From 06a984da073840d92824bfd745bd471597aefa67 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 28 Mar 2018 14:07:53 -0700 Subject: [PATCH 01/42] add new files --- .../google-cloud-compute/pom.xml | 28 + .../compute/deprecated/it/ITComputeTest.java | 3684 ++++++++--------- ...tancesInstanceGroupManagerHttpRequest.java | 441 ++ ...RegionInstanceGroupManagerHttpRequest.java | 441 ++ .../google/cloud/compute/v1/AccessConfig.java | 264 ++ .../AddAccessConfigInstanceHttpRequest.java | 477 +++ .../AddHealthCheckTargetPoolHttpRequest.java | 441 ++ .../v1/AddInstanceTargetPoolHttpRequest.java | 441 ++ .../AddInstancesInstanceGroupHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/Address.java | 480 +++ .../compute/v1/AddressAggregatedList.java | 298 ++ .../cloud/compute/v1/AddressClient.java | 936 +++++ .../google/cloud/compute/v1/AddressList.java | 310 ++ .../google/cloud/compute/v1/AddressName.java | 211 + .../cloud/compute/v1/AddressSettings.java | 283 ++ .../cloud/compute/v1/AddressesScopedList.java | 208 + .../AggregatedListAddressesHttpRequest.java | 543 +++ .../AggregatedListAutoscalersHttpRequest.java | 543 +++ ...regatedListBackendServicesHttpRequest.java | 543 +++ .../AggregatedListDiskTypesHttpRequest.java | 543 +++ .../v1/AggregatedListDisksHttpRequest.java | 543 +++ ...regatedListForwardingRulesHttpRequest.java | 543 +++ ...egatedListGlobalOperationsHttpRequest.java | 543 +++ ...dListInstanceGroupManagersHttpRequest.java | 543 +++ ...gregatedListInstanceGroupsHttpRequest.java | 543 +++ .../AggregatedListInstancesHttpRequest.java | 543 +++ ...AggregatedListMachineTypesHttpRequest.java | 543 +++ .../v1/AggregatedListRoutersHttpRequest.java | 543 +++ .../AggregatedListSubnetworksHttpRequest.java | 543 +++ ...regatedListTargetInstancesHttpRequest.java | 543 +++ .../AggregatedListTargetPoolsHttpRequest.java | 543 +++ ...gatedListTargetVpnGatewaysHttpRequest.java | 543 +++ .../AggregatedListVpnTunnelsHttpRequest.java | 543 +++ .../com/google/cloud/compute/v1/Allowed.java | 208 + .../v1/AttachDiskInstanceHttpRequest.java | 441 ++ .../google/cloud/compute/v1/AttachedDisk.java | 548 +++ .../v1/AttachedDiskInitializeParams.java | 298 ++ .../google/cloud/compute/v1/Autoscaler.java | 468 +++ .../compute/v1/AutoscalerAggregatedList.java | 298 ++ .../cloud/compute/v1/AutoscalerClient.java | 1166 ++++++ .../cloud/compute/v1/AutoscalerList.java | 310 ++ .../cloud/compute/v1/AutoscalerName.java | 211 + .../cloud/compute/v1/AutoscalerSettings.java | 311 ++ .../compute/v1/AutoscalersScopedList.java | 208 + .../cloud/compute/v1/AutoscalingPolicy.java | 344 ++ .../v1/AutoscalingPolicyCpuUtilization.java | 162 + ...oscalingPolicyCustomMetricUtilization.java | 230 + ...scalingPolicyLoadBalancingUtilization.java | 162 + .../com/google/cloud/compute/v1/Backend.java | 434 ++ .../cloud/compute/v1/BackendService.java | 798 ++++ .../v1/BackendServiceAggregatedList.java | 298 ++ .../compute/v1/BackendServiceClient.java | 1251 ++++++ .../compute/v1/BackendServiceGroupHealth.java | 208 + .../cloud/compute/v1/BackendServiceList.java | 310 ++ .../cloud/compute/v1/BackendServiceName.java | 187 + .../compute/v1/BackendServiceSettings.java | 325 ++ .../compute/v1/BackendServicesScopedList.java | 208 + .../compute/v1/CacheInvalidationRule.java | 196 + .../cloud/compute/v1/ConnectionDraining.java | 162 + .../v1/CreateSnapshotDiskHttpRequest.java | 441 ++ .../compute/v1/CustomerEncryptionKey.java | 196 + .../CustomerEncryptionKeyProtectedDisk.java | 196 + .../com/google/cloud/compute/v1/Data.java | 196 + ...DeleteAccessConfigInstanceHttpRequest.java | 479 +++ .../compute/v1/DeleteAddressHttpRequest.java | 407 ++ .../v1/DeleteAutoscalerHttpRequest.java | 407 ++ .../v1/DeleteBackendServiceHttpRequest.java | 407 ++ .../compute/v1/DeleteDiskHttpRequest.java | 407 ++ .../compute/v1/DeleteFirewallHttpRequest.java | 407 ++ .../v1/DeleteForwardingRuleHttpRequest.java | 407 ++ .../v1/DeleteGlobalAddressHttpRequest.java | 407 ++ ...DeleteGlobalForwardingRuleHttpRequest.java | 407 ++ .../v1/DeleteGlobalOperationHttpRequest.java | 407 ++ .../v1/DeleteHealthCheckHttpRequest.java | 407 ++ .../v1/DeleteHttpHealthCheckHttpRequest.java | 407 ++ .../v1/DeleteHttpsHealthCheckHttpRequest.java | 407 ++ .../compute/v1/DeleteImageHttpRequest.java | 407 ++ .../v1/DeleteInstanceGroupHttpRequest.java | 407 ++ ...DeleteInstanceGroupManagerHttpRequest.java | 407 ++ .../compute/v1/DeleteInstanceHttpRequest.java | 407 ++ .../v1/DeleteInstanceTemplateHttpRequest.java | 407 ++ ...tancesInstanceGroupManagerHttpRequest.java | 441 ++ ...RegionInstanceGroupManagerHttpRequest.java | 441 ++ .../compute/v1/DeleteNetworkHttpRequest.java | 407 ++ .../v1/DeleteRegionAutoscalerHttpRequest.java | 407 ++ ...DeleteRegionBackendServiceHttpRequest.java | 407 ++ ...RegionInstanceGroupManagerHttpRequest.java | 407 ++ .../v1/DeleteRegionOperationHttpRequest.java | 407 ++ .../compute/v1/DeleteRouteHttpRequest.java | 407 ++ .../compute/v1/DeleteRouterHttpRequest.java | 407 ++ .../compute/v1/DeleteSnapshotHttpRequest.java | 407 ++ .../v1/DeleteSslCertificateHttpRequest.java | 407 ++ .../v1/DeleteSubnetworkHttpRequest.java | 407 ++ .../v1/DeleteTargetHttpProxyHttpRequest.java | 407 ++ .../v1/DeleteTargetHttpsProxyHttpRequest.java | 407 ++ .../v1/DeleteTargetInstanceHttpRequest.java | 407 ++ .../v1/DeleteTargetPoolHttpRequest.java | 407 ++ .../v1/DeleteTargetSslProxyHttpRequest.java | 407 ++ .../v1/DeleteTargetVpnGatewayHttpRequest.java | 407 ++ .../compute/v1/DeleteUrlMapHttpRequest.java | 407 ++ .../v1/DeleteVpnTunnelHttpRequest.java | 407 ++ .../v1/DeleteZoneOperationHttpRequest.java | 407 ++ .../compute/v1/DeprecateImageHttpRequest.java | 441 ++ .../cloud/compute/v1/DeprecationStatus.java | 298 ++ .../v1/DetachDiskInstanceHttpRequest.java | 443 ++ .../com/google/cloud/compute/v1/Disk.java | 900 ++++ .../cloud/compute/v1/DiskAggregatedList.java | 298 ++ .../google/cloud/compute/v1/DiskClient.java | 1157 ++++++ .../com/google/cloud/compute/v1/DiskList.java | 310 ++ .../cloud/compute/v1/DiskMoveRequest.java | 196 + .../com/google/cloud/compute/v1/DiskName.java | 211 + .../google/cloud/compute/v1/DiskSettings.java | 311 ++ .../com/google/cloud/compute/v1/DiskType.java | 468 +++ .../compute/v1/DiskTypeAggregatedList.java | 298 ++ .../cloud/compute/v1/DiskTypeClient.java | 736 ++++ .../google/cloud/compute/v1/DiskTypeList.java | 310 ++ .../google/cloud/compute/v1/DiskTypeName.java | 211 + .../cloud/compute/v1/DiskTypeSettings.java | 255 ++ .../cloud/compute/v1/DiskTypesScopedList.java | 208 + .../cloud/compute/v1/DisksResizeRequest.java | 162 + .../cloud/compute/v1/DisksScopedList.java | 208 + .../com/google/cloud/compute/v1/Error.java | 174 + .../com/google/cloud/compute/v1/Errors.java | 230 + ...xpandIpCidrRangeSubnetworkHttpRequest.java | 441 ++ .../google/cloud/compute/v1/FamilyName.java | 187 + .../com/google/cloud/compute/v1/Firewall.java | 550 +++ .../cloud/compute/v1/FirewallClient.java | 926 +++++ .../google/cloud/compute/v1/FirewallList.java | 310 ++ .../google/cloud/compute/v1/FirewallName.java | 187 + .../cloud/compute/v1/FirewallSettings.java | 296 ++ .../cloud/compute/v1/ForwardingRule.java | 684 +++ .../v1/ForwardingRuleAggregatedList.java | 298 ++ .../compute/v1/ForwardingRuleClient.java | 1041 +++++ .../cloud/compute/v1/ForwardingRuleList.java | 310 ++ .../cloud/compute/v1/ForwardingRuleName.java | 211 + .../compute/v1/ForwardingRuleSettings.java | 297 ++ .../compute/v1/ForwardingRulesScopedList.java | 208 + .../compute/v1/GetAddressHttpRequest.java | 407 ++ .../compute/v1/GetAutoscalerHttpRequest.java | 407 ++ .../v1/GetBackendServiceHttpRequest.java | 407 ++ .../cloud/compute/v1/GetDiskHttpRequest.java | 407 ++ .../compute/v1/GetDiskTypeHttpRequest.java | 407 ++ .../compute/v1/GetFirewallHttpRequest.java | 407 ++ .../v1/GetForwardingRuleHttpRequest.java | 407 ++ .../v1/GetFromFamilyImageHttpRequest.java | 407 ++ .../v1/GetGlobalAddressHttpRequest.java | 407 ++ .../GetGlobalForwardingRuleHttpRequest.java | 407 ++ .../v1/GetGlobalOperationHttpRequest.java | 407 ++ .../GetHealthBackendServiceHttpRequest.java | 441 ++ .../compute/v1/GetHealthCheckHttpRequest.java | 407 ++ ...HealthRegionBackendServiceHttpRequest.java | 441 ++ .../v1/GetHealthTargetPoolHttpRequest.java | 441 ++ .../v1/GetHttpHealthCheckHttpRequest.java | 407 ++ .../v1/GetHttpsHealthCheckHttpRequest.java | 407 ++ .../cloud/compute/v1/GetImageHttpRequest.java | 407 ++ .../v1/GetInstanceGroupHttpRequest.java | 407 ++ .../GetInstanceGroupManagerHttpRequest.java | 407 ++ .../compute/v1/GetInstanceHttpRequest.java | 407 ++ .../v1/GetInstanceTemplateHttpRequest.java | 407 ++ .../compute/v1/GetLicensHttpRequest.java | 407 ++ .../compute/v1/GetMachineTypeHttpRequest.java | 407 ++ .../compute/v1/GetNetworkHttpRequest.java | 407 ++ .../compute/v1/GetProjectHttpRequest.java | 407 ++ .../v1/GetRegionAutoscalerHttpRequest.java | 407 ++ .../GetRegionBackendServiceHttpRequest.java | 407 ++ .../compute/v1/GetRegionHttpRequest.java | 407 ++ .../v1/GetRegionInstanceGroupHttpRequest.java | 407 ++ ...RegionInstanceGroupManagerHttpRequest.java | 407 ++ .../v1/GetRegionOperationHttpRequest.java | 407 ++ .../cloud/compute/v1/GetRouteHttpRequest.java | 407 ++ .../compute/v1/GetRouterHttpRequest.java | 407 ++ .../v1/GetRouterStatusRouterHttpRequest.java | 407 ++ ...etSerialPortOutputInstanceHttpRequest.java | 475 +++ .../compute/v1/GetSnapshotHttpRequest.java | 407 ++ .../v1/GetSslCertificateHttpRequest.java | 407 ++ .../compute/v1/GetSubnetworkHttpRequest.java | 407 ++ .../v1/GetTargetHttpProxyHttpRequest.java | 407 ++ .../v1/GetTargetHttpsProxyHttpRequest.java | 407 ++ .../v1/GetTargetInstanceHttpRequest.java | 407 ++ .../compute/v1/GetTargetPoolHttpRequest.java | 407 ++ .../v1/GetTargetSslProxyHttpRequest.java | 407 ++ .../v1/GetTargetVpnGatewayHttpRequest.java | 407 ++ .../compute/v1/GetUrlMapHttpRequest.java | 407 ++ .../compute/v1/GetVpnTunnelHttpRequest.java | 407 ++ .../cloud/compute/v1/GetZoneHttpRequest.java | 407 ++ .../v1/GetZoneOperationHttpRequest.java | 407 ++ .../cloud/compute/v1/GlobalAddressClient.java | 716 ++++ .../compute/v1/GlobalAddressSettings.java | 268 ++ .../v1/GlobalForwardingRuleClient.java | 821 ++++ .../v1/GlobalForwardingRuleSettings.java | 282 ++ .../compute/v1/GlobalOperationClient.java | 831 ++++ .../compute/v1/GlobalOperationSettings.java | 269 ++ .../cloud/compute/v1/GuestOsFeature.java | 162 + .../cloud/compute/v1/HTTPHealthCheck.java | 298 ++ .../cloud/compute/v1/HTTPSHealthCheck.java | 298 ++ .../google/cloud/compute/v1/HealthCheck.java | 638 +++ .../cloud/compute/v1/HealthCheckClient.java | 926 +++++ .../cloud/compute/v1/HealthCheckList.java | 310 ++ .../cloud/compute/v1/HealthCheckName.java | 187 + .../compute/v1/HealthCheckReference.java | 162 + .../cloud/compute/v1/HealthCheckSettings.java | 296 ++ .../google/cloud/compute/v1/HealthStatus.java | 264 ++ .../com/google/cloud/compute/v1/HostRule.java | 242 ++ .../cloud/compute/v1/HttpHealthCheck.java | 570 +++ .../compute/v1/HttpHealthCheckClient.java | 926 +++++ .../cloud/compute/v1/HttpHealthCheckList.java | 310 ++ .../cloud/compute/v1/HttpHealthCheckName.java | 187 + .../compute/v1/HttpHealthCheckSettings.java | 296 ++ .../cloud/compute/v1/HttpsHealthCheck.java | 570 +++ .../compute/v1/HttpsHealthCheckClient.java | 926 +++++ .../compute/v1/HttpsHealthCheckList.java | 310 ++ .../compute/v1/HttpsHealthCheckName.java | 187 + .../compute/v1/HttpsHealthCheckSettings.java | 296 ++ .../com/google/cloud/compute/v1/Image.java | 798 ++++ .../google/cloud/compute/v1/ImageClient.java | 924 +++++ .../google/cloud/compute/v1/ImageList.java | 310 ++ .../google/cloud/compute/v1/ImageName.java | 187 + .../cloud/compute/v1/ImageSettings.java | 296 ++ .../compute/v1/InsertAddressHttpRequest.java | 441 ++ .../v1/InsertAutoscalerHttpRequest.java | 441 ++ .../v1/InsertBackendServiceHttpRequest.java | 441 ++ .../compute/v1/InsertDiskHttpRequest.java | 475 +++ .../compute/v1/InsertFirewallHttpRequest.java | 441 ++ .../v1/InsertForwardingRuleHttpRequest.java | 441 ++ .../v1/InsertGlobalAddressHttpRequest.java | 441 ++ ...InsertGlobalForwardingRuleHttpRequest.java | 441 ++ .../v1/InsertHealthCheckHttpRequest.java | 441 ++ .../v1/InsertHttpHealthCheckHttpRequest.java | 441 ++ .../v1/InsertHttpsHealthCheckHttpRequest.java | 441 ++ .../compute/v1/InsertImageHttpRequest.java | 441 ++ .../v1/InsertInstanceGroupHttpRequest.java | 441 ++ ...InsertInstanceGroupManagerHttpRequest.java | 441 ++ .../compute/v1/InsertInstanceHttpRequest.java | 441 ++ .../v1/InsertInstanceTemplateHttpRequest.java | 441 ++ .../compute/v1/InsertNetworkHttpRequest.java | 441 ++ .../v1/InsertRegionAutoscalerHttpRequest.java | 441 ++ ...InsertRegionBackendServiceHttpRequest.java | 441 ++ ...RegionInstanceGroupManagerHttpRequest.java | 441 ++ .../compute/v1/InsertRouteHttpRequest.java | 441 ++ .../compute/v1/InsertRouterHttpRequest.java | 441 ++ .../v1/InsertSslCertificateHttpRequest.java | 441 ++ .../v1/InsertSubnetworkHttpRequest.java | 441 ++ .../v1/InsertTargetHttpProxyHttpRequest.java | 441 ++ .../v1/InsertTargetHttpsProxyHttpRequest.java | 441 ++ .../v1/InsertTargetInstanceHttpRequest.java | 441 ++ .../v1/InsertTargetPoolHttpRequest.java | 441 ++ .../v1/InsertTargetSslProxyHttpRequest.java | 441 ++ .../v1/InsertTargetVpnGatewayHttpRequest.java | 441 ++ .../compute/v1/InsertUrlMapHttpRequest.java | 441 ++ .../v1/InsertVpnTunnelHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/Instance.java | 776 ++++ .../compute/v1/InstanceAggregatedList.java | 298 ++ .../cloud/compute/v1/InstanceClient.java | 2523 +++++++++++ .../cloud/compute/v1/InstanceGroup.java | 582 +++ .../v1/InstanceGroupAggregatedList.java | 298 ++ .../cloud/compute/v1/InstanceGroupClient.java | 1484 +++++++ .../cloud/compute/v1/InstanceGroupList.java | 310 ++ .../compute/v1/InstanceGroupManager.java | 696 ++++ .../InstanceGroupManagerActionsSummary.java | 400 ++ .../InstanceGroupManagerAggregatedList.java | 298 ++ .../v1/InstanceGroupManagerClient.java | 1662 ++++++++ .../compute/v1/InstanceGroupManagerList.java | 310 ++ .../compute/v1/InstanceGroupManagerName.java | 211 + .../v1/InstanceGroupManagerSettings.java | 381 ++ ...eGroupManagersAbandonInstancesRequest.java | 174 + ...ceGroupManagersDeleteInstancesRequest.java | 174 + ...pManagersListManagedInstancesResponse.java | 174 + ...GroupManagersRecreateInstancesRequest.java | 174 + .../v1/InstanceGroupManagersScopedList.java | 208 + ...oupManagersSetInstanceTemplateRequest.java | 162 + ...nceGroupManagersSetTargetPoolsRequest.java | 208 + .../cloud/compute/v1/InstanceGroupName.java | 211 + .../compute/v1/InstanceGroupSettings.java | 340 ++ .../v1/InstanceGroupsAddInstancesRequest.java | 174 + .../v1/InstanceGroupsListInstances.java | 310 ++ .../InstanceGroupsListInstancesRequest.java | 162 + .../InstanceGroupsRemoveInstancesRequest.java | 174 + .../compute/v1/InstanceGroupsScopedList.java | 208 + .../InstanceGroupsSetNamedPortsRequest.java | 208 + .../google/cloud/compute/v1/InstanceList.java | 310 ++ .../cloud/compute/v1/InstanceMoveRequest.java | 196 + .../google/cloud/compute/v1/InstanceName.java | 211 + .../cloud/compute/v1/InstanceProperties.java | 470 +++ .../cloud/compute/v1/InstanceReference.java | 162 + .../cloud/compute/v1/InstanceSettings.java | 493 +++ .../cloud/compute/v1/InstanceTemplate.java | 366 ++ .../compute/v1/InstanceTemplateClient.java | 716 ++++ .../compute/v1/InstanceTemplateList.java | 310 ++ .../compute/v1/InstanceTemplateName.java | 187 + .../compute/v1/InstanceTemplateSettings.java | 268 ++ .../compute/v1/InstanceWithNamedPorts.java | 242 ++ .../cloud/compute/v1/InstancesScopedList.java | 208 + .../v1/InstancesSetMachineTypeRequest.java | 162 + .../v1/InstancesSetServiceAccountRequest.java | 208 + ...nstancesStartWithEncryptionKeyRequest.java | 174 + .../v1/InvalidateCacheUrlMapHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/Items.java | 196 + .../google/cloud/compute/v1/LicensClient.java | 297 ++ .../cloud/compute/v1/LicensSettings.java | 218 + .../com/google/cloud/compute/v1/License.java | 264 ++ .../google/cloud/compute/v1/LicenseName.java | 187 + .../compute/v1/ListAddressesHttpRequest.java | 543 +++ .../v1/ListAutoscalersHttpRequest.java | 543 +++ .../v1/ListBackendServicesHttpRequest.java | 543 +++ .../compute/v1/ListDiskTypesHttpRequest.java | 543 +++ .../compute/v1/ListDisksHttpRequest.java | 543 +++ .../compute/v1/ListFirewallsHttpRequest.java | 543 +++ .../v1/ListForwardingRulesHttpRequest.java | 543 +++ .../v1/ListGlobalAddressesHttpRequest.java | 543 +++ .../ListGlobalForwardingRulesHttpRequest.java | 543 +++ .../v1/ListGlobalOperationsHttpRequest.java | 543 +++ .../v1/ListHealthChecksHttpRequest.java | 543 +++ .../v1/ListHttpHealthChecksHttpRequest.java | 543 +++ .../v1/ListHttpsHealthChecksHttpRequest.java | 543 +++ .../compute/v1/ListImagesHttpRequest.java | 543 +++ .../ListInstanceGroupManagersHttpRequest.java | 543 +++ .../v1/ListInstanceGroupsHttpRequest.java | 543 +++ .../v1/ListInstanceTemplatesHttpRequest.java | 543 +++ .../compute/v1/ListInstancesHttpRequest.java | 543 +++ ...istInstancesInstanceGroupsHttpRequest.java | 577 +++ ...tancesRegionInstanceGroupsHttpRequest.java | 577 +++ .../v1/ListMachineTypesHttpRequest.java | 543 +++ ...ancesInstanceGroupManagersHttpRequest.java | 543 +++ ...egionInstanceGroupManagersHttpRequest.java | 543 +++ .../compute/v1/ListNetworksHttpRequest.java | 543 +++ .../v1/ListRegionAutoscalersHttpRequest.java | 543 +++ .../ListRegionBackendServicesHttpRequest.java | 543 +++ ...egionInstanceGroupManagersHttpRequest.java | 543 +++ .../ListRegionInstanceGroupsHttpRequest.java | 543 +++ .../v1/ListRegionOperationsHttpRequest.java | 543 +++ .../compute/v1/ListRegionsHttpRequest.java | 543 +++ .../compute/v1/ListRoutersHttpRequest.java | 543 +++ .../compute/v1/ListRoutesHttpRequest.java | 543 +++ .../compute/v1/ListSnapshotsHttpRequest.java | 543 +++ .../v1/ListSslCertificatesHttpRequest.java | 543 +++ .../v1/ListSubnetworksHttpRequest.java | 543 +++ .../v1/ListTargetHttpProxiesHttpRequest.java | 543 +++ .../v1/ListTargetHttpsProxiesHttpRequest.java | 543 +++ .../v1/ListTargetInstancesHttpRequest.java | 543 +++ .../v1/ListTargetPoolsHttpRequest.java | 543 +++ .../v1/ListTargetSslProxiesHttpRequest.java | 543 +++ .../v1/ListTargetVpnGatewaysHttpRequest.java | 543 +++ .../compute/v1/ListUrlMapsHttpRequest.java | 543 +++ .../compute/v1/ListVpnTunnelsHttpRequest.java | 543 +++ .../v1/ListZoneOperationsHttpRequest.java | 543 +++ .../compute/v1/ListZonesHttpRequest.java | 543 +++ .../google/cloud/compute/v1/MachineType.java | 650 +++ .../compute/v1/MachineTypeAggregatedList.java | 298 ++ .../cloud/compute/v1/MachineTypeClient.java | 736 ++++ .../cloud/compute/v1/MachineTypeList.java | 310 ++ .../cloud/compute/v1/MachineTypeName.java | 211 + .../cloud/compute/v1/MachineTypeSettings.java | 255 ++ .../compute/v1/MachineTypesScopedList.java | 208 + .../cloud/compute/v1/ManagedInstance.java | 298 ++ .../v1/ManagedInstanceLastAttempt.java | 162 + .../com/google/cloud/compute/v1/Metadata.java | 242 ++ .../v1/MoveDiskProjectHttpRequest.java | 441 ++ .../v1/MoveInstanceProjectHttpRequest.java | 441 ++ .../google/cloud/compute/v1/NamedPort.java | 196 + .../com/google/cloud/compute/v1/Network.java | 480 +++ .../cloud/compute/v1/NetworkClient.java | 811 ++++ .../cloud/compute/v1/NetworkInterface.java | 344 ++ .../google/cloud/compute/v1/NetworkList.java | 310 ++ .../google/cloud/compute/v1/NetworkName.java | 187 + .../cloud/compute/v1/NetworkSettings.java | 282 ++ .../google/cloud/compute/v1/Operation.java | 922 +++++ .../compute/v1/OperationAggregatedList.java | 298 ++ .../cloud/compute/v1/OperationList.java | 310 ++ .../cloud/compute/v1/OperationName.java | 187 + .../compute/v1/OperationsScopedList.java | 208 + .../v1/PatchAutoscalerHttpRequest.java | 477 +++ .../v1/PatchBackendServiceHttpRequest.java | 441 ++ .../compute/v1/PatchFirewallHttpRequest.java | 441 ++ .../v1/PatchHealthCheckHttpRequest.java | 441 ++ .../v1/PatchHttpHealthCheckHttpRequest.java | 441 ++ .../v1/PatchHttpsHealthCheckHttpRequest.java | 441 ++ .../v1/PatchRegionAutoscalerHttpRequest.java | 477 +++ .../PatchRegionBackendServiceHttpRequest.java | 441 ++ .../compute/v1/PatchRouterHttpRequest.java | 441 ++ .../compute/v1/PatchUrlMapHttpRequest.java | 441 ++ .../google/cloud/compute/v1/PathMatcher.java | 276 ++ .../com/google/cloud/compute/v1/PathRule.java | 208 + .../compute/v1/PreviewRouterHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/Project.java | 526 +++ .../cloud/compute/v1/ProjectAddressName.java | 187 + .../cloud/compute/v1/ProjectClient.java | 717 ++++ .../compute/v1/ProjectForwardingRuleName.java | 187 + .../google/cloud/compute/v1/ProjectName.java | 163 + .../v1/ProjectRegionAutoscalerName.java | 211 + .../v1/ProjectRegionBackendServiceName.java | 211 + ...ProjectRegionInstanceGroupManagerName.java | 211 + .../v1/ProjectRegionInstanceGroupName.java | 211 + .../v1/ProjectRegionOperationName.java | 211 + .../cloud/compute/v1/ProjectSettings.java | 274 ++ .../compute/v1/ProjectZoneOperationName.java | 211 + .../com/google/cloud/compute/v1/Quota.java | 230 + .../com/google/cloud/compute/v1/RawDisk.java | 230 + ...tancesInstanceGroupManagerHttpRequest.java | 441 ++ ...RegionInstanceGroupManagerHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/Region.java | 492 +++ .../compute/v1/RegionAutoscalerClient.java | 946 +++++ .../compute/v1/RegionAutoscalerList.java | 310 ++ .../compute/v1/RegionAutoscalerSettings.java | 296 ++ .../v1/RegionBackendServiceClient.java | 1031 +++++ .../v1/RegionBackendServiceSettings.java | 310 ++ .../google/cloud/compute/v1/RegionClient.java | 516 +++ .../compute/v1/RegionInstanceGroupClient.java | 853 ++++ .../compute/v1/RegionInstanceGroupList.java | 310 ++ .../v1/RegionInstanceGroupManagerClient.java | 1442 +++++++ .../v1/RegionInstanceGroupManagerList.java | 310 ++ .../RegionInstanceGroupManagerSettings.java | 366 ++ ...eGroupManagersAbandonInstancesRequest.java | 174 + ...ceGroupManagersDeleteInstancesRequest.java | 174 + ...nceGroupManagersListInstancesResponse.java | 174 + ...nInstanceGroupManagersRecreateRequest.java | 174 + ...nceGroupManagersSetTargetPoolsRequest.java | 208 + ...stanceGroupManagersSetTemplateRequest.java | 162 + .../v1/RegionInstanceGroupSettings.java | 269 ++ .../v1/RegionInstanceGroupsListInstances.java | 310 ++ ...ionInstanceGroupsListInstancesRequest.java | 196 + ...ionInstanceGroupsSetNamedPortsRequest.java | 208 + .../google/cloud/compute/v1/RegionList.java | 310 ++ .../google/cloud/compute/v1/RegionName.java | 187 + .../compute/v1/RegionOperationClient.java | 611 +++ .../compute/v1/RegionOperationSettings.java | 254 ++ .../cloud/compute/v1/RegionSettings.java | 240 ++ ...emoveHealthCheckTargetPoolHttpRequest.java | 441 ++ .../RemoveInstanceTargetPoolHttpRequest.java | 441 ++ ...moveInstancesInstanceGroupHttpRequest.java | 441 ++ .../compute/v1/ResetInstanceHttpRequest.java | 407 ++ .../compute/v1/ResizeDiskHttpRequest.java | 441 ++ ...ResizeInstanceGroupManagerHttpRequest.java | 443 ++ ...RegionInstanceGroupManagerHttpRequest.java | 443 ++ .../compute/v1/ResourceGroupReference.java | 162 + .../com/google/cloud/compute/v1/Route.java | 696 ++++ .../google/cloud/compute/v1/RouteClient.java | 724 ++++ .../google/cloud/compute/v1/RouteList.java | 310 ++ .../google/cloud/compute/v1/RouteName.java | 187 + .../cloud/compute/v1/RouteSettings.java | 268 ++ .../com/google/cloud/compute/v1/Router.java | 526 +++ .../compute/v1/RouterAggregatedList.java | 298 ++ .../google/cloud/compute/v1/RouterBgp.java | 162 + .../cloud/compute/v1/RouterBgpPeer.java | 332 ++ .../google/cloud/compute/v1/RouterClient.java | 1346 ++++++ .../cloud/compute/v1/RouterInterface.java | 230 + .../google/cloud/compute/v1/RouterList.java | 310 ++ .../google/cloud/compute/v1/RouterName.java | 211 + .../cloud/compute/v1/RouterSettings.java | 339 ++ .../google/cloud/compute/v1/RouterStatus.java | 254 ++ .../compute/v1/RouterStatusBgpPeerStatus.java | 480 +++ .../compute/v1/RouterStatusResponse.java | 196 + .../compute/v1/RoutersPreviewResponse.java | 162 + .../cloud/compute/v1/RoutersScopedList.java | 208 + .../cloud/compute/v1/SSLHealthCheck.java | 298 ++ .../google/cloud/compute/v1/Scheduling.java | 230 + .../google/cloud/compute/v1/ScratchDisks.java | 162 + .../cloud/compute/v1/SerialPortOutput.java | 298 ++ .../cloud/compute/v1/ServiceAccount.java | 208 + ...ckendServiceTargetSslProxyHttpRequest.java | 441 ++ .../v1/SetBackupTargetPoolHttpRequest.java | 475 +++ ...monInstanceMetadataProjectHttpRequest.java | 441 ++ .../SetDiskAutoDeleteInstanceHttpRequest.java | 479 +++ ...mplateInstanceGroupManagerHttpRequest.java | 441 ++ ...RegionInstanceGroupManagerHttpRequest.java | 441 ++ .../v1/SetMachineTypeInstanceHttpRequest.java | 441 ++ .../v1/SetMetadataInstanceHttpRequest.java | 441 ++ ...SetNamedPortsInstanceGroupHttpRequest.java | 441 ++ ...edPortsRegionInstanceGroupHttpRequest.java | 441 ++ ...tProxyHeaderTargetSslProxyHttpRequest.java | 441 ++ .../v1/SetSchedulingInstanceHttpRequest.java | 441 ++ .../SetServiceAccountInstanceHttpRequest.java | 441 ++ ...rtificatesTargetHttpsProxyHttpRequest.java | 441 ++ ...CertificatesTargetSslProxyHttpRequest.java | 441 ++ .../v1/SetTagsInstanceHttpRequest.java | 441 ++ .../SetTargetForwardingRuleHttpRequest.java | 441 ++ ...TargetGlobalForwardingRuleHttpRequest.java | 441 ++ ...tPoolsInstanceGroupManagerHttpRequest.java | 441 ++ ...RegionInstanceGroupManagerHttpRequest.java | 441 ++ .../SetUrlMapTargetHttpProxyHttpRequest.java | 441 ++ .../SetUrlMapTargetHttpsProxyHttpRequest.java | 441 ++ ...etUsageExportBucketProjectHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/Snapshot.java | 650 +++ .../cloud/compute/v1/SnapshotClient.java | 619 +++ .../google/cloud/compute/v1/SnapshotList.java | 310 ++ .../google/cloud/compute/v1/SnapshotName.java | 187 + .../cloud/compute/v1/SnapshotSettings.java | 254 ++ .../cloud/compute/v1/SslCertificate.java | 400 ++ .../compute/v1/SslCertificateClient.java | 716 ++++ .../cloud/compute/v1/SslCertificateList.java | 310 ++ .../cloud/compute/v1/SslCertificateName.java | 187 + .../compute/v1/SslCertificateSettings.java | 268 ++ .../compute/v1/StartInstanceHttpRequest.java | 407 ++ ...tWithEncryptionKeyInstanceHttpRequest.java | 441 ++ .../compute/v1/StopInstanceHttpRequest.java | 407 ++ .../google/cloud/compute/v1/Subnetwork.java | 468 +++ .../compute/v1/SubnetworkAggregatedList.java | 298 ++ .../cloud/compute/v1/SubnetworkClient.java | 1041 +++++ .../cloud/compute/v1/SubnetworkList.java | 310 ++ .../cloud/compute/v1/SubnetworkName.java | 211 + .../cloud/compute/v1/SubnetworkSettings.java | 297 ++ .../SubnetworksExpandIpCidrRangeRequest.java | 162 + .../compute/v1/SubnetworksScopedList.java | 208 + .../SwitchToCustomModeNetworkHttpRequest.java | 407 ++ .../cloud/compute/v1/TCPHealthCheck.java | 298 ++ .../com/google/cloud/compute/v1/Tags.java | 208 + .../cloud/compute/v1/TargetHttpProxy.java | 366 ++ .../compute/v1/TargetHttpProxyClient.java | 821 ++++ .../cloud/compute/v1/TargetHttpProxyList.java | 310 ++ .../cloud/compute/v1/TargetHttpProxyName.java | 187 + .../compute/v1/TargetHttpProxySettings.java | 282 ++ ...HttpsProxiesSetSslCertificatesRequest.java | 174 + .../cloud/compute/v1/TargetHttpsProxy.java | 412 ++ .../compute/v1/TargetHttpsProxyClient.java | 926 +++++ .../compute/v1/TargetHttpsProxyList.java | 310 ++ .../compute/v1/TargetHttpsProxyName.java | 187 + .../compute/v1/TargetHttpsProxySettings.java | 296 ++ .../cloud/compute/v1/TargetInstance.java | 434 ++ .../v1/TargetInstanceAggregatedList.java | 298 ++ .../compute/v1/TargetInstanceClient.java | 936 +++++ .../cloud/compute/v1/TargetInstanceList.java | 310 ++ .../cloud/compute/v1/TargetInstanceName.java | 211 + .../compute/v1/TargetInstanceSettings.java | 283 ++ .../compute/v1/TargetInstancesScopedList.java | 208 + .../google/cloud/compute/v1/TargetPool.java | 560 +++ .../compute/v1/TargetPoolAggregatedList.java | 298 ++ .../cloud/compute/v1/TargetPoolClient.java | 1577 +++++++ .../compute/v1/TargetPoolInstanceHealth.java | 208 + .../cloud/compute/v1/TargetPoolList.java | 310 ++ .../cloud/compute/v1/TargetPoolName.java | 211 + .../cloud/compute/v1/TargetPoolSettings.java | 367 ++ .../v1/TargetPoolsAddHealthCheckRequest.java | 174 + .../v1/TargetPoolsAddInstanceRequest.java | 174 + .../TargetPoolsRemoveHealthCheckRequest.java | 174 + .../v1/TargetPoolsRemoveInstanceRequest.java | 174 + .../compute/v1/TargetPoolsScopedList.java | 208 + .../cloud/compute/v1/TargetReference.java | 162 + ...getSslProxiesSetBackendServiceRequest.java | 162 + ...TargetSslProxiesSetProxyHeaderRequest.java | 162 + ...etSslProxiesSetSslCertificatesRequest.java | 174 + .../cloud/compute/v1/TargetSslProxy.java | 446 ++ .../compute/v1/TargetSslProxyClient.java | 1031 +++++ .../cloud/compute/v1/TargetSslProxyList.java | 310 ++ .../cloud/compute/v1/TargetSslProxyName.java | 187 + .../compute/v1/TargetSslProxySettings.java | 310 ++ .../cloud/compute/v1/TargetVpnGateway.java | 526 +++ .../v1/TargetVpnGatewayAggregatedList.java | 298 ++ .../compute/v1/TargetVpnGatewayClient.java | 936 +++++ .../compute/v1/TargetVpnGatewayList.java | 310 ++ .../compute/v1/TargetVpnGatewayName.java | 211 + .../compute/v1/TargetVpnGatewaySettings.java | 283 ++ .../v1/TargetVpnGatewaysScopedList.java | 208 + .../google/cloud/compute/v1/TestFailure.java | 264 ++ .../v1/UpdateAutoscalerHttpRequest.java | 475 +++ .../v1/UpdateBackendServiceHttpRequest.java | 441 ++ .../compute/v1/UpdateFirewallHttpRequest.java | 441 ++ .../v1/UpdateHealthCheckHttpRequest.java | 441 ++ .../v1/UpdateHttpHealthCheckHttpRequest.java | 441 ++ .../v1/UpdateHttpsHealthCheckHttpRequest.java | 441 ++ .../v1/UpdateRegionAutoscalerHttpRequest.java | 475 +++ ...UpdateRegionBackendServiceHttpRequest.java | 441 ++ .../compute/v1/UpdateRouterHttpRequest.java | 441 ++ .../compute/v1/UpdateUrlMapHttpRequest.java | 441 ++ .../com/google/cloud/compute/v1/UrlMap.java | 538 +++ .../google/cloud/compute/v1/UrlMapClient.java | 1136 +++++ .../google/cloud/compute/v1/UrlMapList.java | 310 ++ .../google/cloud/compute/v1/UrlMapName.java | 187 + .../cloud/compute/v1/UrlMapReference.java | 162 + .../cloud/compute/v1/UrlMapSettings.java | 324 ++ .../google/cloud/compute/v1/UrlMapTest.java | 264 ++ .../compute/v1/UrlMapValidationResult.java | 288 ++ .../compute/v1/UrlMapsValidateRequest.java | 162 + .../compute/v1/UrlMapsValidateResponse.java | 162 + .../cloud/compute/v1/UsageExportLocation.java | 196 + .../compute/v1/ValidateUrlMapHttpRequest.java | 441 ++ .../google/cloud/compute/v1/VpnTunnel.java | 730 ++++ .../compute/v1/VpnTunnelAggregatedList.java | 298 ++ .../cloud/compute/v1/VpnTunnelClient.java | 936 +++++ .../cloud/compute/v1/VpnTunnelList.java | 310 ++ .../cloud/compute/v1/VpnTunnelName.java | 211 + .../cloud/compute/v1/VpnTunnelSettings.java | 283 ++ .../compute/v1/VpnTunnelsScopedList.java | 208 + .../com/google/cloud/compute/v1/Warning.java | 242 ++ .../com/google/cloud/compute/v1/Warnings.java | 242 ++ .../com/google/cloud/compute/v1/Zone.java | 434 ++ .../google/cloud/compute/v1/ZoneClient.java | 516 +++ .../com/google/cloud/compute/v1/ZoneList.java | 310 ++ .../com/google/cloud/compute/v1/ZoneName.java | 187 + .../cloud/compute/v1/ZoneOperationClient.java | 611 +++ .../compute/v1/ZoneOperationSettings.java | 254 ++ .../google/cloud/compute/v1/ZoneSettings.java | 240 ++ .../google/cloud/compute/v1/package-info.java | 719 ++++ .../cloud/compute/v1/stub/AddressStub.java | 84 + .../compute/v1/stub/AddressStubSettings.java | 526 +++ .../cloud/compute/v1/stub/AutoscalerStub.java | 96 + .../v1/stub/AutoscalerStubSettings.java | 580 +++ .../compute/v1/stub/BackendServiceStub.java | 103 + .../v1/stub/BackendServiceStubSettings.java | 608 +++ .../cloud/compute/v1/stub/DiskStub.java | 98 + .../compute/v1/stub/DiskStubSettings.java | 580 +++ .../cloud/compute/v1/stub/DiskTypeStub.java | 71 + .../compute/v1/stub/DiskTypeStubSettings.java | 471 +++ .../cloud/compute/v1/stub/FirewallStub.java | 81 + .../compute/v1/stub/FirewallStubSettings.java | 501 +++ .../compute/v1/stub/ForwardingRuleStub.java | 91 + .../v1/stub/ForwardingRuleStubSettings.java | 553 +++ .../compute/v1/stub/GlobalAddressStub.java | 69 + .../v1/stub/GlobalAddressStubSettings.java | 447 ++ .../v1/stub/GlobalForwardingRuleStub.java | 76 + .../GlobalForwardingRuleStubSettings.java | 474 +++ .../compute/v1/stub/GlobalOperationStub.java | 76 + .../v1/stub/GlobalOperationStubSettings.java | 498 +++ .../compute/v1/stub/HealthCheckStub.java | 81 + .../v1/stub/HealthCheckStubSettings.java | 501 +++ .../compute/v1/stub/HttpHealthCheckStub.java | 81 + .../v1/stub/HttpHealthCheckStubSettings.java | 501 +++ .../stub/HttpJsonAddressCallableFactory.java | 101 + .../compute/v1/stub/HttpJsonAddressStub.java | 300 ++ .../HttpJsonAutoscalerCallableFactory.java | 103 + .../v1/stub/HttpJsonAutoscalerStub.java | 364 ++ ...HttpJsonBackendServiceCallableFactory.java | 105 + .../v1/stub/HttpJsonBackendServiceStub.java | 394 ++ .../v1/stub/HttpJsonDiskCallableFactory.java | 105 + .../compute/v1/stub/HttpJsonDiskStub.java | 365 ++ .../stub/HttpJsonDiskTypeCallableFactory.java | 99 + .../compute/v1/stub/HttpJsonDiskTypeStub.java | 237 ++ .../stub/HttpJsonFirewallCallableFactory.java | 98 + .../compute/v1/stub/HttpJsonFirewallStub.java | 319 ++ ...HttpJsonForwardingRuleCallableFactory.java | 103 + .../v1/stub/HttpJsonForwardingRuleStub.java | 332 ++ .../HttpJsonGlobalAddressCallableFactory.java | 96 + .../v1/stub/HttpJsonGlobalAddressStub.java | 257 ++ ...onGlobalForwardingRuleCallableFactory.java | 98 + .../HttpJsonGlobalForwardingRuleStub.java | 289 ++ ...ttpJsonGlobalOperationCallableFactory.java | 98 + .../v1/stub/HttpJsonGlobalOperationStub.java | 263 ++ .../HttpJsonHealthCheckCallableFactory.java | 98 + .../v1/stub/HttpJsonHealthCheckStub.java | 319 ++ ...ttpJsonHttpHealthCheckCallableFactory.java | 98 + .../v1/stub/HttpJsonHttpHealthCheckStub.java | 319 ++ ...tpJsonHttpsHealthCheckCallableFactory.java | 98 + .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 319 ++ .../v1/stub/HttpJsonImageCallableFactory.java | 100 + .../compute/v1/stub/HttpJsonImageStub.java | 321 ++ .../stub/HttpJsonInstanceCallableFactory.java | 125 + .../HttpJsonInstanceGroupCallableFactory.java | 112 + ...onInstanceGroupManagerCallableFactory.java | 114 + .../HttpJsonInstanceGroupManagerStub.java | 525 +++ .../v1/stub/HttpJsonInstanceGroupStub.java | 439 ++ .../compute/v1/stub/HttpJsonInstanceStub.java | 779 ++++ ...tpJsonInstanceTemplateCallableFactory.java | 96 + .../v1/stub/HttpJsonInstanceTemplateStub.java | 257 ++ .../stub/HttpJsonLicensCallableFactory.java | 90 + .../compute/v1/stub/HttpJsonLicensStub.java | 152 + .../HttpJsonMachineTypeCallableFactory.java | 99 + .../v1/stub/HttpJsonMachineTypeStub.java | 237 ++ .../stub/HttpJsonNetworkCallableFactory.java | 97 + .../compute/v1/stub/HttpJsonNetworkStub.java | 288 ++ .../stub/HttpJsonProjectCallableFactory.java | 98 + .../compute/v1/stub/HttpJsonProjectStub.java | 281 ++ ...tpJsonRegionAutoscalerCallableFactory.java | 98 + .../v1/stub/HttpJsonRegionAutoscalerStub.java | 321 ++ ...onRegionBackendServiceCallableFactory.java | 101 + .../HttpJsonRegionBackendServiceStub.java | 352 ++ .../stub/HttpJsonRegionCallableFactory.java | 94 + ...sonRegionInstanceGroupCallableFactory.java | 101 + ...onInstanceGroupManagerCallableFactory.java | 109 + ...ttpJsonRegionInstanceGroupManagerStub.java | 482 +++ .../stub/HttpJsonRegionInstanceGroupStub.java | 270 ++ ...ttpJsonRegionOperationCallableFactory.java | 94 + .../v1/stub/HttpJsonRegionOperationStub.java | 221 + .../compute/v1/stub/HttpJsonRegionStub.java | 194 + .../v1/stub/HttpJsonRouteCallableFactory.java | 96 + .../compute/v1/stub/HttpJsonRouteStub.java | 257 ++ .../stub/HttpJsonRouterCallableFactory.java | 107 + .../compute/v1/stub/HttpJsonRouterStub.java | 426 ++ .../stub/HttpJsonSnapshotCallableFactory.java | 95 + .../compute/v1/stub/HttpJsonSnapshotStub.java | 226 + ...HttpJsonSslCertificateCallableFactory.java | 96 + .../v1/stub/HttpJsonSslCertificateStub.java | 257 ++ .../HttpJsonSubnetworkCallableFactory.java | 103 + .../v1/stub/HttpJsonSubnetworkStub.java | 332 ++ ...ttpJsonTargetHttpProxyCallableFactory.java | 98 + .../v1/stub/HttpJsonTargetHttpProxyStub.java | 289 ++ ...tpJsonTargetHttpsProxyCallableFactory.java | 100 + .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 321 ++ ...HttpJsonTargetInstanceCallableFactory.java | 101 + .../v1/stub/HttpJsonTargetInstanceStub.java | 300 ++ .../HttpJsonTargetPoolCallableFactory.java | 114 + .../v1/stub/HttpJsonTargetPoolStub.java | 494 +++ ...HttpJsonTargetSslProxyCallableFactory.java | 102 + .../v1/stub/HttpJsonTargetSslProxyStub.java | 353 ++ ...tpJsonTargetVpnGatewayCallableFactory.java | 101 + .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 300 ++ .../stub/HttpJsonUrlMapCallableFactory.java | 103 + .../compute/v1/stub/HttpJsonUrlMapStub.java | 384 ++ .../HttpJsonVpnTunnelCallableFactory.java | 101 + .../v1/stub/HttpJsonVpnTunnelStub.java | 300 ++ .../v1/stub/HttpJsonZoneCallableFactory.java | 94 + .../HttpJsonZoneOperationCallableFactory.java | 94 + .../v1/stub/HttpJsonZoneOperationStub.java | 221 + .../compute/v1/stub/HttpJsonZoneStub.java | 194 + .../compute/v1/stub/HttpsHealthCheckStub.java | 81 + .../v1/stub/HttpsHealthCheckStubSettings.java | 501 +++ .../cloud/compute/v1/stub/ImageStub.java | 83 + .../compute/v1/stub/ImageStubSettings.java | 501 +++ .../v1/stub/InstanceGroupManagerStub.java | 132 + .../InstanceGroupManagerStubSettings.java | 716 ++++ .../compute/v1/stub/InstanceGroupStub.java | 120 + .../v1/stub/InstanceGroupStubSettings.java | 686 +++ .../cloud/compute/v1/stub/InstanceStub.java | 183 + .../compute/v1/stub/InstanceStubSettings.java | 932 +++++ .../compute/v1/stub/InstanceTemplateStub.java | 69 + .../v1/stub/InstanceTemplateStubSettings.java | 447 ++ .../cloud/compute/v1/stub/LicensStub.java | 42 + .../compute/v1/stub/LicensStubSettings.java | 309 ++ .../compute/v1/stub/MachineTypeStub.java | 71 + .../v1/stub/MachineTypeStubSettings.java | 471 +++ .../cloud/compute/v1/stub/NetworkStub.java | 75 + .../compute/v1/stub/NetworkStubSettings.java | 474 +++ .../cloud/compute/v1/stub/ProjectStub.java | 71 + .../compute/v1/stub/ProjectStubSettings.java | 418 ++ .../compute/v1/stub/RegionAutoscalerStub.java | 81 + .../v1/stub/RegionAutoscalerStubSettings.java | 501 +++ .../v1/stub/RegionBackendServiceStub.java | 89 + .../RegionBackendServiceStubSettings.java | 529 +++ .../stub/RegionInstanceGroupManagerStub.java | 117 + ...egionInstanceGroupManagerStubSettings.java | 637 +++ .../v1/stub/RegionInstanceGroupStub.java | 79 + .../stub/RegionInstanceGroupStubSettings.java | 499 +++ .../compute/v1/stub/RegionOperationStub.java | 62 + .../v1/stub/RegionOperationStubSettings.java | 419 ++ .../cloud/compute/v1/stub/RegionStub.java | 56 + .../compute/v1/stub/RegionStubSettings.java | 392 ++ .../cloud/compute/v1/stub/RouteStub.java | 69 + .../compute/v1/stub/RouteStubSettings.java | 447 ++ .../cloud/compute/v1/stub/RouterStub.java | 110 + .../compute/v1/stub/RouterStubSettings.java | 636 +++ .../cloud/compute/v1/stub/SnapshotStub.java | 63 + .../compute/v1/stub/SnapshotStubSettings.java | 420 ++ .../compute/v1/stub/SslCertificateStub.java | 69 + .../v1/stub/SslCertificateStubSettings.java | 447 ++ .../cloud/compute/v1/stub/SubnetworkStub.java | 91 + .../v1/stub/SubnetworkStubSettings.java | 553 +++ .../compute/v1/stub/TargetHttpProxyStub.java | 76 + .../v1/stub/TargetHttpProxyStubSettings.java | 474 +++ .../compute/v1/stub/TargetHttpsProxyStub.java | 83 + .../v1/stub/TargetHttpsProxyStubSettings.java | 501 +++ .../compute/v1/stub/TargetInstanceStub.java | 84 + .../v1/stub/TargetInstanceStubSettings.java | 526 +++ .../cloud/compute/v1/stub/TargetPoolStub.java | 127 + .../v1/stub/TargetPoolStubSettings.java | 689 +++ .../compute/v1/stub/TargetSslProxyStub.java | 90 + .../v1/stub/TargetSslProxyStubSettings.java | 528 +++ .../compute/v1/stub/TargetVpnGatewayStub.java | 84 + .../v1/stub/TargetVpnGatewayStubSettings.java | 526 +++ .../cloud/compute/v1/stub/UrlMapStub.java | 96 + .../compute/v1/stub/UrlMapStubSettings.java | 556 +++ .../cloud/compute/v1/stub/VpnTunnelStub.java | 84 + .../v1/stub/VpnTunnelStubSettings.java | 526 +++ .../compute/v1/stub/ZoneOperationStub.java | 62 + .../v1/stub/ZoneOperationStubSettings.java | 419 ++ .../cloud/compute/v1/stub/ZoneStub.java | 56 + .../compute/v1/stub/ZoneStubSettings.java | 392 ++ .../cloud/compute/v1/AddressClientTest.java | 409 ++ .../compute/v1/AutoscalerClientTest.java | 581 +++ .../compute/v1/BackendServiceClientTest.java | 635 +++ .../cloud/compute/v1/DiskClientTest.java | 595 +++ .../cloud/compute/v1/DiskTypeClientTest.java | 243 ++ .../cloud/compute/v1/FirewallClientTest.java | 517 +++ .../compute/v1/ForwardingRuleClientTest.java | 505 +++ .../compute/v1/GlobalAddressClientTest.java | 353 ++ .../v1/GlobalForwardingRuleClientTest.java | 449 ++ .../compute/v1/GlobalOperationClientTest.java | 303 ++ .../compute/v1/HealthCheckClientTest.java | 525 +++ .../compute/v1/HttpHealthCheckClientTest.java | 529 +++ .../v1/HttpsHealthCheckClientTest.java | 529 +++ .../cloud/compute/v1/ImageClientTest.java | 511 +++ .../cloud/compute/v1/InstanceClientTest.java | 1645 ++++++++ .../compute/v1/InstanceGroupClientTest.java | 724 ++++ .../v1/InstanceGroupManagerClientTest.java | 960 +++++ .../v1/InstanceTemplateClientTest.java | 347 ++ .../cloud/compute/v1/LicensClientTest.java | 122 + .../compute/v1/MachineTypeClientTest.java | 251 ++ .../cloud/compute/v1/NetworkClientTest.java | 435 ++ .../cloud/compute/v1/ProjectClientTest.java | 464 +++ .../v1/RegionAutoscalerClientTest.java | 525 +++ .../v1/RegionBackendServiceClientTest.java | 579 +++ .../cloud/compute/v1/RegionClientTest.java | 183 + .../v1/RegionInstanceGroupClientTest.java | 334 ++ .../RegionInstanceGroupManagerClientTest.java | 904 ++++ .../compute/v1/RegionOperationClientTest.java | 247 ++ .../cloud/compute/v1/RouteClientTest.java | 363 ++ .../cloud/compute/v1/RouterClientTest.java | 658 +++ .../cloud/compute/v1/SnapshotClientTest.java | 275 ++ .../compute/v1/SslCertificateClientTest.java | 351 ++ .../compute/v1/SubnetworkClientTest.java | 495 +++ .../compute/v1/TargetHttpProxyClientTest.java | 433 ++ .../v1/TargetHttpsProxyClientTest.java | 517 +++ .../compute/v1/TargetInstanceClientTest.java | 409 ++ .../compute/v1/TargetPoolClientTest.java | 877 ++++ .../compute/v1/TargetSslProxyClientTest.java | 603 +++ .../v1/TargetVpnGatewayClientTest.java | 409 ++ .../cloud/compute/v1/UrlMapClientTest.java | 644 +++ .../cloud/compute/v1/VpnTunnelClientTest.java | 421 ++ .../cloud/compute/v1/ZoneClientTest.java | 185 + .../compute/v1/ZoneOperationClientTest.java | 247 ++ .../cloud/compute/v1/it/ITComputeTest.java | 151 + 807 files changed, 308695 insertions(+), 1842 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index 854684f2568c..42d87a5da316 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -43,6 +43,34 @@ test-jar test + + + com.google.api + gax-httpjson + + + com.google.api + gax-httpjson + testlib + test + + + com.google.api + gax + + + com.google.api + gax + testlib + + + + + org.threeten + threetenbp + 1.3.3 + + junit junit diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java index 943d915ced9c..18116a7a4a8f 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java @@ -1,1842 +1,1842 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.paging.Page; -import com.google.cloud.compute.deprecated.Address; -import com.google.cloud.compute.deprecated.AddressId; -import com.google.cloud.compute.deprecated.AddressInfo; -import com.google.cloud.compute.deprecated.AttachedDisk; -import com.google.cloud.compute.deprecated.Compute; -import com.google.cloud.compute.deprecated.DeprecationStatus; -import com.google.cloud.compute.deprecated.Disk; -import com.google.cloud.compute.deprecated.DiskConfiguration; -import com.google.cloud.compute.deprecated.DiskId; -import com.google.cloud.compute.deprecated.DiskImageConfiguration; -import com.google.cloud.compute.deprecated.DiskInfo; -import com.google.cloud.compute.deprecated.DiskType; -import com.google.cloud.compute.deprecated.DiskTypeId; -import com.google.cloud.compute.deprecated.GlobalAddressId; -import com.google.cloud.compute.deprecated.Image; -import com.google.cloud.compute.deprecated.ImageConfiguration; -import com.google.cloud.compute.deprecated.ImageDiskConfiguration; -import com.google.cloud.compute.deprecated.ImageId; -import com.google.cloud.compute.deprecated.ImageInfo; -import com.google.cloud.compute.deprecated.Instance; -import com.google.cloud.compute.deprecated.InstanceId; -import com.google.cloud.compute.deprecated.InstanceInfo; -import com.google.cloud.compute.deprecated.License; -import com.google.cloud.compute.deprecated.LicenseId; -import com.google.cloud.compute.deprecated.MachineType; -import com.google.cloud.compute.deprecated.MachineTypeId; -import com.google.cloud.compute.deprecated.Network; -import com.google.cloud.compute.deprecated.NetworkConfiguration; -import com.google.cloud.compute.deprecated.NetworkId; -import com.google.cloud.compute.deprecated.NetworkInfo; -import com.google.cloud.compute.deprecated.NetworkInterface; -import com.google.cloud.compute.deprecated.Operation; -import com.google.cloud.compute.deprecated.Region; -import com.google.cloud.compute.deprecated.RegionAddressId; -import com.google.cloud.compute.deprecated.RegionOperationId; -import com.google.cloud.compute.deprecated.SchedulingOptions; -import com.google.cloud.compute.deprecated.Snapshot; -import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; -import com.google.cloud.compute.deprecated.SnapshotId; -import com.google.cloud.compute.deprecated.SnapshotInfo; -import com.google.cloud.compute.deprecated.StandardDiskConfiguration; -import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; -import com.google.cloud.compute.deprecated.StorageImageConfiguration; -import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; -import com.google.cloud.compute.deprecated.Subnetwork; -import com.google.cloud.compute.deprecated.SubnetworkId; -import com.google.cloud.compute.deprecated.SubnetworkInfo; -import com.google.cloud.compute.deprecated.Zone; -import com.google.cloud.compute.deprecated.ZoneOperationId; -import com.google.cloud.compute.deprecated.testing.ResourceCleaner; -import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeoutException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; - -public class ITComputeTest { - - private static final String REGION = "us-central1"; - private static final String ZONE = "us-central1-a"; - private static final String DISK_TYPE = "local-ssd"; - private static final String MACHINE_TYPE = "f1-micro"; - private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); - private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); - private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); - private static final String IMAGE_PROJECT = "debian-cloud"; - - private static Compute compute; - private static ResourceCleaner resourceCleaner; - - - @Rule - public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() { - RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); - compute = computeHelper.getOptions().getService(); - resourceCleaner = ResourceCleaner.create(compute); - } - - @AfterClass - public static void tearDown() { - resourceCleaner.cleanUp(); - } - - @Test - public void testGetDiskType() { - DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); - // assertNotNull(diskType.getGeneratedId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testGetDiskTypeWithSelectedFields() { - DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, - Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - // assertNotNull(diskType.getGeneratedId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNull(diskType.getDescription()); - assertNull(diskType.getValidDiskSize()); - assertNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testListDiskTypes() { - Page diskPage = compute.listDiskTypes(ZONE); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithSelectedFields() { - Page diskPage = compute.listDiskTypes(ZONE, - Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - assertNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNull(diskType.getDescription()); - assertNull(diskType.getValidDiskSize()); - assertNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithFilter() { - Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( - Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypes() { - Page diskPage = compute.listDiskTypes(); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypesWithFilter() { - Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( - Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testGetMachineType() { - MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - - @Test - public void testGetMachineTypeWithSelectedFields() { - MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, - Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); - assertNotNull(machineType.getGeneratedId()); - assertNull(machineType.getCreationTimestamp()); - assertNull(machineType.getDescription()); - assertNull(machineType.getCpus()); - assertNull(machineType.getMemoryMb()); - assertNull(machineType.getMaximumPersistentDisks()); - assertNull(machineType.getMaximumPersistentDisksSizeGb()); - } - - @Test - public void testListMachineTypes() { - Page machinePage = compute.listMachineTypes(ZONE); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testListMachineTypesWithSelectedFields() { - Page machinePage = compute.listMachineTypes(ZONE, - Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNull(machineType.getDescription()); - assertNull(machineType.getCpus()); - assertNull(machineType.getMemoryMb()); - assertNull(machineType.getMaximumPersistentDisks()); - assertNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testListMachineTypesWithFilter() { - Page machinePage = compute.listMachineTypes(ZONE, - Compute.MachineTypeListOption.filter( - Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertEquals(2, (long) machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testAggregatedListMachineTypes() { - Page machinePage = compute.listMachineTypes(); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testAggregatedListMachineTypesWithFilter() { - Page machinePage = - compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( - Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotEquals(2, (long) machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testGetLicense() { - License license = compute.getLicense(LICENSE_ID); - assertEquals(LICENSE_ID, license.getLicenseId()); - assertNotNull(license.chargesUseFee()); - } - - @Test - public void testGetLicenseWithSelectedFields() { - License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); - assertEquals(LICENSE_ID, license.getLicenseId()); - assertNull(license.chargesUseFee()); - } - - @Test - public void testGetRegion() { - Region region = compute.getRegion(REGION); - assertEquals(REGION, region.getRegionId().getRegion()); - assertNotNull(region.getDescription()); - assertNotNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNotNull(region.getQuotas()); - assertNotNull(region.getStatus()); - assertNotNull(region.getZones()); - } - - @Test - public void testGetRegionWithSelectedFields() { - Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); - assertEquals(REGION, region.getRegionId().getRegion()); - assertNotNull(region.getGeneratedId()); - assertNull(region.getDescription()); - assertNull(region.getCreationTimestamp()); - assertNull(region.getQuotas()); - assertNull(region.getStatus()); - assertNull(region.getZones()); - } - - @Test - public void testListRegions() { - Page regionPage = compute.listRegions(); - Iterator regionIterator = regionPage.iterateAll().iterator(); - while (regionIterator.hasNext()) { - Region region = regionIterator.next(); - assertNotNull(region.getRegionId()); - assertNotNull(region.getDescription()); - assertNotNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNotNull(region.getQuotas()); - assertNotNull(region.getStatus()); - assertNotNull(region.getZones()); - } - } - - @Test - public void testListRegionsWithSelectedFields() { - Page regionPage = - compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); - Iterator regionIterator = regionPage.iterateAll().iterator(); - while (regionIterator.hasNext()) { - Region region = regionIterator.next(); - assertNotNull(region.getRegionId()); - assertNull(region.getDescription()); - assertNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNull(region.getQuotas()); - assertNull(region.getStatus()); - assertNull(region.getZones()); - } - } - - @Test - public void testListRegionsWithFilter() { - Page regionPage = compute.listRegions(Compute.RegionListOption.filter( - Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); - Iterator regionIterator = regionPage.iterateAll().iterator(); - assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); - assertFalse(regionIterator.hasNext()); - } - - @Test - public void testGetZone() { - Zone zone = compute.getZone(ZONE); - assertEquals(ZONE, zone.getZoneId().getZone()); - assertNotNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNotNull(zone.getDescription()); - assertNotNull(zone.getStatus()); - assertNotNull(zone.getRegion()); - } - - @Test - public void testGetZoneWithSelectedFields() { - Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); - assertEquals(ZONE, zone.getZoneId().getZone()); - assertNotNull(zone.getGeneratedId()); - assertNull(zone.getCreationTimestamp()); - assertNull(zone.getDescription()); - assertNull(zone.getStatus()); - assertNull(zone.getRegion()); - } - - @Test - public void testListZones() { - Page zonePage = compute.listZones(); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - while (zoneIterator.hasNext()) { - Zone zone = zoneIterator.next(); - assertNotNull(zone.getZoneId()); - assertNotNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNotNull(zone.getDescription()); - assertNotNull(zone.getStatus()); - assertNotNull(zone.getRegion()); - } - } - - @Test - public void testListZonesWithSelectedFields() { - Page zonePage = compute.listZones( - Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - while (zoneIterator.hasNext()) { - Zone zone = zoneIterator.next(); - assertNotNull(zone.getZoneId()); - assertNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNull(zone.getDescription()); - assertNull(zone.getStatus()); - assertNull(zone.getRegion()); - } - } - - @Test - public void testListZonesWithFilter() { - Page zonePage = compute.listZones( - Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); - assertFalse(zoneIterator.hasNext()); - } - - @Test - public void testListGlobalOperations() { - Page operationPage = compute.listGlobalOperations(); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListGlobalOperationsWithSelectedFields() { - Page operationPage = - compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListGlobalOperationsWithFilter() { - Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( - Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListRegionOperations() { - Page operationPage = compute.listRegionOperations(REGION); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListRegionOperationsWithSelectedFields() { - Page operationPage = compute.listRegionOperations(REGION, - Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListRegionOperationsWithFilter() { - Page operationPage = compute.listRegionOperations(REGION, - Compute.OperationListOption.filter(Compute.OperationFilter.equals( - Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListZoneOperations() { - Page operationPage = compute.listZoneOperations(ZONE); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListZoneOperationsWithSelectedFields() { - Page operationPage = compute.listZoneOperations(ZONE, - Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListZoneOperationsWithFilter() { - Page operationPage = compute.listZoneOperations(ZONE, - Compute.OperationListOption.filter(Compute.OperationFilter.equals( - Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; - AddressId addressId = RegionAddressId.of(REGION, name); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - // test get - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, remoteAddress.getAddressId().getRegion()); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNotNull(remoteAddress.getAddress()); - assertNotNull(remoteAddress.getCreationTimestamp()); - assertNotNull(remoteAddress.getGeneratedId()); - assertNotNull(remoteAddress.getStatus()); - // test get with selected fields - remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, remoteAddress.getAddressId().getRegion()); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNull(remoteAddress.getAddress()); - assertNull(remoteAddress.getCreationTimestamp()); - assertNull(remoteAddress.getGeneratedId()); - operation = remoteAddress.delete(); - operation.waitFor(); - resourceCleaner.remove(addressId); - assertNull(compute.getAddress(addressId)); - } - - @Test - public void testListRegionAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-region-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); - AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - // test list - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(address.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, address.getAddressId().getRegion()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - // test list with selected fields - count = 0; - addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), - Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); - addressIterator = addressPage.iterateAll().iterator(); - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertTrue(address.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, address.getAddressId().getRegion()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); - AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; - AddressId addressId = GlobalAddressId.of(name); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - // test get - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNotNull(remoteAddress.getAddress()); - assertNotNull(remoteAddress.getCreationTimestamp()); - assertNotNull(remoteAddress.getGeneratedId()); - assertNotNull(remoteAddress.getStatus()); - // test get with selected fields - remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNull(remoteAddress.getAddress()); - assertNull(remoteAddress.getCreationTimestamp()); - assertNull(remoteAddress.getGeneratedId()); - operation = remoteAddress.delete(); - operation.waitFor(); - resourceCleaner.remove(addressId); - assertNull(compute.getAddress(addressId)); - } - - @Test - public void testListGlobalAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-global-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); - AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - // test list - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(address.getAddressId() instanceof GlobalAddressId); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - // test list with selected fields - count = 0; - addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), - Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); - addressIterator = addressPage.iterateAll().iterator(); - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertTrue(address.getAddressId() instanceof GlobalAddressId); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetResizeAndDeleteStandardDisk() - throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; - DiskId diskId = DiskId.of(ZONE, name); - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - // test get - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.resize(200L); - operation.waitFor(); - // test resize and get with selected fields - remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(200L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(diskId); - assertNull(compute.getDisk(diskId)); - } - - @Test - public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; - DiskId diskId = DiskId.of(ZONE, name); - DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - // test get - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); - ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); - assertNotNull(remoteConfiguration.getSourceImageId()); - assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); - assertNotNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - // test get with selected fields - remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); - assertNull(remoteConfiguration.getSourceImageId()); - assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(diskId); - assertNull(compute.getDisk(diskId)); - } - - @Test - public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() - throws InterruptedException, TimeoutException { - String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; - String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; - DiskId diskId = DiskId.of(ZONE, diskName); - DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); - String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - operation = remoteDisk.createSnapshot(snapshotName); - operation.waitFor(); - // test get snapshot with selected fields - Snapshot snapshot = compute.getSnapshot(snapshotName, - Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - resourceCleaner.add(snapshot.getSnapshotId()); - assertNull(snapshot.getGeneratedId()); - assertNotNull(snapshot.getSnapshotId()); - assertNotNull(snapshot.getCreationTimestamp()); - assertNull(snapshot.getDescription()); - assertNull(snapshot.getStatus()); - assertNull(snapshot.getDiskSizeGb()); - assertNull(snapshot.getLicenses()); - assertNull(snapshot.getSourceDisk()); - assertNull(snapshot.getSourceDiskId()); - assertNull(snapshot.getStorageBytes()); - assertNull(snapshot.getStorageBytesStatus()); - // test get snapshot - snapshot = compute.getSnapshot(snapshotName); - assertNotNull(snapshot.getGeneratedId()); - assertNotNull(snapshot.getSnapshotId()); - assertNotNull(snapshot.getCreationTimestamp()); - assertNotNull(snapshot.getStatus()); - assertEquals(100L, (long) snapshot.getDiskSizeGb()); - assertEquals(diskName, snapshot.getSourceDisk().getDisk()); - assertNotNull(snapshot.getSourceDiskId()); - assertNotNull(snapshot.getStorageBytes()); - assertNotNull(snapshot.getStorageBytesStatus()); - remoteDisk.delete(); - resourceCleaner.remove(diskId); - diskInfo = - DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); - operation = compute.create(diskInfo); - operation.waitFor(); - // test get disk - remoteDisk = compute.getDisk(snapshotDiskId); - resourceCleaner.add(snapshotDiskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); - SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); - assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNotNull(remoteConfiguration.getSourceSnapshotId()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - // test get disk with selected fields - remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationStatus()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); - assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(snapshotDiskId); - assertNull(compute.getDisk(snapshotDiskId)); - operation = snapshot.delete(); - operation.waitFor(); - resourceCleaner.remove(snapshot.getSnapshotId()); - assertNull(compute.getSnapshot(snapshotName)); - } - - @Test - public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; - String[] diskNames = {prefix + "1", prefix + "2"}; - DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); - DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); - DiskConfiguration configuration = - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); - Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); - Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); - firstOperation.waitFor(); - resourceCleaner.add(firstDiskId); - secondOperation.waitFor(); - resourceCleaner.add(secondDiskId); - Set diskSet = ImmutableSet.copyOf(diskNames); - // test list disks - Compute.DiskFilter diskFilter = - Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); - Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); - Iterator diskIterator = diskPage.iterateAll().iterator(); - int count = 0; - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - count++; - } - assertEquals(2, count); - // test list disks with selected fields - count = 0; - diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), - Compute.DiskListOption.fields(Compute.DiskField.STATUS)); - diskIterator = diskPage.iterateAll().iterator(); - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - count++; - } - assertEquals(2, count); - // test snapshots - SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); - SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); - firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); - secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); - firstOperation.waitFor(); - resourceCleaner.add(firstSnapshotId); - secondOperation.waitFor(); - resourceCleaner.add(secondSnapshotId); - // test list snapshots - Compute.SnapshotFilter snapshotFilter = - Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); - Page snapshotPage = - compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); - Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); - count = 0; - while (snapshotIterator.hasNext()) { - Snapshot remoteSnapshot = snapshotIterator.next(); - assertNotNull(remoteSnapshot.getGeneratedId()); - assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); - assertNotNull(remoteSnapshot.getCreationTimestamp()); - assertNotNull(remoteSnapshot.getStatus()); - assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); - assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); - assertNotNull(remoteSnapshot.getSourceDiskId()); - assertNotNull(remoteSnapshot.getStorageBytes()); - assertNotNull(remoteSnapshot.getStorageBytesStatus()); - count++; - } - assertEquals(2, count); - // test list snapshots with selected fields - snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), - Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - snapshotIterator = snapshotPage.iterateAll().iterator(); - count = 0; - while (snapshotIterator.hasNext()) { - Snapshot remoteSnapshot = snapshotIterator.next(); - assertNull(remoteSnapshot.getGeneratedId()); - assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); - assertNotNull(remoteSnapshot.getCreationTimestamp()); - assertNull(remoteSnapshot.getStatus()); - assertNull(remoteSnapshot.getDiskSizeGb()); - assertNull(remoteSnapshot.getSourceDisk()); - assertNull(remoteSnapshot.getSourceDiskId()); - assertNull(remoteSnapshot.getStorageBytes()); - assertNull(remoteSnapshot.getStorageBytesStatus()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testAggregatedListDisks() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; - String[] diskZones = {"us-central1-a", "us-east1-c"}; - String[] diskNames = {prefix + "1", prefix + "2"}; - DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); - DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); - DiskConfiguration configuration = - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); - Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); - Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); - firstOperation.waitFor(); - resourceCleaner.add(firstDiskId); - secondOperation.waitFor(); - resourceCleaner.add(secondDiskId); - Set zoneSet = ImmutableSet.copyOf(diskZones); - Set diskSet = ImmutableSet.copyOf(diskNames); - Compute.DiskFilter diskFilter = - Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); - Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); - Iterator diskIterator = diskPage.iterateAll().iterator(); - int count = 0; - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { - String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; - String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; - DiskId diskId = DiskId.of(ZONE, diskName); - ImageId imageId = ImageId.of(imageName); - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); -operation.waitFor(); - Disk remoteDisk = compute.getDisk(diskId); - ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); - operation = compute.create(imageInfo); -operation.waitFor(); - resourceCleaner.add(diskId); - // test get image with selected fields - Image image = compute.getImage(imageId, - Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); - resourceCleaner.add(imageId); - assertNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNull(image.getDescription()); - assertNotNull(image.getConfiguration()); - assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); - DiskImageConfiguration remoteConfiguration = image.getConfiguration(); - assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); - assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - // test get image - image = compute.getImage(imageId); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); - remoteConfiguration = image.getConfiguration(); - assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); - assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); - assertEquals(100L, (long) image.getDiskSizeGb()); - assertNotNull(image.getStatus()); - assertNull(image.getDeprecationStatus()); - // test deprecate image - DeprecationStatus deprecationStatus = - DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) - .setDeprecated(System.currentTimeMillis()) - .build(); - operation = image.deprecate(deprecationStatus); - operation.waitFor(); - image = compute.getImage(imageId); - assertEquals(deprecationStatus, image.getDeprecationStatus()); - remoteDisk.delete(); - resourceCleaner.remove(diskId); - operation = image.delete(); - operation.waitFor(); - resourceCleaner.remove(imageId); - assertNull(compute.getImage(imageId)); - } - - @Test - public void testListImages() { - Page imagePage = compute.listImages(IMAGE_PROJECT); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNotNull(image.getStatus()); - assertNotNull(image.getDiskSizeGb()); - } - assertTrue(count > 0); - } - - @Test - public void testListImagesWithSelectedFields() { - Page imagePage = - compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - } - assertTrue(count > 0); - } - - @Test - public void testListImagesWithFilter() { - Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( - Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNotNull(image.getStatus()); - assertNotNull(image.getDiskSizeGb()); - assertEquals(365056004L, - (long) image.getConfiguration().getArchiveSizeBytes()); - } - assertTrue(count > 0); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-network"; - NetworkId networkId = NetworkId.of(name); - NetworkInfo networkInfo = - NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(networkInfo); -operation.waitFor(); - // test get network with selected fields - Network network = compute.getNetwork(networkId.getNetwork(), - Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); - resourceCleaner.add(networkId); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertNull(network.getDescription()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - // test get network - network = compute.getNetwork(networkId.getNetwork()); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - operation = network.delete(); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getNetwork(name)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testListNetworks() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "list-network"; - NetworkId networkId = NetworkId.of(name); - NetworkInfo networkInfo = - NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - resourceCleaner.add(networkId); - // test list - Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); - Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); - Iterator networkIterator = networkPage.iterateAll().iterator(); - int count = 0; - while (networkIterator.hasNext()) { - Network network = networkIterator.next(); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - count++; - } - assertEquals(1, count); - // test list with selected fields - count = 0; - networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), - Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); - networkIterator = networkPage.iterateAll().iterator(); - while (networkIterator.hasNext()) { - Network network = networkIterator.next(); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertNull(network.getDescription()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - count++; - } - assertEquals(1, count); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getNetwork(name)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { - String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; - NetworkId networkId = NetworkId.of(networkName); - NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - // test get network - Network network = compute.getNetwork(networkId.getNetwork()); - resourceCleaner.add(networkId); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); - assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); - assertFalse(network.getConfiguration().autoCreateSubnetworks()); - String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; - SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); - operation = compute.create(subnetworkInfo); - operation.waitFor(); - // test get subnetwork with selected fields - Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, - Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - resourceCleaner.add(subnetworkId); - assertNull(subnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(subnetwork.getCreationTimestamp()); - assertNull(subnetwork.getDescription()); - assertNull(subnetwork.getGatewayAddress()); - assertNull(subnetwork.getNetwork()); - assertNull(subnetwork.getIpRange()); - // test get subnetwork - subnetwork = compute.getSubnetwork(subnetworkId); - assertNotNull(subnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(subnetwork.getCreationTimestamp()); - assertNotNull(subnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); - assertEquals("192.168.0.0/16", subnetwork.getIpRange()); - // test list subnetworks - Compute.SubnetworkFilter filter = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); - Page subnetworkPage = - compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); - Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); - int count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), - remoteSubnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNotNull(remoteSubnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); - assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); - count++; - } - assertEquals(1, count); - // test list subnetworks with selected fields - subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), - Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - subnetworkIterator = subnetworkPage.iterateAll().iterator(); - count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNull(remoteSubnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), - remoteSubnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNull(remoteSubnetwork.getDescription()); - assertNull(remoteSubnetwork.getGatewayAddress()); - assertNull(remoteSubnetwork.getNetwork()); - assertNull(remoteSubnetwork.getIpRange()); - count++; - } - assertEquals(1, count); - operation = subnetwork.delete(); - operation.waitFor(); - resourceCleaner.remove(subnetworkId); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getSubnetwork(subnetworkId)); - assertNull(compute.getNetwork(networkName)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { - String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; - NetworkId networkId = NetworkId.of(networkName); - NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - resourceCleaner.add(networkId); - String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; - String[] regionNames = {"us-central1", "us-east1"}; - String[] subnetworkNames = {prefix + "1", prefix + "2"}; - String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; - SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); - SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); - SubnetworkInfo firstSubnetworkInfo = - SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); - SubnetworkInfo secondSubnetworkInfo = - SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); - Operation firstOperation = compute.create(firstSubnetworkInfo); - Operation secondOperation = compute.create(secondSubnetworkInfo); - firstOperation.waitFor(); - resourceCleaner.add(firstSubnetworkId); - secondOperation.waitFor(); - resourceCleaner.add(secondSubnetworkId); - Set regionSet = ImmutableSet.copyOf(regionNames); - Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); - Set rangeSet = ImmutableSet.copyOf(ipRanges); - Compute.SubnetworkFilter subnetworkFilter = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); - Page subnetworkPage = - compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); - Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); - int count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.getGeneratedId()); - assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); - assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNotNull(remoteSubnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); - assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); - count++; - } - assertEquals(2, count); - firstOperation = compute.deleteSubnetwork(firstSubnetworkId); - secondOperation = compute.deleteSubnetwork(secondSubnetworkId); - firstOperation.waitFor(); - resourceCleaner.remove(firstSubnetworkId); - secondOperation.waitFor(); - resourceCleaner.remove(secondSubnetworkId); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getSubnetwork(firstSubnetworkId)); - assertNull(compute.getSubnetwork(secondSubnetworkId)); - assertNull(compute.getNetwork(networkName)); - } - - @Test - public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; - String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; - // Create an address to assign to the instance - AddressId addressId = RegionAddressId.of(REGION, addressName); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - Address address = compute.getAddress(addressId); - resourceCleaner.add(addressId); - // Create an instance - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) - .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() - .setName("NAT") - .setNatIp(address.getAddress()).build()) - .build(); - AttachedDisk disk1 = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - AttachedDisk disk2 = - AttachedDisk.of("dev1", - AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) - .setAttachedDisks(disk1, disk2) - .setNetworkInterfaces(networkInterface) - .build(); - operation = compute.create(instanceInfo); - operation.waitFor(); - // test get - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); - assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); - assertEquals(ZONE, remoteInstance.getMachineType().getZone()); - assertNotNull(remoteInstance.getCreationTimestamp()); - Set deviceSet = ImmutableSet.of("dev0", "dev1"); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - } - assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, - remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); - AttachedDisk.PersistentDiskConfiguration remoteConfiguration = - remoteInstance.getAttachedDisks().get(0).getConfiguration(); - assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); - assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); - assertTrue(remoteConfiguration.boot()); - assertTrue(remoteConfiguration.autoDelete()); - assertEquals(1, remoteInstance.getNetworkInterfaces().size()); - NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); - assertNotNull(remoteNetworkInterface.getName()); - assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); - List remoteAccessConfigurations = - remoteNetworkInterface.getAccessConfigurations(); - assertNotNull(remoteAccessConfigurations); - assertEquals(1, remoteAccessConfigurations.size()); - NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); - assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); - assertEquals("NAT", remoteAccessConfig.getName()); - assertNotNull(remoteInstance.getMetadata()); - assertNotNull(remoteInstance.getTags()); - // test get with selected fields - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); - assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); - assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); - assertNull(remoteInstance.getMachineType()); - assertNotNull(remoteInstance.getCreationTimestamp()); - assertNull(remoteInstance.getAttachedDisks()); - assertNull(remoteInstance.getNetworkInterfaces()); - assertNull(remoteInstance.getMetadata()); - assertNull(remoteInstance.getTags()); - // test get default serial port output - String serialPortOutput = remoteInstance.getSerialPortOutput(); - assertNotNull(serialPortOutput); - // test get serial port output by number - String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); - assertTrue(newSerialPortOutput.contains(serialPortOutput)); - operation = remoteInstance.delete(); - operation.waitFor(); - resourceCleaner.remove(instanceId); - assertNull(compute.getInstance(instanceId)); - } - - @Test - public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation operation = compute.create(instanceInfo); - operation.waitFor(); - Instance remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - resourceCleaner.add(instanceId); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - operation = remoteInstance.stop(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); - operation = remoteInstance.start(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - operation = remoteInstance.reset(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - } - - @Test - public void testSetInstanceProperties() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation operation = compute.create(instanceInfo); - operation.waitFor(); - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - // test set tags - List tags = ImmutableList.of("tag1", "tag2"); - operation = remoteInstance.setTags(tags); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(tags, remoteInstance.getTags().getValues()); - // test set metadata - Map metadata = ImmutableMap.of("key", "value"); - operation = remoteInstance.setMetadata(metadata); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(metadata, remoteInstance.getMetadata().getValues()); - // test set machine type - operation = remoteInstance.stop(); - operation.waitFor(); - operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); - assertEquals(ZONE, remoteInstance.getMachineType().getZone()); - // test set scheduling options - SchedulingOptions options = - SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); - operation = remoteInstance.setSchedulingOptions(options); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(options, remoteInstance.getSchedulingOptions()); - } - - @Test - public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; - String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation instanceOperation = compute.create(instanceInfo); - DiskId diskId = DiskId.of(ZONE, diskName); - Operation diskOperation = compute.create(DiskInfo.of(diskId, - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); - instanceOperation.waitFor(); - diskOperation.waitFor(); - resourceCleaner.add(diskId); - Instance remoteInstance = compute.getInstance(instanceId); - // test attach disk - instanceOperation = remoteInstance.attachDisk("dev1", - AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - Set deviceSet = ImmutableSet.of("dev0", "dev1"); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - } - // test set disk auto-delete - instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); - } - // test detach disk - instanceOperation = remoteInstance.detachDisk("dev1"); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(1, remoteInstance.getAttachedDisks().size()); - assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); - } - - @Test - public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; - String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation instanceOperation = compute.create(instanceInfo); - AddressId addressId = RegionAddressId.of(REGION, addressName); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation addressOperation = compute.create(addressInfo); - addressOperation.waitFor(); - instanceOperation.waitFor(); - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); - // test add access config - NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() - .setNatIp(remoteAddress.getAddress()) - .setName("NAT") - .build(); - instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - List accessConfigurations = - remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); - assertEquals(1, accessConfigurations.size()); - assertEquals("NAT", accessConfigurations.get(0).getName()); - // test delete access config - instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); - } -} +// /* +// * Copyright 2016 Google LLC +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +// +// package com.google.cloud.compute.deprecated.it; +// +// import static org.junit.Assert.assertEquals; +// import static org.junit.Assert.assertFalse; +// import static org.junit.Assert.assertNotEquals; +// import static org.junit.Assert.assertNotNull; +// import static org.junit.Assert.assertNull; +// import static org.junit.Assert.assertTrue; +// +// import com.google.api.gax.paging.Page; +// import com.google.cloud.compute.deprecated.Address; +// import com.google.cloud.compute.deprecated.AddressId; +// import com.google.cloud.compute.deprecated.AddressInfo; +// import com.google.cloud.compute.deprecated.AttachedDisk; +// import com.google.cloud.compute.deprecated.Compute; +// import com.google.cloud.compute.deprecated.DeprecationStatus; +// import com.google.cloud.compute.deprecated.Disk; +// import com.google.cloud.compute.deprecated.DiskConfiguration; +// import com.google.cloud.compute.deprecated.DiskId; +// import com.google.cloud.compute.deprecated.DiskImageConfiguration; +// import com.google.cloud.compute.deprecated.DiskInfo; +// import com.google.cloud.compute.deprecated.DiskType; +// import com.google.cloud.compute.deprecated.DiskTypeId; +// import com.google.cloud.compute.deprecated.GlobalAddressId; +// import com.google.cloud.compute.deprecated.Image; +// import com.google.cloud.compute.deprecated.ImageConfiguration; +// import com.google.cloud.compute.deprecated.ImageDiskConfiguration; +// import com.google.cloud.compute.deprecated.ImageId; +// import com.google.cloud.compute.deprecated.ImageInfo; +// import com.google.cloud.compute.deprecated.Instance; +// import com.google.cloud.compute.deprecated.InstanceId; +// import com.google.cloud.compute.deprecated.InstanceInfo; +// import com.google.cloud.compute.deprecated.License; +// import com.google.cloud.compute.deprecated.LicenseId; +// import com.google.cloud.compute.deprecated.MachineType; +// import com.google.cloud.compute.deprecated.MachineTypeId; +// import com.google.cloud.compute.deprecated.Network; +// import com.google.cloud.compute.deprecated.NetworkConfiguration; +// import com.google.cloud.compute.deprecated.NetworkId; +// import com.google.cloud.compute.deprecated.NetworkInfo; +// import com.google.cloud.compute.deprecated.NetworkInterface; +// import com.google.cloud.compute.deprecated.Operation; +// import com.google.cloud.compute.deprecated.Region; +// import com.google.cloud.compute.deprecated.RegionAddressId; +// import com.google.cloud.compute.deprecated.RegionOperationId; +// import com.google.cloud.compute.deprecated.SchedulingOptions; +// import com.google.cloud.compute.deprecated.Snapshot; +// import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; +// import com.google.cloud.compute.deprecated.SnapshotId; +// import com.google.cloud.compute.deprecated.SnapshotInfo; +// import com.google.cloud.compute.deprecated.StandardDiskConfiguration; +// import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; +// import com.google.cloud.compute.deprecated.StorageImageConfiguration; +// import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; +// import com.google.cloud.compute.deprecated.Subnetwork; +// import com.google.cloud.compute.deprecated.SubnetworkId; +// import com.google.cloud.compute.deprecated.SubnetworkInfo; +// import com.google.cloud.compute.deprecated.Zone; +// import com.google.cloud.compute.deprecated.ZoneOperationId; +// import com.google.cloud.compute.deprecated.testing.ResourceCleaner; +// import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; +// import com.google.common.collect.ImmutableList; +// import com.google.common.collect.ImmutableMap; +// import com.google.common.collect.ImmutableSet; +// import java.util.Iterator; +// import java.util.List; +// import java.util.Map; +// import java.util.Set; +// import java.util.concurrent.TimeoutException; +// import org.junit.AfterClass; +// import org.junit.BeforeClass; +// import org.junit.Ignore; +// import org.junit.Rule; +// import org.junit.Test; +// import org.junit.rules.Timeout; +// +// public class ITComputeTest { +// +// private static final String REGION = "us-central1"; +// private static final String ZONE = "us-central1-a"; +// private static final String DISK_TYPE = "local-ssd"; +// private static final String MACHINE_TYPE = "f1-micro"; +// private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); +// private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); +// private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); +// private static final String IMAGE_PROJECT = "debian-cloud"; +// +// private static Compute compute; +// private static ResourceCleaner resourceCleaner; +// +// +// @Rule +// public Timeout globalTimeout = Timeout.seconds(300); +// +// @BeforeClass +// public static void beforeClass() { +// RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); +// compute = computeHelper.getOptions().getService(); +// resourceCleaner = ResourceCleaner.create(compute); +// } +// +// @AfterClass +// public static void tearDown() { +// resourceCleaner.cleanUp(); +// } +// +// @Test +// public void testGetDiskType() { +// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); +// // assertNotNull(diskType.getGeneratedId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotNull(diskType.getDefaultDiskSizeGb()); +// } +// +// @Test +// public void testGetDiskTypeWithSelectedFields() { +// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, +// Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); +// // assertNotNull(diskType.getGeneratedId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNull(diskType.getDescription()); +// assertNull(diskType.getValidDiskSize()); +// assertNull(diskType.getDefaultDiskSizeGb()); +// } +// +// @Test +// public void testListDiskTypes() { +// Page diskPage = compute.listDiskTypes(ZONE); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotNull(diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testListDiskTypesWithSelectedFields() { +// Page diskPage = compute.listDiskTypes(ZONE, +// Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// assertNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNull(diskType.getDescription()); +// assertNull(diskType.getValidDiskSize()); +// assertNull(diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testListDiskTypesWithFilter() { +// Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( +// Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // todo(mziccard): uncomment or remove once #695 is closed +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListDiskTypes() { +// Page diskPage = compute.listDiskTypes(); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotNull(diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListDiskTypesWithFilter() { +// Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( +// Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // todo(mziccard): uncomment or remove once #695 is closed +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testGetMachineType() { +// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// +// @Test +// public void testGetMachineTypeWithSelectedFields() { +// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, +// Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); +// assertNotNull(machineType.getGeneratedId()); +// assertNull(machineType.getCreationTimestamp()); +// assertNull(machineType.getDescription()); +// assertNull(machineType.getCpus()); +// assertNull(machineType.getMemoryMb()); +// assertNull(machineType.getMaximumPersistentDisks()); +// assertNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// +// @Test +// public void testListMachineTypes() { +// Page machinePage = compute.listMachineTypes(ZONE); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testListMachineTypesWithSelectedFields() { +// Page machinePage = compute.listMachineTypes(ZONE, +// Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNull(machineType.getDescription()); +// assertNull(machineType.getCpus()); +// assertNull(machineType.getMemoryMb()); +// assertNull(machineType.getMaximumPersistentDisks()); +// assertNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testListMachineTypesWithFilter() { +// Page machinePage = compute.listMachineTypes(ZONE, +// Compute.MachineTypeListOption.filter( +// Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertEquals(2, (long) machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListMachineTypes() { +// Page machinePage = compute.listMachineTypes(); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListMachineTypesWithFilter() { +// Page machinePage = +// compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( +// Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotEquals(2, (long) machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testGetLicense() { +// License license = compute.getLicense(LICENSE_ID); +// assertEquals(LICENSE_ID, license.getLicenseId()); +// assertNotNull(license.chargesUseFee()); +// } +// +// @Test +// public void testGetLicenseWithSelectedFields() { +// License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); +// assertEquals(LICENSE_ID, license.getLicenseId()); +// assertNull(license.chargesUseFee()); +// } +// +// @Test +// public void testGetRegion() { +// Region region = compute.getRegion(REGION); +// assertEquals(REGION, region.getRegionId().getRegion()); +// assertNotNull(region.getDescription()); +// assertNotNull(region.getCreationTimestamp()); +// assertNotNull(region.getGeneratedId()); +// assertNotNull(region.getQuotas()); +// assertNotNull(region.getStatus()); +// assertNotNull(region.getZones()); +// } +// +// @Test +// public void testGetRegionWithSelectedFields() { +// Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); +// assertEquals(REGION, region.getRegionId().getRegion()); +// assertNotNull(region.getGeneratedId()); +// assertNull(region.getDescription()); +// assertNull(region.getCreationTimestamp()); +// assertNull(region.getQuotas()); +// assertNull(region.getStatus()); +// assertNull(region.getZones()); +// } +// +// @Test +// public void testListRegions() { +// Page regionPage = compute.listRegions(); +// Iterator regionIterator = regionPage.iterateAll().iterator(); +// while (regionIterator.hasNext()) { +// Region region = regionIterator.next(); +// assertNotNull(region.getRegionId()); +// assertNotNull(region.getDescription()); +// assertNotNull(region.getCreationTimestamp()); +// assertNotNull(region.getGeneratedId()); +// assertNotNull(region.getQuotas()); +// assertNotNull(region.getStatus()); +// assertNotNull(region.getZones()); +// } +// } +// +// @Test +// public void testListRegionsWithSelectedFields() { +// Page regionPage = +// compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); +// Iterator regionIterator = regionPage.iterateAll().iterator(); +// while (regionIterator.hasNext()) { +// Region region = regionIterator.next(); +// assertNotNull(region.getRegionId()); +// assertNull(region.getDescription()); +// assertNull(region.getCreationTimestamp()); +// assertNotNull(region.getGeneratedId()); +// assertNull(region.getQuotas()); +// assertNull(region.getStatus()); +// assertNull(region.getZones()); +// } +// } +// +// @Test +// public void testListRegionsWithFilter() { +// Page regionPage = compute.listRegions(Compute.RegionListOption.filter( +// Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); +// Iterator regionIterator = regionPage.iterateAll().iterator(); +// assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); +// assertFalse(regionIterator.hasNext()); +// } +// +// @Test +// public void testGetZone() { +// Zone zone = compute.getZone(ZONE); +// assertEquals(ZONE, zone.getZoneId().getZone()); +// assertNotNull(zone.getGeneratedId()); +// assertNotNull(zone.getCreationTimestamp()); +// assertNotNull(zone.getDescription()); +// assertNotNull(zone.getStatus()); +// assertNotNull(zone.getRegion()); +// } +// +// @Test +// public void testGetZoneWithSelectedFields() { +// Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); +// assertEquals(ZONE, zone.getZoneId().getZone()); +// assertNotNull(zone.getGeneratedId()); +// assertNull(zone.getCreationTimestamp()); +// assertNull(zone.getDescription()); +// assertNull(zone.getStatus()); +// assertNull(zone.getRegion()); +// } +// +// @Test +// public void testListZones() { +// Page zonePage = compute.listZones(); +// Iterator zoneIterator = zonePage.iterateAll().iterator(); +// while (zoneIterator.hasNext()) { +// Zone zone = zoneIterator.next(); +// assertNotNull(zone.getZoneId()); +// assertNotNull(zone.getGeneratedId()); +// assertNotNull(zone.getCreationTimestamp()); +// assertNotNull(zone.getDescription()); +// assertNotNull(zone.getStatus()); +// assertNotNull(zone.getRegion()); +// } +// } +// +// @Test +// public void testListZonesWithSelectedFields() { +// Page zonePage = compute.listZones( +// Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); +// Iterator zoneIterator = zonePage.iterateAll().iterator(); +// while (zoneIterator.hasNext()) { +// Zone zone = zoneIterator.next(); +// assertNotNull(zone.getZoneId()); +// assertNull(zone.getGeneratedId()); +// assertNotNull(zone.getCreationTimestamp()); +// assertNull(zone.getDescription()); +// assertNull(zone.getStatus()); +// assertNull(zone.getRegion()); +// } +// } +// +// @Test +// public void testListZonesWithFilter() { +// Page zonePage = compute.listZones( +// Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); +// Iterator zoneIterator = zonePage.iterateAll().iterator(); +// assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); +// assertFalse(zoneIterator.hasNext()); +// } +// +// @Test +// public void testListGlobalOperations() { +// Page operationPage = compute.listGlobalOperations(); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertNotNull(operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListGlobalOperationsWithSelectedFields() { +// Page operationPage = +// compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getTargetLink()); +// assertNull(operation.getTargetId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getStatus()); +// assertNull(operation.getStatusMessage()); +// assertNull(operation.getUser()); +// assertNull(operation.getProgress()); +// assertNull(operation.getDescription()); +// assertNull(operation.getInsertTime()); +// assertNull(operation.getStartTime()); +// assertNull(operation.getEndTime()); +// assertNull(operation.getWarnings()); +// assertNull(operation.getHttpErrorMessage()); +// } +// } +// +// @Test +// public void testListGlobalOperationsWithFilter() { +// Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( +// Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertEquals(Operation.Status.DONE, operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListRegionOperations() { +// Page operationPage = compute.listRegionOperations(REGION); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(REGION, operation.getOperationId().getRegion()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertNotNull(operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListRegionOperationsWithSelectedFields() { +// Page operationPage = compute.listRegionOperations(REGION, +// Compute.OperationListOption.fields(Compute.OperationField.ID)); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(REGION, operation.getOperationId().getRegion()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getTargetLink()); +// assertNull(operation.getTargetId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getStatus()); +// assertNull(operation.getStatusMessage()); +// assertNull(operation.getUser()); +// assertNull(operation.getProgress()); +// assertNull(operation.getDescription()); +// assertNull(operation.getInsertTime()); +// assertNull(operation.getStartTime()); +// assertNull(operation.getEndTime()); +// assertNull(operation.getWarnings()); +// assertNull(operation.getHttpErrorMessage()); +// } +// } +// +// @Test +// public void testListRegionOperationsWithFilter() { +// Page operationPage = compute.listRegionOperations(REGION, +// Compute.OperationListOption.filter(Compute.OperationFilter.equals( +// Compute.OperationField.STATUS, "DONE"))); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(REGION, operation.getOperationId().getRegion()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertEquals(Operation.Status.DONE, operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListZoneOperations() { +// Page operationPage = compute.listZoneOperations(ZONE); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(ZONE, operation.getOperationId().getZone()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertNotNull(operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListZoneOperationsWithSelectedFields() { +// Page operationPage = compute.listZoneOperations(ZONE, +// Compute.OperationListOption.fields(Compute.OperationField.ID)); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(ZONE, operation.getOperationId().getZone()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getTargetLink()); +// assertNull(operation.getTargetId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getStatus()); +// assertNull(operation.getStatusMessage()); +// assertNull(operation.getUser()); +// assertNull(operation.getProgress()); +// assertNull(operation.getDescription()); +// assertNull(operation.getInsertTime()); +// assertNull(operation.getStartTime()); +// assertNull(operation.getEndTime()); +// assertNull(operation.getWarnings()); +// assertNull(operation.getHttpErrorMessage()); +// } +// } +// +// @Test +// public void testListZoneOperationsWithFilter() { +// Page operationPage = compute.listZoneOperations(ZONE, +// Compute.OperationListOption.filter(Compute.OperationFilter.equals( +// Compute.OperationField.STATUS, "DONE"))); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(ZONE, operation.getOperationId().getZone()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertEquals(Operation.Status.DONE, operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; +// AddressId addressId = RegionAddressId.of(REGION, name); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation operation = compute.create(addressInfo); +// operation.waitFor(); +// // test get +// Address remoteAddress = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNotNull(remoteAddress.getAddress()); +// assertNotNull(remoteAddress.getCreationTimestamp()); +// assertNotNull(remoteAddress.getGeneratedId()); +// assertNotNull(remoteAddress.getStatus()); +// // test get with selected fields +// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNull(remoteAddress.getAddress()); +// assertNull(remoteAddress.getCreationTimestamp()); +// assertNull(remoteAddress.getGeneratedId()); +// operation = remoteAddress.delete(); +// operation.waitFor(); +// resourceCleaner.remove(addressId); +// assertNull(compute.getAddress(addressId)); +// } +// +// @Test +// public void testListRegionAddresses() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-region-address"; +// String[] addressNames = {prefix + "1", prefix + "2"}; +// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); +// AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); +// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); +// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstAddressId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondAddressId); +// Set addressSet = ImmutableSet.copyOf(addressNames); +// // test list +// Compute.AddressFilter filter = +// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); +// Page
addressPage = +// compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); +// Iterator
addressIterator = addressPage.iterateAll().iterator(); +// int count = 0; +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertNotNull(address.getAddressId()); +// assertTrue(address.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, address.getAddressId().getRegion()); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNotNull(address.getCreationTimestamp()); +// assertNotNull(address.getGeneratedId()); +// count++; +// } +// assertEquals(2, count); +// // test list with selected fields +// count = 0; +// addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), +// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); +// addressIterator = addressPage.iterateAll().iterator(); +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertTrue(address.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, address.getAddressId().getRegion()); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNull(address.getCreationTimestamp()); +// assertNull(address.getGeneratedId()); +// assertNull(address.getStatus()); +// assertNull(address.getUsage()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; +// String[] addressNames = {prefix + "1", prefix + "2"}; +// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); +// AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); +// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); +// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstAddressId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondAddressId); +// Set addressSet = ImmutableSet.copyOf(addressNames); +// Compute.AddressFilter filter = +// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); +// Page
addressPage = +// compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); +// Iterator
addressIterator = addressPage.iterateAll().iterator(); +// int count = 0; +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertNotNull(address.getAddressId()); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNotNull(address.getCreationTimestamp()); +// assertNotNull(address.getGeneratedId()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; +// AddressId addressId = GlobalAddressId.of(name); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation operation = compute.create(addressInfo); +// operation.waitFor(); +// // test get +// Address remoteAddress = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNotNull(remoteAddress.getAddress()); +// assertNotNull(remoteAddress.getCreationTimestamp()); +// assertNotNull(remoteAddress.getGeneratedId()); +// assertNotNull(remoteAddress.getStatus()); +// // test get with selected fields +// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNull(remoteAddress.getAddress()); +// assertNull(remoteAddress.getCreationTimestamp()); +// assertNull(remoteAddress.getGeneratedId()); +// operation = remoteAddress.delete(); +// operation.waitFor(); +// resourceCleaner.remove(addressId); +// assertNull(compute.getAddress(addressId)); +// } +// +// @Test +// public void testListGlobalAddresses() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-global-address"; +// String[] addressNames = {prefix + "1", prefix + "2"}; +// AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); +// AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); +// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); +// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstAddressId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondAddressId); +// Set addressSet = ImmutableSet.copyOf(addressNames); +// // test list +// Compute.AddressFilter filter = +// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); +// Page
addressPage = +// compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); +// Iterator
addressIterator = addressPage.iterateAll().iterator(); +// int count = 0; +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertNotNull(address.getAddressId()); +// assertTrue(address.getAddressId() instanceof GlobalAddressId); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNotNull(address.getCreationTimestamp()); +// assertNotNull(address.getGeneratedId()); +// count++; +// } +// assertEquals(2, count); +// // test list with selected fields +// count = 0; +// addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), +// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); +// addressIterator = addressPage.iterateAll().iterator(); +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertTrue(address.getAddressId() instanceof GlobalAddressId); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNull(address.getCreationTimestamp()); +// assertNull(address.getGeneratedId()); +// assertNull(address.getStatus()); +// assertNull(address.getUsage()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testCreateGetResizeAndDeleteStandardDisk() +// throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; +// DiskId diskId = DiskId.of(ZONE, name); +// DiskInfo diskInfo = +// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// // test get +// Disk remoteDisk = compute.getDisk(diskId); +// resourceCleaner.add(diskId); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.resize(200L); +// operation.waitFor(); +// // test resize and get with selected fields +// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(200L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.delete(); +// operation.waitFor(); +// resourceCleaner.remove(diskId); +// assertNull(compute.getDisk(diskId)); +// } +// +// @Test +// public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; +// DiskId diskId = DiskId.of(ZONE, name); +// DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// // test get +// Disk remoteDisk = compute.getDisk(diskId); +// resourceCleaner.add(diskId); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); +// ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); +// assertNotNull(remoteConfiguration.getSourceImageId()); +// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); +// assertNotNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// // test get with selected fields +// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); +// remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); +// assertNull(remoteConfiguration.getSourceImageId()); +// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); +// assertNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.delete(); +// operation.waitFor(); +// resourceCleaner.remove(diskId); +// assertNull(compute.getDisk(diskId)); +// } +// +// @Test +// public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() +// throws InterruptedException, TimeoutException { +// String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; +// String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; +// DiskId diskId = DiskId.of(ZONE, diskName); +// DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); +// String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; +// DiskInfo diskInfo = +// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// Disk remoteDisk = compute.getDisk(diskId); +// resourceCleaner.add(diskId); +// operation = remoteDisk.createSnapshot(snapshotName); +// operation.waitFor(); +// // test get snapshot with selected fields +// Snapshot snapshot = compute.getSnapshot(snapshotName, +// Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); +// resourceCleaner.add(snapshot.getSnapshotId()); +// assertNull(snapshot.getGeneratedId()); +// assertNotNull(snapshot.getSnapshotId()); +// assertNotNull(snapshot.getCreationTimestamp()); +// assertNull(snapshot.getDescription()); +// assertNull(snapshot.getStatus()); +// assertNull(snapshot.getDiskSizeGb()); +// assertNull(snapshot.getLicenses()); +// assertNull(snapshot.getSourceDisk()); +// assertNull(snapshot.getSourceDiskId()); +// assertNull(snapshot.getStorageBytes()); +// assertNull(snapshot.getStorageBytesStatus()); +// // test get snapshot +// snapshot = compute.getSnapshot(snapshotName); +// assertNotNull(snapshot.getGeneratedId()); +// assertNotNull(snapshot.getSnapshotId()); +// assertNotNull(snapshot.getCreationTimestamp()); +// assertNotNull(snapshot.getStatus()); +// assertEquals(100L, (long) snapshot.getDiskSizeGb()); +// assertEquals(diskName, snapshot.getSourceDisk().getDisk()); +// assertNotNull(snapshot.getSourceDiskId()); +// assertNotNull(snapshot.getStorageBytes()); +// assertNotNull(snapshot.getStorageBytesStatus()); +// remoteDisk.delete(); +// resourceCleaner.remove(diskId); +// diskInfo = +// DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); +// operation = compute.create(diskInfo); +// operation.waitFor(); +// // test get disk +// remoteDisk = compute.getDisk(snapshotDiskId); +// resourceCleaner.add(snapshotDiskId); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); +// SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); +// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNotNull(remoteConfiguration.getSourceSnapshotId()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// // test get disk with selected fields +// remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNull(remoteDisk.getCreationStatus()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); +// remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); +// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); +// assertNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.delete(); +// operation.waitFor(); +// resourceCleaner.remove(snapshotDiskId); +// assertNull(compute.getDisk(snapshotDiskId)); +// operation = snapshot.delete(); +// operation.waitFor(); +// resourceCleaner.remove(snapshot.getSnapshotId()); +// assertNull(compute.getSnapshot(snapshotName)); +// } +// +// @Test +// public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; +// String[] diskNames = {prefix + "1", prefix + "2"}; +// DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); +// DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); +// DiskConfiguration configuration = +// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); +// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); +// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstDiskId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondDiskId); +// Set diskSet = ImmutableSet.copyOf(diskNames); +// // test list disks +// Compute.DiskFilter diskFilter = +// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); +// Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); +// Iterator diskIterator = diskPage.iterateAll().iterator(); +// int count = 0; +// while (diskIterator.hasNext()) { +// Disk remoteDisk = diskIterator.next(); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// count++; +// } +// assertEquals(2, count); +// // test list disks with selected fields +// count = 0; +// diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), +// Compute.DiskListOption.fields(Compute.DiskField.STATUS)); +// diskIterator = diskPage.iterateAll().iterator(); +// while (diskIterator.hasNext()) { +// Disk remoteDisk = diskIterator.next(); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// count++; +// } +// assertEquals(2, count); +// // test snapshots +// SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); +// SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); +// firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); +// secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstSnapshotId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondSnapshotId); +// // test list snapshots +// Compute.SnapshotFilter snapshotFilter = +// Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); +// Page snapshotPage = +// compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); +// Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); +// count = 0; +// while (snapshotIterator.hasNext()) { +// Snapshot remoteSnapshot = snapshotIterator.next(); +// assertNotNull(remoteSnapshot.getGeneratedId()); +// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); +// assertNotNull(remoteSnapshot.getCreationTimestamp()); +// assertNotNull(remoteSnapshot.getStatus()); +// assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); +// assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); +// assertNotNull(remoteSnapshot.getSourceDiskId()); +// assertNotNull(remoteSnapshot.getStorageBytes()); +// assertNotNull(remoteSnapshot.getStorageBytesStatus()); +// count++; +// } +// assertEquals(2, count); +// // test list snapshots with selected fields +// snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), +// Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); +// snapshotIterator = snapshotPage.iterateAll().iterator(); +// count = 0; +// while (snapshotIterator.hasNext()) { +// Snapshot remoteSnapshot = snapshotIterator.next(); +// assertNull(remoteSnapshot.getGeneratedId()); +// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); +// assertNotNull(remoteSnapshot.getCreationTimestamp()); +// assertNull(remoteSnapshot.getStatus()); +// assertNull(remoteSnapshot.getDiskSizeGb()); +// assertNull(remoteSnapshot.getSourceDisk()); +// assertNull(remoteSnapshot.getSourceDiskId()); +// assertNull(remoteSnapshot.getStorageBytes()); +// assertNull(remoteSnapshot.getStorageBytesStatus()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testAggregatedListDisks() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; +// String[] diskZones = {"us-central1-a", "us-east1-c"}; +// String[] diskNames = {prefix + "1", prefix + "2"}; +// DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); +// DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); +// DiskConfiguration configuration = +// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); +// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); +// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstDiskId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondDiskId); +// Set zoneSet = ImmutableSet.copyOf(diskZones); +// Set diskSet = ImmutableSet.copyOf(diskNames); +// Compute.DiskFilter diskFilter = +// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); +// Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); +// Iterator diskIterator = diskPage.iterateAll().iterator(); +// int count = 0; +// while (diskIterator.hasNext()) { +// Disk remoteDisk = diskIterator.next(); +// assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); +// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { +// String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; +// String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; +// DiskId diskId = DiskId.of(ZONE, diskName); +// ImageId imageId = ImageId.of(imageName); +// DiskInfo diskInfo = +// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// Disk remoteDisk = compute.getDisk(diskId); +// ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); +// operation = compute.create(imageInfo); +// operation.waitFor(); +// resourceCleaner.add(diskId); +// // test get image with selected fields +// Image image = compute.getImage(imageId, +// Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); +// resourceCleaner.add(imageId); +// assertNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNull(image.getDescription()); +// assertNotNull(image.getConfiguration()); +// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); +// DiskImageConfiguration remoteConfiguration = image.getConfiguration(); +// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); +// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); +// assertNull(image.getStatus()); +// assertNull(image.getDiskSizeGb()); +// assertNull(image.getLicenses()); +// assertNull(image.getDeprecationStatus()); +// // test get image +// image = compute.getImage(imageId); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); +// remoteConfiguration = image.getConfiguration(); +// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); +// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); +// assertEquals(100L, (long) image.getDiskSizeGb()); +// assertNotNull(image.getStatus()); +// assertNull(image.getDeprecationStatus()); +// // test deprecate image +// DeprecationStatus deprecationStatus = +// DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) +// .setDeprecated(System.currentTimeMillis()) +// .build(); +// operation = image.deprecate(deprecationStatus); +// operation.waitFor(); +// image = compute.getImage(imageId); +// assertEquals(deprecationStatus, image.getDeprecationStatus()); +// remoteDisk.delete(); +// resourceCleaner.remove(diskId); +// operation = image.delete(); +// operation.waitFor(); +// resourceCleaner.remove(imageId); +// assertNull(compute.getImage(imageId)); +// } +// +// @Test +// public void testListImages() { +// Page imagePage = compute.listImages(IMAGE_PROJECT); +// Iterator imageIterator = imagePage.iterateAll().iterator(); +// int count = 0; +// while (imageIterator.hasNext()) { +// count++; +// Image image = imageIterator.next(); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertNotNull(image.getStatus()); +// assertNotNull(image.getDiskSizeGb()); +// } +// assertTrue(count > 0); +// } +// +// @Test +// public void testListImagesWithSelectedFields() { +// Page imagePage = +// compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); +// Iterator imageIterator = imagePage.iterateAll().iterator(); +// int count = 0; +// while (imageIterator.hasNext()) { +// count++; +// Image image = imageIterator.next(); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertNull(image.getStatus()); +// assertNull(image.getDiskSizeGb()); +// assertNull(image.getLicenses()); +// assertNull(image.getDeprecationStatus()); +// } +// assertTrue(count > 0); +// } +// +// @Test +// public void testListImagesWithFilter() { +// Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( +// Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); +// Iterator imageIterator = imagePage.iterateAll().iterator(); +// int count = 0; +// while (imageIterator.hasNext()) { +// count++; +// Image image = imageIterator.next(); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertNotNull(image.getStatus()); +// assertNotNull(image.getDiskSizeGb()); +// assertEquals(365056004L, +// (long) image.getConfiguration().getArchiveSizeBytes()); +// } +// assertTrue(count > 0); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-network"; +// NetworkId networkId = NetworkId.of(name); +// NetworkInfo networkInfo = +// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// // test get network with selected fields +// Network network = compute.getNetwork(networkId.getNetwork(), +// Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); +// resourceCleaner.add(networkId); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertNull(network.getDescription()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// // test get network +// network = compute.getNetwork(networkId.getNetwork()); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNotNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// operation = network.delete(); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getNetwork(name)); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testListNetworks() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "list-network"; +// NetworkId networkId = NetworkId.of(name); +// NetworkInfo networkInfo = +// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// resourceCleaner.add(networkId); +// // test list +// Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); +// Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); +// Iterator networkIterator = networkPage.iterateAll().iterator(); +// int count = 0; +// while (networkIterator.hasNext()) { +// Network network = networkIterator.next(); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNotNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// // test list with selected fields +// count = 0; +// networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), +// Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); +// networkIterator = networkPage.iterateAll().iterator(); +// while (networkIterator.hasNext()) { +// Network network = networkIterator.next(); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertNull(network.getDescription()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// operation = compute.deleteNetwork(networkId); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getNetwork(name)); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { +// String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; +// NetworkId networkId = NetworkId.of(networkName); +// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// // test get network +// Network network = compute.getNetwork(networkId.getNetwork()); +// resourceCleaner.add(networkId); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNotNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); +// assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); +// assertFalse(network.getConfiguration().autoCreateSubnetworks()); +// String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; +// SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); +// SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); +// operation = compute.create(subnetworkInfo); +// operation.waitFor(); +// // test get subnetwork with selected fields +// Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, +// Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); +// resourceCleaner.add(subnetworkId); +// assertNull(subnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(subnetwork.getCreationTimestamp()); +// assertNull(subnetwork.getDescription()); +// assertNull(subnetwork.getGatewayAddress()); +// assertNull(subnetwork.getNetwork()); +// assertNull(subnetwork.getIpRange()); +// // test get subnetwork +// subnetwork = compute.getSubnetwork(subnetworkId); +// assertNotNull(subnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(subnetwork.getCreationTimestamp()); +// assertNotNull(subnetwork.getGatewayAddress()); +// assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); +// assertEquals("192.168.0.0/16", subnetwork.getIpRange()); +// // test list subnetworks +// Compute.SubnetworkFilter filter = +// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); +// Page subnetworkPage = +// compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); +// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); +// int count = 0; +// while (subnetworkIterator.hasNext()) { +// Subnetwork remoteSubnetwork = subnetworkIterator.next(); +// assertNotNull(remoteSubnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), +// remoteSubnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(remoteSubnetwork.getCreationTimestamp()); +// assertNotNull(remoteSubnetwork.getGatewayAddress()); +// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); +// assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// // test list subnetworks with selected fields +// subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), +// Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); +// subnetworkIterator = subnetworkPage.iterateAll().iterator(); +// count = 0; +// while (subnetworkIterator.hasNext()) { +// Subnetwork remoteSubnetwork = subnetworkIterator.next(); +// assertNull(remoteSubnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), +// remoteSubnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(remoteSubnetwork.getCreationTimestamp()); +// assertNull(remoteSubnetwork.getDescription()); +// assertNull(remoteSubnetwork.getGatewayAddress()); +// assertNull(remoteSubnetwork.getNetwork()); +// assertNull(remoteSubnetwork.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// operation = subnetwork.delete(); +// operation.waitFor(); +// resourceCleaner.remove(subnetworkId); +// operation = compute.deleteNetwork(networkId); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getSubnetwork(subnetworkId)); +// assertNull(compute.getNetwork(networkName)); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { +// String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; +// NetworkId networkId = NetworkId.of(networkName); +// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// resourceCleaner.add(networkId); +// String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; +// String[] regionNames = {"us-central1", "us-east1"}; +// String[] subnetworkNames = {prefix + "1", prefix + "2"}; +// String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; +// SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); +// SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); +// SubnetworkInfo firstSubnetworkInfo = +// SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); +// SubnetworkInfo secondSubnetworkInfo = +// SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); +// Operation firstOperation = compute.create(firstSubnetworkInfo); +// Operation secondOperation = compute.create(secondSubnetworkInfo); +// firstOperation.waitFor(); +// resourceCleaner.add(firstSubnetworkId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondSubnetworkId); +// Set regionSet = ImmutableSet.copyOf(regionNames); +// Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); +// Set rangeSet = ImmutableSet.copyOf(ipRanges); +// Compute.SubnetworkFilter subnetworkFilter = +// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); +// Page subnetworkPage = +// compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); +// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); +// int count = 0; +// while (subnetworkIterator.hasNext()) { +// Subnetwork remoteSubnetwork = subnetworkIterator.next(); +// assertNotNull(remoteSubnetwork.getGeneratedId()); +// assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); +// assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); +// assertNotNull(remoteSubnetwork.getCreationTimestamp()); +// assertNotNull(remoteSubnetwork.getGatewayAddress()); +// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); +// assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); +// count++; +// } +// assertEquals(2, count); +// firstOperation = compute.deleteSubnetwork(firstSubnetworkId); +// secondOperation = compute.deleteSubnetwork(secondSubnetworkId); +// firstOperation.waitFor(); +// resourceCleaner.remove(firstSubnetworkId); +// secondOperation.waitFor(); +// resourceCleaner.remove(secondSubnetworkId); +// operation = compute.deleteNetwork(networkId); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getSubnetwork(firstSubnetworkId)); +// assertNull(compute.getSubnetwork(secondSubnetworkId)); +// assertNull(compute.getNetwork(networkName)); +// } +// +// @Test +// public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; +// String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; +// // Create an address to assign to the instance +// AddressId addressId = RegionAddressId.of(REGION, addressName); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation operation = compute.create(addressInfo); +// operation.waitFor(); +// Address address = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// // Create an instance +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) +// .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() +// .setName("NAT") +// .setNatIp(address.getAddress()).build()) +// .build(); +// AttachedDisk disk1 = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// AttachedDisk disk2 = +// AttachedDisk.of("dev1", +// AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) +// .setAttachedDisks(disk1, disk2) +// .setNetworkInterfaces(networkInterface) +// .build(); +// operation = compute.create(instanceInfo); +// operation.waitFor(); +// // test get +// Instance remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); +// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); +// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); +// assertNotNull(remoteInstance.getCreationTimestamp()); +// Set deviceSet = ImmutableSet.of("dev0", "dev1"); +// assertEquals(2, remoteInstance.getAttachedDisks().size()); +// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { +// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); +// } +// assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, +// remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); +// AttachedDisk.PersistentDiskConfiguration remoteConfiguration = +// remoteInstance.getAttachedDisks().get(0).getConfiguration(); +// assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); +// assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); +// assertTrue(remoteConfiguration.boot()); +// assertTrue(remoteConfiguration.autoDelete()); +// assertEquals(1, remoteInstance.getNetworkInterfaces().size()); +// NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); +// assertNotNull(remoteNetworkInterface.getName()); +// assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); +// List remoteAccessConfigurations = +// remoteNetworkInterface.getAccessConfigurations(); +// assertNotNull(remoteAccessConfigurations); +// assertEquals(1, remoteAccessConfigurations.size()); +// NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); +// assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); +// assertEquals("NAT", remoteAccessConfig.getName()); +// assertNotNull(remoteInstance.getMetadata()); +// assertNotNull(remoteInstance.getTags()); +// // test get with selected fields +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); +// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); +// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); +// assertNull(remoteInstance.getMachineType()); +// assertNotNull(remoteInstance.getCreationTimestamp()); +// assertNull(remoteInstance.getAttachedDisks()); +// assertNull(remoteInstance.getNetworkInterfaces()); +// assertNull(remoteInstance.getMetadata()); +// assertNull(remoteInstance.getTags()); +// // test get default serial port output +// String serialPortOutput = remoteInstance.getSerialPortOutput(); +// assertNotNull(serialPortOutput); +// // test get serial port output by number +// String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); +// assertTrue(newSerialPortOutput.contains(serialPortOutput)); +// operation = remoteInstance.delete(); +// operation.waitFor(); +// resourceCleaner.remove(instanceId); +// assertNull(compute.getInstance(instanceId)); +// } +// +// @Test +// public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation operation = compute.create(instanceInfo); +// operation.waitFor(); +// Instance remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// resourceCleaner.add(instanceId); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// operation = remoteInstance.stop(); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); +// operation = remoteInstance.start(); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// operation = remoteInstance.reset(); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// } +// +// @Test +// public void testSetInstanceProperties() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation operation = compute.create(instanceInfo); +// operation.waitFor(); +// Instance remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// // test set tags +// List tags = ImmutableList.of("tag1", "tag2"); +// operation = remoteInstance.setTags(tags); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(tags, remoteInstance.getTags().getValues()); +// // test set metadata +// Map metadata = ImmutableMap.of("key", "value"); +// operation = remoteInstance.setMetadata(metadata); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(metadata, remoteInstance.getMetadata().getValues()); +// // test set machine type +// operation = remoteInstance.stop(); +// operation.waitFor(); +// operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); +// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); +// // test set scheduling options +// SchedulingOptions options = +// SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); +// operation = remoteInstance.setSchedulingOptions(options); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(options, remoteInstance.getSchedulingOptions()); +// } +// +// @Test +// public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; +// String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation instanceOperation = compute.create(instanceInfo); +// DiskId diskId = DiskId.of(ZONE, diskName); +// Operation diskOperation = compute.create(DiskInfo.of(diskId, +// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); +// instanceOperation.waitFor(); +// diskOperation.waitFor(); +// resourceCleaner.add(diskId); +// Instance remoteInstance = compute.getInstance(instanceId); +// // test attach disk +// instanceOperation = remoteInstance.attachDisk("dev1", +// AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// Set deviceSet = ImmutableSet.of("dev0", "dev1"); +// assertEquals(2, remoteInstance.getAttachedDisks().size()); +// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { +// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); +// } +// // test set disk auto-delete +// instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(2, remoteInstance.getAttachedDisks().size()); +// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { +// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); +// assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); +// } +// // test detach disk +// instanceOperation = remoteInstance.detachDisk("dev1"); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(1, remoteInstance.getAttachedDisks().size()); +// assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); +// } +// +// @Test +// public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; +// String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation instanceOperation = compute.create(instanceInfo); +// AddressId addressId = RegionAddressId.of(REGION, addressName); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation addressOperation = compute.create(addressInfo); +// addressOperation.waitFor(); +// instanceOperation.waitFor(); +// Address remoteAddress = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// Instance remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); +// // test add access config +// NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() +// .setNatIp(remoteAddress.getAddress()) +// .setName("NAT") +// .build(); +// instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// List accessConfigurations = +// remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); +// assertEquals(1, accessConfigurations.size()); +// assertEquals("NAT", accessConfigurations.get(0).getName()); +// // test delete access config +// instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); +// } +// } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..7c40cedf2776 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AbandonInstancesInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private AbandonInstancesInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagersAbandonInstancesRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AbandonInstancesInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagersAbandonInstancesRequestResource = instanceGroupManagersAbandonInstancesRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersAbandonInstancesRequestResource") && instanceGroupManagersAbandonInstancesRequestResource != null) { + fieldMap.put("instanceGroupManagersAbandonInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersAbandonInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("instanceGroupManagersAbandonInstancesRequestResource")) { + return String.valueOf(instanceGroupManagersAbandonInstancesRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBody() { + return instanceGroupManagersAbandonInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManagersAbandonInstancesRequest getInstanceGroupManagersAbandonInstancesRequestResource() { + return instanceGroupManagersAbandonInstancesRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AbandonInstancesInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AbandonInstancesInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AbandonInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AbandonInstancesInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AbandonInstancesInstanceGroupManagerHttpRequest other) { + if (other == AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagersAbandonInstancesRequestResource() != null) { + this.instanceGroupManagersAbandonInstancesRequestResource = other.instanceGroupManagersAbandonInstancesRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AbandonInstancesInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagersAbandonInstancesRequestResource = source.instanceGroupManagersAbandonInstancesRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManagersAbandonInstancesRequest getInstanceGroupManagersAbandonInstancesRequestResource() { + return instanceGroupManagersAbandonInstancesRequestResource; + } + + public Builder setInstanceGroupManagersAbandonInstancesRequestResource(InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { + this.instanceGroupManagersAbandonInstancesRequestResource = instanceGroupManagersAbandonInstancesRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AbandonInstancesInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AbandonInstancesInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersAbandonInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagersAbandonInstancesRequestResource(this.instanceGroupManagersAbandonInstancesRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AbandonInstancesInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "instanceGroupManagersAbandonInstancesRequestResource=" + instanceGroupManagersAbandonInstancesRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AbandonInstancesInstanceGroupManagerHttpRequest) { + AbandonInstancesInstanceGroupManagerHttpRequest that = (AbandonInstancesInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.instanceGroupManagersAbandonInstancesRequestResource, that.getInstanceGroupManagersAbandonInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersAbandonInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..eb11482759c5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AbandonInstancesRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource; + private final String userIp; + + private AbandonInstancesRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupManagersAbandonInstancesRequestResource = null; + this.userIp = null; + } + + + private AbandonInstancesRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupManagersAbandonInstancesRequestResource = regionInstanceGroupManagersAbandonInstancesRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource") && regionInstanceGroupManagersAbandonInstancesRequestResource != null) { + fieldMap.put("regionInstanceGroupManagersAbandonInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupManagersAbandonInstancesRequestResource")) { + return String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBody() { + return regionInstanceGroupManagersAbandonInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupManagersAbandonInstancesRequest getRegionInstanceGroupManagersAbandonInstancesRequestResource() { + return regionInstanceGroupManagersAbandonInstancesRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AbandonInstancesRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AbandonInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AbandonInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AbandonInstancesRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AbandonInstancesRegionInstanceGroupManagerHttpRequest other) { + if (other == AbandonInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupManagersAbandonInstancesRequestResource() != null) { + this.regionInstanceGroupManagersAbandonInstancesRequestResource = other.regionInstanceGroupManagersAbandonInstancesRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AbandonInstancesRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupManagersAbandonInstancesRequestResource = source.regionInstanceGroupManagersAbandonInstancesRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupManagersAbandonInstancesRequest getRegionInstanceGroupManagersAbandonInstancesRequestResource() { + return regionInstanceGroupManagersAbandonInstancesRequestResource; + } + + public Builder setRegionInstanceGroupManagersAbandonInstancesRequestResource(RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { + this.regionInstanceGroupManagersAbandonInstancesRequestResource = regionInstanceGroupManagersAbandonInstancesRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AbandonInstancesRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AbandonInstancesRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersAbandonInstancesRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupManagersAbandonInstancesRequestResource(this.regionInstanceGroupManagersAbandonInstancesRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AbandonInstancesRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupManagersAbandonInstancesRequestResource=" + regionInstanceGroupManagersAbandonInstancesRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AbandonInstancesRegionInstanceGroupManagerHttpRequest) { + AbandonInstancesRegionInstanceGroupManagerHttpRequest that = (AbandonInstancesRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupManagersAbandonInstancesRequestResource, that.getRegionInstanceGroupManagersAbandonInstancesRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersAbandonInstancesRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java new file mode 100644 index 000000000000..c005ea93500f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AccessConfig implements ApiMessage { + private final String kind; + private final String name; + private final String natIP; + private final String type; + + private AccessConfig() { + this.kind = null; + this.name = null; + this.natIP = null; + this.type = null; + } + + + private AccessConfig( + String kind, + String name, + String natIP, + String type + ) { + this.kind = kind; + this.name = name; + this.natIP = natIP; + this.type = type; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("natIP") && natIP != null) { + fieldMap.put("natIP", Collections.singletonList(String.valueOf(natIP))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("natIP")) { + return String.valueOf(natIP); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNatIP() { + return natIP; + } + + public String getType() { + return type; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AccessConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AccessConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AccessConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AccessConfig(); + } + + public static class Builder { + private String kind; + private String name; + private String natIP; + private String type; + + Builder() {} + + public Builder mergeFrom(AccessConfig other) { + if (other == AccessConfig.getDefaultInstance()) return this; + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNatIP() != null) { + this.natIP = other.natIP; + } + if (other.getType() != null) { + this.type = other.type; + } + return this; + } + + Builder(AccessConfig source) { + this.kind = source.kind; + this.name = source.name; + this.natIP = source.natIP; + this.type = source.type; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNatIP() { + return natIP; + } + + public Builder setNatIP(String natIP) { + this.natIP = natIP; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + + public AccessConfig build() { + + + + return new AccessConfig( + kind, + name, + natIP, + type + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNatIP(this.natIP); + newBuilder.setType(this.type); + return newBuilder; + } + } + + @Override + public String toString() { + return "AccessConfig{" + + "kind=" + kind + ", " + + "name=" + name + ", " + + "natIP=" + natIP + ", " + + "type=" + type + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AccessConfig) { + AccessConfig that = (AccessConfig) o; + return + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.natIP, that.getNatIP()) && + Objects.equals(this.type, that.getType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + kind, + name, + natIP, + type + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java new file mode 100644 index 000000000000..43fb8056a332 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java @@ -0,0 +1,477 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddAccessConfigInstanceHttpRequest implements ApiMessage { + private final AccessConfig accessConfigResource; + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String networkInterface; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private AddAccessConfigInstanceHttpRequest() { + this.accessConfigResource = null; + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.networkInterface = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AddAccessConfigInstanceHttpRequest( + AccessConfig accessConfigResource, + String access_token, + String callback, + String fields, + String instance, + String key, + String networkInterface, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.accessConfigResource = accessConfigResource; + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.networkInterface = networkInterface; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { + fieldMap.put("accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("accessConfigResource")) { + return String.valueOf(accessConfigResource); + } + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("networkInterface")) { + return String.valueOf(networkInterface); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public AccessConfig getApiMessageRequestBody() { + return accessConfigResource; + } + + public AccessConfig getAccessConfigResource() { + return accessConfigResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddAccessConfigInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddAccessConfigInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddAccessConfigInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddAccessConfigInstanceHttpRequest(); + } + + public static class Builder { + private AccessConfig accessConfigResource; + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String networkInterface; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AddAccessConfigInstanceHttpRequest other) { + if (other == AddAccessConfigInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessConfigResource() != null) { + this.accessConfigResource = other.accessConfigResource; + } + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetworkInterface() != null) { + this.networkInterface = other.networkInterface; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AddAccessConfigInstanceHttpRequest source) { + this.accessConfigResource = source.accessConfigResource; + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.networkInterface = source.networkInterface; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public AccessConfig getAccessConfigResource() { + return accessConfigResource; + } + + public Builder setAccessConfigResource(AccessConfig accessConfigResource) { + this.accessConfigResource = accessConfigResource; + return this; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public Builder setNetworkInterface(String networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AddAccessConfigInstanceHttpRequest build() { + String missing = ""; + + + + + if (instance == null) { + missing += " instance"; + } + + if (networkInterface == null) { + missing += " networkInterface"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AddAccessConfigInstanceHttpRequest( + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessConfigResource(this.accessConfigResource); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setNetworkInterface(this.networkInterface); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddAccessConfigInstanceHttpRequest{" + + "accessConfigResource=" + accessConfigResource + ", " + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "networkInterface=" + networkInterface + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddAccessConfigInstanceHttpRequest) { + AddAccessConfigInstanceHttpRequest that = (AddAccessConfigInstanceHttpRequest) o; + return + Objects.equals(this.accessConfigResource, that.getAccessConfigResource()) && + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.networkInterface, that.getNetworkInterface()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java new file mode 100644 index 000000000000..81161647787d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddHealthCheckTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource; + private final String userIp; + + private AddHealthCheckTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.targetPoolsAddHealthCheckRequestResource = null; + this.userIp = null; + } + + + private AddHealthCheckTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.targetPoolsAddHealthCheckRequestResource = targetPoolsAddHealthCheckRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsAddHealthCheckRequestResource") && targetPoolsAddHealthCheckRequestResource != null) { + fieldMap.put("targetPoolsAddHealthCheckRequestResource", Collections.singletonList(String.valueOf(targetPoolsAddHealthCheckRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("targetPoolsAddHealthCheckRequestResource")) { + return String.valueOf(targetPoolsAddHealthCheckRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetPoolsAddHealthCheckRequest getApiMessageRequestBody() { + return targetPoolsAddHealthCheckRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public TargetPoolsAddHealthCheckRequest getTargetPoolsAddHealthCheckRequestResource() { + return targetPoolsAddHealthCheckRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddHealthCheckTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddHealthCheckTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddHealthCheckTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddHealthCheckTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AddHealthCheckTargetPoolHttpRequest other) { + if (other == AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getTargetPoolsAddHealthCheckRequestResource() != null) { + this.targetPoolsAddHealthCheckRequestResource = other.targetPoolsAddHealthCheckRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AddHealthCheckTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.targetPoolsAddHealthCheckRequestResource = source.targetPoolsAddHealthCheckRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public TargetPoolsAddHealthCheckRequest getTargetPoolsAddHealthCheckRequestResource() { + return targetPoolsAddHealthCheckRequestResource; + } + + public Builder setTargetPoolsAddHealthCheckRequestResource(TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + this.targetPoolsAddHealthCheckRequestResource = targetPoolsAddHealthCheckRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AddHealthCheckTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AddHealthCheckTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsAddHealthCheckRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setTargetPoolsAddHealthCheckRequestResource(this.targetPoolsAddHealthCheckRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddHealthCheckTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "targetPoolsAddHealthCheckRequestResource=" + targetPoolsAddHealthCheckRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddHealthCheckTargetPoolHttpRequest) { + AddHealthCheckTargetPoolHttpRequest that = (AddHealthCheckTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.targetPoolsAddHealthCheckRequestResource, that.getTargetPoolsAddHealthCheckRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsAddHealthCheckRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java new file mode 100644 index 000000000000..d5c04bc3a519 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddInstanceTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource; + private final String userIp; + + private AddInstanceTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.targetPoolsAddInstanceRequestResource = null; + this.userIp = null; + } + + + private AddInstanceTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.targetPoolsAddInstanceRequestResource = targetPoolsAddInstanceRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsAddInstanceRequestResource") && targetPoolsAddInstanceRequestResource != null) { + fieldMap.put("targetPoolsAddInstanceRequestResource", Collections.singletonList(String.valueOf(targetPoolsAddInstanceRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("targetPoolsAddInstanceRequestResource")) { + return String.valueOf(targetPoolsAddInstanceRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetPoolsAddInstanceRequest getApiMessageRequestBody() { + return targetPoolsAddInstanceRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public TargetPoolsAddInstanceRequest getTargetPoolsAddInstanceRequestResource() { + return targetPoolsAddInstanceRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddInstanceTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddInstanceTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddInstanceTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddInstanceTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AddInstanceTargetPoolHttpRequest other) { + if (other == AddInstanceTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getTargetPoolsAddInstanceRequestResource() != null) { + this.targetPoolsAddInstanceRequestResource = other.targetPoolsAddInstanceRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AddInstanceTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.targetPoolsAddInstanceRequestResource = source.targetPoolsAddInstanceRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public TargetPoolsAddInstanceRequest getTargetPoolsAddInstanceRequestResource() { + return targetPoolsAddInstanceRequestResource; + } + + public Builder setTargetPoolsAddInstanceRequestResource(TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + this.targetPoolsAddInstanceRequestResource = targetPoolsAddInstanceRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AddInstanceTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AddInstanceTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsAddInstanceRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setTargetPoolsAddInstanceRequestResource(this.targetPoolsAddInstanceRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddInstanceTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "targetPoolsAddInstanceRequestResource=" + targetPoolsAddInstanceRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddInstanceTargetPoolHttpRequest) { + AddInstanceTargetPoolHttpRequest that = (AddInstanceTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.targetPoolsAddInstanceRequestResource, that.getTargetPoolsAddInstanceRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsAddInstanceRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..a3bb51a3c9b9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddInstancesInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private AddInstancesInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.instanceGroupsAddInstancesRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AddInstancesInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.instanceGroupsAddInstancesRequestResource = instanceGroupsAddInstancesRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsAddInstancesRequestResource") && instanceGroupsAddInstancesRequestResource != null) { + fieldMap.put("instanceGroupsAddInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsAddInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("instanceGroupsAddInstancesRequestResource")) { + return String.valueOf(instanceGroupsAddInstancesRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupsAddInstancesRequest getApiMessageRequestBody() { + return instanceGroupsAddInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public InstanceGroupsAddInstancesRequest getInstanceGroupsAddInstancesRequestResource() { + return instanceGroupsAddInstancesRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddInstancesInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddInstancesInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddInstancesInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddInstancesInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AddInstancesInstanceGroupHttpRequest other) { + if (other == AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getInstanceGroupsAddInstancesRequestResource() != null) { + this.instanceGroupsAddInstancesRequestResource = other.instanceGroupsAddInstancesRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AddInstancesInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.instanceGroupsAddInstancesRequestResource = source.instanceGroupsAddInstancesRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public InstanceGroupsAddInstancesRequest getInstanceGroupsAddInstancesRequestResource() { + return instanceGroupsAddInstancesRequestResource; + } + + public Builder setInstanceGroupsAddInstancesRequestResource(InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + this.instanceGroupsAddInstancesRequestResource = instanceGroupsAddInstancesRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AddInstancesInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AddInstancesInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + instanceGroupsAddInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setInstanceGroupsAddInstancesRequestResource(this.instanceGroupsAddInstancesRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddInstancesInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "instanceGroupsAddInstancesRequestResource=" + instanceGroupsAddInstancesRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddInstancesInstanceGroupHttpRequest) { + AddInstancesInstanceGroupHttpRequest that = (AddInstancesInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.instanceGroupsAddInstancesRequestResource, that.getInstanceGroupsAddInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + instanceGroupsAddInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java new file mode 100644 index 000000000000..968b7d1413a3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java @@ -0,0 +1,480 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Address implements ApiMessage { + private final String address; + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String region; + private final String selfLink; + private final String status; + private final List users; + + private Address() { + this.address = null; + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.region = null; + this.selfLink = null; + this.status = null; + this.users = null; + } + + + private Address( + String address, + String creationTimestamp, + String description, + String id, + String kind, + String name, + String region, + String selfLink, + String status, + List users + ) { + this.address = address; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.region = region; + this.selfLink = selfLink; + this.status = status; + this.users = users; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("users") && users != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : users) { + stringList.add(item.toString()); + } + fieldMap.put("users", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("address")) { + return String.valueOf(address); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("users")) { + return String.valueOf(users); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAddress() { + return address; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStatus() { + return status; + } + + public List getUsersList() { + return users; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Address prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Address getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Address DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Address(); + } + + public static class Builder { + private String address; + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String region; + private String selfLink; + private String status; + private List users; + + Builder() {} + + public Builder mergeFrom(Address other) { + if (other == Address.getDefaultInstance()) return this; + if (other.getAddress() != null) { + this.address = other.address; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getUsersList() != null) { + this.users = other.users; + } + return this; + } + + Builder(Address source) { + this.address = source.address; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.region = source.region; + this.selfLink = source.selfLink; + this.status = source.status; + this.users = source.users; + } + + public String getAddress() { + return address; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public List getUsersList() { + return users; + } + + public Builder addAllUsers(List users) { + if (this.users == null) { + this.users = new ArrayList<>(users.size()); + } + this.users.addAll(users); + return this; + } + + public Builder addUsers(String users) { + this.users.add(users); + return this; + } + + + public Address build() { + + + + + + + + + + return new Address( + address, + creationTimestamp, + description, + id, + kind, + name, + region, + selfLink, + status, + users + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAddress(this.address); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); + newBuilder.addAllUsers(this.users); + return newBuilder; + } + } + + @Override + public String toString() { + return "Address{" + + "address=" + address + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "status=" + status + ", " + + "users=" + users + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Address) { + Address that = (Address) o; + return + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.users, that.getUsersList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + address, + creationTimestamp, + description, + id, + kind, + name, + region, + selfLink, + status, + users + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java new file mode 100644 index 000000000000..f8f67a9da712 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddressAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private AddressAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private AddressAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddressAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddressAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddressAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddressAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(AddressAggregatedList other) { + if (other == AddressAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(AddressAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public AddressAggregatedList build() { + + + + + return new AddressAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddressAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddressAggregatedList) { + AddressAggregatedList that = (AddressAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java new file mode 100644 index 000000000000..3e9ed3422d97 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java @@ -0,0 +1,936 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.AddressStub; +import com.google.cloud.compute.v1.stub.AddressStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (AddressClient addressClient = AddressClient.create()) {
+ *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ *   Operation response = addressClient.deleteAddress(address);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the addressClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of AddressSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * AddressSettings addressSettings =
+ *     AddressSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AddressClient addressClient =
+ *     AddressClient.create(addressSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AddressSettings addressSettings =
+ *     AddressSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AddressClient addressClient =
+ *     AddressClient.create(addressSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AddressClient implements BackgroundResource { + private final AddressSettings settings; + private final AddressStub stub; + + + + /** + * Constructs an instance of AddressClient with default settings. + */ + public static final AddressClient create() throws IOException { + return create(AddressSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AddressClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final AddressClient create(AddressSettings settings) throws IOException { + return new AddressClient(settings); + } + + /** + * Constructs an instance of AddressClient, using the given stub for making calls. This is for + * advanced usage - prefer to use AddressSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AddressClient create(AddressStub stub) { + return new AddressClient(stub); + } + + /** + * Constructs an instance of AddressClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected AddressClient(AddressSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AddressStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AddressClient(AddressStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AddressSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AddressStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of addresses. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (AddressesScopedList element : addressClient.aggregatedListAddresses(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAddressesPagedResponse aggregatedListAddresses(ProjectName project) { + AggregatedListAddressesHttpRequest request = + AggregatedListAddressesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListAddresses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of addresses. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (AddressesScopedList element : addressClient.aggregatedListAddresses(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAddressesPagedResponse aggregatedListAddresses(String project) { + AggregatedListAddressesHttpRequest request = + AggregatedListAddressesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListAddresses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of addresses. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAddressesHttpRequest request = AggregatedListAddressesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (AddressesScopedList element : addressClient.aggregatedListAddresses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAddressesPagedResponse aggregatedListAddresses(AggregatedListAddressesHttpRequest request) { + return aggregatedListAddressesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of addresses. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAddressesHttpRequest request = AggregatedListAddressesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListAddressesPagedResponse> future = addressClient.aggregatedListAddressesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (AddressesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListAddressesPagedCallable() { + return stub.aggregatedListAddressesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of addresses. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAddressesHttpRequest request = AggregatedListAddressesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     AddressAggregatedList response = addressClient.aggregatedListAddressesCallable().call(request);
+   *     for (AddressesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListAddressesCallable() { + return stub.aggregatedListAddressesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   Operation response = addressClient.deleteAddress(address);
+   * }
+   * 
+ * + * @param address Name of the address resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAddress(AddressName address) { + + DeleteAddressHttpRequest request = + DeleteAddressHttpRequest.newBuilder() + .setAddress(address == null ? null : address.toString()) + .build(); + return deleteAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   Operation response = addressClient.deleteAddress(address.toString());
+   * }
+   * 
+ * + * @param address Name of the address resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAddress(String address) { + + DeleteAddressHttpRequest request = + DeleteAddressHttpRequest.newBuilder() + .setAddress(address) + .build(); + return deleteAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   Operation response = addressClient.deleteAddress(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAddress(DeleteAddressHttpRequest request) { + return deleteAddressCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = addressClient.deleteAddressCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteAddressCallable() { + return stub.deleteAddressCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   Address response = addressClient.getAddress(address);
+   * }
+   * 
+ * + * @param address Name of the address resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Address getAddress(AddressName address) { + + GetAddressHttpRequest request = + GetAddressHttpRequest.newBuilder() + .setAddress(address == null ? null : address.toString()) + .build(); + return getAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   Address response = addressClient.getAddress(address.toString());
+   * }
+   * 
+ * + * @param address Name of the address resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Address getAddress(String address) { + + GetAddressHttpRequest request = + GetAddressHttpRequest.newBuilder() + .setAddress(address) + .build(); + return getAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   Address response = addressClient.getAddress(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Address getAddress(GetAddressHttpRequest request) { + return getAddressCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   ApiFuture<Address> future = addressClient.getAddressCallable().futureCall(request);
+   *   // Do something
+   *   Address response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getAddressCallable() { + return stub.getAddressCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   Operation response = addressClient.insertAddress(region, addressResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param addressResource A reserved address resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertAddress(RegionName region, Address addressResource) { + + InsertAddressHttpRequest request = + InsertAddressHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setAddressResource(addressResource) + .build(); + return insertAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   Operation response = addressClient.insertAddress(region.toString(), addressResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param addressResource A reserved address resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertAddress(String region, Address addressResource) { + + InsertAddressHttpRequest request = + InsertAddressHttpRequest.newBuilder() + .setRegion(region) + .setAddressResource(addressResource) + .build(); + return insertAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setAddressResource(addressResource)
+   *     .build();
+   *   Operation response = addressClient.insertAddress(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertAddress(InsertAddressHttpRequest request) { + return insertAddressCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setAddressResource(addressResource)
+   *     .build();
+   *   ApiFuture<Operation> future = addressClient.insertAddressCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertAddressCallable() { + return stub.insertAddressCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of addresses contained within the specified region. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Address element : addressClient.listAddresses(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAddressesPagedResponse listAddresses(RegionName region) { + ListAddressesHttpRequest request = + ListAddressesHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listAddresses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of addresses contained within the specified region. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Address element : addressClient.listAddresses(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAddressesPagedResponse listAddresses(String region) { + ListAddressesHttpRequest request = + ListAddressesHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listAddresses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of addresses contained within the specified region. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Address element : addressClient.listAddresses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAddressesPagedResponse listAddresses(ListAddressesHttpRequest request) { + return listAddressesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of addresses contained within the specified region. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListAddressesPagedResponse> future = addressClient.listAddressesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Address element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listAddressesPagedCallable() { + return stub.listAddressesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of addresses contained within the specified region. + * + * Sample code: + *

+   * try (AddressClient addressClient = AddressClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     AddressList response = addressClient.listAddressesCallable().call(request);
+   *     for (Address element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listAddressesCallable() { + return stub.listAddressesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListAddressesPagedResponse extends AbstractPagedListResponse< + AggregatedListAddressesHttpRequest, + AddressAggregatedList, + AddressesScopedList, + AggregatedListAddressesPage, + AggregatedListAddressesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListAddressesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListAddressesPagedResponse apply(AggregatedListAddressesPage input) { + return new AggregatedListAddressesPagedResponse(input); + } + }); + } + + private AggregatedListAddressesPagedResponse(AggregatedListAddressesPage page) { + super(page, AggregatedListAddressesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListAddressesPage extends AbstractPage< + AggregatedListAddressesHttpRequest, + AddressAggregatedList, + AddressesScopedList, + AggregatedListAddressesPage> { + + private AggregatedListAddressesPage( + PageContext context, + AddressAggregatedList response) { + super(context, response); + } + + private static AggregatedListAddressesPage createEmptyPage() { + return new AggregatedListAddressesPage(null, null); + } + + @Override + protected AggregatedListAddressesPage createPage( + PageContext context, + AddressAggregatedList response) { + return new AggregatedListAddressesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListAddressesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListAddressesHttpRequest, + AddressAggregatedList, + AddressesScopedList, + AggregatedListAddressesPage, + AggregatedListAddressesFixedSizeCollection> { + + private AggregatedListAddressesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListAddressesFixedSizeCollection createEmptyCollection() { + return new AggregatedListAddressesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListAddressesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListAddressesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListAddressesPagedResponse extends AbstractPagedListResponse< + ListAddressesHttpRequest, + AddressList, + Address, + ListAddressesPage, + ListAddressesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAddressesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAddressesPagedResponse apply(ListAddressesPage input) { + return new ListAddressesPagedResponse(input); + } + }); + } + + private ListAddressesPagedResponse(ListAddressesPage page) { + super(page, ListAddressesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListAddressesPage extends AbstractPage< + ListAddressesHttpRequest, + AddressList, + Address, + ListAddressesPage> { + + private ListAddressesPage( + PageContext context, + AddressList response) { + super(context, response); + } + + private static ListAddressesPage createEmptyPage() { + return new ListAddressesPage(null, null); + } + + @Override + protected ListAddressesPage createPage( + PageContext context, + AddressList response) { + return new ListAddressesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListAddressesFixedSizeCollection extends AbstractFixedSizeCollection< + ListAddressesHttpRequest, + AddressList, + Address, + ListAddressesPage, + ListAddressesFixedSizeCollection> { + + private ListAddressesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAddressesFixedSizeCollection createEmptyCollection() { + return new ListAddressesFixedSizeCollection(null, 0); + } + + @Override + protected ListAddressesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAddressesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java new file mode 100644 index 000000000000..475c0b8b97c4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddressList implements ApiMessage { + private final String id; + private final List
items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private AddressList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private AddressList( + String id, + List
items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Address item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List
getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddressList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddressList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddressList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddressList(); + } + + public static class Builder { + private String id; + private List
items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(AddressList other) { + if (other == AddressList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(AddressList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List
getItemsList() { + return items; + } + + public Builder addAllItems(List
items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Address items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public AddressList build() { + + + + + return new AddressList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddressList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddressList) { + AddressList that = (AddressList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java new file mode 100644 index 000000000000..1363833e31cd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class AddressName implements ResourceName { + private final String address; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/addresses/{address}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AddressName(Builder builder) { + address = Preconditions.checkNotNull(builder.getAddress()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static AddressName of( + String address, + String project, + String region + ) { + return newBuilder() + .setAddress(address) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String address, + String project, + String region + ) { + return of( + address, + project, + region + ) + .toString(); + } + + public String getAddress() { + return address; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("address", address); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public AddressName parse(String formattedString) {return AddressName.parse(formattedString);} + }; + } + + public static AddressName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "AddressName.parse: formattedString not in valid format"); + return of( + matchMap.get("address"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String address; + private String project; + private String region; + + public String getAddress() { + return address; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (AddressName addressName) { + address = addressName.address; + project = addressName.project; + region = addressName.region; + } + + public AddressName build() { + return new AddressName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "address", address, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddressName) { + AddressName that = (AddressName) o; + return + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + address, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java new file mode 100644 index 000000000000..ab370194f470 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import com.google.cloud.compute.v1.stub.AddressStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AddressClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteAddress to 30 seconds: + * + *

+ * 
+ * AddressSettings.Builder addressSettingsBuilder =
+ *     AddressSettings.newBuilder();
+ * addressSettingsBuilder.deleteAddressSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AddressSettings addressSettings = addressSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AddressSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListAddresses. + */ + public PagedCallSettings aggregatedListAddressesSettings() { + return ((AddressStubSettings) getStubSettings()).aggregatedListAddressesSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteAddress. + */ + public UnaryCallSettings deleteAddressSettings() { + return ((AddressStubSettings) getStubSettings()).deleteAddressSettings(); + } + + /** + * Returns the object with the settings used for calls to getAddress. + */ + public UnaryCallSettings getAddressSettings() { + return ((AddressStubSettings) getStubSettings()).getAddressSettings(); + } + + /** + * Returns the object with the settings used for calls to insertAddress. + */ + public UnaryCallSettings insertAddressSettings() { + return ((AddressStubSettings) getStubSettings()).insertAddressSettings(); + } + + /** + * Returns the object with the settings used for calls to listAddresses. + */ + public PagedCallSettings listAddressesSettings() { + return ((AddressStubSettings) getStubSettings()).listAddressesSettings(); + } + + + public static final AddressSettings create(AddressStubSettings stub) throws IOException { + return new AddressSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AddressStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return AddressStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return AddressStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return AddressStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AddressStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return AddressStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AddressStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AddressStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AddressSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for AddressSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AddressStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AddressStubSettings.newBuilder()); + } + + protected Builder(AddressSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AddressStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public AddressStubSettings.Builder getStubSettingsBuilder() { + return ((AddressStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListAddresses. + */ + public PagedCallSettings.Builder aggregatedListAddressesSettings() { + return getStubSettingsBuilder().aggregatedListAddressesSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteAddress. + */ + public UnaryCallSettings.Builder deleteAddressSettings() { + return getStubSettingsBuilder().deleteAddressSettings(); + } + + /** + * Returns the builder for the settings used for calls to getAddress. + */ + public UnaryCallSettings.Builder getAddressSettings() { + return getStubSettingsBuilder().getAddressSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertAddress. + */ + public UnaryCallSettings.Builder insertAddressSettings() { + return getStubSettingsBuilder().insertAddressSettings(); + } + + /** + * Returns the builder for the settings used for calls to listAddresses. + */ + public PagedCallSettings.Builder listAddressesSettings() { + return getStubSettingsBuilder().listAddressesSettings(); + } + + @Override + public AddressSettings build() throws IOException { + return new AddressSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java new file mode 100644 index 000000000000..4f5641437f4c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddressesScopedList implements ApiMessage { + private final List
addresses; + private final Warning warning; + + private AddressesScopedList() { + this.addresses = null; + this.warning = null; + } + + + private AddressesScopedList( + List
addresses, + Warning warning + ) { + this.addresses = addresses; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("addresses") && addresses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Address item : addresses) { + stringList.add(item.toString()); + } + fieldMap.put("addresses", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("addresses")) { + return String.valueOf(addresses); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List
getAddressesList() { + return addresses; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddressesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddressesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddressesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddressesScopedList(); + } + + public static class Builder { + private List
addresses; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(AddressesScopedList other) { + if (other == AddressesScopedList.getDefaultInstance()) return this; + if (other.getAddressesList() != null) { + this.addresses = other.addresses; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(AddressesScopedList source) { + this.addresses = source.addresses; + this.warning = source.warning; + } + + public List
getAddressesList() { + return addresses; + } + + public Builder addAllAddresses(List
addresses) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(addresses.size()); + } + this.addresses.addAll(addresses); + return this; + } + + public Builder addAddresses(Address addresses) { + this.addresses.add(addresses); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public AddressesScopedList build() { + + return new AddressesScopedList( + addresses, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAddresses(this.addresses); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddressesScopedList{" + + "addresses=" + addresses + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddressesScopedList) { + AddressesScopedList that = (AddressesScopedList) o; + return + Objects.equals(this.addresses, that.getAddressesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + addresses, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java new file mode 100644 index 000000000000..cf0ddb59ac99 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListAddressesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListAddressesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListAddressesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListAddressesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListAddressesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListAddressesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListAddressesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListAddressesHttpRequest other) { + if (other == AggregatedListAddressesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListAddressesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListAddressesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListAddressesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListAddressesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListAddressesHttpRequest) { + AggregatedListAddressesHttpRequest that = (AggregatedListAddressesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java new file mode 100644 index 000000000000..6f42491c2885 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListAutoscalersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListAutoscalersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListAutoscalersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListAutoscalersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListAutoscalersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListAutoscalersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListAutoscalersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListAutoscalersHttpRequest other) { + if (other == AggregatedListAutoscalersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListAutoscalersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListAutoscalersHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListAutoscalersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListAutoscalersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListAutoscalersHttpRequest) { + AggregatedListAutoscalersHttpRequest that = (AggregatedListAutoscalersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java new file mode 100644 index 000000000000..894e48f279b8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListBackendServicesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListBackendServicesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListBackendServicesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListBackendServicesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListBackendServicesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListBackendServicesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListBackendServicesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListBackendServicesHttpRequest other) { + if (other == AggregatedListBackendServicesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListBackendServicesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListBackendServicesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListBackendServicesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListBackendServicesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListBackendServicesHttpRequest) { + AggregatedListBackendServicesHttpRequest that = (AggregatedListBackendServicesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java new file mode 100644 index 000000000000..e0bc892b3a6b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListDiskTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListDiskTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListDiskTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListDiskTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListDiskTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListDiskTypesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListDiskTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListDiskTypesHttpRequest other) { + if (other == AggregatedListDiskTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListDiskTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListDiskTypesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListDiskTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListDiskTypesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListDiskTypesHttpRequest) { + AggregatedListDiskTypesHttpRequest that = (AggregatedListDiskTypesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java new file mode 100644 index 000000000000..2f889d325d2d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListDisksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListDisksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListDisksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListDisksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListDisksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListDisksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListDisksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListDisksHttpRequest other) { + if (other == AggregatedListDisksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListDisksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListDisksHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListDisksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListDisksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListDisksHttpRequest) { + AggregatedListDisksHttpRequest that = (AggregatedListDisksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java new file mode 100644 index 000000000000..d167b4bc8a55 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListForwardingRulesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListForwardingRulesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListForwardingRulesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListForwardingRulesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListForwardingRulesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListForwardingRulesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListForwardingRulesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListForwardingRulesHttpRequest other) { + if (other == AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListForwardingRulesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListForwardingRulesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListForwardingRulesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListForwardingRulesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListForwardingRulesHttpRequest) { + AggregatedListForwardingRulesHttpRequest that = (AggregatedListForwardingRulesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java new file mode 100644 index 000000000000..1b11d1dae87e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListGlobalOperationsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListGlobalOperationsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListGlobalOperationsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListGlobalOperationsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListGlobalOperationsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListGlobalOperationsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListGlobalOperationsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListGlobalOperationsHttpRequest other) { + if (other == AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListGlobalOperationsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListGlobalOperationsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListGlobalOperationsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListGlobalOperationsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListGlobalOperationsHttpRequest) { + AggregatedListGlobalOperationsHttpRequest that = (AggregatedListGlobalOperationsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java new file mode 100644 index 000000000000..83725fe87875 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListInstanceGroupManagersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListInstanceGroupManagersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListInstanceGroupManagersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListInstanceGroupManagersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListInstanceGroupManagersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListInstanceGroupManagersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListInstanceGroupManagersHttpRequest other) { + if (other == AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListInstanceGroupManagersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListInstanceGroupManagersHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListInstanceGroupManagersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListInstanceGroupManagersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListInstanceGroupManagersHttpRequest) { + AggregatedListInstanceGroupManagersHttpRequest that = (AggregatedListInstanceGroupManagersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java new file mode 100644 index 000000000000..60c1fcde17bf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListInstanceGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListInstanceGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListInstanceGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListInstanceGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListInstanceGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListInstanceGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListInstanceGroupsHttpRequest other) { + if (other == AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListInstanceGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListInstanceGroupsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListInstanceGroupsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListInstanceGroupsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListInstanceGroupsHttpRequest) { + AggregatedListInstanceGroupsHttpRequest that = (AggregatedListInstanceGroupsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java new file mode 100644 index 000000000000..752bd786bcb3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListInstancesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListInstancesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListInstancesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListInstancesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListInstancesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListInstancesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListInstancesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListInstancesHttpRequest other) { + if (other == AggregatedListInstancesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListInstancesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListInstancesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListInstancesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListInstancesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListInstancesHttpRequest) { + AggregatedListInstancesHttpRequest that = (AggregatedListInstancesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java new file mode 100644 index 000000000000..55bfca104b20 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListMachineTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListMachineTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListMachineTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListMachineTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListMachineTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListMachineTypesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListMachineTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListMachineTypesHttpRequest other) { + if (other == AggregatedListMachineTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListMachineTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListMachineTypesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListMachineTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListMachineTypesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListMachineTypesHttpRequest) { + AggregatedListMachineTypesHttpRequest that = (AggregatedListMachineTypesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java new file mode 100644 index 000000000000..ac0485db4ee3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListRoutersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListRoutersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListRoutersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListRoutersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListRoutersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListRoutersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListRoutersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListRoutersHttpRequest other) { + if (other == AggregatedListRoutersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListRoutersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListRoutersHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListRoutersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListRoutersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListRoutersHttpRequest) { + AggregatedListRoutersHttpRequest that = (AggregatedListRoutersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java new file mode 100644 index 000000000000..1f63479c0a03 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListSubnetworksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListSubnetworksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListSubnetworksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListSubnetworksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListSubnetworksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListSubnetworksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListSubnetworksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListSubnetworksHttpRequest other) { + if (other == AggregatedListSubnetworksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListSubnetworksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListSubnetworksHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListSubnetworksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListSubnetworksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListSubnetworksHttpRequest) { + AggregatedListSubnetworksHttpRequest that = (AggregatedListSubnetworksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java new file mode 100644 index 000000000000..4e6a1f63aa91 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListTargetInstancesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListTargetInstancesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListTargetInstancesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListTargetInstancesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListTargetInstancesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListTargetInstancesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListTargetInstancesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListTargetInstancesHttpRequest other) { + if (other == AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListTargetInstancesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListTargetInstancesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListTargetInstancesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListTargetInstancesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListTargetInstancesHttpRequest) { + AggregatedListTargetInstancesHttpRequest that = (AggregatedListTargetInstancesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java new file mode 100644 index 000000000000..6fedb5f443cb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListTargetPoolsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListTargetPoolsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListTargetPoolsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListTargetPoolsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListTargetPoolsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListTargetPoolsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListTargetPoolsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListTargetPoolsHttpRequest other) { + if (other == AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListTargetPoolsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListTargetPoolsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListTargetPoolsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListTargetPoolsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListTargetPoolsHttpRequest) { + AggregatedListTargetPoolsHttpRequest that = (AggregatedListTargetPoolsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java new file mode 100644 index 000000000000..b8cb1ab29d97 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListTargetVpnGatewaysHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListTargetVpnGatewaysHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListTargetVpnGatewaysHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListTargetVpnGatewaysHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListTargetVpnGatewaysHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListTargetVpnGatewaysHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListTargetVpnGatewaysHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListTargetVpnGatewaysHttpRequest other) { + if (other == AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListTargetVpnGatewaysHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListTargetVpnGatewaysHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListTargetVpnGatewaysHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListTargetVpnGatewaysHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListTargetVpnGatewaysHttpRequest) { + AggregatedListTargetVpnGatewaysHttpRequest that = (AggregatedListTargetVpnGatewaysHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java new file mode 100644 index 000000000000..51df06608e7d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListVpnTunnelsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListVpnTunnelsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListVpnTunnelsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListVpnTunnelsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListVpnTunnelsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListVpnTunnelsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListVpnTunnelsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListVpnTunnelsHttpRequest other) { + if (other == AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListVpnTunnelsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListVpnTunnelsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListVpnTunnelsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListVpnTunnelsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListVpnTunnelsHttpRequest) { + AggregatedListVpnTunnelsHttpRequest that = (AggregatedListVpnTunnelsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java new file mode 100644 index 000000000000..c12c96954b60 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Allowed implements ApiMessage { + private final String iPProtocol; + private final List ports; + + private Allowed() { + this.iPProtocol = null; + this.ports = null; + } + + + private Allowed( + String iPProtocol, + List ports + ) { + this.iPProtocol = iPProtocol; + this.ports = ports; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("iPProtocol") && iPProtocol != null) { + fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); + } + if (fieldNames.contains("ports") && ports != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : ports) { + stringList.add(item.toString()); + } + fieldMap.put("ports", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("iPProtocol")) { + return String.valueOf(iPProtocol); + } + if (fieldName.equals("ports")) { + return String.valueOf(ports); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getIPProtocol() { + return iPProtocol; + } + + public List getPortsList() { + return ports; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Allowed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Allowed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Allowed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Allowed(); + } + + public static class Builder { + private String iPProtocol; + private List ports; + + Builder() {} + + public Builder mergeFrom(Allowed other) { + if (other == Allowed.getDefaultInstance()) return this; + if (other.getIPProtocol() != null) { + this.iPProtocol = other.iPProtocol; + } + if (other.getPortsList() != null) { + this.ports = other.ports; + } + return this; + } + + Builder(Allowed source) { + this.iPProtocol = source.iPProtocol; + this.ports = source.ports; + } + + public String getIPProtocol() { + return iPProtocol; + } + + public Builder setIPProtocol(String iPProtocol) { + this.iPProtocol = iPProtocol; + return this; + } + + public List getPortsList() { + return ports; + } + + public Builder addAllPorts(List ports) { + if (this.ports == null) { + this.ports = new ArrayList<>(ports.size()); + } + this.ports.addAll(ports); + return this; + } + + public Builder addPorts(String ports) { + this.ports.add(ports); + return this; + } + + + public Allowed build() { + + return new Allowed( + iPProtocol, + ports + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIPProtocol(this.iPProtocol); + newBuilder.addAllPorts(this.ports); + return newBuilder; + } + } + + @Override + public String toString() { + return "Allowed{" + + "iPProtocol=" + iPProtocol + ", " + + "ports=" + ports + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Allowed) { + Allowed that = (Allowed) o; + return + Objects.equals(this.iPProtocol, that.getIPProtocol()) && + Objects.equals(this.ports, that.getPortsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + iPProtocol, + ports + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java new file mode 100644 index 000000000000..82b16d9edd37 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AttachDiskInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final AttachedDisk attachedDiskResource; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private AttachDiskInstanceHttpRequest() { + this.access_token = null; + this.attachedDiskResource = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AttachDiskInstanceHttpRequest( + String access_token, + AttachedDisk attachedDiskResource, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.attachedDiskResource = attachedDiskResource; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("attachedDiskResource") && attachedDiskResource != null) { + fieldMap.put("attachedDiskResource", Collections.singletonList(String.valueOf(attachedDiskResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("attachedDiskResource")) { + return String.valueOf(attachedDiskResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public AttachedDisk getApiMessageRequestBody() { + return attachedDiskResource; + } + + public String getAccessToken() { + return access_token; + } + + public AttachedDisk getAttachedDiskResource() { + return attachedDiskResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AttachDiskInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AttachDiskInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AttachDiskInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AttachDiskInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private AttachedDisk attachedDiskResource; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AttachDiskInstanceHttpRequest other) { + if (other == AttachDiskInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAttachedDiskResource() != null) { + this.attachedDiskResource = other.attachedDiskResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AttachDiskInstanceHttpRequest source) { + this.access_token = source.access_token; + this.attachedDiskResource = source.attachedDiskResource; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public AttachedDisk getAttachedDiskResource() { + return attachedDiskResource; + } + + public Builder setAttachedDiskResource(AttachedDisk attachedDiskResource) { + this.attachedDiskResource = attachedDiskResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AttachDiskInstanceHttpRequest build() { + String missing = ""; + + + + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AttachDiskInstanceHttpRequest( + access_token, + attachedDiskResource, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAttachedDiskResource(this.attachedDiskResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AttachDiskInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "attachedDiskResource=" + attachedDiskResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AttachDiskInstanceHttpRequest) { + AttachDiskInstanceHttpRequest that = (AttachDiskInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.attachedDiskResource, that.getAttachedDiskResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + attachedDiskResource, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java new file mode 100644 index 000000000000..7ec7b6edcfc4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java @@ -0,0 +1,548 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AttachedDisk implements ApiMessage { + private final Boolean autoDelete; + private final Boolean boot; + private final String deviceName; + private final CustomerEncryptionKey diskEncryptionKey; + private final Integer index; + private final AttachedDiskInitializeParams initializeParams; + private final String interface2; + private final String kind; + private final List licenses; + private final String mode; + private final String source; + private final String type; + + private AttachedDisk() { + this.autoDelete = null; + this.boot = null; + this.deviceName = null; + this.diskEncryptionKey = null; + this.index = null; + this.initializeParams = null; + this.interface2 = null; + this.kind = null; + this.licenses = null; + this.mode = null; + this.source = null; + this.type = null; + } + + + private AttachedDisk( + Boolean autoDelete, + Boolean boot, + String deviceName, + CustomerEncryptionKey diskEncryptionKey, + Integer index, + AttachedDiskInitializeParams initializeParams, + String interface2, + String kind, + List licenses, + String mode, + String source, + String type + ) { + this.autoDelete = autoDelete; + this.boot = boot; + this.deviceName = deviceName; + this.diskEncryptionKey = diskEncryptionKey; + this.index = index; + this.initializeParams = initializeParams; + this.interface2 = interface2; + this.kind = kind; + this.licenses = licenses; + this.mode = mode; + this.source = source; + this.type = type; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoDelete") && autoDelete != null) { + fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); + } + if (fieldNames.contains("boot") && boot != null) { + fieldMap.put("boot", Collections.singletonList(String.valueOf(boot))); + } + if (fieldNames.contains("deviceName") && deviceName != null) { + fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); + } + if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { + fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + } + if (fieldNames.contains("index") && index != null) { + fieldMap.put("index", Collections.singletonList(String.valueOf(index))); + } + if (fieldNames.contains("initializeParams") && initializeParams != null) { + fieldMap.put("initializeParams", Collections.singletonList(String.valueOf(initializeParams))); + } + if (fieldNames.contains("interface2") && interface2 != null) { + fieldMap.put("interface2", Collections.singletonList(String.valueOf(interface2))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("mode") && mode != null) { + fieldMap.put("mode", Collections.singletonList(String.valueOf(mode))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("autoDelete")) { + return String.valueOf(autoDelete); + } + if (fieldName.equals("boot")) { + return String.valueOf(boot); + } + if (fieldName.equals("deviceName")) { + return String.valueOf(deviceName); + } + if (fieldName.equals("diskEncryptionKey")) { + return String.valueOf(diskEncryptionKey); + } + if (fieldName.equals("index")) { + return String.valueOf(index); + } + if (fieldName.equals("initializeParams")) { + return String.valueOf(initializeParams); + } + if (fieldName.equals("interface2")) { + return String.valueOf(interface2); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("licenses")) { + return String.valueOf(licenses); + } + if (fieldName.equals("mode")) { + return String.valueOf(mode); + } + if (fieldName.equals("source")) { + return String.valueOf(source); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getAutoDelete() { + return autoDelete; + } + + public Boolean getBoot() { + return boot; + } + + public String getDeviceName() { + return deviceName; + } + + public CustomerEncryptionKey getDiskEncryptionKey() { + return diskEncryptionKey; + } + + public Integer getIndex() { + return index; + } + + public AttachedDiskInitializeParams getInitializeParams() { + return initializeParams; + } + + public String getInterface() { + return interface2; + } + + public String getKind() { + return kind; + } + + public List getLicensesList() { + return licenses; + } + + public String getMode() { + return mode; + } + + public String getSource() { + return source; + } + + public String getType() { + return type; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AttachedDisk prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AttachedDisk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AttachedDisk DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AttachedDisk(); + } + + public static class Builder { + private Boolean autoDelete; + private Boolean boot; + private String deviceName; + private CustomerEncryptionKey diskEncryptionKey; + private Integer index; + private AttachedDiskInitializeParams initializeParams; + private String interface2; + private String kind; + private List licenses; + private String mode; + private String source; + private String type; + + Builder() {} + + public Builder mergeFrom(AttachedDisk other) { + if (other == AttachedDisk.getDefaultInstance()) return this; + if (other.getAutoDelete() != null) { + this.autoDelete = other.autoDelete; + } + if (other.getBoot() != null) { + this.boot = other.boot; + } + if (other.getDeviceName() != null) { + this.deviceName = other.deviceName; + } + if (other.getDiskEncryptionKey() != null) { + this.diskEncryptionKey = other.diskEncryptionKey; + } + if (other.getIndex() != null) { + this.index = other.index; + } + if (other.getInitializeParams() != null) { + this.initializeParams = other.initializeParams; + } + if (other.getInterface() != null) { + this.interface2 = other.interface2; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLicensesList() != null) { + this.licenses = other.licenses; + } + if (other.getMode() != null) { + this.mode = other.mode; + } + if (other.getSource() != null) { + this.source = other.source; + } + if (other.getType() != null) { + this.type = other.type; + } + return this; + } + + Builder(AttachedDisk source) { + this.autoDelete = source.autoDelete; + this.boot = source.boot; + this.deviceName = source.deviceName; + this.diskEncryptionKey = source.diskEncryptionKey; + this.index = source.index; + this.initializeParams = source.initializeParams; + this.interface2 = source.interface2; + this.kind = source.kind; + this.licenses = source.licenses; + this.mode = source.mode; + this.source = source.source; + this.type = source.type; + } + + public Boolean getAutoDelete() { + return autoDelete; + } + + public Builder setAutoDelete(Boolean autoDelete) { + this.autoDelete = autoDelete; + return this; + } + + public Boolean getBoot() { + return boot; + } + + public Builder setBoot(Boolean boot) { + this.boot = boot; + return this; + } + + public String getDeviceName() { + return deviceName; + } + + public Builder setDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + public CustomerEncryptionKey getDiskEncryptionKey() { + return diskEncryptionKey; + } + + public Builder setDiskEncryptionKey(CustomerEncryptionKey diskEncryptionKey) { + this.diskEncryptionKey = diskEncryptionKey; + return this; + } + + public Integer getIndex() { + return index; + } + + public Builder setIndex(Integer index) { + this.index = index; + return this; + } + + public AttachedDiskInitializeParams getInitializeParams() { + return initializeParams; + } + + public Builder setInitializeParams(AttachedDiskInitializeParams initializeParams) { + this.initializeParams = initializeParams; + return this; + } + + public String getInterface() { + return interface2; + } + + public Builder setInterface(String interface2) { + this.interface2 = interface2; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public List getLicensesList() { + return licenses; + } + + public Builder addAllLicenses(List licenses) { + if (this.licenses == null) { + this.licenses = new ArrayList<>(licenses.size()); + } + this.licenses.addAll(licenses); + return this; + } + + public Builder addLicenses(String licenses) { + this.licenses.add(licenses); + return this; + } + + public String getMode() { + return mode; + } + + public Builder setMode(String mode) { + this.mode = mode; + return this; + } + + public String getSource() { + return source; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + + public AttachedDisk build() { + + + + + + + + + + + + return new AttachedDisk( + autoDelete, + boot, + deviceName, + diskEncryptionKey, + index, + initializeParams, + interface2, + kind, + licenses, + mode, + source, + type + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAutoDelete(this.autoDelete); + newBuilder.setBoot(this.boot); + newBuilder.setDeviceName(this.deviceName); + newBuilder.setDiskEncryptionKey(this.diskEncryptionKey); + newBuilder.setIndex(this.index); + newBuilder.setInitializeParams(this.initializeParams); + newBuilder.setInterface(this.interface2); + newBuilder.setKind(this.kind); + newBuilder.addAllLicenses(this.licenses); + newBuilder.setMode(this.mode); + newBuilder.setSource(this.source); + newBuilder.setType(this.type); + return newBuilder; + } + } + + @Override + public String toString() { + return "AttachedDisk{" + + "autoDelete=" + autoDelete + ", " + + "boot=" + boot + ", " + + "deviceName=" + deviceName + ", " + + "diskEncryptionKey=" + diskEncryptionKey + ", " + + "index=" + index + ", " + + "initializeParams=" + initializeParams + ", " + + "interface2=" + interface2 + ", " + + "kind=" + kind + ", " + + "licenses=" + licenses + ", " + + "mode=" + mode + ", " + + "source=" + source + ", " + + "type=" + type + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AttachedDisk) { + AttachedDisk that = (AttachedDisk) o; + return + Objects.equals(this.autoDelete, that.getAutoDelete()) && + Objects.equals(this.boot, that.getBoot()) && + Objects.equals(this.deviceName, that.getDeviceName()) && + Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && + Objects.equals(this.index, that.getIndex()) && + Objects.equals(this.initializeParams, that.getInitializeParams()) && + Objects.equals(this.interface2, that.getInterface()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.licenses, that.getLicensesList()) && + Objects.equals(this.mode, that.getMode()) && + Objects.equals(this.source, that.getSource()) && + Objects.equals(this.type, that.getType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoDelete, + boot, + deviceName, + diskEncryptionKey, + index, + initializeParams, + interface2, + kind, + licenses, + mode, + source, + type + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java new file mode 100644 index 000000000000..c534e12dffdd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AttachedDiskInitializeParams implements ApiMessage { + private final String diskName; + private final String diskSizeGb; + private final String diskType; + private final String sourceImage; + private final CustomerEncryptionKey sourceImageEncryptionKey; + + private AttachedDiskInitializeParams() { + this.diskName = null; + this.diskSizeGb = null; + this.diskType = null; + this.sourceImage = null; + this.sourceImageEncryptionKey = null; + } + + + private AttachedDiskInitializeParams( + String diskName, + String diskSizeGb, + String diskType, + String sourceImage, + CustomerEncryptionKey sourceImageEncryptionKey + ) { + this.diskName = diskName; + this.diskSizeGb = diskSizeGb; + this.diskType = diskType; + this.sourceImage = sourceImage; + this.sourceImageEncryptionKey = sourceImageEncryptionKey; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskName") && diskName != null) { + fieldMap.put("diskName", Collections.singletonList(String.valueOf(diskName))); + } + if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { + fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); + } + if (fieldNames.contains("diskType") && diskType != null) { + fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { + fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskName")) { + return String.valueOf(diskName); + } + if (fieldName.equals("diskSizeGb")) { + return String.valueOf(diskSizeGb); + } + if (fieldName.equals("diskType")) { + return String.valueOf(diskType); + } + if (fieldName.equals("sourceImage")) { + return String.valueOf(sourceImage); + } + if (fieldName.equals("sourceImageEncryptionKey")) { + return String.valueOf(sourceImageEncryptionKey); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDiskName() { + return diskName; + } + + public String getDiskSizeGb() { + return diskSizeGb; + } + + public String getDiskType() { + return diskType; + } + + public String getSourceImage() { + return sourceImage; + } + + public CustomerEncryptionKey getSourceImageEncryptionKey() { + return sourceImageEncryptionKey; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AttachedDiskInitializeParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AttachedDiskInitializeParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AttachedDiskInitializeParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AttachedDiskInitializeParams(); + } + + public static class Builder { + private String diskName; + private String diskSizeGb; + private String diskType; + private String sourceImage; + private CustomerEncryptionKey sourceImageEncryptionKey; + + Builder() {} + + public Builder mergeFrom(AttachedDiskInitializeParams other) { + if (other == AttachedDiskInitializeParams.getDefaultInstance()) return this; + if (other.getDiskName() != null) { + this.diskName = other.diskName; + } + if (other.getDiskSizeGb() != null) { + this.diskSizeGb = other.diskSizeGb; + } + if (other.getDiskType() != null) { + this.diskType = other.diskType; + } + if (other.getSourceImage() != null) { + this.sourceImage = other.sourceImage; + } + if (other.getSourceImageEncryptionKey() != null) { + this.sourceImageEncryptionKey = other.sourceImageEncryptionKey; + } + return this; + } + + Builder(AttachedDiskInitializeParams source) { + this.diskName = source.diskName; + this.diskSizeGb = source.diskSizeGb; + this.diskType = source.diskType; + this.sourceImage = source.sourceImage; + this.sourceImageEncryptionKey = source.sourceImageEncryptionKey; + } + + public String getDiskName() { + return diskName; + } + + public Builder setDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + public String getDiskSizeGb() { + return diskSizeGb; + } + + public Builder setDiskSizeGb(String diskSizeGb) { + this.diskSizeGb = diskSizeGb; + return this; + } + + public String getDiskType() { + return diskType; + } + + public Builder setDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + public String getSourceImage() { + return sourceImage; + } + + public Builder setSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + + public CustomerEncryptionKey getSourceImageEncryptionKey() { + return sourceImageEncryptionKey; + } + + public Builder setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncryptionKey) { + this.sourceImageEncryptionKey = sourceImageEncryptionKey; + return this; + } + + + public AttachedDiskInitializeParams build() { + + + + + return new AttachedDiskInitializeParams( + diskName, + diskSizeGb, + diskType, + sourceImage, + sourceImageEncryptionKey + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDiskName(this.diskName); + newBuilder.setDiskSizeGb(this.diskSizeGb); + newBuilder.setDiskType(this.diskType); + newBuilder.setSourceImage(this.sourceImage); + newBuilder.setSourceImageEncryptionKey(this.sourceImageEncryptionKey); + return newBuilder; + } + } + + @Override + public String toString() { + return "AttachedDiskInitializeParams{" + + "diskName=" + diskName + ", " + + "diskSizeGb=" + diskSizeGb + ", " + + "diskType=" + diskType + ", " + + "sourceImage=" + sourceImage + ", " + + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AttachedDiskInitializeParams) { + AttachedDiskInitializeParams that = (AttachedDiskInitializeParams) o; + return + Objects.equals(this.diskName, that.getDiskName()) && + Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && + Objects.equals(this.diskType, that.getDiskType()) && + Objects.equals(this.sourceImage, that.getSourceImage()) && + Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + diskName, + diskSizeGb, + diskType, + sourceImage, + sourceImageEncryptionKey + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java new file mode 100644 index 000000000000..484938836206 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java @@ -0,0 +1,468 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Autoscaler implements ApiMessage { + private final AutoscalingPolicy autoscalingPolicy; + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String region; + private final String selfLink; + private final String target; + private final String zone; + + private Autoscaler() { + this.autoscalingPolicy = null; + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.region = null; + this.selfLink = null; + this.target = null; + this.zone = null; + } + + + private Autoscaler( + AutoscalingPolicy autoscalingPolicy, + String creationTimestamp, + String description, + String id, + String kind, + String name, + String region, + String selfLink, + String target, + String zone + ) { + this.autoscalingPolicy = autoscalingPolicy; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.region = region; + this.selfLink = selfLink; + this.target = target; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoscalingPolicy") && autoscalingPolicy != null) { + fieldMap.put("autoscalingPolicy", Collections.singletonList(String.valueOf(autoscalingPolicy))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("autoscalingPolicy")) { + return String.valueOf(autoscalingPolicy); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("target")) { + return String.valueOf(target); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public AutoscalingPolicy getAutoscalingPolicy() { + return autoscalingPolicy; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getTarget() { + return target; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Autoscaler prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Autoscaler getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Autoscaler DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Autoscaler(); + } + + public static class Builder { + private AutoscalingPolicy autoscalingPolicy; + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String region; + private String selfLink; + private String target; + private String zone; + + Builder() {} + + public Builder mergeFrom(Autoscaler other) { + if (other == Autoscaler.getDefaultInstance()) return this; + if (other.getAutoscalingPolicy() != null) { + this.autoscalingPolicy = other.autoscalingPolicy; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTarget() != null) { + this.target = other.target; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(Autoscaler source) { + this.autoscalingPolicy = source.autoscalingPolicy; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.region = source.region; + this.selfLink = source.selfLink; + this.target = source.target; + this.zone = source.zone; + } + + public AutoscalingPolicy getAutoscalingPolicy() { + return autoscalingPolicy; + } + + public Builder setAutoscalingPolicy(AutoscalingPolicy autoscalingPolicy) { + this.autoscalingPolicy = autoscalingPolicy; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getTarget() { + return target; + } + + public Builder setTarget(String target) { + this.target = target; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public Autoscaler build() { + + + + + + + + + + return new Autoscaler( + autoscalingPolicy, + creationTimestamp, + description, + id, + kind, + name, + region, + selfLink, + target, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAutoscalingPolicy(this.autoscalingPolicy); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTarget(this.target); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "Autoscaler{" + + "autoscalingPolicy=" + autoscalingPolicy + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "target=" + target + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Autoscaler) { + Autoscaler that = (Autoscaler) o; + return + Objects.equals(this.autoscalingPolicy, that.getAutoscalingPolicy()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.target, that.getTarget()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoscalingPolicy, + creationTimestamp, + description, + id, + kind, + name, + region, + selfLink, + target, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java new file mode 100644 index 000000000000..fd8158b741ea --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalerAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private AutoscalerAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private AutoscalerAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalerAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalerAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalerAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalerAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(AutoscalerAggregatedList other) { + if (other == AutoscalerAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(AutoscalerAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public AutoscalerAggregatedList build() { + + + + + return new AutoscalerAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalerAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalerAggregatedList) { + AutoscalerAggregatedList that = (AutoscalerAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java new file mode 100644 index 000000000000..f101dcba980e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java @@ -0,0 +1,1166 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.AutoscalerStub; +import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the autoscalerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of AutoscalerSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * AutoscalerSettings autoscalerSettings =
+ *     AutoscalerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AutoscalerClient autoscalerClient =
+ *     AutoscalerClient.create(autoscalerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AutoscalerSettings autoscalerSettings =
+ *     AutoscalerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AutoscalerClient autoscalerClient =
+ *     AutoscalerClient.create(autoscalerSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AutoscalerClient implements BackgroundResource { + private final AutoscalerSettings settings; + private final AutoscalerStub stub; + + + + /** + * Constructs an instance of AutoscalerClient with default settings. + */ + public static final AutoscalerClient create() throws IOException { + return create(AutoscalerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AutoscalerClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final AutoscalerClient create(AutoscalerSettings settings) throws IOException { + return new AutoscalerClient(settings); + } + + /** + * Constructs an instance of AutoscalerClient, using the given stub for making calls. This is for + * advanced usage - prefer to use AutoscalerSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AutoscalerClient create(AutoscalerStub stub) { + return new AutoscalerClient(stub); + } + + /** + * Constructs an instance of AutoscalerClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected AutoscalerClient(AutoscalerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AutoscalerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AutoscalerClient(AutoscalerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AutoscalerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AutoscalerStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of autoscalers. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (AutoscalersScopedList element : autoscalerClient.aggregatedListAutoscalers(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(ProjectName project) { + AggregatedListAutoscalersHttpRequest request = + AggregatedListAutoscalersHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListAutoscalers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of autoscalers. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (AutoscalersScopedList element : autoscalerClient.aggregatedListAutoscalers(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(String project) { + AggregatedListAutoscalersHttpRequest request = + AggregatedListAutoscalersHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListAutoscalers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of autoscalers. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAutoscalersHttpRequest request = AggregatedListAutoscalersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (AutoscalersScopedList element : autoscalerClient.aggregatedListAutoscalers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(AggregatedListAutoscalersHttpRequest request) { + return aggregatedListAutoscalersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of autoscalers. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAutoscalersHttpRequest request = AggregatedListAutoscalersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListAutoscalersPagedResponse> future = autoscalerClient.aggregatedListAutoscalersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (AutoscalersScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListAutoscalersPagedCallable() { + return stub.aggregatedListAutoscalersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of autoscalers. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAutoscalersHttpRequest request = AggregatedListAutoscalersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     AutoscalerAggregatedList response = autoscalerClient.aggregatedListAutoscalersCallable().call(request);
+   *     for (AutoscalersScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListAutoscalersCallable() { + return stub.aggregatedListAutoscalersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAutoscaler(AutoscalerName autoscaler) { + + DeleteAutoscalerHttpRequest request = + DeleteAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .build(); + return deleteAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString());
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAutoscaler(String autoscaler) { + + DeleteAutoscalerHttpRequest request = + DeleteAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .build(); + return deleteAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   Operation response = autoscalerClient.deleteAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAutoscaler(DeleteAutoscalerHttpRequest request) { + return deleteAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoscalerClient.deleteAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteAutoscalerCallable() { + return stub.deleteAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   Autoscaler response = autoscalerClient.getAutoscaler(autoscaler);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Autoscaler getAutoscaler(AutoscalerName autoscaler) { + + GetAutoscalerHttpRequest request = + GetAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .build(); + return getAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   Autoscaler response = autoscalerClient.getAutoscaler(autoscaler.toString());
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Autoscaler getAutoscaler(String autoscaler) { + + GetAutoscalerHttpRequest request = + GetAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .build(); + return getAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   Autoscaler response = autoscalerClient.getAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Autoscaler getAutoscaler(GetAutoscalerHttpRequest request) { + return getAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   ApiFuture<Autoscaler> future = autoscalerClient.getAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Autoscaler response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getAutoscalerCallable() { + return stub.getAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = autoscalerClient.insertAutoscaler(zone, autoscalerResource);
+   * }
+   * 
+ * + * @param zone Name of the zone for this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertAutoscaler(ZoneName zone, Autoscaler autoscalerResource) { + + InsertAutoscalerHttpRequest request = + InsertAutoscalerHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); + return insertAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = autoscalerClient.insertAutoscaler(zone.toString(), autoscalerResource);
+   * }
+   * 
+ * + * @param zone Name of the zone for this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertAutoscaler(String zone, Autoscaler autoscalerResource) { + + InsertAutoscalerHttpRequest request = + InsertAutoscalerHttpRequest.newBuilder() + .setZone(zone) + .setAutoscalerResource(autoscalerResource) + .build(); + return insertAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   Operation response = autoscalerClient.insertAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertAutoscaler(InsertAutoscalerHttpRequest request) { + return insertAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = autoscalerClient.insertAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertAutoscalerCallable() { + return stub.insertAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Autoscaler element : autoscalerClient.listAutoscalers(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone Name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAutoscalersPagedResponse listAutoscalers(ZoneName zone) { + ListAutoscalersHttpRequest request = + ListAutoscalersHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listAutoscalers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Autoscaler element : autoscalerClient.listAutoscalers(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone Name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAutoscalersPagedResponse listAutoscalers(String zone) { + ListAutoscalersHttpRequest request = + ListAutoscalersHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listAutoscalers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (Autoscaler element : autoscalerClient.listAutoscalers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAutoscalersPagedResponse listAutoscalers(ListAutoscalersHttpRequest request) { + return listAutoscalersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListAutoscalersPagedResponse> future = autoscalerClient.listAutoscalersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Autoscaler element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listAutoscalersPagedCallable() { + return stub.listAutoscalersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     AutoscalerList response = autoscalerClient.listAutoscalersCallable().call(request);
+   *     for (Autoscaler element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listAutoscalersCallable() { + return stub.listAutoscalersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param zone Name of the zone for this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchAutoscaler(String autoscaler, ZoneName zone, Autoscaler autoscalerResource) { + + PatchAutoscalerHttpRequest request = + PatchAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setZone(zone == null ? null : zone.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); + return patchAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param zone Name of the zone for this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchAutoscaler(String autoscaler, String zone, Autoscaler autoscalerResource) { + + PatchAutoscalerHttpRequest request = + PatchAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setZone(zone) + .setAutoscalerResource(autoscalerResource) + .build(); + return patchAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setZone(zone.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   Operation response = autoscalerClient.patchAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchAutoscaler(PatchAutoscalerHttpRequest request) { + return patchAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setZone(zone.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = autoscalerClient.patchAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchAutoscalerCallable() { + return stub.patchAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param zone Name of the zone for this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateAutoscaler(String autoscaler, ZoneName zone, Autoscaler autoscalerResource) { + + UpdateAutoscalerHttpRequest request = + UpdateAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setZone(zone == null ? null : zone.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); + return updateAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param zone Name of the zone for this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateAutoscaler(String autoscaler, String zone, Autoscaler autoscalerResource) { + + UpdateAutoscalerHttpRequest request = + UpdateAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setZone(zone) + .setAutoscalerResource(autoscalerResource) + .build(); + return updateAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setZone(zone.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   Operation response = autoscalerClient.updateAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateAutoscaler(UpdateAutoscalerHttpRequest request) { + return updateAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setZone(zone.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = autoscalerClient.updateAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateAutoscalerCallable() { + return stub.updateAutoscalerCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListAutoscalersPagedResponse extends AbstractPagedListResponse< + AggregatedListAutoscalersHttpRequest, + AutoscalerAggregatedList, + AutoscalersScopedList, + AggregatedListAutoscalersPage, + AggregatedListAutoscalersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListAutoscalersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListAutoscalersPagedResponse apply(AggregatedListAutoscalersPage input) { + return new AggregatedListAutoscalersPagedResponse(input); + } + }); + } + + private AggregatedListAutoscalersPagedResponse(AggregatedListAutoscalersPage page) { + super(page, AggregatedListAutoscalersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListAutoscalersPage extends AbstractPage< + AggregatedListAutoscalersHttpRequest, + AutoscalerAggregatedList, + AutoscalersScopedList, + AggregatedListAutoscalersPage> { + + private AggregatedListAutoscalersPage( + PageContext context, + AutoscalerAggregatedList response) { + super(context, response); + } + + private static AggregatedListAutoscalersPage createEmptyPage() { + return new AggregatedListAutoscalersPage(null, null); + } + + @Override + protected AggregatedListAutoscalersPage createPage( + PageContext context, + AutoscalerAggregatedList response) { + return new AggregatedListAutoscalersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListAutoscalersHttpRequest, + AutoscalerAggregatedList, + AutoscalersScopedList, + AggregatedListAutoscalersPage, + AggregatedListAutoscalersFixedSizeCollection> { + + private AggregatedListAutoscalersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListAutoscalersFixedSizeCollection createEmptyCollection() { + return new AggregatedListAutoscalersFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListAutoscalersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListAutoscalersFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListAutoscalersPagedResponse extends AbstractPagedListResponse< + ListAutoscalersHttpRequest, + AutoscalerList, + Autoscaler, + ListAutoscalersPage, + ListAutoscalersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAutoscalersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAutoscalersPagedResponse apply(ListAutoscalersPage input) { + return new ListAutoscalersPagedResponse(input); + } + }); + } + + private ListAutoscalersPagedResponse(ListAutoscalersPage page) { + super(page, ListAutoscalersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListAutoscalersPage extends AbstractPage< + ListAutoscalersHttpRequest, + AutoscalerList, + Autoscaler, + ListAutoscalersPage> { + + private ListAutoscalersPage( + PageContext context, + AutoscalerList response) { + super(context, response); + } + + private static ListAutoscalersPage createEmptyPage() { + return new ListAutoscalersPage(null, null); + } + + @Override + protected ListAutoscalersPage createPage( + PageContext context, + AutoscalerList response) { + return new ListAutoscalersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection< + ListAutoscalersHttpRequest, + AutoscalerList, + Autoscaler, + ListAutoscalersPage, + ListAutoscalersFixedSizeCollection> { + + private ListAutoscalersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAutoscalersFixedSizeCollection createEmptyCollection() { + return new ListAutoscalersFixedSizeCollection(null, 0); + } + + @Override + protected ListAutoscalersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAutoscalersFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java new file mode 100644 index 000000000000..555071e276f0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalerList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private AutoscalerList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private AutoscalerList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Autoscaler item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalerList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalerList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalerList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalerList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(AutoscalerList other) { + if (other == AutoscalerList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(AutoscalerList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Autoscaler items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public AutoscalerList build() { + + + + + return new AutoscalerList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalerList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalerList) { + AutoscalerList that = (AutoscalerList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java new file mode 100644 index 000000000000..4382c2035ec1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalerName implements ResourceName { + private final String autoscaler; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/autoscalers/{autoscaler}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AutoscalerName(Builder builder) { + autoscaler = Preconditions.checkNotNull(builder.getAutoscaler()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static AutoscalerName of( + String autoscaler, + String project, + String zone + ) { + return newBuilder() + .setAutoscaler(autoscaler) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String autoscaler, + String project, + String zone + ) { + return of( + autoscaler, + project, + zone + ) + .toString(); + } + + public String getAutoscaler() { + return autoscaler; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("autoscaler", autoscaler); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public AutoscalerName parse(String formattedString) {return AutoscalerName.parse(formattedString);} + }; + } + + public static AutoscalerName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "AutoscalerName.parse: formattedString not in valid format"); + return of( + matchMap.get("autoscaler"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String autoscaler; + private String project; + private String zone; + + public String getAutoscaler() { + return autoscaler; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (AutoscalerName autoscalerName) { + autoscaler = autoscalerName.autoscaler; + project = autoscalerName.project; + zone = autoscalerName.zone; + } + + public AutoscalerName build() { + return new AutoscalerName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "autoscaler", autoscaler, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalerName) { + AutoscalerName that = (AutoscalerName) o; + return + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoscaler, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java new file mode 100644 index 000000000000..ee4ddc935c37 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java @@ -0,0 +1,311 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AutoscalerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteAutoscaler to 30 seconds: + * + *

+ * 
+ * AutoscalerSettings.Builder autoscalerSettingsBuilder =
+ *     AutoscalerSettings.newBuilder();
+ * autoscalerSettingsBuilder.deleteAutoscalerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoscalerSettings autoscalerSettings = autoscalerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AutoscalerSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListAutoscalers. + */ + public PagedCallSettings aggregatedListAutoscalersSettings() { + return ((AutoscalerStubSettings) getStubSettings()).aggregatedListAutoscalersSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteAutoscaler. + */ + public UnaryCallSettings deleteAutoscalerSettings() { + return ((AutoscalerStubSettings) getStubSettings()).deleteAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to getAutoscaler. + */ + public UnaryCallSettings getAutoscalerSettings() { + return ((AutoscalerStubSettings) getStubSettings()).getAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to insertAutoscaler. + */ + public UnaryCallSettings insertAutoscalerSettings() { + return ((AutoscalerStubSettings) getStubSettings()).insertAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to listAutoscalers. + */ + public PagedCallSettings listAutoscalersSettings() { + return ((AutoscalerStubSettings) getStubSettings()).listAutoscalersSettings(); + } + + /** + * Returns the object with the settings used for calls to patchAutoscaler. + */ + public UnaryCallSettings patchAutoscalerSettings() { + return ((AutoscalerStubSettings) getStubSettings()).patchAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to updateAutoscaler. + */ + public UnaryCallSettings updateAutoscalerSettings() { + return ((AutoscalerStubSettings) getStubSettings()).updateAutoscalerSettings(); + } + + + public static final AutoscalerSettings create(AutoscalerStubSettings stub) throws IOException { + return new AutoscalerSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AutoscalerStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return AutoscalerStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return AutoscalerStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return AutoscalerStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AutoscalerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return AutoscalerStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AutoscalerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AutoscalerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AutoscalerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for AutoscalerSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AutoscalerStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AutoscalerStubSettings.newBuilder()); + } + + protected Builder(AutoscalerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AutoscalerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public AutoscalerStubSettings.Builder getStubSettingsBuilder() { + return ((AutoscalerStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListAutoscalers. + */ + public PagedCallSettings.Builder aggregatedListAutoscalersSettings() { + return getStubSettingsBuilder().aggregatedListAutoscalersSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteAutoscaler. + */ + public UnaryCallSettings.Builder deleteAutoscalerSettings() { + return getStubSettingsBuilder().deleteAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to getAutoscaler. + */ + public UnaryCallSettings.Builder getAutoscalerSettings() { + return getStubSettingsBuilder().getAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertAutoscaler. + */ + public UnaryCallSettings.Builder insertAutoscalerSettings() { + return getStubSettingsBuilder().insertAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to listAutoscalers. + */ + public PagedCallSettings.Builder listAutoscalersSettings() { + return getStubSettingsBuilder().listAutoscalersSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchAutoscaler. + */ + public UnaryCallSettings.Builder patchAutoscalerSettings() { + return getStubSettingsBuilder().patchAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateAutoscaler. + */ + public UnaryCallSettings.Builder updateAutoscalerSettings() { + return getStubSettingsBuilder().updateAutoscalerSettings(); + } + + @Override + public AutoscalerSettings build() throws IOException { + return new AutoscalerSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java new file mode 100644 index 000000000000..3e4947231cb6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalersScopedList implements ApiMessage { + private final List autoscalers; + private final Warning warning; + + private AutoscalersScopedList() { + this.autoscalers = null; + this.warning = null; + } + + + private AutoscalersScopedList( + List autoscalers, + Warning warning + ) { + this.autoscalers = autoscalers; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoscalers") && autoscalers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Autoscaler item : autoscalers) { + stringList.add(item.toString()); + } + fieldMap.put("autoscalers", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("autoscalers")) { + return String.valueOf(autoscalers); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getAutoscalersList() { + return autoscalers; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalersScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalersScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalersScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalersScopedList(); + } + + public static class Builder { + private List autoscalers; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(AutoscalersScopedList other) { + if (other == AutoscalersScopedList.getDefaultInstance()) return this; + if (other.getAutoscalersList() != null) { + this.autoscalers = other.autoscalers; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(AutoscalersScopedList source) { + this.autoscalers = source.autoscalers; + this.warning = source.warning; + } + + public List getAutoscalersList() { + return autoscalers; + } + + public Builder addAllAutoscalers(List autoscalers) { + if (this.autoscalers == null) { + this.autoscalers = new ArrayList<>(autoscalers.size()); + } + this.autoscalers.addAll(autoscalers); + return this; + } + + public Builder addAutoscalers(Autoscaler autoscalers) { + this.autoscalers.add(autoscalers); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public AutoscalersScopedList build() { + + return new AutoscalersScopedList( + autoscalers, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAutoscalers(this.autoscalers); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalersScopedList{" + + "autoscalers=" + autoscalers + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalersScopedList) { + AutoscalersScopedList that = (AutoscalersScopedList) o; + return + Objects.equals(this.autoscalers, that.getAutoscalersList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoscalers, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java new file mode 100644 index 000000000000..cae18926b1f9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalingPolicy implements ApiMessage { + private final Integer coolDownPeriodSec; + private final AutoscalingPolicyCpuUtilization cpuUtilization; + private final List customMetricUtilizations; + private final AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization; + private final Integer maxNumReplicas; + private final Integer minNumReplicas; + + private AutoscalingPolicy() { + this.coolDownPeriodSec = null; + this.cpuUtilization = null; + this.customMetricUtilizations = null; + this.loadBalancingUtilization = null; + this.maxNumReplicas = null; + this.minNumReplicas = null; + } + + + private AutoscalingPolicy( + Integer coolDownPeriodSec, + AutoscalingPolicyCpuUtilization cpuUtilization, + List customMetricUtilizations, + AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization, + Integer maxNumReplicas, + Integer minNumReplicas + ) { + this.coolDownPeriodSec = coolDownPeriodSec; + this.cpuUtilization = cpuUtilization; + this.customMetricUtilizations = customMetricUtilizations; + this.loadBalancingUtilization = loadBalancingUtilization; + this.maxNumReplicas = maxNumReplicas; + this.minNumReplicas = minNumReplicas; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("coolDownPeriodSec") && coolDownPeriodSec != null) { + fieldMap.put("coolDownPeriodSec", Collections.singletonList(String.valueOf(coolDownPeriodSec))); + } + if (fieldNames.contains("cpuUtilization") && cpuUtilization != null) { + fieldMap.put("cpuUtilization", Collections.singletonList(String.valueOf(cpuUtilization))); + } + if (fieldNames.contains("customMetricUtilizations") && customMetricUtilizations != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AutoscalingPolicyCustomMetricUtilization item : customMetricUtilizations) { + stringList.add(item.toString()); + } + fieldMap.put("customMetricUtilizations", stringList.build()); + } + if (fieldNames.contains("loadBalancingUtilization") && loadBalancingUtilization != null) { + fieldMap.put("loadBalancingUtilization", Collections.singletonList(String.valueOf(loadBalancingUtilization))); + } + if (fieldNames.contains("maxNumReplicas") && maxNumReplicas != null) { + fieldMap.put("maxNumReplicas", Collections.singletonList(String.valueOf(maxNumReplicas))); + } + if (fieldNames.contains("minNumReplicas") && minNumReplicas != null) { + fieldMap.put("minNumReplicas", Collections.singletonList(String.valueOf(minNumReplicas))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("coolDownPeriodSec")) { + return String.valueOf(coolDownPeriodSec); + } + if (fieldName.equals("cpuUtilization")) { + return String.valueOf(cpuUtilization); + } + if (fieldName.equals("customMetricUtilizations")) { + return String.valueOf(customMetricUtilizations); + } + if (fieldName.equals("loadBalancingUtilization")) { + return String.valueOf(loadBalancingUtilization); + } + if (fieldName.equals("maxNumReplicas")) { + return String.valueOf(maxNumReplicas); + } + if (fieldName.equals("minNumReplicas")) { + return String.valueOf(minNumReplicas); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCoolDownPeriodSec() { + return coolDownPeriodSec; + } + + public AutoscalingPolicyCpuUtilization getCpuUtilization() { + return cpuUtilization; + } + + public List getCustomMetricUtilizationsList() { + return customMetricUtilizations; + } + + public AutoscalingPolicyLoadBalancingUtilization getLoadBalancingUtilization() { + return loadBalancingUtilization; + } + + public Integer getMaxNumReplicas() { + return maxNumReplicas; + } + + public Integer getMinNumReplicas() { + return minNumReplicas; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalingPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalingPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalingPolicy DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalingPolicy(); + } + + public static class Builder { + private Integer coolDownPeriodSec; + private AutoscalingPolicyCpuUtilization cpuUtilization; + private List customMetricUtilizations; + private AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization; + private Integer maxNumReplicas; + private Integer minNumReplicas; + + Builder() {} + + public Builder mergeFrom(AutoscalingPolicy other) { + if (other == AutoscalingPolicy.getDefaultInstance()) return this; + if (other.getCoolDownPeriodSec() != null) { + this.coolDownPeriodSec = other.coolDownPeriodSec; + } + if (other.getCpuUtilization() != null) { + this.cpuUtilization = other.cpuUtilization; + } + if (other.getCustomMetricUtilizationsList() != null) { + this.customMetricUtilizations = other.customMetricUtilizations; + } + if (other.getLoadBalancingUtilization() != null) { + this.loadBalancingUtilization = other.loadBalancingUtilization; + } + if (other.getMaxNumReplicas() != null) { + this.maxNumReplicas = other.maxNumReplicas; + } + if (other.getMinNumReplicas() != null) { + this.minNumReplicas = other.minNumReplicas; + } + return this; + } + + Builder(AutoscalingPolicy source) { + this.coolDownPeriodSec = source.coolDownPeriodSec; + this.cpuUtilization = source.cpuUtilization; + this.customMetricUtilizations = source.customMetricUtilizations; + this.loadBalancingUtilization = source.loadBalancingUtilization; + this.maxNumReplicas = source.maxNumReplicas; + this.minNumReplicas = source.minNumReplicas; + } + + public Integer getCoolDownPeriodSec() { + return coolDownPeriodSec; + } + + public Builder setCoolDownPeriodSec(Integer coolDownPeriodSec) { + this.coolDownPeriodSec = coolDownPeriodSec; + return this; + } + + public AutoscalingPolicyCpuUtilization getCpuUtilization() { + return cpuUtilization; + } + + public Builder setCpuUtilization(AutoscalingPolicyCpuUtilization cpuUtilization) { + this.cpuUtilization = cpuUtilization; + return this; + } + + public List getCustomMetricUtilizationsList() { + return customMetricUtilizations; + } + + public Builder addAllCustomMetricUtilizations(List customMetricUtilizations) { + if (this.customMetricUtilizations == null) { + this.customMetricUtilizations = new ArrayList<>(customMetricUtilizations.size()); + } + this.customMetricUtilizations.addAll(customMetricUtilizations); + return this; + } + + public Builder addCustomMetricUtilizations(AutoscalingPolicyCustomMetricUtilization customMetricUtilizations) { + this.customMetricUtilizations.add(customMetricUtilizations); + return this; + } + + public AutoscalingPolicyLoadBalancingUtilization getLoadBalancingUtilization() { + return loadBalancingUtilization; + } + + public Builder setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization) { + this.loadBalancingUtilization = loadBalancingUtilization; + return this; + } + + public Integer getMaxNumReplicas() { + return maxNumReplicas; + } + + public Builder setMaxNumReplicas(Integer maxNumReplicas) { + this.maxNumReplicas = maxNumReplicas; + return this; + } + + public Integer getMinNumReplicas() { + return minNumReplicas; + } + + public Builder setMinNumReplicas(Integer minNumReplicas) { + this.minNumReplicas = minNumReplicas; + return this; + } + + + public AutoscalingPolicy build() { + + + + + + return new AutoscalingPolicy( + coolDownPeriodSec, + cpuUtilization, + customMetricUtilizations, + loadBalancingUtilization, + maxNumReplicas, + minNumReplicas + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCoolDownPeriodSec(this.coolDownPeriodSec); + newBuilder.setCpuUtilization(this.cpuUtilization); + newBuilder.addAllCustomMetricUtilizations(this.customMetricUtilizations); + newBuilder.setLoadBalancingUtilization(this.loadBalancingUtilization); + newBuilder.setMaxNumReplicas(this.maxNumReplicas); + newBuilder.setMinNumReplicas(this.minNumReplicas); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalingPolicy{" + + "coolDownPeriodSec=" + coolDownPeriodSec + ", " + + "cpuUtilization=" + cpuUtilization + ", " + + "customMetricUtilizations=" + customMetricUtilizations + ", " + + "loadBalancingUtilization=" + loadBalancingUtilization + ", " + + "maxNumReplicas=" + maxNumReplicas + ", " + + "minNumReplicas=" + minNumReplicas + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalingPolicy) { + AutoscalingPolicy that = (AutoscalingPolicy) o; + return + Objects.equals(this.coolDownPeriodSec, that.getCoolDownPeriodSec()) && + Objects.equals(this.cpuUtilization, that.getCpuUtilization()) && + Objects.equals(this.customMetricUtilizations, that.getCustomMetricUtilizationsList()) && + Objects.equals(this.loadBalancingUtilization, that.getLoadBalancingUtilization()) && + Objects.equals(this.maxNumReplicas, that.getMaxNumReplicas()) && + Objects.equals(this.minNumReplicas, that.getMinNumReplicas()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + coolDownPeriodSec, + cpuUtilization, + customMetricUtilizations, + loadBalancingUtilization, + maxNumReplicas, + minNumReplicas + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java new file mode 100644 index 000000000000..387c2cc95f25 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalingPolicyCpuUtilization implements ApiMessage { + private final Double utilizationTarget; + + private AutoscalingPolicyCpuUtilization() { + this.utilizationTarget = null; + } + + + private AutoscalingPolicyCpuUtilization( + Double utilizationTarget + ) { + this.utilizationTarget = utilizationTarget; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { + fieldMap.put("utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return String.valueOf(utilizationTarget); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Double getUtilizationTarget() { + return utilizationTarget; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalingPolicyCpuUtilization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalingPolicyCpuUtilization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalingPolicyCpuUtilization DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalingPolicyCpuUtilization(); + } + + public static class Builder { + private Double utilizationTarget; + + Builder() {} + + public Builder mergeFrom(AutoscalingPolicyCpuUtilization other) { + if (other == AutoscalingPolicyCpuUtilization.getDefaultInstance()) return this; + if (other.getUtilizationTarget() != null) { + this.utilizationTarget = other.utilizationTarget; + } + return this; + } + + Builder(AutoscalingPolicyCpuUtilization source) { + this.utilizationTarget = source.utilizationTarget; + } + + public Double getUtilizationTarget() { + return utilizationTarget; + } + + public Builder setUtilizationTarget(Double utilizationTarget) { + this.utilizationTarget = utilizationTarget; + return this; + } + + + public AutoscalingPolicyCpuUtilization build() { + return new AutoscalingPolicyCpuUtilization( + utilizationTarget + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setUtilizationTarget(this.utilizationTarget); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalingPolicyCpuUtilization{" + + "utilizationTarget=" + utilizationTarget + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalingPolicyCpuUtilization) { + AutoscalingPolicyCpuUtilization that = (AutoscalingPolicyCpuUtilization) o; + return + Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + utilizationTarget + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java new file mode 100644 index 000000000000..8e033cd9c425 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalingPolicyCustomMetricUtilization implements ApiMessage { + private final String metric; + private final Double utilizationTarget; + private final String utilizationTargetType; + + private AutoscalingPolicyCustomMetricUtilization() { + this.metric = null; + this.utilizationTarget = null; + this.utilizationTargetType = null; + } + + + private AutoscalingPolicyCustomMetricUtilization( + String metric, + Double utilizationTarget, + String utilizationTargetType + ) { + this.metric = metric; + this.utilizationTarget = utilizationTarget; + this.utilizationTargetType = utilizationTargetType; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("metric") && metric != null) { + fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); + } + if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { + fieldMap.put("utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + } + if (fieldNames.contains("utilizationTargetType") && utilizationTargetType != null) { + fieldMap.put("utilizationTargetType", Collections.singletonList(String.valueOf(utilizationTargetType))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("metric")) { + return String.valueOf(metric); + } + if (fieldName.equals("utilizationTarget")) { + return String.valueOf(utilizationTarget); + } + if (fieldName.equals("utilizationTargetType")) { + return String.valueOf(utilizationTargetType); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getMetric() { + return metric; + } + + public Double getUtilizationTarget() { + return utilizationTarget; + } + + public String getUtilizationTargetType() { + return utilizationTargetType; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalingPolicyCustomMetricUtilization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalingPolicyCustomMetricUtilization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalingPolicyCustomMetricUtilization DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalingPolicyCustomMetricUtilization(); + } + + public static class Builder { + private String metric; + private Double utilizationTarget; + private String utilizationTargetType; + + Builder() {} + + public Builder mergeFrom(AutoscalingPolicyCustomMetricUtilization other) { + if (other == AutoscalingPolicyCustomMetricUtilization.getDefaultInstance()) return this; + if (other.getMetric() != null) { + this.metric = other.metric; + } + if (other.getUtilizationTarget() != null) { + this.utilizationTarget = other.utilizationTarget; + } + if (other.getUtilizationTargetType() != null) { + this.utilizationTargetType = other.utilizationTargetType; + } + return this; + } + + Builder(AutoscalingPolicyCustomMetricUtilization source) { + this.metric = source.metric; + this.utilizationTarget = source.utilizationTarget; + this.utilizationTargetType = source.utilizationTargetType; + } + + public String getMetric() { + return metric; + } + + public Builder setMetric(String metric) { + this.metric = metric; + return this; + } + + public Double getUtilizationTarget() { + return utilizationTarget; + } + + public Builder setUtilizationTarget(Double utilizationTarget) { + this.utilizationTarget = utilizationTarget; + return this; + } + + public String getUtilizationTargetType() { + return utilizationTargetType; + } + + public Builder setUtilizationTargetType(String utilizationTargetType) { + this.utilizationTargetType = utilizationTargetType; + return this; + } + + + public AutoscalingPolicyCustomMetricUtilization build() { + + + return new AutoscalingPolicyCustomMetricUtilization( + metric, + utilizationTarget, + utilizationTargetType + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setMetric(this.metric); + newBuilder.setUtilizationTarget(this.utilizationTarget); + newBuilder.setUtilizationTargetType(this.utilizationTargetType); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalingPolicyCustomMetricUtilization{" + + "metric=" + metric + ", " + + "utilizationTarget=" + utilizationTarget + ", " + + "utilizationTargetType=" + utilizationTargetType + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalingPolicyCustomMetricUtilization) { + AutoscalingPolicyCustomMetricUtilization that = (AutoscalingPolicyCustomMetricUtilization) o; + return + Objects.equals(this.metric, that.getMetric()) && + Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) && + Objects.equals(this.utilizationTargetType, that.getUtilizationTargetType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + metric, + utilizationTarget, + utilizationTargetType + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java new file mode 100644 index 000000000000..f2362f6dbf7e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalingPolicyLoadBalancingUtilization implements ApiMessage { + private final Double utilizationTarget; + + private AutoscalingPolicyLoadBalancingUtilization() { + this.utilizationTarget = null; + } + + + private AutoscalingPolicyLoadBalancingUtilization( + Double utilizationTarget + ) { + this.utilizationTarget = utilizationTarget; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { + fieldMap.put("utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return String.valueOf(utilizationTarget); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Double getUtilizationTarget() { + return utilizationTarget; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalingPolicyLoadBalancingUtilization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalingPolicyLoadBalancingUtilization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalingPolicyLoadBalancingUtilization DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalingPolicyLoadBalancingUtilization(); + } + + public static class Builder { + private Double utilizationTarget; + + Builder() {} + + public Builder mergeFrom(AutoscalingPolicyLoadBalancingUtilization other) { + if (other == AutoscalingPolicyLoadBalancingUtilization.getDefaultInstance()) return this; + if (other.getUtilizationTarget() != null) { + this.utilizationTarget = other.utilizationTarget; + } + return this; + } + + Builder(AutoscalingPolicyLoadBalancingUtilization source) { + this.utilizationTarget = source.utilizationTarget; + } + + public Double getUtilizationTarget() { + return utilizationTarget; + } + + public Builder setUtilizationTarget(Double utilizationTarget) { + this.utilizationTarget = utilizationTarget; + return this; + } + + + public AutoscalingPolicyLoadBalancingUtilization build() { + return new AutoscalingPolicyLoadBalancingUtilization( + utilizationTarget + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setUtilizationTarget(this.utilizationTarget); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalingPolicyLoadBalancingUtilization{" + + "utilizationTarget=" + utilizationTarget + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalingPolicyLoadBalancingUtilization) { + AutoscalingPolicyLoadBalancingUtilization that = (AutoscalingPolicyLoadBalancingUtilization) o; + return + Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + utilizationTarget + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java new file mode 100644 index 000000000000..388f9f82ff9e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java @@ -0,0 +1,434 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Backend implements ApiMessage { + private final String balancingMode; + private final Float capacityScaler; + private final String description; + private final String group; + private final Integer maxConnections; + private final Integer maxConnectionsPerInstance; + private final Integer maxRate; + private final Float maxRatePerInstance; + private final Float maxUtilization; + + private Backend() { + this.balancingMode = null; + this.capacityScaler = null; + this.description = null; + this.group = null; + this.maxConnections = null; + this.maxConnectionsPerInstance = null; + this.maxRate = null; + this.maxRatePerInstance = null; + this.maxUtilization = null; + } + + + private Backend( + String balancingMode, + Float capacityScaler, + String description, + String group, + Integer maxConnections, + Integer maxConnectionsPerInstance, + Integer maxRate, + Float maxRatePerInstance, + Float maxUtilization + ) { + this.balancingMode = balancingMode; + this.capacityScaler = capacityScaler; + this.description = description; + this.group = group; + this.maxConnections = maxConnections; + this.maxConnectionsPerInstance = maxConnectionsPerInstance; + this.maxRate = maxRate; + this.maxRatePerInstance = maxRatePerInstance; + this.maxUtilization = maxUtilization; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("balancingMode") && balancingMode != null) { + fieldMap.put("balancingMode", Collections.singletonList(String.valueOf(balancingMode))); + } + if (fieldNames.contains("capacityScaler") && capacityScaler != null) { + fieldMap.put("capacityScaler", Collections.singletonList(String.valueOf(capacityScaler))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("group") && group != null) { + fieldMap.put("group", Collections.singletonList(String.valueOf(group))); + } + if (fieldNames.contains("maxConnections") && maxConnections != null) { + fieldMap.put("maxConnections", Collections.singletonList(String.valueOf(maxConnections))); + } + if (fieldNames.contains("maxConnectionsPerInstance") && maxConnectionsPerInstance != null) { + fieldMap.put("maxConnectionsPerInstance", Collections.singletonList(String.valueOf(maxConnectionsPerInstance))); + } + if (fieldNames.contains("maxRate") && maxRate != null) { + fieldMap.put("maxRate", Collections.singletonList(String.valueOf(maxRate))); + } + if (fieldNames.contains("maxRatePerInstance") && maxRatePerInstance != null) { + fieldMap.put("maxRatePerInstance", Collections.singletonList(String.valueOf(maxRatePerInstance))); + } + if (fieldNames.contains("maxUtilization") && maxUtilization != null) { + fieldMap.put("maxUtilization", Collections.singletonList(String.valueOf(maxUtilization))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("balancingMode")) { + return String.valueOf(balancingMode); + } + if (fieldName.equals("capacityScaler")) { + return String.valueOf(capacityScaler); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("group")) { + return String.valueOf(group); + } + if (fieldName.equals("maxConnections")) { + return String.valueOf(maxConnections); + } + if (fieldName.equals("maxConnectionsPerInstance")) { + return String.valueOf(maxConnectionsPerInstance); + } + if (fieldName.equals("maxRate")) { + return String.valueOf(maxRate); + } + if (fieldName.equals("maxRatePerInstance")) { + return String.valueOf(maxRatePerInstance); + } + if (fieldName.equals("maxUtilization")) { + return String.valueOf(maxUtilization); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getBalancingMode() { + return balancingMode; + } + + public Float getCapacityScaler() { + return capacityScaler; + } + + public String getDescription() { + return description; + } + + public String getGroup() { + return group; + } + + public Integer getMaxConnections() { + return maxConnections; + } + + public Integer getMaxConnectionsPerInstance() { + return maxConnectionsPerInstance; + } + + public Integer getMaxRate() { + return maxRate; + } + + public Float getMaxRatePerInstance() { + return maxRatePerInstance; + } + + public Float getMaxUtilization() { + return maxUtilization; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Backend prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Backend getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Backend DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Backend(); + } + + public static class Builder { + private String balancingMode; + private Float capacityScaler; + private String description; + private String group; + private Integer maxConnections; + private Integer maxConnectionsPerInstance; + private Integer maxRate; + private Float maxRatePerInstance; + private Float maxUtilization; + + Builder() {} + + public Builder mergeFrom(Backend other) { + if (other == Backend.getDefaultInstance()) return this; + if (other.getBalancingMode() != null) { + this.balancingMode = other.balancingMode; + } + if (other.getCapacityScaler() != null) { + this.capacityScaler = other.capacityScaler; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getGroup() != null) { + this.group = other.group; + } + if (other.getMaxConnections() != null) { + this.maxConnections = other.maxConnections; + } + if (other.getMaxConnectionsPerInstance() != null) { + this.maxConnectionsPerInstance = other.maxConnectionsPerInstance; + } + if (other.getMaxRate() != null) { + this.maxRate = other.maxRate; + } + if (other.getMaxRatePerInstance() != null) { + this.maxRatePerInstance = other.maxRatePerInstance; + } + if (other.getMaxUtilization() != null) { + this.maxUtilization = other.maxUtilization; + } + return this; + } + + Builder(Backend source) { + this.balancingMode = source.balancingMode; + this.capacityScaler = source.capacityScaler; + this.description = source.description; + this.group = source.group; + this.maxConnections = source.maxConnections; + this.maxConnectionsPerInstance = source.maxConnectionsPerInstance; + this.maxRate = source.maxRate; + this.maxRatePerInstance = source.maxRatePerInstance; + this.maxUtilization = source.maxUtilization; + } + + public String getBalancingMode() { + return balancingMode; + } + + public Builder setBalancingMode(String balancingMode) { + this.balancingMode = balancingMode; + return this; + } + + public Float getCapacityScaler() { + return capacityScaler; + } + + public Builder setCapacityScaler(Float capacityScaler) { + this.capacityScaler = capacityScaler; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getGroup() { + return group; + } + + public Builder setGroup(String group) { + this.group = group; + return this; + } + + public Integer getMaxConnections() { + return maxConnections; + } + + public Builder setMaxConnections(Integer maxConnections) { + this.maxConnections = maxConnections; + return this; + } + + public Integer getMaxConnectionsPerInstance() { + return maxConnectionsPerInstance; + } + + public Builder setMaxConnectionsPerInstance(Integer maxConnectionsPerInstance) { + this.maxConnectionsPerInstance = maxConnectionsPerInstance; + return this; + } + + public Integer getMaxRate() { + return maxRate; + } + + public Builder setMaxRate(Integer maxRate) { + this.maxRate = maxRate; + return this; + } + + public Float getMaxRatePerInstance() { + return maxRatePerInstance; + } + + public Builder setMaxRatePerInstance(Float maxRatePerInstance) { + this.maxRatePerInstance = maxRatePerInstance; + return this; + } + + public Float getMaxUtilization() { + return maxUtilization; + } + + public Builder setMaxUtilization(Float maxUtilization) { + this.maxUtilization = maxUtilization; + return this; + } + + + public Backend build() { + + + + + + + + + return new Backend( + balancingMode, + capacityScaler, + description, + group, + maxConnections, + maxConnectionsPerInstance, + maxRate, + maxRatePerInstance, + maxUtilization + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBalancingMode(this.balancingMode); + newBuilder.setCapacityScaler(this.capacityScaler); + newBuilder.setDescription(this.description); + newBuilder.setGroup(this.group); + newBuilder.setMaxConnections(this.maxConnections); + newBuilder.setMaxConnectionsPerInstance(this.maxConnectionsPerInstance); + newBuilder.setMaxRate(this.maxRate); + newBuilder.setMaxRatePerInstance(this.maxRatePerInstance); + newBuilder.setMaxUtilization(this.maxUtilization); + return newBuilder; + } + } + + @Override + public String toString() { + return "Backend{" + + "balancingMode=" + balancingMode + ", " + + "capacityScaler=" + capacityScaler + ", " + + "description=" + description + ", " + + "group=" + group + ", " + + "maxConnections=" + maxConnections + ", " + + "maxConnectionsPerInstance=" + maxConnectionsPerInstance + ", " + + "maxRate=" + maxRate + ", " + + "maxRatePerInstance=" + maxRatePerInstance + ", " + + "maxUtilization=" + maxUtilization + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Backend) { + Backend that = (Backend) o; + return + Objects.equals(this.balancingMode, that.getBalancingMode()) && + Objects.equals(this.capacityScaler, that.getCapacityScaler()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.group, that.getGroup()) && + Objects.equals(this.maxConnections, that.getMaxConnections()) && + Objects.equals(this.maxConnectionsPerInstance, that.getMaxConnectionsPerInstance()) && + Objects.equals(this.maxRate, that.getMaxRate()) && + Objects.equals(this.maxRatePerInstance, that.getMaxRatePerInstance()) && + Objects.equals(this.maxUtilization, that.getMaxUtilization()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + balancingMode, + capacityScaler, + description, + group, + maxConnections, + maxConnectionsPerInstance, + maxRate, + maxRatePerInstance, + maxUtilization + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java new file mode 100644 index 000000000000..51e9ed0294cd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java @@ -0,0 +1,798 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendService implements ApiMessage { + private final Integer affinityCookieTtlSec; + private final List backends; + private final ConnectionDraining connectionDraining; + private final String creationTimestamp; + private final String description; + private final Boolean enableCDN; + private final String fingerprint; + private final List healthChecks; + private final String id; + private final String kind; + private final String loadBalancingScheme; + private final String name; + private final Integer port; + private final String portName; + private final String protocol; + private final String region; + private final String selfLink; + private final String sessionAffinity; + private final Integer timeoutSec; + + private BackendService() { + this.affinityCookieTtlSec = null; + this.backends = null; + this.connectionDraining = null; + this.creationTimestamp = null; + this.description = null; + this.enableCDN = null; + this.fingerprint = null; + this.healthChecks = null; + this.id = null; + this.kind = null; + this.loadBalancingScheme = null; + this.name = null; + this.port = null; + this.portName = null; + this.protocol = null; + this.region = null; + this.selfLink = null; + this.sessionAffinity = null; + this.timeoutSec = null; + } + + + private BackendService( + Integer affinityCookieTtlSec, + List backends, + ConnectionDraining connectionDraining, + String creationTimestamp, + String description, + Boolean enableCDN, + String fingerprint, + List healthChecks, + String id, + String kind, + String loadBalancingScheme, + String name, + Integer port, + String portName, + String protocol, + String region, + String selfLink, + String sessionAffinity, + Integer timeoutSec + ) { + this.affinityCookieTtlSec = affinityCookieTtlSec; + this.backends = backends; + this.connectionDraining = connectionDraining; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.enableCDN = enableCDN; + this.fingerprint = fingerprint; + this.healthChecks = healthChecks; + this.id = id; + this.kind = kind; + this.loadBalancingScheme = loadBalancingScheme; + this.name = name; + this.port = port; + this.portName = portName; + this.protocol = protocol; + this.region = region; + this.selfLink = selfLink; + this.sessionAffinity = sessionAffinity; + this.timeoutSec = timeoutSec; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("affinityCookieTtlSec") && affinityCookieTtlSec != null) { + fieldMap.put("affinityCookieTtlSec", Collections.singletonList(String.valueOf(affinityCookieTtlSec))); + } + if (fieldNames.contains("backends") && backends != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Backend item : backends) { + stringList.add(item.toString()); + } + fieldMap.put("backends", stringList.build()); + } + if (fieldNames.contains("connectionDraining") && connectionDraining != null) { + fieldMap.put("connectionDraining", Collections.singletonList(String.valueOf(connectionDraining))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enableCDN") && enableCDN != null) { + fieldMap.put("enableCDN", Collections.singletonList(String.valueOf(enableCDN))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { + fieldMap.put("loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("protocol") && protocol != null) { + fieldMap.put("protocol", Collections.singletonList(String.valueOf(protocol))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) { + fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("affinityCookieTtlSec")) { + return String.valueOf(affinityCookieTtlSec); + } + if (fieldName.equals("backends")) { + return String.valueOf(backends); + } + if (fieldName.equals("connectionDraining")) { + return String.valueOf(connectionDraining); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("enableCDN")) { + return String.valueOf(enableCDN); + } + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("healthChecks")) { + return String.valueOf(healthChecks); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("loadBalancingScheme")) { + return String.valueOf(loadBalancingScheme); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("protocol")) { + return String.valueOf(protocol); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sessionAffinity")) { + return String.valueOf(sessionAffinity); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getAffinityCookieTtlSec() { + return affinityCookieTtlSec; + } + + public List getBackendsList() { + return backends; + } + + public ConnectionDraining getConnectionDraining() { + return connectionDraining; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Boolean getEnableCDN() { + return enableCDN; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getHealthChecksList() { + return healthChecks; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getLoadBalancingScheme() { + return loadBalancingScheme; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProtocol() { + return protocol; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getSessionAffinity() { + return sessionAffinity; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendService prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendService getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendService DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendService(); + } + + public static class Builder { + private Integer affinityCookieTtlSec; + private List backends; + private ConnectionDraining connectionDraining; + private String creationTimestamp; + private String description; + private Boolean enableCDN; + private String fingerprint; + private List healthChecks; + private String id; + private String kind; + private String loadBalancingScheme; + private String name; + private Integer port; + private String portName; + private String protocol; + private String region; + private String selfLink; + private String sessionAffinity; + private Integer timeoutSec; + + Builder() {} + + public Builder mergeFrom(BackendService other) { + if (other == BackendService.getDefaultInstance()) return this; + if (other.getAffinityCookieTtlSec() != null) { + this.affinityCookieTtlSec = other.affinityCookieTtlSec; + } + if (other.getBackendsList() != null) { + this.backends = other.backends; + } + if (other.getConnectionDraining() != null) { + this.connectionDraining = other.connectionDraining; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getEnableCDN() != null) { + this.enableCDN = other.enableCDN; + } + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getHealthChecksList() != null) { + this.healthChecks = other.healthChecks; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLoadBalancingScheme() != null) { + this.loadBalancingScheme = other.loadBalancingScheme; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProtocol() != null) { + this.protocol = other.protocol; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSessionAffinity() != null) { + this.sessionAffinity = other.sessionAffinity; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + return this; + } + + Builder(BackendService source) { + this.affinityCookieTtlSec = source.affinityCookieTtlSec; + this.backends = source.backends; + this.connectionDraining = source.connectionDraining; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.enableCDN = source.enableCDN; + this.fingerprint = source.fingerprint; + this.healthChecks = source.healthChecks; + this.id = source.id; + this.kind = source.kind; + this.loadBalancingScheme = source.loadBalancingScheme; + this.name = source.name; + this.port = source.port; + this.portName = source.portName; + this.protocol = source.protocol; + this.region = source.region; + this.selfLink = source.selfLink; + this.sessionAffinity = source.sessionAffinity; + this.timeoutSec = source.timeoutSec; + } + + public Integer getAffinityCookieTtlSec() { + return affinityCookieTtlSec; + } + + public Builder setAffinityCookieTtlSec(Integer affinityCookieTtlSec) { + this.affinityCookieTtlSec = affinityCookieTtlSec; + return this; + } + + public List getBackendsList() { + return backends; + } + + public Builder addAllBackends(List backends) { + if (this.backends == null) { + this.backends = new ArrayList<>(backends.size()); + } + this.backends.addAll(backends); + return this; + } + + public Builder addBackends(Backend backends) { + this.backends.add(backends); + return this; + } + + public ConnectionDraining getConnectionDraining() { + return connectionDraining; + } + + public Builder setConnectionDraining(ConnectionDraining connectionDraining) { + this.connectionDraining = connectionDraining; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Boolean getEnableCDN() { + return enableCDN; + } + + public Builder setEnableCDN(Boolean enableCDN) { + this.enableCDN = enableCDN; + return this; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getHealthChecksList() { + return healthChecks; + } + + public Builder addAllHealthChecks(List healthChecks) { + if (this.healthChecks == null) { + this.healthChecks = new ArrayList<>(healthChecks.size()); + } + this.healthChecks.addAll(healthChecks); + return this; + } + + public Builder addHealthChecks(String healthChecks) { + this.healthChecks.add(healthChecks); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getLoadBalancingScheme() { + return loadBalancingScheme; + } + + public Builder setLoadBalancingScheme(String loadBalancingScheme) { + this.loadBalancingScheme = loadBalancingScheme; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProtocol() { + return protocol; + } + + public Builder setProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getSessionAffinity() { + return sessionAffinity; + } + + public Builder setSessionAffinity(String sessionAffinity) { + this.sessionAffinity = sessionAffinity; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + + public BackendService build() { + + + + + + + + + + + + + + + + + + + return new BackendService( + affinityCookieTtlSec, + backends, + connectionDraining, + creationTimestamp, + description, + enableCDN, + fingerprint, + healthChecks, + id, + kind, + loadBalancingScheme, + name, + port, + portName, + protocol, + region, + selfLink, + sessionAffinity, + timeoutSec + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAffinityCookieTtlSec(this.affinityCookieTtlSec); + newBuilder.addAllBackends(this.backends); + newBuilder.setConnectionDraining(this.connectionDraining); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setEnableCDN(this.enableCDN); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllHealthChecks(this.healthChecks); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setLoadBalancingScheme(this.loadBalancingScheme); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProtocol(this.protocol); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSessionAffinity(this.sessionAffinity); + newBuilder.setTimeoutSec(this.timeoutSec); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendService{" + + "affinityCookieTtlSec=" + affinityCookieTtlSec + ", " + + "backends=" + backends + ", " + + "connectionDraining=" + connectionDraining + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "enableCDN=" + enableCDN + ", " + + "fingerprint=" + fingerprint + ", " + + "healthChecks=" + healthChecks + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "loadBalancingScheme=" + loadBalancingScheme + ", " + + "name=" + name + ", " + + "port=" + port + ", " + + "portName=" + portName + ", " + + "protocol=" + protocol + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "sessionAffinity=" + sessionAffinity + ", " + + "timeoutSec=" + timeoutSec + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendService) { + BackendService that = (BackendService) o; + return + Objects.equals(this.affinityCookieTtlSec, that.getAffinityCookieTtlSec()) && + Objects.equals(this.backends, that.getBackendsList()) && + Objects.equals(this.connectionDraining, that.getConnectionDraining()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.enableCDN, that.getEnableCDN()) && + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.healthChecks, that.getHealthChecksList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.portName, that.getPortName()) && + Objects.equals(this.protocol, that.getProtocol()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sessionAffinity, that.getSessionAffinity()) && + Objects.equals(this.timeoutSec, that.getTimeoutSec()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + affinityCookieTtlSec, + backends, + connectionDraining, + creationTimestamp, + description, + enableCDN, + fingerprint, + healthChecks, + id, + kind, + loadBalancingScheme, + name, + port, + portName, + protocol, + region, + selfLink, + sessionAffinity, + timeoutSec + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java new file mode 100644 index 000000000000..fa5494788f2f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendServiceAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private BackendServiceAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private BackendServiceAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendServiceAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendServiceAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendServiceAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendServiceAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(BackendServiceAggregatedList other) { + if (other == BackendServiceAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(BackendServiceAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public BackendServiceAggregatedList build() { + + + + + return new BackendServiceAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendServiceAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendServiceAggregatedList) { + BackendServiceAggregatedList that = (BackendServiceAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java new file mode 100644 index 000000000000..c8fd7e0d61f8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java @@ -0,0 +1,1251 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.BackendServiceStub; +import com.google.cloud.compute.v1.stub.BackendServiceStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+ *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+ *   Operation response = backendServiceClient.deleteBackendService(backendService);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the backendServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of BackendServiceSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * BackendServiceSettings backendServiceSettings =
+ *     BackendServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BackendServiceClient backendServiceClient =
+ *     BackendServiceClient.create(backendServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * BackendServiceSettings backendServiceSettings =
+ *     BackendServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BackendServiceClient backendServiceClient =
+ *     BackendServiceClient.create(backendServiceSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class BackendServiceClient implements BackgroundResource { + private final BackendServiceSettings settings; + private final BackendServiceStub stub; + + + + /** + * Constructs an instance of BackendServiceClient with default settings. + */ + public static final BackendServiceClient create() throws IOException { + return create(BackendServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of BackendServiceClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final BackendServiceClient create(BackendServiceSettings settings) throws IOException { + return new BackendServiceClient(settings); + } + + /** + * Constructs an instance of BackendServiceClient, using the given stub for making calls. This is for + * advanced usage - prefer to use BackendServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final BackendServiceClient create(BackendServiceStub stub) { + return new BackendServiceClient(stub); + } + + /** + * Constructs an instance of BackendServiceClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected BackendServiceClient(BackendServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((BackendServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected BackendServiceClient(BackendServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final BackendServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BackendServiceStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (BackendServicesScopedList element : backendServiceClient.aggregatedListBackendServices(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Name of the project scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(ProjectName project) { + AggregatedListBackendServicesHttpRequest request = + AggregatedListBackendServicesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListBackendServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (BackendServicesScopedList element : backendServiceClient.aggregatedListBackendServices(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Name of the project scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(String project) { + AggregatedListBackendServicesHttpRequest request = + AggregatedListBackendServicesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListBackendServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListBackendServicesHttpRequest request = AggregatedListBackendServicesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (BackendServicesScopedList element : backendServiceClient.aggregatedListBackendServices(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(AggregatedListBackendServicesHttpRequest request) { + return aggregatedListBackendServicesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListBackendServicesHttpRequest request = AggregatedListBackendServicesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListBackendServicesPagedResponse> future = backendServiceClient.aggregatedListBackendServicesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (BackendServicesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListBackendServicesPagedCallable() { + return stub.aggregatedListBackendServicesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListBackendServicesHttpRequest request = AggregatedListBackendServicesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     BackendServiceAggregatedList response = backendServiceClient.aggregatedListBackendServicesCallable().call(request);
+   *     for (BackendServicesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListBackendServicesCallable() { + return stub.aggregatedListBackendServicesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendService resource. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   Operation response = backendServiceClient.deleteBackendService(backendService);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteBackendService(BackendServiceName backendService) { + + DeleteBackendServiceHttpRequest request = + DeleteBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); + return deleteBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendService resource. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   Operation response = backendServiceClient.deleteBackendService(backendService.toString());
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteBackendService(String backendService) { + + DeleteBackendServiceHttpRequest request = + DeleteBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .build(); + return deleteBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendService resource. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   Operation response = backendServiceClient.deleteBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteBackendService(DeleteBackendServiceHttpRequest request) { + return deleteBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendService resource. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = backendServiceClient.deleteBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteBackendServiceCallable() { + return stub.deleteBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService response = backendServiceClient.getBackendService(backendService);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendService getBackendService(BackendServiceName backendService) { + + GetBackendServiceHttpRequest request = + GetBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); + return getBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService response = backendServiceClient.getBackendService(backendService.toString());
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendService getBackendService(String backendService) { + + GetBackendServiceHttpRequest request = + GetBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .build(); + return getBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   BackendService response = backendServiceClient.getBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendService getBackendService(GetBackendServiceHttpRequest request) { + return getBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   ApiFuture<BackendService> future = backendServiceClient.getBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   BackendService response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getBackendServiceCallable() { + return stub.getBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this BackendService. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(backendService, resourceGroupReferenceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param resourceGroupReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendServiceGroupHealth getHealthBackendService(BackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource) { + + GetHealthBackendServiceHttpRequest request = + GetHealthBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setResourceGroupReferenceResource(resourceGroupReferenceResource) + .build(); + return getHealthBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this BackendService. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(backendService.toString(), resourceGroupReferenceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param resourceGroupReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendServiceGroupHealth getHealthBackendService(String backendService, ResourceGroupReference resourceGroupReferenceResource) { + + GetHealthBackendServiceHttpRequest request = + GetHealthBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setResourceGroupReferenceResource(resourceGroupReferenceResource) + .build(); + return getHealthBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this BackendService. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setResourceGroupReferenceResource(resourceGroupReferenceResource)
+   *     .build();
+   *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendServiceGroupHealth getHealthBackendService(GetHealthBackendServiceHttpRequest request) { + return getHealthBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this BackendService. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setResourceGroupReferenceResource(resourceGroupReferenceResource)
+   *     .build();
+   *   ApiFuture<BackendServiceGroupHealth> future = backendServiceClient.getHealthBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   BackendServiceGroupHealth response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getHealthBackendServiceCallable() { + return stub.getHealthBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = backendServiceClient.insertBackendService(project, backendServiceResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertBackendService(ProjectName project, BackendService backendServiceResource) { + + InsertBackendServiceHttpRequest request = + InsertBackendServiceHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); + return insertBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = backendServiceClient.insertBackendService(project.toString(), backendServiceResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertBackendService(String project, BackendService backendServiceResource) { + + InsertBackendServiceHttpRequest request = + InsertBackendServiceHttpRequest.newBuilder() + .setProject(project) + .setBackendServiceResource(backendServiceResource) + .build(); + return insertBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   Operation response = backendServiceClient.insertBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertBackendService(InsertBackendServiceHttpRequest request) { + return insertBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendServiceClient.insertBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertBackendServiceCallable() { + return stub.insertBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (BackendService element : backendServiceClient.listBackendServices(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListBackendServicesPagedResponse listBackendServices(ProjectName project) { + ListBackendServicesHttpRequest request = + ListBackendServicesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listBackendServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (BackendService element : backendServiceClient.listBackendServices(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListBackendServicesPagedResponse listBackendServices(String project) { + ListBackendServicesHttpRequest request = + ListBackendServicesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listBackendServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListBackendServicesHttpRequest request = ListBackendServicesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (BackendService element : backendServiceClient.listBackendServices(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListBackendServicesPagedResponse listBackendServices(ListBackendServicesHttpRequest request) { + return listBackendServicesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListBackendServicesHttpRequest request = ListBackendServicesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListBackendServicesPagedResponse> future = backendServiceClient.listBackendServicesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (BackendService element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listBackendServicesPagedCallable() { + return stub.listBackendServicesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListBackendServicesHttpRequest request = ListBackendServicesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     BackendServiceList response = backendServiceClient.listBackendServicesCallable().call(request);
+   *     for (BackendService element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listBackendServicesCallable() { + return stub.listBackendServicesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = backendServiceClient.patchBackendService(backendService, backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchBackendService(BackendServiceName backendService, BackendService backendServiceResource) { + + PatchBackendServiceHttpRequest request = + PatchBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); + return patchBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = backendServiceClient.patchBackendService(backendService.toString(), backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchBackendService(String backendService, BackendService backendServiceResource) { + + PatchBackendServiceHttpRequest request = + PatchBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); + return patchBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   Operation response = backendServiceClient.patchBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchBackendService(PatchBackendServiceHttpRequest request) { + return patchBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendServiceClient.patchBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchBackendServiceCallable() { + return stub.patchBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = backendServiceClient.updateBackendService(backendService, backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateBackendService(BackendServiceName backendService, BackendService backendServiceResource) { + + UpdateBackendServiceHttpRequest request = + UpdateBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); + return updateBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = backendServiceClient.updateBackendService(backendService.toString(), backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateBackendService(String backendService, BackendService backendServiceResource) { + + UpdateBackendServiceHttpRequest request = + UpdateBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); + return updateBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   Operation response = backendServiceClient.updateBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateBackendService(UpdateBackendServiceHttpRequest request) { + return updateBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendServiceClient.updateBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateBackendServiceCallable() { + return stub.updateBackendServiceCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListBackendServicesPagedResponse extends AbstractPagedListResponse< + AggregatedListBackendServicesHttpRequest, + BackendServiceAggregatedList, + BackendServicesScopedList, + AggregatedListBackendServicesPage, + AggregatedListBackendServicesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListBackendServicesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListBackendServicesPagedResponse apply(AggregatedListBackendServicesPage input) { + return new AggregatedListBackendServicesPagedResponse(input); + } + }); + } + + private AggregatedListBackendServicesPagedResponse(AggregatedListBackendServicesPage page) { + super(page, AggregatedListBackendServicesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListBackendServicesPage extends AbstractPage< + AggregatedListBackendServicesHttpRequest, + BackendServiceAggregatedList, + BackendServicesScopedList, + AggregatedListBackendServicesPage> { + + private AggregatedListBackendServicesPage( + PageContext context, + BackendServiceAggregatedList response) { + super(context, response); + } + + private static AggregatedListBackendServicesPage createEmptyPage() { + return new AggregatedListBackendServicesPage(null, null); + } + + @Override + protected AggregatedListBackendServicesPage createPage( + PageContext context, + BackendServiceAggregatedList response) { + return new AggregatedListBackendServicesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListBackendServicesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListBackendServicesHttpRequest, + BackendServiceAggregatedList, + BackendServicesScopedList, + AggregatedListBackendServicesPage, + AggregatedListBackendServicesFixedSizeCollection> { + + private AggregatedListBackendServicesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListBackendServicesFixedSizeCollection createEmptyCollection() { + return new AggregatedListBackendServicesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListBackendServicesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListBackendServicesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListBackendServicesPagedResponse extends AbstractPagedListResponse< + ListBackendServicesHttpRequest, + BackendServiceList, + BackendService, + ListBackendServicesPage, + ListBackendServicesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackendServicesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBackendServicesPagedResponse apply(ListBackendServicesPage input) { + return new ListBackendServicesPagedResponse(input); + } + }); + } + + private ListBackendServicesPagedResponse(ListBackendServicesPage page) { + super(page, ListBackendServicesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListBackendServicesPage extends AbstractPage< + ListBackendServicesHttpRequest, + BackendServiceList, + BackendService, + ListBackendServicesPage> { + + private ListBackendServicesPage( + PageContext context, + BackendServiceList response) { + super(context, response); + } + + private static ListBackendServicesPage createEmptyPage() { + return new ListBackendServicesPage(null, null); + } + + @Override + protected ListBackendServicesPage createPage( + PageContext context, + BackendServiceList response) { + return new ListBackendServicesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListBackendServicesFixedSizeCollection extends AbstractFixedSizeCollection< + ListBackendServicesHttpRequest, + BackendServiceList, + BackendService, + ListBackendServicesPage, + ListBackendServicesFixedSizeCollection> { + + private ListBackendServicesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackendServicesFixedSizeCollection createEmptyCollection() { + return new ListBackendServicesFixedSizeCollection(null, 0); + } + + @Override + protected ListBackendServicesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackendServicesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java new file mode 100644 index 000000000000..7ef040b63790 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendServiceGroupHealth implements ApiMessage { + private final List healthStatus; + private final String kind; + + private BackendServiceGroupHealth() { + this.healthStatus = null; + this.kind = null; + } + + + private BackendServiceGroupHealth( + List healthStatus, + String kind + ) { + this.healthStatus = healthStatus; + this.kind = kind; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthStatus") && healthStatus != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthStatus item : healthStatus) { + stringList.add(item.toString()); + } + fieldMap.put("healthStatus", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthStatus")) { + return String.valueOf(healthStatus); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getHealthStatusList() { + return healthStatus; + } + + public String getKind() { + return kind; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendServiceGroupHealth prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendServiceGroupHealth getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendServiceGroupHealth DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendServiceGroupHealth(); + } + + public static class Builder { + private List healthStatus; + private String kind; + + Builder() {} + + public Builder mergeFrom(BackendServiceGroupHealth other) { + if (other == BackendServiceGroupHealth.getDefaultInstance()) return this; + if (other.getHealthStatusList() != null) { + this.healthStatus = other.healthStatus; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + return this; + } + + Builder(BackendServiceGroupHealth source) { + this.healthStatus = source.healthStatus; + this.kind = source.kind; + } + + public List getHealthStatusList() { + return healthStatus; + } + + public Builder addAllHealthStatus(List healthStatus) { + if (this.healthStatus == null) { + this.healthStatus = new ArrayList<>(healthStatus.size()); + } + this.healthStatus.addAll(healthStatus); + return this; + } + + public Builder addHealthStatus(HealthStatus healthStatus) { + this.healthStatus.add(healthStatus); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + + public BackendServiceGroupHealth build() { + + return new BackendServiceGroupHealth( + healthStatus, + kind + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllHealthStatus(this.healthStatus); + newBuilder.setKind(this.kind); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendServiceGroupHealth{" + + "healthStatus=" + healthStatus + ", " + + "kind=" + kind + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendServiceGroupHealth) { + BackendServiceGroupHealth that = (BackendServiceGroupHealth) o; + return + Objects.equals(this.healthStatus, that.getHealthStatusList()) && + Objects.equals(this.kind, that.getKind()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthStatus, + kind + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java new file mode 100644 index 000000000000..fe6616e3972d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendServiceList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private BackendServiceList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private BackendServiceList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (BackendService item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendServiceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendServiceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendServiceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendServiceList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(BackendServiceList other) { + if (other == BackendServiceList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(BackendServiceList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(BackendService items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public BackendServiceList build() { + + + + + return new BackendServiceList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendServiceList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendServiceList) { + BackendServiceList that = (BackendServiceList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java new file mode 100644 index 000000000000..d77efb55d378 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class BackendServiceName implements ResourceName { + private final String backendService; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/backendServices/{backendService}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BackendServiceName(Builder builder) { + backendService = Preconditions.checkNotNull(builder.getBackendService()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static BackendServiceName of( + String backendService, + String project + ) { + return newBuilder() + .setBackendService(backendService) + .setProject(project) + .build(); + } + + public static String format( + String backendService, + String project + ) { + return of( + backendService, + project + ) + .toString(); + } + + public String getBackendService() { + return backendService; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("backendService", backendService); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public BackendServiceName parse(String formattedString) {return BackendServiceName.parse(formattedString);} + }; + } + + public static BackendServiceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "BackendServiceName.parse: formattedString not in valid format"); + return of( + matchMap.get("backendService"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String backendService; + private String project; + + public String getBackendService() { + return backendService; + } + public String getProject() { + return project; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (BackendServiceName backendServiceName) { + backendService = backendServiceName.backendService; + project = backendServiceName.project; + } + + public BackendServiceName build() { + return new BackendServiceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "backendService", backendService, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendServiceName) { + BackendServiceName that = (BackendServiceName) o; + return + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + backendService, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java new file mode 100644 index 000000000000..f91f156010a5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java @@ -0,0 +1,325 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import com.google.cloud.compute.v1.stub.BackendServiceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link BackendServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteBackendService to 30 seconds: + * + *

+ * 
+ * BackendServiceSettings.Builder backendServiceSettingsBuilder =
+ *     BackendServiceSettings.newBuilder();
+ * backendServiceSettingsBuilder.deleteBackendServiceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * BackendServiceSettings backendServiceSettings = backendServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class BackendServiceSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListBackendServices. + */ + public PagedCallSettings aggregatedListBackendServicesSettings() { + return ((BackendServiceStubSettings) getStubSettings()).aggregatedListBackendServicesSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteBackendService. + */ + public UnaryCallSettings deleteBackendServiceSettings() { + return ((BackendServiceStubSettings) getStubSettings()).deleteBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to getBackendService. + */ + public UnaryCallSettings getBackendServiceSettings() { + return ((BackendServiceStubSettings) getStubSettings()).getBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to getHealthBackendService. + */ + public UnaryCallSettings getHealthBackendServiceSettings() { + return ((BackendServiceStubSettings) getStubSettings()).getHealthBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to insertBackendService. + */ + public UnaryCallSettings insertBackendServiceSettings() { + return ((BackendServiceStubSettings) getStubSettings()).insertBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to listBackendServices. + */ + public PagedCallSettings listBackendServicesSettings() { + return ((BackendServiceStubSettings) getStubSettings()).listBackendServicesSettings(); + } + + /** + * Returns the object with the settings used for calls to patchBackendService. + */ + public UnaryCallSettings patchBackendServiceSettings() { + return ((BackendServiceStubSettings) getStubSettings()).patchBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to updateBackendService. + */ + public UnaryCallSettings updateBackendServiceSettings() { + return ((BackendServiceStubSettings) getStubSettings()).updateBackendServiceSettings(); + } + + + public static final BackendServiceSettings create(BackendServiceStubSettings stub) throws IOException { + return new BackendServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return BackendServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return BackendServiceStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return BackendServiceStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return BackendServiceStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BackendServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return BackendServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return BackendServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BackendServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BackendServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for BackendServiceSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(BackendServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(BackendServiceStubSettings.newBuilder()); + } + + protected Builder(BackendServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(BackendServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public BackendServiceStubSettings.Builder getStubSettingsBuilder() { + return ((BackendServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListBackendServices. + */ + public PagedCallSettings.Builder aggregatedListBackendServicesSettings() { + return getStubSettingsBuilder().aggregatedListBackendServicesSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteBackendService. + */ + public UnaryCallSettings.Builder deleteBackendServiceSettings() { + return getStubSettingsBuilder().deleteBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBackendService. + */ + public UnaryCallSettings.Builder getBackendServiceSettings() { + return getStubSettingsBuilder().getBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getHealthBackendService. + */ + public UnaryCallSettings.Builder getHealthBackendServiceSettings() { + return getStubSettingsBuilder().getHealthBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertBackendService. + */ + public UnaryCallSettings.Builder insertBackendServiceSettings() { + return getStubSettingsBuilder().insertBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to listBackendServices. + */ + public PagedCallSettings.Builder listBackendServicesSettings() { + return getStubSettingsBuilder().listBackendServicesSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchBackendService. + */ + public UnaryCallSettings.Builder patchBackendServiceSettings() { + return getStubSettingsBuilder().patchBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateBackendService. + */ + public UnaryCallSettings.Builder updateBackendServiceSettings() { + return getStubSettingsBuilder().updateBackendServiceSettings(); + } + + @Override + public BackendServiceSettings build() throws IOException { + return new BackendServiceSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java new file mode 100644 index 000000000000..563b74fc4894 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendServicesScopedList implements ApiMessage { + private final List backendServices; + private final Warning warning; + + private BackendServicesScopedList() { + this.backendServices = null; + this.warning = null; + } + + + private BackendServicesScopedList( + List backendServices, + Warning warning + ) { + this.backendServices = backendServices; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("backendServices") && backendServices != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (BackendService item : backendServices) { + stringList.add(item.toString()); + } + fieldMap.put("backendServices", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("backendServices")) { + return String.valueOf(backendServices); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getBackendServicesList() { + return backendServices; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendServicesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendServicesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendServicesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendServicesScopedList(); + } + + public static class Builder { + private List backendServices; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(BackendServicesScopedList other) { + if (other == BackendServicesScopedList.getDefaultInstance()) return this; + if (other.getBackendServicesList() != null) { + this.backendServices = other.backendServices; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(BackendServicesScopedList source) { + this.backendServices = source.backendServices; + this.warning = source.warning; + } + + public List getBackendServicesList() { + return backendServices; + } + + public Builder addAllBackendServices(List backendServices) { + if (this.backendServices == null) { + this.backendServices = new ArrayList<>(backendServices.size()); + } + this.backendServices.addAll(backendServices); + return this; + } + + public Builder addBackendServices(BackendService backendServices) { + this.backendServices.add(backendServices); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public BackendServicesScopedList build() { + + return new BackendServicesScopedList( + backendServices, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllBackendServices(this.backendServices); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendServicesScopedList{" + + "backendServices=" + backendServices + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendServicesScopedList) { + BackendServicesScopedList that = (BackendServicesScopedList) o; + return + Objects.equals(this.backendServices, that.getBackendServicesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + backendServices, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java new file mode 100644 index 000000000000..67e5ce2ffbb5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class CacheInvalidationRule implements ApiMessage { + private final String host; + private final String path; + + private CacheInvalidationRule() { + this.host = null; + this.path = null; + } + + + private CacheInvalidationRule( + String host, + String path + ) { + this.host = host; + this.path = path; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("path") && path != null) { + fieldMap.put("path", Collections.singletonList(String.valueOf(path))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("path")) { + return String.valueOf(path); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHost() { + return host; + } + + public String getPath() { + return path; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(CacheInvalidationRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static CacheInvalidationRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final CacheInvalidationRule DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new CacheInvalidationRule(); + } + + public static class Builder { + private String host; + private String path; + + Builder() {} + + public Builder mergeFrom(CacheInvalidationRule other) { + if (other == CacheInvalidationRule.getDefaultInstance()) return this; + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPath() != null) { + this.path = other.path; + } + return this; + } + + Builder(CacheInvalidationRule source) { + this.host = source.host; + this.path = source.path; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getPath() { + return path; + } + + public Builder setPath(String path) { + this.path = path; + return this; + } + + + public CacheInvalidationRule build() { + + return new CacheInvalidationRule( + host, + path + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHost(this.host); + newBuilder.setPath(this.path); + return newBuilder; + } + } + + @Override + public String toString() { + return "CacheInvalidationRule{" + + "host=" + host + ", " + + "path=" + path + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CacheInvalidationRule) { + CacheInvalidationRule that = (CacheInvalidationRule) o; + return + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.path, that.getPath()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + host, + path + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java new file mode 100644 index 000000000000..e0a09e5c5865 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ConnectionDraining implements ApiMessage { + private final Integer drainingTimeoutSec; + + private ConnectionDraining() { + this.drainingTimeoutSec = null; + } + + + private ConnectionDraining( + Integer drainingTimeoutSec + ) { + this.drainingTimeoutSec = drainingTimeoutSec; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("drainingTimeoutSec") && drainingTimeoutSec != null) { + fieldMap.put("drainingTimeoutSec", Collections.singletonList(String.valueOf(drainingTimeoutSec))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("drainingTimeoutSec")) { + return String.valueOf(drainingTimeoutSec); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getDrainingTimeoutSec() { + return drainingTimeoutSec; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ConnectionDraining prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ConnectionDraining getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ConnectionDraining DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ConnectionDraining(); + } + + public static class Builder { + private Integer drainingTimeoutSec; + + Builder() {} + + public Builder mergeFrom(ConnectionDraining other) { + if (other == ConnectionDraining.getDefaultInstance()) return this; + if (other.getDrainingTimeoutSec() != null) { + this.drainingTimeoutSec = other.drainingTimeoutSec; + } + return this; + } + + Builder(ConnectionDraining source) { + this.drainingTimeoutSec = source.drainingTimeoutSec; + } + + public Integer getDrainingTimeoutSec() { + return drainingTimeoutSec; + } + + public Builder setDrainingTimeoutSec(Integer drainingTimeoutSec) { + this.drainingTimeoutSec = drainingTimeoutSec; + return this; + } + + + public ConnectionDraining build() { + return new ConnectionDraining( + drainingTimeoutSec + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDrainingTimeoutSec(this.drainingTimeoutSec); + return newBuilder; + } + } + + @Override + public String toString() { + return "ConnectionDraining{" + + "drainingTimeoutSec=" + drainingTimeoutSec + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ConnectionDraining) { + ConnectionDraining that = (ConnectionDraining) o; + return + Objects.equals(this.drainingTimeoutSec, that.getDrainingTimeoutSec()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + drainingTimeoutSec + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java new file mode 100644 index 000000000000..f87823d32377 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class CreateSnapshotDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final Snapshot snapshotResource; + private final String userIp; + + private CreateSnapshotDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.snapshotResource = null; + this.userIp = null; + } + + + private CreateSnapshotDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + Snapshot snapshotResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.snapshotResource = snapshotResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("snapshotResource") && snapshotResource != null) { + fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("snapshotResource")) { + return String.valueOf(snapshotResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Snapshot getApiMessageRequestBody() { + return snapshotResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Snapshot getSnapshotResource() { + return snapshotResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(CreateSnapshotDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static CreateSnapshotDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final CreateSnapshotDiskHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new CreateSnapshotDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private Snapshot snapshotResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(CreateSnapshotDiskHttpRequest other) { + if (other == CreateSnapshotDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSnapshotResource() != null) { + this.snapshotResource = other.snapshotResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(CreateSnapshotDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.snapshotResource = source.snapshotResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public Snapshot getSnapshotResource() { + return snapshotResource; + } + + public Builder setSnapshotResource(Snapshot snapshotResource) { + this.snapshotResource = snapshotResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public CreateSnapshotDiskHttpRequest build() { + String missing = ""; + + + if (disk == null) { + missing += " disk"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new CreateSnapshotDiskHttpRequest( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + snapshotResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSnapshotResource(this.snapshotResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "CreateSnapshotDiskHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "disk=" + disk + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "snapshotResource=" + snapshotResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CreateSnapshotDiskHttpRequest) { + CreateSnapshotDiskHttpRequest that = (CreateSnapshotDiskHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.disk, that.getDisk()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.snapshotResource, that.getSnapshotResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + snapshotResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java new file mode 100644 index 000000000000..b7f1d51b070f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class CustomerEncryptionKey implements ApiMessage { + private final String rawKey; + private final String sha256; + + private CustomerEncryptionKey() { + this.rawKey = null; + this.sha256 = null; + } + + + private CustomerEncryptionKey( + String rawKey, + String sha256 + ) { + this.rawKey = rawKey; + this.sha256 = sha256; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("rawKey") && rawKey != null) { + fieldMap.put("rawKey", Collections.singletonList(String.valueOf(rawKey))); + } + if (fieldNames.contains("sha256") && sha256 != null) { + fieldMap.put("sha256", Collections.singletonList(String.valueOf(sha256))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("rawKey")) { + return String.valueOf(rawKey); + } + if (fieldName.equals("sha256")) { + return String.valueOf(sha256); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getRawKey() { + return rawKey; + } + + public String getSha256() { + return sha256; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(CustomerEncryptionKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static CustomerEncryptionKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final CustomerEncryptionKey DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new CustomerEncryptionKey(); + } + + public static class Builder { + private String rawKey; + private String sha256; + + Builder() {} + + public Builder mergeFrom(CustomerEncryptionKey other) { + if (other == CustomerEncryptionKey.getDefaultInstance()) return this; + if (other.getRawKey() != null) { + this.rawKey = other.rawKey; + } + if (other.getSha256() != null) { + this.sha256 = other.sha256; + } + return this; + } + + Builder(CustomerEncryptionKey source) { + this.rawKey = source.rawKey; + this.sha256 = source.sha256; + } + + public String getRawKey() { + return rawKey; + } + + public Builder setRawKey(String rawKey) { + this.rawKey = rawKey; + return this; + } + + public String getSha256() { + return sha256; + } + + public Builder setSha256(String sha256) { + this.sha256 = sha256; + return this; + } + + + public CustomerEncryptionKey build() { + + return new CustomerEncryptionKey( + rawKey, + sha256 + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setRawKey(this.rawKey); + newBuilder.setSha256(this.sha256); + return newBuilder; + } + } + + @Override + public String toString() { + return "CustomerEncryptionKey{" + + "rawKey=" + rawKey + ", " + + "sha256=" + sha256 + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CustomerEncryptionKey) { + CustomerEncryptionKey that = (CustomerEncryptionKey) o; + return + Objects.equals(this.rawKey, that.getRawKey()) && + Objects.equals(this.sha256, that.getSha256()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + rawKey, + sha256 + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java new file mode 100644 index 000000000000..0bee694253f2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class CustomerEncryptionKeyProtectedDisk implements ApiMessage { + private final CustomerEncryptionKey diskEncryptionKey; + private final String source; + + private CustomerEncryptionKeyProtectedDisk() { + this.diskEncryptionKey = null; + this.source = null; + } + + + private CustomerEncryptionKeyProtectedDisk( + CustomerEncryptionKey diskEncryptionKey, + String source + ) { + this.diskEncryptionKey = diskEncryptionKey; + this.source = source; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { + fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskEncryptionKey")) { + return String.valueOf(diskEncryptionKey); + } + if (fieldName.equals("source")) { + return String.valueOf(source); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public CustomerEncryptionKey getDiskEncryptionKey() { + return diskEncryptionKey; + } + + public String getSource() { + return source; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(CustomerEncryptionKeyProtectedDisk prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static CustomerEncryptionKeyProtectedDisk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final CustomerEncryptionKeyProtectedDisk DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new CustomerEncryptionKeyProtectedDisk(); + } + + public static class Builder { + private CustomerEncryptionKey diskEncryptionKey; + private String source; + + Builder() {} + + public Builder mergeFrom(CustomerEncryptionKeyProtectedDisk other) { + if (other == CustomerEncryptionKeyProtectedDisk.getDefaultInstance()) return this; + if (other.getDiskEncryptionKey() != null) { + this.diskEncryptionKey = other.diskEncryptionKey; + } + if (other.getSource() != null) { + this.source = other.source; + } + return this; + } + + Builder(CustomerEncryptionKeyProtectedDisk source) { + this.diskEncryptionKey = source.diskEncryptionKey; + this.source = source.source; + } + + public CustomerEncryptionKey getDiskEncryptionKey() { + return diskEncryptionKey; + } + + public Builder setDiskEncryptionKey(CustomerEncryptionKey diskEncryptionKey) { + this.diskEncryptionKey = diskEncryptionKey; + return this; + } + + public String getSource() { + return source; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + + public CustomerEncryptionKeyProtectedDisk build() { + + return new CustomerEncryptionKeyProtectedDisk( + diskEncryptionKey, + source + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDiskEncryptionKey(this.diskEncryptionKey); + newBuilder.setSource(this.source); + return newBuilder; + } + } + + @Override + public String toString() { + return "CustomerEncryptionKeyProtectedDisk{" + + "diskEncryptionKey=" + diskEncryptionKey + ", " + + "source=" + source + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CustomerEncryptionKeyProtectedDisk) { + CustomerEncryptionKeyProtectedDisk that = (CustomerEncryptionKeyProtectedDisk) o; + return + Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && + Objects.equals(this.source, that.getSource()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + diskEncryptionKey, + source + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java new file mode 100644 index 000000000000..a10d08cfbe3a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Data implements ApiMessage { + private final String key; + private final String value; + + private Data() { + this.key = null; + this.value = null; + } + + + private Data( + String key, + String value + ) { + this.key = key; + this.value = value; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("value") && value != null) { + fieldMap.put("value", Collections.singletonList(String.valueOf(value))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("value")) { + return String.valueOf(value); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getKey() { + return key; + } + + public String getValue() { + return value; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Data prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Data getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Data DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Data(); + } + + public static class Builder { + private String key; + private String value; + + Builder() {} + + public Builder mergeFrom(Data other) { + if (other == Data.getDefaultInstance()) return this; + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getValue() != null) { + this.value = other.value; + } + return this; + } + + Builder(Data source) { + this.key = source.key; + this.value = source.value; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getValue() { + return value; + } + + public Builder setValue(String value) { + this.value = value; + return this; + } + + + public Data build() { + + return new Data( + key, + value + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setKey(this.key); + newBuilder.setValue(this.value); + return newBuilder; + } + } + + @Override + public String toString() { + return "Data{" + + "key=" + key + ", " + + "value=" + value + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Data) { + Data that = (Data) o; + return + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.value, that.getValue()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + key, + value + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java new file mode 100644 index 000000000000..4fed7c5e6957 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java @@ -0,0 +1,479 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteAccessConfigInstanceHttpRequest implements ApiMessage { + private final String accessConfig; + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String networkInterface; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteAccessConfigInstanceHttpRequest() { + this.accessConfig = null; + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.networkInterface = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteAccessConfigInstanceHttpRequest( + String accessConfig, + String access_token, + String callback, + String fields, + String instance, + String key, + String networkInterface, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.accessConfig = accessConfig; + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.networkInterface = networkInterface; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfig") && accessConfig != null) { + fieldMap.put("accessConfig", Collections.singletonList(String.valueOf(accessConfig))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("accessConfig")) { + return String.valueOf(accessConfig); + } + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("networkInterface")) { + return String.valueOf(networkInterface); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessConfig() { + return accessConfig; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteAccessConfigInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteAccessConfigInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteAccessConfigInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteAccessConfigInstanceHttpRequest(); + } + + public static class Builder { + private String accessConfig; + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String networkInterface; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteAccessConfigInstanceHttpRequest other) { + if (other == DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessConfig() != null) { + this.accessConfig = other.accessConfig; + } + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetworkInterface() != null) { + this.networkInterface = other.networkInterface; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteAccessConfigInstanceHttpRequest source) { + this.accessConfig = source.accessConfig; + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.networkInterface = source.networkInterface; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessConfig() { + return accessConfig; + } + + public Builder setAccessConfig(String accessConfig) { + this.accessConfig = accessConfig; + return this; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public Builder setNetworkInterface(String networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteAccessConfigInstanceHttpRequest build() { + String missing = ""; + if (accessConfig == null) { + missing += " accessConfig"; + } + + + + if (instance == null) { + missing += " instance"; + } + + if (networkInterface == null) { + missing += " networkInterface"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteAccessConfigInstanceHttpRequest( + accessConfig, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessConfig(this.accessConfig); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setNetworkInterface(this.networkInterface); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteAccessConfigInstanceHttpRequest{" + + "accessConfig=" + accessConfig + ", " + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "networkInterface=" + networkInterface + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteAccessConfigInstanceHttpRequest) { + DeleteAccessConfigInstanceHttpRequest that = (DeleteAccessConfigInstanceHttpRequest) o; + return + Objects.equals(this.accessConfig, that.getAccessConfig()) && + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.networkInterface, that.getNetworkInterface()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + accessConfig, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java new file mode 100644 index 000000000000..6f899b8a1c98 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteAddressHttpRequest implements ApiMessage { + private final String access_token; + private final String address; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteAddressHttpRequest() { + this.access_token = null; + this.address = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteAddressHttpRequest( + String access_token, + String address, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.address = address; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("address")) { + return String.valueOf(address); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAddress() { + return address; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteAddressHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteAddressHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteAddressHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteAddressHttpRequest(); + } + + public static class Builder { + private String access_token; + private String address; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteAddressHttpRequest other) { + if (other == DeleteAddressHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAddress() != null) { + this.address = other.address; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteAddressHttpRequest source) { + this.access_token = source.access_token; + this.address = source.address; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAddress() { + return address; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteAddressHttpRequest build() { + String missing = ""; + + if (address == null) { + missing += " address"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteAddressHttpRequest( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAddress(this.address); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteAddressHttpRequest{" + + "access_token=" + access_token + ", " + + "address=" + address + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteAddressHttpRequest) { + DeleteAddressHttpRequest that = (DeleteAddressHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java new file mode 100644 index 000000000000..d126024201a4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteAutoscalerHttpRequest( + String access_token, + String autoscaler, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteAutoscalerHttpRequest other) { + if (other == DeleteAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteAutoscalerHttpRequest build() { + String missing = ""; + + if (autoscaler == null) { + missing += " autoscaler"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteAutoscalerHttpRequest( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteAutoscalerHttpRequest) { + DeleteAutoscalerHttpRequest that = (DeleteAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java new file mode 100644 index 000000000000..358cbbc3cf23 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteBackendServiceHttpRequest( + String access_token, + String backendService, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteBackendServiceHttpRequest other) { + if (other == DeleteBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteBackendServiceHttpRequest( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteBackendServiceHttpRequest) { + DeleteBackendServiceHttpRequest that = (DeleteBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java new file mode 100644 index 000000000000..b03414aeedf2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteDiskHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteDiskHttpRequest other) { + if (other == DeleteDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteDiskHttpRequest build() { + String missing = ""; + + + if (disk == null) { + missing += " disk"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteDiskHttpRequest( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteDiskHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "disk=" + disk + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteDiskHttpRequest) { + DeleteDiskHttpRequest that = (DeleteDiskHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.disk, that.getDisk()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java new file mode 100644 index 000000000000..6689d82ccf47 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteFirewallHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String firewall; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteFirewallHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.firewall = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteFirewallHttpRequest( + String access_token, + String callback, + String fields, + String firewall, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.firewall = firewall; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("firewall")) { + return String.valueOf(firewall); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFirewall() { + return firewall; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteFirewallHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteFirewallHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteFirewallHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteFirewallHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String firewall; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteFirewallHttpRequest other) { + if (other == DeleteFirewallHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFirewall() != null) { + this.firewall = other.firewall; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteFirewallHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.firewall = source.firewall; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFirewall() { + return firewall; + } + + public Builder setFirewall(String firewall) { + this.firewall = firewall; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteFirewallHttpRequest build() { + String missing = ""; + + + + if (firewall == null) { + missing += " firewall"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteFirewallHttpRequest( + access_token, + callback, + fields, + firewall, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFirewall(this.firewall); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteFirewallHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "firewall=" + firewall + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteFirewallHttpRequest) { + DeleteFirewallHttpRequest that = (DeleteFirewallHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.firewall, that.getFirewall()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + firewall, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..60ec17e6f863 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String forwardingRule; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRule = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + String forwardingRule, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRule = forwardingRule; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRule")) { + return String.valueOf(forwardingRule); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String forwardingRule; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteForwardingRuleHttpRequest other) { + if (other == DeleteForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRule() != null) { + this.forwardingRule = other.forwardingRule; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRule = source.forwardingRule; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteForwardingRuleHttpRequest build() { + String missing = ""; + + + + if (forwardingRule == null) { + missing += " forwardingRule"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRule(this.forwardingRule); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRule=" + forwardingRule + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteForwardingRuleHttpRequest) { + DeleteForwardingRuleHttpRequest that = (DeleteForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java new file mode 100644 index 000000000000..4de69f7e8ce1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteGlobalAddressHttpRequest implements ApiMessage { + private final String access_token; + private final String address; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteGlobalAddressHttpRequest() { + this.access_token = null; + this.address = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteGlobalAddressHttpRequest( + String access_token, + String address, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.address = address; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("address")) { + return String.valueOf(address); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAddress() { + return address; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteGlobalAddressHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteGlobalAddressHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteGlobalAddressHttpRequest(); + } + + public static class Builder { + private String access_token; + private String address; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteGlobalAddressHttpRequest other) { + if (other == DeleteGlobalAddressHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAddress() != null) { + this.address = other.address; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteGlobalAddressHttpRequest source) { + this.access_token = source.access_token; + this.address = source.address; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAddress() { + return address; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteGlobalAddressHttpRequest build() { + String missing = ""; + + if (address == null) { + missing += " address"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteGlobalAddressHttpRequest( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAddress(this.address); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteGlobalAddressHttpRequest{" + + "access_token=" + access_token + ", " + + "address=" + address + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteGlobalAddressHttpRequest) { + DeleteGlobalAddressHttpRequest that = (DeleteGlobalAddressHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..4cfdd5ef74ae --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteGlobalForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String forwardingRule; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteGlobalForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRule = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteGlobalForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + String forwardingRule, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRule = forwardingRule; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRule")) { + return String.valueOf(forwardingRule); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteGlobalForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteGlobalForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteGlobalForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String forwardingRule; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteGlobalForwardingRuleHttpRequest other) { + if (other == DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRule() != null) { + this.forwardingRule = other.forwardingRule; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteGlobalForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRule = source.forwardingRule; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteGlobalForwardingRuleHttpRequest build() { + String missing = ""; + + + + if (forwardingRule == null) { + missing += " forwardingRule"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteGlobalForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRule(this.forwardingRule); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteGlobalForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRule=" + forwardingRule + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteGlobalForwardingRuleHttpRequest) { + DeleteGlobalForwardingRuleHttpRequest that = (DeleteGlobalForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java new file mode 100644 index 000000000000..c0015de99be7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteGlobalOperationHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String operation; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteGlobalOperationHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.operation = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteGlobalOperationHttpRequest( + String access_token, + String callback, + String fields, + String key, + String operation, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.operation = operation; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("operation")) { + return String.valueOf(operation); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getOperation() { + return operation; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteGlobalOperationHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteGlobalOperationHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteGlobalOperationHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteGlobalOperationHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String operation; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteGlobalOperationHttpRequest other) { + if (other == DeleteGlobalOperationHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperation() != null) { + this.operation = other.operation; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteGlobalOperationHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.operation = source.operation; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperation() { + return operation; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteGlobalOperationHttpRequest build() { + String missing = ""; + + + + + if (operation == null) { + missing += " operation"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteGlobalOperationHttpRequest( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setOperation(this.operation); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteGlobalOperationHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "operation=" + operation + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteGlobalOperationHttpRequest) { + DeleteGlobalOperationHttpRequest that = (DeleteGlobalOperationHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java new file mode 100644 index 000000000000..ab670b41018e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String healthCheck; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.healthCheck = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String healthCheck, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.healthCheck = healthCheck; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("healthCheck")) { + return String.valueOf(healthCheck); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHealthCheck() { + return healthCheck; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String healthCheck; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteHealthCheckHttpRequest other) { + if (other == DeleteHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHealthCheck() != null) { + this.healthCheck = other.healthCheck; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.healthCheck = source.healthCheck; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHealthCheck() { + return healthCheck; + } + + public Builder setHealthCheck(String healthCheck) { + this.healthCheck = healthCheck; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteHealthCheckHttpRequest build() { + String missing = ""; + + + + if (healthCheck == null) { + missing += " healthCheck"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteHealthCheckHttpRequest( + access_token, + callback, + fields, + healthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHealthCheck(this.healthCheck); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "healthCheck=" + healthCheck + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteHealthCheckHttpRequest) { + DeleteHealthCheckHttpRequest that = (DeleteHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.healthCheck, that.getHealthCheck()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + healthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java new file mode 100644 index 000000000000..28ddcccf70d7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteHttpHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpHealthCheck; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteHttpHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpHealthCheck = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteHttpHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpHealthCheck, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpHealthCheck = httpHealthCheck; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpHealthCheck")) { + return String.valueOf(httpHealthCheck); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteHttpHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteHttpHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteHttpHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpHealthCheck; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteHttpHealthCheckHttpRequest other) { + if (other == DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpHealthCheck() != null) { + this.httpHealthCheck = other.httpHealthCheck; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteHttpHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpHealthCheck = source.httpHealthCheck; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public Builder setHttpHealthCheck(String httpHealthCheck) { + this.httpHealthCheck = httpHealthCheck; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteHttpHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpHealthCheck == null) { + missing += " httpHealthCheck"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteHttpHealthCheckHttpRequest( + access_token, + callback, + fields, + httpHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpHealthCheck(this.httpHealthCheck); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteHttpHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpHealthCheck=" + httpHealthCheck + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteHttpHealthCheckHttpRequest) { + DeleteHttpHealthCheckHttpRequest that = (DeleteHttpHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java new file mode 100644 index 000000000000..02ae5a4bce71 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteHttpsHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpsHealthCheck; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteHttpsHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpsHealthCheck = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteHttpsHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpsHealthCheck, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpsHealthCheck = httpsHealthCheck; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpsHealthCheck")) { + return String.valueOf(httpsHealthCheck); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteHttpsHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteHttpsHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteHttpsHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpsHealthCheck; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteHttpsHealthCheckHttpRequest other) { + if (other == DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpsHealthCheck() != null) { + this.httpsHealthCheck = other.httpsHealthCheck; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteHttpsHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpsHealthCheck = source.httpsHealthCheck; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public Builder setHttpsHealthCheck(String httpsHealthCheck) { + this.httpsHealthCheck = httpsHealthCheck; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteHttpsHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpsHealthCheck == null) { + missing += " httpsHealthCheck"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteHttpsHealthCheckHttpRequest( + access_token, + callback, + fields, + httpsHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteHttpsHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpsHealthCheck=" + httpsHealthCheck + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteHttpsHealthCheckHttpRequest) { + DeleteHttpsHealthCheckHttpRequest that = (DeleteHttpsHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpsHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java new file mode 100644 index 000000000000..062f6a56f101 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteImageHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String image; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.image = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteImageHttpRequest( + String access_token, + String callback, + String fields, + String image, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.image = image; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("image") && image != null) { + fieldMap.put("image", Collections.singletonList(String.valueOf(image))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("image")) { + return String.valueOf(image); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getImage() { + return image; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteImageHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteImageHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String image; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteImageHttpRequest other) { + if (other == DeleteImageHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getImage() != null) { + this.image = other.image; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteImageHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.image = source.image; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getImage() { + return image; + } + + public Builder setImage(String image) { + this.image = image; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteImageHttpRequest build() { + String missing = ""; + + + + if (image == null) { + missing += " image"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteImageHttpRequest( + access_token, + callback, + fields, + image, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setImage(this.image); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteImageHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "image=" + image + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteImageHttpRequest) { + DeleteImageHttpRequest that = (DeleteImageHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.image, that.getImage()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + image, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..eb457fca0dc0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteInstanceGroupHttpRequest other) { + if (other == DeleteInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteInstanceGroupHttpRequest) { + DeleteInstanceGroupHttpRequest that = (DeleteInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..ed164619e352 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteInstanceGroupManagerHttpRequest other) { + if (other == DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteInstanceGroupManagerHttpRequest) { + DeleteInstanceGroupManagerHttpRequest that = (DeleteInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java new file mode 100644 index 000000000000..91e7a51f655b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteInstanceHttpRequest other) { + if (other == DeleteInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteInstanceHttpRequest) { + DeleteInstanceHttpRequest that = (DeleteInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java new file mode 100644 index 000000000000..b117eefe65b8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteInstanceTemplateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceTemplate; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteInstanceTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceTemplate = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteInstanceTemplateHttpRequest( + String access_token, + String callback, + String fields, + String instanceTemplate, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceTemplate = instanceTemplate; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteInstanceTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteInstanceTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteInstanceTemplateHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteInstanceTemplateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceTemplate; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteInstanceTemplateHttpRequest other) { + if (other == DeleteInstanceTemplateHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceTemplate() != null) { + this.instanceTemplate = other.instanceTemplate; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteInstanceTemplateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceTemplate = source.instanceTemplate; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteInstanceTemplateHttpRequest build() { + String missing = ""; + + + + if (instanceTemplate == null) { + missing += " instanceTemplate"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteInstanceTemplateHttpRequest( + access_token, + callback, + fields, + instanceTemplate, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceTemplate(this.instanceTemplate); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteInstanceTemplateHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceTemplate=" + instanceTemplate + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteInstanceTemplateHttpRequest) { + DeleteInstanceTemplateHttpRequest that = (DeleteInstanceTemplateHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceTemplate, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..fe4f1e2dc83a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteInstancesInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteInstancesInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagersDeleteInstancesRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteInstancesInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagersDeleteInstancesRequestResource = instanceGroupManagersDeleteInstancesRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersDeleteInstancesRequestResource") && instanceGroupManagersDeleteInstancesRequestResource != null) { + fieldMap.put("instanceGroupManagersDeleteInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersDeleteInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("instanceGroupManagersDeleteInstancesRequestResource")) { + return String.valueOf(instanceGroupManagersDeleteInstancesRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBody() { + return instanceGroupManagersDeleteInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManagersDeleteInstancesRequest getInstanceGroupManagersDeleteInstancesRequestResource() { + return instanceGroupManagersDeleteInstancesRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteInstancesInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteInstancesInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteInstancesInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteInstancesInstanceGroupManagerHttpRequest other) { + if (other == DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagersDeleteInstancesRequestResource() != null) { + this.instanceGroupManagersDeleteInstancesRequestResource = other.instanceGroupManagersDeleteInstancesRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteInstancesInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagersDeleteInstancesRequestResource = source.instanceGroupManagersDeleteInstancesRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManagersDeleteInstancesRequest getInstanceGroupManagersDeleteInstancesRequestResource() { + return instanceGroupManagersDeleteInstancesRequestResource; + } + + public Builder setInstanceGroupManagersDeleteInstancesRequestResource(InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { + this.instanceGroupManagersDeleteInstancesRequestResource = instanceGroupManagersDeleteInstancesRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteInstancesInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteInstancesInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersDeleteInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagersDeleteInstancesRequestResource(this.instanceGroupManagersDeleteInstancesRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteInstancesInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "instanceGroupManagersDeleteInstancesRequestResource=" + instanceGroupManagersDeleteInstancesRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteInstancesInstanceGroupManagerHttpRequest) { + DeleteInstancesInstanceGroupManagerHttpRequest that = (DeleteInstancesInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.instanceGroupManagersDeleteInstancesRequestResource, that.getInstanceGroupManagersDeleteInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersDeleteInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..1dd25cee840b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteInstancesRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource; + private final String userIp; + + private DeleteInstancesRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupManagersDeleteInstancesRequestResource = null; + this.userIp = null; + } + + + private DeleteInstancesRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupManagersDeleteInstancesRequestResource = regionInstanceGroupManagersDeleteInstancesRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource") && regionInstanceGroupManagersDeleteInstancesRequestResource != null) { + fieldMap.put("regionInstanceGroupManagersDeleteInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupManagersDeleteInstancesRequestResource")) { + return String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBody() { + return regionInstanceGroupManagersDeleteInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupManagersDeleteInstancesRequest getRegionInstanceGroupManagersDeleteInstancesRequestResource() { + return regionInstanceGroupManagersDeleteInstancesRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteInstancesRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteInstancesRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteInstancesRegionInstanceGroupManagerHttpRequest other) { + if (other == DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupManagersDeleteInstancesRequestResource() != null) { + this.regionInstanceGroupManagersDeleteInstancesRequestResource = other.regionInstanceGroupManagersDeleteInstancesRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteInstancesRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupManagersDeleteInstancesRequestResource = source.regionInstanceGroupManagersDeleteInstancesRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupManagersDeleteInstancesRequest getRegionInstanceGroupManagersDeleteInstancesRequestResource() { + return regionInstanceGroupManagersDeleteInstancesRequestResource; + } + + public Builder setRegionInstanceGroupManagersDeleteInstancesRequestResource(RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { + this.regionInstanceGroupManagersDeleteInstancesRequestResource = regionInstanceGroupManagersDeleteInstancesRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteInstancesRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteInstancesRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersDeleteInstancesRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupManagersDeleteInstancesRequestResource(this.regionInstanceGroupManagersDeleteInstancesRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteInstancesRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupManagersDeleteInstancesRequestResource=" + regionInstanceGroupManagersDeleteInstancesRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteInstancesRegionInstanceGroupManagerHttpRequest) { + DeleteInstancesRegionInstanceGroupManagerHttpRequest that = (DeleteInstancesRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupManagersDeleteInstancesRequestResource, that.getRegionInstanceGroupManagersDeleteInstancesRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersDeleteInstancesRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java new file mode 100644 index 000000000000..5110312966e3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String network; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.network = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String network, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.network = network; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNetwork() { + return network; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String network; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteNetworkHttpRequest other) { + if (other == DeleteNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.network = source.network; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteNetworkHttpRequest build() { + String missing = ""; + + + + + if (network == null) { + missing += " network"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteNetworkHttpRequest( + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetwork(this.network); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteNetworkHttpRequest) { + DeleteNetworkHttpRequest that = (DeleteNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java new file mode 100644 index 000000000000..1b1532fb6f99 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRegionAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteRegionAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteRegionAutoscalerHttpRequest( + String access_token, + String autoscaler, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteRegionAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRegionAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteRegionAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRegionAutoscalerHttpRequest other) { + if (other == DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRegionAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteRegionAutoscalerHttpRequest build() { + String missing = ""; + + if (autoscaler == null) { + missing += " autoscaler"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRegionAutoscalerHttpRequest( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRegionAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRegionAutoscalerHttpRequest) { + DeleteRegionAutoscalerHttpRequest that = (DeleteRegionAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java new file mode 100644 index 000000000000..4f4c3b8a73dd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRegionBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteRegionBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteRegionBackendServiceHttpRequest( + String access_token, + String backendService, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteRegionBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRegionBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteRegionBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRegionBackendServiceHttpRequest other) { + if (other == DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRegionBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteRegionBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRegionBackendServiceHttpRequest( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRegionBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRegionBackendServiceHttpRequest) { + DeleteRegionBackendServiceHttpRequest that = (DeleteRegionBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..be5a2f799255 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRegionInstanceGroupManagerHttpRequest other) { + if (other == DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRegionInstanceGroupManagerHttpRequest) { + DeleteRegionInstanceGroupManagerHttpRequest that = (DeleteRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java new file mode 100644 index 000000000000..240e2a8351d0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRegionOperationHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String operation; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteRegionOperationHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.operation = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteRegionOperationHttpRequest( + String access_token, + String callback, + String fields, + String key, + String operation, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.operation = operation; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("operation")) { + return String.valueOf(operation); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getOperation() { + return operation; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteRegionOperationHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRegionOperationHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteRegionOperationHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteRegionOperationHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String operation; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRegionOperationHttpRequest other) { + if (other == DeleteRegionOperationHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperation() != null) { + this.operation = other.operation; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRegionOperationHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.operation = source.operation; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperation() { + return operation; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteRegionOperationHttpRequest build() { + String missing = ""; + + + + + if (operation == null) { + missing += " operation"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRegionOperationHttpRequest( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setOperation(this.operation); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRegionOperationHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "operation=" + operation + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRegionOperationHttpRequest) { + DeleteRegionOperationHttpRequest that = (DeleteRegionOperationHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java new file mode 100644 index 000000000000..8fc8751b6256 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRouteHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String route; + private final String userIp; + + private DeleteRouteHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.route = null; + this.userIp = null; + } + + + private DeleteRouteHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String route, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.route = route; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("route") && route != null) { + fieldMap.put("route", Collections.singletonList(String.valueOf(route))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("route")) { + return String.valueOf(route); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRoute() { + return route; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteRouteHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRouteHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteRouteHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteRouteHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String route; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRouteHttpRequest other) { + if (other == DeleteRouteHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRoute() != null) { + this.route = other.route; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRouteHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.route = source.route; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRoute() { + return route; + } + + public Builder setRoute(String route) { + this.route = route; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteRouteHttpRequest build() { + String missing = ""; + + + + + + + if (route == null) { + missing += " route"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRouteHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + route, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRoute(this.route); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRouteHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "route=" + route + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRouteHttpRequest) { + DeleteRouteHttpRequest that = (DeleteRouteHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.route, that.getRoute()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + route, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java new file mode 100644 index 000000000000..838f38158690 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String router; + private final String userIp; + + private DeleteRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.router = null; + this.userIp = null; + } + + + private DeleteRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String router, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.router = router; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRouter() { + return router; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String router; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRouterHttpRequest other) { + if (other == DeleteRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.router = source.router; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteRouterHttpRequest build() { + String missing = ""; + + + + + + + if (router == null) { + missing += " router"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouter(this.router); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "router=" + router + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRouterHttpRequest) { + DeleteRouterHttpRequest that = (DeleteRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java new file mode 100644 index 000000000000..fb5c26d280bf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteSnapshotHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String snapshot; + private final String userIp; + + private DeleteSnapshotHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.snapshot = null; + this.userIp = null; + } + + + private DeleteSnapshotHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String snapshot, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.snapshot = snapshot; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("snapshot") && snapshot != null) { + fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("snapshot")) { + return String.valueOf(snapshot); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSnapshot() { + return snapshot; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteSnapshotHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteSnapshotHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteSnapshotHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteSnapshotHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String snapshot; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteSnapshotHttpRequest other) { + if (other == DeleteSnapshotHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSnapshot() != null) { + this.snapshot = other.snapshot; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteSnapshotHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.snapshot = source.snapshot; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSnapshot() { + return snapshot; + } + + public Builder setSnapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteSnapshotHttpRequest build() { + String missing = ""; + + + + + + + if (snapshot == null) { + missing += " snapshot"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteSnapshotHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + snapshot, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSnapshot(this.snapshot); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteSnapshotHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "snapshot=" + snapshot + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteSnapshotHttpRequest) { + DeleteSnapshotHttpRequest that = (DeleteSnapshotHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.snapshot, that.getSnapshot()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + snapshot, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java new file mode 100644 index 000000000000..3f3c1f4a57c3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteSslCertificateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String sslCertificate; + private final String userIp; + + private DeleteSslCertificateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.sslCertificate = null; + this.userIp = null; + } + + + private DeleteSslCertificateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String sslCertificate, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.sslCertificate = sslCertificate; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sslCertificate") && sslCertificate != null) { + fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("sslCertificate")) { + return String.valueOf(sslCertificate); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSslCertificate() { + return sslCertificate; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteSslCertificateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteSslCertificateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteSslCertificateHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteSslCertificateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String sslCertificate; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteSslCertificateHttpRequest other) { + if (other == DeleteSslCertificateHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSslCertificate() != null) { + this.sslCertificate = other.sslCertificate; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteSslCertificateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.sslCertificate = source.sslCertificate; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSslCertificate() { + return sslCertificate; + } + + public Builder setSslCertificate(String sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteSslCertificateHttpRequest build() { + String missing = ""; + + + + + + + if (sslCertificate == null) { + missing += " sslCertificate"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteSslCertificateHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + sslCertificate, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSslCertificate(this.sslCertificate); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteSslCertificateHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "sslCertificate=" + sslCertificate + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteSslCertificateHttpRequest) { + DeleteSslCertificateHttpRequest that = (DeleteSslCertificateHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.sslCertificate, that.getSslCertificate()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + sslCertificate, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java new file mode 100644 index 000000000000..4e705b060b16 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteSubnetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String subnetwork; + private final String userIp; + + private DeleteSubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.subnetwork = null; + this.userIp = null; + } + + + private DeleteSubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String subnetwork, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.subnetwork = subnetwork; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSubnetwork() { + return subnetwork; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteSubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteSubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteSubnetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteSubnetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String subnetwork; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteSubnetworkHttpRequest other) { + if (other == DeleteSubnetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteSubnetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.subnetwork = source.subnetwork; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteSubnetworkHttpRequest build() { + String missing = ""; + + + + + + + if (subnetwork == null) { + missing += " subnetwork"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteSubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + subnetwork, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSubnetwork(this.subnetwork); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteSubnetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "subnetwork=" + subnetwork + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteSubnetworkHttpRequest) { + DeleteSubnetworkHttpRequest that = (DeleteSubnetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + subnetwork, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java new file mode 100644 index 000000000000..9aa0a4fe93e3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteTargetHttpProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetHttpProxy; + private final String userIp; + + private DeleteTargetHttpProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpProxy = null; + this.userIp = null; + } + + + private DeleteTargetHttpProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetHttpProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpProxy = targetHttpProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { + fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpProxy")) { + return String.valueOf(targetHttpProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteTargetHttpProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteTargetHttpProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteTargetHttpProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetHttpProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteTargetHttpProxyHttpRequest other) { + if (other == DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpProxy() != null) { + this.targetHttpProxy = other.targetHttpProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteTargetHttpProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpProxy = source.targetHttpProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public Builder setTargetHttpProxy(String targetHttpProxy) { + this.targetHttpProxy = targetHttpProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteTargetHttpProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetHttpProxy == null) { + missing += " targetHttpProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteTargetHttpProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpProxy(this.targetHttpProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteTargetHttpProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpProxy=" + targetHttpProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteTargetHttpProxyHttpRequest) { + DeleteTargetHttpProxyHttpRequest that = (DeleteTargetHttpProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..87b1ce126bde --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetHttpsProxy; + private final String userIp; + + private DeleteTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpsProxy = null; + this.userIp = null; + } + + + private DeleteTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetHttpsProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpsProxy = targetHttpsProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpsProxy")) { + return String.valueOf(targetHttpsProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetHttpsProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteTargetHttpsProxyHttpRequest other) { + if (other == DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpsProxy() != null) { + this.targetHttpsProxy = other.targetHttpsProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpsProxy = source.targetHttpsProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteTargetHttpsProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetHttpsProxy == null) { + missing += " targetHttpsProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteTargetHttpsProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpsProxy=" + targetHttpsProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteTargetHttpsProxyHttpRequest) { + DeleteTargetHttpsProxyHttpRequest that = (DeleteTargetHttpsProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java new file mode 100644 index 000000000000..f511b02f13f6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteTargetInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetInstance; + private final String userIp; + + private DeleteTargetInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetInstance = null; + this.userIp = null; + } + + + private DeleteTargetInstanceHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetInstance, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetInstance = targetInstance; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetInstance") && targetInstance != null) { + fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetInstance")) { + return String.valueOf(targetInstance); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetInstance() { + return targetInstance; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteTargetInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteTargetInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteTargetInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteTargetInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetInstance; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteTargetInstanceHttpRequest other) { + if (other == DeleteTargetInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetInstance() != null) { + this.targetInstance = other.targetInstance; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteTargetInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetInstance = source.targetInstance; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetInstance() { + return targetInstance; + } + + public Builder setTargetInstance(String targetInstance) { + this.targetInstance = targetInstance; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteTargetInstanceHttpRequest build() { + String missing = ""; + + + + + + + if (targetInstance == null) { + missing += " targetInstance"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteTargetInstanceHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetInstance, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetInstance(this.targetInstance); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteTargetInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetInstance=" + targetInstance + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteTargetInstanceHttpRequest) { + DeleteTargetInstanceHttpRequest that = (DeleteTargetInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetInstance, that.getTargetInstance()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetInstance, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java new file mode 100644 index 000000000000..dfdced03ab8f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final String userIp; + + private DeleteTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.userIp = null; + } + + + private DeleteTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteTargetPoolHttpRequest other) { + if (other == DeleteTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteTargetPoolHttpRequest) { + DeleteTargetPoolHttpRequest that = (DeleteTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..cccd039942bd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetSslProxy; + private final String userIp; + + private DeleteTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetSslProxy = null; + this.userIp = null; + } + + + private DeleteTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetSslProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetSslProxy = targetSslProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetSslProxy")) { + return String.valueOf(targetSslProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetSslProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteTargetSslProxyHttpRequest other) { + if (other == DeleteTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetSslProxy() != null) { + this.targetSslProxy = other.targetSslProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetSslProxy = source.targetSslProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteTargetSslProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetSslProxy == null) { + missing += " targetSslProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetSslProxy(this.targetSslProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteTargetSslProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetSslProxy=" + targetSslProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteTargetSslProxyHttpRequest) { + DeleteTargetSslProxyHttpRequest that = (DeleteTargetSslProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java new file mode 100644 index 000000000000..be2df80b877c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteTargetVpnGatewayHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetVpnGateway; + private final String userIp; + + private DeleteTargetVpnGatewayHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetVpnGateway = null; + this.userIp = null; + } + + + private DeleteTargetVpnGatewayHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetVpnGateway, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetVpnGateway = targetVpnGateway; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { + fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetVpnGateway")) { + return String.valueOf(targetVpnGateway); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteTargetVpnGatewayHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteTargetVpnGatewayHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteTargetVpnGatewayHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteTargetVpnGatewayHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetVpnGateway; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteTargetVpnGatewayHttpRequest other) { + if (other == DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetVpnGateway() != null) { + this.targetVpnGateway = other.targetVpnGateway; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteTargetVpnGatewayHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetVpnGateway = source.targetVpnGateway; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + public Builder setTargetVpnGateway(String targetVpnGateway) { + this.targetVpnGateway = targetVpnGateway; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteTargetVpnGatewayHttpRequest build() { + String missing = ""; + + + + + + + if (targetVpnGateway == null) { + missing += " targetVpnGateway"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteTargetVpnGatewayHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetVpnGateway, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetVpnGateway(this.targetVpnGateway); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteTargetVpnGatewayHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetVpnGateway=" + targetVpnGateway + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteTargetVpnGatewayHttpRequest) { + DeleteTargetVpnGatewayHttpRequest that = (DeleteTargetVpnGatewayHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetVpnGateway, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java new file mode 100644 index 000000000000..a2bc7526cbdd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String urlMap; + private final String userIp; + + private DeleteUrlMapHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.urlMap = null; + this.userIp = null; + } + + + private DeleteUrlMapHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String urlMap, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.urlMap = urlMap; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUrlMap() { + return urlMap; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String urlMap; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteUrlMapHttpRequest other) { + if (other == DeleteUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.urlMap = source.urlMap; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteUrlMapHttpRequest build() { + String missing = ""; + + + + + + + if (urlMap == null) { + missing += " urlMap"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteUrlMapHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMap(this.urlMap); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMap=" + urlMap + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteUrlMapHttpRequest) { + DeleteUrlMapHttpRequest that = (DeleteUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMap, that.getUrlMap()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java new file mode 100644 index 000000000000..2ddedd993d93 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteVpnTunnelHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String vpnTunnel; + + private DeleteVpnTunnelHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.vpnTunnel = null; + } + + + private DeleteVpnTunnelHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String vpnTunnel + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.vpnTunnel = vpnTunnel; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) { + fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("vpnTunnel")) { + return String.valueOf(vpnTunnel); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getVpnTunnel() { + return vpnTunnel; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteVpnTunnelHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteVpnTunnelHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteVpnTunnelHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String vpnTunnel; + + Builder() {} + + public Builder mergeFrom(DeleteVpnTunnelHttpRequest other) { + if (other == DeleteVpnTunnelHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getVpnTunnel() != null) { + this.vpnTunnel = other.vpnTunnel; + } + return this; + } + + Builder(DeleteVpnTunnelHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.vpnTunnel = source.vpnTunnel; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getVpnTunnel() { + return vpnTunnel; + } + + public Builder setVpnTunnel(String vpnTunnel) { + this.vpnTunnel = vpnTunnel; + return this; + } + + + public DeleteVpnTunnelHttpRequest build() { + String missing = ""; + + + + + + + + if (vpnTunnel == null) { + missing += " vpnTunnel"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteVpnTunnelHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + vpnTunnel + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setVpnTunnel(this.vpnTunnel); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteVpnTunnelHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "vpnTunnel=" + vpnTunnel + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteVpnTunnelHttpRequest) { + DeleteVpnTunnelHttpRequest that = (DeleteVpnTunnelHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.vpnTunnel, that.getVpnTunnel()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + vpnTunnel + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java new file mode 100644 index 000000000000..bb50690c4cb8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteZoneOperationHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String operation; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeleteZoneOperationHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.operation = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeleteZoneOperationHttpRequest( + String access_token, + String callback, + String fields, + String key, + String operation, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.operation = operation; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("operation")) { + return String.valueOf(operation); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getOperation() { + return operation; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeleteZoneOperationHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteZoneOperationHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeleteZoneOperationHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeleteZoneOperationHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String operation; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteZoneOperationHttpRequest other) { + if (other == DeleteZoneOperationHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperation() != null) { + this.operation = other.operation; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteZoneOperationHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.operation = source.operation; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperation() { + return operation; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeleteZoneOperationHttpRequest build() { + String missing = ""; + + + + + if (operation == null) { + missing += " operation"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteZoneOperationHttpRequest( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setOperation(this.operation); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteZoneOperationHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "operation=" + operation + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteZoneOperationHttpRequest) { + DeleteZoneOperationHttpRequest that = (DeleteZoneOperationHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java new file mode 100644 index 000000000000..20d68ba4b9c7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeprecateImageHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final DeprecationStatus deprecationStatusResource; + private final String fields; + private final String image; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DeprecateImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.deprecationStatusResource = null; + this.fields = null; + this.image = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DeprecateImageHttpRequest( + String access_token, + String callback, + DeprecationStatus deprecationStatusResource, + String fields, + String image, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.deprecationStatusResource = deprecationStatusResource; + this.fields = fields; + this.image = image; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deprecationStatusResource") && deprecationStatusResource != null) { + fieldMap.put("deprecationStatusResource", Collections.singletonList(String.valueOf(deprecationStatusResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("image") && image != null) { + fieldMap.put("image", Collections.singletonList(String.valueOf(image))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("deprecationStatusResource")) { + return String.valueOf(deprecationStatusResource); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("image")) { + return String.valueOf(image); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public DeprecationStatus getApiMessageRequestBody() { + return deprecationStatusResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public DeprecationStatus getDeprecationStatusResource() { + return deprecationStatusResource; + } + + public String getFields() { + return fields; + } + + public String getImage() { + return image; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeprecateImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeprecateImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeprecateImageHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeprecateImageHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private DeprecationStatus deprecationStatusResource; + private String fields; + private String image; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeprecateImageHttpRequest other) { + if (other == DeprecateImageHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDeprecationStatusResource() != null) { + this.deprecationStatusResource = other.deprecationStatusResource; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getImage() != null) { + this.image = other.image; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeprecateImageHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.deprecationStatusResource = source.deprecationStatusResource; + this.fields = source.fields; + this.image = source.image; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public DeprecationStatus getDeprecationStatusResource() { + return deprecationStatusResource; + } + + public Builder setDeprecationStatusResource(DeprecationStatus deprecationStatusResource) { + this.deprecationStatusResource = deprecationStatusResource; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getImage() { + return image; + } + + public Builder setImage(String image) { + this.image = image; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DeprecateImageHttpRequest build() { + String missing = ""; + + + + + if (image == null) { + missing += " image"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeprecateImageHttpRequest( + access_token, + callback, + deprecationStatusResource, + fields, + image, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDeprecationStatusResource(this.deprecationStatusResource); + newBuilder.setFields(this.fields); + newBuilder.setImage(this.image); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeprecateImageHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "deprecationStatusResource=" + deprecationStatusResource + ", " + + "fields=" + fields + ", " + + "image=" + image + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeprecateImageHttpRequest) { + DeprecateImageHttpRequest that = (DeprecateImageHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.deprecationStatusResource, that.getDeprecationStatusResource()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.image, that.getImage()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + deprecationStatusResource, + fields, + image, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java new file mode 100644 index 000000000000..4804140dbb3b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeprecationStatus implements ApiMessage { + private final String deleted; + private final String deprecated; + private final String obsolete; + private final String replacement; + private final String state; + + private DeprecationStatus() { + this.deleted = null; + this.deprecated = null; + this.obsolete = null; + this.replacement = null; + this.state = null; + } + + + private DeprecationStatus( + String deleted, + String deprecated, + String obsolete, + String replacement, + String state + ) { + this.deleted = deleted; + this.deprecated = deprecated; + this.obsolete = obsolete; + this.replacement = replacement; + this.state = state; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("deleted") && deleted != null) { + fieldMap.put("deleted", Collections.singletonList(String.valueOf(deleted))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("obsolete") && obsolete != null) { + fieldMap.put("obsolete", Collections.singletonList(String.valueOf(obsolete))); + } + if (fieldNames.contains("replacement") && replacement != null) { + fieldMap.put("replacement", Collections.singletonList(String.valueOf(replacement))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("deleted")) { + return String.valueOf(deleted); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("obsolete")) { + return String.valueOf(obsolete); + } + if (fieldName.equals("replacement")) { + return String.valueOf(replacement); + } + if (fieldName.equals("state")) { + return String.valueOf(state); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDeleted() { + return deleted; + } + + public String getDeprecated() { + return deprecated; + } + + public String getObsolete() { + return obsolete; + } + + public String getReplacement() { + return replacement; + } + + public String getState() { + return state; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DeprecationStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeprecationStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DeprecationStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DeprecationStatus(); + } + + public static class Builder { + private String deleted; + private String deprecated; + private String obsolete; + private String replacement; + private String state; + + Builder() {} + + public Builder mergeFrom(DeprecationStatus other) { + if (other == DeprecationStatus.getDefaultInstance()) return this; + if (other.getDeleted() != null) { + this.deleted = other.deleted; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getObsolete() != null) { + this.obsolete = other.obsolete; + } + if (other.getReplacement() != null) { + this.replacement = other.replacement; + } + if (other.getState() != null) { + this.state = other.state; + } + return this; + } + + Builder(DeprecationStatus source) { + this.deleted = source.deleted; + this.deprecated = source.deprecated; + this.obsolete = source.obsolete; + this.replacement = source.replacement; + this.state = source.state; + } + + public String getDeleted() { + return deleted; + } + + public Builder setDeleted(String deleted) { + this.deleted = deleted; + return this; + } + + public String getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(String deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getObsolete() { + return obsolete; + } + + public Builder setObsolete(String obsolete) { + this.obsolete = obsolete; + return this; + } + + public String getReplacement() { + return replacement; + } + + public Builder setReplacement(String replacement) { + this.replacement = replacement; + return this; + } + + public String getState() { + return state; + } + + public Builder setState(String state) { + this.state = state; + return this; + } + + + public DeprecationStatus build() { + + + + + return new DeprecationStatus( + deleted, + deprecated, + obsolete, + replacement, + state + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDeleted(this.deleted); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setObsolete(this.obsolete); + newBuilder.setReplacement(this.replacement); + newBuilder.setState(this.state); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeprecationStatus{" + + "deleted=" + deleted + ", " + + "deprecated=" + deprecated + ", " + + "obsolete=" + obsolete + ", " + + "replacement=" + replacement + ", " + + "state=" + state + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeprecationStatus) { + DeprecationStatus that = (DeprecationStatus) o; + return + Objects.equals(this.deleted, that.getDeleted()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.obsolete, that.getObsolete()) && + Objects.equals(this.replacement, that.getReplacement()) && + Objects.equals(this.state, that.getState()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + deleted, + deprecated, + obsolete, + replacement, + state + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java new file mode 100644 index 000000000000..8a41d48a8cba --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java @@ -0,0 +1,443 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DetachDiskInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String deviceName; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private DetachDiskInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.deviceName = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private DetachDiskInstanceHttpRequest( + String access_token, + String callback, + String deviceName, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.deviceName = deviceName; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deviceName") && deviceName != null) { + fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("deviceName")) { + return String.valueOf(deviceName); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDeviceName() { + return deviceName; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DetachDiskInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DetachDiskInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DetachDiskInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DetachDiskInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String deviceName; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DetachDiskInstanceHttpRequest other) { + if (other == DetachDiskInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDeviceName() != null) { + this.deviceName = other.deviceName; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DetachDiskInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.deviceName = source.deviceName; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDeviceName() { + return deviceName; + } + + public Builder setDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public DetachDiskInstanceHttpRequest build() { + String missing = ""; + + + if (deviceName == null) { + missing += " deviceName"; + } + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DetachDiskInstanceHttpRequest( + access_token, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDeviceName(this.deviceName); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DetachDiskInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "deviceName=" + deviceName + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DetachDiskInstanceHttpRequest) { + DetachDiskInstanceHttpRequest that = (DetachDiskInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.deviceName, that.getDeviceName()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java new file mode 100644 index 000000000000..caf2b6d61397 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java @@ -0,0 +1,900 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Disk implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final CustomerEncryptionKey diskEncryptionKey; + private final String id; + private final String kind; + private final String lastAttachTimestamp; + private final String lastDetachTimestamp; + private final List licenses; + private final String name; + private final String options; + private final String selfLink; + private final String sizeGb; + private final String sourceImage; + private final CustomerEncryptionKey sourceImageEncryptionKey; + private final String sourceImageId; + private final String sourceSnapshot; + private final CustomerEncryptionKey sourceSnapshotEncryptionKey; + private final String sourceSnapshotId; + private final String status; + private final String type; + private final List users; + private final String zone; + + private Disk() { + this.creationTimestamp = null; + this.description = null; + this.diskEncryptionKey = null; + this.id = null; + this.kind = null; + this.lastAttachTimestamp = null; + this.lastDetachTimestamp = null; + this.licenses = null; + this.name = null; + this.options = null; + this.selfLink = null; + this.sizeGb = null; + this.sourceImage = null; + this.sourceImageEncryptionKey = null; + this.sourceImageId = null; + this.sourceSnapshot = null; + this.sourceSnapshotEncryptionKey = null; + this.sourceSnapshotId = null; + this.status = null; + this.type = null; + this.users = null; + this.zone = null; + } + + + private Disk( + String creationTimestamp, + String description, + CustomerEncryptionKey diskEncryptionKey, + String id, + String kind, + String lastAttachTimestamp, + String lastDetachTimestamp, + List licenses, + String name, + String options, + String selfLink, + String sizeGb, + String sourceImage, + CustomerEncryptionKey sourceImageEncryptionKey, + String sourceImageId, + String sourceSnapshot, + CustomerEncryptionKey sourceSnapshotEncryptionKey, + String sourceSnapshotId, + String status, + String type, + List users, + String zone + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.diskEncryptionKey = diskEncryptionKey; + this.id = id; + this.kind = kind; + this.lastAttachTimestamp = lastAttachTimestamp; + this.lastDetachTimestamp = lastDetachTimestamp; + this.licenses = licenses; + this.name = name; + this.options = options; + this.selfLink = selfLink; + this.sizeGb = sizeGb; + this.sourceImage = sourceImage; + this.sourceImageEncryptionKey = sourceImageEncryptionKey; + this.sourceImageId = sourceImageId; + this.sourceSnapshot = sourceSnapshot; + this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey; + this.sourceSnapshotId = sourceSnapshotId; + this.status = status; + this.type = type; + this.users = users; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { + fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) { + fieldMap.put("lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); + } + if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) { + fieldMap.put("lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("options") && options != null) { + fieldMap.put("options", Collections.singletonList(String.valueOf(options))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sizeGb") && sizeGb != null) { + fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { + fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + } + if (fieldNames.contains("sourceImageId") && sourceImageId != null) { + fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); + } + if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) { + fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); + } + if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { + fieldMap.put("sourceSnapshotEncryptionKey", Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); + } + if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { + fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + if (fieldNames.contains("users") && users != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : users) { + stringList.add(item.toString()); + } + fieldMap.put("users", stringList.build()); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("diskEncryptionKey")) { + return String.valueOf(diskEncryptionKey); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("lastAttachTimestamp")) { + return String.valueOf(lastAttachTimestamp); + } + if (fieldName.equals("lastDetachTimestamp")) { + return String.valueOf(lastDetachTimestamp); + } + if (fieldName.equals("licenses")) { + return String.valueOf(licenses); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("options")) { + return String.valueOf(options); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sizeGb")) { + return String.valueOf(sizeGb); + } + if (fieldName.equals("sourceImage")) { + return String.valueOf(sourceImage); + } + if (fieldName.equals("sourceImageEncryptionKey")) { + return String.valueOf(sourceImageEncryptionKey); + } + if (fieldName.equals("sourceImageId")) { + return String.valueOf(sourceImageId); + } + if (fieldName.equals("sourceSnapshot")) { + return String.valueOf(sourceSnapshot); + } + if (fieldName.equals("sourceSnapshotEncryptionKey")) { + return String.valueOf(sourceSnapshotEncryptionKey); + } + if (fieldName.equals("sourceSnapshotId")) { + return String.valueOf(sourceSnapshotId); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } + if (fieldName.equals("users")) { + return String.valueOf(users); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public CustomerEncryptionKey getDiskEncryptionKey() { + return diskEncryptionKey; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getLastAttachTimestamp() { + return lastAttachTimestamp; + } + + public String getLastDetachTimestamp() { + return lastDetachTimestamp; + } + + public List getLicensesList() { + return licenses; + } + + public String getName() { + return name; + } + + public String getOptions() { + return options; + } + + public String getSelfLink() { + return selfLink; + } + + public String getSizeGb() { + return sizeGb; + } + + public String getSourceImage() { + return sourceImage; + } + + public CustomerEncryptionKey getSourceImageEncryptionKey() { + return sourceImageEncryptionKey; + } + + public String getSourceImageId() { + return sourceImageId; + } + + public String getSourceSnapshot() { + return sourceSnapshot; + } + + public CustomerEncryptionKey getSourceSnapshotEncryptionKey() { + return sourceSnapshotEncryptionKey; + } + + public String getSourceSnapshotId() { + return sourceSnapshotId; + } + + public String getStatus() { + return status; + } + + public String getType() { + return type; + } + + public List getUsersList() { + return users; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Disk prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Disk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Disk DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Disk(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private CustomerEncryptionKey diskEncryptionKey; + private String id; + private String kind; + private String lastAttachTimestamp; + private String lastDetachTimestamp; + private List licenses; + private String name; + private String options; + private String selfLink; + private String sizeGb; + private String sourceImage; + private CustomerEncryptionKey sourceImageEncryptionKey; + private String sourceImageId; + private String sourceSnapshot; + private CustomerEncryptionKey sourceSnapshotEncryptionKey; + private String sourceSnapshotId; + private String status; + private String type; + private List users; + private String zone; + + Builder() {} + + public Builder mergeFrom(Disk other) { + if (other == Disk.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDiskEncryptionKey() != null) { + this.diskEncryptionKey = other.diskEncryptionKey; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLastAttachTimestamp() != null) { + this.lastAttachTimestamp = other.lastAttachTimestamp; + } + if (other.getLastDetachTimestamp() != null) { + this.lastDetachTimestamp = other.lastDetachTimestamp; + } + if (other.getLicensesList() != null) { + this.licenses = other.licenses; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getOptions() != null) { + this.options = other.options; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSizeGb() != null) { + this.sizeGb = other.sizeGb; + } + if (other.getSourceImage() != null) { + this.sourceImage = other.sourceImage; + } + if (other.getSourceImageEncryptionKey() != null) { + this.sourceImageEncryptionKey = other.sourceImageEncryptionKey; + } + if (other.getSourceImageId() != null) { + this.sourceImageId = other.sourceImageId; + } + if (other.getSourceSnapshot() != null) { + this.sourceSnapshot = other.sourceSnapshot; + } + if (other.getSourceSnapshotEncryptionKey() != null) { + this.sourceSnapshotEncryptionKey = other.sourceSnapshotEncryptionKey; + } + if (other.getSourceSnapshotId() != null) { + this.sourceSnapshotId = other.sourceSnapshotId; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getType() != null) { + this.type = other.type; + } + if (other.getUsersList() != null) { + this.users = other.users; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(Disk source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.diskEncryptionKey = source.diskEncryptionKey; + this.id = source.id; + this.kind = source.kind; + this.lastAttachTimestamp = source.lastAttachTimestamp; + this.lastDetachTimestamp = source.lastDetachTimestamp; + this.licenses = source.licenses; + this.name = source.name; + this.options = source.options; + this.selfLink = source.selfLink; + this.sizeGb = source.sizeGb; + this.sourceImage = source.sourceImage; + this.sourceImageEncryptionKey = source.sourceImageEncryptionKey; + this.sourceImageId = source.sourceImageId; + this.sourceSnapshot = source.sourceSnapshot; + this.sourceSnapshotEncryptionKey = source.sourceSnapshotEncryptionKey; + this.sourceSnapshotId = source.sourceSnapshotId; + this.status = source.status; + this.type = source.type; + this.users = source.users; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public CustomerEncryptionKey getDiskEncryptionKey() { + return diskEncryptionKey; + } + + public Builder setDiskEncryptionKey(CustomerEncryptionKey diskEncryptionKey) { + this.diskEncryptionKey = diskEncryptionKey; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getLastAttachTimestamp() { + return lastAttachTimestamp; + } + + public Builder setLastAttachTimestamp(String lastAttachTimestamp) { + this.lastAttachTimestamp = lastAttachTimestamp; + return this; + } + + public String getLastDetachTimestamp() { + return lastDetachTimestamp; + } + + public Builder setLastDetachTimestamp(String lastDetachTimestamp) { + this.lastDetachTimestamp = lastDetachTimestamp; + return this; + } + + public List getLicensesList() { + return licenses; + } + + public Builder addAllLicenses(List licenses) { + if (this.licenses == null) { + this.licenses = new ArrayList<>(licenses.size()); + } + this.licenses.addAll(licenses); + return this; + } + + public Builder addLicenses(String licenses) { + this.licenses.add(licenses); + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getOptions() { + return options; + } + + public Builder setOptions(String options) { + this.options = options; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getSizeGb() { + return sizeGb; + } + + public Builder setSizeGb(String sizeGb) { + this.sizeGb = sizeGb; + return this; + } + + public String getSourceImage() { + return sourceImage; + } + + public Builder setSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + + public CustomerEncryptionKey getSourceImageEncryptionKey() { + return sourceImageEncryptionKey; + } + + public Builder setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncryptionKey) { + this.sourceImageEncryptionKey = sourceImageEncryptionKey; + return this; + } + + public String getSourceImageId() { + return sourceImageId; + } + + public Builder setSourceImageId(String sourceImageId) { + this.sourceImageId = sourceImageId; + return this; + } + + public String getSourceSnapshot() { + return sourceSnapshot; + } + + public Builder setSourceSnapshot(String sourceSnapshot) { + this.sourceSnapshot = sourceSnapshot; + return this; + } + + public CustomerEncryptionKey getSourceSnapshotEncryptionKey() { + return sourceSnapshotEncryptionKey; + } + + public Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey) { + this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey; + return this; + } + + public String getSourceSnapshotId() { + return sourceSnapshotId; + } + + public Builder setSourceSnapshotId(String sourceSnapshotId) { + this.sourceSnapshotId = sourceSnapshotId; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + public List getUsersList() { + return users; + } + + public Builder addAllUsers(List users) { + if (this.users == null) { + this.users = new ArrayList<>(users.size()); + } + this.users.addAll(users); + return this; + } + + public Builder addUsers(String users) { + this.users.add(users); + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public Disk build() { + + + + + + + + + + + + + + + + + + + + + + return new Disk( + creationTimestamp, + description, + diskEncryptionKey, + id, + kind, + lastAttachTimestamp, + lastDetachTimestamp, + licenses, + name, + options, + selfLink, + sizeGb, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + status, + type, + users, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setDiskEncryptionKey(this.diskEncryptionKey); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setLastAttachTimestamp(this.lastAttachTimestamp); + newBuilder.setLastDetachTimestamp(this.lastDetachTimestamp); + newBuilder.addAllLicenses(this.licenses); + newBuilder.setName(this.name); + newBuilder.setOptions(this.options); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSizeGb(this.sizeGb); + newBuilder.setSourceImage(this.sourceImage); + newBuilder.setSourceImageEncryptionKey(this.sourceImageEncryptionKey); + newBuilder.setSourceImageId(this.sourceImageId); + newBuilder.setSourceSnapshot(this.sourceSnapshot); + newBuilder.setSourceSnapshotEncryptionKey(this.sourceSnapshotEncryptionKey); + newBuilder.setSourceSnapshotId(this.sourceSnapshotId); + newBuilder.setStatus(this.status); + newBuilder.setType(this.type); + newBuilder.addAllUsers(this.users); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "Disk{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "diskEncryptionKey=" + diskEncryptionKey + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "lastAttachTimestamp=" + lastAttachTimestamp + ", " + + "lastDetachTimestamp=" + lastDetachTimestamp + ", " + + "licenses=" + licenses + ", " + + "name=" + name + ", " + + "options=" + options + ", " + + "selfLink=" + selfLink + ", " + + "sizeGb=" + sizeGb + ", " + + "sourceImage=" + sourceImage + ", " + + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + ", " + + "sourceImageId=" + sourceImageId + ", " + + "sourceSnapshot=" + sourceSnapshot + ", " + + "sourceSnapshotEncryptionKey=" + sourceSnapshotEncryptionKey + ", " + + "sourceSnapshotId=" + sourceSnapshotId + ", " + + "status=" + status + ", " + + "type=" + type + ", " + + "users=" + users + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Disk) { + Disk that = (Disk) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp()) && + Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp()) && + Objects.equals(this.licenses, that.getLicensesList()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.options, that.getOptions()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sizeGb, that.getSizeGb()) && + Objects.equals(this.sourceImage, that.getSourceImage()) && + Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) && + Objects.equals(this.sourceImageId, that.getSourceImageId()) && + Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) && + Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) && + Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.type, that.getType()) && + Objects.equals(this.users, that.getUsersList()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + diskEncryptionKey, + id, + kind, + lastAttachTimestamp, + lastDetachTimestamp, + licenses, + name, + options, + selfLink, + sizeGb, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + status, + type, + users, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java new file mode 100644 index 000000000000..8e1cb2f50345 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private DiskAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private DiskAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(DiskAggregatedList other) { + if (other == DiskAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(DiskAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public DiskAggregatedList build() { + + + + + return new DiskAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskAggregatedList) { + DiskAggregatedList that = (DiskAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java new file mode 100644 index 000000000000..bff396e94b59 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.DiskStub; +import com.google.cloud.compute.v1.stub.DiskStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (DiskClient diskClient = DiskClient.create()) {
+ *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+ *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+ *   Operation response = diskClient.createSnapshotDisk(disk, snapshotResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the diskClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of DiskSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * DiskSettings diskSettings =
+ *     DiskSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DiskClient diskClient =
+ *     DiskClient.create(diskSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * DiskSettings diskSettings =
+ *     DiskSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DiskClient diskClient =
+ *     DiskClient.create(diskSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class DiskClient implements BackgroundResource { + private final DiskSettings settings; + private final DiskStub stub; + + + + /** + * Constructs an instance of DiskClient with default settings. + */ + public static final DiskClient create() throws IOException { + return create(DiskSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DiskClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final DiskClient create(DiskSettings settings) throws IOException { + return new DiskClient(settings); + } + + /** + * Constructs an instance of DiskClient, using the given stub for making calls. This is for + * advanced usage - prefer to use DiskSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DiskClient create(DiskStub stub) { + return new DiskClient(stub); + } + + /** + * Constructs an instance of DiskClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected DiskClient(DiskSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DiskStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected DiskClient(DiskStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DiskSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DiskStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of persistent disks. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (DisksScopedList element : diskClient.aggregatedListDisks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListDisksPagedResponse aggregatedListDisks(ProjectName project) { + AggregatedListDisksHttpRequest request = + AggregatedListDisksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListDisks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of persistent disks. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (DisksScopedList element : diskClient.aggregatedListDisks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListDisksPagedResponse aggregatedListDisks(String project) { + AggregatedListDisksHttpRequest request = + AggregatedListDisksHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListDisks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of persistent disks. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListDisksHttpRequest request = AggregatedListDisksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (DisksScopedList element : diskClient.aggregatedListDisks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListDisksPagedResponse aggregatedListDisks(AggregatedListDisksHttpRequest request) { + return aggregatedListDisksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of persistent disks. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListDisksHttpRequest request = AggregatedListDisksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListDisksPagedResponse> future = diskClient.aggregatedListDisksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (DisksScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListDisksPagedCallable() { + return stub.aggregatedListDisksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of persistent disks. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListDisksHttpRequest request = AggregatedListDisksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     DiskAggregatedList response = diskClient.aggregatedListDisksCallable().call(request);
+   *     for (DisksScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListDisksCallable() { + return stub.aggregatedListDisksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of a specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   Operation response = diskClient.createSnapshotDisk(disk, snapshotResource);
+   * }
+   * 
+ * + * @param disk Name of the persistent disk to snapshot. + * @param snapshotResource A persistent disk snapshot resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation createSnapshotDisk(DiskName disk, Snapshot snapshotResource) { + + CreateSnapshotDiskHttpRequest request = + CreateSnapshotDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .setSnapshotResource(snapshotResource) + .build(); + return createSnapshotDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of a specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   Operation response = diskClient.createSnapshotDisk(disk.toString(), snapshotResource);
+   * }
+   * 
+ * + * @param disk Name of the persistent disk to snapshot. + * @param snapshotResource A persistent disk snapshot resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation createSnapshotDisk(String disk, Snapshot snapshotResource) { + + CreateSnapshotDiskHttpRequest request = + CreateSnapshotDiskHttpRequest.newBuilder() + .setDisk(disk) + .setSnapshotResource(snapshotResource) + .build(); + return createSnapshotDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of a specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setSnapshotResource(snapshotResource)
+   *     .build();
+   *   Operation response = diskClient.createSnapshotDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request) { + return createSnapshotDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of a specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setSnapshotResource(snapshotResource)
+   *     .build();
+   *   ApiFuture<Operation> future = diskClient.createSnapshotDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable createSnapshotDiskCallable() { + return stub.createSnapshotDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Operation response = diskClient.deleteDisk(disk);
+   * }
+   * 
+ * + * @param disk Name of the persistent disk to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteDisk(DiskName disk) { + + DeleteDiskHttpRequest request = + DeleteDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .build(); + return deleteDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Operation response = diskClient.deleteDisk(disk.toString());
+   * }
+   * 
+ * + * @param disk Name of the persistent disk to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteDisk(String disk) { + + DeleteDiskHttpRequest request = + DeleteDiskHttpRequest.newBuilder() + .setDisk(disk) + .build(); + return deleteDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .build();
+   *   Operation response = diskClient.deleteDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteDisk(DeleteDiskHttpRequest request) { + return deleteDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = diskClient.deleteDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteDiskCallable() { + return stub.deleteDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Disk response = diskClient.getDisk(disk);
+   * }
+   * 
+ * + * @param disk Name of the persistent disk to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Disk getDisk(DiskName disk) { + + GetDiskHttpRequest request = + GetDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .build(); + return getDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   Disk response = diskClient.getDisk(disk.toString());
+   * }
+   * 
+ * + * @param disk Name of the persistent disk to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Disk getDisk(String disk) { + + GetDiskHttpRequest request = + GetDiskHttpRequest.newBuilder() + .setDisk(disk) + .build(); + return getDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   GetDiskHttpRequest request = GetDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .build();
+   *   Disk response = diskClient.getDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Disk getDisk(GetDiskHttpRequest request) { + return getDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   GetDiskHttpRequest request = GetDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .build();
+   *   ApiFuture<Disk> future = diskClient.getDiskCallable().futureCall(request);
+   *   // Do something
+   *   Disk response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getDiskCallable() { + return stub.getDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String sourceImage = "";
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   Operation response = diskClient.insertDisk(zone, sourceImage, diskResource);
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @param sourceImage Optional. Source image to restore onto a disk. + * @param diskResource A Disk resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertDisk(ZoneName zone, String sourceImage, Disk diskResource) { + + InsertDiskHttpRequest request = + InsertDiskHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .setSourceImage(sourceImage) + .setDiskResource(diskResource) + .build(); + return insertDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String sourceImage = "";
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   Operation response = diskClient.insertDisk(zone.toString(), sourceImage, diskResource);
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @param sourceImage Optional. Source image to restore onto a disk. + * @param diskResource A Disk resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertDisk(String zone, String sourceImage, Disk diskResource) { + + InsertDiskHttpRequest request = + InsertDiskHttpRequest.newBuilder() + .setZone(zone) + .setSourceImage(sourceImage) + .setDiskResource(diskResource) + .build(); + return insertDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String sourceImage = "";
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setSourceImage(sourceImage)
+   *     .setDiskResource(diskResource)
+   *     .build();
+   *   Operation response = diskClient.insertDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertDisk(InsertDiskHttpRequest request) { + return insertDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String sourceImage = "";
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setSourceImage(sourceImage)
+   *     .setDiskResource(diskResource)
+   *     .build();
+   *   ApiFuture<Operation> future = diskClient.insertDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertDiskCallable() { + return stub.insertDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Disk element : diskClient.listDisks(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListDisksPagedResponse listDisks(ZoneName zone) { + ListDisksHttpRequest request = + ListDisksHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listDisks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Disk element : diskClient.listDisks(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListDisksPagedResponse listDisks(String zone) { + ListDisksHttpRequest request = + ListDisksHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listDisks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (Disk element : diskClient.listDisks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListDisksPagedResponse listDisks(ListDisksHttpRequest request) { + return listDisksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListDisksPagedResponse> future = diskClient.listDisksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Disk element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listDisksPagedCallable() { + return stub.listDisksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     DiskList response = diskClient.listDisksCallable().call(request);
+   *     for (Disk element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listDisksCallable() { + return stub.listDisksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
+   *   Operation response = diskClient.resizeDisk(disk, disksResizeRequestResource);
+   * }
+   * 
+ * + * @param disk The name of the persistent disk. + * @param disksResizeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeDisk(DiskName disk, DisksResizeRequest disksResizeRequestResource) { + + ResizeDiskHttpRequest request = + ResizeDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .setDisksResizeRequestResource(disksResizeRequestResource) + .build(); + return resizeDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
+   *   Operation response = diskClient.resizeDisk(disk.toString(), disksResizeRequestResource);
+   * }
+   * 
+ * + * @param disk The name of the persistent disk. + * @param disksResizeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeDisk(String disk, DisksResizeRequest disksResizeRequestResource) { + + ResizeDiskHttpRequest request = + ResizeDiskHttpRequest.newBuilder() + .setDisk(disk) + .setDisksResizeRequestResource(disksResizeRequestResource) + .build(); + return resizeDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
+   *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setDisksResizeRequestResource(disksResizeRequestResource)
+   *     .build();
+   *   Operation response = diskClient.resizeDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeDisk(ResizeDiskHttpRequest request) { + return resizeDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified persistent disk. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
+   *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setDisksResizeRequestResource(disksResizeRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = diskClient.resizeDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable resizeDiskCallable() { + return stub.resizeDiskCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListDisksPagedResponse extends AbstractPagedListResponse< + AggregatedListDisksHttpRequest, + DiskAggregatedList, + DisksScopedList, + AggregatedListDisksPage, + AggregatedListDisksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListDisksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListDisksPagedResponse apply(AggregatedListDisksPage input) { + return new AggregatedListDisksPagedResponse(input); + } + }); + } + + private AggregatedListDisksPagedResponse(AggregatedListDisksPage page) { + super(page, AggregatedListDisksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListDisksPage extends AbstractPage< + AggregatedListDisksHttpRequest, + DiskAggregatedList, + DisksScopedList, + AggregatedListDisksPage> { + + private AggregatedListDisksPage( + PageContext context, + DiskAggregatedList response) { + super(context, response); + } + + private static AggregatedListDisksPage createEmptyPage() { + return new AggregatedListDisksPage(null, null); + } + + @Override + protected AggregatedListDisksPage createPage( + PageContext context, + DiskAggregatedList response) { + return new AggregatedListDisksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListDisksFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListDisksHttpRequest, + DiskAggregatedList, + DisksScopedList, + AggregatedListDisksPage, + AggregatedListDisksFixedSizeCollection> { + + private AggregatedListDisksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListDisksFixedSizeCollection createEmptyCollection() { + return new AggregatedListDisksFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListDisksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListDisksFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListDisksPagedResponse extends AbstractPagedListResponse< + ListDisksHttpRequest, + DiskList, + Disk, + ListDisksPage, + ListDisksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDisksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListDisksPagedResponse apply(ListDisksPage input) { + return new ListDisksPagedResponse(input); + } + }); + } + + private ListDisksPagedResponse(ListDisksPage page) { + super(page, ListDisksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListDisksPage extends AbstractPage< + ListDisksHttpRequest, + DiskList, + Disk, + ListDisksPage> { + + private ListDisksPage( + PageContext context, + DiskList response) { + super(context, response); + } + + private static ListDisksPage createEmptyPage() { + return new ListDisksPage(null, null); + } + + @Override + protected ListDisksPage createPage( + PageContext context, + DiskList response) { + return new ListDisksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListDisksFixedSizeCollection extends AbstractFixedSizeCollection< + ListDisksHttpRequest, + DiskList, + Disk, + ListDisksPage, + ListDisksFixedSizeCollection> { + + private ListDisksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDisksFixedSizeCollection createEmptyCollection() { + return new ListDisksFixedSizeCollection(null, 0); + } + + @Override + protected ListDisksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDisksFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java new file mode 100644 index 000000000000..6d9de2bcd192 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private DiskList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private DiskList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Disk item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(DiskList other) { + if (other == DiskList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(DiskList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Disk items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public DiskList build() { + + + + + return new DiskList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskList) { + DiskList that = (DiskList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java new file mode 100644 index 000000000000..6bc5ed24ffa2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskMoveRequest implements ApiMessage { + private final String destinationZone; + private final String targetDisk; + + private DiskMoveRequest() { + this.destinationZone = null; + this.targetDisk = null; + } + + + private DiskMoveRequest( + String destinationZone, + String targetDisk + ) { + this.destinationZone = destinationZone; + this.targetDisk = targetDisk; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("destinationZone") && destinationZone != null) { + fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone))); + } + if (fieldNames.contains("targetDisk") && targetDisk != null) { + fieldMap.put("targetDisk", Collections.singletonList(String.valueOf(targetDisk))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("destinationZone")) { + return String.valueOf(destinationZone); + } + if (fieldName.equals("targetDisk")) { + return String.valueOf(targetDisk); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDestinationZone() { + return destinationZone; + } + + public String getTargetDisk() { + return targetDisk; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskMoveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskMoveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskMoveRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskMoveRequest(); + } + + public static class Builder { + private String destinationZone; + private String targetDisk; + + Builder() {} + + public Builder mergeFrom(DiskMoveRequest other) { + if (other == DiskMoveRequest.getDefaultInstance()) return this; + if (other.getDestinationZone() != null) { + this.destinationZone = other.destinationZone; + } + if (other.getTargetDisk() != null) { + this.targetDisk = other.targetDisk; + } + return this; + } + + Builder(DiskMoveRequest source) { + this.destinationZone = source.destinationZone; + this.targetDisk = source.targetDisk; + } + + public String getDestinationZone() { + return destinationZone; + } + + public Builder setDestinationZone(String destinationZone) { + this.destinationZone = destinationZone; + return this; + } + + public String getTargetDisk() { + return targetDisk; + } + + public Builder setTargetDisk(String targetDisk) { + this.targetDisk = targetDisk; + return this; + } + + + public DiskMoveRequest build() { + + return new DiskMoveRequest( + destinationZone, + targetDisk + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDestinationZone(this.destinationZone); + newBuilder.setTargetDisk(this.targetDisk); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskMoveRequest{" + + "destinationZone=" + destinationZone + ", " + + "targetDisk=" + targetDisk + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskMoveRequest) { + DiskMoveRequest that = (DiskMoveRequest) o; + return + Objects.equals(this.destinationZone, that.getDestinationZone()) && + Objects.equals(this.targetDisk, that.getTargetDisk()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + destinationZone, + targetDisk + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java new file mode 100644 index 000000000000..2c9228548abf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class DiskName implements ResourceName { + private final String disk; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{disk}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DiskName(Builder builder) { + disk = Preconditions.checkNotNull(builder.getDisk()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static DiskName of( + String disk, + String project, + String zone + ) { + return newBuilder() + .setDisk(disk) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String disk, + String project, + String zone + ) { + return of( + disk, + project, + zone + ) + .toString(); + } + + public String getDisk() { + return disk; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("disk", disk); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public DiskName parse(String formattedString) {return DiskName.parse(formattedString);} + }; + } + + public static DiskName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "DiskName.parse: formattedString not in valid format"); + return of( + matchMap.get("disk"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String disk; + private String project; + private String zone; + + public String getDisk() { + return disk; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (DiskName diskName) { + disk = diskName.disk; + project = diskName.project; + zone = diskName.zone; + } + + public DiskName build() { + return new DiskName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "disk", disk, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskName) { + DiskName that = (DiskName) o; + return + Objects.equals(this.disk, that.getDisk()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + disk, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java new file mode 100644 index 000000000000..cb7227662453 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java @@ -0,0 +1,311 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import com.google.cloud.compute.v1.stub.DiskStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link DiskClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of createSnapshotDisk to 30 seconds: + * + *

+ * 
+ * DiskSettings.Builder diskSettingsBuilder =
+ *     DiskSettings.newBuilder();
+ * diskSettingsBuilder.createSnapshotDiskSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * DiskSettings diskSettings = diskSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class DiskSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListDisks. + */ + public PagedCallSettings aggregatedListDisksSettings() { + return ((DiskStubSettings) getStubSettings()).aggregatedListDisksSettings(); + } + + /** + * Returns the object with the settings used for calls to createSnapshotDisk. + */ + public UnaryCallSettings createSnapshotDiskSettings() { + return ((DiskStubSettings) getStubSettings()).createSnapshotDiskSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteDisk. + */ + public UnaryCallSettings deleteDiskSettings() { + return ((DiskStubSettings) getStubSettings()).deleteDiskSettings(); + } + + /** + * Returns the object with the settings used for calls to getDisk. + */ + public UnaryCallSettings getDiskSettings() { + return ((DiskStubSettings) getStubSettings()).getDiskSettings(); + } + + /** + * Returns the object with the settings used for calls to insertDisk. + */ + public UnaryCallSettings insertDiskSettings() { + return ((DiskStubSettings) getStubSettings()).insertDiskSettings(); + } + + /** + * Returns the object with the settings used for calls to listDisks. + */ + public PagedCallSettings listDisksSettings() { + return ((DiskStubSettings) getStubSettings()).listDisksSettings(); + } + + /** + * Returns the object with the settings used for calls to resizeDisk. + */ + public UnaryCallSettings resizeDiskSettings() { + return ((DiskStubSettings) getStubSettings()).resizeDiskSettings(); + } + + + public static final DiskSettings create(DiskStubSettings stub) throws IOException { + return new DiskSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DiskStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return DiskStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return DiskStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DiskStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DiskStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return DiskStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DiskStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DiskStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DiskSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for DiskSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(DiskStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(DiskStubSettings.newBuilder()); + } + + protected Builder(DiskSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DiskStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public DiskStubSettings.Builder getStubSettingsBuilder() { + return ((DiskStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListDisks. + */ + public PagedCallSettings.Builder aggregatedListDisksSettings() { + return getStubSettingsBuilder().aggregatedListDisksSettings(); + } + + /** + * Returns the builder for the settings used for calls to createSnapshotDisk. + */ + public UnaryCallSettings.Builder createSnapshotDiskSettings() { + return getStubSettingsBuilder().createSnapshotDiskSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteDisk. + */ + public UnaryCallSettings.Builder deleteDiskSettings() { + return getStubSettingsBuilder().deleteDiskSettings(); + } + + /** + * Returns the builder for the settings used for calls to getDisk. + */ + public UnaryCallSettings.Builder getDiskSettings() { + return getStubSettingsBuilder().getDiskSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertDisk. + */ + public UnaryCallSettings.Builder insertDiskSettings() { + return getStubSettingsBuilder().insertDiskSettings(); + } + + /** + * Returns the builder for the settings used for calls to listDisks. + */ + public PagedCallSettings.Builder listDisksSettings() { + return getStubSettingsBuilder().listDisksSettings(); + } + + /** + * Returns the builder for the settings used for calls to resizeDisk. + */ + public UnaryCallSettings.Builder resizeDiskSettings() { + return getStubSettingsBuilder().resizeDiskSettings(); + } + + @Override + public DiskSettings build() throws IOException { + return new DiskSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java new file mode 100644 index 000000000000..9dc9879cf632 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java @@ -0,0 +1,468 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskType implements ApiMessage { + private final String creationTimestamp; + private final String defaultDiskSizeGb; + private final DeprecationStatus deprecated; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String selfLink; + private final String validDiskSize; + private final String zone; + + private DiskType() { + this.creationTimestamp = null; + this.defaultDiskSizeGb = null; + this.deprecated = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.selfLink = null; + this.validDiskSize = null; + this.zone = null; + } + + + private DiskType( + String creationTimestamp, + String defaultDiskSizeGb, + DeprecationStatus deprecated, + String description, + String id, + String kind, + String name, + String selfLink, + String validDiskSize, + String zone + ) { + this.creationTimestamp = creationTimestamp; + this.defaultDiskSizeGb = defaultDiskSizeGb; + this.deprecated = deprecated; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + this.validDiskSize = validDiskSize; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("defaultDiskSizeGb") && defaultDiskSizeGb != null) { + fieldMap.put("defaultDiskSizeGb", Collections.singletonList(String.valueOf(defaultDiskSizeGb))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("validDiskSize") && validDiskSize != null) { + fieldMap.put("validDiskSize", Collections.singletonList(String.valueOf(validDiskSize))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("defaultDiskSizeGb")) { + return String.valueOf(defaultDiskSizeGb); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("validDiskSize")) { + return String.valueOf(validDiskSize); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDefaultDiskSizeGb() { + return defaultDiskSizeGb; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public String getValidDiskSize() { + return validDiskSize; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskType(); + } + + public static class Builder { + private String creationTimestamp; + private String defaultDiskSizeGb; + private DeprecationStatus deprecated; + private String description; + private String id; + private String kind; + private String name; + private String selfLink; + private String validDiskSize; + private String zone; + + Builder() {} + + public Builder mergeFrom(DiskType other) { + if (other == DiskType.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDefaultDiskSizeGb() != null) { + this.defaultDiskSizeGb = other.defaultDiskSizeGb; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getValidDiskSize() != null) { + this.validDiskSize = other.validDiskSize; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(DiskType source) { + this.creationTimestamp = source.creationTimestamp; + this.defaultDiskSizeGb = source.defaultDiskSizeGb; + this.deprecated = source.deprecated; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + this.validDiskSize = source.validDiskSize; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDefaultDiskSizeGb() { + return defaultDiskSizeGb; + } + + public Builder setDefaultDiskSizeGb(String defaultDiskSizeGb) { + this.defaultDiskSizeGb = defaultDiskSizeGb; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getValidDiskSize() { + return validDiskSize; + } + + public Builder setValidDiskSize(String validDiskSize) { + this.validDiskSize = validDiskSize; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public DiskType build() { + + + + + + + + + + return new DiskType( + creationTimestamp, + defaultDiskSizeGb, + deprecated, + description, + id, + kind, + name, + selfLink, + validDiskSize, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDefaultDiskSizeGb(this.defaultDiskSizeGb); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setValidDiskSize(this.validDiskSize); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskType{" + + "creationTimestamp=" + creationTimestamp + ", " + + "defaultDiskSizeGb=" + defaultDiskSizeGb + ", " + + "deprecated=" + deprecated + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "validDiskSize=" + validDiskSize + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskType) { + DiskType that = (DiskType) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.defaultDiskSizeGb, that.getDefaultDiskSizeGb()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.validDiskSize, that.getValidDiskSize()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + defaultDiskSizeGb, + deprecated, + description, + id, + kind, + name, + selfLink, + validDiskSize, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java new file mode 100644 index 000000000000..444239dd6785 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskTypeAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private DiskTypeAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private DiskTypeAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskTypeAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskTypeAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskTypeAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskTypeAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(DiskTypeAggregatedList other) { + if (other == DiskTypeAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(DiskTypeAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public DiskTypeAggregatedList build() { + + + + + return new DiskTypeAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskTypeAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskTypeAggregatedList) { + DiskTypeAggregatedList that = (DiskTypeAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java new file mode 100644 index 000000000000..da3a6b973f97 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java @@ -0,0 +1,736 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.DiskTypeStub; +import com.google.cloud.compute.v1.stub.DiskTypeStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+ *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+ *   DiskType response = diskTypeClient.getDiskType(diskType);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the diskTypeClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of DiskTypeSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * DiskTypeSettings diskTypeSettings =
+ *     DiskTypeSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DiskTypeClient diskTypeClient =
+ *     DiskTypeClient.create(diskTypeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * DiskTypeSettings diskTypeSettings =
+ *     DiskTypeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DiskTypeClient diskTypeClient =
+ *     DiskTypeClient.create(diskTypeSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class DiskTypeClient implements BackgroundResource { + private final DiskTypeSettings settings; + private final DiskTypeStub stub; + + + + /** + * Constructs an instance of DiskTypeClient with default settings. + */ + public static final DiskTypeClient create() throws IOException { + return create(DiskTypeSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DiskTypeClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final DiskTypeClient create(DiskTypeSettings settings) throws IOException { + return new DiskTypeClient(settings); + } + + /** + * Constructs an instance of DiskTypeClient, using the given stub for making calls. This is for + * advanced usage - prefer to use DiskTypeSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DiskTypeClient create(DiskTypeStub stub) { + return new DiskTypeClient(stub); + } + + /** + * Constructs an instance of DiskTypeClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected DiskTypeClient(DiskTypeSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DiskTypeStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected DiskTypeClient(DiskTypeStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DiskTypeSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DiskTypeStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of disk types. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (DiskTypesScopedList element : diskTypeClient.aggregatedListDiskTypes(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(ProjectName project) { + AggregatedListDiskTypesHttpRequest request = + AggregatedListDiskTypesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListDiskTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of disk types. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (DiskTypesScopedList element : diskTypeClient.aggregatedListDiskTypes(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(String project) { + AggregatedListDiskTypesHttpRequest request = + AggregatedListDiskTypesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListDiskTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of disk types. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListDiskTypesHttpRequest request = AggregatedListDiskTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (DiskTypesScopedList element : diskTypeClient.aggregatedListDiskTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(AggregatedListDiskTypesHttpRequest request) { + return aggregatedListDiskTypesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of disk types. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListDiskTypesHttpRequest request = AggregatedListDiskTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListDiskTypesPagedResponse> future = diskTypeClient.aggregatedListDiskTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (DiskTypesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListDiskTypesPagedCallable() { + return stub.aggregatedListDiskTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of disk types. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListDiskTypesHttpRequest request = AggregatedListDiskTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     DiskTypeAggregatedList response = diskTypeClient.aggregatedListDiskTypesCallable().call(request);
+   *     for (DiskTypesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListDiskTypesCallable() { + return stub.aggregatedListDiskTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified disk type. Get a list of available disk types by making a list() request. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   DiskType response = diskTypeClient.getDiskType(diskType);
+   * }
+   * 
+ * + * @param diskType Name of the disk type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final DiskType getDiskType(DiskTypeName diskType) { + + GetDiskTypeHttpRequest request = + GetDiskTypeHttpRequest.newBuilder() + .setDiskType(diskType == null ? null : diskType.toString()) + .build(); + return getDiskType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified disk type. Get a list of available disk types by making a list() request. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   DiskType response = diskTypeClient.getDiskType(diskType.toString());
+   * }
+   * 
+ * + * @param diskType Name of the disk type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final DiskType getDiskType(String diskType) { + + GetDiskTypeHttpRequest request = + GetDiskTypeHttpRequest.newBuilder() + .setDiskType(diskType) + .build(); + return getDiskType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified disk type. Get a list of available disk types by making a list() request. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   GetDiskTypeHttpRequest request = GetDiskTypeHttpRequest.newBuilder()
+   *     .setDiskType(diskType.toString())
+   *     .build();
+   *   DiskType response = diskTypeClient.getDiskType(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final DiskType getDiskType(GetDiskTypeHttpRequest request) { + return getDiskTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified disk type. Get a list of available disk types by making a list() request. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   GetDiskTypeHttpRequest request = GetDiskTypeHttpRequest.newBuilder()
+   *     .setDiskType(diskType.toString())
+   *     .build();
+   *   ApiFuture<DiskType> future = diskTypeClient.getDiskTypeCallable().futureCall(request);
+   *   // Do something
+   *   DiskType response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getDiskTypeCallable() { + return stub.getDiskTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of disk types available to the specified project. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (DiskType element : diskTypeClient.listDiskTypes(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListDiskTypesPagedResponse listDiskTypes(ZoneName zone) { + ListDiskTypesHttpRequest request = + ListDiskTypesHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listDiskTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of disk types available to the specified project. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (DiskType element : diskTypeClient.listDiskTypes(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListDiskTypesPagedResponse listDiskTypes(String zone) { + ListDiskTypesHttpRequest request = + ListDiskTypesHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listDiskTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of disk types available to the specified project. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (DiskType element : diskTypeClient.listDiskTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListDiskTypesPagedResponse listDiskTypes(ListDiskTypesHttpRequest request) { + return listDiskTypesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of disk types available to the specified project. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListDiskTypesPagedResponse> future = diskTypeClient.listDiskTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (DiskType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listDiskTypesPagedCallable() { + return stub.listDiskTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of disk types available to the specified project. + * + * Sample code: + *

+   * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     DiskTypeList response = diskTypeClient.listDiskTypesCallable().call(request);
+   *     for (DiskType element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listDiskTypesCallable() { + return stub.listDiskTypesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListDiskTypesPagedResponse extends AbstractPagedListResponse< + AggregatedListDiskTypesHttpRequest, + DiskTypeAggregatedList, + DiskTypesScopedList, + AggregatedListDiskTypesPage, + AggregatedListDiskTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListDiskTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListDiskTypesPagedResponse apply(AggregatedListDiskTypesPage input) { + return new AggregatedListDiskTypesPagedResponse(input); + } + }); + } + + private AggregatedListDiskTypesPagedResponse(AggregatedListDiskTypesPage page) { + super(page, AggregatedListDiskTypesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListDiskTypesPage extends AbstractPage< + AggregatedListDiskTypesHttpRequest, + DiskTypeAggregatedList, + DiskTypesScopedList, + AggregatedListDiskTypesPage> { + + private AggregatedListDiskTypesPage( + PageContext context, + DiskTypeAggregatedList response) { + super(context, response); + } + + private static AggregatedListDiskTypesPage createEmptyPage() { + return new AggregatedListDiskTypesPage(null, null); + } + + @Override + protected AggregatedListDiskTypesPage createPage( + PageContext context, + DiskTypeAggregatedList response) { + return new AggregatedListDiskTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListDiskTypesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListDiskTypesHttpRequest, + DiskTypeAggregatedList, + DiskTypesScopedList, + AggregatedListDiskTypesPage, + AggregatedListDiskTypesFixedSizeCollection> { + + private AggregatedListDiskTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListDiskTypesFixedSizeCollection createEmptyCollection() { + return new AggregatedListDiskTypesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListDiskTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListDiskTypesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListDiskTypesPagedResponse extends AbstractPagedListResponse< + ListDiskTypesHttpRequest, + DiskTypeList, + DiskType, + ListDiskTypesPage, + ListDiskTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDiskTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListDiskTypesPagedResponse apply(ListDiskTypesPage input) { + return new ListDiskTypesPagedResponse(input); + } + }); + } + + private ListDiskTypesPagedResponse(ListDiskTypesPage page) { + super(page, ListDiskTypesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListDiskTypesPage extends AbstractPage< + ListDiskTypesHttpRequest, + DiskTypeList, + DiskType, + ListDiskTypesPage> { + + private ListDiskTypesPage( + PageContext context, + DiskTypeList response) { + super(context, response); + } + + private static ListDiskTypesPage createEmptyPage() { + return new ListDiskTypesPage(null, null); + } + + @Override + protected ListDiskTypesPage createPage( + PageContext context, + DiskTypeList response) { + return new ListDiskTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListDiskTypesFixedSizeCollection extends AbstractFixedSizeCollection< + ListDiskTypesHttpRequest, + DiskTypeList, + DiskType, + ListDiskTypesPage, + ListDiskTypesFixedSizeCollection> { + + private ListDiskTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDiskTypesFixedSizeCollection createEmptyCollection() { + return new ListDiskTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListDiskTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDiskTypesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java new file mode 100644 index 000000000000..03b078e1d3dd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskTypeList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private DiskTypeList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private DiskTypeList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (DiskType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskTypeList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskTypeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskTypeList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskTypeList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(DiskTypeList other) { + if (other == DiskTypeList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(DiskTypeList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(DiskType items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public DiskTypeList build() { + + + + + return new DiskTypeList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskTypeList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskTypeList) { + DiskTypeList that = (DiskTypeList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java new file mode 100644 index 000000000000..e1233580ce8b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class DiskTypeName implements ResourceName { + private final String diskType; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/diskTypes/{diskType}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DiskTypeName(Builder builder) { + diskType = Preconditions.checkNotNull(builder.getDiskType()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static DiskTypeName of( + String diskType, + String project, + String zone + ) { + return newBuilder() + .setDiskType(diskType) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String diskType, + String project, + String zone + ) { + return of( + diskType, + project, + zone + ) + .toString(); + } + + public String getDiskType() { + return diskType; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("diskType", diskType); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public DiskTypeName parse(String formattedString) {return DiskTypeName.parse(formattedString);} + }; + } + + public static DiskTypeName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "DiskTypeName.parse: formattedString not in valid format"); + return of( + matchMap.get("diskType"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String diskType; + private String project; + private String zone; + + public String getDiskType() { + return diskType; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setDiskType(String diskType) { + this.diskType = diskType; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (DiskTypeName diskTypeName) { + diskType = diskTypeName.diskType; + project = diskTypeName.project; + zone = diskTypeName.zone; + } + + public DiskTypeName build() { + return new DiskTypeName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "diskType", diskType, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskTypeName) { + DiskTypeName that = (DiskTypeName) o; + return + Objects.equals(this.diskType, that.getDiskType()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + diskType, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java new file mode 100644 index 000000000000..1a121be13fbf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java @@ -0,0 +1,255 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.stub.DiskTypeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link DiskTypeClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getDiskType to 30 seconds: + * + *

+ * 
+ * DiskTypeSettings.Builder diskTypeSettingsBuilder =
+ *     DiskTypeSettings.newBuilder();
+ * diskTypeSettingsBuilder.getDiskTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * DiskTypeSettings diskTypeSettings = diskTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class DiskTypeSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListDiskTypes. + */ + public PagedCallSettings aggregatedListDiskTypesSettings() { + return ((DiskTypeStubSettings) getStubSettings()).aggregatedListDiskTypesSettings(); + } + + /** + * Returns the object with the settings used for calls to getDiskType. + */ + public UnaryCallSettings getDiskTypeSettings() { + return ((DiskTypeStubSettings) getStubSettings()).getDiskTypeSettings(); + } + + /** + * Returns the object with the settings used for calls to listDiskTypes. + */ + public PagedCallSettings listDiskTypesSettings() { + return ((DiskTypeStubSettings) getStubSettings()).listDiskTypesSettings(); + } + + + public static final DiskTypeSettings create(DiskTypeStubSettings stub) throws IOException { + return new DiskTypeSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DiskTypeStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return DiskTypeStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return DiskTypeStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DiskTypeStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DiskTypeStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return DiskTypeStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DiskTypeStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DiskTypeStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DiskTypeSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for DiskTypeSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(DiskTypeStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(DiskTypeStubSettings.newBuilder()); + } + + protected Builder(DiskTypeSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DiskTypeStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public DiskTypeStubSettings.Builder getStubSettingsBuilder() { + return ((DiskTypeStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListDiskTypes. + */ + public PagedCallSettings.Builder aggregatedListDiskTypesSettings() { + return getStubSettingsBuilder().aggregatedListDiskTypesSettings(); + } + + /** + * Returns the builder for the settings used for calls to getDiskType. + */ + public UnaryCallSettings.Builder getDiskTypeSettings() { + return getStubSettingsBuilder().getDiskTypeSettings(); + } + + /** + * Returns the builder for the settings used for calls to listDiskTypes. + */ + public PagedCallSettings.Builder listDiskTypesSettings() { + return getStubSettingsBuilder().listDiskTypesSettings(); + } + + @Override + public DiskTypeSettings build() throws IOException { + return new DiskTypeSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java new file mode 100644 index 000000000000..44673da3fa2d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DiskTypesScopedList implements ApiMessage { + private final List diskTypes; + private final Warning warning; + + private DiskTypesScopedList() { + this.diskTypes = null; + this.warning = null; + } + + + private DiskTypesScopedList( + List diskTypes, + Warning warning + ) { + this.diskTypes = diskTypes; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskTypes") && diskTypes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (DiskType item : diskTypes) { + stringList.add(item.toString()); + } + fieldMap.put("diskTypes", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskTypes")) { + return String.valueOf(diskTypes); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getDiskTypesList() { + return diskTypes; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DiskTypesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DiskTypesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DiskTypesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DiskTypesScopedList(); + } + + public static class Builder { + private List diskTypes; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(DiskTypesScopedList other) { + if (other == DiskTypesScopedList.getDefaultInstance()) return this; + if (other.getDiskTypesList() != null) { + this.diskTypes = other.diskTypes; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(DiskTypesScopedList source) { + this.diskTypes = source.diskTypes; + this.warning = source.warning; + } + + public List getDiskTypesList() { + return diskTypes; + } + + public Builder addAllDiskTypes(List diskTypes) { + if (this.diskTypes == null) { + this.diskTypes = new ArrayList<>(diskTypes.size()); + } + this.diskTypes.addAll(diskTypes); + return this; + } + + public Builder addDiskTypes(DiskType diskTypes) { + this.diskTypes.add(diskTypes); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public DiskTypesScopedList build() { + + return new DiskTypesScopedList( + diskTypes, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllDiskTypes(this.diskTypes); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "DiskTypesScopedList{" + + "diskTypes=" + diskTypes + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DiskTypesScopedList) { + DiskTypesScopedList that = (DiskTypesScopedList) o; + return + Objects.equals(this.diskTypes, that.getDiskTypesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + diskTypes, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java new file mode 100644 index 000000000000..f2c3fe1925cf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DisksResizeRequest implements ApiMessage { + private final String sizeGb; + + private DisksResizeRequest() { + this.sizeGb = null; + } + + + private DisksResizeRequest( + String sizeGb + ) { + this.sizeGb = sizeGb; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sizeGb") && sizeGb != null) { + fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sizeGb")) { + return String.valueOf(sizeGb); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getSizeGb() { + return sizeGb; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DisksResizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DisksResizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DisksResizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DisksResizeRequest(); + } + + public static class Builder { + private String sizeGb; + + Builder() {} + + public Builder mergeFrom(DisksResizeRequest other) { + if (other == DisksResizeRequest.getDefaultInstance()) return this; + if (other.getSizeGb() != null) { + this.sizeGb = other.sizeGb; + } + return this; + } + + Builder(DisksResizeRequest source) { + this.sizeGb = source.sizeGb; + } + + public String getSizeGb() { + return sizeGb; + } + + public Builder setSizeGb(String sizeGb) { + this.sizeGb = sizeGb; + return this; + } + + + public DisksResizeRequest build() { + return new DisksResizeRequest( + sizeGb + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setSizeGb(this.sizeGb); + return newBuilder; + } + } + + @Override + public String toString() { + return "DisksResizeRequest{" + + "sizeGb=" + sizeGb + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DisksResizeRequest) { + DisksResizeRequest that = (DisksResizeRequest) o; + return + Objects.equals(this.sizeGb, that.getSizeGb()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + sizeGb + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java new file mode 100644 index 000000000000..43cc1f116e0f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DisksScopedList implements ApiMessage { + private final List disks; + private final Warning warning; + + private DisksScopedList() { + this.disks = null; + this.warning = null; + } + + + private DisksScopedList( + List disks, + Warning warning + ) { + this.disks = disks; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Disk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("disks")) { + return String.valueOf(disks); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getDisksList() { + return disks; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DisksScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static DisksScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final DisksScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DisksScopedList(); + } + + public static class Builder { + private List disks; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(DisksScopedList other) { + if (other == DisksScopedList.getDefaultInstance()) return this; + if (other.getDisksList() != null) { + this.disks = other.disks; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(DisksScopedList source) { + this.disks = source.disks; + this.warning = source.warning; + } + + public List getDisksList() { + return disks; + } + + public Builder addAllDisks(List disks) { + if (this.disks == null) { + this.disks = new ArrayList<>(disks.size()); + } + this.disks.addAll(disks); + return this; + } + + public Builder addDisks(Disk disks) { + this.disks.add(disks); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public DisksScopedList build() { + + return new DisksScopedList( + disks, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllDisks(this.disks); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "DisksScopedList{" + + "disks=" + disks + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DisksScopedList) { + DisksScopedList that = (DisksScopedList) o; + return + Objects.equals(this.disks, that.getDisksList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + disks, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java new file mode 100644 index 000000000000..da44bda46c2a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Error implements ApiMessage { + private final List errors; + + private Error() { + this.errors = null; + } + + + private Error( + List errors + ) { + this.errors = errors; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("errors") && errors != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Errors item : errors) { + stringList.add(item.toString()); + } + fieldMap.put("errors", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("errors")) { + return String.valueOf(errors); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getErrorsList() { + return errors; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Error prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Error getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Error DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Error(); + } + + public static class Builder { + private List errors; + + Builder() {} + + public Builder mergeFrom(Error other) { + if (other == Error.getDefaultInstance()) return this; + if (other.getErrorsList() != null) { + this.errors = other.errors; + } + return this; + } + + Builder(Error source) { + this.errors = source.errors; + } + + public List getErrorsList() { + return errors; + } + + public Builder addAllErrors(List errors) { + if (this.errors == null) { + this.errors = new ArrayList<>(errors.size()); + } + this.errors.addAll(errors); + return this; + } + + public Builder addErrors(Errors errors) { + this.errors.add(errors); + return this; + } + + + public Error build() { + return new Error( + errors + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllErrors(this.errors); + return newBuilder; + } + } + + @Override + public String toString() { + return "Error{" + + "errors=" + errors + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Error) { + Error that = (Error) o; + return + Objects.equals(this.errors, that.getErrorsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + errors + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java new file mode 100644 index 000000000000..d9d1e491ba49 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Errors implements ApiMessage { + private final String code; + private final String location; + private final String message; + + private Errors() { + this.code = null; + this.location = null; + this.message = null; + } + + + private Errors( + String code, + String location, + String message + ) { + this.code = code; + this.location = location; + this.message = message; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("location") && location != null) { + fieldMap.put("location", Collections.singletonList(String.valueOf(location))); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("code")) { + return String.valueOf(code); + } + if (fieldName.equals("location")) { + return String.valueOf(location); + } + if (fieldName.equals("message")) { + return String.valueOf(message); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCode() { + return code; + } + + public String getLocation() { + return location; + } + + public String getMessage() { + return message; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Errors prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Errors getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Errors DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Errors(); + } + + public static class Builder { + private String code; + private String location; + private String message; + + Builder() {} + + public Builder mergeFrom(Errors other) { + if (other == Errors.getDefaultInstance()) return this; + if (other.getCode() != null) { + this.code = other.code; + } + if (other.getLocation() != null) { + this.location = other.location; + } + if (other.getMessage() != null) { + this.message = other.message; + } + return this; + } + + Builder(Errors source) { + this.code = source.code; + this.location = source.location; + this.message = source.message; + } + + public String getCode() { + return code; + } + + public Builder setCode(String code) { + this.code = code; + return this; + } + + public String getLocation() { + return location; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public String getMessage() { + return message; + } + + public Builder setMessage(String message) { + this.message = message; + return this; + } + + + public Errors build() { + + + return new Errors( + code, + location, + message + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCode(this.code); + newBuilder.setLocation(this.location); + newBuilder.setMessage(this.message); + return newBuilder; + } + } + + @Override + public String toString() { + return "Errors{" + + "code=" + code + ", " + + "location=" + location + ", " + + "message=" + message + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Errors) { + Errors that = (Errors) o; + return + Objects.equals(this.code, that.getCode()) && + Objects.equals(this.location, that.getLocation()) && + Objects.equals(this.message, that.getMessage()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + code, + location, + message + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java new file mode 100644 index 000000000000..a366a1e1c039 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ExpandIpCidrRangeSubnetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String subnetwork; + private final SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource; + private final String userIp; + + private ExpandIpCidrRangeSubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.subnetwork = null; + this.subnetworksExpandIpCidrRangeRequestResource = null; + this.userIp = null; + } + + + private ExpandIpCidrRangeSubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String subnetwork, + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.subnetwork = subnetwork; + this.subnetworksExpandIpCidrRangeRequestResource = subnetworksExpandIpCidrRangeRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("subnetworksExpandIpCidrRangeRequestResource") && subnetworksExpandIpCidrRangeRequestResource != null) { + fieldMap.put("subnetworksExpandIpCidrRangeRequestResource", Collections.singletonList(String.valueOf(subnetworksExpandIpCidrRangeRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + if (fieldName.equals("subnetworksExpandIpCidrRangeRequestResource")) { + return String.valueOf(subnetworksExpandIpCidrRangeRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public SubnetworksExpandIpCidrRangeRequest getApiMessageRequestBody() { + return subnetworksExpandIpCidrRangeRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSubnetwork() { + return subnetwork; + } + + public SubnetworksExpandIpCidrRangeRequest getSubnetworksExpandIpCidrRangeRequestResource() { + return subnetworksExpandIpCidrRangeRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ExpandIpCidrRangeSubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ExpandIpCidrRangeSubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ExpandIpCidrRangeSubnetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ExpandIpCidrRangeSubnetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String subnetwork; + private SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ExpandIpCidrRangeSubnetworkHttpRequest other) { + if (other == ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + if (other.getSubnetworksExpandIpCidrRangeRequestResource() != null) { + this.subnetworksExpandIpCidrRangeRequestResource = other.subnetworksExpandIpCidrRangeRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ExpandIpCidrRangeSubnetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.subnetwork = source.subnetwork; + this.subnetworksExpandIpCidrRangeRequestResource = source.subnetworksExpandIpCidrRangeRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public SubnetworksExpandIpCidrRangeRequest getSubnetworksExpandIpCidrRangeRequestResource() { + return subnetworksExpandIpCidrRangeRequestResource; + } + + public Builder setSubnetworksExpandIpCidrRangeRequestResource(SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + this.subnetworksExpandIpCidrRangeRequestResource = subnetworksExpandIpCidrRangeRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ExpandIpCidrRangeSubnetworkHttpRequest build() { + String missing = ""; + + + + + + + if (subnetwork == null) { + missing += " subnetwork"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ExpandIpCidrRangeSubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + subnetwork, + subnetworksExpandIpCidrRangeRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSubnetwork(this.subnetwork); + newBuilder.setSubnetworksExpandIpCidrRangeRequestResource(this.subnetworksExpandIpCidrRangeRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ExpandIpCidrRangeSubnetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "subnetwork=" + subnetwork + ", " + + "subnetworksExpandIpCidrRangeRequestResource=" + subnetworksExpandIpCidrRangeRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ExpandIpCidrRangeSubnetworkHttpRequest) { + ExpandIpCidrRangeSubnetworkHttpRequest that = (ExpandIpCidrRangeSubnetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && + Objects.equals(this.subnetworksExpandIpCidrRangeRequestResource, that.getSubnetworksExpandIpCidrRangeRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + subnetwork, + subnetworksExpandIpCidrRangeRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java new file mode 100644 index 000000000000..f09fe99184b9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class FamilyName implements ResourceName { + private final String family; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/family/{family}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FamilyName(Builder builder) { + family = Preconditions.checkNotNull(builder.getFamily()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static FamilyName of( + String family, + String project + ) { + return newBuilder() + .setFamily(family) + .setProject(project) + .build(); + } + + public static String format( + String family, + String project + ) { + return of( + family, + project + ) + .toString(); + } + + public String getFamily() { + return family; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("family", family); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public FamilyName parse(String formattedString) {return FamilyName.parse(formattedString);} + }; + } + + public static FamilyName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "FamilyName.parse: formattedString not in valid format"); + return of( + matchMap.get("family"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String family; + private String project; + + public String getFamily() { + return family; + } + public String getProject() { + return project; + } + + public Builder setFamily(String family) { + this.family = family; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (FamilyName familyName) { + family = familyName.family; + project = familyName.project; + } + + public FamilyName build() { + return new FamilyName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "family", family, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FamilyName) { + FamilyName that = (FamilyName) o; + return + Objects.equals(this.family, that.getFamily()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + family, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java new file mode 100644 index 000000000000..3133f30b7955 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java @@ -0,0 +1,550 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Firewall implements ApiMessage { + private final List allowed; + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String network; + private final String selfLink; + private final List sourceRanges; + private final List sourceTags; + private final List targetTags; + + private Firewall() { + this.allowed = null; + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.network = null; + this.selfLink = null; + this.sourceRanges = null; + this.sourceTags = null; + this.targetTags = null; + } + + + private Firewall( + List allowed, + String creationTimestamp, + String description, + String id, + String kind, + String name, + String network, + String selfLink, + List sourceRanges, + List sourceTags, + List targetTags + ) { + this.allowed = allowed; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.network = network; + this.selfLink = selfLink; + this.sourceRanges = sourceRanges; + this.sourceTags = sourceTags; + this.targetTags = targetTags; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("allowed") && allowed != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Allowed item : allowed) { + stringList.add(item.toString()); + } + fieldMap.put("allowed", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sourceRanges") && sourceRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sourceRanges) { + stringList.add(item.toString()); + } + fieldMap.put("sourceRanges", stringList.build()); + } + if (fieldNames.contains("sourceTags") && sourceTags != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sourceTags) { + stringList.add(item.toString()); + } + fieldMap.put("sourceTags", stringList.build()); + } + if (fieldNames.contains("targetTags") && targetTags != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetTags) { + stringList.add(item.toString()); + } + fieldMap.put("targetTags", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("allowed")) { + return String.valueOf(allowed); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sourceRanges")) { + return String.valueOf(sourceRanges); + } + if (fieldName.equals("sourceTags")) { + return String.valueOf(sourceTags); + } + if (fieldName.equals("targetTags")) { + return String.valueOf(targetTags); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getAllowedList() { + return allowed; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getSelfLink() { + return selfLink; + } + + public List getSourceRangesList() { + return sourceRanges; + } + + public List getSourceTagsList() { + return sourceTags; + } + + public List getTargetTagsList() { + return targetTags; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Firewall prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Firewall getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Firewall DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Firewall(); + } + + public static class Builder { + private List allowed; + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String network; + private String selfLink; + private List sourceRanges; + private List sourceTags; + private List targetTags; + + Builder() {} + + public Builder mergeFrom(Firewall other) { + if (other == Firewall.getDefaultInstance()) return this; + if (other.getAllowedList() != null) { + this.allowed = other.allowed; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSourceRangesList() != null) { + this.sourceRanges = other.sourceRanges; + } + if (other.getSourceTagsList() != null) { + this.sourceTags = other.sourceTags; + } + if (other.getTargetTagsList() != null) { + this.targetTags = other.targetTags; + } + return this; + } + + Builder(Firewall source) { + this.allowed = source.allowed; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.network = source.network; + this.selfLink = source.selfLink; + this.sourceRanges = source.sourceRanges; + this.sourceTags = source.sourceTags; + this.targetTags = source.targetTags; + } + + public List getAllowedList() { + return allowed; + } + + public Builder addAllAllowed(List allowed) { + if (this.allowed == null) { + this.allowed = new ArrayList<>(allowed.size()); + } + this.allowed.addAll(allowed); + return this; + } + + public Builder addAllowed(Allowed allowed) { + this.allowed.add(allowed); + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getSourceRangesList() { + return sourceRanges; + } + + public Builder addAllSourceRanges(List sourceRanges) { + if (this.sourceRanges == null) { + this.sourceRanges = new ArrayList<>(sourceRanges.size()); + } + this.sourceRanges.addAll(sourceRanges); + return this; + } + + public Builder addSourceRanges(String sourceRanges) { + this.sourceRanges.add(sourceRanges); + return this; + } + + public List getSourceTagsList() { + return sourceTags; + } + + public Builder addAllSourceTags(List sourceTags) { + if (this.sourceTags == null) { + this.sourceTags = new ArrayList<>(sourceTags.size()); + } + this.sourceTags.addAll(sourceTags); + return this; + } + + public Builder addSourceTags(String sourceTags) { + this.sourceTags.add(sourceTags); + return this; + } + + public List getTargetTagsList() { + return targetTags; + } + + public Builder addAllTargetTags(List targetTags) { + if (this.targetTags == null) { + this.targetTags = new ArrayList<>(targetTags.size()); + } + this.targetTags.addAll(targetTags); + return this; + } + + public Builder addTargetTags(String targetTags) { + this.targetTags.add(targetTags); + return this; + } + + + public Firewall build() { + + + + + + + + + + + return new Firewall( + allowed, + creationTimestamp, + description, + id, + kind, + name, + network, + selfLink, + sourceRanges, + sourceTags, + targetTags + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAllowed(this.allowed); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllSourceRanges(this.sourceRanges); + newBuilder.addAllSourceTags(this.sourceTags); + newBuilder.addAllTargetTags(this.targetTags); + return newBuilder; + } + } + + @Override + public String toString() { + return "Firewall{" + + "allowed=" + allowed + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "selfLink=" + selfLink + ", " + + "sourceRanges=" + sourceRanges + ", " + + "sourceTags=" + sourceTags + ", " + + "targetTags=" + targetTags + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Firewall) { + Firewall that = (Firewall) o; + return + Objects.equals(this.allowed, that.getAllowedList()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sourceRanges, that.getSourceRangesList()) && + Objects.equals(this.sourceTags, that.getSourceTagsList()) && + Objects.equals(this.targetTags, that.getTargetTagsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + allowed, + creationTimestamp, + description, + id, + kind, + name, + network, + selfLink, + sourceRanges, + sourceTags, + targetTags + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java new file mode 100644 index 000000000000..c1a943db3666 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java @@ -0,0 +1,926 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.FirewallStub; +import com.google.cloud.compute.v1.stub.FirewallStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (FirewallClient firewallClient = FirewallClient.create()) {
+ *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+ *   Operation response = firewallClient.deleteFirewall(firewall);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the firewallClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of FirewallSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * FirewallSettings firewallSettings =
+ *     FirewallSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * FirewallClient firewallClient =
+ *     FirewallClient.create(firewallSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * FirewallSettings firewallSettings =
+ *     FirewallSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FirewallClient firewallClient =
+ *     FirewallClient.create(firewallSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class FirewallClient implements BackgroundResource { + private final FirewallSettings settings; + private final FirewallStub stub; + + + + /** + * Constructs an instance of FirewallClient with default settings. + */ + public static final FirewallClient create() throws IOException { + return create(FirewallSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FirewallClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final FirewallClient create(FirewallSettings settings) throws IOException { + return new FirewallClient(settings); + } + + /** + * Constructs an instance of FirewallClient, using the given stub for making calls. This is for + * advanced usage - prefer to use FirewallSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final FirewallClient create(FirewallStub stub) { + return new FirewallClient(stub); + } + + /** + * Constructs an instance of FirewallClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected FirewallClient(FirewallSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FirewallStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected FirewallClient(FirewallStub stub) { + this.settings = null; + this.stub = stub; + } + + public final FirewallSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FirewallStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Operation response = firewallClient.deleteFirewall(firewall);
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteFirewall(FirewallName firewall) { + + DeleteFirewallHttpRequest request = + DeleteFirewallHttpRequest.newBuilder() + .setFirewall(firewall == null ? null : firewall.toString()) + .build(); + return deleteFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Operation response = firewallClient.deleteFirewall(firewall.toString());
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteFirewall(String firewall) { + + DeleteFirewallHttpRequest request = + DeleteFirewallHttpRequest.newBuilder() + .setFirewall(firewall) + .build(); + return deleteFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .build();
+   *   Operation response = firewallClient.deleteFirewall(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteFirewall(DeleteFirewallHttpRequest request) { + return deleteFirewallCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = firewallClient.deleteFirewallCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteFirewallCallable() { + return stub.deleteFirewallCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall response = firewallClient.getFirewall(firewall);
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Firewall getFirewall(FirewallName firewall) { + + GetFirewallHttpRequest request = + GetFirewallHttpRequest.newBuilder() + .setFirewall(firewall == null ? null : firewall.toString()) + .build(); + return getFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall response = firewallClient.getFirewall(firewall.toString());
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Firewall getFirewall(String firewall) { + + GetFirewallHttpRequest request = + GetFirewallHttpRequest.newBuilder() + .setFirewall(firewall) + .build(); + return getFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .build();
+   *   Firewall response = firewallClient.getFirewall(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Firewall getFirewall(GetFirewallHttpRequest request) { + return getFirewallCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified firewall. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .build();
+   *   ApiFuture<Firewall> future = firewallClient.getFirewallCallable().futureCall(request);
+   *   // Do something
+   *   Firewall response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getFirewallCallable() { + return stub.getFirewallCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   Operation response = firewallClient.insertFirewall(project, firewallResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param firewallResource Represents a Firewall resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertFirewall(ProjectName project, Firewall firewallResource) { + + InsertFirewallHttpRequest request = + InsertFirewallHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setFirewallResource(firewallResource) + .build(); + return insertFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   Operation response = firewallClient.insertFirewall(project.toString(), firewallResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param firewallResource Represents a Firewall resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertFirewall(String project, Firewall firewallResource) { + + InsertFirewallHttpRequest request = + InsertFirewallHttpRequest.newBuilder() + .setProject(project) + .setFirewallResource(firewallResource) + .build(); + return insertFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setFirewallResource(firewallResource)
+   *     .build();
+   *   Operation response = firewallClient.insertFirewall(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertFirewall(InsertFirewallHttpRequest request) { + return insertFirewallCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setFirewallResource(firewallResource)
+   *     .build();
+   *   ApiFuture<Operation> future = firewallClient.insertFirewallCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertFirewallCallable() { + return stub.insertFirewallCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of firewall rules available to the specified project. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Firewall element : firewallClient.listFirewalls(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListFirewallsPagedResponse listFirewalls(ProjectName project) { + ListFirewallsHttpRequest request = + ListFirewallsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listFirewalls(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of firewall rules available to the specified project. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Firewall element : firewallClient.listFirewalls(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListFirewallsPagedResponse listFirewalls(String project) { + ListFirewallsHttpRequest request = + ListFirewallsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listFirewalls(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of firewall rules available to the specified project. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListFirewallsHttpRequest request = ListFirewallsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Firewall element : firewallClient.listFirewalls(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest request) { + return listFirewallsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of firewall rules available to the specified project. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListFirewallsHttpRequest request = ListFirewallsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListFirewallsPagedResponse> future = firewallClient.listFirewallsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Firewall element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listFirewallsPagedCallable() { + return stub.listFirewallsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of firewall rules available to the specified project. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListFirewallsHttpRequest request = ListFirewallsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     FirewallList response = firewallClient.listFirewallsCallable().call(request);
+   *     for (Firewall element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listFirewallsCallable() { + return stub.listFirewallsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   Operation response = firewallClient.patchFirewall(firewall, firewallResource);
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to update. + * @param firewallResource Represents a Firewall resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchFirewall(FirewallName firewall, Firewall firewallResource) { + + PatchFirewallHttpRequest request = + PatchFirewallHttpRequest.newBuilder() + .setFirewall(firewall == null ? null : firewall.toString()) + .setFirewallResource(firewallResource) + .build(); + return patchFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   Operation response = firewallClient.patchFirewall(firewall.toString(), firewallResource);
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to update. + * @param firewallResource Represents a Firewall resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchFirewall(String firewall, Firewall firewallResource) { + + PatchFirewallHttpRequest request = + PatchFirewallHttpRequest.newBuilder() + .setFirewall(firewall) + .setFirewallResource(firewallResource) + .build(); + return patchFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .setFirewallResource(firewallResource)
+   *     .build();
+   *   Operation response = firewallClient.patchFirewall(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchFirewall(PatchFirewallHttpRequest request) { + return patchFirewallCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .setFirewallResource(firewallResource)
+   *     .build();
+   *   ApiFuture<Operation> future = firewallClient.patchFirewallCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchFirewallCallable() { + return stub.patchFirewallCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   Operation response = firewallClient.updateFirewall(firewall, firewallResource);
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to update. + * @param firewallResource Represents a Firewall resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateFirewall(FirewallName firewall, Firewall firewallResource) { + + UpdateFirewallHttpRequest request = + UpdateFirewallHttpRequest.newBuilder() + .setFirewall(firewall == null ? null : firewall.toString()) + .setFirewallResource(firewallResource) + .build(); + return updateFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   Operation response = firewallClient.updateFirewall(firewall.toString(), firewallResource);
+   * }
+   * 
+ * + * @param firewall Name of the firewall rule to update. + * @param firewallResource Represents a Firewall resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateFirewall(String firewall, Firewall firewallResource) { + + UpdateFirewallHttpRequest request = + UpdateFirewallHttpRequest.newBuilder() + .setFirewall(firewall) + .setFirewallResource(firewallResource) + .build(); + return updateFirewall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .setFirewallResource(firewallResource)
+   *     .build();
+   *   Operation response = firewallClient.updateFirewall(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateFirewall(UpdateFirewallHttpRequest request) { + return updateFirewallCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified firewall rule with the data included in the request. + * + * Sample code: + *

+   * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   Firewall firewallResource = Firewall.newBuilder().build();
+   *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
+   *     .setFirewall(firewall.toString())
+   *     .setFirewallResource(firewallResource)
+   *     .build();
+   *   ApiFuture<Operation> future = firewallClient.updateFirewallCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateFirewallCallable() { + return stub.updateFirewallCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListFirewallsPagedResponse extends AbstractPagedListResponse< + ListFirewallsHttpRequest, + FirewallList, + Firewall, + ListFirewallsPage, + ListFirewallsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFirewallsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFirewallsPagedResponse apply(ListFirewallsPage input) { + return new ListFirewallsPagedResponse(input); + } + }); + } + + private ListFirewallsPagedResponse(ListFirewallsPage page) { + super(page, ListFirewallsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListFirewallsPage extends AbstractPage< + ListFirewallsHttpRequest, + FirewallList, + Firewall, + ListFirewallsPage> { + + private ListFirewallsPage( + PageContext context, + FirewallList response) { + super(context, response); + } + + private static ListFirewallsPage createEmptyPage() { + return new ListFirewallsPage(null, null); + } + + @Override + protected ListFirewallsPage createPage( + PageContext context, + FirewallList response) { + return new ListFirewallsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListFirewallsFixedSizeCollection extends AbstractFixedSizeCollection< + ListFirewallsHttpRequest, + FirewallList, + Firewall, + ListFirewallsPage, + ListFirewallsFixedSizeCollection> { + + private ListFirewallsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFirewallsFixedSizeCollection createEmptyCollection() { + return new ListFirewallsFixedSizeCollection(null, 0); + } + + @Override + protected ListFirewallsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFirewallsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java new file mode 100644 index 000000000000..55da6cdd8ed6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class FirewallList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private FirewallList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private FirewallList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Firewall item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(FirewallList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static FirewallList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final FirewallList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new FirewallList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(FirewallList other) { + if (other == FirewallList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(FirewallList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Firewall items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public FirewallList build() { + + + + + return new FirewallList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "FirewallList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FirewallList) { + FirewallList that = (FirewallList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java new file mode 100644 index 000000000000..8b164540c6fe --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class FirewallName implements ResourceName { + private final String firewall; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/firewalls/{firewall}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FirewallName(Builder builder) { + firewall = Preconditions.checkNotNull(builder.getFirewall()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static FirewallName of( + String firewall, + String project + ) { + return newBuilder() + .setFirewall(firewall) + .setProject(project) + .build(); + } + + public static String format( + String firewall, + String project + ) { + return of( + firewall, + project + ) + .toString(); + } + + public String getFirewall() { + return firewall; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("firewall", firewall); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public FirewallName parse(String formattedString) {return FirewallName.parse(formattedString);} + }; + } + + public static FirewallName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "FirewallName.parse: formattedString not in valid format"); + return of( + matchMap.get("firewall"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String firewall; + private String project; + + public String getFirewall() { + return firewall; + } + public String getProject() { + return project; + } + + public Builder setFirewall(String firewall) { + this.firewall = firewall; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (FirewallName firewallName) { + firewall = firewallName.firewall; + project = firewallName.project; + } + + public FirewallName build() { + return new FirewallName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "firewall", firewall, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FirewallName) { + FirewallName that = (FirewallName) o; + return + Objects.equals(this.firewall, that.getFirewall()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + firewall, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java new file mode 100644 index 000000000000..bd2a538d9263 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import com.google.cloud.compute.v1.stub.FirewallStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link FirewallClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteFirewall to 30 seconds: + * + *

+ * 
+ * FirewallSettings.Builder firewallSettingsBuilder =
+ *     FirewallSettings.newBuilder();
+ * firewallSettingsBuilder.deleteFirewallSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * FirewallSettings firewallSettings = firewallSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class FirewallSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteFirewall. + */ + public UnaryCallSettings deleteFirewallSettings() { + return ((FirewallStubSettings) getStubSettings()).deleteFirewallSettings(); + } + + /** + * Returns the object with the settings used for calls to getFirewall. + */ + public UnaryCallSettings getFirewallSettings() { + return ((FirewallStubSettings) getStubSettings()).getFirewallSettings(); + } + + /** + * Returns the object with the settings used for calls to insertFirewall. + */ + public UnaryCallSettings insertFirewallSettings() { + return ((FirewallStubSettings) getStubSettings()).insertFirewallSettings(); + } + + /** + * Returns the object with the settings used for calls to listFirewalls. + */ + public PagedCallSettings listFirewallsSettings() { + return ((FirewallStubSettings) getStubSettings()).listFirewallsSettings(); + } + + /** + * Returns the object with the settings used for calls to patchFirewall. + */ + public UnaryCallSettings patchFirewallSettings() { + return ((FirewallStubSettings) getStubSettings()).patchFirewallSettings(); + } + + /** + * Returns the object with the settings used for calls to updateFirewall. + */ + public UnaryCallSettings updateFirewallSettings() { + return ((FirewallStubSettings) getStubSettings()).updateFirewallSettings(); + } + + + public static final FirewallSettings create(FirewallStubSettings stub) throws IOException { + return new FirewallSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FirewallStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return FirewallStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return FirewallStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return FirewallStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FirewallStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return FirewallStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FirewallStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FirewallStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FirewallSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for FirewallSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(FirewallStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(FirewallStubSettings.newBuilder()); + } + + protected Builder(FirewallSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FirewallStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public FirewallStubSettings.Builder getStubSettingsBuilder() { + return ((FirewallStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteFirewall. + */ + public UnaryCallSettings.Builder deleteFirewallSettings() { + return getStubSettingsBuilder().deleteFirewallSettings(); + } + + /** + * Returns the builder for the settings used for calls to getFirewall. + */ + public UnaryCallSettings.Builder getFirewallSettings() { + return getStubSettingsBuilder().getFirewallSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertFirewall. + */ + public UnaryCallSettings.Builder insertFirewallSettings() { + return getStubSettingsBuilder().insertFirewallSettings(); + } + + /** + * Returns the builder for the settings used for calls to listFirewalls. + */ + public PagedCallSettings.Builder listFirewallsSettings() { + return getStubSettingsBuilder().listFirewallsSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchFirewall. + */ + public UnaryCallSettings.Builder patchFirewallSettings() { + return getStubSettingsBuilder().patchFirewallSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateFirewall. + */ + public UnaryCallSettings.Builder updateFirewallSettings() { + return getStubSettingsBuilder().updateFirewallSettings(); + } + + @Override + public FirewallSettings build() throws IOException { + return new FirewallSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java new file mode 100644 index 000000000000..c676e3aa334c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java @@ -0,0 +1,684 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ForwardingRule implements ApiMessage { + private final String backendService; + private final String creationTimestamp; + private final String description; + private final String iPAddress; + private final String iPProtocol; + private final String id; + private final String kind; + private final String loadBalancingScheme; + private final String name; + private final String network; + private final String portRange; + private final List ports; + private final String region; + private final String selfLink; + private final String subnetwork; + private final String target; + + private ForwardingRule() { + this.backendService = null; + this.creationTimestamp = null; + this.description = null; + this.iPAddress = null; + this.iPProtocol = null; + this.id = null; + this.kind = null; + this.loadBalancingScheme = null; + this.name = null; + this.network = null; + this.portRange = null; + this.ports = null; + this.region = null; + this.selfLink = null; + this.subnetwork = null; + this.target = null; + } + + + private ForwardingRule( + String backendService, + String creationTimestamp, + String description, + String iPAddress, + String iPProtocol, + String id, + String kind, + String loadBalancingScheme, + String name, + String network, + String portRange, + List ports, + String region, + String selfLink, + String subnetwork, + String target + ) { + this.backendService = backendService; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.iPAddress = iPAddress; + this.iPProtocol = iPProtocol; + this.id = id; + this.kind = kind; + this.loadBalancingScheme = loadBalancingScheme; + this.name = name; + this.network = network; + this.portRange = portRange; + this.ports = ports; + this.region = region; + this.selfLink = selfLink; + this.subnetwork = subnetwork; + this.target = target; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("iPAddress") && iPAddress != null) { + fieldMap.put("iPAddress", Collections.singletonList(String.valueOf(iPAddress))); + } + if (fieldNames.contains("iPProtocol") && iPProtocol != null) { + fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { + fieldMap.put("loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("portRange") && portRange != null) { + fieldMap.put("portRange", Collections.singletonList(String.valueOf(portRange))); + } + if (fieldNames.contains("ports") && ports != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : ports) { + stringList.add(item.toString()); + } + fieldMap.put("ports", stringList.build()); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("iPAddress")) { + return String.valueOf(iPAddress); + } + if (fieldName.equals("iPProtocol")) { + return String.valueOf(iPProtocol); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("loadBalancingScheme")) { + return String.valueOf(loadBalancingScheme); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("portRange")) { + return String.valueOf(portRange); + } + if (fieldName.equals("ports")) { + return String.valueOf(ports); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + if (fieldName.equals("target")) { + return String.valueOf(target); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getBackendService() { + return backendService; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getIPAddress() { + return iPAddress; + } + + public String getIPProtocol() { + return iPProtocol; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getLoadBalancingScheme() { + return loadBalancingScheme; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getPortRange() { + return portRange; + } + + public List getPortsList() { + return ports; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getSubnetwork() { + return subnetwork; + } + + public String getTarget() { + return target; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ForwardingRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ForwardingRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ForwardingRule DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ForwardingRule(); + } + + public static class Builder { + private String backendService; + private String creationTimestamp; + private String description; + private String iPAddress; + private String iPProtocol; + private String id; + private String kind; + private String loadBalancingScheme; + private String name; + private String network; + private String portRange; + private List ports; + private String region; + private String selfLink; + private String subnetwork; + private String target; + + Builder() {} + + public Builder mergeFrom(ForwardingRule other) { + if (other == ForwardingRule.getDefaultInstance()) return this; + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getIPAddress() != null) { + this.iPAddress = other.iPAddress; + } + if (other.getIPProtocol() != null) { + this.iPProtocol = other.iPProtocol; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLoadBalancingScheme() != null) { + this.loadBalancingScheme = other.loadBalancingScheme; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getPortRange() != null) { + this.portRange = other.portRange; + } + if (other.getPortsList() != null) { + this.ports = other.ports; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + if (other.getTarget() != null) { + this.target = other.target; + } + return this; + } + + Builder(ForwardingRule source) { + this.backendService = source.backendService; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.iPAddress = source.iPAddress; + this.iPProtocol = source.iPProtocol; + this.id = source.id; + this.kind = source.kind; + this.loadBalancingScheme = source.loadBalancingScheme; + this.name = source.name; + this.network = source.network; + this.portRange = source.portRange; + this.ports = source.ports; + this.region = source.region; + this.selfLink = source.selfLink; + this.subnetwork = source.subnetwork; + this.target = source.target; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getIPAddress() { + return iPAddress; + } + + public Builder setIPAddress(String iPAddress) { + this.iPAddress = iPAddress; + return this; + } + + public String getIPProtocol() { + return iPProtocol; + } + + public Builder setIPProtocol(String iPProtocol) { + this.iPProtocol = iPProtocol; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getLoadBalancingScheme() { + return loadBalancingScheme; + } + + public Builder setLoadBalancingScheme(String loadBalancingScheme) { + this.loadBalancingScheme = loadBalancingScheme; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getPortRange() { + return portRange; + } + + public Builder setPortRange(String portRange) { + this.portRange = portRange; + return this; + } + + public List getPortsList() { + return ports; + } + + public Builder addAllPorts(List ports) { + if (this.ports == null) { + this.ports = new ArrayList<>(ports.size()); + } + this.ports.addAll(ports); + return this; + } + + public Builder addPorts(String ports) { + this.ports.add(ports); + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public String getTarget() { + return target; + } + + public Builder setTarget(String target) { + this.target = target; + return this; + } + + + public ForwardingRule build() { + + + + + + + + + + + + + + + + return new ForwardingRule( + backendService, + creationTimestamp, + description, + iPAddress, + iPProtocol, + id, + kind, + loadBalancingScheme, + name, + network, + portRange, + ports, + region, + selfLink, + subnetwork, + target + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBackendService(this.backendService); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setIPAddress(this.iPAddress); + newBuilder.setIPProtocol(this.iPProtocol); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setLoadBalancingScheme(this.loadBalancingScheme); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setPortRange(this.portRange); + newBuilder.addAllPorts(this.ports); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSubnetwork(this.subnetwork); + newBuilder.setTarget(this.target); + return newBuilder; + } + } + + @Override + public String toString() { + return "ForwardingRule{" + + "backendService=" + backendService + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "iPAddress=" + iPAddress + ", " + + "iPProtocol=" + iPProtocol + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "loadBalancingScheme=" + loadBalancingScheme + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "portRange=" + portRange + ", " + + "ports=" + ports + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "subnetwork=" + subnetwork + ", " + + "target=" + target + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ForwardingRule) { + ForwardingRule that = (ForwardingRule) o; + return + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.iPAddress, that.getIPAddress()) && + Objects.equals(this.iPProtocol, that.getIPProtocol()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.portRange, that.getPortRange()) && + Objects.equals(this.ports, that.getPortsList()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && + Objects.equals(this.target, that.getTarget()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + backendService, + creationTimestamp, + description, + iPAddress, + iPProtocol, + id, + kind, + loadBalancingScheme, + name, + network, + portRange, + ports, + region, + selfLink, + subnetwork, + target + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java new file mode 100644 index 000000000000..5d564fea3bb8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ForwardingRuleAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private ForwardingRuleAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private ForwardingRuleAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ForwardingRuleAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ForwardingRuleAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ForwardingRuleAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ForwardingRuleAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(ForwardingRuleAggregatedList other) { + if (other == ForwardingRuleAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(ForwardingRuleAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public ForwardingRuleAggregatedList build() { + + + + + return new ForwardingRuleAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "ForwardingRuleAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ForwardingRuleAggregatedList) { + ForwardingRuleAggregatedList that = (ForwardingRuleAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java new file mode 100644 index 000000000000..38ad2f6fe283 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java @@ -0,0 +1,1041 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.ForwardingRuleStub; +import com.google.cloud.compute.v1.stub.ForwardingRuleStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+ *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+ *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the forwardingRuleClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of ForwardingRuleSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * ForwardingRuleSettings forwardingRuleSettings =
+ *     ForwardingRuleSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ForwardingRuleClient forwardingRuleClient =
+ *     ForwardingRuleClient.create(forwardingRuleSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ForwardingRuleSettings forwardingRuleSettings =
+ *     ForwardingRuleSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ForwardingRuleClient forwardingRuleClient =
+ *     ForwardingRuleClient.create(forwardingRuleSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ForwardingRuleClient implements BackgroundResource { + private final ForwardingRuleSettings settings; + private final ForwardingRuleStub stub; + + + + /** + * Constructs an instance of ForwardingRuleClient with default settings. + */ + public static final ForwardingRuleClient create() throws IOException { + return create(ForwardingRuleSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ForwardingRuleClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final ForwardingRuleClient create(ForwardingRuleSettings settings) throws IOException { + return new ForwardingRuleClient(settings); + } + + /** + * Constructs an instance of ForwardingRuleClient, using the given stub for making calls. This is for + * advanced usage - prefer to use ForwardingRuleSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ForwardingRuleClient create(ForwardingRuleStub stub) { + return new ForwardingRuleClient(stub); + } + + /** + * Constructs an instance of ForwardingRuleClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected ForwardingRuleClient(ForwardingRuleSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ForwardingRuleStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ForwardingRuleClient(ForwardingRuleStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ForwardingRuleSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ForwardingRuleStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of forwarding rules. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (ForwardingRulesScopedList element : forwardingRuleClient.aggregatedListForwardingRules(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(ProjectName project) { + AggregatedListForwardingRulesHttpRequest request = + AggregatedListForwardingRulesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListForwardingRules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of forwarding rules. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (ForwardingRulesScopedList element : forwardingRuleClient.aggregatedListForwardingRules(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(String project) { + AggregatedListForwardingRulesHttpRequest request = + AggregatedListForwardingRulesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListForwardingRules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of forwarding rules. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListForwardingRulesHttpRequest request = AggregatedListForwardingRulesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (ForwardingRulesScopedList element : forwardingRuleClient.aggregatedListForwardingRules(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(AggregatedListForwardingRulesHttpRequest request) { + return aggregatedListForwardingRulesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of forwarding rules. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListForwardingRulesHttpRequest request = AggregatedListForwardingRulesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListForwardingRulesPagedResponse> future = forwardingRuleClient.aggregatedListForwardingRulesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ForwardingRulesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListForwardingRulesPagedCallable() { + return stub.aggregatedListForwardingRulesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of forwarding rules. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListForwardingRulesHttpRequest request = AggregatedListForwardingRulesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     ForwardingRuleAggregatedList response = forwardingRuleClient.aggregatedListForwardingRulesCallable().call(request);
+   *     for (ForwardingRulesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListForwardingRulesCallable() { + return stub.aggregatedListForwardingRulesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteForwardingRule(ForwardingRuleName forwardingRule) { + + DeleteForwardingRuleHttpRequest request = + DeleteForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); + return deleteForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule.toString());
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteForwardingRule(String forwardingRule) { + + DeleteForwardingRuleHttpRequest request = + DeleteForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule) + .build(); + return deleteForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   Operation response = forwardingRuleClient.deleteForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteForwardingRule(DeleteForwardingRuleHttpRequest request) { + return deleteForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = forwardingRuleClient.deleteForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteForwardingRuleCallable() { + return stub.deleteForwardingRuleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ForwardingRule response = forwardingRuleClient.getForwardingRule(forwardingRule);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ForwardingRule getForwardingRule(ForwardingRuleName forwardingRule) { + + GetForwardingRuleHttpRequest request = + GetForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); + return getForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ForwardingRule response = forwardingRuleClient.getForwardingRule(forwardingRule.toString());
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ForwardingRule getForwardingRule(String forwardingRule) { + + GetForwardingRuleHttpRequest request = + GetForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule) + .build(); + return getForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   GetForwardingRuleHttpRequest request = GetForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   ForwardingRule response = forwardingRuleClient.getForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ForwardingRule getForwardingRule(GetForwardingRuleHttpRequest request) { + return getForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   GetForwardingRuleHttpRequest request = GetForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   ApiFuture<ForwardingRule> future = forwardingRuleClient.getForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   ForwardingRule response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getForwardingRuleCallable() { + return stub.getForwardingRuleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   Operation response = forwardingRuleClient.insertForwardingRule(region, forwardingRuleResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertForwardingRule(RegionName region, ForwardingRule forwardingRuleResource) { + + InsertForwardingRuleHttpRequest request = + InsertForwardingRuleHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setForwardingRuleResource(forwardingRuleResource) + .build(); + return insertForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   Operation response = forwardingRuleClient.insertForwardingRule(region.toString(), forwardingRuleResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertForwardingRule(String region, ForwardingRule forwardingRuleResource) { + + InsertForwardingRuleHttpRequest request = + InsertForwardingRuleHttpRequest.newBuilder() + .setRegion(region) + .setForwardingRuleResource(forwardingRuleResource) + .build(); + return insertForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setForwardingRuleResource(forwardingRuleResource)
+   *     .build();
+   *   Operation response = forwardingRuleClient.insertForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertForwardingRule(InsertForwardingRuleHttpRequest request) { + return insertForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setForwardingRuleResource(forwardingRuleResource)
+   *     .build();
+   *   ApiFuture<Operation> future = forwardingRuleClient.insertForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertForwardingRuleCallable() { + return stub.insertForwardingRuleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (ForwardingRule element : forwardingRuleClient.listForwardingRules(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListForwardingRulesPagedResponse listForwardingRules(RegionName region) { + ListForwardingRulesHttpRequest request = + ListForwardingRulesHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listForwardingRules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (ForwardingRule element : forwardingRuleClient.listForwardingRules(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListForwardingRulesPagedResponse listForwardingRules(String region) { + ListForwardingRulesHttpRequest request = + ListForwardingRulesHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listForwardingRules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (ForwardingRule element : forwardingRuleClient.listForwardingRules(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListForwardingRulesPagedResponse listForwardingRules(ListForwardingRulesHttpRequest request) { + return listForwardingRulesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListForwardingRulesPagedResponse> future = forwardingRuleClient.listForwardingRulesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ForwardingRule element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listForwardingRulesPagedCallable() { + return stub.listForwardingRulesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     ForwardingRuleList response = forwardingRuleClient.listForwardingRulesCallable().call(request);
+   *     for (ForwardingRule element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listForwardingRulesCallable() { + return stub.listForwardingRulesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(forwardingRule, targetReferenceResource);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param targetReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetForwardingRule(ForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { + + SetTargetForwardingRuleHttpRequest request = + SetTargetForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .setTargetReferenceResource(targetReferenceResource) + .build(); + return setTargetForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(forwardingRule.toString(), targetReferenceResource);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param targetReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetForwardingRule(String forwardingRule, TargetReference targetReferenceResource) { + + SetTargetForwardingRuleHttpRequest request = + SetTargetForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule) + .setTargetReferenceResource(targetReferenceResource) + .build(); + return setTargetForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .setTargetReferenceResource(targetReferenceResource)
+   *     .build();
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetForwardingRule(SetTargetForwardingRuleHttpRequest request) { + return setTargetForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .setTargetReferenceResource(targetReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = forwardingRuleClient.setTargetForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setTargetForwardingRuleCallable() { + return stub.setTargetForwardingRuleCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListForwardingRulesPagedResponse extends AbstractPagedListResponse< + AggregatedListForwardingRulesHttpRequest, + ForwardingRuleAggregatedList, + ForwardingRulesScopedList, + AggregatedListForwardingRulesPage, + AggregatedListForwardingRulesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListForwardingRulesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListForwardingRulesPagedResponse apply(AggregatedListForwardingRulesPage input) { + return new AggregatedListForwardingRulesPagedResponse(input); + } + }); + } + + private AggregatedListForwardingRulesPagedResponse(AggregatedListForwardingRulesPage page) { + super(page, AggregatedListForwardingRulesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListForwardingRulesPage extends AbstractPage< + AggregatedListForwardingRulesHttpRequest, + ForwardingRuleAggregatedList, + ForwardingRulesScopedList, + AggregatedListForwardingRulesPage> { + + private AggregatedListForwardingRulesPage( + PageContext context, + ForwardingRuleAggregatedList response) { + super(context, response); + } + + private static AggregatedListForwardingRulesPage createEmptyPage() { + return new AggregatedListForwardingRulesPage(null, null); + } + + @Override + protected AggregatedListForwardingRulesPage createPage( + PageContext context, + ForwardingRuleAggregatedList response) { + return new AggregatedListForwardingRulesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListForwardingRulesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListForwardingRulesHttpRequest, + ForwardingRuleAggregatedList, + ForwardingRulesScopedList, + AggregatedListForwardingRulesPage, + AggregatedListForwardingRulesFixedSizeCollection> { + + private AggregatedListForwardingRulesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListForwardingRulesFixedSizeCollection createEmptyCollection() { + return new AggregatedListForwardingRulesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListForwardingRulesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListForwardingRulesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListForwardingRulesPagedResponse extends AbstractPagedListResponse< + ListForwardingRulesHttpRequest, + ForwardingRuleList, + ForwardingRule, + ListForwardingRulesPage, + ListForwardingRulesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListForwardingRulesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListForwardingRulesPagedResponse apply(ListForwardingRulesPage input) { + return new ListForwardingRulesPagedResponse(input); + } + }); + } + + private ListForwardingRulesPagedResponse(ListForwardingRulesPage page) { + super(page, ListForwardingRulesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListForwardingRulesPage extends AbstractPage< + ListForwardingRulesHttpRequest, + ForwardingRuleList, + ForwardingRule, + ListForwardingRulesPage> { + + private ListForwardingRulesPage( + PageContext context, + ForwardingRuleList response) { + super(context, response); + } + + private static ListForwardingRulesPage createEmptyPage() { + return new ListForwardingRulesPage(null, null); + } + + @Override + protected ListForwardingRulesPage createPage( + PageContext context, + ForwardingRuleList response) { + return new ListForwardingRulesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListForwardingRulesFixedSizeCollection extends AbstractFixedSizeCollection< + ListForwardingRulesHttpRequest, + ForwardingRuleList, + ForwardingRule, + ListForwardingRulesPage, + ListForwardingRulesFixedSizeCollection> { + + private ListForwardingRulesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListForwardingRulesFixedSizeCollection createEmptyCollection() { + return new ListForwardingRulesFixedSizeCollection(null, 0); + } + + @Override + protected ListForwardingRulesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListForwardingRulesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java new file mode 100644 index 000000000000..d42016544ece --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ForwardingRuleList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private ForwardingRuleList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private ForwardingRuleList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ForwardingRule item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ForwardingRuleList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ForwardingRuleList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ForwardingRuleList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ForwardingRuleList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(ForwardingRuleList other) { + if (other == ForwardingRuleList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(ForwardingRuleList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(ForwardingRule items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public ForwardingRuleList build() { + + + + + return new ForwardingRuleList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "ForwardingRuleList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ForwardingRuleList) { + ForwardingRuleList that = (ForwardingRuleList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java new file mode 100644 index 000000000000..41020ed96e03 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ForwardingRuleName implements ResourceName { + private final String forwardingRule; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/forwardingRules/{forwardingRule}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ForwardingRuleName(Builder builder) { + forwardingRule = Preconditions.checkNotNull(builder.getForwardingRule()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ForwardingRuleName of( + String forwardingRule, + String project, + String region + ) { + return newBuilder() + .setForwardingRule(forwardingRule) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String forwardingRule, + String project, + String region + ) { + return of( + forwardingRule, + project, + region + ) + .toString(); + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("forwardingRule", forwardingRule); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ForwardingRuleName parse(String formattedString) {return ForwardingRuleName.parse(formattedString);} + }; + } + + public static ForwardingRuleName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ForwardingRuleName.parse: formattedString not in valid format"); + return of( + matchMap.get("forwardingRule"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String forwardingRule; + private String project; + private String region; + + public String getForwardingRule() { + return forwardingRule; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (ForwardingRuleName forwardingRuleName) { + forwardingRule = forwardingRuleName.forwardingRule; + project = forwardingRuleName.project; + region = forwardingRuleName.region; + } + + public ForwardingRuleName build() { + return new ForwardingRuleName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "forwardingRule", forwardingRule, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ForwardingRuleName) { + ForwardingRuleName that = (ForwardingRuleName) o; + return + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + forwardingRule, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java new file mode 100644 index 000000000000..c4a673cab649 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java @@ -0,0 +1,297 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.stub.ForwardingRuleStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ForwardingRuleClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteForwardingRule to 30 seconds: + * + *

+ * 
+ * ForwardingRuleSettings.Builder forwardingRuleSettingsBuilder =
+ *     ForwardingRuleSettings.newBuilder();
+ * forwardingRuleSettingsBuilder.deleteForwardingRuleSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ForwardingRuleSettings forwardingRuleSettings = forwardingRuleSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ForwardingRuleSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListForwardingRules. + */ + public PagedCallSettings aggregatedListForwardingRulesSettings() { + return ((ForwardingRuleStubSettings) getStubSettings()).aggregatedListForwardingRulesSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteForwardingRule. + */ + public UnaryCallSettings deleteForwardingRuleSettings() { + return ((ForwardingRuleStubSettings) getStubSettings()).deleteForwardingRuleSettings(); + } + + /** + * Returns the object with the settings used for calls to getForwardingRule. + */ + public UnaryCallSettings getForwardingRuleSettings() { + return ((ForwardingRuleStubSettings) getStubSettings()).getForwardingRuleSettings(); + } + + /** + * Returns the object with the settings used for calls to insertForwardingRule. + */ + public UnaryCallSettings insertForwardingRuleSettings() { + return ((ForwardingRuleStubSettings) getStubSettings()).insertForwardingRuleSettings(); + } + + /** + * Returns the object with the settings used for calls to listForwardingRules. + */ + public PagedCallSettings listForwardingRulesSettings() { + return ((ForwardingRuleStubSettings) getStubSettings()).listForwardingRulesSettings(); + } + + /** + * Returns the object with the settings used for calls to setTargetForwardingRule. + */ + public UnaryCallSettings setTargetForwardingRuleSettings() { + return ((ForwardingRuleStubSettings) getStubSettings()).setTargetForwardingRuleSettings(); + } + + + public static final ForwardingRuleSettings create(ForwardingRuleStubSettings stub) throws IOException { + return new ForwardingRuleSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ForwardingRuleStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return ForwardingRuleStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return ForwardingRuleStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return ForwardingRuleStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ForwardingRuleStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return ForwardingRuleStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ForwardingRuleStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ForwardingRuleStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ForwardingRuleSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for ForwardingRuleSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ForwardingRuleStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ForwardingRuleStubSettings.newBuilder()); + } + + protected Builder(ForwardingRuleSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ForwardingRuleStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public ForwardingRuleStubSettings.Builder getStubSettingsBuilder() { + return ((ForwardingRuleStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListForwardingRules. + */ + public PagedCallSettings.Builder aggregatedListForwardingRulesSettings() { + return getStubSettingsBuilder().aggregatedListForwardingRulesSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteForwardingRule. + */ + public UnaryCallSettings.Builder deleteForwardingRuleSettings() { + return getStubSettingsBuilder().deleteForwardingRuleSettings(); + } + + /** + * Returns the builder for the settings used for calls to getForwardingRule. + */ + public UnaryCallSettings.Builder getForwardingRuleSettings() { + return getStubSettingsBuilder().getForwardingRuleSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertForwardingRule. + */ + public UnaryCallSettings.Builder insertForwardingRuleSettings() { + return getStubSettingsBuilder().insertForwardingRuleSettings(); + } + + /** + * Returns the builder for the settings used for calls to listForwardingRules. + */ + public PagedCallSettings.Builder listForwardingRulesSettings() { + return getStubSettingsBuilder().listForwardingRulesSettings(); + } + + /** + * Returns the builder for the settings used for calls to setTargetForwardingRule. + */ + public UnaryCallSettings.Builder setTargetForwardingRuleSettings() { + return getStubSettingsBuilder().setTargetForwardingRuleSettings(); + } + + @Override + public ForwardingRuleSettings build() throws IOException { + return new ForwardingRuleSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java new file mode 100644 index 000000000000..21c06d5b9119 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ForwardingRulesScopedList implements ApiMessage { + private final List forwardingRules; + private final Warning warning; + + private ForwardingRulesScopedList() { + this.forwardingRules = null; + this.warning = null; + } + + + private ForwardingRulesScopedList( + List forwardingRules, + Warning warning + ) { + this.forwardingRules = forwardingRules; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("forwardingRules") && forwardingRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ForwardingRule item : forwardingRules) { + stringList.add(item.toString()); + } + fieldMap.put("forwardingRules", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("forwardingRules")) { + return String.valueOf(forwardingRules); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getForwardingRulesList() { + return forwardingRules; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ForwardingRulesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ForwardingRulesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ForwardingRulesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ForwardingRulesScopedList(); + } + + public static class Builder { + private List forwardingRules; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(ForwardingRulesScopedList other) { + if (other == ForwardingRulesScopedList.getDefaultInstance()) return this; + if (other.getForwardingRulesList() != null) { + this.forwardingRules = other.forwardingRules; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(ForwardingRulesScopedList source) { + this.forwardingRules = source.forwardingRules; + this.warning = source.warning; + } + + public List getForwardingRulesList() { + return forwardingRules; + } + + public Builder addAllForwardingRules(List forwardingRules) { + if (this.forwardingRules == null) { + this.forwardingRules = new ArrayList<>(forwardingRules.size()); + } + this.forwardingRules.addAll(forwardingRules); + return this; + } + + public Builder addForwardingRules(ForwardingRule forwardingRules) { + this.forwardingRules.add(forwardingRules); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public ForwardingRulesScopedList build() { + + return new ForwardingRulesScopedList( + forwardingRules, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllForwardingRules(this.forwardingRules); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "ForwardingRulesScopedList{" + + "forwardingRules=" + forwardingRules + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ForwardingRulesScopedList) { + ForwardingRulesScopedList that = (ForwardingRulesScopedList) o; + return + Objects.equals(this.forwardingRules, that.getForwardingRulesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + forwardingRules, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java new file mode 100644 index 000000000000..ae8f674b2faf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetAddressHttpRequest implements ApiMessage { + private final String access_token; + private final String address; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetAddressHttpRequest() { + this.access_token = null; + this.address = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetAddressHttpRequest( + String access_token, + String address, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.address = address; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("address")) { + return String.valueOf(address); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAddress() { + return address; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetAddressHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetAddressHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetAddressHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetAddressHttpRequest(); + } + + public static class Builder { + private String access_token; + private String address; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetAddressHttpRequest other) { + if (other == GetAddressHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAddress() != null) { + this.address = other.address; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetAddressHttpRequest source) { + this.access_token = source.access_token; + this.address = source.address; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAddress() { + return address; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetAddressHttpRequest build() { + String missing = ""; + + if (address == null) { + missing += " address"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetAddressHttpRequest( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAddress(this.address); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetAddressHttpRequest{" + + "access_token=" + access_token + ", " + + "address=" + address + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetAddressHttpRequest) { + GetAddressHttpRequest that = (GetAddressHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java new file mode 100644 index 000000000000..7434bae2114c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetAutoscalerHttpRequest( + String access_token, + String autoscaler, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetAutoscalerHttpRequest other) { + if (other == GetAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetAutoscalerHttpRequest build() { + String missing = ""; + + if (autoscaler == null) { + missing += " autoscaler"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetAutoscalerHttpRequest( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetAutoscalerHttpRequest) { + GetAutoscalerHttpRequest that = (GetAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java new file mode 100644 index 000000000000..3ecfe8e20cf6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetBackendServiceHttpRequest( + String access_token, + String backendService, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetBackendServiceHttpRequest other) { + if (other == GetBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetBackendServiceHttpRequest( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetBackendServiceHttpRequest) { + GetBackendServiceHttpRequest that = (GetBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java new file mode 100644 index 000000000000..621e43321bbd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetDiskHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetDiskHttpRequest other) { + if (other == GetDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetDiskHttpRequest build() { + String missing = ""; + + + if (disk == null) { + missing += " disk"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetDiskHttpRequest( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetDiskHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "disk=" + disk + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetDiskHttpRequest) { + GetDiskHttpRequest that = (GetDiskHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.disk, that.getDisk()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java new file mode 100644 index 000000000000..d3690c707115 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetDiskTypeHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String diskType; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetDiskTypeHttpRequest() { + this.access_token = null; + this.callback = null; + this.diskType = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetDiskTypeHttpRequest( + String access_token, + String callback, + String diskType, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.diskType = diskType; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskType") && diskType != null) { + fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("diskType")) { + return String.valueOf(diskType); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDiskType() { + return diskType; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetDiskTypeHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetDiskTypeHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetDiskTypeHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetDiskTypeHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String diskType; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetDiskTypeHttpRequest other) { + if (other == GetDiskTypeHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDiskType() != null) { + this.diskType = other.diskType; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetDiskTypeHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.diskType = source.diskType; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDiskType() { + return diskType; + } + + public Builder setDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetDiskTypeHttpRequest build() { + String missing = ""; + + + if (diskType == null) { + missing += " diskType"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetDiskTypeHttpRequest( + access_token, + callback, + diskType, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDiskType(this.diskType); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetDiskTypeHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "diskType=" + diskType + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetDiskTypeHttpRequest) { + GetDiskTypeHttpRequest that = (GetDiskTypeHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.diskType, that.getDiskType()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + diskType, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java new file mode 100644 index 000000000000..8c65512d533d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetFirewallHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String firewall; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetFirewallHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.firewall = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetFirewallHttpRequest( + String access_token, + String callback, + String fields, + String firewall, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.firewall = firewall; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("firewall")) { + return String.valueOf(firewall); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFirewall() { + return firewall; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetFirewallHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetFirewallHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetFirewallHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetFirewallHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String firewall; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetFirewallHttpRequest other) { + if (other == GetFirewallHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFirewall() != null) { + this.firewall = other.firewall; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetFirewallHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.firewall = source.firewall; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFirewall() { + return firewall; + } + + public Builder setFirewall(String firewall) { + this.firewall = firewall; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetFirewallHttpRequest build() { + String missing = ""; + + + + if (firewall == null) { + missing += " firewall"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetFirewallHttpRequest( + access_token, + callback, + fields, + firewall, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFirewall(this.firewall); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetFirewallHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "firewall=" + firewall + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetFirewallHttpRequest) { + GetFirewallHttpRequest that = (GetFirewallHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.firewall, that.getFirewall()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + firewall, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..6b4853924411 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String forwardingRule; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRule = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + String forwardingRule, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRule = forwardingRule; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRule")) { + return String.valueOf(forwardingRule); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String forwardingRule; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetForwardingRuleHttpRequest other) { + if (other == GetForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRule() != null) { + this.forwardingRule = other.forwardingRule; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRule = source.forwardingRule; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetForwardingRuleHttpRequest build() { + String missing = ""; + + + + if (forwardingRule == null) { + missing += " forwardingRule"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRule(this.forwardingRule); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRule=" + forwardingRule + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetForwardingRuleHttpRequest) { + GetForwardingRuleHttpRequest that = (GetForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java new file mode 100644 index 000000000000..df6eba7e6001 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetFromFamilyImageHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String family; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetFromFamilyImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.family = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetFromFamilyImageHttpRequest( + String access_token, + String callback, + String family, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.family = family; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("family") && family != null) { + fieldMap.put("family", Collections.singletonList(String.valueOf(family))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("family")) { + return String.valueOf(family); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFamily() { + return family; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetFromFamilyImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetFromFamilyImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetFromFamilyImageHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetFromFamilyImageHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String family; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetFromFamilyImageHttpRequest other) { + if (other == GetFromFamilyImageHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFamily() != null) { + this.family = other.family; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetFromFamilyImageHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.family = source.family; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFamily() { + return family; + } + + public Builder setFamily(String family) { + this.family = family; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetFromFamilyImageHttpRequest build() { + String missing = ""; + + + if (family == null) { + missing += " family"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetFromFamilyImageHttpRequest( + access_token, + callback, + family, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFamily(this.family); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetFromFamilyImageHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "family=" + family + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetFromFamilyImageHttpRequest) { + GetFromFamilyImageHttpRequest that = (GetFromFamilyImageHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.family, that.getFamily()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + family, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java new file mode 100644 index 000000000000..efc91ea85a21 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetGlobalAddressHttpRequest implements ApiMessage { + private final String access_token; + private final String address; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetGlobalAddressHttpRequest() { + this.access_token = null; + this.address = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetGlobalAddressHttpRequest( + String access_token, + String address, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.address = address; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("address")) { + return String.valueOf(address); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAddress() { + return address; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetGlobalAddressHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetGlobalAddressHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetGlobalAddressHttpRequest(); + } + + public static class Builder { + private String access_token; + private String address; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetGlobalAddressHttpRequest other) { + if (other == GetGlobalAddressHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAddress() != null) { + this.address = other.address; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetGlobalAddressHttpRequest source) { + this.access_token = source.access_token; + this.address = source.address; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAddress() { + return address; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetGlobalAddressHttpRequest build() { + String missing = ""; + + if (address == null) { + missing += " address"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetGlobalAddressHttpRequest( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAddress(this.address); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetGlobalAddressHttpRequest{" + + "access_token=" + access_token + ", " + + "address=" + address + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetGlobalAddressHttpRequest) { + GetGlobalAddressHttpRequest that = (GetGlobalAddressHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + address, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..0f0c9865cd9a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetGlobalForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String forwardingRule; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetGlobalForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRule = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetGlobalForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + String forwardingRule, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRule = forwardingRule; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRule")) { + return String.valueOf(forwardingRule); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetGlobalForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetGlobalForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetGlobalForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String forwardingRule; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetGlobalForwardingRuleHttpRequest other) { + if (other == GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRule() != null) { + this.forwardingRule = other.forwardingRule; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetGlobalForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRule = source.forwardingRule; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetGlobalForwardingRuleHttpRequest build() { + String missing = ""; + + + + if (forwardingRule == null) { + missing += " forwardingRule"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetGlobalForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRule(this.forwardingRule); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetGlobalForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRule=" + forwardingRule + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetGlobalForwardingRuleHttpRequest) { + GetGlobalForwardingRuleHttpRequest that = (GetGlobalForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java new file mode 100644 index 000000000000..463218134782 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetGlobalOperationHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String operation; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetGlobalOperationHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.operation = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetGlobalOperationHttpRequest( + String access_token, + String callback, + String fields, + String key, + String operation, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.operation = operation; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("operation")) { + return String.valueOf(operation); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getOperation() { + return operation; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetGlobalOperationHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetGlobalOperationHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetGlobalOperationHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetGlobalOperationHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String operation; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetGlobalOperationHttpRequest other) { + if (other == GetGlobalOperationHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperation() != null) { + this.operation = other.operation; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetGlobalOperationHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.operation = source.operation; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperation() { + return operation; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetGlobalOperationHttpRequest build() { + String missing = ""; + + + + + if (operation == null) { + missing += " operation"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetGlobalOperationHttpRequest( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setOperation(this.operation); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetGlobalOperationHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "operation=" + operation + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetGlobalOperationHttpRequest) { + GetGlobalOperationHttpRequest that = (GetGlobalOperationHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java new file mode 100644 index 000000000000..515d63d69685 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetHealthBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final ResourceGroupReference resourceGroupReferenceResource; + private final String userIp; + + private GetHealthBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resourceGroupReferenceResource = null; + this.userIp = null; + } + + + private GetHealthBackendServiceHttpRequest( + String access_token, + String backendService, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + ResourceGroupReference resourceGroupReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resourceGroupReferenceResource = resourceGroupReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resourceGroupReferenceResource") && resourceGroupReferenceResource != null) { + fieldMap.put("resourceGroupReferenceResource", Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("resourceGroupReferenceResource")) { + return String.valueOf(resourceGroupReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ResourceGroupReference getApiMessageRequestBody() { + return resourceGroupReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public ResourceGroupReference getResourceGroupReferenceResource() { + return resourceGroupReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetHealthBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetHealthBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetHealthBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetHealthBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private ResourceGroupReference resourceGroupReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetHealthBackendServiceHttpRequest other) { + if (other == GetHealthBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getResourceGroupReferenceResource() != null) { + this.resourceGroupReferenceResource = other.resourceGroupReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetHealthBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resourceGroupReferenceResource = source.resourceGroupReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public ResourceGroupReference getResourceGroupReferenceResource() { + return resourceGroupReferenceResource; + } + + public Builder setResourceGroupReferenceResource(ResourceGroupReference resourceGroupReferenceResource) { + this.resourceGroupReferenceResource = resourceGroupReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetHealthBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetHealthBackendServiceHttpRequest( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResourceGroupReferenceResource(this.resourceGroupReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetHealthBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "resourceGroupReferenceResource=" + resourceGroupReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetHealthBackendServiceHttpRequest) { + GetHealthBackendServiceHttpRequest that = (GetHealthBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.resourceGroupReferenceResource, that.getResourceGroupReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java new file mode 100644 index 000000000000..7325dc49853a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String healthCheck; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.healthCheck = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String healthCheck, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.healthCheck = healthCheck; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("healthCheck")) { + return String.valueOf(healthCheck); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHealthCheck() { + return healthCheck; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String healthCheck; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetHealthCheckHttpRequest other) { + if (other == GetHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHealthCheck() != null) { + this.healthCheck = other.healthCheck; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.healthCheck = source.healthCheck; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHealthCheck() { + return healthCheck; + } + + public Builder setHealthCheck(String healthCheck) { + this.healthCheck = healthCheck; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetHealthCheckHttpRequest build() { + String missing = ""; + + + + if (healthCheck == null) { + missing += " healthCheck"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetHealthCheckHttpRequest( + access_token, + callback, + fields, + healthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHealthCheck(this.healthCheck); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "healthCheck=" + healthCheck + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetHealthCheckHttpRequest) { + GetHealthCheckHttpRequest that = (GetHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.healthCheck, that.getHealthCheck()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + healthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java new file mode 100644 index 000000000000..7f88880bf242 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetHealthRegionBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final ResourceGroupReference resourceGroupReferenceResource; + private final String userIp; + + private GetHealthRegionBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resourceGroupReferenceResource = null; + this.userIp = null; + } + + + private GetHealthRegionBackendServiceHttpRequest( + String access_token, + String backendService, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + ResourceGroupReference resourceGroupReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resourceGroupReferenceResource = resourceGroupReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resourceGroupReferenceResource") && resourceGroupReferenceResource != null) { + fieldMap.put("resourceGroupReferenceResource", Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("resourceGroupReferenceResource")) { + return String.valueOf(resourceGroupReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ResourceGroupReference getApiMessageRequestBody() { + return resourceGroupReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public ResourceGroupReference getResourceGroupReferenceResource() { + return resourceGroupReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetHealthRegionBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetHealthRegionBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetHealthRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetHealthRegionBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private ResourceGroupReference resourceGroupReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetHealthRegionBackendServiceHttpRequest other) { + if (other == GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getResourceGroupReferenceResource() != null) { + this.resourceGroupReferenceResource = other.resourceGroupReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetHealthRegionBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resourceGroupReferenceResource = source.resourceGroupReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public ResourceGroupReference getResourceGroupReferenceResource() { + return resourceGroupReferenceResource; + } + + public Builder setResourceGroupReferenceResource(ResourceGroupReference resourceGroupReferenceResource) { + this.resourceGroupReferenceResource = resourceGroupReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetHealthRegionBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetHealthRegionBackendServiceHttpRequest( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResourceGroupReferenceResource(this.resourceGroupReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetHealthRegionBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "resourceGroupReferenceResource=" + resourceGroupReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetHealthRegionBackendServiceHttpRequest) { + GetHealthRegionBackendServiceHttpRequest that = (GetHealthRegionBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.resourceGroupReferenceResource, that.getResourceGroupReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java new file mode 100644 index 000000000000..916478cf37d1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetHealthTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InstanceReference instanceReferenceResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final String userIp; + + private GetHealthTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceReferenceResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.userIp = null; + } + + + private GetHealthTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + InstanceReference instanceReferenceResource, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceReferenceResource = instanceReferenceResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceReferenceResource") && instanceReferenceResource != null) { + fieldMap.put("instanceReferenceResource", Collections.singletonList(String.valueOf(instanceReferenceResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceReferenceResource")) { + return String.valueOf(instanceReferenceResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceReference getApiMessageRequestBody() { + return instanceReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InstanceReference getInstanceReferenceResource() { + return instanceReferenceResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetHealthTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetHealthTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetHealthTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetHealthTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InstanceReference instanceReferenceResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetHealthTargetPoolHttpRequest other) { + if (other == GetHealthTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceReferenceResource() != null) { + this.instanceReferenceResource = other.instanceReferenceResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetHealthTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceReferenceResource = source.instanceReferenceResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InstanceReference getInstanceReferenceResource() { + return instanceReferenceResource; + } + + public Builder setInstanceReferenceResource(InstanceReference instanceReferenceResource) { + this.instanceReferenceResource = instanceReferenceResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetHealthTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetHealthTargetPoolHttpRequest( + access_token, + callback, + fields, + instanceReferenceResource, + key, + prettyPrint, + quotaUser, + targetPool, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceReferenceResource(this.instanceReferenceResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetHealthTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceReferenceResource=" + instanceReferenceResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetHealthTargetPoolHttpRequest) { + GetHealthTargetPoolHttpRequest that = (GetHealthTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceReferenceResource, that.getInstanceReferenceResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceReferenceResource, + key, + prettyPrint, + quotaUser, + targetPool, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java new file mode 100644 index 000000000000..5d4fef3c724c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetHttpHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpHealthCheck; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetHttpHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpHealthCheck = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetHttpHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpHealthCheck, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpHealthCheck = httpHealthCheck; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpHealthCheck")) { + return String.valueOf(httpHealthCheck); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetHttpHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetHttpHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetHttpHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpHealthCheck; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetHttpHealthCheckHttpRequest other) { + if (other == GetHttpHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpHealthCheck() != null) { + this.httpHealthCheck = other.httpHealthCheck; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetHttpHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpHealthCheck = source.httpHealthCheck; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public Builder setHttpHealthCheck(String httpHealthCheck) { + this.httpHealthCheck = httpHealthCheck; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetHttpHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpHealthCheck == null) { + missing += " httpHealthCheck"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetHttpHealthCheckHttpRequest( + access_token, + callback, + fields, + httpHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpHealthCheck(this.httpHealthCheck); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetHttpHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpHealthCheck=" + httpHealthCheck + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetHttpHealthCheckHttpRequest) { + GetHttpHealthCheckHttpRequest that = (GetHttpHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java new file mode 100644 index 000000000000..b8ae1b23a425 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetHttpsHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpsHealthCheck; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetHttpsHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpsHealthCheck = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetHttpsHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpsHealthCheck, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpsHealthCheck = httpsHealthCheck; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpsHealthCheck")) { + return String.valueOf(httpsHealthCheck); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetHttpsHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetHttpsHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetHttpsHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpsHealthCheck; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetHttpsHealthCheckHttpRequest other) { + if (other == GetHttpsHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpsHealthCheck() != null) { + this.httpsHealthCheck = other.httpsHealthCheck; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetHttpsHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpsHealthCheck = source.httpsHealthCheck; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public Builder setHttpsHealthCheck(String httpsHealthCheck) { + this.httpsHealthCheck = httpsHealthCheck; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetHttpsHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpsHealthCheck == null) { + missing += " httpsHealthCheck"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetHttpsHealthCheckHttpRequest( + access_token, + callback, + fields, + httpsHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetHttpsHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpsHealthCheck=" + httpsHealthCheck + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetHttpsHealthCheckHttpRequest) { + GetHttpsHealthCheckHttpRequest that = (GetHttpsHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpsHealthCheck, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java new file mode 100644 index 000000000000..0b87b479fd03 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetImageHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String image; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.image = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetImageHttpRequest( + String access_token, + String callback, + String fields, + String image, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.image = image; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("image") && image != null) { + fieldMap.put("image", Collections.singletonList(String.valueOf(image))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("image")) { + return String.valueOf(image); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getImage() { + return image; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetImageHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetImageHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String image; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetImageHttpRequest other) { + if (other == GetImageHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getImage() != null) { + this.image = other.image; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetImageHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.image = source.image; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getImage() { + return image; + } + + public Builder setImage(String image) { + this.image = image; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetImageHttpRequest build() { + String missing = ""; + + + + if (image == null) { + missing += " image"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetImageHttpRequest( + access_token, + callback, + fields, + image, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setImage(this.image); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetImageHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "image=" + image + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetImageHttpRequest) { + GetImageHttpRequest that = (GetImageHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.image, that.getImage()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + image, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..5f1271ff9b5c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetInstanceGroupHttpRequest other) { + if (other == GetInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetInstanceGroupHttpRequest) { + GetInstanceGroupHttpRequest that = (GetInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..a2c117fd32ec --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetInstanceGroupManagerHttpRequest other) { + if (other == GetInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetInstanceGroupManagerHttpRequest) { + GetInstanceGroupManagerHttpRequest that = (GetInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java new file mode 100644 index 000000000000..6fc34419fe86 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetInstanceHttpRequest other) { + if (other == GetInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetInstanceHttpRequest) { + GetInstanceHttpRequest that = (GetInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java new file mode 100644 index 000000000000..ba26f1095d46 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetInstanceTemplateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceTemplate; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetInstanceTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceTemplate = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetInstanceTemplateHttpRequest( + String access_token, + String callback, + String fields, + String instanceTemplate, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceTemplate = instanceTemplate; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetInstanceTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetInstanceTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetInstanceTemplateHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetInstanceTemplateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceTemplate; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetInstanceTemplateHttpRequest other) { + if (other == GetInstanceTemplateHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceTemplate() != null) { + this.instanceTemplate = other.instanceTemplate; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetInstanceTemplateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceTemplate = source.instanceTemplate; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetInstanceTemplateHttpRequest build() { + String missing = ""; + + + + if (instanceTemplate == null) { + missing += " instanceTemplate"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetInstanceTemplateHttpRequest( + access_token, + callback, + fields, + instanceTemplate, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceTemplate(this.instanceTemplate); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetInstanceTemplateHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceTemplate=" + instanceTemplate + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetInstanceTemplateHttpRequest) { + GetInstanceTemplateHttpRequest that = (GetInstanceTemplateHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceTemplate, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java new file mode 100644 index 000000000000..f59cbb63288d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetLicensHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String license; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetLicensHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.license = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetLicensHttpRequest( + String access_token, + String callback, + String fields, + String key, + String license, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.license = license; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("license") && license != null) { + fieldMap.put("license", Collections.singletonList(String.valueOf(license))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("license")) { + return String.valueOf(license); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getLicense() { + return license; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetLicensHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetLicensHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetLicensHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetLicensHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String license; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetLicensHttpRequest other) { + if (other == GetLicensHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getLicense() != null) { + this.license = other.license; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetLicensHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.license = source.license; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getLicense() { + return license; + } + + public Builder setLicense(String license) { + this.license = license; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetLicensHttpRequest build() { + String missing = ""; + + + + + if (license == null) { + missing += " license"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetLicensHttpRequest( + access_token, + callback, + fields, + key, + license, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setLicense(this.license); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetLicensHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "license=" + license + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetLicensHttpRequest) { + GetLicensHttpRequest that = (GetLicensHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.license, that.getLicense()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + license, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java new file mode 100644 index 000000000000..fd753f290575 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetMachineTypeHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String machineType; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetMachineTypeHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.machineType = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetMachineTypeHttpRequest( + String access_token, + String callback, + String fields, + String key, + String machineType, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.machineType = machineType; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("machineType")) { + return String.valueOf(machineType); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getMachineType() { + return machineType; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetMachineTypeHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetMachineTypeHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetMachineTypeHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetMachineTypeHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String machineType; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetMachineTypeHttpRequest other) { + if (other == GetMachineTypeHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMachineType() != null) { + this.machineType = other.machineType; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetMachineTypeHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.machineType = source.machineType; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getMachineType() { + return machineType; + } + + public Builder setMachineType(String machineType) { + this.machineType = machineType; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetMachineTypeHttpRequest build() { + String missing = ""; + + + + + if (machineType == null) { + missing += " machineType"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetMachineTypeHttpRequest( + access_token, + callback, + fields, + key, + machineType, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setMachineType(this.machineType); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetMachineTypeHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "machineType=" + machineType + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetMachineTypeHttpRequest) { + GetMachineTypeHttpRequest that = (GetMachineTypeHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.machineType, that.getMachineType()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + machineType, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java new file mode 100644 index 000000000000..b45b347c3644 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String network; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.network = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String network, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.network = network; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNetwork() { + return network; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String network; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetNetworkHttpRequest other) { + if (other == GetNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.network = source.network; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetNetworkHttpRequest build() { + String missing = ""; + + + + + if (network == null) { + missing += " network"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetNetworkHttpRequest( + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetwork(this.network); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetNetworkHttpRequest) { + GetNetworkHttpRequest that = (GetNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java new file mode 100644 index 000000000000..4adb4bc34121 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private GetProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetProjectHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetProjectHttpRequest other) { + if (other == GetProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetProjectHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetProjectHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetProjectHttpRequest) { + GetProjectHttpRequest that = (GetProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java new file mode 100644 index 000000000000..f9e4ca853a0d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetRegionAutoscalerHttpRequest( + String access_token, + String autoscaler, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRegionAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRegionAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionAutoscalerHttpRequest other) { + if (other == GetRegionAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRegionAutoscalerHttpRequest build() { + String missing = ""; + + if (autoscaler == null) { + missing += " autoscaler"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionAutoscalerHttpRequest( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionAutoscalerHttpRequest) { + GetRegionAutoscalerHttpRequest that = (GetRegionAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java new file mode 100644 index 000000000000..e57a7e3febd6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetRegionBackendServiceHttpRequest( + String access_token, + String backendService, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRegionBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRegionBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionBackendServiceHttpRequest other) { + if (other == GetRegionBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRegionBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionBackendServiceHttpRequest( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionBackendServiceHttpRequest) { + GetRegionBackendServiceHttpRequest that = (GetRegionBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java new file mode 100644 index 000000000000..a00910597f70 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private GetRegionHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private GetRegionHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRegionHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRegionHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRegionHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionHttpRequest other) { + if (other == GetRegionHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRegionHttpRequest build() { + String missing = ""; + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionHttpRequest) { + GetRegionHttpRequest that = (GetRegionHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..dc8795624c12 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetRegionInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRegionInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRegionInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRegionInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionInstanceGroupHttpRequest other) { + if (other == GetRegionInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRegionInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionInstanceGroupHttpRequest) { + GetRegionInstanceGroupHttpRequest that = (GetRegionInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..8d491533e2a8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionInstanceGroupManagerHttpRequest other) { + if (other == GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionInstanceGroupManagerHttpRequest) { + GetRegionInstanceGroupManagerHttpRequest that = (GetRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java new file mode 100644 index 000000000000..4988e19f8288 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionOperationHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String operation; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionOperationHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.operation = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetRegionOperationHttpRequest( + String access_token, + String callback, + String fields, + String key, + String operation, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.operation = operation; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("operation")) { + return String.valueOf(operation); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getOperation() { + return operation; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRegionOperationHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionOperationHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRegionOperationHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRegionOperationHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String operation; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionOperationHttpRequest other) { + if (other == GetRegionOperationHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperation() != null) { + this.operation = other.operation; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionOperationHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.operation = source.operation; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperation() { + return operation; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRegionOperationHttpRequest build() { + String missing = ""; + + + + + if (operation == null) { + missing += " operation"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionOperationHttpRequest( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setOperation(this.operation); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionOperationHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "operation=" + operation + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionOperationHttpRequest) { + GetRegionOperationHttpRequest that = (GetRegionOperationHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java new file mode 100644 index 000000000000..863e7b936ed2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRouteHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String route; + private final String userIp; + + private GetRouteHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.route = null; + this.userIp = null; + } + + + private GetRouteHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String route, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.route = route; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("route") && route != null) { + fieldMap.put("route", Collections.singletonList(String.valueOf(route))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("route")) { + return String.valueOf(route); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRoute() { + return route; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRouteHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRouteHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRouteHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRouteHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String route; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRouteHttpRequest other) { + if (other == GetRouteHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRoute() != null) { + this.route = other.route; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRouteHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.route = source.route; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRoute() { + return route; + } + + public Builder setRoute(String route) { + this.route = route; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRouteHttpRequest build() { + String missing = ""; + + + + + + + if (route == null) { + missing += " route"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRouteHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + route, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRoute(this.route); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRouteHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "route=" + route + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRouteHttpRequest) { + GetRouteHttpRequest that = (GetRouteHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.route, that.getRoute()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + route, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java new file mode 100644 index 000000000000..e921d4f6dea3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String router; + private final String userIp; + + private GetRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.router = null; + this.userIp = null; + } + + + private GetRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String router, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.router = router; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRouter() { + return router; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String router; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRouterHttpRequest other) { + if (other == GetRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.router = source.router; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRouterHttpRequest build() { + String missing = ""; + + + + + + + if (router == null) { + missing += " router"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouter(this.router); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "router=" + router + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRouterHttpRequest) { + GetRouterHttpRequest that = (GetRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java new file mode 100644 index 000000000000..889d4c16a038 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRouterStatusRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String router; + private final String userIp; + + private GetRouterStatusRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.router = null; + this.userIp = null; + } + + + private GetRouterStatusRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String router, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.router = router; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRouter() { + return router; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetRouterStatusRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRouterStatusRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetRouterStatusRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetRouterStatusRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String router; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRouterStatusRouterHttpRequest other) { + if (other == GetRouterStatusRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRouterStatusRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.router = source.router; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetRouterStatusRouterHttpRequest build() { + String missing = ""; + + + + + + + if (router == null) { + missing += " router"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRouterStatusRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouter(this.router); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRouterStatusRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "router=" + router + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRouterStatusRouterHttpRequest) { + GetRouterStatusRouterHttpRequest that = (GetRouterStatusRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java new file mode 100644 index 000000000000..5eec44a0167d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetSerialPortOutputInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final Integer port; + private final String prettyPrint; + private final String quotaUser; + private final String start; + private final String userIp; + + private GetSerialPortOutputInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.port = null; + this.prettyPrint = null; + this.quotaUser = null; + this.start = null; + this.userIp = null; + } + + + private GetSerialPortOutputInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + Integer port, + String prettyPrint, + String quotaUser, + String start, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.port = port; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.start = start; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("start") && start != null) { + fieldMap.put("start", Collections.singletonList(String.valueOf(start))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("start")) { + return String.valueOf(start); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public Integer getPort() { + return port; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getStart() { + return start; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetSerialPortOutputInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetSerialPortOutputInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetSerialPortOutputInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetSerialPortOutputInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private Integer port; + private String prettyPrint; + private String quotaUser; + private String start; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetSerialPortOutputInstanceHttpRequest other) { + if (other == GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getStart() != null) { + this.start = other.start; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetSerialPortOutputInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.port = source.port; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.start = source.start; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getStart() { + return start; + } + + public Builder setStart(String start) { + this.start = start; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetSerialPortOutputInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetSerialPortOutputInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + port, + prettyPrint, + quotaUser, + start, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPort(this.port); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setStart(this.start); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetSerialPortOutputInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "port=" + port + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "start=" + start + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetSerialPortOutputInstanceHttpRequest) { + GetSerialPortOutputInstanceHttpRequest that = (GetSerialPortOutputInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.start, that.getStart()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + port, + prettyPrint, + quotaUser, + start, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java new file mode 100644 index 000000000000..cef8f1598984 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetSnapshotHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String snapshot; + private final String userIp; + + private GetSnapshotHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.snapshot = null; + this.userIp = null; + } + + + private GetSnapshotHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String snapshot, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.snapshot = snapshot; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("snapshot") && snapshot != null) { + fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("snapshot")) { + return String.valueOf(snapshot); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSnapshot() { + return snapshot; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetSnapshotHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetSnapshotHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetSnapshotHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetSnapshotHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String snapshot; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetSnapshotHttpRequest other) { + if (other == GetSnapshotHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSnapshot() != null) { + this.snapshot = other.snapshot; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetSnapshotHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.snapshot = source.snapshot; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSnapshot() { + return snapshot; + } + + public Builder setSnapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetSnapshotHttpRequest build() { + String missing = ""; + + + + + + + if (snapshot == null) { + missing += " snapshot"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetSnapshotHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + snapshot, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSnapshot(this.snapshot); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetSnapshotHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "snapshot=" + snapshot + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetSnapshotHttpRequest) { + GetSnapshotHttpRequest that = (GetSnapshotHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.snapshot, that.getSnapshot()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + snapshot, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java new file mode 100644 index 000000000000..77122017824b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetSslCertificateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String sslCertificate; + private final String userIp; + + private GetSslCertificateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.sslCertificate = null; + this.userIp = null; + } + + + private GetSslCertificateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String sslCertificate, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.sslCertificate = sslCertificate; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sslCertificate") && sslCertificate != null) { + fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("sslCertificate")) { + return String.valueOf(sslCertificate); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSslCertificate() { + return sslCertificate; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetSslCertificateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetSslCertificateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetSslCertificateHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetSslCertificateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String sslCertificate; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetSslCertificateHttpRequest other) { + if (other == GetSslCertificateHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSslCertificate() != null) { + this.sslCertificate = other.sslCertificate; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetSslCertificateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.sslCertificate = source.sslCertificate; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSslCertificate() { + return sslCertificate; + } + + public Builder setSslCertificate(String sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetSslCertificateHttpRequest build() { + String missing = ""; + + + + + + + if (sslCertificate == null) { + missing += " sslCertificate"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetSslCertificateHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + sslCertificate, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSslCertificate(this.sslCertificate); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetSslCertificateHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "sslCertificate=" + sslCertificate + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetSslCertificateHttpRequest) { + GetSslCertificateHttpRequest that = (GetSslCertificateHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.sslCertificate, that.getSslCertificate()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + sslCertificate, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java new file mode 100644 index 000000000000..5f1a1e6bb172 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetSubnetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String subnetwork; + private final String userIp; + + private GetSubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.subnetwork = null; + this.userIp = null; + } + + + private GetSubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String subnetwork, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.subnetwork = subnetwork; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSubnetwork() { + return subnetwork; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetSubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetSubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetSubnetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetSubnetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String subnetwork; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetSubnetworkHttpRequest other) { + if (other == GetSubnetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetSubnetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.subnetwork = source.subnetwork; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetSubnetworkHttpRequest build() { + String missing = ""; + + + + + + + if (subnetwork == null) { + missing += " subnetwork"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetSubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + subnetwork, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSubnetwork(this.subnetwork); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetSubnetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "subnetwork=" + subnetwork + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetSubnetworkHttpRequest) { + GetSubnetworkHttpRequest that = (GetSubnetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + subnetwork, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java new file mode 100644 index 000000000000..99ecd8f5c346 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetTargetHttpProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetHttpProxy; + private final String userIp; + + private GetTargetHttpProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpProxy = null; + this.userIp = null; + } + + + private GetTargetHttpProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetHttpProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpProxy = targetHttpProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { + fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpProxy")) { + return String.valueOf(targetHttpProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetTargetHttpProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetTargetHttpProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetTargetHttpProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetHttpProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetTargetHttpProxyHttpRequest other) { + if (other == GetTargetHttpProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpProxy() != null) { + this.targetHttpProxy = other.targetHttpProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetTargetHttpProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpProxy = source.targetHttpProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public Builder setTargetHttpProxy(String targetHttpProxy) { + this.targetHttpProxy = targetHttpProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetTargetHttpProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetHttpProxy == null) { + missing += " targetHttpProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetTargetHttpProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpProxy(this.targetHttpProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetTargetHttpProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpProxy=" + targetHttpProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetTargetHttpProxyHttpRequest) { + GetTargetHttpProxyHttpRequest that = (GetTargetHttpProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..4fa049faeb9b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetHttpsProxy; + private final String userIp; + + private GetTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpsProxy = null; + this.userIp = null; + } + + + private GetTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetHttpsProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpsProxy = targetHttpsProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpsProxy")) { + return String.valueOf(targetHttpsProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetHttpsProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetTargetHttpsProxyHttpRequest other) { + if (other == GetTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpsProxy() != null) { + this.targetHttpsProxy = other.targetHttpsProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpsProxy = source.targetHttpsProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetTargetHttpsProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetHttpsProxy == null) { + missing += " targetHttpsProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetTargetHttpsProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpsProxy=" + targetHttpsProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetTargetHttpsProxyHttpRequest) { + GetTargetHttpsProxyHttpRequest that = (GetTargetHttpsProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java new file mode 100644 index 000000000000..827f3f8ccdbb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetTargetInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetInstance; + private final String userIp; + + private GetTargetInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetInstance = null; + this.userIp = null; + } + + + private GetTargetInstanceHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetInstance, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetInstance = targetInstance; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetInstance") && targetInstance != null) { + fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetInstance")) { + return String.valueOf(targetInstance); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetInstance() { + return targetInstance; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetTargetInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetTargetInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetTargetInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetTargetInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetInstance; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetTargetInstanceHttpRequest other) { + if (other == GetTargetInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetInstance() != null) { + this.targetInstance = other.targetInstance; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetTargetInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetInstance = source.targetInstance; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetInstance() { + return targetInstance; + } + + public Builder setTargetInstance(String targetInstance) { + this.targetInstance = targetInstance; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetTargetInstanceHttpRequest build() { + String missing = ""; + + + + + + + if (targetInstance == null) { + missing += " targetInstance"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetTargetInstanceHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetInstance, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetInstance(this.targetInstance); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetTargetInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetInstance=" + targetInstance + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetTargetInstanceHttpRequest) { + GetTargetInstanceHttpRequest that = (GetTargetInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetInstance, that.getTargetInstance()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetInstance, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java new file mode 100644 index 000000000000..2abcff9f7549 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final String userIp; + + private GetTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.userIp = null; + } + + + private GetTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetTargetPoolHttpRequest other) { + if (other == GetTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetTargetPoolHttpRequest) { + GetTargetPoolHttpRequest that = (GetTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..867a3b23a0ff --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetSslProxy; + private final String userIp; + + private GetTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetSslProxy = null; + this.userIp = null; + } + + + private GetTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetSslProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetSslProxy = targetSslProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetSslProxy")) { + return String.valueOf(targetSslProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetSslProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetTargetSslProxyHttpRequest other) { + if (other == GetTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetSslProxy() != null) { + this.targetSslProxy = other.targetSslProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetSslProxy = source.targetSslProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetTargetSslProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetSslProxy == null) { + missing += " targetSslProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetSslProxy(this.targetSslProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetTargetSslProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetSslProxy=" + targetSslProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetTargetSslProxyHttpRequest) { + GetTargetSslProxyHttpRequest that = (GetTargetSslProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java new file mode 100644 index 000000000000..16eadbdeb109 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetTargetVpnGatewayHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetVpnGateway; + private final String userIp; + + private GetTargetVpnGatewayHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetVpnGateway = null; + this.userIp = null; + } + + + private GetTargetVpnGatewayHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetVpnGateway, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetVpnGateway = targetVpnGateway; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { + fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetVpnGateway")) { + return String.valueOf(targetVpnGateway); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetTargetVpnGatewayHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetTargetVpnGatewayHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetTargetVpnGatewayHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetTargetVpnGatewayHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetVpnGateway; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetTargetVpnGatewayHttpRequest other) { + if (other == GetTargetVpnGatewayHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetVpnGateway() != null) { + this.targetVpnGateway = other.targetVpnGateway; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetTargetVpnGatewayHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetVpnGateway = source.targetVpnGateway; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + public Builder setTargetVpnGateway(String targetVpnGateway) { + this.targetVpnGateway = targetVpnGateway; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetTargetVpnGatewayHttpRequest build() { + String missing = ""; + + + + + + + if (targetVpnGateway == null) { + missing += " targetVpnGateway"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetTargetVpnGatewayHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetVpnGateway, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetVpnGateway(this.targetVpnGateway); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetTargetVpnGatewayHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetVpnGateway=" + targetVpnGateway + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetTargetVpnGatewayHttpRequest) { + GetTargetVpnGatewayHttpRequest that = (GetTargetVpnGatewayHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetVpnGateway, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java new file mode 100644 index 000000000000..44b7e0624e8d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String urlMap; + private final String userIp; + + private GetUrlMapHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.urlMap = null; + this.userIp = null; + } + + + private GetUrlMapHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String urlMap, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.urlMap = urlMap; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUrlMap() { + return urlMap; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String urlMap; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetUrlMapHttpRequest other) { + if (other == GetUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.urlMap = source.urlMap; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetUrlMapHttpRequest build() { + String missing = ""; + + + + + + + if (urlMap == null) { + missing += " urlMap"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetUrlMapHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMap(this.urlMap); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMap=" + urlMap + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetUrlMapHttpRequest) { + GetUrlMapHttpRequest that = (GetUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMap, that.getUrlMap()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java new file mode 100644 index 000000000000..be78c2e64d94 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetVpnTunnelHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String vpnTunnel; + + private GetVpnTunnelHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.vpnTunnel = null; + } + + + private GetVpnTunnelHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String vpnTunnel + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.vpnTunnel = vpnTunnel; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) { + fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("vpnTunnel")) { + return String.valueOf(vpnTunnel); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getVpnTunnel() { + return vpnTunnel; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetVpnTunnelHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetVpnTunnelHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetVpnTunnelHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String vpnTunnel; + + Builder() {} + + public Builder mergeFrom(GetVpnTunnelHttpRequest other) { + if (other == GetVpnTunnelHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getVpnTunnel() != null) { + this.vpnTunnel = other.vpnTunnel; + } + return this; + } + + Builder(GetVpnTunnelHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.vpnTunnel = source.vpnTunnel; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getVpnTunnel() { + return vpnTunnel; + } + + public Builder setVpnTunnel(String vpnTunnel) { + this.vpnTunnel = vpnTunnel; + return this; + } + + + public GetVpnTunnelHttpRequest build() { + String missing = ""; + + + + + + + + if (vpnTunnel == null) { + missing += " vpnTunnel"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetVpnTunnelHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + vpnTunnel + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setVpnTunnel(this.vpnTunnel); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetVpnTunnelHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "vpnTunnel=" + vpnTunnel + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetVpnTunnelHttpRequest) { + GetVpnTunnelHttpRequest that = (GetVpnTunnelHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.vpnTunnel, that.getVpnTunnel()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + vpnTunnel + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java new file mode 100644 index 000000000000..17619f09814b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetZoneHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private GetZoneHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private GetZoneHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetZoneHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetZoneHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetZoneHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetZoneHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(GetZoneHttpRequest other) { + if (other == GetZoneHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(GetZoneHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public GetZoneHttpRequest build() { + String missing = ""; + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetZoneHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetZoneHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetZoneHttpRequest) { + GetZoneHttpRequest that = (GetZoneHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java new file mode 100644 index 000000000000..5b7dc23b83c1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetZoneOperationHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String operation; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetZoneOperationHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.operation = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private GetZoneOperationHttpRequest( + String access_token, + String callback, + String fields, + String key, + String operation, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.operation = operation; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("operation")) { + return String.valueOf(operation); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getOperation() { + return operation; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GetZoneOperationHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetZoneOperationHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GetZoneOperationHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GetZoneOperationHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String operation; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetZoneOperationHttpRequest other) { + if (other == GetZoneOperationHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperation() != null) { + this.operation = other.operation; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetZoneOperationHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.operation = source.operation; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperation() { + return operation; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public GetZoneOperationHttpRequest build() { + String missing = ""; + + + + + if (operation == null) { + missing += " operation"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetZoneOperationHttpRequest( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setOperation(this.operation); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetZoneOperationHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "operation=" + operation + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetZoneOperationHttpRequest) { + GetZoneOperationHttpRequest that = (GetZoneOperationHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + operation, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java new file mode 100644 index 000000000000..6cf011ff3133 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java @@ -0,0 +1,716 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.GlobalAddressStub; +import com.google.cloud.compute.v1.stub.GlobalAddressStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+ *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+ *   Operation response = globalAddressClient.deleteGlobalAddress(address);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the globalAddressClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of GlobalAddressSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * GlobalAddressSettings globalAddressSettings =
+ *     GlobalAddressSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GlobalAddressClient globalAddressClient =
+ *     GlobalAddressClient.create(globalAddressSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * GlobalAddressSettings globalAddressSettings =
+ *     GlobalAddressSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GlobalAddressClient globalAddressClient =
+ *     GlobalAddressClient.create(globalAddressSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalAddressClient implements BackgroundResource { + private final GlobalAddressSettings settings; + private final GlobalAddressStub stub; + + + + /** + * Constructs an instance of GlobalAddressClient with default settings. + */ + public static final GlobalAddressClient create() throws IOException { + return create(GlobalAddressSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GlobalAddressClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final GlobalAddressClient create(GlobalAddressSettings settings) throws IOException { + return new GlobalAddressClient(settings); + } + + /** + * Constructs an instance of GlobalAddressClient, using the given stub for making calls. This is for + * advanced usage - prefer to use GlobalAddressSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final GlobalAddressClient create(GlobalAddressStub stub) { + return new GlobalAddressClient(stub); + } + + /** + * Constructs an instance of GlobalAddressClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GlobalAddressClient(GlobalAddressSettings settings) throws IOException { + this.settings = settings; + this.stub = ((GlobalAddressStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected GlobalAddressClient(GlobalAddressStub stub) { + this.settings = null; + this.stub = stub; + } + + public final GlobalAddressSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GlobalAddressStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   Operation response = globalAddressClient.deleteGlobalAddress(address);
+   * }
+   * 
+ * + * @param address Name of the address resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteGlobalAddress(ProjectAddressName address) { + + DeleteGlobalAddressHttpRequest request = + DeleteGlobalAddressHttpRequest.newBuilder() + .setAddress(address == null ? null : address.toString()) + .build(); + return deleteGlobalAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   Operation response = globalAddressClient.deleteGlobalAddress(address.toString());
+   * }
+   * 
+ * + * @param address Name of the address resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteGlobalAddress(String address) { + + DeleteGlobalAddressHttpRequest request = + DeleteGlobalAddressHttpRequest.newBuilder() + .setAddress(address) + .build(); + return deleteGlobalAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   Operation response = globalAddressClient.deleteGlobalAddress(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteGlobalAddress(DeleteGlobalAddressHttpRequest request) { + return deleteGlobalAddressCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified address resource. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = globalAddressClient.deleteGlobalAddressCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteGlobalAddressCallable() { + return stub.deleteGlobalAddressCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. Get a list of available addresses by making a list() request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   Address response = globalAddressClient.getGlobalAddress(address);
+   * }
+   * 
+ * + * @param address Name of the address resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Address getGlobalAddress(ProjectAddressName address) { + + GetGlobalAddressHttpRequest request = + GetGlobalAddressHttpRequest.newBuilder() + .setAddress(address == null ? null : address.toString()) + .build(); + return getGlobalAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. Get a list of available addresses by making a list() request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   Address response = globalAddressClient.getGlobalAddress(address.toString());
+   * }
+   * 
+ * + * @param address Name of the address resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Address getGlobalAddress(String address) { + + GetGlobalAddressHttpRequest request = + GetGlobalAddressHttpRequest.newBuilder() + .setAddress(address) + .build(); + return getGlobalAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. Get a list of available addresses by making a list() request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   GetGlobalAddressHttpRequest request = GetGlobalAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   Address response = globalAddressClient.getGlobalAddress(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Address getGlobalAddress(GetGlobalAddressHttpRequest request) { + return getGlobalAddressCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified address resource. Get a list of available addresses by making a list() request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   GetGlobalAddressHttpRequest request = GetGlobalAddressHttpRequest.newBuilder()
+   *     .setAddress(address.toString())
+   *     .build();
+   *   ApiFuture<Address> future = globalAddressClient.getGlobalAddressCallable().futureCall(request);
+   *   // Do something
+   *   Address response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getGlobalAddressCallable() { + return stub.getGlobalAddressCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   Operation response = globalAddressClient.insertGlobalAddress(project, addressResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param addressResource A reserved address resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertGlobalAddress(ProjectName project, Address addressResource) { + + InsertGlobalAddressHttpRequest request = + InsertGlobalAddressHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setAddressResource(addressResource) + .build(); + return insertGlobalAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   Operation response = globalAddressClient.insertGlobalAddress(project.toString(), addressResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param addressResource A reserved address resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertGlobalAddress(String project, Address addressResource) { + + InsertGlobalAddressHttpRequest request = + InsertGlobalAddressHttpRequest.newBuilder() + .setProject(project) + .setAddressResource(addressResource) + .build(); + return insertGlobalAddress(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setAddressResource(addressResource)
+   *     .build();
+   *   Operation response = globalAddressClient.insertGlobalAddress(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertGlobalAddress(InsertGlobalAddressHttpRequest request) { + return insertGlobalAddressCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an address resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Address addressResource = Address.newBuilder().build();
+   *   InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setAddressResource(addressResource)
+   *     .build();
+   *   ApiFuture<Operation> future = globalAddressClient.insertGlobalAddressCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertGlobalAddressCallable() { + return stub.insertGlobalAddressCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of global addresses. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Address element : globalAddressClient.listGlobalAddresses(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalAddressesPagedResponse listGlobalAddresses(ProjectName project) { + ListGlobalAddressesHttpRequest request = + ListGlobalAddressesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listGlobalAddresses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of global addresses. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Address element : globalAddressClient.listGlobalAddresses(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalAddressesPagedResponse listGlobalAddresses(String project) { + ListGlobalAddressesHttpRequest request = + ListGlobalAddressesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listGlobalAddresses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of global addresses. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalAddressesHttpRequest request = ListGlobalAddressesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Address element : globalAddressClient.listGlobalAddresses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalAddressesPagedResponse listGlobalAddresses(ListGlobalAddressesHttpRequest request) { + return listGlobalAddressesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of global addresses. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalAddressesHttpRequest request = ListGlobalAddressesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListGlobalAddressesPagedResponse> future = globalAddressClient.listGlobalAddressesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Address element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listGlobalAddressesPagedCallable() { + return stub.listGlobalAddressesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of global addresses. + * + * Sample code: + *

+   * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalAddressesHttpRequest request = ListGlobalAddressesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     AddressList response = globalAddressClient.listGlobalAddressesCallable().call(request);
+   *     for (Address element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listGlobalAddressesCallable() { + return stub.listGlobalAddressesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListGlobalAddressesPagedResponse extends AbstractPagedListResponse< + ListGlobalAddressesHttpRequest, + AddressList, + Address, + ListGlobalAddressesPage, + ListGlobalAddressesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListGlobalAddressesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListGlobalAddressesPagedResponse apply(ListGlobalAddressesPage input) { + return new ListGlobalAddressesPagedResponse(input); + } + }); + } + + private ListGlobalAddressesPagedResponse(ListGlobalAddressesPage page) { + super(page, ListGlobalAddressesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListGlobalAddressesPage extends AbstractPage< + ListGlobalAddressesHttpRequest, + AddressList, + Address, + ListGlobalAddressesPage> { + + private ListGlobalAddressesPage( + PageContext context, + AddressList response) { + super(context, response); + } + + private static ListGlobalAddressesPage createEmptyPage() { + return new ListGlobalAddressesPage(null, null); + } + + @Override + protected ListGlobalAddressesPage createPage( + PageContext context, + AddressList response) { + return new ListGlobalAddressesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListGlobalAddressesFixedSizeCollection extends AbstractFixedSizeCollection< + ListGlobalAddressesHttpRequest, + AddressList, + Address, + ListGlobalAddressesPage, + ListGlobalAddressesFixedSizeCollection> { + + private ListGlobalAddressesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListGlobalAddressesFixedSizeCollection createEmptyCollection() { + return new ListGlobalAddressesFixedSizeCollection(null, 0); + } + + @Override + protected ListGlobalAddressesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListGlobalAddressesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java new file mode 100644 index 000000000000..cf03a2bdfb41 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java @@ -0,0 +1,268 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import com.google.cloud.compute.v1.stub.GlobalAddressStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GlobalAddressClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteGlobalAddress to 30 seconds: + * + *

+ * 
+ * GlobalAddressSettings.Builder globalAddressSettingsBuilder =
+ *     GlobalAddressSettings.newBuilder();
+ * globalAddressSettingsBuilder.deleteGlobalAddressSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GlobalAddressSettings globalAddressSettings = globalAddressSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalAddressSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteGlobalAddress. + */ + public UnaryCallSettings deleteGlobalAddressSettings() { + return ((GlobalAddressStubSettings) getStubSettings()).deleteGlobalAddressSettings(); + } + + /** + * Returns the object with the settings used for calls to getGlobalAddress. + */ + public UnaryCallSettings getGlobalAddressSettings() { + return ((GlobalAddressStubSettings) getStubSettings()).getGlobalAddressSettings(); + } + + /** + * Returns the object with the settings used for calls to insertGlobalAddress. + */ + public UnaryCallSettings insertGlobalAddressSettings() { + return ((GlobalAddressStubSettings) getStubSettings()).insertGlobalAddressSettings(); + } + + /** + * Returns the object with the settings used for calls to listGlobalAddresses. + */ + public PagedCallSettings listGlobalAddressesSettings() { + return ((GlobalAddressStubSettings) getStubSettings()).listGlobalAddressesSettings(); + } + + + public static final GlobalAddressSettings create(GlobalAddressStubSettings stub) throws IOException { + return new GlobalAddressSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return GlobalAddressStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return GlobalAddressStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return GlobalAddressStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return GlobalAddressStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GlobalAddressStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return GlobalAddressStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return GlobalAddressStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GlobalAddressStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GlobalAddressSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for GlobalAddressSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(GlobalAddressStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(GlobalAddressStubSettings.newBuilder()); + } + + protected Builder(GlobalAddressSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(GlobalAddressStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public GlobalAddressStubSettings.Builder getStubSettingsBuilder() { + return ((GlobalAddressStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteGlobalAddress. + */ + public UnaryCallSettings.Builder deleteGlobalAddressSettings() { + return getStubSettingsBuilder().deleteGlobalAddressSettings(); + } + + /** + * Returns the builder for the settings used for calls to getGlobalAddress. + */ + public UnaryCallSettings.Builder getGlobalAddressSettings() { + return getStubSettingsBuilder().getGlobalAddressSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertGlobalAddress. + */ + public UnaryCallSettings.Builder insertGlobalAddressSettings() { + return getStubSettingsBuilder().insertGlobalAddressSettings(); + } + + /** + * Returns the builder for the settings used for calls to listGlobalAddresses. + */ + public PagedCallSettings.Builder listGlobalAddressesSettings() { + return getStubSettingsBuilder().listGlobalAddressesSettings(); + } + + @Override + public GlobalAddressSettings build() throws IOException { + return new GlobalAddressSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java new file mode 100644 index 000000000000..73765f550ec6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java @@ -0,0 +1,821 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStub; +import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+ *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+ *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the globalForwardingRuleClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of GlobalForwardingRuleSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * GlobalForwardingRuleSettings globalForwardingRuleSettings =
+ *     GlobalForwardingRuleSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GlobalForwardingRuleClient globalForwardingRuleClient =
+ *     GlobalForwardingRuleClient.create(globalForwardingRuleSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * GlobalForwardingRuleSettings globalForwardingRuleSettings =
+ *     GlobalForwardingRuleSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GlobalForwardingRuleClient globalForwardingRuleClient =
+ *     GlobalForwardingRuleClient.create(globalForwardingRuleSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalForwardingRuleClient implements BackgroundResource { + private final GlobalForwardingRuleSettings settings; + private final GlobalForwardingRuleStub stub; + + + + /** + * Constructs an instance of GlobalForwardingRuleClient with default settings. + */ + public static final GlobalForwardingRuleClient create() throws IOException { + return create(GlobalForwardingRuleSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GlobalForwardingRuleClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final GlobalForwardingRuleClient create(GlobalForwardingRuleSettings settings) throws IOException { + return new GlobalForwardingRuleClient(settings); + } + + /** + * Constructs an instance of GlobalForwardingRuleClient, using the given stub for making calls. This is for + * advanced usage - prefer to use GlobalForwardingRuleSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final GlobalForwardingRuleClient create(GlobalForwardingRuleStub stub) { + return new GlobalForwardingRuleClient(stub); + } + + /** + * Constructs an instance of GlobalForwardingRuleClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GlobalForwardingRuleClient(GlobalForwardingRuleSettings settings) throws IOException { + this.settings = settings; + this.stub = ((GlobalForwardingRuleStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected GlobalForwardingRuleClient(GlobalForwardingRuleStub stub) { + this.settings = null; + this.stub = stub; + } + + public final GlobalForwardingRuleSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GlobalForwardingRuleStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteGlobalForwardingRule(ProjectForwardingRuleName forwardingRule) { + + DeleteGlobalForwardingRuleHttpRequest request = + DeleteGlobalForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); + return deleteGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule.toString());
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteGlobalForwardingRule(String forwardingRule) { + + DeleteGlobalForwardingRuleHttpRequest request = + DeleteGlobalForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule) + .build(); + return deleteGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteGlobalForwardingRule(DeleteGlobalForwardingRuleHttpRequest request) { + return deleteGlobalForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = globalForwardingRuleClient.deleteGlobalForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteGlobalForwardingRuleCallable() { + return stub.deleteGlobalForwardingRuleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ForwardingRule response = globalForwardingRuleClient.getGlobalForwardingRule(forwardingRule);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ForwardingRule getGlobalForwardingRule(ProjectForwardingRuleName forwardingRule) { + + GetGlobalForwardingRuleHttpRequest request = + GetGlobalForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); + return getGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ForwardingRule response = globalForwardingRuleClient.getGlobalForwardingRule(forwardingRule.toString());
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ForwardingRule getGlobalForwardingRule(String forwardingRule) { + + GetGlobalForwardingRuleHttpRequest request = + GetGlobalForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule) + .build(); + return getGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   GetGlobalForwardingRuleHttpRequest request = GetGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   ForwardingRule response = globalForwardingRuleClient.getGlobalForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpRequest request) { + return getGlobalForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   GetGlobalForwardingRuleHttpRequest request = GetGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .build();
+   *   ApiFuture<ForwardingRule> future = globalForwardingRuleClient.getGlobalForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   ForwardingRule response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getGlobalForwardingRuleCallable() { + return stub.getGlobalForwardingRuleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(project, forwardingRuleResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertGlobalForwardingRule(ProjectName project, ForwardingRule forwardingRuleResource) { + + InsertGlobalForwardingRuleHttpRequest request = + InsertGlobalForwardingRuleHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setForwardingRuleResource(forwardingRuleResource) + .build(); + return insertGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(project.toString(), forwardingRuleResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertGlobalForwardingRule(String project, ForwardingRule forwardingRuleResource) { + + InsertGlobalForwardingRuleHttpRequest request = + InsertGlobalForwardingRuleHttpRequest.newBuilder() + .setProject(project) + .setForwardingRuleResource(forwardingRuleResource) + .build(); + return insertGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setForwardingRuleResource(forwardingRuleResource)
+   *     .build();
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertGlobalForwardingRule(InsertGlobalForwardingRuleHttpRequest request) { + return insertGlobalForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+   *   InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setForwardingRuleResource(forwardingRuleResource)
+   *     .build();
+   *   ApiFuture<Operation> future = globalForwardingRuleClient.insertGlobalForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertGlobalForwardingRuleCallable() { + return stub.insertGlobalForwardingRuleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (ForwardingRule element : globalForwardingRuleClient.listGlobalForwardingRules(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(ProjectName project) { + ListGlobalForwardingRulesHttpRequest request = + ListGlobalForwardingRulesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listGlobalForwardingRules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (ForwardingRule element : globalForwardingRuleClient.listGlobalForwardingRules(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(String project) { + ListGlobalForwardingRulesHttpRequest request = + ListGlobalForwardingRulesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listGlobalForwardingRules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalForwardingRulesHttpRequest request = ListGlobalForwardingRulesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (ForwardingRule element : globalForwardingRuleClient.listGlobalForwardingRules(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(ListGlobalForwardingRulesHttpRequest request) { + return listGlobalForwardingRulesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalForwardingRulesHttpRequest request = ListGlobalForwardingRulesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListGlobalForwardingRulesPagedResponse> future = globalForwardingRuleClient.listGlobalForwardingRulesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ForwardingRule element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listGlobalForwardingRulesPagedCallable() { + return stub.listGlobalForwardingRulesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of ForwardingRule resources available to the specified project. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalForwardingRulesHttpRequest request = ListGlobalForwardingRulesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     ForwardingRuleList response = globalForwardingRuleClient.listGlobalForwardingRulesCallable().call(request);
+   *     for (ForwardingRule element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listGlobalForwardingRulesCallable() { + return stub.listGlobalForwardingRulesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param targetReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetGlobalForwardingRule(ProjectForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { + + SetTargetGlobalForwardingRuleHttpRequest request = + SetTargetGlobalForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .setTargetReferenceResource(targetReferenceResource) + .build(); + return setTargetGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(forwardingRule.toString(), targetReferenceResource);
+   * }
+   * 
+ * + * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param targetReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetGlobalForwardingRule(String forwardingRule, TargetReference targetReferenceResource) { + + SetTargetGlobalForwardingRuleHttpRequest request = + SetTargetGlobalForwardingRuleHttpRequest.newBuilder() + .setForwardingRule(forwardingRule) + .setTargetReferenceResource(targetReferenceResource) + .build(); + return setTargetGlobalForwardingRule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .setTargetReferenceResource(targetReferenceResource)
+   *     .build();
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetGlobalForwardingRule(SetTargetGlobalForwardingRuleHttpRequest request) { + return setTargetGlobalForwardingRuleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + *

+   * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setForwardingRule(forwardingRule.toString())
+   *     .setTargetReferenceResource(targetReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = globalForwardingRuleClient.setTargetGlobalForwardingRuleCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setTargetGlobalForwardingRuleCallable() { + return stub.setTargetGlobalForwardingRuleCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListGlobalForwardingRulesPagedResponse extends AbstractPagedListResponse< + ListGlobalForwardingRulesHttpRequest, + ForwardingRuleList, + ForwardingRule, + ListGlobalForwardingRulesPage, + ListGlobalForwardingRulesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListGlobalForwardingRulesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListGlobalForwardingRulesPagedResponse apply(ListGlobalForwardingRulesPage input) { + return new ListGlobalForwardingRulesPagedResponse(input); + } + }); + } + + private ListGlobalForwardingRulesPagedResponse(ListGlobalForwardingRulesPage page) { + super(page, ListGlobalForwardingRulesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListGlobalForwardingRulesPage extends AbstractPage< + ListGlobalForwardingRulesHttpRequest, + ForwardingRuleList, + ForwardingRule, + ListGlobalForwardingRulesPage> { + + private ListGlobalForwardingRulesPage( + PageContext context, + ForwardingRuleList response) { + super(context, response); + } + + private static ListGlobalForwardingRulesPage createEmptyPage() { + return new ListGlobalForwardingRulesPage(null, null); + } + + @Override + protected ListGlobalForwardingRulesPage createPage( + PageContext context, + ForwardingRuleList response) { + return new ListGlobalForwardingRulesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListGlobalForwardingRulesFixedSizeCollection extends AbstractFixedSizeCollection< + ListGlobalForwardingRulesHttpRequest, + ForwardingRuleList, + ForwardingRule, + ListGlobalForwardingRulesPage, + ListGlobalForwardingRulesFixedSizeCollection> { + + private ListGlobalForwardingRulesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListGlobalForwardingRulesFixedSizeCollection createEmptyCollection() { + return new ListGlobalForwardingRulesFixedSizeCollection(null, 0); + } + + @Override + protected ListGlobalForwardingRulesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListGlobalForwardingRulesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java new file mode 100644 index 000000000000..8eba9797810f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java @@ -0,0 +1,282 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GlobalForwardingRuleClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteGlobalForwardingRule to 30 seconds: + * + *

+ * 
+ * GlobalForwardingRuleSettings.Builder globalForwardingRuleSettingsBuilder =
+ *     GlobalForwardingRuleSettings.newBuilder();
+ * globalForwardingRuleSettingsBuilder.deleteGlobalForwardingRuleSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GlobalForwardingRuleSettings globalForwardingRuleSettings = globalForwardingRuleSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalForwardingRuleSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteGlobalForwardingRule. + */ + public UnaryCallSettings deleteGlobalForwardingRuleSettings() { + return ((GlobalForwardingRuleStubSettings) getStubSettings()).deleteGlobalForwardingRuleSettings(); + } + + /** + * Returns the object with the settings used for calls to getGlobalForwardingRule. + */ + public UnaryCallSettings getGlobalForwardingRuleSettings() { + return ((GlobalForwardingRuleStubSettings) getStubSettings()).getGlobalForwardingRuleSettings(); + } + + /** + * Returns the object with the settings used for calls to insertGlobalForwardingRule. + */ + public UnaryCallSettings insertGlobalForwardingRuleSettings() { + return ((GlobalForwardingRuleStubSettings) getStubSettings()).insertGlobalForwardingRuleSettings(); + } + + /** + * Returns the object with the settings used for calls to listGlobalForwardingRules. + */ + public PagedCallSettings listGlobalForwardingRulesSettings() { + return ((GlobalForwardingRuleStubSettings) getStubSettings()).listGlobalForwardingRulesSettings(); + } + + /** + * Returns the object with the settings used for calls to setTargetGlobalForwardingRule. + */ + public UnaryCallSettings setTargetGlobalForwardingRuleSettings() { + return ((GlobalForwardingRuleStubSettings) getStubSettings()).setTargetGlobalForwardingRuleSettings(); + } + + + public static final GlobalForwardingRuleSettings create(GlobalForwardingRuleStubSettings stub) throws IOException { + return new GlobalForwardingRuleSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return GlobalForwardingRuleStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return GlobalForwardingRuleStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return GlobalForwardingRuleStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return GlobalForwardingRuleStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GlobalForwardingRuleStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return GlobalForwardingRuleStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return GlobalForwardingRuleStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GlobalForwardingRuleStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GlobalForwardingRuleSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for GlobalForwardingRuleSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(GlobalForwardingRuleStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(GlobalForwardingRuleStubSettings.newBuilder()); + } + + protected Builder(GlobalForwardingRuleSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(GlobalForwardingRuleStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public GlobalForwardingRuleStubSettings.Builder getStubSettingsBuilder() { + return ((GlobalForwardingRuleStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteGlobalForwardingRule. + */ + public UnaryCallSettings.Builder deleteGlobalForwardingRuleSettings() { + return getStubSettingsBuilder().deleteGlobalForwardingRuleSettings(); + } + + /** + * Returns the builder for the settings used for calls to getGlobalForwardingRule. + */ + public UnaryCallSettings.Builder getGlobalForwardingRuleSettings() { + return getStubSettingsBuilder().getGlobalForwardingRuleSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertGlobalForwardingRule. + */ + public UnaryCallSettings.Builder insertGlobalForwardingRuleSettings() { + return getStubSettingsBuilder().insertGlobalForwardingRuleSettings(); + } + + /** + * Returns the builder for the settings used for calls to listGlobalForwardingRules. + */ + public PagedCallSettings.Builder listGlobalForwardingRulesSettings() { + return getStubSettingsBuilder().listGlobalForwardingRulesSettings(); + } + + /** + * Returns the builder for the settings used for calls to setTargetGlobalForwardingRule. + */ + public UnaryCallSettings.Builder setTargetGlobalForwardingRuleSettings() { + return getStubSettingsBuilder().setTargetGlobalForwardingRuleSettings(); + } + + @Override + public GlobalForwardingRuleSettings build() throws IOException { + return new GlobalForwardingRuleSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java new file mode 100644 index 000000000000..4554d5aa137f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java @@ -0,0 +1,831 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.GlobalOperationStub; +import com.google.cloud.compute.v1.stub.GlobalOperationStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+ *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+ *   globalOperationClient.deleteGlobalOperation(operation);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the globalOperationClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of GlobalOperationSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * GlobalOperationSettings globalOperationSettings =
+ *     GlobalOperationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GlobalOperationClient globalOperationClient =
+ *     GlobalOperationClient.create(globalOperationSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * GlobalOperationSettings globalOperationSettings =
+ *     GlobalOperationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GlobalOperationClient globalOperationClient =
+ *     GlobalOperationClient.create(globalOperationSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalOperationClient implements BackgroundResource { + private final GlobalOperationSettings settings; + private final GlobalOperationStub stub; + + + + /** + * Constructs an instance of GlobalOperationClient with default settings. + */ + public static final GlobalOperationClient create() throws IOException { + return create(GlobalOperationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GlobalOperationClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final GlobalOperationClient create(GlobalOperationSettings settings) throws IOException { + return new GlobalOperationClient(settings); + } + + /** + * Constructs an instance of GlobalOperationClient, using the given stub for making calls. This is for + * advanced usage - prefer to use GlobalOperationSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final GlobalOperationClient create(GlobalOperationStub stub) { + return new GlobalOperationClient(stub); + } + + /** + * Constructs an instance of GlobalOperationClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GlobalOperationClient(GlobalOperationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((GlobalOperationStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected GlobalOperationClient(GlobalOperationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final GlobalOperationSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GlobalOperationStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of all operations. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (OperationsScopedList element : globalOperationClient.aggregatedListGlobalOperations(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(ProjectName project) { + AggregatedListGlobalOperationsHttpRequest request = + AggregatedListGlobalOperationsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListGlobalOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of all operations. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (OperationsScopedList element : globalOperationClient.aggregatedListGlobalOperations(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(String project) { + AggregatedListGlobalOperationsHttpRequest request = + AggregatedListGlobalOperationsHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListGlobalOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of all operations. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListGlobalOperationsHttpRequest request = AggregatedListGlobalOperationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (OperationsScopedList element : globalOperationClient.aggregatedListGlobalOperations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(AggregatedListGlobalOperationsHttpRequest request) { + return aggregatedListGlobalOperationsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of all operations. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListGlobalOperationsHttpRequest request = AggregatedListGlobalOperationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListGlobalOperationsPagedResponse> future = globalOperationClient.aggregatedListGlobalOperationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (OperationsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListGlobalOperationsPagedCallable() { + return stub.aggregatedListGlobalOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of all operations. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListGlobalOperationsHttpRequest request = AggregatedListGlobalOperationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     OperationAggregatedList response = globalOperationClient.aggregatedListGlobalOperationsCallable().call(request);
+   *     for (OperationsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListGlobalOperationsCallable() { + return stub.aggregatedListGlobalOperationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Operations resource. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   globalOperationClient.deleteGlobalOperation(operation);
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteGlobalOperation(OperationName operation) { + + DeleteGlobalOperationHttpRequest request = + DeleteGlobalOperationHttpRequest.newBuilder() + .setOperation(operation == null ? null : operation.toString()) + .build(); + deleteGlobalOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Operations resource. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   globalOperationClient.deleteGlobalOperation(operation.toString());
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteGlobalOperation(String operation) { + + DeleteGlobalOperationHttpRequest request = + DeleteGlobalOperationHttpRequest.newBuilder() + .setOperation(operation) + .build(); + deleteGlobalOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Operations resource. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   DeleteGlobalOperationHttpRequest request = DeleteGlobalOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   globalOperationClient.deleteGlobalOperation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteGlobalOperation(DeleteGlobalOperationHttpRequest request) { + deleteGlobalOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Operations resource. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   DeleteGlobalOperationHttpRequest request = DeleteGlobalOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   ApiFuture<Void> future = globalOperationClient.deleteGlobalOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteGlobalOperationCallable() { + return stub.deleteGlobalOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   Operation response = globalOperationClient.getGlobalOperation(operation);
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getGlobalOperation(OperationName operation) { + + GetGlobalOperationHttpRequest request = + GetGlobalOperationHttpRequest.newBuilder() + .setOperation(operation == null ? null : operation.toString()) + .build(); + return getGlobalOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   Operation response = globalOperationClient.getGlobalOperation(operation.toString());
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getGlobalOperation(String operation) { + + GetGlobalOperationHttpRequest request = + GetGlobalOperationHttpRequest.newBuilder() + .setOperation(operation) + .build(); + return getGlobalOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   Operation response = globalOperationClient.getGlobalOperation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getGlobalOperation(GetGlobalOperationHttpRequest request) { + return getGlobalOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = globalOperationClient.getGlobalOperationCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getGlobalOperationCallable() { + return stub.getGlobalOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Operation element : globalOperationClient.listGlobalOperations(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalOperationsPagedResponse listGlobalOperations(ProjectName project) { + ListGlobalOperationsHttpRequest request = + ListGlobalOperationsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listGlobalOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Operation element : globalOperationClient.listGlobalOperations(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalOperationsPagedResponse listGlobalOperations(String project) { + ListGlobalOperationsHttpRequest request = + ListGlobalOperationsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listGlobalOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalOperationsHttpRequest request = ListGlobalOperationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Operation element : globalOperationClient.listGlobalOperations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListGlobalOperationsPagedResponse listGlobalOperations(ListGlobalOperationsHttpRequest request) { + return listGlobalOperationsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalOperationsHttpRequest request = ListGlobalOperationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListGlobalOperationsPagedResponse> future = globalOperationClient.listGlobalOperationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Operation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listGlobalOperationsPagedCallable() { + return stub.listGlobalOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * Sample code: + *

+   * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListGlobalOperationsHttpRequest request = ListGlobalOperationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     OperationList response = globalOperationClient.listGlobalOperationsCallable().call(request);
+   *     for (Operation element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listGlobalOperationsCallable() { + return stub.listGlobalOperationsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListGlobalOperationsPagedResponse extends AbstractPagedListResponse< + AggregatedListGlobalOperationsHttpRequest, + OperationAggregatedList, + OperationsScopedList, + AggregatedListGlobalOperationsPage, + AggregatedListGlobalOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListGlobalOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListGlobalOperationsPagedResponse apply(AggregatedListGlobalOperationsPage input) { + return new AggregatedListGlobalOperationsPagedResponse(input); + } + }); + } + + private AggregatedListGlobalOperationsPagedResponse(AggregatedListGlobalOperationsPage page) { + super(page, AggregatedListGlobalOperationsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListGlobalOperationsPage extends AbstractPage< + AggregatedListGlobalOperationsHttpRequest, + OperationAggregatedList, + OperationsScopedList, + AggregatedListGlobalOperationsPage> { + + private AggregatedListGlobalOperationsPage( + PageContext context, + OperationAggregatedList response) { + super(context, response); + } + + private static AggregatedListGlobalOperationsPage createEmptyPage() { + return new AggregatedListGlobalOperationsPage(null, null); + } + + @Override + protected AggregatedListGlobalOperationsPage createPage( + PageContext context, + OperationAggregatedList response) { + return new AggregatedListGlobalOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListGlobalOperationsFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListGlobalOperationsHttpRequest, + OperationAggregatedList, + OperationsScopedList, + AggregatedListGlobalOperationsPage, + AggregatedListGlobalOperationsFixedSizeCollection> { + + private AggregatedListGlobalOperationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListGlobalOperationsFixedSizeCollection createEmptyCollection() { + return new AggregatedListGlobalOperationsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListGlobalOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListGlobalOperationsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListGlobalOperationsPagedResponse extends AbstractPagedListResponse< + ListGlobalOperationsHttpRequest, + OperationList, + Operation, + ListGlobalOperationsPage, + ListGlobalOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListGlobalOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListGlobalOperationsPagedResponse apply(ListGlobalOperationsPage input) { + return new ListGlobalOperationsPagedResponse(input); + } + }); + } + + private ListGlobalOperationsPagedResponse(ListGlobalOperationsPage page) { + super(page, ListGlobalOperationsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListGlobalOperationsPage extends AbstractPage< + ListGlobalOperationsHttpRequest, + OperationList, + Operation, + ListGlobalOperationsPage> { + + private ListGlobalOperationsPage( + PageContext context, + OperationList response) { + super(context, response); + } + + private static ListGlobalOperationsPage createEmptyPage() { + return new ListGlobalOperationsPage(null, null); + } + + @Override + protected ListGlobalOperationsPage createPage( + PageContext context, + OperationList response) { + return new ListGlobalOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListGlobalOperationsFixedSizeCollection extends AbstractFixedSizeCollection< + ListGlobalOperationsHttpRequest, + OperationList, + Operation, + ListGlobalOperationsPage, + ListGlobalOperationsFixedSizeCollection> { + + private ListGlobalOperationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListGlobalOperationsFixedSizeCollection createEmptyCollection() { + return new ListGlobalOperationsFixedSizeCollection(null, 0); + } + + @Override + protected ListGlobalOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListGlobalOperationsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java new file mode 100644 index 000000000000..892f282427aa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java @@ -0,0 +1,269 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import com.google.cloud.compute.v1.stub.GlobalOperationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GlobalOperationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteGlobalOperation to 30 seconds: + * + *

+ * 
+ * GlobalOperationSettings.Builder globalOperationSettingsBuilder =
+ *     GlobalOperationSettings.newBuilder();
+ * globalOperationSettingsBuilder.deleteGlobalOperationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GlobalOperationSettings globalOperationSettings = globalOperationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalOperationSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListGlobalOperations. + */ + public PagedCallSettings aggregatedListGlobalOperationsSettings() { + return ((GlobalOperationStubSettings) getStubSettings()).aggregatedListGlobalOperationsSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteGlobalOperation. + */ + public UnaryCallSettings deleteGlobalOperationSettings() { + return ((GlobalOperationStubSettings) getStubSettings()).deleteGlobalOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to getGlobalOperation. + */ + public UnaryCallSettings getGlobalOperationSettings() { + return ((GlobalOperationStubSettings) getStubSettings()).getGlobalOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to listGlobalOperations. + */ + public PagedCallSettings listGlobalOperationsSettings() { + return ((GlobalOperationStubSettings) getStubSettings()).listGlobalOperationsSettings(); + } + + + public static final GlobalOperationSettings create(GlobalOperationStubSettings stub) throws IOException { + return new GlobalOperationSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return GlobalOperationStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return GlobalOperationStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return GlobalOperationStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return GlobalOperationStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GlobalOperationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return GlobalOperationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return GlobalOperationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GlobalOperationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GlobalOperationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for GlobalOperationSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(GlobalOperationStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(GlobalOperationStubSettings.newBuilder()); + } + + protected Builder(GlobalOperationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(GlobalOperationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public GlobalOperationStubSettings.Builder getStubSettingsBuilder() { + return ((GlobalOperationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListGlobalOperations. + */ + public PagedCallSettings.Builder aggregatedListGlobalOperationsSettings() { + return getStubSettingsBuilder().aggregatedListGlobalOperationsSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteGlobalOperation. + */ + public UnaryCallSettings.Builder deleteGlobalOperationSettings() { + return getStubSettingsBuilder().deleteGlobalOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to getGlobalOperation. + */ + public UnaryCallSettings.Builder getGlobalOperationSettings() { + return getStubSettingsBuilder().getGlobalOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to listGlobalOperations. + */ + public PagedCallSettings.Builder listGlobalOperationsSettings() { + return getStubSettingsBuilder().listGlobalOperationsSettings(); + } + + @Override + public GlobalOperationSettings build() throws IOException { + return new GlobalOperationSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java new file mode 100644 index 000000000000..404e42a99166 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GuestOsFeature implements ApiMessage { + private final String type; + + private GuestOsFeature() { + this.type = null; + } + + + private GuestOsFeature( + String type + ) { + this.type = type; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("type")) { + return String.valueOf(type); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getType() { + return type; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GuestOsFeature prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static GuestOsFeature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final GuestOsFeature DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GuestOsFeature(); + } + + public static class Builder { + private String type; + + Builder() {} + + public Builder mergeFrom(GuestOsFeature other) { + if (other == GuestOsFeature.getDefaultInstance()) return this; + if (other.getType() != null) { + this.type = other.type; + } + return this; + } + + Builder(GuestOsFeature source) { + this.type = source.type; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + + public GuestOsFeature build() { + return new GuestOsFeature( + type + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setType(this.type); + return newBuilder; + } + } + + @Override + public String toString() { + return "GuestOsFeature{" + + "type=" + type + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GuestOsFeature) { + GuestOsFeature that = (GuestOsFeature) o; + return + Objects.equals(this.type, that.getType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + type + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java new file mode 100644 index 000000000000..c5349c870abc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HTTPHealthCheck implements ApiMessage { + private final String host; + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String requestPath; + + private HTTPHealthCheck() { + this.host = null; + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.requestPath = null; + } + + + private HTTPHealthCheck( + String host, + Integer port, + String portName, + String proxyHeader, + String requestPath + ) { + this.host = host; + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.requestPath = requestPath; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHost() { + return host; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequestPath() { + return requestPath; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HTTPHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HTTPHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HTTPHealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HTTPHealthCheck(); + } + + public static class Builder { + private String host; + private Integer port; + private String portName; + private String proxyHeader; + private String requestPath; + + Builder() {} + + public Builder mergeFrom(HTTPHealthCheck other) { + if (other == HTTPHealthCheck.getDefaultInstance()) return this; + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + return this; + } + + Builder(HTTPHealthCheck source) { + this.host = source.host; + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.requestPath = source.requestPath; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + + public HTTPHealthCheck build() { + + + + + return new HTTPHealthCheck( + host, + port, + portName, + proxyHeader, + requestPath + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHost(this.host); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequestPath(this.requestPath); + return newBuilder; + } + } + + @Override + public String toString() { + return "HTTPHealthCheck{" + + "host=" + host + ", " + + "port=" + port + ", " + + "portName=" + portName + ", " + + "proxyHeader=" + proxyHeader + ", " + + "requestPath=" + requestPath + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HTTPHealthCheck) { + HTTPHealthCheck that = (HTTPHealthCheck) o; + return + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.portName, that.getPortName()) && + Objects.equals(this.proxyHeader, that.getProxyHeader()) && + Objects.equals(this.requestPath, that.getRequestPath()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + host, + port, + portName, + proxyHeader, + requestPath + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java new file mode 100644 index 000000000000..a65287471367 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HTTPSHealthCheck implements ApiMessage { + private final String host; + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String requestPath; + + private HTTPSHealthCheck() { + this.host = null; + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.requestPath = null; + } + + + private HTTPSHealthCheck( + String host, + Integer port, + String portName, + String proxyHeader, + String requestPath + ) { + this.host = host; + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.requestPath = requestPath; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHost() { + return host; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequestPath() { + return requestPath; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HTTPSHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HTTPSHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HTTPSHealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HTTPSHealthCheck(); + } + + public static class Builder { + private String host; + private Integer port; + private String portName; + private String proxyHeader; + private String requestPath; + + Builder() {} + + public Builder mergeFrom(HTTPSHealthCheck other) { + if (other == HTTPSHealthCheck.getDefaultInstance()) return this; + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + return this; + } + + Builder(HTTPSHealthCheck source) { + this.host = source.host; + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.requestPath = source.requestPath; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + + public HTTPSHealthCheck build() { + + + + + return new HTTPSHealthCheck( + host, + port, + portName, + proxyHeader, + requestPath + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHost(this.host); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequestPath(this.requestPath); + return newBuilder; + } + } + + @Override + public String toString() { + return "HTTPSHealthCheck{" + + "host=" + host + ", " + + "port=" + port + ", " + + "portName=" + portName + ", " + + "proxyHeader=" + proxyHeader + ", " + + "requestPath=" + requestPath + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HTTPSHealthCheck) { + HTTPSHealthCheck that = (HTTPSHealthCheck) o; + return + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.portName, that.getPortName()) && + Objects.equals(this.proxyHeader, that.getProxyHeader()) && + Objects.equals(this.requestPath, that.getRequestPath()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + host, + port, + portName, + proxyHeader, + requestPath + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java new file mode 100644 index 000000000000..3a5e581ef1a9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java @@ -0,0 +1,638 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HealthCheck implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; + private final HTTPHealthCheck httpHealthCheck; + private final HTTPSHealthCheck httpsHealthCheck; + private final String id; + private final String kind; + private final String name; + private final String selfLink; + private final SSLHealthCheck sslHealthCheck; + private final TCPHealthCheck tcpHealthCheck; + private final Integer timeoutSec; + private final String type; + private final Integer unhealthyThreshold; + + private HealthCheck() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; + this.httpHealthCheck = null; + this.httpsHealthCheck = null; + this.id = null; + this.kind = null; + this.name = null; + this.selfLink = null; + this.sslHealthCheck = null; + this.tcpHealthCheck = null; + this.timeoutSec = null; + this.type = null; + this.unhealthyThreshold = null; + } + + + private HealthCheck( + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + HTTPHealthCheck httpHealthCheck, + HTTPSHealthCheck httpsHealthCheck, + String id, + String kind, + String name, + String selfLink, + SSLHealthCheck sslHealthCheck, + TCPHealthCheck tcpHealthCheck, + Integer timeoutSec, + String type, + Integer unhealthyThreshold + ) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; + this.httpHealthCheck = httpHealthCheck; + this.httpsHealthCheck = httpsHealthCheck; + this.id = id; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + this.sslHealthCheck = sslHealthCheck; + this.tcpHealthCheck = tcpHealthCheck; + this.timeoutSec = timeoutSec; + this.type = type; + this.unhealthyThreshold = unhealthyThreshold; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sslHealthCheck") && sslHealthCheck != null) { + fieldMap.put("sslHealthCheck", Collections.singletonList(String.valueOf(sslHealthCheck))); + } + if (fieldNames.contains("tcpHealthCheck") && tcpHealthCheck != null) { + fieldMap.put("tcpHealthCheck", Collections.singletonList(String.valueOf(tcpHealthCheck))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put("unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return String.valueOf(checkIntervalSec); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("healthyThreshold")) { + return String.valueOf(healthyThreshold); + } + if (fieldName.equals("httpHealthCheck")) { + return String.valueOf(httpHealthCheck); + } + if (fieldName.equals("httpsHealthCheck")) { + return String.valueOf(httpsHealthCheck); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sslHealthCheck")) { + return String.valueOf(sslHealthCheck); + } + if (fieldName.equals("tcpHealthCheck")) { + return String.valueOf(tcpHealthCheck); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } + if (fieldName.equals("unhealthyThreshold")) { + return String.valueOf(unhealthyThreshold); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public HTTPHealthCheck getHttpHealthCheck() { + return httpHealthCheck; + } + + public HTTPSHealthCheck getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public SSLHealthCheck getSslHealthCheck() { + return sslHealthCheck; + } + + public TCPHealthCheck getTcpHealthCheck() { + return tcpHealthCheck; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public String getType() { + return type; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HealthCheck(); + } + + public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; + private HTTPHealthCheck httpHealthCheck; + private HTTPSHealthCheck httpsHealthCheck; + private String id; + private String kind; + private String name; + private String selfLink; + private SSLHealthCheck sslHealthCheck; + private TCPHealthCheck tcpHealthCheck; + private Integer timeoutSec; + private String type; + private Integer unhealthyThreshold; + + Builder() {} + + public Builder mergeFrom(HealthCheck other) { + if (other == HealthCheck.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } + if (other.getHttpHealthCheck() != null) { + this.httpHealthCheck = other.httpHealthCheck; + } + if (other.getHttpsHealthCheck() != null) { + this.httpsHealthCheck = other.httpsHealthCheck; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSslHealthCheck() != null) { + this.sslHealthCheck = other.sslHealthCheck; + } + if (other.getTcpHealthCheck() != null) { + this.tcpHealthCheck = other.tcpHealthCheck; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getType() != null) { + this.type = other.type; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } + return this; + } + + Builder(HealthCheck source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; + this.httpHealthCheck = source.httpHealthCheck; + this.httpsHealthCheck = source.httpsHealthCheck; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + this.sslHealthCheck = source.sslHealthCheck; + this.tcpHealthCheck = source.tcpHealthCheck; + this.timeoutSec = source.timeoutSec; + this.type = source.type; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; + } + + public HTTPHealthCheck getHttpHealthCheck() { + return httpHealthCheck; + } + + public Builder setHttpHealthCheck(HTTPHealthCheck httpHealthCheck) { + this.httpHealthCheck = httpHealthCheck; + return this; + } + + public HTTPSHealthCheck getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public Builder setHttpsHealthCheck(HTTPSHealthCheck httpsHealthCheck) { + this.httpsHealthCheck = httpsHealthCheck; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public SSLHealthCheck getSslHealthCheck() { + return sslHealthCheck; + } + + public Builder setSslHealthCheck(SSLHealthCheck sslHealthCheck) { + this.sslHealthCheck = sslHealthCheck; + return this; + } + + public TCPHealthCheck getTcpHealthCheck() { + return tcpHealthCheck; + } + + public Builder setTcpHealthCheck(TCPHealthCheck tcpHealthCheck) { + this.tcpHealthCheck = tcpHealthCheck; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + + public HealthCheck build() { + + + + + + + + + + + + + + + return new HealthCheck( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + httpHealthCheck, + httpsHealthCheck, + id, + kind, + name, + selfLink, + sslHealthCheck, + tcpHealthCheck, + timeoutSec, + type, + unhealthyThreshold + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); + newBuilder.setHttpHealthCheck(this.httpHealthCheck); + newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSslHealthCheck(this.sslHealthCheck); + newBuilder.setTcpHealthCheck(this.tcpHealthCheck); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setType(this.type); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); + return newBuilder; + } + } + + @Override + public String toString() { + return "HealthCheck{" + + "checkIntervalSec=" + checkIntervalSec + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "healthyThreshold=" + healthyThreshold + ", " + + "httpHealthCheck=" + httpHealthCheck + ", " + + "httpsHealthCheck=" + httpsHealthCheck + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "sslHealthCheck=" + sslHealthCheck + ", " + + "tcpHealthCheck=" + tcpHealthCheck + ", " + + "timeoutSec=" + timeoutSec + ", " + + "type=" + type + ", " + + "unhealthyThreshold=" + unhealthyThreshold + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HealthCheck) { + HealthCheck that = (HealthCheck) o; + return + Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) && + Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && + Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sslHealthCheck, that.getSslHealthCheck()) && + Objects.equals(this.tcpHealthCheck, that.getTcpHealthCheck()) && + Objects.equals(this.timeoutSec, that.getTimeoutSec()) && + Objects.equals(this.type, that.getType()) && + Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + httpHealthCheck, + httpsHealthCheck, + id, + kind, + name, + selfLink, + sslHealthCheck, + tcpHealthCheck, + timeoutSec, + type, + unhealthyThreshold + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java new file mode 100644 index 000000000000..af7ee357f569 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java @@ -0,0 +1,926 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.HealthCheckStub; +import com.google.cloud.compute.v1.stub.HealthCheckStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+ *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+ *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the healthCheckClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of HealthCheckSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * HealthCheckSettings healthCheckSettings =
+ *     HealthCheckSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * HealthCheckClient healthCheckClient =
+ *     HealthCheckClient.create(healthCheckSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * HealthCheckSettings healthCheckSettings =
+ *     HealthCheckSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HealthCheckClient healthCheckClient =
+ *     HealthCheckClient.create(healthCheckSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HealthCheckClient implements BackgroundResource { + private final HealthCheckSettings settings; + private final HealthCheckStub stub; + + + + /** + * Constructs an instance of HealthCheckClient with default settings. + */ + public static final HealthCheckClient create() throws IOException { + return create(HealthCheckSettings.newBuilder().build()); + } + + /** + * Constructs an instance of HealthCheckClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final HealthCheckClient create(HealthCheckSettings settings) throws IOException { + return new HealthCheckClient(settings); + } + + /** + * Constructs an instance of HealthCheckClient, using the given stub for making calls. This is for + * advanced usage - prefer to use HealthCheckSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final HealthCheckClient create(HealthCheckStub stub) { + return new HealthCheckClient(stub); + } + + /** + * Constructs an instance of HealthCheckClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HealthCheckClient(HealthCheckSettings settings) throws IOException { + this.settings = settings; + this.stub = ((HealthCheckStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected HealthCheckClient(HealthCheckStub stub) { + this.settings = null; + this.stub = stub; + } + + public final HealthCheckSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HealthCheckStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HealthCheck resource. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHealthCheck(HealthCheckName healthCheck) { + + DeleteHealthCheckHttpRequest request = + DeleteHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .build(); + return deleteHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HealthCheck resource. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck.toString());
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHealthCheck(String healthCheck) { + + DeleteHealthCheckHttpRequest request = + DeleteHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck) + .build(); + return deleteHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HealthCheck resource. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .build();
+   *   Operation response = healthCheckClient.deleteHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHealthCheck(DeleteHealthCheckHttpRequest request) { + return deleteHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HealthCheck resource. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = healthCheckClient.deleteHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteHealthCheckCallable() { + return stub.deleteHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck response = healthCheckClient.getHealthCheck(healthCheck);
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HealthCheck getHealthCheck(HealthCheckName healthCheck) { + + GetHealthCheckHttpRequest request = + GetHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .build(); + return getHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck response = healthCheckClient.getHealthCheck(healthCheck.toString());
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HealthCheck getHealthCheck(String healthCheck) { + + GetHealthCheckHttpRequest request = + GetHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck) + .build(); + return getHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .build();
+   *   HealthCheck response = healthCheckClient.getHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HealthCheck getHealthCheck(GetHealthCheckHttpRequest request) { + return getHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .build();
+   *   ApiFuture<HealthCheck> future = healthCheckClient.getHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   HealthCheck response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getHealthCheckCallable() { + return stub.getHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   Operation response = healthCheckClient.insertHealthCheck(project, healthCheckResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHealthCheck(ProjectName project, HealthCheck healthCheckResource) { + + InsertHealthCheckHttpRequest request = + InsertHealthCheckHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setHealthCheckResource(healthCheckResource) + .build(); + return insertHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   Operation response = healthCheckClient.insertHealthCheck(project.toString(), healthCheckResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHealthCheck(String project, HealthCheck healthCheckResource) { + + InsertHealthCheckHttpRequest request = + InsertHealthCheckHttpRequest.newBuilder() + .setProject(project) + .setHealthCheckResource(healthCheckResource) + .build(); + return insertHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setHealthCheckResource(healthCheckResource)
+   *     .build();
+   *   Operation response = healthCheckClient.insertHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHealthCheck(InsertHealthCheckHttpRequest request) { + return insertHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setHealthCheckResource(healthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = healthCheckClient.insertHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertHealthCheckCallable() { + return stub.insertHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (HealthCheck element : healthCheckClient.listHealthChecks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHealthChecksPagedResponse listHealthChecks(ProjectName project) { + ListHealthChecksHttpRequest request = + ListHealthChecksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listHealthChecks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (HealthCheck element : healthCheckClient.listHealthChecks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHealthChecksPagedResponse listHealthChecks(String project) { + ListHealthChecksHttpRequest request = + ListHealthChecksHttpRequest.newBuilder() + .setProject(project) + .build(); + return listHealthChecks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHealthChecksHttpRequest request = ListHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (HealthCheck element : healthCheckClient.listHealthChecks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHealthChecksPagedResponse listHealthChecks(ListHealthChecksHttpRequest request) { + return listHealthChecksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHealthChecksHttpRequest request = ListHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListHealthChecksPagedResponse> future = healthCheckClient.listHealthChecksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (HealthCheck element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listHealthChecksPagedCallable() { + return stub.listHealthChecksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHealthChecksHttpRequest request = ListHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     HealthCheckList response = healthCheckClient.listHealthChecksCallable().call(request);
+   *     for (HealthCheck element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listHealthChecksCallable() { + return stub.listHealthChecksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   Operation response = healthCheckClient.patchHealthCheck(healthCheck, healthCheckResource);
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to update. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHealthCheck(HealthCheckName healthCheck, HealthCheck healthCheckResource) { + + PatchHealthCheckHttpRequest request = + PatchHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .setHealthCheckResource(healthCheckResource) + .build(); + return patchHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   Operation response = healthCheckClient.patchHealthCheck(healthCheck.toString(), healthCheckResource);
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to update. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHealthCheck(String healthCheck, HealthCheck healthCheckResource) { + + PatchHealthCheckHttpRequest request = + PatchHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck) + .setHealthCheckResource(healthCheckResource) + .build(); + return patchHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .setHealthCheckResource(healthCheckResource)
+   *     .build();
+   *   Operation response = healthCheckClient.patchHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHealthCheck(PatchHealthCheckHttpRequest request) { + return patchHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .setHealthCheckResource(healthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = healthCheckClient.patchHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchHealthCheckCallable() { + return stub.patchHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   Operation response = healthCheckClient.updateHealthCheck(healthCheck, healthCheckResource);
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to update. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHealthCheck(HealthCheckName healthCheck, HealthCheck healthCheckResource) { + + UpdateHealthCheckHttpRequest request = + UpdateHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .setHealthCheckResource(healthCheckResource) + .build(); + return updateHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   Operation response = healthCheckClient.updateHealthCheck(healthCheck.toString(), healthCheckResource);
+   * }
+   * 
+ * + * @param healthCheck Name of the HealthCheck resource to update. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHealthCheck(String healthCheck, HealthCheck healthCheckResource) { + + UpdateHealthCheckHttpRequest request = + UpdateHealthCheckHttpRequest.newBuilder() + .setHealthCheck(healthCheck) + .setHealthCheckResource(healthCheckResource) + .build(); + return updateHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .setHealthCheckResource(healthCheckResource)
+   *     .build();
+   *   Operation response = healthCheckClient.updateHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHealthCheck(UpdateHealthCheckHttpRequest request) { + return updateHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
+   *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
+   *     .setHealthCheck(healthCheck.toString())
+   *     .setHealthCheckResource(healthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = healthCheckClient.updateHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateHealthCheckCallable() { + return stub.updateHealthCheckCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListHealthChecksPagedResponse extends AbstractPagedListResponse< + ListHealthChecksHttpRequest, + HealthCheckList, + HealthCheck, + ListHealthChecksPage, + ListHealthChecksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListHealthChecksPagedResponse apply(ListHealthChecksPage input) { + return new ListHealthChecksPagedResponse(input); + } + }); + } + + private ListHealthChecksPagedResponse(ListHealthChecksPage page) { + super(page, ListHealthChecksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListHealthChecksPage extends AbstractPage< + ListHealthChecksHttpRequest, + HealthCheckList, + HealthCheck, + ListHealthChecksPage> { + + private ListHealthChecksPage( + PageContext context, + HealthCheckList response) { + super(context, response); + } + + private static ListHealthChecksPage createEmptyPage() { + return new ListHealthChecksPage(null, null); + } + + @Override + protected ListHealthChecksPage createPage( + PageContext context, + HealthCheckList response) { + return new ListHealthChecksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< + ListHealthChecksHttpRequest, + HealthCheckList, + HealthCheck, + ListHealthChecksPage, + ListHealthChecksFixedSizeCollection> { + + private ListHealthChecksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHealthChecksFixedSizeCollection createEmptyCollection() { + return new ListHealthChecksFixedSizeCollection(null, 0); + } + + @Override + protected ListHealthChecksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHealthChecksFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java new file mode 100644 index 000000000000..e7290b0da358 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HealthCheckList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private HealthCheckList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private HealthCheckList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthCheck item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HealthCheckList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HealthCheckList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HealthCheckList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HealthCheckList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(HealthCheckList other) { + if (other == HealthCheckList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(HealthCheckList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(HealthCheck items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public HealthCheckList build() { + + + + + return new HealthCheckList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "HealthCheckList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HealthCheckList) { + HealthCheckList that = (HealthCheckList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java new file mode 100644 index 000000000000..1fc282781d9d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class HealthCheckName implements ResourceName { + private final String healthCheck; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/healthChecks/{healthCheck}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private HealthCheckName(Builder builder) { + healthCheck = Preconditions.checkNotNull(builder.getHealthCheck()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static HealthCheckName of( + String healthCheck, + String project + ) { + return newBuilder() + .setHealthCheck(healthCheck) + .setProject(project) + .build(); + } + + public static String format( + String healthCheck, + String project + ) { + return of( + healthCheck, + project + ) + .toString(); + } + + public String getHealthCheck() { + return healthCheck; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("healthCheck", healthCheck); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public HealthCheckName parse(String formattedString) {return HealthCheckName.parse(formattedString);} + }; + } + + public static HealthCheckName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "HealthCheckName.parse: formattedString not in valid format"); + return of( + matchMap.get("healthCheck"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String healthCheck; + private String project; + + public String getHealthCheck() { + return healthCheck; + } + public String getProject() { + return project; + } + + public Builder setHealthCheck(String healthCheck) { + this.healthCheck = healthCheck; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (HealthCheckName healthCheckName) { + healthCheck = healthCheckName.healthCheck; + project = healthCheckName.project; + } + + public HealthCheckName build() { + return new HealthCheckName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "healthCheck", healthCheck, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HealthCheckName) { + HealthCheckName that = (HealthCheckName) o; + return + Objects.equals(this.healthCheck, that.getHealthCheck()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthCheck, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java new file mode 100644 index 000000000000..5670951074ac --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HealthCheckReference implements ApiMessage { + private final String healthCheck; + + private HealthCheckReference() { + this.healthCheck = null; + } + + + private HealthCheckReference( + String healthCheck + ) { + this.healthCheck = healthCheck; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthCheck")) { + return String.valueOf(healthCheck); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHealthCheck() { + return healthCheck; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HealthCheckReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HealthCheckReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HealthCheckReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HealthCheckReference(); + } + + public static class Builder { + private String healthCheck; + + Builder() {} + + public Builder mergeFrom(HealthCheckReference other) { + if (other == HealthCheckReference.getDefaultInstance()) return this; + if (other.getHealthCheck() != null) { + this.healthCheck = other.healthCheck; + } + return this; + } + + Builder(HealthCheckReference source) { + this.healthCheck = source.healthCheck; + } + + public String getHealthCheck() { + return healthCheck; + } + + public Builder setHealthCheck(String healthCheck) { + this.healthCheck = healthCheck; + return this; + } + + + public HealthCheckReference build() { + return new HealthCheckReference( + healthCheck + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHealthCheck(this.healthCheck); + return newBuilder; + } + } + + @Override + public String toString() { + return "HealthCheckReference{" + + "healthCheck=" + healthCheck + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HealthCheckReference) { + HealthCheckReference that = (HealthCheckReference) o; + return + Objects.equals(this.healthCheck, that.getHealthCheck()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthCheck + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java new file mode 100644 index 000000000000..dbeba0bb15e7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import com.google.cloud.compute.v1.stub.HealthCheckStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link HealthCheckClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteHealthCheck to 30 seconds: + * + *

+ * 
+ * HealthCheckSettings.Builder healthCheckSettingsBuilder =
+ *     HealthCheckSettings.newBuilder();
+ * healthCheckSettingsBuilder.deleteHealthCheckSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * HealthCheckSettings healthCheckSettings = healthCheckSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HealthCheckSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteHealthCheck. + */ + public UnaryCallSettings deleteHealthCheckSettings() { + return ((HealthCheckStubSettings) getStubSettings()).deleteHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to getHealthCheck. + */ + public UnaryCallSettings getHealthCheckSettings() { + return ((HealthCheckStubSettings) getStubSettings()).getHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to insertHealthCheck. + */ + public UnaryCallSettings insertHealthCheckSettings() { + return ((HealthCheckStubSettings) getStubSettings()).insertHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to listHealthChecks. + */ + public PagedCallSettings listHealthChecksSettings() { + return ((HealthCheckStubSettings) getStubSettings()).listHealthChecksSettings(); + } + + /** + * Returns the object with the settings used for calls to patchHealthCheck. + */ + public UnaryCallSettings patchHealthCheckSettings() { + return ((HealthCheckStubSettings) getStubSettings()).patchHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to updateHealthCheck. + */ + public UnaryCallSettings updateHealthCheckSettings() { + return ((HealthCheckStubSettings) getStubSettings()).updateHealthCheckSettings(); + } + + + public static final HealthCheckSettings create(HealthCheckStubSettings stub) throws IOException { + return new HealthCheckSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return HealthCheckStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return HealthCheckStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return HealthCheckStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return HealthCheckStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return HealthCheckStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return HealthCheckStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return HealthCheckStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HealthCheckStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected HealthCheckSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for HealthCheckSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(HealthCheckStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(HealthCheckStubSettings.newBuilder()); + } + + protected Builder(HealthCheckSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(HealthCheckStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public HealthCheckStubSettings.Builder getStubSettingsBuilder() { + return ((HealthCheckStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteHealthCheck. + */ + public UnaryCallSettings.Builder deleteHealthCheckSettings() { + return getStubSettingsBuilder().deleteHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to getHealthCheck. + */ + public UnaryCallSettings.Builder getHealthCheckSettings() { + return getStubSettingsBuilder().getHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertHealthCheck. + */ + public UnaryCallSettings.Builder insertHealthCheckSettings() { + return getStubSettingsBuilder().insertHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to listHealthChecks. + */ + public PagedCallSettings.Builder listHealthChecksSettings() { + return getStubSettingsBuilder().listHealthChecksSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchHealthCheck. + */ + public UnaryCallSettings.Builder patchHealthCheckSettings() { + return getStubSettingsBuilder().patchHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateHealthCheck. + */ + public UnaryCallSettings.Builder updateHealthCheckSettings() { + return getStubSettingsBuilder().updateHealthCheckSettings(); + } + + @Override + public HealthCheckSettings build() throws IOException { + return new HealthCheckSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java new file mode 100644 index 000000000000..512427c88a90 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HealthStatus implements ApiMessage { + private final String healthState; + private final String instance; + private final String ipAddress; + private final Integer port; + + private HealthStatus() { + this.healthState = null; + this.instance = null; + this.ipAddress = null; + this.port = null; + } + + + private HealthStatus( + String healthState, + String instance, + String ipAddress, + Integer port + ) { + this.healthState = healthState; + this.instance = instance; + this.ipAddress = ipAddress; + this.port = port; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthState") && healthState != null) { + fieldMap.put("healthState", Collections.singletonList(String.valueOf(healthState))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("ipAddress") && ipAddress != null) { + fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthState")) { + return String.valueOf(healthState); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("ipAddress")) { + return String.valueOf(ipAddress); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHealthState() { + return healthState; + } + + public String getInstance() { + return instance; + } + + public String getIpAddress() { + return ipAddress; + } + + public Integer getPort() { + return port; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HealthStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HealthStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HealthStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HealthStatus(); + } + + public static class Builder { + private String healthState; + private String instance; + private String ipAddress; + private Integer port; + + Builder() {} + + public Builder mergeFrom(HealthStatus other) { + if (other == HealthStatus.getDefaultInstance()) return this; + if (other.getHealthState() != null) { + this.healthState = other.healthState; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getIpAddress() != null) { + this.ipAddress = other.ipAddress; + } + if (other.getPort() != null) { + this.port = other.port; + } + return this; + } + + Builder(HealthStatus source) { + this.healthState = source.healthState; + this.instance = source.instance; + this.ipAddress = source.ipAddress; + this.port = source.port; + } + + public String getHealthState() { + return healthState; + } + + public Builder setHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getIpAddress() { + return ipAddress; + } + + public Builder setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + + public HealthStatus build() { + + + + return new HealthStatus( + healthState, + instance, + ipAddress, + port + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHealthState(this.healthState); + newBuilder.setInstance(this.instance); + newBuilder.setIpAddress(this.ipAddress); + newBuilder.setPort(this.port); + return newBuilder; + } + } + + @Override + public String toString() { + return "HealthStatus{" + + "healthState=" + healthState + ", " + + "instance=" + instance + ", " + + "ipAddress=" + ipAddress + ", " + + "port=" + port + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HealthStatus) { + HealthStatus that = (HealthStatus) o; + return + Objects.equals(this.healthState, that.getHealthState()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.ipAddress, that.getIpAddress()) && + Objects.equals(this.port, that.getPort()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthState, + instance, + ipAddress, + port + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java new file mode 100644 index 000000000000..ef0a4b0dd8f9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java @@ -0,0 +1,242 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HostRule implements ApiMessage { + private final String description; + private final List hosts; + private final String pathMatcher; + + private HostRule() { + this.description = null; + this.hosts = null; + this.pathMatcher = null; + } + + + private HostRule( + String description, + List hosts, + String pathMatcher + ) { + this.description = description; + this.hosts = hosts; + this.pathMatcher = pathMatcher; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("hosts") && hosts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : hosts) { + stringList.add(item.toString()); + } + fieldMap.put("hosts", stringList.build()); + } + if (fieldNames.contains("pathMatcher") && pathMatcher != null) { + fieldMap.put("pathMatcher", Collections.singletonList(String.valueOf(pathMatcher))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("hosts")) { + return String.valueOf(hosts); + } + if (fieldName.equals("pathMatcher")) { + return String.valueOf(pathMatcher); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDescription() { + return description; + } + + public List getHostsList() { + return hosts; + } + + public String getPathMatcher() { + return pathMatcher; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HostRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HostRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HostRule DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HostRule(); + } + + public static class Builder { + private String description; + private List hosts; + private String pathMatcher; + + Builder() {} + + public Builder mergeFrom(HostRule other) { + if (other == HostRule.getDefaultInstance()) return this; + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHostsList() != null) { + this.hosts = other.hosts; + } + if (other.getPathMatcher() != null) { + this.pathMatcher = other.pathMatcher; + } + return this; + } + + Builder(HostRule source) { + this.description = source.description; + this.hosts = source.hosts; + this.pathMatcher = source.pathMatcher; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getHostsList() { + return hosts; + } + + public Builder addAllHosts(List hosts) { + if (this.hosts == null) { + this.hosts = new ArrayList<>(hosts.size()); + } + this.hosts.addAll(hosts); + return this; + } + + public Builder addHosts(String hosts) { + this.hosts.add(hosts); + return this; + } + + public String getPathMatcher() { + return pathMatcher; + } + + public Builder setPathMatcher(String pathMatcher) { + this.pathMatcher = pathMatcher; + return this; + } + + + public HostRule build() { + + + return new HostRule( + description, + hosts, + pathMatcher + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDescription(this.description); + newBuilder.addAllHosts(this.hosts); + newBuilder.setPathMatcher(this.pathMatcher); + return newBuilder; + } + } + + @Override + public String toString() { + return "HostRule{" + + "description=" + description + ", " + + "hosts=" + hosts + ", " + + "pathMatcher=" + pathMatcher + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HostRule) { + HostRule that = (HostRule) o; + return + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.hosts, that.getHostsList()) && + Objects.equals(this.pathMatcher, that.getPathMatcher()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + description, + hosts, + pathMatcher + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java new file mode 100644 index 000000000000..847dcc0dfa0d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java @@ -0,0 +1,570 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpHealthCheck implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; + private final String host; + private final String id; + private final String kind; + private final String name; + private final Integer port; + private final String requestPath; + private final String selfLink; + private final Integer timeoutSec; + private final Integer unhealthyThreshold; + + private HttpHealthCheck() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; + this.host = null; + this.id = null; + this.kind = null; + this.name = null; + this.port = null; + this.requestPath = null; + this.selfLink = null; + this.timeoutSec = null; + this.unhealthyThreshold = null; + } + + + private HttpHealthCheck( + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + String host, + String id, + String kind, + String name, + Integer port, + String requestPath, + String selfLink, + Integer timeoutSec, + Integer unhealthyThreshold + ) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; + this.host = host; + this.id = id; + this.kind = kind; + this.name = name; + this.port = port; + this.requestPath = requestPath; + this.selfLink = selfLink; + this.timeoutSec = timeoutSec; + this.unhealthyThreshold = unhealthyThreshold; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put("unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return String.valueOf(checkIntervalSec); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("healthyThreshold")) { + return String.valueOf(healthyThreshold); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + if (fieldName.equals("unhealthyThreshold")) { + return String.valueOf(unhealthyThreshold); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public String getHost() { + return host; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + public String getRequestPath() { + return requestPath; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HttpHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HttpHealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HttpHealthCheck(); + } + + public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; + private String host; + private String id; + private String kind; + private String name; + private Integer port; + private String requestPath; + private String selfLink; + private Integer timeoutSec; + private Integer unhealthyThreshold; + + Builder() {} + + public Builder mergeFrom(HttpHealthCheck other) { + if (other == HttpHealthCheck.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } + return this; + } + + Builder(HttpHealthCheck source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; + this.host = source.host; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.port = source.port; + this.requestPath = source.requestPath; + this.selfLink = source.selfLink; + this.timeoutSec = source.timeoutSec; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + + public HttpHealthCheck build() { + + + + + + + + + + + + + return new HttpHealthCheck( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); + newBuilder.setHost(this.host); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + newBuilder.setRequestPath(this.requestPath); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpHealthCheck{" + + "checkIntervalSec=" + checkIntervalSec + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "healthyThreshold=" + healthyThreshold + ", " + + "host=" + host + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "port=" + port + ", " + + "requestPath=" + requestPath + ", " + + "selfLink=" + selfLink + ", " + + "timeoutSec=" + timeoutSec + ", " + + "unhealthyThreshold=" + unhealthyThreshold + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpHealthCheck) { + HttpHealthCheck that = (HttpHealthCheck) o; + return + Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) && + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.requestPath, that.getRequestPath()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.timeoutSec, that.getTimeoutSec()) && + Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java new file mode 100644 index 000000000000..f58b8b704927 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -0,0 +1,926 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.HttpHealthCheckStub; +import com.google.cloud.compute.v1.stub.HttpHealthCheckStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+ *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+ *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the httpHealthCheckClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of HttpHealthCheckSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * HttpHealthCheckSettings httpHealthCheckSettings =
+ *     HttpHealthCheckSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * HttpHealthCheckClient httpHealthCheckClient =
+ *     HttpHealthCheckClient.create(httpHealthCheckSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * HttpHealthCheckSettings httpHealthCheckSettings =
+ *     HttpHealthCheckSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HttpHealthCheckClient httpHealthCheckClient =
+ *     HttpHealthCheckClient.create(httpHealthCheckSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HttpHealthCheckClient implements BackgroundResource { + private final HttpHealthCheckSettings settings; + private final HttpHealthCheckStub stub; + + + + /** + * Constructs an instance of HttpHealthCheckClient with default settings. + */ + public static final HttpHealthCheckClient create() throws IOException { + return create(HttpHealthCheckSettings.newBuilder().build()); + } + + /** + * Constructs an instance of HttpHealthCheckClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final HttpHealthCheckClient create(HttpHealthCheckSettings settings) throws IOException { + return new HttpHealthCheckClient(settings); + } + + /** + * Constructs an instance of HttpHealthCheckClient, using the given stub for making calls. This is for + * advanced usage - prefer to use HttpHealthCheckSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final HttpHealthCheckClient create(HttpHealthCheckStub stub) { + return new HttpHealthCheckClient(stub); + } + + /** + * Constructs an instance of HttpHealthCheckClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpHealthCheckClient(HttpHealthCheckSettings settings) throws IOException { + this.settings = settings; + this.stub = ((HttpHealthCheckStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected HttpHealthCheckClient(HttpHealthCheckStub stub) { + this.settings = null; + this.stub = stub; + } + + public final HttpHealthCheckSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HttpHealthCheckStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpHealthCheck resource. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHttpHealthCheck(HttpHealthCheckName httpHealthCheck) { + + DeleteHttpHealthCheckHttpRequest request = + DeleteHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .build(); + return deleteHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpHealthCheck resource. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck.toString());
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHttpHealthCheck(String httpHealthCheck) { + + DeleteHttpHealthCheckHttpRequest request = + DeleteHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck) + .build(); + return deleteHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpHealthCheck resource. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .build();
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest request) { + return deleteHttpHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpHealthCheck resource. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = httpHealthCheckClient.deleteHttpHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteHttpHealthCheckCallable() { + return stub.deleteHttpHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HttpHealthCheck getHttpHealthCheck(HttpHealthCheckName httpHealthCheck) { + + GetHttpHealthCheckHttpRequest request = + GetHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .build(); + return getHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { + + GetHttpHealthCheckHttpRequest request = + GetHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck) + .build(); + return getHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .build();
+   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { + return getHttpHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .build();
+   *   ApiFuture<HttpHealthCheck> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   HttpHealthCheck response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getHttpHealthCheckCallable() { + return stub.getHttpHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(project, httpHealthCheckResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHttpHealthCheck(ProjectName project, HttpHealthCheck httpHealthCheckResource) { + + InsertHttpHealthCheckHttpRequest request = + InsertHttpHealthCheckHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); + return insertHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(project.toString(), httpHealthCheckResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHttpHealthCheck(String project, HttpHealthCheck httpHealthCheckResource) { + + InsertHttpHealthCheckHttpRequest request = + InsertHttpHealthCheckHttpRequest.newBuilder() + .setProject(project) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); + return insertHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setHttpHealthCheckResource(httpHealthCheckResource)
+   *     .build();
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest request) { + return insertHttpHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setHttpHealthCheckResource(httpHealthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = httpHealthCheckClient.insertHttpHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertHttpHealthCheckCallable() { + return stub.insertHttpHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName project) { + ListHttpHealthChecksHttpRequest request = + ListHttpHealthChecksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listHttpHealthChecks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String project) { + ListHttpHealthChecksHttpRequest request = + ListHttpHealthChecksHttpRequest.newBuilder() + .setProject(project) + .build(); + return listHttpHealthChecks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ListHttpHealthChecksHttpRequest request) { + return listHttpHealthChecksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListHttpHealthChecksPagedResponse> future = httpHealthCheckClient.listHttpHealthChecksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (HttpHealthCheck element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listHttpHealthChecksPagedCallable() { + return stub.listHttpHealthChecksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     HttpHealthCheckList response = httpHealthCheckClient.listHttpHealthChecksCallable().call(request);
+   *     for (HttpHealthCheck element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listHttpHealthChecksCallable() { + return stub.listHttpHealthChecksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource);
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHttpHealthCheck(HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + + PatchHttpHealthCheckHttpRequest request = + PatchHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); + return patchHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource);
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHttpHealthCheck(String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + + PatchHttpHealthCheckHttpRequest request = + PatchHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); + return patchHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .setHttpHealthCheckResource(httpHealthCheckResource)
+   *     .build();
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest request) { + return patchHttpHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .setHttpHealthCheckResource(httpHealthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = httpHealthCheckClient.patchHttpHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchHttpHealthCheckCallable() { + return stub.patchHttpHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource);
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHttpHealthCheck(HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + + UpdateHttpHealthCheckHttpRequest request = + UpdateHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); + return updateHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource);
+   * }
+   * 
+ * + * @param httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHttpHealthCheck(String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + + UpdateHttpHealthCheckHttpRequest request = + UpdateHttpHealthCheckHttpRequest.newBuilder() + .setHttpHealthCheck(httpHealthCheck) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); + return updateHttpHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .setHttpHealthCheckResource(httpHealthCheckResource)
+   *     .build();
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest request) { + return updateHttpHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
+   *     .setHttpHealthCheck(httpHealthCheck.toString())
+   *     .setHttpHealthCheckResource(httpHealthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = httpHealthCheckClient.updateHttpHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateHttpHealthCheckCallable() { + return stub.updateHttpHealthCheckCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListHttpHealthChecksPagedResponse extends AbstractPagedListResponse< + ListHttpHealthChecksHttpRequest, + HttpHealthCheckList, + HttpHealthCheck, + ListHttpHealthChecksPage, + ListHttpHealthChecksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHttpHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListHttpHealthChecksPagedResponse apply(ListHttpHealthChecksPage input) { + return new ListHttpHealthChecksPagedResponse(input); + } + }); + } + + private ListHttpHealthChecksPagedResponse(ListHttpHealthChecksPage page) { + super(page, ListHttpHealthChecksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListHttpHealthChecksPage extends AbstractPage< + ListHttpHealthChecksHttpRequest, + HttpHealthCheckList, + HttpHealthCheck, + ListHttpHealthChecksPage> { + + private ListHttpHealthChecksPage( + PageContext context, + HttpHealthCheckList response) { + super(context, response); + } + + private static ListHttpHealthChecksPage createEmptyPage() { + return new ListHttpHealthChecksPage(null, null); + } + + @Override + protected ListHttpHealthChecksPage createPage( + PageContext context, + HttpHealthCheckList response) { + return new ListHttpHealthChecksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListHttpHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< + ListHttpHealthChecksHttpRequest, + HttpHealthCheckList, + HttpHealthCheck, + ListHttpHealthChecksPage, + ListHttpHealthChecksFixedSizeCollection> { + + private ListHttpHealthChecksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHttpHealthChecksFixedSizeCollection createEmptyCollection() { + return new ListHttpHealthChecksFixedSizeCollection(null, 0); + } + + @Override + protected ListHttpHealthChecksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHttpHealthChecksFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java new file mode 100644 index 000000000000..9f5521cb6f6f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpHealthCheckList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private HttpHealthCheckList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private HttpHealthCheckList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HttpHealthCheck item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HttpHealthCheckList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpHealthCheckList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HttpHealthCheckList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HttpHealthCheckList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(HttpHealthCheckList other) { + if (other == HttpHealthCheckList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(HttpHealthCheckList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(HttpHealthCheck items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public HttpHealthCheckList build() { + + + + + return new HttpHealthCheckList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpHealthCheckList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpHealthCheckList) { + HttpHealthCheckList that = (HttpHealthCheckList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java new file mode 100644 index 000000000000..526140f4a050 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class HttpHealthCheckName implements ResourceName { + private final String httpHealthCheck; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/httpHealthChecks/{httpHealthCheck}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private HttpHealthCheckName(Builder builder) { + httpHealthCheck = Preconditions.checkNotNull(builder.getHttpHealthCheck()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static HttpHealthCheckName of( + String httpHealthCheck, + String project + ) { + return newBuilder() + .setHttpHealthCheck(httpHealthCheck) + .setProject(project) + .build(); + } + + public static String format( + String httpHealthCheck, + String project + ) { + return of( + httpHealthCheck, + project + ) + .toString(); + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("httpHealthCheck", httpHealthCheck); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public HttpHealthCheckName parse(String formattedString) {return HttpHealthCheckName.parse(formattedString);} + }; + } + + public static HttpHealthCheckName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "HttpHealthCheckName.parse: formattedString not in valid format"); + return of( + matchMap.get("httpHealthCheck"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String httpHealthCheck; + private String project; + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + public String getProject() { + return project; + } + + public Builder setHttpHealthCheck(String httpHealthCheck) { + this.httpHealthCheck = httpHealthCheck; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (HttpHealthCheckName httpHealthCheckName) { + httpHealthCheck = httpHealthCheckName.httpHealthCheck; + project = httpHealthCheckName.project; + } + + public HttpHealthCheckName build() { + return new HttpHealthCheckName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "httpHealthCheck", httpHealthCheck, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpHealthCheckName) { + HttpHealthCheckName that = (HttpHealthCheckName) o; + return + Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + httpHealthCheck, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java new file mode 100644 index 000000000000..ba8b5ac32b64 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import com.google.cloud.compute.v1.stub.HttpHealthCheckStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link HttpHealthCheckClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteHttpHealthCheck to 30 seconds: + * + *

+ * 
+ * HttpHealthCheckSettings.Builder httpHealthCheckSettingsBuilder =
+ *     HttpHealthCheckSettings.newBuilder();
+ * httpHealthCheckSettingsBuilder.deleteHttpHealthCheckSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * HttpHealthCheckSettings httpHealthCheckSettings = httpHealthCheckSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HttpHealthCheckSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteHttpHealthCheck. + */ + public UnaryCallSettings deleteHttpHealthCheckSettings() { + return ((HttpHealthCheckStubSettings) getStubSettings()).deleteHttpHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to getHttpHealthCheck. + */ + public UnaryCallSettings getHttpHealthCheckSettings() { + return ((HttpHealthCheckStubSettings) getStubSettings()).getHttpHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to insertHttpHealthCheck. + */ + public UnaryCallSettings insertHttpHealthCheckSettings() { + return ((HttpHealthCheckStubSettings) getStubSettings()).insertHttpHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to listHttpHealthChecks. + */ + public PagedCallSettings listHttpHealthChecksSettings() { + return ((HttpHealthCheckStubSettings) getStubSettings()).listHttpHealthChecksSettings(); + } + + /** + * Returns the object with the settings used for calls to patchHttpHealthCheck. + */ + public UnaryCallSettings patchHttpHealthCheckSettings() { + return ((HttpHealthCheckStubSettings) getStubSettings()).patchHttpHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to updateHttpHealthCheck. + */ + public UnaryCallSettings updateHttpHealthCheckSettings() { + return ((HttpHealthCheckStubSettings) getStubSettings()).updateHttpHealthCheckSettings(); + } + + + public static final HttpHealthCheckSettings create(HttpHealthCheckStubSettings stub) throws IOException { + return new HttpHealthCheckSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return HttpHealthCheckStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return HttpHealthCheckStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return HttpHealthCheckStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return HttpHealthCheckStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return HttpHealthCheckStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return HttpHealthCheckStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return HttpHealthCheckStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HttpHealthCheckStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected HttpHealthCheckSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for HttpHealthCheckSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(HttpHealthCheckStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(HttpHealthCheckStubSettings.newBuilder()); + } + + protected Builder(HttpHealthCheckSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(HttpHealthCheckStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public HttpHealthCheckStubSettings.Builder getStubSettingsBuilder() { + return ((HttpHealthCheckStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteHttpHealthCheck. + */ + public UnaryCallSettings.Builder deleteHttpHealthCheckSettings() { + return getStubSettingsBuilder().deleteHttpHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to getHttpHealthCheck. + */ + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { + return getStubSettingsBuilder().getHttpHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertHttpHealthCheck. + */ + public UnaryCallSettings.Builder insertHttpHealthCheckSettings() { + return getStubSettingsBuilder().insertHttpHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to listHttpHealthChecks. + */ + public PagedCallSettings.Builder listHttpHealthChecksSettings() { + return getStubSettingsBuilder().listHttpHealthChecksSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchHttpHealthCheck. + */ + public UnaryCallSettings.Builder patchHttpHealthCheckSettings() { + return getStubSettingsBuilder().patchHttpHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateHttpHealthCheck. + */ + public UnaryCallSettings.Builder updateHttpHealthCheckSettings() { + return getStubSettingsBuilder().updateHttpHealthCheckSettings(); + } + + @Override + public HttpHealthCheckSettings build() throws IOException { + return new HttpHealthCheckSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java new file mode 100644 index 000000000000..be2790e60d80 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java @@ -0,0 +1,570 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpsHealthCheck implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; + private final String host; + private final String id; + private final String kind; + private final String name; + private final Integer port; + private final String requestPath; + private final String selfLink; + private final Integer timeoutSec; + private final Integer unhealthyThreshold; + + private HttpsHealthCheck() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; + this.host = null; + this.id = null; + this.kind = null; + this.name = null; + this.port = null; + this.requestPath = null; + this.selfLink = null; + this.timeoutSec = null; + this.unhealthyThreshold = null; + } + + + private HttpsHealthCheck( + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + String host, + String id, + String kind, + String name, + Integer port, + String requestPath, + String selfLink, + Integer timeoutSec, + Integer unhealthyThreshold + ) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; + this.host = host; + this.id = id; + this.kind = kind; + this.name = name; + this.port = port; + this.requestPath = requestPath; + this.selfLink = selfLink; + this.timeoutSec = timeoutSec; + this.unhealthyThreshold = unhealthyThreshold; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put("unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return String.valueOf(checkIntervalSec); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("healthyThreshold")) { + return String.valueOf(healthyThreshold); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + if (fieldName.equals("unhealthyThreshold")) { + return String.valueOf(unhealthyThreshold); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public String getHost() { + return host; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + public String getRequestPath() { + return requestPath; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HttpsHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpsHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HttpsHealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HttpsHealthCheck(); + } + + public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; + private String host; + private String id; + private String kind; + private String name; + private Integer port; + private String requestPath; + private String selfLink; + private Integer timeoutSec; + private Integer unhealthyThreshold; + + Builder() {} + + public Builder mergeFrom(HttpsHealthCheck other) { + if (other == HttpsHealthCheck.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } + return this; + } + + Builder(HttpsHealthCheck source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; + this.host = source.host; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.port = source.port; + this.requestPath = source.requestPath; + this.selfLink = source.selfLink; + this.timeoutSec = source.timeoutSec; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + + public HttpsHealthCheck build() { + + + + + + + + + + + + + return new HttpsHealthCheck( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); + newBuilder.setHost(this.host); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + newBuilder.setRequestPath(this.requestPath); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpsHealthCheck{" + + "checkIntervalSec=" + checkIntervalSec + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "healthyThreshold=" + healthyThreshold + ", " + + "host=" + host + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "port=" + port + ", " + + "requestPath=" + requestPath + ", " + + "selfLink=" + selfLink + ", " + + "timeoutSec=" + timeoutSec + ", " + + "unhealthyThreshold=" + unhealthyThreshold + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpsHealthCheck) { + HttpsHealthCheck that = (HttpsHealthCheck) o; + return + Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) && + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.requestPath, that.getRequestPath()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.timeoutSec, that.getTimeoutSec()) && + Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java new file mode 100644 index 000000000000..cd22810f10f2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -0,0 +1,926 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.HttpsHealthCheckStub; +import com.google.cloud.compute.v1.stub.HttpsHealthCheckStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+ *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+ *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the httpsHealthCheckClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of HttpsHealthCheckSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * HttpsHealthCheckSettings httpsHealthCheckSettings =
+ *     HttpsHealthCheckSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * HttpsHealthCheckClient httpsHealthCheckClient =
+ *     HttpsHealthCheckClient.create(httpsHealthCheckSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * HttpsHealthCheckSettings httpsHealthCheckSettings =
+ *     HttpsHealthCheckSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HttpsHealthCheckClient httpsHealthCheckClient =
+ *     HttpsHealthCheckClient.create(httpsHealthCheckSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HttpsHealthCheckClient implements BackgroundResource { + private final HttpsHealthCheckSettings settings; + private final HttpsHealthCheckStub stub; + + + + /** + * Constructs an instance of HttpsHealthCheckClient with default settings. + */ + public static final HttpsHealthCheckClient create() throws IOException { + return create(HttpsHealthCheckSettings.newBuilder().build()); + } + + /** + * Constructs an instance of HttpsHealthCheckClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final HttpsHealthCheckClient create(HttpsHealthCheckSettings settings) throws IOException { + return new HttpsHealthCheckClient(settings); + } + + /** + * Constructs an instance of HttpsHealthCheckClient, using the given stub for making calls. This is for + * advanced usage - prefer to use HttpsHealthCheckSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final HttpsHealthCheckClient create(HttpsHealthCheckStub stub) { + return new HttpsHealthCheckClient(stub); + } + + /** + * Constructs an instance of HttpsHealthCheckClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpsHealthCheckClient(HttpsHealthCheckSettings settings) throws IOException { + this.settings = settings; + this.stub = ((HttpsHealthCheckStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected HttpsHealthCheckClient(HttpsHealthCheckStub stub) { + this.settings = null; + this.stub = stub; + } + + public final HttpsHealthCheckSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HttpsHealthCheckStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpsHealthCheck resource. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck) { + + DeleteHttpsHealthCheckHttpRequest request = + DeleteHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .build(); + return deleteHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpsHealthCheck resource. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString());
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHttpsHealthCheck(String httpsHealthCheck) { + + DeleteHttpsHealthCheckHttpRequest request = + DeleteHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck) + .build(); + return deleteHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpsHealthCheck resource. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .build();
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest request) { + return deleteHttpsHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified HttpsHealthCheck resource. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = httpsHealthCheckClient.deleteHttpsHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteHttpsHealthCheckCallable() { + return stub.deleteHttpsHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HttpsHealthCheck getHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck) { + + GetHttpsHealthCheckHttpRequest request = + GetHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .build(); + return getHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { + + GetHttpsHealthCheckHttpRequest request = + GetHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck) + .build(); + return getHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .build();
+   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { + return getHttpsHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .build();
+   *   ApiFuture<HttpsHealthCheck> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   HttpsHealthCheck response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getHttpsHealthCheckCallable() { + return stub.getHttpsHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project, httpsHealthCheckResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHttpsHealthCheck(ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { + + InsertHttpsHealthCheckHttpRequest request = + InsertHttpsHealthCheckHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); + return insertHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project.toString(), httpsHealthCheckResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHttpsHealthCheck(String project, HttpsHealthCheck httpsHealthCheckResource) { + + InsertHttpsHealthCheckHttpRequest request = + InsertHttpsHealthCheckHttpRequest.newBuilder() + .setProject(project) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); + return insertHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
+   *     .build();
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest request) { + return insertHttpsHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = httpsHealthCheckClient.insertHttpsHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertHttpsHealthCheckCallable() { + return stub.insertHttpsHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpsHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectName project) { + ListHttpsHealthChecksHttpRequest request = + ListHttpsHealthChecksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listHttpsHealthChecks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpsHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String project) { + ListHttpsHealthChecksHttpRequest request = + ListHttpsHealthChecksHttpRequest.newBuilder() + .setProject(project) + .build(); + return listHttpsHealthChecks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpsHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ListHttpsHealthChecksHttpRequest request) { + return listHttpsHealthChecksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpsHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListHttpsHealthChecksPagedResponse> future = httpsHealthCheckClient.listHttpsHealthChecksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (HttpsHealthCheck element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listHttpsHealthChecksPagedCallable() { + return stub.listHttpsHealthChecksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of HttpsHealthCheck resources available to the specified project. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     HttpsHealthCheckList response = httpsHealthCheckClient.listHttpsHealthChecksCallable().call(request);
+   *     for (HttpsHealthCheck element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listHttpsHealthChecksCallable() { + return stub.listHttpsHealthChecksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource);
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + + PatchHttpsHealthCheckHttpRequest request = + PatchHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); + return patchHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource);
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHttpsHealthCheck(String httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + + PatchHttpsHealthCheckHttpRequest request = + PatchHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); + return patchHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
+   *     .build();
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest request) { + return patchHttpsHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = httpsHealthCheckClient.patchHttpsHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchHttpsHealthCheckCallable() { + return stub.patchHttpsHealthCheckCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource);
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + + UpdateHttpsHealthCheckHttpRequest request = + UpdateHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); + return updateHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource);
+   * }
+   * 
+ * + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHttpsHealthCheck(String httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + + UpdateHttpsHealthCheckHttpRequest request = + UpdateHttpsHealthCheckHttpRequest.newBuilder() + .setHttpsHealthCheck(httpsHealthCheck) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); + return updateHttpsHealthCheck(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
+   *     .build();
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest request) { + return updateHttpsHealthCheckCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
+   *     .build();
+   *   ApiFuture<Operation> future = httpsHealthCheckClient.updateHttpsHealthCheckCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateHttpsHealthCheckCallable() { + return stub.updateHttpsHealthCheckCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListHttpsHealthChecksPagedResponse extends AbstractPagedListResponse< + ListHttpsHealthChecksHttpRequest, + HttpsHealthCheckList, + HttpsHealthCheck, + ListHttpsHealthChecksPage, + ListHttpsHealthChecksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHttpsHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListHttpsHealthChecksPagedResponse apply(ListHttpsHealthChecksPage input) { + return new ListHttpsHealthChecksPagedResponse(input); + } + }); + } + + private ListHttpsHealthChecksPagedResponse(ListHttpsHealthChecksPage page) { + super(page, ListHttpsHealthChecksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListHttpsHealthChecksPage extends AbstractPage< + ListHttpsHealthChecksHttpRequest, + HttpsHealthCheckList, + HttpsHealthCheck, + ListHttpsHealthChecksPage> { + + private ListHttpsHealthChecksPage( + PageContext context, + HttpsHealthCheckList response) { + super(context, response); + } + + private static ListHttpsHealthChecksPage createEmptyPage() { + return new ListHttpsHealthChecksPage(null, null); + } + + @Override + protected ListHttpsHealthChecksPage createPage( + PageContext context, + HttpsHealthCheckList response) { + return new ListHttpsHealthChecksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListHttpsHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< + ListHttpsHealthChecksHttpRequest, + HttpsHealthCheckList, + HttpsHealthCheck, + ListHttpsHealthChecksPage, + ListHttpsHealthChecksFixedSizeCollection> { + + private ListHttpsHealthChecksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHttpsHealthChecksFixedSizeCollection createEmptyCollection() { + return new ListHttpsHealthChecksFixedSizeCollection(null, 0); + } + + @Override + protected ListHttpsHealthChecksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHttpsHealthChecksFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java new file mode 100644 index 000000000000..097c98e99d7a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpsHealthCheckList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private HttpsHealthCheckList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private HttpsHealthCheckList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HttpsHealthCheck item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(HttpsHealthCheckList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpsHealthCheckList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final HttpsHealthCheckList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HttpsHealthCheckList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(HttpsHealthCheckList other) { + if (other == HttpsHealthCheckList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(HttpsHealthCheckList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(HttpsHealthCheck items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public HttpsHealthCheckList build() { + + + + + return new HttpsHealthCheckList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpsHealthCheckList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpsHealthCheckList) { + HttpsHealthCheckList that = (HttpsHealthCheckList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java new file mode 100644 index 000000000000..ba63a73b57e6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class HttpsHealthCheckName implements ResourceName { + private final String httpsHealthCheck; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/httpsHealthChecks/{httpsHealthCheck}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private HttpsHealthCheckName(Builder builder) { + httpsHealthCheck = Preconditions.checkNotNull(builder.getHttpsHealthCheck()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static HttpsHealthCheckName of( + String httpsHealthCheck, + String project + ) { + return newBuilder() + .setHttpsHealthCheck(httpsHealthCheck) + .setProject(project) + .build(); + } + + public static String format( + String httpsHealthCheck, + String project + ) { + return of( + httpsHealthCheck, + project + ) + .toString(); + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("httpsHealthCheck", httpsHealthCheck); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public HttpsHealthCheckName parse(String formattedString) {return HttpsHealthCheckName.parse(formattedString);} + }; + } + + public static HttpsHealthCheckName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "HttpsHealthCheckName.parse: formattedString not in valid format"); + return of( + matchMap.get("httpsHealthCheck"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String httpsHealthCheck; + private String project; + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + public String getProject() { + return project; + } + + public Builder setHttpsHealthCheck(String httpsHealthCheck) { + this.httpsHealthCheck = httpsHealthCheck; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (HttpsHealthCheckName httpsHealthCheckName) { + httpsHealthCheck = httpsHealthCheckName.httpsHealthCheck; + project = httpsHealthCheckName.project; + } + + public HttpsHealthCheckName build() { + return new HttpsHealthCheckName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "httpsHealthCheck", httpsHealthCheck, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpsHealthCheckName) { + HttpsHealthCheckName that = (HttpsHealthCheckName) o; + return + Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + httpsHealthCheck, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java new file mode 100644 index 000000000000..8372d0abcfa1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import com.google.cloud.compute.v1.stub.HttpsHealthCheckStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link HttpsHealthCheckClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteHttpsHealthCheck to 30 seconds: + * + *

+ * 
+ * HttpsHealthCheckSettings.Builder httpsHealthCheckSettingsBuilder =
+ *     HttpsHealthCheckSettings.newBuilder();
+ * httpsHealthCheckSettingsBuilder.deleteHttpsHealthCheckSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * HttpsHealthCheckSettings httpsHealthCheckSettings = httpsHealthCheckSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HttpsHealthCheckSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteHttpsHealthCheck. + */ + public UnaryCallSettings deleteHttpsHealthCheckSettings() { + return ((HttpsHealthCheckStubSettings) getStubSettings()).deleteHttpsHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to getHttpsHealthCheck. + */ + public UnaryCallSettings getHttpsHealthCheckSettings() { + return ((HttpsHealthCheckStubSettings) getStubSettings()).getHttpsHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to insertHttpsHealthCheck. + */ + public UnaryCallSettings insertHttpsHealthCheckSettings() { + return ((HttpsHealthCheckStubSettings) getStubSettings()).insertHttpsHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to listHttpsHealthChecks. + */ + public PagedCallSettings listHttpsHealthChecksSettings() { + return ((HttpsHealthCheckStubSettings) getStubSettings()).listHttpsHealthChecksSettings(); + } + + /** + * Returns the object with the settings used for calls to patchHttpsHealthCheck. + */ + public UnaryCallSettings patchHttpsHealthCheckSettings() { + return ((HttpsHealthCheckStubSettings) getStubSettings()).patchHttpsHealthCheckSettings(); + } + + /** + * Returns the object with the settings used for calls to updateHttpsHealthCheck. + */ + public UnaryCallSettings updateHttpsHealthCheckSettings() { + return ((HttpsHealthCheckStubSettings) getStubSettings()).updateHttpsHealthCheckSettings(); + } + + + public static final HttpsHealthCheckSettings create(HttpsHealthCheckStubSettings stub) throws IOException { + return new HttpsHealthCheckSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return HttpsHealthCheckStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return HttpsHealthCheckStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return HttpsHealthCheckStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return HttpsHealthCheckStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return HttpsHealthCheckStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return HttpsHealthCheckStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return HttpsHealthCheckStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HttpsHealthCheckStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected HttpsHealthCheckSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for HttpsHealthCheckSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(HttpsHealthCheckStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(HttpsHealthCheckStubSettings.newBuilder()); + } + + protected Builder(HttpsHealthCheckSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(HttpsHealthCheckStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public HttpsHealthCheckStubSettings.Builder getStubSettingsBuilder() { + return ((HttpsHealthCheckStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteHttpsHealthCheck. + */ + public UnaryCallSettings.Builder deleteHttpsHealthCheckSettings() { + return getStubSettingsBuilder().deleteHttpsHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to getHttpsHealthCheck. + */ + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { + return getStubSettingsBuilder().getHttpsHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertHttpsHealthCheck. + */ + public UnaryCallSettings.Builder insertHttpsHealthCheckSettings() { + return getStubSettingsBuilder().insertHttpsHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to listHttpsHealthChecks. + */ + public PagedCallSettings.Builder listHttpsHealthChecksSettings() { + return getStubSettingsBuilder().listHttpsHealthChecksSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchHttpsHealthCheck. + */ + public UnaryCallSettings.Builder patchHttpsHealthCheckSettings() { + return getStubSettingsBuilder().patchHttpsHealthCheckSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateHttpsHealthCheck. + */ + public UnaryCallSettings.Builder updateHttpsHealthCheckSettings() { + return getStubSettingsBuilder().updateHttpsHealthCheckSettings(); + } + + @Override + public HttpsHealthCheckSettings build() throws IOException { + return new HttpsHealthCheckSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java new file mode 100644 index 000000000000..43f7e0f17898 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java @@ -0,0 +1,798 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Image implements ApiMessage { + private final String archiveSizeBytes; + private final String creationTimestamp; + private final DeprecationStatus deprecated; + private final String description; + private final String diskSizeGb; + private final String family; + private final List guestOsFeatures; + private final String id; + private final CustomerEncryptionKey imageEncryptionKey; + private final String kind; + private final List licenses; + private final String name; + private final RawDisk rawDisk; + private final String selfLink; + private final String sourceDisk; + private final CustomerEncryptionKey sourceDiskEncryptionKey; + private final String sourceDiskId; + private final String sourceType; + private final String status; + + private Image() { + this.archiveSizeBytes = null; + this.creationTimestamp = null; + this.deprecated = null; + this.description = null; + this.diskSizeGb = null; + this.family = null; + this.guestOsFeatures = null; + this.id = null; + this.imageEncryptionKey = null; + this.kind = null; + this.licenses = null; + this.name = null; + this.rawDisk = null; + this.selfLink = null; + this.sourceDisk = null; + this.sourceDiskEncryptionKey = null; + this.sourceDiskId = null; + this.sourceType = null; + this.status = null; + } + + + private Image( + String archiveSizeBytes, + String creationTimestamp, + DeprecationStatus deprecated, + String description, + String diskSizeGb, + String family, + List guestOsFeatures, + String id, + CustomerEncryptionKey imageEncryptionKey, + String kind, + List licenses, + String name, + RawDisk rawDisk, + String selfLink, + String sourceDisk, + CustomerEncryptionKey sourceDiskEncryptionKey, + String sourceDiskId, + String sourceType, + String status + ) { + this.archiveSizeBytes = archiveSizeBytes; + this.creationTimestamp = creationTimestamp; + this.deprecated = deprecated; + this.description = description; + this.diskSizeGb = diskSizeGb; + this.family = family; + this.guestOsFeatures = guestOsFeatures; + this.id = id; + this.imageEncryptionKey = imageEncryptionKey; + this.kind = kind; + this.licenses = licenses; + this.name = name; + this.rawDisk = rawDisk; + this.selfLink = selfLink; + this.sourceDisk = sourceDisk; + this.sourceDiskEncryptionKey = sourceDiskEncryptionKey; + this.sourceDiskId = sourceDiskId; + this.sourceType = sourceType; + this.status = status; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("archiveSizeBytes") && archiveSizeBytes != null) { + fieldMap.put("archiveSizeBytes", Collections.singletonList(String.valueOf(archiveSizeBytes))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { + fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); + } + if (fieldNames.contains("family") && family != null) { + fieldMap.put("family", Collections.singletonList(String.valueOf(family))); + } + if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (GuestOsFeature item : guestOsFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("guestOsFeatures", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("imageEncryptionKey") && imageEncryptionKey != null) { + fieldMap.put("imageEncryptionKey", Collections.singletonList(String.valueOf(imageEncryptionKey))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("rawDisk") && rawDisk != null) { + fieldMap.put("rawDisk", Collections.singletonList(String.valueOf(rawDisk))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sourceDisk") && sourceDisk != null) { + fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); + } + if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { + fieldMap.put("sourceDiskEncryptionKey", Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); + } + if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { + fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); + } + if (fieldNames.contains("sourceType") && sourceType != null) { + fieldMap.put("sourceType", Collections.singletonList(String.valueOf(sourceType))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("archiveSizeBytes")) { + return String.valueOf(archiveSizeBytes); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("diskSizeGb")) { + return String.valueOf(diskSizeGb); + } + if (fieldName.equals("family")) { + return String.valueOf(family); + } + if (fieldName.equals("guestOsFeatures")) { + return String.valueOf(guestOsFeatures); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("imageEncryptionKey")) { + return String.valueOf(imageEncryptionKey); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("licenses")) { + return String.valueOf(licenses); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("rawDisk")) { + return String.valueOf(rawDisk); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sourceDisk")) { + return String.valueOf(sourceDisk); + } + if (fieldName.equals("sourceDiskEncryptionKey")) { + return String.valueOf(sourceDiskEncryptionKey); + } + if (fieldName.equals("sourceDiskId")) { + return String.valueOf(sourceDiskId); + } + if (fieldName.equals("sourceType")) { + return String.valueOf(sourceType); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getArchiveSizeBytes() { + return archiveSizeBytes; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public String getDiskSizeGb() { + return diskSizeGb; + } + + public String getFamily() { + return family; + } + + public List getGuestOsFeaturesList() { + return guestOsFeatures; + } + + public String getId() { + return id; + } + + public CustomerEncryptionKey getImageEncryptionKey() { + return imageEncryptionKey; + } + + public String getKind() { + return kind; + } + + public List getLicensesList() { + return licenses; + } + + public String getName() { + return name; + } + + public RawDisk getRawDisk() { + return rawDisk; + } + + public String getSelfLink() { + return selfLink; + } + + public String getSourceDisk() { + return sourceDisk; + } + + public CustomerEncryptionKey getSourceDiskEncryptionKey() { + return sourceDiskEncryptionKey; + } + + public String getSourceDiskId() { + return sourceDiskId; + } + + public String getSourceType() { + return sourceType; + } + + public String getStatus() { + return status; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Image prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Image DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Image(); + } + + public static class Builder { + private String archiveSizeBytes; + private String creationTimestamp; + private DeprecationStatus deprecated; + private String description; + private String diskSizeGb; + private String family; + private List guestOsFeatures; + private String id; + private CustomerEncryptionKey imageEncryptionKey; + private String kind; + private List licenses; + private String name; + private RawDisk rawDisk; + private String selfLink; + private String sourceDisk; + private CustomerEncryptionKey sourceDiskEncryptionKey; + private String sourceDiskId; + private String sourceType; + private String status; + + Builder() {} + + public Builder mergeFrom(Image other) { + if (other == Image.getDefaultInstance()) return this; + if (other.getArchiveSizeBytes() != null) { + this.archiveSizeBytes = other.archiveSizeBytes; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDiskSizeGb() != null) { + this.diskSizeGb = other.diskSizeGb; + } + if (other.getFamily() != null) { + this.family = other.family; + } + if (other.getGuestOsFeaturesList() != null) { + this.guestOsFeatures = other.guestOsFeatures; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getImageEncryptionKey() != null) { + this.imageEncryptionKey = other.imageEncryptionKey; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLicensesList() != null) { + this.licenses = other.licenses; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getRawDisk() != null) { + this.rawDisk = other.rawDisk; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSourceDisk() != null) { + this.sourceDisk = other.sourceDisk; + } + if (other.getSourceDiskEncryptionKey() != null) { + this.sourceDiskEncryptionKey = other.sourceDiskEncryptionKey; + } + if (other.getSourceDiskId() != null) { + this.sourceDiskId = other.sourceDiskId; + } + if (other.getSourceType() != null) { + this.sourceType = other.sourceType; + } + if (other.getStatus() != null) { + this.status = other.status; + } + return this; + } + + Builder(Image source) { + this.archiveSizeBytes = source.archiveSizeBytes; + this.creationTimestamp = source.creationTimestamp; + this.deprecated = source.deprecated; + this.description = source.description; + this.diskSizeGb = source.diskSizeGb; + this.family = source.family; + this.guestOsFeatures = source.guestOsFeatures; + this.id = source.id; + this.imageEncryptionKey = source.imageEncryptionKey; + this.kind = source.kind; + this.licenses = source.licenses; + this.name = source.name; + this.rawDisk = source.rawDisk; + this.selfLink = source.selfLink; + this.sourceDisk = source.sourceDisk; + this.sourceDiskEncryptionKey = source.sourceDiskEncryptionKey; + this.sourceDiskId = source.sourceDiskId; + this.sourceType = source.sourceType; + this.status = source.status; + } + + public String getArchiveSizeBytes() { + return archiveSizeBytes; + } + + public Builder setArchiveSizeBytes(String archiveSizeBytes) { + this.archiveSizeBytes = archiveSizeBytes; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getDiskSizeGb() { + return diskSizeGb; + } + + public Builder setDiskSizeGb(String diskSizeGb) { + this.diskSizeGb = diskSizeGb; + return this; + } + + public String getFamily() { + return family; + } + + public Builder setFamily(String family) { + this.family = family; + return this; + } + + public List getGuestOsFeaturesList() { + return guestOsFeatures; + } + + public Builder addAllGuestOsFeatures(List guestOsFeatures) { + if (this.guestOsFeatures == null) { + this.guestOsFeatures = new ArrayList<>(guestOsFeatures.size()); + } + this.guestOsFeatures.addAll(guestOsFeatures); + return this; + } + + public Builder addGuestOsFeatures(GuestOsFeature guestOsFeatures) { + this.guestOsFeatures.add(guestOsFeatures); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public CustomerEncryptionKey getImageEncryptionKey() { + return imageEncryptionKey; + } + + public Builder setImageEncryptionKey(CustomerEncryptionKey imageEncryptionKey) { + this.imageEncryptionKey = imageEncryptionKey; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public List getLicensesList() { + return licenses; + } + + public Builder addAllLicenses(List licenses) { + if (this.licenses == null) { + this.licenses = new ArrayList<>(licenses.size()); + } + this.licenses.addAll(licenses); + return this; + } + + public Builder addLicenses(String licenses) { + this.licenses.add(licenses); + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public RawDisk getRawDisk() { + return rawDisk; + } + + public Builder setRawDisk(RawDisk rawDisk) { + this.rawDisk = rawDisk; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getSourceDisk() { + return sourceDisk; + } + + public Builder setSourceDisk(String sourceDisk) { + this.sourceDisk = sourceDisk; + return this; + } + + public CustomerEncryptionKey getSourceDiskEncryptionKey() { + return sourceDiskEncryptionKey; + } + + public Builder setSourceDiskEncryptionKey(CustomerEncryptionKey sourceDiskEncryptionKey) { + this.sourceDiskEncryptionKey = sourceDiskEncryptionKey; + return this; + } + + public String getSourceDiskId() { + return sourceDiskId; + } + + public Builder setSourceDiskId(String sourceDiskId) { + this.sourceDiskId = sourceDiskId; + return this; + } + + public String getSourceType() { + return sourceType; + } + + public Builder setSourceType(String sourceType) { + this.sourceType = sourceType; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + + public Image build() { + + + + + + + + + + + + + + + + + + + return new Image( + archiveSizeBytes, + creationTimestamp, + deprecated, + description, + diskSizeGb, + family, + guestOsFeatures, + id, + imageEncryptionKey, + kind, + licenses, + name, + rawDisk, + selfLink, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + sourceType, + status + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setArchiveSizeBytes(this.archiveSizeBytes); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setDiskSizeGb(this.diskSizeGb); + newBuilder.setFamily(this.family); + newBuilder.addAllGuestOsFeatures(this.guestOsFeatures); + newBuilder.setId(this.id); + newBuilder.setImageEncryptionKey(this.imageEncryptionKey); + newBuilder.setKind(this.kind); + newBuilder.addAllLicenses(this.licenses); + newBuilder.setName(this.name); + newBuilder.setRawDisk(this.rawDisk); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSourceDisk(this.sourceDisk); + newBuilder.setSourceDiskEncryptionKey(this.sourceDiskEncryptionKey); + newBuilder.setSourceDiskId(this.sourceDiskId); + newBuilder.setSourceType(this.sourceType); + newBuilder.setStatus(this.status); + return newBuilder; + } + } + + @Override + public String toString() { + return "Image{" + + "archiveSizeBytes=" + archiveSizeBytes + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "deprecated=" + deprecated + ", " + + "description=" + description + ", " + + "diskSizeGb=" + diskSizeGb + ", " + + "family=" + family + ", " + + "guestOsFeatures=" + guestOsFeatures + ", " + + "id=" + id + ", " + + "imageEncryptionKey=" + imageEncryptionKey + ", " + + "kind=" + kind + ", " + + "licenses=" + licenses + ", " + + "name=" + name + ", " + + "rawDisk=" + rawDisk + ", " + + "selfLink=" + selfLink + ", " + + "sourceDisk=" + sourceDisk + ", " + + "sourceDiskEncryptionKey=" + sourceDiskEncryptionKey + ", " + + "sourceDiskId=" + sourceDiskId + ", " + + "sourceType=" + sourceType + ", " + + "status=" + status + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Image) { + Image that = (Image) o; + return + Objects.equals(this.archiveSizeBytes, that.getArchiveSizeBytes()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && + Objects.equals(this.family, that.getFamily()) && + Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.imageEncryptionKey, that.getImageEncryptionKey()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.licenses, that.getLicensesList()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.rawDisk, that.getRawDisk()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sourceDisk, that.getSourceDisk()) && + Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) && + Objects.equals(this.sourceDiskId, that.getSourceDiskId()) && + Objects.equals(this.sourceType, that.getSourceType()) && + Objects.equals(this.status, that.getStatus()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + archiveSizeBytes, + creationTimestamp, + deprecated, + description, + diskSizeGb, + family, + guestOsFeatures, + id, + imageEncryptionKey, + kind, + licenses, + name, + rawDisk, + selfLink, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + sourceType, + status + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java new file mode 100644 index 000000000000..905edcde3150 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java @@ -0,0 +1,924 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.ImageStub; +import com.google.cloud.compute.v1.stub.ImageStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ImageClient imageClient = ImageClient.create()) {
+ *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+ *   Operation response = imageClient.deleteImage(image);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the imageClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of ImageSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * ImageSettings imageSettings =
+ *     ImageSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ImageClient imageClient =
+ *     ImageClient.create(imageSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ImageSettings imageSettings =
+ *     ImageSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ImageClient imageClient =
+ *     ImageClient.create(imageSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ImageClient implements BackgroundResource { + private final ImageSettings settings; + private final ImageStub stub; + + + + /** + * Constructs an instance of ImageClient with default settings. + */ + public static final ImageClient create() throws IOException { + return create(ImageSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ImageClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final ImageClient create(ImageSettings settings) throws IOException { + return new ImageClient(settings); + } + + /** + * Constructs an instance of ImageClient, using the given stub for making calls. This is for + * advanced usage - prefer to use ImageSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ImageClient create(ImageStub stub) { + return new ImageClient(stub); + } + + /** + * Constructs an instance of ImageClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected ImageClient(ImageSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ImageStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ImageClient(ImageStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ImageSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ImageStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified image. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   Operation response = imageClient.deleteImage(image);
+   * }
+   * 
+ * + * @param image Name of the image resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteImage(ImageName image) { + + DeleteImageHttpRequest request = + DeleteImageHttpRequest.newBuilder() + .setImage(image == null ? null : image.toString()) + .build(); + return deleteImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified image. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   Operation response = imageClient.deleteImage(image.toString());
+   * }
+   * 
+ * + * @param image Name of the image resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteImage(String image) { + + DeleteImageHttpRequest request = + DeleteImageHttpRequest.newBuilder() + .setImage(image) + .build(); + return deleteImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified image. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
+   *     .setImage(image.toString())
+   *     .build();
+   *   Operation response = imageClient.deleteImage(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteImage(DeleteImageHttpRequest request) { + return deleteImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified image. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
+   *     .setImage(image.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = imageClient.deleteImageCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteImageCallable() { + return stub.deleteImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
+   *   Operation response = imageClient.deprecateImage(image, deprecationStatusResource);
+   * }
+   * 
+ * + * @param image Image name. + * @param deprecationStatusResource Deprecation status for a public resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deprecateImage(ImageName image, DeprecationStatus deprecationStatusResource) { + + DeprecateImageHttpRequest request = + DeprecateImageHttpRequest.newBuilder() + .setImage(image == null ? null : image.toString()) + .setDeprecationStatusResource(deprecationStatusResource) + .build(); + return deprecateImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
+   *   Operation response = imageClient.deprecateImage(image.toString(), deprecationStatusResource);
+   * }
+   * 
+ * + * @param image Image name. + * @param deprecationStatusResource Deprecation status for a public resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deprecateImage(String image, DeprecationStatus deprecationStatusResource) { + + DeprecateImageHttpRequest request = + DeprecateImageHttpRequest.newBuilder() + .setImage(image) + .setDeprecationStatusResource(deprecationStatusResource) + .build(); + return deprecateImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
+   *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
+   *     .setImage(image.toString())
+   *     .setDeprecationStatusResource(deprecationStatusResource)
+   *     .build();
+   *   Operation response = imageClient.deprecateImage(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deprecateImage(DeprecateImageHttpRequest request) { + return deprecateImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
+   *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
+   *     .setImage(image.toString())
+   *     .setDeprecationStatusResource(deprecationStatusResource)
+   *     .build();
+   *   ApiFuture<Operation> future = imageClient.deprecateImageCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deprecateImageCallable() { + return stub.deprecateImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified image. Get a list of available images by making a list() request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   Image response = imageClient.getImage(image);
+   * }
+   * 
+ * + * @param image Name of the image resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Image getImage(ImageName image) { + + GetImageHttpRequest request = + GetImageHttpRequest.newBuilder() + .setImage(image == null ? null : image.toString()) + .build(); + return getImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified image. Get a list of available images by making a list() request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   Image response = imageClient.getImage(image.toString());
+   * }
+   * 
+ * + * @param image Name of the image resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Image getImage(String image) { + + GetImageHttpRequest request = + GetImageHttpRequest.newBuilder() + .setImage(image) + .build(); + return getImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified image. Get a list of available images by making a list() request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   GetImageHttpRequest request = GetImageHttpRequest.newBuilder()
+   *     .setImage(image.toString())
+   *     .build();
+   *   Image response = imageClient.getImage(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Image getImage(GetImageHttpRequest request) { + return getImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified image. Get a list of available images by making a list() request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   GetImageHttpRequest request = GetImageHttpRequest.newBuilder()
+   *     .setImage(image.toString())
+   *     .build();
+   *   ApiFuture<Image> future = imageClient.getImageCallable().futureCall(request);
+   *   // Do something
+   *   Image response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getImageCallable() { + return stub.getImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the latest image that is part of an image family and is not deprecated. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   Image response = imageClient.getFromFamilyImage(family);
+   * }
+   * 
+ * + * @param family Name of the image family to search for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Image getFromFamilyImage(FamilyName family) { + + GetFromFamilyImageHttpRequest request = + GetFromFamilyImageHttpRequest.newBuilder() + .setFamily(family == null ? null : family.toString()) + .build(); + return getFromFamilyImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the latest image that is part of an image family and is not deprecated. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   Image response = imageClient.getFromFamilyImage(family.toString());
+   * }
+   * 
+ * + * @param family Name of the image family to search for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Image getFromFamilyImage(String family) { + + GetFromFamilyImageHttpRequest request = + GetFromFamilyImageHttpRequest.newBuilder() + .setFamily(family) + .build(); + return getFromFamilyImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the latest image that is part of an image family and is not deprecated. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder()
+   *     .setFamily(family.toString())
+   *     .build();
+   *   Image response = imageClient.getFromFamilyImage(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Image getFromFamilyImage(GetFromFamilyImageHttpRequest request) { + return getFromFamilyImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the latest image that is part of an image family and is not deprecated. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder()
+   *     .setFamily(family.toString())
+   *     .build();
+   *   ApiFuture<Image> future = imageClient.getFromFamilyImageCallable().futureCall(request);
+   *   // Do something
+   *   Image response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getFromFamilyImageCallable() { + return stub.getFromFamilyImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an image in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Image imageResource = Image.newBuilder().build();
+   *   Operation response = imageClient.insertImage(project, imageResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param imageResource An Image resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertImage(ProjectName project, Image imageResource) { + + InsertImageHttpRequest request = + InsertImageHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setImageResource(imageResource) + .build(); + return insertImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an image in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Image imageResource = Image.newBuilder().build();
+   *   Operation response = imageClient.insertImage(project.toString(), imageResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param imageResource An Image resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertImage(String project, Image imageResource) { + + InsertImageHttpRequest request = + InsertImageHttpRequest.newBuilder() + .setProject(project) + .setImageResource(imageResource) + .build(); + return insertImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an image in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Image imageResource = Image.newBuilder().build();
+   *   InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setImageResource(imageResource)
+   *     .build();
+   *   Operation response = imageClient.insertImage(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertImage(InsertImageHttpRequest request) { + return insertImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an image in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Image imageResource = Image.newBuilder().build();
+   *   InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setImageResource(imageResource)
+   *     .build();
+   *   ApiFuture<Operation> future = imageClient.insertImageCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertImageCallable() { + return stub.insertImageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of private images available to the specified project. Private 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: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Image element : imageClient.listImages(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListImagesPagedResponse listImages(ProjectName project) { + ListImagesHttpRequest request = + ListImagesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of private images available to the specified project. Private 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: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Image element : imageClient.listImages(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListImagesPagedResponse listImages(String project) { + ListImagesHttpRequest request = + ListImagesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of private images available to the specified project. Private 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: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListImagesHttpRequest request = ListImagesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Image element : imageClient.listImages(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListImagesPagedResponse listImages(ListImagesHttpRequest request) { + return listImagesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of private images available to the specified project. Private 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: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListImagesHttpRequest request = ListImagesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListImagesPagedResponse> future = imageClient.listImagesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Image element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listImagesPagedCallable() { + return stub.listImagesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of private images available to the specified project. Private 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: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListImagesHttpRequest request = ListImagesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     ImageList response = imageClient.listImagesCallable().call(request);
+   *     for (Image element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listImagesCallable() { + return stub.listImagesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListImagesPagedResponse extends AbstractPagedListResponse< + ListImagesHttpRequest, + ImageList, + Image, + ListImagesPage, + ListImagesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListImagesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListImagesPagedResponse apply(ListImagesPage input) { + return new ListImagesPagedResponse(input); + } + }); + } + + private ListImagesPagedResponse(ListImagesPage page) { + super(page, ListImagesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListImagesPage extends AbstractPage< + ListImagesHttpRequest, + ImageList, + Image, + ListImagesPage> { + + private ListImagesPage( + PageContext context, + ImageList response) { + super(context, response); + } + + private static ListImagesPage createEmptyPage() { + return new ListImagesPage(null, null); + } + + @Override + protected ListImagesPage createPage( + PageContext context, + ImageList response) { + return new ListImagesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListImagesFixedSizeCollection extends AbstractFixedSizeCollection< + ListImagesHttpRequest, + ImageList, + Image, + ListImagesPage, + ListImagesFixedSizeCollection> { + + private ListImagesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListImagesFixedSizeCollection createEmptyCollection() { + return new ListImagesFixedSizeCollection(null, 0); + } + + @Override + protected ListImagesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListImagesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java new file mode 100644 index 000000000000..d6e37cffb923 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ImageList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private ImageList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private ImageList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Image item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ImageList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ImageList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ImageList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ImageList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(ImageList other) { + if (other == ImageList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(ImageList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Image items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public ImageList build() { + + + + + return new ImageList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "ImageList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ImageList) { + ImageList that = (ImageList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java new file mode 100644 index 000000000000..67e0002845c1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ImageName implements ResourceName { + private final String image; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/images/{image}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ImageName(Builder builder) { + image = Preconditions.checkNotNull(builder.getImage()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ImageName of( + String image, + String project + ) { + return newBuilder() + .setImage(image) + .setProject(project) + .build(); + } + + public static String format( + String image, + String project + ) { + return of( + image, + project + ) + .toString(); + } + + public String getImage() { + return image; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("image", image); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ImageName parse(String formattedString) {return ImageName.parse(formattedString);} + }; + } + + public static ImageName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ImageName.parse: formattedString not in valid format"); + return of( + matchMap.get("image"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String image; + private String project; + + public String getImage() { + return image; + } + public String getProject() { + return project; + } + + public Builder setImage(String image) { + this.image = image; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (ImageName imageName) { + image = imageName.image; + project = imageName.project; + } + + public ImageName build() { + return new ImageName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "image", image, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ImageName) { + ImageName that = (ImageName) o; + return + Objects.equals(this.image, that.getImage()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + image, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java new file mode 100644 index 000000000000..7298cc7c51e9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import com.google.cloud.compute.v1.stub.ImageStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ImageClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteImage to 30 seconds: + * + *

+ * 
+ * ImageSettings.Builder imageSettingsBuilder =
+ *     ImageSettings.newBuilder();
+ * imageSettingsBuilder.deleteImageSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ImageSettings imageSettings = imageSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ImageSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteImage. + */ + public UnaryCallSettings deleteImageSettings() { + return ((ImageStubSettings) getStubSettings()).deleteImageSettings(); + } + + /** + * Returns the object with the settings used for calls to deprecateImage. + */ + public UnaryCallSettings deprecateImageSettings() { + return ((ImageStubSettings) getStubSettings()).deprecateImageSettings(); + } + + /** + * Returns the object with the settings used for calls to getImage. + */ + public UnaryCallSettings getImageSettings() { + return ((ImageStubSettings) getStubSettings()).getImageSettings(); + } + + /** + * Returns the object with the settings used for calls to getFromFamilyImage. + */ + public UnaryCallSettings getFromFamilyImageSettings() { + return ((ImageStubSettings) getStubSettings()).getFromFamilyImageSettings(); + } + + /** + * Returns the object with the settings used for calls to insertImage. + */ + public UnaryCallSettings insertImageSettings() { + return ((ImageStubSettings) getStubSettings()).insertImageSettings(); + } + + /** + * Returns the object with the settings used for calls to listImages. + */ + public PagedCallSettings listImagesSettings() { + return ((ImageStubSettings) getStubSettings()).listImagesSettings(); + } + + + public static final ImageSettings create(ImageStubSettings stub) throws IOException { + return new ImageSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ImageStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return ImageStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return ImageStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return ImageStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ImageStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return ImageStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ImageStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ImageStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ImageSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for ImageSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ImageStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ImageStubSettings.newBuilder()); + } + + protected Builder(ImageSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ImageStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public ImageStubSettings.Builder getStubSettingsBuilder() { + return ((ImageStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteImage. + */ + public UnaryCallSettings.Builder deleteImageSettings() { + return getStubSettingsBuilder().deleteImageSettings(); + } + + /** + * Returns the builder for the settings used for calls to deprecateImage. + */ + public UnaryCallSettings.Builder deprecateImageSettings() { + return getStubSettingsBuilder().deprecateImageSettings(); + } + + /** + * Returns the builder for the settings used for calls to getImage. + */ + public UnaryCallSettings.Builder getImageSettings() { + return getStubSettingsBuilder().getImageSettings(); + } + + /** + * Returns the builder for the settings used for calls to getFromFamilyImage. + */ + public UnaryCallSettings.Builder getFromFamilyImageSettings() { + return getStubSettingsBuilder().getFromFamilyImageSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertImage. + */ + public UnaryCallSettings.Builder insertImageSettings() { + return getStubSettingsBuilder().insertImageSettings(); + } + + /** + * Returns the builder for the settings used for calls to listImages. + */ + public PagedCallSettings.Builder listImagesSettings() { + return getStubSettingsBuilder().listImagesSettings(); + } + + @Override + public ImageSettings build() throws IOException { + return new ImageSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java new file mode 100644 index 000000000000..c92faec7da67 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertAddressHttpRequest implements ApiMessage { + private final String access_token; + private final Address addressResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private InsertAddressHttpRequest() { + this.access_token = null; + this.addressResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private InsertAddressHttpRequest( + String access_token, + Address addressResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.addressResource = addressResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("addressResource") && addressResource != null) { + fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("addressResource")) { + return String.valueOf(addressResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Address getApiMessageRequestBody() { + return addressResource; + } + + public String getAccessToken() { + return access_token; + } + + public Address getAddressResource() { + return addressResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertAddressHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertAddressHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertAddressHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertAddressHttpRequest(); + } + + public static class Builder { + private String access_token; + private Address addressResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertAddressHttpRequest other) { + if (other == InsertAddressHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAddressResource() != null) { + this.addressResource = other.addressResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertAddressHttpRequest source) { + this.access_token = source.access_token; + this.addressResource = source.addressResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public Address getAddressResource() { + return addressResource; + } + + public Builder setAddressResource(Address addressResource) { + this.addressResource = addressResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertAddressHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertAddressHttpRequest( + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAddressResource(this.addressResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertAddressHttpRequest{" + + "access_token=" + access_token + ", " + + "addressResource=" + addressResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertAddressHttpRequest) { + InsertAddressHttpRequest that = (InsertAddressHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.addressResource, that.getAddressResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java new file mode 100644 index 000000000000..21a7e6bbeb2e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final Autoscaler autoscalerResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private InsertAutoscalerHttpRequest() { + this.access_token = null; + this.autoscalerResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private InsertAutoscalerHttpRequest( + String access_token, + Autoscaler autoscalerResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.autoscalerResource = autoscalerResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscalerResource")) { + return String.valueOf(autoscalerResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public Autoscaler getApiMessageRequestBody() { + return autoscalerResource; + } + + public String getAccessToken() { + return access_token; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private Autoscaler autoscalerResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(InsertAutoscalerHttpRequest other) { + if (other == InsertAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscalerResource() != null) { + this.autoscalerResource = other.autoscalerResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InsertAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscalerResource = source.autoscalerResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public Builder setAutoscalerResource(Autoscaler autoscalerResource) { + this.autoscalerResource = autoscalerResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InsertAutoscalerHttpRequest build() { + String missing = ""; + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertAutoscalerHttpRequest( + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscalerResource(this.autoscalerResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertAutoscalerHttpRequest) { + InsertAutoscalerHttpRequest that = (InsertAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java new file mode 100644 index 000000000000..975e0911b1f9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final BackendService backendServiceResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertBackendServiceHttpRequest() { + this.access_token = null; + this.backendServiceResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertBackendServiceHttpRequest( + String access_token, + BackendService backendServiceResource, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendServiceResource = backendServiceResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendServiceResource")) { + return String.valueOf(backendServiceResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendService getApiMessageRequestBody() { + return backendServiceResource; + } + + public String getAccessToken() { + return access_token; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private BackendService backendServiceResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertBackendServiceHttpRequest other) { + if (other == InsertBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendServiceResource() != null) { + this.backendServiceResource = other.backendServiceResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendServiceResource = source.backendServiceResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public Builder setBackendServiceResource(BackendService backendServiceResource) { + this.backendServiceResource = backendServiceResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertBackendServiceHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertBackendServiceHttpRequest( + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendServiceResource(this.backendServiceResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendServiceResource=" + backendServiceResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertBackendServiceHttpRequest) { + InsertBackendServiceHttpRequest that = (InsertBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java new file mode 100644 index 000000000000..fc1fde7e6e03 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final Disk diskResource; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String sourceImage; + private final String userIp; + private final String zone; + + private InsertDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.diskResource = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.sourceImage = null; + this.userIp = null; + this.zone = null; + } + + + private InsertDiskHttpRequest( + String access_token, + String callback, + Disk diskResource, + String fields, + String key, + String prettyPrint, + String quotaUser, + String sourceImage, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.diskResource = diskResource; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.sourceImage = sourceImage; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskResource") && diskResource != null) { + fieldMap.put("diskResource", Collections.singletonList(String.valueOf(diskResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("diskResource")) { + return String.valueOf(diskResource); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("sourceImage")) { + return String.valueOf(sourceImage); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public Disk getApiMessageRequestBody() { + return diskResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public Disk getDiskResource() { + return diskResource; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSourceImage() { + return sourceImage; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertDiskHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private Disk diskResource; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String sourceImage; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(InsertDiskHttpRequest other) { + if (other == InsertDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDiskResource() != null) { + this.diskResource = other.diskResource; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSourceImage() != null) { + this.sourceImage = other.sourceImage; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InsertDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.diskResource = source.diskResource; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.sourceImage = source.sourceImage; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public Disk getDiskResource() { + return diskResource; + } + + public Builder setDiskResource(Disk diskResource) { + this.diskResource = diskResource; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSourceImage() { + return sourceImage; + } + + public Builder setSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InsertDiskHttpRequest build() { + String missing = ""; + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertDiskHttpRequest( + access_token, + callback, + diskResource, + fields, + key, + prettyPrint, + quotaUser, + sourceImage, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDiskResource(this.diskResource); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSourceImage(this.sourceImage); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertDiskHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "diskResource=" + diskResource + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "sourceImage=" + sourceImage + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertDiskHttpRequest) { + InsertDiskHttpRequest that = (InsertDiskHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.diskResource, that.getDiskResource()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.sourceImage, that.getSourceImage()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + diskResource, + fields, + key, + prettyPrint, + quotaUser, + sourceImage, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java new file mode 100644 index 000000000000..a6f9227fa520 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertFirewallHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final Firewall firewallResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertFirewallHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.firewallResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertFirewallHttpRequest( + String access_token, + String callback, + String fields, + Firewall firewallResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.firewallResource = firewallResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewallResource") && firewallResource != null) { + fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("firewallResource")) { + return String.valueOf(firewallResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Firewall getApiMessageRequestBody() { + return firewallResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public Firewall getFirewallResource() { + return firewallResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertFirewallHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertFirewallHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertFirewallHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertFirewallHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private Firewall firewallResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertFirewallHttpRequest other) { + if (other == InsertFirewallHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFirewallResource() != null) { + this.firewallResource = other.firewallResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertFirewallHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.firewallResource = source.firewallResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public Firewall getFirewallResource() { + return firewallResource; + } + + public Builder setFirewallResource(Firewall firewallResource) { + this.firewallResource = firewallResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertFirewallHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertFirewallHttpRequest( + access_token, + callback, + fields, + firewallResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFirewallResource(this.firewallResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertFirewallHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "firewallResource=" + firewallResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertFirewallHttpRequest) { + InsertFirewallHttpRequest that = (InsertFirewallHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.firewallResource, that.getFirewallResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + firewallResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..2c2fc7b57caa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final ForwardingRule forwardingRuleResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private InsertForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRuleResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private InsertForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + ForwardingRule forwardingRuleResource, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRuleResource = forwardingRuleResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { + fieldMap.put("forwardingRuleResource", Collections.singletonList(String.valueOf(forwardingRuleResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRuleResource")) { + return String.valueOf(forwardingRuleResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ForwardingRule getApiMessageRequestBody() { + return forwardingRuleResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public ForwardingRule getForwardingRuleResource() { + return forwardingRuleResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private ForwardingRule forwardingRuleResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertForwardingRuleHttpRequest other) { + if (other == InsertForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRuleResource() != null) { + this.forwardingRuleResource = other.forwardingRuleResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRuleResource = source.forwardingRuleResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public ForwardingRule getForwardingRuleResource() { + return forwardingRuleResource; + } + + public Builder setForwardingRuleResource(ForwardingRule forwardingRuleResource) { + this.forwardingRuleResource = forwardingRuleResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertForwardingRuleHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRuleResource(this.forwardingRuleResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRuleResource=" + forwardingRuleResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertForwardingRuleHttpRequest) { + InsertForwardingRuleHttpRequest that = (InsertForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRuleResource, that.getForwardingRuleResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java new file mode 100644 index 000000000000..b2cb059d4d56 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertGlobalAddressHttpRequest implements ApiMessage { + private final String access_token; + private final Address addressResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertGlobalAddressHttpRequest() { + this.access_token = null; + this.addressResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertGlobalAddressHttpRequest( + String access_token, + Address addressResource, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.addressResource = addressResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("addressResource") && addressResource != null) { + fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("addressResource")) { + return String.valueOf(addressResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Address getApiMessageRequestBody() { + return addressResource; + } + + public String getAccessToken() { + return access_token; + } + + public Address getAddressResource() { + return addressResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertGlobalAddressHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertGlobalAddressHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertGlobalAddressHttpRequest(); + } + + public static class Builder { + private String access_token; + private Address addressResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertGlobalAddressHttpRequest other) { + if (other == InsertGlobalAddressHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAddressResource() != null) { + this.addressResource = other.addressResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertGlobalAddressHttpRequest source) { + this.access_token = source.access_token; + this.addressResource = source.addressResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public Address getAddressResource() { + return addressResource; + } + + public Builder setAddressResource(Address addressResource) { + this.addressResource = addressResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertGlobalAddressHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertGlobalAddressHttpRequest( + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAddressResource(this.addressResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertGlobalAddressHttpRequest{" + + "access_token=" + access_token + ", " + + "addressResource=" + addressResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertGlobalAddressHttpRequest) { + InsertGlobalAddressHttpRequest that = (InsertGlobalAddressHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.addressResource, that.getAddressResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..c34b27fa121d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertGlobalForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final ForwardingRule forwardingRuleResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertGlobalForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRuleResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertGlobalForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + ForwardingRule forwardingRuleResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRuleResource = forwardingRuleResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { + fieldMap.put("forwardingRuleResource", Collections.singletonList(String.valueOf(forwardingRuleResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRuleResource")) { + return String.valueOf(forwardingRuleResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ForwardingRule getApiMessageRequestBody() { + return forwardingRuleResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public ForwardingRule getForwardingRuleResource() { + return forwardingRuleResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertGlobalForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertGlobalForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertGlobalForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private ForwardingRule forwardingRuleResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertGlobalForwardingRuleHttpRequest other) { + if (other == InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRuleResource() != null) { + this.forwardingRuleResource = other.forwardingRuleResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertGlobalForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRuleResource = source.forwardingRuleResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public ForwardingRule getForwardingRuleResource() { + return forwardingRuleResource; + } + + public Builder setForwardingRuleResource(ForwardingRule forwardingRuleResource) { + this.forwardingRuleResource = forwardingRuleResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertGlobalForwardingRuleHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertGlobalForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRuleResource(this.forwardingRuleResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertGlobalForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRuleResource=" + forwardingRuleResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertGlobalForwardingRuleHttpRequest) { + InsertGlobalForwardingRuleHttpRequest that = (InsertGlobalForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRuleResource, that.getForwardingRuleResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java new file mode 100644 index 000000000000..8ea349a18d1f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final HealthCheck healthCheckResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.healthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + HealthCheck healthCheckResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.healthCheckResource = healthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { + fieldMap.put("healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("healthCheckResource")) { + return String.valueOf(healthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HealthCheck getApiMessageRequestBody() { + return healthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public HealthCheck getHealthCheckResource() { + return healthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private HealthCheck healthCheckResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertHealthCheckHttpRequest other) { + if (other == InsertHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHealthCheckResource() != null) { + this.healthCheckResource = other.healthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.healthCheckResource = source.healthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public HealthCheck getHealthCheckResource() { + return healthCheckResource; + } + + public Builder setHealthCheckResource(HealthCheck healthCheckResource) { + this.healthCheckResource = healthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertHealthCheckHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertHealthCheckHttpRequest( + access_token, + callback, + fields, + healthCheckResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHealthCheckResource(this.healthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "healthCheckResource=" + healthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertHealthCheckHttpRequest) { + InsertHealthCheckHttpRequest that = (InsertHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + healthCheckResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java new file mode 100644 index 000000000000..4aee7ae74179 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertHttpHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final HttpHealthCheck httpHealthCheckResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertHttpHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpHealthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertHttpHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + HttpHealthCheck httpHealthCheckResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpHealthCheckResource = httpHealthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { + fieldMap.put("httpHealthCheckResource", Collections.singletonList(String.valueOf(httpHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpHealthCheckResource")) { + return String.valueOf(httpHealthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HttpHealthCheck getApiMessageRequestBody() { + return httpHealthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public HttpHealthCheck getHttpHealthCheckResource() { + return httpHealthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertHttpHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertHttpHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertHttpHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private HttpHealthCheck httpHealthCheckResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertHttpHealthCheckHttpRequest other) { + if (other == InsertHttpHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpHealthCheckResource() != null) { + this.httpHealthCheckResource = other.httpHealthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertHttpHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpHealthCheckResource = source.httpHealthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public HttpHealthCheck getHttpHealthCheckResource() { + return httpHealthCheckResource; + } + + public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + this.httpHealthCheckResource = httpHealthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertHttpHealthCheckHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertHttpHealthCheckHttpRequest( + access_token, + callback, + fields, + httpHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertHttpHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpHealthCheckResource=" + httpHealthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertHttpHealthCheckHttpRequest) { + InsertHttpHealthCheckHttpRequest that = (InsertHttpHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java new file mode 100644 index 000000000000..e410dfc793cd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertHttpsHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final HttpsHealthCheck httpsHealthCheckResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertHttpsHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpsHealthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertHttpsHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + HttpsHealthCheck httpsHealthCheckResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpsHealthCheckResource = httpsHealthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { + fieldMap.put("httpsHealthCheckResource", Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpsHealthCheckResource")) { + return String.valueOf(httpsHealthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HttpsHealthCheck getApiMessageRequestBody() { + return httpsHealthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public HttpsHealthCheck getHttpsHealthCheckResource() { + return httpsHealthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertHttpsHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertHttpsHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertHttpsHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private HttpsHealthCheck httpsHealthCheckResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertHttpsHealthCheckHttpRequest other) { + if (other == InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpsHealthCheckResource() != null) { + this.httpsHealthCheckResource = other.httpsHealthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertHttpsHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpsHealthCheckResource = source.httpsHealthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public HttpsHealthCheck getHttpsHealthCheckResource() { + return httpsHealthCheckResource; + } + + public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + this.httpsHealthCheckResource = httpsHealthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertHttpsHealthCheckHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertHttpsHealthCheckHttpRequest( + access_token, + callback, + fields, + httpsHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertHttpsHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpsHealthCheckResource=" + httpsHealthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertHttpsHealthCheckHttpRequest) { + InsertHttpsHealthCheckHttpRequest that = (InsertHttpsHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpsHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java new file mode 100644 index 000000000000..d9e31ed0fea4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertImageHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final Image imageResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.imageResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertImageHttpRequest( + String access_token, + String callback, + String fields, + Image imageResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.imageResource = imageResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("imageResource") && imageResource != null) { + fieldMap.put("imageResource", Collections.singletonList(String.valueOf(imageResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("imageResource")) { + return String.valueOf(imageResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Image getApiMessageRequestBody() { + return imageResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public Image getImageResource() { + return imageResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertImageHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertImageHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private Image imageResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertImageHttpRequest other) { + if (other == InsertImageHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getImageResource() != null) { + this.imageResource = other.imageResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertImageHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.imageResource = source.imageResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public Image getImageResource() { + return imageResource; + } + + public Builder setImageResource(Image imageResource) { + this.imageResource = imageResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertImageHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertImageHttpRequest( + access_token, + callback, + fields, + imageResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setImageResource(this.imageResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertImageHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "imageResource=" + imageResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertImageHttpRequest) { + InsertImageHttpRequest that = (InsertImageHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.imageResource, that.getImageResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + imageResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..467b3cf98738 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InstanceGroup instanceGroupResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private InsertInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private InsertInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + InstanceGroup instanceGroupResource, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupResource = instanceGroupResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupResource") && instanceGroupResource != null) { + fieldMap.put("instanceGroupResource", Collections.singletonList(String.valueOf(instanceGroupResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupResource")) { + return String.valueOf(instanceGroupResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public InstanceGroup getApiMessageRequestBody() { + return instanceGroupResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InstanceGroup getInstanceGroupResource() { + return instanceGroupResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InstanceGroup instanceGroupResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(InsertInstanceGroupHttpRequest other) { + if (other == InsertInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupResource() != null) { + this.instanceGroupResource = other.instanceGroupResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InsertInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupResource = source.instanceGroupResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InstanceGroup getInstanceGroupResource() { + return instanceGroupResource; + } + + public Builder setInstanceGroupResource(InstanceGroup instanceGroupResource) { + this.instanceGroupResource = instanceGroupResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InsertInstanceGroupHttpRequest build() { + String missing = ""; + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroupResource, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupResource(this.instanceGroupResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupResource=" + instanceGroupResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertInstanceGroupHttpRequest) { + InsertInstanceGroupHttpRequest that = (InsertInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupResource, that.getInstanceGroupResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupResource, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..6fb6a524f723 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InstanceGroupManager instanceGroupManagerResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private InsertInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManagerResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private InsertInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + InstanceGroupManager instanceGroupManagerResource, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManagerResource = instanceGroupManagerResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManagerResource") && instanceGroupManagerResource != null) { + fieldMap.put("instanceGroupManagerResource", Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManagerResource")) { + return String.valueOf(instanceGroupManagerResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManager getApiMessageRequestBody() { + return instanceGroupManagerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InstanceGroupManager instanceGroupManagerResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(InsertInstanceGroupManagerHttpRequest other) { + if (other == InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManagerResource() != null) { + this.instanceGroupManagerResource = other.instanceGroupManagerResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InsertInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManagerResource = source.instanceGroupManagerResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + public Builder setInstanceGroupManagerResource(InstanceGroupManager instanceGroupManagerResource) { + this.instanceGroupManagerResource = instanceGroupManagerResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InsertInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManagerResource(this.instanceGroupManagerResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManagerResource=" + instanceGroupManagerResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertInstanceGroupManagerHttpRequest) { + InsertInstanceGroupManagerHttpRequest that = (InsertInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java new file mode 100644 index 000000000000..93fab884c5bb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final Instance instanceResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private InsertInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private InsertInstanceHttpRequest( + String access_token, + String callback, + String fields, + Instance instanceResource, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceResource = instanceResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceResource") && instanceResource != null) { + fieldMap.put("instanceResource", Collections.singletonList(String.valueOf(instanceResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceResource")) { + return String.valueOf(instanceResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public Instance getApiMessageRequestBody() { + return instanceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public Instance getInstanceResource() { + return instanceResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private Instance instanceResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(InsertInstanceHttpRequest other) { + if (other == InsertInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceResource() != null) { + this.instanceResource = other.instanceResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InsertInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceResource = source.instanceResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public Instance getInstanceResource() { + return instanceResource; + } + + public Builder setInstanceResource(Instance instanceResource) { + this.instanceResource = instanceResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InsertInstanceHttpRequest build() { + String missing = ""; + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertInstanceHttpRequest( + access_token, + callback, + fields, + instanceResource, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceResource(this.instanceResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceResource=" + instanceResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertInstanceHttpRequest) { + InsertInstanceHttpRequest that = (InsertInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceResource, that.getInstanceResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceResource, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java new file mode 100644 index 000000000000..32497a5b6ba2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertInstanceTemplateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InstanceTemplate instanceTemplateResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertInstanceTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceTemplateResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertInstanceTemplateHttpRequest( + String access_token, + String callback, + String fields, + InstanceTemplate instanceTemplateResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceTemplateResource = instanceTemplateResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceTemplateResource") && instanceTemplateResource != null) { + fieldMap.put("instanceTemplateResource", Collections.singletonList(String.valueOf(instanceTemplateResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceTemplateResource")) { + return String.valueOf(instanceTemplateResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceTemplate getApiMessageRequestBody() { + return instanceTemplateResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InstanceTemplate getInstanceTemplateResource() { + return instanceTemplateResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertInstanceTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertInstanceTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertInstanceTemplateHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertInstanceTemplateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InstanceTemplate instanceTemplateResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertInstanceTemplateHttpRequest other) { + if (other == InsertInstanceTemplateHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceTemplateResource() != null) { + this.instanceTemplateResource = other.instanceTemplateResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertInstanceTemplateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceTemplateResource = source.instanceTemplateResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InstanceTemplate getInstanceTemplateResource() { + return instanceTemplateResource; + } + + public Builder setInstanceTemplateResource(InstanceTemplate instanceTemplateResource) { + this.instanceTemplateResource = instanceTemplateResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertInstanceTemplateHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertInstanceTemplateHttpRequest( + access_token, + callback, + fields, + instanceTemplateResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceTemplateResource(this.instanceTemplateResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertInstanceTemplateHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceTemplateResource=" + instanceTemplateResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertInstanceTemplateHttpRequest) { + InsertInstanceTemplateHttpRequest that = (InsertInstanceTemplateHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceTemplateResource, that.getInstanceTemplateResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceTemplateResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java new file mode 100644 index 000000000000..79bcded2143d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final Network networkResource; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private InsertNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.networkResource = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private InsertNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + Network networkResource, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.networkResource = networkResource; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkResource") && networkResource != null) { + fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("networkResource")) { + return String.valueOf(networkResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Network getApiMessageRequestBody() { + return networkResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public Network getNetworkResource() { + return networkResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private Network networkResource; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertNetworkHttpRequest other) { + if (other == InsertNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetworkResource() != null) { + this.networkResource = other.networkResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.networkResource = source.networkResource; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Network getNetworkResource() { + return networkResource; + } + + public Builder setNetworkResource(Network networkResource) { + this.networkResource = networkResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertNetworkHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertNetworkHttpRequest( + access_token, + callback, + fields, + key, + networkResource, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetworkResource(this.networkResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "networkResource=" + networkResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertNetworkHttpRequest) { + InsertNetworkHttpRequest that = (InsertNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.networkResource, that.getNetworkResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + networkResource, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java new file mode 100644 index 000000000000..e8b4b9eede93 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRegionAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final Autoscaler autoscalerResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private InsertRegionAutoscalerHttpRequest() { + this.access_token = null; + this.autoscalerResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private InsertRegionAutoscalerHttpRequest( + String access_token, + Autoscaler autoscalerResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.autoscalerResource = autoscalerResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscalerResource")) { + return String.valueOf(autoscalerResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Autoscaler getApiMessageRequestBody() { + return autoscalerResource; + } + + public String getAccessToken() { + return access_token; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertRegionAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRegionAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertRegionAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private Autoscaler autoscalerResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRegionAutoscalerHttpRequest other) { + if (other == InsertRegionAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscalerResource() != null) { + this.autoscalerResource = other.autoscalerResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRegionAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscalerResource = source.autoscalerResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public Builder setAutoscalerResource(Autoscaler autoscalerResource) { + this.autoscalerResource = autoscalerResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertRegionAutoscalerHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRegionAutoscalerHttpRequest( + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscalerResource(this.autoscalerResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRegionAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRegionAutoscalerHttpRequest) { + InsertRegionAutoscalerHttpRequest that = (InsertRegionAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java new file mode 100644 index 000000000000..8e0cbd488382 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRegionBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final BackendService backendServiceResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private InsertRegionBackendServiceHttpRequest() { + this.access_token = null; + this.backendServiceResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private InsertRegionBackendServiceHttpRequest( + String access_token, + BackendService backendServiceResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.backendServiceResource = backendServiceResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendServiceResource")) { + return String.valueOf(backendServiceResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendService getApiMessageRequestBody() { + return backendServiceResource; + } + + public String getAccessToken() { + return access_token; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertRegionBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRegionBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertRegionBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private BackendService backendServiceResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRegionBackendServiceHttpRequest other) { + if (other == InsertRegionBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendServiceResource() != null) { + this.backendServiceResource = other.backendServiceResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRegionBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendServiceResource = source.backendServiceResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public Builder setBackendServiceResource(BackendService backendServiceResource) { + this.backendServiceResource = backendServiceResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertRegionBackendServiceHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRegionBackendServiceHttpRequest( + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendServiceResource(this.backendServiceResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRegionBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendServiceResource=" + backendServiceResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRegionBackendServiceHttpRequest) { + InsertRegionBackendServiceHttpRequest that = (InsertRegionBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..fd357cdb00a9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InstanceGroupManager instanceGroupManagerResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private InsertRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManagerResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private InsertRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + InstanceGroupManager instanceGroupManagerResource, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManagerResource = instanceGroupManagerResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManagerResource") && instanceGroupManagerResource != null) { + fieldMap.put("instanceGroupManagerResource", Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManagerResource")) { + return String.valueOf(instanceGroupManagerResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManager getApiMessageRequestBody() { + return instanceGroupManagerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InstanceGroupManager instanceGroupManagerResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRegionInstanceGroupManagerHttpRequest other) { + if (other == InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManagerResource() != null) { + this.instanceGroupManagerResource = other.instanceGroupManagerResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManagerResource = source.instanceGroupManagerResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + public Builder setInstanceGroupManagerResource(InstanceGroupManager instanceGroupManagerResource) { + this.instanceGroupManagerResource = instanceGroupManagerResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManagerResource(this.instanceGroupManagerResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManagerResource=" + instanceGroupManagerResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRegionInstanceGroupManagerHttpRequest) { + InsertRegionInstanceGroupManagerHttpRequest that = (InsertRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java new file mode 100644 index 000000000000..351fdccea01b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRouteHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final Route routeResource; + private final String userIp; + + private InsertRouteHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.routeResource = null; + this.userIp = null; + } + + + private InsertRouteHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + Route routeResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.routeResource = routeResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("routeResource") && routeResource != null) { + fieldMap.put("routeResource", Collections.singletonList(String.valueOf(routeResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("routeResource")) { + return String.valueOf(routeResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Route getApiMessageRequestBody() { + return routeResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Route getRouteResource() { + return routeResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertRouteHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRouteHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertRouteHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertRouteHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private Route routeResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRouteHttpRequest other) { + if (other == InsertRouteHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouteResource() != null) { + this.routeResource = other.routeResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRouteHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.routeResource = source.routeResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public Route getRouteResource() { + return routeResource; + } + + public Builder setRouteResource(Route routeResource) { + this.routeResource = routeResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertRouteHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRouteHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + routeResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouteResource(this.routeResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRouteHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "routeResource=" + routeResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRouteHttpRequest) { + InsertRouteHttpRequest that = (InsertRouteHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.routeResource, that.getRouteResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + routeResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java new file mode 100644 index 000000000000..a984541e5c36 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final Router routerResource; + private final String userIp; + + private InsertRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.routerResource = null; + this.userIp = null; + } + + + private InsertRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + Router routerResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.routerResource = routerResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("routerResource")) { + return String.valueOf(routerResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Router getApiMessageRequestBody() { + return routerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public Router getRouterResource() { + return routerResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private Router routerResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRouterHttpRequest other) { + if (other == InsertRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getRouterResource() != null) { + this.routerResource = other.routerResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.routerResource = source.routerResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Router getRouterResource() { + return routerResource; + } + + public Builder setRouterResource(Router routerResource) { + this.routerResource = routerResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertRouterHttpRequest build() { + String missing = ""; + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + routerResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setRouterResource(this.routerResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "routerResource=" + routerResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRouterHttpRequest) { + InsertRouterHttpRequest that = (InsertRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.routerResource, that.getRouterResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + routerResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java new file mode 100644 index 000000000000..a2aab36670b1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertSslCertificateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final SslCertificate sslCertificateResource; + private final String userIp; + + private InsertSslCertificateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.sslCertificateResource = null; + this.userIp = null; + } + + + private InsertSslCertificateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + SslCertificate sslCertificateResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.sslCertificateResource = sslCertificateResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sslCertificateResource") && sslCertificateResource != null) { + fieldMap.put("sslCertificateResource", Collections.singletonList(String.valueOf(sslCertificateResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("sslCertificateResource")) { + return String.valueOf(sslCertificateResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public SslCertificate getApiMessageRequestBody() { + return sslCertificateResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public SslCertificate getSslCertificateResource() { + return sslCertificateResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertSslCertificateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertSslCertificateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertSslCertificateHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertSslCertificateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private SslCertificate sslCertificateResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertSslCertificateHttpRequest other) { + if (other == InsertSslCertificateHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSslCertificateResource() != null) { + this.sslCertificateResource = other.sslCertificateResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertSslCertificateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.sslCertificateResource = source.sslCertificateResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public SslCertificate getSslCertificateResource() { + return sslCertificateResource; + } + + public Builder setSslCertificateResource(SslCertificate sslCertificateResource) { + this.sslCertificateResource = sslCertificateResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertSslCertificateHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertSslCertificateHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + sslCertificateResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSslCertificateResource(this.sslCertificateResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertSslCertificateHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "sslCertificateResource=" + sslCertificateResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertSslCertificateHttpRequest) { + InsertSslCertificateHttpRequest that = (InsertSslCertificateHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.sslCertificateResource, that.getSslCertificateResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + sslCertificateResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java new file mode 100644 index 000000000000..cc6b77ab3e9c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertSubnetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final Subnetwork subnetworkResource; + private final String userIp; + + private InsertSubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.subnetworkResource = null; + this.userIp = null; + } + + + private InsertSubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + Subnetwork subnetworkResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.subnetworkResource = subnetworkResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { + fieldMap.put("subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("subnetworkResource")) { + return String.valueOf(subnetworkResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Subnetwork getApiMessageRequestBody() { + return subnetworkResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public Subnetwork getSubnetworkResource() { + return subnetworkResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertSubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertSubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertSubnetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertSubnetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private Subnetwork subnetworkResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertSubnetworkHttpRequest other) { + if (other == InsertSubnetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSubnetworkResource() != null) { + this.subnetworkResource = other.subnetworkResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertSubnetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.subnetworkResource = source.subnetworkResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Subnetwork getSubnetworkResource() { + return subnetworkResource; + } + + public Builder setSubnetworkResource(Subnetwork subnetworkResource) { + this.subnetworkResource = subnetworkResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertSubnetworkHttpRequest build() { + String missing = ""; + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertSubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + subnetworkResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setSubnetworkResource(this.subnetworkResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertSubnetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "subnetworkResource=" + subnetworkResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertSubnetworkHttpRequest) { + InsertSubnetworkHttpRequest that = (InsertSubnetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + subnetworkResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java new file mode 100644 index 000000000000..93abca892c56 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetHttpProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final TargetHttpProxy targetHttpProxyResource; + private final String userIp; + + private InsertTargetHttpProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.targetHttpProxyResource = null; + this.userIp = null; + } + + + private InsertTargetHttpProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + TargetHttpProxy targetHttpProxyResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.targetHttpProxyResource = targetHttpProxyResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpProxyResource") && targetHttpProxyResource != null) { + fieldMap.put("targetHttpProxyResource", Collections.singletonList(String.valueOf(targetHttpProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpProxyResource")) { + return String.valueOf(targetHttpProxyResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetHttpProxy getApiMessageRequestBody() { + return targetHttpProxyResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetHttpProxy getTargetHttpProxyResource() { + return targetHttpProxyResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetHttpProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetHttpProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetHttpProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private TargetHttpProxy targetHttpProxyResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertTargetHttpProxyHttpRequest other) { + if (other == InsertTargetHttpProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpProxyResource() != null) { + this.targetHttpProxyResource = other.targetHttpProxyResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertTargetHttpProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.targetHttpProxyResource = source.targetHttpProxyResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetHttpProxy getTargetHttpProxyResource() { + return targetHttpProxyResource; + } + + public Builder setTargetHttpProxyResource(TargetHttpProxy targetHttpProxyResource) { + this.targetHttpProxyResource = targetHttpProxyResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertTargetHttpProxyHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetHttpProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + targetHttpProxyResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpProxyResource(this.targetHttpProxyResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetHttpProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpProxyResource=" + targetHttpProxyResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetHttpProxyHttpRequest) { + InsertTargetHttpProxyHttpRequest that = (InsertTargetHttpProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpProxyResource, that.getTargetHttpProxyResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + targetHttpProxyResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..eb4c7f932e39 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final TargetHttpsProxy targetHttpsProxyResource; + private final String userIp; + + private InsertTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.targetHttpsProxyResource = null; + this.userIp = null; + } + + + private InsertTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + TargetHttpsProxy targetHttpsProxyResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.targetHttpsProxyResource = targetHttpsProxyResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpsProxyResource") && targetHttpsProxyResource != null) { + fieldMap.put("targetHttpsProxyResource", Collections.singletonList(String.valueOf(targetHttpsProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpsProxyResource")) { + return String.valueOf(targetHttpsProxyResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetHttpsProxy getApiMessageRequestBody() { + return targetHttpsProxyResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetHttpsProxy getTargetHttpsProxyResource() { + return targetHttpsProxyResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private TargetHttpsProxy targetHttpsProxyResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertTargetHttpsProxyHttpRequest other) { + if (other == InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpsProxyResource() != null) { + this.targetHttpsProxyResource = other.targetHttpsProxyResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.targetHttpsProxyResource = source.targetHttpsProxyResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetHttpsProxy getTargetHttpsProxyResource() { + return targetHttpsProxyResource; + } + + public Builder setTargetHttpsProxyResource(TargetHttpsProxy targetHttpsProxyResource) { + this.targetHttpsProxyResource = targetHttpsProxyResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertTargetHttpsProxyHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + targetHttpsProxyResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpsProxyResource(this.targetHttpsProxyResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetHttpsProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpsProxyResource=" + targetHttpsProxyResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetHttpsProxyHttpRequest) { + InsertTargetHttpsProxyHttpRequest that = (InsertTargetHttpsProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpsProxyResource, that.getTargetHttpsProxyResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + targetHttpsProxyResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java new file mode 100644 index 000000000000..7089867013df --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetInstance targetInstanceResource; + private final String userIp; + private final String zone; + + private InsertTargetInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetInstanceResource = null; + this.userIp = null; + this.zone = null; + } + + + private InsertTargetInstanceHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + TargetInstance targetInstanceResource, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetInstanceResource = targetInstanceResource; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetInstanceResource") && targetInstanceResource != null) { + fieldMap.put("targetInstanceResource", Collections.singletonList(String.valueOf(targetInstanceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetInstanceResource")) { + return String.valueOf(targetInstanceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public TargetInstance getApiMessageRequestBody() { + return targetInstanceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetInstance getTargetInstanceResource() { + return targetInstanceResource; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetInstance targetInstanceResource; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(InsertTargetInstanceHttpRequest other) { + if (other == InsertTargetInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetInstanceResource() != null) { + this.targetInstanceResource = other.targetInstanceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InsertTargetInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetInstanceResource = source.targetInstanceResource; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetInstance getTargetInstanceResource() { + return targetInstanceResource; + } + + public Builder setTargetInstanceResource(TargetInstance targetInstanceResource) { + this.targetInstanceResource = targetInstanceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InsertTargetInstanceHttpRequest build() { + String missing = ""; + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetInstanceHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetInstanceResource, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetInstanceResource(this.targetInstanceResource); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetInstanceResource=" + targetInstanceResource + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetInstanceHttpRequest) { + InsertTargetInstanceHttpRequest that = (InsertTargetInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetInstanceResource, that.getTargetInstanceResource()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetInstanceResource, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java new file mode 100644 index 000000000000..2c21b65b5caf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final TargetPool targetPoolResource; + private final String userIp; + + private InsertTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.targetPoolResource = null; + this.userIp = null; + } + + + private InsertTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + TargetPool targetPoolResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.targetPoolResource = targetPoolResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("targetPoolResource") && targetPoolResource != null) { + fieldMap.put("targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("targetPoolResource")) { + return String.valueOf(targetPoolResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetPool getApiMessageRequestBody() { + return targetPoolResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public TargetPool getTargetPoolResource() { + return targetPoolResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private TargetPool targetPoolResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertTargetPoolHttpRequest other) { + if (other == InsertTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getTargetPoolResource() != null) { + this.targetPoolResource = other.targetPoolResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.targetPoolResource = source.targetPoolResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public TargetPool getTargetPoolResource() { + return targetPoolResource; + } + + public Builder setTargetPoolResource(TargetPool targetPoolResource) { + this.targetPoolResource = targetPoolResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + targetPoolResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setTargetPoolResource(this.targetPoolResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "targetPoolResource=" + targetPoolResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetPoolHttpRequest) { + InsertTargetPoolHttpRequest that = (InsertTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.targetPoolResource, that.getTargetPoolResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + targetPoolResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..d4f3e84b22f1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final TargetSslProxy targetSslProxyResource; + private final String userIp; + + private InsertTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.targetSslProxyResource = null; + this.userIp = null; + } + + + private InsertTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + TargetSslProxy targetSslProxyResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.targetSslProxyResource = targetSslProxyResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxyResource") && targetSslProxyResource != null) { + fieldMap.put("targetSslProxyResource", Collections.singletonList(String.valueOf(targetSslProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetSslProxyResource")) { + return String.valueOf(targetSslProxyResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetSslProxy getApiMessageRequestBody() { + return targetSslProxyResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetSslProxy getTargetSslProxyResource() { + return targetSslProxyResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private TargetSslProxy targetSslProxyResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertTargetSslProxyHttpRequest other) { + if (other == InsertTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetSslProxyResource() != null) { + this.targetSslProxyResource = other.targetSslProxyResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.targetSslProxyResource = source.targetSslProxyResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetSslProxy getTargetSslProxyResource() { + return targetSslProxyResource; + } + + public Builder setTargetSslProxyResource(TargetSslProxy targetSslProxyResource) { + this.targetSslProxyResource = targetSslProxyResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertTargetSslProxyHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + targetSslProxyResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetSslProxyResource(this.targetSslProxyResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetSslProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "targetSslProxyResource=" + targetSslProxyResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetSslProxyHttpRequest) { + InsertTargetSslProxyHttpRequest that = (InsertTargetSslProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetSslProxyResource, that.getTargetSslProxyResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + targetSslProxyResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java new file mode 100644 index 000000000000..028eec74f110 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetVpnGatewayHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final TargetVpnGateway targetVpnGatewayResource; + private final String userIp; + + private InsertTargetVpnGatewayHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.targetVpnGatewayResource = null; + this.userIp = null; + } + + + private InsertTargetVpnGatewayHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + TargetVpnGateway targetVpnGatewayResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.targetVpnGatewayResource = targetVpnGatewayResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("targetVpnGatewayResource") && targetVpnGatewayResource != null) { + fieldMap.put("targetVpnGatewayResource", Collections.singletonList(String.valueOf(targetVpnGatewayResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("targetVpnGatewayResource")) { + return String.valueOf(targetVpnGatewayResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetVpnGateway getApiMessageRequestBody() { + return targetVpnGatewayResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public TargetVpnGateway getTargetVpnGatewayResource() { + return targetVpnGatewayResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetVpnGatewayHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetVpnGatewayHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetVpnGatewayHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetVpnGatewayHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private TargetVpnGateway targetVpnGatewayResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertTargetVpnGatewayHttpRequest other) { + if (other == InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getTargetVpnGatewayResource() != null) { + this.targetVpnGatewayResource = other.targetVpnGatewayResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertTargetVpnGatewayHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.targetVpnGatewayResource = source.targetVpnGatewayResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public TargetVpnGateway getTargetVpnGatewayResource() { + return targetVpnGatewayResource; + } + + public Builder setTargetVpnGatewayResource(TargetVpnGateway targetVpnGatewayResource) { + this.targetVpnGatewayResource = targetVpnGatewayResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertTargetVpnGatewayHttpRequest build() { + String missing = ""; + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetVpnGatewayHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + targetVpnGatewayResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setTargetVpnGatewayResource(this.targetVpnGatewayResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetVpnGatewayHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "targetVpnGatewayResource=" + targetVpnGatewayResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetVpnGatewayHttpRequest) { + InsertTargetVpnGatewayHttpRequest that = (InsertTargetVpnGatewayHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.targetVpnGatewayResource, that.getTargetVpnGatewayResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + targetVpnGatewayResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java new file mode 100644 index 000000000000..9677ee2e6b5e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final UrlMap urlMapResource; + private final String userIp; + + private InsertUrlMapHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.urlMapResource = null; + this.userIp = null; + } + + + private InsertUrlMapHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + UrlMap urlMapResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.urlMapResource = urlMapResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMapResource") && urlMapResource != null) { + fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMapResource")) { + return String.valueOf(urlMapResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UrlMap getApiMessageRequestBody() { + return urlMapResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public UrlMap getUrlMapResource() { + return urlMapResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private UrlMap urlMapResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertUrlMapHttpRequest other) { + if (other == InsertUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMapResource() != null) { + this.urlMapResource = other.urlMapResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.urlMapResource = source.urlMapResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public UrlMap getUrlMapResource() { + return urlMapResource; + } + + public Builder setUrlMapResource(UrlMap urlMapResource) { + this.urlMapResource = urlMapResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertUrlMapHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertUrlMapHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + urlMapResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMapResource(this.urlMapResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMapResource=" + urlMapResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertUrlMapHttpRequest) { + InsertUrlMapHttpRequest that = (InsertUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMapResource, that.getUrlMapResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + urlMapResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java new file mode 100644 index 000000000000..eb6bb5167aa4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertVpnTunnelHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + private final VpnTunnel vpnTunnelResource; + + private InsertVpnTunnelHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + this.vpnTunnelResource = null; + } + + + private InsertVpnTunnelHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp, + VpnTunnel vpnTunnelResource + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + this.vpnTunnelResource = vpnTunnelResource; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) { + fieldMap.put("vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("vpnTunnelResource")) { + return String.valueOf(vpnTunnelResource); + } + return null; + } + + @Nullable + @Override + public VpnTunnel getApiMessageRequestBody() { + return vpnTunnelResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + public VpnTunnel getVpnTunnelResource() { + return vpnTunnelResource; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertVpnTunnelHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertVpnTunnelHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertVpnTunnelHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + private VpnTunnel vpnTunnelResource; + + Builder() {} + + public Builder mergeFrom(InsertVpnTunnelHttpRequest other) { + if (other == InsertVpnTunnelHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getVpnTunnelResource() != null) { + this.vpnTunnelResource = other.vpnTunnelResource; + } + return this; + } + + Builder(InsertVpnTunnelHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + this.vpnTunnelResource = source.vpnTunnelResource; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public VpnTunnel getVpnTunnelResource() { + return vpnTunnelResource; + } + + public Builder setVpnTunnelResource(VpnTunnel vpnTunnelResource) { + this.vpnTunnelResource = vpnTunnelResource; + return this; + } + + + public InsertVpnTunnelHttpRequest build() { + String missing = ""; + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertVpnTunnelHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp, + vpnTunnelResource + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + newBuilder.setVpnTunnelResource(this.vpnTunnelResource); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertVpnTunnelHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + ", " + + "vpnTunnelResource=" + vpnTunnelResource + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertVpnTunnelHttpRequest) { + InsertVpnTunnelHttpRequest that = (InsertVpnTunnelHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp, + vpnTunnelResource + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java new file mode 100644 index 000000000000..a5992878c05e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java @@ -0,0 +1,776 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Instance implements ApiMessage { + private final Boolean canIpForward; + private final String cpuPlatform; + private final String creationTimestamp; + private final String description; + private final List disks; + private final String id; + private final String kind; + private final String machineType; + private final Metadata metadata; + private final String name; + private final List networkInterfaces; + private final Scheduling scheduling; + private final String selfLink; + private final List serviceAccounts; + private final String status; + private final String statusMessage; + private final Tags tags; + private final String zone; + + private Instance() { + this.canIpForward = null; + this.cpuPlatform = null; + this.creationTimestamp = null; + this.description = null; + this.disks = null; + this.id = null; + this.kind = null; + this.machineType = null; + this.metadata = null; + this.name = null; + this.networkInterfaces = null; + this.scheduling = null; + this.selfLink = null; + this.serviceAccounts = null; + this.status = null; + this.statusMessage = null; + this.tags = null; + this.zone = null; + } + + + private Instance( + Boolean canIpForward, + String cpuPlatform, + String creationTimestamp, + String description, + List disks, + String id, + String kind, + String machineType, + Metadata metadata, + String name, + List networkInterfaces, + Scheduling scheduling, + String selfLink, + List serviceAccounts, + String status, + String statusMessage, + Tags tags, + String zone + ) { + this.canIpForward = canIpForward; + this.cpuPlatform = cpuPlatform; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.disks = disks; + this.id = id; + this.kind = kind; + this.machineType = machineType; + this.metadata = metadata; + this.name = name; + this.networkInterfaces = networkInterfaces; + this.scheduling = scheduling; + this.selfLink = selfLink; + this.serviceAccounts = serviceAccounts; + this.status = status; + this.statusMessage = statusMessage; + this.tags = tags; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("canIpForward") && canIpForward != null) { + fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward))); + } + if (fieldNames.contains("cpuPlatform") && cpuPlatform != null) { + fieldMap.put("cpuPlatform", Collections.singletonList(String.valueOf(cpuPlatform))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AttachedDisk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + if (fieldNames.contains("metadata") && metadata != null) { + fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NetworkInterface item : networkInterfaces) { + stringList.add(item.toString()); + } + fieldMap.put("networkInterfaces", stringList.build()); + } + if (fieldNames.contains("scheduling") && scheduling != null) { + fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ServiceAccount item : serviceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("serviceAccounts", stringList.build()); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusMessage") && statusMessage != null) { + fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); + } + if (fieldNames.contains("tags") && tags != null) { + fieldMap.put("tags", Collections.singletonList(String.valueOf(tags))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("canIpForward")) { + return String.valueOf(canIpForward); + } + if (fieldName.equals("cpuPlatform")) { + return String.valueOf(cpuPlatform); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("disks")) { + return String.valueOf(disks); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("machineType")) { + return String.valueOf(machineType); + } + if (fieldName.equals("metadata")) { + return String.valueOf(metadata); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("networkInterfaces")) { + return String.valueOf(networkInterfaces); + } + if (fieldName.equals("scheduling")) { + return String.valueOf(scheduling); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("serviceAccounts")) { + return String.valueOf(serviceAccounts); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("statusMessage")) { + return String.valueOf(statusMessage); + } + if (fieldName.equals("tags")) { + return String.valueOf(tags); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getCanIpForward() { + return canIpForward; + } + + public String getCpuPlatform() { + return cpuPlatform; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public List getDisksList() { + return disks; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getMachineType() { + return machineType; + } + + public Metadata getMetadata() { + return metadata; + } + + public String getName() { + return name; + } + + public List getNetworkInterfacesList() { + return networkInterfaces; + } + + public Scheduling getScheduling() { + return scheduling; + } + + public String getSelfLink() { + return selfLink; + } + + public List getServiceAccountsList() { + return serviceAccounts; + } + + public String getStatus() { + return status; + } + + public String getStatusMessage() { + return statusMessage; + } + + public Tags getTags() { + return tags; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Instance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Instance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Instance(); + } + + public static class Builder { + private Boolean canIpForward; + private String cpuPlatform; + private String creationTimestamp; + private String description; + private List disks; + private String id; + private String kind; + private String machineType; + private Metadata metadata; + private String name; + private List networkInterfaces; + private Scheduling scheduling; + private String selfLink; + private List serviceAccounts; + private String status; + private String statusMessage; + private Tags tags; + private String zone; + + Builder() {} + + public Builder mergeFrom(Instance other) { + if (other == Instance.getDefaultInstance()) return this; + if (other.getCanIpForward() != null) { + this.canIpForward = other.canIpForward; + } + if (other.getCpuPlatform() != null) { + this.cpuPlatform = other.cpuPlatform; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDisksList() != null) { + this.disks = other.disks; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getMachineType() != null) { + this.machineType = other.machineType; + } + if (other.getMetadata() != null) { + this.metadata = other.metadata; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetworkInterfacesList() != null) { + this.networkInterfaces = other.networkInterfaces; + } + if (other.getScheduling() != null) { + this.scheduling = other.scheduling; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getServiceAccountsList() != null) { + this.serviceAccounts = other.serviceAccounts; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getStatusMessage() != null) { + this.statusMessage = other.statusMessage; + } + if (other.getTags() != null) { + this.tags = other.tags; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(Instance source) { + this.canIpForward = source.canIpForward; + this.cpuPlatform = source.cpuPlatform; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.disks = source.disks; + this.id = source.id; + this.kind = source.kind; + this.machineType = source.machineType; + this.metadata = source.metadata; + this.name = source.name; + this.networkInterfaces = source.networkInterfaces; + this.scheduling = source.scheduling; + this.selfLink = source.selfLink; + this.serviceAccounts = source.serviceAccounts; + this.status = source.status; + this.statusMessage = source.statusMessage; + this.tags = source.tags; + this.zone = source.zone; + } + + public Boolean getCanIpForward() { + return canIpForward; + } + + public Builder setCanIpForward(Boolean canIpForward) { + this.canIpForward = canIpForward; + return this; + } + + public String getCpuPlatform() { + return cpuPlatform; + } + + public Builder setCpuPlatform(String cpuPlatform) { + this.cpuPlatform = cpuPlatform; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getDisksList() { + return disks; + } + + public Builder addAllDisks(List disks) { + if (this.disks == null) { + this.disks = new ArrayList<>(disks.size()); + } + this.disks.addAll(disks); + return this; + } + + public Builder addDisks(AttachedDisk disks) { + this.disks.add(disks); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getMachineType() { + return machineType; + } + + public Builder setMachineType(String machineType) { + this.machineType = machineType; + return this; + } + + public Metadata getMetadata() { + return metadata; + } + + public Builder setMetadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getNetworkInterfacesList() { + return networkInterfaces; + } + + public Builder addAllNetworkInterfaces(List networkInterfaces) { + if (this.networkInterfaces == null) { + this.networkInterfaces = new ArrayList<>(networkInterfaces.size()); + } + this.networkInterfaces.addAll(networkInterfaces); + return this; + } + + public Builder addNetworkInterfaces(NetworkInterface networkInterfaces) { + this.networkInterfaces.add(networkInterfaces); + return this; + } + + public Scheduling getScheduling() { + return scheduling; + } + + public Builder setScheduling(Scheduling scheduling) { + this.scheduling = scheduling; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getServiceAccountsList() { + return serviceAccounts; + } + + public Builder addAllServiceAccounts(List serviceAccounts) { + if (this.serviceAccounts == null) { + this.serviceAccounts = new ArrayList<>(serviceAccounts.size()); + } + this.serviceAccounts.addAll(serviceAccounts); + return this; + } + + public Builder addServiceAccounts(ServiceAccount serviceAccounts) { + this.serviceAccounts.add(serviceAccounts); + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getStatusMessage() { + return statusMessage; + } + + public Builder setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + public Tags getTags() { + return tags; + } + + public Builder setTags(Tags tags) { + this.tags = tags; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public Instance build() { + + + + + + + + + + + + + + + + + + return new Instance( + canIpForward, + cpuPlatform, + creationTimestamp, + description, + disks, + id, + kind, + machineType, + metadata, + name, + networkInterfaces, + scheduling, + selfLink, + serviceAccounts, + status, + statusMessage, + tags, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCanIpForward(this.canIpForward); + newBuilder.setCpuPlatform(this.cpuPlatform); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.addAllDisks(this.disks); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setMachineType(this.machineType); + newBuilder.setMetadata(this.metadata); + newBuilder.setName(this.name); + newBuilder.addAllNetworkInterfaces(this.networkInterfaces); + newBuilder.setScheduling(this.scheduling); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllServiceAccounts(this.serviceAccounts); + newBuilder.setStatus(this.status); + newBuilder.setStatusMessage(this.statusMessage); + newBuilder.setTags(this.tags); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "Instance{" + + "canIpForward=" + canIpForward + ", " + + "cpuPlatform=" + cpuPlatform + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "disks=" + disks + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "machineType=" + machineType + ", " + + "metadata=" + metadata + ", " + + "name=" + name + ", " + + "networkInterfaces=" + networkInterfaces + ", " + + "scheduling=" + scheduling + ", " + + "selfLink=" + selfLink + ", " + + "serviceAccounts=" + serviceAccounts + ", " + + "status=" + status + ", " + + "statusMessage=" + statusMessage + ", " + + "tags=" + tags + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Instance) { + Instance that = (Instance) o; + return + Objects.equals(this.canIpForward, that.getCanIpForward()) && + Objects.equals(this.cpuPlatform, that.getCpuPlatform()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.disks, that.getDisksList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.machineType, that.getMachineType()) && + Objects.equals(this.metadata, that.getMetadata()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) && + Objects.equals(this.scheduling, that.getScheduling()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.statusMessage, that.getStatusMessage()) && + Objects.equals(this.tags, that.getTags()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + canIpForward, + cpuPlatform, + creationTimestamp, + description, + disks, + id, + kind, + machineType, + metadata, + name, + networkInterfaces, + scheduling, + selfLink, + serviceAccounts, + status, + statusMessage, + tags, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java new file mode 100644 index 000000000000..cdb3bb9ee999 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceAggregatedList other) { + if (other == InstanceAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceAggregatedList build() { + + + + + return new InstanceAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceAggregatedList) { + InstanceAggregatedList that = (InstanceAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java new file mode 100644 index 000000000000..f6097d4e9fe2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -0,0 +1,2523 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InstanceStub; +import com.google.cloud.compute.v1.stub.InstanceStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InstanceClient instanceClient = InstanceClient.create()) {
+ *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+ *   String networkInterface = "";
+ *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+ *   Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the instanceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InstanceSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InstanceSettings instanceSettings =
+ *     InstanceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InstanceClient instanceClient =
+ *     InstanceClient.create(instanceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InstanceSettings instanceSettings =
+ *     InstanceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InstanceClient instanceClient =
+ *     InstanceClient.create(instanceSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceClient implements BackgroundResource { + private final InstanceSettings settings; + private final InstanceStub stub; + + + + /** + * Constructs an instance of InstanceClient with default settings. + */ + public static final InstanceClient create() throws IOException { + return create(InstanceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InstanceClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InstanceClient create(InstanceSettings settings) throws IOException { + return new InstanceClient(settings); + } + + /** + * Constructs an instance of InstanceClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InstanceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InstanceClient create(InstanceStub stub) { + return new InstanceClient(stub); + } + + /** + * Constructs an instance of InstanceClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InstanceClient(InstanceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InstanceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InstanceClient(InstanceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InstanceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an access config to an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface to add to this instance. + * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addAccessConfigInstance(InstanceName instance, String networkInterface, AccessConfig accessConfigResource) { + + AddAccessConfigInstanceHttpRequest request = + AddAccessConfigInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setAccessConfigResource(accessConfigResource) + .build(); + return addAccessConfigInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an access config to an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   Operation response = instanceClient.addAccessConfigInstance(instance.toString(), networkInterface, accessConfigResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface to add to this instance. + * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addAccessConfigInstance(String instance, String networkInterface, AccessConfig accessConfigResource) { + + AddAccessConfigInstanceHttpRequest request = + AddAccessConfigInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setAccessConfigResource(accessConfigResource) + .build(); + return addAccessConfigInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an access config to an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setAccessConfigResource(accessConfigResource)
+   *     .build();
+   *   Operation response = instanceClient.addAccessConfigInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addAccessConfigInstance(AddAccessConfigInstanceHttpRequest request) { + return addAccessConfigInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an access config to an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setAccessConfigResource(accessConfigResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.addAccessConfigInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable addAccessConfigInstanceCallable() { + return stub.addAccessConfigInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves aggregated list of instances. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstancesScopedList element : instanceClient.aggregatedListInstances(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstancesPagedResponse aggregatedListInstances(ProjectName project) { + AggregatedListInstancesHttpRequest request = + AggregatedListInstancesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves aggregated list of instances. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstancesScopedList element : instanceClient.aggregatedListInstances(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstancesPagedResponse aggregatedListInstances(String project) { + AggregatedListInstancesHttpRequest request = + AggregatedListInstancesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves aggregated list of instances. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstancesHttpRequest request = AggregatedListInstancesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (InstancesScopedList element : instanceClient.aggregatedListInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstancesPagedResponse aggregatedListInstances(AggregatedListInstancesHttpRequest request) { + return aggregatedListInstancesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves aggregated list of instances. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstancesHttpRequest request = AggregatedListInstancesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListInstancesPagedResponse> future = instanceClient.aggregatedListInstancesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstancesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInstancesPagedCallable() { + return stub.aggregatedListInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves aggregated list of instances. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstancesHttpRequest request = AggregatedListInstancesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceAggregatedList response = instanceClient.aggregatedListInstancesCallable().call(request);
+   *     for (InstancesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInstancesCallable() { + return stub.aggregatedListInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Attaches a Disk resource to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
+   *   Operation response = instanceClient.attachDiskInstance(instance, attachedDiskResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param attachedDiskResource An instance-attached disk resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation attachDiskInstance(InstanceName instance, AttachedDisk attachedDiskResource) { + + AttachDiskInstanceHttpRequest request = + AttachDiskInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setAttachedDiskResource(attachedDiskResource) + .build(); + return attachDiskInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Attaches a Disk resource to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
+   *   Operation response = instanceClient.attachDiskInstance(instance.toString(), attachedDiskResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param attachedDiskResource An instance-attached disk resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation attachDiskInstance(String instance, AttachedDisk attachedDiskResource) { + + AttachDiskInstanceHttpRequest request = + AttachDiskInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setAttachedDiskResource(attachedDiskResource) + .build(); + return attachDiskInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Attaches a Disk resource to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
+   *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setAttachedDiskResource(attachedDiskResource)
+   *     .build();
+   *   Operation response = instanceClient.attachDiskInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request) { + return attachDiskInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Attaches a Disk resource to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
+   *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setAttachedDiskResource(attachedDiskResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.attachDiskInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable attachDiskInstanceCallable() { + return stub.attachDiskInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.deleteInstance(instance);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstance(InstanceName instance) { + + DeleteInstanceHttpRequest request = + DeleteInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .build(); + return deleteInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.deleteInstance(instance.toString());
+   * }
+   * 
+ * + * @param instance Name of the instance resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstance(String instance) { + + DeleteInstanceHttpRequest request = + DeleteInstanceHttpRequest.newBuilder() + .setInstance(instance) + .build(); + return deleteInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   Operation response = instanceClient.deleteInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstance(DeleteInstanceHttpRequest request) { + return deleteInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an access config from an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String accessConfig = "";
+   *   Operation response = instanceClient.deleteAccessConfigInstance(instance, networkInterface, accessConfig);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface. + * @param accessConfig The name of the access config to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAccessConfigInstance(InstanceName instance, String networkInterface, String accessConfig) { + + DeleteAccessConfigInstanceHttpRequest request = + DeleteAccessConfigInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setAccessConfig(accessConfig) + .build(); + return deleteAccessConfigInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an access config from an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String accessConfig = "";
+   *   Operation response = instanceClient.deleteAccessConfigInstance(instance.toString(), networkInterface, accessConfig);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface. + * @param accessConfig The name of the access config to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAccessConfigInstance(String instance, String networkInterface, String accessConfig) { + + DeleteAccessConfigInstanceHttpRequest request = + DeleteAccessConfigInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setAccessConfig(accessConfig) + .build(); + return deleteAccessConfigInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an access config from an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String accessConfig = "";
+   *   DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setAccessConfig(accessConfig)
+   *     .build();
+   *   Operation response = instanceClient.deleteAccessConfigInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttpRequest request) { + return deleteAccessConfigInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an access config from an instance's network interface. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String accessConfig = "";
+   *   DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setAccessConfig(accessConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.deleteAccessConfigInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteAccessConfigInstanceCallable() { + return stub.deleteAccessConfigInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Detaches a disk from an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String deviceName = "";
+   *   Operation response = instanceClient.detachDiskInstance(instance, deviceName);
+   * }
+   * 
+ * + * @param instance Instance name. + * @param deviceName Disk device name to detach. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation detachDiskInstance(InstanceName instance, String deviceName) { + + DetachDiskInstanceHttpRequest request = + DetachDiskInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setDeviceName(deviceName) + .build(); + return detachDiskInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Detaches a disk from an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String deviceName = "";
+   *   Operation response = instanceClient.detachDiskInstance(instance.toString(), deviceName);
+   * }
+   * 
+ * + * @param instance Instance name. + * @param deviceName Disk device name to detach. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation detachDiskInstance(String instance, String deviceName) { + + DetachDiskInstanceHttpRequest request = + DetachDiskInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setDeviceName(deviceName) + .build(); + return detachDiskInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Detaches a disk from an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String deviceName = "";
+   *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setDeviceName(deviceName)
+   *     .build();
+   *   Operation response = instanceClient.detachDiskInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request) { + return detachDiskInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Detaches a disk from an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String deviceName = "";
+   *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setDeviceName(deviceName)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.detachDiskInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable detachDiskInstanceCallable() { + return stub.detachDiskInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Instance resource. Get a list of available instances by making a list() request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Instance response = instanceClient.getInstance(instance);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Instance getInstance(InstanceName instance) { + + GetInstanceHttpRequest request = + GetInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Instance resource. Get a list of available instances by making a list() request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Instance response = instanceClient.getInstance(instance.toString());
+   * }
+   * 
+ * + * @param instance Name of the instance resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Instance getInstance(String instance) { + + GetInstanceHttpRequest request = + GetInstanceHttpRequest.newBuilder() + .setInstance(instance) + .build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Instance resource. Get a list of available instances by making a list() request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   GetInstanceHttpRequest request = GetInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   Instance response = instanceClient.getInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Instance getInstance(GetInstanceHttpRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Instance resource. Get a list of available instances by making a list() request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   GetInstanceHttpRequest request = GetInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   ApiFuture<Instance> future = instanceClient.getInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Instance response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance's serial port output. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Integer port = 0;
+   *   String start = "";
+   *   SerialPortOutput response = instanceClient.getSerialPortOutputInstance(instance, port, start);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param port Specifies which COM or serial port to retrieve data from. + * @param start For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value that was returned in the previous call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SerialPortOutput getSerialPortOutputInstance(InstanceName instance, Integer port, String start) { + + GetSerialPortOutputInstanceHttpRequest request = + GetSerialPortOutputInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setPort(port) + .setStart(start) + .build(); + return getSerialPortOutputInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance's serial port output. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Integer port = 0;
+   *   String start = "";
+   *   SerialPortOutput response = instanceClient.getSerialPortOutputInstance(instance.toString(), port, start);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param port Specifies which COM or serial port to retrieve data from. + * @param start For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value that was returned in the previous call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SerialPortOutput getSerialPortOutputInstance(String instance, Integer port, String start) { + + GetSerialPortOutputInstanceHttpRequest request = + GetSerialPortOutputInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setPort(port) + .setStart(start) + .build(); + return getSerialPortOutputInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance's serial port output. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Integer port = 0;
+   *   String start = "";
+   *   GetSerialPortOutputInstanceHttpRequest request = GetSerialPortOutputInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setPort(port)
+   *     .setStart(start)
+   *     .build();
+   *   SerialPortOutput response = instanceClient.getSerialPortOutputInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SerialPortOutput getSerialPortOutputInstance(GetSerialPortOutputInstanceHttpRequest request) { + return getSerialPortOutputInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance's serial port output. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Integer port = 0;
+   *   String start = "";
+   *   GetSerialPortOutputInstanceHttpRequest request = GetSerialPortOutputInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setPort(port)
+   *     .setStart(start)
+   *     .build();
+   *   ApiFuture<SerialPortOutput> future = instanceClient.getSerialPortOutputInstanceCallable().futureCall(request);
+   *   // Do something
+   *   SerialPortOutput response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getSerialPortOutputInstanceCallable() { + return stub.getSerialPortOutputInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Instance instanceResource = Instance.newBuilder().build();
+   *   Operation response = instanceClient.insertInstance(zone, instanceResource);
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @param instanceResource An Instance resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstance(ZoneName zone, Instance instanceResource) { + + InsertInstanceHttpRequest request = + InsertInstanceHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .setInstanceResource(instanceResource) + .build(); + return insertInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Instance instanceResource = Instance.newBuilder().build();
+   *   Operation response = instanceClient.insertInstance(zone.toString(), instanceResource);
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @param instanceResource An Instance resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstance(String zone, Instance instanceResource) { + + InsertInstanceHttpRequest request = + InsertInstanceHttpRequest.newBuilder() + .setZone(zone) + .setInstanceResource(instanceResource) + .build(); + return insertInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Instance instanceResource = Instance.newBuilder().build();
+   *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setInstanceResource(instanceResource)
+   *     .build();
+   *   Operation response = instanceClient.insertInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstance(InsertInstanceHttpRequest request) { + return insertInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Instance instanceResource = Instance.newBuilder().build();
+   *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setInstanceResource(instanceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.insertInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertInstanceCallable() { + return stub.insertInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Instance element : instanceClient.listInstances(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesPagedResponse listInstances(ZoneName zone) { + ListInstancesHttpRequest request = + ListInstancesHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Instance element : instanceClient.listInstances(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesPagedResponse listInstances(String zone) { + ListInstancesHttpRequest request = + ListInstancesHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (Instance element : instanceClient.listInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesPagedResponse listInstances(ListInstancesHttpRequest request) { + return listInstancesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListInstancesPagedResponse> future = instanceClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceList response = instanceClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs a hard reset on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.resetInstance(instance);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resetInstance(InstanceName instance) { + + ResetInstanceHttpRequest request = + ResetInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .build(); + return resetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs a hard reset on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.resetInstance(instance.toString());
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resetInstance(String instance) { + + ResetInstanceHttpRequest request = + ResetInstanceHttpRequest.newBuilder() + .setInstance(instance) + .build(); + return resetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs a hard reset on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   Operation response = instanceClient.resetInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resetInstance(ResetInstanceHttpRequest request) { + return resetInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs a hard reset on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.resetInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable resetInstanceCallable() { + return stub.resetInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Boolean autoDelete = false;
+   *   String deviceName = "";
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance, autoDelete, deviceName);
+   * }
+   * 
+ * + * @param instance The instance name. + * @param autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param deviceName The device name of the disk to modify. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDiskAutoDeleteInstance(InstanceName instance, Boolean autoDelete, String deviceName) { + + SetDiskAutoDeleteInstanceHttpRequest request = + SetDiskAutoDeleteInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setAutoDelete(autoDelete) + .setDeviceName(deviceName) + .build(); + return setDiskAutoDeleteInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Boolean autoDelete = false;
+   *   String deviceName = "";
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance.toString(), autoDelete, deviceName);
+   * }
+   * 
+ * + * @param instance The instance name. + * @param autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param deviceName The device name of the disk to modify. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDiskAutoDeleteInstance(String instance, Boolean autoDelete, String deviceName) { + + SetDiskAutoDeleteInstanceHttpRequest request = + SetDiskAutoDeleteInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setAutoDelete(autoDelete) + .setDeviceName(deviceName) + .build(); + return setDiskAutoDeleteInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Boolean autoDelete = false;
+   *   String deviceName = "";
+   *   SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setAutoDelete(autoDelete)
+   *     .setDeviceName(deviceName)
+   *     .build();
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRequest request) { + return setDiskAutoDeleteInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Boolean autoDelete = false;
+   *   String deviceName = "";
+   *   SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setAutoDelete(autoDelete)
+   *     .setDeviceName(deviceName)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setDiskAutoDeleteInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setDiskAutoDeleteInstanceCallable() { + return stub.setDiskAutoDeleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param instancesSetMachineTypeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineTypeInstance(InstanceName instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + + SetMachineTypeInstanceHttpRequest request = + SetMachineTypeInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .build(); + return setMachineTypeInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMachineTypeInstance(instance.toString(), instancesSetMachineTypeRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param instancesSetMachineTypeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineTypeInstance(String instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + + SetMachineTypeInstanceHttpRequest request = + SetMachineTypeInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .build(); + return setMachineTypeInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
+   *     .build();
+   *   Operation response = instanceClient.setMachineTypeInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest request) { + return setMachineTypeInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setMachineTypeInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setMachineTypeInstanceCallable() { + return stub.setMachineTypeInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   Operation response = instanceClient.setMetadataInstance(instance, metadataResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param metadataResource A metadata key/value entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMetadataInstance(InstanceName instance, Metadata metadataResource) { + + SetMetadataInstanceHttpRequest request = + SetMetadataInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setMetadataResource(metadataResource) + .build(); + return setMetadataInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   Operation response = instanceClient.setMetadataInstance(instance.toString(), metadataResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param metadataResource A metadata key/value entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMetadataInstance(String instance, Metadata metadataResource) { + + SetMetadataInstanceHttpRequest request = + SetMetadataInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setMetadataResource(metadataResource) + .build(); + return setMetadataInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setMetadataResource(metadataResource)
+   *     .build();
+   *   Operation response = instanceClient.setMetadataInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest request) { + return setMetadataInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setMetadataResource(metadataResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setMetadataInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setMetadataInstanceCallable() { + return stub.setMetadataInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets an instance's scheduling options. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Scheduling schedulingResource = Scheduling.newBuilder().build();
+   *   Operation response = instanceClient.setSchedulingInstance(instance, schedulingResource);
+   * }
+   * 
+ * + * @param instance Instance name. + * @param schedulingResource Sets the scheduling options for an Instance. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSchedulingInstance(InstanceName instance, Scheduling schedulingResource) { + + SetSchedulingInstanceHttpRequest request = + SetSchedulingInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setSchedulingResource(schedulingResource) + .build(); + return setSchedulingInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets an instance's scheduling options. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Scheduling schedulingResource = Scheduling.newBuilder().build();
+   *   Operation response = instanceClient.setSchedulingInstance(instance.toString(), schedulingResource);
+   * }
+   * 
+ * + * @param instance Instance name. + * @param schedulingResource Sets the scheduling options for an Instance. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSchedulingInstance(String instance, Scheduling schedulingResource) { + + SetSchedulingInstanceHttpRequest request = + SetSchedulingInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setSchedulingResource(schedulingResource) + .build(); + return setSchedulingInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets an instance's scheduling options. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Scheduling schedulingResource = Scheduling.newBuilder().build();
+   *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setSchedulingResource(schedulingResource)
+   *     .build();
+   *   Operation response = instanceClient.setSchedulingInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest request) { + return setSchedulingInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets an instance's scheduling options. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Scheduling schedulingResource = Scheduling.newBuilder().build();
+   *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setSchedulingResource(schedulingResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setSchedulingInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setSchedulingInstanceCallable() { + return stub.setSchedulingInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the service account on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
+   *   Operation response = instanceClient.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to start. + * @param instancesSetServiceAccountRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setServiceAccountInstance(InstanceName instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + + SetServiceAccountInstanceHttpRequest request = + SetServiceAccountInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) + .build(); + return setServiceAccountInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the service account on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
+   *   Operation response = instanceClient.setServiceAccountInstance(instance.toString(), instancesSetServiceAccountRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to start. + * @param instancesSetServiceAccountRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setServiceAccountInstance(String instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + + SetServiceAccountInstanceHttpRequest request = + SetServiceAccountInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) + .build(); + return setServiceAccountInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the service account on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
+   *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource)
+   *     .build();
+   *   Operation response = instanceClient.setServiceAccountInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRequest request) { + return setServiceAccountInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the service account on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
+   *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setServiceAccountInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setServiceAccountInstanceCallable() { + return stub.setServiceAccountInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets tags for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Tags tagsResource = Tags.newBuilder().build();
+   *   Operation response = instanceClient.setTagsInstance(instance, tagsResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param tagsResource A set of instance tags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTagsInstance(InstanceName instance, Tags tagsResource) { + + SetTagsInstanceHttpRequest request = + SetTagsInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setTagsResource(tagsResource) + .build(); + return setTagsInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets tags for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Tags tagsResource = Tags.newBuilder().build();
+   *   Operation response = instanceClient.setTagsInstance(instance.toString(), tagsResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param tagsResource A set of instance tags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTagsInstance(String instance, Tags tagsResource) { + + SetTagsInstanceHttpRequest request = + SetTagsInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setTagsResource(tagsResource) + .build(); + return setTagsInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets tags for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Tags tagsResource = Tags.newBuilder().build();
+   *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setTagsResource(tagsResource)
+   *     .build();
+   *   Operation response = instanceClient.setTagsInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTagsInstance(SetTagsInstanceHttpRequest request) { + return setTagsInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets tags for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Tags tagsResource = Tags.newBuilder().build();
+   *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setTagsResource(tagsResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setTagsInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setTagsInstanceCallable() { + return stub.setTagsInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.startInstance(instance);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to start. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation startInstance(InstanceName instance) { + + StartInstanceHttpRequest request = + StartInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .build(); + return startInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.startInstance(instance.toString());
+   * }
+   * 
+ * + * @param instance Name of the instance resource to start. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation startInstance(String instance) { + + StartInstanceHttpRequest request = + StartInstanceHttpRequest.newBuilder() + .setInstance(instance) + .build(); + return startInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   Operation response = instanceClient.startInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation startInstance(StartInstanceHttpRequest request) { + return startInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.startInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable startInstanceCallable() { + return stub.startInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to start. + * @param instancesStartWithEncryptionKeyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation startWithEncryptionKeyInstance(InstanceName instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + + StartWithEncryptionKeyInstanceHttpRequest request = + StartWithEncryptionKeyInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource) + .build(); + return startWithEncryptionKeyInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance.toString(), instancesStartWithEncryptionKeyRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to start. + * @param instancesStartWithEncryptionKeyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation startWithEncryptionKeyInstance(String instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + + StartWithEncryptionKeyInstanceHttpRequest request = + StartWithEncryptionKeyInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource) + .build(); + return startWithEncryptionKeyInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
+   *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource)
+   *     .build();
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation startWithEncryptionKeyInstance(StartWithEncryptionKeyInstanceHttpRequest request) { + return startWithEncryptionKeyInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
+   *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.startWithEncryptionKeyInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable startWithEncryptionKeyInstanceCallable() { + return stub.startWithEncryptionKeyInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.stopInstance(instance);
+   * }
+   * 
+ * + * @param instance Name of the instance resource to stop. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation stopInstance(InstanceName instance) { + + StopInstanceHttpRequest request = + StopInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .build(); + return stopInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   Operation response = instanceClient.stopInstance(instance.toString());
+   * }
+   * 
+ * + * @param instance Name of the instance resource to stop. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation stopInstance(String instance) { + + StopInstanceHttpRequest request = + StopInstanceHttpRequest.newBuilder() + .setInstance(instance) + .build(); + return stopInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   Operation response = instanceClient.stopInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation stopInstance(StopInstanceHttpRequest request) { + return stopInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.stopInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable stopInstanceCallable() { + return stub.stopInstanceCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListInstancesPagedResponse extends AbstractPagedListResponse< + AggregatedListInstancesHttpRequest, + InstanceAggregatedList, + InstancesScopedList, + AggregatedListInstancesPage, + AggregatedListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListInstancesPagedResponse apply(AggregatedListInstancesPage input) { + return new AggregatedListInstancesPagedResponse(input); + } + }); + } + + private AggregatedListInstancesPagedResponse(AggregatedListInstancesPage page) { + super(page, AggregatedListInstancesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListInstancesPage extends AbstractPage< + AggregatedListInstancesHttpRequest, + InstanceAggregatedList, + InstancesScopedList, + AggregatedListInstancesPage> { + + private AggregatedListInstancesPage( + PageContext context, + InstanceAggregatedList response) { + super(context, response); + } + + private static AggregatedListInstancesPage createEmptyPage() { + return new AggregatedListInstancesPage(null, null); + } + + @Override + protected AggregatedListInstancesPage createPage( + PageContext context, + InstanceAggregatedList response) { + return new AggregatedListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListInstancesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListInstancesHttpRequest, + InstanceAggregatedList, + InstancesScopedList, + AggregatedListInstancesPage, + AggregatedListInstancesFixedSizeCollection> { + + private AggregatedListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListInstancesFixedSizeCollection createEmptyCollection() { + return new AggregatedListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListInstancesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListInstancesPagedResponse extends AbstractPagedListResponse< + ListInstancesHttpRequest, + InstanceList, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstancesPagedResponse apply(ListInstancesPage input) { + return new ListInstancesPagedResponse(input); + } + }); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInstancesPage extends AbstractPage< + ListInstancesHttpRequest, + InstanceList, + Instance, + ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + InstanceList response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + InstanceList response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInstancesFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstancesHttpRequest, + InstanceList, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java new file mode 100644 index 000000000000..30f2f45ff32a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java @@ -0,0 +1,582 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroup implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String fingerprint; + private final String id; + private final String kind; + private final String name; + private final List namedPorts; + private final String network; + private final String region; + private final String selfLink; + private final Integer size; + private final String subnetwork; + private final String zone; + + private InstanceGroup() { + this.creationTimestamp = null; + this.description = null; + this.fingerprint = null; + this.id = null; + this.kind = null; + this.name = null; + this.namedPorts = null; + this.network = null; + this.region = null; + this.selfLink = null; + this.size = null; + this.subnetwork = null; + this.zone = null; + } + + + private InstanceGroup( + String creationTimestamp, + String description, + String fingerprint, + String id, + String kind, + String name, + List namedPorts, + String network, + String region, + String selfLink, + Integer size, + String subnetwork, + String zone + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.fingerprint = fingerprint; + this.id = id; + this.kind = kind; + this.name = name; + this.namedPorts = namedPorts; + this.network = network; + this.region = region; + this.selfLink = selfLink; + this.size = size; + this.subnetwork = subnetwork; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("size") && size != null) { + fieldMap.put("size", Collections.singletonList(String.valueOf(size))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("size")) { + return String.valueOf(size); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getFingerprint() { + return fingerprint; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public String getNetwork() { + return network; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getSize() { + return size; + } + + public String getSubnetwork() { + return subnetwork; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroup DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroup(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String fingerprint; + private String id; + private String kind; + private String name; + private List namedPorts; + private String network; + private String region; + private String selfLink; + private Integer size; + private String subnetwork; + private String zone; + + Builder() {} + + public Builder mergeFrom(InstanceGroup other) { + if (other == InstanceGroup.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNamedPortsList() != null) { + this.namedPorts = other.namedPorts; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSize() != null) { + this.size = other.size; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InstanceGroup source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.fingerprint = source.fingerprint; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.namedPorts = source.namedPorts; + this.network = source.network; + this.region = source.region; + this.selfLink = source.selfLink; + this.size = source.size; + this.subnetwork = source.subnetwork; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public Builder addAllNamedPorts(List namedPorts) { + if (this.namedPorts == null) { + this.namedPorts = new ArrayList<>(namedPorts.size()); + } + this.namedPorts.addAll(namedPorts); + return this; + } + + public Builder addNamedPorts(NamedPort namedPorts) { + this.namedPorts.add(namedPorts); + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getSize() { + return size; + } + + public Builder setSize(Integer size) { + this.size = size; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InstanceGroup build() { + + + + + + + + + + + + + return new InstanceGroup( + creationTimestamp, + description, + fingerprint, + id, + kind, + name, + namedPorts, + network, + region, + selfLink, + size, + subnetwork, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.addAllNamedPorts(this.namedPorts); + newBuilder.setNetwork(this.network); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSize(this.size); + newBuilder.setSubnetwork(this.subnetwork); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroup{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "fingerprint=" + fingerprint + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "namedPorts=" + namedPorts + ", " + + "network=" + network + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "size=" + size + ", " + + "subnetwork=" + subnetwork + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroup) { + InstanceGroup that = (InstanceGroup) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.namedPorts, that.getNamedPortsList()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.size, that.getSize()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + fingerprint, + id, + kind, + name, + namedPorts, + network, + region, + selfLink, + size, + subnetwork, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java new file mode 100644 index 000000000000..cf44e637f6b2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceGroupAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceGroupAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceGroupAggregatedList other) { + if (other == InstanceGroupAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceGroupAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceGroupAggregatedList build() { + + + + + return new InstanceGroupAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupAggregatedList) { + InstanceGroupAggregatedList that = (InstanceGroupAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java new file mode 100644 index 000000000000..3439cf4b69f0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java @@ -0,0 +1,1484 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InstanceGroupStub; +import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+ *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+ *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
+ *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the instanceGroupClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InstanceGroupSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InstanceGroupSettings instanceGroupSettings =
+ *     InstanceGroupSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InstanceGroupClient instanceGroupClient =
+ *     InstanceGroupClient.create(instanceGroupSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InstanceGroupSettings instanceGroupSettings =
+ *     InstanceGroupSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InstanceGroupClient instanceGroupClient =
+ *     InstanceGroupClient.create(instanceGroupSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceGroupClient implements BackgroundResource { + private final InstanceGroupSettings settings; + private final InstanceGroupStub stub; + + + + /** + * Constructs an instance of InstanceGroupClient with default settings. + */ + public static final InstanceGroupClient create() throws IOException { + return create(InstanceGroupSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InstanceGroupClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InstanceGroupClient create(InstanceGroupSettings settings) throws IOException { + return new InstanceGroupClient(settings); + } + + /** + * Constructs an instance of InstanceGroupClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InstanceGroupSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InstanceGroupClient create(InstanceGroupStub stub) { + return new InstanceGroupClient(stub); + } + + /** + * Constructs an instance of InstanceGroupClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InstanceGroupClient(InstanceGroupSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InstanceGroupStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InstanceGroupClient(InstanceGroupStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InstanceGroupSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceGroupStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group where you are adding instances. + * @param instanceGroupsAddInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addInstancesInstanceGroup(InstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + + AddInstancesInstanceGroupHttpRequest request = + AddInstancesInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) + .build(); + return addInstancesInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup.toString(), instanceGroupsAddInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group where you are adding instances. + * @param instanceGroupsAddInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addInstancesInstanceGroup(String instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + + AddInstancesInstanceGroupHttpRequest request = + AddInstancesInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) + .build(); + return addInstancesInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
+   *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addInstancesInstanceGroup(AddInstancesInstanceGroupHttpRequest request) { + return addInstancesInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
+   *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupClient.addInstancesInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable addInstancesInstanceGroupCallable() { + return stub.addInstancesInstanceGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups and sorts them by zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstanceGroupsScopedList element : instanceGroupClient.aggregatedListInstanceGroups(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(ProjectName project) { + AggregatedListInstanceGroupsHttpRequest request = + AggregatedListInstanceGroupsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups and sorts them by zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstanceGroupsScopedList element : instanceGroupClient.aggregatedListInstanceGroups(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(String project) { + AggregatedListInstanceGroupsHttpRequest request = + AggregatedListInstanceGroupsHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups and sorts them by zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstanceGroupsHttpRequest request = AggregatedListInstanceGroupsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (InstanceGroupsScopedList element : instanceGroupClient.aggregatedListInstanceGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(AggregatedListInstanceGroupsHttpRequest request) { + return aggregatedListInstanceGroupsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups and sorts them by zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstanceGroupsHttpRequest request = AggregatedListInstanceGroupsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListInstanceGroupsPagedResponse> future = instanceGroupClient.aggregatedListInstanceGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceGroupsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInstanceGroupsPagedCallable() { + return stub.aggregatedListInstanceGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups and sorts them by zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstanceGroupsHttpRequest request = AggregatedListInstanceGroupsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceGroupAggregatedList response = instanceGroupClient.aggregatedListInstanceGroupsCallable().call(request);
+   *     for (InstanceGroupsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInstanceGroupsCallable() { + return stub.aggregatedListInstanceGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(instanceGroup);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceGroup(InstanceGroupName instanceGroup) { + + DeleteInstanceGroupHttpRequest request = + DeleteInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .build(); + return deleteInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(instanceGroup.toString());
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceGroup(String instanceGroup) { + + DeleteInstanceGroupHttpRequest request = + DeleteInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .build(); + return deleteInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .build();
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest request) { + return deleteInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupClient.deleteInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInstanceGroupCallable() { + return stub.deleteInstanceGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group. Get a list of available instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroup response = instanceGroupClient.getInstanceGroup(instanceGroup);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroup getInstanceGroup(InstanceGroupName instanceGroup) { + + GetInstanceGroupHttpRequest request = + GetInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .build(); + return getInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group. Get a list of available instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroup response = instanceGroupClient.getInstanceGroup(instanceGroup.toString());
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroup getInstanceGroup(String instanceGroup) { + + GetInstanceGroupHttpRequest request = + GetInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .build(); + return getInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group. Get a list of available instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   GetInstanceGroupHttpRequest request = GetInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .build();
+   *   InstanceGroup response = instanceGroupClient.getInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request) { + return getInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group. Get a list of available instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   GetInstanceGroupHttpRequest request = GetInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .build();
+   *   ApiFuture<InstanceGroup> future = instanceGroupClient.getInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   InstanceGroup response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInstanceGroupCallable() { + return stub.getInstanceGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
+   *   Operation response = instanceGroupClient.insertInstanceGroup(zone, instanceGroupResource);
+   * }
+   * 
+ * + * @param zone The name of the zone where you want to create the instance group. + * @param instanceGroupResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceGroup(ZoneName zone, InstanceGroup instanceGroupResource) { + + InsertInstanceGroupHttpRequest request = + InsertInstanceGroupHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .setInstanceGroupResource(instanceGroupResource) + .build(); + return insertInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
+   *   Operation response = instanceGroupClient.insertInstanceGroup(zone.toString(), instanceGroupResource);
+   * }
+   * 
+ * + * @param zone The name of the zone where you want to create the instance group. + * @param instanceGroupResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceGroup(String zone, InstanceGroup instanceGroupResource) { + + InsertInstanceGroupHttpRequest request = + InsertInstanceGroupHttpRequest.newBuilder() + .setZone(zone) + .setInstanceGroupResource(instanceGroupResource) + .build(); + return insertInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
+   *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setInstanceGroupResource(instanceGroupResource)
+   *     .build();
+   *   Operation response = instanceGroupClient.insertInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceGroup(InsertInstanceGroupHttpRequest request) { + return insertInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
+   *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setInstanceGroupResource(instanceGroupResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupClient.insertInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertInstanceGroupCallable() { + return stub.insertInstanceGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups that are located in the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (InstanceGroup element : instanceGroupClient.listInstanceGroups(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone where the instance group is located. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceGroupsPagedResponse listInstanceGroups(ZoneName zone) { + ListInstanceGroupsHttpRequest request = + ListInstanceGroupsHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups that are located in the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (InstanceGroup element : instanceGroupClient.listInstanceGroups(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone where the instance group is located. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceGroupsPagedResponse listInstanceGroups(String zone) { + ListInstanceGroupsHttpRequest request = + ListInstanceGroupsHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups that are located in the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstanceGroupsHttpRequest request = ListInstanceGroupsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (InstanceGroup element : instanceGroupClient.listInstanceGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceGroupsPagedResponse listInstanceGroups(ListInstanceGroupsHttpRequest request) { + return listInstanceGroupsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups that are located in the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstanceGroupsHttpRequest request = ListInstanceGroupsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListInstanceGroupsPagedResponse> future = instanceGroupClient.listInstanceGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceGroup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstanceGroupsPagedCallable() { + return stub.listInstanceGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance groups that are located in the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstanceGroupsHttpRequest request = ListInstanceGroupsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceGroupList response = instanceGroupClient.listInstanceGroupsCallable().call(request);
+   *     for (InstanceGroup element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstanceGroupsCallable() { + return stub.listInstanceGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the instances in the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
+   *   for (InstanceWithNamedPorts element : instanceGroupClient.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param instanceGroupsListInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(InstanceGroupName instanceGroup, InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + ListInstancesInstanceGroupsHttpRequest request = + ListInstancesInstanceGroupsHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource) + .build(); + return listInstancesInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the instances in the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
+   *   for (InstanceWithNamedPorts element : instanceGroupClient.listInstancesInstanceGroups(instanceGroup.toString(), instanceGroupsListInstancesRequestResource).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param instanceGroupsListInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(String instanceGroup, InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + ListInstancesInstanceGroupsHttpRequest request = + ListInstancesInstanceGroupsHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource) + .build(); + return listInstancesInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the instances in the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
+   *   ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource)
+   *     .build();
+   *   for (InstanceWithNamedPorts element : instanceGroupClient.listInstancesInstanceGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(ListInstancesInstanceGroupsHttpRequest request) { + return listInstancesInstanceGroupsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the instances in the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
+   *   ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<ListInstancesInstanceGroupsPagedResponse> future = instanceGroupClient.listInstancesInstanceGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceWithNamedPorts element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstancesInstanceGroupsPagedCallable() { + return stub.listInstancesInstanceGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the instances in the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
+   *   ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource)
+   *     .build();
+   *   while (true) {
+   *     InstanceGroupsListInstances response = instanceGroupClient.listInstancesInstanceGroupsCallable().call(request);
+   *     for (InstanceWithNamedPorts element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstancesInstanceGroupsCallable() { + return stub.listInstancesInstanceGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group where the specified instances will be removed. + * @param instanceGroupsRemoveInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeInstancesInstanceGroup(InstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + + RemoveInstancesInstanceGroupHttpRequest request = + RemoveInstancesInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource) + .build(); + return removeInstancesInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(instanceGroup.toString(), instanceGroupsRemoveInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group where the specified instances will be removed. + * @param instanceGroupsRemoveInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeInstancesInstanceGroup(String instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + + RemoveInstancesInstanceGroupHttpRequest request = + RemoveInstancesInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource) + .build(); + return removeInstancesInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
+   *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeInstancesInstanceGroup(RemoveInstancesInstanceGroupHttpRequest request) { + return removeInstancesInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
+   *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupClient.removeInstancesInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable removeInstancesInstanceGroupCallable() { + return stub.removeInstancesInstanceGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group where the named ports are updated. + * @param instanceGroupsSetNamedPortsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNamedPortsInstanceGroup(InstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + + SetNamedPortsInstanceGroupHttpRequest request = + SetNamedPortsInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource) + .build(); + return setNamedPortsInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(instanceGroup.toString(), instanceGroupsSetNamedPortsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the instance group where the named ports are updated. + * @param instanceGroupsSetNamedPortsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNamedPortsInstanceGroup(String instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + + SetNamedPortsInstanceGroupHttpRequest request = + SetNamedPortsInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource) + .build(); + return setNamedPortsInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNamedPortsInstanceGroup(SetNamedPortsInstanceGroupHttpRequest request) { + return setNamedPortsInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified instance group. + * + * Sample code: + *

+   * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupClient.setNamedPortsInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setNamedPortsInstanceGroupCallable() { + return stub.setNamedPortsInstanceGroupCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListInstanceGroupsPagedResponse extends AbstractPagedListResponse< + AggregatedListInstanceGroupsHttpRequest, + InstanceGroupAggregatedList, + InstanceGroupsScopedList, + AggregatedListInstanceGroupsPage, + AggregatedListInstanceGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListInstanceGroupsPagedResponse apply(AggregatedListInstanceGroupsPage input) { + return new AggregatedListInstanceGroupsPagedResponse(input); + } + }); + } + + private AggregatedListInstanceGroupsPagedResponse(AggregatedListInstanceGroupsPage page) { + super(page, AggregatedListInstanceGroupsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListInstanceGroupsPage extends AbstractPage< + AggregatedListInstanceGroupsHttpRequest, + InstanceGroupAggregatedList, + InstanceGroupsScopedList, + AggregatedListInstanceGroupsPage> { + + private AggregatedListInstanceGroupsPage( + PageContext context, + InstanceGroupAggregatedList response) { + super(context, response); + } + + private static AggregatedListInstanceGroupsPage createEmptyPage() { + return new AggregatedListInstanceGroupsPage(null, null); + } + + @Override + protected AggregatedListInstanceGroupsPage createPage( + PageContext context, + InstanceGroupAggregatedList response) { + return new AggregatedListInstanceGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListInstanceGroupsHttpRequest, + InstanceGroupAggregatedList, + InstanceGroupsScopedList, + AggregatedListInstanceGroupsPage, + AggregatedListInstanceGroupsFixedSizeCollection> { + + private AggregatedListInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListInstanceGroupsFixedSizeCollection createEmptyCollection() { + return new AggregatedListInstanceGroupsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListInstanceGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListInstanceGroupsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListInstanceGroupsPagedResponse extends AbstractPagedListResponse< + ListInstanceGroupsHttpRequest, + InstanceGroupList, + InstanceGroup, + ListInstanceGroupsPage, + ListInstanceGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstanceGroupsPagedResponse apply(ListInstanceGroupsPage input) { + return new ListInstanceGroupsPagedResponse(input); + } + }); + } + + private ListInstanceGroupsPagedResponse(ListInstanceGroupsPage page) { + super(page, ListInstanceGroupsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInstanceGroupsPage extends AbstractPage< + ListInstanceGroupsHttpRequest, + InstanceGroupList, + InstanceGroup, + ListInstanceGroupsPage> { + + private ListInstanceGroupsPage( + PageContext context, + InstanceGroupList response) { + super(context, response); + } + + private static ListInstanceGroupsPage createEmptyPage() { + return new ListInstanceGroupsPage(null, null); + } + + @Override + protected ListInstanceGroupsPage createPage( + PageContext context, + InstanceGroupList response) { + return new ListInstanceGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstanceGroupsHttpRequest, + InstanceGroupList, + InstanceGroup, + ListInstanceGroupsPage, + ListInstanceGroupsFixedSizeCollection> { + + private ListInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstanceGroupsFixedSizeCollection createEmptyCollection() { + return new ListInstanceGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListInstanceGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstanceGroupsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListInstancesInstanceGroupsPagedResponse extends AbstractPagedListResponse< + ListInstancesInstanceGroupsHttpRequest, + InstanceGroupsListInstances, + InstanceWithNamedPorts, + ListInstancesInstanceGroupsPage, + ListInstancesInstanceGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstancesInstanceGroupsPagedResponse apply(ListInstancesInstanceGroupsPage input) { + return new ListInstancesInstanceGroupsPagedResponse(input); + } + }); + } + + private ListInstancesInstanceGroupsPagedResponse(ListInstancesInstanceGroupsPage page) { + super(page, ListInstancesInstanceGroupsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInstancesInstanceGroupsPage extends AbstractPage< + ListInstancesInstanceGroupsHttpRequest, + InstanceGroupsListInstances, + InstanceWithNamedPorts, + ListInstancesInstanceGroupsPage> { + + private ListInstancesInstanceGroupsPage( + PageContext context, + InstanceGroupsListInstances response) { + super(context, response); + } + + private static ListInstancesInstanceGroupsPage createEmptyPage() { + return new ListInstancesInstanceGroupsPage(null, null); + } + + @Override + protected ListInstancesInstanceGroupsPage createPage( + PageContext context, + InstanceGroupsListInstances response) { + return new ListInstancesInstanceGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInstancesInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstancesInstanceGroupsHttpRequest, + InstanceGroupsListInstances, + InstanceWithNamedPorts, + ListInstancesInstanceGroupsPage, + ListInstancesInstanceGroupsFixedSizeCollection> { + + private ListInstancesInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesInstanceGroupsFixedSizeCollection createEmptyCollection() { + return new ListInstancesInstanceGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesInstanceGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesInstanceGroupsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java new file mode 100644 index 000000000000..c37ae7dacc99 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceGroupList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceGroupList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroup item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceGroupList other) { + if (other == InstanceGroupList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceGroupList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceGroup items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceGroupList build() { + + + + + return new InstanceGroupList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupList) { + InstanceGroupList that = (InstanceGroupList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java new file mode 100644 index 000000000000..56796afeb6a0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java @@ -0,0 +1,696 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManager implements ApiMessage { + private final String baseInstanceName; + private final String creationTimestamp; + private final InstanceGroupManagerActionsSummary currentActions; + private final String description; + private final String fingerprint; + private final String id; + private final String instanceGroup; + private final String instanceTemplate; + private final String kind; + private final String name; + private final List namedPorts; + private final String region; + private final String selfLink; + private final List targetPools; + private final Integer targetSize; + private final String zone; + + private InstanceGroupManager() { + this.baseInstanceName = null; + this.creationTimestamp = null; + this.currentActions = null; + this.description = null; + this.fingerprint = null; + this.id = null; + this.instanceGroup = null; + this.instanceTemplate = null; + this.kind = null; + this.name = null; + this.namedPorts = null; + this.region = null; + this.selfLink = null; + this.targetPools = null; + this.targetSize = null; + this.zone = null; + } + + + private InstanceGroupManager( + String baseInstanceName, + String creationTimestamp, + InstanceGroupManagerActionsSummary currentActions, + String description, + String fingerprint, + String id, + String instanceGroup, + String instanceTemplate, + String kind, + String name, + List namedPorts, + String region, + String selfLink, + List targetPools, + Integer targetSize, + String zone + ) { + this.baseInstanceName = baseInstanceName; + this.creationTimestamp = creationTimestamp; + this.currentActions = currentActions; + this.description = description; + this.fingerprint = fingerprint; + this.id = id; + this.instanceGroup = instanceGroup; + this.instanceTemplate = instanceTemplate; + this.kind = kind; + this.name = name; + this.namedPorts = namedPorts; + this.region = region; + this.selfLink = selfLink; + this.targetPools = targetPools; + this.targetSize = targetSize; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("baseInstanceName") && baseInstanceName != null) { + fieldMap.put("baseInstanceName", Collections.singletonList(String.valueOf(baseInstanceName))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("currentActions") && currentActions != null) { + fieldMap.put("currentActions", Collections.singletonList(String.valueOf(currentActions))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); + } + if (fieldNames.contains("targetSize") && targetSize != null) { + fieldMap.put("targetSize", Collections.singletonList(String.valueOf(targetSize))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("baseInstanceName")) { + return String.valueOf(baseInstanceName); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("currentActions")) { + return String.valueOf(currentActions); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } + if (fieldName.equals("targetSize")) { + return String.valueOf(targetSize); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getBaseInstanceName() { + return baseInstanceName; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public InstanceGroupManagerActionsSummary getCurrentActions() { + return currentActions; + } + + public String getDescription() { + return description; + } + + public String getFingerprint() { + return fingerprint; + } + + public String getId() { + return id; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public List getTargetPoolsList() { + return targetPools; + } + + public Integer getTargetSize() { + return targetSize; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManager prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManager getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManager DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManager(); + } + + public static class Builder { + private String baseInstanceName; + private String creationTimestamp; + private InstanceGroupManagerActionsSummary currentActions; + private String description; + private String fingerprint; + private String id; + private String instanceGroup; + private String instanceTemplate; + private String kind; + private String name; + private List namedPorts; + private String region; + private String selfLink; + private List targetPools; + private Integer targetSize; + private String zone; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManager other) { + if (other == InstanceGroupManager.getDefaultInstance()) return this; + if (other.getBaseInstanceName() != null) { + this.baseInstanceName = other.baseInstanceName; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getCurrentActions() != null) { + this.currentActions = other.currentActions; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getInstanceTemplate() != null) { + this.instanceTemplate = other.instanceTemplate; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNamedPortsList() != null) { + this.namedPorts = other.namedPorts; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTargetPoolsList() != null) { + this.targetPools = other.targetPools; + } + if (other.getTargetSize() != null) { + this.targetSize = other.targetSize; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(InstanceGroupManager source) { + this.baseInstanceName = source.baseInstanceName; + this.creationTimestamp = source.creationTimestamp; + this.currentActions = source.currentActions; + this.description = source.description; + this.fingerprint = source.fingerprint; + this.id = source.id; + this.instanceGroup = source.instanceGroup; + this.instanceTemplate = source.instanceTemplate; + this.kind = source.kind; + this.name = source.name; + this.namedPorts = source.namedPorts; + this.region = source.region; + this.selfLink = source.selfLink; + this.targetPools = source.targetPools; + this.targetSize = source.targetSize; + this.zone = source.zone; + } + + public String getBaseInstanceName() { + return baseInstanceName; + } + + public Builder setBaseInstanceName(String baseInstanceName) { + this.baseInstanceName = baseInstanceName; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public InstanceGroupManagerActionsSummary getCurrentActions() { + return currentActions; + } + + public Builder setCurrentActions(InstanceGroupManagerActionsSummary currentActions) { + this.currentActions = currentActions; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public Builder addAllNamedPorts(List namedPorts) { + if (this.namedPorts == null) { + this.namedPorts = new ArrayList<>(namedPorts.size()); + } + this.namedPorts.addAll(namedPorts); + return this; + } + + public Builder addNamedPorts(NamedPort namedPorts) { + this.namedPorts.add(namedPorts); + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getTargetPoolsList() { + return targetPools; + } + + public Builder addAllTargetPools(List targetPools) { + if (this.targetPools == null) { + this.targetPools = new ArrayList<>(targetPools.size()); + } + this.targetPools.addAll(targetPools); + return this; + } + + public Builder addTargetPools(String targetPools) { + this.targetPools.add(targetPools); + return this; + } + + public Integer getTargetSize() { + return targetSize; + } + + public Builder setTargetSize(Integer targetSize) { + this.targetSize = targetSize; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public InstanceGroupManager build() { + + + + + + + + + + + + + + + + return new InstanceGroupManager( + baseInstanceName, + creationTimestamp, + currentActions, + description, + fingerprint, + id, + instanceGroup, + instanceTemplate, + kind, + name, + namedPorts, + region, + selfLink, + targetPools, + targetSize, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBaseInstanceName(this.baseInstanceName); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setCurrentActions(this.currentActions); + newBuilder.setDescription(this.description); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.setId(this.id); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setInstanceTemplate(this.instanceTemplate); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.addAllNamedPorts(this.namedPorts); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllTargetPools(this.targetPools); + newBuilder.setTargetSize(this.targetSize); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManager{" + + "baseInstanceName=" + baseInstanceName + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "currentActions=" + currentActions + ", " + + "description=" + description + ", " + + "fingerprint=" + fingerprint + ", " + + "id=" + id + ", " + + "instanceGroup=" + instanceGroup + ", " + + "instanceTemplate=" + instanceTemplate + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "namedPorts=" + namedPorts + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "targetPools=" + targetPools + ", " + + "targetSize=" + targetSize + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManager) { + InstanceGroupManager that = (InstanceGroupManager) o; + return + Objects.equals(this.baseInstanceName, that.getBaseInstanceName()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.currentActions, that.getCurrentActions()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.namedPorts, that.getNamedPortsList()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.targetPools, that.getTargetPoolsList()) && + Objects.equals(this.targetSize, that.getTargetSize()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + baseInstanceName, + creationTimestamp, + currentActions, + description, + fingerprint, + id, + instanceGroup, + instanceTemplate, + kind, + name, + namedPorts, + region, + selfLink, + targetPools, + targetSize, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java new file mode 100644 index 000000000000..3523709d86db --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java @@ -0,0 +1,400 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerActionsSummary implements ApiMessage { + private final Integer abandoning; + private final Integer creating; + private final Integer creatingWithoutRetries; + private final Integer deleting; + private final Integer none; + private final Integer recreating; + private final Integer refreshing; + private final Integer restarting; + + private InstanceGroupManagerActionsSummary() { + this.abandoning = null; + this.creating = null; + this.creatingWithoutRetries = null; + this.deleting = null; + this.none = null; + this.recreating = null; + this.refreshing = null; + this.restarting = null; + } + + + private InstanceGroupManagerActionsSummary( + Integer abandoning, + Integer creating, + Integer creatingWithoutRetries, + Integer deleting, + Integer none, + Integer recreating, + Integer refreshing, + Integer restarting + ) { + this.abandoning = abandoning; + this.creating = creating; + this.creatingWithoutRetries = creatingWithoutRetries; + this.deleting = deleting; + this.none = none; + this.recreating = recreating; + this.refreshing = refreshing; + this.restarting = restarting; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("abandoning") && abandoning != null) { + fieldMap.put("abandoning", Collections.singletonList(String.valueOf(abandoning))); + } + if (fieldNames.contains("creating") && creating != null) { + fieldMap.put("creating", Collections.singletonList(String.valueOf(creating))); + } + if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) { + fieldMap.put("creatingWithoutRetries", Collections.singletonList(String.valueOf(creatingWithoutRetries))); + } + if (fieldNames.contains("deleting") && deleting != null) { + fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting))); + } + if (fieldNames.contains("none") && none != null) { + fieldMap.put("none", Collections.singletonList(String.valueOf(none))); + } + if (fieldNames.contains("recreating") && recreating != null) { + fieldMap.put("recreating", Collections.singletonList(String.valueOf(recreating))); + } + if (fieldNames.contains("refreshing") && refreshing != null) { + fieldMap.put("refreshing", Collections.singletonList(String.valueOf(refreshing))); + } + if (fieldNames.contains("restarting") && restarting != null) { + fieldMap.put("restarting", Collections.singletonList(String.valueOf(restarting))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("abandoning")) { + return String.valueOf(abandoning); + } + if (fieldName.equals("creating")) { + return String.valueOf(creating); + } + if (fieldName.equals("creatingWithoutRetries")) { + return String.valueOf(creatingWithoutRetries); + } + if (fieldName.equals("deleting")) { + return String.valueOf(deleting); + } + if (fieldName.equals("none")) { + return String.valueOf(none); + } + if (fieldName.equals("recreating")) { + return String.valueOf(recreating); + } + if (fieldName.equals("refreshing")) { + return String.valueOf(refreshing); + } + if (fieldName.equals("restarting")) { + return String.valueOf(restarting); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getAbandoning() { + return abandoning; + } + + public Integer getCreating() { + return creating; + } + + public Integer getCreatingWithoutRetries() { + return creatingWithoutRetries; + } + + public Integer getDeleting() { + return deleting; + } + + public Integer getNone() { + return none; + } + + public Integer getRecreating() { + return recreating; + } + + public Integer getRefreshing() { + return refreshing; + } + + public Integer getRestarting() { + return restarting; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagerActionsSummary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagerActionsSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagerActionsSummary DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagerActionsSummary(); + } + + public static class Builder { + private Integer abandoning; + private Integer creating; + private Integer creatingWithoutRetries; + private Integer deleting; + private Integer none; + private Integer recreating; + private Integer refreshing; + private Integer restarting; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagerActionsSummary other) { + if (other == InstanceGroupManagerActionsSummary.getDefaultInstance()) return this; + if (other.getAbandoning() != null) { + this.abandoning = other.abandoning; + } + if (other.getCreating() != null) { + this.creating = other.creating; + } + if (other.getCreatingWithoutRetries() != null) { + this.creatingWithoutRetries = other.creatingWithoutRetries; + } + if (other.getDeleting() != null) { + this.deleting = other.deleting; + } + if (other.getNone() != null) { + this.none = other.none; + } + if (other.getRecreating() != null) { + this.recreating = other.recreating; + } + if (other.getRefreshing() != null) { + this.refreshing = other.refreshing; + } + if (other.getRestarting() != null) { + this.restarting = other.restarting; + } + return this; + } + + Builder(InstanceGroupManagerActionsSummary source) { + this.abandoning = source.abandoning; + this.creating = source.creating; + this.creatingWithoutRetries = source.creatingWithoutRetries; + this.deleting = source.deleting; + this.none = source.none; + this.recreating = source.recreating; + this.refreshing = source.refreshing; + this.restarting = source.restarting; + } + + public Integer getAbandoning() { + return abandoning; + } + + public Builder setAbandoning(Integer abandoning) { + this.abandoning = abandoning; + return this; + } + + public Integer getCreating() { + return creating; + } + + public Builder setCreating(Integer creating) { + this.creating = creating; + return this; + } + + public Integer getCreatingWithoutRetries() { + return creatingWithoutRetries; + } + + public Builder setCreatingWithoutRetries(Integer creatingWithoutRetries) { + this.creatingWithoutRetries = creatingWithoutRetries; + return this; + } + + public Integer getDeleting() { + return deleting; + } + + public Builder setDeleting(Integer deleting) { + this.deleting = deleting; + return this; + } + + public Integer getNone() { + return none; + } + + public Builder setNone(Integer none) { + this.none = none; + return this; + } + + public Integer getRecreating() { + return recreating; + } + + public Builder setRecreating(Integer recreating) { + this.recreating = recreating; + return this; + } + + public Integer getRefreshing() { + return refreshing; + } + + public Builder setRefreshing(Integer refreshing) { + this.refreshing = refreshing; + return this; + } + + public Integer getRestarting() { + return restarting; + } + + public Builder setRestarting(Integer restarting) { + this.restarting = restarting; + return this; + } + + + public InstanceGroupManagerActionsSummary build() { + + + + + + + + return new InstanceGroupManagerActionsSummary( + abandoning, + creating, + creatingWithoutRetries, + deleting, + none, + recreating, + refreshing, + restarting + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAbandoning(this.abandoning); + newBuilder.setCreating(this.creating); + newBuilder.setCreatingWithoutRetries(this.creatingWithoutRetries); + newBuilder.setDeleting(this.deleting); + newBuilder.setNone(this.none); + newBuilder.setRecreating(this.recreating); + newBuilder.setRefreshing(this.refreshing); + newBuilder.setRestarting(this.restarting); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagerActionsSummary{" + + "abandoning=" + abandoning + ", " + + "creating=" + creating + ", " + + "creatingWithoutRetries=" + creatingWithoutRetries + ", " + + "deleting=" + deleting + ", " + + "none=" + none + ", " + + "recreating=" + recreating + ", " + + "refreshing=" + refreshing + ", " + + "restarting=" + restarting + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerActionsSummary) { + InstanceGroupManagerActionsSummary that = (InstanceGroupManagerActionsSummary) o; + return + Objects.equals(this.abandoning, that.getAbandoning()) && + Objects.equals(this.creating, that.getCreating()) && + Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries()) && + Objects.equals(this.deleting, that.getDeleting()) && + Objects.equals(this.none, that.getNone()) && + Objects.equals(this.recreating, that.getRecreating()) && + Objects.equals(this.refreshing, that.getRefreshing()) && + Objects.equals(this.restarting, that.getRestarting()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + abandoning, + creating, + creatingWithoutRetries, + deleting, + none, + recreating, + refreshing, + restarting + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java new file mode 100644 index 000000000000..140d7f521f4f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceGroupManagerAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceGroupManagerAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagerAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagerAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagerAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagerAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagerAggregatedList other) { + if (other == InstanceGroupManagerAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceGroupManagerAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceGroupManagerAggregatedList build() { + + + + + return new InstanceGroupManagerAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagerAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerAggregatedList) { + InstanceGroupManagerAggregatedList that = (InstanceGroupManagerAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java new file mode 100644 index 000000000000..e0692a5a613a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java @@ -0,0 +1,1662 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InstanceGroupManagerStub; +import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+ *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+ *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+ *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InstanceGroupManagerSettings instanceGroupManagerSettings =
+ *     InstanceGroupManagerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InstanceGroupManagerClient instanceGroupManagerClient =
+ *     InstanceGroupManagerClient.create(instanceGroupManagerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InstanceGroupManagerSettings instanceGroupManagerSettings =
+ *     InstanceGroupManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InstanceGroupManagerClient instanceGroupManagerClient =
+ *     InstanceGroupManagerClient.create(instanceGroupManagerSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceGroupManagerClient implements BackgroundResource { + private final InstanceGroupManagerSettings settings; + private final InstanceGroupManagerStub stub; + + + + /** + * Constructs an instance of InstanceGroupManagerClient with default settings. + */ + public static final InstanceGroupManagerClient create() throws IOException { + return create(InstanceGroupManagerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InstanceGroupManagerClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings) throws IOException { + return new InstanceGroupManagerClient(settings); + } + + /** + * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InstanceGroupManagerSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InstanceGroupManagerClient create(InstanceGroupManagerStub stub) { + return new InstanceGroupManagerClient(stub); + } + + /** + * Constructs an instance of InstanceGroupManagerClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InstanceGroupManagerClient(InstanceGroupManagerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InstanceGroupManagerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InstanceGroupManagerClient(InstanceGroupManagerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InstanceGroupManagerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceGroupManagerStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersAbandonInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation abandonInstancesInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { + + AbandonInstancesInstanceGroupManagerHttpRequest request = + AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource) + .build(); + return abandonInstancesInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersAbandonInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersAbandonInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation abandonInstancesInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { + + AbandonInstancesInstanceGroupManagerHttpRequest request = + AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource) + .build(); + return abandonInstancesInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInstanceGroupManagerHttpRequest request) { + return abandonInstancesInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.abandonInstancesInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable abandonInstancesInstanceGroupManagerCallable() { + return stub.abandonInstancesInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups and groups them by zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstanceGroupManagersScopedList element : instanceGroupManagerClient.aggregatedListInstanceGroupManagers(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(ProjectName project) { + AggregatedListInstanceGroupManagersHttpRequest request = + AggregatedListInstanceGroupManagersHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups and groups them by zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstanceGroupManagersScopedList element : instanceGroupManagerClient.aggregatedListInstanceGroupManagers(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(String project) { + AggregatedListInstanceGroupManagersHttpRequest request = + AggregatedListInstanceGroupManagersHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups and groups them by zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstanceGroupManagersHttpRequest request = AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (InstanceGroupManagersScopedList element : instanceGroupManagerClient.aggregatedListInstanceGroupManagers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(AggregatedListInstanceGroupManagersHttpRequest request) { + return aggregatedListInstanceGroupManagersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups and groups them by zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstanceGroupManagersHttpRequest request = AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListInstanceGroupManagersPagedResponse> future = instanceGroupManagerClient.aggregatedListInstanceGroupManagersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceGroupManagersScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { + return stub.aggregatedListInstanceGroupManagersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups and groups them by zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInstanceGroupManagersHttpRequest request = AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceGroupManagerAggregatedList response = instanceGroupManagerClient.aggregatedListInstanceGroupManagersCallable().call(request);
+   *     for (InstanceGroupManagersScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInstanceGroupManagersCallable() { + return stub.aggregatedListInstanceGroupManagersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(instanceGroupManager);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceGroupManager(InstanceGroupManagerName instanceGroupManager) { + + DeleteInstanceGroupManagerHttpRequest request = + DeleteInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return deleteInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceGroupManager(String instanceGroupManager) { + + DeleteInstanceGroupManagerHttpRequest request = + DeleteInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .build(); + return deleteInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttpRequest request) { + return deleteInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.deleteInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInstanceGroupManagerCallable() { + return stub.deleteInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersDeleteInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstancesInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { + + DeleteInstancesInstanceGroupManagerHttpRequest request = + DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource) + .build(); + return deleteInstancesInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersDeleteInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersDeleteInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstancesInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { + + DeleteInstancesInstanceGroupManagerHttpRequest request = + DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource) + .build(); + return deleteInstancesInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstanceGroupManagerHttpRequest request) { + return deleteInstancesInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.deleteInstancesInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInstancesInstanceGroupManagerCallable() { + return stub.deleteInstancesInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager response = instanceGroupManagerClient.getInstanceGroupManager(instanceGroupManager);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManager getInstanceGroupManager(InstanceGroupManagerName instanceGroupManager) { + + GetInstanceGroupManagerHttpRequest request = + GetInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return getInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager response = instanceGroupManagerClient.getInstanceGroupManager(instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManager getInstanceGroupManager(String instanceGroupManager) { + + GetInstanceGroupManagerHttpRequest request = + GetInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .build(); + return getInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   GetInstanceGroupManagerHttpRequest request = GetInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   InstanceGroupManager response = instanceGroupManagerClient.getInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManagerHttpRequest request) { + return getInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   GetInstanceGroupManagerHttpRequest request = GetInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<InstanceGroupManager> future = instanceGroupManagerClient.getInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   InstanceGroupManager response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInstanceGroupManagerCallable() { + return stub.getInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone, instanceGroupManagerResource);
+   * }
+   * 
+ * + * @param zone The name of the zone where you want to create the managed instance group. + * @param instanceGroupManagerResource An Instance Group Manager resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceGroupManager(ZoneName zone, InstanceGroupManager instanceGroupManagerResource) { + + InsertInstanceGroupManagerHttpRequest request = + InsertInstanceGroupManagerHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); + return insertInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone.toString(), instanceGroupManagerResource);
+   * }
+   * 
+ * + * @param zone The name of the zone where you want to create the managed instance group. + * @param instanceGroupManagerResource An Instance Group Manager resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceGroupManager(String zone, InstanceGroupManager instanceGroupManagerResource) { + + InsertInstanceGroupManagerHttpRequest request = + InsertInstanceGroupManagerHttpRequest.newBuilder() + .setZone(zone) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); + return insertInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttpRequest request) { + return insertInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.insertInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertInstanceGroupManagerCallable() { + return stub.insertInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (InstanceGroupManager element : instanceGroupManagerClient.listInstanceGroupManagers(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone where the managed instance group is located. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ZoneName zone) { + ListInstanceGroupManagersHttpRequest request = + ListInstanceGroupManagersHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (InstanceGroupManager element : instanceGroupManagerClient.listInstanceGroupManagers(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone where the managed instance group is located. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(String zone) { + ListInstanceGroupManagersHttpRequest request = + ListInstanceGroupManagersHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstanceGroupManagersHttpRequest request = ListInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (InstanceGroupManager element : instanceGroupManagerClient.listInstanceGroupManagers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ListInstanceGroupManagersHttpRequest request) { + return listInstanceGroupManagersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstanceGroupManagersHttpRequest request = ListInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListInstanceGroupManagersPagedResponse> future = instanceGroupManagerClient.listInstanceGroupManagersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceGroupManager element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstanceGroupManagersPagedCallable() { + return stub.listInstanceGroupManagersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListInstanceGroupManagersHttpRequest request = ListInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceGroupManagerList response = instanceGroupManagerClient.listInstanceGroupManagersCallable().call(request);
+   *     for (InstanceGroupManager element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstanceGroupManagersCallable() { + return stub.listInstanceGroupManagersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersListManagedInstancesResponse response = instanceGroupManagerClient.listManagedInstancesInstanceGroupManagers(instanceGroupManager);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(InstanceGroupManagerName instanceGroupManager) { + + ListManagedInstancesInstanceGroupManagersHttpRequest request = + ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return listManagedInstancesInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersListManagedInstancesResponse response = instanceGroupManagerClient.listManagedInstancesInstanceGroupManagers(instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(String instanceGroupManager) { + + ListManagedInstancesInstanceGroupManagersHttpRequest request = + ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .build(); + return listManagedInstancesInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ListManagedInstancesInstanceGroupManagersHttpRequest request = ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   InstanceGroupManagersListManagedInstancesResponse response = instanceGroupManagerClient.listManagedInstancesInstanceGroupManagers(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(ListManagedInstancesInstanceGroupManagersHttpRequest request) { + return listManagedInstancesInstanceGroupManagersCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ListManagedInstancesInstanceGroupManagersHttpRequest request = ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<InstanceGroupManagersListManagedInstancesResponse> future = instanceGroupManagerClient.listManagedInstancesInstanceGroupManagersCallable().futureCall(request);
+   *   // Do something
+   *   InstanceGroupManagersListManagedInstancesResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { + return stub.listManagedInstancesInstanceGroupManagersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersRecreateInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation recreateInstancesInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { + + RecreateInstancesInstanceGroupManagerHttpRequest request = + RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource) + .build(); + return recreateInstancesInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersRecreateInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersRecreateInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation recreateInstancesInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { + + RecreateInstancesInstanceGroupManagerHttpRequest request = + RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource) + .build(); + return recreateInstancesInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
+   *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesInstanceGroupManagerHttpRequest request) { + return recreateInstancesInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
+   *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.recreateInstancesInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable recreateInstancesInstanceGroupManagerCallable() { + return stub.recreateInstancesInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, instanceGroupManager);
+   * }
+   * 
+ * + * @param 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 instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeInstanceGroupManager(Integer size, InstanceGroupManagerName instanceGroupManager) { + + ResizeInstanceGroupManagerHttpRequest request = + ResizeInstanceGroupManagerHttpRequest.newBuilder() + .setSize(size) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return resizeInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param 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 instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) { + + ResizeInstanceGroupManagerHttpRequest request = + ResizeInstanceGroupManagerHttpRequest.newBuilder() + .setSize(size) + .setInstanceGroupManager(instanceGroupManager) + .build(); + return resizeInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setSize(size)
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttpRequest request) { + return resizeInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setSize(size)
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.resizeInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable resizeInstanceGroupManagerCallable() { + return stub.resizeInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 recreate them. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersSetInstanceTemplateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setInstanceTemplateInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { + + SetInstanceTemplateInstanceGroupManagerHttpRequest request = + SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource) + .build(); + return setInstanceTemplateInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 recreate them. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersSetInstanceTemplateRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersSetInstanceTemplateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setInstanceTemplateInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { + + SetInstanceTemplateInstanceGroupManagerHttpRequest request = + SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource) + .build(); + return setInstanceTemplateInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 recreate them. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
+   *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTemplateInstanceGroupManagerHttpRequest request) { + return setInstanceTemplateInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 recreate them. + * + * Sample code: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
+   *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { + return stub.setInstanceTemplateInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersSetTargetPoolsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetPoolsInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { + + SetTargetPoolsInstanceGroupManagerHttpRequest request = + SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource) + .build(); + return setTargetPoolsInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersSetTargetPoolsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param instanceGroupManagersSetTargetPoolsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetPoolsInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { + + SetTargetPoolsInstanceGroupManagerHttpRequest request = + SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource) + .build(); + return setTargetPoolsInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstanceGroupManagerHttpRequest request) { + return setTargetPoolsInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.setTargetPoolsInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { + return stub.setTargetPoolsInstanceGroupManagerCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListInstanceGroupManagersPagedResponse apply(AggregatedListInstanceGroupManagersPage input) { + return new AggregatedListInstanceGroupManagersPagedResponse(input); + } + }); + } + + private AggregatedListInstanceGroupManagersPagedResponse(AggregatedListInstanceGroupManagersPage page) { + super(page, AggregatedListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListInstanceGroupManagersPage extends AbstractPage< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage> { + + private AggregatedListInstanceGroupManagersPage( + PageContext context, + InstanceGroupManagerAggregatedList response) { + super(context, response); + } + + private static AggregatedListInstanceGroupManagersPage createEmptyPage() { + return new AggregatedListInstanceGroupManagersPage(null, null); + } + + @Override + protected AggregatedListInstanceGroupManagersPage createPage( + PageContext context, + InstanceGroupManagerAggregatedList response) { + return new AggregatedListInstanceGroupManagersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { + + private AggregatedListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListInstanceGroupManagersFixedSizeCollection createEmptyCollection() { + return new AggregatedListInstanceGroupManagersFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListInstanceGroupManagersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage, + ListInstanceGroupManagersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstanceGroupManagersPagedResponse apply(ListInstanceGroupManagersPage input) { + return new ListInstanceGroupManagersPagedResponse(input); + } + }); + } + + private ListInstanceGroupManagersPagedResponse(ListInstanceGroupManagersPage page) { + super(page, ListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInstanceGroupManagersPage extends AbstractPage< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage> { + + private ListInstanceGroupManagersPage( + PageContext context, + InstanceGroupManagerList response) { + super(context, response); + } + + private static ListInstanceGroupManagersPage createEmptyPage() { + return new ListInstanceGroupManagersPage(null, null); + } + + @Override + protected ListInstanceGroupManagersPage createPage( + PageContext context, + InstanceGroupManagerList response) { + return new ListInstanceGroupManagersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage, + ListInstanceGroupManagersFixedSizeCollection> { + + private ListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstanceGroupManagersFixedSizeCollection createEmptyCollection() { + return new ListInstanceGroupManagersFixedSizeCollection(null, 0); + } + + @Override + protected ListInstanceGroupManagersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java new file mode 100644 index 000000000000..0d0aabf5656f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceGroupManagerList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceGroupManagerList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroupManager item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagerList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagerList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagerList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagerList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagerList other) { + if (other == InstanceGroupManagerList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceGroupManagerList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceGroupManager items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceGroupManagerList build() { + + + + + return new InstanceGroupManagerList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagerList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerList) { + InstanceGroupManagerList that = (InstanceGroupManagerList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java new file mode 100644 index 000000000000..f04b44de351c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerName implements ResourceName { + private final String instanceGroupManager; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InstanceGroupManagerName(Builder builder) { + instanceGroupManager = Preconditions.checkNotNull(builder.getInstanceGroupManager()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static InstanceGroupManagerName of( + String instanceGroupManager, + String project, + String zone + ) { + return newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String instanceGroupManager, + String project, + String zone + ) { + return of( + instanceGroupManager, + project, + zone + ) + .toString(); + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("instanceGroupManager", instanceGroupManager); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InstanceGroupManagerName parse(String formattedString) {return InstanceGroupManagerName.parse(formattedString);} + }; + } + + public static InstanceGroupManagerName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InstanceGroupManagerName.parse: formattedString not in valid format"); + return of( + matchMap.get("instanceGroupManager"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String instanceGroupManager; + private String project; + private String zone; + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (InstanceGroupManagerName instanceGroupManagerName) { + instanceGroupManager = instanceGroupManagerName.instanceGroupManager; + project = instanceGroupManagerName.project; + zone = instanceGroupManagerName.zone; + } + + public InstanceGroupManagerName build() { + return new InstanceGroupManagerName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "instanceGroupManager", instanceGroupManager, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerName) { + InstanceGroupManagerName that = (InstanceGroupManagerName) o; + return + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceGroupManager, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java new file mode 100644 index 000000000000..02e782687226 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java @@ -0,0 +1,381 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceGroupManagerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of abandonInstancesInstanceGroupManager to 30 seconds: + * + *

+ * 
+ * InstanceGroupManagerSettings.Builder instanceGroupManagerSettingsBuilder =
+ *     InstanceGroupManagerSettings.newBuilder();
+ * instanceGroupManagerSettingsBuilder.abandonInstancesInstanceGroupManagerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceGroupManagerSettings instanceGroupManagerSettings = instanceGroupManagerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceGroupManagerSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to abandonInstancesInstanceGroupManager. + */ + public UnaryCallSettings abandonInstancesInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).abandonInstancesInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to aggregatedListInstanceGroupManagers. + */ + public PagedCallSettings aggregatedListInstanceGroupManagersSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).aggregatedListInstanceGroupManagersSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteInstanceGroupManager. + */ + public UnaryCallSettings deleteInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).deleteInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteInstancesInstanceGroupManager. + */ + public UnaryCallSettings deleteInstancesInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).deleteInstancesInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to getInstanceGroupManager. + */ + public UnaryCallSettings getInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).getInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to insertInstanceGroupManager. + */ + public UnaryCallSettings insertInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).insertInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to listInstanceGroupManagers. + */ + public PagedCallSettings listInstanceGroupManagersSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).listInstanceGroupManagersSettings(); + } + + /** + * Returns the object with the settings used for calls to listManagedInstancesInstanceGroupManagers. + */ + public UnaryCallSettings listManagedInstancesInstanceGroupManagersSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).listManagedInstancesInstanceGroupManagersSettings(); + } + + /** + * Returns the object with the settings used for calls to recreateInstancesInstanceGroupManager. + */ + public UnaryCallSettings recreateInstancesInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).recreateInstancesInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to resizeInstanceGroupManager. + */ + public UnaryCallSettings resizeInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).resizeInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to setInstanceTemplateInstanceGroupManager. + */ + public UnaryCallSettings setInstanceTemplateInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).setInstanceTemplateInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to setTargetPoolsInstanceGroupManager. + */ + public UnaryCallSettings setTargetPoolsInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()).setTargetPoolsInstanceGroupManagerSettings(); + } + + + public static final InstanceGroupManagerSettings create(InstanceGroupManagerStubSettings stub) throws IOException { + return new InstanceGroupManagerSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstanceGroupManagerStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InstanceGroupManagerStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InstanceGroupManagerStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InstanceGroupManagerStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InstanceGroupManagerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstanceGroupManagerStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InstanceGroupManagerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InstanceGroupManagerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceGroupManagerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InstanceGroupManagerSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InstanceGroupManagerStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InstanceGroupManagerStubSettings.newBuilder()); + } + + protected Builder(InstanceGroupManagerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InstanceGroupManagerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InstanceGroupManagerStubSettings.Builder getStubSettingsBuilder() { + return ((InstanceGroupManagerStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to abandonInstancesInstanceGroupManager. + */ + public UnaryCallSettings.Builder abandonInstancesInstanceGroupManagerSettings() { + return getStubSettingsBuilder().abandonInstancesInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInstanceGroupManagers. + */ + public PagedCallSettings.Builder aggregatedListInstanceGroupManagersSettings() { + return getStubSettingsBuilder().aggregatedListInstanceGroupManagersSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteInstanceGroupManagerSettings() { + return getStubSettingsBuilder().deleteInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteInstancesInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteInstancesInstanceGroupManagerSettings() { + return getStubSettingsBuilder().deleteInstancesInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to getInstanceGroupManager. + */ + public UnaryCallSettings.Builder getInstanceGroupManagerSettings() { + return getStubSettingsBuilder().getInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertInstanceGroupManager. + */ + public UnaryCallSettings.Builder insertInstanceGroupManagerSettings() { + return getStubSettingsBuilder().insertInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInstanceGroupManagers. + */ + public PagedCallSettings.Builder listInstanceGroupManagersSettings() { + return getStubSettingsBuilder().listInstanceGroupManagersSettings(); + } + + /** + * Returns the builder for the settings used for calls to listManagedInstancesInstanceGroupManagers. + */ + public UnaryCallSettings.Builder listManagedInstancesInstanceGroupManagersSettings() { + return getStubSettingsBuilder().listManagedInstancesInstanceGroupManagersSettings(); + } + + /** + * Returns the builder for the settings used for calls to recreateInstancesInstanceGroupManager. + */ + public UnaryCallSettings.Builder recreateInstancesInstanceGroupManagerSettings() { + return getStubSettingsBuilder().recreateInstancesInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to resizeInstanceGroupManager. + */ + public UnaryCallSettings.Builder resizeInstanceGroupManagerSettings() { + return getStubSettingsBuilder().resizeInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to setInstanceTemplateInstanceGroupManager. + */ + public UnaryCallSettings.Builder setInstanceTemplateInstanceGroupManagerSettings() { + return getStubSettingsBuilder().setInstanceTemplateInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to setTargetPoolsInstanceGroupManager. + */ + public UnaryCallSettings.Builder setTargetPoolsInstanceGroupManagerSettings() { + return getStubSettingsBuilder().setTargetPoolsInstanceGroupManagerSettings(); + } + + @Override + public InstanceGroupManagerSettings build() throws IOException { + return new InstanceGroupManagerSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java new file mode 100644 index 000000000000..6e1647c5d5f5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersAbandonInstancesRequest implements ApiMessage { + private final List instances; + + private InstanceGroupManagersAbandonInstancesRequest() { + this.instances = null; + } + + + private InstanceGroupManagersAbandonInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersAbandonInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersAbandonInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersAbandonInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersAbandonInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersAbandonInstancesRequest other) { + if (other == InstanceGroupManagersAbandonInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(InstanceGroupManagersAbandonInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + + public InstanceGroupManagersAbandonInstancesRequest build() { + return new InstanceGroupManagersAbandonInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersAbandonInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersAbandonInstancesRequest) { + InstanceGroupManagersAbandonInstancesRequest that = (InstanceGroupManagersAbandonInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java new file mode 100644 index 000000000000..51f49fc42fb2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersDeleteInstancesRequest implements ApiMessage { + private final List instances; + + private InstanceGroupManagersDeleteInstancesRequest() { + this.instances = null; + } + + + private InstanceGroupManagersDeleteInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersDeleteInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersDeleteInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersDeleteInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersDeleteInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersDeleteInstancesRequest other) { + if (other == InstanceGroupManagersDeleteInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(InstanceGroupManagersDeleteInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + + public InstanceGroupManagersDeleteInstancesRequest build() { + return new InstanceGroupManagersDeleteInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersDeleteInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersDeleteInstancesRequest) { + InstanceGroupManagersDeleteInstancesRequest that = (InstanceGroupManagersDeleteInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java new file mode 100644 index 000000000000..0a493ca6bede --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersListManagedInstancesResponse implements ApiMessage { + private final List managedInstances; + + private InstanceGroupManagersListManagedInstancesResponse() { + this.managedInstances = null; + } + + + private InstanceGroupManagersListManagedInstancesResponse( + List managedInstances + ) { + this.managedInstances = managedInstances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("managedInstances") && managedInstances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ManagedInstance item : managedInstances) { + stringList.add(item.toString()); + } + fieldMap.put("managedInstances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("managedInstances")) { + return String.valueOf(managedInstances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getManagedInstancesList() { + return managedInstances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersListManagedInstancesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersListManagedInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersListManagedInstancesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersListManagedInstancesResponse(); + } + + public static class Builder { + private List managedInstances; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersListManagedInstancesResponse other) { + if (other == InstanceGroupManagersListManagedInstancesResponse.getDefaultInstance()) return this; + if (other.getManagedInstancesList() != null) { + this.managedInstances = other.managedInstances; + } + return this; + } + + Builder(InstanceGroupManagersListManagedInstancesResponse source) { + this.managedInstances = source.managedInstances; + } + + public List getManagedInstancesList() { + return managedInstances; + } + + public Builder addAllManagedInstances(List managedInstances) { + if (this.managedInstances == null) { + this.managedInstances = new ArrayList<>(managedInstances.size()); + } + this.managedInstances.addAll(managedInstances); + return this; + } + + public Builder addManagedInstances(ManagedInstance managedInstances) { + this.managedInstances.add(managedInstances); + return this; + } + + + public InstanceGroupManagersListManagedInstancesResponse build() { + return new InstanceGroupManagersListManagedInstancesResponse( + managedInstances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllManagedInstances(this.managedInstances); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersListManagedInstancesResponse{" + + "managedInstances=" + managedInstances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersListManagedInstancesResponse) { + InstanceGroupManagersListManagedInstancesResponse that = (InstanceGroupManagersListManagedInstancesResponse) o; + return + Objects.equals(this.managedInstances, that.getManagedInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + managedInstances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java new file mode 100644 index 000000000000..06f585bde163 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersRecreateInstancesRequest implements ApiMessage { + private final List instances; + + private InstanceGroupManagersRecreateInstancesRequest() { + this.instances = null; + } + + + private InstanceGroupManagersRecreateInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersRecreateInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersRecreateInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersRecreateInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersRecreateInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersRecreateInstancesRequest other) { + if (other == InstanceGroupManagersRecreateInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(InstanceGroupManagersRecreateInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + + public InstanceGroupManagersRecreateInstancesRequest build() { + return new InstanceGroupManagersRecreateInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersRecreateInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersRecreateInstancesRequest) { + InstanceGroupManagersRecreateInstancesRequest that = (InstanceGroupManagersRecreateInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java new file mode 100644 index 000000000000..011fbf0724d9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersScopedList implements ApiMessage { + private final List instanceGroupManagers; + private final Warning warning; + + private InstanceGroupManagersScopedList() { + this.instanceGroupManagers = null; + this.warning = null; + } + + + private InstanceGroupManagersScopedList( + List instanceGroupManagers, + Warning warning + ) { + this.instanceGroupManagers = instanceGroupManagers; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceGroupManagers") && instanceGroupManagers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroupManager item : instanceGroupManagers) { + stringList.add(item.toString()); + } + fieldMap.put("instanceGroupManagers", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceGroupManagers")) { + return String.valueOf(instanceGroupManagers); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstanceGroupManagersList() { + return instanceGroupManagers; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersScopedList(); + } + + public static class Builder { + private List instanceGroupManagers; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersScopedList other) { + if (other == InstanceGroupManagersScopedList.getDefaultInstance()) return this; + if (other.getInstanceGroupManagersList() != null) { + this.instanceGroupManagers = other.instanceGroupManagers; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InstanceGroupManagersScopedList source) { + this.instanceGroupManagers = source.instanceGroupManagers; + this.warning = source.warning; + } + + public List getInstanceGroupManagersList() { + return instanceGroupManagers; + } + + public Builder addAllInstanceGroupManagers(List instanceGroupManagers) { + if (this.instanceGroupManagers == null) { + this.instanceGroupManagers = new ArrayList<>(instanceGroupManagers.size()); + } + this.instanceGroupManagers.addAll(instanceGroupManagers); + return this; + } + + public Builder addInstanceGroupManagers(InstanceGroupManager instanceGroupManagers) { + this.instanceGroupManagers.add(instanceGroupManagers); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InstanceGroupManagersScopedList build() { + + return new InstanceGroupManagersScopedList( + instanceGroupManagers, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstanceGroupManagers(this.instanceGroupManagers); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersScopedList{" + + "instanceGroupManagers=" + instanceGroupManagers + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersScopedList) { + InstanceGroupManagersScopedList that = (InstanceGroupManagersScopedList) o; + return + Objects.equals(this.instanceGroupManagers, that.getInstanceGroupManagersList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceGroupManagers, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java new file mode 100644 index 000000000000..43396f32f2f3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersSetInstanceTemplateRequest implements ApiMessage { + private final String instanceTemplate; + + private InstanceGroupManagersSetInstanceTemplateRequest() { + this.instanceTemplate = null; + } + + + private InstanceGroupManagersSetInstanceTemplateRequest( + String instanceTemplate + ) { + this.instanceTemplate = instanceTemplate; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersSetInstanceTemplateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersSetInstanceTemplateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersSetInstanceTemplateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersSetInstanceTemplateRequest(); + } + + public static class Builder { + private String instanceTemplate; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersSetInstanceTemplateRequest other) { + if (other == InstanceGroupManagersSetInstanceTemplateRequest.getDefaultInstance()) return this; + if (other.getInstanceTemplate() != null) { + this.instanceTemplate = other.instanceTemplate; + } + return this; + } + + Builder(InstanceGroupManagersSetInstanceTemplateRequest source) { + this.instanceTemplate = source.instanceTemplate; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + + + public InstanceGroupManagersSetInstanceTemplateRequest build() { + return new InstanceGroupManagersSetInstanceTemplateRequest( + instanceTemplate + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstanceTemplate(this.instanceTemplate); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersSetInstanceTemplateRequest{" + + "instanceTemplate=" + instanceTemplate + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersSetInstanceTemplateRequest) { + InstanceGroupManagersSetInstanceTemplateRequest that = (InstanceGroupManagersSetInstanceTemplateRequest) o; + return + Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceTemplate + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java new file mode 100644 index 000000000000..02d00154a3a1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagersSetTargetPoolsRequest implements ApiMessage { + private final String fingerprint; + private final List targetPools; + + private InstanceGroupManagersSetTargetPoolsRequest() { + this.fingerprint = null; + this.targetPools = null; + } + + + private InstanceGroupManagersSetTargetPoolsRequest( + String fingerprint, + List targetPools + ) { + this.fingerprint = fingerprint; + this.targetPools = targetPools; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getTargetPoolsList() { + return targetPools; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupManagersSetTargetPoolsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagersSetTargetPoolsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupManagersSetTargetPoolsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupManagersSetTargetPoolsRequest(); + } + + public static class Builder { + private String fingerprint; + private List targetPools; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagersSetTargetPoolsRequest other) { + if (other == InstanceGroupManagersSetTargetPoolsRequest.getDefaultInstance()) return this; + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getTargetPoolsList() != null) { + this.targetPools = other.targetPools; + } + return this; + } + + Builder(InstanceGroupManagersSetTargetPoolsRequest source) { + this.fingerprint = source.fingerprint; + this.targetPools = source.targetPools; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getTargetPoolsList() { + return targetPools; + } + + public Builder addAllTargetPools(List targetPools) { + if (this.targetPools == null) { + this.targetPools = new ArrayList<>(targetPools.size()); + } + this.targetPools.addAll(targetPools); + return this; + } + + public Builder addTargetPools(String targetPools) { + this.targetPools.add(targetPools); + return this; + } + + + public InstanceGroupManagersSetTargetPoolsRequest build() { + + return new InstanceGroupManagersSetTargetPoolsRequest( + fingerprint, + targetPools + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllTargetPools(this.targetPools); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagersSetTargetPoolsRequest{" + + "fingerprint=" + fingerprint + ", " + + "targetPools=" + targetPools + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagersSetTargetPoolsRequest) { + InstanceGroupManagersSetTargetPoolsRequest that = (InstanceGroupManagersSetTargetPoolsRequest) o; + return + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.targetPools, that.getTargetPoolsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + fingerprint, + targetPools + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java new file mode 100644 index 000000000000..fc1c10813ebd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupName implements ResourceName { + private final String instanceGroup; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InstanceGroupName(Builder builder) { + instanceGroup = Preconditions.checkNotNull(builder.getInstanceGroup()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static InstanceGroupName of( + String instanceGroup, + String project, + String zone + ) { + return newBuilder() + .setInstanceGroup(instanceGroup) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String instanceGroup, + String project, + String zone + ) { + return of( + instanceGroup, + project, + zone + ) + .toString(); + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("instanceGroup", instanceGroup); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InstanceGroupName parse(String formattedString) {return InstanceGroupName.parse(formattedString);} + }; + } + + public static InstanceGroupName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InstanceGroupName.parse: formattedString not in valid format"); + return of( + matchMap.get("instanceGroup"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String instanceGroup; + private String project; + private String zone; + + public String getInstanceGroup() { + return instanceGroup; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (InstanceGroupName instanceGroupName) { + instanceGroup = instanceGroupName.instanceGroup; + project = instanceGroupName.project; + zone = instanceGroupName.zone; + } + + public InstanceGroupName build() { + return new InstanceGroupName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "instanceGroup", instanceGroup, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupName) { + InstanceGroupName that = (InstanceGroupName) o; + return + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceGroup, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java new file mode 100644 index 000000000000..2a2788e688f9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java @@ -0,0 +1,340 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceGroupClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: + * + *

+ * 
+ * InstanceGroupSettings.Builder instanceGroupSettingsBuilder =
+ *     InstanceGroupSettings.newBuilder();
+ * instanceGroupSettingsBuilder.addInstancesInstanceGroupSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceGroupSettings instanceGroupSettings = instanceGroupSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceGroupSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to addInstancesInstanceGroup. + */ + public UnaryCallSettings addInstancesInstanceGroupSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).addInstancesInstanceGroupSettings(); + } + + /** + * Returns the object with the settings used for calls to aggregatedListInstanceGroups. + */ + public PagedCallSettings aggregatedListInstanceGroupsSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).aggregatedListInstanceGroupsSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteInstanceGroup. + */ + public UnaryCallSettings deleteInstanceGroupSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).deleteInstanceGroupSettings(); + } + + /** + * Returns the object with the settings used for calls to getInstanceGroup. + */ + public UnaryCallSettings getInstanceGroupSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).getInstanceGroupSettings(); + } + + /** + * Returns the object with the settings used for calls to insertInstanceGroup. + */ + public UnaryCallSettings insertInstanceGroupSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).insertInstanceGroupSettings(); + } + + /** + * Returns the object with the settings used for calls to listInstanceGroups. + */ + public PagedCallSettings listInstanceGroupsSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).listInstanceGroupsSettings(); + } + + /** + * Returns the object with the settings used for calls to listInstancesInstanceGroups. + */ + public PagedCallSettings listInstancesInstanceGroupsSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).listInstancesInstanceGroupsSettings(); + } + + /** + * Returns the object with the settings used for calls to removeInstancesInstanceGroup. + */ + public UnaryCallSettings removeInstancesInstanceGroupSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).removeInstancesInstanceGroupSettings(); + } + + /** + * Returns the object with the settings used for calls to setNamedPortsInstanceGroup. + */ + public UnaryCallSettings setNamedPortsInstanceGroupSettings() { + return ((InstanceGroupStubSettings) getStubSettings()).setNamedPortsInstanceGroupSettings(); + } + + + public static final InstanceGroupSettings create(InstanceGroupStubSettings stub) throws IOException { + return new InstanceGroupSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstanceGroupStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InstanceGroupStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InstanceGroupStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InstanceGroupStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InstanceGroupStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstanceGroupStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InstanceGroupStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InstanceGroupStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceGroupSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InstanceGroupSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InstanceGroupStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InstanceGroupStubSettings.newBuilder()); + } + + protected Builder(InstanceGroupSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InstanceGroupStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InstanceGroupStubSettings.Builder getStubSettingsBuilder() { + return ((InstanceGroupStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to addInstancesInstanceGroup. + */ + public UnaryCallSettings.Builder addInstancesInstanceGroupSettings() { + return getStubSettingsBuilder().addInstancesInstanceGroupSettings(); + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInstanceGroups. + */ + public PagedCallSettings.Builder aggregatedListInstanceGroupsSettings() { + return getStubSettingsBuilder().aggregatedListInstanceGroupsSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteInstanceGroup. + */ + public UnaryCallSettings.Builder deleteInstanceGroupSettings() { + return getStubSettingsBuilder().deleteInstanceGroupSettings(); + } + + /** + * Returns the builder for the settings used for calls to getInstanceGroup. + */ + public UnaryCallSettings.Builder getInstanceGroupSettings() { + return getStubSettingsBuilder().getInstanceGroupSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertInstanceGroup. + */ + public UnaryCallSettings.Builder insertInstanceGroupSettings() { + return getStubSettingsBuilder().insertInstanceGroupSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInstanceGroups. + */ + public PagedCallSettings.Builder listInstanceGroupsSettings() { + return getStubSettingsBuilder().listInstanceGroupsSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInstancesInstanceGroups. + */ + public PagedCallSettings.Builder listInstancesInstanceGroupsSettings() { + return getStubSettingsBuilder().listInstancesInstanceGroupsSettings(); + } + + /** + * Returns the builder for the settings used for calls to removeInstancesInstanceGroup. + */ + public UnaryCallSettings.Builder removeInstancesInstanceGroupSettings() { + return getStubSettingsBuilder().removeInstancesInstanceGroupSettings(); + } + + /** + * Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. + */ + public UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings() { + return getStubSettingsBuilder().setNamedPortsInstanceGroupSettings(); + } + + @Override + public InstanceGroupSettings build() throws IOException { + return new InstanceGroupSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java new file mode 100644 index 000000000000..e888ad71d02f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupsAddInstancesRequest implements ApiMessage { + private final List instances; + + private InstanceGroupsAddInstancesRequest() { + this.instances = null; + } + + + private InstanceGroupsAddInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupsAddInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupsAddInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupsAddInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupsAddInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(InstanceGroupsAddInstancesRequest other) { + if (other == InstanceGroupsAddInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(InstanceGroupsAddInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(InstanceReference instances) { + this.instances.add(instances); + return this; + } + + + public InstanceGroupsAddInstancesRequest build() { + return new InstanceGroupsAddInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupsAddInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupsAddInstancesRequest) { + InstanceGroupsAddInstancesRequest that = (InstanceGroupsAddInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java new file mode 100644 index 000000000000..52068beed867 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupsListInstances implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceGroupsListInstances() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceGroupsListInstances( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceWithNamedPorts item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupsListInstances prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupsListInstances getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupsListInstances DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupsListInstances(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceGroupsListInstances other) { + if (other == InstanceGroupsListInstances.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceGroupsListInstances source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceWithNamedPorts items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceGroupsListInstances build() { + + + + + return new InstanceGroupsListInstances( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupsListInstances{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupsListInstances) { + InstanceGroupsListInstances that = (InstanceGroupsListInstances) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java new file mode 100644 index 000000000000..1d63da0f01ab --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupsListInstancesRequest implements ApiMessage { + private final String instanceState; + + private InstanceGroupsListInstancesRequest() { + this.instanceState = null; + } + + + private InstanceGroupsListInstancesRequest( + String instanceState + ) { + this.instanceState = instanceState; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceState") && instanceState != null) { + fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceState")) { + return String.valueOf(instanceState); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getInstanceState() { + return instanceState; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupsListInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupsListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupsListInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupsListInstancesRequest(); + } + + public static class Builder { + private String instanceState; + + Builder() {} + + public Builder mergeFrom(InstanceGroupsListInstancesRequest other) { + if (other == InstanceGroupsListInstancesRequest.getDefaultInstance()) return this; + if (other.getInstanceState() != null) { + this.instanceState = other.instanceState; + } + return this; + } + + Builder(InstanceGroupsListInstancesRequest source) { + this.instanceState = source.instanceState; + } + + public String getInstanceState() { + return instanceState; + } + + public Builder setInstanceState(String instanceState) { + this.instanceState = instanceState; + return this; + } + + + public InstanceGroupsListInstancesRequest build() { + return new InstanceGroupsListInstancesRequest( + instanceState + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstanceState(this.instanceState); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupsListInstancesRequest{" + + "instanceState=" + instanceState + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupsListInstancesRequest) { + InstanceGroupsListInstancesRequest that = (InstanceGroupsListInstancesRequest) o; + return + Objects.equals(this.instanceState, that.getInstanceState()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceState + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java new file mode 100644 index 000000000000..88869b5cd248 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupsRemoveInstancesRequest implements ApiMessage { + private final List instances; + + private InstanceGroupsRemoveInstancesRequest() { + this.instances = null; + } + + + private InstanceGroupsRemoveInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupsRemoveInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupsRemoveInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupsRemoveInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupsRemoveInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(InstanceGroupsRemoveInstancesRequest other) { + if (other == InstanceGroupsRemoveInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(InstanceGroupsRemoveInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(InstanceReference instances) { + this.instances.add(instances); + return this; + } + + + public InstanceGroupsRemoveInstancesRequest build() { + return new InstanceGroupsRemoveInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupsRemoveInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupsRemoveInstancesRequest) { + InstanceGroupsRemoveInstancesRequest that = (InstanceGroupsRemoveInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java new file mode 100644 index 000000000000..7060edf0b460 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupsScopedList implements ApiMessage { + private final List instanceGroups; + private final Warning warning; + + private InstanceGroupsScopedList() { + this.instanceGroups = null; + this.warning = null; + } + + + private InstanceGroupsScopedList( + List instanceGroups, + Warning warning + ) { + this.instanceGroups = instanceGroups; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceGroups") && instanceGroups != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroup item : instanceGroups) { + stringList.add(item.toString()); + } + fieldMap.put("instanceGroups", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceGroups")) { + return String.valueOf(instanceGroups); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstanceGroupsList() { + return instanceGroups; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupsScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupsScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupsScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupsScopedList(); + } + + public static class Builder { + private List instanceGroups; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InstanceGroupsScopedList other) { + if (other == InstanceGroupsScopedList.getDefaultInstance()) return this; + if (other.getInstanceGroupsList() != null) { + this.instanceGroups = other.instanceGroups; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InstanceGroupsScopedList source) { + this.instanceGroups = source.instanceGroups; + this.warning = source.warning; + } + + public List getInstanceGroupsList() { + return instanceGroups; + } + + public Builder addAllInstanceGroups(List instanceGroups) { + if (this.instanceGroups == null) { + this.instanceGroups = new ArrayList<>(instanceGroups.size()); + } + this.instanceGroups.addAll(instanceGroups); + return this; + } + + public Builder addInstanceGroups(InstanceGroup instanceGroups) { + this.instanceGroups.add(instanceGroups); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InstanceGroupsScopedList build() { + + return new InstanceGroupsScopedList( + instanceGroups, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstanceGroups(this.instanceGroups); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupsScopedList{" + + "instanceGroups=" + instanceGroups + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupsScopedList) { + InstanceGroupsScopedList that = (InstanceGroupsScopedList) o; + return + Objects.equals(this.instanceGroups, that.getInstanceGroupsList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceGroups, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java new file mode 100644 index 000000000000..d1b0265e3407 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupsSetNamedPortsRequest implements ApiMessage { + private final String fingerprint; + private final List namedPorts; + + private InstanceGroupsSetNamedPortsRequest() { + this.fingerprint = null; + this.namedPorts = null; + } + + + private InstanceGroupsSetNamedPortsRequest( + String fingerprint, + List namedPorts + ) { + this.fingerprint = fingerprint; + this.namedPorts = namedPorts; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getNamedPortsList() { + return namedPorts; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceGroupsSetNamedPortsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupsSetNamedPortsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceGroupsSetNamedPortsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceGroupsSetNamedPortsRequest(); + } + + public static class Builder { + private String fingerprint; + private List namedPorts; + + Builder() {} + + public Builder mergeFrom(InstanceGroupsSetNamedPortsRequest other) { + if (other == InstanceGroupsSetNamedPortsRequest.getDefaultInstance()) return this; + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getNamedPortsList() != null) { + this.namedPorts = other.namedPorts; + } + return this; + } + + Builder(InstanceGroupsSetNamedPortsRequest source) { + this.fingerprint = source.fingerprint; + this.namedPorts = source.namedPorts; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public Builder addAllNamedPorts(List namedPorts) { + if (this.namedPorts == null) { + this.namedPorts = new ArrayList<>(namedPorts.size()); + } + this.namedPorts.addAll(namedPorts); + return this; + } + + public Builder addNamedPorts(NamedPort namedPorts) { + this.namedPorts.add(namedPorts); + return this; + } + + + public InstanceGroupsSetNamedPortsRequest build() { + + return new InstanceGroupsSetNamedPortsRequest( + fingerprint, + namedPorts + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllNamedPorts(this.namedPorts); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupsSetNamedPortsRequest{" + + "fingerprint=" + fingerprint + ", " + + "namedPorts=" + namedPorts + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupsSetNamedPortsRequest) { + InstanceGroupsSetNamedPortsRequest that = (InstanceGroupsSetNamedPortsRequest) o; + return + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.namedPorts, that.getNamedPortsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + fingerprint, + namedPorts + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java new file mode 100644 index 000000000000..ccc3838cf334 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Instance item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceList other) { + if (other == InstanceList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Instance items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceList build() { + + + + + return new InstanceList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceList) { + InstanceList that = (InstanceList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java new file mode 100644 index 000000000000..4fd1cfc5474d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceMoveRequest implements ApiMessage { + private final String destinationZone; + private final String targetInstance; + + private InstanceMoveRequest() { + this.destinationZone = null; + this.targetInstance = null; + } + + + private InstanceMoveRequest( + String destinationZone, + String targetInstance + ) { + this.destinationZone = destinationZone; + this.targetInstance = targetInstance; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("destinationZone") && destinationZone != null) { + fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone))); + } + if (fieldNames.contains("targetInstance") && targetInstance != null) { + fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("destinationZone")) { + return String.valueOf(destinationZone); + } + if (fieldName.equals("targetInstance")) { + return String.valueOf(targetInstance); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDestinationZone() { + return destinationZone; + } + + public String getTargetInstance() { + return targetInstance; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceMoveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceMoveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceMoveRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceMoveRequest(); + } + + public static class Builder { + private String destinationZone; + private String targetInstance; + + Builder() {} + + public Builder mergeFrom(InstanceMoveRequest other) { + if (other == InstanceMoveRequest.getDefaultInstance()) return this; + if (other.getDestinationZone() != null) { + this.destinationZone = other.destinationZone; + } + if (other.getTargetInstance() != null) { + this.targetInstance = other.targetInstance; + } + return this; + } + + Builder(InstanceMoveRequest source) { + this.destinationZone = source.destinationZone; + this.targetInstance = source.targetInstance; + } + + public String getDestinationZone() { + return destinationZone; + } + + public Builder setDestinationZone(String destinationZone) { + this.destinationZone = destinationZone; + return this; + } + + public String getTargetInstance() { + return targetInstance; + } + + public Builder setTargetInstance(String targetInstance) { + this.targetInstance = targetInstance; + return this; + } + + + public InstanceMoveRequest build() { + + return new InstanceMoveRequest( + destinationZone, + targetInstance + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDestinationZone(this.destinationZone); + newBuilder.setTargetInstance(this.targetInstance); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceMoveRequest{" + + "destinationZone=" + destinationZone + ", " + + "targetInstance=" + targetInstance + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceMoveRequest) { + InstanceMoveRequest that = (InstanceMoveRequest) o; + return + Objects.equals(this.destinationZone, that.getDestinationZone()) && + Objects.equals(this.targetInstance, that.getTargetInstance()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + destinationZone, + targetInstance + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java new file mode 100644 index 000000000000..de89835b85de --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceName implements ResourceName { + private final String instance; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InstanceName(Builder builder) { + instance = Preconditions.checkNotNull(builder.getInstance()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static InstanceName of( + String instance, + String project, + String zone + ) { + return newBuilder() + .setInstance(instance) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String instance, + String project, + String zone + ) { + return of( + instance, + project, + zone + ) + .toString(); + } + + public String getInstance() { + return instance; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("instance", instance); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InstanceName parse(String formattedString) {return InstanceName.parse(formattedString);} + }; + } + + public static InstanceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InstanceName.parse: formattedString not in valid format"); + return of( + matchMap.get("instance"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String instance; + private String project; + private String zone; + + public String getInstance() { + return instance; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (InstanceName instanceName) { + instance = instanceName.instance; + project = instanceName.project; + zone = instanceName.zone; + } + + public InstanceName build() { + return new InstanceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "instance", instance, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceName) { + InstanceName that = (InstanceName) o; + return + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instance, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java new file mode 100644 index 000000000000..a0fd9ca11277 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java @@ -0,0 +1,470 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceProperties implements ApiMessage { + private final Boolean canIpForward; + private final String description; + private final List disks; + private final String machineType; + private final Metadata metadata; + private final List networkInterfaces; + private final Scheduling scheduling; + private final List serviceAccounts; + private final Tags tags; + + private InstanceProperties() { + this.canIpForward = null; + this.description = null; + this.disks = null; + this.machineType = null; + this.metadata = null; + this.networkInterfaces = null; + this.scheduling = null; + this.serviceAccounts = null; + this.tags = null; + } + + + private InstanceProperties( + Boolean canIpForward, + String description, + List disks, + String machineType, + Metadata metadata, + List networkInterfaces, + Scheduling scheduling, + List serviceAccounts, + Tags tags + ) { + this.canIpForward = canIpForward; + this.description = description; + this.disks = disks; + this.machineType = machineType; + this.metadata = metadata; + this.networkInterfaces = networkInterfaces; + this.scheduling = scheduling; + this.serviceAccounts = serviceAccounts; + this.tags = tags; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("canIpForward") && canIpForward != null) { + fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AttachedDisk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); + } + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + if (fieldNames.contains("metadata") && metadata != null) { + fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); + } + if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NetworkInterface item : networkInterfaces) { + stringList.add(item.toString()); + } + fieldMap.put("networkInterfaces", stringList.build()); + } + if (fieldNames.contains("scheduling") && scheduling != null) { + fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling))); + } + if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ServiceAccount item : serviceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("serviceAccounts", stringList.build()); + } + if (fieldNames.contains("tags") && tags != null) { + fieldMap.put("tags", Collections.singletonList(String.valueOf(tags))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("canIpForward")) { + return String.valueOf(canIpForward); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("disks")) { + return String.valueOf(disks); + } + if (fieldName.equals("machineType")) { + return String.valueOf(machineType); + } + if (fieldName.equals("metadata")) { + return String.valueOf(metadata); + } + if (fieldName.equals("networkInterfaces")) { + return String.valueOf(networkInterfaces); + } + if (fieldName.equals("scheduling")) { + return String.valueOf(scheduling); + } + if (fieldName.equals("serviceAccounts")) { + return String.valueOf(serviceAccounts); + } + if (fieldName.equals("tags")) { + return String.valueOf(tags); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getCanIpForward() { + return canIpForward; + } + + public String getDescription() { + return description; + } + + public List getDisksList() { + return disks; + } + + public String getMachineType() { + return machineType; + } + + public Metadata getMetadata() { + return metadata; + } + + public List getNetworkInterfacesList() { + return networkInterfaces; + } + + public Scheduling getScheduling() { + return scheduling; + } + + public List getServiceAccountsList() { + return serviceAccounts; + } + + public Tags getTags() { + return tags; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceProperties DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceProperties(); + } + + public static class Builder { + private Boolean canIpForward; + private String description; + private List disks; + private String machineType; + private Metadata metadata; + private List networkInterfaces; + private Scheduling scheduling; + private List serviceAccounts; + private Tags tags; + + Builder() {} + + public Builder mergeFrom(InstanceProperties other) { + if (other == InstanceProperties.getDefaultInstance()) return this; + if (other.getCanIpForward() != null) { + this.canIpForward = other.canIpForward; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDisksList() != null) { + this.disks = other.disks; + } + if (other.getMachineType() != null) { + this.machineType = other.machineType; + } + if (other.getMetadata() != null) { + this.metadata = other.metadata; + } + if (other.getNetworkInterfacesList() != null) { + this.networkInterfaces = other.networkInterfaces; + } + if (other.getScheduling() != null) { + this.scheduling = other.scheduling; + } + if (other.getServiceAccountsList() != null) { + this.serviceAccounts = other.serviceAccounts; + } + if (other.getTags() != null) { + this.tags = other.tags; + } + return this; + } + + Builder(InstanceProperties source) { + this.canIpForward = source.canIpForward; + this.description = source.description; + this.disks = source.disks; + this.machineType = source.machineType; + this.metadata = source.metadata; + this.networkInterfaces = source.networkInterfaces; + this.scheduling = source.scheduling; + this.serviceAccounts = source.serviceAccounts; + this.tags = source.tags; + } + + public Boolean getCanIpForward() { + return canIpForward; + } + + public Builder setCanIpForward(Boolean canIpForward) { + this.canIpForward = canIpForward; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getDisksList() { + return disks; + } + + public Builder addAllDisks(List disks) { + if (this.disks == null) { + this.disks = new ArrayList<>(disks.size()); + } + this.disks.addAll(disks); + return this; + } + + public Builder addDisks(AttachedDisk disks) { + this.disks.add(disks); + return this; + } + + public String getMachineType() { + return machineType; + } + + public Builder setMachineType(String machineType) { + this.machineType = machineType; + return this; + } + + public Metadata getMetadata() { + return metadata; + } + + public Builder setMetadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + public List getNetworkInterfacesList() { + return networkInterfaces; + } + + public Builder addAllNetworkInterfaces(List networkInterfaces) { + if (this.networkInterfaces == null) { + this.networkInterfaces = new ArrayList<>(networkInterfaces.size()); + } + this.networkInterfaces.addAll(networkInterfaces); + return this; + } + + public Builder addNetworkInterfaces(NetworkInterface networkInterfaces) { + this.networkInterfaces.add(networkInterfaces); + return this; + } + + public Scheduling getScheduling() { + return scheduling; + } + + public Builder setScheduling(Scheduling scheduling) { + this.scheduling = scheduling; + return this; + } + + public List getServiceAccountsList() { + return serviceAccounts; + } + + public Builder addAllServiceAccounts(List serviceAccounts) { + if (this.serviceAccounts == null) { + this.serviceAccounts = new ArrayList<>(serviceAccounts.size()); + } + this.serviceAccounts.addAll(serviceAccounts); + return this; + } + + public Builder addServiceAccounts(ServiceAccount serviceAccounts) { + this.serviceAccounts.add(serviceAccounts); + return this; + } + + public Tags getTags() { + return tags; + } + + public Builder setTags(Tags tags) { + this.tags = tags; + return this; + } + + + public InstanceProperties build() { + + + + + + + + + return new InstanceProperties( + canIpForward, + description, + disks, + machineType, + metadata, + networkInterfaces, + scheduling, + serviceAccounts, + tags + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCanIpForward(this.canIpForward); + newBuilder.setDescription(this.description); + newBuilder.addAllDisks(this.disks); + newBuilder.setMachineType(this.machineType); + newBuilder.setMetadata(this.metadata); + newBuilder.addAllNetworkInterfaces(this.networkInterfaces); + newBuilder.setScheduling(this.scheduling); + newBuilder.addAllServiceAccounts(this.serviceAccounts); + newBuilder.setTags(this.tags); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceProperties{" + + "canIpForward=" + canIpForward + ", " + + "description=" + description + ", " + + "disks=" + disks + ", " + + "machineType=" + machineType + ", " + + "metadata=" + metadata + ", " + + "networkInterfaces=" + networkInterfaces + ", " + + "scheduling=" + scheduling + ", " + + "serviceAccounts=" + serviceAccounts + ", " + + "tags=" + tags + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceProperties) { + InstanceProperties that = (InstanceProperties) o; + return + Objects.equals(this.canIpForward, that.getCanIpForward()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.disks, that.getDisksList()) && + Objects.equals(this.machineType, that.getMachineType()) && + Objects.equals(this.metadata, that.getMetadata()) && + Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) && + Objects.equals(this.scheduling, that.getScheduling()) && + Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) && + Objects.equals(this.tags, that.getTags()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + canIpForward, + description, + disks, + machineType, + metadata, + networkInterfaces, + scheduling, + serviceAccounts, + tags + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java new file mode 100644 index 000000000000..414e2ed1425f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceReference implements ApiMessage { + private final String instance; + + private InstanceReference() { + this.instance = null; + } + + + private InstanceReference( + String instance + ) { + this.instance = instance; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getInstance() { + return instance; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceReference(); + } + + public static class Builder { + private String instance; + + Builder() {} + + public Builder mergeFrom(InstanceReference other) { + if (other == InstanceReference.getDefaultInstance()) return this; + if (other.getInstance() != null) { + this.instance = other.instance; + } + return this; + } + + Builder(InstanceReference source) { + this.instance = source.instance; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + + public InstanceReference build() { + return new InstanceReference( + instance + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstance(this.instance); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceReference{" + + "instance=" + instance + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceReference) { + InstanceReference that = (InstanceReference) o; + return + Objects.equals(this.instance, that.getInstance()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instance + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java new file mode 100644 index 000000000000..0f038a95b0f4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java @@ -0,0 +1,493 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import com.google.cloud.compute.v1.stub.InstanceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addAccessConfigInstance to 30 seconds: + * + *

+ * 
+ * InstanceSettings.Builder instanceSettingsBuilder =
+ *     InstanceSettings.newBuilder();
+ * instanceSettingsBuilder.addAccessConfigInstanceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceSettings instanceSettings = instanceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to addAccessConfigInstance. + */ + public UnaryCallSettings addAccessConfigInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).addAccessConfigInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to aggregatedListInstances. + */ + public PagedCallSettings aggregatedListInstancesSettings() { + return ((InstanceStubSettings) getStubSettings()).aggregatedListInstancesSettings(); + } + + /** + * Returns the object with the settings used for calls to attachDiskInstance. + */ + public UnaryCallSettings attachDiskInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).attachDiskInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteInstance. + */ + public UnaryCallSettings deleteInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteAccessConfigInstance. + */ + public UnaryCallSettings deleteAccessConfigInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).deleteAccessConfigInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to detachDiskInstance. + */ + public UnaryCallSettings detachDiskInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).detachDiskInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to getInstance. + */ + public UnaryCallSettings getInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to getSerialPortOutputInstance. + */ + public UnaryCallSettings getSerialPortOutputInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).getSerialPortOutputInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to insertInstance. + */ + public UnaryCallSettings insertInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).insertInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to listInstances. + */ + public PagedCallSettings listInstancesSettings() { + return ((InstanceStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** + * Returns the object with the settings used for calls to resetInstance. + */ + public UnaryCallSettings resetInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).resetInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setDiskAutoDeleteInstance. + */ + public UnaryCallSettings setDiskAutoDeleteInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setDiskAutoDeleteInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setMachineTypeInstance. + */ + public UnaryCallSettings setMachineTypeInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setMachineTypeInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setMetadataInstance. + */ + public UnaryCallSettings setMetadataInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setMetadataInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setSchedulingInstance. + */ + public UnaryCallSettings setSchedulingInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setSchedulingInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setServiceAccountInstance. + */ + public UnaryCallSettings setServiceAccountInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setServiceAccountInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setTagsInstance. + */ + public UnaryCallSettings setTagsInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setTagsInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to startInstance. + */ + public UnaryCallSettings startInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).startInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to startWithEncryptionKeyInstance. + */ + public UnaryCallSettings startWithEncryptionKeyInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).startWithEncryptionKeyInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to stopInstance. + */ + public UnaryCallSettings stopInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).stopInstanceSettings(); + } + + + public static final InstanceSettings create(InstanceStubSettings stub) throws IOException { + return new InstanceSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstanceStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InstanceStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InstanceStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InstanceStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InstanceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstanceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InstanceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InstanceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InstanceSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InstanceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InstanceStubSettings.newBuilder()); + } + + protected Builder(InstanceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InstanceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InstanceStubSettings.Builder getStubSettingsBuilder() { + return ((InstanceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to addAccessConfigInstance. + */ + public UnaryCallSettings.Builder addAccessConfigInstanceSettings() { + return getStubSettingsBuilder().addAccessConfigInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInstances. + */ + public PagedCallSettings.Builder aggregatedListInstancesSettings() { + return getStubSettingsBuilder().aggregatedListInstancesSettings(); + } + + /** + * Returns the builder for the settings used for calls to attachDiskInstance. + */ + public UnaryCallSettings.Builder attachDiskInstanceSettings() { + return getStubSettingsBuilder().attachDiskInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteInstance. + */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteAccessConfigInstance. + */ + public UnaryCallSettings.Builder deleteAccessConfigInstanceSettings() { + return getStubSettingsBuilder().deleteAccessConfigInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to detachDiskInstance. + */ + public UnaryCallSettings.Builder detachDiskInstanceSettings() { + return getStubSettingsBuilder().detachDiskInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getInstance. + */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getSerialPortOutputInstance. + */ + public UnaryCallSettings.Builder getSerialPortOutputInstanceSettings() { + return getStubSettingsBuilder().getSerialPortOutputInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertInstance. + */ + public UnaryCallSettings.Builder insertInstanceSettings() { + return getStubSettingsBuilder().insertInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInstances. + */ + public PagedCallSettings.Builder listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** + * Returns the builder for the settings used for calls to resetInstance. + */ + public UnaryCallSettings.Builder resetInstanceSettings() { + return getStubSettingsBuilder().resetInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. + */ + public UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings() { + return getStubSettingsBuilder().setDiskAutoDeleteInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setMachineTypeInstance. + */ + public UnaryCallSettings.Builder setMachineTypeInstanceSettings() { + return getStubSettingsBuilder().setMachineTypeInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setMetadataInstance. + */ + public UnaryCallSettings.Builder setMetadataInstanceSettings() { + return getStubSettingsBuilder().setMetadataInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setSchedulingInstance. + */ + public UnaryCallSettings.Builder setSchedulingInstanceSettings() { + return getStubSettingsBuilder().setSchedulingInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setServiceAccountInstance. + */ + public UnaryCallSettings.Builder setServiceAccountInstanceSettings() { + return getStubSettingsBuilder().setServiceAccountInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setTagsInstance. + */ + public UnaryCallSettings.Builder setTagsInstanceSettings() { + return getStubSettingsBuilder().setTagsInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to startInstance. + */ + public UnaryCallSettings.Builder startInstanceSettings() { + return getStubSettingsBuilder().startInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to startWithEncryptionKeyInstance. + */ + public UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings() { + return getStubSettingsBuilder().startWithEncryptionKeyInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to stopInstance. + */ + public UnaryCallSettings.Builder stopInstanceSettings() { + return getStubSettingsBuilder().stopInstanceSettings(); + } + + @Override + public InstanceSettings build() throws IOException { + return new InstanceSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java new file mode 100644 index 000000000000..a1f965b37e67 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java @@ -0,0 +1,366 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceTemplate implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final InstanceProperties properties; + private final String selfLink; + + private InstanceTemplate() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.properties = null; + this.selfLink = null; + } + + + private InstanceTemplate( + String creationTimestamp, + String description, + String id, + String kind, + String name, + InstanceProperties properties, + String selfLink + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.properties = properties; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("properties") && properties != null) { + fieldMap.put("properties", Collections.singletonList(String.valueOf(properties))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("properties")) { + return String.valueOf(properties); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public InstanceProperties getProperties() { + return properties; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceTemplate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceTemplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceTemplate DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceTemplate(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private InstanceProperties properties; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceTemplate other) { + if (other == InstanceTemplate.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getProperties() != null) { + this.properties = other.properties; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceTemplate source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.properties = source.properties; + this.selfLink = source.selfLink; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public InstanceProperties getProperties() { + return properties; + } + + public Builder setProperties(InstanceProperties properties) { + this.properties = properties; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceTemplate build() { + + + + + + + return new InstanceTemplate( + creationTimestamp, + description, + id, + kind, + name, + properties, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setProperties(this.properties); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceTemplate{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "properties=" + properties + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceTemplate) { + InstanceTemplate that = (InstanceTemplate) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.properties, that.getProperties()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + kind, + name, + properties, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java new file mode 100644 index 000000000000..363bdadfeb34 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java @@ -0,0 +1,716 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InstanceTemplateStub; +import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+ *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+ *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InstanceTemplateSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InstanceTemplateSettings instanceTemplateSettings =
+ *     InstanceTemplateSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InstanceTemplateClient instanceTemplateClient =
+ *     InstanceTemplateClient.create(instanceTemplateSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InstanceTemplateSettings instanceTemplateSettings =
+ *     InstanceTemplateSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InstanceTemplateClient instanceTemplateClient =
+ *     InstanceTemplateClient.create(instanceTemplateSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceTemplateClient implements BackgroundResource { + private final InstanceTemplateSettings settings; + private final InstanceTemplateStub stub; + + + + /** + * Constructs an instance of InstanceTemplateClient with default settings. + */ + public static final InstanceTemplateClient create() throws IOException { + return create(InstanceTemplateSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InstanceTemplateClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InstanceTemplateClient create(InstanceTemplateSettings settings) throws IOException { + return new InstanceTemplateClient(settings); + } + + /** + * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InstanceTemplateSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InstanceTemplateClient create(InstanceTemplateStub stub) { + return new InstanceTemplateClient(stub); + } + + /** + * Constructs an instance of InstanceTemplateClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InstanceTemplateClient(InstanceTemplateSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InstanceTemplateStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InstanceTemplateClient(InstanceTemplateStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InstanceTemplateSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceTemplateStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate);
+   * }
+   * 
+ * + * @param instanceTemplate The name of the instance template to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceTemplate(InstanceTemplateName instanceTemplate) { + + DeleteInstanceTemplateHttpRequest request = + DeleteInstanceTemplateHttpRequest.newBuilder() + .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) + .build(); + return deleteInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString());
+   * }
+   * 
+ * + * @param instanceTemplate The name of the instance template to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceTemplate(String instanceTemplate) { + + DeleteInstanceTemplateHttpRequest request = + DeleteInstanceTemplateHttpRequest.newBuilder() + .setInstanceTemplate(instanceTemplate) + .build(); + return deleteInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
+   *     .setInstanceTemplate(instanceTemplate.toString())
+   *     .build();
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest request) { + return deleteInstanceTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
+   *     .setInstanceTemplate(instanceTemplate.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = instanceTemplateClient.deleteInstanceTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInstanceTemplateCallable() { + return stub.deleteInstanceTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(instanceTemplate);
+   * }
+   * 
+ * + * @param instanceTemplate The name of the instance template. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceTemplate) { + + GetInstanceTemplateHttpRequest request = + GetInstanceTemplateHttpRequest.newBuilder() + .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) + .build(); + return getInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(instanceTemplate.toString());
+   * }
+   * 
+ * + * @param instanceTemplate The name of the instance template. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceTemplate getInstanceTemplate(String instanceTemplate) { + + GetInstanceTemplateHttpRequest request = + GetInstanceTemplateHttpRequest.newBuilder() + .setInstanceTemplate(instanceTemplate) + .build(); + return getInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder()
+   *     .setInstanceTemplate(instanceTemplate.toString())
+   *     .build();
+   *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest request) { + return getInstanceTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder()
+   *     .setInstanceTemplate(instanceTemplate.toString())
+   *     .build();
+   *   ApiFuture<InstanceTemplate> future = instanceTemplateClient.getInstanceTemplateCallable().futureCall(request);
+   *   // Do something
+   *   InstanceTemplate response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInstanceTemplateCallable() { + return stub.getInstanceTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(project, instanceTemplateResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param instanceTemplateResource An Instance Template resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceTemplate(ProjectName project, InstanceTemplate instanceTemplateResource) { + + InsertInstanceTemplateHttpRequest request = + InsertInstanceTemplateHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setInstanceTemplateResource(instanceTemplateResource) + .build(); + return insertInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(project.toString(), instanceTemplateResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param instanceTemplateResource An Instance Template resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceTemplate(String project, InstanceTemplate instanceTemplateResource) { + + InsertInstanceTemplateHttpRequest request = + InsertInstanceTemplateHttpRequest.newBuilder() + .setProject(project) + .setInstanceTemplateResource(instanceTemplateResource) + .build(); + return insertInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
+   *   InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setInstanceTemplateResource(instanceTemplateResource)
+   *     .build();
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest request) { + return insertInstanceTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
+   *   InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setInstanceTemplateResource(instanceTemplateResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceTemplateClient.insertInstanceTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertInstanceTemplateCallable() { + return stub.insertInstanceTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of instance templates that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstanceTemplate element : instanceTemplateClient.listInstanceTemplates(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectName project) { + ListInstanceTemplatesHttpRequest request = + ListInstanceTemplatesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listInstanceTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of instance templates that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InstanceTemplate element : instanceTemplateClient.listInstanceTemplates(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String project) { + ListInstanceTemplatesHttpRequest request = + ListInstanceTemplatesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listInstanceTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of instance templates that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInstanceTemplatesHttpRequest request = ListInstanceTemplatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (InstanceTemplate element : instanceTemplateClient.listInstanceTemplates(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ListInstanceTemplatesHttpRequest request) { + return listInstanceTemplatesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of instance templates that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInstanceTemplatesHttpRequest request = ListInstanceTemplatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListInstanceTemplatesPagedResponse> future = instanceTemplateClient.listInstanceTemplatesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceTemplate element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstanceTemplatesPagedCallable() { + return stub.listInstanceTemplatesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of instance templates that are contained within the specified project and zone. + * + * Sample code: + *

+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInstanceTemplatesHttpRequest request = ListInstanceTemplatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceTemplateList response = instanceTemplateClient.listInstanceTemplatesCallable().call(request);
+   *     for (InstanceTemplate element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstanceTemplatesCallable() { + return stub.listInstanceTemplatesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListInstanceTemplatesPagedResponse extends AbstractPagedListResponse< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage, + ListInstanceTemplatesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstanceTemplatesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstanceTemplatesPagedResponse apply(ListInstanceTemplatesPage input) { + return new ListInstanceTemplatesPagedResponse(input); + } + }); + } + + private ListInstanceTemplatesPagedResponse(ListInstanceTemplatesPage page) { + super(page, ListInstanceTemplatesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInstanceTemplatesPage extends AbstractPage< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage> { + + private ListInstanceTemplatesPage( + PageContext context, + InstanceTemplateList response) { + super(context, response); + } + + private static ListInstanceTemplatesPage createEmptyPage() { + return new ListInstanceTemplatesPage(null, null); + } + + @Override + protected ListInstanceTemplatesPage createPage( + PageContext context, + InstanceTemplateList response) { + return new ListInstanceTemplatesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInstanceTemplatesFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage, + ListInstanceTemplatesFixedSizeCollection> { + + private ListInstanceTemplatesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstanceTemplatesFixedSizeCollection createEmptyCollection() { + return new ListInstanceTemplatesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstanceTemplatesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstanceTemplatesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java new file mode 100644 index 000000000000..09a750ac6ffa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceTemplateList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private InstanceTemplateList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private InstanceTemplateList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceTemplate item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceTemplateList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceTemplateList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceTemplateList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceTemplateList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InstanceTemplateList other) { + if (other == InstanceTemplateList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InstanceTemplateList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceTemplate items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InstanceTemplateList build() { + + + + + return new InstanceTemplateList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceTemplateList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceTemplateList) { + InstanceTemplateList that = (InstanceTemplateList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java new file mode 100644 index 000000000000..5756bfcc4152 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceTemplateName implements ResourceName { + private final String instanceTemplate; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/instanceTemplates/{instanceTemplate}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InstanceTemplateName(Builder builder) { + instanceTemplate = Preconditions.checkNotNull(builder.getInstanceTemplate()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static InstanceTemplateName of( + String instanceTemplate, + String project + ) { + return newBuilder() + .setInstanceTemplate(instanceTemplate) + .setProject(project) + .build(); + } + + public static String format( + String instanceTemplate, + String project + ) { + return of( + instanceTemplate, + project + ) + .toString(); + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("instanceTemplate", instanceTemplate); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InstanceTemplateName parse(String formattedString) {return InstanceTemplateName.parse(formattedString);} + }; + } + + public static InstanceTemplateName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InstanceTemplateName.parse: formattedString not in valid format"); + return of( + matchMap.get("instanceTemplate"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String instanceTemplate; + private String project; + + public String getInstanceTemplate() { + return instanceTemplate; + } + public String getProject() { + return project; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (InstanceTemplateName instanceTemplateName) { + instanceTemplate = instanceTemplateName.instanceTemplate; + project = instanceTemplateName.project; + } + + public InstanceTemplateName build() { + return new InstanceTemplateName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "instanceTemplate", instanceTemplate, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceTemplateName) { + InstanceTemplateName that = (InstanceTemplateName) o; + return + Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceTemplate, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java new file mode 100644 index 000000000000..62589deb971a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java @@ -0,0 +1,268 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceTemplateClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteInstanceTemplate to 30 seconds: + * + *

+ * 
+ * InstanceTemplateSettings.Builder instanceTemplateSettingsBuilder =
+ *     InstanceTemplateSettings.newBuilder();
+ * instanceTemplateSettingsBuilder.deleteInstanceTemplateSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceTemplateSettings instanceTemplateSettings = instanceTemplateSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceTemplateSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteInstanceTemplate. + */ + public UnaryCallSettings deleteInstanceTemplateSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()).deleteInstanceTemplateSettings(); + } + + /** + * Returns the object with the settings used for calls to getInstanceTemplate. + */ + public UnaryCallSettings getInstanceTemplateSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()).getInstanceTemplateSettings(); + } + + /** + * Returns the object with the settings used for calls to insertInstanceTemplate. + */ + public UnaryCallSettings insertInstanceTemplateSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()).insertInstanceTemplateSettings(); + } + + /** + * Returns the object with the settings used for calls to listInstanceTemplates. + */ + public PagedCallSettings listInstanceTemplatesSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()).listInstanceTemplatesSettings(); + } + + + public static final InstanceTemplateSettings create(InstanceTemplateStubSettings stub) throws IOException { + return new InstanceTemplateSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstanceTemplateStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InstanceTemplateStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InstanceTemplateStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InstanceTemplateStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InstanceTemplateStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstanceTemplateStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InstanceTemplateStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InstanceTemplateStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceTemplateSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InstanceTemplateSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InstanceTemplateStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InstanceTemplateStubSettings.newBuilder()); + } + + protected Builder(InstanceTemplateSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InstanceTemplateStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InstanceTemplateStubSettings.Builder getStubSettingsBuilder() { + return ((InstanceTemplateStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteInstanceTemplate. + */ + public UnaryCallSettings.Builder deleteInstanceTemplateSettings() { + return getStubSettingsBuilder().deleteInstanceTemplateSettings(); + } + + /** + * Returns the builder for the settings used for calls to getInstanceTemplate. + */ + public UnaryCallSettings.Builder getInstanceTemplateSettings() { + return getStubSettingsBuilder().getInstanceTemplateSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertInstanceTemplate. + */ + public UnaryCallSettings.Builder insertInstanceTemplateSettings() { + return getStubSettingsBuilder().insertInstanceTemplateSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInstanceTemplates. + */ + public PagedCallSettings.Builder listInstanceTemplatesSettings() { + return getStubSettingsBuilder().listInstanceTemplatesSettings(); + } + + @Override + public InstanceTemplateSettings build() throws IOException { + return new InstanceTemplateSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java new file mode 100644 index 000000000000..11faf51f5123 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java @@ -0,0 +1,242 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceWithNamedPorts implements ApiMessage { + private final String instance; + private final List namedPorts; + private final String status; + + private InstanceWithNamedPorts() { + this.instance = null; + this.namedPorts = null; + this.status = null; + } + + + private InstanceWithNamedPorts( + String instance, + List namedPorts, + String status + ) { + this.instance = instance; + this.namedPorts = namedPorts; + this.status = status; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getInstance() { + return instance; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public String getStatus() { + return status; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceWithNamedPorts prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceWithNamedPorts getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceWithNamedPorts DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceWithNamedPorts(); + } + + public static class Builder { + private String instance; + private List namedPorts; + private String status; + + Builder() {} + + public Builder mergeFrom(InstanceWithNamedPorts other) { + if (other == InstanceWithNamedPorts.getDefaultInstance()) return this; + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getNamedPortsList() != null) { + this.namedPorts = other.namedPorts; + } + if (other.getStatus() != null) { + this.status = other.status; + } + return this; + } + + Builder(InstanceWithNamedPorts source) { + this.instance = source.instance; + this.namedPorts = source.namedPorts; + this.status = source.status; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public Builder addAllNamedPorts(List namedPorts) { + if (this.namedPorts == null) { + this.namedPorts = new ArrayList<>(namedPorts.size()); + } + this.namedPorts.addAll(namedPorts); + return this; + } + + public Builder addNamedPorts(NamedPort namedPorts) { + this.namedPorts.add(namedPorts); + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + + public InstanceWithNamedPorts build() { + + + return new InstanceWithNamedPorts( + instance, + namedPorts, + status + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstance(this.instance); + newBuilder.addAllNamedPorts(this.namedPorts); + newBuilder.setStatus(this.status); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceWithNamedPorts{" + + "instance=" + instance + ", " + + "namedPorts=" + namedPorts + ", " + + "status=" + status + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceWithNamedPorts) { + InstanceWithNamedPorts that = (InstanceWithNamedPorts) o; + return + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.namedPorts, that.getNamedPortsList()) && + Objects.equals(this.status, that.getStatus()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instance, + namedPorts, + status + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java new file mode 100644 index 000000000000..d488ca668a2e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesScopedList implements ApiMessage { + private final List instances; + private final Warning warning; + + private InstancesScopedList() { + this.instances = null; + this.warning = null; + } + + + private InstancesScopedList( + List instances, + Warning warning + ) { + this.instances = instances; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Instance item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesScopedList(); + } + + public static class Builder { + private List instances; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InstancesScopedList other) { + if (other == InstancesScopedList.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InstancesScopedList source) { + this.instances = source.instances; + this.warning = source.warning; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(Instance instances) { + this.instances.add(instances); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InstancesScopedList build() { + + return new InstancesScopedList( + instances, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesScopedList{" + + "instances=" + instances + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesScopedList) { + InstancesScopedList that = (InstancesScopedList) o; + return + Objects.equals(this.instances, that.getInstancesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java new file mode 100644 index 000000000000..ed8f60bf97f7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesSetMachineTypeRequest implements ApiMessage { + private final String machineType; + + private InstancesSetMachineTypeRequest() { + this.machineType = null; + } + + + private InstancesSetMachineTypeRequest( + String machineType + ) { + this.machineType = machineType; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("machineType")) { + return String.valueOf(machineType); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getMachineType() { + return machineType; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesSetMachineTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesSetMachineTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesSetMachineTypeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesSetMachineTypeRequest(); + } + + public static class Builder { + private String machineType; + + Builder() {} + + public Builder mergeFrom(InstancesSetMachineTypeRequest other) { + if (other == InstancesSetMachineTypeRequest.getDefaultInstance()) return this; + if (other.getMachineType() != null) { + this.machineType = other.machineType; + } + return this; + } + + Builder(InstancesSetMachineTypeRequest source) { + this.machineType = source.machineType; + } + + public String getMachineType() { + return machineType; + } + + public Builder setMachineType(String machineType) { + this.machineType = machineType; + return this; + } + + + public InstancesSetMachineTypeRequest build() { + return new InstancesSetMachineTypeRequest( + machineType + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setMachineType(this.machineType); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesSetMachineTypeRequest{" + + "machineType=" + machineType + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesSetMachineTypeRequest) { + InstancesSetMachineTypeRequest that = (InstancesSetMachineTypeRequest) o; + return + Objects.equals(this.machineType, that.getMachineType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + machineType + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java new file mode 100644 index 000000000000..77bf1c60183c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesSetServiceAccountRequest implements ApiMessage { + private final String email; + private final List scopes; + + private InstancesSetServiceAccountRequest() { + this.email = null; + this.scopes = null; + } + + + private InstancesSetServiceAccountRequest( + String email, + List scopes + ) { + this.email = email; + this.scopes = scopes; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("email") && email != null) { + fieldMap.put("email", Collections.singletonList(String.valueOf(email))); + } + if (fieldNames.contains("scopes") && scopes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : scopes) { + stringList.add(item.toString()); + } + fieldMap.put("scopes", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("email")) { + return String.valueOf(email); + } + if (fieldName.equals("scopes")) { + return String.valueOf(scopes); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getEmail() { + return email; + } + + public List getScopesList() { + return scopes; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesSetServiceAccountRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesSetServiceAccountRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesSetServiceAccountRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesSetServiceAccountRequest(); + } + + public static class Builder { + private String email; + private List scopes; + + Builder() {} + + public Builder mergeFrom(InstancesSetServiceAccountRequest other) { + if (other == InstancesSetServiceAccountRequest.getDefaultInstance()) return this; + if (other.getEmail() != null) { + this.email = other.email; + } + if (other.getScopesList() != null) { + this.scopes = other.scopes; + } + return this; + } + + Builder(InstancesSetServiceAccountRequest source) { + this.email = source.email; + this.scopes = source.scopes; + } + + public String getEmail() { + return email; + } + + public Builder setEmail(String email) { + this.email = email; + return this; + } + + public List getScopesList() { + return scopes; + } + + public Builder addAllScopes(List scopes) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(scopes.size()); + } + this.scopes.addAll(scopes); + return this; + } + + public Builder addScopes(String scopes) { + this.scopes.add(scopes); + return this; + } + + + public InstancesSetServiceAccountRequest build() { + + return new InstancesSetServiceAccountRequest( + email, + scopes + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setEmail(this.email); + newBuilder.addAllScopes(this.scopes); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesSetServiceAccountRequest{" + + "email=" + email + ", " + + "scopes=" + scopes + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesSetServiceAccountRequest) { + InstancesSetServiceAccountRequest that = (InstancesSetServiceAccountRequest) o; + return + Objects.equals(this.email, that.getEmail()) && + Objects.equals(this.scopes, that.getScopesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + email, + scopes + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java new file mode 100644 index 000000000000..e2c4671b9b48 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesStartWithEncryptionKeyRequest implements ApiMessage { + private final List disks; + + private InstancesStartWithEncryptionKeyRequest() { + this.disks = null; + } + + + private InstancesStartWithEncryptionKeyRequest( + List disks + ) { + this.disks = disks; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (CustomerEncryptionKeyProtectedDisk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("disks")) { + return String.valueOf(disks); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getDisksList() { + return disks; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesStartWithEncryptionKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesStartWithEncryptionKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesStartWithEncryptionKeyRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesStartWithEncryptionKeyRequest(); + } + + public static class Builder { + private List disks; + + Builder() {} + + public Builder mergeFrom(InstancesStartWithEncryptionKeyRequest other) { + if (other == InstancesStartWithEncryptionKeyRequest.getDefaultInstance()) return this; + if (other.getDisksList() != null) { + this.disks = other.disks; + } + return this; + } + + Builder(InstancesStartWithEncryptionKeyRequest source) { + this.disks = source.disks; + } + + public List getDisksList() { + return disks; + } + + public Builder addAllDisks(List disks) { + if (this.disks == null) { + this.disks = new ArrayList<>(disks.size()); + } + this.disks.addAll(disks); + return this; + } + + public Builder addDisks(CustomerEncryptionKeyProtectedDisk disks) { + this.disks.add(disks); + return this; + } + + + public InstancesStartWithEncryptionKeyRequest build() { + return new InstancesStartWithEncryptionKeyRequest( + disks + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllDisks(this.disks); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesStartWithEncryptionKeyRequest{" + + "disks=" + disks + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesStartWithEncryptionKeyRequest) { + InstancesStartWithEncryptionKeyRequest that = (InstancesStartWithEncryptionKeyRequest) o; + return + Objects.equals(this.disks, that.getDisksList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + disks + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java new file mode 100644 index 000000000000..941394203a58 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InvalidateCacheUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final CacheInvalidationRule cacheInvalidationRuleResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String urlMap; + private final String userIp; + + private InvalidateCacheUrlMapHttpRequest() { + this.access_token = null; + this.cacheInvalidationRuleResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.urlMap = null; + this.userIp = null; + } + + + private InvalidateCacheUrlMapHttpRequest( + String access_token, + CacheInvalidationRule cacheInvalidationRuleResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String urlMap, + String userIp + ) { + this.access_token = access_token; + this.cacheInvalidationRuleResource = cacheInvalidationRuleResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.urlMap = urlMap; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("cacheInvalidationRuleResource") && cacheInvalidationRuleResource != null) { + fieldMap.put("cacheInvalidationRuleResource", Collections.singletonList(String.valueOf(cacheInvalidationRuleResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("cacheInvalidationRuleResource")) { + return String.valueOf(cacheInvalidationRuleResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public CacheInvalidationRule getApiMessageRequestBody() { + return cacheInvalidationRuleResource; + } + + public String getAccessToken() { + return access_token; + } + + public CacheInvalidationRule getCacheInvalidationRuleResource() { + return cacheInvalidationRuleResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUrlMap() { + return urlMap; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InvalidateCacheUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InvalidateCacheUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InvalidateCacheUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InvalidateCacheUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private CacheInvalidationRule cacheInvalidationRuleResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String urlMap; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InvalidateCacheUrlMapHttpRequest other) { + if (other == InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCacheInvalidationRuleResource() != null) { + this.cacheInvalidationRuleResource = other.cacheInvalidationRuleResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InvalidateCacheUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.cacheInvalidationRuleResource = source.cacheInvalidationRuleResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.urlMap = source.urlMap; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public CacheInvalidationRule getCacheInvalidationRuleResource() { + return cacheInvalidationRuleResource; + } + + public Builder setCacheInvalidationRuleResource(CacheInvalidationRule cacheInvalidationRuleResource) { + this.cacheInvalidationRuleResource = cacheInvalidationRuleResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InvalidateCacheUrlMapHttpRequest build() { + String missing = ""; + + + + + + + + if (urlMap == null) { + missing += " urlMap"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InvalidateCacheUrlMapHttpRequest( + access_token, + cacheInvalidationRuleResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCacheInvalidationRuleResource(this.cacheInvalidationRuleResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMap(this.urlMap); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InvalidateCacheUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "cacheInvalidationRuleResource=" + cacheInvalidationRuleResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMap=" + urlMap + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InvalidateCacheUrlMapHttpRequest) { + InvalidateCacheUrlMapHttpRequest that = (InvalidateCacheUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.cacheInvalidationRuleResource, that.getCacheInvalidationRuleResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMap, that.getUrlMap()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + cacheInvalidationRuleResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java new file mode 100644 index 000000000000..e4235c930543 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Items implements ApiMessage { + private final String key; + private final String value; + + private Items() { + this.key = null; + this.value = null; + } + + + private Items( + String key, + String value + ) { + this.key = key; + this.value = value; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("value") && value != null) { + fieldMap.put("value", Collections.singletonList(String.valueOf(value))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("value")) { + return String.valueOf(value); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getKey() { + return key; + } + + public String getValue() { + return value; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Items prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Items getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Items DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Items(); + } + + public static class Builder { + private String key; + private String value; + + Builder() {} + + public Builder mergeFrom(Items other) { + if (other == Items.getDefaultInstance()) return this; + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getValue() != null) { + this.value = other.value; + } + return this; + } + + Builder(Items source) { + this.key = source.key; + this.value = source.value; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getValue() { + return value; + } + + public Builder setValue(String value) { + this.value = value; + return this; + } + + + public Items build() { + + return new Items( + key, + value + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setKey(this.key); + newBuilder.setValue(this.value); + return newBuilder; + } + } + + @Override + public String toString() { + return "Items{" + + "key=" + key + ", " + + "value=" + value + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Items) { + Items that = (Items) o; + return + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.value, that.getValue()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + key, + value + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java new file mode 100644 index 000000000000..a2e62864f804 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java @@ -0,0 +1,297 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.LicensStub; +import com.google.cloud.compute.v1.stub.LicensStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (LicensClient licensClient = LicensClient.create()) {
+ *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+ *   License response = licensClient.getLicens(license);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the licensClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of LicensSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * LicensSettings licensSettings =
+ *     LicensSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LicensClient licensClient =
+ *     LicensClient.create(licensSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * LicensSettings licensSettings =
+ *     LicensSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LicensClient licensClient =
+ *     LicensClient.create(licensSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicensClient implements BackgroundResource { + private final LicensSettings settings; + private final LicensStub stub; + + + + /** + * Constructs an instance of LicensClient with default settings. + */ + public static final LicensClient create() throws IOException { + return create(LicensSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LicensClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final LicensClient create(LicensSettings settings) throws IOException { + return new LicensClient(settings); + } + + /** + * Constructs an instance of LicensClient, using the given stub for making calls. This is for + * advanced usage - prefer to use LicensSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final LicensClient create(LicensStub stub) { + return new LicensClient(stub); + } + + /** + * Constructs an instance of LicensClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected LicensClient(LicensSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LicensStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected LicensClient(LicensStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LicensSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LicensStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. Get a list of available licenses by making a list() request. + * + * Sample code: + *

+   * try (LicensClient licensClient = LicensClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   License response = licensClient.getLicens(license);
+   * }
+   * 
+ * + * @param license Name of the License resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final License getLicens(LicenseName license) { + + GetLicensHttpRequest request = + GetLicensHttpRequest.newBuilder() + .setLicense(license == null ? null : license.toString()) + .build(); + return getLicens(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. Get a list of available licenses by making a list() request. + * + * Sample code: + *

+   * try (LicensClient licensClient = LicensClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   License response = licensClient.getLicens(license.toString());
+   * }
+   * 
+ * + * @param license Name of the License resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final License getLicens(String license) { + + GetLicensHttpRequest request = + GetLicensHttpRequest.newBuilder() + .setLicense(license) + .build(); + return getLicens(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. Get a list of available licenses by making a list() request. + * + * Sample code: + *

+   * try (LicensClient licensClient = LicensClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   GetLicensHttpRequest request = GetLicensHttpRequest.newBuilder()
+   *     .setLicense(license.toString())
+   *     .build();
+   *   License response = licensClient.getLicens(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final License getLicens(GetLicensHttpRequest request) { + return getLicensCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. Get a list of available licenses by making a list() request. + * + * Sample code: + *

+   * try (LicensClient licensClient = LicensClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   GetLicensHttpRequest request = GetLicensHttpRequest.newBuilder()
+   *     .setLicense(license.toString())
+   *     .build();
+   *   ApiFuture<License> future = licensClient.getLicensCallable().futureCall(request);
+   *   // Do something
+   *   License response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getLicensCallable() { + return stub.getLicensCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java new file mode 100644 index 000000000000..794d346abff0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java @@ -0,0 +1,218 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.stub.LicensStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LicensClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getLicens to 30 seconds: + * + *

+ * 
+ * LicensSettings.Builder licensSettingsBuilder =
+ *     LicensSettings.newBuilder();
+ * licensSettingsBuilder.getLicensSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LicensSettings licensSettings = licensSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicensSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getLicens. + */ + public UnaryCallSettings getLicensSettings() { + return ((LicensStubSettings) getStubSettings()).getLicensSettings(); + } + + + public static final LicensSettings create(LicensStubSettings stub) throws IOException { + return new LicensSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LicensStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return LicensStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return LicensStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return LicensStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LicensStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return LicensStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LicensStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LicensStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LicensSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for LicensSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(LicensStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(LicensStubSettings.newBuilder()); + } + + protected Builder(LicensSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LicensStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public LicensStubSettings.Builder getStubSettingsBuilder() { + return ((LicensStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getLicens. + */ + public UnaryCallSettings.Builder getLicensSettings() { + return getStubSettingsBuilder().getLicensSettings(); + } + + @Override + public LicensSettings build() throws IOException { + return new LicensSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java new file mode 100644 index 000000000000..2bc6ff8c223f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class License implements ApiMessage { + private final Boolean chargesUseFee; + private final String kind; + private final String name; + private final String selfLink; + + private License() { + this.chargesUseFee = null; + this.kind = null; + this.name = null; + this.selfLink = null; + } + + + private License( + Boolean chargesUseFee, + String kind, + String name, + String selfLink + ) { + this.chargesUseFee = chargesUseFee; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("chargesUseFee") && chargesUseFee != null) { + fieldMap.put("chargesUseFee", Collections.singletonList(String.valueOf(chargesUseFee))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("chargesUseFee")) { + return String.valueOf(chargesUseFee); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getChargesUseFee() { + return chargesUseFee; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(License prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static License getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final License DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new License(); + } + + public static class Builder { + private Boolean chargesUseFee; + private String kind; + private String name; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(License other) { + if (other == License.getDefaultInstance()) return this; + if (other.getChargesUseFee() != null) { + this.chargesUseFee = other.chargesUseFee; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(License source) { + this.chargesUseFee = source.chargesUseFee; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + } + + public Boolean getChargesUseFee() { + return chargesUseFee; + } + + public Builder setChargesUseFee(Boolean chargesUseFee) { + this.chargesUseFee = chargesUseFee; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public License build() { + + + + return new License( + chargesUseFee, + kind, + name, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setChargesUseFee(this.chargesUseFee); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "License{" + + "chargesUseFee=" + chargesUseFee + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof License) { + License that = (License) o; + return + Objects.equals(this.chargesUseFee, that.getChargesUseFee()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + chargesUseFee, + kind, + name, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java new file mode 100644 index 000000000000..e73964c32b40 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class LicenseName implements ResourceName { + private final String license; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/licenses/{license}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LicenseName(Builder builder) { + license = Preconditions.checkNotNull(builder.getLicense()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static LicenseName of( + String license, + String project + ) { + return newBuilder() + .setLicense(license) + .setProject(project) + .build(); + } + + public static String format( + String license, + String project + ) { + return of( + license, + project + ) + .toString(); + } + + public String getLicense() { + return license; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("license", license); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public LicenseName parse(String formattedString) {return LicenseName.parse(formattedString);} + }; + } + + public static LicenseName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "LicenseName.parse: formattedString not in valid format"); + return of( + matchMap.get("license"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String license; + private String project; + + public String getLicense() { + return license; + } + public String getProject() { + return project; + } + + public Builder setLicense(String license) { + this.license = license; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (LicenseName licenseName) { + license = licenseName.license; + project = licenseName.project; + } + + public LicenseName build() { + return new LicenseName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "license", license, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LicenseName) { + LicenseName that = (LicenseName) o; + return + Objects.equals(this.license, that.getLicense()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + license, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java new file mode 100644 index 000000000000..eee7428ad7ff --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListAddressesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListAddressesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListAddressesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListAddressesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListAddressesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListAddressesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListAddressesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListAddressesHttpRequest other) { + if (other == ListAddressesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListAddressesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListAddressesHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListAddressesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListAddressesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListAddressesHttpRequest) { + ListAddressesHttpRequest that = (ListAddressesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java new file mode 100644 index 000000000000..0840b48beb4c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListAutoscalersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListAutoscalersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListAutoscalersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListAutoscalersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListAutoscalersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListAutoscalersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListAutoscalersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListAutoscalersHttpRequest other) { + if (other == ListAutoscalersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListAutoscalersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListAutoscalersHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListAutoscalersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListAutoscalersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListAutoscalersHttpRequest) { + ListAutoscalersHttpRequest that = (ListAutoscalersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java new file mode 100644 index 000000000000..dffd8c704b48 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListBackendServicesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListBackendServicesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListBackendServicesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListBackendServicesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListBackendServicesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListBackendServicesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListBackendServicesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListBackendServicesHttpRequest other) { + if (other == ListBackendServicesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListBackendServicesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListBackendServicesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListBackendServicesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListBackendServicesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListBackendServicesHttpRequest) { + ListBackendServicesHttpRequest that = (ListBackendServicesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java new file mode 100644 index 000000000000..359256b1b022 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListDiskTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListDiskTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListDiskTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListDiskTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListDiskTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListDiskTypesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListDiskTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListDiskTypesHttpRequest other) { + if (other == ListDiskTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListDiskTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListDiskTypesHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListDiskTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListDiskTypesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListDiskTypesHttpRequest) { + ListDiskTypesHttpRequest that = (ListDiskTypesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java new file mode 100644 index 000000000000..be037e5275d0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListDisksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListDisksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListDisksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListDisksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListDisksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListDisksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListDisksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListDisksHttpRequest other) { + if (other == ListDisksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListDisksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListDisksHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListDisksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListDisksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListDisksHttpRequest) { + ListDisksHttpRequest that = (ListDisksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java new file mode 100644 index 000000000000..d51a138ced6f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListFirewallsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListFirewallsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListFirewallsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListFirewallsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListFirewallsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListFirewallsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListFirewallsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListFirewallsHttpRequest other) { + if (other == ListFirewallsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListFirewallsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListFirewallsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListFirewallsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListFirewallsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListFirewallsHttpRequest) { + ListFirewallsHttpRequest that = (ListFirewallsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java new file mode 100644 index 000000000000..fa7f0f9e03f9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListForwardingRulesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListForwardingRulesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListForwardingRulesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListForwardingRulesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListForwardingRulesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListForwardingRulesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListForwardingRulesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListForwardingRulesHttpRequest other) { + if (other == ListForwardingRulesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListForwardingRulesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListForwardingRulesHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListForwardingRulesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListForwardingRulesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListForwardingRulesHttpRequest) { + ListForwardingRulesHttpRequest that = (ListForwardingRulesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java new file mode 100644 index 000000000000..554668907450 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListGlobalAddressesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListGlobalAddressesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListGlobalAddressesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListGlobalAddressesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListGlobalAddressesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListGlobalAddressesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListGlobalAddressesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListGlobalAddressesHttpRequest other) { + if (other == ListGlobalAddressesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListGlobalAddressesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListGlobalAddressesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListGlobalAddressesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListGlobalAddressesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListGlobalAddressesHttpRequest) { + ListGlobalAddressesHttpRequest that = (ListGlobalAddressesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java new file mode 100644 index 000000000000..06b0a928143c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListGlobalForwardingRulesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListGlobalForwardingRulesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListGlobalForwardingRulesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListGlobalForwardingRulesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListGlobalForwardingRulesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListGlobalForwardingRulesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListGlobalForwardingRulesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListGlobalForwardingRulesHttpRequest other) { + if (other == ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListGlobalForwardingRulesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListGlobalForwardingRulesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListGlobalForwardingRulesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListGlobalForwardingRulesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListGlobalForwardingRulesHttpRequest) { + ListGlobalForwardingRulesHttpRequest that = (ListGlobalForwardingRulesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java new file mode 100644 index 000000000000..99c9f5c16299 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListGlobalOperationsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListGlobalOperationsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListGlobalOperationsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListGlobalOperationsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListGlobalOperationsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListGlobalOperationsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListGlobalOperationsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListGlobalOperationsHttpRequest other) { + if (other == ListGlobalOperationsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListGlobalOperationsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListGlobalOperationsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListGlobalOperationsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListGlobalOperationsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListGlobalOperationsHttpRequest) { + ListGlobalOperationsHttpRequest that = (ListGlobalOperationsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java new file mode 100644 index 000000000000..a2d542bd77c0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListHealthChecksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListHealthChecksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListHealthChecksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListHealthChecksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListHealthChecksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListHealthChecksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListHealthChecksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListHealthChecksHttpRequest other) { + if (other == ListHealthChecksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListHealthChecksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListHealthChecksHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListHealthChecksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListHealthChecksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListHealthChecksHttpRequest) { + ListHealthChecksHttpRequest that = (ListHealthChecksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java new file mode 100644 index 000000000000..7da5e9349dfb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListHttpHealthChecksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListHttpHealthChecksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListHttpHealthChecksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListHttpHealthChecksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListHttpHealthChecksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListHttpHealthChecksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListHttpHealthChecksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListHttpHealthChecksHttpRequest other) { + if (other == ListHttpHealthChecksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListHttpHealthChecksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListHttpHealthChecksHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListHttpHealthChecksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListHttpHealthChecksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListHttpHealthChecksHttpRequest) { + ListHttpHealthChecksHttpRequest that = (ListHttpHealthChecksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java new file mode 100644 index 000000000000..cf63c6ff93e2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListHttpsHealthChecksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListHttpsHealthChecksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListHttpsHealthChecksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListHttpsHealthChecksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListHttpsHealthChecksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListHttpsHealthChecksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListHttpsHealthChecksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListHttpsHealthChecksHttpRequest other) { + if (other == ListHttpsHealthChecksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListHttpsHealthChecksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListHttpsHealthChecksHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListHttpsHealthChecksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListHttpsHealthChecksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListHttpsHealthChecksHttpRequest) { + ListHttpsHealthChecksHttpRequest that = (ListHttpsHealthChecksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java new file mode 100644 index 000000000000..709cda218261 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListImagesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListImagesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListImagesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListImagesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListImagesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListImagesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListImagesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListImagesHttpRequest other) { + if (other == ListImagesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListImagesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListImagesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListImagesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListImagesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListImagesHttpRequest) { + ListImagesHttpRequest that = (ListImagesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java new file mode 100644 index 000000000000..fc05960c2259 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInstanceGroupManagersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListInstanceGroupManagersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListInstanceGroupManagersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInstanceGroupManagersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInstanceGroupManagersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInstanceGroupManagersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListInstanceGroupManagersHttpRequest other) { + if (other == ListInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListInstanceGroupManagersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListInstanceGroupManagersHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInstanceGroupManagersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInstanceGroupManagersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInstanceGroupManagersHttpRequest) { + ListInstanceGroupManagersHttpRequest that = (ListInstanceGroupManagersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java new file mode 100644 index 000000000000..37f448462625 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInstanceGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListInstanceGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListInstanceGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInstanceGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInstanceGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInstanceGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListInstanceGroupsHttpRequest other) { + if (other == ListInstanceGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListInstanceGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListInstanceGroupsHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInstanceGroupsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInstanceGroupsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInstanceGroupsHttpRequest) { + ListInstanceGroupsHttpRequest that = (ListInstanceGroupsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java new file mode 100644 index 000000000000..bd982d36bd7a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInstanceTemplatesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListInstanceTemplatesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListInstanceTemplatesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInstanceTemplatesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInstanceTemplatesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInstanceTemplatesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInstanceTemplatesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListInstanceTemplatesHttpRequest other) { + if (other == ListInstanceTemplatesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListInstanceTemplatesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListInstanceTemplatesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInstanceTemplatesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInstanceTemplatesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInstanceTemplatesHttpRequest) { + ListInstanceTemplatesHttpRequest that = (ListInstanceTemplatesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java new file mode 100644 index 000000000000..689cf32dbe6d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInstancesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListInstancesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListInstancesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInstancesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInstancesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInstancesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInstancesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListInstancesHttpRequest other) { + if (other == ListInstancesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListInstancesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListInstancesHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInstancesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInstancesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInstancesHttpRequest) { + ListInstancesHttpRequest that = (ListInstancesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java new file mode 100644 index 000000000000..8ce925c89077 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java @@ -0,0 +1,577 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInstancesInstanceGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String instanceGroup; + private final InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ListInstancesInstanceGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.instanceGroup = null; + this.instanceGroupsListInstancesRequestResource = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListInstancesInstanceGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String instanceGroup, + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.instanceGroup = instanceGroup; + this.instanceGroupsListInstancesRequestResource = instanceGroupsListInstancesRequestResource; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsListInstancesRequestResource") && instanceGroupsListInstancesRequestResource != null) { + fieldMap.put("instanceGroupsListInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("instanceGroupsListInstancesRequestResource")) { + return String.valueOf(instanceGroupsListInstancesRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupsListInstancesRequest getApiMessageRequestBody() { + return instanceGroupsListInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public InstanceGroupsListInstancesRequest getInstanceGroupsListInstancesRequestResource() { + return instanceGroupsListInstancesRequestResource; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInstancesInstanceGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInstancesInstanceGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInstancesInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInstancesInstanceGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String instanceGroup; + private InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { + if (other == ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getInstanceGroupsListInstancesRequestResource() != null) { + this.instanceGroupsListInstancesRequestResource = other.instanceGroupsListInstancesRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListInstancesInstanceGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.instanceGroup = source.instanceGroup; + this.instanceGroupsListInstancesRequestResource = source.instanceGroupsListInstancesRequestResource; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public InstanceGroupsListInstancesRequest getInstanceGroupsListInstancesRequestResource() { + return instanceGroupsListInstancesRequestResource; + } + + public Builder setInstanceGroupsListInstancesRequestResource(InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + this.instanceGroupsListInstancesRequestResource = instanceGroupsListInstancesRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListInstancesInstanceGroupsHttpRequest build() { + String missing = ""; + + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInstancesInstanceGroupsHttpRequest( + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setInstanceGroupsListInstancesRequestResource(this.instanceGroupsListInstancesRequestResource); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInstancesInstanceGroupsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "instanceGroup=" + instanceGroup + ", " + + "instanceGroupsListInstancesRequestResource=" + instanceGroupsListInstancesRequestResource + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInstancesInstanceGroupsHttpRequest) { + ListInstancesInstanceGroupsHttpRequest that = (ListInstancesInstanceGroupsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.instanceGroupsListInstancesRequestResource, that.getInstanceGroupsListInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java new file mode 100644 index 000000000000..fae1f741c2e4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java @@ -0,0 +1,577 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInstancesRegionInstanceGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String instanceGroup; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource; + private final String userIp; + + private ListInstancesRegionInstanceGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.instanceGroup = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupsListInstancesRequestResource = null; + this.userIp = null; + } + + + private ListInstancesRegionInstanceGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String instanceGroup, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.instanceGroup = instanceGroup; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupsListInstancesRequestResource = regionInstanceGroupsListInstancesRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupsListInstancesRequestResource") && regionInstanceGroupsListInstancesRequestResource != null) { + fieldMap.put("regionInstanceGroupsListInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupsListInstancesRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupsListInstancesRequestResource")) { + return String.valueOf(regionInstanceGroupsListInstancesRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupsListInstancesRequest getApiMessageRequestBody() { + return regionInstanceGroupsListInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupsListInstancesRequest getRegionInstanceGroupsListInstancesRequestResource() { + return regionInstanceGroupsListInstancesRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInstancesRegionInstanceGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInstancesRegionInstanceGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInstancesRegionInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInstancesRegionInstanceGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String instanceGroup; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListInstancesRegionInstanceGroupsHttpRequest other) { + if (other == ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupsListInstancesRequestResource() != null) { + this.regionInstanceGroupsListInstancesRequestResource = other.regionInstanceGroupsListInstancesRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListInstancesRegionInstanceGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.instanceGroup = source.instanceGroup; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupsListInstancesRequestResource = source.regionInstanceGroupsListInstancesRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupsListInstancesRequest getRegionInstanceGroupsListInstancesRequestResource() { + return regionInstanceGroupsListInstancesRequestResource; + } + + public Builder setRegionInstanceGroupsListInstancesRequestResource(RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { + this.regionInstanceGroupsListInstancesRequestResource = regionInstanceGroupsListInstancesRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListInstancesRegionInstanceGroupsHttpRequest build() { + String missing = ""; + + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInstancesRegionInstanceGroupsHttpRequest( + access_token, + callback, + fields, + filter, + instanceGroup, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + regionInstanceGroupsListInstancesRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupsListInstancesRequestResource(this.regionInstanceGroupsListInstancesRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInstancesRegionInstanceGroupsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "instanceGroup=" + instanceGroup + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupsListInstancesRequestResource=" + regionInstanceGroupsListInstancesRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInstancesRegionInstanceGroupsHttpRequest) { + ListInstancesRegionInstanceGroupsHttpRequest that = (ListInstancesRegionInstanceGroupsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupsListInstancesRequestResource, that.getRegionInstanceGroupsListInstancesRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + instanceGroup, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + regionInstanceGroupsListInstancesRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java new file mode 100644 index 000000000000..ca62639c1a7f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListMachineTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListMachineTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListMachineTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListMachineTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListMachineTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListMachineTypesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListMachineTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListMachineTypesHttpRequest other) { + if (other == ListMachineTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListMachineTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListMachineTypesHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListMachineTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListMachineTypesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListMachineTypesHttpRequest) { + ListMachineTypesHttpRequest that = (ListMachineTypesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java new file mode 100644 index 000000000000..e1db51e1a4b1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListManagedInstancesInstanceGroupManagersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String instanceGroupManager; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ListManagedInstancesInstanceGroupManagersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.instanceGroupManager = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListManagedInstancesInstanceGroupManagersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String instanceGroupManager, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListManagedInstancesInstanceGroupManagersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListManagedInstancesInstanceGroupManagersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListManagedInstancesInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListManagedInstancesInstanceGroupManagersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String instanceGroupManager; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListManagedInstancesInstanceGroupManagersHttpRequest other) { + if (other == ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListManagedInstancesInstanceGroupManagersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListManagedInstancesInstanceGroupManagersHttpRequest build() { + String missing = ""; + + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListManagedInstancesInstanceGroupManagersHttpRequest( + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListManagedInstancesInstanceGroupManagersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListManagedInstancesInstanceGroupManagersHttpRequest) { + ListManagedInstancesInstanceGroupManagersHttpRequest that = (ListManagedInstancesInstanceGroupManagersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java new file mode 100644 index 000000000000..af2a3b23a7db --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListManagedInstancesRegionInstanceGroupManagersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String instanceGroupManager; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ListManagedInstancesRegionInstanceGroupManagersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.instanceGroupManager = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListManagedInstancesRegionInstanceGroupManagersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String instanceGroupManager, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListManagedInstancesRegionInstanceGroupManagersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListManagedInstancesRegionInstanceGroupManagersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListManagedInstancesRegionInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListManagedInstancesRegionInstanceGroupManagersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String instanceGroupManager; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListManagedInstancesRegionInstanceGroupManagersHttpRequest other) { + if (other == ListManagedInstancesRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListManagedInstancesRegionInstanceGroupManagersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListManagedInstancesRegionInstanceGroupManagersHttpRequest build() { + String missing = ""; + + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListManagedInstancesRegionInstanceGroupManagersHttpRequest( + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListManagedInstancesRegionInstanceGroupManagersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListManagedInstancesRegionInstanceGroupManagersHttpRequest) { + ListManagedInstancesRegionInstanceGroupManagersHttpRequest that = (ListManagedInstancesRegionInstanceGroupManagersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java new file mode 100644 index 000000000000..a042b64daca9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListNetworksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListNetworksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListNetworksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListNetworksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListNetworksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListNetworksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListNetworksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListNetworksHttpRequest other) { + if (other == ListNetworksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListNetworksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListNetworksHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListNetworksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListNetworksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListNetworksHttpRequest) { + ListNetworksHttpRequest that = (ListNetworksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java new file mode 100644 index 000000000000..fe7547813893 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionAutoscalersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionAutoscalersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRegionAutoscalersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionAutoscalersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionAutoscalersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionAutoscalersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionAutoscalersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionAutoscalersHttpRequest other) { + if (other == ListRegionAutoscalersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionAutoscalersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionAutoscalersHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionAutoscalersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionAutoscalersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionAutoscalersHttpRequest) { + ListRegionAutoscalersHttpRequest that = (ListRegionAutoscalersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java new file mode 100644 index 000000000000..d80fd2babb50 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionBackendServicesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionBackendServicesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRegionBackendServicesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionBackendServicesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionBackendServicesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionBackendServicesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionBackendServicesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionBackendServicesHttpRequest other) { + if (other == ListRegionBackendServicesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionBackendServicesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionBackendServicesHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionBackendServicesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionBackendServicesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionBackendServicesHttpRequest) { + ListRegionBackendServicesHttpRequest that = (ListRegionBackendServicesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java new file mode 100644 index 000000000000..cd58b0310b81 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionInstanceGroupManagersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionInstanceGroupManagersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRegionInstanceGroupManagersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionInstanceGroupManagersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionInstanceGroupManagersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionInstanceGroupManagersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionInstanceGroupManagersHttpRequest other) { + if (other == ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionInstanceGroupManagersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionInstanceGroupManagersHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionInstanceGroupManagersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionInstanceGroupManagersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionInstanceGroupManagersHttpRequest) { + ListRegionInstanceGroupManagersHttpRequest that = (ListRegionInstanceGroupManagersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java new file mode 100644 index 000000000000..a9a73a4bcd3d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionInstanceGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionInstanceGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRegionInstanceGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionInstanceGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionInstanceGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionInstanceGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionInstanceGroupsHttpRequest other) { + if (other == ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionInstanceGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionInstanceGroupsHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionInstanceGroupsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionInstanceGroupsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionInstanceGroupsHttpRequest) { + ListRegionInstanceGroupsHttpRequest that = (ListRegionInstanceGroupsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java new file mode 100644 index 000000000000..d5ac4a3a9c94 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionOperationsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionOperationsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRegionOperationsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionOperationsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionOperationsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionOperationsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionOperationsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionOperationsHttpRequest other) { + if (other == ListRegionOperationsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionOperationsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionOperationsHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionOperationsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionOperationsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionOperationsHttpRequest) { + ListRegionOperationsHttpRequest that = (ListRegionOperationsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java new file mode 100644 index 000000000000..5a6b9b5b0170 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListRegionsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListRegionsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionsHttpRequest other) { + if (other == ListRegionsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionsHttpRequest) { + ListRegionsHttpRequest that = (ListRegionsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java new file mode 100644 index 000000000000..716360bfb585 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRoutersHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRoutersHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRoutersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRoutersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRoutersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRoutersHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRoutersHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRoutersHttpRequest other) { + if (other == ListRoutersHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRoutersHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRoutersHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRoutersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRoutersHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRoutersHttpRequest) { + ListRoutersHttpRequest that = (ListRoutersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java new file mode 100644 index 000000000000..0f1402be0cd4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRoutesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListRoutesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListRoutesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRoutesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRoutesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRoutesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRoutesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRoutesHttpRequest other) { + if (other == ListRoutesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRoutesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRoutesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRoutesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRoutesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRoutesHttpRequest) { + ListRoutesHttpRequest that = (ListRoutesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java new file mode 100644 index 000000000000..469f4f722d02 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListSnapshotsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListSnapshotsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListSnapshotsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListSnapshotsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListSnapshotsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListSnapshotsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListSnapshotsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListSnapshotsHttpRequest other) { + if (other == ListSnapshotsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListSnapshotsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListSnapshotsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListSnapshotsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListSnapshotsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListSnapshotsHttpRequest) { + ListSnapshotsHttpRequest that = (ListSnapshotsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java new file mode 100644 index 000000000000..511de85bfd2a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListSslCertificatesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListSslCertificatesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListSslCertificatesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListSslCertificatesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListSslCertificatesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListSslCertificatesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListSslCertificatesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListSslCertificatesHttpRequest other) { + if (other == ListSslCertificatesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListSslCertificatesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListSslCertificatesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListSslCertificatesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListSslCertificatesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListSslCertificatesHttpRequest) { + ListSslCertificatesHttpRequest that = (ListSslCertificatesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java new file mode 100644 index 000000000000..72fccac743d5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListSubnetworksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListSubnetworksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListSubnetworksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListSubnetworksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListSubnetworksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListSubnetworksHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListSubnetworksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListSubnetworksHttpRequest other) { + if (other == ListSubnetworksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListSubnetworksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListSubnetworksHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListSubnetworksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListSubnetworksHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListSubnetworksHttpRequest) { + ListSubnetworksHttpRequest that = (ListSubnetworksHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java new file mode 100644 index 000000000000..ad3429da957d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetHttpProxiesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListTargetHttpProxiesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListTargetHttpProxiesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetHttpProxiesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetHttpProxiesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetHttpProxiesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetHttpProxiesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListTargetHttpProxiesHttpRequest other) { + if (other == ListTargetHttpProxiesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListTargetHttpProxiesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListTargetHttpProxiesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetHttpProxiesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetHttpProxiesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetHttpProxiesHttpRequest) { + ListTargetHttpProxiesHttpRequest that = (ListTargetHttpProxiesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java new file mode 100644 index 000000000000..7d0d7cdadfbf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetHttpsProxiesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListTargetHttpsProxiesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListTargetHttpsProxiesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetHttpsProxiesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetHttpsProxiesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetHttpsProxiesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetHttpsProxiesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListTargetHttpsProxiesHttpRequest other) { + if (other == ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListTargetHttpsProxiesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListTargetHttpsProxiesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetHttpsProxiesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetHttpsProxiesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetHttpsProxiesHttpRequest) { + ListTargetHttpsProxiesHttpRequest that = (ListTargetHttpsProxiesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java new file mode 100644 index 000000000000..53709f611142 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetInstancesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListTargetInstancesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListTargetInstancesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetInstancesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetInstancesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetInstancesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetInstancesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListTargetInstancesHttpRequest other) { + if (other == ListTargetInstancesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListTargetInstancesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListTargetInstancesHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetInstancesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetInstancesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetInstancesHttpRequest) { + ListTargetInstancesHttpRequest that = (ListTargetInstancesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java new file mode 100644 index 000000000000..15f3b3fc6c72 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetPoolsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListTargetPoolsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListTargetPoolsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetPoolsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetPoolsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetPoolsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetPoolsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListTargetPoolsHttpRequest other) { + if (other == ListTargetPoolsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListTargetPoolsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListTargetPoolsHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetPoolsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetPoolsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetPoolsHttpRequest) { + ListTargetPoolsHttpRequest that = (ListTargetPoolsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java new file mode 100644 index 000000000000..ae290b934b14 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetSslProxiesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListTargetSslProxiesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListTargetSslProxiesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetSslProxiesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetSslProxiesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetSslProxiesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetSslProxiesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListTargetSslProxiesHttpRequest other) { + if (other == ListTargetSslProxiesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListTargetSslProxiesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListTargetSslProxiesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetSslProxiesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetSslProxiesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetSslProxiesHttpRequest) { + ListTargetSslProxiesHttpRequest that = (ListTargetSslProxiesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java new file mode 100644 index 000000000000..8916ab7b9b5b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetVpnGatewaysHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListTargetVpnGatewaysHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListTargetVpnGatewaysHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetVpnGatewaysHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetVpnGatewaysHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetVpnGatewaysHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetVpnGatewaysHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListTargetVpnGatewaysHttpRequest other) { + if (other == ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListTargetVpnGatewaysHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListTargetVpnGatewaysHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetVpnGatewaysHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetVpnGatewaysHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetVpnGatewaysHttpRequest) { + ListTargetVpnGatewaysHttpRequest that = (ListTargetVpnGatewaysHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java new file mode 100644 index 000000000000..7cc5342dd488 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListUrlMapsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListUrlMapsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListUrlMapsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListUrlMapsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListUrlMapsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListUrlMapsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListUrlMapsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListUrlMapsHttpRequest other) { + if (other == ListUrlMapsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListUrlMapsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListUrlMapsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListUrlMapsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListUrlMapsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListUrlMapsHttpRequest) { + ListUrlMapsHttpRequest that = (ListUrlMapsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java new file mode 100644 index 000000000000..56b33e876276 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListVpnTunnelsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListVpnTunnelsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListVpnTunnelsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListVpnTunnelsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListVpnTunnelsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListVpnTunnelsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListVpnTunnelsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListVpnTunnelsHttpRequest other) { + if (other == ListVpnTunnelsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListVpnTunnelsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListVpnTunnelsHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListVpnTunnelsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListVpnTunnelsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListVpnTunnelsHttpRequest) { + ListVpnTunnelsHttpRequest that = (ListVpnTunnelsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java new file mode 100644 index 000000000000..8289de971b9c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListZoneOperationsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListZoneOperationsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListZoneOperationsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListZoneOperationsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListZoneOperationsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListZoneOperationsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListZoneOperationsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListZoneOperationsHttpRequest other) { + if (other == ListZoneOperationsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListZoneOperationsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListZoneOperationsHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListZoneOperationsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListZoneOperationsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListZoneOperationsHttpRequest) { + ListZoneOperationsHttpRequest that = (ListZoneOperationsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java new file mode 100644 index 000000000000..469fbc73477c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListZonesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListZonesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListZonesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListZonesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListZonesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListZonesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListZonesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListZonesHttpRequest other) { + if (other == ListZonesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListZonesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListZonesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListZonesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListZonesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListZonesHttpRequest) { + ListZonesHttpRequest that = (ListZonesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java new file mode 100644 index 000000000000..002ca334dc5e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java @@ -0,0 +1,650 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class MachineType implements ApiMessage { + private final String creationTimestamp; + private final DeprecationStatus deprecated; + private final String description; + private final Integer guestCpus; + private final String id; + private final Integer imageSpaceGb; + private final Boolean isSharedCpu; + private final String kind; + private final Integer maximumPersistentDisks; + private final String maximumPersistentDisksSizeGb; + private final Integer memoryMb; + private final String name; + private final List scratchDisks; + private final String selfLink; + private final String zone; + + private MachineType() { + this.creationTimestamp = null; + this.deprecated = null; + this.description = null; + this.guestCpus = null; + this.id = null; + this.imageSpaceGb = null; + this.isSharedCpu = null; + this.kind = null; + this.maximumPersistentDisks = null; + this.maximumPersistentDisksSizeGb = null; + this.memoryMb = null; + this.name = null; + this.scratchDisks = null; + this.selfLink = null; + this.zone = null; + } + + + private MachineType( + String creationTimestamp, + DeprecationStatus deprecated, + String description, + Integer guestCpus, + String id, + Integer imageSpaceGb, + Boolean isSharedCpu, + String kind, + Integer maximumPersistentDisks, + String maximumPersistentDisksSizeGb, + Integer memoryMb, + String name, + List scratchDisks, + String selfLink, + String zone + ) { + this.creationTimestamp = creationTimestamp; + this.deprecated = deprecated; + this.description = description; + this.guestCpus = guestCpus; + this.id = id; + this.imageSpaceGb = imageSpaceGb; + this.isSharedCpu = isSharedCpu; + this.kind = kind; + this.maximumPersistentDisks = maximumPersistentDisks; + this.maximumPersistentDisksSizeGb = maximumPersistentDisksSizeGb; + this.memoryMb = memoryMb; + this.name = name; + this.scratchDisks = scratchDisks; + this.selfLink = selfLink; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("guestCpus") && guestCpus != null) { + fieldMap.put("guestCpus", Collections.singletonList(String.valueOf(guestCpus))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("imageSpaceGb") && imageSpaceGb != null) { + fieldMap.put("imageSpaceGb", Collections.singletonList(String.valueOf(imageSpaceGb))); + } + if (fieldNames.contains("isSharedCpu") && isSharedCpu != null) { + fieldMap.put("isSharedCpu", Collections.singletonList(String.valueOf(isSharedCpu))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("maximumPersistentDisks") && maximumPersistentDisks != null) { + fieldMap.put("maximumPersistentDisks", Collections.singletonList(String.valueOf(maximumPersistentDisks))); + } + if (fieldNames.contains("maximumPersistentDisksSizeGb") && maximumPersistentDisksSizeGb != null) { + fieldMap.put("maximumPersistentDisksSizeGb", Collections.singletonList(String.valueOf(maximumPersistentDisksSizeGb))); + } + if (fieldNames.contains("memoryMb") && memoryMb != null) { + fieldMap.put("memoryMb", Collections.singletonList(String.valueOf(memoryMb))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("scratchDisks") && scratchDisks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ScratchDisks item : scratchDisks) { + stringList.add(item.toString()); + } + fieldMap.put("scratchDisks", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("guestCpus")) { + return String.valueOf(guestCpus); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("imageSpaceGb")) { + return String.valueOf(imageSpaceGb); + } + if (fieldName.equals("isSharedCpu")) { + return String.valueOf(isSharedCpu); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("maximumPersistentDisks")) { + return String.valueOf(maximumPersistentDisks); + } + if (fieldName.equals("maximumPersistentDisksSizeGb")) { + return String.valueOf(maximumPersistentDisksSizeGb); + } + if (fieldName.equals("memoryMb")) { + return String.valueOf(memoryMb); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("scratchDisks")) { + return String.valueOf(scratchDisks); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public Integer getGuestCpus() { + return guestCpus; + } + + public String getId() { + return id; + } + + public Integer getImageSpaceGb() { + return imageSpaceGb; + } + + public Boolean getIsSharedCpu() { + return isSharedCpu; + } + + public String getKind() { + return kind; + } + + public Integer getMaximumPersistentDisks() { + return maximumPersistentDisks; + } + + public String getMaximumPersistentDisksSizeGb() { + return maximumPersistentDisksSizeGb; + } + + public Integer getMemoryMb() { + return memoryMb; + } + + public String getName() { + return name; + } + + public List getScratchDisksList() { + return scratchDisks; + } + + public String getSelfLink() { + return selfLink; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MachineType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static MachineType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final MachineType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MachineType(); + } + + public static class Builder { + private String creationTimestamp; + private DeprecationStatus deprecated; + private String description; + private Integer guestCpus; + private String id; + private Integer imageSpaceGb; + private Boolean isSharedCpu; + private String kind; + private Integer maximumPersistentDisks; + private String maximumPersistentDisksSizeGb; + private Integer memoryMb; + private String name; + private List scratchDisks; + private String selfLink; + private String zone; + + Builder() {} + + public Builder mergeFrom(MachineType other) { + if (other == MachineType.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getGuestCpus() != null) { + this.guestCpus = other.guestCpus; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getImageSpaceGb() != null) { + this.imageSpaceGb = other.imageSpaceGb; + } + if (other.getIsSharedCpu() != null) { + this.isSharedCpu = other.isSharedCpu; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getMaximumPersistentDisks() != null) { + this.maximumPersistentDisks = other.maximumPersistentDisks; + } + if (other.getMaximumPersistentDisksSizeGb() != null) { + this.maximumPersistentDisksSizeGb = other.maximumPersistentDisksSizeGb; + } + if (other.getMemoryMb() != null) { + this.memoryMb = other.memoryMb; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getScratchDisksList() != null) { + this.scratchDisks = other.scratchDisks; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(MachineType source) { + this.creationTimestamp = source.creationTimestamp; + this.deprecated = source.deprecated; + this.description = source.description; + this.guestCpus = source.guestCpus; + this.id = source.id; + this.imageSpaceGb = source.imageSpaceGb; + this.isSharedCpu = source.isSharedCpu; + this.kind = source.kind; + this.maximumPersistentDisks = source.maximumPersistentDisks; + this.maximumPersistentDisksSizeGb = source.maximumPersistentDisksSizeGb; + this.memoryMb = source.memoryMb; + this.name = source.name; + this.scratchDisks = source.scratchDisks; + this.selfLink = source.selfLink; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getGuestCpus() { + return guestCpus; + } + + public Builder setGuestCpus(Integer guestCpus) { + this.guestCpus = guestCpus; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Integer getImageSpaceGb() { + return imageSpaceGb; + } + + public Builder setImageSpaceGb(Integer imageSpaceGb) { + this.imageSpaceGb = imageSpaceGb; + return this; + } + + public Boolean getIsSharedCpu() { + return isSharedCpu; + } + + public Builder setIsSharedCpu(Boolean isSharedCpu) { + this.isSharedCpu = isSharedCpu; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public Integer getMaximumPersistentDisks() { + return maximumPersistentDisks; + } + + public Builder setMaximumPersistentDisks(Integer maximumPersistentDisks) { + this.maximumPersistentDisks = maximumPersistentDisks; + return this; + } + + public String getMaximumPersistentDisksSizeGb() { + return maximumPersistentDisksSizeGb; + } + + public Builder setMaximumPersistentDisksSizeGb(String maximumPersistentDisksSizeGb) { + this.maximumPersistentDisksSizeGb = maximumPersistentDisksSizeGb; + return this; + } + + public Integer getMemoryMb() { + return memoryMb; + } + + public Builder setMemoryMb(Integer memoryMb) { + this.memoryMb = memoryMb; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getScratchDisksList() { + return scratchDisks; + } + + public Builder addAllScratchDisks(List scratchDisks) { + if (this.scratchDisks == null) { + this.scratchDisks = new ArrayList<>(scratchDisks.size()); + } + this.scratchDisks.addAll(scratchDisks); + return this; + } + + public Builder addScratchDisks(ScratchDisks scratchDisks) { + this.scratchDisks.add(scratchDisks); + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public MachineType build() { + + + + + + + + + + + + + + + return new MachineType( + creationTimestamp, + deprecated, + description, + guestCpus, + id, + imageSpaceGb, + isSharedCpu, + kind, + maximumPersistentDisks, + maximumPersistentDisksSizeGb, + memoryMb, + name, + scratchDisks, + selfLink, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setGuestCpus(this.guestCpus); + newBuilder.setId(this.id); + newBuilder.setImageSpaceGb(this.imageSpaceGb); + newBuilder.setIsSharedCpu(this.isSharedCpu); + newBuilder.setKind(this.kind); + newBuilder.setMaximumPersistentDisks(this.maximumPersistentDisks); + newBuilder.setMaximumPersistentDisksSizeGb(this.maximumPersistentDisksSizeGb); + newBuilder.setMemoryMb(this.memoryMb); + newBuilder.setName(this.name); + newBuilder.addAllScratchDisks(this.scratchDisks); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "MachineType{" + + "creationTimestamp=" + creationTimestamp + ", " + + "deprecated=" + deprecated + ", " + + "description=" + description + ", " + + "guestCpus=" + guestCpus + ", " + + "id=" + id + ", " + + "imageSpaceGb=" + imageSpaceGb + ", " + + "isSharedCpu=" + isSharedCpu + ", " + + "kind=" + kind + ", " + + "maximumPersistentDisks=" + maximumPersistentDisks + ", " + + "maximumPersistentDisksSizeGb=" + maximumPersistentDisksSizeGb + ", " + + "memoryMb=" + memoryMb + ", " + + "name=" + name + ", " + + "scratchDisks=" + scratchDisks + ", " + + "selfLink=" + selfLink + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MachineType) { + MachineType that = (MachineType) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.guestCpus, that.getGuestCpus()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.imageSpaceGb, that.getImageSpaceGb()) && + Objects.equals(this.isSharedCpu, that.getIsSharedCpu()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.maximumPersistentDisks, that.getMaximumPersistentDisks()) && + Objects.equals(this.maximumPersistentDisksSizeGb, that.getMaximumPersistentDisksSizeGb()) && + Objects.equals(this.memoryMb, that.getMemoryMb()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.scratchDisks, that.getScratchDisksList()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + deprecated, + description, + guestCpus, + id, + imageSpaceGb, + isSharedCpu, + kind, + maximumPersistentDisks, + maximumPersistentDisksSizeGb, + memoryMb, + name, + scratchDisks, + selfLink, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java new file mode 100644 index 000000000000..fb8a996d11e1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class MachineTypeAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private MachineTypeAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private MachineTypeAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MachineTypeAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static MachineTypeAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final MachineTypeAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MachineTypeAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(MachineTypeAggregatedList other) { + if (other == MachineTypeAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(MachineTypeAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public MachineTypeAggregatedList build() { + + + + + return new MachineTypeAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "MachineTypeAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MachineTypeAggregatedList) { + MachineTypeAggregatedList that = (MachineTypeAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java new file mode 100644 index 000000000000..b3a500027885 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java @@ -0,0 +1,736 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.MachineTypeStub; +import com.google.cloud.compute.v1.stub.MachineTypeStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+ *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+ *   MachineType response = machineTypeClient.getMachineType(machineType);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the machineTypeClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of MachineTypeSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * MachineTypeSettings machineTypeSettings =
+ *     MachineTypeSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MachineTypeClient machineTypeClient =
+ *     MachineTypeClient.create(machineTypeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * MachineTypeSettings machineTypeSettings =
+ *     MachineTypeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MachineTypeClient machineTypeClient =
+ *     MachineTypeClient.create(machineTypeSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class MachineTypeClient implements BackgroundResource { + private final MachineTypeSettings settings; + private final MachineTypeStub stub; + + + + /** + * Constructs an instance of MachineTypeClient with default settings. + */ + public static final MachineTypeClient create() throws IOException { + return create(MachineTypeSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MachineTypeClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final MachineTypeClient create(MachineTypeSettings settings) throws IOException { + return new MachineTypeClient(settings); + } + + /** + * Constructs an instance of MachineTypeClient, using the given stub for making calls. This is for + * advanced usage - prefer to use MachineTypeSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final MachineTypeClient create(MachineTypeStub stub) { + return new MachineTypeClient(stub); + } + + /** + * Constructs an instance of MachineTypeClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected MachineTypeClient(MachineTypeSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MachineTypeStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected MachineTypeClient(MachineTypeStub stub) { + this.settings = null; + this.stub = stub; + } + + public final MachineTypeSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public MachineTypeStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of machine types. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (MachineTypesScopedList element : machineTypeClient.aggregatedListMachineTypes(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(ProjectName project) { + AggregatedListMachineTypesHttpRequest request = + AggregatedListMachineTypesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListMachineTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of machine types. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (MachineTypesScopedList element : machineTypeClient.aggregatedListMachineTypes(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(String project) { + AggregatedListMachineTypesHttpRequest request = + AggregatedListMachineTypesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListMachineTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of machine types. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListMachineTypesHttpRequest request = AggregatedListMachineTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (MachineTypesScopedList element : machineTypeClient.aggregatedListMachineTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(AggregatedListMachineTypesHttpRequest request) { + return aggregatedListMachineTypesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of machine types. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListMachineTypesHttpRequest request = AggregatedListMachineTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListMachineTypesPagedResponse> future = machineTypeClient.aggregatedListMachineTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (MachineTypesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListMachineTypesPagedCallable() { + return stub.aggregatedListMachineTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of machine types. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListMachineTypesHttpRequest request = AggregatedListMachineTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     MachineTypeAggregatedList response = machineTypeClient.aggregatedListMachineTypesCallable().call(request);
+   *     for (MachineTypesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListMachineTypesCallable() { + return stub.aggregatedListMachineTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified machine type. Get a list of available machine types by making a list() request. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   MachineType response = machineTypeClient.getMachineType(machineType);
+   * }
+   * 
+ * + * @param machineType Name of the machine type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final MachineType getMachineType(MachineTypeName machineType) { + + GetMachineTypeHttpRequest request = + GetMachineTypeHttpRequest.newBuilder() + .setMachineType(machineType == null ? null : machineType.toString()) + .build(); + return getMachineType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified machine type. Get a list of available machine types by making a list() request. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   MachineType response = machineTypeClient.getMachineType(machineType.toString());
+   * }
+   * 
+ * + * @param machineType Name of the machine type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final MachineType getMachineType(String machineType) { + + GetMachineTypeHttpRequest request = + GetMachineTypeHttpRequest.newBuilder() + .setMachineType(machineType) + .build(); + return getMachineType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified machine type. Get a list of available machine types by making a list() request. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   GetMachineTypeHttpRequest request = GetMachineTypeHttpRequest.newBuilder()
+   *     .setMachineType(machineType.toString())
+   *     .build();
+   *   MachineType response = machineTypeClient.getMachineType(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final MachineType getMachineType(GetMachineTypeHttpRequest request) { + return getMachineTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified machine type. Get a list of available machine types by making a list() request. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   GetMachineTypeHttpRequest request = GetMachineTypeHttpRequest.newBuilder()
+   *     .setMachineType(machineType.toString())
+   *     .build();
+   *   ApiFuture<MachineType> future = machineTypeClient.getMachineTypeCallable().futureCall(request);
+   *   // Do something
+   *   MachineType response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getMachineTypeCallable() { + return stub.getMachineTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of machine types available to the specified project. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (MachineType element : machineTypeClient.listMachineTypes(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListMachineTypesPagedResponse listMachineTypes(ZoneName zone) { + ListMachineTypesHttpRequest request = + ListMachineTypesHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listMachineTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of machine types available to the specified project. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (MachineType element : machineTypeClient.listMachineTypes(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListMachineTypesPagedResponse listMachineTypes(String zone) { + ListMachineTypesHttpRequest request = + ListMachineTypesHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listMachineTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of machine types available to the specified project. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListMachineTypesHttpRequest request = ListMachineTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (MachineType element : machineTypeClient.listMachineTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListMachineTypesPagedResponse listMachineTypes(ListMachineTypesHttpRequest request) { + return listMachineTypesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of machine types available to the specified project. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListMachineTypesHttpRequest request = ListMachineTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListMachineTypesPagedResponse> future = machineTypeClient.listMachineTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (MachineType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listMachineTypesPagedCallable() { + return stub.listMachineTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of machine types available to the specified project. + * + * Sample code: + *

+   * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListMachineTypesHttpRequest request = ListMachineTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     MachineTypeList response = machineTypeClient.listMachineTypesCallable().call(request);
+   *     for (MachineType element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listMachineTypesCallable() { + return stub.listMachineTypesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListMachineTypesPagedResponse extends AbstractPagedListResponse< + AggregatedListMachineTypesHttpRequest, + MachineTypeAggregatedList, + MachineTypesScopedList, + AggregatedListMachineTypesPage, + AggregatedListMachineTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListMachineTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListMachineTypesPagedResponse apply(AggregatedListMachineTypesPage input) { + return new AggregatedListMachineTypesPagedResponse(input); + } + }); + } + + private AggregatedListMachineTypesPagedResponse(AggregatedListMachineTypesPage page) { + super(page, AggregatedListMachineTypesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListMachineTypesPage extends AbstractPage< + AggregatedListMachineTypesHttpRequest, + MachineTypeAggregatedList, + MachineTypesScopedList, + AggregatedListMachineTypesPage> { + + private AggregatedListMachineTypesPage( + PageContext context, + MachineTypeAggregatedList response) { + super(context, response); + } + + private static AggregatedListMachineTypesPage createEmptyPage() { + return new AggregatedListMachineTypesPage(null, null); + } + + @Override + protected AggregatedListMachineTypesPage createPage( + PageContext context, + MachineTypeAggregatedList response) { + return new AggregatedListMachineTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListMachineTypesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListMachineTypesHttpRequest, + MachineTypeAggregatedList, + MachineTypesScopedList, + AggregatedListMachineTypesPage, + AggregatedListMachineTypesFixedSizeCollection> { + + private AggregatedListMachineTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListMachineTypesFixedSizeCollection createEmptyCollection() { + return new AggregatedListMachineTypesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListMachineTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListMachineTypesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListMachineTypesPagedResponse extends AbstractPagedListResponse< + ListMachineTypesHttpRequest, + MachineTypeList, + MachineType, + ListMachineTypesPage, + ListMachineTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMachineTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListMachineTypesPagedResponse apply(ListMachineTypesPage input) { + return new ListMachineTypesPagedResponse(input); + } + }); + } + + private ListMachineTypesPagedResponse(ListMachineTypesPage page) { + super(page, ListMachineTypesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListMachineTypesPage extends AbstractPage< + ListMachineTypesHttpRequest, + MachineTypeList, + MachineType, + ListMachineTypesPage> { + + private ListMachineTypesPage( + PageContext context, + MachineTypeList response) { + super(context, response); + } + + private static ListMachineTypesPage createEmptyPage() { + return new ListMachineTypesPage(null, null); + } + + @Override + protected ListMachineTypesPage createPage( + PageContext context, + MachineTypeList response) { + return new ListMachineTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListMachineTypesFixedSizeCollection extends AbstractFixedSizeCollection< + ListMachineTypesHttpRequest, + MachineTypeList, + MachineType, + ListMachineTypesPage, + ListMachineTypesFixedSizeCollection> { + + private ListMachineTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMachineTypesFixedSizeCollection createEmptyCollection() { + return new ListMachineTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListMachineTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMachineTypesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java new file mode 100644 index 000000000000..0612fab75dac --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class MachineTypeList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private MachineTypeList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private MachineTypeList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (MachineType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MachineTypeList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static MachineTypeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final MachineTypeList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MachineTypeList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(MachineTypeList other) { + if (other == MachineTypeList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(MachineTypeList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(MachineType items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public MachineTypeList build() { + + + + + return new MachineTypeList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "MachineTypeList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MachineTypeList) { + MachineTypeList that = (MachineTypeList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java new file mode 100644 index 000000000000..4b3308be4210 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class MachineTypeName implements ResourceName { + private final String machineType; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/machineTypes/{machineType}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private MachineTypeName(Builder builder) { + machineType = Preconditions.checkNotNull(builder.getMachineType()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static MachineTypeName of( + String machineType, + String project, + String zone + ) { + return newBuilder() + .setMachineType(machineType) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String machineType, + String project, + String zone + ) { + return of( + machineType, + project, + zone + ) + .toString(); + } + + public String getMachineType() { + return machineType; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("machineType", machineType); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public MachineTypeName parse(String formattedString) {return MachineTypeName.parse(formattedString);} + }; + } + + public static MachineTypeName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "MachineTypeName.parse: formattedString not in valid format"); + return of( + matchMap.get("machineType"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String machineType; + private String project; + private String zone; + + public String getMachineType() { + return machineType; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setMachineType(String machineType) { + this.machineType = machineType; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (MachineTypeName machineTypeName) { + machineType = machineTypeName.machineType; + project = machineTypeName.project; + zone = machineTypeName.zone; + } + + public MachineTypeName build() { + return new MachineTypeName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "machineType", machineType, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MachineTypeName) { + MachineTypeName that = (MachineTypeName) o; + return + Objects.equals(this.machineType, that.getMachineType()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + machineType, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java new file mode 100644 index 000000000000..bd694ff8863d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java @@ -0,0 +1,255 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import com.google.cloud.compute.v1.stub.MachineTypeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link MachineTypeClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getMachineType to 30 seconds: + * + *

+ * 
+ * MachineTypeSettings.Builder machineTypeSettingsBuilder =
+ *     MachineTypeSettings.newBuilder();
+ * machineTypeSettingsBuilder.getMachineTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * MachineTypeSettings machineTypeSettings = machineTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class MachineTypeSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListMachineTypes. + */ + public PagedCallSettings aggregatedListMachineTypesSettings() { + return ((MachineTypeStubSettings) getStubSettings()).aggregatedListMachineTypesSettings(); + } + + /** + * Returns the object with the settings used for calls to getMachineType. + */ + public UnaryCallSettings getMachineTypeSettings() { + return ((MachineTypeStubSettings) getStubSettings()).getMachineTypeSettings(); + } + + /** + * Returns the object with the settings used for calls to listMachineTypes. + */ + public PagedCallSettings listMachineTypesSettings() { + return ((MachineTypeStubSettings) getStubSettings()).listMachineTypesSettings(); + } + + + public static final MachineTypeSettings create(MachineTypeStubSettings stub) throws IOException { + return new MachineTypeSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MachineTypeStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return MachineTypeStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return MachineTypeStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return MachineTypeStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MachineTypeStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return MachineTypeStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MachineTypeStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MachineTypeStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MachineTypeSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for MachineTypeSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(MachineTypeStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(MachineTypeStubSettings.newBuilder()); + } + + protected Builder(MachineTypeSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MachineTypeStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public MachineTypeStubSettings.Builder getStubSettingsBuilder() { + return ((MachineTypeStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListMachineTypes. + */ + public PagedCallSettings.Builder aggregatedListMachineTypesSettings() { + return getStubSettingsBuilder().aggregatedListMachineTypesSettings(); + } + + /** + * Returns the builder for the settings used for calls to getMachineType. + */ + public UnaryCallSettings.Builder getMachineTypeSettings() { + return getStubSettingsBuilder().getMachineTypeSettings(); + } + + /** + * Returns the builder for the settings used for calls to listMachineTypes. + */ + public PagedCallSettings.Builder listMachineTypesSettings() { + return getStubSettingsBuilder().listMachineTypesSettings(); + } + + @Override + public MachineTypeSettings build() throws IOException { + return new MachineTypeSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java new file mode 100644 index 000000000000..93991e33ef6b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class MachineTypesScopedList implements ApiMessage { + private final List machineTypes; + private final Warning warning; + + private MachineTypesScopedList() { + this.machineTypes = null; + this.warning = null; + } + + + private MachineTypesScopedList( + List machineTypes, + Warning warning + ) { + this.machineTypes = machineTypes; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("machineTypes") && machineTypes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (MachineType item : machineTypes) { + stringList.add(item.toString()); + } + fieldMap.put("machineTypes", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("machineTypes")) { + return String.valueOf(machineTypes); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getMachineTypesList() { + return machineTypes; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MachineTypesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static MachineTypesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final MachineTypesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MachineTypesScopedList(); + } + + public static class Builder { + private List machineTypes; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(MachineTypesScopedList other) { + if (other == MachineTypesScopedList.getDefaultInstance()) return this; + if (other.getMachineTypesList() != null) { + this.machineTypes = other.machineTypes; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(MachineTypesScopedList source) { + this.machineTypes = source.machineTypes; + this.warning = source.warning; + } + + public List getMachineTypesList() { + return machineTypes; + } + + public Builder addAllMachineTypes(List machineTypes) { + if (this.machineTypes == null) { + this.machineTypes = new ArrayList<>(machineTypes.size()); + } + this.machineTypes.addAll(machineTypes); + return this; + } + + public Builder addMachineTypes(MachineType machineTypes) { + this.machineTypes.add(machineTypes); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public MachineTypesScopedList build() { + + return new MachineTypesScopedList( + machineTypes, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllMachineTypes(this.machineTypes); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "MachineTypesScopedList{" + + "machineTypes=" + machineTypes + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MachineTypesScopedList) { + MachineTypesScopedList that = (MachineTypesScopedList) o; + return + Objects.equals(this.machineTypes, that.getMachineTypesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + machineTypes, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java new file mode 100644 index 000000000000..10568e797fcb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ManagedInstance implements ApiMessage { + private final String currentAction; + private final String id; + private final String instance; + private final String instanceStatus; + private final ManagedInstanceLastAttempt lastAttempt; + + private ManagedInstance() { + this.currentAction = null; + this.id = null; + this.instance = null; + this.instanceStatus = null; + this.lastAttempt = null; + } + + + private ManagedInstance( + String currentAction, + String id, + String instance, + String instanceStatus, + ManagedInstanceLastAttempt lastAttempt + ) { + this.currentAction = currentAction; + this.id = id; + this.instance = instance; + this.instanceStatus = instanceStatus; + this.lastAttempt = lastAttempt; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("currentAction") && currentAction != null) { + fieldMap.put("currentAction", Collections.singletonList(String.valueOf(currentAction))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instanceStatus") && instanceStatus != null) { + fieldMap.put("instanceStatus", Collections.singletonList(String.valueOf(instanceStatus))); + } + if (fieldNames.contains("lastAttempt") && lastAttempt != null) { + fieldMap.put("lastAttempt", Collections.singletonList(String.valueOf(lastAttempt))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("currentAction")) { + return String.valueOf(currentAction); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("instanceStatus")) { + return String.valueOf(instanceStatus); + } + if (fieldName.equals("lastAttempt")) { + return String.valueOf(lastAttempt); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCurrentAction() { + return currentAction; + } + + public String getId() { + return id; + } + + public String getInstance() { + return instance; + } + + public String getInstanceStatus() { + return instanceStatus; + } + + public ManagedInstanceLastAttempt getLastAttempt() { + return lastAttempt; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ManagedInstance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ManagedInstance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ManagedInstance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ManagedInstance(); + } + + public static class Builder { + private String currentAction; + private String id; + private String instance; + private String instanceStatus; + private ManagedInstanceLastAttempt lastAttempt; + + Builder() {} + + public Builder mergeFrom(ManagedInstance other) { + if (other == ManagedInstance.getDefaultInstance()) return this; + if (other.getCurrentAction() != null) { + this.currentAction = other.currentAction; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getInstanceStatus() != null) { + this.instanceStatus = other.instanceStatus; + } + if (other.getLastAttempt() != null) { + this.lastAttempt = other.lastAttempt; + } + return this; + } + + Builder(ManagedInstance source) { + this.currentAction = source.currentAction; + this.id = source.id; + this.instance = source.instance; + this.instanceStatus = source.instanceStatus; + this.lastAttempt = source.lastAttempt; + } + + public String getCurrentAction() { + return currentAction; + } + + public Builder setCurrentAction(String currentAction) { + this.currentAction = currentAction; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getInstanceStatus() { + return instanceStatus; + } + + public Builder setInstanceStatus(String instanceStatus) { + this.instanceStatus = instanceStatus; + return this; + } + + public ManagedInstanceLastAttempt getLastAttempt() { + return lastAttempt; + } + + public Builder setLastAttempt(ManagedInstanceLastAttempt lastAttempt) { + this.lastAttempt = lastAttempt; + return this; + } + + + public ManagedInstance build() { + + + + + return new ManagedInstance( + currentAction, + id, + instance, + instanceStatus, + lastAttempt + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCurrentAction(this.currentAction); + newBuilder.setId(this.id); + newBuilder.setInstance(this.instance); + newBuilder.setInstanceStatus(this.instanceStatus); + newBuilder.setLastAttempt(this.lastAttempt); + return newBuilder; + } + } + + @Override + public String toString() { + return "ManagedInstance{" + + "currentAction=" + currentAction + ", " + + "id=" + id + ", " + + "instance=" + instance + ", " + + "instanceStatus=" + instanceStatus + ", " + + "lastAttempt=" + lastAttempt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ManagedInstance) { + ManagedInstance that = (ManagedInstance) o; + return + Objects.equals(this.currentAction, that.getCurrentAction()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.instanceStatus, that.getInstanceStatus()) && + Objects.equals(this.lastAttempt, that.getLastAttempt()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + currentAction, + id, + instance, + instanceStatus, + lastAttempt + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java new file mode 100644 index 000000000000..8f1ed351e4a7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ManagedInstanceLastAttempt implements ApiMessage { + private final Errors errors; + + private ManagedInstanceLastAttempt() { + this.errors = null; + } + + + private ManagedInstanceLastAttempt( + Errors errors + ) { + this.errors = errors; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("errors") && errors != null) { + fieldMap.put("errors", Collections.singletonList(String.valueOf(errors))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("errors")) { + return String.valueOf(errors); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Errors getErrors() { + return errors; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ManagedInstanceLastAttempt prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ManagedInstanceLastAttempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ManagedInstanceLastAttempt DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ManagedInstanceLastAttempt(); + } + + public static class Builder { + private Errors errors; + + Builder() {} + + public Builder mergeFrom(ManagedInstanceLastAttempt other) { + if (other == ManagedInstanceLastAttempt.getDefaultInstance()) return this; + if (other.getErrors() != null) { + this.errors = other.errors; + } + return this; + } + + Builder(ManagedInstanceLastAttempt source) { + this.errors = source.errors; + } + + public Errors getErrors() { + return errors; + } + + public Builder setErrors(Errors errors) { + this.errors = errors; + return this; + } + + + public ManagedInstanceLastAttempt build() { + return new ManagedInstanceLastAttempt( + errors + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setErrors(this.errors); + return newBuilder; + } + } + + @Override + public String toString() { + return "ManagedInstanceLastAttempt{" + + "errors=" + errors + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ManagedInstanceLastAttempt) { + ManagedInstanceLastAttempt that = (ManagedInstanceLastAttempt) o; + return + Objects.equals(this.errors, that.getErrors()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + errors + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java new file mode 100644 index 000000000000..53e39bd50ed9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java @@ -0,0 +1,242 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Metadata implements ApiMessage { + private final String fingerprint; + private final List items; + private final String kind; + + private Metadata() { + this.fingerprint = null; + this.items = null; + this.kind = null; + } + + + private Metadata( + String fingerprint, + List items, + String kind + ) { + this.fingerprint = fingerprint; + this.items = items; + this.kind = kind; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Items item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Metadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Metadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Metadata(); + } + + public static class Builder { + private String fingerprint; + private List items; + private String kind; + + Builder() {} + + public Builder mergeFrom(Metadata other) { + if (other == Metadata.getDefaultInstance()) return this; + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + return this; + } + + Builder(Metadata source) { + this.fingerprint = source.fingerprint; + this.items = source.items; + this.kind = source.kind; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Items items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + + public Metadata build() { + + + return new Metadata( + fingerprint, + items, + kind + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + return newBuilder; + } + } + + @Override + public String toString() { + return "Metadata{" + + "fingerprint=" + fingerprint + ", " + + "items=" + items + ", " + + "kind=" + kind + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Metadata) { + Metadata that = (Metadata) o; + return + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + fingerprint, + items, + kind + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java new file mode 100644 index 000000000000..00d01087bdd5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class MoveDiskProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final DiskMoveRequest diskMoveRequestResource; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private MoveDiskProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.diskMoveRequestResource = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private MoveDiskProjectHttpRequest( + String access_token, + String callback, + DiskMoveRequest diskMoveRequestResource, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.diskMoveRequestResource = diskMoveRequestResource; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskMoveRequestResource") && diskMoveRequestResource != null) { + fieldMap.put("diskMoveRequestResource", Collections.singletonList(String.valueOf(diskMoveRequestResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("diskMoveRequestResource")) { + return String.valueOf(diskMoveRequestResource); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public DiskMoveRequest getApiMessageRequestBody() { + return diskMoveRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public DiskMoveRequest getDiskMoveRequestResource() { + return diskMoveRequestResource; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MoveDiskProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static MoveDiskProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final MoveDiskProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MoveDiskProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private DiskMoveRequest diskMoveRequestResource; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(MoveDiskProjectHttpRequest other) { + if (other == MoveDiskProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDiskMoveRequestResource() != null) { + this.diskMoveRequestResource = other.diskMoveRequestResource; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(MoveDiskProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.diskMoveRequestResource = source.diskMoveRequestResource; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public DiskMoveRequest getDiskMoveRequestResource() { + return diskMoveRequestResource; + } + + public Builder setDiskMoveRequestResource(DiskMoveRequest diskMoveRequestResource) { + this.diskMoveRequestResource = diskMoveRequestResource; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public MoveDiskProjectHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new MoveDiskProjectHttpRequest( + access_token, + callback, + diskMoveRequestResource, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDiskMoveRequestResource(this.diskMoveRequestResource); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "MoveDiskProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "diskMoveRequestResource=" + diskMoveRequestResource + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MoveDiskProjectHttpRequest) { + MoveDiskProjectHttpRequest that = (MoveDiskProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.diskMoveRequestResource, that.getDiskMoveRequestResource()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + diskMoveRequestResource, + fields, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java new file mode 100644 index 000000000000..8d8cf45981a1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class MoveInstanceProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InstanceMoveRequest instanceMoveRequestResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private MoveInstanceProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceMoveRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private MoveInstanceProjectHttpRequest( + String access_token, + String callback, + String fields, + InstanceMoveRequest instanceMoveRequestResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceMoveRequestResource = instanceMoveRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceMoveRequestResource") && instanceMoveRequestResource != null) { + fieldMap.put("instanceMoveRequestResource", Collections.singletonList(String.valueOf(instanceMoveRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceMoveRequestResource")) { + return String.valueOf(instanceMoveRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceMoveRequest getApiMessageRequestBody() { + return instanceMoveRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InstanceMoveRequest getInstanceMoveRequestResource() { + return instanceMoveRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MoveInstanceProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static MoveInstanceProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final MoveInstanceProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MoveInstanceProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InstanceMoveRequest instanceMoveRequestResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(MoveInstanceProjectHttpRequest other) { + if (other == MoveInstanceProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceMoveRequestResource() != null) { + this.instanceMoveRequestResource = other.instanceMoveRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(MoveInstanceProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceMoveRequestResource = source.instanceMoveRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InstanceMoveRequest getInstanceMoveRequestResource() { + return instanceMoveRequestResource; + } + + public Builder setInstanceMoveRequestResource(InstanceMoveRequest instanceMoveRequestResource) { + this.instanceMoveRequestResource = instanceMoveRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public MoveInstanceProjectHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new MoveInstanceProjectHttpRequest( + access_token, + callback, + fields, + instanceMoveRequestResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceMoveRequestResource(this.instanceMoveRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "MoveInstanceProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceMoveRequestResource=" + instanceMoveRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof MoveInstanceProjectHttpRequest) { + MoveInstanceProjectHttpRequest that = (MoveInstanceProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceMoveRequestResource, that.getInstanceMoveRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceMoveRequestResource, + key, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java new file mode 100644 index 000000000000..905c2d3148d4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NamedPort implements ApiMessage { + private final String name; + private final Integer port; + + private NamedPort() { + this.name = null; + this.port = null; + } + + + private NamedPort( + String name, + Integer port + ) { + this.name = name; + this.port = port; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(NamedPort prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static NamedPort getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final NamedPort DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new NamedPort(); + } + + public static class Builder { + private String name; + private Integer port; + + Builder() {} + + public Builder mergeFrom(NamedPort other) { + if (other == NamedPort.getDefaultInstance()) return this; + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + return this; + } + + Builder(NamedPort source) { + this.name = source.name; + this.port = source.port; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + + public NamedPort build() { + + return new NamedPort( + name, + port + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + return newBuilder; + } + } + + @Override + public String toString() { + return "NamedPort{" + + "name=" + name + ", " + + "port=" + port + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NamedPort) { + NamedPort that = (NamedPort) o; + return + Objects.equals(this.name, that.getName()) && + Objects.equals(this.port, that.getPort()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + name, + port + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java new file mode 100644 index 000000000000..be57d3c2992f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java @@ -0,0 +1,480 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Network implements ApiMessage { + private final Boolean autoCreateSubnetworks; + private final String creationTimestamp; + private final String description; + private final String gatewayIPv4; + private final String iPv4Range; + private final String id; + private final String kind; + private final String name; + private final String selfLink; + private final List subnetworks; + + private Network() { + this.autoCreateSubnetworks = null; + this.creationTimestamp = null; + this.description = null; + this.gatewayIPv4 = null; + this.iPv4Range = null; + this.id = null; + this.kind = null; + this.name = null; + this.selfLink = null; + this.subnetworks = null; + } + + + private Network( + Boolean autoCreateSubnetworks, + String creationTimestamp, + String description, + String gatewayIPv4, + String iPv4Range, + String id, + String kind, + String name, + String selfLink, + List subnetworks + ) { + this.autoCreateSubnetworks = autoCreateSubnetworks; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.gatewayIPv4 = gatewayIPv4; + this.iPv4Range = iPv4Range; + this.id = id; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + this.subnetworks = subnetworks; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoCreateSubnetworks") && autoCreateSubnetworks != null) { + fieldMap.put("autoCreateSubnetworks", Collections.singletonList(String.valueOf(autoCreateSubnetworks))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("gatewayIPv4") && gatewayIPv4 != null) { + fieldMap.put("gatewayIPv4", Collections.singletonList(String.valueOf(gatewayIPv4))); + } + if (fieldNames.contains("iPv4Range") && iPv4Range != null) { + fieldMap.put("iPv4Range", Collections.singletonList(String.valueOf(iPv4Range))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("subnetworks") && subnetworks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : subnetworks) { + stringList.add(item.toString()); + } + fieldMap.put("subnetworks", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("autoCreateSubnetworks")) { + return String.valueOf(autoCreateSubnetworks); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("gatewayIPv4")) { + return String.valueOf(gatewayIPv4); + } + if (fieldName.equals("iPv4Range")) { + return String.valueOf(iPv4Range); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("subnetworks")) { + return String.valueOf(subnetworks); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getAutoCreateSubnetworks() { + return autoCreateSubnetworks; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getGatewayIPv4() { + return gatewayIPv4; + } + + public String getIPv4Range() { + return iPv4Range; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public List getSubnetworksList() { + return subnetworks; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Network prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Network getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Network DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Network(); + } + + public static class Builder { + private Boolean autoCreateSubnetworks; + private String creationTimestamp; + private String description; + private String gatewayIPv4; + private String iPv4Range; + private String id; + private String kind; + private String name; + private String selfLink; + private List subnetworks; + + Builder() {} + + public Builder mergeFrom(Network other) { + if (other == Network.getDefaultInstance()) return this; + if (other.getAutoCreateSubnetworks() != null) { + this.autoCreateSubnetworks = other.autoCreateSubnetworks; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getGatewayIPv4() != null) { + this.gatewayIPv4 = other.gatewayIPv4; + } + if (other.getIPv4Range() != null) { + this.iPv4Range = other.iPv4Range; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSubnetworksList() != null) { + this.subnetworks = other.subnetworks; + } + return this; + } + + Builder(Network source) { + this.autoCreateSubnetworks = source.autoCreateSubnetworks; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.gatewayIPv4 = source.gatewayIPv4; + this.iPv4Range = source.iPv4Range; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + this.subnetworks = source.subnetworks; + } + + public Boolean getAutoCreateSubnetworks() { + return autoCreateSubnetworks; + } + + public Builder setAutoCreateSubnetworks(Boolean autoCreateSubnetworks) { + this.autoCreateSubnetworks = autoCreateSubnetworks; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getGatewayIPv4() { + return gatewayIPv4; + } + + public Builder setGatewayIPv4(String gatewayIPv4) { + this.gatewayIPv4 = gatewayIPv4; + return this; + } + + public String getIPv4Range() { + return iPv4Range; + } + + public Builder setIPv4Range(String iPv4Range) { + this.iPv4Range = iPv4Range; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getSubnetworksList() { + return subnetworks; + } + + public Builder addAllSubnetworks(List subnetworks) { + if (this.subnetworks == null) { + this.subnetworks = new ArrayList<>(subnetworks.size()); + } + this.subnetworks.addAll(subnetworks); + return this; + } + + public Builder addSubnetworks(String subnetworks) { + this.subnetworks.add(subnetworks); + return this; + } + + + public Network build() { + + + + + + + + + + return new Network( + autoCreateSubnetworks, + creationTimestamp, + description, + gatewayIPv4, + iPv4Range, + id, + kind, + name, + selfLink, + subnetworks + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAutoCreateSubnetworks(this.autoCreateSubnetworks); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setGatewayIPv4(this.gatewayIPv4); + newBuilder.setIPv4Range(this.iPv4Range); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllSubnetworks(this.subnetworks); + return newBuilder; + } + } + + @Override + public String toString() { + return "Network{" + + "autoCreateSubnetworks=" + autoCreateSubnetworks + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "gatewayIPv4=" + gatewayIPv4 + ", " + + "iPv4Range=" + iPv4Range + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "subnetworks=" + subnetworks + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Network) { + Network that = (Network) o; + return + Objects.equals(this.autoCreateSubnetworks, that.getAutoCreateSubnetworks()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.gatewayIPv4, that.getGatewayIPv4()) && + Objects.equals(this.iPv4Range, that.getIPv4Range()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.subnetworks, that.getSubnetworksList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoCreateSubnetworks, + creationTimestamp, + description, + gatewayIPv4, + iPv4Range, + id, + kind, + name, + selfLink, + subnetworks + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java new file mode 100644 index 000000000000..e6fd670a365d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java @@ -0,0 +1,811 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.NetworkStub; +import com.google.cloud.compute.v1.stub.NetworkStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (NetworkClient networkClient = NetworkClient.create()) {
+ *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+ *   Operation response = networkClient.deleteNetwork(network);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the networkClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of NetworkSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * NetworkSettings networkSettings =
+ *     NetworkSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * NetworkClient networkClient =
+ *     NetworkClient.create(networkSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * NetworkSettings networkSettings =
+ *     NetworkSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NetworkClient networkClient =
+ *     NetworkClient.create(networkSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class NetworkClient implements BackgroundResource { + private final NetworkSettings settings; + private final NetworkStub stub; + + + + /** + * Constructs an instance of NetworkClient with default settings. + */ + public static final NetworkClient create() throws IOException { + return create(NetworkSettings.newBuilder().build()); + } + + /** + * Constructs an instance of NetworkClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final NetworkClient create(NetworkSettings settings) throws IOException { + return new NetworkClient(settings); + } + + /** + * Constructs an instance of NetworkClient, using the given stub for making calls. This is for + * advanced usage - prefer to use NetworkSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final NetworkClient create(NetworkStub stub) { + return new NetworkClient(stub); + } + + /** + * Constructs an instance of NetworkClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected NetworkClient(NetworkSettings settings) throws IOException { + this.settings = settings; + this.stub = ((NetworkStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected NetworkClient(NetworkStub stub) { + this.settings = null; + this.stub = stub; + } + + public final NetworkSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NetworkStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Operation response = networkClient.deleteNetwork(network);
+   * }
+   * 
+ * + * @param network Name of the network to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNetwork(NetworkName network) { + + DeleteNetworkHttpRequest request = + DeleteNetworkHttpRequest.newBuilder() + .setNetwork(network == null ? null : network.toString()) + .build(); + return deleteNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Operation response = networkClient.deleteNetwork(network.toString());
+   * }
+   * 
+ * + * @param network Name of the network to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNetwork(String network) { + + DeleteNetworkHttpRequest request = + DeleteNetworkHttpRequest.newBuilder() + .setNetwork(network) + .build(); + return deleteNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
+   *     .setNetwork(network.toString())
+   *     .build();
+   *   Operation response = networkClient.deleteNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNetwork(DeleteNetworkHttpRequest request) { + return deleteNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
+   *     .setNetwork(network.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = networkClient.deleteNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteNetworkCallable() { + return stub.deleteNetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified network. Get a list of available networks by making a list() request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Network response = networkClient.getNetwork(network);
+   * }
+   * 
+ * + * @param network Name of the network to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Network getNetwork(NetworkName network) { + + GetNetworkHttpRequest request = + GetNetworkHttpRequest.newBuilder() + .setNetwork(network == null ? null : network.toString()) + .build(); + return getNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified network. Get a list of available networks by making a list() request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Network response = networkClient.getNetwork(network.toString());
+   * }
+   * 
+ * + * @param network Name of the network to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Network getNetwork(String network) { + + GetNetworkHttpRequest request = + GetNetworkHttpRequest.newBuilder() + .setNetwork(network) + .build(); + return getNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified network. Get a list of available networks by making a list() request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder()
+   *     .setNetwork(network.toString())
+   *     .build();
+   *   Network response = networkClient.getNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Network getNetwork(GetNetworkHttpRequest request) { + return getNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified network. Get a list of available networks by making a list() request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder()
+   *     .setNetwork(network.toString())
+   *     .build();
+   *   ApiFuture<Network> future = networkClient.getNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Network response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getNetworkCallable() { + return stub.getNetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a network in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   Operation response = networkClient.insertNetwork(project, networkResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNetwork(ProjectName project, Network networkResource) { + + InsertNetworkHttpRequest request = + InsertNetworkHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setNetworkResource(networkResource) + .build(); + return insertNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a network in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   Operation response = networkClient.insertNetwork(project.toString(), networkResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNetwork(String project, Network networkResource) { + + InsertNetworkHttpRequest request = + InsertNetworkHttpRequest.newBuilder() + .setProject(project) + .setNetworkResource(networkResource) + .build(); + return insertNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a network in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setNetworkResource(networkResource)
+   *     .build();
+   *   Operation response = networkClient.insertNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNetwork(InsertNetworkHttpRequest request) { + return insertNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a network in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setNetworkResource(networkResource)
+   *     .build();
+   *   ApiFuture<Operation> future = networkClient.insertNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertNetworkCallable() { + return stub.insertNetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of networks available to the specified project. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Network element : networkClient.listNetworks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNetworksPagedResponse listNetworks(ProjectName project) { + ListNetworksHttpRequest request = + ListNetworksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listNetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of networks available to the specified project. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Network element : networkClient.listNetworks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNetworksPagedResponse listNetworks(String project) { + ListNetworksHttpRequest request = + ListNetworksHttpRequest.newBuilder() + .setProject(project) + .build(); + return listNetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of networks available to the specified project. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListNetworksHttpRequest request = ListNetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Network element : networkClient.listNetworks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNetworksPagedResponse listNetworks(ListNetworksHttpRequest request) { + return listNetworksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of networks available to the specified project. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListNetworksHttpRequest request = ListNetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListNetworksPagedResponse> future = networkClient.listNetworksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Network element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listNetworksPagedCallable() { + return stub.listNetworksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of networks available to the specified project. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListNetworksHttpRequest request = ListNetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     NetworkList response = networkClient.listNetworksCallable().call(request);
+   *     for (Network element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listNetworksCallable() { + return stub.listNetworksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Operation response = networkClient.switchToCustomModeNetwork(network);
+   * }
+   * 
+ * + * @param network Name of the network to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation switchToCustomModeNetwork(NetworkName network) { + + SwitchToCustomModeNetworkHttpRequest request = + SwitchToCustomModeNetworkHttpRequest.newBuilder() + .setNetwork(network == null ? null : network.toString()) + .build(); + return switchToCustomModeNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Operation response = networkClient.switchToCustomModeNetwork(network.toString());
+   * }
+   * 
+ * + * @param network Name of the network to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation switchToCustomModeNetwork(String network) { + + SwitchToCustomModeNetworkHttpRequest request = + SwitchToCustomModeNetworkHttpRequest.newBuilder() + .setNetwork(network) + .build(); + return switchToCustomModeNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
+   *     .setNetwork(network.toString())
+   *     .build();
+   *   Operation response = networkClient.switchToCustomModeNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation switchToCustomModeNetwork(SwitchToCustomModeNetworkHttpRequest request) { + return switchToCustomModeNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
+   *     .setNetwork(network.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = networkClient.switchToCustomModeNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable switchToCustomModeNetworkCallable() { + return stub.switchToCustomModeNetworkCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListNetworksPagedResponse extends AbstractPagedListResponse< + ListNetworksHttpRequest, + NetworkList, + Network, + ListNetworksPage, + ListNetworksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNetworksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNetworksPagedResponse apply(ListNetworksPage input) { + return new ListNetworksPagedResponse(input); + } + }); + } + + private ListNetworksPagedResponse(ListNetworksPage page) { + super(page, ListNetworksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListNetworksPage extends AbstractPage< + ListNetworksHttpRequest, + NetworkList, + Network, + ListNetworksPage> { + + private ListNetworksPage( + PageContext context, + NetworkList response) { + super(context, response); + } + + private static ListNetworksPage createEmptyPage() { + return new ListNetworksPage(null, null); + } + + @Override + protected ListNetworksPage createPage( + PageContext context, + NetworkList response) { + return new ListNetworksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListNetworksFixedSizeCollection extends AbstractFixedSizeCollection< + ListNetworksHttpRequest, + NetworkList, + Network, + ListNetworksPage, + ListNetworksFixedSizeCollection> { + + private ListNetworksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNetworksFixedSizeCollection createEmptyCollection() { + return new ListNetworksFixedSizeCollection(null, 0); + } + + @Override + protected ListNetworksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNetworksFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java new file mode 100644 index 000000000000..cb7a34db124d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NetworkInterface implements ApiMessage { + private final List accessConfigs; + private final String kind; + private final String name; + private final String network; + private final String networkIP; + private final String subnetwork; + + private NetworkInterface() { + this.accessConfigs = null; + this.kind = null; + this.name = null; + this.network = null; + this.networkIP = null; + this.subnetwork = null; + } + + + private NetworkInterface( + List accessConfigs, + String kind, + String name, + String network, + String networkIP, + String subnetwork + ) { + this.accessConfigs = accessConfigs; + this.kind = kind; + this.name = name; + this.network = network; + this.networkIP = networkIP; + this.subnetwork = subnetwork; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfigs") && accessConfigs != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AccessConfig item : accessConfigs) { + stringList.add(item.toString()); + } + fieldMap.put("accessConfigs", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networkIP") && networkIP != null) { + fieldMap.put("networkIP", Collections.singletonList(String.valueOf(networkIP))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("accessConfigs")) { + return String.valueOf(accessConfigs); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("networkIP")) { + return String.valueOf(networkIP); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getAccessConfigsList() { + return accessConfigs; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getNetworkIP() { + return networkIP; + } + + public String getSubnetwork() { + return subnetwork; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(NetworkInterface prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static NetworkInterface getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final NetworkInterface DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new NetworkInterface(); + } + + public static class Builder { + private List accessConfigs; + private String kind; + private String name; + private String network; + private String networkIP; + private String subnetwork; + + Builder() {} + + public Builder mergeFrom(NetworkInterface other) { + if (other == NetworkInterface.getDefaultInstance()) return this; + if (other.getAccessConfigsList() != null) { + this.accessConfigs = other.accessConfigs; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getNetworkIP() != null) { + this.networkIP = other.networkIP; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + return this; + } + + Builder(NetworkInterface source) { + this.accessConfigs = source.accessConfigs; + this.kind = source.kind; + this.name = source.name; + this.network = source.network; + this.networkIP = source.networkIP; + this.subnetwork = source.subnetwork; + } + + public List getAccessConfigsList() { + return accessConfigs; + } + + public Builder addAllAccessConfigs(List accessConfigs) { + if (this.accessConfigs == null) { + this.accessConfigs = new ArrayList<>(accessConfigs.size()); + } + this.accessConfigs.addAll(accessConfigs); + return this; + } + + public Builder addAccessConfigs(AccessConfig accessConfigs) { + this.accessConfigs.add(accessConfigs); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getNetworkIP() { + return networkIP; + } + + public Builder setNetworkIP(String networkIP) { + this.networkIP = networkIP; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + + public NetworkInterface build() { + + + + + + return new NetworkInterface( + accessConfigs, + kind, + name, + network, + networkIP, + subnetwork + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAccessConfigs(this.accessConfigs); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setNetworkIP(this.networkIP); + newBuilder.setSubnetwork(this.subnetwork); + return newBuilder; + } + } + + @Override + public String toString() { + return "NetworkInterface{" + + "accessConfigs=" + accessConfigs + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "networkIP=" + networkIP + ", " + + "subnetwork=" + subnetwork + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NetworkInterface) { + NetworkInterface that = (NetworkInterface) o; + return + Objects.equals(this.accessConfigs, that.getAccessConfigsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.networkIP, that.getNetworkIP()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + accessConfigs, + kind, + name, + network, + networkIP, + subnetwork + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java new file mode 100644 index 000000000000..eaaef922532c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NetworkList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private NetworkList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private NetworkList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Network item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(NetworkList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static NetworkList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final NetworkList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new NetworkList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(NetworkList other) { + if (other == NetworkList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(NetworkList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Network items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public NetworkList build() { + + + + + return new NetworkList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "NetworkList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NetworkList) { + NetworkList that = (NetworkList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java new file mode 100644 index 000000000000..751436376661 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class NetworkName implements ResourceName { + private final String network; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private NetworkName(Builder builder) { + network = Preconditions.checkNotNull(builder.getNetwork()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static NetworkName of( + String network, + String project + ) { + return newBuilder() + .setNetwork(network) + .setProject(project) + .build(); + } + + public static String format( + String network, + String project + ) { + return of( + network, + project + ) + .toString(); + } + + public String getNetwork() { + return network; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("network", network); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public NetworkName parse(String formattedString) {return NetworkName.parse(formattedString);} + }; + } + + public static NetworkName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "NetworkName.parse: formattedString not in valid format"); + return of( + matchMap.get("network"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String network; + private String project; + + public String getNetwork() { + return network; + } + public String getProject() { + return project; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (NetworkName networkName) { + network = networkName.network; + project = networkName.project; + } + + public NetworkName build() { + return new NetworkName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "network", network, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NetworkName) { + NetworkName that = (NetworkName) o; + return + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + network, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java new file mode 100644 index 000000000000..2a2984bba0f6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java @@ -0,0 +1,282 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import com.google.cloud.compute.v1.stub.NetworkStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NetworkClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteNetwork to 30 seconds: + * + *

+ * 
+ * NetworkSettings.Builder networkSettingsBuilder =
+ *     NetworkSettings.newBuilder();
+ * networkSettingsBuilder.deleteNetworkSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NetworkSettings networkSettings = networkSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class NetworkSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteNetwork. + */ + public UnaryCallSettings deleteNetworkSettings() { + return ((NetworkStubSettings) getStubSettings()).deleteNetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to getNetwork. + */ + public UnaryCallSettings getNetworkSettings() { + return ((NetworkStubSettings) getStubSettings()).getNetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to insertNetwork. + */ + public UnaryCallSettings insertNetworkSettings() { + return ((NetworkStubSettings) getStubSettings()).insertNetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to listNetworks. + */ + public PagedCallSettings listNetworksSettings() { + return ((NetworkStubSettings) getStubSettings()).listNetworksSettings(); + } + + /** + * Returns the object with the settings used for calls to switchToCustomModeNetwork. + */ + public UnaryCallSettings switchToCustomModeNetworkSettings() { + return ((NetworkStubSettings) getStubSettings()).switchToCustomModeNetworkSettings(); + } + + + public static final NetworkSettings create(NetworkStubSettings stub) throws IOException { + return new NetworkSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return NetworkStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return NetworkStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return NetworkStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return NetworkStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return NetworkStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return NetworkStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return NetworkStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NetworkStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NetworkSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for NetworkSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(NetworkStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(NetworkStubSettings.newBuilder()); + } + + protected Builder(NetworkSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(NetworkStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public NetworkStubSettings.Builder getStubSettingsBuilder() { + return ((NetworkStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteNetwork. + */ + public UnaryCallSettings.Builder deleteNetworkSettings() { + return getStubSettingsBuilder().deleteNetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to getNetwork. + */ + public UnaryCallSettings.Builder getNetworkSettings() { + return getStubSettingsBuilder().getNetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertNetwork. + */ + public UnaryCallSettings.Builder insertNetworkSettings() { + return getStubSettingsBuilder().insertNetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to listNetworks. + */ + public PagedCallSettings.Builder listNetworksSettings() { + return getStubSettingsBuilder().listNetworksSettings(); + } + + /** + * Returns the builder for the settings used for calls to switchToCustomModeNetwork. + */ + public UnaryCallSettings.Builder switchToCustomModeNetworkSettings() { + return getStubSettingsBuilder().switchToCustomModeNetworkSettings(); + } + + @Override + public NetworkSettings build() throws IOException { + return new NetworkSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java new file mode 100644 index 000000000000..b16cb9cd080d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java @@ -0,0 +1,922 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Operation implements ApiMessage { + private final String clientOperationId; + private final String creationTimestamp; + private final String description; + private final String endTime; + private final Error error; + private final String httpErrorMessage; + private final Integer httpErrorStatusCode; + private final String id; + private final String insertTime; + private final String kind; + private final String name; + private final String operationType; + private final Integer progress; + private final String region; + private final String selfLink; + private final String startTime; + private final String status; + private final String statusMessage; + private final String targetId; + private final String targetLink; + private final String user; + private final List warnings; + private final String zone; + + private Operation() { + this.clientOperationId = null; + this.creationTimestamp = null; + this.description = null; + this.endTime = null; + this.error = null; + this.httpErrorMessage = null; + this.httpErrorStatusCode = null; + this.id = null; + this.insertTime = null; + this.kind = null; + this.name = null; + this.operationType = null; + this.progress = null; + this.region = null; + this.selfLink = null; + this.startTime = null; + this.status = null; + this.statusMessage = null; + this.targetId = null; + this.targetLink = null; + this.user = null; + this.warnings = null; + this.zone = null; + } + + + private Operation( + String clientOperationId, + String creationTimestamp, + String description, + String endTime, + Error error, + String httpErrorMessage, + Integer httpErrorStatusCode, + String id, + String insertTime, + String kind, + String name, + String operationType, + Integer progress, + String region, + String selfLink, + String startTime, + String status, + String statusMessage, + String targetId, + String targetLink, + String user, + List warnings, + String zone + ) { + this.clientOperationId = clientOperationId; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.endTime = endTime; + this.error = error; + this.httpErrorMessage = httpErrorMessage; + this.httpErrorStatusCode = httpErrorStatusCode; + this.id = id; + this.insertTime = insertTime; + this.kind = kind; + this.name = name; + this.operationType = operationType; + this.progress = progress; + this.region = region; + this.selfLink = selfLink; + this.startTime = startTime; + this.status = status; + this.statusMessage = statusMessage; + this.targetId = targetId; + this.targetLink = targetLink; + this.user = user; + this.warnings = warnings; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("clientOperationId") && clientOperationId != null) { + fieldMap.put("clientOperationId", Collections.singletonList(String.valueOf(clientOperationId))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("endTime") && endTime != null) { + fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime))); + } + if (fieldNames.contains("error") && error != null) { + fieldMap.put("error", Collections.singletonList(String.valueOf(error))); + } + if (fieldNames.contains("httpErrorMessage") && httpErrorMessage != null) { + fieldMap.put("httpErrorMessage", Collections.singletonList(String.valueOf(httpErrorMessage))); + } + if (fieldNames.contains("httpErrorStatusCode") && httpErrorStatusCode != null) { + fieldMap.put("httpErrorStatusCode", Collections.singletonList(String.valueOf(httpErrorStatusCode))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("insertTime") && insertTime != null) { + fieldMap.put("insertTime", Collections.singletonList(String.valueOf(insertTime))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("operationType") && operationType != null) { + fieldMap.put("operationType", Collections.singletonList(String.valueOf(operationType))); + } + if (fieldNames.contains("progress") && progress != null) { + fieldMap.put("progress", Collections.singletonList(String.valueOf(progress))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("startTime") && startTime != null) { + fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusMessage") && statusMessage != null) { + fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); + } + if (fieldNames.contains("targetId") && targetId != null) { + fieldMap.put("targetId", Collections.singletonList(String.valueOf(targetId))); + } + if (fieldNames.contains("targetLink") && targetLink != null) { + fieldMap.put("targetLink", Collections.singletonList(String.valueOf(targetLink))); + } + if (fieldNames.contains("user") && user != null) { + fieldMap.put("user", Collections.singletonList(String.valueOf(user))); + } + if (fieldNames.contains("warnings") && warnings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Warnings item : warnings) { + stringList.add(item.toString()); + } + fieldMap.put("warnings", stringList.build()); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("clientOperationId")) { + return String.valueOf(clientOperationId); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("endTime")) { + return String.valueOf(endTime); + } + if (fieldName.equals("error")) { + return String.valueOf(error); + } + if (fieldName.equals("httpErrorMessage")) { + return String.valueOf(httpErrorMessage); + } + if (fieldName.equals("httpErrorStatusCode")) { + return String.valueOf(httpErrorStatusCode); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("insertTime")) { + return String.valueOf(insertTime); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("operationType")) { + return String.valueOf(operationType); + } + if (fieldName.equals("progress")) { + return String.valueOf(progress); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("startTime")) { + return String.valueOf(startTime); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("statusMessage")) { + return String.valueOf(statusMessage); + } + if (fieldName.equals("targetId")) { + return String.valueOf(targetId); + } + if (fieldName.equals("targetLink")) { + return String.valueOf(targetLink); + } + if (fieldName.equals("user")) { + return String.valueOf(user); + } + if (fieldName.equals("warnings")) { + return String.valueOf(warnings); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getClientOperationId() { + return clientOperationId; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getEndTime() { + return endTime; + } + + public Error getError() { + return error; + } + + public String getHttpErrorMessage() { + return httpErrorMessage; + } + + public Integer getHttpErrorStatusCode() { + return httpErrorStatusCode; + } + + public String getId() { + return id; + } + + public String getInsertTime() { + return insertTime; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getOperationType() { + return operationType; + } + + public Integer getProgress() { + return progress; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStartTime() { + return startTime; + } + + public String getStatus() { + return status; + } + + public String getStatusMessage() { + return statusMessage; + } + + public String getTargetId() { + return targetId; + } + + public String getTargetLink() { + return targetLink; + } + + public String getUser() { + return user; + } + + public List getWarningsList() { + return warnings; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Operation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Operation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Operation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Operation(); + } + + public static class Builder { + private String clientOperationId; + private String creationTimestamp; + private String description; + private String endTime; + private Error error; + private String httpErrorMessage; + private Integer httpErrorStatusCode; + private String id; + private String insertTime; + private String kind; + private String name; + private String operationType; + private Integer progress; + private String region; + private String selfLink; + private String startTime; + private String status; + private String statusMessage; + private String targetId; + private String targetLink; + private String user; + private List warnings; + private String zone; + + Builder() {} + + public Builder mergeFrom(Operation other) { + if (other == Operation.getDefaultInstance()) return this; + if (other.getClientOperationId() != null) { + this.clientOperationId = other.clientOperationId; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getEndTime() != null) { + this.endTime = other.endTime; + } + if (other.getError() != null) { + this.error = other.error; + } + if (other.getHttpErrorMessage() != null) { + this.httpErrorMessage = other.httpErrorMessage; + } + if (other.getHttpErrorStatusCode() != null) { + this.httpErrorStatusCode = other.httpErrorStatusCode; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInsertTime() != null) { + this.insertTime = other.insertTime; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getOperationType() != null) { + this.operationType = other.operationType; + } + if (other.getProgress() != null) { + this.progress = other.progress; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStartTime() != null) { + this.startTime = other.startTime; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getStatusMessage() != null) { + this.statusMessage = other.statusMessage; + } + if (other.getTargetId() != null) { + this.targetId = other.targetId; + } + if (other.getTargetLink() != null) { + this.targetLink = other.targetLink; + } + if (other.getUser() != null) { + this.user = other.user; + } + if (other.getWarningsList() != null) { + this.warnings = other.warnings; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(Operation source) { + this.clientOperationId = source.clientOperationId; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.endTime = source.endTime; + this.error = source.error; + this.httpErrorMessage = source.httpErrorMessage; + this.httpErrorStatusCode = source.httpErrorStatusCode; + this.id = source.id; + this.insertTime = source.insertTime; + this.kind = source.kind; + this.name = source.name; + this.operationType = source.operationType; + this.progress = source.progress; + this.region = source.region; + this.selfLink = source.selfLink; + this.startTime = source.startTime; + this.status = source.status; + this.statusMessage = source.statusMessage; + this.targetId = source.targetId; + this.targetLink = source.targetLink; + this.user = source.user; + this.warnings = source.warnings; + this.zone = source.zone; + } + + public String getClientOperationId() { + return clientOperationId; + } + + public Builder setClientOperationId(String clientOperationId) { + this.clientOperationId = clientOperationId; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getEndTime() { + return endTime; + } + + public Builder setEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + public Error getError() { + return error; + } + + public Builder setError(Error error) { + this.error = error; + return this; + } + + public String getHttpErrorMessage() { + return httpErrorMessage; + } + + public Builder setHttpErrorMessage(String httpErrorMessage) { + this.httpErrorMessage = httpErrorMessage; + return this; + } + + public Integer getHttpErrorStatusCode() { + return httpErrorStatusCode; + } + + public Builder setHttpErrorStatusCode(Integer httpErrorStatusCode) { + this.httpErrorStatusCode = httpErrorStatusCode; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getInsertTime() { + return insertTime; + } + + public Builder setInsertTime(String insertTime) { + this.insertTime = insertTime; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getOperationType() { + return operationType; + } + + public Builder setOperationType(String operationType) { + this.operationType = operationType; + return this; + } + + public Integer getProgress() { + return progress; + } + + public Builder setProgress(Integer progress) { + this.progress = progress; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStartTime() { + return startTime; + } + + public Builder setStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getStatusMessage() { + return statusMessage; + } + + public Builder setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + public String getTargetId() { + return targetId; + } + + public Builder setTargetId(String targetId) { + this.targetId = targetId; + return this; + } + + public String getTargetLink() { + return targetLink; + } + + public Builder setTargetLink(String targetLink) { + this.targetLink = targetLink; + return this; + } + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public List getWarningsList() { + return warnings; + } + + public Builder addAllWarnings(List warnings) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(warnings.size()); + } + this.warnings.addAll(warnings); + return this; + } + + public Builder addWarnings(Warnings warnings) { + this.warnings.add(warnings); + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public Operation build() { + + + + + + + + + + + + + + + + + + + + + + + return new Operation( + clientOperationId, + creationTimestamp, + description, + endTime, + error, + httpErrorMessage, + httpErrorStatusCode, + id, + insertTime, + kind, + name, + operationType, + progress, + region, + selfLink, + startTime, + status, + statusMessage, + targetId, + targetLink, + user, + warnings, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setClientOperationId(this.clientOperationId); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setEndTime(this.endTime); + newBuilder.setError(this.error); + newBuilder.setHttpErrorMessage(this.httpErrorMessage); + newBuilder.setHttpErrorStatusCode(this.httpErrorStatusCode); + newBuilder.setId(this.id); + newBuilder.setInsertTime(this.insertTime); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setOperationType(this.operationType); + newBuilder.setProgress(this.progress); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStartTime(this.startTime); + newBuilder.setStatus(this.status); + newBuilder.setStatusMessage(this.statusMessage); + newBuilder.setTargetId(this.targetId); + newBuilder.setTargetLink(this.targetLink); + newBuilder.setUser(this.user); + newBuilder.addAllWarnings(this.warnings); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "Operation{" + + "clientOperationId=" + clientOperationId + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "endTime=" + endTime + ", " + + "error=" + error + ", " + + "httpErrorMessage=" + httpErrorMessage + ", " + + "httpErrorStatusCode=" + httpErrorStatusCode + ", " + + "id=" + id + ", " + + "insertTime=" + insertTime + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "operationType=" + operationType + ", " + + "progress=" + progress + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "startTime=" + startTime + ", " + + "status=" + status + ", " + + "statusMessage=" + statusMessage + ", " + + "targetId=" + targetId + ", " + + "targetLink=" + targetLink + ", " + + "user=" + user + ", " + + "warnings=" + warnings + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Operation) { + Operation that = (Operation) o; + return + Objects.equals(this.clientOperationId, that.getClientOperationId()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.endTime, that.getEndTime()) && + Objects.equals(this.error, that.getError()) && + Objects.equals(this.httpErrorMessage, that.getHttpErrorMessage()) && + Objects.equals(this.httpErrorStatusCode, that.getHttpErrorStatusCode()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.insertTime, that.getInsertTime()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.operationType, that.getOperationType()) && + Objects.equals(this.progress, that.getProgress()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.startTime, that.getStartTime()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.statusMessage, that.getStatusMessage()) && + Objects.equals(this.targetId, that.getTargetId()) && + Objects.equals(this.targetLink, that.getTargetLink()) && + Objects.equals(this.user, that.getUser()) && + Objects.equals(this.warnings, that.getWarningsList()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + clientOperationId, + creationTimestamp, + description, + endTime, + error, + httpErrorMessage, + httpErrorStatusCode, + id, + insertTime, + kind, + name, + operationType, + progress, + region, + selfLink, + startTime, + status, + statusMessage, + targetId, + targetLink, + user, + warnings, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java new file mode 100644 index 000000000000..4c6e6728811c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class OperationAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private OperationAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private OperationAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(OperationAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static OperationAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final OperationAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new OperationAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(OperationAggregatedList other) { + if (other == OperationAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(OperationAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public OperationAggregatedList build() { + + + + + return new OperationAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "OperationAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OperationAggregatedList) { + OperationAggregatedList that = (OperationAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java new file mode 100644 index 000000000000..7020c662d1cb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class OperationList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private OperationList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private OperationList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Operation item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(OperationList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static OperationList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final OperationList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new OperationList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(OperationList other) { + if (other == OperationList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(OperationList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Operation items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public OperationList build() { + + + + + return new OperationList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "OperationList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OperationList) { + OperationList that = (OperationList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java new file mode 100644 index 000000000000..3d3b370ab39a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class OperationName implements ResourceName { + private final String operation; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/operations/{operation}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OperationName(Builder builder) { + operation = Preconditions.checkNotNull(builder.getOperation()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static OperationName of( + String operation, + String project + ) { + return newBuilder() + .setOperation(operation) + .setProject(project) + .build(); + } + + public static String format( + String operation, + String project + ) { + return of( + operation, + project + ) + .toString(); + } + + public String getOperation() { + return operation; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("operation", operation); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public OperationName parse(String formattedString) {return OperationName.parse(formattedString);} + }; + } + + public static OperationName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "OperationName.parse: formattedString not in valid format"); + return of( + matchMap.get("operation"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String operation; + private String project; + + public String getOperation() { + return operation; + } + public String getProject() { + return project; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (OperationName operationName) { + operation = operationName.operation; + project = operationName.project; + } + + public OperationName build() { + return new OperationName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "operation", operation, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OperationName) { + OperationName that = (OperationName) o; + return + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + operation, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java new file mode 100644 index 000000000000..5b714ea22727 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class OperationsScopedList implements ApiMessage { + private final List operations; + private final Warning warning; + + private OperationsScopedList() { + this.operations = null; + this.warning = null; + } + + + private OperationsScopedList( + List operations, + Warning warning + ) { + this.operations = operations; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("operations") && operations != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Operation item : operations) { + stringList.add(item.toString()); + } + fieldMap.put("operations", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("operations")) { + return String.valueOf(operations); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getOperationsList() { + return operations; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(OperationsScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static OperationsScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final OperationsScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new OperationsScopedList(); + } + + public static class Builder { + private List operations; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(OperationsScopedList other) { + if (other == OperationsScopedList.getDefaultInstance()) return this; + if (other.getOperationsList() != null) { + this.operations = other.operations; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(OperationsScopedList source) { + this.operations = source.operations; + this.warning = source.warning; + } + + public List getOperationsList() { + return operations; + } + + public Builder addAllOperations(List operations) { + if (this.operations == null) { + this.operations = new ArrayList<>(operations.size()); + } + this.operations.addAll(operations); + return this; + } + + public Builder addOperations(Operation operations) { + this.operations.add(operations); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public OperationsScopedList build() { + + return new OperationsScopedList( + operations, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllOperations(this.operations); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "OperationsScopedList{" + + "operations=" + operations + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OperationsScopedList) { + OperationsScopedList that = (OperationsScopedList) o; + return + Objects.equals(this.operations, that.getOperationsList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + operations, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java new file mode 100644 index 000000000000..a526c818f415 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -0,0 +1,477 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final Autoscaler autoscalerResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private PatchAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.autoscalerResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private PatchAutoscalerHttpRequest( + String access_token, + String autoscaler, + Autoscaler autoscalerResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.autoscalerResource = autoscalerResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("autoscalerResource")) { + return String.valueOf(autoscalerResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public Autoscaler getApiMessageRequestBody() { + return autoscalerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private Autoscaler autoscalerResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(PatchAutoscalerHttpRequest other) { + if (other == PatchAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getAutoscalerResource() != null) { + this.autoscalerResource = other.autoscalerResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(PatchAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.autoscalerResource = source.autoscalerResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public Builder setAutoscalerResource(Autoscaler autoscalerResource) { + this.autoscalerResource = autoscalerResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public PatchAutoscalerHttpRequest build() { + String missing = ""; + + if (autoscaler == null) { + missing += " autoscaler"; + } + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchAutoscalerHttpRequest( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setAutoscalerResource(this.autoscalerResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchAutoscalerHttpRequest) { + PatchAutoscalerHttpRequest that = (PatchAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java new file mode 100644 index 000000000000..459662bc9f58 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final BackendService backendServiceResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private PatchBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.backendServiceResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private PatchBackendServiceHttpRequest( + String access_token, + String backendService, + BackendService backendServiceResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.backendServiceResource = backendServiceResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("backendServiceResource")) { + return String.valueOf(backendServiceResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendService getApiMessageRequestBody() { + return backendServiceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private BackendService backendServiceResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchBackendServiceHttpRequest other) { + if (other == PatchBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getBackendServiceResource() != null) { + this.backendServiceResource = other.backendServiceResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.backendServiceResource = source.backendServiceResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public Builder setBackendServiceResource(BackendService backendServiceResource) { + this.backendServiceResource = backendServiceResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchBackendServiceHttpRequest( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setBackendServiceResource(this.backendServiceResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "backendServiceResource=" + backendServiceResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchBackendServiceHttpRequest) { + PatchBackendServiceHttpRequest that = (PatchBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java new file mode 100644 index 000000000000..c6a057ec7f00 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchFirewallHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String firewall; + private final Firewall firewallResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private PatchFirewallHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.firewall = null; + this.firewallResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private PatchFirewallHttpRequest( + String access_token, + String callback, + String fields, + String firewall, + Firewall firewallResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.firewall = firewall; + this.firewallResource = firewallResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("firewallResource") && firewallResource != null) { + fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("firewall")) { + return String.valueOf(firewall); + } + if (fieldName.equals("firewallResource")) { + return String.valueOf(firewallResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Firewall getApiMessageRequestBody() { + return firewallResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFirewall() { + return firewall; + } + + public Firewall getFirewallResource() { + return firewallResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchFirewallHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchFirewallHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchFirewallHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchFirewallHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String firewall; + private Firewall firewallResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchFirewallHttpRequest other) { + if (other == PatchFirewallHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFirewall() != null) { + this.firewall = other.firewall; + } + if (other.getFirewallResource() != null) { + this.firewallResource = other.firewallResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchFirewallHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.firewall = source.firewall; + this.firewallResource = source.firewallResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFirewall() { + return firewall; + } + + public Builder setFirewall(String firewall) { + this.firewall = firewall; + return this; + } + + public Firewall getFirewallResource() { + return firewallResource; + } + + public Builder setFirewallResource(Firewall firewallResource) { + this.firewallResource = firewallResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchFirewallHttpRequest build() { + String missing = ""; + + + + if (firewall == null) { + missing += " firewall"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchFirewallHttpRequest( + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFirewall(this.firewall); + newBuilder.setFirewallResource(this.firewallResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchFirewallHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "firewall=" + firewall + ", " + + "firewallResource=" + firewallResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchFirewallHttpRequest) { + PatchFirewallHttpRequest that = (PatchFirewallHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.firewall, that.getFirewall()) && + Objects.equals(this.firewallResource, that.getFirewallResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java new file mode 100644 index 000000000000..e6d6591722c9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String healthCheck; + private final HealthCheck healthCheckResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private PatchHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.healthCheck = null; + this.healthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private PatchHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String healthCheck, + HealthCheck healthCheckResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.healthCheck = healthCheck; + this.healthCheckResource = healthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { + fieldMap.put("healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("healthCheck")) { + return String.valueOf(healthCheck); + } + if (fieldName.equals("healthCheckResource")) { + return String.valueOf(healthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HealthCheck getApiMessageRequestBody() { + return healthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHealthCheck() { + return healthCheck; + } + + public HealthCheck getHealthCheckResource() { + return healthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String healthCheck; + private HealthCheck healthCheckResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchHealthCheckHttpRequest other) { + if (other == PatchHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHealthCheck() != null) { + this.healthCheck = other.healthCheck; + } + if (other.getHealthCheckResource() != null) { + this.healthCheckResource = other.healthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.healthCheck = source.healthCheck; + this.healthCheckResource = source.healthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHealthCheck() { + return healthCheck; + } + + public Builder setHealthCheck(String healthCheck) { + this.healthCheck = healthCheck; + return this; + } + + public HealthCheck getHealthCheckResource() { + return healthCheckResource; + } + + public Builder setHealthCheckResource(HealthCheck healthCheckResource) { + this.healthCheckResource = healthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchHealthCheckHttpRequest build() { + String missing = ""; + + + + if (healthCheck == null) { + missing += " healthCheck"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchHealthCheckHttpRequest( + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHealthCheck(this.healthCheck); + newBuilder.setHealthCheckResource(this.healthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "healthCheck=" + healthCheck + ", " + + "healthCheckResource=" + healthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchHealthCheckHttpRequest) { + PatchHealthCheckHttpRequest that = (PatchHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.healthCheck, that.getHealthCheck()) && + Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java new file mode 100644 index 000000000000..a6efb48981b0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpHealthCheck; + private final HttpHealthCheck httpHealthCheckResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private PatchHttpHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpHealthCheck = null; + this.httpHealthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private PatchHttpHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpHealthCheck, + HttpHealthCheck httpHealthCheckResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpHealthCheck = httpHealthCheck; + this.httpHealthCheckResource = httpHealthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { + fieldMap.put("httpHealthCheckResource", Collections.singletonList(String.valueOf(httpHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpHealthCheck")) { + return String.valueOf(httpHealthCheck); + } + if (fieldName.equals("httpHealthCheckResource")) { + return String.valueOf(httpHealthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HttpHealthCheck getApiMessageRequestBody() { + return httpHealthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public HttpHealthCheck getHttpHealthCheckResource() { + return httpHealthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchHttpHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchHttpHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchHttpHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpHealthCheck; + private HttpHealthCheck httpHealthCheckResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { + if (other == PatchHttpHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpHealthCheck() != null) { + this.httpHealthCheck = other.httpHealthCheck; + } + if (other.getHttpHealthCheckResource() != null) { + this.httpHealthCheckResource = other.httpHealthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchHttpHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpHealthCheck = source.httpHealthCheck; + this.httpHealthCheckResource = source.httpHealthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public Builder setHttpHealthCheck(String httpHealthCheck) { + this.httpHealthCheck = httpHealthCheck; + return this; + } + + public HttpHealthCheck getHttpHealthCheckResource() { + return httpHealthCheckResource; + } + + public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + this.httpHealthCheckResource = httpHealthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchHttpHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpHealthCheck == null) { + missing += " httpHealthCheck"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchHttpHealthCheckHttpRequest( + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpHealthCheck(this.httpHealthCheck); + newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchHttpHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpHealthCheck=" + httpHealthCheck + ", " + + "httpHealthCheckResource=" + httpHealthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchHttpHealthCheckHttpRequest) { + PatchHttpHealthCheckHttpRequest that = (PatchHttpHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && + Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java new file mode 100644 index 000000000000..113221fa5b6e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpsHealthCheck; + private final HttpsHealthCheck httpsHealthCheckResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private PatchHttpsHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpsHealthCheck = null; + this.httpsHealthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private PatchHttpsHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpsHealthCheck, + HttpsHealthCheck httpsHealthCheckResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpsHealthCheck = httpsHealthCheck; + this.httpsHealthCheckResource = httpsHealthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { + fieldMap.put("httpsHealthCheckResource", Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpsHealthCheck")) { + return String.valueOf(httpsHealthCheck); + } + if (fieldName.equals("httpsHealthCheckResource")) { + return String.valueOf(httpsHealthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HttpsHealthCheck getApiMessageRequestBody() { + return httpsHealthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public HttpsHealthCheck getHttpsHealthCheckResource() { + return httpsHealthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchHttpsHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchHttpsHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchHttpsHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpsHealthCheck; + private HttpsHealthCheck httpsHealthCheckResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { + if (other == PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpsHealthCheck() != null) { + this.httpsHealthCheck = other.httpsHealthCheck; + } + if (other.getHttpsHealthCheckResource() != null) { + this.httpsHealthCheckResource = other.httpsHealthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchHttpsHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpsHealthCheck = source.httpsHealthCheck; + this.httpsHealthCheckResource = source.httpsHealthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public Builder setHttpsHealthCheck(String httpsHealthCheck) { + this.httpsHealthCheck = httpsHealthCheck; + return this; + } + + public HttpsHealthCheck getHttpsHealthCheckResource() { + return httpsHealthCheckResource; + } + + public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + this.httpsHealthCheckResource = httpsHealthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchHttpsHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpsHealthCheck == null) { + missing += " httpsHealthCheck"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchHttpsHealthCheckHttpRequest( + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); + newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchHttpsHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpsHealthCheck=" + httpsHealthCheck + ", " + + "httpsHealthCheckResource=" + httpsHealthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchHttpsHealthCheckHttpRequest) { + PatchHttpsHealthCheckHttpRequest that = (PatchHttpsHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && + Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java new file mode 100644 index 000000000000..ed4ad1b3eff8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -0,0 +1,477 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchRegionAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final Autoscaler autoscalerResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private PatchRegionAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.autoscalerResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private PatchRegionAutoscalerHttpRequest( + String access_token, + String autoscaler, + Autoscaler autoscalerResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.autoscalerResource = autoscalerResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("autoscalerResource")) { + return String.valueOf(autoscalerResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Autoscaler getApiMessageRequestBody() { + return autoscalerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchRegionAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchRegionAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchRegionAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private Autoscaler autoscalerResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { + if (other == PatchRegionAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getAutoscalerResource() != null) { + this.autoscalerResource = other.autoscalerResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchRegionAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.autoscalerResource = source.autoscalerResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public Builder setAutoscalerResource(Autoscaler autoscalerResource) { + this.autoscalerResource = autoscalerResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchRegionAutoscalerHttpRequest build() { + String missing = ""; + + if (autoscaler == null) { + missing += " autoscaler"; + } + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchRegionAutoscalerHttpRequest( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setAutoscalerResource(this.autoscalerResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchRegionAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchRegionAutoscalerHttpRequest) { + PatchRegionAutoscalerHttpRequest that = (PatchRegionAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java new file mode 100644 index 000000000000..35bf0fecda74 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchRegionBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final BackendService backendServiceResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private PatchRegionBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.backendServiceResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private PatchRegionBackendServiceHttpRequest( + String access_token, + String backendService, + BackendService backendServiceResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.backendServiceResource = backendServiceResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("backendServiceResource")) { + return String.valueOf(backendServiceResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendService getApiMessageRequestBody() { + return backendServiceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchRegionBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchRegionBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchRegionBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private BackendService backendServiceResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { + if (other == PatchRegionBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getBackendServiceResource() != null) { + this.backendServiceResource = other.backendServiceResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchRegionBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.backendServiceResource = source.backendServiceResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public Builder setBackendServiceResource(BackendService backendServiceResource) { + this.backendServiceResource = backendServiceResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchRegionBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchRegionBackendServiceHttpRequest( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setBackendServiceResource(this.backendServiceResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchRegionBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "backendServiceResource=" + backendServiceResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchRegionBackendServiceHttpRequest) { + PatchRegionBackendServiceHttpRequest that = (PatchRegionBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java new file mode 100644 index 000000000000..1d01d16f5a91 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String router; + private final Router routerResource; + private final String userIp; + + private PatchRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.router = null; + this.routerResource = null; + this.userIp = null; + } + + + private PatchRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String router, + Router routerResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.router = router; + this.routerResource = routerResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("routerResource")) { + return String.valueOf(routerResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Router getApiMessageRequestBody() { + return routerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRouter() { + return router; + } + + public Router getRouterResource() { + return routerResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String router; + private Router routerResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchRouterHttpRequest other) { + if (other == PatchRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getRouterResource() != null) { + this.routerResource = other.routerResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.router = source.router; + this.routerResource = source.routerResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public Router getRouterResource() { + return routerResource; + } + + public Builder setRouterResource(Router routerResource) { + this.routerResource = routerResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchRouterHttpRequest build() { + String missing = ""; + + + + + + + if (router == null) { + missing += " router"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouter(this.router); + newBuilder.setRouterResource(this.routerResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "router=" + router + ", " + + "routerResource=" + routerResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchRouterHttpRequest) { + PatchRouterHttpRequest that = (PatchRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.routerResource, that.getRouterResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java new file mode 100644 index 000000000000..2d1479373e17 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String urlMap; + private final UrlMap urlMapResource; + private final String userIp; + + private PatchUrlMapHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.urlMap = null; + this.urlMapResource = null; + this.userIp = null; + } + + + private PatchUrlMapHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String urlMap, + UrlMap urlMapResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.urlMap = urlMap; + this.urlMapResource = urlMapResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("urlMapResource") && urlMapResource != null) { + fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + if (fieldName.equals("urlMapResource")) { + return String.valueOf(urlMapResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UrlMap getApiMessageRequestBody() { + return urlMapResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUrlMap() { + return urlMap; + } + + public UrlMap getUrlMapResource() { + return urlMapResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String urlMap; + private UrlMap urlMapResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchUrlMapHttpRequest other) { + if (other == PatchUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + if (other.getUrlMapResource() != null) { + this.urlMapResource = other.urlMapResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.urlMap = source.urlMap; + this.urlMapResource = source.urlMapResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + public UrlMap getUrlMapResource() { + return urlMapResource; + } + + public Builder setUrlMapResource(UrlMap urlMapResource) { + this.urlMapResource = urlMapResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchUrlMapHttpRequest build() { + String missing = ""; + + + + + + + if (urlMap == null) { + missing += " urlMap"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchUrlMapHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMap(this.urlMap); + newBuilder.setUrlMapResource(this.urlMapResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMap=" + urlMap + ", " + + "urlMapResource=" + urlMapResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchUrlMapHttpRequest) { + PatchUrlMapHttpRequest that = (PatchUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMap, that.getUrlMap()) && + Objects.equals(this.urlMapResource, that.getUrlMapResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java new file mode 100644 index 000000000000..318e6f33e645 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java @@ -0,0 +1,276 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PathMatcher implements ApiMessage { + private final String defaultService; + private final String description; + private final String name; + private final List pathRules; + + private PathMatcher() { + this.defaultService = null; + this.description = null; + this.name = null; + this.pathRules = null; + } + + + private PathMatcher( + String defaultService, + String description, + String name, + List pathRules + ) { + this.defaultService = defaultService; + this.description = description; + this.name = name; + this.pathRules = pathRules; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("defaultService") && defaultService != null) { + fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("pathRules") && pathRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (PathRule item : pathRules) { + stringList.add(item.toString()); + } + fieldMap.put("pathRules", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("defaultService")) { + return String.valueOf(defaultService); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("pathRules")) { + return String.valueOf(pathRules); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDefaultService() { + return defaultService; + } + + public String getDescription() { + return description; + } + + public String getName() { + return name; + } + + public List getPathRulesList() { + return pathRules; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PathMatcher prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PathMatcher getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PathMatcher DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PathMatcher(); + } + + public static class Builder { + private String defaultService; + private String description; + private String name; + private List pathRules; + + Builder() {} + + public Builder mergeFrom(PathMatcher other) { + if (other == PathMatcher.getDefaultInstance()) return this; + if (other.getDefaultService() != null) { + this.defaultService = other.defaultService; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPathRulesList() != null) { + this.pathRules = other.pathRules; + } + return this; + } + + Builder(PathMatcher source) { + this.defaultService = source.defaultService; + this.description = source.description; + this.name = source.name; + this.pathRules = source.pathRules; + } + + public String getDefaultService() { + return defaultService; + } + + public Builder setDefaultService(String defaultService) { + this.defaultService = defaultService; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getPathRulesList() { + return pathRules; + } + + public Builder addAllPathRules(List pathRules) { + if (this.pathRules == null) { + this.pathRules = new ArrayList<>(pathRules.size()); + } + this.pathRules.addAll(pathRules); + return this; + } + + public Builder addPathRules(PathRule pathRules) { + this.pathRules.add(pathRules); + return this; + } + + + public PathMatcher build() { + + + + return new PathMatcher( + defaultService, + description, + name, + pathRules + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDefaultService(this.defaultService); + newBuilder.setDescription(this.description); + newBuilder.setName(this.name); + newBuilder.addAllPathRules(this.pathRules); + return newBuilder; + } + } + + @Override + public String toString() { + return "PathMatcher{" + + "defaultService=" + defaultService + ", " + + "description=" + description + ", " + + "name=" + name + ", " + + "pathRules=" + pathRules + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PathMatcher) { + PathMatcher that = (PathMatcher) o; + return + Objects.equals(this.defaultService, that.getDefaultService()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.pathRules, that.getPathRulesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + defaultService, + description, + name, + pathRules + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java new file mode 100644 index 000000000000..d1129e6f234b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PathRule implements ApiMessage { + private final List paths; + private final String service; + + private PathRule() { + this.paths = null; + this.service = null; + } + + + private PathRule( + List paths, + String service + ) { + this.paths = paths; + this.service = service; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("paths") && paths != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : paths) { + stringList.add(item.toString()); + } + fieldMap.put("paths", stringList.build()); + } + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("paths")) { + return String.valueOf(paths); + } + if (fieldName.equals("service")) { + return String.valueOf(service); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getPathsList() { + return paths; + } + + public String getService() { + return service; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PathRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PathRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PathRule DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PathRule(); + } + + public static class Builder { + private List paths; + private String service; + + Builder() {} + + public Builder mergeFrom(PathRule other) { + if (other == PathRule.getDefaultInstance()) return this; + if (other.getPathsList() != null) { + this.paths = other.paths; + } + if (other.getService() != null) { + this.service = other.service; + } + return this; + } + + Builder(PathRule source) { + this.paths = source.paths; + this.service = source.service; + } + + public List getPathsList() { + return paths; + } + + public Builder addAllPaths(List paths) { + if (this.paths == null) { + this.paths = new ArrayList<>(paths.size()); + } + this.paths.addAll(paths); + return this; + } + + public Builder addPaths(String paths) { + this.paths.add(paths); + return this; + } + + public String getService() { + return service; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + + public PathRule build() { + + return new PathRule( + paths, + service + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllPaths(this.paths); + newBuilder.setService(this.service); + return newBuilder; + } + } + + @Override + public String toString() { + return "PathRule{" + + "paths=" + paths + ", " + + "service=" + service + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PathRule) { + PathRule that = (PathRule) o; + return + Objects.equals(this.paths, that.getPathsList()) && + Objects.equals(this.service, that.getService()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + paths, + service + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java new file mode 100644 index 000000000000..1a6e5a3ef46c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PreviewRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String router; + private final Router routerResource; + private final String userIp; + + private PreviewRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.router = null; + this.routerResource = null; + this.userIp = null; + } + + + private PreviewRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String router, + Router routerResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.router = router; + this.routerResource = routerResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("routerResource")) { + return String.valueOf(routerResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Router getApiMessageRequestBody() { + return routerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRouter() { + return router; + } + + public Router getRouterResource() { + return routerResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PreviewRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PreviewRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PreviewRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PreviewRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String router; + private Router routerResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PreviewRouterHttpRequest other) { + if (other == PreviewRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getRouterResource() != null) { + this.routerResource = other.routerResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PreviewRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.router = source.router; + this.routerResource = source.routerResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public Router getRouterResource() { + return routerResource; + } + + public Builder setRouterResource(Router routerResource) { + this.routerResource = routerResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PreviewRouterHttpRequest build() { + String missing = ""; + + + + + + + if (router == null) { + missing += " router"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PreviewRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouter(this.router); + newBuilder.setRouterResource(this.routerResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PreviewRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "router=" + router + ", " + + "routerResource=" + routerResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PreviewRouterHttpRequest) { + PreviewRouterHttpRequest that = (PreviewRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.routerResource, that.getRouterResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java new file mode 100644 index 000000000000..84a0b9a47d17 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Project implements ApiMessage { + private final Metadata commonInstanceMetadata; + private final String creationTimestamp; + private final String defaultServiceAccount; + private final String description; + private final List enabledFeatures; + private final String id; + private final String kind; + private final String name; + private final List quotas; + private final String selfLink; + private final UsageExportLocation usageExportLocation; + + private Project() { + this.commonInstanceMetadata = null; + this.creationTimestamp = null; + this.defaultServiceAccount = null; + this.description = null; + this.enabledFeatures = null; + this.id = null; + this.kind = null; + this.name = null; + this.quotas = null; + this.selfLink = null; + this.usageExportLocation = null; + } + + + private Project( + Metadata commonInstanceMetadata, + String creationTimestamp, + String defaultServiceAccount, + String description, + List enabledFeatures, + String id, + String kind, + String name, + List quotas, + String selfLink, + UsageExportLocation usageExportLocation + ) { + this.commonInstanceMetadata = commonInstanceMetadata; + this.creationTimestamp = creationTimestamp; + this.defaultServiceAccount = defaultServiceAccount; + this.description = description; + this.enabledFeatures = enabledFeatures; + this.id = id; + this.kind = kind; + this.name = name; + this.quotas = quotas; + this.selfLink = selfLink; + this.usageExportLocation = usageExportLocation; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("commonInstanceMetadata") && commonInstanceMetadata != null) { + fieldMap.put("commonInstanceMetadata", Collections.singletonList(String.valueOf(commonInstanceMetadata))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("defaultServiceAccount") && defaultServiceAccount != null) { + fieldMap.put("defaultServiceAccount", Collections.singletonList(String.valueOf(defaultServiceAccount))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : enabledFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("enabledFeatures", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("quotas") && quotas != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Quota item : quotas) { + stringList.add(item.toString()); + } + fieldMap.put("quotas", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("usageExportLocation") && usageExportLocation != null) { + fieldMap.put("usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("commonInstanceMetadata")) { + return String.valueOf(commonInstanceMetadata); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("defaultServiceAccount")) { + return String.valueOf(defaultServiceAccount); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("enabledFeatures")) { + return String.valueOf(enabledFeatures); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("quotas")) { + return String.valueOf(quotas); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("usageExportLocation")) { + return String.valueOf(usageExportLocation); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Metadata getCommonInstanceMetadata() { + return commonInstanceMetadata; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDefaultServiceAccount() { + return defaultServiceAccount; + } + + public String getDescription() { + return description; + } + + public List getEnabledFeaturesList() { + return enabledFeatures; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public List getQuotasList() { + return quotas; + } + + public String getSelfLink() { + return selfLink; + } + + public UsageExportLocation getUsageExportLocation() { + return usageExportLocation; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Project prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Project getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Project DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Project(); + } + + public static class Builder { + private Metadata commonInstanceMetadata; + private String creationTimestamp; + private String defaultServiceAccount; + private String description; + private List enabledFeatures; + private String id; + private String kind; + private String name; + private List quotas; + private String selfLink; + private UsageExportLocation usageExportLocation; + + Builder() {} + + public Builder mergeFrom(Project other) { + if (other == Project.getDefaultInstance()) return this; + if (other.getCommonInstanceMetadata() != null) { + this.commonInstanceMetadata = other.commonInstanceMetadata; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDefaultServiceAccount() != null) { + this.defaultServiceAccount = other.defaultServiceAccount; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getEnabledFeaturesList() != null) { + this.enabledFeatures = other.enabledFeatures; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getQuotasList() != null) { + this.quotas = other.quotas; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getUsageExportLocation() != null) { + this.usageExportLocation = other.usageExportLocation; + } + return this; + } + + Builder(Project source) { + this.commonInstanceMetadata = source.commonInstanceMetadata; + this.creationTimestamp = source.creationTimestamp; + this.defaultServiceAccount = source.defaultServiceAccount; + this.description = source.description; + this.enabledFeatures = source.enabledFeatures; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.quotas = source.quotas; + this.selfLink = source.selfLink; + this.usageExportLocation = source.usageExportLocation; + } + + public Metadata getCommonInstanceMetadata() { + return commonInstanceMetadata; + } + + public Builder setCommonInstanceMetadata(Metadata commonInstanceMetadata) { + this.commonInstanceMetadata = commonInstanceMetadata; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDefaultServiceAccount() { + return defaultServiceAccount; + } + + public Builder setDefaultServiceAccount(String defaultServiceAccount) { + this.defaultServiceAccount = defaultServiceAccount; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getEnabledFeaturesList() { + return enabledFeatures; + } + + public Builder addAllEnabledFeatures(List enabledFeatures) { + if (this.enabledFeatures == null) { + this.enabledFeatures = new ArrayList<>(enabledFeatures.size()); + } + this.enabledFeatures.addAll(enabledFeatures); + return this; + } + + public Builder addEnabledFeatures(String enabledFeatures) { + this.enabledFeatures.add(enabledFeatures); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getQuotasList() { + return quotas; + } + + public Builder addAllQuotas(List quotas) { + if (this.quotas == null) { + this.quotas = new ArrayList<>(quotas.size()); + } + this.quotas.addAll(quotas); + return this; + } + + public Builder addQuotas(Quota quotas) { + this.quotas.add(quotas); + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public UsageExportLocation getUsageExportLocation() { + return usageExportLocation; + } + + public Builder setUsageExportLocation(UsageExportLocation usageExportLocation) { + this.usageExportLocation = usageExportLocation; + return this; + } + + + public Project build() { + + + + + + + + + + + return new Project( + commonInstanceMetadata, + creationTimestamp, + defaultServiceAccount, + description, + enabledFeatures, + id, + kind, + name, + quotas, + selfLink, + usageExportLocation + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCommonInstanceMetadata(this.commonInstanceMetadata); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDefaultServiceAccount(this.defaultServiceAccount); + newBuilder.setDescription(this.description); + newBuilder.addAllEnabledFeatures(this.enabledFeatures); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.addAllQuotas(this.quotas); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setUsageExportLocation(this.usageExportLocation); + return newBuilder; + } + } + + @Override + public String toString() { + return "Project{" + + "commonInstanceMetadata=" + commonInstanceMetadata + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "defaultServiceAccount=" + defaultServiceAccount + ", " + + "description=" + description + ", " + + "enabledFeatures=" + enabledFeatures + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "quotas=" + quotas + ", " + + "selfLink=" + selfLink + ", " + + "usageExportLocation=" + usageExportLocation + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Project) { + Project that = (Project) o; + return + Objects.equals(this.commonInstanceMetadata, that.getCommonInstanceMetadata()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.defaultServiceAccount, that.getDefaultServiceAccount()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.enabledFeatures, that.getEnabledFeaturesList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.quotas, that.getQuotasList()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.usageExportLocation, that.getUsageExportLocation()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + commonInstanceMetadata, + creationTimestamp, + defaultServiceAccount, + description, + enabledFeatures, + id, + kind, + name, + quotas, + selfLink, + usageExportLocation + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java new file mode 100644 index 000000000000..59b0a8d04cea --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectAddressName implements ResourceName { + private final String address; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/addresses/{address}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectAddressName(Builder builder) { + address = Preconditions.checkNotNull(builder.getAddress()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectAddressName of( + String address, + String project + ) { + return newBuilder() + .setAddress(address) + .setProject(project) + .build(); + } + + public static String format( + String address, + String project + ) { + return of( + address, + project + ) + .toString(); + } + + public String getAddress() { + return address; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("address", address); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectAddressName parse(String formattedString) {return ProjectAddressName.parse(formattedString);} + }; + } + + public static ProjectAddressName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectAddressName.parse: formattedString not in valid format"); + return of( + matchMap.get("address"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String address; + private String project; + + public String getAddress() { + return address; + } + public String getProject() { + return project; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (ProjectAddressName projectAddressName) { + address = projectAddressName.address; + project = projectAddressName.project; + } + + public ProjectAddressName build() { + return new ProjectAddressName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "address", address, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectAddressName) { + ProjectAddressName that = (ProjectAddressName) o; + return + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + address, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java new file mode 100644 index 000000000000..a868d37751d9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java @@ -0,0 +1,717 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.ProjectStub; +import com.google.cloud.compute.v1.stub.ProjectStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ProjectClient projectClient = ProjectClient.create()) {
+ *   ProjectName project = ProjectName.of("[PROJECT]");
+ *   Project response = projectClient.getProject(project);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the projectClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of ProjectSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * ProjectSettings projectSettings =
+ *     ProjectSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ProjectClient projectClient =
+ *     ProjectClient.create(projectSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ProjectSettings projectSettings =
+ *     ProjectSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ProjectClient projectClient =
+ *     ProjectClient.create(projectSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ProjectClient implements BackgroundResource { + private final ProjectSettings settings; + private final ProjectStub stub; + + + + /** + * Constructs an instance of ProjectClient with default settings. + */ + public static final ProjectClient create() throws IOException { + return create(ProjectSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ProjectClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final ProjectClient create(ProjectSettings settings) throws IOException { + return new ProjectClient(settings); + } + + /** + * Constructs an instance of ProjectClient, using the given stub for making calls. This is for + * advanced usage - prefer to use ProjectSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ProjectClient create(ProjectStub stub) { + return new ProjectClient(stub); + } + + /** + * Constructs an instance of ProjectClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected ProjectClient(ProjectSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ProjectStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ProjectClient(ProjectStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ProjectSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ProjectStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Project response = projectClient.getProject(project);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Project getProject(ProjectName project) { + + GetProjectHttpRequest request = + GetProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return getProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Project response = projectClient.getProject(project.toString());
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Project getProject(String project) { + + GetProjectHttpRequest request = + GetProjectHttpRequest.newBuilder() + .setProject(project) + .build(); + return getProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   Project response = projectClient.getProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + private final Project getProject(GetProjectHttpRequest request) { + return getProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<Project> future = projectClient.getProjectCallable().futureCall(request);
+   *   // Do something
+   *   Project response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getProjectCallable() { + return stub.getProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a persistent disk from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
+   *   Operation response = projectClient.moveDiskProject(project, diskMoveRequestResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param diskMoveRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation moveDiskProject(ProjectName project, DiskMoveRequest diskMoveRequestResource) { + + MoveDiskProjectHttpRequest request = + MoveDiskProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setDiskMoveRequestResource(diskMoveRequestResource) + .build(); + return moveDiskProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a persistent disk from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
+   *   Operation response = projectClient.moveDiskProject(project.toString(), diskMoveRequestResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param diskMoveRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation moveDiskProject(String project, DiskMoveRequest diskMoveRequestResource) { + + MoveDiskProjectHttpRequest request = + MoveDiskProjectHttpRequest.newBuilder() + .setProject(project) + .setDiskMoveRequestResource(diskMoveRequestResource) + .build(); + return moveDiskProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a persistent disk from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
+   *   MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setDiskMoveRequestResource(diskMoveRequestResource)
+   *     .build();
+   *   Operation response = projectClient.moveDiskProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation moveDiskProject(MoveDiskProjectHttpRequest request) { + return moveDiskProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a persistent disk from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
+   *   MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setDiskMoveRequestResource(diskMoveRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.moveDiskProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable moveDiskProjectCallable() { + return stub.moveDiskProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves an instance and its attached persistent disks from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
+   *   Operation response = projectClient.moveInstanceProject(project, instanceMoveRequestResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param instanceMoveRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation moveInstanceProject(ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { + + MoveInstanceProjectHttpRequest request = + MoveInstanceProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setInstanceMoveRequestResource(instanceMoveRequestResource) + .build(); + return moveInstanceProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves an instance and its attached persistent disks from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
+   *   Operation response = projectClient.moveInstanceProject(project.toString(), instanceMoveRequestResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param instanceMoveRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation moveInstanceProject(String project, InstanceMoveRequest instanceMoveRequestResource) { + + MoveInstanceProjectHttpRequest request = + MoveInstanceProjectHttpRequest.newBuilder() + .setProject(project) + .setInstanceMoveRequestResource(instanceMoveRequestResource) + .build(); + return moveInstanceProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves an instance and its attached persistent disks from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
+   *   MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setInstanceMoveRequestResource(instanceMoveRequestResource)
+   *     .build();
+   *   Operation response = projectClient.moveInstanceProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation moveInstanceProject(MoveInstanceProjectHttpRequest request) { + return moveInstanceProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves an instance and its attached persistent disks from one zone to another. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
+   *   MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setInstanceMoveRequestResource(instanceMoveRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.moveInstanceProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable moveInstanceProjectCallable() { + return stub.moveInstanceProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(project, metadataResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param metadataResource A metadata key/value entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setCommonInstanceMetadataProject(ProjectName project, Metadata metadataResource) { + + SetCommonInstanceMetadataProjectHttpRequest request = + SetCommonInstanceMetadataProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setMetadataResource(metadataResource) + .build(); + return setCommonInstanceMetadataProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(project.toString(), metadataResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param metadataResource A metadata key/value entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setCommonInstanceMetadataProject(String project, Metadata metadataResource) { + + SetCommonInstanceMetadataProjectHttpRequest request = + SetCommonInstanceMetadataProjectHttpRequest.newBuilder() + .setProject(project) + .setMetadataResource(metadataResource) + .build(); + return setCommonInstanceMetadataProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setMetadataResource(metadataResource)
+   *     .build();
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setCommonInstanceMetadataProject(SetCommonInstanceMetadataProjectHttpRequest request) { + return setCommonInstanceMetadataProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setMetadataResource(metadataResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.setCommonInstanceMetadataProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setCommonInstanceMetadataProjectCallable() { + return stub.setCommonInstanceMetadataProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
+   *   Operation response = projectClient.setUsageExportBucketProject(project, usageExportLocationResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUsageExportBucketProject(ProjectName project, UsageExportLocation usageExportLocationResource) { + + SetUsageExportBucketProjectHttpRequest request = + SetUsageExportBucketProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setUsageExportLocationResource(usageExportLocationResource) + .build(); + return setUsageExportBucketProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
+   *   Operation response = projectClient.setUsageExportBucketProject(project.toString(), usageExportLocationResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUsageExportBucketProject(String project, UsageExportLocation usageExportLocationResource) { + + SetUsageExportBucketProjectHttpRequest request = + SetUsageExportBucketProjectHttpRequest.newBuilder() + .setProject(project) + .setUsageExportLocationResource(usageExportLocationResource) + .build(); + return setUsageExportBucketProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
+   *   SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setUsageExportLocationResource(usageExportLocationResource)
+   *     .build();
+   *   Operation response = projectClient.setUsageExportBucketProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUsageExportBucketProject(SetUsageExportBucketProjectHttpRequest request) { + return setUsageExportBucketProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
+   *   SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setUsageExportLocationResource(usageExportLocationResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.setUsageExportBucketProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setUsageExportBucketProjectCallable() { + return stub.setUsageExportBucketProjectCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java new file mode 100644 index 000000000000..1b0fc06ea4f7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectForwardingRuleName implements ResourceName { + private final String forwardingRule; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/forwardingRules/{forwardingRule}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectForwardingRuleName(Builder builder) { + forwardingRule = Preconditions.checkNotNull(builder.getForwardingRule()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectForwardingRuleName of( + String forwardingRule, + String project + ) { + return newBuilder() + .setForwardingRule(forwardingRule) + .setProject(project) + .build(); + } + + public static String format( + String forwardingRule, + String project + ) { + return of( + forwardingRule, + project + ) + .toString(); + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("forwardingRule", forwardingRule); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectForwardingRuleName parse(String formattedString) {return ProjectForwardingRuleName.parse(formattedString);} + }; + } + + public static ProjectForwardingRuleName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectForwardingRuleName.parse: formattedString not in valid format"); + return of( + matchMap.get("forwardingRule"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String forwardingRule; + private String project; + + public String getForwardingRule() { + return forwardingRule; + } + public String getProject() { + return project; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (ProjectForwardingRuleName projectForwardingRuleName) { + forwardingRule = projectForwardingRuleName.forwardingRule; + project = projectForwardingRuleName.project; + } + + public ProjectForwardingRuleName build() { + return new ProjectForwardingRuleName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "forwardingRule", forwardingRule, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectForwardingRuleName) { + ProjectForwardingRuleName that = (ProjectForwardingRuleName) o; + return + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + forwardingRule, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java new file mode 100644 index 000000000000..59ca4ad0fa80 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java @@ -0,0 +1,163 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectName implements ResourceName { + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectName of( + String project + ) { + return newBuilder() + .setProject(project) + .build(); + } + + public static String format( + String project + ) { + return of( + project + ) + .toString(); + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectName parse(String formattedString) {return ProjectName.parse(formattedString);} + }; + } + + public static ProjectName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectName.parse: formattedString not in valid format"); + return of( + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (ProjectName projectName) { + project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectName) { + ProjectName that = (ProjectName) o; + return + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java new file mode 100644 index 000000000000..845615eeb423 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionAutoscalerName implements ResourceName { + private final String autoscaler; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/autoscalers/{autoscaler}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionAutoscalerName(Builder builder) { + autoscaler = Preconditions.checkNotNull(builder.getAutoscaler()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionAutoscalerName of( + String autoscaler, + String project, + String region + ) { + return newBuilder() + .setAutoscaler(autoscaler) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String autoscaler, + String project, + String region + ) { + return of( + autoscaler, + project, + region + ) + .toString(); + } + + public String getAutoscaler() { + return autoscaler; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("autoscaler", autoscaler); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionAutoscalerName parse(String formattedString) {return ProjectRegionAutoscalerName.parse(formattedString);} + }; + } + + public static ProjectRegionAutoscalerName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionAutoscalerName.parse: formattedString not in valid format"); + return of( + matchMap.get("autoscaler"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String autoscaler; + private String project; + private String region; + + public String getAutoscaler() { + return autoscaler; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (ProjectRegionAutoscalerName projectRegionAutoscalerName) { + autoscaler = projectRegionAutoscalerName.autoscaler; + project = projectRegionAutoscalerName.project; + region = projectRegionAutoscalerName.region; + } + + public ProjectRegionAutoscalerName build() { + return new ProjectRegionAutoscalerName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "autoscaler", autoscaler, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionAutoscalerName) { + ProjectRegionAutoscalerName that = (ProjectRegionAutoscalerName) o; + return + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoscaler, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java new file mode 100644 index 000000000000..ce4965f363ae --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionBackendServiceName implements ResourceName { + private final String backendService; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/backendServices/{backendService}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionBackendServiceName(Builder builder) { + backendService = Preconditions.checkNotNull(builder.getBackendService()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionBackendServiceName of( + String backendService, + String project, + String region + ) { + return newBuilder() + .setBackendService(backendService) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String backendService, + String project, + String region + ) { + return of( + backendService, + project, + region + ) + .toString(); + } + + public String getBackendService() { + return backendService; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("backendService", backendService); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionBackendServiceName parse(String formattedString) {return ProjectRegionBackendServiceName.parse(formattedString);} + }; + } + + public static ProjectRegionBackendServiceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionBackendServiceName.parse: formattedString not in valid format"); + return of( + matchMap.get("backendService"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String backendService; + private String project; + private String region; + + public String getBackendService() { + return backendService; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (ProjectRegionBackendServiceName projectRegionBackendServiceName) { + backendService = projectRegionBackendServiceName.backendService; + project = projectRegionBackendServiceName.project; + region = projectRegionBackendServiceName.region; + } + + public ProjectRegionBackendServiceName build() { + return new ProjectRegionBackendServiceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "backendService", backendService, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionBackendServiceName) { + ProjectRegionBackendServiceName that = (ProjectRegionBackendServiceName) o; + return + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + backendService, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java new file mode 100644 index 000000000000..74b325c154c7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionInstanceGroupManagerName implements ResourceName { + private final String instanceGroupManager; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionInstanceGroupManagerName(Builder builder) { + instanceGroupManager = Preconditions.checkNotNull(builder.getInstanceGroupManager()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionInstanceGroupManagerName of( + String instanceGroupManager, + String project, + String region + ) { + return newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String instanceGroupManager, + String project, + String region + ) { + return of( + instanceGroupManager, + project, + region + ) + .toString(); + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("instanceGroupManager", instanceGroupManager); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionInstanceGroupManagerName parse(String formattedString) {return ProjectRegionInstanceGroupManagerName.parse(formattedString);} + }; + } + + public static ProjectRegionInstanceGroupManagerName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionInstanceGroupManagerName.parse: formattedString not in valid format"); + return of( + matchMap.get("instanceGroupManager"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String instanceGroupManager; + private String project; + private String region; + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (ProjectRegionInstanceGroupManagerName projectRegionInstanceGroupManagerName) { + instanceGroupManager = projectRegionInstanceGroupManagerName.instanceGroupManager; + project = projectRegionInstanceGroupManagerName.project; + region = projectRegionInstanceGroupManagerName.region; + } + + public ProjectRegionInstanceGroupManagerName build() { + return new ProjectRegionInstanceGroupManagerName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "instanceGroupManager", instanceGroupManager, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionInstanceGroupManagerName) { + ProjectRegionInstanceGroupManagerName that = (ProjectRegionInstanceGroupManagerName) o; + return + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceGroupManager, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java new file mode 100644 index 000000000000..4b49f748d2ec --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionInstanceGroupName implements ResourceName { + private final String instanceGroup; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/instanceGroups/{instanceGroup}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionInstanceGroupName(Builder builder) { + instanceGroup = Preconditions.checkNotNull(builder.getInstanceGroup()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionInstanceGroupName of( + String instanceGroup, + String project, + String region + ) { + return newBuilder() + .setInstanceGroup(instanceGroup) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String instanceGroup, + String project, + String region + ) { + return of( + instanceGroup, + project, + region + ) + .toString(); + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("instanceGroup", instanceGroup); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionInstanceGroupName parse(String formattedString) {return ProjectRegionInstanceGroupName.parse(formattedString);} + }; + } + + public static ProjectRegionInstanceGroupName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionInstanceGroupName.parse: formattedString not in valid format"); + return of( + matchMap.get("instanceGroup"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String instanceGroup; + private String project; + private String region; + + public String getInstanceGroup() { + return instanceGroup; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (ProjectRegionInstanceGroupName projectRegionInstanceGroupName) { + instanceGroup = projectRegionInstanceGroupName.instanceGroup; + project = projectRegionInstanceGroupName.project; + region = projectRegionInstanceGroupName.region; + } + + public ProjectRegionInstanceGroupName build() { + return new ProjectRegionInstanceGroupName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "instanceGroup", instanceGroup, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionInstanceGroupName) { + ProjectRegionInstanceGroupName that = (ProjectRegionInstanceGroupName) o; + return + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceGroup, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java new file mode 100644 index 000000000000..2fbbc3ecb206 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionOperationName implements ResourceName { + private final String operation; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/operations/{operation}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionOperationName(Builder builder) { + operation = Preconditions.checkNotNull(builder.getOperation()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionOperationName of( + String operation, + String project, + String region + ) { + return newBuilder() + .setOperation(operation) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String operation, + String project, + String region + ) { + return of( + operation, + project, + region + ) + .toString(); + } + + public String getOperation() { + return operation; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("operation", operation); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionOperationName parse(String formattedString) {return ProjectRegionOperationName.parse(formattedString);} + }; + } + + public static ProjectRegionOperationName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionOperationName.parse: formattedString not in valid format"); + return of( + matchMap.get("operation"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String operation; + private String project; + private String region; + + public String getOperation() { + return operation; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (ProjectRegionOperationName projectRegionOperationName) { + operation = projectRegionOperationName.operation; + project = projectRegionOperationName.project; + region = projectRegionOperationName.region; + } + + public ProjectRegionOperationName build() { + return new ProjectRegionOperationName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "operation", operation, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionOperationName) { + ProjectRegionOperationName that = (ProjectRegionOperationName) o; + return + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + operation, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java new file mode 100644 index 000000000000..24336ec59128 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java @@ -0,0 +1,274 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.stub.ProjectStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ProjectClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getProject to 30 seconds: + * + *

+ * 
+ * ProjectSettings.Builder projectSettingsBuilder =
+ *     ProjectSettings.newBuilder();
+ * projectSettingsBuilder.getProjectSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ProjectSettings projectSettings = projectSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ProjectSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getProject. + */ + public UnaryCallSettings getProjectSettings() { + return ((ProjectStubSettings) getStubSettings()).getProjectSettings(); + } + + /** + * Returns the object with the settings used for calls to moveDiskProject. + */ + public UnaryCallSettings moveDiskProjectSettings() { + return ((ProjectStubSettings) getStubSettings()).moveDiskProjectSettings(); + } + + /** + * Returns the object with the settings used for calls to moveInstanceProject. + */ + public UnaryCallSettings moveInstanceProjectSettings() { + return ((ProjectStubSettings) getStubSettings()).moveInstanceProjectSettings(); + } + + /** + * Returns the object with the settings used for calls to setCommonInstanceMetadataProject. + */ + public UnaryCallSettings setCommonInstanceMetadataProjectSettings() { + return ((ProjectStubSettings) getStubSettings()).setCommonInstanceMetadataProjectSettings(); + } + + /** + * Returns the object with the settings used for calls to setUsageExportBucketProject. + */ + public UnaryCallSettings setUsageExportBucketProjectSettings() { + return ((ProjectStubSettings) getStubSettings()).setUsageExportBucketProjectSettings(); + } + + + public static final ProjectSettings create(ProjectStubSettings stub) throws IOException { + return new ProjectSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ProjectStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return ProjectStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return ProjectStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return ProjectStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ProjectStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return ProjectStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ProjectStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProjectStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ProjectSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for ProjectSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ProjectStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ProjectStubSettings.newBuilder()); + } + + protected Builder(ProjectSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ProjectStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public ProjectStubSettings.Builder getStubSettingsBuilder() { + return ((ProjectStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getProject. + */ + public UnaryCallSettings.Builder getProjectSettings() { + return getStubSettingsBuilder().getProjectSettings(); + } + + /** + * Returns the builder for the settings used for calls to moveDiskProject. + */ + public UnaryCallSettings.Builder moveDiskProjectSettings() { + return getStubSettingsBuilder().moveDiskProjectSettings(); + } + + /** + * Returns the builder for the settings used for calls to moveInstanceProject. + */ + public UnaryCallSettings.Builder moveInstanceProjectSettings() { + return getStubSettingsBuilder().moveInstanceProjectSettings(); + } + + /** + * Returns the builder for the settings used for calls to setCommonInstanceMetadataProject. + */ + public UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings() { + return getStubSettingsBuilder().setCommonInstanceMetadataProjectSettings(); + } + + /** + * Returns the builder for the settings used for calls to setUsageExportBucketProject. + */ + public UnaryCallSettings.Builder setUsageExportBucketProjectSettings() { + return getStubSettingsBuilder().setUsageExportBucketProjectSettings(); + } + + @Override + public ProjectSettings build() throws IOException { + return new ProjectSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java new file mode 100644 index 000000000000..0e1b6eef740d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectZoneOperationName implements ResourceName { + private final String operation; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/operations/{operation}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectZoneOperationName(Builder builder) { + operation = Preconditions.checkNotNull(builder.getOperation()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static ProjectZoneOperationName of( + String operation, + String project, + String zone + ) { + return newBuilder() + .setOperation(operation) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String operation, + String project, + String zone + ) { + return of( + operation, + project, + zone + ) + .toString(); + } + + public String getOperation() { + return operation; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("operation", operation); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectZoneOperationName parse(String formattedString) {return ProjectZoneOperationName.parse(formattedString);} + }; + } + + public static ProjectZoneOperationName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneOperationName.parse: formattedString not in valid format"); + return of( + matchMap.get("operation"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String operation; + private String project; + private String zone; + + public String getOperation() { + return operation; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setOperation(String operation) { + this.operation = operation; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (ProjectZoneOperationName projectZoneOperationName) { + operation = projectZoneOperationName.operation; + project = projectZoneOperationName.project; + zone = projectZoneOperationName.zone; + } + + public ProjectZoneOperationName build() { + return new ProjectZoneOperationName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "operation", operation, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectZoneOperationName) { + ProjectZoneOperationName that = (ProjectZoneOperationName) o; + return + Objects.equals(this.operation, that.getOperation()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + operation, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java new file mode 100644 index 000000000000..00eff7049361 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Quota implements ApiMessage { + private final Double limit; + private final String metric; + private final Double usage; + + private Quota() { + this.limit = null; + this.metric = null; + this.usage = null; + } + + + private Quota( + Double limit, + String metric, + Double usage + ) { + this.limit = limit; + this.metric = metric; + this.usage = usage; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("limit") && limit != null) { + fieldMap.put("limit", Collections.singletonList(String.valueOf(limit))); + } + if (fieldNames.contains("metric") && metric != null) { + fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); + } + if (fieldNames.contains("usage") && usage != null) { + fieldMap.put("usage", Collections.singletonList(String.valueOf(usage))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("limit")) { + return String.valueOf(limit); + } + if (fieldName.equals("metric")) { + return String.valueOf(metric); + } + if (fieldName.equals("usage")) { + return String.valueOf(usage); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Double getLimit() { + return limit; + } + + public String getMetric() { + return metric; + } + + public Double getUsage() { + return usage; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Quota prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Quota getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Quota DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Quota(); + } + + public static class Builder { + private Double limit; + private String metric; + private Double usage; + + Builder() {} + + public Builder mergeFrom(Quota other) { + if (other == Quota.getDefaultInstance()) return this; + if (other.getLimit() != null) { + this.limit = other.limit; + } + if (other.getMetric() != null) { + this.metric = other.metric; + } + if (other.getUsage() != null) { + this.usage = other.usage; + } + return this; + } + + Builder(Quota source) { + this.limit = source.limit; + this.metric = source.metric; + this.usage = source.usage; + } + + public Double getLimit() { + return limit; + } + + public Builder setLimit(Double limit) { + this.limit = limit; + return this; + } + + public String getMetric() { + return metric; + } + + public Builder setMetric(String metric) { + this.metric = metric; + return this; + } + + public Double getUsage() { + return usage; + } + + public Builder setUsage(Double usage) { + this.usage = usage; + return this; + } + + + public Quota build() { + + + return new Quota( + limit, + metric, + usage + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setLimit(this.limit); + newBuilder.setMetric(this.metric); + newBuilder.setUsage(this.usage); + return newBuilder; + } + } + + @Override + public String toString() { + return "Quota{" + + "limit=" + limit + ", " + + "metric=" + metric + ", " + + "usage=" + usage + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Quota) { + Quota that = (Quota) o; + return + Objects.equals(this.limit, that.getLimit()) && + Objects.equals(this.metric, that.getMetric()) && + Objects.equals(this.usage, that.getUsage()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + limit, + metric, + usage + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java new file mode 100644 index 000000000000..6aca6b7df6c0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RawDisk implements ApiMessage { + private final String containerType; + private final String sha1Checksum; + private final String source; + + private RawDisk() { + this.containerType = null; + this.sha1Checksum = null; + this.source = null; + } + + + private RawDisk( + String containerType, + String sha1Checksum, + String source + ) { + this.containerType = containerType; + this.sha1Checksum = sha1Checksum; + this.source = source; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("containerType") && containerType != null) { + fieldMap.put("containerType", Collections.singletonList(String.valueOf(containerType))); + } + if (fieldNames.contains("sha1Checksum") && sha1Checksum != null) { + fieldMap.put("sha1Checksum", Collections.singletonList(String.valueOf(sha1Checksum))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("containerType")) { + return String.valueOf(containerType); + } + if (fieldName.equals("sha1Checksum")) { + return String.valueOf(sha1Checksum); + } + if (fieldName.equals("source")) { + return String.valueOf(source); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getContainerType() { + return containerType; + } + + public String getSha1Checksum() { + return sha1Checksum; + } + + public String getSource() { + return source; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RawDisk prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RawDisk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RawDisk DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RawDisk(); + } + + public static class Builder { + private String containerType; + private String sha1Checksum; + private String source; + + Builder() {} + + public Builder mergeFrom(RawDisk other) { + if (other == RawDisk.getDefaultInstance()) return this; + if (other.getContainerType() != null) { + this.containerType = other.containerType; + } + if (other.getSha1Checksum() != null) { + this.sha1Checksum = other.sha1Checksum; + } + if (other.getSource() != null) { + this.source = other.source; + } + return this; + } + + Builder(RawDisk source) { + this.containerType = source.containerType; + this.sha1Checksum = source.sha1Checksum; + this.source = source.source; + } + + public String getContainerType() { + return containerType; + } + + public Builder setContainerType(String containerType) { + this.containerType = containerType; + return this; + } + + public String getSha1Checksum() { + return sha1Checksum; + } + + public Builder setSha1Checksum(String sha1Checksum) { + this.sha1Checksum = sha1Checksum; + return this; + } + + public String getSource() { + return source; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + + public RawDisk build() { + + + return new RawDisk( + containerType, + sha1Checksum, + source + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setContainerType(this.containerType); + newBuilder.setSha1Checksum(this.sha1Checksum); + newBuilder.setSource(this.source); + return newBuilder; + } + } + + @Override + public String toString() { + return "RawDisk{" + + "containerType=" + containerType + ", " + + "sha1Checksum=" + sha1Checksum + ", " + + "source=" + source + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RawDisk) { + RawDisk that = (RawDisk) o; + return + Objects.equals(this.containerType, that.getContainerType()) && + Objects.equals(this.sha1Checksum, that.getSha1Checksum()) && + Objects.equals(this.source, that.getSource()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + containerType, + sha1Checksum, + source + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..9aa6cead1c86 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RecreateInstancesInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private RecreateInstancesInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagersRecreateInstancesRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private RecreateInstancesInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") && instanceGroupManagersRecreateInstancesRequestResource != null) { + fieldMap.put("instanceGroupManagersRecreateInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("instanceGroupManagersRecreateInstancesRequestResource")) { + return String.valueOf(instanceGroupManagersRecreateInstancesRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManagersRecreateInstancesRequest getApiMessageRequestBody() { + return instanceGroupManagersRecreateInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() { + return instanceGroupManagersRecreateInstancesRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RecreateInstancesInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RecreateInstancesInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RecreateInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RecreateInstancesInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) { + if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagersRecreateInstancesRequestResource() != null) { + this.instanceGroupManagersRecreateInstancesRequestResource = other.instanceGroupManagersRecreateInstancesRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(RecreateInstancesInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagersRecreateInstancesRequestResource = source.instanceGroupManagersRecreateInstancesRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() { + return instanceGroupManagersRecreateInstancesRequestResource; + } + + public Builder setInstanceGroupManagersRecreateInstancesRequestResource(InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { + this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public RecreateInstancesInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new RecreateInstancesInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersRecreateInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource(this.instanceGroupManagersRecreateInstancesRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "RecreateInstancesInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "instanceGroupManagersRecreateInstancesRequestResource=" + instanceGroupManagersRecreateInstancesRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RecreateInstancesInstanceGroupManagerHttpRequest) { + RecreateInstancesInstanceGroupManagerHttpRequest that = (RecreateInstancesInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.instanceGroupManagersRecreateInstancesRequestResource, that.getInstanceGroupManagersRecreateInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersRecreateInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..ef7c045a3f38 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RecreateInstancesRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource; + private final String userIp; + + private RecreateInstancesRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupManagersRecreateRequestResource = null; + this.userIp = null; + } + + + private RecreateInstancesRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") && regionInstanceGroupManagersRecreateRequestResource != null) { + fieldMap.put("regionInstanceGroupManagersRecreateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupManagersRecreateRequestResource")) { + return String.valueOf(regionInstanceGroupManagersRecreateRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupManagersRecreateRequest getApiMessageRequestBody() { + return regionInstanceGroupManagersRecreateRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() { + return regionInstanceGroupManagersRecreateRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RecreateInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RecreateInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RecreateInstancesRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest other) { + if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupManagersRecreateRequestResource() != null) { + this.regionInstanceGroupManagersRecreateRequestResource = other.regionInstanceGroupManagersRecreateRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(RecreateInstancesRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupManagersRecreateRequestResource = source.regionInstanceGroupManagersRecreateRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() { + return regionInstanceGroupManagersRecreateRequestResource; + } + + public Builder setRegionInstanceGroupManagersRecreateRequestResource(RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { + this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public RecreateInstancesRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new RecreateInstancesRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersRecreateRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupManagersRecreateRequestResource(this.regionInstanceGroupManagersRecreateRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "RecreateInstancesRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupManagersRecreateRequestResource=" + regionInstanceGroupManagersRecreateRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RecreateInstancesRegionInstanceGroupManagerHttpRequest) { + RecreateInstancesRegionInstanceGroupManagerHttpRequest that = (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupManagersRecreateRequestResource, that.getRegionInstanceGroupManagersRecreateRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersRecreateRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java new file mode 100644 index 000000000000..ccf4e9bcaed3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java @@ -0,0 +1,492 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Region implements ApiMessage { + private final String creationTimestamp; + private final DeprecationStatus deprecated; + private final String description; + private final String id; + private final String kind; + private final String name; + private final List quotas; + private final String selfLink; + private final String status; + private final List zones; + + private Region() { + this.creationTimestamp = null; + this.deprecated = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.quotas = null; + this.selfLink = null; + this.status = null; + this.zones = null; + } + + + private Region( + String creationTimestamp, + DeprecationStatus deprecated, + String description, + String id, + String kind, + String name, + List quotas, + String selfLink, + String status, + List zones + ) { + this.creationTimestamp = creationTimestamp; + this.deprecated = deprecated; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.quotas = quotas; + this.selfLink = selfLink; + this.status = status; + this.zones = zones; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("quotas") && quotas != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Quota item : quotas) { + stringList.add(item.toString()); + } + fieldMap.put("quotas", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("zones") && zones != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : zones) { + stringList.add(item.toString()); + } + fieldMap.put("zones", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("quotas")) { + return String.valueOf(quotas); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("zones")) { + return String.valueOf(zones); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public List getQuotasList() { + return quotas; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStatus() { + return status; + } + + public List getZonesList() { + return zones; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Region prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Region getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Region DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Region(); + } + + public static class Builder { + private String creationTimestamp; + private DeprecationStatus deprecated; + private String description; + private String id; + private String kind; + private String name; + private List quotas; + private String selfLink; + private String status; + private List zones; + + Builder() {} + + public Builder mergeFrom(Region other) { + if (other == Region.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getQuotasList() != null) { + this.quotas = other.quotas; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getZonesList() != null) { + this.zones = other.zones; + } + return this; + } + + Builder(Region source) { + this.creationTimestamp = source.creationTimestamp; + this.deprecated = source.deprecated; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.quotas = source.quotas; + this.selfLink = source.selfLink; + this.status = source.status; + this.zones = source.zones; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getQuotasList() { + return quotas; + } + + public Builder addAllQuotas(List quotas) { + if (this.quotas == null) { + this.quotas = new ArrayList<>(quotas.size()); + } + this.quotas.addAll(quotas); + return this; + } + + public Builder addQuotas(Quota quotas) { + this.quotas.add(quotas); + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public List getZonesList() { + return zones; + } + + public Builder addAllZones(List zones) { + if (this.zones == null) { + this.zones = new ArrayList<>(zones.size()); + } + this.zones.addAll(zones); + return this; + } + + public Builder addZones(String zones) { + this.zones.add(zones); + return this; + } + + + public Region build() { + + + + + + + + + + return new Region( + creationTimestamp, + deprecated, + description, + id, + kind, + name, + quotas, + selfLink, + status, + zones + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.addAllQuotas(this.quotas); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); + newBuilder.addAllZones(this.zones); + return newBuilder; + } + } + + @Override + public String toString() { + return "Region{" + + "creationTimestamp=" + creationTimestamp + ", " + + "deprecated=" + deprecated + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "quotas=" + quotas + ", " + + "selfLink=" + selfLink + ", " + + "status=" + status + ", " + + "zones=" + zones + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Region) { + Region that = (Region) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.quotas, that.getQuotasList()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.zones, that.getZonesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + deprecated, + description, + id, + kind, + name, + quotas, + selfLink, + status, + zones + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java new file mode 100644 index 000000000000..0dfa08837464 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java @@ -0,0 +1,946 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RegionAutoscalerStub; +import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+ *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+ *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionAutoscalerSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionAutoscalerSettings regionAutoscalerSettings =
+ *     RegionAutoscalerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionAutoscalerClient regionAutoscalerClient =
+ *     RegionAutoscalerClient.create(regionAutoscalerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionAutoscalerSettings regionAutoscalerSettings =
+ *     RegionAutoscalerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionAutoscalerClient regionAutoscalerClient =
+ *     RegionAutoscalerClient.create(regionAutoscalerSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionAutoscalerClient implements BackgroundResource { + private final RegionAutoscalerSettings settings; + private final RegionAutoscalerStub stub; + + + + /** + * Constructs an instance of RegionAutoscalerClient with default settings. + */ + public static final RegionAutoscalerClient create() throws IOException { + return create(RegionAutoscalerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionAutoscalerClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings) throws IOException { + return new RegionAutoscalerClient(settings); + } + + /** + * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionAutoscalerSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) { + return new RegionAutoscalerClient(stub); + } + + /** + * Constructs an instance of RegionAutoscalerClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionAutoscalerClient(RegionAutoscalerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionAutoscalerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionAutoscalerClient(RegionAutoscalerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionAutoscalerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionAutoscalerStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autoscaler) { + + DeleteRegionAutoscalerHttpRequest request = + DeleteRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .build(); + return deleteRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler.toString());
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionAutoscaler(String autoscaler) { + + DeleteRegionAutoscalerHttpRequest request = + DeleteRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .build(); + return deleteRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest request) { + return deleteRegionAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = regionAutoscalerClient.deleteRegionAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRegionAutoscalerCallable() { + return stub.deleteRegionAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   Autoscaler response = regionAutoscalerClient.getRegionAutoscaler(autoscaler);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscaler) { + + GetRegionAutoscalerHttpRequest request = + GetRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .build(); + return getRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   Autoscaler response = regionAutoscalerClient.getRegionAutoscaler(autoscaler.toString());
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Autoscaler getRegionAutoscaler(String autoscaler) { + + GetRegionAutoscalerHttpRequest request = + GetRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .build(); + return getRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   GetRegionAutoscalerHttpRequest request = GetRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   Autoscaler response = regionAutoscalerClient.getRegionAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest request) { + return getRegionAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified autoscaler. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   GetRegionAutoscalerHttpRequest request = GetRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler.toString())
+   *     .build();
+   *   ApiFuture<Autoscaler> future = regionAutoscalerClient.getRegionAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Autoscaler response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionAutoscalerCallable() { + return stub.getRegionAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(region, autoscalerResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionAutoscaler(RegionName region, Autoscaler autoscalerResource) { + + InsertRegionAutoscalerHttpRequest request = + InsertRegionAutoscalerHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); + return insertRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(region.toString(), autoscalerResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionAutoscaler(String region, Autoscaler autoscalerResource) { + + InsertRegionAutoscalerHttpRequest request = + InsertRegionAutoscalerHttpRequest.newBuilder() + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); + return insertRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest request) { + return insertRegionAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionAutoscalerClient.insertRegionAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRegionAutoscalerCallable() { + return stub.insertRegionAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Autoscaler element : regionAutoscalerClient.listRegionAutoscalers(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName region) { + ListRegionAutoscalersHttpRequest request = + ListRegionAutoscalersHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionAutoscalers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Autoscaler element : regionAutoscalerClient.listRegionAutoscalers(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String region) { + ListRegionAutoscalersHttpRequest request = + ListRegionAutoscalersHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRegionAutoscalers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Autoscaler element : regionAutoscalerClient.listRegionAutoscalers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegionAutoscalersHttpRequest request) { + return listRegionAutoscalersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionAutoscalersPagedResponse> future = regionAutoscalerClient.listRegionAutoscalersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Autoscaler element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionAutoscalersPagedCallable() { + return stub.listRegionAutoscalersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     RegionAutoscalerList response = regionAutoscalerClient.listRegionAutoscalersCallable().call(request);
+   *     for (Autoscaler element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionAutoscalersCallable() { + return stub.listRegionAutoscalersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, region, autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param region Name of the region scoping this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionAutoscaler(String autoscaler, RegionName region, Autoscaler autoscalerResource) { + + PatchRegionAutoscalerHttpRequest request = + PatchRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); + return patchRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, region.toString(), autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param region Name of the region scoping this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionAutoscaler(String autoscaler, String region, Autoscaler autoscalerResource) { + + PatchRegionAutoscalerHttpRequest request = + PatchRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); + return patchRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setRegion(region.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest request) { + return patchRegionAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setRegion(region.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionAutoscalerClient.patchRegionAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchRegionAutoscalerCallable() { + return stub.patchRegionAutoscalerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, region, autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param region Name of the region scoping this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRegionAutoscaler(String autoscaler, RegionName region, Autoscaler autoscalerResource) { + + UpdateRegionAutoscalerHttpRequest request = + UpdateRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); + return updateRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, region.toString(), autoscalerResource);
+   * }
+   * 
+ * + * @param autoscaler Name of the autoscaler to update. + * @param region Name of the region scoping this request. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRegionAutoscaler(String autoscaler, String region, Autoscaler autoscalerResource) { + + UpdateRegionAutoscalerHttpRequest request = + UpdateRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); + return updateRegionAutoscaler(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setRegion(region.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest request) { + return updateRegionAutoscalerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String autoscaler = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+   *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
+   *     .setAutoscaler(autoscaler)
+   *     .setRegion(region.toString())
+   *     .setAutoscalerResource(autoscalerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionAutoscalerClient.updateRegionAutoscalerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateRegionAutoscalerCallable() { + return stub.updateRegionAutoscalerCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionAutoscalersPagedResponse extends AbstractPagedListResponse< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage, + ListRegionAutoscalersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionAutoscalersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionAutoscalersPagedResponse apply(ListRegionAutoscalersPage input) { + return new ListRegionAutoscalersPagedResponse(input); + } + }); + } + + private ListRegionAutoscalersPagedResponse(ListRegionAutoscalersPage page) { + super(page, ListRegionAutoscalersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionAutoscalersPage extends AbstractPage< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage> { + + private ListRegionAutoscalersPage( + PageContext context, + RegionAutoscalerList response) { + super(context, response); + } + + private static ListRegionAutoscalersPage createEmptyPage() { + return new ListRegionAutoscalersPage(null, null); + } + + @Override + protected ListRegionAutoscalersPage createPage( + PageContext context, + RegionAutoscalerList response) { + return new ListRegionAutoscalersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage, + ListRegionAutoscalersFixedSizeCollection> { + + private ListRegionAutoscalersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionAutoscalersFixedSizeCollection createEmptyCollection() { + return new ListRegionAutoscalersFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionAutoscalersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionAutoscalersFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java new file mode 100644 index 000000000000..3158c8d9cc8c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionAutoscalerList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RegionAutoscalerList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RegionAutoscalerList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Autoscaler item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionAutoscalerList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionAutoscalerList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionAutoscalerList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionAutoscalerList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RegionAutoscalerList other) { + if (other == RegionAutoscalerList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RegionAutoscalerList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Autoscaler items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RegionAutoscalerList build() { + + + + + return new RegionAutoscalerList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionAutoscalerList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionAutoscalerList) { + RegionAutoscalerList that = (RegionAutoscalerList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java new file mode 100644 index 000000000000..e4c01674da70 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionAutoscalerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRegionAutoscaler to 30 seconds: + * + *

+ * 
+ * RegionAutoscalerSettings.Builder regionAutoscalerSettingsBuilder =
+ *     RegionAutoscalerSettings.newBuilder();
+ * regionAutoscalerSettingsBuilder.deleteRegionAutoscalerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionAutoscalerSettings regionAutoscalerSettings = regionAutoscalerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionAutoscalerSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteRegionAutoscaler. + */ + public UnaryCallSettings deleteRegionAutoscalerSettings() { + return ((RegionAutoscalerStubSettings) getStubSettings()).deleteRegionAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to getRegionAutoscaler. + */ + public UnaryCallSettings getRegionAutoscalerSettings() { + return ((RegionAutoscalerStubSettings) getStubSettings()).getRegionAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to insertRegionAutoscaler. + */ + public UnaryCallSettings insertRegionAutoscalerSettings() { + return ((RegionAutoscalerStubSettings) getStubSettings()).insertRegionAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegionAutoscalers. + */ + public PagedCallSettings listRegionAutoscalersSettings() { + return ((RegionAutoscalerStubSettings) getStubSettings()).listRegionAutoscalersSettings(); + } + + /** + * Returns the object with the settings used for calls to patchRegionAutoscaler. + */ + public UnaryCallSettings patchRegionAutoscalerSettings() { + return ((RegionAutoscalerStubSettings) getStubSettings()).patchRegionAutoscalerSettings(); + } + + /** + * Returns the object with the settings used for calls to updateRegionAutoscaler. + */ + public UnaryCallSettings updateRegionAutoscalerSettings() { + return ((RegionAutoscalerStubSettings) getStubSettings()).updateRegionAutoscalerSettings(); + } + + + public static final RegionAutoscalerSettings create(RegionAutoscalerStubSettings stub) throws IOException { + return new RegionAutoscalerSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionAutoscalerStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionAutoscalerStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionAutoscalerStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionAutoscalerStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionAutoscalerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionAutoscalerStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionAutoscalerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionAutoscalerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionAutoscalerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionAutoscalerSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionAutoscalerStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionAutoscalerStubSettings.newBuilder()); + } + + protected Builder(RegionAutoscalerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionAutoscalerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionAutoscalerStubSettings.Builder getStubSettingsBuilder() { + return ((RegionAutoscalerStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionAutoscaler. + */ + public UnaryCallSettings.Builder deleteRegionAutoscalerSettings() { + return getStubSettingsBuilder().deleteRegionAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRegionAutoscaler. + */ + public UnaryCallSettings.Builder getRegionAutoscalerSettings() { + return getStubSettingsBuilder().getRegionAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertRegionAutoscaler. + */ + public UnaryCallSettings.Builder insertRegionAutoscalerSettings() { + return getStubSettingsBuilder().insertRegionAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegionAutoscalers. + */ + public PagedCallSettings.Builder listRegionAutoscalersSettings() { + return getStubSettingsBuilder().listRegionAutoscalersSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchRegionAutoscaler. + */ + public UnaryCallSettings.Builder patchRegionAutoscalerSettings() { + return getStubSettingsBuilder().patchRegionAutoscalerSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateRegionAutoscaler. + */ + public UnaryCallSettings.Builder updateRegionAutoscalerSettings() { + return getStubSettingsBuilder().updateRegionAutoscalerSettings(); + } + + @Override + public RegionAutoscalerSettings build() throws IOException { + return new RegionAutoscalerSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java new file mode 100644 index 000000000000..d58b009d7032 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java @@ -0,0 +1,1031 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RegionBackendServiceStub; +import com.google.cloud.compute.v1.stub.RegionBackendServiceStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+ *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+ *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionBackendServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionBackendServiceSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionBackendServiceSettings regionBackendServiceSettings =
+ *     RegionBackendServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionBackendServiceClient regionBackendServiceClient =
+ *     RegionBackendServiceClient.create(regionBackendServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionBackendServiceSettings regionBackendServiceSettings =
+ *     RegionBackendServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionBackendServiceClient regionBackendServiceClient =
+ *     RegionBackendServiceClient.create(regionBackendServiceSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionBackendServiceClient implements BackgroundResource { + private final RegionBackendServiceSettings settings; + private final RegionBackendServiceStub stub; + + + + /** + * Constructs an instance of RegionBackendServiceClient with default settings. + */ + public static final RegionBackendServiceClient create() throws IOException { + return create(RegionBackendServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionBackendServiceClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionBackendServiceClient create(RegionBackendServiceSettings settings) throws IOException { + return new RegionBackendServiceClient(settings); + } + + /** + * Constructs an instance of RegionBackendServiceClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionBackendServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionBackendServiceClient create(RegionBackendServiceStub stub) { + return new RegionBackendServiceClient(stub); + } + + /** + * Constructs an instance of RegionBackendServiceClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionBackendServiceClient(RegionBackendServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionBackendServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionBackendServiceClient(RegionBackendServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionBackendServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionBackendServiceStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionBackendService(ProjectRegionBackendServiceName backendService) { + + DeleteRegionBackendServiceHttpRequest request = + DeleteRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); + return deleteRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService.toString());
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionBackendService(String backendService) { + + DeleteRegionBackendServiceHttpRequest request = + DeleteRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .build(); + return deleteRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionBackendService(DeleteRegionBackendServiceHttpRequest request) { + return deleteRegionBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = regionBackendServiceClient.deleteRegionBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRegionBackendServiceCallable() { + return stub.deleteRegionBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService response = regionBackendServiceClient.getRegionBackendService(backendService);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendService getRegionBackendService(ProjectRegionBackendServiceName backendService) { + + GetRegionBackendServiceHttpRequest request = + GetRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); + return getRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService response = regionBackendServiceClient.getRegionBackendService(backendService.toString());
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendService getRegionBackendService(String backendService) { + + GetRegionBackendServiceHttpRequest request = + GetRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .build(); + return getRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   GetRegionBackendServiceHttpRequest request = GetRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   BackendService response = regionBackendServiceClient.getRegionBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendService getRegionBackendService(GetRegionBackendServiceHttpRequest request) { + return getRegionBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional BackendService resource. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   GetRegionBackendServiceHttpRequest request = GetRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .build();
+   *   ApiFuture<BackendService> future = regionBackendServiceClient.getRegionBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   BackendService response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionBackendServiceCallable() { + return stub.getRegionBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this regional BackendService. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   BackendServiceGroupHealth response = regionBackendServiceClient.getHealthRegionBackendService(backendService, resourceGroupReferenceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param resourceGroupReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendServiceGroupHealth getHealthRegionBackendService(ProjectRegionBackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource) { + + GetHealthRegionBackendServiceHttpRequest request = + GetHealthRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setResourceGroupReferenceResource(resourceGroupReferenceResource) + .build(); + return getHealthRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this regional BackendService. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   BackendServiceGroupHealth response = regionBackendServiceClient.getHealthRegionBackendService(backendService.toString(), resourceGroupReferenceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param resourceGroupReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendServiceGroupHealth getHealthRegionBackendService(String backendService, ResourceGroupReference resourceGroupReferenceResource) { + + GetHealthRegionBackendServiceHttpRequest request = + GetHealthRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setResourceGroupReferenceResource(resourceGroupReferenceResource) + .build(); + return getHealthRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this regional BackendService. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   GetHealthRegionBackendServiceHttpRequest request = GetHealthRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setResourceGroupReferenceResource(resourceGroupReferenceResource)
+   *     .build();
+   *   BackendServiceGroupHealth response = regionBackendServiceClient.getHealthRegionBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendServiceGroupHealth getHealthRegionBackendService(GetHealthRegionBackendServiceHttpRequest request) { + return getHealthRegionBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for this regional BackendService. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
+   *   GetHealthRegionBackendServiceHttpRequest request = GetHealthRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setResourceGroupReferenceResource(resourceGroupReferenceResource)
+   *     .build();
+   *   ApiFuture<BackendServiceGroupHealth> future = regionBackendServiceClient.getHealthRegionBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   BackendServiceGroupHealth response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getHealthRegionBackendServiceCallable() { + return stub.getHealthRegionBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = regionBackendServiceClient.insertRegionBackendService(region, backendServiceResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionBackendService(RegionName region, BackendService backendServiceResource) { + + InsertRegionBackendServiceHttpRequest request = + InsertRegionBackendServiceHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); + return insertRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = regionBackendServiceClient.insertRegionBackendService(region.toString(), backendServiceResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionBackendService(String region, BackendService backendServiceResource) { + + InsertRegionBackendServiceHttpRequest request = + InsertRegionBackendServiceHttpRequest.newBuilder() + .setRegion(region) + .setBackendServiceResource(backendServiceResource) + .build(); + return insertRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   Operation response = regionBackendServiceClient.insertRegionBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionBackendService(InsertRegionBackendServiceHttpRequest request) { + return insertRegionBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionBackendServiceClient.insertRegionBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRegionBackendServiceCallable() { + return stub.insertRegionBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (BackendService element : regionBackendServiceClient.listRegionBackendServices(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionBackendServicesPagedResponse listRegionBackendServices(RegionName region) { + ListRegionBackendServicesHttpRequest request = + ListRegionBackendServicesHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionBackendServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (BackendService element : regionBackendServiceClient.listRegionBackendServices(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionBackendServicesPagedResponse listRegionBackendServices(String region) { + ListRegionBackendServicesHttpRequest request = + ListRegionBackendServicesHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRegionBackendServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (BackendService element : regionBackendServiceClient.listRegionBackendServices(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionBackendServicesPagedResponse listRegionBackendServices(ListRegionBackendServicesHttpRequest request) { + return listRegionBackendServicesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionBackendServicesPagedResponse> future = regionBackendServiceClient.listRegionBackendServicesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (BackendService element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionBackendServicesPagedCallable() { + return stub.listRegionBackendServicesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     BackendServiceList response = regionBackendServiceClient.listRegionBackendServicesCallable().call(request);
+   *     for (BackendService element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionBackendServicesCallable() { + return stub.listRegionBackendServicesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(backendService, backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionBackendService(ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { + + PatchRegionBackendServiceHttpRequest request = + PatchRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); + return patchRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(backendService.toString(), backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionBackendService(String backendService, BackendService backendServiceResource) { + + PatchRegionBackendServiceHttpRequest request = + PatchRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); + return patchRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRequest request) { + return patchRegionBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionBackendServiceClient.patchRegionBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchRegionBackendServiceCallable() { + return stub.patchRegionBackendServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(backendService, backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRegionBackendService(ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { + + UpdateRegionBackendServiceHttpRequest request = + UpdateRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); + return updateRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(backendService.toString(), backendServiceResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to update. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRegionBackendService(String backendService, BackendService backendServiceResource) { + + UpdateRegionBackendServiceHttpRequest request = + UpdateRegionBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); + return updateRegionBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRegionBackendService(UpdateRegionBackendServiceHttpRequest request) { + return updateRegionBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * + * Sample code: + *

+   * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+   *   BackendService backendServiceResource = BackendService.newBuilder().build();
+   *   UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setBackendServiceResource(backendServiceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionBackendServiceClient.updateRegionBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateRegionBackendServiceCallable() { + return stub.updateRegionBackendServiceCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionBackendServicesPagedResponse extends AbstractPagedListResponse< + ListRegionBackendServicesHttpRequest, + BackendServiceList, + BackendService, + ListRegionBackendServicesPage, + ListRegionBackendServicesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionBackendServicesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionBackendServicesPagedResponse apply(ListRegionBackendServicesPage input) { + return new ListRegionBackendServicesPagedResponse(input); + } + }); + } + + private ListRegionBackendServicesPagedResponse(ListRegionBackendServicesPage page) { + super(page, ListRegionBackendServicesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionBackendServicesPage extends AbstractPage< + ListRegionBackendServicesHttpRequest, + BackendServiceList, + BackendService, + ListRegionBackendServicesPage> { + + private ListRegionBackendServicesPage( + PageContext context, + BackendServiceList response) { + super(context, response); + } + + private static ListRegionBackendServicesPage createEmptyPage() { + return new ListRegionBackendServicesPage(null, null); + } + + @Override + protected ListRegionBackendServicesPage createPage( + PageContext context, + BackendServiceList response) { + return new ListRegionBackendServicesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionBackendServicesFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionBackendServicesHttpRequest, + BackendServiceList, + BackendService, + ListRegionBackendServicesPage, + ListRegionBackendServicesFixedSizeCollection> { + + private ListRegionBackendServicesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionBackendServicesFixedSizeCollection createEmptyCollection() { + return new ListRegionBackendServicesFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionBackendServicesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionBackendServicesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java new file mode 100644 index 000000000000..78be1457cdaa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import com.google.cloud.compute.v1.stub.RegionBackendServiceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionBackendServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRegionBackendService to 30 seconds: + * + *

+ * 
+ * RegionBackendServiceSettings.Builder regionBackendServiceSettingsBuilder =
+ *     RegionBackendServiceSettings.newBuilder();
+ * regionBackendServiceSettingsBuilder.deleteRegionBackendServiceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionBackendServiceSettings regionBackendServiceSettings = regionBackendServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionBackendServiceSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteRegionBackendService. + */ + public UnaryCallSettings deleteRegionBackendServiceSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).deleteRegionBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to getRegionBackendService. + */ + public UnaryCallSettings getRegionBackendServiceSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).getRegionBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to getHealthRegionBackendService. + */ + public UnaryCallSettings getHealthRegionBackendServiceSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).getHealthRegionBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to insertRegionBackendService. + */ + public UnaryCallSettings insertRegionBackendServiceSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).insertRegionBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegionBackendServices. + */ + public PagedCallSettings listRegionBackendServicesSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).listRegionBackendServicesSettings(); + } + + /** + * Returns the object with the settings used for calls to patchRegionBackendService. + */ + public UnaryCallSettings patchRegionBackendServiceSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).patchRegionBackendServiceSettings(); + } + + /** + * Returns the object with the settings used for calls to updateRegionBackendService. + */ + public UnaryCallSettings updateRegionBackendServiceSettings() { + return ((RegionBackendServiceStubSettings) getStubSettings()).updateRegionBackendServiceSettings(); + } + + + public static final RegionBackendServiceSettings create(RegionBackendServiceStubSettings stub) throws IOException { + return new RegionBackendServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionBackendServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionBackendServiceStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionBackendServiceStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionBackendServiceStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionBackendServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionBackendServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionBackendServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionBackendServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionBackendServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionBackendServiceSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionBackendServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionBackendServiceStubSettings.newBuilder()); + } + + protected Builder(RegionBackendServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionBackendServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionBackendServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RegionBackendServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionBackendService. + */ + public UnaryCallSettings.Builder deleteRegionBackendServiceSettings() { + return getStubSettingsBuilder().deleteRegionBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRegionBackendService. + */ + public UnaryCallSettings.Builder getRegionBackendServiceSettings() { + return getStubSettingsBuilder().getRegionBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getHealthRegionBackendService. + */ + public UnaryCallSettings.Builder getHealthRegionBackendServiceSettings() { + return getStubSettingsBuilder().getHealthRegionBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertRegionBackendService. + */ + public UnaryCallSettings.Builder insertRegionBackendServiceSettings() { + return getStubSettingsBuilder().insertRegionBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegionBackendServices. + */ + public PagedCallSettings.Builder listRegionBackendServicesSettings() { + return getStubSettingsBuilder().listRegionBackendServicesSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchRegionBackendService. + */ + public UnaryCallSettings.Builder patchRegionBackendServiceSettings() { + return getStubSettingsBuilder().patchRegionBackendServiceSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateRegionBackendService. + */ + public UnaryCallSettings.Builder updateRegionBackendServiceSettings() { + return getStubSettingsBuilder().updateRegionBackendServiceSettings(); + } + + @Override + public RegionBackendServiceSettings build() throws IOException { + return new RegionBackendServiceSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java new file mode 100644 index 000000000000..8cc8421eeb58 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java @@ -0,0 +1,516 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RegionStub; +import com.google.cloud.compute.v1.stub.RegionStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionClient regionClient = RegionClient.create()) {
+ *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+ *   Region response = regionClient.getRegion(region);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionSettings regionSettings =
+ *     RegionSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionClient regionClient =
+ *     RegionClient.create(regionSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionSettings regionSettings =
+ *     RegionSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionClient regionClient =
+ *     RegionClient.create(regionSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionClient implements BackgroundResource { + private final RegionSettings settings; + private final RegionStub stub; + + + + /** + * Constructs an instance of RegionClient with default settings. + */ + public static final RegionClient create() throws IOException { + return create(RegionSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionClient create(RegionSettings settings) throws IOException { + return new RegionClient(settings); + } + + /** + * Constructs an instance of RegionClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionClient create(RegionStub stub) { + return new RegionClient(stub); + } + + /** + * Constructs an instance of RegionClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionClient(RegionSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionClient(RegionStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Region resource. Get a list of available regions by making a list() request. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Region response = regionClient.getRegion(region);
+   * }
+   * 
+ * + * @param region Name of the region resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Region getRegion(RegionName region) { + + GetRegionHttpRequest request = + GetRegionHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return getRegion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Region resource. Get a list of available regions by making a list() request. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Region response = regionClient.getRegion(region.toString());
+   * }
+   * 
+ * + * @param region Name of the region resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Region getRegion(String region) { + + GetRegionHttpRequest request = + GetRegionHttpRequest.newBuilder() + .setRegion(region) + .build(); + return getRegion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Region resource. Get a list of available regions by making a list() request. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   GetRegionHttpRequest request = GetRegionHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   Region response = regionClient.getRegion(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Region getRegion(GetRegionHttpRequest request) { + return getRegionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Region resource. Get a list of available regions by making a list() request. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   GetRegionHttpRequest request = GetRegionHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<Region> future = regionClient.getRegionCallable().futureCall(request);
+   *   // Do something
+   *   Region response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionCallable() { + return stub.getRegionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of region resources available to the specified project. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Region element : regionClient.listRegions(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionsPagedResponse listRegions(ProjectName project) { + ListRegionsHttpRequest request = + ListRegionsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listRegions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of region resources available to the specified project. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Region element : regionClient.listRegions(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionsPagedResponse listRegions(String project) { + ListRegionsHttpRequest request = + ListRegionsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listRegions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of region resources available to the specified project. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListRegionsHttpRequest request = ListRegionsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Region element : regionClient.listRegions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionsPagedResponse listRegions(ListRegionsHttpRequest request) { + return listRegionsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of region resources available to the specified project. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListRegionsHttpRequest request = ListRegionsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListRegionsPagedResponse> future = regionClient.listRegionsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Region element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionsPagedCallable() { + return stub.listRegionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of region resources available to the specified project. + * + * Sample code: + *

+   * try (RegionClient regionClient = RegionClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListRegionsHttpRequest request = ListRegionsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     RegionList response = regionClient.listRegionsCallable().call(request);
+   *     for (Region element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionsCallable() { + return stub.listRegionsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionsPagedResponse extends AbstractPagedListResponse< + ListRegionsHttpRequest, + RegionList, + Region, + ListRegionsPage, + ListRegionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionsPagedResponse apply(ListRegionsPage input) { + return new ListRegionsPagedResponse(input); + } + }); + } + + private ListRegionsPagedResponse(ListRegionsPage page) { + super(page, ListRegionsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionsPage extends AbstractPage< + ListRegionsHttpRequest, + RegionList, + Region, + ListRegionsPage> { + + private ListRegionsPage( + PageContext context, + RegionList response) { + super(context, response); + } + + private static ListRegionsPage createEmptyPage() { + return new ListRegionsPage(null, null); + } + + @Override + protected ListRegionsPage createPage( + PageContext context, + RegionList response) { + return new ListRegionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionsFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionsHttpRequest, + RegionList, + Region, + ListRegionsPage, + ListRegionsFixedSizeCollection> { + + private ListRegionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionsFixedSizeCollection createEmptyCollection() { + return new ListRegionsFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java new file mode 100644 index 000000000000..65ed48bb0f1c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java @@ -0,0 +1,853 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupStub; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+ *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+ *   InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionInstanceGroupClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionInstanceGroupSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionInstanceGroupSettings regionInstanceGroupSettings =
+ *     RegionInstanceGroupSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionInstanceGroupClient regionInstanceGroupClient =
+ *     RegionInstanceGroupClient.create(regionInstanceGroupSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionInstanceGroupSettings regionInstanceGroupSettings =
+ *     RegionInstanceGroupSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionInstanceGroupClient regionInstanceGroupClient =
+ *     RegionInstanceGroupClient.create(regionInstanceGroupSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionInstanceGroupClient implements BackgroundResource { + private final RegionInstanceGroupSettings settings; + private final RegionInstanceGroupStub stub; + + + + /** + * Constructs an instance of RegionInstanceGroupClient with default settings. + */ + public static final RegionInstanceGroupClient create() throws IOException { + return create(RegionInstanceGroupSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionInstanceGroupClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionInstanceGroupClient create(RegionInstanceGroupSettings settings) throws IOException { + return new RegionInstanceGroupClient(settings); + } + + /** + * Constructs an instance of RegionInstanceGroupClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionInstanceGroupSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionInstanceGroupClient create(RegionInstanceGroupStub stub) { + return new RegionInstanceGroupClient(stub); + } + + /** + * Constructs an instance of RegionInstanceGroupClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionInstanceGroupClient(RegionInstanceGroupSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionInstanceGroupStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionInstanceGroupClient(RegionInstanceGroupStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionInstanceGroupSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionInstanceGroupStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group resource. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup);
+   * }
+   * 
+ * + * @param instanceGroup Name of the instance group resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroup getRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup) { + + GetRegionInstanceGroupHttpRequest request = + GetRegionInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .build(); + return getRegionInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group resource. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup.toString());
+   * }
+   * 
+ * + * @param instanceGroup Name of the instance group resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroup getRegionInstanceGroup(String instanceGroup) { + + GetRegionInstanceGroupHttpRequest request = + GetRegionInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .build(); + return getRegionInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group resource. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   GetRegionInstanceGroupHttpRequest request = GetRegionInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .build();
+   *   InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroup getRegionInstanceGroup(GetRegionInstanceGroupHttpRequest request) { + return getRegionInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified instance group resource. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   GetRegionInstanceGroupHttpRequest request = GetRegionInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .build();
+   *   ApiFuture<InstanceGroup> future = regionInstanceGroupClient.getRegionInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   InstanceGroup response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionInstanceGroupCallable() { + return stub.getRegionInstanceGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(RegionName region) { + ListRegionInstanceGroupsHttpRequest request = + ListRegionInstanceGroupsHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(String region) { + ListRegionInstanceGroupsHttpRequest request = + ListRegionInstanceGroupsHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRegionInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(ListRegionInstanceGroupsHttpRequest request) { + return listRegionInstanceGroupsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionInstanceGroupsPagedResponse> future = regionInstanceGroupClient.listRegionInstanceGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceGroup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionInstanceGroupsPagedCallable() { + return stub.listRegionInstanceGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     RegionInstanceGroupList response = regionInstanceGroupClient.listRegionInstanceGroupsCallable().call(request);
+   *     for (InstanceGroup element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionInstanceGroupsCallable() { + return stub.listRegionInstanceGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
+   *   for (InstanceWithNamedPorts element : regionInstanceGroupClient.listInstancesRegionInstanceGroups(instanceGroup, regionInstanceGroupsListInstancesRequestResource).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param instanceGroup Name of the regional instance group for which we want to list the instances. + * @param regionInstanceGroupsListInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { + ListInstancesRegionInstanceGroupsHttpRequest request = + ListInstancesRegionInstanceGroupsHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource) + .build(); + return listInstancesRegionInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
+   *   for (InstanceWithNamedPorts element : regionInstanceGroupClient.listInstancesRegionInstanceGroups(instanceGroup.toString(), regionInstanceGroupsListInstancesRequestResource).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param instanceGroup Name of the regional instance group for which we want to list the instances. + * @param regionInstanceGroupsListInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(String instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { + ListInstancesRegionInstanceGroupsHttpRequest request = + ListInstancesRegionInstanceGroupsHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource) + .build(); + return listInstancesRegionInstanceGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
+   *   ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource)
+   *     .build();
+   *   for (InstanceWithNamedPorts element : regionInstanceGroupClient.listInstancesRegionInstanceGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(ListInstancesRegionInstanceGroupsHttpRequest request) { + return listInstancesRegionInstanceGroupsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
+   *   ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<ListInstancesRegionInstanceGroupsPagedResponse> future = regionInstanceGroupClient.listInstancesRegionInstanceGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceWithNamedPorts element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstancesRegionInstanceGroupsPagedCallable() { + return stub.listInstancesRegionInstanceGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
+   *   ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource)
+   *     .build();
+   *   while (true) {
+   *     RegionInstanceGroupsListInstances response = regionInstanceGroupClient.listInstancesRegionInstanceGroupsCallable().call(request);
+   *     for (InstanceWithNamedPorts element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInstancesRegionInstanceGroupsCallable() { + return stub.listInstancesRegionInstanceGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified regional instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the regional instance group where the named ports are updated. + * @param regionInstanceGroupsSetNamedPortsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNamedPortsRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + + SetNamedPortsRegionInstanceGroupHttpRequest request = + SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource) + .build(); + return setNamedPortsRegionInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified regional instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup.toString(), regionInstanceGroupsSetNamedPortsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroup The name of the regional instance group where the named ports are updated. + * @param regionInstanceGroupsSetNamedPortsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNamedPortsRegionInstanceGroup(String instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + + SetNamedPortsRegionInstanceGroupHttpRequest request = + SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() + .setInstanceGroup(instanceGroup) + .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource) + .build(); + return setNamedPortsRegionInstanceGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified regional instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInstanceGroupHttpRequest request) { + return setNamedPortsRegionInstanceGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the named ports for the specified regional instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+   *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
+   *   SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
+   *     .setInstanceGroup(instanceGroup.toString())
+   *     .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupClient.setNamedPortsRegionInstanceGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setNamedPortsRegionInstanceGroupCallable() { + return stub.setNamedPortsRegionInstanceGroupCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionInstanceGroupsPagedResponse extends AbstractPagedListResponse< + ListRegionInstanceGroupsHttpRequest, + RegionInstanceGroupList, + InstanceGroup, + ListRegionInstanceGroupsPage, + ListRegionInstanceGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionInstanceGroupsPagedResponse apply(ListRegionInstanceGroupsPage input) { + return new ListRegionInstanceGroupsPagedResponse(input); + } + }); + } + + private ListRegionInstanceGroupsPagedResponse(ListRegionInstanceGroupsPage page) { + super(page, ListRegionInstanceGroupsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionInstanceGroupsPage extends AbstractPage< + ListRegionInstanceGroupsHttpRequest, + RegionInstanceGroupList, + InstanceGroup, + ListRegionInstanceGroupsPage> { + + private ListRegionInstanceGroupsPage( + PageContext context, + RegionInstanceGroupList response) { + super(context, response); + } + + private static ListRegionInstanceGroupsPage createEmptyPage() { + return new ListRegionInstanceGroupsPage(null, null); + } + + @Override + protected ListRegionInstanceGroupsPage createPage( + PageContext context, + RegionInstanceGroupList response) { + return new ListRegionInstanceGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionInstanceGroupsHttpRequest, + RegionInstanceGroupList, + InstanceGroup, + ListRegionInstanceGroupsPage, + ListRegionInstanceGroupsFixedSizeCollection> { + + private ListRegionInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionInstanceGroupsFixedSizeCollection createEmptyCollection() { + return new ListRegionInstanceGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionInstanceGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionInstanceGroupsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListInstancesRegionInstanceGroupsPagedResponse extends AbstractPagedListResponse< + ListInstancesRegionInstanceGroupsHttpRequest, + RegionInstanceGroupsListInstances, + InstanceWithNamedPorts, + ListInstancesRegionInstanceGroupsPage, + ListInstancesRegionInstanceGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesRegionInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstancesRegionInstanceGroupsPagedResponse apply(ListInstancesRegionInstanceGroupsPage input) { + return new ListInstancesRegionInstanceGroupsPagedResponse(input); + } + }); + } + + private ListInstancesRegionInstanceGroupsPagedResponse(ListInstancesRegionInstanceGroupsPage page) { + super(page, ListInstancesRegionInstanceGroupsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInstancesRegionInstanceGroupsPage extends AbstractPage< + ListInstancesRegionInstanceGroupsHttpRequest, + RegionInstanceGroupsListInstances, + InstanceWithNamedPorts, + ListInstancesRegionInstanceGroupsPage> { + + private ListInstancesRegionInstanceGroupsPage( + PageContext context, + RegionInstanceGroupsListInstances response) { + super(context, response); + } + + private static ListInstancesRegionInstanceGroupsPage createEmptyPage() { + return new ListInstancesRegionInstanceGroupsPage(null, null); + } + + @Override + protected ListInstancesRegionInstanceGroupsPage createPage( + PageContext context, + RegionInstanceGroupsListInstances response) { + return new ListInstancesRegionInstanceGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInstancesRegionInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstancesRegionInstanceGroupsHttpRequest, + RegionInstanceGroupsListInstances, + InstanceWithNamedPorts, + ListInstancesRegionInstanceGroupsPage, + ListInstancesRegionInstanceGroupsFixedSizeCollection> { + + private ListInstancesRegionInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesRegionInstanceGroupsFixedSizeCollection createEmptyCollection() { + return new ListInstancesRegionInstanceGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesRegionInstanceGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesRegionInstanceGroupsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java new file mode 100644 index 000000000000..66e7f43c6a68 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RegionInstanceGroupList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RegionInstanceGroupList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroup item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupList other) { + if (other == RegionInstanceGroupList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RegionInstanceGroupList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceGroup items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RegionInstanceGroupList build() { + + + + + return new RegionInstanceGroupList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupList) { + RegionInstanceGroupList that = (RegionInstanceGroupList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java new file mode 100644 index 000000000000..149a1120ff04 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java @@ -0,0 +1,1442 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStub; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+ *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+ *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+ *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionInstanceGroupManagerSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionInstanceGroupManagerSettings regionInstanceGroupManagerSettings =
+ *     RegionInstanceGroupManagerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionInstanceGroupManagerClient regionInstanceGroupManagerClient =
+ *     RegionInstanceGroupManagerClient.create(regionInstanceGroupManagerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionInstanceGroupManagerSettings regionInstanceGroupManagerSettings =
+ *     RegionInstanceGroupManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionInstanceGroupManagerClient regionInstanceGroupManagerClient =
+ *     RegionInstanceGroupManagerClient.create(regionInstanceGroupManagerSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionInstanceGroupManagerClient implements BackgroundResource { + private final RegionInstanceGroupManagerSettings settings; + private final RegionInstanceGroupManagerStub stub; + + + + /** + * Constructs an instance of RegionInstanceGroupManagerClient with default settings. + */ + public static final RegionInstanceGroupManagerClient create() throws IOException { + return create(RegionInstanceGroupManagerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerSettings settings) throws IOException { + return new RegionInstanceGroupManagerClient(settings); + } + + /** + * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionInstanceGroupManagerSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerStub stub) { + return new RegionInstanceGroupManagerClient(stub); + } + + /** + * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionInstanceGroupManagerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionInstanceGroupManagerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionInstanceGroupManagerStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersAbandonInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation abandonInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { + + AbandonInstancesRegionInstanceGroupManagerHttpRequest request = + AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource) + .build(); + return abandonInstancesRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersAbandonInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersAbandonInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation abandonInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { + + AbandonInstancesRegionInstanceGroupManagerHttpRequest request = + AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource) + .build(); + return abandonInstancesRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstancesRegionInstanceGroupManagerHttpRequest request) { + return abandonInstancesRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to remove the specified instances 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+   *   AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { + return stub.abandonInstancesRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager) { + + DeleteRegionInstanceGroupManagerHttpRequest request = + DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return deleteRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionInstanceGroupManager(String instanceGroupManager) { + + DeleteRegionInstanceGroupManagerHttpRequest request = + DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .build(); + return deleteRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGroupManagerHttpRequest request) { + return deleteRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRegionInstanceGroupManagerCallable() { + return stub.deleteRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersDeleteInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { + + DeleteInstancesRegionInstanceGroupManagerHttpRequest request = + DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource) + .build(); + return deleteInstancesRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersDeleteInstancesRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersDeleteInstancesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { + + DeleteInstancesRegionInstanceGroupManagerHttpRequest request = + DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource) + .build(); + return deleteInstancesRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstancesRegionInstanceGroupManagerHttpRequest request) { + return deleteInstancesRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
+   *   DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { + return stub.deleteInstancesRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager response = regionInstanceGroupManagerClient.getRegionInstanceGroupManager(instanceGroupManager);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManager getRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager) { + + GetRegionInstanceGroupManagerHttpRequest request = + GetRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return getRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager response = regionInstanceGroupManagerClient.getRegionInstanceGroupManager(instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManager getRegionInstanceGroupManager(String instanceGroupManager) { + + GetRegionInstanceGroupManagerHttpRequest request = + GetRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .build(); + return getRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   GetRegionInstanceGroupManagerHttpRequest request = GetRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   InstanceGroupManager response = regionInstanceGroupManagerClient.getRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanceGroupManagerHttpRequest request) { + return getRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns all of the details about the specified managed instance group. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   GetRegionInstanceGroupManagerHttpRequest request = GetRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<InstanceGroupManager> future = regionInstanceGroupManagerClient.getRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   InstanceGroupManager response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionInstanceGroupManagerCallable() { + return stub.getRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region, instanceGroupManagerResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param instanceGroupManagerResource An Instance Group Manager resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionInstanceGroupManager(RegionName region, InstanceGroupManager instanceGroupManagerResource) { + + InsertRegionInstanceGroupManagerHttpRequest request = + InsertRegionInstanceGroupManagerHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); + return insertRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region.toString(), instanceGroupManagerResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param instanceGroupManagerResource An Instance Group Manager resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionInstanceGroupManager(String region, InstanceGroupManager instanceGroupManagerResource) { + + InsertRegionInstanceGroupManagerHttpRequest request = + InsertRegionInstanceGroupManagerHttpRequest.newBuilder() + .setRegion(region) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); + return insertRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGroupManagerHttpRequest request) { + return insertRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.insertRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRegionInstanceGroupManagerCallable() { + return stub.insertRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(RegionName region) { + ListRegionInstanceGroupManagersHttpRequest request = + ListRegionInstanceGroupManagersHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(String region) { + ListRegionInstanceGroupManagersHttpRequest request = + ListRegionInstanceGroupManagersHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRegionInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(ListRegionInstanceGroupManagersHttpRequest request) { + return listRegionInstanceGroupManagersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionInstanceGroupManagersPagedResponse> future = regionInstanceGroupManagerClient.listRegionInstanceGroupManagersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InstanceGroupManager element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionInstanceGroupManagersPagedCallable() { + return stub.listRegionInstanceGroupManagersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     RegionInstanceGroupManagerList response = regionInstanceGroupManagerClient.listRegionInstanceGroupManagersCallable().call(request);
+   *     for (InstanceGroupManager element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionInstanceGroupManagersCallable() { + return stub.listRegionInstanceGroupManagersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ProjectRegionInstanceGroupManagerName instanceGroupManager) { + + ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = + ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return listManagedInstancesRegionInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) { + + ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = + ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .build(); + return listManagedInstancesRegionInstanceGroupManagers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagers(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) { + return listManagedInstancesRegionInstanceGroupManagersCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<RegionInstanceGroupManagersListInstancesResponse> future = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagersCallable().futureCall(request);
+   *   // Do something
+   *   RegionInstanceGroupManagersListInstancesResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { + return stub.listManagedInstancesRegionInstanceGroupManagersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersRecreateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation recreateInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { + + RecreateInstancesRegionInstanceGroupManagerHttpRequest request = + RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource) + .build(); + return recreateInstancesRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersRecreateRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersRecreateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation recreateInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { + + RecreateInstancesRegionInstanceGroupManagerHttpRequest request = + RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource) + .build(); + return recreateInstancesRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
+   *   RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInstancesRegionInstanceGroupManagerHttpRequest request) { + return recreateInstancesRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
+   *   RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { + return stub.recreateInstancesRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager);
+   * }
+   * 
+ * + * @param size Number of instances that should exist in this instance group manager. + * @param instanceGroupManager Name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeRegionInstanceGroupManager(Integer size, ProjectRegionInstanceGroupManagerName instanceGroupManager) { + + ResizeRegionInstanceGroupManagerHttpRequest request = + ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() + .setSize(size) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); + return resizeRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager.toString());
+   * }
+   * 
+ * + * @param size Number of instances that should exist in this instance group manager. + * @param instanceGroupManager Name of the managed instance group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeRegionInstanceGroupManager(Integer size, String instanceGroupManager) { + + ResizeRegionInstanceGroupManagerHttpRequest request = + ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() + .setSize(size) + .setInstanceGroupManager(instanceGroupManager) + .build(); + return resizeRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setSize(size)
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGroupManagerHttpRequest request) { + return resizeRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   Integer size = 0;
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setSize(size)
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable resizeRegionInstanceGroupManagerCallable() { + return stub.resizeRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param regionInstanceGroupManagersSetTemplateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setInstanceTemplateRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { + + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource) + .build(); + return setInstanceTemplateRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTemplateRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the managed instance group. + * @param regionInstanceGroupManagersSetTemplateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setInstanceTemplateRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { + + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource) + .build(); + return setInstanceTemplateRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
+   *   SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) { + return setInstanceTemplateRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
+   *   SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { + return stub.setInstanceTemplateRegionInstanceGroupManagerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersSetTargetPoolsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetPoolsRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { + + SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = + SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource) + .build(); + return setTargetPoolsRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTargetPoolsRequestResource);
+   * }
+   * 
+ * + * @param instanceGroupManager Name of the managed instance group. + * @param regionInstanceGroupManagersSetTargetPoolsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetPoolsRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { + + SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = + SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource) + .build(); + return setTargetPoolsRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) { + return setTargetPoolsRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * Sample code: + *

+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
+   *   SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { + return stub.setTargetPoolsRegionInstanceGroupManagerCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionInstanceGroupManagersPagedResponse apply(ListRegionInstanceGroupManagersPage input) { + return new ListRegionInstanceGroupManagersPagedResponse(input); + } + }); + } + + private ListRegionInstanceGroupManagersPagedResponse(ListRegionInstanceGroupManagersPage page) { + super(page, ListRegionInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionInstanceGroupManagersPage extends AbstractPage< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage> { + + private ListRegionInstanceGroupManagersPage( + PageContext context, + RegionInstanceGroupManagerList response) { + super(context, response); + } + + private static ListRegionInstanceGroupManagersPage createEmptyPage() { + return new ListRegionInstanceGroupManagersPage(null, null); + } + + @Override + protected ListRegionInstanceGroupManagersPage createPage( + PageContext context, + RegionInstanceGroupManagerList response) { + return new ListRegionInstanceGroupManagersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { + + private ListRegionInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionInstanceGroupManagersFixedSizeCollection createEmptyCollection() { + return new ListRegionInstanceGroupManagersFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionInstanceGroupManagersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionInstanceGroupManagersFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java new file mode 100644 index 000000000000..6c7117738808 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagerList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RegionInstanceGroupManagerList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RegionInstanceGroupManagerList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroupManager item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagerList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagerList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagerList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagerList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagerList other) { + if (other == RegionInstanceGroupManagerList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RegionInstanceGroupManagerList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceGroupManager items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RegionInstanceGroupManagerList build() { + + + + + return new RegionInstanceGroupManagerList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagerList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagerList) { + RegionInstanceGroupManagerList that = (RegionInstanceGroupManagerList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java new file mode 100644 index 000000000000..0736c1d04482 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java @@ -0,0 +1,366 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionInstanceGroupManagerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of abandonInstancesRegionInstanceGroupManager to 30 seconds: + * + *

+ * 
+ * RegionInstanceGroupManagerSettings.Builder regionInstanceGroupManagerSettingsBuilder =
+ *     RegionInstanceGroupManagerSettings.newBuilder();
+ * regionInstanceGroupManagerSettingsBuilder.abandonInstancesRegionInstanceGroupManagerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionInstanceGroupManagerSettings regionInstanceGroupManagerSettings = regionInstanceGroupManagerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionInstanceGroupManagerSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to abandonInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings abandonInstancesRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).abandonInstancesRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteRegionInstanceGroupManager. + */ + public UnaryCallSettings deleteRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).deleteRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings deleteInstancesRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).deleteInstancesRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to getRegionInstanceGroupManager. + */ + public UnaryCallSettings getRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).getRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to insertRegionInstanceGroupManager. + */ + public UnaryCallSettings insertRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).insertRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegionInstanceGroupManagers. + */ + public PagedCallSettings listRegionInstanceGroupManagersSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).listRegionInstanceGroupManagersSettings(); + } + + /** + * Returns the object with the settings used for calls to listManagedInstancesRegionInstanceGroupManagers. + */ + public UnaryCallSettings listManagedInstancesRegionInstanceGroupManagersSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).listManagedInstancesRegionInstanceGroupManagersSettings(); + } + + /** + * Returns the object with the settings used for calls to recreateInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).recreateInstancesRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to resizeRegionInstanceGroupManager. + */ + public UnaryCallSettings resizeRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).resizeRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to setInstanceTemplateRegionInstanceGroupManager. + */ + public UnaryCallSettings setInstanceTemplateRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).setInstanceTemplateRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the object with the settings used for calls to setTargetPoolsRegionInstanceGroupManager. + */ + public UnaryCallSettings setTargetPoolsRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).setTargetPoolsRegionInstanceGroupManagerSettings(); + } + + + public static final RegionInstanceGroupManagerSettings create(RegionInstanceGroupManagerStubSettings stub) throws IOException { + return new RegionInstanceGroupManagerSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionInstanceGroupManagerStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionInstanceGroupManagerStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionInstanceGroupManagerStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionInstanceGroupManagerStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionInstanceGroupManagerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionInstanceGroupManagerStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionInstanceGroupManagerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionInstanceGroupManagerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionInstanceGroupManagerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionInstanceGroupManagerSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionInstanceGroupManagerStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionInstanceGroupManagerStubSettings.newBuilder()); + } + + protected Builder(RegionInstanceGroupManagerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionInstanceGroupManagerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionInstanceGroupManagerStubSettings.Builder getStubSettingsBuilder() { + return ((RegionInstanceGroupManagerStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to abandonInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder abandonInstancesRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().abandonInstancesRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().deleteRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteInstancesRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().deleteInstancesRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder getRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().getRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder insertRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().insertRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegionInstanceGroupManagers. + */ + public PagedCallSettings.Builder listRegionInstanceGroupManagersSettings() { + return getStubSettingsBuilder().listRegionInstanceGroupManagersSettings(); + } + + /** + * Returns the builder for the settings used for calls to listManagedInstancesRegionInstanceGroupManagers. + */ + public UnaryCallSettings.Builder listManagedInstancesRegionInstanceGroupManagersSettings() { + return getStubSettingsBuilder().listManagedInstancesRegionInstanceGroupManagersSettings(); + } + + /** + * Returns the builder for the settings used for calls to recreateInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder recreateInstancesRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().recreateInstancesRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to resizeRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder resizeRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().resizeRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to setInstanceTemplateRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder setInstanceTemplateRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().setInstanceTemplateRegionInstanceGroupManagerSettings(); + } + + /** + * Returns the builder for the settings used for calls to setTargetPoolsRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder setTargetPoolsRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().setTargetPoolsRegionInstanceGroupManagerSettings(); + } + + @Override + public RegionInstanceGroupManagerSettings build() throws IOException { + return new RegionInstanceGroupManagerSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java new file mode 100644 index 000000000000..33360df8476d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagersAbandonInstancesRequest implements ApiMessage { + private final List instances; + + private RegionInstanceGroupManagersAbandonInstancesRequest() { + this.instances = null; + } + + + private RegionInstanceGroupManagersAbandonInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagersAbandonInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagersAbandonInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagersAbandonInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagersAbandonInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagersAbandonInstancesRequest other) { + if (other == RegionInstanceGroupManagersAbandonInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(RegionInstanceGroupManagersAbandonInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + + public RegionInstanceGroupManagersAbandonInstancesRequest build() { + return new RegionInstanceGroupManagersAbandonInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagersAbandonInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagersAbandonInstancesRequest) { + RegionInstanceGroupManagersAbandonInstancesRequest that = (RegionInstanceGroupManagersAbandonInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java new file mode 100644 index 000000000000..1ab3b9d238a9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagersDeleteInstancesRequest implements ApiMessage { + private final List instances; + + private RegionInstanceGroupManagersDeleteInstancesRequest() { + this.instances = null; + } + + + private RegionInstanceGroupManagersDeleteInstancesRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagersDeleteInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagersDeleteInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagersDeleteInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagersDeleteInstancesRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagersDeleteInstancesRequest other) { + if (other == RegionInstanceGroupManagersDeleteInstancesRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(RegionInstanceGroupManagersDeleteInstancesRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + + public RegionInstanceGroupManagersDeleteInstancesRequest build() { + return new RegionInstanceGroupManagersDeleteInstancesRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagersDeleteInstancesRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagersDeleteInstancesRequest) { + RegionInstanceGroupManagersDeleteInstancesRequest that = (RegionInstanceGroupManagersDeleteInstancesRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java new file mode 100644 index 000000000000..90b87088dcbd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagersListInstancesResponse implements ApiMessage { + private final List managedInstances; + + private RegionInstanceGroupManagersListInstancesResponse() { + this.managedInstances = null; + } + + + private RegionInstanceGroupManagersListInstancesResponse( + List managedInstances + ) { + this.managedInstances = managedInstances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("managedInstances") && managedInstances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ManagedInstance item : managedInstances) { + stringList.add(item.toString()); + } + fieldMap.put("managedInstances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("managedInstances")) { + return String.valueOf(managedInstances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getManagedInstancesList() { + return managedInstances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagersListInstancesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagersListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagersListInstancesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagersListInstancesResponse(); + } + + public static class Builder { + private List managedInstances; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagersListInstancesResponse other) { + if (other == RegionInstanceGroupManagersListInstancesResponse.getDefaultInstance()) return this; + if (other.getManagedInstancesList() != null) { + this.managedInstances = other.managedInstances; + } + return this; + } + + Builder(RegionInstanceGroupManagersListInstancesResponse source) { + this.managedInstances = source.managedInstances; + } + + public List getManagedInstancesList() { + return managedInstances; + } + + public Builder addAllManagedInstances(List managedInstances) { + if (this.managedInstances == null) { + this.managedInstances = new ArrayList<>(managedInstances.size()); + } + this.managedInstances.addAll(managedInstances); + return this; + } + + public Builder addManagedInstances(ManagedInstance managedInstances) { + this.managedInstances.add(managedInstances); + return this; + } + + + public RegionInstanceGroupManagersListInstancesResponse build() { + return new RegionInstanceGroupManagersListInstancesResponse( + managedInstances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllManagedInstances(this.managedInstances); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagersListInstancesResponse{" + + "managedInstances=" + managedInstances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagersListInstancesResponse) { + RegionInstanceGroupManagersListInstancesResponse that = (RegionInstanceGroupManagersListInstancesResponse) o; + return + Objects.equals(this.managedInstances, that.getManagedInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + managedInstances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java new file mode 100644 index 000000000000..1a2c15c46362 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagersRecreateRequest implements ApiMessage { + private final List instances; + + private RegionInstanceGroupManagersRecreateRequest() { + this.instances = null; + } + + + private RegionInstanceGroupManagersRecreateRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagersRecreateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagersRecreateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagersRecreateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagersRecreateRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagersRecreateRequest other) { + if (other == RegionInstanceGroupManagersRecreateRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(RegionInstanceGroupManagersRecreateRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + + public RegionInstanceGroupManagersRecreateRequest build() { + return new RegionInstanceGroupManagersRecreateRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagersRecreateRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagersRecreateRequest) { + RegionInstanceGroupManagersRecreateRequest that = (RegionInstanceGroupManagersRecreateRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java new file mode 100644 index 000000000000..fc809979f180 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagersSetTargetPoolsRequest implements ApiMessage { + private final String fingerprint; + private final List targetPools; + + private RegionInstanceGroupManagersSetTargetPoolsRequest() { + this.fingerprint = null; + this.targetPools = null; + } + + + private RegionInstanceGroupManagersSetTargetPoolsRequest( + String fingerprint, + List targetPools + ) { + this.fingerprint = fingerprint; + this.targetPools = targetPools; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getTargetPoolsList() { + return targetPools; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagersSetTargetPoolsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagersSetTargetPoolsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagersSetTargetPoolsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + } + + public static class Builder { + private String fingerprint; + private List targetPools; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagersSetTargetPoolsRequest other) { + if (other == RegionInstanceGroupManagersSetTargetPoolsRequest.getDefaultInstance()) return this; + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getTargetPoolsList() != null) { + this.targetPools = other.targetPools; + } + return this; + } + + Builder(RegionInstanceGroupManagersSetTargetPoolsRequest source) { + this.fingerprint = source.fingerprint; + this.targetPools = source.targetPools; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getTargetPoolsList() { + return targetPools; + } + + public Builder addAllTargetPools(List targetPools) { + if (this.targetPools == null) { + this.targetPools = new ArrayList<>(targetPools.size()); + } + this.targetPools.addAll(targetPools); + return this; + } + + public Builder addTargetPools(String targetPools) { + this.targetPools.add(targetPools); + return this; + } + + + public RegionInstanceGroupManagersSetTargetPoolsRequest build() { + + return new RegionInstanceGroupManagersSetTargetPoolsRequest( + fingerprint, + targetPools + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllTargetPools(this.targetPools); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagersSetTargetPoolsRequest{" + + "fingerprint=" + fingerprint + ", " + + "targetPools=" + targetPools + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagersSetTargetPoolsRequest) { + RegionInstanceGroupManagersSetTargetPoolsRequest that = (RegionInstanceGroupManagersSetTargetPoolsRequest) o; + return + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.targetPools, that.getTargetPoolsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + fingerprint, + targetPools + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java new file mode 100644 index 000000000000..b98972dd35b3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupManagersSetTemplateRequest implements ApiMessage { + private final String instanceTemplate; + + private RegionInstanceGroupManagersSetTemplateRequest() { + this.instanceTemplate = null; + } + + + private RegionInstanceGroupManagersSetTemplateRequest( + String instanceTemplate + ) { + this.instanceTemplate = instanceTemplate; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupManagersSetTemplateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupManagersSetTemplateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupManagersSetTemplateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupManagersSetTemplateRequest(); + } + + public static class Builder { + private String instanceTemplate; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupManagersSetTemplateRequest other) { + if (other == RegionInstanceGroupManagersSetTemplateRequest.getDefaultInstance()) return this; + if (other.getInstanceTemplate() != null) { + this.instanceTemplate = other.instanceTemplate; + } + return this; + } + + Builder(RegionInstanceGroupManagersSetTemplateRequest source) { + this.instanceTemplate = source.instanceTemplate; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + + + public RegionInstanceGroupManagersSetTemplateRequest build() { + return new RegionInstanceGroupManagersSetTemplateRequest( + instanceTemplate + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstanceTemplate(this.instanceTemplate); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupManagersSetTemplateRequest{" + + "instanceTemplate=" + instanceTemplate + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupManagersSetTemplateRequest) { + RegionInstanceGroupManagersSetTemplateRequest that = (RegionInstanceGroupManagersSetTemplateRequest) o; + return + Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceTemplate + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java new file mode 100644 index 000000000000..c550efe76946 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java @@ -0,0 +1,269 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionInstanceGroupClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getRegionInstanceGroup to 30 seconds: + * + *

+ * 
+ * RegionInstanceGroupSettings.Builder regionInstanceGroupSettingsBuilder =
+ *     RegionInstanceGroupSettings.newBuilder();
+ * regionInstanceGroupSettingsBuilder.getRegionInstanceGroupSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionInstanceGroupSettings regionInstanceGroupSettings = regionInstanceGroupSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionInstanceGroupSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getRegionInstanceGroup. + */ + public UnaryCallSettings getRegionInstanceGroupSettings() { + return ((RegionInstanceGroupStubSettings) getStubSettings()).getRegionInstanceGroupSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegionInstanceGroups. + */ + public PagedCallSettings listRegionInstanceGroupsSettings() { + return ((RegionInstanceGroupStubSettings) getStubSettings()).listRegionInstanceGroupsSettings(); + } + + /** + * Returns the object with the settings used for calls to listInstancesRegionInstanceGroups. + */ + public PagedCallSettings listInstancesRegionInstanceGroupsSettings() { + return ((RegionInstanceGroupStubSettings) getStubSettings()).listInstancesRegionInstanceGroupsSettings(); + } + + /** + * Returns the object with the settings used for calls to setNamedPortsRegionInstanceGroup. + */ + public UnaryCallSettings setNamedPortsRegionInstanceGroupSettings() { + return ((RegionInstanceGroupStubSettings) getStubSettings()).setNamedPortsRegionInstanceGroupSettings(); + } + + + public static final RegionInstanceGroupSettings create(RegionInstanceGroupStubSettings stub) throws IOException { + return new RegionInstanceGroupSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionInstanceGroupStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionInstanceGroupStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionInstanceGroupStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionInstanceGroupStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionInstanceGroupStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionInstanceGroupStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionInstanceGroupStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionInstanceGroupStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionInstanceGroupSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionInstanceGroupSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionInstanceGroupStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionInstanceGroupStubSettings.newBuilder()); + } + + protected Builder(RegionInstanceGroupSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionInstanceGroupStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionInstanceGroupStubSettings.Builder getStubSettingsBuilder() { + return ((RegionInstanceGroupStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getRegionInstanceGroup. + */ + public UnaryCallSettings.Builder getRegionInstanceGroupSettings() { + return getStubSettingsBuilder().getRegionInstanceGroupSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegionInstanceGroups. + */ + public PagedCallSettings.Builder listRegionInstanceGroupsSettings() { + return getStubSettingsBuilder().listRegionInstanceGroupsSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInstancesRegionInstanceGroups. + */ + public PagedCallSettings.Builder listInstancesRegionInstanceGroupsSettings() { + return getStubSettingsBuilder().listInstancesRegionInstanceGroupsSettings(); + } + + /** + * Returns the builder for the settings used for calls to setNamedPortsRegionInstanceGroup. + */ + public UnaryCallSettings.Builder setNamedPortsRegionInstanceGroupSettings() { + return getStubSettingsBuilder().setNamedPortsRegionInstanceGroupSettings(); + } + + @Override + public RegionInstanceGroupSettings build() throws IOException { + return new RegionInstanceGroupSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java new file mode 100644 index 000000000000..4d60555fa830 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupsListInstances implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RegionInstanceGroupsListInstances() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RegionInstanceGroupsListInstances( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceWithNamedPorts item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupsListInstances prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupsListInstances getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupsListInstances DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupsListInstances(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupsListInstances other) { + if (other == RegionInstanceGroupsListInstances.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RegionInstanceGroupsListInstances source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InstanceWithNamedPorts items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RegionInstanceGroupsListInstances build() { + + + + + return new RegionInstanceGroupsListInstances( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupsListInstances{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupsListInstances) { + RegionInstanceGroupsListInstances that = (RegionInstanceGroupsListInstances) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java new file mode 100644 index 000000000000..b4bc7eec48b8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupsListInstancesRequest implements ApiMessage { + private final String instanceState; + private final String portName; + + private RegionInstanceGroupsListInstancesRequest() { + this.instanceState = null; + this.portName = null; + } + + + private RegionInstanceGroupsListInstancesRequest( + String instanceState, + String portName + ) { + this.instanceState = instanceState; + this.portName = portName; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceState") && instanceState != null) { + fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceState")) { + return String.valueOf(instanceState); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getInstanceState() { + return instanceState; + } + + public String getPortName() { + return portName; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupsListInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupsListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupsListInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupsListInstancesRequest(); + } + + public static class Builder { + private String instanceState; + private String portName; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupsListInstancesRequest other) { + if (other == RegionInstanceGroupsListInstancesRequest.getDefaultInstance()) return this; + if (other.getInstanceState() != null) { + this.instanceState = other.instanceState; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + return this; + } + + Builder(RegionInstanceGroupsListInstancesRequest source) { + this.instanceState = source.instanceState; + this.portName = source.portName; + } + + public String getInstanceState() { + return instanceState; + } + + public Builder setInstanceState(String instanceState) { + this.instanceState = instanceState; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + + public RegionInstanceGroupsListInstancesRequest build() { + + return new RegionInstanceGroupsListInstancesRequest( + instanceState, + portName + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstanceState(this.instanceState); + newBuilder.setPortName(this.portName); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupsListInstancesRequest{" + + "instanceState=" + instanceState + ", " + + "portName=" + portName + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupsListInstancesRequest) { + RegionInstanceGroupsListInstancesRequest that = (RegionInstanceGroupsListInstancesRequest) o; + return + Objects.equals(this.instanceState, that.getInstanceState()) && + Objects.equals(this.portName, that.getPortName()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instanceState, + portName + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java new file mode 100644 index 000000000000..52718623ce73 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionInstanceGroupsSetNamedPortsRequest implements ApiMessage { + private final String fingerprint; + private final List namedPorts; + + private RegionInstanceGroupsSetNamedPortsRequest() { + this.fingerprint = null; + this.namedPorts = null; + } + + + private RegionInstanceGroupsSetNamedPortsRequest( + String fingerprint, + List namedPorts + ) { + this.fingerprint = fingerprint; + this.namedPorts = namedPorts; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getNamedPortsList() { + return namedPorts; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionInstanceGroupsSetNamedPortsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionInstanceGroupsSetNamedPortsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionInstanceGroupsSetNamedPortsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionInstanceGroupsSetNamedPortsRequest(); + } + + public static class Builder { + private String fingerprint; + private List namedPorts; + + Builder() {} + + public Builder mergeFrom(RegionInstanceGroupsSetNamedPortsRequest other) { + if (other == RegionInstanceGroupsSetNamedPortsRequest.getDefaultInstance()) return this; + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getNamedPortsList() != null) { + this.namedPorts = other.namedPorts; + } + return this; + } + + Builder(RegionInstanceGroupsSetNamedPortsRequest source) { + this.fingerprint = source.fingerprint; + this.namedPorts = source.namedPorts; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getNamedPortsList() { + return namedPorts; + } + + public Builder addAllNamedPorts(List namedPorts) { + if (this.namedPorts == null) { + this.namedPorts = new ArrayList<>(namedPorts.size()); + } + this.namedPorts.addAll(namedPorts); + return this; + } + + public Builder addNamedPorts(NamedPort namedPorts) { + this.namedPorts.add(namedPorts); + return this; + } + + + public RegionInstanceGroupsSetNamedPortsRequest build() { + + return new RegionInstanceGroupsSetNamedPortsRequest( + fingerprint, + namedPorts + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllNamedPorts(this.namedPorts); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionInstanceGroupsSetNamedPortsRequest{" + + "fingerprint=" + fingerprint + ", " + + "namedPorts=" + namedPorts + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionInstanceGroupsSetNamedPortsRequest) { + RegionInstanceGroupsSetNamedPortsRequest that = (RegionInstanceGroupsSetNamedPortsRequest) o; + return + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.namedPorts, that.getNamedPortsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + fingerprint, + namedPorts + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java new file mode 100644 index 000000000000..a1c0e9fe2548 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RegionList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RegionList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Region item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RegionList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RegionList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RegionList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RegionList other) { + if (other == RegionList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RegionList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Region items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RegionList build() { + + + + + return new RegionList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionList) { + RegionList that = (RegionList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java new file mode 100644 index 000000000000..a0a3c54e6b22 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class RegionName implements ResourceName { + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private RegionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static RegionName of( + String project, + String region + ) { + return newBuilder() + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String project, + String region + ) { + return of( + project, + region + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public RegionName parse(String formattedString) {return RegionName.parse(formattedString);} + }; + } + + public static RegionName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "RegionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (RegionName regionName) { + project = regionName.project; + region = regionName.region; + } + + public RegionName build() { + return new RegionName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionName) { + RegionName that = (RegionName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java new file mode 100644 index 000000000000..6562e0070890 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java @@ -0,0 +1,611 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RegionOperationStub; +import com.google.cloud.compute.v1.stub.RegionOperationStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+ *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+ *   regionOperationClient.deleteRegionOperation(operation);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionOperationClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionOperationSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionOperationSettings regionOperationSettings =
+ *     RegionOperationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionOperationClient regionOperationClient =
+ *     RegionOperationClient.create(regionOperationSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionOperationSettings regionOperationSettings =
+ *     RegionOperationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionOperationClient regionOperationClient =
+ *     RegionOperationClient.create(regionOperationSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionOperationClient implements BackgroundResource { + private final RegionOperationSettings settings; + private final RegionOperationStub stub; + + + + /** + * Constructs an instance of RegionOperationClient with default settings. + */ + public static final RegionOperationClient create() throws IOException { + return create(RegionOperationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionOperationClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionOperationClient create(RegionOperationSettings settings) throws IOException { + return new RegionOperationClient(settings); + } + + /** + * Constructs an instance of RegionOperationClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionOperationSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionOperationClient create(RegionOperationStub stub) { + return new RegionOperationClient(stub); + } + + /** + * Constructs an instance of RegionOperationClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionOperationClient(RegionOperationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionOperationStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionOperationClient(RegionOperationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionOperationSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionOperationStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   regionOperationClient.deleteRegionOperation(operation);
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteRegionOperation(ProjectRegionOperationName operation) { + + DeleteRegionOperationHttpRequest request = + DeleteRegionOperationHttpRequest.newBuilder() + .setOperation(operation == null ? null : operation.toString()) + .build(); + deleteRegionOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   regionOperationClient.deleteRegionOperation(operation.toString());
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteRegionOperation(String operation) { + + DeleteRegionOperationHttpRequest request = + DeleteRegionOperationHttpRequest.newBuilder() + .setOperation(operation) + .build(); + deleteRegionOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   DeleteRegionOperationHttpRequest request = DeleteRegionOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   regionOperationClient.deleteRegionOperation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteRegionOperation(DeleteRegionOperationHttpRequest request) { + deleteRegionOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   DeleteRegionOperationHttpRequest request = DeleteRegionOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   ApiFuture<Void> future = regionOperationClient.deleteRegionOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRegionOperationCallable() { + return stub.deleteRegionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   Operation response = regionOperationClient.getRegionOperation(operation);
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getRegionOperation(ProjectRegionOperationName operation) { + + GetRegionOperationHttpRequest request = + GetRegionOperationHttpRequest.newBuilder() + .setOperation(operation == null ? null : operation.toString()) + .build(); + return getRegionOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   Operation response = regionOperationClient.getRegionOperation(operation.toString());
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getRegionOperation(String operation) { + + GetRegionOperationHttpRequest request = + GetRegionOperationHttpRequest.newBuilder() + .setOperation(operation) + .build(); + return getRegionOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   GetRegionOperationHttpRequest request = GetRegionOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   Operation response = regionOperationClient.getRegionOperation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getRegionOperation(GetRegionOperationHttpRequest request) { + return getRegionOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified region-specific Operations resource. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+   *   GetRegionOperationHttpRequest request = GetRegionOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = regionOperationClient.getRegionOperationCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionOperationCallable() { + return stub.getRegionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Operation element : regionOperationClient.listRegionOperations(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionOperationsPagedResponse listRegionOperations(RegionName region) { + ListRegionOperationsHttpRequest request = + ListRegionOperationsHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Operation element : regionOperationClient.listRegionOperations(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionOperationsPagedResponse listRegionOperations(String region) { + ListRegionOperationsHttpRequest request = + ListRegionOperationsHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRegionOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionOperationsHttpRequest request = ListRegionOperationsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Operation element : regionOperationClient.listRegionOperations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionOperationsPagedResponse listRegionOperations(ListRegionOperationsHttpRequest request) { + return listRegionOperationsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionOperationsHttpRequest request = ListRegionOperationsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionOperationsPagedResponse> future = regionOperationClient.listRegionOperationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Operation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionOperationsPagedCallable() { + return stub.listRegionOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * Sample code: + *

+   * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionOperationsHttpRequest request = ListRegionOperationsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     OperationList response = regionOperationClient.listRegionOperationsCallable().call(request);
+   *     for (Operation element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionOperationsCallable() { + return stub.listRegionOperationsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionOperationsPagedResponse extends AbstractPagedListResponse< + ListRegionOperationsHttpRequest, + OperationList, + Operation, + ListRegionOperationsPage, + ListRegionOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionOperationsPagedResponse apply(ListRegionOperationsPage input) { + return new ListRegionOperationsPagedResponse(input); + } + }); + } + + private ListRegionOperationsPagedResponse(ListRegionOperationsPage page) { + super(page, ListRegionOperationsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionOperationsPage extends AbstractPage< + ListRegionOperationsHttpRequest, + OperationList, + Operation, + ListRegionOperationsPage> { + + private ListRegionOperationsPage( + PageContext context, + OperationList response) { + super(context, response); + } + + private static ListRegionOperationsPage createEmptyPage() { + return new ListRegionOperationsPage(null, null); + } + + @Override + protected ListRegionOperationsPage createPage( + PageContext context, + OperationList response) { + return new ListRegionOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionOperationsFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionOperationsHttpRequest, + OperationList, + Operation, + ListRegionOperationsPage, + ListRegionOperationsFixedSizeCollection> { + + private ListRegionOperationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionOperationsFixedSizeCollection createEmptyCollection() { + return new ListRegionOperationsFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionOperationsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java new file mode 100644 index 000000000000..496bf5ddf023 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java @@ -0,0 +1,254 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import com.google.cloud.compute.v1.stub.RegionOperationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionOperationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRegionOperation to 30 seconds: + * + *

+ * 
+ * RegionOperationSettings.Builder regionOperationSettingsBuilder =
+ *     RegionOperationSettings.newBuilder();
+ * regionOperationSettingsBuilder.deleteRegionOperationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionOperationSettings regionOperationSettings = regionOperationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionOperationSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteRegionOperation. + */ + public UnaryCallSettings deleteRegionOperationSettings() { + return ((RegionOperationStubSettings) getStubSettings()).deleteRegionOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to getRegionOperation. + */ + public UnaryCallSettings getRegionOperationSettings() { + return ((RegionOperationStubSettings) getStubSettings()).getRegionOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegionOperations. + */ + public PagedCallSettings listRegionOperationsSettings() { + return ((RegionOperationStubSettings) getStubSettings()).listRegionOperationsSettings(); + } + + + public static final RegionOperationSettings create(RegionOperationStubSettings stub) throws IOException { + return new RegionOperationSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionOperationStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionOperationStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionOperationStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionOperationStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionOperationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionOperationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionOperationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionOperationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionOperationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionOperationSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionOperationStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionOperationStubSettings.newBuilder()); + } + + protected Builder(RegionOperationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionOperationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionOperationStubSettings.Builder getStubSettingsBuilder() { + return ((RegionOperationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionOperation. + */ + public UnaryCallSettings.Builder deleteRegionOperationSettings() { + return getStubSettingsBuilder().deleteRegionOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRegionOperation. + */ + public UnaryCallSettings.Builder getRegionOperationSettings() { + return getStubSettingsBuilder().getRegionOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegionOperations. + */ + public PagedCallSettings.Builder listRegionOperationsSettings() { + return getStubSettingsBuilder().listRegionOperationsSettings(); + } + + @Override + public RegionOperationSettings build() throws IOException { + return new RegionOperationSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java new file mode 100644 index 000000000000..44c823b77f6a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java @@ -0,0 +1,240 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import com.google.cloud.compute.v1.stub.RegionStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getRegion to 30 seconds: + * + *

+ * 
+ * RegionSettings.Builder regionSettingsBuilder =
+ *     RegionSettings.newBuilder();
+ * regionSettingsBuilder.getRegionSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionSettings regionSettings = regionSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getRegion. + */ + public UnaryCallSettings getRegionSettings() { + return ((RegionStubSettings) getStubSettings()).getRegionSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegions. + */ + public PagedCallSettings listRegionsSettings() { + return ((RegionStubSettings) getStubSettings()).listRegionsSettings(); + } + + + public static final RegionSettings create(RegionStubSettings stub) throws IOException { + return new RegionSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionStubSettings.newBuilder()); + } + + protected Builder(RegionSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionStubSettings.Builder getStubSettingsBuilder() { + return ((RegionStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getRegion. + */ + public UnaryCallSettings.Builder getRegionSettings() { + return getStubSettingsBuilder().getRegionSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegions. + */ + public PagedCallSettings.Builder listRegionsSettings() { + return getStubSettingsBuilder().listRegionsSettings(); + } + + @Override + public RegionSettings build() throws IOException { + return new RegionSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java new file mode 100644 index 000000000000..da8f14b8390e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RemoveHealthCheckTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource; + private final String userIp; + + private RemoveHealthCheckTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.targetPoolsRemoveHealthCheckRequestResource = null; + this.userIp = null; + } + + + private RemoveHealthCheckTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.targetPoolsRemoveHealthCheckRequestResource = targetPoolsRemoveHealthCheckRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsRemoveHealthCheckRequestResource") && targetPoolsRemoveHealthCheckRequestResource != null) { + fieldMap.put("targetPoolsRemoveHealthCheckRequestResource", Collections.singletonList(String.valueOf(targetPoolsRemoveHealthCheckRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("targetPoolsRemoveHealthCheckRequestResource")) { + return String.valueOf(targetPoolsRemoveHealthCheckRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetPoolsRemoveHealthCheckRequest getApiMessageRequestBody() { + return targetPoolsRemoveHealthCheckRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public TargetPoolsRemoveHealthCheckRequest getTargetPoolsRemoveHealthCheckRequestResource() { + return targetPoolsRemoveHealthCheckRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RemoveHealthCheckTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RemoveHealthCheckTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RemoveHealthCheckTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RemoveHealthCheckTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(RemoveHealthCheckTargetPoolHttpRequest other) { + if (other == RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getTargetPoolsRemoveHealthCheckRequestResource() != null) { + this.targetPoolsRemoveHealthCheckRequestResource = other.targetPoolsRemoveHealthCheckRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(RemoveHealthCheckTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.targetPoolsRemoveHealthCheckRequestResource = source.targetPoolsRemoveHealthCheckRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public TargetPoolsRemoveHealthCheckRequest getTargetPoolsRemoveHealthCheckRequestResource() { + return targetPoolsRemoveHealthCheckRequestResource; + } + + public Builder setTargetPoolsRemoveHealthCheckRequestResource(TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + this.targetPoolsRemoveHealthCheckRequestResource = targetPoolsRemoveHealthCheckRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public RemoveHealthCheckTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new RemoveHealthCheckTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsRemoveHealthCheckRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setTargetPoolsRemoveHealthCheckRequestResource(this.targetPoolsRemoveHealthCheckRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "RemoveHealthCheckTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "targetPoolsRemoveHealthCheckRequestResource=" + targetPoolsRemoveHealthCheckRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RemoveHealthCheckTargetPoolHttpRequest) { + RemoveHealthCheckTargetPoolHttpRequest that = (RemoveHealthCheckTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.targetPoolsRemoveHealthCheckRequestResource, that.getTargetPoolsRemoveHealthCheckRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsRemoveHealthCheckRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java new file mode 100644 index 000000000000..904ad0750c74 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RemoveInstanceTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource; + private final String userIp; + + private RemoveInstanceTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.targetPoolsRemoveInstanceRequestResource = null; + this.userIp = null; + } + + + private RemoveInstanceTargetPoolHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.targetPoolsRemoveInstanceRequestResource = targetPoolsRemoveInstanceRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsRemoveInstanceRequestResource") && targetPoolsRemoveInstanceRequestResource != null) { + fieldMap.put("targetPoolsRemoveInstanceRequestResource", Collections.singletonList(String.valueOf(targetPoolsRemoveInstanceRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("targetPoolsRemoveInstanceRequestResource")) { + return String.valueOf(targetPoolsRemoveInstanceRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetPoolsRemoveInstanceRequest getApiMessageRequestBody() { + return targetPoolsRemoveInstanceRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public TargetPoolsRemoveInstanceRequest getTargetPoolsRemoveInstanceRequestResource() { + return targetPoolsRemoveInstanceRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RemoveInstanceTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RemoveInstanceTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RemoveInstanceTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RemoveInstanceTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(RemoveInstanceTargetPoolHttpRequest other) { + if (other == RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getTargetPoolsRemoveInstanceRequestResource() != null) { + this.targetPoolsRemoveInstanceRequestResource = other.targetPoolsRemoveInstanceRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(RemoveInstanceTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.targetPoolsRemoveInstanceRequestResource = source.targetPoolsRemoveInstanceRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public TargetPoolsRemoveInstanceRequest getTargetPoolsRemoveInstanceRequestResource() { + return targetPoolsRemoveInstanceRequestResource; + } + + public Builder setTargetPoolsRemoveInstanceRequestResource(TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + this.targetPoolsRemoveInstanceRequestResource = targetPoolsRemoveInstanceRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public RemoveInstanceTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new RemoveInstanceTargetPoolHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsRemoveInstanceRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setTargetPoolsRemoveInstanceRequestResource(this.targetPoolsRemoveInstanceRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "RemoveInstanceTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "targetPoolsRemoveInstanceRequestResource=" + targetPoolsRemoveInstanceRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RemoveInstanceTargetPoolHttpRequest) { + RemoveInstanceTargetPoolHttpRequest that = (RemoveInstanceTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.targetPoolsRemoveInstanceRequestResource, that.getTargetPoolsRemoveInstanceRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetPoolsRemoveInstanceRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..d340e1435705 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RemoveInstancesInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private RemoveInstancesInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.instanceGroupsRemoveInstancesRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private RemoveInstancesInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.instanceGroupsRemoveInstancesRequestResource = instanceGroupsRemoveInstancesRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsRemoveInstancesRequestResource") && instanceGroupsRemoveInstancesRequestResource != null) { + fieldMap.put("instanceGroupsRemoveInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsRemoveInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("instanceGroupsRemoveInstancesRequestResource")) { + return String.valueOf(instanceGroupsRemoveInstancesRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupsRemoveInstancesRequest getApiMessageRequestBody() { + return instanceGroupsRemoveInstancesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public InstanceGroupsRemoveInstancesRequest getInstanceGroupsRemoveInstancesRequestResource() { + return instanceGroupsRemoveInstancesRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RemoveInstancesInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RemoveInstancesInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RemoveInstancesInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RemoveInstancesInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(RemoveInstancesInstanceGroupHttpRequest other) { + if (other == RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getInstanceGroupsRemoveInstancesRequestResource() != null) { + this.instanceGroupsRemoveInstancesRequestResource = other.instanceGroupsRemoveInstancesRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(RemoveInstancesInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.instanceGroupsRemoveInstancesRequestResource = source.instanceGroupsRemoveInstancesRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public InstanceGroupsRemoveInstancesRequest getInstanceGroupsRemoveInstancesRequestResource() { + return instanceGroupsRemoveInstancesRequestResource; + } + + public Builder setInstanceGroupsRemoveInstancesRequestResource(InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + this.instanceGroupsRemoveInstancesRequestResource = instanceGroupsRemoveInstancesRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public RemoveInstancesInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new RemoveInstancesInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + instanceGroupsRemoveInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setInstanceGroupsRemoveInstancesRequestResource(this.instanceGroupsRemoveInstancesRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "RemoveInstancesInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "instanceGroupsRemoveInstancesRequestResource=" + instanceGroupsRemoveInstancesRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RemoveInstancesInstanceGroupHttpRequest) { + RemoveInstancesInstanceGroupHttpRequest that = (RemoveInstancesInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.instanceGroupsRemoveInstancesRequestResource, that.getInstanceGroupsRemoveInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + instanceGroupsRemoveInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java new file mode 100644 index 000000000000..4be7b3a1bfd6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResetInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ResetInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ResetInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ResetInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResetInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ResetInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ResetInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ResetInstanceHttpRequest other) { + if (other == ResetInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ResetInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ResetInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ResetInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResetInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResetInstanceHttpRequest) { + ResetInstanceHttpRequest that = (ResetInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java new file mode 100644 index 000000000000..efedfc6ca83e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResizeDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final DisksResizeRequest disksResizeRequestResource; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ResizeDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.disksResizeRequestResource = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ResizeDiskHttpRequest( + String access_token, + String callback, + String disk, + DisksResizeRequest disksResizeRequestResource, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.disksResizeRequestResource = disksResizeRequestResource; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("disksResizeRequestResource") && disksResizeRequestResource != null) { + fieldMap.put("disksResizeRequestResource", Collections.singletonList(String.valueOf(disksResizeRequestResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("disksResizeRequestResource")) { + return String.valueOf(disksResizeRequestResource); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public DisksResizeRequest getApiMessageRequestBody() { + return disksResizeRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public DisksResizeRequest getDisksResizeRequestResource() { + return disksResizeRequestResource; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ResizeDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResizeDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ResizeDiskHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ResizeDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private DisksResizeRequest disksResizeRequestResource; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ResizeDiskHttpRequest other) { + if (other == ResizeDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getDisksResizeRequestResource() != null) { + this.disksResizeRequestResource = other.disksResizeRequestResource; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ResizeDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.disksResizeRequestResource = source.disksResizeRequestResource; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public DisksResizeRequest getDisksResizeRequestResource() { + return disksResizeRequestResource; + } + + public Builder setDisksResizeRequestResource(DisksResizeRequest disksResizeRequestResource) { + this.disksResizeRequestResource = disksResizeRequestResource; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ResizeDiskHttpRequest build() { + String missing = ""; + + + if (disk == null) { + missing += " disk"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ResizeDiskHttpRequest( + access_token, + callback, + disk, + disksResizeRequestResource, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setDisksResizeRequestResource(this.disksResizeRequestResource); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResizeDiskHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "disk=" + disk + ", " + + "disksResizeRequestResource=" + disksResizeRequestResource + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResizeDiskHttpRequest) { + ResizeDiskHttpRequest that = (ResizeDiskHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.disk, that.getDisk()) && + Objects.equals(this.disksResizeRequestResource, that.getDisksResizeRequestResource()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + disk, + disksResizeRequestResource, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..6b6caabd4cf4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java @@ -0,0 +1,443 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResizeInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final Integer size; + private final String userIp; + + private ResizeInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.size = null; + this.userIp = null; + } + + + private ResizeInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + Integer size, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.size = size; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("size") && size != null) { + fieldMap.put("size", Collections.singletonList(String.valueOf(size))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("size")) { + return String.valueOf(size); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Integer getSize() { + return size; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ResizeInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResizeInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ResizeInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ResizeInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private Integer size; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ResizeInstanceGroupManagerHttpRequest other) { + if (other == ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSize() != null) { + this.size = other.size; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ResizeInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.size = source.size; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public Integer getSize() { + return size; + } + + public Builder setSize(Integer size) { + this.size = size; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ResizeInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + if (size == null) { + missing += " size"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ResizeInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + size, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSize(this.size); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResizeInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "size=" + size + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResizeInstanceGroupManagerHttpRequest) { + ResizeInstanceGroupManagerHttpRequest that = (ResizeInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.size, that.getSize()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + size, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..e523222c94d3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,443 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResizeRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final Integer size; + private final String userIp; + + private ResizeRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.size = null; + this.userIp = null; + } + + + private ResizeRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + Integer size, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.size = size; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("size") && size != null) { + fieldMap.put("size", Collections.singletonList(String.valueOf(size))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("size")) { + return String.valueOf(size); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Integer getSize() { + return size; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ResizeRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResizeRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ResizeRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ResizeRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private Integer size; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ResizeRegionInstanceGroupManagerHttpRequest other) { + if (other == ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSize() != null) { + this.size = other.size; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ResizeRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.size = source.size; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public Integer getSize() { + return size; + } + + public Builder setSize(Integer size) { + this.size = size; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ResizeRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + if (size == null) { + missing += " size"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ResizeRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + size, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSize(this.size); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResizeRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "size=" + size + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResizeRegionInstanceGroupManagerHttpRequest) { + ResizeRegionInstanceGroupManagerHttpRequest that = (ResizeRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.size, that.getSize()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + size, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java new file mode 100644 index 000000000000..5b0747058b26 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResourceGroupReference implements ApiMessage { + private final String group; + + private ResourceGroupReference() { + this.group = null; + } + + + private ResourceGroupReference( + String group + ) { + this.group = group; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("group") && group != null) { + fieldMap.put("group", Collections.singletonList(String.valueOf(group))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("group")) { + return String.valueOf(group); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getGroup() { + return group; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ResourceGroupReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResourceGroupReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ResourceGroupReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ResourceGroupReference(); + } + + public static class Builder { + private String group; + + Builder() {} + + public Builder mergeFrom(ResourceGroupReference other) { + if (other == ResourceGroupReference.getDefaultInstance()) return this; + if (other.getGroup() != null) { + this.group = other.group; + } + return this; + } + + Builder(ResourceGroupReference source) { + this.group = source.group; + } + + public String getGroup() { + return group; + } + + public Builder setGroup(String group) { + this.group = group; + return this; + } + + + public ResourceGroupReference build() { + return new ResourceGroupReference( + group + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setGroup(this.group); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResourceGroupReference{" + + "group=" + group + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResourceGroupReference) { + ResourceGroupReference that = (ResourceGroupReference) o; + return + Objects.equals(this.group, that.getGroup()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + group + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java new file mode 100644 index 000000000000..c03fcd1c9a10 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java @@ -0,0 +1,696 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Route implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String destRange; + private final String id; + private final String kind; + private final String name; + private final String network; + private final String nextHopGateway; + private final String nextHopInstance; + private final String nextHopIp; + private final String nextHopNetwork; + private final String nextHopVpnTunnel; + private final Integer priority; + private final String selfLink; + private final List tags; + private final List warnings; + + private Route() { + this.creationTimestamp = null; + this.description = null; + this.destRange = null; + this.id = null; + this.kind = null; + this.name = null; + this.network = null; + this.nextHopGateway = null; + this.nextHopInstance = null; + this.nextHopIp = null; + this.nextHopNetwork = null; + this.nextHopVpnTunnel = null; + this.priority = null; + this.selfLink = null; + this.tags = null; + this.warnings = null; + } + + + private Route( + String creationTimestamp, + String description, + String destRange, + String id, + String kind, + String name, + String network, + String nextHopGateway, + String nextHopInstance, + String nextHopIp, + String nextHopNetwork, + String nextHopVpnTunnel, + Integer priority, + String selfLink, + List tags, + List warnings + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.destRange = destRange; + this.id = id; + this.kind = kind; + this.name = name; + this.network = network; + this.nextHopGateway = nextHopGateway; + this.nextHopInstance = nextHopInstance; + this.nextHopIp = nextHopIp; + this.nextHopNetwork = nextHopNetwork; + this.nextHopVpnTunnel = nextHopVpnTunnel; + this.priority = priority; + this.selfLink = selfLink; + this.tags = tags; + this.warnings = warnings; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("destRange") && destRange != null) { + fieldMap.put("destRange", Collections.singletonList(String.valueOf(destRange))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("nextHopGateway") && nextHopGateway != null) { + fieldMap.put("nextHopGateway", Collections.singletonList(String.valueOf(nextHopGateway))); + } + if (fieldNames.contains("nextHopInstance") && nextHopInstance != null) { + fieldMap.put("nextHopInstance", Collections.singletonList(String.valueOf(nextHopInstance))); + } + if (fieldNames.contains("nextHopIp") && nextHopIp != null) { + fieldMap.put("nextHopIp", Collections.singletonList(String.valueOf(nextHopIp))); + } + if (fieldNames.contains("nextHopNetwork") && nextHopNetwork != null) { + fieldMap.put("nextHopNetwork", Collections.singletonList(String.valueOf(nextHopNetwork))); + } + if (fieldNames.contains("nextHopVpnTunnel") && nextHopVpnTunnel != null) { + fieldMap.put("nextHopVpnTunnel", Collections.singletonList(String.valueOf(nextHopVpnTunnel))); + } + if (fieldNames.contains("priority") && priority != null) { + fieldMap.put("priority", Collections.singletonList(String.valueOf(priority))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("tags") && tags != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : tags) { + stringList.add(item.toString()); + } + fieldMap.put("tags", stringList.build()); + } + if (fieldNames.contains("warnings") && warnings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Warnings item : warnings) { + stringList.add(item.toString()); + } + fieldMap.put("warnings", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("destRange")) { + return String.valueOf(destRange); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("nextHopGateway")) { + return String.valueOf(nextHopGateway); + } + if (fieldName.equals("nextHopInstance")) { + return String.valueOf(nextHopInstance); + } + if (fieldName.equals("nextHopIp")) { + return String.valueOf(nextHopIp); + } + if (fieldName.equals("nextHopNetwork")) { + return String.valueOf(nextHopNetwork); + } + if (fieldName.equals("nextHopVpnTunnel")) { + return String.valueOf(nextHopVpnTunnel); + } + if (fieldName.equals("priority")) { + return String.valueOf(priority); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("tags")) { + return String.valueOf(tags); + } + if (fieldName.equals("warnings")) { + return String.valueOf(warnings); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getDestRange() { + return destRange; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getNextHopGateway() { + return nextHopGateway; + } + + public String getNextHopInstance() { + return nextHopInstance; + } + + public String getNextHopIp() { + return nextHopIp; + } + + public String getNextHopNetwork() { + return nextHopNetwork; + } + + public String getNextHopVpnTunnel() { + return nextHopVpnTunnel; + } + + public Integer getPriority() { + return priority; + } + + public String getSelfLink() { + return selfLink; + } + + public List getTagsList() { + return tags; + } + + public List getWarningsList() { + return warnings; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Route prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Route getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Route DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Route(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String destRange; + private String id; + private String kind; + private String name; + private String network; + private String nextHopGateway; + private String nextHopInstance; + private String nextHopIp; + private String nextHopNetwork; + private String nextHopVpnTunnel; + private Integer priority; + private String selfLink; + private List tags; + private List warnings; + + Builder() {} + + public Builder mergeFrom(Route other) { + if (other == Route.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDestRange() != null) { + this.destRange = other.destRange; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getNextHopGateway() != null) { + this.nextHopGateway = other.nextHopGateway; + } + if (other.getNextHopInstance() != null) { + this.nextHopInstance = other.nextHopInstance; + } + if (other.getNextHopIp() != null) { + this.nextHopIp = other.nextHopIp; + } + if (other.getNextHopNetwork() != null) { + this.nextHopNetwork = other.nextHopNetwork; + } + if (other.getNextHopVpnTunnel() != null) { + this.nextHopVpnTunnel = other.nextHopVpnTunnel; + } + if (other.getPriority() != null) { + this.priority = other.priority; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTagsList() != null) { + this.tags = other.tags; + } + if (other.getWarningsList() != null) { + this.warnings = other.warnings; + } + return this; + } + + Builder(Route source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.destRange = source.destRange; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.network = source.network; + this.nextHopGateway = source.nextHopGateway; + this.nextHopInstance = source.nextHopInstance; + this.nextHopIp = source.nextHopIp; + this.nextHopNetwork = source.nextHopNetwork; + this.nextHopVpnTunnel = source.nextHopVpnTunnel; + this.priority = source.priority; + this.selfLink = source.selfLink; + this.tags = source.tags; + this.warnings = source.warnings; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getDestRange() { + return destRange; + } + + public Builder setDestRange(String destRange) { + this.destRange = destRange; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getNextHopGateway() { + return nextHopGateway; + } + + public Builder setNextHopGateway(String nextHopGateway) { + this.nextHopGateway = nextHopGateway; + return this; + } + + public String getNextHopInstance() { + return nextHopInstance; + } + + public Builder setNextHopInstance(String nextHopInstance) { + this.nextHopInstance = nextHopInstance; + return this; + } + + public String getNextHopIp() { + return nextHopIp; + } + + public Builder setNextHopIp(String nextHopIp) { + this.nextHopIp = nextHopIp; + return this; + } + + public String getNextHopNetwork() { + return nextHopNetwork; + } + + public Builder setNextHopNetwork(String nextHopNetwork) { + this.nextHopNetwork = nextHopNetwork; + return this; + } + + public String getNextHopVpnTunnel() { + return nextHopVpnTunnel; + } + + public Builder setNextHopVpnTunnel(String nextHopVpnTunnel) { + this.nextHopVpnTunnel = nextHopVpnTunnel; + return this; + } + + public Integer getPriority() { + return priority; + } + + public Builder setPriority(Integer priority) { + this.priority = priority; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getTagsList() { + return tags; + } + + public Builder addAllTags(List tags) { + if (this.tags == null) { + this.tags = new ArrayList<>(tags.size()); + } + this.tags.addAll(tags); + return this; + } + + public Builder addTags(String tags) { + this.tags.add(tags); + return this; + } + + public List getWarningsList() { + return warnings; + } + + public Builder addAllWarnings(List warnings) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(warnings.size()); + } + this.warnings.addAll(warnings); + return this; + } + + public Builder addWarnings(Warnings warnings) { + this.warnings.add(warnings); + return this; + } + + + public Route build() { + + + + + + + + + + + + + + + + return new Route( + creationTimestamp, + description, + destRange, + id, + kind, + name, + network, + nextHopGateway, + nextHopInstance, + nextHopIp, + nextHopNetwork, + nextHopVpnTunnel, + priority, + selfLink, + tags, + warnings + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setDestRange(this.destRange); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setNextHopGateway(this.nextHopGateway); + newBuilder.setNextHopInstance(this.nextHopInstance); + newBuilder.setNextHopIp(this.nextHopIp); + newBuilder.setNextHopNetwork(this.nextHopNetwork); + newBuilder.setNextHopVpnTunnel(this.nextHopVpnTunnel); + newBuilder.setPriority(this.priority); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllTags(this.tags); + newBuilder.addAllWarnings(this.warnings); + return newBuilder; + } + } + + @Override + public String toString() { + return "Route{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "destRange=" + destRange + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "nextHopGateway=" + nextHopGateway + ", " + + "nextHopInstance=" + nextHopInstance + ", " + + "nextHopIp=" + nextHopIp + ", " + + "nextHopNetwork=" + nextHopNetwork + ", " + + "nextHopVpnTunnel=" + nextHopVpnTunnel + ", " + + "priority=" + priority + ", " + + "selfLink=" + selfLink + ", " + + "tags=" + tags + ", " + + "warnings=" + warnings + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Route) { + Route that = (Route) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.destRange, that.getDestRange()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.nextHopGateway, that.getNextHopGateway()) && + Objects.equals(this.nextHopInstance, that.getNextHopInstance()) && + Objects.equals(this.nextHopIp, that.getNextHopIp()) && + Objects.equals(this.nextHopNetwork, that.getNextHopNetwork()) && + Objects.equals(this.nextHopVpnTunnel, that.getNextHopVpnTunnel()) && + Objects.equals(this.priority, that.getPriority()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.tags, that.getTagsList()) && + Objects.equals(this.warnings, that.getWarningsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + destRange, + id, + kind, + name, + network, + nextHopGateway, + nextHopInstance, + nextHopIp, + nextHopNetwork, + nextHopVpnTunnel, + priority, + selfLink, + tags, + warnings + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java new file mode 100644 index 000000000000..30b5fe2f6995 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java @@ -0,0 +1,724 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RouteStub; +import com.google.cloud.compute.v1.stub.RouteStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RouteClient routeClient = RouteClient.create()) {
+ *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+ *   Operation response = routeClient.deleteRoute(route);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the routeClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RouteSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RouteSettings routeSettings =
+ *     RouteSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RouteClient routeClient =
+ *     RouteClient.create(routeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RouteSettings routeSettings =
+ *     RouteSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RouteClient routeClient =
+ *     RouteClient.create(routeSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RouteClient implements BackgroundResource { + private final RouteSettings settings; + private final RouteStub stub; + + + + /** + * Constructs an instance of RouteClient with default settings. + */ + public static final RouteClient create() throws IOException { + return create(RouteSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RouteClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RouteClient create(RouteSettings settings) throws IOException { + return new RouteClient(settings); + } + + /** + * Constructs an instance of RouteClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RouteSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RouteClient create(RouteStub stub) { + return new RouteClient(stub); + } + + /** + * Constructs an instance of RouteClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RouteClient(RouteSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RouteStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RouteClient(RouteStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RouteSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RouteStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Route resource. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   Operation response = routeClient.deleteRoute(route);
+   * }
+   * 
+ * + * @param route Name of the Route resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRoute(RouteName route) { + + DeleteRouteHttpRequest request = + DeleteRouteHttpRequest.newBuilder() + .setRoute(route == null ? null : route.toString()) + .build(); + return deleteRoute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Route resource. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   Operation response = routeClient.deleteRoute(route.toString());
+   * }
+   * 
+ * + * @param route Name of the Route resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRoute(String route) { + + DeleteRouteHttpRequest request = + DeleteRouteHttpRequest.newBuilder() + .setRoute(route) + .build(); + return deleteRoute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Route resource. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
+   *     .setRoute(route.toString())
+   *     .build();
+   *   Operation response = routeClient.deleteRoute(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRoute(DeleteRouteHttpRequest request) { + return deleteRouteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Route resource. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
+   *     .setRoute(route.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = routeClient.deleteRouteCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRouteCallable() { + return stub.deleteRouteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Route resource. Get a list of available routes by making a list() request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   Route response = routeClient.getRoute(route);
+   * }
+   * 
+ * + * @param route Name of the Route resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Route getRoute(RouteName route) { + + GetRouteHttpRequest request = + GetRouteHttpRequest.newBuilder() + .setRoute(route == null ? null : route.toString()) + .build(); + return getRoute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Route resource. Get a list of available routes by making a list() request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   Route response = routeClient.getRoute(route.toString());
+   * }
+   * 
+ * + * @param route Name of the Route resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Route getRoute(String route) { + + GetRouteHttpRequest request = + GetRouteHttpRequest.newBuilder() + .setRoute(route) + .build(); + return getRoute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Route resource. Get a list of available routes by making a list() request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder()
+   *     .setRoute(route.toString())
+   *     .build();
+   *   Route response = routeClient.getRoute(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Route getRoute(GetRouteHttpRequest request) { + return getRouteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Route resource. Get a list of available routes by making a list() request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder()
+   *     .setRoute(route.toString())
+   *     .build();
+   *   ApiFuture<Route> future = routeClient.getRouteCallable().futureCall(request);
+   *   // Do something
+   *   Route response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRouteCallable() { + return stub.getRouteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Route routeResource = Route.newBuilder().build();
+   *   Operation response = routeClient.insertRoute(project, routeResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param routeResource Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table. + * + * For each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, a instance gateway or a Google Compute Engine-operated gateway. + * + * Packets that do not match any route in the sending instance's routing table are dropped. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRoute(ProjectName project, Route routeResource) { + + InsertRouteHttpRequest request = + InsertRouteHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setRouteResource(routeResource) + .build(); + return insertRoute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Route routeResource = Route.newBuilder().build();
+   *   Operation response = routeClient.insertRoute(project.toString(), routeResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param routeResource Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table. + * + * For each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, a instance gateway or a Google Compute Engine-operated gateway. + * + * Packets that do not match any route in the sending instance's routing table are dropped. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRoute(String project, Route routeResource) { + + InsertRouteHttpRequest request = + InsertRouteHttpRequest.newBuilder() + .setProject(project) + .setRouteResource(routeResource) + .build(); + return insertRoute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Route routeResource = Route.newBuilder().build();
+   *   InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setRouteResource(routeResource)
+   *     .build();
+   *   Operation response = routeClient.insertRoute(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRoute(InsertRouteHttpRequest request) { + return insertRouteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Route routeResource = Route.newBuilder().build();
+   *   InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setRouteResource(routeResource)
+   *     .build();
+   *   ApiFuture<Operation> future = routeClient.insertRouteCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRouteCallable() { + return stub.insertRouteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Route resources available to the specified project. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Route element : routeClient.listRoutes(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRoutesPagedResponse listRoutes(ProjectName project) { + ListRoutesHttpRequest request = + ListRoutesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listRoutes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Route resources available to the specified project. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Route element : routeClient.listRoutes(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRoutesPagedResponse listRoutes(String project) { + ListRoutesHttpRequest request = + ListRoutesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listRoutes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Route resources available to the specified project. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListRoutesHttpRequest request = ListRoutesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Route element : routeClient.listRoutes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRoutesPagedResponse listRoutes(ListRoutesHttpRequest request) { + return listRoutesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Route resources available to the specified project. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListRoutesHttpRequest request = ListRoutesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListRoutesPagedResponse> future = routeClient.listRoutesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Route element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRoutesPagedCallable() { + return stub.listRoutesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Route resources available to the specified project. + * + * Sample code: + *

+   * try (RouteClient routeClient = RouteClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListRoutesHttpRequest request = ListRoutesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     RouteList response = routeClient.listRoutesCallable().call(request);
+   *     for (Route element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRoutesCallable() { + return stub.listRoutesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRoutesPagedResponse extends AbstractPagedListResponse< + ListRoutesHttpRequest, + RouteList, + Route, + ListRoutesPage, + ListRoutesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRoutesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRoutesPagedResponse apply(ListRoutesPage input) { + return new ListRoutesPagedResponse(input); + } + }); + } + + private ListRoutesPagedResponse(ListRoutesPage page) { + super(page, ListRoutesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRoutesPage extends AbstractPage< + ListRoutesHttpRequest, + RouteList, + Route, + ListRoutesPage> { + + private ListRoutesPage( + PageContext context, + RouteList response) { + super(context, response); + } + + private static ListRoutesPage createEmptyPage() { + return new ListRoutesPage(null, null); + } + + @Override + protected ListRoutesPage createPage( + PageContext context, + RouteList response) { + return new ListRoutesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRoutesFixedSizeCollection extends AbstractFixedSizeCollection< + ListRoutesHttpRequest, + RouteList, + Route, + ListRoutesPage, + ListRoutesFixedSizeCollection> { + + private ListRoutesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRoutesFixedSizeCollection createEmptyCollection() { + return new ListRoutesFixedSizeCollection(null, 0); + } + + @Override + protected ListRoutesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRoutesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java new file mode 100644 index 000000000000..f506fb79fc07 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouteList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RouteList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RouteList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouteList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouteList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouteList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouteList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RouteList other) { + if (other == RouteList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RouteList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Route items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RouteList build() { + + + + + return new RouteList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouteList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouteList) { + RouteList that = (RouteList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java new file mode 100644 index 000000000000..054480fb8bd9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class RouteName implements ResourceName { + private final String project; + private final String route; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/routes/{route}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private RouteName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + route = Preconditions.checkNotNull(builder.getRoute()); + } + + public static RouteName of( + String project, + String route + ) { + return newBuilder() + .setProject(project) + .setRoute(route) + .build(); + } + + public static String format( + String project, + String route + ) { + return of( + project, + route + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRoute() { + return route; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("route", route); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public RouteName parse(String formattedString) {return RouteName.parse(formattedString);} + }; + } + + public static RouteName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "RouteName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("route") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String route; + + public String getProject() { + return project; + } + public String getRoute() { + return route; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRoute(String route) { + this.route = route; + return this; + } + + private Builder() {} + + public Builder (RouteName routeName) { + project = routeName.project; + route = routeName.route; + } + + public RouteName build() { + return new RouteName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "route", route + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouteName) { + RouteName that = (RouteName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.route, that.getRoute()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + route + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java new file mode 100644 index 000000000000..91ad5009fc52 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java @@ -0,0 +1,268 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import com.google.cloud.compute.v1.stub.RouteStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RouteClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRoute to 30 seconds: + * + *

+ * 
+ * RouteSettings.Builder routeSettingsBuilder =
+ *     RouteSettings.newBuilder();
+ * routeSettingsBuilder.deleteRouteSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RouteSettings routeSettings = routeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RouteSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteRoute. + */ + public UnaryCallSettings deleteRouteSettings() { + return ((RouteStubSettings) getStubSettings()).deleteRouteSettings(); + } + + /** + * Returns the object with the settings used for calls to getRoute. + */ + public UnaryCallSettings getRouteSettings() { + return ((RouteStubSettings) getStubSettings()).getRouteSettings(); + } + + /** + * Returns the object with the settings used for calls to insertRoute. + */ + public UnaryCallSettings insertRouteSettings() { + return ((RouteStubSettings) getStubSettings()).insertRouteSettings(); + } + + /** + * Returns the object with the settings used for calls to listRoutes. + */ + public PagedCallSettings listRoutesSettings() { + return ((RouteStubSettings) getStubSettings()).listRoutesSettings(); + } + + + public static final RouteSettings create(RouteStubSettings stub) throws IOException { + return new RouteSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RouteStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RouteStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RouteStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RouteStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RouteStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RouteStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RouteStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RouteStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RouteSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RouteSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RouteStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RouteStubSettings.newBuilder()); + } + + protected Builder(RouteSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RouteStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RouteStubSettings.Builder getStubSettingsBuilder() { + return ((RouteStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteRoute. + */ + public UnaryCallSettings.Builder deleteRouteSettings() { + return getStubSettingsBuilder().deleteRouteSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRoute. + */ + public UnaryCallSettings.Builder getRouteSettings() { + return getStubSettingsBuilder().getRouteSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertRoute. + */ + public UnaryCallSettings.Builder insertRouteSettings() { + return getStubSettingsBuilder().insertRouteSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRoutes. + */ + public PagedCallSettings.Builder listRoutesSettings() { + return getStubSettingsBuilder().listRoutesSettings(); + } + + @Override + public RouteSettings build() throws IOException { + return new RouteSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java new file mode 100644 index 000000000000..239139f4c39d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Router implements ApiMessage { + private final RouterBgp bgp; + private final List bgpPeers; + private final String creationTimestamp; + private final String description; + private final String id; + private final List interfaces; + private final String kind; + private final String name; + private final String network; + private final String region; + private final String selfLink; + + private Router() { + this.bgp = null; + this.bgpPeers = null; + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.interfaces = null; + this.kind = null; + this.name = null; + this.network = null; + this.region = null; + this.selfLink = null; + } + + + private Router( + RouterBgp bgp, + List bgpPeers, + String creationTimestamp, + String description, + String id, + List interfaces, + String kind, + String name, + String network, + String region, + String selfLink + ) { + this.bgp = bgp; + this.bgpPeers = bgpPeers; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.interfaces = interfaces; + this.kind = kind; + this.name = name; + this.network = network; + this.region = region; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bgp") && bgp != null) { + fieldMap.put("bgp", Collections.singletonList(String.valueOf(bgp))); + } + if (fieldNames.contains("bgpPeers") && bgpPeers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterBgpPeer item : bgpPeers) { + stringList.add(item.toString()); + } + fieldMap.put("bgpPeers", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("interfaces") && interfaces != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterInterface item : interfaces) { + stringList.add(item.toString()); + } + fieldMap.put("interfaces", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("bgp")) { + return String.valueOf(bgp); + } + if (fieldName.equals("bgpPeers")) { + return String.valueOf(bgpPeers); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("interfaces")) { + return String.valueOf(interfaces); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public RouterBgp getBgp() { + return bgp; + } + + public List getBgpPeersList() { + return bgpPeers; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public List getInterfacesList() { + return interfaces; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Router prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Router getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Router DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Router(); + } + + public static class Builder { + private RouterBgp bgp; + private List bgpPeers; + private String creationTimestamp; + private String description; + private String id; + private List interfaces; + private String kind; + private String name; + private String network; + private String region; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(Router other) { + if (other == Router.getDefaultInstance()) return this; + if (other.getBgp() != null) { + this.bgp = other.bgp; + } + if (other.getBgpPeersList() != null) { + this.bgpPeers = other.bgpPeers; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInterfacesList() != null) { + this.interfaces = other.interfaces; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(Router source) { + this.bgp = source.bgp; + this.bgpPeers = source.bgpPeers; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.interfaces = source.interfaces; + this.kind = source.kind; + this.name = source.name; + this.network = source.network; + this.region = source.region; + this.selfLink = source.selfLink; + } + + public RouterBgp getBgp() { + return bgp; + } + + public Builder setBgp(RouterBgp bgp) { + this.bgp = bgp; + return this; + } + + public List getBgpPeersList() { + return bgpPeers; + } + + public Builder addAllBgpPeers(List bgpPeers) { + if (this.bgpPeers == null) { + this.bgpPeers = new ArrayList<>(bgpPeers.size()); + } + this.bgpPeers.addAll(bgpPeers); + return this; + } + + public Builder addBgpPeers(RouterBgpPeer bgpPeers) { + this.bgpPeers.add(bgpPeers); + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getInterfacesList() { + return interfaces; + } + + public Builder addAllInterfaces(List interfaces) { + if (this.interfaces == null) { + this.interfaces = new ArrayList<>(interfaces.size()); + } + this.interfaces.addAll(interfaces); + return this; + } + + public Builder addInterfaces(RouterInterface interfaces) { + this.interfaces.add(interfaces); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public Router build() { + + + + + + + + + + + return new Router( + bgp, + bgpPeers, + creationTimestamp, + description, + id, + interfaces, + kind, + name, + network, + region, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBgp(this.bgp); + newBuilder.addAllBgpPeers(this.bgpPeers); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.addAllInterfaces(this.interfaces); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "Router{" + + "bgp=" + bgp + ", " + + "bgpPeers=" + bgpPeers + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "interfaces=" + interfaces + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Router) { + Router that = (Router) o; + return + Objects.equals(this.bgp, that.getBgp()) && + Objects.equals(this.bgpPeers, that.getBgpPeersList()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.interfaces, that.getInterfacesList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + bgp, + bgpPeers, + creationTimestamp, + description, + id, + interfaces, + kind, + name, + network, + region, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java new file mode 100644 index 000000000000..7465564574a1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RouterAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RouterAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RouterAggregatedList other) { + if (other == RouterAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RouterAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RouterAggregatedList build() { + + + + + return new RouterAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterAggregatedList) { + RouterAggregatedList that = (RouterAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java new file mode 100644 index 000000000000..a39da3597e45 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterBgp implements ApiMessage { + private final Integer asn; + + private RouterBgp() { + this.asn = null; + } + + + private RouterBgp( + Integer asn + ) { + this.asn = asn; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("asn") && asn != null) { + fieldMap.put("asn", Collections.singletonList(String.valueOf(asn))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("asn")) { + return String.valueOf(asn); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getAsn() { + return asn; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterBgp prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterBgp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterBgp DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterBgp(); + } + + public static class Builder { + private Integer asn; + + Builder() {} + + public Builder mergeFrom(RouterBgp other) { + if (other == RouterBgp.getDefaultInstance()) return this; + if (other.getAsn() != null) { + this.asn = other.asn; + } + return this; + } + + Builder(RouterBgp source) { + this.asn = source.asn; + } + + public Integer getAsn() { + return asn; + } + + public Builder setAsn(Integer asn) { + this.asn = asn; + return this; + } + + + public RouterBgp build() { + return new RouterBgp( + asn + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAsn(this.asn); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterBgp{" + + "asn=" + asn + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterBgp) { + RouterBgp that = (RouterBgp) o; + return + Objects.equals(this.asn, that.getAsn()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + asn + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java new file mode 100644 index 000000000000..48c1e59d7e33 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java @@ -0,0 +1,332 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterBgpPeer implements ApiMessage { + private final Integer advertisedRoutePriority; + private final String interfaceName; + private final String ipAddress; + private final String name; + private final Integer peerAsn; + private final String peerIpAddress; + + private RouterBgpPeer() { + this.advertisedRoutePriority = null; + this.interfaceName = null; + this.ipAddress = null; + this.name = null; + this.peerAsn = null; + this.peerIpAddress = null; + } + + + private RouterBgpPeer( + Integer advertisedRoutePriority, + String interfaceName, + String ipAddress, + String name, + Integer peerAsn, + String peerIpAddress + ) { + this.advertisedRoutePriority = advertisedRoutePriority; + this.interfaceName = interfaceName; + this.ipAddress = ipAddress; + this.name = name; + this.peerAsn = peerAsn; + this.peerIpAddress = peerIpAddress; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("advertisedRoutePriority") && advertisedRoutePriority != null) { + fieldMap.put("advertisedRoutePriority", Collections.singletonList(String.valueOf(advertisedRoutePriority))); + } + if (fieldNames.contains("interfaceName") && interfaceName != null) { + fieldMap.put("interfaceName", Collections.singletonList(String.valueOf(interfaceName))); + } + if (fieldNames.contains("ipAddress") && ipAddress != null) { + fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerAsn") && peerAsn != null) { + fieldMap.put("peerAsn", Collections.singletonList(String.valueOf(peerAsn))); + } + if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { + fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("advertisedRoutePriority")) { + return String.valueOf(advertisedRoutePriority); + } + if (fieldName.equals("interfaceName")) { + return String.valueOf(interfaceName); + } + if (fieldName.equals("ipAddress")) { + return String.valueOf(ipAddress); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("peerAsn")) { + return String.valueOf(peerAsn); + } + if (fieldName.equals("peerIpAddress")) { + return String.valueOf(peerIpAddress); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getAdvertisedRoutePriority() { + return advertisedRoutePriority; + } + + public String getInterfaceName() { + return interfaceName; + } + + public String getIpAddress() { + return ipAddress; + } + + public String getName() { + return name; + } + + public Integer getPeerAsn() { + return peerAsn; + } + + public String getPeerIpAddress() { + return peerIpAddress; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterBgpPeer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterBgpPeer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterBgpPeer DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterBgpPeer(); + } + + public static class Builder { + private Integer advertisedRoutePriority; + private String interfaceName; + private String ipAddress; + private String name; + private Integer peerAsn; + private String peerIpAddress; + + Builder() {} + + public Builder mergeFrom(RouterBgpPeer other) { + if (other == RouterBgpPeer.getDefaultInstance()) return this; + if (other.getAdvertisedRoutePriority() != null) { + this.advertisedRoutePriority = other.advertisedRoutePriority; + } + if (other.getInterfaceName() != null) { + this.interfaceName = other.interfaceName; + } + if (other.getIpAddress() != null) { + this.ipAddress = other.ipAddress; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPeerAsn() != null) { + this.peerAsn = other.peerAsn; + } + if (other.getPeerIpAddress() != null) { + this.peerIpAddress = other.peerIpAddress; + } + return this; + } + + Builder(RouterBgpPeer source) { + this.advertisedRoutePriority = source.advertisedRoutePriority; + this.interfaceName = source.interfaceName; + this.ipAddress = source.ipAddress; + this.name = source.name; + this.peerAsn = source.peerAsn; + this.peerIpAddress = source.peerIpAddress; + } + + public Integer getAdvertisedRoutePriority() { + return advertisedRoutePriority; + } + + public Builder setAdvertisedRoutePriority(Integer advertisedRoutePriority) { + this.advertisedRoutePriority = advertisedRoutePriority; + return this; + } + + public String getInterfaceName() { + return interfaceName; + } + + public Builder setInterfaceName(String interfaceName) { + this.interfaceName = interfaceName; + return this; + } + + public String getIpAddress() { + return ipAddress; + } + + public Builder setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPeerAsn() { + return peerAsn; + } + + public Builder setPeerAsn(Integer peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + public String getPeerIpAddress() { + return peerIpAddress; + } + + public Builder setPeerIpAddress(String peerIpAddress) { + this.peerIpAddress = peerIpAddress; + return this; + } + + + public RouterBgpPeer build() { + + + + + + return new RouterBgpPeer( + advertisedRoutePriority, + interfaceName, + ipAddress, + name, + peerAsn, + peerIpAddress + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAdvertisedRoutePriority(this.advertisedRoutePriority); + newBuilder.setInterfaceName(this.interfaceName); + newBuilder.setIpAddress(this.ipAddress); + newBuilder.setName(this.name); + newBuilder.setPeerAsn(this.peerAsn); + newBuilder.setPeerIpAddress(this.peerIpAddress); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterBgpPeer{" + + "advertisedRoutePriority=" + advertisedRoutePriority + ", " + + "interfaceName=" + interfaceName + ", " + + "ipAddress=" + ipAddress + ", " + + "name=" + name + ", " + + "peerAsn=" + peerAsn + ", " + + "peerIpAddress=" + peerIpAddress + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterBgpPeer) { + RouterBgpPeer that = (RouterBgpPeer) o; + return + Objects.equals(this.advertisedRoutePriority, that.getAdvertisedRoutePriority()) && + Objects.equals(this.interfaceName, that.getInterfaceName()) && + Objects.equals(this.ipAddress, that.getIpAddress()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.peerAsn, that.getPeerAsn()) && + Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + advertisedRoutePriority, + interfaceName, + ipAddress, + name, + peerAsn, + peerIpAddress + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java new file mode 100644 index 000000000000..5e1867c2f50e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java @@ -0,0 +1,1346 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.RouterStub; +import com.google.cloud.compute.v1.stub.RouterStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RouterClient routerClient = RouterClient.create()) {
+ *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+ *   Operation response = routerClient.deleteRouter(router);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the routerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RouterSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RouterSettings routerSettings =
+ *     RouterSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RouterClient routerClient =
+ *     RouterClient.create(routerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RouterSettings routerSettings =
+ *     RouterSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RouterClient routerClient =
+ *     RouterClient.create(routerSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RouterClient implements BackgroundResource { + private final RouterSettings settings; + private final RouterStub stub; + + + + /** + * Constructs an instance of RouterClient with default settings. + */ + public static final RouterClient create() throws IOException { + return create(RouterSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RouterClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RouterClient create(RouterSettings settings) throws IOException { + return new RouterClient(settings); + } + + /** + * Constructs an instance of RouterClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RouterSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RouterClient create(RouterStub stub) { + return new RouterClient(stub); + } + + /** + * Constructs an instance of RouterClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RouterClient(RouterSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RouterStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RouterClient(RouterStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RouterSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RouterStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of routers. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (RoutersScopedList element : routerClient.aggregatedListRouters(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListRoutersPagedResponse aggregatedListRouters(ProjectName project) { + AggregatedListRoutersHttpRequest request = + AggregatedListRoutersHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListRouters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of routers. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (RoutersScopedList element : routerClient.aggregatedListRouters(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListRoutersPagedResponse aggregatedListRouters(String project) { + AggregatedListRoutersHttpRequest request = + AggregatedListRoutersHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListRouters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of routers. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListRoutersHttpRequest request = AggregatedListRoutersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (RoutersScopedList element : routerClient.aggregatedListRouters(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListRoutersPagedResponse aggregatedListRouters(AggregatedListRoutersHttpRequest request) { + return aggregatedListRoutersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of routers. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListRoutersHttpRequest request = AggregatedListRoutersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListRoutersPagedResponse> future = routerClient.aggregatedListRoutersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (RoutersScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListRoutersPagedCallable() { + return stub.aggregatedListRoutersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of routers. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListRoutersHttpRequest request = AggregatedListRoutersHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     RouterAggregatedList response = routerClient.aggregatedListRoutersCallable().call(request);
+   *     for (RoutersScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListRoutersCallable() { + return stub.aggregatedListRoutersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Router resource. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Operation response = routerClient.deleteRouter(router);
+   * }
+   * 
+ * + * @param router Name of the Router resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRouter(RouterName router) { + + DeleteRouterHttpRequest request = + DeleteRouterHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .build(); + return deleteRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Router resource. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Operation response = routerClient.deleteRouter(router.toString());
+   * }
+   * 
+ * + * @param router Name of the Router resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRouter(String router) { + + DeleteRouterHttpRequest request = + DeleteRouterHttpRequest.newBuilder() + .setRouter(router) + .build(); + return deleteRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Router resource. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   Operation response = routerClient.deleteRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRouter(DeleteRouterHttpRequest request) { + return deleteRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified Router resource. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = routerClient.deleteRouterCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRouterCallable() { + return stub.deleteRouterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Router resource. Get a list of available routers by making a list() request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router response = routerClient.getRouter(router);
+   * }
+   * 
+ * + * @param router Name of the Router resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Router getRouter(RouterName router) { + + GetRouterHttpRequest request = + GetRouterHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .build(); + return getRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Router resource. Get a list of available routers by making a list() request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router response = routerClient.getRouter(router.toString());
+   * }
+   * 
+ * + * @param router Name of the Router resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Router getRouter(String router) { + + GetRouterHttpRequest request = + GetRouterHttpRequest.newBuilder() + .setRouter(router) + .build(); + return getRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Router resource. Get a list of available routers by making a list() request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetRouterHttpRequest request = GetRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   Router response = routerClient.getRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Router getRouter(GetRouterHttpRequest request) { + return getRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Router resource. Get a list of available routers by making a list() request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetRouterHttpRequest request = GetRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   ApiFuture<Router> future = routerClient.getRouterCallable().futureCall(request);
+   *   // Do something
+   *   Router response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRouterCallable() { + return stub.getRouterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime information of the specified router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   RouterStatusResponse response = routerClient.getRouterStatusRouter(router);
+   * }
+   * 
+ * + * @param router Name of the Router resource to query. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RouterStatusResponse getRouterStatusRouter(RouterName router) { + + GetRouterStatusRouterHttpRequest request = + GetRouterStatusRouterHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .build(); + return getRouterStatusRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime information of the specified router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   RouterStatusResponse response = routerClient.getRouterStatusRouter(router.toString());
+   * }
+   * 
+ * + * @param router Name of the Router resource to query. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RouterStatusResponse getRouterStatusRouter(String router) { + + GetRouterStatusRouterHttpRequest request = + GetRouterStatusRouterHttpRequest.newBuilder() + .setRouter(router) + .build(); + return getRouterStatusRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime information of the specified router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetRouterStatusRouterHttpRequest request = GetRouterStatusRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   RouterStatusResponse response = routerClient.getRouterStatusRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RouterStatusResponse getRouterStatusRouter(GetRouterStatusRouterHttpRequest request) { + return getRouterStatusRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime information of the specified router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetRouterStatusRouterHttpRequest request = GetRouterStatusRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   ApiFuture<RouterStatusResponse> future = routerClient.getRouterStatusRouterCallable().futureCall(request);
+   *   // Do something
+   *   RouterStatusResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRouterStatusRouterCallable() { + return stub.getRouterStatusRouterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   Operation response = routerClient.insertRouter(region, routerResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRouter(RegionName region, Router routerResource) { + + InsertRouterHttpRequest request = + InsertRouterHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setRouterResource(routerResource) + .build(); + return insertRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   Operation response = routerClient.insertRouter(region.toString(), routerResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRouter(String region, Router routerResource) { + + InsertRouterHttpRequest request = + InsertRouterHttpRequest.newBuilder() + .setRegion(region) + .setRouterResource(routerResource) + .build(); + return insertRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   Operation response = routerClient.insertRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRouter(InsertRouterHttpRequest request) { + return insertRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = routerClient.insertRouterCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRouterCallable() { + return stub.insertRouterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Router resources available to the specified project. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Router element : routerClient.listRouters(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRoutersPagedResponse listRouters(RegionName region) { + ListRoutersHttpRequest request = + ListRoutersHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRouters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Router resources available to the specified project. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Router element : routerClient.listRouters(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRoutersPagedResponse listRouters(String region) { + ListRoutersHttpRequest request = + ListRoutersHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRouters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Router resources available to the specified project. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Router element : routerClient.listRouters(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRoutersPagedResponse listRouters(ListRoutersHttpRequest request) { + return listRoutersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Router resources available to the specified project. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRoutersPagedResponse> future = routerClient.listRoutersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Router element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRoutersPagedCallable() { + return stub.listRoutersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Router resources available to the specified project. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     RouterList response = routerClient.listRoutersCallable().call(request);
+   *     for (Router element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRoutersCallable() { + return stub.listRoutersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   Operation response = routerClient.patchRouter(router, routerResource);
+   * }
+   * 
+ * + * @param router Name of the Router resource to update. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRouter(RouterName router, Router routerResource) { + + PatchRouterHttpRequest request = + PatchRouterHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .setRouterResource(routerResource) + .build(); + return patchRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   Operation response = routerClient.patchRouter(router.toString(), routerResource);
+   * }
+   * 
+ * + * @param router Name of the Router resource to update. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRouter(String router, Router routerResource) { + + PatchRouterHttpRequest request = + PatchRouterHttpRequest.newBuilder() + .setRouter(router) + .setRouterResource(routerResource) + .build(); + return patchRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   Operation response = routerClient.patchRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRouter(PatchRouterHttpRequest request) { + return patchRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = routerClient.patchRouterCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchRouterCallable() { + return stub.patchRouterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   RoutersPreviewResponse response = routerClient.previewRouter(router, routerResource);
+   * }
+   * 
+ * + * @param router Name of the Router resource to query. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RoutersPreviewResponse previewRouter(RouterName router, Router routerResource) { + + PreviewRouterHttpRequest request = + PreviewRouterHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .setRouterResource(routerResource) + .build(); + return previewRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   RoutersPreviewResponse response = routerClient.previewRouter(router.toString(), routerResource);
+   * }
+   * 
+ * + * @param router Name of the Router resource to query. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RoutersPreviewResponse previewRouter(String router, Router routerResource) { + + PreviewRouterHttpRequest request = + PreviewRouterHttpRequest.newBuilder() + .setRouter(router) + .setRouterResource(routerResource) + .build(); + return previewRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   PreviewRouterHttpRequest request = PreviewRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   RoutersPreviewResponse response = routerClient.previewRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final RoutersPreviewResponse previewRouter(PreviewRouterHttpRequest request) { + return previewRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   PreviewRouterHttpRequest request = PreviewRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   ApiFuture<RoutersPreviewResponse> future = routerClient.previewRouterCallable().futureCall(request);
+   *   // Do something
+   *   RoutersPreviewResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable previewRouterCallable() { + return stub.previewRouterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   Operation response = routerClient.updateRouter(router, routerResource);
+   * }
+   * 
+ * + * @param router Name of the Router resource to update. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRouter(RouterName router, Router routerResource) { + + UpdateRouterHttpRequest request = + UpdateRouterHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .setRouterResource(routerResource) + .build(); + return updateRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   Operation response = routerClient.updateRouter(router.toString(), routerResource);
+   * }
+   * 
+ * + * @param router Name of the Router resource to update. + * @param routerResource Router resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRouter(String router, Router routerResource) { + + UpdateRouterHttpRequest request = + UpdateRouterHttpRequest.newBuilder() + .setRouter(router) + .setRouterResource(routerResource) + .build(); + return updateRouter(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   Operation response = routerClient.updateRouter(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateRouter(UpdateRouterHttpRequest request) { + return updateRouterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified Router resource with the data included in the request. + * + * Sample code: + *

+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   Router routerResource = Router.newBuilder().build();
+   *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .setRouterResource(routerResource)
+   *     .build();
+   *   ApiFuture<Operation> future = routerClient.updateRouterCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateRouterCallable() { + return stub.updateRouterCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListRoutersPagedResponse extends AbstractPagedListResponse< + AggregatedListRoutersHttpRequest, + RouterAggregatedList, + RoutersScopedList, + AggregatedListRoutersPage, + AggregatedListRoutersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListRoutersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListRoutersPagedResponse apply(AggregatedListRoutersPage input) { + return new AggregatedListRoutersPagedResponse(input); + } + }); + } + + private AggregatedListRoutersPagedResponse(AggregatedListRoutersPage page) { + super(page, AggregatedListRoutersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListRoutersPage extends AbstractPage< + AggregatedListRoutersHttpRequest, + RouterAggregatedList, + RoutersScopedList, + AggregatedListRoutersPage> { + + private AggregatedListRoutersPage( + PageContext context, + RouterAggregatedList response) { + super(context, response); + } + + private static AggregatedListRoutersPage createEmptyPage() { + return new AggregatedListRoutersPage(null, null); + } + + @Override + protected AggregatedListRoutersPage createPage( + PageContext context, + RouterAggregatedList response) { + return new AggregatedListRoutersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListRoutersFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListRoutersHttpRequest, + RouterAggregatedList, + RoutersScopedList, + AggregatedListRoutersPage, + AggregatedListRoutersFixedSizeCollection> { + + private AggregatedListRoutersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListRoutersFixedSizeCollection createEmptyCollection() { + return new AggregatedListRoutersFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListRoutersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListRoutersFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListRoutersPagedResponse extends AbstractPagedListResponse< + ListRoutersHttpRequest, + RouterList, + Router, + ListRoutersPage, + ListRoutersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRoutersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRoutersPagedResponse apply(ListRoutersPage input) { + return new ListRoutersPagedResponse(input); + } + }); + } + + private ListRoutersPagedResponse(ListRoutersPage page) { + super(page, ListRoutersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRoutersPage extends AbstractPage< + ListRoutersHttpRequest, + RouterList, + Router, + ListRoutersPage> { + + private ListRoutersPage( + PageContext context, + RouterList response) { + super(context, response); + } + + private static ListRoutersPage createEmptyPage() { + return new ListRoutersPage(null, null); + } + + @Override + protected ListRoutersPage createPage( + PageContext context, + RouterList response) { + return new ListRoutersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRoutersFixedSizeCollection extends AbstractFixedSizeCollection< + ListRoutersHttpRequest, + RouterList, + Router, + ListRoutersPage, + ListRoutersFixedSizeCollection> { + + private ListRoutersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRoutersFixedSizeCollection createEmptyCollection() { + return new ListRoutersFixedSizeCollection(null, 0); + } + + @Override + protected ListRoutersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRoutersFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java new file mode 100644 index 000000000000..9540e7bc544d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterInterface implements ApiMessage { + private final String ipRange; + private final String linkedVpnTunnel; + private final String name; + + private RouterInterface() { + this.ipRange = null; + this.linkedVpnTunnel = null; + this.name = null; + } + + + private RouterInterface( + String ipRange, + String linkedVpnTunnel, + String name + ) { + this.ipRange = ipRange; + this.linkedVpnTunnel = linkedVpnTunnel; + this.name = name; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipRange") && ipRange != null) { + fieldMap.put("ipRange", Collections.singletonList(String.valueOf(ipRange))); + } + if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) { + fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipRange")) { + return String.valueOf(ipRange); + } + if (fieldName.equals("linkedVpnTunnel")) { + return String.valueOf(linkedVpnTunnel); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getIpRange() { + return ipRange; + } + + public String getLinkedVpnTunnel() { + return linkedVpnTunnel; + } + + public String getName() { + return name; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterInterface prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterInterface getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterInterface DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterInterface(); + } + + public static class Builder { + private String ipRange; + private String linkedVpnTunnel; + private String name; + + Builder() {} + + public Builder mergeFrom(RouterInterface other) { + if (other == RouterInterface.getDefaultInstance()) return this; + if (other.getIpRange() != null) { + this.ipRange = other.ipRange; + } + if (other.getLinkedVpnTunnel() != null) { + this.linkedVpnTunnel = other.linkedVpnTunnel; + } + if (other.getName() != null) { + this.name = other.name; + } + return this; + } + + Builder(RouterInterface source) { + this.ipRange = source.ipRange; + this.linkedVpnTunnel = source.linkedVpnTunnel; + this.name = source.name; + } + + public String getIpRange() { + return ipRange; + } + + public Builder setIpRange(String ipRange) { + this.ipRange = ipRange; + return this; + } + + public String getLinkedVpnTunnel() { + return linkedVpnTunnel; + } + + public Builder setLinkedVpnTunnel(String linkedVpnTunnel) { + this.linkedVpnTunnel = linkedVpnTunnel; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + + public RouterInterface build() { + + + return new RouterInterface( + ipRange, + linkedVpnTunnel, + name + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIpRange(this.ipRange); + newBuilder.setLinkedVpnTunnel(this.linkedVpnTunnel); + newBuilder.setName(this.name); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterInterface{" + + "ipRange=" + ipRange + ", " + + "linkedVpnTunnel=" + linkedVpnTunnel + ", " + + "name=" + name + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterInterface) { + RouterInterface that = (RouterInterface) o; + return + Objects.equals(this.ipRange, that.getIpRange()) && + Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel()) && + Objects.equals(this.name, that.getName()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + ipRange, + linkedVpnTunnel, + name + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java new file mode 100644 index 000000000000..b15018ebd909 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private RouterList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private RouterList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Router item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(RouterList other) { + if (other == RouterList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(RouterList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Router items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public RouterList build() { + + + + + return new RouterList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterList) { + RouterList that = (RouterList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java new file mode 100644 index 000000000000..c8121c04348a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class RouterName implements ResourceName { + private final String project; + private final String region; + private final String router; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private RouterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + router = Preconditions.checkNotNull(builder.getRouter()); + } + + public static RouterName of( + String project, + String region, + String router + ) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setRouter(router) + .build(); + } + + public static String format( + String project, + String region, + String router + ) { + return of( + project, + region, + router + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getRouter() { + return router; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("router", router); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public RouterName parse(String formattedString) {return RouterName.parse(formattedString);} + }; + } + + public static RouterName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "RouterName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("region"), + matchMap.get("router") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String router; + + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + public String getRouter() { + return router; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + public Builder setRouter(String router) { + this.router = router; + return this; + } + + private Builder() {} + + public Builder (RouterName routerName) { + project = routerName.project; + region = routerName.region; + router = routerName.router; + } + + public RouterName build() { + return new RouterName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "router", router + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterName) { + RouterName that = (RouterName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.router, that.getRouter()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + region, + router + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java new file mode 100644 index 000000000000..0e43780cbda2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java @@ -0,0 +1,339 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; +import com.google.cloud.compute.v1.stub.RouterStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RouterClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRouter to 30 seconds: + * + *

+ * 
+ * RouterSettings.Builder routerSettingsBuilder =
+ *     RouterSettings.newBuilder();
+ * routerSettingsBuilder.deleteRouterSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RouterSettings routerSettings = routerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RouterSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListRouters. + */ + public PagedCallSettings aggregatedListRoutersSettings() { + return ((RouterStubSettings) getStubSettings()).aggregatedListRoutersSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteRouter. + */ + public UnaryCallSettings deleteRouterSettings() { + return ((RouterStubSettings) getStubSettings()).deleteRouterSettings(); + } + + /** + * Returns the object with the settings used for calls to getRouter. + */ + public UnaryCallSettings getRouterSettings() { + return ((RouterStubSettings) getStubSettings()).getRouterSettings(); + } + + /** + * Returns the object with the settings used for calls to getRouterStatusRouter. + */ + public UnaryCallSettings getRouterStatusRouterSettings() { + return ((RouterStubSettings) getStubSettings()).getRouterStatusRouterSettings(); + } + + /** + * Returns the object with the settings used for calls to insertRouter. + */ + public UnaryCallSettings insertRouterSettings() { + return ((RouterStubSettings) getStubSettings()).insertRouterSettings(); + } + + /** + * Returns the object with the settings used for calls to listRouters. + */ + public PagedCallSettings listRoutersSettings() { + return ((RouterStubSettings) getStubSettings()).listRoutersSettings(); + } + + /** + * Returns the object with the settings used for calls to patchRouter. + */ + public UnaryCallSettings patchRouterSettings() { + return ((RouterStubSettings) getStubSettings()).patchRouterSettings(); + } + + /** + * Returns the object with the settings used for calls to previewRouter. + */ + public UnaryCallSettings previewRouterSettings() { + return ((RouterStubSettings) getStubSettings()).previewRouterSettings(); + } + + /** + * Returns the object with the settings used for calls to updateRouter. + */ + public UnaryCallSettings updateRouterSettings() { + return ((RouterStubSettings) getStubSettings()).updateRouterSettings(); + } + + + public static final RouterSettings create(RouterStubSettings stub) throws IOException { + return new RouterSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RouterStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RouterStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RouterStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RouterStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RouterStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RouterStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RouterStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RouterStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RouterSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RouterSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RouterStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RouterStubSettings.newBuilder()); + } + + protected Builder(RouterSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RouterStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RouterStubSettings.Builder getStubSettingsBuilder() { + return ((RouterStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListRouters. + */ + public PagedCallSettings.Builder aggregatedListRoutersSettings() { + return getStubSettingsBuilder().aggregatedListRoutersSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteRouter. + */ + public UnaryCallSettings.Builder deleteRouterSettings() { + return getStubSettingsBuilder().deleteRouterSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRouter. + */ + public UnaryCallSettings.Builder getRouterSettings() { + return getStubSettingsBuilder().getRouterSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRouterStatusRouter. + */ + public UnaryCallSettings.Builder getRouterStatusRouterSettings() { + return getStubSettingsBuilder().getRouterStatusRouterSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertRouter. + */ + public UnaryCallSettings.Builder insertRouterSettings() { + return getStubSettingsBuilder().insertRouterSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRouters. + */ + public PagedCallSettings.Builder listRoutersSettings() { + return getStubSettingsBuilder().listRoutersSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchRouter. + */ + public UnaryCallSettings.Builder patchRouterSettings() { + return getStubSettingsBuilder().patchRouterSettings(); + } + + /** + * Returns the builder for the settings used for calls to previewRouter. + */ + public UnaryCallSettings.Builder previewRouterSettings() { + return getStubSettingsBuilder().previewRouterSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateRouter. + */ + public UnaryCallSettings.Builder updateRouterSettings() { + return getStubSettingsBuilder().updateRouterSettings(); + } + + @Override + public RouterSettings build() throws IOException { + return new RouterSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java new file mode 100644 index 000000000000..bbbbde30bb2c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java @@ -0,0 +1,254 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterStatus implements ApiMessage { + private final List bestRoutes; + private final List bgpPeerStatus; + private final String network; + + private RouterStatus() { + this.bestRoutes = null; + this.bgpPeerStatus = null; + this.network = null; + } + + + private RouterStatus( + List bestRoutes, + List bgpPeerStatus, + String network + ) { + this.bestRoutes = bestRoutes; + this.bgpPeerStatus = bgpPeerStatus; + this.network = network; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bestRoutes") && bestRoutes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : bestRoutes) { + stringList.add(item.toString()); + } + fieldMap.put("bestRoutes", stringList.build()); + } + if (fieldNames.contains("bgpPeerStatus") && bgpPeerStatus != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterStatusBgpPeerStatus item : bgpPeerStatus) { + stringList.add(item.toString()); + } + fieldMap.put("bgpPeerStatus", stringList.build()); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("bestRoutes")) { + return String.valueOf(bestRoutes); + } + if (fieldName.equals("bgpPeerStatus")) { + return String.valueOf(bgpPeerStatus); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getBestRoutesList() { + return bestRoutes; + } + + public List getBgpPeerStatusList() { + return bgpPeerStatus; + } + + public String getNetwork() { + return network; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterStatus(); + } + + public static class Builder { + private List bestRoutes; + private List bgpPeerStatus; + private String network; + + Builder() {} + + public Builder mergeFrom(RouterStatus other) { + if (other == RouterStatus.getDefaultInstance()) return this; + if (other.getBestRoutesList() != null) { + this.bestRoutes = other.bestRoutes; + } + if (other.getBgpPeerStatusList() != null) { + this.bgpPeerStatus = other.bgpPeerStatus; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + return this; + } + + Builder(RouterStatus source) { + this.bestRoutes = source.bestRoutes; + this.bgpPeerStatus = source.bgpPeerStatus; + this.network = source.network; + } + + public List getBestRoutesList() { + return bestRoutes; + } + + public Builder addAllBestRoutes(List bestRoutes) { + if (this.bestRoutes == null) { + this.bestRoutes = new ArrayList<>(bestRoutes.size()); + } + this.bestRoutes.addAll(bestRoutes); + return this; + } + + public Builder addBestRoutes(Route bestRoutes) { + this.bestRoutes.add(bestRoutes); + return this; + } + + public List getBgpPeerStatusList() { + return bgpPeerStatus; + } + + public Builder addAllBgpPeerStatus(List bgpPeerStatus) { + if (this.bgpPeerStatus == null) { + this.bgpPeerStatus = new ArrayList<>(bgpPeerStatus.size()); + } + this.bgpPeerStatus.addAll(bgpPeerStatus); + return this; + } + + public Builder addBgpPeerStatus(RouterStatusBgpPeerStatus bgpPeerStatus) { + this.bgpPeerStatus.add(bgpPeerStatus); + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + + public RouterStatus build() { + + + return new RouterStatus( + bestRoutes, + bgpPeerStatus, + network + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllBestRoutes(this.bestRoutes); + newBuilder.addAllBgpPeerStatus(this.bgpPeerStatus); + newBuilder.setNetwork(this.network); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterStatus{" + + "bestRoutes=" + bestRoutes + ", " + + "bgpPeerStatus=" + bgpPeerStatus + ", " + + "network=" + network + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterStatus) { + RouterStatus that = (RouterStatus) o; + return + Objects.equals(this.bestRoutes, that.getBestRoutesList()) && + Objects.equals(this.bgpPeerStatus, that.getBgpPeerStatusList()) && + Objects.equals(this.network, that.getNetwork()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + bestRoutes, + bgpPeerStatus, + network + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java new file mode 100644 index 000000000000..38a08a623252 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java @@ -0,0 +1,480 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterStatusBgpPeerStatus implements ApiMessage { + private final List advertisedRoutes; + private final String ipAddress; + private final String linkedVpnTunnel; + private final String name; + private final Integer numLearnedRoutes; + private final String peerIpAddress; + private final String state; + private final String status; + private final String uptime; + private final String uptimeSeconds; + + private RouterStatusBgpPeerStatus() { + this.advertisedRoutes = null; + this.ipAddress = null; + this.linkedVpnTunnel = null; + this.name = null; + this.numLearnedRoutes = null; + this.peerIpAddress = null; + this.state = null; + this.status = null; + this.uptime = null; + this.uptimeSeconds = null; + } + + + private RouterStatusBgpPeerStatus( + List advertisedRoutes, + String ipAddress, + String linkedVpnTunnel, + String name, + Integer numLearnedRoutes, + String peerIpAddress, + String state, + String status, + String uptime, + String uptimeSeconds + ) { + this.advertisedRoutes = advertisedRoutes; + this.ipAddress = ipAddress; + this.linkedVpnTunnel = linkedVpnTunnel; + this.name = name; + this.numLearnedRoutes = numLearnedRoutes; + this.peerIpAddress = peerIpAddress; + this.state = state; + this.status = status; + this.uptime = uptime; + this.uptimeSeconds = uptimeSeconds; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("advertisedRoutes") && advertisedRoutes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : advertisedRoutes) { + stringList.add(item.toString()); + } + fieldMap.put("advertisedRoutes", stringList.build()); + } + if (fieldNames.contains("ipAddress") && ipAddress != null) { + fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); + } + if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) { + fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("numLearnedRoutes") && numLearnedRoutes != null) { + fieldMap.put("numLearnedRoutes", Collections.singletonList(String.valueOf(numLearnedRoutes))); + } + if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { + fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("uptime") && uptime != null) { + fieldMap.put("uptime", Collections.singletonList(String.valueOf(uptime))); + } + if (fieldNames.contains("uptimeSeconds") && uptimeSeconds != null) { + fieldMap.put("uptimeSeconds", Collections.singletonList(String.valueOf(uptimeSeconds))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("advertisedRoutes")) { + return String.valueOf(advertisedRoutes); + } + if (fieldName.equals("ipAddress")) { + return String.valueOf(ipAddress); + } + if (fieldName.equals("linkedVpnTunnel")) { + return String.valueOf(linkedVpnTunnel); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("numLearnedRoutes")) { + return String.valueOf(numLearnedRoutes); + } + if (fieldName.equals("peerIpAddress")) { + return String.valueOf(peerIpAddress); + } + if (fieldName.equals("state")) { + return String.valueOf(state); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("uptime")) { + return String.valueOf(uptime); + } + if (fieldName.equals("uptimeSeconds")) { + return String.valueOf(uptimeSeconds); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getAdvertisedRoutesList() { + return advertisedRoutes; + } + + public String getIpAddress() { + return ipAddress; + } + + public String getLinkedVpnTunnel() { + return linkedVpnTunnel; + } + + public String getName() { + return name; + } + + public Integer getNumLearnedRoutes() { + return numLearnedRoutes; + } + + public String getPeerIpAddress() { + return peerIpAddress; + } + + public String getState() { + return state; + } + + public String getStatus() { + return status; + } + + public String getUptime() { + return uptime; + } + + public String getUptimeSeconds() { + return uptimeSeconds; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterStatusBgpPeerStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterStatusBgpPeerStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterStatusBgpPeerStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterStatusBgpPeerStatus(); + } + + public static class Builder { + private List advertisedRoutes; + private String ipAddress; + private String linkedVpnTunnel; + private String name; + private Integer numLearnedRoutes; + private String peerIpAddress; + private String state; + private String status; + private String uptime; + private String uptimeSeconds; + + Builder() {} + + public Builder mergeFrom(RouterStatusBgpPeerStatus other) { + if (other == RouterStatusBgpPeerStatus.getDefaultInstance()) return this; + if (other.getAdvertisedRoutesList() != null) { + this.advertisedRoutes = other.advertisedRoutes; + } + if (other.getIpAddress() != null) { + this.ipAddress = other.ipAddress; + } + if (other.getLinkedVpnTunnel() != null) { + this.linkedVpnTunnel = other.linkedVpnTunnel; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNumLearnedRoutes() != null) { + this.numLearnedRoutes = other.numLearnedRoutes; + } + if (other.getPeerIpAddress() != null) { + this.peerIpAddress = other.peerIpAddress; + } + if (other.getState() != null) { + this.state = other.state; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getUptime() != null) { + this.uptime = other.uptime; + } + if (other.getUptimeSeconds() != null) { + this.uptimeSeconds = other.uptimeSeconds; + } + return this; + } + + Builder(RouterStatusBgpPeerStatus source) { + this.advertisedRoutes = source.advertisedRoutes; + this.ipAddress = source.ipAddress; + this.linkedVpnTunnel = source.linkedVpnTunnel; + this.name = source.name; + this.numLearnedRoutes = source.numLearnedRoutes; + this.peerIpAddress = source.peerIpAddress; + this.state = source.state; + this.status = source.status; + this.uptime = source.uptime; + this.uptimeSeconds = source.uptimeSeconds; + } + + public List getAdvertisedRoutesList() { + return advertisedRoutes; + } + + public Builder addAllAdvertisedRoutes(List advertisedRoutes) { + if (this.advertisedRoutes == null) { + this.advertisedRoutes = new ArrayList<>(advertisedRoutes.size()); + } + this.advertisedRoutes.addAll(advertisedRoutes); + return this; + } + + public Builder addAdvertisedRoutes(Route advertisedRoutes) { + this.advertisedRoutes.add(advertisedRoutes); + return this; + } + + public String getIpAddress() { + return ipAddress; + } + + public Builder setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + public String getLinkedVpnTunnel() { + return linkedVpnTunnel; + } + + public Builder setLinkedVpnTunnel(String linkedVpnTunnel) { + this.linkedVpnTunnel = linkedVpnTunnel; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getNumLearnedRoutes() { + return numLearnedRoutes; + } + + public Builder setNumLearnedRoutes(Integer numLearnedRoutes) { + this.numLearnedRoutes = numLearnedRoutes; + return this; + } + + public String getPeerIpAddress() { + return peerIpAddress; + } + + public Builder setPeerIpAddress(String peerIpAddress) { + this.peerIpAddress = peerIpAddress; + return this; + } + + public String getState() { + return state; + } + + public Builder setState(String state) { + this.state = state; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getUptime() { + return uptime; + } + + public Builder setUptime(String uptime) { + this.uptime = uptime; + return this; + } + + public String getUptimeSeconds() { + return uptimeSeconds; + } + + public Builder setUptimeSeconds(String uptimeSeconds) { + this.uptimeSeconds = uptimeSeconds; + return this; + } + + + public RouterStatusBgpPeerStatus build() { + + + + + + + + + + return new RouterStatusBgpPeerStatus( + advertisedRoutes, + ipAddress, + linkedVpnTunnel, + name, + numLearnedRoutes, + peerIpAddress, + state, + status, + uptime, + uptimeSeconds + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAdvertisedRoutes(this.advertisedRoutes); + newBuilder.setIpAddress(this.ipAddress); + newBuilder.setLinkedVpnTunnel(this.linkedVpnTunnel); + newBuilder.setName(this.name); + newBuilder.setNumLearnedRoutes(this.numLearnedRoutes); + newBuilder.setPeerIpAddress(this.peerIpAddress); + newBuilder.setState(this.state); + newBuilder.setStatus(this.status); + newBuilder.setUptime(this.uptime); + newBuilder.setUptimeSeconds(this.uptimeSeconds); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterStatusBgpPeerStatus{" + + "advertisedRoutes=" + advertisedRoutes + ", " + + "ipAddress=" + ipAddress + ", " + + "linkedVpnTunnel=" + linkedVpnTunnel + ", " + + "name=" + name + ", " + + "numLearnedRoutes=" + numLearnedRoutes + ", " + + "peerIpAddress=" + peerIpAddress + ", " + + "state=" + state + ", " + + "status=" + status + ", " + + "uptime=" + uptime + ", " + + "uptimeSeconds=" + uptimeSeconds + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterStatusBgpPeerStatus) { + RouterStatusBgpPeerStatus that = (RouterStatusBgpPeerStatus) o; + return + Objects.equals(this.advertisedRoutes, that.getAdvertisedRoutesList()) && + Objects.equals(this.ipAddress, that.getIpAddress()) && + Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.numLearnedRoutes, that.getNumLearnedRoutes()) && + Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) && + Objects.equals(this.state, that.getState()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.uptime, that.getUptime()) && + Objects.equals(this.uptimeSeconds, that.getUptimeSeconds()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + advertisedRoutes, + ipAddress, + linkedVpnTunnel, + name, + numLearnedRoutes, + peerIpAddress, + state, + status, + uptime, + uptimeSeconds + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java new file mode 100644 index 000000000000..003fb880ce30 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RouterStatusResponse implements ApiMessage { + private final String kind; + private final RouterStatus result; + + private RouterStatusResponse() { + this.kind = null; + this.result = null; + } + + + private RouterStatusResponse( + String kind, + RouterStatus result + ) { + this.kind = kind; + this.result = result; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("result") && result != null) { + fieldMap.put("result", Collections.singletonList(String.valueOf(result))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("result")) { + return String.valueOf(result); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getKind() { + return kind; + } + + public RouterStatus getResult() { + return result; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RouterStatusResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RouterStatusResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RouterStatusResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RouterStatusResponse(); + } + + public static class Builder { + private String kind; + private RouterStatus result; + + Builder() {} + + public Builder mergeFrom(RouterStatusResponse other) { + if (other == RouterStatusResponse.getDefaultInstance()) return this; + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getResult() != null) { + this.result = other.result; + } + return this; + } + + Builder(RouterStatusResponse source) { + this.kind = source.kind; + this.result = source.result; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public RouterStatus getResult() { + return result; + } + + public Builder setResult(RouterStatus result) { + this.result = result; + return this; + } + + + public RouterStatusResponse build() { + + return new RouterStatusResponse( + kind, + result + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setKind(this.kind); + newBuilder.setResult(this.result); + return newBuilder; + } + } + + @Override + public String toString() { + return "RouterStatusResponse{" + + "kind=" + kind + ", " + + "result=" + result + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RouterStatusResponse) { + RouterStatusResponse that = (RouterStatusResponse) o; + return + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.result, that.getResult()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + kind, + result + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java new file mode 100644 index 000000000000..90a3fe8a3dbf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RoutersPreviewResponse implements ApiMessage { + private final Router resource; + + private RoutersPreviewResponse() { + this.resource = null; + } + + + private RoutersPreviewResponse( + Router resource + ) { + this.resource = resource; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Router getResource() { + return resource; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RoutersPreviewResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RoutersPreviewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RoutersPreviewResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RoutersPreviewResponse(); + } + + public static class Builder { + private Router resource; + + Builder() {} + + public Builder mergeFrom(RoutersPreviewResponse other) { + if (other == RoutersPreviewResponse.getDefaultInstance()) return this; + if (other.getResource() != null) { + this.resource = other.resource; + } + return this; + } + + Builder(RoutersPreviewResponse source) { + this.resource = source.resource; + } + + public Router getResource() { + return resource; + } + + public Builder setResource(Router resource) { + this.resource = resource; + return this; + } + + + public RoutersPreviewResponse build() { + return new RoutersPreviewResponse( + resource + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setResource(this.resource); + return newBuilder; + } + } + + @Override + public String toString() { + return "RoutersPreviewResponse{" + + "resource=" + resource + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RoutersPreviewResponse) { + RoutersPreviewResponse that = (RoutersPreviewResponse) o; + return + Objects.equals(this.resource, that.getResource()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + resource + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java new file mode 100644 index 000000000000..9096a32e4817 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RoutersScopedList implements ApiMessage { + private final List routers; + private final Warning warning; + + private RoutersScopedList() { + this.routers = null; + this.warning = null; + } + + + private RoutersScopedList( + List routers, + Warning warning + ) { + this.routers = routers; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("routers") && routers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Router item : routers) { + stringList.add(item.toString()); + } + fieldMap.put("routers", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("routers")) { + return String.valueOf(routers); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getRoutersList() { + return routers; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RoutersScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RoutersScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RoutersScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RoutersScopedList(); + } + + public static class Builder { + private List routers; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(RoutersScopedList other) { + if (other == RoutersScopedList.getDefaultInstance()) return this; + if (other.getRoutersList() != null) { + this.routers = other.routers; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(RoutersScopedList source) { + this.routers = source.routers; + this.warning = source.warning; + } + + public List getRoutersList() { + return routers; + } + + public Builder addAllRouters(List routers) { + if (this.routers == null) { + this.routers = new ArrayList<>(routers.size()); + } + this.routers.addAll(routers); + return this; + } + + public Builder addRouters(Router routers) { + this.routers.add(routers); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public RoutersScopedList build() { + + return new RoutersScopedList( + routers, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllRouters(this.routers); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "RoutersScopedList{" + + "routers=" + routers + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RoutersScopedList) { + RoutersScopedList that = (RoutersScopedList) o; + return + Objects.equals(this.routers, that.getRoutersList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + routers, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java new file mode 100644 index 000000000000..d9dc9f360eb2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SSLHealthCheck implements ApiMessage { + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String request; + private final String response; + + private SSLHealthCheck() { + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.request = null; + this.response = null; + } + + + private SSLHealthCheck( + Integer port, + String portName, + String proxyHeader, + String request, + String response + ) { + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.request = request; + this.response = response; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("request") && request != null) { + fieldMap.put("request", Collections.singletonList(String.valueOf(request))); + } + if (fieldNames.contains("response") && response != null) { + fieldMap.put("response", Collections.singletonList(String.valueOf(response))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("request")) { + return String.valueOf(request); + } + if (fieldName.equals("response")) { + return String.valueOf(response); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequest() { + return request; + } + + public String getResponse() { + return response; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SSLHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SSLHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SSLHealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SSLHealthCheck(); + } + + public static class Builder { + private Integer port; + private String portName; + private String proxyHeader; + private String request; + private String response; + + Builder() {} + + public Builder mergeFrom(SSLHealthCheck other) { + if (other == SSLHealthCheck.getDefaultInstance()) return this; + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequest() != null) { + this.request = other.request; + } + if (other.getResponse() != null) { + this.response = other.response; + } + return this; + } + + Builder(SSLHealthCheck source) { + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.request = source.request; + this.response = source.response; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequest() { + return request; + } + + public Builder setRequest(String request) { + this.request = request; + return this; + } + + public String getResponse() { + return response; + } + + public Builder setResponse(String response) { + this.response = response; + return this; + } + + + public SSLHealthCheck build() { + + + + + return new SSLHealthCheck( + port, + portName, + proxyHeader, + request, + response + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequest(this.request); + newBuilder.setResponse(this.response); + return newBuilder; + } + } + + @Override + public String toString() { + return "SSLHealthCheck{" + + "port=" + port + ", " + + "portName=" + portName + ", " + + "proxyHeader=" + proxyHeader + ", " + + "request=" + request + ", " + + "response=" + response + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SSLHealthCheck) { + SSLHealthCheck that = (SSLHealthCheck) o; + return + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.portName, that.getPortName()) && + Objects.equals(this.proxyHeader, that.getProxyHeader()) && + Objects.equals(this.request, that.getRequest()) && + Objects.equals(this.response, that.getResponse()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + port, + portName, + proxyHeader, + request, + response + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java new file mode 100644 index 000000000000..c8503d297693 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Scheduling implements ApiMessage { + private final Boolean automaticRestart; + private final String onHostMaintenance; + private final Boolean preemptible; + + private Scheduling() { + this.automaticRestart = null; + this.onHostMaintenance = null; + this.preemptible = null; + } + + + private Scheduling( + Boolean automaticRestart, + String onHostMaintenance, + Boolean preemptible + ) { + this.automaticRestart = automaticRestart; + this.onHostMaintenance = onHostMaintenance; + this.preemptible = preemptible; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("automaticRestart") && automaticRestart != null) { + fieldMap.put("automaticRestart", Collections.singletonList(String.valueOf(automaticRestart))); + } + if (fieldNames.contains("onHostMaintenance") && onHostMaintenance != null) { + fieldMap.put("onHostMaintenance", Collections.singletonList(String.valueOf(onHostMaintenance))); + } + if (fieldNames.contains("preemptible") && preemptible != null) { + fieldMap.put("preemptible", Collections.singletonList(String.valueOf(preemptible))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("automaticRestart")) { + return String.valueOf(automaticRestart); + } + if (fieldName.equals("onHostMaintenance")) { + return String.valueOf(onHostMaintenance); + } + if (fieldName.equals("preemptible")) { + return String.valueOf(preemptible); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getAutomaticRestart() { + return automaticRestart; + } + + public String getOnHostMaintenance() { + return onHostMaintenance; + } + + public Boolean getPreemptible() { + return preemptible; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Scheduling prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Scheduling getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Scheduling DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Scheduling(); + } + + public static class Builder { + private Boolean automaticRestart; + private String onHostMaintenance; + private Boolean preemptible; + + Builder() {} + + public Builder mergeFrom(Scheduling other) { + if (other == Scheduling.getDefaultInstance()) return this; + if (other.getAutomaticRestart() != null) { + this.automaticRestart = other.automaticRestart; + } + if (other.getOnHostMaintenance() != null) { + this.onHostMaintenance = other.onHostMaintenance; + } + if (other.getPreemptible() != null) { + this.preemptible = other.preemptible; + } + return this; + } + + Builder(Scheduling source) { + this.automaticRestart = source.automaticRestart; + this.onHostMaintenance = source.onHostMaintenance; + this.preemptible = source.preemptible; + } + + public Boolean getAutomaticRestart() { + return automaticRestart; + } + + public Builder setAutomaticRestart(Boolean automaticRestart) { + this.automaticRestart = automaticRestart; + return this; + } + + public String getOnHostMaintenance() { + return onHostMaintenance; + } + + public Builder setOnHostMaintenance(String onHostMaintenance) { + this.onHostMaintenance = onHostMaintenance; + return this; + } + + public Boolean getPreemptible() { + return preemptible; + } + + public Builder setPreemptible(Boolean preemptible) { + this.preemptible = preemptible; + return this; + } + + + public Scheduling build() { + + + return new Scheduling( + automaticRestart, + onHostMaintenance, + preemptible + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAutomaticRestart(this.automaticRestart); + newBuilder.setOnHostMaintenance(this.onHostMaintenance); + newBuilder.setPreemptible(this.preemptible); + return newBuilder; + } + } + + @Override + public String toString() { + return "Scheduling{" + + "automaticRestart=" + automaticRestart + ", " + + "onHostMaintenance=" + onHostMaintenance + ", " + + "preemptible=" + preemptible + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Scheduling) { + Scheduling that = (Scheduling) o; + return + Objects.equals(this.automaticRestart, that.getAutomaticRestart()) && + Objects.equals(this.onHostMaintenance, that.getOnHostMaintenance()) && + Objects.equals(this.preemptible, that.getPreemptible()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + automaticRestart, + onHostMaintenance, + preemptible + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java new file mode 100644 index 000000000000..f2d32b3e0b9a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ScratchDisks implements ApiMessage { + private final Integer diskGb; + + private ScratchDisks() { + this.diskGb = null; + } + + + private ScratchDisks( + Integer diskGb + ) { + this.diskGb = diskGb; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskGb") && diskGb != null) { + fieldMap.put("diskGb", Collections.singletonList(String.valueOf(diskGb))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskGb")) { + return String.valueOf(diskGb); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getDiskGb() { + return diskGb; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ScratchDisks prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ScratchDisks getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ScratchDisks DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ScratchDisks(); + } + + public static class Builder { + private Integer diskGb; + + Builder() {} + + public Builder mergeFrom(ScratchDisks other) { + if (other == ScratchDisks.getDefaultInstance()) return this; + if (other.getDiskGb() != null) { + this.diskGb = other.diskGb; + } + return this; + } + + Builder(ScratchDisks source) { + this.diskGb = source.diskGb; + } + + public Integer getDiskGb() { + return diskGb; + } + + public Builder setDiskGb(Integer diskGb) { + this.diskGb = diskGb; + return this; + } + + + public ScratchDisks build() { + return new ScratchDisks( + diskGb + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDiskGb(this.diskGb); + return newBuilder; + } + } + + @Override + public String toString() { + return "ScratchDisks{" + + "diskGb=" + diskGb + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScratchDisks) { + ScratchDisks that = (ScratchDisks) o; + return + Objects.equals(this.diskGb, that.getDiskGb()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + diskGb + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java new file mode 100644 index 000000000000..acc506b8b2bf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SerialPortOutput implements ApiMessage { + private final String contents; + private final String kind; + private final String next; + private final String selfLink; + private final String start; + + private SerialPortOutput() { + this.contents = null; + this.kind = null; + this.next = null; + this.selfLink = null; + this.start = null; + } + + + private SerialPortOutput( + String contents, + String kind, + String next, + String selfLink, + String start + ) { + this.contents = contents; + this.kind = kind; + this.next = next; + this.selfLink = selfLink; + this.start = start; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("contents") && contents != null) { + fieldMap.put("contents", Collections.singletonList(String.valueOf(contents))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("next") && next != null) { + fieldMap.put("next", Collections.singletonList(String.valueOf(next))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("start") && start != null) { + fieldMap.put("start", Collections.singletonList(String.valueOf(start))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("contents")) { + return String.valueOf(contents); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("next")) { + return String.valueOf(next); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("start")) { + return String.valueOf(start); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getContents() { + return contents; + } + + public String getKind() { + return kind; + } + + public String getNext() { + return next; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStart() { + return start; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SerialPortOutput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SerialPortOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SerialPortOutput DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SerialPortOutput(); + } + + public static class Builder { + private String contents; + private String kind; + private String next; + private String selfLink; + private String start; + + Builder() {} + + public Builder mergeFrom(SerialPortOutput other) { + if (other == SerialPortOutput.getDefaultInstance()) return this; + if (other.getContents() != null) { + this.contents = other.contents; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNext() != null) { + this.next = other.next; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStart() != null) { + this.start = other.start; + } + return this; + } + + Builder(SerialPortOutput source) { + this.contents = source.contents; + this.kind = source.kind; + this.next = source.next; + this.selfLink = source.selfLink; + this.start = source.start; + } + + public String getContents() { + return contents; + } + + public Builder setContents(String contents) { + this.contents = contents; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNext() { + return next; + } + + public Builder setNext(String next) { + this.next = next; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStart() { + return start; + } + + public Builder setStart(String start) { + this.start = start; + return this; + } + + + public SerialPortOutput build() { + + + + + return new SerialPortOutput( + contents, + kind, + next, + selfLink, + start + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setContents(this.contents); + newBuilder.setKind(this.kind); + newBuilder.setNext(this.next); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStart(this.start); + return newBuilder; + } + } + + @Override + public String toString() { + return "SerialPortOutput{" + + "contents=" + contents + ", " + + "kind=" + kind + ", " + + "next=" + next + ", " + + "selfLink=" + selfLink + ", " + + "start=" + start + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SerialPortOutput) { + SerialPortOutput that = (SerialPortOutput) o; + return + Objects.equals(this.contents, that.getContents()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.next, that.getNext()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.start, that.getStart()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + contents, + kind, + next, + selfLink, + start + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java new file mode 100644 index 000000000000..524c7faf89ab --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ServiceAccount implements ApiMessage { + private final String email; + private final List scopes; + + private ServiceAccount() { + this.email = null; + this.scopes = null; + } + + + private ServiceAccount( + String email, + List scopes + ) { + this.email = email; + this.scopes = scopes; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("email") && email != null) { + fieldMap.put("email", Collections.singletonList(String.valueOf(email))); + } + if (fieldNames.contains("scopes") && scopes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : scopes) { + stringList.add(item.toString()); + } + fieldMap.put("scopes", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("email")) { + return String.valueOf(email); + } + if (fieldName.equals("scopes")) { + return String.valueOf(scopes); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getEmail() { + return email; + } + + public List getScopesList() { + return scopes; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ServiceAccount prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ServiceAccount getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ServiceAccount DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ServiceAccount(); + } + + public static class Builder { + private String email; + private List scopes; + + Builder() {} + + public Builder mergeFrom(ServiceAccount other) { + if (other == ServiceAccount.getDefaultInstance()) return this; + if (other.getEmail() != null) { + this.email = other.email; + } + if (other.getScopesList() != null) { + this.scopes = other.scopes; + } + return this; + } + + Builder(ServiceAccount source) { + this.email = source.email; + this.scopes = source.scopes; + } + + public String getEmail() { + return email; + } + + public Builder setEmail(String email) { + this.email = email; + return this; + } + + public List getScopesList() { + return scopes; + } + + public Builder addAllScopes(List scopes) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(scopes.size()); + } + this.scopes.addAll(scopes); + return this; + } + + public Builder addScopes(String scopes) { + this.scopes.add(scopes); + return this; + } + + + public ServiceAccount build() { + + return new ServiceAccount( + email, + scopes + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setEmail(this.email); + newBuilder.addAllScopes(this.scopes); + return newBuilder; + } + } + + @Override + public String toString() { + return "ServiceAccount{" + + "email=" + email + ", " + + "scopes=" + scopes + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ServiceAccount) { + ServiceAccount that = (ServiceAccount) o; + return + Objects.equals(this.email, that.getEmail()) && + Objects.equals(this.scopes, that.getScopesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + email, + scopes + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..871263aa8005 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetBackendServiceTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource; + private final String targetSslProxy; + private final String userIp; + + private SetBackendServiceTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetSslProxiesSetBackendServiceRequestResource = null; + this.targetSslProxy = null; + this.userIp = null; + } + + + private SetBackendServiceTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, + String targetSslProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetSslProxiesSetBackendServiceRequestResource = targetSslProxiesSetBackendServiceRequestResource; + this.targetSslProxy = targetSslProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource") && targetSslProxiesSetBackendServiceRequestResource != null) { + fieldMap.put("targetSslProxiesSetBackendServiceRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetBackendServiceRequestResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetSslProxiesSetBackendServiceRequestResource")) { + return String.valueOf(targetSslProxiesSetBackendServiceRequestResource); + } + if (fieldName.equals("targetSslProxy")) { + return String.valueOf(targetSslProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetSslProxiesSetBackendServiceRequest getApiMessageRequestBody() { + return targetSslProxiesSetBackendServiceRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetSslProxiesSetBackendServiceRequest getTargetSslProxiesSetBackendServiceRequestResource() { + return targetSslProxiesSetBackendServiceRequestResource; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetBackendServiceTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetBackendServiceTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetBackendServiceTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetBackendServiceTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource; + private String targetSslProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetBackendServiceTargetSslProxyHttpRequest other) { + if (other == SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetSslProxiesSetBackendServiceRequestResource() != null) { + this.targetSslProxiesSetBackendServiceRequestResource = other.targetSslProxiesSetBackendServiceRequestResource; + } + if (other.getTargetSslProxy() != null) { + this.targetSslProxy = other.targetSslProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetBackendServiceTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetSslProxiesSetBackendServiceRequestResource = source.targetSslProxiesSetBackendServiceRequestResource; + this.targetSslProxy = source.targetSslProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetSslProxiesSetBackendServiceRequest getTargetSslProxiesSetBackendServiceRequestResource() { + return targetSslProxiesSetBackendServiceRequestResource; + } + + public Builder setTargetSslProxiesSetBackendServiceRequestResource(TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + this.targetSslProxiesSetBackendServiceRequestResource = targetSslProxiesSetBackendServiceRequestResource; + return this; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetBackendServiceTargetSslProxyHttpRequest build() { + String missing = ""; + + + + + + + + if (targetSslProxy == null) { + missing += " targetSslProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetBackendServiceTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxiesSetBackendServiceRequestResource, + targetSslProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetSslProxiesSetBackendServiceRequestResource(this.targetSslProxiesSetBackendServiceRequestResource); + newBuilder.setTargetSslProxy(this.targetSslProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetBackendServiceTargetSslProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetSslProxiesSetBackendServiceRequestResource=" + targetSslProxiesSetBackendServiceRequestResource + ", " + + "targetSslProxy=" + targetSslProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetBackendServiceTargetSslProxyHttpRequest) { + SetBackendServiceTargetSslProxyHttpRequest that = (SetBackendServiceTargetSslProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetSslProxiesSetBackendServiceRequestResource, that.getTargetSslProxiesSetBackendServiceRequestResource()) && + Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxiesSetBackendServiceRequestResource, + targetSslProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java new file mode 100644 index 000000000000..2420e08328d7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetBackupTargetPoolHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final Float failoverRatio; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetPool; + private final TargetReference targetReferenceResource; + private final String userIp; + + private SetBackupTargetPoolHttpRequest() { + this.access_token = null; + this.callback = null; + this.failoverRatio = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetPool = null; + this.targetReferenceResource = null; + this.userIp = null; + } + + + private SetBackupTargetPoolHttpRequest( + String access_token, + String callback, + Float failoverRatio, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetPool, + TargetReference targetReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.failoverRatio = failoverRatio; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetPool = targetPool; + this.targetReferenceResource = targetReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("failoverRatio") && failoverRatio != null) { + fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { + fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("failoverRatio")) { + return String.valueOf(failoverRatio); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetPool")) { + return String.valueOf(targetPool); + } + if (fieldName.equals("targetReferenceResource")) { + return String.valueOf(targetReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetReference getApiMessageRequestBody() { + return targetReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public Float getFailoverRatio() { + return failoverRatio; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetPool() { + return targetPool; + } + + public TargetReference getTargetReferenceResource() { + return targetReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetBackupTargetPoolHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetBackupTargetPoolHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetBackupTargetPoolHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetBackupTargetPoolHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private Float failoverRatio; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetPool; + private TargetReference targetReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetBackupTargetPoolHttpRequest other) { + if (other == SetBackupTargetPoolHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFailoverRatio() != null) { + this.failoverRatio = other.failoverRatio; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetPool() != null) { + this.targetPool = other.targetPool; + } + if (other.getTargetReferenceResource() != null) { + this.targetReferenceResource = other.targetReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetBackupTargetPoolHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.failoverRatio = source.failoverRatio; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetPool = source.targetPool; + this.targetReferenceResource = source.targetReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public Float getFailoverRatio() { + return failoverRatio; + } + + public Builder setFailoverRatio(Float failoverRatio) { + this.failoverRatio = failoverRatio; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetPool() { + return targetPool; + } + + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + public TargetReference getTargetReferenceResource() { + return targetReferenceResource; + } + + public Builder setTargetReferenceResource(TargetReference targetReferenceResource) { + this.targetReferenceResource = targetReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetBackupTargetPoolHttpRequest build() { + String missing = ""; + + + + + + + + if (targetPool == null) { + missing += " targetPool"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetBackupTargetPoolHttpRequest( + access_token, + callback, + failoverRatio, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFailoverRatio(this.failoverRatio); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetPool(this.targetPool); + newBuilder.setTargetReferenceResource(this.targetReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetBackupTargetPoolHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "failoverRatio=" + failoverRatio + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetPool=" + targetPool + ", " + + "targetReferenceResource=" + targetReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetBackupTargetPoolHttpRequest) { + SetBackupTargetPoolHttpRequest that = (SetBackupTargetPoolHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.failoverRatio, that.getFailoverRatio()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetPool, that.getTargetPool()) && + Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + failoverRatio, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java new file mode 100644 index 000000000000..c39ec922033b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetCommonInstanceMetadataProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final Metadata metadataResource; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private SetCommonInstanceMetadataProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.metadataResource = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetCommonInstanceMetadataProjectHttpRequest( + String access_token, + String callback, + String fields, + String key, + Metadata metadataResource, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.metadataResource = metadataResource; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("metadataResource") && metadataResource != null) { + fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("metadataResource")) { + return String.valueOf(metadataResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Metadata getApiMessageRequestBody() { + return metadataResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public Metadata getMetadataResource() { + return metadataResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetCommonInstanceMetadataProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetCommonInstanceMetadataProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetCommonInstanceMetadataProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetCommonInstanceMetadataProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private Metadata metadataResource; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetCommonInstanceMetadataProjectHttpRequest other) { + if (other == SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMetadataResource() != null) { + this.metadataResource = other.metadataResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetCommonInstanceMetadataProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.metadataResource = source.metadataResource; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Metadata getMetadataResource() { + return metadataResource; + } + + public Builder setMetadataResource(Metadata metadataResource) { + this.metadataResource = metadataResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetCommonInstanceMetadataProjectHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetCommonInstanceMetadataProjectHttpRequest( + access_token, + callback, + fields, + key, + metadataResource, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setMetadataResource(this.metadataResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetCommonInstanceMetadataProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "metadataResource=" + metadataResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetCommonInstanceMetadataProjectHttpRequest) { + SetCommonInstanceMetadataProjectHttpRequest that = (SetCommonInstanceMetadataProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.metadataResource, that.getMetadataResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + metadataResource, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java new file mode 100644 index 000000000000..f177ee3810b9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java @@ -0,0 +1,479 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetDiskAutoDeleteInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final Boolean autoDelete; + private final String callback; + private final String deviceName; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetDiskAutoDeleteInstanceHttpRequest() { + this.access_token = null; + this.autoDelete = null; + this.callback = null; + this.deviceName = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetDiskAutoDeleteInstanceHttpRequest( + String access_token, + Boolean autoDelete, + String callback, + String deviceName, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.autoDelete = autoDelete; + this.callback = callback; + this.deviceName = deviceName; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoDelete") && autoDelete != null) { + fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deviceName") && deviceName != null) { + fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoDelete")) { + return String.valueOf(autoDelete); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("deviceName")) { + return String.valueOf(deviceName); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public Boolean getAutoDelete() { + return autoDelete; + } + + public String getCallback() { + return callback; + } + + public String getDeviceName() { + return deviceName; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetDiskAutoDeleteInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetDiskAutoDeleteInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetDiskAutoDeleteInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetDiskAutoDeleteInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private Boolean autoDelete; + private String callback; + private String deviceName; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetDiskAutoDeleteInstanceHttpRequest other) { + if (other == SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoDelete() != null) { + this.autoDelete = other.autoDelete; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDeviceName() != null) { + this.deviceName = other.deviceName; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetDiskAutoDeleteInstanceHttpRequest source) { + this.access_token = source.access_token; + this.autoDelete = source.autoDelete; + this.callback = source.callback; + this.deviceName = source.deviceName; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public Boolean getAutoDelete() { + return autoDelete; + } + + public Builder setAutoDelete(Boolean autoDelete) { + this.autoDelete = autoDelete; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDeviceName() { + return deviceName; + } + + public Builder setDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetDiskAutoDeleteInstanceHttpRequest build() { + String missing = ""; + + if (autoDelete == null) { + missing += " autoDelete"; + } + + if (deviceName == null) { + missing += " deviceName"; + } + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetDiskAutoDeleteInstanceHttpRequest( + access_token, + autoDelete, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoDelete(this.autoDelete); + newBuilder.setCallback(this.callback); + newBuilder.setDeviceName(this.deviceName); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetDiskAutoDeleteInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "autoDelete=" + autoDelete + ", " + + "callback=" + callback + ", " + + "deviceName=" + deviceName + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetDiskAutoDeleteInstanceHttpRequest) { + SetDiskAutoDeleteInstanceHttpRequest that = (SetDiskAutoDeleteInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoDelete, that.getAutoDelete()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.deviceName, that.getDeviceName()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoDelete, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..40b119a599ae --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetInstanceTemplateInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetInstanceTemplateInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagersSetInstanceTemplateRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetInstanceTemplateInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagersSetInstanceTemplateRequestResource = instanceGroupManagersSetInstanceTemplateRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersSetInstanceTemplateRequestResource") && instanceGroupManagersSetInstanceTemplateRequestResource != null) { + fieldMap.put("instanceGroupManagersSetInstanceTemplateRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("instanceGroupManagersSetInstanceTemplateRequestResource")) { + return String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManagersSetInstanceTemplateRequest getApiMessageRequestBody() { + return instanceGroupManagersSetInstanceTemplateRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManagersSetInstanceTemplateRequest getInstanceGroupManagersSetInstanceTemplateRequestResource() { + return instanceGroupManagersSetInstanceTemplateRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetInstanceTemplateInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetInstanceTemplateInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetInstanceTemplateInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetInstanceTemplateInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetInstanceTemplateInstanceGroupManagerHttpRequest other) { + if (other == SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagersSetInstanceTemplateRequestResource() != null) { + this.instanceGroupManagersSetInstanceTemplateRequestResource = other.instanceGroupManagersSetInstanceTemplateRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetInstanceTemplateInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagersSetInstanceTemplateRequestResource = source.instanceGroupManagersSetInstanceTemplateRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManagersSetInstanceTemplateRequest getInstanceGroupManagersSetInstanceTemplateRequestResource() { + return instanceGroupManagersSetInstanceTemplateRequestResource; + } + + public Builder setInstanceGroupManagersSetInstanceTemplateRequestResource(InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { + this.instanceGroupManagersSetInstanceTemplateRequestResource = instanceGroupManagersSetInstanceTemplateRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetInstanceTemplateInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetInstanceTemplateInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetInstanceTemplateRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagersSetInstanceTemplateRequestResource(this.instanceGroupManagersSetInstanceTemplateRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetInstanceTemplateInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "instanceGroupManagersSetInstanceTemplateRequestResource=" + instanceGroupManagersSetInstanceTemplateRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetInstanceTemplateInstanceGroupManagerHttpRequest) { + SetInstanceTemplateInstanceGroupManagerHttpRequest that = (SetInstanceTemplateInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.instanceGroupManagersSetInstanceTemplateRequestResource, that.getInstanceGroupManagersSetInstanceTemplateRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetInstanceTemplateRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..b795769afdd6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetInstanceTemplateRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource; + private final String userIp; + + private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupManagersSetTemplateRequestResource = null; + this.userIp = null; + } + + + private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupManagersSetTemplateRequestResource = regionInstanceGroupManagersSetTemplateRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource") && regionInstanceGroupManagersSetTemplateRequestResource != null) { + fieldMap.put("regionInstanceGroupManagersSetTemplateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupManagersSetTemplateRequestResource")) { + return String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupManagersSetTemplateRequest getApiMessageRequestBody() { + return regionInstanceGroupManagersSetTemplateRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupManagersSetTemplateRequest getRegionInstanceGroupManagersSetTemplateRequestResource() { + return regionInstanceGroupManagersSetTemplateRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetInstanceTemplateRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetInstanceTemplateRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetInstanceTemplateRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest other) { + if (other == SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupManagersSetTemplateRequestResource() != null) { + this.regionInstanceGroupManagersSetTemplateRequestResource = other.regionInstanceGroupManagersSetTemplateRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupManagersSetTemplateRequestResource = source.regionInstanceGroupManagersSetTemplateRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupManagersSetTemplateRequest getRegionInstanceGroupManagersSetTemplateRequestResource() { + return regionInstanceGroupManagersSetTemplateRequestResource; + } + + public Builder setRegionInstanceGroupManagersSetTemplateRequestResource(RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { + this.regionInstanceGroupManagersSetTemplateRequestResource = regionInstanceGroupManagersSetTemplateRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetInstanceTemplateRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTemplateRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupManagersSetTemplateRequestResource(this.regionInstanceGroupManagersSetTemplateRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetInstanceTemplateRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupManagersSetTemplateRequestResource=" + regionInstanceGroupManagersSetTemplateRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetInstanceTemplateRegionInstanceGroupManagerHttpRequest) { + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest that = (SetInstanceTemplateRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupManagersSetTemplateRequestResource, that.getRegionInstanceGroupManagersSetTemplateRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTemplateRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java new file mode 100644 index 000000000000..19e1597c4278 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetMachineTypeInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetMachineTypeInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.instancesSetMachineTypeRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetMachineTypeInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.instancesSetMachineTypeRequestResource = instancesSetMachineTypeRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetMachineTypeRequestResource") && instancesSetMachineTypeRequestResource != null) { + fieldMap.put("instancesSetMachineTypeRequestResource", Collections.singletonList(String.valueOf(instancesSetMachineTypeRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("instancesSetMachineTypeRequestResource")) { + return String.valueOf(instancesSetMachineTypeRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstancesSetMachineTypeRequest getApiMessageRequestBody() { + return instancesSetMachineTypeRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public InstancesSetMachineTypeRequest getInstancesSetMachineTypeRequestResource() { + return instancesSetMachineTypeRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetMachineTypeInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetMachineTypeInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetMachineTypeInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetMachineTypeInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetMachineTypeInstanceHttpRequest other) { + if (other == SetMachineTypeInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getInstancesSetMachineTypeRequestResource() != null) { + this.instancesSetMachineTypeRequestResource = other.instancesSetMachineTypeRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetMachineTypeInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.instancesSetMachineTypeRequestResource = source.instancesSetMachineTypeRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public InstancesSetMachineTypeRequest getInstancesSetMachineTypeRequestResource() { + return instancesSetMachineTypeRequestResource; + } + + public Builder setInstancesSetMachineTypeRequestResource(InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + this.instancesSetMachineTypeRequestResource = instancesSetMachineTypeRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetMachineTypeInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetMachineTypeInstanceHttpRequest( + access_token, + callback, + fields, + instance, + instancesSetMachineTypeRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setInstancesSetMachineTypeRequestResource(this.instancesSetMachineTypeRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetMachineTypeInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "instancesSetMachineTypeRequestResource=" + instancesSetMachineTypeRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetMachineTypeInstanceHttpRequest) { + SetMachineTypeInstanceHttpRequest that = (SetMachineTypeInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.instancesSetMachineTypeRequestResource, that.getInstancesSetMachineTypeRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + instancesSetMachineTypeRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java new file mode 100644 index 000000000000..963c3d39d7e2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetMetadataInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final Metadata metadataResource; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetMetadataInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.metadataResource = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetMetadataInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + Metadata metadataResource, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.metadataResource = metadataResource; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("metadataResource") && metadataResource != null) { + fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("metadataResource")) { + return String.valueOf(metadataResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Metadata getApiMessageRequestBody() { + return metadataResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public Metadata getMetadataResource() { + return metadataResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetMetadataInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetMetadataInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetMetadataInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetMetadataInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private Metadata metadataResource; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetMetadataInstanceHttpRequest other) { + if (other == SetMetadataInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMetadataResource() != null) { + this.metadataResource = other.metadataResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetMetadataInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.metadataResource = source.metadataResource; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Metadata getMetadataResource() { + return metadataResource; + } + + public Builder setMetadataResource(Metadata metadataResource) { + this.metadataResource = metadataResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetMetadataInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetMetadataInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + metadataResource, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setMetadataResource(this.metadataResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetMetadataInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "metadataResource=" + metadataResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetMetadataInstanceHttpRequest) { + SetMetadataInstanceHttpRequest that = (SetMetadataInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.metadataResource, that.getMetadataResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + metadataResource, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..18468d7a5377 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetNamedPortsInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetNamedPortsInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.instanceGroupsSetNamedPortsRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetNamedPortsInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.instanceGroupsSetNamedPortsRequestResource = instanceGroupsSetNamedPortsRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsSetNamedPortsRequestResource") && instanceGroupsSetNamedPortsRequestResource != null) { + fieldMap.put("instanceGroupsSetNamedPortsRequestResource", Collections.singletonList(String.valueOf(instanceGroupsSetNamedPortsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("instanceGroupsSetNamedPortsRequestResource")) { + return String.valueOf(instanceGroupsSetNamedPortsRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() { + return instanceGroupsSetNamedPortsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public InstanceGroupsSetNamedPortsRequest getInstanceGroupsSetNamedPortsRequestResource() { + return instanceGroupsSetNamedPortsRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetNamedPortsInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetNamedPortsInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetNamedPortsInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetNamedPortsInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetNamedPortsInstanceGroupHttpRequest other) { + if (other == SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getInstanceGroupsSetNamedPortsRequestResource() != null) { + this.instanceGroupsSetNamedPortsRequestResource = other.instanceGroupsSetNamedPortsRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetNamedPortsInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.instanceGroupsSetNamedPortsRequestResource = source.instanceGroupsSetNamedPortsRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public InstanceGroupsSetNamedPortsRequest getInstanceGroupsSetNamedPortsRequestResource() { + return instanceGroupsSetNamedPortsRequestResource; + } + + public Builder setInstanceGroupsSetNamedPortsRequestResource(InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + this.instanceGroupsSetNamedPortsRequestResource = instanceGroupsSetNamedPortsRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetNamedPortsInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetNamedPortsInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + instanceGroupsSetNamedPortsRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setInstanceGroupsSetNamedPortsRequestResource(this.instanceGroupsSetNamedPortsRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetNamedPortsInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "instanceGroupsSetNamedPortsRequestResource=" + instanceGroupsSetNamedPortsRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetNamedPortsInstanceGroupHttpRequest) { + SetNamedPortsInstanceGroupHttpRequest that = (SetNamedPortsInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.instanceGroupsSetNamedPortsRequestResource, that.getInstanceGroupsSetNamedPortsRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + instanceGroupsSetNamedPortsRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java new file mode 100644 index 000000000000..d91366a58ff6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetNamedPortsRegionInstanceGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroup; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource; + private final String userIp; + + private SetNamedPortsRegionInstanceGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroup = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupsSetNamedPortsRequestResource = null; + this.userIp = null; + } + + + private SetNamedPortsRegionInstanceGroupHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroup, + String key, + String prettyPrint, + String quotaUser, + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroup = instanceGroup; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupsSetNamedPortsRequestResource = regionInstanceGroupsSetNamedPortsRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource") && regionInstanceGroupsSetNamedPortsRequestResource != null) { + fieldMap.put("regionInstanceGroupsSetNamedPortsRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroup")) { + return String.valueOf(instanceGroup); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupsSetNamedPortsRequestResource")) { + return String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() { + return regionInstanceGroupsSetNamedPortsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupsSetNamedPortsRequest getRegionInstanceGroupsSetNamedPortsRequestResource() { + return regionInstanceGroupsSetNamedPortsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetNamedPortsRegionInstanceGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetNamedPortsRegionInstanceGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetNamedPortsRegionInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetNamedPortsRegionInstanceGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroup; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetNamedPortsRegionInstanceGroupHttpRequest other) { + if (other == SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroup() != null) { + this.instanceGroup = other.instanceGroup; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupsSetNamedPortsRequestResource() != null) { + this.regionInstanceGroupsSetNamedPortsRequestResource = other.regionInstanceGroupsSetNamedPortsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetNamedPortsRegionInstanceGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroup = source.instanceGroup; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupsSetNamedPortsRequestResource = source.regionInstanceGroupsSetNamedPortsRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroup() { + return instanceGroup; + } + + public Builder setInstanceGroup(String instanceGroup) { + this.instanceGroup = instanceGroup; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupsSetNamedPortsRequest getRegionInstanceGroupsSetNamedPortsRequestResource() { + return regionInstanceGroupsSetNamedPortsRequestResource; + } + + public Builder setRegionInstanceGroupsSetNamedPortsRequestResource(RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + this.regionInstanceGroupsSetNamedPortsRequestResource = regionInstanceGroupsSetNamedPortsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetNamedPortsRegionInstanceGroupHttpRequest build() { + String missing = ""; + + + + if (instanceGroup == null) { + missing += " instanceGroup"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetNamedPortsRegionInstanceGroupHttpRequest( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + regionInstanceGroupsSetNamedPortsRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroup(this.instanceGroup); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupsSetNamedPortsRequestResource(this.regionInstanceGroupsSetNamedPortsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetNamedPortsRegionInstanceGroupHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroup=" + instanceGroup + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupsSetNamedPortsRequestResource=" + regionInstanceGroupsSetNamedPortsRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetNamedPortsRegionInstanceGroupHttpRequest) { + SetNamedPortsRegionInstanceGroupHttpRequest that = (SetNamedPortsRegionInstanceGroupHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupsSetNamedPortsRequestResource, that.getRegionInstanceGroupsSetNamedPortsRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + regionInstanceGroupsSetNamedPortsRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..25a402b8f326 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetProxyHeaderTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource; + private final String targetSslProxy; + private final String userIp; + + private SetProxyHeaderTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetSslProxiesSetProxyHeaderRequestResource = null; + this.targetSslProxy = null; + this.userIp = null; + } + + + private SetProxyHeaderTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, + String targetSslProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetSslProxiesSetProxyHeaderRequestResource = targetSslProxiesSetProxyHeaderRequestResource; + this.targetSslProxy = targetSslProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource") && targetSslProxiesSetProxyHeaderRequestResource != null) { + fieldMap.put("targetSslProxiesSetProxyHeaderRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetSslProxiesSetProxyHeaderRequestResource")) { + return String.valueOf(targetSslProxiesSetProxyHeaderRequestResource); + } + if (fieldName.equals("targetSslProxy")) { + return String.valueOf(targetSslProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetSslProxiesSetProxyHeaderRequest getApiMessageRequestBody() { + return targetSslProxiesSetProxyHeaderRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetSslProxiesSetProxyHeaderRequest getTargetSslProxiesSetProxyHeaderRequestResource() { + return targetSslProxiesSetProxyHeaderRequestResource; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetProxyHeaderTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetProxyHeaderTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetProxyHeaderTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetProxyHeaderTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource; + private String targetSslProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetProxyHeaderTargetSslProxyHttpRequest other) { + if (other == SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetSslProxiesSetProxyHeaderRequestResource() != null) { + this.targetSslProxiesSetProxyHeaderRequestResource = other.targetSslProxiesSetProxyHeaderRequestResource; + } + if (other.getTargetSslProxy() != null) { + this.targetSslProxy = other.targetSslProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetProxyHeaderTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetSslProxiesSetProxyHeaderRequestResource = source.targetSslProxiesSetProxyHeaderRequestResource; + this.targetSslProxy = source.targetSslProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetSslProxiesSetProxyHeaderRequest getTargetSslProxiesSetProxyHeaderRequestResource() { + return targetSslProxiesSetProxyHeaderRequestResource; + } + + public Builder setTargetSslProxiesSetProxyHeaderRequestResource(TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + this.targetSslProxiesSetProxyHeaderRequestResource = targetSslProxiesSetProxyHeaderRequestResource; + return this; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetProxyHeaderTargetSslProxyHttpRequest build() { + String missing = ""; + + + + + + + + if (targetSslProxy == null) { + missing += " targetSslProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetProxyHeaderTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxiesSetProxyHeaderRequestResource, + targetSslProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetSslProxiesSetProxyHeaderRequestResource(this.targetSslProxiesSetProxyHeaderRequestResource); + newBuilder.setTargetSslProxy(this.targetSslProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetProxyHeaderTargetSslProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetSslProxiesSetProxyHeaderRequestResource=" + targetSslProxiesSetProxyHeaderRequestResource + ", " + + "targetSslProxy=" + targetSslProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetProxyHeaderTargetSslProxyHttpRequest) { + SetProxyHeaderTargetSslProxyHttpRequest that = (SetProxyHeaderTargetSslProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetSslProxiesSetProxyHeaderRequestResource, that.getTargetSslProxiesSetProxyHeaderRequestResource()) && + Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxiesSetProxyHeaderRequestResource, + targetSslProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java new file mode 100644 index 000000000000..42f40f716806 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetSchedulingInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final Scheduling schedulingResource; + private final String userIp; + + private SetSchedulingInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.schedulingResource = null; + this.userIp = null; + } + + + private SetSchedulingInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + Scheduling schedulingResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.schedulingResource = schedulingResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("schedulingResource") && schedulingResource != null) { + fieldMap.put("schedulingResource", Collections.singletonList(String.valueOf(schedulingResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("schedulingResource")) { + return String.valueOf(schedulingResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Scheduling getApiMessageRequestBody() { + return schedulingResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Scheduling getSchedulingResource() { + return schedulingResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetSchedulingInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetSchedulingInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetSchedulingInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetSchedulingInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private Scheduling schedulingResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetSchedulingInstanceHttpRequest other) { + if (other == SetSchedulingInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSchedulingResource() != null) { + this.schedulingResource = other.schedulingResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetSchedulingInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.schedulingResource = source.schedulingResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public Scheduling getSchedulingResource() { + return schedulingResource; + } + + public Builder setSchedulingResource(Scheduling schedulingResource) { + this.schedulingResource = schedulingResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetSchedulingInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetSchedulingInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + schedulingResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSchedulingResource(this.schedulingResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetSchedulingInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "schedulingResource=" + schedulingResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetSchedulingInstanceHttpRequest) { + SetSchedulingInstanceHttpRequest that = (SetSchedulingInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.schedulingResource, that.getSchedulingResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + schedulingResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java new file mode 100644 index 000000000000..f1455670eea2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetServiceAccountInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetServiceAccountInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.instancesSetServiceAccountRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetServiceAccountInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.instancesSetServiceAccountRequestResource = instancesSetServiceAccountRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetServiceAccountRequestResource") && instancesSetServiceAccountRequestResource != null) { + fieldMap.put("instancesSetServiceAccountRequestResource", Collections.singletonList(String.valueOf(instancesSetServiceAccountRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("instancesSetServiceAccountRequestResource")) { + return String.valueOf(instancesSetServiceAccountRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstancesSetServiceAccountRequest getApiMessageRequestBody() { + return instancesSetServiceAccountRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public InstancesSetServiceAccountRequest getInstancesSetServiceAccountRequestResource() { + return instancesSetServiceAccountRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetServiceAccountInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetServiceAccountInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetServiceAccountInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetServiceAccountInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetServiceAccountInstanceHttpRequest other) { + if (other == SetServiceAccountInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getInstancesSetServiceAccountRequestResource() != null) { + this.instancesSetServiceAccountRequestResource = other.instancesSetServiceAccountRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetServiceAccountInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.instancesSetServiceAccountRequestResource = source.instancesSetServiceAccountRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public InstancesSetServiceAccountRequest getInstancesSetServiceAccountRequestResource() { + return instancesSetServiceAccountRequestResource; + } + + public Builder setInstancesSetServiceAccountRequestResource(InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + this.instancesSetServiceAccountRequestResource = instancesSetServiceAccountRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetServiceAccountInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetServiceAccountInstanceHttpRequest( + access_token, + callback, + fields, + instance, + instancesSetServiceAccountRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setInstancesSetServiceAccountRequestResource(this.instancesSetServiceAccountRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetServiceAccountInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "instancesSetServiceAccountRequestResource=" + instancesSetServiceAccountRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetServiceAccountInstanceHttpRequest) { + SetServiceAccountInstanceHttpRequest that = (SetServiceAccountInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.instancesSetServiceAccountRequestResource, that.getInstancesSetServiceAccountRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + instancesSetServiceAccountRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..0c1d867a0acd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetSslCertificatesTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource; + private final String targetHttpsProxy; + private final String userIp; + + private SetSslCertificatesTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpsProxiesSetSslCertificatesRequestResource = null; + this.targetHttpsProxy = null; + this.userIp = null; + } + + + private SetSslCertificatesTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, + String targetHttpsProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpsProxiesSetSslCertificatesRequestResource = targetHttpsProxiesSetSslCertificatesRequestResource; + this.targetHttpsProxy = targetHttpsProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource") && targetHttpsProxiesSetSslCertificatesRequestResource != null) { + fieldMap.put("targetHttpsProxiesSetSslCertificatesRequestResource", Collections.singletonList(String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpsProxiesSetSslCertificatesRequestResource")) { + return String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource); + } + if (fieldName.equals("targetHttpsProxy")) { + return String.valueOf(targetHttpsProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetHttpsProxiesSetSslCertificatesRequest getApiMessageRequestBody() { + return targetHttpsProxiesSetSslCertificatesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetHttpsProxiesSetSslCertificatesRequest getTargetHttpsProxiesSetSslCertificatesRequestResource() { + return targetHttpsProxiesSetSslCertificatesRequestResource; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetSslCertificatesTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetSslCertificatesTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetSslCertificatesTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetSslCertificatesTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource; + private String targetHttpsProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetSslCertificatesTargetHttpsProxyHttpRequest other) { + if (other == SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpsProxiesSetSslCertificatesRequestResource() != null) { + this.targetHttpsProxiesSetSslCertificatesRequestResource = other.targetHttpsProxiesSetSslCertificatesRequestResource; + } + if (other.getTargetHttpsProxy() != null) { + this.targetHttpsProxy = other.targetHttpsProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetSslCertificatesTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpsProxiesSetSslCertificatesRequestResource = source.targetHttpsProxiesSetSslCertificatesRequestResource; + this.targetHttpsProxy = source.targetHttpsProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetHttpsProxiesSetSslCertificatesRequest getTargetHttpsProxiesSetSslCertificatesRequestResource() { + return targetHttpsProxiesSetSslCertificatesRequestResource; + } + + public Builder setTargetHttpsProxiesSetSslCertificatesRequestResource(TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + this.targetHttpsProxiesSetSslCertificatesRequestResource = targetHttpsProxiesSetSslCertificatesRequestResource; + return this; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetSslCertificatesTargetHttpsProxyHttpRequest build() { + String missing = ""; + + + + + + + + if (targetHttpsProxy == null) { + missing += " targetHttpsProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetSslCertificatesTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxiesSetSslCertificatesRequestResource, + targetHttpsProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpsProxiesSetSslCertificatesRequestResource(this.targetHttpsProxiesSetSslCertificatesRequestResource); + newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetSslCertificatesTargetHttpsProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpsProxiesSetSslCertificatesRequestResource=" + targetHttpsProxiesSetSslCertificatesRequestResource + ", " + + "targetHttpsProxy=" + targetHttpsProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetSslCertificatesTargetHttpsProxyHttpRequest) { + SetSslCertificatesTargetHttpsProxyHttpRequest that = (SetSslCertificatesTargetHttpsProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpsProxiesSetSslCertificatesRequestResource, that.getTargetHttpsProxiesSetSslCertificatesRequestResource()) && + Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxiesSetSslCertificatesRequestResource, + targetHttpsProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..098d19ada6b6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetSslCertificatesTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource; + private final String targetSslProxy; + private final String userIp; + + private SetSslCertificatesTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetSslProxiesSetSslCertificatesRequestResource = null; + this.targetSslProxy = null; + this.userIp = null; + } + + + private SetSslCertificatesTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, + String targetSslProxy, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetSslProxiesSetSslCertificatesRequestResource = targetSslProxiesSetSslCertificatesRequestResource; + this.targetSslProxy = targetSslProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource") && targetSslProxiesSetSslCertificatesRequestResource != null) { + fieldMap.put("targetSslProxiesSetSslCertificatesRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetSslCertificatesRequestResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetSslProxiesSetSslCertificatesRequestResource")) { + return String.valueOf(targetSslProxiesSetSslCertificatesRequestResource); + } + if (fieldName.equals("targetSslProxy")) { + return String.valueOf(targetSslProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetSslProxiesSetSslCertificatesRequest getApiMessageRequestBody() { + return targetSslProxiesSetSslCertificatesRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetSslProxiesSetSslCertificatesRequest getTargetSslProxiesSetSslCertificatesRequestResource() { + return targetSslProxiesSetSslCertificatesRequestResource; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetSslCertificatesTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetSslCertificatesTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetSslCertificatesTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetSslCertificatesTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource; + private String targetSslProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetSslCertificatesTargetSslProxyHttpRequest other) { + if (other == SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetSslProxiesSetSslCertificatesRequestResource() != null) { + this.targetSslProxiesSetSslCertificatesRequestResource = other.targetSslProxiesSetSslCertificatesRequestResource; + } + if (other.getTargetSslProxy() != null) { + this.targetSslProxy = other.targetSslProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetSslCertificatesTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetSslProxiesSetSslCertificatesRequestResource = source.targetSslProxiesSetSslCertificatesRequestResource; + this.targetSslProxy = source.targetSslProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetSslProxiesSetSslCertificatesRequest getTargetSslProxiesSetSslCertificatesRequestResource() { + return targetSslProxiesSetSslCertificatesRequestResource; + } + + public Builder setTargetSslProxiesSetSslCertificatesRequestResource(TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + this.targetSslProxiesSetSslCertificatesRequestResource = targetSslProxiesSetSslCertificatesRequestResource; + return this; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetSslCertificatesTargetSslProxyHttpRequest build() { + String missing = ""; + + + + + + + + if (targetSslProxy == null) { + missing += " targetSslProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetSslCertificatesTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxiesSetSslCertificatesRequestResource, + targetSslProxy, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetSslProxiesSetSslCertificatesRequestResource(this.targetSslProxiesSetSslCertificatesRequestResource); + newBuilder.setTargetSslProxy(this.targetSslProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetSslCertificatesTargetSslProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetSslProxiesSetSslCertificatesRequestResource=" + targetSslProxiesSetSslCertificatesRequestResource + ", " + + "targetSslProxy=" + targetSslProxy + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetSslCertificatesTargetSslProxyHttpRequest) { + SetSslCertificatesTargetSslProxyHttpRequest that = (SetSslCertificatesTargetSslProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetSslProxiesSetSslCertificatesRequestResource, that.getTargetSslProxiesSetSslCertificatesRequestResource()) && + Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetSslProxiesSetSslCertificatesRequestResource, + targetSslProxy, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java new file mode 100644 index 000000000000..d63b583ee9ff --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetTagsInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final Tags tagsResource; + private final String userIp; + + private SetTagsInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.tagsResource = null; + this.userIp = null; + } + + + private SetTagsInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + Tags tagsResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.tagsResource = tagsResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("tagsResource") && tagsResource != null) { + fieldMap.put("tagsResource", Collections.singletonList(String.valueOf(tagsResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("tagsResource")) { + return String.valueOf(tagsResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Tags getApiMessageRequestBody() { + return tagsResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Tags getTagsResource() { + return tagsResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetTagsInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetTagsInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetTagsInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetTagsInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private Tags tagsResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetTagsInstanceHttpRequest other) { + if (other == SetTagsInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTagsResource() != null) { + this.tagsResource = other.tagsResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetTagsInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.tagsResource = source.tagsResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public Tags getTagsResource() { + return tagsResource; + } + + public Builder setTagsResource(Tags tagsResource) { + this.tagsResource = tagsResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetTagsInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetTagsInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + tagsResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTagsResource(this.tagsResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetTagsInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "tagsResource=" + tagsResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetTagsInstanceHttpRequest) { + SetTagsInstanceHttpRequest that = (SetTagsInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.tagsResource, that.getTagsResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + tagsResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..26aada1f3486 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetTargetForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String forwardingRule; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetReference targetReferenceResource; + private final String userIp; + + private SetTargetForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRule = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetReferenceResource = null; + this.userIp = null; + } + + + private SetTargetForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + String forwardingRule, + String key, + String prettyPrint, + String quotaUser, + TargetReference targetReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRule = forwardingRule; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetReferenceResource = targetReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { + fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRule")) { + return String.valueOf(forwardingRule); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetReferenceResource")) { + return String.valueOf(targetReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetReference getApiMessageRequestBody() { + return targetReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetReference getTargetReferenceResource() { + return targetReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetTargetForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetTargetForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetTargetForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetTargetForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String forwardingRule; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetReference targetReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetTargetForwardingRuleHttpRequest other) { + if (other == SetTargetForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRule() != null) { + this.forwardingRule = other.forwardingRule; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetReferenceResource() != null) { + this.targetReferenceResource = other.targetReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetTargetForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRule = source.forwardingRule; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetReferenceResource = source.targetReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetReference getTargetReferenceResource() { + return targetReferenceResource; + } + + public Builder setTargetReferenceResource(TargetReference targetReferenceResource) { + this.targetReferenceResource = targetReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetTargetForwardingRuleHttpRequest build() { + String missing = ""; + + + + if (forwardingRule == null) { + missing += " forwardingRule"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetTargetForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + targetReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRule(this.forwardingRule); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetReferenceResource(this.targetReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetTargetForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRule=" + forwardingRule + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetReferenceResource=" + targetReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetTargetForwardingRuleHttpRequest) { + SetTargetForwardingRuleHttpRequest that = (SetTargetForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + targetReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java new file mode 100644 index 000000000000..2321a4571f81 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetTargetGlobalForwardingRuleHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String forwardingRule; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final TargetReference targetReferenceResource; + private final String userIp; + + private SetTargetGlobalForwardingRuleHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.forwardingRule = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetReferenceResource = null; + this.userIp = null; + } + + + private SetTargetGlobalForwardingRuleHttpRequest( + String access_token, + String callback, + String fields, + String forwardingRule, + String key, + String prettyPrint, + String quotaUser, + TargetReference targetReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.forwardingRule = forwardingRule; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetReferenceResource = targetReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { + fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("forwardingRule")) { + return String.valueOf(forwardingRule); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetReferenceResource")) { + return String.valueOf(targetReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetReference getApiMessageRequestBody() { + return targetReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public TargetReference getTargetReferenceResource() { + return targetReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetTargetGlobalForwardingRuleHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetTargetGlobalForwardingRuleHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetTargetGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetTargetGlobalForwardingRuleHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String forwardingRule; + private String key; + private String prettyPrint; + private String quotaUser; + private TargetReference targetReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetTargetGlobalForwardingRuleHttpRequest other) { + if (other == SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getForwardingRule() != null) { + this.forwardingRule = other.forwardingRule; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetReferenceResource() != null) { + this.targetReferenceResource = other.targetReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetTargetGlobalForwardingRuleHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.forwardingRule = source.forwardingRule; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetReferenceResource = source.targetReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getForwardingRule() { + return forwardingRule; + } + + public Builder setForwardingRule(String forwardingRule) { + this.forwardingRule = forwardingRule; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public TargetReference getTargetReferenceResource() { + return targetReferenceResource; + } + + public Builder setTargetReferenceResource(TargetReference targetReferenceResource) { + this.targetReferenceResource = targetReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetTargetGlobalForwardingRuleHttpRequest build() { + String missing = ""; + + + + if (forwardingRule == null) { + missing += " forwardingRule"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetTargetGlobalForwardingRuleHttpRequest( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + targetReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setForwardingRule(this.forwardingRule); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetReferenceResource(this.targetReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetTargetGlobalForwardingRuleHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "forwardingRule=" + forwardingRule + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetReferenceResource=" + targetReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetTargetGlobalForwardingRuleHttpRequest) { + SetTargetGlobalForwardingRuleHttpRequest that = (SetTargetGlobalForwardingRuleHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forwardingRule, that.getForwardingRule()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + targetReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..ca8da858cd38 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetTargetPoolsInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SetTargetPoolsInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagersSetTargetPoolsRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SetTargetPoolsInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagersSetTargetPoolsRequestResource = instanceGroupManagersSetTargetPoolsRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersSetTargetPoolsRequestResource") && instanceGroupManagersSetTargetPoolsRequestResource != null) { + fieldMap.put("instanceGroupManagersSetTargetPoolsRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("instanceGroupManagersSetTargetPoolsRequestResource")) { + return String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody() { + return instanceGroupManagersSetTargetPoolsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManagersSetTargetPoolsRequest getInstanceGroupManagersSetTargetPoolsRequestResource() { + return instanceGroupManagersSetTargetPoolsRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetTargetPoolsInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetTargetPoolsInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetTargetPoolsInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetTargetPoolsInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetTargetPoolsInstanceGroupManagerHttpRequest other) { + if (other == SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagersSetTargetPoolsRequestResource() != null) { + this.instanceGroupManagersSetTargetPoolsRequestResource = other.instanceGroupManagersSetTargetPoolsRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetTargetPoolsInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagersSetTargetPoolsRequestResource = source.instanceGroupManagersSetTargetPoolsRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManagersSetTargetPoolsRequest getInstanceGroupManagersSetTargetPoolsRequestResource() { + return instanceGroupManagersSetTargetPoolsRequestResource; + } + + public Builder setInstanceGroupManagersSetTargetPoolsRequestResource(InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { + this.instanceGroupManagersSetTargetPoolsRequestResource = instanceGroupManagersSetTargetPoolsRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetTargetPoolsInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetTargetPoolsInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetTargetPoolsRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagersSetTargetPoolsRequestResource(this.instanceGroupManagersSetTargetPoolsRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetTargetPoolsInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "instanceGroupManagersSetTargetPoolsRequestResource=" + instanceGroupManagersSetTargetPoolsRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetTargetPoolsInstanceGroupManagerHttpRequest) { + SetTargetPoolsInstanceGroupManagerHttpRequest that = (SetTargetPoolsInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.instanceGroupManagersSetTargetPoolsRequestResource, that.getInstanceGroupManagersSetTargetPoolsRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetTargetPoolsRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..b247b831b081 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetTargetPoolsRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instanceGroupManager; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource; + private final String userIp; + + private SetTargetPoolsRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instanceGroupManager = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = null; + this.userIp = null; + } + + + private SetTargetPoolsRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + String fields, + String instanceGroupManager, + String key, + String prettyPrint, + String quotaUser, + RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instanceGroupManager = instanceGroupManager; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = regionInstanceGroupManagersSetTargetPoolsRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource") && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) { + fieldMap.put("regionInstanceGroupManagersSetTargetPoolsRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instanceGroupManager")) { + return String.valueOf(instanceGroupManager); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionInstanceGroupManagersSetTargetPoolsRequestResource")) { + return String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionInstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody() { + return regionInstanceGroupManagersSetTargetPoolsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionInstanceGroupManagersSetTargetPoolsRequest getRegionInstanceGroupManagersSetTargetPoolsRequestResource() { + return regionInstanceGroupManagersSetTargetPoolsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetTargetPoolsRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetTargetPoolsRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetTargetPoolsRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetTargetPoolsRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instanceGroupManager; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetTargetPoolsRegionInstanceGroupManagerHttpRequest other) { + if (other == SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionInstanceGroupManagersSetTargetPoolsRequestResource() != null) { + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = other.regionInstanceGroupManagersSetTargetPoolsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetTargetPoolsRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = source.regionInstanceGroupManagersSetTargetPoolsRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionInstanceGroupManagersSetTargetPoolsRequest getRegionInstanceGroupManagersSetTargetPoolsRequestResource() { + return regionInstanceGroupManagersSetTargetPoolsRequestResource; + } + + public Builder setRegionInstanceGroupManagersSetTargetPoolsRequestResource(RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = regionInstanceGroupManagersSetTargetPoolsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetTargetPoolsRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetTargetPoolsRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTargetPoolsRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionInstanceGroupManagersSetTargetPoolsRequestResource(this.regionInstanceGroupManagersSetTargetPoolsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetTargetPoolsRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManager=" + instanceGroupManager + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "regionInstanceGroupManagersSetTargetPoolsRequestResource=" + regionInstanceGroupManagersSetTargetPoolsRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetTargetPoolsRegionInstanceGroupManagerHttpRequest) { + SetTargetPoolsRegionInstanceGroupManagerHttpRequest that = (SetTargetPoolsRegionInstanceGroupManagerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.regionInstanceGroupManagersSetTargetPoolsRequestResource, that.getRegionInstanceGroupManagersSetTargetPoolsRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTargetPoolsRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java new file mode 100644 index 000000000000..39f07c689ca6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetUrlMapTargetHttpProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetHttpProxy; + private final UrlMapReference urlMapReferenceResource; + private final String userIp; + + private SetUrlMapTargetHttpProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpProxy = null; + this.urlMapReferenceResource = null; + this.userIp = null; + } + + + private SetUrlMapTargetHttpProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetHttpProxy, + UrlMapReference urlMapReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpProxy = targetHttpProxy; + this.urlMapReferenceResource = urlMapReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { + fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); + } + if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { + fieldMap.put("urlMapReferenceResource", Collections.singletonList(String.valueOf(urlMapReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpProxy")) { + return String.valueOf(targetHttpProxy); + } + if (fieldName.equals("urlMapReferenceResource")) { + return String.valueOf(urlMapReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UrlMapReference getApiMessageRequestBody() { + return urlMapReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public UrlMapReference getUrlMapReferenceResource() { + return urlMapReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetUrlMapTargetHttpProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetUrlMapTargetHttpProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetUrlMapTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetUrlMapTargetHttpProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetHttpProxy; + private UrlMapReference urlMapReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetUrlMapTargetHttpProxyHttpRequest other) { + if (other == SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpProxy() != null) { + this.targetHttpProxy = other.targetHttpProxy; + } + if (other.getUrlMapReferenceResource() != null) { + this.urlMapReferenceResource = other.urlMapReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetUrlMapTargetHttpProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpProxy = source.targetHttpProxy; + this.urlMapReferenceResource = source.urlMapReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public Builder setTargetHttpProxy(String targetHttpProxy) { + this.targetHttpProxy = targetHttpProxy; + return this; + } + + public UrlMapReference getUrlMapReferenceResource() { + return urlMapReferenceResource; + } + + public Builder setUrlMapReferenceResource(UrlMapReference urlMapReferenceResource) { + this.urlMapReferenceResource = urlMapReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetUrlMapTargetHttpProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetHttpProxy == null) { + missing += " targetHttpProxy"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetUrlMapTargetHttpProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpProxy, + urlMapReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpProxy(this.targetHttpProxy); + newBuilder.setUrlMapReferenceResource(this.urlMapReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetUrlMapTargetHttpProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpProxy=" + targetHttpProxy + ", " + + "urlMapReferenceResource=" + urlMapReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetUrlMapTargetHttpProxyHttpRequest) { + SetUrlMapTargetHttpProxyHttpRequest that = (SetUrlMapTargetHttpProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) && + Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpProxy, + urlMapReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..3c4de0d6049b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetUrlMapTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String targetHttpsProxy; + private final UrlMapReference urlMapReferenceResource; + private final String userIp; + + private SetUrlMapTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.targetHttpsProxy = null; + this.urlMapReferenceResource = null; + this.userIp = null; + } + + + private SetUrlMapTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String targetHttpsProxy, + UrlMapReference urlMapReferenceResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.targetHttpsProxy = targetHttpsProxy; + this.urlMapReferenceResource = urlMapReferenceResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { + fieldMap.put("urlMapReferenceResource", Collections.singletonList(String.valueOf(urlMapReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("targetHttpsProxy")) { + return String.valueOf(targetHttpsProxy); + } + if (fieldName.equals("urlMapReferenceResource")) { + return String.valueOf(urlMapReferenceResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UrlMapReference getApiMessageRequestBody() { + return urlMapReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public UrlMapReference getUrlMapReferenceResource() { + return urlMapReferenceResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetUrlMapTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetUrlMapTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetUrlMapTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetUrlMapTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String targetHttpsProxy; + private UrlMapReference urlMapReferenceResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetUrlMapTargetHttpsProxyHttpRequest other) { + if (other == SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getTargetHttpsProxy() != null) { + this.targetHttpsProxy = other.targetHttpsProxy; + } + if (other.getUrlMapReferenceResource() != null) { + this.urlMapReferenceResource = other.urlMapReferenceResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetUrlMapTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.targetHttpsProxy = source.targetHttpsProxy; + this.urlMapReferenceResource = source.urlMapReferenceResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + public UrlMapReference getUrlMapReferenceResource() { + return urlMapReferenceResource; + } + + public Builder setUrlMapReferenceResource(UrlMapReference urlMapReferenceResource) { + this.urlMapReferenceResource = urlMapReferenceResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetUrlMapTargetHttpsProxyHttpRequest build() { + String missing = ""; + + + + + + + if (targetHttpsProxy == null) { + missing += " targetHttpsProxy"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetUrlMapTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxy, + urlMapReferenceResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); + newBuilder.setUrlMapReferenceResource(this.urlMapReferenceResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetUrlMapTargetHttpsProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "targetHttpsProxy=" + targetHttpsProxy + ", " + + "urlMapReferenceResource=" + urlMapReferenceResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetUrlMapTargetHttpsProxyHttpRequest) { + SetUrlMapTargetHttpsProxyHttpRequest that = (SetUrlMapTargetHttpsProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && + Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + targetHttpsProxy, + urlMapReferenceResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java new file mode 100644 index 000000000000..872e9f58ecb9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetUsageExportBucketProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final UsageExportLocation usageExportLocationResource; + private final String userIp; + + private SetUsageExportBucketProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.usageExportLocationResource = null; + this.userIp = null; + } + + + private SetUsageExportBucketProjectHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + UsageExportLocation usageExportLocationResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.usageExportLocationResource = usageExportLocationResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("usageExportLocationResource") && usageExportLocationResource != null) { + fieldMap.put("usageExportLocationResource", Collections.singletonList(String.valueOf(usageExportLocationResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("usageExportLocationResource")) { + return String.valueOf(usageExportLocationResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UsageExportLocation getApiMessageRequestBody() { + return usageExportLocationResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public UsageExportLocation getUsageExportLocationResource() { + return usageExportLocationResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SetUsageExportBucketProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetUsageExportBucketProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SetUsageExportBucketProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SetUsageExportBucketProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private UsageExportLocation usageExportLocationResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetUsageExportBucketProjectHttpRequest other) { + if (other == SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUsageExportLocationResource() != null) { + this.usageExportLocationResource = other.usageExportLocationResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetUsageExportBucketProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.usageExportLocationResource = source.usageExportLocationResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public UsageExportLocation getUsageExportLocationResource() { + return usageExportLocationResource; + } + + public Builder setUsageExportLocationResource(UsageExportLocation usageExportLocationResource) { + this.usageExportLocationResource = usageExportLocationResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SetUsageExportBucketProjectHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetUsageExportBucketProjectHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + usageExportLocationResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUsageExportLocationResource(this.usageExportLocationResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetUsageExportBucketProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "usageExportLocationResource=" + usageExportLocationResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetUsageExportBucketProjectHttpRequest) { + SetUsageExportBucketProjectHttpRequest that = (SetUsageExportBucketProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.usageExportLocationResource, that.getUsageExportLocationResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + usageExportLocationResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java new file mode 100644 index 000000000000..6e2670f39c54 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java @@ -0,0 +1,650 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Snapshot implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String diskSizeGb; + private final String id; + private final String kind; + private final List licenses; + private final String name; + private final String selfLink; + private final CustomerEncryptionKey snapshotEncryptionKey; + private final String sourceDisk; + private final CustomerEncryptionKey sourceDiskEncryptionKey; + private final String sourceDiskId; + private final String status; + private final String storageBytes; + private final String storageBytesStatus; + + private Snapshot() { + this.creationTimestamp = null; + this.description = null; + this.diskSizeGb = null; + this.id = null; + this.kind = null; + this.licenses = null; + this.name = null; + this.selfLink = null; + this.snapshotEncryptionKey = null; + this.sourceDisk = null; + this.sourceDiskEncryptionKey = null; + this.sourceDiskId = null; + this.status = null; + this.storageBytes = null; + this.storageBytesStatus = null; + } + + + private Snapshot( + String creationTimestamp, + String description, + String diskSizeGb, + String id, + String kind, + List licenses, + String name, + String selfLink, + CustomerEncryptionKey snapshotEncryptionKey, + String sourceDisk, + CustomerEncryptionKey sourceDiskEncryptionKey, + String sourceDiskId, + String status, + String storageBytes, + String storageBytesStatus + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.diskSizeGb = diskSizeGb; + this.id = id; + this.kind = kind; + this.licenses = licenses; + this.name = name; + this.selfLink = selfLink; + this.snapshotEncryptionKey = snapshotEncryptionKey; + this.sourceDisk = sourceDisk; + this.sourceDiskEncryptionKey = sourceDiskEncryptionKey; + this.sourceDiskId = sourceDiskId; + this.status = status; + this.storageBytes = storageBytes; + this.storageBytesStatus = storageBytesStatus; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { + fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("snapshotEncryptionKey") && snapshotEncryptionKey != null) { + fieldMap.put("snapshotEncryptionKey", Collections.singletonList(String.valueOf(snapshotEncryptionKey))); + } + if (fieldNames.contains("sourceDisk") && sourceDisk != null) { + fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); + } + if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { + fieldMap.put("sourceDiskEncryptionKey", Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); + } + if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { + fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("storageBytes") && storageBytes != null) { + fieldMap.put("storageBytes", Collections.singletonList(String.valueOf(storageBytes))); + } + if (fieldNames.contains("storageBytesStatus") && storageBytesStatus != null) { + fieldMap.put("storageBytesStatus", Collections.singletonList(String.valueOf(storageBytesStatus))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("diskSizeGb")) { + return String.valueOf(diskSizeGb); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("licenses")) { + return String.valueOf(licenses); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("snapshotEncryptionKey")) { + return String.valueOf(snapshotEncryptionKey); + } + if (fieldName.equals("sourceDisk")) { + return String.valueOf(sourceDisk); + } + if (fieldName.equals("sourceDiskEncryptionKey")) { + return String.valueOf(sourceDiskEncryptionKey); + } + if (fieldName.equals("sourceDiskId")) { + return String.valueOf(sourceDiskId); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("storageBytes")) { + return String.valueOf(storageBytes); + } + if (fieldName.equals("storageBytesStatus")) { + return String.valueOf(storageBytesStatus); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getDiskSizeGb() { + return diskSizeGb; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public List getLicensesList() { + return licenses; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public CustomerEncryptionKey getSnapshotEncryptionKey() { + return snapshotEncryptionKey; + } + + public String getSourceDisk() { + return sourceDisk; + } + + public CustomerEncryptionKey getSourceDiskEncryptionKey() { + return sourceDiskEncryptionKey; + } + + public String getSourceDiskId() { + return sourceDiskId; + } + + public String getStatus() { + return status; + } + + public String getStorageBytes() { + return storageBytes; + } + + public String getStorageBytesStatus() { + return storageBytesStatus; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Snapshot prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Snapshot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Snapshot DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Snapshot(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String diskSizeGb; + private String id; + private String kind; + private List licenses; + private String name; + private String selfLink; + private CustomerEncryptionKey snapshotEncryptionKey; + private String sourceDisk; + private CustomerEncryptionKey sourceDiskEncryptionKey; + private String sourceDiskId; + private String status; + private String storageBytes; + private String storageBytesStatus; + + Builder() {} + + public Builder mergeFrom(Snapshot other) { + if (other == Snapshot.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDiskSizeGb() != null) { + this.diskSizeGb = other.diskSizeGb; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLicensesList() != null) { + this.licenses = other.licenses; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSnapshotEncryptionKey() != null) { + this.snapshotEncryptionKey = other.snapshotEncryptionKey; + } + if (other.getSourceDisk() != null) { + this.sourceDisk = other.sourceDisk; + } + if (other.getSourceDiskEncryptionKey() != null) { + this.sourceDiskEncryptionKey = other.sourceDiskEncryptionKey; + } + if (other.getSourceDiskId() != null) { + this.sourceDiskId = other.sourceDiskId; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getStorageBytes() != null) { + this.storageBytes = other.storageBytes; + } + if (other.getStorageBytesStatus() != null) { + this.storageBytesStatus = other.storageBytesStatus; + } + return this; + } + + Builder(Snapshot source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.diskSizeGb = source.diskSizeGb; + this.id = source.id; + this.kind = source.kind; + this.licenses = source.licenses; + this.name = source.name; + this.selfLink = source.selfLink; + this.snapshotEncryptionKey = source.snapshotEncryptionKey; + this.sourceDisk = source.sourceDisk; + this.sourceDiskEncryptionKey = source.sourceDiskEncryptionKey; + this.sourceDiskId = source.sourceDiskId; + this.status = source.status; + this.storageBytes = source.storageBytes; + this.storageBytesStatus = source.storageBytesStatus; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getDiskSizeGb() { + return diskSizeGb; + } + + public Builder setDiskSizeGb(String diskSizeGb) { + this.diskSizeGb = diskSizeGb; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public List getLicensesList() { + return licenses; + } + + public Builder addAllLicenses(List licenses) { + if (this.licenses == null) { + this.licenses = new ArrayList<>(licenses.size()); + } + this.licenses.addAll(licenses); + return this; + } + + public Builder addLicenses(String licenses) { + this.licenses.add(licenses); + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public CustomerEncryptionKey getSnapshotEncryptionKey() { + return snapshotEncryptionKey; + } + + public Builder setSnapshotEncryptionKey(CustomerEncryptionKey snapshotEncryptionKey) { + this.snapshotEncryptionKey = snapshotEncryptionKey; + return this; + } + + public String getSourceDisk() { + return sourceDisk; + } + + public Builder setSourceDisk(String sourceDisk) { + this.sourceDisk = sourceDisk; + return this; + } + + public CustomerEncryptionKey getSourceDiskEncryptionKey() { + return sourceDiskEncryptionKey; + } + + public Builder setSourceDiskEncryptionKey(CustomerEncryptionKey sourceDiskEncryptionKey) { + this.sourceDiskEncryptionKey = sourceDiskEncryptionKey; + return this; + } + + public String getSourceDiskId() { + return sourceDiskId; + } + + public Builder setSourceDiskId(String sourceDiskId) { + this.sourceDiskId = sourceDiskId; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getStorageBytes() { + return storageBytes; + } + + public Builder setStorageBytes(String storageBytes) { + this.storageBytes = storageBytes; + return this; + } + + public String getStorageBytesStatus() { + return storageBytesStatus; + } + + public Builder setStorageBytesStatus(String storageBytesStatus) { + this.storageBytesStatus = storageBytesStatus; + return this; + } + + + public Snapshot build() { + + + + + + + + + + + + + + + return new Snapshot( + creationTimestamp, + description, + diskSizeGb, + id, + kind, + licenses, + name, + selfLink, + snapshotEncryptionKey, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + status, + storageBytes, + storageBytesStatus + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setDiskSizeGb(this.diskSizeGb); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.addAllLicenses(this.licenses); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSnapshotEncryptionKey(this.snapshotEncryptionKey); + newBuilder.setSourceDisk(this.sourceDisk); + newBuilder.setSourceDiskEncryptionKey(this.sourceDiskEncryptionKey); + newBuilder.setSourceDiskId(this.sourceDiskId); + newBuilder.setStatus(this.status); + newBuilder.setStorageBytes(this.storageBytes); + newBuilder.setStorageBytesStatus(this.storageBytesStatus); + return newBuilder; + } + } + + @Override + public String toString() { + return "Snapshot{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "diskSizeGb=" + diskSizeGb + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "licenses=" + licenses + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "snapshotEncryptionKey=" + snapshotEncryptionKey + ", " + + "sourceDisk=" + sourceDisk + ", " + + "sourceDiskEncryptionKey=" + sourceDiskEncryptionKey + ", " + + "sourceDiskId=" + sourceDiskId + ", " + + "status=" + status + ", " + + "storageBytes=" + storageBytes + ", " + + "storageBytesStatus=" + storageBytesStatus + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Snapshot) { + Snapshot that = (Snapshot) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.licenses, that.getLicensesList()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.snapshotEncryptionKey, that.getSnapshotEncryptionKey()) && + Objects.equals(this.sourceDisk, that.getSourceDisk()) && + Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) && + Objects.equals(this.sourceDiskId, that.getSourceDiskId()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.storageBytes, that.getStorageBytes()) && + Objects.equals(this.storageBytesStatus, that.getStorageBytesStatus()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + diskSizeGb, + id, + kind, + licenses, + name, + selfLink, + snapshotEncryptionKey, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + status, + storageBytes, + storageBytesStatus + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java new file mode 100644 index 000000000000..ec3ecb94aed0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java @@ -0,0 +1,619 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.SnapshotStub; +import com.google.cloud.compute.v1.stub.SnapshotStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+ *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ *   Operation response = snapshotClient.deleteSnapshot(snapshot);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the snapshotClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of SnapshotSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * SnapshotSettings snapshotSettings =
+ *     SnapshotSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SnapshotClient snapshotClient =
+ *     SnapshotClient.create(snapshotSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SnapshotSettings snapshotSettings =
+ *     SnapshotSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SnapshotClient snapshotClient =
+ *     SnapshotClient.create(snapshotSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SnapshotClient implements BackgroundResource { + private final SnapshotSettings settings; + private final SnapshotStub stub; + + + + /** + * Constructs an instance of SnapshotClient with default settings. + */ + public static final SnapshotClient create() throws IOException { + return create(SnapshotSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SnapshotClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final SnapshotClient create(SnapshotSettings settings) throws IOException { + return new SnapshotClient(settings); + } + + /** + * Constructs an instance of SnapshotClient, using the given stub for making calls. This is for + * advanced usage - prefer to use SnapshotSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SnapshotClient create(SnapshotStub stub) { + return new SnapshotClient(stub); + } + + /** + * Constructs an instance of SnapshotClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected SnapshotClient(SnapshotSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SnapshotStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SnapshotClient(SnapshotStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SnapshotSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SnapshotStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 snaphots. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   Operation response = snapshotClient.deleteSnapshot(snapshot);
+   * }
+   * 
+ * + * @param snapshot Name of the Snapshot resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSnapshot(SnapshotName snapshot) { + + DeleteSnapshotHttpRequest request = + DeleteSnapshotHttpRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + return deleteSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 snaphots. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   Operation response = snapshotClient.deleteSnapshot(snapshot.toString());
+   * }
+   * 
+ * + * @param snapshot Name of the Snapshot resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSnapshot(String snapshot) { + + DeleteSnapshotHttpRequest request = + DeleteSnapshotHttpRequest.newBuilder() + .setSnapshot(snapshot) + .build(); + return deleteSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 snaphots. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
+   *     .setSnapshot(snapshot.toString())
+   *     .build();
+   *   Operation response = snapshotClient.deleteSnapshot(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSnapshot(DeleteSnapshotHttpRequest request) { + return deleteSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 snaphots. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
+   *     .setSnapshot(snapshot.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = snapshotClient.deleteSnapshotCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteSnapshotCallable() { + return stub.deleteSnapshotCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   Snapshot response = snapshotClient.getSnapshot(snapshot);
+   * }
+   * 
+ * + * @param snapshot Name of the Snapshot resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Snapshot getSnapshot(SnapshotName snapshot) { + + GetSnapshotHttpRequest request = + GetSnapshotHttpRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + return getSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   Snapshot response = snapshotClient.getSnapshot(snapshot.toString());
+   * }
+   * 
+ * + * @param snapshot Name of the Snapshot resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Snapshot getSnapshot(String snapshot) { + + GetSnapshotHttpRequest request = + GetSnapshotHttpRequest.newBuilder() + .setSnapshot(snapshot) + .build(); + return getSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder()
+   *     .setSnapshot(snapshot.toString())
+   *     .build();
+   *   Snapshot response = snapshotClient.getSnapshot(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Snapshot getSnapshot(GetSnapshotHttpRequest request) { + return getSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder()
+   *     .setSnapshot(snapshot.toString())
+   *     .build();
+   *   ApiFuture<Snapshot> future = snapshotClient.getSnapshotCallable().futureCall(request);
+   *   // Do something
+   *   Snapshot response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getSnapshotCallable() { + return stub.getSnapshotCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Snapshot element : snapshotClient.listSnapshots(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSnapshotsPagedResponse listSnapshots(ProjectName project) { + ListSnapshotsHttpRequest request = + ListSnapshotsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listSnapshots(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Snapshot element : snapshotClient.listSnapshots(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSnapshotsPagedResponse listSnapshots(String project) { + ListSnapshotsHttpRequest request = + ListSnapshotsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listSnapshots(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSnapshotsHttpRequest request = ListSnapshotsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Snapshot element : snapshotClient.listSnapshots(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsHttpRequest request) { + return listSnapshotsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSnapshotsHttpRequest request = ListSnapshotsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListSnapshotsPagedResponse> future = snapshotClient.listSnapshotsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Snapshot element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listSnapshotsPagedCallable() { + return stub.listSnapshotsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSnapshotsHttpRequest request = ListSnapshotsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     SnapshotList response = snapshotClient.listSnapshotsCallable().call(request);
+   *     for (Snapshot element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listSnapshotsCallable() { + return stub.listSnapshotsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListSnapshotsPagedResponse extends AbstractPagedListResponse< + ListSnapshotsHttpRequest, + SnapshotList, + Snapshot, + ListSnapshotsPage, + ListSnapshotsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSnapshotsPagedResponse apply(ListSnapshotsPage input) { + return new ListSnapshotsPagedResponse(input); + } + }); + } + + private ListSnapshotsPagedResponse(ListSnapshotsPage page) { + super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListSnapshotsPage extends AbstractPage< + ListSnapshotsHttpRequest, + SnapshotList, + Snapshot, + ListSnapshotsPage> { + + private ListSnapshotsPage( + PageContext context, + SnapshotList response) { + super(context, response); + } + + private static ListSnapshotsPage createEmptyPage() { + return new ListSnapshotsPage(null, null); + } + + @Override + protected ListSnapshotsPage createPage( + PageContext context, + SnapshotList response) { + return new ListSnapshotsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListSnapshotsFixedSizeCollection extends AbstractFixedSizeCollection< + ListSnapshotsHttpRequest, + SnapshotList, + Snapshot, + ListSnapshotsPage, + ListSnapshotsFixedSizeCollection> { + + private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSnapshotsFixedSizeCollection createEmptyCollection() { + return new ListSnapshotsFixedSizeCollection(null, 0); + } + + @Override + protected ListSnapshotsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSnapshotsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java new file mode 100644 index 000000000000..53942a47d8e9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SnapshotList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private SnapshotList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private SnapshotList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Snapshot item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SnapshotList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SnapshotList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SnapshotList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SnapshotList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(SnapshotList other) { + if (other == SnapshotList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(SnapshotList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Snapshot items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public SnapshotList build() { + + + + + return new SnapshotList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "SnapshotList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SnapshotList) { + SnapshotList that = (SnapshotList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java new file mode 100644 index 000000000000..0f557b09e554 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class SnapshotName implements ResourceName { + private final String project; + private final String snapshot; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{snapshot}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private SnapshotName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + snapshot = Preconditions.checkNotNull(builder.getSnapshot()); + } + + public static SnapshotName of( + String project, + String snapshot + ) { + return newBuilder() + .setProject(project) + .setSnapshot(snapshot) + .build(); + } + + public static String format( + String project, + String snapshot + ) { + return of( + project, + snapshot + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getSnapshot() { + return snapshot; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("snapshot", snapshot); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public SnapshotName parse(String formattedString) {return SnapshotName.parse(formattedString);} + }; + } + + public static SnapshotName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "SnapshotName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("snapshot") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String snapshot; + + public String getProject() { + return project; + } + public String getSnapshot() { + return snapshot; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setSnapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + + private Builder() {} + + public Builder (SnapshotName snapshotName) { + project = snapshotName.project; + snapshot = snapshotName.snapshot; + } + + public SnapshotName build() { + return new SnapshotName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "snapshot", snapshot + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SnapshotName) { + SnapshotName that = (SnapshotName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.snapshot, that.getSnapshot()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + snapshot + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java new file mode 100644 index 000000000000..3b76a7a7a68d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java @@ -0,0 +1,254 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import com.google.cloud.compute.v1.stub.SnapshotStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SnapshotClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSnapshot to 30 seconds: + * + *

+ * 
+ * SnapshotSettings.Builder snapshotSettingsBuilder =
+ *     SnapshotSettings.newBuilder();
+ * snapshotSettingsBuilder.deleteSnapshotSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SnapshotSettings snapshotSettings = snapshotSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SnapshotSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteSnapshot. + */ + public UnaryCallSettings deleteSnapshotSettings() { + return ((SnapshotStubSettings) getStubSettings()).deleteSnapshotSettings(); + } + + /** + * Returns the object with the settings used for calls to getSnapshot. + */ + public UnaryCallSettings getSnapshotSettings() { + return ((SnapshotStubSettings) getStubSettings()).getSnapshotSettings(); + } + + /** + * Returns the object with the settings used for calls to listSnapshots. + */ + public PagedCallSettings listSnapshotsSettings() { + return ((SnapshotStubSettings) getStubSettings()).listSnapshotsSettings(); + } + + + public static final SnapshotSettings create(SnapshotStubSettings stub) throws IOException { + return new SnapshotSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SnapshotStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return SnapshotStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return SnapshotStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return SnapshotStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SnapshotStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return SnapshotStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SnapshotStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SnapshotStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SnapshotSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for SnapshotSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SnapshotStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SnapshotStubSettings.newBuilder()); + } + + protected Builder(SnapshotSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SnapshotStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public SnapshotStubSettings.Builder getStubSettingsBuilder() { + return ((SnapshotStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteSnapshot. + */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { + return getStubSettingsBuilder().deleteSnapshotSettings(); + } + + /** + * Returns the builder for the settings used for calls to getSnapshot. + */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getStubSettingsBuilder().getSnapshotSettings(); + } + + /** + * Returns the builder for the settings used for calls to listSnapshots. + */ + public PagedCallSettings.Builder listSnapshotsSettings() { + return getStubSettingsBuilder().listSnapshotsSettings(); + } + + @Override + public SnapshotSettings build() throws IOException { + return new SnapshotSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java new file mode 100644 index 000000000000..522c372b8492 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java @@ -0,0 +1,400 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SslCertificate implements ApiMessage { + private final String certificate; + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String privateKey; + private final String selfLink; + + private SslCertificate() { + this.certificate = null; + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.privateKey = null; + this.selfLink = null; + } + + + private SslCertificate( + String certificate, + String creationTimestamp, + String description, + String id, + String kind, + String name, + String privateKey, + String selfLink + ) { + this.certificate = certificate; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.privateKey = privateKey; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("certificate") && certificate != null) { + fieldMap.put("certificate", Collections.singletonList(String.valueOf(certificate))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("privateKey") && privateKey != null) { + fieldMap.put("privateKey", Collections.singletonList(String.valueOf(privateKey))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("certificate")) { + return String.valueOf(certificate); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("privateKey")) { + return String.valueOf(privateKey); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCertificate() { + return certificate; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getPrivateKey() { + return privateKey; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SslCertificate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SslCertificate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SslCertificate DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SslCertificate(); + } + + public static class Builder { + private String certificate; + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String privateKey; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(SslCertificate other) { + if (other == SslCertificate.getDefaultInstance()) return this; + if (other.getCertificate() != null) { + this.certificate = other.certificate; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPrivateKey() != null) { + this.privateKey = other.privateKey; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(SslCertificate source) { + this.certificate = source.certificate; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.privateKey = source.privateKey; + this.selfLink = source.selfLink; + } + + public String getCertificate() { + return certificate; + } + + public Builder setCertificate(String certificate) { + this.certificate = certificate; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getPrivateKey() { + return privateKey; + } + + public Builder setPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public SslCertificate build() { + + + + + + + + return new SslCertificate( + certificate, + creationTimestamp, + description, + id, + kind, + name, + privateKey, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCertificate(this.certificate); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPrivateKey(this.privateKey); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "SslCertificate{" + + "certificate=" + certificate + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "privateKey=" + privateKey + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslCertificate) { + SslCertificate that = (SslCertificate) o; + return + Objects.equals(this.certificate, that.getCertificate()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.privateKey, that.getPrivateKey()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + certificate, + creationTimestamp, + description, + id, + kind, + name, + privateKey, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java new file mode 100644 index 000000000000..8723760eca02 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java @@ -0,0 +1,716 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.SslCertificateStub; +import com.google.cloud.compute.v1.stub.SslCertificateStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+ *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+ *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the sslCertificateClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of SslCertificateSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * SslCertificateSettings sslCertificateSettings =
+ *     SslCertificateSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SslCertificateClient sslCertificateClient =
+ *     SslCertificateClient.create(sslCertificateSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SslCertificateSettings sslCertificateSettings =
+ *     SslCertificateSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SslCertificateClient sslCertificateClient =
+ *     SslCertificateClient.create(sslCertificateSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SslCertificateClient implements BackgroundResource { + private final SslCertificateSettings settings; + private final SslCertificateStub stub; + + + + /** + * Constructs an instance of SslCertificateClient with default settings. + */ + public static final SslCertificateClient create() throws IOException { + return create(SslCertificateSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SslCertificateClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final SslCertificateClient create(SslCertificateSettings settings) throws IOException { + return new SslCertificateClient(settings); + } + + /** + * Constructs an instance of SslCertificateClient, using the given stub for making calls. This is for + * advanced usage - prefer to use SslCertificateSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SslCertificateClient create(SslCertificateStub stub) { + return new SslCertificateClient(stub); + } + + /** + * Constructs an instance of SslCertificateClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected SslCertificateClient(SslCertificateSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SslCertificateStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SslCertificateClient(SslCertificateStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SslCertificateSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SslCertificateStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified SslCertificate resource. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
+   * }
+   * 
+ * + * @param sslCertificate Name of the SslCertificate resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSslCertificate(SslCertificateName sslCertificate) { + + DeleteSslCertificateHttpRequest request = + DeleteSslCertificateHttpRequest.newBuilder() + .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) + .build(); + return deleteSslCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified SslCertificate resource. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString());
+   * }
+   * 
+ * + * @param sslCertificate Name of the SslCertificate resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSslCertificate(String sslCertificate) { + + DeleteSslCertificateHttpRequest request = + DeleteSslCertificateHttpRequest.newBuilder() + .setSslCertificate(sslCertificate) + .build(); + return deleteSslCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified SslCertificate resource. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
+   *     .setSslCertificate(sslCertificate.toString())
+   *     .build();
+   *   Operation response = sslCertificateClient.deleteSslCertificate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest request) { + return deleteSslCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified SslCertificate resource. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
+   *     .setSslCertificate(sslCertificate.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = sslCertificateClient.deleteSslCertificateCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteSslCertificateCallable() { + return stub.deleteSslCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate);
+   * }
+   * 
+ * + * @param sslCertificate Name of the SslCertificate resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslCertificate getSslCertificate(SslCertificateName sslCertificate) { + + GetSslCertificateHttpRequest request = + GetSslCertificateHttpRequest.newBuilder() + .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) + .build(); + return getSslCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate.toString());
+   * }
+   * 
+ * + * @param sslCertificate Name of the SslCertificate resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslCertificate getSslCertificate(String sslCertificate) { + + GetSslCertificateHttpRequest request = + GetSslCertificateHttpRequest.newBuilder() + .setSslCertificate(sslCertificate) + .build(); + return getSslCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
+   *     .setSslCertificate(sslCertificate.toString())
+   *     .build();
+   *   SslCertificate response = sslCertificateClient.getSslCertificate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest request) { + return getSslCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
+   *     .setSslCertificate(sslCertificate.toString())
+   *     .build();
+   *   ApiFuture<SslCertificate> future = sslCertificateClient.getSslCertificateCallable().futureCall(request);
+   *   // Do something
+   *   SslCertificate response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getSslCertificateCallable() { + return stub.getSslCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
+   *   Operation response = sslCertificateClient.insertSslCertificate(project, sslCertificateResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSslCertificate(ProjectName project, SslCertificate sslCertificateResource) { + + InsertSslCertificateHttpRequest request = + InsertSslCertificateHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setSslCertificateResource(sslCertificateResource) + .build(); + return insertSslCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
+   *   Operation response = sslCertificateClient.insertSslCertificate(project.toString(), sslCertificateResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSslCertificate(String project, SslCertificate sslCertificateResource) { + + InsertSslCertificateHttpRequest request = + InsertSslCertificateHttpRequest.newBuilder() + .setProject(project) + .setSslCertificateResource(sslCertificateResource) + .build(); + return insertSslCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
+   *   InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setSslCertificateResource(sslCertificateResource)
+   *     .build();
+   *   Operation response = sslCertificateClient.insertSslCertificate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSslCertificate(InsertSslCertificateHttpRequest request) { + return insertSslCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
+   *   InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setSslCertificateResource(sslCertificateResource)
+   *     .build();
+   *   ApiFuture<Operation> future = sslCertificateClient.insertSslCertificateCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertSslCertificateCallable() { + return stub.insertSslCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (SslCertificate element : sslCertificateClient.listSslCertificates(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSslCertificatesPagedResponse listSslCertificates(ProjectName project) { + ListSslCertificatesHttpRequest request = + ListSslCertificatesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listSslCertificates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (SslCertificate element : sslCertificateClient.listSslCertificates(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSslCertificatesPagedResponse listSslCertificates(String project) { + ListSslCertificatesHttpRequest request = + ListSslCertificatesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listSslCertificates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSslCertificatesHttpRequest request = ListSslCertificatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (SslCertificate element : sslCertificateClient.listSslCertificates(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSslCertificatesPagedResponse listSslCertificates(ListSslCertificatesHttpRequest request) { + return listSslCertificatesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSslCertificatesHttpRequest request = ListSslCertificatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListSslCertificatesPagedResponse> future = sslCertificateClient.listSslCertificatesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (SslCertificate element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listSslCertificatesPagedCallable() { + return stub.listSslCertificatesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * Sample code: + *

+   * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSslCertificatesHttpRequest request = ListSslCertificatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     SslCertificateList response = sslCertificateClient.listSslCertificatesCallable().call(request);
+   *     for (SslCertificate element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listSslCertificatesCallable() { + return stub.listSslCertificatesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListSslCertificatesPagedResponse extends AbstractPagedListResponse< + ListSslCertificatesHttpRequest, + SslCertificateList, + SslCertificate, + ListSslCertificatesPage, + ListSslCertificatesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSslCertificatesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSslCertificatesPagedResponse apply(ListSslCertificatesPage input) { + return new ListSslCertificatesPagedResponse(input); + } + }); + } + + private ListSslCertificatesPagedResponse(ListSslCertificatesPage page) { + super(page, ListSslCertificatesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListSslCertificatesPage extends AbstractPage< + ListSslCertificatesHttpRequest, + SslCertificateList, + SslCertificate, + ListSslCertificatesPage> { + + private ListSslCertificatesPage( + PageContext context, + SslCertificateList response) { + super(context, response); + } + + private static ListSslCertificatesPage createEmptyPage() { + return new ListSslCertificatesPage(null, null); + } + + @Override + protected ListSslCertificatesPage createPage( + PageContext context, + SslCertificateList response) { + return new ListSslCertificatesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListSslCertificatesFixedSizeCollection extends AbstractFixedSizeCollection< + ListSslCertificatesHttpRequest, + SslCertificateList, + SslCertificate, + ListSslCertificatesPage, + ListSslCertificatesFixedSizeCollection> { + + private ListSslCertificatesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSslCertificatesFixedSizeCollection createEmptyCollection() { + return new ListSslCertificatesFixedSizeCollection(null, 0); + } + + @Override + protected ListSslCertificatesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSslCertificatesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java new file mode 100644 index 000000000000..b7716df69e54 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SslCertificateList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private SslCertificateList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private SslCertificateList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (SslCertificate item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SslCertificateList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SslCertificateList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SslCertificateList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SslCertificateList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(SslCertificateList other) { + if (other == SslCertificateList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(SslCertificateList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(SslCertificate items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public SslCertificateList build() { + + + + + return new SslCertificateList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "SslCertificateList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslCertificateList) { + SslCertificateList that = (SslCertificateList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java new file mode 100644 index 000000000000..5237a912e9f7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class SslCertificateName implements ResourceName { + private final String project; + private final String sslCertificate; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private SslCertificateName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + sslCertificate = Preconditions.checkNotNull(builder.getSslCertificate()); + } + + public static SslCertificateName of( + String project, + String sslCertificate + ) { + return newBuilder() + .setProject(project) + .setSslCertificate(sslCertificate) + .build(); + } + + public static String format( + String project, + String sslCertificate + ) { + return of( + project, + sslCertificate + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getSslCertificate() { + return sslCertificate; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("sslCertificate", sslCertificate); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public SslCertificateName parse(String formattedString) {return SslCertificateName.parse(formattedString);} + }; + } + + public static SslCertificateName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "SslCertificateName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("sslCertificate") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String sslCertificate; + + public String getProject() { + return project; + } + public String getSslCertificate() { + return sslCertificate; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setSslCertificate(String sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + private Builder() {} + + public Builder (SslCertificateName sslCertificateName) { + project = sslCertificateName.project; + sslCertificate = sslCertificateName.sslCertificate; + } + + public SslCertificateName build() { + return new SslCertificateName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "sslCertificate", sslCertificate + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslCertificateName) { + SslCertificateName that = (SslCertificateName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.sslCertificate, that.getSslCertificate()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + sslCertificate + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java new file mode 100644 index 000000000000..0c6e60bab287 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java @@ -0,0 +1,268 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import com.google.cloud.compute.v1.stub.SslCertificateStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SslCertificateClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSslCertificate to 30 seconds: + * + *

+ * 
+ * SslCertificateSettings.Builder sslCertificateSettingsBuilder =
+ *     SslCertificateSettings.newBuilder();
+ * sslCertificateSettingsBuilder.deleteSslCertificateSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SslCertificateSettings sslCertificateSettings = sslCertificateSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SslCertificateSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteSslCertificate. + */ + public UnaryCallSettings deleteSslCertificateSettings() { + return ((SslCertificateStubSettings) getStubSettings()).deleteSslCertificateSettings(); + } + + /** + * Returns the object with the settings used for calls to getSslCertificate. + */ + public UnaryCallSettings getSslCertificateSettings() { + return ((SslCertificateStubSettings) getStubSettings()).getSslCertificateSettings(); + } + + /** + * Returns the object with the settings used for calls to insertSslCertificate. + */ + public UnaryCallSettings insertSslCertificateSettings() { + return ((SslCertificateStubSettings) getStubSettings()).insertSslCertificateSettings(); + } + + /** + * Returns the object with the settings used for calls to listSslCertificates. + */ + public PagedCallSettings listSslCertificatesSettings() { + return ((SslCertificateStubSettings) getStubSettings()).listSslCertificatesSettings(); + } + + + public static final SslCertificateSettings create(SslCertificateStubSettings stub) throws IOException { + return new SslCertificateSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SslCertificateStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return SslCertificateStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return SslCertificateStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return SslCertificateStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SslCertificateStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return SslCertificateStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SslCertificateStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SslCertificateStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SslCertificateSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for SslCertificateSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SslCertificateStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SslCertificateStubSettings.newBuilder()); + } + + protected Builder(SslCertificateSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SslCertificateStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public SslCertificateStubSettings.Builder getStubSettingsBuilder() { + return ((SslCertificateStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteSslCertificate. + */ + public UnaryCallSettings.Builder deleteSslCertificateSettings() { + return getStubSettingsBuilder().deleteSslCertificateSettings(); + } + + /** + * Returns the builder for the settings used for calls to getSslCertificate. + */ + public UnaryCallSettings.Builder getSslCertificateSettings() { + return getStubSettingsBuilder().getSslCertificateSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertSslCertificate. + */ + public UnaryCallSettings.Builder insertSslCertificateSettings() { + return getStubSettingsBuilder().insertSslCertificateSettings(); + } + + /** + * Returns the builder for the settings used for calls to listSslCertificates. + */ + public PagedCallSettings.Builder listSslCertificatesSettings() { + return getStubSettingsBuilder().listSslCertificatesSettings(); + } + + @Override + public SslCertificateSettings build() throws IOException { + return new SslCertificateSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java new file mode 100644 index 000000000000..78ab0319f2ac --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class StartInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private StartInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private StartInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(StartInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static StartInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final StartInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new StartInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(StartInstanceHttpRequest other) { + if (other == StartInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(StartInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public StartInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new StartInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "StartInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof StartInstanceHttpRequest) { + StartInstanceHttpRequest that = (StartInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java new file mode 100644 index 000000000000..4824ec430416 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class StartWithEncryptionKeyInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private StartWithEncryptionKeyInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.instancesStartWithEncryptionKeyRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private StartWithEncryptionKeyInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.instancesStartWithEncryptionKeyRequestResource = instancesStartWithEncryptionKeyRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesStartWithEncryptionKeyRequestResource") && instancesStartWithEncryptionKeyRequestResource != null) { + fieldMap.put("instancesStartWithEncryptionKeyRequestResource", Collections.singletonList(String.valueOf(instancesStartWithEncryptionKeyRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("instancesStartWithEncryptionKeyRequestResource")) { + return String.valueOf(instancesStartWithEncryptionKeyRequestResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InstancesStartWithEncryptionKeyRequest getApiMessageRequestBody() { + return instancesStartWithEncryptionKeyRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public InstancesStartWithEncryptionKeyRequest getInstancesStartWithEncryptionKeyRequestResource() { + return instancesStartWithEncryptionKeyRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(StartWithEncryptionKeyInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static StartWithEncryptionKeyInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final StartWithEncryptionKeyInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new StartWithEncryptionKeyInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(StartWithEncryptionKeyInstanceHttpRequest other) { + if (other == StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getInstancesStartWithEncryptionKeyRequestResource() != null) { + this.instancesStartWithEncryptionKeyRequestResource = other.instancesStartWithEncryptionKeyRequestResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(StartWithEncryptionKeyInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.instancesStartWithEncryptionKeyRequestResource = source.instancesStartWithEncryptionKeyRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public InstancesStartWithEncryptionKeyRequest getInstancesStartWithEncryptionKeyRequestResource() { + return instancesStartWithEncryptionKeyRequestResource; + } + + public Builder setInstancesStartWithEncryptionKeyRequestResource(InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + this.instancesStartWithEncryptionKeyRequestResource = instancesStartWithEncryptionKeyRequestResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public StartWithEncryptionKeyInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new StartWithEncryptionKeyInstanceHttpRequest( + access_token, + callback, + fields, + instance, + instancesStartWithEncryptionKeyRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setInstancesStartWithEncryptionKeyRequestResource(this.instancesStartWithEncryptionKeyRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "StartWithEncryptionKeyInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "instancesStartWithEncryptionKeyRequestResource=" + instancesStartWithEncryptionKeyRequestResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof StartWithEncryptionKeyInstanceHttpRequest) { + StartWithEncryptionKeyInstanceHttpRequest that = (StartWithEncryptionKeyInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.instancesStartWithEncryptionKeyRequestResource, that.getInstancesStartWithEncryptionKeyRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + instancesStartWithEncryptionKeyRequestResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java new file mode 100644 index 000000000000..7c5a50ffd4a5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class StopInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private StopInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private StopInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(StopInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static StopInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final StopInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new StopInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(StopInstanceHttpRequest other) { + if (other == StopInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(StopInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public StopInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new StopInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "StopInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof StopInstanceHttpRequest) { + StopInstanceHttpRequest that = (StopInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java new file mode 100644 index 000000000000..a3d8de56c02c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java @@ -0,0 +1,468 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Subnetwork implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String gatewayAddress; + private final String id; + private final String ipCidrRange; + private final String kind; + private final String name; + private final String network; + private final String region; + private final String selfLink; + + private Subnetwork() { + this.creationTimestamp = null; + this.description = null; + this.gatewayAddress = null; + this.id = null; + this.ipCidrRange = null; + this.kind = null; + this.name = null; + this.network = null; + this.region = null; + this.selfLink = null; + } + + + private Subnetwork( + String creationTimestamp, + String description, + String gatewayAddress, + String id, + String ipCidrRange, + String kind, + String name, + String network, + String region, + String selfLink + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.gatewayAddress = gatewayAddress; + this.id = id; + this.ipCidrRange = ipCidrRange; + this.kind = kind; + this.name = name; + this.network = network; + this.region = region; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("gatewayAddress") && gatewayAddress != null) { + fieldMap.put("gatewayAddress", Collections.singletonList(String.valueOf(gatewayAddress))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("gatewayAddress")) { + return String.valueOf(gatewayAddress); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getGatewayAddress() { + return gatewayAddress; + } + + public String getId() { + return id; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Subnetwork prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Subnetwork getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Subnetwork DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Subnetwork(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String gatewayAddress; + private String id; + private String ipCidrRange; + private String kind; + private String name; + private String network; + private String region; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(Subnetwork other) { + if (other == Subnetwork.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getGatewayAddress() != null) { + this.gatewayAddress = other.gatewayAddress; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getIpCidrRange() != null) { + this.ipCidrRange = other.ipCidrRange; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(Subnetwork source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.gatewayAddress = source.gatewayAddress; + this.id = source.id; + this.ipCidrRange = source.ipCidrRange; + this.kind = source.kind; + this.name = source.name; + this.network = source.network; + this.region = source.region; + this.selfLink = source.selfLink; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getGatewayAddress() { + return gatewayAddress; + } + + public Builder setGatewayAddress(String gatewayAddress) { + this.gatewayAddress = gatewayAddress; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public Builder setIpCidrRange(String ipCidrRange) { + this.ipCidrRange = ipCidrRange; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public Subnetwork build() { + + + + + + + + + + return new Subnetwork( + creationTimestamp, + description, + gatewayAddress, + id, + ipCidrRange, + kind, + name, + network, + region, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setGatewayAddress(this.gatewayAddress); + newBuilder.setId(this.id); + newBuilder.setIpCidrRange(this.ipCidrRange); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "Subnetwork{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "gatewayAddress=" + gatewayAddress + ", " + + "id=" + id + ", " + + "ipCidrRange=" + ipCidrRange + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Subnetwork) { + Subnetwork that = (Subnetwork) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.gatewayAddress, that.getGatewayAddress()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.ipCidrRange, that.getIpCidrRange()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + gatewayAddress, + id, + ipCidrRange, + kind, + name, + network, + region, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java new file mode 100644 index 000000000000..3349e053d3f5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworkAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private SubnetworkAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private SubnetworkAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SubnetworkAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SubnetworkAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SubnetworkAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SubnetworkAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(SubnetworkAggregatedList other) { + if (other == SubnetworkAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(SubnetworkAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public SubnetworkAggregatedList build() { + + + + + return new SubnetworkAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "SubnetworkAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworkAggregatedList) { + SubnetworkAggregatedList that = (SubnetworkAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java new file mode 100644 index 000000000000..089b1e31c2fd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java @@ -0,0 +1,1041 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.SubnetworkStub; +import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+ *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+ *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the subnetworkClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of SubnetworkSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * SubnetworkSettings subnetworkSettings =
+ *     SubnetworkSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SubnetworkClient subnetworkClient =
+ *     SubnetworkClient.create(subnetworkSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SubnetworkSettings subnetworkSettings =
+ *     SubnetworkSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SubnetworkClient subnetworkClient =
+ *     SubnetworkClient.create(subnetworkSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SubnetworkClient implements BackgroundResource { + private final SubnetworkSettings settings; + private final SubnetworkStub stub; + + + + /** + * Constructs an instance of SubnetworkClient with default settings. + */ + public static final SubnetworkClient create() throws IOException { + return create(SubnetworkSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SubnetworkClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final SubnetworkClient create(SubnetworkSettings settings) throws IOException { + return new SubnetworkClient(settings); + } + + /** + * Constructs an instance of SubnetworkClient, using the given stub for making calls. This is for + * advanced usage - prefer to use SubnetworkSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SubnetworkClient create(SubnetworkStub stub) { + return new SubnetworkClient(stub); + } + + /** + * Constructs an instance of SubnetworkClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected SubnetworkClient(SubnetworkSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SubnetworkStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SubnetworkClient(SubnetworkStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SubnetworkSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SubnetworkStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of subnetworks. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (SubnetworksScopedList element : subnetworkClient.aggregatedListSubnetworks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(ProjectName project) { + AggregatedListSubnetworksHttpRequest request = + AggregatedListSubnetworksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListSubnetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of subnetworks. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (SubnetworksScopedList element : subnetworkClient.aggregatedListSubnetworks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(String project) { + AggregatedListSubnetworksHttpRequest request = + AggregatedListSubnetworksHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListSubnetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of subnetworks. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListSubnetworksHttpRequest request = AggregatedListSubnetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (SubnetworksScopedList element : subnetworkClient.aggregatedListSubnetworks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(AggregatedListSubnetworksHttpRequest request) { + return aggregatedListSubnetworksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of subnetworks. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListSubnetworksHttpRequest request = AggregatedListSubnetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListSubnetworksPagedResponse> future = subnetworkClient.aggregatedListSubnetworksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (SubnetworksScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListSubnetworksPagedCallable() { + return stub.aggregatedListSubnetworksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of subnetworks. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListSubnetworksHttpRequest request = AggregatedListSubnetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     SubnetworkAggregatedList response = subnetworkClient.aggregatedListSubnetworksCallable().call(request);
+   *     for (SubnetworksScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListSubnetworksCallable() { + return stub.aggregatedListSubnetworksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified subnetwork. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
+   * }
+   * 
+ * + * @param subnetwork Name of the Subnetwork resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSubnetwork(SubnetworkName subnetwork) { + + DeleteSubnetworkHttpRequest request = + DeleteSubnetworkHttpRequest.newBuilder() + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .build(); + return deleteSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified subnetwork. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork.toString());
+   * }
+   * 
+ * + * @param subnetwork Name of the Subnetwork resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSubnetwork(String subnetwork) { + + DeleteSubnetworkHttpRequest request = + DeleteSubnetworkHttpRequest.newBuilder() + .setSubnetwork(subnetwork) + .build(); + return deleteSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified subnetwork. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
+   *     .setSubnetwork(subnetwork.toString())
+   *     .build();
+   *   Operation response = subnetworkClient.deleteSubnetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSubnetwork(DeleteSubnetworkHttpRequest request) { + return deleteSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified subnetwork. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
+   *     .setSubnetwork(subnetwork.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = subnetworkClient.deleteSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteSubnetworkCallable() { + return stub.deleteSubnetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource);
+   * }
+   * 
+ * + * @param subnetwork Name of the Subnetwork resource to update. + * @param subnetworksExpandIpCidrRangeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation expandIpCidrRangeSubnetwork(SubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + + ExpandIpCidrRangeSubnetworkHttpRequest request = + ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource) + .build(); + return expandIpCidrRangeSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(subnetwork.toString(), subnetworksExpandIpCidrRangeRequestResource);
+   * }
+   * 
+ * + * @param subnetwork Name of the Subnetwork resource to update. + * @param subnetworksExpandIpCidrRangeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation expandIpCidrRangeSubnetwork(String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + + ExpandIpCidrRangeSubnetworkHttpRequest request = + ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() + .setSubnetwork(subnetwork) + .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource) + .build(); + return expandIpCidrRangeSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
+   *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
+   *     .setSubnetwork(subnetwork.toString())
+   *     .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
+   *     .build();
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHttpRequest request) { + return expandIpCidrRangeSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
+   *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
+   *     .setSubnetwork(subnetwork.toString())
+   *     .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = subnetworkClient.expandIpCidrRangeSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable expandIpCidrRangeSubnetworkCallable() { + return stub.expandIpCidrRangeSubnetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Subnetwork response = subnetworkClient.getSubnetwork(subnetwork);
+   * }
+   * 
+ * + * @param subnetwork Name of the Subnetwork resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Subnetwork getSubnetwork(SubnetworkName subnetwork) { + + GetSubnetworkHttpRequest request = + GetSubnetworkHttpRequest.newBuilder() + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .build(); + return getSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Subnetwork response = subnetworkClient.getSubnetwork(subnetwork.toString());
+   * }
+   * 
+ * + * @param subnetwork Name of the Subnetwork resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Subnetwork getSubnetwork(String subnetwork) { + + GetSubnetworkHttpRequest request = + GetSubnetworkHttpRequest.newBuilder() + .setSubnetwork(subnetwork) + .build(); + return getSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   GetSubnetworkHttpRequest request = GetSubnetworkHttpRequest.newBuilder()
+   *     .setSubnetwork(subnetwork.toString())
+   *     .build();
+   *   Subnetwork response = subnetworkClient.getSubnetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Subnetwork getSubnetwork(GetSubnetworkHttpRequest request) { + return getSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   GetSubnetworkHttpRequest request = GetSubnetworkHttpRequest.newBuilder()
+   *     .setSubnetwork(subnetwork.toString())
+   *     .build();
+   *   ApiFuture<Subnetwork> future = subnetworkClient.getSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Subnetwork response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getSubnetworkCallable() { + return stub.getSubnetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   Operation response = subnetworkClient.insertSubnetwork(region, subnetworkResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param subnetworkResource A Subnetwork resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSubnetwork(RegionName region, Subnetwork subnetworkResource) { + + InsertSubnetworkHttpRequest request = + InsertSubnetworkHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setSubnetworkResource(subnetworkResource) + .build(); + return insertSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   Operation response = subnetworkClient.insertSubnetwork(region.toString(), subnetworkResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param subnetworkResource A Subnetwork resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSubnetwork(String region, Subnetwork subnetworkResource) { + + InsertSubnetworkHttpRequest request = + InsertSubnetworkHttpRequest.newBuilder() + .setRegion(region) + .setSubnetworkResource(subnetworkResource) + .build(); + return insertSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setSubnetworkResource(subnetworkResource)
+   *     .build();
+   *   Operation response = subnetworkClient.insertSubnetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSubnetwork(InsertSubnetworkHttpRequest request) { + return insertSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setSubnetworkResource(subnetworkResource)
+   *     .build();
+   *   ApiFuture<Operation> future = subnetworkClient.insertSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertSubnetworkCallable() { + return stub.insertSubnetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of subnetworks available to the specified project. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Subnetwork element : subnetworkClient.listSubnetworks(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) { + ListSubnetworksHttpRequest request = + ListSubnetworksHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listSubnetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of subnetworks available to the specified project. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Subnetwork element : subnetworkClient.listSubnetworks(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSubnetworksPagedResponse listSubnetworks(String region) { + ListSubnetworksHttpRequest request = + ListSubnetworksHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listSubnetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of subnetworks available to the specified project. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListSubnetworksHttpRequest request = ListSubnetworksHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Subnetwork element : subnetworkClient.listSubnetworks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpRequest request) { + return listSubnetworksPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of subnetworks available to the specified project. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListSubnetworksHttpRequest request = ListSubnetworksHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListSubnetworksPagedResponse> future = subnetworkClient.listSubnetworksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Subnetwork element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listSubnetworksPagedCallable() { + return stub.listSubnetworksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of subnetworks available to the specified project. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListSubnetworksHttpRequest request = ListSubnetworksHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     SubnetworkList response = subnetworkClient.listSubnetworksCallable().call(request);
+   *     for (Subnetwork element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listSubnetworksCallable() { + return stub.listSubnetworksCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListSubnetworksPagedResponse extends AbstractPagedListResponse< + AggregatedListSubnetworksHttpRequest, + SubnetworkAggregatedList, + SubnetworksScopedList, + AggregatedListSubnetworksPage, + AggregatedListSubnetworksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListSubnetworksPagedResponse apply(AggregatedListSubnetworksPage input) { + return new AggregatedListSubnetworksPagedResponse(input); + } + }); + } + + private AggregatedListSubnetworksPagedResponse(AggregatedListSubnetworksPage page) { + super(page, AggregatedListSubnetworksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListSubnetworksPage extends AbstractPage< + AggregatedListSubnetworksHttpRequest, + SubnetworkAggregatedList, + SubnetworksScopedList, + AggregatedListSubnetworksPage> { + + private AggregatedListSubnetworksPage( + PageContext context, + SubnetworkAggregatedList response) { + super(context, response); + } + + private static AggregatedListSubnetworksPage createEmptyPage() { + return new AggregatedListSubnetworksPage(null, null); + } + + @Override + protected AggregatedListSubnetworksPage createPage( + PageContext context, + SubnetworkAggregatedList response) { + return new AggregatedListSubnetworksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListSubnetworksHttpRequest, + SubnetworkAggregatedList, + SubnetworksScopedList, + AggregatedListSubnetworksPage, + AggregatedListSubnetworksFixedSizeCollection> { + + private AggregatedListSubnetworksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListSubnetworksFixedSizeCollection createEmptyCollection() { + return new AggregatedListSubnetworksFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListSubnetworksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListSubnetworksFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListSubnetworksPagedResponse extends AbstractPagedListResponse< + ListSubnetworksHttpRequest, + SubnetworkList, + Subnetwork, + ListSubnetworksPage, + ListSubnetworksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSubnetworksPagedResponse apply(ListSubnetworksPage input) { + return new ListSubnetworksPagedResponse(input); + } + }); + } + + private ListSubnetworksPagedResponse(ListSubnetworksPage page) { + super(page, ListSubnetworksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListSubnetworksPage extends AbstractPage< + ListSubnetworksHttpRequest, + SubnetworkList, + Subnetwork, + ListSubnetworksPage> { + + private ListSubnetworksPage( + PageContext context, + SubnetworkList response) { + super(context, response); + } + + private static ListSubnetworksPage createEmptyPage() { + return new ListSubnetworksPage(null, null); + } + + @Override + protected ListSubnetworksPage createPage( + PageContext context, + SubnetworkList response) { + return new ListSubnetworksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection< + ListSubnetworksHttpRequest, + SubnetworkList, + Subnetwork, + ListSubnetworksPage, + ListSubnetworksFixedSizeCollection> { + + private ListSubnetworksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSubnetworksFixedSizeCollection createEmptyCollection() { + return new ListSubnetworksFixedSizeCollection(null, 0); + } + + @Override + protected ListSubnetworksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSubnetworksFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java new file mode 100644 index 000000000000..6fbb3eb8406c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworkList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private SubnetworkList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private SubnetworkList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Subnetwork item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SubnetworkList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SubnetworkList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SubnetworkList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SubnetworkList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(SubnetworkList other) { + if (other == SubnetworkList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(SubnetworkList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Subnetwork items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public SubnetworkList build() { + + + + + return new SubnetworkList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "SubnetworkList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworkList) { + SubnetworkList that = (SubnetworkList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java new file mode 100644 index 000000000000..0cadfd41d9f3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworkName implements ResourceName { + private final String project; + private final String region; + private final String subnetwork; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/subnetworks/{subnetwork}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private SubnetworkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + subnetwork = Preconditions.checkNotNull(builder.getSubnetwork()); + } + + public static SubnetworkName of( + String project, + String region, + String subnetwork + ) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setSubnetwork(subnetwork) + .build(); + } + + public static String format( + String project, + String region, + String subnetwork + ) { + return of( + project, + region, + subnetwork + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getSubnetwork() { + return subnetwork; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("subnetwork", subnetwork); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public SubnetworkName parse(String formattedString) {return SubnetworkName.parse(formattedString);} + }; + } + + public static SubnetworkName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "SubnetworkName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("region"), + matchMap.get("subnetwork") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String subnetwork; + + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + public String getSubnetwork() { + return subnetwork; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + private Builder() {} + + public Builder (SubnetworkName subnetworkName) { + project = subnetworkName.project; + region = subnetworkName.region; + subnetwork = subnetworkName.subnetwork; + } + + public SubnetworkName build() { + return new SubnetworkName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "subnetwork", subnetwork + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworkName) { + SubnetworkName that = (SubnetworkName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + region, + subnetwork + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java new file mode 100644 index 000000000000..ad08ace8b7a3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java @@ -0,0 +1,297 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SubnetworkClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSubnetwork to 30 seconds: + * + *

+ * 
+ * SubnetworkSettings.Builder subnetworkSettingsBuilder =
+ *     SubnetworkSettings.newBuilder();
+ * subnetworkSettingsBuilder.deleteSubnetworkSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SubnetworkSettings subnetworkSettings = subnetworkSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SubnetworkSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListSubnetworks. + */ + public PagedCallSettings aggregatedListSubnetworksSettings() { + return ((SubnetworkStubSettings) getStubSettings()).aggregatedListSubnetworksSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteSubnetwork. + */ + public UnaryCallSettings deleteSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).deleteSubnetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to expandIpCidrRangeSubnetwork. + */ + public UnaryCallSettings expandIpCidrRangeSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).expandIpCidrRangeSubnetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to getSubnetwork. + */ + public UnaryCallSettings getSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).getSubnetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to insertSubnetwork. + */ + public UnaryCallSettings insertSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).insertSubnetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to listSubnetworks. + */ + public PagedCallSettings listSubnetworksSettings() { + return ((SubnetworkStubSettings) getStubSettings()).listSubnetworksSettings(); + } + + + public static final SubnetworkSettings create(SubnetworkStubSettings stub) throws IOException { + return new SubnetworkSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SubnetworkStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return SubnetworkStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return SubnetworkStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return SubnetworkStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SubnetworkStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return SubnetworkStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SubnetworkStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SubnetworkStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SubnetworkSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for SubnetworkSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SubnetworkStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SubnetworkStubSettings.newBuilder()); + } + + protected Builder(SubnetworkSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SubnetworkStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public SubnetworkStubSettings.Builder getStubSettingsBuilder() { + return ((SubnetworkStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListSubnetworks. + */ + public PagedCallSettings.Builder aggregatedListSubnetworksSettings() { + return getStubSettingsBuilder().aggregatedListSubnetworksSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteSubnetwork. + */ + public UnaryCallSettings.Builder deleteSubnetworkSettings() { + return getStubSettingsBuilder().deleteSubnetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to expandIpCidrRangeSubnetwork. + */ + public UnaryCallSettings.Builder expandIpCidrRangeSubnetworkSettings() { + return getStubSettingsBuilder().expandIpCidrRangeSubnetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to getSubnetwork. + */ + public UnaryCallSettings.Builder getSubnetworkSettings() { + return getStubSettingsBuilder().getSubnetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertSubnetwork. + */ + public UnaryCallSettings.Builder insertSubnetworkSettings() { + return getStubSettingsBuilder().insertSubnetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to listSubnetworks. + */ + public PagedCallSettings.Builder listSubnetworksSettings() { + return getStubSettingsBuilder().listSubnetworksSettings(); + } + + @Override + public SubnetworkSettings build() throws IOException { + return new SubnetworkSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java new file mode 100644 index 000000000000..abb53d5f7a38 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworksExpandIpCidrRangeRequest implements ApiMessage { + private final String ipCidrRange; + + private SubnetworksExpandIpCidrRangeRequest() { + this.ipCidrRange = null; + } + + + private SubnetworksExpandIpCidrRangeRequest( + String ipCidrRange + ) { + this.ipCidrRange = ipCidrRange; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SubnetworksExpandIpCidrRangeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SubnetworksExpandIpCidrRangeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SubnetworksExpandIpCidrRangeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SubnetworksExpandIpCidrRangeRequest(); + } + + public static class Builder { + private String ipCidrRange; + + Builder() {} + + public Builder mergeFrom(SubnetworksExpandIpCidrRangeRequest other) { + if (other == SubnetworksExpandIpCidrRangeRequest.getDefaultInstance()) return this; + if (other.getIpCidrRange() != null) { + this.ipCidrRange = other.ipCidrRange; + } + return this; + } + + Builder(SubnetworksExpandIpCidrRangeRequest source) { + this.ipCidrRange = source.ipCidrRange; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public Builder setIpCidrRange(String ipCidrRange) { + this.ipCidrRange = ipCidrRange; + return this; + } + + + public SubnetworksExpandIpCidrRangeRequest build() { + return new SubnetworksExpandIpCidrRangeRequest( + ipCidrRange + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIpCidrRange(this.ipCidrRange); + return newBuilder; + } + } + + @Override + public String toString() { + return "SubnetworksExpandIpCidrRangeRequest{" + + "ipCidrRange=" + ipCidrRange + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworksExpandIpCidrRangeRequest) { + SubnetworksExpandIpCidrRangeRequest that = (SubnetworksExpandIpCidrRangeRequest) o; + return + Objects.equals(this.ipCidrRange, that.getIpCidrRange()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + ipCidrRange + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java new file mode 100644 index 000000000000..0ceb0a2bc2ef --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworksScopedList implements ApiMessage { + private final List subnetworks; + private final Warning warning; + + private SubnetworksScopedList() { + this.subnetworks = null; + this.warning = null; + } + + + private SubnetworksScopedList( + List subnetworks, + Warning warning + ) { + this.subnetworks = subnetworks; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("subnetworks") && subnetworks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Subnetwork item : subnetworks) { + stringList.add(item.toString()); + } + fieldMap.put("subnetworks", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("subnetworks")) { + return String.valueOf(subnetworks); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getSubnetworksList() { + return subnetworks; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SubnetworksScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SubnetworksScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SubnetworksScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SubnetworksScopedList(); + } + + public static class Builder { + private List subnetworks; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(SubnetworksScopedList other) { + if (other == SubnetworksScopedList.getDefaultInstance()) return this; + if (other.getSubnetworksList() != null) { + this.subnetworks = other.subnetworks; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(SubnetworksScopedList source) { + this.subnetworks = source.subnetworks; + this.warning = source.warning; + } + + public List getSubnetworksList() { + return subnetworks; + } + + public Builder addAllSubnetworks(List subnetworks) { + if (this.subnetworks == null) { + this.subnetworks = new ArrayList<>(subnetworks.size()); + } + this.subnetworks.addAll(subnetworks); + return this; + } + + public Builder addSubnetworks(Subnetwork subnetworks) { + this.subnetworks.add(subnetworks); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public SubnetworksScopedList build() { + + return new SubnetworksScopedList( + subnetworks, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllSubnetworks(this.subnetworks); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "SubnetworksScopedList{" + + "subnetworks=" + subnetworks + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworksScopedList) { + SubnetworksScopedList that = (SubnetworksScopedList) o; + return + Objects.equals(this.subnetworks, that.getSubnetworksList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + subnetworks, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java new file mode 100644 index 000000000000..dcf69816e59b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java @@ -0,0 +1,407 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SwitchToCustomModeNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String network; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private SwitchToCustomModeNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.network = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private SwitchToCustomModeNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String network, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.network = network; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNetwork() { + return network; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SwitchToCustomModeNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SwitchToCustomModeNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SwitchToCustomModeNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SwitchToCustomModeNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String network; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SwitchToCustomModeNetworkHttpRequest other) { + if (other == SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SwitchToCustomModeNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.network = source.network; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public SwitchToCustomModeNetworkHttpRequest build() { + String missing = ""; + + + + + if (network == null) { + missing += " network"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SwitchToCustomModeNetworkHttpRequest( + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetwork(this.network); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SwitchToCustomModeNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SwitchToCustomModeNetworkHttpRequest) { + SwitchToCustomModeNetworkHttpRequest that = (SwitchToCustomModeNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java new file mode 100644 index 000000000000..6774605f867c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TCPHealthCheck implements ApiMessage { + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String request; + private final String response; + + private TCPHealthCheck() { + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.request = null; + this.response = null; + } + + + private TCPHealthCheck( + Integer port, + String portName, + String proxyHeader, + String request, + String response + ) { + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.request = request; + this.response = response; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("request") && request != null) { + fieldMap.put("request", Collections.singletonList(String.valueOf(request))); + } + if (fieldNames.contains("response") && response != null) { + fieldMap.put("response", Collections.singletonList(String.valueOf(response))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("request")) { + return String.valueOf(request); + } + if (fieldName.equals("response")) { + return String.valueOf(response); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequest() { + return request; + } + + public String getResponse() { + return response; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TCPHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TCPHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TCPHealthCheck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TCPHealthCheck(); + } + + public static class Builder { + private Integer port; + private String portName; + private String proxyHeader; + private String request; + private String response; + + Builder() {} + + public Builder mergeFrom(TCPHealthCheck other) { + if (other == TCPHealthCheck.getDefaultInstance()) return this; + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequest() != null) { + this.request = other.request; + } + if (other.getResponse() != null) { + this.response = other.response; + } + return this; + } + + Builder(TCPHealthCheck source) { + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.request = source.request; + this.response = source.response; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequest() { + return request; + } + + public Builder setRequest(String request) { + this.request = request; + return this; + } + + public String getResponse() { + return response; + } + + public Builder setResponse(String response) { + this.response = response; + return this; + } + + + public TCPHealthCheck build() { + + + + + return new TCPHealthCheck( + port, + portName, + proxyHeader, + request, + response + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequest(this.request); + newBuilder.setResponse(this.response); + return newBuilder; + } + } + + @Override + public String toString() { + return "TCPHealthCheck{" + + "port=" + port + ", " + + "portName=" + portName + ", " + + "proxyHeader=" + proxyHeader + ", " + + "request=" + request + ", " + + "response=" + response + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TCPHealthCheck) { + TCPHealthCheck that = (TCPHealthCheck) o; + return + Objects.equals(this.port, that.getPort()) && + Objects.equals(this.portName, that.getPortName()) && + Objects.equals(this.proxyHeader, that.getProxyHeader()) && + Objects.equals(this.request, that.getRequest()) && + Objects.equals(this.response, that.getResponse()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + port, + portName, + proxyHeader, + request, + response + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java new file mode 100644 index 000000000000..d8ffa316b625 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Tags implements ApiMessage { + private final String fingerprint; + private final List items; + + private Tags() { + this.fingerprint = null; + this.items = null; + } + + + private Tags( + String fingerprint, + List items + ) { + this.fingerprint = fingerprint; + this.items = items; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getItemsList() { + return items; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Tags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Tags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Tags DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Tags(); + } + + public static class Builder { + private String fingerprint; + private List items; + + Builder() {} + + public Builder mergeFrom(Tags other) { + if (other == Tags.getDefaultInstance()) return this; + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + return this; + } + + Builder(Tags source) { + this.fingerprint = source.fingerprint; + this.items = source.items; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(String items) { + this.items.add(items); + return this; + } + + + public Tags build() { + + return new Tags( + fingerprint, + items + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllItems(this.items); + return newBuilder; + } + } + + @Override + public String toString() { + return "Tags{" + + "fingerprint=" + fingerprint + ", " + + "items=" + items + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Tags) { + Tags that = (Tags) o; + return + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.items, that.getItemsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + fingerprint, + items + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java new file mode 100644 index 000000000000..1e97e3a11d1e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java @@ -0,0 +1,366 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpProxy implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String selfLink; + private final String urlMap; + + private TargetHttpProxy() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.selfLink = null; + this.urlMap = null; + } + + + private TargetHttpProxy( + String creationTimestamp, + String description, + String id, + String kind, + String name, + String selfLink, + String urlMap + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + this.urlMap = urlMap; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public String getUrlMap() { + return urlMap; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetHttpProxy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetHttpProxy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetHttpProxy DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetHttpProxy(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String selfLink; + private String urlMap; + + Builder() {} + + public Builder mergeFrom(TargetHttpProxy other) { + if (other == TargetHttpProxy.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + return this; + } + + Builder(TargetHttpProxy source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + this.urlMap = source.urlMap; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + + public TargetHttpProxy build() { + + + + + + + return new TargetHttpProxy( + creationTimestamp, + description, + id, + kind, + name, + selfLink, + urlMap + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setUrlMap(this.urlMap); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetHttpProxy{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "urlMap=" + urlMap + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpProxy) { + TargetHttpProxy that = (TargetHttpProxy) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.urlMap, that.getUrlMap()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + kind, + name, + selfLink, + urlMap + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java new file mode 100644 index 000000000000..fe267ad9e87a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java @@ -0,0 +1,821 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.TargetHttpProxyStub; +import com.google.cloud.compute.v1.stub.TargetHttpProxyStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+ *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+ *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetHttpProxyClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetHttpProxySettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetHttpProxySettings targetHttpProxySettings =
+ *     TargetHttpProxySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetHttpProxyClient targetHttpProxyClient =
+ *     TargetHttpProxyClient.create(targetHttpProxySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetHttpProxySettings targetHttpProxySettings =
+ *     TargetHttpProxySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetHttpProxyClient targetHttpProxyClient =
+ *     TargetHttpProxyClient.create(targetHttpProxySettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetHttpProxyClient implements BackgroundResource { + private final TargetHttpProxySettings settings; + private final TargetHttpProxyStub stub; + + + + /** + * Constructs an instance of TargetHttpProxyClient with default settings. + */ + public static final TargetHttpProxyClient create() throws IOException { + return create(TargetHttpProxySettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetHttpProxyClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetHttpProxyClient create(TargetHttpProxySettings settings) throws IOException { + return new TargetHttpProxyClient(settings); + } + + /** + * Constructs an instance of TargetHttpProxyClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetHttpProxySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetHttpProxyClient create(TargetHttpProxyStub stub) { + return new TargetHttpProxyClient(stub); + } + + /** + * Constructs an instance of TargetHttpProxyClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetHttpProxyClient(TargetHttpProxySettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetHttpProxyStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetHttpProxyClient(TargetHttpProxyStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetHttpProxySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetHttpProxyStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpProxy resource. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
+   * }
+   * 
+ * + * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetHttpProxy(TargetHttpProxyName targetHttpProxy) { + + DeleteTargetHttpProxyHttpRequest request = + DeleteTargetHttpProxyHttpRequest.newBuilder() + .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) + .build(); + return deleteTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpProxy resource. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy.toString());
+   * }
+   * 
+ * + * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetHttpProxy(String targetHttpProxy) { + + DeleteTargetHttpProxyHttpRequest request = + DeleteTargetHttpProxyHttpRequest.newBuilder() + .setTargetHttpProxy(targetHttpProxy) + .build(); + return deleteTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpProxy resource. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
+   *     .setTargetHttpProxy(targetHttpProxy.toString())
+   *     .build();
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest request) { + return deleteTargetHttpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpProxy resource. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
+   *     .setTargetHttpProxy(targetHttpProxy.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpProxyClient.deleteTargetHttpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetHttpProxyCallable() { + return stub.deleteTargetHttpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(targetHttpProxy);
+   * }
+   * 
+ * + * @param targetHttpProxy Name of the TargetHttpProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetHttpProxy getTargetHttpProxy(TargetHttpProxyName targetHttpProxy) { + + GetTargetHttpProxyHttpRequest request = + GetTargetHttpProxyHttpRequest.newBuilder() + .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) + .build(); + return getTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(targetHttpProxy.toString());
+   * }
+   * 
+ * + * @param targetHttpProxy Name of the TargetHttpProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetHttpProxy getTargetHttpProxy(String targetHttpProxy) { + + GetTargetHttpProxyHttpRequest request = + GetTargetHttpProxyHttpRequest.newBuilder() + .setTargetHttpProxy(targetHttpProxy) + .build(); + return getTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder()
+   *     .setTargetHttpProxy(targetHttpProxy.toString())
+   *     .build();
+   *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest request) { + return getTargetHttpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder()
+   *     .setTargetHttpProxy(targetHttpProxy.toString())
+   *     .build();
+   *   ApiFuture<TargetHttpProxy> future = targetHttpProxyClient.getTargetHttpProxyCallable().futureCall(request);
+   *   // Do something
+   *   TargetHttpProxy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetHttpProxyCallable() { + return stub.getTargetHttpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(project, targetHttpProxyResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetHttpProxy(ProjectName project, TargetHttpProxy targetHttpProxyResource) { + + InsertTargetHttpProxyHttpRequest request = + InsertTargetHttpProxyHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setTargetHttpProxyResource(targetHttpProxyResource) + .build(); + return insertTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(project.toString(), targetHttpProxyResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetHttpProxy(String project, TargetHttpProxy targetHttpProxyResource) { + + InsertTargetHttpProxyHttpRequest request = + InsertTargetHttpProxyHttpRequest.newBuilder() + .setProject(project) + .setTargetHttpProxyResource(targetHttpProxyResource) + .build(); + return insertTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
+   *   InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setTargetHttpProxyResource(targetHttpProxyResource)
+   *     .build();
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetHttpProxy(InsertTargetHttpProxyHttpRequest request) { + return insertTargetHttpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
+   *   InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setTargetHttpProxyResource(targetHttpProxyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpProxyClient.insertTargetHttpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetHttpProxyCallable() { + return stub.insertTargetHttpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetHttpProxy element : targetHttpProxyClient.listTargetHttpProxies(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ProjectName project) { + ListTargetHttpProxiesHttpRequest request = + ListTargetHttpProxiesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listTargetHttpProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetHttpProxy element : targetHttpProxyClient.listTargetHttpProxies(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(String project) { + ListTargetHttpProxiesHttpRequest request = + ListTargetHttpProxiesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listTargetHttpProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetHttpProxiesHttpRequest request = ListTargetHttpProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetHttpProxy element : targetHttpProxyClient.listTargetHttpProxies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ListTargetHttpProxiesHttpRequest request) { + return listTargetHttpProxiesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetHttpProxiesHttpRequest request = ListTargetHttpProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListTargetHttpProxiesPagedResponse> future = targetHttpProxyClient.listTargetHttpProxiesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetHttpProxy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetHttpProxiesPagedCallable() { + return stub.listTargetHttpProxiesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetHttpProxiesHttpRequest request = ListTargetHttpProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetHttpProxyList response = targetHttpProxyClient.listTargetHttpProxiesCallable().call(request);
+   *     for (TargetHttpProxy element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetHttpProxiesCallable() { + return stub.listTargetHttpProxiesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpProxy. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource);
+   * }
+   * 
+ * + * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param urlMapReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUrlMapTargetHttpProxy(TargetHttpProxyName targetHttpProxy, UrlMapReference urlMapReferenceResource) { + + SetUrlMapTargetHttpProxyHttpRequest request = + SetUrlMapTargetHttpProxyHttpRequest.newBuilder() + .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); + return setUrlMapTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpProxy. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(targetHttpProxy.toString(), urlMapReferenceResource);
+   * }
+   * 
+ * + * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param urlMapReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUrlMapTargetHttpProxy(String targetHttpProxy, UrlMapReference urlMapReferenceResource) { + + SetUrlMapTargetHttpProxyHttpRequest request = + SetUrlMapTargetHttpProxyHttpRequest.newBuilder() + .setTargetHttpProxy(targetHttpProxy) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); + return setUrlMapTargetHttpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpProxy. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
+   *     .setTargetHttpProxy(targetHttpProxy.toString())
+   *     .setUrlMapReferenceResource(urlMapReferenceResource)
+   *     .build();
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUrlMapTargetHttpProxy(SetUrlMapTargetHttpProxyHttpRequest request) { + return setUrlMapTargetHttpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpProxy. + * + * Sample code: + *

+   * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
+   *     .setTargetHttpProxy(targetHttpProxy.toString())
+   *     .setUrlMapReferenceResource(urlMapReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpProxyClient.setUrlMapTargetHttpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setUrlMapTargetHttpProxyCallable() { + return stub.setUrlMapTargetHttpProxyCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTargetHttpProxiesPagedResponse extends AbstractPagedListResponse< + ListTargetHttpProxiesHttpRequest, + TargetHttpProxyList, + TargetHttpProxy, + ListTargetHttpProxiesPage, + ListTargetHttpProxiesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetHttpProxiesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetHttpProxiesPagedResponse apply(ListTargetHttpProxiesPage input) { + return new ListTargetHttpProxiesPagedResponse(input); + } + }); + } + + private ListTargetHttpProxiesPagedResponse(ListTargetHttpProxiesPage page) { + super(page, ListTargetHttpProxiesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetHttpProxiesPage extends AbstractPage< + ListTargetHttpProxiesHttpRequest, + TargetHttpProxyList, + TargetHttpProxy, + ListTargetHttpProxiesPage> { + + private ListTargetHttpProxiesPage( + PageContext context, + TargetHttpProxyList response) { + super(context, response); + } + + private static ListTargetHttpProxiesPage createEmptyPage() { + return new ListTargetHttpProxiesPage(null, null); + } + + @Override + protected ListTargetHttpProxiesPage createPage( + PageContext context, + TargetHttpProxyList response) { + return new ListTargetHttpProxiesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetHttpProxiesFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetHttpProxiesHttpRequest, + TargetHttpProxyList, + TargetHttpProxy, + ListTargetHttpProxiesPage, + ListTargetHttpProxiesFixedSizeCollection> { + + private ListTargetHttpProxiesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetHttpProxiesFixedSizeCollection createEmptyCollection() { + return new ListTargetHttpProxiesFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetHttpProxiesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetHttpProxiesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java new file mode 100644 index 000000000000..e451012d2eeb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpProxyList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetHttpProxyList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetHttpProxyList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetHttpProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetHttpProxyList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetHttpProxyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetHttpProxyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetHttpProxyList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetHttpProxyList other) { + if (other == TargetHttpProxyList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetHttpProxyList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetHttpProxy items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetHttpProxyList build() { + + + + + return new TargetHttpProxyList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetHttpProxyList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpProxyList) { + TargetHttpProxyList that = (TargetHttpProxyList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java new file mode 100644 index 000000000000..9c26c614a253 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpProxyName implements ResourceName { + private final String project; + private final String targetHttpProxy; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpProxies/{targetHttpProxy}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetHttpProxyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + targetHttpProxy = Preconditions.checkNotNull(builder.getTargetHttpProxy()); + } + + public static TargetHttpProxyName of( + String project, + String targetHttpProxy + ) { + return newBuilder() + .setProject(project) + .setTargetHttpProxy(targetHttpProxy) + .build(); + } + + public static String format( + String project, + String targetHttpProxy + ) { + return of( + project, + targetHttpProxy + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("targetHttpProxy", targetHttpProxy); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetHttpProxyName parse(String formattedString) {return TargetHttpProxyName.parse(formattedString);} + }; + } + + public static TargetHttpProxyName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetHttpProxyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("targetHttpProxy") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String targetHttpProxy; + + public String getProject() { + return project; + } + public String getTargetHttpProxy() { + return targetHttpProxy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setTargetHttpProxy(String targetHttpProxy) { + this.targetHttpProxy = targetHttpProxy; + return this; + } + + private Builder() {} + + public Builder (TargetHttpProxyName targetHttpProxyName) { + project = targetHttpProxyName.project; + targetHttpProxy = targetHttpProxyName.targetHttpProxy; + } + + public TargetHttpProxyName build() { + return new TargetHttpProxyName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "targetHttpProxy", targetHttpProxy + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpProxyName) { + TargetHttpProxyName that = (TargetHttpProxyName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + targetHttpProxy + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java new file mode 100644 index 000000000000..60166ba94348 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java @@ -0,0 +1,282 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import com.google.cloud.compute.v1.stub.TargetHttpProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetHttpProxyClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetHttpProxy to 30 seconds: + * + *

+ * 
+ * TargetHttpProxySettings.Builder targetHttpProxySettingsBuilder =
+ *     TargetHttpProxySettings.newBuilder();
+ * targetHttpProxySettingsBuilder.deleteTargetHttpProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetHttpProxySettings targetHttpProxySettings = targetHttpProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetHttpProxySettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteTargetHttpProxy. + */ + public UnaryCallSettings deleteTargetHttpProxySettings() { + return ((TargetHttpProxyStubSettings) getStubSettings()).deleteTargetHttpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetHttpProxy. + */ + public UnaryCallSettings getTargetHttpProxySettings() { + return ((TargetHttpProxyStubSettings) getStubSettings()).getTargetHttpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetHttpProxy. + */ + public UnaryCallSettings insertTargetHttpProxySettings() { + return ((TargetHttpProxyStubSettings) getStubSettings()).insertTargetHttpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetHttpProxies. + */ + public PagedCallSettings listTargetHttpProxiesSettings() { + return ((TargetHttpProxyStubSettings) getStubSettings()).listTargetHttpProxiesSettings(); + } + + /** + * Returns the object with the settings used for calls to setUrlMapTargetHttpProxy. + */ + public UnaryCallSettings setUrlMapTargetHttpProxySettings() { + return ((TargetHttpProxyStubSettings) getStubSettings()).setUrlMapTargetHttpProxySettings(); + } + + + public static final TargetHttpProxySettings create(TargetHttpProxyStubSettings stub) throws IOException { + return new TargetHttpProxySettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetHttpProxyStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetHttpProxyStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetHttpProxyStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetHttpProxyStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetHttpProxyStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetHttpProxyStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetHttpProxyStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetHttpProxyStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetHttpProxySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetHttpProxySettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetHttpProxyStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetHttpProxyStubSettings.newBuilder()); + } + + protected Builder(TargetHttpProxySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetHttpProxyStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetHttpProxyStubSettings.Builder getStubSettingsBuilder() { + return ((TargetHttpProxyStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetHttpProxy. + */ + public UnaryCallSettings.Builder deleteTargetHttpProxySettings() { + return getStubSettingsBuilder().deleteTargetHttpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetHttpProxy. + */ + public UnaryCallSettings.Builder getTargetHttpProxySettings() { + return getStubSettingsBuilder().getTargetHttpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetHttpProxy. + */ + public UnaryCallSettings.Builder insertTargetHttpProxySettings() { + return getStubSettingsBuilder().insertTargetHttpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetHttpProxies. + */ + public PagedCallSettings.Builder listTargetHttpProxiesSettings() { + return getStubSettingsBuilder().listTargetHttpProxiesSettings(); + } + + /** + * Returns the builder for the settings used for calls to setUrlMapTargetHttpProxy. + */ + public UnaryCallSettings.Builder setUrlMapTargetHttpProxySettings() { + return getStubSettingsBuilder().setUrlMapTargetHttpProxySettings(); + } + + @Override + public TargetHttpProxySettings build() throws IOException { + return new TargetHttpProxySettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java new file mode 100644 index 000000000000..0b05858e24c5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpsProxiesSetSslCertificatesRequest implements ApiMessage { + private final List sslCertificates; + + private TargetHttpsProxiesSetSslCertificatesRequest() { + this.sslCertificates = null; + } + + + private TargetHttpsProxiesSetSslCertificatesRequest( + List sslCertificates + ) { + this.sslCertificates = sslCertificates; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sslCertificates")) { + return String.valueOf(sslCertificates); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetHttpsProxiesSetSslCertificatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetHttpsProxiesSetSslCertificatesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetHttpsProxiesSetSslCertificatesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetHttpsProxiesSetSslCertificatesRequest(); + } + + public static class Builder { + private List sslCertificates; + + Builder() {} + + public Builder mergeFrom(TargetHttpsProxiesSetSslCertificatesRequest other) { + if (other == TargetHttpsProxiesSetSslCertificatesRequest.getDefaultInstance()) return this; + if (other.getSslCertificatesList() != null) { + this.sslCertificates = other.sslCertificates; + } + return this; + } + + Builder(TargetHttpsProxiesSetSslCertificatesRequest source) { + this.sslCertificates = source.sslCertificates; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + public Builder addAllSslCertificates(List sslCertificates) { + if (this.sslCertificates == null) { + this.sslCertificates = new ArrayList<>(sslCertificates.size()); + } + this.sslCertificates.addAll(sslCertificates); + return this; + } + + public Builder addSslCertificates(String sslCertificates) { + this.sslCertificates.add(sslCertificates); + return this; + } + + + public TargetHttpsProxiesSetSslCertificatesRequest build() { + return new TargetHttpsProxiesSetSslCertificatesRequest( + sslCertificates + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllSslCertificates(this.sslCertificates); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetHttpsProxiesSetSslCertificatesRequest{" + + "sslCertificates=" + sslCertificates + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpsProxiesSetSslCertificatesRequest) { + TargetHttpsProxiesSetSslCertificatesRequest that = (TargetHttpsProxiesSetSslCertificatesRequest) o; + return + Objects.equals(this.sslCertificates, that.getSslCertificatesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + sslCertificates + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java new file mode 100644 index 000000000000..8a3cbb58a1f5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java @@ -0,0 +1,412 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpsProxy implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String selfLink; + private final List sslCertificates; + private final String urlMap; + + private TargetHttpsProxy() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.selfLink = null; + this.sslCertificates = null; + this.urlMap = null; + } + + + private TargetHttpsProxy( + String creationTimestamp, + String description, + String id, + String kind, + String name, + String selfLink, + List sslCertificates, + String urlMap + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + this.sslCertificates = sslCertificates; + this.urlMap = urlMap; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sslCertificates")) { + return String.valueOf(sslCertificates); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + public String getUrlMap() { + return urlMap; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetHttpsProxy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetHttpsProxy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetHttpsProxy DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetHttpsProxy(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String selfLink; + private List sslCertificates; + private String urlMap; + + Builder() {} + + public Builder mergeFrom(TargetHttpsProxy other) { + if (other == TargetHttpsProxy.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSslCertificatesList() != null) { + this.sslCertificates = other.sslCertificates; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + return this; + } + + Builder(TargetHttpsProxy source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + this.sslCertificates = source.sslCertificates; + this.urlMap = source.urlMap; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + public Builder addAllSslCertificates(List sslCertificates) { + if (this.sslCertificates == null) { + this.sslCertificates = new ArrayList<>(sslCertificates.size()); + } + this.sslCertificates.addAll(sslCertificates); + return this; + } + + public Builder addSslCertificates(String sslCertificates) { + this.sslCertificates.add(sslCertificates); + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + + public TargetHttpsProxy build() { + + + + + + + + return new TargetHttpsProxy( + creationTimestamp, + description, + id, + kind, + name, + selfLink, + sslCertificates, + urlMap + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllSslCertificates(this.sslCertificates); + newBuilder.setUrlMap(this.urlMap); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetHttpsProxy{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "sslCertificates=" + sslCertificates + ", " + + "urlMap=" + urlMap + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpsProxy) { + TargetHttpsProxy that = (TargetHttpsProxy) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sslCertificates, that.getSslCertificatesList()) && + Objects.equals(this.urlMap, that.getUrlMap()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + kind, + name, + selfLink, + sslCertificates, + urlMap + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java new file mode 100644 index 000000000000..3a64d503aa8b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java @@ -0,0 +1,926 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.TargetHttpsProxyStub; +import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+ *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+ *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetHttpsProxyClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetHttpsProxySettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetHttpsProxySettings targetHttpsProxySettings =
+ *     TargetHttpsProxySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetHttpsProxyClient targetHttpsProxyClient =
+ *     TargetHttpsProxyClient.create(targetHttpsProxySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetHttpsProxySettings targetHttpsProxySettings =
+ *     TargetHttpsProxySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetHttpsProxyClient targetHttpsProxyClient =
+ *     TargetHttpsProxyClient.create(targetHttpsProxySettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetHttpsProxyClient implements BackgroundResource { + private final TargetHttpsProxySettings settings; + private final TargetHttpsProxyStub stub; + + + + /** + * Constructs an instance of TargetHttpsProxyClient with default settings. + */ + public static final TargetHttpsProxyClient create() throws IOException { + return create(TargetHttpsProxySettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetHttpsProxyClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetHttpsProxyClient create(TargetHttpsProxySettings settings) throws IOException { + return new TargetHttpsProxyClient(settings); + } + + /** + * Constructs an instance of TargetHttpsProxyClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetHttpsProxySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetHttpsProxyClient create(TargetHttpsProxyStub stub) { + return new TargetHttpsProxyClient(stub); + } + + /** + * Constructs an instance of TargetHttpsProxyClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetHttpsProxyClient(TargetHttpsProxySettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetHttpsProxyStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetHttpsProxyClient(TargetHttpsProxyStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetHttpsProxySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetHttpsProxyStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpsProxy resource. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy) { + + DeleteTargetHttpsProxyHttpRequest request = + DeleteTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .build(); + return deleteTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpsProxy resource. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString());
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetHttpsProxy(String targetHttpsProxy) { + + DeleteTargetHttpsProxyHttpRequest request = + DeleteTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy) + .build(); + return deleteTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpsProxy resource. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .build();
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest request) { + return deleteTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetHttpsProxy resource. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpsProxyClient.deleteTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetHttpsProxyCallable() { + return stub.deleteTargetHttpsProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(targetHttpsProxy);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetHttpsProxy getTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy) { + + GetTargetHttpsProxyHttpRequest request = + GetTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .build(); + return getTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(targetHttpsProxy.toString());
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetHttpsProxy getTargetHttpsProxy(String targetHttpsProxy) { + + GetTargetHttpsProxyHttpRequest request = + GetTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy) + .build(); + return getTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .build();
+   *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest request) { + return getTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .build();
+   *   ApiFuture<TargetHttpsProxy> future = targetHttpsProxyClient.getTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   TargetHttpsProxy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetHttpsProxyCallable() { + return stub.getTargetHttpsProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(project, targetHttpsProxyResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetHttpsProxy(ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { + + InsertTargetHttpsProxyHttpRequest request = + InsertTargetHttpsProxyHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setTargetHttpsProxyResource(targetHttpsProxyResource) + .build(); + return insertTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(project.toString(), targetHttpsProxyResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetHttpsProxy(String project, TargetHttpsProxy targetHttpsProxyResource) { + + InsertTargetHttpsProxyHttpRequest request = + InsertTargetHttpsProxyHttpRequest.newBuilder() + .setProject(project) + .setTargetHttpsProxyResource(targetHttpsProxyResource) + .build(); + return insertTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
+   *   InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setTargetHttpsProxyResource(targetHttpsProxyResource)
+   *     .build();
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetHttpsProxy(InsertTargetHttpsProxyHttpRequest request) { + return insertTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
+   *   InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setTargetHttpsProxyResource(targetHttpsProxyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpsProxyClient.insertTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetHttpsProxyCallable() { + return stub.insertTargetHttpsProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetHttpsProxy element : targetHttpsProxyClient.listTargetHttpsProxies(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ProjectName project) { + ListTargetHttpsProxiesHttpRequest request = + ListTargetHttpsProxiesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listTargetHttpsProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetHttpsProxy element : targetHttpsProxyClient.listTargetHttpsProxies(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(String project) { + ListTargetHttpsProxiesHttpRequest request = + ListTargetHttpsProxiesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listTargetHttpsProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetHttpsProxiesHttpRequest request = ListTargetHttpsProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetHttpsProxy element : targetHttpsProxyClient.listTargetHttpsProxies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ListTargetHttpsProxiesHttpRequest request) { + return listTargetHttpsProxiesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetHttpsProxiesHttpRequest request = ListTargetHttpsProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListTargetHttpsProxiesPagedResponse> future = targetHttpsProxyClient.listTargetHttpsProxiesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetHttpsProxy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetHttpsProxiesPagedCallable() { + return stub.listTargetHttpsProxiesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetHttpsProxiesHttpRequest request = ListTargetHttpsProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetHttpsProxyList response = targetHttpsProxyClient.listTargetHttpsProxiesCallable().call(request);
+   *     for (TargetHttpsProxy element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetHttpsProxiesCallable() { + return stub.listTargetHttpsProxiesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param targetHttpsProxiesSetSslCertificatesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslCertificatesTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + + SetSslCertificatesTargetHttpsProxyHttpRequest request = + SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource) + .build(); + return setSslCertificatesTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy.toString(), targetHttpsProxiesSetSslCertificatesRequestResource);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param targetHttpsProxiesSetSslCertificatesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + + SetSslCertificatesTargetHttpsProxyHttpRequest request = + SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy) + .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource) + .build(); + return setSslCertificatesTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource)
+   *     .build();
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslCertificatesTargetHttpsProxy(SetSslCertificatesTargetHttpsProxyHttpRequest request) { + return setSslCertificatesTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { + return stub.setSslCertificatesTargetHttpsProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param urlMapReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUrlMapTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, UrlMapReference urlMapReferenceResource) { + + SetUrlMapTargetHttpsProxyHttpRequest request = + SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); + return setUrlMapTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy.toString(), urlMapReferenceResource);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param urlMapReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, UrlMapReference urlMapReferenceResource) { + + SetUrlMapTargetHttpsProxyHttpRequest request = + SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); + return setUrlMapTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setUrlMapReferenceResource(urlMapReferenceResource)
+   *     .build();
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setUrlMapTargetHttpsProxy(SetUrlMapTargetHttpsProxyHttpRequest request) { + return setUrlMapTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the URL map for TargetHttpsProxy. + * + * Sample code: + *

+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
+   *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setUrlMapReferenceResource(urlMapReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpsProxyClient.setUrlMapTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setUrlMapTargetHttpsProxyCallable() { + return stub.setUrlMapTargetHttpsProxyCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTargetHttpsProxiesPagedResponse extends AbstractPagedListResponse< + ListTargetHttpsProxiesHttpRequest, + TargetHttpsProxyList, + TargetHttpsProxy, + ListTargetHttpsProxiesPage, + ListTargetHttpsProxiesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetHttpsProxiesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetHttpsProxiesPagedResponse apply(ListTargetHttpsProxiesPage input) { + return new ListTargetHttpsProxiesPagedResponse(input); + } + }); + } + + private ListTargetHttpsProxiesPagedResponse(ListTargetHttpsProxiesPage page) { + super(page, ListTargetHttpsProxiesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetHttpsProxiesPage extends AbstractPage< + ListTargetHttpsProxiesHttpRequest, + TargetHttpsProxyList, + TargetHttpsProxy, + ListTargetHttpsProxiesPage> { + + private ListTargetHttpsProxiesPage( + PageContext context, + TargetHttpsProxyList response) { + super(context, response); + } + + private static ListTargetHttpsProxiesPage createEmptyPage() { + return new ListTargetHttpsProxiesPage(null, null); + } + + @Override + protected ListTargetHttpsProxiesPage createPage( + PageContext context, + TargetHttpsProxyList response) { + return new ListTargetHttpsProxiesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetHttpsProxiesFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetHttpsProxiesHttpRequest, + TargetHttpsProxyList, + TargetHttpsProxy, + ListTargetHttpsProxiesPage, + ListTargetHttpsProxiesFixedSizeCollection> { + + private ListTargetHttpsProxiesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetHttpsProxiesFixedSizeCollection createEmptyCollection() { + return new ListTargetHttpsProxiesFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetHttpsProxiesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetHttpsProxiesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java new file mode 100644 index 000000000000..fbc28ec48175 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpsProxyList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetHttpsProxyList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetHttpsProxyList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetHttpsProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetHttpsProxyList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetHttpsProxyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetHttpsProxyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetHttpsProxyList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetHttpsProxyList other) { + if (other == TargetHttpsProxyList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetHttpsProxyList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetHttpsProxy items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetHttpsProxyList build() { + + + + + return new TargetHttpsProxyList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetHttpsProxyList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpsProxyList) { + TargetHttpsProxyList that = (TargetHttpsProxyList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java new file mode 100644 index 000000000000..87c97f1280eb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetHttpsProxyName implements ResourceName { + private final String project; + private final String targetHttpsProxy; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpsProxies/{targetHttpsProxy}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetHttpsProxyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + targetHttpsProxy = Preconditions.checkNotNull(builder.getTargetHttpsProxy()); + } + + public static TargetHttpsProxyName of( + String project, + String targetHttpsProxy + ) { + return newBuilder() + .setProject(project) + .setTargetHttpsProxy(targetHttpsProxy) + .build(); + } + + public static String format( + String project, + String targetHttpsProxy + ) { + return of( + project, + targetHttpsProxy + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("targetHttpsProxy", targetHttpsProxy); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetHttpsProxyName parse(String formattedString) {return TargetHttpsProxyName.parse(formattedString);} + }; + } + + public static TargetHttpsProxyName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetHttpsProxyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("targetHttpsProxy") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String targetHttpsProxy; + + public String getProject() { + return project; + } + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + private Builder() {} + + public Builder (TargetHttpsProxyName targetHttpsProxyName) { + project = targetHttpsProxyName.project; + targetHttpsProxy = targetHttpsProxyName.targetHttpsProxy; + } + + public TargetHttpsProxyName build() { + return new TargetHttpsProxyName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "targetHttpsProxy", targetHttpsProxy + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetHttpsProxyName) { + TargetHttpsProxyName that = (TargetHttpsProxyName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + targetHttpsProxy + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java new file mode 100644 index 000000000000..5ec56a20d47e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetHttpsProxyClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetHttpsProxy to 30 seconds: + * + *

+ * 
+ * TargetHttpsProxySettings.Builder targetHttpsProxySettingsBuilder =
+ *     TargetHttpsProxySettings.newBuilder();
+ * targetHttpsProxySettingsBuilder.deleteTargetHttpsProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetHttpsProxySettings targetHttpsProxySettings = targetHttpsProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetHttpsProxySettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteTargetHttpsProxy. + */ + public UnaryCallSettings deleteTargetHttpsProxySettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()).deleteTargetHttpsProxySettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetHttpsProxy. + */ + public UnaryCallSettings getTargetHttpsProxySettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()).getTargetHttpsProxySettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetHttpsProxy. + */ + public UnaryCallSettings insertTargetHttpsProxySettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()).insertTargetHttpsProxySettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetHttpsProxies. + */ + public PagedCallSettings listTargetHttpsProxiesSettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()).listTargetHttpsProxiesSettings(); + } + + /** + * Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy. + */ + public UnaryCallSettings setSslCertificatesTargetHttpsProxySettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()).setSslCertificatesTargetHttpsProxySettings(); + } + + /** + * Returns the object with the settings used for calls to setUrlMapTargetHttpsProxy. + */ + public UnaryCallSettings setUrlMapTargetHttpsProxySettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()).setUrlMapTargetHttpsProxySettings(); + } + + + public static final TargetHttpsProxySettings create(TargetHttpsProxyStubSettings stub) throws IOException { + return new TargetHttpsProxySettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetHttpsProxyStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetHttpsProxyStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetHttpsProxyStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetHttpsProxyStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetHttpsProxyStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetHttpsProxyStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetHttpsProxyStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetHttpsProxyStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetHttpsProxySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetHttpsProxySettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetHttpsProxyStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetHttpsProxyStubSettings.newBuilder()); + } + + protected Builder(TargetHttpsProxySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetHttpsProxyStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetHttpsProxyStubSettings.Builder getStubSettingsBuilder() { + return ((TargetHttpsProxyStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetHttpsProxy. + */ + public UnaryCallSettings.Builder deleteTargetHttpsProxySettings() { + return getStubSettingsBuilder().deleteTargetHttpsProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetHttpsProxy. + */ + public UnaryCallSettings.Builder getTargetHttpsProxySettings() { + return getStubSettingsBuilder().getTargetHttpsProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetHttpsProxy. + */ + public UnaryCallSettings.Builder insertTargetHttpsProxySettings() { + return getStubSettingsBuilder().insertTargetHttpsProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetHttpsProxies. + */ + public PagedCallSettings.Builder listTargetHttpsProxiesSettings() { + return getStubSettingsBuilder().listTargetHttpsProxiesSettings(); + } + + /** + * Returns the builder for the settings used for calls to setSslCertificatesTargetHttpsProxy. + */ + public UnaryCallSettings.Builder setSslCertificatesTargetHttpsProxySettings() { + return getStubSettingsBuilder().setSslCertificatesTargetHttpsProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to setUrlMapTargetHttpsProxy. + */ + public UnaryCallSettings.Builder setUrlMapTargetHttpsProxySettings() { + return getStubSettingsBuilder().setUrlMapTargetHttpsProxySettings(); + } + + @Override + public TargetHttpsProxySettings build() throws IOException { + return new TargetHttpsProxySettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java new file mode 100644 index 000000000000..04afb03c2800 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java @@ -0,0 +1,434 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetInstance implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String instance; + private final String kind; + private final String name; + private final String natPolicy; + private final String selfLink; + private final String zone; + + private TargetInstance() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.instance = null; + this.kind = null; + this.name = null; + this.natPolicy = null; + this.selfLink = null; + this.zone = null; + } + + + private TargetInstance( + String creationTimestamp, + String description, + String id, + String instance, + String kind, + String name, + String natPolicy, + String selfLink, + String zone + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.instance = instance; + this.kind = kind; + this.name = name; + this.natPolicy = natPolicy; + this.selfLink = selfLink; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("natPolicy") && natPolicy != null) { + fieldMap.put("natPolicy", Collections.singletonList(String.valueOf(natPolicy))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("natPolicy")) { + return String.valueOf(natPolicy); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getInstance() { + return instance; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNatPolicy() { + return natPolicy; + } + + public String getSelfLink() { + return selfLink; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetInstance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetInstance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetInstance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetInstance(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String instance; + private String kind; + private String name; + private String natPolicy; + private String selfLink; + private String zone; + + Builder() {} + + public Builder mergeFrom(TargetInstance other) { + if (other == TargetInstance.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNatPolicy() != null) { + this.natPolicy = other.natPolicy; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(TargetInstance source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.instance = source.instance; + this.kind = source.kind; + this.name = source.name; + this.natPolicy = source.natPolicy; + this.selfLink = source.selfLink; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNatPolicy() { + return natPolicy; + } + + public Builder setNatPolicy(String natPolicy) { + this.natPolicy = natPolicy; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public TargetInstance build() { + + + + + + + + + return new TargetInstance( + creationTimestamp, + description, + id, + instance, + kind, + name, + natPolicy, + selfLink, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setInstance(this.instance); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNatPolicy(this.natPolicy); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetInstance{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "instance=" + instance + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "natPolicy=" + natPolicy + ", " + + "selfLink=" + selfLink + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetInstance) { + TargetInstance that = (TargetInstance) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.natPolicy, that.getNatPolicy()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + instance, + kind, + name, + natPolicy, + selfLink, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java new file mode 100644 index 000000000000..90843287c914 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetInstanceAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetInstanceAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetInstanceAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetInstanceAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetInstanceAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetInstanceAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetInstanceAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetInstanceAggregatedList other) { + if (other == TargetInstanceAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetInstanceAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetInstanceAggregatedList build() { + + + + + return new TargetInstanceAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetInstanceAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetInstanceAggregatedList) { + TargetInstanceAggregatedList that = (TargetInstanceAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java new file mode 100644 index 000000000000..190e458cb2de --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java @@ -0,0 +1,936 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.TargetInstanceStub; +import com.google.cloud.compute.v1.stub.TargetInstanceStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+ *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+ *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetInstanceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetInstanceSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetInstanceSettings targetInstanceSettings =
+ *     TargetInstanceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetInstanceClient targetInstanceClient =
+ *     TargetInstanceClient.create(targetInstanceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetInstanceSettings targetInstanceSettings =
+ *     TargetInstanceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetInstanceClient targetInstanceClient =
+ *     TargetInstanceClient.create(targetInstanceSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetInstanceClient implements BackgroundResource { + private final TargetInstanceSettings settings; + private final TargetInstanceStub stub; + + + + /** + * Constructs an instance of TargetInstanceClient with default settings. + */ + public static final TargetInstanceClient create() throws IOException { + return create(TargetInstanceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetInstanceClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetInstanceClient create(TargetInstanceSettings settings) throws IOException { + return new TargetInstanceClient(settings); + } + + /** + * Constructs an instance of TargetInstanceClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetInstanceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetInstanceClient create(TargetInstanceStub stub) { + return new TargetInstanceClient(stub); + } + + /** + * Constructs an instance of TargetInstanceClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetInstanceClient(TargetInstanceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetInstanceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetInstanceClient(TargetInstanceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetInstanceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetInstanceStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target instances. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetInstancesScopedList element : targetInstanceClient.aggregatedListTargetInstances(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(ProjectName project) { + AggregatedListTargetInstancesHttpRequest request = + AggregatedListTargetInstancesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListTargetInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target instances. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetInstancesScopedList element : targetInstanceClient.aggregatedListTargetInstances(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(String project) { + AggregatedListTargetInstancesHttpRequest request = + AggregatedListTargetInstancesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListTargetInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target instances. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetInstancesHttpRequest request = AggregatedListTargetInstancesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetInstancesScopedList element : targetInstanceClient.aggregatedListTargetInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(AggregatedListTargetInstancesHttpRequest request) { + return aggregatedListTargetInstancesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target instances. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetInstancesHttpRequest request = AggregatedListTargetInstancesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListTargetInstancesPagedResponse> future = targetInstanceClient.aggregatedListTargetInstancesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetInstancesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListTargetInstancesPagedCallable() { + return stub.aggregatedListTargetInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target instances. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetInstancesHttpRequest request = AggregatedListTargetInstancesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetInstanceAggregatedList response = targetInstanceClient.aggregatedListTargetInstancesCallable().call(request);
+   *     for (TargetInstancesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListTargetInstancesCallable() { + return stub.aggregatedListTargetInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetInstance resource. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
+   * }
+   * 
+ * + * @param targetInstance Name of the TargetInstance resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetInstance(TargetInstanceName targetInstance) { + + DeleteTargetInstanceHttpRequest request = + DeleteTargetInstanceHttpRequest.newBuilder() + .setTargetInstance(targetInstance == null ? null : targetInstance.toString()) + .build(); + return deleteTargetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetInstance resource. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance.toString());
+   * }
+   * 
+ * + * @param targetInstance Name of the TargetInstance resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetInstance(String targetInstance) { + + DeleteTargetInstanceHttpRequest request = + DeleteTargetInstanceHttpRequest.newBuilder() + .setTargetInstance(targetInstance) + .build(); + return deleteTargetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetInstance resource. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
+   *     .setTargetInstance(targetInstance.toString())
+   *     .build();
+   *   Operation response = targetInstanceClient.deleteTargetInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest request) { + return deleteTargetInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetInstance resource. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
+   *     .setTargetInstance(targetInstance.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetInstanceClient.deleteTargetInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetInstanceCallable() { + return stub.deleteTargetInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   TargetInstance response = targetInstanceClient.getTargetInstance(targetInstance);
+   * }
+   * 
+ * + * @param targetInstance Name of the TargetInstance resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetInstance getTargetInstance(TargetInstanceName targetInstance) { + + GetTargetInstanceHttpRequest request = + GetTargetInstanceHttpRequest.newBuilder() + .setTargetInstance(targetInstance == null ? null : targetInstance.toString()) + .build(); + return getTargetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   TargetInstance response = targetInstanceClient.getTargetInstance(targetInstance.toString());
+   * }
+   * 
+ * + * @param targetInstance Name of the TargetInstance resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetInstance getTargetInstance(String targetInstance) { + + GetTargetInstanceHttpRequest request = + GetTargetInstanceHttpRequest.newBuilder() + .setTargetInstance(targetInstance) + .build(); + return getTargetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   GetTargetInstanceHttpRequest request = GetTargetInstanceHttpRequest.newBuilder()
+   *     .setTargetInstance(targetInstance.toString())
+   *     .build();
+   *   TargetInstance response = targetInstanceClient.getTargetInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest request) { + return getTargetInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   GetTargetInstanceHttpRequest request = GetTargetInstanceHttpRequest.newBuilder()
+   *     .setTargetInstance(targetInstance.toString())
+   *     .build();
+   *   ApiFuture<TargetInstance> future = targetInstanceClient.getTargetInstanceCallable().futureCall(request);
+   *   // Do something
+   *   TargetInstance response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetInstanceCallable() { + return stub.getTargetInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
+   *   Operation response = targetInstanceClient.insertTargetInstance(zone, targetInstanceResource);
+   * }
+   * 
+ * + * @param zone Name of the zone scoping this request. + * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetInstance(ZoneName zone, TargetInstance targetInstanceResource) { + + InsertTargetInstanceHttpRequest request = + InsertTargetInstanceHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .setTargetInstanceResource(targetInstanceResource) + .build(); + return insertTargetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
+   *   Operation response = targetInstanceClient.insertTargetInstance(zone.toString(), targetInstanceResource);
+   * }
+   * 
+ * + * @param zone Name of the zone scoping this request. + * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetInstance(String zone, TargetInstance targetInstanceResource) { + + InsertTargetInstanceHttpRequest request = + InsertTargetInstanceHttpRequest.newBuilder() + .setZone(zone) + .setTargetInstanceResource(targetInstanceResource) + .build(); + return insertTargetInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
+   *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setTargetInstanceResource(targetInstanceResource)
+   *     .build();
+   *   Operation response = targetInstanceClient.insertTargetInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetInstance(InsertTargetInstanceHttpRequest request) { + return insertTargetInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
+   *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .setTargetInstanceResource(targetInstanceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetInstanceClient.insertTargetInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetInstanceCallable() { + return stub.insertTargetInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (TargetInstance element : targetInstanceClient.listTargetInstances(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone Name of the zone scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetInstancesPagedResponse listTargetInstances(ZoneName zone) { + ListTargetInstancesHttpRequest request = + ListTargetInstancesHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listTargetInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (TargetInstance element : targetInstanceClient.listTargetInstances(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone Name of the zone scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetInstancesPagedResponse listTargetInstances(String zone) { + ListTargetInstancesHttpRequest request = + ListTargetInstancesHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listTargetInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListTargetInstancesHttpRequest request = ListTargetInstancesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (TargetInstance element : targetInstanceClient.listTargetInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetInstancesPagedResponse listTargetInstances(ListTargetInstancesHttpRequest request) { + return listTargetInstancesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListTargetInstancesHttpRequest request = ListTargetInstancesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListTargetInstancesPagedResponse> future = targetInstanceClient.listTargetInstancesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetInstance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetInstancesPagedCallable() { + return stub.listTargetInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * Sample code: + *

+   * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListTargetInstancesHttpRequest request = ListTargetInstancesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetInstanceList response = targetInstanceClient.listTargetInstancesCallable().call(request);
+   *     for (TargetInstance element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetInstancesCallable() { + return stub.listTargetInstancesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListTargetInstancesPagedResponse extends AbstractPagedListResponse< + AggregatedListTargetInstancesHttpRequest, + TargetInstanceAggregatedList, + TargetInstancesScopedList, + AggregatedListTargetInstancesPage, + AggregatedListTargetInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListTargetInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListTargetInstancesPagedResponse apply(AggregatedListTargetInstancesPage input) { + return new AggregatedListTargetInstancesPagedResponse(input); + } + }); + } + + private AggregatedListTargetInstancesPagedResponse(AggregatedListTargetInstancesPage page) { + super(page, AggregatedListTargetInstancesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListTargetInstancesPage extends AbstractPage< + AggregatedListTargetInstancesHttpRequest, + TargetInstanceAggregatedList, + TargetInstancesScopedList, + AggregatedListTargetInstancesPage> { + + private AggregatedListTargetInstancesPage( + PageContext context, + TargetInstanceAggregatedList response) { + super(context, response); + } + + private static AggregatedListTargetInstancesPage createEmptyPage() { + return new AggregatedListTargetInstancesPage(null, null); + } + + @Override + protected AggregatedListTargetInstancesPage createPage( + PageContext context, + TargetInstanceAggregatedList response) { + return new AggregatedListTargetInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListTargetInstancesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListTargetInstancesHttpRequest, + TargetInstanceAggregatedList, + TargetInstancesScopedList, + AggregatedListTargetInstancesPage, + AggregatedListTargetInstancesFixedSizeCollection> { + + private AggregatedListTargetInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListTargetInstancesFixedSizeCollection createEmptyCollection() { + return new AggregatedListTargetInstancesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListTargetInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListTargetInstancesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListTargetInstancesPagedResponse extends AbstractPagedListResponse< + ListTargetInstancesHttpRequest, + TargetInstanceList, + TargetInstance, + ListTargetInstancesPage, + ListTargetInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetInstancesPagedResponse apply(ListTargetInstancesPage input) { + return new ListTargetInstancesPagedResponse(input); + } + }); + } + + private ListTargetInstancesPagedResponse(ListTargetInstancesPage page) { + super(page, ListTargetInstancesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetInstancesPage extends AbstractPage< + ListTargetInstancesHttpRequest, + TargetInstanceList, + TargetInstance, + ListTargetInstancesPage> { + + private ListTargetInstancesPage( + PageContext context, + TargetInstanceList response) { + super(context, response); + } + + private static ListTargetInstancesPage createEmptyPage() { + return new ListTargetInstancesPage(null, null); + } + + @Override + protected ListTargetInstancesPage createPage( + PageContext context, + TargetInstanceList response) { + return new ListTargetInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetInstancesFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetInstancesHttpRequest, + TargetInstanceList, + TargetInstance, + ListTargetInstancesPage, + ListTargetInstancesFixedSizeCollection> { + + private ListTargetInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetInstancesFixedSizeCollection createEmptyCollection() { + return new ListTargetInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetInstancesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java new file mode 100644 index 000000000000..877ec8d726ca --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetInstanceList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetInstanceList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetInstanceList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetInstance item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetInstanceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetInstanceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetInstanceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetInstanceList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetInstanceList other) { + if (other == TargetInstanceList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetInstanceList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetInstance items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetInstanceList build() { + + + + + return new TargetInstanceList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetInstanceList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetInstanceList) { + TargetInstanceList that = (TargetInstanceList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java new file mode 100644 index 000000000000..c4abd864f795 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetInstanceName implements ResourceName { + private final String project; + private final String targetInstance; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/targetInstances/{targetInstance}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetInstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + targetInstance = Preconditions.checkNotNull(builder.getTargetInstance()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static TargetInstanceName of( + String project, + String targetInstance, + String zone + ) { + return newBuilder() + .setProject(project) + .setTargetInstance(targetInstance) + .setZone(zone) + .build(); + } + + public static String format( + String project, + String targetInstance, + String zone + ) { + return of( + project, + targetInstance, + zone + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getTargetInstance() { + return targetInstance; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("targetInstance", targetInstance); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetInstanceName parse(String formattedString) {return TargetInstanceName.parse(formattedString);} + }; + } + + public static TargetInstanceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetInstanceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("targetInstance"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String targetInstance; + private String zone; + + public String getProject() { + return project; + } + public String getTargetInstance() { + return targetInstance; + } + public String getZone() { + return zone; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setTargetInstance(String targetInstance) { + this.targetInstance = targetInstance; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (TargetInstanceName targetInstanceName) { + project = targetInstanceName.project; + targetInstance = targetInstanceName.targetInstance; + zone = targetInstanceName.zone; + } + + public TargetInstanceName build() { + return new TargetInstanceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "targetInstance", targetInstance, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetInstanceName) { + TargetInstanceName that = (TargetInstanceName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.targetInstance, that.getTargetInstance()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + targetInstance, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java new file mode 100644 index 000000000000..488422f16962 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import com.google.cloud.compute.v1.stub.TargetInstanceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetInstanceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetInstance to 30 seconds: + * + *

+ * 
+ * TargetInstanceSettings.Builder targetInstanceSettingsBuilder =
+ *     TargetInstanceSettings.newBuilder();
+ * targetInstanceSettingsBuilder.deleteTargetInstanceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetInstanceSettings targetInstanceSettings = targetInstanceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetInstanceSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListTargetInstances. + */ + public PagedCallSettings aggregatedListTargetInstancesSettings() { + return ((TargetInstanceStubSettings) getStubSettings()).aggregatedListTargetInstancesSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteTargetInstance. + */ + public UnaryCallSettings deleteTargetInstanceSettings() { + return ((TargetInstanceStubSettings) getStubSettings()).deleteTargetInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetInstance. + */ + public UnaryCallSettings getTargetInstanceSettings() { + return ((TargetInstanceStubSettings) getStubSettings()).getTargetInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetInstance. + */ + public UnaryCallSettings insertTargetInstanceSettings() { + return ((TargetInstanceStubSettings) getStubSettings()).insertTargetInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetInstances. + */ + public PagedCallSettings listTargetInstancesSettings() { + return ((TargetInstanceStubSettings) getStubSettings()).listTargetInstancesSettings(); + } + + + public static final TargetInstanceSettings create(TargetInstanceStubSettings stub) throws IOException { + return new TargetInstanceSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetInstanceStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetInstanceStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetInstanceStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetInstanceStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetInstanceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetInstanceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetInstanceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetInstanceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetInstanceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetInstanceSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetInstanceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetInstanceStubSettings.newBuilder()); + } + + protected Builder(TargetInstanceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetInstanceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetInstanceStubSettings.Builder getStubSettingsBuilder() { + return ((TargetInstanceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListTargetInstances. + */ + public PagedCallSettings.Builder aggregatedListTargetInstancesSettings() { + return getStubSettingsBuilder().aggregatedListTargetInstancesSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteTargetInstance. + */ + public UnaryCallSettings.Builder deleteTargetInstanceSettings() { + return getStubSettingsBuilder().deleteTargetInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetInstance. + */ + public UnaryCallSettings.Builder getTargetInstanceSettings() { + return getStubSettingsBuilder().getTargetInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetInstance. + */ + public UnaryCallSettings.Builder insertTargetInstanceSettings() { + return getStubSettingsBuilder().insertTargetInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetInstances. + */ + public PagedCallSettings.Builder listTargetInstancesSettings() { + return getStubSettingsBuilder().listTargetInstancesSettings(); + } + + @Override + public TargetInstanceSettings build() throws IOException { + return new TargetInstanceSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java new file mode 100644 index 000000000000..d0558be85aee --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetInstancesScopedList implements ApiMessage { + private final List targetInstances; + private final Warning warning; + + private TargetInstancesScopedList() { + this.targetInstances = null; + this.warning = null; + } + + + private TargetInstancesScopedList( + List targetInstances, + Warning warning + ) { + this.targetInstances = targetInstances; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("targetInstances") && targetInstances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetInstance item : targetInstances) { + stringList.add(item.toString()); + } + fieldMap.put("targetInstances", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("targetInstances")) { + return String.valueOf(targetInstances); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getTargetInstancesList() { + return targetInstances; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetInstancesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetInstancesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetInstancesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetInstancesScopedList(); + } + + public static class Builder { + private List targetInstances; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(TargetInstancesScopedList other) { + if (other == TargetInstancesScopedList.getDefaultInstance()) return this; + if (other.getTargetInstancesList() != null) { + this.targetInstances = other.targetInstances; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(TargetInstancesScopedList source) { + this.targetInstances = source.targetInstances; + this.warning = source.warning; + } + + public List getTargetInstancesList() { + return targetInstances; + } + + public Builder addAllTargetInstances(List targetInstances) { + if (this.targetInstances == null) { + this.targetInstances = new ArrayList<>(targetInstances.size()); + } + this.targetInstances.addAll(targetInstances); + return this; + } + + public Builder addTargetInstances(TargetInstance targetInstances) { + this.targetInstances.add(targetInstances); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public TargetInstancesScopedList build() { + + return new TargetInstancesScopedList( + targetInstances, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllTargetInstances(this.targetInstances); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetInstancesScopedList{" + + "targetInstances=" + targetInstances + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetInstancesScopedList) { + TargetInstancesScopedList that = (TargetInstancesScopedList) o; + return + Objects.equals(this.targetInstances, that.getTargetInstancesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + targetInstances, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java new file mode 100644 index 000000000000..469b8815b44c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java @@ -0,0 +1,560 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPool implements ApiMessage { + private final String backupPool; + private final String creationTimestamp; + private final String description; + private final Float failoverRatio; + private final List healthChecks; + private final String id; + private final List instances; + private final String kind; + private final String name; + private final String region; + private final String selfLink; + private final String sessionAffinity; + + private TargetPool() { + this.backupPool = null; + this.creationTimestamp = null; + this.description = null; + this.failoverRatio = null; + this.healthChecks = null; + this.id = null; + this.instances = null; + this.kind = null; + this.name = null; + this.region = null; + this.selfLink = null; + this.sessionAffinity = null; + } + + + private TargetPool( + String backupPool, + String creationTimestamp, + String description, + Float failoverRatio, + List healthChecks, + String id, + List instances, + String kind, + String name, + String region, + String selfLink, + String sessionAffinity + ) { + this.backupPool = backupPool; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.failoverRatio = failoverRatio; + this.healthChecks = healthChecks; + this.id = id; + this.instances = instances; + this.kind = kind; + this.name = name; + this.region = region; + this.selfLink = selfLink; + this.sessionAffinity = sessionAffinity; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("backupPool") && backupPool != null) { + fieldMap.put("backupPool", Collections.singletonList(String.valueOf(backupPool))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("failoverRatio") && failoverRatio != null) { + fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio))); + } + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) { + fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("backupPool")) { + return String.valueOf(backupPool); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("failoverRatio")) { + return String.valueOf(failoverRatio); + } + if (fieldName.equals("healthChecks")) { + return String.valueOf(healthChecks); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sessionAffinity")) { + return String.valueOf(sessionAffinity); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getBackupPool() { + return backupPool; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Float getFailoverRatio() { + return failoverRatio; + } + + public List getHealthChecksList() { + return healthChecks; + } + + public String getId() { + return id; + } + + public List getInstancesList() { + return instances; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getSessionAffinity() { + return sessionAffinity; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPool prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPool getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPool DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPool(); + } + + public static class Builder { + private String backupPool; + private String creationTimestamp; + private String description; + private Float failoverRatio; + private List healthChecks; + private String id; + private List instances; + private String kind; + private String name; + private String region; + private String selfLink; + private String sessionAffinity; + + Builder() {} + + public Builder mergeFrom(TargetPool other) { + if (other == TargetPool.getDefaultInstance()) return this; + if (other.getBackupPool() != null) { + this.backupPool = other.backupPool; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getFailoverRatio() != null) { + this.failoverRatio = other.failoverRatio; + } + if (other.getHealthChecksList() != null) { + this.healthChecks = other.healthChecks; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSessionAffinity() != null) { + this.sessionAffinity = other.sessionAffinity; + } + return this; + } + + Builder(TargetPool source) { + this.backupPool = source.backupPool; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.failoverRatio = source.failoverRatio; + this.healthChecks = source.healthChecks; + this.id = source.id; + this.instances = source.instances; + this.kind = source.kind; + this.name = source.name; + this.region = source.region; + this.selfLink = source.selfLink; + this.sessionAffinity = source.sessionAffinity; + } + + public String getBackupPool() { + return backupPool; + } + + public Builder setBackupPool(String backupPool) { + this.backupPool = backupPool; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Float getFailoverRatio() { + return failoverRatio; + } + + public Builder setFailoverRatio(Float failoverRatio) { + this.failoverRatio = failoverRatio; + return this; + } + + public List getHealthChecksList() { + return healthChecks; + } + + public Builder addAllHealthChecks(List healthChecks) { + if (this.healthChecks == null) { + this.healthChecks = new ArrayList<>(healthChecks.size()); + } + this.healthChecks.addAll(healthChecks); + return this; + } + + public Builder addHealthChecks(String healthChecks) { + this.healthChecks.add(healthChecks); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + this.instances.add(instances); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getSessionAffinity() { + return sessionAffinity; + } + + public Builder setSessionAffinity(String sessionAffinity) { + this.sessionAffinity = sessionAffinity; + return this; + } + + + public TargetPool build() { + + + + + + + + + + + + return new TargetPool( + backupPool, + creationTimestamp, + description, + failoverRatio, + healthChecks, + id, + instances, + kind, + name, + region, + selfLink, + sessionAffinity + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBackupPool(this.backupPool); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setFailoverRatio(this.failoverRatio); + newBuilder.addAllHealthChecks(this.healthChecks); + newBuilder.setId(this.id); + newBuilder.addAllInstances(this.instances); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSessionAffinity(this.sessionAffinity); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPool{" + + "backupPool=" + backupPool + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "failoverRatio=" + failoverRatio + ", " + + "healthChecks=" + healthChecks + ", " + + "id=" + id + ", " + + "instances=" + instances + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "sessionAffinity=" + sessionAffinity + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPool) { + TargetPool that = (TargetPool) o; + return + Objects.equals(this.backupPool, that.getBackupPool()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.failoverRatio, that.getFailoverRatio()) && + Objects.equals(this.healthChecks, that.getHealthChecksList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.instances, that.getInstancesList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sessionAffinity, that.getSessionAffinity()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + backupPool, + creationTimestamp, + description, + failoverRatio, + healthChecks, + id, + instances, + kind, + name, + region, + selfLink, + sessionAffinity + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java new file mode 100644 index 000000000000..fad41b9422dd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetPoolAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetPoolAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetPoolAggregatedList other) { + if (other == TargetPoolAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetPoolAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetPoolAggregatedList build() { + + + + + return new TargetPoolAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolAggregatedList) { + TargetPoolAggregatedList that = (TargetPoolAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java new file mode 100644 index 000000000000..7e2f51bbf6b1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java @@ -0,0 +1,1577 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.TargetPoolStub; +import com.google.cloud.compute.v1.stub.TargetPoolStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+ *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+ *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
+ *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetPoolClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetPoolSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetPoolSettings targetPoolSettings =
+ *     TargetPoolSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetPoolClient targetPoolClient =
+ *     TargetPoolClient.create(targetPoolSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetPoolSettings targetPoolSettings =
+ *     TargetPoolSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetPoolClient targetPoolClient =
+ *     TargetPoolClient.create(targetPoolSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetPoolClient implements BackgroundResource { + private final TargetPoolSettings settings; + private final TargetPoolStub stub; + + + + /** + * Constructs an instance of TargetPoolClient with default settings. + */ + public static final TargetPoolClient create() throws IOException { + return create(TargetPoolSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetPoolClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetPoolClient create(TargetPoolSettings settings) throws IOException { + return new TargetPoolClient(settings); + } + + /** + * Constructs an instance of TargetPoolClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetPoolSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetPoolClient create(TargetPoolStub stub) { + return new TargetPoolClient(stub); + } + + /** + * Constructs an instance of TargetPoolClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetPoolClient(TargetPoolSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetPoolStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetPoolClient(TargetPoolStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetPoolSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetPoolStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds health check URLs to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the target pool to add a health check to. + * @param targetPoolsAddHealthCheckRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addHealthCheckTargetPool(TargetPoolName targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + + AddHealthCheckTargetPoolHttpRequest request = + AddHealthCheckTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) + .build(); + return addHealthCheckTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds health check URLs to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool.toString(), targetPoolsAddHealthCheckRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the target pool to add a health check to. + * @param targetPoolsAddHealthCheckRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addHealthCheckTargetPool(String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + + AddHealthCheckTargetPoolHttpRequest request = + AddHealthCheckTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) + .build(); + return addHealthCheckTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds health check URLs to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
+   *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource)
+   *     .build();
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequest request) { + return addHealthCheckTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds health check URLs to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
+   *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.addHealthCheckTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable addHealthCheckTargetPoolCallable() { + return stub.addHealthCheckTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an instance to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to add instances to. + * @param targetPoolsAddInstanceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addInstanceTargetPool(TargetPoolName targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + + AddInstanceTargetPoolHttpRequest request = + AddInstanceTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) + .build(); + return addInstanceTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an instance to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool.toString(), targetPoolsAddInstanceRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to add instances to. + * @param targetPoolsAddInstanceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addInstanceTargetPool(String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + + AddInstanceTargetPoolHttpRequest request = + AddInstanceTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) + .build(); + return addInstanceTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an instance to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
+   *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource)
+   *     .build();
+   *   Operation response = targetPoolClient.addInstanceTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addInstanceTargetPool(AddInstanceTargetPoolHttpRequest request) { + return addInstanceTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds an instance to a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
+   *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.addInstanceTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable addInstanceTargetPoolCallable() { + return stub.addInstanceTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target pools. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetPoolsScopedList element : targetPoolClient.aggregatedListTargetPools(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(ProjectName project) { + AggregatedListTargetPoolsHttpRequest request = + AggregatedListTargetPoolsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListTargetPools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target pools. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetPoolsScopedList element : targetPoolClient.aggregatedListTargetPools(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(String project) { + AggregatedListTargetPoolsHttpRequest request = + AggregatedListTargetPoolsHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListTargetPools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target pools. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetPoolsHttpRequest request = AggregatedListTargetPoolsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetPoolsScopedList element : targetPoolClient.aggregatedListTargetPools(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(AggregatedListTargetPoolsHttpRequest request) { + return aggregatedListTargetPoolsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target pools. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetPoolsHttpRequest request = AggregatedListTargetPoolsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListTargetPoolsPagedResponse> future = targetPoolClient.aggregatedListTargetPoolsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetPoolsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListTargetPoolsPagedCallable() { + return stub.aggregatedListTargetPoolsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target pools. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetPoolsHttpRequest request = AggregatedListTargetPoolsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetPoolAggregatedList response = targetPoolClient.aggregatedListTargetPoolsCallable().call(request);
+   *     for (TargetPoolsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListTargetPoolsCallable() { + return stub.aggregatedListTargetPoolsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   Operation response = targetPoolClient.deleteTargetPool(targetPool);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetPool(TargetPoolName targetPool) { + + DeleteTargetPoolHttpRequest request = + DeleteTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .build(); + return deleteTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   Operation response = targetPoolClient.deleteTargetPool(targetPool.toString());
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetPool(String targetPool) { + + DeleteTargetPoolHttpRequest request = + DeleteTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .build(); + return deleteTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .build();
+   *   Operation response = targetPoolClient.deleteTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetPool(DeleteTargetPoolHttpRequest request) { + return deleteTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.deleteTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetPoolCallable() { + return stub.deleteTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target pool. Get a list of available target pools by making a list() request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPool response = targetPoolClient.getTargetPool(targetPool);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetPool getTargetPool(TargetPoolName targetPool) { + + GetTargetPoolHttpRequest request = + GetTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .build(); + return getTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target pool. Get a list of available target pools by making a list() request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPool response = targetPoolClient.getTargetPool(targetPool.toString());
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetPool getTargetPool(String targetPool) { + + GetTargetPoolHttpRequest request = + GetTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .build(); + return getTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target pool. Get a list of available target pools by making a list() request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   GetTargetPoolHttpRequest request = GetTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .build();
+   *   TargetPool response = targetPoolClient.getTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetPool getTargetPool(GetTargetPoolHttpRequest request) { + return getTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target pool. Get a list of available target pools by making a list() request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   GetTargetPoolHttpRequest request = GetTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .build();
+   *   ApiFuture<TargetPool> future = targetPoolClient.getTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   TargetPool response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetPoolCallable() { + return stub.getTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
+   *   TargetPoolInstanceHealth response = targetPoolClient.getHealthTargetPool(targetPool, instanceReferenceResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to which the queried instance belongs. + * @param instanceReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetPoolInstanceHealth getHealthTargetPool(TargetPoolName targetPool, InstanceReference instanceReferenceResource) { + + GetHealthTargetPoolHttpRequest request = + GetHealthTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setInstanceReferenceResource(instanceReferenceResource) + .build(); + return getHealthTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
+   *   TargetPoolInstanceHealth response = targetPoolClient.getHealthTargetPool(targetPool.toString(), instanceReferenceResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to which the queried instance belongs. + * @param instanceReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetPoolInstanceHealth getHealthTargetPool(String targetPool, InstanceReference instanceReferenceResource) { + + GetHealthTargetPoolHttpRequest request = + GetHealthTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .setInstanceReferenceResource(instanceReferenceResource) + .build(); + return getHealthTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
+   *   GetHealthTargetPoolHttpRequest request = GetHealthTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setInstanceReferenceResource(instanceReferenceResource)
+   *     .build();
+   *   TargetPoolInstanceHealth response = targetPoolClient.getHealthTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetPoolInstanceHealth getHealthTargetPool(GetHealthTargetPoolHttpRequest request) { + return getHealthTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
+   *   GetHealthTargetPoolHttpRequest request = GetHealthTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setInstanceReferenceResource(instanceReferenceResource)
+   *     .build();
+   *   ApiFuture<TargetPoolInstanceHealth> future = targetPoolClient.getHealthTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   TargetPoolInstanceHealth response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getHealthTargetPoolCallable() { + return stub.getHealthTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
+   *   Operation response = targetPoolClient.insertTargetPool(region, targetPoolResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, associated HttpHealthCheck resources, and the fallback target pool. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetPool(RegionName region, TargetPool targetPoolResource) { + + InsertTargetPoolHttpRequest request = + InsertTargetPoolHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setTargetPoolResource(targetPoolResource) + .build(); + return insertTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
+   *   Operation response = targetPoolClient.insertTargetPool(region.toString(), targetPoolResource);
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, associated HttpHealthCheck resources, and the fallback target pool. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetPool(String region, TargetPool targetPoolResource) { + + InsertTargetPoolHttpRequest request = + InsertTargetPoolHttpRequest.newBuilder() + .setRegion(region) + .setTargetPoolResource(targetPoolResource) + .build(); + return insertTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
+   *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setTargetPoolResource(targetPoolResource)
+   *     .build();
+   *   Operation response = targetPoolClient.insertTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetPool(InsertTargetPoolHttpRequest request) { + return insertTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
+   *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setTargetPoolResource(targetPoolResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.insertTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetPoolCallable() { + return stub.insertTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target pools available to the specified project and region. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (TargetPool element : targetPoolClient.listTargetPools(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetPoolsPagedResponse listTargetPools(RegionName region) { + ListTargetPoolsHttpRequest request = + ListTargetPoolsHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listTargetPools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target pools available to the specified project and region. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (TargetPool element : targetPoolClient.listTargetPools(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region scoping this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetPoolsPagedResponse listTargetPools(String region) { + ListTargetPoolsHttpRequest request = + ListTargetPoolsHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listTargetPools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target pools available to the specified project and region. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListTargetPoolsHttpRequest request = ListTargetPoolsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (TargetPool element : targetPoolClient.listTargetPools(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetPoolsPagedResponse listTargetPools(ListTargetPoolsHttpRequest request) { + return listTargetPoolsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target pools available to the specified project and region. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListTargetPoolsHttpRequest request = ListTargetPoolsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListTargetPoolsPagedResponse> future = targetPoolClient.listTargetPoolsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetPool element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetPoolsPagedCallable() { + return stub.listTargetPoolsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target pools available to the specified project and region. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListTargetPoolsHttpRequest request = ListTargetPoolsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetPoolList response = targetPoolClient.listTargetPoolsCallable().call(request);
+   *     for (TargetPool element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetPoolsCallable() { + return stub.listTargetPoolsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes health check URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the target pool to remove health checks from. + * @param targetPoolsRemoveHealthCheckRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeHealthCheckTargetPool(TargetPoolName targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + + RemoveHealthCheckTargetPoolHttpRequest request = + RemoveHealthCheckTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource) + .build(); + return removeHealthCheckTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes health check URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool.toString(), targetPoolsRemoveHealthCheckRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the target pool to remove health checks from. + * @param targetPoolsRemoveHealthCheckRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeHealthCheckTargetPool(String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + + RemoveHealthCheckTargetPoolHttpRequest request = + RemoveHealthCheckTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource) + .build(); + return removeHealthCheckTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes health check URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
+   *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource)
+   *     .build();
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeHealthCheckTargetPool(RemoveHealthCheckTargetPoolHttpRequest request) { + return removeHealthCheckTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes health check URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
+   *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.removeHealthCheckTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable removeHealthCheckTargetPoolCallable() { + return stub.removeHealthCheckTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes instance URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to remove instances from. + * @param targetPoolsRemoveInstanceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeInstanceTargetPool(TargetPoolName targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + + RemoveInstanceTargetPoolHttpRequest request = + RemoveInstanceTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) + .build(); + return removeInstanceTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes instance URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool.toString(), targetPoolsRemoveInstanceRequestResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to remove instances from. + * @param targetPoolsRemoveInstanceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeInstanceTargetPool(String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + + RemoveInstanceTargetPoolHttpRequest request = + RemoveInstanceTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) + .build(); + return removeInstanceTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes instance URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
+   *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource)
+   *     .build();
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequest request) { + return removeInstanceTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes instance URL from a target pool. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
+   *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.removeInstanceTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable removeInstanceTargetPoolCallable() { + return stub.removeInstanceTargetPoolCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes a backup target pool's configurations. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   Float failoverRatio = 0;
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to set a backup pool for. + * @param failoverRatio New failoverRatio value for the target pool. + * @param targetReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackupTargetPool(TargetPoolName targetPool, Float failoverRatio, TargetReference targetReferenceResource) { + + SetBackupTargetPoolHttpRequest request = + SetBackupTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setFailoverRatio(failoverRatio) + .setTargetReferenceResource(targetReferenceResource) + .build(); + return setBackupTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes a backup target pool's configurations. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   Float failoverRatio = 0;
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool.toString(), failoverRatio, targetReferenceResource);
+   * }
+   * 
+ * + * @param targetPool Name of the TargetPool resource to set a backup pool for. + * @param failoverRatio New failoverRatio value for the target pool. + * @param targetReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackupTargetPool(String targetPool, Float failoverRatio, TargetReference targetReferenceResource) { + + SetBackupTargetPoolHttpRequest request = + SetBackupTargetPoolHttpRequest.newBuilder() + .setTargetPool(targetPool) + .setFailoverRatio(failoverRatio) + .setTargetReferenceResource(targetReferenceResource) + .build(); + return setBackupTargetPool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes a backup target pool's configurations. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   Float failoverRatio = 0;
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setFailoverRatio(failoverRatio)
+   *     .setTargetReferenceResource(targetReferenceResource)
+   *     .build();
+   *   Operation response = targetPoolClient.setBackupTargetPool(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackupTargetPool(SetBackupTargetPoolHttpRequest request) { + return setBackupTargetPoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes a backup target pool's configurations. + * + * Sample code: + *

+   * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   Float failoverRatio = 0;
+   *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+   *   SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder()
+   *     .setTargetPool(targetPool.toString())
+   *     .setFailoverRatio(failoverRatio)
+   *     .setTargetReferenceResource(targetReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetPoolClient.setBackupTargetPoolCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setBackupTargetPoolCallable() { + return stub.setBackupTargetPoolCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListTargetPoolsPagedResponse extends AbstractPagedListResponse< + AggregatedListTargetPoolsHttpRequest, + TargetPoolAggregatedList, + TargetPoolsScopedList, + AggregatedListTargetPoolsPage, + AggregatedListTargetPoolsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListTargetPoolsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListTargetPoolsPagedResponse apply(AggregatedListTargetPoolsPage input) { + return new AggregatedListTargetPoolsPagedResponse(input); + } + }); + } + + private AggregatedListTargetPoolsPagedResponse(AggregatedListTargetPoolsPage page) { + super(page, AggregatedListTargetPoolsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListTargetPoolsPage extends AbstractPage< + AggregatedListTargetPoolsHttpRequest, + TargetPoolAggregatedList, + TargetPoolsScopedList, + AggregatedListTargetPoolsPage> { + + private AggregatedListTargetPoolsPage( + PageContext context, + TargetPoolAggregatedList response) { + super(context, response); + } + + private static AggregatedListTargetPoolsPage createEmptyPage() { + return new AggregatedListTargetPoolsPage(null, null); + } + + @Override + protected AggregatedListTargetPoolsPage createPage( + PageContext context, + TargetPoolAggregatedList response) { + return new AggregatedListTargetPoolsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListTargetPoolsFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListTargetPoolsHttpRequest, + TargetPoolAggregatedList, + TargetPoolsScopedList, + AggregatedListTargetPoolsPage, + AggregatedListTargetPoolsFixedSizeCollection> { + + private AggregatedListTargetPoolsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListTargetPoolsFixedSizeCollection createEmptyCollection() { + return new AggregatedListTargetPoolsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListTargetPoolsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListTargetPoolsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListTargetPoolsPagedResponse extends AbstractPagedListResponse< + ListTargetPoolsHttpRequest, + TargetPoolList, + TargetPool, + ListTargetPoolsPage, + ListTargetPoolsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetPoolsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetPoolsPagedResponse apply(ListTargetPoolsPage input) { + return new ListTargetPoolsPagedResponse(input); + } + }); + } + + private ListTargetPoolsPagedResponse(ListTargetPoolsPage page) { + super(page, ListTargetPoolsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetPoolsPage extends AbstractPage< + ListTargetPoolsHttpRequest, + TargetPoolList, + TargetPool, + ListTargetPoolsPage> { + + private ListTargetPoolsPage( + PageContext context, + TargetPoolList response) { + super(context, response); + } + + private static ListTargetPoolsPage createEmptyPage() { + return new ListTargetPoolsPage(null, null); + } + + @Override + protected ListTargetPoolsPage createPage( + PageContext context, + TargetPoolList response) { + return new ListTargetPoolsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetPoolsFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetPoolsHttpRequest, + TargetPoolList, + TargetPool, + ListTargetPoolsPage, + ListTargetPoolsFixedSizeCollection> { + + private ListTargetPoolsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetPoolsFixedSizeCollection createEmptyCollection() { + return new ListTargetPoolsFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetPoolsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetPoolsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java new file mode 100644 index 000000000000..c2fc01490661 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolInstanceHealth implements ApiMessage { + private final List healthStatus; + private final String kind; + + private TargetPoolInstanceHealth() { + this.healthStatus = null; + this.kind = null; + } + + + private TargetPoolInstanceHealth( + List healthStatus, + String kind + ) { + this.healthStatus = healthStatus; + this.kind = kind; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthStatus") && healthStatus != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthStatus item : healthStatus) { + stringList.add(item.toString()); + } + fieldMap.put("healthStatus", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthStatus")) { + return String.valueOf(healthStatus); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getHealthStatusList() { + return healthStatus; + } + + public String getKind() { + return kind; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolInstanceHealth prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolInstanceHealth getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolInstanceHealth DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolInstanceHealth(); + } + + public static class Builder { + private List healthStatus; + private String kind; + + Builder() {} + + public Builder mergeFrom(TargetPoolInstanceHealth other) { + if (other == TargetPoolInstanceHealth.getDefaultInstance()) return this; + if (other.getHealthStatusList() != null) { + this.healthStatus = other.healthStatus; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + return this; + } + + Builder(TargetPoolInstanceHealth source) { + this.healthStatus = source.healthStatus; + this.kind = source.kind; + } + + public List getHealthStatusList() { + return healthStatus; + } + + public Builder addAllHealthStatus(List healthStatus) { + if (this.healthStatus == null) { + this.healthStatus = new ArrayList<>(healthStatus.size()); + } + this.healthStatus.addAll(healthStatus); + return this; + } + + public Builder addHealthStatus(HealthStatus healthStatus) { + this.healthStatus.add(healthStatus); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + + public TargetPoolInstanceHealth build() { + + return new TargetPoolInstanceHealth( + healthStatus, + kind + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllHealthStatus(this.healthStatus); + newBuilder.setKind(this.kind); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolInstanceHealth{" + + "healthStatus=" + healthStatus + ", " + + "kind=" + kind + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolInstanceHealth) { + TargetPoolInstanceHealth that = (TargetPoolInstanceHealth) o; + return + Objects.equals(this.healthStatus, that.getHealthStatusList()) && + Objects.equals(this.kind, that.getKind()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthStatus, + kind + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java new file mode 100644 index 000000000000..1d044f196d47 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetPoolList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetPoolList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetPool item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetPoolList other) { + if (other == TargetPoolList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetPoolList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetPool items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetPoolList build() { + + + + + return new TargetPoolList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolList) { + TargetPoolList that = (TargetPoolList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java new file mode 100644 index 000000000000..352aa6b90f0d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolName implements ResourceName { + private final String project; + private final String region; + private final String targetPool; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetPools/{targetPool}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetPoolName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + targetPool = Preconditions.checkNotNull(builder.getTargetPool()); + } + + public static TargetPoolName of( + String project, + String region, + String targetPool + ) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setTargetPool(targetPool) + .build(); + } + + public static String format( + String project, + String region, + String targetPool + ) { + return of( + project, + region, + targetPool + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getTargetPool() { + return targetPool; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("targetPool", targetPool); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetPoolName parse(String formattedString) {return TargetPoolName.parse(formattedString);} + }; + } + + public static TargetPoolName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetPoolName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("region"), + matchMap.get("targetPool") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String targetPool; + + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + public String getTargetPool() { + return targetPool; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + public Builder setTargetPool(String targetPool) { + this.targetPool = targetPool; + return this; + } + + private Builder() {} + + public Builder (TargetPoolName targetPoolName) { + project = targetPoolName.project; + region = targetPoolName.region; + targetPool = targetPoolName.targetPool; + } + + public TargetPoolName build() { + return new TargetPoolName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "targetPool", targetPool + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolName) { + TargetPoolName that = (TargetPoolName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.targetPool, that.getTargetPool()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + region, + targetPool + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java new file mode 100644 index 000000000000..68b94343164a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java @@ -0,0 +1,367 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; +import com.google.cloud.compute.v1.stub.TargetPoolStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetPoolClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addHealthCheckTargetPool to 30 seconds: + * + *

+ * 
+ * TargetPoolSettings.Builder targetPoolSettingsBuilder =
+ *     TargetPoolSettings.newBuilder();
+ * targetPoolSettingsBuilder.addHealthCheckTargetPoolSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetPoolSettings targetPoolSettings = targetPoolSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetPoolSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to addHealthCheckTargetPool. + */ + public UnaryCallSettings addHealthCheckTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).addHealthCheckTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to addInstanceTargetPool. + */ + public UnaryCallSettings addInstanceTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).addInstanceTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to aggregatedListTargetPools. + */ + public PagedCallSettings aggregatedListTargetPoolsSettings() { + return ((TargetPoolStubSettings) getStubSettings()).aggregatedListTargetPoolsSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteTargetPool. + */ + public UnaryCallSettings deleteTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).deleteTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetPool. + */ + public UnaryCallSettings getTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).getTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to getHealthTargetPool. + */ + public UnaryCallSettings getHealthTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).getHealthTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetPool. + */ + public UnaryCallSettings insertTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).insertTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetPools. + */ + public PagedCallSettings listTargetPoolsSettings() { + return ((TargetPoolStubSettings) getStubSettings()).listTargetPoolsSettings(); + } + + /** + * Returns the object with the settings used for calls to removeHealthCheckTargetPool. + */ + public UnaryCallSettings removeHealthCheckTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).removeHealthCheckTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to removeInstanceTargetPool. + */ + public UnaryCallSettings removeInstanceTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).removeInstanceTargetPoolSettings(); + } + + /** + * Returns the object with the settings used for calls to setBackupTargetPool. + */ + public UnaryCallSettings setBackupTargetPoolSettings() { + return ((TargetPoolStubSettings) getStubSettings()).setBackupTargetPoolSettings(); + } + + + public static final TargetPoolSettings create(TargetPoolStubSettings stub) throws IOException { + return new TargetPoolSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetPoolStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetPoolStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetPoolStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetPoolStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetPoolStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetPoolStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetPoolStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetPoolStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetPoolSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetPoolSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetPoolStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetPoolStubSettings.newBuilder()); + } + + protected Builder(TargetPoolSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetPoolStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetPoolStubSettings.Builder getStubSettingsBuilder() { + return ((TargetPoolStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to addHealthCheckTargetPool. + */ + public UnaryCallSettings.Builder addHealthCheckTargetPoolSettings() { + return getStubSettingsBuilder().addHealthCheckTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to addInstanceTargetPool. + */ + public UnaryCallSettings.Builder addInstanceTargetPoolSettings() { + return getStubSettingsBuilder().addInstanceTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to aggregatedListTargetPools. + */ + public PagedCallSettings.Builder aggregatedListTargetPoolsSettings() { + return getStubSettingsBuilder().aggregatedListTargetPoolsSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteTargetPool. + */ + public UnaryCallSettings.Builder deleteTargetPoolSettings() { + return getStubSettingsBuilder().deleteTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetPool. + */ + public UnaryCallSettings.Builder getTargetPoolSettings() { + return getStubSettingsBuilder().getTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to getHealthTargetPool. + */ + public UnaryCallSettings.Builder getHealthTargetPoolSettings() { + return getStubSettingsBuilder().getHealthTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetPool. + */ + public UnaryCallSettings.Builder insertTargetPoolSettings() { + return getStubSettingsBuilder().insertTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetPools. + */ + public PagedCallSettings.Builder listTargetPoolsSettings() { + return getStubSettingsBuilder().listTargetPoolsSettings(); + } + + /** + * Returns the builder for the settings used for calls to removeHealthCheckTargetPool. + */ + public UnaryCallSettings.Builder removeHealthCheckTargetPoolSettings() { + return getStubSettingsBuilder().removeHealthCheckTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to removeInstanceTargetPool. + */ + public UnaryCallSettings.Builder removeInstanceTargetPoolSettings() { + return getStubSettingsBuilder().removeInstanceTargetPoolSettings(); + } + + /** + * Returns the builder for the settings used for calls to setBackupTargetPool. + */ + public UnaryCallSettings.Builder setBackupTargetPoolSettings() { + return getStubSettingsBuilder().setBackupTargetPoolSettings(); + } + + @Override + public TargetPoolSettings build() throws IOException { + return new TargetPoolSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java new file mode 100644 index 000000000000..987f8b15cdc9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolsAddHealthCheckRequest implements ApiMessage { + private final List healthChecks; + + private TargetPoolsAddHealthCheckRequest() { + this.healthChecks = null; + } + + + private TargetPoolsAddHealthCheckRequest( + List healthChecks + ) { + this.healthChecks = healthChecks; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthCheckReference item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthChecks")) { + return String.valueOf(healthChecks); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getHealthChecksList() { + return healthChecks; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolsAddHealthCheckRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolsAddHealthCheckRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolsAddHealthCheckRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolsAddHealthCheckRequest(); + } + + public static class Builder { + private List healthChecks; + + Builder() {} + + public Builder mergeFrom(TargetPoolsAddHealthCheckRequest other) { + if (other == TargetPoolsAddHealthCheckRequest.getDefaultInstance()) return this; + if (other.getHealthChecksList() != null) { + this.healthChecks = other.healthChecks; + } + return this; + } + + Builder(TargetPoolsAddHealthCheckRequest source) { + this.healthChecks = source.healthChecks; + } + + public List getHealthChecksList() { + return healthChecks; + } + + public Builder addAllHealthChecks(List healthChecks) { + if (this.healthChecks == null) { + this.healthChecks = new ArrayList<>(healthChecks.size()); + } + this.healthChecks.addAll(healthChecks); + return this; + } + + public Builder addHealthChecks(HealthCheckReference healthChecks) { + this.healthChecks.add(healthChecks); + return this; + } + + + public TargetPoolsAddHealthCheckRequest build() { + return new TargetPoolsAddHealthCheckRequest( + healthChecks + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllHealthChecks(this.healthChecks); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolsAddHealthCheckRequest{" + + "healthChecks=" + healthChecks + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolsAddHealthCheckRequest) { + TargetPoolsAddHealthCheckRequest that = (TargetPoolsAddHealthCheckRequest) o; + return + Objects.equals(this.healthChecks, that.getHealthChecksList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthChecks + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java new file mode 100644 index 000000000000..0c6057132940 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolsAddInstanceRequest implements ApiMessage { + private final List instances; + + private TargetPoolsAddInstanceRequest() { + this.instances = null; + } + + + private TargetPoolsAddInstanceRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolsAddInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolsAddInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolsAddInstanceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolsAddInstanceRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(TargetPoolsAddInstanceRequest other) { + if (other == TargetPoolsAddInstanceRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(TargetPoolsAddInstanceRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(InstanceReference instances) { + this.instances.add(instances); + return this; + } + + + public TargetPoolsAddInstanceRequest build() { + return new TargetPoolsAddInstanceRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolsAddInstanceRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolsAddInstanceRequest) { + TargetPoolsAddInstanceRequest that = (TargetPoolsAddInstanceRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java new file mode 100644 index 000000000000..0e83d29b5eb5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolsRemoveHealthCheckRequest implements ApiMessage { + private final List healthChecks; + + private TargetPoolsRemoveHealthCheckRequest() { + this.healthChecks = null; + } + + + private TargetPoolsRemoveHealthCheckRequest( + List healthChecks + ) { + this.healthChecks = healthChecks; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthCheckReference item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthChecks")) { + return String.valueOf(healthChecks); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getHealthChecksList() { + return healthChecks; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolsRemoveHealthCheckRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolsRemoveHealthCheckRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolsRemoveHealthCheckRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolsRemoveHealthCheckRequest(); + } + + public static class Builder { + private List healthChecks; + + Builder() {} + + public Builder mergeFrom(TargetPoolsRemoveHealthCheckRequest other) { + if (other == TargetPoolsRemoveHealthCheckRequest.getDefaultInstance()) return this; + if (other.getHealthChecksList() != null) { + this.healthChecks = other.healthChecks; + } + return this; + } + + Builder(TargetPoolsRemoveHealthCheckRequest source) { + this.healthChecks = source.healthChecks; + } + + public List getHealthChecksList() { + return healthChecks; + } + + public Builder addAllHealthChecks(List healthChecks) { + if (this.healthChecks == null) { + this.healthChecks = new ArrayList<>(healthChecks.size()); + } + this.healthChecks.addAll(healthChecks); + return this; + } + + public Builder addHealthChecks(HealthCheckReference healthChecks) { + this.healthChecks.add(healthChecks); + return this; + } + + + public TargetPoolsRemoveHealthCheckRequest build() { + return new TargetPoolsRemoveHealthCheckRequest( + healthChecks + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllHealthChecks(this.healthChecks); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolsRemoveHealthCheckRequest{" + + "healthChecks=" + healthChecks + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolsRemoveHealthCheckRequest) { + TargetPoolsRemoveHealthCheckRequest that = (TargetPoolsRemoveHealthCheckRequest) o; + return + Objects.equals(this.healthChecks, that.getHealthChecksList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + healthChecks + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java new file mode 100644 index 000000000000..3752671d0f9d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolsRemoveInstanceRequest implements ApiMessage { + private final List instances; + + private TargetPoolsRemoveInstanceRequest() { + this.instances = null; + } + + + private TargetPoolsRemoveInstanceRequest( + List instances + ) { + this.instances = instances; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInstancesList() { + return instances; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolsRemoveInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolsRemoveInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolsRemoveInstanceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolsRemoveInstanceRequest(); + } + + public static class Builder { + private List instances; + + Builder() {} + + public Builder mergeFrom(TargetPoolsRemoveInstanceRequest other) { + if (other == TargetPoolsRemoveInstanceRequest.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + return this; + } + + Builder(TargetPoolsRemoveInstanceRequest source) { + this.instances = source.instances; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new ArrayList<>(instances.size()); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(InstanceReference instances) { + this.instances.add(instances); + return this; + } + + + public TargetPoolsRemoveInstanceRequest build() { + return new TargetPoolsRemoveInstanceRequest( + instances + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolsRemoveInstanceRequest{" + + "instances=" + instances + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolsRemoveInstanceRequest) { + TargetPoolsRemoveInstanceRequest that = (TargetPoolsRemoveInstanceRequest) o; + return + Objects.equals(this.instances, that.getInstancesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + instances + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java new file mode 100644 index 000000000000..c207a7af2248 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetPoolsScopedList implements ApiMessage { + private final List targetPools; + private final Warning warning; + + private TargetPoolsScopedList() { + this.targetPools = null; + this.warning = null; + } + + + private TargetPoolsScopedList( + List targetPools, + Warning warning + ) { + this.targetPools = targetPools; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetPool item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getTargetPoolsList() { + return targetPools; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetPoolsScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetPoolsScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetPoolsScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetPoolsScopedList(); + } + + public static class Builder { + private List targetPools; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(TargetPoolsScopedList other) { + if (other == TargetPoolsScopedList.getDefaultInstance()) return this; + if (other.getTargetPoolsList() != null) { + this.targetPools = other.targetPools; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(TargetPoolsScopedList source) { + this.targetPools = source.targetPools; + this.warning = source.warning; + } + + public List getTargetPoolsList() { + return targetPools; + } + + public Builder addAllTargetPools(List targetPools) { + if (this.targetPools == null) { + this.targetPools = new ArrayList<>(targetPools.size()); + } + this.targetPools.addAll(targetPools); + return this; + } + + public Builder addTargetPools(TargetPool targetPools) { + this.targetPools.add(targetPools); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public TargetPoolsScopedList build() { + + return new TargetPoolsScopedList( + targetPools, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllTargetPools(this.targetPools); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetPoolsScopedList{" + + "targetPools=" + targetPools + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetPoolsScopedList) { + TargetPoolsScopedList that = (TargetPoolsScopedList) o; + return + Objects.equals(this.targetPools, that.getTargetPoolsList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + targetPools, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java new file mode 100644 index 000000000000..e3febccb9f3f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetReference implements ApiMessage { + private final String target; + + private TargetReference() { + this.target = null; + } + + + private TargetReference( + String target + ) { + this.target = target; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("target")) { + return String.valueOf(target); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getTarget() { + return target; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetReference(); + } + + public static class Builder { + private String target; + + Builder() {} + + public Builder mergeFrom(TargetReference other) { + if (other == TargetReference.getDefaultInstance()) return this; + if (other.getTarget() != null) { + this.target = other.target; + } + return this; + } + + Builder(TargetReference source) { + this.target = source.target; + } + + public String getTarget() { + return target; + } + + public Builder setTarget(String target) { + this.target = target; + return this; + } + + + public TargetReference build() { + return new TargetReference( + target + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setTarget(this.target); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetReference{" + + "target=" + target + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetReference) { + TargetReference that = (TargetReference) o; + return + Objects.equals(this.target, that.getTarget()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + target + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java new file mode 100644 index 000000000000..aa67fe98bdca --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetSslProxiesSetBackendServiceRequest implements ApiMessage { + private final String service; + + private TargetSslProxiesSetBackendServiceRequest() { + this.service = null; + } + + + private TargetSslProxiesSetBackendServiceRequest( + String service + ) { + this.service = service; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("service")) { + return String.valueOf(service); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getService() { + return service; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetSslProxiesSetBackendServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetSslProxiesSetBackendServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetSslProxiesSetBackendServiceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetSslProxiesSetBackendServiceRequest(); + } + + public static class Builder { + private String service; + + Builder() {} + + public Builder mergeFrom(TargetSslProxiesSetBackendServiceRequest other) { + if (other == TargetSslProxiesSetBackendServiceRequest.getDefaultInstance()) return this; + if (other.getService() != null) { + this.service = other.service; + } + return this; + } + + Builder(TargetSslProxiesSetBackendServiceRequest source) { + this.service = source.service; + } + + public String getService() { + return service; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + + public TargetSslProxiesSetBackendServiceRequest build() { + return new TargetSslProxiesSetBackendServiceRequest( + service + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setService(this.service); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetSslProxiesSetBackendServiceRequest{" + + "service=" + service + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetSslProxiesSetBackendServiceRequest) { + TargetSslProxiesSetBackendServiceRequest that = (TargetSslProxiesSetBackendServiceRequest) o; + return + Objects.equals(this.service, that.getService()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + service + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java new file mode 100644 index 000000000000..63c68fef7ca5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetSslProxiesSetProxyHeaderRequest implements ApiMessage { + private final String proxyHeader; + + private TargetSslProxiesSetProxyHeaderRequest() { + this.proxyHeader = null; + } + + + private TargetSslProxiesSetProxyHeaderRequest( + String proxyHeader + ) { + this.proxyHeader = proxyHeader; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getProxyHeader() { + return proxyHeader; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetSslProxiesSetProxyHeaderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetSslProxiesSetProxyHeaderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetSslProxiesSetProxyHeaderRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetSslProxiesSetProxyHeaderRequest(); + } + + public static class Builder { + private String proxyHeader; + + Builder() {} + + public Builder mergeFrom(TargetSslProxiesSetProxyHeaderRequest other) { + if (other == TargetSslProxiesSetProxyHeaderRequest.getDefaultInstance()) return this; + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + return this; + } + + Builder(TargetSslProxiesSetProxyHeaderRequest source) { + this.proxyHeader = source.proxyHeader; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + + public TargetSslProxiesSetProxyHeaderRequest build() { + return new TargetSslProxiesSetProxyHeaderRequest( + proxyHeader + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setProxyHeader(this.proxyHeader); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetSslProxiesSetProxyHeaderRequest{" + + "proxyHeader=" + proxyHeader + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetSslProxiesSetProxyHeaderRequest) { + TargetSslProxiesSetProxyHeaderRequest that = (TargetSslProxiesSetProxyHeaderRequest) o; + return + Objects.equals(this.proxyHeader, that.getProxyHeader()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + proxyHeader + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java new file mode 100644 index 000000000000..46111fdc1262 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetSslProxiesSetSslCertificatesRequest implements ApiMessage { + private final List sslCertificates; + + private TargetSslProxiesSetSslCertificatesRequest() { + this.sslCertificates = null; + } + + + private TargetSslProxiesSetSslCertificatesRequest( + List sslCertificates + ) { + this.sslCertificates = sslCertificates; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sslCertificates")) { + return String.valueOf(sslCertificates); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetSslProxiesSetSslCertificatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetSslProxiesSetSslCertificatesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetSslProxiesSetSslCertificatesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetSslProxiesSetSslCertificatesRequest(); + } + + public static class Builder { + private List sslCertificates; + + Builder() {} + + public Builder mergeFrom(TargetSslProxiesSetSslCertificatesRequest other) { + if (other == TargetSslProxiesSetSslCertificatesRequest.getDefaultInstance()) return this; + if (other.getSslCertificatesList() != null) { + this.sslCertificates = other.sslCertificates; + } + return this; + } + + Builder(TargetSslProxiesSetSslCertificatesRequest source) { + this.sslCertificates = source.sslCertificates; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + public Builder addAllSslCertificates(List sslCertificates) { + if (this.sslCertificates == null) { + this.sslCertificates = new ArrayList<>(sslCertificates.size()); + } + this.sslCertificates.addAll(sslCertificates); + return this; + } + + public Builder addSslCertificates(String sslCertificates) { + this.sslCertificates.add(sslCertificates); + return this; + } + + + public TargetSslProxiesSetSslCertificatesRequest build() { + return new TargetSslProxiesSetSslCertificatesRequest( + sslCertificates + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllSslCertificates(this.sslCertificates); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetSslProxiesSetSslCertificatesRequest{" + + "sslCertificates=" + sslCertificates + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetSslProxiesSetSslCertificatesRequest) { + TargetSslProxiesSetSslCertificatesRequest that = (TargetSslProxiesSetSslCertificatesRequest) o; + return + Objects.equals(this.sslCertificates, that.getSslCertificatesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + sslCertificates + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java new file mode 100644 index 000000000000..bc7b55987ca2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java @@ -0,0 +1,446 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetSslProxy implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String proxyHeader; + private final String selfLink; + private final String service; + private final List sslCertificates; + + private TargetSslProxy() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.proxyHeader = null; + this.selfLink = null; + this.service = null; + this.sslCertificates = null; + } + + + private TargetSslProxy( + String creationTimestamp, + String description, + String id, + String kind, + String name, + String proxyHeader, + String selfLink, + String service, + List sslCertificates + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.proxyHeader = proxyHeader; + this.selfLink = selfLink; + this.service = service; + this.sslCertificates = sslCertificates; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("service")) { + return String.valueOf(service); + } + if (fieldName.equals("sslCertificates")) { + return String.valueOf(sslCertificates); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getSelfLink() { + return selfLink; + } + + public String getService() { + return service; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetSslProxy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetSslProxy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetSslProxy DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetSslProxy(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String proxyHeader; + private String selfLink; + private String service; + private List sslCertificates; + + Builder() {} + + public Builder mergeFrom(TargetSslProxy other) { + if (other == TargetSslProxy.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getService() != null) { + this.service = other.service; + } + if (other.getSslCertificatesList() != null) { + this.sslCertificates = other.sslCertificates; + } + return this; + } + + Builder(TargetSslProxy source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.proxyHeader = source.proxyHeader; + this.selfLink = source.selfLink; + this.service = source.service; + this.sslCertificates = source.sslCertificates; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getService() { + return service; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + public List getSslCertificatesList() { + return sslCertificates; + } + + public Builder addAllSslCertificates(List sslCertificates) { + if (this.sslCertificates == null) { + this.sslCertificates = new ArrayList<>(sslCertificates.size()); + } + this.sslCertificates.addAll(sslCertificates); + return this; + } + + public Builder addSslCertificates(String sslCertificates) { + this.sslCertificates.add(sslCertificates); + return this; + } + + + public TargetSslProxy build() { + + + + + + + + + return new TargetSslProxy( + creationTimestamp, + description, + id, + kind, + name, + proxyHeader, + selfLink, + service, + sslCertificates + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setService(this.service); + newBuilder.addAllSslCertificates(this.sslCertificates); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetSslProxy{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "proxyHeader=" + proxyHeader + ", " + + "selfLink=" + selfLink + ", " + + "service=" + service + ", " + + "sslCertificates=" + sslCertificates + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetSslProxy) { + TargetSslProxy that = (TargetSslProxy) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.proxyHeader, that.getProxyHeader()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.service, that.getService()) && + Objects.equals(this.sslCertificates, that.getSslCertificatesList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + kind, + name, + proxyHeader, + selfLink, + service, + sslCertificates + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java new file mode 100644 index 000000000000..eac94b44fc41 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java @@ -0,0 +1,1031 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.TargetSslProxyStub; +import com.google.cloud.compute.v1.stub.TargetSslProxyStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+ *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+ *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetSslProxyClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetSslProxySettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetSslProxySettings targetSslProxySettings =
+ *     TargetSslProxySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetSslProxyClient targetSslProxyClient =
+ *     TargetSslProxyClient.create(targetSslProxySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetSslProxySettings targetSslProxySettings =
+ *     TargetSslProxySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetSslProxyClient targetSslProxyClient =
+ *     TargetSslProxyClient.create(targetSslProxySettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetSslProxyClient implements BackgroundResource { + private final TargetSslProxySettings settings; + private final TargetSslProxyStub stub; + + + + /** + * Constructs an instance of TargetSslProxyClient with default settings. + */ + public static final TargetSslProxyClient create() throws IOException { + return create(TargetSslProxySettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetSslProxyClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetSslProxyClient create(TargetSslProxySettings settings) throws IOException { + return new TargetSslProxyClient(settings); + } + + /** + * Constructs an instance of TargetSslProxyClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetSslProxySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetSslProxyClient create(TargetSslProxyStub stub) { + return new TargetSslProxyClient(stub); + } + + /** + * Constructs an instance of TargetSslProxyClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetSslProxyClient(TargetSslProxySettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetSslProxyStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetSslProxyClient(TargetSslProxyStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetSslProxySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetSslProxyStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetSslProxy resource. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetSslProxy(TargetSslProxyName targetSslProxy) { + + DeleteTargetSslProxyHttpRequest request = + DeleteTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .build(); + return deleteTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetSslProxy resource. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString());
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetSslProxy(String targetSslProxy) { + + DeleteTargetSslProxyHttpRequest request = + DeleteTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy) + .build(); + return deleteTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetSslProxy resource. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .build();
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest request) { + return deleteTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetSslProxy resource. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetSslProxyClient.deleteTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetSslProxyCallable() { + return stub.deleteTargetSslProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(targetSslProxy);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetSslProxy getTargetSslProxy(TargetSslProxyName targetSslProxy) { + + GetTargetSslProxyHttpRequest request = + GetTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .build(); + return getTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(targetSslProxy.toString());
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetSslProxy getTargetSslProxy(String targetSslProxy) { + + GetTargetSslProxyHttpRequest request = + GetTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy) + .build(); + return getTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .build();
+   *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest request) { + return getTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .build();
+   *   ApiFuture<TargetSslProxy> future = targetSslProxyClient.getTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   TargetSslProxy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetSslProxyCallable() { + return stub.getTargetSslProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(project, targetSslProxyResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetSslProxy(ProjectName project, TargetSslProxy targetSslProxyResource) { + + InsertTargetSslProxyHttpRequest request = + InsertTargetSslProxyHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setTargetSslProxyResource(targetSslProxyResource) + .build(); + return insertTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(project.toString(), targetSslProxyResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetSslProxy(String project, TargetSslProxy targetSslProxyResource) { + + InsertTargetSslProxyHttpRequest request = + InsertTargetSslProxyHttpRequest.newBuilder() + .setProject(project) + .setTargetSslProxyResource(targetSslProxyResource) + .build(); + return insertTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
+   *   InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setTargetSslProxyResource(targetSslProxyResource)
+   *     .build();
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetSslProxy(InsertTargetSslProxyHttpRequest request) { + return insertTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
+   *   InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setTargetSslProxyResource(targetSslProxyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetSslProxyClient.insertTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetSslProxyCallable() { + return stub.insertTargetSslProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetSslProxy element : targetSslProxyClient.listTargetSslProxies(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ProjectName project) { + ListTargetSslProxiesHttpRequest request = + ListTargetSslProxiesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listTargetSslProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetSslProxy element : targetSslProxyClient.listTargetSslProxies(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetSslProxiesPagedResponse listTargetSslProxies(String project) { + ListTargetSslProxiesHttpRequest request = + ListTargetSslProxiesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listTargetSslProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetSslProxiesHttpRequest request = ListTargetSslProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetSslProxy element : targetSslProxyClient.listTargetSslProxies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ListTargetSslProxiesHttpRequest request) { + return listTargetSslProxiesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetSslProxiesHttpRequest request = ListTargetSslProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListTargetSslProxiesPagedResponse> future = targetSslProxyClient.listTargetSslProxiesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetSslProxy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetSslProxiesPagedCallable() { + return stub.listTargetSslProxiesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetSslProxiesHttpRequest request = ListTargetSslProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetSslProxyList response = targetSslProxyClient.listTargetSslProxiesCallable().call(request);
+   *     for (TargetSslProxy element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetSslProxiesCallable() { + return stub.listTargetSslProxiesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param targetSslProxiesSetBackendServiceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackendServiceTargetSslProxy(TargetSslProxyName targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + + SetBackendServiceTargetSslProxyHttpRequest request = + SetBackendServiceTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource) + .build(); + return setBackendServiceTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetBackendServiceRequestResource);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param targetSslProxiesSetBackendServiceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + + SetBackendServiceTargetSslProxyHttpRequest request = + SetBackendServiceTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy) + .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource) + .build(); + return setBackendServiceTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
+   *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource)
+   *     .build();
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackendServiceTargetSslProxy(SetBackendServiceTargetSslProxyHttpRequest request) { + return setBackendServiceTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
+   *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetSslProxyClient.setBackendServiceTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setBackendServiceTargetSslProxyCallable() { + return stub.setBackendServiceTargetSslProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param targetSslProxiesSetProxyHeaderRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setProxyHeaderTargetSslProxy(TargetSslProxyName targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + + SetProxyHeaderTargetSslProxyHttpRequest request = + SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource) + .build(); + return setProxyHeaderTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetProxyHeaderRequestResource);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param targetSslProxiesSetProxyHeaderRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + + SetProxyHeaderTargetSslProxyHttpRequest request = + SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy) + .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource) + .build(); + return setProxyHeaderTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource)
+   *     .build();
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setProxyHeaderTargetSslProxy(SetProxyHeaderTargetSslProxyHttpRequest request) { + return setProxyHeaderTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetSslProxyClient.setProxyHeaderTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setProxyHeaderTargetSslProxyCallable() { + return stub.setProxyHeaderTargetSslProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes SslCertificates for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param targetSslProxiesSetSslCertificatesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslCertificatesTargetSslProxy(TargetSslProxyName targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + + SetSslCertificatesTargetSslProxyHttpRequest request = + SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource) + .build(); + return setSslCertificatesTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes SslCertificates for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetSslCertificatesRequestResource);
+   * }
+   * 
+ * + * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param targetSslProxiesSetSslCertificatesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + + SetSslCertificatesTargetSslProxyHttpRequest request = + SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy) + .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource) + .build(); + return setSslCertificatesTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes SslCertificates for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource)
+   *     .build();
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslCertificatesTargetSslProxy(SetSslCertificatesTargetSslProxyHttpRequest request) { + return setSslCertificatesTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes SslCertificates for TargetSslProxy. + * + * Sample code: + *

+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
+   *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetSslProxyClient.setSslCertificatesTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setSslCertificatesTargetSslProxyCallable() { + return stub.setSslCertificatesTargetSslProxyCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTargetSslProxiesPagedResponse extends AbstractPagedListResponse< + ListTargetSslProxiesHttpRequest, + TargetSslProxyList, + TargetSslProxy, + ListTargetSslProxiesPage, + ListTargetSslProxiesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetSslProxiesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetSslProxiesPagedResponse apply(ListTargetSslProxiesPage input) { + return new ListTargetSslProxiesPagedResponse(input); + } + }); + } + + private ListTargetSslProxiesPagedResponse(ListTargetSslProxiesPage page) { + super(page, ListTargetSslProxiesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetSslProxiesPage extends AbstractPage< + ListTargetSslProxiesHttpRequest, + TargetSslProxyList, + TargetSslProxy, + ListTargetSslProxiesPage> { + + private ListTargetSslProxiesPage( + PageContext context, + TargetSslProxyList response) { + super(context, response); + } + + private static ListTargetSslProxiesPage createEmptyPage() { + return new ListTargetSslProxiesPage(null, null); + } + + @Override + protected ListTargetSslProxiesPage createPage( + PageContext context, + TargetSslProxyList response) { + return new ListTargetSslProxiesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetSslProxiesFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetSslProxiesHttpRequest, + TargetSslProxyList, + TargetSslProxy, + ListTargetSslProxiesPage, + ListTargetSslProxiesFixedSizeCollection> { + + private ListTargetSslProxiesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetSslProxiesFixedSizeCollection createEmptyCollection() { + return new ListTargetSslProxiesFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetSslProxiesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetSslProxiesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java new file mode 100644 index 000000000000..e2ae4b43c25b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetSslProxyList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetSslProxyList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetSslProxyList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetSslProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetSslProxyList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetSslProxyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetSslProxyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetSslProxyList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetSslProxyList other) { + if (other == TargetSslProxyList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetSslProxyList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetSslProxy items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetSslProxyList build() { + + + + + return new TargetSslProxyList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetSslProxyList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetSslProxyList) { + TargetSslProxyList that = (TargetSslProxyList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java new file mode 100644 index 000000000000..fd411b8c3b6f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetSslProxyName implements ResourceName { + private final String project; + private final String targetSslProxy; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/targetSslProxies/{targetSslProxy}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetSslProxyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + targetSslProxy = Preconditions.checkNotNull(builder.getTargetSslProxy()); + } + + public static TargetSslProxyName of( + String project, + String targetSslProxy + ) { + return newBuilder() + .setProject(project) + .setTargetSslProxy(targetSslProxy) + .build(); + } + + public static String format( + String project, + String targetSslProxy + ) { + return of( + project, + targetSslProxy + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("targetSslProxy", targetSslProxy); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetSslProxyName parse(String formattedString) {return TargetSslProxyName.parse(formattedString);} + }; + } + + public static TargetSslProxyName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetSslProxyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("targetSslProxy") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String targetSslProxy; + + public String getProject() { + return project; + } + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + private Builder() {} + + public Builder (TargetSslProxyName targetSslProxyName) { + project = targetSslProxyName.project; + targetSslProxy = targetSslProxyName.targetSslProxy; + } + + public TargetSslProxyName build() { + return new TargetSslProxyName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "targetSslProxy", targetSslProxy + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetSslProxyName) { + TargetSslProxyName that = (TargetSslProxyName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + targetSslProxy + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java new file mode 100644 index 000000000000..1c1d9d9dac1b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import com.google.cloud.compute.v1.stub.TargetSslProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetSslProxyClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetSslProxy to 30 seconds: + * + *

+ * 
+ * TargetSslProxySettings.Builder targetSslProxySettingsBuilder =
+ *     TargetSslProxySettings.newBuilder();
+ * targetSslProxySettingsBuilder.deleteTargetSslProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetSslProxySettings targetSslProxySettings = targetSslProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetSslProxySettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteTargetSslProxy. + */ + public UnaryCallSettings deleteTargetSslProxySettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).deleteTargetSslProxySettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetSslProxy. + */ + public UnaryCallSettings getTargetSslProxySettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).getTargetSslProxySettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetSslProxy. + */ + public UnaryCallSettings insertTargetSslProxySettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).insertTargetSslProxySettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetSslProxies. + */ + public PagedCallSettings listTargetSslProxiesSettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).listTargetSslProxiesSettings(); + } + + /** + * Returns the object with the settings used for calls to setBackendServiceTargetSslProxy. + */ + public UnaryCallSettings setBackendServiceTargetSslProxySettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).setBackendServiceTargetSslProxySettings(); + } + + /** + * Returns the object with the settings used for calls to setProxyHeaderTargetSslProxy. + */ + public UnaryCallSettings setProxyHeaderTargetSslProxySettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).setProxyHeaderTargetSslProxySettings(); + } + + /** + * Returns the object with the settings used for calls to setSslCertificatesTargetSslProxy. + */ + public UnaryCallSettings setSslCertificatesTargetSslProxySettings() { + return ((TargetSslProxyStubSettings) getStubSettings()).setSslCertificatesTargetSslProxySettings(); + } + + + public static final TargetSslProxySettings create(TargetSslProxyStubSettings stub) throws IOException { + return new TargetSslProxySettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetSslProxyStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetSslProxyStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetSslProxyStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetSslProxyStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetSslProxyStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetSslProxyStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetSslProxyStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetSslProxyStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetSslProxySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetSslProxySettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetSslProxyStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetSslProxyStubSettings.newBuilder()); + } + + protected Builder(TargetSslProxySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetSslProxyStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetSslProxyStubSettings.Builder getStubSettingsBuilder() { + return ((TargetSslProxyStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetSslProxy. + */ + public UnaryCallSettings.Builder deleteTargetSslProxySettings() { + return getStubSettingsBuilder().deleteTargetSslProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetSslProxy. + */ + public UnaryCallSettings.Builder getTargetSslProxySettings() { + return getStubSettingsBuilder().getTargetSslProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetSslProxy. + */ + public UnaryCallSettings.Builder insertTargetSslProxySettings() { + return getStubSettingsBuilder().insertTargetSslProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetSslProxies. + */ + public PagedCallSettings.Builder listTargetSslProxiesSettings() { + return getStubSettingsBuilder().listTargetSslProxiesSettings(); + } + + /** + * Returns the builder for the settings used for calls to setBackendServiceTargetSslProxy. + */ + public UnaryCallSettings.Builder setBackendServiceTargetSslProxySettings() { + return getStubSettingsBuilder().setBackendServiceTargetSslProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to setProxyHeaderTargetSslProxy. + */ + public UnaryCallSettings.Builder setProxyHeaderTargetSslProxySettings() { + return getStubSettingsBuilder().setProxyHeaderTargetSslProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to setSslCertificatesTargetSslProxy. + */ + public UnaryCallSettings.Builder setSslCertificatesTargetSslProxySettings() { + return getStubSettingsBuilder().setSslCertificatesTargetSslProxySettings(); + } + + @Override + public TargetSslProxySettings build() throws IOException { + return new TargetSslProxySettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java new file mode 100644 index 000000000000..7b182e775054 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetVpnGateway implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final List forwardingRules; + private final String id; + private final String kind; + private final String name; + private final String network; + private final String region; + private final String selfLink; + private final String status; + private final List tunnels; + + private TargetVpnGateway() { + this.creationTimestamp = null; + this.description = null; + this.forwardingRules = null; + this.id = null; + this.kind = null; + this.name = null; + this.network = null; + this.region = null; + this.selfLink = null; + this.status = null; + this.tunnels = null; + } + + + private TargetVpnGateway( + String creationTimestamp, + String description, + List forwardingRules, + String id, + String kind, + String name, + String network, + String region, + String selfLink, + String status, + List tunnels + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.forwardingRules = forwardingRules; + this.id = id; + this.kind = kind; + this.name = name; + this.network = network; + this.region = region; + this.selfLink = selfLink; + this.status = status; + this.tunnels = tunnels; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("forwardingRules") && forwardingRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : forwardingRules) { + stringList.add(item.toString()); + } + fieldMap.put("forwardingRules", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("tunnels") && tunnels != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : tunnels) { + stringList.add(item.toString()); + } + fieldMap.put("tunnels", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("forwardingRules")) { + return String.valueOf(forwardingRules); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("tunnels")) { + return String.valueOf(tunnels); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public List getForwardingRulesList() { + return forwardingRules; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNetwork() { + return network; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStatus() { + return status; + } + + public List getTunnelsList() { + return tunnels; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetVpnGateway prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetVpnGateway getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetVpnGateway DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetVpnGateway(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private List forwardingRules; + private String id; + private String kind; + private String name; + private String network; + private String region; + private String selfLink; + private String status; + private List tunnels; + + Builder() {} + + public Builder mergeFrom(TargetVpnGateway other) { + if (other == TargetVpnGateway.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getForwardingRulesList() != null) { + this.forwardingRules = other.forwardingRules; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getTunnelsList() != null) { + this.tunnels = other.tunnels; + } + return this; + } + + Builder(TargetVpnGateway source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.forwardingRules = source.forwardingRules; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.network = source.network; + this.region = source.region; + this.selfLink = source.selfLink; + this.status = source.status; + this.tunnels = source.tunnels; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getForwardingRulesList() { + return forwardingRules; + } + + public Builder addAllForwardingRules(List forwardingRules) { + if (this.forwardingRules == null) { + this.forwardingRules = new ArrayList<>(forwardingRules.size()); + } + this.forwardingRules.addAll(forwardingRules); + return this; + } + + public Builder addForwardingRules(String forwardingRules) { + this.forwardingRules.add(forwardingRules); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public List getTunnelsList() { + return tunnels; + } + + public Builder addAllTunnels(List tunnels) { + if (this.tunnels == null) { + this.tunnels = new ArrayList<>(tunnels.size()); + } + this.tunnels.addAll(tunnels); + return this; + } + + public Builder addTunnels(String tunnels) { + this.tunnels.add(tunnels); + return this; + } + + + public TargetVpnGateway build() { + + + + + + + + + + + return new TargetVpnGateway( + creationTimestamp, + description, + forwardingRules, + id, + kind, + name, + network, + region, + selfLink, + status, + tunnels + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.addAllForwardingRules(this.forwardingRules); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNetwork(this.network); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); + newBuilder.addAllTunnels(this.tunnels); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetVpnGateway{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "forwardingRules=" + forwardingRules + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "network=" + network + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "status=" + status + ", " + + "tunnels=" + tunnels + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetVpnGateway) { + TargetVpnGateway that = (TargetVpnGateway) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.forwardingRules, that.getForwardingRulesList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.tunnels, that.getTunnelsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + forwardingRules, + id, + kind, + name, + network, + region, + selfLink, + status, + tunnels + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java new file mode 100644 index 000000000000..0c96312cb6f1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetVpnGatewayAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetVpnGatewayAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetVpnGatewayAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetVpnGatewayAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetVpnGatewayAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetVpnGatewayAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetVpnGatewayAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetVpnGatewayAggregatedList other) { + if (other == TargetVpnGatewayAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetVpnGatewayAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetVpnGatewayAggregatedList build() { + + + + + return new TargetVpnGatewayAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetVpnGatewayAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetVpnGatewayAggregatedList) { + TargetVpnGatewayAggregatedList that = (TargetVpnGatewayAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java new file mode 100644 index 000000000000..a10c1f1ef8c1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java @@ -0,0 +1,936 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.TargetVpnGatewayStub; +import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+ *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+ *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetVpnGatewaySettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetVpnGatewaySettings targetVpnGatewaySettings =
+ *     TargetVpnGatewaySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetVpnGatewayClient targetVpnGatewayClient =
+ *     TargetVpnGatewayClient.create(targetVpnGatewaySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetVpnGatewaySettings targetVpnGatewaySettings =
+ *     TargetVpnGatewaySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetVpnGatewayClient targetVpnGatewayClient =
+ *     TargetVpnGatewayClient.create(targetVpnGatewaySettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetVpnGatewayClient implements BackgroundResource { + private final TargetVpnGatewaySettings settings; + private final TargetVpnGatewayStub stub; + + + + /** + * Constructs an instance of TargetVpnGatewayClient with default settings. + */ + public static final TargetVpnGatewayClient create() throws IOException { + return create(TargetVpnGatewaySettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetVpnGatewayClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings) throws IOException { + return new TargetVpnGatewayClient(settings); + } + + /** + * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetVpnGatewaySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) { + return new TargetVpnGatewayClient(stub); + } + + /** + * Constructs an instance of TargetVpnGatewayClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetVpnGatewayClient(TargetVpnGatewaySettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetVpnGatewayStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetVpnGatewayClient(TargetVpnGatewayStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetVpnGatewaySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetVpnGatewayStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target VPN gateways. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetVpnGatewaysScopedList element : targetVpnGatewayClient.aggregatedListTargetVpnGateways(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(ProjectName project) { + AggregatedListTargetVpnGatewaysHttpRequest request = + AggregatedListTargetVpnGatewaysHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListTargetVpnGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target VPN gateways. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetVpnGatewaysScopedList element : targetVpnGatewayClient.aggregatedListTargetVpnGateways(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(String project) { + AggregatedListTargetVpnGatewaysHttpRequest request = + AggregatedListTargetVpnGatewaysHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListTargetVpnGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target VPN gateways. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetVpnGatewaysHttpRequest request = AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetVpnGatewaysScopedList element : targetVpnGatewayClient.aggregatedListTargetVpnGateways(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(AggregatedListTargetVpnGatewaysHttpRequest request) { + return aggregatedListTargetVpnGatewaysPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target VPN gateways. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetVpnGatewaysHttpRequest request = AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListTargetVpnGatewaysPagedResponse> future = targetVpnGatewayClient.aggregatedListTargetVpnGatewaysPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetVpnGatewaysScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { + return stub.aggregatedListTargetVpnGatewaysPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of target VPN gateways. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListTargetVpnGatewaysHttpRequest request = AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetVpnGatewayAggregatedList response = targetVpnGatewayClient.aggregatedListTargetVpnGatewaysCallable().call(request);
+   *     for (TargetVpnGatewaysScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListTargetVpnGatewaysCallable() { + return stub.aggregatedListTargetVpnGatewaysCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target VPN gateway. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
+   * }
+   * 
+ * + * @param targetVpnGateway Name of the target VPN gateway to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetVpnGateway(TargetVpnGatewayName targetVpnGateway) { + + DeleteTargetVpnGatewayHttpRequest request = + DeleteTargetVpnGatewayHttpRequest.newBuilder() + .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) + .build(); + return deleteTargetVpnGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target VPN gateway. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway.toString());
+   * }
+   * 
+ * + * @param targetVpnGateway Name of the target VPN gateway to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetVpnGateway(String targetVpnGateway) { + + DeleteTargetVpnGatewayHttpRequest request = + DeleteTargetVpnGatewayHttpRequest.newBuilder() + .setTargetVpnGateway(targetVpnGateway) + .build(); + return deleteTargetVpnGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target VPN gateway. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setTargetVpnGateway(targetVpnGateway.toString())
+   *     .build();
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest request) { + return deleteTargetVpnGatewayCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified target VPN gateway. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setTargetVpnGateway(targetVpnGateway.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetVpnGatewayClient.deleteTargetVpnGatewayCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetVpnGatewayCallable() { + return stub.deleteTargetVpnGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   TargetVpnGateway response = targetVpnGatewayClient.getTargetVpnGateway(targetVpnGateway);
+   * }
+   * 
+ * + * @param targetVpnGateway Name of the target VPN gateway to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpnGateway) { + + GetTargetVpnGatewayHttpRequest request = + GetTargetVpnGatewayHttpRequest.newBuilder() + .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) + .build(); + return getTargetVpnGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   TargetVpnGateway response = targetVpnGatewayClient.getTargetVpnGateway(targetVpnGateway.toString());
+   * }
+   * 
+ * + * @param targetVpnGateway Name of the target VPN gateway to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetVpnGateway getTargetVpnGateway(String targetVpnGateway) { + + GetTargetVpnGatewayHttpRequest request = + GetTargetVpnGatewayHttpRequest.newBuilder() + .setTargetVpnGateway(targetVpnGateway) + .build(); + return getTargetVpnGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   GetTargetVpnGatewayHttpRequest request = GetTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setTargetVpnGateway(targetVpnGateway.toString())
+   *     .build();
+   *   TargetVpnGateway response = targetVpnGatewayClient.getTargetVpnGateway(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest request) { + return getTargetVpnGatewayCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   GetTargetVpnGatewayHttpRequest request = GetTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setTargetVpnGateway(targetVpnGateway.toString())
+   *     .build();
+   *   ApiFuture<TargetVpnGateway> future = targetVpnGatewayClient.getTargetVpnGatewayCallable().futureCall(request);
+   *   // Do something
+   *   TargetVpnGateway response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetVpnGatewayCallable() { + return stub.getTargetVpnGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(region, targetVpnGatewayResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param targetVpnGatewayResource Represents a Target VPN gateway resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetVpnGateway(RegionName region, TargetVpnGateway targetVpnGatewayResource) { + + InsertTargetVpnGatewayHttpRequest request = + InsertTargetVpnGatewayHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setTargetVpnGatewayResource(targetVpnGatewayResource) + .build(); + return insertTargetVpnGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(region.toString(), targetVpnGatewayResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param targetVpnGatewayResource Represents a Target VPN gateway resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetVpnGateway(String region, TargetVpnGateway targetVpnGatewayResource) { + + InsertTargetVpnGatewayHttpRequest request = + InsertTargetVpnGatewayHttpRequest.newBuilder() + .setRegion(region) + .setTargetVpnGatewayResource(targetVpnGatewayResource) + .build(); + return insertTargetVpnGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
+   *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setTargetVpnGatewayResource(targetVpnGatewayResource)
+   *     .build();
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest request) { + return insertTargetVpnGatewayCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
+   *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setTargetVpnGatewayResource(targetVpnGatewayResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetVpnGatewayClient.insertTargetVpnGatewayCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetVpnGatewayCallable() { + return stub.insertTargetVpnGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (TargetVpnGateway element : targetVpnGatewayClient.listTargetVpnGateways(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName region) { + ListTargetVpnGatewaysHttpRequest request = + ListTargetVpnGatewaysHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listTargetVpnGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (TargetVpnGateway element : targetVpnGatewayClient.listTargetVpnGateways(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String region) { + ListTargetVpnGatewaysHttpRequest request = + ListTargetVpnGatewaysHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listTargetVpnGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListTargetVpnGatewaysHttpRequest request = ListTargetVpnGatewaysHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (TargetVpnGateway element : targetVpnGatewayClient.listTargetVpnGateways(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTargetVpnGatewaysHttpRequest request) { + return listTargetVpnGatewaysPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListTargetVpnGatewaysHttpRequest request = ListTargetVpnGatewaysHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListTargetVpnGatewaysPagedResponse> future = targetVpnGatewayClient.listTargetVpnGatewaysPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetVpnGateway element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetVpnGatewaysPagedCallable() { + return stub.listTargetVpnGatewaysPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * Sample code: + *

+   * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListTargetVpnGatewaysHttpRequest request = ListTargetVpnGatewaysHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetVpnGatewayList response = targetVpnGatewayClient.listTargetVpnGatewaysCallable().call(request);
+   *     for (TargetVpnGateway element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetVpnGatewaysCallable() { + return stub.listTargetVpnGatewaysCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListTargetVpnGatewaysPagedResponse apply(AggregatedListTargetVpnGatewaysPage input) { + return new AggregatedListTargetVpnGatewaysPagedResponse(input); + } + }); + } + + private AggregatedListTargetVpnGatewaysPagedResponse(AggregatedListTargetVpnGatewaysPage page) { + super(page, AggregatedListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListTargetVpnGatewaysPage extends AbstractPage< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage> { + + private AggregatedListTargetVpnGatewaysPage( + PageContext context, + TargetVpnGatewayAggregatedList response) { + super(context, response); + } + + private static AggregatedListTargetVpnGatewaysPage createEmptyPage() { + return new AggregatedListTargetVpnGatewaysPage(null, null); + } + + @Override + protected AggregatedListTargetVpnGatewaysPage createPage( + PageContext context, + TargetVpnGatewayAggregatedList response) { + return new AggregatedListTargetVpnGatewaysPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { + + private AggregatedListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListTargetVpnGatewaysFixedSizeCollection createEmptyCollection() { + return new AggregatedListTargetVpnGatewaysFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListTargetVpnGatewaysFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage, + ListTargetVpnGatewaysFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetVpnGatewaysPagedResponse apply(ListTargetVpnGatewaysPage input) { + return new ListTargetVpnGatewaysPagedResponse(input); + } + }); + } + + private ListTargetVpnGatewaysPagedResponse(ListTargetVpnGatewaysPage page) { + super(page, ListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetVpnGatewaysPage extends AbstractPage< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage> { + + private ListTargetVpnGatewaysPage( + PageContext context, + TargetVpnGatewayList response) { + super(context, response); + } + + private static ListTargetVpnGatewaysPage createEmptyPage() { + return new ListTargetVpnGatewaysPage(null, null); + } + + @Override + protected ListTargetVpnGatewaysPage createPage( + PageContext context, + TargetVpnGatewayList response) { + return new ListTargetVpnGatewaysPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage, + ListTargetVpnGatewaysFixedSizeCollection> { + + private ListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetVpnGatewaysFixedSizeCollection createEmptyCollection() { + return new ListTargetVpnGatewaysFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetVpnGatewaysFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java new file mode 100644 index 000000000000..da5a02f82bd8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetVpnGatewayList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private TargetVpnGatewayList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private TargetVpnGatewayList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetVpnGateway item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetVpnGatewayList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetVpnGatewayList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetVpnGatewayList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetVpnGatewayList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(TargetVpnGatewayList other) { + if (other == TargetVpnGatewayList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(TargetVpnGatewayList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetVpnGateway items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public TargetVpnGatewayList build() { + + + + + return new TargetVpnGatewayList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetVpnGatewayList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetVpnGatewayList) { + TargetVpnGatewayList that = (TargetVpnGatewayList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java new file mode 100644 index 000000000000..7cf01894ec7a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetVpnGatewayName implements ResourceName { + private final String project; + private final String region; + private final String targetVpnGateway; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetVpnGatewayName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + targetVpnGateway = Preconditions.checkNotNull(builder.getTargetVpnGateway()); + } + + public static TargetVpnGatewayName of( + String project, + String region, + String targetVpnGateway + ) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setTargetVpnGateway(targetVpnGateway) + .build(); + } + + public static String format( + String project, + String region, + String targetVpnGateway + ) { + return of( + project, + region, + targetVpnGateway + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("targetVpnGateway", targetVpnGateway); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetVpnGatewayName parse(String formattedString) {return TargetVpnGatewayName.parse(formattedString);} + }; + } + + public static TargetVpnGatewayName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetVpnGatewayName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("region"), + matchMap.get("targetVpnGateway") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String targetVpnGateway; + + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + public Builder setTargetVpnGateway(String targetVpnGateway) { + this.targetVpnGateway = targetVpnGateway; + return this; + } + + private Builder() {} + + public Builder (TargetVpnGatewayName targetVpnGatewayName) { + project = targetVpnGatewayName.project; + region = targetVpnGatewayName.region; + targetVpnGateway = targetVpnGatewayName.targetVpnGateway; + } + + public TargetVpnGatewayName build() { + return new TargetVpnGatewayName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "targetVpnGateway", targetVpnGateway + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetVpnGatewayName) { + TargetVpnGatewayName that = (TargetVpnGatewayName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + region, + targetVpnGateway + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java new file mode 100644 index 000000000000..db93426cdc41 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetVpnGatewayClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetVpnGateway to 30 seconds: + * + *

+ * 
+ * TargetVpnGatewaySettings.Builder targetVpnGatewaySettingsBuilder =
+ *     TargetVpnGatewaySettings.newBuilder();
+ * targetVpnGatewaySettingsBuilder.deleteTargetVpnGatewaySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetVpnGatewaySettings targetVpnGatewaySettings = targetVpnGatewaySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetVpnGatewaySettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListTargetVpnGateways. + */ + public PagedCallSettings aggregatedListTargetVpnGatewaysSettings() { + return ((TargetVpnGatewayStubSettings) getStubSettings()).aggregatedListTargetVpnGatewaysSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteTargetVpnGateway. + */ + public UnaryCallSettings deleteTargetVpnGatewaySettings() { + return ((TargetVpnGatewayStubSettings) getStubSettings()).deleteTargetVpnGatewaySettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetVpnGateway. + */ + public UnaryCallSettings getTargetVpnGatewaySettings() { + return ((TargetVpnGatewayStubSettings) getStubSettings()).getTargetVpnGatewaySettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetVpnGateway. + */ + public UnaryCallSettings insertTargetVpnGatewaySettings() { + return ((TargetVpnGatewayStubSettings) getStubSettings()).insertTargetVpnGatewaySettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetVpnGateways. + */ + public PagedCallSettings listTargetVpnGatewaysSettings() { + return ((TargetVpnGatewayStubSettings) getStubSettings()).listTargetVpnGatewaysSettings(); + } + + + public static final TargetVpnGatewaySettings create(TargetVpnGatewayStubSettings stub) throws IOException { + return new TargetVpnGatewaySettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetVpnGatewayStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetVpnGatewayStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetVpnGatewayStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetVpnGatewayStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetVpnGatewayStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetVpnGatewayStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetVpnGatewayStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetVpnGatewayStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetVpnGatewaySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetVpnGatewaySettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetVpnGatewayStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetVpnGatewayStubSettings.newBuilder()); + } + + protected Builder(TargetVpnGatewaySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetVpnGatewayStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetVpnGatewayStubSettings.Builder getStubSettingsBuilder() { + return ((TargetVpnGatewayStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListTargetVpnGateways. + */ + public PagedCallSettings.Builder aggregatedListTargetVpnGatewaysSettings() { + return getStubSettingsBuilder().aggregatedListTargetVpnGatewaysSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteTargetVpnGateway. + */ + public UnaryCallSettings.Builder deleteTargetVpnGatewaySettings() { + return getStubSettingsBuilder().deleteTargetVpnGatewaySettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetVpnGateway. + */ + public UnaryCallSettings.Builder getTargetVpnGatewaySettings() { + return getStubSettingsBuilder().getTargetVpnGatewaySettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetVpnGateway. + */ + public UnaryCallSettings.Builder insertTargetVpnGatewaySettings() { + return getStubSettingsBuilder().insertTargetVpnGatewaySettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetVpnGateways. + */ + public PagedCallSettings.Builder listTargetVpnGatewaysSettings() { + return getStubSettingsBuilder().listTargetVpnGatewaysSettings(); + } + + @Override + public TargetVpnGatewaySettings build() throws IOException { + return new TargetVpnGatewaySettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java new file mode 100644 index 000000000000..48ed9f78bf64 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetVpnGatewaysScopedList implements ApiMessage { + private final List targetVpnGateways; + private final Warning warning; + + private TargetVpnGatewaysScopedList() { + this.targetVpnGateways = null; + this.warning = null; + } + + + private TargetVpnGatewaysScopedList( + List targetVpnGateways, + Warning warning + ) { + this.targetVpnGateways = targetVpnGateways; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("targetVpnGateways") && targetVpnGateways != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetVpnGateway item : targetVpnGateways) { + stringList.add(item.toString()); + } + fieldMap.put("targetVpnGateways", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("targetVpnGateways")) { + return String.valueOf(targetVpnGateways); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getTargetVpnGatewaysList() { + return targetVpnGateways; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetVpnGatewaysScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetVpnGatewaysScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetVpnGatewaysScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetVpnGatewaysScopedList(); + } + + public static class Builder { + private List targetVpnGateways; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(TargetVpnGatewaysScopedList other) { + if (other == TargetVpnGatewaysScopedList.getDefaultInstance()) return this; + if (other.getTargetVpnGatewaysList() != null) { + this.targetVpnGateways = other.targetVpnGateways; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(TargetVpnGatewaysScopedList source) { + this.targetVpnGateways = source.targetVpnGateways; + this.warning = source.warning; + } + + public List getTargetVpnGatewaysList() { + return targetVpnGateways; + } + + public Builder addAllTargetVpnGateways(List targetVpnGateways) { + if (this.targetVpnGateways == null) { + this.targetVpnGateways = new ArrayList<>(targetVpnGateways.size()); + } + this.targetVpnGateways.addAll(targetVpnGateways); + return this; + } + + public Builder addTargetVpnGateways(TargetVpnGateway targetVpnGateways) { + this.targetVpnGateways.add(targetVpnGateways); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public TargetVpnGatewaysScopedList build() { + + return new TargetVpnGatewaysScopedList( + targetVpnGateways, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllTargetVpnGateways(this.targetVpnGateways); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetVpnGatewaysScopedList{" + + "targetVpnGateways=" + targetVpnGateways + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetVpnGatewaysScopedList) { + TargetVpnGatewaysScopedList that = (TargetVpnGatewaysScopedList) o; + return + Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + targetVpnGateways, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java new file mode 100644 index 000000000000..81730c434638 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TestFailure implements ApiMessage { + private final String actualService; + private final String expectedService; + private final String host; + private final String path; + + private TestFailure() { + this.actualService = null; + this.expectedService = null; + this.host = null; + this.path = null; + } + + + private TestFailure( + String actualService, + String expectedService, + String host, + String path + ) { + this.actualService = actualService; + this.expectedService = expectedService; + this.host = host; + this.path = path; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("actualService") && actualService != null) { + fieldMap.put("actualService", Collections.singletonList(String.valueOf(actualService))); + } + if (fieldNames.contains("expectedService") && expectedService != null) { + fieldMap.put("expectedService", Collections.singletonList(String.valueOf(expectedService))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("path") && path != null) { + fieldMap.put("path", Collections.singletonList(String.valueOf(path))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("actualService")) { + return String.valueOf(actualService); + } + if (fieldName.equals("expectedService")) { + return String.valueOf(expectedService); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("path")) { + return String.valueOf(path); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getActualService() { + return actualService; + } + + public String getExpectedService() { + return expectedService; + } + + public String getHost() { + return host; + } + + public String getPath() { + return path; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TestFailure prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestFailure getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TestFailure DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TestFailure(); + } + + public static class Builder { + private String actualService; + private String expectedService; + private String host; + private String path; + + Builder() {} + + public Builder mergeFrom(TestFailure other) { + if (other == TestFailure.getDefaultInstance()) return this; + if (other.getActualService() != null) { + this.actualService = other.actualService; + } + if (other.getExpectedService() != null) { + this.expectedService = other.expectedService; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPath() != null) { + this.path = other.path; + } + return this; + } + + Builder(TestFailure source) { + this.actualService = source.actualService; + this.expectedService = source.expectedService; + this.host = source.host; + this.path = source.path; + } + + public String getActualService() { + return actualService; + } + + public Builder setActualService(String actualService) { + this.actualService = actualService; + return this; + } + + public String getExpectedService() { + return expectedService; + } + + public Builder setExpectedService(String expectedService) { + this.expectedService = expectedService; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getPath() { + return path; + } + + public Builder setPath(String path) { + this.path = path; + return this; + } + + + public TestFailure build() { + + + + return new TestFailure( + actualService, + expectedService, + host, + path + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setActualService(this.actualService); + newBuilder.setExpectedService(this.expectedService); + newBuilder.setHost(this.host); + newBuilder.setPath(this.path); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestFailure{" + + "actualService=" + actualService + ", " + + "expectedService=" + expectedService + ", " + + "host=" + host + ", " + + "path=" + path + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestFailure) { + TestFailure that = (TestFailure) o; + return + Objects.equals(this.actualService, that.getActualService()) && + Objects.equals(this.expectedService, that.getExpectedService()) && + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.path, that.getPath()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + actualService, + expectedService, + host, + path + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java new file mode 100644 index 000000000000..5069f79fd234 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final Autoscaler autoscalerResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private UpdateAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.autoscalerResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private UpdateAutoscalerHttpRequest( + String access_token, + String autoscaler, + Autoscaler autoscalerResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.autoscalerResource = autoscalerResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("autoscalerResource")) { + return String.valueOf(autoscalerResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public Autoscaler getApiMessageRequestBody() { + return autoscalerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private Autoscaler autoscalerResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { + if (other == UpdateAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getAutoscalerResource() != null) { + this.autoscalerResource = other.autoscalerResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(UpdateAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.autoscalerResource = source.autoscalerResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public Builder setAutoscalerResource(Autoscaler autoscalerResource) { + this.autoscalerResource = autoscalerResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public UpdateAutoscalerHttpRequest build() { + String missing = ""; + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateAutoscalerHttpRequest( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setAutoscalerResource(this.autoscalerResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateAutoscalerHttpRequest) { + UpdateAutoscalerHttpRequest that = (UpdateAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java new file mode 100644 index 000000000000..64ef351ce193 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final BackendService backendServiceResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private UpdateBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.backendServiceResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private UpdateBackendServiceHttpRequest( + String access_token, + String backendService, + BackendService backendServiceResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.backendServiceResource = backendServiceResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("backendServiceResource")) { + return String.valueOf(backendServiceResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendService getApiMessageRequestBody() { + return backendServiceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private BackendService backendServiceResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { + if (other == UpdateBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getBackendServiceResource() != null) { + this.backendServiceResource = other.backendServiceResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.backendServiceResource = source.backendServiceResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public Builder setBackendServiceResource(BackendService backendServiceResource) { + this.backendServiceResource = backendServiceResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateBackendServiceHttpRequest( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setBackendServiceResource(this.backendServiceResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "backendServiceResource=" + backendServiceResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateBackendServiceHttpRequest) { + UpdateBackendServiceHttpRequest that = (UpdateBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java new file mode 100644 index 000000000000..53827e96d236 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateFirewallHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String firewall; + private final Firewall firewallResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private UpdateFirewallHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.firewall = null; + this.firewallResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private UpdateFirewallHttpRequest( + String access_token, + String callback, + String fields, + String firewall, + Firewall firewallResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.firewall = firewall; + this.firewallResource = firewallResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("firewallResource") && firewallResource != null) { + fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("firewall")) { + return String.valueOf(firewall); + } + if (fieldName.equals("firewallResource")) { + return String.valueOf(firewallResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Firewall getApiMessageRequestBody() { + return firewallResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFirewall() { + return firewall; + } + + public Firewall getFirewallResource() { + return firewallResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateFirewallHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateFirewallHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateFirewallHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateFirewallHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String firewall; + private Firewall firewallResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateFirewallHttpRequest other) { + if (other == UpdateFirewallHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFirewall() != null) { + this.firewall = other.firewall; + } + if (other.getFirewallResource() != null) { + this.firewallResource = other.firewallResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateFirewallHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.firewall = source.firewall; + this.firewallResource = source.firewallResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFirewall() { + return firewall; + } + + public Builder setFirewall(String firewall) { + this.firewall = firewall; + return this; + } + + public Firewall getFirewallResource() { + return firewallResource; + } + + public Builder setFirewallResource(Firewall firewallResource) { + this.firewallResource = firewallResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateFirewallHttpRequest build() { + String missing = ""; + + + + if (firewall == null) { + missing += " firewall"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateFirewallHttpRequest( + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFirewall(this.firewall); + newBuilder.setFirewallResource(this.firewallResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateFirewallHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "firewall=" + firewall + ", " + + "firewallResource=" + firewallResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateFirewallHttpRequest) { + UpdateFirewallHttpRequest that = (UpdateFirewallHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.firewall, that.getFirewall()) && + Objects.equals(this.firewallResource, that.getFirewallResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java new file mode 100644 index 000000000000..93b4cb146835 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String healthCheck; + private final HealthCheck healthCheckResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private UpdateHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.healthCheck = null; + this.healthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private UpdateHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String healthCheck, + HealthCheck healthCheckResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.healthCheck = healthCheck; + this.healthCheckResource = healthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { + fieldMap.put("healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("healthCheck")) { + return String.valueOf(healthCheck); + } + if (fieldName.equals("healthCheckResource")) { + return String.valueOf(healthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HealthCheck getApiMessageRequestBody() { + return healthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHealthCheck() { + return healthCheck; + } + + public HealthCheck getHealthCheckResource() { + return healthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String healthCheck; + private HealthCheck healthCheckResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { + if (other == UpdateHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHealthCheck() != null) { + this.healthCheck = other.healthCheck; + } + if (other.getHealthCheckResource() != null) { + this.healthCheckResource = other.healthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.healthCheck = source.healthCheck; + this.healthCheckResource = source.healthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHealthCheck() { + return healthCheck; + } + + public Builder setHealthCheck(String healthCheck) { + this.healthCheck = healthCheck; + return this; + } + + public HealthCheck getHealthCheckResource() { + return healthCheckResource; + } + + public Builder setHealthCheckResource(HealthCheck healthCheckResource) { + this.healthCheckResource = healthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateHealthCheckHttpRequest build() { + String missing = ""; + + + + if (healthCheck == null) { + missing += " healthCheck"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateHealthCheckHttpRequest( + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHealthCheck(this.healthCheck); + newBuilder.setHealthCheckResource(this.healthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "healthCheck=" + healthCheck + ", " + + "healthCheckResource=" + healthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateHealthCheckHttpRequest) { + UpdateHealthCheckHttpRequest that = (UpdateHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.healthCheck, that.getHealthCheck()) && + Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java new file mode 100644 index 000000000000..c28c311f1643 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpHealthCheck; + private final HttpHealthCheck httpHealthCheckResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private UpdateHttpHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpHealthCheck = null; + this.httpHealthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private UpdateHttpHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpHealthCheck, + HttpHealthCheck httpHealthCheckResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpHealthCheck = httpHealthCheck; + this.httpHealthCheckResource = httpHealthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { + fieldMap.put("httpHealthCheckResource", Collections.singletonList(String.valueOf(httpHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpHealthCheck")) { + return String.valueOf(httpHealthCheck); + } + if (fieldName.equals("httpHealthCheckResource")) { + return String.valueOf(httpHealthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HttpHealthCheck getApiMessageRequestBody() { + return httpHealthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public HttpHealthCheck getHttpHealthCheckResource() { + return httpHealthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateHttpHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateHttpHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateHttpHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpHealthCheck; + private HttpHealthCheck httpHealthCheckResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { + if (other == UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpHealthCheck() != null) { + this.httpHealthCheck = other.httpHealthCheck; + } + if (other.getHttpHealthCheckResource() != null) { + this.httpHealthCheckResource = other.httpHealthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateHttpHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpHealthCheck = source.httpHealthCheck; + this.httpHealthCheckResource = source.httpHealthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpHealthCheck() { + return httpHealthCheck; + } + + public Builder setHttpHealthCheck(String httpHealthCheck) { + this.httpHealthCheck = httpHealthCheck; + return this; + } + + public HttpHealthCheck getHttpHealthCheckResource() { + return httpHealthCheckResource; + } + + public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + this.httpHealthCheckResource = httpHealthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateHttpHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpHealthCheck == null) { + missing += " httpHealthCheck"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateHttpHealthCheckHttpRequest( + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpHealthCheck(this.httpHealthCheck); + newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateHttpHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpHealthCheck=" + httpHealthCheck + ", " + + "httpHealthCheckResource=" + httpHealthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateHttpHealthCheckHttpRequest) { + UpdateHttpHealthCheckHttpRequest that = (UpdateHttpHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && + Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java new file mode 100644 index 000000000000..de704a2afbfa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String httpsHealthCheck; + private final HttpsHealthCheck httpsHealthCheckResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private UpdateHttpsHealthCheckHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.httpsHealthCheck = null; + this.httpsHealthCheckResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private UpdateHttpsHealthCheckHttpRequest( + String access_token, + String callback, + String fields, + String httpsHealthCheck, + HttpsHealthCheck httpsHealthCheckResource, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.httpsHealthCheck = httpsHealthCheck; + this.httpsHealthCheckResource = httpsHealthCheckResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { + fieldMap.put("httpsHealthCheckResource", Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("httpsHealthCheck")) { + return String.valueOf(httpsHealthCheck); + } + if (fieldName.equals("httpsHealthCheckResource")) { + return String.valueOf(httpsHealthCheckResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public HttpsHealthCheck getApiMessageRequestBody() { + return httpsHealthCheckResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public HttpsHealthCheck getHttpsHealthCheckResource() { + return httpsHealthCheckResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateHttpsHealthCheckHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateHttpsHealthCheckHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateHttpsHealthCheckHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String httpsHealthCheck; + private HttpsHealthCheck httpsHealthCheckResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { + if (other == UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getHttpsHealthCheck() != null) { + this.httpsHealthCheck = other.httpsHealthCheck; + } + if (other.getHttpsHealthCheckResource() != null) { + this.httpsHealthCheckResource = other.httpsHealthCheckResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateHttpsHealthCheckHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.httpsHealthCheck = source.httpsHealthCheck; + this.httpsHealthCheckResource = source.httpsHealthCheckResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getHttpsHealthCheck() { + return httpsHealthCheck; + } + + public Builder setHttpsHealthCheck(String httpsHealthCheck) { + this.httpsHealthCheck = httpsHealthCheck; + return this; + } + + public HttpsHealthCheck getHttpsHealthCheckResource() { + return httpsHealthCheckResource; + } + + public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + this.httpsHealthCheckResource = httpsHealthCheckResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateHttpsHealthCheckHttpRequest build() { + String missing = ""; + + + + if (httpsHealthCheck == null) { + missing += " httpsHealthCheck"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateHttpsHealthCheckHttpRequest( + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); + newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateHttpsHealthCheckHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "httpsHealthCheck=" + httpsHealthCheck + ", " + + "httpsHealthCheckResource=" + httpsHealthCheckResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateHttpsHealthCheckHttpRequest) { + UpdateHttpsHealthCheckHttpRequest that = (UpdateHttpsHealthCheckHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && + Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java new file mode 100644 index 000000000000..13756014148e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage { + private final String access_token; + private final String autoscaler; + private final Autoscaler autoscalerResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private UpdateRegionAutoscalerHttpRequest() { + this.access_token = null; + this.autoscaler = null; + this.autoscalerResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private UpdateRegionAutoscalerHttpRequest( + String access_token, + String autoscaler, + Autoscaler autoscalerResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.autoscaler = autoscaler; + this.autoscalerResource = autoscalerResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("autoscaler")) { + return String.valueOf(autoscaler); + } + if (fieldName.equals("autoscalerResource")) { + return String.valueOf(autoscalerResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Autoscaler getApiMessageRequestBody() { + return autoscalerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateRegionAutoscalerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateRegionAutoscalerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateRegionAutoscalerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String autoscaler; + private Autoscaler autoscalerResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { + if (other == UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getAutoscaler() != null) { + this.autoscaler = other.autoscaler; + } + if (other.getAutoscalerResource() != null) { + this.autoscalerResource = other.autoscalerResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateRegionAutoscalerHttpRequest source) { + this.access_token = source.access_token; + this.autoscaler = source.autoscaler; + this.autoscalerResource = source.autoscalerResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getAutoscaler() { + return autoscaler; + } + + public Builder setAutoscaler(String autoscaler) { + this.autoscaler = autoscaler; + return this; + } + + public Autoscaler getAutoscalerResource() { + return autoscalerResource; + } + + public Builder setAutoscalerResource(Autoscaler autoscalerResource) { + this.autoscalerResource = autoscalerResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateRegionAutoscalerHttpRequest build() { + String missing = ""; + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateRegionAutoscalerHttpRequest( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setAutoscaler(this.autoscaler); + newBuilder.setAutoscalerResource(this.autoscalerResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateRegionAutoscalerHttpRequest{" + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateRegionAutoscalerHttpRequest) { + UpdateRegionAutoscalerHttpRequest that = (UpdateRegionAutoscalerHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java new file mode 100644 index 000000000000..2ce0678a5c59 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage { + private final String access_token; + private final String backendService; + private final BackendService backendServiceResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private UpdateRegionBackendServiceHttpRequest() { + this.access_token = null; + this.backendService = null; + this.backendServiceResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private UpdateRegionBackendServiceHttpRequest( + String access_token, + String backendService, + BackendService backendServiceResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.backendService = backendService; + this.backendServiceResource = backendServiceResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendService")) { + return String.valueOf(backendService); + } + if (fieldName.equals("backendServiceResource")) { + return String.valueOf(backendServiceResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendService getApiMessageRequestBody() { + return backendServiceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendService() { + return backendService; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateRegionBackendServiceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateRegionBackendServiceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateRegionBackendServiceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendService; + private BackendService backendServiceResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { + if (other == UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendService() != null) { + this.backendService = other.backendService; + } + if (other.getBackendServiceResource() != null) { + this.backendServiceResource = other.backendServiceResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateRegionBackendServiceHttpRequest source) { + this.access_token = source.access_token; + this.backendService = source.backendService; + this.backendServiceResource = source.backendServiceResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendService() { + return backendService; + } + + public Builder setBackendService(String backendService) { + this.backendService = backendService; + return this; + } + + public BackendService getBackendServiceResource() { + return backendServiceResource; + } + + public Builder setBackendServiceResource(BackendService backendServiceResource) { + this.backendServiceResource = backendServiceResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateRegionBackendServiceHttpRequest build() { + String missing = ""; + + if (backendService == null) { + missing += " backendService"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateRegionBackendServiceHttpRequest( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendService(this.backendService); + newBuilder.setBackendServiceResource(this.backendServiceResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateRegionBackendServiceHttpRequest{" + + "access_token=" + access_token + ", " + + "backendService=" + backendService + ", " + + "backendServiceResource=" + backendServiceResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateRegionBackendServiceHttpRequest) { + UpdateRegionBackendServiceHttpRequest that = (UpdateRegionBackendServiceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendService, that.getBackendService()) && + Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java new file mode 100644 index 000000000000..8437416d2bc3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateRouterHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String router; + private final Router routerResource; + private final String userIp; + + private UpdateRouterHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.router = null; + this.routerResource = null; + this.userIp = null; + } + + + private UpdateRouterHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String router, + Router routerResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.router = router; + this.routerResource = routerResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("routerResource")) { + return String.valueOf(routerResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Router getApiMessageRequestBody() { + return routerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRouter() { + return router; + } + + public Router getRouterResource() { + return routerResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateRouterHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateRouterHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateRouterHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateRouterHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String router; + private Router routerResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateRouterHttpRequest other) { + if (other == UpdateRouterHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getRouterResource() != null) { + this.routerResource = other.routerResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateRouterHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.router = source.router; + this.routerResource = source.routerResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public Router getRouterResource() { + return routerResource; + } + + public Builder setRouterResource(Router routerResource) { + this.routerResource = routerResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateRouterHttpRequest build() { + String missing = ""; + + + + + + + if (router == null) { + missing += " router"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateRouterHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRouter(this.router); + newBuilder.setRouterResource(this.routerResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateRouterHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "router=" + router + ", " + + "routerResource=" + routerResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateRouterHttpRequest) { + UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.routerResource, that.getRouterResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java new file mode 100644 index 000000000000..873e3c3a264a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String urlMap; + private final UrlMap urlMapResource; + private final String userIp; + + private UpdateUrlMapHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.urlMap = null; + this.urlMapResource = null; + this.userIp = null; + } + + + private UpdateUrlMapHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String urlMap, + UrlMap urlMapResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.urlMap = urlMap; + this.urlMapResource = urlMapResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("urlMapResource") && urlMapResource != null) { + fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + if (fieldName.equals("urlMapResource")) { + return String.valueOf(urlMapResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UrlMap getApiMessageRequestBody() { + return urlMapResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUrlMap() { + return urlMap; + } + + public UrlMap getUrlMapResource() { + return urlMapResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String urlMap; + private UrlMap urlMapResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateUrlMapHttpRequest other) { + if (other == UpdateUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + if (other.getUrlMapResource() != null) { + this.urlMapResource = other.urlMapResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.urlMap = source.urlMap; + this.urlMapResource = source.urlMapResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + public UrlMap getUrlMapResource() { + return urlMapResource; + } + + public Builder setUrlMapResource(UrlMap urlMapResource) { + this.urlMapResource = urlMapResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateUrlMapHttpRequest build() { + String missing = ""; + + + + + + + if (urlMap == null) { + missing += " urlMap"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateUrlMapHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMap(this.urlMap); + newBuilder.setUrlMapResource(this.urlMapResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMap=" + urlMap + ", " + + "urlMapResource=" + urlMapResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateUrlMapHttpRequest) { + UpdateUrlMapHttpRequest that = (UpdateUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMap, that.getUrlMap()) && + Objects.equals(this.urlMapResource, that.getUrlMapResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java new file mode 100644 index 000000000000..7f562f1fad98 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java @@ -0,0 +1,538 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMap implements ApiMessage { + private final String creationTimestamp; + private final String defaultService; + private final String description; + private final String fingerprint; + private final List hostRules; + private final String id; + private final String kind; + private final String name; + private final List pathMatchers; + private final String selfLink; + private final List tests; + + private UrlMap() { + this.creationTimestamp = null; + this.defaultService = null; + this.description = null; + this.fingerprint = null; + this.hostRules = null; + this.id = null; + this.kind = null; + this.name = null; + this.pathMatchers = null; + this.selfLink = null; + this.tests = null; + } + + + private UrlMap( + String creationTimestamp, + String defaultService, + String description, + String fingerprint, + List hostRules, + String id, + String kind, + String name, + List pathMatchers, + String selfLink, + List tests + ) { + this.creationTimestamp = creationTimestamp; + this.defaultService = defaultService; + this.description = description; + this.fingerprint = fingerprint; + this.hostRules = hostRules; + this.id = id; + this.kind = kind; + this.name = name; + this.pathMatchers = pathMatchers; + this.selfLink = selfLink; + this.tests = tests; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("defaultService") && defaultService != null) { + fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("hostRules") && hostRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HostRule item : hostRules) { + stringList.add(item.toString()); + } + fieldMap.put("hostRules", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("pathMatchers") && pathMatchers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (PathMatcher item : pathMatchers) { + stringList.add(item.toString()); + } + fieldMap.put("pathMatchers", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("tests") && tests != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (UrlMapTest item : tests) { + stringList.add(item.toString()); + } + fieldMap.put("tests", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("defaultService")) { + return String.valueOf(defaultService); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("hostRules")) { + return String.valueOf(hostRules); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("pathMatchers")) { + return String.valueOf(pathMatchers); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("tests")) { + return String.valueOf(tests); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDefaultService() { + return defaultService; + } + + public String getDescription() { + return description; + } + + public String getFingerprint() { + return fingerprint; + } + + public List getHostRulesList() { + return hostRules; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public List getPathMatchersList() { + return pathMatchers; + } + + public String getSelfLink() { + return selfLink; + } + + public List getTestsList() { + return tests; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMap prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMap getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMap DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMap(); + } + + public static class Builder { + private String creationTimestamp; + private String defaultService; + private String description; + private String fingerprint; + private List hostRules; + private String id; + private String kind; + private String name; + private List pathMatchers; + private String selfLink; + private List tests; + + Builder() {} + + public Builder mergeFrom(UrlMap other) { + if (other == UrlMap.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDefaultService() != null) { + this.defaultService = other.defaultService; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getHostRulesList() != null) { + this.hostRules = other.hostRules; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPathMatchersList() != null) { + this.pathMatchers = other.pathMatchers; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTestsList() != null) { + this.tests = other.tests; + } + return this; + } + + Builder(UrlMap source) { + this.creationTimestamp = source.creationTimestamp; + this.defaultService = source.defaultService; + this.description = source.description; + this.fingerprint = source.fingerprint; + this.hostRules = source.hostRules; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.pathMatchers = source.pathMatchers; + this.selfLink = source.selfLink; + this.tests = source.tests; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDefaultService() { + return defaultService; + } + + public Builder setDefaultService(String defaultService) { + this.defaultService = defaultService; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public List getHostRulesList() { + return hostRules; + } + + public Builder addAllHostRules(List hostRules) { + if (this.hostRules == null) { + this.hostRules = new ArrayList<>(hostRules.size()); + } + this.hostRules.addAll(hostRules); + return this; + } + + public Builder addHostRules(HostRule hostRules) { + this.hostRules.add(hostRules); + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public List getPathMatchersList() { + return pathMatchers; + } + + public Builder addAllPathMatchers(List pathMatchers) { + if (this.pathMatchers == null) { + this.pathMatchers = new ArrayList<>(pathMatchers.size()); + } + this.pathMatchers.addAll(pathMatchers); + return this; + } + + public Builder addPathMatchers(PathMatcher pathMatchers) { + this.pathMatchers.add(pathMatchers); + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getTestsList() { + return tests; + } + + public Builder addAllTests(List tests) { + if (this.tests == null) { + this.tests = new ArrayList<>(tests.size()); + } + this.tests.addAll(tests); + return this; + } + + public Builder addTests(UrlMapTest tests) { + this.tests.add(tests); + return this; + } + + + public UrlMap build() { + + + + + + + + + + + return new UrlMap( + creationTimestamp, + defaultService, + description, + fingerprint, + hostRules, + id, + kind, + name, + pathMatchers, + selfLink, + tests + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDefaultService(this.defaultService); + newBuilder.setDescription(this.description); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.addAllHostRules(this.hostRules); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.addAllPathMatchers(this.pathMatchers); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllTests(this.tests); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMap{" + + "creationTimestamp=" + creationTimestamp + ", " + + "defaultService=" + defaultService + ", " + + "description=" + description + ", " + + "fingerprint=" + fingerprint + ", " + + "hostRules=" + hostRules + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "pathMatchers=" + pathMatchers + ", " + + "selfLink=" + selfLink + ", " + + "tests=" + tests + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMap) { + UrlMap that = (UrlMap) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.defaultService, that.getDefaultService()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.fingerprint, that.getFingerprint()) && + Objects.equals(this.hostRules, that.getHostRulesList()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.pathMatchers, that.getPathMatchersList()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.tests, that.getTestsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + defaultService, + description, + fingerprint, + hostRules, + id, + kind, + name, + pathMatchers, + selfLink, + tests + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java new file mode 100644 index 000000000000..2d6f3374c132 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java @@ -0,0 +1,1136 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.UrlMapStub; +import com.google.cloud.compute.v1.stub.UrlMapStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+ *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+ *   Operation response = urlMapClient.deleteUrlMap(urlMap);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the urlMapClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of UrlMapSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * UrlMapSettings urlMapSettings =
+ *     UrlMapSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * UrlMapClient urlMapClient =
+ *     UrlMapClient.create(urlMapSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * UrlMapSettings urlMapSettings =
+ *     UrlMapSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * UrlMapClient urlMapClient =
+ *     UrlMapClient.create(urlMapSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class UrlMapClient implements BackgroundResource { + private final UrlMapSettings settings; + private final UrlMapStub stub; + + + + /** + * Constructs an instance of UrlMapClient with default settings. + */ + public static final UrlMapClient create() throws IOException { + return create(UrlMapSettings.newBuilder().build()); + } + + /** + * Constructs an instance of UrlMapClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final UrlMapClient create(UrlMapSettings settings) throws IOException { + return new UrlMapClient(settings); + } + + /** + * Constructs an instance of UrlMapClient, using the given stub for making calls. This is for + * advanced usage - prefer to use UrlMapSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final UrlMapClient create(UrlMapStub stub) { + return new UrlMapClient(stub); + } + + /** + * Constructs an instance of UrlMapClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected UrlMapClient(UrlMapSettings settings) throws IOException { + this.settings = settings; + this.stub = ((UrlMapStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected UrlMapClient(UrlMapStub stub) { + this.settings = null; + this.stub = stub; + } + + public final UrlMapSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public UrlMapStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified UrlMap resource. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   Operation response = urlMapClient.deleteUrlMap(urlMap);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteUrlMap(UrlMapName urlMap) { + + DeleteUrlMapHttpRequest request = + DeleteUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .build(); + return deleteUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified UrlMap resource. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString());
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteUrlMap(String urlMap) { + + DeleteUrlMapHttpRequest request = + DeleteUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap) + .build(); + return deleteUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified UrlMap resource. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .build();
+   *   Operation response = urlMapClient.deleteUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteUrlMap(DeleteUrlMapHttpRequest request) { + return deleteUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified UrlMap resource. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = urlMapClient.deleteUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteUrlMapCallable() { + return stub.deleteUrlMapCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap response = urlMapClient.getUrlMap(urlMap);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final UrlMap getUrlMap(UrlMapName urlMap) { + + GetUrlMapHttpRequest request = + GetUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .build(); + return getUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap response = urlMapClient.getUrlMap(urlMap.toString());
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final UrlMap getUrlMap(String urlMap) { + + GetUrlMapHttpRequest request = + GetUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap) + .build(); + return getUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .build();
+   *   UrlMap response = urlMapClient.getUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final UrlMap getUrlMap(GetUrlMapHttpRequest request) { + return getUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .build();
+   *   ApiFuture<UrlMap> future = urlMapClient.getUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   UrlMap response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getUrlMapCallable() { + return stub.getUrlMapCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   Operation response = urlMapClient.insertUrlMap(project, urlMapResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertUrlMap(ProjectName project, UrlMap urlMapResource) { + + InsertUrlMapHttpRequest request = + InsertUrlMapHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setUrlMapResource(urlMapResource) + .build(); + return insertUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   Operation response = urlMapClient.insertUrlMap(project.toString(), urlMapResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertUrlMap(String project, UrlMap urlMapResource) { + + InsertUrlMapHttpRequest request = + InsertUrlMapHttpRequest.newBuilder() + .setProject(project) + .setUrlMapResource(urlMapResource) + .build(); + return insertUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setUrlMapResource(urlMapResource)
+   *     .build();
+   *   Operation response = urlMapClient.insertUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertUrlMap(InsertUrlMapHttpRequest request) { + return insertUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setUrlMapResource(urlMapResource)
+   *     .build();
+   *   ApiFuture<Operation> future = urlMapClient.insertUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertUrlMapCallable() { + return stub.insertUrlMapCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap scoping this request. + * @param cacheInvalidationRuleResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation invalidateCacheUrlMap(UrlMapName urlMap, CacheInvalidationRule cacheInvalidationRuleResource) { + + InvalidateCacheUrlMapHttpRequest request = + InvalidateCacheUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) + .build(); + return invalidateCacheUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), cacheInvalidationRuleResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap scoping this request. + * @param cacheInvalidationRuleResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation invalidateCacheUrlMap(String urlMap, CacheInvalidationRule cacheInvalidationRuleResource) { + + InvalidateCacheUrlMapHttpRequest request = + InvalidateCacheUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap) + .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) + .build(); + return invalidateCacheUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
+   *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setCacheInvalidationRuleResource(cacheInvalidationRuleResource)
+   *     .build();
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation invalidateCacheUrlMap(InvalidateCacheUrlMapHttpRequest request) { + return invalidateCacheUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
+   *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setCacheInvalidationRuleResource(cacheInvalidationRuleResource)
+   *     .build();
+   *   ApiFuture<Operation> future = urlMapClient.invalidateCacheUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable invalidateCacheUrlMapCallable() { + return stub.invalidateCacheUrlMapCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (UrlMap element : urlMapClient.listUrlMaps(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListUrlMapsPagedResponse listUrlMaps(ProjectName project) { + ListUrlMapsHttpRequest request = + ListUrlMapsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listUrlMaps(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (UrlMap element : urlMapClient.listUrlMaps(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListUrlMapsPagedResponse listUrlMaps(String project) { + ListUrlMapsHttpRequest request = + ListUrlMapsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listUrlMaps(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListUrlMapsHttpRequest request = ListUrlMapsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (UrlMap element : urlMapClient.listUrlMaps(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListUrlMapsPagedResponse listUrlMaps(ListUrlMapsHttpRequest request) { + return listUrlMapsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListUrlMapsHttpRequest request = ListUrlMapsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListUrlMapsPagedResponse> future = urlMapClient.listUrlMapsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (UrlMap element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listUrlMapsPagedCallable() { + return stub.listUrlMapsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListUrlMapsHttpRequest request = ListUrlMapsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     UrlMapList response = urlMapClient.listUrlMapsCallable().call(request);
+   *     for (UrlMap element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listUrlMapsCallable() { + return stub.listUrlMapsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   Operation response = urlMapClient.patchUrlMap(urlMap, urlMapResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to update. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchUrlMap(UrlMapName urlMap, UrlMap urlMapResource) { + + PatchUrlMapHttpRequest request = + PatchUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setUrlMapResource(urlMapResource) + .build(); + return patchUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), urlMapResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to update. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchUrlMap(String urlMap, UrlMap urlMapResource) { + + PatchUrlMapHttpRequest request = + PatchUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap) + .setUrlMapResource(urlMapResource) + .build(); + return patchUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setUrlMapResource(urlMapResource)
+   *     .build();
+   *   Operation response = urlMapClient.patchUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchUrlMap(PatchUrlMapHttpRequest request) { + return patchUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setUrlMapResource(urlMapResource)
+   *     .build();
+   *   ApiFuture<Operation> future = urlMapClient.patchUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchUrlMapCallable() { + return stub.patchUrlMapCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   Operation response = urlMapClient.updateUrlMap(urlMap, urlMapResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to update. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateUrlMap(UrlMapName urlMap, UrlMap urlMapResource) { + + UpdateUrlMapHttpRequest request = + UpdateUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setUrlMapResource(urlMapResource) + .build(); + return updateUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), urlMapResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to update. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateUrlMap(String urlMap, UrlMap urlMapResource) { + + UpdateUrlMapHttpRequest request = + UpdateUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap) + .setUrlMapResource(urlMapResource) + .build(); + return updateUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setUrlMapResource(urlMapResource)
+   *     .build();
+   *   Operation response = urlMapClient.updateUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateUrlMap(UpdateUrlMapHttpRequest request) { + return updateUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * Sample code: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMap urlMapResource = UrlMap.newBuilder().build();
+   *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setUrlMapResource(urlMapResource)
+   *     .build();
+   *   ApiFuture<Operation> future = urlMapClient.updateUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateUrlMapCallable() { + return stub.updateUrlMapCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
+   *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(urlMap, urlMapsValidateRequestResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to be validated as. + * @param urlMapsValidateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final UrlMapsValidateResponse validateUrlMap(UrlMapName urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) { + + ValidateUrlMapHttpRequest request = + ValidateUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource) + .build(); + return validateUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
+   *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(urlMap.toString(), urlMapsValidateRequestResource);
+   * }
+   * 
+ * + * @param urlMap Name of the UrlMap resource to be validated as. + * @param urlMapsValidateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final UrlMapsValidateResponse validateUrlMap(String urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) { + + ValidateUrlMapHttpRequest request = + ValidateUrlMapHttpRequest.newBuilder() + .setUrlMap(urlMap) + .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource) + .build(); + return validateUrlMap(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
+   *   ValidateUrlMapHttpRequest request = ValidateUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource)
+   *     .build();
+   *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final UrlMapsValidateResponse validateUrlMap(ValidateUrlMapHttpRequest request) { + return validateUrlMapCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
+   *   ValidateUrlMapHttpRequest request = ValidateUrlMapHttpRequest.newBuilder()
+   *     .setUrlMap(urlMap.toString())
+   *     .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource)
+   *     .build();
+   *   ApiFuture<UrlMapsValidateResponse> future = urlMapClient.validateUrlMapCallable().futureCall(request);
+   *   // Do something
+   *   UrlMapsValidateResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable validateUrlMapCallable() { + return stub.validateUrlMapCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListUrlMapsPagedResponse extends AbstractPagedListResponse< + ListUrlMapsHttpRequest, + UrlMapList, + UrlMap, + ListUrlMapsPage, + ListUrlMapsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUrlMapsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListUrlMapsPagedResponse apply(ListUrlMapsPage input) { + return new ListUrlMapsPagedResponse(input); + } + }); + } + + private ListUrlMapsPagedResponse(ListUrlMapsPage page) { + super(page, ListUrlMapsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListUrlMapsPage extends AbstractPage< + ListUrlMapsHttpRequest, + UrlMapList, + UrlMap, + ListUrlMapsPage> { + + private ListUrlMapsPage( + PageContext context, + UrlMapList response) { + super(context, response); + } + + private static ListUrlMapsPage createEmptyPage() { + return new ListUrlMapsPage(null, null); + } + + @Override + protected ListUrlMapsPage createPage( + PageContext context, + UrlMapList response) { + return new ListUrlMapsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListUrlMapsFixedSizeCollection extends AbstractFixedSizeCollection< + ListUrlMapsHttpRequest, + UrlMapList, + UrlMap, + ListUrlMapsPage, + ListUrlMapsFixedSizeCollection> { + + private ListUrlMapsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUrlMapsFixedSizeCollection createEmptyCollection() { + return new ListUrlMapsFixedSizeCollection(null, 0); + } + + @Override + protected ListUrlMapsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUrlMapsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java new file mode 100644 index 000000000000..dacd44f351a6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private UrlMapList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private UrlMapList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (UrlMap item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMapList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMapList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMapList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMapList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(UrlMapList other) { + if (other == UrlMapList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(UrlMapList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(UrlMap items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public UrlMapList build() { + + + + + return new UrlMapList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMapList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapList) { + UrlMapList that = (UrlMapList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java new file mode 100644 index 000000000000..3abdaaee2d8e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapName implements ResourceName { + private final String project; + private final String urlMap; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private UrlMapName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + urlMap = Preconditions.checkNotNull(builder.getUrlMap()); + } + + public static UrlMapName of( + String project, + String urlMap + ) { + return newBuilder() + .setProject(project) + .setUrlMap(urlMap) + .build(); + } + + public static String format( + String project, + String urlMap + ) { + return of( + project, + urlMap + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getUrlMap() { + return urlMap; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("urlMap", urlMap); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public UrlMapName parse(String formattedString) {return UrlMapName.parse(formattedString);} + }; + } + + public static UrlMapName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "UrlMapName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("urlMap") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String urlMap; + + public String getProject() { + return project; + } + public String getUrlMap() { + return urlMap; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + private Builder() {} + + public Builder (UrlMapName urlMapName) { + project = urlMapName.project; + urlMap = urlMapName.urlMap; + } + + public UrlMapName build() { + return new UrlMapName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "urlMap", urlMap + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapName) { + UrlMapName that = (UrlMapName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.urlMap, that.getUrlMap()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + urlMap + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java new file mode 100644 index 000000000000..2af65b332d4f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapReference implements ApiMessage { + private final String urlMap; + + private UrlMapReference() { + this.urlMap = null; + } + + + private UrlMapReference( + String urlMap + ) { + this.urlMap = urlMap; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getUrlMap() { + return urlMap; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMapReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMapReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMapReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMapReference(); + } + + public static class Builder { + private String urlMap; + + Builder() {} + + public Builder mergeFrom(UrlMapReference other) { + if (other == UrlMapReference.getDefaultInstance()) return this; + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + return this; + } + + Builder(UrlMapReference source) { + this.urlMap = source.urlMap; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + + public UrlMapReference build() { + return new UrlMapReference( + urlMap + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setUrlMap(this.urlMap); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMapReference{" + + "urlMap=" + urlMap + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapReference) { + UrlMapReference that = (UrlMapReference) o; + return + Objects.equals(this.urlMap, that.getUrlMap()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + urlMap + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java new file mode 100644 index 000000000000..ba1df33f9b84 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java @@ -0,0 +1,324 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import com.google.cloud.compute.v1.stub.UrlMapStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link UrlMapClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteUrlMap to 30 seconds: + * + *

+ * 
+ * UrlMapSettings.Builder urlMapSettingsBuilder =
+ *     UrlMapSettings.newBuilder();
+ * urlMapSettingsBuilder.deleteUrlMapSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * UrlMapSettings urlMapSettings = urlMapSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class UrlMapSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteUrlMap. + */ + public UnaryCallSettings deleteUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).deleteUrlMapSettings(); + } + + /** + * Returns the object with the settings used for calls to getUrlMap. + */ + public UnaryCallSettings getUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).getUrlMapSettings(); + } + + /** + * Returns the object with the settings used for calls to insertUrlMap. + */ + public UnaryCallSettings insertUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).insertUrlMapSettings(); + } + + /** + * Returns the object with the settings used for calls to invalidateCacheUrlMap. + */ + public UnaryCallSettings invalidateCacheUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).invalidateCacheUrlMapSettings(); + } + + /** + * Returns the object with the settings used for calls to listUrlMaps. + */ + public PagedCallSettings listUrlMapsSettings() { + return ((UrlMapStubSettings) getStubSettings()).listUrlMapsSettings(); + } + + /** + * Returns the object with the settings used for calls to patchUrlMap. + */ + public UnaryCallSettings patchUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).patchUrlMapSettings(); + } + + /** + * Returns the object with the settings used for calls to updateUrlMap. + */ + public UnaryCallSettings updateUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).updateUrlMapSettings(); + } + + /** + * Returns the object with the settings used for calls to validateUrlMap. + */ + public UnaryCallSettings validateUrlMapSettings() { + return ((UrlMapStubSettings) getStubSettings()).validateUrlMapSettings(); + } + + + public static final UrlMapSettings create(UrlMapStubSettings stub) throws IOException { + return new UrlMapSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return UrlMapStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return UrlMapStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return UrlMapStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return UrlMapStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return UrlMapStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return UrlMapStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return UrlMapStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return UrlMapStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected UrlMapSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for UrlMapSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(UrlMapStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(UrlMapStubSettings.newBuilder()); + } + + protected Builder(UrlMapSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(UrlMapStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public UrlMapStubSettings.Builder getStubSettingsBuilder() { + return ((UrlMapStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteUrlMap. + */ + public UnaryCallSettings.Builder deleteUrlMapSettings() { + return getStubSettingsBuilder().deleteUrlMapSettings(); + } + + /** + * Returns the builder for the settings used for calls to getUrlMap. + */ + public UnaryCallSettings.Builder getUrlMapSettings() { + return getStubSettingsBuilder().getUrlMapSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertUrlMap. + */ + public UnaryCallSettings.Builder insertUrlMapSettings() { + return getStubSettingsBuilder().insertUrlMapSettings(); + } + + /** + * Returns the builder for the settings used for calls to invalidateCacheUrlMap. + */ + public UnaryCallSettings.Builder invalidateCacheUrlMapSettings() { + return getStubSettingsBuilder().invalidateCacheUrlMapSettings(); + } + + /** + * Returns the builder for the settings used for calls to listUrlMaps. + */ + public PagedCallSettings.Builder listUrlMapsSettings() { + return getStubSettingsBuilder().listUrlMapsSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchUrlMap. + */ + public UnaryCallSettings.Builder patchUrlMapSettings() { + return getStubSettingsBuilder().patchUrlMapSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateUrlMap. + */ + public UnaryCallSettings.Builder updateUrlMapSettings() { + return getStubSettingsBuilder().updateUrlMapSettings(); + } + + /** + * Returns the builder for the settings used for calls to validateUrlMap. + */ + public UnaryCallSettings.Builder validateUrlMapSettings() { + return getStubSettingsBuilder().validateUrlMapSettings(); + } + + @Override + public UrlMapSettings build() throws IOException { + return new UrlMapSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java new file mode 100644 index 000000000000..e434b2bf9a68 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapTest implements ApiMessage { + private final String description; + private final String host; + private final String path; + private final String service; + + private UrlMapTest() { + this.description = null; + this.host = null; + this.path = null; + this.service = null; + } + + + private UrlMapTest( + String description, + String host, + String path, + String service + ) { + this.description = description; + this.host = host; + this.path = path; + this.service = service; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("path") && path != null) { + fieldMap.put("path", Collections.singletonList(String.valueOf(path))); + } + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("path")) { + return String.valueOf(path); + } + if (fieldName.equals("service")) { + return String.valueOf(service); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDescription() { + return description; + } + + public String getHost() { + return host; + } + + public String getPath() { + return path; + } + + public String getService() { + return service; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMapTest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMapTest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMapTest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMapTest(); + } + + public static class Builder { + private String description; + private String host; + private String path; + private String service; + + Builder() {} + + public Builder mergeFrom(UrlMapTest other) { + if (other == UrlMapTest.getDefaultInstance()) return this; + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPath() != null) { + this.path = other.path; + } + if (other.getService() != null) { + this.service = other.service; + } + return this; + } + + Builder(UrlMapTest source) { + this.description = source.description; + this.host = source.host; + this.path = source.path; + this.service = source.service; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getPath() { + return path; + } + + public Builder setPath(String path) { + this.path = path; + return this; + } + + public String getService() { + return service; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + + public UrlMapTest build() { + + + + return new UrlMapTest( + description, + host, + path, + service + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDescription(this.description); + newBuilder.setHost(this.host); + newBuilder.setPath(this.path); + newBuilder.setService(this.service); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMapTest{" + + "description=" + description + ", " + + "host=" + host + ", " + + "path=" + path + ", " + + "service=" + service + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapTest) { + UrlMapTest that = (UrlMapTest) o; + return + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.host, that.getHost()) && + Objects.equals(this.path, that.getPath()) && + Objects.equals(this.service, that.getService()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + description, + host, + path, + service + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java new file mode 100644 index 000000000000..e2e6f51b2f65 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java @@ -0,0 +1,288 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapValidationResult implements ApiMessage { + private final List loadErrors; + private final Boolean loadSucceeded; + private final List testFailures; + private final Boolean testPassed; + + private UrlMapValidationResult() { + this.loadErrors = null; + this.loadSucceeded = null; + this.testFailures = null; + this.testPassed = null; + } + + + private UrlMapValidationResult( + List loadErrors, + Boolean loadSucceeded, + List testFailures, + Boolean testPassed + ) { + this.loadErrors = loadErrors; + this.loadSucceeded = loadSucceeded; + this.testFailures = testFailures; + this.testPassed = testPassed; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("loadErrors") && loadErrors != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : loadErrors) { + stringList.add(item.toString()); + } + fieldMap.put("loadErrors", stringList.build()); + } + if (fieldNames.contains("loadSucceeded") && loadSucceeded != null) { + fieldMap.put("loadSucceeded", Collections.singletonList(String.valueOf(loadSucceeded))); + } + if (fieldNames.contains("testFailures") && testFailures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TestFailure item : testFailures) { + stringList.add(item.toString()); + } + fieldMap.put("testFailures", stringList.build()); + } + if (fieldNames.contains("testPassed") && testPassed != null) { + fieldMap.put("testPassed", Collections.singletonList(String.valueOf(testPassed))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("loadErrors")) { + return String.valueOf(loadErrors); + } + if (fieldName.equals("loadSucceeded")) { + return String.valueOf(loadSucceeded); + } + if (fieldName.equals("testFailures")) { + return String.valueOf(testFailures); + } + if (fieldName.equals("testPassed")) { + return String.valueOf(testPassed); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getLoadErrorsList() { + return loadErrors; + } + + public Boolean getLoadSucceeded() { + return loadSucceeded; + } + + public List getTestFailuresList() { + return testFailures; + } + + public Boolean getTestPassed() { + return testPassed; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMapValidationResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMapValidationResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMapValidationResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMapValidationResult(); + } + + public static class Builder { + private List loadErrors; + private Boolean loadSucceeded; + private List testFailures; + private Boolean testPassed; + + Builder() {} + + public Builder mergeFrom(UrlMapValidationResult other) { + if (other == UrlMapValidationResult.getDefaultInstance()) return this; + if (other.getLoadErrorsList() != null) { + this.loadErrors = other.loadErrors; + } + if (other.getLoadSucceeded() != null) { + this.loadSucceeded = other.loadSucceeded; + } + if (other.getTestFailuresList() != null) { + this.testFailures = other.testFailures; + } + if (other.getTestPassed() != null) { + this.testPassed = other.testPassed; + } + return this; + } + + Builder(UrlMapValidationResult source) { + this.loadErrors = source.loadErrors; + this.loadSucceeded = source.loadSucceeded; + this.testFailures = source.testFailures; + this.testPassed = source.testPassed; + } + + public List getLoadErrorsList() { + return loadErrors; + } + + public Builder addAllLoadErrors(List loadErrors) { + if (this.loadErrors == null) { + this.loadErrors = new ArrayList<>(loadErrors.size()); + } + this.loadErrors.addAll(loadErrors); + return this; + } + + public Builder addLoadErrors(String loadErrors) { + this.loadErrors.add(loadErrors); + return this; + } + + public Boolean getLoadSucceeded() { + return loadSucceeded; + } + + public Builder setLoadSucceeded(Boolean loadSucceeded) { + this.loadSucceeded = loadSucceeded; + return this; + } + + public List getTestFailuresList() { + return testFailures; + } + + public Builder addAllTestFailures(List testFailures) { + if (this.testFailures == null) { + this.testFailures = new ArrayList<>(testFailures.size()); + } + this.testFailures.addAll(testFailures); + return this; + } + + public Builder addTestFailures(TestFailure testFailures) { + this.testFailures.add(testFailures); + return this; + } + + public Boolean getTestPassed() { + return testPassed; + } + + public Builder setTestPassed(Boolean testPassed) { + this.testPassed = testPassed; + return this; + } + + + public UrlMapValidationResult build() { + + + + return new UrlMapValidationResult( + loadErrors, + loadSucceeded, + testFailures, + testPassed + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllLoadErrors(this.loadErrors); + newBuilder.setLoadSucceeded(this.loadSucceeded); + newBuilder.addAllTestFailures(this.testFailures); + newBuilder.setTestPassed(this.testPassed); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMapValidationResult{" + + "loadErrors=" + loadErrors + ", " + + "loadSucceeded=" + loadSucceeded + ", " + + "testFailures=" + testFailures + ", " + + "testPassed=" + testPassed + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapValidationResult) { + UrlMapValidationResult that = (UrlMapValidationResult) o; + return + Objects.equals(this.loadErrors, that.getLoadErrorsList()) && + Objects.equals(this.loadSucceeded, that.getLoadSucceeded()) && + Objects.equals(this.testFailures, that.getTestFailuresList()) && + Objects.equals(this.testPassed, that.getTestPassed()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + loadErrors, + loadSucceeded, + testFailures, + testPassed + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java new file mode 100644 index 000000000000..df935111559c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapsValidateRequest implements ApiMessage { + private final UrlMap resource; + + private UrlMapsValidateRequest() { + this.resource = null; + } + + + private UrlMapsValidateRequest( + UrlMap resource + ) { + this.resource = resource; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public UrlMap getResource() { + return resource; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMapsValidateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMapsValidateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMapsValidateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMapsValidateRequest(); + } + + public static class Builder { + private UrlMap resource; + + Builder() {} + + public Builder mergeFrom(UrlMapsValidateRequest other) { + if (other == UrlMapsValidateRequest.getDefaultInstance()) return this; + if (other.getResource() != null) { + this.resource = other.resource; + } + return this; + } + + Builder(UrlMapsValidateRequest source) { + this.resource = source.resource; + } + + public UrlMap getResource() { + return resource; + } + + public Builder setResource(UrlMap resource) { + this.resource = resource; + return this; + } + + + public UrlMapsValidateRequest build() { + return new UrlMapsValidateRequest( + resource + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setResource(this.resource); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMapsValidateRequest{" + + "resource=" + resource + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapsValidateRequest) { + UrlMapsValidateRequest that = (UrlMapsValidateRequest) o; + return + Objects.equals(this.resource, that.getResource()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + resource + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java new file mode 100644 index 000000000000..58f5a4c0ef33 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UrlMapsValidateResponse implements ApiMessage { + private final UrlMapValidationResult result; + + private UrlMapsValidateResponse() { + this.result = null; + } + + + private UrlMapsValidateResponse( + UrlMapValidationResult result + ) { + this.result = result; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("result") && result != null) { + fieldMap.put("result", Collections.singletonList(String.valueOf(result))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("result")) { + return String.valueOf(result); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public UrlMapValidationResult getResult() { + return result; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UrlMapsValidateResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UrlMapsValidateResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UrlMapsValidateResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UrlMapsValidateResponse(); + } + + public static class Builder { + private UrlMapValidationResult result; + + Builder() {} + + public Builder mergeFrom(UrlMapsValidateResponse other) { + if (other == UrlMapsValidateResponse.getDefaultInstance()) return this; + if (other.getResult() != null) { + this.result = other.result; + } + return this; + } + + Builder(UrlMapsValidateResponse source) { + this.result = source.result; + } + + public UrlMapValidationResult getResult() { + return result; + } + + public Builder setResult(UrlMapValidationResult result) { + this.result = result; + return this; + } + + + public UrlMapsValidateResponse build() { + return new UrlMapsValidateResponse( + result + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setResult(this.result); + return newBuilder; + } + } + + @Override + public String toString() { + return "UrlMapsValidateResponse{" + + "result=" + result + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UrlMapsValidateResponse) { + UrlMapsValidateResponse that = (UrlMapsValidateResponse) o; + return + Objects.equals(this.result, that.getResult()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + result + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java new file mode 100644 index 000000000000..84a01d9006d1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UsageExportLocation implements ApiMessage { + private final String bucketName; + private final String reportNamePrefix; + + private UsageExportLocation() { + this.bucketName = null; + this.reportNamePrefix = null; + } + + + private UsageExportLocation( + String bucketName, + String reportNamePrefix + ) { + this.bucketName = bucketName; + this.reportNamePrefix = reportNamePrefix; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bucketName") && bucketName != null) { + fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); + } + if (fieldNames.contains("reportNamePrefix") && reportNamePrefix != null) { + fieldMap.put("reportNamePrefix", Collections.singletonList(String.valueOf(reportNamePrefix))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("bucketName")) { + return String.valueOf(bucketName); + } + if (fieldName.equals("reportNamePrefix")) { + return String.valueOf(reportNamePrefix); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getBucketName() { + return bucketName; + } + + public String getReportNamePrefix() { + return reportNamePrefix; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UsageExportLocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UsageExportLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UsageExportLocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UsageExportLocation(); + } + + public static class Builder { + private String bucketName; + private String reportNamePrefix; + + Builder() {} + + public Builder mergeFrom(UsageExportLocation other) { + if (other == UsageExportLocation.getDefaultInstance()) return this; + if (other.getBucketName() != null) { + this.bucketName = other.bucketName; + } + if (other.getReportNamePrefix() != null) { + this.reportNamePrefix = other.reportNamePrefix; + } + return this; + } + + Builder(UsageExportLocation source) { + this.bucketName = source.bucketName; + this.reportNamePrefix = source.reportNamePrefix; + } + + public String getBucketName() { + return bucketName; + } + + public Builder setBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + public String getReportNamePrefix() { + return reportNamePrefix; + } + + public Builder setReportNamePrefix(String reportNamePrefix) { + this.reportNamePrefix = reportNamePrefix; + return this; + } + + + public UsageExportLocation build() { + + return new UsageExportLocation( + bucketName, + reportNamePrefix + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBucketName(this.bucketName); + newBuilder.setReportNamePrefix(this.reportNamePrefix); + return newBuilder; + } + } + + @Override + public String toString() { + return "UsageExportLocation{" + + "bucketName=" + bucketName + ", " + + "reportNamePrefix=" + reportNamePrefix + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UsageExportLocation) { + UsageExportLocation that = (UsageExportLocation) o; + return + Objects.equals(this.bucketName, that.getBucketName()) && + Objects.equals(this.reportNamePrefix, that.getReportNamePrefix()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + bucketName, + reportNamePrefix + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java new file mode 100644 index 000000000000..a111ab1fa621 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ValidateUrlMapHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String urlMap; + private final UrlMapsValidateRequest urlMapsValidateRequestResource; + private final String userIp; + + private ValidateUrlMapHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.urlMap = null; + this.urlMapsValidateRequestResource = null; + this.userIp = null; + } + + + private ValidateUrlMapHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String urlMap, + UrlMapsValidateRequest urlMapsValidateRequestResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.urlMap = urlMap; + this.urlMapsValidateRequestResource = urlMapsValidateRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("urlMapsValidateRequestResource") && urlMapsValidateRequestResource != null) { + fieldMap.put("urlMapsValidateRequestResource", Collections.singletonList(String.valueOf(urlMapsValidateRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } + if (fieldName.equals("urlMapsValidateRequestResource")) { + return String.valueOf(urlMapsValidateRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public UrlMapsValidateRequest getApiMessageRequestBody() { + return urlMapsValidateRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUrlMap() { + return urlMap; + } + + public UrlMapsValidateRequest getUrlMapsValidateRequestResource() { + return urlMapsValidateRequestResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ValidateUrlMapHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ValidateUrlMapHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ValidateUrlMapHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ValidateUrlMapHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String urlMap; + private UrlMapsValidateRequest urlMapsValidateRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ValidateUrlMapHttpRequest other) { + if (other == ValidateUrlMapHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUrlMap() != null) { + this.urlMap = other.urlMap; + } + if (other.getUrlMapsValidateRequestResource() != null) { + this.urlMapsValidateRequestResource = other.urlMapsValidateRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ValidateUrlMapHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.urlMap = source.urlMap; + this.urlMapsValidateRequestResource = source.urlMapsValidateRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUrlMap() { + return urlMap; + } + + public Builder setUrlMap(String urlMap) { + this.urlMap = urlMap; + return this; + } + + public UrlMapsValidateRequest getUrlMapsValidateRequestResource() { + return urlMapsValidateRequestResource; + } + + public Builder setUrlMapsValidateRequestResource(UrlMapsValidateRequest urlMapsValidateRequestResource) { + this.urlMapsValidateRequestResource = urlMapsValidateRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ValidateUrlMapHttpRequest build() { + String missing = ""; + + + + + + + if (urlMap == null) { + missing += " urlMap"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ValidateUrlMapHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapsValidateRequestResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUrlMap(this.urlMap); + newBuilder.setUrlMapsValidateRequestResource(this.urlMapsValidateRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ValidateUrlMapHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "urlMap=" + urlMap + ", " + + "urlMapsValidateRequestResource=" + urlMapsValidateRequestResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ValidateUrlMapHttpRequest) { + ValidateUrlMapHttpRequest that = (ValidateUrlMapHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.urlMap, that.getUrlMap()) && + Objects.equals(this.urlMapsValidateRequestResource, that.getUrlMapsValidateRequestResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapsValidateRequestResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java new file mode 100644 index 000000000000..bb5c17c94e93 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java @@ -0,0 +1,730 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class VpnTunnel implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String detailedStatus; + private final String id; + private final Integer ikeVersion; + private final String kind; + private final List localTrafficSelector; + private final String name; + private final String peerIp; + private final String region; + private final List remoteTrafficSelector; + private final String router; + private final String selfLink; + private final String sharedSecret; + private final String sharedSecretHash; + private final String status; + private final String targetVpnGateway; + + private VpnTunnel() { + this.creationTimestamp = null; + this.description = null; + this.detailedStatus = null; + this.id = null; + this.ikeVersion = null; + this.kind = null; + this.localTrafficSelector = null; + this.name = null; + this.peerIp = null; + this.region = null; + this.remoteTrafficSelector = null; + this.router = null; + this.selfLink = null; + this.sharedSecret = null; + this.sharedSecretHash = null; + this.status = null; + this.targetVpnGateway = null; + } + + + private VpnTunnel( + String creationTimestamp, + String description, + String detailedStatus, + String id, + Integer ikeVersion, + String kind, + List localTrafficSelector, + String name, + String peerIp, + String region, + List remoteTrafficSelector, + String router, + String selfLink, + String sharedSecret, + String sharedSecretHash, + String status, + String targetVpnGateway + ) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.detailedStatus = detailedStatus; + this.id = id; + this.ikeVersion = ikeVersion; + this.kind = kind; + this.localTrafficSelector = localTrafficSelector; + this.name = name; + this.peerIp = peerIp; + this.region = region; + this.remoteTrafficSelector = remoteTrafficSelector; + this.router = router; + this.selfLink = selfLink; + this.sharedSecret = sharedSecret; + this.sharedSecretHash = sharedSecretHash; + this.status = status; + this.targetVpnGateway = targetVpnGateway; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("detailedStatus") && detailedStatus != null) { + fieldMap.put("detailedStatus", Collections.singletonList(String.valueOf(detailedStatus))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("ikeVersion") && ikeVersion != null) { + fieldMap.put("ikeVersion", Collections.singletonList(String.valueOf(ikeVersion))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("localTrafficSelector") && localTrafficSelector != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : localTrafficSelector) { + stringList.add(item.toString()); + } + fieldMap.put("localTrafficSelector", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerIp") && peerIp != null) { + fieldMap.put("peerIp", Collections.singletonList(String.valueOf(peerIp))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("remoteTrafficSelector") && remoteTrafficSelector != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : remoteTrafficSelector) { + stringList.add(item.toString()); + } + fieldMap.put("remoteTrafficSelector", stringList.build()); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sharedSecret") && sharedSecret != null) { + fieldMap.put("sharedSecret", Collections.singletonList(String.valueOf(sharedSecret))); + } + if (fieldNames.contains("sharedSecretHash") && sharedSecretHash != null) { + fieldMap.put("sharedSecretHash", Collections.singletonList(String.valueOf(sharedSecretHash))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { + fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("detailedStatus")) { + return String.valueOf(detailedStatus); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("ikeVersion")) { + return String.valueOf(ikeVersion); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("localTrafficSelector")) { + return String.valueOf(localTrafficSelector); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("peerIp")) { + return String.valueOf(peerIp); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("remoteTrafficSelector")) { + return String.valueOf(remoteTrafficSelector); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("sharedSecret")) { + return String.valueOf(sharedSecret); + } + if (fieldName.equals("sharedSecretHash")) { + return String.valueOf(sharedSecretHash); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("targetVpnGateway")) { + return String.valueOf(targetVpnGateway); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getDetailedStatus() { + return detailedStatus; + } + + public String getId() { + return id; + } + + public Integer getIkeVersion() { + return ikeVersion; + } + + public String getKind() { + return kind; + } + + public List getLocalTrafficSelectorList() { + return localTrafficSelector; + } + + public String getName() { + return name; + } + + public String getPeerIp() { + return peerIp; + } + + public String getRegion() { + return region; + } + + public List getRemoteTrafficSelectorList() { + return remoteTrafficSelector; + } + + public String getRouter() { + return router; + } + + public String getSelfLink() { + return selfLink; + } + + public String getSharedSecret() { + return sharedSecret; + } + + public String getSharedSecretHash() { + return sharedSecretHash; + } + + public String getStatus() { + return status; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(VpnTunnel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static VpnTunnel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final VpnTunnel DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new VpnTunnel(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String detailedStatus; + private String id; + private Integer ikeVersion; + private String kind; + private List localTrafficSelector; + private String name; + private String peerIp; + private String region; + private List remoteTrafficSelector; + private String router; + private String selfLink; + private String sharedSecret; + private String sharedSecretHash; + private String status; + private String targetVpnGateway; + + Builder() {} + + public Builder mergeFrom(VpnTunnel other) { + if (other == VpnTunnel.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getDetailedStatus() != null) { + this.detailedStatus = other.detailedStatus; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getIkeVersion() != null) { + this.ikeVersion = other.ikeVersion; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLocalTrafficSelectorList() != null) { + this.localTrafficSelector = other.localTrafficSelector; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPeerIp() != null) { + this.peerIp = other.peerIp; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getRemoteTrafficSelectorList() != null) { + this.remoteTrafficSelector = other.remoteTrafficSelector; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSharedSecret() != null) { + this.sharedSecret = other.sharedSecret; + } + if (other.getSharedSecretHash() != null) { + this.sharedSecretHash = other.sharedSecretHash; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getTargetVpnGateway() != null) { + this.targetVpnGateway = other.targetVpnGateway; + } + return this; + } + + Builder(VpnTunnel source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.detailedStatus = source.detailedStatus; + this.id = source.id; + this.ikeVersion = source.ikeVersion; + this.kind = source.kind; + this.localTrafficSelector = source.localTrafficSelector; + this.name = source.name; + this.peerIp = source.peerIp; + this.region = source.region; + this.remoteTrafficSelector = source.remoteTrafficSelector; + this.router = source.router; + this.selfLink = source.selfLink; + this.sharedSecret = source.sharedSecret; + this.sharedSecretHash = source.sharedSecretHash; + this.status = source.status; + this.targetVpnGateway = source.targetVpnGateway; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getDetailedStatus() { + return detailedStatus; + } + + public Builder setDetailedStatus(String detailedStatus) { + this.detailedStatus = detailedStatus; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Integer getIkeVersion() { + return ikeVersion; + } + + public Builder setIkeVersion(Integer ikeVersion) { + this.ikeVersion = ikeVersion; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public List getLocalTrafficSelectorList() { + return localTrafficSelector; + } + + public Builder addAllLocalTrafficSelector(List localTrafficSelector) { + if (this.localTrafficSelector == null) { + this.localTrafficSelector = new ArrayList<>(localTrafficSelector.size()); + } + this.localTrafficSelector.addAll(localTrafficSelector); + return this; + } + + public Builder addLocalTrafficSelector(String localTrafficSelector) { + this.localTrafficSelector.add(localTrafficSelector); + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getPeerIp() { + return peerIp; + } + + public Builder setPeerIp(String peerIp) { + this.peerIp = peerIp; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public List getRemoteTrafficSelectorList() { + return remoteTrafficSelector; + } + + public Builder addAllRemoteTrafficSelector(List remoteTrafficSelector) { + if (this.remoteTrafficSelector == null) { + this.remoteTrafficSelector = new ArrayList<>(remoteTrafficSelector.size()); + } + this.remoteTrafficSelector.addAll(remoteTrafficSelector); + return this; + } + + public Builder addRemoteTrafficSelector(String remoteTrafficSelector) { + this.remoteTrafficSelector.add(remoteTrafficSelector); + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getSharedSecret() { + return sharedSecret; + } + + public Builder setSharedSecret(String sharedSecret) { + this.sharedSecret = sharedSecret; + return this; + } + + public String getSharedSecretHash() { + return sharedSecretHash; + } + + public Builder setSharedSecretHash(String sharedSecretHash) { + this.sharedSecretHash = sharedSecretHash; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getTargetVpnGateway() { + return targetVpnGateway; + } + + public Builder setTargetVpnGateway(String targetVpnGateway) { + this.targetVpnGateway = targetVpnGateway; + return this; + } + + + public VpnTunnel build() { + + + + + + + + + + + + + + + + + return new VpnTunnel( + creationTimestamp, + description, + detailedStatus, + id, + ikeVersion, + kind, + localTrafficSelector, + name, + peerIp, + region, + remoteTrafficSelector, + router, + selfLink, + sharedSecret, + sharedSecretHash, + status, + targetVpnGateway + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setDetailedStatus(this.detailedStatus); + newBuilder.setId(this.id); + newBuilder.setIkeVersion(this.ikeVersion); + newBuilder.setKind(this.kind); + newBuilder.addAllLocalTrafficSelector(this.localTrafficSelector); + newBuilder.setName(this.name); + newBuilder.setPeerIp(this.peerIp); + newBuilder.setRegion(this.region); + newBuilder.addAllRemoteTrafficSelector(this.remoteTrafficSelector); + newBuilder.setRouter(this.router); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSharedSecret(this.sharedSecret); + newBuilder.setSharedSecretHash(this.sharedSecretHash); + newBuilder.setStatus(this.status); + newBuilder.setTargetVpnGateway(this.targetVpnGateway); + return newBuilder; + } + } + + @Override + public String toString() { + return "VpnTunnel{" + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "detailedStatus=" + detailedStatus + ", " + + "id=" + id + ", " + + "ikeVersion=" + ikeVersion + ", " + + "kind=" + kind + ", " + + "localTrafficSelector=" + localTrafficSelector + ", " + + "name=" + name + ", " + + "peerIp=" + peerIp + ", " + + "region=" + region + ", " + + "remoteTrafficSelector=" + remoteTrafficSelector + ", " + + "router=" + router + ", " + + "selfLink=" + selfLink + ", " + + "sharedSecret=" + sharedSecret + ", " + + "sharedSecretHash=" + sharedSecretHash + ", " + + "status=" + status + ", " + + "targetVpnGateway=" + targetVpnGateway + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VpnTunnel) { + VpnTunnel that = (VpnTunnel) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.detailedStatus, that.getDetailedStatus()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.ikeVersion, that.getIkeVersion()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.localTrafficSelector, that.getLocalTrafficSelectorList()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.peerIp, that.getPeerIp()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.remoteTrafficSelector, that.getRemoteTrafficSelectorList()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.sharedSecret, that.getSharedSecret()) && + Objects.equals(this.sharedSecretHash, that.getSharedSecretHash()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + detailedStatus, + id, + ikeVersion, + kind, + localTrafficSelector, + name, + peerIp, + region, + remoteTrafficSelector, + router, + selfLink, + sharedSecret, + sharedSecretHash, + status, + targetVpnGateway + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java new file mode 100644 index 000000000000..e90faa666fa0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class VpnTunnelAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private VpnTunnelAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private VpnTunnelAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(VpnTunnelAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static VpnTunnelAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final VpnTunnelAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new VpnTunnelAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(VpnTunnelAggregatedList other) { + if (other == VpnTunnelAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(VpnTunnelAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public VpnTunnelAggregatedList build() { + + + + + return new VpnTunnelAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "VpnTunnelAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VpnTunnelAggregatedList) { + VpnTunnelAggregatedList that = (VpnTunnelAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java new file mode 100644 index 000000000000..fed7bb72aaa0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java @@ -0,0 +1,936 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.VpnTunnelStub; +import com.google.cloud.compute.v1.stub.VpnTunnelStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+ *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+ *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the vpnTunnelClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of VpnTunnelSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * VpnTunnelSettings vpnTunnelSettings =
+ *     VpnTunnelSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * VpnTunnelClient vpnTunnelClient =
+ *     VpnTunnelClient.create(vpnTunnelSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * VpnTunnelSettings vpnTunnelSettings =
+ *     VpnTunnelSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * VpnTunnelClient vpnTunnelClient =
+ *     VpnTunnelClient.create(vpnTunnelSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class VpnTunnelClient implements BackgroundResource { + private final VpnTunnelSettings settings; + private final VpnTunnelStub stub; + + + + /** + * Constructs an instance of VpnTunnelClient with default settings. + */ + public static final VpnTunnelClient create() throws IOException { + return create(VpnTunnelSettings.newBuilder().build()); + } + + /** + * Constructs an instance of VpnTunnelClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final VpnTunnelClient create(VpnTunnelSettings settings) throws IOException { + return new VpnTunnelClient(settings); + } + + /** + * Constructs an instance of VpnTunnelClient, using the given stub for making calls. This is for + * advanced usage - prefer to use VpnTunnelSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final VpnTunnelClient create(VpnTunnelStub stub) { + return new VpnTunnelClient(stub); + } + + /** + * Constructs an instance of VpnTunnelClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected VpnTunnelClient(VpnTunnelSettings settings) throws IOException { + this.settings = settings; + this.stub = ((VpnTunnelStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected VpnTunnelClient(VpnTunnelStub stub) { + this.settings = null; + this.stub = stub; + } + + public final VpnTunnelSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public VpnTunnelStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of VPN tunnels. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (VpnTunnelsScopedList element : vpnTunnelClient.aggregatedListVpnTunnels(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(ProjectName project) { + AggregatedListVpnTunnelsHttpRequest request = + AggregatedListVpnTunnelsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListVpnTunnels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of VPN tunnels. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (VpnTunnelsScopedList element : vpnTunnelClient.aggregatedListVpnTunnels(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(String project) { + AggregatedListVpnTunnelsHttpRequest request = + AggregatedListVpnTunnelsHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListVpnTunnels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of VPN tunnels. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListVpnTunnelsHttpRequest request = AggregatedListVpnTunnelsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (VpnTunnelsScopedList element : vpnTunnelClient.aggregatedListVpnTunnels(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(AggregatedListVpnTunnelsHttpRequest request) { + return aggregatedListVpnTunnelsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of VPN tunnels. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListVpnTunnelsHttpRequest request = AggregatedListVpnTunnelsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListVpnTunnelsPagedResponse> future = vpnTunnelClient.aggregatedListVpnTunnelsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (VpnTunnelsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListVpnTunnelsPagedCallable() { + return stub.aggregatedListVpnTunnelsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of VPN tunnels. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListVpnTunnelsHttpRequest request = AggregatedListVpnTunnelsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     VpnTunnelAggregatedList response = vpnTunnelClient.aggregatedListVpnTunnelsCallable().call(request);
+   *     for (VpnTunnelsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListVpnTunnelsCallable() { + return stub.aggregatedListVpnTunnelsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified VpnTunnel resource. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
+   * }
+   * 
+ * + * @param vpnTunnel Name of the VpnTunnel resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteVpnTunnel(VpnTunnelName vpnTunnel) { + + DeleteVpnTunnelHttpRequest request = + DeleteVpnTunnelHttpRequest.newBuilder() + .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString()) + .build(); + return deleteVpnTunnel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified VpnTunnel resource. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel.toString());
+   * }
+   * 
+ * + * @param vpnTunnel Name of the VpnTunnel resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteVpnTunnel(String vpnTunnel) { + + DeleteVpnTunnelHttpRequest request = + DeleteVpnTunnelHttpRequest.newBuilder() + .setVpnTunnel(vpnTunnel) + .build(); + return deleteVpnTunnel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified VpnTunnel resource. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
+   *     .setVpnTunnel(vpnTunnel.toString())
+   *     .build();
+   *   Operation response = vpnTunnelClient.deleteVpnTunnel(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteVpnTunnel(DeleteVpnTunnelHttpRequest request) { + return deleteVpnTunnelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified VpnTunnel resource. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
+   *     .setVpnTunnel(vpnTunnel.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = vpnTunnelClient.deleteVpnTunnelCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteVpnTunnelCallable() { + return stub.deleteVpnTunnelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   VpnTunnel response = vpnTunnelClient.getVpnTunnel(vpnTunnel);
+   * }
+   * 
+ * + * @param vpnTunnel Name of the VpnTunnel resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final VpnTunnel getVpnTunnel(VpnTunnelName vpnTunnel) { + + GetVpnTunnelHttpRequest request = + GetVpnTunnelHttpRequest.newBuilder() + .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString()) + .build(); + return getVpnTunnel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   VpnTunnel response = vpnTunnelClient.getVpnTunnel(vpnTunnel.toString());
+   * }
+   * 
+ * + * @param vpnTunnel Name of the VpnTunnel resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final VpnTunnel getVpnTunnel(String vpnTunnel) { + + GetVpnTunnelHttpRequest request = + GetVpnTunnelHttpRequest.newBuilder() + .setVpnTunnel(vpnTunnel) + .build(); + return getVpnTunnel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   GetVpnTunnelHttpRequest request = GetVpnTunnelHttpRequest.newBuilder()
+   *     .setVpnTunnel(vpnTunnel.toString())
+   *     .build();
+   *   VpnTunnel response = vpnTunnelClient.getVpnTunnel(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final VpnTunnel getVpnTunnel(GetVpnTunnelHttpRequest request) { + return getVpnTunnelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   GetVpnTunnelHttpRequest request = GetVpnTunnelHttpRequest.newBuilder()
+   *     .setVpnTunnel(vpnTunnel.toString())
+   *     .build();
+   *   ApiFuture<VpnTunnel> future = vpnTunnelClient.getVpnTunnelCallable().futureCall(request);
+   *   // Do something
+   *   VpnTunnel response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getVpnTunnelCallable() { + return stub.getVpnTunnelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(region, vpnTunnelResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param vpnTunnelResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertVpnTunnel(RegionName region, VpnTunnel vpnTunnelResource) { + + InsertVpnTunnelHttpRequest request = + InsertVpnTunnelHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setVpnTunnelResource(vpnTunnelResource) + .build(); + return insertVpnTunnel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(region.toString(), vpnTunnelResource);
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @param vpnTunnelResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertVpnTunnel(String region, VpnTunnel vpnTunnelResource) { + + InsertVpnTunnelHttpRequest request = + InsertVpnTunnelHttpRequest.newBuilder() + .setRegion(region) + .setVpnTunnelResource(vpnTunnelResource) + .build(); + return insertVpnTunnel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
+   *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setVpnTunnelResource(vpnTunnelResource)
+   *     .build();
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertVpnTunnel(InsertVpnTunnelHttpRequest request) { + return insertVpnTunnelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
+   *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setVpnTunnelResource(vpnTunnelResource)
+   *     .build();
+   *   ApiFuture<Operation> future = vpnTunnelClient.insertVpnTunnelCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertVpnTunnelCallable() { + return stub.insertVpnTunnelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (VpnTunnel element : vpnTunnelClient.listVpnTunnels(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListVpnTunnelsPagedResponse listVpnTunnels(RegionName region) { + ListVpnTunnelsHttpRequest request = + ListVpnTunnelsHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listVpnTunnels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (VpnTunnel element : vpnTunnelClient.listVpnTunnels(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListVpnTunnelsPagedResponse listVpnTunnels(String region) { + ListVpnTunnelsHttpRequest request = + ListVpnTunnelsHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listVpnTunnels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListVpnTunnelsHttpRequest request = ListVpnTunnelsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (VpnTunnel element : vpnTunnelClient.listVpnTunnels(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListVpnTunnelsPagedResponse listVpnTunnels(ListVpnTunnelsHttpRequest request) { + return listVpnTunnelsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListVpnTunnelsHttpRequest request = ListVpnTunnelsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListVpnTunnelsPagedResponse> future = vpnTunnelClient.listVpnTunnelsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (VpnTunnel element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listVpnTunnelsPagedCallable() { + return stub.listVpnTunnelsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * Sample code: + *

+   * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListVpnTunnelsHttpRequest request = ListVpnTunnelsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     VpnTunnelList response = vpnTunnelClient.listVpnTunnelsCallable().call(request);
+   *     for (VpnTunnel element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listVpnTunnelsCallable() { + return stub.listVpnTunnelsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListVpnTunnelsPagedResponse extends AbstractPagedListResponse< + AggregatedListVpnTunnelsHttpRequest, + VpnTunnelAggregatedList, + VpnTunnelsScopedList, + AggregatedListVpnTunnelsPage, + AggregatedListVpnTunnelsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListVpnTunnelsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListVpnTunnelsPagedResponse apply(AggregatedListVpnTunnelsPage input) { + return new AggregatedListVpnTunnelsPagedResponse(input); + } + }); + } + + private AggregatedListVpnTunnelsPagedResponse(AggregatedListVpnTunnelsPage page) { + super(page, AggregatedListVpnTunnelsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListVpnTunnelsPage extends AbstractPage< + AggregatedListVpnTunnelsHttpRequest, + VpnTunnelAggregatedList, + VpnTunnelsScopedList, + AggregatedListVpnTunnelsPage> { + + private AggregatedListVpnTunnelsPage( + PageContext context, + VpnTunnelAggregatedList response) { + super(context, response); + } + + private static AggregatedListVpnTunnelsPage createEmptyPage() { + return new AggregatedListVpnTunnelsPage(null, null); + } + + @Override + protected AggregatedListVpnTunnelsPage createPage( + PageContext context, + VpnTunnelAggregatedList response) { + return new AggregatedListVpnTunnelsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListVpnTunnelsFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListVpnTunnelsHttpRequest, + VpnTunnelAggregatedList, + VpnTunnelsScopedList, + AggregatedListVpnTunnelsPage, + AggregatedListVpnTunnelsFixedSizeCollection> { + + private AggregatedListVpnTunnelsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListVpnTunnelsFixedSizeCollection createEmptyCollection() { + return new AggregatedListVpnTunnelsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListVpnTunnelsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListVpnTunnelsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListVpnTunnelsPagedResponse extends AbstractPagedListResponse< + ListVpnTunnelsHttpRequest, + VpnTunnelList, + VpnTunnel, + ListVpnTunnelsPage, + ListVpnTunnelsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListVpnTunnelsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListVpnTunnelsPagedResponse apply(ListVpnTunnelsPage input) { + return new ListVpnTunnelsPagedResponse(input); + } + }); + } + + private ListVpnTunnelsPagedResponse(ListVpnTunnelsPage page) { + super(page, ListVpnTunnelsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListVpnTunnelsPage extends AbstractPage< + ListVpnTunnelsHttpRequest, + VpnTunnelList, + VpnTunnel, + ListVpnTunnelsPage> { + + private ListVpnTunnelsPage( + PageContext context, + VpnTunnelList response) { + super(context, response); + } + + private static ListVpnTunnelsPage createEmptyPage() { + return new ListVpnTunnelsPage(null, null); + } + + @Override + protected ListVpnTunnelsPage createPage( + PageContext context, + VpnTunnelList response) { + return new ListVpnTunnelsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListVpnTunnelsFixedSizeCollection extends AbstractFixedSizeCollection< + ListVpnTunnelsHttpRequest, + VpnTunnelList, + VpnTunnel, + ListVpnTunnelsPage, + ListVpnTunnelsFixedSizeCollection> { + + private ListVpnTunnelsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListVpnTunnelsFixedSizeCollection createEmptyCollection() { + return new ListVpnTunnelsFixedSizeCollection(null, 0); + } + + @Override + protected ListVpnTunnelsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListVpnTunnelsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java new file mode 100644 index 000000000000..752c4474b1a6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class VpnTunnelList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private VpnTunnelList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private VpnTunnelList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (VpnTunnel item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(VpnTunnelList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static VpnTunnelList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final VpnTunnelList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new VpnTunnelList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(VpnTunnelList other) { + if (other == VpnTunnelList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(VpnTunnelList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(VpnTunnel items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public VpnTunnelList build() { + + + + + return new VpnTunnelList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "VpnTunnelList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VpnTunnelList) { + VpnTunnelList that = (VpnTunnelList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java new file mode 100644 index 000000000000..113cec4c852c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class VpnTunnelName implements ResourceName { + private final String project; + private final String region; + private final String vpnTunnel; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private VpnTunnelName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + vpnTunnel = Preconditions.checkNotNull(builder.getVpnTunnel()); + } + + public static VpnTunnelName of( + String project, + String region, + String vpnTunnel + ) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setVpnTunnel(vpnTunnel) + .build(); + } + + public static String format( + String project, + String region, + String vpnTunnel + ) { + return of( + project, + region, + vpnTunnel + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getVpnTunnel() { + return vpnTunnel; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("vpnTunnel", vpnTunnel); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public VpnTunnelName parse(String formattedString) {return VpnTunnelName.parse(formattedString);} + }; + } + + public static VpnTunnelName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "VpnTunnelName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("region"), + matchMap.get("vpnTunnel") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String vpnTunnel; + + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + public String getVpnTunnel() { + return vpnTunnel; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + public Builder setVpnTunnel(String vpnTunnel) { + this.vpnTunnel = vpnTunnel; + return this; + } + + private Builder() {} + + public Builder (VpnTunnelName vpnTunnelName) { + project = vpnTunnelName.project; + region = vpnTunnelName.region; + vpnTunnel = vpnTunnelName.vpnTunnel; + } + + public VpnTunnelName build() { + return new VpnTunnelName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "vpnTunnel", vpnTunnel + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VpnTunnelName) { + VpnTunnelName that = (VpnTunnelName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.vpnTunnel, that.getVpnTunnel()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + region, + vpnTunnel + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java new file mode 100644 index 000000000000..823260a567da --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import com.google.cloud.compute.v1.stub.VpnTunnelStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link VpnTunnelClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteVpnTunnel to 30 seconds: + * + *

+ * 
+ * VpnTunnelSettings.Builder vpnTunnelSettingsBuilder =
+ *     VpnTunnelSettings.newBuilder();
+ * vpnTunnelSettingsBuilder.deleteVpnTunnelSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * VpnTunnelSettings vpnTunnelSettings = vpnTunnelSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class VpnTunnelSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListVpnTunnels. + */ + public PagedCallSettings aggregatedListVpnTunnelsSettings() { + return ((VpnTunnelStubSettings) getStubSettings()).aggregatedListVpnTunnelsSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteVpnTunnel. + */ + public UnaryCallSettings deleteVpnTunnelSettings() { + return ((VpnTunnelStubSettings) getStubSettings()).deleteVpnTunnelSettings(); + } + + /** + * Returns the object with the settings used for calls to getVpnTunnel. + */ + public UnaryCallSettings getVpnTunnelSettings() { + return ((VpnTunnelStubSettings) getStubSettings()).getVpnTunnelSettings(); + } + + /** + * Returns the object with the settings used for calls to insertVpnTunnel. + */ + public UnaryCallSettings insertVpnTunnelSettings() { + return ((VpnTunnelStubSettings) getStubSettings()).insertVpnTunnelSettings(); + } + + /** + * Returns the object with the settings used for calls to listVpnTunnels. + */ + public PagedCallSettings listVpnTunnelsSettings() { + return ((VpnTunnelStubSettings) getStubSettings()).listVpnTunnelsSettings(); + } + + + public static final VpnTunnelSettings create(VpnTunnelStubSettings stub) throws IOException { + return new VpnTunnelSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return VpnTunnelStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return VpnTunnelStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return VpnTunnelStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return VpnTunnelStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return VpnTunnelStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return VpnTunnelStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return VpnTunnelStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return VpnTunnelStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected VpnTunnelSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for VpnTunnelSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(VpnTunnelStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(VpnTunnelStubSettings.newBuilder()); + } + + protected Builder(VpnTunnelSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(VpnTunnelStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public VpnTunnelStubSettings.Builder getStubSettingsBuilder() { + return ((VpnTunnelStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListVpnTunnels. + */ + public PagedCallSettings.Builder aggregatedListVpnTunnelsSettings() { + return getStubSettingsBuilder().aggregatedListVpnTunnelsSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteVpnTunnel. + */ + public UnaryCallSettings.Builder deleteVpnTunnelSettings() { + return getStubSettingsBuilder().deleteVpnTunnelSettings(); + } + + /** + * Returns the builder for the settings used for calls to getVpnTunnel. + */ + public UnaryCallSettings.Builder getVpnTunnelSettings() { + return getStubSettingsBuilder().getVpnTunnelSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertVpnTunnel. + */ + public UnaryCallSettings.Builder insertVpnTunnelSettings() { + return getStubSettingsBuilder().insertVpnTunnelSettings(); + } + + /** + * Returns the builder for the settings used for calls to listVpnTunnels. + */ + public PagedCallSettings.Builder listVpnTunnelsSettings() { + return getStubSettingsBuilder().listVpnTunnelsSettings(); + } + + @Override + public VpnTunnelSettings build() throws IOException { + return new VpnTunnelSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java new file mode 100644 index 000000000000..f9b10da57343 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class VpnTunnelsScopedList implements ApiMessage { + private final List vpnTunnels; + private final Warning warning; + + private VpnTunnelsScopedList() { + this.vpnTunnels = null; + this.warning = null; + } + + + private VpnTunnelsScopedList( + List vpnTunnels, + Warning warning + ) { + this.vpnTunnels = vpnTunnels; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("vpnTunnels") && vpnTunnels != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (VpnTunnel item : vpnTunnels) { + stringList.add(item.toString()); + } + fieldMap.put("vpnTunnels", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("vpnTunnels")) { + return String.valueOf(vpnTunnels); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getVpnTunnelsList() { + return vpnTunnels; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(VpnTunnelsScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static VpnTunnelsScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final VpnTunnelsScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new VpnTunnelsScopedList(); + } + + public static class Builder { + private List vpnTunnels; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(VpnTunnelsScopedList other) { + if (other == VpnTunnelsScopedList.getDefaultInstance()) return this; + if (other.getVpnTunnelsList() != null) { + this.vpnTunnels = other.vpnTunnels; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(VpnTunnelsScopedList source) { + this.vpnTunnels = source.vpnTunnels; + this.warning = source.warning; + } + + public List getVpnTunnelsList() { + return vpnTunnels; + } + + public Builder addAllVpnTunnels(List vpnTunnels) { + if (this.vpnTunnels == null) { + this.vpnTunnels = new ArrayList<>(vpnTunnels.size()); + } + this.vpnTunnels.addAll(vpnTunnels); + return this; + } + + public Builder addVpnTunnels(VpnTunnel vpnTunnels) { + this.vpnTunnels.add(vpnTunnels); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public VpnTunnelsScopedList build() { + + return new VpnTunnelsScopedList( + vpnTunnels, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllVpnTunnels(this.vpnTunnels); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "VpnTunnelsScopedList{" + + "vpnTunnels=" + vpnTunnels + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VpnTunnelsScopedList) { + VpnTunnelsScopedList that = (VpnTunnelsScopedList) o; + return + Objects.equals(this.vpnTunnels, that.getVpnTunnelsList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + vpnTunnels, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java new file mode 100644 index 000000000000..735ff1d81097 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java @@ -0,0 +1,242 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Warning implements ApiMessage { + private final String code; + private final List data; + private final String message; + + private Warning() { + this.code = null; + this.data = null; + this.message = null; + } + + + private Warning( + String code, + List data, + String message + ) { + this.code = code; + this.data = data; + this.message = message; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("data") && data != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Data item : data) { + stringList.add(item.toString()); + } + fieldMap.put("data", stringList.build()); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("code")) { + return String.valueOf(code); + } + if (fieldName.equals("data")) { + return String.valueOf(data); + } + if (fieldName.equals("message")) { + return String.valueOf(message); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCode() { + return code; + } + + public List getDataList() { + return data; + } + + public String getMessage() { + return message; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Warning prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Warning getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Warning DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Warning(); + } + + public static class Builder { + private String code; + private List data; + private String message; + + Builder() {} + + public Builder mergeFrom(Warning other) { + if (other == Warning.getDefaultInstance()) return this; + if (other.getCode() != null) { + this.code = other.code; + } + if (other.getDataList() != null) { + this.data = other.data; + } + if (other.getMessage() != null) { + this.message = other.message; + } + return this; + } + + Builder(Warning source) { + this.code = source.code; + this.data = source.data; + this.message = source.message; + } + + public String getCode() { + return code; + } + + public Builder setCode(String code) { + this.code = code; + return this; + } + + public List getDataList() { + return data; + } + + public Builder addAllData(List data) { + if (this.data == null) { + this.data = new ArrayList<>(data.size()); + } + this.data.addAll(data); + return this; + } + + public Builder addData(Data data) { + this.data.add(data); + return this; + } + + public String getMessage() { + return message; + } + + public Builder setMessage(String message) { + this.message = message; + return this; + } + + + public Warning build() { + + + return new Warning( + code, + data, + message + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCode(this.code); + newBuilder.addAllData(this.data); + newBuilder.setMessage(this.message); + return newBuilder; + } + } + + @Override + public String toString() { + return "Warning{" + + "code=" + code + ", " + + "data=" + data + ", " + + "message=" + message + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Warning) { + Warning that = (Warning) o; + return + Objects.equals(this.code, that.getCode()) && + Objects.equals(this.data, that.getDataList()) && + Objects.equals(this.message, that.getMessage()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + code, + data, + message + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java new file mode 100644 index 000000000000..ab20f171ccdf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java @@ -0,0 +1,242 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Warnings implements ApiMessage { + private final String code; + private final List data; + private final String message; + + private Warnings() { + this.code = null; + this.data = null; + this.message = null; + } + + + private Warnings( + String code, + List data, + String message + ) { + this.code = code; + this.data = data; + this.message = message; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("data") && data != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Data item : data) { + stringList.add(item.toString()); + } + fieldMap.put("data", stringList.build()); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("code")) { + return String.valueOf(code); + } + if (fieldName.equals("data")) { + return String.valueOf(data); + } + if (fieldName.equals("message")) { + return String.valueOf(message); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCode() { + return code; + } + + public List getDataList() { + return data; + } + + public String getMessage() { + return message; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Warnings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Warnings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Warnings DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Warnings(); + } + + public static class Builder { + private String code; + private List data; + private String message; + + Builder() {} + + public Builder mergeFrom(Warnings other) { + if (other == Warnings.getDefaultInstance()) return this; + if (other.getCode() != null) { + this.code = other.code; + } + if (other.getDataList() != null) { + this.data = other.data; + } + if (other.getMessage() != null) { + this.message = other.message; + } + return this; + } + + Builder(Warnings source) { + this.code = source.code; + this.data = source.data; + this.message = source.message; + } + + public String getCode() { + return code; + } + + public Builder setCode(String code) { + this.code = code; + return this; + } + + public List getDataList() { + return data; + } + + public Builder addAllData(List data) { + if (this.data == null) { + this.data = new ArrayList<>(data.size()); + } + this.data.addAll(data); + return this; + } + + public Builder addData(Data data) { + this.data.add(data); + return this; + } + + public String getMessage() { + return message; + } + + public Builder setMessage(String message) { + this.message = message; + return this; + } + + + public Warnings build() { + + + return new Warnings( + code, + data, + message + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCode(this.code); + newBuilder.addAllData(this.data); + newBuilder.setMessage(this.message); + return newBuilder; + } + } + + @Override + public String toString() { + return "Warnings{" + + "code=" + code + ", " + + "data=" + data + ", " + + "message=" + message + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Warnings) { + Warnings that = (Warnings) o; + return + Objects.equals(this.code, that.getCode()) && + Objects.equals(this.data, that.getDataList()) && + Objects.equals(this.message, that.getMessage()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + code, + data, + message + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java new file mode 100644 index 000000000000..d7347cfa5999 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java @@ -0,0 +1,434 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Zone implements ApiMessage { + private final String creationTimestamp; + private final DeprecationStatus deprecated; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String region; + private final String selfLink; + private final String status; + + private Zone() { + this.creationTimestamp = null; + this.deprecated = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.region = null; + this.selfLink = null; + this.status = null; + } + + + private Zone( + String creationTimestamp, + DeprecationStatus deprecated, + String description, + String id, + String kind, + String name, + String region, + String selfLink, + String status + ) { + this.creationTimestamp = creationTimestamp; + this.deprecated = deprecated; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.region = region; + this.selfLink = selfLink; + this.status = status; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStatus() { + return status; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Zone prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Zone getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Zone DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Zone(); + } + + public static class Builder { + private String creationTimestamp; + private DeprecationStatus deprecated; + private String description; + private String id; + private String kind; + private String name; + private String region; + private String selfLink; + private String status; + + Builder() {} + + public Builder mergeFrom(Zone other) { + if (other == Zone.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStatus() != null) { + this.status = other.status; + } + return this; + } + + Builder(Zone source) { + this.creationTimestamp = source.creationTimestamp; + this.deprecated = source.deprecated; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.region = source.region; + this.selfLink = source.selfLink; + this.status = source.status; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + + public Zone build() { + + + + + + + + + return new Zone( + creationTimestamp, + deprecated, + description, + id, + kind, + name, + region, + selfLink, + status + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); + return newBuilder; + } + } + + @Override + public String toString() { + return "Zone{" + + "creationTimestamp=" + creationTimestamp + ", " + + "deprecated=" + deprecated + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "region=" + region + ", " + + "selfLink=" + selfLink + ", " + + "status=" + status + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Zone) { + Zone that = (Zone) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.status, that.getStatus()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + deprecated, + description, + id, + kind, + name, + region, + selfLink, + status + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java new file mode 100644 index 000000000000..d4aa79597d73 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java @@ -0,0 +1,516 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.ZoneStub; +import com.google.cloud.compute.v1.stub.ZoneStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ZoneClient zoneClient = ZoneClient.create()) {
+ *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+ *   Zone response = zoneClient.getZone(zone);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the zoneClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of ZoneSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * ZoneSettings zoneSettings =
+ *     ZoneSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ZoneClient zoneClient =
+ *     ZoneClient.create(zoneSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ZoneSettings zoneSettings =
+ *     ZoneSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ZoneClient zoneClient =
+ *     ZoneClient.create(zoneSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ZoneClient implements BackgroundResource { + private final ZoneSettings settings; + private final ZoneStub stub; + + + + /** + * Constructs an instance of ZoneClient with default settings. + */ + public static final ZoneClient create() throws IOException { + return create(ZoneSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ZoneClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final ZoneClient create(ZoneSettings settings) throws IOException { + return new ZoneClient(settings); + } + + /** + * Constructs an instance of ZoneClient, using the given stub for making calls. This is for + * advanced usage - prefer to use ZoneSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ZoneClient create(ZoneStub stub) { + return new ZoneClient(stub); + } + + /** + * Constructs an instance of ZoneClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected ZoneClient(ZoneSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ZoneStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ZoneClient(ZoneStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ZoneSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ZoneStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Zone response = zoneClient.getZone(zone);
+   * }
+   * 
+ * + * @param zone Name of the zone resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Zone getZone(ZoneName zone) { + + GetZoneHttpRequest request = + GetZoneHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return getZone(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   Zone response = zoneClient.getZone(zone.toString());
+   * }
+   * 
+ * + * @param zone Name of the zone resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Zone getZone(String zone) { + + GetZoneHttpRequest request = + GetZoneHttpRequest.newBuilder() + .setZone(zone) + .build(); + return getZone(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   GetZoneHttpRequest request = GetZoneHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   Zone response = zoneClient.getZone(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Zone getZone(GetZoneHttpRequest request) { + return getZoneCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   GetZoneHttpRequest request = GetZoneHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<Zone> future = zoneClient.getZoneCallable().futureCall(request);
+   *   // Do something
+   *   Zone response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getZoneCallable() { + return stub.getZoneCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Zone resources available to the specified project. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Zone element : zoneClient.listZones(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListZonesPagedResponse listZones(ProjectName project) { + ListZonesHttpRequest request = + ListZonesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listZones(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Zone resources available to the specified project. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Zone element : zoneClient.listZones(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListZonesPagedResponse listZones(String project) { + ListZonesHttpRequest request = + ListZonesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listZones(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Zone resources available to the specified project. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListZonesHttpRequest request = ListZonesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Zone element : zoneClient.listZones(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListZonesPagedResponse listZones(ListZonesHttpRequest request) { + return listZonesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Zone resources available to the specified project. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListZonesHttpRequest request = ListZonesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListZonesPagedResponse> future = zoneClient.listZonesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Zone element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listZonesPagedCallable() { + return stub.listZonesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of Zone resources available to the specified project. + * + * Sample code: + *

+   * try (ZoneClient zoneClient = ZoneClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListZonesHttpRequest request = ListZonesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     ZoneList response = zoneClient.listZonesCallable().call(request);
+   *     for (Zone element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listZonesCallable() { + return stub.listZonesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListZonesPagedResponse extends AbstractPagedListResponse< + ListZonesHttpRequest, + ZoneList, + Zone, + ListZonesPage, + ListZonesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListZonesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListZonesPagedResponse apply(ListZonesPage input) { + return new ListZonesPagedResponse(input); + } + }); + } + + private ListZonesPagedResponse(ListZonesPage page) { + super(page, ListZonesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListZonesPage extends AbstractPage< + ListZonesHttpRequest, + ZoneList, + Zone, + ListZonesPage> { + + private ListZonesPage( + PageContext context, + ZoneList response) { + super(context, response); + } + + private static ListZonesPage createEmptyPage() { + return new ListZonesPage(null, null); + } + + @Override + protected ListZonesPage createPage( + PageContext context, + ZoneList response) { + return new ListZonesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListZonesFixedSizeCollection extends AbstractFixedSizeCollection< + ListZonesHttpRequest, + ZoneList, + Zone, + ListZonesPage, + ListZonesFixedSizeCollection> { + + private ListZonesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListZonesFixedSizeCollection createEmptyCollection() { + return new ListZonesFixedSizeCollection(null, 0); + } + + @Override + protected ListZonesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListZonesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java new file mode 100644 index 000000000000..efcf91e9dc5f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java @@ -0,0 +1,310 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ZoneList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + + private ZoneList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + } + + + private ZoneList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Zone item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ZoneList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ZoneList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ZoneList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ZoneList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(ZoneList other) { + if (other == ZoneList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(ZoneList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Zone items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public ZoneList build() { + + + + + return new ZoneList( + id, + items, + kind, + nextPageToken, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "ZoneList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ZoneList) { + ZoneList that = (ZoneList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java new file mode 100644 index 000000000000..67312bdfa023 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ZoneName implements ResourceName { + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ZoneName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static ZoneName of( + String project, + String zone + ) { + return newBuilder() + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String project, + String zone + ) { + return of( + project, + zone + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ZoneName parse(String formattedString) {return ZoneName.parse(formattedString);} + }; + } + + public static ZoneName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ZoneName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String zone; + + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (ZoneName zoneName) { + project = zoneName.project; + zone = zoneName.zone; + } + + public ZoneName build() { + return new ZoneName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ZoneName) { + ZoneName that = (ZoneName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java new file mode 100644 index 000000000000..393315ece23e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java @@ -0,0 +1,611 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.ZoneOperationStub; +import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+ *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+ *   zoneOperationClient.deleteZoneOperation(operation);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the zoneOperationClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of ZoneOperationSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * ZoneOperationSettings zoneOperationSettings =
+ *     ZoneOperationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ZoneOperationClient zoneOperationClient =
+ *     ZoneOperationClient.create(zoneOperationSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ZoneOperationSettings zoneOperationSettings =
+ *     ZoneOperationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ZoneOperationClient zoneOperationClient =
+ *     ZoneOperationClient.create(zoneOperationSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ZoneOperationClient implements BackgroundResource { + private final ZoneOperationSettings settings; + private final ZoneOperationStub stub; + + + + /** + * Constructs an instance of ZoneOperationClient with default settings. + */ + public static final ZoneOperationClient create() throws IOException { + return create(ZoneOperationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ZoneOperationClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final ZoneOperationClient create(ZoneOperationSettings settings) throws IOException { + return new ZoneOperationClient(settings); + } + + /** + * Constructs an instance of ZoneOperationClient, using the given stub for making calls. This is for + * advanced usage - prefer to use ZoneOperationSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ZoneOperationClient create(ZoneOperationStub stub) { + return new ZoneOperationClient(stub); + } + + /** + * Constructs an instance of ZoneOperationClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected ZoneOperationClient(ZoneOperationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ZoneOperationStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ZoneOperationClient(ZoneOperationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ZoneOperationSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ZoneOperationStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   zoneOperationClient.deleteZoneOperation(operation);
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteZoneOperation(ProjectZoneOperationName operation) { + + DeleteZoneOperationHttpRequest request = + DeleteZoneOperationHttpRequest.newBuilder() + .setOperation(operation == null ? null : operation.toString()) + .build(); + deleteZoneOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   zoneOperationClient.deleteZoneOperation(operation.toString());
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteZoneOperation(String operation) { + + DeleteZoneOperationHttpRequest request = + DeleteZoneOperationHttpRequest.newBuilder() + .setOperation(operation) + .build(); + deleteZoneOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   DeleteZoneOperationHttpRequest request = DeleteZoneOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   zoneOperationClient.deleteZoneOperation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final void deleteZoneOperation(DeleteZoneOperationHttpRequest request) { + deleteZoneOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   DeleteZoneOperationHttpRequest request = DeleteZoneOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   ApiFuture<Void> future = zoneOperationClient.deleteZoneOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteZoneOperationCallable() { + return stub.deleteZoneOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   Operation response = zoneOperationClient.getZoneOperation(operation);
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getZoneOperation(ProjectZoneOperationName operation) { + + GetZoneOperationHttpRequest request = + GetZoneOperationHttpRequest.newBuilder() + .setOperation(operation == null ? null : operation.toString()) + .build(); + return getZoneOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   Operation response = zoneOperationClient.getZoneOperation(operation.toString());
+   * }
+   * 
+ * + * @param operation Name of the Operations resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getZoneOperation(String operation) { + + GetZoneOperationHttpRequest request = + GetZoneOperationHttpRequest.newBuilder() + .setOperation(operation) + .build(); + return getZoneOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   GetZoneOperationHttpRequest request = GetZoneOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   Operation response = zoneOperationClient.getZoneOperation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation getZoneOperation(GetZoneOperationHttpRequest request) { + return getZoneOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified zone-specific Operations resource. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+   *   GetZoneOperationHttpRequest request = GetZoneOperationHttpRequest.newBuilder()
+   *     .setOperation(operation.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = zoneOperationClient.getZoneOperationCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getZoneOperationCallable() { + return stub.getZoneOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Operation element : zoneOperationClient.listZoneOperations(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone Name of the zone for request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListZoneOperationsPagedResponse listZoneOperations(ZoneName zone) { + ListZoneOperationsHttpRequest request = + ListZoneOperationsHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listZoneOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (Operation element : zoneOperationClient.listZoneOperations(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone Name of the zone for request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListZoneOperationsPagedResponse listZoneOperations(String zone) { + ListZoneOperationsHttpRequest request = + ListZoneOperationsHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listZoneOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (Operation element : zoneOperationClient.listZoneOperations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListZoneOperationsPagedResponse listZoneOperations(ListZoneOperationsHttpRequest request) { + return listZoneOperationsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListZoneOperationsPagedResponse> future = zoneOperationClient.listZoneOperationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Operation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listZoneOperationsPagedCallable() { + return stub.listZoneOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * Sample code: + *

+   * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     OperationList response = zoneOperationClient.listZoneOperationsCallable().call(request);
+   *     for (Operation element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listZoneOperationsCallable() { + return stub.listZoneOperationsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListZoneOperationsPagedResponse extends AbstractPagedListResponse< + ListZoneOperationsHttpRequest, + OperationList, + Operation, + ListZoneOperationsPage, + ListZoneOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListZoneOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListZoneOperationsPagedResponse apply(ListZoneOperationsPage input) { + return new ListZoneOperationsPagedResponse(input); + } + }); + } + + private ListZoneOperationsPagedResponse(ListZoneOperationsPage page) { + super(page, ListZoneOperationsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListZoneOperationsPage extends AbstractPage< + ListZoneOperationsHttpRequest, + OperationList, + Operation, + ListZoneOperationsPage> { + + private ListZoneOperationsPage( + PageContext context, + OperationList response) { + super(context, response); + } + + private static ListZoneOperationsPage createEmptyPage() { + return new ListZoneOperationsPage(null, null); + } + + @Override + protected ListZoneOperationsPage createPage( + PageContext context, + OperationList response) { + return new ListZoneOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListZoneOperationsFixedSizeCollection extends AbstractFixedSizeCollection< + ListZoneOperationsHttpRequest, + OperationList, + Operation, + ListZoneOperationsPage, + ListZoneOperationsFixedSizeCollection> { + + private ListZoneOperationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListZoneOperationsFixedSizeCollection createEmptyCollection() { + return new ListZoneOperationsFixedSizeCollection(null, 0); + } + + @Override + protected ListZoneOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListZoneOperationsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java new file mode 100644 index 000000000000..3f791014e24d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java @@ -0,0 +1,254 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ZoneOperationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteZoneOperation to 30 seconds: + * + *

+ * 
+ * ZoneOperationSettings.Builder zoneOperationSettingsBuilder =
+ *     ZoneOperationSettings.newBuilder();
+ * zoneOperationSettingsBuilder.deleteZoneOperationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ZoneOperationSettings zoneOperationSettings = zoneOperationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ZoneOperationSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteZoneOperation. + */ + public UnaryCallSettings deleteZoneOperationSettings() { + return ((ZoneOperationStubSettings) getStubSettings()).deleteZoneOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to getZoneOperation. + */ + public UnaryCallSettings getZoneOperationSettings() { + return ((ZoneOperationStubSettings) getStubSettings()).getZoneOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to listZoneOperations. + */ + public PagedCallSettings listZoneOperationsSettings() { + return ((ZoneOperationStubSettings) getStubSettings()).listZoneOperationsSettings(); + } + + + public static final ZoneOperationSettings create(ZoneOperationStubSettings stub) throws IOException { + return new ZoneOperationSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ZoneOperationStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return ZoneOperationStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return ZoneOperationStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return ZoneOperationStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ZoneOperationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return ZoneOperationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ZoneOperationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ZoneOperationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ZoneOperationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for ZoneOperationSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ZoneOperationStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ZoneOperationStubSettings.newBuilder()); + } + + protected Builder(ZoneOperationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ZoneOperationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public ZoneOperationStubSettings.Builder getStubSettingsBuilder() { + return ((ZoneOperationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteZoneOperation. + */ + public UnaryCallSettings.Builder deleteZoneOperationSettings() { + return getStubSettingsBuilder().deleteZoneOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to getZoneOperation. + */ + public UnaryCallSettings.Builder getZoneOperationSettings() { + return getStubSettingsBuilder().getZoneOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to listZoneOperations. + */ + public PagedCallSettings.Builder listZoneOperationsSettings() { + return getStubSettingsBuilder().listZoneOperationsSettings(); + } + + @Override + public ZoneOperationSettings build() throws IOException { + return new ZoneOperationSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java new file mode 100644 index 000000000000..63d8e7fbeacf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java @@ -0,0 +1,240 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import com.google.cloud.compute.v1.stub.ZoneStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ZoneClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getZone to 30 seconds: + * + *

+ * 
+ * ZoneSettings.Builder zoneSettingsBuilder =
+ *     ZoneSettings.newBuilder();
+ * zoneSettingsBuilder.getZoneSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ZoneSettings zoneSettings = zoneSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ZoneSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getZone. + */ + public UnaryCallSettings getZoneSettings() { + return ((ZoneStubSettings) getStubSettings()).getZoneSettings(); + } + + /** + * Returns the object with the settings used for calls to listZones. + */ + public PagedCallSettings listZonesSettings() { + return ((ZoneStubSettings) getStubSettings()).listZonesSettings(); + } + + + public static final ZoneSettings create(ZoneStubSettings stub) throws IOException { + return new ZoneSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ZoneStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return ZoneStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return ZoneStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return ZoneStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ZoneStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return ZoneStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ZoneStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ZoneStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ZoneSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for ZoneSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ZoneStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ZoneStubSettings.newBuilder()); + } + + protected Builder(ZoneSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ZoneStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public ZoneStubSettings.Builder getStubSettingsBuilder() { + return ((ZoneStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getZone. + */ + public UnaryCallSettings.Builder getZoneSettings() { + return getStubSettingsBuilder().getZoneSettings(); + } + + /** + * Returns the builder for the settings used for calls to listZones. + */ + public PagedCallSettings.Builder listZonesSettings() { + return getStubSettingsBuilder().listZonesSettings(); + } + + @Override + public ZoneSettings build() throws IOException { + return new ZoneSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java new file mode 100644 index 000000000000..671d81b24fb5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java @@ -0,0 +1,719 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Compute Engine API. + * + * The interfaces provided are listed below, along with usage samples. + * + * ============= + * AddressClient + * ============= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for AddressClient: + *
+ * 
+ * try (AddressClient addressClient = AddressClient.create()) {
+ *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ *   Operation response = addressClient.deleteAddress(address);
+ * }
+ * 
+ * 
+ * + * ================ + * AutoscalerClient + * ================ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for AutoscalerClient: + *
+ * 
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler);
+ * }
+ * 
+ * 
+ * + * ==================== + * BackendServiceClient + * ==================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for BackendServiceClient: + *
+ * 
+ * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+ *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+ *   Operation response = backendServiceClient.deleteBackendService(backendService);
+ * }
+ * 
+ * 
+ * + * ============== + * DiskTypeClient + * ============== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for DiskTypeClient: + *
+ * 
+ * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
+ *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+ *   DiskType response = diskTypeClient.getDiskType(diskType);
+ * }
+ * 
+ * 
+ * + * ========== + * DiskClient + * ========== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for DiskClient: + *
+ * 
+ * try (DiskClient diskClient = DiskClient.create()) {
+ *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+ *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+ *   Operation response = diskClient.createSnapshotDisk(disk, snapshotResource);
+ * }
+ * 
+ * 
+ * + * ============== + * FirewallClient + * ============== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for FirewallClient: + *
+ * 
+ * try (FirewallClient firewallClient = FirewallClient.create()) {
+ *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+ *   Operation response = firewallClient.deleteFirewall(firewall);
+ * }
+ * 
+ * 
+ * + * ==================== + * ForwardingRuleClient + * ==================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for ForwardingRuleClient: + *
+ * 
+ * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+ *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+ *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
+ * }
+ * 
+ * 
+ * + * =================== + * GlobalAddressClient + * =================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for GlobalAddressClient: + *
+ * 
+ * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+ *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+ *   Operation response = globalAddressClient.deleteGlobalAddress(address);
+ * }
+ * 
+ * 
+ * + * ========================== + * GlobalForwardingRuleClient + * ========================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for GlobalForwardingRuleClient: + *
+ * 
+ * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+ *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+ *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
+ * }
+ * 
+ * 
+ * + * ===================== + * GlobalOperationClient + * ===================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for GlobalOperationClient: + *
+ * 
+ * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
+ *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+ *   globalOperationClient.deleteGlobalOperation(operation);
+ * }
+ * 
+ * 
+ * + * ================= + * HealthCheckClient + * ================= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for HealthCheckClient: + *
+ * 
+ * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+ *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+ *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
+ * }
+ * 
+ * 
+ * + * ===================== + * HttpHealthCheckClient + * ===================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for HttpHealthCheckClient: + *
+ * 
+ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+ *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+ *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
+ * }
+ * 
+ * 
+ * + * ====================== + * HttpsHealthCheckClient + * ====================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for HttpsHealthCheckClient: + *
+ * 
+ * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+ *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+ *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
+ * }
+ * 
+ * 
+ * + * =========== + * ImageClient + * =========== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for ImageClient: + *
+ * 
+ * try (ImageClient imageClient = ImageClient.create()) {
+ *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+ *   Operation response = imageClient.deleteImage(image);
+ * }
+ * 
+ * 
+ * + * ========================== + * InstanceGroupManagerClient + * ========================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for InstanceGroupManagerClient: + *
+ * 
+ * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+ *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+ *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+ *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+ * }
+ * 
+ * 
+ * + * =================== + * InstanceGroupClient + * =================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for InstanceGroupClient: + *
+ * 
+ * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+ *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+ *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
+ *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
+ * }
+ * 
+ * 
+ * + * ====================== + * InstanceTemplateClient + * ====================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for InstanceTemplateClient: + *
+ * 
+ * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+ *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+ *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate);
+ * }
+ * 
+ * 
+ * + * ============== + * InstanceClient + * ============== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for InstanceClient: + *
+ * 
+ * try (InstanceClient instanceClient = InstanceClient.create()) {
+ *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+ *   String networkInterface = "";
+ *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+ *   Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource);
+ * }
+ * 
+ * 
+ * + * ============ + * LicensClient + * ============ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for LicensClient: + *
+ * 
+ * try (LicensClient licensClient = LicensClient.create()) {
+ *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+ *   License response = licensClient.getLicens(license);
+ * }
+ * 
+ * 
+ * + * ================= + * MachineTypeClient + * ================= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for MachineTypeClient: + *
+ * 
+ * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
+ *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+ *   MachineType response = machineTypeClient.getMachineType(machineType);
+ * }
+ * 
+ * 
+ * + * ============= + * NetworkClient + * ============= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for NetworkClient: + *
+ * 
+ * try (NetworkClient networkClient = NetworkClient.create()) {
+ *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+ *   Operation response = networkClient.deleteNetwork(network);
+ * }
+ * 
+ * 
+ * + * ============= + * ProjectClient + * ============= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for ProjectClient: + *
+ * 
+ * try (ProjectClient projectClient = ProjectClient.create()) {
+ *   ProjectName project = ProjectName.of("[PROJECT]");
+ *   Project response = projectClient.getProject(project);
+ * }
+ * 
+ * 
+ * + * ====================== + * RegionAutoscalerClient + * ====================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionAutoscalerClient: + *
+ * 
+ * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+ *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+ *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
+ * }
+ * 
+ * 
+ * + * ========================== + * RegionBackendServiceClient + * ========================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionBackendServiceClient: + *
+ * 
+ * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+ *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
+ *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
+ * }
+ * 
+ * 
+ * + * ================================ + * RegionInstanceGroupManagerClient + * ================================ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionInstanceGroupManagerClient: + *
+ * 
+ * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+ *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+ *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
+ *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+ * }
+ * 
+ * 
+ * + * ========================= + * RegionInstanceGroupClient + * ========================= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionInstanceGroupClient: + *
+ * 
+ * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+ *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
+ *   InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup);
+ * }
+ * 
+ * 
+ * + * ===================== + * RegionOperationClient + * ===================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionOperationClient: + *
+ * 
+ * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
+ *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
+ *   regionOperationClient.deleteRegionOperation(operation);
+ * }
+ * 
+ * 
+ * + * ============ + * RegionClient + * ============ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionClient: + *
+ * 
+ * try (RegionClient regionClient = RegionClient.create()) {
+ *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+ *   Region response = regionClient.getRegion(region);
+ * }
+ * 
+ * 
+ * + * ============ + * RouterClient + * ============ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RouterClient: + *
+ * 
+ * try (RouterClient routerClient = RouterClient.create()) {
+ *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+ *   Operation response = routerClient.deleteRouter(router);
+ * }
+ * 
+ * 
+ * + * =========== + * RouteClient + * =========== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RouteClient: + *
+ * 
+ * try (RouteClient routeClient = RouteClient.create()) {
+ *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+ *   Operation response = routeClient.deleteRoute(route);
+ * }
+ * 
+ * 
+ * + * ============== + * SnapshotClient + * ============== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for SnapshotClient: + *
+ * 
+ * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+ *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ *   Operation response = snapshotClient.deleteSnapshot(snapshot);
+ * }
+ * 
+ * 
+ * + * ==================== + * SslCertificateClient + * ==================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for SslCertificateClient: + *
+ * 
+ * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+ *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+ *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
+ * }
+ * 
+ * 
+ * + * ================ + * SubnetworkClient + * ================ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for SubnetworkClient: + *
+ * 
+ * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+ *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+ *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
+ * }
+ * 
+ * 
+ * + * ===================== + * TargetHttpProxyClient + * ===================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetHttpProxyClient: + *
+ * 
+ * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+ *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+ *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
+ * }
+ * 
+ * 
+ * + * ====================== + * TargetHttpsProxyClient + * ====================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetHttpsProxyClient: + *
+ * 
+ * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+ *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+ *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
+ * }
+ * 
+ * 
+ * + * ==================== + * TargetInstanceClient + * ==================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetInstanceClient: + *
+ * 
+ * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+ *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+ *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
+ * }
+ * 
+ * 
+ * + * ================ + * TargetPoolClient + * ================ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetPoolClient: + *
+ * 
+ * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+ *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+ *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
+ *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
+ * }
+ * 
+ * 
+ * + * ==================== + * TargetSslProxyClient + * ==================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetSslProxyClient: + *
+ * 
+ * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+ *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+ *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
+ * }
+ * 
+ * 
+ * + * ====================== + * TargetVpnGatewayClient + * ====================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetVpnGatewayClient: + *
+ * 
+ * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+ *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+ *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
+ * }
+ * 
+ * 
+ * + * ============ + * UrlMapClient + * ============ + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for UrlMapClient: + *
+ * 
+ * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+ *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+ *   Operation response = urlMapClient.deleteUrlMap(urlMap);
+ * }
+ * 
+ * 
+ * + * =============== + * VpnTunnelClient + * =============== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for VpnTunnelClient: + *
+ * 
+ * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+ *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+ *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
+ * }
+ * 
+ * 
+ * + * =================== + * ZoneOperationClient + * =================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for ZoneOperationClient: + *
+ * 
+ * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
+ *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
+ *   zoneOperationClient.deleteZoneOperation(operation);
+ * }
+ * 
+ * 
+ * + * ========== + * ZoneClient + * ========== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for ZoneClient: + *
+ * 
+ * try (ZoneClient zoneClient = ZoneClient.create()) {
+ *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+ *   Zone response = zoneClient.getZone(zone);
+ * }
+ * 
+ * 
+ * + */ + +package com.google.cloud.compute.v1; \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java new file mode 100644 index 000000000000..a359c8b1c24c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressAggregatedList; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.AddressName; +import com.google.cloud.compute.v1.AddressesScopedList; +import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; +import com.google.cloud.compute.v1.DeleteAddressHttpRequest; +import com.google.cloud.compute.v1.GetAddressHttpRequest; +import com.google.cloud.compute.v1.InsertAddressHttpRequest; +import com.google.cloud.compute.v1.ListAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AddressStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListAddressesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListAddressesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListAddressesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListAddressesCallable()"); + } + + @BetaApi + public UnaryCallable deleteAddressCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAddressCallable()"); + } + + @BetaApi + public UnaryCallable getAddressCallable() { + throw new UnsupportedOperationException("Not implemented: getAddressCallable()"); + } + + @BetaApi + public UnaryCallable insertAddressCallable() { + throw new UnsupportedOperationException("Not implemented: insertAddressCallable()"); + } + + @BetaApi + public UnaryCallable listAddressesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAddressesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listAddressesCallable() { + throw new UnsupportedOperationException("Not implemented: listAddressesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java new file mode 100644 index 000000000000..329451652249 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressAggregatedList; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.AddressesScopedList; +import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; +import com.google.cloud.compute.v1.DeleteAddressHttpRequest; +import com.google.cloud.compute.v1.GetAddressHttpRequest; +import com.google.cloud.compute.v1.InsertAddressHttpRequest; +import com.google.cloud.compute.v1.ListAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AddressStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteAddress to 30 seconds: + * + *

+ * 
+ * AddressStubSettings.Builder addressSettingsBuilder =
+ *     AddressStubSettings.newBuilder();
+ * addressSettingsBuilder.deleteAddressSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AddressStubSettings addressSettings = addressSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AddressStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListAddressesSettings; + private final UnaryCallSettings deleteAddressSettings; + private final UnaryCallSettings getAddressSettings; + private final UnaryCallSettings insertAddressSettings; + private final PagedCallSettings listAddressesSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListAddresses. + */ + public PagedCallSettings aggregatedListAddressesSettings() { + return aggregatedListAddressesSettings; + } + + /** + * Returns the object with the settings used for calls to deleteAddress. + */ + public UnaryCallSettings deleteAddressSettings() { + return deleteAddressSettings; + } + + /** + * Returns the object with the settings used for calls to getAddress. + */ + public UnaryCallSettings getAddressSettings() { + return getAddressSettings; + } + + /** + * Returns the object with the settings used for calls to insertAddress. + */ + public UnaryCallSettings insertAddressSettings() { + return insertAddressSettings; + } + + /** + * Returns the object with the settings used for calls to listAddresses. + */ + public PagedCallSettings listAddressesSettings() { + return listAddressesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AddressStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAddressStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AddressStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AddressStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListAddressesSettings = settingsBuilder.aggregatedListAddressesSettings().build(); + deleteAddressSettings = settingsBuilder.deleteAddressSettings().build(); + getAddressSettings = settingsBuilder.getAddressSettings().build(); + insertAddressSettings = settingsBuilder.insertAddressSettings().build(); + listAddressesSettings = settingsBuilder.listAddressesSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_ADDRESSES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListAddressesHttpRequest injectToken(AggregatedListAddressesHttpRequest payload, String token) { + return AggregatedListAddressesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListAddressesHttpRequest injectPageSize(AggregatedListAddressesHttpRequest payload, int pageSize) { + return AggregatedListAddressesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListAddressesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AddressAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(AddressAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_ADDRESSES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListAddressesHttpRequest injectToken(ListAddressesHttpRequest payload, String token) { + return ListAddressesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListAddressesHttpRequest injectPageSize(ListAddressesHttpRequest payload, int pageSize) { + return ListAddressesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListAddressesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AddressList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable
extractResources(AddressList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_ADDRESSES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListAddressesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_ADDRESSES_PAGE_STR_DESC, request, context); + return AggregatedListAddressesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_ADDRESSES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAddressesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ADDRESSES_PAGE_STR_DESC, request, context); + return ListAddressesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for AddressStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListAddressesSettings; + private final UnaryCallSettings.Builder deleteAddressSettings; + private final UnaryCallSettings.Builder getAddressSettings; + private final UnaryCallSettings.Builder insertAddressSettings; + private final PagedCallSettings.Builder listAddressesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListAddressesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_ADDRESSES_PAGE_STR_FACT); + + deleteAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listAddressesSettings = PagedCallSettings.newBuilder( + LIST_ADDRESSES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListAddressesSettings, + deleteAddressSettings, + getAddressSettings, + insertAddressSettings, + listAddressesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListAddressesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteAddressSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getAddressSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertAddressSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listAddressesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(AddressStubSettings settings) { + super(settings); + + aggregatedListAddressesSettings = settings.aggregatedListAddressesSettings.toBuilder(); + deleteAddressSettings = settings.deleteAddressSettings.toBuilder(); + getAddressSettings = settings.getAddressSettings.toBuilder(); + insertAddressSettings = settings.insertAddressSettings.toBuilder(); + listAddressesSettings = settings.listAddressesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListAddressesSettings, + deleteAddressSettings, + getAddressSettings, + insertAddressSettings, + listAddressesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListAddresses. + */ + public PagedCallSettings.Builder aggregatedListAddressesSettings() { + return aggregatedListAddressesSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteAddress. + */ + public UnaryCallSettings.Builder deleteAddressSettings() { + return deleteAddressSettings; + } + + /** + * Returns the builder for the settings used for calls to getAddress. + */ + public UnaryCallSettings.Builder getAddressSettings() { + return getAddressSettings; + } + + /** + * Returns the builder for the settings used for calls to insertAddress. + */ + public UnaryCallSettings.Builder insertAddressSettings() { + return insertAddressSettings; + } + + /** + * Returns the builder for the settings used for calls to listAddresses. + */ + public PagedCallSettings.Builder listAddressesSettings() { + return listAddressesSettings; + } + + @Override + public AddressStubSettings build() throws IOException { + return new AddressStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java new file mode 100644 index 000000000000..544200ef9eea --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.AutoscalerAggregatedList; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import com.google.cloud.compute.v1.AutoscalerList; +import com.google.cloud.compute.v1.AutoscalerName; +import com.google.cloud.compute.v1.AutoscalersScopedList; +import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AutoscalerStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListAutoscalersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListAutoscalersPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListAutoscalersCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListAutoscalersCallable()"); + } + + @BetaApi + public UnaryCallable deleteAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable getAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: getAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable insertAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: insertAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable listAutoscalersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAutoscalersPagedCallable()"); + } + + @BetaApi + public UnaryCallable listAutoscalersCallable() { + throw new UnsupportedOperationException("Not implemented: listAutoscalersCallable()"); + } + + @BetaApi + public UnaryCallable patchAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: patchAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable updateAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: updateAutoscalerCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java new file mode 100644 index 000000000000..ef15518d7e1c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java @@ -0,0 +1,580 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.AutoscalerAggregatedList; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import com.google.cloud.compute.v1.AutoscalerList; +import com.google.cloud.compute.v1.AutoscalersScopedList; +import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest; +import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AutoscalerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteAutoscaler to 30 seconds: + * + *

+ * 
+ * AutoscalerStubSettings.Builder autoscalerSettingsBuilder =
+ *     AutoscalerStubSettings.newBuilder();
+ * autoscalerSettingsBuilder.deleteAutoscalerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoscalerStubSettings autoscalerSettings = autoscalerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AutoscalerStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListAutoscalersSettings; + private final UnaryCallSettings deleteAutoscalerSettings; + private final UnaryCallSettings getAutoscalerSettings; + private final UnaryCallSettings insertAutoscalerSettings; + private final PagedCallSettings listAutoscalersSettings; + private final UnaryCallSettings patchAutoscalerSettings; + private final UnaryCallSettings updateAutoscalerSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListAutoscalers. + */ + public PagedCallSettings aggregatedListAutoscalersSettings() { + return aggregatedListAutoscalersSettings; + } + + /** + * Returns the object with the settings used for calls to deleteAutoscaler. + */ + public UnaryCallSettings deleteAutoscalerSettings() { + return deleteAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to getAutoscaler. + */ + public UnaryCallSettings getAutoscalerSettings() { + return getAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to insertAutoscaler. + */ + public UnaryCallSettings insertAutoscalerSettings() { + return insertAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to listAutoscalers. + */ + public PagedCallSettings listAutoscalersSettings() { + return listAutoscalersSettings; + } + + /** + * Returns the object with the settings used for calls to patchAutoscaler. + */ + public UnaryCallSettings patchAutoscalerSettings() { + return patchAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to updateAutoscaler. + */ + public UnaryCallSettings updateAutoscalerSettings() { + return updateAutoscalerSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AutoscalerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAutoscalerStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AutoscalerStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AutoscalerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListAutoscalersSettings = settingsBuilder.aggregatedListAutoscalersSettings().build(); + deleteAutoscalerSettings = settingsBuilder.deleteAutoscalerSettings().build(); + getAutoscalerSettings = settingsBuilder.getAutoscalerSettings().build(); + insertAutoscalerSettings = settingsBuilder.insertAutoscalerSettings().build(); + listAutoscalersSettings = settingsBuilder.listAutoscalersSettings().build(); + patchAutoscalerSettings = settingsBuilder.patchAutoscalerSettings().build(); + updateAutoscalerSettings = settingsBuilder.updateAutoscalerSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListAutoscalersHttpRequest injectToken(AggregatedListAutoscalersHttpRequest payload, String token) { + return AggregatedListAutoscalersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListAutoscalersHttpRequest injectPageSize(AggregatedListAutoscalersHttpRequest payload, int pageSize) { + return AggregatedListAutoscalersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListAutoscalersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AutoscalerAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(AutoscalerAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_AUTOSCALERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListAutoscalersHttpRequest injectToken(ListAutoscalersHttpRequest payload, String token) { + return ListAutoscalersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListAutoscalersHttpRequest injectPageSize(ListAutoscalersHttpRequest payload, int pageSize) { + return ListAutoscalersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListAutoscalersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AutoscalerList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(AutoscalerList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListAutoscalersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_DESC, request, context); + return AggregatedListAutoscalersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_AUTOSCALERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAutoscalersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_AUTOSCALERS_PAGE_STR_DESC, request, context); + return ListAutoscalersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for AutoscalerStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListAutoscalersSettings; + private final UnaryCallSettings.Builder deleteAutoscalerSettings; + private final UnaryCallSettings.Builder getAutoscalerSettings; + private final UnaryCallSettings.Builder insertAutoscalerSettings; + private final PagedCallSettings.Builder listAutoscalersSettings; + private final UnaryCallSettings.Builder patchAutoscalerSettings; + private final UnaryCallSettings.Builder updateAutoscalerSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListAutoscalersSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_FACT); + + deleteAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listAutoscalersSettings = PagedCallSettings.newBuilder( + LIST_AUTOSCALERS_PAGE_STR_FACT); + + patchAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListAutoscalersSettings, + deleteAutoscalerSettings, + getAutoscalerSettings, + insertAutoscalerSettings, + listAutoscalersSettings, + patchAutoscalerSettings, + updateAutoscalerSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListAutoscalersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listAutoscalersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(AutoscalerStubSettings settings) { + super(settings); + + aggregatedListAutoscalersSettings = settings.aggregatedListAutoscalersSettings.toBuilder(); + deleteAutoscalerSettings = settings.deleteAutoscalerSettings.toBuilder(); + getAutoscalerSettings = settings.getAutoscalerSettings.toBuilder(); + insertAutoscalerSettings = settings.insertAutoscalerSettings.toBuilder(); + listAutoscalersSettings = settings.listAutoscalersSettings.toBuilder(); + patchAutoscalerSettings = settings.patchAutoscalerSettings.toBuilder(); + updateAutoscalerSettings = settings.updateAutoscalerSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListAutoscalersSettings, + deleteAutoscalerSettings, + getAutoscalerSettings, + insertAutoscalerSettings, + listAutoscalersSettings, + patchAutoscalerSettings, + updateAutoscalerSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListAutoscalers. + */ + public PagedCallSettings.Builder aggregatedListAutoscalersSettings() { + return aggregatedListAutoscalersSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteAutoscaler. + */ + public UnaryCallSettings.Builder deleteAutoscalerSettings() { + return deleteAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to getAutoscaler. + */ + public UnaryCallSettings.Builder getAutoscalerSettings() { + return getAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to insertAutoscaler. + */ + public UnaryCallSettings.Builder insertAutoscalerSettings() { + return insertAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to listAutoscalers. + */ + public PagedCallSettings.Builder listAutoscalersSettings() { + return listAutoscalersSettings; + } + + /** + * Returns the builder for the settings used for calls to patchAutoscaler. + */ + public UnaryCallSettings.Builder patchAutoscalerSettings() { + return patchAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to updateAutoscaler. + */ + public UnaryCallSettings.Builder updateAutoscalerSettings() { + return updateAutoscalerSettings; + } + + @Override + public AutoscalerStubSettings build() throws IOException { + return new AutoscalerStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java new file mode 100644 index 000000000000..91d66c942e75 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java @@ -0,0 +1,103 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceAggregatedList; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.BackendServiceName; +import com.google.cloud.compute.v1.BackendServicesScopedList; +import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class BackendServiceStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListBackendServicesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListBackendServicesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListBackendServicesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListBackendServicesCallable()"); + } + + @BetaApi + public UnaryCallable deleteBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable getBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: getBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable getHealthBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: getHealthBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable insertBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: insertBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable listBackendServicesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackendServicesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listBackendServicesCallable() { + throw new UnsupportedOperationException("Not implemented: listBackendServicesCallable()"); + } + + @BetaApi + public UnaryCallable patchBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: patchBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable updateBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackendServiceCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java new file mode 100644 index 000000000000..76b04d455620 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java @@ -0,0 +1,608 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceAggregatedList; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.BackendServicesScopedList; +import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; +import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link BackendServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteBackendService to 30 seconds: + * + *

+ * 
+ * BackendServiceStubSettings.Builder backendServiceSettingsBuilder =
+ *     BackendServiceStubSettings.newBuilder();
+ * backendServiceSettingsBuilder.deleteBackendServiceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * BackendServiceStubSettings backendServiceSettings = backendServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class BackendServiceStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListBackendServicesSettings; + private final UnaryCallSettings deleteBackendServiceSettings; + private final UnaryCallSettings getBackendServiceSettings; + private final UnaryCallSettings getHealthBackendServiceSettings; + private final UnaryCallSettings insertBackendServiceSettings; + private final PagedCallSettings listBackendServicesSettings; + private final UnaryCallSettings patchBackendServiceSettings; + private final UnaryCallSettings updateBackendServiceSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListBackendServices. + */ + public PagedCallSettings aggregatedListBackendServicesSettings() { + return aggregatedListBackendServicesSettings; + } + + /** + * Returns the object with the settings used for calls to deleteBackendService. + */ + public UnaryCallSettings deleteBackendServiceSettings() { + return deleteBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to getBackendService. + */ + public UnaryCallSettings getBackendServiceSettings() { + return getBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to getHealthBackendService. + */ + public UnaryCallSettings getHealthBackendServiceSettings() { + return getHealthBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to insertBackendService. + */ + public UnaryCallSettings insertBackendServiceSettings() { + return insertBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to listBackendServices. + */ + public PagedCallSettings listBackendServicesSettings() { + return listBackendServicesSettings; + } + + /** + * Returns the object with the settings used for calls to patchBackendService. + */ + public UnaryCallSettings patchBackendServiceSettings() { + return patchBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to updateBackendService. + */ + public UnaryCallSettings updateBackendServiceSettings() { + return updateBackendServiceSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BackendServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonBackendServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BackendServiceStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BackendServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListBackendServicesSettings = settingsBuilder.aggregatedListBackendServicesSettings().build(); + deleteBackendServiceSettings = settingsBuilder.deleteBackendServiceSettings().build(); + getBackendServiceSettings = settingsBuilder.getBackendServiceSettings().build(); + getHealthBackendServiceSettings = settingsBuilder.getHealthBackendServiceSettings().build(); + insertBackendServiceSettings = settingsBuilder.insertBackendServiceSettings().build(); + listBackendServicesSettings = settingsBuilder.listBackendServicesSettings().build(); + patchBackendServiceSettings = settingsBuilder.patchBackendServiceSettings().build(); + updateBackendServiceSettings = settingsBuilder.updateBackendServiceSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListBackendServicesHttpRequest injectToken(AggregatedListBackendServicesHttpRequest payload, String token) { + return AggregatedListBackendServicesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListBackendServicesHttpRequest injectPageSize(AggregatedListBackendServicesHttpRequest payload, int pageSize) { + return AggregatedListBackendServicesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListBackendServicesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(BackendServiceAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(BackendServiceAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_BACKEND_SERVICES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListBackendServicesHttpRequest injectToken(ListBackendServicesHttpRequest payload, String token) { + return ListBackendServicesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListBackendServicesHttpRequest injectPageSize(ListBackendServicesHttpRequest payload, int pageSize) { + return ListBackendServicesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListBackendServicesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(BackendServiceList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(BackendServiceList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListBackendServicesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_DESC, request, context); + return AggregatedListBackendServicesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_BACKEND_SERVICES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackendServicesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKEND_SERVICES_PAGE_STR_DESC, request, context); + return ListBackendServicesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for BackendServiceStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListBackendServicesSettings; + private final UnaryCallSettings.Builder deleteBackendServiceSettings; + private final UnaryCallSettings.Builder getBackendServiceSettings; + private final UnaryCallSettings.Builder getHealthBackendServiceSettings; + private final UnaryCallSettings.Builder insertBackendServiceSettings; + private final PagedCallSettings.Builder listBackendServicesSettings; + private final UnaryCallSettings.Builder patchBackendServiceSettings; + private final UnaryCallSettings.Builder updateBackendServiceSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListBackendServicesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT); + + deleteBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getHealthBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listBackendServicesSettings = PagedCallSettings.newBuilder( + LIST_BACKEND_SERVICES_PAGE_STR_FACT); + + patchBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListBackendServicesSettings, + deleteBackendServiceSettings, + getBackendServiceSettings, + getHealthBackendServiceSettings, + insertBackendServiceSettings, + listBackendServicesSettings, + patchBackendServiceSettings, + updateBackendServiceSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListBackendServicesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getHealthBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listBackendServicesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(BackendServiceStubSettings settings) { + super(settings); + + aggregatedListBackendServicesSettings = settings.aggregatedListBackendServicesSettings.toBuilder(); + deleteBackendServiceSettings = settings.deleteBackendServiceSettings.toBuilder(); + getBackendServiceSettings = settings.getBackendServiceSettings.toBuilder(); + getHealthBackendServiceSettings = settings.getHealthBackendServiceSettings.toBuilder(); + insertBackendServiceSettings = settings.insertBackendServiceSettings.toBuilder(); + listBackendServicesSettings = settings.listBackendServicesSettings.toBuilder(); + patchBackendServiceSettings = settings.patchBackendServiceSettings.toBuilder(); + updateBackendServiceSettings = settings.updateBackendServiceSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListBackendServicesSettings, + deleteBackendServiceSettings, + getBackendServiceSettings, + getHealthBackendServiceSettings, + insertBackendServiceSettings, + listBackendServicesSettings, + patchBackendServiceSettings, + updateBackendServiceSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListBackendServices. + */ + public PagedCallSettings.Builder aggregatedListBackendServicesSettings() { + return aggregatedListBackendServicesSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteBackendService. + */ + public UnaryCallSettings.Builder deleteBackendServiceSettings() { + return deleteBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to getBackendService. + */ + public UnaryCallSettings.Builder getBackendServiceSettings() { + return getBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to getHealthBackendService. + */ + public UnaryCallSettings.Builder getHealthBackendServiceSettings() { + return getHealthBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to insertBackendService. + */ + public UnaryCallSettings.Builder insertBackendServiceSettings() { + return insertBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to listBackendServices. + */ + public PagedCallSettings.Builder listBackendServicesSettings() { + return listBackendServicesSettings; + } + + /** + * Returns the builder for the settings used for calls to patchBackendService. + */ + public UnaryCallSettings.Builder patchBackendServiceSettings() { + return patchBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to updateBackendService. + */ + public UnaryCallSettings.Builder updateBackendServiceSettings() { + return updateBackendServiceSettings; + } + + @Override + public BackendServiceStubSettings build() throws IOException { + return new BackendServiceStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java new file mode 100644 index 000000000000..8d2ea0d902bc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; +import com.google.cloud.compute.v1.CreateSnapshotDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskAggregatedList; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.DiskName; +import com.google.cloud.compute.v1.DisksResizeRequest; +import com.google.cloud.compute.v1.DisksScopedList; +import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.InsertDiskHttpRequest; +import com.google.cloud.compute.v1.ListDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.Snapshot; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class DiskStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListDisksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListDisksPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListDisksCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListDisksCallable()"); + } + + @BetaApi + public UnaryCallable createSnapshotDiskCallable() { + throw new UnsupportedOperationException("Not implemented: createSnapshotDiskCallable()"); + } + + @BetaApi + public UnaryCallable deleteDiskCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDiskCallable()"); + } + + @BetaApi + public UnaryCallable getDiskCallable() { + throw new UnsupportedOperationException("Not implemented: getDiskCallable()"); + } + + @BetaApi + public UnaryCallable insertDiskCallable() { + throw new UnsupportedOperationException("Not implemented: insertDiskCallable()"); + } + + @BetaApi + public UnaryCallable listDisksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDisksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listDisksCallable() { + throw new UnsupportedOperationException("Not implemented: listDisksCallable()"); + } + + @BetaApi + public UnaryCallable resizeDiskCallable() { + throw new UnsupportedOperationException("Not implemented: resizeDiskCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java new file mode 100644 index 000000000000..2fbab0b0a3b9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java @@ -0,0 +1,580 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; +import com.google.cloud.compute.v1.CreateSnapshotDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskAggregatedList; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.DisksScopedList; +import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.InsertDiskHttpRequest; +import com.google.cloud.compute.v1.ListDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link DiskStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of createSnapshotDisk to 30 seconds: + * + *

+ * 
+ * DiskStubSettings.Builder diskSettingsBuilder =
+ *     DiskStubSettings.newBuilder();
+ * diskSettingsBuilder.createSnapshotDiskSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * DiskStubSettings diskSettings = diskSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class DiskStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListDisksSettings; + private final UnaryCallSettings createSnapshotDiskSettings; + private final UnaryCallSettings deleteDiskSettings; + private final UnaryCallSettings getDiskSettings; + private final UnaryCallSettings insertDiskSettings; + private final PagedCallSettings listDisksSettings; + private final UnaryCallSettings resizeDiskSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListDisks. + */ + public PagedCallSettings aggregatedListDisksSettings() { + return aggregatedListDisksSettings; + } + + /** + * Returns the object with the settings used for calls to createSnapshotDisk. + */ + public UnaryCallSettings createSnapshotDiskSettings() { + return createSnapshotDiskSettings; + } + + /** + * Returns the object with the settings used for calls to deleteDisk. + */ + public UnaryCallSettings deleteDiskSettings() { + return deleteDiskSettings; + } + + /** + * Returns the object with the settings used for calls to getDisk. + */ + public UnaryCallSettings getDiskSettings() { + return getDiskSettings; + } + + /** + * Returns the object with the settings used for calls to insertDisk. + */ + public UnaryCallSettings insertDiskSettings() { + return insertDiskSettings; + } + + /** + * Returns the object with the settings used for calls to listDisks. + */ + public PagedCallSettings listDisksSettings() { + return listDisksSettings; + } + + /** + * Returns the object with the settings used for calls to resizeDisk. + */ + public UnaryCallSettings resizeDiskSettings() { + return resizeDiskSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DiskStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDiskStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DiskStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DiskStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListDisksSettings = settingsBuilder.aggregatedListDisksSettings().build(); + createSnapshotDiskSettings = settingsBuilder.createSnapshotDiskSettings().build(); + deleteDiskSettings = settingsBuilder.deleteDiskSettings().build(); + getDiskSettings = settingsBuilder.getDiskSettings().build(); + insertDiskSettings = settingsBuilder.insertDiskSettings().build(); + listDisksSettings = settingsBuilder.listDisksSettings().build(); + resizeDiskSettings = settingsBuilder.resizeDiskSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_DISKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListDisksHttpRequest injectToken(AggregatedListDisksHttpRequest payload, String token) { + return AggregatedListDisksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListDisksHttpRequest injectPageSize(AggregatedListDisksHttpRequest payload, int pageSize) { + return AggregatedListDisksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListDisksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(DiskAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(DiskAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_DISKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListDisksHttpRequest injectToken(ListDisksHttpRequest payload, String token) { + return ListDisksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListDisksHttpRequest injectPageSize(ListDisksHttpRequest payload, int pageSize) { + return ListDisksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListDisksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(DiskList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(DiskList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_DISKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListDisksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_DISKS_PAGE_STR_DESC, request, context); + return AggregatedListDisksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_DISKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDisksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DISKS_PAGE_STR_DESC, request, context); + return ListDisksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for DiskStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListDisksSettings; + private final UnaryCallSettings.Builder createSnapshotDiskSettings; + private final UnaryCallSettings.Builder deleteDiskSettings; + private final UnaryCallSettings.Builder getDiskSettings; + private final UnaryCallSettings.Builder insertDiskSettings; + private final PagedCallSettings.Builder listDisksSettings; + private final UnaryCallSettings.Builder resizeDiskSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListDisksSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_DISKS_PAGE_STR_FACT); + + createSnapshotDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listDisksSettings = PagedCallSettings.newBuilder( + LIST_DISKS_PAGE_STR_FACT); + + resizeDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListDisksSettings, + createSnapshotDiskSettings, + deleteDiskSettings, + getDiskSettings, + insertDiskSettings, + listDisksSettings, + resizeDiskSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListDisksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.createSnapshotDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listDisksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.resizeDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(DiskStubSettings settings) { + super(settings); + + aggregatedListDisksSettings = settings.aggregatedListDisksSettings.toBuilder(); + createSnapshotDiskSettings = settings.createSnapshotDiskSettings.toBuilder(); + deleteDiskSettings = settings.deleteDiskSettings.toBuilder(); + getDiskSettings = settings.getDiskSettings.toBuilder(); + insertDiskSettings = settings.insertDiskSettings.toBuilder(); + listDisksSettings = settings.listDisksSettings.toBuilder(); + resizeDiskSettings = settings.resizeDiskSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListDisksSettings, + createSnapshotDiskSettings, + deleteDiskSettings, + getDiskSettings, + insertDiskSettings, + listDisksSettings, + resizeDiskSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListDisks. + */ + public PagedCallSettings.Builder aggregatedListDisksSettings() { + return aggregatedListDisksSettings; + } + + /** + * Returns the builder for the settings used for calls to createSnapshotDisk. + */ + public UnaryCallSettings.Builder createSnapshotDiskSettings() { + return createSnapshotDiskSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteDisk. + */ + public UnaryCallSettings.Builder deleteDiskSettings() { + return deleteDiskSettings; + } + + /** + * Returns the builder for the settings used for calls to getDisk. + */ + public UnaryCallSettings.Builder getDiskSettings() { + return getDiskSettings; + } + + /** + * Returns the builder for the settings used for calls to insertDisk. + */ + public UnaryCallSettings.Builder insertDiskSettings() { + return insertDiskSettings; + } + + /** + * Returns the builder for the settings used for calls to listDisks. + */ + public PagedCallSettings.Builder listDisksSettings() { + return listDisksSettings; + } + + /** + * Returns the builder for the settings used for calls to resizeDisk. + */ + public UnaryCallSettings.Builder resizeDiskSettings() { + return resizeDiskSettings; + } + + @Override + public DiskStubSettings build() throws IOException { + return new DiskStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java new file mode 100644 index 000000000000..f99bfdf6c027 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java @@ -0,0 +1,71 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.DiskTypeAggregatedList; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.DiskTypeList; +import com.google.cloud.compute.v1.DiskTypeName; +import com.google.cloud.compute.v1.DiskTypesScopedList; +import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class DiskTypeStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListDiskTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListDiskTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListDiskTypesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListDiskTypesCallable()"); + } + + @BetaApi + public UnaryCallable getDiskTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getDiskTypeCallable()"); + } + + @BetaApi + public UnaryCallable listDiskTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDiskTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listDiskTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listDiskTypesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java new file mode 100644 index 000000000000..f7bcc0aff7a5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java @@ -0,0 +1,471 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.DiskTypeAggregatedList; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.DiskTypeList; +import com.google.cloud.compute.v1.DiskTypesScopedList; +import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link DiskTypeStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getDiskType to 30 seconds: + * + *

+ * 
+ * DiskTypeStubSettings.Builder diskTypeSettingsBuilder =
+ *     DiskTypeStubSettings.newBuilder();
+ * diskTypeSettingsBuilder.getDiskTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * DiskTypeStubSettings diskTypeSettings = diskTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class DiskTypeStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListDiskTypesSettings; + private final UnaryCallSettings getDiskTypeSettings; + private final PagedCallSettings listDiskTypesSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListDiskTypes. + */ + public PagedCallSettings aggregatedListDiskTypesSettings() { + return aggregatedListDiskTypesSettings; + } + + /** + * Returns the object with the settings used for calls to getDiskType. + */ + public UnaryCallSettings getDiskTypeSettings() { + return getDiskTypeSettings; + } + + /** + * Returns the object with the settings used for calls to listDiskTypes. + */ + public PagedCallSettings listDiskTypesSettings() { + return listDiskTypesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DiskTypeStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDiskTypeStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DiskTypeStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DiskTypeStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListDiskTypesSettings = settingsBuilder.aggregatedListDiskTypesSettings().build(); + getDiskTypeSettings = settingsBuilder.getDiskTypeSettings().build(); + listDiskTypesSettings = settingsBuilder.listDiskTypesSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_DISK_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListDiskTypesHttpRequest injectToken(AggregatedListDiskTypesHttpRequest payload, String token) { + return AggregatedListDiskTypesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListDiskTypesHttpRequest injectPageSize(AggregatedListDiskTypesHttpRequest payload, int pageSize) { + return AggregatedListDiskTypesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListDiskTypesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(DiskTypeAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(DiskTypeAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_DISK_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListDiskTypesHttpRequest injectToken(ListDiskTypesHttpRequest payload, String token) { + return ListDiskTypesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListDiskTypesHttpRequest injectPageSize(ListDiskTypesHttpRequest payload, int pageSize) { + return ListDiskTypesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListDiskTypesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(DiskTypeList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(DiskTypeList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_DISK_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListDiskTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_DISK_TYPES_PAGE_STR_DESC, request, context); + return AggregatedListDiskTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_DISK_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDiskTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DISK_TYPES_PAGE_STR_DESC, request, context); + return ListDiskTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for DiskTypeStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListDiskTypesSettings; + private final UnaryCallSettings.Builder getDiskTypeSettings; + private final PagedCallSettings.Builder listDiskTypesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListDiskTypesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_DISK_TYPES_PAGE_STR_FACT); + + getDiskTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listDiskTypesSettings = PagedCallSettings.newBuilder( + LIST_DISK_TYPES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListDiskTypesSettings, + getDiskTypeSettings, + listDiskTypesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListDiskTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getDiskTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listDiskTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(DiskTypeStubSettings settings) { + super(settings); + + aggregatedListDiskTypesSettings = settings.aggregatedListDiskTypesSettings.toBuilder(); + getDiskTypeSettings = settings.getDiskTypeSettings.toBuilder(); + listDiskTypesSettings = settings.listDiskTypesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListDiskTypesSettings, + getDiskTypeSettings, + listDiskTypesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListDiskTypes. + */ + public PagedCallSettings.Builder aggregatedListDiskTypesSettings() { + return aggregatedListDiskTypesSettings; + } + + /** + * Returns the builder for the settings used for calls to getDiskType. + */ + public UnaryCallSettings.Builder getDiskTypeSettings() { + return getDiskTypeSettings; + } + + /** + * Returns the builder for the settings used for calls to listDiskTypes. + */ + public PagedCallSettings.Builder listDiskTypesSettings() { + return listDiskTypesSettings; + } + + @Override + public DiskTypeStubSettings build() throws IOException { + return new DiskTypeStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java new file mode 100644 index 000000000000..12fbd2206b44 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; +import com.google.cloud.compute.v1.Firewall; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import com.google.cloud.compute.v1.FirewallList; +import com.google.cloud.compute.v1.FirewallName; +import com.google.cloud.compute.v1.GetFirewallHttpRequest; +import com.google.cloud.compute.v1.InsertFirewallHttpRequest; +import com.google.cloud.compute.v1.ListFirewallsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchFirewallHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class FirewallStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteFirewallCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFirewallCallable()"); + } + + @BetaApi + public UnaryCallable getFirewallCallable() { + throw new UnsupportedOperationException("Not implemented: getFirewallCallable()"); + } + + @BetaApi + public UnaryCallable insertFirewallCallable() { + throw new UnsupportedOperationException("Not implemented: insertFirewallCallable()"); + } + + @BetaApi + public UnaryCallable listFirewallsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFirewallsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listFirewallsCallable() { + throw new UnsupportedOperationException("Not implemented: listFirewallsCallable()"); + } + + @BetaApi + public UnaryCallable patchFirewallCallable() { + throw new UnsupportedOperationException("Not implemented: patchFirewallCallable()"); + } + + @BetaApi + public UnaryCallable updateFirewallCallable() { + throw new UnsupportedOperationException("Not implemented: updateFirewallCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java new file mode 100644 index 000000000000..f7aa50abd27e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; +import com.google.cloud.compute.v1.Firewall; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import com.google.cloud.compute.v1.FirewallList; +import com.google.cloud.compute.v1.GetFirewallHttpRequest; +import com.google.cloud.compute.v1.InsertFirewallHttpRequest; +import com.google.cloud.compute.v1.ListFirewallsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchFirewallHttpRequest; +import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link FirewallStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteFirewall to 30 seconds: + * + *

+ * 
+ * FirewallStubSettings.Builder firewallSettingsBuilder =
+ *     FirewallStubSettings.newBuilder();
+ * firewallSettingsBuilder.deleteFirewallSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * FirewallStubSettings firewallSettings = firewallSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class FirewallStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteFirewallSettings; + private final UnaryCallSettings getFirewallSettings; + private final UnaryCallSettings insertFirewallSettings; + private final PagedCallSettings listFirewallsSettings; + private final UnaryCallSettings patchFirewallSettings; + private final UnaryCallSettings updateFirewallSettings; + + /** + * Returns the object with the settings used for calls to deleteFirewall. + */ + public UnaryCallSettings deleteFirewallSettings() { + return deleteFirewallSettings; + } + + /** + * Returns the object with the settings used for calls to getFirewall. + */ + public UnaryCallSettings getFirewallSettings() { + return getFirewallSettings; + } + + /** + * Returns the object with the settings used for calls to insertFirewall. + */ + public UnaryCallSettings insertFirewallSettings() { + return insertFirewallSettings; + } + + /** + * Returns the object with the settings used for calls to listFirewalls. + */ + public PagedCallSettings listFirewallsSettings() { + return listFirewallsSettings; + } + + /** + * Returns the object with the settings used for calls to patchFirewall. + */ + public UnaryCallSettings patchFirewallSettings() { + return patchFirewallSettings; + } + + /** + * Returns the object with the settings used for calls to updateFirewall. + */ + public UnaryCallSettings updateFirewallSettings() { + return updateFirewallSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FirewallStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonFirewallStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(FirewallStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FirewallStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteFirewallSettings = settingsBuilder.deleteFirewallSettings().build(); + getFirewallSettings = settingsBuilder.getFirewallSettings().build(); + insertFirewallSettings = settingsBuilder.insertFirewallSettings().build(); + listFirewallsSettings = settingsBuilder.listFirewallsSettings().build(); + patchFirewallSettings = settingsBuilder.patchFirewallSettings().build(); + updateFirewallSettings = settingsBuilder.updateFirewallSettings().build(); + } + + private static final PagedListDescriptor LIST_FIREWALLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListFirewallsHttpRequest injectToken(ListFirewallsHttpRequest payload, String token) { + return ListFirewallsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListFirewallsHttpRequest injectPageSize(ListFirewallsHttpRequest payload, int pageSize) { + return ListFirewallsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListFirewallsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(FirewallList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(FirewallList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_FIREWALLS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFirewallsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FIREWALLS_PAGE_STR_DESC, request, context); + return ListFirewallsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for FirewallStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteFirewallSettings; + private final UnaryCallSettings.Builder getFirewallSettings; + private final UnaryCallSettings.Builder insertFirewallSettings; + private final PagedCallSettings.Builder listFirewallsSettings; + private final UnaryCallSettings.Builder patchFirewallSettings; + private final UnaryCallSettings.Builder updateFirewallSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listFirewallsSettings = PagedCallSettings.newBuilder( + LIST_FIREWALLS_PAGE_STR_FACT); + + patchFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteFirewallSettings, + getFirewallSettings, + insertFirewallSettings, + listFirewallsSettings, + patchFirewallSettings, + updateFirewallSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteFirewallSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getFirewallSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertFirewallSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listFirewallsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchFirewallSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateFirewallSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(FirewallStubSettings settings) { + super(settings); + + deleteFirewallSettings = settings.deleteFirewallSettings.toBuilder(); + getFirewallSettings = settings.getFirewallSettings.toBuilder(); + insertFirewallSettings = settings.insertFirewallSettings.toBuilder(); + listFirewallsSettings = settings.listFirewallsSettings.toBuilder(); + patchFirewallSettings = settings.patchFirewallSettings.toBuilder(); + updateFirewallSettings = settings.updateFirewallSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteFirewallSettings, + getFirewallSettings, + insertFirewallSettings, + listFirewallsSettings, + patchFirewallSettings, + updateFirewallSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteFirewall. + */ + public UnaryCallSettings.Builder deleteFirewallSettings() { + return deleteFirewallSettings; + } + + /** + * Returns the builder for the settings used for calls to getFirewall. + */ + public UnaryCallSettings.Builder getFirewallSettings() { + return getFirewallSettings; + } + + /** + * Returns the builder for the settings used for calls to insertFirewall. + */ + public UnaryCallSettings.Builder insertFirewallSettings() { + return insertFirewallSettings; + } + + /** + * Returns the builder for the settings used for calls to listFirewalls. + */ + public PagedCallSettings.Builder listFirewallsSettings() { + return listFirewallsSettings; + } + + /** + * Returns the builder for the settings used for calls to patchFirewall. + */ + public UnaryCallSettings.Builder patchFirewallSettings() { + return patchFirewallSettings; + } + + /** + * Returns the builder for the settings used for calls to updateFirewall. + */ + public UnaryCallSettings.Builder updateFirewallSettings() { + return updateFirewallSettings; + } + + @Override + public FirewallStubSettings build() throws IOException { + return new FirewallStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java new file mode 100644 index 000000000000..a0ab3bebf6a4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java @@ -0,0 +1,91 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.ForwardingRuleName; +import com.google.cloud.compute.v1.ForwardingRulesScopedList; +import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.TargetReference; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ForwardingRuleStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListForwardingRulesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListForwardingRulesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListForwardingRulesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListForwardingRulesCallable()"); + } + + @BetaApi + public UnaryCallable deleteForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: deleteForwardingRuleCallable()"); + } + + @BetaApi + public UnaryCallable getForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: getForwardingRuleCallable()"); + } + + @BetaApi + public UnaryCallable insertForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: insertForwardingRuleCallable()"); + } + + @BetaApi + public UnaryCallable listForwardingRulesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listForwardingRulesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listForwardingRulesCallable() { + throw new UnsupportedOperationException("Not implemented: listForwardingRulesCallable()"); + } + + @BetaApi + public UnaryCallable setTargetForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: setTargetForwardingRuleCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java new file mode 100644 index 000000000000..8e10d1b1d1ff --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java @@ -0,0 +1,553 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.ForwardingRulesScopedList; +import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ForwardingRuleStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteForwardingRule to 30 seconds: + * + *

+ * 
+ * ForwardingRuleStubSettings.Builder forwardingRuleSettingsBuilder =
+ *     ForwardingRuleStubSettings.newBuilder();
+ * forwardingRuleSettingsBuilder.deleteForwardingRuleSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ForwardingRuleStubSettings forwardingRuleSettings = forwardingRuleSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ForwardingRuleStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListForwardingRulesSettings; + private final UnaryCallSettings deleteForwardingRuleSettings; + private final UnaryCallSettings getForwardingRuleSettings; + private final UnaryCallSettings insertForwardingRuleSettings; + private final PagedCallSettings listForwardingRulesSettings; + private final UnaryCallSettings setTargetForwardingRuleSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListForwardingRules. + */ + public PagedCallSettings aggregatedListForwardingRulesSettings() { + return aggregatedListForwardingRulesSettings; + } + + /** + * Returns the object with the settings used for calls to deleteForwardingRule. + */ + public UnaryCallSettings deleteForwardingRuleSettings() { + return deleteForwardingRuleSettings; + } + + /** + * Returns the object with the settings used for calls to getForwardingRule. + */ + public UnaryCallSettings getForwardingRuleSettings() { + return getForwardingRuleSettings; + } + + /** + * Returns the object with the settings used for calls to insertForwardingRule. + */ + public UnaryCallSettings insertForwardingRuleSettings() { + return insertForwardingRuleSettings; + } + + /** + * Returns the object with the settings used for calls to listForwardingRules. + */ + public PagedCallSettings listForwardingRulesSettings() { + return listForwardingRulesSettings; + } + + /** + * Returns the object with the settings used for calls to setTargetForwardingRule. + */ + public UnaryCallSettings setTargetForwardingRuleSettings() { + return setTargetForwardingRuleSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ForwardingRuleStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonForwardingRuleStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ForwardingRuleStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ForwardingRuleStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListForwardingRulesSettings = settingsBuilder.aggregatedListForwardingRulesSettings().build(); + deleteForwardingRuleSettings = settingsBuilder.deleteForwardingRuleSettings().build(); + getForwardingRuleSettings = settingsBuilder.getForwardingRuleSettings().build(); + insertForwardingRuleSettings = settingsBuilder.insertForwardingRuleSettings().build(); + listForwardingRulesSettings = settingsBuilder.listForwardingRulesSettings().build(); + setTargetForwardingRuleSettings = settingsBuilder.setTargetForwardingRuleSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListForwardingRulesHttpRequest injectToken(AggregatedListForwardingRulesHttpRequest payload, String token) { + return AggregatedListForwardingRulesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListForwardingRulesHttpRequest injectPageSize(AggregatedListForwardingRulesHttpRequest payload, int pageSize) { + return AggregatedListForwardingRulesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListForwardingRulesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(ForwardingRuleAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ForwardingRuleAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_FORWARDING_RULES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListForwardingRulesHttpRequest injectToken(ListForwardingRulesHttpRequest payload, String token) { + return ListForwardingRulesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListForwardingRulesHttpRequest injectPageSize(ListForwardingRulesHttpRequest payload, int pageSize) { + return ListForwardingRulesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListForwardingRulesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(ForwardingRuleList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ForwardingRuleList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListForwardingRulesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_DESC, request, context); + return AggregatedListForwardingRulesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_FORWARDING_RULES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListForwardingRulesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FORWARDING_RULES_PAGE_STR_DESC, request, context); + return ListForwardingRulesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for ForwardingRuleStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListForwardingRulesSettings; + private final UnaryCallSettings.Builder deleteForwardingRuleSettings; + private final UnaryCallSettings.Builder getForwardingRuleSettings; + private final UnaryCallSettings.Builder insertForwardingRuleSettings; + private final PagedCallSettings.Builder listForwardingRulesSettings; + private final UnaryCallSettings.Builder setTargetForwardingRuleSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListForwardingRulesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_FACT); + + deleteForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listForwardingRulesSettings = PagedCallSettings.newBuilder( + LIST_FORWARDING_RULES_PAGE_STR_FACT); + + setTargetForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListForwardingRulesSettings, + deleteForwardingRuleSettings, + getForwardingRuleSettings, + insertForwardingRuleSettings, + listForwardingRulesSettings, + setTargetForwardingRuleSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListForwardingRulesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listForwardingRulesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setTargetForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ForwardingRuleStubSettings settings) { + super(settings); + + aggregatedListForwardingRulesSettings = settings.aggregatedListForwardingRulesSettings.toBuilder(); + deleteForwardingRuleSettings = settings.deleteForwardingRuleSettings.toBuilder(); + getForwardingRuleSettings = settings.getForwardingRuleSettings.toBuilder(); + insertForwardingRuleSettings = settings.insertForwardingRuleSettings.toBuilder(); + listForwardingRulesSettings = settings.listForwardingRulesSettings.toBuilder(); + setTargetForwardingRuleSettings = settings.setTargetForwardingRuleSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListForwardingRulesSettings, + deleteForwardingRuleSettings, + getForwardingRuleSettings, + insertForwardingRuleSettings, + listForwardingRulesSettings, + setTargetForwardingRuleSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListForwardingRules. + */ + public PagedCallSettings.Builder aggregatedListForwardingRulesSettings() { + return aggregatedListForwardingRulesSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteForwardingRule. + */ + public UnaryCallSettings.Builder deleteForwardingRuleSettings() { + return deleteForwardingRuleSettings; + } + + /** + * Returns the builder for the settings used for calls to getForwardingRule. + */ + public UnaryCallSettings.Builder getForwardingRuleSettings() { + return getForwardingRuleSettings; + } + + /** + * Returns the builder for the settings used for calls to insertForwardingRule. + */ + public UnaryCallSettings.Builder insertForwardingRuleSettings() { + return insertForwardingRuleSettings; + } + + /** + * Returns the builder for the settings used for calls to listForwardingRules. + */ + public PagedCallSettings.Builder listForwardingRulesSettings() { + return listForwardingRulesSettings; + } + + /** + * Returns the builder for the settings used for calls to setTargetForwardingRule. + */ + public UnaryCallSettings.Builder setTargetForwardingRuleSettings() { + return setTargetForwardingRuleSettings; + } + + @Override + public ForwardingRuleStubSettings build() throws IOException { + return new ForwardingRuleStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java new file mode 100644 index 000000000000..efee9618f647 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectAddressName; +import com.google.cloud.compute.v1.ProjectName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class GlobalAddressStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteGlobalAddressCallable() { + throw new UnsupportedOperationException("Not implemented: deleteGlobalAddressCallable()"); + } + + @BetaApi + public UnaryCallable getGlobalAddressCallable() { + throw new UnsupportedOperationException("Not implemented: getGlobalAddressCallable()"); + } + + @BetaApi + public UnaryCallable insertGlobalAddressCallable() { + throw new UnsupportedOperationException("Not implemented: insertGlobalAddressCallable()"); + } + + @BetaApi + public UnaryCallable listGlobalAddressesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listGlobalAddressesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listGlobalAddressesCallable() { + throw new UnsupportedOperationException("Not implemented: listGlobalAddressesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java new file mode 100644 index 000000000000..2740988426f4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java @@ -0,0 +1,447 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GlobalAddressStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteGlobalAddress to 30 seconds: + * + *

+ * 
+ * GlobalAddressStubSettings.Builder globalAddressSettingsBuilder =
+ *     GlobalAddressStubSettings.newBuilder();
+ * globalAddressSettingsBuilder.deleteGlobalAddressSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GlobalAddressStubSettings globalAddressSettings = globalAddressSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalAddressStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteGlobalAddressSettings; + private final UnaryCallSettings getGlobalAddressSettings; + private final UnaryCallSettings insertGlobalAddressSettings; + private final PagedCallSettings listGlobalAddressesSettings; + + /** + * Returns the object with the settings used for calls to deleteGlobalAddress. + */ + public UnaryCallSettings deleteGlobalAddressSettings() { + return deleteGlobalAddressSettings; + } + + /** + * Returns the object with the settings used for calls to getGlobalAddress. + */ + public UnaryCallSettings getGlobalAddressSettings() { + return getGlobalAddressSettings; + } + + /** + * Returns the object with the settings used for calls to insertGlobalAddress. + */ + public UnaryCallSettings insertGlobalAddressSettings() { + return insertGlobalAddressSettings; + } + + /** + * Returns the object with the settings used for calls to listGlobalAddresses. + */ + public PagedCallSettings listGlobalAddressesSettings() { + return listGlobalAddressesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GlobalAddressStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGlobalAddressStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GlobalAddressStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GlobalAddressStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteGlobalAddressSettings = settingsBuilder.deleteGlobalAddressSettings().build(); + getGlobalAddressSettings = settingsBuilder.getGlobalAddressSettings().build(); + insertGlobalAddressSettings = settingsBuilder.insertGlobalAddressSettings().build(); + listGlobalAddressesSettings = settingsBuilder.listGlobalAddressesSettings().build(); + } + + private static final PagedListDescriptor LIST_GLOBAL_ADDRESSES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListGlobalAddressesHttpRequest injectToken(ListGlobalAddressesHttpRequest payload, String token) { + return ListGlobalAddressesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListGlobalAddressesHttpRequest injectPageSize(ListGlobalAddressesHttpRequest payload, int pageSize) { + return ListGlobalAddressesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListGlobalAddressesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AddressList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable
extractResources(AddressList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_GLOBAL_ADDRESSES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListGlobalAddressesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_GLOBAL_ADDRESSES_PAGE_STR_DESC, request, context); + return ListGlobalAddressesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for GlobalAddressStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteGlobalAddressSettings; + private final UnaryCallSettings.Builder getGlobalAddressSettings; + private final UnaryCallSettings.Builder insertGlobalAddressSettings; + private final PagedCallSettings.Builder listGlobalAddressesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteGlobalAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getGlobalAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertGlobalAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listGlobalAddressesSettings = PagedCallSettings.newBuilder( + LIST_GLOBAL_ADDRESSES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteGlobalAddressSettings, + getGlobalAddressSettings, + insertGlobalAddressSettings, + listGlobalAddressesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteGlobalAddressSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getGlobalAddressSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertGlobalAddressSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listGlobalAddressesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(GlobalAddressStubSettings settings) { + super(settings); + + deleteGlobalAddressSettings = settings.deleteGlobalAddressSettings.toBuilder(); + getGlobalAddressSettings = settings.getGlobalAddressSettings.toBuilder(); + insertGlobalAddressSettings = settings.insertGlobalAddressSettings.toBuilder(); + listGlobalAddressesSettings = settings.listGlobalAddressesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteGlobalAddressSettings, + getGlobalAddressSettings, + insertGlobalAddressSettings, + listGlobalAddressesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteGlobalAddress. + */ + public UnaryCallSettings.Builder deleteGlobalAddressSettings() { + return deleteGlobalAddressSettings; + } + + /** + * Returns the builder for the settings used for calls to getGlobalAddress. + */ + public UnaryCallSettings.Builder getGlobalAddressSettings() { + return getGlobalAddressSettings; + } + + /** + * Returns the builder for the settings used for calls to insertGlobalAddress. + */ + public UnaryCallSettings.Builder insertGlobalAddressSettings() { + return insertGlobalAddressSettings; + } + + /** + * Returns the builder for the settings used for calls to listGlobalAddresses. + */ + public PagedCallSettings.Builder listGlobalAddressesSettings() { + return listGlobalAddressesSettings; + } + + @Override + public GlobalAddressStubSettings build() throws IOException { + return new GlobalAddressStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java new file mode 100644 index 000000000000..c82528e75be7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java @@ -0,0 +1,76 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectForwardingRuleName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.TargetReference; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class GlobalForwardingRuleStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: deleteGlobalForwardingRuleCallable()"); + } + + @BetaApi + public UnaryCallable getGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: getGlobalForwardingRuleCallable()"); + } + + @BetaApi + public UnaryCallable insertGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: insertGlobalForwardingRuleCallable()"); + } + + @BetaApi + public UnaryCallable listGlobalForwardingRulesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listGlobalForwardingRulesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listGlobalForwardingRulesCallable() { + throw new UnsupportedOperationException("Not implemented: listGlobalForwardingRulesCallable()"); + } + + @BetaApi + public UnaryCallable setTargetGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException("Not implemented: setTargetGlobalForwardingRuleCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java new file mode 100644 index 000000000000..403f4786e56a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java @@ -0,0 +1,474 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GlobalForwardingRuleStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteGlobalForwardingRule to 30 seconds: + * + *

+ * 
+ * GlobalForwardingRuleStubSettings.Builder globalForwardingRuleSettingsBuilder =
+ *     GlobalForwardingRuleStubSettings.newBuilder();
+ * globalForwardingRuleSettingsBuilder.deleteGlobalForwardingRuleSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GlobalForwardingRuleStubSettings globalForwardingRuleSettings = globalForwardingRuleSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalForwardingRuleStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteGlobalForwardingRuleSettings; + private final UnaryCallSettings getGlobalForwardingRuleSettings; + private final UnaryCallSettings insertGlobalForwardingRuleSettings; + private final PagedCallSettings listGlobalForwardingRulesSettings; + private final UnaryCallSettings setTargetGlobalForwardingRuleSettings; + + /** + * Returns the object with the settings used for calls to deleteGlobalForwardingRule. + */ + public UnaryCallSettings deleteGlobalForwardingRuleSettings() { + return deleteGlobalForwardingRuleSettings; + } + + /** + * Returns the object with the settings used for calls to getGlobalForwardingRule. + */ + public UnaryCallSettings getGlobalForwardingRuleSettings() { + return getGlobalForwardingRuleSettings; + } + + /** + * Returns the object with the settings used for calls to insertGlobalForwardingRule. + */ + public UnaryCallSettings insertGlobalForwardingRuleSettings() { + return insertGlobalForwardingRuleSettings; + } + + /** + * Returns the object with the settings used for calls to listGlobalForwardingRules. + */ + public PagedCallSettings listGlobalForwardingRulesSettings() { + return listGlobalForwardingRulesSettings; + } + + /** + * Returns the object with the settings used for calls to setTargetGlobalForwardingRule. + */ + public UnaryCallSettings setTargetGlobalForwardingRuleSettings() { + return setTargetGlobalForwardingRuleSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GlobalForwardingRuleStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGlobalForwardingRuleStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GlobalForwardingRuleStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GlobalForwardingRuleStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteGlobalForwardingRuleSettings = settingsBuilder.deleteGlobalForwardingRuleSettings().build(); + getGlobalForwardingRuleSettings = settingsBuilder.getGlobalForwardingRuleSettings().build(); + insertGlobalForwardingRuleSettings = settingsBuilder.insertGlobalForwardingRuleSettings().build(); + listGlobalForwardingRulesSettings = settingsBuilder.listGlobalForwardingRulesSettings().build(); + setTargetGlobalForwardingRuleSettings = settingsBuilder.setTargetGlobalForwardingRuleSettings().build(); + } + + private static final PagedListDescriptor LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListGlobalForwardingRulesHttpRequest injectToken(ListGlobalForwardingRulesHttpRequest payload, String token) { + return ListGlobalForwardingRulesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListGlobalForwardingRulesHttpRequest injectPageSize(ListGlobalForwardingRulesHttpRequest payload, int pageSize) { + return ListGlobalForwardingRulesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListGlobalForwardingRulesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(ForwardingRuleList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ForwardingRuleList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListGlobalForwardingRulesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_DESC, request, context); + return ListGlobalForwardingRulesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for GlobalForwardingRuleStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteGlobalForwardingRuleSettings; + private final UnaryCallSettings.Builder getGlobalForwardingRuleSettings; + private final UnaryCallSettings.Builder insertGlobalForwardingRuleSettings; + private final PagedCallSettings.Builder listGlobalForwardingRulesSettings; + private final UnaryCallSettings.Builder setTargetGlobalForwardingRuleSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteGlobalForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getGlobalForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertGlobalForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listGlobalForwardingRulesSettings = PagedCallSettings.newBuilder( + LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_FACT); + + setTargetGlobalForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteGlobalForwardingRuleSettings, + getGlobalForwardingRuleSettings, + insertGlobalForwardingRuleSettings, + listGlobalForwardingRulesSettings, + setTargetGlobalForwardingRuleSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteGlobalForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getGlobalForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertGlobalForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listGlobalForwardingRulesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setTargetGlobalForwardingRuleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(GlobalForwardingRuleStubSettings settings) { + super(settings); + + deleteGlobalForwardingRuleSettings = settings.deleteGlobalForwardingRuleSettings.toBuilder(); + getGlobalForwardingRuleSettings = settings.getGlobalForwardingRuleSettings.toBuilder(); + insertGlobalForwardingRuleSettings = settings.insertGlobalForwardingRuleSettings.toBuilder(); + listGlobalForwardingRulesSettings = settings.listGlobalForwardingRulesSettings.toBuilder(); + setTargetGlobalForwardingRuleSettings = settings.setTargetGlobalForwardingRuleSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteGlobalForwardingRuleSettings, + getGlobalForwardingRuleSettings, + insertGlobalForwardingRuleSettings, + listGlobalForwardingRulesSettings, + setTargetGlobalForwardingRuleSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteGlobalForwardingRule. + */ + public UnaryCallSettings.Builder deleteGlobalForwardingRuleSettings() { + return deleteGlobalForwardingRuleSettings; + } + + /** + * Returns the builder for the settings used for calls to getGlobalForwardingRule. + */ + public UnaryCallSettings.Builder getGlobalForwardingRuleSettings() { + return getGlobalForwardingRuleSettings; + } + + /** + * Returns the builder for the settings used for calls to insertGlobalForwardingRule. + */ + public UnaryCallSettings.Builder insertGlobalForwardingRuleSettings() { + return insertGlobalForwardingRuleSettings; + } + + /** + * Returns the builder for the settings used for calls to listGlobalForwardingRules. + */ + public PagedCallSettings.Builder listGlobalForwardingRulesSettings() { + return listGlobalForwardingRulesSettings; + } + + /** + * Returns the builder for the settings used for calls to setTargetGlobalForwardingRule. + */ + public UnaryCallSettings.Builder setTargetGlobalForwardingRuleSettings() { + return setTargetGlobalForwardingRuleSettings; + } + + @Override + public GlobalForwardingRuleStubSettings build() throws IOException { + return new GlobalForwardingRuleStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java new file mode 100644 index 000000000000..aa274b647a0a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java @@ -0,0 +1,76 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; +import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationAggregatedList; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.OperationName; +import com.google.cloud.compute.v1.OperationsScopedList; +import com.google.cloud.compute.v1.ProjectName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class GlobalOperationStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListGlobalOperationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListGlobalOperationsPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListGlobalOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListGlobalOperationsCallable()"); + } + + @BetaApi + public UnaryCallable deleteGlobalOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteGlobalOperationCallable()"); + } + + @BetaApi + public UnaryCallable getGlobalOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getGlobalOperationCallable()"); + } + + @BetaApi + public UnaryCallable listGlobalOperationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listGlobalOperationsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listGlobalOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: listGlobalOperationsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java new file mode 100644 index 000000000000..7dbfc3f4629f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java @@ -0,0 +1,498 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; +import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationAggregatedList; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.OperationsScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GlobalOperationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteGlobalOperation to 30 seconds: + * + *

+ * 
+ * GlobalOperationStubSettings.Builder globalOperationSettingsBuilder =
+ *     GlobalOperationStubSettings.newBuilder();
+ * globalOperationSettingsBuilder.deleteGlobalOperationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GlobalOperationStubSettings globalOperationSettings = globalOperationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class GlobalOperationStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListGlobalOperationsSettings; + private final UnaryCallSettings deleteGlobalOperationSettings; + private final UnaryCallSettings getGlobalOperationSettings; + private final PagedCallSettings listGlobalOperationsSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListGlobalOperations. + */ + public PagedCallSettings aggregatedListGlobalOperationsSettings() { + return aggregatedListGlobalOperationsSettings; + } + + /** + * Returns the object with the settings used for calls to deleteGlobalOperation. + */ + public UnaryCallSettings deleteGlobalOperationSettings() { + return deleteGlobalOperationSettings; + } + + /** + * Returns the object with the settings used for calls to getGlobalOperation. + */ + public UnaryCallSettings getGlobalOperationSettings() { + return getGlobalOperationSettings; + } + + /** + * Returns the object with the settings used for calls to listGlobalOperations. + */ + public PagedCallSettings listGlobalOperationsSettings() { + return listGlobalOperationsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GlobalOperationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGlobalOperationStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GlobalOperationStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GlobalOperationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListGlobalOperationsSettings = settingsBuilder.aggregatedListGlobalOperationsSettings().build(); + deleteGlobalOperationSettings = settingsBuilder.deleteGlobalOperationSettings().build(); + getGlobalOperationSettings = settingsBuilder.getGlobalOperationSettings().build(); + listGlobalOperationsSettings = settingsBuilder.listGlobalOperationsSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListGlobalOperationsHttpRequest injectToken(AggregatedListGlobalOperationsHttpRequest payload, String token) { + return AggregatedListGlobalOperationsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListGlobalOperationsHttpRequest injectPageSize(AggregatedListGlobalOperationsHttpRequest payload, int pageSize) { + return AggregatedListGlobalOperationsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListGlobalOperationsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(OperationAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(OperationAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListGlobalOperationsHttpRequest injectToken(ListGlobalOperationsHttpRequest payload, String token) { + return ListGlobalOperationsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListGlobalOperationsHttpRequest injectPageSize(ListGlobalOperationsHttpRequest payload, int pageSize) { + return ListGlobalOperationsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListGlobalOperationsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(OperationList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(OperationList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListGlobalOperationsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC, request, context); + return AggregatedListGlobalOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListGlobalOperationsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC, request, context); + return ListGlobalOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for GlobalOperationStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListGlobalOperationsSettings; + private final UnaryCallSettings.Builder deleteGlobalOperationSettings; + private final UnaryCallSettings.Builder getGlobalOperationSettings; + private final PagedCallSettings.Builder listGlobalOperationsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListGlobalOperationsSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT); + + deleteGlobalOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getGlobalOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listGlobalOperationsSettings = PagedCallSettings.newBuilder( + LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListGlobalOperationsSettings, + deleteGlobalOperationSettings, + getGlobalOperationSettings, + listGlobalOperationsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListGlobalOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteGlobalOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getGlobalOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listGlobalOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(GlobalOperationStubSettings settings) { + super(settings); + + aggregatedListGlobalOperationsSettings = settings.aggregatedListGlobalOperationsSettings.toBuilder(); + deleteGlobalOperationSettings = settings.deleteGlobalOperationSettings.toBuilder(); + getGlobalOperationSettings = settings.getGlobalOperationSettings.toBuilder(); + listGlobalOperationsSettings = settings.listGlobalOperationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListGlobalOperationsSettings, + deleteGlobalOperationSettings, + getGlobalOperationSettings, + listGlobalOperationsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListGlobalOperations. + */ + public PagedCallSettings.Builder aggregatedListGlobalOperationsSettings() { + return aggregatedListGlobalOperationsSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteGlobalOperation. + */ + public UnaryCallSettings.Builder deleteGlobalOperationSettings() { + return deleteGlobalOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to getGlobalOperation. + */ + public UnaryCallSettings.Builder getGlobalOperationSettings() { + return getGlobalOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to listGlobalOperations. + */ + public PagedCallSettings.Builder listGlobalOperationsSettings() { + return listGlobalOperationsSettings; + } + + @Override + public GlobalOperationStubSettings build() throws IOException { + return new GlobalOperationStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java new file mode 100644 index 000000000000..b208bb3f46d1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HealthCheck; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HealthCheckList; +import com.google.cloud.compute.v1.HealthCheckName; +import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class HealthCheckStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable getHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: getHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable insertHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: insertHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable listHealthChecksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHealthChecksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listHealthChecksCallable() { + throw new UnsupportedOperationException("Not implemented: listHealthChecksCallable()"); + } + + @BetaApi + public UnaryCallable patchHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: patchHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable updateHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: updateHealthCheckCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java new file mode 100644 index 000000000000..b48d80f4ffd0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HealthCheck; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HealthCheckList; +import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; +import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link HealthCheckStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteHealthCheck to 30 seconds: + * + *

+ * 
+ * HealthCheckStubSettings.Builder healthCheckSettingsBuilder =
+ *     HealthCheckStubSettings.newBuilder();
+ * healthCheckSettingsBuilder.deleteHealthCheckSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * HealthCheckStubSettings healthCheckSettings = healthCheckSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HealthCheckStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteHealthCheckSettings; + private final UnaryCallSettings getHealthCheckSettings; + private final UnaryCallSettings insertHealthCheckSettings; + private final PagedCallSettings listHealthChecksSettings; + private final UnaryCallSettings patchHealthCheckSettings; + private final UnaryCallSettings updateHealthCheckSettings; + + /** + * Returns the object with the settings used for calls to deleteHealthCheck. + */ + public UnaryCallSettings deleteHealthCheckSettings() { + return deleteHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to getHealthCheck. + */ + public UnaryCallSettings getHealthCheckSettings() { + return getHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to insertHealthCheck. + */ + public UnaryCallSettings insertHealthCheckSettings() { + return insertHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to listHealthChecks. + */ + public PagedCallSettings listHealthChecksSettings() { + return listHealthChecksSettings; + } + + /** + * Returns the object with the settings used for calls to patchHealthCheck. + */ + public UnaryCallSettings patchHealthCheckSettings() { + return patchHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to updateHealthCheck. + */ + public UnaryCallSettings updateHealthCheckSettings() { + return updateHealthCheckSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HealthCheckStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonHealthCheckStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(HealthCheckStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected HealthCheckStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteHealthCheckSettings = settingsBuilder.deleteHealthCheckSettings().build(); + getHealthCheckSettings = settingsBuilder.getHealthCheckSettings().build(); + insertHealthCheckSettings = settingsBuilder.insertHealthCheckSettings().build(); + listHealthChecksSettings = settingsBuilder.listHealthChecksSettings().build(); + patchHealthCheckSettings = settingsBuilder.patchHealthCheckSettings().build(); + updateHealthCheckSettings = settingsBuilder.updateHealthCheckSettings().build(); + } + + private static final PagedListDescriptor LIST_HEALTH_CHECKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListHealthChecksHttpRequest injectToken(ListHealthChecksHttpRequest payload, String token) { + return ListHealthChecksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListHealthChecksHttpRequest injectPageSize(ListHealthChecksHttpRequest payload, int pageSize) { + return ListHealthChecksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListHealthChecksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(HealthCheckList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(HealthCheckList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_HEALTH_CHECKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListHealthChecksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_HEALTH_CHECKS_PAGE_STR_DESC, request, context); + return ListHealthChecksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for HealthCheckStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteHealthCheckSettings; + private final UnaryCallSettings.Builder getHealthCheckSettings; + private final UnaryCallSettings.Builder insertHealthCheckSettings; + private final PagedCallSettings.Builder listHealthChecksSettings; + private final UnaryCallSettings.Builder patchHealthCheckSettings; + private final UnaryCallSettings.Builder updateHealthCheckSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listHealthChecksSettings = PagedCallSettings.newBuilder( + LIST_HEALTH_CHECKS_PAGE_STR_FACT); + + patchHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteHealthCheckSettings, + getHealthCheckSettings, + insertHealthCheckSettings, + listHealthChecksSettings, + patchHealthCheckSettings, + updateHealthCheckSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listHealthChecksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(HealthCheckStubSettings settings) { + super(settings); + + deleteHealthCheckSettings = settings.deleteHealthCheckSettings.toBuilder(); + getHealthCheckSettings = settings.getHealthCheckSettings.toBuilder(); + insertHealthCheckSettings = settings.insertHealthCheckSettings.toBuilder(); + listHealthChecksSettings = settings.listHealthChecksSettings.toBuilder(); + patchHealthCheckSettings = settings.patchHealthCheckSettings.toBuilder(); + updateHealthCheckSettings = settings.updateHealthCheckSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteHealthCheckSettings, + getHealthCheckSettings, + insertHealthCheckSettings, + listHealthChecksSettings, + patchHealthCheckSettings, + updateHealthCheckSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteHealthCheck. + */ + public UnaryCallSettings.Builder deleteHealthCheckSettings() { + return deleteHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to getHealthCheck. + */ + public UnaryCallSettings.Builder getHealthCheckSettings() { + return getHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to insertHealthCheck. + */ + public UnaryCallSettings.Builder insertHealthCheckSettings() { + return insertHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to listHealthChecks. + */ + public PagedCallSettings.Builder listHealthChecksSettings() { + return listHealthChecksSettings; + } + + /** + * Returns the builder for the settings used for calls to patchHealthCheck. + */ + public UnaryCallSettings.Builder patchHealthCheckSettings() { + return patchHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to updateHealthCheck. + */ + public UnaryCallSettings.Builder updateHealthCheckSettings() { + return updateHealthCheckSettings; + } + + @Override + public HealthCheckStubSettings build() throws IOException { + return new HealthCheckStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java new file mode 100644 index 000000000000..2ceb0cd73019 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpHealthCheck; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpHealthCheckList; +import com.google.cloud.compute.v1.HttpHealthCheckName; +import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class HttpHealthCheckStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteHttpHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHttpHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable getHttpHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: getHttpHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable insertHttpHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: insertHttpHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable listHttpHealthChecksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHttpHealthChecksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listHttpHealthChecksCallable() { + throw new UnsupportedOperationException("Not implemented: listHttpHealthChecksCallable()"); + } + + @BetaApi + public UnaryCallable patchHttpHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: patchHttpHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable updateHttpHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: updateHttpHealthCheckCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java new file mode 100644 index 000000000000..8a3145f503f5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpHealthCheck; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpHealthCheckList; +import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link HttpHealthCheckStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteHttpHealthCheck to 30 seconds: + * + *

+ * 
+ * HttpHealthCheckStubSettings.Builder httpHealthCheckSettingsBuilder =
+ *     HttpHealthCheckStubSettings.newBuilder();
+ * httpHealthCheckSettingsBuilder.deleteHttpHealthCheckSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * HttpHealthCheckStubSettings httpHealthCheckSettings = httpHealthCheckSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HttpHealthCheckStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteHttpHealthCheckSettings; + private final UnaryCallSettings getHttpHealthCheckSettings; + private final UnaryCallSettings insertHttpHealthCheckSettings; + private final PagedCallSettings listHttpHealthChecksSettings; + private final UnaryCallSettings patchHttpHealthCheckSettings; + private final UnaryCallSettings updateHttpHealthCheckSettings; + + /** + * Returns the object with the settings used for calls to deleteHttpHealthCheck. + */ + public UnaryCallSettings deleteHttpHealthCheckSettings() { + return deleteHttpHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to getHttpHealthCheck. + */ + public UnaryCallSettings getHttpHealthCheckSettings() { + return getHttpHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to insertHttpHealthCheck. + */ + public UnaryCallSettings insertHttpHealthCheckSettings() { + return insertHttpHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to listHttpHealthChecks. + */ + public PagedCallSettings listHttpHealthChecksSettings() { + return listHttpHealthChecksSettings; + } + + /** + * Returns the object with the settings used for calls to patchHttpHealthCheck. + */ + public UnaryCallSettings patchHttpHealthCheckSettings() { + return patchHttpHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to updateHttpHealthCheck. + */ + public UnaryCallSettings updateHttpHealthCheckSettings() { + return updateHttpHealthCheckSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HttpHealthCheckStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonHttpHealthCheckStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(HttpHealthCheckStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected HttpHealthCheckStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteHttpHealthCheckSettings = settingsBuilder.deleteHttpHealthCheckSettings().build(); + getHttpHealthCheckSettings = settingsBuilder.getHttpHealthCheckSettings().build(); + insertHttpHealthCheckSettings = settingsBuilder.insertHttpHealthCheckSettings().build(); + listHttpHealthChecksSettings = settingsBuilder.listHttpHealthChecksSettings().build(); + patchHttpHealthCheckSettings = settingsBuilder.patchHttpHealthCheckSettings().build(); + updateHttpHealthCheckSettings = settingsBuilder.updateHttpHealthCheckSettings().build(); + } + + private static final PagedListDescriptor LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListHttpHealthChecksHttpRequest injectToken(ListHttpHealthChecksHttpRequest payload, String token) { + return ListHttpHealthChecksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListHttpHealthChecksHttpRequest injectPageSize(ListHttpHealthChecksHttpRequest payload, int pageSize) { + return ListHttpHealthChecksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListHttpHealthChecksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(HttpHealthCheckList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(HttpHealthCheckList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_HTTP_HEALTH_CHECKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListHttpHealthChecksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC, request, context); + return ListHttpHealthChecksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for HttpHealthCheckStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteHttpHealthCheckSettings; + private final UnaryCallSettings.Builder getHttpHealthCheckSettings; + private final UnaryCallSettings.Builder insertHttpHealthCheckSettings; + private final PagedCallSettings.Builder listHttpHealthChecksSettings; + private final UnaryCallSettings.Builder patchHttpHealthCheckSettings; + private final UnaryCallSettings.Builder updateHttpHealthCheckSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listHttpHealthChecksSettings = PagedCallSettings.newBuilder( + LIST_HTTP_HEALTH_CHECKS_PAGE_STR_FACT); + + patchHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteHttpHealthCheckSettings, + getHttpHealthCheckSettings, + insertHttpHealthCheckSettings, + listHttpHealthChecksSettings, + patchHttpHealthCheckSettings, + updateHttpHealthCheckSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteHttpHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getHttpHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertHttpHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listHttpHealthChecksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchHttpHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateHttpHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(HttpHealthCheckStubSettings settings) { + super(settings); + + deleteHttpHealthCheckSettings = settings.deleteHttpHealthCheckSettings.toBuilder(); + getHttpHealthCheckSettings = settings.getHttpHealthCheckSettings.toBuilder(); + insertHttpHealthCheckSettings = settings.insertHttpHealthCheckSettings.toBuilder(); + listHttpHealthChecksSettings = settings.listHttpHealthChecksSettings.toBuilder(); + patchHttpHealthCheckSettings = settings.patchHttpHealthCheckSettings.toBuilder(); + updateHttpHealthCheckSettings = settings.updateHttpHealthCheckSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteHttpHealthCheckSettings, + getHttpHealthCheckSettings, + insertHttpHealthCheckSettings, + listHttpHealthChecksSettings, + patchHttpHealthCheckSettings, + updateHttpHealthCheckSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteHttpHealthCheck. + */ + public UnaryCallSettings.Builder deleteHttpHealthCheckSettings() { + return deleteHttpHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to getHttpHealthCheck. + */ + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { + return getHttpHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to insertHttpHealthCheck. + */ + public UnaryCallSettings.Builder insertHttpHealthCheckSettings() { + return insertHttpHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to listHttpHealthChecks. + */ + public PagedCallSettings.Builder listHttpHealthChecksSettings() { + return listHttpHealthChecksSettings; + } + + /** + * Returns the builder for the settings used for calls to patchHttpHealthCheck. + */ + public UnaryCallSettings.Builder patchHttpHealthCheckSettings() { + return patchHttpHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to updateHttpHealthCheck. + */ + public UnaryCallSettings.Builder updateHttpHealthCheckSettings() { + return updateHttpHealthCheckSettings; + } + + @Override + public HttpHealthCheckStubSettings build() throws IOException { + return new HttpHealthCheckStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java new file mode 100644 index 000000000000..4af14212fc10 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressAggregatedList; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.AddressName; +import com.google.cloud.compute.v1.AddressSettings; +import com.google.cloud.compute.v1.AddressesScopedList; +import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; +import com.google.cloud.compute.v1.DeleteAddressHttpRequest; +import com.google.cloud.compute.v1.GetAddressHttpRequest; +import com.google.cloud.compute.v1.InsertAddressHttpRequest; +import com.google.cloud.compute.v1.ListAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonAddressCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java new file mode 100644 index 000000000000..7ee564100d11 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -0,0 +1,300 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressAggregatedList; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.AddressName; +import com.google.cloud.compute.v1.AddressSettings; +import com.google.cloud.compute.v1.AddressesScopedList; +import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; +import com.google.cloud.compute.v1.DeleteAddressHttpRequest; +import com.google.cloud.compute.v1.GetAddressHttpRequest; +import com.google.cloud.compute.v1.InsertAddressHttpRequest; +import com.google.cloud.compute.v1.ListAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonAddressStub extends AddressStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListAddressesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAddressesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/addresses")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AddressAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses/{address}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(AddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses/{address}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(AddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.

newBuilder() + .setResponseInstance(Address.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listAddressesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAddressesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AddressList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListAddressesCallable; + private final UnaryCallable aggregatedListAddressesPagedCallable; + private final UnaryCallable deleteAddressCallable; + private final UnaryCallable getAddressCallable; + private final UnaryCallable insertAddressCallable; + private final UnaryCallable listAddressesCallable; + private final UnaryCallable listAddressesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonAddressStub create(AddressStubSettings settings) throws IOException { + return new HttpJsonAddressStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAddressStub create(ClientContext clientContext) throws IOException { + return new HttpJsonAddressStub(AddressStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonAddressStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAddressStub(AddressStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAddressStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonAddressStub(AddressStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAddressCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAddressStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonAddressStub(AddressStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListAddressesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListAddressesMethodDescriptor) + .build(); + HttpJsonCallSettings deleteAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAddressMethodDescriptor) + .build(); + HttpJsonCallSettings getAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAddressMethodDescriptor) + .build(); + HttpJsonCallSettings insertAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertAddressMethodDescriptor) + .build(); + HttpJsonCallSettings listAddressesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAddressesMethodDescriptor) + .build(); + + this.aggregatedListAddressesCallable = callableFactory.createUnaryCallable(aggregatedListAddressesTransportSettings,settings.aggregatedListAddressesSettings(), clientContext); + this.aggregatedListAddressesPagedCallable = callableFactory.createPagedCallable(aggregatedListAddressesTransportSettings,settings.aggregatedListAddressesSettings(), clientContext); + this.deleteAddressCallable = callableFactory.createUnaryCallable(deleteAddressTransportSettings,settings.deleteAddressSettings(), clientContext); + this.getAddressCallable = callableFactory.createUnaryCallable(getAddressTransportSettings,settings.getAddressSettings(), clientContext); + this.insertAddressCallable = callableFactory.createUnaryCallable(insertAddressTransportSettings,settings.insertAddressSettings(), clientContext); + this.listAddressesCallable = callableFactory.createUnaryCallable(listAddressesTransportSettings,settings.listAddressesSettings(), clientContext); + this.listAddressesPagedCallable = callableFactory.createPagedCallable(listAddressesTransportSettings,settings.listAddressesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListAddressesPagedCallable() { + return aggregatedListAddressesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListAddressesCallable() { + return aggregatedListAddressesCallable; + } + + @BetaApi + public UnaryCallable deleteAddressCallable() { + return deleteAddressCallable; + } + + @BetaApi + public UnaryCallable getAddressCallable() { + return getAddressCallable; + } + + @BetaApi + public UnaryCallable insertAddressCallable() { + return insertAddressCallable; + } + + @BetaApi + public UnaryCallable listAddressesPagedCallable() { + return listAddressesPagedCallable; + } + + @BetaApi + public UnaryCallable listAddressesCallable() { + return listAddressesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java new file mode 100644 index 000000000000..6ddc5058b19a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.AutoscalerAggregatedList; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import com.google.cloud.compute.v1.AutoscalerList; +import com.google.cloud.compute.v1.AutoscalerName; +import com.google.cloud.compute.v1.AutoscalerSettings; +import com.google.cloud.compute.v1.AutoscalersScopedList; +import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonAutoscalerCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java new file mode 100644 index 000000000000..5c73beb81093 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -0,0 +1,364 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.AutoscalerAggregatedList; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import com.google.cloud.compute.v1.AutoscalerList; +import com.google.cloud.compute.v1.AutoscalerName; +import com.google.cloud.compute.v1.AutoscalerSettings; +import com.google.cloud.compute.v1.AutoscalersScopedList; +import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonAutoscalerStub extends AutoscalerStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListAutoscalersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAutoscalersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/autoscalers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AutoscalerAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(AutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(AutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Autoscaler.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listAutoscalersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAutoscalersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AutoscalerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet( + "autoscaler" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet( + "autoscaler" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListAutoscalersCallable; + private final UnaryCallable aggregatedListAutoscalersPagedCallable; + private final UnaryCallable deleteAutoscalerCallable; + private final UnaryCallable getAutoscalerCallable; + private final UnaryCallable insertAutoscalerCallable; + private final UnaryCallable listAutoscalersCallable; + private final UnaryCallable listAutoscalersPagedCallable; + private final UnaryCallable patchAutoscalerCallable; + private final UnaryCallable updateAutoscalerCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonAutoscalerStub create(AutoscalerStubSettings settings) throws IOException { + return new HttpJsonAutoscalerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAutoscalerStub create(ClientContext clientContext) throws IOException { + return new HttpJsonAutoscalerStub(AutoscalerStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonAutoscalerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAutoscalerStub(AutoscalerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAutoscalerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAutoscalerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAutoscalerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListAutoscalersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListAutoscalersMethodDescriptor) + .build(); + HttpJsonCallSettings deleteAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings getAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings insertAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings listAutoscalersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAutoscalersMethodDescriptor) + .build(); + HttpJsonCallSettings patchAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings updateAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAutoscalerMethodDescriptor) + .build(); + + this.aggregatedListAutoscalersCallable = callableFactory.createUnaryCallable(aggregatedListAutoscalersTransportSettings,settings.aggregatedListAutoscalersSettings(), clientContext); + this.aggregatedListAutoscalersPagedCallable = callableFactory.createPagedCallable(aggregatedListAutoscalersTransportSettings,settings.aggregatedListAutoscalersSettings(), clientContext); + this.deleteAutoscalerCallable = callableFactory.createUnaryCallable(deleteAutoscalerTransportSettings,settings.deleteAutoscalerSettings(), clientContext); + this.getAutoscalerCallable = callableFactory.createUnaryCallable(getAutoscalerTransportSettings,settings.getAutoscalerSettings(), clientContext); + this.insertAutoscalerCallable = callableFactory.createUnaryCallable(insertAutoscalerTransportSettings,settings.insertAutoscalerSettings(), clientContext); + this.listAutoscalersCallable = callableFactory.createUnaryCallable(listAutoscalersTransportSettings,settings.listAutoscalersSettings(), clientContext); + this.listAutoscalersPagedCallable = callableFactory.createPagedCallable(listAutoscalersTransportSettings,settings.listAutoscalersSettings(), clientContext); + this.patchAutoscalerCallable = callableFactory.createUnaryCallable(patchAutoscalerTransportSettings,settings.patchAutoscalerSettings(), clientContext); + this.updateAutoscalerCallable = callableFactory.createUnaryCallable(updateAutoscalerTransportSettings,settings.updateAutoscalerSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListAutoscalersPagedCallable() { + return aggregatedListAutoscalersPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListAutoscalersCallable() { + return aggregatedListAutoscalersCallable; + } + + @BetaApi + public UnaryCallable deleteAutoscalerCallable() { + return deleteAutoscalerCallable; + } + + @BetaApi + public UnaryCallable getAutoscalerCallable() { + return getAutoscalerCallable; + } + + @BetaApi + public UnaryCallable insertAutoscalerCallable() { + return insertAutoscalerCallable; + } + + @BetaApi + public UnaryCallable listAutoscalersPagedCallable() { + return listAutoscalersPagedCallable; + } + + @BetaApi + public UnaryCallable listAutoscalersCallable() { + return listAutoscalersCallable; + } + + @BetaApi + public UnaryCallable patchAutoscalerCallable() { + return patchAutoscalerCallable; + } + + @BetaApi + public UnaryCallable updateAutoscalerCallable() { + return updateAutoscalerCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java new file mode 100644 index 000000000000..87e6a2698157 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceAggregatedList; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.BackendServiceName; +import com.google.cloud.compute.v1.BackendServiceSettings; +import com.google.cloud.compute.v1.BackendServicesScopedList; +import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonBackendServiceCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java new file mode 100644 index 000000000000..387538f45d2c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -0,0 +1,394 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceAggregatedList; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.BackendServiceName; +import com.google.cloud.compute.v1.BackendServiceSettings; +import com.google.cloud.compute.v1.BackendServicesScopedList; +import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonBackendServiceStub extends BackendServiceStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListBackendServicesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListBackendServicesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/backendServices")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(BackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(BackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendService.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getHealthBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.getHealth") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}/getHealth")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(BackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceGroupHealth.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listBackendServicesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListBackendServicesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(BackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(BackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListBackendServicesCallable; + private final UnaryCallable aggregatedListBackendServicesPagedCallable; + private final UnaryCallable deleteBackendServiceCallable; + private final UnaryCallable getBackendServiceCallable; + private final UnaryCallable getHealthBackendServiceCallable; + private final UnaryCallable insertBackendServiceCallable; + private final UnaryCallable listBackendServicesCallable; + private final UnaryCallable listBackendServicesPagedCallable; + private final UnaryCallable patchBackendServiceCallable; + private final UnaryCallable updateBackendServiceCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonBackendServiceStub create(BackendServiceStubSettings settings) throws IOException { + return new HttpJsonBackendServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonBackendServiceStub create(ClientContext clientContext) throws IOException { + return new HttpJsonBackendServiceStub(BackendServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonBackendServiceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonBackendServiceStub(BackendServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonBackendServiceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonBackendServiceStub(BackendServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonBackendServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonBackendServiceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonBackendServiceStub(BackendServiceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListBackendServicesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListBackendServicesMethodDescriptor) + .build(); + HttpJsonCallSettings deleteBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings getBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings getHealthBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHealthBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings insertBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings listBackendServicesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackendServicesMethodDescriptor) + .build(); + HttpJsonCallSettings patchBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings updateBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackendServiceMethodDescriptor) + .build(); + + this.aggregatedListBackendServicesCallable = callableFactory.createUnaryCallable(aggregatedListBackendServicesTransportSettings,settings.aggregatedListBackendServicesSettings(), clientContext); + this.aggregatedListBackendServicesPagedCallable = callableFactory.createPagedCallable(aggregatedListBackendServicesTransportSettings,settings.aggregatedListBackendServicesSettings(), clientContext); + this.deleteBackendServiceCallable = callableFactory.createUnaryCallable(deleteBackendServiceTransportSettings,settings.deleteBackendServiceSettings(), clientContext); + this.getBackendServiceCallable = callableFactory.createUnaryCallable(getBackendServiceTransportSettings,settings.getBackendServiceSettings(), clientContext); + this.getHealthBackendServiceCallable = callableFactory.createUnaryCallable(getHealthBackendServiceTransportSettings,settings.getHealthBackendServiceSettings(), clientContext); + this.insertBackendServiceCallable = callableFactory.createUnaryCallable(insertBackendServiceTransportSettings,settings.insertBackendServiceSettings(), clientContext); + this.listBackendServicesCallable = callableFactory.createUnaryCallable(listBackendServicesTransportSettings,settings.listBackendServicesSettings(), clientContext); + this.listBackendServicesPagedCallable = callableFactory.createPagedCallable(listBackendServicesTransportSettings,settings.listBackendServicesSettings(), clientContext); + this.patchBackendServiceCallable = callableFactory.createUnaryCallable(patchBackendServiceTransportSettings,settings.patchBackendServiceSettings(), clientContext); + this.updateBackendServiceCallable = callableFactory.createUnaryCallable(updateBackendServiceTransportSettings,settings.updateBackendServiceSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListBackendServicesPagedCallable() { + return aggregatedListBackendServicesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListBackendServicesCallable() { + return aggregatedListBackendServicesCallable; + } + + @BetaApi + public UnaryCallable deleteBackendServiceCallable() { + return deleteBackendServiceCallable; + } + + @BetaApi + public UnaryCallable getBackendServiceCallable() { + return getBackendServiceCallable; + } + + @BetaApi + public UnaryCallable getHealthBackendServiceCallable() { + return getHealthBackendServiceCallable; + } + + @BetaApi + public UnaryCallable insertBackendServiceCallable() { + return insertBackendServiceCallable; + } + + @BetaApi + public UnaryCallable listBackendServicesPagedCallable() { + return listBackendServicesPagedCallable; + } + + @BetaApi + public UnaryCallable listBackendServicesCallable() { + return listBackendServicesCallable; + } + + @BetaApi + public UnaryCallable patchBackendServiceCallable() { + return patchBackendServiceCallable; + } + + @BetaApi + public UnaryCallable updateBackendServiceCallable() { + return updateBackendServiceCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java new file mode 100644 index 000000000000..b6fe838d7704 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; +import com.google.cloud.compute.v1.CreateSnapshotDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskAggregatedList; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.DiskName; +import com.google.cloud.compute.v1.DiskSettings; +import com.google.cloud.compute.v1.DisksResizeRequest; +import com.google.cloud.compute.v1.DisksScopedList; +import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.InsertDiskHttpRequest; +import com.google.cloud.compute.v1.ListDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.Snapshot; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonDiskCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java new file mode 100644 index 000000000000..babb6ecd1270 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -0,0 +1,365 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; +import com.google.cloud.compute.v1.CreateSnapshotDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskAggregatedList; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.DiskName; +import com.google.cloud.compute.v1.DiskSettings; +import com.google.cloud.compute.v1.DisksResizeRequest; +import com.google.cloud.compute.v1.DisksScopedList; +import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.InsertDiskHttpRequest; +import com.google.cloud.compute.v1.ListDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.Snapshot; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonDiskStub extends DiskStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor createSnapshotDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.createSnapshot") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Disk.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams(Sets.newHashSet( + "sourceImage" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor resizeDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListDisksCallable; + private final UnaryCallable aggregatedListDisksPagedCallable; + private final UnaryCallable createSnapshotDiskCallable; + private final UnaryCallable deleteDiskCallable; + private final UnaryCallable getDiskCallable; + private final UnaryCallable insertDiskCallable; + private final UnaryCallable listDisksCallable; + private final UnaryCallable listDisksPagedCallable; + private final UnaryCallable resizeDiskCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonDiskStub create(DiskStubSettings settings) throws IOException { + return new HttpJsonDiskStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDiskStub create(ClientContext clientContext) throws IOException { + return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonDiskStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonDiskStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDiskCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDiskStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListDisksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListDisksMethodDescriptor) + .build(); + HttpJsonCallSettings createSnapshotDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotDiskMethodDescriptor) + .build(); + HttpJsonCallSettings deleteDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDiskMethodDescriptor) + .build(); + HttpJsonCallSettings getDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDiskMethodDescriptor) + .build(); + HttpJsonCallSettings insertDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertDiskMethodDescriptor) + .build(); + HttpJsonCallSettings listDisksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDisksMethodDescriptor) + .build(); + HttpJsonCallSettings resizeDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resizeDiskMethodDescriptor) + .build(); + + this.aggregatedListDisksCallable = callableFactory.createUnaryCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); + this.aggregatedListDisksPagedCallable = callableFactory.createPagedCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); + this.createSnapshotDiskCallable = callableFactory.createUnaryCallable(createSnapshotDiskTransportSettings,settings.createSnapshotDiskSettings(), clientContext); + this.deleteDiskCallable = callableFactory.createUnaryCallable(deleteDiskTransportSettings,settings.deleteDiskSettings(), clientContext); + this.getDiskCallable = callableFactory.createUnaryCallable(getDiskTransportSettings,settings.getDiskSettings(), clientContext); + this.insertDiskCallable = callableFactory.createUnaryCallable(insertDiskTransportSettings,settings.insertDiskSettings(), clientContext); + this.listDisksCallable = callableFactory.createUnaryCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); + this.listDisksPagedCallable = callableFactory.createPagedCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); + this.resizeDiskCallable = callableFactory.createUnaryCallable(resizeDiskTransportSettings,settings.resizeDiskSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListDisksPagedCallable() { + return aggregatedListDisksPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListDisksCallable() { + return aggregatedListDisksCallable; + } + + @BetaApi + public UnaryCallable createSnapshotDiskCallable() { + return createSnapshotDiskCallable; + } + + @BetaApi + public UnaryCallable deleteDiskCallable() { + return deleteDiskCallable; + } + + @BetaApi + public UnaryCallable getDiskCallable() { + return getDiskCallable; + } + + @BetaApi + public UnaryCallable insertDiskCallable() { + return insertDiskCallable; + } + + @BetaApi + public UnaryCallable listDisksPagedCallable() { + return listDisksPagedCallable; + } + + @BetaApi + public UnaryCallable listDisksCallable() { + return listDisksCallable; + } + + @BetaApi + public UnaryCallable resizeDiskCallable() { + return resizeDiskCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java new file mode 100644 index 000000000000..ea52e4309a3e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java @@ -0,0 +1,99 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.DiskTypeAggregatedList; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.DiskTypeList; +import com.google.cloud.compute.v1.DiskTypeName; +import com.google.cloud.compute.v1.DiskTypeSettings; +import com.google.cloud.compute.v1.DiskTypesScopedList; +import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonDiskTypeCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java new file mode 100644 index 000000000000..b43fdc51c306 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java @@ -0,0 +1,237 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.DiskTypeAggregatedList; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.DiskTypeList; +import com.google.cloud.compute.v1.DiskTypeName; +import com.google.cloud.compute.v1.DiskTypeSettings; +import com.google.cloud.compute.v1.DiskTypesScopedList; +import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonDiskTypeStub extends DiskTypeStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListDiskTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.diskTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDiskTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/diskTypes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getDiskTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.diskTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetDiskTypeHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(DiskTypeName.newFactory()) + .setResourceNameField("diskType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskType.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listDiskTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.diskTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDiskTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskTypeList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListDiskTypesCallable; + private final UnaryCallable aggregatedListDiskTypesPagedCallable; + private final UnaryCallable getDiskTypeCallable; + private final UnaryCallable listDiskTypesCallable; + private final UnaryCallable listDiskTypesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonDiskTypeStub create(DiskTypeStubSettings settings) throws IOException { + return new HttpJsonDiskTypeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDiskTypeStub create(ClientContext clientContext) throws IOException { + return new HttpJsonDiskTypeStub(DiskTypeStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonDiskTypeStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDiskTypeStub(DiskTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonDiskTypeStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonDiskTypeStub(DiskTypeStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDiskTypeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDiskTypeStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonDiskTypeStub(DiskTypeStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListDiskTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListDiskTypesMethodDescriptor) + .build(); + HttpJsonCallSettings getDiskTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDiskTypeMethodDescriptor) + .build(); + HttpJsonCallSettings listDiskTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDiskTypesMethodDescriptor) + .build(); + + this.aggregatedListDiskTypesCallable = callableFactory.createUnaryCallable(aggregatedListDiskTypesTransportSettings,settings.aggregatedListDiskTypesSettings(), clientContext); + this.aggregatedListDiskTypesPagedCallable = callableFactory.createPagedCallable(aggregatedListDiskTypesTransportSettings,settings.aggregatedListDiskTypesSettings(), clientContext); + this.getDiskTypeCallable = callableFactory.createUnaryCallable(getDiskTypeTransportSettings,settings.getDiskTypeSettings(), clientContext); + this.listDiskTypesCallable = callableFactory.createUnaryCallable(listDiskTypesTransportSettings,settings.listDiskTypesSettings(), clientContext); + this.listDiskTypesPagedCallable = callableFactory.createPagedCallable(listDiskTypesTransportSettings,settings.listDiskTypesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListDiskTypesPagedCallable() { + return aggregatedListDiskTypesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListDiskTypesCallable() { + return aggregatedListDiskTypesCallable; + } + + @BetaApi + public UnaryCallable getDiskTypeCallable() { + return getDiskTypeCallable; + } + + @BetaApi + public UnaryCallable listDiskTypesPagedCallable() { + return listDiskTypesPagedCallable; + } + + @BetaApi + public UnaryCallable listDiskTypesCallable() { + return listDiskTypesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java new file mode 100644 index 000000000000..6bfc27bebede --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; +import com.google.cloud.compute.v1.Firewall; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import com.google.cloud.compute.v1.FirewallList; +import com.google.cloud.compute.v1.FirewallName; +import com.google.cloud.compute.v1.FirewallSettings; +import com.google.cloud.compute.v1.GetFirewallHttpRequest; +import com.google.cloud.compute.v1.InsertFirewallHttpRequest; +import com.google.cloud.compute.v1.ListFirewallsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchFirewallHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonFirewallCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java new file mode 100644 index 000000000000..3bc50a415364 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -0,0 +1,319 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; +import com.google.cloud.compute.v1.Firewall; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import com.google.cloud.compute.v1.FirewallList; +import com.google.cloud.compute.v1.FirewallName; +import com.google.cloud.compute.v1.FirewallSettings; +import com.google.cloud.compute.v1.GetFirewallHttpRequest; +import com.google.cloud.compute.v1.InsertFirewallHttpRequest; +import com.google.cloud.compute.v1.ListFirewallsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchFirewallHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonFirewallStub extends FirewallStub { + @InternalApi + public static final ApiMethodDescriptor deleteFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(FirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(FirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Firewall.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listFirewallsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListFirewallsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(FirewallList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(FirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(FirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteFirewallCallable; + private final UnaryCallable getFirewallCallable; + private final UnaryCallable insertFirewallCallable; + private final UnaryCallable listFirewallsCallable; + private final UnaryCallable listFirewallsPagedCallable; + private final UnaryCallable patchFirewallCallable; + private final UnaryCallable updateFirewallCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonFirewallStub create(FirewallStubSettings settings) throws IOException { + return new HttpJsonFirewallStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonFirewallStub create(ClientContext clientContext) throws IOException { + return new HttpJsonFirewallStub(FirewallStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonFirewallStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonFirewallStub(FirewallStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonFirewallStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonFirewallStub(FirewallStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonFirewallCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonFirewallStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonFirewallStub(FirewallStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteFirewallTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFirewallMethodDescriptor) + .build(); + HttpJsonCallSettings getFirewallTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFirewallMethodDescriptor) + .build(); + HttpJsonCallSettings insertFirewallTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertFirewallMethodDescriptor) + .build(); + HttpJsonCallSettings listFirewallsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFirewallsMethodDescriptor) + .build(); + HttpJsonCallSettings patchFirewallTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchFirewallMethodDescriptor) + .build(); + HttpJsonCallSettings updateFirewallTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFirewallMethodDescriptor) + .build(); + + this.deleteFirewallCallable = callableFactory.createUnaryCallable(deleteFirewallTransportSettings,settings.deleteFirewallSettings(), clientContext); + this.getFirewallCallable = callableFactory.createUnaryCallable(getFirewallTransportSettings,settings.getFirewallSettings(), clientContext); + this.insertFirewallCallable = callableFactory.createUnaryCallable(insertFirewallTransportSettings,settings.insertFirewallSettings(), clientContext); + this.listFirewallsCallable = callableFactory.createUnaryCallable(listFirewallsTransportSettings,settings.listFirewallsSettings(), clientContext); + this.listFirewallsPagedCallable = callableFactory.createPagedCallable(listFirewallsTransportSettings,settings.listFirewallsSettings(), clientContext); + this.patchFirewallCallable = callableFactory.createUnaryCallable(patchFirewallTransportSettings,settings.patchFirewallSettings(), clientContext); + this.updateFirewallCallable = callableFactory.createUnaryCallable(updateFirewallTransportSettings,settings.updateFirewallSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteFirewallCallable() { + return deleteFirewallCallable; + } + + @BetaApi + public UnaryCallable getFirewallCallable() { + return getFirewallCallable; + } + + @BetaApi + public UnaryCallable insertFirewallCallable() { + return insertFirewallCallable; + } + + @BetaApi + public UnaryCallable listFirewallsPagedCallable() { + return listFirewallsPagedCallable; + } + + @BetaApi + public UnaryCallable listFirewallsCallable() { + return listFirewallsCallable; + } + + @BetaApi + public UnaryCallable patchFirewallCallable() { + return patchFirewallCallable; + } + + @BetaApi + public UnaryCallable updateFirewallCallable() { + return updateFirewallCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java new file mode 100644 index 000000000000..ead882f0c257 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.ForwardingRuleName; +import com.google.cloud.compute.v1.ForwardingRuleSettings; +import com.google.cloud.compute.v1.ForwardingRulesScopedList; +import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.TargetReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonForwardingRuleCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java new file mode 100644 index 000000000000..6b877cffec9a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -0,0 +1,332 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.ForwardingRuleName; +import com.google.cloud.compute.v1.ForwardingRuleSettings; +import com.google.cloud.compute.v1.ForwardingRulesScopedList; +import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.TargetReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListForwardingRulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/forwardingRules")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRuleAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRule.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listForwardingRulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListForwardingRulesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRuleList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setTargetForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.setTarget") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListForwardingRulesCallable; + private final UnaryCallable aggregatedListForwardingRulesPagedCallable; + private final UnaryCallable deleteForwardingRuleCallable; + private final UnaryCallable getForwardingRuleCallable; + private final UnaryCallable insertForwardingRuleCallable; + private final UnaryCallable listForwardingRulesCallable; + private final UnaryCallable listForwardingRulesPagedCallable; + private final UnaryCallable setTargetForwardingRuleCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonForwardingRuleStub create(ForwardingRuleStubSettings settings) throws IOException { + return new HttpJsonForwardingRuleStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonForwardingRuleStub create(ClientContext clientContext) throws IOException { + return new HttpJsonForwardingRuleStub(ForwardingRuleStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonForwardingRuleStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonForwardingRuleStub(ForwardingRuleStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonForwardingRuleStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonForwardingRuleStub(ForwardingRuleStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonForwardingRuleCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonForwardingRuleStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonForwardingRuleStub(ForwardingRuleStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListForwardingRulesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListForwardingRulesMethodDescriptor) + .build(); + HttpJsonCallSettings deleteForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings getForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings insertForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings listForwardingRulesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listForwardingRulesMethodDescriptor) + .build(); + HttpJsonCallSettings setTargetForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTargetForwardingRuleMethodDescriptor) + .build(); + + this.aggregatedListForwardingRulesCallable = callableFactory.createUnaryCallable(aggregatedListForwardingRulesTransportSettings,settings.aggregatedListForwardingRulesSettings(), clientContext); + this.aggregatedListForwardingRulesPagedCallable = callableFactory.createPagedCallable(aggregatedListForwardingRulesTransportSettings,settings.aggregatedListForwardingRulesSettings(), clientContext); + this.deleteForwardingRuleCallable = callableFactory.createUnaryCallable(deleteForwardingRuleTransportSettings,settings.deleteForwardingRuleSettings(), clientContext); + this.getForwardingRuleCallable = callableFactory.createUnaryCallable(getForwardingRuleTransportSettings,settings.getForwardingRuleSettings(), clientContext); + this.insertForwardingRuleCallable = callableFactory.createUnaryCallable(insertForwardingRuleTransportSettings,settings.insertForwardingRuleSettings(), clientContext); + this.listForwardingRulesCallable = callableFactory.createUnaryCallable(listForwardingRulesTransportSettings,settings.listForwardingRulesSettings(), clientContext); + this.listForwardingRulesPagedCallable = callableFactory.createPagedCallable(listForwardingRulesTransportSettings,settings.listForwardingRulesSettings(), clientContext); + this.setTargetForwardingRuleCallable = callableFactory.createUnaryCallable(setTargetForwardingRuleTransportSettings,settings.setTargetForwardingRuleSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListForwardingRulesPagedCallable() { + return aggregatedListForwardingRulesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListForwardingRulesCallable() { + return aggregatedListForwardingRulesCallable; + } + + @BetaApi + public UnaryCallable deleteForwardingRuleCallable() { + return deleteForwardingRuleCallable; + } + + @BetaApi + public UnaryCallable getForwardingRuleCallable() { + return getForwardingRuleCallable; + } + + @BetaApi + public UnaryCallable insertForwardingRuleCallable() { + return insertForwardingRuleCallable; + } + + @BetaApi + public UnaryCallable listForwardingRulesPagedCallable() { + return listForwardingRulesPagedCallable; + } + + @BetaApi + public UnaryCallable listForwardingRulesCallable() { + return listForwardingRulesCallable; + } + + @BetaApi + public UnaryCallable setTargetForwardingRuleCallable() { + return setTargetForwardingRuleCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java new file mode 100644 index 000000000000..9e3e06becd85 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import com.google.cloud.compute.v1.GlobalAddressSettings; +import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectAddressName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonGlobalAddressCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java new file mode 100644 index 000000000000..aa75842603a5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -0,0 +1,257 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.Address; +import com.google.cloud.compute.v1.AddressList; +import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import com.google.cloud.compute.v1.GlobalAddressSettings; +import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; +import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectAddressName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonGlobalAddressStub extends GlobalAddressStub { + @InternalApi + public static final ApiMethodDescriptor deleteGlobalAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectAddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getGlobalAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectAddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.

newBuilder() + .setResponseInstance(Address.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertGlobalAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listGlobalAddressesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalAddressesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AddressList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteGlobalAddressCallable; + private final UnaryCallable getGlobalAddressCallable; + private final UnaryCallable insertGlobalAddressCallable; + private final UnaryCallable listGlobalAddressesCallable; + private final UnaryCallable listGlobalAddressesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonGlobalAddressStub create(GlobalAddressStubSettings settings) throws IOException { + return new HttpJsonGlobalAddressStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGlobalAddressStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGlobalAddressStub(GlobalAddressStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonGlobalAddressStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGlobalAddressStub(GlobalAddressStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGlobalAddressStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonGlobalAddressStub(GlobalAddressStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonGlobalAddressCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGlobalAddressStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonGlobalAddressStub(GlobalAddressStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteGlobalAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteGlobalAddressMethodDescriptor) + .build(); + HttpJsonCallSettings getGlobalAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGlobalAddressMethodDescriptor) + .build(); + HttpJsonCallSettings insertGlobalAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertGlobalAddressMethodDescriptor) + .build(); + HttpJsonCallSettings listGlobalAddressesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listGlobalAddressesMethodDescriptor) + .build(); + + this.deleteGlobalAddressCallable = callableFactory.createUnaryCallable(deleteGlobalAddressTransportSettings,settings.deleteGlobalAddressSettings(), clientContext); + this.getGlobalAddressCallable = callableFactory.createUnaryCallable(getGlobalAddressTransportSettings,settings.getGlobalAddressSettings(), clientContext); + this.insertGlobalAddressCallable = callableFactory.createUnaryCallable(insertGlobalAddressTransportSettings,settings.insertGlobalAddressSettings(), clientContext); + this.listGlobalAddressesCallable = callableFactory.createUnaryCallable(listGlobalAddressesTransportSettings,settings.listGlobalAddressesSettings(), clientContext); + this.listGlobalAddressesPagedCallable = callableFactory.createPagedCallable(listGlobalAddressesTransportSettings,settings.listGlobalAddressesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteGlobalAddressCallable() { + return deleteGlobalAddressCallable; + } + + @BetaApi + public UnaryCallable getGlobalAddressCallable() { + return getGlobalAddressCallable; + } + + @BetaApi + public UnaryCallable insertGlobalAddressCallable() { + return insertGlobalAddressCallable; + } + + @BetaApi + public UnaryCallable listGlobalAddressesPagedCallable() { + return listGlobalAddressesPagedCallable; + } + + @BetaApi + public UnaryCallable listGlobalAddressesCallable() { + return listGlobalAddressesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java new file mode 100644 index 000000000000..2bb40db148ca --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.GlobalForwardingRuleSettings; +import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectForwardingRuleName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.TargetReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonGlobalForwardingRuleCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java new file mode 100644 index 000000000000..8d6bec3d7056 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -0,0 +1,289 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ForwardingRule; +import com.google.cloud.compute.v1.ForwardingRuleList; +import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.GlobalForwardingRuleSettings; +import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectForwardingRuleName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; +import com.google.cloud.compute.v1.TargetReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { + @InternalApi + public static final ApiMethodDescriptor deleteGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRule.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listGlobalForwardingRulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRuleList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setTargetGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.setTarget") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}/setTarget")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteGlobalForwardingRuleCallable; + private final UnaryCallable getGlobalForwardingRuleCallable; + private final UnaryCallable insertGlobalForwardingRuleCallable; + private final UnaryCallable listGlobalForwardingRulesCallable; + private final UnaryCallable listGlobalForwardingRulesPagedCallable; + private final UnaryCallable setTargetGlobalForwardingRuleCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonGlobalForwardingRuleStub create(GlobalForwardingRuleStubSettings settings) throws IOException { + return new HttpJsonGlobalForwardingRuleStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGlobalForwardingRuleStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonGlobalForwardingRuleStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGlobalForwardingRuleStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonGlobalForwardingRuleCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGlobalForwardingRuleStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteGlobalForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings getGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGlobalForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings insertGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertGlobalForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings listGlobalForwardingRulesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listGlobalForwardingRulesMethodDescriptor) + .build(); + HttpJsonCallSettings setTargetGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTargetGlobalForwardingRuleMethodDescriptor) + .build(); + + this.deleteGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(deleteGlobalForwardingRuleTransportSettings,settings.deleteGlobalForwardingRuleSettings(), clientContext); + this.getGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(getGlobalForwardingRuleTransportSettings,settings.getGlobalForwardingRuleSettings(), clientContext); + this.insertGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(insertGlobalForwardingRuleTransportSettings,settings.insertGlobalForwardingRuleSettings(), clientContext); + this.listGlobalForwardingRulesCallable = callableFactory.createUnaryCallable(listGlobalForwardingRulesTransportSettings,settings.listGlobalForwardingRulesSettings(), clientContext); + this.listGlobalForwardingRulesPagedCallable = callableFactory.createPagedCallable(listGlobalForwardingRulesTransportSettings,settings.listGlobalForwardingRulesSettings(), clientContext); + this.setTargetGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(setTargetGlobalForwardingRuleTransportSettings,settings.setTargetGlobalForwardingRuleSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteGlobalForwardingRuleCallable() { + return deleteGlobalForwardingRuleCallable; + } + + @BetaApi + public UnaryCallable getGlobalForwardingRuleCallable() { + return getGlobalForwardingRuleCallable; + } + + @BetaApi + public UnaryCallable insertGlobalForwardingRuleCallable() { + return insertGlobalForwardingRuleCallable; + } + + @BetaApi + public UnaryCallable listGlobalForwardingRulesPagedCallable() { + return listGlobalForwardingRulesPagedCallable; + } + + @BetaApi + public UnaryCallable listGlobalForwardingRulesCallable() { + return listGlobalForwardingRulesCallable; + } + + @BetaApi + public UnaryCallable setTargetGlobalForwardingRuleCallable() { + return setTargetGlobalForwardingRuleCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java new file mode 100644 index 000000000000..7e7024faf669 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; +import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import com.google.cloud.compute.v1.GlobalOperationSettings; +import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationAggregatedList; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.OperationName; +import com.google.cloud.compute.v1.OperationsScopedList; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonGlobalOperationCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java new file mode 100644 index 000000000000..94497845a597 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java @@ -0,0 +1,263 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; +import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import com.google.cloud.compute.v1.GlobalOperationSettings; +import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationAggregatedList; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.OperationName; +import com.google.cloud.compute.v1.OperationsScopedList; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonGlobalOperationStub extends GlobalOperationStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListGlobalOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/operations")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteGlobalOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalOperationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/operations/{operation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(OperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getGlobalOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalOperationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/operations/{operation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(OperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listGlobalOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/operations")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListGlobalOperationsCallable; + private final UnaryCallable aggregatedListGlobalOperationsPagedCallable; + private final UnaryCallable deleteGlobalOperationCallable; + private final UnaryCallable getGlobalOperationCallable; + private final UnaryCallable listGlobalOperationsCallable; + private final UnaryCallable listGlobalOperationsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonGlobalOperationStub create(GlobalOperationStubSettings settings) throws IOException { + return new HttpJsonGlobalOperationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGlobalOperationStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGlobalOperationStub(GlobalOperationStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonGlobalOperationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGlobalOperationStub(GlobalOperationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGlobalOperationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonGlobalOperationStub(GlobalOperationStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonGlobalOperationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGlobalOperationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonGlobalOperationStub(GlobalOperationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListGlobalOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListGlobalOperationsMethodDescriptor) + .build(); + HttpJsonCallSettings deleteGlobalOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteGlobalOperationMethodDescriptor) + .build(); + HttpJsonCallSettings getGlobalOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGlobalOperationMethodDescriptor) + .build(); + HttpJsonCallSettings listGlobalOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listGlobalOperationsMethodDescriptor) + .build(); + + this.aggregatedListGlobalOperationsCallable = callableFactory.createUnaryCallable(aggregatedListGlobalOperationsTransportSettings,settings.aggregatedListGlobalOperationsSettings(), clientContext); + this.aggregatedListGlobalOperationsPagedCallable = callableFactory.createPagedCallable(aggregatedListGlobalOperationsTransportSettings,settings.aggregatedListGlobalOperationsSettings(), clientContext); + this.deleteGlobalOperationCallable = callableFactory.createUnaryCallable(deleteGlobalOperationTransportSettings,settings.deleteGlobalOperationSettings(), clientContext); + this.getGlobalOperationCallable = callableFactory.createUnaryCallable(getGlobalOperationTransportSettings,settings.getGlobalOperationSettings(), clientContext); + this.listGlobalOperationsCallable = callableFactory.createUnaryCallable(listGlobalOperationsTransportSettings,settings.listGlobalOperationsSettings(), clientContext); + this.listGlobalOperationsPagedCallable = callableFactory.createPagedCallable(listGlobalOperationsTransportSettings,settings.listGlobalOperationsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListGlobalOperationsPagedCallable() { + return aggregatedListGlobalOperationsPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListGlobalOperationsCallable() { + return aggregatedListGlobalOperationsCallable; + } + + @BetaApi + public UnaryCallable deleteGlobalOperationCallable() { + return deleteGlobalOperationCallable; + } + + @BetaApi + public UnaryCallable getGlobalOperationCallable() { + return getGlobalOperationCallable; + } + + @BetaApi + public UnaryCallable listGlobalOperationsPagedCallable() { + return listGlobalOperationsPagedCallable; + } + + @BetaApi + public UnaryCallable listGlobalOperationsCallable() { + return listGlobalOperationsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java new file mode 100644 index 000000000000..a5f298355e74 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HealthCheck; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HealthCheckList; +import com.google.cloud.compute.v1.HealthCheckName; +import com.google.cloud.compute.v1.HealthCheckSettings; +import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonHealthCheckCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java new file mode 100644 index 000000000000..4eee744b6b10 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -0,0 +1,319 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HealthCheck; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HealthCheckList; +import com.google.cloud.compute.v1.HealthCheckName; +import com.google.cloud.compute.v1.HealthCheckSettings; +import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonHealthCheckStub extends HealthCheckStub { + @InternalApi + public static final ApiMethodDescriptor deleteHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HealthCheck.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listHealthChecksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHealthChecksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HealthCheckList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteHealthCheckCallable; + private final UnaryCallable getHealthCheckCallable; + private final UnaryCallable insertHealthCheckCallable; + private final UnaryCallable listHealthChecksCallable; + private final UnaryCallable listHealthChecksPagedCallable; + private final UnaryCallable patchHealthCheckCallable; + private final UnaryCallable updateHealthCheckCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonHealthCheckStub create(HealthCheckStubSettings settings) throws IOException { + return new HttpJsonHealthCheckStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonHealthCheckStub create(ClientContext clientContext) throws IOException { + return new HttpJsonHealthCheckStub(HealthCheckStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonHealthCheckStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHealthCheckStub(HealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonHealthCheckStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonHealthCheckStub(HealthCheckStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonHealthCheckCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonHealthCheckStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonHealthCheckStub(HealthCheckStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings getHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings insertHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings listHealthChecksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listHealthChecksMethodDescriptor) + .build(); + HttpJsonCallSettings patchHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings updateHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateHealthCheckMethodDescriptor) + .build(); + + this.deleteHealthCheckCallable = callableFactory.createUnaryCallable(deleteHealthCheckTransportSettings,settings.deleteHealthCheckSettings(), clientContext); + this.getHealthCheckCallable = callableFactory.createUnaryCallable(getHealthCheckTransportSettings,settings.getHealthCheckSettings(), clientContext); + this.insertHealthCheckCallable = callableFactory.createUnaryCallable(insertHealthCheckTransportSettings,settings.insertHealthCheckSettings(), clientContext); + this.listHealthChecksCallable = callableFactory.createUnaryCallable(listHealthChecksTransportSettings,settings.listHealthChecksSettings(), clientContext); + this.listHealthChecksPagedCallable = callableFactory.createPagedCallable(listHealthChecksTransportSettings,settings.listHealthChecksSettings(), clientContext); + this.patchHealthCheckCallable = callableFactory.createUnaryCallable(patchHealthCheckTransportSettings,settings.patchHealthCheckSettings(), clientContext); + this.updateHealthCheckCallable = callableFactory.createUnaryCallable(updateHealthCheckTransportSettings,settings.updateHealthCheckSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteHealthCheckCallable() { + return deleteHealthCheckCallable; + } + + @BetaApi + public UnaryCallable getHealthCheckCallable() { + return getHealthCheckCallable; + } + + @BetaApi + public UnaryCallable insertHealthCheckCallable() { + return insertHealthCheckCallable; + } + + @BetaApi + public UnaryCallable listHealthChecksPagedCallable() { + return listHealthChecksPagedCallable; + } + + @BetaApi + public UnaryCallable listHealthChecksCallable() { + return listHealthChecksCallable; + } + + @BetaApi + public UnaryCallable patchHealthCheckCallable() { + return patchHealthCheckCallable; + } + + @BetaApi + public UnaryCallable updateHealthCheckCallable() { + return updateHealthCheckCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java new file mode 100644 index 000000000000..68c18b08ff97 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpHealthCheck; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpHealthCheckList; +import com.google.cloud.compute.v1.HttpHealthCheckName; +import com.google.cloud.compute.v1.HttpHealthCheckSettings; +import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonHttpHealthCheckCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java new file mode 100644 index 000000000000..b23145fac407 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -0,0 +1,319 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpHealthCheck; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpHealthCheckList; +import com.google.cloud.compute.v1.HttpHealthCheckName; +import com.google.cloud.compute.v1.HttpHealthCheckSettings; +import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { + @InternalApi + public static final ApiMethodDescriptor deleteHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheck.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listHttpHealthChecksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHttpHealthChecksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheckList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteHttpHealthCheckCallable; + private final UnaryCallable getHttpHealthCheckCallable; + private final UnaryCallable insertHttpHealthCheckCallable; + private final UnaryCallable listHttpHealthChecksCallable; + private final UnaryCallable listHttpHealthChecksPagedCallable; + private final UnaryCallable patchHttpHealthCheckCallable; + private final UnaryCallable updateHttpHealthCheckCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonHttpHealthCheckStub create(HttpHealthCheckStubSettings settings) throws IOException { + return new HttpJsonHttpHealthCheckStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonHttpHealthCheckStub create(ClientContext clientContext) throws IOException { + return new HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonHttpHealthCheckStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonHttpHealthCheckStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonHttpHealthCheckCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonHttpHealthCheckStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings getHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings insertHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings listHttpHealthChecksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listHttpHealthChecksMethodDescriptor) + .build(); + HttpJsonCallSettings patchHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings updateHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateHttpHealthCheckMethodDescriptor) + .build(); + + this.deleteHttpHealthCheckCallable = callableFactory.createUnaryCallable(deleteHttpHealthCheckTransportSettings,settings.deleteHttpHealthCheckSettings(), clientContext); + this.getHttpHealthCheckCallable = callableFactory.createUnaryCallable(getHttpHealthCheckTransportSettings,settings.getHttpHealthCheckSettings(), clientContext); + this.insertHttpHealthCheckCallable = callableFactory.createUnaryCallable(insertHttpHealthCheckTransportSettings,settings.insertHttpHealthCheckSettings(), clientContext); + this.listHttpHealthChecksCallable = callableFactory.createUnaryCallable(listHttpHealthChecksTransportSettings,settings.listHttpHealthChecksSettings(), clientContext); + this.listHttpHealthChecksPagedCallable = callableFactory.createPagedCallable(listHttpHealthChecksTransportSettings,settings.listHttpHealthChecksSettings(), clientContext); + this.patchHttpHealthCheckCallable = callableFactory.createUnaryCallable(patchHttpHealthCheckTransportSettings,settings.patchHttpHealthCheckSettings(), clientContext); + this.updateHttpHealthCheckCallable = callableFactory.createUnaryCallable(updateHttpHealthCheckTransportSettings,settings.updateHttpHealthCheckSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteHttpHealthCheckCallable() { + return deleteHttpHealthCheckCallable; + } + + @BetaApi + public UnaryCallable getHttpHealthCheckCallable() { + return getHttpHealthCheckCallable; + } + + @BetaApi + public UnaryCallable insertHttpHealthCheckCallable() { + return insertHttpHealthCheckCallable; + } + + @BetaApi + public UnaryCallable listHttpHealthChecksPagedCallable() { + return listHttpHealthChecksPagedCallable; + } + + @BetaApi + public UnaryCallable listHttpHealthChecksCallable() { + return listHttpHealthChecksCallable; + } + + @BetaApi + public UnaryCallable patchHttpHealthCheckCallable() { + return patchHttpHealthCheckCallable; + } + + @BetaApi + public UnaryCallable updateHttpHealthCheckCallable() { + return updateHttpHealthCheckCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java new file mode 100644 index 000000000000..bcdbe457fda3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpsHealthCheck; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpsHealthCheckList; +import com.google.cloud.compute.v1.HttpsHealthCheckName; +import com.google.cloud.compute.v1.HttpsHealthCheckSettings; +import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonHttpsHealthCheckCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java new file mode 100644 index 000000000000..48f35e7103a5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -0,0 +1,319 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpsHealthCheck; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpsHealthCheckList; +import com.google.cloud.compute.v1.HttpsHealthCheckName; +import com.google.cloud.compute.v1.HttpsHealthCheckSettings; +import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { + @InternalApi + public static final ApiMethodDescriptor deleteHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheck.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listHttpsHealthChecksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHttpsHealthChecksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheckList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(HttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteHttpsHealthCheckCallable; + private final UnaryCallable getHttpsHealthCheckCallable; + private final UnaryCallable insertHttpsHealthCheckCallable; + private final UnaryCallable listHttpsHealthChecksCallable; + private final UnaryCallable listHttpsHealthChecksPagedCallable; + private final UnaryCallable patchHttpsHealthCheckCallable; + private final UnaryCallable updateHttpsHealthCheckCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonHttpsHealthCheckStub create(HttpsHealthCheckStubSettings settings) throws IOException { + return new HttpJsonHttpsHealthCheckStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonHttpsHealthCheckStub create(ClientContext clientContext) throws IOException { + return new HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonHttpsHealthCheckStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonHttpsHealthCheckStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonHttpsHealthCheckCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonHttpsHealthCheckStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings getHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings insertHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings listHttpsHealthChecksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listHttpsHealthChecksMethodDescriptor) + .build(); + HttpJsonCallSettings patchHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings updateHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateHttpsHealthCheckMethodDescriptor) + .build(); + + this.deleteHttpsHealthCheckCallable = callableFactory.createUnaryCallable(deleteHttpsHealthCheckTransportSettings,settings.deleteHttpsHealthCheckSettings(), clientContext); + this.getHttpsHealthCheckCallable = callableFactory.createUnaryCallable(getHttpsHealthCheckTransportSettings,settings.getHttpsHealthCheckSettings(), clientContext); + this.insertHttpsHealthCheckCallable = callableFactory.createUnaryCallable(insertHttpsHealthCheckTransportSettings,settings.insertHttpsHealthCheckSettings(), clientContext); + this.listHttpsHealthChecksCallable = callableFactory.createUnaryCallable(listHttpsHealthChecksTransportSettings,settings.listHttpsHealthChecksSettings(), clientContext); + this.listHttpsHealthChecksPagedCallable = callableFactory.createPagedCallable(listHttpsHealthChecksTransportSettings,settings.listHttpsHealthChecksSettings(), clientContext); + this.patchHttpsHealthCheckCallable = callableFactory.createUnaryCallable(patchHttpsHealthCheckTransportSettings,settings.patchHttpsHealthCheckSettings(), clientContext); + this.updateHttpsHealthCheckCallable = callableFactory.createUnaryCallable(updateHttpsHealthCheckTransportSettings,settings.updateHttpsHealthCheckSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteHttpsHealthCheckCallable() { + return deleteHttpsHealthCheckCallable; + } + + @BetaApi + public UnaryCallable getHttpsHealthCheckCallable() { + return getHttpsHealthCheckCallable; + } + + @BetaApi + public UnaryCallable insertHttpsHealthCheckCallable() { + return insertHttpsHealthCheckCallable; + } + + @BetaApi + public UnaryCallable listHttpsHealthChecksPagedCallable() { + return listHttpsHealthChecksPagedCallable; + } + + @BetaApi + public UnaryCallable listHttpsHealthChecksCallable() { + return listHttpsHealthChecksCallable; + } + + @BetaApi + public UnaryCallable patchHttpsHealthCheckCallable() { + return patchHttpsHealthCheckCallable; + } + + @BetaApi + public UnaryCallable updateHttpsHealthCheckCallable() { + return updateHttpsHealthCheckCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java new file mode 100644 index 000000000000..01b6b1c43e74 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java @@ -0,0 +1,100 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteImageHttpRequest; +import com.google.cloud.compute.v1.DeprecateImageHttpRequest; +import com.google.cloud.compute.v1.DeprecationStatus; +import com.google.cloud.compute.v1.FamilyName; +import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.Image; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import com.google.cloud.compute.v1.ImageList; +import com.google.cloud.compute.v1.ImageName; +import com.google.cloud.compute.v1.ImageSettings; +import com.google.cloud.compute.v1.InsertImageHttpRequest; +import com.google.cloud.compute.v1.ListImagesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonImageCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java new file mode 100644 index 000000000000..0af37c62dd70 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -0,0 +1,321 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteImageHttpRequest; +import com.google.cloud.compute.v1.DeprecateImageHttpRequest; +import com.google.cloud.compute.v1.DeprecationStatus; +import com.google.cloud.compute.v1.FamilyName; +import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.Image; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import com.google.cloud.compute.v1.ImageList; +import com.google.cloud.compute.v1.ImageName; +import com.google.cloud.compute.v1.ImageSettings; +import com.google.cloud.compute.v1.InsertImageHttpRequest; +import com.google.cloud.compute.v1.ListImagesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonImageStub extends ImageStub { + @InternalApi + public static final ApiMethodDescriptor deleteImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ImageName.newFactory()) + .setResourceNameField("image") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deprecateImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.deprecate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images/{image}/deprecate")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ImageName.newFactory()) + .setResourceNameField("image") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ImageName.newFactory()) + .setResourceNameField("image") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Image.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getFromFamilyImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.getFromFamily") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetFromFamilyImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images/family/{family}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(FamilyName.newFactory()) + .setResourceNameField("family") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Image.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listImagesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListImagesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ImageList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteImageCallable; + private final UnaryCallable deprecateImageCallable; + private final UnaryCallable getImageCallable; + private final UnaryCallable getFromFamilyImageCallable; + private final UnaryCallable insertImageCallable; + private final UnaryCallable listImagesCallable; + private final UnaryCallable listImagesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonImageStub create(ImageStubSettings settings) throws IOException { + return new HttpJsonImageStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonImageStub create(ClientContext clientContext) throws IOException { + return new HttpJsonImageStub(ImageStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonImageStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonImageStub(ImageStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonImageStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonImageCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonImageStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteImageMethodDescriptor) + .build(); + HttpJsonCallSettings deprecateImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deprecateImageMethodDescriptor) + .build(); + HttpJsonCallSettings getImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getImageMethodDescriptor) + .build(); + HttpJsonCallSettings getFromFamilyImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFromFamilyImageMethodDescriptor) + .build(); + HttpJsonCallSettings insertImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertImageMethodDescriptor) + .build(); + HttpJsonCallSettings listImagesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listImagesMethodDescriptor) + .build(); + + this.deleteImageCallable = callableFactory.createUnaryCallable(deleteImageTransportSettings,settings.deleteImageSettings(), clientContext); + this.deprecateImageCallable = callableFactory.createUnaryCallable(deprecateImageTransportSettings,settings.deprecateImageSettings(), clientContext); + this.getImageCallable = callableFactory.createUnaryCallable(getImageTransportSettings,settings.getImageSettings(), clientContext); + this.getFromFamilyImageCallable = callableFactory.createUnaryCallable(getFromFamilyImageTransportSettings,settings.getFromFamilyImageSettings(), clientContext); + this.insertImageCallable = callableFactory.createUnaryCallable(insertImageTransportSettings,settings.insertImageSettings(), clientContext); + this.listImagesCallable = callableFactory.createUnaryCallable(listImagesTransportSettings,settings.listImagesSettings(), clientContext); + this.listImagesPagedCallable = callableFactory.createPagedCallable(listImagesTransportSettings,settings.listImagesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteImageCallable() { + return deleteImageCallable; + } + + @BetaApi + public UnaryCallable deprecateImageCallable() { + return deprecateImageCallable; + } + + @BetaApi + public UnaryCallable getImageCallable() { + return getImageCallable; + } + + @BetaApi + public UnaryCallable getFromFamilyImageCallable() { + return getFromFamilyImageCallable; + } + + @BetaApi + public UnaryCallable insertImageCallable() { + return insertImageCallable; + } + + @BetaApi + public UnaryCallable listImagesPagedCallable() { + return listImagesPagedCallable; + } + + @BetaApi + public UnaryCallable listImagesCallable() { + return listImagesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java new file mode 100644 index 000000000000..50372c488cf4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java @@ -0,0 +1,125 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AccessConfig; +import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; +import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.AttachedDisk; +import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceHttpRequest; +import com.google.cloud.compute.v1.Instance; +import com.google.cloud.compute.v1.InstanceAggregatedList; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceName; +import com.google.cloud.compute.v1.InstanceSettings; +import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; +import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; +import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; +import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResetInstanceHttpRequest; +import com.google.cloud.compute.v1.Scheduling; +import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; +import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; +import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; +import com.google.cloud.compute.v1.StartInstanceHttpRequest; +import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; +import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.Tags; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInstanceCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java new file mode 100644 index 000000000000..293d754c49a3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceGroupAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupList; +import com.google.cloud.compute.v1.InstanceGroupName; +import com.google.cloud.compute.v1.InstanceGroupSettings; +import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsListInstances; +import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsScopedList; +import com.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInstanceGroupCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java new file mode 100644 index 000000000000..68aa6f18d2da --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java @@ -0,0 +1,114 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupManagerList; +import com.google.cloud.compute.v1.InstanceGroupManagerName; +import com.google.cloud.compute.v1.InstanceGroupManagerSettings; +import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; +import com.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; +import com.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; +import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInstanceGroupManagerCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java new file mode 100644 index 000000000000..c7fdd7d97011 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -0,0 +1,525 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupManagerList; +import com.google.cloud.compute.v1.InstanceGroupManagerName; +import com.google.cloud.compute.v1.InstanceGroupManagerSettings; +import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; +import com.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; +import com.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; +import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { + @InternalApi + public static final ApiMethodDescriptor abandonInstancesInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.abandonInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor aggregatedListInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManagerAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteInstancesInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.deleteInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManager.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManagerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listManagedInstancesInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.listManagedInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "order_by", "pageToken" + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManagersListManagedInstancesResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor recreateInstancesInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.recreateInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor resizeInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) + .setQueryParams(Sets.newHashSet( + "size" + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setInstanceTemplateInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.setInstanceTemplate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setTargetPoolsInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.setTargetPools") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable abandonInstancesInstanceGroupManagerCallable; + private final UnaryCallable aggregatedListInstanceGroupManagersCallable; + private final UnaryCallable aggregatedListInstanceGroupManagersPagedCallable; + private final UnaryCallable deleteInstanceGroupManagerCallable; + private final UnaryCallable deleteInstancesInstanceGroupManagerCallable; + private final UnaryCallable getInstanceGroupManagerCallable; + private final UnaryCallable insertInstanceGroupManagerCallable; + private final UnaryCallable listInstanceGroupManagersCallable; + private final UnaryCallable listInstanceGroupManagersPagedCallable; + private final UnaryCallable listManagedInstancesInstanceGroupManagersCallable; + private final UnaryCallable recreateInstancesInstanceGroupManagerCallable; + private final UnaryCallable resizeInstanceGroupManagerCallable; + private final UnaryCallable setInstanceTemplateInstanceGroupManagerCallable; + private final UnaryCallable setTargetPoolsInstanceGroupManagerCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInstanceGroupManagerStub create(InstanceGroupManagerStubSettings settings) throws IOException { + return new HttpJsonInstanceGroupManagerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInstanceGroupManagerStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInstanceGroupManagerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInstanceGroupManagerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInstanceGroupManagerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInstanceGroupManagerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings abandonInstancesInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(abandonInstancesInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings aggregatedListInstanceGroupManagersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings deleteInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings deleteInstancesInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstancesInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings getInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings insertInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings listInstanceGroupManagersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings listManagedInstancesInstanceGroupManagersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listManagedInstancesInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings recreateInstancesInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recreateInstancesInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings resizeInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resizeInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings setInstanceTemplateInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setInstanceTemplateInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings setTargetPoolsInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTargetPoolsInstanceGroupManagerMethodDescriptor) + .build(); + + this.abandonInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable(abandonInstancesInstanceGroupManagerTransportSettings,settings.abandonInstancesInstanceGroupManagerSettings(), clientContext); + this.aggregatedListInstanceGroupManagersCallable = callableFactory.createUnaryCallable(aggregatedListInstanceGroupManagersTransportSettings,settings.aggregatedListInstanceGroupManagersSettings(), clientContext); + this.aggregatedListInstanceGroupManagersPagedCallable = callableFactory.createPagedCallable(aggregatedListInstanceGroupManagersTransportSettings,settings.aggregatedListInstanceGroupManagersSettings(), clientContext); + this.deleteInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteInstanceGroupManagerTransportSettings,settings.deleteInstanceGroupManagerSettings(), clientContext); + this.deleteInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteInstancesInstanceGroupManagerTransportSettings,settings.deleteInstancesInstanceGroupManagerSettings(), clientContext); + this.getInstanceGroupManagerCallable = callableFactory.createUnaryCallable(getInstanceGroupManagerTransportSettings,settings.getInstanceGroupManagerSettings(), clientContext); + this.insertInstanceGroupManagerCallable = callableFactory.createUnaryCallable(insertInstanceGroupManagerTransportSettings,settings.insertInstanceGroupManagerSettings(), clientContext); + this.listInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listInstanceGroupManagersTransportSettings,settings.listInstanceGroupManagersSettings(), clientContext); + this.listInstanceGroupManagersPagedCallable = callableFactory.createPagedCallable(listInstanceGroupManagersTransportSettings,settings.listInstanceGroupManagersSettings(), clientContext); + this.listManagedInstancesInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listManagedInstancesInstanceGroupManagersTransportSettings,settings.listManagedInstancesInstanceGroupManagersSettings(), clientContext); + this.recreateInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable(recreateInstancesInstanceGroupManagerTransportSettings,settings.recreateInstancesInstanceGroupManagerSettings(), clientContext); + this.resizeInstanceGroupManagerCallable = callableFactory.createUnaryCallable(resizeInstanceGroupManagerTransportSettings,settings.resizeInstanceGroupManagerSettings(), clientContext); + this.setInstanceTemplateInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setInstanceTemplateInstanceGroupManagerTransportSettings,settings.setInstanceTemplateInstanceGroupManagerSettings(), clientContext); + this.setTargetPoolsInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setTargetPoolsInstanceGroupManagerTransportSettings,settings.setTargetPoolsInstanceGroupManagerSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable abandonInstancesInstanceGroupManagerCallable() { + return abandonInstancesInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { + return aggregatedListInstanceGroupManagersPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupManagersCallable() { + return aggregatedListInstanceGroupManagersCallable; + } + + @BetaApi + public UnaryCallable deleteInstanceGroupManagerCallable() { + return deleteInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable deleteInstancesInstanceGroupManagerCallable() { + return deleteInstancesInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable getInstanceGroupManagerCallable() { + return getInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable insertInstanceGroupManagerCallable() { + return insertInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable listInstanceGroupManagersPagedCallable() { + return listInstanceGroupManagersPagedCallable; + } + + @BetaApi + public UnaryCallable listInstanceGroupManagersCallable() { + return listInstanceGroupManagersCallable; + } + + @BetaApi + public UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { + return listManagedInstancesInstanceGroupManagersCallable; + } + + @BetaApi + public UnaryCallable recreateInstancesInstanceGroupManagerCallable() { + return recreateInstancesInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable resizeInstanceGroupManagerCallable() { + return resizeInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { + return setInstanceTemplateInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { + return setTargetPoolsInstanceGroupManagerCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java new file mode 100644 index 000000000000..3921277dbcc5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -0,0 +1,439 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceGroupAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupList; +import com.google.cloud.compute.v1.InstanceGroupName; +import com.google.cloud.compute.v1.InstanceGroupSettings; +import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsListInstances; +import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsScopedList; +import com.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInstanceGroupStub extends InstanceGroupStub { + @InternalApi + public static final ApiMethodDescriptor addInstancesInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.addInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor aggregatedListInstanceGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroups")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroup.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInstanceGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInstancesInstanceGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.listInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(InstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupsListInstances.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor removeInstancesInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.removeInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setNamedPortsInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.setNamedPorts") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable addInstancesInstanceGroupCallable; + private final UnaryCallable aggregatedListInstanceGroupsCallable; + private final UnaryCallable aggregatedListInstanceGroupsPagedCallable; + private final UnaryCallable deleteInstanceGroupCallable; + private final UnaryCallable getInstanceGroupCallable; + private final UnaryCallable insertInstanceGroupCallable; + private final UnaryCallable listInstanceGroupsCallable; + private final UnaryCallable listInstanceGroupsPagedCallable; + private final UnaryCallable listInstancesInstanceGroupsCallable; + private final UnaryCallable listInstancesInstanceGroupsPagedCallable; + private final UnaryCallable removeInstancesInstanceGroupCallable; + private final UnaryCallable setNamedPortsInstanceGroupCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInstanceGroupStub create(InstanceGroupStubSettings settings) throws IOException { + return new HttpJsonInstanceGroupStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInstanceGroupStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInstanceGroupStub(InstanceGroupStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInstanceGroupStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceGroupStub(InstanceGroupStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInstanceGroupStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceGroupStub(InstanceGroupStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInstanceGroupCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInstanceGroupStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceGroupStub(InstanceGroupStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings addInstancesInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addInstancesInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings aggregatedListInstanceGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings deleteInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings getInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings insertInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings listInstanceGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings listInstancesInstanceGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings removeInstancesInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removeInstancesInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings setNamedPortsInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setNamedPortsInstanceGroupMethodDescriptor) + .build(); + + this.addInstancesInstanceGroupCallable = callableFactory.createUnaryCallable(addInstancesInstanceGroupTransportSettings,settings.addInstancesInstanceGroupSettings(), clientContext); + this.aggregatedListInstanceGroupsCallable = callableFactory.createUnaryCallable(aggregatedListInstanceGroupsTransportSettings,settings.aggregatedListInstanceGroupsSettings(), clientContext); + this.aggregatedListInstanceGroupsPagedCallable = callableFactory.createPagedCallable(aggregatedListInstanceGroupsTransportSettings,settings.aggregatedListInstanceGroupsSettings(), clientContext); + this.deleteInstanceGroupCallable = callableFactory.createUnaryCallable(deleteInstanceGroupTransportSettings,settings.deleteInstanceGroupSettings(), clientContext); + this.getInstanceGroupCallable = callableFactory.createUnaryCallable(getInstanceGroupTransportSettings,settings.getInstanceGroupSettings(), clientContext); + this.insertInstanceGroupCallable = callableFactory.createUnaryCallable(insertInstanceGroupTransportSettings,settings.insertInstanceGroupSettings(), clientContext); + this.listInstanceGroupsCallable = callableFactory.createUnaryCallable(listInstanceGroupsTransportSettings,settings.listInstanceGroupsSettings(), clientContext); + this.listInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listInstanceGroupsTransportSettings,settings.listInstanceGroupsSettings(), clientContext); + this.listInstancesInstanceGroupsCallable = callableFactory.createUnaryCallable(listInstancesInstanceGroupsTransportSettings,settings.listInstancesInstanceGroupsSettings(), clientContext); + this.listInstancesInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listInstancesInstanceGroupsTransportSettings,settings.listInstancesInstanceGroupsSettings(), clientContext); + this.removeInstancesInstanceGroupCallable = callableFactory.createUnaryCallable(removeInstancesInstanceGroupTransportSettings,settings.removeInstancesInstanceGroupSettings(), clientContext); + this.setNamedPortsInstanceGroupCallable = callableFactory.createUnaryCallable(setNamedPortsInstanceGroupTransportSettings,settings.setNamedPortsInstanceGroupSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable addInstancesInstanceGroupCallable() { + return addInstancesInstanceGroupCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupsPagedCallable() { + return aggregatedListInstanceGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupsCallable() { + return aggregatedListInstanceGroupsCallable; + } + + @BetaApi + public UnaryCallable deleteInstanceGroupCallable() { + return deleteInstanceGroupCallable; + } + + @BetaApi + public UnaryCallable getInstanceGroupCallable() { + return getInstanceGroupCallable; + } + + @BetaApi + public UnaryCallable insertInstanceGroupCallable() { + return insertInstanceGroupCallable; + } + + @BetaApi + public UnaryCallable listInstanceGroupsPagedCallable() { + return listInstanceGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable listInstanceGroupsCallable() { + return listInstanceGroupsCallable; + } + + @BetaApi + public UnaryCallable listInstancesInstanceGroupsPagedCallable() { + return listInstancesInstanceGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable listInstancesInstanceGroupsCallable() { + return listInstancesInstanceGroupsCallable; + } + + @BetaApi + public UnaryCallable removeInstancesInstanceGroupCallable() { + return removeInstancesInstanceGroupCallable; + } + + @BetaApi + public UnaryCallable setNamedPortsInstanceGroupCallable() { + return setNamedPortsInstanceGroupCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java new file mode 100644 index 000000000000..152be2825cbe --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -0,0 +1,779 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AccessConfig; +import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; +import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.AttachedDisk; +import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceHttpRequest; +import com.google.cloud.compute.v1.Instance; +import com.google.cloud.compute.v1.InstanceAggregatedList; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceName; +import com.google.cloud.compute.v1.InstanceSettings; +import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; +import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; +import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; +import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResetInstanceHttpRequest; +import com.google.cloud.compute.v1.Scheduling; +import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; +import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; +import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; +import com.google.cloud.compute.v1.StartInstanceHttpRequest; +import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; +import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.Tags; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInstanceStub extends InstanceStub { + @InternalApi + public static final ApiMethodDescriptor addAccessConfigInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.addAccessConfig") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/addAccessConfig")) + .setQueryParams(Sets.newHashSet( + "networkInterface" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor aggregatedListInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/instances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor attachDiskInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.attachDisk") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/attachDisk")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteAccessConfigInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.deleteAccessConfig") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) + .setQueryParams(Sets.newHashSet( + "accessConfig", "networkInterface" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor detachDiskInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.detachDisk") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/detachDisk")) + .setQueryParams(Sets.newHashSet( + "deviceName" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Instance.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getSerialPortOutputInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.getSerialPortOutput") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/serialPort")) + .setQueryParams(Sets.newHashSet( + "port", "start" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SerialPortOutput.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor resetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.reset") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setDiskAutoDeleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setDiskAutoDelete") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) + .setQueryParams(Sets.newHashSet( + "autoDelete", "deviceName" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setMachineTypeInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMachineType") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMachineType")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setMetadataInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMetadata") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMetadata")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setSchedulingInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setScheduling") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setScheduling")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setServiceAccountInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setServiceAccount") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setServiceAccount")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setTagsInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setTags") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setTags")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor startInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.start") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor startWithEncryptionKeyInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.startWithEncryptionKey") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor stopInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.stop") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable addAccessConfigInstanceCallable; + private final UnaryCallable aggregatedListInstancesCallable; + private final UnaryCallable aggregatedListInstancesPagedCallable; + private final UnaryCallable attachDiskInstanceCallable; + private final UnaryCallable deleteInstanceCallable; + private final UnaryCallable deleteAccessConfigInstanceCallable; + private final UnaryCallable detachDiskInstanceCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable getSerialPortOutputInstanceCallable; + private final UnaryCallable insertInstanceCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable listInstancesPagedCallable; + private final UnaryCallable resetInstanceCallable; + private final UnaryCallable setDiskAutoDeleteInstanceCallable; + private final UnaryCallable setMachineTypeInstanceCallable; + private final UnaryCallable setMetadataInstanceCallable; + private final UnaryCallable setSchedulingInstanceCallable; + private final UnaryCallable setServiceAccountInstanceCallable; + private final UnaryCallable setTagsInstanceCallable; + private final UnaryCallable startInstanceCallable; + private final UnaryCallable startWithEncryptionKeyInstanceCallable; + private final UnaryCallable stopInstanceCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInstanceStub create(InstanceStubSettings settings) throws IOException { + return new HttpJsonInstanceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInstanceStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInstanceStub(InstanceStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInstanceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceStub(InstanceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInstanceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInstanceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInstanceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings addAccessConfigInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addAccessConfigInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings aggregatedListInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListInstancesMethodDescriptor) + .build(); + HttpJsonCallSettings attachDiskInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attachDiskInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings deleteAccessConfigInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAccessConfigInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings detachDiskInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(detachDiskInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings getSerialPortOutputInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSerialPortOutputInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings insertInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .build(); + HttpJsonCallSettings resetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setDiskAutoDeleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDiskAutoDeleteInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setMachineTypeInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMachineTypeInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setMetadataInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMetadataInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setSchedulingInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSchedulingInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setServiceAccountInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setServiceAccountInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setTagsInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTagsInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings startInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings startWithEncryptionKeyInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startWithEncryptionKeyInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings stopInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(stopInstanceMethodDescriptor) + .build(); + + this.addAccessConfigInstanceCallable = callableFactory.createUnaryCallable(addAccessConfigInstanceTransportSettings,settings.addAccessConfigInstanceSettings(), clientContext); + this.aggregatedListInstancesCallable = callableFactory.createUnaryCallable(aggregatedListInstancesTransportSettings,settings.aggregatedListInstancesSettings(), clientContext); + this.aggregatedListInstancesPagedCallable = callableFactory.createPagedCallable(aggregatedListInstancesTransportSettings,settings.aggregatedListInstancesSettings(), clientContext); + this.attachDiskInstanceCallable = callableFactory.createUnaryCallable(attachDiskInstanceTransportSettings,settings.attachDiskInstanceSettings(), clientContext); + this.deleteInstanceCallable = callableFactory.createUnaryCallable(deleteInstanceTransportSettings,settings.deleteInstanceSettings(), clientContext); + this.deleteAccessConfigInstanceCallable = callableFactory.createUnaryCallable(deleteAccessConfigInstanceTransportSettings,settings.deleteAccessConfigInstanceSettings(), clientContext); + this.detachDiskInstanceCallable = callableFactory.createUnaryCallable(detachDiskInstanceTransportSettings,settings.detachDiskInstanceSettings(), clientContext); + this.getInstanceCallable = callableFactory.createUnaryCallable(getInstanceTransportSettings,settings.getInstanceSettings(), clientContext); + this.getSerialPortOutputInstanceCallable = callableFactory.createUnaryCallable(getSerialPortOutputInstanceTransportSettings,settings.getSerialPortOutputInstanceSettings(), clientContext); + this.insertInstanceCallable = callableFactory.createUnaryCallable(insertInstanceTransportSettings,settings.insertInstanceSettings(), clientContext); + this.listInstancesCallable = callableFactory.createUnaryCallable(listInstancesTransportSettings,settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = callableFactory.createPagedCallable(listInstancesTransportSettings,settings.listInstancesSettings(), clientContext); + this.resetInstanceCallable = callableFactory.createUnaryCallable(resetInstanceTransportSettings,settings.resetInstanceSettings(), clientContext); + this.setDiskAutoDeleteInstanceCallable = callableFactory.createUnaryCallable(setDiskAutoDeleteInstanceTransportSettings,settings.setDiskAutoDeleteInstanceSettings(), clientContext); + this.setMachineTypeInstanceCallable = callableFactory.createUnaryCallable(setMachineTypeInstanceTransportSettings,settings.setMachineTypeInstanceSettings(), clientContext); + this.setMetadataInstanceCallable = callableFactory.createUnaryCallable(setMetadataInstanceTransportSettings,settings.setMetadataInstanceSettings(), clientContext); + this.setSchedulingInstanceCallable = callableFactory.createUnaryCallable(setSchedulingInstanceTransportSettings,settings.setSchedulingInstanceSettings(), clientContext); + this.setServiceAccountInstanceCallable = callableFactory.createUnaryCallable(setServiceAccountInstanceTransportSettings,settings.setServiceAccountInstanceSettings(), clientContext); + this.setTagsInstanceCallable = callableFactory.createUnaryCallable(setTagsInstanceTransportSettings,settings.setTagsInstanceSettings(), clientContext); + this.startInstanceCallable = callableFactory.createUnaryCallable(startInstanceTransportSettings,settings.startInstanceSettings(), clientContext); + this.startWithEncryptionKeyInstanceCallable = callableFactory.createUnaryCallable(startWithEncryptionKeyInstanceTransportSettings,settings.startWithEncryptionKeyInstanceSettings(), clientContext); + this.stopInstanceCallable = callableFactory.createUnaryCallable(stopInstanceTransportSettings,settings.stopInstanceSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable addAccessConfigInstanceCallable() { + return addAccessConfigInstanceCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInstancesPagedCallable() { + return aggregatedListInstancesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInstancesCallable() { + return aggregatedListInstancesCallable; + } + + @BetaApi + public UnaryCallable attachDiskInstanceCallable() { + return attachDiskInstanceCallable; + } + + @BetaApi + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @BetaApi + public UnaryCallable deleteAccessConfigInstanceCallable() { + return deleteAccessConfigInstanceCallable; + } + + @BetaApi + public UnaryCallable detachDiskInstanceCallable() { + return detachDiskInstanceCallable; + } + + @BetaApi + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @BetaApi + public UnaryCallable getSerialPortOutputInstanceCallable() { + return getSerialPortOutputInstanceCallable; + } + + @BetaApi + public UnaryCallable insertInstanceCallable() { + return insertInstanceCallable; + } + + @BetaApi + public UnaryCallable listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @BetaApi + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @BetaApi + public UnaryCallable resetInstanceCallable() { + return resetInstanceCallable; + } + + @BetaApi + public UnaryCallable setDiskAutoDeleteInstanceCallable() { + return setDiskAutoDeleteInstanceCallable; + } + + @BetaApi + public UnaryCallable setMachineTypeInstanceCallable() { + return setMachineTypeInstanceCallable; + } + + @BetaApi + public UnaryCallable setMetadataInstanceCallable() { + return setMetadataInstanceCallable; + } + + @BetaApi + public UnaryCallable setSchedulingInstanceCallable() { + return setSchedulingInstanceCallable; + } + + @BetaApi + public UnaryCallable setServiceAccountInstanceCallable() { + return setServiceAccountInstanceCallable; + } + + @BetaApi + public UnaryCallable setTagsInstanceCallable() { + return setTagsInstanceCallable; + } + + @BetaApi + public UnaryCallable startInstanceCallable() { + return startInstanceCallable; + } + + @BetaApi + public UnaryCallable startWithEncryptionKeyInstanceCallable() { + return startWithEncryptionKeyInstanceCallable; + } + + @BetaApi + public UnaryCallable stopInstanceCallable() { + return stopInstanceCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java new file mode 100644 index 000000000000..c5c267d0acd5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InstanceTemplate; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import com.google.cloud.compute.v1.InstanceTemplateList; +import com.google.cloud.compute.v1.InstanceTemplateName; +import com.google.cloud.compute.v1.InstanceTemplateSettings; +import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInstanceTemplateCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java new file mode 100644 index 000000000000..e6a3603dd4ab --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -0,0 +1,257 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InstanceTemplate; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import com.google.cloud.compute.v1.InstanceTemplateList; +import com.google.cloud.compute.v1.InstanceTemplateName; +import com.google.cloud.compute.v1.InstanceTemplateSettings; +import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { + @InternalApi + public static final ApiMethodDescriptor deleteInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates/{instanceTemplate}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceTemplateName.newFactory()) + .setResourceNameField("instanceTemplate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceTemplateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates/{instanceTemplate}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InstanceTemplateName.newFactory()) + .setResourceNameField("instanceTemplate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceTemplate.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInstanceTemplatesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceTemplatesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceTemplateList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteInstanceTemplateCallable; + private final UnaryCallable getInstanceTemplateCallable; + private final UnaryCallable insertInstanceTemplateCallable; + private final UnaryCallable listInstanceTemplatesCallable; + private final UnaryCallable listInstanceTemplatesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInstanceTemplateStub create(InstanceTemplateStubSettings settings) throws IOException { + return new HttpJsonInstanceTemplateStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInstanceTemplateStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInstanceTemplateStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInstanceTemplateStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInstanceTemplateCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInstanceTemplateStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings getInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings insertInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings listInstanceTemplatesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstanceTemplatesMethodDescriptor) + .build(); + + this.deleteInstanceTemplateCallable = callableFactory.createUnaryCallable(deleteInstanceTemplateTransportSettings,settings.deleteInstanceTemplateSettings(), clientContext); + this.getInstanceTemplateCallable = callableFactory.createUnaryCallable(getInstanceTemplateTransportSettings,settings.getInstanceTemplateSettings(), clientContext); + this.insertInstanceTemplateCallable = callableFactory.createUnaryCallable(insertInstanceTemplateTransportSettings,settings.insertInstanceTemplateSettings(), clientContext); + this.listInstanceTemplatesCallable = callableFactory.createUnaryCallable(listInstanceTemplatesTransportSettings,settings.listInstanceTemplatesSettings(), clientContext); + this.listInstanceTemplatesPagedCallable = callableFactory.createPagedCallable(listInstanceTemplatesTransportSettings,settings.listInstanceTemplatesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteInstanceTemplateCallable() { + return deleteInstanceTemplateCallable; + } + + @BetaApi + public UnaryCallable getInstanceTemplateCallable() { + return getInstanceTemplateCallable; + } + + @BetaApi + public UnaryCallable insertInstanceTemplateCallable() { + return insertInstanceTemplateCallable; + } + + @BetaApi + public UnaryCallable listInstanceTemplatesPagedCallable() { + return listInstanceTemplatesPagedCallable; + } + + @BetaApi + public UnaryCallable listInstanceTemplatesCallable() { + return listInstanceTemplatesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java new file mode 100644 index 000000000000..17d059d168a9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java @@ -0,0 +1,90 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetLicensHttpRequest; +import com.google.cloud.compute.v1.LicensSettings; +import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicenseName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonLicensCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java new file mode 100644 index 000000000000..2d645076e23e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java @@ -0,0 +1,152 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetLicensHttpRequest; +import com.google.cloud.compute.v1.LicensSettings; +import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicenseName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonLicensStub extends LicensStub { + @InternalApi + public static final ApiMethodDescriptor getLicensMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetLicensHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(LicenseName.newFactory()) + .setResourceNameField("license") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(License.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getLicensCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonLicensStub create(LicensStubSettings settings) throws IOException { + return new HttpJsonLicensStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonLicensStub create(ClientContext clientContext) throws IOException { + return new HttpJsonLicensStub(LicensStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonLicensStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLicensStub(LicensStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonLicensStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonLicensStub(LicensStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonLicensCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonLicensStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonLicensStub(LicensStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getLicensTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLicensMethodDescriptor) + .build(); + + this.getLicensCallable = callableFactory.createUnaryCallable(getLicensTransportSettings,settings.getLicensSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getLicensCallable() { + return getLicensCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java new file mode 100644 index 000000000000..a20d3a4d8604 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java @@ -0,0 +1,99 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.GetMachineTypeHttpRequest; +import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.MachineType; +import com.google.cloud.compute.v1.MachineTypeAggregatedList; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import com.google.cloud.compute.v1.MachineTypeList; +import com.google.cloud.compute.v1.MachineTypeName; +import com.google.cloud.compute.v1.MachineTypeSettings; +import com.google.cloud.compute.v1.MachineTypesScopedList; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonMachineTypeCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java new file mode 100644 index 000000000000..3295cab00f41 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java @@ -0,0 +1,237 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.GetMachineTypeHttpRequest; +import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.MachineType; +import com.google.cloud.compute.v1.MachineTypeAggregatedList; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import com.google.cloud.compute.v1.MachineTypeList; +import com.google.cloud.compute.v1.MachineTypeName; +import com.google.cloud.compute.v1.MachineTypeSettings; +import com.google.cloud.compute.v1.MachineTypesScopedList; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonMachineTypeStub extends MachineTypeStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListMachineTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.machineTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListMachineTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/machineTypes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(MachineTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getMachineTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.machineTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetMachineTypeHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(MachineTypeName.newFactory()) + .setResourceNameField("machineType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(MachineType.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listMachineTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.machineTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListMachineTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(MachineTypeList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListMachineTypesCallable; + private final UnaryCallable aggregatedListMachineTypesPagedCallable; + private final UnaryCallable getMachineTypeCallable; + private final UnaryCallable listMachineTypesCallable; + private final UnaryCallable listMachineTypesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonMachineTypeStub create(MachineTypeStubSettings settings) throws IOException { + return new HttpJsonMachineTypeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMachineTypeStub create(ClientContext clientContext) throws IOException { + return new HttpJsonMachineTypeStub(MachineTypeStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonMachineTypeStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMachineTypeStub(MachineTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMachineTypeStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonMachineTypeStub(MachineTypeStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonMachineTypeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMachineTypeStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonMachineTypeStub(MachineTypeStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListMachineTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListMachineTypesMethodDescriptor) + .build(); + HttpJsonCallSettings getMachineTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMachineTypeMethodDescriptor) + .build(); + HttpJsonCallSettings listMachineTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMachineTypesMethodDescriptor) + .build(); + + this.aggregatedListMachineTypesCallable = callableFactory.createUnaryCallable(aggregatedListMachineTypesTransportSettings,settings.aggregatedListMachineTypesSettings(), clientContext); + this.aggregatedListMachineTypesPagedCallable = callableFactory.createPagedCallable(aggregatedListMachineTypesTransportSettings,settings.aggregatedListMachineTypesSettings(), clientContext); + this.getMachineTypeCallable = callableFactory.createUnaryCallable(getMachineTypeTransportSettings,settings.getMachineTypeSettings(), clientContext); + this.listMachineTypesCallable = callableFactory.createUnaryCallable(listMachineTypesTransportSettings,settings.listMachineTypesSettings(), clientContext); + this.listMachineTypesPagedCallable = callableFactory.createPagedCallable(listMachineTypesTransportSettings,settings.listMachineTypesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListMachineTypesPagedCallable() { + return aggregatedListMachineTypesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListMachineTypesCallable() { + return aggregatedListMachineTypesCallable; + } + + @BetaApi + public UnaryCallable getMachineTypeCallable() { + return getMachineTypeCallable; + } + + @BetaApi + public UnaryCallable listMachineTypesPagedCallable() { + return listMachineTypesPagedCallable; + } + + @BetaApi + public UnaryCallable listMachineTypesCallable() { + return listMachineTypesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java new file mode 100644 index 000000000000..e035188fd2e1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java @@ -0,0 +1,97 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; +import com.google.cloud.compute.v1.GetNetworkHttpRequest; +import com.google.cloud.compute.v1.InsertNetworkHttpRequest; +import com.google.cloud.compute.v1.ListNetworksHttpRequest; +import com.google.cloud.compute.v1.Network; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import com.google.cloud.compute.v1.NetworkList; +import com.google.cloud.compute.v1.NetworkName; +import com.google.cloud.compute.v1.NetworkSettings; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonNetworkCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java new file mode 100644 index 000000000000..793370d46202 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -0,0 +1,288 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; +import com.google.cloud.compute.v1.GetNetworkHttpRequest; +import com.google.cloud.compute.v1.InsertNetworkHttpRequest; +import com.google.cloud.compute.v1.ListNetworksHttpRequest; +import com.google.cloud.compute.v1.Network; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import com.google.cloud.compute.v1.NetworkList; +import com.google.cloud.compute.v1.NetworkName; +import com.google.cloud.compute.v1.NetworkSettings; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonNetworkStub extends NetworkStub { + @InternalApi + public static final ApiMethodDescriptor deleteNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(NetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(NetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Network.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listNetworksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListNetworksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NetworkList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor switchToCustomModeNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.switchToCustomMode") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/switchToCustomMode")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(NetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteNetworkCallable; + private final UnaryCallable getNetworkCallable; + private final UnaryCallable insertNetworkCallable; + private final UnaryCallable listNetworksCallable; + private final UnaryCallable listNetworksPagedCallable; + private final UnaryCallable switchToCustomModeNetworkCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonNetworkStub create(NetworkStubSettings settings) throws IOException { + return new HttpJsonNetworkStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonNetworkStub create(ClientContext clientContext) throws IOException { + return new HttpJsonNetworkStub(NetworkStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonNetworkStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNetworkStub(NetworkStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonNetworkStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonNetworkCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonNetworkStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteNetworkMethodDescriptor) + .build(); + HttpJsonCallSettings getNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getNetworkMethodDescriptor) + .build(); + HttpJsonCallSettings insertNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertNetworkMethodDescriptor) + .build(); + HttpJsonCallSettings listNetworksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listNetworksMethodDescriptor) + .build(); + HttpJsonCallSettings switchToCustomModeNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(switchToCustomModeNetworkMethodDescriptor) + .build(); + + this.deleteNetworkCallable = callableFactory.createUnaryCallable(deleteNetworkTransportSettings,settings.deleteNetworkSettings(), clientContext); + this.getNetworkCallable = callableFactory.createUnaryCallable(getNetworkTransportSettings,settings.getNetworkSettings(), clientContext); + this.insertNetworkCallable = callableFactory.createUnaryCallable(insertNetworkTransportSettings,settings.insertNetworkSettings(), clientContext); + this.listNetworksCallable = callableFactory.createUnaryCallable(listNetworksTransportSettings,settings.listNetworksSettings(), clientContext); + this.listNetworksPagedCallable = callableFactory.createPagedCallable(listNetworksTransportSettings,settings.listNetworksSettings(), clientContext); + this.switchToCustomModeNetworkCallable = callableFactory.createUnaryCallable(switchToCustomModeNetworkTransportSettings,settings.switchToCustomModeNetworkSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteNetworkCallable() { + return deleteNetworkCallable; + } + + @BetaApi + public UnaryCallable getNetworkCallable() { + return getNetworkCallable; + } + + @BetaApi + public UnaryCallable insertNetworkCallable() { + return insertNetworkCallable; + } + + @BetaApi + public UnaryCallable listNetworksPagedCallable() { + return listNetworksPagedCallable; + } + + @BetaApi + public UnaryCallable listNetworksCallable() { + return listNetworksCallable; + } + + @BetaApi + public UnaryCallable switchToCustomModeNetworkCallable() { + return switchToCustomModeNetworkCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java new file mode 100644 index 000000000000..31ca3fe880da --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DiskMoveRequest; +import com.google.cloud.compute.v1.GetProjectHttpRequest; +import com.google.cloud.compute.v1.InstanceMoveRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; +import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Project; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectSettings; +import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; +import com.google.cloud.compute.v1.UsageExportLocation; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonProjectCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java new file mode 100644 index 000000000000..3fe62a4578aa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -0,0 +1,281 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DiskMoveRequest; +import com.google.cloud.compute.v1.GetProjectHttpRequest; +import com.google.cloud.compute.v1.InstanceMoveRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; +import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Project; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectSettings; +import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; +import com.google.cloud.compute.v1.UsageExportLocation; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonProjectStub extends ProjectStub { + @InternalApi + public static final ApiMethodDescriptor getProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Project.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor moveDiskProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.moveDisk") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/moveDisk")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor moveInstanceProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.moveInstance") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/moveInstance")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setCommonInstanceMetadataProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.setCommonInstanceMetadata") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setUsageExportBucketProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.setUsageExportBucket") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getProjectCallable; + private final UnaryCallable moveDiskProjectCallable; + private final UnaryCallable moveInstanceProjectCallable; + private final UnaryCallable setCommonInstanceMetadataProjectCallable; + private final UnaryCallable setUsageExportBucketProjectCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonProjectStub create(ProjectStubSettings settings) throws IOException { + return new HttpJsonProjectStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonProjectStub create(ClientContext clientContext) throws IOException { + return new HttpJsonProjectStub(ProjectStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonProjectStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonProjectStub(ProjectStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonProjectStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonProjectCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonProjectStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProjectMethodDescriptor) + .build(); + HttpJsonCallSettings moveDiskProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(moveDiskProjectMethodDescriptor) + .build(); + HttpJsonCallSettings moveInstanceProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(moveInstanceProjectMethodDescriptor) + .build(); + HttpJsonCallSettings setCommonInstanceMetadataProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setCommonInstanceMetadataProjectMethodDescriptor) + .build(); + HttpJsonCallSettings setUsageExportBucketProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUsageExportBucketProjectMethodDescriptor) + .build(); + + this.getProjectCallable = callableFactory.createUnaryCallable(getProjectTransportSettings,settings.getProjectSettings(), clientContext); + this.moveDiskProjectCallable = callableFactory.createUnaryCallable(moveDiskProjectTransportSettings,settings.moveDiskProjectSettings(), clientContext); + this.moveInstanceProjectCallable = callableFactory.createUnaryCallable(moveInstanceProjectTransportSettings,settings.moveInstanceProjectSettings(), clientContext); + this.setCommonInstanceMetadataProjectCallable = callableFactory.createUnaryCallable(setCommonInstanceMetadataProjectTransportSettings,settings.setCommonInstanceMetadataProjectSettings(), clientContext); + this.setUsageExportBucketProjectCallable = callableFactory.createUnaryCallable(setUsageExportBucketProjectTransportSettings,settings.setUsageExportBucketProjectSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getProjectCallable() { + return getProjectCallable; + } + + @BetaApi + public UnaryCallable moveDiskProjectCallable() { + return moveDiskProjectCallable; + } + + @BetaApi + public UnaryCallable moveInstanceProjectCallable() { + return moveInstanceProjectCallable; + } + + @BetaApi + public UnaryCallable setCommonInstanceMetadataProjectCallable() { + return setCommonInstanceMetadataProjectCallable; + } + + @BetaApi + public UnaryCallable setUsageExportBucketProjectCallable() { + return setUsageExportBucketProjectCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java new file mode 100644 index 000000000000..fcd290fceae8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.DeleteRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionAutoscalerName; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import com.google.cloud.compute.v1.RegionAutoscalerList; +import com.google.cloud.compute.v1.RegionAutoscalerSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionAutoscalerCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java new file mode 100644 index 000000000000..92462d8cdbd1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -0,0 +1,321 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.DeleteRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionAutoscalerName; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import com.google.cloud.compute.v1.RegionAutoscalerList; +import com.google.cloud.compute.v1.RegionAutoscalerSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { + @InternalApi + public static final ApiMethodDescriptor deleteRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Autoscaler.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionAutoscalersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionAutoscalersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionAutoscalerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet( + "autoscaler" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet( + "autoscaler" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteRegionAutoscalerCallable; + private final UnaryCallable getRegionAutoscalerCallable; + private final UnaryCallable insertRegionAutoscalerCallable; + private final UnaryCallable listRegionAutoscalersCallable; + private final UnaryCallable listRegionAutoscalersPagedCallable; + private final UnaryCallable patchRegionAutoscalerCallable; + private final UnaryCallable updateRegionAutoscalerCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionAutoscalerStub create(RegionAutoscalerStubSettings settings) throws IOException { + return new HttpJsonRegionAutoscalerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionAutoscalerStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionAutoscalerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionAutoscalerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionAutoscalerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionAutoscalerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings getRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings insertRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionAutoscalersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionAutoscalersMethodDescriptor) + .build(); + HttpJsonCallSettings patchRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings updateRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRegionAutoscalerMethodDescriptor) + .build(); + + this.deleteRegionAutoscalerCallable = callableFactory.createUnaryCallable(deleteRegionAutoscalerTransportSettings,settings.deleteRegionAutoscalerSettings(), clientContext); + this.getRegionAutoscalerCallable = callableFactory.createUnaryCallable(getRegionAutoscalerTransportSettings,settings.getRegionAutoscalerSettings(), clientContext); + this.insertRegionAutoscalerCallable = callableFactory.createUnaryCallable(insertRegionAutoscalerTransportSettings,settings.insertRegionAutoscalerSettings(), clientContext); + this.listRegionAutoscalersCallable = callableFactory.createUnaryCallable(listRegionAutoscalersTransportSettings,settings.listRegionAutoscalersSettings(), clientContext); + this.listRegionAutoscalersPagedCallable = callableFactory.createPagedCallable(listRegionAutoscalersTransportSettings,settings.listRegionAutoscalersSettings(), clientContext); + this.patchRegionAutoscalerCallable = callableFactory.createUnaryCallable(patchRegionAutoscalerTransportSettings,settings.patchRegionAutoscalerSettings(), clientContext); + this.updateRegionAutoscalerCallable = callableFactory.createUnaryCallable(updateRegionAutoscalerTransportSettings,settings.updateRegionAutoscalerSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteRegionAutoscalerCallable() { + return deleteRegionAutoscalerCallable; + } + + @BetaApi + public UnaryCallable getRegionAutoscalerCallable() { + return getRegionAutoscalerCallable; + } + + @BetaApi + public UnaryCallable insertRegionAutoscalerCallable() { + return insertRegionAutoscalerCallable; + } + + @BetaApi + public UnaryCallable listRegionAutoscalersPagedCallable() { + return listRegionAutoscalersPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionAutoscalersCallable() { + return listRegionAutoscalersCallable; + } + + @BetaApi + public UnaryCallable patchRegionAutoscalerCallable() { + return patchRegionAutoscalerCallable; + } + + @BetaApi + public UnaryCallable updateRegionAutoscalerCallable() { + return updateRegionAutoscalerCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java new file mode 100644 index 000000000000..0b8932b4676b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import com.google.cloud.compute.v1.RegionBackendServiceSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionBackendServiceCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java new file mode 100644 index 000000000000..fa77a4123b2f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -0,0 +1,352 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import com.google.cloud.compute.v1.RegionBackendServiceSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { + @InternalApi + public static final ApiMethodDescriptor deleteRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendService.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getHealthRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.getHealth") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}/getHealth")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceGroupHealth.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionBackendServicesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionBackendServicesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteRegionBackendServiceCallable; + private final UnaryCallable getRegionBackendServiceCallable; + private final UnaryCallable getHealthRegionBackendServiceCallable; + private final UnaryCallable insertRegionBackendServiceCallable; + private final UnaryCallable listRegionBackendServicesCallable; + private final UnaryCallable listRegionBackendServicesPagedCallable; + private final UnaryCallable patchRegionBackendServiceCallable; + private final UnaryCallable updateRegionBackendServiceCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionBackendServiceStub create(RegionBackendServiceStubSettings settings) throws IOException { + return new HttpJsonRegionBackendServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionBackendServiceStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionBackendServiceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionBackendServiceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionBackendServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionBackendServiceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings getRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings getHealthRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHealthRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings insertRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionBackendServicesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionBackendServicesMethodDescriptor) + .build(); + HttpJsonCallSettings patchRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings updateRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRegionBackendServiceMethodDescriptor) + .build(); + + this.deleteRegionBackendServiceCallable = callableFactory.createUnaryCallable(deleteRegionBackendServiceTransportSettings,settings.deleteRegionBackendServiceSettings(), clientContext); + this.getRegionBackendServiceCallable = callableFactory.createUnaryCallable(getRegionBackendServiceTransportSettings,settings.getRegionBackendServiceSettings(), clientContext); + this.getHealthRegionBackendServiceCallable = callableFactory.createUnaryCallable(getHealthRegionBackendServiceTransportSettings,settings.getHealthRegionBackendServiceSettings(), clientContext); + this.insertRegionBackendServiceCallable = callableFactory.createUnaryCallable(insertRegionBackendServiceTransportSettings,settings.insertRegionBackendServiceSettings(), clientContext); + this.listRegionBackendServicesCallable = callableFactory.createUnaryCallable(listRegionBackendServicesTransportSettings,settings.listRegionBackendServicesSettings(), clientContext); + this.listRegionBackendServicesPagedCallable = callableFactory.createPagedCallable(listRegionBackendServicesTransportSettings,settings.listRegionBackendServicesSettings(), clientContext); + this.patchRegionBackendServiceCallable = callableFactory.createUnaryCallable(patchRegionBackendServiceTransportSettings,settings.patchRegionBackendServiceSettings(), clientContext); + this.updateRegionBackendServiceCallable = callableFactory.createUnaryCallable(updateRegionBackendServiceTransportSettings,settings.updateRegionBackendServiceSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteRegionBackendServiceCallable() { + return deleteRegionBackendServiceCallable; + } + + @BetaApi + public UnaryCallable getRegionBackendServiceCallable() { + return getRegionBackendServiceCallable; + } + + @BetaApi + public UnaryCallable getHealthRegionBackendServiceCallable() { + return getHealthRegionBackendServiceCallable; + } + + @BetaApi + public UnaryCallable insertRegionBackendServiceCallable() { + return insertRegionBackendServiceCallable; + } + + @BetaApi + public UnaryCallable listRegionBackendServicesPagedCallable() { + return listRegionBackendServicesPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionBackendServicesCallable() { + return listRegionBackendServicesCallable; + } + + @BetaApi + public UnaryCallable patchRegionBackendServiceCallable() { + return patchRegionBackendServiceCallable; + } + + @BetaApi + public UnaryCallable updateRegionBackendServiceCallable() { + return updateRegionBackendServiceCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java new file mode 100644 index 000000000000..ce7ecaa68e00 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetRegionHttpRequest; +import com.google.cloud.compute.v1.ListRegionsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Region; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import com.google.cloud.compute.v1.RegionList; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.RegionSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java new file mode 100644 index 000000000000..9e211fa13df9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupList; +import com.google.cloud.compute.v1.RegionInstanceGroupSettings; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionInstanceGroupCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java new file mode 100644 index 000000000000..dadd8de78e82 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java @@ -0,0 +1,109 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; +import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; +import com.google.cloud.compute.v1.RegionInstanceGroupManagerSettings; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionInstanceGroupManagerCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java new file mode 100644 index 000000000000..df1bce025a37 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -0,0 +1,482 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; +import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; +import com.google.cloud.compute.v1.RegionInstanceGroupManagerSettings; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupManagerStub { + @InternalApi + public static final ApiMethodDescriptor abandonInstancesRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.abandonInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AbandonInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteInstancesRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.deleteInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManager.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupManagerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listManagedInstancesRegionInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.listManagedInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListManagedInstancesRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "order_by", "pageToken" + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupManagersListInstancesResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor recreateInstancesRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.recreateInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor resizeRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) + .setQueryParams(Sets.newHashSet( + "size" + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.setInstanceTemplate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setTargetPoolsRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.setTargetPools") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable; + private final UnaryCallable deleteRegionInstanceGroupManagerCallable; + private final UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable; + private final UnaryCallable getRegionInstanceGroupManagerCallable; + private final UnaryCallable insertRegionInstanceGroupManagerCallable; + private final UnaryCallable listRegionInstanceGroupManagersCallable; + private final UnaryCallable listRegionInstanceGroupManagersPagedCallable; + private final UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable; + private final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable; + private final UnaryCallable resizeRegionInstanceGroupManagerCallable; + private final UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable; + private final UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionInstanceGroupManagerStub create(RegionInstanceGroupManagerStubSettings settings) throws IOException { + return new HttpJsonRegionInstanceGroupManagerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionInstanceGroupManagerStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionInstanceGroupManagerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionInstanceGroupManagerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionInstanceGroupManagerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionInstanceGroupManagerStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings abandonInstancesRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(abandonInstancesRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings deleteRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings deleteInstancesRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstancesRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings getRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings insertRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionInstanceGroupManagersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings listManagedInstancesRegionInstanceGroupManagersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listManagedInstancesRegionInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings recreateInstancesRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recreateInstancesRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings resizeRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resizeRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings setInstanceTemplateRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings setTargetPoolsRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTargetPoolsRegionInstanceGroupManagerMethodDescriptor) + .build(); + + this.abandonInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(abandonInstancesRegionInstanceGroupManagerTransportSettings,settings.abandonInstancesRegionInstanceGroupManagerSettings(), clientContext); + this.deleteRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteRegionInstanceGroupManagerTransportSettings,settings.deleteRegionInstanceGroupManagerSettings(), clientContext); + this.deleteInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteInstancesRegionInstanceGroupManagerTransportSettings,settings.deleteInstancesRegionInstanceGroupManagerSettings(), clientContext); + this.getRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(getRegionInstanceGroupManagerTransportSettings,settings.getRegionInstanceGroupManagerSettings(), clientContext); + this.insertRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(insertRegionInstanceGroupManagerTransportSettings,settings.insertRegionInstanceGroupManagerSettings(), clientContext); + this.listRegionInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listRegionInstanceGroupManagersTransportSettings,settings.listRegionInstanceGroupManagersSettings(), clientContext); + this.listRegionInstanceGroupManagersPagedCallable = callableFactory.createPagedCallable(listRegionInstanceGroupManagersTransportSettings,settings.listRegionInstanceGroupManagersSettings(), clientContext); + this.listManagedInstancesRegionInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listManagedInstancesRegionInstanceGroupManagersTransportSettings,settings.listManagedInstancesRegionInstanceGroupManagersSettings(), clientContext); + this.recreateInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(recreateInstancesRegionInstanceGroupManagerTransportSettings,settings.recreateInstancesRegionInstanceGroupManagerSettings(), clientContext); + this.resizeRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(resizeRegionInstanceGroupManagerTransportSettings,settings.resizeRegionInstanceGroupManagerSettings(), clientContext); + this.setInstanceTemplateRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setInstanceTemplateRegionInstanceGroupManagerTransportSettings,settings.setInstanceTemplateRegionInstanceGroupManagerSettings(), clientContext); + this.setTargetPoolsRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setTargetPoolsRegionInstanceGroupManagerTransportSettings,settings.setTargetPoolsRegionInstanceGroupManagerSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { + return abandonInstancesRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable deleteRegionInstanceGroupManagerCallable() { + return deleteRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { + return deleteInstancesRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable getRegionInstanceGroupManagerCallable() { + return getRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable insertRegionInstanceGroupManagerCallable() { + return insertRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupManagersPagedCallable() { + return listRegionInstanceGroupManagersPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupManagersCallable() { + return listRegionInstanceGroupManagersCallable; + } + + @BetaApi + public UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { + return listManagedInstancesRegionInstanceGroupManagersCallable; + } + + @BetaApi + public UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { + return recreateInstancesRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable resizeRegionInstanceGroupManagerCallable() { + return resizeRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { + return setInstanceTemplateRegionInstanceGroupManagerCallable; + } + + @BetaApi + public UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { + return setTargetPoolsRegionInstanceGroupManagerCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java new file mode 100644 index 000000000000..c7e077bd3953 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -0,0 +1,270 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupList; +import com.google.cloud.compute.v1.RegionInstanceGroupSettings; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { + @InternalApi + public static final ApiMethodDescriptor getRegionInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroups.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroup.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionInstanceGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroups.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInstancesRegionInstanceGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroups.listInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupsListInstances.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setNamedPortsRegionInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroups.setNamedPorts") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getRegionInstanceGroupCallable; + private final UnaryCallable listRegionInstanceGroupsCallable; + private final UnaryCallable listRegionInstanceGroupsPagedCallable; + private final UnaryCallable listInstancesRegionInstanceGroupsCallable; + private final UnaryCallable listInstancesRegionInstanceGroupsPagedCallable; + private final UnaryCallable setNamedPortsRegionInstanceGroupCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionInstanceGroupStub create(RegionInstanceGroupStubSettings settings) throws IOException { + return new HttpJsonRegionInstanceGroupStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionInstanceGroupStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionInstanceGroupStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionInstanceGroupStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionInstanceGroupCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionInstanceGroupStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getRegionInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionInstanceGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings listInstancesRegionInstanceGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesRegionInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings setNamedPortsRegionInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setNamedPortsRegionInstanceGroupMethodDescriptor) + .build(); + + this.getRegionInstanceGroupCallable = callableFactory.createUnaryCallable(getRegionInstanceGroupTransportSettings,settings.getRegionInstanceGroupSettings(), clientContext); + this.listRegionInstanceGroupsCallable = callableFactory.createUnaryCallable(listRegionInstanceGroupsTransportSettings,settings.listRegionInstanceGroupsSettings(), clientContext); + this.listRegionInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listRegionInstanceGroupsTransportSettings,settings.listRegionInstanceGroupsSettings(), clientContext); + this.listInstancesRegionInstanceGroupsCallable = callableFactory.createUnaryCallable(listInstancesRegionInstanceGroupsTransportSettings,settings.listInstancesRegionInstanceGroupsSettings(), clientContext); + this.listInstancesRegionInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listInstancesRegionInstanceGroupsTransportSettings,settings.listInstancesRegionInstanceGroupsSettings(), clientContext); + this.setNamedPortsRegionInstanceGroupCallable = callableFactory.createUnaryCallable(setNamedPortsRegionInstanceGroupTransportSettings,settings.setNamedPortsRegionInstanceGroupSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getRegionInstanceGroupCallable() { + return getRegionInstanceGroupCallable; + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupsPagedCallable() { + return listRegionInstanceGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupsCallable() { + return listRegionInstanceGroupsCallable; + } + + @BetaApi + public UnaryCallable listInstancesRegionInstanceGroupsPagedCallable() { + return listInstancesRegionInstanceGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable listInstancesRegionInstanceGroupsCallable() { + return listInstancesRegionInstanceGroupsCallable; + } + + @BetaApi + public UnaryCallable setNamedPortsRegionInstanceGroupCallable() { + return setNamedPortsRegionInstanceGroupCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java new file mode 100644 index 000000000000..74b59d8d3702 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; +import com.google.cloud.compute.v1.GetRegionOperationHttpRequest; +import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.ProjectRegionOperationName; +import com.google.cloud.compute.v1.RegionName; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import com.google.cloud.compute.v1.RegionOperationSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionOperationCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java new file mode 100644 index 000000000000..529fb39840d3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java @@ -0,0 +1,221 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; +import com.google.cloud.compute.v1.GetRegionOperationHttpRequest; +import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.ProjectRegionOperationName; +import com.google.cloud.compute.v1.RegionName; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import com.google.cloud.compute.v1.RegionOperationSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionOperationStub extends RegionOperationStub { + @InternalApi + public static final ApiMethodDescriptor deleteRegionOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionOperations.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionOperationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations/{operation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRegionOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionOperations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionOperationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations/{operation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectRegionOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionOperations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteRegionOperationCallable; + private final UnaryCallable getRegionOperationCallable; + private final UnaryCallable listRegionOperationsCallable; + private final UnaryCallable listRegionOperationsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionOperationStub create(RegionOperationStubSettings settings) throws IOException { + return new HttpJsonRegionOperationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionOperationStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionOperationStub(RegionOperationStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionOperationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionOperationStub(RegionOperationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionOperationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionOperationStub(RegionOperationStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionOperationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionOperationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionOperationStub(RegionOperationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteRegionOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionOperationMethodDescriptor) + .build(); + HttpJsonCallSettings getRegionOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionOperationMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionOperationsMethodDescriptor) + .build(); + + this.deleteRegionOperationCallable = callableFactory.createUnaryCallable(deleteRegionOperationTransportSettings,settings.deleteRegionOperationSettings(), clientContext); + this.getRegionOperationCallable = callableFactory.createUnaryCallable(getRegionOperationTransportSettings,settings.getRegionOperationSettings(), clientContext); + this.listRegionOperationsCallable = callableFactory.createUnaryCallable(listRegionOperationsTransportSettings,settings.listRegionOperationsSettings(), clientContext); + this.listRegionOperationsPagedCallable = callableFactory.createPagedCallable(listRegionOperationsTransportSettings,settings.listRegionOperationsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteRegionOperationCallable() { + return deleteRegionOperationCallable; + } + + @BetaApi + public UnaryCallable getRegionOperationCallable() { + return getRegionOperationCallable; + } + + @BetaApi + public UnaryCallable listRegionOperationsPagedCallable() { + return listRegionOperationsPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionOperationsCallable() { + return listRegionOperationsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java new file mode 100644 index 000000000000..38b7b52369a0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java @@ -0,0 +1,194 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetRegionHttpRequest; +import com.google.cloud.compute.v1.ListRegionsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Region; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import com.google.cloud.compute.v1.RegionList; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.RegionSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionStub extends RegionStub { + @InternalApi + public static final ApiMethodDescriptor getRegionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regions.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Region.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regions.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getRegionCallable; + private final UnaryCallable listRegionsCallable; + private final UnaryCallable listRegionsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionStub create(RegionStubSettings settings) throws IOException { + return new HttpJsonRegionStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionStub(RegionStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionStub(RegionStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionStub(RegionStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionStub(RegionStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getRegionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionsMethodDescriptor) + .build(); + + this.getRegionCallable = callableFactory.createUnaryCallable(getRegionTransportSettings,settings.getRegionSettings(), clientContext); + this.listRegionsCallable = callableFactory.createUnaryCallable(listRegionsTransportSettings,settings.listRegionsSettings(), clientContext); + this.listRegionsPagedCallable = callableFactory.createPagedCallable(listRegionsTransportSettings,settings.listRegionsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getRegionCallable() { + return getRegionCallable; + } + + @BetaApi + public UnaryCallable listRegionsPagedCallable() { + return listRegionsPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionsCallable() { + return listRegionsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java new file mode 100644 index 000000000000..d0af233c5651 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteRouteHttpRequest; +import com.google.cloud.compute.v1.GetRouteHttpRequest; +import com.google.cloud.compute.v1.InsertRouteHttpRequest; +import com.google.cloud.compute.v1.ListRoutesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Route; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import com.google.cloud.compute.v1.RouteList; +import com.google.cloud.compute.v1.RouteName; +import com.google.cloud.compute.v1.RouteSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRouteCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java new file mode 100644 index 000000000000..b700479b3cf5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -0,0 +1,257 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteRouteHttpRequest; +import com.google.cloud.compute.v1.GetRouteHttpRequest; +import com.google.cloud.compute.v1.InsertRouteHttpRequest; +import com.google.cloud.compute.v1.ListRoutesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Route; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import com.google.cloud.compute.v1.RouteList; +import com.google.cloud.compute.v1.RouteName; +import com.google.cloud.compute.v1.RouteSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRouteStub extends RouteStub { + @InternalApi + public static final ApiMethodDescriptor deleteRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouteName.newFactory()) + .setResourceNameField("route") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouteName.newFactory()) + .setResourceNameField("route") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Route.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRoutesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouteList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteRouteCallable; + private final UnaryCallable getRouteCallable; + private final UnaryCallable insertRouteCallable; + private final UnaryCallable listRoutesCallable; + private final UnaryCallable listRoutesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRouteStub create(RouteStubSettings settings) throws IOException { + return new HttpJsonRouteStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRouteStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRouteStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRouteStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRouteCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRouteStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteRouteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRouteMethodDescriptor) + .build(); + HttpJsonCallSettings getRouteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRouteMethodDescriptor) + .build(); + HttpJsonCallSettings insertRouteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRouteMethodDescriptor) + .build(); + HttpJsonCallSettings listRoutesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoutesMethodDescriptor) + .build(); + + this.deleteRouteCallable = callableFactory.createUnaryCallable(deleteRouteTransportSettings,settings.deleteRouteSettings(), clientContext); + this.getRouteCallable = callableFactory.createUnaryCallable(getRouteTransportSettings,settings.getRouteSettings(), clientContext); + this.insertRouteCallable = callableFactory.createUnaryCallable(insertRouteTransportSettings,settings.insertRouteSettings(), clientContext); + this.listRoutesCallable = callableFactory.createUnaryCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); + this.listRoutesPagedCallable = callableFactory.createPagedCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteRouteCallable() { + return deleteRouteCallable; + } + + @BetaApi + public UnaryCallable getRouteCallable() { + return getRouteCallable; + } + + @BetaApi + public UnaryCallable insertRouteCallable() { + return insertRouteCallable; + } + + @BetaApi + public UnaryCallable listRoutesPagedCallable() { + return listRoutesPagedCallable; + } + + @BetaApi + public UnaryCallable listRoutesCallable() { + return listRoutesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java new file mode 100644 index 000000000000..e1c1a0f1e5db --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java @@ -0,0 +1,107 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; +import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; +import com.google.cloud.compute.v1.InsertRouterHttpRequest; +import com.google.cloud.compute.v1.ListRoutersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRouterHttpRequest; +import com.google.cloud.compute.v1.PreviewRouterHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.Router; +import com.google.cloud.compute.v1.RouterAggregatedList; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; +import com.google.cloud.compute.v1.RouterList; +import com.google.cloud.compute.v1.RouterName; +import com.google.cloud.compute.v1.RouterSettings; +import com.google.cloud.compute.v1.RouterStatusResponse; +import com.google.cloud.compute.v1.RoutersPreviewResponse; +import com.google.cloud.compute.v1.RoutersScopedList; +import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRouterCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java new file mode 100644 index 000000000000..bebdcdb85a25 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -0,0 +1,426 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; +import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; +import com.google.cloud.compute.v1.InsertRouterHttpRequest; +import com.google.cloud.compute.v1.ListRoutersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRouterHttpRequest; +import com.google.cloud.compute.v1.PreviewRouterHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.Router; +import com.google.cloud.compute.v1.RouterAggregatedList; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; +import com.google.cloud.compute.v1.RouterList; +import com.google.cloud.compute.v1.RouterName; +import com.google.cloud.compute.v1.RouterSettings; +import com.google.cloud.compute.v1.RouterStatusResponse; +import com.google.cloud.compute.v1.RoutersPreviewResponse; +import com.google.cloud.compute.v1.RoutersScopedList; +import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRouterStub extends RouterStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListRoutersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListRoutersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/routers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouterAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Router.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRouterStatusRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.getRouterStatus") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouterStatusRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}/getRouterStatus")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouterStatusResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRoutersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouterList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor previewRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.preview") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PreviewRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}/preview")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RoutersPreviewResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListRoutersCallable; + private final UnaryCallable aggregatedListRoutersPagedCallable; + private final UnaryCallable deleteRouterCallable; + private final UnaryCallable getRouterCallable; + private final UnaryCallable getRouterStatusRouterCallable; + private final UnaryCallable insertRouterCallable; + private final UnaryCallable listRoutersCallable; + private final UnaryCallable listRoutersPagedCallable; + private final UnaryCallable patchRouterCallable; + private final UnaryCallable previewRouterCallable; + private final UnaryCallable updateRouterCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRouterStub create(RouterStubSettings settings) throws IOException { + return new HttpJsonRouterStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRouterStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRouterStub(RouterStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRouterStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouterStub(RouterStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRouterStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRouterCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRouterStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListRoutersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListRoutersMethodDescriptor) + .build(); + HttpJsonCallSettings deleteRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRouterMethodDescriptor) + .build(); + HttpJsonCallSettings getRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRouterMethodDescriptor) + .build(); + HttpJsonCallSettings getRouterStatusRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRouterStatusRouterMethodDescriptor) + .build(); + HttpJsonCallSettings insertRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRouterMethodDescriptor) + .build(); + HttpJsonCallSettings listRoutersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoutersMethodDescriptor) + .build(); + HttpJsonCallSettings patchRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchRouterMethodDescriptor) + .build(); + HttpJsonCallSettings previewRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(previewRouterMethodDescriptor) + .build(); + HttpJsonCallSettings updateRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRouterMethodDescriptor) + .build(); + + this.aggregatedListRoutersCallable = callableFactory.createUnaryCallable(aggregatedListRoutersTransportSettings,settings.aggregatedListRoutersSettings(), clientContext); + this.aggregatedListRoutersPagedCallable = callableFactory.createPagedCallable(aggregatedListRoutersTransportSettings,settings.aggregatedListRoutersSettings(), clientContext); + this.deleteRouterCallable = callableFactory.createUnaryCallable(deleteRouterTransportSettings,settings.deleteRouterSettings(), clientContext); + this.getRouterCallable = callableFactory.createUnaryCallable(getRouterTransportSettings,settings.getRouterSettings(), clientContext); + this.getRouterStatusRouterCallable = callableFactory.createUnaryCallable(getRouterStatusRouterTransportSettings,settings.getRouterStatusRouterSettings(), clientContext); + this.insertRouterCallable = callableFactory.createUnaryCallable(insertRouterTransportSettings,settings.insertRouterSettings(), clientContext); + this.listRoutersCallable = callableFactory.createUnaryCallable(listRoutersTransportSettings,settings.listRoutersSettings(), clientContext); + this.listRoutersPagedCallable = callableFactory.createPagedCallable(listRoutersTransportSettings,settings.listRoutersSettings(), clientContext); + this.patchRouterCallable = callableFactory.createUnaryCallable(patchRouterTransportSettings,settings.patchRouterSettings(), clientContext); + this.previewRouterCallable = callableFactory.createUnaryCallable(previewRouterTransportSettings,settings.previewRouterSettings(), clientContext); + this.updateRouterCallable = callableFactory.createUnaryCallable(updateRouterTransportSettings,settings.updateRouterSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListRoutersPagedCallable() { + return aggregatedListRoutersPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListRoutersCallable() { + return aggregatedListRoutersCallable; + } + + @BetaApi + public UnaryCallable deleteRouterCallable() { + return deleteRouterCallable; + } + + @BetaApi + public UnaryCallable getRouterCallable() { + return getRouterCallable; + } + + @BetaApi + public UnaryCallable getRouterStatusRouterCallable() { + return getRouterStatusRouterCallable; + } + + @BetaApi + public UnaryCallable insertRouterCallable() { + return insertRouterCallable; + } + + @BetaApi + public UnaryCallable listRoutersPagedCallable() { + return listRoutersPagedCallable; + } + + @BetaApi + public UnaryCallable listRoutersCallable() { + return listRoutersCallable; + } + + @BetaApi + public UnaryCallable patchRouterCallable() { + return patchRouterCallable; + } + + @BetaApi + public UnaryCallable previewRouterCallable() { + return previewRouterCallable; + } + + @BetaApi + public UnaryCallable updateRouterCallable() { + return updateRouterCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java new file mode 100644 index 000000000000..de8fcd2e5bf2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java @@ -0,0 +1,95 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Snapshot; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.SnapshotName; +import com.google.cloud.compute.v1.SnapshotSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonSnapshotCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java new file mode 100644 index 000000000000..32fc3592b974 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -0,0 +1,226 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Snapshot; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.SnapshotName; +import com.google.cloud.compute.v1.SnapshotSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonSnapshotStub extends SnapshotStub { + @InternalApi + public static final ApiMethodDescriptor deleteSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SnapshotName.newFactory()) + .setResourceNameField("snapshot") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSnapshotHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SnapshotName.newFactory()) + .setResourceNameField("snapshot") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Snapshot.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listSnapshotsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSnapshotsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SnapshotList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteSnapshotCallable; + private final UnaryCallable getSnapshotCallable; + private final UnaryCallable listSnapshotsCallable; + private final UnaryCallable listSnapshotsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonSnapshotStub create(SnapshotStubSettings settings) throws IOException { + return new HttpJsonSnapshotStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSnapshotStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSnapshotStub(SnapshotStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonSnapshotStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSnapshotStub(SnapshotStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSnapshotStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSnapshotCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSnapshotStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSnapshotMethodDescriptor) + .build(); + HttpJsonCallSettings getSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSnapshotMethodDescriptor) + .build(); + HttpJsonCallSettings listSnapshotsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSnapshotsMethodDescriptor) + .build(); + + this.deleteSnapshotCallable = callableFactory.createUnaryCallable(deleteSnapshotTransportSettings,settings.deleteSnapshotSettings(), clientContext); + this.getSnapshotCallable = callableFactory.createUnaryCallable(getSnapshotTransportSettings,settings.getSnapshotSettings(), clientContext); + this.listSnapshotsCallable = callableFactory.createUnaryCallable(listSnapshotsTransportSettings,settings.listSnapshotsSettings(), clientContext); + this.listSnapshotsPagedCallable = callableFactory.createPagedCallable(listSnapshotsTransportSettings,settings.listSnapshotsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteSnapshotCallable() { + return deleteSnapshotCallable; + } + + @BetaApi + public UnaryCallable getSnapshotCallable() { + return getSnapshotCallable; + } + + @BetaApi + public UnaryCallable listSnapshotsPagedCallable() { + return listSnapshotsPagedCallable; + } + + @BetaApi + public UnaryCallable listSnapshotsCallable() { + return listSnapshotsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java new file mode 100644 index 000000000000..7f472fa98e0e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; +import com.google.cloud.compute.v1.GetSslCertificateHttpRequest; +import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; +import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SslCertificate; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import com.google.cloud.compute.v1.SslCertificateList; +import com.google.cloud.compute.v1.SslCertificateName; +import com.google.cloud.compute.v1.SslCertificateSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonSslCertificateCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java new file mode 100644 index 000000000000..c53686e259dc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -0,0 +1,257 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; +import com.google.cloud.compute.v1.GetSslCertificateHttpRequest; +import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; +import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SslCertificate; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import com.google.cloud.compute.v1.SslCertificateList; +import com.google.cloud.compute.v1.SslCertificateName; +import com.google.cloud.compute.v1.SslCertificateSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonSslCertificateStub extends SslCertificateStub { + @InternalApi + public static final ApiMethodDescriptor deleteSslCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SslCertificateName.newFactory()) + .setResourceNameField("sslCertificate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getSslCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSslCertificateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SslCertificateName.newFactory()) + .setResourceNameField("sslCertificate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SslCertificate.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertSslCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listSslCertificatesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSslCertificatesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SslCertificateList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteSslCertificateCallable; + private final UnaryCallable getSslCertificateCallable; + private final UnaryCallable insertSslCertificateCallable; + private final UnaryCallable listSslCertificatesCallable; + private final UnaryCallable listSslCertificatesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonSslCertificateStub create(SslCertificateStubSettings settings) throws IOException { + return new HttpJsonSslCertificateStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSslCertificateStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSslCertificateStub(SslCertificateStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonSslCertificateStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSslCertificateStub(SslCertificateStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSslCertificateStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonSslCertificateStub(SslCertificateStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSslCertificateCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSslCertificateStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonSslCertificateStub(SslCertificateStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteSslCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSslCertificateMethodDescriptor) + .build(); + HttpJsonCallSettings getSslCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSslCertificateMethodDescriptor) + .build(); + HttpJsonCallSettings insertSslCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertSslCertificateMethodDescriptor) + .build(); + HttpJsonCallSettings listSslCertificatesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSslCertificatesMethodDescriptor) + .build(); + + this.deleteSslCertificateCallable = callableFactory.createUnaryCallable(deleteSslCertificateTransportSettings,settings.deleteSslCertificateSettings(), clientContext); + this.getSslCertificateCallable = callableFactory.createUnaryCallable(getSslCertificateTransportSettings,settings.getSslCertificateSettings(), clientContext); + this.insertSslCertificateCallable = callableFactory.createUnaryCallable(insertSslCertificateTransportSettings,settings.insertSslCertificateSettings(), clientContext); + this.listSslCertificatesCallable = callableFactory.createUnaryCallable(listSslCertificatesTransportSettings,settings.listSslCertificatesSettings(), clientContext); + this.listSslCertificatesPagedCallable = callableFactory.createPagedCallable(listSslCertificatesTransportSettings,settings.listSslCertificatesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteSslCertificateCallable() { + return deleteSslCertificateCallable; + } + + @BetaApi + public UnaryCallable getSslCertificateCallable() { + return getSslCertificateCallable; + } + + @BetaApi + public UnaryCallable insertSslCertificateCallable() { + return insertSslCertificateCallable; + } + + @BetaApi + public UnaryCallable listSslCertificatesPagedCallable() { + return listSslCertificatesPagedCallable; + } + + @BetaApi + public UnaryCallable listSslCertificatesCallable() { + return listSslCertificatesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java new file mode 100644 index 000000000000..efa57a8f71f3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; +import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.Subnetwork; +import com.google.cloud.compute.v1.SubnetworkAggregatedList; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import com.google.cloud.compute.v1.SubnetworkList; +import com.google.cloud.compute.v1.SubnetworkName; +import com.google.cloud.compute.v1.SubnetworkSettings; +import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; +import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonSubnetworkCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java new file mode 100644 index 000000000000..f8c83c67ac1f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -0,0 +1,332 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; +import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.Subnetwork; +import com.google.cloud.compute.v1.SubnetworkAggregatedList; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import com.google.cloud.compute.v1.SubnetworkList; +import com.google.cloud.compute.v1.SubnetworkName; +import com.google.cloud.compute.v1.SubnetworkSettings; +import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; +import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonSubnetworkStub extends SubnetworkStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListSubnetworksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListSubnetworksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/subnetworks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SubnetworkAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor expandIpCidrRangeSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.expandIpCidrRange") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(SubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Subnetwork.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listSubnetworksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSubnetworksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SubnetworkList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListSubnetworksCallable; + private final UnaryCallable aggregatedListSubnetworksPagedCallable; + private final UnaryCallable deleteSubnetworkCallable; + private final UnaryCallable expandIpCidrRangeSubnetworkCallable; + private final UnaryCallable getSubnetworkCallable; + private final UnaryCallable insertSubnetworkCallable; + private final UnaryCallable listSubnetworksCallable; + private final UnaryCallable listSubnetworksPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonSubnetworkStub create(SubnetworkStubSettings settings) throws IOException { + return new HttpJsonSubnetworkStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSubnetworkStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSubnetworkStub(SubnetworkStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonSubnetworkStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSubnetworkStub(SubnetworkStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSubnetworkStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSubnetworkCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSubnetworkStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListSubnetworksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListSubnetworksMethodDescriptor) + .build(); + HttpJsonCallSettings deleteSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSubnetworkMethodDescriptor) + .build(); + HttpJsonCallSettings expandIpCidrRangeSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandIpCidrRangeSubnetworkMethodDescriptor) + .build(); + HttpJsonCallSettings getSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSubnetworkMethodDescriptor) + .build(); + HttpJsonCallSettings insertSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertSubnetworkMethodDescriptor) + .build(); + HttpJsonCallSettings listSubnetworksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSubnetworksMethodDescriptor) + .build(); + + this.aggregatedListSubnetworksCallable = callableFactory.createUnaryCallable(aggregatedListSubnetworksTransportSettings,settings.aggregatedListSubnetworksSettings(), clientContext); + this.aggregatedListSubnetworksPagedCallable = callableFactory.createPagedCallable(aggregatedListSubnetworksTransportSettings,settings.aggregatedListSubnetworksSettings(), clientContext); + this.deleteSubnetworkCallable = callableFactory.createUnaryCallable(deleteSubnetworkTransportSettings,settings.deleteSubnetworkSettings(), clientContext); + this.expandIpCidrRangeSubnetworkCallable = callableFactory.createUnaryCallable(expandIpCidrRangeSubnetworkTransportSettings,settings.expandIpCidrRangeSubnetworkSettings(), clientContext); + this.getSubnetworkCallable = callableFactory.createUnaryCallable(getSubnetworkTransportSettings,settings.getSubnetworkSettings(), clientContext); + this.insertSubnetworkCallable = callableFactory.createUnaryCallable(insertSubnetworkTransportSettings,settings.insertSubnetworkSettings(), clientContext); + this.listSubnetworksCallable = callableFactory.createUnaryCallable(listSubnetworksTransportSettings,settings.listSubnetworksSettings(), clientContext); + this.listSubnetworksPagedCallable = callableFactory.createPagedCallable(listSubnetworksTransportSettings,settings.listSubnetworksSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListSubnetworksPagedCallable() { + return aggregatedListSubnetworksPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListSubnetworksCallable() { + return aggregatedListSubnetworksCallable; + } + + @BetaApi + public UnaryCallable deleteSubnetworkCallable() { + return deleteSubnetworkCallable; + } + + @BetaApi + public UnaryCallable expandIpCidrRangeSubnetworkCallable() { + return expandIpCidrRangeSubnetworkCallable; + } + + @BetaApi + public UnaryCallable getSubnetworkCallable() { + return getSubnetworkCallable; + } + + @BetaApi + public UnaryCallable insertSubnetworkCallable() { + return insertSubnetworkCallable; + } + + @BetaApi + public UnaryCallable listSubnetworksPagedCallable() { + return listSubnetworksPagedCallable; + } + + @BetaApi + public UnaryCallable listSubnetworksCallable() { + return listSubnetworksCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java new file mode 100644 index 000000000000..2acdd04ec37b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpProxy; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpProxyList; +import com.google.cloud.compute.v1.TargetHttpProxyName; +import com.google.cloud.compute.v1.TargetHttpProxySettings; +import com.google.cloud.compute.v1.UrlMapReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetHttpProxyCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java new file mode 100644 index 000000000000..1ff6fa3de2be --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -0,0 +1,289 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpProxy; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpProxyList; +import com.google.cloud.compute.v1.TargetHttpProxyName; +import com.google.cloud.compute.v1.TargetHttpProxySettings; +import com.google.cloud.compute.v1.UrlMapReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { + @InternalApi + public static final ApiMethodDescriptor deleteTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies/{targetHttpProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpProxyName.newFactory()) + .setResourceNameField("targetHttpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies/{targetHttpProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpProxyName.newFactory()) + .setResourceNameField("targetHttpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetHttpProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetHttpProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setUrlMapTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.setUrlMap") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpProxyName.newFactory()) + .setResourceNameField("targetHttpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteTargetHttpProxyCallable; + private final UnaryCallable getTargetHttpProxyCallable; + private final UnaryCallable insertTargetHttpProxyCallable; + private final UnaryCallable listTargetHttpProxiesCallable; + private final UnaryCallable listTargetHttpProxiesPagedCallable; + private final UnaryCallable setUrlMapTargetHttpProxyCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetHttpProxyStub create(TargetHttpProxyStubSettings settings) throws IOException { + return new HttpJsonTargetHttpProxyStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetHttpProxyStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetHttpProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetHttpProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetHttpProxyCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetHttpProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetHttpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetHttpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetHttpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetHttpProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetHttpProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings setUrlMapTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUrlMapTargetHttpProxyMethodDescriptor) + .build(); + + this.deleteTargetHttpProxyCallable = callableFactory.createUnaryCallable(deleteTargetHttpProxyTransportSettings,settings.deleteTargetHttpProxySettings(), clientContext); + this.getTargetHttpProxyCallable = callableFactory.createUnaryCallable(getTargetHttpProxyTransportSettings,settings.getTargetHttpProxySettings(), clientContext); + this.insertTargetHttpProxyCallable = callableFactory.createUnaryCallable(insertTargetHttpProxyTransportSettings,settings.insertTargetHttpProxySettings(), clientContext); + this.listTargetHttpProxiesCallable = callableFactory.createUnaryCallable(listTargetHttpProxiesTransportSettings,settings.listTargetHttpProxiesSettings(), clientContext); + this.listTargetHttpProxiesPagedCallable = callableFactory.createPagedCallable(listTargetHttpProxiesTransportSettings,settings.listTargetHttpProxiesSettings(), clientContext); + this.setUrlMapTargetHttpProxyCallable = callableFactory.createUnaryCallable(setUrlMapTargetHttpProxyTransportSettings,settings.setUrlMapTargetHttpProxySettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteTargetHttpProxyCallable() { + return deleteTargetHttpProxyCallable; + } + + @BetaApi + public UnaryCallable getTargetHttpProxyCallable() { + return getTargetHttpProxyCallable; + } + + @BetaApi + public UnaryCallable insertTargetHttpProxyCallable() { + return insertTargetHttpProxyCallable; + } + + @BetaApi + public UnaryCallable listTargetHttpProxiesPagedCallable() { + return listTargetHttpProxiesPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetHttpProxiesCallable() { + return listTargetHttpProxiesCallable; + } + + @BetaApi + public UnaryCallable setUrlMapTargetHttpProxyCallable() { + return setUrlMapTargetHttpProxyCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java new file mode 100644 index 000000000000..5d01e27d6c23 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java @@ -0,0 +1,100 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.TargetHttpsProxy; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpsProxyList; +import com.google.cloud.compute.v1.TargetHttpsProxyName; +import com.google.cloud.compute.v1.TargetHttpsProxySettings; +import com.google.cloud.compute.v1.UrlMapReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetHttpsProxyCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java new file mode 100644 index 000000000000..a0051ca3599b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -0,0 +1,321 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.TargetHttpsProxy; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpsProxyList; +import com.google.cloud.compute.v1.TargetHttpsProxyName; +import com.google.cloud.compute.v1.TargetHttpsProxySettings; +import com.google.cloud.compute.v1.UrlMapReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { + @InternalApi + public static final ApiMethodDescriptor deleteTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies/{targetHttpsProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies/{targetHttpsProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpsProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetHttpsProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpsProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setSslCertificatesTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.setSslCertificates") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setUrlMapTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.setUrlMap") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteTargetHttpsProxyCallable; + private final UnaryCallable getTargetHttpsProxyCallable; + private final UnaryCallable insertTargetHttpsProxyCallable; + private final UnaryCallable listTargetHttpsProxiesCallable; + private final UnaryCallable listTargetHttpsProxiesPagedCallable; + private final UnaryCallable setSslCertificatesTargetHttpsProxyCallable; + private final UnaryCallable setUrlMapTargetHttpsProxyCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetHttpsProxyStub create(TargetHttpsProxyStubSettings settings) throws IOException { + return new HttpJsonTargetHttpsProxyStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetHttpsProxyStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetHttpsProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetHttpsProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetHttpsProxyCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetHttpsProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetHttpsProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetHttpsProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings setSslCertificatesTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSslCertificatesTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings setUrlMapTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUrlMapTargetHttpsProxyMethodDescriptor) + .build(); + + this.deleteTargetHttpsProxyCallable = callableFactory.createUnaryCallable(deleteTargetHttpsProxyTransportSettings,settings.deleteTargetHttpsProxySettings(), clientContext); + this.getTargetHttpsProxyCallable = callableFactory.createUnaryCallable(getTargetHttpsProxyTransportSettings,settings.getTargetHttpsProxySettings(), clientContext); + this.insertTargetHttpsProxyCallable = callableFactory.createUnaryCallable(insertTargetHttpsProxyTransportSettings,settings.insertTargetHttpsProxySettings(), clientContext); + this.listTargetHttpsProxiesCallable = callableFactory.createUnaryCallable(listTargetHttpsProxiesTransportSettings,settings.listTargetHttpsProxiesSettings(), clientContext); + this.listTargetHttpsProxiesPagedCallable = callableFactory.createPagedCallable(listTargetHttpsProxiesTransportSettings,settings.listTargetHttpsProxiesSettings(), clientContext); + this.setSslCertificatesTargetHttpsProxyCallable = callableFactory.createUnaryCallable(setSslCertificatesTargetHttpsProxyTransportSettings,settings.setSslCertificatesTargetHttpsProxySettings(), clientContext); + this.setUrlMapTargetHttpsProxyCallable = callableFactory.createUnaryCallable(setUrlMapTargetHttpsProxyTransportSettings,settings.setUrlMapTargetHttpsProxySettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteTargetHttpsProxyCallable() { + return deleteTargetHttpsProxyCallable; + } + + @BetaApi + public UnaryCallable getTargetHttpsProxyCallable() { + return getTargetHttpsProxyCallable; + } + + @BetaApi + public UnaryCallable insertTargetHttpsProxyCallable() { + return insertTargetHttpsProxyCallable; + } + + @BetaApi + public UnaryCallable listTargetHttpsProxiesPagedCallable() { + return listTargetHttpsProxiesPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetHttpsProxiesCallable() { + return listTargetHttpsProxiesCallable; + } + + @BetaApi + public UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { + return setSslCertificatesTargetHttpsProxyCallable; + } + + @BetaApi + public UnaryCallable setUrlMapTargetHttpsProxyCallable() { + return setUrlMapTargetHttpsProxyCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java new file mode 100644 index 000000000000..1d0ca0cd7341 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.TargetInstance; +import com.google.cloud.compute.v1.TargetInstanceAggregatedList; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import com.google.cloud.compute.v1.TargetInstanceList; +import com.google.cloud.compute.v1.TargetInstanceName; +import com.google.cloud.compute.v1.TargetInstanceSettings; +import com.google.cloud.compute.v1.TargetInstancesScopedList; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetInstanceCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java new file mode 100644 index 000000000000..6b35676e76ed --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -0,0 +1,300 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.TargetInstance; +import com.google.cloud.compute.v1.TargetInstanceAggregatedList; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import com.google.cloud.compute.v1.TargetInstanceList; +import com.google.cloud.compute.v1.TargetInstanceName; +import com.google.cloud.compute.v1.TargetInstanceSettings; +import com.google.cloud.compute.v1.TargetInstancesScopedList; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetInstanceStub extends TargetInstanceStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListTargetInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/targetInstances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetInstanceAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteTargetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances/{targetInstance}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetInstanceName.newFactory()) + .setResourceNameField("targetInstance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances/{targetInstance}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetInstanceName.newFactory()) + .setResourceNameField("targetInstance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetInstance.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetInstanceList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListTargetInstancesCallable; + private final UnaryCallable aggregatedListTargetInstancesPagedCallable; + private final UnaryCallable deleteTargetInstanceCallable; + private final UnaryCallable getTargetInstanceCallable; + private final UnaryCallable insertTargetInstanceCallable; + private final UnaryCallable listTargetInstancesCallable; + private final UnaryCallable listTargetInstancesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetInstanceStub create(TargetInstanceStubSettings settings) throws IOException { + return new HttpJsonTargetInstanceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetInstanceStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetInstanceStub(TargetInstanceStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetInstanceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetInstanceStub(TargetInstanceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetInstanceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetInstanceStub(TargetInstanceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetInstanceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetInstanceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetInstanceStub(TargetInstanceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListTargetInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListTargetInstancesMethodDescriptor) + .build(); + HttpJsonCallSettings deleteTargetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetInstancesMethodDescriptor) + .build(); + + this.aggregatedListTargetInstancesCallable = callableFactory.createUnaryCallable(aggregatedListTargetInstancesTransportSettings,settings.aggregatedListTargetInstancesSettings(), clientContext); + this.aggregatedListTargetInstancesPagedCallable = callableFactory.createPagedCallable(aggregatedListTargetInstancesTransportSettings,settings.aggregatedListTargetInstancesSettings(), clientContext); + this.deleteTargetInstanceCallable = callableFactory.createUnaryCallable(deleteTargetInstanceTransportSettings,settings.deleteTargetInstanceSettings(), clientContext); + this.getTargetInstanceCallable = callableFactory.createUnaryCallable(getTargetInstanceTransportSettings,settings.getTargetInstanceSettings(), clientContext); + this.insertTargetInstanceCallable = callableFactory.createUnaryCallable(insertTargetInstanceTransportSettings,settings.insertTargetInstanceSettings(), clientContext); + this.listTargetInstancesCallable = callableFactory.createUnaryCallable(listTargetInstancesTransportSettings,settings.listTargetInstancesSettings(), clientContext); + this.listTargetInstancesPagedCallable = callableFactory.createPagedCallable(listTargetInstancesTransportSettings,settings.listTargetInstancesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListTargetInstancesPagedCallable() { + return aggregatedListTargetInstancesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListTargetInstancesCallable() { + return aggregatedListTargetInstancesCallable; + } + + @BetaApi + public UnaryCallable deleteTargetInstanceCallable() { + return deleteTargetInstanceCallable; + } + + @BetaApi + public UnaryCallable getTargetInstanceCallable() { + return getTargetInstanceCallable; + } + + @BetaApi + public UnaryCallable insertTargetInstanceCallable() { + return insertTargetInstanceCallable; + } + + @BetaApi + public UnaryCallable listTargetInstancesPagedCallable() { + return listTargetInstancesPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetInstancesCallable() { + return listTargetInstancesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java new file mode 100644 index 000000000000..186870c31e0f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java @@ -0,0 +1,114 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AddInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AggregatedListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InstanceReference; +import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; +import com.google.cloud.compute.v1.TargetPool; +import com.google.cloud.compute.v1.TargetPoolAggregatedList; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; +import com.google.cloud.compute.v1.TargetPoolInstanceHealth; +import com.google.cloud.compute.v1.TargetPoolList; +import com.google.cloud.compute.v1.TargetPoolName; +import com.google.cloud.compute.v1.TargetPoolSettings; +import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; +import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest; +import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; +import com.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; +import com.google.cloud.compute.v1.TargetPoolsScopedList; +import com.google.cloud.compute.v1.TargetReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetPoolCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java new file mode 100644 index 000000000000..2c9b4229d931 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -0,0 +1,494 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AddInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AggregatedListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InstanceReference; +import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; +import com.google.cloud.compute.v1.TargetPool; +import com.google.cloud.compute.v1.TargetPoolAggregatedList; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; +import com.google.cloud.compute.v1.TargetPoolInstanceHealth; +import com.google.cloud.compute.v1.TargetPoolList; +import com.google.cloud.compute.v1.TargetPoolName; +import com.google.cloud.compute.v1.TargetPoolSettings; +import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; +import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest; +import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; +import com.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; +import com.google.cloud.compute.v1.TargetPoolsScopedList; +import com.google.cloud.compute.v1.TargetReference; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetPoolStub extends TargetPoolStub { + @InternalApi + public static final ApiMethodDescriptor addHealthCheckTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.addHealthCheck") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor addInstanceTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.addInstance") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/addInstance")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor aggregatedListTargetPoolsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/targetPools")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPoolAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPool.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getHealthTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.getHealth") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/getHealth")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPoolInstanceHealth.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetPoolsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetPoolsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPoolList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor removeHealthCheckTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.removeHealthCheck") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor removeInstanceTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.removeInstance") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setBackupTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.setBackup") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/setBackup")) + .setQueryParams(Sets.newHashSet( + "failoverRatio" + )) + .setResourceNameFactory(TargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable addHealthCheckTargetPoolCallable; + private final UnaryCallable addInstanceTargetPoolCallable; + private final UnaryCallable aggregatedListTargetPoolsCallable; + private final UnaryCallable aggregatedListTargetPoolsPagedCallable; + private final UnaryCallable deleteTargetPoolCallable; + private final UnaryCallable getTargetPoolCallable; + private final UnaryCallable getHealthTargetPoolCallable; + private final UnaryCallable insertTargetPoolCallable; + private final UnaryCallable listTargetPoolsCallable; + private final UnaryCallable listTargetPoolsPagedCallable; + private final UnaryCallable removeHealthCheckTargetPoolCallable; + private final UnaryCallable removeInstanceTargetPoolCallable; + private final UnaryCallable setBackupTargetPoolCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetPoolStub create(TargetPoolStubSettings settings) throws IOException { + return new HttpJsonTargetPoolStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetPoolStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetPoolStub(TargetPoolStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetPoolStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetPoolStub(TargetPoolStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetPoolStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetPoolStub(TargetPoolStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetPoolCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetPoolStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetPoolStub(TargetPoolStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings addHealthCheckTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addHealthCheckTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings addInstanceTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addInstanceTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings aggregatedListTargetPoolsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListTargetPoolsMethodDescriptor) + .build(); + HttpJsonCallSettings deleteTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings getHealthTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHealthTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetPoolsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetPoolsMethodDescriptor) + .build(); + HttpJsonCallSettings removeHealthCheckTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removeHealthCheckTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings removeInstanceTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removeInstanceTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings setBackupTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackupTargetPoolMethodDescriptor) + .build(); + + this.addHealthCheckTargetPoolCallable = callableFactory.createUnaryCallable(addHealthCheckTargetPoolTransportSettings,settings.addHealthCheckTargetPoolSettings(), clientContext); + this.addInstanceTargetPoolCallable = callableFactory.createUnaryCallable(addInstanceTargetPoolTransportSettings,settings.addInstanceTargetPoolSettings(), clientContext); + this.aggregatedListTargetPoolsCallable = callableFactory.createUnaryCallable(aggregatedListTargetPoolsTransportSettings,settings.aggregatedListTargetPoolsSettings(), clientContext); + this.aggregatedListTargetPoolsPagedCallable = callableFactory.createPagedCallable(aggregatedListTargetPoolsTransportSettings,settings.aggregatedListTargetPoolsSettings(), clientContext); + this.deleteTargetPoolCallable = callableFactory.createUnaryCallable(deleteTargetPoolTransportSettings,settings.deleteTargetPoolSettings(), clientContext); + this.getTargetPoolCallable = callableFactory.createUnaryCallable(getTargetPoolTransportSettings,settings.getTargetPoolSettings(), clientContext); + this.getHealthTargetPoolCallable = callableFactory.createUnaryCallable(getHealthTargetPoolTransportSettings,settings.getHealthTargetPoolSettings(), clientContext); + this.insertTargetPoolCallable = callableFactory.createUnaryCallable(insertTargetPoolTransportSettings,settings.insertTargetPoolSettings(), clientContext); + this.listTargetPoolsCallable = callableFactory.createUnaryCallable(listTargetPoolsTransportSettings,settings.listTargetPoolsSettings(), clientContext); + this.listTargetPoolsPagedCallable = callableFactory.createPagedCallable(listTargetPoolsTransportSettings,settings.listTargetPoolsSettings(), clientContext); + this.removeHealthCheckTargetPoolCallable = callableFactory.createUnaryCallable(removeHealthCheckTargetPoolTransportSettings,settings.removeHealthCheckTargetPoolSettings(), clientContext); + this.removeInstanceTargetPoolCallable = callableFactory.createUnaryCallable(removeInstanceTargetPoolTransportSettings,settings.removeInstanceTargetPoolSettings(), clientContext); + this.setBackupTargetPoolCallable = callableFactory.createUnaryCallable(setBackupTargetPoolTransportSettings,settings.setBackupTargetPoolSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable addHealthCheckTargetPoolCallable() { + return addHealthCheckTargetPoolCallable; + } + + @BetaApi + public UnaryCallable addInstanceTargetPoolCallable() { + return addInstanceTargetPoolCallable; + } + + @BetaApi + public UnaryCallable aggregatedListTargetPoolsPagedCallable() { + return aggregatedListTargetPoolsPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListTargetPoolsCallable() { + return aggregatedListTargetPoolsCallable; + } + + @BetaApi + public UnaryCallable deleteTargetPoolCallable() { + return deleteTargetPoolCallable; + } + + @BetaApi + public UnaryCallable getTargetPoolCallable() { + return getTargetPoolCallable; + } + + @BetaApi + public UnaryCallable getHealthTargetPoolCallable() { + return getHealthTargetPoolCallable; + } + + @BetaApi + public UnaryCallable insertTargetPoolCallable() { + return insertTargetPoolCallable; + } + + @BetaApi + public UnaryCallable listTargetPoolsPagedCallable() { + return listTargetPoolsPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetPoolsCallable() { + return listTargetPoolsCallable; + } + + @BetaApi + public UnaryCallable removeHealthCheckTargetPoolCallable() { + return removeHealthCheckTargetPoolCallable; + } + + @BetaApi + public UnaryCallable removeInstanceTargetPoolCallable() { + return removeInstanceTargetPoolCallable; + } + + @BetaApi + public UnaryCallable setBackupTargetPoolCallable() { + return setBackupTargetPoolCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java new file mode 100644 index 000000000000..1144cb66a456 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java @@ -0,0 +1,102 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.TargetSslProxy; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetSslProxyList; +import com.google.cloud.compute.v1.TargetSslProxyName; +import com.google.cloud.compute.v1.TargetSslProxySettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetSslProxyCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java new file mode 100644 index 000000000000..b5c01ec516ff --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -0,0 +1,353 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.TargetSslProxy; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetSslProxyList; +import com.google.cloud.compute.v1.TargetSslProxyName; +import com.google.cloud.compute.v1.TargetSslProxySettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { + @InternalApi + public static final ApiMethodDescriptor deleteTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetSslProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setBackendServiceTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setBackendService") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setProxyHeaderTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setProxyHeader") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setSslCertificatesTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setSslCertificates") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteTargetSslProxyCallable; + private final UnaryCallable getTargetSslProxyCallable; + private final UnaryCallable insertTargetSslProxyCallable; + private final UnaryCallable listTargetSslProxiesCallable; + private final UnaryCallable listTargetSslProxiesPagedCallable; + private final UnaryCallable setBackendServiceTargetSslProxyCallable; + private final UnaryCallable setProxyHeaderTargetSslProxyCallable; + private final UnaryCallable setSslCertificatesTargetSslProxyCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) throws IOException { + return new HttpJsonTargetSslProxyStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetSslProxyCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetSslProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings setBackendServiceTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings setProxyHeaderTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings setSslCertificatesTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) + .build(); + + this.deleteTargetSslProxyCallable = callableFactory.createUnaryCallable(deleteTargetSslProxyTransportSettings,settings.deleteTargetSslProxySettings(), clientContext); + this.getTargetSslProxyCallable = callableFactory.createUnaryCallable(getTargetSslProxyTransportSettings,settings.getTargetSslProxySettings(), clientContext); + this.insertTargetSslProxyCallable = callableFactory.createUnaryCallable(insertTargetSslProxyTransportSettings,settings.insertTargetSslProxySettings(), clientContext); + this.listTargetSslProxiesCallable = callableFactory.createUnaryCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); + this.listTargetSslProxiesPagedCallable = callableFactory.createPagedCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); + this.setBackendServiceTargetSslProxyCallable = callableFactory.createUnaryCallable(setBackendServiceTargetSslProxyTransportSettings,settings.setBackendServiceTargetSslProxySettings(), clientContext); + this.setProxyHeaderTargetSslProxyCallable = callableFactory.createUnaryCallable(setProxyHeaderTargetSslProxyTransportSettings,settings.setProxyHeaderTargetSslProxySettings(), clientContext); + this.setSslCertificatesTargetSslProxyCallable = callableFactory.createUnaryCallable(setSslCertificatesTargetSslProxyTransportSettings,settings.setSslCertificatesTargetSslProxySettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteTargetSslProxyCallable() { + return deleteTargetSslProxyCallable; + } + + @BetaApi + public UnaryCallable getTargetSslProxyCallable() { + return getTargetSslProxyCallable; + } + + @BetaApi + public UnaryCallable insertTargetSslProxyCallable() { + return insertTargetSslProxyCallable; + } + + @BetaApi + public UnaryCallable listTargetSslProxiesPagedCallable() { + return listTargetSslProxiesPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetSslProxiesCallable() { + return listTargetSslProxiesCallable; + } + + @BetaApi + public UnaryCallable setBackendServiceTargetSslProxyCallable() { + return setBackendServiceTargetSslProxyCallable; + } + + @BetaApi + public UnaryCallable setProxyHeaderTargetSslProxyCallable() { + return setProxyHeaderTargetSslProxyCallable; + } + + @BetaApi + public UnaryCallable setSslCertificatesTargetSslProxyCallable() { + return setSslCertificatesTargetSslProxyCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java new file mode 100644 index 000000000000..129100fa1e58 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.GetTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.InsertTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.TargetVpnGateway; +import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import com.google.cloud.compute.v1.TargetVpnGatewayList; +import com.google.cloud.compute.v1.TargetVpnGatewayName; +import com.google.cloud.compute.v1.TargetVpnGatewaySettings; +import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetVpnGatewayCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java new file mode 100644 index 000000000000..72d70a811a1a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -0,0 +1,300 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.GetTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.InsertTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.TargetVpnGateway; +import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import com.google.cloud.compute.v1.TargetVpnGatewayList; +import com.google.cloud.compute.v1.TargetVpnGatewayName; +import com.google.cloud.compute.v1.TargetVpnGatewaySettings; +import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListTargetVpnGatewaysMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/targetVpnGateways")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetVpnGatewayAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteTargetVpnGatewayMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetVpnGatewayName.newFactory()) + .setResourceNameField("targetVpnGateway") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetVpnGatewayMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetVpnGatewayHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetVpnGatewayName.newFactory()) + .setResourceNameField("targetVpnGateway") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetVpnGateway.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetVpnGatewayMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetVpnGatewaysMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetVpnGatewayList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListTargetVpnGatewaysCallable; + private final UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable; + private final UnaryCallable deleteTargetVpnGatewayCallable; + private final UnaryCallable getTargetVpnGatewayCallable; + private final UnaryCallable insertTargetVpnGatewayCallable; + private final UnaryCallable listTargetVpnGatewaysCallable; + private final UnaryCallable listTargetVpnGatewaysPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetVpnGatewayStub create(TargetVpnGatewayStubSettings settings) throws IOException { + return new HttpJsonTargetVpnGatewayStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetVpnGatewayStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetVpnGatewayStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetVpnGatewayStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetVpnGatewayCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetVpnGatewayStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListTargetVpnGatewaysTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListTargetVpnGatewaysMethodDescriptor) + .build(); + HttpJsonCallSettings deleteTargetVpnGatewayTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetVpnGatewayMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetVpnGatewayTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetVpnGatewayMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetVpnGatewayTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetVpnGatewayMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetVpnGatewaysTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetVpnGatewaysMethodDescriptor) + .build(); + + this.aggregatedListTargetVpnGatewaysCallable = callableFactory.createUnaryCallable(aggregatedListTargetVpnGatewaysTransportSettings,settings.aggregatedListTargetVpnGatewaysSettings(), clientContext); + this.aggregatedListTargetVpnGatewaysPagedCallable = callableFactory.createPagedCallable(aggregatedListTargetVpnGatewaysTransportSettings,settings.aggregatedListTargetVpnGatewaysSettings(), clientContext); + this.deleteTargetVpnGatewayCallable = callableFactory.createUnaryCallable(deleteTargetVpnGatewayTransportSettings,settings.deleteTargetVpnGatewaySettings(), clientContext); + this.getTargetVpnGatewayCallable = callableFactory.createUnaryCallable(getTargetVpnGatewayTransportSettings,settings.getTargetVpnGatewaySettings(), clientContext); + this.insertTargetVpnGatewayCallable = callableFactory.createUnaryCallable(insertTargetVpnGatewayTransportSettings,settings.insertTargetVpnGatewaySettings(), clientContext); + this.listTargetVpnGatewaysCallable = callableFactory.createUnaryCallable(listTargetVpnGatewaysTransportSettings,settings.listTargetVpnGatewaysSettings(), clientContext); + this.listTargetVpnGatewaysPagedCallable = callableFactory.createPagedCallable(listTargetVpnGatewaysTransportSettings,settings.listTargetVpnGatewaysSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { + return aggregatedListTargetVpnGatewaysPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListTargetVpnGatewaysCallable() { + return aggregatedListTargetVpnGatewaysCallable; + } + + @BetaApi + public UnaryCallable deleteTargetVpnGatewayCallable() { + return deleteTargetVpnGatewayCallable; + } + + @BetaApi + public UnaryCallable getTargetVpnGatewayCallable() { + return getTargetVpnGatewayCallable; + } + + @BetaApi + public UnaryCallable insertTargetVpnGatewayCallable() { + return insertTargetVpnGatewayCallable; + } + + @BetaApi + public UnaryCallable listTargetVpnGatewaysPagedCallable() { + return listTargetVpnGatewaysPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetVpnGatewaysCallable() { + return listTargetVpnGatewaysCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java new file mode 100644 index 000000000000..3eb4808078de --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.CacheInvalidationRule; +import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; +import com.google.cloud.compute.v1.GetUrlMapHttpRequest; +import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; +import com.google.cloud.compute.v1.InvalidateCacheUrlMapHttpRequest; +import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; +import com.google.cloud.compute.v1.UrlMap; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import com.google.cloud.compute.v1.UrlMapList; +import com.google.cloud.compute.v1.UrlMapName; +import com.google.cloud.compute.v1.UrlMapSettings; +import com.google.cloud.compute.v1.UrlMapsValidateRequest; +import com.google.cloud.compute.v1.UrlMapsValidateResponse; +import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonUrlMapCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java new file mode 100644 index 000000000000..92021ea219af --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -0,0 +1,384 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.CacheInvalidationRule; +import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; +import com.google.cloud.compute.v1.GetUrlMapHttpRequest; +import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; +import com.google.cloud.compute.v1.InvalidateCacheUrlMapHttpRequest; +import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; +import com.google.cloud.compute.v1.UrlMap; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import com.google.cloud.compute.v1.UrlMapList; +import com.google.cloud.compute.v1.UrlMapName; +import com.google.cloud.compute.v1.UrlMapSettings; +import com.google.cloud.compute.v1.UrlMapsValidateRequest; +import com.google.cloud.compute.v1.UrlMapsValidateResponse; +import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonUrlMapStub extends UrlMapStub { + @InternalApi + public static final ApiMethodDescriptor deleteUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMap.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor invalidateCacheUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.invalidateCache") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listUrlMapsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor validateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.validate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteUrlMapCallable; + private final UnaryCallable getUrlMapCallable; + private final UnaryCallable insertUrlMapCallable; + private final UnaryCallable invalidateCacheUrlMapCallable; + private final UnaryCallable listUrlMapsCallable; + private final UnaryCallable listUrlMapsPagedCallable; + private final UnaryCallable patchUrlMapCallable; + private final UnaryCallable updateUrlMapCallable; + private final UnaryCallable validateUrlMapCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonUrlMapStub create(UrlMapStubSettings settings) throws IOException { + return new HttpJsonUrlMapStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonUrlMapStub create(ClientContext clientContext) throws IOException { + return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonUrlMapStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonUrlMapCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUrlMapMethodDescriptor) + .build(); + HttpJsonCallSettings getUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUrlMapMethodDescriptor) + .build(); + HttpJsonCallSettings insertUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertUrlMapMethodDescriptor) + .build(); + HttpJsonCallSettings invalidateCacheUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) + .build(); + HttpJsonCallSettings listUrlMapsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUrlMapsMethodDescriptor) + .build(); + HttpJsonCallSettings patchUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchUrlMapMethodDescriptor) + .build(); + HttpJsonCallSettings updateUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUrlMapMethodDescriptor) + .build(); + HttpJsonCallSettings validateUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(validateUrlMapMethodDescriptor) + .build(); + + this.deleteUrlMapCallable = callableFactory.createUnaryCallable(deleteUrlMapTransportSettings,settings.deleteUrlMapSettings(), clientContext); + this.getUrlMapCallable = callableFactory.createUnaryCallable(getUrlMapTransportSettings,settings.getUrlMapSettings(), clientContext); + this.insertUrlMapCallable = callableFactory.createUnaryCallable(insertUrlMapTransportSettings,settings.insertUrlMapSettings(), clientContext); + this.invalidateCacheUrlMapCallable = callableFactory.createUnaryCallable(invalidateCacheUrlMapTransportSettings,settings.invalidateCacheUrlMapSettings(), clientContext); + this.listUrlMapsCallable = callableFactory.createUnaryCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); + this.listUrlMapsPagedCallable = callableFactory.createPagedCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); + this.patchUrlMapCallable = callableFactory.createUnaryCallable(patchUrlMapTransportSettings,settings.patchUrlMapSettings(), clientContext); + this.updateUrlMapCallable = callableFactory.createUnaryCallable(updateUrlMapTransportSettings,settings.updateUrlMapSettings(), clientContext); + this.validateUrlMapCallable = callableFactory.createUnaryCallable(validateUrlMapTransportSettings,settings.validateUrlMapSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteUrlMapCallable() { + return deleteUrlMapCallable; + } + + @BetaApi + public UnaryCallable getUrlMapCallable() { + return getUrlMapCallable; + } + + @BetaApi + public UnaryCallable insertUrlMapCallable() { + return insertUrlMapCallable; + } + + @BetaApi + public UnaryCallable invalidateCacheUrlMapCallable() { + return invalidateCacheUrlMapCallable; + } + + @BetaApi + public UnaryCallable listUrlMapsPagedCallable() { + return listUrlMapsPagedCallable; + } + + @BetaApi + public UnaryCallable listUrlMapsCallable() { + return listUrlMapsCallable; + } + + @BetaApi + public UnaryCallable patchUrlMapCallable() { + return patchUrlMapCallable; + } + + @BetaApi + public UnaryCallable updateUrlMapCallable() { + return updateUrlMapCallable; + } + + @BetaApi + public UnaryCallable validateUrlMapCallable() { + return validateUrlMapCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java new file mode 100644 index 000000000000..2a68d72a1729 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.DeleteVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.GetVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.InsertVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.VpnTunnel; +import com.google.cloud.compute.v1.VpnTunnelAggregatedList; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import com.google.cloud.compute.v1.VpnTunnelList; +import com.google.cloud.compute.v1.VpnTunnelName; +import com.google.cloud.compute.v1.VpnTunnelSettings; +import com.google.cloud.compute.v1.VpnTunnelsScopedList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonVpnTunnelCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java new file mode 100644 index 000000000000..303a85fdf7ca --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -0,0 +1,300 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.DeleteVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.GetVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.InsertVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.VpnTunnel; +import com.google.cloud.compute.v1.VpnTunnelAggregatedList; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import com.google.cloud.compute.v1.VpnTunnelList; +import com.google.cloud.compute.v1.VpnTunnelName; +import com.google.cloud.compute.v1.VpnTunnelSettings; +import com.google.cloud.compute.v1.VpnTunnelsScopedList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonVpnTunnelStub extends VpnTunnelStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListVpnTunnelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/vpnTunnels")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VpnTunnelAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteVpnTunnelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(VpnTunnelName.newFactory()) + .setResourceNameField("vpnTunnel") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getVpnTunnelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetVpnTunnelHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(VpnTunnelName.newFactory()) + .setResourceNameField("vpnTunnel") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VpnTunnel.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertVpnTunnelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listVpnTunnelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListVpnTunnelsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VpnTunnelList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListVpnTunnelsCallable; + private final UnaryCallable aggregatedListVpnTunnelsPagedCallable; + private final UnaryCallable deleteVpnTunnelCallable; + private final UnaryCallable getVpnTunnelCallable; + private final UnaryCallable insertVpnTunnelCallable; + private final UnaryCallable listVpnTunnelsCallable; + private final UnaryCallable listVpnTunnelsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonVpnTunnelStub create(VpnTunnelStubSettings settings) throws IOException { + return new HttpJsonVpnTunnelStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonVpnTunnelStub create(ClientContext clientContext) throws IOException { + return new HttpJsonVpnTunnelStub(VpnTunnelStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonVpnTunnelStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonVpnTunnelStub(VpnTunnelStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonVpnTunnelStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonVpnTunnelStub(VpnTunnelStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonVpnTunnelCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonVpnTunnelStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonVpnTunnelStub(VpnTunnelStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListVpnTunnelsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListVpnTunnelsMethodDescriptor) + .build(); + HttpJsonCallSettings deleteVpnTunnelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteVpnTunnelMethodDescriptor) + .build(); + HttpJsonCallSettings getVpnTunnelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getVpnTunnelMethodDescriptor) + .build(); + HttpJsonCallSettings insertVpnTunnelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertVpnTunnelMethodDescriptor) + .build(); + HttpJsonCallSettings listVpnTunnelsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listVpnTunnelsMethodDescriptor) + .build(); + + this.aggregatedListVpnTunnelsCallable = callableFactory.createUnaryCallable(aggregatedListVpnTunnelsTransportSettings,settings.aggregatedListVpnTunnelsSettings(), clientContext); + this.aggregatedListVpnTunnelsPagedCallable = callableFactory.createPagedCallable(aggregatedListVpnTunnelsTransportSettings,settings.aggregatedListVpnTunnelsSettings(), clientContext); + this.deleteVpnTunnelCallable = callableFactory.createUnaryCallable(deleteVpnTunnelTransportSettings,settings.deleteVpnTunnelSettings(), clientContext); + this.getVpnTunnelCallable = callableFactory.createUnaryCallable(getVpnTunnelTransportSettings,settings.getVpnTunnelSettings(), clientContext); + this.insertVpnTunnelCallable = callableFactory.createUnaryCallable(insertVpnTunnelTransportSettings,settings.insertVpnTunnelSettings(), clientContext); + this.listVpnTunnelsCallable = callableFactory.createUnaryCallable(listVpnTunnelsTransportSettings,settings.listVpnTunnelsSettings(), clientContext); + this.listVpnTunnelsPagedCallable = callableFactory.createPagedCallable(listVpnTunnelsTransportSettings,settings.listVpnTunnelsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListVpnTunnelsPagedCallable() { + return aggregatedListVpnTunnelsPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListVpnTunnelsCallable() { + return aggregatedListVpnTunnelsCallable; + } + + @BetaApi + public UnaryCallable deleteVpnTunnelCallable() { + return deleteVpnTunnelCallable; + } + + @BetaApi + public UnaryCallable getVpnTunnelCallable() { + return getVpnTunnelCallable; + } + + @BetaApi + public UnaryCallable insertVpnTunnelCallable() { + return insertVpnTunnelCallable; + } + + @BetaApi + public UnaryCallable listVpnTunnelsPagedCallable() { + return listVpnTunnelsPagedCallable; + } + + @BetaApi + public UnaryCallable listVpnTunnelsCallable() { + return listVpnTunnelsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java new file mode 100644 index 000000000000..e4d5d1ccc44c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetZoneHttpRequest; +import com.google.cloud.compute.v1.ListZonesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Zone; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import com.google.cloud.compute.v1.ZoneList; +import com.google.cloud.compute.v1.ZoneName; +import com.google.cloud.compute.v1.ZoneSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonZoneCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java new file mode 100644 index 000000000000..d9a0764865e6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; +import com.google.cloud.compute.v1.GetZoneOperationHttpRequest; +import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.ProjectZoneOperationName; +import com.google.cloud.compute.v1.ZoneName; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import com.google.cloud.compute.v1.ZoneOperationSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonZoneOperationCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java new file mode 100644 index 000000000000..7c7e14d7983f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java @@ -0,0 +1,221 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; +import com.google.cloud.compute.v1.GetZoneOperationHttpRequest; +import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.ProjectZoneOperationName; +import com.google.cloud.compute.v1.ZoneName; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import com.google.cloud.compute.v1.ZoneOperationSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonZoneOperationStub extends ZoneOperationStub { + @InternalApi + public static final ApiMethodDescriptor deleteZoneOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zoneOperations.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteZoneOperationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectZoneOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getZoneOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zoneOperations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetZoneOperationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectZoneOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listZoneOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zoneOperations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListZoneOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteZoneOperationCallable; + private final UnaryCallable getZoneOperationCallable; + private final UnaryCallable listZoneOperationsCallable; + private final UnaryCallable listZoneOperationsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonZoneOperationStub create(ZoneOperationStubSettings settings) throws IOException { + return new HttpJsonZoneOperationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonZoneOperationStub create(ClientContext clientContext) throws IOException { + return new HttpJsonZoneOperationStub(ZoneOperationStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonZoneOperationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonZoneOperationStub(ZoneOperationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonZoneOperationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonZoneOperationStub(ZoneOperationStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonZoneOperationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonZoneOperationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonZoneOperationStub(ZoneOperationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteZoneOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteZoneOperationMethodDescriptor) + .build(); + HttpJsonCallSettings getZoneOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getZoneOperationMethodDescriptor) + .build(); + HttpJsonCallSettings listZoneOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listZoneOperationsMethodDescriptor) + .build(); + + this.deleteZoneOperationCallable = callableFactory.createUnaryCallable(deleteZoneOperationTransportSettings,settings.deleteZoneOperationSettings(), clientContext); + this.getZoneOperationCallable = callableFactory.createUnaryCallable(getZoneOperationTransportSettings,settings.getZoneOperationSettings(), clientContext); + this.listZoneOperationsCallable = callableFactory.createUnaryCallable(listZoneOperationsTransportSettings,settings.listZoneOperationsSettings(), clientContext); + this.listZoneOperationsPagedCallable = callableFactory.createPagedCallable(listZoneOperationsTransportSettings,settings.listZoneOperationsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteZoneOperationCallable() { + return deleteZoneOperationCallable; + } + + @BetaApi + public UnaryCallable getZoneOperationCallable() { + return getZoneOperationCallable; + } + + @BetaApi + public UnaryCallable listZoneOperationsPagedCallable() { + return listZoneOperationsPagedCallable; + } + + @BetaApi + public UnaryCallable listZoneOperationsCallable() { + return listZoneOperationsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java new file mode 100644 index 000000000000..9a5408247a45 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java @@ -0,0 +1,194 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetZoneHttpRequest; +import com.google.cloud.compute.v1.ListZonesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Zone; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import com.google.cloud.compute.v1.ZoneList; +import com.google.cloud.compute.v1.ZoneName; +import com.google.cloud.compute.v1.ZoneSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonZoneStub extends ZoneStub { + @InternalApi + public static final ApiMethodDescriptor getZoneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zones.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetZoneHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Zone.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listZonesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zones.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListZonesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ZoneList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getZoneCallable; + private final UnaryCallable listZonesCallable; + private final UnaryCallable listZonesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonZoneStub create(ZoneStubSettings settings) throws IOException { + return new HttpJsonZoneStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonZoneStub create(ClientContext clientContext) throws IOException { + return new HttpJsonZoneStub(ZoneStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonZoneStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonZoneStub(ZoneStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonZoneStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonZoneStub(ZoneStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonZoneCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonZoneStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonZoneStub(ZoneStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getZoneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getZoneMethodDescriptor) + .build(); + HttpJsonCallSettings listZonesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listZonesMethodDescriptor) + .build(); + + this.getZoneCallable = callableFactory.createUnaryCallable(getZoneTransportSettings,settings.getZoneSettings(), clientContext); + this.listZonesCallable = callableFactory.createUnaryCallable(listZonesTransportSettings,settings.listZonesSettings(), clientContext); + this.listZonesPagedCallable = callableFactory.createPagedCallable(listZonesTransportSettings,settings.listZonesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getZoneCallable() { + return getZoneCallable; + } + + @BetaApi + public UnaryCallable listZonesPagedCallable() { + return listZonesPagedCallable; + } + + @BetaApi + public UnaryCallable listZonesCallable() { + return listZonesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java new file mode 100644 index 000000000000..ab60bba1ebd6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpsHealthCheck; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpsHealthCheckList; +import com.google.cloud.compute.v1.HttpsHealthCheckName; +import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class HttpsHealthCheckStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteHttpsHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHttpsHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable getHttpsHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable insertHttpsHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: insertHttpsHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable listHttpsHealthChecksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listHttpsHealthChecksCallable() { + throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksCallable()"); + } + + @BetaApi + public UnaryCallable patchHttpsHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: patchHttpsHealthCheckCallable()"); + } + + @BetaApi + public UnaryCallable updateHttpsHealthCheckCallable() { + throw new UnsupportedOperationException("Not implemented: updateHttpsHealthCheckCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java new file mode 100644 index 000000000000..3ab0953a77e8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.HttpsHealthCheck; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import com.google.cloud.compute.v1.HttpsHealthCheckList; +import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link HttpsHealthCheckStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteHttpsHealthCheck to 30 seconds: + * + *

+ * 
+ * HttpsHealthCheckStubSettings.Builder httpsHealthCheckSettingsBuilder =
+ *     HttpsHealthCheckStubSettings.newBuilder();
+ * httpsHealthCheckSettingsBuilder.deleteHttpsHealthCheckSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * HttpsHealthCheckStubSettings httpsHealthCheckSettings = httpsHealthCheckSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class HttpsHealthCheckStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteHttpsHealthCheckSettings; + private final UnaryCallSettings getHttpsHealthCheckSettings; + private final UnaryCallSettings insertHttpsHealthCheckSettings; + private final PagedCallSettings listHttpsHealthChecksSettings; + private final UnaryCallSettings patchHttpsHealthCheckSettings; + private final UnaryCallSettings updateHttpsHealthCheckSettings; + + /** + * Returns the object with the settings used for calls to deleteHttpsHealthCheck. + */ + public UnaryCallSettings deleteHttpsHealthCheckSettings() { + return deleteHttpsHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to getHttpsHealthCheck. + */ + public UnaryCallSettings getHttpsHealthCheckSettings() { + return getHttpsHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to insertHttpsHealthCheck. + */ + public UnaryCallSettings insertHttpsHealthCheckSettings() { + return insertHttpsHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to listHttpsHealthChecks. + */ + public PagedCallSettings listHttpsHealthChecksSettings() { + return listHttpsHealthChecksSettings; + } + + /** + * Returns the object with the settings used for calls to patchHttpsHealthCheck. + */ + public UnaryCallSettings patchHttpsHealthCheckSettings() { + return patchHttpsHealthCheckSettings; + } + + /** + * Returns the object with the settings used for calls to updateHttpsHealthCheck. + */ + public UnaryCallSettings updateHttpsHealthCheckSettings() { + return updateHttpsHealthCheckSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HttpsHealthCheckStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonHttpsHealthCheckStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(HttpsHealthCheckStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected HttpsHealthCheckStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteHttpsHealthCheckSettings = settingsBuilder.deleteHttpsHealthCheckSettings().build(); + getHttpsHealthCheckSettings = settingsBuilder.getHttpsHealthCheckSettings().build(); + insertHttpsHealthCheckSettings = settingsBuilder.insertHttpsHealthCheckSettings().build(); + listHttpsHealthChecksSettings = settingsBuilder.listHttpsHealthChecksSettings().build(); + patchHttpsHealthCheckSettings = settingsBuilder.patchHttpsHealthCheckSettings().build(); + updateHttpsHealthCheckSettings = settingsBuilder.updateHttpsHealthCheckSettings().build(); + } + + private static final PagedListDescriptor LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListHttpsHealthChecksHttpRequest injectToken(ListHttpsHealthChecksHttpRequest payload, String token) { + return ListHttpsHealthChecksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListHttpsHealthChecksHttpRequest injectPageSize(ListHttpsHealthChecksHttpRequest payload, int pageSize) { + return ListHttpsHealthChecksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListHttpsHealthChecksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(HttpsHealthCheckList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(HttpsHealthCheckList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListHttpsHealthChecksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC, request, context); + return ListHttpsHealthChecksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for HttpsHealthCheckStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteHttpsHealthCheckSettings; + private final UnaryCallSettings.Builder getHttpsHealthCheckSettings; + private final UnaryCallSettings.Builder insertHttpsHealthCheckSettings; + private final PagedCallSettings.Builder listHttpsHealthChecksSettings; + private final UnaryCallSettings.Builder patchHttpsHealthCheckSettings; + private final UnaryCallSettings.Builder updateHttpsHealthCheckSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listHttpsHealthChecksSettings = PagedCallSettings.newBuilder( + LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_FACT); + + patchHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteHttpsHealthCheckSettings, + getHttpsHealthCheckSettings, + insertHttpsHealthCheckSettings, + listHttpsHealthChecksSettings, + patchHttpsHealthCheckSettings, + updateHttpsHealthCheckSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteHttpsHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getHttpsHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertHttpsHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listHttpsHealthChecksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchHttpsHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateHttpsHealthCheckSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(HttpsHealthCheckStubSettings settings) { + super(settings); + + deleteHttpsHealthCheckSettings = settings.deleteHttpsHealthCheckSettings.toBuilder(); + getHttpsHealthCheckSettings = settings.getHttpsHealthCheckSettings.toBuilder(); + insertHttpsHealthCheckSettings = settings.insertHttpsHealthCheckSettings.toBuilder(); + listHttpsHealthChecksSettings = settings.listHttpsHealthChecksSettings.toBuilder(); + patchHttpsHealthCheckSettings = settings.patchHttpsHealthCheckSettings.toBuilder(); + updateHttpsHealthCheckSettings = settings.updateHttpsHealthCheckSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteHttpsHealthCheckSettings, + getHttpsHealthCheckSettings, + insertHttpsHealthCheckSettings, + listHttpsHealthChecksSettings, + patchHttpsHealthCheckSettings, + updateHttpsHealthCheckSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteHttpsHealthCheck. + */ + public UnaryCallSettings.Builder deleteHttpsHealthCheckSettings() { + return deleteHttpsHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to getHttpsHealthCheck. + */ + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { + return getHttpsHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to insertHttpsHealthCheck. + */ + public UnaryCallSettings.Builder insertHttpsHealthCheckSettings() { + return insertHttpsHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to listHttpsHealthChecks. + */ + public PagedCallSettings.Builder listHttpsHealthChecksSettings() { + return listHttpsHealthChecksSettings; + } + + /** + * Returns the builder for the settings used for calls to patchHttpsHealthCheck. + */ + public UnaryCallSettings.Builder patchHttpsHealthCheckSettings() { + return patchHttpsHealthCheckSettings; + } + + /** + * Returns the builder for the settings used for calls to updateHttpsHealthCheck. + */ + public UnaryCallSettings.Builder updateHttpsHealthCheckSettings() { + return updateHttpsHealthCheckSettings; + } + + @Override + public HttpsHealthCheckStubSettings build() throws IOException { + return new HttpsHealthCheckStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java new file mode 100644 index 000000000000..c1ab2fe9f40c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java @@ -0,0 +1,83 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteImageHttpRequest; +import com.google.cloud.compute.v1.DeprecateImageHttpRequest; +import com.google.cloud.compute.v1.DeprecationStatus; +import com.google.cloud.compute.v1.FamilyName; +import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.Image; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import com.google.cloud.compute.v1.ImageList; +import com.google.cloud.compute.v1.ImageName; +import com.google.cloud.compute.v1.InsertImageHttpRequest; +import com.google.cloud.compute.v1.ListImagesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ImageStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteImageCallable() { + throw new UnsupportedOperationException("Not implemented: deleteImageCallable()"); + } + + @BetaApi + public UnaryCallable deprecateImageCallable() { + throw new UnsupportedOperationException("Not implemented: deprecateImageCallable()"); + } + + @BetaApi + public UnaryCallable getImageCallable() { + throw new UnsupportedOperationException("Not implemented: getImageCallable()"); + } + + @BetaApi + public UnaryCallable getFromFamilyImageCallable() { + throw new UnsupportedOperationException("Not implemented: getFromFamilyImageCallable()"); + } + + @BetaApi + public UnaryCallable insertImageCallable() { + throw new UnsupportedOperationException("Not implemented: insertImageCallable()"); + } + + @BetaApi + public UnaryCallable listImagesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listImagesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listImagesCallable() { + throw new UnsupportedOperationException("Not implemented: listImagesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java new file mode 100644 index 000000000000..4aed85c0d86f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteImageHttpRequest; +import com.google.cloud.compute.v1.DeprecateImageHttpRequest; +import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.Image; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import com.google.cloud.compute.v1.ImageList; +import com.google.cloud.compute.v1.InsertImageHttpRequest; +import com.google.cloud.compute.v1.ListImagesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ImageStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteImage to 30 seconds: + * + *

+ * 
+ * ImageStubSettings.Builder imageSettingsBuilder =
+ *     ImageStubSettings.newBuilder();
+ * imageSettingsBuilder.deleteImageSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ImageStubSettings imageSettings = imageSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ImageStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteImageSettings; + private final UnaryCallSettings deprecateImageSettings; + private final UnaryCallSettings getImageSettings; + private final UnaryCallSettings getFromFamilyImageSettings; + private final UnaryCallSettings insertImageSettings; + private final PagedCallSettings listImagesSettings; + + /** + * Returns the object with the settings used for calls to deleteImage. + */ + public UnaryCallSettings deleteImageSettings() { + return deleteImageSettings; + } + + /** + * Returns the object with the settings used for calls to deprecateImage. + */ + public UnaryCallSettings deprecateImageSettings() { + return deprecateImageSettings; + } + + /** + * Returns the object with the settings used for calls to getImage. + */ + public UnaryCallSettings getImageSettings() { + return getImageSettings; + } + + /** + * Returns the object with the settings used for calls to getFromFamilyImage. + */ + public UnaryCallSettings getFromFamilyImageSettings() { + return getFromFamilyImageSettings; + } + + /** + * Returns the object with the settings used for calls to insertImage. + */ + public UnaryCallSettings insertImageSettings() { + return insertImageSettings; + } + + /** + * Returns the object with the settings used for calls to listImages. + */ + public PagedCallSettings listImagesSettings() { + return listImagesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ImageStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonImageStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ImageStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ImageStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteImageSettings = settingsBuilder.deleteImageSettings().build(); + deprecateImageSettings = settingsBuilder.deprecateImageSettings().build(); + getImageSettings = settingsBuilder.getImageSettings().build(); + getFromFamilyImageSettings = settingsBuilder.getFromFamilyImageSettings().build(); + insertImageSettings = settingsBuilder.insertImageSettings().build(); + listImagesSettings = settingsBuilder.listImagesSettings().build(); + } + + private static final PagedListDescriptor LIST_IMAGES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) { + return ListImagesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListImagesHttpRequest injectPageSize(ListImagesHttpRequest payload, int pageSize) { + return ListImagesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListImagesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(ImageList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ImageList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_IMAGES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListImagesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context); + return ListImagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for ImageStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteImageSettings; + private final UnaryCallSettings.Builder deprecateImageSettings; + private final UnaryCallSettings.Builder getImageSettings; + private final UnaryCallSettings.Builder getFromFamilyImageSettings; + private final UnaryCallSettings.Builder insertImageSettings; + private final PagedCallSettings.Builder listImagesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deprecateImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getFromFamilyImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listImagesSettings = PagedCallSettings.newBuilder( + LIST_IMAGES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteImageSettings, + deprecateImageSettings, + getImageSettings, + getFromFamilyImageSettings, + insertImageSettings, + listImagesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deprecateImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getFromFamilyImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ImageStubSettings settings) { + super(settings); + + deleteImageSettings = settings.deleteImageSettings.toBuilder(); + deprecateImageSettings = settings.deprecateImageSettings.toBuilder(); + getImageSettings = settings.getImageSettings.toBuilder(); + getFromFamilyImageSettings = settings.getFromFamilyImageSettings.toBuilder(); + insertImageSettings = settings.insertImageSettings.toBuilder(); + listImagesSettings = settings.listImagesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteImageSettings, + deprecateImageSettings, + getImageSettings, + getFromFamilyImageSettings, + insertImageSettings, + listImagesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteImage. + */ + public UnaryCallSettings.Builder deleteImageSettings() { + return deleteImageSettings; + } + + /** + * Returns the builder for the settings used for calls to deprecateImage. + */ + public UnaryCallSettings.Builder deprecateImageSettings() { + return deprecateImageSettings; + } + + /** + * Returns the builder for the settings used for calls to getImage. + */ + public UnaryCallSettings.Builder getImageSettings() { + return getImageSettings; + } + + /** + * Returns the builder for the settings used for calls to getFromFamilyImage. + */ + public UnaryCallSettings.Builder getFromFamilyImageSettings() { + return getFromFamilyImageSettings; + } + + /** + * Returns the builder for the settings used for calls to insertImage. + */ + public UnaryCallSettings.Builder insertImageSettings() { + return insertImageSettings; + } + + /** + * Returns the builder for the settings used for calls to listImages. + */ + public PagedCallSettings.Builder listImagesSettings() { + return listImagesSettings; + } + + @Override + public ImageStubSettings build() throws IOException { + return new ImageStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java new file mode 100644 index 000000000000..997265cd530c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java @@ -0,0 +1,132 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupManagerList; +import com.google.cloud.compute.v1.InstanceGroupManagerName; +import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; +import com.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; +import com.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; +import com.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; +import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InstanceGroupManagerStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable abandonInstancesInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: abandonInstancesInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupManagersPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupManagersCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupManagersCallable()"); + } + + @BetaApi + public UnaryCallable deleteInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable deleteInstancesInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstancesInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable getInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable insertInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: insertInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable listInstanceGroupManagersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstanceGroupManagersPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInstanceGroupManagersCallable() { + throw new UnsupportedOperationException("Not implemented: listInstanceGroupManagersCallable()"); + } + + @BetaApi + public UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { + throw new UnsupportedOperationException("Not implemented: listManagedInstancesInstanceGroupManagersCallable()"); + } + + @BetaApi + public UnaryCallable recreateInstancesInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: recreateInstancesInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable resizeInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: resizeInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: setInstanceTemplateInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: setTargetPoolsInstanceGroupManagerCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java new file mode 100644 index 000000000000..2810f512f51e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java @@ -0,0 +1,716 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupManagerList; +import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; +import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; +import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceGroupManagerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of abandonInstancesInstanceGroupManager to 30 seconds: + * + *

+ * 
+ * InstanceGroupManagerStubSettings.Builder instanceGroupManagerSettingsBuilder =
+ *     InstanceGroupManagerStubSettings.newBuilder();
+ * instanceGroupManagerSettingsBuilder.abandonInstancesInstanceGroupManagerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceGroupManagerStubSettings instanceGroupManagerSettings = instanceGroupManagerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceGroupManagerStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings abandonInstancesInstanceGroupManagerSettings; + private final PagedCallSettings aggregatedListInstanceGroupManagersSettings; + private final UnaryCallSettings deleteInstanceGroupManagerSettings; + private final UnaryCallSettings deleteInstancesInstanceGroupManagerSettings; + private final UnaryCallSettings getInstanceGroupManagerSettings; + private final UnaryCallSettings insertInstanceGroupManagerSettings; + private final PagedCallSettings listInstanceGroupManagersSettings; + private final UnaryCallSettings listManagedInstancesInstanceGroupManagersSettings; + private final UnaryCallSettings recreateInstancesInstanceGroupManagerSettings; + private final UnaryCallSettings resizeInstanceGroupManagerSettings; + private final UnaryCallSettings setInstanceTemplateInstanceGroupManagerSettings; + private final UnaryCallSettings setTargetPoolsInstanceGroupManagerSettings; + + /** + * Returns the object with the settings used for calls to abandonInstancesInstanceGroupManager. + */ + public UnaryCallSettings abandonInstancesInstanceGroupManagerSettings() { + return abandonInstancesInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to aggregatedListInstanceGroupManagers. + */ + public PagedCallSettings aggregatedListInstanceGroupManagersSettings() { + return aggregatedListInstanceGroupManagersSettings; + } + + /** + * Returns the object with the settings used for calls to deleteInstanceGroupManager. + */ + public UnaryCallSettings deleteInstanceGroupManagerSettings() { + return deleteInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to deleteInstancesInstanceGroupManager. + */ + public UnaryCallSettings deleteInstancesInstanceGroupManagerSettings() { + return deleteInstancesInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to getInstanceGroupManager. + */ + public UnaryCallSettings getInstanceGroupManagerSettings() { + return getInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to insertInstanceGroupManager. + */ + public UnaryCallSettings insertInstanceGroupManagerSettings() { + return insertInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to listInstanceGroupManagers. + */ + public PagedCallSettings listInstanceGroupManagersSettings() { + return listInstanceGroupManagersSettings; + } + + /** + * Returns the object with the settings used for calls to listManagedInstancesInstanceGroupManagers. + */ + public UnaryCallSettings listManagedInstancesInstanceGroupManagersSettings() { + return listManagedInstancesInstanceGroupManagersSettings; + } + + /** + * Returns the object with the settings used for calls to recreateInstancesInstanceGroupManager. + */ + public UnaryCallSettings recreateInstancesInstanceGroupManagerSettings() { + return recreateInstancesInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to resizeInstanceGroupManager. + */ + public UnaryCallSettings resizeInstanceGroupManagerSettings() { + return resizeInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to setInstanceTemplateInstanceGroupManager. + */ + public UnaryCallSettings setInstanceTemplateInstanceGroupManagerSettings() { + return setInstanceTemplateInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to setTargetPoolsInstanceGroupManager. + */ + public UnaryCallSettings setTargetPoolsInstanceGroupManagerSettings() { + return setTargetPoolsInstanceGroupManagerSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceGroupManagerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInstanceGroupManagerStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceGroupManagerStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceGroupManagerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + abandonInstancesInstanceGroupManagerSettings = settingsBuilder.abandonInstancesInstanceGroupManagerSettings().build(); + aggregatedListInstanceGroupManagersSettings = settingsBuilder.aggregatedListInstanceGroupManagersSettings().build(); + deleteInstanceGroupManagerSettings = settingsBuilder.deleteInstanceGroupManagerSettings().build(); + deleteInstancesInstanceGroupManagerSettings = settingsBuilder.deleteInstancesInstanceGroupManagerSettings().build(); + getInstanceGroupManagerSettings = settingsBuilder.getInstanceGroupManagerSettings().build(); + insertInstanceGroupManagerSettings = settingsBuilder.insertInstanceGroupManagerSettings().build(); + listInstanceGroupManagersSettings = settingsBuilder.listInstanceGroupManagersSettings().build(); + listManagedInstancesInstanceGroupManagersSettings = settingsBuilder.listManagedInstancesInstanceGroupManagersSettings().build(); + recreateInstancesInstanceGroupManagerSettings = settingsBuilder.recreateInstancesInstanceGroupManagerSettings().build(); + resizeInstanceGroupManagerSettings = settingsBuilder.resizeInstanceGroupManagerSettings().build(); + setInstanceTemplateInstanceGroupManagerSettings = settingsBuilder.setInstanceTemplateInstanceGroupManagerSettings().build(); + setTargetPoolsInstanceGroupManagerSettings = settingsBuilder.setTargetPoolsInstanceGroupManagerSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListInstanceGroupManagersHttpRequest injectToken(AggregatedListInstanceGroupManagersHttpRequest payload, String token) { + return AggregatedListInstanceGroupManagersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListInstanceGroupManagersHttpRequest injectPageSize(AggregatedListInstanceGroupManagersHttpRequest payload, int pageSize) { + return AggregatedListInstanceGroupManagersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListInstanceGroupManagersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceGroupManagerAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceGroupManagerAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInstanceGroupManagersHttpRequest injectToken(ListInstanceGroupManagersHttpRequest payload, String token) { + return ListInstanceGroupManagersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInstanceGroupManagersHttpRequest injectPageSize(ListInstanceGroupManagersHttpRequest payload, int pageSize) { + return ListInstanceGroupManagersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInstanceGroupManagersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceGroupManagerList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceGroupManagerList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListInstanceGroupManagersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context); + return AggregatedListInstanceGroupManagersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstanceGroupManagersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context); + return ListInstanceGroupManagersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InstanceGroupManagerStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder abandonInstancesInstanceGroupManagerSettings; + private final PagedCallSettings.Builder aggregatedListInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder deleteInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder deleteInstancesInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder getInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder insertInstanceGroupManagerSettings; + private final PagedCallSettings.Builder listInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder listManagedInstancesInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder recreateInstancesInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder resizeInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder setInstanceTemplateInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder setTargetPoolsInstanceGroupManagerSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + abandonInstancesInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + aggregatedListInstanceGroupManagersSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT); + + deleteInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteInstancesInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInstanceGroupManagersSettings = PagedCallSettings.newBuilder( + LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT); + + listManagedInstancesInstanceGroupManagersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + recreateInstancesInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + resizeInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setInstanceTemplateInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setTargetPoolsInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + abandonInstancesInstanceGroupManagerSettings, + aggregatedListInstanceGroupManagersSettings, + deleteInstanceGroupManagerSettings, + deleteInstancesInstanceGroupManagerSettings, + getInstanceGroupManagerSettings, + insertInstanceGroupManagerSettings, + listInstanceGroupManagersSettings, + listManagedInstancesInstanceGroupManagersSettings, + recreateInstancesInstanceGroupManagerSettings, + resizeInstanceGroupManagerSettings, + setInstanceTemplateInstanceGroupManagerSettings, + setTargetPoolsInstanceGroupManagerSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.abandonInstancesInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.aggregatedListInstanceGroupManagersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteInstancesInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInstanceGroupManagersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listManagedInstancesInstanceGroupManagersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.recreateInstancesInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.resizeInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setInstanceTemplateInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setTargetPoolsInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InstanceGroupManagerStubSettings settings) { + super(settings); + + abandonInstancesInstanceGroupManagerSettings = settings.abandonInstancesInstanceGroupManagerSettings.toBuilder(); + aggregatedListInstanceGroupManagersSettings = settings.aggregatedListInstanceGroupManagersSettings.toBuilder(); + deleteInstanceGroupManagerSettings = settings.deleteInstanceGroupManagerSettings.toBuilder(); + deleteInstancesInstanceGroupManagerSettings = settings.deleteInstancesInstanceGroupManagerSettings.toBuilder(); + getInstanceGroupManagerSettings = settings.getInstanceGroupManagerSettings.toBuilder(); + insertInstanceGroupManagerSettings = settings.insertInstanceGroupManagerSettings.toBuilder(); + listInstanceGroupManagersSettings = settings.listInstanceGroupManagersSettings.toBuilder(); + listManagedInstancesInstanceGroupManagersSettings = settings.listManagedInstancesInstanceGroupManagersSettings.toBuilder(); + recreateInstancesInstanceGroupManagerSettings = settings.recreateInstancesInstanceGroupManagerSettings.toBuilder(); + resizeInstanceGroupManagerSettings = settings.resizeInstanceGroupManagerSettings.toBuilder(); + setInstanceTemplateInstanceGroupManagerSettings = settings.setInstanceTemplateInstanceGroupManagerSettings.toBuilder(); + setTargetPoolsInstanceGroupManagerSettings = settings.setTargetPoolsInstanceGroupManagerSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + abandonInstancesInstanceGroupManagerSettings, + aggregatedListInstanceGroupManagersSettings, + deleteInstanceGroupManagerSettings, + deleteInstancesInstanceGroupManagerSettings, + getInstanceGroupManagerSettings, + insertInstanceGroupManagerSettings, + listInstanceGroupManagersSettings, + listManagedInstancesInstanceGroupManagersSettings, + recreateInstancesInstanceGroupManagerSettings, + resizeInstanceGroupManagerSettings, + setInstanceTemplateInstanceGroupManagerSettings, + setTargetPoolsInstanceGroupManagerSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to abandonInstancesInstanceGroupManager. + */ + public UnaryCallSettings.Builder abandonInstancesInstanceGroupManagerSettings() { + return abandonInstancesInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInstanceGroupManagers. + */ + public PagedCallSettings.Builder aggregatedListInstanceGroupManagersSettings() { + return aggregatedListInstanceGroupManagersSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteInstanceGroupManagerSettings() { + return deleteInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteInstancesInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteInstancesInstanceGroupManagerSettings() { + return deleteInstancesInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to getInstanceGroupManager. + */ + public UnaryCallSettings.Builder getInstanceGroupManagerSettings() { + return getInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to insertInstanceGroupManager. + */ + public UnaryCallSettings.Builder insertInstanceGroupManagerSettings() { + return insertInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to listInstanceGroupManagers. + */ + public PagedCallSettings.Builder listInstanceGroupManagersSettings() { + return listInstanceGroupManagersSettings; + } + + /** + * Returns the builder for the settings used for calls to listManagedInstancesInstanceGroupManagers. + */ + public UnaryCallSettings.Builder listManagedInstancesInstanceGroupManagersSettings() { + return listManagedInstancesInstanceGroupManagersSettings; + } + + /** + * Returns the builder for the settings used for calls to recreateInstancesInstanceGroupManager. + */ + public UnaryCallSettings.Builder recreateInstancesInstanceGroupManagerSettings() { + return recreateInstancesInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to resizeInstanceGroupManager. + */ + public UnaryCallSettings.Builder resizeInstanceGroupManagerSettings() { + return resizeInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to setInstanceTemplateInstanceGroupManager. + */ + public UnaryCallSettings.Builder setInstanceTemplateInstanceGroupManagerSettings() { + return setInstanceTemplateInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to setTargetPoolsInstanceGroupManager. + */ + public UnaryCallSettings.Builder setTargetPoolsInstanceGroupManagerSettings() { + return setTargetPoolsInstanceGroupManagerSettings; + } + + @Override + public InstanceGroupManagerStubSettings build() throws IOException { + return new InstanceGroupManagerStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java new file mode 100644 index 000000000000..11dffda5776b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java @@ -0,0 +1,120 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceGroupAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupList; +import com.google.cloud.compute.v1.InstanceGroupName; +import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsListInstances; +import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; +import com.google.cloud.compute.v1.InstanceGroupsScopedList; +import com.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InstanceGroupStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable addInstancesInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: addInstancesInstanceGroupCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInstanceGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupsCallable()"); + } + + @BetaApi + public UnaryCallable deleteInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceGroupCallable()"); + } + + @BetaApi + public UnaryCallable getInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceGroupCallable()"); + } + + @BetaApi + public UnaryCallable insertInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: insertInstanceGroupCallable()"); + } + + @BetaApi + public UnaryCallable listInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstanceGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInstanceGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listInstanceGroupsCallable()"); + } + + @BetaApi + public UnaryCallable listInstancesInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesInstanceGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInstancesInstanceGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesInstanceGroupsCallable()"); + } + + @BetaApi + public UnaryCallable removeInstancesInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: removeInstancesInstanceGroupCallable()"); + } + + @BetaApi + public UnaryCallable setNamedPortsInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: setNamedPortsInstanceGroupCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java new file mode 100644 index 000000000000..1ecd2a34590a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java @@ -0,0 +1,686 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.GetInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceGroupAggregatedList; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.InstanceGroupList; +import com.google.cloud.compute.v1.InstanceGroupsListInstances; +import com.google.cloud.compute.v1.InstanceGroupsScopedList; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceGroupStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: + * + *

+ * 
+ * InstanceGroupStubSettings.Builder instanceGroupSettingsBuilder =
+ *     InstanceGroupStubSettings.newBuilder();
+ * instanceGroupSettingsBuilder.addInstancesInstanceGroupSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceGroupStubSettings instanceGroupSettings = instanceGroupSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceGroupStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings addInstancesInstanceGroupSettings; + private final PagedCallSettings aggregatedListInstanceGroupsSettings; + private final UnaryCallSettings deleteInstanceGroupSettings; + private final UnaryCallSettings getInstanceGroupSettings; + private final UnaryCallSettings insertInstanceGroupSettings; + private final PagedCallSettings listInstanceGroupsSettings; + private final PagedCallSettings listInstancesInstanceGroupsSettings; + private final UnaryCallSettings removeInstancesInstanceGroupSettings; + private final UnaryCallSettings setNamedPortsInstanceGroupSettings; + + /** + * Returns the object with the settings used for calls to addInstancesInstanceGroup. + */ + public UnaryCallSettings addInstancesInstanceGroupSettings() { + return addInstancesInstanceGroupSettings; + } + + /** + * Returns the object with the settings used for calls to aggregatedListInstanceGroups. + */ + public PagedCallSettings aggregatedListInstanceGroupsSettings() { + return aggregatedListInstanceGroupsSettings; + } + + /** + * Returns the object with the settings used for calls to deleteInstanceGroup. + */ + public UnaryCallSettings deleteInstanceGroupSettings() { + return deleteInstanceGroupSettings; + } + + /** + * Returns the object with the settings used for calls to getInstanceGroup. + */ + public UnaryCallSettings getInstanceGroupSettings() { + return getInstanceGroupSettings; + } + + /** + * Returns the object with the settings used for calls to insertInstanceGroup. + */ + public UnaryCallSettings insertInstanceGroupSettings() { + return insertInstanceGroupSettings; + } + + /** + * Returns the object with the settings used for calls to listInstanceGroups. + */ + public PagedCallSettings listInstanceGroupsSettings() { + return listInstanceGroupsSettings; + } + + /** + * Returns the object with the settings used for calls to listInstancesInstanceGroups. + */ + public PagedCallSettings listInstancesInstanceGroupsSettings() { + return listInstancesInstanceGroupsSettings; + } + + /** + * Returns the object with the settings used for calls to removeInstancesInstanceGroup. + */ + public UnaryCallSettings removeInstancesInstanceGroupSettings() { + return removeInstancesInstanceGroupSettings; + } + + /** + * Returns the object with the settings used for calls to setNamedPortsInstanceGroup. + */ + public UnaryCallSettings setNamedPortsInstanceGroupSettings() { + return setNamedPortsInstanceGroupSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceGroupStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInstanceGroupStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceGroupStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceGroupStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + addInstancesInstanceGroupSettings = settingsBuilder.addInstancesInstanceGroupSettings().build(); + aggregatedListInstanceGroupsSettings = settingsBuilder.aggregatedListInstanceGroupsSettings().build(); + deleteInstanceGroupSettings = settingsBuilder.deleteInstanceGroupSettings().build(); + getInstanceGroupSettings = settingsBuilder.getInstanceGroupSettings().build(); + insertInstanceGroupSettings = settingsBuilder.insertInstanceGroupSettings().build(); + listInstanceGroupsSettings = settingsBuilder.listInstanceGroupsSettings().build(); + listInstancesInstanceGroupsSettings = settingsBuilder.listInstancesInstanceGroupsSettings().build(); + removeInstancesInstanceGroupSettings = settingsBuilder.removeInstancesInstanceGroupSettings().build(); + setNamedPortsInstanceGroupSettings = settingsBuilder.setNamedPortsInstanceGroupSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListInstanceGroupsHttpRequest injectToken(AggregatedListInstanceGroupsHttpRequest payload, String token) { + return AggregatedListInstanceGroupsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListInstanceGroupsHttpRequest injectPageSize(AggregatedListInstanceGroupsHttpRequest payload, int pageSize) { + return AggregatedListInstanceGroupsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListInstanceGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceGroupAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceGroupAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_INSTANCE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInstanceGroupsHttpRequest injectToken(ListInstanceGroupsHttpRequest payload, String token) { + return ListInstanceGroupsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInstanceGroupsHttpRequest injectPageSize(ListInstanceGroupsHttpRequest payload, int pageSize) { + return ListInstanceGroupsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInstanceGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceGroupList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceGroupList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListDescriptor LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInstancesInstanceGroupsHttpRequest injectToken(ListInstancesInstanceGroupsHttpRequest payload, String token) { + return ListInstancesInstanceGroupsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInstancesInstanceGroupsHttpRequest injectPageSize(ListInstancesInstanceGroupsHttpRequest payload, int pageSize) { + return ListInstancesInstanceGroupsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInstancesInstanceGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceGroupsListInstances payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceGroupsListInstances payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListInstanceGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_DESC, request, context); + return AggregatedListInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_INSTANCE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstanceGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCE_GROUPS_PAGE_STR_DESC, request, context); + return ListInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesInstanceGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_DESC, request, context); + return ListInstancesInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InstanceGroupStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder addInstancesInstanceGroupSettings; + private final PagedCallSettings.Builder aggregatedListInstanceGroupsSettings; + private final UnaryCallSettings.Builder deleteInstanceGroupSettings; + private final UnaryCallSettings.Builder getInstanceGroupSettings; + private final UnaryCallSettings.Builder insertInstanceGroupSettings; + private final PagedCallSettings.Builder listInstanceGroupsSettings; + private final PagedCallSettings.Builder listInstancesInstanceGroupsSettings; + private final UnaryCallSettings.Builder removeInstancesInstanceGroupSettings; + private final UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + addInstancesInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + aggregatedListInstanceGroupsSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_FACT); + + deleteInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInstanceGroupsSettings = PagedCallSettings.newBuilder( + LIST_INSTANCE_GROUPS_PAGE_STR_FACT); + + listInstancesInstanceGroupsSettings = PagedCallSettings.newBuilder( + LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_FACT); + + removeInstancesInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setNamedPortsInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + addInstancesInstanceGroupSettings, + aggregatedListInstanceGroupsSettings, + deleteInstanceGroupSettings, + getInstanceGroupSettings, + insertInstanceGroupSettings, + listInstanceGroupsSettings, + listInstancesInstanceGroupsSettings, + removeInstancesInstanceGroupSettings, + setNamedPortsInstanceGroupSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.addInstancesInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.aggregatedListInstanceGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInstanceGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInstancesInstanceGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.removeInstancesInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setNamedPortsInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InstanceGroupStubSettings settings) { + super(settings); + + addInstancesInstanceGroupSettings = settings.addInstancesInstanceGroupSettings.toBuilder(); + aggregatedListInstanceGroupsSettings = settings.aggregatedListInstanceGroupsSettings.toBuilder(); + deleteInstanceGroupSettings = settings.deleteInstanceGroupSettings.toBuilder(); + getInstanceGroupSettings = settings.getInstanceGroupSettings.toBuilder(); + insertInstanceGroupSettings = settings.insertInstanceGroupSettings.toBuilder(); + listInstanceGroupsSettings = settings.listInstanceGroupsSettings.toBuilder(); + listInstancesInstanceGroupsSettings = settings.listInstancesInstanceGroupsSettings.toBuilder(); + removeInstancesInstanceGroupSettings = settings.removeInstancesInstanceGroupSettings.toBuilder(); + setNamedPortsInstanceGroupSettings = settings.setNamedPortsInstanceGroupSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + addInstancesInstanceGroupSettings, + aggregatedListInstanceGroupsSettings, + deleteInstanceGroupSettings, + getInstanceGroupSettings, + insertInstanceGroupSettings, + listInstanceGroupsSettings, + listInstancesInstanceGroupsSettings, + removeInstancesInstanceGroupSettings, + setNamedPortsInstanceGroupSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to addInstancesInstanceGroup. + */ + public UnaryCallSettings.Builder addInstancesInstanceGroupSettings() { + return addInstancesInstanceGroupSettings; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInstanceGroups. + */ + public PagedCallSettings.Builder aggregatedListInstanceGroupsSettings() { + return aggregatedListInstanceGroupsSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteInstanceGroup. + */ + public UnaryCallSettings.Builder deleteInstanceGroupSettings() { + return deleteInstanceGroupSettings; + } + + /** + * Returns the builder for the settings used for calls to getInstanceGroup. + */ + public UnaryCallSettings.Builder getInstanceGroupSettings() { + return getInstanceGroupSettings; + } + + /** + * Returns the builder for the settings used for calls to insertInstanceGroup. + */ + public UnaryCallSettings.Builder insertInstanceGroupSettings() { + return insertInstanceGroupSettings; + } + + /** + * Returns the builder for the settings used for calls to listInstanceGroups. + */ + public PagedCallSettings.Builder listInstanceGroupsSettings() { + return listInstanceGroupsSettings; + } + + /** + * Returns the builder for the settings used for calls to listInstancesInstanceGroups. + */ + public PagedCallSettings.Builder listInstancesInstanceGroupsSettings() { + return listInstancesInstanceGroupsSettings; + } + + /** + * Returns the builder for the settings used for calls to removeInstancesInstanceGroup. + */ + public UnaryCallSettings.Builder removeInstancesInstanceGroupSettings() { + return removeInstancesInstanceGroupSettings; + } + + /** + * Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. + */ + public UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings() { + return setNamedPortsInstanceGroupSettings; + } + + @Override + public InstanceGroupStubSettings build() throws IOException { + return new InstanceGroupStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java new file mode 100644 index 000000000000..f4f668f45e35 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java @@ -0,0 +1,183 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AccessConfig; +import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; +import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.AttachedDisk; +import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceHttpRequest; +import com.google.cloud.compute.v1.Instance; +import com.google.cloud.compute.v1.InstanceAggregatedList; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceName; +import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; +import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; +import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; +import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ResetInstanceHttpRequest; +import com.google.cloud.compute.v1.Scheduling; +import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; +import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; +import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; +import com.google.cloud.compute.v1.StartInstanceHttpRequest; +import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; +import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.Tags; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InstanceStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable addAccessConfigInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: addAccessConfigInstanceCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInstancesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInstancesCallable()"); + } + + @BetaApi + public UnaryCallable attachDiskInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: attachDiskInstanceCallable()"); + } + + @BetaApi + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + @BetaApi + public UnaryCallable deleteAccessConfigInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAccessConfigInstanceCallable()"); + } + + @BetaApi + public UnaryCallable detachDiskInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: detachDiskInstanceCallable()"); + } + + @BetaApi + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + @BetaApi + public UnaryCallable getSerialPortOutputInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getSerialPortOutputInstanceCallable()"); + } + + @BetaApi + public UnaryCallable insertInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: insertInstanceCallable()"); + } + + @BetaApi + public UnaryCallable listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + @BetaApi + public UnaryCallable resetInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: resetInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setDiskAutoDeleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setDiskAutoDeleteInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setMachineTypeInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setMachineTypeInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setMetadataInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setMetadataInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setSchedulingInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setSchedulingInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setServiceAccountInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setServiceAccountInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setTagsInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setTagsInstanceCallable()"); + } + + @BetaApi + public UnaryCallable startInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: startInstanceCallable()"); + } + + @BetaApi + public UnaryCallable startWithEncryptionKeyInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: startWithEncryptionKeyInstanceCallable()"); + } + + @BetaApi + public UnaryCallable stopInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: stopInstanceCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java new file mode 100644 index 000000000000..6e3a31e3dccc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java @@ -0,0 +1,932 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; +import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceHttpRequest; +import com.google.cloud.compute.v1.Instance; +import com.google.cloud.compute.v1.InstanceAggregatedList; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ResetInstanceHttpRequest; +import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; +import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; +import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; +import com.google.cloud.compute.v1.StartInstanceHttpRequest; +import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; +import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addAccessConfigInstance to 30 seconds: + * + *

+ * 
+ * InstanceStubSettings.Builder instanceSettingsBuilder =
+ *     InstanceStubSettings.newBuilder();
+ * instanceSettingsBuilder.addAccessConfigInstanceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceStubSettings instanceSettings = instanceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings addAccessConfigInstanceSettings; + private final PagedCallSettings aggregatedListInstancesSettings; + private final UnaryCallSettings attachDiskInstanceSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final UnaryCallSettings deleteAccessConfigInstanceSettings; + private final UnaryCallSettings detachDiskInstanceSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings getSerialPortOutputInstanceSettings; + private final UnaryCallSettings insertInstanceSettings; + private final PagedCallSettings listInstancesSettings; + private final UnaryCallSettings resetInstanceSettings; + private final UnaryCallSettings setDiskAutoDeleteInstanceSettings; + private final UnaryCallSettings setMachineTypeInstanceSettings; + private final UnaryCallSettings setMetadataInstanceSettings; + private final UnaryCallSettings setSchedulingInstanceSettings; + private final UnaryCallSettings setServiceAccountInstanceSettings; + private final UnaryCallSettings setTagsInstanceSettings; + private final UnaryCallSettings startInstanceSettings; + private final UnaryCallSettings startWithEncryptionKeyInstanceSettings; + private final UnaryCallSettings stopInstanceSettings; + + /** + * Returns the object with the settings used for calls to addAccessConfigInstance. + */ + public UnaryCallSettings addAccessConfigInstanceSettings() { + return addAccessConfigInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to aggregatedListInstances. + */ + public PagedCallSettings aggregatedListInstancesSettings() { + return aggregatedListInstancesSettings; + } + + /** + * Returns the object with the settings used for calls to attachDiskInstance. + */ + public UnaryCallSettings attachDiskInstanceSettings() { + return attachDiskInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to deleteInstance. + */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to deleteAccessConfigInstance. + */ + public UnaryCallSettings deleteAccessConfigInstanceSettings() { + return deleteAccessConfigInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to detachDiskInstance. + */ + public UnaryCallSettings detachDiskInstanceSettings() { + return detachDiskInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to getInstance. + */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to getSerialPortOutputInstance. + */ + public UnaryCallSettings getSerialPortOutputInstanceSettings() { + return getSerialPortOutputInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to insertInstance. + */ + public UnaryCallSettings insertInstanceSettings() { + return insertInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to listInstances. + */ + public PagedCallSettings listInstancesSettings() { + return listInstancesSettings; + } + + /** + * Returns the object with the settings used for calls to resetInstance. + */ + public UnaryCallSettings resetInstanceSettings() { + return resetInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setDiskAutoDeleteInstance. + */ + public UnaryCallSettings setDiskAutoDeleteInstanceSettings() { + return setDiskAutoDeleteInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setMachineTypeInstance. + */ + public UnaryCallSettings setMachineTypeInstanceSettings() { + return setMachineTypeInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setMetadataInstance. + */ + public UnaryCallSettings setMetadataInstanceSettings() { + return setMetadataInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setSchedulingInstance. + */ + public UnaryCallSettings setSchedulingInstanceSettings() { + return setSchedulingInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setServiceAccountInstance. + */ + public UnaryCallSettings setServiceAccountInstanceSettings() { + return setServiceAccountInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setTagsInstance. + */ + public UnaryCallSettings setTagsInstanceSettings() { + return setTagsInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to startInstance. + */ + public UnaryCallSettings startInstanceSettings() { + return startInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to startWithEncryptionKeyInstance. + */ + public UnaryCallSettings startWithEncryptionKeyInstanceSettings() { + return startWithEncryptionKeyInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to stopInstance. + */ + public UnaryCallSettings stopInstanceSettings() { + return stopInstanceSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInstanceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + addAccessConfigInstanceSettings = settingsBuilder.addAccessConfigInstanceSettings().build(); + aggregatedListInstancesSettings = settingsBuilder.aggregatedListInstancesSettings().build(); + attachDiskInstanceSettings = settingsBuilder.attachDiskInstanceSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteAccessConfigInstanceSettings = settingsBuilder.deleteAccessConfigInstanceSettings().build(); + detachDiskInstanceSettings = settingsBuilder.detachDiskInstanceSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + getSerialPortOutputInstanceSettings = settingsBuilder.getSerialPortOutputInstanceSettings().build(); + insertInstanceSettings = settingsBuilder.insertInstanceSettings().build(); + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + resetInstanceSettings = settingsBuilder.resetInstanceSettings().build(); + setDiskAutoDeleteInstanceSettings = settingsBuilder.setDiskAutoDeleteInstanceSettings().build(); + setMachineTypeInstanceSettings = settingsBuilder.setMachineTypeInstanceSettings().build(); + setMetadataInstanceSettings = settingsBuilder.setMetadataInstanceSettings().build(); + setSchedulingInstanceSettings = settingsBuilder.setSchedulingInstanceSettings().build(); + setServiceAccountInstanceSettings = settingsBuilder.setServiceAccountInstanceSettings().build(); + setTagsInstanceSettings = settingsBuilder.setTagsInstanceSettings().build(); + startInstanceSettings = settingsBuilder.startInstanceSettings().build(); + startWithEncryptionKeyInstanceSettings = settingsBuilder.startWithEncryptionKeyInstanceSettings().build(); + stopInstanceSettings = settingsBuilder.stopInstanceSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListInstancesHttpRequest injectToken(AggregatedListInstancesHttpRequest payload, String token) { + return AggregatedListInstancesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListInstancesHttpRequest injectPageSize(AggregatedListInstancesHttpRequest payload, int pageSize) { + return AggregatedListInstancesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListInstancesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInstancesHttpRequest injectToken(ListInstancesHttpRequest payload, String token) { + return ListInstancesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInstancesHttpRequest injectPageSize(ListInstancesHttpRequest payload, int pageSize) { + return ListInstancesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInstancesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListInstancesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC, request, context); + return AggregatedListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InstanceStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder addAccessConfigInstanceSettings; + private final PagedCallSettings.Builder aggregatedListInstancesSettings; + private final UnaryCallSettings.Builder attachDiskInstanceSettings; + private final UnaryCallSettings.Builder deleteInstanceSettings; + private final UnaryCallSettings.Builder deleteAccessConfigInstanceSettings; + private final UnaryCallSettings.Builder detachDiskInstanceSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder getSerialPortOutputInstanceSettings; + private final UnaryCallSettings.Builder insertInstanceSettings; + private final PagedCallSettings.Builder listInstancesSettings; + private final UnaryCallSettings.Builder resetInstanceSettings; + private final UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings; + private final UnaryCallSettings.Builder setMachineTypeInstanceSettings; + private final UnaryCallSettings.Builder setMetadataInstanceSettings; + private final UnaryCallSettings.Builder setSchedulingInstanceSettings; + private final UnaryCallSettings.Builder setServiceAccountInstanceSettings; + private final UnaryCallSettings.Builder setTagsInstanceSettings; + private final UnaryCallSettings.Builder startInstanceSettings; + private final UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings; + private final UnaryCallSettings.Builder stopInstanceSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + addAccessConfigInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + aggregatedListInstancesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT); + + attachDiskInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteAccessConfigInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + detachDiskInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSerialPortOutputInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInstancesSettings = PagedCallSettings.newBuilder( + LIST_INSTANCES_PAGE_STR_FACT); + + resetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setDiskAutoDeleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setMachineTypeInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setMetadataInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setSchedulingInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setServiceAccountInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setTagsInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + startInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + startWithEncryptionKeyInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + stopInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + addAccessConfigInstanceSettings, + aggregatedListInstancesSettings, + attachDiskInstanceSettings, + deleteInstanceSettings, + deleteAccessConfigInstanceSettings, + detachDiskInstanceSettings, + getInstanceSettings, + getSerialPortOutputInstanceSettings, + insertInstanceSettings, + listInstancesSettings, + resetInstanceSettings, + setDiskAutoDeleteInstanceSettings, + setMachineTypeInstanceSettings, + setMetadataInstanceSettings, + setSchedulingInstanceSettings, + setServiceAccountInstanceSettings, + setTagsInstanceSettings, + startInstanceSettings, + startWithEncryptionKeyInstanceSettings, + stopInstanceSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.addAccessConfigInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.aggregatedListInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.attachDiskInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteAccessConfigInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.detachDiskInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getSerialPortOutputInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.resetInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setDiskAutoDeleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setMachineTypeInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setMetadataInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setSchedulingInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setServiceAccountInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setTagsInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.startInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.startWithEncryptionKeyInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.stopInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InstanceStubSettings settings) { + super(settings); + + addAccessConfigInstanceSettings = settings.addAccessConfigInstanceSettings.toBuilder(); + aggregatedListInstancesSettings = settings.aggregatedListInstancesSettings.toBuilder(); + attachDiskInstanceSettings = settings.attachDiskInstanceSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteAccessConfigInstanceSettings = settings.deleteAccessConfigInstanceSettings.toBuilder(); + detachDiskInstanceSettings = settings.detachDiskInstanceSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + getSerialPortOutputInstanceSettings = settings.getSerialPortOutputInstanceSettings.toBuilder(); + insertInstanceSettings = settings.insertInstanceSettings.toBuilder(); + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + resetInstanceSettings = settings.resetInstanceSettings.toBuilder(); + setDiskAutoDeleteInstanceSettings = settings.setDiskAutoDeleteInstanceSettings.toBuilder(); + setMachineTypeInstanceSettings = settings.setMachineTypeInstanceSettings.toBuilder(); + setMetadataInstanceSettings = settings.setMetadataInstanceSettings.toBuilder(); + setSchedulingInstanceSettings = settings.setSchedulingInstanceSettings.toBuilder(); + setServiceAccountInstanceSettings = settings.setServiceAccountInstanceSettings.toBuilder(); + setTagsInstanceSettings = settings.setTagsInstanceSettings.toBuilder(); + startInstanceSettings = settings.startInstanceSettings.toBuilder(); + startWithEncryptionKeyInstanceSettings = settings.startWithEncryptionKeyInstanceSettings.toBuilder(); + stopInstanceSettings = settings.stopInstanceSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + addAccessConfigInstanceSettings, + aggregatedListInstancesSettings, + attachDiskInstanceSettings, + deleteInstanceSettings, + deleteAccessConfigInstanceSettings, + detachDiskInstanceSettings, + getInstanceSettings, + getSerialPortOutputInstanceSettings, + insertInstanceSettings, + listInstancesSettings, + resetInstanceSettings, + setDiskAutoDeleteInstanceSettings, + setMachineTypeInstanceSettings, + setMetadataInstanceSettings, + setSchedulingInstanceSettings, + setServiceAccountInstanceSettings, + setTagsInstanceSettings, + startInstanceSettings, + startWithEncryptionKeyInstanceSettings, + stopInstanceSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to addAccessConfigInstance. + */ + public UnaryCallSettings.Builder addAccessConfigInstanceSettings() { + return addAccessConfigInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInstances. + */ + public PagedCallSettings.Builder aggregatedListInstancesSettings() { + return aggregatedListInstancesSettings; + } + + /** + * Returns the builder for the settings used for calls to attachDiskInstance. + */ + public UnaryCallSettings.Builder attachDiskInstanceSettings() { + return attachDiskInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteInstance. + */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteAccessConfigInstance. + */ + public UnaryCallSettings.Builder deleteAccessConfigInstanceSettings() { + return deleteAccessConfigInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to detachDiskInstance. + */ + public UnaryCallSettings.Builder detachDiskInstanceSettings() { + return detachDiskInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to getInstance. + */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to getSerialPortOutputInstance. + */ + public UnaryCallSettings.Builder getSerialPortOutputInstanceSettings() { + return getSerialPortOutputInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to insertInstance. + */ + public UnaryCallSettings.Builder insertInstanceSettings() { + return insertInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to listInstances. + */ + public PagedCallSettings.Builder listInstancesSettings() { + return listInstancesSettings; + } + + /** + * Returns the builder for the settings used for calls to resetInstance. + */ + public UnaryCallSettings.Builder resetInstanceSettings() { + return resetInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. + */ + public UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings() { + return setDiskAutoDeleteInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setMachineTypeInstance. + */ + public UnaryCallSettings.Builder setMachineTypeInstanceSettings() { + return setMachineTypeInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setMetadataInstance. + */ + public UnaryCallSettings.Builder setMetadataInstanceSettings() { + return setMetadataInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setSchedulingInstance. + */ + public UnaryCallSettings.Builder setSchedulingInstanceSettings() { + return setSchedulingInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setServiceAccountInstance. + */ + public UnaryCallSettings.Builder setServiceAccountInstanceSettings() { + return setServiceAccountInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setTagsInstance. + */ + public UnaryCallSettings.Builder setTagsInstanceSettings() { + return setTagsInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to startInstance. + */ + public UnaryCallSettings.Builder startInstanceSettings() { + return startInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to startWithEncryptionKeyInstance. + */ + public UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings() { + return startWithEncryptionKeyInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to stopInstance. + */ + public UnaryCallSettings.Builder stopInstanceSettings() { + return stopInstanceSettings; + } + + @Override + public InstanceStubSettings build() throws IOException { + return new InstanceStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java new file mode 100644 index 000000000000..4f032e7eab27 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InstanceTemplate; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import com.google.cloud.compute.v1.InstanceTemplateList; +import com.google.cloud.compute.v1.InstanceTemplateName; +import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InstanceTemplateStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteInstanceTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceTemplateCallable()"); + } + + @BetaApi + public UnaryCallable getInstanceTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceTemplateCallable()"); + } + + @BetaApi + public UnaryCallable insertInstanceTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: insertInstanceTemplateCallable()"); + } + + @BetaApi + public UnaryCallable listInstanceTemplatesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstanceTemplatesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInstanceTemplatesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstanceTemplatesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java new file mode 100644 index 000000000000..aa06425baeb5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java @@ -0,0 +1,447 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.InstanceTemplate; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import com.google.cloud.compute.v1.InstanceTemplateList; +import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InstanceTemplateStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteInstanceTemplate to 30 seconds: + * + *

+ * 
+ * InstanceTemplateStubSettings.Builder instanceTemplateSettingsBuilder =
+ *     InstanceTemplateStubSettings.newBuilder();
+ * instanceTemplateSettingsBuilder.deleteInstanceTemplateSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InstanceTemplateStubSettings instanceTemplateSettings = instanceTemplateSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InstanceTemplateStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteInstanceTemplateSettings; + private final UnaryCallSettings getInstanceTemplateSettings; + private final UnaryCallSettings insertInstanceTemplateSettings; + private final PagedCallSettings listInstanceTemplatesSettings; + + /** + * Returns the object with the settings used for calls to deleteInstanceTemplate. + */ + public UnaryCallSettings deleteInstanceTemplateSettings() { + return deleteInstanceTemplateSettings; + } + + /** + * Returns the object with the settings used for calls to getInstanceTemplate. + */ + public UnaryCallSettings getInstanceTemplateSettings() { + return getInstanceTemplateSettings; + } + + /** + * Returns the object with the settings used for calls to insertInstanceTemplate. + */ + public UnaryCallSettings insertInstanceTemplateSettings() { + return insertInstanceTemplateSettings; + } + + /** + * Returns the object with the settings used for calls to listInstanceTemplates. + */ + public PagedCallSettings listInstanceTemplatesSettings() { + return listInstanceTemplatesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InstanceTemplateStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInstanceTemplateStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceTemplateStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InstanceTemplateStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteInstanceTemplateSettings = settingsBuilder.deleteInstanceTemplateSettings().build(); + getInstanceTemplateSettings = settingsBuilder.getInstanceTemplateSettings().build(); + insertInstanceTemplateSettings = settingsBuilder.insertInstanceTemplateSettings().build(); + listInstanceTemplatesSettings = settingsBuilder.listInstanceTemplatesSettings().build(); + } + + private static final PagedListDescriptor LIST_INSTANCE_TEMPLATES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInstanceTemplatesHttpRequest injectToken(ListInstanceTemplatesHttpRequest payload, String token) { + return ListInstanceTemplatesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInstanceTemplatesHttpRequest injectPageSize(ListInstanceTemplatesHttpRequest payload, int pageSize) { + return ListInstanceTemplatesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInstanceTemplatesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceTemplateList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceTemplateList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstanceTemplatesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCE_TEMPLATES_PAGE_STR_DESC, request, context); + return ListInstanceTemplatesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InstanceTemplateStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteInstanceTemplateSettings; + private final UnaryCallSettings.Builder getInstanceTemplateSettings; + private final UnaryCallSettings.Builder insertInstanceTemplateSettings; + private final PagedCallSettings.Builder listInstanceTemplatesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInstanceTemplatesSettings = PagedCallSettings.newBuilder( + LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteInstanceTemplateSettings, + getInstanceTemplateSettings, + insertInstanceTemplateSettings, + listInstanceTemplatesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteInstanceTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getInstanceTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertInstanceTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInstanceTemplatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InstanceTemplateStubSettings settings) { + super(settings); + + deleteInstanceTemplateSettings = settings.deleteInstanceTemplateSettings.toBuilder(); + getInstanceTemplateSettings = settings.getInstanceTemplateSettings.toBuilder(); + insertInstanceTemplateSettings = settings.insertInstanceTemplateSettings.toBuilder(); + listInstanceTemplatesSettings = settings.listInstanceTemplatesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteInstanceTemplateSettings, + getInstanceTemplateSettings, + insertInstanceTemplateSettings, + listInstanceTemplatesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteInstanceTemplate. + */ + public UnaryCallSettings.Builder deleteInstanceTemplateSettings() { + return deleteInstanceTemplateSettings; + } + + /** + * Returns the builder for the settings used for calls to getInstanceTemplate. + */ + public UnaryCallSettings.Builder getInstanceTemplateSettings() { + return getInstanceTemplateSettings; + } + + /** + * Returns the builder for the settings used for calls to insertInstanceTemplate. + */ + public UnaryCallSettings.Builder insertInstanceTemplateSettings() { + return insertInstanceTemplateSettings; + } + + /** + * Returns the builder for the settings used for calls to listInstanceTemplates. + */ + public PagedCallSettings.Builder listInstanceTemplatesSettings() { + return listInstanceTemplatesSettings; + } + + @Override + public InstanceTemplateStubSettings build() throws IOException { + return new InstanceTemplateStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java new file mode 100644 index 000000000000..fd2e8befec1f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.GetLicensHttpRequest; +import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicenseName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class LicensStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getLicensCallable() { + throw new UnsupportedOperationException("Not implemented: getLicensCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java new file mode 100644 index 000000000000..c14d7f1bf921 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetLicensHttpRequest; +import com.google.cloud.compute.v1.License; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LicensStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getLicens to 30 seconds: + * + *

+ * 
+ * LicensStubSettings.Builder licensSettingsBuilder =
+ *     LicensStubSettings.newBuilder();
+ * licensSettingsBuilder.getLicensSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LicensStubSettings licensSettings = licensSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicensStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getLicensSettings; + + /** + * Returns the object with the settings used for calls to getLicens. + */ + public UnaryCallSettings getLicensSettings() { + return getLicensSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LicensStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonLicensStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LicensStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LicensStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getLicensSettings = settingsBuilder.getLicensSettings().build(); + } + + + + + /** + * Builder for LicensStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getLicensSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getLicensSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getLicensSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getLicensSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(LicensStubSettings settings) { + super(settings); + + getLicensSettings = settings.getLicensSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getLicensSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getLicens. + */ + public UnaryCallSettings.Builder getLicensSettings() { + return getLicensSettings; + } + + @Override + public LicensStubSettings build() throws IOException { + return new LicensStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java new file mode 100644 index 000000000000..4c6e9eed2a9f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java @@ -0,0 +1,71 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.GetMachineTypeHttpRequest; +import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.MachineType; +import com.google.cloud.compute.v1.MachineTypeAggregatedList; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import com.google.cloud.compute.v1.MachineTypeList; +import com.google.cloud.compute.v1.MachineTypeName; +import com.google.cloud.compute.v1.MachineTypesScopedList; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class MachineTypeStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListMachineTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListMachineTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListMachineTypesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListMachineTypesCallable()"); + } + + @BetaApi + public UnaryCallable getMachineTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getMachineTypeCallable()"); + } + + @BetaApi + public UnaryCallable listMachineTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listMachineTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listMachineTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listMachineTypesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java new file mode 100644 index 000000000000..25a27e59ce31 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java @@ -0,0 +1,471 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.GetMachineTypeHttpRequest; +import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; +import com.google.cloud.compute.v1.MachineType; +import com.google.cloud.compute.v1.MachineTypeAggregatedList; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import com.google.cloud.compute.v1.MachineTypeList; +import com.google.cloud.compute.v1.MachineTypesScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link MachineTypeStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getMachineType to 30 seconds: + * + *

+ * 
+ * MachineTypeStubSettings.Builder machineTypeSettingsBuilder =
+ *     MachineTypeStubSettings.newBuilder();
+ * machineTypeSettingsBuilder.getMachineTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * MachineTypeStubSettings machineTypeSettings = machineTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class MachineTypeStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListMachineTypesSettings; + private final UnaryCallSettings getMachineTypeSettings; + private final PagedCallSettings listMachineTypesSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListMachineTypes. + */ + public PagedCallSettings aggregatedListMachineTypesSettings() { + return aggregatedListMachineTypesSettings; + } + + /** + * Returns the object with the settings used for calls to getMachineType. + */ + public UnaryCallSettings getMachineTypeSettings() { + return getMachineTypeSettings; + } + + /** + * Returns the object with the settings used for calls to listMachineTypes. + */ + public PagedCallSettings listMachineTypesSettings() { + return listMachineTypesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public MachineTypeStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMachineTypeStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MachineTypeStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MachineTypeStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListMachineTypesSettings = settingsBuilder.aggregatedListMachineTypesSettings().build(); + getMachineTypeSettings = settingsBuilder.getMachineTypeSettings().build(); + listMachineTypesSettings = settingsBuilder.listMachineTypesSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListMachineTypesHttpRequest injectToken(AggregatedListMachineTypesHttpRequest payload, String token) { + return AggregatedListMachineTypesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListMachineTypesHttpRequest injectPageSize(AggregatedListMachineTypesHttpRequest payload, int pageSize) { + return AggregatedListMachineTypesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListMachineTypesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(MachineTypeAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(MachineTypeAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_MACHINE_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListMachineTypesHttpRequest injectToken(ListMachineTypesHttpRequest payload, String token) { + return ListMachineTypesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListMachineTypesHttpRequest injectPageSize(ListMachineTypesHttpRequest payload, int pageSize) { + return ListMachineTypesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListMachineTypesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(MachineTypeList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(MachineTypeList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListMachineTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_DESC, request, context); + return AggregatedListMachineTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_MACHINE_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListMachineTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MACHINE_TYPES_PAGE_STR_DESC, request, context); + return ListMachineTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for MachineTypeStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListMachineTypesSettings; + private final UnaryCallSettings.Builder getMachineTypeSettings; + private final PagedCallSettings.Builder listMachineTypesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListMachineTypesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_FACT); + + getMachineTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listMachineTypesSettings = PagedCallSettings.newBuilder( + LIST_MACHINE_TYPES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListMachineTypesSettings, + getMachineTypeSettings, + listMachineTypesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListMachineTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getMachineTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listMachineTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(MachineTypeStubSettings settings) { + super(settings); + + aggregatedListMachineTypesSettings = settings.aggregatedListMachineTypesSettings.toBuilder(); + getMachineTypeSettings = settings.getMachineTypeSettings.toBuilder(); + listMachineTypesSettings = settings.listMachineTypesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListMachineTypesSettings, + getMachineTypeSettings, + listMachineTypesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListMachineTypes. + */ + public PagedCallSettings.Builder aggregatedListMachineTypesSettings() { + return aggregatedListMachineTypesSettings; + } + + /** + * Returns the builder for the settings used for calls to getMachineType. + */ + public UnaryCallSettings.Builder getMachineTypeSettings() { + return getMachineTypeSettings; + } + + /** + * Returns the builder for the settings used for calls to listMachineTypes. + */ + public PagedCallSettings.Builder listMachineTypesSettings() { + return listMachineTypesSettings; + } + + @Override + public MachineTypeStubSettings build() throws IOException { + return new MachineTypeStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java new file mode 100644 index 000000000000..cf84117b76c5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java @@ -0,0 +1,75 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; +import com.google.cloud.compute.v1.GetNetworkHttpRequest; +import com.google.cloud.compute.v1.InsertNetworkHttpRequest; +import com.google.cloud.compute.v1.ListNetworksHttpRequest; +import com.google.cloud.compute.v1.Network; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import com.google.cloud.compute.v1.NetworkList; +import com.google.cloud.compute.v1.NetworkName; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class NetworkStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNetworkCallable()"); + } + + @BetaApi + public UnaryCallable getNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: getNetworkCallable()"); + } + + @BetaApi + public UnaryCallable insertNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: insertNetworkCallable()"); + } + + @BetaApi + public UnaryCallable listNetworksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNetworksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listNetworksCallable() { + throw new UnsupportedOperationException("Not implemented: listNetworksCallable()"); + } + + @BetaApi + public UnaryCallable switchToCustomModeNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: switchToCustomModeNetworkCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java new file mode 100644 index 000000000000..9c6fbe709267 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java @@ -0,0 +1,474 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; +import com.google.cloud.compute.v1.GetNetworkHttpRequest; +import com.google.cloud.compute.v1.InsertNetworkHttpRequest; +import com.google.cloud.compute.v1.ListNetworksHttpRequest; +import com.google.cloud.compute.v1.Network; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import com.google.cloud.compute.v1.NetworkList; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NetworkStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteNetwork to 30 seconds: + * + *

+ * 
+ * NetworkStubSettings.Builder networkSettingsBuilder =
+ *     NetworkStubSettings.newBuilder();
+ * networkSettingsBuilder.deleteNetworkSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NetworkStubSettings networkSettings = networkSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class NetworkStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteNetworkSettings; + private final UnaryCallSettings getNetworkSettings; + private final UnaryCallSettings insertNetworkSettings; + private final PagedCallSettings listNetworksSettings; + private final UnaryCallSettings switchToCustomModeNetworkSettings; + + /** + * Returns the object with the settings used for calls to deleteNetwork. + */ + public UnaryCallSettings deleteNetworkSettings() { + return deleteNetworkSettings; + } + + /** + * Returns the object with the settings used for calls to getNetwork. + */ + public UnaryCallSettings getNetworkSettings() { + return getNetworkSettings; + } + + /** + * Returns the object with the settings used for calls to insertNetwork. + */ + public UnaryCallSettings insertNetworkSettings() { + return insertNetworkSettings; + } + + /** + * Returns the object with the settings used for calls to listNetworks. + */ + public PagedCallSettings listNetworksSettings() { + return listNetworksSettings; + } + + /** + * Returns the object with the settings used for calls to switchToCustomModeNetwork. + */ + public UnaryCallSettings switchToCustomModeNetworkSettings() { + return switchToCustomModeNetworkSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NetworkStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonNetworkStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(NetworkStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NetworkStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteNetworkSettings = settingsBuilder.deleteNetworkSettings().build(); + getNetworkSettings = settingsBuilder.getNetworkSettings().build(); + insertNetworkSettings = settingsBuilder.insertNetworkSettings().build(); + listNetworksSettings = settingsBuilder.listNetworksSettings().build(); + switchToCustomModeNetworkSettings = settingsBuilder.switchToCustomModeNetworkSettings().build(); + } + + private static final PagedListDescriptor LIST_NETWORKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListNetworksHttpRequest injectToken(ListNetworksHttpRequest payload, String token) { + return ListNetworksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListNetworksHttpRequest injectPageSize(ListNetworksHttpRequest payload, int pageSize) { + return ListNetworksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListNetworksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(NetworkList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(NetworkList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_NETWORKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNetworksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NETWORKS_PAGE_STR_DESC, request, context); + return ListNetworksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for NetworkStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteNetworkSettings; + private final UnaryCallSettings.Builder getNetworkSettings; + private final UnaryCallSettings.Builder insertNetworkSettings; + private final PagedCallSettings.Builder listNetworksSettings; + private final UnaryCallSettings.Builder switchToCustomModeNetworkSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNetworksSettings = PagedCallSettings.newBuilder( + LIST_NETWORKS_PAGE_STR_FACT); + + switchToCustomModeNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteNetworkSettings, + getNetworkSettings, + insertNetworkSettings, + listNetworksSettings, + switchToCustomModeNetworkSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteNetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getNetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertNetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listNetworksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.switchToCustomModeNetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(NetworkStubSettings settings) { + super(settings); + + deleteNetworkSettings = settings.deleteNetworkSettings.toBuilder(); + getNetworkSettings = settings.getNetworkSettings.toBuilder(); + insertNetworkSettings = settings.insertNetworkSettings.toBuilder(); + listNetworksSettings = settings.listNetworksSettings.toBuilder(); + switchToCustomModeNetworkSettings = settings.switchToCustomModeNetworkSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteNetworkSettings, + getNetworkSettings, + insertNetworkSettings, + listNetworksSettings, + switchToCustomModeNetworkSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteNetwork. + */ + public UnaryCallSettings.Builder deleteNetworkSettings() { + return deleteNetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to getNetwork. + */ + public UnaryCallSettings.Builder getNetworkSettings() { + return getNetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to insertNetwork. + */ + public UnaryCallSettings.Builder insertNetworkSettings() { + return insertNetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to listNetworks. + */ + public PagedCallSettings.Builder listNetworksSettings() { + return listNetworksSettings; + } + + /** + * Returns the builder for the settings used for calls to switchToCustomModeNetwork. + */ + public UnaryCallSettings.Builder switchToCustomModeNetworkSettings() { + return switchToCustomModeNetworkSettings; + } + + @Override + public NetworkStubSettings build() throws IOException { + return new NetworkStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java new file mode 100644 index 000000000000..9aa6c3302f58 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java @@ -0,0 +1,71 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DiskMoveRequest; +import com.google.cloud.compute.v1.GetProjectHttpRequest; +import com.google.cloud.compute.v1.InstanceMoveRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; +import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Project; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; +import com.google.cloud.compute.v1.UsageExportLocation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ProjectStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getProjectCallable() { + throw new UnsupportedOperationException("Not implemented: getProjectCallable()"); + } + + @BetaApi + public UnaryCallable moveDiskProjectCallable() { + throw new UnsupportedOperationException("Not implemented: moveDiskProjectCallable()"); + } + + @BetaApi + public UnaryCallable moveInstanceProjectCallable() { + throw new UnsupportedOperationException("Not implemented: moveInstanceProjectCallable()"); + } + + @BetaApi + public UnaryCallable setCommonInstanceMetadataProjectCallable() { + throw new UnsupportedOperationException("Not implemented: setCommonInstanceMetadataProjectCallable()"); + } + + @BetaApi + public UnaryCallable setUsageExportBucketProjectCallable() { + throw new UnsupportedOperationException("Not implemented: setUsageExportBucketProjectCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java new file mode 100644 index 000000000000..d468b27cb4a0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java @@ -0,0 +1,418 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetProjectHttpRequest; +import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; +import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Project; +import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ProjectStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getProject to 30 seconds: + * + *

+ * 
+ * ProjectStubSettings.Builder projectSettingsBuilder =
+ *     ProjectStubSettings.newBuilder();
+ * projectSettingsBuilder.getProjectSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ProjectStubSettings projectSettings = projectSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ProjectStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getProjectSettings; + private final UnaryCallSettings moveDiskProjectSettings; + private final UnaryCallSettings moveInstanceProjectSettings; + private final UnaryCallSettings setCommonInstanceMetadataProjectSettings; + private final UnaryCallSettings setUsageExportBucketProjectSettings; + + /** + * Returns the object with the settings used for calls to getProject. + */ + public UnaryCallSettings getProjectSettings() { + return getProjectSettings; + } + + /** + * Returns the object with the settings used for calls to moveDiskProject. + */ + public UnaryCallSettings moveDiskProjectSettings() { + return moveDiskProjectSettings; + } + + /** + * Returns the object with the settings used for calls to moveInstanceProject. + */ + public UnaryCallSettings moveInstanceProjectSettings() { + return moveInstanceProjectSettings; + } + + /** + * Returns the object with the settings used for calls to setCommonInstanceMetadataProject. + */ + public UnaryCallSettings setCommonInstanceMetadataProjectSettings() { + return setCommonInstanceMetadataProjectSettings; + } + + /** + * Returns the object with the settings used for calls to setUsageExportBucketProject. + */ + public UnaryCallSettings setUsageExportBucketProjectSettings() { + return setUsageExportBucketProjectSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ProjectStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonProjectStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ProjectStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ProjectStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getProjectSettings = settingsBuilder.getProjectSettings().build(); + moveDiskProjectSettings = settingsBuilder.moveDiskProjectSettings().build(); + moveInstanceProjectSettings = settingsBuilder.moveInstanceProjectSettings().build(); + setCommonInstanceMetadataProjectSettings = settingsBuilder.setCommonInstanceMetadataProjectSettings().build(); + setUsageExportBucketProjectSettings = settingsBuilder.setUsageExportBucketProjectSettings().build(); + } + + + + + /** + * Builder for ProjectStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getProjectSettings; + private final UnaryCallSettings.Builder moveDiskProjectSettings; + private final UnaryCallSettings.Builder moveInstanceProjectSettings; + private final UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings; + private final UnaryCallSettings.Builder setUsageExportBucketProjectSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + moveDiskProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + moveInstanceProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setCommonInstanceMetadataProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setUsageExportBucketProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getProjectSettings, + moveDiskProjectSettings, + moveInstanceProjectSettings, + setCommonInstanceMetadataProjectSettings, + setUsageExportBucketProjectSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.moveDiskProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.moveInstanceProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setCommonInstanceMetadataProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setUsageExportBucketProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ProjectStubSettings settings) { + super(settings); + + getProjectSettings = settings.getProjectSettings.toBuilder(); + moveDiskProjectSettings = settings.moveDiskProjectSettings.toBuilder(); + moveInstanceProjectSettings = settings.moveInstanceProjectSettings.toBuilder(); + setCommonInstanceMetadataProjectSettings = settings.setCommonInstanceMetadataProjectSettings.toBuilder(); + setUsageExportBucketProjectSettings = settings.setUsageExportBucketProjectSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getProjectSettings, + moveDiskProjectSettings, + moveInstanceProjectSettings, + setCommonInstanceMetadataProjectSettings, + setUsageExportBucketProjectSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getProject. + */ + public UnaryCallSettings.Builder getProjectSettings() { + return getProjectSettings; + } + + /** + * Returns the builder for the settings used for calls to moveDiskProject. + */ + public UnaryCallSettings.Builder moveDiskProjectSettings() { + return moveDiskProjectSettings; + } + + /** + * Returns the builder for the settings used for calls to moveInstanceProject. + */ + public UnaryCallSettings.Builder moveInstanceProjectSettings() { + return moveInstanceProjectSettings; + } + + /** + * Returns the builder for the settings used for calls to setCommonInstanceMetadataProject. + */ + public UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings() { + return setCommonInstanceMetadataProjectSettings; + } + + /** + * Returns the builder for the settings used for calls to setUsageExportBucketProject. + */ + public UnaryCallSettings.Builder setUsageExportBucketProjectSettings() { + return setUsageExportBucketProjectSettings; + } + + @Override + public ProjectStubSettings build() throws IOException { + return new ProjectStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java new file mode 100644 index 000000000000..55a020e5e644 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.DeleteRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionAutoscalerName; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import com.google.cloud.compute.v1.RegionAutoscalerList; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionAutoscalerStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteRegionAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRegionAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable getRegionAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable insertRegionAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: insertRegionAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable listRegionAutoscalersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionAutoscalersPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionAutoscalersCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionAutoscalersCallable()"); + } + + @BetaApi + public UnaryCallable patchRegionAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: patchRegionAutoscalerCallable()"); + } + + @BetaApi + public UnaryCallable updateRegionAutoscalerCallable() { + throw new UnsupportedOperationException("Not implemented: updateRegionAutoscalerCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java new file mode 100644 index 000000000000..64d30f536338 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.Autoscaler; +import com.google.cloud.compute.v1.DeleteRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.GetRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionAutoscalerHttpRequest; +import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import com.google.cloud.compute.v1.RegionAutoscalerList; +import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionAutoscalerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRegionAutoscaler to 30 seconds: + * + *

+ * 
+ * RegionAutoscalerStubSettings.Builder regionAutoscalerSettingsBuilder =
+ *     RegionAutoscalerStubSettings.newBuilder();
+ * regionAutoscalerSettingsBuilder.deleteRegionAutoscalerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionAutoscalerStubSettings regionAutoscalerSettings = regionAutoscalerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionAutoscalerStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteRegionAutoscalerSettings; + private final UnaryCallSettings getRegionAutoscalerSettings; + private final UnaryCallSettings insertRegionAutoscalerSettings; + private final PagedCallSettings listRegionAutoscalersSettings; + private final UnaryCallSettings patchRegionAutoscalerSettings; + private final UnaryCallSettings updateRegionAutoscalerSettings; + + /** + * Returns the object with the settings used for calls to deleteRegionAutoscaler. + */ + public UnaryCallSettings deleteRegionAutoscalerSettings() { + return deleteRegionAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to getRegionAutoscaler. + */ + public UnaryCallSettings getRegionAutoscalerSettings() { + return getRegionAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to insertRegionAutoscaler. + */ + public UnaryCallSettings insertRegionAutoscalerSettings() { + return insertRegionAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to listRegionAutoscalers. + */ + public PagedCallSettings listRegionAutoscalersSettings() { + return listRegionAutoscalersSettings; + } + + /** + * Returns the object with the settings used for calls to patchRegionAutoscaler. + */ + public UnaryCallSettings patchRegionAutoscalerSettings() { + return patchRegionAutoscalerSettings; + } + + /** + * Returns the object with the settings used for calls to updateRegionAutoscaler. + */ + public UnaryCallSettings updateRegionAutoscalerSettings() { + return updateRegionAutoscalerSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionAutoscalerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionAutoscalerStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionAutoscalerStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionAutoscalerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteRegionAutoscalerSettings = settingsBuilder.deleteRegionAutoscalerSettings().build(); + getRegionAutoscalerSettings = settingsBuilder.getRegionAutoscalerSettings().build(); + insertRegionAutoscalerSettings = settingsBuilder.insertRegionAutoscalerSettings().build(); + listRegionAutoscalersSettings = settingsBuilder.listRegionAutoscalersSettings().build(); + patchRegionAutoscalerSettings = settingsBuilder.patchRegionAutoscalerSettings().build(); + updateRegionAutoscalerSettings = settingsBuilder.updateRegionAutoscalerSettings().build(); + } + + private static final PagedListDescriptor LIST_REGION_AUTOSCALERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionAutoscalersHttpRequest injectToken(ListRegionAutoscalersHttpRequest payload, String token) { + return ListRegionAutoscalersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionAutoscalersHttpRequest injectPageSize(ListRegionAutoscalersHttpRequest payload, int pageSize) { + return ListRegionAutoscalersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionAutoscalersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RegionAutoscalerList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RegionAutoscalerList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_REGION_AUTOSCALERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionAutoscalersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_AUTOSCALERS_PAGE_STR_DESC, request, context); + return ListRegionAutoscalersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionAutoscalerStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteRegionAutoscalerSettings; + private final UnaryCallSettings.Builder getRegionAutoscalerSettings; + private final UnaryCallSettings.Builder insertRegionAutoscalerSettings; + private final PagedCallSettings.Builder listRegionAutoscalersSettings; + private final UnaryCallSettings.Builder patchRegionAutoscalerSettings; + private final UnaryCallSettings.Builder updateRegionAutoscalerSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionAutoscalersSettings = PagedCallSettings.newBuilder( + LIST_REGION_AUTOSCALERS_PAGE_STR_FACT); + + patchRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRegionAutoscalerSettings, + getRegionAutoscalerSettings, + insertRegionAutoscalerSettings, + listRegionAutoscalersSettings, + patchRegionAutoscalerSettings, + updateRegionAutoscalerSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteRegionAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRegionAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertRegionAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionAutoscalersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchRegionAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateRegionAutoscalerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionAutoscalerStubSettings settings) { + super(settings); + + deleteRegionAutoscalerSettings = settings.deleteRegionAutoscalerSettings.toBuilder(); + getRegionAutoscalerSettings = settings.getRegionAutoscalerSettings.toBuilder(); + insertRegionAutoscalerSettings = settings.insertRegionAutoscalerSettings.toBuilder(); + listRegionAutoscalersSettings = settings.listRegionAutoscalersSettings.toBuilder(); + patchRegionAutoscalerSettings = settings.patchRegionAutoscalerSettings.toBuilder(); + updateRegionAutoscalerSettings = settings.updateRegionAutoscalerSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRegionAutoscalerSettings, + getRegionAutoscalerSettings, + insertRegionAutoscalerSettings, + listRegionAutoscalersSettings, + patchRegionAutoscalerSettings, + updateRegionAutoscalerSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionAutoscaler. + */ + public UnaryCallSettings.Builder deleteRegionAutoscalerSettings() { + return deleteRegionAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to getRegionAutoscaler. + */ + public UnaryCallSettings.Builder getRegionAutoscalerSettings() { + return getRegionAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to insertRegionAutoscaler. + */ + public UnaryCallSettings.Builder insertRegionAutoscalerSettings() { + return insertRegionAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegionAutoscalers. + */ + public PagedCallSettings.Builder listRegionAutoscalersSettings() { + return listRegionAutoscalersSettings; + } + + /** + * Returns the builder for the settings used for calls to patchRegionAutoscaler. + */ + public UnaryCallSettings.Builder patchRegionAutoscalerSettings() { + return patchRegionAutoscalerSettings; + } + + /** + * Returns the builder for the settings used for calls to updateRegionAutoscaler. + */ + public UnaryCallSettings.Builder updateRegionAutoscalerSettings() { + return updateRegionAutoscalerSettings; + } + + @Override + public RegionAutoscalerStubSettings build() throws IOException { + return new RegionAutoscalerStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java new file mode 100644 index 000000000000..0091d8b00605 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java @@ -0,0 +1,89 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionBackendServiceStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteRegionBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRegionBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable getRegionBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable getHealthRegionBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: getHealthRegionBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable insertRegionBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: insertRegionBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable listRegionBackendServicesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionBackendServicesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionBackendServicesCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionBackendServicesCallable()"); + } + + @BetaApi + public UnaryCallable patchRegionBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: patchRegionBackendServiceCallable()"); + } + + @BetaApi + public UnaryCallable updateRegionBackendServiceCallable() { + throw new UnsupportedOperationException("Not implemented: updateRegionBackendServiceCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java new file mode 100644 index 000000000000..8955b0c0e072 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java @@ -0,0 +1,529 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionBackendServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRegionBackendService to 30 seconds: + * + *

+ * 
+ * RegionBackendServiceStubSettings.Builder regionBackendServiceSettingsBuilder =
+ *     RegionBackendServiceStubSettings.newBuilder();
+ * regionBackendServiceSettingsBuilder.deleteRegionBackendServiceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionBackendServiceStubSettings regionBackendServiceSettings = regionBackendServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionBackendServiceStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteRegionBackendServiceSettings; + private final UnaryCallSettings getRegionBackendServiceSettings; + private final UnaryCallSettings getHealthRegionBackendServiceSettings; + private final UnaryCallSettings insertRegionBackendServiceSettings; + private final PagedCallSettings listRegionBackendServicesSettings; + private final UnaryCallSettings patchRegionBackendServiceSettings; + private final UnaryCallSettings updateRegionBackendServiceSettings; + + /** + * Returns the object with the settings used for calls to deleteRegionBackendService. + */ + public UnaryCallSettings deleteRegionBackendServiceSettings() { + return deleteRegionBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to getRegionBackendService. + */ + public UnaryCallSettings getRegionBackendServiceSettings() { + return getRegionBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to getHealthRegionBackendService. + */ + public UnaryCallSettings getHealthRegionBackendServiceSettings() { + return getHealthRegionBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to insertRegionBackendService. + */ + public UnaryCallSettings insertRegionBackendServiceSettings() { + return insertRegionBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to listRegionBackendServices. + */ + public PagedCallSettings listRegionBackendServicesSettings() { + return listRegionBackendServicesSettings; + } + + /** + * Returns the object with the settings used for calls to patchRegionBackendService. + */ + public UnaryCallSettings patchRegionBackendServiceSettings() { + return patchRegionBackendServiceSettings; + } + + /** + * Returns the object with the settings used for calls to updateRegionBackendService. + */ + public UnaryCallSettings updateRegionBackendServiceSettings() { + return updateRegionBackendServiceSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionBackendServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionBackendServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionBackendServiceStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionBackendServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteRegionBackendServiceSettings = settingsBuilder.deleteRegionBackendServiceSettings().build(); + getRegionBackendServiceSettings = settingsBuilder.getRegionBackendServiceSettings().build(); + getHealthRegionBackendServiceSettings = settingsBuilder.getHealthRegionBackendServiceSettings().build(); + insertRegionBackendServiceSettings = settingsBuilder.insertRegionBackendServiceSettings().build(); + listRegionBackendServicesSettings = settingsBuilder.listRegionBackendServicesSettings().build(); + patchRegionBackendServiceSettings = settingsBuilder.patchRegionBackendServiceSettings().build(); + updateRegionBackendServiceSettings = settingsBuilder.updateRegionBackendServiceSettings().build(); + } + + private static final PagedListDescriptor LIST_REGION_BACKEND_SERVICES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionBackendServicesHttpRequest injectToken(ListRegionBackendServicesHttpRequest payload, String token) { + return ListRegionBackendServicesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionBackendServicesHttpRequest injectPageSize(ListRegionBackendServicesHttpRequest payload, int pageSize) { + return ListRegionBackendServicesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionBackendServicesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(BackendServiceList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(BackendServiceList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_REGION_BACKEND_SERVICES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionBackendServicesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_BACKEND_SERVICES_PAGE_STR_DESC, request, context); + return ListRegionBackendServicesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionBackendServiceStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteRegionBackendServiceSettings; + private final UnaryCallSettings.Builder getRegionBackendServiceSettings; + private final UnaryCallSettings.Builder getHealthRegionBackendServiceSettings; + private final UnaryCallSettings.Builder insertRegionBackendServiceSettings; + private final PagedCallSettings.Builder listRegionBackendServicesSettings; + private final UnaryCallSettings.Builder patchRegionBackendServiceSettings; + private final UnaryCallSettings.Builder updateRegionBackendServiceSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getHealthRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionBackendServicesSettings = PagedCallSettings.newBuilder( + LIST_REGION_BACKEND_SERVICES_PAGE_STR_FACT); + + patchRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRegionBackendServiceSettings, + getRegionBackendServiceSettings, + getHealthRegionBackendServiceSettings, + insertRegionBackendServiceSettings, + listRegionBackendServicesSettings, + patchRegionBackendServiceSettings, + updateRegionBackendServiceSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteRegionBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRegionBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getHealthRegionBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertRegionBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionBackendServicesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchRegionBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateRegionBackendServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionBackendServiceStubSettings settings) { + super(settings); + + deleteRegionBackendServiceSettings = settings.deleteRegionBackendServiceSettings.toBuilder(); + getRegionBackendServiceSettings = settings.getRegionBackendServiceSettings.toBuilder(); + getHealthRegionBackendServiceSettings = settings.getHealthRegionBackendServiceSettings.toBuilder(); + insertRegionBackendServiceSettings = settings.insertRegionBackendServiceSettings.toBuilder(); + listRegionBackendServicesSettings = settings.listRegionBackendServicesSettings.toBuilder(); + patchRegionBackendServiceSettings = settings.patchRegionBackendServiceSettings.toBuilder(); + updateRegionBackendServiceSettings = settings.updateRegionBackendServiceSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRegionBackendServiceSettings, + getRegionBackendServiceSettings, + getHealthRegionBackendServiceSettings, + insertRegionBackendServiceSettings, + listRegionBackendServicesSettings, + patchRegionBackendServiceSettings, + updateRegionBackendServiceSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionBackendService. + */ + public UnaryCallSettings.Builder deleteRegionBackendServiceSettings() { + return deleteRegionBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to getRegionBackendService. + */ + public UnaryCallSettings.Builder getRegionBackendServiceSettings() { + return getRegionBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to getHealthRegionBackendService. + */ + public UnaryCallSettings.Builder getHealthRegionBackendServiceSettings() { + return getHealthRegionBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to insertRegionBackendService. + */ + public UnaryCallSettings.Builder insertRegionBackendServiceSettings() { + return insertRegionBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegionBackendServices. + */ + public PagedCallSettings.Builder listRegionBackendServicesSettings() { + return listRegionBackendServicesSettings; + } + + /** + * Returns the builder for the settings used for calls to patchRegionBackendService. + */ + public UnaryCallSettings.Builder patchRegionBackendServiceSettings() { + return patchRegionBackendServiceSettings; + } + + /** + * Returns the builder for the settings used for calls to updateRegionBackendService. + */ + public UnaryCallSettings.Builder updateRegionBackendServiceSettings() { + return updateRegionBackendServiceSettings; + } + + @Override + public RegionBackendServiceStubSettings build() throws IOException { + return new RegionBackendServiceStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java new file mode 100644 index 000000000000..9d29fe290b05 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java @@ -0,0 +1,117 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; +import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionInstanceGroupManagerStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: abandonInstancesRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable deleteRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstancesRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable getRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable insertRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: insertRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupManagersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupManagersPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupManagersCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupManagersCallable()"); + } + + @BetaApi + public UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { + throw new UnsupportedOperationException("Not implemented: listManagedInstancesRegionInstanceGroupManagersCallable()"); + } + + @BetaApi + public UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: recreateInstancesRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable resizeRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: resizeRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: setInstanceTemplateRegionInstanceGroupManagerCallable()"); + } + + @BetaApi + public UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: setTargetPoolsRegionInstanceGroupManagerCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java new file mode 100644 index 000000000000..acfde157e4ec --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java @@ -0,0 +1,637 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.GetRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InsertRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.InstanceGroupManager; +import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; +import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; +import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; +import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionInstanceGroupManagerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of abandonInstancesRegionInstanceGroupManager to 30 seconds: + * + *

+ * 
+ * RegionInstanceGroupManagerStubSettings.Builder regionInstanceGroupManagerSettingsBuilder =
+ *     RegionInstanceGroupManagerStubSettings.newBuilder();
+ * regionInstanceGroupManagerSettingsBuilder.abandonInstancesRegionInstanceGroupManagerSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionInstanceGroupManagerStubSettings regionInstanceGroupManagerSettings = regionInstanceGroupManagerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionInstanceGroupManagerStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings abandonInstancesRegionInstanceGroupManagerSettings; + private final UnaryCallSettings deleteRegionInstanceGroupManagerSettings; + private final UnaryCallSettings deleteInstancesRegionInstanceGroupManagerSettings; + private final UnaryCallSettings getRegionInstanceGroupManagerSettings; + private final UnaryCallSettings insertRegionInstanceGroupManagerSettings; + private final PagedCallSettings listRegionInstanceGroupManagersSettings; + private final UnaryCallSettings listManagedInstancesRegionInstanceGroupManagersSettings; + private final UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings; + private final UnaryCallSettings resizeRegionInstanceGroupManagerSettings; + private final UnaryCallSettings setInstanceTemplateRegionInstanceGroupManagerSettings; + private final UnaryCallSettings setTargetPoolsRegionInstanceGroupManagerSettings; + + /** + * Returns the object with the settings used for calls to abandonInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings abandonInstancesRegionInstanceGroupManagerSettings() { + return abandonInstancesRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to deleteRegionInstanceGroupManager. + */ + public UnaryCallSettings deleteRegionInstanceGroupManagerSettings() { + return deleteRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to deleteInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings deleteInstancesRegionInstanceGroupManagerSettings() { + return deleteInstancesRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to getRegionInstanceGroupManager. + */ + public UnaryCallSettings getRegionInstanceGroupManagerSettings() { + return getRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to insertRegionInstanceGroupManager. + */ + public UnaryCallSettings insertRegionInstanceGroupManagerSettings() { + return insertRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to listRegionInstanceGroupManagers. + */ + public PagedCallSettings listRegionInstanceGroupManagersSettings() { + return listRegionInstanceGroupManagersSettings; + } + + /** + * Returns the object with the settings used for calls to listManagedInstancesRegionInstanceGroupManagers. + */ + public UnaryCallSettings listManagedInstancesRegionInstanceGroupManagersSettings() { + return listManagedInstancesRegionInstanceGroupManagersSettings; + } + + /** + * Returns the object with the settings used for calls to recreateInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings() { + return recreateInstancesRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to resizeRegionInstanceGroupManager. + */ + public UnaryCallSettings resizeRegionInstanceGroupManagerSettings() { + return resizeRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to setInstanceTemplateRegionInstanceGroupManager. + */ + public UnaryCallSettings setInstanceTemplateRegionInstanceGroupManagerSettings() { + return setInstanceTemplateRegionInstanceGroupManagerSettings; + } + + /** + * Returns the object with the settings used for calls to setTargetPoolsRegionInstanceGroupManager. + */ + public UnaryCallSettings setTargetPoolsRegionInstanceGroupManagerSettings() { + return setTargetPoolsRegionInstanceGroupManagerSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionInstanceGroupManagerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionInstanceGroupManagerStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionInstanceGroupManagerStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionInstanceGroupManagerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + abandonInstancesRegionInstanceGroupManagerSettings = settingsBuilder.abandonInstancesRegionInstanceGroupManagerSettings().build(); + deleteRegionInstanceGroupManagerSettings = settingsBuilder.deleteRegionInstanceGroupManagerSettings().build(); + deleteInstancesRegionInstanceGroupManagerSettings = settingsBuilder.deleteInstancesRegionInstanceGroupManagerSettings().build(); + getRegionInstanceGroupManagerSettings = settingsBuilder.getRegionInstanceGroupManagerSettings().build(); + insertRegionInstanceGroupManagerSettings = settingsBuilder.insertRegionInstanceGroupManagerSettings().build(); + listRegionInstanceGroupManagersSettings = settingsBuilder.listRegionInstanceGroupManagersSettings().build(); + listManagedInstancesRegionInstanceGroupManagersSettings = settingsBuilder.listManagedInstancesRegionInstanceGroupManagersSettings().build(); + recreateInstancesRegionInstanceGroupManagerSettings = settingsBuilder.recreateInstancesRegionInstanceGroupManagerSettings().build(); + resizeRegionInstanceGroupManagerSettings = settingsBuilder.resizeRegionInstanceGroupManagerSettings().build(); + setInstanceTemplateRegionInstanceGroupManagerSettings = settingsBuilder.setInstanceTemplateRegionInstanceGroupManagerSettings().build(); + setTargetPoolsRegionInstanceGroupManagerSettings = settingsBuilder.setTargetPoolsRegionInstanceGroupManagerSettings().build(); + } + + private static final PagedListDescriptor LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionInstanceGroupManagersHttpRequest injectToken(ListRegionInstanceGroupManagersHttpRequest payload, String token) { + return ListRegionInstanceGroupManagersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionInstanceGroupManagersHttpRequest injectPageSize(ListRegionInstanceGroupManagersHttpRequest payload, int pageSize) { + return ListRegionInstanceGroupManagersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionInstanceGroupManagersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RegionInstanceGroupManagerList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RegionInstanceGroupManagerList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionInstanceGroupManagersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context); + return ListRegionInstanceGroupManagersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionInstanceGroupManagerStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder abandonInstancesRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder deleteRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder deleteInstancesRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder getRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder insertRegionInstanceGroupManagerSettings; + private final PagedCallSettings.Builder listRegionInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder listManagedInstancesRegionInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder recreateInstancesRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder resizeRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder setInstanceTemplateRegionInstanceGroupManagerSettings; + private final UnaryCallSettings.Builder setTargetPoolsRegionInstanceGroupManagerSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + abandonInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionInstanceGroupManagersSettings = PagedCallSettings.newBuilder( + LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT); + + listManagedInstancesRegionInstanceGroupManagersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + recreateInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + resizeRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setInstanceTemplateRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setTargetPoolsRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + abandonInstancesRegionInstanceGroupManagerSettings, + deleteRegionInstanceGroupManagerSettings, + deleteInstancesRegionInstanceGroupManagerSettings, + getRegionInstanceGroupManagerSettings, + insertRegionInstanceGroupManagerSettings, + listRegionInstanceGroupManagersSettings, + listManagedInstancesRegionInstanceGroupManagersSettings, + recreateInstancesRegionInstanceGroupManagerSettings, + resizeRegionInstanceGroupManagerSettings, + setInstanceTemplateRegionInstanceGroupManagerSettings, + setTargetPoolsRegionInstanceGroupManagerSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.abandonInstancesRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteInstancesRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionInstanceGroupManagersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listManagedInstancesRegionInstanceGroupManagersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.recreateInstancesRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.resizeRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setInstanceTemplateRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setTargetPoolsRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionInstanceGroupManagerStubSettings settings) { + super(settings); + + abandonInstancesRegionInstanceGroupManagerSettings = settings.abandonInstancesRegionInstanceGroupManagerSettings.toBuilder(); + deleteRegionInstanceGroupManagerSettings = settings.deleteRegionInstanceGroupManagerSettings.toBuilder(); + deleteInstancesRegionInstanceGroupManagerSettings = settings.deleteInstancesRegionInstanceGroupManagerSettings.toBuilder(); + getRegionInstanceGroupManagerSettings = settings.getRegionInstanceGroupManagerSettings.toBuilder(); + insertRegionInstanceGroupManagerSettings = settings.insertRegionInstanceGroupManagerSettings.toBuilder(); + listRegionInstanceGroupManagersSettings = settings.listRegionInstanceGroupManagersSettings.toBuilder(); + listManagedInstancesRegionInstanceGroupManagersSettings = settings.listManagedInstancesRegionInstanceGroupManagersSettings.toBuilder(); + recreateInstancesRegionInstanceGroupManagerSettings = settings.recreateInstancesRegionInstanceGroupManagerSettings.toBuilder(); + resizeRegionInstanceGroupManagerSettings = settings.resizeRegionInstanceGroupManagerSettings.toBuilder(); + setInstanceTemplateRegionInstanceGroupManagerSettings = settings.setInstanceTemplateRegionInstanceGroupManagerSettings.toBuilder(); + setTargetPoolsRegionInstanceGroupManagerSettings = settings.setTargetPoolsRegionInstanceGroupManagerSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + abandonInstancesRegionInstanceGroupManagerSettings, + deleteRegionInstanceGroupManagerSettings, + deleteInstancesRegionInstanceGroupManagerSettings, + getRegionInstanceGroupManagerSettings, + insertRegionInstanceGroupManagerSettings, + listRegionInstanceGroupManagersSettings, + listManagedInstancesRegionInstanceGroupManagersSettings, + recreateInstancesRegionInstanceGroupManagerSettings, + resizeRegionInstanceGroupManagerSettings, + setInstanceTemplateRegionInstanceGroupManagerSettings, + setTargetPoolsRegionInstanceGroupManagerSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to abandonInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder abandonInstancesRegionInstanceGroupManagerSettings() { + return abandonInstancesRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteRegionInstanceGroupManagerSettings() { + return deleteRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder deleteInstancesRegionInstanceGroupManagerSettings() { + return deleteInstancesRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to getRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder getRegionInstanceGroupManagerSettings() { + return getRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to insertRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder insertRegionInstanceGroupManagerSettings() { + return insertRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegionInstanceGroupManagers. + */ + public PagedCallSettings.Builder listRegionInstanceGroupManagersSettings() { + return listRegionInstanceGroupManagersSettings; + } + + /** + * Returns the builder for the settings used for calls to listManagedInstancesRegionInstanceGroupManagers. + */ + public UnaryCallSettings.Builder listManagedInstancesRegionInstanceGroupManagersSettings() { + return listManagedInstancesRegionInstanceGroupManagersSettings; + } + + /** + * Returns the builder for the settings used for calls to recreateInstancesRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder recreateInstancesRegionInstanceGroupManagerSettings() { + return recreateInstancesRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to resizeRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder resizeRegionInstanceGroupManagerSettings() { + return resizeRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to setInstanceTemplateRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder setInstanceTemplateRegionInstanceGroupManagerSettings() { + return setInstanceTemplateRegionInstanceGroupManagerSettings; + } + + /** + * Returns the builder for the settings used for calls to setTargetPoolsRegionInstanceGroupManager. + */ + public UnaryCallSettings.Builder setTargetPoolsRegionInstanceGroupManagerSettings() { + return setTargetPoolsRegionInstanceGroupManagerSettings; + } + + @Override + public RegionInstanceGroupManagerStubSettings build() throws IOException { + return new RegionInstanceGroupManagerStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java new file mode 100644 index 000000000000..3147151301ed --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java @@ -0,0 +1,79 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupList; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; +import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionInstanceGroupStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getRegionInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionInstanceGroupCallable()"); + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionInstanceGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupsCallable()"); + } + + @BetaApi + public UnaryCallable listInstancesRegionInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesRegionInstanceGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInstancesRegionInstanceGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesRegionInstanceGroupsCallable()"); + } + + @BetaApi + public UnaryCallable setNamedPortsRegionInstanceGroupCallable() { + throw new UnsupportedOperationException("Not implemented: setNamedPortsRegionInstanceGroupCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java new file mode 100644 index 000000000000..fb0dc73288a5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java @@ -0,0 +1,499 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; +import com.google.cloud.compute.v1.InstanceGroup; +import com.google.cloud.compute.v1.InstanceWithNamedPorts; +import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import com.google.cloud.compute.v1.RegionInstanceGroupList; +import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; +import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionInstanceGroupStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getRegionInstanceGroup to 30 seconds: + * + *

+ * 
+ * RegionInstanceGroupStubSettings.Builder regionInstanceGroupSettingsBuilder =
+ *     RegionInstanceGroupStubSettings.newBuilder();
+ * regionInstanceGroupSettingsBuilder.getRegionInstanceGroupSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionInstanceGroupStubSettings regionInstanceGroupSettings = regionInstanceGroupSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionInstanceGroupStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getRegionInstanceGroupSettings; + private final PagedCallSettings listRegionInstanceGroupsSettings; + private final PagedCallSettings listInstancesRegionInstanceGroupsSettings; + private final UnaryCallSettings setNamedPortsRegionInstanceGroupSettings; + + /** + * Returns the object with the settings used for calls to getRegionInstanceGroup. + */ + public UnaryCallSettings getRegionInstanceGroupSettings() { + return getRegionInstanceGroupSettings; + } + + /** + * Returns the object with the settings used for calls to listRegionInstanceGroups. + */ + public PagedCallSettings listRegionInstanceGroupsSettings() { + return listRegionInstanceGroupsSettings; + } + + /** + * Returns the object with the settings used for calls to listInstancesRegionInstanceGroups. + */ + public PagedCallSettings listInstancesRegionInstanceGroupsSettings() { + return listInstancesRegionInstanceGroupsSettings; + } + + /** + * Returns the object with the settings used for calls to setNamedPortsRegionInstanceGroup. + */ + public UnaryCallSettings setNamedPortsRegionInstanceGroupSettings() { + return setNamedPortsRegionInstanceGroupSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionInstanceGroupStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionInstanceGroupStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionInstanceGroupStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionInstanceGroupStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getRegionInstanceGroupSettings = settingsBuilder.getRegionInstanceGroupSettings().build(); + listRegionInstanceGroupsSettings = settingsBuilder.listRegionInstanceGroupsSettings().build(); + listInstancesRegionInstanceGroupsSettings = settingsBuilder.listInstancesRegionInstanceGroupsSettings().build(); + setNamedPortsRegionInstanceGroupSettings = settingsBuilder.setNamedPortsRegionInstanceGroupSettings().build(); + } + + private static final PagedListDescriptor LIST_REGION_INSTANCE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionInstanceGroupsHttpRequest injectToken(ListRegionInstanceGroupsHttpRequest payload, String token) { + return ListRegionInstanceGroupsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionInstanceGroupsHttpRequest injectPageSize(ListRegionInstanceGroupsHttpRequest payload, int pageSize) { + return ListRegionInstanceGroupsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionInstanceGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RegionInstanceGroupList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RegionInstanceGroupList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListDescriptor LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInstancesRegionInstanceGroupsHttpRequest injectToken(ListInstancesRegionInstanceGroupsHttpRequest payload, String token) { + return ListInstancesRegionInstanceGroupsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInstancesRegionInstanceGroupsHttpRequest injectPageSize(ListInstancesRegionInstanceGroupsHttpRequest payload, int pageSize) { + return ListInstancesRegionInstanceGroupsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInstancesRegionInstanceGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RegionInstanceGroupsListInstances payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RegionInstanceGroupsListInstances payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_REGION_INSTANCE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionInstanceGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_INSTANCE_GROUPS_PAGE_STR_DESC, request, context); + return ListRegionInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRegionInstanceGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_DESC, request, context); + return ListInstancesRegionInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionInstanceGroupStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getRegionInstanceGroupSettings; + private final PagedCallSettings.Builder listRegionInstanceGroupsSettings; + private final PagedCallSettings.Builder listInstancesRegionInstanceGroupsSettings; + private final UnaryCallSettings.Builder setNamedPortsRegionInstanceGroupSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getRegionInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionInstanceGroupsSettings = PagedCallSettings.newBuilder( + LIST_REGION_INSTANCE_GROUPS_PAGE_STR_FACT); + + listInstancesRegionInstanceGroupsSettings = PagedCallSettings.newBuilder( + LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_FACT); + + setNamedPortsRegionInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getRegionInstanceGroupSettings, + listRegionInstanceGroupsSettings, + listInstancesRegionInstanceGroupsSettings, + setNamedPortsRegionInstanceGroupSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getRegionInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionInstanceGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInstancesRegionInstanceGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setNamedPortsRegionInstanceGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionInstanceGroupStubSettings settings) { + super(settings); + + getRegionInstanceGroupSettings = settings.getRegionInstanceGroupSettings.toBuilder(); + listRegionInstanceGroupsSettings = settings.listRegionInstanceGroupsSettings.toBuilder(); + listInstancesRegionInstanceGroupsSettings = settings.listInstancesRegionInstanceGroupsSettings.toBuilder(); + setNamedPortsRegionInstanceGroupSettings = settings.setNamedPortsRegionInstanceGroupSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getRegionInstanceGroupSettings, + listRegionInstanceGroupsSettings, + listInstancesRegionInstanceGroupsSettings, + setNamedPortsRegionInstanceGroupSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getRegionInstanceGroup. + */ + public UnaryCallSettings.Builder getRegionInstanceGroupSettings() { + return getRegionInstanceGroupSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegionInstanceGroups. + */ + public PagedCallSettings.Builder listRegionInstanceGroupsSettings() { + return listRegionInstanceGroupsSettings; + } + + /** + * Returns the builder for the settings used for calls to listInstancesRegionInstanceGroups. + */ + public PagedCallSettings.Builder listInstancesRegionInstanceGroupsSettings() { + return listInstancesRegionInstanceGroupsSettings; + } + + /** + * Returns the builder for the settings used for calls to setNamedPortsRegionInstanceGroup. + */ + public UnaryCallSettings.Builder setNamedPortsRegionInstanceGroupSettings() { + return setNamedPortsRegionInstanceGroupSettings; + } + + @Override + public RegionInstanceGroupStubSettings build() throws IOException { + return new RegionInstanceGroupStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java new file mode 100644 index 000000000000..103b8c96485b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; +import com.google.cloud.compute.v1.GetRegionOperationHttpRequest; +import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.ProjectRegionOperationName; +import com.google.cloud.compute.v1.RegionName; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionOperationStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteRegionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRegionOperationCallable()"); + } + + @BetaApi + public UnaryCallable getRegionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionOperationCallable()"); + } + + @BetaApi + public UnaryCallable listRegionOperationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionOperationsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionOperationsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java new file mode 100644 index 000000000000..653ccaf19e07 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java @@ -0,0 +1,419 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; +import com.google.cloud.compute.v1.GetRegionOperationHttpRequest; +import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionOperationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRegionOperation to 30 seconds: + * + *

+ * 
+ * RegionOperationStubSettings.Builder regionOperationSettingsBuilder =
+ *     RegionOperationStubSettings.newBuilder();
+ * regionOperationSettingsBuilder.deleteRegionOperationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionOperationStubSettings regionOperationSettings = regionOperationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionOperationStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteRegionOperationSettings; + private final UnaryCallSettings getRegionOperationSettings; + private final PagedCallSettings listRegionOperationsSettings; + + /** + * Returns the object with the settings used for calls to deleteRegionOperation. + */ + public UnaryCallSettings deleteRegionOperationSettings() { + return deleteRegionOperationSettings; + } + + /** + * Returns the object with the settings used for calls to getRegionOperation. + */ + public UnaryCallSettings getRegionOperationSettings() { + return getRegionOperationSettings; + } + + /** + * Returns the object with the settings used for calls to listRegionOperations. + */ + public PagedCallSettings listRegionOperationsSettings() { + return listRegionOperationsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionOperationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionOperationStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionOperationStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionOperationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteRegionOperationSettings = settingsBuilder.deleteRegionOperationSettings().build(); + getRegionOperationSettings = settingsBuilder.getRegionOperationSettings().build(); + listRegionOperationsSettings = settingsBuilder.listRegionOperationsSettings().build(); + } + + private static final PagedListDescriptor LIST_REGION_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionOperationsHttpRequest injectToken(ListRegionOperationsHttpRequest payload, String token) { + return ListRegionOperationsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionOperationsHttpRequest injectPageSize(ListRegionOperationsHttpRequest payload, int pageSize) { + return ListRegionOperationsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionOperationsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(OperationList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(OperationList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_REGION_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionOperationsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_OPERATIONS_PAGE_STR_DESC, request, context); + return ListRegionOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionOperationStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteRegionOperationSettings; + private final UnaryCallSettings.Builder getRegionOperationSettings; + private final PagedCallSettings.Builder listRegionOperationsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteRegionOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRegionOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionOperationsSettings = PagedCallSettings.newBuilder( + LIST_REGION_OPERATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRegionOperationSettings, + getRegionOperationSettings, + listRegionOperationsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteRegionOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRegionOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionOperationStubSettings settings) { + super(settings); + + deleteRegionOperationSettings = settings.deleteRegionOperationSettings.toBuilder(); + getRegionOperationSettings = settings.getRegionOperationSettings.toBuilder(); + listRegionOperationsSettings = settings.listRegionOperationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRegionOperationSettings, + getRegionOperationSettings, + listRegionOperationsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteRegionOperation. + */ + public UnaryCallSettings.Builder deleteRegionOperationSettings() { + return deleteRegionOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to getRegionOperation. + */ + public UnaryCallSettings.Builder getRegionOperationSettings() { + return getRegionOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegionOperations. + */ + public PagedCallSettings.Builder listRegionOperationsSettings() { + return listRegionOperationsSettings; + } + + @Override + public RegionOperationStubSettings build() throws IOException { + return new RegionOperationStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java new file mode 100644 index 000000000000..c4826fea323b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java @@ -0,0 +1,56 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.GetRegionHttpRequest; +import com.google.cloud.compute.v1.ListRegionsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Region; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import com.google.cloud.compute.v1.RegionList; +import com.google.cloud.compute.v1.RegionName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getRegionCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionCallable()"); + } + + @BetaApi + public UnaryCallable listRegionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionsCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java new file mode 100644 index 000000000000..dd550bbf2e0b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java @@ -0,0 +1,392 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetRegionHttpRequest; +import com.google.cloud.compute.v1.ListRegionsHttpRequest; +import com.google.cloud.compute.v1.Region; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import com.google.cloud.compute.v1.RegionList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getRegion to 30 seconds: + * + *

+ * 
+ * RegionStubSettings.Builder regionSettingsBuilder =
+ *     RegionStubSettings.newBuilder();
+ * regionSettingsBuilder.getRegionSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionStubSettings regionSettings = regionSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getRegionSettings; + private final PagedCallSettings listRegionsSettings; + + /** + * Returns the object with the settings used for calls to getRegion. + */ + public UnaryCallSettings getRegionSettings() { + return getRegionSettings; + } + + /** + * Returns the object with the settings used for calls to listRegions. + */ + public PagedCallSettings listRegionsSettings() { + return listRegionsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getRegionSettings = settingsBuilder.getRegionSettings().build(); + listRegionsSettings = settingsBuilder.listRegionsSettings().build(); + } + + private static final PagedListDescriptor LIST_REGIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionsHttpRequest injectToken(ListRegionsHttpRequest payload, String token) { + return ListRegionsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionsHttpRequest injectPageSize(ListRegionsHttpRequest payload, int pageSize) { + return ListRegionsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RegionList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RegionList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_REGIONS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGIONS_PAGE_STR_DESC, request, context); + return ListRegionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getRegionSettings; + private final PagedCallSettings.Builder listRegionsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getRegionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionsSettings = PagedCallSettings.newBuilder( + LIST_REGIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getRegionSettings, + listRegionsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getRegionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionStubSettings settings) { + super(settings); + + getRegionSettings = settings.getRegionSettings.toBuilder(); + listRegionsSettings = settings.listRegionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getRegionSettings, + listRegionsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getRegion. + */ + public UnaryCallSettings.Builder getRegionSettings() { + return getRegionSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegions. + */ + public PagedCallSettings.Builder listRegionsSettings() { + return listRegionsSettings; + } + + @Override + public RegionStubSettings build() throws IOException { + return new RegionStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java new file mode 100644 index 000000000000..51ab5756bf05 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteRouteHttpRequest; +import com.google.cloud.compute.v1.GetRouteHttpRequest; +import com.google.cloud.compute.v1.InsertRouteHttpRequest; +import com.google.cloud.compute.v1.ListRoutesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Route; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import com.google.cloud.compute.v1.RouteList; +import com.google.cloud.compute.v1.RouteName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RouteStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteRouteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRouteCallable()"); + } + + @BetaApi + public UnaryCallable getRouteCallable() { + throw new UnsupportedOperationException("Not implemented: getRouteCallable()"); + } + + @BetaApi + public UnaryCallable insertRouteCallable() { + throw new UnsupportedOperationException("Not implemented: insertRouteCallable()"); + } + + @BetaApi + public UnaryCallable listRoutesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRoutesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRoutesCallable() { + throw new UnsupportedOperationException("Not implemented: listRoutesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java new file mode 100644 index 000000000000..b084a16c2379 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java @@ -0,0 +1,447 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteRouteHttpRequest; +import com.google.cloud.compute.v1.GetRouteHttpRequest; +import com.google.cloud.compute.v1.InsertRouteHttpRequest; +import com.google.cloud.compute.v1.ListRoutesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Route; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import com.google.cloud.compute.v1.RouteList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RouteStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRoute to 30 seconds: + * + *

+ * 
+ * RouteStubSettings.Builder routeSettingsBuilder =
+ *     RouteStubSettings.newBuilder();
+ * routeSettingsBuilder.deleteRouteSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RouteStubSettings routeSettings = routeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RouteStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteRouteSettings; + private final UnaryCallSettings getRouteSettings; + private final UnaryCallSettings insertRouteSettings; + private final PagedCallSettings listRoutesSettings; + + /** + * Returns the object with the settings used for calls to deleteRoute. + */ + public UnaryCallSettings deleteRouteSettings() { + return deleteRouteSettings; + } + + /** + * Returns the object with the settings used for calls to getRoute. + */ + public UnaryCallSettings getRouteSettings() { + return getRouteSettings; + } + + /** + * Returns the object with the settings used for calls to insertRoute. + */ + public UnaryCallSettings insertRouteSettings() { + return insertRouteSettings; + } + + /** + * Returns the object with the settings used for calls to listRoutes. + */ + public PagedCallSettings listRoutesSettings() { + return listRoutesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RouteStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRouteStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RouteStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RouteStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteRouteSettings = settingsBuilder.deleteRouteSettings().build(); + getRouteSettings = settingsBuilder.getRouteSettings().build(); + insertRouteSettings = settingsBuilder.insertRouteSettings().build(); + listRoutesSettings = settingsBuilder.listRoutesSettings().build(); + } + + private static final PagedListDescriptor LIST_ROUTES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRoutesHttpRequest injectToken(ListRoutesHttpRequest payload, String token) { + return ListRoutesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRoutesHttpRequest injectPageSize(ListRoutesHttpRequest payload, int pageSize) { + return ListRoutesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRoutesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RouteList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RouteList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_ROUTES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRoutesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ROUTES_PAGE_STR_DESC, request, context); + return ListRoutesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RouteStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteRouteSettings; + private final UnaryCallSettings.Builder getRouteSettings; + private final UnaryCallSettings.Builder insertRouteSettings; + private final PagedCallSettings.Builder listRoutesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRoutesSettings = PagedCallSettings.newBuilder( + LIST_ROUTES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRouteSettings, + getRouteSettings, + insertRouteSettings, + listRoutesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteRouteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRouteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertRouteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRoutesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RouteStubSettings settings) { + super(settings); + + deleteRouteSettings = settings.deleteRouteSettings.toBuilder(); + getRouteSettings = settings.getRouteSettings.toBuilder(); + insertRouteSettings = settings.insertRouteSettings.toBuilder(); + listRoutesSettings = settings.listRoutesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteRouteSettings, + getRouteSettings, + insertRouteSettings, + listRoutesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteRoute. + */ + public UnaryCallSettings.Builder deleteRouteSettings() { + return deleteRouteSettings; + } + + /** + * Returns the builder for the settings used for calls to getRoute. + */ + public UnaryCallSettings.Builder getRouteSettings() { + return getRouteSettings; + } + + /** + * Returns the builder for the settings used for calls to insertRoute. + */ + public UnaryCallSettings.Builder insertRouteSettings() { + return insertRouteSettings; + } + + /** + * Returns the builder for the settings used for calls to listRoutes. + */ + public PagedCallSettings.Builder listRoutesSettings() { + return listRoutesSettings; + } + + @Override + public RouteStubSettings build() throws IOException { + return new RouteStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java new file mode 100644 index 000000000000..8eeac0c72117 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java @@ -0,0 +1,110 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; +import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; +import com.google.cloud.compute.v1.InsertRouterHttpRequest; +import com.google.cloud.compute.v1.ListRoutersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRouterHttpRequest; +import com.google.cloud.compute.v1.PreviewRouterHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.Router; +import com.google.cloud.compute.v1.RouterAggregatedList; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; +import com.google.cloud.compute.v1.RouterList; +import com.google.cloud.compute.v1.RouterName; +import com.google.cloud.compute.v1.RouterStatusResponse; +import com.google.cloud.compute.v1.RoutersPreviewResponse; +import com.google.cloud.compute.v1.RoutersScopedList; +import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RouterStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListRoutersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListRoutersPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListRoutersCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListRoutersCallable()"); + } + + @BetaApi + public UnaryCallable deleteRouterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRouterCallable()"); + } + + @BetaApi + public UnaryCallable getRouterCallable() { + throw new UnsupportedOperationException("Not implemented: getRouterCallable()"); + } + + @BetaApi + public UnaryCallable getRouterStatusRouterCallable() { + throw new UnsupportedOperationException("Not implemented: getRouterStatusRouterCallable()"); + } + + @BetaApi + public UnaryCallable insertRouterCallable() { + throw new UnsupportedOperationException("Not implemented: insertRouterCallable()"); + } + + @BetaApi + public UnaryCallable listRoutersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRoutersPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRoutersCallable() { + throw new UnsupportedOperationException("Not implemented: listRoutersCallable()"); + } + + @BetaApi + public UnaryCallable patchRouterCallable() { + throw new UnsupportedOperationException("Not implemented: patchRouterCallable()"); + } + + @BetaApi + public UnaryCallable previewRouterCallable() { + throw new UnsupportedOperationException("Not implemented: previewRouterCallable()"); + } + + @BetaApi + public UnaryCallable updateRouterCallable() { + throw new UnsupportedOperationException("Not implemented: updateRouterCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java new file mode 100644 index 000000000000..44df81a455d9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java @@ -0,0 +1,636 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; +import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterHttpRequest; +import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; +import com.google.cloud.compute.v1.InsertRouterHttpRequest; +import com.google.cloud.compute.v1.ListRoutersHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRouterHttpRequest; +import com.google.cloud.compute.v1.PreviewRouterHttpRequest; +import com.google.cloud.compute.v1.Router; +import com.google.cloud.compute.v1.RouterAggregatedList; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; +import com.google.cloud.compute.v1.RouterList; +import com.google.cloud.compute.v1.RouterStatusResponse; +import com.google.cloud.compute.v1.RoutersPreviewResponse; +import com.google.cloud.compute.v1.RoutersScopedList; +import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RouterStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteRouter to 30 seconds: + * + *

+ * 
+ * RouterStubSettings.Builder routerSettingsBuilder =
+ *     RouterStubSettings.newBuilder();
+ * routerSettingsBuilder.deleteRouterSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RouterStubSettings routerSettings = routerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RouterStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListRoutersSettings; + private final UnaryCallSettings deleteRouterSettings; + private final UnaryCallSettings getRouterSettings; + private final UnaryCallSettings getRouterStatusRouterSettings; + private final UnaryCallSettings insertRouterSettings; + private final PagedCallSettings listRoutersSettings; + private final UnaryCallSettings patchRouterSettings; + private final UnaryCallSettings previewRouterSettings; + private final UnaryCallSettings updateRouterSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListRouters. + */ + public PagedCallSettings aggregatedListRoutersSettings() { + return aggregatedListRoutersSettings; + } + + /** + * Returns the object with the settings used for calls to deleteRouter. + */ + public UnaryCallSettings deleteRouterSettings() { + return deleteRouterSettings; + } + + /** + * Returns the object with the settings used for calls to getRouter. + */ + public UnaryCallSettings getRouterSettings() { + return getRouterSettings; + } + + /** + * Returns the object with the settings used for calls to getRouterStatusRouter. + */ + public UnaryCallSettings getRouterStatusRouterSettings() { + return getRouterStatusRouterSettings; + } + + /** + * Returns the object with the settings used for calls to insertRouter. + */ + public UnaryCallSettings insertRouterSettings() { + return insertRouterSettings; + } + + /** + * Returns the object with the settings used for calls to listRouters. + */ + public PagedCallSettings listRoutersSettings() { + return listRoutersSettings; + } + + /** + * Returns the object with the settings used for calls to patchRouter. + */ + public UnaryCallSettings patchRouterSettings() { + return patchRouterSettings; + } + + /** + * Returns the object with the settings used for calls to previewRouter. + */ + public UnaryCallSettings previewRouterSettings() { + return previewRouterSettings; + } + + /** + * Returns the object with the settings used for calls to updateRouter. + */ + public UnaryCallSettings updateRouterSettings() { + return updateRouterSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RouterStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRouterStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RouterStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RouterStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListRoutersSettings = settingsBuilder.aggregatedListRoutersSettings().build(); + deleteRouterSettings = settingsBuilder.deleteRouterSettings().build(); + getRouterSettings = settingsBuilder.getRouterSettings().build(); + getRouterStatusRouterSettings = settingsBuilder.getRouterStatusRouterSettings().build(); + insertRouterSettings = settingsBuilder.insertRouterSettings().build(); + listRoutersSettings = settingsBuilder.listRoutersSettings().build(); + patchRouterSettings = settingsBuilder.patchRouterSettings().build(); + previewRouterSettings = settingsBuilder.previewRouterSettings().build(); + updateRouterSettings = settingsBuilder.updateRouterSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_ROUTERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListRoutersHttpRequest injectToken(AggregatedListRoutersHttpRequest payload, String token) { + return AggregatedListRoutersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListRoutersHttpRequest injectPageSize(AggregatedListRoutersHttpRequest payload, int pageSize) { + return AggregatedListRoutersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListRoutersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RouterAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RouterAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_ROUTERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRoutersHttpRequest injectToken(ListRoutersHttpRequest payload, String token) { + return ListRoutersHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRoutersHttpRequest injectPageSize(ListRoutersHttpRequest payload, int pageSize) { + return ListRoutersHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRoutersHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(RouterList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(RouterList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_ROUTERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListRoutersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_ROUTERS_PAGE_STR_DESC, request, context); + return AggregatedListRoutersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_ROUTERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRoutersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ROUTERS_PAGE_STR_DESC, request, context); + return ListRoutersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RouterStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListRoutersSettings; + private final UnaryCallSettings.Builder deleteRouterSettings; + private final UnaryCallSettings.Builder getRouterSettings; + private final UnaryCallSettings.Builder getRouterStatusRouterSettings; + private final UnaryCallSettings.Builder insertRouterSettings; + private final PagedCallSettings.Builder listRoutersSettings; + private final UnaryCallSettings.Builder patchRouterSettings; + private final UnaryCallSettings.Builder previewRouterSettings; + private final UnaryCallSettings.Builder updateRouterSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListRoutersSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_ROUTERS_PAGE_STR_FACT); + + deleteRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRouterStatusRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRoutersSettings = PagedCallSettings.newBuilder( + LIST_ROUTERS_PAGE_STR_FACT); + + patchRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + previewRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListRoutersSettings, + deleteRouterSettings, + getRouterSettings, + getRouterStatusRouterSettings, + insertRouterSettings, + listRoutersSettings, + patchRouterSettings, + previewRouterSettings, + updateRouterSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListRoutersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRouterStatusRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRoutersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.previewRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateRouterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RouterStubSettings settings) { + super(settings); + + aggregatedListRoutersSettings = settings.aggregatedListRoutersSettings.toBuilder(); + deleteRouterSettings = settings.deleteRouterSettings.toBuilder(); + getRouterSettings = settings.getRouterSettings.toBuilder(); + getRouterStatusRouterSettings = settings.getRouterStatusRouterSettings.toBuilder(); + insertRouterSettings = settings.insertRouterSettings.toBuilder(); + listRoutersSettings = settings.listRoutersSettings.toBuilder(); + patchRouterSettings = settings.patchRouterSettings.toBuilder(); + previewRouterSettings = settings.previewRouterSettings.toBuilder(); + updateRouterSettings = settings.updateRouterSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListRoutersSettings, + deleteRouterSettings, + getRouterSettings, + getRouterStatusRouterSettings, + insertRouterSettings, + listRoutersSettings, + patchRouterSettings, + previewRouterSettings, + updateRouterSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListRouters. + */ + public PagedCallSettings.Builder aggregatedListRoutersSettings() { + return aggregatedListRoutersSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteRouter. + */ + public UnaryCallSettings.Builder deleteRouterSettings() { + return deleteRouterSettings; + } + + /** + * Returns the builder for the settings used for calls to getRouter. + */ + public UnaryCallSettings.Builder getRouterSettings() { + return getRouterSettings; + } + + /** + * Returns the builder for the settings used for calls to getRouterStatusRouter. + */ + public UnaryCallSettings.Builder getRouterStatusRouterSettings() { + return getRouterStatusRouterSettings; + } + + /** + * Returns the builder for the settings used for calls to insertRouter. + */ + public UnaryCallSettings.Builder insertRouterSettings() { + return insertRouterSettings; + } + + /** + * Returns the builder for the settings used for calls to listRouters. + */ + public PagedCallSettings.Builder listRoutersSettings() { + return listRoutersSettings; + } + + /** + * Returns the builder for the settings used for calls to patchRouter. + */ + public UnaryCallSettings.Builder patchRouterSettings() { + return patchRouterSettings; + } + + /** + * Returns the builder for the settings used for calls to previewRouter. + */ + public UnaryCallSettings.Builder previewRouterSettings() { + return previewRouterSettings; + } + + /** + * Returns the builder for the settings used for calls to updateRouter. + */ + public UnaryCallSettings.Builder updateRouterSettings() { + return updateRouterSettings; + } + + @Override + public RouterStubSettings build() throws IOException { + return new RouterStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java new file mode 100644 index 000000000000..c4b6ae380ec4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java @@ -0,0 +1,63 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Snapshot; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.SnapshotName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SnapshotStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSnapshotCallable()"); + } + + @BetaApi + public UnaryCallable getSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: getSnapshotCallable()"); + } + + @BetaApi + public UnaryCallable listSnapshotsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSnapshotsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listSnapshotsCallable() { + throw new UnsupportedOperationException("Not implemented: listSnapshotsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java new file mode 100644 index 000000000000..11221269749b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java @@ -0,0 +1,420 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Snapshot; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import com.google.cloud.compute.v1.SnapshotList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SnapshotStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSnapshot to 30 seconds: + * + *

+ * 
+ * SnapshotStubSettings.Builder snapshotSettingsBuilder =
+ *     SnapshotStubSettings.newBuilder();
+ * snapshotSettingsBuilder.deleteSnapshotSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SnapshotStubSettings snapshotSettings = snapshotSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SnapshotStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteSnapshotSettings; + private final UnaryCallSettings getSnapshotSettings; + private final PagedCallSettings listSnapshotsSettings; + + /** + * Returns the object with the settings used for calls to deleteSnapshot. + */ + public UnaryCallSettings deleteSnapshotSettings() { + return deleteSnapshotSettings; + } + + /** + * Returns the object with the settings used for calls to getSnapshot. + */ + public UnaryCallSettings getSnapshotSettings() { + return getSnapshotSettings; + } + + /** + * Returns the object with the settings used for calls to listSnapshots. + */ + public PagedCallSettings listSnapshotsSettings() { + return listSnapshotsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SnapshotStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSnapshotStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SnapshotStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SnapshotStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSnapshotSettings = settingsBuilder.deleteSnapshotSettings().build(); + getSnapshotSettings = settingsBuilder.getSnapshotSettings().build(); + listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build(); + } + + private static final PagedListDescriptor LIST_SNAPSHOTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListSnapshotsHttpRequest injectToken(ListSnapshotsHttpRequest payload, String token) { + return ListSnapshotsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListSnapshotsHttpRequest injectPageSize(ListSnapshotsHttpRequest payload, int pageSize) { + return ListSnapshotsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListSnapshotsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(SnapshotList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(SnapshotList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_SNAPSHOTS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSnapshotsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context); + return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for SnapshotStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteSnapshotSettings; + private final UnaryCallSettings.Builder getSnapshotSettings; + private final PagedCallSettings.Builder listSnapshotsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listSnapshotsSettings = PagedCallSettings.newBuilder( + LIST_SNAPSHOTS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteSnapshotSettings, + getSnapshotSettings, + listSnapshotsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listSnapshotsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(SnapshotStubSettings settings) { + super(settings); + + deleteSnapshotSettings = settings.deleteSnapshotSettings.toBuilder(); + getSnapshotSettings = settings.getSnapshotSettings.toBuilder(); + listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteSnapshotSettings, + getSnapshotSettings, + listSnapshotsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteSnapshot. + */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { + return deleteSnapshotSettings; + } + + /** + * Returns the builder for the settings used for calls to getSnapshot. + */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getSnapshotSettings; + } + + /** + * Returns the builder for the settings used for calls to listSnapshots. + */ + public PagedCallSettings.Builder listSnapshotsSettings() { + return listSnapshotsSettings; + } + + @Override + public SnapshotStubSettings build() throws IOException { + return new SnapshotStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java new file mode 100644 index 000000000000..b6e4f48f8930 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; +import com.google.cloud.compute.v1.GetSslCertificateHttpRequest; +import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; +import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SslCertificate; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import com.google.cloud.compute.v1.SslCertificateList; +import com.google.cloud.compute.v1.SslCertificateName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SslCertificateStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteSslCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSslCertificateCallable()"); + } + + @BetaApi + public UnaryCallable getSslCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: getSslCertificateCallable()"); + } + + @BetaApi + public UnaryCallable insertSslCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: insertSslCertificateCallable()"); + } + + @BetaApi + public UnaryCallable listSslCertificatesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSslCertificatesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listSslCertificatesCallable() { + throw new UnsupportedOperationException("Not implemented: listSslCertificatesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java new file mode 100644 index 000000000000..a8e89c98f652 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java @@ -0,0 +1,447 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; +import com.google.cloud.compute.v1.GetSslCertificateHttpRequest; +import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; +import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SslCertificate; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import com.google.cloud.compute.v1.SslCertificateList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SslCertificateStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSslCertificate to 30 seconds: + * + *

+ * 
+ * SslCertificateStubSettings.Builder sslCertificateSettingsBuilder =
+ *     SslCertificateStubSettings.newBuilder();
+ * sslCertificateSettingsBuilder.deleteSslCertificateSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SslCertificateStubSettings sslCertificateSettings = sslCertificateSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SslCertificateStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteSslCertificateSettings; + private final UnaryCallSettings getSslCertificateSettings; + private final UnaryCallSettings insertSslCertificateSettings; + private final PagedCallSettings listSslCertificatesSettings; + + /** + * Returns the object with the settings used for calls to deleteSslCertificate. + */ + public UnaryCallSettings deleteSslCertificateSettings() { + return deleteSslCertificateSettings; + } + + /** + * Returns the object with the settings used for calls to getSslCertificate. + */ + public UnaryCallSettings getSslCertificateSettings() { + return getSslCertificateSettings; + } + + /** + * Returns the object with the settings used for calls to insertSslCertificate. + */ + public UnaryCallSettings insertSslCertificateSettings() { + return insertSslCertificateSettings; + } + + /** + * Returns the object with the settings used for calls to listSslCertificates. + */ + public PagedCallSettings listSslCertificatesSettings() { + return listSslCertificatesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SslCertificateStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSslCertificateStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SslCertificateStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SslCertificateStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSslCertificateSettings = settingsBuilder.deleteSslCertificateSettings().build(); + getSslCertificateSettings = settingsBuilder.getSslCertificateSettings().build(); + insertSslCertificateSettings = settingsBuilder.insertSslCertificateSettings().build(); + listSslCertificatesSettings = settingsBuilder.listSslCertificatesSettings().build(); + } + + private static final PagedListDescriptor LIST_SSL_CERTIFICATES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListSslCertificatesHttpRequest injectToken(ListSslCertificatesHttpRequest payload, String token) { + return ListSslCertificatesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListSslCertificatesHttpRequest injectPageSize(ListSslCertificatesHttpRequest payload, int pageSize) { + return ListSslCertificatesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListSslCertificatesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(SslCertificateList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(SslCertificateList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_SSL_CERTIFICATES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSslCertificatesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SSL_CERTIFICATES_PAGE_STR_DESC, request, context); + return ListSslCertificatesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for SslCertificateStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteSslCertificateSettings; + private final UnaryCallSettings.Builder getSslCertificateSettings; + private final UnaryCallSettings.Builder insertSslCertificateSettings; + private final PagedCallSettings.Builder listSslCertificatesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteSslCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSslCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertSslCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listSslCertificatesSettings = PagedCallSettings.newBuilder( + LIST_SSL_CERTIFICATES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteSslCertificateSettings, + getSslCertificateSettings, + insertSslCertificateSettings, + listSslCertificatesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteSslCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getSslCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertSslCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listSslCertificatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(SslCertificateStubSettings settings) { + super(settings); + + deleteSslCertificateSettings = settings.deleteSslCertificateSettings.toBuilder(); + getSslCertificateSettings = settings.getSslCertificateSettings.toBuilder(); + insertSslCertificateSettings = settings.insertSslCertificateSettings.toBuilder(); + listSslCertificatesSettings = settings.listSslCertificatesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteSslCertificateSettings, + getSslCertificateSettings, + insertSslCertificateSettings, + listSslCertificatesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteSslCertificate. + */ + public UnaryCallSettings.Builder deleteSslCertificateSettings() { + return deleteSslCertificateSettings; + } + + /** + * Returns the builder for the settings used for calls to getSslCertificate. + */ + public UnaryCallSettings.Builder getSslCertificateSettings() { + return getSslCertificateSettings; + } + + /** + * Returns the builder for the settings used for calls to insertSslCertificate. + */ + public UnaryCallSettings.Builder insertSslCertificateSettings() { + return insertSslCertificateSettings; + } + + /** + * Returns the builder for the settings used for calls to listSslCertificates. + */ + public PagedCallSettings.Builder listSslCertificatesSettings() { + return listSslCertificatesSettings; + } + + @Override + public SslCertificateStubSettings build() throws IOException { + return new SslCertificateStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java new file mode 100644 index 000000000000..39100b457fc7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java @@ -0,0 +1,91 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; +import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.Subnetwork; +import com.google.cloud.compute.v1.SubnetworkAggregatedList; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import com.google.cloud.compute.v1.SubnetworkList; +import com.google.cloud.compute.v1.SubnetworkName; +import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; +import com.google.cloud.compute.v1.SubnetworksScopedList; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SubnetworkStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListSubnetworksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListSubnetworksPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListSubnetworksCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListSubnetworksCallable()"); + } + + @BetaApi + public UnaryCallable deleteSubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSubnetworkCallable()"); + } + + @BetaApi + public UnaryCallable expandIpCidrRangeSubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: expandIpCidrRangeSubnetworkCallable()"); + } + + @BetaApi + public UnaryCallable getSubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: getSubnetworkCallable()"); + } + + @BetaApi + public UnaryCallable insertSubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: insertSubnetworkCallable()"); + } + + @BetaApi + public UnaryCallable listSubnetworksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSubnetworksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listSubnetworksCallable() { + throw new UnsupportedOperationException("Not implemented: listSubnetworksCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java new file mode 100644 index 000000000000..086c062c2253 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java @@ -0,0 +1,553 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; +import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; +import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Subnetwork; +import com.google.cloud.compute.v1.SubnetworkAggregatedList; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import com.google.cloud.compute.v1.SubnetworkList; +import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SubnetworkStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSubnetwork to 30 seconds: + * + *

+ * 
+ * SubnetworkStubSettings.Builder subnetworkSettingsBuilder =
+ *     SubnetworkStubSettings.newBuilder();
+ * subnetworkSettingsBuilder.deleteSubnetworkSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SubnetworkStubSettings subnetworkSettings = subnetworkSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SubnetworkStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListSubnetworksSettings; + private final UnaryCallSettings deleteSubnetworkSettings; + private final UnaryCallSettings expandIpCidrRangeSubnetworkSettings; + private final UnaryCallSettings getSubnetworkSettings; + private final UnaryCallSettings insertSubnetworkSettings; + private final PagedCallSettings listSubnetworksSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListSubnetworks. + */ + public PagedCallSettings aggregatedListSubnetworksSettings() { + return aggregatedListSubnetworksSettings; + } + + /** + * Returns the object with the settings used for calls to deleteSubnetwork. + */ + public UnaryCallSettings deleteSubnetworkSettings() { + return deleteSubnetworkSettings; + } + + /** + * Returns the object with the settings used for calls to expandIpCidrRangeSubnetwork. + */ + public UnaryCallSettings expandIpCidrRangeSubnetworkSettings() { + return expandIpCidrRangeSubnetworkSettings; + } + + /** + * Returns the object with the settings used for calls to getSubnetwork. + */ + public UnaryCallSettings getSubnetworkSettings() { + return getSubnetworkSettings; + } + + /** + * Returns the object with the settings used for calls to insertSubnetwork. + */ + public UnaryCallSettings insertSubnetworkSettings() { + return insertSubnetworkSettings; + } + + /** + * Returns the object with the settings used for calls to listSubnetworks. + */ + public PagedCallSettings listSubnetworksSettings() { + return listSubnetworksSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SubnetworkStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSubnetworkStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SubnetworkStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SubnetworkStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListSubnetworksSettings = settingsBuilder.aggregatedListSubnetworksSettings().build(); + deleteSubnetworkSettings = settingsBuilder.deleteSubnetworkSettings().build(); + expandIpCidrRangeSubnetworkSettings = settingsBuilder.expandIpCidrRangeSubnetworkSettings().build(); + getSubnetworkSettings = settingsBuilder.getSubnetworkSettings().build(); + insertSubnetworkSettings = settingsBuilder.insertSubnetworkSettings().build(); + listSubnetworksSettings = settingsBuilder.listSubnetworksSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListSubnetworksHttpRequest injectToken(AggregatedListSubnetworksHttpRequest payload, String token) { + return AggregatedListSubnetworksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListSubnetworksHttpRequest injectPageSize(AggregatedListSubnetworksHttpRequest payload, int pageSize) { + return AggregatedListSubnetworksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListSubnetworksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(SubnetworkAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(SubnetworkAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_SUBNETWORKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListSubnetworksHttpRequest injectToken(ListSubnetworksHttpRequest payload, String token) { + return ListSubnetworksHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListSubnetworksHttpRequest injectPageSize(ListSubnetworksHttpRequest payload, int pageSize) { + return ListSubnetworksHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListSubnetworksHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(SubnetworkList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(SubnetworkList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListSubnetworksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC, request, context); + return AggregatedListSubnetworksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_SUBNETWORKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSubnetworksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SUBNETWORKS_PAGE_STR_DESC, request, context); + return ListSubnetworksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for SubnetworkStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListSubnetworksSettings; + private final UnaryCallSettings.Builder deleteSubnetworkSettings; + private final UnaryCallSettings.Builder expandIpCidrRangeSubnetworkSettings; + private final UnaryCallSettings.Builder getSubnetworkSettings; + private final UnaryCallSettings.Builder insertSubnetworkSettings; + private final PagedCallSettings.Builder listSubnetworksSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListSubnetworksSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_FACT); + + deleteSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + expandIpCidrRangeSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listSubnetworksSettings = PagedCallSettings.newBuilder( + LIST_SUBNETWORKS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListSubnetworksSettings, + deleteSubnetworkSettings, + expandIpCidrRangeSubnetworkSettings, + getSubnetworkSettings, + insertSubnetworkSettings, + listSubnetworksSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListSubnetworksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.expandIpCidrRangeSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listSubnetworksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(SubnetworkStubSettings settings) { + super(settings); + + aggregatedListSubnetworksSettings = settings.aggregatedListSubnetworksSettings.toBuilder(); + deleteSubnetworkSettings = settings.deleteSubnetworkSettings.toBuilder(); + expandIpCidrRangeSubnetworkSettings = settings.expandIpCidrRangeSubnetworkSettings.toBuilder(); + getSubnetworkSettings = settings.getSubnetworkSettings.toBuilder(); + insertSubnetworkSettings = settings.insertSubnetworkSettings.toBuilder(); + listSubnetworksSettings = settings.listSubnetworksSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListSubnetworksSettings, + deleteSubnetworkSettings, + expandIpCidrRangeSubnetworkSettings, + getSubnetworkSettings, + insertSubnetworkSettings, + listSubnetworksSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListSubnetworks. + */ + public PagedCallSettings.Builder aggregatedListSubnetworksSettings() { + return aggregatedListSubnetworksSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteSubnetwork. + */ + public UnaryCallSettings.Builder deleteSubnetworkSettings() { + return deleteSubnetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to expandIpCidrRangeSubnetwork. + */ + public UnaryCallSettings.Builder expandIpCidrRangeSubnetworkSettings() { + return expandIpCidrRangeSubnetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to getSubnetwork. + */ + public UnaryCallSettings.Builder getSubnetworkSettings() { + return getSubnetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to insertSubnetwork. + */ + public UnaryCallSettings.Builder insertSubnetworkSettings() { + return insertSubnetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to listSubnetworks. + */ + public PagedCallSettings.Builder listSubnetworksSettings() { + return listSubnetworksSettings; + } + + @Override + public SubnetworkStubSettings build() throws IOException { + return new SubnetworkStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java new file mode 100644 index 000000000000..770b99bd5292 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java @@ -0,0 +1,76 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpProxy; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpProxyList; +import com.google.cloud.compute.v1.TargetHttpProxyName; +import com.google.cloud.compute.v1.UrlMapReference; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetHttpProxyStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteTargetHttpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetHttpProxyCallable()"); + } + + @BetaApi + public UnaryCallable getTargetHttpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetHttpProxyCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetHttpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetHttpProxyCallable()"); + } + + @BetaApi + public UnaryCallable listTargetHttpProxiesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetHttpProxiesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetHttpProxiesCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetHttpProxiesCallable()"); + } + + @BetaApi + public UnaryCallable setUrlMapTargetHttpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setUrlMapTargetHttpProxyCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java new file mode 100644 index 000000000000..8aea8461d8e8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java @@ -0,0 +1,474 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpProxy; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpProxyList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetHttpProxyStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetHttpProxy to 30 seconds: + * + *

+ * 
+ * TargetHttpProxyStubSettings.Builder targetHttpProxySettingsBuilder =
+ *     TargetHttpProxyStubSettings.newBuilder();
+ * targetHttpProxySettingsBuilder.deleteTargetHttpProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetHttpProxyStubSettings targetHttpProxySettings = targetHttpProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetHttpProxyStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteTargetHttpProxySettings; + private final UnaryCallSettings getTargetHttpProxySettings; + private final UnaryCallSettings insertTargetHttpProxySettings; + private final PagedCallSettings listTargetHttpProxiesSettings; + private final UnaryCallSettings setUrlMapTargetHttpProxySettings; + + /** + * Returns the object with the settings used for calls to deleteTargetHttpProxy. + */ + public UnaryCallSettings deleteTargetHttpProxySettings() { + return deleteTargetHttpProxySettings; + } + + /** + * Returns the object with the settings used for calls to getTargetHttpProxy. + */ + public UnaryCallSettings getTargetHttpProxySettings() { + return getTargetHttpProxySettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetHttpProxy. + */ + public UnaryCallSettings insertTargetHttpProxySettings() { + return insertTargetHttpProxySettings; + } + + /** + * Returns the object with the settings used for calls to listTargetHttpProxies. + */ + public PagedCallSettings listTargetHttpProxiesSettings() { + return listTargetHttpProxiesSettings; + } + + /** + * Returns the object with the settings used for calls to setUrlMapTargetHttpProxy. + */ + public UnaryCallSettings setUrlMapTargetHttpProxySettings() { + return setUrlMapTargetHttpProxySettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetHttpProxyStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetHttpProxyStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetHttpProxyStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetHttpProxyStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteTargetHttpProxySettings = settingsBuilder.deleteTargetHttpProxySettings().build(); + getTargetHttpProxySettings = settingsBuilder.getTargetHttpProxySettings().build(); + insertTargetHttpProxySettings = settingsBuilder.insertTargetHttpProxySettings().build(); + listTargetHttpProxiesSettings = settingsBuilder.listTargetHttpProxiesSettings().build(); + setUrlMapTargetHttpProxySettings = settingsBuilder.setUrlMapTargetHttpProxySettings().build(); + } + + private static final PagedListDescriptor LIST_TARGET_HTTP_PROXIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetHttpProxiesHttpRequest injectToken(ListTargetHttpProxiesHttpRequest payload, String token) { + return ListTargetHttpProxiesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetHttpProxiesHttpRequest injectPageSize(ListTargetHttpProxiesHttpRequest payload, int pageSize) { + return ListTargetHttpProxiesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetHttpProxiesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetHttpProxyList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetHttpProxyList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_HTTP_PROXIES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetHttpProxiesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_HTTP_PROXIES_PAGE_STR_DESC, request, context); + return ListTargetHttpProxiesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetHttpProxyStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteTargetHttpProxySettings; + private final UnaryCallSettings.Builder getTargetHttpProxySettings; + private final UnaryCallSettings.Builder insertTargetHttpProxySettings; + private final PagedCallSettings.Builder listTargetHttpProxiesSettings; + private final UnaryCallSettings.Builder setUrlMapTargetHttpProxySettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteTargetHttpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetHttpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetHttpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetHttpProxiesSettings = PagedCallSettings.newBuilder( + LIST_TARGET_HTTP_PROXIES_PAGE_STR_FACT); + + setUrlMapTargetHttpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetHttpProxySettings, + getTargetHttpProxySettings, + insertTargetHttpProxySettings, + listTargetHttpProxiesSettings, + setUrlMapTargetHttpProxySettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteTargetHttpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetHttpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetHttpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetHttpProxiesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setUrlMapTargetHttpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetHttpProxyStubSettings settings) { + super(settings); + + deleteTargetHttpProxySettings = settings.deleteTargetHttpProxySettings.toBuilder(); + getTargetHttpProxySettings = settings.getTargetHttpProxySettings.toBuilder(); + insertTargetHttpProxySettings = settings.insertTargetHttpProxySettings.toBuilder(); + listTargetHttpProxiesSettings = settings.listTargetHttpProxiesSettings.toBuilder(); + setUrlMapTargetHttpProxySettings = settings.setUrlMapTargetHttpProxySettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetHttpProxySettings, + getTargetHttpProxySettings, + insertTargetHttpProxySettings, + listTargetHttpProxiesSettings, + setUrlMapTargetHttpProxySettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetHttpProxy. + */ + public UnaryCallSettings.Builder deleteTargetHttpProxySettings() { + return deleteTargetHttpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetHttpProxy. + */ + public UnaryCallSettings.Builder getTargetHttpProxySettings() { + return getTargetHttpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetHttpProxy. + */ + public UnaryCallSettings.Builder insertTargetHttpProxySettings() { + return insertTargetHttpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetHttpProxies. + */ + public PagedCallSettings.Builder listTargetHttpProxiesSettings() { + return listTargetHttpProxiesSettings; + } + + /** + * Returns the builder for the settings used for calls to setUrlMapTargetHttpProxy. + */ + public UnaryCallSettings.Builder setUrlMapTargetHttpProxySettings() { + return setUrlMapTargetHttpProxySettings; + } + + @Override + public TargetHttpProxyStubSettings build() throws IOException { + return new TargetHttpProxyStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java new file mode 100644 index 000000000000..82070df364b7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java @@ -0,0 +1,83 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.TargetHttpsProxy; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpsProxyList; +import com.google.cloud.compute.v1.TargetHttpsProxyName; +import com.google.cloud.compute.v1.UrlMapReference; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetHttpsProxyStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteTargetHttpsProxyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetHttpsProxyCallable()"); + } + + @BetaApi + public UnaryCallable getTargetHttpsProxyCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetHttpsProxyCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetHttpsProxyCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetHttpsProxyCallable()"); + } + + @BetaApi + public UnaryCallable listTargetHttpsProxiesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetHttpsProxiesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetHttpsProxiesCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetHttpsProxiesCallable()"); + } + + @BetaApi + public UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setSslCertificatesTargetHttpsProxyCallable()"); + } + + @BetaApi + public UnaryCallable setUrlMapTargetHttpsProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setUrlMapTargetHttpsProxyCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java new file mode 100644 index 000000000000..f140fb65e35d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.TargetHttpsProxy; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetHttpsProxyList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetHttpsProxyStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetHttpsProxy to 30 seconds: + * + *

+ * 
+ * TargetHttpsProxyStubSettings.Builder targetHttpsProxySettingsBuilder =
+ *     TargetHttpsProxyStubSettings.newBuilder();
+ * targetHttpsProxySettingsBuilder.deleteTargetHttpsProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetHttpsProxyStubSettings targetHttpsProxySettings = targetHttpsProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetHttpsProxyStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteTargetHttpsProxySettings; + private final UnaryCallSettings getTargetHttpsProxySettings; + private final UnaryCallSettings insertTargetHttpsProxySettings; + private final PagedCallSettings listTargetHttpsProxiesSettings; + private final UnaryCallSettings setSslCertificatesTargetHttpsProxySettings; + private final UnaryCallSettings setUrlMapTargetHttpsProxySettings; + + /** + * Returns the object with the settings used for calls to deleteTargetHttpsProxy. + */ + public UnaryCallSettings deleteTargetHttpsProxySettings() { + return deleteTargetHttpsProxySettings; + } + + /** + * Returns the object with the settings used for calls to getTargetHttpsProxy. + */ + public UnaryCallSettings getTargetHttpsProxySettings() { + return getTargetHttpsProxySettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetHttpsProxy. + */ + public UnaryCallSettings insertTargetHttpsProxySettings() { + return insertTargetHttpsProxySettings; + } + + /** + * Returns the object with the settings used for calls to listTargetHttpsProxies. + */ + public PagedCallSettings listTargetHttpsProxiesSettings() { + return listTargetHttpsProxiesSettings; + } + + /** + * Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy. + */ + public UnaryCallSettings setSslCertificatesTargetHttpsProxySettings() { + return setSslCertificatesTargetHttpsProxySettings; + } + + /** + * Returns the object with the settings used for calls to setUrlMapTargetHttpsProxy. + */ + public UnaryCallSettings setUrlMapTargetHttpsProxySettings() { + return setUrlMapTargetHttpsProxySettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetHttpsProxyStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetHttpsProxyStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetHttpsProxyStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetHttpsProxyStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteTargetHttpsProxySettings = settingsBuilder.deleteTargetHttpsProxySettings().build(); + getTargetHttpsProxySettings = settingsBuilder.getTargetHttpsProxySettings().build(); + insertTargetHttpsProxySettings = settingsBuilder.insertTargetHttpsProxySettings().build(); + listTargetHttpsProxiesSettings = settingsBuilder.listTargetHttpsProxiesSettings().build(); + setSslCertificatesTargetHttpsProxySettings = settingsBuilder.setSslCertificatesTargetHttpsProxySettings().build(); + setUrlMapTargetHttpsProxySettings = settingsBuilder.setUrlMapTargetHttpsProxySettings().build(); + } + + private static final PagedListDescriptor LIST_TARGET_HTTPS_PROXIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetHttpsProxiesHttpRequest injectToken(ListTargetHttpsProxiesHttpRequest payload, String token) { + return ListTargetHttpsProxiesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetHttpsProxiesHttpRequest injectPageSize(ListTargetHttpsProxiesHttpRequest payload, int pageSize) { + return ListTargetHttpsProxiesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetHttpsProxiesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetHttpsProxyList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetHttpsProxyList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetHttpsProxiesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_HTTPS_PROXIES_PAGE_STR_DESC, request, context); + return ListTargetHttpsProxiesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetHttpsProxyStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteTargetHttpsProxySettings; + private final UnaryCallSettings.Builder getTargetHttpsProxySettings; + private final UnaryCallSettings.Builder insertTargetHttpsProxySettings; + private final PagedCallSettings.Builder listTargetHttpsProxiesSettings; + private final UnaryCallSettings.Builder setSslCertificatesTargetHttpsProxySettings; + private final UnaryCallSettings.Builder setUrlMapTargetHttpsProxySettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetHttpsProxiesSettings = PagedCallSettings.newBuilder( + LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT); + + setSslCertificatesTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setUrlMapTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetHttpsProxySettings, + getTargetHttpsProxySettings, + insertTargetHttpsProxySettings, + listTargetHttpsProxiesSettings, + setSslCertificatesTargetHttpsProxySettings, + setUrlMapTargetHttpsProxySettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteTargetHttpsProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetHttpsProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetHttpsProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetHttpsProxiesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setSslCertificatesTargetHttpsProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setUrlMapTargetHttpsProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetHttpsProxyStubSettings settings) { + super(settings); + + deleteTargetHttpsProxySettings = settings.deleteTargetHttpsProxySettings.toBuilder(); + getTargetHttpsProxySettings = settings.getTargetHttpsProxySettings.toBuilder(); + insertTargetHttpsProxySettings = settings.insertTargetHttpsProxySettings.toBuilder(); + listTargetHttpsProxiesSettings = settings.listTargetHttpsProxiesSettings.toBuilder(); + setSslCertificatesTargetHttpsProxySettings = settings.setSslCertificatesTargetHttpsProxySettings.toBuilder(); + setUrlMapTargetHttpsProxySettings = settings.setUrlMapTargetHttpsProxySettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetHttpsProxySettings, + getTargetHttpsProxySettings, + insertTargetHttpsProxySettings, + listTargetHttpsProxiesSettings, + setSslCertificatesTargetHttpsProxySettings, + setUrlMapTargetHttpsProxySettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetHttpsProxy. + */ + public UnaryCallSettings.Builder deleteTargetHttpsProxySettings() { + return deleteTargetHttpsProxySettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetHttpsProxy. + */ + public UnaryCallSettings.Builder getTargetHttpsProxySettings() { + return getTargetHttpsProxySettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetHttpsProxy. + */ + public UnaryCallSettings.Builder insertTargetHttpsProxySettings() { + return insertTargetHttpsProxySettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetHttpsProxies. + */ + public PagedCallSettings.Builder listTargetHttpsProxiesSettings() { + return listTargetHttpsProxiesSettings; + } + + /** + * Returns the builder for the settings used for calls to setSslCertificatesTargetHttpsProxy. + */ + public UnaryCallSettings.Builder setSslCertificatesTargetHttpsProxySettings() { + return setSslCertificatesTargetHttpsProxySettings; + } + + /** + * Returns the builder for the settings used for calls to setUrlMapTargetHttpsProxy. + */ + public UnaryCallSettings.Builder setUrlMapTargetHttpsProxySettings() { + return setUrlMapTargetHttpsProxySettings; + } + + @Override + public TargetHttpsProxyStubSettings build() throws IOException { + return new TargetHttpsProxyStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java new file mode 100644 index 000000000000..544cd9abb8c1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.TargetInstance; +import com.google.cloud.compute.v1.TargetInstanceAggregatedList; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import com.google.cloud.compute.v1.TargetInstanceList; +import com.google.cloud.compute.v1.TargetInstanceName; +import com.google.cloud.compute.v1.TargetInstancesScopedList; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetInstanceStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListTargetInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListTargetInstancesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListTargetInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListTargetInstancesCallable()"); + } + + @BetaApi + public UnaryCallable deleteTargetInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetInstanceCallable()"); + } + + @BetaApi + public UnaryCallable getTargetInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetInstanceCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetInstanceCallable()"); + } + + @BetaApi + public UnaryCallable listTargetInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetInstancesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetInstancesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java new file mode 100644 index 000000000000..590d0ba7a209 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertTargetInstanceHttpRequest; +import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.TargetInstance; +import com.google.cloud.compute.v1.TargetInstanceAggregatedList; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import com.google.cloud.compute.v1.TargetInstanceList; +import com.google.cloud.compute.v1.TargetInstancesScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetInstanceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetInstance to 30 seconds: + * + *

+ * 
+ * TargetInstanceStubSettings.Builder targetInstanceSettingsBuilder =
+ *     TargetInstanceStubSettings.newBuilder();
+ * targetInstanceSettingsBuilder.deleteTargetInstanceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetInstanceStubSettings targetInstanceSettings = targetInstanceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetInstanceStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListTargetInstancesSettings; + private final UnaryCallSettings deleteTargetInstanceSettings; + private final UnaryCallSettings getTargetInstanceSettings; + private final UnaryCallSettings insertTargetInstanceSettings; + private final PagedCallSettings listTargetInstancesSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListTargetInstances. + */ + public PagedCallSettings aggregatedListTargetInstancesSettings() { + return aggregatedListTargetInstancesSettings; + } + + /** + * Returns the object with the settings used for calls to deleteTargetInstance. + */ + public UnaryCallSettings deleteTargetInstanceSettings() { + return deleteTargetInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to getTargetInstance. + */ + public UnaryCallSettings getTargetInstanceSettings() { + return getTargetInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetInstance. + */ + public UnaryCallSettings insertTargetInstanceSettings() { + return insertTargetInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to listTargetInstances. + */ + public PagedCallSettings listTargetInstancesSettings() { + return listTargetInstancesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetInstanceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetInstanceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetInstanceStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetInstanceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListTargetInstancesSettings = settingsBuilder.aggregatedListTargetInstancesSettings().build(); + deleteTargetInstanceSettings = settingsBuilder.deleteTargetInstanceSettings().build(); + getTargetInstanceSettings = settingsBuilder.getTargetInstanceSettings().build(); + insertTargetInstanceSettings = settingsBuilder.insertTargetInstanceSettings().build(); + listTargetInstancesSettings = settingsBuilder.listTargetInstancesSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListTargetInstancesHttpRequest injectToken(AggregatedListTargetInstancesHttpRequest payload, String token) { + return AggregatedListTargetInstancesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListTargetInstancesHttpRequest injectPageSize(AggregatedListTargetInstancesHttpRequest payload, int pageSize) { + return AggregatedListTargetInstancesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListTargetInstancesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetInstanceAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetInstanceAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_TARGET_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetInstancesHttpRequest injectToken(ListTargetInstancesHttpRequest payload, String token) { + return ListTargetInstancesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetInstancesHttpRequest injectPageSize(ListTargetInstancesHttpRequest payload, int pageSize) { + return ListTargetInstancesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetInstancesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetInstanceList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetInstanceList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListTargetInstancesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_DESC, request, context); + return AggregatedListTargetInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetInstancesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_INSTANCES_PAGE_STR_DESC, request, context); + return ListTargetInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetInstanceStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListTargetInstancesSettings; + private final UnaryCallSettings.Builder deleteTargetInstanceSettings; + private final UnaryCallSettings.Builder getTargetInstanceSettings; + private final UnaryCallSettings.Builder insertTargetInstanceSettings; + private final PagedCallSettings.Builder listTargetInstancesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListTargetInstancesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_FACT); + + deleteTargetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetInstancesSettings = PagedCallSettings.newBuilder( + LIST_TARGET_INSTANCES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListTargetInstancesSettings, + deleteTargetInstanceSettings, + getTargetInstanceSettings, + insertTargetInstanceSettings, + listTargetInstancesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListTargetInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteTargetInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetInstanceStubSettings settings) { + super(settings); + + aggregatedListTargetInstancesSettings = settings.aggregatedListTargetInstancesSettings.toBuilder(); + deleteTargetInstanceSettings = settings.deleteTargetInstanceSettings.toBuilder(); + getTargetInstanceSettings = settings.getTargetInstanceSettings.toBuilder(); + insertTargetInstanceSettings = settings.insertTargetInstanceSettings.toBuilder(); + listTargetInstancesSettings = settings.listTargetInstancesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListTargetInstancesSettings, + deleteTargetInstanceSettings, + getTargetInstanceSettings, + insertTargetInstanceSettings, + listTargetInstancesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListTargetInstances. + */ + public PagedCallSettings.Builder aggregatedListTargetInstancesSettings() { + return aggregatedListTargetInstancesSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetInstance. + */ + public UnaryCallSettings.Builder deleteTargetInstanceSettings() { + return deleteTargetInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetInstance. + */ + public UnaryCallSettings.Builder getTargetInstanceSettings() { + return getTargetInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetInstance. + */ + public UnaryCallSettings.Builder insertTargetInstanceSettings() { + return insertTargetInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetInstances. + */ + public PagedCallSettings.Builder listTargetInstancesSettings() { + return listTargetInstancesSettings; + } + + @Override + public TargetInstanceStubSettings build() throws IOException { + return new TargetInstanceStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java new file mode 100644 index 000000000000..15577cd3ad23 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java @@ -0,0 +1,127 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AddInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AggregatedListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InstanceReference; +import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; +import com.google.cloud.compute.v1.TargetPool; +import com.google.cloud.compute.v1.TargetPoolAggregatedList; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; +import com.google.cloud.compute.v1.TargetPoolInstanceHealth; +import com.google.cloud.compute.v1.TargetPoolList; +import com.google.cloud.compute.v1.TargetPoolName; +import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; +import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest; +import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; +import com.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; +import com.google.cloud.compute.v1.TargetPoolsScopedList; +import com.google.cloud.compute.v1.TargetReference; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetPoolStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable addHealthCheckTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: addHealthCheckTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable addInstanceTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: addInstanceTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListTargetPoolsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListTargetPoolsPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListTargetPoolsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListTargetPoolsCallable()"); + } + + @BetaApi + public UnaryCallable deleteTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable getTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable getHealthTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: getHealthTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable listTargetPoolsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetPoolsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetPoolsCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetPoolsCallable()"); + } + + @BetaApi + public UnaryCallable removeHealthCheckTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: removeHealthCheckTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable removeInstanceTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: removeInstanceTargetPoolCallable()"); + } + + @BetaApi + public UnaryCallable setBackupTargetPoolCallable() { + throw new UnsupportedOperationException("Not implemented: setBackupTargetPoolCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java new file mode 100644 index 000000000000..1bfd1bd045c6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java @@ -0,0 +1,689 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AddInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.AggregatedListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; +import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; +import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; +import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest; +import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest; +import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; +import com.google.cloud.compute.v1.TargetPool; +import com.google.cloud.compute.v1.TargetPoolAggregatedList; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; +import com.google.cloud.compute.v1.TargetPoolInstanceHealth; +import com.google.cloud.compute.v1.TargetPoolList; +import com.google.cloud.compute.v1.TargetPoolsScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetPoolStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addHealthCheckTargetPool to 30 seconds: + * + *

+ * 
+ * TargetPoolStubSettings.Builder targetPoolSettingsBuilder =
+ *     TargetPoolStubSettings.newBuilder();
+ * targetPoolSettingsBuilder.addHealthCheckTargetPoolSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetPoolStubSettings targetPoolSettings = targetPoolSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetPoolStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings addHealthCheckTargetPoolSettings; + private final UnaryCallSettings addInstanceTargetPoolSettings; + private final PagedCallSettings aggregatedListTargetPoolsSettings; + private final UnaryCallSettings deleteTargetPoolSettings; + private final UnaryCallSettings getTargetPoolSettings; + private final UnaryCallSettings getHealthTargetPoolSettings; + private final UnaryCallSettings insertTargetPoolSettings; + private final PagedCallSettings listTargetPoolsSettings; + private final UnaryCallSettings removeHealthCheckTargetPoolSettings; + private final UnaryCallSettings removeInstanceTargetPoolSettings; + private final UnaryCallSettings setBackupTargetPoolSettings; + + /** + * Returns the object with the settings used for calls to addHealthCheckTargetPool. + */ + public UnaryCallSettings addHealthCheckTargetPoolSettings() { + return addHealthCheckTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to addInstanceTargetPool. + */ + public UnaryCallSettings addInstanceTargetPoolSettings() { + return addInstanceTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to aggregatedListTargetPools. + */ + public PagedCallSettings aggregatedListTargetPoolsSettings() { + return aggregatedListTargetPoolsSettings; + } + + /** + * Returns the object with the settings used for calls to deleteTargetPool. + */ + public UnaryCallSettings deleteTargetPoolSettings() { + return deleteTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to getTargetPool. + */ + public UnaryCallSettings getTargetPoolSettings() { + return getTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to getHealthTargetPool. + */ + public UnaryCallSettings getHealthTargetPoolSettings() { + return getHealthTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetPool. + */ + public UnaryCallSettings insertTargetPoolSettings() { + return insertTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to listTargetPools. + */ + public PagedCallSettings listTargetPoolsSettings() { + return listTargetPoolsSettings; + } + + /** + * Returns the object with the settings used for calls to removeHealthCheckTargetPool. + */ + public UnaryCallSettings removeHealthCheckTargetPoolSettings() { + return removeHealthCheckTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to removeInstanceTargetPool. + */ + public UnaryCallSettings removeInstanceTargetPoolSettings() { + return removeInstanceTargetPoolSettings; + } + + /** + * Returns the object with the settings used for calls to setBackupTargetPool. + */ + public UnaryCallSettings setBackupTargetPoolSettings() { + return setBackupTargetPoolSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetPoolStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetPoolStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetPoolStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetPoolStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + addHealthCheckTargetPoolSettings = settingsBuilder.addHealthCheckTargetPoolSettings().build(); + addInstanceTargetPoolSettings = settingsBuilder.addInstanceTargetPoolSettings().build(); + aggregatedListTargetPoolsSettings = settingsBuilder.aggregatedListTargetPoolsSettings().build(); + deleteTargetPoolSettings = settingsBuilder.deleteTargetPoolSettings().build(); + getTargetPoolSettings = settingsBuilder.getTargetPoolSettings().build(); + getHealthTargetPoolSettings = settingsBuilder.getHealthTargetPoolSettings().build(); + insertTargetPoolSettings = settingsBuilder.insertTargetPoolSettings().build(); + listTargetPoolsSettings = settingsBuilder.listTargetPoolsSettings().build(); + removeHealthCheckTargetPoolSettings = settingsBuilder.removeHealthCheckTargetPoolSettings().build(); + removeInstanceTargetPoolSettings = settingsBuilder.removeInstanceTargetPoolSettings().build(); + setBackupTargetPoolSettings = settingsBuilder.setBackupTargetPoolSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListTargetPoolsHttpRequest injectToken(AggregatedListTargetPoolsHttpRequest payload, String token) { + return AggregatedListTargetPoolsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListTargetPoolsHttpRequest injectPageSize(AggregatedListTargetPoolsHttpRequest payload, int pageSize) { + return AggregatedListTargetPoolsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListTargetPoolsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetPoolAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetPoolAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_TARGET_POOLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetPoolsHttpRequest injectToken(ListTargetPoolsHttpRequest payload, String token) { + return ListTargetPoolsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetPoolsHttpRequest injectPageSize(ListTargetPoolsHttpRequest payload, int pageSize) { + return ListTargetPoolsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetPoolsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetPoolList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetPoolList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListTargetPoolsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_DESC, request, context); + return AggregatedListTargetPoolsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_POOLS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetPoolsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_POOLS_PAGE_STR_DESC, request, context); + return ListTargetPoolsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetPoolStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder addHealthCheckTargetPoolSettings; + private final UnaryCallSettings.Builder addInstanceTargetPoolSettings; + private final PagedCallSettings.Builder aggregatedListTargetPoolsSettings; + private final UnaryCallSettings.Builder deleteTargetPoolSettings; + private final UnaryCallSettings.Builder getTargetPoolSettings; + private final UnaryCallSettings.Builder getHealthTargetPoolSettings; + private final UnaryCallSettings.Builder insertTargetPoolSettings; + private final PagedCallSettings.Builder listTargetPoolsSettings; + private final UnaryCallSettings.Builder removeHealthCheckTargetPoolSettings; + private final UnaryCallSettings.Builder removeInstanceTargetPoolSettings; + private final UnaryCallSettings.Builder setBackupTargetPoolSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + addHealthCheckTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + addInstanceTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + aggregatedListTargetPoolsSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_FACT); + + deleteTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getHealthTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetPoolsSettings = PagedCallSettings.newBuilder( + LIST_TARGET_POOLS_PAGE_STR_FACT); + + removeHealthCheckTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + removeInstanceTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setBackupTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + addHealthCheckTargetPoolSettings, + addInstanceTargetPoolSettings, + aggregatedListTargetPoolsSettings, + deleteTargetPoolSettings, + getTargetPoolSettings, + getHealthTargetPoolSettings, + insertTargetPoolSettings, + listTargetPoolsSettings, + removeHealthCheckTargetPoolSettings, + removeInstanceTargetPoolSettings, + setBackupTargetPoolSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.addHealthCheckTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.addInstanceTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.aggregatedListTargetPoolsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getHealthTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetPoolsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.removeHealthCheckTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.removeInstanceTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setBackupTargetPoolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetPoolStubSettings settings) { + super(settings); + + addHealthCheckTargetPoolSettings = settings.addHealthCheckTargetPoolSettings.toBuilder(); + addInstanceTargetPoolSettings = settings.addInstanceTargetPoolSettings.toBuilder(); + aggregatedListTargetPoolsSettings = settings.aggregatedListTargetPoolsSettings.toBuilder(); + deleteTargetPoolSettings = settings.deleteTargetPoolSettings.toBuilder(); + getTargetPoolSettings = settings.getTargetPoolSettings.toBuilder(); + getHealthTargetPoolSettings = settings.getHealthTargetPoolSettings.toBuilder(); + insertTargetPoolSettings = settings.insertTargetPoolSettings.toBuilder(); + listTargetPoolsSettings = settings.listTargetPoolsSettings.toBuilder(); + removeHealthCheckTargetPoolSettings = settings.removeHealthCheckTargetPoolSettings.toBuilder(); + removeInstanceTargetPoolSettings = settings.removeInstanceTargetPoolSettings.toBuilder(); + setBackupTargetPoolSettings = settings.setBackupTargetPoolSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + addHealthCheckTargetPoolSettings, + addInstanceTargetPoolSettings, + aggregatedListTargetPoolsSettings, + deleteTargetPoolSettings, + getTargetPoolSettings, + getHealthTargetPoolSettings, + insertTargetPoolSettings, + listTargetPoolsSettings, + removeHealthCheckTargetPoolSettings, + removeInstanceTargetPoolSettings, + setBackupTargetPoolSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to addHealthCheckTargetPool. + */ + public UnaryCallSettings.Builder addHealthCheckTargetPoolSettings() { + return addHealthCheckTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to addInstanceTargetPool. + */ + public UnaryCallSettings.Builder addInstanceTargetPoolSettings() { + return addInstanceTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListTargetPools. + */ + public PagedCallSettings.Builder aggregatedListTargetPoolsSettings() { + return aggregatedListTargetPoolsSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetPool. + */ + public UnaryCallSettings.Builder deleteTargetPoolSettings() { + return deleteTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetPool. + */ + public UnaryCallSettings.Builder getTargetPoolSettings() { + return getTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to getHealthTargetPool. + */ + public UnaryCallSettings.Builder getHealthTargetPoolSettings() { + return getHealthTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetPool. + */ + public UnaryCallSettings.Builder insertTargetPoolSettings() { + return insertTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetPools. + */ + public PagedCallSettings.Builder listTargetPoolsSettings() { + return listTargetPoolsSettings; + } + + /** + * Returns the builder for the settings used for calls to removeHealthCheckTargetPool. + */ + public UnaryCallSettings.Builder removeHealthCheckTargetPoolSettings() { + return removeHealthCheckTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to removeInstanceTargetPool. + */ + public UnaryCallSettings.Builder removeInstanceTargetPoolSettings() { + return removeInstanceTargetPoolSettings; + } + + /** + * Returns the builder for the settings used for calls to setBackupTargetPool. + */ + public UnaryCallSettings.Builder setBackupTargetPoolSettings() { + return setBackupTargetPoolSettings; + } + + @Override + public TargetPoolStubSettings build() throws IOException { + return new TargetPoolStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java new file mode 100644 index 000000000000..6d140f2aad68 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java @@ -0,0 +1,90 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.TargetSslProxy; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetSslProxyList; +import com.google.cloud.compute.v1.TargetSslProxyName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetSslProxyStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteTargetSslProxyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetSslProxyCallable()"); + } + + @BetaApi + public UnaryCallable getTargetSslProxyCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetSslProxyCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetSslProxyCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetSslProxyCallable()"); + } + + @BetaApi + public UnaryCallable listTargetSslProxiesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetSslProxiesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetSslProxiesCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetSslProxiesCallable()"); + } + + @BetaApi + public UnaryCallable setBackendServiceTargetSslProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setBackendServiceTargetSslProxyCallable()"); + } + + @BetaApi + public UnaryCallable setProxyHeaderTargetSslProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setProxyHeaderTargetSslProxyCallable()"); + } + + @BetaApi + public UnaryCallable setSslCertificatesTargetSslProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setSslCertificatesTargetSslProxyCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java new file mode 100644 index 000000000000..0b5b14153262 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java @@ -0,0 +1,528 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.TargetSslProxy; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetSslProxyList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetSslProxyStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetSslProxy to 30 seconds: + * + *

+ * 
+ * TargetSslProxyStubSettings.Builder targetSslProxySettingsBuilder =
+ *     TargetSslProxyStubSettings.newBuilder();
+ * targetSslProxySettingsBuilder.deleteTargetSslProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetSslProxyStubSettings targetSslProxySettings = targetSslProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetSslProxyStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteTargetSslProxySettings; + private final UnaryCallSettings getTargetSslProxySettings; + private final UnaryCallSettings insertTargetSslProxySettings; + private final PagedCallSettings listTargetSslProxiesSettings; + private final UnaryCallSettings setBackendServiceTargetSslProxySettings; + private final UnaryCallSettings setProxyHeaderTargetSslProxySettings; + private final UnaryCallSettings setSslCertificatesTargetSslProxySettings; + + /** + * Returns the object with the settings used for calls to deleteTargetSslProxy. + */ + public UnaryCallSettings deleteTargetSslProxySettings() { + return deleteTargetSslProxySettings; + } + + /** + * Returns the object with the settings used for calls to getTargetSslProxy. + */ + public UnaryCallSettings getTargetSslProxySettings() { + return getTargetSslProxySettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetSslProxy. + */ + public UnaryCallSettings insertTargetSslProxySettings() { + return insertTargetSslProxySettings; + } + + /** + * Returns the object with the settings used for calls to listTargetSslProxies. + */ + public PagedCallSettings listTargetSslProxiesSettings() { + return listTargetSslProxiesSettings; + } + + /** + * Returns the object with the settings used for calls to setBackendServiceTargetSslProxy. + */ + public UnaryCallSettings setBackendServiceTargetSslProxySettings() { + return setBackendServiceTargetSslProxySettings; + } + + /** + * Returns the object with the settings used for calls to setProxyHeaderTargetSslProxy. + */ + public UnaryCallSettings setProxyHeaderTargetSslProxySettings() { + return setProxyHeaderTargetSslProxySettings; + } + + /** + * Returns the object with the settings used for calls to setSslCertificatesTargetSslProxy. + */ + public UnaryCallSettings setSslCertificatesTargetSslProxySettings() { + return setSslCertificatesTargetSslProxySettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetSslProxyStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetSslProxyStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetSslProxyStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetSslProxyStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteTargetSslProxySettings = settingsBuilder.deleteTargetSslProxySettings().build(); + getTargetSslProxySettings = settingsBuilder.getTargetSslProxySettings().build(); + insertTargetSslProxySettings = settingsBuilder.insertTargetSslProxySettings().build(); + listTargetSslProxiesSettings = settingsBuilder.listTargetSslProxiesSettings().build(); + setBackendServiceTargetSslProxySettings = settingsBuilder.setBackendServiceTargetSslProxySettings().build(); + setProxyHeaderTargetSslProxySettings = settingsBuilder.setProxyHeaderTargetSslProxySettings().build(); + setSslCertificatesTargetSslProxySettings = settingsBuilder.setSslCertificatesTargetSslProxySettings().build(); + } + + private static final PagedListDescriptor LIST_TARGET_SSL_PROXIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetSslProxiesHttpRequest injectToken(ListTargetSslProxiesHttpRequest payload, String token) { + return ListTargetSslProxiesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetSslProxiesHttpRequest injectPageSize(ListTargetSslProxiesHttpRequest payload, int pageSize) { + return ListTargetSslProxiesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetSslProxiesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetSslProxyList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetSslProxyList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_SSL_PROXIES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetSslProxiesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_SSL_PROXIES_PAGE_STR_DESC, request, context); + return ListTargetSslProxiesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetSslProxyStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteTargetSslProxySettings; + private final UnaryCallSettings.Builder getTargetSslProxySettings; + private final UnaryCallSettings.Builder insertTargetSslProxySettings; + private final PagedCallSettings.Builder listTargetSslProxiesSettings; + private final UnaryCallSettings.Builder setBackendServiceTargetSslProxySettings; + private final UnaryCallSettings.Builder setProxyHeaderTargetSslProxySettings; + private final UnaryCallSettings.Builder setSslCertificatesTargetSslProxySettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetSslProxiesSettings = PagedCallSettings.newBuilder( + LIST_TARGET_SSL_PROXIES_PAGE_STR_FACT); + + setBackendServiceTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setProxyHeaderTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setSslCertificatesTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetSslProxySettings, + getTargetSslProxySettings, + insertTargetSslProxySettings, + listTargetSslProxiesSettings, + setBackendServiceTargetSslProxySettings, + setProxyHeaderTargetSslProxySettings, + setSslCertificatesTargetSslProxySettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteTargetSslProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetSslProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetSslProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetSslProxiesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setBackendServiceTargetSslProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setProxyHeaderTargetSslProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setSslCertificatesTargetSslProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetSslProxyStubSettings settings) { + super(settings); + + deleteTargetSslProxySettings = settings.deleteTargetSslProxySettings.toBuilder(); + getTargetSslProxySettings = settings.getTargetSslProxySettings.toBuilder(); + insertTargetSslProxySettings = settings.insertTargetSslProxySettings.toBuilder(); + listTargetSslProxiesSettings = settings.listTargetSslProxiesSettings.toBuilder(); + setBackendServiceTargetSslProxySettings = settings.setBackendServiceTargetSslProxySettings.toBuilder(); + setProxyHeaderTargetSslProxySettings = settings.setProxyHeaderTargetSslProxySettings.toBuilder(); + setSslCertificatesTargetSslProxySettings = settings.setSslCertificatesTargetSslProxySettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetSslProxySettings, + getTargetSslProxySettings, + insertTargetSslProxySettings, + listTargetSslProxiesSettings, + setBackendServiceTargetSslProxySettings, + setProxyHeaderTargetSslProxySettings, + setSslCertificatesTargetSslProxySettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetSslProxy. + */ + public UnaryCallSettings.Builder deleteTargetSslProxySettings() { + return deleteTargetSslProxySettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetSslProxy. + */ + public UnaryCallSettings.Builder getTargetSslProxySettings() { + return getTargetSslProxySettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetSslProxy. + */ + public UnaryCallSettings.Builder insertTargetSslProxySettings() { + return insertTargetSslProxySettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetSslProxies. + */ + public PagedCallSettings.Builder listTargetSslProxiesSettings() { + return listTargetSslProxiesSettings; + } + + /** + * Returns the builder for the settings used for calls to setBackendServiceTargetSslProxy. + */ + public UnaryCallSettings.Builder setBackendServiceTargetSslProxySettings() { + return setBackendServiceTargetSslProxySettings; + } + + /** + * Returns the builder for the settings used for calls to setProxyHeaderTargetSslProxy. + */ + public UnaryCallSettings.Builder setProxyHeaderTargetSslProxySettings() { + return setProxyHeaderTargetSslProxySettings; + } + + /** + * Returns the builder for the settings used for calls to setSslCertificatesTargetSslProxy. + */ + public UnaryCallSettings.Builder setSslCertificatesTargetSslProxySettings() { + return setSslCertificatesTargetSslProxySettings; + } + + @Override + public TargetSslProxyStubSettings build() throws IOException { + return new TargetSslProxyStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java new file mode 100644 index 000000000000..1330e1c0a6e7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.GetTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.InsertTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.TargetVpnGateway; +import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import com.google.cloud.compute.v1.TargetVpnGatewayList; +import com.google.cloud.compute.v1.TargetVpnGatewayName; +import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetVpnGatewayStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListTargetVpnGatewaysPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListTargetVpnGatewaysCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListTargetVpnGatewaysCallable()"); + } + + @BetaApi + public UnaryCallable deleteTargetVpnGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetVpnGatewayCallable()"); + } + + @BetaApi + public UnaryCallable getTargetVpnGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetVpnGatewayCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetVpnGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetVpnGatewayCallable()"); + } + + @BetaApi + public UnaryCallable listTargetVpnGatewaysPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetVpnGatewaysPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetVpnGatewaysCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetVpnGatewaysCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java new file mode 100644 index 000000000000..939fbd47a303 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.DeleteTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.GetTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.InsertTargetVpnGatewayHttpRequest; +import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.TargetVpnGateway; +import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import com.google.cloud.compute.v1.TargetVpnGatewayList; +import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetVpnGatewayStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetVpnGateway to 30 seconds: + * + *

+ * 
+ * TargetVpnGatewayStubSettings.Builder targetVpnGatewaySettingsBuilder =
+ *     TargetVpnGatewayStubSettings.newBuilder();
+ * targetVpnGatewaySettingsBuilder.deleteTargetVpnGatewaySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetVpnGatewayStubSettings targetVpnGatewaySettings = targetVpnGatewaySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetVpnGatewayStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListTargetVpnGatewaysSettings; + private final UnaryCallSettings deleteTargetVpnGatewaySettings; + private final UnaryCallSettings getTargetVpnGatewaySettings; + private final UnaryCallSettings insertTargetVpnGatewaySettings; + private final PagedCallSettings listTargetVpnGatewaysSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListTargetVpnGateways. + */ + public PagedCallSettings aggregatedListTargetVpnGatewaysSettings() { + return aggregatedListTargetVpnGatewaysSettings; + } + + /** + * Returns the object with the settings used for calls to deleteTargetVpnGateway. + */ + public UnaryCallSettings deleteTargetVpnGatewaySettings() { + return deleteTargetVpnGatewaySettings; + } + + /** + * Returns the object with the settings used for calls to getTargetVpnGateway. + */ + public UnaryCallSettings getTargetVpnGatewaySettings() { + return getTargetVpnGatewaySettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetVpnGateway. + */ + public UnaryCallSettings insertTargetVpnGatewaySettings() { + return insertTargetVpnGatewaySettings; + } + + /** + * Returns the object with the settings used for calls to listTargetVpnGateways. + */ + public PagedCallSettings listTargetVpnGatewaysSettings() { + return listTargetVpnGatewaysSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetVpnGatewayStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetVpnGatewayStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetVpnGatewayStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetVpnGatewayStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListTargetVpnGatewaysSettings = settingsBuilder.aggregatedListTargetVpnGatewaysSettings().build(); + deleteTargetVpnGatewaySettings = settingsBuilder.deleteTargetVpnGatewaySettings().build(); + getTargetVpnGatewaySettings = settingsBuilder.getTargetVpnGatewaySettings().build(); + insertTargetVpnGatewaySettings = settingsBuilder.insertTargetVpnGatewaySettings().build(); + listTargetVpnGatewaysSettings = settingsBuilder.listTargetVpnGatewaysSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListTargetVpnGatewaysHttpRequest injectToken(AggregatedListTargetVpnGatewaysHttpRequest payload, String token) { + return AggregatedListTargetVpnGatewaysHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListTargetVpnGatewaysHttpRequest injectPageSize(AggregatedListTargetVpnGatewaysHttpRequest payload, int pageSize) { + return AggregatedListTargetVpnGatewaysHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListTargetVpnGatewaysHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetVpnGatewayAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetVpnGatewayAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetVpnGatewaysHttpRequest injectToken(ListTargetVpnGatewaysHttpRequest payload, String token) { + return ListTargetVpnGatewaysHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetVpnGatewaysHttpRequest injectPageSize(ListTargetVpnGatewaysHttpRequest payload, int pageSize) { + return ListTargetVpnGatewaysHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetVpnGatewaysHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetVpnGatewayList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetVpnGatewayList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListTargetVpnGatewaysHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC, request, context); + return AggregatedListTargetVpnGatewaysPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetVpnGatewaysHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC, request, context); + return ListTargetVpnGatewaysPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetVpnGatewayStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListTargetVpnGatewaysSettings; + private final UnaryCallSettings.Builder deleteTargetVpnGatewaySettings; + private final UnaryCallSettings.Builder getTargetVpnGatewaySettings; + private final UnaryCallSettings.Builder insertTargetVpnGatewaySettings; + private final PagedCallSettings.Builder listTargetVpnGatewaysSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListTargetVpnGatewaysSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT); + + deleteTargetVpnGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetVpnGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetVpnGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetVpnGatewaysSettings = PagedCallSettings.newBuilder( + LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListTargetVpnGatewaysSettings, + deleteTargetVpnGatewaySettings, + getTargetVpnGatewaySettings, + insertTargetVpnGatewaySettings, + listTargetVpnGatewaysSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListTargetVpnGatewaysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteTargetVpnGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetVpnGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetVpnGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetVpnGatewaysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetVpnGatewayStubSettings settings) { + super(settings); + + aggregatedListTargetVpnGatewaysSettings = settings.aggregatedListTargetVpnGatewaysSettings.toBuilder(); + deleteTargetVpnGatewaySettings = settings.deleteTargetVpnGatewaySettings.toBuilder(); + getTargetVpnGatewaySettings = settings.getTargetVpnGatewaySettings.toBuilder(); + insertTargetVpnGatewaySettings = settings.insertTargetVpnGatewaySettings.toBuilder(); + listTargetVpnGatewaysSettings = settings.listTargetVpnGatewaysSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListTargetVpnGatewaysSettings, + deleteTargetVpnGatewaySettings, + getTargetVpnGatewaySettings, + insertTargetVpnGatewaySettings, + listTargetVpnGatewaysSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListTargetVpnGateways. + */ + public PagedCallSettings.Builder aggregatedListTargetVpnGatewaysSettings() { + return aggregatedListTargetVpnGatewaysSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetVpnGateway. + */ + public UnaryCallSettings.Builder deleteTargetVpnGatewaySettings() { + return deleteTargetVpnGatewaySettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetVpnGateway. + */ + public UnaryCallSettings.Builder getTargetVpnGatewaySettings() { + return getTargetVpnGatewaySettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetVpnGateway. + */ + public UnaryCallSettings.Builder insertTargetVpnGatewaySettings() { + return insertTargetVpnGatewaySettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetVpnGateways. + */ + public PagedCallSettings.Builder listTargetVpnGatewaysSettings() { + return listTargetVpnGatewaysSettings; + } + + @Override + public TargetVpnGatewayStubSettings build() throws IOException { + return new TargetVpnGatewayStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java new file mode 100644 index 000000000000..a73e6a4f1430 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.CacheInvalidationRule; +import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; +import com.google.cloud.compute.v1.GetUrlMapHttpRequest; +import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; +import com.google.cloud.compute.v1.InvalidateCacheUrlMapHttpRequest; +import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; +import com.google.cloud.compute.v1.UrlMap; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import com.google.cloud.compute.v1.UrlMapList; +import com.google.cloud.compute.v1.UrlMapName; +import com.google.cloud.compute.v1.UrlMapsValidateRequest; +import com.google.cloud.compute.v1.UrlMapsValidateResponse; +import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class UrlMapStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUrlMapCallable()"); + } + + @BetaApi + public UnaryCallable getUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: getUrlMapCallable()"); + } + + @BetaApi + public UnaryCallable insertUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: insertUrlMapCallable()"); + } + + @BetaApi + public UnaryCallable invalidateCacheUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: invalidateCacheUrlMapCallable()"); + } + + @BetaApi + public UnaryCallable listUrlMapsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUrlMapsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listUrlMapsCallable() { + throw new UnsupportedOperationException("Not implemented: listUrlMapsCallable()"); + } + + @BetaApi + public UnaryCallable patchUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: patchUrlMapCallable()"); + } + + @BetaApi + public UnaryCallable updateUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: updateUrlMapCallable()"); + } + + @BetaApi + public UnaryCallable validateUrlMapCallable() { + throw new UnsupportedOperationException("Not implemented: validateUrlMapCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java new file mode 100644 index 000000000000..994975b187db --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java @@ -0,0 +1,556 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; +import com.google.cloud.compute.v1.GetUrlMapHttpRequest; +import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; +import com.google.cloud.compute.v1.InvalidateCacheUrlMapHttpRequest; +import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; +import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; +import com.google.cloud.compute.v1.UrlMap; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import com.google.cloud.compute.v1.UrlMapList; +import com.google.cloud.compute.v1.UrlMapsValidateResponse; +import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link UrlMapStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteUrlMap to 30 seconds: + * + *

+ * 
+ * UrlMapStubSettings.Builder urlMapSettingsBuilder =
+ *     UrlMapStubSettings.newBuilder();
+ * urlMapSettingsBuilder.deleteUrlMapSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * UrlMapStubSettings urlMapSettings = urlMapSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class UrlMapStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteUrlMapSettings; + private final UnaryCallSettings getUrlMapSettings; + private final UnaryCallSettings insertUrlMapSettings; + private final UnaryCallSettings invalidateCacheUrlMapSettings; + private final PagedCallSettings listUrlMapsSettings; + private final UnaryCallSettings patchUrlMapSettings; + private final UnaryCallSettings updateUrlMapSettings; + private final UnaryCallSettings validateUrlMapSettings; + + /** + * Returns the object with the settings used for calls to deleteUrlMap. + */ + public UnaryCallSettings deleteUrlMapSettings() { + return deleteUrlMapSettings; + } + + /** + * Returns the object with the settings used for calls to getUrlMap. + */ + public UnaryCallSettings getUrlMapSettings() { + return getUrlMapSettings; + } + + /** + * Returns the object with the settings used for calls to insertUrlMap. + */ + public UnaryCallSettings insertUrlMapSettings() { + return insertUrlMapSettings; + } + + /** + * Returns the object with the settings used for calls to invalidateCacheUrlMap. + */ + public UnaryCallSettings invalidateCacheUrlMapSettings() { + return invalidateCacheUrlMapSettings; + } + + /** + * Returns the object with the settings used for calls to listUrlMaps. + */ + public PagedCallSettings listUrlMapsSettings() { + return listUrlMapsSettings; + } + + /** + * Returns the object with the settings used for calls to patchUrlMap. + */ + public UnaryCallSettings patchUrlMapSettings() { + return patchUrlMapSettings; + } + + /** + * Returns the object with the settings used for calls to updateUrlMap. + */ + public UnaryCallSettings updateUrlMapSettings() { + return updateUrlMapSettings; + } + + /** + * Returns the object with the settings used for calls to validateUrlMap. + */ + public UnaryCallSettings validateUrlMapSettings() { + return validateUrlMapSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public UrlMapStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonUrlMapStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(UrlMapStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected UrlMapStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteUrlMapSettings = settingsBuilder.deleteUrlMapSettings().build(); + getUrlMapSettings = settingsBuilder.getUrlMapSettings().build(); + insertUrlMapSettings = settingsBuilder.insertUrlMapSettings().build(); + invalidateCacheUrlMapSettings = settingsBuilder.invalidateCacheUrlMapSettings().build(); + listUrlMapsSettings = settingsBuilder.listUrlMapsSettings().build(); + patchUrlMapSettings = settingsBuilder.patchUrlMapSettings().build(); + updateUrlMapSettings = settingsBuilder.updateUrlMapSettings().build(); + validateUrlMapSettings = settingsBuilder.validateUrlMapSettings().build(); + } + + private static final PagedListDescriptor LIST_URL_MAPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListUrlMapsHttpRequest injectToken(ListUrlMapsHttpRequest payload, String token) { + return ListUrlMapsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListUrlMapsHttpRequest injectPageSize(ListUrlMapsHttpRequest payload, int pageSize) { + return ListUrlMapsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListUrlMapsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(UrlMapList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(UrlMapList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_URL_MAPS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUrlMapsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_URL_MAPS_PAGE_STR_DESC, request, context); + return ListUrlMapsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for UrlMapStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteUrlMapSettings; + private final UnaryCallSettings.Builder getUrlMapSettings; + private final UnaryCallSettings.Builder insertUrlMapSettings; + private final UnaryCallSettings.Builder invalidateCacheUrlMapSettings; + private final PagedCallSettings.Builder listUrlMapsSettings; + private final UnaryCallSettings.Builder patchUrlMapSettings; + private final UnaryCallSettings.Builder updateUrlMapSettings; + private final UnaryCallSettings.Builder validateUrlMapSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + invalidateCacheUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listUrlMapsSettings = PagedCallSettings.newBuilder( + LIST_URL_MAPS_PAGE_STR_FACT); + + patchUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + validateUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteUrlMapSettings, + getUrlMapSettings, + insertUrlMapSettings, + invalidateCacheUrlMapSettings, + listUrlMapsSettings, + patchUrlMapSettings, + updateUrlMapSettings, + validateUrlMapSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.invalidateCacheUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listUrlMapsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.validateUrlMapSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(UrlMapStubSettings settings) { + super(settings); + + deleteUrlMapSettings = settings.deleteUrlMapSettings.toBuilder(); + getUrlMapSettings = settings.getUrlMapSettings.toBuilder(); + insertUrlMapSettings = settings.insertUrlMapSettings.toBuilder(); + invalidateCacheUrlMapSettings = settings.invalidateCacheUrlMapSettings.toBuilder(); + listUrlMapsSettings = settings.listUrlMapsSettings.toBuilder(); + patchUrlMapSettings = settings.patchUrlMapSettings.toBuilder(); + updateUrlMapSettings = settings.updateUrlMapSettings.toBuilder(); + validateUrlMapSettings = settings.validateUrlMapSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteUrlMapSettings, + getUrlMapSettings, + insertUrlMapSettings, + invalidateCacheUrlMapSettings, + listUrlMapsSettings, + patchUrlMapSettings, + updateUrlMapSettings, + validateUrlMapSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteUrlMap. + */ + public UnaryCallSettings.Builder deleteUrlMapSettings() { + return deleteUrlMapSettings; + } + + /** + * Returns the builder for the settings used for calls to getUrlMap. + */ + public UnaryCallSettings.Builder getUrlMapSettings() { + return getUrlMapSettings; + } + + /** + * Returns the builder for the settings used for calls to insertUrlMap. + */ + public UnaryCallSettings.Builder insertUrlMapSettings() { + return insertUrlMapSettings; + } + + /** + * Returns the builder for the settings used for calls to invalidateCacheUrlMap. + */ + public UnaryCallSettings.Builder invalidateCacheUrlMapSettings() { + return invalidateCacheUrlMapSettings; + } + + /** + * Returns the builder for the settings used for calls to listUrlMaps. + */ + public PagedCallSettings.Builder listUrlMapsSettings() { + return listUrlMapsSettings; + } + + /** + * Returns the builder for the settings used for calls to patchUrlMap. + */ + public UnaryCallSettings.Builder patchUrlMapSettings() { + return patchUrlMapSettings; + } + + /** + * Returns the builder for the settings used for calls to updateUrlMap. + */ + public UnaryCallSettings.Builder updateUrlMapSettings() { + return updateUrlMapSettings; + } + + /** + * Returns the builder for the settings used for calls to validateUrlMap. + */ + public UnaryCallSettings.Builder validateUrlMapSettings() { + return validateUrlMapSettings; + } + + @Override + public UrlMapStubSettings build() throws IOException { + return new UrlMapStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java new file mode 100644 index 000000000000..9628a3a2992a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.DeleteVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.GetVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.InsertVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.VpnTunnel; +import com.google.cloud.compute.v1.VpnTunnelAggregatedList; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import com.google.cloud.compute.v1.VpnTunnelList; +import com.google.cloud.compute.v1.VpnTunnelName; +import com.google.cloud.compute.v1.VpnTunnelsScopedList; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class VpnTunnelStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListVpnTunnelsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListVpnTunnelsPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListVpnTunnelsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListVpnTunnelsCallable()"); + } + + @BetaApi + public UnaryCallable deleteVpnTunnelCallable() { + throw new UnsupportedOperationException("Not implemented: deleteVpnTunnelCallable()"); + } + + @BetaApi + public UnaryCallable getVpnTunnelCallable() { + throw new UnsupportedOperationException("Not implemented: getVpnTunnelCallable()"); + } + + @BetaApi + public UnaryCallable insertVpnTunnelCallable() { + throw new UnsupportedOperationException("Not implemented: insertVpnTunnelCallable()"); + } + + @BetaApi + public UnaryCallable listVpnTunnelsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listVpnTunnelsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listVpnTunnelsCallable() { + throw new UnsupportedOperationException("Not implemented: listVpnTunnelsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java new file mode 100644 index 000000000000..285f23db5fed --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.DeleteVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.GetVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.InsertVpnTunnelHttpRequest; +import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.VpnTunnel; +import com.google.cloud.compute.v1.VpnTunnelAggregatedList; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import com.google.cloud.compute.v1.VpnTunnelList; +import com.google.cloud.compute.v1.VpnTunnelsScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link VpnTunnelStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteVpnTunnel to 30 seconds: + * + *

+ * 
+ * VpnTunnelStubSettings.Builder vpnTunnelSettingsBuilder =
+ *     VpnTunnelStubSettings.newBuilder();
+ * vpnTunnelSettingsBuilder.deleteVpnTunnelSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * VpnTunnelStubSettings vpnTunnelSettings = vpnTunnelSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class VpnTunnelStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListVpnTunnelsSettings; + private final UnaryCallSettings deleteVpnTunnelSettings; + private final UnaryCallSettings getVpnTunnelSettings; + private final UnaryCallSettings insertVpnTunnelSettings; + private final PagedCallSettings listVpnTunnelsSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListVpnTunnels. + */ + public PagedCallSettings aggregatedListVpnTunnelsSettings() { + return aggregatedListVpnTunnelsSettings; + } + + /** + * Returns the object with the settings used for calls to deleteVpnTunnel. + */ + public UnaryCallSettings deleteVpnTunnelSettings() { + return deleteVpnTunnelSettings; + } + + /** + * Returns the object with the settings used for calls to getVpnTunnel. + */ + public UnaryCallSettings getVpnTunnelSettings() { + return getVpnTunnelSettings; + } + + /** + * Returns the object with the settings used for calls to insertVpnTunnel. + */ + public UnaryCallSettings insertVpnTunnelSettings() { + return insertVpnTunnelSettings; + } + + /** + * Returns the object with the settings used for calls to listVpnTunnels. + */ + public PagedCallSettings listVpnTunnelsSettings() { + return listVpnTunnelsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public VpnTunnelStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonVpnTunnelStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(VpnTunnelStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected VpnTunnelStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListVpnTunnelsSettings = settingsBuilder.aggregatedListVpnTunnelsSettings().build(); + deleteVpnTunnelSettings = settingsBuilder.deleteVpnTunnelSettings().build(); + getVpnTunnelSettings = settingsBuilder.getVpnTunnelSettings().build(); + insertVpnTunnelSettings = settingsBuilder.insertVpnTunnelSettings().build(); + listVpnTunnelsSettings = settingsBuilder.listVpnTunnelsSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListVpnTunnelsHttpRequest injectToken(AggregatedListVpnTunnelsHttpRequest payload, String token) { + return AggregatedListVpnTunnelsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListVpnTunnelsHttpRequest injectPageSize(AggregatedListVpnTunnelsHttpRequest payload, int pageSize) { + return AggregatedListVpnTunnelsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListVpnTunnelsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(VpnTunnelAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(VpnTunnelAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_VPN_TUNNELS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListVpnTunnelsHttpRequest injectToken(ListVpnTunnelsHttpRequest payload, String token) { + return ListVpnTunnelsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListVpnTunnelsHttpRequest injectPageSize(ListVpnTunnelsHttpRequest payload, int pageSize) { + return ListVpnTunnelsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListVpnTunnelsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(VpnTunnelList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(VpnTunnelList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListVpnTunnelsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_DESC, request, context); + return AggregatedListVpnTunnelsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_VPN_TUNNELS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListVpnTunnelsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VPN_TUNNELS_PAGE_STR_DESC, request, context); + return ListVpnTunnelsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for VpnTunnelStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListVpnTunnelsSettings; + private final UnaryCallSettings.Builder deleteVpnTunnelSettings; + private final UnaryCallSettings.Builder getVpnTunnelSettings; + private final UnaryCallSettings.Builder insertVpnTunnelSettings; + private final PagedCallSettings.Builder listVpnTunnelsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListVpnTunnelsSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_FACT); + + deleteVpnTunnelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getVpnTunnelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertVpnTunnelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listVpnTunnelsSettings = PagedCallSettings.newBuilder( + LIST_VPN_TUNNELS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListVpnTunnelsSettings, + deleteVpnTunnelSettings, + getVpnTunnelSettings, + insertVpnTunnelSettings, + listVpnTunnelsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListVpnTunnelsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteVpnTunnelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getVpnTunnelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertVpnTunnelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listVpnTunnelsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(VpnTunnelStubSettings settings) { + super(settings); + + aggregatedListVpnTunnelsSettings = settings.aggregatedListVpnTunnelsSettings.toBuilder(); + deleteVpnTunnelSettings = settings.deleteVpnTunnelSettings.toBuilder(); + getVpnTunnelSettings = settings.getVpnTunnelSettings.toBuilder(); + insertVpnTunnelSettings = settings.insertVpnTunnelSettings.toBuilder(); + listVpnTunnelsSettings = settings.listVpnTunnelsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListVpnTunnelsSettings, + deleteVpnTunnelSettings, + getVpnTunnelSettings, + insertVpnTunnelSettings, + listVpnTunnelsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListVpnTunnels. + */ + public PagedCallSettings.Builder aggregatedListVpnTunnelsSettings() { + return aggregatedListVpnTunnelsSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteVpnTunnel. + */ + public UnaryCallSettings.Builder deleteVpnTunnelSettings() { + return deleteVpnTunnelSettings; + } + + /** + * Returns the builder for the settings used for calls to getVpnTunnel. + */ + public UnaryCallSettings.Builder getVpnTunnelSettings() { + return getVpnTunnelSettings; + } + + /** + * Returns the builder for the settings used for calls to insertVpnTunnel. + */ + public UnaryCallSettings.Builder insertVpnTunnelSettings() { + return insertVpnTunnelSettings; + } + + /** + * Returns the builder for the settings used for calls to listVpnTunnels. + */ + public PagedCallSettings.Builder listVpnTunnelsSettings() { + return listVpnTunnelsSettings; + } + + @Override + public VpnTunnelStubSettings build() throws IOException { + return new VpnTunnelStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java new file mode 100644 index 000000000000..58e815c6acb5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; +import com.google.cloud.compute.v1.GetZoneOperationHttpRequest; +import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import com.google.cloud.compute.v1.ProjectZoneOperationName; +import com.google.cloud.compute.v1.ZoneName; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ZoneOperationStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteZoneOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteZoneOperationCallable()"); + } + + @BetaApi + public UnaryCallable getZoneOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getZoneOperationCallable()"); + } + + @BetaApi + public UnaryCallable listZoneOperationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listZoneOperationsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listZoneOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: listZoneOperationsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java new file mode 100644 index 000000000000..184339a514f4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java @@ -0,0 +1,419 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; +import com.google.cloud.compute.v1.GetZoneOperationHttpRequest; +import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.OperationList; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ZoneOperationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteZoneOperation to 30 seconds: + * + *

+ * 
+ * ZoneOperationStubSettings.Builder zoneOperationSettingsBuilder =
+ *     ZoneOperationStubSettings.newBuilder();
+ * zoneOperationSettingsBuilder.deleteZoneOperationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ZoneOperationStubSettings zoneOperationSettings = zoneOperationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ZoneOperationStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteZoneOperationSettings; + private final UnaryCallSettings getZoneOperationSettings; + private final PagedCallSettings listZoneOperationsSettings; + + /** + * Returns the object with the settings used for calls to deleteZoneOperation. + */ + public UnaryCallSettings deleteZoneOperationSettings() { + return deleteZoneOperationSettings; + } + + /** + * Returns the object with the settings used for calls to getZoneOperation. + */ + public UnaryCallSettings getZoneOperationSettings() { + return getZoneOperationSettings; + } + + /** + * Returns the object with the settings used for calls to listZoneOperations. + */ + public PagedCallSettings listZoneOperationsSettings() { + return listZoneOperationsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ZoneOperationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonZoneOperationStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ZoneOperationStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ZoneOperationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteZoneOperationSettings = settingsBuilder.deleteZoneOperationSettings().build(); + getZoneOperationSettings = settingsBuilder.getZoneOperationSettings().build(); + listZoneOperationsSettings = settingsBuilder.listZoneOperationsSettings().build(); + } + + private static final PagedListDescriptor LIST_ZONE_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListZoneOperationsHttpRequest injectToken(ListZoneOperationsHttpRequest payload, String token) { + return ListZoneOperationsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListZoneOperationsHttpRequest injectPageSize(ListZoneOperationsHttpRequest payload, int pageSize) { + return ListZoneOperationsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListZoneOperationsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(OperationList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(OperationList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_ZONE_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListZoneOperationsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ZONE_OPERATIONS_PAGE_STR_DESC, request, context); + return ListZoneOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for ZoneOperationStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteZoneOperationSettings; + private final UnaryCallSettings.Builder getZoneOperationSettings; + private final PagedCallSettings.Builder listZoneOperationsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteZoneOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getZoneOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listZoneOperationsSettings = PagedCallSettings.newBuilder( + LIST_ZONE_OPERATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteZoneOperationSettings, + getZoneOperationSettings, + listZoneOperationsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteZoneOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getZoneOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listZoneOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ZoneOperationStubSettings settings) { + super(settings); + + deleteZoneOperationSettings = settings.deleteZoneOperationSettings.toBuilder(); + getZoneOperationSettings = settings.getZoneOperationSettings.toBuilder(); + listZoneOperationsSettings = settings.listZoneOperationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteZoneOperationSettings, + getZoneOperationSettings, + listZoneOperationsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteZoneOperation. + */ + public UnaryCallSettings.Builder deleteZoneOperationSettings() { + return deleteZoneOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to getZoneOperation. + */ + public UnaryCallSettings.Builder getZoneOperationSettings() { + return getZoneOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to listZoneOperations. + */ + public PagedCallSettings.Builder listZoneOperationsSettings() { + return listZoneOperationsSettings; + } + + @Override + public ZoneOperationStubSettings build() throws IOException { + return new ZoneOperationStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java new file mode 100644 index 000000000000..c415ed28482a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java @@ -0,0 +1,56 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.GetZoneHttpRequest; +import com.google.cloud.compute.v1.ListZonesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Zone; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import com.google.cloud.compute.v1.ZoneList; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ZoneStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getZoneCallable() { + throw new UnsupportedOperationException("Not implemented: getZoneCallable()"); + } + + @BetaApi + public UnaryCallable listZonesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listZonesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listZonesCallable() { + throw new UnsupportedOperationException("Not implemented: listZonesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java new file mode 100644 index 000000000000..8926a9a39cab --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java @@ -0,0 +1,392 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetZoneHttpRequest; +import com.google.cloud.compute.v1.ListZonesHttpRequest; +import com.google.cloud.compute.v1.Zone; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import com.google.cloud.compute.v1.ZoneList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ZoneStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getZone to 30 seconds: + * + *

+ * 
+ * ZoneStubSettings.Builder zoneSettingsBuilder =
+ *     ZoneStubSettings.newBuilder();
+ * zoneSettingsBuilder.getZoneSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ZoneStubSettings zoneSettings = zoneSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class ZoneStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getZoneSettings; + private final PagedCallSettings listZonesSettings; + + /** + * Returns the object with the settings used for calls to getZone. + */ + public UnaryCallSettings getZoneSettings() { + return getZoneSettings; + } + + /** + * Returns the object with the settings used for calls to listZones. + */ + public PagedCallSettings listZonesSettings() { + return listZonesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ZoneStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonZoneStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ZoneStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ZoneStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getZoneSettings = settingsBuilder.getZoneSettings().build(); + listZonesSettings = settingsBuilder.listZonesSettings().build(); + } + + private static final PagedListDescriptor LIST_ZONES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListZonesHttpRequest injectToken(ListZonesHttpRequest payload, String token) { + return ListZonesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListZonesHttpRequest injectPageSize(ListZonesHttpRequest payload, int pageSize) { + return ListZonesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListZonesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(ZoneList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ZoneList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_ZONES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListZonesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ZONES_PAGE_STR_DESC, request, context); + return ListZonesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for ZoneStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getZoneSettings; + private final PagedCallSettings.Builder listZonesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getZoneSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listZonesSettings = PagedCallSettings.newBuilder( + LIST_ZONES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getZoneSettings, + listZonesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getZoneSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listZonesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ZoneStubSettings settings) { + super(settings); + + getZoneSettings = settings.getZoneSettings.toBuilder(); + listZonesSettings = settings.listZonesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getZoneSettings, + listZonesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getZone. + */ + public UnaryCallSettings.Builder getZoneSettings() { + return getZoneSettings; + } + + /** + * Returns the builder for the settings used for calls to listZones. + */ + public PagedCallSettings.Builder listZonesSettings() { + return listZonesSettings; + } + + @Override + public ZoneStubSettings build() throws IOException { + return new ZoneStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java new file mode 100644 index 000000000000..7f7fdb302c6a --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -0,0 +1,409 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import com.google.cloud.compute.v1.stub.AddressStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.aggregatedListAddressesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.deleteAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.getAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.insertAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.listAddressesMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class AddressClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAddressesMethodDescriptor, + deleteAddressMethodDescriptor, + getAddressMethodDescriptor, + insertAddressMethodDescriptor, + listAddressesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, AddressStubSettings.getDefaultEndpoint()); + + private static AddressClient client; + private static AddressSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + AddressSettings.newBuilder() + .setTransportChannelProvider( + AddressSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + AddressClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListAddressesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + AddressesScopedList itemsItem = AddressesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + AddressAggregatedList expectedResponse = AddressAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListAddressesPagedResponse pagedListResponse = client.aggregatedListAddresses(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListAddressesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListAddresses(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteAddressTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + + Operation actualResponse = + client.deleteAddress(address); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteAddressExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + + client.deleteAddress(address); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getAddressTest() { + ProjectAddressName address2 = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + Address expectedResponse = Address.newBuilder() + .setAddress(address2.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + + Address actualResponse = + client.getAddress(address); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getAddressExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + + client.getAddress(address); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertAddressTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Address addressResource = Address.newBuilder().build(); + + Operation actualResponse = + client.insertAddress(region, addressResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertAddressExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Address addressResource = Address.newBuilder().build(); + + client.insertAddress(region, addressResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listAddressesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Address itemsElement = Address.newBuilder().build(); + List
items = Arrays.asList(itemsElement); + AddressList expectedResponse = AddressList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListAddressesPagedResponse pagedListResponse = client.listAddresses(region); + + List
resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listAddressesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listAddresses(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java new file mode 100644 index 000000000000..f3f817d950fb --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -0,0 +1,581 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class AutoscalerClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAutoscalersMethodDescriptor, + deleteAutoscalerMethodDescriptor, + getAutoscalerMethodDescriptor, + insertAutoscalerMethodDescriptor, + listAutoscalersMethodDescriptor, + patchAutoscalerMethodDescriptor, + updateAutoscalerMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); + + private static AutoscalerClient client; + private static AutoscalerSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + AutoscalerSettings.newBuilder() + .setTransportChannelProvider( + AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + AutoscalerClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListAutoscalersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + AutoscalersScopedList itemsItem = AutoscalersScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + AutoscalerAggregatedList expectedResponse = AutoscalerAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListAutoscalersPagedResponse pagedListResponse = client.aggregatedListAutoscalers(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListAutoscalersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListAutoscalers(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + + Operation actualResponse = + client.deleteAutoscaler(autoscaler); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + + client.deleteAutoscaler(autoscaler); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getAutoscalerTest() { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String target = "target-880905839"; + Autoscaler expectedResponse = Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .build(); + mockService.addResponse(expectedResponse); + + AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + + Autoscaler actualResponse = + client.getAutoscaler(autoscaler); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + + client.getAutoscaler(autoscaler); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + Operation actualResponse = + client.insertAutoscaler(zone, autoscalerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + client.insertAutoscaler(zone, autoscalerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listAutoscalersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Autoscaler itemsElement = Autoscaler.newBuilder().build(); + List items = Arrays.asList(itemsElement); + AutoscalerList expectedResponse = AutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListAutoscalersPagedResponse pagedListResponse = client.listAutoscalers(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listAutoscalersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listAutoscalers(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String autoscaler = "autoscaler517258967"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + Operation actualResponse = + client.patchAutoscaler(autoscaler, zone, autoscalerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String autoscaler = "autoscaler517258967"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + client.patchAutoscaler(autoscaler, zone, autoscalerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String autoscaler = "autoscaler517258967"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + Operation actualResponse = + client.updateAutoscaler(autoscaler, zone, autoscalerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String autoscaler = "autoscaler517258967"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + client.updateAutoscaler(autoscaler, zone, autoscalerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java new file mode 100644 index 000000000000..5b13049c52eb --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -0,0 +1,635 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import com.google.cloud.compute.v1.stub.BackendServiceStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.aggregatedListBackendServicesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.deleteBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getHealthBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.insertBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.listBackendServicesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.patchBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.updateBackendServiceMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class BackendServiceClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListBackendServicesMethodDescriptor, + deleteBackendServiceMethodDescriptor, + getBackendServiceMethodDescriptor, + getHealthBackendServiceMethodDescriptor, + insertBackendServiceMethodDescriptor, + listBackendServicesMethodDescriptor, + patchBackendServiceMethodDescriptor, + updateBackendServiceMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, BackendServiceStubSettings.getDefaultEndpoint()); + + private static BackendServiceClient client; + private static BackendServiceSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + BackendServiceSettings.newBuilder() + .setTransportChannelProvider( + BackendServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + BackendServiceClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListBackendServicesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + BackendServicesScopedList itemsItem = BackendServicesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + BackendServiceAggregatedList expectedResponse = BackendServiceAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListBackendServicesPagedResponse pagedListResponse = client.aggregatedListBackendServices(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListBackendServicesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListBackendServices(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + + Operation actualResponse = + client.deleteBackendService(backendService); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + + client.deleteBackendService(backendService); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBackendServiceTest() { + Integer affinityCookieTtlSec = 1777486694; + String kind = "kind3292052"; + String sessionAffinity = "sessionAffinity1000759473"; + String description = "description-1724546052"; + String loadBalancingScheme = "loadBalancingScheme1974502980"; + String portName = "portName1115276169"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + String protocol = "protocol-989163880"; + Boolean enableCDN = false; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + BackendService expectedResponse = BackendService.newBuilder() + .setAffinityCookieTtlSec(affinityCookieTtlSec) + .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setPortName(portName) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setProtocol(protocol) + .setEnableCDN(enableCDN) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + + BackendService actualResponse = + client.getBackendService(backendService); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + + client.getBackendService(backendService); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getHealthBackendServiceTest() { + String kind = "kind3292052"; + BackendServiceGroupHealth expectedResponse = BackendServiceGroupHealth.newBuilder() + .setKind(kind) + .build(); + mockService.addResponse(expectedResponse); + + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + + BackendServiceGroupHealth actualResponse = + client.getHealthBackendService(backendService, resourceGroupReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getHealthBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + + client.getHealthBackendService(backendService, resourceGroupReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + Operation actualResponse = + client.insertBackendService(project, backendServiceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + client.insertBackendService(project, backendServiceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBackendServicesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + BackendService itemsElement = BackendService.newBuilder().build(); + List items = Arrays.asList(itemsElement); + BackendServiceList expectedResponse = BackendServiceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListBackendServicesPagedResponse pagedListResponse = client.listBackendServices(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listBackendServicesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listBackendServices(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + Operation actualResponse = + client.patchBackendService(backendService, backendServiceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + client.patchBackendService(backendService, backendServiceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + Operation actualResponse = + client.updateBackendService(backendService, backendServiceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + client.updateBackendService(backendService, backendServiceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java new file mode 100644 index 000000000000..760e43db8927 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -0,0 +1,595 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import com.google.cloud.compute.v1.stub.DiskStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.aggregatedListDisksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.createSnapshotDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.deleteDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.getDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.insertDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.listDisksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.resizeDiskMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class DiskClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListDisksMethodDescriptor, + createSnapshotDiskMethodDescriptor, + deleteDiskMethodDescriptor, + getDiskMethodDescriptor, + insertDiskMethodDescriptor, + listDisksMethodDescriptor, + resizeDiskMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, DiskStubSettings.getDefaultEndpoint()); + + private static DiskClient client; + private static DiskSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + DiskSettings.newBuilder() + .setTransportChannelProvider( + DiskSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + DiskClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListDisksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + DisksScopedList itemsItem = DisksScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + DiskAggregatedList expectedResponse = DiskAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListDisksPagedResponse pagedListResponse = client.aggregatedListDisks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListDisksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListDisks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createSnapshotDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + Snapshot snapshotResource = Snapshot.newBuilder().build(); + + Operation actualResponse = + client.createSnapshotDisk(disk, snapshotResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void createSnapshotDiskExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + Snapshot snapshotResource = Snapshot.newBuilder().build(); + + client.createSnapshotDisk(disk, snapshotResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + + Operation actualResponse = + client.deleteDisk(disk); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteDiskExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + + client.deleteDisk(disk); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getDiskTest() { + String sizeGb = "sizeGb2105542105"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String sourceImageId = "sourceImageId-2092155357"; + String lastDetachTimestamp = "lastDetachTimestamp-480399885"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String type = "type3575610"; + String lastAttachTimestamp = "lastAttachTimestamp-2105323995"; + String selfLink = "selfLink-1691268851"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String options = "options-1249474914"; + String id = "id3355"; + String sourceImage = "sourceImage1661056055"; + String status = "status-892481550"; + Disk expectedResponse = Disk.newBuilder() + .setSizeGb(sizeGb) + .setSourceSnapshotId(sourceSnapshotId) + .setSourceImageId(sourceImageId) + .setLastDetachTimestamp(lastDetachTimestamp) + .setKind(kind) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setType(type) + .setLastAttachTimestamp(lastAttachTimestamp) + .setSelfLink(selfLink) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setOptions(options) + .setId(id) + .setSourceImage(sourceImage) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + + Disk actualResponse = + client.getDisk(disk); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getDiskExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + + client.getDisk(disk); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String sourceImage = "sourceImage1661056055"; + Disk diskResource = Disk.newBuilder().build(); + + Operation actualResponse = + client.insertDisk(zone, sourceImage, diskResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertDiskExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String sourceImage = "sourceImage1661056055"; + Disk diskResource = Disk.newBuilder().build(); + + client.insertDisk(zone, sourceImage, diskResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listDisksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Disk itemsElement = Disk.newBuilder().build(); + List items = Arrays.asList(itemsElement); + DiskList expectedResponse = DiskList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListDisksPagedResponse pagedListResponse = client.listDisks(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listDisksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listDisks(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void resizeDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); + + Operation actualResponse = + client.resizeDisk(disk, disksResizeRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void resizeDiskExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); + + client.resizeDisk(disk, disksResizeRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java new file mode 100644 index 000000000000..89f43ae63b96 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java @@ -0,0 +1,243 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.stub.DiskTypeStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.aggregatedListDiskTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.getDiskTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.listDiskTypesMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class DiskTypeClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListDiskTypesMethodDescriptor, + getDiskTypeMethodDescriptor, + listDiskTypesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, DiskTypeStubSettings.getDefaultEndpoint()); + + private static DiskTypeClient client; + private static DiskTypeSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + DiskTypeSettings.newBuilder() + .setTransportChannelProvider( + DiskTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + DiskTypeClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListDiskTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + DiskTypesScopedList itemsItem = DiskTypesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + DiskTypeAggregatedList expectedResponse = DiskTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListDiskTypesPagedResponse pagedListResponse = client.aggregatedListDiskTypes(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListDiskTypesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListDiskTypes(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getDiskTypeTest() { + String defaultDiskSizeGb = "defaultDiskSizeGb807490165"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String validDiskSize = "validDiskSize-1653521184"; + String selfLink = "selfLink-1691268851"; + DiskType expectedResponse = DiskType.newBuilder() + .setDefaultDiskSizeGb(defaultDiskSizeGb) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setValidDiskSize(validDiskSize) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); + + DiskType actualResponse = + client.getDiskType(diskType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getDiskTypeExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); + + client.getDiskType(diskType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listDiskTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + DiskType itemsElement = DiskType.newBuilder().build(); + List items = Arrays.asList(itemsElement); + DiskTypeList expectedResponse = DiskTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListDiskTypesPagedResponse pagedListResponse = client.listDiskTypes(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listDiskTypesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listDiskTypes(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java new file mode 100644 index 000000000000..377d588a077e --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -0,0 +1,517 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import com.google.cloud.compute.v1.stub.FirewallStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.deleteFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.getFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.insertFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.listFirewallsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.patchFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.updateFirewallMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class FirewallClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteFirewallMethodDescriptor, + getFirewallMethodDescriptor, + insertFirewallMethodDescriptor, + listFirewallsMethodDescriptor, + patchFirewallMethodDescriptor, + updateFirewallMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, FirewallStubSettings.getDefaultEndpoint()); + + private static FirewallClient client; + private static FirewallSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + FirewallSettings.newBuilder() + .setTransportChannelProvider( + FirewallSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + FirewallClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteFirewallTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + + Operation actualResponse = + client.deleteFirewall(firewall); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteFirewallExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + + client.deleteFirewall(firewall); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getFirewallTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + Firewall expectedResponse = Firewall.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + + Firewall actualResponse = + client.getFirewall(firewall); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getFirewallExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + + client.getFirewall(firewall); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertFirewallTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + Firewall firewallResource = Firewall.newBuilder().build(); + + Operation actualResponse = + client.insertFirewall(project, firewallResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertFirewallExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + Firewall firewallResource = Firewall.newBuilder().build(); + + client.insertFirewall(project, firewallResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listFirewallsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Firewall itemsElement = Firewall.newBuilder().build(); + List items = Arrays.asList(itemsElement); + FirewallList expectedResponse = FirewallList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListFirewallsPagedResponse pagedListResponse = client.listFirewalls(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listFirewallsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listFirewalls(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchFirewallTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + Firewall firewallResource = Firewall.newBuilder().build(); + + Operation actualResponse = + client.patchFirewall(firewall, firewallResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchFirewallExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + Firewall firewallResource = Firewall.newBuilder().build(); + + client.patchFirewall(firewall, firewallResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateFirewallTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + Firewall firewallResource = Firewall.newBuilder().build(); + + Operation actualResponse = + client.updateFirewall(firewall, firewallResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateFirewallExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + Firewall firewallResource = Firewall.newBuilder().build(); + + client.updateFirewall(firewall, firewallResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java new file mode 100644 index 000000000000..4c234c164575 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -0,0 +1,505 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.stub.ForwardingRuleStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.aggregatedListForwardingRulesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.deleteForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.getForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.insertForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.listForwardingRulesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.setTargetForwardingRuleMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ForwardingRuleClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListForwardingRulesMethodDescriptor, + deleteForwardingRuleMethodDescriptor, + getForwardingRuleMethodDescriptor, + insertForwardingRuleMethodDescriptor, + listForwardingRulesMethodDescriptor, + setTargetForwardingRuleMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, ForwardingRuleStubSettings.getDefaultEndpoint()); + + private static ForwardingRuleClient client; + private static ForwardingRuleSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + ForwardingRuleSettings.newBuilder() + .setTransportChannelProvider( + ForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + ForwardingRuleClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListForwardingRulesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + ForwardingRulesScopedList itemsItem = ForwardingRulesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + ForwardingRuleAggregatedList expectedResponse = ForwardingRuleAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListForwardingRulesPagedResponse pagedListResponse = client.aggregatedListForwardingRules(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListForwardingRulesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListForwardingRules(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteForwardingRuleTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + + Operation actualResponse = + client.deleteForwardingRule(forwardingRule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + + client.deleteForwardingRule(forwardingRule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getForwardingRuleTest() { + String portRange = "portRange217518079"; + String kind = "kind3292052"; + String iPProtocol = "iPProtocol323774237"; + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + String description = "description-1724546052"; + String loadBalancingScheme = "loadBalancingScheme1974502980"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + String target = "target-880905839"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String iPAddress = "iPAddress-551149873"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + ForwardingRule expectedResponse = ForwardingRule.newBuilder() + .setPortRange(portRange) + .setKind(kind) + .setIPProtocol(iPProtocol) + .setBackendService(backendService.toString()) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setIPAddress(iPAddress) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + + ForwardingRule actualResponse = + client.getForwardingRule(forwardingRule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + + client.getForwardingRule(forwardingRule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertForwardingRuleTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); + + Operation actualResponse = + client.insertForwardingRule(region, forwardingRuleResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); + + client.insertForwardingRule(region, forwardingRuleResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listForwardingRulesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); + List items = Arrays.asList(itemsElement); + ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListForwardingRulesPagedResponse pagedListResponse = client.listForwardingRules(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listForwardingRulesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listForwardingRules(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setTargetForwardingRuleTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + TargetReference targetReferenceResource = TargetReference.newBuilder().build(); + + Operation actualResponse = + client.setTargetForwardingRule(forwardingRule, targetReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setTargetForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + TargetReference targetReferenceResource = TargetReference.newBuilder().build(); + + client.setTargetForwardingRule(forwardingRule, targetReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java new file mode 100644 index 000000000000..00690116af12 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -0,0 +1,353 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import com.google.cloud.compute.v1.stub.GlobalAddressStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.deleteGlobalAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.getGlobalAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.insertGlobalAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.listGlobalAddressesMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class GlobalAddressClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteGlobalAddressMethodDescriptor, + getGlobalAddressMethodDescriptor, + insertGlobalAddressMethodDescriptor, + listGlobalAddressesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, GlobalAddressStubSettings.getDefaultEndpoint()); + + private static GlobalAddressClient client; + private static GlobalAddressSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + GlobalAddressSettings.newBuilder() + .setTransportChannelProvider( + GlobalAddressSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + GlobalAddressClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteGlobalAddressTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + + Operation actualResponse = + client.deleteGlobalAddress(address); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteGlobalAddressExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + + client.deleteGlobalAddress(address); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getGlobalAddressTest() { + ProjectAddressName address2 = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + Address expectedResponse = Address.newBuilder() + .setAddress(address2.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + + Address actualResponse = + client.getGlobalAddress(address); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getGlobalAddressExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + + client.getGlobalAddress(address); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertGlobalAddressTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + Address addressResource = Address.newBuilder().build(); + + Operation actualResponse = + client.insertGlobalAddress(project, addressResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertGlobalAddressExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + Address addressResource = Address.newBuilder().build(); + + client.insertGlobalAddress(project, addressResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listGlobalAddressesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Address itemsElement = Address.newBuilder().build(); + List
items = Arrays.asList(itemsElement); + AddressList expectedResponse = AddressList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListGlobalAddressesPagedResponse pagedListResponse = client.listGlobalAddresses(project); + + List
resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listGlobalAddressesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listGlobalAddresses(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java new file mode 100644 index 000000000000..5b8d3f1edd6c --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -0,0 +1,449 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.deleteGlobalForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.getGlobalForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.insertGlobalForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.listGlobalForwardingRulesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.setTargetGlobalForwardingRuleMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class GlobalForwardingRuleClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteGlobalForwardingRuleMethodDescriptor, + getGlobalForwardingRuleMethodDescriptor, + insertGlobalForwardingRuleMethodDescriptor, + listGlobalForwardingRulesMethodDescriptor, + setTargetGlobalForwardingRuleMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, GlobalForwardingRuleStubSettings.getDefaultEndpoint()); + + private static GlobalForwardingRuleClient client; + private static GlobalForwardingRuleSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + GlobalForwardingRuleSettings.newBuilder() + .setTransportChannelProvider( + GlobalForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + GlobalForwardingRuleClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteGlobalForwardingRuleTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + + Operation actualResponse = + client.deleteGlobalForwardingRule(forwardingRule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteGlobalForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + + client.deleteGlobalForwardingRule(forwardingRule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getGlobalForwardingRuleTest() { + String portRange = "portRange217518079"; + String kind = "kind3292052"; + String iPProtocol = "iPProtocol323774237"; + BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + String description = "description-1724546052"; + String loadBalancingScheme = "loadBalancingScheme1974502980"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + String target = "target-880905839"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String iPAddress = "iPAddress-551149873"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + ForwardingRule expectedResponse = ForwardingRule.newBuilder() + .setPortRange(portRange) + .setKind(kind) + .setIPProtocol(iPProtocol) + .setBackendService(backendService.toString()) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setIPAddress(iPAddress) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + + ForwardingRule actualResponse = + client.getGlobalForwardingRule(forwardingRule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getGlobalForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + + client.getGlobalForwardingRule(forwardingRule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertGlobalForwardingRuleTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); + + Operation actualResponse = + client.insertGlobalForwardingRule(project, forwardingRuleResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertGlobalForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); + + client.insertGlobalForwardingRule(project, forwardingRuleResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listGlobalForwardingRulesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); + List items = Arrays.asList(itemsElement); + ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListGlobalForwardingRulesPagedResponse pagedListResponse = client.listGlobalForwardingRules(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listGlobalForwardingRulesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listGlobalForwardingRules(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setTargetGlobalForwardingRuleTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + TargetReference targetReferenceResource = TargetReference.newBuilder().build(); + + Operation actualResponse = + client.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setTargetGlobalForwardingRuleExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + TargetReference targetReferenceResource = TargetReference.newBuilder().build(); + + client.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java new file mode 100644 index 000000000000..f1121f00bca9 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java @@ -0,0 +1,303 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import com.google.cloud.compute.v1.stub.GlobalOperationStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.aggregatedListGlobalOperationsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.deleteGlobalOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.getGlobalOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.listGlobalOperationsMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class GlobalOperationClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListGlobalOperationsMethodDescriptor, + deleteGlobalOperationMethodDescriptor, + getGlobalOperationMethodDescriptor, + listGlobalOperationsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, GlobalOperationStubSettings.getDefaultEndpoint()); + + private static GlobalOperationClient client; + private static GlobalOperationSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + GlobalOperationSettings.newBuilder() + .setTransportChannelProvider( + GlobalOperationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + GlobalOperationClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListGlobalOperationsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + OperationsScopedList itemsItem = OperationsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + OperationAggregatedList expectedResponse = OperationAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListGlobalOperationsPagedResponse pagedListResponse = client.aggregatedListGlobalOperations(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListGlobalOperationsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListGlobalOperations(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteGlobalOperationTest() { + mockService.addNullResponse(); + + OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]"); + + client.deleteGlobalOperation(operation); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteGlobalOperationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]"); + + client.deleteGlobalOperation(operation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getGlobalOperationTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]"); + + Operation actualResponse = + client.getGlobalOperation(operation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getGlobalOperationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]"); + + client.getGlobalOperation(operation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listGlobalOperationsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Operation itemsElement = Operation.newBuilder().build(); + List items = Arrays.asList(itemsElement); + OperationList expectedResponse = OperationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListGlobalOperationsPagedResponse pagedListResponse = client.listGlobalOperations(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listGlobalOperationsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listGlobalOperations(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java new file mode 100644 index 000000000000..f47186b76f6e --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -0,0 +1,525 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import com.google.cloud.compute.v1.stub.HealthCheckStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.deleteHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.getHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.insertHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.listHealthChecksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.patchHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.updateHealthCheckMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class HealthCheckClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteHealthCheckMethodDescriptor, + getHealthCheckMethodDescriptor, + insertHealthCheckMethodDescriptor, + listHealthChecksMethodDescriptor, + patchHealthCheckMethodDescriptor, + updateHealthCheckMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, HealthCheckStubSettings.getDefaultEndpoint()); + + private static HealthCheckClient client; + private static HealthCheckSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + HealthCheckSettings.newBuilder() + .setTransportChannelProvider( + HealthCheckSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + HealthCheckClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + + Operation actualResponse = + client.deleteHealthCheck(healthCheck); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + + client.deleteHealthCheck(healthCheck); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getHealthCheckTest() { + Integer checkIntervalSec = 345561006; + String kind = "kind3292052"; + String description = "description-1724546052"; + String type = "type3575610"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer unhealthyThreshold = 1838571216; + Integer healthyThreshold = 133658551; + String id = "id3355"; + HealthCheck expectedResponse = HealthCheck.newBuilder() + .setCheckIntervalSec(checkIntervalSec) + .setKind(kind) + .setDescription(description) + .setType(type) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .build(); + mockService.addResponse(expectedResponse); + + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + + HealthCheck actualResponse = + client.getHealthCheck(healthCheck); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + + client.getHealthCheck(healthCheck); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); + + Operation actualResponse = + client.insertHealthCheck(project, healthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); + + client.insertHealthCheck(project, healthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listHealthChecksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + HealthCheck itemsElement = HealthCheck.newBuilder().build(); + List items = Arrays.asList(itemsElement); + HealthCheckList expectedResponse = HealthCheckList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListHealthChecksPagedResponse pagedListResponse = client.listHealthChecks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listHealthChecksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listHealthChecks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); + + Operation actualResponse = + client.patchHealthCheck(healthCheck, healthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); + + client.patchHealthCheck(healthCheck, healthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); + + Operation actualResponse = + client.updateHealthCheck(healthCheck, healthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); + + client.updateHealthCheck(healthCheck, healthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java new file mode 100644 index 000000000000..bf32fe341053 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -0,0 +1,529 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import com.google.cloud.compute.v1.stub.HttpHealthCheckStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.deleteHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.getHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.insertHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.listHttpHealthChecksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.patchHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.updateHttpHealthCheckMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class HttpHealthCheckClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteHttpHealthCheckMethodDescriptor, + getHttpHealthCheckMethodDescriptor, + insertHttpHealthCheckMethodDescriptor, + listHttpHealthChecksMethodDescriptor, + patchHttpHealthCheckMethodDescriptor, + updateHttpHealthCheckMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, HttpHealthCheckStubSettings.getDefaultEndpoint()); + + private static HttpHealthCheckClient client; + private static HttpHealthCheckSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + HttpHealthCheckSettings.newBuilder() + .setTransportChannelProvider( + HttpHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + HttpHealthCheckClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteHttpHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + + Operation actualResponse = + client.deleteHttpHealthCheck(httpHealthCheck); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteHttpHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + + client.deleteHttpHealthCheck(httpHealthCheck); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getHttpHealthCheckTest() { + Integer checkIntervalSec = 345561006; + String kind = "kind3292052"; + String description = "description-1724546052"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; + String host = "host3208616"; + String name = "name3373707"; + Integer unhealthyThreshold = 1838571216; + Integer healthyThreshold = 133658551; + String id = "id3355"; + String requestPath = "requestPath1303145429"; + HttpHealthCheck expectedResponse = HttpHealthCheck.newBuilder() + .setCheckIntervalSec(checkIntervalSec) + .setKind(kind) + .setDescription(description) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setHost(host) + .setName(name) + .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .setRequestPath(requestPath) + .build(); + mockService.addResponse(expectedResponse); + + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + + HttpHealthCheck actualResponse = + client.getHttpHealthCheck(httpHealthCheck); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getHttpHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + + client.getHttpHealthCheck(httpHealthCheck); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertHttpHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + + Operation actualResponse = + client.insertHttpHealthCheck(project, httpHealthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertHttpHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + + client.insertHttpHealthCheck(project, httpHealthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listHttpHealthChecksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); + List items = Arrays.asList(itemsElement); + HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListHttpHealthChecksPagedResponse pagedListResponse = client.listHttpHealthChecks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listHttpHealthChecksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listHttpHealthChecks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchHttpHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + + Operation actualResponse = + client.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchHttpHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + + client.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateHttpHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + + Operation actualResponse = + client.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateHttpHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + + client.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java new file mode 100644 index 000000000000..9691b191522f --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -0,0 +1,529 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.deleteHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.getHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.insertHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.listHttpsHealthChecksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.patchHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.updateHttpsHealthCheckMethodDescriptor; +import com.google.cloud.compute.v1.stub.HttpsHealthCheckStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class HttpsHealthCheckClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteHttpsHealthCheckMethodDescriptor, + getHttpsHealthCheckMethodDescriptor, + insertHttpsHealthCheckMethodDescriptor, + listHttpsHealthChecksMethodDescriptor, + patchHttpsHealthCheckMethodDescriptor, + updateHttpsHealthCheckMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, HttpsHealthCheckStubSettings.getDefaultEndpoint()); + + private static HttpsHealthCheckClient client; + private static HttpsHealthCheckSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + HttpsHealthCheckSettings.newBuilder() + .setTransportChannelProvider( + HttpsHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + HttpsHealthCheckClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteHttpsHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + + Operation actualResponse = + client.deleteHttpsHealthCheck(httpsHealthCheck); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteHttpsHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + + client.deleteHttpsHealthCheck(httpsHealthCheck); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getHttpsHealthCheckTest() { + Integer checkIntervalSec = 345561006; + String kind = "kind3292052"; + String description = "description-1724546052"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; + String host = "host3208616"; + String name = "name3373707"; + Integer unhealthyThreshold = 1838571216; + Integer healthyThreshold = 133658551; + String id = "id3355"; + String requestPath = "requestPath1303145429"; + HttpsHealthCheck expectedResponse = HttpsHealthCheck.newBuilder() + .setCheckIntervalSec(checkIntervalSec) + .setKind(kind) + .setDescription(description) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setHost(host) + .setName(name) + .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .setRequestPath(requestPath) + .build(); + mockService.addResponse(expectedResponse); + + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + + HttpsHealthCheck actualResponse = + client.getHttpsHealthCheck(httpsHealthCheck); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getHttpsHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + + client.getHttpsHealthCheck(httpsHealthCheck); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertHttpsHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + + Operation actualResponse = + client.insertHttpsHealthCheck(project, httpsHealthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertHttpsHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + + client.insertHttpsHealthCheck(project, httpsHealthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listHttpsHealthChecksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); + List items = Arrays.asList(itemsElement); + HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListHttpsHealthChecksPagedResponse pagedListResponse = client.listHttpsHealthChecks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listHttpsHealthChecksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listHttpsHealthChecks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchHttpsHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + + Operation actualResponse = + client.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchHttpsHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + + client.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateHttpsHealthCheckTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + + Operation actualResponse = + client.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateHttpsHealthCheckExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + + client.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java new file mode 100644 index 000000000000..582c099d7dbc --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -0,0 +1,511 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deleteImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deprecateImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getFromFamilyImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.insertImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.listImagesMethodDescriptor; +import com.google.cloud.compute.v1.stub.ImageStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ImageClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteImageMethodDescriptor, + deprecateImageMethodDescriptor, + getImageMethodDescriptor, + getFromFamilyImageMethodDescriptor, + insertImageMethodDescriptor, + listImagesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, ImageStubSettings.getDefaultEndpoint()); + + private static ImageClient client; + private static ImageSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + ImageSettings.newBuilder() + .setTransportChannelProvider( + ImageSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + ImageClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteImageTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + + Operation actualResponse = + client.deleteImage(image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteImageExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + + client.deleteImage(image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deprecateImageTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); + + Operation actualResponse = + client.deprecateImage(image, deprecationStatusResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deprecateImageExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); + + client.deprecateImage(image, deprecationStatusResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getImageTest() { + String sourceDisk = "sourceDisk-85117119"; + String sourceDiskId = "sourceDiskId-1693292839"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + String sourceType = "sourceType-84625186"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String archiveSizeBytes = "archiveSizeBytes-1766390198"; + String id = "id3355"; + FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]"); + String diskSizeGb = "diskSizeGb-757478089"; + String status = "status-892481550"; + Image expectedResponse = Image.newBuilder() + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setSourceType(sourceType) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setArchiveSizeBytes(archiveSizeBytes) + .setId(id) + .setFamily(family.toString()) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + + Image actualResponse = + client.getImage(image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getImageExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + + client.getImage(image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getFromFamilyImageTest() { + String sourceDisk = "sourceDisk-85117119"; + String sourceDiskId = "sourceDiskId-1693292839"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + String sourceType = "sourceType-84625186"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String archiveSizeBytes = "archiveSizeBytes-1766390198"; + String id = "id3355"; + FamilyName family2 = FamilyName.of("[PROJECT]", "[FAMILY]"); + String diskSizeGb = "diskSizeGb-757478089"; + String status = "status-892481550"; + Image expectedResponse = Image.newBuilder() + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setSourceType(sourceType) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setArchiveSizeBytes(archiveSizeBytes) + .setId(id) + .setFamily(family2.toString()) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]"); + + Image actualResponse = + client.getFromFamilyImage(family); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getFromFamilyImageExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]"); + + client.getFromFamilyImage(family); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertImageTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + Image imageResource = Image.newBuilder().build(); + + Operation actualResponse = + client.insertImage(project, imageResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertImageExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + Image imageResource = Image.newBuilder().build(); + + client.insertImage(project, imageResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listImagesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Image itemsElement = Image.newBuilder().build(); + List items = Arrays.asList(itemsElement); + ImageList expectedResponse = ImageList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListImagesPagedResponse pagedListResponse = client.listImages(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listImagesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listImages(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java new file mode 100644 index 000000000000..03ca422a4cf0 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -0,0 +1,1645 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.addAccessConfigInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.aggregatedListInstancesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.attachDiskInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.deleteAccessConfigInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.deleteInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.detachDiskInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.getInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.getSerialPortOutputInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.insertInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.listInstancesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.resetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setDiskAutoDeleteInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMachineTypeInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMetadataInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setSchedulingInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setServiceAccountInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setTagsInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.startInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.startWithEncryptionKeyInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.stopInstanceMethodDescriptor; +import com.google.cloud.compute.v1.stub.InstanceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InstanceClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + addAccessConfigInstanceMethodDescriptor, + aggregatedListInstancesMethodDescriptor, + attachDiskInstanceMethodDescriptor, + deleteInstanceMethodDescriptor, + deleteAccessConfigInstanceMethodDescriptor, + detachDiskInstanceMethodDescriptor, + getInstanceMethodDescriptor, + getSerialPortOutputInstanceMethodDescriptor, + insertInstanceMethodDescriptor, + listInstancesMethodDescriptor, + resetInstanceMethodDescriptor, + setDiskAutoDeleteInstanceMethodDescriptor, + setMachineTypeInstanceMethodDescriptor, + setMetadataInstanceMethodDescriptor, + setSchedulingInstanceMethodDescriptor, + setServiceAccountInstanceMethodDescriptor, + setTagsInstanceMethodDescriptor, + startInstanceMethodDescriptor, + startWithEncryptionKeyInstanceMethodDescriptor, + stopInstanceMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InstanceStubSettings.getDefaultEndpoint()); + + private static InstanceClient client; + private static InstanceSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InstanceSettings.newBuilder() + .setTransportChannelProvider( + InstanceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + InstanceClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void addAccessConfigInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); + + Operation actualResponse = + client.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void addAccessConfigInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); + + client.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInstancesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstancesScopedList itemsItem = InstancesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + InstanceAggregatedList expectedResponse = InstanceAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListInstancesPagedResponse pagedListResponse = client.aggregatedListInstances(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInstancesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListInstances(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void attachDiskInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); + + Operation actualResponse = + client.attachDiskInstance(instance, attachedDiskResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void attachDiskInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); + + client.attachDiskInstance(instance, attachedDiskResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + Operation actualResponse = + client.deleteInstance(instance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + client.deleteInstance(instance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteAccessConfigInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + String accessConfig = "accessConfig-464014723"; + + Operation actualResponse = + client.deleteAccessConfigInstance(instance, networkInterface, accessConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteAccessConfigInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + String accessConfig = "accessConfig-464014723"; + + client.deleteAccessConfigInstance(instance, networkInterface, accessConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void detachDiskInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String deviceName = "deviceName-1543071020"; + + Operation actualResponse = + client.detachDiskInstance(instance, deviceName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void detachDiskInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String deviceName = "deviceName-1543071020"; + + client.detachDiskInstance(instance, deviceName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInstanceTest() { + Boolean canIpForward = true; + String kind = "kind3292052"; + String description = "description-1724546052"; + String cpuPlatform = "cpuPlatform947156266"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + String status = "status-892481550"; + Instance expectedResponse = Instance.newBuilder() + .setCanIpForward(canIpForward) + .setKind(kind) + .setDescription(description) + .setCpuPlatform(cpuPlatform) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setMachineType(machineType.toString()) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + Instance actualResponse = + client.getInstance(instance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + client.getInstance(instance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSerialPortOutputInstanceTest() { + String next = "next3377907"; + String contents = "contents-567321830"; + String kind = "kind3292052"; + String start2 = "start2-1897185387"; + String selfLink = "selfLink-1691268851"; + SerialPortOutput expectedResponse = SerialPortOutput.newBuilder() + .setNext(next) + .setContents(contents) + .setKind(kind) + .setStart(start2) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Integer port = 3446913; + String start = "start109757538"; + + SerialPortOutput actualResponse = + client.getSerialPortOutputInstance(instance, port, start); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getSerialPortOutputInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Integer port = 3446913; + String start = "start109757538"; + + client.getSerialPortOutputInstance(instance, port, start); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Instance instanceResource = Instance.newBuilder().build(); + + Operation actualResponse = + client.insertInstance(zone, instanceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + Instance instanceResource = Instance.newBuilder().build(); + + client.insertInstance(zone, instanceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInstancesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Instance itemsElement = Instance.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InstanceList expectedResponse = InstanceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInstancesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listInstances(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void resetInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + Operation actualResponse = + client.resetInstance(instance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void resetInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + client.resetInstance(instance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setDiskAutoDeleteInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Boolean autoDelete = false; + String deviceName = "deviceName-1543071020"; + + Operation actualResponse = + client.setDiskAutoDeleteInstance(instance, autoDelete, deviceName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Boolean autoDelete = false; + String deviceName = "deviceName-1543071020"; + + client.setDiskAutoDeleteInstance(instance, autoDelete, deviceName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setMachineTypeInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); + + Operation actualResponse = + client.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setMachineTypeInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); + + client.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setMetadataInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Metadata metadataResource = Metadata.newBuilder().build(); + + Operation actualResponse = + client.setMetadataInstance(instance, metadataResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setMetadataInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Metadata metadataResource = Metadata.newBuilder().build(); + + client.setMetadataInstance(instance, metadataResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setSchedulingInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Scheduling schedulingResource = Scheduling.newBuilder().build(); + + Operation actualResponse = + client.setSchedulingInstance(instance, schedulingResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setSchedulingInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Scheduling schedulingResource = Scheduling.newBuilder().build(); + + client.setSchedulingInstance(instance, schedulingResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setServiceAccountInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); + + Operation actualResponse = + client.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setServiceAccountInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); + + client.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setTagsInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Tags tagsResource = Tags.newBuilder().build(); + + Operation actualResponse = + client.setTagsInstance(instance, tagsResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setTagsInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + Tags tagsResource = Tags.newBuilder().build(); + + client.setTagsInstance(instance, tagsResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void startInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + Operation actualResponse = + client.startInstance(instance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void startInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + client.startInstance(instance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void startWithEncryptionKeyInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); + + Operation actualResponse = + client.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void startWithEncryptionKeyInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); + + client.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void stopInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + Operation actualResponse = + client.stopInstance(instance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void stopInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + client.stopInstance(instance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java new file mode 100644 index 000000000000..73b463da77f0 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -0,0 +1,724 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.addInstancesInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.aggregatedListInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.deleteInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.getInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.insertInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.listInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.listInstancesInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.removeInstancesInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.setNamedPortsInstanceGroupMethodDescriptor; +import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InstanceGroupClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + addInstancesInstanceGroupMethodDescriptor, + aggregatedListInstanceGroupsMethodDescriptor, + deleteInstanceGroupMethodDescriptor, + getInstanceGroupMethodDescriptor, + insertInstanceGroupMethodDescriptor, + listInstanceGroupsMethodDescriptor, + listInstancesInstanceGroupsMethodDescriptor, + removeInstancesInstanceGroupMethodDescriptor, + setNamedPortsInstanceGroupMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); + + private static InstanceGroupClient client; + private static InstanceGroupSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InstanceGroupSettings.newBuilder() + .setTransportChannelProvider( + InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + InstanceGroupClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void addInstancesInstanceGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void addInstancesInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); + + client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInstanceGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceGroupsScopedList itemsItem = InstanceGroupsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + InstanceGroupAggregatedList expectedResponse = InstanceGroupAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListInstanceGroupsPagedResponse pagedListResponse = client.aggregatedListInstanceGroups(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInstanceGroupsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListInstanceGroups(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + + Operation actualResponse = + client.deleteInstanceGroup(instanceGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + + client.deleteInstanceGroup(instanceGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInstanceGroupTest() { + String kind = "kind3292052"; + String description = "description-1724546052"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + Integer size = 3530753; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InstanceGroup expectedResponse = InstanceGroup.newBuilder() + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setSize(size) + .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + + InstanceGroup actualResponse = + client.getInstanceGroup(instanceGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + + client.getInstanceGroup(instanceGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertInstanceGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); + + Operation actualResponse = + client.insertInstanceGroup(zone, instanceGroupResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); + + client.insertInstanceGroup(zone, instanceGroupResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInstanceGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InstanceGroupList expectedResponse = InstanceGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListInstanceGroupsPagedResponse pagedListResponse = client.listInstanceGroups(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInstanceGroupsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listInstanceGroups(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInstancesInstanceGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InstanceGroupsListInstances expectedResponse = InstanceGroupsListInstances.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); + + ListInstancesInstanceGroupsPagedResponse pagedListResponse = client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInstancesInstanceGroupsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); + + client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void removeInstancesInstanceGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void removeInstancesInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + + client.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setNamedPortsInstanceGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + + Operation actualResponse = + client.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setNamedPortsInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + + client.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java new file mode 100644 index 000000000000..8cfba1e0eff5 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -0,0 +1,960 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.abandonInstancesInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.aggregatedListInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.deleteInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.deleteInstancesInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.getInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.insertInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.listInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.listManagedInstancesInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.recreateInstancesInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.resizeInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.setInstanceTemplateInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.setTargetPoolsInstanceGroupManagerMethodDescriptor; +import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InstanceGroupManagerClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + abandonInstancesInstanceGroupManagerMethodDescriptor, + aggregatedListInstanceGroupManagersMethodDescriptor, + deleteInstanceGroupManagerMethodDescriptor, + deleteInstancesInstanceGroupManagerMethodDescriptor, + getInstanceGroupManagerMethodDescriptor, + insertInstanceGroupManagerMethodDescriptor, + listInstanceGroupManagersMethodDescriptor, + listManagedInstancesInstanceGroupManagersMethodDescriptor, + recreateInstancesInstanceGroupManagerMethodDescriptor, + resizeInstanceGroupManagerMethodDescriptor, + setInstanceTemplateInstanceGroupManagerMethodDescriptor, + setTargetPoolsInstanceGroupManagerMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupManagerStubSettings.getDefaultEndpoint()); + + private static InstanceGroupManagerClient client; + private static InstanceGroupManagerSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InstanceGroupManagerSettings.newBuilder() + .setTransportChannelProvider( + InstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + InstanceGroupManagerClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void abandonInstancesInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + + client.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInstanceGroupManagersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceGroupManagersScopedList itemsItem = InstanceGroupManagersScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + InstanceGroupManagerAggregatedList expectedResponse = InstanceGroupManagerAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListInstanceGroupManagersPagedResponse pagedListResponse = client.aggregatedListInstanceGroupManagers(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInstanceGroupManagersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListInstanceGroupManagers(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + Operation actualResponse = + client.deleteInstanceGroupManager(instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + client.deleteInstanceGroupManager(instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteInstancesInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + + client.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInstanceGroupManagerTest() { + InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + String kind = "kind3292052"; + String description = "description-1724546052"; + String baseInstanceName = "baseInstanceName389106439"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + String selfLink = "selfLink-1691268851"; + Integer targetSize = 2084603409; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() + .setInstanceTemplate(instanceTemplate.toString()) + .setKind(kind) + .setDescription(description) + .setBaseInstanceName(baseInstanceName) + .setInstanceGroup(instanceGroup.toString()) + .setSelfLink(selfLink) + .setTargetSize(targetSize) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + InstanceGroupManager actualResponse = + client.getInstanceGroupManager(instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + client.getInstanceGroupManager(instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + + Operation actualResponse = + client.insertInstanceGroupManager(zone, instanceGroupManagerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + + client.insertInstanceGroupManager(zone, instanceGroupManagerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInstanceGroupManagersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InstanceGroupManagerList expectedResponse = InstanceGroupManagerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListInstanceGroupManagersPagedResponse pagedListResponse = client.listInstanceGroupManagers(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInstanceGroupManagersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listInstanceGroupManagers(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listManagedInstancesInstanceGroupManagersTest() { + InstanceGroupManagersListManagedInstancesResponse expectedResponse = InstanceGroupManagersListManagedInstancesResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + InstanceGroupManagersListManagedInstancesResponse actualResponse = + client.listManagedInstancesInstanceGroupManagers(instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listManagedInstancesInstanceGroupManagersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + client.listManagedInstancesInstanceGroupManagers(instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void recreateInstancesInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); + + client.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void resizeInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + Integer size = 3530753; + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + Operation actualResponse = + client.resizeInstanceGroupManager(size, instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void resizeInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Integer size = 3530753; + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + + client.resizeInstanceGroupManager(size, instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setInstanceTemplateInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); + + Operation actualResponse = + client.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); + + client.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setTargetPoolsInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + + Operation actualResponse = + client.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setTargetPoolsInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + + client.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java new file mode 100644 index 000000000000..1203b941f331 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -0,0 +1,347 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.deleteInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.getInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.insertInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.listInstanceTemplatesMethodDescriptor; +import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InstanceTemplateClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteInstanceTemplateMethodDescriptor, + getInstanceTemplateMethodDescriptor, + insertInstanceTemplateMethodDescriptor, + listInstanceTemplatesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InstanceTemplateStubSettings.getDefaultEndpoint()); + + private static InstanceTemplateClient client; + private static InstanceTemplateSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InstanceTemplateSettings.newBuilder() + .setTransportChannelProvider( + InstanceTemplateSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + InstanceTemplateClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceTemplateTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + + Operation actualResponse = + client.deleteInstanceTemplate(instanceTemplate); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceTemplateExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + + client.deleteInstanceTemplate(instanceTemplate); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInstanceTemplateTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceTemplate expectedResponse = InstanceTemplate.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + + InstanceTemplate actualResponse = + client.getInstanceTemplate(instanceTemplate); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInstanceTemplateExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + + client.getInstanceTemplate(instanceTemplate); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertInstanceTemplateTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build(); + + Operation actualResponse = + client.insertInstanceTemplate(project, instanceTemplateResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertInstanceTemplateExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build(); + + client.insertInstanceTemplate(project, instanceTemplateResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInstanceTemplatesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceTemplate itemsElement = InstanceTemplate.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InstanceTemplateList expectedResponse = InstanceTemplateList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListInstanceTemplatesPagedResponse pagedListResponse = client.listInstanceTemplates(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInstanceTemplatesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listInstanceTemplates(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java new file mode 100644 index 000000000000..f135b2b80baa --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.stub.HttpJsonLicensStub.getLicensMethodDescriptor; +import com.google.cloud.compute.v1.stub.LicensStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class LicensClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + getLicensMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, LicensStubSettings.getDefaultEndpoint()); + + private static LicensClient client; + private static LicensSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + LicensSettings.newBuilder() + .setTransportChannelProvider( + LicensSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + LicensClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getLicensTest() { + Boolean chargesUseFee = true; + String kind = "kind3292052"; + String name = "name3373707"; + String selfLink = "selfLink-1691268851"; + License expectedResponse = License.newBuilder() + .setChargesUseFee(chargesUseFee) + .setKind(kind) + .setName(name) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]"); + + License actualResponse = + client.getLicens(license); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getLicensExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]"); + + client.getLicens(license); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java new file mode 100644 index 000000000000..0685e259222e --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java @@ -0,0 +1,251 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.aggregatedListMachineTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.getMachineTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.listMachineTypesMethodDescriptor; +import com.google.cloud.compute.v1.stub.MachineTypeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class MachineTypeClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListMachineTypesMethodDescriptor, + getMachineTypeMethodDescriptor, + listMachineTypesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, MachineTypeStubSettings.getDefaultEndpoint()); + + private static MachineTypeClient client; + private static MachineTypeSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + MachineTypeSettings.newBuilder() + .setTransportChannelProvider( + MachineTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + MachineTypeClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListMachineTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + MachineTypesScopedList itemsItem = MachineTypesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + MachineTypeAggregatedList expectedResponse = MachineTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListMachineTypesPagedResponse pagedListResponse = client.aggregatedListMachineTypes(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListMachineTypesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListMachineTypes(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getMachineTypeTest() { + Boolean isSharedCpu = false; + Integer guestCpus = 1754126894; + String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + Integer memoryMb = 1726613907; + Integer maximumPersistentDisks = 1033091853; + String maximumPersistentDisksSizeGb = "maximumPersistentDisksSizeGb-1993209177"; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + Integer imageSpaceGb = 461539048; + MachineType expectedResponse = MachineType.newBuilder() + .setIsSharedCpu(isSharedCpu) + .setGuestCpus(guestCpus) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setMemoryMb(memoryMb) + .setMaximumPersistentDisks(maximumPersistentDisks) + .setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setImageSpaceGb(imageSpaceGb) + .build(); + mockService.addResponse(expectedResponse); + + MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + + MachineType actualResponse = + client.getMachineType(machineType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getMachineTypeExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + + client.getMachineType(machineType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listMachineTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + MachineType itemsElement = MachineType.newBuilder().build(); + List items = Arrays.asList(itemsElement); + MachineTypeList expectedResponse = MachineTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListMachineTypesPagedResponse pagedListResponse = client.listMachineTypes(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listMachineTypesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listMachineTypes(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java new file mode 100644 index 000000000000..66c923824a01 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -0,0 +1,435 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.deleteNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.getNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.insertNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.listNetworksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.switchToCustomModeNetworkMethodDescriptor; +import com.google.cloud.compute.v1.stub.NetworkStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class NetworkClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteNetworkMethodDescriptor, + getNetworkMethodDescriptor, + insertNetworkMethodDescriptor, + listNetworksMethodDescriptor, + switchToCustomModeNetworkMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, NetworkStubSettings.getDefaultEndpoint()); + + private static NetworkClient client; + private static NetworkSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + NetworkSettings.newBuilder() + .setTransportChannelProvider( + NetworkSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + NetworkClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteNetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + + Operation actualResponse = + client.deleteNetwork(network); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + + client.deleteNetwork(network); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNetworkTest() { + String iPv4Range = "iPv4Range-534892458"; + String kind = "kind3292052"; + Boolean autoCreateSubnetworks = true; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String gatewayIPv4 = "gatewayIPv4-1431933859"; + String selfLink = "selfLink-1691268851"; + Network expectedResponse = Network.newBuilder() + .setIPv4Range(iPv4Range) + .setKind(kind) + .setAutoCreateSubnetworks(autoCreateSubnetworks) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setGatewayIPv4(gatewayIPv4) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + + Network actualResponse = + client.getNetwork(network); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + + client.getNetwork(network); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertNetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + Network networkResource = Network.newBuilder().build(); + + Operation actualResponse = + client.insertNetwork(project, networkResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + Network networkResource = Network.newBuilder().build(); + + client.insertNetwork(project, networkResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNetworksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Network itemsElement = Network.newBuilder().build(); + List items = Arrays.asList(itemsElement); + NetworkList expectedResponse = NetworkList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListNetworksPagedResponse pagedListResponse = client.listNetworks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listNetworksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listNetworks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void switchToCustomModeNetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + + Operation actualResponse = + client.switchToCustomModeNetwork(network); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void switchToCustomModeNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + + client.switchToCustomModeNetwork(network); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java new file mode 100644 index 000000000000..d0c0f6696ed9 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -0,0 +1,464 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveDiskProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; +import com.google.cloud.compute.v1.stub.ProjectStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ProjectClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + getProjectMethodDescriptor, + moveDiskProjectMethodDescriptor, + moveInstanceProjectMethodDescriptor, + setCommonInstanceMetadataProjectMethodDescriptor, + setUsageExportBucketProjectMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); + + private static ProjectClient client; + private static ProjectSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + ProjectSettings.newBuilder() + .setTransportChannelProvider( + ProjectSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + ProjectClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getProjectTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String defaultServiceAccount = "defaultServiceAccount-1848771419"; + String selfLink = "selfLink-1691268851"; + Project expectedResponse = Project.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultServiceAccount(defaultServiceAccount) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + Project actualResponse = + client.getProject(project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.getProject(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveDiskProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); + + Operation actualResponse = + client.moveDiskProject(project, diskMoveRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void moveDiskProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); + + client.moveDiskProject(project, diskMoveRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveInstanceProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); + + Operation actualResponse = + client.moveInstanceProject(project, instanceMoveRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void moveInstanceProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); + + client.moveInstanceProject(project, instanceMoveRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setCommonInstanceMetadataProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + Metadata metadataResource = Metadata.newBuilder().build(); + + Operation actualResponse = + client.setCommonInstanceMetadataProject(project, metadataResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + Metadata metadataResource = Metadata.newBuilder().build(); + + client.setCommonInstanceMetadataProject(project, metadataResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setUsageExportBucketProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build(); + + Operation actualResponse = + client.setUsageExportBucketProject(project, usageExportLocationResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setUsageExportBucketProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build(); + + client.setUsageExportBucketProject(project, usageExportLocationResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java new file mode 100644 index 000000000000..7c4a7f74f64f --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -0,0 +1,525 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionAutoscalerClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionAutoscalerMethodDescriptor, + getRegionAutoscalerMethodDescriptor, + insertRegionAutoscalerMethodDescriptor, + listRegionAutoscalersMethodDescriptor, + patchRegionAutoscalerMethodDescriptor, + updateRegionAutoscalerMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); + + private static RegionAutoscalerClient client; + private static RegionAutoscalerSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionAutoscalerSettings.newBuilder() + .setTransportChannelProvider( + RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RegionAutoscalerClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + + Operation actualResponse = + client.deleteRegionAutoscaler(autoscaler); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + + client.deleteRegionAutoscaler(autoscaler); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRegionAutoscalerTest() { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String target = "target-880905839"; + Autoscaler expectedResponse = Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + + Autoscaler actualResponse = + client.getRegionAutoscaler(autoscaler); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + + client.getRegionAutoscaler(autoscaler); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRegionAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + Operation actualResponse = + client.insertRegionAutoscaler(region, autoscalerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRegionAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + client.insertRegionAutoscaler(region, autoscalerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionAutoscalersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Autoscaler itemsElement = Autoscaler.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RegionAutoscalerList expectedResponse = RegionAutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRegionAutoscalersPagedResponse pagedListResponse = client.listRegionAutoscalers(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionAutoscalersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionAutoscalers(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchRegionAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String autoscaler = "autoscaler517258967"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + Operation actualResponse = + client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchRegionAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String autoscaler = "autoscaler517258967"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateRegionAutoscalerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String autoscaler = "autoscaler517258967"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + Operation actualResponse = + client.updateRegionAutoscaler(autoscaler, region, autoscalerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateRegionAutoscalerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String autoscaler = "autoscaler517258967"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); + + client.updateRegionAutoscaler(autoscaler, region, autoscalerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java new file mode 100644 index 000000000000..df86d985f875 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -0,0 +1,579 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.deleteRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.getHealthRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.getRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.insertRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.listRegionBackendServicesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.patchRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.updateRegionBackendServiceMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionBackendServiceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionBackendServiceClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionBackendServiceMethodDescriptor, + getRegionBackendServiceMethodDescriptor, + getHealthRegionBackendServiceMethodDescriptor, + insertRegionBackendServiceMethodDescriptor, + listRegionBackendServicesMethodDescriptor, + patchRegionBackendServiceMethodDescriptor, + updateRegionBackendServiceMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionBackendServiceStubSettings.getDefaultEndpoint()); + + private static RegionBackendServiceClient client; + private static RegionBackendServiceSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionBackendServiceSettings.newBuilder() + .setTransportChannelProvider( + RegionBackendServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RegionBackendServiceClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + + Operation actualResponse = + client.deleteRegionBackendService(backendService); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + + client.deleteRegionBackendService(backendService); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRegionBackendServiceTest() { + Integer affinityCookieTtlSec = 1777486694; + String kind = "kind3292052"; + String sessionAffinity = "sessionAffinity1000759473"; + String description = "description-1724546052"; + String loadBalancingScheme = "loadBalancingScheme1974502980"; + String portName = "portName1115276169"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + String protocol = "protocol-989163880"; + Boolean enableCDN = false; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + BackendService expectedResponse = BackendService.newBuilder() + .setAffinityCookieTtlSec(affinityCookieTtlSec) + .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setPortName(portName) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setProtocol(protocol) + .setEnableCDN(enableCDN) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + + BackendService actualResponse = + client.getRegionBackendService(backendService); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + + client.getRegionBackendService(backendService); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getHealthRegionBackendServiceTest() { + String kind = "kind3292052"; + BackendServiceGroupHealth expectedResponse = BackendServiceGroupHealth.newBuilder() + .setKind(kind) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + + BackendServiceGroupHealth actualResponse = + client.getHealthRegionBackendService(backendService, resourceGroupReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getHealthRegionBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + + client.getHealthRegionBackendService(backendService, resourceGroupReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRegionBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + Operation actualResponse = + client.insertRegionBackendService(region, backendServiceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRegionBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + client.insertRegionBackendService(region, backendServiceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionBackendServicesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + BackendService itemsElement = BackendService.newBuilder().build(); + List items = Arrays.asList(itemsElement); + BackendServiceList expectedResponse = BackendServiceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRegionBackendServicesPagedResponse pagedListResponse = client.listRegionBackendServices(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionBackendServicesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionBackendServices(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchRegionBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + Operation actualResponse = + client.patchRegionBackendService(backendService, backendServiceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchRegionBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + client.patchRegionBackendService(backendService, backendServiceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateRegionBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + Operation actualResponse = + client.updateRegionBackendService(backendService, backendServiceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateRegionBackendServiceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + BackendService backendServiceResource = BackendService.newBuilder().build(); + + client.updateRegionBackendService(backendService, backendServiceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java new file mode 100644 index 000000000000..dc90e29233ed --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java @@ -0,0 +1,183 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionStub.getRegionMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionStub.listRegionsMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + getRegionMethodDescriptor, + listRegionsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionStubSettings.getDefaultEndpoint()); + + private static RegionClient client; + private static RegionSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionSettings.newBuilder() + .setTransportChannelProvider( + RegionSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RegionClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getRegionTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + Region expectedResponse = Region.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + Region actualResponse = + client.getRegion(region); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.getRegion(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Region itemsElement = Region.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RegionList expectedResponse = RegionList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListRegionsPagedResponse pagedListResponse = client.listRegions(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listRegions(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java new file mode 100644 index 000000000000..398e6cc4fbff --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -0,0 +1,334 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.getRegionInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.listInstancesRegionInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.listRegionInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.setNamedPortsRegionInstanceGroupMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionInstanceGroupClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + getRegionInstanceGroupMethodDescriptor, + listRegionInstanceGroupsMethodDescriptor, + listInstancesRegionInstanceGroupsMethodDescriptor, + setNamedPortsRegionInstanceGroupMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionInstanceGroupStubSettings.getDefaultEndpoint()); + + private static RegionInstanceGroupClient client; + private static RegionInstanceGroupSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionInstanceGroupSettings.newBuilder() + .setTransportChannelProvider( + RegionInstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RegionInstanceGroupClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getRegionInstanceGroupTest() { + String kind = "kind3292052"; + String description = "description-1724546052"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + Integer size = 3530753; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InstanceGroup expectedResponse = InstanceGroup.newBuilder() + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setSize(size) + .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + + InstanceGroup actualResponse = + client.getRegionInstanceGroup(instanceGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + + client.getRegionInstanceGroup(instanceGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionInstanceGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RegionInstanceGroupList expectedResponse = RegionInstanceGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRegionInstanceGroupsPagedResponse pagedListResponse = client.listRegionInstanceGroups(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionInstanceGroupsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionInstanceGroups(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInstancesRegionInstanceGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RegionInstanceGroupsListInstances expectedResponse = RegionInstanceGroupsListInstances.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build(); + + ListInstancesRegionInstanceGroupsPagedResponse pagedListResponse = client.listInstancesRegionInstanceGroups(instanceGroup, regionInstanceGroupsListInstancesRequestResource); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInstancesRegionInstanceGroupsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build(); + + client.listInstancesRegionInstanceGroups(instanceGroup, regionInstanceGroupsListInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setNamedPortsRegionInstanceGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); + + Operation actualResponse = + client.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setNamedPortsRegionInstanceGroupExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); + + client.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java new file mode 100644 index 000000000000..b6d7eef22c72 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -0,0 +1,904 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.abandonInstancesRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.deleteInstancesRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.deleteRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.getRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.insertRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.listManagedInstancesRegionInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.listRegionInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.recreateInstancesRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.resizeRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.setTargetPoolsRegionInstanceGroupManagerMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionInstanceGroupManagerClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + abandonInstancesRegionInstanceGroupManagerMethodDescriptor, + deleteRegionInstanceGroupManagerMethodDescriptor, + deleteInstancesRegionInstanceGroupManagerMethodDescriptor, + getRegionInstanceGroupManagerMethodDescriptor, + insertRegionInstanceGroupManagerMethodDescriptor, + listRegionInstanceGroupManagersMethodDescriptor, + listManagedInstancesRegionInstanceGroupManagersMethodDescriptor, + recreateInstancesRegionInstanceGroupManagerMethodDescriptor, + resizeRegionInstanceGroupManagerMethodDescriptor, + setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor, + setTargetPoolsRegionInstanceGroupManagerMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionInstanceGroupManagerStubSettings.getDefaultEndpoint()); + + private static RegionInstanceGroupManagerClient client; + private static RegionInstanceGroupManagerSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionInstanceGroupManagerSettings.newBuilder() + .setTransportChannelProvider( + RegionInstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RegionInstanceGroupManagerClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void abandonInstancesRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + + client.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + Operation actualResponse = + client.deleteRegionInstanceGroupManager(instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + client.deleteRegionInstanceGroupManager(instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteInstancesRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + + Operation actualResponse = + client.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + + client.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRegionInstanceGroupManagerTest() { + InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + String kind = "kind3292052"; + String description = "description-1724546052"; + String baseInstanceName = "baseInstanceName389106439"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + String selfLink = "selfLink-1691268851"; + Integer targetSize = 2084603409; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() + .setInstanceTemplate(instanceTemplate.toString()) + .setKind(kind) + .setDescription(description) + .setBaseInstanceName(baseInstanceName) + .setInstanceGroup(instanceGroup.toString()) + .setSelfLink(selfLink) + .setTargetSize(targetSize) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + InstanceGroupManager actualResponse = + client.getRegionInstanceGroupManager(instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + client.getRegionInstanceGroupManager(instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + + Operation actualResponse = + client.insertRegionInstanceGroupManager(region, instanceGroupManagerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + + client.insertRegionInstanceGroupManager(region, instanceGroupManagerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionInstanceGroupManagersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RegionInstanceGroupManagerList expectedResponse = RegionInstanceGroupManagerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRegionInstanceGroupManagersPagedResponse pagedListResponse = client.listRegionInstanceGroupManagers(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionInstanceGroupManagersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionInstanceGroupManagers(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listManagedInstancesRegionInstanceGroupManagersTest() { + RegionInstanceGroupManagersListInstancesResponse expectedResponse = RegionInstanceGroupManagersListInstancesResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + RegionInstanceGroupManagersListInstancesResponse actualResponse = + client.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listManagedInstancesRegionInstanceGroupManagersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + client.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void recreateInstancesRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); + + Operation actualResponse = + client.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); + + client.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void resizeRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + Integer size = 3530753; + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + Operation actualResponse = + client.resizeRegionInstanceGroupManager(size, instanceGroupManager); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void resizeRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Integer size = 3530753; + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + + client.resizeRegionInstanceGroupManager(size, instanceGroupManager); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setInstanceTemplateRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); + + Operation actualResponse = + client.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); + + client.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setTargetPoolsRegionInstanceGroupManagerTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + + Operation actualResponse = + client.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setTargetPoolsRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + + client.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java new file mode 100644 index 000000000000..f7afaeae9997 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java @@ -0,0 +1,247 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.deleteRegionOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.getRegionOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.listRegionOperationsMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionOperationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionOperationClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionOperationMethodDescriptor, + getRegionOperationMethodDescriptor, + listRegionOperationsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionOperationStubSettings.getDefaultEndpoint()); + + private static RegionOperationClient client; + private static RegionOperationSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionOperationSettings.newBuilder() + .setTransportChannelProvider( + RegionOperationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RegionOperationClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionOperationTest() { + mockService.addNullResponse(); + + ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + + client.deleteRegionOperation(operation); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionOperationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + + client.deleteRegionOperation(operation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRegionOperationTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + + Operation actualResponse = + client.getRegionOperation(operation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionOperationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + + client.getRegionOperation(operation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionOperationsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Operation itemsElement = Operation.newBuilder().build(); + List items = Arrays.asList(itemsElement); + OperationList expectedResponse = OperationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRegionOperationsPagedResponse pagedListResponse = client.listRegionOperations(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionOperationsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionOperations(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java new file mode 100644 index 000000000000..ea08051ff041 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -0,0 +1,363 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.deleteRouteMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.getRouteMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.insertRouteMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.listRoutesMethodDescriptor; +import com.google.cloud.compute.v1.stub.RouteStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RouteClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteRouteMethodDescriptor, + getRouteMethodDescriptor, + insertRouteMethodDescriptor, + listRoutesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RouteStubSettings.getDefaultEndpoint()); + + private static RouteClient client; + private static RouteSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RouteSettings.newBuilder() + .setTransportChannelProvider( + RouteSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RouteClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteRouteTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); + + Operation actualResponse = + client.deleteRoute(route); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRouteExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); + + client.deleteRoute(route); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRouteTest() { + String nextHopGateway = "nextHopGateway-159695614"; + String kind = "kind3292052"; + String description = "description-1724546052"; + Integer priority = 1165461084; + String nextHopNetwork = "nextHopNetwork1872908524"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + String nextHopInstance = "nextHopInstance1467250071"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String destRange = "destRange918198624"; + String nextHopVpnTunnel = "nextHopVpnTunnel-1627639147"; + String nextHopIp = "nextHopIp1184061353"; + String id = "id3355"; + Route expectedResponse = Route.newBuilder() + .setNextHopGateway(nextHopGateway) + .setKind(kind) + .setDescription(description) + .setPriority(priority) + .setNextHopNetwork(nextHopNetwork) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setNextHopInstance(nextHopInstance) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDestRange(destRange) + .setNextHopVpnTunnel(nextHopVpnTunnel) + .setNextHopIp(nextHopIp) + .setId(id) + .build(); + mockService.addResponse(expectedResponse); + + RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); + + Route actualResponse = + client.getRoute(route); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRouteExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); + + client.getRoute(route); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRouteTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + Route routeResource = Route.newBuilder().build(); + + Operation actualResponse = + client.insertRoute(project, routeResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRouteExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + Route routeResource = Route.newBuilder().build(); + + client.insertRoute(project, routeResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRoutesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Route itemsElement = Route.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RouteList expectedResponse = RouteList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListRoutesPagedResponse pagedListResponse = client.listRoutes(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRoutesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listRoutes(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java new file mode 100644 index 000000000000..34b491e236f9 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.aggregatedListRoutersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.deleteRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.getRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.getRouterStatusRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.insertRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.listRoutersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.patchRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.previewRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.updateRouterMethodDescriptor; +import com.google.cloud.compute.v1.stub.RouterStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RouterClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListRoutersMethodDescriptor, + deleteRouterMethodDescriptor, + getRouterMethodDescriptor, + getRouterStatusRouterMethodDescriptor, + insertRouterMethodDescriptor, + listRoutersMethodDescriptor, + patchRouterMethodDescriptor, + previewRouterMethodDescriptor, + updateRouterMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RouterStubSettings.getDefaultEndpoint()); + + private static RouterClient client; + private static RouterSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RouterSettings.newBuilder() + .setTransportChannelProvider( + RouterSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + RouterClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListRoutersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + RoutersScopedList itemsItem = RoutersScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + RouterAggregatedList expectedResponse = RouterAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListRoutersPagedResponse pagedListResponse = client.aggregatedListRouters(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListRoutersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListRouters(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteRouterTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + Operation actualResponse = + client.deleteRouter(router); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + client.deleteRouter(router); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRouterTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + Router expectedResponse = Router.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + Router actualResponse = + client.getRouter(router); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + client.getRouter(router); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRouterStatusRouterTest() { + String kind = "kind3292052"; + RouterStatusResponse expectedResponse = RouterStatusResponse.newBuilder() + .setKind(kind) + .build(); + mockService.addResponse(expectedResponse); + + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + RouterStatusResponse actualResponse = + client.getRouterStatusRouter(router); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRouterStatusRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + client.getRouterStatusRouter(router); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRouterTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Router routerResource = Router.newBuilder().build(); + + Operation actualResponse = + client.insertRouter(region, routerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Router routerResource = Router.newBuilder().build(); + + client.insertRouter(region, routerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRoutersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Router itemsElement = Router.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RouterList expectedResponse = RouterList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRoutersPagedResponse pagedListResponse = client.listRouters(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRoutersExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRouters(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchRouterTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + Router routerResource = Router.newBuilder().build(); + + Operation actualResponse = + client.patchRouter(router, routerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + Router routerResource = Router.newBuilder().build(); + + client.patchRouter(router, routerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void previewRouterTest() { + RoutersPreviewResponse expectedResponse = RoutersPreviewResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + Router routerResource = Router.newBuilder().build(); + + RoutersPreviewResponse actualResponse = + client.previewRouter(router, routerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void previewRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + Router routerResource = Router.newBuilder().build(); + + client.previewRouter(router, routerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateRouterTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + Router routerResource = Router.newBuilder().build(); + + Operation actualResponse = + client.updateRouter(router, routerResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateRouterExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + Router routerResource = Router.newBuilder().build(); + + client.updateRouter(router, routerResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java new file mode 100644 index 000000000000..b5629c0a148d --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -0,0 +1,275 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.deleteSnapshotMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.getSnapshotMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.listSnapshotsMethodDescriptor; +import com.google.cloud.compute.v1.stub.SnapshotStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SnapshotClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteSnapshotMethodDescriptor, + getSnapshotMethodDescriptor, + listSnapshotsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, SnapshotStubSettings.getDefaultEndpoint()); + + private static SnapshotClient client; + private static SnapshotSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + SnapshotSettings.newBuilder() + .setTransportChannelProvider( + SnapshotSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + SnapshotClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteSnapshotTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + + Operation actualResponse = + client.deleteSnapshot(snapshot); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteSnapshotExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + + client.deleteSnapshot(snapshot); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSnapshotTest() { + String sourceDisk = "sourceDisk-85117119"; + String sourceDiskId = "sourceDiskId-1693292839"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + String storageBytesStatus = "storageBytesStatus1027609994"; + String storageBytes = "storageBytes2035244455"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String diskSizeGb = "diskSizeGb-757478089"; + String status = "status-892481550"; + Snapshot expectedResponse = Snapshot.newBuilder() + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setStorageBytesStatus(storageBytesStatus) + .setStorageBytes(storageBytes) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + + Snapshot actualResponse = + client.getSnapshot(snapshot); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getSnapshotExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + + client.getSnapshot(snapshot); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSnapshotsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Snapshot itemsElement = Snapshot.newBuilder().build(); + List items = Arrays.asList(itemsElement); + SnapshotList expectedResponse = SnapshotList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listSnapshotsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listSnapshots(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java new file mode 100644 index 000000000000..688bf2d8e20c --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -0,0 +1,351 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.deleteSslCertificateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.getSslCertificateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.insertSslCertificateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.listSslCertificatesMethodDescriptor; +import com.google.cloud.compute.v1.stub.SslCertificateStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SslCertificateClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteSslCertificateMethodDescriptor, + getSslCertificateMethodDescriptor, + insertSslCertificateMethodDescriptor, + listSslCertificatesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, SslCertificateStubSettings.getDefaultEndpoint()); + + private static SslCertificateClient client; + private static SslCertificateSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + SslCertificateSettings.newBuilder() + .setTransportChannelProvider( + SslCertificateSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + SslCertificateClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteSslCertificateTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + + Operation actualResponse = + client.deleteSslCertificate(sslCertificate); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteSslCertificateExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + + client.deleteSslCertificate(sslCertificate); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSslCertificateTest() { + String privateKey = "privateKey1971943843"; + String kind = "kind3292052"; + String certificate = "certificate1952399767"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + SslCertificate expectedResponse = SslCertificate.newBuilder() + .setPrivateKey(privateKey) + .setKind(kind) + .setCertificate(certificate) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + + SslCertificate actualResponse = + client.getSslCertificate(sslCertificate); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getSslCertificateExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + + client.getSslCertificate(sslCertificate); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertSslCertificateTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + SslCertificate sslCertificateResource = SslCertificate.newBuilder().build(); + + Operation actualResponse = + client.insertSslCertificate(project, sslCertificateResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertSslCertificateExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + SslCertificate sslCertificateResource = SslCertificate.newBuilder().build(); + + client.insertSslCertificate(project, sslCertificateResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSslCertificatesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + SslCertificate itemsElement = SslCertificate.newBuilder().build(); + List items = Arrays.asList(itemsElement); + SslCertificateList expectedResponse = SslCertificateList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListSslCertificatesPagedResponse pagedListResponse = client.listSslCertificates(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listSslCertificatesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listSslCertificates(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java new file mode 100644 index 000000000000..942b5a3d300d --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -0,0 +1,495 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.aggregatedListSubnetworksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.deleteSubnetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.expandIpCidrRangeSubnetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.getSubnetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.insertSubnetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.listSubnetworksMethodDescriptor; +import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SubnetworkClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListSubnetworksMethodDescriptor, + deleteSubnetworkMethodDescriptor, + expandIpCidrRangeSubnetworkMethodDescriptor, + getSubnetworkMethodDescriptor, + insertSubnetworkMethodDescriptor, + listSubnetworksMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, SubnetworkStubSettings.getDefaultEndpoint()); + + private static SubnetworkClient client; + private static SubnetworkSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + SubnetworkSettings.newBuilder() + .setTransportChannelProvider( + SubnetworkSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + SubnetworkClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListSubnetworksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + SubnetworksScopedList itemsItem = SubnetworksScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + SubnetworkAggregatedList expectedResponse = SubnetworkAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListSubnetworksPagedResponse pagedListResponse = client.aggregatedListSubnetworks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListSubnetworksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListSubnetworks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteSubnetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + + Operation actualResponse = + client.deleteSubnetwork(subnetwork); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteSubnetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + + client.deleteSubnetwork(subnetwork); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void expandIpCidrRangeSubnetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); + + Operation actualResponse = + client.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); + + client.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSubnetworkTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String gatewayAddress = "gatewayAddress-77003527"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String ipCidrRange = "ipCidrRange-2049366326"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + Subnetwork expectedResponse = Subnetwork.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setGatewayAddress(gatewayAddress) + .setId(id) + .setRegion(region.toString()) + .setIpCidrRange(ipCidrRange) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + + Subnetwork actualResponse = + client.getSubnetwork(subnetwork); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getSubnetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + + client.getSubnetwork(subnetwork); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertSubnetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); + + Operation actualResponse = + client.insertSubnetwork(region, subnetworkResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertSubnetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); + + client.insertSubnetwork(region, subnetworkResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSubnetworksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Subnetwork itemsElement = Subnetwork.newBuilder().build(); + List items = Arrays.asList(itemsElement); + SubnetworkList expectedResponse = SubnetworkList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListSubnetworksPagedResponse pagedListResponse = client.listSubnetworks(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listSubnetworksExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listSubnetworks(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java new file mode 100644 index 000000000000..ac4c1b9d4f62 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -0,0 +1,433 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.deleteTargetHttpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.getTargetHttpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.insertTargetHttpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.listTargetHttpProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.setUrlMapTargetHttpProxyMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetHttpProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetHttpProxyClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetHttpProxyMethodDescriptor, + getTargetHttpProxyMethodDescriptor, + insertTargetHttpProxyMethodDescriptor, + listTargetHttpProxiesMethodDescriptor, + setUrlMapTargetHttpProxyMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetHttpProxyStubSettings.getDefaultEndpoint()); + + private static TargetHttpProxyClient client; + private static TargetHttpProxySettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetHttpProxySettings.newBuilder() + .setTransportChannelProvider( + TargetHttpProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + TargetHttpProxyClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetHttpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + + Operation actualResponse = + client.deleteTargetHttpProxy(targetHttpProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetHttpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + + client.deleteTargetHttpProxy(targetHttpProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetHttpProxyTest() { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetHttpProxy expectedResponse = TargetHttpProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + + TargetHttpProxy actualResponse = + client.getTargetHttpProxy(targetHttpProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetHttpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + + client.getTargetHttpProxy(targetHttpProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetHttpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build(); + + Operation actualResponse = + client.insertTargetHttpProxy(project, targetHttpProxyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetHttpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build(); + + client.insertTargetHttpProxy(project, targetHttpProxyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetHttpProxiesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetHttpProxy itemsElement = TargetHttpProxy.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetHttpProxyList expectedResponse = TargetHttpProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListTargetHttpProxiesPagedResponse pagedListResponse = client.listTargetHttpProxies(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetHttpProxiesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listTargetHttpProxies(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setUrlMapTargetHttpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); + + Operation actualResponse = + client.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setUrlMapTargetHttpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); + + client.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java new file mode 100644 index 000000000000..0b0281ff8402 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -0,0 +1,517 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetHttpsProxyClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetHttpsProxyMethodDescriptor, + getTargetHttpsProxyMethodDescriptor, + insertTargetHttpsProxyMethodDescriptor, + listTargetHttpsProxiesMethodDescriptor, + setSslCertificatesTargetHttpsProxyMethodDescriptor, + setUrlMapTargetHttpsProxyMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); + + private static TargetHttpsProxyClient client; + private static TargetHttpsProxySettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetHttpsProxySettings.newBuilder() + .setTransportChannelProvider( + TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + TargetHttpsProxyClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetHttpsProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + + Operation actualResponse = + client.deleteTargetHttpsProxy(targetHttpsProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + + client.deleteTargetHttpsProxy(targetHttpsProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetHttpsProxyTest() { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetHttpsProxy expectedResponse = TargetHttpsProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + + TargetHttpsProxy actualResponse = + client.getTargetHttpsProxy(targetHttpsProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + + client.getTargetHttpsProxy(targetHttpsProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetHttpsProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); + + Operation actualResponse = + client.insertTargetHttpsProxy(project, targetHttpsProxyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); + + client.insertTargetHttpsProxy(project, targetHttpsProxyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetHttpsProxiesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetHttpsProxy itemsElement = TargetHttpsProxy.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetHttpsProxyList expectedResponse = TargetHttpsProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListTargetHttpsProxiesPagedResponse pagedListResponse = client.listTargetHttpsProxies(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetHttpsProxiesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listTargetHttpsProxies(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setSslCertificatesTargetHttpsProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + + Operation actualResponse = + client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + + client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setUrlMapTargetHttpsProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); + + Operation actualResponse = + client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); + + client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java new file mode 100644 index 000000000000..633e7c312570 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -0,0 +1,409 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.aggregatedListTargetInstancesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.deleteTargetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.getTargetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.insertTargetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.listTargetInstancesMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetInstanceStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetInstanceClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListTargetInstancesMethodDescriptor, + deleteTargetInstanceMethodDescriptor, + getTargetInstanceMethodDescriptor, + insertTargetInstanceMethodDescriptor, + listTargetInstancesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetInstanceStubSettings.getDefaultEndpoint()); + + private static TargetInstanceClient client; + private static TargetInstanceSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetInstanceSettings.newBuilder() + .setTransportChannelProvider( + TargetInstanceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + TargetInstanceClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListTargetInstancesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetInstancesScopedList itemsItem = TargetInstancesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + TargetInstanceAggregatedList expectedResponse = TargetInstanceAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListTargetInstancesPagedResponse pagedListResponse = client.aggregatedListTargetInstances(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListTargetInstancesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListTargetInstances(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteTargetInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + + Operation actualResponse = + client.deleteTargetInstance(targetInstance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + + client.deleteTargetInstance(targetInstance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetInstanceTest() { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String natPolicy = "natPolicy-1637703152"; + String selfLink = "selfLink-1691268851"; + TargetInstance expectedResponse = TargetInstance.newBuilder() + .setInstance(instance.toString()) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setNatPolicy(natPolicy) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + + TargetInstance actualResponse = + client.getTargetInstance(targetInstance); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + + client.getTargetInstance(targetInstance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); + + Operation actualResponse = + client.insertTargetInstance(zone, targetInstanceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); + + client.insertTargetInstance(zone, targetInstanceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetInstancesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetInstance itemsElement = TargetInstance.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetInstanceList expectedResponse = TargetInstanceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListTargetInstancesPagedResponse pagedListResponse = client.listTargetInstances(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetInstancesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listTargetInstances(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java new file mode 100644 index 000000000000..0cbf3ddfed3a --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -0,0 +1,877 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.addHealthCheckTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.addInstanceTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.aggregatedListTargetPoolsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.deleteTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.getHealthTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.getTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.insertTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.listTargetPoolsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.removeHealthCheckTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.removeInstanceTargetPoolMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.setBackupTargetPoolMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetPoolStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetPoolClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + addHealthCheckTargetPoolMethodDescriptor, + addInstanceTargetPoolMethodDescriptor, + aggregatedListTargetPoolsMethodDescriptor, + deleteTargetPoolMethodDescriptor, + getTargetPoolMethodDescriptor, + getHealthTargetPoolMethodDescriptor, + insertTargetPoolMethodDescriptor, + listTargetPoolsMethodDescriptor, + removeHealthCheckTargetPoolMethodDescriptor, + removeInstanceTargetPoolMethodDescriptor, + setBackupTargetPoolMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetPoolStubSettings.getDefaultEndpoint()); + + private static TargetPoolClient client; + private static TargetPoolSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetPoolSettings.newBuilder() + .setTransportChannelProvider( + TargetPoolSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + TargetPoolClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void addHealthCheckTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); + + Operation actualResponse = + client.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void addHealthCheckTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); + + client.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void addInstanceTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); + + Operation actualResponse = + client.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void addInstanceTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); + + client.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void aggregatedListTargetPoolsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetPoolsScopedList itemsItem = TargetPoolsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + TargetPoolAggregatedList expectedResponse = TargetPoolAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListTargetPoolsPagedResponse pagedListResponse = client.aggregatedListTargetPools(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListTargetPoolsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListTargetPools(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + + Operation actualResponse = + client.deleteTargetPool(targetPool); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + + client.deleteTargetPool(targetPool); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetPoolTest() { + String kind = "kind3292052"; + String sessionAffinity = "sessionAffinity1000759473"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + Float failoverRatio = -8.6107481E7F; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String backupPool = "backupPool1119626361"; + String selfLink = "selfLink-1691268851"; + TargetPool expectedResponse = TargetPool.newBuilder() + .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setFailoverRatio(failoverRatio) + .setId(id) + .setRegion(region.toString()) + .setBackupPool(backupPool) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + + TargetPool actualResponse = + client.getTargetPool(targetPool); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + + client.getTargetPool(targetPool); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getHealthTargetPoolTest() { + String kind = "kind3292052"; + TargetPoolInstanceHealth expectedResponse = TargetPoolInstanceHealth.newBuilder() + .setKind(kind) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build(); + + TargetPoolInstanceHealth actualResponse = + client.getHealthTargetPool(targetPool, instanceReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getHealthTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build(); + + client.getHealthTargetPool(targetPool, instanceReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + TargetPool targetPoolResource = TargetPool.newBuilder().build(); + + Operation actualResponse = + client.insertTargetPool(region, targetPoolResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + TargetPool targetPoolResource = TargetPool.newBuilder().build(); + + client.insertTargetPool(region, targetPoolResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetPoolsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetPool itemsElement = TargetPool.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetPoolList expectedResponse = TargetPoolList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListTargetPoolsPagedResponse pagedListResponse = client.listTargetPools(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetPoolsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listTargetPools(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void removeHealthCheckTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); + + Operation actualResponse = + client.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void removeHealthCheckTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); + + client.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void removeInstanceTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); + + Operation actualResponse = + client.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void removeInstanceTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); + + client.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setBackupTargetPoolTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + Float failoverRatio = -8.6107481E7F; + TargetReference targetReferenceResource = TargetReference.newBuilder().build(); + + Operation actualResponse = + client.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setBackupTargetPoolExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + Float failoverRatio = -8.6107481E7F; + TargetReference targetReferenceResource = TargetReference.newBuilder().build(); + + client.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java new file mode 100644 index 000000000000..d89556886cfa --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -0,0 +1,603 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.deleteTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.getTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.insertTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.listTargetSslProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setBackendServiceTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setProxyHeaderTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setSslCertificatesTargetSslProxyMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetSslProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetSslProxyClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetSslProxyMethodDescriptor, + getTargetSslProxyMethodDescriptor, + insertTargetSslProxyMethodDescriptor, + listTargetSslProxiesMethodDescriptor, + setBackendServiceTargetSslProxyMethodDescriptor, + setProxyHeaderTargetSslProxyMethodDescriptor, + setSslCertificatesTargetSslProxyMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetSslProxyStubSettings.getDefaultEndpoint()); + + private static TargetSslProxyClient client; + private static TargetSslProxySettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetSslProxySettings.newBuilder() + .setTransportChannelProvider( + TargetSslProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + TargetSslProxyClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetSslProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + + Operation actualResponse = + client.deleteTargetSslProxy(targetSslProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetSslProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + + client.deleteTargetSslProxy(targetSslProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetSslProxyTest() { + String kind = "kind3292052"; + String service = "service1984153269"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String proxyHeader = "proxyHeader-1987109506"; + String selfLink = "selfLink-1691268851"; + TargetSslProxy expectedResponse = TargetSslProxy.newBuilder() + .setKind(kind) + .setService(service) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setProxyHeader(proxyHeader) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + + TargetSslProxy actualResponse = + client.getTargetSslProxy(targetSslProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetSslProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + + client.getTargetSslProxy(targetSslProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetSslProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); + + Operation actualResponse = + client.insertTargetSslProxy(project, targetSslProxyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetSslProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); + + client.insertTargetSslProxy(project, targetSslProxyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetSslProxiesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetSslProxy itemsElement = TargetSslProxy.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetSslProxyList expectedResponse = TargetSslProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListTargetSslProxiesPagedResponse pagedListResponse = client.listTargetSslProxies(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetSslProxiesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listTargetSslProxies(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setBackendServiceTargetSslProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); + + Operation actualResponse = + client.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setBackendServiceTargetSslProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); + + client.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setProxyHeaderTargetSslProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); + + Operation actualResponse = + client.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); + + client.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setSslCertificatesTargetSslProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); + + Operation actualResponse = + client.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); + + client.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java new file mode 100644 index 000000000000..92a63d52aaaa --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -0,0 +1,409 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.aggregatedListTargetVpnGatewaysMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.deleteTargetVpnGatewayMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.getTargetVpnGatewayMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.insertTargetVpnGatewayMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.listTargetVpnGatewaysMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetVpnGatewayClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListTargetVpnGatewaysMethodDescriptor, + deleteTargetVpnGatewayMethodDescriptor, + getTargetVpnGatewayMethodDescriptor, + insertTargetVpnGatewayMethodDescriptor, + listTargetVpnGatewaysMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetVpnGatewayStubSettings.getDefaultEndpoint()); + + private static TargetVpnGatewayClient client; + private static TargetVpnGatewaySettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetVpnGatewaySettings.newBuilder() + .setTransportChannelProvider( + TargetVpnGatewaySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + TargetVpnGatewayClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListTargetVpnGatewaysTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetVpnGatewaysScopedList itemsItem = TargetVpnGatewaysScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + TargetVpnGatewayAggregatedList expectedResponse = TargetVpnGatewayAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListTargetVpnGatewaysPagedResponse pagedListResponse = client.aggregatedListTargetVpnGateways(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListTargetVpnGatewaysExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListTargetVpnGateways(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteTargetVpnGatewayTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + + Operation actualResponse = + client.deleteTargetVpnGateway(targetVpnGateway); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetVpnGatewayExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + + client.deleteTargetVpnGateway(targetVpnGateway); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetVpnGatewayTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + TargetVpnGateway expectedResponse = TargetVpnGateway.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + + TargetVpnGateway actualResponse = + client.getTargetVpnGateway(targetVpnGateway); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetVpnGatewayExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + + client.getTargetVpnGateway(targetVpnGateway); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetVpnGatewayTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build(); + + Operation actualResponse = + client.insertTargetVpnGateway(region, targetVpnGatewayResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetVpnGatewayExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build(); + + client.insertTargetVpnGateway(region, targetVpnGatewayResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetVpnGatewaysTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetVpnGateway itemsElement = TargetVpnGateway.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetVpnGatewayList expectedResponse = TargetVpnGatewayList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListTargetVpnGatewaysPagedResponse pagedListResponse = client.listTargetVpnGateways(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetVpnGatewaysExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listTargetVpnGateways(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java new file mode 100644 index 000000000000..297ffcada731 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.deleteUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.getUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.insertUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.invalidateCacheUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.listUrlMapsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.patchUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.updateUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.validateUrlMapMethodDescriptor; +import com.google.cloud.compute.v1.stub.UrlMapStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class UrlMapClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteUrlMapMethodDescriptor, + getUrlMapMethodDescriptor, + insertUrlMapMethodDescriptor, + invalidateCacheUrlMapMethodDescriptor, + listUrlMapsMethodDescriptor, + patchUrlMapMethodDescriptor, + updateUrlMapMethodDescriptor, + validateUrlMapMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, UrlMapStubSettings.getDefaultEndpoint()); + + private static UrlMapClient client; + private static UrlMapSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + UrlMapSettings.newBuilder() + .setTransportChannelProvider( + UrlMapSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + UrlMapClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteUrlMapTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + + Operation actualResponse = + client.deleteUrlMap(urlMap); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + + client.deleteUrlMap(urlMap); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getUrlMapTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String defaultService = "defaultService1980854967"; + String selfLink = "selfLink-1691268851"; + UrlMap expectedResponse = UrlMap.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultService(defaultService) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + + UrlMap actualResponse = + client.getUrlMap(urlMap); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + + client.getUrlMap(urlMap); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertUrlMapTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + UrlMap urlMapResource = UrlMap.newBuilder().build(); + + Operation actualResponse = + client.insertUrlMap(project, urlMapResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + UrlMap urlMapResource = UrlMap.newBuilder().build(); + + client.insertUrlMap(project, urlMapResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void invalidateCacheUrlMapTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); + + Operation actualResponse = + client.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void invalidateCacheUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); + + client.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listUrlMapsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + UrlMap itemsElement = UrlMap.newBuilder().build(); + List items = Arrays.asList(itemsElement); + UrlMapList expectedResponse = UrlMapList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListUrlMapsPagedResponse pagedListResponse = client.listUrlMaps(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listUrlMapsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listUrlMaps(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchUrlMapTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMap urlMapResource = UrlMap.newBuilder().build(); + + Operation actualResponse = + client.patchUrlMap(urlMap, urlMapResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMap urlMapResource = UrlMap.newBuilder().build(); + + client.patchUrlMap(urlMap, urlMapResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateUrlMapTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMap urlMapResource = UrlMap.newBuilder().build(); + + Operation actualResponse = + client.updateUrlMap(urlMap, urlMapResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMap urlMapResource = UrlMap.newBuilder().build(); + + client.updateUrlMap(urlMap, urlMapResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void validateUrlMapTest() { + UrlMapsValidateResponse expectedResponse = UrlMapsValidateResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build(); + + UrlMapsValidateResponse actualResponse = + client.validateUrlMap(urlMap, urlMapsValidateRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void validateUrlMapExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build(); + + client.validateUrlMap(urlMap, urlMapsValidateRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java new file mode 100644 index 000000000000..e4f730024484 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -0,0 +1,421 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.aggregatedListVpnTunnelsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.deleteVpnTunnelMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.getVpnTunnelMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.insertVpnTunnelMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.listVpnTunnelsMethodDescriptor; +import com.google.cloud.compute.v1.stub.VpnTunnelStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class VpnTunnelClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListVpnTunnelsMethodDescriptor, + deleteVpnTunnelMethodDescriptor, + getVpnTunnelMethodDescriptor, + insertVpnTunnelMethodDescriptor, + listVpnTunnelsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, VpnTunnelStubSettings.getDefaultEndpoint()); + + private static VpnTunnelClient client; + private static VpnTunnelSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + VpnTunnelSettings.newBuilder() + .setTransportChannelProvider( + VpnTunnelSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + VpnTunnelClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListVpnTunnelsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + VpnTunnelsScopedList itemsItem = VpnTunnelsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + VpnTunnelAggregatedList expectedResponse = VpnTunnelAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListVpnTunnelsPagedResponse pagedListResponse = client.aggregatedListVpnTunnels(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListVpnTunnelsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListVpnTunnels(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteVpnTunnelTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + + Operation actualResponse = + client.deleteVpnTunnel(vpnTunnel); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteVpnTunnelExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + + client.deleteVpnTunnel(vpnTunnel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getVpnTunnelTest() { + String sharedSecretHash = "sharedSecretHash935752803"; + String kind = "kind3292052"; + String description = "description-1724546052"; + Integer ikeVersion = 1292118044; + String selfLink = "selfLink-1691268851"; + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String detailedStatus = "detailedStatus-740240799"; + String peerIp = "peerIp-690492124"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String sharedSecret = "sharedSecret-154938422"; + TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + String status = "status-892481550"; + VpnTunnel expectedResponse = VpnTunnel.newBuilder() + .setSharedSecretHash(sharedSecretHash) + .setKind(kind) + .setDescription(description) + .setIkeVersion(ikeVersion) + .setSelfLink(selfLink) + .setRouter(router.toString()) + .setDetailedStatus(detailedStatus) + .setPeerIp(peerIp) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .setSharedSecret(sharedSecret) + .setTargetVpnGateway(targetVpnGateway.toString()) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + + VpnTunnel actualResponse = + client.getVpnTunnel(vpnTunnel); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getVpnTunnelExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + + client.getVpnTunnel(vpnTunnel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertVpnTunnelTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); + + Operation actualResponse = + client.insertVpnTunnel(region, vpnTunnelResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertVpnTunnelExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); + + client.insertVpnTunnel(region, vpnTunnelResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listVpnTunnelsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + VpnTunnel itemsElement = VpnTunnel.newBuilder().build(); + List items = Arrays.asList(itemsElement); + VpnTunnelList expectedResponse = VpnTunnelList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListVpnTunnelsPagedResponse pagedListResponse = client.listVpnTunnels(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listVpnTunnelsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listVpnTunnels(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java new file mode 100644 index 000000000000..8c9bf5106a81 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java @@ -0,0 +1,185 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneStub.getZoneMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneStub.listZonesMethodDescriptor; +import com.google.cloud.compute.v1.stub.ZoneStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ZoneClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + getZoneMethodDescriptor, + listZonesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, ZoneStubSettings.getDefaultEndpoint()); + + private static ZoneClient client; + private static ZoneSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + ZoneSettings.newBuilder() + .setTransportChannelProvider( + ZoneSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + ZoneClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getZoneTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + Zone expectedResponse = Zone.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + Zone actualResponse = + client.getZone(zone); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getZoneExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.getZone(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listZonesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Zone itemsElement = Zone.newBuilder().build(); + List items = Arrays.asList(itemsElement); + ZoneList expectedResponse = ZoneList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListZonesPagedResponse pagedListResponse = client.listZones(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listZonesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listZones(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java new file mode 100644 index 000000000000..b05aefd1c2e3 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java @@ -0,0 +1,247 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.deleteZoneOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.getZoneOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.listZoneOperationsMethodDescriptor; +import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ZoneOperationClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteZoneOperationMethodDescriptor, + getZoneOperationMethodDescriptor, + listZoneOperationsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, ZoneOperationStubSettings.getDefaultEndpoint()); + + private static ZoneOperationClient client; + private static ZoneOperationSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + ZoneOperationSettings.newBuilder() + .setTransportChannelProvider( + ZoneOperationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()).build(); + client = + ZoneOperationClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteZoneOperationTest() { + mockService.addNullResponse(); + + ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + + client.deleteZoneOperation(operation); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteZoneOperationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + + client.deleteZoneOperation(operation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getZoneOperationTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + + Operation actualResponse = + client.getZoneOperation(operation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getZoneOperationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + + client.getZoneOperation(operation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listZoneOperationsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Operation itemsElement = Operation.newBuilder().build(); + List items = Arrays.asList(itemsElement); + OperationList expectedResponse = OperationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListZoneOperationsPagedResponse pagedListResponse = client.listZoneOperations(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listZoneOperationsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listZoneOperations(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java new file mode 100644 index 000000000000..e85ca9d0db5c --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java @@ -0,0 +1,151 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.v1.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.paging.Page; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.cloud.ServiceOptions; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.DiskTypeClient; +import com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import com.google.cloud.compute.v1.DiskTypeName; +import com.google.cloud.compute.v1.DiskTypeSettings; +import com.google.cloud.compute.v1.DiskTypesScopedList; +import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; + +public class ITComputeTest { + + private static final String ZONE = "us-central1-a"; + private static final String DISK_TYPE = "local-ssd"; + private static final String DEFAULT_PROJECT = ServiceOptions.getDefaultProjectId(); + + private static DiskTypeClient diskTypeClient; + private static DiskTypeSettings diskTypeSettings; + + + @Rule + public Timeout globalTimeout = Timeout.seconds(300); + + @BeforeClass + public static void beforeClass() throws IOException{ + Credentials credentials = GoogleCredentials.getApplicationDefault(); + + diskTypeSettings = + DiskTypeSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credentials)).build(); + diskTypeClient = + DiskTypeClient.create(diskTypeSettings); + } + + @AfterClass + public static void tearDown() throws Exception { + diskTypeClient.close(); + } + + @Test + public void testGetDiskType() { + DiskType diskType = diskTypeClient.getDiskType(DiskTypeName.of(DISK_TYPE, DEFAULT_PROJECT, ZONE)); + DiskTypeName returnDiskName = DiskTypeName.parse(trimUrl(diskType.getSelfLink())); + assertEquals(ZONE, returnDiskName.getZone()); + assertEquals(DISK_TYPE, returnDiskName.getDiskType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testListDiskTypes() { + Page diskPage = diskTypeClient.listDiskTypes(ZoneName.of(DEFAULT_PROJECT, ZONE)).getPage(); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + assertNotNull(diskType.getSelfLink()); + DiskTypeName returnDiskName = DiskTypeName.parse(trimUrl(diskType.getSelfLink())); + assertEquals(ZONE, returnDiskName.getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithFilter() { + ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder() + .setZone(ZoneName.of(DEFAULT_PROJECT, ZONE).toString()) + .setFilter("(defaultDiskSizeGb = 375)") + .build(); + Page diskPage = diskTypeClient.listDiskTypes(request).getPage(); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + assertNotNull(diskType.getZone()); + ZoneName zoneName = ZoneName.parse(trimUrl(diskType.getZone())); + assertEquals(ZONE, zoneName.getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypes() { + AggregatedListDiskTypesPagedResponse pagedListResponse = diskTypeClient.aggregatedListDiskTypes(ProjectName.of(DEFAULT_PROJECT)); + List diskTypeScopedListIterator = Lists.newArrayList(pagedListResponse.iterateAll()); + List diskTypeIterator = new LinkedList<>(); + for (DiskTypesScopedList scopedList : diskTypeScopedListIterator) { + diskTypeIterator.addAll(scopedList.getDiskTypesList()); + } + assertTrue(diskTypeIterator.size() > 0); + for (DiskType diskType : diskTypeIterator) { + assertNotNull(diskType.getZone()); + DiskTypeName zoneName = DiskTypeName.parse(trimUrl(diskType.getSelfLink())); + assertNotNull(zoneName.getDiskType()); + assertNotNull(zoneName.getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + /** For a given resource's URI, trim the path until it contains only the PathTemplate string. */ + private String trimUrl(String url) { + return url.replaceFirst("^https://www.googleapis.com/compute/v1/", ""); + } +} From 107c18c5ef4958557cb94789adccad6eb5a18754 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 28 Mar 2018 15:34:10 -0700 Subject: [PATCH 02/42] remove bp threeten dep --- google-cloud-clients/google-cloud-compute/pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index 42d87a5da316..648866f59c5a 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -64,13 +64,6 @@ testlib - - - org.threeten - threetenbp - 1.3.3 - - junit junit From aef6e2faea779252fd960ee1219b9e0b2364e623 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 28 Mar 2018 15:42:19 -0700 Subject: [PATCH 03/42] reimport master's deprecated ITComputeTest.java --- .../compute/deprecated/it/ITComputeTest.java | 3684 ++++++++--------- 1 file changed, 1842 insertions(+), 1842 deletions(-) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java index 18116a7a4a8f..943d915ced9c 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java @@ -1,1842 +1,1842 @@ -// /* -// * Copyright 2016 Google LLC -// * -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ -// -// package com.google.cloud.compute.deprecated.it; -// -// import static org.junit.Assert.assertEquals; -// import static org.junit.Assert.assertFalse; -// import static org.junit.Assert.assertNotEquals; -// import static org.junit.Assert.assertNotNull; -// import static org.junit.Assert.assertNull; -// import static org.junit.Assert.assertTrue; -// -// import com.google.api.gax.paging.Page; -// import com.google.cloud.compute.deprecated.Address; -// import com.google.cloud.compute.deprecated.AddressId; -// import com.google.cloud.compute.deprecated.AddressInfo; -// import com.google.cloud.compute.deprecated.AttachedDisk; -// import com.google.cloud.compute.deprecated.Compute; -// import com.google.cloud.compute.deprecated.DeprecationStatus; -// import com.google.cloud.compute.deprecated.Disk; -// import com.google.cloud.compute.deprecated.DiskConfiguration; -// import com.google.cloud.compute.deprecated.DiskId; -// import com.google.cloud.compute.deprecated.DiskImageConfiguration; -// import com.google.cloud.compute.deprecated.DiskInfo; -// import com.google.cloud.compute.deprecated.DiskType; -// import com.google.cloud.compute.deprecated.DiskTypeId; -// import com.google.cloud.compute.deprecated.GlobalAddressId; -// import com.google.cloud.compute.deprecated.Image; -// import com.google.cloud.compute.deprecated.ImageConfiguration; -// import com.google.cloud.compute.deprecated.ImageDiskConfiguration; -// import com.google.cloud.compute.deprecated.ImageId; -// import com.google.cloud.compute.deprecated.ImageInfo; -// import com.google.cloud.compute.deprecated.Instance; -// import com.google.cloud.compute.deprecated.InstanceId; -// import com.google.cloud.compute.deprecated.InstanceInfo; -// import com.google.cloud.compute.deprecated.License; -// import com.google.cloud.compute.deprecated.LicenseId; -// import com.google.cloud.compute.deprecated.MachineType; -// import com.google.cloud.compute.deprecated.MachineTypeId; -// import com.google.cloud.compute.deprecated.Network; -// import com.google.cloud.compute.deprecated.NetworkConfiguration; -// import com.google.cloud.compute.deprecated.NetworkId; -// import com.google.cloud.compute.deprecated.NetworkInfo; -// import com.google.cloud.compute.deprecated.NetworkInterface; -// import com.google.cloud.compute.deprecated.Operation; -// import com.google.cloud.compute.deprecated.Region; -// import com.google.cloud.compute.deprecated.RegionAddressId; -// import com.google.cloud.compute.deprecated.RegionOperationId; -// import com.google.cloud.compute.deprecated.SchedulingOptions; -// import com.google.cloud.compute.deprecated.Snapshot; -// import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; -// import com.google.cloud.compute.deprecated.SnapshotId; -// import com.google.cloud.compute.deprecated.SnapshotInfo; -// import com.google.cloud.compute.deprecated.StandardDiskConfiguration; -// import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; -// import com.google.cloud.compute.deprecated.StorageImageConfiguration; -// import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; -// import com.google.cloud.compute.deprecated.Subnetwork; -// import com.google.cloud.compute.deprecated.SubnetworkId; -// import com.google.cloud.compute.deprecated.SubnetworkInfo; -// import com.google.cloud.compute.deprecated.Zone; -// import com.google.cloud.compute.deprecated.ZoneOperationId; -// import com.google.cloud.compute.deprecated.testing.ResourceCleaner; -// import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; -// import com.google.common.collect.ImmutableList; -// import com.google.common.collect.ImmutableMap; -// import com.google.common.collect.ImmutableSet; -// import java.util.Iterator; -// import java.util.List; -// import java.util.Map; -// import java.util.Set; -// import java.util.concurrent.TimeoutException; -// import org.junit.AfterClass; -// import org.junit.BeforeClass; -// import org.junit.Ignore; -// import org.junit.Rule; -// import org.junit.Test; -// import org.junit.rules.Timeout; -// -// public class ITComputeTest { -// -// private static final String REGION = "us-central1"; -// private static final String ZONE = "us-central1-a"; -// private static final String DISK_TYPE = "local-ssd"; -// private static final String MACHINE_TYPE = "f1-micro"; -// private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); -// private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); -// private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); -// private static final String IMAGE_PROJECT = "debian-cloud"; -// -// private static Compute compute; -// private static ResourceCleaner resourceCleaner; -// -// -// @Rule -// public Timeout globalTimeout = Timeout.seconds(300); -// -// @BeforeClass -// public static void beforeClass() { -// RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); -// compute = computeHelper.getOptions().getService(); -// resourceCleaner = ResourceCleaner.create(compute); -// } -// -// @AfterClass -// public static void tearDown() { -// resourceCleaner.cleanUp(); -// } -// -// @Test -// public void testGetDiskType() { -// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); -// // assertNotNull(diskType.getGeneratedId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotNull(diskType.getDefaultDiskSizeGb()); -// } -// -// @Test -// public void testGetDiskTypeWithSelectedFields() { -// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, -// Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); -// // assertNotNull(diskType.getGeneratedId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNull(diskType.getDescription()); -// assertNull(diskType.getValidDiskSize()); -// assertNull(diskType.getDefaultDiskSizeGb()); -// } -// -// @Test -// public void testListDiskTypes() { -// Page diskPage = compute.listDiskTypes(ZONE); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotNull(diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testListDiskTypesWithSelectedFields() { -// Page diskPage = compute.listDiskTypes(ZONE, -// Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// assertNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNull(diskType.getDescription()); -// assertNull(diskType.getValidDiskSize()); -// assertNull(diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testListDiskTypesWithFilter() { -// Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( -// Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // todo(mziccard): uncomment or remove once #695 is closed -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListDiskTypes() { -// Page diskPage = compute.listDiskTypes(); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotNull(diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListDiskTypesWithFilter() { -// Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( -// Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // todo(mziccard): uncomment or remove once #695 is closed -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testGetMachineType() { -// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// -// @Test -// public void testGetMachineTypeWithSelectedFields() { -// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, -// Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); -// assertNotNull(machineType.getGeneratedId()); -// assertNull(machineType.getCreationTimestamp()); -// assertNull(machineType.getDescription()); -// assertNull(machineType.getCpus()); -// assertNull(machineType.getMemoryMb()); -// assertNull(machineType.getMaximumPersistentDisks()); -// assertNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// -// @Test -// public void testListMachineTypes() { -// Page machinePage = compute.listMachineTypes(ZONE); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testListMachineTypesWithSelectedFields() { -// Page machinePage = compute.listMachineTypes(ZONE, -// Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNull(machineType.getDescription()); -// assertNull(machineType.getCpus()); -// assertNull(machineType.getMemoryMb()); -// assertNull(machineType.getMaximumPersistentDisks()); -// assertNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testListMachineTypesWithFilter() { -// Page machinePage = compute.listMachineTypes(ZONE, -// Compute.MachineTypeListOption.filter( -// Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertEquals(2, (long) machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListMachineTypes() { -// Page machinePage = compute.listMachineTypes(); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListMachineTypesWithFilter() { -// Page machinePage = -// compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( -// Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotEquals(2, (long) machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testGetLicense() { -// License license = compute.getLicense(LICENSE_ID); -// assertEquals(LICENSE_ID, license.getLicenseId()); -// assertNotNull(license.chargesUseFee()); -// } -// -// @Test -// public void testGetLicenseWithSelectedFields() { -// License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); -// assertEquals(LICENSE_ID, license.getLicenseId()); -// assertNull(license.chargesUseFee()); -// } -// -// @Test -// public void testGetRegion() { -// Region region = compute.getRegion(REGION); -// assertEquals(REGION, region.getRegionId().getRegion()); -// assertNotNull(region.getDescription()); -// assertNotNull(region.getCreationTimestamp()); -// assertNotNull(region.getGeneratedId()); -// assertNotNull(region.getQuotas()); -// assertNotNull(region.getStatus()); -// assertNotNull(region.getZones()); -// } -// -// @Test -// public void testGetRegionWithSelectedFields() { -// Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); -// assertEquals(REGION, region.getRegionId().getRegion()); -// assertNotNull(region.getGeneratedId()); -// assertNull(region.getDescription()); -// assertNull(region.getCreationTimestamp()); -// assertNull(region.getQuotas()); -// assertNull(region.getStatus()); -// assertNull(region.getZones()); -// } -// -// @Test -// public void testListRegions() { -// Page regionPage = compute.listRegions(); -// Iterator regionIterator = regionPage.iterateAll().iterator(); -// while (regionIterator.hasNext()) { -// Region region = regionIterator.next(); -// assertNotNull(region.getRegionId()); -// assertNotNull(region.getDescription()); -// assertNotNull(region.getCreationTimestamp()); -// assertNotNull(region.getGeneratedId()); -// assertNotNull(region.getQuotas()); -// assertNotNull(region.getStatus()); -// assertNotNull(region.getZones()); -// } -// } -// -// @Test -// public void testListRegionsWithSelectedFields() { -// Page regionPage = -// compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); -// Iterator regionIterator = regionPage.iterateAll().iterator(); -// while (regionIterator.hasNext()) { -// Region region = regionIterator.next(); -// assertNotNull(region.getRegionId()); -// assertNull(region.getDescription()); -// assertNull(region.getCreationTimestamp()); -// assertNotNull(region.getGeneratedId()); -// assertNull(region.getQuotas()); -// assertNull(region.getStatus()); -// assertNull(region.getZones()); -// } -// } -// -// @Test -// public void testListRegionsWithFilter() { -// Page regionPage = compute.listRegions(Compute.RegionListOption.filter( -// Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); -// Iterator regionIterator = regionPage.iterateAll().iterator(); -// assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); -// assertFalse(regionIterator.hasNext()); -// } -// -// @Test -// public void testGetZone() { -// Zone zone = compute.getZone(ZONE); -// assertEquals(ZONE, zone.getZoneId().getZone()); -// assertNotNull(zone.getGeneratedId()); -// assertNotNull(zone.getCreationTimestamp()); -// assertNotNull(zone.getDescription()); -// assertNotNull(zone.getStatus()); -// assertNotNull(zone.getRegion()); -// } -// -// @Test -// public void testGetZoneWithSelectedFields() { -// Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); -// assertEquals(ZONE, zone.getZoneId().getZone()); -// assertNotNull(zone.getGeneratedId()); -// assertNull(zone.getCreationTimestamp()); -// assertNull(zone.getDescription()); -// assertNull(zone.getStatus()); -// assertNull(zone.getRegion()); -// } -// -// @Test -// public void testListZones() { -// Page zonePage = compute.listZones(); -// Iterator zoneIterator = zonePage.iterateAll().iterator(); -// while (zoneIterator.hasNext()) { -// Zone zone = zoneIterator.next(); -// assertNotNull(zone.getZoneId()); -// assertNotNull(zone.getGeneratedId()); -// assertNotNull(zone.getCreationTimestamp()); -// assertNotNull(zone.getDescription()); -// assertNotNull(zone.getStatus()); -// assertNotNull(zone.getRegion()); -// } -// } -// -// @Test -// public void testListZonesWithSelectedFields() { -// Page zonePage = compute.listZones( -// Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); -// Iterator zoneIterator = zonePage.iterateAll().iterator(); -// while (zoneIterator.hasNext()) { -// Zone zone = zoneIterator.next(); -// assertNotNull(zone.getZoneId()); -// assertNull(zone.getGeneratedId()); -// assertNotNull(zone.getCreationTimestamp()); -// assertNull(zone.getDescription()); -// assertNull(zone.getStatus()); -// assertNull(zone.getRegion()); -// } -// } -// -// @Test -// public void testListZonesWithFilter() { -// Page zonePage = compute.listZones( -// Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); -// Iterator zoneIterator = zonePage.iterateAll().iterator(); -// assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); -// assertFalse(zoneIterator.hasNext()); -// } -// -// @Test -// public void testListGlobalOperations() { -// Page operationPage = compute.listGlobalOperations(); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertNotNull(operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListGlobalOperationsWithSelectedFields() { -// Page operationPage = -// compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getTargetLink()); -// assertNull(operation.getTargetId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getStatus()); -// assertNull(operation.getStatusMessage()); -// assertNull(operation.getUser()); -// assertNull(operation.getProgress()); -// assertNull(operation.getDescription()); -// assertNull(operation.getInsertTime()); -// assertNull(operation.getStartTime()); -// assertNull(operation.getEndTime()); -// assertNull(operation.getWarnings()); -// assertNull(operation.getHttpErrorMessage()); -// } -// } -// -// @Test -// public void testListGlobalOperationsWithFilter() { -// Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( -// Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertEquals(Operation.Status.DONE, operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListRegionOperations() { -// Page operationPage = compute.listRegionOperations(REGION); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(REGION, operation.getOperationId().getRegion()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertNotNull(operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListRegionOperationsWithSelectedFields() { -// Page operationPage = compute.listRegionOperations(REGION, -// Compute.OperationListOption.fields(Compute.OperationField.ID)); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(REGION, operation.getOperationId().getRegion()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getTargetLink()); -// assertNull(operation.getTargetId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getStatus()); -// assertNull(operation.getStatusMessage()); -// assertNull(operation.getUser()); -// assertNull(operation.getProgress()); -// assertNull(operation.getDescription()); -// assertNull(operation.getInsertTime()); -// assertNull(operation.getStartTime()); -// assertNull(operation.getEndTime()); -// assertNull(operation.getWarnings()); -// assertNull(operation.getHttpErrorMessage()); -// } -// } -// -// @Test -// public void testListRegionOperationsWithFilter() { -// Page operationPage = compute.listRegionOperations(REGION, -// Compute.OperationListOption.filter(Compute.OperationFilter.equals( -// Compute.OperationField.STATUS, "DONE"))); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(REGION, operation.getOperationId().getRegion()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertEquals(Operation.Status.DONE, operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListZoneOperations() { -// Page operationPage = compute.listZoneOperations(ZONE); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(ZONE, operation.getOperationId().getZone()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertNotNull(operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListZoneOperationsWithSelectedFields() { -// Page operationPage = compute.listZoneOperations(ZONE, -// Compute.OperationListOption.fields(Compute.OperationField.ID)); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(ZONE, operation.getOperationId().getZone()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getTargetLink()); -// assertNull(operation.getTargetId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getStatus()); -// assertNull(operation.getStatusMessage()); -// assertNull(operation.getUser()); -// assertNull(operation.getProgress()); -// assertNull(operation.getDescription()); -// assertNull(operation.getInsertTime()); -// assertNull(operation.getStartTime()); -// assertNull(operation.getEndTime()); -// assertNull(operation.getWarnings()); -// assertNull(operation.getHttpErrorMessage()); -// } -// } -// -// @Test -// public void testListZoneOperationsWithFilter() { -// Page operationPage = compute.listZoneOperations(ZONE, -// Compute.OperationListOption.filter(Compute.OperationFilter.equals( -// Compute.OperationField.STATUS, "DONE"))); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(ZONE, operation.getOperationId().getZone()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertEquals(Operation.Status.DONE, operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; -// AddressId addressId = RegionAddressId.of(REGION, name); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation operation = compute.create(addressInfo); -// operation.waitFor(); -// // test get -// Address remoteAddress = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNotNull(remoteAddress.getAddress()); -// assertNotNull(remoteAddress.getCreationTimestamp()); -// assertNotNull(remoteAddress.getGeneratedId()); -// assertNotNull(remoteAddress.getStatus()); -// // test get with selected fields -// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNull(remoteAddress.getAddress()); -// assertNull(remoteAddress.getCreationTimestamp()); -// assertNull(remoteAddress.getGeneratedId()); -// operation = remoteAddress.delete(); -// operation.waitFor(); -// resourceCleaner.remove(addressId); -// assertNull(compute.getAddress(addressId)); -// } -// -// @Test -// public void testListRegionAddresses() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-region-address"; -// String[] addressNames = {prefix + "1", prefix + "2"}; -// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); -// AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); -// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); -// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstAddressId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondAddressId); -// Set addressSet = ImmutableSet.copyOf(addressNames); -// // test list -// Compute.AddressFilter filter = -// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); -// Page
addressPage = -// compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); -// Iterator
addressIterator = addressPage.iterateAll().iterator(); -// int count = 0; -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertNotNull(address.getAddressId()); -// assertTrue(address.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, address.getAddressId().getRegion()); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNotNull(address.getCreationTimestamp()); -// assertNotNull(address.getGeneratedId()); -// count++; -// } -// assertEquals(2, count); -// // test list with selected fields -// count = 0; -// addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), -// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); -// addressIterator = addressPage.iterateAll().iterator(); -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertTrue(address.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, address.getAddressId().getRegion()); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNull(address.getCreationTimestamp()); -// assertNull(address.getGeneratedId()); -// assertNull(address.getStatus()); -// assertNull(address.getUsage()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; -// String[] addressNames = {prefix + "1", prefix + "2"}; -// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); -// AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); -// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); -// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstAddressId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondAddressId); -// Set addressSet = ImmutableSet.copyOf(addressNames); -// Compute.AddressFilter filter = -// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); -// Page
addressPage = -// compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); -// Iterator
addressIterator = addressPage.iterateAll().iterator(); -// int count = 0; -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertNotNull(address.getAddressId()); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNotNull(address.getCreationTimestamp()); -// assertNotNull(address.getGeneratedId()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; -// AddressId addressId = GlobalAddressId.of(name); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation operation = compute.create(addressInfo); -// operation.waitFor(); -// // test get -// Address remoteAddress = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNotNull(remoteAddress.getAddress()); -// assertNotNull(remoteAddress.getCreationTimestamp()); -// assertNotNull(remoteAddress.getGeneratedId()); -// assertNotNull(remoteAddress.getStatus()); -// // test get with selected fields -// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNull(remoteAddress.getAddress()); -// assertNull(remoteAddress.getCreationTimestamp()); -// assertNull(remoteAddress.getGeneratedId()); -// operation = remoteAddress.delete(); -// operation.waitFor(); -// resourceCleaner.remove(addressId); -// assertNull(compute.getAddress(addressId)); -// } -// -// @Test -// public void testListGlobalAddresses() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-global-address"; -// String[] addressNames = {prefix + "1", prefix + "2"}; -// AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); -// AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); -// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); -// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstAddressId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondAddressId); -// Set addressSet = ImmutableSet.copyOf(addressNames); -// // test list -// Compute.AddressFilter filter = -// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); -// Page
addressPage = -// compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); -// Iterator
addressIterator = addressPage.iterateAll().iterator(); -// int count = 0; -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertNotNull(address.getAddressId()); -// assertTrue(address.getAddressId() instanceof GlobalAddressId); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNotNull(address.getCreationTimestamp()); -// assertNotNull(address.getGeneratedId()); -// count++; -// } -// assertEquals(2, count); -// // test list with selected fields -// count = 0; -// addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), -// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); -// addressIterator = addressPage.iterateAll().iterator(); -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertTrue(address.getAddressId() instanceof GlobalAddressId); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNull(address.getCreationTimestamp()); -// assertNull(address.getGeneratedId()); -// assertNull(address.getStatus()); -// assertNull(address.getUsage()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testCreateGetResizeAndDeleteStandardDisk() -// throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; -// DiskId diskId = DiskId.of(ZONE, name); -// DiskInfo diskInfo = -// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// // test get -// Disk remoteDisk = compute.getDisk(diskId); -// resourceCleaner.add(diskId); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.resize(200L); -// operation.waitFor(); -// // test resize and get with selected fields -// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(200L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.delete(); -// operation.waitFor(); -// resourceCleaner.remove(diskId); -// assertNull(compute.getDisk(diskId)); -// } -// -// @Test -// public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; -// DiskId diskId = DiskId.of(ZONE, name); -// DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// // test get -// Disk remoteDisk = compute.getDisk(diskId); -// resourceCleaner.add(diskId); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); -// ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); -// assertNotNull(remoteConfiguration.getSourceImageId()); -// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); -// assertNotNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// // test get with selected fields -// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); -// remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); -// assertNull(remoteConfiguration.getSourceImageId()); -// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); -// assertNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.delete(); -// operation.waitFor(); -// resourceCleaner.remove(diskId); -// assertNull(compute.getDisk(diskId)); -// } -// -// @Test -// public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() -// throws InterruptedException, TimeoutException { -// String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; -// String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; -// DiskId diskId = DiskId.of(ZONE, diskName); -// DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); -// String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; -// DiskInfo diskInfo = -// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// Disk remoteDisk = compute.getDisk(diskId); -// resourceCleaner.add(diskId); -// operation = remoteDisk.createSnapshot(snapshotName); -// operation.waitFor(); -// // test get snapshot with selected fields -// Snapshot snapshot = compute.getSnapshot(snapshotName, -// Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); -// resourceCleaner.add(snapshot.getSnapshotId()); -// assertNull(snapshot.getGeneratedId()); -// assertNotNull(snapshot.getSnapshotId()); -// assertNotNull(snapshot.getCreationTimestamp()); -// assertNull(snapshot.getDescription()); -// assertNull(snapshot.getStatus()); -// assertNull(snapshot.getDiskSizeGb()); -// assertNull(snapshot.getLicenses()); -// assertNull(snapshot.getSourceDisk()); -// assertNull(snapshot.getSourceDiskId()); -// assertNull(snapshot.getStorageBytes()); -// assertNull(snapshot.getStorageBytesStatus()); -// // test get snapshot -// snapshot = compute.getSnapshot(snapshotName); -// assertNotNull(snapshot.getGeneratedId()); -// assertNotNull(snapshot.getSnapshotId()); -// assertNotNull(snapshot.getCreationTimestamp()); -// assertNotNull(snapshot.getStatus()); -// assertEquals(100L, (long) snapshot.getDiskSizeGb()); -// assertEquals(diskName, snapshot.getSourceDisk().getDisk()); -// assertNotNull(snapshot.getSourceDiskId()); -// assertNotNull(snapshot.getStorageBytes()); -// assertNotNull(snapshot.getStorageBytesStatus()); -// remoteDisk.delete(); -// resourceCleaner.remove(diskId); -// diskInfo = -// DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); -// operation = compute.create(diskInfo); -// operation.waitFor(); -// // test get disk -// remoteDisk = compute.getDisk(snapshotDiskId); -// resourceCleaner.add(snapshotDiskId); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); -// SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); -// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNotNull(remoteConfiguration.getSourceSnapshotId()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// // test get disk with selected fields -// remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNull(remoteDisk.getCreationStatus()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); -// remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); -// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); -// assertNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.delete(); -// operation.waitFor(); -// resourceCleaner.remove(snapshotDiskId); -// assertNull(compute.getDisk(snapshotDiskId)); -// operation = snapshot.delete(); -// operation.waitFor(); -// resourceCleaner.remove(snapshot.getSnapshotId()); -// assertNull(compute.getSnapshot(snapshotName)); -// } -// -// @Test -// public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; -// String[] diskNames = {prefix + "1", prefix + "2"}; -// DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); -// DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); -// DiskConfiguration configuration = -// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); -// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); -// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstDiskId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondDiskId); -// Set diskSet = ImmutableSet.copyOf(diskNames); -// // test list disks -// Compute.DiskFilter diskFilter = -// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); -// Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); -// Iterator diskIterator = diskPage.iterateAll().iterator(); -// int count = 0; -// while (diskIterator.hasNext()) { -// Disk remoteDisk = diskIterator.next(); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// count++; -// } -// assertEquals(2, count); -// // test list disks with selected fields -// count = 0; -// diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), -// Compute.DiskListOption.fields(Compute.DiskField.STATUS)); -// diskIterator = diskPage.iterateAll().iterator(); -// while (diskIterator.hasNext()) { -// Disk remoteDisk = diskIterator.next(); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// count++; -// } -// assertEquals(2, count); -// // test snapshots -// SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); -// SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); -// firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); -// secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstSnapshotId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondSnapshotId); -// // test list snapshots -// Compute.SnapshotFilter snapshotFilter = -// Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); -// Page snapshotPage = -// compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); -// Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); -// count = 0; -// while (snapshotIterator.hasNext()) { -// Snapshot remoteSnapshot = snapshotIterator.next(); -// assertNotNull(remoteSnapshot.getGeneratedId()); -// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); -// assertNotNull(remoteSnapshot.getCreationTimestamp()); -// assertNotNull(remoteSnapshot.getStatus()); -// assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); -// assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); -// assertNotNull(remoteSnapshot.getSourceDiskId()); -// assertNotNull(remoteSnapshot.getStorageBytes()); -// assertNotNull(remoteSnapshot.getStorageBytesStatus()); -// count++; -// } -// assertEquals(2, count); -// // test list snapshots with selected fields -// snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), -// Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); -// snapshotIterator = snapshotPage.iterateAll().iterator(); -// count = 0; -// while (snapshotIterator.hasNext()) { -// Snapshot remoteSnapshot = snapshotIterator.next(); -// assertNull(remoteSnapshot.getGeneratedId()); -// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); -// assertNotNull(remoteSnapshot.getCreationTimestamp()); -// assertNull(remoteSnapshot.getStatus()); -// assertNull(remoteSnapshot.getDiskSizeGb()); -// assertNull(remoteSnapshot.getSourceDisk()); -// assertNull(remoteSnapshot.getSourceDiskId()); -// assertNull(remoteSnapshot.getStorageBytes()); -// assertNull(remoteSnapshot.getStorageBytesStatus()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testAggregatedListDisks() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; -// String[] diskZones = {"us-central1-a", "us-east1-c"}; -// String[] diskNames = {prefix + "1", prefix + "2"}; -// DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); -// DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); -// DiskConfiguration configuration = -// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); -// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); -// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstDiskId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondDiskId); -// Set zoneSet = ImmutableSet.copyOf(diskZones); -// Set diskSet = ImmutableSet.copyOf(diskNames); -// Compute.DiskFilter diskFilter = -// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); -// Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); -// Iterator diskIterator = diskPage.iterateAll().iterator(); -// int count = 0; -// while (diskIterator.hasNext()) { -// Disk remoteDisk = diskIterator.next(); -// assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); -// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { -// String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; -// String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; -// DiskId diskId = DiskId.of(ZONE, diskName); -// ImageId imageId = ImageId.of(imageName); -// DiskInfo diskInfo = -// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// Disk remoteDisk = compute.getDisk(diskId); -// ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); -// operation = compute.create(imageInfo); -// operation.waitFor(); -// resourceCleaner.add(diskId); -// // test get image with selected fields -// Image image = compute.getImage(imageId, -// Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); -// resourceCleaner.add(imageId); -// assertNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNull(image.getDescription()); -// assertNotNull(image.getConfiguration()); -// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); -// DiskImageConfiguration remoteConfiguration = image.getConfiguration(); -// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); -// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); -// assertNull(image.getStatus()); -// assertNull(image.getDiskSizeGb()); -// assertNull(image.getLicenses()); -// assertNull(image.getDeprecationStatus()); -// // test get image -// image = compute.getImage(imageId); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); -// remoteConfiguration = image.getConfiguration(); -// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); -// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); -// assertEquals(100L, (long) image.getDiskSizeGb()); -// assertNotNull(image.getStatus()); -// assertNull(image.getDeprecationStatus()); -// // test deprecate image -// DeprecationStatus deprecationStatus = -// DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) -// .setDeprecated(System.currentTimeMillis()) -// .build(); -// operation = image.deprecate(deprecationStatus); -// operation.waitFor(); -// image = compute.getImage(imageId); -// assertEquals(deprecationStatus, image.getDeprecationStatus()); -// remoteDisk.delete(); -// resourceCleaner.remove(diskId); -// operation = image.delete(); -// operation.waitFor(); -// resourceCleaner.remove(imageId); -// assertNull(compute.getImage(imageId)); -// } -// -// @Test -// public void testListImages() { -// Page imagePage = compute.listImages(IMAGE_PROJECT); -// Iterator imageIterator = imagePage.iterateAll().iterator(); -// int count = 0; -// while (imageIterator.hasNext()) { -// count++; -// Image image = imageIterator.next(); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertNotNull(image.getStatus()); -// assertNotNull(image.getDiskSizeGb()); -// } -// assertTrue(count > 0); -// } -// -// @Test -// public void testListImagesWithSelectedFields() { -// Page imagePage = -// compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); -// Iterator imageIterator = imagePage.iterateAll().iterator(); -// int count = 0; -// while (imageIterator.hasNext()) { -// count++; -// Image image = imageIterator.next(); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertNull(image.getStatus()); -// assertNull(image.getDiskSizeGb()); -// assertNull(image.getLicenses()); -// assertNull(image.getDeprecationStatus()); -// } -// assertTrue(count > 0); -// } -// -// @Test -// public void testListImagesWithFilter() { -// Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( -// Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); -// Iterator imageIterator = imagePage.iterateAll().iterator(); -// int count = 0; -// while (imageIterator.hasNext()) { -// count++; -// Image image = imageIterator.next(); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertNotNull(image.getStatus()); -// assertNotNull(image.getDiskSizeGb()); -// assertEquals(365056004L, -// (long) image.getConfiguration().getArchiveSizeBytes()); -// } -// assertTrue(count > 0); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-network"; -// NetworkId networkId = NetworkId.of(name); -// NetworkInfo networkInfo = -// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// // test get network with selected fields -// Network network = compute.getNetwork(networkId.getNetwork(), -// Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); -// resourceCleaner.add(networkId); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertNull(network.getDescription()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// // test get network -// network = compute.getNetwork(networkId.getNetwork()); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNotNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// operation = network.delete(); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getNetwork(name)); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testListNetworks() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "list-network"; -// NetworkId networkId = NetworkId.of(name); -// NetworkInfo networkInfo = -// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// resourceCleaner.add(networkId); -// // test list -// Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); -// Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); -// Iterator networkIterator = networkPage.iterateAll().iterator(); -// int count = 0; -// while (networkIterator.hasNext()) { -// Network network = networkIterator.next(); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNotNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// // test list with selected fields -// count = 0; -// networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), -// Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); -// networkIterator = networkPage.iterateAll().iterator(); -// while (networkIterator.hasNext()) { -// Network network = networkIterator.next(); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertNull(network.getDescription()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// operation = compute.deleteNetwork(networkId); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getNetwork(name)); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { -// String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; -// NetworkId networkId = NetworkId.of(networkName); -// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// // test get network -// Network network = compute.getNetwork(networkId.getNetwork()); -// resourceCleaner.add(networkId); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNotNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); -// assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); -// assertFalse(network.getConfiguration().autoCreateSubnetworks()); -// String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; -// SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); -// SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); -// operation = compute.create(subnetworkInfo); -// operation.waitFor(); -// // test get subnetwork with selected fields -// Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, -// Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); -// resourceCleaner.add(subnetworkId); -// assertNull(subnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(subnetwork.getCreationTimestamp()); -// assertNull(subnetwork.getDescription()); -// assertNull(subnetwork.getGatewayAddress()); -// assertNull(subnetwork.getNetwork()); -// assertNull(subnetwork.getIpRange()); -// // test get subnetwork -// subnetwork = compute.getSubnetwork(subnetworkId); -// assertNotNull(subnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(subnetwork.getCreationTimestamp()); -// assertNotNull(subnetwork.getGatewayAddress()); -// assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); -// assertEquals("192.168.0.0/16", subnetwork.getIpRange()); -// // test list subnetworks -// Compute.SubnetworkFilter filter = -// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); -// Page subnetworkPage = -// compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); -// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); -// int count = 0; -// while (subnetworkIterator.hasNext()) { -// Subnetwork remoteSubnetwork = subnetworkIterator.next(); -// assertNotNull(remoteSubnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), -// remoteSubnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(remoteSubnetwork.getCreationTimestamp()); -// assertNotNull(remoteSubnetwork.getGatewayAddress()); -// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); -// assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// // test list subnetworks with selected fields -// subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), -// Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); -// subnetworkIterator = subnetworkPage.iterateAll().iterator(); -// count = 0; -// while (subnetworkIterator.hasNext()) { -// Subnetwork remoteSubnetwork = subnetworkIterator.next(); -// assertNull(remoteSubnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), -// remoteSubnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(remoteSubnetwork.getCreationTimestamp()); -// assertNull(remoteSubnetwork.getDescription()); -// assertNull(remoteSubnetwork.getGatewayAddress()); -// assertNull(remoteSubnetwork.getNetwork()); -// assertNull(remoteSubnetwork.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// operation = subnetwork.delete(); -// operation.waitFor(); -// resourceCleaner.remove(subnetworkId); -// operation = compute.deleteNetwork(networkId); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getSubnetwork(subnetworkId)); -// assertNull(compute.getNetwork(networkName)); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { -// String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; -// NetworkId networkId = NetworkId.of(networkName); -// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// resourceCleaner.add(networkId); -// String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; -// String[] regionNames = {"us-central1", "us-east1"}; -// String[] subnetworkNames = {prefix + "1", prefix + "2"}; -// String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; -// SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); -// SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); -// SubnetworkInfo firstSubnetworkInfo = -// SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); -// SubnetworkInfo secondSubnetworkInfo = -// SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); -// Operation firstOperation = compute.create(firstSubnetworkInfo); -// Operation secondOperation = compute.create(secondSubnetworkInfo); -// firstOperation.waitFor(); -// resourceCleaner.add(firstSubnetworkId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondSubnetworkId); -// Set regionSet = ImmutableSet.copyOf(regionNames); -// Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); -// Set rangeSet = ImmutableSet.copyOf(ipRanges); -// Compute.SubnetworkFilter subnetworkFilter = -// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); -// Page subnetworkPage = -// compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); -// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); -// int count = 0; -// while (subnetworkIterator.hasNext()) { -// Subnetwork remoteSubnetwork = subnetworkIterator.next(); -// assertNotNull(remoteSubnetwork.getGeneratedId()); -// assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); -// assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); -// assertNotNull(remoteSubnetwork.getCreationTimestamp()); -// assertNotNull(remoteSubnetwork.getGatewayAddress()); -// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); -// assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); -// count++; -// } -// assertEquals(2, count); -// firstOperation = compute.deleteSubnetwork(firstSubnetworkId); -// secondOperation = compute.deleteSubnetwork(secondSubnetworkId); -// firstOperation.waitFor(); -// resourceCleaner.remove(firstSubnetworkId); -// secondOperation.waitFor(); -// resourceCleaner.remove(secondSubnetworkId); -// operation = compute.deleteNetwork(networkId); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getSubnetwork(firstSubnetworkId)); -// assertNull(compute.getSubnetwork(secondSubnetworkId)); -// assertNull(compute.getNetwork(networkName)); -// } -// -// @Test -// public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; -// String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; -// // Create an address to assign to the instance -// AddressId addressId = RegionAddressId.of(REGION, addressName); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation operation = compute.create(addressInfo); -// operation.waitFor(); -// Address address = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// // Create an instance -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) -// .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() -// .setName("NAT") -// .setNatIp(address.getAddress()).build()) -// .build(); -// AttachedDisk disk1 = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// AttachedDisk disk2 = -// AttachedDisk.of("dev1", -// AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) -// .setAttachedDisks(disk1, disk2) -// .setNetworkInterfaces(networkInterface) -// .build(); -// operation = compute.create(instanceInfo); -// operation.waitFor(); -// // test get -// Instance remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); -// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); -// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); -// assertNotNull(remoteInstance.getCreationTimestamp()); -// Set deviceSet = ImmutableSet.of("dev0", "dev1"); -// assertEquals(2, remoteInstance.getAttachedDisks().size()); -// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { -// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); -// } -// assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, -// remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); -// AttachedDisk.PersistentDiskConfiguration remoteConfiguration = -// remoteInstance.getAttachedDisks().get(0).getConfiguration(); -// assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); -// assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); -// assertTrue(remoteConfiguration.boot()); -// assertTrue(remoteConfiguration.autoDelete()); -// assertEquals(1, remoteInstance.getNetworkInterfaces().size()); -// NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); -// assertNotNull(remoteNetworkInterface.getName()); -// assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); -// List remoteAccessConfigurations = -// remoteNetworkInterface.getAccessConfigurations(); -// assertNotNull(remoteAccessConfigurations); -// assertEquals(1, remoteAccessConfigurations.size()); -// NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); -// assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); -// assertEquals("NAT", remoteAccessConfig.getName()); -// assertNotNull(remoteInstance.getMetadata()); -// assertNotNull(remoteInstance.getTags()); -// // test get with selected fields -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); -// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); -// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); -// assertNull(remoteInstance.getMachineType()); -// assertNotNull(remoteInstance.getCreationTimestamp()); -// assertNull(remoteInstance.getAttachedDisks()); -// assertNull(remoteInstance.getNetworkInterfaces()); -// assertNull(remoteInstance.getMetadata()); -// assertNull(remoteInstance.getTags()); -// // test get default serial port output -// String serialPortOutput = remoteInstance.getSerialPortOutput(); -// assertNotNull(serialPortOutput); -// // test get serial port output by number -// String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); -// assertTrue(newSerialPortOutput.contains(serialPortOutput)); -// operation = remoteInstance.delete(); -// operation.waitFor(); -// resourceCleaner.remove(instanceId); -// assertNull(compute.getInstance(instanceId)); -// } -// -// @Test -// public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation operation = compute.create(instanceInfo); -// operation.waitFor(); -// Instance remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// resourceCleaner.add(instanceId); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// operation = remoteInstance.stop(); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); -// operation = remoteInstance.start(); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// operation = remoteInstance.reset(); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// } -// -// @Test -// public void testSetInstanceProperties() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation operation = compute.create(instanceInfo); -// operation.waitFor(); -// Instance remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// // test set tags -// List tags = ImmutableList.of("tag1", "tag2"); -// operation = remoteInstance.setTags(tags); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(tags, remoteInstance.getTags().getValues()); -// // test set metadata -// Map metadata = ImmutableMap.of("key", "value"); -// operation = remoteInstance.setMetadata(metadata); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(metadata, remoteInstance.getMetadata().getValues()); -// // test set machine type -// operation = remoteInstance.stop(); -// operation.waitFor(); -// operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); -// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); -// // test set scheduling options -// SchedulingOptions options = -// SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); -// operation = remoteInstance.setSchedulingOptions(options); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(options, remoteInstance.getSchedulingOptions()); -// } -// -// @Test -// public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; -// String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation instanceOperation = compute.create(instanceInfo); -// DiskId diskId = DiskId.of(ZONE, diskName); -// Operation diskOperation = compute.create(DiskInfo.of(diskId, -// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); -// instanceOperation.waitFor(); -// diskOperation.waitFor(); -// resourceCleaner.add(diskId); -// Instance remoteInstance = compute.getInstance(instanceId); -// // test attach disk -// instanceOperation = remoteInstance.attachDisk("dev1", -// AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// Set deviceSet = ImmutableSet.of("dev0", "dev1"); -// assertEquals(2, remoteInstance.getAttachedDisks().size()); -// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { -// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); -// } -// // test set disk auto-delete -// instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(2, remoteInstance.getAttachedDisks().size()); -// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { -// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); -// assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); -// } -// // test detach disk -// instanceOperation = remoteInstance.detachDisk("dev1"); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(1, remoteInstance.getAttachedDisks().size()); -// assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); -// } -// -// @Test -// public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; -// String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation instanceOperation = compute.create(instanceInfo); -// AddressId addressId = RegionAddressId.of(REGION, addressName); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation addressOperation = compute.create(addressInfo); -// addressOperation.waitFor(); -// instanceOperation.waitFor(); -// Address remoteAddress = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// Instance remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); -// // test add access config -// NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() -// .setNatIp(remoteAddress.getAddress()) -// .setName("NAT") -// .build(); -// instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// List accessConfigurations = -// remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); -// assertEquals(1, accessConfigurations.size()); -// assertEquals("NAT", accessConfigurations.get(0).getName()); -// // test delete access config -// instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); -// } -// } +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.paging.Page; +import com.google.cloud.compute.deprecated.Address; +import com.google.cloud.compute.deprecated.AddressId; +import com.google.cloud.compute.deprecated.AddressInfo; +import com.google.cloud.compute.deprecated.AttachedDisk; +import com.google.cloud.compute.deprecated.Compute; +import com.google.cloud.compute.deprecated.DeprecationStatus; +import com.google.cloud.compute.deprecated.Disk; +import com.google.cloud.compute.deprecated.DiskConfiguration; +import com.google.cloud.compute.deprecated.DiskId; +import com.google.cloud.compute.deprecated.DiskImageConfiguration; +import com.google.cloud.compute.deprecated.DiskInfo; +import com.google.cloud.compute.deprecated.DiskType; +import com.google.cloud.compute.deprecated.DiskTypeId; +import com.google.cloud.compute.deprecated.GlobalAddressId; +import com.google.cloud.compute.deprecated.Image; +import com.google.cloud.compute.deprecated.ImageConfiguration; +import com.google.cloud.compute.deprecated.ImageDiskConfiguration; +import com.google.cloud.compute.deprecated.ImageId; +import com.google.cloud.compute.deprecated.ImageInfo; +import com.google.cloud.compute.deprecated.Instance; +import com.google.cloud.compute.deprecated.InstanceId; +import com.google.cloud.compute.deprecated.InstanceInfo; +import com.google.cloud.compute.deprecated.License; +import com.google.cloud.compute.deprecated.LicenseId; +import com.google.cloud.compute.deprecated.MachineType; +import com.google.cloud.compute.deprecated.MachineTypeId; +import com.google.cloud.compute.deprecated.Network; +import com.google.cloud.compute.deprecated.NetworkConfiguration; +import com.google.cloud.compute.deprecated.NetworkId; +import com.google.cloud.compute.deprecated.NetworkInfo; +import com.google.cloud.compute.deprecated.NetworkInterface; +import com.google.cloud.compute.deprecated.Operation; +import com.google.cloud.compute.deprecated.Region; +import com.google.cloud.compute.deprecated.RegionAddressId; +import com.google.cloud.compute.deprecated.RegionOperationId; +import com.google.cloud.compute.deprecated.SchedulingOptions; +import com.google.cloud.compute.deprecated.Snapshot; +import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; +import com.google.cloud.compute.deprecated.SnapshotId; +import com.google.cloud.compute.deprecated.SnapshotInfo; +import com.google.cloud.compute.deprecated.StandardDiskConfiguration; +import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; +import com.google.cloud.compute.deprecated.StorageImageConfiguration; +import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; +import com.google.cloud.compute.deprecated.Subnetwork; +import com.google.cloud.compute.deprecated.SubnetworkId; +import com.google.cloud.compute.deprecated.SubnetworkInfo; +import com.google.cloud.compute.deprecated.Zone; +import com.google.cloud.compute.deprecated.ZoneOperationId; +import com.google.cloud.compute.deprecated.testing.ResourceCleaner; +import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeoutException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; + +public class ITComputeTest { + + private static final String REGION = "us-central1"; + private static final String ZONE = "us-central1-a"; + private static final String DISK_TYPE = "local-ssd"; + private static final String MACHINE_TYPE = "f1-micro"; + private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); + private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); + private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); + private static final String IMAGE_PROJECT = "debian-cloud"; + + private static Compute compute; + private static ResourceCleaner resourceCleaner; + + + @Rule + public Timeout globalTimeout = Timeout.seconds(300); + + @BeforeClass + public static void beforeClass() { + RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); + compute = computeHelper.getOptions().getService(); + resourceCleaner = ResourceCleaner.create(compute); + } + + @AfterClass + public static void tearDown() { + resourceCleaner.cleanUp(); + } + + @Test + public void testGetDiskType() { + DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); + // assertNotNull(diskType.getGeneratedId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testGetDiskTypeWithSelectedFields() { + DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, + Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); + // assertNotNull(diskType.getGeneratedId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNull(diskType.getDescription()); + assertNull(diskType.getValidDiskSize()); + assertNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testListDiskTypes() { + Page diskPage = compute.listDiskTypes(ZONE); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithSelectedFields() { + Page diskPage = compute.listDiskTypes(ZONE, + Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + assertNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNull(diskType.getDescription()); + assertNull(diskType.getValidDiskSize()); + assertNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithFilter() { + Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( + Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // todo(mziccard): uncomment or remove once #695 is closed + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypes() { + Page diskPage = compute.listDiskTypes(); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypesWithFilter() { + Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( + Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // todo(mziccard): uncomment or remove once #695 is closed + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testGetMachineType() { + MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + + @Test + public void testGetMachineTypeWithSelectedFields() { + MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, + Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); + assertNotNull(machineType.getGeneratedId()); + assertNull(machineType.getCreationTimestamp()); + assertNull(machineType.getDescription()); + assertNull(machineType.getCpus()); + assertNull(machineType.getMemoryMb()); + assertNull(machineType.getMaximumPersistentDisks()); + assertNull(machineType.getMaximumPersistentDisksSizeGb()); + } + + @Test + public void testListMachineTypes() { + Page machinePage = compute.listMachineTypes(ZONE); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testListMachineTypesWithSelectedFields() { + Page machinePage = compute.listMachineTypes(ZONE, + Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNull(machineType.getDescription()); + assertNull(machineType.getCpus()); + assertNull(machineType.getMemoryMb()); + assertNull(machineType.getMaximumPersistentDisks()); + assertNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testListMachineTypesWithFilter() { + Page machinePage = compute.listMachineTypes(ZONE, + Compute.MachineTypeListOption.filter( + Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertEquals(2, (long) machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testAggregatedListMachineTypes() { + Page machinePage = compute.listMachineTypes(); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testAggregatedListMachineTypesWithFilter() { + Page machinePage = + compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( + Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotEquals(2, (long) machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testGetLicense() { + License license = compute.getLicense(LICENSE_ID); + assertEquals(LICENSE_ID, license.getLicenseId()); + assertNotNull(license.chargesUseFee()); + } + + @Test + public void testGetLicenseWithSelectedFields() { + License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); + assertEquals(LICENSE_ID, license.getLicenseId()); + assertNull(license.chargesUseFee()); + } + + @Test + public void testGetRegion() { + Region region = compute.getRegion(REGION); + assertEquals(REGION, region.getRegionId().getRegion()); + assertNotNull(region.getDescription()); + assertNotNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNotNull(region.getQuotas()); + assertNotNull(region.getStatus()); + assertNotNull(region.getZones()); + } + + @Test + public void testGetRegionWithSelectedFields() { + Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); + assertEquals(REGION, region.getRegionId().getRegion()); + assertNotNull(region.getGeneratedId()); + assertNull(region.getDescription()); + assertNull(region.getCreationTimestamp()); + assertNull(region.getQuotas()); + assertNull(region.getStatus()); + assertNull(region.getZones()); + } + + @Test + public void testListRegions() { + Page regionPage = compute.listRegions(); + Iterator regionIterator = regionPage.iterateAll().iterator(); + while (regionIterator.hasNext()) { + Region region = regionIterator.next(); + assertNotNull(region.getRegionId()); + assertNotNull(region.getDescription()); + assertNotNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNotNull(region.getQuotas()); + assertNotNull(region.getStatus()); + assertNotNull(region.getZones()); + } + } + + @Test + public void testListRegionsWithSelectedFields() { + Page regionPage = + compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); + Iterator regionIterator = regionPage.iterateAll().iterator(); + while (regionIterator.hasNext()) { + Region region = regionIterator.next(); + assertNotNull(region.getRegionId()); + assertNull(region.getDescription()); + assertNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNull(region.getQuotas()); + assertNull(region.getStatus()); + assertNull(region.getZones()); + } + } + + @Test + public void testListRegionsWithFilter() { + Page regionPage = compute.listRegions(Compute.RegionListOption.filter( + Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); + Iterator regionIterator = regionPage.iterateAll().iterator(); + assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); + assertFalse(regionIterator.hasNext()); + } + + @Test + public void testGetZone() { + Zone zone = compute.getZone(ZONE); + assertEquals(ZONE, zone.getZoneId().getZone()); + assertNotNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNotNull(zone.getDescription()); + assertNotNull(zone.getStatus()); + assertNotNull(zone.getRegion()); + } + + @Test + public void testGetZoneWithSelectedFields() { + Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); + assertEquals(ZONE, zone.getZoneId().getZone()); + assertNotNull(zone.getGeneratedId()); + assertNull(zone.getCreationTimestamp()); + assertNull(zone.getDescription()); + assertNull(zone.getStatus()); + assertNull(zone.getRegion()); + } + + @Test + public void testListZones() { + Page zonePage = compute.listZones(); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + while (zoneIterator.hasNext()) { + Zone zone = zoneIterator.next(); + assertNotNull(zone.getZoneId()); + assertNotNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNotNull(zone.getDescription()); + assertNotNull(zone.getStatus()); + assertNotNull(zone.getRegion()); + } + } + + @Test + public void testListZonesWithSelectedFields() { + Page zonePage = compute.listZones( + Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + while (zoneIterator.hasNext()) { + Zone zone = zoneIterator.next(); + assertNotNull(zone.getZoneId()); + assertNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNull(zone.getDescription()); + assertNull(zone.getStatus()); + assertNull(zone.getRegion()); + } + } + + @Test + public void testListZonesWithFilter() { + Page zonePage = compute.listZones( + Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); + assertFalse(zoneIterator.hasNext()); + } + + @Test + public void testListGlobalOperations() { + Page operationPage = compute.listGlobalOperations(); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListGlobalOperationsWithSelectedFields() { + Page operationPage = + compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListGlobalOperationsWithFilter() { + Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( + Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListRegionOperations() { + Page operationPage = compute.listRegionOperations(REGION); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListRegionOperationsWithSelectedFields() { + Page operationPage = compute.listRegionOperations(REGION, + Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListRegionOperationsWithFilter() { + Page operationPage = compute.listRegionOperations(REGION, + Compute.OperationListOption.filter(Compute.OperationFilter.equals( + Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListZoneOperations() { + Page operationPage = compute.listZoneOperations(ZONE); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListZoneOperationsWithSelectedFields() { + Page operationPage = compute.listZoneOperations(ZONE, + Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListZoneOperationsWithFilter() { + Page operationPage = compute.listZoneOperations(ZONE, + Compute.OperationListOption.filter(Compute.OperationFilter.equals( + Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; + AddressId addressId = RegionAddressId.of(REGION, name); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + // test get + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, remoteAddress.getAddressId().getRegion()); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNotNull(remoteAddress.getAddress()); + assertNotNull(remoteAddress.getCreationTimestamp()); + assertNotNull(remoteAddress.getGeneratedId()); + assertNotNull(remoteAddress.getStatus()); + // test get with selected fields + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, remoteAddress.getAddressId().getRegion()); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNull(remoteAddress.getAddress()); + assertNull(remoteAddress.getCreationTimestamp()); + assertNull(remoteAddress.getGeneratedId()); + operation = remoteAddress.delete(); + operation.waitFor(); + resourceCleaner.remove(addressId); + assertNull(compute.getAddress(addressId)); + } + + @Test + public void testListRegionAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-region-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); + AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + // test list + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(address.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, address.getAddressId().getRegion()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + // test list with selected fields + count = 0; + addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), + Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); + addressIterator = addressPage.iterateAll().iterator(); + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertTrue(address.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, address.getAddressId().getRegion()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); + AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; + AddressId addressId = GlobalAddressId.of(name); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + // test get + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNotNull(remoteAddress.getAddress()); + assertNotNull(remoteAddress.getCreationTimestamp()); + assertNotNull(remoteAddress.getGeneratedId()); + assertNotNull(remoteAddress.getStatus()); + // test get with selected fields + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNull(remoteAddress.getAddress()); + assertNull(remoteAddress.getCreationTimestamp()); + assertNull(remoteAddress.getGeneratedId()); + operation = remoteAddress.delete(); + operation.waitFor(); + resourceCleaner.remove(addressId); + assertNull(compute.getAddress(addressId)); + } + + @Test + public void testListGlobalAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-global-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); + AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + // test list + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(address.getAddressId() instanceof GlobalAddressId); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + // test list with selected fields + count = 0; + addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), + Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); + addressIterator = addressPage.iterateAll().iterator(); + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertTrue(address.getAddressId() instanceof GlobalAddressId); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetResizeAndDeleteStandardDisk() + throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; + DiskId diskId = DiskId.of(ZONE, name); + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + // test get + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.resize(200L); + operation.waitFor(); + // test resize and get with selected fields + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(200L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(diskId); + assertNull(compute.getDisk(diskId)); + } + + @Test + public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; + DiskId diskId = DiskId.of(ZONE, name); + DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + // test get + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); + ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); + assertNotNull(remoteConfiguration.getSourceImageId()); + assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); + assertNotNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + // test get with selected fields + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); + assertNull(remoteConfiguration.getSourceImageId()); + assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(diskId); + assertNull(compute.getDisk(diskId)); + } + + @Test + public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() + throws InterruptedException, TimeoutException { + String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; + String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; + DiskId diskId = DiskId.of(ZONE, diskName); + DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); + String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + operation = remoteDisk.createSnapshot(snapshotName); + operation.waitFor(); + // test get snapshot with selected fields + Snapshot snapshot = compute.getSnapshot(snapshotName, + Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); + resourceCleaner.add(snapshot.getSnapshotId()); + assertNull(snapshot.getGeneratedId()); + assertNotNull(snapshot.getSnapshotId()); + assertNotNull(snapshot.getCreationTimestamp()); + assertNull(snapshot.getDescription()); + assertNull(snapshot.getStatus()); + assertNull(snapshot.getDiskSizeGb()); + assertNull(snapshot.getLicenses()); + assertNull(snapshot.getSourceDisk()); + assertNull(snapshot.getSourceDiskId()); + assertNull(snapshot.getStorageBytes()); + assertNull(snapshot.getStorageBytesStatus()); + // test get snapshot + snapshot = compute.getSnapshot(snapshotName); + assertNotNull(snapshot.getGeneratedId()); + assertNotNull(snapshot.getSnapshotId()); + assertNotNull(snapshot.getCreationTimestamp()); + assertNotNull(snapshot.getStatus()); + assertEquals(100L, (long) snapshot.getDiskSizeGb()); + assertEquals(diskName, snapshot.getSourceDisk().getDisk()); + assertNotNull(snapshot.getSourceDiskId()); + assertNotNull(snapshot.getStorageBytes()); + assertNotNull(snapshot.getStorageBytesStatus()); + remoteDisk.delete(); + resourceCleaner.remove(diskId); + diskInfo = + DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); + operation = compute.create(diskInfo); + operation.waitFor(); + // test get disk + remoteDisk = compute.getDisk(snapshotDiskId); + resourceCleaner.add(snapshotDiskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); + SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); + assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNotNull(remoteConfiguration.getSourceSnapshotId()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + // test get disk with selected fields + remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationStatus()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); + assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(snapshotDiskId); + assertNull(compute.getDisk(snapshotDiskId)); + operation = snapshot.delete(); + operation.waitFor(); + resourceCleaner.remove(snapshot.getSnapshotId()); + assertNull(compute.getSnapshot(snapshotName)); + } + + @Test + public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; + String[] diskNames = {prefix + "1", prefix + "2"}; + DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); + DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); + DiskConfiguration configuration = + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); + Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); + Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); + firstOperation.waitFor(); + resourceCleaner.add(firstDiskId); + secondOperation.waitFor(); + resourceCleaner.add(secondDiskId); + Set diskSet = ImmutableSet.copyOf(diskNames); + // test list disks + Compute.DiskFilter diskFilter = + Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); + Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); + Iterator diskIterator = diskPage.iterateAll().iterator(); + int count = 0; + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + count++; + } + assertEquals(2, count); + // test list disks with selected fields + count = 0; + diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), + Compute.DiskListOption.fields(Compute.DiskField.STATUS)); + diskIterator = diskPage.iterateAll().iterator(); + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + count++; + } + assertEquals(2, count); + // test snapshots + SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); + SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); + firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); + secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); + firstOperation.waitFor(); + resourceCleaner.add(firstSnapshotId); + secondOperation.waitFor(); + resourceCleaner.add(secondSnapshotId); + // test list snapshots + Compute.SnapshotFilter snapshotFilter = + Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); + Page snapshotPage = + compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); + Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); + count = 0; + while (snapshotIterator.hasNext()) { + Snapshot remoteSnapshot = snapshotIterator.next(); + assertNotNull(remoteSnapshot.getGeneratedId()); + assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); + assertNotNull(remoteSnapshot.getCreationTimestamp()); + assertNotNull(remoteSnapshot.getStatus()); + assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); + assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); + assertNotNull(remoteSnapshot.getSourceDiskId()); + assertNotNull(remoteSnapshot.getStorageBytes()); + assertNotNull(remoteSnapshot.getStorageBytesStatus()); + count++; + } + assertEquals(2, count); + // test list snapshots with selected fields + snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), + Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); + snapshotIterator = snapshotPage.iterateAll().iterator(); + count = 0; + while (snapshotIterator.hasNext()) { + Snapshot remoteSnapshot = snapshotIterator.next(); + assertNull(remoteSnapshot.getGeneratedId()); + assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); + assertNotNull(remoteSnapshot.getCreationTimestamp()); + assertNull(remoteSnapshot.getStatus()); + assertNull(remoteSnapshot.getDiskSizeGb()); + assertNull(remoteSnapshot.getSourceDisk()); + assertNull(remoteSnapshot.getSourceDiskId()); + assertNull(remoteSnapshot.getStorageBytes()); + assertNull(remoteSnapshot.getStorageBytesStatus()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testAggregatedListDisks() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; + String[] diskZones = {"us-central1-a", "us-east1-c"}; + String[] diskNames = {prefix + "1", prefix + "2"}; + DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); + DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); + DiskConfiguration configuration = + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); + Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); + Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); + firstOperation.waitFor(); + resourceCleaner.add(firstDiskId); + secondOperation.waitFor(); + resourceCleaner.add(secondDiskId); + Set zoneSet = ImmutableSet.copyOf(diskZones); + Set diskSet = ImmutableSet.copyOf(diskNames); + Compute.DiskFilter diskFilter = + Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); + Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); + Iterator diskIterator = diskPage.iterateAll().iterator(); + int count = 0; + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { + String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; + String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; + DiskId diskId = DiskId.of(ZONE, diskName); + ImageId imageId = ImageId.of(imageName); + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); +operation.waitFor(); + Disk remoteDisk = compute.getDisk(diskId); + ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); + operation = compute.create(imageInfo); +operation.waitFor(); + resourceCleaner.add(diskId); + // test get image with selected fields + Image image = compute.getImage(imageId, + Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); + resourceCleaner.add(imageId); + assertNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNull(image.getDescription()); + assertNotNull(image.getConfiguration()); + assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); + DiskImageConfiguration remoteConfiguration = image.getConfiguration(); + assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); + assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + // test get image + image = compute.getImage(imageId); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); + remoteConfiguration = image.getConfiguration(); + assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); + assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); + assertEquals(100L, (long) image.getDiskSizeGb()); + assertNotNull(image.getStatus()); + assertNull(image.getDeprecationStatus()); + // test deprecate image + DeprecationStatus deprecationStatus = + DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) + .setDeprecated(System.currentTimeMillis()) + .build(); + operation = image.deprecate(deprecationStatus); + operation.waitFor(); + image = compute.getImage(imageId); + assertEquals(deprecationStatus, image.getDeprecationStatus()); + remoteDisk.delete(); + resourceCleaner.remove(diskId); + operation = image.delete(); + operation.waitFor(); + resourceCleaner.remove(imageId); + assertNull(compute.getImage(imageId)); + } + + @Test + public void testListImages() { + Page imagePage = compute.listImages(IMAGE_PROJECT); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNotNull(image.getStatus()); + assertNotNull(image.getDiskSizeGb()); + } + assertTrue(count > 0); + } + + @Test + public void testListImagesWithSelectedFields() { + Page imagePage = + compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + } + assertTrue(count > 0); + } + + @Test + public void testListImagesWithFilter() { + Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( + Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNotNull(image.getStatus()); + assertNotNull(image.getDiskSizeGb()); + assertEquals(365056004L, + (long) image.getConfiguration().getArchiveSizeBytes()); + } + assertTrue(count > 0); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-network"; + NetworkId networkId = NetworkId.of(name); + NetworkInfo networkInfo = + NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(networkInfo); +operation.waitFor(); + // test get network with selected fields + Network network = compute.getNetwork(networkId.getNetwork(), + Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); + resourceCleaner.add(networkId); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertNull(network.getDescription()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + // test get network + network = compute.getNetwork(networkId.getNetwork()); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + operation = network.delete(); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getNetwork(name)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testListNetworks() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "list-network"; + NetworkId networkId = NetworkId.of(name); + NetworkInfo networkInfo = + NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + resourceCleaner.add(networkId); + // test list + Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); + Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); + Iterator networkIterator = networkPage.iterateAll().iterator(); + int count = 0; + while (networkIterator.hasNext()) { + Network network = networkIterator.next(); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + count++; + } + assertEquals(1, count); + // test list with selected fields + count = 0; + networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), + Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); + networkIterator = networkPage.iterateAll().iterator(); + while (networkIterator.hasNext()) { + Network network = networkIterator.next(); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertNull(network.getDescription()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + count++; + } + assertEquals(1, count); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getNetwork(name)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { + String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; + NetworkId networkId = NetworkId.of(networkName); + NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + // test get network + Network network = compute.getNetwork(networkId.getNetwork()); + resourceCleaner.add(networkId); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); + assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); + assertFalse(network.getConfiguration().autoCreateSubnetworks()); + String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; + SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); + operation = compute.create(subnetworkInfo); + operation.waitFor(); + // test get subnetwork with selected fields + Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, + Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); + resourceCleaner.add(subnetworkId); + assertNull(subnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(subnetwork.getCreationTimestamp()); + assertNull(subnetwork.getDescription()); + assertNull(subnetwork.getGatewayAddress()); + assertNull(subnetwork.getNetwork()); + assertNull(subnetwork.getIpRange()); + // test get subnetwork + subnetwork = compute.getSubnetwork(subnetworkId); + assertNotNull(subnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(subnetwork.getCreationTimestamp()); + assertNotNull(subnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); + assertEquals("192.168.0.0/16", subnetwork.getIpRange()); + // test list subnetworks + Compute.SubnetworkFilter filter = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); + Page subnetworkPage = + compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); + Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); + int count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNotNull(remoteSubnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), + remoteSubnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNotNull(remoteSubnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); + assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); + count++; + } + assertEquals(1, count); + // test list subnetworks with selected fields + subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), + Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); + subnetworkIterator = subnetworkPage.iterateAll().iterator(); + count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNull(remoteSubnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), + remoteSubnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNull(remoteSubnetwork.getDescription()); + assertNull(remoteSubnetwork.getGatewayAddress()); + assertNull(remoteSubnetwork.getNetwork()); + assertNull(remoteSubnetwork.getIpRange()); + count++; + } + assertEquals(1, count); + operation = subnetwork.delete(); + operation.waitFor(); + resourceCleaner.remove(subnetworkId); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getSubnetwork(subnetworkId)); + assertNull(compute.getNetwork(networkName)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { + String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; + NetworkId networkId = NetworkId.of(networkName); + NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + resourceCleaner.add(networkId); + String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; + String[] regionNames = {"us-central1", "us-east1"}; + String[] subnetworkNames = {prefix + "1", prefix + "2"}; + String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; + SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); + SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); + SubnetworkInfo firstSubnetworkInfo = + SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); + SubnetworkInfo secondSubnetworkInfo = + SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); + Operation firstOperation = compute.create(firstSubnetworkInfo); + Operation secondOperation = compute.create(secondSubnetworkInfo); + firstOperation.waitFor(); + resourceCleaner.add(firstSubnetworkId); + secondOperation.waitFor(); + resourceCleaner.add(secondSubnetworkId); + Set regionSet = ImmutableSet.copyOf(regionNames); + Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); + Set rangeSet = ImmutableSet.copyOf(ipRanges); + Compute.SubnetworkFilter subnetworkFilter = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); + Page subnetworkPage = + compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); + Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); + int count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNotNull(remoteSubnetwork.getGeneratedId()); + assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); + assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNotNull(remoteSubnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); + assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); + count++; + } + assertEquals(2, count); + firstOperation = compute.deleteSubnetwork(firstSubnetworkId); + secondOperation = compute.deleteSubnetwork(secondSubnetworkId); + firstOperation.waitFor(); + resourceCleaner.remove(firstSubnetworkId); + secondOperation.waitFor(); + resourceCleaner.remove(secondSubnetworkId); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getSubnetwork(firstSubnetworkId)); + assertNull(compute.getSubnetwork(secondSubnetworkId)); + assertNull(compute.getNetwork(networkName)); + } + + @Test + public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; + String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; + // Create an address to assign to the instance + AddressId addressId = RegionAddressId.of(REGION, addressName); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + Address address = compute.getAddress(addressId); + resourceCleaner.add(addressId); + // Create an instance + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) + .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() + .setName("NAT") + .setNatIp(address.getAddress()).build()) + .build(); + AttachedDisk disk1 = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + AttachedDisk disk2 = + AttachedDisk.of("dev1", + AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) + .setAttachedDisks(disk1, disk2) + .setNetworkInterfaces(networkInterface) + .build(); + operation = compute.create(instanceInfo); + operation.waitFor(); + // test get + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); + assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); + assertEquals(ZONE, remoteInstance.getMachineType().getZone()); + assertNotNull(remoteInstance.getCreationTimestamp()); + Set deviceSet = ImmutableSet.of("dev0", "dev1"); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + } + assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, + remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); + AttachedDisk.PersistentDiskConfiguration remoteConfiguration = + remoteInstance.getAttachedDisks().get(0).getConfiguration(); + assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); + assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); + assertTrue(remoteConfiguration.boot()); + assertTrue(remoteConfiguration.autoDelete()); + assertEquals(1, remoteInstance.getNetworkInterfaces().size()); + NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); + assertNotNull(remoteNetworkInterface.getName()); + assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); + List remoteAccessConfigurations = + remoteNetworkInterface.getAccessConfigurations(); + assertNotNull(remoteAccessConfigurations); + assertEquals(1, remoteAccessConfigurations.size()); + NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); + assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); + assertEquals("NAT", remoteAccessConfig.getName()); + assertNotNull(remoteInstance.getMetadata()); + assertNotNull(remoteInstance.getTags()); + // test get with selected fields + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); + assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); + assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); + assertNull(remoteInstance.getMachineType()); + assertNotNull(remoteInstance.getCreationTimestamp()); + assertNull(remoteInstance.getAttachedDisks()); + assertNull(remoteInstance.getNetworkInterfaces()); + assertNull(remoteInstance.getMetadata()); + assertNull(remoteInstance.getTags()); + // test get default serial port output + String serialPortOutput = remoteInstance.getSerialPortOutput(); + assertNotNull(serialPortOutput); + // test get serial port output by number + String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); + assertTrue(newSerialPortOutput.contains(serialPortOutput)); + operation = remoteInstance.delete(); + operation.waitFor(); + resourceCleaner.remove(instanceId); + assertNull(compute.getInstance(instanceId)); + } + + @Test + public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation operation = compute.create(instanceInfo); + operation.waitFor(); + Instance remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + resourceCleaner.add(instanceId); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + operation = remoteInstance.stop(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); + operation = remoteInstance.start(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + operation = remoteInstance.reset(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + } + + @Test + public void testSetInstanceProperties() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation operation = compute.create(instanceInfo); + operation.waitFor(); + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + // test set tags + List tags = ImmutableList.of("tag1", "tag2"); + operation = remoteInstance.setTags(tags); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(tags, remoteInstance.getTags().getValues()); + // test set metadata + Map metadata = ImmutableMap.of("key", "value"); + operation = remoteInstance.setMetadata(metadata); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(metadata, remoteInstance.getMetadata().getValues()); + // test set machine type + operation = remoteInstance.stop(); + operation.waitFor(); + operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); + assertEquals(ZONE, remoteInstance.getMachineType().getZone()); + // test set scheduling options + SchedulingOptions options = + SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); + operation = remoteInstance.setSchedulingOptions(options); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(options, remoteInstance.getSchedulingOptions()); + } + + @Test + public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; + String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation instanceOperation = compute.create(instanceInfo); + DiskId diskId = DiskId.of(ZONE, diskName); + Operation diskOperation = compute.create(DiskInfo.of(diskId, + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); + instanceOperation.waitFor(); + diskOperation.waitFor(); + resourceCleaner.add(diskId); + Instance remoteInstance = compute.getInstance(instanceId); + // test attach disk + instanceOperation = remoteInstance.attachDisk("dev1", + AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + Set deviceSet = ImmutableSet.of("dev0", "dev1"); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + } + // test set disk auto-delete + instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); + } + // test detach disk + instanceOperation = remoteInstance.detachDisk("dev1"); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(1, remoteInstance.getAttachedDisks().size()); + assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); + } + + @Test + public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; + String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation instanceOperation = compute.create(instanceInfo); + AddressId addressId = RegionAddressId.of(REGION, addressName); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation addressOperation = compute.create(addressInfo); + addressOperation.waitFor(); + instanceOperation.waitFor(); + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); + // test add access config + NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() + .setNatIp(remoteAddress.getAddress()) + .setName("NAT") + .build(); + instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + List accessConfigurations = + remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); + assertEquals(1, accessConfigurations.size()); + assertEquals("NAT", accessConfigurations.get(0).getName()); + // test delete access config + instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); + } +} From 42f1e0c11ec30e4be77e2a61f9442744b63db432 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 28 Mar 2018 15:57:34 -0700 Subject: [PATCH 04/42] update license year --- .../test/java/com/google/cloud/compute/v1/it/ITComputeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java index e85ca9d0db5c..884e0bb44c59 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Google LLC + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From bad6b7170c2aaab922dbdb2ef93791ad347c7712 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 29 Mar 2018 10:10:32 -0700 Subject: [PATCH 05/42] add setCredentialsProvider in each clientsettings object in unit tests --- .../compute/deprecated/it/ITComputeTest.java | 3684 ++++++++--------- .../cloud/compute/v1/AddressClientTest.java | 5 +- .../compute/v1/AutoscalerClientTest.java | 5 +- .../compute/v1/BackendServiceClientTest.java | 5 +- .../cloud/compute/v1/DiskClientTest.java | 5 +- .../cloud/compute/v1/DiskTypeClientTest.java | 5 +- .../cloud/compute/v1/FirewallClientTest.java | 5 +- .../compute/v1/ForwardingRuleClientTest.java | 5 +- .../compute/v1/GlobalAddressClientTest.java | 5 +- .../v1/GlobalForwardingRuleClientTest.java | 5 +- .../compute/v1/GlobalOperationClientTest.java | 5 +- .../compute/v1/HealthCheckClientTest.java | 5 +- .../compute/v1/HttpHealthCheckClientTest.java | 5 +- .../v1/HttpsHealthCheckClientTest.java | 5 +- .../cloud/compute/v1/ImageClientTest.java | 5 +- .../cloud/compute/v1/InstanceClientTest.java | 5 +- .../compute/v1/InstanceGroupClientTest.java | 5 +- .../v1/InstanceGroupManagerClientTest.java | 5 +- .../v1/InstanceTemplateClientTest.java | 5 +- .../cloud/compute/v1/LicensClientTest.java | 5 +- .../compute/v1/MachineTypeClientTest.java | 5 +- .../cloud/compute/v1/NetworkClientTest.java | 5 +- .../cloud/compute/v1/ProjectClientTest.java | 5 +- .../v1/RegionAutoscalerClientTest.java | 5 +- .../v1/RegionBackendServiceClientTest.java | 5 +- .../cloud/compute/v1/RegionClientTest.java | 5 +- .../v1/RegionInstanceGroupClientTest.java | 5 +- .../RegionInstanceGroupManagerClientTest.java | 5 +- .../compute/v1/RegionOperationClientTest.java | 5 +- .../cloud/compute/v1/RouteClientTest.java | 5 +- .../cloud/compute/v1/RouterClientTest.java | 5 +- .../cloud/compute/v1/SnapshotClientTest.java | 5 +- .../compute/v1/SslCertificateClientTest.java | 5 +- .../compute/v1/SubnetworkClientTest.java | 5 +- .../compute/v1/TargetHttpProxyClientTest.java | 5 +- .../v1/TargetHttpsProxyClientTest.java | 5 +- .../compute/v1/TargetInstanceClientTest.java | 5 +- .../compute/v1/TargetPoolClientTest.java | 5 +- .../compute/v1/TargetSslProxyClientTest.java | 5 +- .../v1/TargetVpnGatewayClientTest.java | 5 +- .../cloud/compute/v1/UrlMapClientTest.java | 5 +- .../cloud/compute/v1/VpnTunnelClientTest.java | 5 +- .../cloud/compute/v1/ZoneClientTest.java | 5 +- .../compute/v1/ZoneOperationClientTest.java | 5 +- 44 files changed, 2014 insertions(+), 1885 deletions(-) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java index 943d915ced9c..18116a7a4a8f 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java @@ -1,1842 +1,1842 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.paging.Page; -import com.google.cloud.compute.deprecated.Address; -import com.google.cloud.compute.deprecated.AddressId; -import com.google.cloud.compute.deprecated.AddressInfo; -import com.google.cloud.compute.deprecated.AttachedDisk; -import com.google.cloud.compute.deprecated.Compute; -import com.google.cloud.compute.deprecated.DeprecationStatus; -import com.google.cloud.compute.deprecated.Disk; -import com.google.cloud.compute.deprecated.DiskConfiguration; -import com.google.cloud.compute.deprecated.DiskId; -import com.google.cloud.compute.deprecated.DiskImageConfiguration; -import com.google.cloud.compute.deprecated.DiskInfo; -import com.google.cloud.compute.deprecated.DiskType; -import com.google.cloud.compute.deprecated.DiskTypeId; -import com.google.cloud.compute.deprecated.GlobalAddressId; -import com.google.cloud.compute.deprecated.Image; -import com.google.cloud.compute.deprecated.ImageConfiguration; -import com.google.cloud.compute.deprecated.ImageDiskConfiguration; -import com.google.cloud.compute.deprecated.ImageId; -import com.google.cloud.compute.deprecated.ImageInfo; -import com.google.cloud.compute.deprecated.Instance; -import com.google.cloud.compute.deprecated.InstanceId; -import com.google.cloud.compute.deprecated.InstanceInfo; -import com.google.cloud.compute.deprecated.License; -import com.google.cloud.compute.deprecated.LicenseId; -import com.google.cloud.compute.deprecated.MachineType; -import com.google.cloud.compute.deprecated.MachineTypeId; -import com.google.cloud.compute.deprecated.Network; -import com.google.cloud.compute.deprecated.NetworkConfiguration; -import com.google.cloud.compute.deprecated.NetworkId; -import com.google.cloud.compute.deprecated.NetworkInfo; -import com.google.cloud.compute.deprecated.NetworkInterface; -import com.google.cloud.compute.deprecated.Operation; -import com.google.cloud.compute.deprecated.Region; -import com.google.cloud.compute.deprecated.RegionAddressId; -import com.google.cloud.compute.deprecated.RegionOperationId; -import com.google.cloud.compute.deprecated.SchedulingOptions; -import com.google.cloud.compute.deprecated.Snapshot; -import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; -import com.google.cloud.compute.deprecated.SnapshotId; -import com.google.cloud.compute.deprecated.SnapshotInfo; -import com.google.cloud.compute.deprecated.StandardDiskConfiguration; -import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; -import com.google.cloud.compute.deprecated.StorageImageConfiguration; -import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; -import com.google.cloud.compute.deprecated.Subnetwork; -import com.google.cloud.compute.deprecated.SubnetworkId; -import com.google.cloud.compute.deprecated.SubnetworkInfo; -import com.google.cloud.compute.deprecated.Zone; -import com.google.cloud.compute.deprecated.ZoneOperationId; -import com.google.cloud.compute.deprecated.testing.ResourceCleaner; -import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeoutException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; - -public class ITComputeTest { - - private static final String REGION = "us-central1"; - private static final String ZONE = "us-central1-a"; - private static final String DISK_TYPE = "local-ssd"; - private static final String MACHINE_TYPE = "f1-micro"; - private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); - private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); - private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); - private static final String IMAGE_PROJECT = "debian-cloud"; - - private static Compute compute; - private static ResourceCleaner resourceCleaner; - - - @Rule - public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() { - RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); - compute = computeHelper.getOptions().getService(); - resourceCleaner = ResourceCleaner.create(compute); - } - - @AfterClass - public static void tearDown() { - resourceCleaner.cleanUp(); - } - - @Test - public void testGetDiskType() { - DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); - // assertNotNull(diskType.getGeneratedId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testGetDiskTypeWithSelectedFields() { - DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, - Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - // assertNotNull(diskType.getGeneratedId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNull(diskType.getDescription()); - assertNull(diskType.getValidDiskSize()); - assertNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testListDiskTypes() { - Page diskPage = compute.listDiskTypes(ZONE); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithSelectedFields() { - Page diskPage = compute.listDiskTypes(ZONE, - Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - assertNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNull(diskType.getDescription()); - assertNull(diskType.getValidDiskSize()); - assertNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithFilter() { - Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( - Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypes() { - Page diskPage = compute.listDiskTypes(); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypesWithFilter() { - Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( - Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testGetMachineType() { - MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - - @Test - public void testGetMachineTypeWithSelectedFields() { - MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, - Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); - assertNotNull(machineType.getGeneratedId()); - assertNull(machineType.getCreationTimestamp()); - assertNull(machineType.getDescription()); - assertNull(machineType.getCpus()); - assertNull(machineType.getMemoryMb()); - assertNull(machineType.getMaximumPersistentDisks()); - assertNull(machineType.getMaximumPersistentDisksSizeGb()); - } - - @Test - public void testListMachineTypes() { - Page machinePage = compute.listMachineTypes(ZONE); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testListMachineTypesWithSelectedFields() { - Page machinePage = compute.listMachineTypes(ZONE, - Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNull(machineType.getDescription()); - assertNull(machineType.getCpus()); - assertNull(machineType.getMemoryMb()); - assertNull(machineType.getMaximumPersistentDisks()); - assertNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testListMachineTypesWithFilter() { - Page machinePage = compute.listMachineTypes(ZONE, - Compute.MachineTypeListOption.filter( - Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertEquals(2, (long) machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testAggregatedListMachineTypes() { - Page machinePage = compute.listMachineTypes(); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testAggregatedListMachineTypesWithFilter() { - Page machinePage = - compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( - Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotEquals(2, (long) machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testGetLicense() { - License license = compute.getLicense(LICENSE_ID); - assertEquals(LICENSE_ID, license.getLicenseId()); - assertNotNull(license.chargesUseFee()); - } - - @Test - public void testGetLicenseWithSelectedFields() { - License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); - assertEquals(LICENSE_ID, license.getLicenseId()); - assertNull(license.chargesUseFee()); - } - - @Test - public void testGetRegion() { - Region region = compute.getRegion(REGION); - assertEquals(REGION, region.getRegionId().getRegion()); - assertNotNull(region.getDescription()); - assertNotNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNotNull(region.getQuotas()); - assertNotNull(region.getStatus()); - assertNotNull(region.getZones()); - } - - @Test - public void testGetRegionWithSelectedFields() { - Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); - assertEquals(REGION, region.getRegionId().getRegion()); - assertNotNull(region.getGeneratedId()); - assertNull(region.getDescription()); - assertNull(region.getCreationTimestamp()); - assertNull(region.getQuotas()); - assertNull(region.getStatus()); - assertNull(region.getZones()); - } - - @Test - public void testListRegions() { - Page regionPage = compute.listRegions(); - Iterator regionIterator = regionPage.iterateAll().iterator(); - while (regionIterator.hasNext()) { - Region region = regionIterator.next(); - assertNotNull(region.getRegionId()); - assertNotNull(region.getDescription()); - assertNotNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNotNull(region.getQuotas()); - assertNotNull(region.getStatus()); - assertNotNull(region.getZones()); - } - } - - @Test - public void testListRegionsWithSelectedFields() { - Page regionPage = - compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); - Iterator regionIterator = regionPage.iterateAll().iterator(); - while (regionIterator.hasNext()) { - Region region = regionIterator.next(); - assertNotNull(region.getRegionId()); - assertNull(region.getDescription()); - assertNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNull(region.getQuotas()); - assertNull(region.getStatus()); - assertNull(region.getZones()); - } - } - - @Test - public void testListRegionsWithFilter() { - Page regionPage = compute.listRegions(Compute.RegionListOption.filter( - Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); - Iterator regionIterator = regionPage.iterateAll().iterator(); - assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); - assertFalse(regionIterator.hasNext()); - } - - @Test - public void testGetZone() { - Zone zone = compute.getZone(ZONE); - assertEquals(ZONE, zone.getZoneId().getZone()); - assertNotNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNotNull(zone.getDescription()); - assertNotNull(zone.getStatus()); - assertNotNull(zone.getRegion()); - } - - @Test - public void testGetZoneWithSelectedFields() { - Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); - assertEquals(ZONE, zone.getZoneId().getZone()); - assertNotNull(zone.getGeneratedId()); - assertNull(zone.getCreationTimestamp()); - assertNull(zone.getDescription()); - assertNull(zone.getStatus()); - assertNull(zone.getRegion()); - } - - @Test - public void testListZones() { - Page zonePage = compute.listZones(); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - while (zoneIterator.hasNext()) { - Zone zone = zoneIterator.next(); - assertNotNull(zone.getZoneId()); - assertNotNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNotNull(zone.getDescription()); - assertNotNull(zone.getStatus()); - assertNotNull(zone.getRegion()); - } - } - - @Test - public void testListZonesWithSelectedFields() { - Page zonePage = compute.listZones( - Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - while (zoneIterator.hasNext()) { - Zone zone = zoneIterator.next(); - assertNotNull(zone.getZoneId()); - assertNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNull(zone.getDescription()); - assertNull(zone.getStatus()); - assertNull(zone.getRegion()); - } - } - - @Test - public void testListZonesWithFilter() { - Page zonePage = compute.listZones( - Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); - assertFalse(zoneIterator.hasNext()); - } - - @Test - public void testListGlobalOperations() { - Page operationPage = compute.listGlobalOperations(); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListGlobalOperationsWithSelectedFields() { - Page operationPage = - compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListGlobalOperationsWithFilter() { - Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( - Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListRegionOperations() { - Page operationPage = compute.listRegionOperations(REGION); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListRegionOperationsWithSelectedFields() { - Page operationPage = compute.listRegionOperations(REGION, - Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListRegionOperationsWithFilter() { - Page operationPage = compute.listRegionOperations(REGION, - Compute.OperationListOption.filter(Compute.OperationFilter.equals( - Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListZoneOperations() { - Page operationPage = compute.listZoneOperations(ZONE); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListZoneOperationsWithSelectedFields() { - Page operationPage = compute.listZoneOperations(ZONE, - Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListZoneOperationsWithFilter() { - Page operationPage = compute.listZoneOperations(ZONE, - Compute.OperationListOption.filter(Compute.OperationFilter.equals( - Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; - AddressId addressId = RegionAddressId.of(REGION, name); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - // test get - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, remoteAddress.getAddressId().getRegion()); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNotNull(remoteAddress.getAddress()); - assertNotNull(remoteAddress.getCreationTimestamp()); - assertNotNull(remoteAddress.getGeneratedId()); - assertNotNull(remoteAddress.getStatus()); - // test get with selected fields - remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, remoteAddress.getAddressId().getRegion()); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNull(remoteAddress.getAddress()); - assertNull(remoteAddress.getCreationTimestamp()); - assertNull(remoteAddress.getGeneratedId()); - operation = remoteAddress.delete(); - operation.waitFor(); - resourceCleaner.remove(addressId); - assertNull(compute.getAddress(addressId)); - } - - @Test - public void testListRegionAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-region-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); - AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - // test list - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(address.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, address.getAddressId().getRegion()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - // test list with selected fields - count = 0; - addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), - Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); - addressIterator = addressPage.iterateAll().iterator(); - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertTrue(address.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, address.getAddressId().getRegion()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); - AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; - AddressId addressId = GlobalAddressId.of(name); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - // test get - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNotNull(remoteAddress.getAddress()); - assertNotNull(remoteAddress.getCreationTimestamp()); - assertNotNull(remoteAddress.getGeneratedId()); - assertNotNull(remoteAddress.getStatus()); - // test get with selected fields - remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNull(remoteAddress.getAddress()); - assertNull(remoteAddress.getCreationTimestamp()); - assertNull(remoteAddress.getGeneratedId()); - operation = remoteAddress.delete(); - operation.waitFor(); - resourceCleaner.remove(addressId); - assertNull(compute.getAddress(addressId)); - } - - @Test - public void testListGlobalAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-global-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); - AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - // test list - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(address.getAddressId() instanceof GlobalAddressId); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - // test list with selected fields - count = 0; - addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), - Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); - addressIterator = addressPage.iterateAll().iterator(); - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertTrue(address.getAddressId() instanceof GlobalAddressId); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetResizeAndDeleteStandardDisk() - throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; - DiskId diskId = DiskId.of(ZONE, name); - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - // test get - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.resize(200L); - operation.waitFor(); - // test resize and get with selected fields - remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(200L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(diskId); - assertNull(compute.getDisk(diskId)); - } - - @Test - public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; - DiskId diskId = DiskId.of(ZONE, name); - DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - // test get - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); - ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); - assertNotNull(remoteConfiguration.getSourceImageId()); - assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); - assertNotNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - // test get with selected fields - remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); - assertNull(remoteConfiguration.getSourceImageId()); - assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(diskId); - assertNull(compute.getDisk(diskId)); - } - - @Test - public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() - throws InterruptedException, TimeoutException { - String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; - String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; - DiskId diskId = DiskId.of(ZONE, diskName); - DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); - String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - operation = remoteDisk.createSnapshot(snapshotName); - operation.waitFor(); - // test get snapshot with selected fields - Snapshot snapshot = compute.getSnapshot(snapshotName, - Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - resourceCleaner.add(snapshot.getSnapshotId()); - assertNull(snapshot.getGeneratedId()); - assertNotNull(snapshot.getSnapshotId()); - assertNotNull(snapshot.getCreationTimestamp()); - assertNull(snapshot.getDescription()); - assertNull(snapshot.getStatus()); - assertNull(snapshot.getDiskSizeGb()); - assertNull(snapshot.getLicenses()); - assertNull(snapshot.getSourceDisk()); - assertNull(snapshot.getSourceDiskId()); - assertNull(snapshot.getStorageBytes()); - assertNull(snapshot.getStorageBytesStatus()); - // test get snapshot - snapshot = compute.getSnapshot(snapshotName); - assertNotNull(snapshot.getGeneratedId()); - assertNotNull(snapshot.getSnapshotId()); - assertNotNull(snapshot.getCreationTimestamp()); - assertNotNull(snapshot.getStatus()); - assertEquals(100L, (long) snapshot.getDiskSizeGb()); - assertEquals(diskName, snapshot.getSourceDisk().getDisk()); - assertNotNull(snapshot.getSourceDiskId()); - assertNotNull(snapshot.getStorageBytes()); - assertNotNull(snapshot.getStorageBytesStatus()); - remoteDisk.delete(); - resourceCleaner.remove(diskId); - diskInfo = - DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); - operation = compute.create(diskInfo); - operation.waitFor(); - // test get disk - remoteDisk = compute.getDisk(snapshotDiskId); - resourceCleaner.add(snapshotDiskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); - SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); - assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNotNull(remoteConfiguration.getSourceSnapshotId()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - // test get disk with selected fields - remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationStatus()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); - assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(snapshotDiskId); - assertNull(compute.getDisk(snapshotDiskId)); - operation = snapshot.delete(); - operation.waitFor(); - resourceCleaner.remove(snapshot.getSnapshotId()); - assertNull(compute.getSnapshot(snapshotName)); - } - - @Test - public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; - String[] diskNames = {prefix + "1", prefix + "2"}; - DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); - DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); - DiskConfiguration configuration = - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); - Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); - Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); - firstOperation.waitFor(); - resourceCleaner.add(firstDiskId); - secondOperation.waitFor(); - resourceCleaner.add(secondDiskId); - Set diskSet = ImmutableSet.copyOf(diskNames); - // test list disks - Compute.DiskFilter diskFilter = - Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); - Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); - Iterator diskIterator = diskPage.iterateAll().iterator(); - int count = 0; - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - count++; - } - assertEquals(2, count); - // test list disks with selected fields - count = 0; - diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), - Compute.DiskListOption.fields(Compute.DiskField.STATUS)); - diskIterator = diskPage.iterateAll().iterator(); - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - count++; - } - assertEquals(2, count); - // test snapshots - SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); - SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); - firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); - secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); - firstOperation.waitFor(); - resourceCleaner.add(firstSnapshotId); - secondOperation.waitFor(); - resourceCleaner.add(secondSnapshotId); - // test list snapshots - Compute.SnapshotFilter snapshotFilter = - Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); - Page snapshotPage = - compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); - Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); - count = 0; - while (snapshotIterator.hasNext()) { - Snapshot remoteSnapshot = snapshotIterator.next(); - assertNotNull(remoteSnapshot.getGeneratedId()); - assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); - assertNotNull(remoteSnapshot.getCreationTimestamp()); - assertNotNull(remoteSnapshot.getStatus()); - assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); - assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); - assertNotNull(remoteSnapshot.getSourceDiskId()); - assertNotNull(remoteSnapshot.getStorageBytes()); - assertNotNull(remoteSnapshot.getStorageBytesStatus()); - count++; - } - assertEquals(2, count); - // test list snapshots with selected fields - snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), - Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - snapshotIterator = snapshotPage.iterateAll().iterator(); - count = 0; - while (snapshotIterator.hasNext()) { - Snapshot remoteSnapshot = snapshotIterator.next(); - assertNull(remoteSnapshot.getGeneratedId()); - assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); - assertNotNull(remoteSnapshot.getCreationTimestamp()); - assertNull(remoteSnapshot.getStatus()); - assertNull(remoteSnapshot.getDiskSizeGb()); - assertNull(remoteSnapshot.getSourceDisk()); - assertNull(remoteSnapshot.getSourceDiskId()); - assertNull(remoteSnapshot.getStorageBytes()); - assertNull(remoteSnapshot.getStorageBytesStatus()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testAggregatedListDisks() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; - String[] diskZones = {"us-central1-a", "us-east1-c"}; - String[] diskNames = {prefix + "1", prefix + "2"}; - DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); - DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); - DiskConfiguration configuration = - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); - Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); - Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); - firstOperation.waitFor(); - resourceCleaner.add(firstDiskId); - secondOperation.waitFor(); - resourceCleaner.add(secondDiskId); - Set zoneSet = ImmutableSet.copyOf(diskZones); - Set diskSet = ImmutableSet.copyOf(diskNames); - Compute.DiskFilter diskFilter = - Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); - Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); - Iterator diskIterator = diskPage.iterateAll().iterator(); - int count = 0; - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { - String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; - String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; - DiskId diskId = DiskId.of(ZONE, diskName); - ImageId imageId = ImageId.of(imageName); - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); -operation.waitFor(); - Disk remoteDisk = compute.getDisk(diskId); - ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); - operation = compute.create(imageInfo); -operation.waitFor(); - resourceCleaner.add(diskId); - // test get image with selected fields - Image image = compute.getImage(imageId, - Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); - resourceCleaner.add(imageId); - assertNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNull(image.getDescription()); - assertNotNull(image.getConfiguration()); - assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); - DiskImageConfiguration remoteConfiguration = image.getConfiguration(); - assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); - assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - // test get image - image = compute.getImage(imageId); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); - remoteConfiguration = image.getConfiguration(); - assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); - assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); - assertEquals(100L, (long) image.getDiskSizeGb()); - assertNotNull(image.getStatus()); - assertNull(image.getDeprecationStatus()); - // test deprecate image - DeprecationStatus deprecationStatus = - DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) - .setDeprecated(System.currentTimeMillis()) - .build(); - operation = image.deprecate(deprecationStatus); - operation.waitFor(); - image = compute.getImage(imageId); - assertEquals(deprecationStatus, image.getDeprecationStatus()); - remoteDisk.delete(); - resourceCleaner.remove(diskId); - operation = image.delete(); - operation.waitFor(); - resourceCleaner.remove(imageId); - assertNull(compute.getImage(imageId)); - } - - @Test - public void testListImages() { - Page imagePage = compute.listImages(IMAGE_PROJECT); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNotNull(image.getStatus()); - assertNotNull(image.getDiskSizeGb()); - } - assertTrue(count > 0); - } - - @Test - public void testListImagesWithSelectedFields() { - Page imagePage = - compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - } - assertTrue(count > 0); - } - - @Test - public void testListImagesWithFilter() { - Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( - Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNotNull(image.getStatus()); - assertNotNull(image.getDiskSizeGb()); - assertEquals(365056004L, - (long) image.getConfiguration().getArchiveSizeBytes()); - } - assertTrue(count > 0); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-network"; - NetworkId networkId = NetworkId.of(name); - NetworkInfo networkInfo = - NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(networkInfo); -operation.waitFor(); - // test get network with selected fields - Network network = compute.getNetwork(networkId.getNetwork(), - Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); - resourceCleaner.add(networkId); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertNull(network.getDescription()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - // test get network - network = compute.getNetwork(networkId.getNetwork()); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - operation = network.delete(); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getNetwork(name)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testListNetworks() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "list-network"; - NetworkId networkId = NetworkId.of(name); - NetworkInfo networkInfo = - NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - resourceCleaner.add(networkId); - // test list - Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); - Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); - Iterator networkIterator = networkPage.iterateAll().iterator(); - int count = 0; - while (networkIterator.hasNext()) { - Network network = networkIterator.next(); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - count++; - } - assertEquals(1, count); - // test list with selected fields - count = 0; - networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), - Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); - networkIterator = networkPage.iterateAll().iterator(); - while (networkIterator.hasNext()) { - Network network = networkIterator.next(); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertNull(network.getDescription()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - count++; - } - assertEquals(1, count); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getNetwork(name)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { - String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; - NetworkId networkId = NetworkId.of(networkName); - NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - // test get network - Network network = compute.getNetwork(networkId.getNetwork()); - resourceCleaner.add(networkId); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); - assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); - assertFalse(network.getConfiguration().autoCreateSubnetworks()); - String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; - SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); - operation = compute.create(subnetworkInfo); - operation.waitFor(); - // test get subnetwork with selected fields - Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, - Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - resourceCleaner.add(subnetworkId); - assertNull(subnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(subnetwork.getCreationTimestamp()); - assertNull(subnetwork.getDescription()); - assertNull(subnetwork.getGatewayAddress()); - assertNull(subnetwork.getNetwork()); - assertNull(subnetwork.getIpRange()); - // test get subnetwork - subnetwork = compute.getSubnetwork(subnetworkId); - assertNotNull(subnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(subnetwork.getCreationTimestamp()); - assertNotNull(subnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); - assertEquals("192.168.0.0/16", subnetwork.getIpRange()); - // test list subnetworks - Compute.SubnetworkFilter filter = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); - Page subnetworkPage = - compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); - Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); - int count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), - remoteSubnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNotNull(remoteSubnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); - assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); - count++; - } - assertEquals(1, count); - // test list subnetworks with selected fields - subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), - Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - subnetworkIterator = subnetworkPage.iterateAll().iterator(); - count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNull(remoteSubnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), - remoteSubnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNull(remoteSubnetwork.getDescription()); - assertNull(remoteSubnetwork.getGatewayAddress()); - assertNull(remoteSubnetwork.getNetwork()); - assertNull(remoteSubnetwork.getIpRange()); - count++; - } - assertEquals(1, count); - operation = subnetwork.delete(); - operation.waitFor(); - resourceCleaner.remove(subnetworkId); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getSubnetwork(subnetworkId)); - assertNull(compute.getNetwork(networkName)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { - String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; - NetworkId networkId = NetworkId.of(networkName); - NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - resourceCleaner.add(networkId); - String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; - String[] regionNames = {"us-central1", "us-east1"}; - String[] subnetworkNames = {prefix + "1", prefix + "2"}; - String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; - SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); - SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); - SubnetworkInfo firstSubnetworkInfo = - SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); - SubnetworkInfo secondSubnetworkInfo = - SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); - Operation firstOperation = compute.create(firstSubnetworkInfo); - Operation secondOperation = compute.create(secondSubnetworkInfo); - firstOperation.waitFor(); - resourceCleaner.add(firstSubnetworkId); - secondOperation.waitFor(); - resourceCleaner.add(secondSubnetworkId); - Set regionSet = ImmutableSet.copyOf(regionNames); - Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); - Set rangeSet = ImmutableSet.copyOf(ipRanges); - Compute.SubnetworkFilter subnetworkFilter = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); - Page subnetworkPage = - compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); - Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); - int count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.getGeneratedId()); - assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); - assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNotNull(remoteSubnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); - assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); - count++; - } - assertEquals(2, count); - firstOperation = compute.deleteSubnetwork(firstSubnetworkId); - secondOperation = compute.deleteSubnetwork(secondSubnetworkId); - firstOperation.waitFor(); - resourceCleaner.remove(firstSubnetworkId); - secondOperation.waitFor(); - resourceCleaner.remove(secondSubnetworkId); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getSubnetwork(firstSubnetworkId)); - assertNull(compute.getSubnetwork(secondSubnetworkId)); - assertNull(compute.getNetwork(networkName)); - } - - @Test - public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; - String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; - // Create an address to assign to the instance - AddressId addressId = RegionAddressId.of(REGION, addressName); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - Address address = compute.getAddress(addressId); - resourceCleaner.add(addressId); - // Create an instance - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) - .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() - .setName("NAT") - .setNatIp(address.getAddress()).build()) - .build(); - AttachedDisk disk1 = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - AttachedDisk disk2 = - AttachedDisk.of("dev1", - AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) - .setAttachedDisks(disk1, disk2) - .setNetworkInterfaces(networkInterface) - .build(); - operation = compute.create(instanceInfo); - operation.waitFor(); - // test get - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); - assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); - assertEquals(ZONE, remoteInstance.getMachineType().getZone()); - assertNotNull(remoteInstance.getCreationTimestamp()); - Set deviceSet = ImmutableSet.of("dev0", "dev1"); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - } - assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, - remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); - AttachedDisk.PersistentDiskConfiguration remoteConfiguration = - remoteInstance.getAttachedDisks().get(0).getConfiguration(); - assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); - assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); - assertTrue(remoteConfiguration.boot()); - assertTrue(remoteConfiguration.autoDelete()); - assertEquals(1, remoteInstance.getNetworkInterfaces().size()); - NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); - assertNotNull(remoteNetworkInterface.getName()); - assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); - List remoteAccessConfigurations = - remoteNetworkInterface.getAccessConfigurations(); - assertNotNull(remoteAccessConfigurations); - assertEquals(1, remoteAccessConfigurations.size()); - NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); - assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); - assertEquals("NAT", remoteAccessConfig.getName()); - assertNotNull(remoteInstance.getMetadata()); - assertNotNull(remoteInstance.getTags()); - // test get with selected fields - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); - assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); - assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); - assertNull(remoteInstance.getMachineType()); - assertNotNull(remoteInstance.getCreationTimestamp()); - assertNull(remoteInstance.getAttachedDisks()); - assertNull(remoteInstance.getNetworkInterfaces()); - assertNull(remoteInstance.getMetadata()); - assertNull(remoteInstance.getTags()); - // test get default serial port output - String serialPortOutput = remoteInstance.getSerialPortOutput(); - assertNotNull(serialPortOutput); - // test get serial port output by number - String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); - assertTrue(newSerialPortOutput.contains(serialPortOutput)); - operation = remoteInstance.delete(); - operation.waitFor(); - resourceCleaner.remove(instanceId); - assertNull(compute.getInstance(instanceId)); - } - - @Test - public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation operation = compute.create(instanceInfo); - operation.waitFor(); - Instance remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - resourceCleaner.add(instanceId); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - operation = remoteInstance.stop(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); - operation = remoteInstance.start(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - operation = remoteInstance.reset(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - } - - @Test - public void testSetInstanceProperties() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation operation = compute.create(instanceInfo); - operation.waitFor(); - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - // test set tags - List tags = ImmutableList.of("tag1", "tag2"); - operation = remoteInstance.setTags(tags); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(tags, remoteInstance.getTags().getValues()); - // test set metadata - Map metadata = ImmutableMap.of("key", "value"); - operation = remoteInstance.setMetadata(metadata); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(metadata, remoteInstance.getMetadata().getValues()); - // test set machine type - operation = remoteInstance.stop(); - operation.waitFor(); - operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); - assertEquals(ZONE, remoteInstance.getMachineType().getZone()); - // test set scheduling options - SchedulingOptions options = - SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); - operation = remoteInstance.setSchedulingOptions(options); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(options, remoteInstance.getSchedulingOptions()); - } - - @Test - public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; - String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation instanceOperation = compute.create(instanceInfo); - DiskId diskId = DiskId.of(ZONE, diskName); - Operation diskOperation = compute.create(DiskInfo.of(diskId, - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); - instanceOperation.waitFor(); - diskOperation.waitFor(); - resourceCleaner.add(diskId); - Instance remoteInstance = compute.getInstance(instanceId); - // test attach disk - instanceOperation = remoteInstance.attachDisk("dev1", - AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - Set deviceSet = ImmutableSet.of("dev0", "dev1"); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - } - // test set disk auto-delete - instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); - } - // test detach disk - instanceOperation = remoteInstance.detachDisk("dev1"); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(1, remoteInstance.getAttachedDisks().size()); - assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); - } - - @Test - public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; - String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation instanceOperation = compute.create(instanceInfo); - AddressId addressId = RegionAddressId.of(REGION, addressName); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation addressOperation = compute.create(addressInfo); - addressOperation.waitFor(); - instanceOperation.waitFor(); - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); - // test add access config - NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() - .setNatIp(remoteAddress.getAddress()) - .setName("NAT") - .build(); - instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - List accessConfigurations = - remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); - assertEquals(1, accessConfigurations.size()); - assertEquals("NAT", accessConfigurations.get(0).getName()); - // test delete access config - instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); - } -} +// /* +// * Copyright 2016 Google LLC +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +// +// package com.google.cloud.compute.deprecated.it; +// +// import static org.junit.Assert.assertEquals; +// import static org.junit.Assert.assertFalse; +// import static org.junit.Assert.assertNotEquals; +// import static org.junit.Assert.assertNotNull; +// import static org.junit.Assert.assertNull; +// import static org.junit.Assert.assertTrue; +// +// import com.google.api.gax.paging.Page; +// import com.google.cloud.compute.deprecated.Address; +// import com.google.cloud.compute.deprecated.AddressId; +// import com.google.cloud.compute.deprecated.AddressInfo; +// import com.google.cloud.compute.deprecated.AttachedDisk; +// import com.google.cloud.compute.deprecated.Compute; +// import com.google.cloud.compute.deprecated.DeprecationStatus; +// import com.google.cloud.compute.deprecated.Disk; +// import com.google.cloud.compute.deprecated.DiskConfiguration; +// import com.google.cloud.compute.deprecated.DiskId; +// import com.google.cloud.compute.deprecated.DiskImageConfiguration; +// import com.google.cloud.compute.deprecated.DiskInfo; +// import com.google.cloud.compute.deprecated.DiskType; +// import com.google.cloud.compute.deprecated.DiskTypeId; +// import com.google.cloud.compute.deprecated.GlobalAddressId; +// import com.google.cloud.compute.deprecated.Image; +// import com.google.cloud.compute.deprecated.ImageConfiguration; +// import com.google.cloud.compute.deprecated.ImageDiskConfiguration; +// import com.google.cloud.compute.deprecated.ImageId; +// import com.google.cloud.compute.deprecated.ImageInfo; +// import com.google.cloud.compute.deprecated.Instance; +// import com.google.cloud.compute.deprecated.InstanceId; +// import com.google.cloud.compute.deprecated.InstanceInfo; +// import com.google.cloud.compute.deprecated.License; +// import com.google.cloud.compute.deprecated.LicenseId; +// import com.google.cloud.compute.deprecated.MachineType; +// import com.google.cloud.compute.deprecated.MachineTypeId; +// import com.google.cloud.compute.deprecated.Network; +// import com.google.cloud.compute.deprecated.NetworkConfiguration; +// import com.google.cloud.compute.deprecated.NetworkId; +// import com.google.cloud.compute.deprecated.NetworkInfo; +// import com.google.cloud.compute.deprecated.NetworkInterface; +// import com.google.cloud.compute.deprecated.Operation; +// import com.google.cloud.compute.deprecated.Region; +// import com.google.cloud.compute.deprecated.RegionAddressId; +// import com.google.cloud.compute.deprecated.RegionOperationId; +// import com.google.cloud.compute.deprecated.SchedulingOptions; +// import com.google.cloud.compute.deprecated.Snapshot; +// import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; +// import com.google.cloud.compute.deprecated.SnapshotId; +// import com.google.cloud.compute.deprecated.SnapshotInfo; +// import com.google.cloud.compute.deprecated.StandardDiskConfiguration; +// import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; +// import com.google.cloud.compute.deprecated.StorageImageConfiguration; +// import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; +// import com.google.cloud.compute.deprecated.Subnetwork; +// import com.google.cloud.compute.deprecated.SubnetworkId; +// import com.google.cloud.compute.deprecated.SubnetworkInfo; +// import com.google.cloud.compute.deprecated.Zone; +// import com.google.cloud.compute.deprecated.ZoneOperationId; +// import com.google.cloud.compute.deprecated.testing.ResourceCleaner; +// import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; +// import com.google.common.collect.ImmutableList; +// import com.google.common.collect.ImmutableMap; +// import com.google.common.collect.ImmutableSet; +// import java.util.Iterator; +// import java.util.List; +// import java.util.Map; +// import java.util.Set; +// import java.util.concurrent.TimeoutException; +// import org.junit.AfterClass; +// import org.junit.BeforeClass; +// import org.junit.Ignore; +// import org.junit.Rule; +// import org.junit.Test; +// import org.junit.rules.Timeout; +// +// public class ITComputeTest { +// +// private static final String REGION = "us-central1"; +// private static final String ZONE = "us-central1-a"; +// private static final String DISK_TYPE = "local-ssd"; +// private static final String MACHINE_TYPE = "f1-micro"; +// private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); +// private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); +// private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); +// private static final String IMAGE_PROJECT = "debian-cloud"; +// +// private static Compute compute; +// private static ResourceCleaner resourceCleaner; +// +// +// @Rule +// public Timeout globalTimeout = Timeout.seconds(300); +// +// @BeforeClass +// public static void beforeClass() { +// RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); +// compute = computeHelper.getOptions().getService(); +// resourceCleaner = ResourceCleaner.create(compute); +// } +// +// @AfterClass +// public static void tearDown() { +// resourceCleaner.cleanUp(); +// } +// +// @Test +// public void testGetDiskType() { +// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); +// // assertNotNull(diskType.getGeneratedId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotNull(diskType.getDefaultDiskSizeGb()); +// } +// +// @Test +// public void testGetDiskTypeWithSelectedFields() { +// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, +// Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); +// // assertNotNull(diskType.getGeneratedId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNull(diskType.getDescription()); +// assertNull(diskType.getValidDiskSize()); +// assertNull(diskType.getDefaultDiskSizeGb()); +// } +// +// @Test +// public void testListDiskTypes() { +// Page diskPage = compute.listDiskTypes(ZONE); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotNull(diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testListDiskTypesWithSelectedFields() { +// Page diskPage = compute.listDiskTypes(ZONE, +// Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// assertNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNull(diskType.getDescription()); +// assertNull(diskType.getValidDiskSize()); +// assertNull(diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testListDiskTypesWithFilter() { +// Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( +// Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // todo(mziccard): uncomment or remove once #695 is closed +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListDiskTypes() { +// Page diskPage = compute.listDiskTypes(); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotNull(diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListDiskTypesWithFilter() { +// Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( +// Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); +// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); +// assertTrue(diskTypeIterator.hasNext()); +// while (diskTypeIterator.hasNext()) { +// DiskType diskType = diskTypeIterator.next(); +// // todo(mziccard): uncomment or remove once #695 is closed +// // assertNotNull(diskType.getGeneratedId()); +// assertNotNull(diskType.getDiskTypeId()); +// assertNotNull(diskType.getCreationTimestamp()); +// assertNotNull(diskType.getDescription()); +// assertNotNull(diskType.getValidDiskSize()); +// assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); +// } +// } +// +// @Test +// public void testGetMachineType() { +// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// +// @Test +// public void testGetMachineTypeWithSelectedFields() { +// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, +// Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); +// assertNotNull(machineType.getGeneratedId()); +// assertNull(machineType.getCreationTimestamp()); +// assertNull(machineType.getDescription()); +// assertNull(machineType.getCpus()); +// assertNull(machineType.getMemoryMb()); +// assertNull(machineType.getMaximumPersistentDisks()); +// assertNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// +// @Test +// public void testListMachineTypes() { +// Page machinePage = compute.listMachineTypes(ZONE); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testListMachineTypesWithSelectedFields() { +// Page machinePage = compute.listMachineTypes(ZONE, +// Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNull(machineType.getDescription()); +// assertNull(machineType.getCpus()); +// assertNull(machineType.getMemoryMb()); +// assertNull(machineType.getMaximumPersistentDisks()); +// assertNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testListMachineTypesWithFilter() { +// Page machinePage = compute.listMachineTypes(ZONE, +// Compute.MachineTypeListOption.filter( +// Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertEquals(2, (long) machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListMachineTypes() { +// Page machinePage = compute.listMachineTypes(); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testAggregatedListMachineTypesWithFilter() { +// Page machinePage = +// compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( +// Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); +// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); +// assertTrue(machineTypeIterator.hasNext()); +// while (machineTypeIterator.hasNext()) { +// MachineType machineType = machineTypeIterator.next(); +// assertNotNull(machineType.getMachineTypeId()); +// assertNotNull(machineType.getGeneratedId()); +// assertNotNull(machineType.getCreationTimestamp()); +// assertNotNull(machineType.getDescription()); +// assertNotNull(machineType.getCpus()); +// assertNotEquals(2, (long) machineType.getCpus()); +// assertNotNull(machineType.getMemoryMb()); +// assertNotNull(machineType.getMaximumPersistentDisks()); +// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); +// } +// } +// +// @Test +// public void testGetLicense() { +// License license = compute.getLicense(LICENSE_ID); +// assertEquals(LICENSE_ID, license.getLicenseId()); +// assertNotNull(license.chargesUseFee()); +// } +// +// @Test +// public void testGetLicenseWithSelectedFields() { +// License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); +// assertEquals(LICENSE_ID, license.getLicenseId()); +// assertNull(license.chargesUseFee()); +// } +// +// @Test +// public void testGetRegion() { +// Region region = compute.getRegion(REGION); +// assertEquals(REGION, region.getRegionId().getRegion()); +// assertNotNull(region.getDescription()); +// assertNotNull(region.getCreationTimestamp()); +// assertNotNull(region.getGeneratedId()); +// assertNotNull(region.getQuotas()); +// assertNotNull(region.getStatus()); +// assertNotNull(region.getZones()); +// } +// +// @Test +// public void testGetRegionWithSelectedFields() { +// Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); +// assertEquals(REGION, region.getRegionId().getRegion()); +// assertNotNull(region.getGeneratedId()); +// assertNull(region.getDescription()); +// assertNull(region.getCreationTimestamp()); +// assertNull(region.getQuotas()); +// assertNull(region.getStatus()); +// assertNull(region.getZones()); +// } +// +// @Test +// public void testListRegions() { +// Page regionPage = compute.listRegions(); +// Iterator regionIterator = regionPage.iterateAll().iterator(); +// while (regionIterator.hasNext()) { +// Region region = regionIterator.next(); +// assertNotNull(region.getRegionId()); +// assertNotNull(region.getDescription()); +// assertNotNull(region.getCreationTimestamp()); +// assertNotNull(region.getGeneratedId()); +// assertNotNull(region.getQuotas()); +// assertNotNull(region.getStatus()); +// assertNotNull(region.getZones()); +// } +// } +// +// @Test +// public void testListRegionsWithSelectedFields() { +// Page regionPage = +// compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); +// Iterator regionIterator = regionPage.iterateAll().iterator(); +// while (regionIterator.hasNext()) { +// Region region = regionIterator.next(); +// assertNotNull(region.getRegionId()); +// assertNull(region.getDescription()); +// assertNull(region.getCreationTimestamp()); +// assertNotNull(region.getGeneratedId()); +// assertNull(region.getQuotas()); +// assertNull(region.getStatus()); +// assertNull(region.getZones()); +// } +// } +// +// @Test +// public void testListRegionsWithFilter() { +// Page regionPage = compute.listRegions(Compute.RegionListOption.filter( +// Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); +// Iterator regionIterator = regionPage.iterateAll().iterator(); +// assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); +// assertFalse(regionIterator.hasNext()); +// } +// +// @Test +// public void testGetZone() { +// Zone zone = compute.getZone(ZONE); +// assertEquals(ZONE, zone.getZoneId().getZone()); +// assertNotNull(zone.getGeneratedId()); +// assertNotNull(zone.getCreationTimestamp()); +// assertNotNull(zone.getDescription()); +// assertNotNull(zone.getStatus()); +// assertNotNull(zone.getRegion()); +// } +// +// @Test +// public void testGetZoneWithSelectedFields() { +// Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); +// assertEquals(ZONE, zone.getZoneId().getZone()); +// assertNotNull(zone.getGeneratedId()); +// assertNull(zone.getCreationTimestamp()); +// assertNull(zone.getDescription()); +// assertNull(zone.getStatus()); +// assertNull(zone.getRegion()); +// } +// +// @Test +// public void testListZones() { +// Page zonePage = compute.listZones(); +// Iterator zoneIterator = zonePage.iterateAll().iterator(); +// while (zoneIterator.hasNext()) { +// Zone zone = zoneIterator.next(); +// assertNotNull(zone.getZoneId()); +// assertNotNull(zone.getGeneratedId()); +// assertNotNull(zone.getCreationTimestamp()); +// assertNotNull(zone.getDescription()); +// assertNotNull(zone.getStatus()); +// assertNotNull(zone.getRegion()); +// } +// } +// +// @Test +// public void testListZonesWithSelectedFields() { +// Page zonePage = compute.listZones( +// Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); +// Iterator zoneIterator = zonePage.iterateAll().iterator(); +// while (zoneIterator.hasNext()) { +// Zone zone = zoneIterator.next(); +// assertNotNull(zone.getZoneId()); +// assertNull(zone.getGeneratedId()); +// assertNotNull(zone.getCreationTimestamp()); +// assertNull(zone.getDescription()); +// assertNull(zone.getStatus()); +// assertNull(zone.getRegion()); +// } +// } +// +// @Test +// public void testListZonesWithFilter() { +// Page zonePage = compute.listZones( +// Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); +// Iterator zoneIterator = zonePage.iterateAll().iterator(); +// assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); +// assertFalse(zoneIterator.hasNext()); +// } +// +// @Test +// public void testListGlobalOperations() { +// Page operationPage = compute.listGlobalOperations(); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertNotNull(operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListGlobalOperationsWithSelectedFields() { +// Page operationPage = +// compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getTargetLink()); +// assertNull(operation.getTargetId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getStatus()); +// assertNull(operation.getStatusMessage()); +// assertNull(operation.getUser()); +// assertNull(operation.getProgress()); +// assertNull(operation.getDescription()); +// assertNull(operation.getInsertTime()); +// assertNull(operation.getStartTime()); +// assertNull(operation.getEndTime()); +// assertNull(operation.getWarnings()); +// assertNull(operation.getHttpErrorMessage()); +// } +// } +// +// @Test +// public void testListGlobalOperationsWithFilter() { +// Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( +// Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertEquals(Operation.Status.DONE, operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListRegionOperations() { +// Page operationPage = compute.listRegionOperations(REGION); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(REGION, operation.getOperationId().getRegion()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertNotNull(operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListRegionOperationsWithSelectedFields() { +// Page operationPage = compute.listRegionOperations(REGION, +// Compute.OperationListOption.fields(Compute.OperationField.ID)); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(REGION, operation.getOperationId().getRegion()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getTargetLink()); +// assertNull(operation.getTargetId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getStatus()); +// assertNull(operation.getStatusMessage()); +// assertNull(operation.getUser()); +// assertNull(operation.getProgress()); +// assertNull(operation.getDescription()); +// assertNull(operation.getInsertTime()); +// assertNull(operation.getStartTime()); +// assertNull(operation.getEndTime()); +// assertNull(operation.getWarnings()); +// assertNull(operation.getHttpErrorMessage()); +// } +// } +// +// @Test +// public void testListRegionOperationsWithFilter() { +// Page operationPage = compute.listRegionOperations(REGION, +// Compute.OperationListOption.filter(Compute.OperationFilter.equals( +// Compute.OperationField.STATUS, "DONE"))); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(REGION, operation.getOperationId().getRegion()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertEquals(Operation.Status.DONE, operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListZoneOperations() { +// Page operationPage = compute.listZoneOperations(ZONE); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(ZONE, operation.getOperationId().getZone()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertNotNull(operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testListZoneOperationsWithSelectedFields() { +// Page operationPage = compute.listZoneOperations(ZONE, +// Compute.OperationListOption.fields(Compute.OperationField.ID)); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(ZONE, operation.getOperationId().getZone()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getTargetLink()); +// assertNull(operation.getTargetId()); +// assertNull(operation.getOperationType()); +// assertNull(operation.getStatus()); +// assertNull(operation.getStatusMessage()); +// assertNull(operation.getUser()); +// assertNull(operation.getProgress()); +// assertNull(operation.getDescription()); +// assertNull(operation.getInsertTime()); +// assertNull(operation.getStartTime()); +// assertNull(operation.getEndTime()); +// assertNull(operation.getWarnings()); +// assertNull(operation.getHttpErrorMessage()); +// } +// } +// +// @Test +// public void testListZoneOperationsWithFilter() { +// Page operationPage = compute.listZoneOperations(ZONE, +// Compute.OperationListOption.filter(Compute.OperationFilter.equals( +// Compute.OperationField.STATUS, "DONE"))); +// Iterator operationIterator = operationPage.iterateAll().iterator(); +// while (operationIterator.hasNext()) { +// Operation operation = operationIterator.next(); +// assertNotNull(operation.getGeneratedId()); +// assertNotNull(operation.getOperationId()); +// assertEquals(ZONE, operation.getOperationId().getZone()); +// // todo(mziccard): uncomment or remove once #727 is closed +// // assertNotNull(operation.getCreationTimestamp()); +// assertNotNull(operation.getOperationType()); +// assertEquals(Operation.Status.DONE, operation.getStatus()); +// assertNotNull(operation.getUser()); +// } +// } +// +// @Test +// public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; +// AddressId addressId = RegionAddressId.of(REGION, name); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation operation = compute.create(addressInfo); +// operation.waitFor(); +// // test get +// Address remoteAddress = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNotNull(remoteAddress.getAddress()); +// assertNotNull(remoteAddress.getCreationTimestamp()); +// assertNotNull(remoteAddress.getGeneratedId()); +// assertNotNull(remoteAddress.getStatus()); +// // test get with selected fields +// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNull(remoteAddress.getAddress()); +// assertNull(remoteAddress.getCreationTimestamp()); +// assertNull(remoteAddress.getGeneratedId()); +// operation = remoteAddress.delete(); +// operation.waitFor(); +// resourceCleaner.remove(addressId); +// assertNull(compute.getAddress(addressId)); +// } +// +// @Test +// public void testListRegionAddresses() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-region-address"; +// String[] addressNames = {prefix + "1", prefix + "2"}; +// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); +// AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); +// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); +// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstAddressId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondAddressId); +// Set addressSet = ImmutableSet.copyOf(addressNames); +// // test list +// Compute.AddressFilter filter = +// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); +// Page
addressPage = +// compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); +// Iterator
addressIterator = addressPage.iterateAll().iterator(); +// int count = 0; +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertNotNull(address.getAddressId()); +// assertTrue(address.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, address.getAddressId().getRegion()); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNotNull(address.getCreationTimestamp()); +// assertNotNull(address.getGeneratedId()); +// count++; +// } +// assertEquals(2, count); +// // test list with selected fields +// count = 0; +// addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), +// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); +// addressIterator = addressPage.iterateAll().iterator(); +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertTrue(address.getAddressId() instanceof RegionAddressId); +// assertEquals(REGION, address.getAddressId().getRegion()); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNull(address.getCreationTimestamp()); +// assertNull(address.getGeneratedId()); +// assertNull(address.getStatus()); +// assertNull(address.getUsage()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; +// String[] addressNames = {prefix + "1", prefix + "2"}; +// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); +// AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); +// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); +// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstAddressId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondAddressId); +// Set addressSet = ImmutableSet.copyOf(addressNames); +// Compute.AddressFilter filter = +// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); +// Page
addressPage = +// compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); +// Iterator
addressIterator = addressPage.iterateAll().iterator(); +// int count = 0; +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertNotNull(address.getAddressId()); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNotNull(address.getCreationTimestamp()); +// assertNotNull(address.getGeneratedId()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; +// AddressId addressId = GlobalAddressId.of(name); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation operation = compute.create(addressInfo); +// operation.waitFor(); +// // test get +// Address remoteAddress = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNotNull(remoteAddress.getAddress()); +// assertNotNull(remoteAddress.getCreationTimestamp()); +// assertNotNull(remoteAddress.getGeneratedId()); +// assertNotNull(remoteAddress.getStatus()); +// // test get with selected fields +// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); +// assertNotNull(remoteAddress); +// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); +// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); +// assertNull(remoteAddress.getAddress()); +// assertNull(remoteAddress.getCreationTimestamp()); +// assertNull(remoteAddress.getGeneratedId()); +// operation = remoteAddress.delete(); +// operation.waitFor(); +// resourceCleaner.remove(addressId); +// assertNull(compute.getAddress(addressId)); +// } +// +// @Test +// public void testListGlobalAddresses() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-global-address"; +// String[] addressNames = {prefix + "1", prefix + "2"}; +// AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); +// AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); +// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); +// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstAddressId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondAddressId); +// Set addressSet = ImmutableSet.copyOf(addressNames); +// // test list +// Compute.AddressFilter filter = +// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); +// Page
addressPage = +// compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); +// Iterator
addressIterator = addressPage.iterateAll().iterator(); +// int count = 0; +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertNotNull(address.getAddressId()); +// assertTrue(address.getAddressId() instanceof GlobalAddressId); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNotNull(address.getCreationTimestamp()); +// assertNotNull(address.getGeneratedId()); +// count++; +// } +// assertEquals(2, count); +// // test list with selected fields +// count = 0; +// addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), +// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); +// addressIterator = addressPage.iterateAll().iterator(); +// while (addressIterator.hasNext()) { +// Address address = addressIterator.next(); +// assertTrue(address.getAddressId() instanceof GlobalAddressId); +// assertTrue(addressSet.contains(address.getAddressId().getAddress())); +// assertNotNull(address.getAddress()); +// assertNull(address.getCreationTimestamp()); +// assertNull(address.getGeneratedId()); +// assertNull(address.getStatus()); +// assertNull(address.getUsage()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testCreateGetResizeAndDeleteStandardDisk() +// throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; +// DiskId diskId = DiskId.of(ZONE, name); +// DiskInfo diskInfo = +// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// // test get +// Disk remoteDisk = compute.getDisk(diskId); +// resourceCleaner.add(diskId); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.resize(200L); +// operation.waitFor(); +// // test resize and get with selected fields +// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(200L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.delete(); +// operation.waitFor(); +// resourceCleaner.remove(diskId); +// assertNull(compute.getDisk(diskId)); +// } +// +// @Test +// public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; +// DiskId diskId = DiskId.of(ZONE, name); +// DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// // test get +// Disk remoteDisk = compute.getDisk(diskId); +// resourceCleaner.add(diskId); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); +// ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); +// assertNotNull(remoteConfiguration.getSourceImageId()); +// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); +// assertNotNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// // test get with selected fields +// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); +// remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); +// assertNull(remoteConfiguration.getSourceImageId()); +// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); +// assertNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.delete(); +// operation.waitFor(); +// resourceCleaner.remove(diskId); +// assertNull(compute.getDisk(diskId)); +// } +// +// @Test +// public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() +// throws InterruptedException, TimeoutException { +// String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; +// String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; +// DiskId diskId = DiskId.of(ZONE, diskName); +// DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); +// String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; +// DiskInfo diskInfo = +// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// Disk remoteDisk = compute.getDisk(diskId); +// resourceCleaner.add(diskId); +// operation = remoteDisk.createSnapshot(snapshotName); +// operation.waitFor(); +// // test get snapshot with selected fields +// Snapshot snapshot = compute.getSnapshot(snapshotName, +// Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); +// resourceCleaner.add(snapshot.getSnapshotId()); +// assertNull(snapshot.getGeneratedId()); +// assertNotNull(snapshot.getSnapshotId()); +// assertNotNull(snapshot.getCreationTimestamp()); +// assertNull(snapshot.getDescription()); +// assertNull(snapshot.getStatus()); +// assertNull(snapshot.getDiskSizeGb()); +// assertNull(snapshot.getLicenses()); +// assertNull(snapshot.getSourceDisk()); +// assertNull(snapshot.getSourceDiskId()); +// assertNull(snapshot.getStorageBytes()); +// assertNull(snapshot.getStorageBytesStatus()); +// // test get snapshot +// snapshot = compute.getSnapshot(snapshotName); +// assertNotNull(snapshot.getGeneratedId()); +// assertNotNull(snapshot.getSnapshotId()); +// assertNotNull(snapshot.getCreationTimestamp()); +// assertNotNull(snapshot.getStatus()); +// assertEquals(100L, (long) snapshot.getDiskSizeGb()); +// assertEquals(diskName, snapshot.getSourceDisk().getDisk()); +// assertNotNull(snapshot.getSourceDiskId()); +// assertNotNull(snapshot.getStorageBytes()); +// assertNotNull(snapshot.getStorageBytesStatus()); +// remoteDisk.delete(); +// resourceCleaner.remove(diskId); +// diskInfo = +// DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); +// operation = compute.create(diskInfo); +// operation.waitFor(); +// // test get disk +// remoteDisk = compute.getDisk(snapshotDiskId); +// resourceCleaner.add(snapshotDiskId); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); +// SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); +// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNotNull(remoteConfiguration.getSourceSnapshotId()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// // test get disk with selected fields +// remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); +// assertNotNull(remoteDisk); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); +// assertNull(remoteDisk.getCreationStatus()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); +// remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); +// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); +// assertNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); +// assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// operation = remoteDisk.delete(); +// operation.waitFor(); +// resourceCleaner.remove(snapshotDiskId); +// assertNull(compute.getDisk(snapshotDiskId)); +// operation = snapshot.delete(); +// operation.waitFor(); +// resourceCleaner.remove(snapshot.getSnapshotId()); +// assertNull(compute.getSnapshot(snapshotName)); +// } +// +// @Test +// public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; +// String[] diskNames = {prefix + "1", prefix + "2"}; +// DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); +// DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); +// DiskConfiguration configuration = +// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); +// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); +// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstDiskId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondDiskId); +// Set diskSet = ImmutableSet.copyOf(diskNames); +// // test list disks +// Compute.DiskFilter diskFilter = +// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); +// Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); +// Iterator diskIterator = diskPage.iterateAll().iterator(); +// int count = 0; +// while (diskIterator.hasNext()) { +// Disk remoteDisk = diskIterator.next(); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// count++; +// } +// assertEquals(2, count); +// // test list disks with selected fields +// count = 0; +// diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), +// Compute.DiskListOption.fields(Compute.DiskField.STATUS)); +// diskIterator = diskPage.iterateAll().iterator(); +// while (diskIterator.hasNext()) { +// Disk remoteDisk = diskIterator.next(); +// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); +// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNull(remoteDisk.getCreationTimestamp()); +// assertNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertNull(remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// assertNull(remoteDisk.getLastAttachTimestamp()); +// assertNull(remoteDisk.getLastDetachTimestamp()); +// count++; +// } +// assertEquals(2, count); +// // test snapshots +// SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); +// SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); +// firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); +// secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstSnapshotId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondSnapshotId); +// // test list snapshots +// Compute.SnapshotFilter snapshotFilter = +// Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); +// Page snapshotPage = +// compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); +// Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); +// count = 0; +// while (snapshotIterator.hasNext()) { +// Snapshot remoteSnapshot = snapshotIterator.next(); +// assertNotNull(remoteSnapshot.getGeneratedId()); +// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); +// assertNotNull(remoteSnapshot.getCreationTimestamp()); +// assertNotNull(remoteSnapshot.getStatus()); +// assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); +// assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); +// assertNotNull(remoteSnapshot.getSourceDiskId()); +// assertNotNull(remoteSnapshot.getStorageBytes()); +// assertNotNull(remoteSnapshot.getStorageBytesStatus()); +// count++; +// } +// assertEquals(2, count); +// // test list snapshots with selected fields +// snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), +// Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); +// snapshotIterator = snapshotPage.iterateAll().iterator(); +// count = 0; +// while (snapshotIterator.hasNext()) { +// Snapshot remoteSnapshot = snapshotIterator.next(); +// assertNull(remoteSnapshot.getGeneratedId()); +// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); +// assertNotNull(remoteSnapshot.getCreationTimestamp()); +// assertNull(remoteSnapshot.getStatus()); +// assertNull(remoteSnapshot.getDiskSizeGb()); +// assertNull(remoteSnapshot.getSourceDisk()); +// assertNull(remoteSnapshot.getSourceDiskId()); +// assertNull(remoteSnapshot.getStorageBytes()); +// assertNull(remoteSnapshot.getStorageBytesStatus()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testAggregatedListDisks() throws InterruptedException, TimeoutException { +// String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; +// String[] diskZones = {"us-central1-a", "us-east1-c"}; +// String[] diskNames = {prefix + "1", prefix + "2"}; +// DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); +// DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); +// DiskConfiguration configuration = +// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); +// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); +// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); +// firstOperation.waitFor(); +// resourceCleaner.add(firstDiskId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondDiskId); +// Set zoneSet = ImmutableSet.copyOf(diskZones); +// Set diskSet = ImmutableSet.copyOf(diskNames); +// Compute.DiskFilter diskFilter = +// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); +// Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); +// Iterator diskIterator = diskPage.iterateAll().iterator(); +// int count = 0; +// while (diskIterator.hasNext()) { +// Disk remoteDisk = diskIterator.next(); +// assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); +// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); +// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); +// assertNotNull(remoteDisk.getCreationTimestamp()); +// assertNotNull(remoteDisk.getGeneratedId()); +// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); +// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); +// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); +// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); +// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); +// count++; +// } +// assertEquals(2, count); +// } +// +// @Test +// public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { +// String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; +// String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; +// DiskId diskId = DiskId.of(ZONE, diskName); +// ImageId imageId = ImageId.of(imageName); +// DiskInfo diskInfo = +// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); +// Operation operation = compute.create(diskInfo); +// operation.waitFor(); +// Disk remoteDisk = compute.getDisk(diskId); +// ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); +// operation = compute.create(imageInfo); +// operation.waitFor(); +// resourceCleaner.add(diskId); +// // test get image with selected fields +// Image image = compute.getImage(imageId, +// Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); +// resourceCleaner.add(imageId); +// assertNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNull(image.getDescription()); +// assertNotNull(image.getConfiguration()); +// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); +// DiskImageConfiguration remoteConfiguration = image.getConfiguration(); +// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); +// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); +// assertNull(image.getStatus()); +// assertNull(image.getDiskSizeGb()); +// assertNull(image.getLicenses()); +// assertNull(image.getDeprecationStatus()); +// // test get image +// image = compute.getImage(imageId); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); +// remoteConfiguration = image.getConfiguration(); +// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); +// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); +// assertEquals(100L, (long) image.getDiskSizeGb()); +// assertNotNull(image.getStatus()); +// assertNull(image.getDeprecationStatus()); +// // test deprecate image +// DeprecationStatus deprecationStatus = +// DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) +// .setDeprecated(System.currentTimeMillis()) +// .build(); +// operation = image.deprecate(deprecationStatus); +// operation.waitFor(); +// image = compute.getImage(imageId); +// assertEquals(deprecationStatus, image.getDeprecationStatus()); +// remoteDisk.delete(); +// resourceCleaner.remove(diskId); +// operation = image.delete(); +// operation.waitFor(); +// resourceCleaner.remove(imageId); +// assertNull(compute.getImage(imageId)); +// } +// +// @Test +// public void testListImages() { +// Page imagePage = compute.listImages(IMAGE_PROJECT); +// Iterator imageIterator = imagePage.iterateAll().iterator(); +// int count = 0; +// while (imageIterator.hasNext()) { +// count++; +// Image image = imageIterator.next(); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertNotNull(image.getStatus()); +// assertNotNull(image.getDiskSizeGb()); +// } +// assertTrue(count > 0); +// } +// +// @Test +// public void testListImagesWithSelectedFields() { +// Page imagePage = +// compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); +// Iterator imageIterator = imagePage.iterateAll().iterator(); +// int count = 0; +// while (imageIterator.hasNext()) { +// count++; +// Image image = imageIterator.next(); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertNull(image.getStatus()); +// assertNull(image.getDiskSizeGb()); +// assertNull(image.getLicenses()); +// assertNull(image.getDeprecationStatus()); +// } +// assertTrue(count > 0); +// } +// +// @Test +// public void testListImagesWithFilter() { +// Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( +// Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); +// Iterator imageIterator = imagePage.iterateAll().iterator(); +// int count = 0; +// while (imageIterator.hasNext()) { +// count++; +// Image image = imageIterator.next(); +// assertNotNull(image.getGeneratedId()); +// assertNotNull(image.getImageId()); +// assertNotNull(image.getCreationTimestamp()); +// assertNotNull(image.getConfiguration()); +// assertNotNull(image.getStatus()); +// assertNotNull(image.getDiskSizeGb()); +// assertEquals(365056004L, +// (long) image.getConfiguration().getArchiveSizeBytes()); +// } +// assertTrue(count > 0); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "create-and-get-network"; +// NetworkId networkId = NetworkId.of(name); +// NetworkInfo networkInfo = +// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// // test get network with selected fields +// Network network = compute.getNetwork(networkId.getNetwork(), +// Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); +// resourceCleaner.add(networkId); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertNull(network.getDescription()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// // test get network +// network = compute.getNetwork(networkId.getNetwork()); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNotNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// operation = network.delete(); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getNetwork(name)); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testListNetworks() throws InterruptedException, TimeoutException { +// String name = BASE_RESOURCE_NAME + "list-network"; +// NetworkId networkId = NetworkId.of(name); +// NetworkInfo networkInfo = +// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// resourceCleaner.add(networkId); +// // test list +// Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); +// Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); +// Iterator networkIterator = networkPage.iterateAll().iterator(); +// int count = 0; +// while (networkIterator.hasNext()) { +// Network network = networkIterator.next(); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNotNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// // test list with selected fields +// count = 0; +// networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), +// Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); +// networkIterator = networkPage.iterateAll().iterator(); +// while (networkIterator.hasNext()) { +// Network network = networkIterator.next(); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertNull(network.getDescription()); +// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); +// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); +// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// operation = compute.deleteNetwork(networkId); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getNetwork(name)); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { +// String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; +// NetworkId networkId = NetworkId.of(networkName); +// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// // test get network +// Network network = compute.getNetwork(networkId.getNetwork()); +// resourceCleaner.add(networkId); +// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); +// assertNotNull(network.getGeneratedId()); +// assertNotNull(network.getCreationTimestamp()); +// assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); +// assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); +// assertFalse(network.getConfiguration().autoCreateSubnetworks()); +// String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; +// SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); +// SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); +// operation = compute.create(subnetworkInfo); +// operation.waitFor(); +// // test get subnetwork with selected fields +// Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, +// Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); +// resourceCleaner.add(subnetworkId); +// assertNull(subnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(subnetwork.getCreationTimestamp()); +// assertNull(subnetwork.getDescription()); +// assertNull(subnetwork.getGatewayAddress()); +// assertNull(subnetwork.getNetwork()); +// assertNull(subnetwork.getIpRange()); +// // test get subnetwork +// subnetwork = compute.getSubnetwork(subnetworkId); +// assertNotNull(subnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(subnetwork.getCreationTimestamp()); +// assertNotNull(subnetwork.getGatewayAddress()); +// assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); +// assertEquals("192.168.0.0/16", subnetwork.getIpRange()); +// // test list subnetworks +// Compute.SubnetworkFilter filter = +// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); +// Page subnetworkPage = +// compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); +// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); +// int count = 0; +// while (subnetworkIterator.hasNext()) { +// Subnetwork remoteSubnetwork = subnetworkIterator.next(); +// assertNotNull(remoteSubnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), +// remoteSubnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(remoteSubnetwork.getCreationTimestamp()); +// assertNotNull(remoteSubnetwork.getGatewayAddress()); +// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); +// assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// // test list subnetworks with selected fields +// subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), +// Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); +// subnetworkIterator = subnetworkPage.iterateAll().iterator(); +// count = 0; +// while (subnetworkIterator.hasNext()) { +// Subnetwork remoteSubnetwork = subnetworkIterator.next(); +// assertNull(remoteSubnetwork.getGeneratedId()); +// assertEquals(subnetworkId.getSubnetwork(), +// remoteSubnetwork.getSubnetworkId().getSubnetwork()); +// assertNotNull(remoteSubnetwork.getCreationTimestamp()); +// assertNull(remoteSubnetwork.getDescription()); +// assertNull(remoteSubnetwork.getGatewayAddress()); +// assertNull(remoteSubnetwork.getNetwork()); +// assertNull(remoteSubnetwork.getIpRange()); +// count++; +// } +// assertEquals(1, count); +// operation = subnetwork.delete(); +// operation.waitFor(); +// resourceCleaner.remove(subnetworkId); +// operation = compute.deleteNetwork(networkId); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getSubnetwork(subnetworkId)); +// assertNull(compute.getNetwork(networkName)); +// } +// +// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") +// @Test +// public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { +// String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; +// NetworkId networkId = NetworkId.of(networkName); +// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); +// Operation operation = compute.create(networkInfo); +// operation.waitFor(); +// resourceCleaner.add(networkId); +// String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; +// String[] regionNames = {"us-central1", "us-east1"}; +// String[] subnetworkNames = {prefix + "1", prefix + "2"}; +// String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; +// SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); +// SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); +// SubnetworkInfo firstSubnetworkInfo = +// SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); +// SubnetworkInfo secondSubnetworkInfo = +// SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); +// Operation firstOperation = compute.create(firstSubnetworkInfo); +// Operation secondOperation = compute.create(secondSubnetworkInfo); +// firstOperation.waitFor(); +// resourceCleaner.add(firstSubnetworkId); +// secondOperation.waitFor(); +// resourceCleaner.add(secondSubnetworkId); +// Set regionSet = ImmutableSet.copyOf(regionNames); +// Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); +// Set rangeSet = ImmutableSet.copyOf(ipRanges); +// Compute.SubnetworkFilter subnetworkFilter = +// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); +// Page subnetworkPage = +// compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); +// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); +// int count = 0; +// while (subnetworkIterator.hasNext()) { +// Subnetwork remoteSubnetwork = subnetworkIterator.next(); +// assertNotNull(remoteSubnetwork.getGeneratedId()); +// assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); +// assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); +// assertNotNull(remoteSubnetwork.getCreationTimestamp()); +// assertNotNull(remoteSubnetwork.getGatewayAddress()); +// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); +// assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); +// count++; +// } +// assertEquals(2, count); +// firstOperation = compute.deleteSubnetwork(firstSubnetworkId); +// secondOperation = compute.deleteSubnetwork(secondSubnetworkId); +// firstOperation.waitFor(); +// resourceCleaner.remove(firstSubnetworkId); +// secondOperation.waitFor(); +// resourceCleaner.remove(secondSubnetworkId); +// operation = compute.deleteNetwork(networkId); +// operation.waitFor(); +// resourceCleaner.remove(networkId); +// assertNull(compute.getSubnetwork(firstSubnetworkId)); +// assertNull(compute.getSubnetwork(secondSubnetworkId)); +// assertNull(compute.getNetwork(networkName)); +// } +// +// @Test +// public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; +// String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; +// // Create an address to assign to the instance +// AddressId addressId = RegionAddressId.of(REGION, addressName); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation operation = compute.create(addressInfo); +// operation.waitFor(); +// Address address = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// // Create an instance +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) +// .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() +// .setName("NAT") +// .setNatIp(address.getAddress()).build()) +// .build(); +// AttachedDisk disk1 = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// AttachedDisk disk2 = +// AttachedDisk.of("dev1", +// AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) +// .setAttachedDisks(disk1, disk2) +// .setNetworkInterfaces(networkInterface) +// .build(); +// operation = compute.create(instanceInfo); +// operation.waitFor(); +// // test get +// Instance remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); +// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); +// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); +// assertNotNull(remoteInstance.getCreationTimestamp()); +// Set deviceSet = ImmutableSet.of("dev0", "dev1"); +// assertEquals(2, remoteInstance.getAttachedDisks().size()); +// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { +// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); +// } +// assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, +// remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); +// AttachedDisk.PersistentDiskConfiguration remoteConfiguration = +// remoteInstance.getAttachedDisks().get(0).getConfiguration(); +// assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); +// assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); +// assertTrue(remoteConfiguration.boot()); +// assertTrue(remoteConfiguration.autoDelete()); +// assertEquals(1, remoteInstance.getNetworkInterfaces().size()); +// NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); +// assertNotNull(remoteNetworkInterface.getName()); +// assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); +// List remoteAccessConfigurations = +// remoteNetworkInterface.getAccessConfigurations(); +// assertNotNull(remoteAccessConfigurations); +// assertEquals(1, remoteAccessConfigurations.size()); +// NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); +// assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); +// assertEquals("NAT", remoteAccessConfig.getName()); +// assertNotNull(remoteInstance.getMetadata()); +// assertNotNull(remoteInstance.getTags()); +// // test get with selected fields +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); +// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); +// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); +// assertNull(remoteInstance.getMachineType()); +// assertNotNull(remoteInstance.getCreationTimestamp()); +// assertNull(remoteInstance.getAttachedDisks()); +// assertNull(remoteInstance.getNetworkInterfaces()); +// assertNull(remoteInstance.getMetadata()); +// assertNull(remoteInstance.getTags()); +// // test get default serial port output +// String serialPortOutput = remoteInstance.getSerialPortOutput(); +// assertNotNull(serialPortOutput); +// // test get serial port output by number +// String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); +// assertTrue(newSerialPortOutput.contains(serialPortOutput)); +// operation = remoteInstance.delete(); +// operation.waitFor(); +// resourceCleaner.remove(instanceId); +// assertNull(compute.getInstance(instanceId)); +// } +// +// @Test +// public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation operation = compute.create(instanceInfo); +// operation.waitFor(); +// Instance remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// resourceCleaner.add(instanceId); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// operation = remoteInstance.stop(); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); +// operation = remoteInstance.start(); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// operation = remoteInstance.reset(); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId, +// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); +// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); +// } +// +// @Test +// public void testSetInstanceProperties() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation operation = compute.create(instanceInfo); +// operation.waitFor(); +// Instance remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// // test set tags +// List tags = ImmutableList.of("tag1", "tag2"); +// operation = remoteInstance.setTags(tags); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(tags, remoteInstance.getTags().getValues()); +// // test set metadata +// Map metadata = ImmutableMap.of("key", "value"); +// operation = remoteInstance.setMetadata(metadata); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(metadata, remoteInstance.getMetadata().getValues()); +// // test set machine type +// operation = remoteInstance.stop(); +// operation.waitFor(); +// operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); +// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); +// // test set scheduling options +// SchedulingOptions options = +// SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); +// operation = remoteInstance.setSchedulingOptions(options); +// operation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(options, remoteInstance.getSchedulingOptions()); +// } +// +// @Test +// public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; +// String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation instanceOperation = compute.create(instanceInfo); +// DiskId diskId = DiskId.of(ZONE, diskName); +// Operation diskOperation = compute.create(DiskInfo.of(diskId, +// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); +// instanceOperation.waitFor(); +// diskOperation.waitFor(); +// resourceCleaner.add(diskId); +// Instance remoteInstance = compute.getInstance(instanceId); +// // test attach disk +// instanceOperation = remoteInstance.attachDisk("dev1", +// AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// Set deviceSet = ImmutableSet.of("dev0", "dev1"); +// assertEquals(2, remoteInstance.getAttachedDisks().size()); +// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { +// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); +// } +// // test set disk auto-delete +// instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(2, remoteInstance.getAttachedDisks().size()); +// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { +// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); +// assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); +// } +// // test detach disk +// instanceOperation = remoteInstance.detachDisk("dev1"); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertEquals(1, remoteInstance.getAttachedDisks().size()); +// assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); +// } +// +// @Test +// public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { +// String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; +// String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; +// InstanceId instanceId = InstanceId.of(ZONE, instanceName); +// NetworkId networkId = NetworkId.of("default"); +// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); +// AttachedDisk disk = AttachedDisk.of("dev0", +// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); +// InstanceInfo instanceInfo = +// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) +// .setAttachedDisks(disk) +// .setNetworkInterfaces(networkInterface) +// .build(); +// Operation instanceOperation = compute.create(instanceInfo); +// AddressId addressId = RegionAddressId.of(REGION, addressName); +// AddressInfo addressInfo = AddressInfo.of(addressId); +// Operation addressOperation = compute.create(addressInfo); +// addressOperation.waitFor(); +// instanceOperation.waitFor(); +// Address remoteAddress = compute.getAddress(addressId); +// resourceCleaner.add(addressId); +// Instance remoteInstance = compute.getInstance(instanceId); +// resourceCleaner.add(instanceId); +// String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); +// // test add access config +// NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() +// .setNatIp(remoteAddress.getAddress()) +// .setName("NAT") +// .build(); +// instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// List accessConfigurations = +// remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); +// assertEquals(1, accessConfigurations.size()); +// assertEquals("NAT", accessConfigurations.get(0).getName()); +// // test delete access config +// instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); +// instanceOperation.waitFor(); +// remoteInstance = compute.getInstance(instanceId); +// assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); +// } +// } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index 7f7fdb302c6a..96efa68744ce 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -68,7 +69,9 @@ public static void setUp() throws IOException { AddressSettings.newBuilder() .setTransportChannelProvider( AddressSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = AddressClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index f3f817d950fb..1e37d6697c45 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -72,7 +73,9 @@ public static void setUp() throws IOException { AutoscalerSettings.newBuilder() .setTransportChannelProvider( AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = AutoscalerClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index 5b13049c52eb..07c96cfa00ba 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -74,7 +75,9 @@ public static void setUp() throws IOException { BackendServiceSettings.newBuilder() .setTransportChannelProvider( BackendServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = BackendServiceClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 760e43db8927..59b447addd99 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -72,7 +73,9 @@ public static void setUp() throws IOException { DiskSettings.newBuilder() .setTransportChannelProvider( DiskSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = DiskClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java index 89f43ae63b96..edbd89e72741 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -64,7 +65,9 @@ public static void setUp() throws IOException { DiskTypeSettings.newBuilder() .setTransportChannelProvider( DiskTypeSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = DiskTypeClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java index 377d588a077e..1082ffb3705b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { FirewallSettings.newBuilder() .setTransportChannelProvider( FirewallSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = FirewallClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 4c234c164575..4d567934a89a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -70,7 +71,9 @@ public static void setUp() throws IOException { ForwardingRuleSettings.newBuilder() .setTransportChannelProvider( ForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = ForwardingRuleClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index 00690116af12..a72626516a79 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -65,7 +66,9 @@ public static void setUp() throws IOException { GlobalAddressSettings.newBuilder() .setTransportChannelProvider( GlobalAddressSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = GlobalAddressClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index 5b8d3f1edd6c..25fe6423bf3d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -67,7 +68,9 @@ public static void setUp() throws IOException { GlobalForwardingRuleSettings.newBuilder() .setTransportChannelProvider( GlobalForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = GlobalForwardingRuleClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java index f1121f00bca9..9c7f3b888813 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -66,7 +67,9 @@ public static void setUp() throws IOException { GlobalOperationSettings.newBuilder() .setTransportChannelProvider( GlobalOperationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = GlobalOperationClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java index f47186b76f6e..6c5a8db1794a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { HealthCheckSettings.newBuilder() .setTransportChannelProvider( HealthCheckSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = HealthCheckClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index bf32fe341053..f82d6bb2085c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { HttpHealthCheckSettings.newBuilder() .setTransportChannelProvider( HttpHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = HttpHealthCheckClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index 9691b191522f..0ebb0bc6a4cb 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { HttpsHealthCheckSettings.newBuilder() .setTransportChannelProvider( HttpsHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = HttpsHealthCheckClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index 582c099d7dbc..4c13f0164749 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { ImageSettings.newBuilder() .setTransportChannelProvider( ImageSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = ImageClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index 03ca422a4cf0..6fc689d5acd7 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -98,7 +99,9 @@ public static void setUp() throws IOException { InstanceSettings.newBuilder() .setTransportChannelProvider( InstanceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = InstanceClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index 73b463da77f0..dd661424888b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -77,7 +78,9 @@ public static void setUp() throws IOException { InstanceGroupSettings.newBuilder() .setTransportChannelProvider( InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = InstanceGroupClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index 8cfba1e0eff5..6ffc2d77c07c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -82,7 +83,9 @@ public static void setUp() throws IOException { InstanceGroupManagerSettings.newBuilder() .setTransportChannelProvider( InstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = InstanceGroupManagerClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index 1203b941f331..c75fa5b18bb9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -65,7 +66,9 @@ public static void setUp() throws IOException { InstanceTemplateSettings.newBuilder() .setTransportChannelProvider( InstanceTemplateSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = InstanceTemplateClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java index f135b2b80baa..8ce2dfa4adfd 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -58,7 +59,9 @@ public static void setUp() throws IOException { LicensSettings.newBuilder() .setTransportChannelProvider( LicensSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = LicensClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java index 0685e259222e..e06844c21fb1 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -64,7 +65,9 @@ public static void setUp() throws IOException { MachineTypeSettings.newBuilder() .setTransportChannelProvider( MachineTypeSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = MachineTypeClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java index 66c923824a01..5d717332f490 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -67,7 +68,9 @@ public static void setUp() throws IOException { NetworkSettings.newBuilder() .setTransportChannelProvider( NetworkSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = NetworkClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index d0c0f6696ed9..caa30cafec07 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -66,7 +67,9 @@ public static void setUp() throws IOException { ProjectSettings.newBuilder() .setTransportChannelProvider( ProjectSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = ProjectClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index 7c4a7f74f64f..12ef5fac2022 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { RegionAutoscalerSettings.newBuilder() .setTransportChannelProvider( RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RegionAutoscalerClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java index df86d985f875..c0c5387e4c47 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -71,7 +72,9 @@ public static void setUp() throws IOException { RegionBackendServiceSettings.newBuilder() .setTransportChannelProvider( RegionBackendServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RegionBackendServiceClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java index dc90e29233ed..0cd938a806c3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -61,7 +62,9 @@ public static void setUp() throws IOException { RegionSettings.newBuilder() .setTransportChannelProvider( RegionSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RegionClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java index 398e6cc4fbff..19280e440938 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -66,7 +67,9 @@ public static void setUp() throws IOException { RegionInstanceGroupSettings.newBuilder() .setTransportChannelProvider( RegionInstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RegionInstanceGroupClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index b6d7eef22c72..ea2893f3f750 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -79,7 +80,9 @@ public static void setUp() throws IOException { RegionInstanceGroupManagerSettings.newBuilder() .setTransportChannelProvider( RegionInstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RegionInstanceGroupManagerClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java index f7afaeae9997..89578e70cf28 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -63,7 +64,9 @@ public static void setUp() throws IOException { RegionOperationSettings.newBuilder() .setTransportChannelProvider( RegionOperationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RegionOperationClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java index ea08051ff041..0a031e82838e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -65,7 +66,9 @@ public static void setUp() throws IOException { RouteSettings.newBuilder() .setTransportChannelProvider( RouteSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RouteClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 34b491e236f9..3c04fb3c53e3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -76,7 +77,9 @@ public static void setUp() throws IOException { RouterSettings.newBuilder() .setTransportChannelProvider( RouterSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = RouterClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index b5629c0a148d..9f2757b9f6ad 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -63,7 +64,9 @@ public static void setUp() throws IOException { SnapshotSettings.newBuilder() .setTransportChannelProvider( SnapshotSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = SnapshotClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java index 688bf2d8e20c..42cd9cf6b4d9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -65,7 +66,9 @@ public static void setUp() throws IOException { SslCertificateSettings.newBuilder() .setTransportChannelProvider( SslCertificateSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = SslCertificateClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 942b5a3d300d..c54ad7c420ab 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -70,7 +71,9 @@ public static void setUp() throws IOException { SubnetworkSettings.newBuilder() .setTransportChannelProvider( SubnetworkSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = SubnetworkClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java index ac4c1b9d4f62..514e4f015346 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -67,7 +68,9 @@ public static void setUp() throws IOException { TargetHttpProxySettings.newBuilder() .setTransportChannelProvider( TargetHttpProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = TargetHttpProxyClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 0b0281ff8402..729d66ea67b9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -69,7 +70,9 @@ public static void setUp() throws IOException { TargetHttpsProxySettings.newBuilder() .setTransportChannelProvider( TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = TargetHttpsProxyClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java index 633e7c312570..6f4b1258f243 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -68,7 +69,9 @@ public static void setUp() throws IOException { TargetInstanceSettings.newBuilder() .setTransportChannelProvider( TargetInstanceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = TargetInstanceClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java index 0cbf3ddfed3a..c6a2a6169656 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -80,7 +81,9 @@ public static void setUp() throws IOException { TargetPoolSettings.newBuilder() .setTransportChannelProvider( TargetPoolSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = TargetPoolClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java index d89556886cfa..94ebdc834e5d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -71,7 +72,9 @@ public static void setUp() throws IOException { TargetSslProxySettings.newBuilder() .setTransportChannelProvider( TargetSslProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = TargetSslProxyClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java index 92a63d52aaaa..b6867eb03f6e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -68,7 +69,9 @@ public static void setUp() throws IOException { TargetVpnGatewaySettings.newBuilder() .setTransportChannelProvider( TargetVpnGatewaySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = TargetVpnGatewayClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java index 297ffcada731..9dc527b50b5b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -73,7 +74,9 @@ public static void setUp() throws IOException { UrlMapSettings.newBuilder() .setTransportChannelProvider( UrlMapSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = UrlMapClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java index e4f730024484..251e92a45968 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -68,7 +69,9 @@ public static void setUp() throws IOException { VpnTunnelSettings.newBuilder() .setTransportChannelProvider( VpnTunnelSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = VpnTunnelClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java index 8c9bf5106a81..ac87bd38b760 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -61,7 +62,9 @@ public static void setUp() throws IOException { ZoneSettings.newBuilder() .setTransportChannelProvider( ZoneSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = ZoneClient.create(clientSettings); } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java index b05aefd1c2e3..f3315753f23a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java @@ -15,6 +15,7 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; import com.google.api.gax.httpjson.testing.MockHttpService; @@ -63,7 +64,9 @@ public static void setUp() throws IOException { ZoneOperationSettings.newBuilder() .setTransportChannelProvider( ZoneOperationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()).build(); + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); client = ZoneOperationClient.create(clientSettings); } From 5d19543e6feb7ab851386be88c6cfcc77bc6571f Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 29 Mar 2018 12:40:46 -0700 Subject: [PATCH 06/42] formatted --- .../v1/DeleteHealthCheckHttpRequest.java | 90 +-- .../v1/DeleteHttpHealthCheckHttpRequest.java | 90 +-- .../compute/v1/DeleteRouteHttpRequest.java | 91 +-- .../cloud/compute/v1/FirewallClient.java | 260 +++--- .../compute/v1/InstanceTemplateClient.java | 310 +++---- .../v1/RegionInstanceGroupManagerClient.java | 760 ++++++++++++------ ...ionInstanceGroupsListInstancesRequest.java | 41 +- .../cloud/compute/v1/SslCertificateName.java | 60 +- .../cloud/compute/v1/SubnetworkClient.java | 355 ++++---- .../SwitchToCustomModeNetworkHttpRequest.java | 90 +-- .../compute/v1/TargetHttpsProxyList.java | 68 +- .../v1/TargetVpnGatewaysScopedList.java | 39 +- .../compute/v1/ZoneOperationSettings.java | 140 ++-- .../cloud/compute/v1/ProjectClientTest.java | 360 +++++---- 14 files changed, 1466 insertions(+), 1288 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java index ab670b41018e..98487512c151 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteHealthCheckHttpRequest() { this.userIp = null; } - private DeleteHealthCheckHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteHealthCheckHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteHealthCheckHttpRequest build() { String missing = ""; - - if (healthCheck == null) { missing += " healthCheck"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteHealthCheckHttpRequest( - access_token, - callback, - fields, - healthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, healthCheck, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "healthCheck=" + healthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "healthCheck=" + + healthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteHealthCheckHttpRequest) { DeleteHealthCheckHttpRequest that = (DeleteHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.healthCheck, that.getHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - healthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, healthCheck, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java index 28ddcccf70d7..fb54a346295e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteHttpHealthCheckHttpRequest() { this.userIp = null; } - private DeleteHttpHealthCheckHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteHttpHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteHttpHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteHttpHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteHttpHealthCheckHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteHttpHealthCheckHttpRequest build() { String missing = ""; - - if (httpHealthCheck == null) { missing += " httpHealthCheck"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteHttpHealthCheckHttpRequest( - access_token, - callback, - fields, - httpHealthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, httpHealthCheck, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteHttpHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpHealthCheck=" + httpHealthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpHealthCheck=" + + httpHealthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteHttpHealthCheckHttpRequest) { DeleteHttpHealthCheckHttpRequest that = (DeleteHttpHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpHealthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, httpHealthCheck, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java index 8fc8751b6256..1a2c3fbb4a27 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteRouteHttpRequest() { this.userIp = null; } - private DeleteRouteHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteRouteHttpRequest( String prettyPrint, String quotaUser, String route, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRouteHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRouteHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRouteHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRouteHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRouteHttpRequest build() { String missing = ""; - - - - - if (route == null) { missing += " route"; } @@ -331,15 +322,7 @@ public DeleteRouteHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRouteHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - route, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, route, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteRouteHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "route=" + route + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "route=" + + route + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,31 +375,20 @@ public boolean equals(Object o) { } if (o instanceof DeleteRouteHttpRequest) { DeleteRouteHttpRequest that = (DeleteRouteHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.route, that.getRoute()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.route, that.getRoute()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @Override public int hashCode() { - return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - route, - userIp - ); + return Objects.hash(access_token, callback, fields, key, prettyPrint, quotaUser, route, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java index c1a943db3666..5e8c3bb98905 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.FirewallStub; import com.google.cloud.compute.v1.stub.FirewallStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,33 @@ * * * - *

Note: close() needs to be called on the firewallClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the firewallClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of FirewallSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of FirewallSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +104,14 @@ public class FirewallClient implements BackgroundResource {
   private final FirewallSettings settings;
   private final FirewallStub stub;
 
-
-
-  /**
-   * Constructs an instance of FirewallClient with default settings.
-   */
+  /** Constructs an instance of FirewallClient with default settings. */
   public static final FirewallClient create() throws IOException {
     return create(FirewallSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of FirewallClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of FirewallClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final FirewallClient create(FirewallSettings settings) throws IOException {
     return new FirewallClient(settings);
@@ -143,9 +127,8 @@ public static final FirewallClient create(FirewallStub stub) {
   }
 
   /**
-   * Constructs an instance of FirewallClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of FirewallClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected FirewallClient(FirewallSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +150,12 @@ public FirewallStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -188,8 +171,8 @@ public final Operation deleteFirewall(FirewallName firewall) {
 
     DeleteFirewallHttpRequest request =
         DeleteFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall == null ? null : firewall.toString())
-        .build();
+            .setFirewall(firewall == null ? null : firewall.toString())
+            .build();
     return deleteFirewall(request);
   }
 
@@ -197,7 +180,8 @@ public final Operation deleteFirewall(FirewallName firewall) {
   /**
    * Deletes the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -212,9 +196,7 @@ public final Operation deleteFirewall(FirewallName firewall) {
   public final Operation deleteFirewall(String firewall) {
 
     DeleteFirewallHttpRequest request =
-        DeleteFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall)
-        .build();
+        DeleteFirewallHttpRequest.newBuilder().setFirewall(firewall).build();
     return deleteFirewall(request);
   }
 
@@ -222,7 +204,8 @@ public final Operation deleteFirewall(String firewall) {
   /**
    * Deletes the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -245,7 +228,8 @@ public final Operation deleteFirewall(DeleteFirewallHttpRequest request) {
   /**
    * Deletes the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -267,7 +251,8 @@ public final UnaryCallable deleteFirewallC
   /**
    * Returns the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -283,8 +268,8 @@ public final Firewall getFirewall(FirewallName firewall) {
 
     GetFirewallHttpRequest request =
         GetFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall == null ? null : firewall.toString())
-        .build();
+            .setFirewall(firewall == null ? null : firewall.toString())
+            .build();
     return getFirewall(request);
   }
 
@@ -292,7 +277,8 @@ public final Firewall getFirewall(FirewallName firewall) {
   /**
    * Returns the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -307,9 +293,7 @@ public final Firewall getFirewall(FirewallName firewall) {
   public final Firewall getFirewall(String firewall) {
 
     GetFirewallHttpRequest request =
-        GetFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall)
-        .build();
+        GetFirewallHttpRequest.newBuilder().setFirewall(firewall).build();
     return getFirewall(request);
   }
 
@@ -317,7 +301,8 @@ public final Firewall getFirewall(String firewall) {
   /**
    * Returns the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -340,7 +325,8 @@ public final Firewall getFirewall(GetFirewallHttpRequest request) {
   /**
    * Returns the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -362,7 +348,8 @@ public final UnaryCallable getFirewallCallable
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -380,9 +367,9 @@ public final Operation insertFirewall(ProjectName project, Firewall firewallReso
 
     InsertFirewallHttpRequest request =
         InsertFirewallHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .setFirewallResource(firewallResource)
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .setFirewallResource(firewallResource)
+            .build();
     return insertFirewall(request);
   }
 
@@ -390,7 +377,8 @@ public final Operation insertFirewall(ProjectName project, Firewall firewallReso
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -408,9 +396,9 @@ public final Operation insertFirewall(String project, Firewall firewallResource)
 
     InsertFirewallHttpRequest request =
         InsertFirewallHttpRequest.newBuilder()
-        .setProject(project)
-        .setFirewallResource(firewallResource)
-        .build();
+            .setProject(project)
+            .setFirewallResource(firewallResource)
+            .build();
     return insertFirewall(request);
   }
 
@@ -418,7 +406,8 @@ public final Operation insertFirewall(String project, Firewall firewallResource)
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -443,7 +432,8 @@ public final Operation insertFirewall(InsertFirewallHttpRequest request) {
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -467,7 +457,8 @@ public final UnaryCallable insertFirewallC
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -484,8 +475,8 @@ public final UnaryCallable insertFirewallC
   public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
     ListFirewallsHttpRequest request =
         ListFirewallsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listFirewalls(request);
   }
 
@@ -493,7 +484,8 @@ public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -509,9 +501,7 @@ public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
   @BetaApi
   public final ListFirewallsPagedResponse listFirewalls(String project) {
     ListFirewallsHttpRequest request =
-        ListFirewallsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListFirewallsHttpRequest.newBuilder().setProject(project).build();
     return listFirewalls(request);
   }
 
@@ -519,7 +509,8 @@ public final ListFirewallsPagedResponse listFirewalls(String project) {
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -537,15 +528,15 @@ public final ListFirewallsPagedResponse listFirewalls(String project) {
    */
   @BetaApi
   public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest request) {
-    return listFirewallsPagedCallable()
-        .call(request);
+    return listFirewallsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -561,7 +552,8 @@ public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable listFirewallsPagedCallable() { + public final UnaryCallable + listFirewallsPagedCallable() { return stub.listFirewallsPagedCallable(); } @@ -569,7 +561,8 @@ public final UnaryCallable /** * Retrieves the list of firewall rules available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,9 +591,11 @@ public final UnaryCallable listFirewalls
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. This method supports patch semantics.
+   * Updates the specified firewall rule with the data included in the request. This method supports
+   * patch semantics.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -618,17 +613,19 @@ public final Operation patchFirewall(FirewallName firewall, Firewall firewallRes
 
     PatchFirewallHttpRequest request =
         PatchFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall == null ? null : firewall.toString())
-        .setFirewallResource(firewallResource)
-        .build();
+            .setFirewall(firewall == null ? null : firewall.toString())
+            .setFirewallResource(firewallResource)
+            .build();
     return patchFirewall(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. This method supports patch semantics.
+   * Updates the specified firewall rule with the data included in the request. This method supports
+   * patch semantics.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -646,17 +643,19 @@ public final Operation patchFirewall(String firewall, Firewall firewallResource)
 
     PatchFirewallHttpRequest request =
         PatchFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall)
-        .setFirewallResource(firewallResource)
-        .build();
+            .setFirewall(firewall)
+            .setFirewallResource(firewallResource)
+            .build();
     return patchFirewall(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. This method supports patch semantics.
+   * Updates the specified firewall rule with the data included in the request. This method supports
+   * patch semantics.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -679,9 +678,11 @@ public final Operation patchFirewall(PatchFirewallHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. This method supports patch semantics.
+   * Updates the specified firewall rule with the data included in the request. This method supports
+   * patch semantics.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -705,7 +706,8 @@ public final UnaryCallable patchFirewallCal
   /**
    * Updates the specified firewall rule with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -723,9 +725,9 @@ public final Operation updateFirewall(FirewallName firewall, Firewall firewallRe
 
     UpdateFirewallHttpRequest request =
         UpdateFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall == null ? null : firewall.toString())
-        .setFirewallResource(firewallResource)
-        .build();
+            .setFirewall(firewall == null ? null : firewall.toString())
+            .setFirewallResource(firewallResource)
+            .build();
     return updateFirewall(request);
   }
 
@@ -733,7 +735,8 @@ public final Operation updateFirewall(FirewallName firewall, Firewall firewallRe
   /**
    * Updates the specified firewall rule with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -751,9 +754,9 @@ public final Operation updateFirewall(String firewall, Firewall firewallResource
 
     UpdateFirewallHttpRequest request =
         UpdateFirewallHttpRequest.newBuilder()
-        .setFirewall(firewall)
-        .setFirewallResource(firewallResource)
-        .build();
+            .setFirewall(firewall)
+            .setFirewallResource(firewallResource)
+            .build();
     return updateFirewall(request);
   }
 
@@ -761,7 +764,8 @@ public final Operation updateFirewall(String firewall, Firewall firewallResource
   /**
    * Updates the specified firewall rule with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -786,7 +790,8 @@ public final Operation updateFirewall(UpdateFirewallHttpRequest request) {
   /**
    * Updates the specified firewall rule with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -836,12 +841,13 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListFirewallsPagedResponse extends AbstractPagedListResponse<
-      ListFirewallsHttpRequest,
-      FirewallList,
-      Firewall,
-      ListFirewallsPage,
-      ListFirewallsFixedSizeCollection> {
+  public static class ListFirewallsPagedResponse
+      extends AbstractPagedListResponse<
+          ListFirewallsHttpRequest,
+          FirewallList,
+          Firewall,
+          ListFirewallsPage,
+          ListFirewallsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -861,15 +867,10 @@ public ListFirewallsPagedResponse apply(ListFirewallsPage input) {
     private ListFirewallsPagedResponse(ListFirewallsPage page) {
       super(page, ListFirewallsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListFirewallsPage extends AbstractPage<
-      ListFirewallsHttpRequest,
-      FirewallList,
-      Firewall,
-      ListFirewallsPage> {
+  public static class ListFirewallsPage
+      extends AbstractPage {
 
     private ListFirewallsPage(
         PageContext context,
@@ -894,18 +895,15 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListFirewallsFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListFirewallsHttpRequest,
-      FirewallList,
-      Firewall,
-      ListFirewallsPage,
-      ListFirewallsFixedSizeCollection> {
+  public static class ListFirewallsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListFirewallsHttpRequest,
+          FirewallList,
+          Firewall,
+          ListFirewallsPage,
+          ListFirewallsFixedSizeCollection> {
 
     private ListFirewallsFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -920,7 +918,5 @@ protected ListFirewallsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListFirewallsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
index 363bdadfeb34..4aa7c21ca504 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
@@ -23,22 +23,12 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
-import com.google.api.gax.paging.FixedSizeCollection;
-import com.google.api.gax.paging.Page;
-import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.InstanceTemplateStub;
 import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import java.io.Closeable;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -58,34 +48,34 @@
  * 
  * 
* - *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of InstanceTemplateSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class InstanceTemplateClient implements BackgroundResource {
   private final InstanceTemplateSettings settings;
   private final InstanceTemplateStub stub;
 
-
-
-  /**
-   * Constructs an instance of InstanceTemplateClient with default settings.
-   */
+  /** Constructs an instance of InstanceTemplateClient with default settings. */
   public static final InstanceTemplateClient create() throws IOException {
     return create(InstanceTemplateSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InstanceTemplateClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InstanceTemplateClient create(InstanceTemplateSettings settings) throws IOException {
+  public static final InstanceTemplateClient create(InstanceTemplateSettings settings)
+      throws IOException {
     return new InstanceTemplateClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InstanceTemplateSettings}.
+   * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use InstanceTemplateSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceTemplateClient create(InstanceTemplateStub stub) {
@@ -143,9 +129,9 @@ public static final InstanceTemplateClient create(InstanceTemplateStub stub) {
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InstanceTemplateClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected InstanceTemplateClient(InstanceTemplateSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,15 @@ public InstanceTemplateStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.
+   * Deletes the specified instance template. If you delete an instance template that is being
+   * referenced from another instance group, the instance group will not be able to create or
+   * recreate virtual machine instances. Deleting an instance template is permanent and cannot be
+   * undone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -188,16 +177,20 @@ public final Operation deleteInstanceTemplate(InstanceTemplateName instanceTempl
 
     DeleteInstanceTemplateHttpRequest request =
         DeleteInstanceTemplateHttpRequest.newBuilder()
-        .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString())
-        .build();
+            .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString())
+            .build();
     return deleteInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.
+   * Deletes the specified instance template. If you delete an instance template that is being
+   * referenced from another instance group, the instance group will not be able to create or
+   * recreate virtual machine instances. Deleting an instance template is permanent and cannot be
+   * undone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -213,16 +206,20 @@ public final Operation deleteInstanceTemplate(String instanceTemplate) {
 
     DeleteInstanceTemplateHttpRequest request =
         DeleteInstanceTemplateHttpRequest.newBuilder()
-        .setInstanceTemplate(instanceTemplate)
-        .build();
+            .setInstanceTemplate(instanceTemplate)
+            .build();
     return deleteInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.
+   * Deletes the specified instance template. If you delete an instance template that is being
+   * referenced from another instance group, the instance group will not be able to create or
+   * recreate virtual machine instances. Deleting an instance template is permanent and cannot be
+   * undone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -243,9 +240,13 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.
+   * Deletes the specified instance template. If you delete an instance template that is being
+   * referenced from another instance group, the instance group will not be able to create or
+   * recreate virtual machine instances. Deleting an instance template is permanent and cannot be
+   * undone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -259,15 +260,18 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteInstanceTemplateCallable() { + public final UnaryCallable + deleteInstanceTemplateCallable() { return stub.deleteInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * Returns the specified instance template. Get a list of available instance templates by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -283,16 +287,18 @@ public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceT
 
     GetInstanceTemplateHttpRequest request =
         GetInstanceTemplateHttpRequest.newBuilder()
-        .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString())
-        .build();
+            .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString())
+            .build();
     return getInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a list() request.
+   * Returns the specified instance template. Get a list of available instance templates by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -307,17 +313,17 @@ public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceT
   public final InstanceTemplate getInstanceTemplate(String instanceTemplate) {
 
     GetInstanceTemplateHttpRequest request =
-        GetInstanceTemplateHttpRequest.newBuilder()
-        .setInstanceTemplate(instanceTemplate)
-        .build();
+        GetInstanceTemplateHttpRequest.newBuilder().setInstanceTemplate(instanceTemplate).build();
     return getInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a list() request.
+   * Returns the specified instance template. Get a list of available instance templates by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -338,9 +344,11 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a list() request.
+   * Returns the specified instance template. Get a list of available instance templates by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -354,15 +362,20 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable getInstanceTemplateCallable() { + public final UnaryCallable + getInstanceTemplateCallable() { return stub.getInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -376,21 +389,26 @@ public final UnaryCallable get
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertInstanceTemplate(ProjectName project, InstanceTemplate instanceTemplateResource) {
+  public final Operation insertInstanceTemplate(
+      ProjectName project, InstanceTemplate instanceTemplateResource) {
 
     InsertInstanceTemplateHttpRequest request =
         InsertInstanceTemplateHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .setInstanceTemplateResource(instanceTemplateResource)
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .setInstanceTemplateResource(instanceTemplateResource)
+            .build();
     return insertInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -404,21 +422,26 @@ public final Operation insertInstanceTemplate(ProjectName project, InstanceTempl
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertInstanceTemplate(String project, InstanceTemplate instanceTemplateResource) {
+  public final Operation insertInstanceTemplate(
+      String project, InstanceTemplate instanceTemplateResource) {
 
     InsertInstanceTemplateHttpRequest request =
         InsertInstanceTemplateHttpRequest.newBuilder()
-        .setProject(project)
-        .setInstanceTemplateResource(instanceTemplateResource)
-        .build();
+            .setProject(project)
+            .setInstanceTemplateResource(instanceTemplateResource)
+            .build();
     return insertInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -441,9 +464,13 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -459,15 +486,18 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertInstanceTemplateCallable() { + public final UnaryCallable + insertInstanceTemplateCallable() { return stub.insertInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of instance templates that are contained within the specified project and zone. + * Retrieves a list of instance templates that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -484,16 +514,18 @@ public final UnaryCallable insertI
   public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectName project) {
     ListInstanceTemplatesHttpRequest request =
         ListInstanceTemplatesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listInstanceTemplates(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and zone.
+   * Retrieves a list of instance templates that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -509,17 +541,17 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectNam
   @BetaApi
   public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String project) {
     ListInstanceTemplatesHttpRequest request =
-        ListInstanceTemplatesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListInstanceTemplatesHttpRequest.newBuilder().setProject(project).build();
     return listInstanceTemplates(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and zone.
+   * Retrieves a list of instance templates that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -536,16 +568,18 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String pro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ListInstanceTemplatesHttpRequest request) {
-    return listInstanceTemplatesPagedCallable()
-        .call(request);
+  public final ListInstanceTemplatesPagedResponse listInstanceTemplates(
+      ListInstanceTemplatesHttpRequest request) {
+    return listInstanceTemplatesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and zone.
+   * Retrieves a list of instance templates that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -561,15 +595,18 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ListInstan
    * 
*/ @BetaApi - public final UnaryCallable listInstanceTemplatesPagedCallable() { + public final UnaryCallable + listInstanceTemplatesPagedCallable() { return stub.listInstanceTemplatesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of instance templates that are contained within the specified project and zone. + * Retrieves a list of instance templates that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -592,7 +629,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstanceTemplatesCallable() { + public final UnaryCallable + listInstanceTemplatesCallable() { return stub.listInstanceTemplatesCallable(); } @@ -626,15 +664,17 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListInstanceTemplatesPagedResponse extends AbstractPagedListResponse< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage, - ListInstanceTemplatesFixedSizeCollection> { + public static class ListInstanceTemplatesPagedResponse + extends AbstractPagedListResponse< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage, + ListInstanceTemplatesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstanceTemplatesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -651,18 +691,18 @@ public ListInstanceTemplatesPagedResponse apply(ListInstanceTemplatesPage input) private ListInstanceTemplatesPagedResponse(ListInstanceTemplatesPage page) { super(page, ListInstanceTemplatesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstanceTemplatesPage extends AbstractPage< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage> { + public static class ListInstanceTemplatesPage + extends AbstractPage< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage> { private ListInstanceTemplatesPage( - PageContext context, + PageContext + context, InstanceTemplateList response) { super(context, response); } @@ -673,31 +713,31 @@ private static ListInstanceTemplatesPage createEmptyPage() { @Override protected ListInstanceTemplatesPage createPage( - PageContext context, + PageContext + context, InstanceTemplateList response) { return new ListInstanceTemplatesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstanceTemplatesFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage, - ListInstanceTemplatesFixedSizeCollection> { + public static class ListInstanceTemplatesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage, + ListInstanceTemplatesFixedSizeCollection> { - private ListInstanceTemplatesFixedSizeCollection(List pages, int collectionSize) { + private ListInstanceTemplatesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -710,7 +750,5 @@ protected ListInstanceTemplatesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceTemplatesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java index 149a1120ff04..50a2ee0af749 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStub; import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,34 @@ * *
* - *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of RegionInstanceGroupManagerSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of + * RegionInstanceGroupManagerSettings to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,24 @@ public class RegionInstanceGroupManagerClient implements BackgroundResource {
   private final RegionInstanceGroupManagerSettings settings;
   private final RegionInstanceGroupManagerStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionInstanceGroupManagerClient with default settings.
-   */
+  /** Constructs an instance of RegionInstanceGroupManagerClient with default settings. */
   public static final RegionInstanceGroupManagerClient create() throws IOException {
     return create(RegionInstanceGroupManagerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. The
+   * channels are created based on the settings passed in, or defaults for any settings that are not
+   * set.
    */
-  public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerSettings settings) throws IOException {
+  public static final RegionInstanceGroupManagerClient create(
+      RegionInstanceGroupManagerSettings settings) throws IOException {
     return new RegionInstanceGroupManagerClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionInstanceGroupManagerSettings}.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making
+   * calls. This is for advanced usage - prefer to use RegionInstanceGroupManagerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerStub stub) {
@@ -144,11 +131,12 @@ public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupM
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
-  protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings) throws IOException {
+  protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings)
+      throws IOException {
     this.settings = settings;
     this.stub = ((RegionInstanceGroupManagerStubSettings) settings.getStubSettings()).createStub();
   }
@@ -168,12 +156,18 @@ public RegionInstanceGroupManagerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -187,21 +181,33 @@ public RegionInstanceGroupManagerStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) {
+  public final Operation abandonInstancesRegionInstanceGroupManager(
+      ProjectRegionInstanceGroupManagerName instanceGroupManager,
+      RegionInstanceGroupManagersAbandonInstancesRequest
+          regionInstanceGroupManagersAbandonInstancesRequestResource) {
 
     AbandonInstancesRegionInstanceGroupManagerHttpRequest request =
         AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
-        .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(
+                instanceGroupManager == null ? null : instanceGroupManager.toString())
+            .setRegionInstanceGroupManagersAbandonInstancesRequestResource(
+                regionInstanceGroupManagersAbandonInstancesRequestResource)
+            .build();
     return abandonInstancesRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -215,21 +221,32 @@ public final Operation abandonInstancesRegionInstanceGroupManager(ProjectRegionI
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) {
+  public final Operation abandonInstancesRegionInstanceGroupManager(
+      String instanceGroupManager,
+      RegionInstanceGroupManagersAbandonInstancesRequest
+          regionInstanceGroupManagersAbandonInstancesRequestResource) {
 
     AbandonInstancesRegionInstanceGroupManagerHttpRequest request =
         AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setRegionInstanceGroupManagersAbandonInstancesRequestResource(
+                regionInstanceGroupManagersAbandonInstancesRequestResource)
+            .build();
     return abandonInstancesRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -246,15 +263,23 @@ public final Operation abandonInstancesRegionInstanceGroupManager(String instanc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation abandonInstancesRegionInstanceGroupManager(
+      AbandonInstancesRegionInstanceGroupManagerHttpRequest request) {
     return abandonInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -270,7 +295,8 @@ public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstanc
    * 
*/ @BetaApi - public final UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable + abandonInstancesRegionInstanceGroupManagerCallable() { return stub.abandonInstancesRegionInstanceGroupManagerCallable(); } @@ -278,7 +304,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -290,12 +317,14 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -319,8 +349,8 @@ public final Operation deleteRegionInstanceGroupManager(String instanceGroupMana
 
     DeleteRegionInstanceGroupManagerHttpRequest request =
         DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return deleteRegionInstanceGroupManager(request);
   }
 
@@ -328,7 +358,8 @@ public final Operation deleteRegionInstanceGroupManager(String instanceGroupMana
   /**
    * Deletes the specified managed instance group and all of the instances in that group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -343,7 +374,8 @@ public final Operation deleteRegionInstanceGroupManager(String instanceGroupMana
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteRegionInstanceGroupManager(
+      DeleteRegionInstanceGroupManagerHttpRequest request) {
     return deleteRegionInstanceGroupManagerCallable().call(request);
   }
 
@@ -351,7 +383,8 @@ public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGrou
   /**
    * Deletes the specified managed instance group and all of the instances in that group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -365,15 +398,22 @@ public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable deleteRegionInstanceGroupManagerCallable() { + public final UnaryCallable + deleteRegionInstanceGroupManagerCallable() { return stub.deleteRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -387,21 +427,32 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -415,21 +466,31 @@ public final Operation deleteInstancesRegionInstanceGroupManager(ProjectRegionIn
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) {
+  public final Operation deleteInstancesRegionInstanceGroupManager(
+      String instanceGroupManager,
+      RegionInstanceGroupManagersDeleteInstancesRequest
+          regionInstanceGroupManagersDeleteInstancesRequestResource) {
 
     DeleteInstancesRegionInstanceGroupManagerHttpRequest request =
         DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setRegionInstanceGroupManagersDeleteInstancesRequestResource(
+                regionInstanceGroupManagersDeleteInstancesRequestResource)
+            .build();
     return deleteInstancesRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -446,15 +507,22 @@ public final Operation deleteInstancesRegionInstanceGroupManager(String instance
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteInstancesRegionInstanceGroupManager(
+      DeleteInstancesRegionInstanceGroupManagerHttpRequest request) {
     return deleteInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -470,7 +538,8 @@ public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstances
    * 
*/ @BetaApi - public final UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable + deleteInstancesRegionInstanceGroupManagerCallable() { return stub.deleteInstancesRegionInstanceGroupManagerCallable(); } @@ -478,7 +547,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -490,12 +560,14 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -519,8 +592,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
 
     GetRegionInstanceGroupManagerHttpRequest request =
         GetRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return getRegionInstanceGroupManager(request);
   }
 
@@ -528,7 +601,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -543,7 +617,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanceGroupManagerHttpRequest request) {
+  public final InstanceGroupManager getRegionInstanceGroupManager(
+      GetRegionInstanceGroupManagerHttpRequest request) {
     return getRegionInstanceGroupManagerCallable().call(request);
   }
 
@@ -551,7 +626,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanc
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -565,15 +641,21 @@ public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanc
    * 
*/ @BetaApi - public final UnaryCallable getRegionInstanceGroupManagerCallable() { + public final UnaryCallable + getRegionInstanceGroupManagerCallable() { return stub.getRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -587,21 +669,27 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -615,21 +703,27 @@ public final Operation insertRegionInstanceGroupManager(RegionName region, Insta
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertRegionInstanceGroupManager(String region, InstanceGroupManager instanceGroupManagerResource) {
+  public final Operation insertRegionInstanceGroupManager(
+      String region, InstanceGroupManager instanceGroupManagerResource) {
 
     InsertRegionInstanceGroupManagerHttpRequest request =
         InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setRegion(region)
-        .setInstanceGroupManagerResource(instanceGroupManagerResource)
-        .build();
+            .setRegion(region)
+            .setInstanceGroupManagerResource(instanceGroupManagerResource)
+            .build();
     return insertRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After
+   * the group is created, it schedules an action to create instances in the group 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -646,15 +740,21 @@ public final Operation insertRegionInstanceGroupManager(String region, InstanceG
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation insertRegionInstanceGroupManager(
+      InsertRegionInstanceGroupManagerHttpRequest request) {
     return insertRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After
+   * the group is created, it schedules an action to create instances in the group 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -670,7 +770,8 @@ public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable insertRegionInstanceGroupManagerCallable() { + public final UnaryCallable + insertRegionInstanceGroupManagerCallable() { return stub.insertRegionInstanceGroupManagerCallable(); } @@ -678,7 +779,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -692,11 +794,12 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -718,11 +822,10 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(String region) {
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
+      String region) {
     ListRegionInstanceGroupManagersHttpRequest request =
-        ListRegionInstanceGroupManagersHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionInstanceGroupManagersHttpRequest.newBuilder().setRegion(region).build();
     return listRegionInstanceGroupManagers(request);
   }
 
@@ -730,7 +833,8 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -747,16 +851,17 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(ListRegionInstanceGroupManagersHttpRequest request) {
-    return listRegionInstanceGroupManagersPagedCallable()
-        .call(request);
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
+      ListRegionInstanceGroupManagersHttpRequest request) {
+    return listRegionInstanceGroupManagersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -772,7 +877,9 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable listRegionInstanceGroupManagersPagedCallable() { + public final UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersPagedCallable() { return stub.listRegionInstanceGroupManagersPagedCallable(); } @@ -780,7 +887,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -803,15 +911,19 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionInstanceGroupManagersCallable() { + public final UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList> + listRegionInstanceGroupManagersCallable() { return stub.listRegionInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -823,20 +935,25 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -848,20 +965,23 @@ public final RegionInstanceGroupManagersListInstancesResponse listManagedInstanc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) {
+  public final RegionInstanceGroupManagersListInstancesResponse
+      listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) {
 
     ListManagedInstancesRegionInstanceGroupManagersHttpRequest request =
         ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return listManagedInstancesRegionInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -876,15 +996,19 @@ public final RegionInstanceGroupManagersListInstancesResponse listManagedInstanc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) {
+  public final RegionInstanceGroupManagersListInstancesResponse
+      listManagedInstancesRegionInstanceGroupManagers(
+          ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) {
     return listManagedInstancesRegionInstanceGroupManagersCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -898,15 +1022,23 @@ public final RegionInstanceGroupManagersListInstancesResponse listManagedInstanc
    * 
*/ @BetaApi - public final UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { + public final UnaryCallable< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersCallable() { return stub.listManagedInstancesRegionInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * action with the listmanagedinstances method. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -920,21 +1052,31 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -948,21 +1090,30 @@ public final Operation recreateInstancesRegionInstanceGroupManager(ProjectRegion
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) {
+  public final Operation recreateInstancesRegionInstanceGroupManager(
+      String instanceGroupManager,
+      RegionInstanceGroupManagersRecreateRequest
+          regionInstanceGroupManagersRecreateRequestResource) {
 
     RecreateInstancesRegionInstanceGroupManagerHttpRequest request =
         RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setRegionInstanceGroupManagersRecreateRequestResource(
+                regionInstanceGroupManagersRecreateRequestResource)
+            .build();
     return recreateInstancesRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The
+   * instances are deleted and recreated using the current instance template for the managed
+   * instance group. This operation is marked as DONE when the action is scheduled even if the
+   * instances have not yet been recreated. You must separately verify the status of the recreating
+   * action with the listmanagedinstances method.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -979,15 +1130,21 @@ public final Operation recreateInstancesRegionInstanceGroupManager(String instan
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation recreateInstancesRegionInstanceGroupManager(
+      RecreateInstancesRegionInstanceGroupManagerHttpRequest request) {
     return recreateInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The
+   * instances are deleted and recreated using the current instance template for the managed
+   * instance group. This operation is marked as DONE when the action is scheduled even if the
+   * instances have not yet been recreated. You must separately verify the status of the recreating
+   * action with the listmanagedinstances method.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1003,15 +1160,22 @@ public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInsta
    * 
*/ @BetaApi - public final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable + recreateInstancesRegionInstanceGroupManagerCallable() { return stub.recreateInstancesRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group + * schedules actions to create new instances using the current instance template. If you decrease + * the size, the group schedules delete actions on one or more 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1025,21 +1189,29 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1053,21 +1225,28 @@ public final Operation resizeRegionInstanceGroupManager(Integer size, ProjectReg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation resizeRegionInstanceGroupManager(Integer size, String instanceGroupManager) {
+  public final Operation resizeRegionInstanceGroupManager(
+      Integer size, String instanceGroupManager) {
 
     ResizeRegionInstanceGroupManagerHttpRequest request =
         ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setSize(size)
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setSize(size)
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return resizeRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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.
+   * Changes the intended size for the managed instance group. If you increase the size, the group
+   * schedules actions to create new instances using the current instance template. If you decrease
+   * the size, the group schedules delete actions on one or more 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1084,15 +1263,22 @@ public final Operation resizeRegionInstanceGroupManager(Integer size, String ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation resizeRegionInstanceGroupManager(
+      ResizeRegionInstanceGroupManagerHttpRequest request) {
     return resizeRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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.
+   * Changes the intended size for the managed instance group. If you increase the size, the group
+   * schedules actions to create new instances using the current instance template. If you decrease
+   * the size, the group schedules delete actions on one or more 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1108,15 +1294,18 @@ public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable resizeRegionInstanceGroupManagerCallable() { + public final UnaryCallable + resizeRegionInstanceGroupManagerCallable() { return stub.resizeRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * Sets the instance template to use when creating new instances or recreating instances in this + * group. Existing instances are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1130,21 +1319,28 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1158,21 +1354,27 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(ProjectRegi
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) {
+  public final Operation setInstanceTemplateRegionInstanceGroupManager(
+      String instanceGroupManager,
+      RegionInstanceGroupManagersSetTemplateRequest
+          regionInstanceGroupManagersSetTemplateRequestResource) {
 
     SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request =
         SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setRegionInstanceGroupManagersSetTemplateRequestResource(
+                regionInstanceGroupManagersSetTemplateRequestResource)
+            .build();
     return setInstanceTemplateRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.
+   * Sets the instance template to use when creating new instances or recreating instances in this
+   * group. Existing instances are not affected.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1189,15 +1391,18 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(String inst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation setInstanceTemplateRegionInstanceGroupManager(
+      SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) {
     return setInstanceTemplateRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.
+   * Sets the instance template to use when creating new instances or recreating instances in this
+   * group. Existing instances are not affected.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1213,15 +1418,18 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstance
    * 
*/ @BetaApi - public final UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { + public final UnaryCallable + setInstanceTemplateRegionInstanceGroupManagerCallable() { return stub.setInstanceTemplateRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * Modifies the target pools to which all new instances in this group are assigned. Existing + * instances in the group are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1235,21 +1443,28 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1263,21 +1478,27 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(ProjectRegionIns
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) {
+  public final Operation setTargetPoolsRegionInstanceGroupManager(
+      String instanceGroupManager,
+      RegionInstanceGroupManagersSetTargetPoolsRequest
+          regionInstanceGroupManagersSetTargetPoolsRequestResource) {
 
     SetTargetPoolsRegionInstanceGroupManagerHttpRequest request =
         SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(
+                regionInstanceGroupManagersSetTargetPoolsRequestResource)
+            .build();
     return setTargetPoolsRegionInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
+   * Modifies the target pools to which all new instances in this group are assigned. Existing
+   * instances in the group are not affected.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1294,15 +1515,18 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(String instanceG
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation setTargetPoolsRegionInstanceGroupManager(
+      SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) {
     return setTargetPoolsRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
+   * Modifies the target pools to which all new instances in this group are assigned. Existing
+   * instances in the group are not affected.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1318,7 +1542,8 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRe
    * 
*/ @BetaApi - public final UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { + public final UnaryCallable + setTargetPoolsRegionInstanceGroupManagerCallable() { return stub.setTargetPoolsRegionInstanceGroupManagerCallable(); } @@ -1352,23 +1577,31 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage, - ListRegionInstanceGroupManagersFixedSizeCollection> { + public static class ListRegionInstanceGroupManagersPagedResponse + extends AbstractPagedListResponse< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { ApiFuture futurePage = - ListRegionInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + ListRegionInstanceGroupManagersPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + ListRegionInstanceGroupManagersPage, ListRegionInstanceGroupManagersPagedResponse>() { @Override - public ListRegionInstanceGroupManagersPagedResponse apply(ListRegionInstanceGroupManagersPage input) { + public ListRegionInstanceGroupManagersPagedResponse apply( + ListRegionInstanceGroupManagersPage input) { return new ListRegionInstanceGroupManagersPagedResponse(input); } }); @@ -1377,18 +1610,21 @@ public ListRegionInstanceGroupManagersPagedResponse apply(ListRegionInstanceGrou private ListRegionInstanceGroupManagersPagedResponse(ListRegionInstanceGroupManagersPage page) { super(page, ListRegionInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionInstanceGroupManagersPage extends AbstractPage< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage> { + public static class ListRegionInstanceGroupManagersPage + extends AbstractPage< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage> { private ListRegionInstanceGroupManagersPage( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager> + context, RegionInstanceGroupManagerList response) { super(context, response); } @@ -1399,31 +1635,37 @@ private static ListRegionInstanceGroupManagersPage createEmptyPage() { @Override protected ListRegionInstanceGroupManagersPage createPage( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager> + context, RegionInstanceGroupManagerList response) { return new ListRegionInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage, - ListRegionInstanceGroupManagersFixedSizeCollection> { + public static class ListRegionInstanceGroupManagersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { - private ListRegionInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + private ListRegionInstanceGroupManagersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1436,7 +1678,5 @@ protected ListRegionInstanceGroupManagersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java index b4bc7eec48b8..d6bfddceb997 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private RegionInstanceGroupsListInstancesRequest() { this.portName = null; } - - private RegionInstanceGroupsListInstancesRequest( - String instanceState, - String portName - ) { + private RegionInstanceGroupsListInstancesRequest(String instanceState, String portName) { this.instanceState = instanceState; this.portName = portName; } @@ -86,22 +79,24 @@ public String getPortName() { return portName; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupsListInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupsListInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupsListInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupsListInstancesRequest(); } @@ -146,13 +141,9 @@ public Builder setPortName(String portName) { return this; } - public RegionInstanceGroupsListInstancesRequest build() { - return new RegionInstanceGroupsListInstancesRequest( - instanceState, - portName - ); + return new RegionInstanceGroupsListInstancesRequest(instanceState, portName); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupsListInstancesRequest{" - + "instanceState=" + instanceState + ", " - + "portName=" + portName + + "instanceState=" + + instanceState + + ", " + + "portName=" + + portName + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupsListInstancesRequest) { RegionInstanceGroupsListInstancesRequest that = (RegionInstanceGroupsListInstancesRequest) o; - return - Objects.equals(this.instanceState, that.getInstanceState()) && - Objects.equals(this.portName, that.getPortName()) - ; + return Objects.equals(this.instanceState, that.getInstanceState()) + && Objects.equals(this.portName, that.getPortName()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceState, - portName - ); + return Objects.hash(instanceState, portName); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java index 5237a912e9f7..7d2e287ee3ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java @@ -21,13 +21,8 @@ import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @@ -36,7 +31,7 @@ public final class SslCertificateName implements ResourceName { private final String project; private final String sslCertificate; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}"); private volatile Map fieldValuesMap; @@ -53,25 +48,12 @@ private SslCertificateName(Builder builder) { sslCertificate = Preconditions.checkNotNull(builder.getSslCertificate()); } - public static SslCertificateName of( - String project, - String sslCertificate - ) { - return newBuilder() - .setProject(project) - .setSslCertificate(sslCertificate) - .build(); + public static SslCertificateName of(String project, String sslCertificate) { + return newBuilder().setProject(project).setSslCertificate(sslCertificate).build(); } - public static String format( - String project, - String sslCertificate - ) { - return of( - project, - sslCertificate - ) - .toString(); + public static String format(String project, String sslCertificate) { + return of(project, sslCertificate).toString(); } public String getProject() { @@ -82,7 +64,6 @@ public String getSslCertificate() { return sslCertificate; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -102,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public SslCertificateName parse(String formattedString) {return SslCertificateName.parse(formattedString);} + public SslCertificateName parse(String formattedString) { + return SslCertificateName.parse(formattedString); + } }; } public static SslCertificateName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "SslCertificateName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("sslCertificate") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "SslCertificateName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("sslCertificate")); } public static boolean isParsableFrom(String formattedString) { @@ -129,6 +109,7 @@ public static class Builder { public String getProject() { return project; } + public String getSslCertificate() { return sslCertificate; } @@ -137,6 +118,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setSslCertificate(String sslCertificate) { this.sslCertificate = sslCertificate; return this; @@ -144,7 +126,7 @@ public Builder setSslCertificate(String sslCertificate) { private Builder() {} - public Builder (SslCertificateName sslCertificateName) { + public Builder(SslCertificateName sslCertificateName) { project = sslCertificateName.project; sslCertificate = sslCertificateName.sslCertificate; } @@ -158,8 +140,7 @@ public SslCertificateName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "sslCertificate", sslCertificate - ); + "sslCertificate", sslCertificate); } @Override @@ -169,19 +150,14 @@ public boolean equals(Object o) { } if (o instanceof SslCertificateName) { SslCertificateName that = (SslCertificateName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.sslCertificate, that.getSslCertificate()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.sslCertificate, that.getSslCertificate()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - sslCertificate - ); + return Objects.hash(project, sslCertificate); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java index 089b1e31c2fd..19383a8370a2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.SubnetworkStub; import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,33 @@ *
*
* - *

Note: close() needs to be called on the subnetworkClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the subnetworkClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of SubnetworkSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +104,14 @@ public class SubnetworkClient implements BackgroundResource {
   private final SubnetworkSettings settings;
   private final SubnetworkStub stub;
 
-
-
-  /**
-   * Constructs an instance of SubnetworkClient with default settings.
-   */
+  /** Constructs an instance of SubnetworkClient with default settings. */
   public static final SubnetworkClient create() throws IOException {
     return create(SubnetworkSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of SubnetworkClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of SubnetworkClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final SubnetworkClient create(SubnetworkSettings settings) throws IOException {
     return new SubnetworkClient(settings);
@@ -143,9 +127,8 @@ public static final SubnetworkClient create(SubnetworkStub stub) {
   }
 
   /**
-   * Constructs an instance of SubnetworkClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of SubnetworkClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected SubnetworkClient(SubnetworkSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +150,12 @@ public SubnetworkStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -186,11 +169,12 @@ public SubnetworkStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(ProjectName project) {
+  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
+      ProjectName project) {
     AggregatedListSubnetworksHttpRequest request =
         AggregatedListSubnetworksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListSubnetworks(request);
   }
 
@@ -198,7 +182,8 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(Pr
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -214,9 +199,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(Pr
   @BetaApi
   public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(String project) {
     AggregatedListSubnetworksHttpRequest request =
-        AggregatedListSubnetworksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListSubnetworksHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListSubnetworks(request);
   }
 
@@ -224,7 +207,8 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(St
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +225,17 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(AggregatedListSubnetworksHttpRequest request) {
-    return aggregatedListSubnetworksPagedCallable()
-        .call(request);
+  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
+      AggregatedListSubnetworksHttpRequest request) {
+    return aggregatedListSubnetworksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +251,9 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(Ag
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListSubnetworksPagedCallable() { + public final UnaryCallable< + AggregatedListSubnetworksHttpRequest, AggregatedListSubnetworksPagedResponse> + aggregatedListSubnetworksPagedCallable() { return stub.aggregatedListSubnetworksPagedCallable(); } @@ -274,7 +261,8 @@ public final UnaryCallableSample code: + * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,7 +285,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListSubnetworksCallable() { + public final UnaryCallable + aggregatedListSubnetworksCallable() { return stub.aggregatedListSubnetworksCallable(); } @@ -305,7 +294,8 @@ public final UnaryCallableSample code: + * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -321,8 +311,8 @@ public final Operation deleteSubnetwork(SubnetworkName subnetwork) {
 
     DeleteSubnetworkHttpRequest request =
         DeleteSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
-        .build();
+            .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
+            .build();
     return deleteSubnetwork(request);
   }
 
@@ -330,7 +320,8 @@ public final Operation deleteSubnetwork(SubnetworkName subnetwork) {
   /**
    * Deletes the specified subnetwork.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -345,9 +336,7 @@ public final Operation deleteSubnetwork(SubnetworkName subnetwork) {
   public final Operation deleteSubnetwork(String subnetwork) {
 
     DeleteSubnetworkHttpRequest request =
-        DeleteSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork)
-        .build();
+        DeleteSubnetworkHttpRequest.newBuilder().setSubnetwork(subnetwork).build();
     return deleteSubnetwork(request);
   }
 
@@ -355,7 +344,8 @@ public final Operation deleteSubnetwork(String subnetwork) {
   /**
    * Deletes the specified subnetwork.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -378,7 +368,8 @@ public final Operation deleteSubnetwork(DeleteSubnetworkHttpRequest request) {
   /**
    * Deletes the specified subnetwork.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -400,7 +391,8 @@ public final UnaryCallable deleteSubnetw
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -414,13 +406,16 @@ public final UnaryCallable deleteSubnetw
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation expandIpCidrRangeSubnetwork(SubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) {
+  public final Operation expandIpCidrRangeSubnetwork(
+      SubnetworkName subnetwork,
+      SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) {
 
     ExpandIpCidrRangeSubnetworkHttpRequest request =
         ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
-        .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
-        .build();
+            .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
+            .setSubnetworksExpandIpCidrRangeRequestResource(
+                subnetworksExpandIpCidrRangeRequestResource)
+            .build();
     return expandIpCidrRangeSubnetwork(request);
   }
 
@@ -428,7 +423,8 @@ public final Operation expandIpCidrRangeSubnetwork(SubnetworkName subnetwork, Su
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -442,13 +438,16 @@ public final Operation expandIpCidrRangeSubnetwork(SubnetworkName subnetwork, Su
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation expandIpCidrRangeSubnetwork(String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) {
+  public final Operation expandIpCidrRangeSubnetwork(
+      String subnetwork,
+      SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) {
 
     ExpandIpCidrRangeSubnetworkHttpRequest request =
         ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork)
-        .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
-        .build();
+            .setSubnetwork(subnetwork)
+            .setSubnetworksExpandIpCidrRangeRequestResource(
+                subnetworksExpandIpCidrRangeRequestResource)
+            .build();
     return expandIpCidrRangeSubnetwork(request);
   }
 
@@ -456,7 +455,8 @@ public final Operation expandIpCidrRangeSubnetwork(String subnetwork, Subnetwork
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -473,7 +473,8 @@ public final Operation expandIpCidrRangeSubnetwork(String subnetwork, Subnetwork
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHttpRequest request) {
+  public final Operation expandIpCidrRangeSubnetwork(
+      ExpandIpCidrRangeSubnetworkHttpRequest request) {
     return expandIpCidrRangeSubnetworkCallable().call(request);
   }
 
@@ -481,7 +482,8 @@ public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHt
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -497,7 +499,8 @@ public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHt
    * 
*/ @BetaApi - public final UnaryCallable expandIpCidrRangeSubnetworkCallable() { + public final UnaryCallable + expandIpCidrRangeSubnetworkCallable() { return stub.expandIpCidrRangeSubnetworkCallable(); } @@ -505,7 +508,8 @@ public final UnaryCallable ex /** * Returns the specified subnetwork. Get a list of available subnetworks list() request. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -521,8 +525,8 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) {
 
     GetSubnetworkHttpRequest request =
         GetSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
-        .build();
+            .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
+            .build();
     return getSubnetwork(request);
   }
 
@@ -530,7 +534,8 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -545,9 +550,7 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) {
   public final Subnetwork getSubnetwork(String subnetwork) {
 
     GetSubnetworkHttpRequest request =
-        GetSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork)
-        .build();
+        GetSubnetworkHttpRequest.newBuilder().setSubnetwork(subnetwork).build();
     return getSubnetwork(request);
   }
 
@@ -555,7 +558,8 @@ public final Subnetwork getSubnetwork(String subnetwork) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -578,7 +582,8 @@ public final Subnetwork getSubnetwork(GetSubnetworkHttpRequest request) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -600,7 +605,8 @@ public final UnaryCallable getSubnetworkCa
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -618,9 +624,9 @@ public final Operation insertSubnetwork(RegionName region, Subnetwork subnetwork
 
     InsertSubnetworkHttpRequest request =
         InsertSubnetworkHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .setSubnetworkResource(subnetworkResource)
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .setSubnetworkResource(subnetworkResource)
+            .build();
     return insertSubnetwork(request);
   }
 
@@ -628,7 +634,8 @@ public final Operation insertSubnetwork(RegionName region, Subnetwork subnetwork
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -646,9 +653,9 @@ public final Operation insertSubnetwork(String region, Subnetwork subnetworkReso
 
     InsertSubnetworkHttpRequest request =
         InsertSubnetworkHttpRequest.newBuilder()
-        .setRegion(region)
-        .setSubnetworkResource(subnetworkResource)
-        .build();
+            .setRegion(region)
+            .setSubnetworkResource(subnetworkResource)
+            .build();
     return insertSubnetwork(request);
   }
 
@@ -656,7 +663,8 @@ public final Operation insertSubnetwork(String region, Subnetwork subnetworkReso
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -681,7 +689,8 @@ public final Operation insertSubnetwork(InsertSubnetworkHttpRequest request) {
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -705,7 +714,8 @@ public final UnaryCallable insertSubnetw
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -722,8 +732,8 @@ public final UnaryCallable insertSubnetw
   public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
     ListSubnetworksHttpRequest request =
         ListSubnetworksHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listSubnetworks(request);
   }
 
@@ -731,7 +741,8 @@ public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -747,9 +758,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
   @BetaApi
   public final ListSubnetworksPagedResponse listSubnetworks(String region) {
     ListSubnetworksHttpRequest request =
-        ListSubnetworksHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListSubnetworksHttpRequest.newBuilder().setRegion(region).build();
     return listSubnetworks(request);
   }
 
@@ -757,7 +766,8 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -775,15 +785,15 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
    */
   @BetaApi
   public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpRequest request) {
-    return listSubnetworksPagedCallable()
-        .call(request);
+    return listSubnetworksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -799,7 +809,8 @@ public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpReq
    * 
*/ @BetaApi - public final UnaryCallable listSubnetworksPagedCallable() { + public final UnaryCallable + listSubnetworksPagedCallable() { return stub.listSubnetworksPagedCallable(); } @@ -807,7 +818,8 @@ public final UnaryCallableSample code: + * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -864,15 +876,20 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListSubnetworksPagedResponse extends AbstractPagedListResponse<
-      AggregatedListSubnetworksHttpRequest,
-      SubnetworkAggregatedList,
-      SubnetworksScopedList,
-      AggregatedListSubnetworksPage,
-      AggregatedListSubnetworksFixedSizeCollection> {
+  public static class AggregatedListSubnetworksPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListSubnetworksHttpRequest,
+          SubnetworkAggregatedList,
+          SubnetworksScopedList,
+          AggregatedListSubnetworksPage,
+          AggregatedListSubnetworksFixedSizeCollection> {
 
     public static ApiFuture createAsync(
-        PageContext context,
+        PageContext<
+                AggregatedListSubnetworksHttpRequest,
+                SubnetworkAggregatedList,
+                SubnetworksScopedList>
+            context,
         ApiFuture futureResponse) {
       ApiFuture futurePage =
           AggregatedListSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse);
@@ -880,7 +897,8 @@ public static ApiFuture createAsync(
           futurePage,
           new ApiFunction() {
             @Override
-            public AggregatedListSubnetworksPagedResponse apply(AggregatedListSubnetworksPage input) {
+            public AggregatedListSubnetworksPagedResponse apply(
+                AggregatedListSubnetworksPage input) {
               return new AggregatedListSubnetworksPagedResponse(input);
             }
           });
@@ -889,18 +907,21 @@ public AggregatedListSubnetworksPagedResponse apply(AggregatedListSubnetworksPag
     private AggregatedListSubnetworksPagedResponse(AggregatedListSubnetworksPage page) {
       super(page, AggregatedListSubnetworksFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListSubnetworksPage extends AbstractPage<
-      AggregatedListSubnetworksHttpRequest,
-      SubnetworkAggregatedList,
-      SubnetworksScopedList,
-      AggregatedListSubnetworksPage> {
+  public static class AggregatedListSubnetworksPage
+      extends AbstractPage<
+          AggregatedListSubnetworksHttpRequest,
+          SubnetworkAggregatedList,
+          SubnetworksScopedList,
+          AggregatedListSubnetworksPage> {
 
     private AggregatedListSubnetworksPage(
-        PageContext context,
+        PageContext<
+                AggregatedListSubnetworksHttpRequest,
+                SubnetworkAggregatedList,
+                SubnetworksScopedList>
+            context,
         SubnetworkAggregatedList response) {
       super(context, response);
     }
@@ -911,31 +932,37 @@ private static AggregatedListSubnetworksPage createEmptyPage() {
 
     @Override
     protected AggregatedListSubnetworksPage createPage(
-        PageContext context,
+        PageContext<
+                AggregatedListSubnetworksHttpRequest,
+                SubnetworkAggregatedList,
+                SubnetworksScopedList>
+            context,
         SubnetworkAggregatedList response) {
       return new AggregatedListSubnetworksPage(context, response);
     }
 
     @Override
     public ApiFuture createPageAsync(
-        PageContext context,
+        PageContext<
+                AggregatedListSubnetworksHttpRequest,
+                SubnetworkAggregatedList,
+                SubnetworksScopedList>
+            context,
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListSubnetworksHttpRequest,
-      SubnetworkAggregatedList,
-      SubnetworksScopedList,
-      AggregatedListSubnetworksPage,
-      AggregatedListSubnetworksFixedSizeCollection> {
+  public static class AggregatedListSubnetworksFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListSubnetworksHttpRequest,
+          SubnetworkAggregatedList,
+          SubnetworksScopedList,
+          AggregatedListSubnetworksPage,
+          AggregatedListSubnetworksFixedSizeCollection> {
 
-    private AggregatedListSubnetworksFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListSubnetworksFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -948,15 +975,15 @@ protected AggregatedListSubnetworksFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListSubnetworksFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListSubnetworksPagedResponse extends AbstractPagedListResponse<
-      ListSubnetworksHttpRequest,
-      SubnetworkList,
-      Subnetwork,
-      ListSubnetworksPage,
-      ListSubnetworksFixedSizeCollection> {
+
+  public static class ListSubnetworksPagedResponse
+      extends AbstractPagedListResponse<
+          ListSubnetworksHttpRequest,
+          SubnetworkList,
+          Subnetwork,
+          ListSubnetworksPage,
+          ListSubnetworksFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -976,15 +1003,11 @@ public ListSubnetworksPagedResponse apply(ListSubnetworksPage input) {
     private ListSubnetworksPagedResponse(ListSubnetworksPage page) {
       super(page, ListSubnetworksFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListSubnetworksPage extends AbstractPage<
-      ListSubnetworksHttpRequest,
-      SubnetworkList,
-      Subnetwork,
-      ListSubnetworksPage> {
+  public static class ListSubnetworksPage
+      extends AbstractPage<
+          ListSubnetworksHttpRequest, SubnetworkList, Subnetwork, ListSubnetworksPage> {
 
     private ListSubnetworksPage(
         PageContext context,
@@ -1009,20 +1032,18 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListSubnetworksHttpRequest,
-      SubnetworkList,
-      Subnetwork,
-      ListSubnetworksPage,
-      ListSubnetworksFixedSizeCollection> {
+  public static class ListSubnetworksFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListSubnetworksHttpRequest,
+          SubnetworkList,
+          Subnetwork,
+          ListSubnetworksPage,
+          ListSubnetworksFixedSizeCollection> {
 
-    private ListSubnetworksFixedSizeCollection(List pages, int collectionSize) {
+    private ListSubnetworksFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -1035,7 +1056,5 @@ protected ListSubnetworksFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListSubnetworksFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java
index dcf69816e59b..ea693832d2dd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -52,7 +49,6 @@ private SwitchToCustomModeNetworkHttpRequest() {
     this.userIp = null;
   }
 
-
   private SwitchToCustomModeNetworkHttpRequest(
       String access_token,
       String callback,
@@ -61,8 +57,7 @@ private SwitchToCustomModeNetworkHttpRequest(
       String network,
       String prettyPrint,
       String quotaUser,
-      String userIp
-      ) {
+      String userIp) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -170,22 +165,24 @@ public String getUserIp() {
     return userIp;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(SwitchToCustomModeNetworkHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static SwitchToCustomModeNetworkHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final SwitchToCustomModeNetworkHttpRequest DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new SwitchToCustomModeNetworkHttpRequest();
   }
@@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
-
     public SwitchToCustomModeNetworkHttpRequest build() {
       String missing = "";
 
-
-
-
       if (network == null) {
         missing += " network";
       }
 
-
-
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new SwitchToCustomModeNetworkHttpRequest(
-        access_token,
-        callback,
-        fields,
-        key,
-        network,
-        prettyPrint,
-        quotaUser,
-        userIp
-      );
+          access_token, callback, fields, key, network, prettyPrint, quotaUser, userIp);
     }
 
     public Builder clone() {
@@ -359,14 +342,29 @@ public Builder clone() {
   @Override
   public String toString() {
     return "SwitchToCustomModeNetworkHttpRequest{"
-        + "access_token=" + access_token + ", "
-        + "callback=" + callback + ", "
-        + "fields=" + fields + ", "
-        + "key=" + key + ", "
-        + "network=" + network + ", "
-        + "prettyPrint=" + prettyPrint + ", "
-        + "quotaUser=" + quotaUser + ", "
-        + "userIp=" + userIp
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "network="
+        + network
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
         + "}";
   }
 
@@ -377,16 +375,14 @@ public boolean equals(Object o) {
     }
     if (o instanceof SwitchToCustomModeNetworkHttpRequest) {
       SwitchToCustomModeNetworkHttpRequest that = (SwitchToCustomModeNetworkHttpRequest) o;
-      return
-          Objects.equals(this.access_token, that.getAccessToken()) &&
-          Objects.equals(this.callback, that.getCallback()) &&
-          Objects.equals(this.fields, that.getFields()) &&
-          Objects.equals(this.key, that.getKey()) &&
-          Objects.equals(this.network, that.getNetwork()) &&
-          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
-          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
-          Objects.equals(this.userIp, that.getUserIp())
-          ;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.network, that.getNetwork())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
     }
     return false;
   }
@@ -394,14 +390,6 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-      access_token,
-      callback,
-      fields,
-      key,
-      network,
-      prettyPrint,
-      quotaUser,
-      userIp
-    );
+        access_token, callback, fields, key, network, prettyPrint, quotaUser, userIp);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
index fbc28ec48175..fd839b821f05 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -46,14 +45,8 @@ private TargetHttpsProxyList() {
     this.selfLink = null;
   }
 
-
   private TargetHttpsProxyList(
-      String id,
-      List items,
-      String kind,
-      String nextPageToken,
-      String selfLink
-      ) {
+      String id, List items, String kind, String nextPageToken, String selfLink) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -132,22 +125,24 @@ public String getSelfLink() {
     return selfLink;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(TargetHttpsProxyList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetHttpsProxyList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final TargetHttpsProxyList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new TargetHttpsProxyList();
   }
@@ -242,19 +237,9 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
-
     public TargetHttpsProxyList build() {
 
-
-
-
-      return new TargetHttpsProxyList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink
-      );
+      return new TargetHttpsProxyList(id, items, kind, nextPageToken, selfLink);
     }
 
     public Builder clone() {
@@ -271,11 +256,20 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetHttpsProxyList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
         + "}";
   }
 
@@ -286,25 +280,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetHttpsProxyList) {
       TargetHttpsProxyList that = (TargetHttpsProxyList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java
index 48ed9f78bf64..81f4c5bbe9ee 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -40,11 +39,7 @@ private TargetVpnGatewaysScopedList() {
     this.warning = null;
   }
 
-
-  private TargetVpnGatewaysScopedList(
-      List targetVpnGateways,
-      Warning warning
-      ) {
+  private TargetVpnGatewaysScopedList(List targetVpnGateways, Warning warning) {
     this.targetVpnGateways = targetVpnGateways;
     this.warning = warning;
   }
@@ -90,22 +85,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(TargetVpnGatewaysScopedList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetVpnGatewaysScopedList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final TargetVpnGatewaysScopedList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new TargetVpnGatewaysScopedList();
   }
@@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public TargetVpnGatewaysScopedList build() {
 
-      return new TargetVpnGatewaysScopedList(
-        targetVpnGateways,
-        warning
-      );
+      return new TargetVpnGatewaysScopedList(targetVpnGateways, warning);
     }
 
     public Builder clone() {
@@ -178,8 +171,11 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetVpnGatewaysScopedList{"
-        + "targetVpnGateways=" + targetVpnGateways + ", "
-        + "warning=" + warning
+        + "targetVpnGateways="
+        + targetVpnGateways
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -190,19 +186,14 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetVpnGatewaysScopedList) {
       TargetVpnGatewaysScopedList that = (TargetVpnGatewaysScopedList) o;
-      return
-          Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      targetVpnGateways,
-      warning
-    );
+    return Objects.hash(targetVpnGateways, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java
index 3f791014e24d..be5ae3508d41 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java
@@ -15,45 +15,23 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
 import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -62,15 +40,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteZoneOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteZoneOperation to 30 seconds: * *

  * 
@@ -85,70 +63,55 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ZoneOperationSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteZoneOperation.
-   */
+  /** Returns the object with the settings used for calls to deleteZoneOperation. */
   public UnaryCallSettings deleteZoneOperationSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).deleteZoneOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getZoneOperation.
-   */
+  /** Returns the object with the settings used for calls to getZoneOperation. */
   public UnaryCallSettings getZoneOperationSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).getZoneOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listZoneOperations.
-   */
-  public PagedCallSettings listZoneOperationsSettings() {
+  /** Returns the object with the settings used for calls to listZoneOperations. */
+  public PagedCallSettings<
+          ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
+      listZoneOperationsSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).listZoneOperationsSettings();
   }
 
-
-  public static final ZoneOperationSettings create(ZoneOperationStubSettings stub) throws IOException {
+  public static final ZoneOperationSettings create(ZoneOperationStubSettings stub)
+      throws IOException {
     return new ZoneOperationSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ZoneOperationStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return ZoneOperationStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return ZoneOperationStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return ZoneOperationStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return ZoneOperationStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ZoneOperationStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return ZoneOperationStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -161,23 +124,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ZoneOperationStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -186,9 +143,7 @@ protected ZoneOperationSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for ZoneOperationSettings.
-   */
+  /** Builder for ZoneOperationSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -210,7 +165,6 @@ protected Builder(ZoneOperationStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public ZoneOperationStubSettings.Builder getStubSettingsBuilder() {
       return ((ZoneOperationStubSettings.Builder) getStubSettings());
     }
@@ -218,31 +172,31 @@ public ZoneOperationStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteZoneOperation. - */ - public UnaryCallSettings.Builder deleteZoneOperationSettings() { + /** Returns the builder for the settings used for calls to deleteZoneOperation. */ + public UnaryCallSettings.Builder + deleteZoneOperationSettings() { return getStubSettingsBuilder().deleteZoneOperationSettings(); } - /** - * Returns the builder for the settings used for calls to getZoneOperation. - */ - public UnaryCallSettings.Builder getZoneOperationSettings() { + /** Returns the builder for the settings used for calls to getZoneOperation. */ + public UnaryCallSettings.Builder + getZoneOperationSettings() { return getStubSettingsBuilder().getZoneOperationSettings(); } - /** - * Returns the builder for the settings used for calls to listZoneOperations. - */ - public PagedCallSettings.Builder listZoneOperationsSettings() { + /** Returns the builder for the settings used for calls to listZoneOperations. */ + public PagedCallSettings.Builder< + ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse> + listZoneOperationsSettings() { return getStubSettingsBuilder().listZoneOperationsSettings(); } @@ -251,4 +205,4 @@ public ZoneOperationSettings build() throws IOException { return new ZoneOperationSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index caa30cafec07..abd0847731b9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveDiskProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,19 +31,11 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveDiskProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; import com.google.cloud.compute.v1.stub.ProjectStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,16 +45,16 @@ @javax.annotation.Generated("by GAPIC") public class ProjectClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - getProjectMethodDescriptor, - moveDiskProjectMethodDescriptor, - moveInstanceProjectMethodDescriptor, - setCommonInstanceMetadataProjectMethodDescriptor, - setUsageExportBucketProjectMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getProjectMethodDescriptor, + moveDiskProjectMethodDescriptor, + moveInstanceProjectMethodDescriptor, + setCommonInstanceMetadataProjectMethodDescriptor, + setUsageExportBucketProjectMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); private static ProjectClient client; private static ProjectSettings clientSettings; @@ -65,13 +63,13 @@ public class ProjectClientTest { public static void setUp() throws IOException { clientSettings = ProjectSettings.newBuilder() - .setTransportChannelProvider( - ProjectSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - ProjectClient.create(clientSettings); + .setTransportChannelProvider( + ProjectSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProjectClient.create(clientSettings); } @After @@ -94,36 +92,44 @@ public void getProjectTest() { String id = "id3355"; String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; - Project expectedResponse = Project.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setDefaultServiceAccount(defaultServiceAccount) - .setSelfLink(selfLink) - .build(); + Project expectedResponse = + Project.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultServiceAccount(defaultServiceAccount) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - Project actualResponse = - client.getProject(project); + Project actualResponse = client.getProject(project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -160,51 +166,59 @@ public void moveDiskProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); - Operation actualResponse = - client.moveDiskProject(project, diskMoveRequestResource); + Operation actualResponse = client.moveDiskProject(project, diskMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void moveDiskProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -242,51 +256,59 @@ public void moveInstanceProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); - Operation actualResponse = - client.moveInstanceProject(project, instanceMoveRequestResource); + Operation actualResponse = client.moveInstanceProject(project, instanceMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void moveInstanceProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -324,51 +346,59 @@ public void setCommonInstanceMetadataProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); Metadata metadataResource = Metadata.newBuilder().build(); - Operation actualResponse = - client.setCommonInstanceMetadataProject(project, metadataResource); + Operation actualResponse = client.setCommonInstanceMetadataProject(project, metadataResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -406,29 +436,30 @@ public void setUsageExportBucketProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -441,16 +472,24 @@ public void setUsageExportBucketProjectTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setUsageExportBucketProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -463,5 +502,4 @@ public void setUsageExportBucketProjectExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} From a1f4ef27da76fcbcbfdff6d50ccd442d9ce21834 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 29 Mar 2018 21:29:28 -0700 Subject: [PATCH 07/42] formatting --- .../v1/AggregatedListDisksHttpRequest.java | 148 +++--- ...dListInstanceGroupManagersHttpRequest.java | 151 +++--- .../cloud/compute/v1/BackendServiceList.java | 68 ++- .../com/google/cloud/compute/v1/Errors.java | 51 +- .../v1/GetRegionInstanceGroupHttpRequest.java | 90 ++-- .../v1/InsertVpnTunnelHttpRequest.java | 118 ++--- .../compute/v1/InstanceGroupSettings.java | 243 ++++------ .../v1/ListInstanceGroupsHttpRequest.java | 149 +++--- .../ListRegionBackendServicesHttpRequest.java | 148 +++--- .../google/cloud/compute/v1/NetworkName.java | 60 +-- .../compute/v1/RegionAutoscalerClient.java | 341 +++++++------ .../cloud/compute/v1/SerialPortOutput.java | 70 ++- .../compute/v1/TargetPoolInstanceHealth.java | 39 +- .../cloud/compute/v1/TargetPoolName.java | 71 +-- .../compute/v1/UpdateRouterHttpRequest.java | 115 ++--- .../google/cloud/compute/v1/UrlMapName.java | 60 +-- .../compute/v1/stub/GlobalAddressStub.java | 12 +- .../stub/HttpJsonInstanceCallableFactory.java | 80 +--- .../compute/v1/stub/HttpJsonRouteStub.java | 180 +++---- .../stub/HttpJsonSnapshotCallableFactory.java | 50 +- .../compute/v1/AutoscalerClientTest.java | 452 ++++++++++-------- 21 files changed, 1279 insertions(+), 1417 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java index 2f889d325d2d..233312cc74e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListDisksHttpRequest() { this.userIp = null; } - private AggregatedListDisksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListDisksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListDisksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListDisksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListDisksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListDisksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListDisksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListDisksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListDisksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListDisksHttpRequest) { AggregatedListDisksHttpRequest that = (AggregatedListDisksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java index 83725fe87875..856200d39650 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListInstanceGroupManagersHttpRequest() { this.userIp = null; } - private AggregatedListInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListInstanceGroupManagersHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListInstanceGroupManagersHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListInstanceGroupManagersHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListInstanceGroupManagersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListInstanceGroupManagersHttpRequest) { - AggregatedListInstanceGroupManagersHttpRequest that = (AggregatedListInstanceGroupManagersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListInstanceGroupManagersHttpRequest that = + (AggregatedListInstanceGroupManagersHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java index fe6616e3972d..3c54fc69fc05 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -46,14 +45,8 @@ private BackendServiceList() { this.selfLink = null; } - private BackendServiceList( - String id, - List items, - String kind, - String nextPageToken, - String selfLink - ) { + String id, List items, String kind, String nextPageToken, String selfLink) { this.id = id; this.items = items; this.kind = kind; @@ -132,22 +125,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServiceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServiceList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServiceList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServiceList(); } @@ -242,19 +237,9 @@ public Builder setSelfLink(String selfLink) { return this; } - public BackendServiceList build() { - - - - return new BackendServiceList( - id, - items, - kind, - nextPageToken, - selfLink - ); + return new BackendServiceList(id, items, kind, nextPageToken, selfLink); } public Builder clone() { @@ -271,11 +256,20 @@ public Builder clone() { @Override public String toString() { return "BackendServiceList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -286,25 +280,17 @@ public boolean equals(Object o) { } if (o instanceof BackendServiceList) { BackendServiceList that = (BackendServiceList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index d9d1e491ba49..4a8dc4f78995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private Errors() { this.message = null; } - - private Errors( - String code, - String location, - String message - ) { + private Errors(String code, String location, String message) { this.code = code; this.location = location; this.message = message; @@ -100,22 +92,24 @@ public String getMessage() { return message; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Errors prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Errors getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Errors DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Errors(); } @@ -174,15 +168,9 @@ public Builder setMessage(String message) { return this; } - public Errors build() { - - return new Errors( - code, - location, - message - ); + return new Errors(code, location, message); } public Builder clone() { @@ -197,9 +185,14 @@ public Builder clone() { @Override public String toString() { return "Errors{" - + "code=" + code + ", " - + "location=" + location + ", " - + "message=" + message + + "code=" + + code + + ", " + + "location=" + + location + + ", " + + "message=" + + message + "}"; } @@ -210,21 +203,15 @@ public boolean equals(Object o) { } if (o instanceof Errors) { Errors that = (Errors) o; - return - Objects.equals(this.code, that.getCode()) && - Objects.equals(this.location, that.getLocation()) && - Objects.equals(this.message, that.getMessage()) - ; + return Objects.equals(this.code, that.getCode()) + && Objects.equals(this.location, that.getLocation()) + && Objects.equals(this.message, that.getMessage()); } return false; } @Override public int hashCode() { - return Objects.hash( - code, - location, - message - ); + return Objects.hash(code, location, message); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java index dc8795624c12..7ff9e320f782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionInstanceGroupHttpRequest() { this.userIp = null; } - private GetRegionInstanceGroupHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRegionInstanceGroupHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionInstanceGroupHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionInstanceGroupHttpRequest) { GetRegionInstanceGroupHttpRequest that = (GetRegionInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java index eb6bb5167aa4..4d617c7b73f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private InsertVpnTunnelHttpRequest() { this.vpnTunnelResource = null; } - private InsertVpnTunnelHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private InsertVpnTunnelHttpRequest( String quotaUser, String region, String userIp, - VpnTunnel vpnTunnelResource - ) { + VpnTunnel vpnTunnelResource) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -105,7 +100,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) { - fieldMap.put("vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); + fieldMap.put( + "vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); } return fieldMap; } @@ -184,22 +180,24 @@ public VpnTunnel getVpnTunnelResource() { return vpnTunnelResource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertVpnTunnelHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertVpnTunnelHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertVpnTunnelHttpRequest(); } @@ -342,34 +340,26 @@ public Builder setVpnTunnelResource(VpnTunnel vpnTunnelResource) { return this; } - public InsertVpnTunnelHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertVpnTunnelHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp, - vpnTunnelResource - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp, + vpnTunnelResource); } public Builder clone() { @@ -390,15 +380,32 @@ public Builder clone() { @Override public String toString() { return "InsertVpnTunnelHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + ", " - + "vpnTunnelResource=" + vpnTunnelResource + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + + ", " + + "vpnTunnelResource=" + + vpnTunnelResource + "}"; } @@ -409,17 +416,15 @@ public boolean equals(Object o) { } if (o instanceof InsertVpnTunnelHttpRequest) { InsertVpnTunnelHttpRequest that = (InsertVpnTunnelHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()); } return false; } @@ -427,15 +432,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp, - vpnTunnelResource - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp, + vpnTunnelResource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java index 2a2788e688f9..569beeba057b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java @@ -15,47 +15,25 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -64,15 +42,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: * *

  * 
@@ -87,112 +65,98 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceGroupSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to addInstancesInstanceGroup.
-   */
-  public UnaryCallSettings addInstancesInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to addInstancesInstanceGroup. */
+  public UnaryCallSettings
+      addInstancesInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).addInstancesInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstanceGroups.
-   */
-  public PagedCallSettings aggregatedListInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListInstanceGroups. */
+  public PagedCallSettings<
+          AggregatedListInstanceGroupsHttpRequest,
+          InstanceGroupAggregatedList,
+          AggregatedListInstanceGroupsPagedResponse>
+      aggregatedListInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).aggregatedListInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceGroup.
-   */
-  public UnaryCallSettings deleteInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to deleteInstanceGroup. */
+  public UnaryCallSettings
+      deleteInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).deleteInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceGroup.
-   */
+  /** Returns the object with the settings used for calls to getInstanceGroup. */
   public UnaryCallSettings getInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).getInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceGroup.
-   */
-  public UnaryCallSettings insertInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to insertInstanceGroup. */
+  public UnaryCallSettings
+      insertInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).insertInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceGroups.
-   */
-  public PagedCallSettings listInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstanceGroups. */
+  public PagedCallSettings<
+          ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
+      listInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).listInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstancesInstanceGroups.
-   */
-  public PagedCallSettings listInstancesInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstancesInstanceGroups. */
+  public PagedCallSettings<
+          ListInstancesInstanceGroupsHttpRequest,
+          InstanceGroupsListInstances,
+          ListInstancesInstanceGroupsPagedResponse>
+      listInstancesInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).listInstancesInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeInstancesInstanceGroup.
-   */
-  public UnaryCallSettings removeInstancesInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to removeInstancesInstanceGroup. */
+  public UnaryCallSettings
+      removeInstancesInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).removeInstancesInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setNamedPortsInstanceGroup.
-   */
-  public UnaryCallSettings setNamedPortsInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to setNamedPortsInstanceGroup. */
+  public UnaryCallSettings
+      setNamedPortsInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).setNamedPortsInstanceGroupSettings();
   }
 
-
-  public static final InstanceGroupSettings create(InstanceGroupStubSettings stub) throws IOException {
+  public static final InstanceGroupSettings create(InstanceGroupStubSettings stub)
+      throws IOException {
     return new InstanceGroupSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstanceGroupStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InstanceGroupStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InstanceGroupStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InstanceGroupStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InstanceGroupStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InstanceGroupStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstanceGroupStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -205,23 +169,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InstanceGroupStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -230,9 +188,7 @@ protected InstanceGroupSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InstanceGroupSettings.
-   */
+  /** Builder for InstanceGroupSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -254,7 +210,6 @@ protected Builder(InstanceGroupStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InstanceGroupStubSettings.Builder getStubSettingsBuilder() {
       return ((InstanceGroupStubSettings.Builder) getStubSettings());
     }
@@ -262,73 +217,73 @@ public InstanceGroupStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to addInstancesInstanceGroup. - */ - public UnaryCallSettings.Builder addInstancesInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to addInstancesInstanceGroup. */ + public UnaryCallSettings.Builder + addInstancesInstanceGroupSettings() { return getStubSettingsBuilder().addInstancesInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to aggregatedListInstanceGroups. - */ - public PagedCallSettings.Builder aggregatedListInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListInstanceGroups. */ + public PagedCallSettings.Builder< + AggregatedListInstanceGroupsHttpRequest, + InstanceGroupAggregatedList, + AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsSettings() { return getStubSettingsBuilder().aggregatedListInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to deleteInstanceGroup. - */ - public UnaryCallSettings.Builder deleteInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceGroup. */ + public UnaryCallSettings.Builder + deleteInstanceGroupSettings() { return getStubSettingsBuilder().deleteInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to getInstanceGroup. - */ - public UnaryCallSettings.Builder getInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to getInstanceGroup. */ + public UnaryCallSettings.Builder + getInstanceGroupSettings() { return getStubSettingsBuilder().getInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to insertInstanceGroup. - */ - public UnaryCallSettings.Builder insertInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to insertInstanceGroup. */ + public UnaryCallSettings.Builder + insertInstanceGroupSettings() { return getStubSettingsBuilder().insertInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to listInstanceGroups. - */ - public PagedCallSettings.Builder listInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse> + listInstanceGroupsSettings() { return getStubSettingsBuilder().listInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to listInstancesInstanceGroups. - */ - public PagedCallSettings.Builder listInstancesInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstancesInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstancesInstanceGroupsHttpRequest, + InstanceGroupsListInstances, + ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsSettings() { return getStubSettingsBuilder().listInstancesInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to removeInstancesInstanceGroup. - */ - public UnaryCallSettings.Builder removeInstancesInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to removeInstancesInstanceGroup. */ + public UnaryCallSettings.Builder + removeInstancesInstanceGroupSettings() { return getStubSettingsBuilder().removeInstancesInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. - */ - public UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. */ + public UnaryCallSettings.Builder + setNamedPortsInstanceGroupSettings() { return getStubSettingsBuilder().setNamedPortsInstanceGroupSettings(); } @@ -337,4 +292,4 @@ public InstanceGroupSettings build() throws IOException { return new InstanceGroupSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java index 37f448462625..065f8f3f7726 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInstanceGroupsHttpRequest() { this.zone = null; } - private ListInstanceGroupsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInstanceGroupsHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstanceGroupsHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListInstanceGroupsHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListInstanceGroupsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListInstanceGroupsHttpRequest) { ListInstanceGroupsHttpRequest that = (ListInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java index d80fd2babb50..584dc381f80e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionBackendServicesHttpRequest() { this.userIp = null; } - private ListRegionBackendServicesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionBackendServicesHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionBackendServicesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionBackendServicesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionBackendServicesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionBackendServicesHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionBackendServicesHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionBackendServicesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionBackendServicesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionBackendServicesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionBackendServicesHttpRequest) { ListRegionBackendServicesHttpRequest that = (ListRegionBackendServicesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java index 751436376661..e5712d85cf8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java @@ -21,13 +21,8 @@ import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @@ -36,7 +31,7 @@ public final class NetworkName implements ResourceName { private final String network; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}"); private volatile Map fieldValuesMap; @@ -53,25 +48,12 @@ private NetworkName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); } - public static NetworkName of( - String network, - String project - ) { - return newBuilder() - .setNetwork(network) - .setProject(project) - .build(); + public static NetworkName of(String network, String project) { + return newBuilder().setNetwork(network).setProject(project).build(); } - public static String format( - String network, - String project - ) { - return of( - network, - project - ) - .toString(); + public static String format(String network, String project) { + return of(network, project).toString(); } public String getNetwork() { @@ -82,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -102,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public NetworkName parse(String formattedString) {return NetworkName.parse(formattedString);} + public NetworkName parse(String formattedString) { + return NetworkName.parse(formattedString); + } }; } public static NetworkName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "NetworkName.parse: formattedString not in valid format"); - return of( - matchMap.get("network"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "NetworkName.parse: formattedString not in valid format"); + return of(matchMap.get("network"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -129,6 +109,7 @@ public static class Builder { public String getNetwork() { return network; } + public String getProject() { return project; } @@ -137,6 +118,7 @@ public Builder setNetwork(String network) { this.network = network; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -144,7 +126,7 @@ public Builder setProject(String project) { private Builder() {} - public Builder (NetworkName networkName) { + public Builder(NetworkName networkName) { network = networkName.network; project = networkName.project; } @@ -158,8 +140,7 @@ public NetworkName build() { public String toString() { return PATH_TEMPLATE.instantiate( "network", network, - "project", project - ); + "project", project); } @Override @@ -169,19 +150,14 @@ public boolean equals(Object o) { } if (o instanceof NetworkName) { NetworkName that = (NetworkName) o; - return - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.project, that.getProject()) - ; + return Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - network, - project - ); + return Objects.hash(network, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java index 0dfa08837464..379259074417 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionAutoscalerStub; import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,34 @@ * *

* - *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of RegionAutoscalerSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class RegionAutoscalerClient implements BackgroundResource {
   private final RegionAutoscalerSettings settings;
   private final RegionAutoscalerStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionAutoscalerClient with default settings.
-   */
+  /** Constructs an instance of RegionAutoscalerClient with default settings. */
   public static final RegionAutoscalerClient create() throws IOException {
     return create(RegionAutoscalerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionAutoscalerClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings) throws IOException {
+  public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings)
+      throws IOException {
     return new RegionAutoscalerClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionAutoscalerSettings}.
+   * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use RegionAutoscalerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) {
@@ -143,9 +129,9 @@ public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) {
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionAutoscalerClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected RegionAutoscalerClient(RegionAutoscalerSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public RegionAutoscalerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -188,8 +174,8 @@ public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autosc
 
     DeleteRegionAutoscalerHttpRequest request =
         DeleteRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
-        .build();
+            .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+            .build();
     return deleteRegionAutoscaler(request);
   }
 
@@ -197,7 +183,8 @@ public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autosc
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -212,9 +199,7 @@ public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autosc
   public final Operation deleteRegionAutoscaler(String autoscaler) {
 
     DeleteRegionAutoscalerHttpRequest request =
-        DeleteRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .build();
+        DeleteRegionAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
     return deleteRegionAutoscaler(request);
   }
 
@@ -222,7 +207,8 @@ public final Operation deleteRegionAutoscaler(String autoscaler) {
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -245,7 +231,8 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -259,7 +246,8 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteRegionAutoscalerCallable() { + public final UnaryCallable + deleteRegionAutoscalerCallable() { return stub.deleteRegionAutoscalerCallable(); } @@ -267,7 +255,8 @@ public final UnaryCallable deleteR /** * Returns the specified autoscaler. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -283,8 +272,8 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
 
     GetRegionAutoscalerHttpRequest request =
         GetRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
-        .build();
+            .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+            .build();
     return getRegionAutoscaler(request);
   }
 
@@ -292,7 +281,8 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
   /**
    * Returns the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -307,9 +297,7 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
   public final Autoscaler getRegionAutoscaler(String autoscaler) {
 
     GetRegionAutoscalerHttpRequest request =
-        GetRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .build();
+        GetRegionAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
     return getRegionAutoscaler(request);
   }
 
@@ -317,7 +305,8 @@ public final Autoscaler getRegionAutoscaler(String autoscaler) {
   /**
    * Returns the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -340,7 +329,8 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
   /**
    * Returns the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -354,7 +344,8 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getRegionAutoscalerCallable() { + public final UnaryCallable + getRegionAutoscalerCallable() { return stub.getRegionAutoscalerCallable(); } @@ -362,7 +353,8 @@ public final UnaryCallable getRegion /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -372,7 +364,10 @@ public final UnaryCallable getRegion
    * 
* * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -380,9 +375,9 @@ public final Operation insertRegionAutoscaler(RegionName region, Autoscaler auto InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return insertRegionAutoscaler(request); } @@ -390,7 +385,8 @@ public final Operation insertRegionAutoscaler(RegionName region, Autoscaler auto /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -400,7 +396,10 @@ public final Operation insertRegionAutoscaler(RegionName region, Autoscaler auto
    * 
* * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -408,9 +407,9 @@ public final Operation insertRegionAutoscaler(String region, Autoscaler autoscal InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return insertRegionAutoscaler(request); } @@ -418,7 +417,8 @@ public final Operation insertRegionAutoscaler(String region, Autoscaler autoscal /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -443,7 +443,8 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
   /**
    * Creates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -459,7 +460,8 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertRegionAutoscalerCallable() { + public final UnaryCallable + insertRegionAutoscalerCallable() { return stub.insertRegionAutoscalerCallable(); } @@ -467,7 +469,8 @@ public final UnaryCallable insertR /** * Retrieves a list of autoscalers contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -484,8 +487,8 @@ public final UnaryCallable insertR
   public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName region) {
     ListRegionAutoscalersHttpRequest request =
         ListRegionAutoscalersHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRegionAutoscalers(request);
   }
 
@@ -493,7 +496,8 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -509,9 +513,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName
   @BetaApi
   public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String region) {
     ListRegionAutoscalersHttpRequest request =
-        ListRegionAutoscalersHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionAutoscalersHttpRequest.newBuilder().setRegion(region).build();
     return listRegionAutoscalers(request);
   }
 
@@ -519,7 +521,8 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -536,16 +539,17 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegionAutoscalersHttpRequest request) {
-    return listRegionAutoscalersPagedCallable()
-        .call(request);
+  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(
+      ListRegionAutoscalersHttpRequest request) {
+    return listRegionAutoscalersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -561,7 +565,8 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegion
    * 
*/ @BetaApi - public final UnaryCallable listRegionAutoscalersPagedCallable() { + public final UnaryCallable + listRegionAutoscalersPagedCallable() { return stub.listRegionAutoscalersPagedCallable(); } @@ -569,7 +574,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -592,15 +598,18 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionAutoscalersCallable() { + public final UnaryCallable + listRegionAutoscalersCallable() { return stub.listRegionAutoscalersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * Updates an autoscaler in the specified project using the data included in the request. This + * method supports patch semantics. + * + *

Sample code: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -612,26 +621,32 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -643,26 +658,32 @@ public final Operation patchRegionAutoscaler(String autoscaler, RegionName regio
    *
    * @param autoscaler Name of the autoscaler to update.
    * @param region Name of the region scoping this request.
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
+   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+   *     automatically scale virtual machine instances in managed instance groups according to an
+   *     autoscaling policy that you define. For more information, read Autoscaling Groups of
+   *     Instances.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchRegionAutoscaler(String autoscaler, String region, Autoscaler autoscalerResource) {
+  public final Operation patchRegionAutoscaler(
+      String autoscaler, String region, Autoscaler autoscalerResource) {
 
     PatchRegionAutoscalerHttpRequest request =
         PatchRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .setRegion(region)
-        .setAutoscalerResource(autoscalerResource)
-        .build();
+            .setAutoscaler(autoscaler)
+            .setRegion(region)
+            .setAutoscalerResource(autoscalerResource)
+            .build();
     return patchRegionAutoscaler(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.
+   * Updates an autoscaler in the specified project using the data included in the request. This
+   * method supports patch semantics.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -687,9 +708,11 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.
+   * Updates an autoscaler in the specified project using the data included in the request. This
+   * method supports patch semantics.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -707,7 +730,8 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable patchRegionAutoscalerCallable() { + public final UnaryCallable + patchRegionAutoscalerCallable() { return stub.patchRegionAutoscalerCallable(); } @@ -715,7 +739,8 @@ public final UnaryCallable patchReg /** * Updates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -727,18 +752,22 @@ public final UnaryCallable patchReg
    *
    * @param autoscaler Name of the autoscaler to update.
    * @param region Name of the region scoping this request.
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
+   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+   *     automatically scale virtual machine instances in managed instance groups according to an
+   *     autoscaling policy that you define. For more information, read Autoscaling Groups of
+   *     Instances.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateRegionAutoscaler(String autoscaler, RegionName region, Autoscaler autoscalerResource) {
+  public final Operation updateRegionAutoscaler(
+      String autoscaler, RegionName region, Autoscaler autoscalerResource) {
 
     UpdateRegionAutoscalerHttpRequest request =
         UpdateRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .setRegion(region == null ? null : region.toString())
-        .setAutoscalerResource(autoscalerResource)
-        .build();
+            .setAutoscaler(autoscaler)
+            .setRegion(region == null ? null : region.toString())
+            .setAutoscalerResource(autoscalerResource)
+            .build();
     return updateRegionAutoscaler(request);
   }
 
@@ -746,7 +775,8 @@ public final Operation updateRegionAutoscaler(String autoscaler, RegionName regi
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -758,18 +788,22 @@ public final Operation updateRegionAutoscaler(String autoscaler, RegionName regi
    *
    * @param autoscaler Name of the autoscaler to update.
    * @param region Name of the region scoping this request.
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
+   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+   *     automatically scale virtual machine instances in managed instance groups according to an
+   *     autoscaling policy that you define. For more information, read Autoscaling Groups of
+   *     Instances.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateRegionAutoscaler(String autoscaler, String region, Autoscaler autoscalerResource) {
+  public final Operation updateRegionAutoscaler(
+      String autoscaler, String region, Autoscaler autoscalerResource) {
 
     UpdateRegionAutoscalerHttpRequest request =
         UpdateRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .setRegion(region)
-        .setAutoscalerResource(autoscalerResource)
-        .build();
+            .setAutoscaler(autoscaler)
+            .setRegion(region)
+            .setAutoscalerResource(autoscalerResource)
+            .build();
     return updateRegionAutoscaler(request);
   }
 
@@ -777,7 +811,8 @@ public final Operation updateRegionAutoscaler(String autoscaler, String region,
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -804,7 +839,8 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -822,7 +858,8 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable updateRegionAutoscalerCallable() { + public final UnaryCallable + updateRegionAutoscalerCallable() { return stub.updateRegionAutoscalerCallable(); } @@ -856,12 +893,13 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionAutoscalersPagedResponse extends AbstractPagedListResponse< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage, - ListRegionAutoscalersFixedSizeCollection> { + public static class ListRegionAutoscalersPagedResponse + extends AbstractPagedListResponse< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage, + ListRegionAutoscalersFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -881,15 +919,14 @@ public ListRegionAutoscalersPagedResponse apply(ListRegionAutoscalersPage input) private ListRegionAutoscalersPagedResponse(ListRegionAutoscalersPage page) { super(page, ListRegionAutoscalersFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionAutoscalersPage extends AbstractPage< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage> { + public static class ListRegionAutoscalersPage + extends AbstractPage< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage> { private ListRegionAutoscalersPage( PageContext context, @@ -914,20 +951,18 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage, - ListRegionAutoscalersFixedSizeCollection> { + public static class ListRegionAutoscalersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage, + ListRegionAutoscalersFixedSizeCollection> { - private ListRegionAutoscalersFixedSizeCollection(List pages, int collectionSize) { + private ListRegionAutoscalersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -940,7 +975,5 @@ protected ListRegionAutoscalersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionAutoscalersFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java index acc506b8b2bf..4753665af903 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private SerialPortOutput() { this.start = null; } - private SerialPortOutput( - String contents, - String kind, - String next, - String selfLink, - String start - ) { + String contents, String kind, String next, String selfLink, String start) { this.contents = contents; this.kind = kind; this.next = next; @@ -128,22 +119,24 @@ public String getStart() { return start; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SerialPortOutput prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SerialPortOutput getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SerialPortOutput DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SerialPortOutput(); } @@ -230,19 +223,9 @@ public Builder setStart(String start) { return this; } - public SerialPortOutput build() { - - - - return new SerialPortOutput( - contents, - kind, - next, - selfLink, - start - ); + return new SerialPortOutput(contents, kind, next, selfLink, start); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "SerialPortOutput{" - + "contents=" + contents + ", " - + "kind=" + kind + ", " - + "next=" + next + ", " - + "selfLink=" + selfLink + ", " - + "start=" + start + + "contents=" + + contents + + ", " + + "kind=" + + kind + + ", " + + "next=" + + next + + ", " + + "selfLink=" + + selfLink + + ", " + + "start=" + + start + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof SerialPortOutput) { SerialPortOutput that = (SerialPortOutput) o; - return - Objects.equals(this.contents, that.getContents()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.next, that.getNext()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.start, that.getStart()) - ; + return Objects.equals(this.contents, that.getContents()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.next, that.getNext()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.start, that.getStart()); } return false; } @Override public int hashCode() { - return Objects.hash( - contents, - kind, - next, - selfLink, - start - ); + return Objects.hash(contents, kind, next, selfLink, start); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java index c2fc01490661..de34cf340414 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private TargetPoolInstanceHealth() { this.kind = null; } - - private TargetPoolInstanceHealth( - List healthStatus, - String kind - ) { + private TargetPoolInstanceHealth(List healthStatus, String kind) { this.healthStatus = healthStatus; this.kind = kind; } @@ -90,22 +85,24 @@ public String getKind() { return kind; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolInstanceHealth prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolInstanceHealth getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolInstanceHealth DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolInstanceHealth(); } @@ -158,13 +155,9 @@ public Builder setKind(String kind) { return this; } - public TargetPoolInstanceHealth build() { - return new TargetPoolInstanceHealth( - healthStatus, - kind - ); + return new TargetPoolInstanceHealth(healthStatus, kind); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "TargetPoolInstanceHealth{" - + "healthStatus=" + healthStatus + ", " - + "kind=" + kind + + "healthStatus=" + + healthStatus + + ", " + + "kind=" + + kind + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolInstanceHealth) { TargetPoolInstanceHealth that = (TargetPoolInstanceHealth) o; - return - Objects.equals(this.healthStatus, that.getHealthStatusList()) && - Objects.equals(this.kind, that.getKind()) - ; + return Objects.equals(this.healthStatus, that.getHealthStatusList()) + && Objects.equals(this.kind, that.getKind()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthStatus, - kind - ); + return Objects.hash(healthStatus, kind); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java index 352aa6b90f0d..642fca8dd7d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java @@ -21,13 +21,8 @@ import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @@ -37,7 +32,8 @@ public final class TargetPoolName implements ResourceName { private final String region; private final String targetPool; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetPools/{targetPool}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/targetPools/{targetPool}"); private volatile Map fieldValuesMap; @@ -55,29 +51,12 @@ private TargetPoolName(Builder builder) { targetPool = Preconditions.checkNotNull(builder.getTargetPool()); } - public static TargetPoolName of( - String project, - String region, - String targetPool - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setTargetPool(targetPool) - .build(); + public static TargetPoolName of(String project, String region, String targetPool) { + return newBuilder().setProject(project).setRegion(region).setTargetPool(targetPool).build(); } - public static String format( - String project, - String region, - String targetPool - ) { - return of( - project, - region, - targetPool - ) - .toString(); + public static String format(String project, String region, String targetPool) { + return of(project, region, targetPool).toString(); } public String getProject() { @@ -92,7 +71,6 @@ public String getTargetPool() { return targetPool; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -113,21 +91,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public TargetPoolName parse(String formattedString) {return TargetPoolName.parse(formattedString);} + public TargetPoolName parse(String formattedString) { + return TargetPoolName.parse(formattedString); + } }; } public static TargetPoolName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetPoolName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("targetPool") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "TargetPoolName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("targetPool")); } public static boolean isParsableFrom(String formattedString) { @@ -142,9 +118,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getTargetPool() { return targetPool; } @@ -153,10 +131,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setTargetPool(String targetPool) { this.targetPool = targetPool; return this; @@ -164,7 +144,7 @@ public Builder setTargetPool(String targetPool) { private Builder() {} - public Builder (TargetPoolName targetPoolName) { + public Builder(TargetPoolName targetPoolName) { project = targetPoolName.project; region = targetPoolName.region; targetPool = targetPoolName.targetPool; @@ -180,8 +160,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "targetPool", targetPool - ); + "targetPool", targetPool); } @Override @@ -191,21 +170,15 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolName) { TargetPoolName that = (TargetPoolName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.targetPool, that.getTargetPool()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.targetPool, that.getTargetPool()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - targetPool - ); + return Objects.hash(project, region, targetPool); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index 8437416d2bc3..94f5cdffeaef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private UpdateRouterHttpRequest() { this.userIp = null; } - private UpdateRouterHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private UpdateRouterHttpRequest( String quotaUser, String router, Router routerResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateRouterHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateRouterHttpRequest build() { String missing = ""; - - - - - if (router == null) { missing += " router"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "UpdateRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "router=" + router + ", " - + "routerResource=" + routerResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "router=" + + router + + ", " + + "routerResource=" + + routerResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof UpdateRouterHttpRequest) { UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.routerResource, that.getRouterResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.routerResource, that.getRouterResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java index 3abdaaee2d8e..ecf765d37354 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java @@ -21,13 +21,8 @@ import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @@ -36,7 +31,7 @@ public final class UrlMapName implements ResourceName { private final String project; private final String urlMap; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}"); private volatile Map fieldValuesMap; @@ -53,25 +48,12 @@ private UrlMapName(Builder builder) { urlMap = Preconditions.checkNotNull(builder.getUrlMap()); } - public static UrlMapName of( - String project, - String urlMap - ) { - return newBuilder() - .setProject(project) - .setUrlMap(urlMap) - .build(); + public static UrlMapName of(String project, String urlMap) { + return newBuilder().setProject(project).setUrlMap(urlMap).build(); } - public static String format( - String project, - String urlMap - ) { - return of( - project, - urlMap - ) - .toString(); + public static String format(String project, String urlMap) { + return of(project, urlMap).toString(); } public String getProject() { @@ -82,7 +64,6 @@ public String getUrlMap() { return urlMap; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -102,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public UrlMapName parse(String formattedString) {return UrlMapName.parse(formattedString);} + public UrlMapName parse(String formattedString) { + return UrlMapName.parse(formattedString); + } }; } public static UrlMapName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "UrlMapName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("urlMap") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "UrlMapName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("urlMap")); } public static boolean isParsableFrom(String formattedString) { @@ -129,6 +109,7 @@ public static class Builder { public String getProject() { return project; } + public String getUrlMap() { return urlMap; } @@ -137,6 +118,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setUrlMap(String urlMap) { this.urlMap = urlMap; return this; @@ -144,7 +126,7 @@ public Builder setUrlMap(String urlMap) { private Builder() {} - public Builder (UrlMapName urlMapName) { + public Builder(UrlMapName urlMapName) { project = urlMapName.project; urlMap = urlMapName.urlMap; } @@ -158,8 +140,7 @@ public UrlMapName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "urlMap", urlMap - ); + "urlMap", urlMap); } @Override @@ -169,19 +150,14 @@ public boolean equals(Object o) { } if (o instanceof UrlMapName) { UrlMapName that = (UrlMapName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.urlMap, that.getUrlMap()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - urlMap - ); + return Objects.hash(project, urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java index efee9618f647..e655806544db 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,12 +24,9 @@ import com.google.cloud.compute.v1.AddressList; import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectAddressName; -import com.google.cloud.compute.v1.ProjectName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,7 +39,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalAddressStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteGlobalAddressCallable() { throw new UnsupportedOperationException("Not implemented: deleteGlobalAddressCallable()"); @@ -57,7 +55,8 @@ public UnaryCallable insertGlobalAddr } @BetaApi - public UnaryCallable listGlobalAddressesPagedCallable() { + public UnaryCallable + listGlobalAddressesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalAddressesPagedCallable()"); } @@ -65,5 +64,4 @@ public UnaryCallable listGlobalAddressesCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalAddressesCallable()"); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java index 50372c488cf4..4ed7f958caaa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java @@ -15,78 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AccessConfig; -import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; -import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; -import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; -import com.google.cloud.compute.v1.AttachedDisk; -import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; -import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; -import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; -import com.google.cloud.compute.v1.GetInstanceHttpRequest; -import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; -import com.google.cloud.compute.v1.InsertInstanceHttpRequest; -import com.google.cloud.compute.v1.Instance; -import com.google.cloud.compute.v1.InstanceAggregatedList; -import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; -import com.google.cloud.compute.v1.InstanceList; -import com.google.cloud.compute.v1.InstanceName; -import com.google.cloud.compute.v1.InstanceSettings; -import com.google.cloud.compute.v1.InstancesScopedList; -import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; -import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; -import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; -import com.google.cloud.compute.v1.ListInstancesHttpRequest; -import com.google.cloud.compute.v1.Metadata; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ResetInstanceHttpRequest; -import com.google.cloud.compute.v1.Scheduling; -import com.google.cloud.compute.v1.SerialPortOutput; -import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; -import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; -import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; -import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; -import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; -import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; -import com.google.cloud.compute.v1.StartInstanceHttpRequest; -import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; -import com.google.cloud.compute.v1.StopInstanceHttpRequest; -import com.google.cloud.compute.v1.Tags; -import com.google.cloud.compute.v1.ZoneName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -103,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -120,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index b700479b3cf5..faf429b67f99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteRouteHttpRequest; @@ -36,16 +37,10 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.Route; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; import com.google.cloud.compute.v1.RouteList; import com.google.cloud.compute.v1.RouteName; -import com.google.cloud.compute.v1.RouteSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,24 +54,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRouteStub extends RouteStub { @InternalApi - public static final ApiMethodDescriptor deleteRouteMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(RouteName.newFactory()) - .setResourceNameField("route") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(RouteName.newFactory()) + .setResourceNameField("route") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getRouteMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -86,8 +82,7 @@ public class HttpJsonRouteStub extends RouteStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) - .setQueryParams(Sets.newHashSet( - )) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(RouteName.newFactory()) .setResourceNameField("route") .build()) @@ -96,54 +91,59 @@ public class HttpJsonRouteStub extends RouteStub { .setResponseInstance(Route.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor insertRouteMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRoutesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RouteList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRoutesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouteList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteRouteCallable; private final UnaryCallable getRouteCallable; private final UnaryCallable insertRouteCallable; private final UnaryCallable listRoutesCallable; - private final UnaryCallable listRoutesPagedCallable; + private final UnaryCallable + listRoutesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRouteStub create(RouteStubSettings settings) throws IOException { return new HttpJsonRouteStub(settings, ClientContext.create(settings)); } @@ -152,25 +152,32 @@ public static final HttpJsonRouteStub create(ClientContext clientContext) throws return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRouteStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRouteStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouteStub( + RouteStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRouteStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRouteStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonRouteCallableFactory()); } /** - * Constructs an instance of HttpJsonRouteStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRouteStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRouteStub( + RouteStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteRouteTransportSettings = @@ -190,11 +197,21 @@ protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientCont .setMethodDescriptor(listRoutesMethodDescriptor) .build(); - this.deleteRouteCallable = callableFactory.createUnaryCallable(deleteRouteTransportSettings,settings.deleteRouteSettings(), clientContext); - this.getRouteCallable = callableFactory.createUnaryCallable(getRouteTransportSettings,settings.getRouteSettings(), clientContext); - this.insertRouteCallable = callableFactory.createUnaryCallable(insertRouteTransportSettings,settings.insertRouteSettings(), clientContext); - this.listRoutesCallable = callableFactory.createUnaryCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); - this.listRoutesPagedCallable = callableFactory.createPagedCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); + this.deleteRouteCallable = + callableFactory.createUnaryCallable( + deleteRouteTransportSettings, settings.deleteRouteSettings(), clientContext); + this.getRouteCallable = + callableFactory.createUnaryCallable( + getRouteTransportSettings, settings.getRouteSettings(), clientContext); + this.insertRouteCallable = + callableFactory.createUnaryCallable( + insertRouteTransportSettings, settings.insertRouteSettings(), clientContext); + this.listRoutesCallable = + callableFactory.createUnaryCallable( + listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); + this.listRoutesPagedCallable = + callableFactory.createPagedCallable( + listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -253,5 +270,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java index de8fcd2e5bf2..599733850786 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java @@ -15,48 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; -import com.google.cloud.compute.v1.GetSnapshotHttpRequest; -import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.Snapshot; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; -import com.google.cloud.compute.v1.SnapshotList; -import com.google.cloud.compute.v1.SnapshotName; -import com.google.cloud.compute.v1.SnapshotSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -73,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -90,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index 1e37d6697c45..b615d1b6834a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -15,6 +15,16 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,16 +35,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -51,18 +52,18 @@ @javax.annotation.Generated("by GAPIC") public class AutoscalerClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListAutoscalersMethodDescriptor, - deleteAutoscalerMethodDescriptor, - getAutoscalerMethodDescriptor, - insertAutoscalerMethodDescriptor, - listAutoscalersMethodDescriptor, - patchAutoscalerMethodDescriptor, - updateAutoscalerMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAutoscalersMethodDescriptor, + deleteAutoscalerMethodDescriptor, + getAutoscalerMethodDescriptor, + insertAutoscalerMethodDescriptor, + listAutoscalersMethodDescriptor, + patchAutoscalerMethodDescriptor, + updateAutoscalerMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); private static AutoscalerClient client; private static AutoscalerSettings clientSettings; @@ -71,13 +72,13 @@ public class AutoscalerClientTest { public static void setUp() throws IOException { clientSettings = AutoscalerSettings.newBuilder() - .setTransportChannelProvider( - AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - AutoscalerClient.create(clientSettings); + .setTransportChannelProvider( + AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AutoscalerClient.create(clientSettings); } @After @@ -100,37 +101,47 @@ public void aggregatedListAutoscalersTest() { AutoscalersScopedList itemsItem = AutoscalersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - AutoscalerAggregatedList expectedResponse = AutoscalerAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + AutoscalerAggregatedList expectedResponse = + AutoscalerAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListAutoscalersPagedResponse pagedListResponse = client.aggregatedListAutoscalers(project); + AggregatedListAutoscalersPagedResponse pagedListResponse = + client.aggregatedListAutoscalers(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListAutoscalersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -167,50 +178,58 @@ public void deleteAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - Operation actualResponse = - client.deleteAutoscaler(autoscaler); + Operation actualResponse = client.deleteAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -235,38 +254,46 @@ public void getAutoscalerTest() { RegionName region = RegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String target = "target-880905839"; - Autoscaler expectedResponse = Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setTarget(target) - .build(); + Autoscaler expectedResponse = + Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .build(); mockService.addResponse(expectedResponse); AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - Autoscaler actualResponse = - client.getAutoscaler(autoscaler); + Autoscaler actualResponse = client.getAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -303,51 +330,59 @@ public void insertAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.insertAutoscaler(zone, autoscalerResource); + Operation actualResponse = client.insertAutoscaler(zone, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -370,13 +405,14 @@ public void listAutoscalersTest() { String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); - AutoscalerList expectedResponse = AutoscalerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + AutoscalerList expectedResponse = + AutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); @@ -385,22 +421,29 @@ public void listAutoscalersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listAutoscalersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -437,52 +480,60 @@ public void patchAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.patchAutoscaler(autoscaler, zone, autoscalerResource); + Operation actualResponse = client.patchAutoscaler(autoscaler, zone, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -521,52 +572,60 @@ public void updateAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.updateAutoscaler(autoscaler, zone, autoscalerResource); + Operation actualResponse = client.updateAutoscaler(autoscaler, zone, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -580,5 +639,4 @@ public void updateAutoscalerExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} From 4a9e28b9ad65035039fb77404ed13e981d7a137a Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 29 Mar 2018 21:49:53 -0700 Subject: [PATCH 08/42] revert deprecated ITComputeTest.java --- .../compute/deprecated/it/ITComputeTest.java | 3684 ++++++++--------- 1 file changed, 1842 insertions(+), 1842 deletions(-) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java index 18116a7a4a8f..943d915ced9c 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java @@ -1,1842 +1,1842 @@ -// /* -// * Copyright 2016 Google LLC -// * -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ -// -// package com.google.cloud.compute.deprecated.it; -// -// import static org.junit.Assert.assertEquals; -// import static org.junit.Assert.assertFalse; -// import static org.junit.Assert.assertNotEquals; -// import static org.junit.Assert.assertNotNull; -// import static org.junit.Assert.assertNull; -// import static org.junit.Assert.assertTrue; -// -// import com.google.api.gax.paging.Page; -// import com.google.cloud.compute.deprecated.Address; -// import com.google.cloud.compute.deprecated.AddressId; -// import com.google.cloud.compute.deprecated.AddressInfo; -// import com.google.cloud.compute.deprecated.AttachedDisk; -// import com.google.cloud.compute.deprecated.Compute; -// import com.google.cloud.compute.deprecated.DeprecationStatus; -// import com.google.cloud.compute.deprecated.Disk; -// import com.google.cloud.compute.deprecated.DiskConfiguration; -// import com.google.cloud.compute.deprecated.DiskId; -// import com.google.cloud.compute.deprecated.DiskImageConfiguration; -// import com.google.cloud.compute.deprecated.DiskInfo; -// import com.google.cloud.compute.deprecated.DiskType; -// import com.google.cloud.compute.deprecated.DiskTypeId; -// import com.google.cloud.compute.deprecated.GlobalAddressId; -// import com.google.cloud.compute.deprecated.Image; -// import com.google.cloud.compute.deprecated.ImageConfiguration; -// import com.google.cloud.compute.deprecated.ImageDiskConfiguration; -// import com.google.cloud.compute.deprecated.ImageId; -// import com.google.cloud.compute.deprecated.ImageInfo; -// import com.google.cloud.compute.deprecated.Instance; -// import com.google.cloud.compute.deprecated.InstanceId; -// import com.google.cloud.compute.deprecated.InstanceInfo; -// import com.google.cloud.compute.deprecated.License; -// import com.google.cloud.compute.deprecated.LicenseId; -// import com.google.cloud.compute.deprecated.MachineType; -// import com.google.cloud.compute.deprecated.MachineTypeId; -// import com.google.cloud.compute.deprecated.Network; -// import com.google.cloud.compute.deprecated.NetworkConfiguration; -// import com.google.cloud.compute.deprecated.NetworkId; -// import com.google.cloud.compute.deprecated.NetworkInfo; -// import com.google.cloud.compute.deprecated.NetworkInterface; -// import com.google.cloud.compute.deprecated.Operation; -// import com.google.cloud.compute.deprecated.Region; -// import com.google.cloud.compute.deprecated.RegionAddressId; -// import com.google.cloud.compute.deprecated.RegionOperationId; -// import com.google.cloud.compute.deprecated.SchedulingOptions; -// import com.google.cloud.compute.deprecated.Snapshot; -// import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; -// import com.google.cloud.compute.deprecated.SnapshotId; -// import com.google.cloud.compute.deprecated.SnapshotInfo; -// import com.google.cloud.compute.deprecated.StandardDiskConfiguration; -// import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; -// import com.google.cloud.compute.deprecated.StorageImageConfiguration; -// import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; -// import com.google.cloud.compute.deprecated.Subnetwork; -// import com.google.cloud.compute.deprecated.SubnetworkId; -// import com.google.cloud.compute.deprecated.SubnetworkInfo; -// import com.google.cloud.compute.deprecated.Zone; -// import com.google.cloud.compute.deprecated.ZoneOperationId; -// import com.google.cloud.compute.deprecated.testing.ResourceCleaner; -// import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; -// import com.google.common.collect.ImmutableList; -// import com.google.common.collect.ImmutableMap; -// import com.google.common.collect.ImmutableSet; -// import java.util.Iterator; -// import java.util.List; -// import java.util.Map; -// import java.util.Set; -// import java.util.concurrent.TimeoutException; -// import org.junit.AfterClass; -// import org.junit.BeforeClass; -// import org.junit.Ignore; -// import org.junit.Rule; -// import org.junit.Test; -// import org.junit.rules.Timeout; -// -// public class ITComputeTest { -// -// private static final String REGION = "us-central1"; -// private static final String ZONE = "us-central1-a"; -// private static final String DISK_TYPE = "local-ssd"; -// private static final String MACHINE_TYPE = "f1-micro"; -// private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); -// private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); -// private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); -// private static final String IMAGE_PROJECT = "debian-cloud"; -// -// private static Compute compute; -// private static ResourceCleaner resourceCleaner; -// -// -// @Rule -// public Timeout globalTimeout = Timeout.seconds(300); -// -// @BeforeClass -// public static void beforeClass() { -// RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); -// compute = computeHelper.getOptions().getService(); -// resourceCleaner = ResourceCleaner.create(compute); -// } -// -// @AfterClass -// public static void tearDown() { -// resourceCleaner.cleanUp(); -// } -// -// @Test -// public void testGetDiskType() { -// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); -// // assertNotNull(diskType.getGeneratedId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotNull(diskType.getDefaultDiskSizeGb()); -// } -// -// @Test -// public void testGetDiskTypeWithSelectedFields() { -// DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, -// Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); -// // assertNotNull(diskType.getGeneratedId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNull(diskType.getDescription()); -// assertNull(diskType.getValidDiskSize()); -// assertNull(diskType.getDefaultDiskSizeGb()); -// } -// -// @Test -// public void testListDiskTypes() { -// Page diskPage = compute.listDiskTypes(ZONE); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotNull(diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testListDiskTypesWithSelectedFields() { -// Page diskPage = compute.listDiskTypes(ZONE, -// Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// assertNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNull(diskType.getDescription()); -// assertNull(diskType.getValidDiskSize()); -// assertNull(diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testListDiskTypesWithFilter() { -// Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( -// Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // todo(mziccard): uncomment or remove once #695 is closed -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertEquals(ZONE, diskType.getDiskTypeId().getZone()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListDiskTypes() { -// Page diskPage = compute.listDiskTypes(); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotNull(diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListDiskTypesWithFilter() { -// Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( -// Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); -// Iterator diskTypeIterator = diskPage.iterateAll().iterator(); -// assertTrue(diskTypeIterator.hasNext()); -// while (diskTypeIterator.hasNext()) { -// DiskType diskType = diskTypeIterator.next(); -// // todo(mziccard): uncomment or remove once #695 is closed -// // assertNotNull(diskType.getGeneratedId()); -// assertNotNull(diskType.getDiskTypeId()); -// assertNotNull(diskType.getCreationTimestamp()); -// assertNotNull(diskType.getDescription()); -// assertNotNull(diskType.getValidDiskSize()); -// assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); -// } -// } -// -// @Test -// public void testGetMachineType() { -// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// -// @Test -// public void testGetMachineTypeWithSelectedFields() { -// MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, -// Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); -// assertNotNull(machineType.getGeneratedId()); -// assertNull(machineType.getCreationTimestamp()); -// assertNull(machineType.getDescription()); -// assertNull(machineType.getCpus()); -// assertNull(machineType.getMemoryMb()); -// assertNull(machineType.getMaximumPersistentDisks()); -// assertNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// -// @Test -// public void testListMachineTypes() { -// Page machinePage = compute.listMachineTypes(ZONE); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testListMachineTypesWithSelectedFields() { -// Page machinePage = compute.listMachineTypes(ZONE, -// Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNull(machineType.getDescription()); -// assertNull(machineType.getCpus()); -// assertNull(machineType.getMemoryMb()); -// assertNull(machineType.getMaximumPersistentDisks()); -// assertNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testListMachineTypesWithFilter() { -// Page machinePage = compute.listMachineTypes(ZONE, -// Compute.MachineTypeListOption.filter( -// Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertEquals(ZONE, machineType.getMachineTypeId().getZone()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertEquals(2, (long) machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListMachineTypes() { -// Page machinePage = compute.listMachineTypes(); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testAggregatedListMachineTypesWithFilter() { -// Page machinePage = -// compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( -// Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); -// Iterator machineTypeIterator = machinePage.iterateAll().iterator(); -// assertTrue(machineTypeIterator.hasNext()); -// while (machineTypeIterator.hasNext()) { -// MachineType machineType = machineTypeIterator.next(); -// assertNotNull(machineType.getMachineTypeId()); -// assertNotNull(machineType.getGeneratedId()); -// assertNotNull(machineType.getCreationTimestamp()); -// assertNotNull(machineType.getDescription()); -// assertNotNull(machineType.getCpus()); -// assertNotEquals(2, (long) machineType.getCpus()); -// assertNotNull(machineType.getMemoryMb()); -// assertNotNull(machineType.getMaximumPersistentDisks()); -// assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); -// } -// } -// -// @Test -// public void testGetLicense() { -// License license = compute.getLicense(LICENSE_ID); -// assertEquals(LICENSE_ID, license.getLicenseId()); -// assertNotNull(license.chargesUseFee()); -// } -// -// @Test -// public void testGetLicenseWithSelectedFields() { -// License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); -// assertEquals(LICENSE_ID, license.getLicenseId()); -// assertNull(license.chargesUseFee()); -// } -// -// @Test -// public void testGetRegion() { -// Region region = compute.getRegion(REGION); -// assertEquals(REGION, region.getRegionId().getRegion()); -// assertNotNull(region.getDescription()); -// assertNotNull(region.getCreationTimestamp()); -// assertNotNull(region.getGeneratedId()); -// assertNotNull(region.getQuotas()); -// assertNotNull(region.getStatus()); -// assertNotNull(region.getZones()); -// } -// -// @Test -// public void testGetRegionWithSelectedFields() { -// Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); -// assertEquals(REGION, region.getRegionId().getRegion()); -// assertNotNull(region.getGeneratedId()); -// assertNull(region.getDescription()); -// assertNull(region.getCreationTimestamp()); -// assertNull(region.getQuotas()); -// assertNull(region.getStatus()); -// assertNull(region.getZones()); -// } -// -// @Test -// public void testListRegions() { -// Page regionPage = compute.listRegions(); -// Iterator regionIterator = regionPage.iterateAll().iterator(); -// while (regionIterator.hasNext()) { -// Region region = regionIterator.next(); -// assertNotNull(region.getRegionId()); -// assertNotNull(region.getDescription()); -// assertNotNull(region.getCreationTimestamp()); -// assertNotNull(region.getGeneratedId()); -// assertNotNull(region.getQuotas()); -// assertNotNull(region.getStatus()); -// assertNotNull(region.getZones()); -// } -// } -// -// @Test -// public void testListRegionsWithSelectedFields() { -// Page regionPage = -// compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); -// Iterator regionIterator = regionPage.iterateAll().iterator(); -// while (regionIterator.hasNext()) { -// Region region = regionIterator.next(); -// assertNotNull(region.getRegionId()); -// assertNull(region.getDescription()); -// assertNull(region.getCreationTimestamp()); -// assertNotNull(region.getGeneratedId()); -// assertNull(region.getQuotas()); -// assertNull(region.getStatus()); -// assertNull(region.getZones()); -// } -// } -// -// @Test -// public void testListRegionsWithFilter() { -// Page regionPage = compute.listRegions(Compute.RegionListOption.filter( -// Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); -// Iterator regionIterator = regionPage.iterateAll().iterator(); -// assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); -// assertFalse(regionIterator.hasNext()); -// } -// -// @Test -// public void testGetZone() { -// Zone zone = compute.getZone(ZONE); -// assertEquals(ZONE, zone.getZoneId().getZone()); -// assertNotNull(zone.getGeneratedId()); -// assertNotNull(zone.getCreationTimestamp()); -// assertNotNull(zone.getDescription()); -// assertNotNull(zone.getStatus()); -// assertNotNull(zone.getRegion()); -// } -// -// @Test -// public void testGetZoneWithSelectedFields() { -// Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); -// assertEquals(ZONE, zone.getZoneId().getZone()); -// assertNotNull(zone.getGeneratedId()); -// assertNull(zone.getCreationTimestamp()); -// assertNull(zone.getDescription()); -// assertNull(zone.getStatus()); -// assertNull(zone.getRegion()); -// } -// -// @Test -// public void testListZones() { -// Page zonePage = compute.listZones(); -// Iterator zoneIterator = zonePage.iterateAll().iterator(); -// while (zoneIterator.hasNext()) { -// Zone zone = zoneIterator.next(); -// assertNotNull(zone.getZoneId()); -// assertNotNull(zone.getGeneratedId()); -// assertNotNull(zone.getCreationTimestamp()); -// assertNotNull(zone.getDescription()); -// assertNotNull(zone.getStatus()); -// assertNotNull(zone.getRegion()); -// } -// } -// -// @Test -// public void testListZonesWithSelectedFields() { -// Page zonePage = compute.listZones( -// Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); -// Iterator zoneIterator = zonePage.iterateAll().iterator(); -// while (zoneIterator.hasNext()) { -// Zone zone = zoneIterator.next(); -// assertNotNull(zone.getZoneId()); -// assertNull(zone.getGeneratedId()); -// assertNotNull(zone.getCreationTimestamp()); -// assertNull(zone.getDescription()); -// assertNull(zone.getStatus()); -// assertNull(zone.getRegion()); -// } -// } -// -// @Test -// public void testListZonesWithFilter() { -// Page zonePage = compute.listZones( -// Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); -// Iterator zoneIterator = zonePage.iterateAll().iterator(); -// assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); -// assertFalse(zoneIterator.hasNext()); -// } -// -// @Test -// public void testListGlobalOperations() { -// Page operationPage = compute.listGlobalOperations(); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertNotNull(operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListGlobalOperationsWithSelectedFields() { -// Page operationPage = -// compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getTargetLink()); -// assertNull(operation.getTargetId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getStatus()); -// assertNull(operation.getStatusMessage()); -// assertNull(operation.getUser()); -// assertNull(operation.getProgress()); -// assertNull(operation.getDescription()); -// assertNull(operation.getInsertTime()); -// assertNull(operation.getStartTime()); -// assertNull(operation.getEndTime()); -// assertNull(operation.getWarnings()); -// assertNull(operation.getHttpErrorMessage()); -// } -// } -// -// @Test -// public void testListGlobalOperationsWithFilter() { -// Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( -// Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertEquals(Operation.Status.DONE, operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListRegionOperations() { -// Page operationPage = compute.listRegionOperations(REGION); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(REGION, operation.getOperationId().getRegion()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertNotNull(operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListRegionOperationsWithSelectedFields() { -// Page operationPage = compute.listRegionOperations(REGION, -// Compute.OperationListOption.fields(Compute.OperationField.ID)); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(REGION, operation.getOperationId().getRegion()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getTargetLink()); -// assertNull(operation.getTargetId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getStatus()); -// assertNull(operation.getStatusMessage()); -// assertNull(operation.getUser()); -// assertNull(operation.getProgress()); -// assertNull(operation.getDescription()); -// assertNull(operation.getInsertTime()); -// assertNull(operation.getStartTime()); -// assertNull(operation.getEndTime()); -// assertNull(operation.getWarnings()); -// assertNull(operation.getHttpErrorMessage()); -// } -// } -// -// @Test -// public void testListRegionOperationsWithFilter() { -// Page operationPage = compute.listRegionOperations(REGION, -// Compute.OperationListOption.filter(Compute.OperationFilter.equals( -// Compute.OperationField.STATUS, "DONE"))); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(REGION, operation.getOperationId().getRegion()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertEquals(Operation.Status.DONE, operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListZoneOperations() { -// Page operationPage = compute.listZoneOperations(ZONE); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(ZONE, operation.getOperationId().getZone()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertNotNull(operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testListZoneOperationsWithSelectedFields() { -// Page operationPage = compute.listZoneOperations(ZONE, -// Compute.OperationListOption.fields(Compute.OperationField.ID)); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(ZONE, operation.getOperationId().getZone()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getTargetLink()); -// assertNull(operation.getTargetId()); -// assertNull(operation.getOperationType()); -// assertNull(operation.getStatus()); -// assertNull(operation.getStatusMessage()); -// assertNull(operation.getUser()); -// assertNull(operation.getProgress()); -// assertNull(operation.getDescription()); -// assertNull(operation.getInsertTime()); -// assertNull(operation.getStartTime()); -// assertNull(operation.getEndTime()); -// assertNull(operation.getWarnings()); -// assertNull(operation.getHttpErrorMessage()); -// } -// } -// -// @Test -// public void testListZoneOperationsWithFilter() { -// Page operationPage = compute.listZoneOperations(ZONE, -// Compute.OperationListOption.filter(Compute.OperationFilter.equals( -// Compute.OperationField.STATUS, "DONE"))); -// Iterator operationIterator = operationPage.iterateAll().iterator(); -// while (operationIterator.hasNext()) { -// Operation operation = operationIterator.next(); -// assertNotNull(operation.getGeneratedId()); -// assertNotNull(operation.getOperationId()); -// assertEquals(ZONE, operation.getOperationId().getZone()); -// // todo(mziccard): uncomment or remove once #727 is closed -// // assertNotNull(operation.getCreationTimestamp()); -// assertNotNull(operation.getOperationType()); -// assertEquals(Operation.Status.DONE, operation.getStatus()); -// assertNotNull(operation.getUser()); -// } -// } -// -// @Test -// public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; -// AddressId addressId = RegionAddressId.of(REGION, name); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation operation = compute.create(addressInfo); -// operation.waitFor(); -// // test get -// Address remoteAddress = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNotNull(remoteAddress.getAddress()); -// assertNotNull(remoteAddress.getCreationTimestamp()); -// assertNotNull(remoteAddress.getGeneratedId()); -// assertNotNull(remoteAddress.getStatus()); -// // test get with selected fields -// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, remoteAddress.getAddressId().getRegion()); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNull(remoteAddress.getAddress()); -// assertNull(remoteAddress.getCreationTimestamp()); -// assertNull(remoteAddress.getGeneratedId()); -// operation = remoteAddress.delete(); -// operation.waitFor(); -// resourceCleaner.remove(addressId); -// assertNull(compute.getAddress(addressId)); -// } -// -// @Test -// public void testListRegionAddresses() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-region-address"; -// String[] addressNames = {prefix + "1", prefix + "2"}; -// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); -// AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); -// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); -// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstAddressId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondAddressId); -// Set addressSet = ImmutableSet.copyOf(addressNames); -// // test list -// Compute.AddressFilter filter = -// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); -// Page
addressPage = -// compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); -// Iterator
addressIterator = addressPage.iterateAll().iterator(); -// int count = 0; -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertNotNull(address.getAddressId()); -// assertTrue(address.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, address.getAddressId().getRegion()); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNotNull(address.getCreationTimestamp()); -// assertNotNull(address.getGeneratedId()); -// count++; -// } -// assertEquals(2, count); -// // test list with selected fields -// count = 0; -// addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), -// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); -// addressIterator = addressPage.iterateAll().iterator(); -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertTrue(address.getAddressId() instanceof RegionAddressId); -// assertEquals(REGION, address.getAddressId().getRegion()); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNull(address.getCreationTimestamp()); -// assertNull(address.getGeneratedId()); -// assertNull(address.getStatus()); -// assertNull(address.getUsage()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; -// String[] addressNames = {prefix + "1", prefix + "2"}; -// AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); -// AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); -// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); -// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstAddressId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondAddressId); -// Set addressSet = ImmutableSet.copyOf(addressNames); -// Compute.AddressFilter filter = -// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); -// Page
addressPage = -// compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); -// Iterator
addressIterator = addressPage.iterateAll().iterator(); -// int count = 0; -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertNotNull(address.getAddressId()); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNotNull(address.getCreationTimestamp()); -// assertNotNull(address.getGeneratedId()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; -// AddressId addressId = GlobalAddressId.of(name); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation operation = compute.create(addressInfo); -// operation.waitFor(); -// // test get -// Address remoteAddress = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNotNull(remoteAddress.getAddress()); -// assertNotNull(remoteAddress.getCreationTimestamp()); -// assertNotNull(remoteAddress.getGeneratedId()); -// assertNotNull(remoteAddress.getStatus()); -// // test get with selected fields -// remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); -// assertNotNull(remoteAddress); -// assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); -// assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); -// assertNull(remoteAddress.getAddress()); -// assertNull(remoteAddress.getCreationTimestamp()); -// assertNull(remoteAddress.getGeneratedId()); -// operation = remoteAddress.delete(); -// operation.waitFor(); -// resourceCleaner.remove(addressId); -// assertNull(compute.getAddress(addressId)); -// } -// -// @Test -// public void testListGlobalAddresses() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-global-address"; -// String[] addressNames = {prefix + "1", prefix + "2"}; -// AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); -// AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); -// Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); -// Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstAddressId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondAddressId); -// Set addressSet = ImmutableSet.copyOf(addressNames); -// // test list -// Compute.AddressFilter filter = -// Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); -// Page
addressPage = -// compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); -// Iterator
addressIterator = addressPage.iterateAll().iterator(); -// int count = 0; -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertNotNull(address.getAddressId()); -// assertTrue(address.getAddressId() instanceof GlobalAddressId); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNotNull(address.getCreationTimestamp()); -// assertNotNull(address.getGeneratedId()); -// count++; -// } -// assertEquals(2, count); -// // test list with selected fields -// count = 0; -// addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), -// Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); -// addressIterator = addressPage.iterateAll().iterator(); -// while (addressIterator.hasNext()) { -// Address address = addressIterator.next(); -// assertTrue(address.getAddressId() instanceof GlobalAddressId); -// assertTrue(addressSet.contains(address.getAddressId().getAddress())); -// assertNotNull(address.getAddress()); -// assertNull(address.getCreationTimestamp()); -// assertNull(address.getGeneratedId()); -// assertNull(address.getStatus()); -// assertNull(address.getUsage()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testCreateGetResizeAndDeleteStandardDisk() -// throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; -// DiskId diskId = DiskId.of(ZONE, name); -// DiskInfo diskInfo = -// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// // test get -// Disk remoteDisk = compute.getDisk(diskId); -// resourceCleaner.add(diskId); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.resize(200L); -// operation.waitFor(); -// // test resize and get with selected fields -// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(200L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.delete(); -// operation.waitFor(); -// resourceCleaner.remove(diskId); -// assertNull(compute.getDisk(diskId)); -// } -// -// @Test -// public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; -// DiskId diskId = DiskId.of(ZONE, name); -// DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// // test get -// Disk remoteDisk = compute.getDisk(diskId); -// resourceCleaner.add(diskId); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); -// ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); -// assertNotNull(remoteConfiguration.getSourceImageId()); -// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); -// assertNotNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// // test get with selected fields -// remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); -// remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); -// assertNull(remoteConfiguration.getSourceImageId()); -// assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); -// assertNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.delete(); -// operation.waitFor(); -// resourceCleaner.remove(diskId); -// assertNull(compute.getDisk(diskId)); -// } -// -// @Test -// public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() -// throws InterruptedException, TimeoutException { -// String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; -// String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; -// DiskId diskId = DiskId.of(ZONE, diskName); -// DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); -// String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; -// DiskInfo diskInfo = -// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// Disk remoteDisk = compute.getDisk(diskId); -// resourceCleaner.add(diskId); -// operation = remoteDisk.createSnapshot(snapshotName); -// operation.waitFor(); -// // test get snapshot with selected fields -// Snapshot snapshot = compute.getSnapshot(snapshotName, -// Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); -// resourceCleaner.add(snapshot.getSnapshotId()); -// assertNull(snapshot.getGeneratedId()); -// assertNotNull(snapshot.getSnapshotId()); -// assertNotNull(snapshot.getCreationTimestamp()); -// assertNull(snapshot.getDescription()); -// assertNull(snapshot.getStatus()); -// assertNull(snapshot.getDiskSizeGb()); -// assertNull(snapshot.getLicenses()); -// assertNull(snapshot.getSourceDisk()); -// assertNull(snapshot.getSourceDiskId()); -// assertNull(snapshot.getStorageBytes()); -// assertNull(snapshot.getStorageBytesStatus()); -// // test get snapshot -// snapshot = compute.getSnapshot(snapshotName); -// assertNotNull(snapshot.getGeneratedId()); -// assertNotNull(snapshot.getSnapshotId()); -// assertNotNull(snapshot.getCreationTimestamp()); -// assertNotNull(snapshot.getStatus()); -// assertEquals(100L, (long) snapshot.getDiskSizeGb()); -// assertEquals(diskName, snapshot.getSourceDisk().getDisk()); -// assertNotNull(snapshot.getSourceDiskId()); -// assertNotNull(snapshot.getStorageBytes()); -// assertNotNull(snapshot.getStorageBytesStatus()); -// remoteDisk.delete(); -// resourceCleaner.remove(diskId); -// diskInfo = -// DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); -// operation = compute.create(diskInfo); -// operation.waitFor(); -// // test get disk -// remoteDisk = compute.getDisk(snapshotDiskId); -// resourceCleaner.add(snapshotDiskId); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); -// SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); -// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNotNull(remoteConfiguration.getSourceSnapshotId()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// // test get disk with selected fields -// remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); -// assertNotNull(remoteDisk); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); -// assertNull(remoteDisk.getCreationStatus()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); -// remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); -// assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); -// assertNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); -// assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// operation = remoteDisk.delete(); -// operation.waitFor(); -// resourceCleaner.remove(snapshotDiskId); -// assertNull(compute.getDisk(snapshotDiskId)); -// operation = snapshot.delete(); -// operation.waitFor(); -// resourceCleaner.remove(snapshot.getSnapshotId()); -// assertNull(compute.getSnapshot(snapshotName)); -// } -// -// @Test -// public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; -// String[] diskNames = {prefix + "1", prefix + "2"}; -// DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); -// DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); -// DiskConfiguration configuration = -// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); -// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); -// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstDiskId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondDiskId); -// Set diskSet = ImmutableSet.copyOf(diskNames); -// // test list disks -// Compute.DiskFilter diskFilter = -// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); -// Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); -// Iterator diskIterator = diskPage.iterateAll().iterator(); -// int count = 0; -// while (diskIterator.hasNext()) { -// Disk remoteDisk = diskIterator.next(); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// count++; -// } -// assertEquals(2, count); -// // test list disks with selected fields -// count = 0; -// diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), -// Compute.DiskListOption.fields(Compute.DiskField.STATUS)); -// diskIterator = diskPage.iterateAll().iterator(); -// while (diskIterator.hasNext()) { -// Disk remoteDisk = diskIterator.next(); -// assertEquals(ZONE, remoteDisk.getDiskId().getZone()); -// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNull(remoteDisk.getCreationTimestamp()); -// assertNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertNull(remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// assertNull(remoteDisk.getLastAttachTimestamp()); -// assertNull(remoteDisk.getLastDetachTimestamp()); -// count++; -// } -// assertEquals(2, count); -// // test snapshots -// SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); -// SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); -// firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); -// secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstSnapshotId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondSnapshotId); -// // test list snapshots -// Compute.SnapshotFilter snapshotFilter = -// Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); -// Page snapshotPage = -// compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); -// Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); -// count = 0; -// while (snapshotIterator.hasNext()) { -// Snapshot remoteSnapshot = snapshotIterator.next(); -// assertNotNull(remoteSnapshot.getGeneratedId()); -// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); -// assertNotNull(remoteSnapshot.getCreationTimestamp()); -// assertNotNull(remoteSnapshot.getStatus()); -// assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); -// assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); -// assertNotNull(remoteSnapshot.getSourceDiskId()); -// assertNotNull(remoteSnapshot.getStorageBytes()); -// assertNotNull(remoteSnapshot.getStorageBytesStatus()); -// count++; -// } -// assertEquals(2, count); -// // test list snapshots with selected fields -// snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), -// Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); -// snapshotIterator = snapshotPage.iterateAll().iterator(); -// count = 0; -// while (snapshotIterator.hasNext()) { -// Snapshot remoteSnapshot = snapshotIterator.next(); -// assertNull(remoteSnapshot.getGeneratedId()); -// assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); -// assertNotNull(remoteSnapshot.getCreationTimestamp()); -// assertNull(remoteSnapshot.getStatus()); -// assertNull(remoteSnapshot.getDiskSizeGb()); -// assertNull(remoteSnapshot.getSourceDisk()); -// assertNull(remoteSnapshot.getSourceDiskId()); -// assertNull(remoteSnapshot.getStorageBytes()); -// assertNull(remoteSnapshot.getStorageBytesStatus()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testAggregatedListDisks() throws InterruptedException, TimeoutException { -// String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; -// String[] diskZones = {"us-central1-a", "us-east1-c"}; -// String[] diskNames = {prefix + "1", prefix + "2"}; -// DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); -// DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); -// DiskConfiguration configuration = -// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); -// Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); -// Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); -// firstOperation.waitFor(); -// resourceCleaner.add(firstDiskId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondDiskId); -// Set zoneSet = ImmutableSet.copyOf(diskZones); -// Set diskSet = ImmutableSet.copyOf(diskNames); -// Compute.DiskFilter diskFilter = -// Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); -// Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); -// Iterator diskIterator = diskPage.iterateAll().iterator(); -// int count = 0; -// while (diskIterator.hasNext()) { -// Disk remoteDisk = diskIterator.next(); -// assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); -// assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); -// assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); -// assertNotNull(remoteDisk.getCreationTimestamp()); -// assertNotNull(remoteDisk.getGeneratedId()); -// assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); -// StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); -// assertEquals(100L, (long) remoteConfiguration.getSizeGb()); -// assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); -// assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); -// count++; -// } -// assertEquals(2, count); -// } -// -// @Test -// public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { -// String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; -// String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; -// DiskId diskId = DiskId.of(ZONE, diskName); -// ImageId imageId = ImageId.of(imageName); -// DiskInfo diskInfo = -// DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); -// Operation operation = compute.create(diskInfo); -// operation.waitFor(); -// Disk remoteDisk = compute.getDisk(diskId); -// ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); -// operation = compute.create(imageInfo); -// operation.waitFor(); -// resourceCleaner.add(diskId); -// // test get image with selected fields -// Image image = compute.getImage(imageId, -// Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); -// resourceCleaner.add(imageId); -// assertNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNull(image.getDescription()); -// assertNotNull(image.getConfiguration()); -// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); -// DiskImageConfiguration remoteConfiguration = image.getConfiguration(); -// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); -// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); -// assertNull(image.getStatus()); -// assertNull(image.getDiskSizeGb()); -// assertNull(image.getLicenses()); -// assertNull(image.getDeprecationStatus()); -// // test get image -// image = compute.getImage(imageId); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); -// remoteConfiguration = image.getConfiguration(); -// assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); -// assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); -// assertEquals(100L, (long) image.getDiskSizeGb()); -// assertNotNull(image.getStatus()); -// assertNull(image.getDeprecationStatus()); -// // test deprecate image -// DeprecationStatus deprecationStatus = -// DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) -// .setDeprecated(System.currentTimeMillis()) -// .build(); -// operation = image.deprecate(deprecationStatus); -// operation.waitFor(); -// image = compute.getImage(imageId); -// assertEquals(deprecationStatus, image.getDeprecationStatus()); -// remoteDisk.delete(); -// resourceCleaner.remove(diskId); -// operation = image.delete(); -// operation.waitFor(); -// resourceCleaner.remove(imageId); -// assertNull(compute.getImage(imageId)); -// } -// -// @Test -// public void testListImages() { -// Page imagePage = compute.listImages(IMAGE_PROJECT); -// Iterator imageIterator = imagePage.iterateAll().iterator(); -// int count = 0; -// while (imageIterator.hasNext()) { -// count++; -// Image image = imageIterator.next(); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertNotNull(image.getStatus()); -// assertNotNull(image.getDiskSizeGb()); -// } -// assertTrue(count > 0); -// } -// -// @Test -// public void testListImagesWithSelectedFields() { -// Page imagePage = -// compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); -// Iterator imageIterator = imagePage.iterateAll().iterator(); -// int count = 0; -// while (imageIterator.hasNext()) { -// count++; -// Image image = imageIterator.next(); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertNull(image.getStatus()); -// assertNull(image.getDiskSizeGb()); -// assertNull(image.getLicenses()); -// assertNull(image.getDeprecationStatus()); -// } -// assertTrue(count > 0); -// } -// -// @Test -// public void testListImagesWithFilter() { -// Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( -// Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); -// Iterator imageIterator = imagePage.iterateAll().iterator(); -// int count = 0; -// while (imageIterator.hasNext()) { -// count++; -// Image image = imageIterator.next(); -// assertNotNull(image.getGeneratedId()); -// assertNotNull(image.getImageId()); -// assertNotNull(image.getCreationTimestamp()); -// assertNotNull(image.getConfiguration()); -// assertNotNull(image.getStatus()); -// assertNotNull(image.getDiskSizeGb()); -// assertEquals(365056004L, -// (long) image.getConfiguration().getArchiveSizeBytes()); -// } -// assertTrue(count > 0); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "create-and-get-network"; -// NetworkId networkId = NetworkId.of(name); -// NetworkInfo networkInfo = -// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// // test get network with selected fields -// Network network = compute.getNetwork(networkId.getNetwork(), -// Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); -// resourceCleaner.add(networkId); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertNull(network.getDescription()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// // test get network -// network = compute.getNetwork(networkId.getNetwork()); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNotNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// operation = network.delete(); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getNetwork(name)); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testListNetworks() throws InterruptedException, TimeoutException { -// String name = BASE_RESOURCE_NAME + "list-network"; -// NetworkId networkId = NetworkId.of(name); -// NetworkInfo networkInfo = -// NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// resourceCleaner.add(networkId); -// // test list -// Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); -// Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); -// Iterator networkIterator = networkPage.iterateAll().iterator(); -// int count = 0; -// while (networkIterator.hasNext()) { -// Network network = networkIterator.next(); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNotNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// // test list with selected fields -// count = 0; -// networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), -// Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); -// networkIterator = networkPage.iterateAll().iterator(); -// while (networkIterator.hasNext()) { -// Network network = networkIterator.next(); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertNull(network.getDescription()); -// assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); -// StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); -// assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// operation = compute.deleteNetwork(networkId); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getNetwork(name)); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { -// String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; -// NetworkId networkId = NetworkId.of(networkName); -// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// // test get network -// Network network = compute.getNetwork(networkId.getNetwork()); -// resourceCleaner.add(networkId); -// assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); -// assertNotNull(network.getGeneratedId()); -// assertNotNull(network.getCreationTimestamp()); -// assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); -// assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); -// assertFalse(network.getConfiguration().autoCreateSubnetworks()); -// String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; -// SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); -// SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); -// operation = compute.create(subnetworkInfo); -// operation.waitFor(); -// // test get subnetwork with selected fields -// Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, -// Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); -// resourceCleaner.add(subnetworkId); -// assertNull(subnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(subnetwork.getCreationTimestamp()); -// assertNull(subnetwork.getDescription()); -// assertNull(subnetwork.getGatewayAddress()); -// assertNull(subnetwork.getNetwork()); -// assertNull(subnetwork.getIpRange()); -// // test get subnetwork -// subnetwork = compute.getSubnetwork(subnetworkId); -// assertNotNull(subnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(subnetwork.getCreationTimestamp()); -// assertNotNull(subnetwork.getGatewayAddress()); -// assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); -// assertEquals("192.168.0.0/16", subnetwork.getIpRange()); -// // test list subnetworks -// Compute.SubnetworkFilter filter = -// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); -// Page subnetworkPage = -// compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); -// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); -// int count = 0; -// while (subnetworkIterator.hasNext()) { -// Subnetwork remoteSubnetwork = subnetworkIterator.next(); -// assertNotNull(remoteSubnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), -// remoteSubnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(remoteSubnetwork.getCreationTimestamp()); -// assertNotNull(remoteSubnetwork.getGatewayAddress()); -// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); -// assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// // test list subnetworks with selected fields -// subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), -// Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); -// subnetworkIterator = subnetworkPage.iterateAll().iterator(); -// count = 0; -// while (subnetworkIterator.hasNext()) { -// Subnetwork remoteSubnetwork = subnetworkIterator.next(); -// assertNull(remoteSubnetwork.getGeneratedId()); -// assertEquals(subnetworkId.getSubnetwork(), -// remoteSubnetwork.getSubnetworkId().getSubnetwork()); -// assertNotNull(remoteSubnetwork.getCreationTimestamp()); -// assertNull(remoteSubnetwork.getDescription()); -// assertNull(remoteSubnetwork.getGatewayAddress()); -// assertNull(remoteSubnetwork.getNetwork()); -// assertNull(remoteSubnetwork.getIpRange()); -// count++; -// } -// assertEquals(1, count); -// operation = subnetwork.delete(); -// operation.waitFor(); -// resourceCleaner.remove(subnetworkId); -// operation = compute.deleteNetwork(networkId); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getSubnetwork(subnetworkId)); -// assertNull(compute.getNetwork(networkName)); -// } -// -// @Ignore("Avoid leaving orphan networks when interrupted: see #2118") -// @Test -// public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { -// String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; -// NetworkId networkId = NetworkId.of(networkName); -// NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); -// Operation operation = compute.create(networkInfo); -// operation.waitFor(); -// resourceCleaner.add(networkId); -// String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; -// String[] regionNames = {"us-central1", "us-east1"}; -// String[] subnetworkNames = {prefix + "1", prefix + "2"}; -// String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; -// SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); -// SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); -// SubnetworkInfo firstSubnetworkInfo = -// SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); -// SubnetworkInfo secondSubnetworkInfo = -// SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); -// Operation firstOperation = compute.create(firstSubnetworkInfo); -// Operation secondOperation = compute.create(secondSubnetworkInfo); -// firstOperation.waitFor(); -// resourceCleaner.add(firstSubnetworkId); -// secondOperation.waitFor(); -// resourceCleaner.add(secondSubnetworkId); -// Set regionSet = ImmutableSet.copyOf(regionNames); -// Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); -// Set rangeSet = ImmutableSet.copyOf(ipRanges); -// Compute.SubnetworkFilter subnetworkFilter = -// Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); -// Page subnetworkPage = -// compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); -// Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); -// int count = 0; -// while (subnetworkIterator.hasNext()) { -// Subnetwork remoteSubnetwork = subnetworkIterator.next(); -// assertNotNull(remoteSubnetwork.getGeneratedId()); -// assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); -// assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); -// assertNotNull(remoteSubnetwork.getCreationTimestamp()); -// assertNotNull(remoteSubnetwork.getGatewayAddress()); -// assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); -// assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); -// count++; -// } -// assertEquals(2, count); -// firstOperation = compute.deleteSubnetwork(firstSubnetworkId); -// secondOperation = compute.deleteSubnetwork(secondSubnetworkId); -// firstOperation.waitFor(); -// resourceCleaner.remove(firstSubnetworkId); -// secondOperation.waitFor(); -// resourceCleaner.remove(secondSubnetworkId); -// operation = compute.deleteNetwork(networkId); -// operation.waitFor(); -// resourceCleaner.remove(networkId); -// assertNull(compute.getSubnetwork(firstSubnetworkId)); -// assertNull(compute.getSubnetwork(secondSubnetworkId)); -// assertNull(compute.getNetwork(networkName)); -// } -// -// @Test -// public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; -// String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; -// // Create an address to assign to the instance -// AddressId addressId = RegionAddressId.of(REGION, addressName); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation operation = compute.create(addressInfo); -// operation.waitFor(); -// Address address = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// // Create an instance -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) -// .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() -// .setName("NAT") -// .setNatIp(address.getAddress()).build()) -// .build(); -// AttachedDisk disk1 = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// AttachedDisk disk2 = -// AttachedDisk.of("dev1", -// AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) -// .setAttachedDisks(disk1, disk2) -// .setNetworkInterfaces(networkInterface) -// .build(); -// operation = compute.create(instanceInfo); -// operation.waitFor(); -// // test get -// Instance remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); -// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); -// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); -// assertNotNull(remoteInstance.getCreationTimestamp()); -// Set deviceSet = ImmutableSet.of("dev0", "dev1"); -// assertEquals(2, remoteInstance.getAttachedDisks().size()); -// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { -// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); -// } -// assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, -// remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); -// AttachedDisk.PersistentDiskConfiguration remoteConfiguration = -// remoteInstance.getAttachedDisks().get(0).getConfiguration(); -// assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); -// assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); -// assertTrue(remoteConfiguration.boot()); -// assertTrue(remoteConfiguration.autoDelete()); -// assertEquals(1, remoteInstance.getNetworkInterfaces().size()); -// NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); -// assertNotNull(remoteNetworkInterface.getName()); -// assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); -// List remoteAccessConfigurations = -// remoteNetworkInterface.getAccessConfigurations(); -// assertNotNull(remoteAccessConfigurations); -// assertEquals(1, remoteAccessConfigurations.size()); -// NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); -// assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); -// assertEquals("NAT", remoteAccessConfig.getName()); -// assertNotNull(remoteInstance.getMetadata()); -// assertNotNull(remoteInstance.getTags()); -// // test get with selected fields -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); -// assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); -// assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); -// assertNull(remoteInstance.getMachineType()); -// assertNotNull(remoteInstance.getCreationTimestamp()); -// assertNull(remoteInstance.getAttachedDisks()); -// assertNull(remoteInstance.getNetworkInterfaces()); -// assertNull(remoteInstance.getMetadata()); -// assertNull(remoteInstance.getTags()); -// // test get default serial port output -// String serialPortOutput = remoteInstance.getSerialPortOutput(); -// assertNotNull(serialPortOutput); -// // test get serial port output by number -// String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); -// assertTrue(newSerialPortOutput.contains(serialPortOutput)); -// operation = remoteInstance.delete(); -// operation.waitFor(); -// resourceCleaner.remove(instanceId); -// assertNull(compute.getInstance(instanceId)); -// } -// -// @Test -// public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation operation = compute.create(instanceInfo); -// operation.waitFor(); -// Instance remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// resourceCleaner.add(instanceId); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// operation = remoteInstance.stop(); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); -// operation = remoteInstance.start(); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// operation = remoteInstance.reset(); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId, -// Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); -// assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); -// } -// -// @Test -// public void testSetInstanceProperties() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation operation = compute.create(instanceInfo); -// operation.waitFor(); -// Instance remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// // test set tags -// List tags = ImmutableList.of("tag1", "tag2"); -// operation = remoteInstance.setTags(tags); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(tags, remoteInstance.getTags().getValues()); -// // test set metadata -// Map metadata = ImmutableMap.of("key", "value"); -// operation = remoteInstance.setMetadata(metadata); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(metadata, remoteInstance.getMetadata().getValues()); -// // test set machine type -// operation = remoteInstance.stop(); -// operation.waitFor(); -// operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); -// assertEquals(ZONE, remoteInstance.getMachineType().getZone()); -// // test set scheduling options -// SchedulingOptions options = -// SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); -// operation = remoteInstance.setSchedulingOptions(options); -// operation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(options, remoteInstance.getSchedulingOptions()); -// } -// -// @Test -// public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; -// String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation instanceOperation = compute.create(instanceInfo); -// DiskId diskId = DiskId.of(ZONE, diskName); -// Operation diskOperation = compute.create(DiskInfo.of(diskId, -// StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); -// instanceOperation.waitFor(); -// diskOperation.waitFor(); -// resourceCleaner.add(diskId); -// Instance remoteInstance = compute.getInstance(instanceId); -// // test attach disk -// instanceOperation = remoteInstance.attachDisk("dev1", -// AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// Set deviceSet = ImmutableSet.of("dev0", "dev1"); -// assertEquals(2, remoteInstance.getAttachedDisks().size()); -// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { -// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); -// } -// // test set disk auto-delete -// instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(2, remoteInstance.getAttachedDisks().size()); -// for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { -// assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); -// assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); -// } -// // test detach disk -// instanceOperation = remoteInstance.detachDisk("dev1"); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertEquals(1, remoteInstance.getAttachedDisks().size()); -// assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); -// } -// -// @Test -// public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { -// String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; -// String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; -// InstanceId instanceId = InstanceId.of(ZONE, instanceName); -// NetworkId networkId = NetworkId.of("default"); -// NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); -// AttachedDisk disk = AttachedDisk.of("dev0", -// AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); -// InstanceInfo instanceInfo = -// InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) -// .setAttachedDisks(disk) -// .setNetworkInterfaces(networkInterface) -// .build(); -// Operation instanceOperation = compute.create(instanceInfo); -// AddressId addressId = RegionAddressId.of(REGION, addressName); -// AddressInfo addressInfo = AddressInfo.of(addressId); -// Operation addressOperation = compute.create(addressInfo); -// addressOperation.waitFor(); -// instanceOperation.waitFor(); -// Address remoteAddress = compute.getAddress(addressId); -// resourceCleaner.add(addressId); -// Instance remoteInstance = compute.getInstance(instanceId); -// resourceCleaner.add(instanceId); -// String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); -// // test add access config -// NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() -// .setNatIp(remoteAddress.getAddress()) -// .setName("NAT") -// .build(); -// instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// List accessConfigurations = -// remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); -// assertEquals(1, accessConfigurations.size()); -// assertEquals("NAT", accessConfigurations.get(0).getName()); -// // test delete access config -// instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); -// instanceOperation.waitFor(); -// remoteInstance = compute.getInstance(instanceId); -// assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); -// } -// } +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.paging.Page; +import com.google.cloud.compute.deprecated.Address; +import com.google.cloud.compute.deprecated.AddressId; +import com.google.cloud.compute.deprecated.AddressInfo; +import com.google.cloud.compute.deprecated.AttachedDisk; +import com.google.cloud.compute.deprecated.Compute; +import com.google.cloud.compute.deprecated.DeprecationStatus; +import com.google.cloud.compute.deprecated.Disk; +import com.google.cloud.compute.deprecated.DiskConfiguration; +import com.google.cloud.compute.deprecated.DiskId; +import com.google.cloud.compute.deprecated.DiskImageConfiguration; +import com.google.cloud.compute.deprecated.DiskInfo; +import com.google.cloud.compute.deprecated.DiskType; +import com.google.cloud.compute.deprecated.DiskTypeId; +import com.google.cloud.compute.deprecated.GlobalAddressId; +import com.google.cloud.compute.deprecated.Image; +import com.google.cloud.compute.deprecated.ImageConfiguration; +import com.google.cloud.compute.deprecated.ImageDiskConfiguration; +import com.google.cloud.compute.deprecated.ImageId; +import com.google.cloud.compute.deprecated.ImageInfo; +import com.google.cloud.compute.deprecated.Instance; +import com.google.cloud.compute.deprecated.InstanceId; +import com.google.cloud.compute.deprecated.InstanceInfo; +import com.google.cloud.compute.deprecated.License; +import com.google.cloud.compute.deprecated.LicenseId; +import com.google.cloud.compute.deprecated.MachineType; +import com.google.cloud.compute.deprecated.MachineTypeId; +import com.google.cloud.compute.deprecated.Network; +import com.google.cloud.compute.deprecated.NetworkConfiguration; +import com.google.cloud.compute.deprecated.NetworkId; +import com.google.cloud.compute.deprecated.NetworkInfo; +import com.google.cloud.compute.deprecated.NetworkInterface; +import com.google.cloud.compute.deprecated.Operation; +import com.google.cloud.compute.deprecated.Region; +import com.google.cloud.compute.deprecated.RegionAddressId; +import com.google.cloud.compute.deprecated.RegionOperationId; +import com.google.cloud.compute.deprecated.SchedulingOptions; +import com.google.cloud.compute.deprecated.Snapshot; +import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; +import com.google.cloud.compute.deprecated.SnapshotId; +import com.google.cloud.compute.deprecated.SnapshotInfo; +import com.google.cloud.compute.deprecated.StandardDiskConfiguration; +import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; +import com.google.cloud.compute.deprecated.StorageImageConfiguration; +import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; +import com.google.cloud.compute.deprecated.Subnetwork; +import com.google.cloud.compute.deprecated.SubnetworkId; +import com.google.cloud.compute.deprecated.SubnetworkInfo; +import com.google.cloud.compute.deprecated.Zone; +import com.google.cloud.compute.deprecated.ZoneOperationId; +import com.google.cloud.compute.deprecated.testing.ResourceCleaner; +import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeoutException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; + +public class ITComputeTest { + + private static final String REGION = "us-central1"; + private static final String ZONE = "us-central1-a"; + private static final String DISK_TYPE = "local-ssd"; + private static final String MACHINE_TYPE = "f1-micro"; + private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); + private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); + private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); + private static final String IMAGE_PROJECT = "debian-cloud"; + + private static Compute compute; + private static ResourceCleaner resourceCleaner; + + + @Rule + public Timeout globalTimeout = Timeout.seconds(300); + + @BeforeClass + public static void beforeClass() { + RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); + compute = computeHelper.getOptions().getService(); + resourceCleaner = ResourceCleaner.create(compute); + } + + @AfterClass + public static void tearDown() { + resourceCleaner.cleanUp(); + } + + @Test + public void testGetDiskType() { + DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); + // assertNotNull(diskType.getGeneratedId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testGetDiskTypeWithSelectedFields() { + DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, + Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); + // assertNotNull(diskType.getGeneratedId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNull(diskType.getDescription()); + assertNull(diskType.getValidDiskSize()); + assertNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testListDiskTypes() { + Page diskPage = compute.listDiskTypes(ZONE); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithSelectedFields() { + Page diskPage = compute.listDiskTypes(ZONE, + Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + assertNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNull(diskType.getDescription()); + assertNull(diskType.getValidDiskSize()); + assertNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithFilter() { + Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( + Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // todo(mziccard): uncomment or remove once #695 is closed + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypes() { + Page diskPage = compute.listDiskTypes(); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypesWithFilter() { + Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( + Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // todo(mziccard): uncomment or remove once #695 is closed + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testGetMachineType() { + MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + + @Test + public void testGetMachineTypeWithSelectedFields() { + MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, + Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); + assertNotNull(machineType.getGeneratedId()); + assertNull(machineType.getCreationTimestamp()); + assertNull(machineType.getDescription()); + assertNull(machineType.getCpus()); + assertNull(machineType.getMemoryMb()); + assertNull(machineType.getMaximumPersistentDisks()); + assertNull(machineType.getMaximumPersistentDisksSizeGb()); + } + + @Test + public void testListMachineTypes() { + Page machinePage = compute.listMachineTypes(ZONE); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testListMachineTypesWithSelectedFields() { + Page machinePage = compute.listMachineTypes(ZONE, + Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNull(machineType.getDescription()); + assertNull(machineType.getCpus()); + assertNull(machineType.getMemoryMb()); + assertNull(machineType.getMaximumPersistentDisks()); + assertNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testListMachineTypesWithFilter() { + Page machinePage = compute.listMachineTypes(ZONE, + Compute.MachineTypeListOption.filter( + Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertEquals(2, (long) machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testAggregatedListMachineTypes() { + Page machinePage = compute.listMachineTypes(); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testAggregatedListMachineTypesWithFilter() { + Page machinePage = + compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( + Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotEquals(2, (long) machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testGetLicense() { + License license = compute.getLicense(LICENSE_ID); + assertEquals(LICENSE_ID, license.getLicenseId()); + assertNotNull(license.chargesUseFee()); + } + + @Test + public void testGetLicenseWithSelectedFields() { + License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); + assertEquals(LICENSE_ID, license.getLicenseId()); + assertNull(license.chargesUseFee()); + } + + @Test + public void testGetRegion() { + Region region = compute.getRegion(REGION); + assertEquals(REGION, region.getRegionId().getRegion()); + assertNotNull(region.getDescription()); + assertNotNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNotNull(region.getQuotas()); + assertNotNull(region.getStatus()); + assertNotNull(region.getZones()); + } + + @Test + public void testGetRegionWithSelectedFields() { + Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); + assertEquals(REGION, region.getRegionId().getRegion()); + assertNotNull(region.getGeneratedId()); + assertNull(region.getDescription()); + assertNull(region.getCreationTimestamp()); + assertNull(region.getQuotas()); + assertNull(region.getStatus()); + assertNull(region.getZones()); + } + + @Test + public void testListRegions() { + Page regionPage = compute.listRegions(); + Iterator regionIterator = regionPage.iterateAll().iterator(); + while (regionIterator.hasNext()) { + Region region = regionIterator.next(); + assertNotNull(region.getRegionId()); + assertNotNull(region.getDescription()); + assertNotNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNotNull(region.getQuotas()); + assertNotNull(region.getStatus()); + assertNotNull(region.getZones()); + } + } + + @Test + public void testListRegionsWithSelectedFields() { + Page regionPage = + compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); + Iterator regionIterator = regionPage.iterateAll().iterator(); + while (regionIterator.hasNext()) { + Region region = regionIterator.next(); + assertNotNull(region.getRegionId()); + assertNull(region.getDescription()); + assertNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNull(region.getQuotas()); + assertNull(region.getStatus()); + assertNull(region.getZones()); + } + } + + @Test + public void testListRegionsWithFilter() { + Page regionPage = compute.listRegions(Compute.RegionListOption.filter( + Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); + Iterator regionIterator = regionPage.iterateAll().iterator(); + assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); + assertFalse(regionIterator.hasNext()); + } + + @Test + public void testGetZone() { + Zone zone = compute.getZone(ZONE); + assertEquals(ZONE, zone.getZoneId().getZone()); + assertNotNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNotNull(zone.getDescription()); + assertNotNull(zone.getStatus()); + assertNotNull(zone.getRegion()); + } + + @Test + public void testGetZoneWithSelectedFields() { + Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); + assertEquals(ZONE, zone.getZoneId().getZone()); + assertNotNull(zone.getGeneratedId()); + assertNull(zone.getCreationTimestamp()); + assertNull(zone.getDescription()); + assertNull(zone.getStatus()); + assertNull(zone.getRegion()); + } + + @Test + public void testListZones() { + Page zonePage = compute.listZones(); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + while (zoneIterator.hasNext()) { + Zone zone = zoneIterator.next(); + assertNotNull(zone.getZoneId()); + assertNotNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNotNull(zone.getDescription()); + assertNotNull(zone.getStatus()); + assertNotNull(zone.getRegion()); + } + } + + @Test + public void testListZonesWithSelectedFields() { + Page zonePage = compute.listZones( + Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + while (zoneIterator.hasNext()) { + Zone zone = zoneIterator.next(); + assertNotNull(zone.getZoneId()); + assertNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNull(zone.getDescription()); + assertNull(zone.getStatus()); + assertNull(zone.getRegion()); + } + } + + @Test + public void testListZonesWithFilter() { + Page zonePage = compute.listZones( + Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); + assertFalse(zoneIterator.hasNext()); + } + + @Test + public void testListGlobalOperations() { + Page operationPage = compute.listGlobalOperations(); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListGlobalOperationsWithSelectedFields() { + Page operationPage = + compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListGlobalOperationsWithFilter() { + Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( + Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListRegionOperations() { + Page operationPage = compute.listRegionOperations(REGION); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListRegionOperationsWithSelectedFields() { + Page operationPage = compute.listRegionOperations(REGION, + Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListRegionOperationsWithFilter() { + Page operationPage = compute.listRegionOperations(REGION, + Compute.OperationListOption.filter(Compute.OperationFilter.equals( + Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListZoneOperations() { + Page operationPage = compute.listZoneOperations(ZONE); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListZoneOperationsWithSelectedFields() { + Page operationPage = compute.listZoneOperations(ZONE, + Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListZoneOperationsWithFilter() { + Page operationPage = compute.listZoneOperations(ZONE, + Compute.OperationListOption.filter(Compute.OperationFilter.equals( + Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; + AddressId addressId = RegionAddressId.of(REGION, name); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + // test get + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, remoteAddress.getAddressId().getRegion()); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNotNull(remoteAddress.getAddress()); + assertNotNull(remoteAddress.getCreationTimestamp()); + assertNotNull(remoteAddress.getGeneratedId()); + assertNotNull(remoteAddress.getStatus()); + // test get with selected fields + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, remoteAddress.getAddressId().getRegion()); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNull(remoteAddress.getAddress()); + assertNull(remoteAddress.getCreationTimestamp()); + assertNull(remoteAddress.getGeneratedId()); + operation = remoteAddress.delete(); + operation.waitFor(); + resourceCleaner.remove(addressId); + assertNull(compute.getAddress(addressId)); + } + + @Test + public void testListRegionAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-region-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); + AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + // test list + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(address.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, address.getAddressId().getRegion()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + // test list with selected fields + count = 0; + addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), + Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); + addressIterator = addressPage.iterateAll().iterator(); + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertTrue(address.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, address.getAddressId().getRegion()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); + AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; + AddressId addressId = GlobalAddressId.of(name); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + // test get + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNotNull(remoteAddress.getAddress()); + assertNotNull(remoteAddress.getCreationTimestamp()); + assertNotNull(remoteAddress.getGeneratedId()); + assertNotNull(remoteAddress.getStatus()); + // test get with selected fields + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNull(remoteAddress.getAddress()); + assertNull(remoteAddress.getCreationTimestamp()); + assertNull(remoteAddress.getGeneratedId()); + operation = remoteAddress.delete(); + operation.waitFor(); + resourceCleaner.remove(addressId); + assertNull(compute.getAddress(addressId)); + } + + @Test + public void testListGlobalAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-global-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); + AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + // test list + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(address.getAddressId() instanceof GlobalAddressId); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + // test list with selected fields + count = 0; + addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), + Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); + addressIterator = addressPage.iterateAll().iterator(); + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertTrue(address.getAddressId() instanceof GlobalAddressId); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetResizeAndDeleteStandardDisk() + throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; + DiskId diskId = DiskId.of(ZONE, name); + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + // test get + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.resize(200L); + operation.waitFor(); + // test resize and get with selected fields + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(200L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(diskId); + assertNull(compute.getDisk(diskId)); + } + + @Test + public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; + DiskId diskId = DiskId.of(ZONE, name); + DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + // test get + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); + ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); + assertNotNull(remoteConfiguration.getSourceImageId()); + assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); + assertNotNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + // test get with selected fields + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); + assertNull(remoteConfiguration.getSourceImageId()); + assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(diskId); + assertNull(compute.getDisk(diskId)); + } + + @Test + public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() + throws InterruptedException, TimeoutException { + String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; + String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; + DiskId diskId = DiskId.of(ZONE, diskName); + DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); + String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + operation = remoteDisk.createSnapshot(snapshotName); + operation.waitFor(); + // test get snapshot with selected fields + Snapshot snapshot = compute.getSnapshot(snapshotName, + Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); + resourceCleaner.add(snapshot.getSnapshotId()); + assertNull(snapshot.getGeneratedId()); + assertNotNull(snapshot.getSnapshotId()); + assertNotNull(snapshot.getCreationTimestamp()); + assertNull(snapshot.getDescription()); + assertNull(snapshot.getStatus()); + assertNull(snapshot.getDiskSizeGb()); + assertNull(snapshot.getLicenses()); + assertNull(snapshot.getSourceDisk()); + assertNull(snapshot.getSourceDiskId()); + assertNull(snapshot.getStorageBytes()); + assertNull(snapshot.getStorageBytesStatus()); + // test get snapshot + snapshot = compute.getSnapshot(snapshotName); + assertNotNull(snapshot.getGeneratedId()); + assertNotNull(snapshot.getSnapshotId()); + assertNotNull(snapshot.getCreationTimestamp()); + assertNotNull(snapshot.getStatus()); + assertEquals(100L, (long) snapshot.getDiskSizeGb()); + assertEquals(diskName, snapshot.getSourceDisk().getDisk()); + assertNotNull(snapshot.getSourceDiskId()); + assertNotNull(snapshot.getStorageBytes()); + assertNotNull(snapshot.getStorageBytesStatus()); + remoteDisk.delete(); + resourceCleaner.remove(diskId); + diskInfo = + DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); + operation = compute.create(diskInfo); + operation.waitFor(); + // test get disk + remoteDisk = compute.getDisk(snapshotDiskId); + resourceCleaner.add(snapshotDiskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); + SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); + assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNotNull(remoteConfiguration.getSourceSnapshotId()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + // test get disk with selected fields + remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationStatus()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); + assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(snapshotDiskId); + assertNull(compute.getDisk(snapshotDiskId)); + operation = snapshot.delete(); + operation.waitFor(); + resourceCleaner.remove(snapshot.getSnapshotId()); + assertNull(compute.getSnapshot(snapshotName)); + } + + @Test + public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; + String[] diskNames = {prefix + "1", prefix + "2"}; + DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); + DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); + DiskConfiguration configuration = + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); + Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); + Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); + firstOperation.waitFor(); + resourceCleaner.add(firstDiskId); + secondOperation.waitFor(); + resourceCleaner.add(secondDiskId); + Set diskSet = ImmutableSet.copyOf(diskNames); + // test list disks + Compute.DiskFilter diskFilter = + Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); + Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); + Iterator diskIterator = diskPage.iterateAll().iterator(); + int count = 0; + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + count++; + } + assertEquals(2, count); + // test list disks with selected fields + count = 0; + diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), + Compute.DiskListOption.fields(Compute.DiskField.STATUS)); + diskIterator = diskPage.iterateAll().iterator(); + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + count++; + } + assertEquals(2, count); + // test snapshots + SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); + SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); + firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); + secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); + firstOperation.waitFor(); + resourceCleaner.add(firstSnapshotId); + secondOperation.waitFor(); + resourceCleaner.add(secondSnapshotId); + // test list snapshots + Compute.SnapshotFilter snapshotFilter = + Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); + Page snapshotPage = + compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); + Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); + count = 0; + while (snapshotIterator.hasNext()) { + Snapshot remoteSnapshot = snapshotIterator.next(); + assertNotNull(remoteSnapshot.getGeneratedId()); + assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); + assertNotNull(remoteSnapshot.getCreationTimestamp()); + assertNotNull(remoteSnapshot.getStatus()); + assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); + assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); + assertNotNull(remoteSnapshot.getSourceDiskId()); + assertNotNull(remoteSnapshot.getStorageBytes()); + assertNotNull(remoteSnapshot.getStorageBytesStatus()); + count++; + } + assertEquals(2, count); + // test list snapshots with selected fields + snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), + Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); + snapshotIterator = snapshotPage.iterateAll().iterator(); + count = 0; + while (snapshotIterator.hasNext()) { + Snapshot remoteSnapshot = snapshotIterator.next(); + assertNull(remoteSnapshot.getGeneratedId()); + assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); + assertNotNull(remoteSnapshot.getCreationTimestamp()); + assertNull(remoteSnapshot.getStatus()); + assertNull(remoteSnapshot.getDiskSizeGb()); + assertNull(remoteSnapshot.getSourceDisk()); + assertNull(remoteSnapshot.getSourceDiskId()); + assertNull(remoteSnapshot.getStorageBytes()); + assertNull(remoteSnapshot.getStorageBytesStatus()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testAggregatedListDisks() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; + String[] diskZones = {"us-central1-a", "us-east1-c"}; + String[] diskNames = {prefix + "1", prefix + "2"}; + DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); + DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); + DiskConfiguration configuration = + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); + Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); + Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); + firstOperation.waitFor(); + resourceCleaner.add(firstDiskId); + secondOperation.waitFor(); + resourceCleaner.add(secondDiskId); + Set zoneSet = ImmutableSet.copyOf(diskZones); + Set diskSet = ImmutableSet.copyOf(diskNames); + Compute.DiskFilter diskFilter = + Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); + Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); + Iterator diskIterator = diskPage.iterateAll().iterator(); + int count = 0; + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { + String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; + String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; + DiskId diskId = DiskId.of(ZONE, diskName); + ImageId imageId = ImageId.of(imageName); + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); +operation.waitFor(); + Disk remoteDisk = compute.getDisk(diskId); + ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); + operation = compute.create(imageInfo); +operation.waitFor(); + resourceCleaner.add(diskId); + // test get image with selected fields + Image image = compute.getImage(imageId, + Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); + resourceCleaner.add(imageId); + assertNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNull(image.getDescription()); + assertNotNull(image.getConfiguration()); + assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); + DiskImageConfiguration remoteConfiguration = image.getConfiguration(); + assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); + assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + // test get image + image = compute.getImage(imageId); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); + remoteConfiguration = image.getConfiguration(); + assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); + assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); + assertEquals(100L, (long) image.getDiskSizeGb()); + assertNotNull(image.getStatus()); + assertNull(image.getDeprecationStatus()); + // test deprecate image + DeprecationStatus deprecationStatus = + DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) + .setDeprecated(System.currentTimeMillis()) + .build(); + operation = image.deprecate(deprecationStatus); + operation.waitFor(); + image = compute.getImage(imageId); + assertEquals(deprecationStatus, image.getDeprecationStatus()); + remoteDisk.delete(); + resourceCleaner.remove(diskId); + operation = image.delete(); + operation.waitFor(); + resourceCleaner.remove(imageId); + assertNull(compute.getImage(imageId)); + } + + @Test + public void testListImages() { + Page imagePage = compute.listImages(IMAGE_PROJECT); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNotNull(image.getStatus()); + assertNotNull(image.getDiskSizeGb()); + } + assertTrue(count > 0); + } + + @Test + public void testListImagesWithSelectedFields() { + Page imagePage = + compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + } + assertTrue(count > 0); + } + + @Test + public void testListImagesWithFilter() { + Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( + Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNotNull(image.getStatus()); + assertNotNull(image.getDiskSizeGb()); + assertEquals(365056004L, + (long) image.getConfiguration().getArchiveSizeBytes()); + } + assertTrue(count > 0); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-network"; + NetworkId networkId = NetworkId.of(name); + NetworkInfo networkInfo = + NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(networkInfo); +operation.waitFor(); + // test get network with selected fields + Network network = compute.getNetwork(networkId.getNetwork(), + Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); + resourceCleaner.add(networkId); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertNull(network.getDescription()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + // test get network + network = compute.getNetwork(networkId.getNetwork()); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + operation = network.delete(); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getNetwork(name)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testListNetworks() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "list-network"; + NetworkId networkId = NetworkId.of(name); + NetworkInfo networkInfo = + NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + resourceCleaner.add(networkId); + // test list + Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); + Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); + Iterator networkIterator = networkPage.iterateAll().iterator(); + int count = 0; + while (networkIterator.hasNext()) { + Network network = networkIterator.next(); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + count++; + } + assertEquals(1, count); + // test list with selected fields + count = 0; + networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), + Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); + networkIterator = networkPage.iterateAll().iterator(); + while (networkIterator.hasNext()) { + Network network = networkIterator.next(); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertNull(network.getDescription()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + count++; + } + assertEquals(1, count); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getNetwork(name)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { + String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; + NetworkId networkId = NetworkId.of(networkName); + NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + // test get network + Network network = compute.getNetwork(networkId.getNetwork()); + resourceCleaner.add(networkId); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); + assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); + assertFalse(network.getConfiguration().autoCreateSubnetworks()); + String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; + SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); + operation = compute.create(subnetworkInfo); + operation.waitFor(); + // test get subnetwork with selected fields + Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, + Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); + resourceCleaner.add(subnetworkId); + assertNull(subnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(subnetwork.getCreationTimestamp()); + assertNull(subnetwork.getDescription()); + assertNull(subnetwork.getGatewayAddress()); + assertNull(subnetwork.getNetwork()); + assertNull(subnetwork.getIpRange()); + // test get subnetwork + subnetwork = compute.getSubnetwork(subnetworkId); + assertNotNull(subnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(subnetwork.getCreationTimestamp()); + assertNotNull(subnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); + assertEquals("192.168.0.0/16", subnetwork.getIpRange()); + // test list subnetworks + Compute.SubnetworkFilter filter = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); + Page subnetworkPage = + compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); + Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); + int count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNotNull(remoteSubnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), + remoteSubnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNotNull(remoteSubnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); + assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); + count++; + } + assertEquals(1, count); + // test list subnetworks with selected fields + subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), + Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); + subnetworkIterator = subnetworkPage.iterateAll().iterator(); + count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNull(remoteSubnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), + remoteSubnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNull(remoteSubnetwork.getDescription()); + assertNull(remoteSubnetwork.getGatewayAddress()); + assertNull(remoteSubnetwork.getNetwork()); + assertNull(remoteSubnetwork.getIpRange()); + count++; + } + assertEquals(1, count); + operation = subnetwork.delete(); + operation.waitFor(); + resourceCleaner.remove(subnetworkId); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getSubnetwork(subnetworkId)); + assertNull(compute.getNetwork(networkName)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { + String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; + NetworkId networkId = NetworkId.of(networkName); + NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + resourceCleaner.add(networkId); + String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; + String[] regionNames = {"us-central1", "us-east1"}; + String[] subnetworkNames = {prefix + "1", prefix + "2"}; + String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; + SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); + SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); + SubnetworkInfo firstSubnetworkInfo = + SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); + SubnetworkInfo secondSubnetworkInfo = + SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); + Operation firstOperation = compute.create(firstSubnetworkInfo); + Operation secondOperation = compute.create(secondSubnetworkInfo); + firstOperation.waitFor(); + resourceCleaner.add(firstSubnetworkId); + secondOperation.waitFor(); + resourceCleaner.add(secondSubnetworkId); + Set regionSet = ImmutableSet.copyOf(regionNames); + Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); + Set rangeSet = ImmutableSet.copyOf(ipRanges); + Compute.SubnetworkFilter subnetworkFilter = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); + Page subnetworkPage = + compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); + Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); + int count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNotNull(remoteSubnetwork.getGeneratedId()); + assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); + assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNotNull(remoteSubnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); + assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); + count++; + } + assertEquals(2, count); + firstOperation = compute.deleteSubnetwork(firstSubnetworkId); + secondOperation = compute.deleteSubnetwork(secondSubnetworkId); + firstOperation.waitFor(); + resourceCleaner.remove(firstSubnetworkId); + secondOperation.waitFor(); + resourceCleaner.remove(secondSubnetworkId); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getSubnetwork(firstSubnetworkId)); + assertNull(compute.getSubnetwork(secondSubnetworkId)); + assertNull(compute.getNetwork(networkName)); + } + + @Test + public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; + String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; + // Create an address to assign to the instance + AddressId addressId = RegionAddressId.of(REGION, addressName); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + Address address = compute.getAddress(addressId); + resourceCleaner.add(addressId); + // Create an instance + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) + .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() + .setName("NAT") + .setNatIp(address.getAddress()).build()) + .build(); + AttachedDisk disk1 = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + AttachedDisk disk2 = + AttachedDisk.of("dev1", + AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) + .setAttachedDisks(disk1, disk2) + .setNetworkInterfaces(networkInterface) + .build(); + operation = compute.create(instanceInfo); + operation.waitFor(); + // test get + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); + assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); + assertEquals(ZONE, remoteInstance.getMachineType().getZone()); + assertNotNull(remoteInstance.getCreationTimestamp()); + Set deviceSet = ImmutableSet.of("dev0", "dev1"); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + } + assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, + remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); + AttachedDisk.PersistentDiskConfiguration remoteConfiguration = + remoteInstance.getAttachedDisks().get(0).getConfiguration(); + assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); + assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); + assertTrue(remoteConfiguration.boot()); + assertTrue(remoteConfiguration.autoDelete()); + assertEquals(1, remoteInstance.getNetworkInterfaces().size()); + NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); + assertNotNull(remoteNetworkInterface.getName()); + assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); + List remoteAccessConfigurations = + remoteNetworkInterface.getAccessConfigurations(); + assertNotNull(remoteAccessConfigurations); + assertEquals(1, remoteAccessConfigurations.size()); + NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); + assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); + assertEquals("NAT", remoteAccessConfig.getName()); + assertNotNull(remoteInstance.getMetadata()); + assertNotNull(remoteInstance.getTags()); + // test get with selected fields + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); + assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); + assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); + assertNull(remoteInstance.getMachineType()); + assertNotNull(remoteInstance.getCreationTimestamp()); + assertNull(remoteInstance.getAttachedDisks()); + assertNull(remoteInstance.getNetworkInterfaces()); + assertNull(remoteInstance.getMetadata()); + assertNull(remoteInstance.getTags()); + // test get default serial port output + String serialPortOutput = remoteInstance.getSerialPortOutput(); + assertNotNull(serialPortOutput); + // test get serial port output by number + String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); + assertTrue(newSerialPortOutput.contains(serialPortOutput)); + operation = remoteInstance.delete(); + operation.waitFor(); + resourceCleaner.remove(instanceId); + assertNull(compute.getInstance(instanceId)); + } + + @Test + public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation operation = compute.create(instanceInfo); + operation.waitFor(); + Instance remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + resourceCleaner.add(instanceId); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + operation = remoteInstance.stop(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); + operation = remoteInstance.start(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + operation = remoteInstance.reset(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + } + + @Test + public void testSetInstanceProperties() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation operation = compute.create(instanceInfo); + operation.waitFor(); + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + // test set tags + List tags = ImmutableList.of("tag1", "tag2"); + operation = remoteInstance.setTags(tags); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(tags, remoteInstance.getTags().getValues()); + // test set metadata + Map metadata = ImmutableMap.of("key", "value"); + operation = remoteInstance.setMetadata(metadata); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(metadata, remoteInstance.getMetadata().getValues()); + // test set machine type + operation = remoteInstance.stop(); + operation.waitFor(); + operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); + assertEquals(ZONE, remoteInstance.getMachineType().getZone()); + // test set scheduling options + SchedulingOptions options = + SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); + operation = remoteInstance.setSchedulingOptions(options); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(options, remoteInstance.getSchedulingOptions()); + } + + @Test + public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; + String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation instanceOperation = compute.create(instanceInfo); + DiskId diskId = DiskId.of(ZONE, diskName); + Operation diskOperation = compute.create(DiskInfo.of(diskId, + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); + instanceOperation.waitFor(); + diskOperation.waitFor(); + resourceCleaner.add(diskId); + Instance remoteInstance = compute.getInstance(instanceId); + // test attach disk + instanceOperation = remoteInstance.attachDisk("dev1", + AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + Set deviceSet = ImmutableSet.of("dev0", "dev1"); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + } + // test set disk auto-delete + instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); + } + // test detach disk + instanceOperation = remoteInstance.detachDisk("dev1"); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(1, remoteInstance.getAttachedDisks().size()); + assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); + } + + @Test + public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; + String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation instanceOperation = compute.create(instanceInfo); + AddressId addressId = RegionAddressId.of(REGION, addressName); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation addressOperation = compute.create(addressInfo); + addressOperation.waitFor(); + instanceOperation.waitFor(); + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); + // test add access config + NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() + .setNatIp(remoteAddress.getAddress()) + .setName("NAT") + .build(); + instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + List accessConfigurations = + remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); + assertEquals(1, accessConfigurations.size()); + assertEquals("NAT", accessConfigurations.get(0).getName()); + // test delete access config + instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); + } +} From 152b5b8011ed59231e3bd133d4eeed2f3281a49f Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 30 Mar 2018 13:45:54 -0700 Subject: [PATCH 09/42] formatted with google-java-format --- ...egatedListGlobalOperationsHttpRequest.java | 151 +-- .../v1/DeleteGlobalAddressHttpRequest.java | 90 +- .../compute/v1/DeleteRouterHttpRequest.java | 90 +- .../com/google/cloud/compute/v1/Disk.java | 280 +++--- .../google/cloud/compute/v1/DiskSettings.java | 174 ++-- .../cloud/compute/v1/DiskTypesScopedList.java | 37 +- .../v1/GetBackendServiceHttpRequest.java | 90 +- .../compute/v1/GetInstanceHttpRequest.java | 90 +- .../compute/v1/GetSubnetworkHttpRequest.java | 90 +- .../compute/v1/GetUrlMapHttpRequest.java | 90 +- .../compute/v1/InsertAddressHttpRequest.java | 115 +-- ...InsertInstanceGroupManagerHttpRequest.java | 127 +-- .../compute/v1/InsertUrlMapHttpRequest.java | 115 +-- .../InstanceGroupManagerActionsSummary.java | 109 ++- .../v1/InstanceGroupManagerClient.java | 924 ++++++++++++------ .../InstanceGroupsRemoveInstancesRequest.java | 32 +- .../cloud/compute/v1/InstanceTemplate.java | 86 +- ...istInstancesInstanceGroupsHttpRequest.java | 180 ++-- .../compute/v1/ListRegionsHttpRequest.java | 148 +-- .../v1/ListTargetHttpProxiesHttpRequest.java | 148 +-- .../v1/ListTargetSslProxiesHttpRequest.java | 148 +-- .../cloud/compute/v1/NetworkSettings.java | 152 +-- .../cloud/compute/v1/OperationList.java | 68 +- .../com/google/cloud/compute/v1/Quota.java | 46 +- ...tancesInstanceGroupManagerHttpRequest.java | 168 ++-- ...RegionInstanceGroupManagerHttpRequest.java | 168 ++-- .../google/cloud/compute/v1/RouterBgp.java | 33 +- .../google/cloud/compute/v1/RouterName.java | 70 +- .../cloud/compute/v1/ServiceAccount.java | 37 +- .../v1/SetBackupTargetPoolHttpRequest.java | 130 +-- .../compute/v1/StartInstanceHttpRequest.java | 90 +- .../cloud/compute/v1/TargetHttpProxyList.java | 68 +- ...HttpsProxiesSetSslCertificatesRequest.java | 34 +- .../cloud/compute/v1/TargetHttpsProxy.java | 92 +- .../cloud/compute/v1/TargetReference.java | 33 +- .../cloud/compute/v1/TargetSslProxy.java | 117 +-- .../compute/v1/TargetVpnGatewayClient.java | 392 ++++---- .../v1/UpdateRegionAutoscalerHttpRequest.java | 129 +-- .../cloud/compute/v1/UrlMapReference.java | 33 +- .../google/cloud/compute/v1/UrlMapTest.java | 61 +- .../compute/v1/stub/HttpJsonDiskStub.java | 348 ++++--- ...onRegionBackendServiceCallableFactory.java | 56 +- .../stub/HttpJsonRegionCallableFactory.java | 49 +- .../v1/stub/HttpJsonTargetSslProxyStub.java | 480 +++++---- .../compute/v1/stub/HttpJsonUrlMapStub.java | 383 ++++---- .../compute/v1/stub/HttpsHealthCheckStub.java | 33 +- .../compute/v1/stub/ImageStubSettings.java | 362 ++++--- .../compute/v1/stub/SnapshotStubSettings.java | 310 +++--- .../compute/v1/InstanceGroupClientTest.java | 632 +++++++----- .../v1/RegionAutoscalerClientTest.java | 417 ++++---- .../v1/TargetHttpsProxyClientTest.java | 438 +++++---- 51 files changed, 4531 insertions(+), 4212 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java index 1b11d1dae87e..bf09eaf8d2ed 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListGlobalOperationsHttpRequest() { this.userIp = null; } - private AggregatedListGlobalOperationsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListGlobalOperationsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListGlobalOperationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListGlobalOperationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListGlobalOperationsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListGlobalOperationsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListGlobalOperationsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListGlobalOperationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListGlobalOperationsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListGlobalOperationsHttpRequest) { - AggregatedListGlobalOperationsHttpRequest that = (AggregatedListGlobalOperationsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListGlobalOperationsHttpRequest that = + (AggregatedListGlobalOperationsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java index 4de69f7e8ce1..4d477f83a0d1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteGlobalAddressHttpRequest() { this.userIp = null; } - private DeleteGlobalAddressHttpRequest( String access_token, String address, @@ -61,8 +57,7 @@ private DeleteGlobalAddressHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.address = address; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteGlobalAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteGlobalAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteGlobalAddressHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteGlobalAddressHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public DeleteGlobalAddressHttpRequest build() { missing += " address"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteGlobalAddressHttpRequest( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteGlobalAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "address=" + address + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "address=" + + address + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteGlobalAddressHttpRequest) { DeleteGlobalAddressHttpRequest that = (DeleteGlobalAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java index 838f38158690..39840a7c9591 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteRouterHttpRequest() { this.userIp = null; } - private DeleteRouterHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteRouterHttpRequest( String prettyPrint, String quotaUser, String router, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRouterHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRouterHttpRequest build() { String missing = ""; - - - - - if (router == null) { missing += " router"; } @@ -331,15 +322,7 @@ public DeleteRouterHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "router=" + router + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "router=" + + router + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteRouterHttpRequest) { DeleteRouterHttpRequest that = (DeleteRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java index caf2b6d61397..30c1ca10b1e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -80,7 +79,6 @@ private Disk() { this.zone = null; } - private Disk( String creationTimestamp, String description, @@ -103,8 +101,7 @@ private Disk( String status, String type, List users, - String zone - ) { + String zone) { this.creationTimestamp = creationTimestamp; this.description = description; this.diskEncryptionKey = diskEncryptionKey; @@ -133,13 +130,15 @@ private Disk( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); @@ -148,10 +147,12 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) { - fieldMap.put("lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); + fieldMap.put( + "lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); } if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) { - fieldMap.put("lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); + fieldMap.put( + "lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); } if (fieldNames.contains("licenses") && licenses != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -176,7 +177,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); } if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); } if (fieldNames.contains("sourceImageId") && sourceImageId != null) { fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); @@ -185,7 +188,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); } if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { - fieldMap.put("sourceSnapshotEncryptionKey", Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); + fieldMap.put( + "sourceSnapshotEncryptionKey", + Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); } if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); @@ -374,22 +379,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Disk prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Disk getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Disk DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Disk(); } @@ -672,7 +679,8 @@ public CustomerEncryptionKey getSourceSnapshotEncryptionKey() { return sourceSnapshotEncryptionKey; } - public Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey) { + public Builder setSourceSnapshotEncryptionKey( + CustomerEncryptionKey sourceSnapshotEncryptionKey) { this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey; return this; } @@ -730,53 +738,31 @@ public Builder setZone(String zone) { return this; } - public Disk build() { - - - - - - - - - - - - - - - - - - - - return new Disk( - creationTimestamp, - description, - diskEncryptionKey, - id, - kind, - lastAttachTimestamp, - lastDetachTimestamp, - licenses, - name, - options, - selfLink, - sizeGb, - sourceImage, - sourceImageEncryptionKey, - sourceImageId, - sourceSnapshot, - sourceSnapshotEncryptionKey, - sourceSnapshotId, - status, - type, - users, - zone - ); + creationTimestamp, + description, + diskEncryptionKey, + id, + kind, + lastAttachTimestamp, + lastDetachTimestamp, + licenses, + name, + options, + selfLink, + sizeGb, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + status, + type, + users, + zone); } public Builder clone() { @@ -810,28 +796,71 @@ public Builder clone() { @Override public String toString() { return "Disk{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "diskEncryptionKey=" + diskEncryptionKey + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "lastAttachTimestamp=" + lastAttachTimestamp + ", " - + "lastDetachTimestamp=" + lastDetachTimestamp + ", " - + "licenses=" + licenses + ", " - + "name=" + name + ", " - + "options=" + options + ", " - + "selfLink=" + selfLink + ", " - + "sizeGb=" + sizeGb + ", " - + "sourceImage=" + sourceImage + ", " - + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + ", " - + "sourceImageId=" + sourceImageId + ", " - + "sourceSnapshot=" + sourceSnapshot + ", " - + "sourceSnapshotEncryptionKey=" + sourceSnapshotEncryptionKey + ", " - + "sourceSnapshotId=" + sourceSnapshotId + ", " - + "status=" + status + ", " - + "type=" + type + ", " - + "users=" + users + ", " - + "zone=" + zone + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "diskEncryptionKey=" + + diskEncryptionKey + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "lastAttachTimestamp=" + + lastAttachTimestamp + + ", " + + "lastDetachTimestamp=" + + lastDetachTimestamp + + ", " + + "licenses=" + + licenses + + ", " + + "name=" + + name + + ", " + + "options=" + + options + + ", " + + "selfLink=" + + selfLink + + ", " + + "sizeGb=" + + sizeGb + + ", " + + "sourceImage=" + + sourceImage + + ", " + + "sourceImageEncryptionKey=" + + sourceImageEncryptionKey + + ", " + + "sourceImageId=" + + sourceImageId + + ", " + + "sourceSnapshot=" + + sourceSnapshot + + ", " + + "sourceSnapshotEncryptionKey=" + + sourceSnapshotEncryptionKey + + ", " + + "sourceSnapshotId=" + + sourceSnapshotId + + ", " + + "status=" + + status + + ", " + + "type=" + + type + + ", " + + "users=" + + users + + ", " + + "zone=" + + zone + "}"; } @@ -842,30 +871,28 @@ public boolean equals(Object o) { } if (o instanceof Disk) { Disk that = (Disk) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp()) && - Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp()) && - Objects.equals(this.licenses, that.getLicensesList()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.options, that.getOptions()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sizeGb, that.getSizeGb()) && - Objects.equals(this.sourceImage, that.getSourceImage()) && - Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) && - Objects.equals(this.sourceImageId, that.getSourceImageId()) && - Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) && - Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) && - Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.type, that.getType()) && - Objects.equals(this.users, that.getUsersList()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp()) + && Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp()) + && Objects.equals(this.licenses, that.getLicensesList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.options, that.getOptions()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sizeGb, that.getSizeGb()) + && Objects.equals(this.sourceImage, that.getSourceImage()) + && Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) + && Objects.equals(this.sourceImageId, that.getSourceImageId()) + && Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) + && Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) + && Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.type, that.getType()) + && Objects.equals(this.users, that.getUsersList()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -873,28 +900,27 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - diskEncryptionKey, - id, - kind, - lastAttachTimestamp, - lastDetachTimestamp, - licenses, - name, - options, - selfLink, - sizeGb, - sourceImage, - sourceImageEncryptionKey, - sourceImageId, - sourceSnapshot, - sourceSnapshotEncryptionKey, - sourceSnapshotId, - status, - type, - users, - zone - ); + creationTimestamp, + description, + diskEncryptionKey, + id, + kind, + lastAttachTimestamp, + lastDetachTimestamp, + licenses, + name, + options, + selfLink, + sizeGb, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + status, + type, + users, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java index cb7227662453..bd7becf1f760 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.stub.DiskStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of createSnapshotDisk to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSnapshotDisk to 30 seconds: * *

  * 
@@ -86,98 +64,75 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class DiskSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListDisks.
-   */
-  public PagedCallSettings aggregatedListDisksSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListDisks. */
+  public PagedCallSettings<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
+      aggregatedListDisksSettings() {
     return ((DiskStubSettings) getStubSettings()).aggregatedListDisksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to createSnapshotDisk.
-   */
+  /** Returns the object with the settings used for calls to createSnapshotDisk. */
   public UnaryCallSettings createSnapshotDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).createSnapshotDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteDisk.
-   */
+  /** Returns the object with the settings used for calls to deleteDisk. */
   public UnaryCallSettings deleteDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).deleteDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getDisk.
-   */
+  /** Returns the object with the settings used for calls to getDisk. */
   public UnaryCallSettings getDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).getDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertDisk.
-   */
+  /** Returns the object with the settings used for calls to insertDisk. */
   public UnaryCallSettings insertDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).insertDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listDisks.
-   */
-  public PagedCallSettings listDisksSettings() {
+  /** Returns the object with the settings used for calls to listDisks. */
+  public PagedCallSettings
+      listDisksSettings() {
     return ((DiskStubSettings) getStubSettings()).listDisksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeDisk.
-   */
+  /** Returns the object with the settings used for calls to resizeDisk. */
   public UnaryCallSettings resizeDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).resizeDiskSettings();
   }
 
-
   public static final DiskSettings create(DiskStubSettings stub) throws IOException {
     return new DiskSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return DiskStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return DiskStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return DiskStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return DiskStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DiskStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return DiskStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return DiskStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -190,23 +145,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return DiskStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -215,9 +164,7 @@ protected DiskSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for DiskSettings.
-   */
+  /** Builder for DiskSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -239,7 +186,6 @@ protected Builder(DiskStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public DiskStubSettings.Builder getStubSettingsBuilder() {
       return ((DiskStubSettings.Builder) getStubSettings());
     }
@@ -247,58 +193,50 @@ public DiskStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListDisks. - */ - public PagedCallSettings.Builder aggregatedListDisksSettings() { + /** Returns the builder for the settings used for calls to aggregatedListDisks. */ + public PagedCallSettings.Builder< + AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse> + aggregatedListDisksSettings() { return getStubSettingsBuilder().aggregatedListDisksSettings(); } - /** - * Returns the builder for the settings used for calls to createSnapshotDisk. - */ - public UnaryCallSettings.Builder createSnapshotDiskSettings() { + /** Returns the builder for the settings used for calls to createSnapshotDisk. */ + public UnaryCallSettings.Builder + createSnapshotDiskSettings() { return getStubSettingsBuilder().createSnapshotDiskSettings(); } - /** - * Returns the builder for the settings used for calls to deleteDisk. - */ + /** Returns the builder for the settings used for calls to deleteDisk. */ public UnaryCallSettings.Builder deleteDiskSettings() { return getStubSettingsBuilder().deleteDiskSettings(); } - /** - * Returns the builder for the settings used for calls to getDisk. - */ + /** Returns the builder for the settings used for calls to getDisk. */ public UnaryCallSettings.Builder getDiskSettings() { return getStubSettingsBuilder().getDiskSettings(); } - /** - * Returns the builder for the settings used for calls to insertDisk. - */ + /** Returns the builder for the settings used for calls to insertDisk. */ public UnaryCallSettings.Builder insertDiskSettings() { return getStubSettingsBuilder().insertDiskSettings(); } - /** - * Returns the builder for the settings used for calls to listDisks. - */ - public PagedCallSettings.Builder listDisksSettings() { + /** Returns the builder for the settings used for calls to listDisks. */ + public PagedCallSettings.Builder + listDisksSettings() { return getStubSettingsBuilder().listDisksSettings(); } - /** - * Returns the builder for the settings used for calls to resizeDisk. - */ + /** Returns the builder for the settings used for calls to resizeDisk. */ public UnaryCallSettings.Builder resizeDiskSettings() { return getStubSettingsBuilder().resizeDiskSettings(); } @@ -308,4 +246,4 @@ public DiskSettings build() throws IOException { return new DiskSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java index 44673da3fa2d..03ace04edf50 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private DiskTypesScopedList() { this.warning = null; } - - private DiskTypesScopedList( - List diskTypes, - Warning warning - ) { + private DiskTypesScopedList(List diskTypes, Warning warning) { this.diskTypes = diskTypes; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DiskTypesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DiskTypesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DiskTypesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DiskTypesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public DiskTypesScopedList build() { - return new DiskTypesScopedList( - diskTypes, - warning - ); + return new DiskTypesScopedList(diskTypes, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "DiskTypesScopedList{" - + "diskTypes=" + diskTypes + ", " - + "warning=" + warning - + "}"; + return "DiskTypesScopedList{" + "diskTypes=" + diskTypes + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof DiskTypesScopedList) { DiskTypesScopedList that = (DiskTypesScopedList) o; - return - Objects.equals(this.diskTypes, that.getDiskTypesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.diskTypes, that.getDiskTypesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - diskTypes, - warning - ); + return Objects.hash(diskTypes, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java index 3ecfe8e20cf6..9341bbee372b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetBackendServiceHttpRequest() { this.userIp = null; } - private GetBackendServiceHttpRequest( String access_token, String backendService, @@ -61,8 +57,7 @@ private GetBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetBackendServiceHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetBackendServiceHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetBackendServiceHttpRequest) { GetBackendServiceHttpRequest that = (GetBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java index 6fc34419fe86..be3a9305efae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInstanceHttpRequest() { this.userIp = null; } - private GetInstanceHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInstanceHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInstanceHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetInstanceHttpRequest) { GetInstanceHttpRequest that = (GetInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java index 5f1a1e6bb172..6ef53c597515 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetSubnetworkHttpRequest() { this.userIp = null; } - private GetSubnetworkHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetSubnetworkHttpRequest( String prettyPrint, String quotaUser, String subnetwork, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetSubnetworkHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetSubnetworkHttpRequest build() { String missing = ""; - - - - - if (subnetwork == null) { missing += " subnetwork"; } @@ -331,15 +322,7 @@ public GetSubnetworkHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - subnetwork, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, subnetwork, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "subnetwork=" + subnetwork + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetSubnetworkHttpRequest) { GetSubnetworkHttpRequest that = (GetSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - subnetwork, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, subnetwork, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java index 44b7e0624e8d..a81d5bea67ca 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetUrlMapHttpRequest() { this.userIp = null; } - private GetUrlMapHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetUrlMapHttpRequest( String prettyPrint, String quotaUser, String urlMap, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetUrlMapHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetUrlMapHttpRequest build() { String missing = ""; - - - - - if (urlMap == null) { missing += " urlMap"; } @@ -331,15 +322,7 @@ public GetUrlMapHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - urlMap, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, urlMap, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "urlMap=" + urlMap + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "urlMap=" + + urlMap + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetUrlMapHttpRequest) { GetUrlMapHttpRequest that = (GetUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - urlMap, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, urlMap, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java index c92faec7da67..be853c87c020 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private InsertAddressHttpRequest() { this.userIp = null; } - private InsertAddressHttpRequest( String access_token, Address addressResource, @@ -64,8 +60,7 @@ private InsertAddressHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.addressResource = addressResource; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertAddressHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public InsertAddressHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } @@ -360,16 +350,15 @@ public InsertAddressHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertAddressHttpRequest( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "InsertAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "addressResource=" + addressResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "addressResource=" + + addressResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof InsertAddressHttpRequest) { InsertAddressHttpRequest that = (InsertAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.addressResource, that.getAddressResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.addressResource, that.getAddressResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java index 6fb6a524f723..5ca99d620344 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private InsertInstanceGroupManagerHttpRequest() { this.zone = null; } - private InsertInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private InsertInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -89,8 +84,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("instanceGroupManagerResource") && instanceGroupManagerResource != null) { - fieldMap.put("instanceGroupManagerResource", Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + if (fieldNames.contains("instanceGroupManagerResource") + && instanceGroupManagerResource != null) { + fieldMap.put( + "instanceGroupManagerResource", + Collections.singletonList(String.valueOf(instanceGroupManagerResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +182,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInstanceGroupManagerHttpRequest(); } @@ -292,7 +292,8 @@ public InstanceGroupManager getInstanceGroupManagerResource() { return instanceGroupManagerResource; } - public Builder setInstanceGroupManagerResource(InstanceGroupManager instanceGroupManagerResource) { + public Builder setInstanceGroupManagerResource( + InstanceGroupManager instanceGroupManagerResource) { this.instanceGroupManagerResource = instanceGroupManagerResource; return this; } @@ -342,17 +343,9 @@ public Builder setZone(String zone) { return this; } - public InsertInstanceGroupManagerHttpRequest build() { String missing = ""; - - - - - - - if (zone == null) { missing += " zone"; } @@ -360,16 +353,15 @@ public InsertInstanceGroupManagerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -390,15 +382,32 @@ public Builder clone() { @Override public String toString() { return "InsertInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManagerResource=" + instanceGroupManagerResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManagerResource=" + + instanceGroupManagerResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -409,17 +418,16 @@ public boolean equals(Object o) { } if (o instanceof InsertInstanceGroupManagerHttpRequest) { InsertInstanceGroupManagerHttpRequest that = (InsertInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -427,15 +435,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java index 9677ee2e6b5e..4f21eb5e4bf6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private InsertUrlMapHttpRequest() { this.userIp = null; } - private InsertUrlMapHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private InsertUrlMapHttpRequest( String project, String quotaUser, UrlMap urlMapResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertUrlMapHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public InsertUrlMapHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + urlMapResource, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "InsertUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "urlMapResource=" + urlMapResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "urlMapResource=" + + urlMapResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof InsertUrlMapHttpRequest) { InsertUrlMapHttpRequest that = (InsertUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.urlMapResource, that.getUrlMapResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.urlMapResource, that.getUrlMapResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + urlMapResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java index 3523709d86db..4ffb882381ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private InstanceGroupManagerActionsSummary() { this.restarting = null; } - private InstanceGroupManagerActionsSummary( Integer abandoning, Integer creating, @@ -61,8 +57,7 @@ private InstanceGroupManagerActionsSummary( Integer none, Integer recreating, Integer refreshing, - Integer restarting - ) { + Integer restarting) { this.abandoning = abandoning; this.creating = creating; this.creatingWithoutRetries = creatingWithoutRetries; @@ -83,7 +78,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("creating", Collections.singletonList(String.valueOf(creating))); } if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) { - fieldMap.put("creatingWithoutRetries", Collections.singletonList(String.valueOf(creatingWithoutRetries))); + fieldMap.put( + "creatingWithoutRetries", + Collections.singletonList(String.valueOf(creatingWithoutRetries))); } if (fieldNames.contains("deleting") && deleting != null) { fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting))); @@ -170,22 +167,24 @@ public Integer getRestarting() { return restarting; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagerActionsSummary prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagerActionsSummary getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagerActionsSummary DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagerActionsSummary(); } @@ -314,25 +313,17 @@ public Builder setRestarting(Integer restarting) { return this; } - public InstanceGroupManagerActionsSummary build() { - - - - - - return new InstanceGroupManagerActionsSummary( - abandoning, - creating, - creatingWithoutRetries, - deleting, - none, - recreating, - refreshing, - restarting - ); + abandoning, + creating, + creatingWithoutRetries, + deleting, + none, + recreating, + refreshing, + restarting); } public Builder clone() { @@ -352,14 +343,29 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagerActionsSummary{" - + "abandoning=" + abandoning + ", " - + "creating=" + creating + ", " - + "creatingWithoutRetries=" + creatingWithoutRetries + ", " - + "deleting=" + deleting + ", " - + "none=" + none + ", " - + "recreating=" + recreating + ", " - + "refreshing=" + refreshing + ", " - + "restarting=" + restarting + + "abandoning=" + + abandoning + + ", " + + "creating=" + + creating + + ", " + + "creatingWithoutRetries=" + + creatingWithoutRetries + + ", " + + "deleting=" + + deleting + + ", " + + "none=" + + none + + ", " + + "recreating=" + + recreating + + ", " + + "refreshing=" + + refreshing + + ", " + + "restarting=" + + restarting + "}"; } @@ -370,16 +376,14 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupManagerActionsSummary) { InstanceGroupManagerActionsSummary that = (InstanceGroupManagerActionsSummary) o; - return - Objects.equals(this.abandoning, that.getAbandoning()) && - Objects.equals(this.creating, that.getCreating()) && - Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries()) && - Objects.equals(this.deleting, that.getDeleting()) && - Objects.equals(this.none, that.getNone()) && - Objects.equals(this.recreating, that.getRecreating()) && - Objects.equals(this.refreshing, that.getRefreshing()) && - Objects.equals(this.restarting, that.getRestarting()) - ; + return Objects.equals(this.abandoning, that.getAbandoning()) + && Objects.equals(this.creating, that.getCreating()) + && Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries()) + && Objects.equals(this.deleting, that.getDeleting()) + && Objects.equals(this.none, that.getNone()) + && Objects.equals(this.recreating, that.getRecreating()) + && Objects.equals(this.refreshing, that.getRefreshing()) + && Objects.equals(this.restarting, that.getRestarting()); } return false; } @@ -387,14 +391,13 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - abandoning, - creating, - creatingWithoutRetries, - deleting, - none, - recreating, - refreshing, - restarting - ); + abandoning, + creating, + creatingWithoutRetries, + deleting, + none, + recreating, + refreshing, + restarting); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java index e0692a5a613a..5a6559e893d0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InstanceGroupManagerStub; import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,34 @@ * *

* - *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings + * to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class InstanceGroupManagerClient implements BackgroundResource {
   private final InstanceGroupManagerSettings settings;
   private final InstanceGroupManagerStub stub;
 
-
-
-  /**
-   * Constructs an instance of InstanceGroupManagerClient with default settings.
-   */
+  /** Constructs an instance of InstanceGroupManagerClient with default settings. */
   public static final InstanceGroupManagerClient create() throws IOException {
     return create(InstanceGroupManagerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InstanceGroupManagerClient, using the given settings. The channels
+   * are created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings) throws IOException {
+  public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings)
+      throws IOException {
     return new InstanceGroupManagerClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InstanceGroupManagerSettings}.
+   * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use InstanceGroupManagerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceGroupManagerClient create(InstanceGroupManagerStub stub) {
@@ -144,9 +130,9 @@ public static final InstanceGroupManagerClient create(InstanceGroupManagerStub s
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InstanceGroupManagerClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
   protected InstanceGroupManagerClient(InstanceGroupManagerSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +154,18 @@ public InstanceGroupManagerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -187,21 +179,33 @@ public InstanceGroupManagerStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) {
+  public final Operation abandonInstancesInstanceGroupManager(
+      InstanceGroupManagerName instanceGroupManager,
+      InstanceGroupManagersAbandonInstancesRequest
+          instanceGroupManagersAbandonInstancesRequestResource) {
 
     AbandonInstancesInstanceGroupManagerHttpRequest request =
         AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
-        .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(
+                instanceGroupManager == null ? null : instanceGroupManager.toString())
+            .setInstanceGroupManagersAbandonInstancesRequestResource(
+                instanceGroupManagersAbandonInstancesRequestResource)
+            .build();
     return abandonInstancesInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -215,21 +219,32 @@ public final Operation abandonInstancesInstanceGroupManager(InstanceGroupManager
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) {
+  public final Operation abandonInstancesInstanceGroupManager(
+      String instanceGroupManager,
+      InstanceGroupManagersAbandonInstancesRequest
+          instanceGroupManagersAbandonInstancesRequestResource) {
 
     AbandonInstancesInstanceGroupManagerHttpRequest request =
         AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setInstanceGroupManagersAbandonInstancesRequestResource(
+                instanceGroupManagersAbandonInstancesRequestResource)
+            .build();
     return abandonInstancesInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -246,15 +261,23 @@ public final Operation abandonInstancesInstanceGroupManager(String instanceGroup
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation abandonInstancesInstanceGroupManager(
+      AbandonInstancesInstanceGroupManagerHttpRequest request) {
     return abandonInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -270,7 +293,8 @@ public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInst
    * 
*/ @BetaApi - public final UnaryCallable abandonInstancesInstanceGroupManagerCallable() { + public final UnaryCallable + abandonInstancesInstanceGroupManagerCallable() { return stub.abandonInstancesInstanceGroupManagerCallable(); } @@ -278,7 +302,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -292,11 +317,12 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -318,11 +345,10 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(String project) {
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
+      String project) {
     AggregatedListInstanceGroupManagersHttpRequest request =
-        AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListInstanceGroupManagersHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListInstanceGroupManagers(request);
   }
 
@@ -330,7 +356,8 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -347,16 +374,17 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(AggregatedListInstanceGroupManagersHttpRequest request) {
-    return aggregatedListInstanceGroupManagersPagedCallable()
-        .call(request);
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
+      AggregatedListInstanceGroupManagersHttpRequest request) {
+    return aggregatedListInstanceGroupManagersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -372,7 +400,10 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { + public final UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersPagedCallable() { return stub.aggregatedListInstanceGroupManagersPagedCallable(); } @@ -380,7 +411,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -403,15 +435,20 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListInstanceGroupManagersCallable() { + public final UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersCallable() { return stub.aggregatedListInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -427,16 +464,20 @@ public final Operation deleteInstanceGroupManager(InstanceGroupManagerName insta
 
     DeleteInstanceGroupManagerHttpRequest request =
         DeleteInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
-        .build();
+            .setInstanceGroupManager(
+                instanceGroupManager == null ? null : instanceGroupManager.toString())
+            .build();
     return deleteInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -452,16 +493,19 @@ public final Operation deleteInstanceGroupManager(String instanceGroupManager) {
 
     DeleteInstanceGroupManagerHttpRequest request =
         DeleteInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return deleteInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -482,9 +526,12 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -498,15 +545,22 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable deleteInstanceGroupManagerCallable() { + public final UnaryCallable + deleteInstanceGroupManagerCallable() { return stub.deleteInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -520,21 +574,32 @@ public final UnaryCallable del
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) {
+  public final Operation deleteInstancesInstanceGroupManager(
+      InstanceGroupManagerName instanceGroupManager,
+      InstanceGroupManagersDeleteInstancesRequest
+          instanceGroupManagersDeleteInstancesRequestResource) {
 
     DeleteInstancesInstanceGroupManagerHttpRequest request =
         DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
-        .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(
+                instanceGroupManager == null ? null : instanceGroupManager.toString())
+            .setInstanceGroupManagersDeleteInstancesRequestResource(
+                instanceGroupManagersDeleteInstancesRequestResource)
+            .build();
     return deleteInstancesInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -548,21 +613,31 @@ public final Operation deleteInstancesInstanceGroupManager(InstanceGroupManagerN
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) {
+  public final Operation deleteInstancesInstanceGroupManager(
+      String instanceGroupManager,
+      InstanceGroupManagersDeleteInstancesRequest
+          instanceGroupManagersDeleteInstancesRequestResource) {
 
     DeleteInstancesInstanceGroupManagerHttpRequest request =
         DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setInstanceGroupManagersDeleteInstancesRequestResource(
+                instanceGroupManagersDeleteInstancesRequestResource)
+            .build();
     return deleteInstancesInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -579,15 +654,22 @@ public final Operation deleteInstancesInstanceGroupManager(String instanceGroupM
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteInstancesInstanceGroupManager(
+      DeleteInstancesInstanceGroupManagerHttpRequest request) {
     return deleteInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -603,15 +685,18 @@ public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstan
    * 
*/ @BetaApi - public final UnaryCallable deleteInstancesInstanceGroupManagerCallable() { + public final UnaryCallable + deleteInstancesInstanceGroupManagerCallable() { return stub.deleteInstancesInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. + * Returns all of the details about the specified managed instance group. Get a list of available + * managed instance groups by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -623,20 +708,24 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -652,16 +741,18 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa
 
     GetInstanceGroupManagerHttpRequest request =
         GetInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return getInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request.
+   * Returns all of the details about the specified managed instance group. Get a list of available
+   * managed instance groups by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -676,15 +767,18 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManagerHttpRequest request) {
+  public final InstanceGroupManager getInstanceGroupManager(
+      GetInstanceGroupManagerHttpRequest request) {
     return getInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request.
+   * Returns all of the details about the specified managed instance group. Get a list of available
+   * managed instance groups by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -698,15 +792,21 @@ public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManage
    * 
*/ @BetaApi - public final UnaryCallable getInstanceGroupManagerCallable() { + public final UnaryCallable + getInstanceGroupManagerCallable() { return stub.getInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -720,21 +820,27 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -748,21 +854,27 @@ public final Operation insertInstanceGroupManager(ZoneName zone, InstanceGroupMa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertInstanceGroupManager(String zone, InstanceGroupManager instanceGroupManagerResource) {
+  public final Operation insertInstanceGroupManager(
+      String zone, InstanceGroupManager instanceGroupManagerResource) {
 
     InsertInstanceGroupManagerHttpRequest request =
         InsertInstanceGroupManagerHttpRequest.newBuilder()
-        .setZone(zone)
-        .setInstanceGroupManagerResource(instanceGroupManagerResource)
-        .build();
+            .setZone(zone)
+            .setInstanceGroupManagerResource(instanceGroupManagerResource)
+            .build();
     return insertInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After
+   * the group is created, it schedules an action to create instances in the group 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -785,9 +897,14 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After
+   * the group is created, it schedules an action to create instances in the group 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -803,15 +920,18 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable insertInstanceGroupManagerCallable() { + public final UnaryCallable + insertInstanceGroupManagerCallable() { return stub.insertInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * Retrieves a list of managed instance groups that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -828,16 +948,18 @@ public final UnaryCallable ins
   public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ZoneName zone) {
     ListInstanceGroupManagersHttpRequest request =
         ListInstanceGroupManagersHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and zone.
+   * Retrieves a list of managed instance groups that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -853,17 +975,17 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Zo
   @BetaApi
   public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(String zone) {
     ListInstanceGroupManagersHttpRequest request =
-        ListInstanceGroupManagersHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListInstanceGroupManagersHttpRequest.newBuilder().setZone(zone).build();
     return listInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and zone.
+   * Retrieves a list of managed instance groups that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -880,16 +1002,18 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ListInstanceGroupManagersHttpRequest request) {
-    return listInstanceGroupManagersPagedCallable()
-        .call(request);
+  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
+      ListInstanceGroupManagersHttpRequest request) {
+    return listInstanceGroupManagersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and zone.
+   * Retrieves a list of managed instance groups that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -905,15 +1029,19 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Li
    * 
*/ @BetaApi - public final UnaryCallable listInstanceGroupManagersPagedCallable() { + public final UnaryCallable< + ListInstanceGroupManagersHttpRequest, ListInstanceGroupManagersPagedResponse> + listInstanceGroupManagersPagedCallable() { return stub.listInstanceGroupManagersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * Retrieves a list of managed instance groups that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -936,15 +1064,20 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstanceGroupManagersCallable() { + public final UnaryCallable + listInstanceGroupManagersCallable() { return stub.listInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -956,20 +1089,26 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -981,20 +1120,25 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(String instanceGroupManager) {
+  public final InstanceGroupManagersListManagedInstancesResponse
+      listManagedInstancesInstanceGroupManagers(String instanceGroupManager) {
 
     ListManagedInstancesInstanceGroupManagersHttpRequest request =
         ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return listManagedInstancesInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1009,15 +1153,21 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(ListManagedInstancesInstanceGroupManagersHttpRequest request) {
+  public final InstanceGroupManagersListManagedInstancesResponse
+      listManagedInstancesInstanceGroupManagers(
+          ListManagedInstancesInstanceGroupManagersHttpRequest request) {
     return listManagedInstancesInstanceGroupManagersCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1031,15 +1181,23 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * 
*/ @BetaApi - public final UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { + public final UnaryCallable< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersCallable() { return stub.listManagedInstancesInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * action with the listmanagedinstances method. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1053,21 +1211,31 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1081,21 +1249,30 @@ public final Operation recreateInstancesInstanceGroupManager(InstanceGroupManage
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) {
+  public final Operation recreateInstancesInstanceGroupManager(
+      String instanceGroupManager,
+      InstanceGroupManagersRecreateInstancesRequest
+          instanceGroupManagersRecreateInstancesRequestResource) {
 
     RecreateInstancesInstanceGroupManagerHttpRequest request =
         RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setInstanceGroupManagersRecreateInstancesRequestResource(
+                instanceGroupManagersRecreateInstancesRequestResource)
+            .build();
     return recreateInstancesInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The
+   * instances are deleted and recreated using the current instance template for the managed
+   * instance group. This operation is marked as DONE when the action is scheduled even if the
+   * instances have not yet been recreated. You must separately verify the status of the recreating
+   * action with the listmanagedinstances method.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1112,15 +1289,21 @@ public final Operation recreateInstancesInstanceGroupManager(String instanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation recreateInstancesInstanceGroupManager(
+      RecreateInstancesInstanceGroupManagerHttpRequest request) {
     return recreateInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The
+   * instances are deleted and recreated using the current instance template for the managed
+   * instance group. This operation is marked as DONE when the action is scheduled even if the
+   * instances have not yet been recreated. You must separately verify the status of the recreating
+   * action with the listmanagedinstances method.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1136,15 +1319,21 @@ public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesIn
    * 
*/ @BetaApi - public final UnaryCallable recreateInstancesInstanceGroupManagerCallable() { + public final UnaryCallable + recreateInstancesInstanceGroupManagerCallable() { return stub.recreateInstancesInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1153,26 +1342,35 @@ public final UnaryCallable
* - * @param 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 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 instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeInstanceGroupManager(Integer size, InstanceGroupManagerName instanceGroupManager) { + public final Operation resizeInstanceGroupManager( + Integer size, InstanceGroupManagerName instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setSize(size) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return resizeInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1181,7 +1379,9 @@ public final Operation resizeInstanceGroupManager(Integer size, InstanceGroupMan
    * }
    * 
* - * @param 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 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 instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1190,17 +1390,22 @@ public final Operation resizeInstanceGroupManager(Integer size, String instanceG ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setSize(size) + .setInstanceGroupManager(instanceGroupManager) + .build(); return resizeInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1223,9 +1428,14 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1241,15 +1451,18 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable resizeInstanceGroupManagerCallable() { + public final UnaryCallable + resizeInstanceGroupManagerCallable() { return stub.resizeInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. + * 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 recreate them. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1263,21 +1476,28 @@ public final UnaryCallable res
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateInstanceGroupManager(InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) {
+  public final Operation setInstanceTemplateInstanceGroupManager(
+      InstanceGroupManagerName instanceGroupManager,
+      InstanceGroupManagersSetInstanceTemplateRequest
+          instanceGroupManagersSetInstanceTemplateRequestResource) {
 
     SetInstanceTemplateInstanceGroupManagerHttpRequest request =
         SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
-        .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
-        .build();
+            .setInstanceGroupManager(
+                instanceGroupManager == null ? null : instanceGroupManager.toString())
+            .setInstanceGroupManagersSetInstanceTemplateRequestResource(
+                instanceGroupManagersSetInstanceTemplateRequestResource)
+            .build();
     return setInstanceTemplateInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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 recreate them.
+   * 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 recreate them.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1291,21 +1511,27 @@ public final Operation setInstanceTemplateInstanceGroupManager(InstanceGroupMana
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) {
+  public final Operation setInstanceTemplateInstanceGroupManager(
+      String instanceGroupManager,
+      InstanceGroupManagersSetInstanceTemplateRequest
+          instanceGroupManagersSetInstanceTemplateRequestResource) {
 
     SetInstanceTemplateInstanceGroupManagerHttpRequest request =
         SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setInstanceGroupManagersSetInstanceTemplateRequestResource(
+                instanceGroupManagersSetInstanceTemplateRequestResource)
+            .build();
     return setInstanceTemplateInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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 recreate them.
+   * 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 recreate them.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1322,15 +1548,18 @@ public final Operation setInstanceTemplateInstanceGroupManager(String instanceGr
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTemplateInstanceGroupManagerHttpRequest request) {
+  public final Operation setInstanceTemplateInstanceGroupManager(
+      SetInstanceTemplateInstanceGroupManagerHttpRequest request) {
     return setInstanceTemplateInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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 recreate them.
+   * 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 recreate them.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1346,15 +1575,21 @@ public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTempla
    * 
*/ @BetaApi - public final UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { + public final UnaryCallable + setInstanceTemplateInstanceGroupManagerCallable() { return stub.setInstanceTemplateInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1368,21 +1603,31 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1396,21 +1641,30 @@ public final Operation setTargetPoolsInstanceGroupManager(InstanceGroupManagerNa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsInstanceGroupManager(String instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) {
+  public final Operation setTargetPoolsInstanceGroupManager(
+      String instanceGroupManager,
+      InstanceGroupManagersSetTargetPoolsRequest
+          instanceGroupManagersSetTargetPoolsRequestResource) {
 
     SetTargetPoolsInstanceGroupManagerHttpRequest request =
         SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .setInstanceGroupManagersSetTargetPoolsRequestResource(
+                instanceGroupManagersSetTargetPoolsRequestResource)
+            .build();
     return setTargetPoolsInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1427,15 +1681,21 @@ public final Operation setTargetPoolsInstanceGroupManager(String instanceGroupMa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstanceGroupManagerHttpRequest request) {
+  public final Operation setTargetPoolsInstanceGroupManager(
+      SetTargetPoolsInstanceGroupManagerHttpRequest request) {
     return setTargetPoolsInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1451,7 +1711,8 @@ public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstance
    * 
*/ @BetaApi - public final UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { + public final UnaryCallable + setTargetPoolsInstanceGroupManagerCallable() { return stub.setTargetPoolsInstanceGroupManagerCallable(); } @@ -1485,43 +1746,56 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersFixedSizeCollection> { + public static class AggregatedListInstanceGroupManagersPagedResponse + extends AbstractPagedListResponse< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListInstanceGroupManagersPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersPagedResponse>() { @Override - public AggregatedListInstanceGroupManagersPagedResponse apply(AggregatedListInstanceGroupManagersPage input) { + public AggregatedListInstanceGroupManagersPagedResponse apply( + AggregatedListInstanceGroupManagersPage input) { return new AggregatedListInstanceGroupManagersPagedResponse(input); } }); } - private AggregatedListInstanceGroupManagersPagedResponse(AggregatedListInstanceGroupManagersPage page) { + private AggregatedListInstanceGroupManagersPagedResponse( + AggregatedListInstanceGroupManagersPage page) { super(page, AggregatedListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListInstanceGroupManagersPage extends AbstractPage< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage> { + public static class AggregatedListInstanceGroupManagersPage + extends AbstractPage< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage> { private AggregatedListInstanceGroupManagersPage( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, InstanceGroupManagerAggregatedList response) { super(context, response); } @@ -1532,31 +1806,37 @@ private static AggregatedListInstanceGroupManagersPage createEmptyPage() { @Override protected AggregatedListInstanceGroupManagersPage createPage( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, InstanceGroupManagerAggregatedList response) { return new AggregatedListInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersFixedSizeCollection> { + public static class AggregatedListInstanceGroupManagersFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { - private AggregatedListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListInstanceGroupManagersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1569,18 +1849,22 @@ protected AggregatedListInstanceGroupManagersFixedSizeCollection createCollectio List pages, int collectionSize) { return new AggregatedListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage, - ListInstanceGroupManagersFixedSizeCollection> { + + public static class ListInstanceGroupManagersPagedResponse + extends AbstractPagedListResponse< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage, + ListInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1588,7 +1872,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public ListInstanceGroupManagersPagedResponse apply(ListInstanceGroupManagersPage input) { + public ListInstanceGroupManagersPagedResponse apply( + ListInstanceGroupManagersPage input) { return new ListInstanceGroupManagersPagedResponse(input); } }); @@ -1597,18 +1882,21 @@ public ListInstanceGroupManagersPagedResponse apply(ListInstanceGroupManagersPag private ListInstanceGroupManagersPagedResponse(ListInstanceGroupManagersPage page) { super(page, ListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstanceGroupManagersPage extends AbstractPage< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage> { + public static class ListInstanceGroupManagersPage + extends AbstractPage< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage> { private ListInstanceGroupManagersPage( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager> + context, InstanceGroupManagerList response) { super(context, response); } @@ -1619,31 +1907,37 @@ private static ListInstanceGroupManagersPage createEmptyPage() { @Override protected ListInstanceGroupManagersPage createPage( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager> + context, InstanceGroupManagerList response) { return new ListInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage, - ListInstanceGroupManagersFixedSizeCollection> { + public static class ListInstanceGroupManagersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage, + ListInstanceGroupManagersFixedSizeCollection> { - private ListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + private ListInstanceGroupManagersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1656,7 +1950,5 @@ protected ListInstanceGroupManagersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java index 88869b5cd248..e08eb75e9557 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstanceGroupsRemoveInstancesRequest() { this.instances = null; } - - private InstanceGroupsRemoveInstancesRequest( - List instances - ) { + private InstanceGroupsRemoveInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsRemoveInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsRemoveInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsRemoveInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsRemoveInstancesRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(InstanceReference instances) { return this; } - public InstanceGroupsRemoveInstancesRequest build() { - return new InstanceGroupsRemoveInstancesRequest( - instances - ); + return new InstanceGroupsRemoveInstancesRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupsRemoveInstancesRequest{" - + "instances=" + instances - + "}"; + return "InstanceGroupsRemoveInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsRemoveInstancesRequest) { InstanceGroupsRemoveInstancesRequest that = (InstanceGroupsRemoveInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java index a1f965b37e67..0aab1348c662 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -50,7 +47,6 @@ private InstanceTemplate() { this.selfLink = null; } - private InstanceTemplate( String creationTimestamp, String description, @@ -58,8 +54,7 @@ private InstanceTemplate( String kind, String name, InstanceProperties properties, - String selfLink - ) { + String selfLink) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -73,7 +68,8 @@ private InstanceTemplate( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -156,22 +152,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceTemplate prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceTemplate getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceTemplate DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceTemplate(); } @@ -286,23 +284,10 @@ public Builder setSelfLink(String selfLink) { return this; } - public InstanceTemplate build() { - - - - - return new InstanceTemplate( - creationTimestamp, - description, - id, - kind, - name, - properties, - selfLink - ); + creationTimestamp, description, id, kind, name, properties, selfLink); } public Builder clone() { @@ -321,13 +306,26 @@ public Builder clone() { @Override public String toString() { return "InstanceTemplate{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "properties=" + properties + ", " - + "selfLink=" + selfLink + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "properties=" + + properties + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -338,29 +336,19 @@ public boolean equals(Object o) { } if (o instanceof InstanceTemplate) { InstanceTemplate that = (InstanceTemplate) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.properties, that.getProperties()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.properties, that.getProperties()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @Override public int hashCode() { - return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - properties, - selfLink - ); + return Objects.hash(creationTimestamp, description, id, kind, name, properties, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java index 8ce925c89077..3b4ef6048d60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -62,7 +59,6 @@ private ListInstancesInstanceGroupsHttpRequest() { this.userIp = null; } - private ListInstancesInstanceGroupsHttpRequest( String access_token, String callback, @@ -76,8 +72,7 @@ private ListInstancesInstanceGroupsHttpRequest( String pageToken, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -111,8 +106,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instanceGroup") && instanceGroup != null) { fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); } - if (fieldNames.contains("instanceGroupsListInstancesRequestResource") && instanceGroupsListInstancesRequestResource != null) { - fieldMap.put("instanceGroupsListInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); + if (fieldNames.contains("instanceGroupsListInstancesRequestResource") + && instanceGroupsListInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsListInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -240,22 +238,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstancesInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstancesInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstancesInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstancesInstanceGroupsHttpRequest(); } @@ -295,7 +295,8 @@ public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { this.instanceGroup = other.instanceGroup; } if (other.getInstanceGroupsListInstancesRequestResource() != null) { - this.instanceGroupsListInstancesRequestResource = other.instanceGroupsListInstancesRequestResource; + this.instanceGroupsListInstancesRequestResource = + other.instanceGroupsListInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -327,7 +328,8 @@ public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { this.fields = source.fields; this.filter = source.filter; this.instanceGroup = source.instanceGroup; - this.instanceGroupsListInstancesRequestResource = source.instanceGroupsListInstancesRequestResource; + this.instanceGroupsListInstancesRequestResource = + source.instanceGroupsListInstancesRequestResource; this.key = source.key; this.maxResults = source.maxResults; this.orderBy = source.orderBy; @@ -386,7 +388,8 @@ public InstanceGroupsListInstancesRequest getInstanceGroupsListInstancesRequestR return instanceGroupsListInstancesRequestResource; } - public Builder setInstanceGroupsListInstancesRequestResource(InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + public Builder setInstanceGroupsListInstancesRequestResource( + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { this.instanceGroupsListInstancesRequestResource = instanceGroupsListInstancesRequestResource; return this; } @@ -454,42 +457,30 @@ public Builder setUserIp(String userIp) { return this; } - public ListInstancesInstanceGroupsHttpRequest build() { String missing = ""; - - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstancesInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - instanceGroup, - instanceGroupsListInstancesRequestResource, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -499,7 +490,8 @@ public Builder clone() { newBuilder.setFields(this.fields); newBuilder.setFilter(this.filter); newBuilder.setInstanceGroup(this.instanceGroup); - newBuilder.setInstanceGroupsListInstancesRequestResource(this.instanceGroupsListInstancesRequestResource); + newBuilder.setInstanceGroupsListInstancesRequestResource( + this.instanceGroupsListInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setMaxResults(this.maxResults); newBuilder.setOrderBy(this.orderBy); @@ -514,19 +506,44 @@ public Builder clone() { @Override public String toString() { return "ListInstancesInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "instanceGroup=" + instanceGroup + ", " - + "instanceGroupsListInstancesRequestResource=" + instanceGroupsListInstancesRequestResource + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "instanceGroupsListInstancesRequestResource=" + + instanceGroupsListInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -537,21 +554,21 @@ public boolean equals(Object o) { } if (o instanceof ListInstancesInstanceGroupsHttpRequest) { ListInstancesInstanceGroupsHttpRequest that = (ListInstancesInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.instanceGroupsListInstancesRequestResource, that.getInstanceGroupsListInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals( + this.instanceGroupsListInstancesRequestResource, + that.getInstanceGroupsListInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -559,19 +576,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instanceGroup, - instanceGroupsListInstancesRequestResource, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java index 5a6b9b5b0170..4f87e0ad4103 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionsHttpRequest() { this.userIp = null; } - private ListRegionsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionsHttpRequest) { ListRegionsHttpRequest that = (ListRegionsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java index ad3429da957d..103aaf931bfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetHttpProxiesHttpRequest() { this.userIp = null; } - private ListTargetHttpProxiesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetHttpProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetHttpProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetHttpProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetHttpProxiesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetHttpProxiesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetHttpProxiesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetHttpProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetHttpProxiesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetHttpProxiesHttpRequest) { ListTargetHttpProxiesHttpRequest that = (ListTargetHttpProxiesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java index ae290b934b14..468717b78089 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetSslProxiesHttpRequest() { this.userIp = null; } - private ListTargetSslProxiesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetSslProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetSslProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetSslProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetSslProxiesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetSslProxiesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetSslProxiesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetSslProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetSslProxiesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetSslProxiesHttpRequest) { ListTargetSslProxiesHttpRequest that = (ListTargetSslProxiesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java index 2a2984bba0f6..81158c51956a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.stub.NetworkStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteNetwork to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteNetwork to 30 seconds: * *

  * 
@@ -85,84 +63,64 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class NetworkSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteNetwork.
-   */
+  /** Returns the object with the settings used for calls to deleteNetwork. */
   public UnaryCallSettings deleteNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).deleteNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getNetwork.
-   */
+  /** Returns the object with the settings used for calls to getNetwork. */
   public UnaryCallSettings getNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).getNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertNetwork.
-   */
+  /** Returns the object with the settings used for calls to insertNetwork. */
   public UnaryCallSettings insertNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).insertNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listNetworks.
-   */
-  public PagedCallSettings listNetworksSettings() {
+  /** Returns the object with the settings used for calls to listNetworks. */
+  public PagedCallSettings
+      listNetworksSettings() {
     return ((NetworkStubSettings) getStubSettings()).listNetworksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to switchToCustomModeNetwork.
-   */
-  public UnaryCallSettings switchToCustomModeNetworkSettings() {
+  /** Returns the object with the settings used for calls to switchToCustomModeNetwork. */
+  public UnaryCallSettings
+      switchToCustomModeNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).switchToCustomModeNetworkSettings();
   }
 
-
   public static final NetworkSettings create(NetworkStubSettings stub) throws IOException {
     return new NetworkSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return NetworkStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return NetworkStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return NetworkStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return NetworkStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return NetworkStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return NetworkStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return NetworkStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -175,23 +133,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return NetworkStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -200,9 +152,7 @@ protected NetworkSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for NetworkSettings.
-   */
+  /** Builder for NetworkSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -224,7 +174,6 @@ protected Builder(NetworkStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public NetworkStubSettings.Builder getStubSettingsBuilder() {
       return ((NetworkStubSettings.Builder) getStubSettings());
     }
@@ -232,45 +181,40 @@ public NetworkStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteNetwork. - */ + /** Returns the builder for the settings used for calls to deleteNetwork. */ public UnaryCallSettings.Builder deleteNetworkSettings() { return getStubSettingsBuilder().deleteNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to getNetwork. - */ + /** Returns the builder for the settings used for calls to getNetwork. */ public UnaryCallSettings.Builder getNetworkSettings() { return getStubSettingsBuilder().getNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to insertNetwork. - */ + /** Returns the builder for the settings used for calls to insertNetwork. */ public UnaryCallSettings.Builder insertNetworkSettings() { return getStubSettingsBuilder().insertNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to listNetworks. - */ - public PagedCallSettings.Builder listNetworksSettings() { + /** Returns the builder for the settings used for calls to listNetworks. */ + public PagedCallSettings.Builder< + ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse> + listNetworksSettings() { return getStubSettingsBuilder().listNetworksSettings(); } - /** - * Returns the builder for the settings used for calls to switchToCustomModeNetwork. - */ - public UnaryCallSettings.Builder switchToCustomModeNetworkSettings() { + /** Returns the builder for the settings used for calls to switchToCustomModeNetwork. */ + public UnaryCallSettings.Builder + switchToCustomModeNetworkSettings() { return getStubSettingsBuilder().switchToCustomModeNetworkSettings(); } @@ -279,4 +223,4 @@ public NetworkSettings build() throws IOException { return new NetworkSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java index 7020c662d1cb..79986b1e70d9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -46,14 +45,8 @@ private OperationList() { this.selfLink = null; } - private OperationList( - String id, - List items, - String kind, - String nextPageToken, - String selfLink - ) { + String id, List items, String kind, String nextPageToken, String selfLink) { this.id = id; this.items = items; this.kind = kind; @@ -132,22 +125,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(OperationList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static OperationList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final OperationList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new OperationList(); } @@ -242,19 +237,9 @@ public Builder setSelfLink(String selfLink) { return this; } - public OperationList build() { - - - - return new OperationList( - id, - items, - kind, - nextPageToken, - selfLink - ); + return new OperationList(id, items, kind, nextPageToken, selfLink); } public Builder clone() { @@ -271,11 +256,20 @@ public Builder clone() { @Override public String toString() { return "OperationList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -286,25 +280,17 @@ public boolean equals(Object o) { } if (o instanceof OperationList) { OperationList that = (OperationList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java index 00eff7049361..bec535da0955 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private Quota() { this.usage = null; } - - private Quota( - Double limit, - String metric, - Double usage - ) { + private Quota(Double limit, String metric, Double usage) { this.limit = limit; this.metric = metric; this.usage = usage; @@ -100,22 +92,24 @@ public Double getUsage() { return usage; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Quota prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Quota getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Quota DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Quota(); } @@ -174,15 +168,9 @@ public Builder setUsage(Double usage) { return this; } - public Quota build() { - - return new Quota( - limit, - metric, - usage - ); + return new Quota(limit, metric, usage); } public Builder clone() { @@ -196,11 +184,7 @@ public Builder clone() { @Override public String toString() { - return "Quota{" - + "limit=" + limit + ", " - + "metric=" + metric + ", " - + "usage=" + usage - + "}"; + return "Quota{" + "limit=" + limit + ", " + "metric=" + metric + ", " + "usage=" + usage + "}"; } @Override @@ -210,21 +194,15 @@ public boolean equals(Object o) { } if (o instanceof Quota) { Quota that = (Quota) o; - return - Objects.equals(this.limit, that.getLimit()) && - Objects.equals(this.metric, that.getMetric()) && - Objects.equals(this.usage, that.getUsage()) - ; + return Objects.equals(this.limit, that.getLimit()) + && Objects.equals(this.metric, that.getMetric()) + && Objects.equals(this.usage, that.getUsage()); } return false; } @Override public int hashCode() { - return Objects.hash( - limit, - metric, - usage - ); + return Objects.hash(limit, metric, usage); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java index 9aa6cead1c86..01a07451f1ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,7 +33,8 @@ public final class RecreateInstancesInstanceGroupManagerHttpRequest implements A private final String callback; private final String fields; private final String instanceGroupManager; - private final InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource; + private final InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -54,23 +52,23 @@ private RecreateInstancesInstanceGroupManagerHttpRequest() { this.userIp = null; } - private RecreateInstancesInstanceGroupManagerHttpRequest( String access_token, String callback, String fields, String instanceGroupManager, - InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource, String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instanceGroupManager = instanceGroupManager; - this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource; + this.instanceGroupManagersRecreateInstancesRequestResource = + instanceGroupManagersRecreateInstancesRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -90,10 +88,15 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } - if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") && instanceGroupManagersRecreateInstancesRequestResource != null) { - fieldMap.put("instanceGroupManagersRecreateInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); + if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") + && instanceGroupManagersRecreateInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupManagersRecreateInstancesRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -164,7 +167,8 @@ public String getInstanceGroupManager() { return instanceGroupManager; } - public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() { + public InstanceGroupManagersRecreateInstancesRequest + getInstanceGroupManagersRecreateInstancesRequestResource() { return instanceGroupManagersRecreateInstancesRequestResource; } @@ -184,22 +188,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RecreateInstancesInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RecreateInstancesInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RecreateInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RecreateInstancesInstanceGroupManagerHttpRequest(); } @@ -209,7 +215,8 @@ public static class Builder { private String callback; private String fields; private String instanceGroupManager; - private InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource; + private InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource; private String key; private String prettyPrint; private String quotaUser; @@ -218,7 +225,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) { - if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -232,7 +240,8 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) this.instanceGroupManager = other.instanceGroupManager; } if (other.getInstanceGroupManagersRecreateInstancesRequestResource() != null) { - this.instanceGroupManagersRecreateInstancesRequestResource = other.instanceGroupManagersRecreateInstancesRequestResource; + this.instanceGroupManagersRecreateInstancesRequestResource = + other.instanceGroupManagersRecreateInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -254,7 +263,8 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) this.callback = source.callback; this.fields = source.fields; this.instanceGroupManager = source.instanceGroupManager; - this.instanceGroupManagersRecreateInstancesRequestResource = source.instanceGroupManagersRecreateInstancesRequestResource; + this.instanceGroupManagersRecreateInstancesRequestResource = + source.instanceGroupManagersRecreateInstancesRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -297,12 +307,16 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { return this; } - public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() { + public InstanceGroupManagersRecreateInstancesRequest + getInstanceGroupManagersRecreateInstancesRequestResource() { return instanceGroupManagersRecreateInstancesRequestResource; } - public Builder setInstanceGroupManagersRecreateInstancesRequestResource(InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { - this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource; + public Builder setInstanceGroupManagersRecreateInstancesRequestResource( + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource) { + this.instanceGroupManagersRecreateInstancesRequestResource = + instanceGroupManagersRecreateInstancesRequestResource; return this; } @@ -342,34 +356,26 @@ public Builder setUserIp(String userIp) { return this; } - public RecreateInstancesInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RecreateInstancesInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersRecreateInstancesRequestResource, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersRecreateInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -378,7 +384,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroupManager(this.instanceGroupManager); - newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource(this.instanceGroupManagersRecreateInstancesRequestResource); + newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource( + this.instanceGroupManagersRecreateInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -390,15 +397,32 @@ public Builder clone() { @Override public String toString() { return "RecreateInstancesInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "instanceGroupManagersRecreateInstancesRequestResource=" + instanceGroupManagersRecreateInstancesRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagersRecreateInstancesRequestResource=" + + instanceGroupManagersRecreateInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -408,18 +432,19 @@ public boolean equals(Object o) { return true; } if (o instanceof RecreateInstancesInstanceGroupManagerHttpRequest) { - RecreateInstancesInstanceGroupManagerHttpRequest that = (RecreateInstancesInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.instanceGroupManagersRecreateInstancesRequestResource, that.getInstanceGroupManagersRecreateInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + RecreateInstancesInstanceGroupManagerHttpRequest that = + (RecreateInstancesInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagersRecreateInstancesRequestResource, + that.getInstanceGroupManagersRecreateInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +452,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersRecreateInstancesRequestResource, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersRecreateInstancesRequestResource, + key, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java index ef7c045a3f38..8de544d182b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class RecreateInstancesRegionInstanceGroupManagerHttpRequest implem private final String key; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource; + private final RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource; private final String userIp; private RecreateInstancesRegionInstanceGroupManagerHttpRequest() { @@ -54,7 +52,6 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private RecreateInstancesRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -64,8 +61,7 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -73,7 +69,8 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource; + this.regionInstanceGroupManagersRecreateRequestResource = + regionInstanceGroupManagersRecreateRequestResource; this.userIp = userIp; } @@ -90,7 +87,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -101,8 +99,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") && regionInstanceGroupManagersRecreateRequestResource != null) { - fieldMap.put("regionInstanceGroupManagersRecreateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); + if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") + && regionInstanceGroupManagersRecreateRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersRecreateRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -176,7 +178,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() { + public RegionInstanceGroupManagersRecreateRequest + getRegionInstanceGroupManagersRecreateRequestResource() { return regionInstanceGroupManagersRecreateRequestResource; } @@ -184,22 +187,25 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) { + + public static Builder newBuilder( + RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RecreateInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RecreateInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RecreateInstancesRegionInstanceGroupManagerHttpRequest(); } @@ -212,13 +218,15 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource; + private RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource; private String userIp; Builder() {} public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest other) { - if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -241,7 +249,8 @@ public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupManagersRecreateRequestResource() != null) { - this.regionInstanceGroupManagersRecreateRequestResource = other.regionInstanceGroupManagersRecreateRequestResource; + this.regionInstanceGroupManagersRecreateRequestResource = + other.regionInstanceGroupManagersRecreateRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -257,7 +266,8 @@ public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupManagersRecreateRequestResource = source.regionInstanceGroupManagersRecreateRequestResource; + this.regionInstanceGroupManagersRecreateRequestResource = + source.regionInstanceGroupManagersRecreateRequestResource; this.userIp = source.userIp; } @@ -324,12 +334,16 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() { + public RegionInstanceGroupManagersRecreateRequest + getRegionInstanceGroupManagersRecreateRequestResource() { return regionInstanceGroupManagersRecreateRequestResource; } - public Builder setRegionInstanceGroupManagersRecreateRequestResource(RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { - this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource; + public Builder setRegionInstanceGroupManagersRecreateRequestResource( + RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource) { + this.regionInstanceGroupManagersRecreateRequestResource = + regionInstanceGroupManagersRecreateRequestResource; return this; } @@ -342,34 +356,26 @@ public Builder setUserIp(String userIp) { return this; } - public RecreateInstancesRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RecreateInstancesRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersRecreateRequestResource, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersRecreateRequestResource, + userIp); } public Builder clone() { @@ -381,7 +387,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupManagersRecreateRequestResource(this.regionInstanceGroupManagersRecreateRequestResource); + newBuilder.setRegionInstanceGroupManagersRecreateRequestResource( + this.regionInstanceGroupManagersRecreateRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -390,15 +397,32 @@ public Builder clone() { @Override public String toString() { return "RecreateInstancesRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupManagersRecreateRequestResource=" + regionInstanceGroupManagersRecreateRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupManagersRecreateRequestResource=" + + regionInstanceGroupManagersRecreateRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -408,18 +432,19 @@ public boolean equals(Object o) { return true; } if (o instanceof RecreateInstancesRegionInstanceGroupManagerHttpRequest) { - RecreateInstancesRegionInstanceGroupManagerHttpRequest that = (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupManagersRecreateRequestResource, that.getRegionInstanceGroupManagersRecreateRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + RecreateInstancesRegionInstanceGroupManagerHttpRequest that = + (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupManagersRecreateRequestResource, + that.getRegionInstanceGroupManagersRecreateRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +452,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersRecreateRequestResource, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersRecreateRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java index a39da3597e45..6e32b2270067 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private RouterBgp() { this.asn = null; } - - private RouterBgp( - Integer asn - ) { + private RouterBgp(Integer asn) { this.asn = asn; } @@ -72,22 +66,24 @@ public Integer getAsn() { return asn; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterBgp prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterBgp getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterBgp DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterBgp(); } @@ -118,11 +114,8 @@ public Builder setAsn(Integer asn) { return this; } - public RouterBgp build() { - return new RouterBgp( - asn - ); + return new RouterBgp(asn); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "RouterBgp{" - + "asn=" + asn - + "}"; + return "RouterBgp{" + "asn=" + asn + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof RouterBgp) { RouterBgp that = (RouterBgp) o; - return - Objects.equals(this.asn, that.getAsn()) - ; + return Objects.equals(this.asn, that.getAsn()); } return false; } @Override public int hashCode() { - return Objects.hash( - asn - ); + return Objects.hash(asn); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java index c8121c04348a..f6f7951f6409 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java @@ -21,13 +21,8 @@ import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @@ -37,7 +32,7 @@ public final class RouterName implements ResourceName { private final String region; private final String router; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}"); private volatile Map fieldValuesMap; @@ -55,29 +50,12 @@ private RouterName(Builder builder) { router = Preconditions.checkNotNull(builder.getRouter()); } - public static RouterName of( - String project, - String region, - String router - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setRouter(router) - .build(); + public static RouterName of(String project, String region, String router) { + return newBuilder().setProject(project).setRegion(region).setRouter(router).build(); } - public static String format( - String project, - String region, - String router - ) { - return of( - project, - region, - router - ) - .toString(); + public static String format(String project, String region, String router) { + return of(project, region, router).toString(); } public String getProject() { @@ -92,7 +70,6 @@ public String getRouter() { return router; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -113,21 +90,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public RouterName parse(String formattedString) {return RouterName.parse(formattedString);} + public RouterName parse(String formattedString) { + return RouterName.parse(formattedString); + } }; } public static RouterName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "RouterName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("router") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "RouterName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("router")); } public static boolean isParsableFrom(String formattedString) { @@ -142,9 +117,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getRouter() { return router; } @@ -153,10 +130,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setRouter(String router) { this.router = router; return this; @@ -164,7 +143,7 @@ public Builder setRouter(String router) { private Builder() {} - public Builder (RouterName routerName) { + public Builder(RouterName routerName) { project = routerName.project; region = routerName.region; router = routerName.router; @@ -180,8 +159,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "router", router - ); + "router", router); } @Override @@ -191,21 +169,15 @@ public boolean equals(Object o) { } if (o instanceof RouterName) { RouterName that = (RouterName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.router, that.getRouter()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.router, that.getRouter()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - router - ); + return Objects.hash(project, region, router); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java index 524c7faf89ab..2bc312927530 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private ServiceAccount() { this.scopes = null; } - - private ServiceAccount( - String email, - List scopes - ) { + private ServiceAccount(String email, List scopes) { this.email = email; this.scopes = scopes; } @@ -90,22 +85,24 @@ public List getScopesList() { return scopes; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ServiceAccount prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ServiceAccount getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ServiceAccount DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ServiceAccount(); } @@ -158,13 +155,9 @@ public Builder addScopes(String scopes) { return this; } - public ServiceAccount build() { - return new ServiceAccount( - email, - scopes - ); + return new ServiceAccount(email, scopes); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "ServiceAccount{" - + "email=" + email + ", " - + "scopes=" + scopes - + "}"; + return "ServiceAccount{" + "email=" + email + ", " + "scopes=" + scopes + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof ServiceAccount) { ServiceAccount that = (ServiceAccount) o; - return - Objects.equals(this.email, that.getEmail()) && - Objects.equals(this.scopes, that.getScopesList()) - ; + return Objects.equals(this.email, that.getEmail()) + && Objects.equals(this.scopes, that.getScopesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - email, - scopes - ); + return Objects.hash(email, scopes); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java index 2420e08328d7..4ec8f2304341 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetBackupTargetPoolHttpRequest() { this.userIp = null; } - private SetBackupTargetPoolHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetBackupTargetPoolHttpRequest( String quotaUser, String targetPool, TargetReference targetReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.failoverRatio = failoverRatio; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetBackupTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetBackupTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetBackupTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetBackupTargetPoolHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetBackupTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetBackupTargetPoolHttpRequest( - access_token, - callback, - failoverRatio, - fields, - key, - prettyPrint, - quotaUser, - targetPool, - targetReferenceResource, - userIp - ); + access_token, + callback, + failoverRatio, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetReferenceResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "SetBackupTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "failoverRatio=" + failoverRatio + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetPool=" + targetPool + ", " - + "targetReferenceResource=" + targetReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "failoverRatio=" + + failoverRatio + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetPool=" + + targetPool + + ", " + + "targetReferenceResource=" + + targetReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof SetBackupTargetPoolHttpRequest) { SetBackupTargetPoolHttpRequest that = (SetBackupTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.failoverRatio, that.getFailoverRatio()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.failoverRatio, that.getFailoverRatio()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - failoverRatio, - fields, - key, - prettyPrint, - quotaUser, - targetPool, - targetReferenceResource, - userIp - ); + access_token, + callback, + failoverRatio, + fields, + key, + prettyPrint, + quotaUser, + targetPool, + targetReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java index 78ab0319f2ac..152ddeff5d48 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private StartInstanceHttpRequest() { this.userIp = null; } - private StartInstanceHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private StartInstanceHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(StartInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static StartInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final StartInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new StartInstanceHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public StartInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new StartInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "StartInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof StartInstanceHttpRequest) { StartInstanceHttpRequest that = (StartInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java index e451012d2eeb..11e986d4774f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -46,14 +45,8 @@ private TargetHttpProxyList() { this.selfLink = null; } - private TargetHttpProxyList( - String id, - List items, - String kind, - String nextPageToken, - String selfLink - ) { + String id, List items, String kind, String nextPageToken, String selfLink) { this.id = id; this.items = items; this.kind = kind; @@ -132,22 +125,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpProxyList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpProxyList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpProxyList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpProxyList(); } @@ -242,19 +237,9 @@ public Builder setSelfLink(String selfLink) { return this; } - public TargetHttpProxyList build() { - - - - return new TargetHttpProxyList( - id, - items, - kind, - nextPageToken, - selfLink - ); + return new TargetHttpProxyList(id, items, kind, nextPageToken, selfLink); } public Builder clone() { @@ -271,11 +256,20 @@ public Builder clone() { @Override public String toString() { return "TargetHttpProxyList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -286,25 +280,17 @@ public boolean equals(Object o) { } if (o instanceof TargetHttpProxyList) { TargetHttpProxyList that = (TargetHttpProxyList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java index 0b05858e24c5..498d2a85d90c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetHttpsProxiesSetSslCertificatesRequest() { this.sslCertificates = null; } - - private TargetHttpsProxiesSetSslCertificatesRequest( - List sslCertificates - ) { + private TargetHttpsProxiesSetSslCertificatesRequest(List sslCertificates) { this.sslCertificates = sslCertificates; } @@ -76,22 +71,24 @@ public List getSslCertificatesList() { return sslCertificates; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpsProxiesSetSslCertificatesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpsProxiesSetSslCertificatesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpsProxiesSetSslCertificatesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpsProxiesSetSslCertificatesRequest(); } @@ -130,11 +127,8 @@ public Builder addSslCertificates(String sslCertificates) { return this; } - public TargetHttpsProxiesSetSslCertificatesRequest build() { - return new TargetHttpsProxiesSetSslCertificatesRequest( - sslCertificates - ); + return new TargetHttpsProxiesSetSslCertificatesRequest(sslCertificates); } public Builder clone() { @@ -147,7 +141,8 @@ public Builder clone() { @Override public String toString() { return "TargetHttpsProxiesSetSslCertificatesRequest{" - + "sslCertificates=" + sslCertificates + + "sslCertificates=" + + sslCertificates + "}"; } @@ -157,18 +152,15 @@ public boolean equals(Object o) { return true; } if (o instanceof TargetHttpsProxiesSetSslCertificatesRequest) { - TargetHttpsProxiesSetSslCertificatesRequest that = (TargetHttpsProxiesSetSslCertificatesRequest) o; - return - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) - ; + TargetHttpsProxiesSetSslCertificatesRequest that = + (TargetHttpsProxiesSetSslCertificatesRequest) o; + return Objects.equals(this.sslCertificates, that.getSslCertificatesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - sslCertificates - ); + return Objects.hash(sslCertificates); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java index 8a3cbb58a1f5..17d954396bbe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -52,7 +51,6 @@ private TargetHttpsProxy() { this.urlMap = null; } - private TargetHttpsProxy( String creationTimestamp, String description, @@ -61,8 +59,7 @@ private TargetHttpsProxy( String name, String selfLink, List sslCertificates, - String urlMap - ) { + String urlMap) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -77,7 +74,8 @@ private TargetHttpsProxy( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -174,22 +172,24 @@ public String getUrlMap() { return urlMap; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpsProxy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpsProxy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpsProxy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpsProxy(); } @@ -326,25 +326,10 @@ public Builder setUrlMap(String urlMap) { return this; } - public TargetHttpsProxy build() { - - - - - - return new TargetHttpsProxy( - creationTimestamp, - description, - id, - kind, - name, - selfLink, - sslCertificates, - urlMap - ); + creationTimestamp, description, id, kind, name, selfLink, sslCertificates, urlMap); } public Builder clone() { @@ -364,14 +349,29 @@ public Builder clone() { @Override public String toString() { return "TargetHttpsProxy{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + ", " - + "sslCertificates=" + sslCertificates + ", " - + "urlMap=" + urlMap + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "sslCertificates=" + + sslCertificates + + ", " + + "urlMap=" + + urlMap + "}"; } @@ -382,16 +382,14 @@ public boolean equals(Object o) { } if (o instanceof TargetHttpsProxy) { TargetHttpsProxy that = (TargetHttpsProxy) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) && - Objects.equals(this.urlMap, that.getUrlMap()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sslCertificates, that.getSslCertificatesList()) + && Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @@ -399,14 +397,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - selfLink, - sslCertificates, - urlMap - ); + creationTimestamp, description, id, kind, name, selfLink, sslCertificates, urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java index e3febccb9f3f..c9282e24fafa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private TargetReference() { this.target = null; } - - private TargetReference( - String target - ) { + private TargetReference(String target) { this.target = target; } @@ -72,22 +66,24 @@ public String getTarget() { return target; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetReference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetReference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetReference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetReference(); } @@ -118,11 +114,8 @@ public Builder setTarget(String target) { return this; } - public TargetReference build() { - return new TargetReference( - target - ); + return new TargetReference(target); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "TargetReference{" - + "target=" + target - + "}"; + return "TargetReference{" + "target=" + target + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof TargetReference) { TargetReference that = (TargetReference) o; - return - Objects.equals(this.target, that.getTarget()) - ; + return Objects.equals(this.target, that.getTarget()); } return false; } @Override public int hashCode() { - return Objects.hash( - target - ); + return Objects.hash(target); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java index bc7b55987ca2..c046122d154c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -54,7 +53,6 @@ private TargetSslProxy() { this.sslCertificates = null; } - private TargetSslProxy( String creationTimestamp, String description, @@ -64,8 +62,7 @@ private TargetSslProxy( String proxyHeader, String selfLink, String service, - List sslCertificates - ) { + List sslCertificates) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -81,7 +78,8 @@ private TargetSslProxy( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -188,22 +186,24 @@ public List getSslCertificatesList() { return sslCertificates; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetSslProxy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetSslProxy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetSslProxy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetSslProxy(); } @@ -354,27 +354,18 @@ public Builder addSslCertificates(String sslCertificates) { return this; } - public TargetSslProxy build() { - - - - - - - return new TargetSslProxy( - creationTimestamp, - description, - id, - kind, - name, - proxyHeader, - selfLink, - service, - sslCertificates - ); + creationTimestamp, + description, + id, + kind, + name, + proxyHeader, + selfLink, + service, + sslCertificates); } public Builder clone() { @@ -395,15 +386,32 @@ public Builder clone() { @Override public String toString() { return "TargetSslProxy{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "proxyHeader=" + proxyHeader + ", " - + "selfLink=" + selfLink + ", " - + "service=" + service + ", " - + "sslCertificates=" + sslCertificates + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "selfLink=" + + selfLink + + ", " + + "service=" + + service + + ", " + + "sslCertificates=" + + sslCertificates + "}"; } @@ -414,17 +422,15 @@ public boolean equals(Object o) { } if (o instanceof TargetSslProxy) { TargetSslProxy that = (TargetSslProxy) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.service, that.getService()) && - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.service, that.getService()) + && Objects.equals(this.sslCertificates, that.getSslCertificatesList()); } return false; } @@ -432,15 +438,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - proxyHeader, - selfLink, - service, - sslCertificates - ); + creationTimestamp, + description, + id, + kind, + name, + proxyHeader, + selfLink, + service, + sslCertificates); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java index a10c1f1ef8c1..4a5df169b842 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStub; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,34 @@ * *

* - *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetVpnGatewaySettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class TargetVpnGatewayClient implements BackgroundResource {
   private final TargetVpnGatewaySettings settings;
   private final TargetVpnGatewayStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetVpnGatewayClient with default settings.
-   */
+  /** Constructs an instance of TargetVpnGatewayClient with default settings. */
   public static final TargetVpnGatewayClient create() throws IOException {
     return create(TargetVpnGatewaySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetVpnGatewayClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings) throws IOException {
+  public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings)
+      throws IOException {
     return new TargetVpnGatewayClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetVpnGatewaySettings}.
+   * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use TargetVpnGatewaySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) {
@@ -143,9 +129,9 @@ public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetVpnGatewayClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetVpnGatewayClient(TargetVpnGatewaySettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public TargetVpnGatewayStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -186,11 +172,12 @@ public TargetVpnGatewayStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(ProjectName project) {
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
+      ProjectName project) {
     AggregatedListTargetVpnGatewaysHttpRequest request =
         AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListTargetVpnGateways(request);
   }
 
@@ -198,7 +185,8 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -212,11 +200,10 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(String project) {
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
+      String project) {
     AggregatedListTargetVpnGatewaysHttpRequest request =
-        AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListTargetVpnGatewaysHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListTargetVpnGateways(request);
   }
 
@@ -224,7 +211,8 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +229,17 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(AggregatedListTargetVpnGatewaysHttpRequest request) {
-    return aggregatedListTargetVpnGatewaysPagedCallable()
-        .call(request);
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
+      AggregatedListTargetVpnGatewaysHttpRequest request) {
+    return aggregatedListTargetVpnGatewaysPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +255,9 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { + public final UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysPagedCallable() { return stub.aggregatedListTargetVpnGatewaysPagedCallable(); } @@ -274,7 +265,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,7 +289,9 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListTargetVpnGatewaysCallable() { + public final UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList> + aggregatedListTargetVpnGatewaysCallable() { return stub.aggregatedListTargetVpnGatewaysCallable(); } @@ -305,7 +299,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -321,8 +316,8 @@ public final Operation deleteTargetVpnGateway(TargetVpnGatewayName targetVpnGate
 
     DeleteTargetVpnGatewayHttpRequest request =
         DeleteTargetVpnGatewayHttpRequest.newBuilder()
-        .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
-        .build();
+            .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
+            .build();
     return deleteTargetVpnGateway(request);
   }
 
@@ -330,7 +325,8 @@ public final Operation deleteTargetVpnGateway(TargetVpnGatewayName targetVpnGate
   /**
    * Deletes the specified target VPN gateway.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -346,8 +342,8 @@ public final Operation deleteTargetVpnGateway(String targetVpnGateway) {
 
     DeleteTargetVpnGatewayHttpRequest request =
         DeleteTargetVpnGatewayHttpRequest.newBuilder()
-        .setTargetVpnGateway(targetVpnGateway)
-        .build();
+            .setTargetVpnGateway(targetVpnGateway)
+            .build();
     return deleteTargetVpnGateway(request);
   }
 
@@ -355,7 +351,8 @@ public final Operation deleteTargetVpnGateway(String targetVpnGateway) {
   /**
    * Deletes the specified target VPN gateway.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -378,7 +375,8 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
   /**
    * Deletes the specified target VPN gateway.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -392,15 +390,18 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetVpnGatewayCallable() { + public final UnaryCallable + deleteTargetVpnGatewayCallable() { return stub.deleteTargetVpnGatewayCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making + * a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -416,16 +417,18 @@ public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpn
 
     GetTargetVpnGatewayHttpRequest request =
         GetTargetVpnGatewayHttpRequest.newBuilder()
-        .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
-        .build();
+            .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
+            .build();
     return getTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
+   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -440,17 +443,17 @@ public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpn
   public final TargetVpnGateway getTargetVpnGateway(String targetVpnGateway) {
 
     GetTargetVpnGatewayHttpRequest request =
-        GetTargetVpnGatewayHttpRequest.newBuilder()
-        .setTargetVpnGateway(targetVpnGateway)
-        .build();
+        GetTargetVpnGatewayHttpRequest.newBuilder().setTargetVpnGateway(targetVpnGateway).build();
     return getTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
+   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -471,9 +474,11 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
+   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -487,15 +492,18 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable getTargetVpnGatewayCallable() { + public final UnaryCallable + getTargetVpnGatewayCallable() { return stub.getTargetVpnGatewayCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the request. + * Creates a target VPN gateway in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -509,21 +517,24 @@ public final UnaryCallable get
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertTargetVpnGateway(RegionName region, TargetVpnGateway targetVpnGatewayResource) {
+  public final Operation insertTargetVpnGateway(
+      RegionName region, TargetVpnGateway targetVpnGatewayResource) {
 
     InsertTargetVpnGatewayHttpRequest request =
         InsertTargetVpnGatewayHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .setTargetVpnGatewayResource(targetVpnGatewayResource)
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .setTargetVpnGatewayResource(targetVpnGatewayResource)
+            .build();
     return insertTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a target VPN gateway in the specified project and region using the data included in the request.
+   * Creates a target VPN gateway in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -537,21 +548,24 @@ public final Operation insertTargetVpnGateway(RegionName region, TargetVpnGatewa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertTargetVpnGateway(String region, TargetVpnGateway targetVpnGatewayResource) {
+  public final Operation insertTargetVpnGateway(
+      String region, TargetVpnGateway targetVpnGatewayResource) {
 
     InsertTargetVpnGatewayHttpRequest request =
         InsertTargetVpnGatewayHttpRequest.newBuilder()
-        .setRegion(region)
-        .setTargetVpnGatewayResource(targetVpnGatewayResource)
-        .build();
+            .setRegion(region)
+            .setTargetVpnGatewayResource(targetVpnGatewayResource)
+            .build();
     return insertTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a target VPN gateway in the specified project and region using the data included in the request.
+   * Creates a target VPN gateway in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -574,9 +588,11 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a target VPN gateway in the specified project and region using the data included in the request.
+   * Creates a target VPN gateway in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -592,7 +608,8 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertTargetVpnGatewayCallable() { + public final UnaryCallable + insertTargetVpnGatewayCallable() { return stub.insertTargetVpnGatewayCallable(); } @@ -600,7 +617,8 @@ public final UnaryCallable insertT /** * Retrieves a list of target VPN gateways available to the specified project and region. * - * Sample code: + *

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -617,8 +635,8 @@ public final UnaryCallable insertT
   public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName region) {
     ListTargetVpnGatewaysHttpRequest request =
         ListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listTargetVpnGateways(request);
   }
 
@@ -626,7 +644,8 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -642,9 +661,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName
   @BetaApi
   public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String region) {
     ListTargetVpnGatewaysHttpRequest request =
-        ListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListTargetVpnGatewaysHttpRequest.newBuilder().setRegion(region).build();
     return listTargetVpnGateways(request);
   }
 
@@ -652,7 +669,8 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -669,16 +687,17 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTargetVpnGatewaysHttpRequest request) {
-    return listTargetVpnGatewaysPagedCallable()
-        .call(request);
+  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(
+      ListTargetVpnGatewaysHttpRequest request) {
+    return listTargetVpnGatewaysPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -694,7 +713,8 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTarget
    * 
*/ @BetaApi - public final UnaryCallable listTargetVpnGatewaysPagedCallable() { + public final UnaryCallable + listTargetVpnGatewaysPagedCallable() { return stub.listTargetVpnGatewaysPagedCallable(); } @@ -702,7 +722,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -725,7 +746,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetVpnGatewaysCallable() { + public final UnaryCallable + listTargetVpnGatewaysCallable() { return stub.listTargetVpnGatewaysCallable(); } @@ -759,23 +781,31 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage, - AggregatedListTargetVpnGatewaysFixedSizeCollection> { + public static class AggregatedListTargetVpnGatewaysPagedResponse + extends AbstractPagedListResponse< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListTargetVpnGatewaysPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListTargetVpnGatewaysPage, AggregatedListTargetVpnGatewaysPagedResponse>() { @Override - public AggregatedListTargetVpnGatewaysPagedResponse apply(AggregatedListTargetVpnGatewaysPage input) { + public AggregatedListTargetVpnGatewaysPagedResponse apply( + AggregatedListTargetVpnGatewaysPage input) { return new AggregatedListTargetVpnGatewaysPagedResponse(input); } }); @@ -784,18 +814,21 @@ public AggregatedListTargetVpnGatewaysPagedResponse apply(AggregatedListTargetVp private AggregatedListTargetVpnGatewaysPagedResponse(AggregatedListTargetVpnGatewaysPage page) { super(page, AggregatedListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListTargetVpnGatewaysPage extends AbstractPage< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage> { + public static class AggregatedListTargetVpnGatewaysPage + extends AbstractPage< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage> { private AggregatedListTargetVpnGatewaysPage( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, TargetVpnGatewayAggregatedList response) { super(context, response); } @@ -806,31 +839,37 @@ private static AggregatedListTargetVpnGatewaysPage createEmptyPage() { @Override protected AggregatedListTargetVpnGatewaysPage createPage( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, TargetVpnGatewayAggregatedList response) { return new AggregatedListTargetVpnGatewaysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage, - AggregatedListTargetVpnGatewaysFixedSizeCollection> { + public static class AggregatedListTargetVpnGatewaysFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { - private AggregatedListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListTargetVpnGatewaysFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -843,18 +882,19 @@ protected AggregatedListTargetVpnGatewaysFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); } - - } - public static class ListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage, - ListTargetVpnGatewaysFixedSizeCollection> { + + public static class ListTargetVpnGatewaysPagedResponse + extends AbstractPagedListResponse< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage, + ListTargetVpnGatewaysFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -871,18 +911,18 @@ public ListTargetVpnGatewaysPagedResponse apply(ListTargetVpnGatewaysPage input) private ListTargetVpnGatewaysPagedResponse(ListTargetVpnGatewaysPage page) { super(page, ListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetVpnGatewaysPage extends AbstractPage< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage> { + public static class ListTargetVpnGatewaysPage + extends AbstractPage< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage> { private ListTargetVpnGatewaysPage( - PageContext context, + PageContext + context, TargetVpnGatewayList response) { super(context, response); } @@ -893,31 +933,31 @@ private static ListTargetVpnGatewaysPage createEmptyPage() { @Override protected ListTargetVpnGatewaysPage createPage( - PageContext context, + PageContext + context, TargetVpnGatewayList response) { return new ListTargetVpnGatewaysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage, - ListTargetVpnGatewaysFixedSizeCollection> { + public static class ListTargetVpnGatewaysFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage, + ListTargetVpnGatewaysFixedSizeCollection> { - private ListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { + private ListTargetVpnGatewaysFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -930,7 +970,5 @@ protected ListTargetVpnGatewaysFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index 13756014148e..974cfb8f187d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateRegionAutoscalerHttpRequest() { this.userIp = null; } - private UpdateRegionAutoscalerHttpRequest( String access_token, String autoscaler, @@ -67,8 +63,7 @@ private UpdateRegionAutoscalerHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; @@ -91,7 +86,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateRegionAutoscalerHttpRequest(); } @@ -370,17 +368,9 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateRegionAutoscalerHttpRequest build() { String missing = ""; - - - - - - - if (region == null) { missing += " region"; } @@ -389,17 +379,16 @@ public UpdateRegionAutoscalerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRegionAutoscalerHttpRequest( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "UpdateRegionAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateRegionAutoscalerHttpRequest) { UpdateRegionAutoscalerHttpRequest that = (UpdateRegionAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java index 2af65b332d4f..54eac934b2bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private UrlMapReference() { this.urlMap = null; } - - private UrlMapReference( - String urlMap - ) { + private UrlMapReference(String urlMap) { this.urlMap = urlMap; } @@ -72,22 +66,24 @@ public String getUrlMap() { return urlMap; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapReference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapReference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapReference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapReference(); } @@ -118,11 +114,8 @@ public Builder setUrlMap(String urlMap) { return this; } - public UrlMapReference build() { - return new UrlMapReference( - urlMap - ); + return new UrlMapReference(urlMap); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "UrlMapReference{" - + "urlMap=" + urlMap - + "}"; + return "UrlMapReference{" + "urlMap=" + urlMap + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof UrlMapReference) { UrlMapReference that = (UrlMapReference) o; - return - Objects.equals(this.urlMap, that.getUrlMap()) - ; + return Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - urlMap - ); + return Objects.hash(urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java index e434b2bf9a68..6c9cee06b282 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,13 +41,7 @@ private UrlMapTest() { this.service = null; } - - private UrlMapTest( - String description, - String host, - String path, - String service - ) { + private UrlMapTest(String description, String host, String path, String service) { this.description = description; this.host = host; this.path = path; @@ -114,22 +105,24 @@ public String getService() { return service; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapTest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapTest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapTest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapTest(); } @@ -202,17 +195,9 @@ public Builder setService(String service) { return this; } - public UrlMapTest build() { - - - return new UrlMapTest( - description, - host, - path, - service - ); + return new UrlMapTest(description, host, path, service); } public Builder clone() { @@ -228,10 +213,17 @@ public Builder clone() { @Override public String toString() { return "UrlMapTest{" - + "description=" + description + ", " - + "host=" + host + ", " - + "path=" + path + ", " - + "service=" + service + + "description=" + + description + + ", " + + "host=" + + host + + ", " + + "path=" + + path + + ", " + + "service=" + + service + "}"; } @@ -242,23 +234,16 @@ public boolean equals(Object o) { } if (o instanceof UrlMapTest) { UrlMapTest that = (UrlMapTest) o; - return - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.path, that.getPath()) && - Objects.equals(this.service, that.getService()) - ; + return Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.path, that.getPath()) + && Objects.equals(this.service, that.getService()); } return false; } @Override public int hashCode() { - return Objects.hash( - description, - host, - path, - service - ); + return Objects.hash(description, host, path, service); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index babb6ecd1270..e838748d42b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; @@ -34,27 +36,17 @@ import com.google.cloud.compute.v1.DeleteDiskHttpRequest; import com.google.cloud.compute.v1.Disk; import com.google.cloud.compute.v1.DiskAggregatedList; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.DiskList; import com.google.cloud.compute.v1.DiskName; -import com.google.cloud.compute.v1.DiskSettings; -import com.google.cloud.compute.v1.DisksResizeRequest; -import com.google.cloud.compute.v1.DisksScopedList; import com.google.cloud.compute.v1.GetDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; -import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.ZoneName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -68,63 +60,67 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonDiskStub extends DiskStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListDisksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + aggregatedListDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor createSnapshotDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.createSnapshot") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(DiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + createSnapshotDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.createSnapshot") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(DiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getDiskMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -134,8 +130,7 @@ public class HttpJsonDiskStub extends DiskStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) - .setQueryParams(Sets.newHashSet( - )) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(DiskName.newFactory()) .setResourceNameField("disk") .build()) @@ -144,69 +139,75 @@ public class HttpJsonDiskStub extends DiskStub { .setResponseInstance(Disk.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor insertDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) - .setQueryParams(Sets.newHashSet( - "sourceImage" - )) - .setResourceNameFactory(ZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams(Sets.newHashSet("sourceImage")) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listDisksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor resizeDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.resize") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(DiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + resizeDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListDisksCallable; - private final UnaryCallable aggregatedListDisksPagedCallable; + private final UnaryCallable + aggregatedListDisksCallable; + private final UnaryCallable + aggregatedListDisksPagedCallable; private final UnaryCallable createSnapshotDiskCallable; private final UnaryCallable deleteDiskCallable; private final UnaryCallable getDiskCallable; @@ -216,6 +217,7 @@ public class HttpJsonDiskStub extends DiskStub { private final UnaryCallable resizeDiskCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonDiskStub create(DiskStubSettings settings) throws IOException { return new HttpJsonDiskStub(settings, ClientContext.create(settings)); } @@ -224,35 +226,42 @@ public static final HttpJsonDiskStub create(ClientContext clientContext) throws return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonDiskStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonDiskStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDiskStub( + DiskStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonDiskStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonDiskStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. */ - protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonDiskCallableFactory()); } /** - * Constructs an instance of HttpJsonDiskStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonDiskStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. */ - protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonDiskStub( + DiskStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListDisksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListDisksMethodDescriptor) - .build(); - HttpJsonCallSettings createSnapshotDiskTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSnapshotDiskMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListDisksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListDisksMethodDescriptor) + .build(); + HttpJsonCallSettings + createSnapshotDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotDiskMethodDescriptor) + .build(); HttpJsonCallSettings deleteDiskTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteDiskMethodDescriptor) @@ -274,26 +283,52 @@ protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContex .setMethodDescriptor(resizeDiskMethodDescriptor) .build(); - this.aggregatedListDisksCallable = callableFactory.createUnaryCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); - this.aggregatedListDisksPagedCallable = callableFactory.createPagedCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); - this.createSnapshotDiskCallable = callableFactory.createUnaryCallable(createSnapshotDiskTransportSettings,settings.createSnapshotDiskSettings(), clientContext); - this.deleteDiskCallable = callableFactory.createUnaryCallable(deleteDiskTransportSettings,settings.deleteDiskSettings(), clientContext); - this.getDiskCallable = callableFactory.createUnaryCallable(getDiskTransportSettings,settings.getDiskSettings(), clientContext); - this.insertDiskCallable = callableFactory.createUnaryCallable(insertDiskTransportSettings,settings.insertDiskSettings(), clientContext); - this.listDisksCallable = callableFactory.createUnaryCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); - this.listDisksPagedCallable = callableFactory.createPagedCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); - this.resizeDiskCallable = callableFactory.createUnaryCallable(resizeDiskTransportSettings,settings.resizeDiskSettings(), clientContext); + this.aggregatedListDisksCallable = + callableFactory.createUnaryCallable( + aggregatedListDisksTransportSettings, + settings.aggregatedListDisksSettings(), + clientContext); + this.aggregatedListDisksPagedCallable = + callableFactory.createPagedCallable( + aggregatedListDisksTransportSettings, + settings.aggregatedListDisksSettings(), + clientContext); + this.createSnapshotDiskCallable = + callableFactory.createUnaryCallable( + createSnapshotDiskTransportSettings, + settings.createSnapshotDiskSettings(), + clientContext); + this.deleteDiskCallable = + callableFactory.createUnaryCallable( + deleteDiskTransportSettings, settings.deleteDiskSettings(), clientContext); + this.getDiskCallable = + callableFactory.createUnaryCallable( + getDiskTransportSettings, settings.getDiskSettings(), clientContext); + this.insertDiskCallable = + callableFactory.createUnaryCallable( + insertDiskTransportSettings, settings.insertDiskSettings(), clientContext); + this.listDisksCallable = + callableFactory.createUnaryCallable( + listDisksTransportSettings, settings.listDisksSettings(), clientContext); + this.listDisksPagedCallable = + callableFactory.createPagedCallable( + listDisksTransportSettings, settings.listDisksSettings(), clientContext); + this.resizeDiskCallable = + callableFactory.createUnaryCallable( + resizeDiskTransportSettings, settings.resizeDiskSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListDisksPagedCallable() { + public UnaryCallable + aggregatedListDisksPagedCallable() { return aggregatedListDisksPagedCallable; } @BetaApi - public UnaryCallable aggregatedListDisksCallable() { + public UnaryCallable + aggregatedListDisksCallable() { return aggregatedListDisksCallable; } @@ -361,5 +396,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java index 0b8932b4676b..237db578a029 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.BackendService; -import com.google.cloud.compute.v1.BackendServiceGroupHealth; -import com.google.cloud.compute.v1.BackendServiceList; -import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; -import com.google.cloud.compute.v1.RegionBackendServiceSettings; -import com.google.cloud.compute.v1.RegionName; -import com.google.cloud.compute.v1.ResourceGroupReference; -import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java index ce7ecaa68e00..3c7b493c70f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java @@ -15,47 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetRegionHttpRequest; -import com.google.cloud.compute.v1.ListRegionsHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.Region; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; -import com.google.cloud.compute.v1.RegionList; -import com.google.cloud.compute.v1.RegionName; -import com.google.cloud.compute.v1.RegionSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -89,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index b5c01ec516ff..0c6bcf30299a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; @@ -38,20 +39,11 @@ import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; import com.google.cloud.compute.v1.TargetSslProxy; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; import com.google.cloud.compute.v1.TargetSslProxyList; import com.google.cloud.compute.v1.TargetSslProxyName; -import com.google.cloud.compute.v1.TargetSslProxySettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -65,217 +57,297 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { @InternalApi - public static final ApiMethodDescriptor deleteTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetSslProxy.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetSslProxiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetSslProxyList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetSslProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setBackendServiceTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setBackendService") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setBackendServiceTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setBackendService") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setProxyHeaderTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setProxyHeader") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setProxyHeaderTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setProxyHeader") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setSslCertificatesTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setSslCertificates") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setSslCertificatesTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setSslCertificates") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteTargetSslProxyCallable; - private final UnaryCallable getTargetSslProxyCallable; - private final UnaryCallable insertTargetSslProxyCallable; - private final UnaryCallable listTargetSslProxiesCallable; - private final UnaryCallable listTargetSslProxiesPagedCallable; - private final UnaryCallable setBackendServiceTargetSslProxyCallable; - private final UnaryCallable setProxyHeaderTargetSslProxyCallable; - private final UnaryCallable setSslCertificatesTargetSslProxyCallable; + private final UnaryCallable + deleteTargetSslProxyCallable; + private final UnaryCallable + getTargetSslProxyCallable; + private final UnaryCallable + insertTargetSslProxyCallable; + private final UnaryCallable + listTargetSslProxiesCallable; + private final UnaryCallable + listTargetSslProxiesPagedCallable; + private final UnaryCallable + setBackendServiceTargetSslProxyCallable; + private final UnaryCallable + setProxyHeaderTargetSslProxyCallable; + private final UnaryCallable + setSslCertificatesTargetSslProxyCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) throws IOException { + + public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) + throws IOException { return new HttpJsonTargetSslProxyStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetSslProxyStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetSslProxyCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetSslProxiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) - .build(); - HttpJsonCallSettings setBackendServiceTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings setProxyHeaderTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings setSslCertificatesTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) - .build(); - - this.deleteTargetSslProxyCallable = callableFactory.createUnaryCallable(deleteTargetSslProxyTransportSettings,settings.deleteTargetSslProxySettings(), clientContext); - this.getTargetSslProxyCallable = callableFactory.createUnaryCallable(getTargetSslProxyTransportSettings,settings.getTargetSslProxySettings(), clientContext); - this.insertTargetSslProxyCallable = callableFactory.createUnaryCallable(insertTargetSslProxyTransportSettings,settings.insertTargetSslProxySettings(), clientContext); - this.listTargetSslProxiesCallable = callableFactory.createUnaryCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); - this.listTargetSslProxiesPagedCallable = callableFactory.createPagedCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); - this.setBackendServiceTargetSslProxyCallable = callableFactory.createUnaryCallable(setBackendServiceTargetSslProxyTransportSettings,settings.setBackendServiceTargetSslProxySettings(), clientContext); - this.setProxyHeaderTargetSslProxyCallable = callableFactory.createUnaryCallable(setProxyHeaderTargetSslProxyTransportSettings,settings.setProxyHeaderTargetSslProxySettings(), clientContext); - this.setSslCertificatesTargetSslProxyCallable = callableFactory.createUnaryCallable(setSslCertificatesTargetSslProxyTransportSettings,settings.setSslCertificatesTargetSslProxySettings(), clientContext); + HttpJsonCallSettings + deleteTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetSslProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings + setBackendServiceTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setProxyHeaderTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setSslCertificatesTargetSslProxyTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) + .build(); + + this.deleteTargetSslProxyCallable = + callableFactory.createUnaryCallable( + deleteTargetSslProxyTransportSettings, + settings.deleteTargetSslProxySettings(), + clientContext); + this.getTargetSslProxyCallable = + callableFactory.createUnaryCallable( + getTargetSslProxyTransportSettings, + settings.getTargetSslProxySettings(), + clientContext); + this.insertTargetSslProxyCallable = + callableFactory.createUnaryCallable( + insertTargetSslProxyTransportSettings, + settings.insertTargetSslProxySettings(), + clientContext); + this.listTargetSslProxiesCallable = + callableFactory.createUnaryCallable( + listTargetSslProxiesTransportSettings, + settings.listTargetSslProxiesSettings(), + clientContext); + this.listTargetSslProxiesPagedCallable = + callableFactory.createPagedCallable( + listTargetSslProxiesTransportSettings, + settings.listTargetSslProxiesSettings(), + clientContext); + this.setBackendServiceTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setBackendServiceTargetSslProxyTransportSettings, + settings.setBackendServiceTargetSslProxySettings(), + clientContext); + this.setProxyHeaderTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setProxyHeaderTargetSslProxyTransportSettings, + settings.setProxyHeaderTargetSslProxySettings(), + clientContext); + this.setSslCertificatesTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setSslCertificatesTargetSslProxyTransportSettings, + settings.setSslCertificatesTargetSslProxySettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -296,27 +368,32 @@ public UnaryCallable insertTargetSsl } @BetaApi - public UnaryCallable listTargetSslProxiesPagedCallable() { + public UnaryCallable + listTargetSslProxiesPagedCallable() { return listTargetSslProxiesPagedCallable; } @BetaApi - public UnaryCallable listTargetSslProxiesCallable() { + public UnaryCallable + listTargetSslProxiesCallable() { return listTargetSslProxiesCallable; } @BetaApi - public UnaryCallable setBackendServiceTargetSslProxyCallable() { + public UnaryCallable + setBackendServiceTargetSslProxyCallable() { return setBackendServiceTargetSslProxyCallable; } @BetaApi - public UnaryCallable setProxyHeaderTargetSslProxyCallable() { + public UnaryCallable + setProxyHeaderTargetSslProxyCallable() { return setProxyHeaderTargetSslProxyCallable; } @BetaApi - public UnaryCallable setSslCertificatesTargetSslProxyCallable() { + public UnaryCallable + setSslCertificatesTargetSslProxyCallable() { return setSslCertificatesTargetSslProxyCallable; } @@ -349,5 +426,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index 92021ea219af..0289f799924c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,10 +28,8 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.CacheInvalidationRule; import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; import com.google.cloud.compute.v1.GetUrlMapHttpRequest; import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; @@ -40,19 +40,12 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; import com.google.cloud.compute.v1.UrlMap; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; import com.google.cloud.compute.v1.UrlMapList; import com.google.cloud.compute.v1.UrlMapName; -import com.google.cloud.compute.v1.UrlMapSettings; -import com.google.cloud.compute.v1.UrlMapsValidateRequest; import com.google.cloud.compute.v1.UrlMapsValidateResponse; import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -66,24 +59,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonUrlMapStub extends UrlMapStub { @InternalApi - public static final ApiMethodDescriptor deleteUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getUrlMapMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -93,8 +87,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - )) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(UrlMapName.newFactory()) .setResourceNameField("urlMap") .build()) @@ -103,134 +96,147 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setResponseInstance(UrlMap.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor insertUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor invalidateCacheUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.invalidateCache") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + invalidateCacheUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.invalidateCache") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listUrlMapsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(UrlMapList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listUrlMapsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor validateUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.validate") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + validateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.validate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteUrlMapCallable; private final UnaryCallable getUrlMapCallable; private final UnaryCallable insertUrlMapCallable; - private final UnaryCallable invalidateCacheUrlMapCallable; + private final UnaryCallable + invalidateCacheUrlMapCallable; private final UnaryCallable listUrlMapsCallable; - private final UnaryCallable listUrlMapsPagedCallable; + private final UnaryCallable + listUrlMapsPagedCallable; private final UnaryCallable patchUrlMapCallable; private final UnaryCallable updateUrlMapCallable; - private final UnaryCallable validateUrlMapCallable; + private final UnaryCallable + validateUrlMapCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonUrlMapStub create(UrlMapStubSettings settings) throws IOException { return new HttpJsonUrlMapStub(settings, ClientContext.create(settings)); } @@ -239,25 +245,32 @@ public static final HttpJsonUrlMapStub create(ClientContext clientContext) throw return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonUrlMapStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonUrlMapStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonUrlMapStub( + UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonUrlMapStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonUrlMapCallableFactory()); } /** - * Constructs an instance of HttpJsonUrlMapStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonUrlMapStub( + UrlMapStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteUrlMapTransportSettings = @@ -272,10 +285,11 @@ protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientCo HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertUrlMapMethodDescriptor) .build(); - HttpJsonCallSettings invalidateCacheUrlMapTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) - .build(); + HttpJsonCallSettings + invalidateCacheUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) + .build(); HttpJsonCallSettings listUrlMapsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listUrlMapsMethodDescriptor) @@ -288,20 +302,41 @@ protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientCo HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateUrlMapMethodDescriptor) .build(); - HttpJsonCallSettings validateUrlMapTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(validateUrlMapMethodDescriptor) - .build(); + HttpJsonCallSettings + validateUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(validateUrlMapMethodDescriptor) + .build(); - this.deleteUrlMapCallable = callableFactory.createUnaryCallable(deleteUrlMapTransportSettings,settings.deleteUrlMapSettings(), clientContext); - this.getUrlMapCallable = callableFactory.createUnaryCallable(getUrlMapTransportSettings,settings.getUrlMapSettings(), clientContext); - this.insertUrlMapCallable = callableFactory.createUnaryCallable(insertUrlMapTransportSettings,settings.insertUrlMapSettings(), clientContext); - this.invalidateCacheUrlMapCallable = callableFactory.createUnaryCallable(invalidateCacheUrlMapTransportSettings,settings.invalidateCacheUrlMapSettings(), clientContext); - this.listUrlMapsCallable = callableFactory.createUnaryCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); - this.listUrlMapsPagedCallable = callableFactory.createPagedCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); - this.patchUrlMapCallable = callableFactory.createUnaryCallable(patchUrlMapTransportSettings,settings.patchUrlMapSettings(), clientContext); - this.updateUrlMapCallable = callableFactory.createUnaryCallable(updateUrlMapTransportSettings,settings.updateUrlMapSettings(), clientContext); - this.validateUrlMapCallable = callableFactory.createUnaryCallable(validateUrlMapTransportSettings,settings.validateUrlMapSettings(), clientContext); + this.deleteUrlMapCallable = + callableFactory.createUnaryCallable( + deleteUrlMapTransportSettings, settings.deleteUrlMapSettings(), clientContext); + this.getUrlMapCallable = + callableFactory.createUnaryCallable( + getUrlMapTransportSettings, settings.getUrlMapSettings(), clientContext); + this.insertUrlMapCallable = + callableFactory.createUnaryCallable( + insertUrlMapTransportSettings, settings.insertUrlMapSettings(), clientContext); + this.invalidateCacheUrlMapCallable = + callableFactory.createUnaryCallable( + invalidateCacheUrlMapTransportSettings, + settings.invalidateCacheUrlMapSettings(), + clientContext); + this.listUrlMapsCallable = + callableFactory.createUnaryCallable( + listUrlMapsTransportSettings, settings.listUrlMapsSettings(), clientContext); + this.listUrlMapsPagedCallable = + callableFactory.createPagedCallable( + listUrlMapsTransportSettings, settings.listUrlMapsSettings(), clientContext); + this.patchUrlMapCallable = + callableFactory.createUnaryCallable( + patchUrlMapTransportSettings, settings.patchUrlMapSettings(), clientContext); + this.updateUrlMapCallable = + callableFactory.createUnaryCallable( + updateUrlMapTransportSettings, settings.updateUrlMapSettings(), clientContext); + this.validateUrlMapCallable = + callableFactory.createUnaryCallable( + validateUrlMapTransportSettings, settings.validateUrlMapSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -322,12 +357,14 @@ public UnaryCallable insertUrlMapCallable() } @BetaApi - public UnaryCallable invalidateCacheUrlMapCallable() { + public UnaryCallable + invalidateCacheUrlMapCallable() { return invalidateCacheUrlMapCallable; } @BetaApi - public UnaryCallable listUrlMapsPagedCallable() { + public UnaryCallable + listUrlMapsPagedCallable() { return listUrlMapsPagedCallable; } @@ -347,7 +384,8 @@ public UnaryCallable updateUrlMapCallable() } @BetaApi - public UnaryCallable validateUrlMapCallable() { + public UnaryCallable + validateUrlMapCallable() { return validateUrlMapCallable; } @@ -380,5 +418,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index ab60bba1ebd6..b33901fdfc9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -15,20 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpsHealthCheck; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpsHealthCheckList; -import com.google.cloud.compute.v1.HttpsHealthCheckName; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; import javax.annotation.Generated; @@ -42,40 +41,46 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HttpsHealthCheckStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteHttpsHealthCheckCallable() { + public UnaryCallable + deleteHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: deleteHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable getHttpsHealthCheckCallable() { + public UnaryCallable + getHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable insertHttpsHealthCheckCallable() { + public UnaryCallable + insertHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: insertHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable listHttpsHealthChecksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksPagedCallable()"); + public UnaryCallable + listHttpsHealthChecksPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listHttpsHealthChecksPagedCallable()"); } @BetaApi - public UnaryCallable listHttpsHealthChecksCallable() { + public UnaryCallable + listHttpsHealthChecksCallable() { throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksCallable()"); } @BetaApi - public UnaryCallable patchHttpsHealthCheckCallable() { + public UnaryCallable + patchHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: patchHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable updateHttpsHealthCheckCallable() { + public UnaryCallable + updateHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: updateHttpsHealthCheckCallable()"); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java index 4aed85c0d86f..51545db1b581 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,13 +39,11 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; import com.google.cloud.compute.v1.Image; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteImage to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteImage to 30 seconds: * *

  * 
@@ -93,68 +87,56 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ImageStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteImageSettings;
   private final UnaryCallSettings deprecateImageSettings;
   private final UnaryCallSettings getImageSettings;
   private final UnaryCallSettings getFromFamilyImageSettings;
   private final UnaryCallSettings insertImageSettings;
-  private final PagedCallSettings listImagesSettings;
+  private final PagedCallSettings
+      listImagesSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteImage.
-   */
+  /** Returns the object with the settings used for calls to deleteImage. */
   public UnaryCallSettings deleteImageSettings() {
     return deleteImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deprecateImage.
-   */
+  /** Returns the object with the settings used for calls to deprecateImage. */
   public UnaryCallSettings deprecateImageSettings() {
     return deprecateImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getImage.
-   */
+  /** Returns the object with the settings used for calls to getImage. */
   public UnaryCallSettings getImageSettings() {
     return getImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getFromFamilyImage.
-   */
+  /** Returns the object with the settings used for calls to getFromFamilyImage. */
   public UnaryCallSettings getFromFamilyImageSettings() {
     return getFromFamilyImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertImage.
-   */
+  /** Returns the object with the settings used for calls to insertImage. */
   public UnaryCallSettings insertImageSettings() {
     return insertImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listImages.
-   */
-  public PagedCallSettings listImagesSettings() {
+  /** Returns the object with the settings used for calls to listImages. */
+  public PagedCallSettings
+      listImagesSettings() {
     return listImagesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ImageStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +149,34 @@ public ImageStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -219,26 +188,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ImageStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +219,85 @@ protected ImageStubSettings(Builder settingsBuilder) throws IOException {
     listImagesSettings = settingsBuilder.listImagesSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_IMAGES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) {
-          return ListImagesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListImagesHttpRequest injectPageSize(ListImagesHttpRequest payload, int pageSize) {
-          return ListImagesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListImagesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ImageList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ImageList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_IMAGES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListImagesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context);
-          return ListImagesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for ImageStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_IMAGES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) {
+              return ListImagesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListImagesHttpRequest injectPageSize(
+                ListImagesHttpRequest payload, int pageSize) {
+              return ListImagesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListImagesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ImageList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(ImageList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListImagesHttpRequest, ImageList, ListImagesPagedResponse>
+      LIST_IMAGES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListImagesHttpRequest, ImageList, ListImagesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListImagesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context);
+              return ListImagesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for ImageStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder deleteImageSettings;
-    private final UnaryCallSettings.Builder deprecateImageSettings;
+    private final UnaryCallSettings.Builder
+        deprecateImageSettings;
     private final UnaryCallSettings.Builder getImageSettings;
-    private final UnaryCallSettings.Builder getFromFamilyImageSettings;
+    private final UnaryCallSettings.Builder
+        getFromFamilyImageSettings;
     private final UnaryCallSettings.Builder insertImageSettings;
-    private final PagedCallSettings.Builder listImagesSettings;
+    private final PagedCallSettings.Builder<
+            ListImagesHttpRequest, ImageList, ListImagesPagedResponse>
+        listImagesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +306,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -364,17 +337,16 @@ protected Builder(ClientContext clientContext) {
 
       insertImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listImagesSettings = PagedCallSettings.newBuilder(
-          LIST_IMAGES_PAGE_STR_FACT);
+      listImagesSettings = PagedCallSettings.newBuilder(LIST_IMAGES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteImageSettings,
-          deprecateImageSettings,
-          getImageSettings,
-          getFromFamilyImageSettings,
-          insertImageSettings,
-          listImagesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteImageSettings,
+              deprecateImageSettings,
+              getImageSettings,
+              getFromFamilyImageSettings,
+              insertImageSettings,
+              listImagesSettings);
 
       initDefaults(this);
     }
@@ -390,27 +362,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteImageSettings()
+      builder
+          .deleteImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deprecateImageSettings()
+      builder
+          .deprecateImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getImageSettings()
+      builder
+          .getImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getFromFamilyImageSettings()
+      builder
+          .getFromFamilyImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertImageSettings()
+      builder
+          .insertImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listImagesSettings()
+      builder
+          .listImagesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +405,23 @@ protected Builder(ImageStubSettings settings) {
       insertImageSettings = settings.insertImageSettings.toBuilder();
       listImagesSettings = settings.listImagesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteImageSettings,
-          deprecateImageSettings,
-          getImageSettings,
-          getFromFamilyImageSettings,
-          insertImageSettings,
-          listImagesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteImageSettings,
+              deprecateImageSettings,
+              getImageSettings,
+              getFromFamilyImageSettings,
+              insertImageSettings,
+              listImagesSettings);
     }
 
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +430,36 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteImageSettings() { return deleteImageSettings; } - /** - * Returns the builder for the settings used for calls to deprecateImage. - */ - public UnaryCallSettings.Builder deprecateImageSettings() { + /** Returns the builder for the settings used for calls to deprecateImage. */ + public UnaryCallSettings.Builder + deprecateImageSettings() { return deprecateImageSettings; } - /** - * Returns the builder for the settings used for calls to getImage. - */ + /** Returns the builder for the settings used for calls to getImage. */ public UnaryCallSettings.Builder getImageSettings() { return getImageSettings; } - /** - * Returns the builder for the settings used for calls to getFromFamilyImage. - */ - public UnaryCallSettings.Builder getFromFamilyImageSettings() { + /** Returns the builder for the settings used for calls to getFromFamilyImage. */ + public UnaryCallSettings.Builder + getFromFamilyImageSettings() { return getFromFamilyImageSettings; } - /** - * Returns the builder for the settings used for calls to insertImage. - */ + /** Returns the builder for the settings used for calls to insertImage. */ public UnaryCallSettings.Builder insertImageSettings() { return insertImageSettings; } - /** - * Returns the builder for the settings used for calls to listImages. - */ - public PagedCallSettings.Builder listImagesSettings() { + /** Returns the builder for the settings used for calls to listImages. */ + public PagedCallSettings.Builder + listImagesSettings() { return listImagesSettings; } @@ -498,4 +468,4 @@ public ImageStubSettings build() throws IOException { return new ImageStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java index 11221269749b..3ae65b73cd29 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,22 +39,18 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Snapshot; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -67,15 +61,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSnapshot to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSnapshot to 30 seconds: * *

  * 
@@ -90,44 +84,39 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SnapshotStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteSnapshotSettings;
   private final UnaryCallSettings getSnapshotSettings;
-  private final PagedCallSettings listSnapshotsSettings;
+  private final PagedCallSettings<
+          ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
+      listSnapshotsSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteSnapshot.
-   */
+  /** Returns the object with the settings used for calls to deleteSnapshot. */
   public UnaryCallSettings deleteSnapshotSettings() {
     return deleteSnapshotSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSnapshot.
-   */
+  /** Returns the object with the settings used for calls to getSnapshot. */
   public UnaryCallSettings getSnapshotSettings() {
     return getSnapshotSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSnapshots.
-   */
-  public PagedCallSettings listSnapshotsSettings() {
+  /** Returns the object with the settings used for calls to listSnapshots. */
+  public PagedCallSettings
+      listSnapshotsSettings() {
     return listSnapshotsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public SnapshotStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -140,47 +129,34 @@ public SnapshotStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -192,26 +168,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SnapshotStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -224,75 +196,82 @@ protected SnapshotStubSettings(Builder settingsBuilder) throws IOException {
     listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_SNAPSHOTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListSnapshotsHttpRequest injectToken(ListSnapshotsHttpRequest payload, String token) {
-          return ListSnapshotsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListSnapshotsHttpRequest injectPageSize(ListSnapshotsHttpRequest payload, int pageSize) {
-          return ListSnapshotsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListSnapshotsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(SnapshotList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(SnapshotList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_SNAPSHOTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListSnapshotsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context);
-          return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for SnapshotStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_SNAPSHOTS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListSnapshotsHttpRequest injectToken(
+                ListSnapshotsHttpRequest payload, String token) {
+              return ListSnapshotsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListSnapshotsHttpRequest injectPageSize(
+                ListSnapshotsHttpRequest payload, int pageSize) {
+              return ListSnapshotsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListSnapshotsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(SnapshotList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(SnapshotList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
+      LIST_SNAPSHOTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListSnapshotsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context);
+              return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for SnapshotStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteSnapshotSettings;
+    private final UnaryCallSettings.Builder
+        deleteSnapshotSettings;
     private final UnaryCallSettings.Builder getSnapshotSettings;
-    private final PagedCallSettings.Builder listSnapshotsSettings;
+    private final PagedCallSettings.Builder<
+            ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
+        listSnapshotsSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -301,15 +280,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -325,14 +305,11 @@ protected Builder(ClientContext clientContext) {
 
       getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listSnapshotsSettings = PagedCallSettings.newBuilder(
-          LIST_SNAPSHOTS_PAGE_STR_FACT);
+      listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteSnapshotSettings,
-          getSnapshotSettings,
-          listSnapshotsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteSnapshotSettings, getSnapshotSettings, listSnapshotsSettings);
 
       initDefaults(this);
     }
@@ -348,15 +325,18 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteSnapshotSettings()
+      builder
+          .deleteSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getSnapshotSettings()
+      builder
+          .getSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listSnapshotsSettings()
+      builder
+          .listSnapshotsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -370,19 +350,18 @@ protected Builder(SnapshotStubSettings settings) {
       getSnapshotSettings = settings.getSnapshotSettings.toBuilder();
       listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteSnapshotSettings,
-          getSnapshotSettings,
-          listSnapshotsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteSnapshotSettings, getSnapshotSettings, listSnapshotsSettings);
     }
 
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -391,24 +370,21 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteSnapshotSettings() { + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder + deleteSnapshotSettings() { return deleteSnapshotSettings; } - /** - * Returns the builder for the settings used for calls to getSnapshot. - */ + /** Returns the builder for the settings used for calls to getSnapshot. */ public UnaryCallSettings.Builder getSnapshotSettings() { return getSnapshotSettings; } - /** - * Returns the builder for the settings used for calls to listSnapshots. - */ - public PagedCallSettings.Builder listSnapshotsSettings() { + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> + listSnapshotsSettings() { return listSnapshotsSettings; } @@ -417,4 +393,4 @@ public SnapshotStubSettings build() throws IOException { return new SnapshotStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index dd661424888b..f1799b86c4de 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; @@ -37,6 +27,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.listInstancesInstanceGroupsMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.removeInstancesInstanceGroupMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.setNamedPortsInstanceGroupMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -54,20 +55,20 @@ @javax.annotation.Generated("by GAPIC") public class InstanceGroupClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - addInstancesInstanceGroupMethodDescriptor, - aggregatedListInstanceGroupsMethodDescriptor, - deleteInstanceGroupMethodDescriptor, - getInstanceGroupMethodDescriptor, - insertInstanceGroupMethodDescriptor, - listInstanceGroupsMethodDescriptor, - listInstancesInstanceGroupsMethodDescriptor, - removeInstancesInstanceGroupMethodDescriptor, - setNamedPortsInstanceGroupMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + addInstancesInstanceGroupMethodDescriptor, + aggregatedListInstanceGroupsMethodDescriptor, + deleteInstanceGroupMethodDescriptor, + getInstanceGroupMethodDescriptor, + insertInstanceGroupMethodDescriptor, + listInstanceGroupsMethodDescriptor, + listInstancesInstanceGroupsMethodDescriptor, + removeInstancesInstanceGroupMethodDescriptor, + setNamedPortsInstanceGroupMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); private static InstanceGroupClient client; private static InstanceGroupSettings clientSettings; @@ -76,13 +77,13 @@ public class InstanceGroupClientTest { public static void setUp() throws IOException { clientSettings = InstanceGroupSettings.newBuilder() - .setTransportChannelProvider( - InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InstanceGroupClient.create(clientSettings); + .setTransportChannelProvider( + InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InstanceGroupClient.create(clientSettings); } @After @@ -119,33 +120,36 @@ public void addInstancesInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = + InstanceGroupsAddInstancesRequest.newBuilder().build(); Operation actualResponse = client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); @@ -154,21 +158,31 @@ public void addInstancesInstanceGroupTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void addInstancesInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = + InstanceGroupsAddInstancesRequest.newBuilder().build(); client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.fail("No exception raised"); @@ -187,37 +201,47 @@ public void aggregatedListInstanceGroupsTest() { InstanceGroupsScopedList itemsItem = InstanceGroupsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - InstanceGroupAggregatedList expectedResponse = InstanceGroupAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + InstanceGroupAggregatedList expectedResponse = + InstanceGroupAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListInstanceGroupsPagedResponse pagedListResponse = client.aggregatedListInstanceGroups(project); + AggregatedListInstanceGroupsPagedResponse pagedListResponse = + client.aggregatedListInstanceGroups(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -254,54 +278,64 @@ public void deleteInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - Operation actualResponse = - client.deleteInstanceGroup(instanceGroup); + Operation actualResponse = client.deleteInstanceGroup(instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); client.deleteInstanceGroup(instanceGroup); Assert.fail("No exception raised"); @@ -325,45 +359,55 @@ public void getInstanceGroupTest() { String name = "name3373707"; String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); - InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setKind(kind) - .setDescription(description) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setSize(size) - .setZone(zone.toString()) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InstanceGroup expectedResponse = + InstanceGroup.newBuilder() + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setSize(size) + .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroup actualResponse = - client.getInstanceGroup(instanceGroup); + InstanceGroup actualResponse = client.getInstanceGroup(instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); client.getInstanceGroup(instanceGroup); Assert.fail("No exception raised"); @@ -396,51 +440,59 @@ public void insertInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); - Operation actualResponse = - client.insertInstanceGroup(zone, instanceGroupResource); + Operation actualResponse = client.insertInstanceGroup(zone, instanceGroupResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -463,13 +515,14 @@ public void listInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupList expectedResponse = InstanceGroupList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupList expectedResponse = + InstanceGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); @@ -478,22 +531,29 @@ public void listInstanceGroupsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -515,43 +575,57 @@ public void listInstancesInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupsListInstances expectedResponse = InstanceGroupsListInstances.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupsListInstances expectedResponse = + InstanceGroupsListInstances.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = + InstanceGroupsListInstancesRequest.newBuilder().build(); - ListInstancesInstanceGroupsPagedResponse pagedListResponse = client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); + ListInstancesInstanceGroupsPagedResponse pagedListResponse = + client.listInstancesInstanceGroups( + instanceGroup, instanceGroupsListInstancesRequestResource); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstancesInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = + InstanceGroupsListInstancesRequest.newBuilder().build(); client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); Assert.fail("No exception raised"); @@ -584,58 +658,73 @@ public void removeInstancesInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = + InstanceGroupsRemoveInstancesRequest.newBuilder().build(); Operation actualResponse = - client.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource); + client.removeInstancesInstanceGroup( + instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void removeInstancesInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = + InstanceGroupsRemoveInstancesRequest.newBuilder().build(); - client.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource); + client.removeInstancesInstanceGroup( + instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -666,56 +755,70 @@ public void setNamedPortsInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = + InstanceGroupsSetNamedPortsRequest.newBuilder().build(); Operation actualResponse = - client.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsInstanceGroup( + instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setNamedPortsInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + InstanceGroupName instanceGroup = + InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = + InstanceGroupsSetNamedPortsRequest.newBuilder().build(); client.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); @@ -723,5 +826,4 @@ public void setNamedPortsInstanceGroupExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index 12ef5fac2022..72356c713715 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class RegionAutoscalerClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteRegionAutoscalerMethodDescriptor, - getRegionAutoscalerMethodDescriptor, - insertRegionAutoscalerMethodDescriptor, - listRegionAutoscalersMethodDescriptor, - patchRegionAutoscalerMethodDescriptor, - updateRegionAutoscalerMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionAutoscalerMethodDescriptor, + getRegionAutoscalerMethodDescriptor, + insertRegionAutoscalerMethodDescriptor, + listRegionAutoscalersMethodDescriptor, + patchRegionAutoscalerMethodDescriptor, + updateRegionAutoscalerMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); private static RegionAutoscalerClient client; private static RegionAutoscalerSettings clientSettings; @@ -68,13 +67,13 @@ public class RegionAutoscalerClientTest { public static void setUp() throws IOException { clientSettings = RegionAutoscalerSettings.newBuilder() - .setTransportChannelProvider( - RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionAutoscalerClient.create(clientSettings); + .setTransportChannelProvider( + RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionAutoscalerClient.create(clientSettings); } @After @@ -111,54 +110,64 @@ public void deleteRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - Operation actualResponse = - client.deleteRegionAutoscaler(autoscaler); + Operation actualResponse = client.deleteRegionAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); client.deleteRegionAutoscaler(autoscaler); Assert.fail("No exception raised"); @@ -179,42 +188,52 @@ public void getRegionAutoscalerTest() { RegionName region = RegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String target = "target-880905839"; - Autoscaler expectedResponse = Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setTarget(target) - .build(); + Autoscaler expectedResponse = + Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - Autoscaler actualResponse = - client.getRegionAutoscaler(autoscaler); + Autoscaler actualResponse = client.getRegionAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); client.getRegionAutoscaler(autoscaler); Assert.fail("No exception raised"); @@ -247,51 +266,59 @@ public void insertRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.insertRegionAutoscaler(region, autoscalerResource); + Operation actualResponse = client.insertRegionAutoscaler(region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -314,13 +341,14 @@ public void listRegionAutoscalersTest() { String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionAutoscalerList expectedResponse = RegionAutoscalerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionAutoscalerList expectedResponse = + RegionAutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); RegionName region = RegionName.of("[PROJECT]", "[REGION]"); @@ -329,22 +357,29 @@ public void listRegionAutoscalersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionAutoscalersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -381,52 +416,60 @@ public void patchRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); + Operation actualResponse = client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -465,29 +508,30 @@ public void updateRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; @@ -501,16 +545,24 @@ public void updateRegionAutoscalerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -524,5 +576,4 @@ public void updateRegionAutoscalerExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 729d66ea67b9..2fcf2599aab9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class TargetHttpsProxyClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteTargetHttpsProxyMethodDescriptor, - getTargetHttpsProxyMethodDescriptor, - insertTargetHttpsProxyMethodDescriptor, - listTargetHttpsProxiesMethodDescriptor, - setSslCertificatesTargetHttpsProxyMethodDescriptor, - setUrlMapTargetHttpsProxyMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetHttpsProxyMethodDescriptor, + getTargetHttpsProxyMethodDescriptor, + insertTargetHttpsProxyMethodDescriptor, + listTargetHttpsProxiesMethodDescriptor, + setSslCertificatesTargetHttpsProxyMethodDescriptor, + setUrlMapTargetHttpsProxyMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); private static TargetHttpsProxyClient client; private static TargetHttpsProxySettings clientSettings; @@ -68,13 +67,13 @@ public class TargetHttpsProxyClientTest { public static void setUp() throws IOException { clientSettings = TargetHttpsProxySettings.newBuilder() - .setTransportChannelProvider( - TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetHttpsProxyClient.create(clientSettings); + .setTransportChannelProvider( + TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetHttpsProxyClient.create(clientSettings); } @After @@ -111,54 +110,64 @@ public void deleteTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - Operation actualResponse = - client.deleteTargetHttpsProxy(targetHttpsProxy); + Operation actualResponse = client.deleteTargetHttpsProxy(targetHttpsProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); client.deleteTargetHttpsProxy(targetHttpsProxy); Assert.fail("No exception raised"); @@ -177,40 +186,50 @@ public void getTargetHttpsProxyTest() { String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - TargetHttpsProxy expectedResponse = TargetHttpsProxy.newBuilder() - .setUrlMap(urlMap.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + TargetHttpsProxy expectedResponse = + TargetHttpsProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxy actualResponse = - client.getTargetHttpsProxy(targetHttpsProxy); + TargetHttpsProxy actualResponse = client.getTargetHttpsProxy(targetHttpsProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); client.getTargetHttpsProxy(targetHttpsProxy); Assert.fail("No exception raised"); @@ -243,51 +262,59 @@ public void insertTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); - Operation actualResponse = - client.insertTargetHttpsProxy(project, targetHttpsProxyResource); + Operation actualResponse = client.insertTargetHttpsProxy(project, targetHttpsProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -310,13 +337,14 @@ public void listTargetHttpsProxiesTest() { String selfLink = "selfLink-1691268851"; TargetHttpsProxy itemsElement = TargetHttpsProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetHttpsProxyList expectedResponse = TargetHttpsProxyList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetHttpsProxyList expectedResponse = + TargetHttpsProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -325,22 +353,29 @@ public void listTargetHttpsProxiesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetHttpsProxiesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -377,58 +412,75 @@ public void setSslCertificatesTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource = + TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = - client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetHttpsProxy( + targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); - - client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource = + TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + + client.setSslCertificatesTargetHttpsProxy( + targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -459,32 +511,34 @@ public void setUrlMapTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); Operation actualResponse = @@ -494,20 +548,29 @@ public void setUrlMapTargetHttpsProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = + TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); @@ -516,5 +579,4 @@ public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} From bedae14f9f51e3ed3a9eac89344b4d9c09effef6 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 3 Apr 2018 12:07:29 -0700 Subject: [PATCH 10/42] regen from toolkit/discogapic_compute --- ...tancesInstanceGroupManagerHttpRequest.java | 34 + ...RegionInstanceGroupManagerHttpRequest.java | 34 + .../cloud/compute/v1/AcceleratorConfig.java | 196 +++ .../cloud/compute/v1/AcceleratorType.java | 434 +++++ .../v1/AcceleratorTypeAggregatedList.java | 332 ++++ .../compute/v1/AcceleratorTypeClient.java | 736 ++++++++ .../cloud/compute/v1/AcceleratorTypeList.java | 344 ++++ .../cloud/compute/v1/AcceleratorTypeName.java | 210 +++ .../compute/v1/AcceleratorTypeSettings.java | 255 +++ .../v1/AcceleratorTypesScopedList.java | 208 +++ .../google/cloud/compute/v1/AccessConfig.java | 68 + .../AddAccessConfigInstanceHttpRequest.java | 34 + .../AddHealthCheckTargetPoolHttpRequest.java | 34 + .../v1/AddInstanceTargetPoolHttpRequest.java | 34 + .../AddInstancesInstanceGroupHttpRequest.java | 34 + .../v1/AddPeeringNetworkHttpRequest.java | 475 +++++ .../com/google/cloud/compute/v1/Address.java | 102 ++ .../compute/v1/AddressAggregatedList.java | 44 +- .../cloud/compute/v1/AddressClient.java | 59 +- .../google/cloud/compute/v1/AddressList.java | 44 +- .../google/cloud/compute/v1/AddressName.java | 3 +- ...egatedListAcceleratorTypesHttpRequest.java | 543 ++++++ .../v1/AggregatedListDisksHttpRequest.java | 148 +- ...egatedListGlobalOperationsHttpRequest.java | 151 +- ...dListInstanceGroupManagersHttpRequest.java | 151 +- ...istInterconnectAttachmentsHttpRequest.java | 543 ++++++ ...gatedListRegionCommitmentsHttpRequest.java | 543 ++++++ .../google/cloud/compute/v1/AliasIpRange.java | 196 +++ .../v1/AttachDiskInstanceHttpRequest.java | 34 + .../google/cloud/compute/v1/AttachedDisk.java | 46 + .../v1/AttachedDiskInitializeParams.java | 34 + .../google/cloud/compute/v1/Autoscaler.java | 80 + .../compute/v1/AutoscalerAggregatedList.java | 44 +- .../cloud/compute/v1/AutoscalerClient.java | 131 +- .../cloud/compute/v1/AutoscalerList.java | 44 +- .../cloud/compute/v1/AutoscalerName.java | 3 +- .../compute/v1/AutoscalerStatusDetails.java | 196 +++ .../cloud/compute/v1/BackendBucket.java | 400 +++++ .../cloud/compute/v1/BackendBucketClient.java | 999 +++++++++++ .../cloud/compute/v1/BackendBucketList.java | 344 ++++ .../cloud/compute/v1/BackendBucketName.java | 186 ++ .../compute/v1/BackendBucketSettings.java | 296 ++++ .../cloud/compute/v1/BackendService.java | 68 + .../v1/BackendServiceAggregatedList.java | 44 +- .../compute/v1/BackendServiceCdnPolicy.java | 162 ++ .../compute/v1/BackendServiceClient.java | 131 +- .../cloud/compute/v1/BackendServiceIAP.java | 264 +++ .../cloud/compute/v1/BackendServiceList.java | 102 +- .../cloud/compute/v1/BackendServiceName.java | 3 +- .../cloud/compute/v1/CacheKeyPolicy.java | 322 ++++ .../google/cloud/compute/v1/Commitment.java | 582 +++++++ .../compute/v1/CommitmentAggregatedList.java | 332 ++++ .../cloud/compute/v1/CommitmentList.java | 344 ++++ .../cloud/compute/v1/CommitmentName.java | 210 +++ .../compute/v1/CommitmentsScopedList.java | 208 +++ .../v1/CreateSnapshotDiskHttpRequest.java | 68 + ...DeleteAccessConfigInstanceHttpRequest.java | 34 + .../compute/v1/DeleteAddressHttpRequest.java | 34 + .../v1/DeleteAutoscalerHttpRequest.java | 34 + .../v1/DeleteBackendBucketHttpRequest.java | 441 +++++ .../v1/DeleteBackendServiceHttpRequest.java | 34 + .../compute/v1/DeleteDiskHttpRequest.java | 34 + .../compute/v1/DeleteFirewallHttpRequest.java | 34 + .../v1/DeleteForwardingRuleHttpRequest.java | 34 + .../v1/DeleteGlobalAddressHttpRequest.java | 124 +- ...DeleteGlobalForwardingRuleHttpRequest.java | 34 + .../v1/DeleteHealthCheckHttpRequest.java | 124 +- .../v1/DeleteHttpHealthCheckHttpRequest.java | 124 +- .../v1/DeleteHttpsHealthCheckHttpRequest.java | 34 + .../compute/v1/DeleteImageHttpRequest.java | 34 + .../v1/DeleteInstanceGroupHttpRequest.java | 34 + ...DeleteInstanceGroupManagerHttpRequest.java | 34 + .../compute/v1/DeleteInstanceHttpRequest.java | 34 + .../v1/DeleteInstanceTemplateHttpRequest.java | 34 + ...tancesInstanceGroupManagerHttpRequest.java | 34 + ...RegionInstanceGroupManagerHttpRequest.java | 34 + ...leteInterconnectAttachmentHttpRequest.java | 441 +++++ .../v1/DeleteInterconnectHttpRequest.java | 441 +++++ .../compute/v1/DeleteNetworkHttpRequest.java | 34 + .../v1/DeleteRegionAutoscalerHttpRequest.java | 34 + ...DeleteRegionBackendServiceHttpRequest.java | 34 + ...RegionInstanceGroupManagerHttpRequest.java | 34 + .../compute/v1/DeleteRouteHttpRequest.java | 125 +- .../compute/v1/DeleteRouterHttpRequest.java | 124 +- .../compute/v1/DeleteSnapshotHttpRequest.java | 34 + .../v1/DeleteSslCertificateHttpRequest.java | 34 + .../v1/DeleteSubnetworkHttpRequest.java | 34 + .../v1/DeleteTargetHttpProxyHttpRequest.java | 34 + .../v1/DeleteTargetHttpsProxyHttpRequest.java | 34 + .../v1/DeleteTargetInstanceHttpRequest.java | 34 + .../v1/DeleteTargetPoolHttpRequest.java | 34 + .../v1/DeleteTargetSslProxyHttpRequest.java | 34 + .../v1/DeleteTargetTcpProxyHttpRequest.java | 441 +++++ .../v1/DeleteTargetVpnGatewayHttpRequest.java | 34 + .../compute/v1/DeleteUrlMapHttpRequest.java | 34 + .../v1/DeleteVpnTunnelHttpRequest.java | 34 + .../com/google/cloud/compute/v1/Denied.java | 208 +++ .../compute/v1/DeprecateImageHttpRequest.java | 34 + .../v1/DetachDiskInstanceHttpRequest.java | 34 + .../v1/DisableXpnHostProjectHttpRequest.java | 441 +++++ .../DisableXpnResourceProjectHttpRequest.java | 475 +++++ .../com/google/cloud/compute/v1/Disk.java | 394 +++-- .../cloud/compute/v1/DiskAggregatedList.java | 44 +- .../google/cloud/compute/v1/DiskClient.java | 257 ++- .../com/google/cloud/compute/v1/DiskList.java | 44 +- .../com/google/cloud/compute/v1/DiskName.java | 3 +- .../google/cloud/compute/v1/DiskSettings.java | 188 +- .../compute/v1/DiskTypeAggregatedList.java | 44 +- .../google/cloud/compute/v1/DiskTypeList.java | 44 +- .../google/cloud/compute/v1/DiskTypeName.java | 3 +- .../cloud/compute/v1/DiskTypesScopedList.java | 37 +- .../v1/EnableXpnHostProjectHttpRequest.java | 441 +++++ .../EnableXpnResourceProjectHttpRequest.java | 475 +++++ .../com/google/cloud/compute/v1/Errors.java | 51 +- ...xpandIpCidrRangeSubnetworkHttpRequest.java | 34 + .../google/cloud/compute/v1/FamilyName.java | 3 +- .../com/google/cloud/compute/v1/Firewall.java | 252 +++ .../cloud/compute/v1/FirewallClient.java | 379 ++-- .../google/cloud/compute/v1/FirewallList.java | 44 +- .../google/cloud/compute/v1/FirewallName.java | 3 +- .../cloud/compute/v1/ForwardingRule.java | 34 + .../v1/ForwardingRuleAggregatedList.java | 44 +- .../compute/v1/ForwardingRuleClient.java | 85 +- .../cloud/compute/v1/ForwardingRuleList.java | 44 +- .../cloud/compute/v1/ForwardingRuleName.java | 3 +- .../v1/GetAcceleratorTypeHttpRequest.java | 407 +++++ .../v1/GetBackendBucketHttpRequest.java | 407 +++++ .../v1/GetBackendServiceHttpRequest.java | 90 +- .../compute/v1/GetInstanceHttpRequest.java | 90 +- .../GetInterconnectAttachmentHttpRequest.java | 407 +++++ .../v1/GetInterconnectHttpRequest.java | 407 +++++ .../GetInterconnectLocationHttpRequest.java | 407 +++++ .../compute/v1/GetLicenseHttpRequest.java | 407 +++++ .../v1/GetRegionCommitmentHttpRequest.java | 407 +++++ .../v1/GetRegionInstanceGroupHttpRequest.java | 90 +- .../compute/v1/GetSubnetworkHttpRequest.java | 90 +- .../v1/GetTargetTcpProxyHttpRequest.java | 407 +++++ .../compute/v1/GetUrlMapHttpRequest.java | 90 +- .../v1/GetXpnHostProjectHttpRequest.java | 407 +++++ .../GetXpnResourcesProjectsHttpRequest.java | 543 ++++++ .../cloud/compute/v1/GlobalAddressClient.java | 59 +- .../v1/GlobalForwardingRuleClient.java | 127 +- .../compute/v1/GlobalSetLabelsRequest.java | 196 +++ .../cloud/compute/v1/HealthCheckClient.java | 119 +- .../cloud/compute/v1/HealthCheckList.java | 44 +- .../cloud/compute/v1/HealthCheckName.java | 3 +- .../compute/v1/HttpHealthCheckClient.java | 119 +- .../cloud/compute/v1/HttpHealthCheckList.java | 44 +- .../cloud/compute/v1/HttpHealthCheckName.java | 3 +- .../compute/v1/HttpsHealthCheckClient.java | 119 +- .../compute/v1/HttpsHealthCheckList.java | 44 +- .../compute/v1/HttpsHealthCheckName.java | 3 +- .../com/google/cloud/compute/v1/Image.java | 272 +++ .../google/cloud/compute/v1/ImageClient.java | 210 ++- .../google/cloud/compute/v1/ImageList.java | 44 +- .../google/cloud/compute/v1/ImageName.java | 3 +- .../cloud/compute/v1/ImageSettings.java | 14 + .../compute/v1/InsertAddressHttpRequest.java | 149 +- .../v1/InsertAutoscalerHttpRequest.java | 34 + .../v1/InsertBackendBucketHttpRequest.java | 475 +++++ .../v1/InsertBackendServiceHttpRequest.java | 34 + .../compute/v1/InsertDiskHttpRequest.java | 34 + .../compute/v1/InsertFirewallHttpRequest.java | 34 + .../v1/InsertForwardingRuleHttpRequest.java | 34 + .../v1/InsertGlobalAddressHttpRequest.java | 34 + ...InsertGlobalForwardingRuleHttpRequest.java | 34 + .../v1/InsertHealthCheckHttpRequest.java | 34 + .../v1/InsertHttpHealthCheckHttpRequest.java | 34 + .../v1/InsertHttpsHealthCheckHttpRequest.java | 34 + .../compute/v1/InsertImageHttpRequest.java | 68 + .../v1/InsertInstanceGroupHttpRequest.java | 34 + ...InsertInstanceGroupManagerHttpRequest.java | 161 +- .../compute/v1/InsertInstanceHttpRequest.java | 34 + .../v1/InsertInstanceTemplateHttpRequest.java | 34 + ...sertInterconnectAttachmentHttpRequest.java | 475 +++++ .../v1/InsertInterconnectHttpRequest.java | 475 +++++ .../compute/v1/InsertNetworkHttpRequest.java | 34 + .../v1/InsertRegionAutoscalerHttpRequest.java | 34 + ...InsertRegionBackendServiceHttpRequest.java | 34 + .../v1/InsertRegionCommitmentHttpRequest.java | 475 +++++ ...RegionInstanceGroupManagerHttpRequest.java | 34 + .../compute/v1/InsertRouteHttpRequest.java | 34 + .../compute/v1/InsertRouterHttpRequest.java | 34 + .../v1/InsertSslCertificateHttpRequest.java | 34 + .../v1/InsertSubnetworkHttpRequest.java | 34 + .../v1/InsertTargetHttpProxyHttpRequest.java | 34 + .../v1/InsertTargetHttpsProxyHttpRequest.java | 34 + .../v1/InsertTargetInstanceHttpRequest.java | 34 + .../v1/InsertTargetPoolHttpRequest.java | 34 + .../v1/InsertTargetSslProxyHttpRequest.java | 34 + .../v1/InsertTargetTcpProxyHttpRequest.java | 475 +++++ .../v1/InsertTargetVpnGatewayHttpRequest.java | 34 + .../compute/v1/InsertUrlMapHttpRequest.java | 149 +- .../v1/InsertVpnTunnelHttpRequest.java | 152 +- .../com/google/cloud/compute/v1/Instance.java | 216 +++ .../compute/v1/InstanceAggregatedList.java | 44 +- .../cloud/compute/v1/InstanceClient.java | 1545 +++++++++++++++-- .../v1/InstanceGroupAggregatedList.java | 44 +- .../cloud/compute/v1/InstanceGroupClient.java | 145 +- .../cloud/compute/v1/InstanceGroupList.java | 44 +- .../InstanceGroupManagerActionsSummary.java | 109 +- .../InstanceGroupManagerAggregatedList.java | 44 +- .../v1/InstanceGroupManagerClient.java | 1137 ++++++------ .../compute/v1/InstanceGroupManagerList.java | 44 +- .../compute/v1/InstanceGroupManagerName.java | 3 +- .../cloud/compute/v1/InstanceGroupName.java | 3 +- .../compute/v1/InstanceGroupSettings.java | 243 +-- .../v1/InstanceGroupsListInstances.java | 44 +- .../InstanceGroupsRemoveInstancesRequest.java | 32 +- .../google/cloud/compute/v1/InstanceList.java | 44 +- .../compute/v1/InstanceListReferrers.java | 344 ++++ .../google/cloud/compute/v1/InstanceName.java | 3 +- .../cloud/compute/v1/InstanceProperties.java | 114 ++ .../cloud/compute/v1/InstanceSettings.java | 99 ++ .../cloud/compute/v1/InstanceTemplate.java | 86 +- .../compute/v1/InstanceTemplateClient.java | 365 ++-- .../compute/v1/InstanceTemplateList.java | 44 +- .../compute/v1/InstanceTemplateName.java | 3 +- .../compute/v1/InstancesSetLabelsRequest.java | 196 +++ .../InstancesSetMachineResourcesRequest.java | 174 ++ .../v1/InstancesSetMinCpuPlatformRequest.java | 162 ++ .../google/cloud/compute/v1/Interconnect.java | 878 ++++++++++ .../compute/v1/InterconnectAttachment.java | 604 +++++++ .../InterconnectAttachmentAggregatedList.java | 332 ++++ .../v1/InterconnectAttachmentClient.java | 973 +++++++++++ .../v1/InterconnectAttachmentList.java | 344 ++++ .../v1/InterconnectAttachmentName.java | 210 +++ .../v1/InterconnectAttachmentPrivateInfo.java | 162 ++ .../v1/InterconnectAttachmentSettings.java | 283 +++ .../v1/InterconnectAttachmentsScopedList.java | 208 +++ .../compute/v1/InterconnectCircuitInfo.java | 230 +++ .../cloud/compute/v1/InterconnectClient.java | 876 ++++++++++ .../cloud/compute/v1/InterconnectList.java | 344 ++++ .../compute/v1/InterconnectLocation.java | 616 +++++++ .../v1/InterconnectLocationClient.java | 516 ++++++ .../compute/v1/InterconnectLocationList.java | 344 ++++ .../compute/v1/InterconnectLocationName.java | 186 ++ .../v1/InterconnectLocationRegionInfo.java | 230 +++ .../v1/InterconnectLocationSettings.java | 240 +++ .../cloud/compute/v1/InterconnectName.java | 186 ++ .../v1/InterconnectOutageNotification.java | 412 +++++ .../compute/v1/InterconnectSettings.java | 282 +++ .../v1/InvalidateCacheUrlMapHttpRequest.java | 34 + .../google/cloud/compute/v1/LicensClient.java | 8 +- .../cloud/compute/v1/LicenseClient.java | 297 ++++ .../google/cloud/compute/v1/LicenseName.java | 3 +- .../cloud/compute/v1/LicenseSettings.java | 218 +++ .../v1/ListAcceleratorTypesHttpRequest.java | 543 ++++++ .../v1/ListBackendBucketsHttpRequest.java | 543 ++++++ .../v1/ListInstanceGroupsHttpRequest.java | 149 +- ...istInstancesInstanceGroupsHttpRequest.java | 180 +- ...istInterconnectAttachmentsHttpRequest.java | 543 ++++++ .../ListInterconnectLocationsHttpRequest.java | 543 ++++++ .../v1/ListInterconnectsHttpRequest.java | 543 ++++++ .../v1/ListReferrersInstancesHttpRequest.java | 543 ++++++ .../ListRegionBackendServicesHttpRequest.java | 148 +- .../v1/ListRegionCommitmentsHttpRequest.java | 543 ++++++ .../compute/v1/ListRegionsHttpRequest.java | 148 +- .../v1/ListTargetHttpProxiesHttpRequest.java | 148 +- .../v1/ListTargetSslProxiesHttpRequest.java | 148 +- .../v1/ListTargetTcpProxiesHttpRequest.java | 543 ++++++ .../v1/ListXpnHostsProjectsHttpRequest.java | 577 ++++++ .../compute/v1/MachineTypeAggregatedList.java | 44 +- .../cloud/compute/v1/MachineTypeList.java | 44 +- .../cloud/compute/v1/MachineTypeName.java | 3 +- .../v1/MoveDiskProjectHttpRequest.java | 34 + .../v1/MoveInstanceProjectHttpRequest.java | 34 + .../com/google/cloud/compute/v1/Network.java | 80 + .../cloud/compute/v1/NetworkClient.java | 455 ++++- .../cloud/compute/v1/NetworkInterface.java | 80 + .../google/cloud/compute/v1/NetworkList.java | 44 +- .../google/cloud/compute/v1/NetworkName.java | 63 +- .../cloud/compute/v1/NetworkPeering.java | 298 ++++ .../compute/v1/NetworkRoutingConfig.java | 162 ++ .../cloud/compute/v1/NetworkSettings.java | 196 ++- .../compute/v1/NetworksAddPeeringRequest.java | 230 +++ .../v1/NetworksRemovePeeringRequest.java | 162 ++ .../compute/v1/OperationAggregatedList.java | 44 +- .../cloud/compute/v1/OperationList.java | 102 +- .../cloud/compute/v1/OperationName.java | 3 +- .../v1/PatchAutoscalerHttpRequest.java | 38 +- .../v1/PatchBackendBucketHttpRequest.java | 475 +++++ .../v1/PatchBackendServiceHttpRequest.java | 34 + .../compute/v1/PatchFirewallHttpRequest.java | 34 + .../v1/PatchHealthCheckHttpRequest.java | 34 + .../v1/PatchHttpHealthCheckHttpRequest.java | 34 + .../v1/PatchHttpsHealthCheckHttpRequest.java | 34 + .../v1/PatchInterconnectHttpRequest.java | 475 +++++ .../compute/v1/PatchNetworkHttpRequest.java | 475 +++++ .../v1/PatchRegionAutoscalerHttpRequest.java | 38 +- .../PatchRegionBackendServiceHttpRequest.java | 34 + .../compute/v1/PatchRouterHttpRequest.java | 34 + .../v1/PatchSubnetworkHttpRequest.java | 475 +++++ .../compute/v1/PatchUrlMapHttpRequest.java | 34 + .../com/google/cloud/compute/v1/Project.java | 44 +- .../cloud/compute/v1/ProjectAddressName.java | 3 +- .../cloud/compute/v1/ProjectClient.java | 1167 ++++++++++++- .../compute/v1/ProjectForwardingRuleName.java | 3 +- .../cloud/compute/v1/ProjectImageName.java | 186 ++ .../google/cloud/compute/v1/ProjectName.java | 3 +- .../v1/ProjectRegionAutoscalerName.java | 3 +- .../v1/ProjectRegionBackendServiceName.java | 3 +- ...ProjectRegionInstanceGroupManagerName.java | 3 +- .../v1/ProjectRegionInstanceGroupName.java | 3 +- .../v1/ProjectRegionOperationName.java | 3 +- .../cloud/compute/v1/ProjectSettings.java | 111 +- .../cloud/compute/v1/ProjectSnapshotName.java | 186 ++ .../compute/v1/ProjectZoneInstanceName.java | 210 +++ .../compute/v1/ProjectZoneOperationName.java | 3 +- .../v1/ProjectsDisableXpnResourceRequest.java | 162 ++ .../v1/ProjectsEnableXpnResourceRequest.java | 162 ++ .../compute/v1/ProjectsGetXpnResources.java | 242 +++ .../v1/ProjectsListXpnHostsRequest.java | 162 ++ .../com/google/cloud/compute/v1/Quota.java | 46 +- ...tancesInstanceGroupManagerHttpRequest.java | 202 ++- ...RegionInstanceGroupManagerHttpRequest.java | 202 ++- .../google/cloud/compute/v1/Reference.java | 264 +++ .../compute/v1/RegionAutoscalerClient.java | 444 ++--- .../compute/v1/RegionAutoscalerList.java | 44 +- .../v1/RegionBackendServiceClient.java | 135 +- .../compute/v1/RegionCommitmentClient.java | 863 +++++++++ .../compute/v1/RegionCommitmentSettings.java | 269 +++ .../compute/v1/RegionInstanceGroupClient.java | 26 +- .../compute/v1/RegionInstanceGroupList.java | 44 +- .../v1/RegionInstanceGroupManagerClient.java | 969 +++++------ .../v1/RegionInstanceGroupManagerList.java | 44 +- .../v1/RegionInstanceGroupsListInstances.java | 44 +- ...ionInstanceGroupsListInstancesRequest.java | 41 +- .../google/cloud/compute/v1/RegionList.java | 44 +- .../google/cloud/compute/v1/RegionName.java | 3 +- ...emoveHealthCheckTargetPoolHttpRequest.java | 34 + .../RemoveInstanceTargetPoolHttpRequest.java | 34 + ...moveInstancesInstanceGroupHttpRequest.java | 34 + .../v1/RemovePeeringNetworkHttpRequest.java | 475 +++++ .../compute/v1/ResetInstanceHttpRequest.java | 34 + .../compute/v1/ResizeDiskHttpRequest.java | 34 + ...ResizeInstanceGroupManagerHttpRequest.java | 34 + ...RegionInstanceGroupManagerHttpRequest.java | 34 + .../cloud/compute/v1/ResourceCommitment.java | 196 +++ .../google/cloud/compute/v1/ResourceName.java | 210 +++ .../com/google/cloud/compute/v1/Route.java | 34 + .../google/cloud/compute/v1/RouteClient.java | 63 +- .../google/cloud/compute/v1/RouteList.java | 44 +- .../google/cloud/compute/v1/RouteName.java | 3 +- .../compute/v1/RouterAdvertisedIpRange.java | 196 +++ .../compute/v1/RouterAggregatedList.java | 44 +- .../google/cloud/compute/v1/RouterBgp.java | 159 +- .../cloud/compute/v1/RouterBgpPeer.java | 126 ++ .../google/cloud/compute/v1/RouterClient.java | 119 +- .../cloud/compute/v1/RouterInterface.java | 34 + .../google/cloud/compute/v1/RouterList.java | 44 +- .../google/cloud/compute/v1/RouterName.java | 73 +- .../google/cloud/compute/v1/RouterStatus.java | 46 + .../cloud/compute/v1/SerialPortOutput.java | 70 +- .../cloud/compute/v1/ServiceAccount.java | 37 +- ...ckendServiceTargetSslProxyHttpRequest.java | 34 + ...ckendServiceTargetTcpProxyHttpRequest.java | 475 +++++ .../v1/SetBackupTargetPoolHttpRequest.java | 164 +- ...monInstanceMetadataProjectHttpRequest.java | 34 + ...DeletionProtectionInstanceHttpRequest.java | 475 +++++ .../SetDiskAutoDeleteInstanceHttpRequest.java | 34 + ...mplateInstanceGroupManagerHttpRequest.java | 34 + ...RegionInstanceGroupManagerHttpRequest.java | 34 + .../compute/v1/SetLabelsDiskHttpRequest.java | 475 +++++ .../compute/v1/SetLabelsImageHttpRequest.java | 441 +++++ .../v1/SetLabelsInstanceHttpRequest.java | 475 +++++ .../v1/SetLabelsSnapshotHttpRequest.java | 441 +++++ ...etMachineResourcesInstanceHttpRequest.java | 475 +++++ .../v1/SetMachineTypeInstanceHttpRequest.java | 34 + .../v1/SetMetadataInstanceHttpRequest.java | 34 + .../SetMinCpuPlatformInstanceHttpRequest.java | 475 +++++ ...SetNamedPortsInstanceGroupHttpRequest.java | 34 + ...edPortsRegionInstanceGroupHttpRequest.java | 34 + ...teIpGoogleAccessSubnetworkHttpRequest.java | 475 +++++ ...tProxyHeaderTargetSslProxyHttpRequest.java | 34 + ...tProxyHeaderTargetTcpProxyHttpRequest.java | 475 +++++ .../v1/SetSchedulingInstanceHttpRequest.java | 34 + .../SetServiceAccountInstanceHttpRequest.java | 34 + ...rtificatesTargetHttpsProxyHttpRequest.java | 34 + ...CertificatesTargetSslProxyHttpRequest.java | 34 + .../v1/SetTagsInstanceHttpRequest.java | 34 + .../SetTargetForwardingRuleHttpRequest.java | 34 + ...TargetGlobalForwardingRuleHttpRequest.java | 34 + ...tPoolsInstanceGroupManagerHttpRequest.java | 34 + ...RegionInstanceGroupManagerHttpRequest.java | 34 + .../SetUrlMapTargetHttpProxyHttpRequest.java | 34 + .../SetUrlMapTargetHttpsProxyHttpRequest.java | 34 + ...etUsageExportBucketProjectHttpRequest.java | 34 + .../com/google/cloud/compute/v1/Snapshot.java | 68 + .../cloud/compute/v1/SnapshotClient.java | 134 +- .../google/cloud/compute/v1/SnapshotList.java | 44 +- .../google/cloud/compute/v1/SnapshotName.java | 3 +- .../cloud/compute/v1/SnapshotSettings.java | 14 + .../compute/v1/SslCertificateClient.java | 59 +- .../cloud/compute/v1/SslCertificateList.java | 44 +- .../cloud/compute/v1/SslCertificateName.java | 63 +- .../compute/v1/StartInstanceHttpRequest.java | 124 +- ...tWithEncryptionKeyInstanceHttpRequest.java | 34 + .../compute/v1/StopInstanceHttpRequest.java | 34 + .../google/cloud/compute/v1/Subnetwork.java | 114 ++ .../compute/v1/SubnetworkAggregatedList.java | 44 +- .../cloud/compute/v1/SubnetworkClient.java | 682 +++++--- .../cloud/compute/v1/SubnetworkList.java | 44 +- .../cloud/compute/v1/SubnetworkName.java | 3 +- .../compute/v1/SubnetworkSecondaryRange.java | 196 +++ .../cloud/compute/v1/SubnetworkSettings.java | 28 + ...tworksSetPrivateIpGoogleAccessRequest.java | 162 ++ .../SwitchToCustomModeNetworkHttpRequest.java | 124 +- .../compute/v1/TargetHttpProxyClient.java | 85 +- .../cloud/compute/v1/TargetHttpProxyList.java | 102 +- .../cloud/compute/v1/TargetHttpProxyName.java | 3 +- ...HttpsProxiesSetSslCertificatesRequest.java | 34 +- .../cloud/compute/v1/TargetHttpsProxy.java | 92 +- .../compute/v1/TargetHttpsProxyClient.java | 111 +- .../compute/v1/TargetHttpsProxyList.java | 102 +- .../compute/v1/TargetHttpsProxyName.java | 3 +- .../v1/TargetInstanceAggregatedList.java | 44 +- .../compute/v1/TargetInstanceClient.java | 59 +- .../cloud/compute/v1/TargetInstanceList.java | 44 +- .../cloud/compute/v1/TargetInstanceName.java | 3 +- .../compute/v1/TargetPoolAggregatedList.java | 44 +- .../cloud/compute/v1/TargetPoolClient.java | 189 +- .../compute/v1/TargetPoolInstanceHealth.java | 39 +- .../cloud/compute/v1/TargetPoolList.java | 44 +- .../cloud/compute/v1/TargetPoolName.java | 74 +- .../cloud/compute/v1/TargetReference.java | 33 +- .../cloud/compute/v1/TargetSslProxy.java | 117 +- .../compute/v1/TargetSslProxyClient.java | 137 +- .../cloud/compute/v1/TargetSslProxyList.java | 44 +- .../cloud/compute/v1/TargetSslProxyName.java | 3 +- ...getTcpProxiesSetBackendServiceRequest.java | 162 ++ ...TargetTcpProxiesSetProxyHeaderRequest.java | 162 ++ .../cloud/compute/v1/TargetTcpProxy.java | 400 +++++ .../compute/v1/TargetTcpProxyClient.java | 999 +++++++++++ .../cloud/compute/v1/TargetTcpProxyList.java | 344 ++++ .../cloud/compute/v1/TargetTcpProxyName.java | 186 ++ .../compute/v1/TargetTcpProxySettings.java | 296 ++++ .../v1/TargetVpnGatewayAggregatedList.java | 44 +- .../compute/v1/TargetVpnGatewayClient.java | 447 +++-- .../compute/v1/TargetVpnGatewayList.java | 44 +- .../compute/v1/TargetVpnGatewayName.java | 3 +- .../v1/TargetVpnGatewaysScopedList.java | 39 +- ...UpdateAccessConfigInstanceHttpRequest.java | 511 ++++++ .../v1/UpdateAutoscalerHttpRequest.java | 34 + .../v1/UpdateBackendBucketHttpRequest.java | 475 +++++ .../v1/UpdateBackendServiceHttpRequest.java | 34 + .../compute/v1/UpdateFirewallHttpRequest.java | 34 + .../v1/UpdateHealthCheckHttpRequest.java | 34 + .../v1/UpdateHttpHealthCheckHttpRequest.java | 34 + .../v1/UpdateHttpsHealthCheckHttpRequest.java | 34 + ...teNetworkInterfaceInstanceHttpRequest.java | 511 ++++++ .../v1/UpdateRegionAutoscalerHttpRequest.java | 163 +- ...UpdateRegionBackendServiceHttpRequest.java | 34 + .../compute/v1/UpdateRouterHttpRequest.java | 149 +- .../compute/v1/UpdateUrlMapHttpRequest.java | 34 + .../google/cloud/compute/v1/UrlMapClient.java | 145 +- .../google/cloud/compute/v1/UrlMapList.java | 44 +- .../google/cloud/compute/v1/UrlMapName.java | 63 +- .../cloud/compute/v1/UrlMapReference.java | 33 +- .../google/cloud/compute/v1/UrlMapTest.java | 61 +- .../compute/v1/VpnTunnelAggregatedList.java | 44 +- .../cloud/compute/v1/VpnTunnelClient.java | 59 +- .../cloud/compute/v1/VpnTunnelList.java | 44 +- .../cloud/compute/v1/VpnTunnelName.java | 3 +- .../google/cloud/compute/v1/XpnHostList.java | 344 ++++ .../cloud/compute/v1/XpnResourceId.java | 196 +++ .../com/google/cloud/compute/v1/Zone.java | 46 + .../com/google/cloud/compute/v1/ZoneList.java | 44 +- .../com/google/cloud/compute/v1/ZoneName.java | 3 +- .../compute/v1/ZoneOperationSettings.java | 140 +- .../compute/v1/ZoneSetLabelsRequest.java | 196 +++ .../google/cloud/compute/v1/package-info.java | 232 ++- .../compute/v1/stub/AcceleratorTypeStub.java | 71 + .../v1/stub/AcceleratorTypeStubSettings.java | 471 +++++ .../compute/v1/stub/BackendBucketStub.java | 81 + .../v1/stub/BackendBucketStubSettings.java | 501 ++++++ .../cloud/compute/v1/stub/DiskStub.java | 8 + .../compute/v1/stub/DiskStubSettings.java | 31 +- .../compute/v1/stub/GlobalAddressStub.java | 12 +- ...ttpJsonAcceleratorTypeCallableFactory.java | 99 ++ .../v1/stub/HttpJsonAcceleratorTypeStub.java | 237 +++ .../compute/v1/stub/HttpJsonAddressStub.java | 2 + .../v1/stub/HttpJsonAutoscalerStub.java | 6 +- .../HttpJsonBackendBucketCallableFactory.java | 98 ++ .../v1/stub/HttpJsonBackendBucketStub.java | 323 ++++ .../v1/stub/HttpJsonBackendServiceStub.java | 4 + .../v1/stub/HttpJsonDiskCallableFactory.java | 3 + .../compute/v1/stub/HttpJsonDiskStub.java | 385 ++-- .../compute/v1/stub/HttpJsonFirewallStub.java | 4 + .../v1/stub/HttpJsonForwardingRuleStub.java | 3 + .../v1/stub/HttpJsonGlobalAddressStub.java | 2 + .../HttpJsonGlobalForwardingRuleStub.java | 3 + .../v1/stub/HttpJsonHealthCheckStub.java | 4 + .../v1/stub/HttpJsonHttpHealthCheckStub.java | 4 + .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 4 + .../v1/stub/HttpJsonImageCallableFactory.java | 3 + .../compute/v1/stub/HttpJsonImageStub.java | 36 + .../stub/HttpJsonInstanceCallableFactory.java | 95 +- .../HttpJsonInstanceGroupManagerStub.java | 9 +- .../v1/stub/HttpJsonInstanceGroupStub.java | 5 + .../compute/v1/stub/HttpJsonInstanceStub.java | 259 ++- .../v1/stub/HttpJsonInstanceTemplateStub.java | 2 + ...InterconnectAttachmentCallableFactory.java | 101 ++ .../HttpJsonInterconnectAttachmentStub.java | 302 ++++ .../HttpJsonInterconnectCallableFactory.java | 97 ++ ...onInterconnectLocationCallableFactory.java | 94 + .../HttpJsonInterconnectLocationStub.java | 194 +++ .../v1/stub/HttpJsonInterconnectStub.java | 291 ++++ .../stub/HttpJsonLicenseCallableFactory.java | 90 + .../compute/v1/stub/HttpJsonLicenseStub.java | 152 ++ .../stub/HttpJsonNetworkCallableFactory.java | 5 + .../compute/v1/stub/HttpJsonNetworkStub.java | 101 ++ .../stub/HttpJsonProjectCallableFactory.java | 15 + .../compute/v1/stub/HttpJsonProjectStub.java | 249 +++ .../v1/stub/HttpJsonRegionAutoscalerStub.java | 6 +- ...onRegionBackendServiceCallableFactory.java | 56 +- .../HttpJsonRegionBackendServiceStub.java | 4 + .../stub/HttpJsonRegionCallableFactory.java | 49 +- ...tpJsonRegionCommitmentCallableFactory.java | 100 ++ .../v1/stub/HttpJsonRegionCommitmentStub.java | 270 +++ ...ttpJsonRegionInstanceGroupManagerStub.java | 9 +- .../stub/HttpJsonRegionInstanceGroupStub.java | 1 + .../compute/v1/stub/HttpJsonRouteStub.java | 182 +- .../compute/v1/stub/HttpJsonRouterStub.java | 4 + .../stub/HttpJsonSnapshotCallableFactory.java | 53 +- .../compute/v1/stub/HttpJsonSnapshotStub.java | 34 + .../v1/stub/HttpJsonSslCertificateStub.java | 2 + .../HttpJsonSubnetworkCallableFactory.java | 3 + .../v1/stub/HttpJsonSubnetworkStub.java | 68 + .../v1/stub/HttpJsonTargetHttpProxyStub.java | 3 + .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 4 + .../v1/stub/HttpJsonTargetInstanceStub.java | 2 + .../v1/stub/HttpJsonTargetPoolStub.java | 8 +- .../v1/stub/HttpJsonTargetSslProxyStub.java | 485 +++--- ...HttpJsonTargetTcpProxyCallableFactory.java | 100 ++ .../v1/stub/HttpJsonTargetTcpProxyStub.java | 325 ++++ .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 2 + .../compute/v1/stub/HttpJsonUrlMapStub.java | 388 ++--- .../v1/stub/HttpJsonVpnTunnelStub.java | 2 + .../compute/v1/stub/HttpsHealthCheckStub.java | 33 +- .../cloud/compute/v1/stub/ImageStub.java | 8 + .../compute/v1/stub/ImageStubSettings.java | 391 +++-- .../cloud/compute/v1/stub/InstanceStub.java | 55 + .../compute/v1/stub/InstanceStubSettings.java | 245 ++- .../v1/stub/InterconnectAttachmentStub.java | 84 + .../InterconnectAttachmentStubSettings.java | 526 ++++++ .../v1/stub/InterconnectLocationStub.java | 56 + .../InterconnectLocationStubSettings.java | 392 +++++ .../compute/v1/stub/InterconnectStub.java | 75 + .../v1/stub/InterconnectStubSettings.java | 474 +++++ .../cloud/compute/v1/stub/LicenseStub.java | 42 + .../compute/v1/stub/LicenseStubSettings.java | 309 ++++ .../cloud/compute/v1/stub/NetworkStub.java | 20 + .../compute/v1/stub/NetworkStubSettings.java | 85 +- .../cloud/compute/v1/stub/ProjectStub.java | 60 + .../compute/v1/stub/ProjectStubSettings.java | 303 +++- .../compute/v1/stub/RegionCommitmentStub.java | 78 + .../v1/stub/RegionCommitmentStubSettings.java | 499 ++++++ .../cloud/compute/v1/stub/SnapshotStub.java | 8 + .../compute/v1/stub/SnapshotStubSettings.java | 339 ++-- .../cloud/compute/v1/stub/SubnetworkStub.java | 13 + .../v1/stub/SubnetworkStubSettings.java | 58 +- .../compute/v1/stub/TargetTcpProxyStub.java | 83 + .../v1/stub/TargetTcpProxyStubSettings.java | 501 ++++++ .../compute/v1/AcceleratorTypeClientTest.java | 244 +++ .../cloud/compute/v1/AddressClientTest.java | 26 +- .../compute/v1/AutoscalerClientTest.java | 470 +++-- .../compute/v1/BackendBucketClientTest.java | 530 ++++++ .../compute/v1/BackendServiceClientTest.java | 24 +- .../cloud/compute/v1/DiskClientTest.java | 136 +- .../cloud/compute/v1/FirewallClientTest.java | 40 +- .../compute/v1/ForwardingRuleClientTest.java | 20 +- .../compute/v1/GlobalAddressClientTest.java | 26 +- .../v1/GlobalForwardingRuleClientTest.java | 20 +- .../compute/v1/HealthCheckClientTest.java | 24 +- .../compute/v1/HttpHealthCheckClientTest.java | 24 +- .../v1/HttpsHealthCheckClientTest.java | 24 +- .../cloud/compute/v1/ImageClientTest.java | 150 +- .../cloud/compute/v1/InstanceClientTest.java | 681 +++++++- .../compute/v1/InstanceGroupClientTest.java | 652 +++---- .../v1/InstanceGroupManagerClientTest.java | 48 +- .../v1/InstanceTemplateClientTest.java | 12 +- .../v1/InterconnectAttachmentClientTest.java | 424 +++++ .../compute/v1/InterconnectClientTest.java | 464 +++++ .../v1/InterconnectLocationClientTest.java | 198 +++ ...ClientTest.java => LicenseClientTest.java} | 28 +- .../cloud/compute/v1/NetworkClientTest.java | 276 ++- .../cloud/compute/v1/ProjectClientTest.java | 884 +++++++--- .../v1/RegionAutoscalerClientTest.java | 437 +++-- .../v1/RegionBackendServiceClientTest.java | 24 +- .../v1/RegionCommitmentClientTest.java | 338 ++++ .../v1/RegionInstanceGroupClientTest.java | 6 +- .../RegionInstanceGroupManagerClientTest.java | 48 +- .../cloud/compute/v1/RouteClientTest.java | 14 +- .../cloud/compute/v1/RouterClientTest.java | 24 +- .../cloud/compute/v1/SnapshotClientTest.java | 94 +- .../compute/v1/SslCertificateClientTest.java | 12 +- .../compute/v1/SubnetworkClientTest.java | 208 ++- .../compute/v1/TargetHttpProxyClientTest.java | 18 +- .../v1/TargetHttpsProxyClientTest.java | 454 +++-- .../compute/v1/TargetInstanceClientTest.java | 12 +- .../compute/v1/TargetPoolClientTest.java | 42 +- .../compute/v1/TargetSslProxyClientTest.java | 30 +- .../compute/v1/TargetTcpProxyClientTest.java | 530 ++++++ .../v1/TargetVpnGatewayClientTest.java | 12 +- .../cloud/compute/v1/UrlMapClientTest.java | 30 +- .../cloud/compute/v1/VpnTunnelClientTest.java | 12 +- 607 files changed, 88638 insertions(+), 8774 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java rename google-cloud-compute/src/test/java/com/google/cloud/compute/v1/{LicensClientTest.java => LicenseClientTest.java} (83%) create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java index 7c40cedf2776..207b4929732e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java @@ -40,6 +40,7 @@ public final class AbandonInstancesInstanceGroupManagerHttpRequest implements Ap private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private AbandonInstancesInstanceGroupManagerHttpRequest() { @@ -51,6 +52,7 @@ private AbandonInstancesInstanceGroupManagerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private AbandonInstancesInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private AbandonInstancesInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(AbandonInstancesInstanceGroupManagerHttpRequest other) if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(AbandonInstancesInstanceGroupManagerHttpRequest other) this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public AbandonInstancesInstanceGroupManagerHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public AbandonInstancesInstanceGroupManagerHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java index eb11482759c5..6481fbe386aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java @@ -40,6 +40,7 @@ public final class AbandonInstancesRegionInstanceGroupManagerHttpRequest impleme private final String prettyPrint; private final String quotaUser; private final RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource; + private final String requestId; private final String userIp; private AbandonInstancesRegionInstanceGroupManagerHttpRequest() { @@ -51,6 +52,7 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.regionInstanceGroupManagersAbandonInstancesRequestResource = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.regionInstanceGroupManagersAbandonInstancesRequestResource = regionInstanceGroupManagersAbandonInstancesRequestResource; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource") && regionInstanceGroupManagersAbandonInstancesRequestResource != null) { fieldMap.put("regionInstanceGroupManagersAbandonInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("regionInstanceGroupManagersAbandonInstancesRequestResource")) { return String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public RegionInstanceGroupManagersAbandonInstancesRequest getRegionInstanceGroup return regionInstanceGroupManagersAbandonInstancesRequestResource; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(AbandonInstancesRegionInstanceGroupManagerHttpRequest o if (other.getRegionInstanceGroupManagersAbandonInstancesRequestResource() != null) { this.regionInstanceGroupManagersAbandonInstancesRequestResource = other.regionInstanceGroupManagersAbandonInstancesRequestResource; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(AbandonInstancesRegionInstanceGroupManagerHttpRequest o this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.regionInstanceGroupManagersAbandonInstancesRequestResource = source.regionInstanceGroupManagersAbandonInstancesRequestResource; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setRegionInstanceGroupManagersAbandonInstancesRequestResource(Reg return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public AbandonInstancesRegionInstanceGroupManagerHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public AbandonInstancesRegionInstanceGroupManagerHttpRequest build() { prettyPrint, quotaUser, regionInstanceGroupManagersAbandonInstancesRequestResource, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegionInstanceGroupManagersAbandonInstancesRequestResource(this.regionInstanceGroupManagersAbandonInstancesRequestResource); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "regionInstanceGroupManagersAbandonInstancesRequestResource=" + regionInstanceGroupManagersAbandonInstancesRequestResource + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.regionInstanceGroupManagersAbandonInstancesRequestResource, that.getRegionInstanceGroupManagersAbandonInstancesRequestResource()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, quotaUser, regionInstanceGroupManagersAbandonInstancesRequestResource, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java new file mode 100644 index 000000000000..0232c0e03db6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AcceleratorConfig implements ApiMessage { + private final Integer acceleratorCount; + private final String acceleratorType; + + private AcceleratorConfig() { + this.acceleratorCount = null; + this.acceleratorType = null; + } + + + private AcceleratorConfig( + Integer acceleratorCount, + String acceleratorType + ) { + this.acceleratorCount = acceleratorCount; + this.acceleratorType = acceleratorType; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("acceleratorCount") && acceleratorCount != null) { + fieldMap.put("acceleratorCount", Collections.singletonList(String.valueOf(acceleratorCount))); + } + if (fieldNames.contains("acceleratorType") && acceleratorType != null) { + fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("acceleratorCount")) { + return String.valueOf(acceleratorCount); + } + if (fieldName.equals("acceleratorType")) { + return String.valueOf(acceleratorType); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getAcceleratorCount() { + return acceleratorCount; + } + + public String getAcceleratorType() { + return acceleratorType; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AcceleratorConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AcceleratorConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AcceleratorConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AcceleratorConfig(); + } + + public static class Builder { + private Integer acceleratorCount; + private String acceleratorType; + + Builder() {} + + public Builder mergeFrom(AcceleratorConfig other) { + if (other == AcceleratorConfig.getDefaultInstance()) return this; + if (other.getAcceleratorCount() != null) { + this.acceleratorCount = other.acceleratorCount; + } + if (other.getAcceleratorType() != null) { + this.acceleratorType = other.acceleratorType; + } + return this; + } + + Builder(AcceleratorConfig source) { + this.acceleratorCount = source.acceleratorCount; + this.acceleratorType = source.acceleratorType; + } + + public Integer getAcceleratorCount() { + return acceleratorCount; + } + + public Builder setAcceleratorCount(Integer acceleratorCount) { + this.acceleratorCount = acceleratorCount; + return this; + } + + public String getAcceleratorType() { + return acceleratorType; + } + + public Builder setAcceleratorType(String acceleratorType) { + this.acceleratorType = acceleratorType; + return this; + } + + + public AcceleratorConfig build() { + + return new AcceleratorConfig( + acceleratorCount, + acceleratorType + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAcceleratorCount(this.acceleratorCount); + newBuilder.setAcceleratorType(this.acceleratorType); + return newBuilder; + } + } + + @Override + public String toString() { + return "AcceleratorConfig{" + + "acceleratorCount=" + acceleratorCount + ", " + + "acceleratorType=" + acceleratorType + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AcceleratorConfig) { + AcceleratorConfig that = (AcceleratorConfig) o; + return + Objects.equals(this.acceleratorCount, that.getAcceleratorCount()) && + Objects.equals(this.acceleratorType, that.getAcceleratorType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + acceleratorCount, + acceleratorType + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java new file mode 100644 index 000000000000..d205857c3034 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java @@ -0,0 +1,434 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AcceleratorType implements ApiMessage { + private final String creationTimestamp; + private final DeprecationStatus deprecated; + private final String description; + private final String id; + private final String kind; + private final Integer maximumCardsPerInstance; + private final String name; + private final String selfLink; + private final String zone; + + private AcceleratorType() { + this.creationTimestamp = null; + this.deprecated = null; + this.description = null; + this.id = null; + this.kind = null; + this.maximumCardsPerInstance = null; + this.name = null; + this.selfLink = null; + this.zone = null; + } + + + private AcceleratorType( + String creationTimestamp, + DeprecationStatus deprecated, + String description, + String id, + String kind, + Integer maximumCardsPerInstance, + String name, + String selfLink, + String zone + ) { + this.creationTimestamp = creationTimestamp; + this.deprecated = deprecated; + this.description = description; + this.id = id; + this.kind = kind; + this.maximumCardsPerInstance = maximumCardsPerInstance; + this.name = name; + this.selfLink = selfLink; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("maximumCardsPerInstance") && maximumCardsPerInstance != null) { + fieldMap.put("maximumCardsPerInstance", Collections.singletonList(String.valueOf(maximumCardsPerInstance))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("deprecated")) { + return String.valueOf(deprecated); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("maximumCardsPerInstance")) { + return String.valueOf(maximumCardsPerInstance); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public Integer getMaximumCardsPerInstance() { + return maximumCardsPerInstance; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AcceleratorType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AcceleratorType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AcceleratorType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AcceleratorType(); + } + + public static class Builder { + private String creationTimestamp; + private DeprecationStatus deprecated; + private String description; + private String id; + private String kind; + private Integer maximumCardsPerInstance; + private String name; + private String selfLink; + private String zone; + + Builder() {} + + public Builder mergeFrom(AcceleratorType other) { + if (other == AcceleratorType.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getMaximumCardsPerInstance() != null) { + this.maximumCardsPerInstance = other.maximumCardsPerInstance; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(AcceleratorType source) { + this.creationTimestamp = source.creationTimestamp; + this.deprecated = source.deprecated; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.maximumCardsPerInstance = source.maximumCardsPerInstance; + this.name = source.name; + this.selfLink = source.selfLink; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public Integer getMaximumCardsPerInstance() { + return maximumCardsPerInstance; + } + + public Builder setMaximumCardsPerInstance(Integer maximumCardsPerInstance) { + this.maximumCardsPerInstance = maximumCardsPerInstance; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public AcceleratorType build() { + + + + + + + + + return new AcceleratorType( + creationTimestamp, + deprecated, + description, + id, + kind, + maximumCardsPerInstance, + name, + selfLink, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setMaximumCardsPerInstance(this.maximumCardsPerInstance); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "AcceleratorType{" + + "creationTimestamp=" + creationTimestamp + ", " + + "deprecated=" + deprecated + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "maximumCardsPerInstance=" + maximumCardsPerInstance + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AcceleratorType) { + AcceleratorType that = (AcceleratorType) o; + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.deprecated, that.getDeprecated()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.maximumCardsPerInstance, that.getMaximumCardsPerInstance()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + deprecated, + description, + id, + kind, + maximumCardsPerInstance, + name, + selfLink, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java new file mode 100644 index 000000000000..36e7b66c77ca --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java @@ -0,0 +1,332 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AcceleratorTypeAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private AcceleratorTypeAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private AcceleratorTypeAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AcceleratorTypeAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AcceleratorTypeAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AcceleratorTypeAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AcceleratorTypeAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(AcceleratorTypeAggregatedList other) { + if (other == AcceleratorTypeAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(AcceleratorTypeAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public AcceleratorTypeAggregatedList build() { + + + + + + return new AcceleratorTypeAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "AcceleratorTypeAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AcceleratorTypeAggregatedList) { + AcceleratorTypeAggregatedList that = (AcceleratorTypeAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java new file mode 100644 index 000000000000..acf6e178bccf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java @@ -0,0 +1,736 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.AcceleratorTypeStub; +import com.google.cloud.compute.v1.stub.AcceleratorTypeStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the acceleratorTypeClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of AcceleratorTypeSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * AcceleratorTypeSettings acceleratorTypeSettings =
+ *     AcceleratorTypeSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AcceleratorTypeClient acceleratorTypeClient =
+ *     AcceleratorTypeClient.create(acceleratorTypeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AcceleratorTypeSettings acceleratorTypeSettings =
+ *     AcceleratorTypeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AcceleratorTypeClient acceleratorTypeClient =
+ *     AcceleratorTypeClient.create(acceleratorTypeSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AcceleratorTypeClient implements BackgroundResource { + private final AcceleratorTypeSettings settings; + private final AcceleratorTypeStub stub; + + + + /** + * Constructs an instance of AcceleratorTypeClient with default settings. + */ + public static final AcceleratorTypeClient create() throws IOException { + return create(AcceleratorTypeSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AcceleratorTypeClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final AcceleratorTypeClient create(AcceleratorTypeSettings settings) throws IOException { + return new AcceleratorTypeClient(settings); + } + + /** + * Constructs an instance of AcceleratorTypeClient, using the given stub for making calls. This is for + * advanced usage - prefer to use AcceleratorTypeSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AcceleratorTypeClient create(AcceleratorTypeStub stub) { + return new AcceleratorTypeClient(stub); + } + + /** + * Constructs an instance of AcceleratorTypeClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected AcceleratorTypeClient(AcceleratorTypeSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AcceleratorTypeStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AcceleratorTypeClient(AcceleratorTypeStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AcceleratorTypeSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AcceleratorTypeStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of accelerator types. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (AcceleratorTypesScopedList element : acceleratorTypeClient.aggregatedListAcceleratorTypes(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(ProjectName project) { + AggregatedListAcceleratorTypesHttpRequest request = + AggregatedListAcceleratorTypesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListAcceleratorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of accelerator types. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (AcceleratorTypesScopedList element : acceleratorTypeClient.aggregatedListAcceleratorTypes(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(String project) { + AggregatedListAcceleratorTypesHttpRequest request = + AggregatedListAcceleratorTypesHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListAcceleratorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of accelerator types. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAcceleratorTypesHttpRequest request = AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (AcceleratorTypesScopedList element : acceleratorTypeClient.aggregatedListAcceleratorTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(AggregatedListAcceleratorTypesHttpRequest request) { + return aggregatedListAcceleratorTypesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of accelerator types. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAcceleratorTypesHttpRequest request = AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListAcceleratorTypesPagedResponse> future = acceleratorTypeClient.aggregatedListAcceleratorTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (AcceleratorTypesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListAcceleratorTypesPagedCallable() { + return stub.aggregatedListAcceleratorTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of accelerator types. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListAcceleratorTypesHttpRequest request = AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     AcceleratorTypeAggregatedList response = acceleratorTypeClient.aggregatedListAcceleratorTypesCallable().call(request);
+   *     for (AcceleratorTypesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListAcceleratorTypesCallable() { + return stub.aggregatedListAcceleratorTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
+   * }
+   * 
+ * + * @param acceleratorType Name of the accelerator type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AcceleratorType getAcceleratorType(AcceleratorTypeName acceleratorType) { + + GetAcceleratorTypeHttpRequest request = + GetAcceleratorTypeHttpRequest.newBuilder() + .setAcceleratorType(acceleratorType == null ? null : acceleratorType.toString()) + .build(); + return getAcceleratorType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType.toString());
+   * }
+   * 
+ * + * @param acceleratorType Name of the accelerator type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AcceleratorType getAcceleratorType(String acceleratorType) { + + GetAcceleratorTypeHttpRequest request = + GetAcceleratorTypeHttpRequest.newBuilder() + .setAcceleratorType(acceleratorType) + .build(); + return getAcceleratorType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   GetAcceleratorTypeHttpRequest request = GetAcceleratorTypeHttpRequest.newBuilder()
+   *     .setAcceleratorType(acceleratorType.toString())
+   *     .build();
+   *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AcceleratorType getAcceleratorType(GetAcceleratorTypeHttpRequest request) { + return getAcceleratorTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   GetAcceleratorTypeHttpRequest request = GetAcceleratorTypeHttpRequest.newBuilder()
+   *     .setAcceleratorType(acceleratorType.toString())
+   *     .build();
+   *   ApiFuture<AcceleratorType> future = acceleratorTypeClient.getAcceleratorTypeCallable().futureCall(request);
+   *   // Do something
+   *   AcceleratorType response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getAcceleratorTypeCallable() { + return stub.getAcceleratorTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of accelerator types available to the specified project. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ZoneName zone) { + ListAcceleratorTypesHttpRequest request = + ListAcceleratorTypesHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listAcceleratorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of accelerator types available to the specified project. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String zone) { + ListAcceleratorTypesHttpRequest request = + ListAcceleratorTypesHttpRequest.newBuilder() + .setZone(zone) + .build(); + return listAcceleratorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of accelerator types available to the specified project. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ListAcceleratorTypesHttpRequest request) { + return listAcceleratorTypesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of accelerator types available to the specified project. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListAcceleratorTypesPagedResponse> future = acceleratorTypeClient.listAcceleratorTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (AcceleratorType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listAcceleratorTypesPagedCallable() { + return stub.listAcceleratorTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of accelerator types available to the specified project. + * + * Sample code: + *

+   * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     AcceleratorTypeList response = acceleratorTypeClient.listAcceleratorTypesCallable().call(request);
+   *     for (AcceleratorType element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listAcceleratorTypesCallable() { + return stub.listAcceleratorTypesCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListAcceleratorTypesPagedResponse extends AbstractPagedListResponse< + AggregatedListAcceleratorTypesHttpRequest, + AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList, + AggregatedListAcceleratorTypesPage, + AggregatedListAcceleratorTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListAcceleratorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListAcceleratorTypesPagedResponse apply(AggregatedListAcceleratorTypesPage input) { + return new AggregatedListAcceleratorTypesPagedResponse(input); + } + }); + } + + private AggregatedListAcceleratorTypesPagedResponse(AggregatedListAcceleratorTypesPage page) { + super(page, AggregatedListAcceleratorTypesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListAcceleratorTypesPage extends AbstractPage< + AggregatedListAcceleratorTypesHttpRequest, + AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList, + AggregatedListAcceleratorTypesPage> { + + private AggregatedListAcceleratorTypesPage( + PageContext context, + AcceleratorTypeAggregatedList response) { + super(context, response); + } + + private static AggregatedListAcceleratorTypesPage createEmptyPage() { + return new AggregatedListAcceleratorTypesPage(null, null); + } + + @Override + protected AggregatedListAcceleratorTypesPage createPage( + PageContext context, + AcceleratorTypeAggregatedList response) { + return new AggregatedListAcceleratorTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListAcceleratorTypesFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListAcceleratorTypesHttpRequest, + AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList, + AggregatedListAcceleratorTypesPage, + AggregatedListAcceleratorTypesFixedSizeCollection> { + + private AggregatedListAcceleratorTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListAcceleratorTypesFixedSizeCollection createEmptyCollection() { + return new AggregatedListAcceleratorTypesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListAcceleratorTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListAcceleratorTypesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListAcceleratorTypesPagedResponse extends AbstractPagedListResponse< + ListAcceleratorTypesHttpRequest, + AcceleratorTypeList, + AcceleratorType, + ListAcceleratorTypesPage, + ListAcceleratorTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAcceleratorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAcceleratorTypesPagedResponse apply(ListAcceleratorTypesPage input) { + return new ListAcceleratorTypesPagedResponse(input); + } + }); + } + + private ListAcceleratorTypesPagedResponse(ListAcceleratorTypesPage page) { + super(page, ListAcceleratorTypesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListAcceleratorTypesPage extends AbstractPage< + ListAcceleratorTypesHttpRequest, + AcceleratorTypeList, + AcceleratorType, + ListAcceleratorTypesPage> { + + private ListAcceleratorTypesPage( + PageContext context, + AcceleratorTypeList response) { + super(context, response); + } + + private static ListAcceleratorTypesPage createEmptyPage() { + return new ListAcceleratorTypesPage(null, null); + } + + @Override + protected ListAcceleratorTypesPage createPage( + PageContext context, + AcceleratorTypeList response) { + return new ListAcceleratorTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListAcceleratorTypesFixedSizeCollection extends AbstractFixedSizeCollection< + ListAcceleratorTypesHttpRequest, + AcceleratorTypeList, + AcceleratorType, + ListAcceleratorTypesPage, + ListAcceleratorTypesFixedSizeCollection> { + + private ListAcceleratorTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAcceleratorTypesFixedSizeCollection createEmptyCollection() { + return new ListAcceleratorTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListAcceleratorTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAcceleratorTypesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java new file mode 100644 index 000000000000..8d191acc8064 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AcceleratorTypeList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private AcceleratorTypeList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private AcceleratorTypeList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AcceleratorTypeList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AcceleratorTypeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AcceleratorTypeList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AcceleratorTypeList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(AcceleratorTypeList other) { + if (other == AcceleratorTypeList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(AcceleratorTypeList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(AcceleratorType items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public AcceleratorTypeList build() { + + + + + + return new AcceleratorTypeList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "AcceleratorTypeList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AcceleratorTypeList) { + AcceleratorTypeList that = (AcceleratorTypeList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java new file mode 100644 index 000000000000..f7f5ae1e5320 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java @@ -0,0 +1,210 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class AcceleratorTypeName implements com.google.api.resourcenames.ResourceName { + private final String acceleratorType; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AcceleratorTypeName(Builder builder) { + acceleratorType = Preconditions.checkNotNull(builder.getAcceleratorType()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static AcceleratorTypeName of( + String acceleratorType, + String project, + String zone + ) { + return newBuilder() + .setAcceleratorType(acceleratorType) + .setProject(project) + .setZone(zone) + .build(); + } + + public static String format( + String acceleratorType, + String project, + String zone + ) { + return of( + acceleratorType, + project, + zone + ) + .toString(); + } + + public String getAcceleratorType() { + return acceleratorType; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("acceleratorType", acceleratorType); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public AcceleratorTypeName parse(String formattedString) {return AcceleratorTypeName.parse(formattedString);} + }; + } + + public static AcceleratorTypeName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "AcceleratorTypeName.parse: formattedString not in valid format"); + return of( + matchMap.get("acceleratorType"), + matchMap.get("project"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String acceleratorType; + private String project; + private String zone; + + public String getAcceleratorType() { + return acceleratorType; + } + public String getProject() { + return project; + } + public String getZone() { + return zone; + } + + public Builder setAcceleratorType(String acceleratorType) { + this.acceleratorType = acceleratorType; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (AcceleratorTypeName acceleratorTypeName) { + acceleratorType = acceleratorTypeName.acceleratorType; + project = acceleratorTypeName.project; + zone = acceleratorTypeName.zone; + } + + public AcceleratorTypeName build() { + return new AcceleratorTypeName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "acceleratorType", acceleratorType, + "project", project, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AcceleratorTypeName) { + AcceleratorTypeName that = (AcceleratorTypeName) o; + return + Objects.equals(this.acceleratorType, that.getAcceleratorType()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + acceleratorType, + project, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java new file mode 100644 index 000000000000..e67d28d549d6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java @@ -0,0 +1,255 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import com.google.cloud.compute.v1.stub.AcceleratorTypeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AcceleratorTypeClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getAcceleratorType to 30 seconds: + * + *

+ * 
+ * AcceleratorTypeSettings.Builder acceleratorTypeSettingsBuilder =
+ *     AcceleratorTypeSettings.newBuilder();
+ * acceleratorTypeSettingsBuilder.getAcceleratorTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AcceleratorTypeSettings acceleratorTypeSettings = acceleratorTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AcceleratorTypeSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListAcceleratorTypes. + */ + public PagedCallSettings aggregatedListAcceleratorTypesSettings() { + return ((AcceleratorTypeStubSettings) getStubSettings()).aggregatedListAcceleratorTypesSettings(); + } + + /** + * Returns the object with the settings used for calls to getAcceleratorType. + */ + public UnaryCallSettings getAcceleratorTypeSettings() { + return ((AcceleratorTypeStubSettings) getStubSettings()).getAcceleratorTypeSettings(); + } + + /** + * Returns the object with the settings used for calls to listAcceleratorTypes. + */ + public PagedCallSettings listAcceleratorTypesSettings() { + return ((AcceleratorTypeStubSettings) getStubSettings()).listAcceleratorTypesSettings(); + } + + + public static final AcceleratorTypeSettings create(AcceleratorTypeStubSettings stub) throws IOException { + return new AcceleratorTypeSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AcceleratorTypeStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return AcceleratorTypeStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return AcceleratorTypeStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return AcceleratorTypeStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AcceleratorTypeStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return AcceleratorTypeStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AcceleratorTypeStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AcceleratorTypeStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AcceleratorTypeSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for AcceleratorTypeSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AcceleratorTypeStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AcceleratorTypeStubSettings.newBuilder()); + } + + protected Builder(AcceleratorTypeSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AcceleratorTypeStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public AcceleratorTypeStubSettings.Builder getStubSettingsBuilder() { + return ((AcceleratorTypeStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListAcceleratorTypes. + */ + public PagedCallSettings.Builder aggregatedListAcceleratorTypesSettings() { + return getStubSettingsBuilder().aggregatedListAcceleratorTypesSettings(); + } + + /** + * Returns the builder for the settings used for calls to getAcceleratorType. + */ + public UnaryCallSettings.Builder getAcceleratorTypeSettings() { + return getStubSettingsBuilder().getAcceleratorTypeSettings(); + } + + /** + * Returns the builder for the settings used for calls to listAcceleratorTypes. + */ + public PagedCallSettings.Builder listAcceleratorTypesSettings() { + return getStubSettingsBuilder().listAcceleratorTypesSettings(); + } + + @Override + public AcceleratorTypeSettings build() throws IOException { + return new AcceleratorTypeSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java new file mode 100644 index 000000000000..1fd769311445 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AcceleratorTypesScopedList implements ApiMessage { + private final List acceleratorTypes; + private final Warning warning; + + private AcceleratorTypesScopedList() { + this.acceleratorTypes = null; + this.warning = null; + } + + + private AcceleratorTypesScopedList( + List acceleratorTypes, + Warning warning + ) { + this.acceleratorTypes = acceleratorTypes; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("acceleratorTypes") && acceleratorTypes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorType item : acceleratorTypes) { + stringList.add(item.toString()); + } + fieldMap.put("acceleratorTypes", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("acceleratorTypes")) { + return String.valueOf(acceleratorTypes); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getAcceleratorTypesList() { + return acceleratorTypes; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AcceleratorTypesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AcceleratorTypesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AcceleratorTypesScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AcceleratorTypesScopedList(); + } + + public static class Builder { + private List acceleratorTypes; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(AcceleratorTypesScopedList other) { + if (other == AcceleratorTypesScopedList.getDefaultInstance()) return this; + if (other.getAcceleratorTypesList() != null) { + this.acceleratorTypes = other.acceleratorTypes; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(AcceleratorTypesScopedList source) { + this.acceleratorTypes = source.acceleratorTypes; + this.warning = source.warning; + } + + public List getAcceleratorTypesList() { + return acceleratorTypes; + } + + public Builder addAllAcceleratorTypes(List acceleratorTypes) { + if (this.acceleratorTypes == null) { + this.acceleratorTypes = new ArrayList<>(acceleratorTypes.size()); + } + this.acceleratorTypes.addAll(acceleratorTypes); + return this; + } + + public Builder addAcceleratorTypes(AcceleratorType acceleratorTypes) { + this.acceleratorTypes.add(acceleratorTypes); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public AcceleratorTypesScopedList build() { + + return new AcceleratorTypesScopedList( + acceleratorTypes, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAcceleratorTypes(this.acceleratorTypes); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "AcceleratorTypesScopedList{" + + "acceleratorTypes=" + acceleratorTypes + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AcceleratorTypesScopedList) { + AcceleratorTypesScopedList that = (AcceleratorTypesScopedList) o; + return + Objects.equals(this.acceleratorTypes, that.getAcceleratorTypesList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + acceleratorTypes, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java index c005ea93500f..c97a9a679e20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java @@ -35,12 +35,16 @@ public final class AccessConfig implements ApiMessage { private final String kind; private final String name; private final String natIP; + private final String publicPtrDomainName; + private final Boolean setPublicPtr; private final String type; private AccessConfig() { this.kind = null; this.name = null; this.natIP = null; + this.publicPtrDomainName = null; + this.setPublicPtr = null; this.type = null; } @@ -49,11 +53,15 @@ private AccessConfig( String kind, String name, String natIP, + String publicPtrDomainName, + Boolean setPublicPtr, String type ) { this.kind = kind; this.name = name; this.natIP = natIP; + this.publicPtrDomainName = publicPtrDomainName; + this.setPublicPtr = setPublicPtr; this.type = type; } @@ -69,6 +77,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("natIP") && natIP != null) { fieldMap.put("natIP", Collections.singletonList(String.valueOf(natIP))); } + if (fieldNames.contains("publicPtrDomainName") && publicPtrDomainName != null) { + fieldMap.put("publicPtrDomainName", Collections.singletonList(String.valueOf(publicPtrDomainName))); + } + if (fieldNames.contains("setPublicPtr") && setPublicPtr != null) { + fieldMap.put("setPublicPtr", Collections.singletonList(String.valueOf(setPublicPtr))); + } if (fieldNames.contains("type") && type != null) { fieldMap.put("type", Collections.singletonList(String.valueOf(type))); } @@ -86,6 +100,12 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("natIP")) { return String.valueOf(natIP); } + if (fieldName.equals("publicPtrDomainName")) { + return String.valueOf(publicPtrDomainName); + } + if (fieldName.equals("setPublicPtr")) { + return String.valueOf(setPublicPtr); + } if (fieldName.equals("type")) { return String.valueOf(type); } @@ -110,6 +130,14 @@ public String getNatIP() { return natIP; } + public String getPublicPtrDomainName() { + return publicPtrDomainName; + } + + public Boolean getSetPublicPtr() { + return setPublicPtr; + } + public String getType() { return type; } @@ -138,6 +166,8 @@ public static class Builder { private String kind; private String name; private String natIP; + private String publicPtrDomainName; + private Boolean setPublicPtr; private String type; Builder() {} @@ -153,6 +183,12 @@ public Builder mergeFrom(AccessConfig other) { if (other.getNatIP() != null) { this.natIP = other.natIP; } + if (other.getPublicPtrDomainName() != null) { + this.publicPtrDomainName = other.publicPtrDomainName; + } + if (other.getSetPublicPtr() != null) { + this.setPublicPtr = other.setPublicPtr; + } if (other.getType() != null) { this.type = other.type; } @@ -163,6 +199,8 @@ public Builder mergeFrom(AccessConfig other) { this.kind = source.kind; this.name = source.name; this.natIP = source.natIP; + this.publicPtrDomainName = source.publicPtrDomainName; + this.setPublicPtr = source.setPublicPtr; this.type = source.type; } @@ -193,6 +231,24 @@ public Builder setNatIP(String natIP) { return this; } + public String getPublicPtrDomainName() { + return publicPtrDomainName; + } + + public Builder setPublicPtrDomainName(String publicPtrDomainName) { + this.publicPtrDomainName = publicPtrDomainName; + return this; + } + + public Boolean getSetPublicPtr() { + return setPublicPtr; + } + + public Builder setSetPublicPtr(Boolean setPublicPtr) { + this.setPublicPtr = setPublicPtr; + return this; + } + public String getType() { return type; } @@ -207,10 +263,14 @@ public AccessConfig build() { + + return new AccessConfig( kind, name, natIP, + publicPtrDomainName, + setPublicPtr, type ); } @@ -220,6 +280,8 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setName(this.name); newBuilder.setNatIP(this.natIP); + newBuilder.setPublicPtrDomainName(this.publicPtrDomainName); + newBuilder.setSetPublicPtr(this.setPublicPtr); newBuilder.setType(this.type); return newBuilder; } @@ -231,6 +293,8 @@ public String toString() { + "kind=" + kind + ", " + "name=" + name + ", " + "natIP=" + natIP + ", " + + "publicPtrDomainName=" + publicPtrDomainName + ", " + + "setPublicPtr=" + setPublicPtr + ", " + "type=" + type + "}"; } @@ -246,6 +310,8 @@ public boolean equals(Object o) { Objects.equals(this.kind, that.getKind()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.natIP, that.getNatIP()) && + Objects.equals(this.publicPtrDomainName, that.getPublicPtrDomainName()) && + Objects.equals(this.setPublicPtr, that.getSetPublicPtr()) && Objects.equals(this.type, that.getType()) ; } @@ -258,6 +324,8 @@ public int hashCode() { kind, name, natIP, + publicPtrDomainName, + setPublicPtr, type ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java index 43fb8056a332..6b91d932bcff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java @@ -41,6 +41,7 @@ public final class AddAccessConfigInstanceHttpRequest implements ApiMessage { private final String networkInterface; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private AddAccessConfigInstanceHttpRequest() { @@ -53,6 +54,7 @@ private AddAccessConfigInstanceHttpRequest() { this.networkInterface = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -67,6 +69,7 @@ private AddAccessConfigInstanceHttpRequest( String networkInterface, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.accessConfigResource = accessConfigResource; @@ -78,6 +81,7 @@ private AddAccessConfigInstanceHttpRequest( this.networkInterface = networkInterface; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -111,6 +115,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -146,6 +153,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -194,6 +204,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -228,6 +242,7 @@ public static class Builder { private String networkInterface; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -261,6 +276,9 @@ public Builder mergeFrom(AddAccessConfigInstanceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -277,6 +295,7 @@ public Builder mergeFrom(AddAccessConfigInstanceHttpRequest other) { this.networkInterface = source.networkInterface; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -361,6 +380,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -387,6 +415,7 @@ public AddAccessConfigInstanceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -400,6 +429,7 @@ public AddAccessConfigInstanceHttpRequest build() { networkInterface, prettyPrint, quotaUser, + requestId, userIp ); } @@ -415,6 +445,7 @@ public Builder clone() { newBuilder.setNetworkInterface(this.networkInterface); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -432,6 +463,7 @@ public String toString() { + "networkInterface=" + networkInterface + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -453,6 +485,7 @@ public boolean equals(Object o) { Objects.equals(this.networkInterface, that.getNetworkInterface()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -471,6 +504,7 @@ public int hashCode() { networkInterface, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java index 81161647787d..ff6380a03acf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java @@ -38,6 +38,7 @@ public final class AddHealthCheckTargetPoolHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String targetPool; private final TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource; private final String userIp; @@ -49,6 +50,7 @@ private AddHealthCheckTargetPoolHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.targetPool = null; this.targetPoolsAddHealthCheckRequestResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private AddHealthCheckTargetPoolHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, String userIp @@ -72,6 +75,7 @@ private AddHealthCheckTargetPoolHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetPool = targetPool; this.targetPoolsAddHealthCheckRequestResource = targetPoolsAddHealthCheckRequestResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetPool")) { return String.valueOf(targetPool); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getTargetPool() { return targetPool; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String targetPool; private TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(AddHealthCheckTargetPoolHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetPool() != null) { this.targetPool = other.targetPool; } @@ -256,6 +274,7 @@ public Builder mergeFrom(AddHealthCheckTargetPoolHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetPool = source.targetPool; this.targetPoolsAddHealthCheckRequestResource = source.targetPoolsAddHealthCheckRequestResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getTargetPool() { return targetPool; } @@ -351,6 +379,7 @@ public AddHealthCheckTargetPoolHttpRequest build() { + if (targetPool == null) { missing += " targetPool"; } @@ -366,6 +395,7 @@ public AddHealthCheckTargetPoolHttpRequest build() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsAddHealthCheckRequestResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); newBuilder.setTargetPoolsAddHealthCheckRequestResource(this.targetPoolsAddHealthCheckRequestResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetPool=" + targetPool + ", " + "targetPoolsAddHealthCheckRequestResource=" + targetPoolsAddHealthCheckRequestResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetPool, that.getTargetPool()) && Objects.equals(this.targetPoolsAddHealthCheckRequestResource, that.getTargetPoolsAddHealthCheckRequestResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsAddHealthCheckRequestResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java index d5c04bc3a519..e5b1b09ea0e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java @@ -38,6 +38,7 @@ public final class AddInstanceTargetPoolHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String targetPool; private final TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource; private final String userIp; @@ -49,6 +50,7 @@ private AddInstanceTargetPoolHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.targetPool = null; this.targetPoolsAddInstanceRequestResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private AddInstanceTargetPoolHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, String userIp @@ -72,6 +75,7 @@ private AddInstanceTargetPoolHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetPool = targetPool; this.targetPoolsAddInstanceRequestResource = targetPoolsAddInstanceRequestResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetPool")) { return String.valueOf(targetPool); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getTargetPool() { return targetPool; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String targetPool; private TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(AddInstanceTargetPoolHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetPool() != null) { this.targetPool = other.targetPool; } @@ -256,6 +274,7 @@ public Builder mergeFrom(AddInstanceTargetPoolHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetPool = source.targetPool; this.targetPoolsAddInstanceRequestResource = source.targetPoolsAddInstanceRequestResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getTargetPool() { return targetPool; } @@ -351,6 +379,7 @@ public AddInstanceTargetPoolHttpRequest build() { + if (targetPool == null) { missing += " targetPool"; } @@ -366,6 +395,7 @@ public AddInstanceTargetPoolHttpRequest build() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsAddInstanceRequestResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); newBuilder.setTargetPoolsAddInstanceRequestResource(this.targetPoolsAddInstanceRequestResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetPool=" + targetPool + ", " + "targetPoolsAddInstanceRequestResource=" + targetPoolsAddInstanceRequestResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetPool, that.getTargetPool()) && Objects.equals(this.targetPoolsAddInstanceRequestResource, that.getTargetPoolsAddInstanceRequestResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsAddInstanceRequestResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java index a3bb51a3c9b9..8d5c47bced1a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java @@ -40,6 +40,7 @@ public final class AddInstancesInstanceGroupHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private AddInstancesInstanceGroupHttpRequest() { @@ -51,6 +52,7 @@ private AddInstancesInstanceGroupHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private AddInstancesInstanceGroupHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private AddInstancesInstanceGroupHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(AddInstancesInstanceGroupHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(AddInstancesInstanceGroupHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public AddInstancesInstanceGroupHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public AddInstancesInstanceGroupHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java new file mode 100644 index 000000000000..b0a2a6e73b74 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AddPeeringNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String network; + private final NetworksAddPeeringRequest networksAddPeeringRequestResource; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private AddPeeringNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.network = null; + this.networksAddPeeringRequestResource = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private AddPeeringNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String network, + NetworksAddPeeringRequest networksAddPeeringRequestResource, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.network = network; + this.networksAddPeeringRequestResource = networksAddPeeringRequestResource; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networksAddPeeringRequestResource") && networksAddPeeringRequestResource != null) { + fieldMap.put("networksAddPeeringRequestResource", Collections.singletonList(String.valueOf(networksAddPeeringRequestResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("networksAddPeeringRequestResource")) { + return String.valueOf(networksAddPeeringRequestResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public NetworksAddPeeringRequest getApiMessageRequestBody() { + return networksAddPeeringRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNetwork() { + return network; + } + + public NetworksAddPeeringRequest getNetworksAddPeeringRequestResource() { + return networksAddPeeringRequestResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AddPeeringNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AddPeeringNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AddPeeringNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AddPeeringNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String network; + private NetworksAddPeeringRequest networksAddPeeringRequestResource; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AddPeeringNetworkHttpRequest other) { + if (other == AddPeeringNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getNetworksAddPeeringRequestResource() != null) { + this.networksAddPeeringRequestResource = other.networksAddPeeringRequestResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AddPeeringNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.network = source.network; + this.networksAddPeeringRequestResource = source.networksAddPeeringRequestResource; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public NetworksAddPeeringRequest getNetworksAddPeeringRequestResource() { + return networksAddPeeringRequestResource; + } + + public Builder setNetworksAddPeeringRequestResource(NetworksAddPeeringRequest networksAddPeeringRequestResource) { + this.networksAddPeeringRequestResource = networksAddPeeringRequestResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AddPeeringNetworkHttpRequest build() { + String missing = ""; + + + + + if (network == null) { + missing += " network"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AddPeeringNetworkHttpRequest( + access_token, + callback, + fields, + key, + network, + networksAddPeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetwork(this.network); + newBuilder.setNetworksAddPeeringRequestResource(this.networksAddPeeringRequestResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AddPeeringNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "networksAddPeeringRequestResource=" + networksAddPeeringRequestResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AddPeeringNetworkHttpRequest) { + AddPeeringNetworkHttpRequest that = (AddPeeringNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.networksAddPeeringRequestResource, that.getNetworksAddPeeringRequestResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + network, + networksAddPeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java index 968b7d1413a3..0d8a567e31d8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java @@ -33,51 +33,63 @@ @BetaApi public final class Address implements ApiMessage { private final String address; + private final String addressType; private final String creationTimestamp; private final String description; private final String id; + private final String ipVersion; private final String kind; private final String name; private final String region; private final String selfLink; private final String status; + private final String subnetwork; private final List users; private Address() { this.address = null; + this.addressType = null; this.creationTimestamp = null; this.description = null; this.id = null; + this.ipVersion = null; this.kind = null; this.name = null; this.region = null; this.selfLink = null; this.status = null; + this.subnetwork = null; this.users = null; } private Address( String address, + String addressType, String creationTimestamp, String description, String id, + String ipVersion, String kind, String name, String region, String selfLink, String status, + String subnetwork, List users ) { this.address = address; + this.addressType = addressType; this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; + this.ipVersion = ipVersion; this.kind = kind; this.name = name; this.region = region; this.selfLink = selfLink; this.status = status; + this.subnetwork = subnetwork; this.users = users; } @@ -87,6 +99,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("address") && address != null) { fieldMap.put("address", Collections.singletonList(String.valueOf(address))); } + if (fieldNames.contains("addressType") && addressType != null) { + fieldMap.put("addressType", Collections.singletonList(String.valueOf(addressType))); + } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } @@ -96,6 +111,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); } + if (fieldNames.contains("ipVersion") && ipVersion != null) { + fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion))); + } if (fieldNames.contains("kind") && kind != null) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } @@ -111,6 +129,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("status") && status != null) { fieldMap.put("status", Collections.singletonList(String.valueOf(status))); } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } if (fieldNames.contains("users") && users != null) { ImmutableList.Builder stringList = ImmutableList.builder(); for (String item : users) { @@ -126,6 +147,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("address")) { return String.valueOf(address); } + if (fieldName.equals("addressType")) { + return String.valueOf(addressType); + } if (fieldName.equals("creationTimestamp")) { return String.valueOf(creationTimestamp); } @@ -135,6 +159,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { return String.valueOf(id); } + if (fieldName.equals("ipVersion")) { + return String.valueOf(ipVersion); + } if (fieldName.equals("kind")) { return String.valueOf(kind); } @@ -150,6 +177,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("status")) { return String.valueOf(status); } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } if (fieldName.equals("users")) { return String.valueOf(users); } @@ -166,6 +196,10 @@ public String getAddress() { return address; } + public String getAddressType() { + return addressType; + } + public String getCreationTimestamp() { return creationTimestamp; } @@ -178,6 +212,10 @@ public String getId() { return id; } + public String getIpVersion() { + return ipVersion; + } + public String getKind() { return kind; } @@ -198,6 +236,10 @@ public String getStatus() { return status; } + public String getSubnetwork() { + return subnetwork; + } + public List getUsersList() { return users; } @@ -224,14 +266,17 @@ public static Address getDefaultInstance() { public static class Builder { private String address; + private String addressType; private String creationTimestamp; private String description; private String id; + private String ipVersion; private String kind; private String name; private String region; private String selfLink; private String status; + private String subnetwork; private List users; Builder() {} @@ -241,6 +286,9 @@ public Builder mergeFrom(Address other) { if (other.getAddress() != null) { this.address = other.address; } + if (other.getAddressType() != null) { + this.addressType = other.addressType; + } if (other.getCreationTimestamp() != null) { this.creationTimestamp = other.creationTimestamp; } @@ -250,6 +298,9 @@ public Builder mergeFrom(Address other) { if (other.getId() != null) { this.id = other.id; } + if (other.getIpVersion() != null) { + this.ipVersion = other.ipVersion; + } if (other.getKind() != null) { this.kind = other.kind; } @@ -265,6 +316,9 @@ public Builder mergeFrom(Address other) { if (other.getStatus() != null) { this.status = other.status; } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } if (other.getUsersList() != null) { this.users = other.users; } @@ -273,14 +327,17 @@ public Builder mergeFrom(Address other) { Builder(Address source) { this.address = source.address; + this.addressType = source.addressType; this.creationTimestamp = source.creationTimestamp; this.description = source.description; this.id = source.id; + this.ipVersion = source.ipVersion; this.kind = source.kind; this.name = source.name; this.region = source.region; this.selfLink = source.selfLink; this.status = source.status; + this.subnetwork = source.subnetwork; this.users = source.users; } @@ -293,6 +350,15 @@ public Builder setAddress(String address) { return this; } + public String getAddressType() { + return addressType; + } + + public Builder setAddressType(String addressType) { + this.addressType = addressType; + return this; + } + public String getCreationTimestamp() { return creationTimestamp; } @@ -320,6 +386,15 @@ public Builder setId(String id) { return this; } + public String getIpVersion() { + return ipVersion; + } + + public Builder setIpVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + public String getKind() { return kind; } @@ -365,6 +440,15 @@ public Builder setStatus(String status) { return this; } + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + public List getUsersList() { return users; } @@ -393,16 +477,22 @@ public Address build() { + + + return new Address( address, + addressType, creationTimestamp, description, id, + ipVersion, kind, name, region, selfLink, status, + subnetwork, users ); } @@ -410,14 +500,17 @@ public Address build() { public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAddress(this.address); + newBuilder.setAddressType(this.addressType); newBuilder.setCreationTimestamp(this.creationTimestamp); newBuilder.setDescription(this.description); newBuilder.setId(this.id); + newBuilder.setIpVersion(this.ipVersion); newBuilder.setKind(this.kind); newBuilder.setName(this.name); newBuilder.setRegion(this.region); newBuilder.setSelfLink(this.selfLink); newBuilder.setStatus(this.status); + newBuilder.setSubnetwork(this.subnetwork); newBuilder.addAllUsers(this.users); return newBuilder; } @@ -427,14 +520,17 @@ public Builder clone() { public String toString() { return "Address{" + "address=" + address + ", " + + "addressType=" + addressType + ", " + "creationTimestamp=" + creationTimestamp + ", " + "description=" + description + ", " + "id=" + id + ", " + + "ipVersion=" + ipVersion + ", " + "kind=" + kind + ", " + "name=" + name + ", " + "region=" + region + ", " + "selfLink=" + selfLink + ", " + "status=" + status + ", " + + "subnetwork=" + subnetwork + ", " + "users=" + users + "}"; } @@ -448,14 +544,17 @@ public boolean equals(Object o) { Address that = (Address) o; return Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.addressType, that.getAddressType()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && Objects.equals(this.description, that.getDescription()) && Objects.equals(this.id, that.getId()) && + Objects.equals(this.ipVersion, that.getIpVersion()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.region, that.getRegion()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && Objects.equals(this.users, that.getUsersList()) ; } @@ -466,14 +565,17 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( address, + addressType, creationTimestamp, description, id, + ipVersion, kind, name, region, selfLink, status, + subnetwork, users ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java index f8f67a9da712..8a9d5f2d2e5f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java @@ -37,6 +37,7 @@ public final class AddressAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private AddressAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private AddressAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private AddressAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(AddressAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(AddressAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public AddressAggregatedList build() { + return new AddressAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java index 3e9ed3422d97..c461be348dfa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java @@ -53,7 +53,8 @@ * * try (AddressClient addressClient = AddressClient.create()) { * AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - * Operation response = addressClient.deleteAddress(address); + * String requestId = ""; + * Operation response = addressClient.deleteAddress(address, requestId); * } * *
@@ -309,19 +310,26 @@ public final UnaryCallable * try (AddressClient addressClient = AddressClient.create()) { * AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - * Operation response = addressClient.deleteAddress(address); + * String requestId = ""; + * Operation response = addressClient.deleteAddress(address, requestId); * } *
* * @param address Name of the address resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAddress(AddressName address) { + public final Operation deleteAddress(AddressName address, String requestId) { DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder() .setAddress(address == null ? null : address.toString()) + .setRequestId(requestId) .build(); return deleteAddress(request); } @@ -334,19 +342,26 @@ public final Operation deleteAddress(AddressName address) { *

    * try (AddressClient addressClient = AddressClient.create()) {
    *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
-   *   Operation response = addressClient.deleteAddress(address.toString());
+   *   String requestId = "";
+   *   Operation response = addressClient.deleteAddress(address.toString(), requestId);
    * }
    * 
* * @param address Name of the address resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAddress(String address) { + public final Operation deleteAddress(String address, String requestId) { DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder() .setAddress(address) + .setRequestId(requestId) .build(); return deleteAddress(request); } @@ -359,8 +374,10 @@ public final Operation deleteAddress(String address) { *

    * try (AddressClient addressClient = AddressClient.create()) {
    *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   String requestId = "";
    *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = addressClient.deleteAddress(request);
    * }
@@ -382,8 +399,10 @@ public final Operation deleteAddress(DeleteAddressHttpRequest request) {
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
    *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   String requestId = "";
    *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = addressClient.deleteAddressCallable().futureCall(request);
    *   // Do something
@@ -498,21 +517,28 @@ public final UnaryCallable getAddressCallable()
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = addressClient.insertAddress(region, addressResource);
+   *   Operation response = addressClient.insertAddress(requestId, region, addressResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param addressResource A reserved address resource. + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAddress(RegionName region, Address addressResource) { + public final Operation insertAddress(String requestId, RegionName region, Address addressResource) { InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setAddressResource(addressResource) .build(); @@ -526,21 +552,28 @@ public final Operation insertAddress(RegionName region, Address addressResource) * Sample code: *

    * try (AddressClient addressClient = AddressClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = addressClient.insertAddress(region.toString(), addressResource);
+   *   Operation response = addressClient.insertAddress(requestId, region.toString(), addressResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param addressResource A reserved address resource. + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAddress(String region, Address addressResource) { + public final Operation insertAddress(String requestId, String region, Address addressResource) { InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region) .setAddressResource(addressResource) .build(); @@ -554,9 +587,11 @@ public final Operation insertAddress(String region, Address addressResource) { * Sample code: *

    * try (AddressClient addressClient = AddressClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAddressResource(addressResource)
    *     .build();
@@ -579,9 +614,11 @@ public final Operation insertAddress(InsertAddressHttpRequest request) {
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAddressResource(addressResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
index 475c0b8b97c4..e48fb1a16d62 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
@@ -37,6 +37,7 @@ public final class AddressList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private AddressList() {
     this.id = null;
@@ -44,6 +45,7 @@ private AddressList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private AddressList(
       List
items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(AddressList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(AddressList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public AddressList build() { + return new AddressList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java index 1363833e31cd..da59ddada873 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class AddressName implements ResourceName { +public final class AddressName implements com.google.api.resourcenames.ResourceName { private final String address; private final String project; private final String region; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java new file mode 100644 index 000000000000..326d0ae1242e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListAcceleratorTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListAcceleratorTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListAcceleratorTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListAcceleratorTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListAcceleratorTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListAcceleratorTypesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListAcceleratorTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListAcceleratorTypesHttpRequest other) { + if (other == AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListAcceleratorTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListAcceleratorTypesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListAcceleratorTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListAcceleratorTypesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListAcceleratorTypesHttpRequest) { + AggregatedListAcceleratorTypesHttpRequest that = (AggregatedListAcceleratorTypesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java index 233312cc74e5..2f889d325d2d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private AggregatedListDisksHttpRequest() { this.userIp = null; } + private AggregatedListDisksHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private AggregatedListDisksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(AggregatedListDisksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListDisksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final AggregatedListDisksHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new AggregatedListDisksHttpRequest(); } @@ -423,29 +426,40 @@ public Builder setUserIp(String userIp) { return this; } + public AggregatedListDisksHttpRequest build() { String missing = ""; + + + + + + + + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListDisksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "AggregatedListDisksHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -514,18 +505,20 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListDisksHttpRequest) { AggregatedListDisksHttpRequest that = (AggregatedListDisksHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -533,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java index bf09eaf8d2ed..1b11d1dae87e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private AggregatedListGlobalOperationsHttpRequest() { this.userIp = null; } + private AggregatedListGlobalOperationsHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private AggregatedListGlobalOperationsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(AggregatedListGlobalOperationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListGlobalOperationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final AggregatedListGlobalOperationsHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new AggregatedListGlobalOperationsHttpRequest(); } @@ -423,29 +426,40 @@ public Builder setUserIp(String userIp) { return this; } + public AggregatedListGlobalOperationsHttpRequest build() { String missing = ""; + + + + + + + + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListGlobalOperationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "AggregatedListGlobalOperationsHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -513,20 +504,21 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListGlobalOperationsHttpRequest) { - AggregatedListGlobalOperationsHttpRequest that = - (AggregatedListGlobalOperationsHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + AggregatedListGlobalOperationsHttpRequest that = (AggregatedListGlobalOperationsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -534,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java index 856200d39650..83725fe87875 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private AggregatedListInstanceGroupManagersHttpRequest() { this.userIp = null; } + private AggregatedListInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private AggregatedListInstanceGroupManagersHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(AggregatedListInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final AggregatedListInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new AggregatedListInstanceGroupManagersHttpRequest(); } @@ -423,29 +426,40 @@ public Builder setUserIp(String userIp) { return this; } + public AggregatedListInstanceGroupManagersHttpRequest build() { String missing = ""; + + + + + + + + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "AggregatedListInstanceGroupManagersHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -513,20 +504,21 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListInstanceGroupManagersHttpRequest) { - AggregatedListInstanceGroupManagersHttpRequest that = - (AggregatedListInstanceGroupManagersHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + AggregatedListInstanceGroupManagersHttpRequest that = (AggregatedListInstanceGroupManagersHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -534,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java new file mode 100644 index 000000000000..789d72277abf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListInterconnectAttachmentsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListInterconnectAttachmentsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListInterconnectAttachmentsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListInterconnectAttachmentsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListInterconnectAttachmentsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListInterconnectAttachmentsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListInterconnectAttachmentsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListInterconnectAttachmentsHttpRequest other) { + if (other == AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListInterconnectAttachmentsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListInterconnectAttachmentsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListInterconnectAttachmentsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListInterconnectAttachmentsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListInterconnectAttachmentsHttpRequest) { + AggregatedListInterconnectAttachmentsHttpRequest that = (AggregatedListInterconnectAttachmentsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java new file mode 100644 index 000000000000..3a526dadcc95 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AggregatedListRegionCommitmentsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private AggregatedListRegionCommitmentsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private AggregatedListRegionCommitmentsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AggregatedListRegionCommitmentsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AggregatedListRegionCommitmentsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AggregatedListRegionCommitmentsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AggregatedListRegionCommitmentsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(AggregatedListRegionCommitmentsHttpRequest other) { + if (other == AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(AggregatedListRegionCommitmentsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public AggregatedListRegionCommitmentsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new AggregatedListRegionCommitmentsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "AggregatedListRegionCommitmentsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AggregatedListRegionCommitmentsHttpRequest) { + AggregatedListRegionCommitmentsHttpRequest that = (AggregatedListRegionCommitmentsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java new file mode 100644 index 000000000000..4b6098009405 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AliasIpRange implements ApiMessage { + private final String ipCidrRange; + private final String subnetworkRangeName; + + private AliasIpRange() { + this.ipCidrRange = null; + this.subnetworkRangeName = null; + } + + + private AliasIpRange( + String ipCidrRange, + String subnetworkRangeName + ) { + this.ipCidrRange = ipCidrRange; + this.subnetworkRangeName = subnetworkRangeName; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); + } + if (fieldNames.contains("subnetworkRangeName") && subnetworkRangeName != null) { + fieldMap.put("subnetworkRangeName", Collections.singletonList(String.valueOf(subnetworkRangeName))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } + if (fieldName.equals("subnetworkRangeName")) { + return String.valueOf(subnetworkRangeName); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public String getSubnetworkRangeName() { + return subnetworkRangeName; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AliasIpRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AliasIpRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AliasIpRange DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AliasIpRange(); + } + + public static class Builder { + private String ipCidrRange; + private String subnetworkRangeName; + + Builder() {} + + public Builder mergeFrom(AliasIpRange other) { + if (other == AliasIpRange.getDefaultInstance()) return this; + if (other.getIpCidrRange() != null) { + this.ipCidrRange = other.ipCidrRange; + } + if (other.getSubnetworkRangeName() != null) { + this.subnetworkRangeName = other.subnetworkRangeName; + } + return this; + } + + Builder(AliasIpRange source) { + this.ipCidrRange = source.ipCidrRange; + this.subnetworkRangeName = source.subnetworkRangeName; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public Builder setIpCidrRange(String ipCidrRange) { + this.ipCidrRange = ipCidrRange; + return this; + } + + public String getSubnetworkRangeName() { + return subnetworkRangeName; + } + + public Builder setSubnetworkRangeName(String subnetworkRangeName) { + this.subnetworkRangeName = subnetworkRangeName; + return this; + } + + + public AliasIpRange build() { + + return new AliasIpRange( + ipCidrRange, + subnetworkRangeName + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIpCidrRange(this.ipCidrRange); + newBuilder.setSubnetworkRangeName(this.subnetworkRangeName); + return newBuilder; + } + } + + @Override + public String toString() { + return "AliasIpRange{" + + "ipCidrRange=" + ipCidrRange + ", " + + "subnetworkRangeName=" + subnetworkRangeName + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AliasIpRange) { + AliasIpRange that = (AliasIpRange) o; + return + Objects.equals(this.ipCidrRange, that.getIpCidrRange()) && + Objects.equals(this.subnetworkRangeName, that.getSubnetworkRangeName()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + ipCidrRange, + subnetworkRangeName + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index 82b16d9edd37..a9a7769635b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -40,6 +40,7 @@ public final class AttachDiskInstanceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private AttachDiskInstanceHttpRequest() { @@ -51,6 +52,7 @@ private AttachDiskInstanceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private AttachDiskInstanceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private AttachDiskInstanceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(AttachDiskInstanceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(AttachDiskInstanceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public AttachDiskInstanceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public AttachDiskInstanceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java index 7ec7b6edcfc4..44f45f3d6360 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java @@ -36,6 +36,7 @@ public final class AttachedDisk implements ApiMessage { private final Boolean boot; private final String deviceName; private final CustomerEncryptionKey diskEncryptionKey; + private final List guestOsFeatures; private final Integer index; private final AttachedDiskInitializeParams initializeParams; private final String interface2; @@ -50,6 +51,7 @@ private AttachedDisk() { this.boot = null; this.deviceName = null; this.diskEncryptionKey = null; + this.guestOsFeatures = null; this.index = null; this.initializeParams = null; this.interface2 = null; @@ -66,6 +68,7 @@ private AttachedDisk( Boolean boot, String deviceName, CustomerEncryptionKey diskEncryptionKey, + List guestOsFeatures, Integer index, AttachedDiskInitializeParams initializeParams, String interface2, @@ -79,6 +82,7 @@ private AttachedDisk( this.boot = boot; this.deviceName = deviceName; this.diskEncryptionKey = diskEncryptionKey; + this.guestOsFeatures = guestOsFeatures; this.index = index; this.initializeParams = initializeParams; this.interface2 = interface2; @@ -104,6 +108,13 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); } + if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (GuestOsFeature item : guestOsFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("guestOsFeatures", stringList.build()); + } if (fieldNames.contains("index") && index != null) { fieldMap.put("index", Collections.singletonList(String.valueOf(index))); } @@ -149,6 +160,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("diskEncryptionKey")) { return String.valueOf(diskEncryptionKey); } + if (fieldName.equals("guestOsFeatures")) { + return String.valueOf(guestOsFeatures); + } if (fieldName.equals("index")) { return String.valueOf(index); } @@ -198,6 +212,10 @@ public CustomerEncryptionKey getDiskEncryptionKey() { return diskEncryptionKey; } + public List getGuestOsFeaturesList() { + return guestOsFeatures; + } + public Integer getIndex() { return index; } @@ -255,6 +273,7 @@ public static class Builder { private Boolean boot; private String deviceName; private CustomerEncryptionKey diskEncryptionKey; + private List guestOsFeatures; private Integer index; private AttachedDiskInitializeParams initializeParams; private String interface2; @@ -280,6 +299,9 @@ public Builder mergeFrom(AttachedDisk other) { if (other.getDiskEncryptionKey() != null) { this.diskEncryptionKey = other.diskEncryptionKey; } + if (other.getGuestOsFeaturesList() != null) { + this.guestOsFeatures = other.guestOsFeatures; + } if (other.getIndex() != null) { this.index = other.index; } @@ -312,6 +334,7 @@ public Builder mergeFrom(AttachedDisk other) { this.boot = source.boot; this.deviceName = source.deviceName; this.diskEncryptionKey = source.diskEncryptionKey; + this.guestOsFeatures = source.guestOsFeatures; this.index = source.index; this.initializeParams = source.initializeParams; this.interface2 = source.interface2; @@ -358,6 +381,23 @@ public Builder setDiskEncryptionKey(CustomerEncryptionKey diskEncryptionKey) { return this; } + public List getGuestOsFeaturesList() { + return guestOsFeatures; + } + + public Builder addAllGuestOsFeatures(List guestOsFeatures) { + if (this.guestOsFeatures == null) { + this.guestOsFeatures = new ArrayList<>(guestOsFeatures.size()); + } + this.guestOsFeatures.addAll(guestOsFeatures); + return this; + } + + public Builder addGuestOsFeatures(GuestOsFeature guestOsFeatures) { + this.guestOsFeatures.add(guestOsFeatures); + return this; + } + public Integer getIndex() { return index; } @@ -451,11 +491,13 @@ public AttachedDisk build() { + return new AttachedDisk( autoDelete, boot, deviceName, diskEncryptionKey, + guestOsFeatures, index, initializeParams, interface2, @@ -473,6 +515,7 @@ public Builder clone() { newBuilder.setBoot(this.boot); newBuilder.setDeviceName(this.deviceName); newBuilder.setDiskEncryptionKey(this.diskEncryptionKey); + newBuilder.addAllGuestOsFeatures(this.guestOsFeatures); newBuilder.setIndex(this.index); newBuilder.setInitializeParams(this.initializeParams); newBuilder.setInterface(this.interface2); @@ -492,6 +535,7 @@ public String toString() { + "boot=" + boot + ", " + "deviceName=" + deviceName + ", " + "diskEncryptionKey=" + diskEncryptionKey + ", " + + "guestOsFeatures=" + guestOsFeatures + ", " + "index=" + index + ", " + "initializeParams=" + initializeParams + ", " + "interface2=" + interface2 + ", " @@ -515,6 +559,7 @@ public boolean equals(Object o) { Objects.equals(this.boot, that.getBoot()) && Objects.equals(this.deviceName, that.getDeviceName()) && Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && + Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) && Objects.equals(this.index, that.getIndex()) && Objects.equals(this.initializeParams, that.getInitializeParams()) && Objects.equals(this.interface2, that.getInterface()) && @@ -535,6 +580,7 @@ public int hashCode() { boot, deviceName, diskEncryptionKey, + guestOsFeatures, index, initializeParams, interface2, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java index c534e12dffdd..3ce07fdc702c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java @@ -35,6 +35,7 @@ public final class AttachedDiskInitializeParams implements ApiMessage { private final String diskName; private final String diskSizeGb; private final String diskType; + private final Map labels; private final String sourceImage; private final CustomerEncryptionKey sourceImageEncryptionKey; @@ -42,6 +43,7 @@ private AttachedDiskInitializeParams() { this.diskName = null; this.diskSizeGb = null; this.diskType = null; + this.labels = null; this.sourceImage = null; this.sourceImageEncryptionKey = null; } @@ -51,12 +53,14 @@ private AttachedDiskInitializeParams( String diskName, String diskSizeGb, String diskType, + Map labels, String sourceImage, CustomerEncryptionKey sourceImageEncryptionKey ) { this.diskName = diskName; this.diskSizeGb = diskSizeGb; this.diskType = diskType; + this.labels = labels; this.sourceImage = sourceImage; this.sourceImageEncryptionKey = sourceImageEncryptionKey; } @@ -73,6 +77,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("diskType") && diskType != null) { fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } if (fieldNames.contains("sourceImage") && sourceImage != null) { fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); } @@ -93,6 +100,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("diskType")) { return String.valueOf(diskType); } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } if (fieldName.equals("sourceImage")) { return String.valueOf(sourceImage); } @@ -120,6 +130,10 @@ public String getDiskType() { return diskType; } + public Map getLabelsMap() { + return labels; + } + public String getSourceImage() { return sourceImage; } @@ -152,6 +166,7 @@ public static class Builder { private String diskName; private String diskSizeGb; private String diskType; + private Map labels; private String sourceImage; private CustomerEncryptionKey sourceImageEncryptionKey; @@ -168,6 +183,9 @@ public Builder mergeFrom(AttachedDiskInitializeParams other) { if (other.getDiskType() != null) { this.diskType = other.diskType; } + if (other.getLabelsMap() != null) { + this.labels = other.labels; + } if (other.getSourceImage() != null) { this.sourceImage = other.sourceImage; } @@ -181,6 +199,7 @@ public Builder mergeFrom(AttachedDiskInitializeParams other) { this.diskName = source.diskName; this.diskSizeGb = source.diskSizeGb; this.diskType = source.diskType; + this.labels = source.labels; this.sourceImage = source.sourceImage; this.sourceImageEncryptionKey = source.sourceImageEncryptionKey; } @@ -212,6 +231,15 @@ public Builder setDiskType(String diskType) { return this; } + public Map getLabelsMap() { + return labels; + } + + public Builder putAllLabels(Map labels) { + this.labels = labels; + return this; + } + public String getSourceImage() { return sourceImage; } @@ -236,10 +264,12 @@ public AttachedDiskInitializeParams build() { + return new AttachedDiskInitializeParams( diskName, diskSizeGb, diskType, + labels, sourceImage, sourceImageEncryptionKey ); @@ -250,6 +280,7 @@ public Builder clone() { newBuilder.setDiskName(this.diskName); newBuilder.setDiskSizeGb(this.diskSizeGb); newBuilder.setDiskType(this.diskType); + newBuilder.putAllLabels(this.labels); newBuilder.setSourceImage(this.sourceImage); newBuilder.setSourceImageEncryptionKey(this.sourceImageEncryptionKey); return newBuilder; @@ -262,6 +293,7 @@ public String toString() { + "diskName=" + diskName + ", " + "diskSizeGb=" + diskSizeGb + ", " + "diskType=" + diskType + ", " + + "labels=" + labels + ", " + "sourceImage=" + sourceImage + ", " + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + "}"; @@ -278,6 +310,7 @@ public boolean equals(Object o) { Objects.equals(this.diskName, that.getDiskName()) && Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && Objects.equals(this.diskType, that.getDiskType()) && + Objects.equals(this.labels, that.getLabelsMap()) && Objects.equals(this.sourceImage, that.getSourceImage()) && Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) ; @@ -291,6 +324,7 @@ public int hashCode() { diskName, diskSizeGb, diskType, + labels, sourceImage, sourceImageEncryptionKey ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java index 484938836206..27214ce4436f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java @@ -40,6 +40,8 @@ public final class Autoscaler implements ApiMessage { private final String name; private final String region; private final String selfLink; + private final String status; + private final List statusDetails; private final String target; private final String zone; @@ -52,6 +54,8 @@ private Autoscaler() { this.name = null; this.region = null; this.selfLink = null; + this.status = null; + this.statusDetails = null; this.target = null; this.zone = null; } @@ -66,6 +70,8 @@ private Autoscaler( String name, String region, String selfLink, + String status, + List statusDetails, String target, String zone ) { @@ -77,6 +83,8 @@ private Autoscaler( this.name = name; this.region = region; this.selfLink = selfLink; + this.status = status; + this.statusDetails = statusDetails; this.target = target; this.zone = zone; } @@ -108,6 +116,16 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusDetails") && statusDetails != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AutoscalerStatusDetails item : statusDetails) { + stringList.add(item.toString()); + } + fieldMap.put("statusDetails", stringList.build()); + } if (fieldNames.contains("target") && target != null) { fieldMap.put("target", Collections.singletonList(String.valueOf(target))); } @@ -143,6 +161,12 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("status")) { + return String.valueOf(status); + } + if (fieldName.equals("statusDetails")) { + return String.valueOf(statusDetails); + } if (fieldName.equals("target")) { return String.valueOf(target); } @@ -190,6 +214,14 @@ public String getSelfLink() { return selfLink; } + public String getStatus() { + return status; + } + + public List getStatusDetailsList() { + return statusDetails; + } + public String getTarget() { return target; } @@ -227,6 +259,8 @@ public static class Builder { private String name; private String region; private String selfLink; + private String status; + private List statusDetails; private String target; private String zone; @@ -258,6 +292,12 @@ public Builder mergeFrom(Autoscaler other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getStatusDetailsList() != null) { + this.statusDetails = other.statusDetails; + } if (other.getTarget() != null) { this.target = other.target; } @@ -276,6 +316,8 @@ public Builder mergeFrom(Autoscaler other) { this.name = source.name; this.region = source.region; this.selfLink = source.selfLink; + this.status = source.status; + this.statusDetails = source.statusDetails; this.target = source.target; this.zone = source.zone; } @@ -352,6 +394,32 @@ public Builder setSelfLink(String selfLink) { return this; } + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public List getStatusDetailsList() { + return statusDetails; + } + + public Builder addAllStatusDetails(List statusDetails) { + if (this.statusDetails == null) { + this.statusDetails = new ArrayList<>(statusDetails.size()); + } + this.statusDetails.addAll(statusDetails); + return this; + } + + public Builder addStatusDetails(AutoscalerStatusDetails statusDetails) { + this.statusDetails.add(statusDetails); + return this; + } + public String getTarget() { return target; } @@ -381,6 +449,8 @@ public Autoscaler build() { + + return new Autoscaler( autoscalingPolicy, creationTimestamp, @@ -390,6 +460,8 @@ public Autoscaler build() { name, region, selfLink, + status, + statusDetails, target, zone ); @@ -405,6 +477,8 @@ public Builder clone() { newBuilder.setName(this.name); newBuilder.setRegion(this.region); newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); + newBuilder.addAllStatusDetails(this.statusDetails); newBuilder.setTarget(this.target); newBuilder.setZone(this.zone); return newBuilder; @@ -422,6 +496,8 @@ public String toString() { + "name=" + name + ", " + "region=" + region + ", " + "selfLink=" + selfLink + ", " + + "status=" + status + ", " + + "statusDetails=" + statusDetails + ", " + "target=" + target + ", " + "zone=" + zone + "}"; @@ -443,6 +519,8 @@ public boolean equals(Object o) { Objects.equals(this.name, that.getName()) && Objects.equals(this.region, that.getRegion()) && Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.status, that.getStatus()) && + Objects.equals(this.statusDetails, that.getStatusDetailsList()) && Objects.equals(this.target, that.getTarget()) && Objects.equals(this.zone, that.getZone()) ; @@ -461,6 +539,8 @@ public int hashCode() { name, region, selfLink, + status, + statusDetails, target, zone ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java index fd8158b741ea..6f5827f70c72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java @@ -37,6 +37,7 @@ public final class AutoscalerAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private AutoscalerAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private AutoscalerAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private AutoscalerAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(AutoscalerAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(AutoscalerAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public AutoscalerAggregatedList build() { + return new AutoscalerAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java index f101dcba980e..9a4b6e40e201 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java @@ -53,7 +53,8 @@ * * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - * Operation response = autoscalerClient.deleteAutoscaler(autoscaler); + * String requestId = ""; + * Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId); * } * *
@@ -309,19 +310,26 @@ public final UnaryCallable * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - * Operation response = autoscalerClient.deleteAutoscaler(autoscaler); + * String requestId = ""; + * Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId); * } *
* * @param autoscaler Name of the autoscaler to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAutoscaler(AutoscalerName autoscaler) { + public final Operation deleteAutoscaler(AutoscalerName autoscaler, String requestId) { DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .setRequestId(requestId) .build(); return deleteAutoscaler(request); } @@ -334,19 +342,26 @@ public final Operation deleteAutoscaler(AutoscalerName autoscaler) { *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
-   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString());
+   *   String requestId = "";
+   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString(), requestId);
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAutoscaler(String autoscaler) { + public final Operation deleteAutoscaler(String autoscaler, String requestId) { DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) + .setRequestId(requestId) .build(); return deleteAutoscaler(request); } @@ -359,8 +374,10 @@ public final Operation deleteAutoscaler(String autoscaler) { *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   String requestId = "";
    *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = autoscalerClient.deleteAutoscaler(request);
    * }
@@ -382,8 +399,10 @@ public final Operation deleteAutoscaler(DeleteAutoscalerHttpRequest request) {
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   String requestId = "";
    *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = autoscalerClient.deleteAutoscalerCallable().futureCall(request);
    *   // Do something
@@ -499,21 +518,28 @@ public final UnaryCallable getAutoscalerCa
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.insertAutoscaler(zone, autoscalerResource);
+   *   Operation response = autoscalerClient.insertAutoscaler(zone, requestId, autoscalerResource);
    * }
    * 
* * @param zone Name of the zone for this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAutoscaler(ZoneName zone, Autoscaler autoscalerResource) { + public final Operation insertAutoscaler(ZoneName zone, String requestId, Autoscaler autoscalerResource) { InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return insertAutoscaler(request); @@ -527,21 +553,28 @@ public final Operation insertAutoscaler(ZoneName zone, Autoscaler autoscalerReso *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.insertAutoscaler(zone.toString(), autoscalerResource);
+   *   Operation response = autoscalerClient.insertAutoscaler(zone.toString(), requestId, autoscalerResource);
    * }
    * 
* * @param zone Name of the zone for this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAutoscaler(String zone, Autoscaler autoscalerResource) { + public final Operation insertAutoscaler(String zone, String requestId, Autoscaler autoscalerResource) { InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder() .setZone(zone) + .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return insertAutoscaler(request); @@ -555,9 +588,11 @@ public final Operation insertAutoscaler(String zone, Autoscaler autoscalerResour *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
    *   Operation response = autoscalerClient.insertAutoscaler(request);
@@ -580,9 +615,11 @@ public final Operation insertAutoscaler(InsertAutoscalerHttpRequest request) {
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
    *   ApiFuture<Operation> future = autoscalerClient.insertAutoscalerCallable().futureCall(request);
@@ -731,30 +768,37 @@ public final UnaryCallable listAutos
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, autoscalerResource);
+   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource);
    * }
    * 
* - * @param autoscaler Name of the autoscaler to update. + * @param autoscaler Name of the autoscaler to patch. * @param zone Name of the zone for this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchAutoscaler(String autoscaler, ZoneName zone, Autoscaler autoscalerResource) { + public final Operation patchAutoscaler(String autoscaler, ZoneName zone, String requestId, Autoscaler autoscalerResource) { PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return patchAutoscaler(request); @@ -762,30 +806,37 @@ public final Operation patchAutoscaler(String autoscaler, ZoneName zone, Autosca // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * 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: *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), autoscalerResource);
+   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), requestId, autoscalerResource);
    * }
    * 
* - * @param autoscaler Name of the autoscaler to update. + * @param autoscaler Name of the autoscaler to patch. * @param zone Name of the zone for this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchAutoscaler(String autoscaler, String zone, Autoscaler autoscalerResource) { + public final Operation patchAutoscaler(String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone) + .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return patchAutoscaler(request); @@ -793,17 +844,19 @@ public final Operation patchAutoscaler(String autoscaler, String zone, Autoscale // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. + * 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: *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
    *   Operation response = autoscalerClient.patchAutoscaler(request);
@@ -820,17 +873,19 @@ public final Operation patchAutoscaler(PatchAutoscalerHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
    *   ApiFuture<Operation> future = autoscalerClient.patchAutoscalerCallable().futureCall(request);
@@ -853,23 +908,30 @@ public final UnaryCallable patchAutoscale
    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, autoscalerResource);
+   *   Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to update. * @param zone Name of the zone for this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateAutoscaler(String autoscaler, ZoneName zone, Autoscaler autoscalerResource) { + public final Operation updateAutoscaler(String autoscaler, ZoneName zone, String requestId, Autoscaler autoscalerResource) { UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return updateAutoscaler(request); @@ -884,23 +946,30 @@ public final Operation updateAutoscaler(String autoscaler, ZoneName zone, Autosc * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), autoscalerResource); + * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), requestId, autoscalerResource); * } *
* * @param autoscaler Name of the autoscaler to update. * @param zone Name of the zone for this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateAutoscaler(String autoscaler, String zone, Autoscaler autoscalerResource) { + public final Operation updateAutoscaler(String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone) + .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return updateAutoscaler(request); @@ -915,10 +984,12 @@ public final Operation updateAutoscaler(String autoscaler, String zone, Autoscal * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); * UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() * .setAutoscaler(autoscaler) * .setZone(zone.toString()) + * .setRequestId(requestId) * .setAutoscalerResource(autoscalerResource) * .build(); * Operation response = autoscalerClient.updateAutoscaler(request); @@ -942,10 +1013,12 @@ public final Operation updateAutoscaler(UpdateAutoscalerHttpRequest request) { * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); * UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() * .setAutoscaler(autoscaler) * .setZone(zone.toString()) + * .setRequestId(requestId) * .setAutoscalerResource(autoscalerResource) * .build(); * ApiFuture<Operation> future = autoscalerClient.updateAutoscalerCallable().futureCall(request); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java index 555071e276f0..5b660006bd91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java @@ -37,6 +37,7 @@ public final class AutoscalerList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private AutoscalerList() { this.id = null; @@ -44,6 +45,7 @@ private AutoscalerList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private AutoscalerList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(AutoscalerList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(AutoscalerList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public AutoscalerList build() { + return new AutoscalerList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java index 4382c2035ec1..7fe59dd1e221 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class AutoscalerName implements ResourceName { +public final class AutoscalerName implements com.google.api.resourcenames.ResourceName { private final String autoscaler; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java new file mode 100644 index 000000000000..1465230b2a49 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class AutoscalerStatusDetails implements ApiMessage { + private final String message; + private final String type; + + private AutoscalerStatusDetails() { + this.message = null; + this.type = null; + } + + + private AutoscalerStatusDetails( + String message, + String type + ) { + this.message = message; + this.type = type; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("message")) { + return String.valueOf(message); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getMessage() { + return message; + } + + public String getType() { + return type; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AutoscalerStatusDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static AutoscalerStatusDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final AutoscalerStatusDetails DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AutoscalerStatusDetails(); + } + + public static class Builder { + private String message; + private String type; + + Builder() {} + + public Builder mergeFrom(AutoscalerStatusDetails other) { + if (other == AutoscalerStatusDetails.getDefaultInstance()) return this; + if (other.getMessage() != null) { + this.message = other.message; + } + if (other.getType() != null) { + this.type = other.type; + } + return this; + } + + Builder(AutoscalerStatusDetails source) { + this.message = source.message; + this.type = source.type; + } + + public String getMessage() { + return message; + } + + public Builder setMessage(String message) { + this.message = message; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + + public AutoscalerStatusDetails build() { + + return new AutoscalerStatusDetails( + message, + type + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setMessage(this.message); + newBuilder.setType(this.type); + return newBuilder; + } + } + + @Override + public String toString() { + return "AutoscalerStatusDetails{" + + "message=" + message + ", " + + "type=" + type + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AutoscalerStatusDetails) { + AutoscalerStatusDetails that = (AutoscalerStatusDetails) o; + return + Objects.equals(this.message, that.getMessage()) && + Objects.equals(this.type, that.getType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + message, + type + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java new file mode 100644 index 000000000000..a078a3f4acef --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java @@ -0,0 +1,400 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendBucket implements ApiMessage { + private final String bucketName; + private final String creationTimestamp; + private final String description; + private final Boolean enableCdn; + private final String id; + private final String kind; + private final String name; + private final String selfLink; + + private BackendBucket() { + this.bucketName = null; + this.creationTimestamp = null; + this.description = null; + this.enableCdn = null; + this.id = null; + this.kind = null; + this.name = null; + this.selfLink = null; + } + + + private BackendBucket( + String bucketName, + String creationTimestamp, + String description, + Boolean enableCdn, + String id, + String kind, + String name, + String selfLink + ) { + this.bucketName = bucketName; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.enableCdn = enableCdn; + this.id = id; + this.kind = kind; + this.name = name; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bucketName") && bucketName != null) { + fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enableCdn") && enableCdn != null) { + fieldMap.put("enableCdn", Collections.singletonList(String.valueOf(enableCdn))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("bucketName")) { + return String.valueOf(bucketName); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("enableCdn")) { + return String.valueOf(enableCdn); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getBucketName() { + return bucketName; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Boolean getEnableCdn() { + return enableCdn; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendBucket prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendBucket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendBucket DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendBucket(); + } + + public static class Builder { + private String bucketName; + private String creationTimestamp; + private String description; + private Boolean enableCdn; + private String id; + private String kind; + private String name; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(BackendBucket other) { + if (other == BackendBucket.getDefaultInstance()) return this; + if (other.getBucketName() != null) { + this.bucketName = other.bucketName; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getEnableCdn() != null) { + this.enableCdn = other.enableCdn; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(BackendBucket source) { + this.bucketName = source.bucketName; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.enableCdn = source.enableCdn; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.selfLink = source.selfLink; + } + + public String getBucketName() { + return bucketName; + } + + public Builder setBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Boolean getEnableCdn() { + return enableCdn; + } + + public Builder setEnableCdn(Boolean enableCdn) { + this.enableCdn = enableCdn; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public BackendBucket build() { + + + + + + + + return new BackendBucket( + bucketName, + creationTimestamp, + description, + enableCdn, + id, + kind, + name, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setBucketName(this.bucketName); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setEnableCdn(this.enableCdn); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendBucket{" + + "bucketName=" + bucketName + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "enableCdn=" + enableCdn + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendBucket) { + BackendBucket that = (BackendBucket) o; + return + Objects.equals(this.bucketName, that.getBucketName()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.enableCdn, that.getEnableCdn()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + bucketName, + creationTimestamp, + description, + enableCdn, + id, + kind, + name, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java new file mode 100644 index 000000000000..a07f250661cd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java @@ -0,0 +1,999 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.BackendBucketStub; +import com.google.cloud.compute.v1.stub.BackendBucketStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+ *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+ *   String requestId = "";
+ *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the backendBucketClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of BackendBucketSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * BackendBucketSettings backendBucketSettings =
+ *     BackendBucketSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BackendBucketClient backendBucketClient =
+ *     BackendBucketClient.create(backendBucketSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * BackendBucketSettings backendBucketSettings =
+ *     BackendBucketSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BackendBucketClient backendBucketClient =
+ *     BackendBucketClient.create(backendBucketSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class BackendBucketClient implements BackgroundResource { + private final BackendBucketSettings settings; + private final BackendBucketStub stub; + + + + /** + * Constructs an instance of BackendBucketClient with default settings. + */ + public static final BackendBucketClient create() throws IOException { + return create(BackendBucketSettings.newBuilder().build()); + } + + /** + * Constructs an instance of BackendBucketClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final BackendBucketClient create(BackendBucketSettings settings) throws IOException { + return new BackendBucketClient(settings); + } + + /** + * Constructs an instance of BackendBucketClient, using the given stub for making calls. This is for + * advanced usage - prefer to use BackendBucketSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final BackendBucketClient create(BackendBucketStub stub) { + return new BackendBucketClient(stub); + } + + /** + * Constructs an instance of BackendBucketClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected BackendBucketClient(BackendBucketSettings settings) throws IOException { + this.settings = settings; + this.stub = ((BackendBucketStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected BackendBucketClient(BackendBucketStub stub) { + this.settings = null; + this.stub = stub; + } + + public final BackendBucketSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BackendBucketStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendBucket resource. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteBackendBucket(BackendBucketName backendBucket, String requestId) { + + DeleteBackendBucketHttpRequest request = + DeleteBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setRequestId(requestId) + .build(); + return deleteBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendBucket resource. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket.toString(), requestId);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteBackendBucket(String backendBucket, String requestId) { + + DeleteBackendBucketHttpRequest request = + DeleteBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket) + .setRequestId(requestId) + .build(); + return deleteBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendBucket resource. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setRequestId(requestId)
+   *     .build();
+   *   Operation response = backendBucketClient.deleteBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest request) { + return deleteBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified BackendBucket resource. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setRequestId(requestId)
+   *     .build();
+   *   ApiFuture<Operation> future = backendBucketClient.deleteBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteBackendBucketCallable() { + return stub.deleteBackendBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   BackendBucket response = backendBucketClient.getBackendBucket(backendBucket);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendBucket getBackendBucket(BackendBucketName backendBucket) { + + GetBackendBucketHttpRequest request = + GetBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .build(); + return getBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   BackendBucket response = backendBucketClient.getBackendBucket(backendBucket.toString());
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendBucket getBackendBucket(String backendBucket) { + + GetBackendBucketHttpRequest request = + GetBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket) + .build(); + return getBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .build();
+   *   BackendBucket response = backendBucketClient.getBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request) { + return getBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .build();
+   *   ApiFuture<BackendBucket> future = backendBucketClient.getBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   BackendBucket response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getBackendBucketCallable() { + return stub.getBackendBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   Operation response = backendBucketClient.insertBackendBucket(requestId, project, backendBucketResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertBackendBucket(String requestId, ProjectName project, BackendBucket backendBucketResource) { + + InsertBackendBucketHttpRequest request = + InsertBackendBucketHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setBackendBucketResource(backendBucketResource) + .build(); + return insertBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   Operation response = backendBucketClient.insertBackendBucket(requestId, project.toString(), backendBucketResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertBackendBucket(String requestId, String project, BackendBucket backendBucketResource) { + + InsertBackendBucketHttpRequest request = + InsertBackendBucketHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setBackendBucketResource(backendBucketResource) + .build(); + return insertBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setBackendBucketResource(backendBucketResource)
+   *     .build();
+   *   Operation response = backendBucketClient.insertBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertBackendBucket(InsertBackendBucketHttpRequest request) { + return insertBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setBackendBucketResource(backendBucketResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendBucketClient.insertBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertBackendBucketCallable() { + return stub.insertBackendBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (BackendBucket element : backendBucketClient.listBackendBuckets(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListBackendBucketsPagedResponse listBackendBuckets(ProjectName project) { + ListBackendBucketsHttpRequest request = + ListBackendBucketsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listBackendBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (BackendBucket element : backendBucketClient.listBackendBuckets(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListBackendBucketsPagedResponse listBackendBuckets(String project) { + ListBackendBucketsHttpRequest request = + ListBackendBucketsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listBackendBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListBackendBucketsHttpRequest request = ListBackendBucketsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (BackendBucket element : backendBucketClient.listBackendBuckets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListBackendBucketsPagedResponse listBackendBuckets(ListBackendBucketsHttpRequest request) { + return listBackendBucketsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListBackendBucketsHttpRequest request = ListBackendBucketsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListBackendBucketsPagedResponse> future = backendBucketClient.listBackendBucketsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (BackendBucket element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listBackendBucketsPagedCallable() { + return stub.listBackendBucketsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListBackendBucketsHttpRequest request = ListBackendBucketsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     BackendBucketList response = backendBucketClient.listBackendBucketsCallable().call(request);
+   *     for (BackendBucket element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listBackendBucketsCallable() { + return stub.listBackendBucketsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   Operation response = backendBucketClient.patchBackendBucket(backendBucket, requestId, backendBucketResource);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchBackendBucket(BackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) { + + PatchBackendBucketHttpRequest request = + PatchBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); + return patchBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   Operation response = backendBucketClient.patchBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchBackendBucket(String backendBucket, String requestId, BackendBucket backendBucketResource) { + + PatchBackendBucketHttpRequest request = + PatchBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); + return patchBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setRequestId(requestId)
+   *     .setBackendBucketResource(backendBucketResource)
+   *     .build();
+   *   Operation response = backendBucketClient.patchBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchBackendBucket(PatchBackendBucketHttpRequest request) { + return patchBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setRequestId(requestId)
+   *     .setBackendBucketResource(backendBucketResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendBucketClient.patchBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchBackendBucketCallable() { + return stub.patchBackendBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendBucket resource with the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   Operation response = backendBucketClient.updateBackendBucket(backendBucket, requestId, backendBucketResource);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateBackendBucket(BackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) { + + UpdateBackendBucketHttpRequest request = + UpdateBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); + return updateBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendBucket resource with the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   Operation response = backendBucketClient.updateBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateBackendBucket(String backendBucket, String requestId, BackendBucket backendBucketResource) { + + UpdateBackendBucketHttpRequest request = + UpdateBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); + return updateBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendBucket resource with the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setRequestId(requestId)
+   *     .setBackendBucketResource(backendBucketResource)
+   *     .build();
+   *   Operation response = backendBucketClient.updateBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateBackendBucket(UpdateBackendBucketHttpRequest request) { + return updateBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified BackendBucket resource with the data included in the request. + * + * Sample code: + *

+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String requestId = "";
+   *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+   *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setRequestId(requestId)
+   *     .setBackendBucketResource(backendBucketResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendBucketClient.updateBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateBackendBucketCallable() { + return stub.updateBackendBucketCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListBackendBucketsPagedResponse extends AbstractPagedListResponse< + ListBackendBucketsHttpRequest, + BackendBucketList, + BackendBucket, + ListBackendBucketsPage, + ListBackendBucketsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackendBucketsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBackendBucketsPagedResponse apply(ListBackendBucketsPage input) { + return new ListBackendBucketsPagedResponse(input); + } + }); + } + + private ListBackendBucketsPagedResponse(ListBackendBucketsPage page) { + super(page, ListBackendBucketsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListBackendBucketsPage extends AbstractPage< + ListBackendBucketsHttpRequest, + BackendBucketList, + BackendBucket, + ListBackendBucketsPage> { + + private ListBackendBucketsPage( + PageContext context, + BackendBucketList response) { + super(context, response); + } + + private static ListBackendBucketsPage createEmptyPage() { + return new ListBackendBucketsPage(null, null); + } + + @Override + protected ListBackendBucketsPage createPage( + PageContext context, + BackendBucketList response) { + return new ListBackendBucketsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListBackendBucketsFixedSizeCollection extends AbstractFixedSizeCollection< + ListBackendBucketsHttpRequest, + BackendBucketList, + BackendBucket, + ListBackendBucketsPage, + ListBackendBucketsFixedSizeCollection> { + + private ListBackendBucketsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackendBucketsFixedSizeCollection createEmptyCollection() { + return new ListBackendBucketsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackendBucketsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackendBucketsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java new file mode 100644 index 000000000000..4e60355ce9fd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendBucketList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private BackendBucketList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private BackendBucketList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (BackendBucket item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendBucketList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendBucketList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendBucketList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendBucketList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(BackendBucketList other) { + if (other == BackendBucketList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(BackendBucketList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(BackendBucket items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public BackendBucketList build() { + + + + + + return new BackendBucketList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendBucketList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendBucketList) { + BackendBucketList that = (BackendBucketList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java new file mode 100644 index 000000000000..1fc90a134a30 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java @@ -0,0 +1,186 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class BackendBucketName implements com.google.api.resourcenames.ResourceName { + private final String backendBucket; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/backendBuckets/{backendBucket}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BackendBucketName(Builder builder) { + backendBucket = Preconditions.checkNotNull(builder.getBackendBucket()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static BackendBucketName of( + String backendBucket, + String project + ) { + return newBuilder() + .setBackendBucket(backendBucket) + .setProject(project) + .build(); + } + + public static String format( + String backendBucket, + String project + ) { + return of( + backendBucket, + project + ) + .toString(); + } + + public String getBackendBucket() { + return backendBucket; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("backendBucket", backendBucket); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public BackendBucketName parse(String formattedString) {return BackendBucketName.parse(formattedString);} + }; + } + + public static BackendBucketName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "BackendBucketName.parse: formattedString not in valid format"); + return of( + matchMap.get("backendBucket"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String backendBucket; + private String project; + + public String getBackendBucket() { + return backendBucket; + } + public String getProject() { + return project; + } + + public Builder setBackendBucket(String backendBucket) { + this.backendBucket = backendBucket; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (BackendBucketName backendBucketName) { + backendBucket = backendBucketName.backendBucket; + project = backendBucketName.project; + } + + public BackendBucketName build() { + return new BackendBucketName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "backendBucket", backendBucket, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendBucketName) { + BackendBucketName that = (BackendBucketName) o; + return + Objects.equals(this.backendBucket, that.getBackendBucket()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + backendBucket, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java new file mode 100644 index 000000000000..c88878f63c52 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import com.google.cloud.compute.v1.stub.BackendBucketStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link BackendBucketClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteBackendBucket to 30 seconds: + * + *

+ * 
+ * BackendBucketSettings.Builder backendBucketSettingsBuilder =
+ *     BackendBucketSettings.newBuilder();
+ * backendBucketSettingsBuilder.deleteBackendBucketSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * BackendBucketSettings backendBucketSettings = backendBucketSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class BackendBucketSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteBackendBucket. + */ + public UnaryCallSettings deleteBackendBucketSettings() { + return ((BackendBucketStubSettings) getStubSettings()).deleteBackendBucketSettings(); + } + + /** + * Returns the object with the settings used for calls to getBackendBucket. + */ + public UnaryCallSettings getBackendBucketSettings() { + return ((BackendBucketStubSettings) getStubSettings()).getBackendBucketSettings(); + } + + /** + * Returns the object with the settings used for calls to insertBackendBucket. + */ + public UnaryCallSettings insertBackendBucketSettings() { + return ((BackendBucketStubSettings) getStubSettings()).insertBackendBucketSettings(); + } + + /** + * Returns the object with the settings used for calls to listBackendBuckets. + */ + public PagedCallSettings listBackendBucketsSettings() { + return ((BackendBucketStubSettings) getStubSettings()).listBackendBucketsSettings(); + } + + /** + * Returns the object with the settings used for calls to patchBackendBucket. + */ + public UnaryCallSettings patchBackendBucketSettings() { + return ((BackendBucketStubSettings) getStubSettings()).patchBackendBucketSettings(); + } + + /** + * Returns the object with the settings used for calls to updateBackendBucket. + */ + public UnaryCallSettings updateBackendBucketSettings() { + return ((BackendBucketStubSettings) getStubSettings()).updateBackendBucketSettings(); + } + + + public static final BackendBucketSettings create(BackendBucketStubSettings stub) throws IOException { + return new BackendBucketSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return BackendBucketStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return BackendBucketStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return BackendBucketStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return BackendBucketStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BackendBucketStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return BackendBucketStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return BackendBucketStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BackendBucketStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BackendBucketSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for BackendBucketSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(BackendBucketStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(BackendBucketStubSettings.newBuilder()); + } + + protected Builder(BackendBucketSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(BackendBucketStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public BackendBucketStubSettings.Builder getStubSettingsBuilder() { + return ((BackendBucketStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteBackendBucket. + */ + public UnaryCallSettings.Builder deleteBackendBucketSettings() { + return getStubSettingsBuilder().deleteBackendBucketSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBackendBucket. + */ + public UnaryCallSettings.Builder getBackendBucketSettings() { + return getStubSettingsBuilder().getBackendBucketSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertBackendBucket. + */ + public UnaryCallSettings.Builder insertBackendBucketSettings() { + return getStubSettingsBuilder().insertBackendBucketSettings(); + } + + /** + * Returns the builder for the settings used for calls to listBackendBuckets. + */ + public PagedCallSettings.Builder listBackendBucketsSettings() { + return getStubSettingsBuilder().listBackendBucketsSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchBackendBucket. + */ + public UnaryCallSettings.Builder patchBackendBucketSettings() { + return getStubSettingsBuilder().patchBackendBucketSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateBackendBucket. + */ + public UnaryCallSettings.Builder updateBackendBucketSettings() { + return getStubSettingsBuilder().updateBackendBucketSettings(); + } + + @Override + public BackendBucketSettings build() throws IOException { + return new BackendBucketSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java index 51e9ed0294cd..eff88f318ee1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java @@ -34,12 +34,14 @@ public final class BackendService implements ApiMessage { private final Integer affinityCookieTtlSec; private final List backends; + private final BackendServiceCdnPolicy cdnPolicy; private final ConnectionDraining connectionDraining; private final String creationTimestamp; private final String description; private final Boolean enableCDN; private final String fingerprint; private final List healthChecks; + private final BackendServiceIAP iap; private final String id; private final String kind; private final String loadBalancingScheme; @@ -55,12 +57,14 @@ public final class BackendService implements ApiMessage { private BackendService() { this.affinityCookieTtlSec = null; this.backends = null; + this.cdnPolicy = null; this.connectionDraining = null; this.creationTimestamp = null; this.description = null; this.enableCDN = null; this.fingerprint = null; this.healthChecks = null; + this.iap = null; this.id = null; this.kind = null; this.loadBalancingScheme = null; @@ -78,12 +82,14 @@ private BackendService() { private BackendService( Integer affinityCookieTtlSec, List backends, + BackendServiceCdnPolicy cdnPolicy, ConnectionDraining connectionDraining, String creationTimestamp, String description, Boolean enableCDN, String fingerprint, List healthChecks, + BackendServiceIAP iap, String id, String kind, String loadBalancingScheme, @@ -98,12 +104,14 @@ private BackendService( ) { this.affinityCookieTtlSec = affinityCookieTtlSec; this.backends = backends; + this.cdnPolicy = cdnPolicy; this.connectionDraining = connectionDraining; this.creationTimestamp = creationTimestamp; this.description = description; this.enableCDN = enableCDN; this.fingerprint = fingerprint; this.healthChecks = healthChecks; + this.iap = iap; this.id = id; this.kind = kind; this.loadBalancingScheme = loadBalancingScheme; @@ -130,6 +138,9 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("backends", stringList.build()); } + if (fieldNames.contains("cdnPolicy") && cdnPolicy != null) { + fieldMap.put("cdnPolicy", Collections.singletonList(String.valueOf(cdnPolicy))); + } if (fieldNames.contains("connectionDraining") && connectionDraining != null) { fieldMap.put("connectionDraining", Collections.singletonList(String.valueOf(connectionDraining))); } @@ -152,6 +163,9 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("healthChecks", stringList.build()); } + if (fieldNames.contains("iap") && iap != null) { + fieldMap.put("iap", Collections.singletonList(String.valueOf(iap))); + } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); } @@ -196,6 +210,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("backends")) { return String.valueOf(backends); } + if (fieldName.equals("cdnPolicy")) { + return String.valueOf(cdnPolicy); + } if (fieldName.equals("connectionDraining")) { return String.valueOf(connectionDraining); } @@ -214,6 +231,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("healthChecks")) { return String.valueOf(healthChecks); } + if (fieldName.equals("iap")) { + return String.valueOf(iap); + } if (fieldName.equals("id")) { return String.valueOf(id); } @@ -264,6 +284,10 @@ public List getBackendsList() { return backends; } + public BackendServiceCdnPolicy getCdnPolicy() { + return cdnPolicy; + } + public ConnectionDraining getConnectionDraining() { return connectionDraining; } @@ -288,6 +312,10 @@ public List getHealthChecksList() { return healthChecks; } + public BackendServiceIAP getIap() { + return iap; + } + public String getId() { return id; } @@ -355,12 +383,14 @@ public static BackendService getDefaultInstance() { public static class Builder { private Integer affinityCookieTtlSec; private List backends; + private BackendServiceCdnPolicy cdnPolicy; private ConnectionDraining connectionDraining; private String creationTimestamp; private String description; private Boolean enableCDN; private String fingerprint; private List healthChecks; + private BackendServiceIAP iap; private String id; private String kind; private String loadBalancingScheme; @@ -383,6 +413,9 @@ public Builder mergeFrom(BackendService other) { if (other.getBackendsList() != null) { this.backends = other.backends; } + if (other.getCdnPolicy() != null) { + this.cdnPolicy = other.cdnPolicy; + } if (other.getConnectionDraining() != null) { this.connectionDraining = other.connectionDraining; } @@ -401,6 +434,9 @@ public Builder mergeFrom(BackendService other) { if (other.getHealthChecksList() != null) { this.healthChecks = other.healthChecks; } + if (other.getIap() != null) { + this.iap = other.iap; + } if (other.getId() != null) { this.id = other.id; } @@ -440,12 +476,14 @@ public Builder mergeFrom(BackendService other) { Builder(BackendService source) { this.affinityCookieTtlSec = source.affinityCookieTtlSec; this.backends = source.backends; + this.cdnPolicy = source.cdnPolicy; this.connectionDraining = source.connectionDraining; this.creationTimestamp = source.creationTimestamp; this.description = source.description; this.enableCDN = source.enableCDN; this.fingerprint = source.fingerprint; this.healthChecks = source.healthChecks; + this.iap = source.iap; this.id = source.id; this.kind = source.kind; this.loadBalancingScheme = source.loadBalancingScheme; @@ -485,6 +523,15 @@ public Builder addBackends(Backend backends) { return this; } + public BackendServiceCdnPolicy getCdnPolicy() { + return cdnPolicy; + } + + public Builder setCdnPolicy(BackendServiceCdnPolicy cdnPolicy) { + this.cdnPolicy = cdnPolicy; + return this; + } + public ConnectionDraining getConnectionDraining() { return connectionDraining; } @@ -547,6 +594,15 @@ public Builder addHealthChecks(String healthChecks) { return this; } + public BackendServiceIAP getIap() { + return iap; + } + + public Builder setIap(BackendServiceIAP iap) { + this.iap = iap; + return this; + } + public String getId() { return id; } @@ -666,15 +722,19 @@ public BackendService build() { + + return new BackendService( affinityCookieTtlSec, backends, + cdnPolicy, connectionDraining, creationTimestamp, description, enableCDN, fingerprint, healthChecks, + iap, id, kind, loadBalancingScheme, @@ -693,12 +753,14 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAffinityCookieTtlSec(this.affinityCookieTtlSec); newBuilder.addAllBackends(this.backends); + newBuilder.setCdnPolicy(this.cdnPolicy); newBuilder.setConnectionDraining(this.connectionDraining); newBuilder.setCreationTimestamp(this.creationTimestamp); newBuilder.setDescription(this.description); newBuilder.setEnableCDN(this.enableCDN); newBuilder.setFingerprint(this.fingerprint); newBuilder.addAllHealthChecks(this.healthChecks); + newBuilder.setIap(this.iap); newBuilder.setId(this.id); newBuilder.setKind(this.kind); newBuilder.setLoadBalancingScheme(this.loadBalancingScheme); @@ -719,12 +781,14 @@ public String toString() { return "BackendService{" + "affinityCookieTtlSec=" + affinityCookieTtlSec + ", " + "backends=" + backends + ", " + + "cdnPolicy=" + cdnPolicy + ", " + "connectionDraining=" + connectionDraining + ", " + "creationTimestamp=" + creationTimestamp + ", " + "description=" + description + ", " + "enableCDN=" + enableCDN + ", " + "fingerprint=" + fingerprint + ", " + "healthChecks=" + healthChecks + ", " + + "iap=" + iap + ", " + "id=" + id + ", " + "kind=" + kind + ", " + "loadBalancingScheme=" + loadBalancingScheme + ", " @@ -749,12 +813,14 @@ public boolean equals(Object o) { return Objects.equals(this.affinityCookieTtlSec, that.getAffinityCookieTtlSec()) && Objects.equals(this.backends, that.getBackendsList()) && + Objects.equals(this.cdnPolicy, that.getCdnPolicy()) && Objects.equals(this.connectionDraining, that.getConnectionDraining()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && Objects.equals(this.description, that.getDescription()) && Objects.equals(this.enableCDN, that.getEnableCDN()) && Objects.equals(this.fingerprint, that.getFingerprint()) && Objects.equals(this.healthChecks, that.getHealthChecksList()) && + Objects.equals(this.iap, that.getIap()) && Objects.equals(this.id, that.getId()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) && @@ -776,12 +842,14 @@ public int hashCode() { return Objects.hash( affinityCookieTtlSec, backends, + cdnPolicy, connectionDraining, creationTimestamp, description, enableCDN, fingerprint, healthChecks, + iap, id, kind, loadBalancingScheme, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java index fa5494788f2f..6151ad5637d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java @@ -37,6 +37,7 @@ public final class BackendServiceAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private BackendServiceAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private BackendServiceAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private BackendServiceAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(BackendServiceAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(BackendServiceAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public BackendServiceAggregatedList build() { + return new BackendServiceAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java new file mode 100644 index 000000000000..1f76f7aa094a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class BackendServiceCdnPolicy implements ApiMessage { + private final CacheKeyPolicy cacheKeyPolicy; + + private BackendServiceCdnPolicy() { + this.cacheKeyPolicy = null; + } + + + private BackendServiceCdnPolicy( + CacheKeyPolicy cacheKeyPolicy + ) { + this.cacheKeyPolicy = cacheKeyPolicy; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("cacheKeyPolicy") && cacheKeyPolicy != null) { + fieldMap.put("cacheKeyPolicy", Collections.singletonList(String.valueOf(cacheKeyPolicy))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("cacheKeyPolicy")) { + return String.valueOf(cacheKeyPolicy); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public CacheKeyPolicy getCacheKeyPolicy() { + return cacheKeyPolicy; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(BackendServiceCdnPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static BackendServiceCdnPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final BackendServiceCdnPolicy DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new BackendServiceCdnPolicy(); + } + + public static class Builder { + private CacheKeyPolicy cacheKeyPolicy; + + Builder() {} + + public Builder mergeFrom(BackendServiceCdnPolicy other) { + if (other == BackendServiceCdnPolicy.getDefaultInstance()) return this; + if (other.getCacheKeyPolicy() != null) { + this.cacheKeyPolicy = other.cacheKeyPolicy; + } + return this; + } + + Builder(BackendServiceCdnPolicy source) { + this.cacheKeyPolicy = source.cacheKeyPolicy; + } + + public CacheKeyPolicy getCacheKeyPolicy() { + return cacheKeyPolicy; + } + + public Builder setCacheKeyPolicy(CacheKeyPolicy cacheKeyPolicy) { + this.cacheKeyPolicy = cacheKeyPolicy; + return this; + } + + + public BackendServiceCdnPolicy build() { + return new BackendServiceCdnPolicy( + cacheKeyPolicy + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCacheKeyPolicy(this.cacheKeyPolicy); + return newBuilder; + } + } + + @Override + public String toString() { + return "BackendServiceCdnPolicy{" + + "cacheKeyPolicy=" + cacheKeyPolicy + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackendServiceCdnPolicy) { + BackendServiceCdnPolicy that = (BackendServiceCdnPolicy) o; + return + Objects.equals(this.cacheKeyPolicy, that.getCacheKeyPolicy()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + cacheKeyPolicy + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java index c8fd7e0d61f8..4861dfc65cc9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java @@ -52,8 +52,9 @@ *
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+ *   String requestId = "";
  *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
- *   Operation response = backendServiceClient.deleteBackendService(backendService);
+ *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
  * }
  * 
  * 
@@ -308,19 +309,26 @@ public final UnaryCallable * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) { + * String requestId = ""; * BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - * Operation response = backendServiceClient.deleteBackendService(backendService); + * Operation response = backendServiceClient.deleteBackendService(requestId, backendService); * } *
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendService(BackendServiceName backendService) { + public final Operation deleteBackendService(String requestId, BackendServiceName backendService) { DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .build(); return deleteBackendService(request); @@ -333,19 +341,26 @@ public final Operation deleteBackendService(BackendServiceName backendService) { * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
-   *   Operation response = backendServiceClient.deleteBackendService(backendService.toString());
+   *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendService(String backendService) { + public final Operation deleteBackendService(String requestId, String backendService) { DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService) .build(); return deleteBackendService(request); @@ -358,8 +373,10 @@ public final Operation deleteBackendService(String backendService) { * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   Operation response = backendServiceClient.deleteBackendService(request);
@@ -381,8 +398,10 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   ApiFuture<Operation> future = backendServiceClient.deleteBackendServiceCallable().futureCall(request);
@@ -603,21 +622,28 @@ public final UnaryCallable
    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.insertBackendService(project, backendServiceResource);
+   *   Operation response = backendServiceClient.insertBackendService(requestId, project, backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendService(ProjectName project, BackendService backendServiceResource) { + public final Operation insertBackendService(String requestId, ProjectName project, BackendService backendServiceResource) { InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -631,21 +657,28 @@ public final Operation insertBackendService(ProjectName project, BackendService * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.insertBackendService(project.toString(), backendServiceResource);
+   *   Operation response = backendServiceClient.insertBackendService(requestId, project.toString(), backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendService(String project, BackendService backendServiceResource) { + public final Operation insertBackendService(String requestId, String project, BackendService backendServiceResource) { InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setBackendServiceResource(backendServiceResource) .build(); @@ -659,9 +692,11 @@ public final Operation insertBackendService(String project, BackendService backe * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -684,9 +719,11 @@ public final Operation insertBackendService(InsertBackendServiceHttpRequest requ
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -836,26 +873,33 @@ public final UnaryCallable l
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports patch semantics.
+   * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
    *
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.patchBackendService(backendService, backendServiceResource);
+   *   Operation response = backendServiceClient.patchBackendService(requestId, backendService, backendServiceResource);
    * }
    * 
* - * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendService Name of the BackendService resource to patch. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchBackendService(BackendServiceName backendService, BackendService backendServiceResource) { + public final Operation patchBackendService(String requestId, BackendServiceName backendService, BackendService backendServiceResource) { PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -864,26 +908,33 @@ public final Operation patchBackendService(BackendServiceName backendService, Ba // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.patchBackendService(backendService.toString(), backendServiceResource);
+   *   Operation response = backendServiceClient.patchBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendService Name of the BackendService resource to patch. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchBackendService(String backendService, BackendService backendServiceResource) { + public final Operation patchBackendService(String requestId, String backendService, BackendService backendServiceResource) { PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -892,14 +943,16 @@ public final Operation patchBackendService(String backendService, BackendService // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -917,14 +970,16 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports patch semantics.
+   * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
    *
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -946,21 +1001,28 @@ public final UnaryCallable patchBacke
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.updateBackendService(backendService, backendServiceResource);
+   *   Operation response = backendServiceClient.updateBackendService(requestId, backendService, backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateBackendService(BackendServiceName backendService, BackendService backendServiceResource) { + public final Operation updateBackendService(String requestId, BackendServiceName backendService, BackendService backendServiceResource) { UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -974,21 +1036,28 @@ public final Operation updateBackendService(BackendServiceName backendService, B * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.updateBackendService(backendService.toString(), backendServiceResource);
+   *   Operation response = backendServiceClient.updateBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateBackendService(String backendService, BackendService backendServiceResource) { + public final Operation updateBackendService(String requestId, String backendService, BackendService backendServiceResource) { UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -1002,9 +1071,11 @@ public final Operation updateBackendService(String backendService, BackendServic * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -1027,9 +1098,11 @@ public final Operation updateBackendService(UpdateBackendServiceHttpRequest requ
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   String requestId = "";
    *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java
new file mode 100644
index 000000000000..013bf76fda03
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class BackendServiceIAP implements ApiMessage {
+  private final Boolean enabled;
+  private final String oauth2ClientId;
+  private final String oauth2ClientSecret;
+  private final String oauth2ClientSecretSha256;
+
+  private BackendServiceIAP() {
+    this.enabled = null;
+    this.oauth2ClientId = null;
+    this.oauth2ClientSecret = null;
+    this.oauth2ClientSecretSha256 = null;
+  }
+
+
+  private BackendServiceIAP(
+      Boolean enabled,
+      String oauth2ClientId,
+      String oauth2ClientSecret,
+      String oauth2ClientSecretSha256
+      ) {
+    this.enabled = enabled;
+    this.oauth2ClientId = oauth2ClientId;
+    this.oauth2ClientSecret = oauth2ClientSecret;
+    this.oauth2ClientSecretSha256 = oauth2ClientSecretSha256;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("enabled") && enabled != null) {
+      fieldMap.put("enabled", Collections.singletonList(String.valueOf(enabled)));
+    }
+    if (fieldNames.contains("oauth2ClientId") && oauth2ClientId != null) {
+      fieldMap.put("oauth2ClientId", Collections.singletonList(String.valueOf(oauth2ClientId)));
+    }
+    if (fieldNames.contains("oauth2ClientSecret") && oauth2ClientSecret != null) {
+      fieldMap.put("oauth2ClientSecret", Collections.singletonList(String.valueOf(oauth2ClientSecret)));
+    }
+    if (fieldNames.contains("oauth2ClientSecretSha256") && oauth2ClientSecretSha256 != null) {
+      fieldMap.put("oauth2ClientSecretSha256", Collections.singletonList(String.valueOf(oauth2ClientSecretSha256)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("enabled")) {
+      return String.valueOf(enabled);
+    }
+    if (fieldName.equals("oauth2ClientId")) {
+      return String.valueOf(oauth2ClientId);
+    }
+    if (fieldName.equals("oauth2ClientSecret")) {
+      return String.valueOf(oauth2ClientSecret);
+    }
+    if (fieldName.equals("oauth2ClientSecretSha256")) {
+      return String.valueOf(oauth2ClientSecretSha256);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public Boolean getEnabled() {
+    return enabled;
+  }
+
+  public String getOauth2ClientId() {
+    return oauth2ClientId;
+  }
+
+  public String getOauth2ClientSecret() {
+    return oauth2ClientSecret;
+  }
+
+  public String getOauth2ClientSecretSha256() {
+    return oauth2ClientSecretSha256;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(BackendServiceIAP prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static BackendServiceIAP getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final BackendServiceIAP DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new BackendServiceIAP();
+  }
+
+  public static class Builder {
+    private Boolean enabled;
+    private String oauth2ClientId;
+    private String oauth2ClientSecret;
+    private String oauth2ClientSecretSha256;
+
+    Builder() {}
+
+    public Builder mergeFrom(BackendServiceIAP other) {
+      if (other == BackendServiceIAP.getDefaultInstance()) return this;
+      if (other.getEnabled() != null) {
+        this.enabled = other.enabled;
+      }
+      if (other.getOauth2ClientId() != null) {
+        this.oauth2ClientId = other.oauth2ClientId;
+      }
+      if (other.getOauth2ClientSecret() != null) {
+        this.oauth2ClientSecret = other.oauth2ClientSecret;
+      }
+      if (other.getOauth2ClientSecretSha256() != null) {
+        this.oauth2ClientSecretSha256 = other.oauth2ClientSecretSha256;
+      }
+      return this;
+    }
+
+    Builder(BackendServiceIAP source) {
+      this.enabled = source.enabled;
+      this.oauth2ClientId = source.oauth2ClientId;
+      this.oauth2ClientSecret = source.oauth2ClientSecret;
+      this.oauth2ClientSecretSha256 = source.oauth2ClientSecretSha256;
+    }
+
+    public Boolean getEnabled() {
+      return enabled;
+    }
+
+    public Builder setEnabled(Boolean enabled) {
+      this.enabled = enabled;
+      return this;
+    }
+
+    public String getOauth2ClientId() {
+      return oauth2ClientId;
+    }
+
+    public Builder setOauth2ClientId(String oauth2ClientId) {
+      this.oauth2ClientId = oauth2ClientId;
+      return this;
+    }
+
+    public String getOauth2ClientSecret() {
+      return oauth2ClientSecret;
+    }
+
+    public Builder setOauth2ClientSecret(String oauth2ClientSecret) {
+      this.oauth2ClientSecret = oauth2ClientSecret;
+      return this;
+    }
+
+    public String getOauth2ClientSecretSha256() {
+      return oauth2ClientSecretSha256;
+    }
+
+    public Builder setOauth2ClientSecretSha256(String oauth2ClientSecretSha256) {
+      this.oauth2ClientSecretSha256 = oauth2ClientSecretSha256;
+      return this;
+    }
+
+
+    public BackendServiceIAP build() {
+
+
+
+      return new BackendServiceIAP(
+        enabled,
+        oauth2ClientId,
+        oauth2ClientSecret,
+        oauth2ClientSecretSha256
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setEnabled(this.enabled);
+      newBuilder.setOauth2ClientId(this.oauth2ClientId);
+      newBuilder.setOauth2ClientSecret(this.oauth2ClientSecret);
+      newBuilder.setOauth2ClientSecretSha256(this.oauth2ClientSecretSha256);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "BackendServiceIAP{"
+        + "enabled=" + enabled + ", "
+        + "oauth2ClientId=" + oauth2ClientId + ", "
+        + "oauth2ClientSecret=" + oauth2ClientSecret + ", "
+        + "oauth2ClientSecretSha256=" + oauth2ClientSecretSha256
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof BackendServiceIAP) {
+      BackendServiceIAP that = (BackendServiceIAP) o;
+      return
+          Objects.equals(this.enabled, that.getEnabled()) &&
+          Objects.equals(this.oauth2ClientId, that.getOauth2ClientId()) &&
+          Objects.equals(this.oauth2ClientSecret, that.getOauth2ClientSecret()) &&
+          Objects.equals(this.oauth2ClientSecretSha256, that.getOauth2ClientSecretSha256())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      enabled,
+      oauth2ClientId,
+      oauth2ClientSecret,
+      oauth2ClientSecretSha256
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java
index 3c54fc69fc05..c70811d88f1e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -36,6 +37,7 @@ public final class BackendServiceList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private BackendServiceList() {
     this.id = null;
@@ -43,15 +45,24 @@ private BackendServiceList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
+
   private BackendServiceList(
-      String id, List items, String kind, String nextPageToken, String selfLink) {
+      String id,
+      List items,
+      String kind,
+      String nextPageToken,
+      String selfLink,
+      Warning warning
+      ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -76,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -96,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -125,24 +142,26 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(BackendServiceList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static BackendServiceList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final BackendServiceList DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new BackendServiceList();
   }
@@ -153,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -173,6 +193,9 @@ public Builder mergeFrom(BackendServiceList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -182,6 +205,7 @@ public Builder mergeFrom(BackendServiceList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -237,9 +261,30 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
     public BackendServiceList build() {
 
-      return new BackendServiceList(id, items, kind, nextPageToken, selfLink);
+
+
+
+
+      return new BackendServiceList(
+        id,
+        items,
+        kind,
+        nextPageToken,
+        selfLink,
+        warning
+      );
     }
 
     public Builder clone() {
@@ -249,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -256,20 +302,12 @@ public Builder clone() {
   @Override
   public String toString() {
     return "BackendServiceList{"
-        + "id="
-        + id
-        + ", "
-        + "items="
-        + items
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "nextPageToken="
-        + nextPageToken
-        + ", "
-        + "selfLink="
-        + selfLink
+        + "id=" + id + ", "
+        + "items=" + items + ", "
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -280,17 +318,27 @@ public boolean equals(Object o) {
     }
     if (o instanceof BackendServiceList) {
       BackendServiceList that = (BackendServiceList) o;
-      return Objects.equals(this.id, that.getId())
-          && Objects.equals(this.items, that.getItemsList())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.nextPageToken, that.getNextPageToken())
-          && Objects.equals(this.selfLink, that.getSelfLink());
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.items, that.getItemsList()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(id, items, kind, nextPageToken, selfLink);
+    return Objects.hash(
+      id,
+      items,
+      kind,
+      nextPageToken,
+      selfLink,
+      warning
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java
index d77efb55d378..a40f752c9a54 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class BackendServiceName implements ResourceName {
+public final class BackendServiceName implements com.google.api.resourcenames.ResourceName {
   private final String backendService;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java
new file mode 100644
index 000000000000..81eedc4f6f44
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class CacheKeyPolicy implements ApiMessage {
+  private final Boolean includeHost;
+  private final Boolean includeProtocol;
+  private final Boolean includeQueryString;
+  private final List queryStringBlacklist;
+  private final List queryStringWhitelist;
+
+  private CacheKeyPolicy() {
+    this.includeHost = null;
+    this.includeProtocol = null;
+    this.includeQueryString = null;
+    this.queryStringBlacklist = null;
+    this.queryStringWhitelist = null;
+  }
+
+
+  private CacheKeyPolicy(
+      Boolean includeHost,
+      Boolean includeProtocol,
+      Boolean includeQueryString,
+      List queryStringBlacklist,
+      List queryStringWhitelist
+      ) {
+    this.includeHost = includeHost;
+    this.includeProtocol = includeProtocol;
+    this.includeQueryString = includeQueryString;
+    this.queryStringBlacklist = queryStringBlacklist;
+    this.queryStringWhitelist = queryStringWhitelist;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("includeHost") && includeHost != null) {
+      fieldMap.put("includeHost", Collections.singletonList(String.valueOf(includeHost)));
+    }
+    if (fieldNames.contains("includeProtocol") && includeProtocol != null) {
+      fieldMap.put("includeProtocol", Collections.singletonList(String.valueOf(includeProtocol)));
+    }
+    if (fieldNames.contains("includeQueryString") && includeQueryString != null) {
+      fieldMap.put("includeQueryString", Collections.singletonList(String.valueOf(includeQueryString)));
+    }
+    if (fieldNames.contains("queryStringBlacklist") && queryStringBlacklist != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (String item : queryStringBlacklist) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("queryStringBlacklist", stringList.build());
+    }
+    if (fieldNames.contains("queryStringWhitelist") && queryStringWhitelist != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (String item : queryStringWhitelist) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("queryStringWhitelist", stringList.build());
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("includeHost")) {
+      return String.valueOf(includeHost);
+    }
+    if (fieldName.equals("includeProtocol")) {
+      return String.valueOf(includeProtocol);
+    }
+    if (fieldName.equals("includeQueryString")) {
+      return String.valueOf(includeQueryString);
+    }
+    if (fieldName.equals("queryStringBlacklist")) {
+      return String.valueOf(queryStringBlacklist);
+    }
+    if (fieldName.equals("queryStringWhitelist")) {
+      return String.valueOf(queryStringWhitelist);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public Boolean getIncludeHost() {
+    return includeHost;
+  }
+
+  public Boolean getIncludeProtocol() {
+    return includeProtocol;
+  }
+
+  public Boolean getIncludeQueryString() {
+    return includeQueryString;
+  }
+
+  public List getQueryStringBlacklistList() {
+    return queryStringBlacklist;
+  }
+
+  public List getQueryStringWhitelistList() {
+    return queryStringWhitelist;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(CacheKeyPolicy prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static CacheKeyPolicy getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final CacheKeyPolicy DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new CacheKeyPolicy();
+  }
+
+  public static class Builder {
+    private Boolean includeHost;
+    private Boolean includeProtocol;
+    private Boolean includeQueryString;
+    private List queryStringBlacklist;
+    private List queryStringWhitelist;
+
+    Builder() {}
+
+    public Builder mergeFrom(CacheKeyPolicy other) {
+      if (other == CacheKeyPolicy.getDefaultInstance()) return this;
+      if (other.getIncludeHost() != null) {
+        this.includeHost = other.includeHost;
+      }
+      if (other.getIncludeProtocol() != null) {
+        this.includeProtocol = other.includeProtocol;
+      }
+      if (other.getIncludeQueryString() != null) {
+        this.includeQueryString = other.includeQueryString;
+      }
+      if (other.getQueryStringBlacklistList() != null) {
+        this.queryStringBlacklist = other.queryStringBlacklist;
+      }
+      if (other.getQueryStringWhitelistList() != null) {
+        this.queryStringWhitelist = other.queryStringWhitelist;
+      }
+      return this;
+    }
+
+    Builder(CacheKeyPolicy source) {
+      this.includeHost = source.includeHost;
+      this.includeProtocol = source.includeProtocol;
+      this.includeQueryString = source.includeQueryString;
+      this.queryStringBlacklist = source.queryStringBlacklist;
+      this.queryStringWhitelist = source.queryStringWhitelist;
+    }
+
+    public Boolean getIncludeHost() {
+      return includeHost;
+    }
+
+    public Builder setIncludeHost(Boolean includeHost) {
+      this.includeHost = includeHost;
+      return this;
+    }
+
+    public Boolean getIncludeProtocol() {
+      return includeProtocol;
+    }
+
+    public Builder setIncludeProtocol(Boolean includeProtocol) {
+      this.includeProtocol = includeProtocol;
+      return this;
+    }
+
+    public Boolean getIncludeQueryString() {
+      return includeQueryString;
+    }
+
+    public Builder setIncludeQueryString(Boolean includeQueryString) {
+      this.includeQueryString = includeQueryString;
+      return this;
+    }
+
+    public List getQueryStringBlacklistList() {
+      return queryStringBlacklist;
+    }
+
+    public Builder addAllQueryStringBlacklist(List queryStringBlacklist) {
+      if (this.queryStringBlacklist == null) {
+        this.queryStringBlacklist = new ArrayList<>(queryStringBlacklist.size());
+      }
+      this.queryStringBlacklist.addAll(queryStringBlacklist);
+      return this;
+    }
+
+    public Builder addQueryStringBlacklist(String queryStringBlacklist) {
+      this.queryStringBlacklist.add(queryStringBlacklist);
+      return this;
+    }
+
+    public List getQueryStringWhitelistList() {
+      return queryStringWhitelist;
+    }
+
+    public Builder addAllQueryStringWhitelist(List queryStringWhitelist) {
+      if (this.queryStringWhitelist == null) {
+        this.queryStringWhitelist = new ArrayList<>(queryStringWhitelist.size());
+      }
+      this.queryStringWhitelist.addAll(queryStringWhitelist);
+      return this;
+    }
+
+    public Builder addQueryStringWhitelist(String queryStringWhitelist) {
+      this.queryStringWhitelist.add(queryStringWhitelist);
+      return this;
+    }
+
+
+    public CacheKeyPolicy build() {
+
+
+
+
+      return new CacheKeyPolicy(
+        includeHost,
+        includeProtocol,
+        includeQueryString,
+        queryStringBlacklist,
+        queryStringWhitelist
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setIncludeHost(this.includeHost);
+      newBuilder.setIncludeProtocol(this.includeProtocol);
+      newBuilder.setIncludeQueryString(this.includeQueryString);
+      newBuilder.addAllQueryStringBlacklist(this.queryStringBlacklist);
+      newBuilder.addAllQueryStringWhitelist(this.queryStringWhitelist);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "CacheKeyPolicy{"
+        + "includeHost=" + includeHost + ", "
+        + "includeProtocol=" + includeProtocol + ", "
+        + "includeQueryString=" + includeQueryString + ", "
+        + "queryStringBlacklist=" + queryStringBlacklist + ", "
+        + "queryStringWhitelist=" + queryStringWhitelist
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof CacheKeyPolicy) {
+      CacheKeyPolicy that = (CacheKeyPolicy) o;
+      return
+          Objects.equals(this.includeHost, that.getIncludeHost()) &&
+          Objects.equals(this.includeProtocol, that.getIncludeProtocol()) &&
+          Objects.equals(this.includeQueryString, that.getIncludeQueryString()) &&
+          Objects.equals(this.queryStringBlacklist, that.getQueryStringBlacklistList()) &&
+          Objects.equals(this.queryStringWhitelist, that.getQueryStringWhitelistList())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      includeHost,
+      includeProtocol,
+      includeQueryString,
+      queryStringBlacklist,
+      queryStringWhitelist
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java
new file mode 100644
index 000000000000..4bd7e140b597
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java
@@ -0,0 +1,582 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class Commitment implements ApiMessage {
+  private final String creationTimestamp;
+  private final String description;
+  private final String endTimestamp;
+  private final String id;
+  private final String kind;
+  private final String name;
+  private final String plan;
+  private final String region;
+  private final List resources;
+  private final String selfLink;
+  private final String startTimestamp;
+  private final String status;
+  private final String statusMessage;
+
+  private Commitment() {
+    this.creationTimestamp = null;
+    this.description = null;
+    this.endTimestamp = null;
+    this.id = null;
+    this.kind = null;
+    this.name = null;
+    this.plan = null;
+    this.region = null;
+    this.resources = null;
+    this.selfLink = null;
+    this.startTimestamp = null;
+    this.status = null;
+    this.statusMessage = null;
+  }
+
+
+  private Commitment(
+      String creationTimestamp,
+      String description,
+      String endTimestamp,
+      String id,
+      String kind,
+      String name,
+      String plan,
+      String region,
+      List resources,
+      String selfLink,
+      String startTimestamp,
+      String status,
+      String statusMessage
+      ) {
+    this.creationTimestamp = creationTimestamp;
+    this.description = description;
+    this.endTimestamp = endTimestamp;
+    this.id = id;
+    this.kind = kind;
+    this.name = name;
+    this.plan = plan;
+    this.region = region;
+    this.resources = resources;
+    this.selfLink = selfLink;
+    this.startTimestamp = startTimestamp;
+    this.status = status;
+    this.statusMessage = statusMessage;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
+      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+    }
+    if (fieldNames.contains("description") && description != null) {
+      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
+    }
+    if (fieldNames.contains("endTimestamp") && endTimestamp != null) {
+      fieldMap.put("endTimestamp", Collections.singletonList(String.valueOf(endTimestamp)));
+    }
+    if (fieldNames.contains("id") && id != null) {
+      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
+    }
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("name") && name != null) {
+      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
+    }
+    if (fieldNames.contains("plan") && plan != null) {
+      fieldMap.put("plan", Collections.singletonList(String.valueOf(plan)));
+    }
+    if (fieldNames.contains("region") && region != null) {
+      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
+    }
+    if (fieldNames.contains("resources") && resources != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (ResourceCommitment item : resources) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("resources", stringList.build());
+    }
+    if (fieldNames.contains("selfLink") && selfLink != null) {
+      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
+    }
+    if (fieldNames.contains("startTimestamp") && startTimestamp != null) {
+      fieldMap.put("startTimestamp", Collections.singletonList(String.valueOf(startTimestamp)));
+    }
+    if (fieldNames.contains("status") && status != null) {
+      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
+    }
+    if (fieldNames.contains("statusMessage") && statusMessage != null) {
+      fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("creationTimestamp")) {
+      return String.valueOf(creationTimestamp);
+    }
+    if (fieldName.equals("description")) {
+      return String.valueOf(description);
+    }
+    if (fieldName.equals("endTimestamp")) {
+      return String.valueOf(endTimestamp);
+    }
+    if (fieldName.equals("id")) {
+      return String.valueOf(id);
+    }
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("name")) {
+      return String.valueOf(name);
+    }
+    if (fieldName.equals("plan")) {
+      return String.valueOf(plan);
+    }
+    if (fieldName.equals("region")) {
+      return String.valueOf(region);
+    }
+    if (fieldName.equals("resources")) {
+      return String.valueOf(resources);
+    }
+    if (fieldName.equals("selfLink")) {
+      return String.valueOf(selfLink);
+    }
+    if (fieldName.equals("startTimestamp")) {
+      return String.valueOf(startTimestamp);
+    }
+    if (fieldName.equals("status")) {
+      return String.valueOf(status);
+    }
+    if (fieldName.equals("statusMessage")) {
+      return String.valueOf(statusMessage);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getCreationTimestamp() {
+    return creationTimestamp;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public String getEndTimestamp() {
+    return endTimestamp;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public String getPlan() {
+    return plan;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public List getResourcesList() {
+    return resources;
+  }
+
+  public String getSelfLink() {
+    return selfLink;
+  }
+
+  public String getStartTimestamp() {
+    return startTimestamp;
+  }
+
+  public String getStatus() {
+    return status;
+  }
+
+  public String getStatusMessage() {
+    return statusMessage;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(Commitment prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static Commitment getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final Commitment DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new Commitment();
+  }
+
+  public static class Builder {
+    private String creationTimestamp;
+    private String description;
+    private String endTimestamp;
+    private String id;
+    private String kind;
+    private String name;
+    private String plan;
+    private String region;
+    private List resources;
+    private String selfLink;
+    private String startTimestamp;
+    private String status;
+    private String statusMessage;
+
+    Builder() {}
+
+    public Builder mergeFrom(Commitment other) {
+      if (other == Commitment.getDefaultInstance()) return this;
+      if (other.getCreationTimestamp() != null) {
+        this.creationTimestamp = other.creationTimestamp;
+      }
+      if (other.getDescription() != null) {
+        this.description = other.description;
+      }
+      if (other.getEndTimestamp() != null) {
+        this.endTimestamp = other.endTimestamp;
+      }
+      if (other.getId() != null) {
+        this.id = other.id;
+      }
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getName() != null) {
+        this.name = other.name;
+      }
+      if (other.getPlan() != null) {
+        this.plan = other.plan;
+      }
+      if (other.getRegion() != null) {
+        this.region = other.region;
+      }
+      if (other.getResourcesList() != null) {
+        this.resources = other.resources;
+      }
+      if (other.getSelfLink() != null) {
+        this.selfLink = other.selfLink;
+      }
+      if (other.getStartTimestamp() != null) {
+        this.startTimestamp = other.startTimestamp;
+      }
+      if (other.getStatus() != null) {
+        this.status = other.status;
+      }
+      if (other.getStatusMessage() != null) {
+        this.statusMessage = other.statusMessage;
+      }
+      return this;
+    }
+
+    Builder(Commitment source) {
+      this.creationTimestamp = source.creationTimestamp;
+      this.description = source.description;
+      this.endTimestamp = source.endTimestamp;
+      this.id = source.id;
+      this.kind = source.kind;
+      this.name = source.name;
+      this.plan = source.plan;
+      this.region = source.region;
+      this.resources = source.resources;
+      this.selfLink = source.selfLink;
+      this.startTimestamp = source.startTimestamp;
+      this.status = source.status;
+      this.statusMessage = source.statusMessage;
+    }
+
+    public String getCreationTimestamp() {
+      return creationTimestamp;
+    }
+
+    public Builder setCreationTimestamp(String creationTimestamp) {
+      this.creationTimestamp = creationTimestamp;
+      return this;
+    }
+
+    public String getDescription() {
+      return description;
+    }
+
+    public Builder setDescription(String description) {
+      this.description = description;
+      return this;
+    }
+
+    public String getEndTimestamp() {
+      return endTimestamp;
+    }
+
+    public Builder setEndTimestamp(String endTimestamp) {
+      this.endTimestamp = endTimestamp;
+      return this;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public Builder setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getName() {
+      return name;
+    }
+
+    public Builder setName(String name) {
+      this.name = name;
+      return this;
+    }
+
+    public String getPlan() {
+      return plan;
+    }
+
+    public Builder setPlan(String plan) {
+      this.plan = plan;
+      return this;
+    }
+
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    public List getResourcesList() {
+      return resources;
+    }
+
+    public Builder addAllResources(List resources) {
+      if (this.resources == null) {
+        this.resources = new ArrayList<>(resources.size());
+      }
+      this.resources.addAll(resources);
+      return this;
+    }
+
+    public Builder addResources(ResourceCommitment resources) {
+      this.resources.add(resources);
+      return this;
+    }
+
+    public String getSelfLink() {
+      return selfLink;
+    }
+
+    public Builder setSelfLink(String selfLink) {
+      this.selfLink = selfLink;
+      return this;
+    }
+
+    public String getStartTimestamp() {
+      return startTimestamp;
+    }
+
+    public Builder setStartTimestamp(String startTimestamp) {
+      this.startTimestamp = startTimestamp;
+      return this;
+    }
+
+    public String getStatus() {
+      return status;
+    }
+
+    public Builder setStatus(String status) {
+      this.status = status;
+      return this;
+    }
+
+    public String getStatusMessage() {
+      return statusMessage;
+    }
+
+    public Builder setStatusMessage(String statusMessage) {
+      this.statusMessage = statusMessage;
+      return this;
+    }
+
+
+    public Commitment build() {
+
+
+
+
+
+
+
+
+
+
+
+
+      return new Commitment(
+        creationTimestamp,
+        description,
+        endTimestamp,
+        id,
+        kind,
+        name,
+        plan,
+        region,
+        resources,
+        selfLink,
+        startTimestamp,
+        status,
+        statusMessage
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setCreationTimestamp(this.creationTimestamp);
+      newBuilder.setDescription(this.description);
+      newBuilder.setEndTimestamp(this.endTimestamp);
+      newBuilder.setId(this.id);
+      newBuilder.setKind(this.kind);
+      newBuilder.setName(this.name);
+      newBuilder.setPlan(this.plan);
+      newBuilder.setRegion(this.region);
+      newBuilder.addAllResources(this.resources);
+      newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setStartTimestamp(this.startTimestamp);
+      newBuilder.setStatus(this.status);
+      newBuilder.setStatusMessage(this.statusMessage);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "Commitment{"
+        + "creationTimestamp=" + creationTimestamp + ", "
+        + "description=" + description + ", "
+        + "endTimestamp=" + endTimestamp + ", "
+        + "id=" + id + ", "
+        + "kind=" + kind + ", "
+        + "name=" + name + ", "
+        + "plan=" + plan + ", "
+        + "region=" + region + ", "
+        + "resources=" + resources + ", "
+        + "selfLink=" + selfLink + ", "
+        + "startTimestamp=" + startTimestamp + ", "
+        + "status=" + status + ", "
+        + "statusMessage=" + statusMessage
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof Commitment) {
+      Commitment that = (Commitment) o;
+      return
+          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.endTimestamp, that.getEndTimestamp()) &&
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.name, that.getName()) &&
+          Objects.equals(this.plan, that.getPlan()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.resources, that.getResourcesList()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.startTimestamp, that.getStartTimestamp()) &&
+          Objects.equals(this.status, that.getStatus()) &&
+          Objects.equals(this.statusMessage, that.getStatusMessage())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      creationTimestamp,
+      description,
+      endTimestamp,
+      id,
+      kind,
+      name,
+      plan,
+      region,
+      resources,
+      selfLink,
+      startTimestamp,
+      status,
+      statusMessage
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java
new file mode 100644
index 000000000000..a1bbaad81b57
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java
@@ -0,0 +1,332 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class CommitmentAggregatedList implements ApiMessage {
+  private final String id;
+  private final Map items;
+  private final String kind;
+  private final String nextPageToken;
+  private final String selfLink;
+  private final Warning warning;
+
+  private CommitmentAggregatedList() {
+    this.id = null;
+    this.items = null;
+    this.kind = null;
+    this.nextPageToken = null;
+    this.selfLink = null;
+    this.warning = null;
+  }
+
+
+  private CommitmentAggregatedList(
+      String id,
+      Map items,
+      String kind,
+      String nextPageToken,
+      String selfLink,
+      Warning warning
+      ) {
+    this.id = id;
+    this.items = items;
+    this.kind = kind;
+    this.nextPageToken = nextPageToken;
+    this.selfLink = selfLink;
+    this.warning = warning;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("id") && id != null) {
+      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
+    }
+    if (fieldNames.contains("items") && items != null) {
+      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
+    }
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
+      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
+    }
+    if (fieldNames.contains("selfLink") && selfLink != null) {
+      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
+    }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("id")) {
+      return String.valueOf(id);
+    }
+    if (fieldName.equals("items")) {
+      return String.valueOf(items);
+    }
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("nextPageToken")) {
+      return String.valueOf(nextPageToken);
+    }
+    if (fieldName.equals("selfLink")) {
+      return String.valueOf(selfLink);
+    }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public Map getItemsMap() {
+    return items;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getNextPageToken() {
+    return nextPageToken;
+  }
+
+  public String getSelfLink() {
+    return selfLink;
+  }
+
+  public Warning getWarning() {
+    return warning;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(CommitmentAggregatedList prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static CommitmentAggregatedList getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final CommitmentAggregatedList DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new CommitmentAggregatedList();
+  }
+
+  public static class Builder {
+    private String id;
+    private Map items;
+    private String kind;
+    private String nextPageToken;
+    private String selfLink;
+    private Warning warning;
+
+    Builder() {}
+
+    public Builder mergeFrom(CommitmentAggregatedList other) {
+      if (other == CommitmentAggregatedList.getDefaultInstance()) return this;
+      if (other.getId() != null) {
+        this.id = other.id;
+      }
+      if (other.getItemsMap() != null) {
+        this.items = other.items;
+      }
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getNextPageToken() != null) {
+        this.nextPageToken = other.nextPageToken;
+      }
+      if (other.getSelfLink() != null) {
+        this.selfLink = other.selfLink;
+      }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
+      return this;
+    }
+
+    Builder(CommitmentAggregatedList source) {
+      this.id = source.id;
+      this.items = source.items;
+      this.kind = source.kind;
+      this.nextPageToken = source.nextPageToken;
+      this.selfLink = source.selfLink;
+      this.warning = source.warning;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public Builder setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public Map getItemsMap() {
+      return items;
+    }
+
+    public Builder putAllItems(Map items) {
+      this.items = items;
+      return this;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getNextPageToken() {
+      return nextPageToken;
+    }
+
+    public Builder setNextPageToken(String nextPageToken) {
+      this.nextPageToken = nextPageToken;
+      return this;
+    }
+
+    public String getSelfLink() {
+      return selfLink;
+    }
+
+    public Builder setSelfLink(String selfLink) {
+      this.selfLink = selfLink;
+      return this;
+    }
+
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
+    public CommitmentAggregatedList build() {
+
+
+
+
+
+      return new CommitmentAggregatedList(
+        id,
+        items,
+        kind,
+        nextPageToken,
+        selfLink,
+        warning
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setId(this.id);
+      newBuilder.putAllItems(this.items);
+      newBuilder.setKind(this.kind);
+      newBuilder.setNextPageToken(this.nextPageToken);
+      newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "CommitmentAggregatedList{"
+        + "id=" + id + ", "
+        + "items=" + items + ", "
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof CommitmentAggregatedList) {
+      CommitmentAggregatedList that = (CommitmentAggregatedList) o;
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.items, that.getItemsMap()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      id,
+      items,
+      kind,
+      nextPageToken,
+      selfLink,
+      warning
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java
new file mode 100644
index 000000000000..a23f84d786b4
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java
@@ -0,0 +1,344 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class CommitmentList implements ApiMessage {
+  private final String id;
+  private final List items;
+  private final String kind;
+  private final String nextPageToken;
+  private final String selfLink;
+  private final Warning warning;
+
+  private CommitmentList() {
+    this.id = null;
+    this.items = null;
+    this.kind = null;
+    this.nextPageToken = null;
+    this.selfLink = null;
+    this.warning = null;
+  }
+
+
+  private CommitmentList(
+      String id,
+      List items,
+      String kind,
+      String nextPageToken,
+      String selfLink,
+      Warning warning
+      ) {
+    this.id = id;
+    this.items = items;
+    this.kind = kind;
+    this.nextPageToken = nextPageToken;
+    this.selfLink = selfLink;
+    this.warning = warning;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("id") && id != null) {
+      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
+    }
+    if (fieldNames.contains("items") && items != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (Commitment item : items) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("items", stringList.build());
+    }
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
+      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
+    }
+    if (fieldNames.contains("selfLink") && selfLink != null) {
+      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
+    }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("id")) {
+      return String.valueOf(id);
+    }
+    if (fieldName.equals("items")) {
+      return String.valueOf(items);
+    }
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("nextPageToken")) {
+      return String.valueOf(nextPageToken);
+    }
+    if (fieldName.equals("selfLink")) {
+      return String.valueOf(selfLink);
+    }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public List getItemsList() {
+    return items;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getNextPageToken() {
+    return nextPageToken;
+  }
+
+  public String getSelfLink() {
+    return selfLink;
+  }
+
+  public Warning getWarning() {
+    return warning;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(CommitmentList prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static CommitmentList getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final CommitmentList DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new CommitmentList();
+  }
+
+  public static class Builder {
+    private String id;
+    private List items;
+    private String kind;
+    private String nextPageToken;
+    private String selfLink;
+    private Warning warning;
+
+    Builder() {}
+
+    public Builder mergeFrom(CommitmentList other) {
+      if (other == CommitmentList.getDefaultInstance()) return this;
+      if (other.getId() != null) {
+        this.id = other.id;
+      }
+      if (other.getItemsList() != null) {
+        this.items = other.items;
+      }
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getNextPageToken() != null) {
+        this.nextPageToken = other.nextPageToken;
+      }
+      if (other.getSelfLink() != null) {
+        this.selfLink = other.selfLink;
+      }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
+      return this;
+    }
+
+    Builder(CommitmentList source) {
+      this.id = source.id;
+      this.items = source.items;
+      this.kind = source.kind;
+      this.nextPageToken = source.nextPageToken;
+      this.selfLink = source.selfLink;
+      this.warning = source.warning;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public Builder setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public List getItemsList() {
+      return items;
+    }
+
+    public Builder addAllItems(List items) {
+      if (this.items == null) {
+        this.items = new ArrayList<>(items.size());
+      }
+      this.items.addAll(items);
+      return this;
+    }
+
+    public Builder addItems(Commitment items) {
+      this.items.add(items);
+      return this;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getNextPageToken() {
+      return nextPageToken;
+    }
+
+    public Builder setNextPageToken(String nextPageToken) {
+      this.nextPageToken = nextPageToken;
+      return this;
+    }
+
+    public String getSelfLink() {
+      return selfLink;
+    }
+
+    public Builder setSelfLink(String selfLink) {
+      this.selfLink = selfLink;
+      return this;
+    }
+
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
+    public CommitmentList build() {
+
+
+
+
+
+      return new CommitmentList(
+        id,
+        items,
+        kind,
+        nextPageToken,
+        selfLink,
+        warning
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setId(this.id);
+      newBuilder.addAllItems(this.items);
+      newBuilder.setKind(this.kind);
+      newBuilder.setNextPageToken(this.nextPageToken);
+      newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "CommitmentList{"
+        + "id=" + id + ", "
+        + "items=" + items + ", "
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof CommitmentList) {
+      CommitmentList that = (CommitmentList) o;
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.items, that.getItemsList()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      id,
+      items,
+      kind,
+      nextPageToken,
+      selfLink,
+      warning
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java
new file mode 100644
index 000000000000..6fe4360657f2
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class CommitmentName implements com.google.api.resourcenames.ResourceName {
+  private final String commitment;
+  private final String project;
+  private final String region;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/commitments/{commitment}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private CommitmentName(Builder builder) {
+    commitment = Preconditions.checkNotNull(builder.getCommitment());
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+  }
+
+  public static CommitmentName of(
+      String commitment,
+      String project,
+      String region
+      ) {
+    return newBuilder()
+    .setCommitment(commitment)
+    .setProject(project)
+    .setRegion(region)
+      .build();
+  }
+
+  public static String format(
+      String commitment,
+      String project,
+      String region
+      ) {
+    return of(
+        commitment,
+        project,
+        region
+        )
+        .toString();
+  }
+
+  public String getCommitment() {
+    return commitment;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("commitment", commitment);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public CommitmentName parse(String formattedString) {return CommitmentName.parse(formattedString);}
+    };
+  }
+
+  public static CommitmentName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "CommitmentName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("commitment"),
+      matchMap.get("project"),
+      matchMap.get("region")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String commitment;
+    private String project;
+    private String region;
+
+    public String getCommitment() {
+      return commitment;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setCommitment(String commitment) {
+      this.commitment = commitment;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (CommitmentName commitmentName) {
+      commitment = commitmentName.commitment;
+      project = commitmentName.project;
+      region = commitmentName.region;
+    }
+
+    public CommitmentName build() {
+      return new CommitmentName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "commitment", commitment,
+        "project", project,
+        "region", region
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof CommitmentName) {
+      CommitmentName that = (CommitmentName) o;
+      return
+          Objects.equals(this.commitment, that.getCommitment()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      commitment,
+      project,
+      region
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java
new file mode 100644
index 000000000000..de67bb7df8f7
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class CommitmentsScopedList implements ApiMessage {
+  private final List commitments;
+  private final Warning warning;
+
+  private CommitmentsScopedList() {
+    this.commitments = null;
+    this.warning = null;
+  }
+
+
+  private CommitmentsScopedList(
+      List commitments,
+      Warning warning
+      ) {
+    this.commitments = commitments;
+    this.warning = warning;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("commitments") && commitments != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (Commitment item : commitments) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("commitments", stringList.build());
+    }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("commitments")) {
+      return String.valueOf(commitments);
+    }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public List getCommitmentsList() {
+    return commitments;
+  }
+
+  public Warning getWarning() {
+    return warning;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(CommitmentsScopedList prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static CommitmentsScopedList getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final CommitmentsScopedList DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new CommitmentsScopedList();
+  }
+
+  public static class Builder {
+    private List commitments;
+    private Warning warning;
+
+    Builder() {}
+
+    public Builder mergeFrom(CommitmentsScopedList other) {
+      if (other == CommitmentsScopedList.getDefaultInstance()) return this;
+      if (other.getCommitmentsList() != null) {
+        this.commitments = other.commitments;
+      }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
+      return this;
+    }
+
+    Builder(CommitmentsScopedList source) {
+      this.commitments = source.commitments;
+      this.warning = source.warning;
+    }
+
+    public List getCommitmentsList() {
+      return commitments;
+    }
+
+    public Builder addAllCommitments(List commitments) {
+      if (this.commitments == null) {
+        this.commitments = new ArrayList<>(commitments.size());
+      }
+      this.commitments.addAll(commitments);
+      return this;
+    }
+
+    public Builder addCommitments(Commitment commitments) {
+      this.commitments.add(commitments);
+      return this;
+    }
+
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
+    public CommitmentsScopedList build() {
+
+      return new CommitmentsScopedList(
+        commitments,
+        warning
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.addAllCommitments(this.commitments);
+      newBuilder.setWarning(this.warning);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "CommitmentsScopedList{"
+        + "commitments=" + commitments + ", "
+        + "warning=" + warning
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof CommitmentsScopedList) {
+      CommitmentsScopedList that = (CommitmentsScopedList) o;
+      return
+          Objects.equals(this.commitments, that.getCommitmentsList()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      commitments,
+      warning
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java
index f87823d32377..56803b35982b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java
@@ -36,9 +36,11 @@ public final class CreateSnapshotDiskHttpRequest implements ApiMessage {
   private final String callback;
   private final String disk;
   private final String fields;
+  private final Boolean guestFlush;
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final Snapshot snapshotResource;
   private final String userIp;
 
@@ -47,9 +49,11 @@ private CreateSnapshotDiskHttpRequest() {
     this.callback = null;
     this.disk = null;
     this.fields = null;
+    this.guestFlush = null;
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.snapshotResource = null;
     this.userIp = null;
   }
@@ -60,9 +64,11 @@ private CreateSnapshotDiskHttpRequest(
       String callback,
       String disk,
       String fields,
+      Boolean guestFlush,
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       Snapshot snapshotResource,
       String userIp
       ) {
@@ -70,9 +76,11 @@ private CreateSnapshotDiskHttpRequest(
     this.callback = callback;
     this.disk = disk;
     this.fields = fields;
+    this.guestFlush = guestFlush;
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.snapshotResource = snapshotResource;
     this.userIp = userIp;
   }
@@ -92,6 +100,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("fields") && fields != null) {
       fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
     }
+    if (fieldNames.contains("guestFlush") && guestFlush != null) {
+      fieldMap.put("guestFlush", Collections.singletonList(String.valueOf(guestFlush)));
+    }
     if (fieldNames.contains("key") && key != null) {
       fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
     }
@@ -101,6 +112,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("snapshotResource") && snapshotResource != null) {
       fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource)));
     }
@@ -124,6 +138,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("fields")) {
       return String.valueOf(fields);
     }
+    if (fieldName.equals("guestFlush")) {
+      return String.valueOf(guestFlush);
+    }
     if (fieldName.equals("key")) {
       return String.valueOf(key);
     }
@@ -133,6 +150,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("snapshotResource")) {
       return String.valueOf(snapshotResource);
     }
@@ -164,6 +184,10 @@ public String getFields() {
     return fields;
   }
 
+  public Boolean getGuestFlush() {
+    return guestFlush;
+  }
+
   public String getKey() {
     return key;
   }
@@ -176,6 +200,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public Snapshot getSnapshotResource() {
     return snapshotResource;
   }
@@ -209,9 +237,11 @@ public static class Builder {
     private String callback;
     private String disk;
     private String fields;
+    private Boolean guestFlush;
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private Snapshot snapshotResource;
     private String userIp;
 
@@ -231,6 +261,9 @@ public Builder mergeFrom(CreateSnapshotDiskHttpRequest other) {
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
+      if (other.getGuestFlush() != null) {
+        this.guestFlush = other.guestFlush;
+      }
       if (other.getKey() != null) {
         this.key = other.key;
       }
@@ -240,6 +273,9 @@ public Builder mergeFrom(CreateSnapshotDiskHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getSnapshotResource() != null) {
         this.snapshotResource = other.snapshotResource;
       }
@@ -254,9 +290,11 @@ public Builder mergeFrom(CreateSnapshotDiskHttpRequest other) {
       this.callback = source.callback;
       this.disk = source.disk;
       this.fields = source.fields;
+      this.guestFlush = source.guestFlush;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.snapshotResource = source.snapshotResource;
       this.userIp = source.userIp;
     }
@@ -297,6 +335,15 @@ public Builder setFields(String fields) {
       return this;
     }
 
+    public Boolean getGuestFlush() {
+      return guestFlush;
+    }
+
+    public Builder setGuestFlush(Boolean guestFlush) {
+      this.guestFlush = guestFlush;
+      return this;
+    }
+
     public String getKey() {
       return key;
     }
@@ -324,6 +371,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public Snapshot getSnapshotResource() {
       return snapshotResource;
     }
@@ -356,6 +412,8 @@ public CreateSnapshotDiskHttpRequest build() {
 
 
 
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -364,9 +422,11 @@ public CreateSnapshotDiskHttpRequest build() {
         callback,
         disk,
         fields,
+        guestFlush,
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         snapshotResource,
         userIp
       );
@@ -378,9 +438,11 @@ public Builder clone() {
       newBuilder.setCallback(this.callback);
       newBuilder.setDisk(this.disk);
       newBuilder.setFields(this.fields);
+      newBuilder.setGuestFlush(this.guestFlush);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setSnapshotResource(this.snapshotResource);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -394,9 +456,11 @@ public String toString() {
         + "callback=" + callback + ", "
         + "disk=" + disk + ", "
         + "fields=" + fields + ", "
+        + "guestFlush=" + guestFlush + ", "
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "snapshotResource=" + snapshotResource + ", "
         + "userIp=" + userIp
         + "}";
@@ -414,9 +478,11 @@ public boolean equals(Object o) {
           Objects.equals(this.callback, that.getCallback()) &&
           Objects.equals(this.disk, that.getDisk()) &&
           Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.guestFlush, that.getGuestFlush()) &&
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.snapshotResource, that.getSnapshotResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -431,9 +497,11 @@ public int hashCode() {
       callback,
       disk,
       fields,
+      guestFlush,
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       snapshotResource,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java
index 4fed7c5e6957..67c2beb60f3f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java
@@ -41,6 +41,7 @@ public final class DeleteAccessConfigInstanceHttpRequest implements ApiMessage {
   private final String networkInterface;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteAccessConfigInstanceHttpRequest() {
@@ -53,6 +54,7 @@ private DeleteAccessConfigInstanceHttpRequest() {
     this.networkInterface = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -67,6 +69,7 @@ private DeleteAccessConfigInstanceHttpRequest(
       String networkInterface,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.accessConfig = accessConfig;
@@ -78,6 +81,7 @@ private DeleteAccessConfigInstanceHttpRequest(
     this.networkInterface = networkInterface;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -111,6 +115,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -146,6 +153,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -194,6 +204,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -228,6 +242,7 @@ public static class Builder {
     private String networkInterface;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -261,6 +276,9 @@ public Builder mergeFrom(DeleteAccessConfigInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -277,6 +295,7 @@ public Builder mergeFrom(DeleteAccessConfigInstanceHttpRequest other) {
       this.networkInterface = source.networkInterface;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -361,6 +380,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -389,6 +417,7 @@ public DeleteAccessConfigInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -402,6 +431,7 @@ public DeleteAccessConfigInstanceHttpRequest build() {
         networkInterface,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -417,6 +447,7 @@ public Builder clone() {
       newBuilder.setNetworkInterface(this.networkInterface);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -434,6 +465,7 @@ public String toString() {
         + "networkInterface=" + networkInterface + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -455,6 +487,7 @@ public boolean equals(Object o) {
           Objects.equals(this.networkInterface, that.getNetworkInterface()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -473,6 +506,7 @@ public int hashCode() {
       networkInterface,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java
index 6f899b8a1c98..845d10a60fba 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteAddressHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteAddressHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteAddressHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteAddressHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteAddressHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteAddressHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteAddressHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteAddressHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteAddressHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java
index d126024201a4..6fde0cb63849 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteAutoscalerHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteAutoscalerHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteAutoscalerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteAutoscalerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteAutoscalerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteAutoscalerHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteAutoscalerHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteAutoscalerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteAutoscalerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java
new file mode 100644
index 000000000000..159a5e81b972
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class DeleteBackendBucketHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String backendBucket;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteBackendBucketHttpRequest() {
+    this.access_token = null;
+    this.backendBucket = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private DeleteBackendBucketHttpRequest(
+      String access_token,
+      String backendBucket,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.backendBucket = backendBucket;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("backendBucket") && backendBucket != null) {
+      fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("backendBucket")) {
+      return String.valueOf(backendBucket);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getBackendBucket() {
+    return backendBucket;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(DeleteBackendBucketHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteBackendBucketHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final DeleteBackendBucketHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new DeleteBackendBucketHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String backendBucket;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteBackendBucketHttpRequest other) {
+      if (other == DeleteBackendBucketHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getBackendBucket() != null) {
+        this.backendBucket = other.backendBucket;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteBackendBucketHttpRequest source) {
+      this.access_token = source.access_token;
+      this.backendBucket = source.backendBucket;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getBackendBucket() {
+      return backendBucket;
+    }
+
+    public Builder setBackendBucket(String backendBucket) {
+      this.backendBucket = backendBucket;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public DeleteBackendBucketHttpRequest build() {
+      String missing = "";
+
+      if (backendBucket == null) {
+        missing += " backendBucket";
+      }
+
+
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteBackendBucketHttpRequest(
+        access_token,
+        backendBucket,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setBackendBucket(this.backendBucket);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteBackendBucketHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "backendBucket=" + backendBucket + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteBackendBucketHttpRequest) {
+      DeleteBackendBucketHttpRequest that = (DeleteBackendBucketHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.backendBucket, that.getBackendBucket()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      backendBucket,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java
index 358cbbc3cf23..3b9d715a571d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteBackendServiceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteBackendServiceHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteBackendServiceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteBackendServiceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteBackendServiceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteBackendServiceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteBackendServiceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteBackendServiceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteBackendServiceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java
index b03414aeedf2..d5ffd4b33a9e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteDiskHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteDiskHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteDiskHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteDiskHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteDiskHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteDiskHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteDiskHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteDiskHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteDiskHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java
index 6689d82ccf47..b564a8ee391c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteFirewallHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteFirewallHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteFirewallHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteFirewallHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteFirewallHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteFirewallHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteFirewallHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteFirewallHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteFirewallHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java
index 60ec17e6f863..5eb2e56f0b7c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteForwardingRuleHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteForwardingRuleHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteForwardingRuleHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteForwardingRuleHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteForwardingRuleHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteForwardingRuleHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteForwardingRuleHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteForwardingRuleHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteForwardingRuleHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java
index 4d477f83a0d1..f8cdbf9d831d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,6 +39,7 @@ public final class DeleteGlobalAddressHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteGlobalAddressHttpRequest() {
@@ -46,9 +50,11 @@ private DeleteGlobalAddressHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
+
   private DeleteGlobalAddressHttpRequest(
       String access_token,
       String address,
@@ -57,7 +63,9 @@ private DeleteGlobalAddressHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String requestId,
+      String userIp
+      ) {
     this.access_token = access_token;
     this.address = address;
     this.callback = callback;
@@ -65,6 +73,7 @@ private DeleteGlobalAddressHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -92,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -121,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -161,28 +176,30 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(DeleteGlobalAddressHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DeleteGlobalAddressHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final DeleteGlobalAddressHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new DeleteGlobalAddressHttpRequest();
   }
@@ -195,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -222,6 +240,9 @@ public Builder mergeFrom(DeleteGlobalAddressHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -236,6 +257,7 @@ public Builder mergeFrom(DeleteGlobalAddressHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -302,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -311,6 +342,7 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public DeleteGlobalAddressHttpRequest build() {
       String missing = "";
 
@@ -318,11 +350,26 @@ public DeleteGlobalAddressHttpRequest build() {
         missing += " address";
       }
 
+
+
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new DeleteGlobalAddressHttpRequest(
-          access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        address,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -334,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -342,29 +390,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DeleteGlobalAddressHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "address="
-        + address
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "address=" + address + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +409,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof DeleteGlobalAddressHttpRequest) {
       DeleteGlobalAddressHttpRequest that = (DeleteGlobalAddressHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.address, that.getAddress())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.address, that.getAddress()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +427,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      address,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java
index 4cfdd5ef74ae..8afebb7a5b27 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteGlobalForwardingRuleHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteGlobalForwardingRuleHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteGlobalForwardingRuleHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteGlobalForwardingRuleHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteGlobalForwardingRuleHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteGlobalForwardingRuleHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteGlobalForwardingRuleHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteGlobalForwardingRuleHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteGlobalForwardingRuleHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java
index 98487512c151..31bf88988994 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,6 +39,7 @@ public final class DeleteHealthCheckHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteHealthCheckHttpRequest() {
@@ -46,9 +50,11 @@ private DeleteHealthCheckHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
+
   private DeleteHealthCheckHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +63,9 @@ private DeleteHealthCheckHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String requestId,
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -65,6 +73,7 @@ private DeleteHealthCheckHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -92,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -121,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -161,28 +176,30 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(DeleteHealthCheckHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DeleteHealthCheckHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final DeleteHealthCheckHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new DeleteHealthCheckHttpRequest();
   }
@@ -195,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -222,6 +240,9 @@ public Builder mergeFrom(DeleteHealthCheckHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -236,6 +257,7 @@ public Builder mergeFrom(DeleteHealthCheckHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -302,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -311,18 +342,34 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public DeleteHealthCheckHttpRequest build() {
       String missing = "";
 
+
+
       if (healthCheck == null) {
         missing += " healthCheck";
       }
 
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new DeleteHealthCheckHttpRequest(
-          access_token, callback, fields, healthCheck, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        callback,
+        fields,
+        healthCheck,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -334,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -342,29 +390,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DeleteHealthCheckHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "healthCheck="
-        + healthCheck
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "healthCheck=" + healthCheck + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +409,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof DeleteHealthCheckHttpRequest) {
       DeleteHealthCheckHttpRequest that = (DeleteHealthCheckHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.healthCheck, that.getHealthCheck())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.healthCheck, that.getHealthCheck()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +427,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, healthCheck, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      callback,
+      fields,
+      healthCheck,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java
index fb54a346295e..03ec48d5b1a7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,6 +39,7 @@ public final class DeleteHttpHealthCheckHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteHttpHealthCheckHttpRequest() {
@@ -46,9 +50,11 @@ private DeleteHttpHealthCheckHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
+
   private DeleteHttpHealthCheckHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +63,9 @@ private DeleteHttpHealthCheckHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String requestId,
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -65,6 +73,7 @@ private DeleteHttpHealthCheckHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -92,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -121,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -161,28 +176,30 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(DeleteHttpHealthCheckHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DeleteHttpHealthCheckHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final DeleteHttpHealthCheckHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new DeleteHttpHealthCheckHttpRequest();
   }
@@ -195,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -222,6 +240,9 @@ public Builder mergeFrom(DeleteHttpHealthCheckHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -236,6 +257,7 @@ public Builder mergeFrom(DeleteHttpHealthCheckHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -302,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -311,18 +342,34 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public DeleteHttpHealthCheckHttpRequest build() {
       String missing = "";
 
+
+
       if (httpHealthCheck == null) {
         missing += " httpHealthCheck";
       }
 
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new DeleteHttpHealthCheckHttpRequest(
-          access_token, callback, fields, httpHealthCheck, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        callback,
+        fields,
+        httpHealthCheck,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -334,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -342,29 +390,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DeleteHttpHealthCheckHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "httpHealthCheck="
-        + httpHealthCheck
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "httpHealthCheck=" + httpHealthCheck + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +409,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof DeleteHttpHealthCheckHttpRequest) {
       DeleteHttpHealthCheckHttpRequest that = (DeleteHttpHealthCheckHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +427,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, httpHealthCheck, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      callback,
+      fields,
+      httpHealthCheck,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java
index 02ae5a4bce71..3c7ec91b2ef1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteHttpsHealthCheckHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteHttpsHealthCheckHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteHttpsHealthCheckHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteHttpsHealthCheckHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteHttpsHealthCheckHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteHttpsHealthCheckHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteHttpsHealthCheckHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteHttpsHealthCheckHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteHttpsHealthCheckHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java
index 062f6a56f101..1fc732fdeed4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteImageHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteImageHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteImageHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteImageHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteImageHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteImageHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteImageHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteImageHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteImageHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java
index eb457fca0dc0..55f3820cbdce 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteInstanceGroupHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteInstanceGroupHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteInstanceGroupHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteInstanceGroupHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteInstanceGroupHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteInstanceGroupHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteInstanceGroupHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteInstanceGroupHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteInstanceGroupHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java
index ed164619e352..92add41e3e2d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteInstanceGroupManagerHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteInstanceGroupManagerHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteInstanceGroupManagerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteInstanceGroupManagerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteInstanceGroupManagerHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteInstanceGroupManagerHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteInstanceGroupManagerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java
index 91e7a51f655b..8c343c6c3647 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteInstanceHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java
index b117eefe65b8..6c390254eeea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteInstanceTemplateHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteInstanceTemplateHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteInstanceTemplateHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteInstanceTemplateHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteInstanceTemplateHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteInstanceTemplateHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteInstanceTemplateHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteInstanceTemplateHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteInstanceTemplateHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java
index fe4f1e2dc83a..e48772c68eb6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java
@@ -40,6 +40,7 @@ public final class DeleteInstancesInstanceGroupManagerHttpRequest implements Api
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteInstancesInstanceGroupManagerHttpRequest() {
@@ -51,6 +52,7 @@ private DeleteInstancesInstanceGroupManagerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private DeleteInstancesInstanceGroupManagerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private DeleteInstancesInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(DeleteInstancesInstanceGroupManagerHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(DeleteInstancesInstanceGroupManagerHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public DeleteInstancesInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public DeleteInstancesInstanceGroupManagerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java
index 1dd25cee840b..da67c3e6ef0f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java
@@ -40,6 +40,7 @@ public final class DeleteInstancesRegionInstanceGroupManagerHttpRequest implemen
   private final String prettyPrint;
   private final String quotaUser;
   private final RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource;
+  private final String requestId;
   private final String userIp;
 
   private DeleteInstancesRegionInstanceGroupManagerHttpRequest() {
@@ -51,6 +52,7 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest() {
     this.prettyPrint = null;
     this.quotaUser = null;
     this.regionInstanceGroupManagersDeleteInstancesRequestResource = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest(
       String prettyPrint,
       String quotaUser,
       RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest(
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
     this.regionInstanceGroupManagersDeleteInstancesRequestResource = regionInstanceGroupManagersDeleteInstancesRequestResource;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource") && regionInstanceGroupManagersDeleteInstancesRequestResource != null) {
       fieldMap.put("regionInstanceGroupManagersDeleteInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("regionInstanceGroupManagersDeleteInstancesRequestResource")) {
       return String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public RegionInstanceGroupManagersDeleteInstancesRequest getRegionInstanceGroupM
     return regionInstanceGroupManagersDeleteInstancesRequestResource;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String prettyPrint;
     private String quotaUser;
     private RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(DeleteInstancesRegionInstanceGroupManagerHttpRequest ot
       if (other.getRegionInstanceGroupManagersDeleteInstancesRequestResource() != null) {
         this.regionInstanceGroupManagersDeleteInstancesRequestResource = other.regionInstanceGroupManagersDeleteInstancesRequestResource;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(DeleteInstancesRegionInstanceGroupManagerHttpRequest ot
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
       this.regionInstanceGroupManagersDeleteInstancesRequestResource = source.regionInstanceGroupManagersDeleteInstancesRequestResource;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setRegionInstanceGroupManagersDeleteInstancesRequestResource(Regi
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public DeleteInstancesRegionInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public DeleteInstancesRegionInstanceGroupManagerHttpRequest build() {
         prettyPrint,
         quotaUser,
         regionInstanceGroupManagersDeleteInstancesRequestResource,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
       newBuilder.setRegionInstanceGroupManagersDeleteInstancesRequestResource(this.regionInstanceGroupManagersDeleteInstancesRequestResource);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
         + "regionInstanceGroupManagersDeleteInstancesRequestResource=" + regionInstanceGroupManagersDeleteInstancesRequestResource + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
           Objects.equals(this.regionInstanceGroupManagersDeleteInstancesRequestResource, that.getRegionInstanceGroupManagersDeleteInstancesRequestResource()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       prettyPrint,
       quotaUser,
       regionInstanceGroupManagersDeleteInstancesRequestResource,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java
new file mode 100644
index 000000000000..5df37d464305
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class DeleteInterconnectAttachmentHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String interconnectAttachment;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteInterconnectAttachmentHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.interconnectAttachment = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private DeleteInterconnectAttachmentHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String interconnectAttachment,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.interconnectAttachment = interconnectAttachment;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) {
+      fieldMap.put("interconnectAttachment", Collections.singletonList(String.valueOf(interconnectAttachment)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("interconnectAttachment")) {
+      return String.valueOf(interconnectAttachment);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInterconnectAttachment() {
+    return interconnectAttachment;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(DeleteInterconnectAttachmentHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteInterconnectAttachmentHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final DeleteInterconnectAttachmentHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new DeleteInterconnectAttachmentHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String interconnectAttachment;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteInterconnectAttachmentHttpRequest other) {
+      if (other == DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInterconnectAttachment() != null) {
+        this.interconnectAttachment = other.interconnectAttachment;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteInterconnectAttachmentHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.interconnectAttachment = source.interconnectAttachment;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInterconnectAttachment() {
+      return interconnectAttachment;
+    }
+
+    public Builder setInterconnectAttachment(String interconnectAttachment) {
+      this.interconnectAttachment = interconnectAttachment;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public DeleteInterconnectAttachmentHttpRequest build() {
+      String missing = "";
+
+
+
+      if (interconnectAttachment == null) {
+        missing += " interconnectAttachment";
+      }
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteInterconnectAttachmentHttpRequest(
+        access_token,
+        callback,
+        fields,
+        interconnectAttachment,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInterconnectAttachment(this.interconnectAttachment);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteInterconnectAttachmentHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "interconnectAttachment=" + interconnectAttachment + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteInterconnectAttachmentHttpRequest) {
+      DeleteInterconnectAttachmentHttpRequest that = (DeleteInterconnectAttachmentHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      interconnectAttachment,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java
new file mode 100644
index 000000000000..f6704a45dadd
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class DeleteInterconnectHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String interconnect;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteInterconnectHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.interconnect = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private DeleteInterconnectHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String interconnect,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.interconnect = interconnect;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("interconnect") && interconnect != null) {
+      fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("interconnect")) {
+      return String.valueOf(interconnect);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInterconnect() {
+    return interconnect;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(DeleteInterconnectHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteInterconnectHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final DeleteInterconnectHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new DeleteInterconnectHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String interconnect;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteInterconnectHttpRequest other) {
+      if (other == DeleteInterconnectHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInterconnect() != null) {
+        this.interconnect = other.interconnect;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteInterconnectHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.interconnect = source.interconnect;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInterconnect() {
+      return interconnect;
+    }
+
+    public Builder setInterconnect(String interconnect) {
+      this.interconnect = interconnect;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public DeleteInterconnectHttpRequest build() {
+      String missing = "";
+
+
+
+      if (interconnect == null) {
+        missing += " interconnect";
+      }
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteInterconnectHttpRequest(
+        access_token,
+        callback,
+        fields,
+        interconnect,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInterconnect(this.interconnect);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteInterconnectHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "interconnect=" + interconnect + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteInterconnectHttpRequest) {
+      DeleteInterconnectHttpRequest that = (DeleteInterconnectHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.interconnect, that.getInterconnect()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      interconnect,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java
index 5110312966e3..18a1da6940f9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteNetworkHttpRequest implements ApiMessage {
   private final String network;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteNetworkHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteNetworkHttpRequest() {
     this.network = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteNetworkHttpRequest(
       String network,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteNetworkHttpRequest(
     this.network = network;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String network;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteNetworkHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteNetworkHttpRequest other) {
       this.network = source.network;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteNetworkHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteNetworkHttpRequest build() {
         network,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setNetwork(this.network);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "network=" + network + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.network, that.getNetwork()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       network,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java
index 1b1532fb6f99..11958472654b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteRegionAutoscalerHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteRegionAutoscalerHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteRegionAutoscalerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteRegionAutoscalerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteRegionAutoscalerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteRegionAutoscalerHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteRegionAutoscalerHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteRegionAutoscalerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteRegionAutoscalerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java
index 4f4c3b8a73dd..47a4531a1000 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteRegionBackendServiceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteRegionBackendServiceHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteRegionBackendServiceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteRegionBackendServiceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteRegionBackendServiceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteRegionBackendServiceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteRegionBackendServiceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteRegionBackendServiceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteRegionBackendServiceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java
index be5a2f799255..c0db3e65c9e5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java
@@ -39,6 +39,7 @@ public final class DeleteRegionInstanceGroupManagerHttpRequest implements ApiMes
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeleteRegionInstanceGroupManagerHttpRequest() {
@@ -49,6 +50,7 @@ private DeleteRegionInstanceGroupManagerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private DeleteRegionInstanceGroupManagerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private DeleteRegionInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(DeleteRegionInstanceGroupManagerHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(DeleteRegionInstanceGroupManagerHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public DeleteRegionInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public DeleteRegionInstanceGroupManagerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java
index 1a2c3fbb4a27..b5940ea8626c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -35,6 +38,7 @@ public final class DeleteRouteHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String route;
   private final String userIp;
 
@@ -45,10 +49,12 @@ private DeleteRouteHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.route = null;
     this.userIp = null;
   }
 
+
   private DeleteRouteHttpRequest(
       String access_token,
       String callback,
@@ -56,14 +62,17 @@ private DeleteRouteHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String route,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.route = route;
     this.userIp = userIp;
   }
@@ -89,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("route") && route != null) {
       fieldMap.put("route", Collections.singletonList(String.valueOf(route)));
     }
@@ -118,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("route")) {
       return String.valueOf(route);
     }
@@ -157,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getRoute() {
     return route;
   }
@@ -165,24 +184,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(DeleteRouteHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DeleteRouteHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final DeleteRouteHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new DeleteRouteHttpRequest();
   }
@@ -194,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String route;
     private String userIp;
 
@@ -219,6 +237,9 @@ public Builder mergeFrom(DeleteRouteHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getRoute() != null) {
         this.route = other.route;
       }
@@ -235,6 +256,7 @@ public Builder mergeFrom(DeleteRouteHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.route = source.route;
       this.userIp = source.userIp;
     }
@@ -293,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getRoute() {
       return route;
     }
@@ -311,9 +342,16 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public DeleteRouteHttpRequest build() {
       String missing = "";
 
+
+
+
+
+
+
       if (route == null) {
         missing += " route";
       }
@@ -322,7 +360,16 @@ public DeleteRouteHttpRequest build() {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new DeleteRouteHttpRequest(
-          access_token, callback, fields, key, prettyPrint, quotaUser, route, userIp);
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        route,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -333,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setRoute(this.route);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -342,29 +390,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DeleteRouteHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "route="
-        + route
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "route=" + route + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,20 +409,33 @@ public boolean equals(Object o) {
     }
     if (o instanceof DeleteRouteHttpRequest) {
       DeleteRouteHttpRequest that = (DeleteRouteHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.route, that.getRoute())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.route, that.getRoute()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(access_token, callback, fields, key, prettyPrint, quotaUser, route, userIp);
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      route,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java
index 39840a7c9591..aaaa9cdae270 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -35,6 +38,7 @@ public final class DeleteRouterHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String router;
   private final String userIp;
 
@@ -45,10 +49,12 @@ private DeleteRouterHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.router = null;
     this.userIp = null;
   }
 
+
   private DeleteRouterHttpRequest(
       String access_token,
       String callback,
@@ -56,14 +62,17 @@ private DeleteRouterHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String router,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.router = router;
     this.userIp = userIp;
   }
@@ -89,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("router") && router != null) {
       fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
     }
@@ -118,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("router")) {
       return String.valueOf(router);
     }
@@ -157,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getRouter() {
     return router;
   }
@@ -165,24 +184,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(DeleteRouterHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DeleteRouterHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final DeleteRouterHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new DeleteRouterHttpRequest();
   }
@@ -194,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String router;
     private String userIp;
 
@@ -219,6 +237,9 @@ public Builder mergeFrom(DeleteRouterHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getRouter() != null) {
         this.router = other.router;
       }
@@ -235,6 +256,7 @@ public Builder mergeFrom(DeleteRouterHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.router = source.router;
       this.userIp = source.userIp;
     }
@@ -293,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getRouter() {
       return router;
     }
@@ -311,9 +342,16 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public DeleteRouterHttpRequest build() {
       String missing = "";
 
+
+
+
+
+
+
       if (router == null) {
         missing += " router";
       }
@@ -322,7 +360,16 @@ public DeleteRouterHttpRequest build() {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new DeleteRouterHttpRequest(
-          access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp);
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        router,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -333,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setRouter(this.router);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -342,29 +390,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DeleteRouterHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "router="
-        + router
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "router=" + router + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +409,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof DeleteRouterHttpRequest) {
       DeleteRouterHttpRequest that = (DeleteRouterHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.router, that.getRouter())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.router, that.getRouter()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +427,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp);
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      router,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java
index fb5c26d280bf..9e76b5c9aee9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteSnapshotHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String snapshot;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteSnapshotHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.snapshot = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteSnapshotHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String snapshot,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteSnapshotHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.snapshot = snapshot;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("snapshot") && snapshot != null) {
       fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("snapshot")) {
       return String.valueOf(snapshot);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getSnapshot() {
     return snapshot;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String snapshot;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteSnapshotHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getSnapshot() != null) {
         this.snapshot = other.snapshot;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteSnapshotHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.snapshot = source.snapshot;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getSnapshot() {
       return snapshot;
     }
@@ -323,6 +351,7 @@ public DeleteSnapshotHttpRequest build() {
 
 
 
+
       if (snapshot == null) {
         missing += " snapshot";
       }
@@ -337,6 +366,7 @@ public DeleteSnapshotHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         snapshot,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setSnapshot(this.snapshot);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "snapshot=" + snapshot + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.snapshot, that.getSnapshot()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       snapshot,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java
index 3f3c1f4a57c3..17905af89720 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteSslCertificateHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String sslCertificate;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteSslCertificateHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.sslCertificate = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteSslCertificateHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String sslCertificate,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteSslCertificateHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.sslCertificate = sslCertificate;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("sslCertificate") && sslCertificate != null) {
       fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("sslCertificate")) {
       return String.valueOf(sslCertificate);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getSslCertificate() {
     return sslCertificate;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String sslCertificate;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteSslCertificateHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getSslCertificate() != null) {
         this.sslCertificate = other.sslCertificate;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteSslCertificateHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.sslCertificate = source.sslCertificate;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getSslCertificate() {
       return sslCertificate;
     }
@@ -323,6 +351,7 @@ public DeleteSslCertificateHttpRequest build() {
 
 
 
+
       if (sslCertificate == null) {
         missing += " sslCertificate";
       }
@@ -337,6 +366,7 @@ public DeleteSslCertificateHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         sslCertificate,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setSslCertificate(this.sslCertificate);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "sslCertificate=" + sslCertificate + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.sslCertificate, that.getSslCertificate()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       sslCertificate,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java
index 4e705b060b16..a2c1698689c7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteSubnetworkHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String subnetwork;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteSubnetworkHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.subnetwork = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteSubnetworkHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String subnetwork,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteSubnetworkHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.subnetwork = subnetwork;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("subnetwork") && subnetwork != null) {
       fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("subnetwork")) {
       return String.valueOf(subnetwork);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getSubnetwork() {
     return subnetwork;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String subnetwork;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteSubnetworkHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getSubnetwork() != null) {
         this.subnetwork = other.subnetwork;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteSubnetworkHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.subnetwork = source.subnetwork;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getSubnetwork() {
       return subnetwork;
     }
@@ -323,6 +351,7 @@ public DeleteSubnetworkHttpRequest build() {
 
 
 
+
       if (subnetwork == null) {
         missing += " subnetwork";
       }
@@ -337,6 +366,7 @@ public DeleteSubnetworkHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         subnetwork,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setSubnetwork(this.subnetwork);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "subnetwork=" + subnetwork + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.subnetwork, that.getSubnetwork()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       subnetwork,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java
index 9aa0a4fe93e3..16e580db46bd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteTargetHttpProxyHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetHttpProxy;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteTargetHttpProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetHttpProxy = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteTargetHttpProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetHttpProxy,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteTargetHttpProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetHttpProxy = targetHttpProxy;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) {
       fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetHttpProxy")) {
       return String.valueOf(targetHttpProxy);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetHttpProxy() {
     return targetHttpProxy;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetHttpProxy;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteTargetHttpProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetHttpProxy() != null) {
         this.targetHttpProxy = other.targetHttpProxy;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteTargetHttpProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetHttpProxy = source.targetHttpProxy;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetHttpProxy() {
       return targetHttpProxy;
     }
@@ -323,6 +351,7 @@ public DeleteTargetHttpProxyHttpRequest build() {
 
 
 
+
       if (targetHttpProxy == null) {
         missing += " targetHttpProxy";
       }
@@ -337,6 +366,7 @@ public DeleteTargetHttpProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetHttpProxy,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetHttpProxy(this.targetHttpProxy);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetHttpProxy=" + targetHttpProxy + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetHttpProxy,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java
index 87b1ce126bde..fc92ef4b9adf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteTargetHttpsProxyHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetHttpsProxy;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteTargetHttpsProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetHttpsProxy = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteTargetHttpsProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetHttpsProxy,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteTargetHttpsProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetHttpsProxy = targetHttpsProxy;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
       fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetHttpsProxy")) {
       return String.valueOf(targetHttpsProxy);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetHttpsProxy() {
     return targetHttpsProxy;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetHttpsProxy;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteTargetHttpsProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetHttpsProxy() != null) {
         this.targetHttpsProxy = other.targetHttpsProxy;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteTargetHttpsProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetHttpsProxy = source.targetHttpsProxy;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetHttpsProxy() {
       return targetHttpsProxy;
     }
@@ -323,6 +351,7 @@ public DeleteTargetHttpsProxyHttpRequest build() {
 
 
 
+
       if (targetHttpsProxy == null) {
         missing += " targetHttpsProxy";
       }
@@ -337,6 +366,7 @@ public DeleteTargetHttpsProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetHttpsProxy,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetHttpsProxy(this.targetHttpsProxy);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetHttpsProxy=" + targetHttpsProxy + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetHttpsProxy,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java
index f511b02f13f6..3f0ac5096c30 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteTargetInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetInstance;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteTargetInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetInstance = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteTargetInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetInstance,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteTargetInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetInstance = targetInstance;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetInstance") && targetInstance != null) {
       fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetInstance")) {
       return String.valueOf(targetInstance);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetInstance() {
     return targetInstance;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetInstance;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteTargetInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetInstance() != null) {
         this.targetInstance = other.targetInstance;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteTargetInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetInstance = source.targetInstance;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetInstance() {
       return targetInstance;
     }
@@ -323,6 +351,7 @@ public DeleteTargetInstanceHttpRequest build() {
 
 
 
+
       if (targetInstance == null) {
         missing += " targetInstance";
       }
@@ -337,6 +366,7 @@ public DeleteTargetInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetInstance,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetInstance(this.targetInstance);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetInstance=" + targetInstance + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetInstance, that.getTargetInstance()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetInstance,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java
index dfdced03ab8f..4f85a3066941 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteTargetPoolHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetPool;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteTargetPoolHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetPool = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteTargetPoolHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetPool,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteTargetPoolHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetPool = targetPool;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetPool") && targetPool != null) {
       fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetPool")) {
       return String.valueOf(targetPool);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetPool() {
     return targetPool;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetPool;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteTargetPoolHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetPool() != null) {
         this.targetPool = other.targetPool;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteTargetPoolHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetPool = source.targetPool;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetPool() {
       return targetPool;
     }
@@ -323,6 +351,7 @@ public DeleteTargetPoolHttpRequest build() {
 
 
 
+
       if (targetPool == null) {
         missing += " targetPool";
       }
@@ -337,6 +366,7 @@ public DeleteTargetPoolHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetPool,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetPool(this.targetPool);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetPool=" + targetPool + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetPool, that.getTargetPool()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetPool,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java
index cccd039942bd..fa2bdcaf3456 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteTargetSslProxyHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetSslProxy;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteTargetSslProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetSslProxy = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteTargetSslProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetSslProxy,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteTargetSslProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetSslProxy = targetSslProxy;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
       fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetSslProxy")) {
       return String.valueOf(targetSslProxy);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetSslProxy() {
     return targetSslProxy;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetSslProxy;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteTargetSslProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetSslProxy() != null) {
         this.targetSslProxy = other.targetSslProxy;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteTargetSslProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetSslProxy = source.targetSslProxy;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetSslProxy() {
       return targetSslProxy;
     }
@@ -323,6 +351,7 @@ public DeleteTargetSslProxyHttpRequest build() {
 
 
 
+
       if (targetSslProxy == null) {
         missing += " targetSslProxy";
       }
@@ -337,6 +366,7 @@ public DeleteTargetSslProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetSslProxy,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetSslProxy(this.targetSslProxy);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetSslProxy=" + targetSslProxy + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetSslProxy,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java
new file mode 100644
index 000000000000..da35f00851da
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class DeleteTargetTcpProxyHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String targetTcpProxy;
+  private final String userIp;
+
+  private DeleteTargetTcpProxyHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.targetTcpProxy = null;
+    this.userIp = null;
+  }
+
+
+  private DeleteTargetTcpProxyHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String targetTcpProxy,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.targetTcpProxy = targetTcpProxy;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
+      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("targetTcpProxy")) {
+      return String.valueOf(targetTcpProxy);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getTargetTcpProxy() {
+    return targetTcpProxy;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(DeleteTargetTcpProxyHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteTargetTcpProxyHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final DeleteTargetTcpProxyHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new DeleteTargetTcpProxyHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String targetTcpProxy;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteTargetTcpProxyHttpRequest other) {
+      if (other == DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getTargetTcpProxy() != null) {
+        this.targetTcpProxy = other.targetTcpProxy;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteTargetTcpProxyHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.targetTcpProxy = source.targetTcpProxy;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getTargetTcpProxy() {
+      return targetTcpProxy;
+    }
+
+    public Builder setTargetTcpProxy(String targetTcpProxy) {
+      this.targetTcpProxy = targetTcpProxy;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public DeleteTargetTcpProxyHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+      if (targetTcpProxy == null) {
+        missing += " targetTcpProxy";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteTargetTcpProxyHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        targetTcpProxy,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setTargetTcpProxy(this.targetTcpProxy);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteTargetTcpProxyHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "targetTcpProxy=" + targetTcpProxy + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteTargetTcpProxyHttpRequest) {
+      DeleteTargetTcpProxyHttpRequest that = (DeleteTargetTcpProxyHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      targetTcpProxy,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java
index be2df80b877c..c39570ffeb45 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteTargetVpnGatewayHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetVpnGateway;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteTargetVpnGatewayHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetVpnGateway = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteTargetVpnGatewayHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetVpnGateway,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteTargetVpnGatewayHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetVpnGateway = targetVpnGateway;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) {
       fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetVpnGateway")) {
       return String.valueOf(targetVpnGateway);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetVpnGateway() {
     return targetVpnGateway;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetVpnGateway;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteTargetVpnGatewayHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetVpnGateway() != null) {
         this.targetVpnGateway = other.targetVpnGateway;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteTargetVpnGatewayHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetVpnGateway = source.targetVpnGateway;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetVpnGateway() {
       return targetVpnGateway;
     }
@@ -323,6 +351,7 @@ public DeleteTargetVpnGatewayHttpRequest build() {
 
 
 
+
       if (targetVpnGateway == null) {
         missing += " targetVpnGateway";
       }
@@ -337,6 +366,7 @@ public DeleteTargetVpnGatewayHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetVpnGateway,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetVpnGateway(this.targetVpnGateway);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetVpnGateway=" + targetVpnGateway + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetVpnGateway,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java
index a2bc7526cbdd..f45f70c8ec39 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteUrlMapHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String urlMap;
   private final String userIp;
 
@@ -48,6 +49,7 @@ private DeleteUrlMapHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.urlMap = null;
     this.userIp = null;
   }
@@ -60,6 +62,7 @@ private DeleteUrlMapHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String urlMap,
       String userIp
       ) {
@@ -69,6 +72,7 @@ private DeleteUrlMapHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.urlMap = urlMap;
     this.userIp = userIp;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("urlMap") && urlMap != null) {
       fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("urlMap")) {
       return String.valueOf(urlMap);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUrlMap() {
     return urlMap;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String urlMap;
     private String userIp;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteUrlMapHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUrlMap() != null) {
         this.urlMap = other.urlMap;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteUrlMapHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.urlMap = source.urlMap;
       this.userIp = source.userIp;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUrlMap() {
       return urlMap;
     }
@@ -323,6 +351,7 @@ public DeleteUrlMapHttpRequest build() {
 
 
 
+
       if (urlMap == null) {
         missing += " urlMap";
       }
@@ -337,6 +366,7 @@ public DeleteUrlMapHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         urlMap,
         userIp
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUrlMap(this.urlMap);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "urlMap=" + urlMap + ", "
         + "userIp=" + userIp
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.urlMap, that.getUrlMap()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       urlMap,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java
index 2ddedd993d93..16b59809675e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java
@@ -38,6 +38,7 @@ public final class DeleteVpnTunnelHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
   private final String vpnTunnel;
 
@@ -48,6 +49,7 @@ private DeleteVpnTunnelHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
     this.vpnTunnel = null;
   }
@@ -60,6 +62,7 @@ private DeleteVpnTunnelHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp,
       String vpnTunnel
       ) {
@@ -69,6 +72,7 @@ private DeleteVpnTunnelHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
     this.vpnTunnel = vpnTunnel;
   }
@@ -94,6 +98,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -123,6 +130,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -162,6 +172,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -197,6 +211,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
     private String vpnTunnel;
 
@@ -222,6 +237,9 @@ public Builder mergeFrom(DeleteVpnTunnelHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -238,6 +256,7 @@ public Builder mergeFrom(DeleteVpnTunnelHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
       this.vpnTunnel = source.vpnTunnel;
     }
@@ -296,6 +315,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -324,6 +352,7 @@ public DeleteVpnTunnelHttpRequest build() {
 
 
 
+
       if (vpnTunnel == null) {
         missing += " vpnTunnel";
       }
@@ -337,6 +366,7 @@ public DeleteVpnTunnelHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp,
         vpnTunnel
       );
@@ -350,6 +380,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       newBuilder.setVpnTunnel(this.vpnTunnel);
       return newBuilder;
@@ -365,6 +396,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp + ", "
         + "vpnTunnel=" + vpnTunnel
         + "}";
@@ -384,6 +416,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp()) &&
           Objects.equals(this.vpnTunnel, that.getVpnTunnel())
           ;
@@ -400,6 +433,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp,
       vpnTunnel
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java
new file mode 100644
index 000000000000..5b58c9173a6a
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class Denied implements ApiMessage {
+  private final String iPProtocol;
+  private final List ports;
+
+  private Denied() {
+    this.iPProtocol = null;
+    this.ports = null;
+  }
+
+
+  private Denied(
+      String iPProtocol,
+      List ports
+      ) {
+    this.iPProtocol = iPProtocol;
+    this.ports = ports;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("iPProtocol") && iPProtocol != null) {
+      fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol)));
+    }
+    if (fieldNames.contains("ports") && ports != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (String item : ports) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("ports", stringList.build());
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("iPProtocol")) {
+      return String.valueOf(iPProtocol);
+    }
+    if (fieldName.equals("ports")) {
+      return String.valueOf(ports);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getIPProtocol() {
+    return iPProtocol;
+  }
+
+  public List getPortsList() {
+    return ports;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(Denied prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static Denied getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final Denied DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new Denied();
+  }
+
+  public static class Builder {
+    private String iPProtocol;
+    private List ports;
+
+    Builder() {}
+
+    public Builder mergeFrom(Denied other) {
+      if (other == Denied.getDefaultInstance()) return this;
+      if (other.getIPProtocol() != null) {
+        this.iPProtocol = other.iPProtocol;
+      }
+      if (other.getPortsList() != null) {
+        this.ports = other.ports;
+      }
+      return this;
+    }
+
+    Builder(Denied source) {
+      this.iPProtocol = source.iPProtocol;
+      this.ports = source.ports;
+    }
+
+    public String getIPProtocol() {
+      return iPProtocol;
+    }
+
+    public Builder setIPProtocol(String iPProtocol) {
+      this.iPProtocol = iPProtocol;
+      return this;
+    }
+
+    public List getPortsList() {
+      return ports;
+    }
+
+    public Builder addAllPorts(List ports) {
+      if (this.ports == null) {
+        this.ports = new ArrayList<>(ports.size());
+      }
+      this.ports.addAll(ports);
+      return this;
+    }
+
+    public Builder addPorts(String ports) {
+      this.ports.add(ports);
+      return this;
+    }
+
+
+    public Denied build() {
+
+      return new Denied(
+        iPProtocol,
+        ports
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setIPProtocol(this.iPProtocol);
+      newBuilder.addAllPorts(this.ports);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "Denied{"
+        + "iPProtocol=" + iPProtocol + ", "
+        + "ports=" + ports
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof Denied) {
+      Denied that = (Denied) o;
+      return
+          Objects.equals(this.iPProtocol, that.getIPProtocol()) &&
+          Objects.equals(this.ports, that.getPortsList())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      iPProtocol,
+      ports
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java
index 20d68ba4b9c7..116ac13076c3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java
@@ -40,6 +40,7 @@ public final class DeprecateImageHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DeprecateImageHttpRequest() {
@@ -51,6 +52,7 @@ private DeprecateImageHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private DeprecateImageHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private DeprecateImageHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(DeprecateImageHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(DeprecateImageHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public DeprecateImageHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public DeprecateImageHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java
index 8a41d48a8cba..2ef2d67f90db 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java
@@ -40,6 +40,7 @@ public final class DetachDiskInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private DetachDiskInstanceHttpRequest() {
@@ -51,6 +52,7 @@ private DetachDiskInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private DetachDiskInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private DetachDiskInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(DetachDiskInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(DetachDiskInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -358,6 +386,7 @@ public DetachDiskInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -370,6 +399,7 @@ public DetachDiskInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -384,6 +414,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -400,6 +431,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -420,6 +452,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -437,6 +470,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java
new file mode 100644
index 000000000000..38b8fbe66e9c
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class DisableXpnHostProjectHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String project;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DisableXpnHostProjectHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private DisableXpnHostProjectHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String project,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("project") && project != null) {
+      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("project")) {
+      return String.valueOf(project);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(DisableXpnHostProjectHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DisableXpnHostProjectHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final DisableXpnHostProjectHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new DisableXpnHostProjectHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String project;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DisableXpnHostProjectHttpRequest other) {
+      if (other == DisableXpnHostProjectHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DisableXpnHostProjectHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public DisableXpnHostProjectHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+      if (project == null) {
+        missing += " project";
+      }
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DisableXpnHostProjectHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        project,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DisableXpnHostProjectHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "project=" + project + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DisableXpnHostProjectHttpRequest) {
+      DisableXpnHostProjectHttpRequest that = (DisableXpnHostProjectHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      project,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java
new file mode 100644
index 000000000000..6ff09081ff4b
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class DisableXpnResourceProjectHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String project;
+  private final ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DisableXpnResourceProjectHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.projectsDisableXpnResourceRequestResource = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private DisableXpnResourceProjectHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String project,
+      ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.projectsDisableXpnResourceRequestResource = projectsDisableXpnResourceRequestResource;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("project") && project != null) {
+      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
+    }
+    if (fieldNames.contains("projectsDisableXpnResourceRequestResource") && projectsDisableXpnResourceRequestResource != null) {
+      fieldMap.put("projectsDisableXpnResourceRequestResource", Collections.singletonList(String.valueOf(projectsDisableXpnResourceRequestResource)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("project")) {
+      return String.valueOf(project);
+    }
+    if (fieldName.equals("projectsDisableXpnResourceRequestResource")) {
+      return String.valueOf(projectsDisableXpnResourceRequestResource);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ProjectsDisableXpnResourceRequest getApiMessageRequestBody() {
+    return projectsDisableXpnResourceRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public ProjectsDisableXpnResourceRequest getProjectsDisableXpnResourceRequestResource() {
+    return projectsDisableXpnResourceRequestResource;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(DisableXpnResourceProjectHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DisableXpnResourceProjectHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final DisableXpnResourceProjectHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new DisableXpnResourceProjectHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String project;
+    private ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DisableXpnResourceProjectHttpRequest other) {
+      if (other == DisableXpnResourceProjectHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getProjectsDisableXpnResourceRequestResource() != null) {
+        this.projectsDisableXpnResourceRequestResource = other.projectsDisableXpnResourceRequestResource;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DisableXpnResourceProjectHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.projectsDisableXpnResourceRequestResource = source.projectsDisableXpnResourceRequestResource;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public ProjectsDisableXpnResourceRequest getProjectsDisableXpnResourceRequestResource() {
+      return projectsDisableXpnResourceRequestResource;
+    }
+
+    public Builder setProjectsDisableXpnResourceRequestResource(ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) {
+      this.projectsDisableXpnResourceRequestResource = projectsDisableXpnResourceRequestResource;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public DisableXpnResourceProjectHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+      if (project == null) {
+        missing += " project";
+      }
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DisableXpnResourceProjectHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        project,
+        projectsDisableXpnResourceRequestResource,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setProjectsDisableXpnResourceRequestResource(this.projectsDisableXpnResourceRequestResource);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DisableXpnResourceProjectHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "project=" + project + ", "
+        + "projectsDisableXpnResourceRequestResource=" + projectsDisableXpnResourceRequestResource + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DisableXpnResourceProjectHttpRequest) {
+      DisableXpnResourceProjectHttpRequest that = (DisableXpnResourceProjectHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.projectsDisableXpnResourceRequestResource, that.getProjectsDisableXpnResourceRequestResource()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      project,
+      projectsDisableXpnResourceRequestResource,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java
index 30c1ca10b1e4..1b0fc8fac81f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -34,8 +35,11 @@ public final class Disk implements ApiMessage {
   private final String creationTimestamp;
   private final String description;
   private final CustomerEncryptionKey diskEncryptionKey;
+  private final List guestOsFeatures;
   private final String id;
   private final String kind;
+  private final String labelFingerprint;
+  private final Map labels;
   private final String lastAttachTimestamp;
   private final String lastDetachTimestamp;
   private final List licenses;
@@ -58,8 +62,11 @@ private Disk() {
     this.creationTimestamp = null;
     this.description = null;
     this.diskEncryptionKey = null;
+    this.guestOsFeatures = null;
     this.id = null;
     this.kind = null;
+    this.labelFingerprint = null;
+    this.labels = null;
     this.lastAttachTimestamp = null;
     this.lastDetachTimestamp = null;
     this.licenses = null;
@@ -79,12 +86,16 @@ private Disk() {
     this.zone = null;
   }
 
+
   private Disk(
       String creationTimestamp,
       String description,
       CustomerEncryptionKey diskEncryptionKey,
+      List guestOsFeatures,
       String id,
       String kind,
+      String labelFingerprint,
+      Map labels,
       String lastAttachTimestamp,
       String lastDetachTimestamp,
       List licenses,
@@ -101,12 +112,16 @@ private Disk(
       String status,
       String type,
       List users,
-      String zone) {
+      String zone
+      ) {
     this.creationTimestamp = creationTimestamp;
     this.description = description;
     this.diskEncryptionKey = diskEncryptionKey;
+    this.guestOsFeatures = guestOsFeatures;
     this.id = id;
     this.kind = kind;
+    this.labelFingerprint = labelFingerprint;
+    this.labels = labels;
     this.lastAttachTimestamp = lastAttachTimestamp;
     this.lastDetachTimestamp = lastDetachTimestamp;
     this.licenses = licenses;
@@ -130,15 +145,20 @@ private Disk(
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
     if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
     }
     if (fieldNames.contains("description") && description != null) {
       fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
     }
     if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) {
-      fieldMap.put(
-          "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey)));
+      fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey)));
+    }
+    if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (GuestOsFeature item : guestOsFeatures) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("guestOsFeatures", stringList.build());
     }
     if (fieldNames.contains("id") && id != null) {
       fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
@@ -146,13 +166,17 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("kind") && kind != null) {
       fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
     }
+    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
+      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
+    }
+    if (fieldNames.contains("labels") && labels != null) {
+      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
+    }
     if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) {
-      fieldMap.put(
-          "lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp)));
+      fieldMap.put("lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp)));
     }
     if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) {
-      fieldMap.put(
-          "lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp)));
+      fieldMap.put("lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp)));
     }
     if (fieldNames.contains("licenses") && licenses != null) {
       ImmutableList.Builder stringList = ImmutableList.builder();
@@ -177,9 +201,7 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage)));
     }
     if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) {
-      fieldMap.put(
-          "sourceImageEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceImageEncryptionKey)));
+      fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey)));
     }
     if (fieldNames.contains("sourceImageId") && sourceImageId != null) {
       fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId)));
@@ -188,9 +210,7 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot)));
     }
     if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) {
-      fieldMap.put(
-          "sourceSnapshotEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey)));
+      fieldMap.put("sourceSnapshotEncryptionKey", Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey)));
     }
     if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) {
       fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId)));
@@ -225,12 +245,21 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("diskEncryptionKey")) {
       return String.valueOf(diskEncryptionKey);
     }
+    if (fieldName.equals("guestOsFeatures")) {
+      return String.valueOf(guestOsFeatures);
+    }
     if (fieldName.equals("id")) {
       return String.valueOf(id);
     }
     if (fieldName.equals("kind")) {
       return String.valueOf(kind);
     }
+    if (fieldName.equals("labelFingerprint")) {
+      return String.valueOf(labelFingerprint);
+    }
+    if (fieldName.equals("labels")) {
+      return String.valueOf(labels);
+    }
     if (fieldName.equals("lastAttachTimestamp")) {
       return String.valueOf(lastAttachTimestamp);
     }
@@ -303,6 +332,10 @@ public CustomerEncryptionKey getDiskEncryptionKey() {
     return diskEncryptionKey;
   }
 
+  public List getGuestOsFeaturesList() {
+    return guestOsFeatures;
+  }
+
   public String getId() {
     return id;
   }
@@ -311,6 +344,14 @@ public String getKind() {
     return kind;
   }
 
+  public String getLabelFingerprint() {
+    return labelFingerprint;
+  }
+
+  public Map getLabelsMap() {
+    return labels;
+  }
+
   public String getLastAttachTimestamp() {
     return lastAttachTimestamp;
   }
@@ -379,24 +420,22 @@ public String getZone() {
     return zone;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(Disk prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static Disk getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final Disk DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new Disk();
   }
@@ -405,8 +444,11 @@ public static class Builder {
     private String creationTimestamp;
     private String description;
     private CustomerEncryptionKey diskEncryptionKey;
+    private List guestOsFeatures;
     private String id;
     private String kind;
+    private String labelFingerprint;
+    private Map labels;
     private String lastAttachTimestamp;
     private String lastDetachTimestamp;
     private List licenses;
@@ -438,12 +480,21 @@ public Builder mergeFrom(Disk other) {
       if (other.getDiskEncryptionKey() != null) {
         this.diskEncryptionKey = other.diskEncryptionKey;
       }
+      if (other.getGuestOsFeaturesList() != null) {
+        this.guestOsFeatures = other.guestOsFeatures;
+      }
       if (other.getId() != null) {
         this.id = other.id;
       }
       if (other.getKind() != null) {
         this.kind = other.kind;
       }
+      if (other.getLabelFingerprint() != null) {
+        this.labelFingerprint = other.labelFingerprint;
+      }
+      if (other.getLabelsMap() != null) {
+        this.labels = other.labels;
+      }
       if (other.getLastAttachTimestamp() != null) {
         this.lastAttachTimestamp = other.lastAttachTimestamp;
       }
@@ -502,8 +553,11 @@ public Builder mergeFrom(Disk other) {
       this.creationTimestamp = source.creationTimestamp;
       this.description = source.description;
       this.diskEncryptionKey = source.diskEncryptionKey;
+      this.guestOsFeatures = source.guestOsFeatures;
       this.id = source.id;
       this.kind = source.kind;
+      this.labelFingerprint = source.labelFingerprint;
+      this.labels = source.labels;
       this.lastAttachTimestamp = source.lastAttachTimestamp;
       this.lastDetachTimestamp = source.lastDetachTimestamp;
       this.licenses = source.licenses;
@@ -550,6 +604,23 @@ public Builder setDiskEncryptionKey(CustomerEncryptionKey diskEncryptionKey) {
       return this;
     }
 
+    public List getGuestOsFeaturesList() {
+      return guestOsFeatures;
+    }
+
+    public Builder addAllGuestOsFeatures(List guestOsFeatures) {
+      if (this.guestOsFeatures == null) {
+        this.guestOsFeatures = new ArrayList<>(guestOsFeatures.size());
+      }
+      this.guestOsFeatures.addAll(guestOsFeatures);
+      return this;
+    }
+
+    public Builder addGuestOsFeatures(GuestOsFeature guestOsFeatures) {
+      this.guestOsFeatures.add(guestOsFeatures);
+      return this;
+    }
+
     public String getId() {
       return id;
     }
@@ -568,6 +639,24 @@ public Builder setKind(String kind) {
       return this;
     }
 
+    public String getLabelFingerprint() {
+      return labelFingerprint;
+    }
+
+    public Builder setLabelFingerprint(String labelFingerprint) {
+      this.labelFingerprint = labelFingerprint;
+      return this;
+    }
+
+    public Map getLabelsMap() {
+      return labels;
+    }
+
+    public Builder putAllLabels(Map labels) {
+      this.labels = labels;
+      return this;
+    }
+
     public String getLastAttachTimestamp() {
       return lastAttachTimestamp;
     }
@@ -679,8 +768,7 @@ public CustomerEncryptionKey getSourceSnapshotEncryptionKey() {
       return sourceSnapshotEncryptionKey;
     }
 
-    public Builder setSourceSnapshotEncryptionKey(
-        CustomerEncryptionKey sourceSnapshotEncryptionKey) {
+    public Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey) {
       this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey;
       return this;
     }
@@ -738,31 +826,59 @@ public Builder setZone(String zone) {
       return this;
     }
 
+
     public Disk build() {
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
       return new Disk(
-          creationTimestamp,
-          description,
-          diskEncryptionKey,
-          id,
-          kind,
-          lastAttachTimestamp,
-          lastDetachTimestamp,
-          licenses,
-          name,
-          options,
-          selfLink,
-          sizeGb,
-          sourceImage,
-          sourceImageEncryptionKey,
-          sourceImageId,
-          sourceSnapshot,
-          sourceSnapshotEncryptionKey,
-          sourceSnapshotId,
-          status,
-          type,
-          users,
-          zone);
+        creationTimestamp,
+        description,
+        diskEncryptionKey,
+        guestOsFeatures,
+        id,
+        kind,
+        labelFingerprint,
+        labels,
+        lastAttachTimestamp,
+        lastDetachTimestamp,
+        licenses,
+        name,
+        options,
+        selfLink,
+        sizeGb,
+        sourceImage,
+        sourceImageEncryptionKey,
+        sourceImageId,
+        sourceSnapshot,
+        sourceSnapshotEncryptionKey,
+        sourceSnapshotId,
+        status,
+        type,
+        users,
+        zone
+      );
     }
 
     public Builder clone() {
@@ -770,8 +886,11 @@ public Builder clone() {
       newBuilder.setCreationTimestamp(this.creationTimestamp);
       newBuilder.setDescription(this.description);
       newBuilder.setDiskEncryptionKey(this.diskEncryptionKey);
+      newBuilder.addAllGuestOsFeatures(this.guestOsFeatures);
       newBuilder.setId(this.id);
       newBuilder.setKind(this.kind);
+      newBuilder.setLabelFingerprint(this.labelFingerprint);
+      newBuilder.putAllLabels(this.labels);
       newBuilder.setLastAttachTimestamp(this.lastAttachTimestamp);
       newBuilder.setLastDetachTimestamp(this.lastDetachTimestamp);
       newBuilder.addAllLicenses(this.licenses);
@@ -796,71 +915,31 @@ public Builder clone() {
   @Override
   public String toString() {
     return "Disk{"
-        + "creationTimestamp="
-        + creationTimestamp
-        + ", "
-        + "description="
-        + description
-        + ", "
-        + "diskEncryptionKey="
-        + diskEncryptionKey
-        + ", "
-        + "id="
-        + id
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "lastAttachTimestamp="
-        + lastAttachTimestamp
-        + ", "
-        + "lastDetachTimestamp="
-        + lastDetachTimestamp
-        + ", "
-        + "licenses="
-        + licenses
-        + ", "
-        + "name="
-        + name
-        + ", "
-        + "options="
-        + options
-        + ", "
-        + "selfLink="
-        + selfLink
-        + ", "
-        + "sizeGb="
-        + sizeGb
-        + ", "
-        + "sourceImage="
-        + sourceImage
-        + ", "
-        + "sourceImageEncryptionKey="
-        + sourceImageEncryptionKey
-        + ", "
-        + "sourceImageId="
-        + sourceImageId
-        + ", "
-        + "sourceSnapshot="
-        + sourceSnapshot
-        + ", "
-        + "sourceSnapshotEncryptionKey="
-        + sourceSnapshotEncryptionKey
-        + ", "
-        + "sourceSnapshotId="
-        + sourceSnapshotId
-        + ", "
-        + "status="
-        + status
-        + ", "
-        + "type="
-        + type
-        + ", "
-        + "users="
-        + users
-        + ", "
-        + "zone="
-        + zone
+        + "creationTimestamp=" + creationTimestamp + ", "
+        + "description=" + description + ", "
+        + "diskEncryptionKey=" + diskEncryptionKey + ", "
+        + "guestOsFeatures=" + guestOsFeatures + ", "
+        + "id=" + id + ", "
+        + "kind=" + kind + ", "
+        + "labelFingerprint=" + labelFingerprint + ", "
+        + "labels=" + labels + ", "
+        + "lastAttachTimestamp=" + lastAttachTimestamp + ", "
+        + "lastDetachTimestamp=" + lastDetachTimestamp + ", "
+        + "licenses=" + licenses + ", "
+        + "name=" + name + ", "
+        + "options=" + options + ", "
+        + "selfLink=" + selfLink + ", "
+        + "sizeGb=" + sizeGb + ", "
+        + "sourceImage=" + sourceImage + ", "
+        + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + ", "
+        + "sourceImageId=" + sourceImageId + ", "
+        + "sourceSnapshot=" + sourceSnapshot + ", "
+        + "sourceSnapshotEncryptionKey=" + sourceSnapshotEncryptionKey + ", "
+        + "sourceSnapshotId=" + sourceSnapshotId + ", "
+        + "status=" + status + ", "
+        + "type=" + type + ", "
+        + "users=" + users + ", "
+        + "zone=" + zone
         + "}";
   }
 
@@ -871,28 +950,33 @@ public boolean equals(Object o) {
     }
     if (o instanceof Disk) {
       Disk that = (Disk) o;
-      return Objects.equals(this.creationTimestamp, that.getCreationTimestamp())
-          && Objects.equals(this.description, that.getDescription())
-          && Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey())
-          && Objects.equals(this.id, that.getId())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp())
-          && Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp())
-          && Objects.equals(this.licenses, that.getLicensesList())
-          && Objects.equals(this.name, that.getName())
-          && Objects.equals(this.options, that.getOptions())
-          && Objects.equals(this.selfLink, that.getSelfLink())
-          && Objects.equals(this.sizeGb, that.getSizeGb())
-          && Objects.equals(this.sourceImage, that.getSourceImage())
-          && Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey())
-          && Objects.equals(this.sourceImageId, that.getSourceImageId())
-          && Objects.equals(this.sourceSnapshot, that.getSourceSnapshot())
-          && Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey())
-          && Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId())
-          && Objects.equals(this.status, that.getStatus())
-          && Objects.equals(this.type, that.getType())
-          && Objects.equals(this.users, that.getUsersList())
-          && Objects.equals(this.zone, that.getZone());
+      return
+          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) &&
+          Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) &&
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) &&
+          Objects.equals(this.labels, that.getLabelsMap()) &&
+          Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp()) &&
+          Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp()) &&
+          Objects.equals(this.licenses, that.getLicensesList()) &&
+          Objects.equals(this.name, that.getName()) &&
+          Objects.equals(this.options, that.getOptions()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.sizeGb, that.getSizeGb()) &&
+          Objects.equals(this.sourceImage, that.getSourceImage()) &&
+          Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) &&
+          Objects.equals(this.sourceImageId, that.getSourceImageId()) &&
+          Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) &&
+          Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) &&
+          Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) &&
+          Objects.equals(this.status, that.getStatus()) &&
+          Objects.equals(this.type, that.getType()) &&
+          Objects.equals(this.users, that.getUsersList()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
     }
     return false;
   }
@@ -900,27 +984,31 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        creationTimestamp,
-        description,
-        diskEncryptionKey,
-        id,
-        kind,
-        lastAttachTimestamp,
-        lastDetachTimestamp,
-        licenses,
-        name,
-        options,
-        selfLink,
-        sizeGb,
-        sourceImage,
-        sourceImageEncryptionKey,
-        sourceImageId,
-        sourceSnapshot,
-        sourceSnapshotEncryptionKey,
-        sourceSnapshotId,
-        status,
-        type,
-        users,
-        zone);
+      creationTimestamp,
+      description,
+      diskEncryptionKey,
+      guestOsFeatures,
+      id,
+      kind,
+      labelFingerprint,
+      labels,
+      lastAttachTimestamp,
+      lastDetachTimestamp,
+      licenses,
+      name,
+      options,
+      selfLink,
+      sizeGb,
+      sourceImage,
+      sourceImageEncryptionKey,
+      sourceImageId,
+      sourceSnapshot,
+      sourceSnapshotEncryptionKey,
+      sourceSnapshotId,
+      status,
+      type,
+      users,
+      zone
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java
index 8e1cb2f50345..b9fffd676c49 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java
@@ -37,6 +37,7 @@ public final class DiskAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private DiskAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private DiskAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private DiskAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(DiskAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(DiskAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public DiskAggregatedList build() {
 
 
 
 
+
       return new DiskAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
index bff396e94b59..c7df2218aa9d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
@@ -53,8 +53,10 @@
  * 
  * try (DiskClient diskClient = DiskClient.create()) {
  *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+ *   String requestId = "";
+ *   Boolean guestFlush = false;
  *   Snapshot snapshotResource = Snapshot.newBuilder().build();
- *   Operation response = diskClient.createSnapshotDisk(disk, snapshotResource);
+ *   Operation response = diskClient.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource);
  * }
  * 
  * 
@@ -310,21 +312,31 @@ public final UnaryCallable a *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
+   *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
-   *   Operation response = diskClient.createSnapshotDisk(disk, snapshotResource);
+   *   Operation response = diskClient.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource);
    * }
    * 
* * @param disk Name of the persistent disk to snapshot. - * @param snapshotResource A persistent disk snapshot resource. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param guestFlush + * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation createSnapshotDisk(DiskName disk, Snapshot snapshotResource) { + public final Operation createSnapshotDisk(DiskName disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .setGuestFlush(guestFlush) .setSnapshotResource(snapshotResource) .build(); return createSnapshotDisk(request); @@ -338,21 +350,31 @@ public final Operation createSnapshotDisk(DiskName disk, Snapshot snapshotResour *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
+   *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
-   *   Operation response = diskClient.createSnapshotDisk(disk.toString(), snapshotResource);
+   *   Operation response = diskClient.createSnapshotDisk(disk.toString(), requestId, guestFlush, snapshotResource);
    * }
    * 
* * @param disk Name of the persistent disk to snapshot. - * @param snapshotResource A persistent disk snapshot resource. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param guestFlush + * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation createSnapshotDisk(String disk, Snapshot snapshotResource) { + public final Operation createSnapshotDisk(String disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() .setDisk(disk) + .setRequestId(requestId) + .setGuestFlush(guestFlush) .setSnapshotResource(snapshotResource) .build(); return createSnapshotDisk(request); @@ -366,9 +388,13 @@ public final Operation createSnapshotDisk(String disk, Snapshot snapshotResource *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
+   *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
    *   CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .setGuestFlush(guestFlush)
    *     .setSnapshotResource(snapshotResource)
    *     .build();
    *   Operation response = diskClient.createSnapshotDisk(request);
@@ -391,9 +417,13 @@ public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request)
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
+   *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
    *   CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .setGuestFlush(guestFlush)
    *     .setSnapshotResource(snapshotResource)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.createSnapshotDiskCallable().futureCall(request);
@@ -415,19 +445,26 @@ public final UnaryCallable createSnaps
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   Operation response = diskClient.deleteDisk(disk);
+   *   String requestId = "";
+   *   Operation response = diskClient.deleteDisk(disk, requestId);
    * }
    * 
* * @param disk Name of the persistent disk to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteDisk(DiskName disk) { + public final Operation deleteDisk(DiskName disk, String requestId) { DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) .build(); return deleteDisk(request); } @@ -440,19 +477,26 @@ public final Operation deleteDisk(DiskName disk) { *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   Operation response = diskClient.deleteDisk(disk.toString());
+   *   String requestId = "";
+   *   Operation response = diskClient.deleteDisk(disk.toString(), requestId);
    * }
    * 
* * @param disk Name of the persistent disk to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteDisk(String disk) { + public final Operation deleteDisk(String disk, String requestId) { DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder() .setDisk(disk) + .setRequestId(requestId) .build(); return deleteDisk(request); } @@ -465,8 +509,10 @@ public final Operation deleteDisk(String disk) { *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
    *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = diskClient.deleteDisk(request);
    * }
@@ -488,8 +534,10 @@ public final Operation deleteDisk(DeleteDiskHttpRequest request) {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
    *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.deleteDiskCallable().futureCall(request);
    *   // Do something
@@ -605,23 +653,30 @@ public final UnaryCallable getDiskCallable() {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
-   *   Operation response = diskClient.insertDisk(zone, sourceImage, diskResource);
+   *   Operation response = diskClient.insertDisk(zone, requestId, sourceImage, diskResource);
    * }
    * 
* * @param zone The name of the zone for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param sourceImage Optional. Source image to restore onto a disk. - * @param diskResource A Disk resource. + * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertDisk(ZoneName zone, String sourceImage, Disk diskResource) { + public final Operation insertDisk(ZoneName zone, String requestId, String sourceImage, Disk diskResource) { InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setSourceImage(sourceImage) .setDiskResource(diskResource) .build(); @@ -636,23 +691,30 @@ public final Operation insertDisk(ZoneName zone, String sourceImage, Disk diskRe *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
-   *   Operation response = diskClient.insertDisk(zone.toString(), sourceImage, diskResource);
+   *   Operation response = diskClient.insertDisk(zone.toString(), requestId, sourceImage, diskResource);
    * }
    * 
* * @param zone The name of the zone for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param sourceImage Optional. Source image to restore onto a disk. - * @param diskResource A Disk resource. + * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertDisk(String zone, String sourceImage, Disk diskResource) { + public final Operation insertDisk(String zone, String requestId, String sourceImage, Disk diskResource) { InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder() .setZone(zone) + .setRequestId(requestId) .setSourceImage(sourceImage) .setDiskResource(diskResource) .build(); @@ -667,10 +729,12 @@ public final Operation insertDisk(String zone, String sourceImage, Disk diskReso *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
    *   InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setSourceImage(sourceImage)
    *     .setDiskResource(diskResource)
    *     .build();
@@ -694,10 +758,12 @@ public final Operation insertDisk(InsertDiskHttpRequest request) {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
    *   InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setSourceImage(sourceImage)
    *     .setDiskResource(diskResource)
    *     .build();
@@ -847,27 +913,34 @@ public final UnaryCallable listDisksCallable() {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Resizes the specified persistent disk.
+   * Resizes the specified persistent disk. You can only increase the size of the disk.
    *
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
-   *   Operation response = diskClient.resizeDisk(disk, disksResizeRequestResource);
+   *   Operation response = diskClient.resizeDisk(disk, requestId, disksResizeRequestResource);
    * }
    * 
* * @param disk The name of the persistent disk. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param disksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeDisk(DiskName disk, DisksResizeRequest disksResizeRequestResource) { + public final Operation resizeDisk(DiskName disk, String requestId, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) .setDisksResizeRequestResource(disksResizeRequestResource) .build(); return resizeDisk(request); @@ -875,27 +948,34 @@ public final Operation resizeDisk(DiskName disk, DisksResizeRequest disksResizeR // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Resizes the specified persistent disk. + * Resizes the specified persistent disk. You can only increase the size of the disk. * * Sample code: *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
-   *   Operation response = diskClient.resizeDisk(disk.toString(), disksResizeRequestResource);
+   *   Operation response = diskClient.resizeDisk(disk.toString(), requestId, disksResizeRequestResource);
    * }
    * 
* * @param disk The name of the persistent disk. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param disksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeDisk(String disk, DisksResizeRequest disksResizeRequestResource) { + public final Operation resizeDisk(String disk, String requestId, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() .setDisk(disk) + .setRequestId(requestId) .setDisksResizeRequestResource(disksResizeRequestResource) .build(); return resizeDisk(request); @@ -903,15 +983,17 @@ public final Operation resizeDisk(String disk, DisksResizeRequest disksResizeReq // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Resizes the specified persistent disk. + * Resizes the specified persistent disk. You can only increase the size of the disk. * * Sample code: *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
    *     .setDisksResizeRequestResource(disksResizeRequestResource)
    *     .build();
    *   Operation response = diskClient.resizeDisk(request);
@@ -928,15 +1010,17 @@ public final Operation resizeDisk(ResizeDiskHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Resizes the specified persistent disk.
+   * Resizes the specified persistent disk. You can only increase the size of the disk.
    *
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
    *     .setDisksResizeRequestResource(disksResizeRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.resizeDiskCallable().futureCall(request);
@@ -950,6 +1034,129 @@ public final UnaryCallable resizeDiskCallable(
     return stub.resizeDiskCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
+   *
+   * Sample code:
+   * 

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
+   *   Operation response = diskClient.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param zoneSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsDisk(ResourceName resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + + SetLabelsDiskHttpRequest request = + SetLabelsDiskHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setRequestId(requestId) + .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) + .build(); + return setLabelsDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
+   *   Operation response = diskClient.setLabelsDisk(resource.toString(), requestId, zoneSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param zoneSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsDisk(String resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + + SetLabelsDiskHttpRequest request = + SetLabelsDiskHttpRequest.newBuilder() + .setResource(resource) + .setRequestId(requestId) + .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) + .build(); + return setLabelsDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
+   *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRequestId(requestId)
+   *     .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource)
+   *     .build();
+   *   Operation response = diskClient.setLabelsDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsDisk(SetLabelsDiskHttpRequest request) { + return setLabelsDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
+   *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRequestId(requestId)
+   *     .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = diskClient.setLabelsDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setLabelsDiskCallable() { + return stub.setLabelsDiskCallable(); + } + @Override public final void close() throws Exception { stub.close(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java index 6d9de2bcd192..71d6483182a6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java @@ -37,6 +37,7 @@ public final class DiskList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private DiskList() { this.id = null; @@ -44,6 +45,7 @@ private DiskList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private DiskList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(DiskList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(DiskList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public DiskList build() { + return new DiskList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java index 2c9228548abf..7d05b7340f59 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class DiskName implements ResourceName { +public final class DiskName implements com.google.api.resourcenames.ResourceName { private final String disk; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java index bd7becf1f760..4f0c59d8a0c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java @@ -15,24 +15,46 @@ */ package com.google.cloud.compute.v1; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; - import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.stub.DiskStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; +import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -41,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default - * port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of createSnapshotDisk to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of createSnapshotDisk to 30 seconds: * *

  * 
@@ -64,75 +86,105 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class DiskSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to aggregatedListDisks. */
-  public PagedCallSettings<
-          AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
-      aggregatedListDisksSettings() {
+  /**
+   * Returns the object with the settings used for calls to aggregatedListDisks.
+   */
+  public PagedCallSettings aggregatedListDisksSettings() {
     return ((DiskStubSettings) getStubSettings()).aggregatedListDisksSettings();
   }
 
-  /** Returns the object with the settings used for calls to createSnapshotDisk. */
+  /**
+   * Returns the object with the settings used for calls to createSnapshotDisk.
+   */
   public UnaryCallSettings createSnapshotDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).createSnapshotDiskSettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteDisk. */
+  /**
+   * Returns the object with the settings used for calls to deleteDisk.
+   */
   public UnaryCallSettings deleteDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).deleteDiskSettings();
   }
 
-  /** Returns the object with the settings used for calls to getDisk. */
+  /**
+   * Returns the object with the settings used for calls to getDisk.
+   */
   public UnaryCallSettings getDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).getDiskSettings();
   }
 
-  /** Returns the object with the settings used for calls to insertDisk. */
+  /**
+   * Returns the object with the settings used for calls to insertDisk.
+   */
   public UnaryCallSettings insertDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).insertDiskSettings();
   }
 
-  /** Returns the object with the settings used for calls to listDisks. */
-  public PagedCallSettings
-      listDisksSettings() {
+  /**
+   * Returns the object with the settings used for calls to listDisks.
+   */
+  public PagedCallSettings listDisksSettings() {
     return ((DiskStubSettings) getStubSettings()).listDisksSettings();
   }
 
-  /** Returns the object with the settings used for calls to resizeDisk. */
+  /**
+   * Returns the object with the settings used for calls to resizeDisk.
+   */
   public UnaryCallSettings resizeDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).resizeDiskSettings();
   }
 
+  /**
+   * Returns the object with the settings used for calls to setLabelsDisk.
+   */
+  public UnaryCallSettings setLabelsDiskSettings() {
+    return ((DiskStubSettings) getStubSettings()).setLabelsDiskSettings();
+  }
+
+
   public static final DiskSettings create(DiskStubSettings stub) throws IOException {
     return new DiskSettings.Builder(stub.toBuilder()).build();
   }
 
-  /** Returns a builder for the default ExecutorProvider for this service. */
+  /**
+   * Returns a builder for the default ExecutorProvider for this service.
+   */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return DiskStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /** Returns the default service endpoint. */
-  public static String getDefaultEndpoint() {
-    return DiskStubSettings.getDefaultEndpoint();
-  }
-  /** Returns the default service port. */
+  /**
+   * Returns the default service endpoint.
+   */
+   public static String getDefaultEndpoint() {
+     return DiskStubSettings.getDefaultEndpoint();
+   }
+  /**
+   * Returns the default service port.
+   */
   public static int getDefaultServicePort() {
     return DiskStubSettings.getDefaultServicePort();
   }
 
-  /** Returns the default service scopes. */
+
+  /**
+   * Returns the default service scopes.
+   */
   public static List getDefaultServiceScopes() {
     return DiskStubSettings.getDefaultServiceScopes();
   }
 
-  /** Returns a builder for the default credentials for this service. */
+
+  /**
+   * Returns a builder for the default credentials for this service.
+   */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return DiskStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder
-      defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
     return DiskStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -145,17 +197,23 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return DiskStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /** Returns a builder containing all the values of this settings class. */
+  /**
+   * Returns a builder containing all the values of this settings class.
+   */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -164,7 +222,9 @@ protected DiskSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /** Builder for DiskSettings. */
+  /**
+   * Builder for DiskSettings.
+   */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -186,6 +246,7 @@ protected Builder(DiskStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
+
     public DiskStubSettings.Builder getStubSettingsBuilder() {
       return ((DiskStubSettings.Builder) getStubSettings());
     }
@@ -193,57 +254,72 @@ public DiskStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * 

Note: This method does not support applying settings to streaming methods. + * Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** Returns the builder for the settings used for calls to aggregatedListDisks. */ - public PagedCallSettings.Builder< - AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse> - aggregatedListDisksSettings() { + /** + * Returns the builder for the settings used for calls to aggregatedListDisks. + */ + public PagedCallSettings.Builder aggregatedListDisksSettings() { return getStubSettingsBuilder().aggregatedListDisksSettings(); } - /** Returns the builder for the settings used for calls to createSnapshotDisk. */ - public UnaryCallSettings.Builder - createSnapshotDiskSettings() { + /** + * Returns the builder for the settings used for calls to createSnapshotDisk. + */ + public UnaryCallSettings.Builder createSnapshotDiskSettings() { return getStubSettingsBuilder().createSnapshotDiskSettings(); } - /** Returns the builder for the settings used for calls to deleteDisk. */ + /** + * Returns the builder for the settings used for calls to deleteDisk. + */ public UnaryCallSettings.Builder deleteDiskSettings() { return getStubSettingsBuilder().deleteDiskSettings(); } - /** Returns the builder for the settings used for calls to getDisk. */ + /** + * Returns the builder for the settings used for calls to getDisk. + */ public UnaryCallSettings.Builder getDiskSettings() { return getStubSettingsBuilder().getDiskSettings(); } - /** Returns the builder for the settings used for calls to insertDisk. */ + /** + * Returns the builder for the settings used for calls to insertDisk. + */ public UnaryCallSettings.Builder insertDiskSettings() { return getStubSettingsBuilder().insertDiskSettings(); } - /** Returns the builder for the settings used for calls to listDisks. */ - public PagedCallSettings.Builder - listDisksSettings() { + /** + * Returns the builder for the settings used for calls to listDisks. + */ + public PagedCallSettings.Builder listDisksSettings() { return getStubSettingsBuilder().listDisksSettings(); } - /** Returns the builder for the settings used for calls to resizeDisk. */ + /** + * Returns the builder for the settings used for calls to resizeDisk. + */ public UnaryCallSettings.Builder resizeDiskSettings() { return getStubSettingsBuilder().resizeDiskSettings(); } + /** + * Returns the builder for the settings used for calls to setLabelsDisk. + */ + public UnaryCallSettings.Builder setLabelsDiskSettings() { + return getStubSettingsBuilder().setLabelsDiskSettings(); + } + @Override public DiskSettings build() throws IOException { return new DiskSettings(this); } } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java index 444239dd6785..9b76cb606445 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java @@ -37,6 +37,7 @@ public final class DiskTypeAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private DiskTypeAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private DiskTypeAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private DiskTypeAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(DiskTypeAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(DiskTypeAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public DiskTypeAggregatedList build() { + return new DiskTypeAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java index 03b078e1d3dd..d169597bbbac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java @@ -37,6 +37,7 @@ public final class DiskTypeList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private DiskTypeList() { this.id = null; @@ -44,6 +45,7 @@ private DiskTypeList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private DiskTypeList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(DiskTypeList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(DiskTypeList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public DiskTypeList build() { + return new DiskTypeList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java index e1233580ce8b..238e7f2dba1a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class DiskTypeName implements ResourceName { +public final class DiskTypeName implements com.google.api.resourcenames.ResourceName { private final String diskType; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java index 03ace04edf50..44673da3fa2d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java @@ -18,6 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -39,7 +40,11 @@ private DiskTypesScopedList() { this.warning = null; } - private DiskTypesScopedList(List diskTypes, Warning warning) { + + private DiskTypesScopedList( + List diskTypes, + Warning warning + ) { this.diskTypes = diskTypes; this.warning = warning; } @@ -85,24 +90,22 @@ public Warning getWarning() { return warning; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(DiskTypesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static DiskTypesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final DiskTypesScopedList DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new DiskTypesScopedList(); } @@ -155,9 +158,13 @@ public Builder setWarning(Warning warning) { return this; } + public DiskTypesScopedList build() { - return new DiskTypesScopedList(diskTypes, warning); + return new DiskTypesScopedList( + diskTypes, + warning + ); } public Builder clone() { @@ -170,7 +177,10 @@ public Builder clone() { @Override public String toString() { - return "DiskTypesScopedList{" + "diskTypes=" + diskTypes + ", " + "warning=" + warning + "}"; + return "DiskTypesScopedList{" + + "diskTypes=" + diskTypes + ", " + + "warning=" + warning + + "}"; } @Override @@ -180,14 +190,19 @@ public boolean equals(Object o) { } if (o instanceof DiskTypesScopedList) { DiskTypesScopedList that = (DiskTypesScopedList) o; - return Objects.equals(this.diskTypes, that.getDiskTypesList()) - && Objects.equals(this.warning, that.getWarning()); + return + Objects.equals(this.diskTypes, that.getDiskTypesList()) && + Objects.equals(this.warning, that.getWarning()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(diskTypes, warning); + return Objects.hash( + diskTypes, + warning + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java new file mode 100644 index 000000000000..3c6783547fac --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java @@ -0,0 +1,441 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class EnableXpnHostProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private EnableXpnHostProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private EnableXpnHostProjectHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(EnableXpnHostProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static EnableXpnHostProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final EnableXpnHostProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new EnableXpnHostProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(EnableXpnHostProjectHttpRequest other) { + if (other == EnableXpnHostProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(EnableXpnHostProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public EnableXpnHostProjectHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new EnableXpnHostProjectHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "EnableXpnHostProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof EnableXpnHostProjectHttpRequest) { + EnableXpnHostProjectHttpRequest that = (EnableXpnHostProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java new file mode 100644 index 000000000000..700d682229ec --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class EnableXpnResourceProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private EnableXpnResourceProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.projectsEnableXpnResourceRequestResource = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private EnableXpnResourceProjectHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.projectsEnableXpnResourceRequestResource = projectsEnableXpnResourceRequestResource; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("projectsEnableXpnResourceRequestResource") && projectsEnableXpnResourceRequestResource != null) { + fieldMap.put("projectsEnableXpnResourceRequestResource", Collections.singletonList(String.valueOf(projectsEnableXpnResourceRequestResource))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("projectsEnableXpnResourceRequestResource")) { + return String.valueOf(projectsEnableXpnResourceRequestResource); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ProjectsEnableXpnResourceRequest getApiMessageRequestBody() { + return projectsEnableXpnResourceRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public ProjectsEnableXpnResourceRequest getProjectsEnableXpnResourceRequestResource() { + return projectsEnableXpnResourceRequestResource; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(EnableXpnResourceProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static EnableXpnResourceProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final EnableXpnResourceProjectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new EnableXpnResourceProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(EnableXpnResourceProjectHttpRequest other) { + if (other == EnableXpnResourceProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getProjectsEnableXpnResourceRequestResource() != null) { + this.projectsEnableXpnResourceRequestResource = other.projectsEnableXpnResourceRequestResource; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(EnableXpnResourceProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.projectsEnableXpnResourceRequestResource = source.projectsEnableXpnResourceRequestResource; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public ProjectsEnableXpnResourceRequest getProjectsEnableXpnResourceRequestResource() { + return projectsEnableXpnResourceRequestResource; + } + + public Builder setProjectsEnableXpnResourceRequestResource(ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + this.projectsEnableXpnResourceRequestResource = projectsEnableXpnResourceRequestResource; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public EnableXpnResourceProjectHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new EnableXpnResourceProjectHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsEnableXpnResourceRequestResource, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setProjectsEnableXpnResourceRequestResource(this.projectsEnableXpnResourceRequestResource); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "EnableXpnResourceProjectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "projectsEnableXpnResourceRequestResource=" + projectsEnableXpnResourceRequestResource + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof EnableXpnResourceProjectHttpRequest) { + EnableXpnResourceProjectHttpRequest that = (EnableXpnResourceProjectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.projectsEnableXpnResourceRequestResource, that.getProjectsEnableXpnResourceRequestResource()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsEnableXpnResourceRequestResource, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index 4a8dc4f78995..d9d1e491ba49 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +42,12 @@ private Errors() { this.message = null; } - private Errors(String code, String location, String message) { + + private Errors( + String code, + String location, + String message + ) { this.code = code; this.location = location; this.message = message; @@ -92,24 +100,22 @@ public String getMessage() { return message; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Errors prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static Errors getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final Errors DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new Errors(); } @@ -168,9 +174,15 @@ public Builder setMessage(String message) { return this; } + public Errors build() { - return new Errors(code, location, message); + + return new Errors( + code, + location, + message + ); } public Builder clone() { @@ -185,14 +197,9 @@ public Builder clone() { @Override public String toString() { return "Errors{" - + "code=" - + code - + ", " - + "location=" - + location - + ", " - + "message=" - + message + + "code=" + code + ", " + + "location=" + location + ", " + + "message=" + message + "}"; } @@ -203,15 +210,21 @@ public boolean equals(Object o) { } if (o instanceof Errors) { Errors that = (Errors) o; - return Objects.equals(this.code, that.getCode()) - && Objects.equals(this.location, that.getLocation()) - && Objects.equals(this.message, that.getMessage()); + return + Objects.equals(this.code, that.getCode()) && + Objects.equals(this.location, that.getLocation()) && + Objects.equals(this.message, that.getMessage()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(code, location, message); + return Objects.hash( + code, + location, + message + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java index a366a1e1c039..13be69f63692 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java @@ -38,6 +38,7 @@ public final class ExpandIpCidrRangeSubnetworkHttpRequest implements ApiMessage private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String subnetwork; private final SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource; private final String userIp; @@ -49,6 +50,7 @@ private ExpandIpCidrRangeSubnetworkHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.subnetwork = null; this.subnetworksExpandIpCidrRangeRequestResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private ExpandIpCidrRangeSubnetworkHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, String userIp @@ -72,6 +75,7 @@ private ExpandIpCidrRangeSubnetworkHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.subnetwork = subnetwork; this.subnetworksExpandIpCidrRangeRequestResource = subnetworksExpandIpCidrRangeRequestResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("subnetwork") && subnetwork != null) { fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("subnetwork")) { return String.valueOf(subnetwork); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getSubnetwork() { return subnetwork; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String subnetwork; private SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(ExpandIpCidrRangeSubnetworkHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getSubnetwork() != null) { this.subnetwork = other.subnetwork; } @@ -256,6 +274,7 @@ public Builder mergeFrom(ExpandIpCidrRangeSubnetworkHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.subnetwork = source.subnetwork; this.subnetworksExpandIpCidrRangeRequestResource = source.subnetworksExpandIpCidrRangeRequestResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getSubnetwork() { return subnetwork; } @@ -351,6 +379,7 @@ public ExpandIpCidrRangeSubnetworkHttpRequest build() { + if (subnetwork == null) { missing += " subnetwork"; } @@ -366,6 +395,7 @@ public ExpandIpCidrRangeSubnetworkHttpRequest build() { key, prettyPrint, quotaUser, + requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setSubnetwork(this.subnetwork); newBuilder.setSubnetworksExpandIpCidrRangeRequestResource(this.subnetworksExpandIpCidrRangeRequestResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "subnetwork=" + subnetwork + ", " + "subnetworksExpandIpCidrRangeRequestResource=" + subnetworksExpandIpCidrRangeRequestResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.subnetwork, that.getSubnetwork()) && Objects.equals(this.subnetworksExpandIpCidrRangeRequestResource, that.getSubnetworksExpandIpCidrRangeRequestResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java index f09fe99184b9..1946b47df1ef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class FamilyName implements ResourceName { +public final class FamilyName implements com.google.api.resourcenames.ResourceName { private final String family; private final String project; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java index 3133f30b7955..bdfc7b01837c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java @@ -34,27 +34,39 @@ public final class Firewall implements ApiMessage { private final List allowed; private final String creationTimestamp; + private final List denied; private final String description; + private final List destinationRanges; + private final String direction; private final String id; private final String kind; private final String name; private final String network; + private final Integer priority; private final String selfLink; private final List sourceRanges; + private final List sourceServiceAccounts; private final List sourceTags; + private final List targetServiceAccounts; private final List targetTags; private Firewall() { this.allowed = null; this.creationTimestamp = null; + this.denied = null; this.description = null; + this.destinationRanges = null; + this.direction = null; this.id = null; this.kind = null; this.name = null; this.network = null; + this.priority = null; this.selfLink = null; this.sourceRanges = null; + this.sourceServiceAccounts = null; this.sourceTags = null; + this.targetServiceAccounts = null; this.targetTags = null; } @@ -62,26 +74,38 @@ private Firewall() { private Firewall( List allowed, String creationTimestamp, + List denied, String description, + List destinationRanges, + String direction, String id, String kind, String name, String network, + Integer priority, String selfLink, List sourceRanges, + List sourceServiceAccounts, List sourceTags, + List targetServiceAccounts, List targetTags ) { this.allowed = allowed; this.creationTimestamp = creationTimestamp; + this.denied = denied; this.description = description; + this.destinationRanges = destinationRanges; + this.direction = direction; this.id = id; this.kind = kind; this.name = name; this.network = network; + this.priority = priority; this.selfLink = selfLink; this.sourceRanges = sourceRanges; + this.sourceServiceAccounts = sourceServiceAccounts; this.sourceTags = sourceTags; + this.targetServiceAccounts = targetServiceAccounts; this.targetTags = targetTags; } @@ -98,9 +122,26 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } + if (fieldNames.contains("denied") && denied != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Denied item : denied) { + stringList.add(item.toString()); + } + fieldMap.put("denied", stringList.build()); + } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } + if (fieldNames.contains("destinationRanges") && destinationRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : destinationRanges) { + stringList.add(item.toString()); + } + fieldMap.put("destinationRanges", stringList.build()); + } + if (fieldNames.contains("direction") && direction != null) { + fieldMap.put("direction", Collections.singletonList(String.valueOf(direction))); + } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); } @@ -113,6 +154,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("network") && network != null) { fieldMap.put("network", Collections.singletonList(String.valueOf(network))); } + if (fieldNames.contains("priority") && priority != null) { + fieldMap.put("priority", Collections.singletonList(String.valueOf(priority))); + } if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } @@ -123,6 +167,13 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("sourceRanges", stringList.build()); } + if (fieldNames.contains("sourceServiceAccounts") && sourceServiceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sourceServiceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("sourceServiceAccounts", stringList.build()); + } if (fieldNames.contains("sourceTags") && sourceTags != null) { ImmutableList.Builder stringList = ImmutableList.builder(); for (String item : sourceTags) { @@ -130,6 +181,13 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("sourceTags", stringList.build()); } + if (fieldNames.contains("targetServiceAccounts") && targetServiceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetServiceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("targetServiceAccounts", stringList.build()); + } if (fieldNames.contains("targetTags") && targetTags != null) { ImmutableList.Builder stringList = ImmutableList.builder(); for (String item : targetTags) { @@ -148,9 +206,18 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { return String.valueOf(creationTimestamp); } + if (fieldName.equals("denied")) { + return String.valueOf(denied); + } if (fieldName.equals("description")) { return String.valueOf(description); } + if (fieldName.equals("destinationRanges")) { + return String.valueOf(destinationRanges); + } + if (fieldName.equals("direction")) { + return String.valueOf(direction); + } if (fieldName.equals("id")) { return String.valueOf(id); } @@ -163,15 +230,24 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("network")) { return String.valueOf(network); } + if (fieldName.equals("priority")) { + return String.valueOf(priority); + } if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } if (fieldName.equals("sourceRanges")) { return String.valueOf(sourceRanges); } + if (fieldName.equals("sourceServiceAccounts")) { + return String.valueOf(sourceServiceAccounts); + } if (fieldName.equals("sourceTags")) { return String.valueOf(sourceTags); } + if (fieldName.equals("targetServiceAccounts")) { + return String.valueOf(targetServiceAccounts); + } if (fieldName.equals("targetTags")) { return String.valueOf(targetTags); } @@ -192,10 +268,22 @@ public String getCreationTimestamp() { return creationTimestamp; } + public List getDeniedList() { + return denied; + } + public String getDescription() { return description; } + public List getDestinationRangesList() { + return destinationRanges; + } + + public String getDirection() { + return direction; + } + public String getId() { return id; } @@ -212,6 +300,10 @@ public String getNetwork() { return network; } + public Integer getPriority() { + return priority; + } + public String getSelfLink() { return selfLink; } @@ -220,10 +312,18 @@ public List getSourceRangesList() { return sourceRanges; } + public List getSourceServiceAccountsList() { + return sourceServiceAccounts; + } + public List getSourceTagsList() { return sourceTags; } + public List getTargetServiceAccountsList() { + return targetServiceAccounts; + } + public List getTargetTagsList() { return targetTags; } @@ -251,14 +351,20 @@ public static Firewall getDefaultInstance() { public static class Builder { private List allowed; private String creationTimestamp; + private List denied; private String description; + private List destinationRanges; + private String direction; private String id; private String kind; private String name; private String network; + private Integer priority; private String selfLink; private List sourceRanges; + private List sourceServiceAccounts; private List sourceTags; + private List targetServiceAccounts; private List targetTags; Builder() {} @@ -271,9 +377,18 @@ public Builder mergeFrom(Firewall other) { if (other.getCreationTimestamp() != null) { this.creationTimestamp = other.creationTimestamp; } + if (other.getDeniedList() != null) { + this.denied = other.denied; + } if (other.getDescription() != null) { this.description = other.description; } + if (other.getDestinationRangesList() != null) { + this.destinationRanges = other.destinationRanges; + } + if (other.getDirection() != null) { + this.direction = other.direction; + } if (other.getId() != null) { this.id = other.id; } @@ -286,15 +401,24 @@ public Builder mergeFrom(Firewall other) { if (other.getNetwork() != null) { this.network = other.network; } + if (other.getPriority() != null) { + this.priority = other.priority; + } if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } if (other.getSourceRangesList() != null) { this.sourceRanges = other.sourceRanges; } + if (other.getSourceServiceAccountsList() != null) { + this.sourceServiceAccounts = other.sourceServiceAccounts; + } if (other.getSourceTagsList() != null) { this.sourceTags = other.sourceTags; } + if (other.getTargetServiceAccountsList() != null) { + this.targetServiceAccounts = other.targetServiceAccounts; + } if (other.getTargetTagsList() != null) { this.targetTags = other.targetTags; } @@ -304,14 +428,20 @@ public Builder mergeFrom(Firewall other) { Builder(Firewall source) { this.allowed = source.allowed; this.creationTimestamp = source.creationTimestamp; + this.denied = source.denied; this.description = source.description; + this.destinationRanges = source.destinationRanges; + this.direction = source.direction; this.id = source.id; this.kind = source.kind; this.name = source.name; this.network = source.network; + this.priority = source.priority; this.selfLink = source.selfLink; this.sourceRanges = source.sourceRanges; + this.sourceServiceAccounts = source.sourceServiceAccounts; this.sourceTags = source.sourceTags; + this.targetServiceAccounts = source.targetServiceAccounts; this.targetTags = source.targetTags; } @@ -341,6 +471,23 @@ public Builder setCreationTimestamp(String creationTimestamp) { return this; } + public List getDeniedList() { + return denied; + } + + public Builder addAllDenied(List denied) { + if (this.denied == null) { + this.denied = new ArrayList<>(denied.size()); + } + this.denied.addAll(denied); + return this; + } + + public Builder addDenied(Denied denied) { + this.denied.add(denied); + return this; + } + public String getDescription() { return description; } @@ -350,6 +497,32 @@ public Builder setDescription(String description) { return this; } + public List getDestinationRangesList() { + return destinationRanges; + } + + public Builder addAllDestinationRanges(List destinationRanges) { + if (this.destinationRanges == null) { + this.destinationRanges = new ArrayList<>(destinationRanges.size()); + } + this.destinationRanges.addAll(destinationRanges); + return this; + } + + public Builder addDestinationRanges(String destinationRanges) { + this.destinationRanges.add(destinationRanges); + return this; + } + + public String getDirection() { + return direction; + } + + public Builder setDirection(String direction) { + this.direction = direction; + return this; + } + public String getId() { return id; } @@ -386,6 +559,15 @@ public Builder setNetwork(String network) { return this; } + public Integer getPriority() { + return priority; + } + + public Builder setPriority(Integer priority) { + this.priority = priority; + return this; + } + public String getSelfLink() { return selfLink; } @@ -412,6 +594,23 @@ public Builder addSourceRanges(String sourceRanges) { return this; } + public List getSourceServiceAccountsList() { + return sourceServiceAccounts; + } + + public Builder addAllSourceServiceAccounts(List sourceServiceAccounts) { + if (this.sourceServiceAccounts == null) { + this.sourceServiceAccounts = new ArrayList<>(sourceServiceAccounts.size()); + } + this.sourceServiceAccounts.addAll(sourceServiceAccounts); + return this; + } + + public Builder addSourceServiceAccounts(String sourceServiceAccounts) { + this.sourceServiceAccounts.add(sourceServiceAccounts); + return this; + } + public List getSourceTagsList() { return sourceTags; } @@ -429,6 +628,23 @@ public Builder addSourceTags(String sourceTags) { return this; } + public List getTargetServiceAccountsList() { + return targetServiceAccounts; + } + + public Builder addAllTargetServiceAccounts(List targetServiceAccounts) { + if (this.targetServiceAccounts == null) { + this.targetServiceAccounts = new ArrayList<>(targetServiceAccounts.size()); + } + this.targetServiceAccounts.addAll(targetServiceAccounts); + return this; + } + + public Builder addTargetServiceAccounts(String targetServiceAccounts) { + this.targetServiceAccounts.add(targetServiceAccounts); + return this; + } + public List getTargetTagsList() { return targetTags; } @@ -458,17 +674,29 @@ public Firewall build() { + + + + + + return new Firewall( allowed, creationTimestamp, + denied, description, + destinationRanges, + direction, id, kind, name, network, + priority, selfLink, sourceRanges, + sourceServiceAccounts, sourceTags, + targetServiceAccounts, targetTags ); } @@ -477,14 +705,20 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.addAllAllowed(this.allowed); newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.addAllDenied(this.denied); newBuilder.setDescription(this.description); + newBuilder.addAllDestinationRanges(this.destinationRanges); + newBuilder.setDirection(this.direction); newBuilder.setId(this.id); newBuilder.setKind(this.kind); newBuilder.setName(this.name); newBuilder.setNetwork(this.network); + newBuilder.setPriority(this.priority); newBuilder.setSelfLink(this.selfLink); newBuilder.addAllSourceRanges(this.sourceRanges); + newBuilder.addAllSourceServiceAccounts(this.sourceServiceAccounts); newBuilder.addAllSourceTags(this.sourceTags); + newBuilder.addAllTargetServiceAccounts(this.targetServiceAccounts); newBuilder.addAllTargetTags(this.targetTags); return newBuilder; } @@ -495,14 +729,20 @@ public String toString() { return "Firewall{" + "allowed=" + allowed + ", " + "creationTimestamp=" + creationTimestamp + ", " + + "denied=" + denied + ", " + "description=" + description + ", " + + "destinationRanges=" + destinationRanges + ", " + + "direction=" + direction + ", " + "id=" + id + ", " + "kind=" + kind + ", " + "name=" + name + ", " + "network=" + network + ", " + + "priority=" + priority + ", " + "selfLink=" + selfLink + ", " + "sourceRanges=" + sourceRanges + ", " + + "sourceServiceAccounts=" + sourceServiceAccounts + ", " + "sourceTags=" + sourceTags + ", " + + "targetServiceAccounts=" + targetServiceAccounts + ", " + "targetTags=" + targetTags + "}"; } @@ -517,14 +757,20 @@ public boolean equals(Object o) { return Objects.equals(this.allowed, that.getAllowedList()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.denied, that.getDeniedList()) && Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.destinationRanges, that.getDestinationRangesList()) && + Objects.equals(this.direction, that.getDirection()) && Objects.equals(this.id, that.getId()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.priority, that.getPriority()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.sourceRanges, that.getSourceRangesList()) && + Objects.equals(this.sourceServiceAccounts, that.getSourceServiceAccountsList()) && Objects.equals(this.sourceTags, that.getSourceTagsList()) && + Objects.equals(this.targetServiceAccounts, that.getTargetServiceAccountsList()) && Objects.equals(this.targetTags, that.getTargetTagsList()) ; } @@ -536,14 +782,20 @@ public int hashCode() { return Objects.hash( allowed, creationTimestamp, + denied, description, + destinationRanges, + direction, id, kind, name, network, + priority, selfLink, sourceRanges, + sourceServiceAccounts, sourceTags, + targetServiceAccounts, targetTags ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java index 5e8c3bb98905..b8ffc383b1c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java @@ -23,12 +23,22 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.FirewallStub; import com.google.cloud.compute.v1.stub.FirewallStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -43,38 +53,40 @@ * * try (FirewallClient firewallClient = FirewallClient.create()) { * FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); - * Operation response = firewallClient.deleteFirewall(firewall); + * String requestId = ""; + * Operation response = firewallClient.deleteFirewall(firewall, requestId); * } * *

* - *

Note: close() needs to be called on the firewallClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). + *

Note: close() needs to be called on the firewallClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * - *

This class can be customized by passing in a custom instance of FirewallSettings to create(). - * For example: + *

This class can be customized by passing in a custom instance of FirewallSettings to + * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -104,14 +116,19 @@ public class FirewallClient implements BackgroundResource {
   private final FirewallSettings settings;
   private final FirewallStub stub;
 
-  /** Constructs an instance of FirewallClient with default settings. */
+
+
+  /**
+   * Constructs an instance of FirewallClient with default settings.
+   */
   public static final FirewallClient create() throws IOException {
     return create(FirewallSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of FirewallClient, using the given settings. The channels are created
-   * based on the settings passed in, or defaults for any settings that are not set.
+   * Constructs an instance of FirewallClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
   public static final FirewallClient create(FirewallSettings settings) throws IOException {
     return new FirewallClient(settings);
@@ -127,8 +144,9 @@ public static final FirewallClient create(FirewallStub stub) {
   }
 
   /**
-   * Constructs an instance of FirewallClient, using the given settings. This is protected so that
-   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
+   * Constructs an instance of FirewallClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
   protected FirewallClient(FirewallSettings settings) throws IOException {
     this.settings = settings;
@@ -150,29 +168,36 @@ public FirewallStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified firewall.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   Operation response = firewallClient.deleteFirewall(firewall);
+   *   String requestId = "";
+   *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
    * }
    * 
* * @param firewall Name of the firewall rule to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteFirewall(FirewallName firewall) { + public final Operation deleteFirewall(FirewallName firewall, String requestId) { DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .setRequestId(requestId) + .build(); return deleteFirewall(request); } @@ -180,23 +205,31 @@ public final Operation deleteFirewall(FirewallName firewall) { /** * Deletes the specified firewall. * - *

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   Operation response = firewallClient.deleteFirewall(firewall.toString());
+   *   String requestId = "";
+   *   Operation response = firewallClient.deleteFirewall(firewall.toString(), requestId);
    * }
    * 
* * @param firewall Name of the firewall rule to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteFirewall(String firewall) { + public final Operation deleteFirewall(String firewall, String requestId) { DeleteFirewallHttpRequest request = - DeleteFirewallHttpRequest.newBuilder().setFirewall(firewall).build(); + DeleteFirewallHttpRequest.newBuilder() + .setFirewall(firewall) + .setRequestId(requestId) + .build(); return deleteFirewall(request); } @@ -204,13 +237,14 @@ public final Operation deleteFirewall(String firewall) { /** * Deletes the specified firewall. * - *

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = firewallClient.deleteFirewall(request);
    * }
@@ -228,13 +262,14 @@ public final Operation deleteFirewall(DeleteFirewallHttpRequest request) {
   /**
    * Deletes the specified firewall.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = firewallClient.deleteFirewallCallable().futureCall(request);
    *   // Do something
@@ -251,8 +286,7 @@ public final UnaryCallable deleteFirewallC
   /**
    * Returns the specified firewall.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -268,8 +302,8 @@ public final Firewall getFirewall(FirewallName firewall) {
 
     GetFirewallHttpRequest request =
         GetFirewallHttpRequest.newBuilder()
-            .setFirewall(firewall == null ? null : firewall.toString())
-            .build();
+        .setFirewall(firewall == null ? null : firewall.toString())
+        .build();
     return getFirewall(request);
   }
 
@@ -277,8 +311,7 @@ public final Firewall getFirewall(FirewallName firewall) {
   /**
    * Returns the specified firewall.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -293,7 +326,9 @@ public final Firewall getFirewall(FirewallName firewall) {
   public final Firewall getFirewall(String firewall) {
 
     GetFirewallHttpRequest request =
-        GetFirewallHttpRequest.newBuilder().setFirewall(firewall).build();
+        GetFirewallHttpRequest.newBuilder()
+        .setFirewall(firewall)
+        .build();
     return getFirewall(request);
   }
 
@@ -301,8 +336,7 @@ public final Firewall getFirewall(String firewall) {
   /**
    * Returns the specified firewall.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -325,8 +359,7 @@ public final Firewall getFirewall(GetFirewallHttpRequest request) {
   /**
    * Returns the specified firewall.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
@@ -348,28 +381,34 @@ public final UnaryCallable getFirewallCallable
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.insertFirewall(project, firewallResource);
+   *   Operation response = firewallClient.insertFirewall(requestId, project, firewallResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertFirewall(ProjectName project, Firewall firewallResource) { + public final Operation insertFirewall(String requestId, ProjectName project, Firewall firewallResource) { InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .setFirewallResource(firewallResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setFirewallResource(firewallResource) + .build(); return insertFirewall(request); } @@ -377,28 +416,34 @@ public final Operation insertFirewall(ProjectName project, Firewall firewallReso /** * Creates a firewall rule in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.insertFirewall(project.toString(), firewallResource);
+   *   Operation response = firewallClient.insertFirewall(requestId, project.toString(), firewallResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertFirewall(String project, Firewall firewallResource) { + public final Operation insertFirewall(String requestId, String project, Firewall firewallResource) { InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder() - .setProject(project) - .setFirewallResource(firewallResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setFirewallResource(firewallResource) + .build(); return insertFirewall(request); } @@ -406,13 +451,14 @@ public final Operation insertFirewall(String project, Firewall firewallResource) /** * Creates a firewall rule in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setFirewallResource(firewallResource)
    *     .build();
@@ -432,13 +478,14 @@ public final Operation insertFirewall(InsertFirewallHttpRequest request) {
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setFirewallResource(firewallResource)
    *     .build();
@@ -457,8 +504,7 @@ public final UnaryCallable insertFirewallC
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -475,8 +521,8 @@ public final UnaryCallable insertFirewallC
   public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
     ListFirewallsHttpRequest request =
         ListFirewallsHttpRequest.newBuilder()
-            .setProject(project == null ? null : project.toString())
-            .build();
+        .setProject(project == null ? null : project.toString())
+        .build();
     return listFirewalls(request);
   }
 
@@ -484,8 +530,7 @@ public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -501,7 +546,9 @@ public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
   @BetaApi
   public final ListFirewallsPagedResponse listFirewalls(String project) {
     ListFirewallsHttpRequest request =
-        ListFirewallsHttpRequest.newBuilder().setProject(project).build();
+        ListFirewallsHttpRequest.newBuilder()
+        .setProject(project)
+        .build();
     return listFirewalls(request);
   }
 
@@ -509,8 +556,7 @@ public final ListFirewallsPagedResponse listFirewalls(String project) {
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -528,15 +574,15 @@ public final ListFirewallsPagedResponse listFirewalls(String project) {
    */
   @BetaApi
   public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest request) {
-    return listFirewallsPagedCallable().call(request);
+    return listFirewallsPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -552,8 +598,7 @@ public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable - listFirewallsPagedCallable() { + public final UnaryCallable listFirewallsPagedCallable() { return stub.listFirewallsPagedCallable(); } @@ -561,8 +606,7 @@ public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest r /** * Retrieves the list of firewall rules available to the specified project. * - *

Sample code: - * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -591,77 +635,87 @@ public final UnaryCallable listFirewalls
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. This method supports
-   * patch semantics.
-   *
-   * 

Sample code: + * 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: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.patchFirewall(firewall, firewallResource);
+   *   Operation response = firewallClient.patchFirewall(firewall, requestId, firewallResource);
    * }
    * 
* - * @param firewall Name of the firewall rule to update. + * @param firewall Name of the firewall rule to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchFirewall(FirewallName firewall, Firewall firewallResource) { + public final Operation patchFirewall(FirewallName firewall, String requestId, Firewall firewallResource) { PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return patchFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified firewall rule with the data included in the request. This method supports - * patch semantics. - * - *

Sample code: + * 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: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.patchFirewall(firewall.toString(), firewallResource);
+   *   Operation response = firewallClient.patchFirewall(firewall.toString(), requestId, firewallResource);
    * }
    * 
* - * @param firewall Name of the firewall rule to update. + * @param firewall Name of the firewall rule to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchFirewall(String firewall, Firewall firewallResource) { + public final Operation patchFirewall(String firewall, String requestId, Firewall firewallResource) { PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return patchFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified firewall rule with the data included in the request. This method supports - * patch semantics. - * - *

Sample code: + * 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: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
+   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   Operation response = firewallClient.patchFirewall(request);
@@ -678,17 +732,17 @@ public final Operation patchFirewall(PatchFirewallHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. This method supports
-   * patch semantics.
-   *
-   * 

Sample code: + * 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: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
+   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   ApiFuture<Operation> future = firewallClient.patchFirewallCallable().futureCall(request);
@@ -704,74 +758,87 @@ public final UnaryCallable patchFirewallCal
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request.
-   *
-   * 

Sample code: + * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.updateFirewall(firewall, firewallResource);
+   *   Operation response = firewallClient.updateFirewall(firewall, requestId, firewallResource);
    * }
    * 
* * @param firewall Name of the firewall rule to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateFirewall(FirewallName firewall, Firewall firewallResource) { + public final Operation updateFirewall(FirewallName firewall, String requestId, Firewall firewallResource) { UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return updateFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified firewall rule with the data included in the request. - * - *

Sample code: + * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.updateFirewall(firewall.toString(), firewallResource);
+   *   Operation response = firewallClient.updateFirewall(firewall.toString(), requestId, firewallResource);
    * }
    * 
* * @param firewall Name of the firewall rule to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateFirewall(String firewall, Firewall firewallResource) { + public final Operation updateFirewall(String firewall, String requestId, Firewall firewallResource) { UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return updateFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified firewall rule with the data included in the request. - * - *

Sample code: + * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
+   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   Operation response = firewallClient.updateFirewall(request);
@@ -788,16 +855,17 @@ public final Operation updateFirewall(UpdateFirewallHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request.
-   *
-   * 

Sample code: + * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. * + * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
+   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   ApiFuture<Operation> future = firewallClient.updateFirewallCallable().futureCall(request);
@@ -841,13 +909,12 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListFirewallsPagedResponse
-      extends AbstractPagedListResponse<
-          ListFirewallsHttpRequest,
-          FirewallList,
-          Firewall,
-          ListFirewallsPage,
-          ListFirewallsFixedSizeCollection> {
+  public static class ListFirewallsPagedResponse extends AbstractPagedListResponse<
+      ListFirewallsHttpRequest,
+      FirewallList,
+      Firewall,
+      ListFirewallsPage,
+      ListFirewallsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -867,10 +934,15 @@ public ListFirewallsPagedResponse apply(ListFirewallsPage input) {
     private ListFirewallsPagedResponse(ListFirewallsPage page) {
       super(page, ListFirewallsFixedSizeCollection.createEmptyCollection());
     }
+
+
   }
 
-  public static class ListFirewallsPage
-      extends AbstractPage {
+  public static class ListFirewallsPage extends AbstractPage<
+      ListFirewallsHttpRequest,
+      FirewallList,
+      Firewall,
+      ListFirewallsPage> {
 
     private ListFirewallsPage(
         PageContext context,
@@ -895,15 +967,18 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
+
+
+
+
   }
 
-  public static class ListFirewallsFixedSizeCollection
-      extends AbstractFixedSizeCollection<
-          ListFirewallsHttpRequest,
-          FirewallList,
-          Firewall,
-          ListFirewallsPage,
-          ListFirewallsFixedSizeCollection> {
+  public static class ListFirewallsFixedSizeCollection extends AbstractFixedSizeCollection<
+      ListFirewallsHttpRequest,
+      FirewallList,
+      Firewall,
+      ListFirewallsPage,
+      ListFirewallsFixedSizeCollection> {
 
     private ListFirewallsFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -918,5 +993,7 @@ protected ListFirewallsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListFirewallsFixedSizeCollection(pages, collectionSize);
     }
+
+
   }
-}
+}
\ No newline at end of file
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
index 55da6cdd8ed6..772b119c7069 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
@@ -37,6 +37,7 @@ public final class FirewallList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private FirewallList() {
     this.id = null;
@@ -44,6 +45,7 @@ private FirewallList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private FirewallList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(FirewallList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(FirewallList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public FirewallList build() {
 
 
 
 
+
       return new FirewallList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java
index 8b164540c6fe..74e2200b7f50 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class FirewallName implements ResourceName {
+public final class FirewallName implements com.google.api.resourcenames.ResourceName {
   private final String firewall;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java
index c676e3aa334c..016b5af03259 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java
@@ -38,6 +38,7 @@ public final class ForwardingRule implements ApiMessage {
   private final String iPAddress;
   private final String iPProtocol;
   private final String id;
+  private final String ipVersion;
   private final String kind;
   private final String loadBalancingScheme;
   private final String name;
@@ -56,6 +57,7 @@ private ForwardingRule() {
     this.iPAddress = null;
     this.iPProtocol = null;
     this.id = null;
+    this.ipVersion = null;
     this.kind = null;
     this.loadBalancingScheme = null;
     this.name = null;
@@ -76,6 +78,7 @@ private ForwardingRule(
       String iPAddress,
       String iPProtocol,
       String id,
+      String ipVersion,
       String kind,
       String loadBalancingScheme,
       String name,
@@ -93,6 +96,7 @@ private ForwardingRule(
     this.iPAddress = iPAddress;
     this.iPProtocol = iPProtocol;
     this.id = id;
+    this.ipVersion = ipVersion;
     this.kind = kind;
     this.loadBalancingScheme = loadBalancingScheme;
     this.name = name;
@@ -126,6 +130,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("id") && id != null) {
       fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
     }
+    if (fieldNames.contains("ipVersion") && ipVersion != null) {
+      fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion)));
+    }
     if (fieldNames.contains("kind") && kind != null) {
       fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
     }
@@ -183,6 +190,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("id")) {
       return String.valueOf(id);
     }
+    if (fieldName.equals("ipVersion")) {
+      return String.valueOf(ipVersion);
+    }
     if (fieldName.equals("kind")) {
       return String.valueOf(kind);
     }
@@ -246,6 +256,10 @@ public String getId() {
     return id;
   }
 
+  public String getIpVersion() {
+    return ipVersion;
+  }
+
   public String getKind() {
     return kind;
   }
@@ -313,6 +327,7 @@ public static class Builder {
     private String iPAddress;
     private String iPProtocol;
     private String id;
+    private String ipVersion;
     private String kind;
     private String loadBalancingScheme;
     private String name;
@@ -346,6 +361,9 @@ public Builder mergeFrom(ForwardingRule other) {
       if (other.getId() != null) {
         this.id = other.id;
       }
+      if (other.getIpVersion() != null) {
+        this.ipVersion = other.ipVersion;
+      }
       if (other.getKind() != null) {
         this.kind = other.kind;
       }
@@ -386,6 +404,7 @@ public Builder mergeFrom(ForwardingRule other) {
       this.iPAddress = source.iPAddress;
       this.iPProtocol = source.iPProtocol;
       this.id = source.id;
+      this.ipVersion = source.ipVersion;
       this.kind = source.kind;
       this.loadBalancingScheme = source.loadBalancingScheme;
       this.name = source.name;
@@ -452,6 +471,15 @@ public Builder setId(String id) {
       return this;
     }
 
+    public String getIpVersion() {
+      return ipVersion;
+    }
+
+    public Builder setIpVersion(String ipVersion) {
+      this.ipVersion = ipVersion;
+      return this;
+    }
+
     public String getKind() {
       return kind;
     }
@@ -567,6 +595,7 @@ public ForwardingRule build() {
 
 
 
+
       return new ForwardingRule(
         backendService,
         creationTimestamp,
@@ -574,6 +603,7 @@ public ForwardingRule build() {
         iPAddress,
         iPProtocol,
         id,
+        ipVersion,
         kind,
         loadBalancingScheme,
         name,
@@ -595,6 +625,7 @@ public Builder clone() {
       newBuilder.setIPAddress(this.iPAddress);
       newBuilder.setIPProtocol(this.iPProtocol);
       newBuilder.setId(this.id);
+      newBuilder.setIpVersion(this.ipVersion);
       newBuilder.setKind(this.kind);
       newBuilder.setLoadBalancingScheme(this.loadBalancingScheme);
       newBuilder.setName(this.name);
@@ -618,6 +649,7 @@ public String toString() {
         + "iPAddress=" + iPAddress + ", "
         + "iPProtocol=" + iPProtocol + ", "
         + "id=" + id + ", "
+        + "ipVersion=" + ipVersion + ", "
         + "kind=" + kind + ", "
         + "loadBalancingScheme=" + loadBalancingScheme + ", "
         + "name=" + name + ", "
@@ -645,6 +677,7 @@ public boolean equals(Object o) {
           Objects.equals(this.iPAddress, that.getIPAddress()) &&
           Objects.equals(this.iPProtocol, that.getIPProtocol()) &&
           Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.ipVersion, that.getIpVersion()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) &&
           Objects.equals(this.name, that.getName()) &&
@@ -669,6 +702,7 @@ public int hashCode() {
       iPAddress,
       iPProtocol,
       id,
+      ipVersion,
       kind,
       loadBalancingScheme,
       name,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java
index 5d564fea3bb8..d6fc7946c739 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java
@@ -37,6 +37,7 @@ public final class ForwardingRuleAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private ForwardingRuleAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private ForwardingRuleAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private ForwardingRuleAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(ForwardingRuleAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(ForwardingRuleAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public ForwardingRuleAggregatedList build() {
 
 
 
 
+
       return new ForwardingRuleAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
index 38ad2f6fe283..7fc079f502c8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+ *   String requestId = "";
  *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
- *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
+ *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
  * }
  * 
  * 
@@ -308,19 +309,26 @@ public final UnaryCallable * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) { + * String requestId = ""; * ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); - * Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule); + * Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule); * } *
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteForwardingRule(ForwardingRuleName forwardingRule) { + public final Operation deleteForwardingRule(String requestId, ForwardingRuleName forwardingRule) { DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .build(); return deleteForwardingRule(request); @@ -333,19 +341,26 @@ public final Operation deleteForwardingRule(ForwardingRuleName forwardingRule) { * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
-   *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule.toString());
+   *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteForwardingRule(String forwardingRule) { + public final Operation deleteForwardingRule(String requestId, String forwardingRule) { DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule) .build(); return deleteForwardingRule(request); @@ -358,8 +373,10 @@ public final Operation deleteForwardingRule(String forwardingRule) { * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   Operation response = forwardingRuleClient.deleteForwardingRule(request);
@@ -381,8 +398,10 @@ public final Operation deleteForwardingRule(DeleteForwardingRuleHttpRequest requ
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   ApiFuture<Operation> future = forwardingRuleClient.deleteForwardingRuleCallable().futureCall(request);
@@ -498,21 +517,28 @@ public final UnaryCallable getForw
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = forwardingRuleClient.insertForwardingRule(region, forwardingRuleResource);
+   *   Operation response = forwardingRuleClient.insertForwardingRule(requestId, region, forwardingRuleResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertForwardingRule(RegionName region, ForwardingRule forwardingRuleResource) { + public final Operation insertForwardingRule(String requestId, RegionName region, ForwardingRule forwardingRuleResource) { InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -526,21 +552,28 @@ public final Operation insertForwardingRule(RegionName region, ForwardingRule fo * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = forwardingRuleClient.insertForwardingRule(region.toString(), forwardingRuleResource);
+   *   Operation response = forwardingRuleClient.insertForwardingRule(requestId, region.toString(), forwardingRuleResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertForwardingRule(String region, ForwardingRule forwardingRuleResource) { + public final Operation insertForwardingRule(String requestId, String region, ForwardingRule forwardingRuleResource) { InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -554,9 +587,11 @@ public final Operation insertForwardingRule(String region, ForwardingRule forwar * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -579,9 +614,11 @@ public final Operation insertForwardingRule(InsertForwardingRuleHttpRequest requ
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -736,21 +773,28 @@ public final UnaryCallable l
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = forwardingRuleClient.setTargetForwardingRule(forwardingRule, targetReferenceResource);
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetForwardingRule(ForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetForwardingRule(String requestId, ForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -764,21 +808,28 @@ public final Operation setTargetForwardingRule(ForwardingRuleName forwardingRule * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = forwardingRuleClient.setTargetForwardingRule(forwardingRule.toString(), targetReferenceResource);
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(requestId, forwardingRule.toString(), targetReferenceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetForwardingRule(String forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetForwardingRule(String requestId, String forwardingRule, TargetReference targetReferenceResource) { SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -792,9 +843,11 @@ public final Operation setTargetForwardingRule(String forwardingRule, TargetRefe * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
@@ -817,9 +870,11 @@ public final Operation setTargetForwardingRule(SetTargetForwardingRuleHttpReques
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java
index d42016544ece..49c74049f2b3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java
@@ -37,6 +37,7 @@ public final class ForwardingRuleList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private ForwardingRuleList() {
     this.id = null;
@@ -44,6 +45,7 @@ private ForwardingRuleList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private ForwardingRuleList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(ForwardingRuleList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(ForwardingRuleList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public ForwardingRuleList build() {
 
 
 
 
+
       return new ForwardingRuleList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java
index 41020ed96e03..4b4ee030abb2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ForwardingRuleName implements ResourceName {
+public final class ForwardingRuleName implements com.google.api.resourcenames.ResourceName {
   private final String forwardingRule;
   private final String project;
   private final String region;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java
new file mode 100644
index 000000000000..7f9c2cdd8d94
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetAcceleratorTypeHttpRequest implements ApiMessage {
+  private final String acceleratorType;
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetAcceleratorTypeHttpRequest() {
+    this.acceleratorType = null;
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetAcceleratorTypeHttpRequest(
+      String acceleratorType,
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.acceleratorType = acceleratorType;
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("acceleratorType") && acceleratorType != null) {
+      fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType)));
+    }
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("acceleratorType")) {
+      return String.valueOf(acceleratorType);
+    }
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAcceleratorType() {
+    return acceleratorType;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetAcceleratorTypeHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetAcceleratorTypeHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetAcceleratorTypeHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetAcceleratorTypeHttpRequest();
+  }
+
+  public static class Builder {
+    private String acceleratorType;
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetAcceleratorTypeHttpRequest other) {
+      if (other == GetAcceleratorTypeHttpRequest.getDefaultInstance()) return this;
+      if (other.getAcceleratorType() != null) {
+        this.acceleratorType = other.acceleratorType;
+      }
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetAcceleratorTypeHttpRequest source) {
+      this.acceleratorType = source.acceleratorType;
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAcceleratorType() {
+      return acceleratorType;
+    }
+
+    public Builder setAcceleratorType(String acceleratorType) {
+      this.acceleratorType = acceleratorType;
+      return this;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetAcceleratorTypeHttpRequest build() {
+      String missing = "";
+      if (acceleratorType == null) {
+        missing += " acceleratorType";
+      }
+
+
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetAcceleratorTypeHttpRequest(
+        acceleratorType,
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAcceleratorType(this.acceleratorType);
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetAcceleratorTypeHttpRequest{"
+        + "acceleratorType=" + acceleratorType + ", "
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetAcceleratorTypeHttpRequest) {
+      GetAcceleratorTypeHttpRequest that = (GetAcceleratorTypeHttpRequest) o;
+      return
+          Objects.equals(this.acceleratorType, that.getAcceleratorType()) &&
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      acceleratorType,
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java
new file mode 100644
index 000000000000..15c594ecd964
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetBackendBucketHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String backendBucket;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetBackendBucketHttpRequest() {
+    this.access_token = null;
+    this.backendBucket = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetBackendBucketHttpRequest(
+      String access_token,
+      String backendBucket,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.backendBucket = backendBucket;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("backendBucket") && backendBucket != null) {
+      fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("backendBucket")) {
+      return String.valueOf(backendBucket);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getBackendBucket() {
+    return backendBucket;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetBackendBucketHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetBackendBucketHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetBackendBucketHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetBackendBucketHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String backendBucket;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetBackendBucketHttpRequest other) {
+      if (other == GetBackendBucketHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getBackendBucket() != null) {
+        this.backendBucket = other.backendBucket;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetBackendBucketHttpRequest source) {
+      this.access_token = source.access_token;
+      this.backendBucket = source.backendBucket;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getBackendBucket() {
+      return backendBucket;
+    }
+
+    public Builder setBackendBucket(String backendBucket) {
+      this.backendBucket = backendBucket;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetBackendBucketHttpRequest build() {
+      String missing = "";
+
+      if (backendBucket == null) {
+        missing += " backendBucket";
+      }
+
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetBackendBucketHttpRequest(
+        access_token,
+        backendBucket,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setBackendBucket(this.backendBucket);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetBackendBucketHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "backendBucket=" + backendBucket + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetBackendBucketHttpRequest) {
+      GetBackendBucketHttpRequest that = (GetBackendBucketHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.backendBucket, that.getBackendBucket()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      backendBucket,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java
index 9341bbee372b..3ecfe8e20cf6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +52,7 @@ private GetBackendServiceHttpRequest() {
     this.userIp = null;
   }
 
+
   private GetBackendServiceHttpRequest(
       String access_token,
       String backendService,
@@ -57,7 +61,8 @@ private GetBackendServiceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.backendService = backendService;
     this.callback = callback;
@@ -165,24 +170,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(GetBackendServiceHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static GetBackendServiceHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final GetBackendServiceHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new GetBackendServiceHttpRequest();
   }
@@ -311,6 +314,7 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public GetBackendServiceHttpRequest build() {
       String missing = "";
 
@@ -318,11 +322,24 @@ public GetBackendServiceHttpRequest build() {
         missing += " backendService";
       }
 
+
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new GetBackendServiceHttpRequest(
-          access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        backendService,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -342,29 +359,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "GetBackendServiceHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "backendService="
-        + backendService
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "backendService=" + backendService + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +377,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof GetBackendServiceHttpRequest) {
       GetBackendServiceHttpRequest that = (GetBackendServiceHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.backendService, that.getBackendService())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.backendService, that.getBackendService()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +394,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      backendService,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java
index be3a9305efae..6fc34419fe86 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +52,7 @@ private GetInstanceHttpRequest() {
     this.userIp = null;
   }
 
+
   private GetInstanceHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +61,8 @@ private GetInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -165,24 +170,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(GetInstanceHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static GetInstanceHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final GetInstanceHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new GetInstanceHttpRequest();
   }
@@ -311,18 +314,32 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public GetInstanceHttpRequest build() {
       String missing = "";
 
+
+
       if (instance == null) {
         missing += " instance";
       }
 
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new GetInstanceHttpRequest(
-          access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        callback,
+        fields,
+        instance,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -342,29 +359,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "GetInstanceHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "instance="
-        + instance
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instance=" + instance + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +377,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof GetInstanceHttpRequest) {
       GetInstanceHttpRequest that = (GetInstanceHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.instance, that.getInstance())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instance, that.getInstance()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +394,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      callback,
+      fields,
+      instance,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java
new file mode 100644
index 000000000000..4c10e3281f60
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetInterconnectAttachmentHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String interconnectAttachment;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetInterconnectAttachmentHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.interconnectAttachment = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetInterconnectAttachmentHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String interconnectAttachment,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.interconnectAttachment = interconnectAttachment;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) {
+      fieldMap.put("interconnectAttachment", Collections.singletonList(String.valueOf(interconnectAttachment)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("interconnectAttachment")) {
+      return String.valueOf(interconnectAttachment);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInterconnectAttachment() {
+    return interconnectAttachment;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetInterconnectAttachmentHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetInterconnectAttachmentHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetInterconnectAttachmentHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetInterconnectAttachmentHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String interconnectAttachment;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetInterconnectAttachmentHttpRequest other) {
+      if (other == GetInterconnectAttachmentHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInterconnectAttachment() != null) {
+        this.interconnectAttachment = other.interconnectAttachment;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetInterconnectAttachmentHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.interconnectAttachment = source.interconnectAttachment;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInterconnectAttachment() {
+      return interconnectAttachment;
+    }
+
+    public Builder setInterconnectAttachment(String interconnectAttachment) {
+      this.interconnectAttachment = interconnectAttachment;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetInterconnectAttachmentHttpRequest build() {
+      String missing = "";
+
+
+
+      if (interconnectAttachment == null) {
+        missing += " interconnectAttachment";
+      }
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetInterconnectAttachmentHttpRequest(
+        access_token,
+        callback,
+        fields,
+        interconnectAttachment,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInterconnectAttachment(this.interconnectAttachment);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetInterconnectAttachmentHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "interconnectAttachment=" + interconnectAttachment + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetInterconnectAttachmentHttpRequest) {
+      GetInterconnectAttachmentHttpRequest that = (GetInterconnectAttachmentHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      interconnectAttachment,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java
new file mode 100644
index 000000000000..e307dce68a52
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetInterconnectHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String interconnect;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetInterconnectHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.interconnect = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetInterconnectHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String interconnect,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.interconnect = interconnect;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("interconnect") && interconnect != null) {
+      fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("interconnect")) {
+      return String.valueOf(interconnect);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInterconnect() {
+    return interconnect;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetInterconnectHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetInterconnectHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetInterconnectHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetInterconnectHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String interconnect;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetInterconnectHttpRequest other) {
+      if (other == GetInterconnectHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInterconnect() != null) {
+        this.interconnect = other.interconnect;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetInterconnectHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.interconnect = source.interconnect;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInterconnect() {
+      return interconnect;
+    }
+
+    public Builder setInterconnect(String interconnect) {
+      this.interconnect = interconnect;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetInterconnectHttpRequest build() {
+      String missing = "";
+
+
+
+      if (interconnect == null) {
+        missing += " interconnect";
+      }
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetInterconnectHttpRequest(
+        access_token,
+        callback,
+        fields,
+        interconnect,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInterconnect(this.interconnect);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetInterconnectHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "interconnect=" + interconnect + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetInterconnectHttpRequest) {
+      GetInterconnectHttpRequest that = (GetInterconnectHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.interconnect, that.getInterconnect()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      interconnect,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java
new file mode 100644
index 000000000000..43ad397b48c8
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetInterconnectLocationHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String interconnectLocation;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetInterconnectLocationHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.interconnectLocation = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetInterconnectLocationHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String interconnectLocation,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.interconnectLocation = interconnectLocation;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("interconnectLocation") && interconnectLocation != null) {
+      fieldMap.put("interconnectLocation", Collections.singletonList(String.valueOf(interconnectLocation)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("interconnectLocation")) {
+      return String.valueOf(interconnectLocation);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInterconnectLocation() {
+    return interconnectLocation;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetInterconnectLocationHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetInterconnectLocationHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetInterconnectLocationHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetInterconnectLocationHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String interconnectLocation;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetInterconnectLocationHttpRequest other) {
+      if (other == GetInterconnectLocationHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInterconnectLocation() != null) {
+        this.interconnectLocation = other.interconnectLocation;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetInterconnectLocationHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.interconnectLocation = source.interconnectLocation;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInterconnectLocation() {
+      return interconnectLocation;
+    }
+
+    public Builder setInterconnectLocation(String interconnectLocation) {
+      this.interconnectLocation = interconnectLocation;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetInterconnectLocationHttpRequest build() {
+      String missing = "";
+
+
+
+      if (interconnectLocation == null) {
+        missing += " interconnectLocation";
+      }
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetInterconnectLocationHttpRequest(
+        access_token,
+        callback,
+        fields,
+        interconnectLocation,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInterconnectLocation(this.interconnectLocation);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetInterconnectLocationHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "interconnectLocation=" + interconnectLocation + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetInterconnectLocationHttpRequest) {
+      GetInterconnectLocationHttpRequest that = (GetInterconnectLocationHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      interconnectLocation,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java
new file mode 100644
index 000000000000..2cec36bb2e0a
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetLicenseHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String license;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetLicenseHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.license = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetLicenseHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String license,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.license = license;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("license") && license != null) {
+      fieldMap.put("license", Collections.singletonList(String.valueOf(license)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("license")) {
+      return String.valueOf(license);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getLicense() {
+    return license;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetLicenseHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetLicenseHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetLicenseHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetLicenseHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String license;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetLicenseHttpRequest other) {
+      if (other == GetLicenseHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getLicense() != null) {
+        this.license = other.license;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetLicenseHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.license = source.license;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getLicense() {
+      return license;
+    }
+
+    public Builder setLicense(String license) {
+      this.license = license;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetLicenseHttpRequest build() {
+      String missing = "";
+
+
+
+
+      if (license == null) {
+        missing += " license";
+      }
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetLicenseHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        license,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setLicense(this.license);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetLicenseHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "license=" + license + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetLicenseHttpRequest) {
+      GetLicenseHttpRequest that = (GetLicenseHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.license, that.getLicense()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      license,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java
new file mode 100644
index 000000000000..56e8e32682a8
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetRegionCommitmentHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String commitment;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetRegionCommitmentHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.commitment = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetRegionCommitmentHttpRequest(
+      String access_token,
+      String callback,
+      String commitment,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.commitment = commitment;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("commitment") && commitment != null) {
+      fieldMap.put("commitment", Collections.singletonList(String.valueOf(commitment)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("commitment")) {
+      return String.valueOf(commitment);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getCommitment() {
+    return commitment;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetRegionCommitmentHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetRegionCommitmentHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetRegionCommitmentHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetRegionCommitmentHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String commitment;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetRegionCommitmentHttpRequest other) {
+      if (other == GetRegionCommitmentHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getCommitment() != null) {
+        this.commitment = other.commitment;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetRegionCommitmentHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.commitment = source.commitment;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getCommitment() {
+      return commitment;
+    }
+
+    public Builder setCommitment(String commitment) {
+      this.commitment = commitment;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetRegionCommitmentHttpRequest build() {
+      String missing = "";
+
+
+      if (commitment == null) {
+        missing += " commitment";
+      }
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetRegionCommitmentHttpRequest(
+        access_token,
+        callback,
+        commitment,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setCommitment(this.commitment);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetRegionCommitmentHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "commitment=" + commitment + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetRegionCommitmentHttpRequest) {
+      GetRegionCommitmentHttpRequest that = (GetRegionCommitmentHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.commitment, that.getCommitment()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      commitment,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java
index 7ff9e320f782..dc8795624c12 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +52,7 @@ private GetRegionInstanceGroupHttpRequest() {
     this.userIp = null;
   }
 
+
   private GetRegionInstanceGroupHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +61,8 @@ private GetRegionInstanceGroupHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -165,24 +170,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(GetRegionInstanceGroupHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static GetRegionInstanceGroupHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final GetRegionInstanceGroupHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new GetRegionInstanceGroupHttpRequest();
   }
@@ -311,18 +314,32 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public GetRegionInstanceGroupHttpRequest build() {
       String missing = "";
 
+
+
       if (instanceGroup == null) {
         missing += " instanceGroup";
       }
 
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new GetRegionInstanceGroupHttpRequest(
-          access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        callback,
+        fields,
+        instanceGroup,
+        key,
+        prettyPrint,
+        quotaUser,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -342,29 +359,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "GetRegionInstanceGroupHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "instanceGroup="
-        + instanceGroup
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instanceGroup=" + instanceGroup + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +377,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof GetRegionInstanceGroupHttpRequest) {
       GetRegionInstanceGroupHttpRequest that = (GetRegionInstanceGroupHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.instanceGroup, that.getInstanceGroup())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instanceGroup, that.getInstanceGroup()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +394,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      callback,
+      fields,
+      instanceGroup,
+      key,
+      prettyPrint,
+      quotaUser,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java
index 6ef53c597515..5f1a1e6bb172 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +52,7 @@ private GetSubnetworkHttpRequest() {
     this.userIp = null;
   }
 
+
   private GetSubnetworkHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +61,8 @@ private GetSubnetworkHttpRequest(
       String prettyPrint,
       String quotaUser,
       String subnetwork,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -165,24 +170,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(GetSubnetworkHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static GetSubnetworkHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final GetSubnetworkHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new GetSubnetworkHttpRequest();
   }
@@ -311,9 +314,15 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public GetSubnetworkHttpRequest build() {
       String missing = "";
 
+
+
+
+
+
       if (subnetwork == null) {
         missing += " subnetwork";
       }
@@ -322,7 +331,15 @@ public GetSubnetworkHttpRequest build() {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new GetSubnetworkHttpRequest(
-          access_token, callback, fields, key, prettyPrint, quotaUser, subnetwork, userIp);
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        subnetwork,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -342,29 +359,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "GetSubnetworkHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "subnetwork="
-        + subnetwork
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "subnetwork=" + subnetwork + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +377,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof GetSubnetworkHttpRequest) {
       GetSubnetworkHttpRequest that = (GetSubnetworkHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.subnetwork, that.getSubnetwork())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.subnetwork, that.getSubnetwork()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +394,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, key, prettyPrint, quotaUser, subnetwork, userIp);
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      subnetwork,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java
new file mode 100644
index 000000000000..f303e77ca864
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetTargetTcpProxyHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String targetTcpProxy;
+  private final String userIp;
+
+  private GetTargetTcpProxyHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.targetTcpProxy = null;
+    this.userIp = null;
+  }
+
+
+  private GetTargetTcpProxyHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String targetTcpProxy,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.targetTcpProxy = targetTcpProxy;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
+      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("targetTcpProxy")) {
+      return String.valueOf(targetTcpProxy);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getTargetTcpProxy() {
+    return targetTcpProxy;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetTargetTcpProxyHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetTargetTcpProxyHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetTargetTcpProxyHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetTargetTcpProxyHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String targetTcpProxy;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetTargetTcpProxyHttpRequest other) {
+      if (other == GetTargetTcpProxyHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getTargetTcpProxy() != null) {
+        this.targetTcpProxy = other.targetTcpProxy;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetTargetTcpProxyHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.targetTcpProxy = source.targetTcpProxy;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getTargetTcpProxy() {
+      return targetTcpProxy;
+    }
+
+    public Builder setTargetTcpProxy(String targetTcpProxy) {
+      this.targetTcpProxy = targetTcpProxy;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetTargetTcpProxyHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+      if (targetTcpProxy == null) {
+        missing += " targetTcpProxy";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetTargetTcpProxyHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        targetTcpProxy,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setTargetTcpProxy(this.targetTcpProxy);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetTargetTcpProxyHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "targetTcpProxy=" + targetTcpProxy + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetTargetTcpProxyHttpRequest) {
+      GetTargetTcpProxyHttpRequest that = (GetTargetTcpProxyHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      targetTcpProxy,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java
index a81d5bea67ca..44b7e0624e8d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +52,7 @@ private GetUrlMapHttpRequest() {
     this.userIp = null;
   }
 
+
   private GetUrlMapHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +61,8 @@ private GetUrlMapHttpRequest(
       String prettyPrint,
       String quotaUser,
       String urlMap,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -165,24 +170,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(GetUrlMapHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static GetUrlMapHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final GetUrlMapHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new GetUrlMapHttpRequest();
   }
@@ -311,9 +314,15 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public GetUrlMapHttpRequest build() {
       String missing = "";
 
+
+
+
+
+
       if (urlMap == null) {
         missing += " urlMap";
       }
@@ -322,7 +331,15 @@ public GetUrlMapHttpRequest build() {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new GetUrlMapHttpRequest(
-          access_token, callback, fields, key, prettyPrint, quotaUser, urlMap, userIp);
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        urlMap,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -342,29 +359,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "GetUrlMapHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "urlMap="
-        + urlMap
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "urlMap=" + urlMap + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +377,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof GetUrlMapHttpRequest) {
       GetUrlMapHttpRequest that = (GetUrlMapHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.urlMap, that.getUrlMap())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.urlMap, that.getUrlMap()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +394,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, key, prettyPrint, quotaUser, urlMap, userIp);
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      urlMap,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java
new file mode 100644
index 000000000000..b2d9f7b8d3e7
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetXpnHostProjectHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String project;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetXpnHostProjectHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetXpnHostProjectHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String project,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("project") && project != null) {
+      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("project")) {
+      return String.valueOf(project);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetXpnHostProjectHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetXpnHostProjectHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetXpnHostProjectHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetXpnHostProjectHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String project;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetXpnHostProjectHttpRequest other) {
+      if (other == GetXpnHostProjectHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetXpnHostProjectHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetXpnHostProjectHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+      if (project == null) {
+        missing += " project";
+      }
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetXpnHostProjectHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        project,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetXpnHostProjectHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "project=" + project + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetXpnHostProjectHttpRequest) {
+      GetXpnHostProjectHttpRequest that = (GetXpnHostProjectHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      project,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java
new file mode 100644
index 000000000000..170c829f4df9
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java
@@ -0,0 +1,543 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GetXpnResourcesProjectsHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String filter;
+  private final String key;
+  private final Integer maxResults;
+  private final String orderBy;
+  private final String pageToken;
+  private final String prettyPrint;
+  private final String project;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetXpnResourcesProjectsHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.filter = null;
+    this.key = null;
+    this.maxResults = null;
+    this.orderBy = null;
+    this.pageToken = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+
+  private GetXpnResourcesProjectsHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String filter,
+      String key,
+      Integer maxResults,
+      String orderBy,
+      String pageToken,
+      String prettyPrint,
+      String project,
+      String quotaUser,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.filter = filter;
+    this.key = key;
+    this.maxResults = maxResults;
+    this.orderBy = orderBy;
+    this.pageToken = pageToken;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("filter") && filter != null) {
+      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("maxResults") && maxResults != null) {
+      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
+    }
+    if (fieldNames.contains("orderBy") && orderBy != null) {
+      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
+    }
+    if (fieldNames.contains("pageToken") && pageToken != null) {
+      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("project") && project != null) {
+      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("filter")) {
+      return String.valueOf(filter);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("maxResults")) {
+      return String.valueOf(maxResults);
+    }
+    if (fieldName.equals("orderBy")) {
+      return String.valueOf(orderBy);
+    }
+    if (fieldName.equals("pageToken")) {
+      return String.valueOf(pageToken);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("project")) {
+      return String.valueOf(project);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getFilter() {
+    return filter;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public Integer getMaxResults() {
+    return maxResults;
+  }
+
+  public String getOrderBy() {
+    return orderBy;
+  }
+
+  public String getPageToken() {
+    return pageToken;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GetXpnResourcesProjectsHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetXpnResourcesProjectsHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GetXpnResourcesProjectsHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GetXpnResourcesProjectsHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String filter;
+    private String key;
+    private Integer maxResults;
+    private String orderBy;
+    private String pageToken;
+    private String prettyPrint;
+    private String project;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetXpnResourcesProjectsHttpRequest other) {
+      if (other == GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getFilter() != null) {
+        this.filter = other.filter;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getMaxResults() != null) {
+        this.maxResults = other.maxResults;
+      }
+      if (other.getOrderBy() != null) {
+        this.orderBy = other.orderBy;
+      }
+      if (other.getPageToken() != null) {
+        this.pageToken = other.pageToken;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetXpnResourcesProjectsHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.filter = source.filter;
+      this.key = source.key;
+      this.maxResults = source.maxResults;
+      this.orderBy = source.orderBy;
+      this.pageToken = source.pageToken;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getFilter() {
+      return filter;
+    }
+
+    public Builder setFilter(String filter) {
+      this.filter = filter;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public Integer getMaxResults() {
+      return maxResults;
+    }
+
+    public Builder setMaxResults(Integer maxResults) {
+      this.maxResults = maxResults;
+      return this;
+    }
+
+    public String getOrderBy() {
+      return orderBy;
+    }
+
+    public Builder setOrderBy(String orderBy) {
+      this.orderBy = orderBy;
+      return this;
+    }
+
+    public String getPageToken() {
+      return pageToken;
+    }
+
+    public Builder setPageToken(String pageToken) {
+      this.pageToken = pageToken;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public GetXpnResourcesProjectsHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+
+
+      if (project == null) {
+        missing += " project";
+      }
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetXpnResourcesProjectsHttpRequest(
+        access_token,
+        callback,
+        fields,
+        filter,
+        key,
+        maxResults,
+        orderBy,
+        pageToken,
+        prettyPrint,
+        project,
+        quotaUser,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setFilter(this.filter);
+      newBuilder.setKey(this.key);
+      newBuilder.setMaxResults(this.maxResults);
+      newBuilder.setOrderBy(this.orderBy);
+      newBuilder.setPageToken(this.pageToken);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetXpnResourcesProjectsHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "filter=" + filter + ", "
+        + "key=" + key + ", "
+        + "maxResults=" + maxResults + ", "
+        + "orderBy=" + orderBy + ", "
+        + "pageToken=" + pageToken + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "project=" + project + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetXpnResourcesProjectsHttpRequest) {
+      GetXpnResourcesProjectsHttpRequest that = (GetXpnResourcesProjectsHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.filter, that.getFilter()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.maxResults, that.getMaxResults()) &&
+          Objects.equals(this.orderBy, that.getOrderBy()) &&
+          Objects.equals(this.pageToken, that.getPageToken()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      filter,
+      key,
+      maxResults,
+      orderBy,
+      pageToken,
+      prettyPrint,
+      project,
+      quotaUser,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java
index 6cf011ff3133..04e17f038757 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java
@@ -53,7 +53,8 @@
  * 
  * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
  *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
- *   Operation response = globalAddressClient.deleteGlobalAddress(address);
+ *   String requestId = "";
+ *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
  * }
  * 
  * 
@@ -176,19 +177,26 @@ public GlobalAddressStub getStub() { *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
-   *   Operation response = globalAddressClient.deleteGlobalAddress(address);
+   *   String requestId = "";
+   *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
    * }
    * 
* * @param address Name of the address resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalAddress(ProjectAddressName address) { + public final Operation deleteGlobalAddress(ProjectAddressName address, String requestId) { DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder() .setAddress(address == null ? null : address.toString()) + .setRequestId(requestId) .build(); return deleteGlobalAddress(request); } @@ -201,19 +209,26 @@ public final Operation deleteGlobalAddress(ProjectAddressName address) { *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
-   *   Operation response = globalAddressClient.deleteGlobalAddress(address.toString());
+   *   String requestId = "";
+   *   Operation response = globalAddressClient.deleteGlobalAddress(address.toString(), requestId);
    * }
    * 
* * @param address Name of the address resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalAddress(String address) { + public final Operation deleteGlobalAddress(String address, String requestId) { DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder() .setAddress(address) + .setRequestId(requestId) .build(); return deleteGlobalAddress(request); } @@ -226,8 +241,10 @@ public final Operation deleteGlobalAddress(String address) { *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   String requestId = "";
    *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = globalAddressClient.deleteGlobalAddress(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteGlobalAddress(DeleteGlobalAddressHttpRequest reques
    * 

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   String requestId = "";
    *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = globalAddressClient.deleteGlobalAddressCallable().futureCall(request);
    *   // Do something
@@ -365,21 +384,28 @@ public final UnaryCallable getGlobalAddres
    * Sample code:
    * 

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = globalAddressClient.insertGlobalAddress(project, addressResource);
+   *   Operation response = globalAddressClient.insertGlobalAddress(requestId, project, addressResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param addressResource A reserved address resource. + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalAddress(ProjectName project, Address addressResource) { + public final Operation insertGlobalAddress(String requestId, ProjectName project, Address addressResource) { InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setAddressResource(addressResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertGlobalAddress(ProjectName project, Address addressR * Sample code: *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = globalAddressClient.insertGlobalAddress(project.toString(), addressResource);
+   *   Operation response = globalAddressClient.insertGlobalAddress(requestId, project.toString(), addressResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param addressResource A reserved address resource. + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalAddress(String project, Address addressResource) { + public final Operation insertGlobalAddress(String requestId, String project, Address addressResource) { InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setAddressResource(addressResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertGlobalAddress(String project, Address addressResour * Sample code: *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setAddressResource(addressResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertGlobalAddress(InsertGlobalAddressHttpRequest reques
    * Sample code:
    * 

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setAddressResource(addressResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java
index 73765f550ec6..c37774ea2d5d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+ *   String requestId = "";
  *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
- *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
+ *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
  * }
  * 
  * 
@@ -170,24 +171,31 @@ public GlobalForwardingRuleStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified ForwardingRule resource. + * Deletes the specified GlobalForwardingRule resource. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
-   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalForwardingRule(ProjectForwardingRuleName forwardingRule) { + public final Operation deleteGlobalForwardingRule(String requestId, ProjectForwardingRuleName forwardingRule) { DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .build(); return deleteGlobalForwardingRule(request); @@ -195,24 +203,31 @@ public final Operation deleteGlobalForwardingRule(ProjectForwardingRuleName forw // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified ForwardingRule resource. + * Deletes the specified GlobalForwardingRule resource. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
-   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule.toString());
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalForwardingRule(String forwardingRule) { + public final Operation deleteGlobalForwardingRule(String requestId, String forwardingRule) { DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule) .build(); return deleteGlobalForwardingRule(request); @@ -220,13 +235,15 @@ public final Operation deleteGlobalForwardingRule(String forwardingRule) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified ForwardingRule resource. + * Deletes the specified GlobalForwardingRule resource. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(request);
@@ -243,13 +260,15 @@ public final Operation deleteGlobalForwardingRule(DeleteGlobalForwardingRuleHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified ForwardingRule resource.
+   * Deletes the specified GlobalForwardingRule resource.
    *
    * Sample code:
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   ApiFuture<Operation> future = globalForwardingRuleClient.deleteGlobalForwardingRuleCallable().futureCall(request);
@@ -265,7 +284,7 @@ public final UnaryCallable del
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request.
+   * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.
    *
    * Sample code:
    * 

@@ -290,7 +309,7 @@ public final ForwardingRule getGlobalForwardingRule(ProjectForwardingRuleName fo
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request.
+   * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.
    *
    * Sample code:
    * 

@@ -315,7 +334,7 @@ public final ForwardingRule getGlobalForwardingRule(String forwardingRule) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request.
+   * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.
    *
    * Sample code:
    * 

@@ -338,7 +357,7 @@ public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpR
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request.
+   * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.
    *
    * Sample code:
    * 

@@ -360,26 +379,33 @@ public final UnaryCallable g
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a ForwardingRule resource in the specified project and region using the data included in the request.
+   * Creates a GlobalForwardingRule resource in the specified project using the data included in the request.
    *
    * Sample code:
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(project, forwardingRuleResource);
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(requestId, project, forwardingRuleResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalForwardingRule(ProjectName project, ForwardingRule forwardingRuleResource) { + public final Operation insertGlobalForwardingRule(String requestId, ProjectName project, ForwardingRule forwardingRuleResource) { InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -388,26 +414,33 @@ public final Operation insertGlobalForwardingRule(ProjectName project, Forwardin // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(project.toString(), forwardingRuleResource);
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(requestId, project.toString(), forwardingRuleResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalForwardingRule(String project, ForwardingRule forwardingRuleResource) { + public final Operation insertGlobalForwardingRule(String requestId, String project, ForwardingRule forwardingRuleResource) { InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -416,14 +449,16 @@ public final Operation insertGlobalForwardingRule(String project, ForwardingRule // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -441,14 +476,16 @@ public final Operation insertGlobalForwardingRule(InsertGlobalForwardingRuleHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a ForwardingRule resource in the specified project and region using the data included in the request.
+   * Creates a GlobalForwardingRule resource in the specified project using the data included in the request.
    *
    * Sample code:
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -465,7 +502,7 @@ public final UnaryCallable ins
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of ForwardingRule resources available to the specified project.
+   * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
    * Sample code:
    * 

@@ -491,7 +528,7 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(Pr
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of ForwardingRule resources available to the specified project.
+   * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
    * Sample code:
    * 

@@ -517,7 +554,7 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(St
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of ForwardingRule resources available to the specified project.
+   * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
    * Sample code:
    * 

@@ -543,7 +580,7 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(Li
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of ForwardingRule resources available to the specified project.
+   * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
    * Sample code:
    * 

@@ -567,7 +604,7 @@ public final UnaryCallable
@@ -598,26 +635,33 @@ public final UnaryCallable
    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource);
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetGlobalForwardingRule(ProjectForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetGlobalForwardingRule(String requestId, ProjectForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -626,26 +670,33 @@ public final Operation setTargetGlobalForwardingRule(ProjectForwardingRuleName f // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(forwardingRule.toString(), targetReferenceResource);
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(requestId, forwardingRule.toString(), targetReferenceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetGlobalForwardingRule(String forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetGlobalForwardingRule(String requestId, String forwardingRule, TargetReference targetReferenceResource) { SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder() + .setRequestId(requestId) .setForwardingRule(forwardingRule) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -654,14 +705,16 @@ public final Operation setTargetGlobalForwardingRule(String forwardingRule, Targ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. * * Sample code: *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
@@ -679,14 +732,16 @@ public final Operation setTargetGlobalForwardingRule(SetTargetGlobalForwardingRu
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes target URL for forwarding rule. The new target should be of the same type as the old target.
+   * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.
    *
    * Sample code:
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+   *   String requestId = "";
    *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java
new file mode 100644
index 000000000000..0d4f9d7dc3fd
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class GlobalSetLabelsRequest implements ApiMessage {
+  private final String labelFingerprint;
+  private final Map labels;
+
+  private GlobalSetLabelsRequest() {
+    this.labelFingerprint = null;
+    this.labels = null;
+  }
+
+
+  private GlobalSetLabelsRequest(
+      String labelFingerprint,
+      Map labels
+      ) {
+    this.labelFingerprint = labelFingerprint;
+    this.labels = labels;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
+      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
+    }
+    if (fieldNames.contains("labels") && labels != null) {
+      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("labelFingerprint")) {
+      return String.valueOf(labelFingerprint);
+    }
+    if (fieldName.equals("labels")) {
+      return String.valueOf(labels);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getLabelFingerprint() {
+    return labelFingerprint;
+  }
+
+  public Map getLabelsMap() {
+    return labels;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(GlobalSetLabelsRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GlobalSetLabelsRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final GlobalSetLabelsRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new GlobalSetLabelsRequest();
+  }
+
+  public static class Builder {
+    private String labelFingerprint;
+    private Map labels;
+
+    Builder() {}
+
+    public Builder mergeFrom(GlobalSetLabelsRequest other) {
+      if (other == GlobalSetLabelsRequest.getDefaultInstance()) return this;
+      if (other.getLabelFingerprint() != null) {
+        this.labelFingerprint = other.labelFingerprint;
+      }
+      if (other.getLabelsMap() != null) {
+        this.labels = other.labels;
+      }
+      return this;
+    }
+
+    Builder(GlobalSetLabelsRequest source) {
+      this.labelFingerprint = source.labelFingerprint;
+      this.labels = source.labels;
+    }
+
+    public String getLabelFingerprint() {
+      return labelFingerprint;
+    }
+
+    public Builder setLabelFingerprint(String labelFingerprint) {
+      this.labelFingerprint = labelFingerprint;
+      return this;
+    }
+
+    public Map getLabelsMap() {
+      return labels;
+    }
+
+    public Builder putAllLabels(Map labels) {
+      this.labels = labels;
+      return this;
+    }
+
+
+    public GlobalSetLabelsRequest build() {
+
+      return new GlobalSetLabelsRequest(
+        labelFingerprint,
+        labels
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setLabelFingerprint(this.labelFingerprint);
+      newBuilder.putAllLabels(this.labels);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GlobalSetLabelsRequest{"
+        + "labelFingerprint=" + labelFingerprint + ", "
+        + "labels=" + labels
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GlobalSetLabelsRequest) {
+      GlobalSetLabelsRequest that = (GlobalSetLabelsRequest) o;
+      return
+          Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) &&
+          Objects.equals(this.labels, that.getLabelsMap())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      labelFingerprint,
+      labels
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
index af7ee357f569..a27aaa13a7b0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+ *   String requestId = "";
  *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
- *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
+ *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
  * }
  * 
  * 
@@ -175,19 +176,26 @@ public HealthCheckStub getStub() { * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
-   *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
+   *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHealthCheck(HealthCheckName healthCheck) { + public final Operation deleteHealthCheck(String requestId, HealthCheckName healthCheck) { DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) .build(); return deleteHealthCheck(request); @@ -200,19 +208,26 @@ public final Operation deleteHealthCheck(HealthCheckName healthCheck) { * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
-   *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck.toString());
+   *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHealthCheck(String healthCheck) { + public final Operation deleteHealthCheck(String requestId, String healthCheck) { DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHealthCheck(healthCheck) .build(); return deleteHealthCheck(request); @@ -225,8 +240,10 @@ public final Operation deleteHealthCheck(String healthCheck) { * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
    *   Operation response = healthCheckClient.deleteHealthCheck(request);
@@ -248,8 +265,10 @@ public final Operation deleteHealthCheck(DeleteHealthCheckHttpRequest request) {
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
    *   ApiFuture<Operation> future = healthCheckClient.deleteHealthCheckCallable().futureCall(request);
@@ -365,21 +384,28 @@ public final UnaryCallable getHealthChec
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.insertHealthCheck(project, healthCheckResource);
+   *   Operation response = healthCheckClient.insertHealthCheck(requestId, project, healthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHealthCheck(ProjectName project, HealthCheck healthCheckResource) { + public final Operation insertHealthCheck(String requestId, ProjectName project, HealthCheck healthCheckResource) { InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setHealthCheckResource(healthCheckResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertHealthCheck(ProjectName project, HealthCheck health * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.insertHealthCheck(project.toString(), healthCheckResource);
+   *   Operation response = healthCheckClient.insertHealthCheck(requestId, project.toString(), healthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHealthCheck(String project, HealthCheck healthCheckResource) { + public final Operation insertHealthCheck(String requestId, String project, HealthCheck healthCheckResource) { InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setHealthCheckResource(healthCheckResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertHealthCheck(String project, HealthCheck healthCheck * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertHealthCheck(InsertHealthCheckHttpRequest request) {
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -598,26 +635,33 @@ public final UnaryCallable listHea
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.patchHealthCheck(healthCheck, healthCheckResource);
+   *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck, healthCheckResource);
    * }
    * 
* - * @param healthCheck Name of the HealthCheck resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param healthCheck Name of the HealthCheck resource to patch. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHealthCheck(HealthCheckName healthCheck, HealthCheck healthCheckResource) { + public final Operation patchHealthCheck(String requestId, HealthCheckName healthCheck, HealthCheck healthCheckResource) { PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) .setHealthCheckResource(healthCheckResource) .build(); @@ -626,26 +670,33 @@ public final Operation patchHealthCheck(HealthCheckName healthCheck, HealthCheck // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * 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: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.patchHealthCheck(healthCheck.toString(), healthCheckResource);
+   *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
    * }
    * 
* - * @param healthCheck Name of the HealthCheck resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param healthCheck Name of the HealthCheck resource to patch. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHealthCheck(String healthCheck, HealthCheck healthCheckResource) { + public final Operation patchHealthCheck(String requestId, String healthCheck, HealthCheck healthCheckResource) { PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHealthCheck(healthCheck) .setHealthCheckResource(healthCheckResource) .build(); @@ -654,14 +705,16 @@ public final Operation patchHealthCheck(String healthCheck, HealthCheck healthCh // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * 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: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -679,14 +732,16 @@ public final Operation patchHealthCheck(PatchHealthCheckHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -708,21 +763,28 @@ public final UnaryCallable patchHealthCh
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.updateHealthCheck(healthCheck, healthCheckResource);
+   *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck, healthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to update. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHealthCheck(HealthCheckName healthCheck, HealthCheck healthCheckResource) { + public final Operation updateHealthCheck(String requestId, HealthCheckName healthCheck, HealthCheck healthCheckResource) { UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) .setHealthCheckResource(healthCheckResource) .build(); @@ -736,21 +798,28 @@ public final Operation updateHealthCheck(HealthCheckName healthCheck, HealthChec * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.updateHealthCheck(healthCheck.toString(), healthCheckResource);
+   *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to update. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHealthCheck(String healthCheck, HealthCheck healthCheckResource) { + public final Operation updateHealthCheck(String requestId, String healthCheck, HealthCheck healthCheckResource) { UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHealthCheck(healthCheck) .setHealthCheckResource(healthCheckResource) .build(); @@ -764,9 +833,11 @@ public final Operation updateHealthCheck(String healthCheck, HealthCheck healthC * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -789,9 +860,11 @@ public final Operation updateHealthCheck(UpdateHealthCheckHttpRequest request) {
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+   *   String requestId = "";
    *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
index e7290b0da358..9c419e92ec86 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
@@ -37,6 +37,7 @@ public final class HealthCheckList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private HealthCheckList() {
     this.id = null;
@@ -44,6 +45,7 @@ private HealthCheckList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private HealthCheckList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(HealthCheckList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(HealthCheckList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public HealthCheckList build() {
 
 
 
 
+
       return new HealthCheckList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java
index 1fc282781d9d..86a2cde0c9f4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class HealthCheckName implements ResourceName {
+public final class HealthCheckName implements com.google.api.resourcenames.ResourceName {
   private final String healthCheck;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
index f58b8b704927..ffac5b2078d1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+ *   String requestId = "";
  *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
- *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
+ *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
  * }
  * 
  * 
@@ -175,19 +176,26 @@ public HttpHealthCheckStub getStub() { * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpHealthCheck(HttpHealthCheckName httpHealthCheck) { + public final Operation deleteHttpHealthCheck(String requestId, HttpHealthCheckName httpHealthCheck) { DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) .build(); return deleteHttpHealthCheck(request); @@ -200,19 +208,26 @@ public final Operation deleteHttpHealthCheck(HttpHealthCheckName httpHealthCheck * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck.toString());
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpHealthCheck(String httpHealthCheck) { + public final Operation deleteHttpHealthCheck(String requestId, String httpHealthCheck) { DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck) .build(); return deleteHttpHealthCheck(request); @@ -225,8 +240,10 @@ public final Operation deleteHttpHealthCheck(String httpHealthCheck) { * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
    *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(request);
@@ -248,8 +265,10 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
    *   ApiFuture<Operation> future = httpHealthCheckClient.deleteHttpHealthCheckCallable().futureCall(request);
@@ -365,21 +384,28 @@ public final UnaryCallable getHt
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(project, httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project, httpHealthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpHealthCheck(ProjectName project, HttpHealthCheck httpHealthCheckResource) { + public final Operation insertHttpHealthCheck(String requestId, ProjectName project, HttpHealthCheck httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertHttpHealthCheck(ProjectName project, HttpHealthChec * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(project.toString(), httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project.toString(), httpHealthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpHealthCheck(String project, HttpHealthCheck httpHealthCheckResource) { + public final Operation insertHttpHealthCheck(String requestId, String project, HttpHealthCheck httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertHttpHealthCheck(String project, HttpHealthCheck htt * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -598,26 +635,33 @@ public final UnaryCallable
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.
+   * Updates a HttpHealthCheck 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:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
* - * @param httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpHealthCheck(HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation patchHttpHealthCheck(String requestId, HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -626,26 +670,33 @@ public final Operation patchHttpHealthCheck(HttpHealthCheckName httpHealthCheck, // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * Updates a HttpHealthCheck 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: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
    * }
    * 
* - * @param httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpHealthCheck(String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation patchHttpHealthCheck(String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -654,14 +705,16 @@ public final Operation patchHttpHealthCheck(String httpHealthCheck, HttpHealthCh // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * Updates a HttpHealthCheck 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: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -679,14 +732,16 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.
+   * Updates a HttpHealthCheck 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:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -708,21 +763,28 @@ public final UnaryCallable patchHttp
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to update. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpHealthCheck(HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation updateHttpHealthCheck(String requestId, HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -736,21 +798,28 @@ public final Operation updateHttpHealthCheck(HttpHealthCheckName httpHealthCheck * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to update. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpHealthCheck(String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation updateHttpHealthCheck(String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -764,9 +833,11 @@ public final Operation updateHttpHealthCheck(String httpHealthCheck, HttpHealthC * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -789,9 +860,11 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+   *   String requestId = "";
    *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java
index 9f5521cb6f6f..ad9def279706 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java
@@ -37,6 +37,7 @@ public final class HttpHealthCheckList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private HttpHealthCheckList() {
     this.id = null;
@@ -44,6 +45,7 @@ private HttpHealthCheckList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private HttpHealthCheckList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(HttpHealthCheckList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(HttpHealthCheckList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public HttpHealthCheckList build() {
 
 
 
 
+
       return new HttpHealthCheckList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java
index 526140f4a050..3496765f4d67 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class HttpHealthCheckName implements ResourceName {
+public final class HttpHealthCheckName implements com.google.api.resourcenames.ResourceName {
   private final String httpHealthCheck;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
index cd22810f10f2..83e6a1a95bbb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
@@ -53,7 +53,8 @@
  * 
  * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
  *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
- *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
+ *   String requestId = "";
+ *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
  * }
  * 
  * 
@@ -176,19 +177,26 @@ public HttpsHealthCheckStub getStub() { *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
+   *   String requestId = "";
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck) { + public final Operation deleteHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, String requestId) { DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setRequestId(requestId) .build(); return deleteHttpsHealthCheck(request); } @@ -201,19 +209,26 @@ public final Operation deleteHttpsHealthCheck(HttpsHealthCheckName httpsHealthCh *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString());
+   *   String requestId = "";
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString(), requestId);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpsHealthCheck(String httpsHealthCheck) { + public final Operation deleteHttpsHealthCheck(String httpsHealthCheck, String requestId) { DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck) + .setRequestId(requestId) .build(); return deleteHttpsHealthCheck(request); } @@ -226,8 +241,10 @@ public final Operation deleteHttpsHealthCheck(String httpsHealthCheck) { *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = httpsHealthCheckClient.deleteHttpsHealthCheckCallable().futureCall(request);
    *   // Do something
@@ -365,21 +384,28 @@ public final UnaryCallable get
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpsHealthCheck(ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation insertHttpsHealthCheck(String requestId, ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertHttpsHealthCheck(ProjectName project, HttpsHealthCh * Sample code: *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project.toString(), httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project.toString(), httpsHealthCheckResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpsHealthCheck(String project, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation insertHttpsHealthCheck(String requestId, String project, HttpsHealthCheck httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertHttpsHealthCheck(String project, HttpsHealthCheck h * Sample code: *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
@@ -598,27 +635,34 @@ public final UnaryCallable
    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
    * }
    * 
* - * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation patchHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return patchHttpsHealthCheck(request); @@ -626,27 +670,34 @@ public final Operation patchHttpsHealthCheck(HttpsHealthCheckName httpsHealthChe // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * Updates a HttpsHealthCheck 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: *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
    * }
    * 
* - * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpsHealthCheck(String httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation patchHttpsHealthCheck(String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck) + .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return patchHttpsHealthCheck(request); @@ -654,15 +705,17 @@ public final Operation patchHttpsHealthCheck(String httpsHealthCheck, HttpsHealt // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics. + * Updates a HttpsHealthCheck 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: *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(request);
@@ -679,15 +732,17 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.
+   * Updates a HttpsHealthCheck 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:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   ApiFuture<Operation> future = httpsHealthCheckClient.patchHttpsHealthCheckCallable().futureCall(request);
@@ -709,21 +764,28 @@ public final UnaryCallable patchHtt
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation updateHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return updateHttpsHealthCheck(request); @@ -737,21 +799,28 @@ public final Operation updateHttpsHealthCheck(HttpsHealthCheckName httpsHealthCh *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpsHealthCheck(String httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation updateHttpsHealthCheck(String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck) + .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return updateHttpsHealthCheck(request); @@ -765,9 +834,11 @@ public final Operation updateHttpsHealthCheck(String httpsHealthCheck, HttpsHeal *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(request);
@@ -790,9 +861,11 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
+   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   ApiFuture<Operation> future = httpsHealthCheckClient.updateHttpsHealthCheckCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java
index 097c98e99d7a..d1b0769d9451 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java
@@ -37,6 +37,7 @@ public final class HttpsHealthCheckList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private HttpsHealthCheckList() {
     this.id = null;
@@ -44,6 +45,7 @@ private HttpsHealthCheckList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private HttpsHealthCheckList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(HttpsHealthCheckList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(HttpsHealthCheckList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public HttpsHealthCheckList build() {
 
 
 
 
+
       return new HttpsHealthCheckList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java
index ba63a73b57e6..da2e4e96d0ae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class HttpsHealthCheckName implements ResourceName {
+public final class HttpsHealthCheckName implements com.google.api.resourcenames.ResourceName {
   private final String httpsHealthCheck;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java
index 43f7e0f17898..ac18a40526ee 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java
@@ -42,6 +42,8 @@ public final class Image implements ApiMessage {
   private final String id;
   private final CustomerEncryptionKey imageEncryptionKey;
   private final String kind;
+  private final String labelFingerprint;
+  private final Map labels;
   private final List licenses;
   private final String name;
   private final RawDisk rawDisk;
@@ -49,6 +51,12 @@ public final class Image implements ApiMessage {
   private final String sourceDisk;
   private final CustomerEncryptionKey sourceDiskEncryptionKey;
   private final String sourceDiskId;
+  private final String sourceImage;
+  private final CustomerEncryptionKey sourceImageEncryptionKey;
+  private final String sourceImageId;
+  private final String sourceSnapshot;
+  private final CustomerEncryptionKey sourceSnapshotEncryptionKey;
+  private final String sourceSnapshotId;
   private final String sourceType;
   private final String status;
 
@@ -63,6 +71,8 @@ private Image() {
     this.id = null;
     this.imageEncryptionKey = null;
     this.kind = null;
+    this.labelFingerprint = null;
+    this.labels = null;
     this.licenses = null;
     this.name = null;
     this.rawDisk = null;
@@ -70,6 +80,12 @@ private Image() {
     this.sourceDisk = null;
     this.sourceDiskEncryptionKey = null;
     this.sourceDiskId = null;
+    this.sourceImage = null;
+    this.sourceImageEncryptionKey = null;
+    this.sourceImageId = null;
+    this.sourceSnapshot = null;
+    this.sourceSnapshotEncryptionKey = null;
+    this.sourceSnapshotId = null;
     this.sourceType = null;
     this.status = null;
   }
@@ -86,6 +102,8 @@ private Image(
       String id,
       CustomerEncryptionKey imageEncryptionKey,
       String kind,
+      String labelFingerprint,
+      Map labels,
       List licenses,
       String name,
       RawDisk rawDisk,
@@ -93,6 +111,12 @@ private Image(
       String sourceDisk,
       CustomerEncryptionKey sourceDiskEncryptionKey,
       String sourceDiskId,
+      String sourceImage,
+      CustomerEncryptionKey sourceImageEncryptionKey,
+      String sourceImageId,
+      String sourceSnapshot,
+      CustomerEncryptionKey sourceSnapshotEncryptionKey,
+      String sourceSnapshotId,
       String sourceType,
       String status
       ) {
@@ -106,6 +130,8 @@ private Image(
     this.id = id;
     this.imageEncryptionKey = imageEncryptionKey;
     this.kind = kind;
+    this.labelFingerprint = labelFingerprint;
+    this.labels = labels;
     this.licenses = licenses;
     this.name = name;
     this.rawDisk = rawDisk;
@@ -113,6 +139,12 @@ private Image(
     this.sourceDisk = sourceDisk;
     this.sourceDiskEncryptionKey = sourceDiskEncryptionKey;
     this.sourceDiskId = sourceDiskId;
+    this.sourceImage = sourceImage;
+    this.sourceImageEncryptionKey = sourceImageEncryptionKey;
+    this.sourceImageId = sourceImageId;
+    this.sourceSnapshot = sourceSnapshot;
+    this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey;
+    this.sourceSnapshotId = sourceSnapshotId;
     this.sourceType = sourceType;
     this.status = status;
   }
@@ -154,6 +186,12 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("kind") && kind != null) {
       fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
     }
+    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
+      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
+    }
+    if (fieldNames.contains("labels") && labels != null) {
+      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
+    }
     if (fieldNames.contains("licenses") && licenses != null) {
       ImmutableList.Builder stringList = ImmutableList.builder();
       for (String item : licenses) {
@@ -179,6 +217,24 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) {
       fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId)));
     }
+    if (fieldNames.contains("sourceImage") && sourceImage != null) {
+      fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage)));
+    }
+    if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) {
+      fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey)));
+    }
+    if (fieldNames.contains("sourceImageId") && sourceImageId != null) {
+      fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId)));
+    }
+    if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) {
+      fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot)));
+    }
+    if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) {
+      fieldMap.put("sourceSnapshotEncryptionKey", Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey)));
+    }
+    if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) {
+      fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId)));
+    }
     if (fieldNames.contains("sourceType") && sourceType != null) {
       fieldMap.put("sourceType", Collections.singletonList(String.valueOf(sourceType)));
     }
@@ -220,6 +276,12 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("kind")) {
       return String.valueOf(kind);
     }
+    if (fieldName.equals("labelFingerprint")) {
+      return String.valueOf(labelFingerprint);
+    }
+    if (fieldName.equals("labels")) {
+      return String.valueOf(labels);
+    }
     if (fieldName.equals("licenses")) {
       return String.valueOf(licenses);
     }
@@ -241,6 +303,24 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("sourceDiskId")) {
       return String.valueOf(sourceDiskId);
     }
+    if (fieldName.equals("sourceImage")) {
+      return String.valueOf(sourceImage);
+    }
+    if (fieldName.equals("sourceImageEncryptionKey")) {
+      return String.valueOf(sourceImageEncryptionKey);
+    }
+    if (fieldName.equals("sourceImageId")) {
+      return String.valueOf(sourceImageId);
+    }
+    if (fieldName.equals("sourceSnapshot")) {
+      return String.valueOf(sourceSnapshot);
+    }
+    if (fieldName.equals("sourceSnapshotEncryptionKey")) {
+      return String.valueOf(sourceSnapshotEncryptionKey);
+    }
+    if (fieldName.equals("sourceSnapshotId")) {
+      return String.valueOf(sourceSnapshotId);
+    }
     if (fieldName.equals("sourceType")) {
       return String.valueOf(sourceType);
     }
@@ -296,6 +376,14 @@ public String getKind() {
     return kind;
   }
 
+  public String getLabelFingerprint() {
+    return labelFingerprint;
+  }
+
+  public Map getLabelsMap() {
+    return labels;
+  }
+
   public List getLicensesList() {
     return licenses;
   }
@@ -324,6 +412,30 @@ public String getSourceDiskId() {
     return sourceDiskId;
   }
 
+  public String getSourceImage() {
+    return sourceImage;
+  }
+
+  public CustomerEncryptionKey getSourceImageEncryptionKey() {
+    return sourceImageEncryptionKey;
+  }
+
+  public String getSourceImageId() {
+    return sourceImageId;
+  }
+
+  public String getSourceSnapshot() {
+    return sourceSnapshot;
+  }
+
+  public CustomerEncryptionKey getSourceSnapshotEncryptionKey() {
+    return sourceSnapshotEncryptionKey;
+  }
+
+  public String getSourceSnapshotId() {
+    return sourceSnapshotId;
+  }
+
   public String getSourceType() {
     return sourceType;
   }
@@ -363,6 +475,8 @@ public static class Builder {
     private String id;
     private CustomerEncryptionKey imageEncryptionKey;
     private String kind;
+    private String labelFingerprint;
+    private Map labels;
     private List licenses;
     private String name;
     private RawDisk rawDisk;
@@ -370,6 +484,12 @@ public static class Builder {
     private String sourceDisk;
     private CustomerEncryptionKey sourceDiskEncryptionKey;
     private String sourceDiskId;
+    private String sourceImage;
+    private CustomerEncryptionKey sourceImageEncryptionKey;
+    private String sourceImageId;
+    private String sourceSnapshot;
+    private CustomerEncryptionKey sourceSnapshotEncryptionKey;
+    private String sourceSnapshotId;
     private String sourceType;
     private String status;
 
@@ -407,6 +527,12 @@ public Builder mergeFrom(Image other) {
       if (other.getKind() != null) {
         this.kind = other.kind;
       }
+      if (other.getLabelFingerprint() != null) {
+        this.labelFingerprint = other.labelFingerprint;
+      }
+      if (other.getLabelsMap() != null) {
+        this.labels = other.labels;
+      }
       if (other.getLicensesList() != null) {
         this.licenses = other.licenses;
       }
@@ -428,6 +554,24 @@ public Builder mergeFrom(Image other) {
       if (other.getSourceDiskId() != null) {
         this.sourceDiskId = other.sourceDiskId;
       }
+      if (other.getSourceImage() != null) {
+        this.sourceImage = other.sourceImage;
+      }
+      if (other.getSourceImageEncryptionKey() != null) {
+        this.sourceImageEncryptionKey = other.sourceImageEncryptionKey;
+      }
+      if (other.getSourceImageId() != null) {
+        this.sourceImageId = other.sourceImageId;
+      }
+      if (other.getSourceSnapshot() != null) {
+        this.sourceSnapshot = other.sourceSnapshot;
+      }
+      if (other.getSourceSnapshotEncryptionKey() != null) {
+        this.sourceSnapshotEncryptionKey = other.sourceSnapshotEncryptionKey;
+      }
+      if (other.getSourceSnapshotId() != null) {
+        this.sourceSnapshotId = other.sourceSnapshotId;
+      }
       if (other.getSourceType() != null) {
         this.sourceType = other.sourceType;
       }
@@ -448,6 +592,8 @@ public Builder mergeFrom(Image other) {
       this.id = source.id;
       this.imageEncryptionKey = source.imageEncryptionKey;
       this.kind = source.kind;
+      this.labelFingerprint = source.labelFingerprint;
+      this.labels = source.labels;
       this.licenses = source.licenses;
       this.name = source.name;
       this.rawDisk = source.rawDisk;
@@ -455,6 +601,12 @@ public Builder mergeFrom(Image other) {
       this.sourceDisk = source.sourceDisk;
       this.sourceDiskEncryptionKey = source.sourceDiskEncryptionKey;
       this.sourceDiskId = source.sourceDiskId;
+      this.sourceImage = source.sourceImage;
+      this.sourceImageEncryptionKey = source.sourceImageEncryptionKey;
+      this.sourceImageId = source.sourceImageId;
+      this.sourceSnapshot = source.sourceSnapshot;
+      this.sourceSnapshotEncryptionKey = source.sourceSnapshotEncryptionKey;
+      this.sourceSnapshotId = source.sourceSnapshotId;
       this.sourceType = source.sourceType;
       this.status = source.status;
     }
@@ -557,6 +709,24 @@ public Builder setKind(String kind) {
       return this;
     }
 
+    public String getLabelFingerprint() {
+      return labelFingerprint;
+    }
+
+    public Builder setLabelFingerprint(String labelFingerprint) {
+      this.labelFingerprint = labelFingerprint;
+      return this;
+    }
+
+    public Map getLabelsMap() {
+      return labels;
+    }
+
+    public Builder putAllLabels(Map labels) {
+      this.labels = labels;
+      return this;
+    }
+
     public List getLicensesList() {
       return licenses;
     }
@@ -628,6 +798,60 @@ public Builder setSourceDiskId(String sourceDiskId) {
       return this;
     }
 
+    public String getSourceImage() {
+      return sourceImage;
+    }
+
+    public Builder setSourceImage(String sourceImage) {
+      this.sourceImage = sourceImage;
+      return this;
+    }
+
+    public CustomerEncryptionKey getSourceImageEncryptionKey() {
+      return sourceImageEncryptionKey;
+    }
+
+    public Builder setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncryptionKey) {
+      this.sourceImageEncryptionKey = sourceImageEncryptionKey;
+      return this;
+    }
+
+    public String getSourceImageId() {
+      return sourceImageId;
+    }
+
+    public Builder setSourceImageId(String sourceImageId) {
+      this.sourceImageId = sourceImageId;
+      return this;
+    }
+
+    public String getSourceSnapshot() {
+      return sourceSnapshot;
+    }
+
+    public Builder setSourceSnapshot(String sourceSnapshot) {
+      this.sourceSnapshot = sourceSnapshot;
+      return this;
+    }
+
+    public CustomerEncryptionKey getSourceSnapshotEncryptionKey() {
+      return sourceSnapshotEncryptionKey;
+    }
+
+    public Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey) {
+      this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey;
+      return this;
+    }
+
+    public String getSourceSnapshotId() {
+      return sourceSnapshotId;
+    }
+
+    public Builder setSourceSnapshotId(String sourceSnapshotId) {
+      this.sourceSnapshotId = sourceSnapshotId;
+      return this;
+    }
+
     public String getSourceType() {
       return sourceType;
     }
@@ -660,6 +884,14 @@ public Image build() {
 
 
 
+
+
+
+
+
+
+
+
 
 
 
@@ -677,6 +909,8 @@ public Image build() {
         id,
         imageEncryptionKey,
         kind,
+        labelFingerprint,
+        labels,
         licenses,
         name,
         rawDisk,
@@ -684,6 +918,12 @@ public Image build() {
         sourceDisk,
         sourceDiskEncryptionKey,
         sourceDiskId,
+        sourceImage,
+        sourceImageEncryptionKey,
+        sourceImageId,
+        sourceSnapshot,
+        sourceSnapshotEncryptionKey,
+        sourceSnapshotId,
         sourceType,
         status
       );
@@ -701,6 +941,8 @@ public Builder clone() {
       newBuilder.setId(this.id);
       newBuilder.setImageEncryptionKey(this.imageEncryptionKey);
       newBuilder.setKind(this.kind);
+      newBuilder.setLabelFingerprint(this.labelFingerprint);
+      newBuilder.putAllLabels(this.labels);
       newBuilder.addAllLicenses(this.licenses);
       newBuilder.setName(this.name);
       newBuilder.setRawDisk(this.rawDisk);
@@ -708,6 +950,12 @@ public Builder clone() {
       newBuilder.setSourceDisk(this.sourceDisk);
       newBuilder.setSourceDiskEncryptionKey(this.sourceDiskEncryptionKey);
       newBuilder.setSourceDiskId(this.sourceDiskId);
+      newBuilder.setSourceImage(this.sourceImage);
+      newBuilder.setSourceImageEncryptionKey(this.sourceImageEncryptionKey);
+      newBuilder.setSourceImageId(this.sourceImageId);
+      newBuilder.setSourceSnapshot(this.sourceSnapshot);
+      newBuilder.setSourceSnapshotEncryptionKey(this.sourceSnapshotEncryptionKey);
+      newBuilder.setSourceSnapshotId(this.sourceSnapshotId);
       newBuilder.setSourceType(this.sourceType);
       newBuilder.setStatus(this.status);
       return newBuilder;
@@ -727,6 +975,8 @@ public String toString() {
         + "id=" + id + ", "
         + "imageEncryptionKey=" + imageEncryptionKey + ", "
         + "kind=" + kind + ", "
+        + "labelFingerprint=" + labelFingerprint + ", "
+        + "labels=" + labels + ", "
         + "licenses=" + licenses + ", "
         + "name=" + name + ", "
         + "rawDisk=" + rawDisk + ", "
@@ -734,6 +984,12 @@ public String toString() {
         + "sourceDisk=" + sourceDisk + ", "
         + "sourceDiskEncryptionKey=" + sourceDiskEncryptionKey + ", "
         + "sourceDiskId=" + sourceDiskId + ", "
+        + "sourceImage=" + sourceImage + ", "
+        + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + ", "
+        + "sourceImageId=" + sourceImageId + ", "
+        + "sourceSnapshot=" + sourceSnapshot + ", "
+        + "sourceSnapshotEncryptionKey=" + sourceSnapshotEncryptionKey + ", "
+        + "sourceSnapshotId=" + sourceSnapshotId + ", "
         + "sourceType=" + sourceType + ", "
         + "status=" + status
         + "}";
@@ -757,6 +1013,8 @@ public boolean equals(Object o) {
           Objects.equals(this.id, that.getId()) &&
           Objects.equals(this.imageEncryptionKey, that.getImageEncryptionKey()) &&
           Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) &&
+          Objects.equals(this.labels, that.getLabelsMap()) &&
           Objects.equals(this.licenses, that.getLicensesList()) &&
           Objects.equals(this.name, that.getName()) &&
           Objects.equals(this.rawDisk, that.getRawDisk()) &&
@@ -764,6 +1022,12 @@ public boolean equals(Object o) {
           Objects.equals(this.sourceDisk, that.getSourceDisk()) &&
           Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) &&
           Objects.equals(this.sourceDiskId, that.getSourceDiskId()) &&
+          Objects.equals(this.sourceImage, that.getSourceImage()) &&
+          Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) &&
+          Objects.equals(this.sourceImageId, that.getSourceImageId()) &&
+          Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) &&
+          Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) &&
+          Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) &&
           Objects.equals(this.sourceType, that.getSourceType()) &&
           Objects.equals(this.status, that.getStatus())
           ;
@@ -784,6 +1048,8 @@ public int hashCode() {
       id,
       imageEncryptionKey,
       kind,
+      labelFingerprint,
+      labels,
       licenses,
       name,
       rawDisk,
@@ -791,6 +1057,12 @@ public int hashCode() {
       sourceDisk,
       sourceDiskEncryptionKey,
       sourceDiskId,
+      sourceImage,
+      sourceImageEncryptionKey,
+      sourceImageId,
+      sourceSnapshot,
+      sourceSnapshotEncryptionKey,
+      sourceSnapshotId,
       sourceType,
       status
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
index 905edcde3150..2f45a38c4b69 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
@@ -53,7 +53,8 @@
  * 
  * try (ImageClient imageClient = ImageClient.create()) {
  *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
- *   Operation response = imageClient.deleteImage(image);
+ *   String requestId = "";
+ *   Operation response = imageClient.deleteImage(image, requestId);
  * }
  * 
  * 
@@ -176,19 +177,26 @@ public ImageStub getStub() { *

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
-   *   Operation response = imageClient.deleteImage(image);
+   *   String requestId = "";
+   *   Operation response = imageClient.deleteImage(image, requestId);
    * }
    * 
* * @param image Name of the image resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteImage(ImageName image) { + public final Operation deleteImage(ImageName image, String requestId) { DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder() .setImage(image == null ? null : image.toString()) + .setRequestId(requestId) .build(); return deleteImage(request); } @@ -201,19 +209,26 @@ public final Operation deleteImage(ImageName image) { *

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
-   *   Operation response = imageClient.deleteImage(image.toString());
+   *   String requestId = "";
+   *   Operation response = imageClient.deleteImage(image.toString(), requestId);
    * }
    * 
* * @param image Name of the image resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteImage(String image) { + public final Operation deleteImage(String image, String requestId) { DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder() .setImage(image) + .setRequestId(requestId) .build(); return deleteImage(request); } @@ -226,8 +241,10 @@ public final Operation deleteImage(String image) { *

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = imageClient.deleteImage(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteImage(DeleteImageHttpRequest request) {
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = imageClient.deleteImageCallable().futureCall(request);
    *   // Do something
@@ -273,21 +292,28 @@ public final UnaryCallable deleteImageCallabl
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
-   *   Operation response = imageClient.deprecateImage(image, deprecationStatusResource);
+   *   Operation response = imageClient.deprecateImage(image, requestId, deprecationStatusResource);
    * }
    * 
* * @param image Image name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param deprecationStatusResource Deprecation status for a public resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deprecateImage(ImageName image, DeprecationStatus deprecationStatusResource) { + public final Operation deprecateImage(ImageName image, String requestId, DeprecationStatus deprecationStatusResource) { DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder() .setImage(image == null ? null : image.toString()) + .setRequestId(requestId) .setDeprecationStatusResource(deprecationStatusResource) .build(); return deprecateImage(request); @@ -303,21 +329,28 @@ public final Operation deprecateImage(ImageName image, DeprecationStatus depreca *

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
-   *   Operation response = imageClient.deprecateImage(image.toString(), deprecationStatusResource);
+   *   Operation response = imageClient.deprecateImage(image.toString(), requestId, deprecationStatusResource);
    * }
    * 
* * @param image Image name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param deprecationStatusResource Deprecation status for a public resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deprecateImage(String image, DeprecationStatus deprecationStatusResource) { + public final Operation deprecateImage(String image, String requestId, DeprecationStatus deprecationStatusResource) { DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder() .setImage(image) + .setRequestId(requestId) .setDeprecationStatusResource(deprecationStatusResource) .build(); return deprecateImage(request); @@ -333,9 +366,11 @@ public final Operation deprecateImage(String image, DeprecationStatus deprecatio *

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
+   *     .setRequestId(requestId)
    *     .setDeprecationStatusResource(deprecationStatusResource)
    *     .build();
    *   Operation response = imageClient.deprecateImage(request);
@@ -360,9 +395,11 @@ public final Operation deprecateImage(DeprecateImageHttpRequest request) {
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
+   *     .setRequestId(requestId)
    *     .setDeprecationStatusResource(deprecationStatusResource)
    *     .build();
    *   ApiFuture<Operation> future = imageClient.deprecateImageCallable().futureCall(request);
@@ -573,21 +610,31 @@ public final UnaryCallable getFromFamilyIm
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
+   *   Boolean forceCreate = false;
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
-   *   Operation response = imageClient.insertImage(project, imageResource);
+   *   Operation response = imageClient.insertImage(forceCreate, requestId, project, imageResource);
    * }
    * 
* + * @param forceCreate Force image creation if true. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param imageResource An Image resource. + * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertImage(ProjectName project, Image imageResource) { + public final Operation insertImage(Boolean forceCreate, String requestId, ProjectName project, Image imageResource) { InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder() + .setForceCreate(forceCreate) + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setImageResource(imageResource) .build(); @@ -601,21 +648,31 @@ public final Operation insertImage(ProjectName project, Image imageResource) { * Sample code: *

    * try (ImageClient imageClient = ImageClient.create()) {
+   *   Boolean forceCreate = false;
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
-   *   Operation response = imageClient.insertImage(project.toString(), imageResource);
+   *   Operation response = imageClient.insertImage(forceCreate, requestId, project.toString(), imageResource);
    * }
    * 
* + * @param forceCreate Force image creation if true. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param imageResource An Image resource. + * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertImage(String project, Image imageResource) { + public final Operation insertImage(Boolean forceCreate, String requestId, String project, Image imageResource) { InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder() + .setForceCreate(forceCreate) + .setRequestId(requestId) .setProject(project) .setImageResource(imageResource) .build(); @@ -629,9 +686,13 @@ public final Operation insertImage(String project, Image imageResource) { * Sample code: *

    * try (ImageClient imageClient = ImageClient.create()) {
+   *   Boolean forceCreate = false;
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
    *   InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder()
+   *     .setForceCreate(forceCreate)
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setImageResource(imageResource)
    *     .build();
@@ -654,9 +715,13 @@ public final Operation insertImage(InsertImageHttpRequest request) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
+   *   Boolean forceCreate = false;
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
    *   InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder()
+   *     .setForceCreate(forceCreate)
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setImageResource(imageResource)
    *     .build();
@@ -673,7 +738,7 @@ public final UnaryCallable insertImageCallabl
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of private images available to the specified project. Private 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.
+   * 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:
    * 

@@ -699,7 +764,7 @@ public final ListImagesPagedResponse listImages(ProjectName project) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of private images available to the specified project. Private 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.
+   * 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:
    * 

@@ -725,7 +790,7 @@ public final ListImagesPagedResponse listImages(String project) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of private images available to the specified project. Private 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.
+   * 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:
    * 

@@ -751,7 +816,7 @@ public final ListImagesPagedResponse listImages(ListImagesHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of private images available to the specified project. Private 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.
+   * 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:
    * 

@@ -775,7 +840,7 @@ public final UnaryCallable listI
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of private images available to the specified project. Private 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.
+   * 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:
    * 

@@ -804,6 +869,111 @@ public final UnaryCallable listImagesCallable(
     return stub.listImagesCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
+   *
+   * Sample code:
+   * 

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   Operation response = imageClient.setLabelsImage(resource, globalSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param globalSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsImage(ProjectImageName resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) { + + SetLabelsImageHttpRequest request = + SetLabelsImageHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource) + .build(); + return setLabelsImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   Operation response = imageClient.setLabelsImage(resource.toString(), globalSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param globalSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsImage(String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) { + + SetLabelsImageHttpRequest request = + SetLabelsImageHttpRequest.newBuilder() + .setResource(resource) + .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource) + .build(); + return setLabelsImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   SetLabelsImageHttpRequest request = SetLabelsImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+   *     .build();
+   *   Operation response = imageClient.setLabelsImage(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsImage(SetLabelsImageHttpRequest request) { + return setLabelsImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   SetLabelsImageHttpRequest request = SetLabelsImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = imageClient.setLabelsImageCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setLabelsImageCallable() { + return stub.setLabelsImageCallable(); + } + @Override public final void close() throws Exception { stub.close(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java index d6e37cffb923..ff414c3ef688 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java @@ -37,6 +37,7 @@ public final class ImageList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private ImageList() { this.id = null; @@ -44,6 +45,7 @@ private ImageList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private ImageList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(ImageList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(ImageList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public ImageList build() { + return new ImageList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java index 67e0002845c1..2a24f4c17246 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class ImageName implements ResourceName { +public final class ImageName implements com.google.api.resourcenames.ResourceName { private final String image; private final String project; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java index 7298cc7c51e9..c434e2bafc60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java @@ -127,6 +127,13 @@ public PagedCallSettings setLabelsImageSettings() { + return ((ImageStubSettings) getStubSettings()).setLabelsImageSettings(); + } + public static final ImageSettings create(ImageStubSettings stub) throws IOException { return new ImageSettings.Builder(stub.toBuilder()).build(); @@ -288,6 +295,13 @@ public PagedCallSettings.Builder setLabelsImageSettings() { + return getStubSettingsBuilder().setLabelsImageSettings(); + } + @Override public ImageSettings build() throws IOException { return new ImageSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java index be853c87c020..fdfd9ff1d223 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -37,6 +40,7 @@ public final class InsertAddressHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private InsertAddressHttpRequest() { @@ -48,9 +52,11 @@ private InsertAddressHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } + private InsertAddressHttpRequest( String access_token, Address addressResource, @@ -60,7 +66,9 @@ private InsertAddressHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp) { + String requestId, + String userIp + ) { this.access_token = access_token; this.addressResource = addressResource; this.callback = callback; @@ -69,6 +77,7 @@ private InsertAddressHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -99,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -131,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -175,28 +190,30 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(InsertAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static InsertAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final InsertAddressHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new InsertAddressHttpRequest(); } @@ -210,6 +227,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -240,6 +258,9 @@ public Builder mergeFrom(InsertAddressHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -255,6 +276,7 @@ public Builder mergeFrom(InsertAddressHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -330,6 +352,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -339,26 +370,36 @@ public Builder setUserIp(String userIp) { return this; } + public InsertAddressHttpRequest build() { String missing = ""; + + + + + + if (region == null) { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertAddressHttpRequest( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); } public Builder clone() { @@ -371,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -379,32 +421,16 @@ public Builder clone() { @Override public String toString() { return "InsertAddressHttpRequest{" - + "access_token=" - + access_token - + ", " - + "addressResource=" - + addressResource - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "key=" - + key - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "region=" - + region - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "addressResource=" + addressResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + "}"; } @@ -415,15 +441,18 @@ public boolean equals(Object o) { } if (o instanceof InsertAddressHttpRequest) { InsertAddressHttpRequest that = (InsertAddressHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.addressResource, that.getAddressResource()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.region, that.getRegion()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.addressResource, that.getAddressResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -431,14 +460,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java index 21a7e6bbeb2e..56d8d2285e85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertAutoscalerHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private final String zone; @@ -50,6 +51,7 @@ private InsertAutoscalerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; this.zone = null; } @@ -63,6 +65,7 @@ private InsertAutoscalerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp, String zone ) { @@ -73,6 +76,7 @@ private InsertAutoscalerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; this.zone = zone; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; private String zone; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertAutoscalerHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertAutoscalerHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; this.zone = source.zone; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -353,6 +381,7 @@ public InsertAutoscalerHttpRequest build() { + if (zone == null) { missing += " zone"; } @@ -367,6 +396,7 @@ public InsertAutoscalerHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + ", " + "zone=" + zone + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) ; @@ -434,6 +467,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java new file mode 100644 index 000000000000..6e790d55670e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertBackendBucketHttpRequest implements ApiMessage { + private final String access_token; + private final BackendBucket backendBucketResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private InsertBackendBucketHttpRequest() { + this.access_token = null; + this.backendBucketResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private InsertBackendBucketHttpRequest( + String access_token, + BackendBucket backendBucketResource, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.backendBucketResource = backendBucketResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { + fieldMap.put("backendBucketResource", Collections.singletonList(String.valueOf(backendBucketResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendBucketResource")) { + return String.valueOf(backendBucketResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendBucket getApiMessageRequestBody() { + return backendBucketResource; + } + + public String getAccessToken() { + return access_token; + } + + public BackendBucket getBackendBucketResource() { + return backendBucketResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertBackendBucketHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertBackendBucketHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertBackendBucketHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertBackendBucketHttpRequest(); + } + + public static class Builder { + private String access_token; + private BackendBucket backendBucketResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertBackendBucketHttpRequest other) { + if (other == InsertBackendBucketHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendBucketResource() != null) { + this.backendBucketResource = other.backendBucketResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertBackendBucketHttpRequest source) { + this.access_token = source.access_token; + this.backendBucketResource = source.backendBucketResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public BackendBucket getBackendBucketResource() { + return backendBucketResource; + } + + public Builder setBackendBucketResource(BackendBucket backendBucketResource) { + this.backendBucketResource = backendBucketResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertBackendBucketHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertBackendBucketHttpRequest( + access_token, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendBucketResource(this.backendBucketResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertBackendBucketHttpRequest{" + + "access_token=" + access_token + ", " + + "backendBucketResource=" + backendBucketResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertBackendBucketHttpRequest) { + InsertBackendBucketHttpRequest that = (InsertBackendBucketHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java index 975e0911b1f9..3688ba735208 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertBackendServiceHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertBackendServiceHttpRequest() { @@ -51,6 +52,7 @@ private InsertBackendServiceHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertBackendServiceHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertBackendServiceHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertBackendServiceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertBackendServiceHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertBackendServiceHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertBackendServiceHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java index fc1fde7e6e03..6d71e4c6928f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertDiskHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String sourceImage; private final String userIp; private final String zone; @@ -51,6 +52,7 @@ private InsertDiskHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.sourceImage = null; this.userIp = null; this.zone = null; @@ -65,6 +67,7 @@ private InsertDiskHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String sourceImage, String userIp, String zone @@ -76,6 +79,7 @@ private InsertDiskHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.sourceImage = sourceImage; this.userIp = userIp; this.zone = zone; @@ -105,6 +109,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("sourceImage") && sourceImage != null) { fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); } @@ -140,6 +147,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("sourceImage")) { return String.valueOf(sourceImage); } @@ -186,6 +196,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getSourceImage() { return sourceImage; } @@ -226,6 +240,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String sourceImage; private String userIp; private String zone; @@ -255,6 +270,9 @@ public Builder mergeFrom(InsertDiskHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getSourceImage() != null) { this.sourceImage = other.sourceImage; } @@ -275,6 +293,7 @@ public Builder mergeFrom(InsertDiskHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.sourceImage = source.sourceImage; this.userIp = source.userIp; this.zone = source.zone; @@ -343,6 +362,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getSourceImage() { return sourceImage; } @@ -382,6 +410,7 @@ public InsertDiskHttpRequest build() { + if (zone == null) { missing += " zone"; } @@ -396,6 +425,7 @@ public InsertDiskHttpRequest build() { key, prettyPrint, quotaUser, + requestId, sourceImage, userIp, zone @@ -411,6 +441,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setSourceImage(this.sourceImage); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); @@ -428,6 +459,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "sourceImage=" + sourceImage + ", " + "userIp=" + userIp + ", " + "zone=" + zone @@ -449,6 +481,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.sourceImage, that.getSourceImage()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) @@ -467,6 +500,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, sourceImage, userIp, zone diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java index a6f9227fa520..f5176afa87ae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertFirewallHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertFirewallHttpRequest() { @@ -51,6 +52,7 @@ private InsertFirewallHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertFirewallHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertFirewallHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertFirewallHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertFirewallHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertFirewallHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertFirewallHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java index 2c2fc7b57caa..f2b9614e5a0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertForwardingRuleHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private InsertForwardingRuleHttpRequest() { @@ -51,6 +52,7 @@ private InsertForwardingRuleHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertForwardingRuleHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertForwardingRuleHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertForwardingRuleHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertForwardingRuleHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertForwardingRuleHttpRequest build() { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertForwardingRuleHttpRequest build() { prettyPrint, quotaUser, region, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java index b2cb059d4d56..84f5a9675d18 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertGlobalAddressHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertGlobalAddressHttpRequest() { @@ -51,6 +52,7 @@ private InsertGlobalAddressHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertGlobalAddressHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertGlobalAddressHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertGlobalAddressHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertGlobalAddressHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertGlobalAddressHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertGlobalAddressHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java index c34b27fa121d..f573b501a552 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertGlobalForwardingRuleHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertGlobalForwardingRuleHttpRequest() { @@ -51,6 +52,7 @@ private InsertGlobalForwardingRuleHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertGlobalForwardingRuleHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertGlobalForwardingRuleHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertGlobalForwardingRuleHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertGlobalForwardingRuleHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertGlobalForwardingRuleHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertGlobalForwardingRuleHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java index 8ea349a18d1f..737d7b1bed13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertHealthCheckHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private InsertHealthCheckHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertHealthCheckHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertHealthCheckHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertHealthCheckHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertHealthCheckHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertHealthCheckHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java index 4aee7ae74179..0837aca326b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertHttpHealthCheckHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertHttpHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private InsertHttpHealthCheckHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertHttpHealthCheckHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertHttpHealthCheckHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertHttpHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertHttpHealthCheckHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertHttpHealthCheckHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertHttpHealthCheckHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java index e410dfc793cd..689b3442fa3f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertHttpsHealthCheckHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertHttpsHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private InsertHttpsHealthCheckHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertHttpsHealthCheckHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertHttpsHealthCheckHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertHttpsHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertHttpsHealthCheckHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertHttpsHealthCheckHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertHttpsHealthCheckHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java index d9e31ed0fea4..df46f604cd5d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java @@ -35,22 +35,26 @@ public final class InsertImageHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; + private final Boolean forceCreate; private final Image imageResource; private final String key; private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertImageHttpRequest() { this.access_token = null; this.callback = null; this.fields = null; + this.forceCreate = null; this.imageResource = null; this.key = null; this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -59,21 +63,25 @@ private InsertImageHttpRequest( String access_token, String callback, String fields, + Boolean forceCreate, Image imageResource, String key, String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; this.callback = callback; this.fields = fields; + this.forceCreate = forceCreate; this.imageResource = imageResource; this.key = key; this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -89,6 +97,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } + if (fieldNames.contains("forceCreate") && forceCreate != null) { + fieldMap.put("forceCreate", Collections.singletonList(String.valueOf(forceCreate))); + } if (fieldNames.contains("imageResource") && imageResource != null) { fieldMap.put("imageResource", Collections.singletonList(String.valueOf(imageResource))); } @@ -104,6 +115,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -121,6 +135,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("fields")) { return String.valueOf(fields); } + if (fieldName.equals("forceCreate")) { + return String.valueOf(forceCreate); + } if (fieldName.equals("imageResource")) { return String.valueOf(imageResource); } @@ -136,6 +153,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -160,6 +180,10 @@ public String getFields() { return fields; } + public Boolean getForceCreate() { + return forceCreate; + } + public Image getImageResource() { return imageResource; } @@ -180,6 +204,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -208,11 +236,13 @@ public static class Builder { private String access_token; private String callback; private String fields; + private Boolean forceCreate; private Image imageResource; private String key; private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -228,6 +258,9 @@ public Builder mergeFrom(InsertImageHttpRequest other) { if (other.getFields() != null) { this.fields = other.fields; } + if (other.getForceCreate() != null) { + this.forceCreate = other.forceCreate; + } if (other.getImageResource() != null) { this.imageResource = other.imageResource; } @@ -243,6 +276,9 @@ public Builder mergeFrom(InsertImageHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -253,11 +289,13 @@ public Builder mergeFrom(InsertImageHttpRequest other) { this.access_token = source.access_token; this.callback = source.callback; this.fields = source.fields; + this.forceCreate = source.forceCreate; this.imageResource = source.imageResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -288,6 +326,15 @@ public Builder setFields(String fields) { return this; } + public Boolean getForceCreate() { + return forceCreate; + } + + public Builder setForceCreate(Boolean forceCreate) { + this.forceCreate = forceCreate; + return this; + } + public Image getImageResource() { return imageResource; } @@ -333,6 +380,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -351,11 +407,13 @@ public InsertImageHttpRequest build() { + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -363,11 +421,13 @@ public InsertImageHttpRequest build() { access_token, callback, fields, + forceCreate, imageResource, key, prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -377,11 +437,13 @@ public Builder clone() { newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); + newBuilder.setForceCreate(this.forceCreate); newBuilder.setImageResource(this.imageResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -393,11 +455,13 @@ public String toString() { + "access_token=" + access_token + ", " + "callback=" + callback + ", " + "fields=" + fields + ", " + + "forceCreate=" + forceCreate + ", " + "imageResource=" + imageResource + ", " + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -413,11 +477,13 @@ public boolean equals(Object o) { Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) && Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.forceCreate, that.getForceCreate()) && Objects.equals(this.imageResource, that.getImageResource()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -430,11 +496,13 @@ public int hashCode() { access_token, callback, fields, + forceCreate, imageResource, key, prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java index 467b3cf98738..41eb5994c2f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertInstanceGroupHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private final String zone; @@ -50,6 +51,7 @@ private InsertInstanceGroupHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; this.zone = null; } @@ -63,6 +65,7 @@ private InsertInstanceGroupHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp, String zone ) { @@ -73,6 +76,7 @@ private InsertInstanceGroupHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; this.zone = zone; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; private String zone; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertInstanceGroupHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertInstanceGroupHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; this.zone = source.zone; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -353,6 +381,7 @@ public InsertInstanceGroupHttpRequest build() { + if (zone == null) { missing += " zone"; } @@ -367,6 +396,7 @@ public InsertInstanceGroupHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + ", " + "zone=" + zone + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) ; @@ -434,6 +467,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java index 5ca99d620344..de032f11e807 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,6 +39,7 @@ public final class InsertInstanceGroupManagerHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private final String zone; @@ -47,10 +51,12 @@ private InsertInstanceGroupManagerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; this.zone = null; } + private InsertInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -59,8 +65,10 @@ private InsertInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp, - String zone) { + String zone + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -68,6 +76,7 @@ private InsertInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; this.zone = zone; } @@ -84,11 +93,8 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("instanceGroupManagerResource") - && instanceGroupManagerResource != null) { - fieldMap.put( - "instanceGroupManagerResource", - Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + if (fieldNames.contains("instanceGroupManagerResource") && instanceGroupManagerResource != null) { + fieldMap.put("instanceGroupManagerResource", Collections.singletonList(String.valueOf(instanceGroupManagerResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -99,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -131,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -174,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -182,24 +198,22 @@ public String getZone() { return zone; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(InsertInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static InsertInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final InsertInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new InsertInstanceGroupManagerHttpRequest(); } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; private String zone; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertInstanceGroupManagerHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertInstanceGroupManagerHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; this.zone = source.zone; } @@ -292,8 +311,7 @@ public InstanceGroupManager getInstanceGroupManagerResource() { return instanceGroupManagerResource; } - public Builder setInstanceGroupManagerResource( - InstanceGroupManager instanceGroupManagerResource) { + public Builder setInstanceGroupManagerResource(InstanceGroupManager instanceGroupManagerResource) { this.instanceGroupManagerResource = instanceGroupManagerResource; return this; } @@ -325,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -343,9 +370,18 @@ public Builder setZone(String zone) { return this; } + public InsertInstanceGroupManagerHttpRequest build() { String missing = ""; + + + + + + + + if (zone == null) { missing += " zone"; } @@ -353,15 +389,17 @@ public InsertInstanceGroupManagerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - userIp, - zone); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone + ); } public Builder clone() { @@ -373,6 +411,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -382,32 +421,16 @@ public Builder clone() { @Override public String toString() { return "InsertInstanceGroupManagerHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "instanceGroupManagerResource=" - + instanceGroupManagerResource - + ", " - + "key=" - + key - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp - + ", " - + "zone=" - + zone + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instanceGroupManagerResource=" + instanceGroupManagerResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + "}"; } @@ -418,16 +441,18 @@ public boolean equals(Object o) { } if (o instanceof InsertInstanceGroupManagerHttpRequest) { InsertInstanceGroupManagerHttpRequest that = (InsertInstanceGroupManagerHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals( - this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()) - && Objects.equals(this.zone, that.getZone()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; } return false; } @@ -435,14 +460,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - userIp, - zone); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java index 93fab884c5bb..ff25d86de933 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertInstanceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private final String zone; @@ -50,6 +51,7 @@ private InsertInstanceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; this.zone = null; } @@ -63,6 +65,7 @@ private InsertInstanceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp, String zone ) { @@ -73,6 +76,7 @@ private InsertInstanceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; this.zone = zone; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; private String zone; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertInstanceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertInstanceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; this.zone = source.zone; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -353,6 +381,7 @@ public InsertInstanceHttpRequest build() { + if (zone == null) { missing += " zone"; } @@ -367,6 +396,7 @@ public InsertInstanceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + ", " + "zone=" + zone + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) ; @@ -434,6 +467,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java index 32497a5b6ba2..849fe15275df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertInstanceTemplateHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertInstanceTemplateHttpRequest() { @@ -51,6 +52,7 @@ private InsertInstanceTemplateHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertInstanceTemplateHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertInstanceTemplateHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertInstanceTemplateHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertInstanceTemplateHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertInstanceTemplateHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertInstanceTemplateHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java new file mode 100644 index 000000000000..9636ed39c80e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertInterconnectAttachmentHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final InterconnectAttachment interconnectAttachmentResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String requestId; + private final String userIp; + + private InsertInterconnectAttachmentHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.interconnectAttachmentResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.requestId = null; + this.userIp = null; + } + + + private InsertInterconnectAttachmentHttpRequest( + String access_token, + String callback, + String fields, + InterconnectAttachment interconnectAttachmentResource, + String key, + String prettyPrint, + String quotaUser, + String region, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.interconnectAttachmentResource = interconnectAttachmentResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectAttachmentResource") && interconnectAttachmentResource != null) { + fieldMap.put("interconnectAttachmentResource", Collections.singletonList(String.valueOf(interconnectAttachmentResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("interconnectAttachmentResource")) { + return String.valueOf(interconnectAttachmentResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public InterconnectAttachment getApiMessageRequestBody() { + return interconnectAttachmentResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public InterconnectAttachment getInterconnectAttachmentResource() { + return interconnectAttachmentResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertInterconnectAttachmentHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertInterconnectAttachmentHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertInterconnectAttachmentHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertInterconnectAttachmentHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private InterconnectAttachment interconnectAttachmentResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertInterconnectAttachmentHttpRequest other) { + if (other == InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInterconnectAttachmentResource() != null) { + this.interconnectAttachmentResource = other.interconnectAttachmentResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertInterconnectAttachmentHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.interconnectAttachmentResource = source.interconnectAttachmentResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public InterconnectAttachment getInterconnectAttachmentResource() { + return interconnectAttachmentResource; + } + + public Builder setInterconnectAttachmentResource(InterconnectAttachment interconnectAttachmentResource) { + this.interconnectAttachmentResource = interconnectAttachmentResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertInterconnectAttachmentHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertInterconnectAttachmentHttpRequest( + access_token, + callback, + fields, + interconnectAttachmentResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInterconnectAttachmentResource(this.interconnectAttachmentResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertInterconnectAttachmentHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "interconnectAttachmentResource=" + interconnectAttachmentResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertInterconnectAttachmentHttpRequest) { + InsertInterconnectAttachmentHttpRequest that = (InsertInterconnectAttachmentHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.interconnectAttachmentResource, that.getInterconnectAttachmentResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + interconnectAttachmentResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java new file mode 100644 index 000000000000..33083f62f13c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertInterconnectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final Interconnect interconnectResource; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private InsertInterconnectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.interconnectResource = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private InsertInterconnectHttpRequest( + String access_token, + String callback, + String fields, + Interconnect interconnectResource, + String key, + String prettyPrint, + String project, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.interconnectResource = interconnectResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectResource") && interconnectResource != null) { + fieldMap.put("interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("interconnectResource")) { + return String.valueOf(interconnectResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Interconnect getApiMessageRequestBody() { + return interconnectResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public Interconnect getInterconnectResource() { + return interconnectResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertInterconnectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertInterconnectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertInterconnectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertInterconnectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private Interconnect interconnectResource; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertInterconnectHttpRequest other) { + if (other == InsertInterconnectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInterconnectResource() != null) { + this.interconnectResource = other.interconnectResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertInterconnectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.interconnectResource = source.interconnectResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public Interconnect getInterconnectResource() { + return interconnectResource; + } + + public Builder setInterconnectResource(Interconnect interconnectResource) { + this.interconnectResource = interconnectResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertInterconnectHttpRequest build() { + String missing = ""; + + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertInterconnectHttpRequest( + access_token, + callback, + fields, + interconnectResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInterconnectResource(this.interconnectResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertInterconnectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "interconnectResource=" + interconnectResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertInterconnectHttpRequest) { + InsertInterconnectHttpRequest that = (InsertInterconnectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.interconnectResource, that.getInterconnectResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + interconnectResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java index 79bcded2143d..921d6fe924b4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertNetworkHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private InsertNetworkHttpRequest() { @@ -51,6 +52,7 @@ private InsertNetworkHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertNetworkHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertNetworkHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertNetworkHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertNetworkHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertNetworkHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertNetworkHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java index e8b4b9eede93..19d9cb11d313 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertRegionAutoscalerHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private InsertRegionAutoscalerHttpRequest() { @@ -51,6 +52,7 @@ private InsertRegionAutoscalerHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertRegionAutoscalerHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertRegionAutoscalerHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertRegionAutoscalerHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertRegionAutoscalerHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertRegionAutoscalerHttpRequest build() { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertRegionAutoscalerHttpRequest build() { prettyPrint, quotaUser, region, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java index 8e0cbd488382..3810eeae9bae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertRegionBackendServiceHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private InsertRegionBackendServiceHttpRequest() { @@ -51,6 +52,7 @@ private InsertRegionBackendServiceHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertRegionBackendServiceHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertRegionBackendServiceHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertRegionBackendServiceHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertRegionBackendServiceHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertRegionBackendServiceHttpRequest build() { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertRegionBackendServiceHttpRequest build() { prettyPrint, quotaUser, region, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java new file mode 100644 index 000000000000..1107014d9769 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRegionCommitmentHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final Commitment commitmentResource; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String requestId; + private final String userIp; + + private InsertRegionCommitmentHttpRequest() { + this.access_token = null; + this.callback = null; + this.commitmentResource = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.requestId = null; + this.userIp = null; + } + + + private InsertRegionCommitmentHttpRequest( + String access_token, + String callback, + Commitment commitmentResource, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.commitmentResource = commitmentResource; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("commitmentResource") && commitmentResource != null) { + fieldMap.put("commitmentResource", Collections.singletonList(String.valueOf(commitmentResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("commitmentResource")) { + return String.valueOf(commitmentResource); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Commitment getApiMessageRequestBody() { + return commitmentResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public Commitment getCommitmentResource() { + return commitmentResource; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertRegionCommitmentHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRegionCommitmentHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertRegionCommitmentHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertRegionCommitmentHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private Commitment commitmentResource; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRegionCommitmentHttpRequest other) { + if (other == InsertRegionCommitmentHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getCommitmentResource() != null) { + this.commitmentResource = other.commitmentResource; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRegionCommitmentHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.commitmentResource = source.commitmentResource; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public Commitment getCommitmentResource() { + return commitmentResource; + } + + public Builder setCommitmentResource(Commitment commitmentResource) { + this.commitmentResource = commitmentResource; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertRegionCommitmentHttpRequest build() { + String missing = ""; + + + + + + + + if (region == null) { + missing += " region"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRegionCommitmentHttpRequest( + access_token, + callback, + commitmentResource, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setCommitmentResource(this.commitmentResource); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRegionCommitmentHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "commitmentResource=" + commitmentResource + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRegionCommitmentHttpRequest) { + InsertRegionCommitmentHttpRequest that = (InsertRegionCommitmentHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.commitmentResource, that.getCommitmentResource()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + commitmentResource, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java index fd357cdb00a9..33ac3d02d1ca 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java @@ -40,6 +40,7 @@ public final class InsertRegionInstanceGroupManagerHttpRequest implements ApiMes private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private InsertRegionInstanceGroupManagerHttpRequest() { @@ -51,6 +52,7 @@ private InsertRegionInstanceGroupManagerHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private InsertRegionInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private InsertRegionInstanceGroupManagerHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(InsertRegionInstanceGroupManagerHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(InsertRegionInstanceGroupManagerHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public InsertRegionInstanceGroupManagerHttpRequest build() { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public InsertRegionInstanceGroupManagerHttpRequest build() { prettyPrint, quotaUser, region, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java index 351fdccea01b..329fa3c40959 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertRouteHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final Route routeResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertRouteHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.routeResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertRouteHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, Route routeResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertRouteHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.routeResource = routeResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("routeResource") && routeResource != null) { fieldMap.put("routeResource", Collections.singletonList(String.valueOf(routeResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("routeResource")) { return String.valueOf(routeResource); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public Route getRouteResource() { return routeResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private Route routeResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertRouteHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getRouteResource() != null) { this.routeResource = other.routeResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertRouteHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.routeResource = source.routeResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public Route getRouteResource() { return routeResource; } @@ -356,6 +384,7 @@ public InsertRouteHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertRouteHttpRequest build() { prettyPrint, project, quotaUser, + requestId, routeResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setRouteResource(this.routeResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "routeResource=" + routeResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.routeResource, that.getRouteResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, routeResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java index a984541e5c36..278c16212e76 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertRouterHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final Router routerResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertRouterHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.routerResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertRouterHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, Router routerResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertRouterHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.routerResource = routerResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("routerResource") && routerResource != null) { fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("routerResource")) { return String.valueOf(routerResource); } @@ -176,6 +186,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public Router getRouterResource() { return routerResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private Router routerResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertRouterHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getRouterResource() != null) { this.routerResource = other.routerResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertRouterHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.routerResource = source.routerResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public Router getRouterResource() { return routerResource; } @@ -356,6 +384,7 @@ public InsertRouterHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertRouterHttpRequest build() { prettyPrint, quotaUser, region, + requestId, routerResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setRouterResource(this.routerResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "routerResource=" + routerResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.routerResource, that.getRouterResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, routerResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java index a2aab36670b1..58242f848c52 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertSslCertificateHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final SslCertificate sslCertificateResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertSslCertificateHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.sslCertificateResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertSslCertificateHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, SslCertificate sslCertificateResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertSslCertificateHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.sslCertificateResource = sslCertificateResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("sslCertificateResource") && sslCertificateResource != null) { fieldMap.put("sslCertificateResource", Collections.singletonList(String.valueOf(sslCertificateResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("sslCertificateResource")) { return String.valueOf(sslCertificateResource); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public SslCertificate getSslCertificateResource() { return sslCertificateResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private SslCertificate sslCertificateResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertSslCertificateHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getSslCertificateResource() != null) { this.sslCertificateResource = other.sslCertificateResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertSslCertificateHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.sslCertificateResource = source.sslCertificateResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public SslCertificate getSslCertificateResource() { return sslCertificateResource; } @@ -356,6 +384,7 @@ public InsertSslCertificateHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertSslCertificateHttpRequest build() { prettyPrint, project, quotaUser, + requestId, sslCertificateResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setSslCertificateResource(this.sslCertificateResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "sslCertificateResource=" + sslCertificateResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.sslCertificateResource, that.getSslCertificateResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, sslCertificateResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java index cc6b77ab3e9c..3f40e3f46e99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertSubnetworkHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final Subnetwork subnetworkResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertSubnetworkHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.subnetworkResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertSubnetworkHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, Subnetwork subnetworkResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertSubnetworkHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.subnetworkResource = subnetworkResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { fieldMap.put("subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("subnetworkResource")) { return String.valueOf(subnetworkResource); } @@ -176,6 +186,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public Subnetwork getSubnetworkResource() { return subnetworkResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private Subnetwork subnetworkResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertSubnetworkHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getSubnetworkResource() != null) { this.subnetworkResource = other.subnetworkResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertSubnetworkHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.subnetworkResource = source.subnetworkResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public Subnetwork getSubnetworkResource() { return subnetworkResource; } @@ -356,6 +384,7 @@ public InsertSubnetworkHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertSubnetworkHttpRequest build() { prettyPrint, quotaUser, region, + requestId, subnetworkResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setSubnetworkResource(this.subnetworkResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "subnetworkResource=" + subnetworkResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, subnetworkResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java index 93abca892c56..250d84a91ab2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertTargetHttpProxyHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final TargetHttpProxy targetHttpProxyResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertTargetHttpProxyHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.targetHttpProxyResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertTargetHttpProxyHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, TargetHttpProxy targetHttpProxyResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertTargetHttpProxyHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetHttpProxyResource = targetHttpProxyResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetHttpProxyResource") && targetHttpProxyResource != null) { fieldMap.put("targetHttpProxyResource", Collections.singletonList(String.valueOf(targetHttpProxyResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetHttpProxyResource")) { return String.valueOf(targetHttpProxyResource); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public TargetHttpProxy getTargetHttpProxyResource() { return targetHttpProxyResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private TargetHttpProxy targetHttpProxyResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertTargetHttpProxyHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetHttpProxyResource() != null) { this.targetHttpProxyResource = other.targetHttpProxyResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertTargetHttpProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetHttpProxyResource = source.targetHttpProxyResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public TargetHttpProxy getTargetHttpProxyResource() { return targetHttpProxyResource; } @@ -356,6 +384,7 @@ public InsertTargetHttpProxyHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertTargetHttpProxyHttpRequest build() { prettyPrint, project, quotaUser, + requestId, targetHttpProxyResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetHttpProxyResource(this.targetHttpProxyResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetHttpProxyResource=" + targetHttpProxyResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetHttpProxyResource, that.getTargetHttpProxyResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, targetHttpProxyResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java index eb4c7f932e39..5b6c5d2e9009 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertTargetHttpsProxyHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final TargetHttpsProxy targetHttpsProxyResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertTargetHttpsProxyHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.targetHttpsProxyResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertTargetHttpsProxyHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, TargetHttpsProxy targetHttpsProxyResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertTargetHttpsProxyHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetHttpsProxyResource = targetHttpsProxyResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetHttpsProxyResource") && targetHttpsProxyResource != null) { fieldMap.put("targetHttpsProxyResource", Collections.singletonList(String.valueOf(targetHttpsProxyResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetHttpsProxyResource")) { return String.valueOf(targetHttpsProxyResource); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public TargetHttpsProxy getTargetHttpsProxyResource() { return targetHttpsProxyResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private TargetHttpsProxy targetHttpsProxyResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertTargetHttpsProxyHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetHttpsProxyResource() != null) { this.targetHttpsProxyResource = other.targetHttpsProxyResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertTargetHttpsProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetHttpsProxyResource = source.targetHttpsProxyResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public TargetHttpsProxy getTargetHttpsProxyResource() { return targetHttpsProxyResource; } @@ -356,6 +384,7 @@ public InsertTargetHttpsProxyHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertTargetHttpsProxyHttpRequest build() { prettyPrint, project, quotaUser, + requestId, targetHttpsProxyResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetHttpsProxyResource(this.targetHttpsProxyResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetHttpsProxyResource=" + targetHttpsProxyResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetHttpsProxyResource, that.getTargetHttpsProxyResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, targetHttpsProxyResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java index 7089867013df..44c862b55350 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java @@ -38,6 +38,7 @@ public final class InsertTargetInstanceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final TargetInstance targetInstanceResource; private final String userIp; private final String zone; @@ -49,6 +50,7 @@ private InsertTargetInstanceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.targetInstanceResource = null; this.userIp = null; this.zone = null; @@ -62,6 +64,7 @@ private InsertTargetInstanceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, TargetInstance targetInstanceResource, String userIp, String zone @@ -72,6 +75,7 @@ private InsertTargetInstanceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetInstanceResource = targetInstanceResource; this.userIp = userIp; this.zone = zone; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetInstanceResource") && targetInstanceResource != null) { fieldMap.put("targetInstanceResource", Collections.singletonList(String.valueOf(targetInstanceResource))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetInstanceResource")) { return String.valueOf(targetInstanceResource); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public TargetInstance getTargetInstanceResource() { return targetInstanceResource; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private TargetInstance targetInstanceResource; private String userIp; private String zone; @@ -237,6 +252,9 @@ public Builder mergeFrom(InsertTargetInstanceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetInstanceResource() != null) { this.targetInstanceResource = other.targetInstanceResource; } @@ -256,6 +274,7 @@ public Builder mergeFrom(InsertTargetInstanceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetInstanceResource = source.targetInstanceResource; this.userIp = source.userIp; this.zone = source.zone; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public TargetInstance getTargetInstanceResource() { return targetInstanceResource; } @@ -353,6 +381,7 @@ public InsertTargetInstanceHttpRequest build() { + if (zone == null) { missing += " zone"; } @@ -366,6 +395,7 @@ public InsertTargetInstanceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, targetInstanceResource, userIp, zone @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetInstanceResource(this.targetInstanceResource); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetInstanceResource=" + targetInstanceResource + ", " + "userIp=" + userIp + ", " + "zone=" + zone @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetInstanceResource, that.getTargetInstanceResource()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, targetInstanceResource, userIp, zone diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java index 2c21b65b5caf..a1f40f273f35 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertTargetPoolHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final TargetPool targetPoolResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertTargetPoolHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.targetPoolResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertTargetPoolHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, TargetPool targetPoolResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertTargetPoolHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.targetPoolResource = targetPoolResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetPoolResource") && targetPoolResource != null) { fieldMap.put("targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetPoolResource")) { return String.valueOf(targetPoolResource); } @@ -176,6 +186,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public TargetPool getTargetPoolResource() { return targetPoolResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private TargetPool targetPoolResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertTargetPoolHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetPoolResource() != null) { this.targetPoolResource = other.targetPoolResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertTargetPoolHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.targetPoolResource = source.targetPoolResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public TargetPool getTargetPoolResource() { return targetPoolResource; } @@ -356,6 +384,7 @@ public InsertTargetPoolHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertTargetPoolHttpRequest build() { prettyPrint, quotaUser, region, + requestId, targetPoolResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetPoolResource(this.targetPoolResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "targetPoolResource=" + targetPoolResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetPoolResource, that.getTargetPoolResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, targetPoolResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java index d4f3e84b22f1..a6a4653c6477 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertTargetSslProxyHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final TargetSslProxy targetSslProxyResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertTargetSslProxyHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.targetSslProxyResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertTargetSslProxyHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, TargetSslProxy targetSslProxyResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertTargetSslProxyHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetSslProxyResource = targetSslProxyResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetSslProxyResource") && targetSslProxyResource != null) { fieldMap.put("targetSslProxyResource", Collections.singletonList(String.valueOf(targetSslProxyResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetSslProxyResource")) { return String.valueOf(targetSslProxyResource); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public TargetSslProxy getTargetSslProxyResource() { return targetSslProxyResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private TargetSslProxy targetSslProxyResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertTargetSslProxyHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetSslProxyResource() != null) { this.targetSslProxyResource = other.targetSslProxyResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertTargetSslProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetSslProxyResource = source.targetSslProxyResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public TargetSslProxy getTargetSslProxyResource() { return targetSslProxyResource; } @@ -356,6 +384,7 @@ public InsertTargetSslProxyHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertTargetSslProxyHttpRequest build() { prettyPrint, project, quotaUser, + requestId, targetSslProxyResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetSslProxyResource(this.targetSslProxyResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetSslProxyResource=" + targetSslProxyResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetSslProxyResource, that.getTargetSslProxyResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, targetSslProxyResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java new file mode 100644 index 000000000000..939e6fd0748b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertTargetTcpProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String requestId; + private final TargetTcpProxy targetTcpProxyResource; + private final String userIp; + + private InsertTargetTcpProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.requestId = null; + this.targetTcpProxyResource = null; + this.userIp = null; + } + + + private InsertTargetTcpProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String requestId, + TargetTcpProxy targetTcpProxyResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.targetTcpProxyResource = targetTcpProxyResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetTcpProxyResource") && targetTcpProxyResource != null) { + fieldMap.put("targetTcpProxyResource", Collections.singletonList(String.valueOf(targetTcpProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("targetTcpProxyResource")) { + return String.valueOf(targetTcpProxyResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TargetTcpProxy getApiMessageRequestBody() { + return targetTcpProxyResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public TargetTcpProxy getTargetTcpProxyResource() { + return targetTcpProxyResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InsertTargetTcpProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertTargetTcpProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InsertTargetTcpProxyHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InsertTargetTcpProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String requestId; + private TargetTcpProxy targetTcpProxyResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertTargetTcpProxyHttpRequest other) { + if (other == InsertTargetTcpProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getTargetTcpProxyResource() != null) { + this.targetTcpProxyResource = other.targetTcpProxyResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertTargetTcpProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.targetTcpProxyResource = source.targetTcpProxyResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public TargetTcpProxy getTargetTcpProxyResource() { + return targetTcpProxyResource; + } + + public Builder setTargetTcpProxyResource(TargetTcpProxy targetTcpProxyResource) { + this.targetTcpProxyResource = targetTcpProxyResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public InsertTargetTcpProxyHttpRequest build() { + String missing = ""; + + + + + + if (project == null) { + missing += " project"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertTargetTcpProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetTcpProxyResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setTargetTcpProxyResource(this.targetTcpProxyResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertTargetTcpProxyHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "targetTcpProxyResource=" + targetTcpProxyResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertTargetTcpProxyHttpRequest) { + InsertTargetTcpProxyHttpRequest that = (InsertTargetTcpProxyHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.targetTcpProxyResource, that.getTargetTcpProxyResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetTcpProxyResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java index 028eec74f110..f87b47926198 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java @@ -39,6 +39,7 @@ public final class InsertTargetVpnGatewayHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final TargetVpnGateway targetVpnGatewayResource; private final String userIp; @@ -50,6 +51,7 @@ private InsertTargetVpnGatewayHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.targetVpnGatewayResource = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InsertTargetVpnGatewayHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, TargetVpnGateway targetVpnGatewayResource, String userIp ) { @@ -73,6 +76,7 @@ private InsertTargetVpnGatewayHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.targetVpnGatewayResource = targetVpnGatewayResource; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetVpnGatewayResource") && targetVpnGatewayResource != null) { fieldMap.put("targetVpnGatewayResource", Collections.singletonList(String.valueOf(targetVpnGatewayResource))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetVpnGatewayResource")) { return String.valueOf(targetVpnGatewayResource); } @@ -176,6 +186,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public TargetVpnGateway getTargetVpnGatewayResource() { return targetVpnGatewayResource; } @@ -212,6 +226,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private TargetVpnGateway targetVpnGatewayResource; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InsertTargetVpnGatewayHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetVpnGatewayResource() != null) { this.targetVpnGatewayResource = other.targetVpnGatewayResource; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InsertTargetVpnGatewayHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.targetVpnGatewayResource = source.targetVpnGatewayResource; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public TargetVpnGateway getTargetVpnGatewayResource() { return targetVpnGatewayResource; } @@ -356,6 +384,7 @@ public InsertTargetVpnGatewayHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -367,6 +396,7 @@ public InsertTargetVpnGatewayHttpRequest build() { prettyPrint, quotaUser, region, + requestId, targetVpnGatewayResource, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetVpnGatewayResource(this.targetVpnGatewayResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "targetVpnGatewayResource=" + targetVpnGatewayResource + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetVpnGatewayResource, that.getTargetVpnGatewayResource()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, targetVpnGatewayResource, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java index 4f21eb5e4bf6..2b24f4e1311d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,6 +39,7 @@ public final class InsertUrlMapHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final UrlMap urlMapResource; private final String userIp; @@ -47,10 +51,12 @@ private InsertUrlMapHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.urlMapResource = null; this.userIp = null; } + private InsertUrlMapHttpRequest( String access_token, String callback, @@ -59,8 +65,10 @@ private InsertUrlMapHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, UrlMap urlMapResource, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -68,6 +76,7 @@ private InsertUrlMapHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.urlMapResource = urlMapResource; this.userIp = userIp; } @@ -96,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("urlMapResource") && urlMapResource != null) { fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); } @@ -128,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("urlMapResource")) { return String.valueOf(urlMapResource); } @@ -171,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public UrlMap getUrlMapResource() { return urlMapResource; } @@ -179,24 +198,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(InsertUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static InsertUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final InsertUrlMapHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new InsertUrlMapHttpRequest(); } @@ -209,6 +226,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private UrlMap urlMapResource; private String userIp; @@ -237,6 +255,9 @@ public Builder mergeFrom(InsertUrlMapHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUrlMapResource() != null) { this.urlMapResource = other.urlMapResource; } @@ -254,6 +275,7 @@ public Builder mergeFrom(InsertUrlMapHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.urlMapResource = source.urlMapResource; this.userIp = source.userIp; } @@ -321,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public UrlMap getUrlMapResource() { return urlMapResource; } @@ -339,26 +370,36 @@ public Builder setUserIp(String userIp) { return this; } + public InsertUrlMapHttpRequest build() { String missing = ""; + + + + if (project == null) { missing += " project"; } + + + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - urlMapResource, - userIp); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + urlMapResource, + userIp + ); } public Builder clone() { @@ -370,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUrlMapResource(this.urlMapResource); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -379,32 +421,16 @@ public Builder clone() { @Override public String toString() { return "InsertUrlMapHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "key=" - + key - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "urlMapResource=" - + urlMapResource - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "urlMapResource=" + urlMapResource + ", " + + "userIp=" + userIp + "}"; } @@ -415,15 +441,18 @@ public boolean equals(Object o) { } if (o instanceof InsertUrlMapHttpRequest) { InsertUrlMapHttpRequest that = (InsertUrlMapHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.urlMapResource, that.getUrlMapResource()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.urlMapResource, that.getUrlMapResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -431,14 +460,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - urlMapResource, - userIp); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + urlMapResource, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java index 4d617c7b73f0..e01cf410bc14 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,6 +39,7 @@ public final class InsertVpnTunnelHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private final VpnTunnel vpnTunnelResource; @@ -47,10 +51,12 @@ private InsertVpnTunnelHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; this.vpnTunnelResource = null; } + private InsertVpnTunnelHttpRequest( String access_token, String callback, @@ -59,8 +65,10 @@ private InsertVpnTunnelHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, String userIp, - VpnTunnel vpnTunnelResource) { + VpnTunnel vpnTunnelResource + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -68,6 +76,7 @@ private InsertVpnTunnelHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; this.vpnTunnelResource = vpnTunnelResource; } @@ -96,12 +105,14 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) { - fieldMap.put( - "vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); + fieldMap.put("vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); } return fieldMap; } @@ -129,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -172,6 +186,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -180,24 +198,22 @@ public VpnTunnel getVpnTunnelResource() { return vpnTunnelResource; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(InsertVpnTunnelHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static InsertVpnTunnelHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final InsertVpnTunnelHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new InsertVpnTunnelHttpRequest(); } @@ -210,6 +226,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; private VpnTunnel vpnTunnelResource; @@ -238,6 +255,9 @@ public Builder mergeFrom(InsertVpnTunnelHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -255,6 +275,7 @@ public Builder mergeFrom(InsertVpnTunnelHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; this.vpnTunnelResource = source.vpnTunnelResource; } @@ -322,6 +343,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -340,26 +370,36 @@ public Builder setVpnTunnelResource(VpnTunnel vpnTunnelResource) { return this; } + public InsertVpnTunnelHttpRequest build() { String missing = ""; + + + + + if (region == null) { missing += " region"; } + + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertVpnTunnelHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp, - vpnTunnelResource); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp, + vpnTunnelResource + ); } public Builder clone() { @@ -371,6 +411,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setVpnTunnelResource(this.vpnTunnelResource); return newBuilder; @@ -380,32 +421,16 @@ public Builder clone() { @Override public String toString() { return "InsertVpnTunnelHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "key=" - + key - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "region=" - + region - + ", " - + "userIp=" - + userIp - + ", " - + "vpnTunnelResource=" - + vpnTunnelResource + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + ", " + + "vpnTunnelResource=" + vpnTunnelResource + "}"; } @@ -416,15 +441,18 @@ public boolean equals(Object o) { } if (o instanceof InsertVpnTunnelHttpRequest) { InsertVpnTunnelHttpRequest that = (InsertVpnTunnelHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.region, that.getRegion()) - && Objects.equals(this.userIp, that.getUserIp()) - && Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()) + ; } return false; } @@ -432,14 +460,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp, - vpnTunnelResource); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp, + vpnTunnelResource + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java index a5992878c05e..f6287c7d4f11 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java @@ -35,17 +35,23 @@ public final class Instance implements ApiMessage { private final Boolean canIpForward; private final String cpuPlatform; private final String creationTimestamp; + private final Boolean deletionProtection; private final String description; private final List disks; + private final List guestAccelerators; private final String id; private final String kind; + private final String labelFingerprint; + private final Map labels; private final String machineType; private final Metadata metadata; + private final String minCpuPlatform; private final String name; private final List networkInterfaces; private final Scheduling scheduling; private final String selfLink; private final List serviceAccounts; + private final Boolean startRestricted; private final String status; private final String statusMessage; private final Tags tags; @@ -55,17 +61,23 @@ private Instance() { this.canIpForward = null; this.cpuPlatform = null; this.creationTimestamp = null; + this.deletionProtection = null; this.description = null; this.disks = null; + this.guestAccelerators = null; this.id = null; this.kind = null; + this.labelFingerprint = null; + this.labels = null; this.machineType = null; this.metadata = null; + this.minCpuPlatform = null; this.name = null; this.networkInterfaces = null; this.scheduling = null; this.selfLink = null; this.serviceAccounts = null; + this.startRestricted = null; this.status = null; this.statusMessage = null; this.tags = null; @@ -77,17 +89,23 @@ private Instance( Boolean canIpForward, String cpuPlatform, String creationTimestamp, + Boolean deletionProtection, String description, List disks, + List guestAccelerators, String id, String kind, + String labelFingerprint, + Map labels, String machineType, Metadata metadata, + String minCpuPlatform, String name, List networkInterfaces, Scheduling scheduling, String selfLink, List serviceAccounts, + Boolean startRestricted, String status, String statusMessage, Tags tags, @@ -96,17 +114,23 @@ private Instance( this.canIpForward = canIpForward; this.cpuPlatform = cpuPlatform; this.creationTimestamp = creationTimestamp; + this.deletionProtection = deletionProtection; this.description = description; this.disks = disks; + this.guestAccelerators = guestAccelerators; this.id = id; this.kind = kind; + this.labelFingerprint = labelFingerprint; + this.labels = labels; this.machineType = machineType; this.metadata = metadata; + this.minCpuPlatform = minCpuPlatform; this.name = name; this.networkInterfaces = networkInterfaces; this.scheduling = scheduling; this.selfLink = selfLink; this.serviceAccounts = serviceAccounts; + this.startRestricted = startRestricted; this.status = status; this.statusMessage = statusMessage; this.tags = tags; @@ -125,6 +149,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } + if (fieldNames.contains("deletionProtection") && deletionProtection != null) { + fieldMap.put("deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); + } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } @@ -135,18 +162,34 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("disks", stringList.build()); } + if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorConfig item : guestAccelerators) { + stringList.add(item.toString()); + } + fieldMap.put("guestAccelerators", stringList.build()); + } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); } if (fieldNames.contains("kind") && kind != null) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } if (fieldNames.contains("machineType") && machineType != null) { fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); } if (fieldNames.contains("metadata") && metadata != null) { fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); } + if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { + fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); + } if (fieldNames.contains("name") && name != null) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } @@ -170,6 +213,9 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("serviceAccounts", stringList.build()); } + if (fieldNames.contains("startRestricted") && startRestricted != null) { + fieldMap.put("startRestricted", Collections.singletonList(String.valueOf(startRestricted))); + } if (fieldNames.contains("status") && status != null) { fieldMap.put("status", Collections.singletonList(String.valueOf(status))); } @@ -196,24 +242,39 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { return String.valueOf(creationTimestamp); } + if (fieldName.equals("deletionProtection")) { + return String.valueOf(deletionProtection); + } if (fieldName.equals("description")) { return String.valueOf(description); } if (fieldName.equals("disks")) { return String.valueOf(disks); } + if (fieldName.equals("guestAccelerators")) { + return String.valueOf(guestAccelerators); + } if (fieldName.equals("id")) { return String.valueOf(id); } if (fieldName.equals("kind")) { return String.valueOf(kind); } + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } if (fieldName.equals("machineType")) { return String.valueOf(machineType); } if (fieldName.equals("metadata")) { return String.valueOf(metadata); } + if (fieldName.equals("minCpuPlatform")) { + return String.valueOf(minCpuPlatform); + } if (fieldName.equals("name")) { return String.valueOf(name); } @@ -229,6 +290,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("serviceAccounts")) { return String.valueOf(serviceAccounts); } + if (fieldName.equals("startRestricted")) { + return String.valueOf(startRestricted); + } if (fieldName.equals("status")) { return String.valueOf(status); } @@ -262,6 +326,10 @@ public String getCreationTimestamp() { return creationTimestamp; } + public Boolean getDeletionProtection() { + return deletionProtection; + } + public String getDescription() { return description; } @@ -270,6 +338,10 @@ public List getDisksList() { return disks; } + public List getGuestAcceleratorsList() { + return guestAccelerators; + } + public String getId() { return id; } @@ -278,6 +350,14 @@ public String getKind() { return kind; } + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Map getLabelsMap() { + return labels; + } + public String getMachineType() { return machineType; } @@ -286,6 +366,10 @@ public Metadata getMetadata() { return metadata; } + public String getMinCpuPlatform() { + return minCpuPlatform; + } + public String getName() { return name; } @@ -306,6 +390,10 @@ public List getServiceAccountsList() { return serviceAccounts; } + public Boolean getStartRestricted() { + return startRestricted; + } + public String getStatus() { return status; } @@ -346,17 +434,23 @@ public static class Builder { private Boolean canIpForward; private String cpuPlatform; private String creationTimestamp; + private Boolean deletionProtection; private String description; private List disks; + private List guestAccelerators; private String id; private String kind; + private String labelFingerprint; + private Map labels; private String machineType; private Metadata metadata; + private String minCpuPlatform; private String name; private List networkInterfaces; private Scheduling scheduling; private String selfLink; private List serviceAccounts; + private Boolean startRestricted; private String status; private String statusMessage; private Tags tags; @@ -375,24 +469,39 @@ public Builder mergeFrom(Instance other) { if (other.getCreationTimestamp() != null) { this.creationTimestamp = other.creationTimestamp; } + if (other.getDeletionProtection() != null) { + this.deletionProtection = other.deletionProtection; + } if (other.getDescription() != null) { this.description = other.description; } if (other.getDisksList() != null) { this.disks = other.disks; } + if (other.getGuestAcceleratorsList() != null) { + this.guestAccelerators = other.guestAccelerators; + } if (other.getId() != null) { this.id = other.id; } if (other.getKind() != null) { this.kind = other.kind; } + if (other.getLabelFingerprint() != null) { + this.labelFingerprint = other.labelFingerprint; + } + if (other.getLabelsMap() != null) { + this.labels = other.labels; + } if (other.getMachineType() != null) { this.machineType = other.machineType; } if (other.getMetadata() != null) { this.metadata = other.metadata; } + if (other.getMinCpuPlatform() != null) { + this.minCpuPlatform = other.minCpuPlatform; + } if (other.getName() != null) { this.name = other.name; } @@ -408,6 +517,9 @@ public Builder mergeFrom(Instance other) { if (other.getServiceAccountsList() != null) { this.serviceAccounts = other.serviceAccounts; } + if (other.getStartRestricted() != null) { + this.startRestricted = other.startRestricted; + } if (other.getStatus() != null) { this.status = other.status; } @@ -427,17 +539,23 @@ public Builder mergeFrom(Instance other) { this.canIpForward = source.canIpForward; this.cpuPlatform = source.cpuPlatform; this.creationTimestamp = source.creationTimestamp; + this.deletionProtection = source.deletionProtection; this.description = source.description; this.disks = source.disks; + this.guestAccelerators = source.guestAccelerators; this.id = source.id; this.kind = source.kind; + this.labelFingerprint = source.labelFingerprint; + this.labels = source.labels; this.machineType = source.machineType; this.metadata = source.metadata; + this.minCpuPlatform = source.minCpuPlatform; this.name = source.name; this.networkInterfaces = source.networkInterfaces; this.scheduling = source.scheduling; this.selfLink = source.selfLink; this.serviceAccounts = source.serviceAccounts; + this.startRestricted = source.startRestricted; this.status = source.status; this.statusMessage = source.statusMessage; this.tags = source.tags; @@ -471,6 +589,15 @@ public Builder setCreationTimestamp(String creationTimestamp) { return this; } + public Boolean getDeletionProtection() { + return deletionProtection; + } + + public Builder setDeletionProtection(Boolean deletionProtection) { + this.deletionProtection = deletionProtection; + return this; + } + public String getDescription() { return description; } @@ -497,6 +624,23 @@ public Builder addDisks(AttachedDisk disks) { return this; } + public List getGuestAcceleratorsList() { + return guestAccelerators; + } + + public Builder addAllGuestAccelerators(List guestAccelerators) { + if (this.guestAccelerators == null) { + this.guestAccelerators = new ArrayList<>(guestAccelerators.size()); + } + this.guestAccelerators.addAll(guestAccelerators); + return this; + } + + public Builder addGuestAccelerators(AcceleratorConfig guestAccelerators) { + this.guestAccelerators.add(guestAccelerators); + return this; + } + public String getId() { return id; } @@ -515,6 +659,24 @@ public Builder setKind(String kind) { return this; } + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Builder setLabelFingerprint(String labelFingerprint) { + this.labelFingerprint = labelFingerprint; + return this; + } + + public Map getLabelsMap() { + return labels; + } + + public Builder putAllLabels(Map labels) { + this.labels = labels; + return this; + } + public String getMachineType() { return machineType; } @@ -533,6 +695,15 @@ public Builder setMetadata(Metadata metadata) { return this; } + public String getMinCpuPlatform() { + return minCpuPlatform; + } + + public Builder setMinCpuPlatform(String minCpuPlatform) { + this.minCpuPlatform = minCpuPlatform; + return this; + } + public String getName() { return name; } @@ -594,6 +765,15 @@ public Builder addServiceAccounts(ServiceAccount serviceAccounts) { return this; } + public Boolean getStartRestricted() { + return startRestricted; + } + + public Builder setStartRestricted(Boolean startRestricted) { + this.startRestricted = startRestricted; + return this; + } + public String getStatus() { return status; } @@ -646,6 +826,12 @@ public Instance build() { + + + + + + @@ -653,17 +839,23 @@ public Instance build() { canIpForward, cpuPlatform, creationTimestamp, + deletionProtection, description, disks, + guestAccelerators, id, kind, + labelFingerprint, + labels, machineType, metadata, + minCpuPlatform, name, networkInterfaces, scheduling, selfLink, serviceAccounts, + startRestricted, status, statusMessage, tags, @@ -676,17 +868,23 @@ public Builder clone() { newBuilder.setCanIpForward(this.canIpForward); newBuilder.setCpuPlatform(this.cpuPlatform); newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeletionProtection(this.deletionProtection); newBuilder.setDescription(this.description); newBuilder.addAllDisks(this.disks); + newBuilder.addAllGuestAccelerators(this.guestAccelerators); newBuilder.setId(this.id); newBuilder.setKind(this.kind); + newBuilder.setLabelFingerprint(this.labelFingerprint); + newBuilder.putAllLabels(this.labels); newBuilder.setMachineType(this.machineType); newBuilder.setMetadata(this.metadata); + newBuilder.setMinCpuPlatform(this.minCpuPlatform); newBuilder.setName(this.name); newBuilder.addAllNetworkInterfaces(this.networkInterfaces); newBuilder.setScheduling(this.scheduling); newBuilder.setSelfLink(this.selfLink); newBuilder.addAllServiceAccounts(this.serviceAccounts); + newBuilder.setStartRestricted(this.startRestricted); newBuilder.setStatus(this.status); newBuilder.setStatusMessage(this.statusMessage); newBuilder.setTags(this.tags); @@ -701,17 +899,23 @@ public String toString() { + "canIpForward=" + canIpForward + ", " + "cpuPlatform=" + cpuPlatform + ", " + "creationTimestamp=" + creationTimestamp + ", " + + "deletionProtection=" + deletionProtection + ", " + "description=" + description + ", " + "disks=" + disks + ", " + + "guestAccelerators=" + guestAccelerators + ", " + "id=" + id + ", " + "kind=" + kind + ", " + + "labelFingerprint=" + labelFingerprint + ", " + + "labels=" + labels + ", " + "machineType=" + machineType + ", " + "metadata=" + metadata + ", " + + "minCpuPlatform=" + minCpuPlatform + ", " + "name=" + name + ", " + "networkInterfaces=" + networkInterfaces + ", " + "scheduling=" + scheduling + ", " + "selfLink=" + selfLink + ", " + "serviceAccounts=" + serviceAccounts + ", " + + "startRestricted=" + startRestricted + ", " + "status=" + status + ", " + "statusMessage=" + statusMessage + ", " + "tags=" + tags + ", " @@ -730,17 +934,23 @@ public boolean equals(Object o) { Objects.equals(this.canIpForward, that.getCanIpForward()) && Objects.equals(this.cpuPlatform, that.getCpuPlatform()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.deletionProtection, that.getDeletionProtection()) && Objects.equals(this.description, that.getDescription()) && Objects.equals(this.disks, that.getDisksList()) && + Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) && Objects.equals(this.id, that.getId()) && Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && + Objects.equals(this.labels, that.getLabelsMap()) && Objects.equals(this.machineType, that.getMachineType()) && Objects.equals(this.metadata, that.getMetadata()) && + Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) && Objects.equals(this.scheduling, that.getScheduling()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) && + Objects.equals(this.startRestricted, that.getStartRestricted()) && Objects.equals(this.status, that.getStatus()) && Objects.equals(this.statusMessage, that.getStatusMessage()) && Objects.equals(this.tags, that.getTags()) && @@ -756,17 +966,23 @@ public int hashCode() { canIpForward, cpuPlatform, creationTimestamp, + deletionProtection, description, disks, + guestAccelerators, id, kind, + labelFingerprint, + labels, machineType, metadata, + minCpuPlatform, name, networkInterfaces, scheduling, selfLink, serviceAccounts, + startRestricted, status, statusMessage, tags, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java index cdb3bb9ee999..59d41443fe78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java @@ -37,6 +37,7 @@ public final class InstanceAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private InstanceAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private InstanceAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private InstanceAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(InstanceAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(InstanceAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public InstanceAggregatedList build() { + return new InstanceAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java index f6097d4e9fe2..eebca093ff0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -54,8 +54,9 @@ * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); * } *
*
@@ -179,23 +180,30 @@ public InstanceStub getStub() { * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); * } *
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface to add to this instance. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addAccessConfigInstance(InstanceName instance, String networkInterface, AccessConfig accessConfigResource) { + public final Operation addAccessConfigInstance(InstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setNetworkInterface(networkInterface) + .setRequestId(requestId) .setAccessConfigResource(accessConfigResource) .build(); return addAccessConfigInstance(request); @@ -210,23 +218,30 @@ public final Operation addAccessConfigInstance(InstanceName instance, String net * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance.toString(), networkInterface, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance.toString(), networkInterface, requestId, accessConfigResource); * } *
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface to add to this instance. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addAccessConfigInstance(String instance, String networkInterface, AccessConfig accessConfigResource) { + public final Operation addAccessConfigInstance(String instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance) .setNetworkInterface(networkInterface) + .setRequestId(requestId) .setAccessConfigResource(accessConfigResource) .build(); return addAccessConfigInstance(request); @@ -241,10 +256,12 @@ public final Operation addAccessConfigInstance(String instance, String networkIn * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); * AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) + * .setRequestId(requestId) * .setAccessConfigResource(accessConfigResource) * .build(); * Operation response = instanceClient.addAccessConfigInstance(request); @@ -268,10 +285,12 @@ public final Operation addAccessConfigInstance(AddAccessConfigInstanceHttpReques * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); * AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) + * .setRequestId(requestId) * .setAccessConfigResource(accessConfigResource) * .build(); * ApiFuture<Operation> future = instanceClient.addAccessConfigInstanceCallable().futureCall(request); @@ -420,27 +439,34 @@ public final UnaryCallable * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + * String requestId = ""; * AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - * Operation response = instanceClient.attachDiskInstance(instance, attachedDiskResource); + * Operation response = instanceClient.attachDiskInstance(instance, requestId, attachedDiskResource); * } *
* * @param instance The instance name for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation attachDiskInstance(InstanceName instance, AttachedDisk attachedDiskResource) { + public final Operation attachDiskInstance(InstanceName instance, String requestId, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setAttachedDiskResource(attachedDiskResource) .build(); return attachDiskInstance(request); @@ -448,27 +474,34 @@ public final Operation attachDiskInstance(InstanceName instance, AttachedDisk at // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Attaches a Disk resource to an instance. + * 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: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
-   *   Operation response = instanceClient.attachDiskInstance(instance.toString(), attachedDiskResource);
+   *   Operation response = instanceClient.attachDiskInstance(instance.toString(), requestId, attachedDiskResource);
    * }
    * 
* * @param instance The instance name for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation attachDiskInstance(String instance, AttachedDisk attachedDiskResource) { + public final Operation attachDiskInstance(String instance, String requestId, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setAttachedDiskResource(attachedDiskResource) .build(); return attachDiskInstance(request); @@ -476,15 +509,17 @@ public final Operation attachDiskInstance(String instance, AttachedDisk attached // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Attaches a Disk resource to an instance. + * 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: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setAttachedDiskResource(attachedDiskResource)
    *     .build();
    *   Operation response = instanceClient.attachDiskInstance(request);
@@ -501,15 +536,17 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request)
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Attaches a Disk resource to an instance.
+   * 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:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setAttachedDiskResource(attachedDiskResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.attachDiskInstanceCallable().futureCall(request);
@@ -531,19 +568,26 @@ public final UnaryCallable attachDiskI
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.deleteInstance(instance);
+   *   String requestId = "";
+   *   Operation response = instanceClient.deleteInstance(instance, requestId);
    * }
    * 
* * @param instance Name of the instance resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstance(InstanceName instance) { + public final Operation deleteInstance(InstanceName instance, String requestId) { DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .build(); return deleteInstance(request); } @@ -556,19 +600,26 @@ public final Operation deleteInstance(InstanceName instance) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.deleteInstance(instance.toString());
+   *   String requestId = "";
+   *   Operation response = instanceClient.deleteInstance(instance.toString(), requestId);
    * }
    * 
* * @param instance Name of the instance resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstance(String instance) { + public final Operation deleteInstance(String instance, String requestId) { DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .build(); return deleteInstance(request); } @@ -581,8 +632,10 @@ public final Operation deleteInstance(String instance) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.deleteInstance(request);
    * }
@@ -604,8 +657,10 @@ public final Operation deleteInstance(DeleteInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.deleteInstanceCallable().futureCall(request);
    *   // Do something
@@ -627,23 +682,30 @@ public final UnaryCallable deleteInstanceC
    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
+   *   String requestId = "";
    *   String accessConfig = "";
-   *   Operation response = instanceClient.deleteAccessConfigInstance(instance, networkInterface, accessConfig);
+   *   Operation response = instanceClient.deleteAccessConfigInstance(instance, networkInterface, requestId, accessConfig);
    * }
    * 
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param accessConfig The name of the access config to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAccessConfigInstance(InstanceName instance, String networkInterface, String accessConfig) { + public final Operation deleteAccessConfigInstance(InstanceName instance, String networkInterface, String requestId, String accessConfig) { DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setNetworkInterface(networkInterface) + .setRequestId(requestId) .setAccessConfig(accessConfig) .build(); return deleteAccessConfigInstance(request); @@ -658,23 +720,30 @@ public final Operation deleteAccessConfigInstance(InstanceName instance, String * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * String accessConfig = ""; - * Operation response = instanceClient.deleteAccessConfigInstance(instance.toString(), networkInterface, accessConfig); + * Operation response = instanceClient.deleteAccessConfigInstance(instance.toString(), networkInterface, requestId, accessConfig); * } *
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param accessConfig The name of the access config to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAccessConfigInstance(String instance, String networkInterface, String accessConfig) { + public final Operation deleteAccessConfigInstance(String instance, String networkInterface, String requestId, String accessConfig) { DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance) .setNetworkInterface(networkInterface) + .setRequestId(requestId) .setAccessConfig(accessConfig) .build(); return deleteAccessConfigInstance(request); @@ -689,10 +758,12 @@ public final Operation deleteAccessConfigInstance(String instance, String networ * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * String accessConfig = ""; * DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) + * .setRequestId(requestId) * .setAccessConfig(accessConfig) * .build(); * Operation response = instanceClient.deleteAccessConfigInstance(request); @@ -716,10 +787,12 @@ public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttp * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * String accessConfig = ""; * DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) + * .setRequestId(requestId) * .setAccessConfig(accessConfig) * .build(); * ApiFuture<Operation> future = instanceClient.deleteAccessConfigInstanceCallable().futureCall(request); @@ -741,21 +814,28 @@ public final UnaryCallable del *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   String deviceName = "";
-   *   Operation response = instanceClient.detachDiskInstance(instance, deviceName);
+   *   Operation response = instanceClient.detachDiskInstance(instance, requestId, deviceName);
    * }
    * 
* * @param instance Instance name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param deviceName Disk device name to detach. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation detachDiskInstance(InstanceName instance, String deviceName) { + public final Operation detachDiskInstance(InstanceName instance, String requestId, String deviceName) { DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setDeviceName(deviceName) .build(); return detachDiskInstance(request); @@ -769,21 +849,28 @@ public final Operation detachDiskInstance(InstanceName instance, String deviceNa *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   String deviceName = "";
-   *   Operation response = instanceClient.detachDiskInstance(instance.toString(), deviceName);
+   *   Operation response = instanceClient.detachDiskInstance(instance.toString(), requestId, deviceName);
    * }
    * 
* * @param instance Instance name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param deviceName Disk device name to detach. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation detachDiskInstance(String instance, String deviceName) { + public final Operation detachDiskInstance(String instance, String requestId, String deviceName) { DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setDeviceName(deviceName) .build(); return detachDiskInstance(request); @@ -797,9 +884,11 @@ public final Operation detachDiskInstance(String instance, String deviceName) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   String deviceName = "";
    *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setDeviceName(deviceName)
    *     .build();
    *   Operation response = instanceClient.detachDiskInstance(request);
@@ -822,9 +911,11 @@ public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request)
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   String deviceName = "";
    *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setDeviceName(deviceName)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.detachDiskInstanceCallable().futureCall(request);
@@ -949,7 +1040,7 @@ public final UnaryCallable getInstanceCallable
    *
    * @param instance Name of the instance scoping this request.
    * @param port Specifies which COM or serial port to retrieve data from.
-   * @param start For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value that was returned in the previous call.
+   * @param start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
@@ -980,7 +1071,7 @@ public final SerialPortOutput getSerialPortOutputInstance(InstanceName instance,
    *
    * @param instance Name of the instance scoping this request.
    * @param port Specifies which COM or serial port to retrieve data from.
-   * @param start For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value that was returned in the previous call.
+   * @param start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
@@ -1056,21 +1147,28 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
-   *   Operation response = instanceClient.insertInstance(zone, instanceResource);
+   *   Operation response = instanceClient.insertInstance(zone, requestId, instanceResource);
    * }
    * 
* * @param zone The name of the zone for this request. - * @param instanceResource An Instance resource. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstance(ZoneName zone, Instance instanceResource) { + public final Operation insertInstance(ZoneName zone, String requestId, Instance instanceResource) { InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setInstanceResource(instanceResource) .build(); return insertInstance(request); @@ -1084,21 +1182,28 @@ public final Operation insertInstance(ZoneName zone, Instance instanceResource) *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
-   *   Operation response = instanceClient.insertInstance(zone.toString(), instanceResource);
+   *   Operation response = instanceClient.insertInstance(zone.toString(), requestId, instanceResource);
    * }
    * 
* * @param zone The name of the zone for this request. - * @param instanceResource An Instance resource. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstance(String zone, Instance instanceResource) { + public final Operation insertInstance(String zone, String requestId, Instance instanceResource) { InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder() .setZone(zone) + .setRequestId(requestId) .setInstanceResource(instanceResource) .build(); return insertInstance(request); @@ -1112,9 +1217,11 @@ public final Operation insertInstance(String zone, Instance instanceResource) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setInstanceResource(instanceResource)
    *     .build();
    *   Operation response = instanceClient.insertInstance(request);
@@ -1137,9 +1244,11 @@ public final Operation insertInstance(InsertInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setInstanceResource(instanceResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.insertInstanceCallable().futureCall(request);
@@ -1288,64 +1397,213 @@ public final UnaryCallable listInstances
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Performs a hard reset on the instance.
+   * Retrieves the list of referrers to instances contained within the specified zone.
+   *
+   * Sample code:
+   * 

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   for (Reference element : instanceClient.listReferrersInstances(instance).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListReferrersInstancesPagedResponse listReferrersInstances(InstanceName instance) { + ListReferrersInstancesHttpRequest request = + ListReferrersInstancesHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .build(); + return listReferrersInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of referrers to instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   for (Reference element : instanceClient.listReferrersInstances(instance.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListReferrersInstancesPagedResponse listReferrersInstances(String instance) { + ListReferrersInstancesHttpRequest request = + ListReferrersInstancesHttpRequest.newBuilder() + .setInstance(instance) + .build(); + return listReferrersInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of referrers to instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   for (Reference element : instanceClient.listReferrersInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListReferrersInstancesPagedResponse listReferrersInstances(ListReferrersInstancesHttpRequest request) { + return listReferrersInstancesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of referrers to instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   ApiFuture<ListReferrersInstancesPagedResponse> future = instanceClient.listReferrersInstancesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Reference element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listReferrersInstancesPagedCallable() { + return stub.listReferrersInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of referrers to instances contained within the specified zone. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .build();
+   *   while (true) {
+   *     InstanceListReferrers response = instanceClient.listReferrersInstancesCallable().call(request);
+   *     for (Reference element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listReferrersInstancesCallable() { + return stub.listReferrersInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs a reset on the instance. For more information, see Resetting an instance. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.resetInstance(instance);
+   *   String requestId = "";
+   *   Operation response = instanceClient.resetInstance(instance, requestId);
    * }
    * 
* * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resetInstance(InstanceName instance) { + public final Operation resetInstance(InstanceName instance, String requestId) { ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .build(); return resetInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Performs a hard reset on the instance. + * Performs a reset on the instance. For more information, see Resetting an instance. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.resetInstance(instance.toString());
+   *   String requestId = "";
+   *   Operation response = instanceClient.resetInstance(instance.toString(), requestId);
    * }
    * 
* * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resetInstance(String instance) { + public final Operation resetInstance(String instance, String requestId) { ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .build(); return resetInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Performs a hard reset on the instance. + * Performs a reset on the instance. For more information, see Resetting an instance. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.resetInstance(request);
    * }
@@ -1361,14 +1619,16 @@ public final Operation resetInstance(ResetInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Performs a hard reset on the instance.
+   * Performs a reset on the instance. For more information, see Resetting an instance.
    *
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.resetInstanceCallable().futureCall(request);
    *   // Do something
@@ -1381,6 +1641,129 @@ public final UnaryCallable resetInstanceCal
     return stub.resetInstanceCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Sets deletion protection on the instance.
+   *
+   * Sample code:
+   * 

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   Boolean deletionProtection = false;
+   *   Operation response = instanceClient.setDeletionProtectionInstance(resource, requestId, deletionProtection);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param deletionProtection Whether the resource should be protected against deletion. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDeletionProtectionInstance(ProjectZoneInstanceName resource, String requestId, Boolean deletionProtection) { + + SetDeletionProtectionInstanceHttpRequest request = + SetDeletionProtectionInstanceHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setRequestId(requestId) + .setDeletionProtection(deletionProtection) + .build(); + return setDeletionProtectionInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets deletion protection on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   Boolean deletionProtection = false;
+   *   Operation response = instanceClient.setDeletionProtectionInstance(resource.toString(), requestId, deletionProtection);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param deletionProtection Whether the resource should be protected against deletion. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDeletionProtectionInstance(String resource, String requestId, Boolean deletionProtection) { + + SetDeletionProtectionInstanceHttpRequest request = + SetDeletionProtectionInstanceHttpRequest.newBuilder() + .setResource(resource) + .setRequestId(requestId) + .setDeletionProtection(deletionProtection) + .build(); + return setDeletionProtectionInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets deletion protection on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   Boolean deletionProtection = false;
+   *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRequestId(requestId)
+   *     .setDeletionProtection(deletionProtection)
+   *     .build();
+   *   Operation response = instanceClient.setDeletionProtectionInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDeletionProtectionInstance(SetDeletionProtectionInstanceHttpRequest request) { + return setDeletionProtectionInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets deletion protection on the instance. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   String requestId = "";
+   *   Boolean deletionProtection = false;
+   *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRequestId(requestId)
+   *     .setDeletionProtection(deletionProtection)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setDeletionProtectionInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setDeletionProtectionInstanceCallable() { + return stub.setDeletionProtectionInstanceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Sets the auto-delete flag for a disk attached to an instance. @@ -1389,23 +1772,30 @@ public final UnaryCallable resetInstanceCal *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
-   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance, autoDelete, deviceName);
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance, requestId, autoDelete, deviceName);
    * }
    * 
* * @param instance The instance name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param autoDelete Whether to auto-delete the disk when the instance is deleted. * @param deviceName The device name of the disk to modify. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setDiskAutoDeleteInstance(InstanceName instance, Boolean autoDelete, String deviceName) { + public final Operation setDiskAutoDeleteInstance(InstanceName instance, String requestId, Boolean autoDelete, String deviceName) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setAutoDelete(autoDelete) .setDeviceName(deviceName) .build(); @@ -1420,23 +1810,30 @@ public final Operation setDiskAutoDeleteInstance(InstanceName instance, Boolean *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
-   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance.toString(), autoDelete, deviceName);
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance.toString(), requestId, autoDelete, deviceName);
    * }
    * 
* * @param instance The instance name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param autoDelete Whether to auto-delete the disk when the instance is deleted. * @param deviceName The device name of the disk to modify. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setDiskAutoDeleteInstance(String instance, Boolean autoDelete, String deviceName) { + public final Operation setDiskAutoDeleteInstance(String instance, String requestId, Boolean autoDelete, String deviceName) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setAutoDelete(autoDelete) .setDeviceName(deviceName) .build(); @@ -1451,10 +1848,12 @@ public final Operation setDiskAutoDeleteInstance(String instance, Boolean autoDe *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
    *   SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setAutoDelete(autoDelete)
    *     .setDeviceName(deviceName)
    *     .build();
@@ -1478,10 +1877,12 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
    *   SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setAutoDelete(autoDelete)
    *     .setDeviceName(deviceName)
    *     .build();
@@ -1498,74 +1899,90 @@ public final UnaryCallable setD
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the machine type for a stopped instance to the machine type specified in the request.
+   * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
    *
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource);
+   *   String requestId = "";
+   *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
+   *   Operation response = instanceClient.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param instancesSetMachineTypeRequestResource + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineTypeInstance(InstanceName instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + public final Operation setLabelsInstance(InstanceName instance, String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) { - SetMachineTypeInstanceHttpRequest request = - SetMachineTypeInstanceHttpRequest.newBuilder() + SetLabelsInstanceHttpRequest request = + SetLabelsInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .setRequestId(requestId) + .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) .build(); - return setMachineTypeInstance(request); + return setLabelsInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the machine type for a stopped instance to the machine type specified in the request. + * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMachineTypeInstance(instance.toString(), instancesSetMachineTypeRequestResource);
+   *   String requestId = "";
+   *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
+   *   Operation response = instanceClient.setLabelsInstance(instance.toString(), requestId, instancesSetLabelsRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param instancesSetMachineTypeRequestResource + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineTypeInstance(String instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + public final Operation setLabelsInstance(String instance, String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) { - SetMachineTypeInstanceHttpRequest request = - SetMachineTypeInstanceHttpRequest.newBuilder() + SetLabelsInstanceHttpRequest request = + SetLabelsInstanceHttpRequest.newBuilder() .setInstance(instance) - .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .setRequestId(requestId) + .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) .build(); - return setMachineTypeInstance(request); + return setLabelsInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the machine type for a stopped instance to the machine type specified in the request. + * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
-   *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
+   *   String requestId = "";
+   *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
+   *   SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
+   *     .setRequestId(requestId)
+   *     .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource)
    *     .build();
-   *   Operation response = instanceClient.setMachineTypeInstance(request);
+   *   Operation response = instanceClient.setLabelsInstance(request);
    * }
    * 
* @@ -1573,104 +1990,368 @@ public final Operation setMachineTypeInstance(String instance, InstancesSetMachi * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest request) { - return setMachineTypeInstanceCallable().call(request); + public final Operation setLabelsInstance(SetLabelsInstanceHttpRequest request) { + return setLabelsInstanceCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the machine type for a stopped instance to the machine type specified in the request. + * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
-   *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
+   *   String requestId = "";
+   *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
+   *   SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
+   *     .setRequestId(requestId)
+   *     .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource)
    *     .build();
-   *   ApiFuture<Operation> future = instanceClient.setMachineTypeInstanceCallable().futureCall(request);
+   *   ApiFuture<Operation> future = instanceClient.setLabelsInstanceCallable().futureCall(request);
    *   // Do something
    *   Operation response = future.get();
    * }
    * 
*/ @BetaApi - public final UnaryCallable setMachineTypeInstanceCallable() { - return stub.setMachineTypeInstanceCallable(); + public final UnaryCallable setLabelsInstanceCallable() { + return stub.setLabelsInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata for the specified instance to the data included in the request. + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = instanceClient.setMetadataInstance(instance, metadataResource);
+   *   String requestId = "";
+   *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param metadataResource A metadata key/value entry. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetMachineResourcesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMetadataInstance(InstanceName instance, Metadata metadataResource) { + public final Operation setMachineResourcesInstance(InstanceName instance, String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { - SetMetadataInstanceHttpRequest request = - SetMetadataInstanceHttpRequest.newBuilder() + SetMachineResourcesInstanceHttpRequest request = + SetMachineResourcesInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setMetadataResource(metadataResource) + .setRequestId(requestId) + .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource) .build(); - return setMetadataInstance(request); + return setMachineResourcesInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata for the specified instance to the data included in the request. + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = instanceClient.setMetadataInstance(instance.toString(), metadataResource);
+   *   String requestId = "";
+   *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMachineResourcesInstance(instance.toString(), requestId, instancesSetMachineResourcesRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param metadataResource A metadata key/value entry. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetMachineResourcesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMetadataInstance(String instance, Metadata metadataResource) { + public final Operation setMachineResourcesInstance(String instance, String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { - SetMetadataInstanceHttpRequest request = - SetMetadataInstanceHttpRequest.newBuilder() + SetMachineResourcesInstanceHttpRequest request = + SetMachineResourcesInstanceHttpRequest.newBuilder() .setInstance(instance) - .setMetadataResource(metadataResource) + .setRequestId(requestId) + .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource) .build(); - return setMetadataInstance(request); + return setMachineResourcesInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata for the specified instance to the data included in the request. + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
+   *   String requestId = "";
+   *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
+   *   SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setMetadataResource(metadataResource)
+   *     .setRequestId(requestId)
+   *     .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource)
    *     .build();
-   *   Operation response = instanceClient.setMetadataInstance(request);
+   *   Operation response = instanceClient.setMachineResourcesInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineResourcesInstance(SetMachineResourcesInstanceHttpRequest request) { + return setMachineResourcesInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
+   *   SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
+   *     .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setMachineResourcesInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setMachineResourcesInstanceCallable() { + return stub.setMachineResourcesInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetMachineTypeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineTypeInstance(InstanceName instance, String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + + SetMachineTypeInstanceHttpRequest request = + SetMachineTypeInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .build(); + return setMachineTypeInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMachineTypeInstance(instance.toString(), requestId, instancesSetMachineTypeRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetMachineTypeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineTypeInstance(String instance, String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + + SetMachineTypeInstanceHttpRequest request = + SetMachineTypeInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .build(); + return setMachineTypeInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
+   *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
+   *     .build();
+   *   Operation response = instanceClient.setMachineTypeInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest request) { + return setMachineTypeInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
+   *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
+   *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setMachineTypeInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setMachineTypeInstanceCallable() { + return stub.setMachineTypeInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   Operation response = instanceClient.setMetadataInstance(instance, requestId, metadataResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param metadataResource A metadata key/value entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMetadataInstance(InstanceName instance, String requestId, Metadata metadataResource) { + + SetMetadataInstanceHttpRequest request = + SetMetadataInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setMetadataResource(metadataResource) + .build(); + return setMetadataInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   Operation response = instanceClient.setMetadataInstance(instance.toString(), requestId, metadataResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param metadataResource A metadata key/value entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMetadataInstance(String instance, String requestId, Metadata metadataResource) { + + SetMetadataInstanceHttpRequest request = + SetMetadataInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setRequestId(requestId) + .setMetadataResource(metadataResource) + .build(); + return setMetadataInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
+   *     .setMetadataResource(metadataResource)
+   *     .build();
+   *   Operation response = instanceClient.setMetadataInstance(request);
    * }
    * 
* @@ -1684,26 +2365,151 @@ public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest reques // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata for the specified instance to the data included in the request. + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   Metadata metadataResource = Metadata.newBuilder().build();
+   *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
+   *     .setMetadataResource(metadataResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.setMetadataInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setMetadataInstanceCallable() { + return stub.setMetadataInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetMinCpuPlatformRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMinCpuPlatformInstance(InstanceName instance, String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { + + SetMinCpuPlatformInstanceHttpRequest request = + SetMinCpuPlatformInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) + .build(); + return setMinCpuPlatformInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
+   *   Operation response = instanceClient.setMinCpuPlatformInstance(instance.toString(), requestId, instancesSetMinCpuPlatformRequestResource);
+   * }
+   * 
+ * + * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instancesSetMinCpuPlatformRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMinCpuPlatformInstance(String instance, String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { + + SetMinCpuPlatformInstanceHttpRequest request = + SetMinCpuPlatformInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) + .build(); + return setMinCpuPlatformInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
+   *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
+   *   SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
+   *     .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource)
+   *     .build();
+   *   Operation response = instanceClient.setMinCpuPlatformInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setMinCpuPlatformInstance(SetMinCpuPlatformInstanceHttpRequest request) { + return setMinCpuPlatformInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
+   *   String requestId = "";
+   *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
+   *   SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setMetadataResource(metadataResource)
+   *     .setRequestId(requestId)
+   *     .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource)
    *     .build();
-   *   ApiFuture<Operation> future = instanceClient.setMetadataInstanceCallable().futureCall(request);
+   *   ApiFuture<Operation> future = instanceClient.setMinCpuPlatformInstanceCallable().futureCall(request);
    *   // Do something
    *   Operation response = future.get();
    * }
    * 
*/ @BetaApi - public final UnaryCallable setMetadataInstanceCallable() { - return stub.setMetadataInstanceCallable(); + public final UnaryCallable setMinCpuPlatformInstanceCallable() { + return stub.setMinCpuPlatformInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1714,21 +2520,28 @@ public final UnaryCallable setMetadat *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
-   *   Operation response = instanceClient.setSchedulingInstance(instance, schedulingResource);
+   *   Operation response = instanceClient.setSchedulingInstance(instance, requestId, schedulingResource);
    * }
    * 
* * @param instance Instance name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param schedulingResource Sets the scheduling options for an Instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSchedulingInstance(InstanceName instance, Scheduling schedulingResource) { + public final Operation setSchedulingInstance(InstanceName instance, String requestId, Scheduling schedulingResource) { SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setSchedulingResource(schedulingResource) .build(); return setSchedulingInstance(request); @@ -1742,21 +2555,28 @@ public final Operation setSchedulingInstance(InstanceName instance, Scheduling s *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
-   *   Operation response = instanceClient.setSchedulingInstance(instance.toString(), schedulingResource);
+   *   Operation response = instanceClient.setSchedulingInstance(instance.toString(), requestId, schedulingResource);
    * }
    * 
* * @param instance Instance name. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param schedulingResource Sets the scheduling options for an Instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSchedulingInstance(String instance, Scheduling schedulingResource) { + public final Operation setSchedulingInstance(String instance, String requestId, Scheduling schedulingResource) { SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setSchedulingResource(schedulingResource) .build(); return setSchedulingInstance(request); @@ -1770,9 +2590,11 @@ public final Operation setSchedulingInstance(String instance, Scheduling schedul *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setSchedulingResource(schedulingResource)
    *     .build();
    *   Operation response = instanceClient.setSchedulingInstance(request);
@@ -1795,9 +2617,11 @@ public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest re
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setSchedulingResource(schedulingResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setSchedulingInstanceCallable().futureCall(request);
@@ -1813,27 +2637,34 @@ public final UnaryCallable setSched
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the service account on the instance.
+   * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
    *
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
-   *   Operation response = instanceClient.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource);
+   *   Operation response = instanceClient.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instancesSetServiceAccountRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setServiceAccountInstance(InstanceName instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + public final Operation setServiceAccountInstance(InstanceName instance, String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) .build(); return setServiceAccountInstance(request); @@ -1841,27 +2672,34 @@ public final Operation setServiceAccountInstance(InstanceName instance, Instance // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the service account on the instance. + * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
-   *   Operation response = instanceClient.setServiceAccountInstance(instance.toString(), instancesSetServiceAccountRequestResource);
+   *   Operation response = instanceClient.setServiceAccountInstance(instance.toString(), requestId, instancesSetServiceAccountRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instancesSetServiceAccountRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setServiceAccountInstance(String instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + public final Operation setServiceAccountInstance(String instance, String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) .build(); return setServiceAccountInstance(request); @@ -1869,15 +2707,17 @@ public final Operation setServiceAccountInstance(String instance, InstancesSetSe // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the service account on the instance. + * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. * * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource)
    *     .build();
    *   Operation response = instanceClient.setServiceAccountInstance(request);
@@ -1894,15 +2734,17 @@ public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRe
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the service account on the instance.
+   * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
    *
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setServiceAccountInstanceCallable().futureCall(request);
@@ -1924,21 +2766,28 @@ public final UnaryCallable setS
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
-   *   Operation response = instanceClient.setTagsInstance(instance, tagsResource);
+   *   Operation response = instanceClient.setTagsInstance(instance, requestId, tagsResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param tagsResource A set of instance tags. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTagsInstance(InstanceName instance, Tags tagsResource) { + public final Operation setTagsInstance(InstanceName instance, String requestId, Tags tagsResource) { SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setTagsResource(tagsResource) .build(); return setTagsInstance(request); @@ -1952,21 +2801,28 @@ public final Operation setTagsInstance(InstanceName instance, Tags tagsResource) *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
-   *   Operation response = instanceClient.setTagsInstance(instance.toString(), tagsResource);
+   *   Operation response = instanceClient.setTagsInstance(instance.toString(), requestId, tagsResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param tagsResource A set of instance tags. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTagsInstance(String instance, Tags tagsResource) { + public final Operation setTagsInstance(String instance, String requestId, Tags tagsResource) { SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setTagsResource(tagsResource) .build(); return setTagsInstance(request); @@ -1980,9 +2836,11 @@ public final Operation setTagsInstance(String instance, Tags tagsResource) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setTagsResource(tagsResource)
    *     .build();
    *   Operation response = instanceClient.setTagsInstance(request);
@@ -2005,9 +2863,11 @@ public final Operation setTagsInstance(SetTagsInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setTagsResource(tagsResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setTagsInstanceCallable().futureCall(request);
@@ -2029,19 +2889,26 @@ public final UnaryCallable setTagsInstanc
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.startInstance(instance);
+   *   String requestId = "";
+   *   Operation response = instanceClient.startInstance(instance, requestId);
    * }
    * 
* * @param instance Name of the instance resource to start. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startInstance(InstanceName instance) { + public final Operation startInstance(InstanceName instance, String requestId) { StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .build(); return startInstance(request); } @@ -2054,19 +2921,26 @@ public final Operation startInstance(InstanceName instance) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.startInstance(instance.toString());
+   *   String requestId = "";
+   *   Operation response = instanceClient.startInstance(instance.toString(), requestId);
    * }
    * 
* * @param instance Name of the instance resource to start. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startInstance(String instance) { + public final Operation startInstance(String instance, String requestId) { StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .build(); return startInstance(request); } @@ -2079,8 +2953,10 @@ public final Operation startInstance(String instance) { *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.startInstance(request);
    * }
@@ -2102,8 +2978,10 @@ public final Operation startInstance(StartInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.startInstanceCallable().futureCall(request);
    *   // Do something
@@ -2124,21 +3002,28 @@ public final UnaryCallable startInstanceCal
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
-   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource);
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instancesStartWithEncryptionKeyRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startWithEncryptionKeyInstance(InstanceName instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + public final Operation startWithEncryptionKeyInstance(InstanceName instance, String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource) .build(); return startWithEncryptionKeyInstance(request); @@ -2152,21 +3037,28 @@ public final Operation startWithEncryptionKeyInstance(InstanceName instance, Ins *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
-   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance.toString(), instancesStartWithEncryptionKeyRequestResource);
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance.toString(), requestId, instancesStartWithEncryptionKeyRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instancesStartWithEncryptionKeyRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startWithEncryptionKeyInstance(String instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + public final Operation startWithEncryptionKeyInstance(String instance, String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource) .build(); return startWithEncryptionKeyInstance(request); @@ -2180,9 +3072,11 @@ public final Operation startWithEncryptionKeyInstance(String instance, Instances *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource)
    *     .build();
    *   Operation response = instanceClient.startWithEncryptionKeyInstance(request);
@@ -2205,9 +3099,11 @@ public final Operation startWithEncryptionKeyInstance(StartWithEncryptionKeyInst
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.startWithEncryptionKeyInstanceCallable().futureCall(request);
@@ -2223,64 +3119,80 @@ public final UnaryCallable
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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.
+   * 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:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.stopInstance(instance);
+   *   String requestId = "";
+   *   Operation response = instanceClient.stopInstance(instance, requestId);
    * }
    * 
* * @param instance Name of the instance resource to stop. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation stopInstance(InstanceName instance) { + public final Operation stopInstance(InstanceName instance, String requestId) { StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) .build(); return stopInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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. + * 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: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   Operation response = instanceClient.stopInstance(instance.toString());
+   *   String requestId = "";
+   *   Operation response = instanceClient.stopInstance(instance.toString(), requestId);
    * }
    * 
* * @param instance Name of the instance resource to stop. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation stopInstance(String instance) { + public final Operation stopInstance(String instance, String requestId) { StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder() .setInstance(instance) + .setRequestId(requestId) .build(); return stopInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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. + * 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: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.stopInstance(request);
    * }
@@ -2296,14 +3208,16 @@ public final Operation stopInstance(StopInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine 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.
+   * 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:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String requestId = "";
    *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.stopInstanceCallable().futureCall(request);
    *   // Do something
@@ -2316,6 +3230,272 @@ public final UnaryCallable stopInstanceCalla
     return stub.stopInstanceCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * 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:
+   * 

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   Operation response = instanceClient.updateAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface where the access config is attached. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateAccessConfigInstance(InstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { + + UpdateAccessConfigInstanceHttpRequest request = + UpdateAccessConfigInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfigResource(accessConfigResource) + .build(); + return updateAccessConfigInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   Operation response = instanceClient.updateAccessConfigInstance(instance.toString(), networkInterface, requestId, accessConfigResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface where the access config is attached. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateAccessConfigInstance(String instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { + + UpdateAccessConfigInstanceHttpRequest request = + UpdateAccessConfigInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfigResource(accessConfigResource) + .build(); + return updateAccessConfigInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setRequestId(requestId)
+   *     .setAccessConfigResource(accessConfigResource)
+   *     .build();
+   *   Operation response = instanceClient.updateAccessConfigInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttpRequest request) { + return updateAccessConfigInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
+   *   UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setRequestId(requestId)
+   *     .setAccessConfigResource(accessConfigResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.updateAccessConfigInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateAccessConfigInstanceCallable() { + return stub.updateAccessConfigInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an instance's network interface. This method follows PATCH semantics. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
+   *   Operation response = instanceClient.updateNetworkInterfaceInstance(instance, networkInterface, requestId, networkInterfaceResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param networkInterfaceResource A network interface resource attached to an instance. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateNetworkInterfaceInstance(InstanceName instance, String networkInterface, String requestId, NetworkInterface networkInterfaceResource) { + + UpdateNetworkInterfaceInstanceHttpRequest request = + UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setNetworkInterfaceResource(networkInterfaceResource) + .build(); + return updateNetworkInterfaceInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an instance's network interface. This method follows PATCH semantics. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
+   *   Operation response = instanceClient.updateNetworkInterfaceInstance(instance.toString(), networkInterface, requestId, networkInterfaceResource);
+   * }
+   * 
+ * + * @param instance The instance name for this request. + * @param networkInterface The name of the network interface to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param networkInterfaceResource A network interface resource attached to an instance. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateNetworkInterfaceInstance(String instance, String networkInterface, String requestId, NetworkInterface networkInterfaceResource) { + + UpdateNetworkInterfaceInstanceHttpRequest request = + UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setNetworkInterfaceResource(networkInterfaceResource) + .build(); + return updateNetworkInterfaceInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an instance's network interface. This method follows PATCH semantics. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
+   *   UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setRequestId(requestId)
+   *     .setNetworkInterfaceResource(networkInterfaceResource)
+   *     .build();
+   *   Operation response = instanceClient.updateNetworkInterfaceInstance(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation updateNetworkInterfaceInstance(UpdateNetworkInterfaceInstanceHttpRequest request) { + return updateNetworkInterfaceInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an instance's network interface. This method follows PATCH semantics. + * + * Sample code: + *

+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   String networkInterface = "";
+   *   String requestId = "";
+   *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
+   *   UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder()
+   *     .setInstance(instance.toString())
+   *     .setNetworkInterface(networkInterface)
+   *     .setRequestId(requestId)
+   *     .setNetworkInterfaceResource(networkInterfaceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceClient.updateNetworkInterfaceInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable updateNetworkInterfaceInstanceCallable() { + return stub.updateNetworkInterfaceInstanceCallable(); + } + @Override public final void close() throws Exception { stub.close(); @@ -2519,5 +3699,92 @@ protected ListInstancesFixedSizeCollection createCollection( } + } + public static class ListReferrersInstancesPagedResponse extends AbstractPagedListResponse< + ListReferrersInstancesHttpRequest, + InstanceListReferrers, + Reference, + ListReferrersInstancesPage, + ListReferrersInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListReferrersInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListReferrersInstancesPagedResponse apply(ListReferrersInstancesPage input) { + return new ListReferrersInstancesPagedResponse(input); + } + }); + } + + private ListReferrersInstancesPagedResponse(ListReferrersInstancesPage page) { + super(page, ListReferrersInstancesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListReferrersInstancesPage extends AbstractPage< + ListReferrersInstancesHttpRequest, + InstanceListReferrers, + Reference, + ListReferrersInstancesPage> { + + private ListReferrersInstancesPage( + PageContext context, + InstanceListReferrers response) { + super(context, response); + } + + private static ListReferrersInstancesPage createEmptyPage() { + return new ListReferrersInstancesPage(null, null); + } + + @Override + protected ListReferrersInstancesPage createPage( + PageContext context, + InstanceListReferrers response) { + return new ListReferrersInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListReferrersInstancesFixedSizeCollection extends AbstractFixedSizeCollection< + ListReferrersInstancesHttpRequest, + InstanceListReferrers, + Reference, + ListReferrersInstancesPage, + ListReferrersInstancesFixedSizeCollection> { + + private ListReferrersInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListReferrersInstancesFixedSizeCollection createEmptyCollection() { + return new ListReferrersInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListReferrersInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListReferrersInstancesFixedSizeCollection(pages, collectionSize); + } + + } } \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java index cf44e637f6b2..c00154ba169e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java @@ -37,6 +37,7 @@ public final class InstanceGroupAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private InstanceGroupAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private InstanceGroupAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private InstanceGroupAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(InstanceGroupAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(InstanceGroupAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public InstanceGroupAggregatedList build() { + return new InstanceGroupAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java index 3439cf4b69f0..e5024e7ecb4f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java @@ -52,9 +52,10 @@ *
  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+ *   String requestId = "";
  *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
  *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
+ *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
  * }
  * 
  * 
@@ -176,21 +177,28 @@ public InstanceGroupStub getStub() { * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where you are adding instances. * @param instanceGroupsAddInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstancesInstanceGroup(InstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + public final Operation addInstancesInstanceGroup(String requestId, InstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) .build(); @@ -204,21 +212,28 @@ public final Operation addInstancesInstanceGroup(InstanceGroupName instanceGroup * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup.toString(), instanceGroupsAddInstancesRequestResource);
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsAddInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where you are adding instances. * @param instanceGroupsAddInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstancesInstanceGroup(String instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + public final Operation addInstancesInstanceGroup(String requestId, String instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) .build(); @@ -232,9 +247,11 @@ public final Operation addInstancesInstanceGroup(String instanceGroup, InstanceG * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource)
    *     .build();
@@ -257,9 +274,11 @@ public final Operation addInstancesInstanceGroup(AddInstancesInstanceGroupHttpRe
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource)
    *     .build();
@@ -414,19 +433,26 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
-   *   Operation response = instanceGroupClient.deleteInstanceGroup(instanceGroup);
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(requestId, instanceGroup);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroup(InstanceGroupName instanceGroup) { + public final Operation deleteInstanceGroup(String requestId, InstanceGroupName instanceGroup) { DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .build(); return deleteInstanceGroup(request); @@ -439,19 +465,26 @@ public final Operation deleteInstanceGroup(InstanceGroupName instanceGroup) { * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
-   *   Operation response = instanceGroupClient.deleteInstanceGroup(instanceGroup.toString());
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(requestId, instanceGroup.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroup(String instanceGroup) { + public final Operation deleteInstanceGroup(String requestId, String instanceGroup) { DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup) .build(); return deleteInstanceGroup(request); @@ -464,8 +497,10 @@ public final Operation deleteInstanceGroup(String instanceGroup) { * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .build();
    *   Operation response = instanceGroupClient.deleteInstanceGroup(request);
@@ -487,8 +522,10 @@ public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest reques
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupClient.deleteInstanceGroupCallable().futureCall(request);
@@ -605,21 +642,28 @@ public final UnaryCallable getInstan
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
-   *   Operation response = instanceGroupClient.insertInstanceGroup(zone, instanceGroupResource);
+   *   Operation response = instanceGroupClient.insertInstanceGroup(zone, requestId, instanceGroupResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the instance group. - * @param instanceGroupResource + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroup(ZoneName zone, InstanceGroup instanceGroupResource) { + public final Operation insertInstanceGroup(ZoneName zone, String requestId, InstanceGroup instanceGroupResource) { InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setInstanceGroupResource(instanceGroupResource) .build(); return insertInstanceGroup(request); @@ -633,21 +677,28 @@ public final Operation insertInstanceGroup(ZoneName zone, InstanceGroup instance *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
-   *   Operation response = instanceGroupClient.insertInstanceGroup(zone.toString(), instanceGroupResource);
+   *   Operation response = instanceGroupClient.insertInstanceGroup(zone.toString(), requestId, instanceGroupResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the instance group. - * @param instanceGroupResource + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroup(String zone, InstanceGroup instanceGroupResource) { + public final Operation insertInstanceGroup(String zone, String requestId, InstanceGroup instanceGroupResource) { InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder() .setZone(zone) + .setRequestId(requestId) .setInstanceGroupResource(instanceGroupResource) .build(); return insertInstanceGroup(request); @@ -661,9 +712,11 @@ public final Operation insertInstanceGroup(String zone, InstanceGroup instanceGr *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setInstanceGroupResource(instanceGroupResource)
    *     .build();
    *   Operation response = instanceGroupClient.insertInstanceGroup(request);
@@ -686,9 +739,11 @@ public final Operation insertInstanceGroup(InsertInstanceGroupHttpRequest reques
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setInstanceGroupResource(instanceGroupResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupClient.insertInstanceGroupCallable().futureCall(request);
@@ -984,24 +1039,33 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource);
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the specified instances will be removed. * @param instanceGroupsRemoveInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstancesInstanceGroup(InstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + public final Operation removeInstancesInstanceGroup(String requestId, InstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource) .build(); @@ -1012,24 +1076,33 @@ public final Operation removeInstancesInstanceGroup(InstanceGroupName instanceGr /** * 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: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(instanceGroup.toString(), instanceGroupsRemoveInstancesRequestResource);
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsRemoveInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the specified instances will be removed. * @param instanceGroupsRemoveInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstancesInstanceGroup(String instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + public final Operation removeInstancesInstanceGroup(String requestId, String instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource) .build(); @@ -1040,12 +1113,16 @@ public final Operation removeInstancesInstanceGroup(String instanceGroup, Instan /** * 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: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource)
    *     .build();
@@ -1065,12 +1142,16 @@ public final Operation removeInstancesInstanceGroup(RemoveInstancesInstanceGroup
   /**
    * 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:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource)
    *     .build();
@@ -1092,21 +1173,28 @@ public final UnaryCallable r
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the named ports are updated. * @param instanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsInstanceGroup(InstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsInstanceGroup(String requestId, InstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource) .build(); @@ -1120,21 +1208,28 @@ public final Operation setNamedPortsInstanceGroup(InstanceGroupName instanceGrou * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(instanceGroup.toString(), instanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the named ports are updated. * @param instanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsInstanceGroup(String instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsInstanceGroup(String requestId, String instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource) .build(); @@ -1148,9 +1243,11 @@ public final Operation setNamedPortsInstanceGroup(String instanceGroup, Instance * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource)
    *     .build();
@@ -1173,9 +1270,11 @@ public final Operation setNamedPortsInstanceGroup(SetNamedPortsInstanceGroupHttp
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java
index c37ae7dacc99..59b59460690f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java
@@ -37,6 +37,7 @@ public final class InstanceGroupList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private InstanceGroupList() {
     this.id = null;
@@ -44,6 +45,7 @@ private InstanceGroupList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private InstanceGroupList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(InstanceGroupList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(InstanceGroupList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public InstanceGroupList build() {
 
 
 
 
+
       return new InstanceGroupList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java
index 4ffb882381ce..3523709d86db 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +52,7 @@ private InstanceGroupManagerActionsSummary() {
     this.restarting = null;
   }
 
+
   private InstanceGroupManagerActionsSummary(
       Integer abandoning,
       Integer creating,
@@ -57,7 +61,8 @@ private InstanceGroupManagerActionsSummary(
       Integer none,
       Integer recreating,
       Integer refreshing,
-      Integer restarting) {
+      Integer restarting
+      ) {
     this.abandoning = abandoning;
     this.creating = creating;
     this.creatingWithoutRetries = creatingWithoutRetries;
@@ -78,9 +83,7 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("creating", Collections.singletonList(String.valueOf(creating)));
     }
     if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) {
-      fieldMap.put(
-          "creatingWithoutRetries",
-          Collections.singletonList(String.valueOf(creatingWithoutRetries)));
+      fieldMap.put("creatingWithoutRetries", Collections.singletonList(String.valueOf(creatingWithoutRetries)));
     }
     if (fieldNames.contains("deleting") && deleting != null) {
       fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting)));
@@ -167,24 +170,22 @@ public Integer getRestarting() {
     return restarting;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(InstanceGroupManagerActionsSummary prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static InstanceGroupManagerActionsSummary getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final InstanceGroupManagerActionsSummary DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new InstanceGroupManagerActionsSummary();
   }
@@ -313,17 +314,25 @@ public Builder setRestarting(Integer restarting) {
       return this;
     }
 
+
     public InstanceGroupManagerActionsSummary build() {
 
+
+
+
+
+
+
       return new InstanceGroupManagerActionsSummary(
-          abandoning,
-          creating,
-          creatingWithoutRetries,
-          deleting,
-          none,
-          recreating,
-          refreshing,
-          restarting);
+        abandoning,
+        creating,
+        creatingWithoutRetries,
+        deleting,
+        none,
+        recreating,
+        refreshing,
+        restarting
+      );
     }
 
     public Builder clone() {
@@ -343,29 +352,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "InstanceGroupManagerActionsSummary{"
-        + "abandoning="
-        + abandoning
-        + ", "
-        + "creating="
-        + creating
-        + ", "
-        + "creatingWithoutRetries="
-        + creatingWithoutRetries
-        + ", "
-        + "deleting="
-        + deleting
-        + ", "
-        + "none="
-        + none
-        + ", "
-        + "recreating="
-        + recreating
-        + ", "
-        + "refreshing="
-        + refreshing
-        + ", "
-        + "restarting="
-        + restarting
+        + "abandoning=" + abandoning + ", "
+        + "creating=" + creating + ", "
+        + "creatingWithoutRetries=" + creatingWithoutRetries + ", "
+        + "deleting=" + deleting + ", "
+        + "none=" + none + ", "
+        + "recreating=" + recreating + ", "
+        + "refreshing=" + refreshing + ", "
+        + "restarting=" + restarting
         + "}";
   }
 
@@ -376,14 +370,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof InstanceGroupManagerActionsSummary) {
       InstanceGroupManagerActionsSummary that = (InstanceGroupManagerActionsSummary) o;
-      return Objects.equals(this.abandoning, that.getAbandoning())
-          && Objects.equals(this.creating, that.getCreating())
-          && Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries())
-          && Objects.equals(this.deleting, that.getDeleting())
-          && Objects.equals(this.none, that.getNone())
-          && Objects.equals(this.recreating, that.getRecreating())
-          && Objects.equals(this.refreshing, that.getRefreshing())
-          && Objects.equals(this.restarting, that.getRestarting());
+      return
+          Objects.equals(this.abandoning, that.getAbandoning()) &&
+          Objects.equals(this.creating, that.getCreating()) &&
+          Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries()) &&
+          Objects.equals(this.deleting, that.getDeleting()) &&
+          Objects.equals(this.none, that.getNone()) &&
+          Objects.equals(this.recreating, that.getRecreating()) &&
+          Objects.equals(this.refreshing, that.getRefreshing()) &&
+          Objects.equals(this.restarting, that.getRestarting())
+          ;
     }
     return false;
   }
@@ -391,13 +387,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        abandoning,
-        creating,
-        creatingWithoutRetries,
-        deleting,
-        none,
-        recreating,
-        refreshing,
-        restarting);
+      abandoning,
+      creating,
+      creatingWithoutRetries,
+      deleting,
+      none,
+      recreating,
+      refreshing,
+      restarting
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java
index 140d7f521f4f..47df696c2b98 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java
@@ -37,6 +37,7 @@ public final class InstanceGroupManagerAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private InstanceGroupManagerAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private InstanceGroupManagerAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private InstanceGroupManagerAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(InstanceGroupManagerAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(InstanceGroupManagerAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public InstanceGroupManagerAggregatedList build() {
 
 
 
 
+
       return new InstanceGroupManagerAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
index 5a6559e893d0..23818fc071f4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
@@ -23,12 +23,22 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.InstanceGroupManagerStub;
 import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -42,41 +52,42 @@
  * 
  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+ *   String requestId = "";
  *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
  *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up - * resources such as threads. In the example above, try-with-resources is used, which automatically - * calls close(). + *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * - *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings - * to create(). For example: + *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings to + * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -106,23 +117,27 @@ public class InstanceGroupManagerClient implements BackgroundResource {
   private final InstanceGroupManagerSettings settings;
   private final InstanceGroupManagerStub stub;
 
-  /** Constructs an instance of InstanceGroupManagerClient with default settings. */
+
+
+  /**
+   * Constructs an instance of InstanceGroupManagerClient with default settings.
+   */
   public static final InstanceGroupManagerClient create() throws IOException {
     return create(InstanceGroupManagerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given settings. The channels
-   * are created based on the settings passed in, or defaults for any settings that are not set.
+   * Constructs an instance of InstanceGroupManagerClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
-  public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings)
-      throws IOException {
+  public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings) throws IOException {
     return new InstanceGroupManagerClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls.
-   * This is for advanced usage - prefer to use InstanceGroupManagerSettings}.
+   * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls. This is for
+   * advanced usage - prefer to use InstanceGroupManagerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceGroupManagerClient create(InstanceGroupManagerStub stub) {
@@ -130,9 +145,9 @@ public static final InstanceGroupManagerClient create(InstanceGroupManagerStub s
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given settings. This is
-   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
-   * should be preferred.
+   * Constructs an instance of InstanceGroupManagerClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
   protected InstanceGroupManagerClient(InstanceGroupManagerSettings settings) throws IOException {
     this.settings = settings;
@@ -154,102 +169,101 @@ public InstanceGroupManagerStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesInstanceGroupManager( - InstanceGroupManagerName instanceGroupManager, - InstanceGroupManagersAbandonInstancesRequest - instanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersAbandonInstancesRequestResource( - instanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesInstanceGroupManager( - String instanceGroupManager, - InstanceGroupManagersAbandonInstancesRequest - instanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersAbandonInstancesRequestResource( - instanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -261,28 +275,26 @@ public final Operation abandonInstancesInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesInstanceGroupManager(
-      AbandonInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInstanceGroupManagerHttpRequest request) {
     return abandonInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -293,8 +305,7 @@ public final Operation abandonInstancesInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - abandonInstancesInstanceGroupManagerCallable() { + public final UnaryCallable abandonInstancesInstanceGroupManagerCallable() { return stub.abandonInstancesInstanceGroupManagerCallable(); } @@ -302,8 +313,7 @@ public final Operation abandonInstancesInstanceGroupManager( /** * Retrieves the list of managed instance groups and groups them by zone. * - *

Sample code: - * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -317,12 +327,11 @@ public final Operation abandonInstancesInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
-      ProjectName project) {
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(ProjectName project) {
     AggregatedListInstanceGroupManagersHttpRequest request =
         AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
-            .setProject(project == null ? null : project.toString())
-            .build();
+        .setProject(project == null ? null : project.toString())
+        .build();
     return aggregatedListInstanceGroupManagers(request);
   }
 
@@ -330,8 +339,7 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -345,10 +353,11 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
-      String project) {
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(String project) {
     AggregatedListInstanceGroupManagersHttpRequest request =
-        AggregatedListInstanceGroupManagersHttpRequest.newBuilder().setProject(project).build();
+        AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
+        .setProject(project)
+        .build();
     return aggregatedListInstanceGroupManagers(request);
   }
 
@@ -356,8 +365,7 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -374,17 +382,16 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
-      AggregatedListInstanceGroupManagersHttpRequest request) {
-    return aggregatedListInstanceGroupManagersPagedCallable().call(request);
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(AggregatedListInstanceGroupManagersHttpRequest request) {
+    return aggregatedListInstanceGroupManagersPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -400,10 +407,7 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * 
*/ @BetaApi - public final UnaryCallable< - AggregatedListInstanceGroupManagersHttpRequest, - AggregatedListInstanceGroupManagersPagedResponse> - aggregatedListInstanceGroupManagersPagedCallable() { + public final UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { return stub.aggregatedListInstanceGroupManagersPagedCallable(); } @@ -411,8 +415,7 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst /** * Retrieves the list of managed instance groups and groups them by zone. * - *

Sample code: - * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -435,81 +438,85 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * 
*/ @BetaApi - public final UnaryCallable< - AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> - aggregatedListInstanceGroupManagersCallable() { + public final UnaryCallable aggregatedListInstanceGroupManagersCallable() { return stub.aggregatedListInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(instanceGroupManager);
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(requestId, instanceGroupManager);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroupManager(InstanceGroupManagerName instanceGroupManager) { + public final Operation deleteInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager) { DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return deleteInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(instanceGroupManager.toString());
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(requestId, instanceGroupManager.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroupManager(String instanceGroupManager) { + public final Operation deleteInstanceGroupManager(String requestId, String instanceGroupManager) { DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return deleteInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(request);
@@ -526,16 +533,15 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupManagerClient.deleteInstanceGroupManagerCallable().futureCall(request);
@@ -545,104 +551,104 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable - deleteInstanceGroupManagerCallable() { + public final UnaryCallable deleteInstanceGroupManagerCallable() { return stub.deleteInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesInstanceGroupManager( - InstanceGroupManagerName instanceGroupManager, - InstanceGroupManagersDeleteInstancesRequest - instanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersDeleteInstancesRequestResource( - instanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesInstanceGroupManager( - String instanceGroupManager, - InstanceGroupManagersDeleteInstancesRequest - instanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersDeleteInstancesRequestResource( - instanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -654,27 +660,26 @@ public final Operation deleteInstancesInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesInstanceGroupManager(
-      DeleteInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstanceGroupManagerHttpRequest request) {
     return deleteInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -685,18 +690,15 @@ public final Operation deleteInstancesInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - deleteInstancesInstanceGroupManagerCallable() { + public final UnaryCallable deleteInstancesInstanceGroupManagerCallable() { return stub.deleteInstancesInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available - * managed instance groups by making a list() request. - * - *

Sample code: + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -708,24 +710,20 @@ public final Operation deleteInstancesInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getInstanceGroupManager(
-      InstanceGroupManagerName instanceGroupManager) {
+  public final InstanceGroupManager getInstanceGroupManager(InstanceGroupManagerName instanceGroupManager) {
 
     GetInstanceGroupManagerHttpRequest request =
         GetInstanceGroupManagerHttpRequest.newBuilder()
-            .setInstanceGroupManager(
-                instanceGroupManager == null ? null : instanceGroupManager.toString())
-            .build();
+        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
+        .build();
     return getInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available
-   * managed instance groups by making a list() request.
-   *
-   * 

Sample code: + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -741,18 +739,16 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa
 
     GetInstanceGroupManagerHttpRequest request =
         GetInstanceGroupManagerHttpRequest.newBuilder()
-            .setInstanceGroupManager(instanceGroupManager)
-            .build();
+        .setInstanceGroupManager(instanceGroupManager)
+        .build();
     return getInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available
-   * managed instance groups by making a list() request.
-   *
-   * 

Sample code: + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -767,18 +763,15 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getInstanceGroupManager(
-      GetInstanceGroupManagerHttpRequest request) {
+  public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManagerHttpRequest request) {
     return getInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available
-   * managed instance groups by making a list() request.
-   *
-   * 

Sample code: + * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -792,95 +785,99 @@ public final InstanceGroupManager getInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - getInstanceGroupManagerCallable() { + public final UnaryCallable getInstanceGroupManagerCallable() { return stub.getInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After - * the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone, instanceGroupManagerResource);
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the managed instance group. - * @param instanceGroupManagerResource An Instance Group Manager resource. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroupManager( - ZoneName zone, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertInstanceGroupManager(ZoneName zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After - * the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone.toString(), instanceGroupManagerResource);
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone.toString(), requestId, instanceGroupManagerResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the managed instance group. - * @param instanceGroupManagerResource An Instance Group Manager resource. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroupManager( - String zone, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertInstanceGroupManager(String zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder() - .setZone(zone) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setZone(zone) + .setRequestId(requestId) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After - * the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
    *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(request);
@@ -897,20 +894,19 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After
-   * the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
    *
-   * 

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupManagerClient.insertInstanceGroupManagerCallable().futureCall(request);
@@ -920,18 +916,15 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable - insertInstanceGroupManagerCallable() { + public final UnaryCallable insertInstanceGroupManagerCallable() { return stub.insertInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of managed instance groups that are contained within the specified project and - * zone. - * - *

Sample code: + * Retrieves a list of managed instance groups that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -948,18 +941,16 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
   public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ZoneName zone) {
     ListInstanceGroupManagersHttpRequest request =
         ListInstanceGroupManagersHttpRequest.newBuilder()
-            .setZone(zone == null ? null : zone.toString())
-            .build();
+        .setZone(zone == null ? null : zone.toString())
+        .build();
     return listInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and
-   * zone.
-   *
-   * 

Sample code: + * Retrieves a list of managed instance groups that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -975,17 +966,17 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Zo
   @BetaApi
   public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(String zone) {
     ListInstanceGroupManagersHttpRequest request =
-        ListInstanceGroupManagersHttpRequest.newBuilder().setZone(zone).build();
+        ListInstanceGroupManagersHttpRequest.newBuilder()
+        .setZone(zone)
+        .build();
     return listInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and
-   * zone.
-   *
-   * 

Sample code: + * Retrieves a list of managed instance groups that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -1002,18 +993,16 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
-      ListInstanceGroupManagersHttpRequest request) {
-    return listInstanceGroupManagersPagedCallable().call(request);
+  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ListInstanceGroupManagersHttpRequest request) {
+    return listInstanceGroupManagersPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and
-   * zone.
-   *
-   * 

Sample code: + * Retrieves a list of managed instance groups that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -1029,19 +1018,15 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    * 
*/ @BetaApi - public final UnaryCallable< - ListInstanceGroupManagersHttpRequest, ListInstanceGroupManagersPagedResponse> - listInstanceGroupManagersPagedCallable() { + public final UnaryCallable listInstanceGroupManagersPagedCallable() { return stub.listInstanceGroupManagersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of managed instance groups that are contained within the specified project and - * zone. - * - *

Sample code: + * Retrieves a list of managed instance groups that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
@@ -1064,20 +1049,15 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    * 
*/ @BetaApi - public final UnaryCallable - listInstanceGroupManagersCallable() { + public final UnaryCallable listInstanceGroupManagersCallable() { return stub.listInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. - * - *

Sample code: + * 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. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1089,26 +1069,20 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse
-      listManagedInstancesInstanceGroupManagers(InstanceGroupManagerName instanceGroupManager) {
+  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(InstanceGroupManagerName instanceGroupManager) {
 
     ListManagedInstancesInstanceGroupManagersHttpRequest request =
         ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
-            .setInstanceGroupManager(
-                instanceGroupManager == null ? null : instanceGroupManager.toString())
-            .build();
+        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
+        .build();
     return listManagedInstancesInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
-   *
-   * 

Sample code: + * 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. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1120,25 +1094,20 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse
-      listManagedInstancesInstanceGroupManagers(String instanceGroupManager) {
+  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(String instanceGroupManager) {
 
     ListManagedInstancesInstanceGroupManagersHttpRequest request =
         ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
-            .setInstanceGroupManager(instanceGroupManager)
-            .build();
+        .setInstanceGroupManager(instanceGroupManager)
+        .build();
     return listManagedInstancesInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
-   *
-   * 

Sample code: + * 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. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1153,21 +1122,15 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse
-      listManagedInstancesInstanceGroupManagers(
-          ListManagedInstancesInstanceGroupManagersHttpRequest request) {
+  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(ListManagedInstancesInstanceGroupManagersHttpRequest request) {
     return listManagedInstancesInstanceGroupManagersCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
-   *
-   * 

Sample code: + * 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. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1181,103 +1144,104 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    * 
*/ @BetaApi - public final UnaryCallable< - ListManagedInstancesInstanceGroupManagersHttpRequest, - InstanceGroupManagersListManagedInstancesResponse> - listManagedInstancesInstanceGroupManagersCallable() { + public final UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { return stub.listManagedInstancesInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The - * instances are deleted and recreated using the current instance template for the managed - * instance group. This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersRecreateInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesInstanceGroupManager( - InstanceGroupManagerName instanceGroupManager, - InstanceGroupManagersRecreateInstancesRequest - instanceGroupManagersRecreateInstancesRequestResource) { + public final Operation recreateInstancesInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersRecreateInstancesRequestResource( - instanceGroupManagersRecreateInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource) + .build(); return recreateInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The - * instances are deleted and recreated using the current instance template for the managed - * instance group. This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersRecreateInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersRecreateInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersRecreateInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesInstanceGroupManager( - String instanceGroupManager, - InstanceGroupManagersRecreateInstancesRequest - instanceGroupManagersRecreateInstancesRequestResource) { + public final Operation recreateInstancesInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersRecreateInstancesRequestResource( - instanceGroupManagersRecreateInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource) + .build(); return recreateInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The - * instances are deleted and recreated using the current instance template for the managed - * instance group. This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
    *     .build();
@@ -1289,26 +1253,26 @@ public final Operation recreateInstancesInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesInstanceGroupManager(
-      RecreateInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesInstanceGroupManagerHttpRequest request) {
     return recreateInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The
-   * instances are deleted and recreated using the current instance template for the managed
-   * instance group. This operation is marked as DONE when the action is scheduled even if the
-   * instances have not yet been recreated. You must separately verify the status of the recreating
-   * action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
    *
-   * 

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
    *     .build();
@@ -1319,99 +1283,99 @@ public final Operation recreateInstancesInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - recreateInstancesInstanceGroupManagerCallable() { + public final UnaryCallable recreateInstancesInstanceGroupManagerCallable() { return stub.recreateInstancesInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, instanceGroupManager);
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, requestId, instanceGroupManager);
    * }
    * 
* - * @param 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 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 requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeInstanceGroupManager( - Integer size, InstanceGroupManagerName instanceGroupManager) { + public final Operation resizeInstanceGroupManager(Integer size, String requestId, InstanceGroupManagerName instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return resizeInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, instanceGroupManager.toString());
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, requestId, instanceGroupManager.toString());
    * }
    * 
* - * @param 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 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 requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) { + public final Operation resizeInstanceGroupManager(Integer size, String requestId, String instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return resizeInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. * - *

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(request);
@@ -1428,20 +1392,19 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
    *
-   * 

Sample code: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupManagerClient.resizeInstanceGroupManagerCallable().futureCall(request);
@@ -1451,92 +1414,92 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable - resizeInstanceGroupManagerCallable() { + public final UnaryCallable resizeInstanceGroupManagerCallable() { return stub.resizeInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. - * - *

Sample code: + * 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 recreate them. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetInstanceTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateInstanceGroupManager( - InstanceGroupManagerName instanceGroupManager, - InstanceGroupManagersSetInstanceTemplateRequest - instanceGroupManagersSetInstanceTemplateRequestResource) { + public final Operation setInstanceTemplateInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersSetInstanceTemplateRequestResource( - instanceGroupManagersSetInstanceTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource) + .build(); return setInstanceTemplateInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. - * - *

Sample code: + * 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 recreate them. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersSetInstanceTemplateRequestResource);
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersSetInstanceTemplateRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetInstanceTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateInstanceGroupManager( - String instanceGroupManager, - InstanceGroupManagersSetInstanceTemplateRequest - instanceGroupManagersSetInstanceTemplateRequestResource) { + public final Operation setInstanceTemplateInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersSetInstanceTemplateRequestResource( - instanceGroupManagersSetInstanceTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource) + .build(); return setInstanceTemplateInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. - * - *

Sample code: + * 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 recreate them. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
    *     .build();
@@ -1548,23 +1511,22 @@ public final Operation setInstanceTemplateInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateInstanceGroupManager(
-      SetInstanceTemplateInstanceGroupManagerHttpRequest request) {
+  public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTemplateInstanceGroupManagerHttpRequest request) {
     return setInstanceTemplateInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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 recreate them.
-   *
-   * 

Sample code: + * 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 recreate them. * + * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
    *     .build();
@@ -1575,101 +1537,92 @@ public final Operation setInstanceTemplateInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - setInstanceTemplateInstanceGroupManagerCallable() { + public final UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { return stub.setInstanceTemplateInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsInstanceGroupManager( - InstanceGroupManagerName instanceGroupManager, - InstanceGroupManagersSetTargetPoolsRequest - instanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersSetTargetPoolsRequestResource( - instanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsInstanceGroupManager( - String instanceGroupManager, - InstanceGroupManagersSetTargetPoolsRequest - instanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersSetTargetPoolsRequestResource( - instanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
@@ -1681,26 +1634,22 @@ public final Operation setTargetPoolsInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsInstanceGroupManager(
-      SetTargetPoolsInstanceGroupManagerHttpRequest request) {
+  public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstanceGroupManagerHttpRequest request) {
     return setTargetPoolsInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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: + * 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: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
@@ -1711,8 +1660,7 @@ public final Operation setTargetPoolsInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - setTargetPoolsInstanceGroupManagerCallable() { + public final UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { return stub.setTargetPoolsInstanceGroupManagerCallable(); } @@ -1746,56 +1694,43 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListInstanceGroupManagersPagedResponse - extends AbstractPagedListResponse< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersFixedSizeCollection> { + public static class AggregatedListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList> - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListInstanceGroupManagersPage.createEmptyPage() - .createPageAsync(context, futureResponse); + AggregatedListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction< - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersPagedResponse>() { + new ApiFunction() { @Override - public AggregatedListInstanceGroupManagersPagedResponse apply( - AggregatedListInstanceGroupManagersPage input) { + public AggregatedListInstanceGroupManagersPagedResponse apply(AggregatedListInstanceGroupManagersPage input) { return new AggregatedListInstanceGroupManagersPagedResponse(input); } }); } - private AggregatedListInstanceGroupManagersPagedResponse( - AggregatedListInstanceGroupManagersPage page) { + private AggregatedListInstanceGroupManagersPagedResponse(AggregatedListInstanceGroupManagersPage page) { super(page, AggregatedListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } + + } - public static class AggregatedListInstanceGroupManagersPage - extends AbstractPage< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage> { + public static class AggregatedListInstanceGroupManagersPage extends AbstractPage< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage> { private AggregatedListInstanceGroupManagersPage( - PageContext< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList> - context, + PageContext context, InstanceGroupManagerAggregatedList response) { super(context, response); } @@ -1806,37 +1741,31 @@ private static AggregatedListInstanceGroupManagersPage createEmptyPage() { @Override protected AggregatedListInstanceGroupManagersPage createPage( - PageContext< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList> - context, + PageContext context, InstanceGroupManagerAggregatedList response) { return new AggregatedListInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList> - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class AggregatedListInstanceGroupManagersFixedSizeCollection - extends AbstractFixedSizeCollection< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersFixedSizeCollection> { + public static class AggregatedListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListInstanceGroupManagersHttpRequest, + InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { - private AggregatedListInstanceGroupManagersFixedSizeCollection( - List pages, int collectionSize) { + private AggregatedListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -1849,22 +1778,18 @@ protected AggregatedListInstanceGroupManagersFixedSizeCollection createCollectio List pages, int collectionSize) { return new AggregatedListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - } - public static class ListInstanceGroupManagersPagedResponse - extends AbstractPagedListResponse< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage, - ListInstanceGroupManagersFixedSizeCollection> { + + } + public static class ListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage, + ListInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1872,8 +1797,7 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public ListInstanceGroupManagersPagedResponse apply( - ListInstanceGroupManagersPage input) { + public ListInstanceGroupManagersPagedResponse apply(ListInstanceGroupManagersPage input) { return new ListInstanceGroupManagersPagedResponse(input); } }); @@ -1882,21 +1806,18 @@ public ListInstanceGroupManagersPagedResponse apply( private ListInstanceGroupManagersPagedResponse(ListInstanceGroupManagersPage page) { super(page, ListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } + + } - public static class ListInstanceGroupManagersPage - extends AbstractPage< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage> { + public static class ListInstanceGroupManagersPage extends AbstractPage< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage> { private ListInstanceGroupManagersPage( - PageContext< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, InstanceGroupManagerList response) { super(context, response); } @@ -1907,37 +1828,31 @@ private static ListInstanceGroupManagersPage createEmptyPage() { @Override protected ListInstanceGroupManagersPage createPage( - PageContext< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, InstanceGroupManagerList response) { return new ListInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class ListInstanceGroupManagersFixedSizeCollection - extends AbstractFixedSizeCollection< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage, - ListInstanceGroupManagersFixedSizeCollection> { + public static class ListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstanceGroupManagersHttpRequest, + InstanceGroupManagerList, + InstanceGroupManager, + ListInstanceGroupManagersPage, + ListInstanceGroupManagersFixedSizeCollection> { - private ListInstanceGroupManagersFixedSizeCollection( - List pages, int collectionSize) { + private ListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -1950,5 +1865,7 @@ protected ListInstanceGroupManagersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } + + } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java index 0d0aabf5656f..eb82383a883d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java @@ -37,6 +37,7 @@ public final class InstanceGroupManagerList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private InstanceGroupManagerList() { this.id = null; @@ -44,6 +45,7 @@ private InstanceGroupManagerList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private InstanceGroupManagerList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(InstanceGroupManagerList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(InstanceGroupManagerList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public InstanceGroupManagerList build() { + return new InstanceGroupManagerList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java index f04b44de351c..db04a2b850a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class InstanceGroupManagerName implements ResourceName { +public final class InstanceGroupManagerName implements com.google.api.resourcenames.ResourceName { private final String instanceGroupManager; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java index fc1c10813ebd..2533830b5eb0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class InstanceGroupName implements ResourceName { +public final class InstanceGroupName implements com.google.api.resourcenames.ResourceName { private final String instanceGroup; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java index 569beeba057b..2a2788e688f9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java @@ -15,25 +15,47 @@ */ package com.google.cloud.compute.v1; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; - import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; +import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -42,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default - * port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: * *

  * 
@@ -65,98 +87,112 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceGroupSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to addInstancesInstanceGroup. */
-  public UnaryCallSettings
-      addInstancesInstanceGroupSettings() {
+  /**
+   * Returns the object with the settings used for calls to addInstancesInstanceGroup.
+   */
+  public UnaryCallSettings addInstancesInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).addInstancesInstanceGroupSettings();
   }
 
-  /** Returns the object with the settings used for calls to aggregatedListInstanceGroups. */
-  public PagedCallSettings<
-          AggregatedListInstanceGroupsHttpRequest,
-          InstanceGroupAggregatedList,
-          AggregatedListInstanceGroupsPagedResponse>
-      aggregatedListInstanceGroupsSettings() {
+  /**
+   * Returns the object with the settings used for calls to aggregatedListInstanceGroups.
+   */
+  public PagedCallSettings aggregatedListInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).aggregatedListInstanceGroupsSettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteInstanceGroup. */
-  public UnaryCallSettings
-      deleteInstanceGroupSettings() {
+  /**
+   * Returns the object with the settings used for calls to deleteInstanceGroup.
+   */
+  public UnaryCallSettings deleteInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).deleteInstanceGroupSettings();
   }
 
-  /** Returns the object with the settings used for calls to getInstanceGroup. */
+  /**
+   * Returns the object with the settings used for calls to getInstanceGroup.
+   */
   public UnaryCallSettings getInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).getInstanceGroupSettings();
   }
 
-  /** Returns the object with the settings used for calls to insertInstanceGroup. */
-  public UnaryCallSettings
-      insertInstanceGroupSettings() {
+  /**
+   * Returns the object with the settings used for calls to insertInstanceGroup.
+   */
+  public UnaryCallSettings insertInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).insertInstanceGroupSettings();
   }
 
-  /** Returns the object with the settings used for calls to listInstanceGroups. */
-  public PagedCallSettings<
-          ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
-      listInstanceGroupsSettings() {
+  /**
+   * Returns the object with the settings used for calls to listInstanceGroups.
+   */
+  public PagedCallSettings listInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).listInstanceGroupsSettings();
   }
 
-  /** Returns the object with the settings used for calls to listInstancesInstanceGroups. */
-  public PagedCallSettings<
-          ListInstancesInstanceGroupsHttpRequest,
-          InstanceGroupsListInstances,
-          ListInstancesInstanceGroupsPagedResponse>
-      listInstancesInstanceGroupsSettings() {
+  /**
+   * Returns the object with the settings used for calls to listInstancesInstanceGroups.
+   */
+  public PagedCallSettings listInstancesInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).listInstancesInstanceGroupsSettings();
   }
 
-  /** Returns the object with the settings used for calls to removeInstancesInstanceGroup. */
-  public UnaryCallSettings
-      removeInstancesInstanceGroupSettings() {
+  /**
+   * Returns the object with the settings used for calls to removeInstancesInstanceGroup.
+   */
+  public UnaryCallSettings removeInstancesInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).removeInstancesInstanceGroupSettings();
   }
 
-  /** Returns the object with the settings used for calls to setNamedPortsInstanceGroup. */
-  public UnaryCallSettings
-      setNamedPortsInstanceGroupSettings() {
+  /**
+   * Returns the object with the settings used for calls to setNamedPortsInstanceGroup.
+   */
+  public UnaryCallSettings setNamedPortsInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).setNamedPortsInstanceGroupSettings();
   }
 
-  public static final InstanceGroupSettings create(InstanceGroupStubSettings stub)
-      throws IOException {
+
+  public static final InstanceGroupSettings create(InstanceGroupStubSettings stub) throws IOException {
     return new InstanceGroupSettings.Builder(stub.toBuilder()).build();
   }
 
-  /** Returns a builder for the default ExecutorProvider for this service. */
+  /**
+   * Returns a builder for the default ExecutorProvider for this service.
+   */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstanceGroupStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /** Returns the default service endpoint. */
-  public static String getDefaultEndpoint() {
-    return InstanceGroupStubSettings.getDefaultEndpoint();
-  }
-  /** Returns the default service port. */
+  /**
+   * Returns the default service endpoint.
+   */
+   public static String getDefaultEndpoint() {
+     return InstanceGroupStubSettings.getDefaultEndpoint();
+   }
+  /**
+   * Returns the default service port.
+   */
   public static int getDefaultServicePort() {
     return InstanceGroupStubSettings.getDefaultServicePort();
   }
 
-  /** Returns the default service scopes. */
+
+  /**
+   * Returns the default service scopes.
+   */
   public static List getDefaultServiceScopes() {
     return InstanceGroupStubSettings.getDefaultServiceScopes();
   }
 
-  /** Returns a builder for the default credentials for this service. */
+
+  /**
+   * Returns a builder for the default credentials for this service.
+   */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InstanceGroupStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder
-      defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
     return InstanceGroupStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -169,17 +205,23 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InstanceGroupStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /** Returns a builder containing all the values of this settings class. */
+  /**
+   * Returns a builder containing all the values of this settings class.
+   */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -188,7 +230,9 @@ protected InstanceGroupSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /** Builder for InstanceGroupSettings. */
+  /**
+   * Builder for InstanceGroupSettings.
+   */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -210,6 +254,7 @@ protected Builder(InstanceGroupStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
+
     public InstanceGroupStubSettings.Builder getStubSettingsBuilder() {
       return ((InstanceGroupStubSettings.Builder) getStubSettings());
     }
@@ -217,73 +262,73 @@ public InstanceGroupStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * 

Note: This method does not support applying settings to streaming methods. + * Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** Returns the builder for the settings used for calls to addInstancesInstanceGroup. */ - public UnaryCallSettings.Builder - addInstancesInstanceGroupSettings() { + /** + * Returns the builder for the settings used for calls to addInstancesInstanceGroup. + */ + public UnaryCallSettings.Builder addInstancesInstanceGroupSettings() { return getStubSettingsBuilder().addInstancesInstanceGroupSettings(); } - /** Returns the builder for the settings used for calls to aggregatedListInstanceGroups. */ - public PagedCallSettings.Builder< - AggregatedListInstanceGroupsHttpRequest, - InstanceGroupAggregatedList, - AggregatedListInstanceGroupsPagedResponse> - aggregatedListInstanceGroupsSettings() { + /** + * Returns the builder for the settings used for calls to aggregatedListInstanceGroups. + */ + public PagedCallSettings.Builder aggregatedListInstanceGroupsSettings() { return getStubSettingsBuilder().aggregatedListInstanceGroupsSettings(); } - /** Returns the builder for the settings used for calls to deleteInstanceGroup. */ - public UnaryCallSettings.Builder - deleteInstanceGroupSettings() { + /** + * Returns the builder for the settings used for calls to deleteInstanceGroup. + */ + public UnaryCallSettings.Builder deleteInstanceGroupSettings() { return getStubSettingsBuilder().deleteInstanceGroupSettings(); } - /** Returns the builder for the settings used for calls to getInstanceGroup. */ - public UnaryCallSettings.Builder - getInstanceGroupSettings() { + /** + * Returns the builder for the settings used for calls to getInstanceGroup. + */ + public UnaryCallSettings.Builder getInstanceGroupSettings() { return getStubSettingsBuilder().getInstanceGroupSettings(); } - /** Returns the builder for the settings used for calls to insertInstanceGroup. */ - public UnaryCallSettings.Builder - insertInstanceGroupSettings() { + /** + * Returns the builder for the settings used for calls to insertInstanceGroup. + */ + public UnaryCallSettings.Builder insertInstanceGroupSettings() { return getStubSettingsBuilder().insertInstanceGroupSettings(); } - /** Returns the builder for the settings used for calls to listInstanceGroups. */ - public PagedCallSettings.Builder< - ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse> - listInstanceGroupsSettings() { + /** + * Returns the builder for the settings used for calls to listInstanceGroups. + */ + public PagedCallSettings.Builder listInstanceGroupsSettings() { return getStubSettingsBuilder().listInstanceGroupsSettings(); } - /** Returns the builder for the settings used for calls to listInstancesInstanceGroups. */ - public PagedCallSettings.Builder< - ListInstancesInstanceGroupsHttpRequest, - InstanceGroupsListInstances, - ListInstancesInstanceGroupsPagedResponse> - listInstancesInstanceGroupsSettings() { + /** + * Returns the builder for the settings used for calls to listInstancesInstanceGroups. + */ + public PagedCallSettings.Builder listInstancesInstanceGroupsSettings() { return getStubSettingsBuilder().listInstancesInstanceGroupsSettings(); } - /** Returns the builder for the settings used for calls to removeInstancesInstanceGroup. */ - public UnaryCallSettings.Builder - removeInstancesInstanceGroupSettings() { + /** + * Returns the builder for the settings used for calls to removeInstancesInstanceGroup. + */ + public UnaryCallSettings.Builder removeInstancesInstanceGroupSettings() { return getStubSettingsBuilder().removeInstancesInstanceGroupSettings(); } - /** Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. */ - public UnaryCallSettings.Builder - setNamedPortsInstanceGroupSettings() { + /** + * Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. + */ + public UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings() { return getStubSettingsBuilder().setNamedPortsInstanceGroupSettings(); } @@ -292,4 +337,4 @@ public InstanceGroupSettings build() throws IOException { return new InstanceGroupSettings(this); } } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java index 52068beed867..2ee64af07096 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java @@ -37,6 +37,7 @@ public final class InstanceGroupsListInstances implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private InstanceGroupsListInstances() { this.id = null; @@ -44,6 +45,7 @@ private InstanceGroupsListInstances() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private InstanceGroupsListInstances( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(InstanceGroupsListInstances other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(InstanceGroupsListInstances other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public InstanceGroupsListInstances build() { + return new InstanceGroupsListInstances( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java index e08eb75e9557..88869b5cd248 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java @@ -18,7 +18,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,7 +38,10 @@ private InstanceGroupsRemoveInstancesRequest() { this.instances = null; } - private InstanceGroupsRemoveInstancesRequest(List instances) { + + private InstanceGroupsRemoveInstancesRequest( + List instances + ) { this.instances = instances; } @@ -71,24 +76,22 @@ public List getInstancesList() { return instances; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(InstanceGroupsRemoveInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsRemoveInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final InstanceGroupsRemoveInstancesRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new InstanceGroupsRemoveInstancesRequest(); } @@ -127,8 +130,11 @@ public Builder addInstances(InstanceReference instances) { return this; } + public InstanceGroupsRemoveInstancesRequest build() { - return new InstanceGroupsRemoveInstancesRequest(instances); + return new InstanceGroupsRemoveInstancesRequest( + instances + ); } public Builder clone() { @@ -140,7 +146,9 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupsRemoveInstancesRequest{" + "instances=" + instances + "}"; + return "InstanceGroupsRemoveInstancesRequest{" + + "instances=" + instances + + "}"; } @Override @@ -150,13 +158,17 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsRemoveInstancesRequest) { InstanceGroupsRemoveInstancesRequest that = (InstanceGroupsRemoveInstancesRequest) o; - return Objects.equals(this.instances, that.getInstancesList()); + return + Objects.equals(this.instances, that.getInstancesList()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(instances); + return Objects.hash( + instances + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java index ccc3838cf334..9c2d9179488a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java @@ -37,6 +37,7 @@ public final class InstanceList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private InstanceList() { this.id = null; @@ -44,6 +45,7 @@ private InstanceList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private InstanceList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(InstanceList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(InstanceList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public InstanceList build() { + return new InstanceList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java new file mode 100644 index 000000000000..060142fee1ff --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceListReferrers implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private InstanceListReferrers() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private InstanceListReferrers( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Reference item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstanceListReferrers prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceListReferrers getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstanceListReferrers DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstanceListReferrers(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InstanceListReferrers other) { + if (other == InstanceListReferrers.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InstanceListReferrers source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Reference items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InstanceListReferrers build() { + + + + + + return new InstanceListReferrers( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceListReferrers{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceListReferrers) { + InstanceListReferrers that = (InstanceListReferrers) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java index de89835b85de..d89dd3dc6a0c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class InstanceName implements ResourceName { +public final class InstanceName implements com.google.api.resourcenames.ResourceName { private final String instance; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java index a0fd9ca11277..20b2f00fc34d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java @@ -35,8 +35,11 @@ public final class InstanceProperties implements ApiMessage { private final Boolean canIpForward; private final String description; private final List disks; + private final List guestAccelerators; + private final Map labels; private final String machineType; private final Metadata metadata; + private final String minCpuPlatform; private final List networkInterfaces; private final Scheduling scheduling; private final List serviceAccounts; @@ -46,8 +49,11 @@ private InstanceProperties() { this.canIpForward = null; this.description = null; this.disks = null; + this.guestAccelerators = null; + this.labels = null; this.machineType = null; this.metadata = null; + this.minCpuPlatform = null; this.networkInterfaces = null; this.scheduling = null; this.serviceAccounts = null; @@ -59,8 +65,11 @@ private InstanceProperties( Boolean canIpForward, String description, List disks, + List guestAccelerators, + Map labels, String machineType, Metadata metadata, + String minCpuPlatform, List networkInterfaces, Scheduling scheduling, List serviceAccounts, @@ -69,8 +78,11 @@ private InstanceProperties( this.canIpForward = canIpForward; this.description = description; this.disks = disks; + this.guestAccelerators = guestAccelerators; + this.labels = labels; this.machineType = machineType; this.metadata = metadata; + this.minCpuPlatform = minCpuPlatform; this.networkInterfaces = networkInterfaces; this.scheduling = scheduling; this.serviceAccounts = serviceAccounts; @@ -93,12 +105,25 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("disks", stringList.build()); } + if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorConfig item : guestAccelerators) { + stringList.add(item.toString()); + } + fieldMap.put("guestAccelerators", stringList.build()); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } if (fieldNames.contains("machineType") && machineType != null) { fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); } if (fieldNames.contains("metadata") && metadata != null) { fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); } + if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { + fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); + } if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { ImmutableList.Builder stringList = ImmutableList.builder(); for (NetworkInterface item : networkInterfaces) { @@ -133,12 +158,21 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("disks")) { return String.valueOf(disks); } + if (fieldName.equals("guestAccelerators")) { + return String.valueOf(guestAccelerators); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } if (fieldName.equals("machineType")) { return String.valueOf(machineType); } if (fieldName.equals("metadata")) { return String.valueOf(metadata); } + if (fieldName.equals("minCpuPlatform")) { + return String.valueOf(minCpuPlatform); + } if (fieldName.equals("networkInterfaces")) { return String.valueOf(networkInterfaces); } @@ -172,6 +206,14 @@ public List getDisksList() { return disks; } + public List getGuestAcceleratorsList() { + return guestAccelerators; + } + + public Map getLabelsMap() { + return labels; + } + public String getMachineType() { return machineType; } @@ -180,6 +222,10 @@ public Metadata getMetadata() { return metadata; } + public String getMinCpuPlatform() { + return minCpuPlatform; + } + public List getNetworkInterfacesList() { return networkInterfaces; } @@ -220,8 +266,11 @@ public static class Builder { private Boolean canIpForward; private String description; private List disks; + private List guestAccelerators; + private Map labels; private String machineType; private Metadata metadata; + private String minCpuPlatform; private List networkInterfaces; private Scheduling scheduling; private List serviceAccounts; @@ -240,12 +289,21 @@ public Builder mergeFrom(InstanceProperties other) { if (other.getDisksList() != null) { this.disks = other.disks; } + if (other.getGuestAcceleratorsList() != null) { + this.guestAccelerators = other.guestAccelerators; + } + if (other.getLabelsMap() != null) { + this.labels = other.labels; + } if (other.getMachineType() != null) { this.machineType = other.machineType; } if (other.getMetadata() != null) { this.metadata = other.metadata; } + if (other.getMinCpuPlatform() != null) { + this.minCpuPlatform = other.minCpuPlatform; + } if (other.getNetworkInterfacesList() != null) { this.networkInterfaces = other.networkInterfaces; } @@ -265,8 +323,11 @@ public Builder mergeFrom(InstanceProperties other) { this.canIpForward = source.canIpForward; this.description = source.description; this.disks = source.disks; + this.guestAccelerators = source.guestAccelerators; + this.labels = source.labels; this.machineType = source.machineType; this.metadata = source.metadata; + this.minCpuPlatform = source.minCpuPlatform; this.networkInterfaces = source.networkInterfaces; this.scheduling = source.scheduling; this.serviceAccounts = source.serviceAccounts; @@ -308,6 +369,32 @@ public Builder addDisks(AttachedDisk disks) { return this; } + public List getGuestAcceleratorsList() { + return guestAccelerators; + } + + public Builder addAllGuestAccelerators(List guestAccelerators) { + if (this.guestAccelerators == null) { + this.guestAccelerators = new ArrayList<>(guestAccelerators.size()); + } + this.guestAccelerators.addAll(guestAccelerators); + return this; + } + + public Builder addGuestAccelerators(AcceleratorConfig guestAccelerators) { + this.guestAccelerators.add(guestAccelerators); + return this; + } + + public Map getLabelsMap() { + return labels; + } + + public Builder putAllLabels(Map labels) { + this.labels = labels; + return this; + } + public String getMachineType() { return machineType; } @@ -326,6 +413,15 @@ public Builder setMetadata(Metadata metadata) { return this; } + public String getMinCpuPlatform() { + return minCpuPlatform; + } + + public Builder setMinCpuPlatform(String minCpuPlatform) { + this.minCpuPlatform = minCpuPlatform; + return this; + } + public List getNetworkInterfacesList() { return networkInterfaces; } @@ -388,12 +484,18 @@ public InstanceProperties build() { + + + return new InstanceProperties( canIpForward, description, disks, + guestAccelerators, + labels, machineType, metadata, + minCpuPlatform, networkInterfaces, scheduling, serviceAccounts, @@ -406,8 +508,11 @@ public Builder clone() { newBuilder.setCanIpForward(this.canIpForward); newBuilder.setDescription(this.description); newBuilder.addAllDisks(this.disks); + newBuilder.addAllGuestAccelerators(this.guestAccelerators); + newBuilder.putAllLabels(this.labels); newBuilder.setMachineType(this.machineType); newBuilder.setMetadata(this.metadata); + newBuilder.setMinCpuPlatform(this.minCpuPlatform); newBuilder.addAllNetworkInterfaces(this.networkInterfaces); newBuilder.setScheduling(this.scheduling); newBuilder.addAllServiceAccounts(this.serviceAccounts); @@ -422,8 +527,11 @@ public String toString() { + "canIpForward=" + canIpForward + ", " + "description=" + description + ", " + "disks=" + disks + ", " + + "guestAccelerators=" + guestAccelerators + ", " + + "labels=" + labels + ", " + "machineType=" + machineType + ", " + "metadata=" + metadata + ", " + + "minCpuPlatform=" + minCpuPlatform + ", " + "networkInterfaces=" + networkInterfaces + ", " + "scheduling=" + scheduling + ", " + "serviceAccounts=" + serviceAccounts + ", " @@ -442,8 +550,11 @@ public boolean equals(Object o) { Objects.equals(this.canIpForward, that.getCanIpForward()) && Objects.equals(this.description, that.getDescription()) && Objects.equals(this.disks, that.getDisksList()) && + Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) && + Objects.equals(this.labels, that.getLabelsMap()) && Objects.equals(this.machineType, that.getMachineType()) && Objects.equals(this.metadata, that.getMetadata()) && + Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) && Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) && Objects.equals(this.scheduling, that.getScheduling()) && Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) && @@ -459,8 +570,11 @@ public int hashCode() { canIpForward, description, disks, + guestAccelerators, + labels, machineType, metadata, + minCpuPlatform, networkInterfaces, scheduling, serviceAccounts, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java index 0f038a95b0f4..7ba9333a96bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java @@ -44,6 +44,7 @@ import com.google.auth.Credentials; import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.stub.InstanceStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -156,6 +157,13 @@ public PagedCallSettings listReferrersInstancesSettings() { + return ((InstanceStubSettings) getStubSettings()).listReferrersInstancesSettings(); + } + /** * Returns the object with the settings used for calls to resetInstance. */ @@ -163,6 +171,13 @@ public UnaryCallSettings resetInstanceSetti return ((InstanceStubSettings) getStubSettings()).resetInstanceSettings(); } + /** + * Returns the object with the settings used for calls to setDeletionProtectionInstance. + */ + public UnaryCallSettings setDeletionProtectionInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setDeletionProtectionInstanceSettings(); + } + /** * Returns the object with the settings used for calls to setDiskAutoDeleteInstance. */ @@ -170,6 +185,20 @@ public UnaryCallSettings setDis return ((InstanceStubSettings) getStubSettings()).setDiskAutoDeleteInstanceSettings(); } + /** + * Returns the object with the settings used for calls to setLabelsInstance. + */ + public UnaryCallSettings setLabelsInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setLabelsInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to setMachineResourcesInstance. + */ + public UnaryCallSettings setMachineResourcesInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setMachineResourcesInstanceSettings(); + } + /** * Returns the object with the settings used for calls to setMachineTypeInstance. */ @@ -184,6 +213,13 @@ public UnaryCallSettings setMetadataI return ((InstanceStubSettings) getStubSettings()).setMetadataInstanceSettings(); } + /** + * Returns the object with the settings used for calls to setMinCpuPlatformInstance. + */ + public UnaryCallSettings setMinCpuPlatformInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setMinCpuPlatformInstanceSettings(); + } + /** * Returns the object with the settings used for calls to setSchedulingInstance. */ @@ -226,6 +262,20 @@ public UnaryCallSettings stopInstanceSetting return ((InstanceStubSettings) getStubSettings()).stopInstanceSettings(); } + /** + * Returns the object with the settings used for calls to updateAccessConfigInstance. + */ + public UnaryCallSettings updateAccessConfigInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).updateAccessConfigInstanceSettings(); + } + + /** + * Returns the object with the settings used for calls to updateNetworkInterfaceInstance. + */ + public UnaryCallSettings updateNetworkInterfaceInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).updateNetworkInterfaceInstanceSettings(); + } + public static final InstanceSettings create(InstanceStubSettings stub) throws IOException { return new InstanceSettings.Builder(stub.toBuilder()).build(); @@ -415,6 +465,13 @@ public PagedCallSettings.Builder listReferrersInstancesSettings() { + return getStubSettingsBuilder().listReferrersInstancesSettings(); + } + /** * Returns the builder for the settings used for calls to resetInstance. */ @@ -422,6 +479,13 @@ public UnaryCallSettings.Builder resetInsta return getStubSettingsBuilder().resetInstanceSettings(); } + /** + * Returns the builder for the settings used for calls to setDeletionProtectionInstance. + */ + public UnaryCallSettings.Builder setDeletionProtectionInstanceSettings() { + return getStubSettingsBuilder().setDeletionProtectionInstanceSettings(); + } + /** * Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. */ @@ -429,6 +493,20 @@ public UnaryCallSettings.Builder setLabelsInstanceSettings() { + return getStubSettingsBuilder().setLabelsInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to setMachineResourcesInstance. + */ + public UnaryCallSettings.Builder setMachineResourcesInstanceSettings() { + return getStubSettingsBuilder().setMachineResourcesInstanceSettings(); + } + /** * Returns the builder for the settings used for calls to setMachineTypeInstance. */ @@ -443,6 +521,13 @@ public UnaryCallSettings.Builder setM return getStubSettingsBuilder().setMetadataInstanceSettings(); } + /** + * Returns the builder for the settings used for calls to setMinCpuPlatformInstance. + */ + public UnaryCallSettings.Builder setMinCpuPlatformInstanceSettings() { + return getStubSettingsBuilder().setMinCpuPlatformInstanceSettings(); + } + /** * Returns the builder for the settings used for calls to setSchedulingInstance. */ @@ -485,6 +570,20 @@ public UnaryCallSettings.Builder stopInstanc return getStubSettingsBuilder().stopInstanceSettings(); } + /** + * Returns the builder for the settings used for calls to updateAccessConfigInstance. + */ + public UnaryCallSettings.Builder updateAccessConfigInstanceSettings() { + return getStubSettingsBuilder().updateAccessConfigInstanceSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateNetworkInterfaceInstance. + */ + public UnaryCallSettings.Builder updateNetworkInterfaceInstanceSettings() { + return getStubSettingsBuilder().updateNetworkInterfaceInstanceSettings(); + } + @Override public InstanceSettings build() throws IOException { return new InstanceSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java index 0aab1348c662..a1f965b37e67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -47,6 +50,7 @@ private InstanceTemplate() { this.selfLink = null; } + private InstanceTemplate( String creationTimestamp, String description, @@ -54,7 +58,8 @@ private InstanceTemplate( String kind, String name, InstanceProperties properties, - String selfLink) { + String selfLink + ) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -68,8 +73,7 @@ private InstanceTemplate( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -152,24 +156,22 @@ public String getSelfLink() { return selfLink; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(InstanceTemplate prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static InstanceTemplate getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final InstanceTemplate DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new InstanceTemplate(); } @@ -284,10 +286,23 @@ public Builder setSelfLink(String selfLink) { return this; } + public InstanceTemplate build() { + + + + + return new InstanceTemplate( - creationTimestamp, description, id, kind, name, properties, selfLink); + creationTimestamp, + description, + id, + kind, + name, + properties, + selfLink + ); } public Builder clone() { @@ -306,26 +321,13 @@ public Builder clone() { @Override public String toString() { return "InstanceTemplate{" - + "creationTimestamp=" - + creationTimestamp - + ", " - + "description=" - + description - + ", " - + "id=" - + id - + ", " - + "kind=" - + kind - + ", " - + "name=" - + name - + ", " - + "properties=" - + properties - + ", " - + "selfLink=" - + selfLink + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "properties=" + properties + ", " + + "selfLink=" + selfLink + "}"; } @@ -336,19 +338,29 @@ public boolean equals(Object o) { } if (o instanceof InstanceTemplate) { InstanceTemplate that = (InstanceTemplate) o; - return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) - && Objects.equals(this.description, that.getDescription()) - && Objects.equals(this.id, that.getId()) - && Objects.equals(this.kind, that.getKind()) - && Objects.equals(this.name, that.getName()) - && Objects.equals(this.properties, that.getProperties()) - && Objects.equals(this.selfLink, that.getSelfLink()); + return + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.properties, that.getProperties()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(creationTimestamp, description, id, kind, name, properties, selfLink); + return Objects.hash( + creationTimestamp, + description, + id, + kind, + name, + properties, + selfLink + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java index 4aa7c21ca504..3791a8bd9de1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java @@ -23,12 +23,22 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InstanceTemplateStub; import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -43,39 +53,40 @@ * * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) { * InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - * Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate); + * String requestId = ""; + * Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId); * } * *

* - *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * *

This class can be customized by passing in a custom instance of InstanceTemplateSettings to * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -105,23 +116,27 @@ public class InstanceTemplateClient implements BackgroundResource {
   private final InstanceTemplateSettings settings;
   private final InstanceTemplateStub stub;
 
-  /** Constructs an instance of InstanceTemplateClient with default settings. */
+
+
+  /**
+   * Constructs an instance of InstanceTemplateClient with default settings.
+   */
   public static final InstanceTemplateClient create() throws IOException {
     return create(InstanceTemplateSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given settings. The channels are
-   * created based on the settings passed in, or defaults for any settings that are not set.
+   * Constructs an instance of InstanceTemplateClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
-  public static final InstanceTemplateClient create(InstanceTemplateSettings settings)
-      throws IOException {
+  public static final InstanceTemplateClient create(InstanceTemplateSettings settings) throws IOException {
     return new InstanceTemplateClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This
-   * is for advanced usage - prefer to use InstanceTemplateSettings}.
+   * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This is for
+   * advanced usage - prefer to use InstanceTemplateSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceTemplateClient create(InstanceTemplateStub stub) {
@@ -129,9 +144,9 @@ public static final InstanceTemplateClient create(InstanceTemplateStub stub) {
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given settings. This is protected
-   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
-   * preferred.
+   * Constructs an instance of InstanceTemplateClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
   protected InstanceTemplateClient(InstanceTemplateSettings settings) throws IOException {
     this.settings = settings;
@@ -153,78 +168,83 @@ public InstanceTemplateStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. If you delete an instance template that is being
-   * referenced from another instance group, the instance group will not be able to create or
-   * recreate virtual machine instances. Deleting an instance template is permanent and cannot be
-   * undone.
-   *
-   * 

Sample code: + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
-   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate);
+   *   String requestId = "";
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
    * }
    * 
* * @param instanceTemplate The name of the instance template to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceTemplate(InstanceTemplateName instanceTemplate) { + public final Operation deleteInstanceTemplate(InstanceTemplateName instanceTemplate, String requestId) { DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder() - .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) - .build(); + .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) + .setRequestId(requestId) + .build(); return deleteInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified instance template. If you delete an instance template that is being - * referenced from another instance group, the instance group will not be able to create or - * recreate virtual machine instances. Deleting an instance template is permanent and cannot be - * undone. - * - *

Sample code: + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
-   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString());
+   *   String requestId = "";
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString(), requestId);
    * }
    * 
* * @param instanceTemplate The name of the instance template to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceTemplate(String instanceTemplate) { + public final Operation deleteInstanceTemplate(String instanceTemplate, String requestId) { DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder() - .setInstanceTemplate(instanceTemplate) - .build(); + .setInstanceTemplate(instanceTemplate) + .setRequestId(requestId) + .build(); return deleteInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified instance template. If you delete an instance template that is being - * referenced from another instance group, the instance group will not be able to create or - * recreate virtual machine instances. Deleting an instance template is permanent and cannot be - * undone. - * - *

Sample code: + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceTemplateClient.deleteInstanceTemplate(request);
    * }
@@ -240,18 +260,16 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. If you delete an instance template that is being
-   * referenced from another instance group, the instance group will not be able to create or
-   * recreate virtual machine instances. Deleting an instance template is permanent and cannot be
-   * undone.
-   *
-   * 

Sample code: + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceTemplateClient.deleteInstanceTemplateCallable().futureCall(request);
    *   // Do something
@@ -260,18 +278,15 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - deleteInstanceTemplateCallable() { + public final UnaryCallable deleteInstanceTemplateCallable() { return stub.deleteInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a - * list() request. - * - *

Sample code: + * Returns the specified instance template. Get a list of available instance templates by making a list() request. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -287,18 +302,16 @@ public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceT
 
     GetInstanceTemplateHttpRequest request =
         GetInstanceTemplateHttpRequest.newBuilder()
-            .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString())
-            .build();
+        .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString())
+        .build();
     return getInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a
-   * list() request.
-   *
-   * 

Sample code: + * Returns the specified instance template. Get a list of available instance templates by making a list() request. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -313,17 +326,17 @@ public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceT
   public final InstanceTemplate getInstanceTemplate(String instanceTemplate) {
 
     GetInstanceTemplateHttpRequest request =
-        GetInstanceTemplateHttpRequest.newBuilder().setInstanceTemplate(instanceTemplate).build();
+        GetInstanceTemplateHttpRequest.newBuilder()
+        .setInstanceTemplate(instanceTemplate)
+        .build();
     return getInstanceTemplate(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a
-   * list() request.
-   *
-   * 

Sample code: + * Returns the specified instance template. Get a list of available instance templates by making a list() request. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -344,11 +357,9 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a
-   * list() request.
-   *
-   * 

Sample code: + * Returns the specified instance template. Get a list of available instance templates by making a list() request. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
@@ -362,91 +373,92 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - getInstanceTemplateCallable() { + public final UnaryCallable getInstanceTemplateCallable() { return stub.getInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
-   *   Operation response = instanceTemplateClient.insertInstanceTemplate(project, instanceTemplateResource);
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(requestId, project, instanceTemplateResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param instanceTemplateResource An Instance Template resource. + * @param instanceTemplateResource An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceTemplate( - ProjectName project, InstanceTemplate instanceTemplateResource) { + public final Operation insertInstanceTemplate(String requestId, ProjectName project, InstanceTemplate instanceTemplateResource) { InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .setInstanceTemplateResource(instanceTemplateResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setInstanceTemplateResource(instanceTemplateResource) + .build(); return insertInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
-   *   Operation response = instanceTemplateClient.insertInstanceTemplate(project.toString(), instanceTemplateResource);
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(requestId, project.toString(), instanceTemplateResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param instanceTemplateResource An Instance Template resource. + * @param instanceTemplateResource An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceTemplate( - String project, InstanceTemplate instanceTemplateResource) { + public final Operation insertInstanceTemplate(String requestId, String project, InstanceTemplate instanceTemplateResource) { InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder() - .setProject(project) - .setInstanceTemplateResource(instanceTemplateResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setInstanceTemplateResource(instanceTemplateResource) + .build(); return insertInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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: + * 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: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
    *   InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceTemplateResource(instanceTemplateResource)
    *     .build();
@@ -464,18 +476,16 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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: + * 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: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
    *   InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceTemplateResource(instanceTemplateResource)
    *     .build();
@@ -486,18 +496,15 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - insertInstanceTemplateCallable() { + public final UnaryCallable insertInstanceTemplateCallable() { return stub.insertInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of instance templates that are contained within the specified project and - * zone. - * - *

Sample code: + * Retrieves a list of instance templates that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -514,18 +521,16 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
   public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectName project) {
     ListInstanceTemplatesHttpRequest request =
         ListInstanceTemplatesHttpRequest.newBuilder()
-            .setProject(project == null ? null : project.toString())
-            .build();
+        .setProject(project == null ? null : project.toString())
+        .build();
     return listInstanceTemplates(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and
-   * zone.
-   *
-   * 

Sample code: + * Retrieves a list of instance templates that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -541,17 +546,17 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectNam
   @BetaApi
   public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String project) {
     ListInstanceTemplatesHttpRequest request =
-        ListInstanceTemplatesHttpRequest.newBuilder().setProject(project).build();
+        ListInstanceTemplatesHttpRequest.newBuilder()
+        .setProject(project)
+        .build();
     return listInstanceTemplates(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and
-   * zone.
-   *
-   * 

Sample code: + * Retrieves a list of instance templates that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -568,18 +573,16 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String pro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceTemplatesPagedResponse listInstanceTemplates(
-      ListInstanceTemplatesHttpRequest request) {
-    return listInstanceTemplatesPagedCallable().call(request);
+  public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ListInstanceTemplatesHttpRequest request) {
+    return listInstanceTemplatesPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and
-   * zone.
-   *
-   * 

Sample code: + * Retrieves a list of instance templates that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -595,18 +598,15 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(
    * 
*/ @BetaApi - public final UnaryCallable - listInstanceTemplatesPagedCallable() { + public final UnaryCallable listInstanceTemplatesPagedCallable() { return stub.listInstanceTemplatesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of instance templates that are contained within the specified project and - * zone. - * - *

Sample code: + * Retrieves a list of instance templates that are contained within the specified project and zone. * + * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,8 +629,7 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(
    * 
*/ @BetaApi - public final UnaryCallable - listInstanceTemplatesCallable() { + public final UnaryCallable listInstanceTemplatesCallable() { return stub.listInstanceTemplatesCallable(); } @@ -664,17 +663,15 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListInstanceTemplatesPagedResponse - extends AbstractPagedListResponse< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage, - ListInstanceTemplatesFixedSizeCollection> { + public static class ListInstanceTemplatesPagedResponse extends AbstractPagedListResponse< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage, + ListInstanceTemplatesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstanceTemplatesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -691,18 +688,18 @@ public ListInstanceTemplatesPagedResponse apply(ListInstanceTemplatesPage input) private ListInstanceTemplatesPagedResponse(ListInstanceTemplatesPage page) { super(page, ListInstanceTemplatesFixedSizeCollection.createEmptyCollection()); } + + } - public static class ListInstanceTemplatesPage - extends AbstractPage< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage> { + public static class ListInstanceTemplatesPage extends AbstractPage< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage> { private ListInstanceTemplatesPage( - PageContext - context, + PageContext context, InstanceTemplateList response) { super(context, response); } @@ -713,31 +710,31 @@ private static ListInstanceTemplatesPage createEmptyPage() { @Override protected ListInstanceTemplatesPage createPage( - PageContext - context, + PageContext context, InstanceTemplateList response) { return new ListInstanceTemplatesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class ListInstanceTemplatesFixedSizeCollection - extends AbstractFixedSizeCollection< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage, - ListInstanceTemplatesFixedSizeCollection> { + public static class ListInstanceTemplatesFixedSizeCollection extends AbstractFixedSizeCollection< + ListInstanceTemplatesHttpRequest, + InstanceTemplateList, + InstanceTemplate, + ListInstanceTemplatesPage, + ListInstanceTemplatesFixedSizeCollection> { - private ListInstanceTemplatesFixedSizeCollection( - List pages, int collectionSize) { + private ListInstanceTemplatesFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -750,5 +747,7 @@ protected ListInstanceTemplatesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceTemplatesFixedSizeCollection(pages, collectionSize); } + + } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java index 09a750ac6ffa..e9f10a7c9f7f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java @@ -37,6 +37,7 @@ public final class InstanceTemplateList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private InstanceTemplateList() { this.id = null; @@ -44,6 +45,7 @@ private InstanceTemplateList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private InstanceTemplateList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(InstanceTemplateList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(InstanceTemplateList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public InstanceTemplateList build() { + return new InstanceTemplateList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java index 5756bfcc4152..d21c51ecae89 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class InstanceTemplateName implements ResourceName { +public final class InstanceTemplateName implements com.google.api.resourcenames.ResourceName { private final String instanceTemplate; private final String project; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java new file mode 100644 index 000000000000..139023807398 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesSetLabelsRequest implements ApiMessage { + private final String labelFingerprint; + private final Map labels; + + private InstancesSetLabelsRequest() { + this.labelFingerprint = null; + this.labels = null; + } + + + private InstancesSetLabelsRequest( + String labelFingerprint, + Map labels + ) { + this.labelFingerprint = labelFingerprint; + this.labels = labels; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Map getLabelsMap() { + return labels; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesSetLabelsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesSetLabelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesSetLabelsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesSetLabelsRequest(); + } + + public static class Builder { + private String labelFingerprint; + private Map labels; + + Builder() {} + + public Builder mergeFrom(InstancesSetLabelsRequest other) { + if (other == InstancesSetLabelsRequest.getDefaultInstance()) return this; + if (other.getLabelFingerprint() != null) { + this.labelFingerprint = other.labelFingerprint; + } + if (other.getLabelsMap() != null) { + this.labels = other.labels; + } + return this; + } + + Builder(InstancesSetLabelsRequest source) { + this.labelFingerprint = source.labelFingerprint; + this.labels = source.labels; + } + + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Builder setLabelFingerprint(String labelFingerprint) { + this.labelFingerprint = labelFingerprint; + return this; + } + + public Map getLabelsMap() { + return labels; + } + + public Builder putAllLabels(Map labels) { + this.labels = labels; + return this; + } + + + public InstancesSetLabelsRequest build() { + + return new InstancesSetLabelsRequest( + labelFingerprint, + labels + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setLabelFingerprint(this.labelFingerprint); + newBuilder.putAllLabels(this.labels); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesSetLabelsRequest{" + + "labelFingerprint=" + labelFingerprint + ", " + + "labels=" + labels + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesSetLabelsRequest) { + InstancesSetLabelsRequest that = (InstancesSetLabelsRequest) o; + return + Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && + Objects.equals(this.labels, that.getLabelsMap()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + labelFingerprint, + labels + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java new file mode 100644 index 000000000000..19d7aa1543a2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesSetMachineResourcesRequest implements ApiMessage { + private final List guestAccelerators; + + private InstancesSetMachineResourcesRequest() { + this.guestAccelerators = null; + } + + + private InstancesSetMachineResourcesRequest( + List guestAccelerators + ) { + this.guestAccelerators = guestAccelerators; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorConfig item : guestAccelerators) { + stringList.add(item.toString()); + } + fieldMap.put("guestAccelerators", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("guestAccelerators")) { + return String.valueOf(guestAccelerators); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getGuestAcceleratorsList() { + return guestAccelerators; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesSetMachineResourcesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesSetMachineResourcesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesSetMachineResourcesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesSetMachineResourcesRequest(); + } + + public static class Builder { + private List guestAccelerators; + + Builder() {} + + public Builder mergeFrom(InstancesSetMachineResourcesRequest other) { + if (other == InstancesSetMachineResourcesRequest.getDefaultInstance()) return this; + if (other.getGuestAcceleratorsList() != null) { + this.guestAccelerators = other.guestAccelerators; + } + return this; + } + + Builder(InstancesSetMachineResourcesRequest source) { + this.guestAccelerators = source.guestAccelerators; + } + + public List getGuestAcceleratorsList() { + return guestAccelerators; + } + + public Builder addAllGuestAccelerators(List guestAccelerators) { + if (this.guestAccelerators == null) { + this.guestAccelerators = new ArrayList<>(guestAccelerators.size()); + } + this.guestAccelerators.addAll(guestAccelerators); + return this; + } + + public Builder addGuestAccelerators(AcceleratorConfig guestAccelerators) { + this.guestAccelerators.add(guestAccelerators); + return this; + } + + + public InstancesSetMachineResourcesRequest build() { + return new InstancesSetMachineResourcesRequest( + guestAccelerators + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllGuestAccelerators(this.guestAccelerators); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesSetMachineResourcesRequest{" + + "guestAccelerators=" + guestAccelerators + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesSetMachineResourcesRequest) { + InstancesSetMachineResourcesRequest that = (InstancesSetMachineResourcesRequest) o; + return + Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + guestAccelerators + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java new file mode 100644 index 000000000000..63b34e4502cf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstancesSetMinCpuPlatformRequest implements ApiMessage { + private final String minCpuPlatform; + + private InstancesSetMinCpuPlatformRequest() { + this.minCpuPlatform = null; + } + + + private InstancesSetMinCpuPlatformRequest( + String minCpuPlatform + ) { + this.minCpuPlatform = minCpuPlatform; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { + fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("minCpuPlatform")) { + return String.valueOf(minCpuPlatform); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getMinCpuPlatform() { + return minCpuPlatform; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InstancesSetMinCpuPlatformRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstancesSetMinCpuPlatformRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InstancesSetMinCpuPlatformRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InstancesSetMinCpuPlatformRequest(); + } + + public static class Builder { + private String minCpuPlatform; + + Builder() {} + + public Builder mergeFrom(InstancesSetMinCpuPlatformRequest other) { + if (other == InstancesSetMinCpuPlatformRequest.getDefaultInstance()) return this; + if (other.getMinCpuPlatform() != null) { + this.minCpuPlatform = other.minCpuPlatform; + } + return this; + } + + Builder(InstancesSetMinCpuPlatformRequest source) { + this.minCpuPlatform = source.minCpuPlatform; + } + + public String getMinCpuPlatform() { + return minCpuPlatform; + } + + public Builder setMinCpuPlatform(String minCpuPlatform) { + this.minCpuPlatform = minCpuPlatform; + return this; + } + + + public InstancesSetMinCpuPlatformRequest build() { + return new InstancesSetMinCpuPlatformRequest( + minCpuPlatform + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setMinCpuPlatform(this.minCpuPlatform); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstancesSetMinCpuPlatformRequest{" + + "minCpuPlatform=" + minCpuPlatform + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstancesSetMinCpuPlatformRequest) { + InstancesSetMinCpuPlatformRequest that = (InstancesSetMinCpuPlatformRequest) o; + return + Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + minCpuPlatform + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java new file mode 100644 index 000000000000..f73b4b7bbc0e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java @@ -0,0 +1,878 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Interconnect implements ApiMessage { + private final Boolean adminEnabled; + private final List circuitInfos; + private final String creationTimestamp; + private final String customerName; + private final String description; + private final List expectedOutages; + private final String googleIpAddress; + private final String googleReferenceId; + private final String id; + private final List interconnectAttachments; + private final String interconnectType; + private final String kind; + private final String linkType; + private final String location; + private final String name; + private final String nocContactEmail; + private final String operationalStatus; + private final String peerIpAddress; + private final Integer provisionedLinkCount; + private final Integer requestedLinkCount; + private final String selfLink; + + private Interconnect() { + this.adminEnabled = null; + this.circuitInfos = null; + this.creationTimestamp = null; + this.customerName = null; + this.description = null; + this.expectedOutages = null; + this.googleIpAddress = null; + this.googleReferenceId = null; + this.id = null; + this.interconnectAttachments = null; + this.interconnectType = null; + this.kind = null; + this.linkType = null; + this.location = null; + this.name = null; + this.nocContactEmail = null; + this.operationalStatus = null; + this.peerIpAddress = null; + this.provisionedLinkCount = null; + this.requestedLinkCount = null; + this.selfLink = null; + } + + + private Interconnect( + Boolean adminEnabled, + List circuitInfos, + String creationTimestamp, + String customerName, + String description, + List expectedOutages, + String googleIpAddress, + String googleReferenceId, + String id, + List interconnectAttachments, + String interconnectType, + String kind, + String linkType, + String location, + String name, + String nocContactEmail, + String operationalStatus, + String peerIpAddress, + Integer provisionedLinkCount, + Integer requestedLinkCount, + String selfLink + ) { + this.adminEnabled = adminEnabled; + this.circuitInfos = circuitInfos; + this.creationTimestamp = creationTimestamp; + this.customerName = customerName; + this.description = description; + this.expectedOutages = expectedOutages; + this.googleIpAddress = googleIpAddress; + this.googleReferenceId = googleReferenceId; + this.id = id; + this.interconnectAttachments = interconnectAttachments; + this.interconnectType = interconnectType; + this.kind = kind; + this.linkType = linkType; + this.location = location; + this.name = name; + this.nocContactEmail = nocContactEmail; + this.operationalStatus = operationalStatus; + this.peerIpAddress = peerIpAddress; + this.provisionedLinkCount = provisionedLinkCount; + this.requestedLinkCount = requestedLinkCount; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("adminEnabled") && adminEnabled != null) { + fieldMap.put("adminEnabled", Collections.singletonList(String.valueOf(adminEnabled))); + } + if (fieldNames.contains("circuitInfos") && circuitInfos != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectCircuitInfo item : circuitInfos) { + stringList.add(item.toString()); + } + fieldMap.put("circuitInfos", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("customerName") && customerName != null) { + fieldMap.put("customerName", Collections.singletonList(String.valueOf(customerName))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("expectedOutages") && expectedOutages != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectOutageNotification item : expectedOutages) { + stringList.add(item.toString()); + } + fieldMap.put("expectedOutages", stringList.build()); + } + if (fieldNames.contains("googleIpAddress") && googleIpAddress != null) { + fieldMap.put("googleIpAddress", Collections.singletonList(String.valueOf(googleIpAddress))); + } + if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { + fieldMap.put("googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : interconnectAttachments) { + stringList.add(item.toString()); + } + fieldMap.put("interconnectAttachments", stringList.build()); + } + if (fieldNames.contains("interconnectType") && interconnectType != null) { + fieldMap.put("interconnectType", Collections.singletonList(String.valueOf(interconnectType))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("linkType") && linkType != null) { + fieldMap.put("linkType", Collections.singletonList(String.valueOf(linkType))); + } + if (fieldNames.contains("location") && location != null) { + fieldMap.put("location", Collections.singletonList(String.valueOf(location))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("nocContactEmail") && nocContactEmail != null) { + fieldMap.put("nocContactEmail", Collections.singletonList(String.valueOf(nocContactEmail))); + } + if (fieldNames.contains("operationalStatus") && operationalStatus != null) { + fieldMap.put("operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); + } + if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { + fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); + } + if (fieldNames.contains("provisionedLinkCount") && provisionedLinkCount != null) { + fieldMap.put("provisionedLinkCount", Collections.singletonList(String.valueOf(provisionedLinkCount))); + } + if (fieldNames.contains("requestedLinkCount") && requestedLinkCount != null) { + fieldMap.put("requestedLinkCount", Collections.singletonList(String.valueOf(requestedLinkCount))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("adminEnabled")) { + return String.valueOf(adminEnabled); + } + if (fieldName.equals("circuitInfos")) { + return String.valueOf(circuitInfos); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("customerName")) { + return String.valueOf(customerName); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("expectedOutages")) { + return String.valueOf(expectedOutages); + } + if (fieldName.equals("googleIpAddress")) { + return String.valueOf(googleIpAddress); + } + if (fieldName.equals("googleReferenceId")) { + return String.valueOf(googleReferenceId); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("interconnectAttachments")) { + return String.valueOf(interconnectAttachments); + } + if (fieldName.equals("interconnectType")) { + return String.valueOf(interconnectType); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("linkType")) { + return String.valueOf(linkType); + } + if (fieldName.equals("location")) { + return String.valueOf(location); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("nocContactEmail")) { + return String.valueOf(nocContactEmail); + } + if (fieldName.equals("operationalStatus")) { + return String.valueOf(operationalStatus); + } + if (fieldName.equals("peerIpAddress")) { + return String.valueOf(peerIpAddress); + } + if (fieldName.equals("provisionedLinkCount")) { + return String.valueOf(provisionedLinkCount); + } + if (fieldName.equals("requestedLinkCount")) { + return String.valueOf(requestedLinkCount); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getAdminEnabled() { + return adminEnabled; + } + + public List getCircuitInfosList() { + return circuitInfos; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getCustomerName() { + return customerName; + } + + public String getDescription() { + return description; + } + + public List getExpectedOutagesList() { + return expectedOutages; + } + + public String getGoogleIpAddress() { + return googleIpAddress; + } + + public String getGoogleReferenceId() { + return googleReferenceId; + } + + public String getId() { + return id; + } + + public List getInterconnectAttachmentsList() { + return interconnectAttachments; + } + + public String getInterconnectType() { + return interconnectType; + } + + public String getKind() { + return kind; + } + + public String getLinkType() { + return linkType; + } + + public String getLocation() { + return location; + } + + public String getName() { + return name; + } + + public String getNocContactEmail() { + return nocContactEmail; + } + + public String getOperationalStatus() { + return operationalStatus; + } + + public String getPeerIpAddress() { + return peerIpAddress; + } + + public Integer getProvisionedLinkCount() { + return provisionedLinkCount; + } + + public Integer getRequestedLinkCount() { + return requestedLinkCount; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Interconnect prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static Interconnect getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final Interconnect DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Interconnect(); + } + + public static class Builder { + private Boolean adminEnabled; + private List circuitInfos; + private String creationTimestamp; + private String customerName; + private String description; + private List expectedOutages; + private String googleIpAddress; + private String googleReferenceId; + private String id; + private List interconnectAttachments; + private String interconnectType; + private String kind; + private String linkType; + private String location; + private String name; + private String nocContactEmail; + private String operationalStatus; + private String peerIpAddress; + private Integer provisionedLinkCount; + private Integer requestedLinkCount; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(Interconnect other) { + if (other == Interconnect.getDefaultInstance()) return this; + if (other.getAdminEnabled() != null) { + this.adminEnabled = other.adminEnabled; + } + if (other.getCircuitInfosList() != null) { + this.circuitInfos = other.circuitInfos; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getCustomerName() != null) { + this.customerName = other.customerName; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getExpectedOutagesList() != null) { + this.expectedOutages = other.expectedOutages; + } + if (other.getGoogleIpAddress() != null) { + this.googleIpAddress = other.googleIpAddress; + } + if (other.getGoogleReferenceId() != null) { + this.googleReferenceId = other.googleReferenceId; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInterconnectAttachmentsList() != null) { + this.interconnectAttachments = other.interconnectAttachments; + } + if (other.getInterconnectType() != null) { + this.interconnectType = other.interconnectType; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLinkType() != null) { + this.linkType = other.linkType; + } + if (other.getLocation() != null) { + this.location = other.location; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNocContactEmail() != null) { + this.nocContactEmail = other.nocContactEmail; + } + if (other.getOperationalStatus() != null) { + this.operationalStatus = other.operationalStatus; + } + if (other.getPeerIpAddress() != null) { + this.peerIpAddress = other.peerIpAddress; + } + if (other.getProvisionedLinkCount() != null) { + this.provisionedLinkCount = other.provisionedLinkCount; + } + if (other.getRequestedLinkCount() != null) { + this.requestedLinkCount = other.requestedLinkCount; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(Interconnect source) { + this.adminEnabled = source.adminEnabled; + this.circuitInfos = source.circuitInfos; + this.creationTimestamp = source.creationTimestamp; + this.customerName = source.customerName; + this.description = source.description; + this.expectedOutages = source.expectedOutages; + this.googleIpAddress = source.googleIpAddress; + this.googleReferenceId = source.googleReferenceId; + this.id = source.id; + this.interconnectAttachments = source.interconnectAttachments; + this.interconnectType = source.interconnectType; + this.kind = source.kind; + this.linkType = source.linkType; + this.location = source.location; + this.name = source.name; + this.nocContactEmail = source.nocContactEmail; + this.operationalStatus = source.operationalStatus; + this.peerIpAddress = source.peerIpAddress; + this.provisionedLinkCount = source.provisionedLinkCount; + this.requestedLinkCount = source.requestedLinkCount; + this.selfLink = source.selfLink; + } + + public Boolean getAdminEnabled() { + return adminEnabled; + } + + public Builder setAdminEnabled(Boolean adminEnabled) { + this.adminEnabled = adminEnabled; + return this; + } + + public List getCircuitInfosList() { + return circuitInfos; + } + + public Builder addAllCircuitInfos(List circuitInfos) { + if (this.circuitInfos == null) { + this.circuitInfos = new ArrayList<>(circuitInfos.size()); + } + this.circuitInfos.addAll(circuitInfos); + return this; + } + + public Builder addCircuitInfos(InterconnectCircuitInfo circuitInfos) { + this.circuitInfos.add(circuitInfos); + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getCustomerName() { + return customerName; + } + + public Builder setCustomerName(String customerName) { + this.customerName = customerName; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getExpectedOutagesList() { + return expectedOutages; + } + + public Builder addAllExpectedOutages(List expectedOutages) { + if (this.expectedOutages == null) { + this.expectedOutages = new ArrayList<>(expectedOutages.size()); + } + this.expectedOutages.addAll(expectedOutages); + return this; + } + + public Builder addExpectedOutages(InterconnectOutageNotification expectedOutages) { + this.expectedOutages.add(expectedOutages); + return this; + } + + public String getGoogleIpAddress() { + return googleIpAddress; + } + + public Builder setGoogleIpAddress(String googleIpAddress) { + this.googleIpAddress = googleIpAddress; + return this; + } + + public String getGoogleReferenceId() { + return googleReferenceId; + } + + public Builder setGoogleReferenceId(String googleReferenceId) { + this.googleReferenceId = googleReferenceId; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getInterconnectAttachmentsList() { + return interconnectAttachments; + } + + public Builder addAllInterconnectAttachments(List interconnectAttachments) { + if (this.interconnectAttachments == null) { + this.interconnectAttachments = new ArrayList<>(interconnectAttachments.size()); + } + this.interconnectAttachments.addAll(interconnectAttachments); + return this; + } + + public Builder addInterconnectAttachments(String interconnectAttachments) { + this.interconnectAttachments.add(interconnectAttachments); + return this; + } + + public String getInterconnectType() { + return interconnectType; + } + + public Builder setInterconnectType(String interconnectType) { + this.interconnectType = interconnectType; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getLinkType() { + return linkType; + } + + public Builder setLinkType(String linkType) { + this.linkType = linkType; + return this; + } + + public String getLocation() { + return location; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNocContactEmail() { + return nocContactEmail; + } + + public Builder setNocContactEmail(String nocContactEmail) { + this.nocContactEmail = nocContactEmail; + return this; + } + + public String getOperationalStatus() { + return operationalStatus; + } + + public Builder setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + return this; + } + + public String getPeerIpAddress() { + return peerIpAddress; + } + + public Builder setPeerIpAddress(String peerIpAddress) { + this.peerIpAddress = peerIpAddress; + return this; + } + + public Integer getProvisionedLinkCount() { + return provisionedLinkCount; + } + + public Builder setProvisionedLinkCount(Integer provisionedLinkCount) { + this.provisionedLinkCount = provisionedLinkCount; + return this; + } + + public Integer getRequestedLinkCount() { + return requestedLinkCount; + } + + public Builder setRequestedLinkCount(Integer requestedLinkCount) { + this.requestedLinkCount = requestedLinkCount; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public Interconnect build() { + + + + + + + + + + + + + + + + + + + + + return new Interconnect( + adminEnabled, + circuitInfos, + creationTimestamp, + customerName, + description, + expectedOutages, + googleIpAddress, + googleReferenceId, + id, + interconnectAttachments, + interconnectType, + kind, + linkType, + location, + name, + nocContactEmail, + operationalStatus, + peerIpAddress, + provisionedLinkCount, + requestedLinkCount, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAdminEnabled(this.adminEnabled); + newBuilder.addAllCircuitInfos(this.circuitInfos); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setCustomerName(this.customerName); + newBuilder.setDescription(this.description); + newBuilder.addAllExpectedOutages(this.expectedOutages); + newBuilder.setGoogleIpAddress(this.googleIpAddress); + newBuilder.setGoogleReferenceId(this.googleReferenceId); + newBuilder.setId(this.id); + newBuilder.addAllInterconnectAttachments(this.interconnectAttachments); + newBuilder.setInterconnectType(this.interconnectType); + newBuilder.setKind(this.kind); + newBuilder.setLinkType(this.linkType); + newBuilder.setLocation(this.location); + newBuilder.setName(this.name); + newBuilder.setNocContactEmail(this.nocContactEmail); + newBuilder.setOperationalStatus(this.operationalStatus); + newBuilder.setPeerIpAddress(this.peerIpAddress); + newBuilder.setProvisionedLinkCount(this.provisionedLinkCount); + newBuilder.setRequestedLinkCount(this.requestedLinkCount); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "Interconnect{" + + "adminEnabled=" + adminEnabled + ", " + + "circuitInfos=" + circuitInfos + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "customerName=" + customerName + ", " + + "description=" + description + ", " + + "expectedOutages=" + expectedOutages + ", " + + "googleIpAddress=" + googleIpAddress + ", " + + "googleReferenceId=" + googleReferenceId + ", " + + "id=" + id + ", " + + "interconnectAttachments=" + interconnectAttachments + ", " + + "interconnectType=" + interconnectType + ", " + + "kind=" + kind + ", " + + "linkType=" + linkType + ", " + + "location=" + location + ", " + + "name=" + name + ", " + + "nocContactEmail=" + nocContactEmail + ", " + + "operationalStatus=" + operationalStatus + ", " + + "peerIpAddress=" + peerIpAddress + ", " + + "provisionedLinkCount=" + provisionedLinkCount + ", " + + "requestedLinkCount=" + requestedLinkCount + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Interconnect) { + Interconnect that = (Interconnect) o; + return + Objects.equals(this.adminEnabled, that.getAdminEnabled()) && + Objects.equals(this.circuitInfos, that.getCircuitInfosList()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.customerName, that.getCustomerName()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.expectedOutages, that.getExpectedOutagesList()) && + Objects.equals(this.googleIpAddress, that.getGoogleIpAddress()) && + Objects.equals(this.googleReferenceId, that.getGoogleReferenceId()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.interconnectAttachments, that.getInterconnectAttachmentsList()) && + Objects.equals(this.interconnectType, that.getInterconnectType()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.linkType, that.getLinkType()) && + Objects.equals(this.location, that.getLocation()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.nocContactEmail, that.getNocContactEmail()) && + Objects.equals(this.operationalStatus, that.getOperationalStatus()) && + Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) && + Objects.equals(this.provisionedLinkCount, that.getProvisionedLinkCount()) && + Objects.equals(this.requestedLinkCount, that.getRequestedLinkCount()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + adminEnabled, + circuitInfos, + creationTimestamp, + customerName, + description, + expectedOutages, + googleIpAddress, + googleReferenceId, + id, + interconnectAttachments, + interconnectType, + kind, + linkType, + location, + name, + nocContactEmail, + operationalStatus, + peerIpAddress, + provisionedLinkCount, + requestedLinkCount, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java new file mode 100644 index 000000000000..1d0935883a8f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java @@ -0,0 +1,604 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectAttachment implements ApiMessage { + private final String cloudRouterIpAddress; + private final String creationTimestamp; + private final String customerRouterIpAddress; + private final String description; + private final String googleReferenceId; + private final String id; + private final String interconnect; + private final String kind; + private final String name; + private final String operationalStatus; + private final InterconnectAttachmentPrivateInfo privateInterconnectInfo; + private final String region; + private final String router; + private final String selfLink; + + private InterconnectAttachment() { + this.cloudRouterIpAddress = null; + this.creationTimestamp = null; + this.customerRouterIpAddress = null; + this.description = null; + this.googleReferenceId = null; + this.id = null; + this.interconnect = null; + this.kind = null; + this.name = null; + this.operationalStatus = null; + this.privateInterconnectInfo = null; + this.region = null; + this.router = null; + this.selfLink = null; + } + + + private InterconnectAttachment( + String cloudRouterIpAddress, + String creationTimestamp, + String customerRouterIpAddress, + String description, + String googleReferenceId, + String id, + String interconnect, + String kind, + String name, + String operationalStatus, + InterconnectAttachmentPrivateInfo privateInterconnectInfo, + String region, + String router, + String selfLink + ) { + this.cloudRouterIpAddress = cloudRouterIpAddress; + this.creationTimestamp = creationTimestamp; + this.customerRouterIpAddress = customerRouterIpAddress; + this.description = description; + this.googleReferenceId = googleReferenceId; + this.id = id; + this.interconnect = interconnect; + this.kind = kind; + this.name = name; + this.operationalStatus = operationalStatus; + this.privateInterconnectInfo = privateInterconnectInfo; + this.region = region; + this.router = router; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("cloudRouterIpAddress") && cloudRouterIpAddress != null) { + fieldMap.put("cloudRouterIpAddress", Collections.singletonList(String.valueOf(cloudRouterIpAddress))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("customerRouterIpAddress") && customerRouterIpAddress != null) { + fieldMap.put("customerRouterIpAddress", Collections.singletonList(String.valueOf(customerRouterIpAddress))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { + fieldMap.put("googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("interconnect") && interconnect != null) { + fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("operationalStatus") && operationalStatus != null) { + fieldMap.put("operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); + } + if (fieldNames.contains("privateInterconnectInfo") && privateInterconnectInfo != null) { + fieldMap.put("privateInterconnectInfo", Collections.singletonList(String.valueOf(privateInterconnectInfo))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("cloudRouterIpAddress")) { + return String.valueOf(cloudRouterIpAddress); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("customerRouterIpAddress")) { + return String.valueOf(customerRouterIpAddress); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("googleReferenceId")) { + return String.valueOf(googleReferenceId); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("interconnect")) { + return String.valueOf(interconnect); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("operationalStatus")) { + return String.valueOf(operationalStatus); + } + if (fieldName.equals("privateInterconnectInfo")) { + return String.valueOf(privateInterconnectInfo); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("router")) { + return String.valueOf(router); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCloudRouterIpAddress() { + return cloudRouterIpAddress; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getCustomerRouterIpAddress() { + return customerRouterIpAddress; + } + + public String getDescription() { + return description; + } + + public String getGoogleReferenceId() { + return googleReferenceId; + } + + public String getId() { + return id; + } + + public String getInterconnect() { + return interconnect; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getOperationalStatus() { + return operationalStatus; + } + + public InterconnectAttachmentPrivateInfo getPrivateInterconnectInfo() { + return privateInterconnectInfo; + } + + public String getRegion() { + return region; + } + + public String getRouter() { + return router; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectAttachment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectAttachment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectAttachment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectAttachment(); + } + + public static class Builder { + private String cloudRouterIpAddress; + private String creationTimestamp; + private String customerRouterIpAddress; + private String description; + private String googleReferenceId; + private String id; + private String interconnect; + private String kind; + private String name; + private String operationalStatus; + private InterconnectAttachmentPrivateInfo privateInterconnectInfo; + private String region; + private String router; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InterconnectAttachment other) { + if (other == InterconnectAttachment.getDefaultInstance()) return this; + if (other.getCloudRouterIpAddress() != null) { + this.cloudRouterIpAddress = other.cloudRouterIpAddress; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getCustomerRouterIpAddress() != null) { + this.customerRouterIpAddress = other.customerRouterIpAddress; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getGoogleReferenceId() != null) { + this.googleReferenceId = other.googleReferenceId; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getInterconnect() != null) { + this.interconnect = other.interconnect; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getOperationalStatus() != null) { + this.operationalStatus = other.operationalStatus; + } + if (other.getPrivateInterconnectInfo() != null) { + this.privateInterconnectInfo = other.privateInterconnectInfo; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getRouter() != null) { + this.router = other.router; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InterconnectAttachment source) { + this.cloudRouterIpAddress = source.cloudRouterIpAddress; + this.creationTimestamp = source.creationTimestamp; + this.customerRouterIpAddress = source.customerRouterIpAddress; + this.description = source.description; + this.googleReferenceId = source.googleReferenceId; + this.id = source.id; + this.interconnect = source.interconnect; + this.kind = source.kind; + this.name = source.name; + this.operationalStatus = source.operationalStatus; + this.privateInterconnectInfo = source.privateInterconnectInfo; + this.region = source.region; + this.router = source.router; + this.selfLink = source.selfLink; + } + + public String getCloudRouterIpAddress() { + return cloudRouterIpAddress; + } + + public Builder setCloudRouterIpAddress(String cloudRouterIpAddress) { + this.cloudRouterIpAddress = cloudRouterIpAddress; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getCustomerRouterIpAddress() { + return customerRouterIpAddress; + } + + public Builder setCustomerRouterIpAddress(String customerRouterIpAddress) { + this.customerRouterIpAddress = customerRouterIpAddress; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getGoogleReferenceId() { + return googleReferenceId; + } + + public Builder setGoogleReferenceId(String googleReferenceId) { + this.googleReferenceId = googleReferenceId; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getInterconnect() { + return interconnect; + } + + public Builder setInterconnect(String interconnect) { + this.interconnect = interconnect; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getOperationalStatus() { + return operationalStatus; + } + + public Builder setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + return this; + } + + public InterconnectAttachmentPrivateInfo getPrivateInterconnectInfo() { + return privateInterconnectInfo; + } + + public Builder setPrivateInterconnectInfo(InterconnectAttachmentPrivateInfo privateInterconnectInfo) { + this.privateInterconnectInfo = privateInterconnectInfo; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InterconnectAttachment build() { + + + + + + + + + + + + + + return new InterconnectAttachment( + cloudRouterIpAddress, + creationTimestamp, + customerRouterIpAddress, + description, + googleReferenceId, + id, + interconnect, + kind, + name, + operationalStatus, + privateInterconnectInfo, + region, + router, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCloudRouterIpAddress(this.cloudRouterIpAddress); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setCustomerRouterIpAddress(this.customerRouterIpAddress); + newBuilder.setDescription(this.description); + newBuilder.setGoogleReferenceId(this.googleReferenceId); + newBuilder.setId(this.id); + newBuilder.setInterconnect(this.interconnect); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setOperationalStatus(this.operationalStatus); + newBuilder.setPrivateInterconnectInfo(this.privateInterconnectInfo); + newBuilder.setRegion(this.region); + newBuilder.setRouter(this.router); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectAttachment{" + + "cloudRouterIpAddress=" + cloudRouterIpAddress + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "customerRouterIpAddress=" + customerRouterIpAddress + ", " + + "description=" + description + ", " + + "googleReferenceId=" + googleReferenceId + ", " + + "id=" + id + ", " + + "interconnect=" + interconnect + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "operationalStatus=" + operationalStatus + ", " + + "privateInterconnectInfo=" + privateInterconnectInfo + ", " + + "region=" + region + ", " + + "router=" + router + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectAttachment) { + InterconnectAttachment that = (InterconnectAttachment) o; + return + Objects.equals(this.cloudRouterIpAddress, that.getCloudRouterIpAddress()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.customerRouterIpAddress, that.getCustomerRouterIpAddress()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.googleReferenceId, that.getGoogleReferenceId()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.interconnect, that.getInterconnect()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.operationalStatus, that.getOperationalStatus()) && + Objects.equals(this.privateInterconnectInfo, that.getPrivateInterconnectInfo()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + cloudRouterIpAddress, + creationTimestamp, + customerRouterIpAddress, + description, + googleReferenceId, + id, + interconnect, + kind, + name, + operationalStatus, + privateInterconnectInfo, + region, + router, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java new file mode 100644 index 000000000000..5092f8fce112 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java @@ -0,0 +1,332 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectAttachmentAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private InterconnectAttachmentAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private InterconnectAttachmentAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectAttachmentAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectAttachmentAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectAttachmentAggregatedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectAttachmentAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InterconnectAttachmentAggregatedList other) { + if (other == InterconnectAttachmentAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InterconnectAttachmentAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InterconnectAttachmentAggregatedList build() { + + + + + + return new InterconnectAttachmentAggregatedList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectAttachmentAggregatedList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectAttachmentAggregatedList) { + InterconnectAttachmentAggregatedList that = (InterconnectAttachmentAggregatedList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsMap()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java new file mode 100644 index 000000000000..8318875456e6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java @@ -0,0 +1,973 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InterconnectAttachmentStub; +import com.google.cloud.compute.v1.stub.InterconnectAttachmentStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+ *   String requestId = "";
+ *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+ *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the interconnectAttachmentClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InterconnectAttachmentSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InterconnectAttachmentSettings interconnectAttachmentSettings =
+ *     InterconnectAttachmentSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InterconnectAttachmentClient interconnectAttachmentClient =
+ *     InterconnectAttachmentClient.create(interconnectAttachmentSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InterconnectAttachmentSettings interconnectAttachmentSettings =
+ *     InterconnectAttachmentSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InterconnectAttachmentClient interconnectAttachmentClient =
+ *     InterconnectAttachmentClient.create(interconnectAttachmentSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectAttachmentClient implements BackgroundResource { + private final InterconnectAttachmentSettings settings; + private final InterconnectAttachmentStub stub; + + + + /** + * Constructs an instance of InterconnectAttachmentClient with default settings. + */ + public static final InterconnectAttachmentClient create() throws IOException { + return create(InterconnectAttachmentSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InterconnectAttachmentClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InterconnectAttachmentClient create(InterconnectAttachmentSettings settings) throws IOException { + return new InterconnectAttachmentClient(settings); + } + + /** + * Constructs an instance of InterconnectAttachmentClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InterconnectAttachmentSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InterconnectAttachmentClient create(InterconnectAttachmentStub stub) { + return new InterconnectAttachmentClient(stub); + } + + /** + * Constructs an instance of InterconnectAttachmentClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InterconnectAttachmentClient(InterconnectAttachmentSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InterconnectAttachmentStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InterconnectAttachmentClient(InterconnectAttachmentStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InterconnectAttachmentSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InterconnectAttachmentStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of interconnect attachments. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InterconnectAttachmentsScopedList element : interconnectAttachmentClient.aggregatedListInterconnectAttachments(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(ProjectName project) { + AggregatedListInterconnectAttachmentsHttpRequest request = + AggregatedListInterconnectAttachmentsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListInterconnectAttachments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of interconnect attachments. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InterconnectAttachmentsScopedList element : interconnectAttachmentClient.aggregatedListInterconnectAttachments(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(String project) { + AggregatedListInterconnectAttachmentsHttpRequest request = + AggregatedListInterconnectAttachmentsHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListInterconnectAttachments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of interconnect attachments. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInterconnectAttachmentsHttpRequest request = AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (InterconnectAttachmentsScopedList element : interconnectAttachmentClient.aggregatedListInterconnectAttachments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(AggregatedListInterconnectAttachmentsHttpRequest request) { + return aggregatedListInterconnectAttachmentsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of interconnect attachments. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInterconnectAttachmentsHttpRequest request = AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListInterconnectAttachmentsPagedResponse> future = interconnectAttachmentClient.aggregatedListInterconnectAttachmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InterconnectAttachmentsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable() { + return stub.aggregatedListInterconnectAttachmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of interconnect attachments. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListInterconnectAttachmentsHttpRequest request = AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InterconnectAttachmentAggregatedList response = interconnectAttachmentClient.aggregatedListInterconnectAttachmentsCallable().call(request);
+   *     for (InterconnectAttachmentsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListInterconnectAttachmentsCallable() { + return stub.aggregatedListInterconnectAttachmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param interconnectAttachment Name of the interconnect attachment to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInterconnectAttachment(String requestId, InterconnectAttachmentName interconnectAttachment) { + + DeleteInterconnectAttachmentHttpRequest request = + DeleteInterconnectAttachmentHttpRequest.newBuilder() + .setRequestId(requestId) + .setInterconnectAttachment(interconnectAttachment == null ? null : interconnectAttachment.toString()) + .build(); + return deleteInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment.toString());
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param interconnectAttachment Name of the interconnect attachment to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInterconnectAttachment(String requestId, String interconnectAttachment) { + + DeleteInterconnectAttachmentHttpRequest request = + DeleteInterconnectAttachmentHttpRequest.newBuilder() + .setRequestId(requestId) + .setInterconnectAttachment(interconnectAttachment) + .build(); + return deleteInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setInterconnectAttachment(interconnectAttachment.toString())
+   *     .build();
+   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInterconnectAttachment(DeleteInterconnectAttachmentHttpRequest request) { + return deleteInterconnectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setInterconnectAttachment(interconnectAttachment.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = interconnectAttachmentClient.deleteInterconnectAttachmentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInterconnectAttachmentCallable() { + return stub.deleteInterconnectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(interconnectAttachment);
+   * }
+   * 
+ * + * @param interconnectAttachment Name of the interconnect attachment to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectAttachment getInterconnectAttachment(InterconnectAttachmentName interconnectAttachment) { + + GetInterconnectAttachmentHttpRequest request = + GetInterconnectAttachmentHttpRequest.newBuilder() + .setInterconnectAttachment(interconnectAttachment == null ? null : interconnectAttachment.toString()) + .build(); + return getInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(interconnectAttachment.toString());
+   * }
+   * 
+ * + * @param interconnectAttachment Name of the interconnect attachment to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectAttachment getInterconnectAttachment(String interconnectAttachment) { + + GetInterconnectAttachmentHttpRequest request = + GetInterconnectAttachmentHttpRequest.newBuilder() + .setInterconnectAttachment(interconnectAttachment) + .build(); + return getInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setInterconnectAttachment(interconnectAttachment.toString())
+   *     .build();
+   *   InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectAttachment getInterconnectAttachment(GetInterconnectAttachmentHttpRequest request) { + return getInterconnectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect attachment. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setInterconnectAttachment(interconnectAttachment.toString())
+   *     .build();
+   *   ApiFuture<InterconnectAttachment> future = interconnectAttachmentClient.getInterconnectAttachmentCallable().futureCall(request);
+   *   // Do something
+   *   InterconnectAttachment response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInterconnectAttachmentCallable() { + return stub.getInterconnectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param region Name of the region for this request. + * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInterconnectAttachment(String requestId, RegionName region, InterconnectAttachment interconnectAttachmentResource) { + + InsertInterconnectAttachmentHttpRequest request = + InsertInterconnectAttachmentHttpRequest.newBuilder() + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setInterconnectAttachmentResource(interconnectAttachmentResource) + .build(); + return insertInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(requestId, region.toString(), interconnectAttachmentResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param region Name of the region for this request. + * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInterconnectAttachment(String requestId, String region, InterconnectAttachment interconnectAttachmentResource) { + + InsertInterconnectAttachmentHttpRequest request = + InsertInterconnectAttachmentHttpRequest.newBuilder() + .setRequestId(requestId) + .setRegion(region) + .setInterconnectAttachmentResource(interconnectAttachmentResource) + .build(); + return insertInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setRegion(region.toString())
+   *     .setInterconnectAttachmentResource(interconnectAttachmentResource)
+   *     .build();
+   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInterconnectAttachment(InsertInterconnectAttachmentHttpRequest request) { + return insertInterconnectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setRegion(region.toString())
+   *     .setInterconnectAttachmentResource(interconnectAttachmentResource)
+   *     .build();
+   *   ApiFuture<Operation> future = interconnectAttachmentClient.insertInterconnectAttachmentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertInterconnectAttachmentCallable() { + return stub.insertInterconnectAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(RegionName region) { + ListInterconnectAttachmentsHttpRequest request = + ListInterconnectAttachmentsHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listInterconnectAttachments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(String region) { + ListInterconnectAttachmentsHttpRequest request = + ListInterconnectAttachmentsHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listInterconnectAttachments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(ListInterconnectAttachmentsHttpRequest request) { + return listInterconnectAttachmentsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListInterconnectAttachmentsPagedResponse> future = interconnectAttachmentClient.listInterconnectAttachmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InterconnectAttachment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInterconnectAttachmentsPagedCallable() { + return stub.listInterconnectAttachmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * Sample code: + *

+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     InterconnectAttachmentList response = interconnectAttachmentClient.listInterconnectAttachmentsCallable().call(request);
+   *     for (InterconnectAttachment element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInterconnectAttachmentsCallable() { + return stub.listInterconnectAttachmentsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListInterconnectAttachmentsPagedResponse extends AbstractPagedListResponse< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, + InterconnectAttachmentsScopedList, + AggregatedListInterconnectAttachmentsPage, + AggregatedListInterconnectAttachmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListInterconnectAttachmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListInterconnectAttachmentsPagedResponse apply(AggregatedListInterconnectAttachmentsPage input) { + return new AggregatedListInterconnectAttachmentsPagedResponse(input); + } + }); + } + + private AggregatedListInterconnectAttachmentsPagedResponse(AggregatedListInterconnectAttachmentsPage page) { + super(page, AggregatedListInterconnectAttachmentsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListInterconnectAttachmentsPage extends AbstractPage< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, + InterconnectAttachmentsScopedList, + AggregatedListInterconnectAttachmentsPage> { + + private AggregatedListInterconnectAttachmentsPage( + PageContext context, + InterconnectAttachmentAggregatedList response) { + super(context, response); + } + + private static AggregatedListInterconnectAttachmentsPage createEmptyPage() { + return new AggregatedListInterconnectAttachmentsPage(null, null); + } + + @Override + protected AggregatedListInterconnectAttachmentsPage createPage( + PageContext context, + InterconnectAttachmentAggregatedList response) { + return new AggregatedListInterconnectAttachmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListInterconnectAttachmentsFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, + InterconnectAttachmentsScopedList, + AggregatedListInterconnectAttachmentsPage, + AggregatedListInterconnectAttachmentsFixedSizeCollection> { + + private AggregatedListInterconnectAttachmentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListInterconnectAttachmentsFixedSizeCollection createEmptyCollection() { + return new AggregatedListInterconnectAttachmentsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListInterconnectAttachmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListInterconnectAttachmentsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListInterconnectAttachmentsPagedResponse extends AbstractPagedListResponse< + ListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentList, + InterconnectAttachment, + ListInterconnectAttachmentsPage, + ListInterconnectAttachmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInterconnectAttachmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInterconnectAttachmentsPagedResponse apply(ListInterconnectAttachmentsPage input) { + return new ListInterconnectAttachmentsPagedResponse(input); + } + }); + } + + private ListInterconnectAttachmentsPagedResponse(ListInterconnectAttachmentsPage page) { + super(page, ListInterconnectAttachmentsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInterconnectAttachmentsPage extends AbstractPage< + ListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentList, + InterconnectAttachment, + ListInterconnectAttachmentsPage> { + + private ListInterconnectAttachmentsPage( + PageContext context, + InterconnectAttachmentList response) { + super(context, response); + } + + private static ListInterconnectAttachmentsPage createEmptyPage() { + return new ListInterconnectAttachmentsPage(null, null); + } + + @Override + protected ListInterconnectAttachmentsPage createPage( + PageContext context, + InterconnectAttachmentList response) { + return new ListInterconnectAttachmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInterconnectAttachmentsFixedSizeCollection extends AbstractFixedSizeCollection< + ListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentList, + InterconnectAttachment, + ListInterconnectAttachmentsPage, + ListInterconnectAttachmentsFixedSizeCollection> { + + private ListInterconnectAttachmentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInterconnectAttachmentsFixedSizeCollection createEmptyCollection() { + return new ListInterconnectAttachmentsFixedSizeCollection(null, 0); + } + + @Override + protected ListInterconnectAttachmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInterconnectAttachmentsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java new file mode 100644 index 000000000000..1103e1b6c6b1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectAttachmentList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private InterconnectAttachmentList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private InterconnectAttachmentList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectAttachment item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectAttachmentList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectAttachmentList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectAttachmentList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectAttachmentList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InterconnectAttachmentList other) { + if (other == InterconnectAttachmentList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InterconnectAttachmentList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InterconnectAttachment items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InterconnectAttachmentList build() { + + + + + + return new InterconnectAttachmentList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectAttachmentList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectAttachmentList) { + InterconnectAttachmentList that = (InterconnectAttachmentList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java new file mode 100644 index 000000000000..151a168624cb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java @@ -0,0 +1,210 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectAttachmentName implements com.google.api.resourcenames.ResourceName { + private final String interconnectAttachment; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InterconnectAttachmentName(Builder builder) { + interconnectAttachment = Preconditions.checkNotNull(builder.getInterconnectAttachment()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static InterconnectAttachmentName of( + String interconnectAttachment, + String project, + String region + ) { + return newBuilder() + .setInterconnectAttachment(interconnectAttachment) + .setProject(project) + .setRegion(region) + .build(); + } + + public static String format( + String interconnectAttachment, + String project, + String region + ) { + return of( + interconnectAttachment, + project, + region + ) + .toString(); + } + + public String getInterconnectAttachment() { + return interconnectAttachment; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("interconnectAttachment", interconnectAttachment); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InterconnectAttachmentName parse(String formattedString) {return InterconnectAttachmentName.parse(formattedString);} + }; + } + + public static InterconnectAttachmentName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InterconnectAttachmentName.parse: formattedString not in valid format"); + return of( + matchMap.get("interconnectAttachment"), + matchMap.get("project"), + matchMap.get("region") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String interconnectAttachment; + private String project; + private String region; + + public String getInterconnectAttachment() { + return interconnectAttachment; + } + public String getProject() { + return project; + } + public String getRegion() { + return region; + } + + public Builder setInterconnectAttachment(String interconnectAttachment) { + this.interconnectAttachment = interconnectAttachment; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder (InterconnectAttachmentName interconnectAttachmentName) { + interconnectAttachment = interconnectAttachmentName.interconnectAttachment; + project = interconnectAttachmentName.project; + region = interconnectAttachmentName.region; + } + + public InterconnectAttachmentName build() { + return new InterconnectAttachmentName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "interconnectAttachment", interconnectAttachment, + "project", project, + "region", region + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectAttachmentName) { + InterconnectAttachmentName that = (InterconnectAttachmentName) o; + return + Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + interconnectAttachment, + project, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java new file mode 100644 index 000000000000..bce867527052 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectAttachmentPrivateInfo implements ApiMessage { + private final Integer tag8021q; + + private InterconnectAttachmentPrivateInfo() { + this.tag8021q = null; + } + + + private InterconnectAttachmentPrivateInfo( + Integer tag8021q + ) { + this.tag8021q = tag8021q; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("tag8021q") && tag8021q != null) { + fieldMap.put("tag8021q", Collections.singletonList(String.valueOf(tag8021q))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("tag8021q")) { + return String.valueOf(tag8021q); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getTag8021q() { + return tag8021q; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectAttachmentPrivateInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectAttachmentPrivateInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectAttachmentPrivateInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectAttachmentPrivateInfo(); + } + + public static class Builder { + private Integer tag8021q; + + Builder() {} + + public Builder mergeFrom(InterconnectAttachmentPrivateInfo other) { + if (other == InterconnectAttachmentPrivateInfo.getDefaultInstance()) return this; + if (other.getTag8021q() != null) { + this.tag8021q = other.tag8021q; + } + return this; + } + + Builder(InterconnectAttachmentPrivateInfo source) { + this.tag8021q = source.tag8021q; + } + + public Integer getTag8021q() { + return tag8021q; + } + + public Builder setTag8021q(Integer tag8021q) { + this.tag8021q = tag8021q; + return this; + } + + + public InterconnectAttachmentPrivateInfo build() { + return new InterconnectAttachmentPrivateInfo( + tag8021q + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setTag8021q(this.tag8021q); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectAttachmentPrivateInfo{" + + "tag8021q=" + tag8021q + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectAttachmentPrivateInfo) { + InterconnectAttachmentPrivateInfo that = (InterconnectAttachmentPrivateInfo) o; + return + Objects.equals(this.tag8021q, that.getTag8021q()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + tag8021q + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java new file mode 100644 index 000000000000..278c04f6e295 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import com.google.cloud.compute.v1.stub.InterconnectAttachmentStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InterconnectAttachmentClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteInterconnectAttachment to 30 seconds: + * + *

+ * 
+ * InterconnectAttachmentSettings.Builder interconnectAttachmentSettingsBuilder =
+ *     InterconnectAttachmentSettings.newBuilder();
+ * interconnectAttachmentSettingsBuilder.deleteInterconnectAttachmentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InterconnectAttachmentSettings interconnectAttachmentSettings = interconnectAttachmentSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectAttachmentSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListInterconnectAttachments. + */ + public PagedCallSettings aggregatedListInterconnectAttachmentsSettings() { + return ((InterconnectAttachmentStubSettings) getStubSettings()).aggregatedListInterconnectAttachmentsSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteInterconnectAttachment. + */ + public UnaryCallSettings deleteInterconnectAttachmentSettings() { + return ((InterconnectAttachmentStubSettings) getStubSettings()).deleteInterconnectAttachmentSettings(); + } + + /** + * Returns the object with the settings used for calls to getInterconnectAttachment. + */ + public UnaryCallSettings getInterconnectAttachmentSettings() { + return ((InterconnectAttachmentStubSettings) getStubSettings()).getInterconnectAttachmentSettings(); + } + + /** + * Returns the object with the settings used for calls to insertInterconnectAttachment. + */ + public UnaryCallSettings insertInterconnectAttachmentSettings() { + return ((InterconnectAttachmentStubSettings) getStubSettings()).insertInterconnectAttachmentSettings(); + } + + /** + * Returns the object with the settings used for calls to listInterconnectAttachments. + */ + public PagedCallSettings listInterconnectAttachmentsSettings() { + return ((InterconnectAttachmentStubSettings) getStubSettings()).listInterconnectAttachmentsSettings(); + } + + + public static final InterconnectAttachmentSettings create(InterconnectAttachmentStubSettings stub) throws IOException { + return new InterconnectAttachmentSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InterconnectAttachmentStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InterconnectAttachmentStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InterconnectAttachmentStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InterconnectAttachmentStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InterconnectAttachmentStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InterconnectAttachmentStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InterconnectAttachmentStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InterconnectAttachmentStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InterconnectAttachmentSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InterconnectAttachmentSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InterconnectAttachmentStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InterconnectAttachmentStubSettings.newBuilder()); + } + + protected Builder(InterconnectAttachmentSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InterconnectAttachmentStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InterconnectAttachmentStubSettings.Builder getStubSettingsBuilder() { + return ((InterconnectAttachmentStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInterconnectAttachments. + */ + public PagedCallSettings.Builder aggregatedListInterconnectAttachmentsSettings() { + return getStubSettingsBuilder().aggregatedListInterconnectAttachmentsSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteInterconnectAttachment. + */ + public UnaryCallSettings.Builder deleteInterconnectAttachmentSettings() { + return getStubSettingsBuilder().deleteInterconnectAttachmentSettings(); + } + + /** + * Returns the builder for the settings used for calls to getInterconnectAttachment. + */ + public UnaryCallSettings.Builder getInterconnectAttachmentSettings() { + return getStubSettingsBuilder().getInterconnectAttachmentSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertInterconnectAttachment. + */ + public UnaryCallSettings.Builder insertInterconnectAttachmentSettings() { + return getStubSettingsBuilder().insertInterconnectAttachmentSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInterconnectAttachments. + */ + public PagedCallSettings.Builder listInterconnectAttachmentsSettings() { + return getStubSettingsBuilder().listInterconnectAttachmentsSettings(); + } + + @Override + public InterconnectAttachmentSettings build() throws IOException { + return new InterconnectAttachmentSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java new file mode 100644 index 000000000000..f6395deb86cb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectAttachmentsScopedList implements ApiMessage { + private final List interconnectAttachments; + private final Warning warning; + + private InterconnectAttachmentsScopedList() { + this.interconnectAttachments = null; + this.warning = null; + } + + + private InterconnectAttachmentsScopedList( + List interconnectAttachments, + Warning warning + ) { + this.interconnectAttachments = interconnectAttachments; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectAttachment item : interconnectAttachments) { + stringList.add(item.toString()); + } + fieldMap.put("interconnectAttachments", stringList.build()); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("interconnectAttachments")) { + return String.valueOf(interconnectAttachments); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getInterconnectAttachmentsList() { + return interconnectAttachments; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectAttachmentsScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectAttachmentsScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectAttachmentsScopedList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectAttachmentsScopedList(); + } + + public static class Builder { + private List interconnectAttachments; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InterconnectAttachmentsScopedList other) { + if (other == InterconnectAttachmentsScopedList.getDefaultInstance()) return this; + if (other.getInterconnectAttachmentsList() != null) { + this.interconnectAttachments = other.interconnectAttachments; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InterconnectAttachmentsScopedList source) { + this.interconnectAttachments = source.interconnectAttachments; + this.warning = source.warning; + } + + public List getInterconnectAttachmentsList() { + return interconnectAttachments; + } + + public Builder addAllInterconnectAttachments(List interconnectAttachments) { + if (this.interconnectAttachments == null) { + this.interconnectAttachments = new ArrayList<>(interconnectAttachments.size()); + } + this.interconnectAttachments.addAll(interconnectAttachments); + return this; + } + + public Builder addInterconnectAttachments(InterconnectAttachment interconnectAttachments) { + this.interconnectAttachments.add(interconnectAttachments); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InterconnectAttachmentsScopedList build() { + + return new InterconnectAttachmentsScopedList( + interconnectAttachments, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInterconnectAttachments(this.interconnectAttachments); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectAttachmentsScopedList{" + + "interconnectAttachments=" + interconnectAttachments + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectAttachmentsScopedList) { + InterconnectAttachmentsScopedList that = (InterconnectAttachmentsScopedList) o; + return + Objects.equals(this.interconnectAttachments, that.getInterconnectAttachmentsList()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + interconnectAttachments, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java new file mode 100644 index 000000000000..54fb17161bb6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectCircuitInfo implements ApiMessage { + private final String customerDemarcId; + private final String googleCircuitId; + private final String googleDemarcId; + + private InterconnectCircuitInfo() { + this.customerDemarcId = null; + this.googleCircuitId = null; + this.googleDemarcId = null; + } + + + private InterconnectCircuitInfo( + String customerDemarcId, + String googleCircuitId, + String googleDemarcId + ) { + this.customerDemarcId = customerDemarcId; + this.googleCircuitId = googleCircuitId; + this.googleDemarcId = googleDemarcId; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("customerDemarcId") && customerDemarcId != null) { + fieldMap.put("customerDemarcId", Collections.singletonList(String.valueOf(customerDemarcId))); + } + if (fieldNames.contains("googleCircuitId") && googleCircuitId != null) { + fieldMap.put("googleCircuitId", Collections.singletonList(String.valueOf(googleCircuitId))); + } + if (fieldNames.contains("googleDemarcId") && googleDemarcId != null) { + fieldMap.put("googleDemarcId", Collections.singletonList(String.valueOf(googleDemarcId))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("customerDemarcId")) { + return String.valueOf(customerDemarcId); + } + if (fieldName.equals("googleCircuitId")) { + return String.valueOf(googleCircuitId); + } + if (fieldName.equals("googleDemarcId")) { + return String.valueOf(googleDemarcId); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCustomerDemarcId() { + return customerDemarcId; + } + + public String getGoogleCircuitId() { + return googleCircuitId; + } + + public String getGoogleDemarcId() { + return googleDemarcId; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectCircuitInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectCircuitInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectCircuitInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectCircuitInfo(); + } + + public static class Builder { + private String customerDemarcId; + private String googleCircuitId; + private String googleDemarcId; + + Builder() {} + + public Builder mergeFrom(InterconnectCircuitInfo other) { + if (other == InterconnectCircuitInfo.getDefaultInstance()) return this; + if (other.getCustomerDemarcId() != null) { + this.customerDemarcId = other.customerDemarcId; + } + if (other.getGoogleCircuitId() != null) { + this.googleCircuitId = other.googleCircuitId; + } + if (other.getGoogleDemarcId() != null) { + this.googleDemarcId = other.googleDemarcId; + } + return this; + } + + Builder(InterconnectCircuitInfo source) { + this.customerDemarcId = source.customerDemarcId; + this.googleCircuitId = source.googleCircuitId; + this.googleDemarcId = source.googleDemarcId; + } + + public String getCustomerDemarcId() { + return customerDemarcId; + } + + public Builder setCustomerDemarcId(String customerDemarcId) { + this.customerDemarcId = customerDemarcId; + return this; + } + + public String getGoogleCircuitId() { + return googleCircuitId; + } + + public Builder setGoogleCircuitId(String googleCircuitId) { + this.googleCircuitId = googleCircuitId; + return this; + } + + public String getGoogleDemarcId() { + return googleDemarcId; + } + + public Builder setGoogleDemarcId(String googleDemarcId) { + this.googleDemarcId = googleDemarcId; + return this; + } + + + public InterconnectCircuitInfo build() { + + + return new InterconnectCircuitInfo( + customerDemarcId, + googleCircuitId, + googleDemarcId + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCustomerDemarcId(this.customerDemarcId); + newBuilder.setGoogleCircuitId(this.googleCircuitId); + newBuilder.setGoogleDemarcId(this.googleDemarcId); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectCircuitInfo{" + + "customerDemarcId=" + customerDemarcId + ", " + + "googleCircuitId=" + googleCircuitId + ", " + + "googleDemarcId=" + googleDemarcId + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectCircuitInfo) { + InterconnectCircuitInfo that = (InterconnectCircuitInfo) o; + return + Objects.equals(this.customerDemarcId, that.getCustomerDemarcId()) && + Objects.equals(this.googleCircuitId, that.getGoogleCircuitId()) && + Objects.equals(this.googleDemarcId, that.getGoogleDemarcId()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + customerDemarcId, + googleCircuitId, + googleDemarcId + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java new file mode 100644 index 000000000000..3d5c5b5f4485 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java @@ -0,0 +1,876 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InterconnectStub; +import com.google.cloud.compute.v1.stub.InterconnectStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+ *   String requestId = "";
+ *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+ *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the interconnectClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InterconnectSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InterconnectSettings interconnectSettings =
+ *     InterconnectSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InterconnectClient interconnectClient =
+ *     InterconnectClient.create(interconnectSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InterconnectSettings interconnectSettings =
+ *     InterconnectSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InterconnectClient interconnectClient =
+ *     InterconnectClient.create(interconnectSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectClient implements BackgroundResource { + private final InterconnectSettings settings; + private final InterconnectStub stub; + + + + /** + * Constructs an instance of InterconnectClient with default settings. + */ + public static final InterconnectClient create() throws IOException { + return create(InterconnectSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InterconnectClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InterconnectClient create(InterconnectSettings settings) throws IOException { + return new InterconnectClient(settings); + } + + /** + * Constructs an instance of InterconnectClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InterconnectSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InterconnectClient create(InterconnectStub stub) { + return new InterconnectClient(stub); + } + + /** + * Constructs an instance of InterconnectClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InterconnectClient(InterconnectSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InterconnectStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InterconnectClient(InterconnectStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InterconnectSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InterconnectStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param interconnect Name of the interconnect to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInterconnect(String requestId, InterconnectName interconnect) { + + DeleteInterconnectHttpRequest request = + DeleteInterconnectHttpRequest.newBuilder() + .setRequestId(requestId) + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .build(); + return deleteInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect.toString());
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param interconnect Name of the interconnect to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInterconnect(String requestId, String interconnect) { + + DeleteInterconnectHttpRequest request = + DeleteInterconnectHttpRequest.newBuilder() + .setRequestId(requestId) + .setInterconnect(interconnect) + .build(); + return deleteInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setInterconnect(interconnect.toString())
+   *     .build();
+   *   Operation response = interconnectClient.deleteInterconnect(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteInterconnect(DeleteInterconnectHttpRequest request) { + return deleteInterconnectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified interconnect. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setInterconnect(interconnect.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = interconnectClient.deleteInterconnectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteInterconnectCallable() { + return stub.deleteInterconnectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Interconnect response = interconnectClient.getInterconnect(interconnect);
+   * }
+   * 
+ * + * @param interconnect Name of the interconnect to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Interconnect getInterconnect(InterconnectName interconnect) { + + GetInterconnectHttpRequest request = + GetInterconnectHttpRequest.newBuilder() + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .build(); + return getInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Interconnect response = interconnectClient.getInterconnect(interconnect.toString());
+   * }
+   * 
+ * + * @param interconnect Name of the interconnect to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Interconnect getInterconnect(String interconnect) { + + GetInterconnectHttpRequest request = + GetInterconnectHttpRequest.newBuilder() + .setInterconnect(interconnect) + .build(); + return getInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder()
+   *     .setInterconnect(interconnect.toString())
+   *     .build();
+   *   Interconnect response = interconnectClient.getInterconnect(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Interconnect getInterconnect(GetInterconnectHttpRequest request) { + return getInterconnectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder()
+   *     .setInterconnect(interconnect.toString())
+   *     .build();
+   *   ApiFuture<Interconnect> future = interconnectClient.getInterconnectCallable().futureCall(request);
+   *   // Do something
+   *   Interconnect response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInterconnectCallable() { + return stub.getInterconnectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Interconnect in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   Operation response = interconnectClient.insertInterconnect(requestId, project, interconnectResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInterconnect(String requestId, ProjectName project, Interconnect interconnectResource) { + + InsertInterconnectHttpRequest request = + InsertInterconnectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setInterconnectResource(interconnectResource) + .build(); + return insertInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Interconnect in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   Operation response = interconnectClient.insertInterconnect(requestId, project.toString(), interconnectResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInterconnect(String requestId, String project, Interconnect interconnectResource) { + + InsertInterconnectHttpRequest request = + InsertInterconnectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setInterconnectResource(interconnectResource) + .build(); + return insertInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Interconnect in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setInterconnectResource(interconnectResource)
+   *     .build();
+   *   Operation response = interconnectClient.insertInterconnect(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertInterconnect(InsertInterconnectHttpRequest request) { + return insertInterconnectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Interconnect in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setInterconnectResource(interconnectResource)
+   *     .build();
+   *   ApiFuture<Operation> future = interconnectClient.insertInterconnectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertInterconnectCallable() { + return stub.insertInterconnectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect available to the specified project. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Interconnect element : interconnectClient.listInterconnects(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectsPagedResponse listInterconnects(ProjectName project) { + ListInterconnectsHttpRequest request = + ListInterconnectsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listInterconnects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect available to the specified project. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (Interconnect element : interconnectClient.listInterconnects(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectsPagedResponse listInterconnects(String project) { + ListInterconnectsHttpRequest request = + ListInterconnectsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listInterconnects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect available to the specified project. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInterconnectsHttpRequest request = ListInterconnectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (Interconnect element : interconnectClient.listInterconnects(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectsPagedResponse listInterconnects(ListInterconnectsHttpRequest request) { + return listInterconnectsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect available to the specified project. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInterconnectsHttpRequest request = ListInterconnectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListInterconnectsPagedResponse> future = interconnectClient.listInterconnectsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Interconnect element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInterconnectsPagedCallable() { + return stub.listInterconnectsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect available to the specified project. + * + * Sample code: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInterconnectsHttpRequest request = ListInterconnectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InterconnectList response = interconnectClient.listInterconnectsCallable().call(request);
+   *     for (Interconnect element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInterconnectsCallable() { + return stub.listInterconnectsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect, interconnectResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param interconnect Name of the interconnect to update. + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInterconnect(String requestId, InterconnectName interconnect, Interconnect interconnectResource) { + + PatchInterconnectHttpRequest request = + PatchInterconnectHttpRequest.newBuilder() + .setRequestId(requestId) + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .setInterconnectResource(interconnectResource) + .build(); + return patchInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect.toString(), interconnectResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param interconnect Name of the interconnect to update. + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInterconnect(String requestId, String interconnect, Interconnect interconnectResource) { + + PatchInterconnectHttpRequest request = + PatchInterconnectHttpRequest.newBuilder() + .setRequestId(requestId) + .setInterconnect(interconnect) + .setInterconnectResource(interconnectResource) + .build(); + return patchInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setInterconnect(interconnect.toString())
+   *     .setInterconnectResource(interconnectResource)
+   *     .build();
+   *   Operation response = interconnectClient.patchInterconnect(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInterconnect(PatchInterconnectHttpRequest request) { + return patchInterconnectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   String requestId = "";
+   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   Interconnect interconnectResource = Interconnect.newBuilder().build();
+   *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setInterconnect(interconnect.toString())
+   *     .setInterconnectResource(interconnectResource)
+   *     .build();
+   *   ApiFuture<Operation> future = interconnectClient.patchInterconnectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchInterconnectCallable() { + return stub.patchInterconnectCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListInterconnectsPagedResponse extends AbstractPagedListResponse< + ListInterconnectsHttpRequest, + InterconnectList, + Interconnect, + ListInterconnectsPage, + ListInterconnectsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInterconnectsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInterconnectsPagedResponse apply(ListInterconnectsPage input) { + return new ListInterconnectsPagedResponse(input); + } + }); + } + + private ListInterconnectsPagedResponse(ListInterconnectsPage page) { + super(page, ListInterconnectsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInterconnectsPage extends AbstractPage< + ListInterconnectsHttpRequest, + InterconnectList, + Interconnect, + ListInterconnectsPage> { + + private ListInterconnectsPage( + PageContext context, + InterconnectList response) { + super(context, response); + } + + private static ListInterconnectsPage createEmptyPage() { + return new ListInterconnectsPage(null, null); + } + + @Override + protected ListInterconnectsPage createPage( + PageContext context, + InterconnectList response) { + return new ListInterconnectsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInterconnectsFixedSizeCollection extends AbstractFixedSizeCollection< + ListInterconnectsHttpRequest, + InterconnectList, + Interconnect, + ListInterconnectsPage, + ListInterconnectsFixedSizeCollection> { + + private ListInterconnectsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInterconnectsFixedSizeCollection createEmptyCollection() { + return new ListInterconnectsFixedSizeCollection(null, 0); + } + + @Override + protected ListInterconnectsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInterconnectsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java new file mode 100644 index 000000000000..9081f9c9225f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private InterconnectList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private InterconnectList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Interconnect item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InterconnectList other) { + if (other == InterconnectList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InterconnectList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(Interconnect items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InterconnectList build() { + + + + + + return new InterconnectList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectList) { + InterconnectList that = (InterconnectList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java new file mode 100644 index 000000000000..02104992ca70 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java @@ -0,0 +1,616 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectLocation implements ApiMessage { + private final String address; + private final String availabilityZone; + private final String city; + private final String continent; + private final String creationTimestamp; + private final String description; + private final String facilityProvider; + private final String facilityProviderFacilityId; + private final String id; + private final String kind; + private final String name; + private final String peeringdbFacilityId; + private final List regionInfos; + private final String selfLink; + + private InterconnectLocation() { + this.address = null; + this.availabilityZone = null; + this.city = null; + this.continent = null; + this.creationTimestamp = null; + this.description = null; + this.facilityProvider = null; + this.facilityProviderFacilityId = null; + this.id = null; + this.kind = null; + this.name = null; + this.peeringdbFacilityId = null; + this.regionInfos = null; + this.selfLink = null; + } + + + private InterconnectLocation( + String address, + String availabilityZone, + String city, + String continent, + String creationTimestamp, + String description, + String facilityProvider, + String facilityProviderFacilityId, + String id, + String kind, + String name, + String peeringdbFacilityId, + List regionInfos, + String selfLink + ) { + this.address = address; + this.availabilityZone = availabilityZone; + this.city = city; + this.continent = continent; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.facilityProvider = facilityProvider; + this.facilityProviderFacilityId = facilityProviderFacilityId; + this.id = id; + this.kind = kind; + this.name = name; + this.peeringdbFacilityId = peeringdbFacilityId; + this.regionInfos = regionInfos; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("availabilityZone") && availabilityZone != null) { + fieldMap.put("availabilityZone", Collections.singletonList(String.valueOf(availabilityZone))); + } + if (fieldNames.contains("city") && city != null) { + fieldMap.put("city", Collections.singletonList(String.valueOf(city))); + } + if (fieldNames.contains("continent") && continent != null) { + fieldMap.put("continent", Collections.singletonList(String.valueOf(continent))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("facilityProvider") && facilityProvider != null) { + fieldMap.put("facilityProvider", Collections.singletonList(String.valueOf(facilityProvider))); + } + if (fieldNames.contains("facilityProviderFacilityId") && facilityProviderFacilityId != null) { + fieldMap.put("facilityProviderFacilityId", Collections.singletonList(String.valueOf(facilityProviderFacilityId))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peeringdbFacilityId") && peeringdbFacilityId != null) { + fieldMap.put("peeringdbFacilityId", Collections.singletonList(String.valueOf(peeringdbFacilityId))); + } + if (fieldNames.contains("regionInfos") && regionInfos != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectLocationRegionInfo item : regionInfos) { + stringList.add(item.toString()); + } + fieldMap.put("regionInfos", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("address")) { + return String.valueOf(address); + } + if (fieldName.equals("availabilityZone")) { + return String.valueOf(availabilityZone); + } + if (fieldName.equals("city")) { + return String.valueOf(city); + } + if (fieldName.equals("continent")) { + return String.valueOf(continent); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("facilityProvider")) { + return String.valueOf(facilityProvider); + } + if (fieldName.equals("facilityProviderFacilityId")) { + return String.valueOf(facilityProviderFacilityId); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("peeringdbFacilityId")) { + return String.valueOf(peeringdbFacilityId); + } + if (fieldName.equals("regionInfos")) { + return String.valueOf(regionInfos); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAddress() { + return address; + } + + public String getAvailabilityZone() { + return availabilityZone; + } + + public String getCity() { + return city; + } + + public String getContinent() { + return continent; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getFacilityProvider() { + return facilityProvider; + } + + public String getFacilityProviderFacilityId() { + return facilityProviderFacilityId; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getPeeringdbFacilityId() { + return peeringdbFacilityId; + } + + public List getRegionInfosList() { + return regionInfos; + } + + public String getSelfLink() { + return selfLink; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectLocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectLocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectLocation(); + } + + public static class Builder { + private String address; + private String availabilityZone; + private String city; + private String continent; + private String creationTimestamp; + private String description; + private String facilityProvider; + private String facilityProviderFacilityId; + private String id; + private String kind; + private String name; + private String peeringdbFacilityId; + private List regionInfos; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(InterconnectLocation other) { + if (other == InterconnectLocation.getDefaultInstance()) return this; + if (other.getAddress() != null) { + this.address = other.address; + } + if (other.getAvailabilityZone() != null) { + this.availabilityZone = other.availabilityZone; + } + if (other.getCity() != null) { + this.city = other.city; + } + if (other.getContinent() != null) { + this.continent = other.continent; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getFacilityProvider() != null) { + this.facilityProvider = other.facilityProvider; + } + if (other.getFacilityProviderFacilityId() != null) { + this.facilityProviderFacilityId = other.facilityProviderFacilityId; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPeeringdbFacilityId() != null) { + this.peeringdbFacilityId = other.peeringdbFacilityId; + } + if (other.getRegionInfosList() != null) { + this.regionInfos = other.regionInfos; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(InterconnectLocation source) { + this.address = source.address; + this.availabilityZone = source.availabilityZone; + this.city = source.city; + this.continent = source.continent; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.facilityProvider = source.facilityProvider; + this.facilityProviderFacilityId = source.facilityProviderFacilityId; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.peeringdbFacilityId = source.peeringdbFacilityId; + this.regionInfos = source.regionInfos; + this.selfLink = source.selfLink; + } + + public String getAddress() { + return address; + } + + public Builder setAddress(String address) { + this.address = address; + return this; + } + + public String getAvailabilityZone() { + return availabilityZone; + } + + public Builder setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + public String getCity() { + return city; + } + + public Builder setCity(String city) { + this.city = city; + return this; + } + + public String getContinent() { + return continent; + } + + public Builder setContinent(String continent) { + this.continent = continent; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getFacilityProvider() { + return facilityProvider; + } + + public Builder setFacilityProvider(String facilityProvider) { + this.facilityProvider = facilityProvider; + return this; + } + + public String getFacilityProviderFacilityId() { + return facilityProviderFacilityId; + } + + public Builder setFacilityProviderFacilityId(String facilityProviderFacilityId) { + this.facilityProviderFacilityId = facilityProviderFacilityId; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getPeeringdbFacilityId() { + return peeringdbFacilityId; + } + + public Builder setPeeringdbFacilityId(String peeringdbFacilityId) { + this.peeringdbFacilityId = peeringdbFacilityId; + return this; + } + + public List getRegionInfosList() { + return regionInfos; + } + + public Builder addAllRegionInfos(List regionInfos) { + if (this.regionInfos == null) { + this.regionInfos = new ArrayList<>(regionInfos.size()); + } + this.regionInfos.addAll(regionInfos); + return this; + } + + public Builder addRegionInfos(InterconnectLocationRegionInfo regionInfos) { + this.regionInfos.add(regionInfos); + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + + public InterconnectLocation build() { + + + + + + + + + + + + + + return new InterconnectLocation( + address, + availabilityZone, + city, + continent, + creationTimestamp, + description, + facilityProvider, + facilityProviderFacilityId, + id, + kind, + name, + peeringdbFacilityId, + regionInfos, + selfLink + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAddress(this.address); + newBuilder.setAvailabilityZone(this.availabilityZone); + newBuilder.setCity(this.city); + newBuilder.setContinent(this.continent); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setFacilityProvider(this.facilityProvider); + newBuilder.setFacilityProviderFacilityId(this.facilityProviderFacilityId); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPeeringdbFacilityId(this.peeringdbFacilityId); + newBuilder.addAllRegionInfos(this.regionInfos); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectLocation{" + + "address=" + address + ", " + + "availabilityZone=" + availabilityZone + ", " + + "city=" + city + ", " + + "continent=" + continent + ", " + + "creationTimestamp=" + creationTimestamp + ", " + + "description=" + description + ", " + + "facilityProvider=" + facilityProvider + ", " + + "facilityProviderFacilityId=" + facilityProviderFacilityId + ", " + + "id=" + id + ", " + + "kind=" + kind + ", " + + "name=" + name + ", " + + "peeringdbFacilityId=" + peeringdbFacilityId + ", " + + "regionInfos=" + regionInfos + ", " + + "selfLink=" + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectLocation) { + InterconnectLocation that = (InterconnectLocation) o; + return + Objects.equals(this.address, that.getAddress()) && + Objects.equals(this.availabilityZone, that.getAvailabilityZone()) && + Objects.equals(this.city, that.getCity()) && + Objects.equals(this.continent, that.getContinent()) && + Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.facilityProvider, that.getFacilityProvider()) && + Objects.equals(this.facilityProviderFacilityId, that.getFacilityProviderFacilityId()) && + Objects.equals(this.id, that.getId()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.peeringdbFacilityId, that.getPeeringdbFacilityId()) && + Objects.equals(this.regionInfos, that.getRegionInfosList()) && + Objects.equals(this.selfLink, that.getSelfLink()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + address, + availabilityZone, + city, + continent, + creationTimestamp, + description, + facilityProvider, + facilityProviderFacilityId, + id, + kind, + name, + peeringdbFacilityId, + regionInfos, + selfLink + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java new file mode 100644 index 000000000000..8181d074d258 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java @@ -0,0 +1,516 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.stub.InterconnectLocationStub; +import com.google.cloud.compute.v1.stub.InterconnectLocationStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+ *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+ *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the interconnectLocationClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of InterconnectLocationSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * InterconnectLocationSettings interconnectLocationSettings =
+ *     InterconnectLocationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * InterconnectLocationClient interconnectLocationClient =
+ *     InterconnectLocationClient.create(interconnectLocationSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * InterconnectLocationSettings interconnectLocationSettings =
+ *     InterconnectLocationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * InterconnectLocationClient interconnectLocationClient =
+ *     InterconnectLocationClient.create(interconnectLocationSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectLocationClient implements BackgroundResource { + private final InterconnectLocationSettings settings; + private final InterconnectLocationStub stub; + + + + /** + * Constructs an instance of InterconnectLocationClient with default settings. + */ + public static final InterconnectLocationClient create() throws IOException { + return create(InterconnectLocationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of InterconnectLocationClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final InterconnectLocationClient create(InterconnectLocationSettings settings) throws IOException { + return new InterconnectLocationClient(settings); + } + + /** + * Constructs an instance of InterconnectLocationClient, using the given stub for making calls. This is for + * advanced usage - prefer to use InterconnectLocationSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final InterconnectLocationClient create(InterconnectLocationStub stub) { + return new InterconnectLocationClient(stub); + } + + /** + * Constructs an instance of InterconnectLocationClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected InterconnectLocationClient(InterconnectLocationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((InterconnectLocationStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected InterconnectLocationClient(InterconnectLocationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final InterconnectLocationSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InterconnectLocationStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
+   * }
+   * 
+ * + * @param interconnectLocation Name of the interconnect location to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectLocation getInterconnectLocation(InterconnectLocationName interconnectLocation) { + + GetInterconnectLocationHttpRequest request = + GetInterconnectLocationHttpRequest.newBuilder() + .setInterconnectLocation(interconnectLocation == null ? null : interconnectLocation.toString()) + .build(); + return getInterconnectLocation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation.toString());
+   * }
+   * 
+ * + * @param interconnectLocation Name of the interconnect location to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectLocation getInterconnectLocation(String interconnectLocation) { + + GetInterconnectLocationHttpRequest request = + GetInterconnectLocationHttpRequest.newBuilder() + .setInterconnectLocation(interconnectLocation) + .build(); + return getInterconnectLocation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder()
+   *     .setInterconnectLocation(interconnectLocation.toString())
+   *     .build();
+   *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectLocation getInterconnectLocation(GetInterconnectLocationHttpRequest request) { + return getInterconnectLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder()
+   *     .setInterconnectLocation(interconnectLocation.toString())
+   *     .build();
+   *   ApiFuture<InterconnectLocation> future = interconnectLocationClient.getInterconnectLocationCallable().futureCall(request);
+   *   // Do something
+   *   InterconnectLocation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getInterconnectLocationCallable() { + return stub.getInterconnectLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InterconnectLocation element : interconnectLocationClient.listInterconnectLocations(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectLocationsPagedResponse listInterconnectLocations(ProjectName project) { + ListInterconnectLocationsHttpRequest request = + ListInterconnectLocationsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listInterconnectLocations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (InterconnectLocation element : interconnectLocationClient.listInterconnectLocations(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectLocationsPagedResponse listInterconnectLocations(String project) { + ListInterconnectLocationsHttpRequest request = + ListInterconnectLocationsHttpRequest.newBuilder() + .setProject(project) + .build(); + return listInterconnectLocations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInterconnectLocationsHttpRequest request = ListInterconnectLocationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (InterconnectLocation element : interconnectLocationClient.listInterconnectLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListInterconnectLocationsPagedResponse listInterconnectLocations(ListInterconnectLocationsHttpRequest request) { + return listInterconnectLocationsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInterconnectLocationsHttpRequest request = ListInterconnectLocationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListInterconnectLocationsPagedResponse> future = interconnectLocationClient.listInterconnectLocationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (InterconnectLocation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInterconnectLocationsPagedCallable() { + return stub.listInterconnectLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * Sample code: + *

+   * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListInterconnectLocationsHttpRequest request = ListInterconnectLocationsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     InterconnectLocationList response = interconnectLocationClient.listInterconnectLocationsCallable().call(request);
+   *     for (InterconnectLocation element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listInterconnectLocationsCallable() { + return stub.listInterconnectLocationsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListInterconnectLocationsPagedResponse extends AbstractPagedListResponse< + ListInterconnectLocationsHttpRequest, + InterconnectLocationList, + InterconnectLocation, + ListInterconnectLocationsPage, + ListInterconnectLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInterconnectLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInterconnectLocationsPagedResponse apply(ListInterconnectLocationsPage input) { + return new ListInterconnectLocationsPagedResponse(input); + } + }); + } + + private ListInterconnectLocationsPagedResponse(ListInterconnectLocationsPage page) { + super(page, ListInterconnectLocationsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListInterconnectLocationsPage extends AbstractPage< + ListInterconnectLocationsHttpRequest, + InterconnectLocationList, + InterconnectLocation, + ListInterconnectLocationsPage> { + + private ListInterconnectLocationsPage( + PageContext context, + InterconnectLocationList response) { + super(context, response); + } + + private static ListInterconnectLocationsPage createEmptyPage() { + return new ListInterconnectLocationsPage(null, null); + } + + @Override + protected ListInterconnectLocationsPage createPage( + PageContext context, + InterconnectLocationList response) { + return new ListInterconnectLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListInterconnectLocationsFixedSizeCollection extends AbstractFixedSizeCollection< + ListInterconnectLocationsHttpRequest, + InterconnectLocationList, + InterconnectLocation, + ListInterconnectLocationsPage, + ListInterconnectLocationsFixedSizeCollection> { + + private ListInterconnectLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInterconnectLocationsFixedSizeCollection createEmptyCollection() { + return new ListInterconnectLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListInterconnectLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInterconnectLocationsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java new file mode 100644 index 000000000000..d5ba537a563a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectLocationList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private InterconnectLocationList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private InterconnectLocationList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectLocation item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectLocationList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectLocationList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectLocationList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectLocationList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(InterconnectLocationList other) { + if (other == InterconnectLocationList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(InterconnectLocationList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(InterconnectLocation items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public InterconnectLocationList build() { + + + + + + return new InterconnectLocationList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectLocationList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectLocationList) { + InterconnectLocationList that = (InterconnectLocationList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java new file mode 100644 index 000000000000..f924818e69d0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java @@ -0,0 +1,186 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectLocationName implements com.google.api.resourcenames.ResourceName { + private final String interconnectLocation; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnectLocations/{interconnectLocation}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InterconnectLocationName(Builder builder) { + interconnectLocation = Preconditions.checkNotNull(builder.getInterconnectLocation()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static InterconnectLocationName of( + String interconnectLocation, + String project + ) { + return newBuilder() + .setInterconnectLocation(interconnectLocation) + .setProject(project) + .build(); + } + + public static String format( + String interconnectLocation, + String project + ) { + return of( + interconnectLocation, + project + ) + .toString(); + } + + public String getInterconnectLocation() { + return interconnectLocation; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("interconnectLocation", interconnectLocation); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InterconnectLocationName parse(String formattedString) {return InterconnectLocationName.parse(formattedString);} + }; + } + + public static InterconnectLocationName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InterconnectLocationName.parse: formattedString not in valid format"); + return of( + matchMap.get("interconnectLocation"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String interconnectLocation; + private String project; + + public String getInterconnectLocation() { + return interconnectLocation; + } + public String getProject() { + return project; + } + + public Builder setInterconnectLocation(String interconnectLocation) { + this.interconnectLocation = interconnectLocation; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (InterconnectLocationName interconnectLocationName) { + interconnectLocation = interconnectLocationName.interconnectLocation; + project = interconnectLocationName.project; + } + + public InterconnectLocationName build() { + return new InterconnectLocationName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "interconnectLocation", interconnectLocation, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectLocationName) { + InterconnectLocationName that = (InterconnectLocationName) o; + return + Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + interconnectLocation, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java new file mode 100644 index 000000000000..e281d763e9bd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectLocationRegionInfo implements ApiMessage { + private final String expectedRttMs; + private final String locationPresence; + private final String region; + + private InterconnectLocationRegionInfo() { + this.expectedRttMs = null; + this.locationPresence = null; + this.region = null; + } + + + private InterconnectLocationRegionInfo( + String expectedRttMs, + String locationPresence, + String region + ) { + this.expectedRttMs = expectedRttMs; + this.locationPresence = locationPresence; + this.region = region; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("expectedRttMs") && expectedRttMs != null) { + fieldMap.put("expectedRttMs", Collections.singletonList(String.valueOf(expectedRttMs))); + } + if (fieldNames.contains("locationPresence") && locationPresence != null) { + fieldMap.put("locationPresence", Collections.singletonList(String.valueOf(locationPresence))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("expectedRttMs")) { + return String.valueOf(expectedRttMs); + } + if (fieldName.equals("locationPresence")) { + return String.valueOf(locationPresence); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getExpectedRttMs() { + return expectedRttMs; + } + + public String getLocationPresence() { + return locationPresence; + } + + public String getRegion() { + return region; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectLocationRegionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectLocationRegionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectLocationRegionInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectLocationRegionInfo(); + } + + public static class Builder { + private String expectedRttMs; + private String locationPresence; + private String region; + + Builder() {} + + public Builder mergeFrom(InterconnectLocationRegionInfo other) { + if (other == InterconnectLocationRegionInfo.getDefaultInstance()) return this; + if (other.getExpectedRttMs() != null) { + this.expectedRttMs = other.expectedRttMs; + } + if (other.getLocationPresence() != null) { + this.locationPresence = other.locationPresence; + } + if (other.getRegion() != null) { + this.region = other.region; + } + return this; + } + + Builder(InterconnectLocationRegionInfo source) { + this.expectedRttMs = source.expectedRttMs; + this.locationPresence = source.locationPresence; + this.region = source.region; + } + + public String getExpectedRttMs() { + return expectedRttMs; + } + + public Builder setExpectedRttMs(String expectedRttMs) { + this.expectedRttMs = expectedRttMs; + return this; + } + + public String getLocationPresence() { + return locationPresence; + } + + public Builder setLocationPresence(String locationPresence) { + this.locationPresence = locationPresence; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + + public InterconnectLocationRegionInfo build() { + + + return new InterconnectLocationRegionInfo( + expectedRttMs, + locationPresence, + region + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setExpectedRttMs(this.expectedRttMs); + newBuilder.setLocationPresence(this.locationPresence); + newBuilder.setRegion(this.region); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectLocationRegionInfo{" + + "expectedRttMs=" + expectedRttMs + ", " + + "locationPresence=" + locationPresence + ", " + + "region=" + region + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectLocationRegionInfo) { + InterconnectLocationRegionInfo that = (InterconnectLocationRegionInfo) o; + return + Objects.equals(this.expectedRttMs, that.getExpectedRttMs()) && + Objects.equals(this.locationPresence, that.getLocationPresence()) && + Objects.equals(this.region, that.getRegion()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + expectedRttMs, + locationPresence, + region + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java new file mode 100644 index 000000000000..d51c80c7d0ab --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java @@ -0,0 +1,240 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import com.google.cloud.compute.v1.stub.InterconnectLocationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InterconnectLocationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getInterconnectLocation to 30 seconds: + * + *

+ * 
+ * InterconnectLocationSettings.Builder interconnectLocationSettingsBuilder =
+ *     InterconnectLocationSettings.newBuilder();
+ * interconnectLocationSettingsBuilder.getInterconnectLocationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InterconnectLocationSettings interconnectLocationSettings = interconnectLocationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectLocationSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getInterconnectLocation. + */ + public UnaryCallSettings getInterconnectLocationSettings() { + return ((InterconnectLocationStubSettings) getStubSettings()).getInterconnectLocationSettings(); + } + + /** + * Returns the object with the settings used for calls to listInterconnectLocations. + */ + public PagedCallSettings listInterconnectLocationsSettings() { + return ((InterconnectLocationStubSettings) getStubSettings()).listInterconnectLocationsSettings(); + } + + + public static final InterconnectLocationSettings create(InterconnectLocationStubSettings stub) throws IOException { + return new InterconnectLocationSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InterconnectLocationStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InterconnectLocationStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InterconnectLocationStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InterconnectLocationStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InterconnectLocationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InterconnectLocationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InterconnectLocationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InterconnectLocationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InterconnectLocationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InterconnectLocationSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InterconnectLocationStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InterconnectLocationStubSettings.newBuilder()); + } + + protected Builder(InterconnectLocationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InterconnectLocationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InterconnectLocationStubSettings.Builder getStubSettingsBuilder() { + return ((InterconnectLocationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getInterconnectLocation. + */ + public UnaryCallSettings.Builder getInterconnectLocationSettings() { + return getStubSettingsBuilder().getInterconnectLocationSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInterconnectLocations. + */ + public PagedCallSettings.Builder listInterconnectLocationsSettings() { + return getStubSettingsBuilder().listInterconnectLocationsSettings(); + } + + @Override + public InterconnectLocationSettings build() throws IOException { + return new InterconnectLocationSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java new file mode 100644 index 000000000000..b4176d922512 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java @@ -0,0 +1,186 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectName implements com.google.api.resourcenames.ResourceName { + private final String interconnect; + private final String project; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnects/{interconnect}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InterconnectName(Builder builder) { + interconnect = Preconditions.checkNotNull(builder.getInterconnect()); + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static InterconnectName of( + String interconnect, + String project + ) { + return newBuilder() + .setInterconnect(interconnect) + .setProject(project) + .build(); + } + + public static String format( + String interconnect, + String project + ) { + return of( + interconnect, + project + ) + .toString(); + } + + public String getInterconnect() { + return interconnect; + } + + public String getProject() { + return project; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("interconnect", interconnect); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public InterconnectName parse(String formattedString) {return InterconnectName.parse(formattedString);} + }; + } + + public static InterconnectName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InterconnectName.parse: formattedString not in valid format"); + return of( + matchMap.get("interconnect"), + matchMap.get("project") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String interconnect; + private String project; + + public String getInterconnect() { + return interconnect; + } + public String getProject() { + return project; + } + + public Builder setInterconnect(String interconnect) { + this.interconnect = interconnect; + return this; + } + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + public Builder (InterconnectName interconnectName) { + interconnect = interconnectName.interconnect; + project = interconnectName.project; + } + + public InterconnectName build() { + return new InterconnectName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "interconnect", interconnect, + "project", project + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectName) { + InterconnectName that = (InterconnectName) o; + return + Objects.equals(this.interconnect, that.getInterconnect()) && + Objects.equals(this.project, that.getProject()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + interconnect, + project + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java new file mode 100644 index 000000000000..e97fa3dc3889 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java @@ -0,0 +1,412 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InterconnectOutageNotification implements ApiMessage { + private final List affectedCircuits; + private final String description; + private final String endTime; + private final String issueType; + private final String name; + private final String source; + private final String startTime; + private final String state; + + private InterconnectOutageNotification() { + this.affectedCircuits = null; + this.description = null; + this.endTime = null; + this.issueType = null; + this.name = null; + this.source = null; + this.startTime = null; + this.state = null; + } + + + private InterconnectOutageNotification( + List affectedCircuits, + String description, + String endTime, + String issueType, + String name, + String source, + String startTime, + String state + ) { + this.affectedCircuits = affectedCircuits; + this.description = description; + this.endTime = endTime; + this.issueType = issueType; + this.name = name; + this.source = source; + this.startTime = startTime; + this.state = state; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("affectedCircuits") && affectedCircuits != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : affectedCircuits) { + stringList.add(item.toString()); + } + fieldMap.put("affectedCircuits", stringList.build()); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("endTime") && endTime != null) { + fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime))); + } + if (fieldNames.contains("issueType") && issueType != null) { + fieldMap.put("issueType", Collections.singletonList(String.valueOf(issueType))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + if (fieldNames.contains("startTime") && startTime != null) { + fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("affectedCircuits")) { + return String.valueOf(affectedCircuits); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("endTime")) { + return String.valueOf(endTime); + } + if (fieldName.equals("issueType")) { + return String.valueOf(issueType); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("source")) { + return String.valueOf(source); + } + if (fieldName.equals("startTime")) { + return String.valueOf(startTime); + } + if (fieldName.equals("state")) { + return String.valueOf(state); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getAffectedCircuitsList() { + return affectedCircuits; + } + + public String getDescription() { + return description; + } + + public String getEndTime() { + return endTime; + } + + public String getIssueType() { + return issueType; + } + + public String getName() { + return name; + } + + public String getSource() { + return source; + } + + public String getStartTime() { + return startTime; + } + + public String getState() { + return state; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(InterconnectOutageNotification prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static InterconnectOutageNotification getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final InterconnectOutageNotification DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new InterconnectOutageNotification(); + } + + public static class Builder { + private List affectedCircuits; + private String description; + private String endTime; + private String issueType; + private String name; + private String source; + private String startTime; + private String state; + + Builder() {} + + public Builder mergeFrom(InterconnectOutageNotification other) { + if (other == InterconnectOutageNotification.getDefaultInstance()) return this; + if (other.getAffectedCircuitsList() != null) { + this.affectedCircuits = other.affectedCircuits; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getEndTime() != null) { + this.endTime = other.endTime; + } + if (other.getIssueType() != null) { + this.issueType = other.issueType; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSource() != null) { + this.source = other.source; + } + if (other.getStartTime() != null) { + this.startTime = other.startTime; + } + if (other.getState() != null) { + this.state = other.state; + } + return this; + } + + Builder(InterconnectOutageNotification source) { + this.affectedCircuits = source.affectedCircuits; + this.description = source.description; + this.endTime = source.endTime; + this.issueType = source.issueType; + this.name = source.name; + this.source = source.source; + this.startTime = source.startTime; + this.state = source.state; + } + + public List getAffectedCircuitsList() { + return affectedCircuits; + } + + public Builder addAllAffectedCircuits(List affectedCircuits) { + if (this.affectedCircuits == null) { + this.affectedCircuits = new ArrayList<>(affectedCircuits.size()); + } + this.affectedCircuits.addAll(affectedCircuits); + return this; + } + + public Builder addAffectedCircuits(String affectedCircuits) { + this.affectedCircuits.add(affectedCircuits); + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getEndTime() { + return endTime; + } + + public Builder setEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + public String getIssueType() { + return issueType; + } + + public Builder setIssueType(String issueType) { + this.issueType = issueType; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSource() { + return source; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + public String getStartTime() { + return startTime; + } + + public Builder setStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + public String getState() { + return state; + } + + public Builder setState(String state) { + this.state = state; + return this; + } + + + public InterconnectOutageNotification build() { + + + + + + + + return new InterconnectOutageNotification( + affectedCircuits, + description, + endTime, + issueType, + name, + source, + startTime, + state + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllAffectedCircuits(this.affectedCircuits); + newBuilder.setDescription(this.description); + newBuilder.setEndTime(this.endTime); + newBuilder.setIssueType(this.issueType); + newBuilder.setName(this.name); + newBuilder.setSource(this.source); + newBuilder.setStartTime(this.startTime); + newBuilder.setState(this.state); + return newBuilder; + } + } + + @Override + public String toString() { + return "InterconnectOutageNotification{" + + "affectedCircuits=" + affectedCircuits + ", " + + "description=" + description + ", " + + "endTime=" + endTime + ", " + + "issueType=" + issueType + ", " + + "name=" + name + ", " + + "source=" + source + ", " + + "startTime=" + startTime + ", " + + "state=" + state + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InterconnectOutageNotification) { + InterconnectOutageNotification that = (InterconnectOutageNotification) o; + return + Objects.equals(this.affectedCircuits, that.getAffectedCircuitsList()) && + Objects.equals(this.description, that.getDescription()) && + Objects.equals(this.endTime, that.getEndTime()) && + Objects.equals(this.issueType, that.getIssueType()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.source, that.getSource()) && + Objects.equals(this.startTime, that.getStartTime()) && + Objects.equals(this.state, that.getState()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + affectedCircuits, + description, + endTime, + issueType, + name, + source, + startTime, + state + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java new file mode 100644 index 000000000000..fa44a10337b8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java @@ -0,0 +1,282 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import com.google.cloud.compute.v1.stub.InterconnectStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InterconnectClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteInterconnect to 30 seconds: + * + *

+ * 
+ * InterconnectSettings.Builder interconnectSettingsBuilder =
+ *     InterconnectSettings.newBuilder();
+ * interconnectSettingsBuilder.deleteInterconnectSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InterconnectSettings interconnectSettings = interconnectSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteInterconnect. + */ + public UnaryCallSettings deleteInterconnectSettings() { + return ((InterconnectStubSettings) getStubSettings()).deleteInterconnectSettings(); + } + + /** + * Returns the object with the settings used for calls to getInterconnect. + */ + public UnaryCallSettings getInterconnectSettings() { + return ((InterconnectStubSettings) getStubSettings()).getInterconnectSettings(); + } + + /** + * Returns the object with the settings used for calls to insertInterconnect. + */ + public UnaryCallSettings insertInterconnectSettings() { + return ((InterconnectStubSettings) getStubSettings()).insertInterconnectSettings(); + } + + /** + * Returns the object with the settings used for calls to listInterconnects. + */ + public PagedCallSettings listInterconnectsSettings() { + return ((InterconnectStubSettings) getStubSettings()).listInterconnectsSettings(); + } + + /** + * Returns the object with the settings used for calls to patchInterconnect. + */ + public UnaryCallSettings patchInterconnectSettings() { + return ((InterconnectStubSettings) getStubSettings()).patchInterconnectSettings(); + } + + + public static final InterconnectSettings create(InterconnectStubSettings stub) throws IOException { + return new InterconnectSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InterconnectStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return InterconnectStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return InterconnectStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return InterconnectStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return InterconnectStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InterconnectStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return InterconnectStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return InterconnectStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InterconnectSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for InterconnectSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(InterconnectStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(InterconnectStubSettings.newBuilder()); + } + + protected Builder(InterconnectSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(InterconnectStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public InterconnectStubSettings.Builder getStubSettingsBuilder() { + return ((InterconnectStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteInterconnect. + */ + public UnaryCallSettings.Builder deleteInterconnectSettings() { + return getStubSettingsBuilder().deleteInterconnectSettings(); + } + + /** + * Returns the builder for the settings used for calls to getInterconnect. + */ + public UnaryCallSettings.Builder getInterconnectSettings() { + return getStubSettingsBuilder().getInterconnectSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertInterconnect. + */ + public UnaryCallSettings.Builder insertInterconnectSettings() { + return getStubSettingsBuilder().insertInterconnectSettings(); + } + + /** + * Returns the builder for the settings used for calls to listInterconnects. + */ + public PagedCallSettings.Builder listInterconnectsSettings() { + return getStubSettingsBuilder().listInterconnectsSettings(); + } + + /** + * Returns the builder for the settings used for calls to patchInterconnect. + */ + public UnaryCallSettings.Builder patchInterconnectSettings() { + return getStubSettingsBuilder().patchInterconnectSettings(); + } + + @Override + public InterconnectSettings build() throws IOException { + return new InterconnectSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java index 941394203a58..94d2414965c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java @@ -39,6 +39,7 @@ public final class InvalidateCacheUrlMapHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String urlMap; private final String userIp; @@ -50,6 +51,7 @@ private InvalidateCacheUrlMapHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.urlMap = null; this.userIp = null; } @@ -63,6 +65,7 @@ private InvalidateCacheUrlMapHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String urlMap, String userIp ) { @@ -73,6 +76,7 @@ private InvalidateCacheUrlMapHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.urlMap = urlMap; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("urlMap") && urlMap != null) { fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("urlMap")) { return String.valueOf(urlMap); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUrlMap() { return urlMap; } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String urlMap; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(InvalidateCacheUrlMapHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUrlMap() != null) { this.urlMap = other.urlMap; } @@ -257,6 +275,7 @@ public Builder mergeFrom(InvalidateCacheUrlMapHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.urlMap = source.urlMap; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUrlMap() { return urlMap; } @@ -352,6 +380,7 @@ public InvalidateCacheUrlMapHttpRequest build() { + if (urlMap == null) { missing += " urlMap"; } @@ -367,6 +396,7 @@ public InvalidateCacheUrlMapHttpRequest build() { key, prettyPrint, quotaUser, + requestId, urlMap, userIp ); @@ -381,6 +411,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUrlMap(this.urlMap); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -397,6 +428,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "urlMap=" + urlMap + ", " + "userIp=" + userIp + "}"; @@ -417,6 +449,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.urlMap, that.getUrlMap()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -434,6 +467,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, urlMap, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java index a2e62864f804..962bd1469701 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java @@ -170,7 +170,7 @@ public LicensStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified License resource. Get a list of available licenses by making a list() request. + * Returns the specified License resource. * * Sample code: *

@@ -195,7 +195,7 @@ public final License getLicens(LicenseName license) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified License resource. Get a list of available licenses by making a list() request.
+   * Returns the specified License resource.
    *
    * Sample code:
    * 

@@ -220,7 +220,7 @@ public final License getLicens(String license) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified License resource. Get a list of available licenses by making a list() request.
+   * Returns the specified License resource.
    *
    * Sample code:
    * 

@@ -243,7 +243,7 @@ public final License getLicens(GetLicensHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified License resource. Get a list of available licenses by making a list() request.
+   * Returns the specified License resource.
    *
    * Sample code:
    * 

diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
new file mode 100644
index 000000000000..635e62bba859
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
@@ -0,0 +1,297 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.cloud.compute.v1.stub.LicenseStub;
+import com.google.cloud.compute.v1.stub.LicenseStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Creates and runs virtual machines on Google Cloud Platform.
+ *
+ * 

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (LicenseClient licenseClient = LicenseClient.create()) {
+ *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+ *   License response = licenseClient.getLicense(license);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the licenseClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of LicenseSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * LicenseSettings licenseSettings =
+ *     LicenseSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LicenseClient licenseClient =
+ *     LicenseClient.create(licenseSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * LicenseSettings licenseSettings =
+ *     LicenseSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LicenseClient licenseClient =
+ *     LicenseClient.create(licenseSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicenseClient implements BackgroundResource { + private final LicenseSettings settings; + private final LicenseStub stub; + + + + /** + * Constructs an instance of LicenseClient with default settings. + */ + public static final LicenseClient create() throws IOException { + return create(LicenseSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LicenseClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final LicenseClient create(LicenseSettings settings) throws IOException { + return new LicenseClient(settings); + } + + /** + * Constructs an instance of LicenseClient, using the given stub for making calls. This is for + * advanced usage - prefer to use LicenseSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final LicenseClient create(LicenseStub stub) { + return new LicenseClient(stub); + } + + /** + * Constructs an instance of LicenseClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected LicenseClient(LicenseSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LicenseStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected LicenseClient(LicenseStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LicenseSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LicenseStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. + * + * Sample code: + *

+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   License response = licenseClient.getLicense(license);
+   * }
+   * 
+ * + * @param license Name of the License resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final License getLicense(LicenseName license) { + + GetLicenseHttpRequest request = + GetLicenseHttpRequest.newBuilder() + .setLicense(license == null ? null : license.toString()) + .build(); + return getLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. + * + * Sample code: + *

+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   License response = licenseClient.getLicense(license.toString());
+   * }
+   * 
+ * + * @param license Name of the License resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final License getLicense(String license) { + + GetLicenseHttpRequest request = + GetLicenseHttpRequest.newBuilder() + .setLicense(license) + .build(); + return getLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. + * + * Sample code: + *

+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder()
+   *     .setLicense(license.toString())
+   *     .build();
+   *   License response = licenseClient.getLicense(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final License getLicense(GetLicenseHttpRequest request) { + return getLicenseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified License resource. + * + * Sample code: + *

+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder()
+   *     .setLicense(license.toString())
+   *     .build();
+   *   ApiFuture<License> future = licenseClient.getLicenseCallable().futureCall(request);
+   *   // Do something
+   *   License response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getLicenseCallable() { + return stub.getLicenseCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java index e73964c32b40..df5423888310 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class LicenseName implements ResourceName { +public final class LicenseName implements com.google.api.resourcenames.ResourceName { private final String license; private final String project; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java new file mode 100644 index 000000000000..8a958ce76a1c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java @@ -0,0 +1,218 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.stub.LicenseStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LicenseClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getLicense to 30 seconds: + * + *

+ * 
+ * LicenseSettings.Builder licenseSettingsBuilder =
+ *     LicenseSettings.newBuilder();
+ * licenseSettingsBuilder.getLicenseSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LicenseSettings licenseSettings = licenseSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicenseSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to getLicense. + */ + public UnaryCallSettings getLicenseSettings() { + return ((LicenseStubSettings) getStubSettings()).getLicenseSettings(); + } + + + public static final LicenseSettings create(LicenseStubSettings stub) throws IOException { + return new LicenseSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LicenseStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return LicenseStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return LicenseStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return LicenseStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LicenseStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return LicenseStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LicenseStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LicenseStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LicenseSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for LicenseSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(LicenseStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(LicenseStubSettings.newBuilder()); + } + + protected Builder(LicenseSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LicenseStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public LicenseStubSettings.Builder getStubSettingsBuilder() { + return ((LicenseStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to getLicense. + */ + public UnaryCallSettings.Builder getLicenseSettings() { + return getStubSettingsBuilder().getLicenseSettings(); + } + + @Override + public LicenseSettings build() throws IOException { + return new LicenseSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java new file mode 100644 index 000000000000..b41fce9dbcc7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListAcceleratorTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListAcceleratorTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + + private ListAcceleratorTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + if (fieldName.equals("zone")) { + return String.valueOf(zone); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListAcceleratorTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListAcceleratorTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListAcceleratorTypesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListAcceleratorTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListAcceleratorTypesHttpRequest other) { + if (other == ListAcceleratorTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListAcceleratorTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + + public ListAcceleratorTypesHttpRequest build() { + String missing = ""; + + + + + + + + + + + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListAcceleratorTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListAcceleratorTypesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListAcceleratorTypesHttpRequest) { + ListAcceleratorTypesHttpRequest that = (ListAcceleratorTypesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java new file mode 100644 index 000000000000..ee345bb44308 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListBackendBucketsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListBackendBucketsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListBackendBucketsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListBackendBucketsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListBackendBucketsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListBackendBucketsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListBackendBucketsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListBackendBucketsHttpRequest other) { + if (other == ListBackendBucketsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListBackendBucketsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListBackendBucketsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListBackendBucketsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListBackendBucketsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListBackendBucketsHttpRequest) { + ListBackendBucketsHttpRequest that = (ListBackendBucketsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java index 065f8f3f7726..37f448462625 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private ListInstanceGroupsHttpRequest() { this.zone = null; } + private ListInstanceGroupsHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private ListInstanceGroupsHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone) { + String zone + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getZone() { return zone; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static ListInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final ListInstanceGroupsHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new ListInstanceGroupsHttpRequest(); } @@ -423,9 +426,20 @@ public Builder setZone(String zone) { return this; } + public ListInstanceGroupsHttpRequest build() { String missing = ""; + + + + + + + + + + if (zone == null) { missing += " zone"; } @@ -433,18 +447,19 @@ public ListInstanceGroupsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); } public Builder clone() { @@ -468,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "ListInstanceGroupsHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp - + ", " - + "zone=" - + zone + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + ", " + + "zone=" + zone + "}"; } @@ -513,18 +505,20 @@ public boolean equals(Object o) { } if (o instanceof ListInstanceGroupsHttpRequest) { ListInstanceGroupsHttpRequest that = (ListInstanceGroupsHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()) - && Objects.equals(this.zone, that.getZone()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) && + Objects.equals(this.zone, that.getZone()) + ; } return false; } @@ -532,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java index 3b4ef6048d60..8ce925c89077 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -59,6 +62,7 @@ private ListInstancesInstanceGroupsHttpRequest() { this.userIp = null; } + private ListInstancesInstanceGroupsHttpRequest( String access_token, String callback, @@ -72,7 +76,8 @@ private ListInstancesInstanceGroupsHttpRequest( String pageToken, String prettyPrint, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -106,11 +111,8 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instanceGroup") && instanceGroup != null) { fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); } - if (fieldNames.contains("instanceGroupsListInstancesRequestResource") - && instanceGroupsListInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupsListInstancesRequestResource", - Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); + if (fieldNames.contains("instanceGroupsListInstancesRequestResource") && instanceGroupsListInstancesRequestResource != null) { + fieldMap.put("instanceGroupsListInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -238,24 +240,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListInstancesInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static ListInstancesInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final ListInstancesInstanceGroupsHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new ListInstancesInstanceGroupsHttpRequest(); } @@ -295,8 +295,7 @@ public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { this.instanceGroup = other.instanceGroup; } if (other.getInstanceGroupsListInstancesRequestResource() != null) { - this.instanceGroupsListInstancesRequestResource = - other.instanceGroupsListInstancesRequestResource; + this.instanceGroupsListInstancesRequestResource = other.instanceGroupsListInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -328,8 +327,7 @@ public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { this.fields = source.fields; this.filter = source.filter; this.instanceGroup = source.instanceGroup; - this.instanceGroupsListInstancesRequestResource = - source.instanceGroupsListInstancesRequestResource; + this.instanceGroupsListInstancesRequestResource = source.instanceGroupsListInstancesRequestResource; this.key = source.key; this.maxResults = source.maxResults; this.orderBy = source.orderBy; @@ -388,8 +386,7 @@ public InstanceGroupsListInstancesRequest getInstanceGroupsListInstancesRequestR return instanceGroupsListInstancesRequestResource; } - public Builder setInstanceGroupsListInstancesRequestResource( - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + public Builder setInstanceGroupsListInstancesRequestResource(InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { this.instanceGroupsListInstancesRequestResource = instanceGroupsListInstancesRequestResource; return this; } @@ -457,30 +454,42 @@ public Builder setUserIp(String userIp) { return this; } + public ListInstancesInstanceGroupsHttpRequest build() { String missing = ""; + + + if (instanceGroup == null) { missing += " instanceGroup"; } + + + + + + + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstancesInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - instanceGroup, - instanceGroupsListInstancesRequestResource, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); } public Builder clone() { @@ -490,8 +499,7 @@ public Builder clone() { newBuilder.setFields(this.fields); newBuilder.setFilter(this.filter); newBuilder.setInstanceGroup(this.instanceGroup); - newBuilder.setInstanceGroupsListInstancesRequestResource( - this.instanceGroupsListInstancesRequestResource); + newBuilder.setInstanceGroupsListInstancesRequestResource(this.instanceGroupsListInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setMaxResults(this.maxResults); newBuilder.setOrderBy(this.orderBy); @@ -506,44 +514,19 @@ public Builder clone() { @Override public String toString() { return "ListInstancesInstanceGroupsHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "instanceGroup=" - + instanceGroup - + ", " - + "instanceGroupsListInstancesRequestResource=" - + instanceGroupsListInstancesRequestResource - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "instanceGroup=" + instanceGroup + ", " + + "instanceGroupsListInstancesRequestResource=" + instanceGroupsListInstancesRequestResource + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -554,21 +537,21 @@ public boolean equals(Object o) { } if (o instanceof ListInstancesInstanceGroupsHttpRequest) { ListInstancesInstanceGroupsHttpRequest that = (ListInstancesInstanceGroupsHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.instanceGroup, that.getInstanceGroup()) - && Objects.equals( - this.instanceGroupsListInstancesRequestResource, - that.getInstanceGroupsListInstancesRequestResource()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.instanceGroup, that.getInstanceGroup()) && + Objects.equals(this.instanceGroupsListInstancesRequestResource, that.getInstanceGroupsListInstancesRequestResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -576,18 +559,19 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instanceGroup, - instanceGroupsListInstancesRequestResource, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java new file mode 100644 index 000000000000..b144bd21afbe --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInterconnectAttachmentsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListInterconnectAttachmentsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListInterconnectAttachmentsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInterconnectAttachmentsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInterconnectAttachmentsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInterconnectAttachmentsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInterconnectAttachmentsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListInterconnectAttachmentsHttpRequest other) { + if (other == ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListInterconnectAttachmentsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListInterconnectAttachmentsHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInterconnectAttachmentsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInterconnectAttachmentsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInterconnectAttachmentsHttpRequest) { + ListInterconnectAttachmentsHttpRequest that = (ListInterconnectAttachmentsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java new file mode 100644 index 000000000000..1868751cd7b6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInterconnectLocationsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListInterconnectLocationsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListInterconnectLocationsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInterconnectLocationsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInterconnectLocationsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInterconnectLocationsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInterconnectLocationsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListInterconnectLocationsHttpRequest other) { + if (other == ListInterconnectLocationsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListInterconnectLocationsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListInterconnectLocationsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInterconnectLocationsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInterconnectLocationsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInterconnectLocationsHttpRequest) { + ListInterconnectLocationsHttpRequest that = (ListInterconnectLocationsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java new file mode 100644 index 000000000000..f3ce98d47a54 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListInterconnectsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListInterconnectsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListInterconnectsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListInterconnectsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListInterconnectsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListInterconnectsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListInterconnectsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListInterconnectsHttpRequest other) { + if (other == ListInterconnectsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListInterconnectsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListInterconnectsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListInterconnectsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListInterconnectsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListInterconnectsHttpRequest) { + ListInterconnectsHttpRequest that = (ListInterconnectsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java new file mode 100644 index 000000000000..4f6771093068 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListReferrersInstancesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String instance; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ListReferrersInstancesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.instance = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListReferrersInstancesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String instance, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.instance = instance; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListReferrersInstancesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListReferrersInstancesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListReferrersInstancesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListReferrersInstancesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String instance; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListReferrersInstancesHttpRequest other) { + if (other == ListReferrersInstancesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListReferrersInstancesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.instance = source.instance; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListReferrersInstancesHttpRequest build() { + String missing = ""; + + + + + if (instance == null) { + missing += " instance"; + } + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListReferrersInstancesHttpRequest( + access_token, + callback, + fields, + filter, + instance, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListReferrersInstancesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListReferrersInstancesHttpRequest) { + ListReferrersInstancesHttpRequest that = (ListReferrersInstancesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + instance, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java index 584dc381f80e..d80fd2babb50 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private ListRegionBackendServicesHttpRequest() { this.userIp = null; } + private ListRegionBackendServicesHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private ListRegionBackendServicesHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListRegionBackendServicesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionBackendServicesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final ListRegionBackendServicesHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new ListRegionBackendServicesHttpRequest(); } @@ -423,9 +426,19 @@ public Builder setUserIp(String userIp) { return this; } + public ListRegionBackendServicesHttpRequest build() { String missing = ""; + + + + + + + + + if (region == null) { missing += " region"; } @@ -434,18 +447,19 @@ public ListRegionBackendServicesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionBackendServicesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "ListRegionBackendServicesHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "region=" - + region - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + "}"; } @@ -514,18 +505,20 @@ public boolean equals(Object o) { } if (o instanceof ListRegionBackendServicesHttpRequest) { ListRegionBackendServicesHttpRequest that = (ListRegionBackendServicesHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.region, that.getRegion()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -533,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java new file mode 100644 index 000000000000..5c298e9abd5d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionCommitmentsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionCommitmentsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + + private ListRegionCommitmentsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListRegionCommitmentsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionCommitmentsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListRegionCommitmentsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListRegionCommitmentsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionCommitmentsHttpRequest other) { + if (other == ListRegionCommitmentsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionCommitmentsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListRegionCommitmentsHttpRequest build() { + String missing = ""; + + + + + + + + + + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionCommitmentsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionCommitmentsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionCommitmentsHttpRequest) { + ListRegionCommitmentsHttpRequest that = (ListRegionCommitmentsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java index 4f87e0ad4103..5a6b9b5b0170 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private ListRegionsHttpRequest() { this.userIp = null; } + private ListRegionsHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private ListRegionsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListRegionsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final ListRegionsHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new ListRegionsHttpRequest(); } @@ -423,29 +426,40 @@ public Builder setUserIp(String userIp) { return this; } + public ListRegionsHttpRequest build() { String missing = ""; + + + + + + + + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "ListRegionsHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -514,18 +505,20 @@ public boolean equals(Object o) { } if (o instanceof ListRegionsHttpRequest) { ListRegionsHttpRequest that = (ListRegionsHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -533,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java index 103aaf931bfb..ad3429da957d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private ListTargetHttpProxiesHttpRequest() { this.userIp = null; } + private ListTargetHttpProxiesHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private ListTargetHttpProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListTargetHttpProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetHttpProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final ListTargetHttpProxiesHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new ListTargetHttpProxiesHttpRequest(); } @@ -423,29 +426,40 @@ public Builder setUserIp(String userIp) { return this; } + public ListTargetHttpProxiesHttpRequest build() { String missing = ""; + + + + + + + + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetHttpProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "ListTargetHttpProxiesHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -514,18 +505,20 @@ public boolean equals(Object o) { } if (o instanceof ListTargetHttpProxiesHttpRequest) { ListTargetHttpProxiesHttpRequest that = (ListTargetHttpProxiesHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -533,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java index 468717b78089..ae290b934b14 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,6 +60,7 @@ private ListTargetSslProxiesHttpRequest() { this.userIp = null; } + private ListTargetSslProxiesHttpRequest( String access_token, String callback, @@ -69,7 +73,8 @@ private ListTargetSslProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -221,24 +226,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListTargetSslProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetSslProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final ListTargetSslProxiesHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new ListTargetSslProxiesHttpRequest(); } @@ -423,29 +426,40 @@ public Builder setUserIp(String userIp) { return this; } + public ListTargetSslProxiesHttpRequest build() { String missing = ""; + + + + + + + + if (project == null) { missing += " project"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetSslProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } public Builder clone() { @@ -469,41 +483,18 @@ public Builder clone() { @Override public String toString() { return "ListTargetSslProxiesHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "filter=" - + filter - + ", " - + "key=" - + key - + ", " - + "maxResults=" - + maxResults - + ", " - + "orderBy=" - + orderBy - + ", " - + "pageToken=" - + pageToken - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "project=" - + project - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + "}"; } @@ -514,18 +505,20 @@ public boolean equals(Object o) { } if (o instanceof ListTargetSslProxiesHttpRequest) { ListTargetSslProxiesHttpRequest that = (ListTargetSslProxiesHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.filter, that.getFilter()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.maxResults, that.getMaxResults()) - && Objects.equals(this.orderBy, that.getOrderBy()) - && Objects.equals(this.pageToken, that.getPageToken()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.project, that.getProject()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -533,17 +526,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java new file mode 100644 index 000000000000..276d37c215fa --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListTargetTcpProxiesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListTargetTcpProxiesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListTargetTcpProxiesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListTargetTcpProxiesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListTargetTcpProxiesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListTargetTcpProxiesHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListTargetTcpProxiesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListTargetTcpProxiesHttpRequest other) { + if (other == ListTargetTcpProxiesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListTargetTcpProxiesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListTargetTcpProxiesHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListTargetTcpProxiesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListTargetTcpProxiesHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListTargetTcpProxiesHttpRequest) { + ListTargetTcpProxiesHttpRequest that = (ListTargetTcpProxiesHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java new file mode 100644 index 000000000000..09729a2b645f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java @@ -0,0 +1,577 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListXpnHostsProjectsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource; + private final String quotaUser; + private final String userIp; + + private ListXpnHostsProjectsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.projectsListXpnHostsRequestResource = null; + this.quotaUser = null; + this.userIp = null; + } + + + private ListXpnHostsProjectsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource, + String quotaUser, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.projectsListXpnHostsRequestResource = projectsListXpnHostsRequestResource; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("projectsListXpnHostsRequestResource") && projectsListXpnHostsRequestResource != null) { + fieldMap.put("projectsListXpnHostsRequestResource", Collections.singletonList(String.valueOf(projectsListXpnHostsRequestResource))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("projectsListXpnHostsRequestResource")) { + return String.valueOf(projectsListXpnHostsRequestResource); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ProjectsListXpnHostsRequest getApiMessageRequestBody() { + return projectsListXpnHostsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public ProjectsListXpnHostsRequest getProjectsListXpnHostsRequestResource() { + return projectsListXpnHostsRequestResource; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ListXpnHostsProjectsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListXpnHostsProjectsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ListXpnHostsProjectsHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ListXpnHostsProjectsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListXpnHostsProjectsHttpRequest other) { + if (other == ListXpnHostsProjectsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getProjectsListXpnHostsRequestResource() != null) { + this.projectsListXpnHostsRequestResource = other.projectsListXpnHostsRequestResource; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListXpnHostsProjectsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.projectsListXpnHostsRequestResource = source.projectsListXpnHostsRequestResource; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public ProjectsListXpnHostsRequest getProjectsListXpnHostsRequestResource() { + return projectsListXpnHostsRequestResource; + } + + public Builder setProjectsListXpnHostsRequestResource(ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) { + this.projectsListXpnHostsRequestResource = projectsListXpnHostsRequestResource; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public ListXpnHostsProjectsHttpRequest build() { + String missing = ""; + + + + + + + + + + if (project == null) { + missing += " project"; + } + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListXpnHostsProjectsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + projectsListXpnHostsRequestResource, + quotaUser, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setProjectsListXpnHostsRequestResource(this.projectsListXpnHostsRequestResource); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListXpnHostsProjectsHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "filter=" + filter + ", " + + "key=" + key + ", " + + "maxResults=" + maxResults + ", " + + "orderBy=" + orderBy + ", " + + "pageToken=" + pageToken + ", " + + "prettyPrint=" + prettyPrint + ", " + + "project=" + project + ", " + + "projectsListXpnHostsRequestResource=" + projectsListXpnHostsRequestResource + ", " + + "quotaUser=" + quotaUser + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListXpnHostsProjectsHttpRequest) { + ListXpnHostsProjectsHttpRequest that = (ListXpnHostsProjectsHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.filter, that.getFilter()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.maxResults, that.getMaxResults()) && + Objects.equals(this.orderBy, that.getOrderBy()) && + Objects.equals(this.pageToken, that.getPageToken()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.projectsListXpnHostsRequestResource, that.getProjectsListXpnHostsRequestResource()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + projectsListXpnHostsRequestResource, + quotaUser, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java index fb8a996d11e1..9e54ac011d08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java @@ -37,6 +37,7 @@ public final class MachineTypeAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private MachineTypeAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private MachineTypeAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private MachineTypeAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(MachineTypeAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(MachineTypeAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public MachineTypeAggregatedList build() { + return new MachineTypeAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java index 0612fab75dac..8d2fc4a2e58d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java @@ -37,6 +37,7 @@ public final class MachineTypeList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private MachineTypeList() { this.id = null; @@ -44,6 +45,7 @@ private MachineTypeList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private MachineTypeList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(MachineTypeList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(MachineTypeList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public MachineTypeList build() { + return new MachineTypeList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java index 4b3308be4210..b231a4cbb0c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class MachineTypeName implements ResourceName { +public final class MachineTypeName implements com.google.api.resourcenames.ResourceName { private final String machineType; private final String project; private final String zone; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java index 00d01087bdd5..12fea23a42a7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java @@ -40,6 +40,7 @@ public final class MoveDiskProjectHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private MoveDiskProjectHttpRequest() { @@ -51,6 +52,7 @@ private MoveDiskProjectHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private MoveDiskProjectHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private MoveDiskProjectHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(MoveDiskProjectHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(MoveDiskProjectHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public MoveDiskProjectHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public MoveDiskProjectHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java index 8d8cf45981a1..3208b47de269 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java @@ -40,6 +40,7 @@ public final class MoveInstanceProjectHttpRequest implements ApiMessage { private final String prettyPrint; private final String project; private final String quotaUser; + private final String requestId; private final String userIp; private MoveInstanceProjectHttpRequest() { @@ -51,6 +52,7 @@ private MoveInstanceProjectHttpRequest() { this.prettyPrint = null; this.project = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private MoveInstanceProjectHttpRequest( String prettyPrint, String project, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private MoveInstanceProjectHttpRequest( this.prettyPrint = prettyPrint; this.project = project; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String prettyPrint; private String project; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(MoveInstanceProjectHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(MoveInstanceProjectHttpRequest other) { this.prettyPrint = source.prettyPrint; this.project = source.project; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public MoveInstanceProjectHttpRequest build() { } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public MoveInstanceProjectHttpRequest build() { prettyPrint, project, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "project=" + project + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.project, that.getProject()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { prettyPrint, project, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java index be57d3c2992f..9e5ebf482317 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java @@ -40,6 +40,8 @@ public final class Network implements ApiMessage { private final String id; private final String kind; private final String name; + private final List peerings; + private final NetworkRoutingConfig routingConfig; private final String selfLink; private final List subnetworks; @@ -52,6 +54,8 @@ private Network() { this.id = null; this.kind = null; this.name = null; + this.peerings = null; + this.routingConfig = null; this.selfLink = null; this.subnetworks = null; } @@ -66,6 +70,8 @@ private Network( String id, String kind, String name, + List peerings, + NetworkRoutingConfig routingConfig, String selfLink, List subnetworks ) { @@ -77,6 +83,8 @@ private Network( this.id = id; this.kind = kind; this.name = name; + this.peerings = peerings; + this.routingConfig = routingConfig; this.selfLink = selfLink; this.subnetworks = subnetworks; } @@ -108,6 +116,16 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("name") && name != null) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } + if (fieldNames.contains("peerings") && peerings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NetworkPeering item : peerings) { + stringList.add(item.toString()); + } + fieldMap.put("peerings", stringList.build()); + } + if (fieldNames.contains("routingConfig") && routingConfig != null) { + fieldMap.put("routingConfig", Collections.singletonList(String.valueOf(routingConfig))); + } if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } @@ -147,6 +165,12 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("name")) { return String.valueOf(name); } + if (fieldName.equals("peerings")) { + return String.valueOf(peerings); + } + if (fieldName.equals("routingConfig")) { + return String.valueOf(routingConfig); + } if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } @@ -194,6 +218,14 @@ public String getName() { return name; } + public List getPeeringsList() { + return peerings; + } + + public NetworkRoutingConfig getRoutingConfig() { + return routingConfig; + } + public String getSelfLink() { return selfLink; } @@ -231,6 +263,8 @@ public static class Builder { private String id; private String kind; private String name; + private List peerings; + private NetworkRoutingConfig routingConfig; private String selfLink; private List subnetworks; @@ -262,6 +296,12 @@ public Builder mergeFrom(Network other) { if (other.getName() != null) { this.name = other.name; } + if (other.getPeeringsList() != null) { + this.peerings = other.peerings; + } + if (other.getRoutingConfig() != null) { + this.routingConfig = other.routingConfig; + } if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } @@ -280,6 +320,8 @@ public Builder mergeFrom(Network other) { this.id = source.id; this.kind = source.kind; this.name = source.name; + this.peerings = source.peerings; + this.routingConfig = source.routingConfig; this.selfLink = source.selfLink; this.subnetworks = source.subnetworks; } @@ -356,6 +398,32 @@ public Builder setName(String name) { return this; } + public List getPeeringsList() { + return peerings; + } + + public Builder addAllPeerings(List peerings) { + if (this.peerings == null) { + this.peerings = new ArrayList<>(peerings.size()); + } + this.peerings.addAll(peerings); + return this; + } + + public Builder addPeerings(NetworkPeering peerings) { + this.peerings.add(peerings); + return this; + } + + public NetworkRoutingConfig getRoutingConfig() { + return routingConfig; + } + + public Builder setRoutingConfig(NetworkRoutingConfig routingConfig) { + this.routingConfig = routingConfig; + return this; + } + public String getSelfLink() { return selfLink; } @@ -393,6 +461,8 @@ public Network build() { + + return new Network( autoCreateSubnetworks, creationTimestamp, @@ -402,6 +472,8 @@ public Network build() { id, kind, name, + peerings, + routingConfig, selfLink, subnetworks ); @@ -417,6 +489,8 @@ public Builder clone() { newBuilder.setId(this.id); newBuilder.setKind(this.kind); newBuilder.setName(this.name); + newBuilder.addAllPeerings(this.peerings); + newBuilder.setRoutingConfig(this.routingConfig); newBuilder.setSelfLink(this.selfLink); newBuilder.addAllSubnetworks(this.subnetworks); return newBuilder; @@ -434,6 +508,8 @@ public String toString() { + "id=" + id + ", " + "kind=" + kind + ", " + "name=" + name + ", " + + "peerings=" + peerings + ", " + + "routingConfig=" + routingConfig + ", " + "selfLink=" + selfLink + ", " + "subnetworks=" + subnetworks + "}"; @@ -455,6 +531,8 @@ public boolean equals(Object o) { Objects.equals(this.id, that.getId()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.name, that.getName()) && + Objects.equals(this.peerings, that.getPeeringsList()) && + Objects.equals(this.routingConfig, that.getRoutingConfig()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.subnetworks, that.getSubnetworksList()) ; @@ -473,6 +551,8 @@ public int hashCode() { id, kind, name, + peerings, + routingConfig, selfLink, subnetworks ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java index e6fd670a365d..37dd5924f34b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java @@ -52,8 +52,10 @@ *
  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
+ *   String requestId = "";
  *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
- *   Operation response = networkClient.deleteNetwork(network);
+ *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
+ *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
  * }
  * 
  * 
@@ -168,6 +170,129 @@ public NetworkStub getStub() { } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a peering to the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
+   *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param network Name of the network resource to add peering to. + * @param networksAddPeeringRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addPeeringNetwork(String requestId, NetworkName network, NetworksAddPeeringRequest networksAddPeeringRequestResource) { + + AddPeeringNetworkHttpRequest request = + AddPeeringNetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) + .build(); + return addPeeringNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a peering to the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
+   *   Operation response = networkClient.addPeeringNetwork(requestId, network.toString(), networksAddPeeringRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param network Name of the network resource to add peering to. + * @param networksAddPeeringRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addPeeringNetwork(String requestId, String network, NetworksAddPeeringRequest networksAddPeeringRequestResource) { + + AddPeeringNetworkHttpRequest request = + AddPeeringNetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setNetwork(network) + .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) + .build(); + return addPeeringNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a peering to the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
+   *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setNetwork(network.toString())
+   *     .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource)
+   *     .build();
+   *   Operation response = networkClient.addPeeringNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addPeeringNetwork(AddPeeringNetworkHttpRequest request) { + return addPeeringNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a peering to the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
+   *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setNetwork(network.toString())
+   *     .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = networkClient.addPeeringNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable addPeeringNetworkCallable() { + return stub.addPeeringNetworkCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes the specified network. @@ -175,19 +300,26 @@ public NetworkStub getStub() { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.deleteNetwork(network);
+   *   Operation response = networkClient.deleteNetwork(requestId, network);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param network Name of the network to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteNetwork(NetworkName network) { + public final Operation deleteNetwork(String requestId, NetworkName network) { DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder() + .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .build(); return deleteNetwork(request); @@ -200,19 +332,26 @@ public final Operation deleteNetwork(NetworkName network) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.deleteNetwork(network.toString());
+   *   Operation response = networkClient.deleteNetwork(requestId, network.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param network Name of the network to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteNetwork(String network) { + public final Operation deleteNetwork(String requestId, String network) { DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder() + .setRequestId(requestId) .setNetwork(network) .build(); return deleteNetwork(request); @@ -225,8 +364,10 @@ public final Operation deleteNetwork(String network) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   Operation response = networkClient.deleteNetwork(request);
@@ -248,8 +389,10 @@ public final Operation deleteNetwork(DeleteNetworkHttpRequest request) {
    * Sample code:
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   ApiFuture<Operation> future = networkClient.deleteNetworkCallable().futureCall(request);
@@ -365,21 +508,28 @@ public final UnaryCallable getNetworkCallable()
    * Sample code:
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
-   *   Operation response = networkClient.insertNetwork(project, networkResource);
+   *   Operation response = networkClient.insertNetwork(requestId, project, networkResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertNetwork(ProjectName project, Network networkResource) { + public final Operation insertNetwork(String requestId, ProjectName project, Network networkResource) { InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setNetworkResource(networkResource) .build(); @@ -393,21 +543,28 @@ public final Operation insertNetwork(ProjectName project, Network networkResourc * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
-   *   Operation response = networkClient.insertNetwork(project.toString(), networkResource);
+   *   Operation response = networkClient.insertNetwork(requestId, project.toString(), networkResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertNetwork(String project, Network networkResource) { + public final Operation insertNetwork(String requestId, String project, Network networkResource) { InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setNetworkResource(networkResource) .build(); @@ -421,9 +578,11 @@ public final Operation insertNetwork(String project, Network networkResource) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
    *   InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setNetworkResource(networkResource)
    *     .build();
@@ -446,9 +605,11 @@ public final Operation insertNetwork(InsertNetworkHttpRequest request) {
    * Sample code:
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
    *   InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setNetworkResource(networkResource)
    *     .build();
@@ -596,6 +757,252 @@ public final UnaryCallable listNetworksCal
     return stub.listNetworksCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.
+   *
+   * Sample code:
+   * 

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   Operation response = networkClient.patchNetwork(requestId, network, networkResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param network Name of the network to update. + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchNetwork(String requestId, NetworkName network, Network networkResource) { + + PatchNetworkHttpRequest request = + PatchNetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .setNetworkResource(networkResource) + .build(); + return patchNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   Operation response = networkClient.patchNetwork(requestId, network.toString(), networkResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param network Name of the network to update. + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchNetwork(String requestId, String network, Network networkResource) { + + PatchNetworkHttpRequest request = + PatchNetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setNetwork(network) + .setNetworkResource(networkResource) + .build(); + return patchNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setNetwork(network.toString())
+   *     .setNetworkResource(networkResource)
+   *     .build();
+   *   Operation response = networkClient.patchNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchNetwork(PatchNetworkHttpRequest request) { + return patchNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   Network networkResource = Network.newBuilder().build();
+   *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setNetwork(network.toString())
+   *     .setNetworkResource(networkResource)
+   *     .build();
+   *   ApiFuture<Operation> future = networkClient.patchNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchNetworkCallable() { + return stub.patchNetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a peering from the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
+   *   Operation response = networkClient.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param network Name of the network resource to remove peering from. + * @param networksRemovePeeringRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removePeeringNetwork(String requestId, NetworkName network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + + RemovePeeringNetworkHttpRequest request = + RemovePeeringNetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) + .build(); + return removePeeringNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a peering from the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
+   *   Operation response = networkClient.removePeeringNetwork(requestId, network.toString(), networksRemovePeeringRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param network Name of the network resource to remove peering from. + * @param networksRemovePeeringRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removePeeringNetwork(String requestId, String network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + + RemovePeeringNetworkHttpRequest request = + RemovePeeringNetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setNetwork(network) + .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) + .build(); + return removePeeringNetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a peering from the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
+   *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setNetwork(network.toString())
+   *     .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource)
+   *     .build();
+   *   Operation response = networkClient.removePeeringNetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation removePeeringNetwork(RemovePeeringNetworkHttpRequest request) { + return removePeeringNetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Removes a peering from the specified network. + * + * Sample code: + *

+   * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
+   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
+   *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setNetwork(network.toString())
+   *     .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = networkClient.removePeeringNetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable removePeeringNetworkCallable() { + return stub.removePeeringNetworkCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Switches the network mode from auto subnet mode to custom subnet mode. @@ -603,19 +1010,26 @@ public final UnaryCallable listNetworksCal * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.switchToCustomModeNetwork(network);
+   *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param network Name of the network to be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation switchToCustomModeNetwork(NetworkName network) { + public final Operation switchToCustomModeNetwork(String requestId, NetworkName network) { SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder() + .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .build(); return switchToCustomModeNetwork(request); @@ -628,19 +1042,26 @@ public final Operation switchToCustomModeNetwork(NetworkName network) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.switchToCustomModeNetwork(network.toString());
+   *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param network Name of the network to be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation switchToCustomModeNetwork(String network) { + public final Operation switchToCustomModeNetwork(String requestId, String network) { SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder() + .setRequestId(requestId) .setNetwork(network) .build(); return switchToCustomModeNetwork(request); @@ -653,8 +1074,10 @@ public final Operation switchToCustomModeNetwork(String network) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   Operation response = networkClient.switchToCustomModeNetwork(request);
@@ -676,8 +1099,10 @@ public final Operation switchToCustomModeNetwork(SwitchToCustomModeNetworkHttpRe
    * Sample code:
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
+   *   String requestId = "";
    *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   ApiFuture<Operation> future = networkClient.switchToCustomModeNetworkCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java
index cb7a34db124d..6d3ac87f83d8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java
@@ -33,6 +33,8 @@
 @BetaApi
 public final class NetworkInterface implements ApiMessage {
   private final List accessConfigs;
+  private final List aliasIpRanges;
+  private final String fingerprint;
   private final String kind;
   private final String name;
   private final String network;
@@ -41,6 +43,8 @@ public final class NetworkInterface implements ApiMessage {
 
   private NetworkInterface() {
     this.accessConfigs = null;
+    this.aliasIpRanges = null;
+    this.fingerprint = null;
     this.kind = null;
     this.name = null;
     this.network = null;
@@ -51,6 +55,8 @@ private NetworkInterface() {
 
   private NetworkInterface(
       List accessConfigs,
+      List aliasIpRanges,
+      String fingerprint,
       String kind,
       String name,
       String network,
@@ -58,6 +64,8 @@ private NetworkInterface(
       String subnetwork
       ) {
     this.accessConfigs = accessConfigs;
+    this.aliasIpRanges = aliasIpRanges;
+    this.fingerprint = fingerprint;
     this.kind = kind;
     this.name = name;
     this.network = network;
@@ -75,6 +83,16 @@ public Map> populateFieldsInMap(Set fieldNames) {
       }
       fieldMap.put("accessConfigs", stringList.build());
     }
+    if (fieldNames.contains("aliasIpRanges") && aliasIpRanges != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (AliasIpRange item : aliasIpRanges) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("aliasIpRanges", stringList.build());
+    }
+    if (fieldNames.contains("fingerprint") && fingerprint != null) {
+      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
+    }
     if (fieldNames.contains("kind") && kind != null) {
       fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
     }
@@ -98,6 +116,12 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("accessConfigs")) {
       return String.valueOf(accessConfigs);
     }
+    if (fieldName.equals("aliasIpRanges")) {
+      return String.valueOf(aliasIpRanges);
+    }
+    if (fieldName.equals("fingerprint")) {
+      return String.valueOf(fingerprint);
+    }
     if (fieldName.equals("kind")) {
       return String.valueOf(kind);
     }
@@ -126,6 +150,14 @@ public List getAccessConfigsList() {
     return accessConfigs;
   }
 
+  public List getAliasIpRangesList() {
+    return aliasIpRanges;
+  }
+
+  public String getFingerprint() {
+    return fingerprint;
+  }
+
   public String getKind() {
     return kind;
   }
@@ -168,6 +200,8 @@ public static NetworkInterface getDefaultInstance() {
 
   public static class Builder {
     private List accessConfigs;
+    private List aliasIpRanges;
+    private String fingerprint;
     private String kind;
     private String name;
     private String network;
@@ -181,6 +215,12 @@ public Builder mergeFrom(NetworkInterface other) {
       if (other.getAccessConfigsList() != null) {
         this.accessConfigs = other.accessConfigs;
       }
+      if (other.getAliasIpRangesList() != null) {
+        this.aliasIpRanges = other.aliasIpRanges;
+      }
+      if (other.getFingerprint() != null) {
+        this.fingerprint = other.fingerprint;
+      }
       if (other.getKind() != null) {
         this.kind = other.kind;
       }
@@ -201,6 +241,8 @@ public Builder mergeFrom(NetworkInterface other) {
 
     Builder(NetworkInterface source) {
       this.accessConfigs = source.accessConfigs;
+      this.aliasIpRanges = source.aliasIpRanges;
+      this.fingerprint = source.fingerprint;
       this.kind = source.kind;
       this.name = source.name;
       this.network = source.network;
@@ -225,6 +267,32 @@ public Builder addAccessConfigs(AccessConfig accessConfigs) {
       return this;
     }
 
+    public List getAliasIpRangesList() {
+      return aliasIpRanges;
+    }
+
+    public Builder addAllAliasIpRanges(List aliasIpRanges) {
+      if (this.aliasIpRanges == null) {
+        this.aliasIpRanges = new ArrayList<>(aliasIpRanges.size());
+      }
+      this.aliasIpRanges.addAll(aliasIpRanges);
+      return this;
+    }
+
+    public Builder addAliasIpRanges(AliasIpRange aliasIpRanges) {
+      this.aliasIpRanges.add(aliasIpRanges);
+      return this;
+    }
+
+    public String getFingerprint() {
+      return fingerprint;
+    }
+
+    public Builder setFingerprint(String fingerprint) {
+      this.fingerprint = fingerprint;
+      return this;
+    }
+
     public String getKind() {
       return kind;
     }
@@ -277,8 +345,12 @@ public NetworkInterface build() {
 
 
 
+
+
       return new NetworkInterface(
         accessConfigs,
+        aliasIpRanges,
+        fingerprint,
         kind,
         name,
         network,
@@ -290,6 +362,8 @@ public NetworkInterface build() {
     public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.addAllAccessConfigs(this.accessConfigs);
+      newBuilder.addAllAliasIpRanges(this.aliasIpRanges);
+      newBuilder.setFingerprint(this.fingerprint);
       newBuilder.setKind(this.kind);
       newBuilder.setName(this.name);
       newBuilder.setNetwork(this.network);
@@ -303,6 +377,8 @@ public Builder clone() {
   public String toString() {
     return "NetworkInterface{"
         + "accessConfigs=" + accessConfigs + ", "
+        + "aliasIpRanges=" + aliasIpRanges + ", "
+        + "fingerprint=" + fingerprint + ", "
         + "kind=" + kind + ", "
         + "name=" + name + ", "
         + "network=" + network + ", "
@@ -320,6 +396,8 @@ public boolean equals(Object o) {
       NetworkInterface that = (NetworkInterface) o;
       return
           Objects.equals(this.accessConfigs, that.getAccessConfigsList()) &&
+          Objects.equals(this.aliasIpRanges, that.getAliasIpRangesList()) &&
+          Objects.equals(this.fingerprint, that.getFingerprint()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.name, that.getName()) &&
           Objects.equals(this.network, that.getNetwork()) &&
@@ -334,6 +412,8 @@ public boolean equals(Object o) {
   public int hashCode() {
     return Objects.hash(
       accessConfigs,
+      aliasIpRanges,
+      fingerprint,
       kind,
       name,
       network,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java
index eaaef922532c..656cc261b12b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java
@@ -37,6 +37,7 @@ public final class NetworkList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private NetworkList() {
     this.id = null;
@@ -44,6 +45,7 @@ private NetworkList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private NetworkList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(NetworkList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(NetworkList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public NetworkList build() {
 
 
 
 
+
       return new NetworkList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java
index e5712d85cf8f..92e245188b13 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java
@@ -17,21 +17,25 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import javax.annotation.Generated;
 
 @Generated("by GAPIC")
 @BetaApi
-public final class NetworkName implements ResourceName {
+public final class NetworkName implements com.google.api.resourcenames.ResourceName {
   private final String network;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
-      PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}");
 
   private volatile Map fieldValuesMap;
 
@@ -48,12 +52,25 @@ private NetworkName(Builder builder) {
     project = Preconditions.checkNotNull(builder.getProject());
   }
 
-  public static NetworkName of(String network, String project) {
-    return newBuilder().setNetwork(network).setProject(project).build();
+  public static NetworkName of(
+      String network,
+      String project
+      ) {
+    return newBuilder()
+    .setNetwork(network)
+    .setProject(project)
+      .build();
   }
 
-  public static String format(String network, String project) {
-    return of(network, project).toString();
+  public static String format(
+      String network,
+      String project
+      ) {
+    return of(
+        network,
+        project
+        )
+        .toString();
   }
 
   public String getNetwork() {
@@ -64,6 +81,7 @@ public String getProject() {
     return project;
   }
 
+
   @Override
   public Map getFieldValuesMap() {
     if (fieldValuesMap == null) {
@@ -83,19 +101,20 @@ public String getFieldValue(String fieldName) {
     return getFieldValuesMap().get(fieldName);
   }
 
+
   public static ResourceNameFactory newFactory() {
     return new ResourceNameFactory() {
-      public NetworkName parse(String formattedString) {
-        return NetworkName.parse(formattedString);
-      }
+      public NetworkName parse(String formattedString) {return NetworkName.parse(formattedString);}
     };
   }
 
   public static NetworkName parse(String formattedString) {
     Map matchMap =
-        PATH_TEMPLATE.validatedMatch(
-            formattedString, "NetworkName.parse: formattedString not in valid format");
-    return of(matchMap.get("network"), matchMap.get("project"));
+        PATH_TEMPLATE.validatedMatch(formattedString, "NetworkName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("network"),
+      matchMap.get("project")
+    );
   }
 
   public static boolean isParsableFrom(String formattedString) {
@@ -109,7 +128,6 @@ public static class Builder {
     public String getNetwork() {
       return network;
     }
-
     public String getProject() {
       return project;
     }
@@ -118,7 +136,6 @@ public Builder setNetwork(String network) {
       this.network = network;
       return this;
     }
-
     public Builder setProject(String project) {
       this.project = project;
       return this;
@@ -126,7 +143,7 @@ public Builder setProject(String project) {
 
     private Builder() {}
 
-    public Builder(NetworkName networkName) {
+    public Builder (NetworkName networkName) {
       network = networkName.network;
       project = networkName.project;
     }
@@ -140,7 +157,8 @@ public NetworkName build() {
   public String toString() {
     return PATH_TEMPLATE.instantiate(
         "network", network,
-        "project", project);
+        "project", project
+        );
   }
 
   @Override
@@ -150,14 +168,19 @@ public boolean equals(Object o) {
     }
     if (o instanceof NetworkName) {
       NetworkName that = (NetworkName) o;
-      return Objects.equals(this.network, that.getNetwork())
-          && Objects.equals(this.project, that.getProject());
+      return
+          Objects.equals(this.network, that.getNetwork()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(network, project);
+    return Objects.hash(
+      network,
+      project
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java
new file mode 100644
index 000000000000..5ac29faa47ef
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java
@@ -0,0 +1,298 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class NetworkPeering implements ApiMessage {
+  private final Boolean autoCreateRoutes;
+  private final String name;
+  private final String network;
+  private final String state;
+  private final String stateDetails;
+
+  private NetworkPeering() {
+    this.autoCreateRoutes = null;
+    this.name = null;
+    this.network = null;
+    this.state = null;
+    this.stateDetails = null;
+  }
+
+
+  private NetworkPeering(
+      Boolean autoCreateRoutes,
+      String name,
+      String network,
+      String state,
+      String stateDetails
+      ) {
+    this.autoCreateRoutes = autoCreateRoutes;
+    this.name = name;
+    this.network = network;
+    this.state = state;
+    this.stateDetails = stateDetails;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) {
+      fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes)));
+    }
+    if (fieldNames.contains("name") && name != null) {
+      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
+    }
+    if (fieldNames.contains("network") && network != null) {
+      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
+    }
+    if (fieldNames.contains("state") && state != null) {
+      fieldMap.put("state", Collections.singletonList(String.valueOf(state)));
+    }
+    if (fieldNames.contains("stateDetails") && stateDetails != null) {
+      fieldMap.put("stateDetails", Collections.singletonList(String.valueOf(stateDetails)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("autoCreateRoutes")) {
+      return String.valueOf(autoCreateRoutes);
+    }
+    if (fieldName.equals("name")) {
+      return String.valueOf(name);
+    }
+    if (fieldName.equals("network")) {
+      return String.valueOf(network);
+    }
+    if (fieldName.equals("state")) {
+      return String.valueOf(state);
+    }
+    if (fieldName.equals("stateDetails")) {
+      return String.valueOf(stateDetails);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public Boolean getAutoCreateRoutes() {
+    return autoCreateRoutes;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public String getNetwork() {
+    return network;
+  }
+
+  public String getState() {
+    return state;
+  }
+
+  public String getStateDetails() {
+    return stateDetails;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(NetworkPeering prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static NetworkPeering getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final NetworkPeering DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new NetworkPeering();
+  }
+
+  public static class Builder {
+    private Boolean autoCreateRoutes;
+    private String name;
+    private String network;
+    private String state;
+    private String stateDetails;
+
+    Builder() {}
+
+    public Builder mergeFrom(NetworkPeering other) {
+      if (other == NetworkPeering.getDefaultInstance()) return this;
+      if (other.getAutoCreateRoutes() != null) {
+        this.autoCreateRoutes = other.autoCreateRoutes;
+      }
+      if (other.getName() != null) {
+        this.name = other.name;
+      }
+      if (other.getNetwork() != null) {
+        this.network = other.network;
+      }
+      if (other.getState() != null) {
+        this.state = other.state;
+      }
+      if (other.getStateDetails() != null) {
+        this.stateDetails = other.stateDetails;
+      }
+      return this;
+    }
+
+    Builder(NetworkPeering source) {
+      this.autoCreateRoutes = source.autoCreateRoutes;
+      this.name = source.name;
+      this.network = source.network;
+      this.state = source.state;
+      this.stateDetails = source.stateDetails;
+    }
+
+    public Boolean getAutoCreateRoutes() {
+      return autoCreateRoutes;
+    }
+
+    public Builder setAutoCreateRoutes(Boolean autoCreateRoutes) {
+      this.autoCreateRoutes = autoCreateRoutes;
+      return this;
+    }
+
+    public String getName() {
+      return name;
+    }
+
+    public Builder setName(String name) {
+      this.name = name;
+      return this;
+    }
+
+    public String getNetwork() {
+      return network;
+    }
+
+    public Builder setNetwork(String network) {
+      this.network = network;
+      return this;
+    }
+
+    public String getState() {
+      return state;
+    }
+
+    public Builder setState(String state) {
+      this.state = state;
+      return this;
+    }
+
+    public String getStateDetails() {
+      return stateDetails;
+    }
+
+    public Builder setStateDetails(String stateDetails) {
+      this.stateDetails = stateDetails;
+      return this;
+    }
+
+
+    public NetworkPeering build() {
+
+
+
+
+      return new NetworkPeering(
+        autoCreateRoutes,
+        name,
+        network,
+        state,
+        stateDetails
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAutoCreateRoutes(this.autoCreateRoutes);
+      newBuilder.setName(this.name);
+      newBuilder.setNetwork(this.network);
+      newBuilder.setState(this.state);
+      newBuilder.setStateDetails(this.stateDetails);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "NetworkPeering{"
+        + "autoCreateRoutes=" + autoCreateRoutes + ", "
+        + "name=" + name + ", "
+        + "network=" + network + ", "
+        + "state=" + state + ", "
+        + "stateDetails=" + stateDetails
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof NetworkPeering) {
+      NetworkPeering that = (NetworkPeering) o;
+      return
+          Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) &&
+          Objects.equals(this.name, that.getName()) &&
+          Objects.equals(this.network, that.getNetwork()) &&
+          Objects.equals(this.state, that.getState()) &&
+          Objects.equals(this.stateDetails, that.getStateDetails())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      autoCreateRoutes,
+      name,
+      network,
+      state,
+      stateDetails
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java
new file mode 100644
index 000000000000..580ef4880229
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class NetworkRoutingConfig implements ApiMessage {
+  private final String routingMode;
+
+  private NetworkRoutingConfig() {
+    this.routingMode = null;
+  }
+
+
+  private NetworkRoutingConfig(
+      String routingMode
+      ) {
+    this.routingMode = routingMode;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("routingMode") && routingMode != null) {
+      fieldMap.put("routingMode", Collections.singletonList(String.valueOf(routingMode)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("routingMode")) {
+      return String.valueOf(routingMode);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getRoutingMode() {
+    return routingMode;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(NetworkRoutingConfig prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static NetworkRoutingConfig getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final NetworkRoutingConfig DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new NetworkRoutingConfig();
+  }
+
+  public static class Builder {
+    private String routingMode;
+
+    Builder() {}
+
+    public Builder mergeFrom(NetworkRoutingConfig other) {
+      if (other == NetworkRoutingConfig.getDefaultInstance()) return this;
+      if (other.getRoutingMode() != null) {
+        this.routingMode = other.routingMode;
+      }
+      return this;
+    }
+
+    Builder(NetworkRoutingConfig source) {
+      this.routingMode = source.routingMode;
+    }
+
+    public String getRoutingMode() {
+      return routingMode;
+    }
+
+    public Builder setRoutingMode(String routingMode) {
+      this.routingMode = routingMode;
+      return this;
+    }
+
+
+    public NetworkRoutingConfig build() {
+      return new NetworkRoutingConfig(
+        routingMode
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setRoutingMode(this.routingMode);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "NetworkRoutingConfig{"
+        + "routingMode=" + routingMode
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof NetworkRoutingConfig) {
+      NetworkRoutingConfig that = (NetworkRoutingConfig) o;
+      return
+          Objects.equals(this.routingMode, that.getRoutingMode())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      routingMode
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java
index 81158c51956a..1b745c9bdcb6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java
@@ -15,23 +15,45 @@
  */
 package com.google.cloud.compute.v1;
 
-import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse;
-
 import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
+import com.google.api.gax.core.CredentialsProvider;
+import com.google.api.gax.core.ExecutorProvider;
+import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
+import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.HeaderProvider;
+import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.auth.Credentials;
+import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse;
 import com.google.cloud.compute.v1.stub.NetworkStubSettings;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
+import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -40,21 +62,21 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default - * port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteNetwork to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of addPeeringNetwork to 30 seconds: * *

  * 
  * NetworkSettings.Builder networkSettingsBuilder =
  *     NetworkSettings.newBuilder();
- * networkSettingsBuilder.deleteNetworkSettings().getRetrySettings().toBuilder()
+ * networkSettingsBuilder.addPeeringNetworkSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * NetworkSettings networkSettings = networkSettingsBuilder.build();
  * 
@@ -63,64 +85,105 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class NetworkSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to deleteNetwork. */
+  /**
+   * Returns the object with the settings used for calls to addPeeringNetwork.
+   */
+  public UnaryCallSettings addPeeringNetworkSettings() {
+    return ((NetworkStubSettings) getStubSettings()).addPeeringNetworkSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to deleteNetwork.
+   */
   public UnaryCallSettings deleteNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).deleteNetworkSettings();
   }
 
-  /** Returns the object with the settings used for calls to getNetwork. */
+  /**
+   * Returns the object with the settings used for calls to getNetwork.
+   */
   public UnaryCallSettings getNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).getNetworkSettings();
   }
 
-  /** Returns the object with the settings used for calls to insertNetwork. */
+  /**
+   * Returns the object with the settings used for calls to insertNetwork.
+   */
   public UnaryCallSettings insertNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).insertNetworkSettings();
   }
 
-  /** Returns the object with the settings used for calls to listNetworks. */
-  public PagedCallSettings
-      listNetworksSettings() {
+  /**
+   * Returns the object with the settings used for calls to listNetworks.
+   */
+  public PagedCallSettings listNetworksSettings() {
     return ((NetworkStubSettings) getStubSettings()).listNetworksSettings();
   }
 
-  /** Returns the object with the settings used for calls to switchToCustomModeNetwork. */
-  public UnaryCallSettings
-      switchToCustomModeNetworkSettings() {
+  /**
+   * Returns the object with the settings used for calls to patchNetwork.
+   */
+  public UnaryCallSettings patchNetworkSettings() {
+    return ((NetworkStubSettings) getStubSettings()).patchNetworkSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to removePeeringNetwork.
+   */
+  public UnaryCallSettings removePeeringNetworkSettings() {
+    return ((NetworkStubSettings) getStubSettings()).removePeeringNetworkSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to switchToCustomModeNetwork.
+   */
+  public UnaryCallSettings switchToCustomModeNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).switchToCustomModeNetworkSettings();
   }
 
+
   public static final NetworkSettings create(NetworkStubSettings stub) throws IOException {
     return new NetworkSettings.Builder(stub.toBuilder()).build();
   }
 
-  /** Returns a builder for the default ExecutorProvider for this service. */
+  /**
+   * Returns a builder for the default ExecutorProvider for this service.
+   */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return NetworkStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /** Returns the default service endpoint. */
-  public static String getDefaultEndpoint() {
-    return NetworkStubSettings.getDefaultEndpoint();
-  }
-  /** Returns the default service port. */
+  /**
+   * Returns the default service endpoint.
+   */
+   public static String getDefaultEndpoint() {
+     return NetworkStubSettings.getDefaultEndpoint();
+   }
+  /**
+   * Returns the default service port.
+   */
   public static int getDefaultServicePort() {
     return NetworkStubSettings.getDefaultServicePort();
   }
 
-  /** Returns the default service scopes. */
+
+  /**
+   * Returns the default service scopes.
+   */
   public static List getDefaultServiceScopes() {
     return NetworkStubSettings.getDefaultServiceScopes();
   }
 
-  /** Returns a builder for the default credentials for this service. */
+
+  /**
+   * Returns a builder for the default credentials for this service.
+   */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return NetworkStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder
-      defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
     return NetworkStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -133,17 +196,23 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return NetworkStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /** Returns a builder containing all the values of this settings class. */
+  /**
+   * Returns a builder containing all the values of this settings class.
+   */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -152,7 +221,9 @@ protected NetworkSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /** Builder for NetworkSettings. */
+  /**
+   * Builder for NetworkSettings.
+   */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -174,6 +245,7 @@ protected Builder(NetworkStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
+
     public NetworkStubSettings.Builder getStubSettingsBuilder() {
       return ((NetworkStubSettings.Builder) getStubSettings());
     }
@@ -181,40 +253,66 @@ public NetworkStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * 

Note: This method does not support applying settings to streaming methods. + * Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** Returns the builder for the settings used for calls to deleteNetwork. */ + /** + * Returns the builder for the settings used for calls to addPeeringNetwork. + */ + public UnaryCallSettings.Builder addPeeringNetworkSettings() { + return getStubSettingsBuilder().addPeeringNetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteNetwork. + */ public UnaryCallSettings.Builder deleteNetworkSettings() { return getStubSettingsBuilder().deleteNetworkSettings(); } - /** Returns the builder for the settings used for calls to getNetwork. */ + /** + * Returns the builder for the settings used for calls to getNetwork. + */ public UnaryCallSettings.Builder getNetworkSettings() { return getStubSettingsBuilder().getNetworkSettings(); } - /** Returns the builder for the settings used for calls to insertNetwork. */ + /** + * Returns the builder for the settings used for calls to insertNetwork. + */ public UnaryCallSettings.Builder insertNetworkSettings() { return getStubSettingsBuilder().insertNetworkSettings(); } - /** Returns the builder for the settings used for calls to listNetworks. */ - public PagedCallSettings.Builder< - ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse> - listNetworksSettings() { + /** + * Returns the builder for the settings used for calls to listNetworks. + */ + public PagedCallSettings.Builder listNetworksSettings() { return getStubSettingsBuilder().listNetworksSettings(); } - /** Returns the builder for the settings used for calls to switchToCustomModeNetwork. */ - public UnaryCallSettings.Builder - switchToCustomModeNetworkSettings() { + /** + * Returns the builder for the settings used for calls to patchNetwork. + */ + public UnaryCallSettings.Builder patchNetworkSettings() { + return getStubSettingsBuilder().patchNetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to removePeeringNetwork. + */ + public UnaryCallSettings.Builder removePeeringNetworkSettings() { + return getStubSettingsBuilder().removePeeringNetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to switchToCustomModeNetwork. + */ + public UnaryCallSettings.Builder switchToCustomModeNetworkSettings() { return getStubSettingsBuilder().switchToCustomModeNetworkSettings(); } @@ -223,4 +321,4 @@ public NetworkSettings build() throws IOException { return new NetworkSettings(this); } } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java new file mode 100644 index 000000000000..54f2050785b4 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java @@ -0,0 +1,230 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NetworksAddPeeringRequest implements ApiMessage { + private final Boolean autoCreateRoutes; + private final String name; + private final String peerNetwork; + + private NetworksAddPeeringRequest() { + this.autoCreateRoutes = null; + this.name = null; + this.peerNetwork = null; + } + + + private NetworksAddPeeringRequest( + Boolean autoCreateRoutes, + String name, + String peerNetwork + ) { + this.autoCreateRoutes = autoCreateRoutes; + this.name = name; + this.peerNetwork = peerNetwork; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) { + fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerNetwork") && peerNetwork != null) { + fieldMap.put("peerNetwork", Collections.singletonList(String.valueOf(peerNetwork))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("autoCreateRoutes")) { + return String.valueOf(autoCreateRoutes); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("peerNetwork")) { + return String.valueOf(peerNetwork); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getAutoCreateRoutes() { + return autoCreateRoutes; + } + + public String getName() { + return name; + } + + public String getPeerNetwork() { + return peerNetwork; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(NetworksAddPeeringRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static NetworksAddPeeringRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final NetworksAddPeeringRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new NetworksAddPeeringRequest(); + } + + public static class Builder { + private Boolean autoCreateRoutes; + private String name; + private String peerNetwork; + + Builder() {} + + public Builder mergeFrom(NetworksAddPeeringRequest other) { + if (other == NetworksAddPeeringRequest.getDefaultInstance()) return this; + if (other.getAutoCreateRoutes() != null) { + this.autoCreateRoutes = other.autoCreateRoutes; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPeerNetwork() != null) { + this.peerNetwork = other.peerNetwork; + } + return this; + } + + Builder(NetworksAddPeeringRequest source) { + this.autoCreateRoutes = source.autoCreateRoutes; + this.name = source.name; + this.peerNetwork = source.peerNetwork; + } + + public Boolean getAutoCreateRoutes() { + return autoCreateRoutes; + } + + public Builder setAutoCreateRoutes(Boolean autoCreateRoutes) { + this.autoCreateRoutes = autoCreateRoutes; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getPeerNetwork() { + return peerNetwork; + } + + public Builder setPeerNetwork(String peerNetwork) { + this.peerNetwork = peerNetwork; + return this; + } + + + public NetworksAddPeeringRequest build() { + + + return new NetworksAddPeeringRequest( + autoCreateRoutes, + name, + peerNetwork + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAutoCreateRoutes(this.autoCreateRoutes); + newBuilder.setName(this.name); + newBuilder.setPeerNetwork(this.peerNetwork); + return newBuilder; + } + } + + @Override + public String toString() { + return "NetworksAddPeeringRequest{" + + "autoCreateRoutes=" + autoCreateRoutes + ", " + + "name=" + name + ", " + + "peerNetwork=" + peerNetwork + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NetworksAddPeeringRequest) { + NetworksAddPeeringRequest that = (NetworksAddPeeringRequest) o; + return + Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) && + Objects.equals(this.name, that.getName()) && + Objects.equals(this.peerNetwork, that.getPeerNetwork()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + autoCreateRoutes, + name, + peerNetwork + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java new file mode 100644 index 000000000000..0c16877da697 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NetworksRemovePeeringRequest implements ApiMessage { + private final String name; + + private NetworksRemovePeeringRequest() { + this.name = null; + } + + + private NetworksRemovePeeringRequest( + String name + ) { + this.name = name; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("name")) { + return String.valueOf(name); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getName() { + return name; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(NetworksRemovePeeringRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static NetworksRemovePeeringRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final NetworksRemovePeeringRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new NetworksRemovePeeringRequest(); + } + + public static class Builder { + private String name; + + Builder() {} + + public Builder mergeFrom(NetworksRemovePeeringRequest other) { + if (other == NetworksRemovePeeringRequest.getDefaultInstance()) return this; + if (other.getName() != null) { + this.name = other.name; + } + return this; + } + + Builder(NetworksRemovePeeringRequest source) { + this.name = source.name; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + + public NetworksRemovePeeringRequest build() { + return new NetworksRemovePeeringRequest( + name + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setName(this.name); + return newBuilder; + } + } + + @Override + public String toString() { + return "NetworksRemovePeeringRequest{" + + "name=" + name + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NetworksRemovePeeringRequest) { + NetworksRemovePeeringRequest that = (NetworksRemovePeeringRequest) o; + return + Objects.equals(this.name, that.getName()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + name + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java index 4c6e6728811c..8c827f601957 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java @@ -37,6 +37,7 @@ public final class OperationAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private OperationAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private OperationAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private OperationAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(OperationAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(OperationAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public OperationAggregatedList build() { + return new OperationAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java index 79986b1e70d9..5844eb80a5e2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java @@ -18,6 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -36,6 +37,7 @@ public final class OperationList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private OperationList() { this.id = null; @@ -43,15 +45,24 @@ private OperationList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } + private OperationList( - String id, List items, String kind, String nextPageToken, String selfLink) { + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -76,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -96,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -125,24 +142,26 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(OperationList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static OperationList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final OperationList DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new OperationList(); } @@ -153,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -173,6 +193,9 @@ public Builder mergeFrom(OperationList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -182,6 +205,7 @@ public Builder mergeFrom(OperationList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -237,9 +261,30 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public OperationList build() { - return new OperationList(id, items, kind, nextPageToken, selfLink); + + + + + return new OperationList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); } public Builder clone() { @@ -249,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -256,20 +302,12 @@ public Builder clone() { @Override public String toString() { return "OperationList{" - + "id=" - + id - + ", " - + "items=" - + items - + ", " - + "kind=" - + kind - + ", " - + "nextPageToken=" - + nextPageToken - + ", " - + "selfLink=" - + selfLink + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -280,17 +318,27 @@ public boolean equals(Object o) { } if (o instanceof OperationList) { OperationList that = (OperationList) o; - return Objects.equals(this.id, that.getId()) - && Objects.equals(this.items, that.getItemsList()) - && Objects.equals(this.kind, that.getKind()) - && Objects.equals(this.nextPageToken, that.getNextPageToken()) - && Objects.equals(this.selfLink, that.getSelfLink()); + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(id, items, kind, nextPageToken, selfLink); + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java index 3d3b370ab39a..176bc98b599c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class OperationName implements ResourceName { +public final class OperationName implements com.google.api.resourcenames.ResourceName { private final String operation; private final String project; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index a526c818f415..7df6f2224229 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchAutoscalerHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private final String zone; @@ -52,6 +53,7 @@ private PatchAutoscalerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; this.zone = null; } @@ -66,6 +68,7 @@ private PatchAutoscalerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp, String zone ) { @@ -77,6 +80,7 @@ private PatchAutoscalerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; this.zone = zone; } @@ -108,6 +112,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -143,6 +150,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -190,6 +200,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -227,6 +241,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; private String zone; @@ -258,6 +273,9 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -276,6 +294,7 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; this.zone = source.zone; } @@ -352,6 +371,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -374,9 +402,8 @@ public Builder setZone(String zone) { public PatchAutoscalerHttpRequest build() { String missing = ""; - if (autoscaler == null) { - missing += " autoscaler"; - } + + @@ -399,6 +426,7 @@ public PatchAutoscalerHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); @@ -414,6 +442,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -431,6 +460,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + ", " + "zone=" + zone + "}"; @@ -452,6 +482,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) ; @@ -470,6 +501,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java new file mode 100644 index 000000000000..04819b1c5fa2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchBackendBucketHttpRequest implements ApiMessage { + private final String access_token; + private final String backendBucket; + private final BackendBucket backendBucketResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private PatchBackendBucketHttpRequest() { + this.access_token = null; + this.backendBucket = null; + this.backendBucketResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private PatchBackendBucketHttpRequest( + String access_token, + String backendBucket, + BackendBucket backendBucketResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.backendBucket = backendBucket; + this.backendBucketResource = backendBucketResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucket") && backendBucket != null) { + fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); + } + if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { + fieldMap.put("backendBucketResource", Collections.singletonList(String.valueOf(backendBucketResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendBucket")) { + return String.valueOf(backendBucket); + } + if (fieldName.equals("backendBucketResource")) { + return String.valueOf(backendBucketResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendBucket getApiMessageRequestBody() { + return backendBucketResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendBucket() { + return backendBucket; + } + + public BackendBucket getBackendBucketResource() { + return backendBucketResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchBackendBucketHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchBackendBucketHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchBackendBucketHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchBackendBucketHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendBucket; + private BackendBucket backendBucketResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchBackendBucketHttpRequest other) { + if (other == PatchBackendBucketHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendBucket() != null) { + this.backendBucket = other.backendBucket; + } + if (other.getBackendBucketResource() != null) { + this.backendBucketResource = other.backendBucketResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchBackendBucketHttpRequest source) { + this.access_token = source.access_token; + this.backendBucket = source.backendBucket; + this.backendBucketResource = source.backendBucketResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendBucket() { + return backendBucket; + } + + public Builder setBackendBucket(String backendBucket) { + this.backendBucket = backendBucket; + return this; + } + + public BackendBucket getBackendBucketResource() { + return backendBucketResource; + } + + public Builder setBackendBucketResource(BackendBucket backendBucketResource) { + this.backendBucketResource = backendBucketResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchBackendBucketHttpRequest build() { + String missing = ""; + + if (backendBucket == null) { + missing += " backendBucket"; + } + + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchBackendBucketHttpRequest( + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendBucket(this.backendBucket); + newBuilder.setBackendBucketResource(this.backendBucketResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchBackendBucketHttpRequest{" + + "access_token=" + access_token + ", " + + "backendBucket=" + backendBucket + ", " + + "backendBucketResource=" + backendBucketResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchBackendBucketHttpRequest) { + PatchBackendBucketHttpRequest that = (PatchBackendBucketHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendBucket, that.getBackendBucket()) && + Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index 459662bc9f58..3249e46d5a80 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchBackendServiceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private PatchBackendServiceHttpRequest() { @@ -51,6 +52,7 @@ private PatchBackendServiceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private PatchBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private PatchBackendServiceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public PatchBackendServiceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public PatchBackendServiceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index c6a057ec7f00..3910dc99b807 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private PatchFirewallHttpRequest() { @@ -51,6 +52,7 @@ private PatchFirewallHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private PatchFirewallHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private PatchFirewallHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public PatchFirewallHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public PatchFirewallHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index e6d6591722c9..0087f5f0fc19 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private PatchHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private PatchHealthCheckHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private PatchHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private PatchHealthCheckHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public PatchHealthCheckHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public PatchHealthCheckHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index a6efb48981b0..da8719683aab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private PatchHttpHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private PatchHttpHealthCheckHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private PatchHttpHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private PatchHttpHealthCheckHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public PatchHttpHealthCheckHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public PatchHttpHealthCheckHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index 113221fa5b6e..ec82df41c043 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private PatchHttpsHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private PatchHttpsHealthCheckHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private PatchHttpsHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private PatchHttpsHealthCheckHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public PatchHttpsHealthCheckHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public PatchHttpsHealthCheckHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java new file mode 100644 index 000000000000..8ac114d779e2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchInterconnectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String interconnect; + private final Interconnect interconnectResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private PatchInterconnectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.interconnect = null; + this.interconnectResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private PatchInterconnectHttpRequest( + String access_token, + String callback, + String fields, + String interconnect, + Interconnect interconnectResource, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.interconnect = interconnect; + this.interconnectResource = interconnectResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnect") && interconnect != null) { + fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); + } + if (fieldNames.contains("interconnectResource") && interconnectResource != null) { + fieldMap.put("interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("interconnect")) { + return String.valueOf(interconnect); + } + if (fieldName.equals("interconnectResource")) { + return String.valueOf(interconnectResource); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Interconnect getApiMessageRequestBody() { + return interconnectResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInterconnect() { + return interconnect; + } + + public Interconnect getInterconnectResource() { + return interconnectResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchInterconnectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchInterconnectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchInterconnectHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchInterconnectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String interconnect; + private Interconnect interconnectResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchInterconnectHttpRequest other) { + if (other == PatchInterconnectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInterconnect() != null) { + this.interconnect = other.interconnect; + } + if (other.getInterconnectResource() != null) { + this.interconnectResource = other.interconnectResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchInterconnectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.interconnect = source.interconnect; + this.interconnectResource = source.interconnectResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInterconnect() { + return interconnect; + } + + public Builder setInterconnect(String interconnect) { + this.interconnect = interconnect; + return this; + } + + public Interconnect getInterconnectResource() { + return interconnectResource; + } + + public Builder setInterconnectResource(Interconnect interconnectResource) { + this.interconnectResource = interconnectResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchInterconnectHttpRequest build() { + String missing = ""; + + + + if (interconnect == null) { + missing += " interconnect"; + } + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchInterconnectHttpRequest( + access_token, + callback, + fields, + interconnect, + interconnectResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInterconnect(this.interconnect); + newBuilder.setInterconnectResource(this.interconnectResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchInterconnectHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "interconnect=" + interconnect + ", " + + "interconnectResource=" + interconnectResource + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchInterconnectHttpRequest) { + PatchInterconnectHttpRequest that = (PatchInterconnectHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.interconnect, that.getInterconnect()) && + Objects.equals(this.interconnectResource, that.getInterconnectResource()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + interconnect, + interconnectResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java new file mode 100644 index 000000000000..f5fbf6293f21 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String network; + private final Network networkResource; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private PatchNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.network = null; + this.networkResource = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private PatchNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String network, + Network networkResource, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.network = network; + this.networkResource = networkResource; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networkResource") && networkResource != null) { + fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("networkResource")) { + return String.valueOf(networkResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Network getApiMessageRequestBody() { + return networkResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNetwork() { + return network; + } + + public Network getNetworkResource() { + return networkResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String network; + private Network networkResource; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchNetworkHttpRequest other) { + if (other == PatchNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getNetworkResource() != null) { + this.networkResource = other.networkResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.network = source.network; + this.networkResource = source.networkResource; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public Network getNetworkResource() { + return networkResource; + } + + public Builder setNetworkResource(Network networkResource) { + this.networkResource = networkResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchNetworkHttpRequest build() { + String missing = ""; + + + + + if (network == null) { + missing += " network"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchNetworkHttpRequest( + access_token, + callback, + fields, + key, + network, + networkResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetwork(this.network); + newBuilder.setNetworkResource(this.networkResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "networkResource=" + networkResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchNetworkHttpRequest) { + PatchNetworkHttpRequest that = (PatchNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.networkResource, that.getNetworkResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + network, + networkResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index ed4ad1b3eff8..bc8e111af76a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -41,6 +41,7 @@ public final class PatchRegionAutoscalerHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private PatchRegionAutoscalerHttpRequest() { @@ -53,6 +54,7 @@ private PatchRegionAutoscalerHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } @@ -67,6 +69,7 @@ private PatchRegionAutoscalerHttpRequest( String prettyPrint, String quotaUser, String region, + String requestId, String userIp ) { this.access_token = access_token; @@ -78,6 +81,7 @@ private PatchRegionAutoscalerHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -111,6 +115,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -146,6 +153,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -194,6 +204,10 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -228,6 +242,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -261,6 +276,9 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -277,6 +295,7 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -361,6 +380,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -374,9 +402,7 @@ public Builder setUserIp(String userIp) { public PatchRegionAutoscalerHttpRequest build() { String missing = ""; - if (autoscaler == null) { - missing += " autoscaler"; - } + @@ -387,6 +413,7 @@ public PatchRegionAutoscalerHttpRequest build() { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -400,6 +427,7 @@ public PatchRegionAutoscalerHttpRequest build() { prettyPrint, quotaUser, region, + requestId, userIp ); } @@ -415,6 +443,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -432,6 +461,7 @@ public String toString() { + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + "region=" + region + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -453,6 +483,7 @@ public boolean equals(Object o) { Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -471,6 +502,7 @@ public int hashCode() { prettyPrint, quotaUser, region, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index 35bf0fecda74..4e6c0efcb0a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -40,6 +40,7 @@ public final class PatchRegionBackendServiceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private PatchRegionBackendServiceHttpRequest() { @@ -51,6 +52,7 @@ private PatchRegionBackendServiceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private PatchRegionBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private PatchRegionBackendServiceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public PatchRegionBackendServiceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public PatchRegionBackendServiceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index 1d01d16f5a91..3c7406a4ad99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -38,6 +38,7 @@ public final class PatchRouterHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String router; private final Router routerResource; private final String userIp; @@ -49,6 +50,7 @@ private PatchRouterHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.router = null; this.routerResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private PatchRouterHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String router, Router routerResource, String userIp @@ -72,6 +75,7 @@ private PatchRouterHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.router = router; this.routerResource = routerResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("router") && router != null) { fieldMap.put("router", Collections.singletonList(String.valueOf(router))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("router")) { return String.valueOf(router); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getRouter() { return router; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String router; private Router routerResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(PatchRouterHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getRouter() != null) { this.router = other.router; } @@ -256,6 +274,7 @@ public Builder mergeFrom(PatchRouterHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.router = source.router; this.routerResource = source.routerResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getRouter() { return router; } @@ -351,6 +379,7 @@ public PatchRouterHttpRequest build() { + if (router == null) { missing += " router"; } @@ -366,6 +395,7 @@ public PatchRouterHttpRequest build() { key, prettyPrint, quotaUser, + requestId, router, routerResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setRouter(this.router); newBuilder.setRouterResource(this.routerResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "router=" + router + ", " + "routerResource=" + routerResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.router, that.getRouter()) && Objects.equals(this.routerResource, that.getRouterResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, router, routerResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java new file mode 100644 index 000000000000..9ac3b8b54779 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchSubnetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String subnetwork; + private final Subnetwork subnetworkResource; + private final String userIp; + + private PatchSubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.subnetwork = null; + this.subnetworkResource = null; + this.userIp = null; + } + + + private PatchSubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String subnetwork, + Subnetwork subnetworkResource, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.subnetwork = subnetwork; + this.subnetworkResource = subnetworkResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { + fieldMap.put("subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("subnetwork")) { + return String.valueOf(subnetwork); + } + if (fieldName.equals("subnetworkResource")) { + return String.valueOf(subnetworkResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Subnetwork getApiMessageRequestBody() { + return subnetworkResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Subnetwork getSubnetworkResource() { + return subnetworkResource; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PatchSubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchSubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final PatchSubnetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PatchSubnetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String subnetwork; + private Subnetwork subnetworkResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchSubnetworkHttpRequest other) { + if (other == PatchSubnetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + if (other.getSubnetworkResource() != null) { + this.subnetworkResource = other.subnetworkResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchSubnetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.subnetwork = source.subnetwork; + this.subnetworkResource = source.subnetworkResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public Subnetwork getSubnetworkResource() { + return subnetworkResource; + } + + public Builder setSubnetworkResource(Subnetwork subnetworkResource) { + this.subnetworkResource = subnetworkResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public PatchSubnetworkHttpRequest build() { + String missing = ""; + + + + + + + + if (subnetwork == null) { + missing += " subnetwork"; + } + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchSubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworkResource, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSubnetwork(this.subnetwork); + newBuilder.setSubnetworkResource(this.subnetworkResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchSubnetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "subnetwork=" + subnetwork + ", " + + "subnetworkResource=" + subnetworkResource + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchSubnetworkHttpRequest) { + PatchSubnetworkHttpRequest that = (PatchSubnetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.subnetwork, that.getSubnetwork()) && + Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworkResource, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index 2d1479373e17..6d46be5537c4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -38,6 +38,7 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String urlMap; private final UrlMap urlMapResource; private final String userIp; @@ -49,6 +50,7 @@ private PatchUrlMapHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.urlMap = null; this.urlMapResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private PatchUrlMapHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String urlMap, UrlMap urlMapResource, String userIp @@ -72,6 +75,7 @@ private PatchUrlMapHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.urlMap = urlMap; this.urlMapResource = urlMapResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("urlMap") && urlMap != null) { fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("urlMap")) { return String.valueOf(urlMap); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUrlMap() { return urlMap; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String urlMap; private UrlMap urlMapResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUrlMap() != null) { this.urlMap = other.urlMap; } @@ -256,6 +274,7 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.urlMap = source.urlMap; this.urlMapResource = source.urlMapResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUrlMap() { return urlMap; } @@ -351,6 +379,7 @@ public PatchUrlMapHttpRequest build() { + if (urlMap == null) { missing += " urlMap"; } @@ -366,6 +395,7 @@ public PatchUrlMapHttpRequest build() { key, prettyPrint, quotaUser, + requestId, urlMap, urlMapResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUrlMap(this.urlMap); newBuilder.setUrlMapResource(this.urlMapResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "urlMap=" + urlMap + ", " + "urlMapResource=" + urlMapResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.urlMap, that.getUrlMap()) && Objects.equals(this.urlMapResource, that.getUrlMapResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, urlMap, urlMapResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java index 84a0b9a47d17..d32b98e40cd3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java @@ -43,6 +43,7 @@ public final class Project implements ApiMessage { private final List quotas; private final String selfLink; private final UsageExportLocation usageExportLocation; + private final String xpnProjectStatus; private Project() { this.commonInstanceMetadata = null; @@ -56,6 +57,7 @@ private Project() { this.quotas = null; this.selfLink = null; this.usageExportLocation = null; + this.xpnProjectStatus = null; } @@ -70,7 +72,8 @@ private Project( String name, List quotas, String selfLink, - UsageExportLocation usageExportLocation + UsageExportLocation usageExportLocation, + String xpnProjectStatus ) { this.commonInstanceMetadata = commonInstanceMetadata; this.creationTimestamp = creationTimestamp; @@ -83,6 +86,7 @@ private Project( this.quotas = quotas; this.selfLink = selfLink; this.usageExportLocation = usageExportLocation; + this.xpnProjectStatus = xpnProjectStatus; } @Override @@ -129,6 +133,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("usageExportLocation") && usageExportLocation != null) { fieldMap.put("usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation))); } + if (fieldNames.contains("xpnProjectStatus") && xpnProjectStatus != null) { + fieldMap.put("xpnProjectStatus", Collections.singletonList(String.valueOf(xpnProjectStatus))); + } return fieldMap; } @@ -167,6 +174,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("usageExportLocation")) { return String.valueOf(usageExportLocation); } + if (fieldName.equals("xpnProjectStatus")) { + return String.valueOf(xpnProjectStatus); + } return null; } @@ -220,6 +230,10 @@ public UsageExportLocation getUsageExportLocation() { return usageExportLocation; } + public String getXpnProjectStatus() { + return xpnProjectStatus; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -252,6 +266,7 @@ public static class Builder { private List quotas; private String selfLink; private UsageExportLocation usageExportLocation; + private String xpnProjectStatus; Builder() {} @@ -290,6 +305,9 @@ public Builder mergeFrom(Project other) { if (other.getUsageExportLocation() != null) { this.usageExportLocation = other.usageExportLocation; } + if (other.getXpnProjectStatus() != null) { + this.xpnProjectStatus = other.xpnProjectStatus; + } return this; } @@ -305,6 +323,7 @@ public Builder mergeFrom(Project other) { this.quotas = source.quotas; this.selfLink = source.selfLink; this.usageExportLocation = source.usageExportLocation; + this.xpnProjectStatus = source.xpnProjectStatus; } public Metadata getCommonInstanceMetadata() { @@ -422,6 +441,15 @@ public Builder setUsageExportLocation(UsageExportLocation usageExportLocation) { return this; } + public String getXpnProjectStatus() { + return xpnProjectStatus; + } + + public Builder setXpnProjectStatus(String xpnProjectStatus) { + this.xpnProjectStatus = xpnProjectStatus; + return this; + } + public Project build() { @@ -434,6 +462,7 @@ public Project build() { + return new Project( commonInstanceMetadata, creationTimestamp, @@ -445,7 +474,8 @@ public Project build() { name, quotas, selfLink, - usageExportLocation + usageExportLocation, + xpnProjectStatus ); } @@ -462,6 +492,7 @@ public Builder clone() { newBuilder.addAllQuotas(this.quotas); newBuilder.setSelfLink(this.selfLink); newBuilder.setUsageExportLocation(this.usageExportLocation); + newBuilder.setXpnProjectStatus(this.xpnProjectStatus); return newBuilder; } } @@ -479,7 +510,8 @@ public String toString() { + "name=" + name + ", " + "quotas=" + quotas + ", " + "selfLink=" + selfLink + ", " - + "usageExportLocation=" + usageExportLocation + + "usageExportLocation=" + usageExportLocation + ", " + + "xpnProjectStatus=" + xpnProjectStatus + "}"; } @@ -501,7 +533,8 @@ public boolean equals(Object o) { Objects.equals(this.name, that.getName()) && Objects.equals(this.quotas, that.getQuotasList()) && Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.usageExportLocation, that.getUsageExportLocation()) + Objects.equals(this.usageExportLocation, that.getUsageExportLocation()) && + Objects.equals(this.xpnProjectStatus, that.getXpnProjectStatus()) ; } return false; @@ -520,7 +553,8 @@ public int hashCode() { name, quotas, selfLink, - usageExportLocation + usageExportLocation, + xpnProjectStatus ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java index 59b0a8d04cea..db6a0c39d912 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class ProjectAddressName implements ResourceName { +public final class ProjectAddressName implements com.google.api.resourcenames.ResourceName { private final String address; private final String project; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java index a868d37751d9..c56ff8a30e30 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java @@ -52,8 +52,9 @@ *

  * 
  * try (ProjectClient projectClient = ProjectClient.create()) {
+ *   String requestId = "";
  *   ProjectName project = ProjectName.of("[PROJECT]");
- *   Project response = projectClient.getProject(project);
+ *   Operation response = projectClient.disableXpnHostProject(requestId, project);
  * }
  * 
  * 
@@ -168,6 +169,503 @@ public ProjectStub getStub() { } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Operation response = projectClient.disableXpnHostProject(requestId, project);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation disableXpnHostProject(String requestId, ProjectName project) { + + DisableXpnHostProjectHttpRequest request = + DisableXpnHostProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .build(); + return disableXpnHostProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Operation response = projectClient.disableXpnHostProject(requestId, project.toString());
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation disableXpnHostProject(String requestId, String project) { + + DisableXpnHostProjectHttpRequest request = + DisableXpnHostProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .build(); + return disableXpnHostProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .build();
+   *   Operation response = projectClient.disableXpnHostProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation disableXpnHostProject(DisableXpnHostProjectHttpRequest request) { + return disableXpnHostProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.disableXpnHostProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable disableXpnHostProjectCallable() { + return stub.disableXpnHostProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable a serivce resource (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
+   *   Operation response = projectClient.disableXpnResourceProject(requestId, project, projectsDisableXpnResourceRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param projectsDisableXpnResourceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation disableXpnResourceProject(String requestId, ProjectName project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { + + DisableXpnResourceProjectHttpRequest request = + DisableXpnResourceProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) + .build(); + return disableXpnResourceProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable a serivce resource (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
+   *   Operation response = projectClient.disableXpnResourceProject(requestId, project.toString(), projectsDisableXpnResourceRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param projectsDisableXpnResourceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation disableXpnResourceProject(String requestId, String project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { + + DisableXpnResourceProjectHttpRequest request = + DisableXpnResourceProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) + .build(); + return disableXpnResourceProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable a serivce resource (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
+   *   DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource)
+   *     .build();
+   *   Operation response = projectClient.disableXpnResourceProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation disableXpnResourceProject(DisableXpnResourceProjectHttpRequest request) { + return disableXpnResourceProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Disable a serivce resource (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
+   *   DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.disableXpnResourceProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable disableXpnResourceProjectCallable() { + return stub.disableXpnResourceProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Enable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Operation response = projectClient.enableXpnHostProject(requestId, project);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation enableXpnHostProject(String requestId, ProjectName project) { + + EnableXpnHostProjectHttpRequest request = + EnableXpnHostProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .build(); + return enableXpnHostProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Enable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Operation response = projectClient.enableXpnHostProject(requestId, project.toString());
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation enableXpnHostProject(String requestId, String project) { + + EnableXpnHostProjectHttpRequest request = + EnableXpnHostProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .build(); + return enableXpnHostProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Enable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .build();
+   *   Operation response = projectClient.enableXpnHostProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation enableXpnHostProject(EnableXpnHostProjectHttpRequest request) { + return enableXpnHostProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Enable this project as a shared VPC host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.enableXpnHostProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable enableXpnHostProjectCallable() { + return stub.enableXpnHostProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
+   *   Operation response = projectClient.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param projectsEnableXpnResourceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation enableXpnResourceProject(String requestId, ProjectName project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + + EnableXpnResourceProjectHttpRequest request = + EnableXpnResourceProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) + .build(); + return enableXpnResourceProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
+   *   Operation response = projectClient.enableXpnResourceProject(requestId, project.toString(), projectsEnableXpnResourceRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param projectsEnableXpnResourceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation enableXpnResourceProject(String requestId, String project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + + EnableXpnResourceProjectHttpRequest request = + EnableXpnResourceProjectHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) + .build(); + return enableXpnResourceProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
+   *   EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource)
+   *     .build();
+   *   Operation response = projectClient.enableXpnResourceProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation enableXpnResourceProject(EnableXpnResourceProjectHttpRequest request) { + return enableXpnResourceProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
+   *   EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.enableXpnResourceProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable enableXpnResourceProjectCallable() { + return stub.enableXpnResourceProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Project response = projectClient.getProject(project);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Project getProject(ProjectName project) { + + GetProjectHttpRequest request = + GetProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return getProject(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns the specified Project resource. @@ -176,7 +674,77 @@ public ProjectStub getStub() { *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   Project response = projectClient.getProject(project);
+   *   Project response = projectClient.getProject(project.toString());
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Project getProject(String project) { + + GetProjectHttpRequest request = + GetProjectHttpRequest.newBuilder() + .setProject(project) + .build(); + return getProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   Project response = projectClient.getProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + private final Project getProject(GetProjectHttpRequest request) { + return getProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified Project resource. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<Project> future = projectClient.getProjectCallable().futureCall(request);
+   *   // Do something
+   *   Project response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getProjectCallable() { + return stub.getProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get the shared VPC host project that this project links to. May be empty if no link exists. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   Project response = projectClient.getXpnHostProject(project);
    * }
    * 
* @@ -184,24 +752,24 @@ public ProjectStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Project getProject(ProjectName project) { + public final Project getXpnHostProject(ProjectName project) { - GetProjectHttpRequest request = - GetProjectHttpRequest.newBuilder() + GetXpnHostProjectHttpRequest request = + GetXpnHostProjectHttpRequest.newBuilder() .setProject(project == null ? null : project.toString()) .build(); - return getProject(request); + return getXpnHostProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Project resource. + * Get the shared VPC host project that this project links to. May be empty if no link exists. * * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   Project response = projectClient.getProject(project.toString());
+   *   Project response = projectClient.getXpnHostProject(project.toString());
    * }
    * 
* @@ -209,27 +777,27 @@ public final Project getProject(ProjectName project) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Project getProject(String project) { + public final Project getXpnHostProject(String project) { - GetProjectHttpRequest request = - GetProjectHttpRequest.newBuilder() + GetXpnHostProjectHttpRequest request = + GetXpnHostProjectHttpRequest.newBuilder() .setProject(project) .build(); - return getProject(request); + return getXpnHostProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Project resource. + * Get the shared VPC host project that this project links to. May be empty if no link exists. * * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder()
+   *   GetXpnHostProjectHttpRequest request = GetXpnHostProjectHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   Project response = projectClient.getProject(request);
+   *   Project response = projectClient.getXpnHostProject(request);
    * }
    * 
* @@ -237,30 +805,308 @@ public final Project getProject(String project) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - private final Project getProject(GetProjectHttpRequest request) { - return getProjectCallable().call(request); + private final Project getXpnHostProject(GetXpnHostProjectHttpRequest request) { + return getXpnHostProjectCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Project resource. + * Get the shared VPC host project that this project links to. May be empty if no link exists. * * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder()
+   *   GetXpnHostProjectHttpRequest request = GetXpnHostProjectHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   ApiFuture<Project> future = projectClient.getProjectCallable().futureCall(request);
+   *   ApiFuture<Project> future = projectClient.getXpnHostProjectCallable().futureCall(request);
    *   // Do something
    *   Project response = future.get();
    * }
    * 
*/ @BetaApi - public final UnaryCallable getProjectCallable() { - return stub.getProjectCallable(); + public final UnaryCallable getXpnHostProjectCallable() { + return stub.getXpnHostProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get service resources (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (XpnResourceId element : projectClient.getXpnResourcesProjects(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(ProjectName project) { + GetXpnResourcesProjectsHttpRequest request = + GetXpnResourcesProjectsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return getXpnResourcesProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get service resources (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (XpnResourceId element : projectClient.getXpnResourcesProjects(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(String project) { + GetXpnResourcesProjectsHttpRequest request = + GetXpnResourcesProjectsHttpRequest.newBuilder() + .setProject(project) + .build(); + return getXpnResourcesProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get service resources (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetXpnResourcesProjectsHttpRequest request = GetXpnResourcesProjectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (XpnResourceId element : projectClient.getXpnResourcesProjects(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(GetXpnResourcesProjectsHttpRequest request) { + return getXpnResourcesProjectsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get service resources (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetXpnResourcesProjectsHttpRequest request = GetXpnResourcesProjectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<GetXpnResourcesProjectsPagedResponse> future = projectClient.getXpnResourcesProjectsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (XpnResourceId element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getXpnResourcesProjectsPagedCallable() { + return stub.getXpnResourcesProjectsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Get service resources (a.k.a service project) associated with this host project. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   GetXpnResourcesProjectsHttpRequest request = GetXpnResourcesProjectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     ProjectsGetXpnResources response = projectClient.getXpnResourcesProjectsCallable().call(request);
+   *     for (XpnResourceId element : response.getResourcesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getXpnResourcesProjectsCallable() { + return stub.getXpnResourcesProjectsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all shared VPC host projects visible to the user in an organization. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build();
+   *   for (Project element : projectClient.listXpnHostsProjects(project, projectsListXpnHostsRequestResource).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param projectsListXpnHostsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(ProjectName project, ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) { + ListXpnHostsProjectsHttpRequest request = + ListXpnHostsProjectsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource) + .build(); + return listXpnHostsProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all shared VPC host projects visible to the user in an organization. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build();
+   *   for (Project element : projectClient.listXpnHostsProjects(project.toString(), projectsListXpnHostsRequestResource).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param projectsListXpnHostsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(String project, ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) { + ListXpnHostsProjectsHttpRequest request = + ListXpnHostsProjectsHttpRequest.newBuilder() + .setProject(project) + .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource) + .build(); + return listXpnHostsProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all shared VPC host projects visible to the user in an organization. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build();
+   *   ListXpnHostsProjectsHttpRequest request = ListXpnHostsProjectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource)
+   *     .build();
+   *   for (Project element : projectClient.listXpnHostsProjects(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(ListXpnHostsProjectsHttpRequest request) { + return listXpnHostsProjectsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all shared VPC host projects visible to the user in an organization. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build();
+   *   ListXpnHostsProjectsHttpRequest request = ListXpnHostsProjectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource)
+   *     .build();
+   *   ApiFuture<ListXpnHostsProjectsPagedResponse> future = projectClient.listXpnHostsProjectsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Project element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listXpnHostsProjectsPagedCallable() { + return stub.listXpnHostsProjectsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all shared VPC host projects visible to the user in an organization. + * + * Sample code: + *

+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build();
+   *   ListXpnHostsProjectsHttpRequest request = ListXpnHostsProjectsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource)
+   *     .build();
+   *   while (true) {
+   *     XpnHostList response = projectClient.listXpnHostsProjectsCallable().call(request);
+   *     for (Project element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listXpnHostsProjectsCallable() { + return stub.listXpnHostsProjectsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -270,21 +1116,28 @@ public final UnaryCallable getProjectCallable() * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveDiskProject(project, diskMoveRequestResource);
+   *   Operation response = projectClient.moveDiskProject(requestId, project, diskMoveRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param diskMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveDiskProject(ProjectName project, DiskMoveRequest diskMoveRequestResource) { + public final Operation moveDiskProject(String requestId, ProjectName project, DiskMoveRequest diskMoveRequestResource) { MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setDiskMoveRequestResource(diskMoveRequestResource) .build(); @@ -298,21 +1151,28 @@ public final Operation moveDiskProject(ProjectName project, DiskMoveRequest disk * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveDiskProject(project.toString(), diskMoveRequestResource);
+   *   Operation response = projectClient.moveDiskProject(requestId, project.toString(), diskMoveRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param diskMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveDiskProject(String project, DiskMoveRequest diskMoveRequestResource) { + public final Operation moveDiskProject(String requestId, String project, DiskMoveRequest diskMoveRequestResource) { MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setDiskMoveRequestResource(diskMoveRequestResource) .build(); @@ -326,9 +1186,11 @@ public final Operation moveDiskProject(String project, DiskMoveRequest diskMoveR * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
    *   MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setDiskMoveRequestResource(diskMoveRequestResource)
    *     .build();
@@ -351,9 +1213,11 @@ public final Operation moveDiskProject(MoveDiskProjectHttpRequest request) {
    * Sample code:
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
    *   MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setDiskMoveRequestResource(diskMoveRequestResource)
    *     .build();
@@ -375,21 +1239,28 @@ public final UnaryCallable moveDiskProjec
    * Sample code:
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveInstanceProject(project, instanceMoveRequestResource);
+   *   Operation response = projectClient.moveInstanceProject(requestId, project, instanceMoveRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveInstanceProject(ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { + public final Operation moveInstanceProject(String requestId, ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setInstanceMoveRequestResource(instanceMoveRequestResource) .build(); @@ -403,21 +1274,28 @@ public final Operation moveInstanceProject(ProjectName project, InstanceMoveRequ * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveInstanceProject(project.toString(), instanceMoveRequestResource);
+   *   Operation response = projectClient.moveInstanceProject(requestId, project.toString(), instanceMoveRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveInstanceProject(String project, InstanceMoveRequest instanceMoveRequestResource) { + public final Operation moveInstanceProject(String requestId, String project, InstanceMoveRequest instanceMoveRequestResource) { MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setInstanceMoveRequestResource(instanceMoveRequestResource) .build(); @@ -431,9 +1309,11 @@ public final Operation moveInstanceProject(String project, InstanceMoveRequest i * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
    *   MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceMoveRequestResource(instanceMoveRequestResource)
    *     .build();
@@ -456,9 +1336,11 @@ public final Operation moveInstanceProject(MoveInstanceProjectHttpRequest reques
    * Sample code:
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
    *   MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceMoveRequestResource(instanceMoveRequestResource)
    *     .build();
@@ -480,21 +1362,28 @@ public final UnaryCallable moveInstan
    * Sample code:
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = projectClient.setCommonInstanceMetadataProject(project, metadataResource);
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(requestId, project, metadataResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setCommonInstanceMetadataProject(ProjectName project, Metadata metadataResource) { + public final Operation setCommonInstanceMetadataProject(String requestId, ProjectName project, Metadata metadataResource) { SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setMetadataResource(metadataResource) .build(); @@ -508,21 +1397,28 @@ public final Operation setCommonInstanceMetadataProject(ProjectName project, Met * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = projectClient.setCommonInstanceMetadataProject(project.toString(), metadataResource);
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(requestId, project.toString(), metadataResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setCommonInstanceMetadataProject(String project, Metadata metadataResource) { + public final Operation setCommonInstanceMetadataProject(String requestId, String project, Metadata metadataResource) { SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setMetadataResource(metadataResource) .build(); @@ -536,9 +1432,11 @@ public final Operation setCommonInstanceMetadataProject(String project, Metadata * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setMetadataResource(metadataResource)
    *     .build();
@@ -561,9 +1459,11 @@ public final Operation setCommonInstanceMetadataProject(SetCommonInstanceMetadat
    * Sample code:
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setMetadataResource(metadataResource)
    *     .build();
@@ -585,21 +1485,28 @@ public final UnaryCallable
    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
-   *   Operation response = projectClient.setUsageExportBucketProject(project, usageExportLocationResource);
+   *   Operation response = projectClient.setUsageExportBucketProject(requestId, project, usageExportLocationResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUsageExportBucketProject(ProjectName project, UsageExportLocation usageExportLocationResource) { + public final Operation setUsageExportBucketProject(String requestId, ProjectName project, UsageExportLocation usageExportLocationResource) { SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setUsageExportLocationResource(usageExportLocationResource) .build(); @@ -613,21 +1520,28 @@ public final Operation setUsageExportBucketProject(ProjectName project, UsageExp * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
-   *   Operation response = projectClient.setUsageExportBucketProject(project.toString(), usageExportLocationResource);
+   *   Operation response = projectClient.setUsageExportBucketProject(requestId, project.toString(), usageExportLocationResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUsageExportBucketProject(String project, UsageExportLocation usageExportLocationResource) { + public final Operation setUsageExportBucketProject(String requestId, String project, UsageExportLocation usageExportLocationResource) { SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setUsageExportLocationResource(usageExportLocationResource) .build(); @@ -641,9 +1555,11 @@ public final Operation setUsageExportBucketProject(String project, UsageExportLo * Sample code: *

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
    *   SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUsageExportLocationResource(usageExportLocationResource)
    *     .build();
@@ -666,9 +1582,11 @@ public final Operation setUsageExportBucketProject(SetUsageExportBucketProjectHt
    * Sample code:
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
    *   SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUsageExportLocationResource(usageExportLocationResource)
    *     .build();
@@ -713,5 +1631,178 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
+  public static class GetXpnResourcesProjectsPagedResponse extends AbstractPagedListResponse<
+      GetXpnResourcesProjectsHttpRequest,
+      ProjectsGetXpnResources,
+      XpnResourceId,
+      GetXpnResourcesProjectsPage,
+      GetXpnResourcesProjectsFixedSizeCollection> {
+
+    public static ApiFuture createAsync(
+        PageContext context,
+        ApiFuture futureResponse) {
+      ApiFuture futurePage =
+          GetXpnResourcesProjectsPage.createEmptyPage().createPageAsync(context, futureResponse);
+      return ApiFutures.transform(
+          futurePage,
+          new ApiFunction() {
+            @Override
+            public GetXpnResourcesProjectsPagedResponse apply(GetXpnResourcesProjectsPage input) {
+              return new GetXpnResourcesProjectsPagedResponse(input);
+            }
+          });
+    }
+
+    private GetXpnResourcesProjectsPagedResponse(GetXpnResourcesProjectsPage page) {
+      super(page, GetXpnResourcesProjectsFixedSizeCollection.createEmptyCollection());
+    }
+
+
+  }
+
+  public static class GetXpnResourcesProjectsPage extends AbstractPage<
+      GetXpnResourcesProjectsHttpRequest,
+      ProjectsGetXpnResources,
+      XpnResourceId,
+      GetXpnResourcesProjectsPage> {
+
+    private GetXpnResourcesProjectsPage(
+        PageContext context,
+        ProjectsGetXpnResources response) {
+      super(context, response);
+    }
+
+    private static GetXpnResourcesProjectsPage createEmptyPage() {
+      return new GetXpnResourcesProjectsPage(null, null);
+    }
+
+    @Override
+    protected GetXpnResourcesProjectsPage createPage(
+        PageContext context,
+        ProjectsGetXpnResources response) {
+      return new GetXpnResourcesProjectsPage(context, response);
+    }
+
+    @Override
+    public ApiFuture createPageAsync(
+        PageContext context,
+        ApiFuture futureResponse) {
+      return super.createPageAsync(context, futureResponse);
+    }
+
+
+
+
+  }
+
+  public static class GetXpnResourcesProjectsFixedSizeCollection extends AbstractFixedSizeCollection<
+      GetXpnResourcesProjectsHttpRequest,
+      ProjectsGetXpnResources,
+      XpnResourceId,
+      GetXpnResourcesProjectsPage,
+      GetXpnResourcesProjectsFixedSizeCollection> {
+
+    private GetXpnResourcesProjectsFixedSizeCollection(List pages, int collectionSize) {
+      super(pages, collectionSize);
+    }
+
+    private static GetXpnResourcesProjectsFixedSizeCollection createEmptyCollection() {
+      return new GetXpnResourcesProjectsFixedSizeCollection(null, 0);
+    }
+
+    @Override
+    protected GetXpnResourcesProjectsFixedSizeCollection createCollection(
+        List pages, int collectionSize) {
+      return new GetXpnResourcesProjectsFixedSizeCollection(pages, collectionSize);
+    }
+
+
+  }
+  public static class ListXpnHostsProjectsPagedResponse extends AbstractPagedListResponse<
+      ListXpnHostsProjectsHttpRequest,
+      XpnHostList,
+      Project,
+      ListXpnHostsProjectsPage,
+      ListXpnHostsProjectsFixedSizeCollection> {
+
+    public static ApiFuture createAsync(
+        PageContext context,
+        ApiFuture futureResponse) {
+      ApiFuture futurePage =
+          ListXpnHostsProjectsPage.createEmptyPage().createPageAsync(context, futureResponse);
+      return ApiFutures.transform(
+          futurePage,
+          new ApiFunction() {
+            @Override
+            public ListXpnHostsProjectsPagedResponse apply(ListXpnHostsProjectsPage input) {
+              return new ListXpnHostsProjectsPagedResponse(input);
+            }
+          });
+    }
+
+    private ListXpnHostsProjectsPagedResponse(ListXpnHostsProjectsPage page) {
+      super(page, ListXpnHostsProjectsFixedSizeCollection.createEmptyCollection());
+    }
+
+
+  }
+
+  public static class ListXpnHostsProjectsPage extends AbstractPage<
+      ListXpnHostsProjectsHttpRequest,
+      XpnHostList,
+      Project,
+      ListXpnHostsProjectsPage> {
+
+    private ListXpnHostsProjectsPage(
+        PageContext context,
+        XpnHostList response) {
+      super(context, response);
+    }
+
+    private static ListXpnHostsProjectsPage createEmptyPage() {
+      return new ListXpnHostsProjectsPage(null, null);
+    }
+
+    @Override
+    protected ListXpnHostsProjectsPage createPage(
+        PageContext context,
+        XpnHostList response) {
+      return new ListXpnHostsProjectsPage(context, response);
+    }
+
+    @Override
+    public ApiFuture createPageAsync(
+        PageContext context,
+        ApiFuture futureResponse) {
+      return super.createPageAsync(context, futureResponse);
+    }
+
+
+
+
+  }
+
+  public static class ListXpnHostsProjectsFixedSizeCollection extends AbstractFixedSizeCollection<
+      ListXpnHostsProjectsHttpRequest,
+      XpnHostList,
+      Project,
+      ListXpnHostsProjectsPage,
+      ListXpnHostsProjectsFixedSizeCollection> {
+
+    private ListXpnHostsProjectsFixedSizeCollection(List pages, int collectionSize) {
+      super(pages, collectionSize);
+    }
 
+    private static ListXpnHostsProjectsFixedSizeCollection createEmptyCollection() {
+      return new ListXpnHostsProjectsFixedSizeCollection(null, 0);
+    }
+
+    @Override
+    protected ListXpnHostsProjectsFixedSizeCollection createCollection(
+        List pages, int collectionSize) {
+      return new ListXpnHostsProjectsFixedSizeCollection(pages, collectionSize);
+    }
+
+
+  }
 }
\ No newline at end of file
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java
index 1b0fc06ea4f7..ffd5d3aeef5d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectForwardingRuleName implements ResourceName {
+public final class ProjectForwardingRuleName implements com.google.api.resourcenames.ResourceName {
   private final String forwardingRule;
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java
new file mode 100644
index 000000000000..e97db6a82f8b
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectImageName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String resource;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/images/{resource}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectImageName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    resource = Preconditions.checkNotNull(builder.getResource());
+  }
+
+  public static ProjectImageName of(
+      String project,
+      String resource
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setResource(resource)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String resource
+      ) {
+    return of(
+        project,
+        resource
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("resource", resource);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectImageName parse(String formattedString) {return ProjectImageName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectImageName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectImageName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("resource")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String resource;
+
+    public String getProject() {
+      return project;
+    }
+    public String getResource() {
+      return resource;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectImageName projectImageName) {
+      project = projectImageName.project;
+      resource = projectImageName.resource;
+    }
+
+    public ProjectImageName build() {
+      return new ProjectImageName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "resource", resource
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectImageName) {
+      ProjectImageName that = (ProjectImageName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.resource, that.getResource())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      resource
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java
index 59ca4ad0fa80..d331ea1cc15e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectName implements ResourceName {
+public final class ProjectName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private static final PathTemplate PATH_TEMPLATE =
         PathTemplate.createWithoutUrlEncoding("projects/{project}");
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java
index 845615eeb423..161df420d42e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectRegionAutoscalerName implements ResourceName {
+public final class ProjectRegionAutoscalerName implements com.google.api.resourcenames.ResourceName {
   private final String autoscaler;
   private final String project;
   private final String region;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java
index ce4965f363ae..6a88ed3455a6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectRegionBackendServiceName implements ResourceName {
+public final class ProjectRegionBackendServiceName implements com.google.api.resourcenames.ResourceName {
   private final String backendService;
   private final String project;
   private final String region;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java
index 74b325c154c7..1b8bcfa01e0a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectRegionInstanceGroupManagerName implements ResourceName {
+public final class ProjectRegionInstanceGroupManagerName implements com.google.api.resourcenames.ResourceName {
   private final String instanceGroupManager;
   private final String project;
   private final String region;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java
index 4b49f748d2ec..d13ad63d5846 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectRegionInstanceGroupName implements ResourceName {
+public final class ProjectRegionInstanceGroupName implements com.google.api.resourcenames.ResourceName {
   private final String instanceGroup;
   private final String project;
   private final String region;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java
index 2fbbc3ecb206..f0481c8fa5b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectRegionOperationName implements ResourceName {
+public final class ProjectRegionOperationName implements com.google.api.resourcenames.ResourceName {
   private final String operation;
   private final String project;
   private final String region;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java
index 24336ec59128..587da3ddd3f5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java
@@ -16,6 +16,7 @@
 package com.google.cloud.compute.v1;
 
 import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.CredentialsProvider;
 import com.google.api.gax.core.ExecutorProvider;
@@ -26,15 +27,23 @@
 import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
 import com.google.api.gax.rpc.HeaderProvider;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
 import com.google.api.gax.rpc.StatusCode;
 import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
 import com.google.auth.Credentials;
+import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse;
+import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse;
 import com.google.cloud.compute.v1.stub.ProjectStubSettings;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
@@ -62,13 +71,13 @@
  *
  * 

The builder of this class is recursive, so contained classes are themselves builders. * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getProject to 30 seconds: + * object. For example, to set the total timeout of disableXpnHostProject to 30 seconds: * *

  * 
  * ProjectSettings.Builder projectSettingsBuilder =
  *     ProjectSettings.newBuilder();
- * projectSettingsBuilder.getProjectSettings().getRetrySettings().toBuilder()
+ * projectSettingsBuilder.disableXpnHostProjectSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * ProjectSettings projectSettings = projectSettingsBuilder.build();
  * 
@@ -77,6 +86,34 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ProjectSettings extends ClientSettings {
+  /**
+   * Returns the object with the settings used for calls to disableXpnHostProject.
+   */
+  public UnaryCallSettings disableXpnHostProjectSettings() {
+    return ((ProjectStubSettings) getStubSettings()).disableXpnHostProjectSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to disableXpnResourceProject.
+   */
+  public UnaryCallSettings disableXpnResourceProjectSettings() {
+    return ((ProjectStubSettings) getStubSettings()).disableXpnResourceProjectSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to enableXpnHostProject.
+   */
+  public UnaryCallSettings enableXpnHostProjectSettings() {
+    return ((ProjectStubSettings) getStubSettings()).enableXpnHostProjectSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to enableXpnResourceProject.
+   */
+  public UnaryCallSettings enableXpnResourceProjectSettings() {
+    return ((ProjectStubSettings) getStubSettings()).enableXpnResourceProjectSettings();
+  }
+
   /**
    * Returns the object with the settings used for calls to getProject.
    */
@@ -84,6 +121,27 @@ public UnaryCallSettings getProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).getProjectSettings();
   }
 
+  /**
+   * Returns the object with the settings used for calls to getXpnHostProject.
+   */
+  public UnaryCallSettings getXpnHostProjectSettings() {
+    return ((ProjectStubSettings) getStubSettings()).getXpnHostProjectSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to getXpnResourcesProjects.
+   */
+  public PagedCallSettings getXpnResourcesProjectsSettings() {
+    return ((ProjectStubSettings) getStubSettings()).getXpnResourcesProjectsSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to listXpnHostsProjects.
+   */
+  public PagedCallSettings listXpnHostsProjectsSettings() {
+    return ((ProjectStubSettings) getStubSettings()).listXpnHostsProjectsSettings();
+  }
+
   /**
    * Returns the object with the settings used for calls to moveDiskProject.
    */
@@ -231,6 +289,34 @@ public Builder applyToAllUnaryMethods(ApiFunction disableXpnHostProjectSettings() {
+      return getStubSettingsBuilder().disableXpnHostProjectSettings();
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to disableXpnResourceProject.
+     */
+    public UnaryCallSettings.Builder disableXpnResourceProjectSettings() {
+      return getStubSettingsBuilder().disableXpnResourceProjectSettings();
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to enableXpnHostProject.
+     */
+    public UnaryCallSettings.Builder enableXpnHostProjectSettings() {
+      return getStubSettingsBuilder().enableXpnHostProjectSettings();
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to enableXpnResourceProject.
+     */
+    public UnaryCallSettings.Builder enableXpnResourceProjectSettings() {
+      return getStubSettingsBuilder().enableXpnResourceProjectSettings();
+    }
+
     /**
      * Returns the builder for the settings used for calls to getProject.
      */
@@ -238,6 +324,27 @@ public UnaryCallSettings.Builder getProjectSetti
       return getStubSettingsBuilder().getProjectSettings();
     }
 
+    /**
+     * Returns the builder for the settings used for calls to getXpnHostProject.
+     */
+    public UnaryCallSettings.Builder getXpnHostProjectSettings() {
+      return getStubSettingsBuilder().getXpnHostProjectSettings();
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to getXpnResourcesProjects.
+     */
+    public PagedCallSettings.Builder getXpnResourcesProjectsSettings() {
+      return getStubSettingsBuilder().getXpnResourcesProjectsSettings();
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to listXpnHostsProjects.
+     */
+    public PagedCallSettings.Builder listXpnHostsProjectsSettings() {
+      return getStubSettingsBuilder().listXpnHostsProjectsSettings();
+    }
+
     /**
      * Returns the builder for the settings used for calls to moveDiskProject.
      */
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java
new file mode 100644
index 000000000000..05ef8a5d2404
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectSnapshotName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String resource;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{resource}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectSnapshotName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    resource = Preconditions.checkNotNull(builder.getResource());
+  }
+
+  public static ProjectSnapshotName of(
+      String project,
+      String resource
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setResource(resource)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String resource
+      ) {
+    return of(
+        project,
+        resource
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("resource", resource);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectSnapshotName parse(String formattedString) {return ProjectSnapshotName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectSnapshotName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectSnapshotName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("resource")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String resource;
+
+    public String getProject() {
+      return project;
+    }
+    public String getResource() {
+      return resource;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectSnapshotName projectSnapshotName) {
+      project = projectSnapshotName.project;
+      resource = projectSnapshotName.resource;
+    }
+
+    public ProjectSnapshotName build() {
+      return new ProjectSnapshotName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "resource", resource
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectSnapshotName) {
+      ProjectSnapshotName that = (ProjectSnapshotName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.resource, that.getResource())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      resource
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java
new file mode 100644
index 000000000000..a50f2a54840d
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneInstanceName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String resource;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{resource}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneInstanceName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    resource = Preconditions.checkNotNull(builder.getResource());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneInstanceName of(
+      String project,
+      String resource,
+      String zone
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setResource(resource)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String resource,
+      String zone
+      ) {
+    return of(
+        project,
+        resource,
+        zone
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("resource", resource);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneInstanceName parse(String formattedString) {return ProjectZoneInstanceName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneInstanceName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("resource"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String resource;
+    private String zone;
+
+    public String getProject() {
+      return project;
+    }
+    public String getResource() {
+      return resource;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneInstanceName projectZoneInstanceName) {
+      project = projectZoneInstanceName.project;
+      resource = projectZoneInstanceName.resource;
+      zone = projectZoneInstanceName.zone;
+    }
+
+    public ProjectZoneInstanceName build() {
+      return new ProjectZoneInstanceName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "resource", resource,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneInstanceName) {
+      ProjectZoneInstanceName that = (ProjectZoneInstanceName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.resource, that.getResource()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      resource,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java
index 0e1b6eef740d..b5806a9f39f3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ProjectZoneOperationName implements ResourceName {
+public final class ProjectZoneOperationName implements com.google.api.resourcenames.ResourceName {
   private final String operation;
   private final String project;
   private final String zone;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java
new file mode 100644
index 000000000000..462b436ba3ac
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectsDisableXpnResourceRequest implements ApiMessage {
+  private final XpnResourceId xpnResource;
+
+  private ProjectsDisableXpnResourceRequest() {
+    this.xpnResource = null;
+  }
+
+
+  private ProjectsDisableXpnResourceRequest(
+      XpnResourceId xpnResource
+      ) {
+    this.xpnResource = xpnResource;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("xpnResource") && xpnResource != null) {
+      fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("xpnResource")) {
+      return String.valueOf(xpnResource);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public XpnResourceId getXpnResource() {
+    return xpnResource;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(ProjectsDisableXpnResourceRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static ProjectsDisableXpnResourceRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final ProjectsDisableXpnResourceRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new ProjectsDisableXpnResourceRequest();
+  }
+
+  public static class Builder {
+    private XpnResourceId xpnResource;
+
+    Builder() {}
+
+    public Builder mergeFrom(ProjectsDisableXpnResourceRequest other) {
+      if (other == ProjectsDisableXpnResourceRequest.getDefaultInstance()) return this;
+      if (other.getXpnResource() != null) {
+        this.xpnResource = other.xpnResource;
+      }
+      return this;
+    }
+
+    Builder(ProjectsDisableXpnResourceRequest source) {
+      this.xpnResource = source.xpnResource;
+    }
+
+    public XpnResourceId getXpnResource() {
+      return xpnResource;
+    }
+
+    public Builder setXpnResource(XpnResourceId xpnResource) {
+      this.xpnResource = xpnResource;
+      return this;
+    }
+
+
+    public ProjectsDisableXpnResourceRequest build() {
+      return new ProjectsDisableXpnResourceRequest(
+        xpnResource
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setXpnResource(this.xpnResource);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "ProjectsDisableXpnResourceRequest{"
+        + "xpnResource=" + xpnResource
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectsDisableXpnResourceRequest) {
+      ProjectsDisableXpnResourceRequest that = (ProjectsDisableXpnResourceRequest) o;
+      return
+          Objects.equals(this.xpnResource, that.getXpnResource())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      xpnResource
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java
new file mode 100644
index 000000000000..e3ef7fb9e333
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectsEnableXpnResourceRequest implements ApiMessage {
+  private final XpnResourceId xpnResource;
+
+  private ProjectsEnableXpnResourceRequest() {
+    this.xpnResource = null;
+  }
+
+
+  private ProjectsEnableXpnResourceRequest(
+      XpnResourceId xpnResource
+      ) {
+    this.xpnResource = xpnResource;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("xpnResource") && xpnResource != null) {
+      fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("xpnResource")) {
+      return String.valueOf(xpnResource);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public XpnResourceId getXpnResource() {
+    return xpnResource;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(ProjectsEnableXpnResourceRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static ProjectsEnableXpnResourceRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final ProjectsEnableXpnResourceRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new ProjectsEnableXpnResourceRequest();
+  }
+
+  public static class Builder {
+    private XpnResourceId xpnResource;
+
+    Builder() {}
+
+    public Builder mergeFrom(ProjectsEnableXpnResourceRequest other) {
+      if (other == ProjectsEnableXpnResourceRequest.getDefaultInstance()) return this;
+      if (other.getXpnResource() != null) {
+        this.xpnResource = other.xpnResource;
+      }
+      return this;
+    }
+
+    Builder(ProjectsEnableXpnResourceRequest source) {
+      this.xpnResource = source.xpnResource;
+    }
+
+    public XpnResourceId getXpnResource() {
+      return xpnResource;
+    }
+
+    public Builder setXpnResource(XpnResourceId xpnResource) {
+      this.xpnResource = xpnResource;
+      return this;
+    }
+
+
+    public ProjectsEnableXpnResourceRequest build() {
+      return new ProjectsEnableXpnResourceRequest(
+        xpnResource
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setXpnResource(this.xpnResource);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "ProjectsEnableXpnResourceRequest{"
+        + "xpnResource=" + xpnResource
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectsEnableXpnResourceRequest) {
+      ProjectsEnableXpnResourceRequest that = (ProjectsEnableXpnResourceRequest) o;
+      return
+          Objects.equals(this.xpnResource, that.getXpnResource())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      xpnResource
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java
new file mode 100644
index 000000000000..86042210efea
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java
@@ -0,0 +1,242 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectsGetXpnResources implements ApiMessage {
+  private final String kind;
+  private final String nextPageToken;
+  private final List resources;
+
+  private ProjectsGetXpnResources() {
+    this.kind = null;
+    this.nextPageToken = null;
+    this.resources = null;
+  }
+
+
+  private ProjectsGetXpnResources(
+      String kind,
+      String nextPageToken,
+      List resources
+      ) {
+    this.kind = kind;
+    this.nextPageToken = nextPageToken;
+    this.resources = resources;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
+      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
+    }
+    if (fieldNames.contains("resources") && resources != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (XpnResourceId item : resources) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("resources", stringList.build());
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("nextPageToken")) {
+      return String.valueOf(nextPageToken);
+    }
+    if (fieldName.equals("resources")) {
+      return String.valueOf(resources);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getNextPageToken() {
+    return nextPageToken;
+  }
+
+  public List getResourcesList() {
+    return resources;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(ProjectsGetXpnResources prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static ProjectsGetXpnResources getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final ProjectsGetXpnResources DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new ProjectsGetXpnResources();
+  }
+
+  public static class Builder {
+    private String kind;
+    private String nextPageToken;
+    private List resources;
+
+    Builder() {}
+
+    public Builder mergeFrom(ProjectsGetXpnResources other) {
+      if (other == ProjectsGetXpnResources.getDefaultInstance()) return this;
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getNextPageToken() != null) {
+        this.nextPageToken = other.nextPageToken;
+      }
+      if (other.getResourcesList() != null) {
+        this.resources = other.resources;
+      }
+      return this;
+    }
+
+    Builder(ProjectsGetXpnResources source) {
+      this.kind = source.kind;
+      this.nextPageToken = source.nextPageToken;
+      this.resources = source.resources;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getNextPageToken() {
+      return nextPageToken;
+    }
+
+    public Builder setNextPageToken(String nextPageToken) {
+      this.nextPageToken = nextPageToken;
+      return this;
+    }
+
+    public List getResourcesList() {
+      return resources;
+    }
+
+    public Builder addAllResources(List resources) {
+      if (this.resources == null) {
+        this.resources = new ArrayList<>(resources.size());
+      }
+      this.resources.addAll(resources);
+      return this;
+    }
+
+    public Builder addResources(XpnResourceId resources) {
+      this.resources.add(resources);
+      return this;
+    }
+
+
+    public ProjectsGetXpnResources build() {
+
+
+      return new ProjectsGetXpnResources(
+        kind,
+        nextPageToken,
+        resources
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setKind(this.kind);
+      newBuilder.setNextPageToken(this.nextPageToken);
+      newBuilder.addAllResources(this.resources);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "ProjectsGetXpnResources{"
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "resources=" + resources
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectsGetXpnResources) {
+      ProjectsGetXpnResources that = (ProjectsGetXpnResources) o;
+      return
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.resources, that.getResourcesList())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      kind,
+      nextPageToken,
+      resources
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java
new file mode 100644
index 000000000000..92110fd0fe48
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectsListXpnHostsRequest implements ApiMessage {
+  private final String organization;
+
+  private ProjectsListXpnHostsRequest() {
+    this.organization = null;
+  }
+
+
+  private ProjectsListXpnHostsRequest(
+      String organization
+      ) {
+    this.organization = organization;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("organization") && organization != null) {
+      fieldMap.put("organization", Collections.singletonList(String.valueOf(organization)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("organization")) {
+      return String.valueOf(organization);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getOrganization() {
+    return organization;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(ProjectsListXpnHostsRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static ProjectsListXpnHostsRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final ProjectsListXpnHostsRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new ProjectsListXpnHostsRequest();
+  }
+
+  public static class Builder {
+    private String organization;
+
+    Builder() {}
+
+    public Builder mergeFrom(ProjectsListXpnHostsRequest other) {
+      if (other == ProjectsListXpnHostsRequest.getDefaultInstance()) return this;
+      if (other.getOrganization() != null) {
+        this.organization = other.organization;
+      }
+      return this;
+    }
+
+    Builder(ProjectsListXpnHostsRequest source) {
+      this.organization = source.organization;
+    }
+
+    public String getOrganization() {
+      return organization;
+    }
+
+    public Builder setOrganization(String organization) {
+      this.organization = organization;
+      return this;
+    }
+
+
+    public ProjectsListXpnHostsRequest build() {
+      return new ProjectsListXpnHostsRequest(
+        organization
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setOrganization(this.organization);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "ProjectsListXpnHostsRequest{"
+        + "organization=" + organization
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectsListXpnHostsRequest) {
+      ProjectsListXpnHostsRequest that = (ProjectsListXpnHostsRequest) o;
+      return
+          Objects.equals(this.organization, that.getOrganization())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      organization
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java
index bec535da0955..00eff7049361 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -39,7 +42,12 @@ private Quota() {
     this.usage = null;
   }
 
-  private Quota(Double limit, String metric, Double usage) {
+
+  private Quota(
+      Double limit,
+      String metric,
+      Double usage
+      ) {
     this.limit = limit;
     this.metric = metric;
     this.usage = usage;
@@ -92,24 +100,22 @@ public Double getUsage() {
     return usage;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(Quota prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static Quota getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final Quota DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new Quota();
   }
@@ -168,9 +174,15 @@ public Builder setUsage(Double usage) {
       return this;
     }
 
+
     public Quota build() {
 
-      return new Quota(limit, metric, usage);
+
+      return new Quota(
+        limit,
+        metric,
+        usage
+      );
     }
 
     public Builder clone() {
@@ -184,7 +196,11 @@ public Builder clone() {
 
   @Override
   public String toString() {
-    return "Quota{" + "limit=" + limit + ", " + "metric=" + metric + ", " + "usage=" + usage + "}";
+    return "Quota{"
+        + "limit=" + limit + ", "
+        + "metric=" + metric + ", "
+        + "usage=" + usage
+        + "}";
   }
 
   @Override
@@ -194,15 +210,21 @@ public boolean equals(Object o) {
     }
     if (o instanceof Quota) {
       Quota that = (Quota) o;
-      return Objects.equals(this.limit, that.getLimit())
-          && Objects.equals(this.metric, that.getMetric())
-          && Objects.equals(this.usage, that.getUsage());
+      return
+          Objects.equals(this.limit, that.getLimit()) &&
+          Objects.equals(this.metric, that.getMetric()) &&
+          Objects.equals(this.usage, that.getUsage())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(limit, metric, usage);
+    return Objects.hash(
+      limit,
+      metric,
+      usage
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java
index 01a07451f1ec..6de0f978c844 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -33,11 +36,11 @@ public final class RecreateInstancesInstanceGroupManagerHttpRequest implements A
   private final String callback;
   private final String fields;
   private final String instanceGroupManager;
-  private final InstanceGroupManagersRecreateInstancesRequest
-      instanceGroupManagersRecreateInstancesRequestResource;
+  private final InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource;
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private RecreateInstancesInstanceGroupManagerHttpRequest() {
@@ -49,29 +52,32 @@ private RecreateInstancesInstanceGroupManagerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
+
   private RecreateInstancesInstanceGroupManagerHttpRequest(
       String access_token,
       String callback,
       String fields,
       String instanceGroupManager,
-      InstanceGroupManagersRecreateInstancesRequest
-          instanceGroupManagersRecreateInstancesRequestResource,
+      InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource,
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String requestId,
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
     this.instanceGroupManager = instanceGroupManager;
-    this.instanceGroupManagersRecreateInstancesRequestResource =
-        instanceGroupManagersRecreateInstancesRequestResource;
+    this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource;
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -88,15 +94,10 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
     }
     if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
+      fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
     }
-    if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource")
-        && instanceGroupManagersRecreateInstancesRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupManagersRecreateInstancesRequestResource",
-          Collections.singletonList(
-              String.valueOf(instanceGroupManagersRecreateInstancesRequestResource)));
+    if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") && instanceGroupManagersRecreateInstancesRequestResource != null) {
+      fieldMap.put("instanceGroupManagersRecreateInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersRecreateInstancesRequestResource)));
     }
     if (fieldNames.contains("key") && key != null) {
       fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
@@ -107,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -139,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -167,8 +174,7 @@ public String getInstanceGroupManager() {
     return instanceGroupManager;
   }
 
-  public InstanceGroupManagersRecreateInstancesRequest
-      getInstanceGroupManagersRecreateInstancesRequestResource() {
+  public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() {
     return instanceGroupManagersRecreateInstancesRequestResource;
   }
 
@@ -184,28 +190,30 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(RecreateInstancesInstanceGroupManagerHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static RecreateInstancesInstanceGroupManagerHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final RecreateInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new RecreateInstancesInstanceGroupManagerHttpRequest();
   }
@@ -215,18 +223,17 @@ public static class Builder {
     private String callback;
     private String fields;
     private String instanceGroupManager;
-    private InstanceGroupManagersRecreateInstancesRequest
-        instanceGroupManagersRecreateInstancesRequestResource;
+    private InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource;
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
 
     public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) {
-      if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance())
-        return this;
+      if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this;
       if (other.getAccessToken() != null) {
         this.access_token = other.access_token;
       }
@@ -240,8 +247,7 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other)
         this.instanceGroupManager = other.instanceGroupManager;
       }
       if (other.getInstanceGroupManagersRecreateInstancesRequestResource() != null) {
-        this.instanceGroupManagersRecreateInstancesRequestResource =
-            other.instanceGroupManagersRecreateInstancesRequestResource;
+        this.instanceGroupManagersRecreateInstancesRequestResource = other.instanceGroupManagersRecreateInstancesRequestResource;
       }
       if (other.getKey() != null) {
         this.key = other.key;
@@ -252,6 +258,9 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other)
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -263,11 +272,11 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other)
       this.callback = source.callback;
       this.fields = source.fields;
       this.instanceGroupManager = source.instanceGroupManager;
-      this.instanceGroupManagersRecreateInstancesRequestResource =
-          source.instanceGroupManagersRecreateInstancesRequestResource;
+      this.instanceGroupManagersRecreateInstancesRequestResource = source.instanceGroupManagersRecreateInstancesRequestResource;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -307,16 +316,12 @@ public Builder setInstanceGroupManager(String instanceGroupManager) {
       return this;
     }
 
-    public InstanceGroupManagersRecreateInstancesRequest
-        getInstanceGroupManagersRecreateInstancesRequestResource() {
+    public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() {
       return instanceGroupManagersRecreateInstancesRequestResource;
     }
 
-    public Builder setInstanceGroupManagersRecreateInstancesRequestResource(
-        InstanceGroupManagersRecreateInstancesRequest
-            instanceGroupManagersRecreateInstancesRequestResource) {
-      this.instanceGroupManagersRecreateInstancesRequestResource =
-          instanceGroupManagersRecreateInstancesRequestResource;
+    public Builder setInstanceGroupManagersRecreateInstancesRequestResource(InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) {
+      this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource;
       return this;
     }
 
@@ -347,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,26 +370,36 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public RecreateInstancesInstanceGroupManagerHttpRequest build() {
       String missing = "";
 
+
+
       if (instanceGroupManager == null) {
         missing += " instanceGroupManager";
       }
 
+
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new RecreateInstancesInstanceGroupManagerHttpRequest(
-          access_token,
-          callback,
-          fields,
-          instanceGroupManager,
-          instanceGroupManagersRecreateInstancesRequestResource,
-          key,
-          prettyPrint,
-          quotaUser,
-          userIp);
+        access_token,
+        callback,
+        fields,
+        instanceGroupManager,
+        instanceGroupManagersRecreateInstancesRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -384,11 +408,11 @@ public Builder clone() {
       newBuilder.setCallback(this.callback);
       newBuilder.setFields(this.fields);
       newBuilder.setInstanceGroupManager(this.instanceGroupManager);
-      newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource(
-          this.instanceGroupManagersRecreateInstancesRequestResource);
+      newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource(this.instanceGroupManagersRecreateInstancesRequestResource);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -397,32 +421,16 @@ public Builder clone() {
   @Override
   public String toString() {
     return "RecreateInstancesInstanceGroupManagerHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "instanceGroupManager="
-        + instanceGroupManager
-        + ", "
-        + "instanceGroupManagersRecreateInstancesRequestResource="
-        + instanceGroupManagersRecreateInstancesRequestResource
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instanceGroupManager=" + instanceGroupManager + ", "
+        + "instanceGroupManagersRecreateInstancesRequestResource=" + instanceGroupManagersRecreateInstancesRequestResource + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -432,19 +440,19 @@ public boolean equals(Object o) {
       return true;
     }
     if (o instanceof RecreateInstancesInstanceGroupManagerHttpRequest) {
-      RecreateInstancesInstanceGroupManagerHttpRequest that =
-          (RecreateInstancesInstanceGroupManagerHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager())
-          && Objects.equals(
-              this.instanceGroupManagersRecreateInstancesRequestResource,
-              that.getInstanceGroupManagersRecreateInstancesRequestResource())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      RecreateInstancesInstanceGroupManagerHttpRequest that = (RecreateInstancesInstanceGroupManagerHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) &&
+          Objects.equals(this.instanceGroupManagersRecreateInstancesRequestResource, that.getInstanceGroupManagersRecreateInstancesRequestResource()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -452,14 +460,16 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token,
-        callback,
-        fields,
-        instanceGroupManager,
-        instanceGroupManagersRecreateInstancesRequestResource,
-        key,
-        prettyPrint,
-        quotaUser,
-        userIp);
+      access_token,
+      callback,
+      fields,
+      instanceGroupManager,
+      instanceGroupManagersRecreateInstancesRequestResource,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java
index 8de544d182b7..8333d43fab82 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,8 +39,8 @@ public final class RecreateInstancesRegionInstanceGroupManagerHttpRequest implem
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
-  private final RegionInstanceGroupManagersRecreateRequest
-      regionInstanceGroupManagersRecreateRequestResource;
+  private final RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource;
+  private final String requestId;
   private final String userIp;
 
   private RecreateInstancesRegionInstanceGroupManagerHttpRequest() {
@@ -49,9 +52,11 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest() {
     this.prettyPrint = null;
     this.quotaUser = null;
     this.regionInstanceGroupManagersRecreateRequestResource = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
+
   private RecreateInstancesRegionInstanceGroupManagerHttpRequest(
       String access_token,
       String callback,
@@ -61,7 +66,9 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest(
       String prettyPrint,
       String quotaUser,
       RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource,
-      String userIp) {
+      String requestId,
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -69,8 +76,8 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
-    this.regionInstanceGroupManagersRecreateRequestResource =
-        regionInstanceGroupManagersRecreateRequestResource;
+    this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -87,8 +94,7 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
     }
     if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
+      fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
     }
     if (fieldNames.contains("key") && key != null) {
       fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
@@ -99,12 +105,11 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
-    if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource")
-        && regionInstanceGroupManagersRecreateRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupManagersRecreateRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupManagersRecreateRequestResource)));
+    if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") && regionInstanceGroupManagersRecreateRequestResource != null) {
+      fieldMap.put("regionInstanceGroupManagersRecreateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersRecreateRequestResource)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
     }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
@@ -138,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("regionInstanceGroupManagersRecreateRequestResource")) {
       return String.valueOf(regionInstanceGroupManagersRecreateRequestResource);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -178,34 +186,34 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
-  public RegionInstanceGroupManagersRecreateRequest
-      getRegionInstanceGroupManagersRecreateRequestResource() {
+  public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() {
     return regionInstanceGroupManagersRecreateRequestResource;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
-  public static Builder newBuilder(
-      RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) {
+  public static Builder newBuilder(RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static RecreateInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final RecreateInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new RecreateInstancesRegionInstanceGroupManagerHttpRequest();
   }
@@ -218,15 +226,14 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
-    private RegionInstanceGroupManagersRecreateRequest
-        regionInstanceGroupManagersRecreateRequestResource;
+    private RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource;
+    private String requestId;
     private String userIp;
 
     Builder() {}
 
     public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest other) {
-      if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance())
-        return this;
+      if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this;
       if (other.getAccessToken() != null) {
         this.access_token = other.access_token;
       }
@@ -249,8 +256,10 @@ public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest
         this.quotaUser = other.quotaUser;
       }
       if (other.getRegionInstanceGroupManagersRecreateRequestResource() != null) {
-        this.regionInstanceGroupManagersRecreateRequestResource =
-            other.regionInstanceGroupManagersRecreateRequestResource;
+        this.regionInstanceGroupManagersRecreateRequestResource = other.regionInstanceGroupManagersRecreateRequestResource;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
       }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
@@ -266,8 +275,8 @@ public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
-      this.regionInstanceGroupManagersRecreateRequestResource =
-          source.regionInstanceGroupManagersRecreateRequestResource;
+      this.regionInstanceGroupManagersRecreateRequestResource = source.regionInstanceGroupManagersRecreateRequestResource;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -334,16 +343,21 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
-    public RegionInstanceGroupManagersRecreateRequest
-        getRegionInstanceGroupManagersRecreateRequestResource() {
+    public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() {
       return regionInstanceGroupManagersRecreateRequestResource;
     }
 
-    public Builder setRegionInstanceGroupManagersRecreateRequestResource(
-        RegionInstanceGroupManagersRecreateRequest
-            regionInstanceGroupManagersRecreateRequestResource) {
-      this.regionInstanceGroupManagersRecreateRequestResource =
-          regionInstanceGroupManagersRecreateRequestResource;
+    public Builder setRegionInstanceGroupManagersRecreateRequestResource(RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) {
+      this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
       return this;
     }
 
@@ -356,26 +370,36 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public RecreateInstancesRegionInstanceGroupManagerHttpRequest build() {
       String missing = "";
 
+
+
       if (instanceGroupManager == null) {
         missing += " instanceGroupManager";
       }
 
+
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new RecreateInstancesRegionInstanceGroupManagerHttpRequest(
-          access_token,
-          callback,
-          fields,
-          instanceGroupManager,
-          key,
-          prettyPrint,
-          quotaUser,
-          regionInstanceGroupManagersRecreateRequestResource,
-          userIp);
+        access_token,
+        callback,
+        fields,
+        instanceGroupManager,
+        key,
+        prettyPrint,
+        quotaUser,
+        regionInstanceGroupManagersRecreateRequestResource,
+        requestId,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -387,8 +411,8 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
-      newBuilder.setRegionInstanceGroupManagersRecreateRequestResource(
-          this.regionInstanceGroupManagersRecreateRequestResource);
+      newBuilder.setRegionInstanceGroupManagersRecreateRequestResource(this.regionInstanceGroupManagersRecreateRequestResource);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -397,32 +421,16 @@ public Builder clone() {
   @Override
   public String toString() {
     return "RecreateInstancesRegionInstanceGroupManagerHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "instanceGroupManager="
-        + instanceGroupManager
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "regionInstanceGroupManagersRecreateRequestResource="
-        + regionInstanceGroupManagersRecreateRequestResource
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instanceGroupManager=" + instanceGroupManager + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "regionInstanceGroupManagersRecreateRequestResource=" + regionInstanceGroupManagersRecreateRequestResource + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -432,19 +440,19 @@ public boolean equals(Object o) {
       return true;
     }
     if (o instanceof RecreateInstancesRegionInstanceGroupManagerHttpRequest) {
-      RecreateInstancesRegionInstanceGroupManagerHttpRequest that =
-          (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(
-              this.regionInstanceGroupManagersRecreateRequestResource,
-              that.getRegionInstanceGroupManagersRecreateRequestResource())
-          && Objects.equals(this.userIp, that.getUserIp());
+      RecreateInstancesRegionInstanceGroupManagerHttpRequest that = (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.regionInstanceGroupManagersRecreateRequestResource, that.getRegionInstanceGroupManagersRecreateRequestResource()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -452,14 +460,16 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token,
-        callback,
-        fields,
-        instanceGroupManager,
-        key,
-        prettyPrint,
-        quotaUser,
-        regionInstanceGroupManagersRecreateRequestResource,
-        userIp);
+      access_token,
+      callback,
+      fields,
+      instanceGroupManager,
+      key,
+      prettyPrint,
+      quotaUser,
+      regionInstanceGroupManagersRecreateRequestResource,
+      requestId,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java
new file mode 100644
index 000000000000..307bfdb61b1d
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class Reference implements ApiMessage {
+  private final String kind;
+  private final String referenceType;
+  private final String referrer;
+  private final String target;
+
+  private Reference() {
+    this.kind = null;
+    this.referenceType = null;
+    this.referrer = null;
+    this.target = null;
+  }
+
+
+  private Reference(
+      String kind,
+      String referenceType,
+      String referrer,
+      String target
+      ) {
+    this.kind = kind;
+    this.referenceType = referenceType;
+    this.referrer = referrer;
+    this.target = target;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("referenceType") && referenceType != null) {
+      fieldMap.put("referenceType", Collections.singletonList(String.valueOf(referenceType)));
+    }
+    if (fieldNames.contains("referrer") && referrer != null) {
+      fieldMap.put("referrer", Collections.singletonList(String.valueOf(referrer)));
+    }
+    if (fieldNames.contains("target") && target != null) {
+      fieldMap.put("target", Collections.singletonList(String.valueOf(target)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("referenceType")) {
+      return String.valueOf(referenceType);
+    }
+    if (fieldName.equals("referrer")) {
+      return String.valueOf(referrer);
+    }
+    if (fieldName.equals("target")) {
+      return String.valueOf(target);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getReferenceType() {
+    return referenceType;
+  }
+
+  public String getReferrer() {
+    return referrer;
+  }
+
+  public String getTarget() {
+    return target;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(Reference prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static Reference getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final Reference DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new Reference();
+  }
+
+  public static class Builder {
+    private String kind;
+    private String referenceType;
+    private String referrer;
+    private String target;
+
+    Builder() {}
+
+    public Builder mergeFrom(Reference other) {
+      if (other == Reference.getDefaultInstance()) return this;
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getReferenceType() != null) {
+        this.referenceType = other.referenceType;
+      }
+      if (other.getReferrer() != null) {
+        this.referrer = other.referrer;
+      }
+      if (other.getTarget() != null) {
+        this.target = other.target;
+      }
+      return this;
+    }
+
+    Builder(Reference source) {
+      this.kind = source.kind;
+      this.referenceType = source.referenceType;
+      this.referrer = source.referrer;
+      this.target = source.target;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getReferenceType() {
+      return referenceType;
+    }
+
+    public Builder setReferenceType(String referenceType) {
+      this.referenceType = referenceType;
+      return this;
+    }
+
+    public String getReferrer() {
+      return referrer;
+    }
+
+    public Builder setReferrer(String referrer) {
+      this.referrer = referrer;
+      return this;
+    }
+
+    public String getTarget() {
+      return target;
+    }
+
+    public Builder setTarget(String target) {
+      this.target = target;
+      return this;
+    }
+
+
+    public Reference build() {
+
+
+
+      return new Reference(
+        kind,
+        referenceType,
+        referrer,
+        target
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setKind(this.kind);
+      newBuilder.setReferenceType(this.referenceType);
+      newBuilder.setReferrer(this.referrer);
+      newBuilder.setTarget(this.target);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "Reference{"
+        + "kind=" + kind + ", "
+        + "referenceType=" + referenceType + ", "
+        + "referrer=" + referrer + ", "
+        + "target=" + target
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof Reference) {
+      Reference that = (Reference) o;
+      return
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.referenceType, that.getReferenceType()) &&
+          Objects.equals(this.referrer, that.getReferrer()) &&
+          Objects.equals(this.target, that.getTarget())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      kind,
+      referenceType,
+      referrer,
+      target
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
index 379259074417..92579cef081d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
@@ -23,12 +23,22 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.RegionAutoscalerStub;
 import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -43,39 +53,40 @@
  * 
  * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
  *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
- *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
+ *   String requestId = "";
+ *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * *

This class can be customized by passing in a custom instance of RegionAutoscalerSettings to * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -105,23 +116,27 @@ public class RegionAutoscalerClient implements BackgroundResource {
   private final RegionAutoscalerSettings settings;
   private final RegionAutoscalerStub stub;
 
-  /** Constructs an instance of RegionAutoscalerClient with default settings. */
+
+
+  /**
+   * Constructs an instance of RegionAutoscalerClient with default settings.
+   */
   public static final RegionAutoscalerClient create() throws IOException {
     return create(RegionAutoscalerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given settings. The channels are
-   * created based on the settings passed in, or defaults for any settings that are not set.
+   * Constructs an instance of RegionAutoscalerClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
-  public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings)
-      throws IOException {
+  public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings) throws IOException {
     return new RegionAutoscalerClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This
-   * is for advanced usage - prefer to use RegionAutoscalerSettings}.
+   * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This is for
+   * advanced usage - prefer to use RegionAutoscalerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) {
@@ -129,9 +144,9 @@ public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) {
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given settings. This is protected
-   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
-   * preferred.
+   * Constructs an instance of RegionAutoscalerClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
   protected RegionAutoscalerClient(RegionAutoscalerSettings settings) throws IOException {
     this.settings = settings;
@@ -153,29 +168,36 @@ public RegionAutoscalerStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified autoscaler.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
-   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
+   *   String requestId = "";
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler, requestId);
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autoscaler) { + public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autoscaler, String requestId) { DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) - .build(); + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .setRequestId(requestId) + .build(); return deleteRegionAutoscaler(request); } @@ -183,23 +205,31 @@ public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autosc /** * Deletes the specified autoscaler. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
-   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler.toString());
+   *   String requestId = "";
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler.toString(), requestId);
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionAutoscaler(String autoscaler) { + public final Operation deleteRegionAutoscaler(String autoscaler, String requestId) { DeleteRegionAutoscalerHttpRequest request = - DeleteRegionAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build(); + DeleteRegionAutoscalerHttpRequest.newBuilder() + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .build(); return deleteRegionAutoscaler(request); } @@ -207,13 +237,14 @@ public final Operation deleteRegionAutoscaler(String autoscaler) { /** * Deletes the specified autoscaler. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   String requestId = "";
    *   DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(request);
    * }
@@ -231,13 +262,14 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
   /**
    * Deletes the specified autoscaler.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
+   *   String requestId = "";
    *   DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = regionAutoscalerClient.deleteRegionAutoscalerCallable().futureCall(request);
    *   // Do something
@@ -246,8 +278,7 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - deleteRegionAutoscalerCallable() { + public final UnaryCallable deleteRegionAutoscalerCallable() { return stub.deleteRegionAutoscalerCallable(); } @@ -255,8 +286,7 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest /** * Returns the specified autoscaler. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -272,8 +302,8 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
 
     GetRegionAutoscalerHttpRequest request =
         GetRegionAutoscalerHttpRequest.newBuilder()
-            .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
-            .build();
+        .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+        .build();
     return getRegionAutoscaler(request);
   }
 
@@ -281,8 +311,7 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
   /**
    * Returns the specified autoscaler.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -297,7 +326,9 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
   public final Autoscaler getRegionAutoscaler(String autoscaler) {
 
     GetRegionAutoscalerHttpRequest request =
-        GetRegionAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
+        GetRegionAutoscalerHttpRequest.newBuilder()
+        .setAutoscaler(autoscaler)
+        .build();
     return getRegionAutoscaler(request);
   }
 
@@ -305,8 +336,7 @@ public final Autoscaler getRegionAutoscaler(String autoscaler) {
   /**
    * Returns the specified autoscaler.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -329,8 +359,7 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
   /**
    * Returns the specified autoscaler.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -344,8 +373,7 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable - getRegionAutoscalerCallable() { + public final UnaryCallable getRegionAutoscalerCallable() { return stub.getRegionAutoscalerCallable(); } @@ -353,31 +381,34 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque /** * Creates an autoscaler in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(region, autoscalerResource);
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(requestId, region, autoscalerResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to - * automatically scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling Groups of - * Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionAutoscaler(RegionName region, Autoscaler autoscalerResource) { + public final Operation insertRegionAutoscaler(String requestId, RegionName region, Autoscaler autoscalerResource) { InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return insertRegionAutoscaler(request); } @@ -385,31 +416,34 @@ public final Operation insertRegionAutoscaler(RegionName region, Autoscaler auto /** * Creates an autoscaler in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(region.toString(), autoscalerResource);
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(requestId, region.toString(), autoscalerResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to - * automatically scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling Groups of - * Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionAutoscaler(String region, Autoscaler autoscalerResource) { + public final Operation insertRegionAutoscaler(String requestId, String region, Autoscaler autoscalerResource) { InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return insertRegionAutoscaler(request); } @@ -417,13 +451,14 @@ public final Operation insertRegionAutoscaler(String region, Autoscaler autoscal /** * Creates an autoscaler in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -443,13 +478,14 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
   /**
    * Creates an autoscaler in the specified project using the data included in the request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -460,8 +496,7 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - insertRegionAutoscalerCallable() { + public final UnaryCallable insertRegionAutoscalerCallable() { return stub.insertRegionAutoscalerCallable(); } @@ -469,8 +504,7 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest /** * Retrieves a list of autoscalers contained within the specified region. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -487,8 +521,8 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
   public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName region) {
     ListRegionAutoscalersHttpRequest request =
         ListRegionAutoscalersHttpRequest.newBuilder()
-            .setRegion(region == null ? null : region.toString())
-            .build();
+        .setRegion(region == null ? null : region.toString())
+        .build();
     return listRegionAutoscalers(request);
   }
 
@@ -496,8 +530,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -513,7 +546,9 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName
   @BetaApi
   public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String region) {
     ListRegionAutoscalersHttpRequest request =
-        ListRegionAutoscalersHttpRequest.newBuilder().setRegion(region).build();
+        ListRegionAutoscalersHttpRequest.newBuilder()
+        .setRegion(region)
+        .build();
     return listRegionAutoscalers(request);
   }
 
@@ -521,8 +556,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -539,17 +573,16 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(
-      ListRegionAutoscalersHttpRequest request) {
-    return listRegionAutoscalersPagedCallable().call(request);
+  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegionAutoscalersHttpRequest request) {
+    return listRegionAutoscalersPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -565,8 +598,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(
    * 
*/ @BetaApi - public final UnaryCallable - listRegionAutoscalersPagedCallable() { + public final UnaryCallable listRegionAutoscalersPagedCallable() { return stub.listRegionAutoscalersPagedCallable(); } @@ -574,8 +606,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers( /** * Retrieves a list of autoscalers contained within the specified region. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -598,99 +629,100 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(
    * 
*/ @BetaApi - public final UnaryCallable - listRegionAutoscalersCallable() { + public final UnaryCallable listRegionAutoscalersCallable() { return stub.listRegionAutoscalersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an autoscaler in the specified project using the data included in the request. This - * method supports patch semantics. - * - *

Sample code: + * 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: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, region, autoscalerResource);
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
    * }
    * 
* - * @param autoscaler Name of the autoscaler to update. + * @param autoscaler Name of the autoscaler to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to - * automatically scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling Groups of - * Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionAutoscaler( - String autoscaler, RegionName region, Autoscaler autoscalerResource) { + public final Operation patchRegionAutoscaler(String autoscaler, String requestId, RegionName region, Autoscaler autoscalerResource) { PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return patchRegionAutoscaler(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an autoscaler in the specified project using the data included in the request. This - * method supports patch semantics. - * - *

Sample code: + * 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: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, region.toString(), autoscalerResource);
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, requestId, region.toString(), autoscalerResource);
    * }
    * 
* - * @param autoscaler Name of the autoscaler to update. + * @param autoscaler Name of the autoscaler to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to - * automatically scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling Groups of - * Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionAutoscaler( - String autoscaler, String region, Autoscaler autoscalerResource) { + public final Operation patchRegionAutoscaler(String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return patchRegionAutoscaler(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an autoscaler in the specified project using the data included in the request. This - * method supports patch semantics. - * - *

Sample code: + * 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: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -708,18 +740,18 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates an autoscaler in the specified project using the data included in the request. This
-   * method supports patch semantics.
-   *
-   * 

Sample code: + * 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: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -730,8 +762,7 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable - patchRegionAutoscalerCallable() { + public final UnaryCallable patchRegionAutoscalerCallable() { return stub.patchRegionAutoscalerCallable(); } @@ -739,35 +770,37 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re /** * Updates an autoscaler in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, region, autoscalerResource);
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to - * automatically scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling Groups of - * Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionAutoscaler( - String autoscaler, RegionName region, Autoscaler autoscalerResource) { + public final Operation updateRegionAutoscaler(String autoscaler, String requestId, RegionName region, Autoscaler autoscalerResource) { UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return updateRegionAutoscaler(request); } @@ -775,35 +808,37 @@ public final Operation updateRegionAutoscaler( /** * Updates an autoscaler in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, region.toString(), autoscalerResource);
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, requestId, region.toString(), autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to - * automatically scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling Groups of - * Instances. + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionAutoscaler( - String autoscaler, String region, Autoscaler autoscalerResource) { + public final Operation updateRegionAutoscaler(String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return updateRegionAutoscaler(request); } @@ -811,15 +846,16 @@ public final Operation updateRegionAutoscaler( /** * Updates an autoscaler in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -839,15 +875,16 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -858,8 +895,7 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - updateRegionAutoscalerCallable() { + public final UnaryCallable updateRegionAutoscalerCallable() { return stub.updateRegionAutoscalerCallable(); } @@ -893,13 +929,12 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionAutoscalersPagedResponse - extends AbstractPagedListResponse< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage, - ListRegionAutoscalersFixedSizeCollection> { + public static class ListRegionAutoscalersPagedResponse extends AbstractPagedListResponse< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage, + ListRegionAutoscalersFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -919,14 +954,15 @@ public ListRegionAutoscalersPagedResponse apply(ListRegionAutoscalersPage input) private ListRegionAutoscalersPagedResponse(ListRegionAutoscalersPage page) { super(page, ListRegionAutoscalersFixedSizeCollection.createEmptyCollection()); } + + } - public static class ListRegionAutoscalersPage - extends AbstractPage< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage> { + public static class ListRegionAutoscalersPage extends AbstractPage< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage> { private ListRegionAutoscalersPage( PageContext context, @@ -951,18 +987,20 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class ListRegionAutoscalersFixedSizeCollection - extends AbstractFixedSizeCollection< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage, - ListRegionAutoscalersFixedSizeCollection> { + public static class ListRegionAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionAutoscalersHttpRequest, + RegionAutoscalerList, + Autoscaler, + ListRegionAutoscalersPage, + ListRegionAutoscalersFixedSizeCollection> { - private ListRegionAutoscalersFixedSizeCollection( - List pages, int collectionSize) { + private ListRegionAutoscalersFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -975,5 +1013,7 @@ protected ListRegionAutoscalersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionAutoscalersFixedSizeCollection(pages, collectionSize); } + + } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java index 3158c8d9cc8c..9ce2f75eb73e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java @@ -37,6 +37,7 @@ public final class RegionAutoscalerList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private RegionAutoscalerList() { this.id = null; @@ -44,6 +45,7 @@ private RegionAutoscalerList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private RegionAutoscalerList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(RegionAutoscalerList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(RegionAutoscalerList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public RegionAutoscalerList build() { + return new RegionAutoscalerList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java index d58b009d7032..81e5a2a8aeef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java @@ -52,8 +52,9 @@ *
  * 
  * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+ *   String requestId = "";
  *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
- *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
+ *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService);
  * }
  * 
  * 
@@ -175,19 +176,26 @@ public RegionBackendServiceStub getStub() { * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
-   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionBackendService(ProjectRegionBackendServiceName backendService) { + public final Operation deleteRegionBackendService(String requestId, ProjectRegionBackendServiceName backendService) { DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .build(); return deleteRegionBackendService(request); @@ -200,19 +208,26 @@ public final Operation deleteRegionBackendService(ProjectRegionBackendServiceNam * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
-   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService.toString());
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionBackendService(String backendService) { + public final Operation deleteRegionBackendService(String requestId, String backendService) { DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService) .build(); return deleteRegionBackendService(request); @@ -225,8 +240,10 @@ public final Operation deleteRegionBackendService(String backendService) { * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   Operation response = regionBackendServiceClient.deleteRegionBackendService(request);
@@ -248,8 +265,10 @@ public final Operation deleteRegionBackendService(DeleteRegionBackendServiceHttp
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   ApiFuture<Operation> future = regionBackendServiceClient.deleteRegionBackendServiceCallable().futureCall(request);
@@ -371,7 +390,7 @@ public final UnaryCallable g
    * }
    * 
* - * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param backendService Name of the BackendService resource for which to get health. * @param resourceGroupReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -399,7 +418,7 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(ProjectRegi * } *
* - * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param backendService Name of the BackendService resource for which to get health. * @param resourceGroupReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -470,21 +489,28 @@ public final UnaryCallable * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) { + * String requestId = ""; * RegionName region = RegionName.of("[PROJECT]", "[REGION]"); * BackendService backendServiceResource = BackendService.newBuilder().build(); - * Operation response = regionBackendServiceClient.insertRegionBackendService(region, backendServiceResource); + * Operation response = regionBackendServiceClient.insertRegionBackendService(requestId, region, backendServiceResource); * } *
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionBackendService(RegionName region, BackendService backendServiceResource) { + public final Operation insertRegionBackendService(String requestId, RegionName region, BackendService backendServiceResource) { InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -498,21 +524,28 @@ public final Operation insertRegionBackendService(RegionName region, BackendServ * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.insertRegionBackendService(region.toString(), backendServiceResource);
+   *   Operation response = regionBackendServiceClient.insertRegionBackendService(requestId, region.toString(), backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionBackendService(String region, BackendService backendServiceResource) { + public final Operation insertRegionBackendService(String requestId, String region, BackendService backendServiceResource) { InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region) .setBackendServiceResource(backendServiceResource) .build(); @@ -526,9 +559,11 @@ public final Operation insertRegionBackendService(String region, BackendService * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -551,9 +586,11 @@ public final Operation insertRegionBackendService(InsertRegionBackendServiceHttp
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -703,26 +740,33 @@ public final UnaryCallable
    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.patchRegionBackendService(backendService, backendServiceResource);
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(requestId, backendService, backendServiceResource);
    * }
    * 
* - * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendService Name of the BackendService resource to patch. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionBackendService(ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { + public final Operation patchRegionBackendService(String requestId, ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -731,26 +775,33 @@ public final Operation patchRegionBackendService(ProjectRegionBackendServiceName // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.patchRegionBackendService(backendService.toString(), backendServiceResource);
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param backendService Name of the BackendService resource to patch. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionBackendService(String backendService, BackendService backendServiceResource) { + public final Operation patchRegionBackendService(String requestId, String backendService, BackendService backendServiceResource) { PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -759,14 +810,16 @@ public final Operation patchRegionBackendService(String backendService, BackendS // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics. + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -784,14 +837,16 @@ public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRe
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports patch semantics.
+   * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
    *
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -813,21 +868,28 @@ public final UnaryCallable patc
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.updateRegionBackendService(backendService, backendServiceResource);
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(requestId, backendService, backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionBackendService(ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { + public final Operation updateRegionBackendService(String requestId, ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -841,21 +903,28 @@ public final Operation updateRegionBackendService(ProjectRegionBackendServiceNam * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.updateRegionBackendService(backendService.toString(), backendServiceResource);
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. + * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionBackendService(String backendService, BackendService backendServiceResource) { + public final Operation updateRegionBackendService(String requestId, String backendService, BackendService backendServiceResource) { UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder() + .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -869,9 +938,11 @@ public final Operation updateRegionBackendService(String backendService, Backend * Sample code: *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -894,9 +965,11 @@ public final Operation updateRegionBackendService(UpdateRegionBackendServiceHttp
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
new file mode 100644
index 000000000000..3ef115fd3936
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
@@ -0,0 +1,863 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.cloud.compute.v1.stub.RegionCommitmentStub;
+import com.google.cloud.compute.v1.stub.RegionCommitmentStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Creates and runs virtual machines on Google Cloud Platform.
+ *
+ * 

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+ *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+ *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionCommitmentClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of RegionCommitmentSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * RegionCommitmentSettings regionCommitmentSettings =
+ *     RegionCommitmentSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionCommitmentClient regionCommitmentClient =
+ *     RegionCommitmentClient.create(regionCommitmentSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionCommitmentSettings regionCommitmentSettings =
+ *     RegionCommitmentSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionCommitmentClient regionCommitmentClient =
+ *     RegionCommitmentClient.create(regionCommitmentSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionCommitmentClient implements BackgroundResource { + private final RegionCommitmentSettings settings; + private final RegionCommitmentStub stub; + + + + /** + * Constructs an instance of RegionCommitmentClient with default settings. + */ + public static final RegionCommitmentClient create() throws IOException { + return create(RegionCommitmentSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionCommitmentClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final RegionCommitmentClient create(RegionCommitmentSettings settings) throws IOException { + return new RegionCommitmentClient(settings); + } + + /** + * Constructs an instance of RegionCommitmentClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionCommitmentSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionCommitmentClient create(RegionCommitmentStub stub) { + return new RegionCommitmentClient(stub); + } + + /** + * Constructs an instance of RegionCommitmentClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected RegionCommitmentClient(RegionCommitmentSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionCommitmentStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionCommitmentClient(RegionCommitmentStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionCommitmentSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionCommitmentStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of commitments. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (CommitmentsScopedList element : regionCommitmentClient.aggregatedListRegionCommitments(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(ProjectName project) { + AggregatedListRegionCommitmentsHttpRequest request = + AggregatedListRegionCommitmentsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListRegionCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of commitments. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (CommitmentsScopedList element : regionCommitmentClient.aggregatedListRegionCommitments(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(String project) { + AggregatedListRegionCommitmentsHttpRequest request = + AggregatedListRegionCommitmentsHttpRequest.newBuilder() + .setProject(project) + .build(); + return aggregatedListRegionCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of commitments. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListRegionCommitmentsHttpRequest request = AggregatedListRegionCommitmentsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (CommitmentsScopedList element : regionCommitmentClient.aggregatedListRegionCommitments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(AggregatedListRegionCommitmentsHttpRequest request) { + return aggregatedListRegionCommitmentsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of commitments. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListRegionCommitmentsHttpRequest request = AggregatedListRegionCommitmentsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListRegionCommitmentsPagedResponse> future = regionCommitmentClient.aggregatedListRegionCommitmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (CommitmentsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListRegionCommitmentsPagedCallable() { + return stub.aggregatedListRegionCommitmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of commitments. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListRegionCommitmentsHttpRequest request = AggregatedListRegionCommitmentsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     CommitmentAggregatedList response = regionCommitmentClient.aggregatedListRegionCommitmentsCallable().call(request);
+   *     for (CommitmentsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable aggregatedListRegionCommitmentsCallable() { + return stub.aggregatedListRegionCommitmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified commitment resource. Get a list of available commitments by making a list() request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment);
+   * }
+   * 
+ * + * @param commitment Name of the commitment to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Commitment getRegionCommitment(CommitmentName commitment) { + + GetRegionCommitmentHttpRequest request = + GetRegionCommitmentHttpRequest.newBuilder() + .setCommitment(commitment == null ? null : commitment.toString()) + .build(); + return getRegionCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified commitment resource. Get a list of available commitments by making a list() request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment.toString());
+   * }
+   * 
+ * + * @param commitment Name of the commitment to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Commitment getRegionCommitment(String commitment) { + + GetRegionCommitmentHttpRequest request = + GetRegionCommitmentHttpRequest.newBuilder() + .setCommitment(commitment) + .build(); + return getRegionCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified commitment resource. Get a list of available commitments by making a list() request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   GetRegionCommitmentHttpRequest request = GetRegionCommitmentHttpRequest.newBuilder()
+   *     .setCommitment(commitment.toString())
+   *     .build();
+   *   Commitment response = regionCommitmentClient.getRegionCommitment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest request) { + return getRegionCommitmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified commitment resource. Get a list of available commitments by making a list() request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   GetRegionCommitmentHttpRequest request = GetRegionCommitmentHttpRequest.newBuilder()
+   *     .setCommitment(commitment.toString())
+   *     .build();
+   *   ApiFuture<Commitment> future = regionCommitmentClient.getRegionCommitmentCallable().futureCall(request);
+   *   // Do something
+   *   Commitment response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionCommitmentCallable() { + return stub.getRegionCommitmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a commitment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Commitment commitmentResource = Commitment.newBuilder().build();
+   *   Operation response = regionCommitmentClient.insertRegionCommitment(requestId, region, commitmentResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param region Name of the region for this request. + * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. + * + * Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionCommitment(String requestId, RegionName region, Commitment commitmentResource) { + + InsertRegionCommitmentHttpRequest request = + InsertRegionCommitmentHttpRequest.newBuilder() + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setCommitmentResource(commitmentResource) + .build(); + return insertRegionCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a commitment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Commitment commitmentResource = Commitment.newBuilder().build();
+   *   Operation response = regionCommitmentClient.insertRegionCommitment(requestId, region.toString(), commitmentResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param region Name of the region for this request. + * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. + * + * Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionCommitment(String requestId, String region, Commitment commitmentResource) { + + InsertRegionCommitmentHttpRequest request = + InsertRegionCommitmentHttpRequest.newBuilder() + .setRequestId(requestId) + .setRegion(region) + .setCommitmentResource(commitmentResource) + .build(); + return insertRegionCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a commitment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Commitment commitmentResource = Commitment.newBuilder().build();
+   *   InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setRegion(region.toString())
+   *     .setCommitmentResource(commitmentResource)
+   *     .build();
+   *   Operation response = regionCommitmentClient.insertRegionCommitment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionCommitment(InsertRegionCommitmentHttpRequest request) { + return insertRegionCommitmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a commitment in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   String requestId = "";
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   Commitment commitmentResource = Commitment.newBuilder().build();
+   *   InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setRegion(region.toString())
+   *     .setCommitmentResource(commitmentResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionCommitmentClient.insertRegionCommitmentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRegionCommitmentCallable() { + return stub.insertRegionCommitmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of commitments contained within the specified region. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Commitment element : regionCommitmentClient.listRegionCommitments(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionCommitmentsPagedResponse listRegionCommitments(RegionName region) { + ListRegionCommitmentsHttpRequest request = + ListRegionCommitmentsHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of commitments contained within the specified region. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   for (Commitment element : regionCommitmentClient.listRegionCommitments(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionCommitmentsPagedResponse listRegionCommitments(String region) { + ListRegionCommitmentsHttpRequest request = + ListRegionCommitmentsHttpRequest.newBuilder() + .setRegion(region) + .build(); + return listRegionCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of commitments contained within the specified region. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionCommitmentsHttpRequest request = ListRegionCommitmentsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Commitment element : regionCommitmentClient.listRegionCommitments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionCommitmentsPagedResponse listRegionCommitments(ListRegionCommitmentsHttpRequest request) { + return listRegionCommitmentsPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of commitments contained within the specified region. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionCommitmentsHttpRequest request = ListRegionCommitmentsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionCommitmentsPagedResponse> future = regionCommitmentClient.listRegionCommitmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Commitment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionCommitmentsPagedCallable() { + return stub.listRegionCommitmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of commitments contained within the specified region. + * + * Sample code: + *

+   * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionCommitmentsHttpRequest request = ListRegionCommitmentsHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     CommitmentList response = regionCommitmentClient.listRegionCommitmentsCallable().call(request);
+   *     for (Commitment element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionCommitmentsCallable() { + return stub.listRegionCommitmentsCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListRegionCommitmentsPagedResponse extends AbstractPagedListResponse< + AggregatedListRegionCommitmentsHttpRequest, + CommitmentAggregatedList, + CommitmentsScopedList, + AggregatedListRegionCommitmentsPage, + AggregatedListRegionCommitmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListRegionCommitmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListRegionCommitmentsPagedResponse apply(AggregatedListRegionCommitmentsPage input) { + return new AggregatedListRegionCommitmentsPagedResponse(input); + } + }); + } + + private AggregatedListRegionCommitmentsPagedResponse(AggregatedListRegionCommitmentsPage page) { + super(page, AggregatedListRegionCommitmentsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class AggregatedListRegionCommitmentsPage extends AbstractPage< + AggregatedListRegionCommitmentsHttpRequest, + CommitmentAggregatedList, + CommitmentsScopedList, + AggregatedListRegionCommitmentsPage> { + + private AggregatedListRegionCommitmentsPage( + PageContext context, + CommitmentAggregatedList response) { + super(context, response); + } + + private static AggregatedListRegionCommitmentsPage createEmptyPage() { + return new AggregatedListRegionCommitmentsPage(null, null); + } + + @Override + protected AggregatedListRegionCommitmentsPage createPage( + PageContext context, + CommitmentAggregatedList response) { + return new AggregatedListRegionCommitmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class AggregatedListRegionCommitmentsFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListRegionCommitmentsHttpRequest, + CommitmentAggregatedList, + CommitmentsScopedList, + AggregatedListRegionCommitmentsPage, + AggregatedListRegionCommitmentsFixedSizeCollection> { + + private AggregatedListRegionCommitmentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListRegionCommitmentsFixedSizeCollection createEmptyCollection() { + return new AggregatedListRegionCommitmentsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListRegionCommitmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListRegionCommitmentsFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListRegionCommitmentsPagedResponse extends AbstractPagedListResponse< + ListRegionCommitmentsHttpRequest, + CommitmentList, + Commitment, + ListRegionCommitmentsPage, + ListRegionCommitmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionCommitmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionCommitmentsPagedResponse apply(ListRegionCommitmentsPage input) { + return new ListRegionCommitmentsPagedResponse(input); + } + }); + } + + private ListRegionCommitmentsPagedResponse(ListRegionCommitmentsPage page) { + super(page, ListRegionCommitmentsFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListRegionCommitmentsPage extends AbstractPage< + ListRegionCommitmentsHttpRequest, + CommitmentList, + Commitment, + ListRegionCommitmentsPage> { + + private ListRegionCommitmentsPage( + PageContext context, + CommitmentList response) { + super(context, response); + } + + private static ListRegionCommitmentsPage createEmptyPage() { + return new ListRegionCommitmentsPage(null, null); + } + + @Override + protected ListRegionCommitmentsPage createPage( + PageContext context, + CommitmentList response) { + return new ListRegionCommitmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListRegionCommitmentsFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionCommitmentsHttpRequest, + CommitmentList, + Commitment, + ListRegionCommitmentsPage, + ListRegionCommitmentsFixedSizeCollection> { + + private ListRegionCommitmentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionCommitmentsFixedSizeCollection createEmptyCollection() { + return new ListRegionCommitmentsFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionCommitmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionCommitmentsFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java new file mode 100644 index 000000000000..38afd85d590a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java @@ -0,0 +1,269 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; +import com.google.cloud.compute.v1.stub.RegionCommitmentStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionCommitmentClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getRegionCommitment to 30 seconds: + * + *

+ * 
+ * RegionCommitmentSettings.Builder regionCommitmentSettingsBuilder =
+ *     RegionCommitmentSettings.newBuilder();
+ * regionCommitmentSettingsBuilder.getRegionCommitmentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionCommitmentSettings regionCommitmentSettings = regionCommitmentSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionCommitmentSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to aggregatedListRegionCommitments. + */ + public PagedCallSettings aggregatedListRegionCommitmentsSettings() { + return ((RegionCommitmentStubSettings) getStubSettings()).aggregatedListRegionCommitmentsSettings(); + } + + /** + * Returns the object with the settings used for calls to getRegionCommitment. + */ + public UnaryCallSettings getRegionCommitmentSettings() { + return ((RegionCommitmentStubSettings) getStubSettings()).getRegionCommitmentSettings(); + } + + /** + * Returns the object with the settings used for calls to insertRegionCommitment. + */ + public UnaryCallSettings insertRegionCommitmentSettings() { + return ((RegionCommitmentStubSettings) getStubSettings()).insertRegionCommitmentSettings(); + } + + /** + * Returns the object with the settings used for calls to listRegionCommitments. + */ + public PagedCallSettings listRegionCommitmentsSettings() { + return ((RegionCommitmentStubSettings) getStubSettings()).listRegionCommitmentsSettings(); + } + + + public static final RegionCommitmentSettings create(RegionCommitmentStubSettings stub) throws IOException { + return new RegionCommitmentSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionCommitmentStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return RegionCommitmentStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return RegionCommitmentStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return RegionCommitmentStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionCommitmentStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return RegionCommitmentStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionCommitmentStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionCommitmentStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionCommitmentSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for RegionCommitmentSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionCommitmentStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionCommitmentStubSettings.newBuilder()); + } + + protected Builder(RegionCommitmentSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionCommitmentStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public RegionCommitmentStubSettings.Builder getStubSettingsBuilder() { + return ((RegionCommitmentStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListRegionCommitments. + */ + public PagedCallSettings.Builder aggregatedListRegionCommitmentsSettings() { + return getStubSettingsBuilder().aggregatedListRegionCommitmentsSettings(); + } + + /** + * Returns the builder for the settings used for calls to getRegionCommitment. + */ + public UnaryCallSettings.Builder getRegionCommitmentSettings() { + return getStubSettingsBuilder().getRegionCommitmentSettings(); + } + + /** + * Returns the builder for the settings used for calls to insertRegionCommitment. + */ + public UnaryCallSettings.Builder insertRegionCommitmentSettings() { + return getStubSettingsBuilder().insertRegionCommitmentSettings(); + } + + /** + * Returns the builder for the settings used for calls to listRegionCommitments. + */ + public PagedCallSettings.Builder listRegionCommitmentsSettings() { + return getStubSettingsBuilder().listRegionCommitmentsSettings(); + } + + @Override + public RegionCommitmentSettings build() throws IOException { + return new RegionCommitmentSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java index 65ed48bb0f1c..e1dd2ac50684 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java @@ -548,21 +548,28 @@ public final UnaryCallable * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) { + * String requestId = ""; * ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); * RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); - * Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + * Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); * } *
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param regionInstanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsRegionInstanceGroup(String requestId, ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource) .build(); @@ -576,21 +583,28 @@ public final Operation setNamedPortsRegionInstanceGroup(ProjectRegionInstanceGro * Sample code: *

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup.toString(), regionInstanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(requestId, instanceGroup.toString(), regionInstanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param regionInstanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsRegionInstanceGroup(String instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsRegionInstanceGroup(String requestId, String instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() + .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource) .build(); @@ -604,9 +618,11 @@ public final Operation setNamedPortsRegionInstanceGroup(String instanceGroup, Re * Sample code: *

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
    *     .build();
@@ -629,9 +645,11 @@ public final Operation setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInsta
    * Sample code:
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java
index 66e7f43c6a68..4b0df4b6c523 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java
@@ -37,6 +37,7 @@ public final class RegionInstanceGroupList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private RegionInstanceGroupList() {
     this.id = null;
@@ -44,6 +45,7 @@ private RegionInstanceGroupList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private RegionInstanceGroupList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(RegionInstanceGroupList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(RegionInstanceGroupList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public RegionInstanceGroupList build() {
 
 
 
 
+
       return new RegionInstanceGroupList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
index 50a2ee0af749..aef8056d12ad 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
@@ -23,12 +23,22 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStub;
 import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -42,41 +52,42 @@
  * 
  * 
  * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+ *   String requestId = "";
  *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
  *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up - * resources such as threads. In the example above, try-with-resources is used, which automatically - * calls close(). + *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * - *

This class can be customized by passing in a custom instance of - * RegionInstanceGroupManagerSettings to create(). For example: + *

This class can be customized by passing in a custom instance of RegionInstanceGroupManagerSettings to + * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -106,24 +117,27 @@ public class RegionInstanceGroupManagerClient implements BackgroundResource {
   private final RegionInstanceGroupManagerSettings settings;
   private final RegionInstanceGroupManagerStub stub;
 
-  /** Constructs an instance of RegionInstanceGroupManagerClient with default settings. */
+
+
+  /**
+   * Constructs an instance of RegionInstanceGroupManagerClient with default settings.
+   */
   public static final RegionInstanceGroupManagerClient create() throws IOException {
     return create(RegionInstanceGroupManagerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. The
-   * channels are created based on the settings passed in, or defaults for any settings that are not
-   * set.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
-  public static final RegionInstanceGroupManagerClient create(
-      RegionInstanceGroupManagerSettings settings) throws IOException {
+  public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerSettings settings) throws IOException {
     return new RegionInstanceGroupManagerClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making
-   * calls. This is for advanced usage - prefer to use RegionInstanceGroupManagerSettings}.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making calls. This is for
+   * advanced usage - prefer to use RegionInstanceGroupManagerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerStub stub) {
@@ -131,12 +145,11 @@ public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupM
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. This is
-   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
-   * should be preferred.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
-  protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings)
-      throws IOException {
+  protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings) throws IOException {
     this.settings = settings;
     this.stub = ((RegionInstanceGroupManagerStubSettings) settings.getStubSettings()).createStub();
   }
@@ -156,102 +169,101 @@ public RegionInstanceGroupManagerStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesRegionInstanceGroupManager( - ProjectRegionInstanceGroupManagerName instanceGroupManager, - RegionInstanceGroupManagersAbandonInstancesRequest - regionInstanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersAbandonInstancesRequestResource( - regionInstanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesRegionInstanceGroupManager( - String instanceGroupManager, - RegionInstanceGroupManagersAbandonInstancesRequest - regionInstanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersAbandonInstancesRequestResource( - regionInstanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -263,28 +275,26 @@ public final Operation abandonInstancesRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesRegionInstanceGroupManager(
-      AbandonInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstancesRegionInstanceGroupManagerHttpRequest request) {
     return abandonInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -295,8 +305,7 @@ public final Operation abandonInstancesRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - abandonInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { return stub.abandonInstancesRegionInstanceGroupManagerCallable(); } @@ -304,27 +313,31 @@ public final Operation abandonInstancesRegionInstanceGroupManager( /** * Deletes the specified managed instance group and all of the instances in that group. * - *

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager);
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(requestId, instanceGroupManager);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionInstanceGroupManager( - ProjectRegionInstanceGroupManagerName instanceGroupManager) { + public final Operation deleteRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return deleteRegionInstanceGroupManager(request); } @@ -332,25 +345,31 @@ public final Operation deleteRegionInstanceGroupManager( /** * Deletes the specified managed instance group and all of the instances in that group. * - *

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager.toString());
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(requestId, instanceGroupManager.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionInstanceGroupManager(String instanceGroupManager) { + public final Operation deleteRegionInstanceGroupManager(String requestId, String instanceGroupManager) { DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return deleteRegionInstanceGroupManager(request); } @@ -358,12 +377,13 @@ public final Operation deleteRegionInstanceGroupManager(String instanceGroupMana /** * Deletes the specified managed instance group and all of the instances in that group. * - *

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(request);
@@ -374,8 +394,7 @@ public final Operation deleteRegionInstanceGroupManager(String instanceGroupMana
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteRegionInstanceGroupManager(
-      DeleteRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGroupManagerHttpRequest request) {
     return deleteRegionInstanceGroupManagerCallable().call(request);
   }
 
@@ -383,12 +402,13 @@ public final Operation deleteRegionInstanceGroupManager(
   /**
    * Deletes the specified managed instance group and all of the instances in that group.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManagerCallable().futureCall(request);
@@ -398,104 +418,104 @@ public final Operation deleteRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - deleteRegionInstanceGroupManagerCallable() { + public final UnaryCallable deleteRegionInstanceGroupManagerCallable() { return stub.deleteRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesRegionInstanceGroupManager( - ProjectRegionInstanceGroupManagerName instanceGroupManager, - RegionInstanceGroupManagersDeleteInstancesRequest - regionInstanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersDeleteInstancesRequestResource( - regionInstanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesRegionInstanceGroupManager( - String instanceGroupManager, - RegionInstanceGroupManagersDeleteInstancesRequest - regionInstanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersDeleteInstancesRequestResource( - regionInstanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -507,27 +527,26 @@ public final Operation deleteInstancesRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesRegionInstanceGroupManager(
-      DeleteInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstancesRegionInstanceGroupManagerHttpRequest request) {
     return deleteInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -538,8 +557,7 @@ public final Operation deleteInstancesRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - deleteInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { return stub.deleteInstancesRegionInstanceGroupManagerCallable(); } @@ -547,8 +565,7 @@ public final Operation deleteInstancesRegionInstanceGroupManager( /** * Returns all of the details about the specified managed instance group. * - *

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -560,14 +577,12 @@ public final Operation deleteInstancesRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getRegionInstanceGroupManager(
-      ProjectRegionInstanceGroupManagerName instanceGroupManager) {
+  public final InstanceGroupManager getRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager) {
 
     GetRegionInstanceGroupManagerHttpRequest request =
         GetRegionInstanceGroupManagerHttpRequest.newBuilder()
-            .setInstanceGroupManager(
-                instanceGroupManager == null ? null : instanceGroupManager.toString())
-            .build();
+        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
+        .build();
     return getRegionInstanceGroupManager(request);
   }
 
@@ -575,8 +590,7 @@ public final InstanceGroupManager getRegionInstanceGroupManager(
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -592,8 +606,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
 
     GetRegionInstanceGroupManagerHttpRequest request =
         GetRegionInstanceGroupManagerHttpRequest.newBuilder()
-            .setInstanceGroupManager(instanceGroupManager)
-            .build();
+        .setInstanceGroupManager(instanceGroupManager)
+        .build();
     return getRegionInstanceGroupManager(request);
   }
 
@@ -601,8 +615,7 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -617,8 +630,7 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getRegionInstanceGroupManager(
-      GetRegionInstanceGroupManagerHttpRequest request) {
+  public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanceGroupManagerHttpRequest request) {
     return getRegionInstanceGroupManagerCallable().call(request);
   }
 
@@ -626,8 +638,7 @@ public final InstanceGroupManager getRegionInstanceGroupManager(
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -641,94 +652,98 @@ public final InstanceGroupManager getRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - getRegionInstanceGroupManagerCallable() { + public final UnaryCallable getRegionInstanceGroupManagerCallable() { return stub.getRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After - * the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. * - *

Sample code: + * A regional managed instance group can contain up to 2000 instances. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region, instanceGroupManagerResource);
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param instanceGroupManagerResource An Instance Group Manager resource. + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionInstanceGroupManager( - RegionName region, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertRegionInstanceGroupManager(String requestId, RegionName region, InstanceGroupManager instanceGroupManagerResource) { InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRegion(region == null ? null : region.toString()) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After - * the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. * - *

Sample code: + * A regional managed instance group can contain up to 2000 instances. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region.toString(), instanceGroupManagerResource);
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(requestId, region.toString(), instanceGroupManagerResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param instanceGroupManagerResource An Instance Group Manager resource. + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionInstanceGroupManager( - String region, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertRegionInstanceGroupManager(String requestId, String region, InstanceGroupManager instanceGroupManagerResource) { InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRegion(region) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After - * the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. * - *

Sample code: + * A regional managed instance group can contain up to 2000 instances. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
@@ -740,26 +755,24 @@ public final Operation insertRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertRegionInstanceGroupManager(
-      InsertRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGroupManagerHttpRequest request) {
     return insertRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After
-   * the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
    *
-   * 

Sample code: + * A regional managed instance group can contain up to 2000 instances. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
@@ -770,8 +783,7 @@ public final Operation insertRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - insertRegionInstanceGroupManagerCallable() { + public final UnaryCallable insertRegionInstanceGroupManagerCallable() { return stub.insertRegionInstanceGroupManagerCallable(); } @@ -779,8 +791,7 @@ public final Operation insertRegionInstanceGroupManager( /** * Retrieves the list of managed instance groups that are contained within the specified region. * - *

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -794,12 +805,11 @@ public final Operation insertRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
-      RegionName region) {
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(RegionName region) {
     ListRegionInstanceGroupManagersHttpRequest request =
         ListRegionInstanceGroupManagersHttpRequest.newBuilder()
-            .setRegion(region == null ? null : region.toString())
-            .build();
+        .setRegion(region == null ? null : region.toString())
+        .build();
     return listRegionInstanceGroupManagers(request);
   }
 
@@ -807,8 +817,7 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -822,10 +831,11 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
-      String region) {
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(String region) {
     ListRegionInstanceGroupManagersHttpRequest request =
-        ListRegionInstanceGroupManagersHttpRequest.newBuilder().setRegion(region).build();
+        ListRegionInstanceGroupManagersHttpRequest.newBuilder()
+        .setRegion(region)
+        .build();
     return listRegionInstanceGroupManagers(request);
   }
 
@@ -833,8 +843,7 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -851,17 +860,16 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
-      ListRegionInstanceGroupManagersHttpRequest request) {
-    return listRegionInstanceGroupManagersPagedCallable().call(request);
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(ListRegionInstanceGroupManagersHttpRequest request) {
+    return listRegionInstanceGroupManagersPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -877,9 +885,7 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable< - ListRegionInstanceGroupManagersHttpRequest, ListRegionInstanceGroupManagersPagedResponse> - listRegionInstanceGroupManagersPagedCallable() { + public final UnaryCallable listRegionInstanceGroupManagersPagedCallable() { return stub.listRegionInstanceGroupManagersPagedCallable(); } @@ -887,8 +893,7 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou /** * Retrieves the list of managed instance groups that are contained within the specified region. * - *

Sample code: - * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -911,19 +916,15 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable< - ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList> - listRegionInstanceGroupManagersCallable() { + public final UnaryCallable listRegionInstanceGroupManagersCallable() { return stub.listRegionInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. - * - *

Sample code: + * 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. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -935,25 +936,20 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse
-      listManagedInstancesRegionInstanceGroupManagers(
-          ProjectRegionInstanceGroupManagerName instanceGroupManager) {
+  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ProjectRegionInstanceGroupManagerName instanceGroupManager) {
 
     ListManagedInstancesRegionInstanceGroupManagersHttpRequest request =
         ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
-            .setInstanceGroupManager(
-                instanceGroupManager == null ? null : instanceGroupManager.toString())
-            .build();
+        .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString())
+        .build();
     return listManagedInstancesRegionInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
-   *
-   * 

Sample code: + * 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. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -965,23 +961,20 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse
-      listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) {
+  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) {
 
     ListManagedInstancesRegionInstanceGroupManagersHttpRequest request =
         ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
-            .setInstanceGroupManager(instanceGroupManager)
-            .build();
+        .setInstanceGroupManager(instanceGroupManager)
+        .build();
     return listManagedInstancesRegionInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
-   *
-   * 

Sample code: + * 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. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -996,19 +989,15 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse
-      listManagedInstancesRegionInstanceGroupManagers(
-          ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) {
+  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) {
     return listManagedInstancesRegionInstanceGroupManagersCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
-   *
-   * 

Sample code: + * 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. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1022,103 +1011,104 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable< - ListManagedInstancesRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagersListInstancesResponse> - listManagedInstancesRegionInstanceGroupManagersCallable() { + public final UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { return stub.listManagedInstancesRegionInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The - * instances are deleted and recreated using the current instance template for the managed - * instance group. This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersRecreateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesRegionInstanceGroupManager( - ProjectRegionInstanceGroupManagerName instanceGroupManager, - RegionInstanceGroupManagersRecreateRequest - regionInstanceGroupManagersRecreateRequestResource) { + public final Operation recreateInstancesRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersRecreateRequestResource( - regionInstanceGroupManagersRecreateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource) + .build(); return recreateInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The - * instances are deleted and recreated using the current instance template for the managed - * instance group. This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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. * - *

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersRecreateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersRecreateRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersRecreateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesRegionInstanceGroupManager( - String instanceGroupManager, - RegionInstanceGroupManagersRecreateRequest - regionInstanceGroupManagersRecreateRequestResource) { + public final Operation recreateInstancesRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersRecreateRequestResource( - regionInstanceGroupManagersRecreateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource) + .build(); return recreateInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The - * instances are deleted and recreated using the current instance template for the managed - * instance group. This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
    *   RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
    *     .build();
@@ -1130,26 +1120,26 @@ public final Operation recreateInstancesRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesRegionInstanceGroupManager(
-      RecreateInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInstancesRegionInstanceGroupManagerHttpRequest request) {
     return recreateInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The
-   * instances are deleted and recreated using the current instance template for the managed
-   * instance group. This operation is marked as DONE when the action is scheduled even if the
-   * instances have not yet been recreated. You must separately verify the status of the recreating
-   * action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating 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.
    *
-   * 

Sample code: + * You can specify a maximum of 1000 instances with this method per request. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
    *   RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
    *     .build();
@@ -1160,99 +1150,99 @@ public final Operation recreateInstancesRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - recreateInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { return stub.recreateInstancesRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group - * schedules actions to create new instances using the current instance template. If you decrease - * the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager);
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager);
    * }
    * 
* * @param size Number of instances that should exist in this instance group manager. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeRegionInstanceGroupManager( - Integer size, ProjectRegionInstanceGroupManagerName instanceGroupManager) { + public final Operation resizeRegionInstanceGroupManager(Integer size, String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return resizeRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group - * schedules actions to create new instances using the current instance template. If you decrease - * the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager.toString());
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager.toString());
    * }
    * 
* * @param size Number of instances that should exist in this instance group manager. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeRegionInstanceGroupManager( - Integer size, String instanceGroupManager) { + public final Operation resizeRegionInstanceGroupManager(Integer size, String requestId, String instanceGroupManager) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return resizeRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group - * schedules actions to create new instances using the current instance template. If you decrease - * the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. * - *

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(request);
@@ -1263,28 +1253,25 @@ public final Operation resizeRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation resizeRegionInstanceGroupManager(
-      ResizeRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGroupManagerHttpRequest request) {
     return resizeRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the intended size for the managed instance group. If you increase the size, the group
-   * schedules actions to create new instances using the current instance template. If you decrease
-   * the size, the group schedules delete actions on one or more 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.
+   * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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.
    *
-   * 

Sample code: + * 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: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManagerCallable().futureCall(request);
@@ -1294,92 +1281,92 @@ public final Operation resizeRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - resizeRegionInstanceGroupManagerCallable() { + public final UnaryCallable resizeRegionInstanceGroupManagerCallable() { return stub.resizeRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this - * group. Existing instances are not affected. - * - *

Sample code: + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param regionInstanceGroupManagersSetTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateRegionInstanceGroupManager( - ProjectRegionInstanceGroupManagerName instanceGroupManager, - RegionInstanceGroupManagersSetTemplateRequest - regionInstanceGroupManagersSetTemplateRequestResource) { + public final Operation setInstanceTemplateRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersSetTemplateRequestResource( - regionInstanceGroupManagersSetTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource) + .build(); return setInstanceTemplateRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this - * group. Existing instances are not affected. - * - *

Sample code: + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTemplateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersSetTemplateRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param regionInstanceGroupManagersSetTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateRegionInstanceGroupManager( - String instanceGroupManager, - RegionInstanceGroupManagersSetTemplateRequest - regionInstanceGroupManagersSetTemplateRequestResource) { + public final Operation setInstanceTemplateRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersSetTemplateRequestResource( - regionInstanceGroupManagersSetTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource) + .build(); return setInstanceTemplateRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this - * group. Existing instances are not affected. - * - *

Sample code: + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
    *     .build();
@@ -1391,23 +1378,22 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateRegionInstanceGroupManager(
-      SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) {
     return setInstanceTemplateRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the instance template to use when creating new instances or recreating instances in this
-   * group. Existing instances are not affected.
-   *
-   * 

Sample code: + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
    *     .build();
@@ -1418,92 +1404,92 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - setInstanceTemplateRegionInstanceGroupManagerCallable() { + public final UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { return stub.setInstanceTemplateRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing - * instances in the group are not affected. - * - *

Sample code: + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsRegionInstanceGroupManager( - ProjectRegionInstanceGroupManagerName instanceGroupManager, - RegionInstanceGroupManagersSetTargetPoolsRequest - regionInstanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager( - instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersSetTargetPoolsRequestResource( - regionInstanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing - * instances in the group are not affected. - * - *

Sample code: + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsRegionInstanceGroupManager( - String instanceGroupManager, - RegionInstanceGroupManagersSetTargetPoolsRequest - regionInstanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersSetTargetPoolsRequestResource( - regionInstanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing - * instances in the group are not affected. - * - *

Sample code: + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
@@ -1515,23 +1501,22 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsRegionInstanceGroupManager(
-      SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) {
     return setTargetPoolsRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Modifies the target pools to which all new instances in this group are assigned. Existing
-   * instances in the group are not affected.
-   *
-   * 

Sample code: + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. * + * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
@@ -1542,8 +1527,7 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(
    * 
*/ @BetaApi - public final UnaryCallable - setTargetPoolsRegionInstanceGroupManagerCallable() { + public final UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { return stub.setTargetPoolsRegionInstanceGroupManagerCallable(); } @@ -1577,31 +1561,23 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionInstanceGroupManagersPagedResponse - extends AbstractPagedListResponse< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage, - ListRegionInstanceGroupManagersFixedSizeCollection> { + public static class ListRegionInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = - ListRegionInstanceGroupManagersPage.createEmptyPage() - .createPageAsync(context, futureResponse); + ListRegionInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction< - ListRegionInstanceGroupManagersPage, ListRegionInstanceGroupManagersPagedResponse>() { + new ApiFunction() { @Override - public ListRegionInstanceGroupManagersPagedResponse apply( - ListRegionInstanceGroupManagersPage input) { + public ListRegionInstanceGroupManagersPagedResponse apply(ListRegionInstanceGroupManagersPage input) { return new ListRegionInstanceGroupManagersPagedResponse(input); } }); @@ -1610,21 +1586,18 @@ public ListRegionInstanceGroupManagersPagedResponse apply( private ListRegionInstanceGroupManagersPagedResponse(ListRegionInstanceGroupManagersPage page) { super(page, ListRegionInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } + + } - public static class ListRegionInstanceGroupManagersPage - extends AbstractPage< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage> { + public static class ListRegionInstanceGroupManagersPage extends AbstractPage< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage> { private ListRegionInstanceGroupManagersPage( - PageContext< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, RegionInstanceGroupManagerList response) { super(context, response); } @@ -1635,37 +1608,31 @@ private static ListRegionInstanceGroupManagersPage createEmptyPage() { @Override protected ListRegionInstanceGroupManagersPage createPage( - PageContext< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, RegionInstanceGroupManagerList response) { return new ListRegionInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager> - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class ListRegionInstanceGroupManagersFixedSizeCollection - extends AbstractFixedSizeCollection< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage, - ListRegionInstanceGroupManagersFixedSizeCollection> { + public static class ListRegionInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< + ListRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagerList, + InstanceGroupManager, + ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { - private ListRegionInstanceGroupManagersFixedSizeCollection( - List pages, int collectionSize) { + private ListRegionInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -1678,5 +1645,7 @@ protected ListRegionInstanceGroupManagersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } + + } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java index 6c7117738808..df6c97226e7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java @@ -37,6 +37,7 @@ public final class RegionInstanceGroupManagerList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private RegionInstanceGroupManagerList() { this.id = null; @@ -44,6 +45,7 @@ private RegionInstanceGroupManagerList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private RegionInstanceGroupManagerList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(RegionInstanceGroupManagerList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(RegionInstanceGroupManagerList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public RegionInstanceGroupManagerList build() { + return new RegionInstanceGroupManagerList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java index 4d60555fa830..13fc71db33af 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java @@ -37,6 +37,7 @@ public final class RegionInstanceGroupsListInstances implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private RegionInstanceGroupsListInstances() { this.id = null; @@ -44,6 +45,7 @@ private RegionInstanceGroupsListInstances() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private RegionInstanceGroupsListInstances( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(RegionInstanceGroupsListInstances other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(RegionInstanceGroupsListInstances other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public RegionInstanceGroupsListInstances build() { + return new RegionInstanceGroupsListInstances( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java index d6bfddceb997..b4bc7eec48b8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -37,7 +40,11 @@ private RegionInstanceGroupsListInstancesRequest() { this.portName = null; } - private RegionInstanceGroupsListInstancesRequest(String instanceState, String portName) { + + private RegionInstanceGroupsListInstancesRequest( + String instanceState, + String portName + ) { this.instanceState = instanceState; this.portName = portName; } @@ -79,24 +86,22 @@ public String getPortName() { return portName; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(RegionInstanceGroupsListInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupsListInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final RegionInstanceGroupsListInstancesRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new RegionInstanceGroupsListInstancesRequest(); } @@ -141,9 +146,13 @@ public Builder setPortName(String portName) { return this; } + public RegionInstanceGroupsListInstancesRequest build() { - return new RegionInstanceGroupsListInstancesRequest(instanceState, portName); + return new RegionInstanceGroupsListInstancesRequest( + instanceState, + portName + ); } public Builder clone() { @@ -157,11 +166,8 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupsListInstancesRequest{" - + "instanceState=" - + instanceState - + ", " - + "portName=" - + portName + + "instanceState=" + instanceState + ", " + + "portName=" + portName + "}"; } @@ -172,14 +178,19 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupsListInstancesRequest) { RegionInstanceGroupsListInstancesRequest that = (RegionInstanceGroupsListInstancesRequest) o; - return Objects.equals(this.instanceState, that.getInstanceState()) - && Objects.equals(this.portName, that.getPortName()); + return + Objects.equals(this.instanceState, that.getInstanceState()) && + Objects.equals(this.portName, that.getPortName()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(instanceState, portName); + return Objects.hash( + instanceState, + portName + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java index a1c0e9fe2548..c0aa7ed94001 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java @@ -37,6 +37,7 @@ public final class RegionList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private RegionList() { this.id = null; @@ -44,6 +45,7 @@ private RegionList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private RegionList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(RegionList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(RegionList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public RegionList build() { + return new RegionList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java index a0a3c54e6b22..aef39f3004ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class RegionName implements ResourceName { +public final class RegionName implements com.google.api.resourcenames.ResourceName { private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java index da8f14b8390e..3beed98f0ce3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java @@ -38,6 +38,7 @@ public final class RemoveHealthCheckTargetPoolHttpRequest implements ApiMessage private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String targetPool; private final TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource; private final String userIp; @@ -49,6 +50,7 @@ private RemoveHealthCheckTargetPoolHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.targetPool = null; this.targetPoolsRemoveHealthCheckRequestResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private RemoveHealthCheckTargetPoolHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, String userIp @@ -72,6 +75,7 @@ private RemoveHealthCheckTargetPoolHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetPool = targetPool; this.targetPoolsRemoveHealthCheckRequestResource = targetPoolsRemoveHealthCheckRequestResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetPool")) { return String.valueOf(targetPool); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getTargetPool() { return targetPool; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String targetPool; private TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(RemoveHealthCheckTargetPoolHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetPool() != null) { this.targetPool = other.targetPool; } @@ -256,6 +274,7 @@ public Builder mergeFrom(RemoveHealthCheckTargetPoolHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetPool = source.targetPool; this.targetPoolsRemoveHealthCheckRequestResource = source.targetPoolsRemoveHealthCheckRequestResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getTargetPool() { return targetPool; } @@ -351,6 +379,7 @@ public RemoveHealthCheckTargetPoolHttpRequest build() { + if (targetPool == null) { missing += " targetPool"; } @@ -366,6 +395,7 @@ public RemoveHealthCheckTargetPoolHttpRequest build() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsRemoveHealthCheckRequestResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); newBuilder.setTargetPoolsRemoveHealthCheckRequestResource(this.targetPoolsRemoveHealthCheckRequestResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetPool=" + targetPool + ", " + "targetPoolsRemoveHealthCheckRequestResource=" + targetPoolsRemoveHealthCheckRequestResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetPool, that.getTargetPool()) && Objects.equals(this.targetPoolsRemoveHealthCheckRequestResource, that.getTargetPoolsRemoveHealthCheckRequestResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsRemoveHealthCheckRequestResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java index 904ad0750c74..788455891e07 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java @@ -38,6 +38,7 @@ public final class RemoveInstanceTargetPoolHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String targetPool; private final TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource; private final String userIp; @@ -49,6 +50,7 @@ private RemoveInstanceTargetPoolHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.targetPool = null; this.targetPoolsRemoveInstanceRequestResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private RemoveInstanceTargetPoolHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, String userIp @@ -72,6 +75,7 @@ private RemoveInstanceTargetPoolHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.targetPool = targetPool; this.targetPoolsRemoveInstanceRequestResource = targetPoolsRemoveInstanceRequestResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("targetPool")) { return String.valueOf(targetPool); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getTargetPool() { return targetPool; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String targetPool; private TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(RemoveInstanceTargetPoolHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getTargetPool() != null) { this.targetPool = other.targetPool; } @@ -256,6 +274,7 @@ public Builder mergeFrom(RemoveInstanceTargetPoolHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.targetPool = source.targetPool; this.targetPoolsRemoveInstanceRequestResource = source.targetPoolsRemoveInstanceRequestResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getTargetPool() { return targetPool; } @@ -351,6 +379,7 @@ public RemoveInstanceTargetPoolHttpRequest build() { + if (targetPool == null) { missing += " targetPool"; } @@ -366,6 +395,7 @@ public RemoveInstanceTargetPoolHttpRequest build() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsRemoveInstanceRequestResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); newBuilder.setTargetPoolsRemoveInstanceRequestResource(this.targetPoolsRemoveInstanceRequestResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "targetPool=" + targetPool + ", " + "targetPoolsRemoveInstanceRequestResource=" + targetPoolsRemoveInstanceRequestResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.targetPool, that.getTargetPool()) && Objects.equals(this.targetPoolsRemoveInstanceRequestResource, that.getTargetPoolsRemoveInstanceRequestResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, targetPool, targetPoolsRemoveInstanceRequestResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java index d340e1435705..cfb00726489c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java @@ -40,6 +40,7 @@ public final class RemoveInstancesInstanceGroupHttpRequest implements ApiMessage private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private RemoveInstancesInstanceGroupHttpRequest() { @@ -51,6 +52,7 @@ private RemoveInstancesInstanceGroupHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private RemoveInstancesInstanceGroupHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private RemoveInstancesInstanceGroupHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(RemoveInstancesInstanceGroupHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(RemoveInstancesInstanceGroupHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public RemoveInstancesInstanceGroupHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public RemoveInstancesInstanceGroupHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java new file mode 100644 index 000000000000..8da267c2ec59 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RemovePeeringNetworkHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String network; + private final NetworksRemovePeeringRequest networksRemovePeeringRequestResource; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private RemovePeeringNetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.network = null; + this.networksRemovePeeringRequestResource = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private RemovePeeringNetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String network, + NetworksRemovePeeringRequest networksRemovePeeringRequestResource, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.network = network; + this.networksRemovePeeringRequestResource = networksRemovePeeringRequestResource; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networksRemovePeeringRequestResource") && networksRemovePeeringRequestResource != null) { + fieldMap.put("networksRemovePeeringRequestResource", Collections.singletonList(String.valueOf(networksRemovePeeringRequestResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("network")) { + return String.valueOf(network); + } + if (fieldName.equals("networksRemovePeeringRequestResource")) { + return String.valueOf(networksRemovePeeringRequestResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public NetworksRemovePeeringRequest getApiMessageRequestBody() { + return networksRemovePeeringRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNetwork() { + return network; + } + + public NetworksRemovePeeringRequest getNetworksRemovePeeringRequestResource() { + return networksRemovePeeringRequestResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RemovePeeringNetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static RemovePeeringNetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final RemovePeeringNetworkHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RemovePeeringNetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String network; + private NetworksRemovePeeringRequest networksRemovePeeringRequestResource; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(RemovePeeringNetworkHttpRequest other) { + if (other == RemovePeeringNetworkHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getNetworksRemovePeeringRequestResource() != null) { + this.networksRemovePeeringRequestResource = other.networksRemovePeeringRequestResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(RemovePeeringNetworkHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.network = source.network; + this.networksRemovePeeringRequestResource = source.networksRemovePeeringRequestResource; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public NetworksRemovePeeringRequest getNetworksRemovePeeringRequestResource() { + return networksRemovePeeringRequestResource; + } + + public Builder setNetworksRemovePeeringRequestResource(NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + this.networksRemovePeeringRequestResource = networksRemovePeeringRequestResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public RemovePeeringNetworkHttpRequest build() { + String missing = ""; + + + + + if (network == null) { + missing += " network"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new RemovePeeringNetworkHttpRequest( + access_token, + callback, + fields, + key, + network, + networksRemovePeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNetwork(this.network); + newBuilder.setNetworksRemovePeeringRequestResource(this.networksRemovePeeringRequestResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "RemovePeeringNetworkHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "networksRemovePeeringRequestResource=" + networksRemovePeeringRequestResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RemovePeeringNetworkHttpRequest) { + RemovePeeringNetworkHttpRequest that = (RemovePeeringNetworkHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.networksRemovePeeringRequestResource, that.getNetworksRemovePeeringRequestResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + network, + networksRemovePeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java index 4be7b3a1bfd6..e17e1ba72f69 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java @@ -39,6 +39,7 @@ public final class ResetInstanceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private ResetInstanceHttpRequest() { @@ -49,6 +50,7 @@ private ResetInstanceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -61,6 +63,7 @@ private ResetInstanceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -70,6 +73,7 @@ private ResetInstanceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -166,6 +176,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -198,6 +212,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -225,6 +240,9 @@ public Builder mergeFrom(ResetInstanceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -239,6 +257,7 @@ public Builder mergeFrom(ResetInstanceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -327,6 +355,7 @@ public ResetInstanceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -338,6 +367,7 @@ public ResetInstanceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -351,6 +381,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -366,6 +397,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -385,6 +417,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -401,6 +434,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java index efedfc6ca83e..175c4e9b2f0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java @@ -40,6 +40,7 @@ public final class ResizeDiskHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private ResizeDiskHttpRequest() { @@ -51,6 +52,7 @@ private ResizeDiskHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private ResizeDiskHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private ResizeDiskHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(ResizeDiskHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(ResizeDiskHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public ResizeDiskHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public ResizeDiskHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java index 6b6caabd4cf4..56e3cf451987 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java @@ -39,6 +39,7 @@ public final class ResizeInstanceGroupManagerHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final Integer size; private final String userIp; @@ -50,6 +51,7 @@ private ResizeInstanceGroupManagerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.size = null; this.userIp = null; } @@ -63,6 +65,7 @@ private ResizeInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, Integer size, String userIp ) { @@ -73,6 +76,7 @@ private ResizeInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.size = size; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("size") && size != null) { fieldMap.put("size", Collections.singletonList(String.valueOf(size))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("size")) { return String.valueOf(size); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public Integer getSize() { return size; } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private Integer size; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(ResizeInstanceGroupManagerHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getSize() != null) { this.size = other.size; } @@ -257,6 +275,7 @@ public Builder mergeFrom(ResizeInstanceGroupManagerHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.size = source.size; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public Integer getSize() { return size; } @@ -354,6 +382,7 @@ public ResizeInstanceGroupManagerHttpRequest build() { + if (size == null) { missing += " size"; } @@ -369,6 +398,7 @@ public ResizeInstanceGroupManagerHttpRequest build() { key, prettyPrint, quotaUser, + requestId, size, userIp ); @@ -383,6 +413,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setSize(this.size); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -399,6 +430,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "size=" + size + ", " + "userIp=" + userIp + "}"; @@ -419,6 +451,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.size, that.getSize()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -436,6 +469,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, size, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java index e523222c94d3..75904592828b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java @@ -39,6 +39,7 @@ public final class ResizeRegionInstanceGroupManagerHttpRequest implements ApiMes private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final Integer size; private final String userIp; @@ -50,6 +51,7 @@ private ResizeRegionInstanceGroupManagerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.size = null; this.userIp = null; } @@ -63,6 +65,7 @@ private ResizeRegionInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, Integer size, String userIp ) { @@ -73,6 +76,7 @@ private ResizeRegionInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.size = size; this.userIp = userIp; } @@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("size") && size != null) { fieldMap.put("size", Collections.singletonList(String.valueOf(size))); } @@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("size")) { return String.valueOf(size); } @@ -176,6 +186,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public Integer getSize() { return size; } @@ -212,6 +226,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private Integer size; private String userIp; @@ -240,6 +255,9 @@ public Builder mergeFrom(ResizeRegionInstanceGroupManagerHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getSize() != null) { this.size = other.size; } @@ -257,6 +275,7 @@ public Builder mergeFrom(ResizeRegionInstanceGroupManagerHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.size = source.size; this.userIp = source.userIp; } @@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public Integer getSize() { return size; } @@ -354,6 +382,7 @@ public ResizeRegionInstanceGroupManagerHttpRequest build() { + if (size == null) { missing += " size"; } @@ -369,6 +398,7 @@ public ResizeRegionInstanceGroupManagerHttpRequest build() { key, prettyPrint, quotaUser, + requestId, size, userIp ); @@ -383,6 +413,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setSize(this.size); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -399,6 +430,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "size=" + size + ", " + "userIp=" + userIp + "}"; @@ -419,6 +451,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.size, that.getSize()) && Objects.equals(this.userIp, that.getUserIp()) ; @@ -436,6 +469,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, size, userIp ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java new file mode 100644 index 000000000000..2f48dab044f9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResourceCommitment implements ApiMessage { + private final String amount; + private final String type; + + private ResourceCommitment() { + this.amount = null; + this.type = null; + } + + + private ResourceCommitment( + String amount, + String type + ) { + this.amount = amount; + this.type = type; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("amount") && amount != null) { + fieldMap.put("amount", Collections.singletonList(String.valueOf(amount))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("amount")) { + return String.valueOf(amount); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAmount() { + return amount; + } + + public String getType() { + return type; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ResourceCommitment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResourceCommitment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ResourceCommitment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ResourceCommitment(); + } + + public static class Builder { + private String amount; + private String type; + + Builder() {} + + public Builder mergeFrom(ResourceCommitment other) { + if (other == ResourceCommitment.getDefaultInstance()) return this; + if (other.getAmount() != null) { + this.amount = other.amount; + } + if (other.getType() != null) { + this.type = other.type; + } + return this; + } + + Builder(ResourceCommitment source) { + this.amount = source.amount; + this.type = source.type; + } + + public String getAmount() { + return amount; + } + + public Builder setAmount(String amount) { + this.amount = amount; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + + public ResourceCommitment build() { + + return new ResourceCommitment( + amount, + type + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAmount(this.amount); + newBuilder.setType(this.type); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResourceCommitment{" + + "amount=" + amount + ", " + + "type=" + type + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResourceCommitment) { + ResourceCommitment that = (ResourceCommitment) o; + return + Objects.equals(this.amount, that.getAmount()) && + Objects.equals(this.type, that.getType()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + amount, + type + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java new file mode 100644 index 000000000000..a81896038ca6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java @@ -0,0 +1,210 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ResourceName implements com.google.api.resourcenames.ResourceName { + private final String project; + private final String resource; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + resource = Preconditions.checkNotNull(builder.getResource()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static ResourceName of( + String project, + String resource, + String zone + ) { + return newBuilder() + .setProject(project) + .setResource(resource) + .setZone(zone) + .build(); + } + + public static String format( + String project, + String resource, + String zone + ) { + return of( + project, + resource, + zone + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + public String getZone() { + return zone; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("resource", resource); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ResourceName parse(String formattedString) {return ResourceName.parse(formattedString);} + }; + } + + public static ResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ResourceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("resource"), + matchMap.get("zone") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String resource; + private String zone; + + public String getProject() { + return project; + } + public String getResource() { + return resource; + } + public String getZone() { + return zone; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder (ResourceName resourceName) { + project = resourceName.project; + resource = resourceName.resource; + zone = resourceName.zone; + } + + public ResourceName build() { + return new ResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "resource", resource, + "zone", zone + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResourceName) { + ResourceName that = (ResourceName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.resource, that.getResource()) && + Objects.equals(this.zone, that.getZone()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + resource, + zone + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java index c03fcd1c9a10..4b494492848e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java @@ -43,6 +43,7 @@ public final class Route implements ApiMessage { private final String nextHopInstance; private final String nextHopIp; private final String nextHopNetwork; + private final String nextHopPeering; private final String nextHopVpnTunnel; private final Integer priority; private final String selfLink; @@ -61,6 +62,7 @@ private Route() { this.nextHopInstance = null; this.nextHopIp = null; this.nextHopNetwork = null; + this.nextHopPeering = null; this.nextHopVpnTunnel = null; this.priority = null; this.selfLink = null; @@ -81,6 +83,7 @@ private Route( String nextHopInstance, String nextHopIp, String nextHopNetwork, + String nextHopPeering, String nextHopVpnTunnel, Integer priority, String selfLink, @@ -98,6 +101,7 @@ private Route( this.nextHopInstance = nextHopInstance; this.nextHopIp = nextHopIp; this.nextHopNetwork = nextHopNetwork; + this.nextHopPeering = nextHopPeering; this.nextHopVpnTunnel = nextHopVpnTunnel; this.priority = priority; this.selfLink = selfLink; @@ -141,6 +145,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("nextHopNetwork") && nextHopNetwork != null) { fieldMap.put("nextHopNetwork", Collections.singletonList(String.valueOf(nextHopNetwork))); } + if (fieldNames.contains("nextHopPeering") && nextHopPeering != null) { + fieldMap.put("nextHopPeering", Collections.singletonList(String.valueOf(nextHopPeering))); + } if (fieldNames.contains("nextHopVpnTunnel") && nextHopVpnTunnel != null) { fieldMap.put("nextHopVpnTunnel", Collections.singletonList(String.valueOf(nextHopVpnTunnel))); } @@ -202,6 +209,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("nextHopNetwork")) { return String.valueOf(nextHopNetwork); } + if (fieldName.equals("nextHopPeering")) { + return String.valueOf(nextHopPeering); + } if (fieldName.equals("nextHopVpnTunnel")) { return String.valueOf(nextHopVpnTunnel); } @@ -270,6 +280,10 @@ public String getNextHopNetwork() { return nextHopNetwork; } + public String getNextHopPeering() { + return nextHopPeering; + } + public String getNextHopVpnTunnel() { return nextHopVpnTunnel; } @@ -322,6 +336,7 @@ public static class Builder { private String nextHopInstance; private String nextHopIp; private String nextHopNetwork; + private String nextHopPeering; private String nextHopVpnTunnel; private Integer priority; private String selfLink; @@ -365,6 +380,9 @@ public Builder mergeFrom(Route other) { if (other.getNextHopNetwork() != null) { this.nextHopNetwork = other.nextHopNetwork; } + if (other.getNextHopPeering() != null) { + this.nextHopPeering = other.nextHopPeering; + } if (other.getNextHopVpnTunnel() != null) { this.nextHopVpnTunnel = other.nextHopVpnTunnel; } @@ -395,6 +413,7 @@ public Builder mergeFrom(Route other) { this.nextHopInstance = source.nextHopInstance; this.nextHopIp = source.nextHopIp; this.nextHopNetwork = source.nextHopNetwork; + this.nextHopPeering = source.nextHopPeering; this.nextHopVpnTunnel = source.nextHopVpnTunnel; this.priority = source.priority; this.selfLink = source.selfLink; @@ -501,6 +520,15 @@ public Builder setNextHopNetwork(String nextHopNetwork) { return this; } + public String getNextHopPeering() { + return nextHopPeering; + } + + public Builder setNextHopPeering(String nextHopPeering) { + this.nextHopPeering = nextHopPeering; + return this; + } + public String getNextHopVpnTunnel() { return nextHopVpnTunnel; } @@ -579,6 +607,7 @@ public Route build() { + return new Route( creationTimestamp, description, @@ -591,6 +620,7 @@ public Route build() { nextHopInstance, nextHopIp, nextHopNetwork, + nextHopPeering, nextHopVpnTunnel, priority, selfLink, @@ -612,6 +642,7 @@ public Builder clone() { newBuilder.setNextHopInstance(this.nextHopInstance); newBuilder.setNextHopIp(this.nextHopIp); newBuilder.setNextHopNetwork(this.nextHopNetwork); + newBuilder.setNextHopPeering(this.nextHopPeering); newBuilder.setNextHopVpnTunnel(this.nextHopVpnTunnel); newBuilder.setPriority(this.priority); newBuilder.setSelfLink(this.selfLink); @@ -635,6 +666,7 @@ public String toString() { + "nextHopInstance=" + nextHopInstance + ", " + "nextHopIp=" + nextHopIp + ", " + "nextHopNetwork=" + nextHopNetwork + ", " + + "nextHopPeering=" + nextHopPeering + ", " + "nextHopVpnTunnel=" + nextHopVpnTunnel + ", " + "priority=" + priority + ", " + "selfLink=" + selfLink + ", " @@ -662,6 +694,7 @@ public boolean equals(Object o) { Objects.equals(this.nextHopInstance, that.getNextHopInstance()) && Objects.equals(this.nextHopIp, that.getNextHopIp()) && Objects.equals(this.nextHopNetwork, that.getNextHopNetwork()) && + Objects.equals(this.nextHopPeering, that.getNextHopPeering()) && Objects.equals(this.nextHopVpnTunnel, that.getNextHopVpnTunnel()) && Objects.equals(this.priority, that.getPriority()) && Objects.equals(this.selfLink, that.getSelfLink()) && @@ -686,6 +719,7 @@ public int hashCode() { nextHopInstance, nextHopIp, nextHopNetwork, + nextHopPeering, nextHopVpnTunnel, priority, selfLink, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java index 30b5fe2f6995..c0b81ed6f5a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java @@ -53,7 +53,8 @@ * * try (RouteClient routeClient = RouteClient.create()) { * RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); - * Operation response = routeClient.deleteRoute(route); + * String requestId = ""; + * Operation response = routeClient.deleteRoute(route, requestId); * } * *
@@ -176,19 +177,26 @@ public RouteStub getStub() { *

    * try (RouteClient routeClient = RouteClient.create()) {
    *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
-   *   Operation response = routeClient.deleteRoute(route);
+   *   String requestId = "";
+   *   Operation response = routeClient.deleteRoute(route, requestId);
    * }
    * 
* * @param route Name of the Route resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRoute(RouteName route) { + public final Operation deleteRoute(RouteName route, String requestId) { DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder() .setRoute(route == null ? null : route.toString()) + .setRequestId(requestId) .build(); return deleteRoute(request); } @@ -201,19 +209,26 @@ public final Operation deleteRoute(RouteName route) { *

    * try (RouteClient routeClient = RouteClient.create()) {
    *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
-   *   Operation response = routeClient.deleteRoute(route.toString());
+   *   String requestId = "";
+   *   Operation response = routeClient.deleteRoute(route.toString(), requestId);
    * }
    * 
* * @param route Name of the Route resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRoute(String route) { + public final Operation deleteRoute(String route, String requestId) { DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder() .setRoute(route) + .setRequestId(requestId) .build(); return deleteRoute(request); } @@ -226,8 +241,10 @@ public final Operation deleteRoute(String route) { *

    * try (RouteClient routeClient = RouteClient.create()) {
    *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = routeClient.deleteRoute(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteRoute(DeleteRouteHttpRequest request) {
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
    *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = routeClient.deleteRouteCallable().futureCall(request);
    *   // Do something
@@ -365,25 +384,32 @@ public final UnaryCallable getRouteCallable() {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
-   *   Operation response = routeClient.insertRoute(project, routeResource);
+   *   Operation response = routeClient.insertRoute(requestId, project, routeResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param routeResource Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table. * - * For each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, a instance gateway or a Google Compute Engine-operated gateway. + * For each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway. * - * Packets that do not match any route in the sending instance's routing table are dropped. + * Packets that do not match any route in the sending instance's routing table are dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRoute(ProjectName project, Route routeResource) { + public final Operation insertRoute(String requestId, ProjectName project, Route routeResource) { InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setRouteResource(routeResource) .build(); @@ -397,25 +423,32 @@ public final Operation insertRoute(ProjectName project, Route routeResource) { * Sample code: *

    * try (RouteClient routeClient = RouteClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
-   *   Operation response = routeClient.insertRoute(project.toString(), routeResource);
+   *   Operation response = routeClient.insertRoute(requestId, project.toString(), routeResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param routeResource Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table. * - * For each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, a instance gateway or a Google Compute Engine-operated gateway. + * For each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway. * - * Packets that do not match any route in the sending instance's routing table are dropped. + * Packets that do not match any route in the sending instance's routing table are dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRoute(String project, Route routeResource) { + public final Operation insertRoute(String requestId, String project, Route routeResource) { InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setRouteResource(routeResource) .build(); @@ -429,9 +462,11 @@ public final Operation insertRoute(String project, Route routeResource) { * Sample code: *

    * try (RouteClient routeClient = RouteClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
    *   InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setRouteResource(routeResource)
    *     .build();
@@ -454,9 +489,11 @@ public final Operation insertRoute(InsertRouteHttpRequest request) {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
    *   InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setRouteResource(routeResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
index f506fb79fc07..f5ab82259625 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
@@ -37,6 +37,7 @@ public final class RouteList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private RouteList() {
     this.id = null;
@@ -44,6 +45,7 @@ private RouteList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private RouteList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(RouteList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(RouteList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public RouteList build() {
 
 
 
 
+
       return new RouteList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java
index 054480fb8bd9..7b06a07a381b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class RouteName implements ResourceName {
+public final class RouteName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String route;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java
new file mode 100644
index 000000000000..f4877c6028b3
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class RouterAdvertisedIpRange implements ApiMessage {
+  private final String description;
+  private final String range;
+
+  private RouterAdvertisedIpRange() {
+    this.description = null;
+    this.range = null;
+  }
+
+
+  private RouterAdvertisedIpRange(
+      String description,
+      String range
+      ) {
+    this.description = description;
+    this.range = range;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("description") && description != null) {
+      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
+    }
+    if (fieldNames.contains("range") && range != null) {
+      fieldMap.put("range", Collections.singletonList(String.valueOf(range)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("description")) {
+      return String.valueOf(description);
+    }
+    if (fieldName.equals("range")) {
+      return String.valueOf(range);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public String getRange() {
+    return range;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(RouterAdvertisedIpRange prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static RouterAdvertisedIpRange getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final RouterAdvertisedIpRange DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new RouterAdvertisedIpRange();
+  }
+
+  public static class Builder {
+    private String description;
+    private String range;
+
+    Builder() {}
+
+    public Builder mergeFrom(RouterAdvertisedIpRange other) {
+      if (other == RouterAdvertisedIpRange.getDefaultInstance()) return this;
+      if (other.getDescription() != null) {
+        this.description = other.description;
+      }
+      if (other.getRange() != null) {
+        this.range = other.range;
+      }
+      return this;
+    }
+
+    Builder(RouterAdvertisedIpRange source) {
+      this.description = source.description;
+      this.range = source.range;
+    }
+
+    public String getDescription() {
+      return description;
+    }
+
+    public Builder setDescription(String description) {
+      this.description = description;
+      return this;
+    }
+
+    public String getRange() {
+      return range;
+    }
+
+    public Builder setRange(String range) {
+      this.range = range;
+      return this;
+    }
+
+
+    public RouterAdvertisedIpRange build() {
+
+      return new RouterAdvertisedIpRange(
+        description,
+        range
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setDescription(this.description);
+      newBuilder.setRange(this.range);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "RouterAdvertisedIpRange{"
+        + "description=" + description + ", "
+        + "range=" + range
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof RouterAdvertisedIpRange) {
+      RouterAdvertisedIpRange that = (RouterAdvertisedIpRange) o;
+      return
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.range, that.getRange())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      description,
+      range
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java
index 7465564574a1..e9b6858abc23 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java
@@ -37,6 +37,7 @@ public final class RouterAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private RouterAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private RouterAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private RouterAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(RouterAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(RouterAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public RouterAggregatedList build() {
 
 
 
 
+
       return new RouterAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java
index 6e32b2270067..8b2dadf80ddd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -29,19 +32,51 @@
 @Generated("by GAPIC")
 @BetaApi
 public final class RouterBgp implements ApiMessage {
+  private final String advertiseMode;
+  private final List advertisedGroups;
+  private final List advertisedIpRanges;
   private final Integer asn;
 
   private RouterBgp() {
+    this.advertiseMode = null;
+    this.advertisedGroups = null;
+    this.advertisedIpRanges = null;
     this.asn = null;
   }
 
-  private RouterBgp(Integer asn) {
+
+  private RouterBgp(
+      String advertiseMode,
+      List advertisedGroups,
+      List advertisedIpRanges,
+      Integer asn
+      ) {
+    this.advertiseMode = advertiseMode;
+    this.advertisedGroups = advertisedGroups;
+    this.advertisedIpRanges = advertisedIpRanges;
     this.asn = asn;
   }
 
   @Override
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("advertiseMode") && advertiseMode != null) {
+      fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode)));
+    }
+    if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (String item : advertisedGroups) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("advertisedGroups", stringList.build());
+    }
+    if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (RouterAdvertisedIpRange item : advertisedIpRanges) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("advertisedIpRanges", stringList.build());
+    }
     if (fieldNames.contains("asn") && asn != null) {
       fieldMap.put("asn", Collections.singletonList(String.valueOf(asn)));
     }
@@ -50,6 +85,15 @@ public Map> populateFieldsInMap(Set fieldNames) {
 
   @Override
   public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("advertiseMode")) {
+      return String.valueOf(advertiseMode);
+    }
+    if (fieldName.equals("advertisedGroups")) {
+      return String.valueOf(advertisedGroups);
+    }
+    if (fieldName.equals("advertisedIpRanges")) {
+      return String.valueOf(advertisedIpRanges);
+    }
     if (fieldName.equals("asn")) {
       return String.valueOf(asn);
     }
@@ -62,39 +106,61 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  public String getAdvertiseMode() {
+    return advertiseMode;
+  }
+
+  public List getAdvertisedGroupsList() {
+    return advertisedGroups;
+  }
+
+  public List getAdvertisedIpRangesList() {
+    return advertisedIpRanges;
+  }
+
   public Integer getAsn() {
     return asn;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(RouterBgp prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static RouterBgp getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final RouterBgp DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new RouterBgp();
   }
 
   public static class Builder {
+    private String advertiseMode;
+    private List advertisedGroups;
+    private List advertisedIpRanges;
     private Integer asn;
 
     Builder() {}
 
     public Builder mergeFrom(RouterBgp other) {
       if (other == RouterBgp.getDefaultInstance()) return this;
+      if (other.getAdvertiseMode() != null) {
+        this.advertiseMode = other.advertiseMode;
+      }
+      if (other.getAdvertisedGroupsList() != null) {
+        this.advertisedGroups = other.advertisedGroups;
+      }
+      if (other.getAdvertisedIpRangesList() != null) {
+        this.advertisedIpRanges = other.advertisedIpRanges;
+      }
       if (other.getAsn() != null) {
         this.asn = other.asn;
       }
@@ -102,9 +168,55 @@ public Builder mergeFrom(RouterBgp other) {
     }
 
     Builder(RouterBgp source) {
+      this.advertiseMode = source.advertiseMode;
+      this.advertisedGroups = source.advertisedGroups;
+      this.advertisedIpRanges = source.advertisedIpRanges;
       this.asn = source.asn;
     }
 
+    public String getAdvertiseMode() {
+      return advertiseMode;
+    }
+
+    public Builder setAdvertiseMode(String advertiseMode) {
+      this.advertiseMode = advertiseMode;
+      return this;
+    }
+
+    public List getAdvertisedGroupsList() {
+      return advertisedGroups;
+    }
+
+    public Builder addAllAdvertisedGroups(List advertisedGroups) {
+      if (this.advertisedGroups == null) {
+        this.advertisedGroups = new ArrayList<>(advertisedGroups.size());
+      }
+      this.advertisedGroups.addAll(advertisedGroups);
+      return this;
+    }
+
+    public Builder addAdvertisedGroups(String advertisedGroups) {
+      this.advertisedGroups.add(advertisedGroups);
+      return this;
+    }
+
+    public List getAdvertisedIpRangesList() {
+      return advertisedIpRanges;
+    }
+
+    public Builder addAllAdvertisedIpRanges(List advertisedIpRanges) {
+      if (this.advertisedIpRanges == null) {
+        this.advertisedIpRanges = new ArrayList<>(advertisedIpRanges.size());
+      }
+      this.advertisedIpRanges.addAll(advertisedIpRanges);
+      return this;
+    }
+
+    public Builder addAdvertisedIpRanges(RouterAdvertisedIpRange advertisedIpRanges) {
+      this.advertisedIpRanges.add(advertisedIpRanges);
+      return this;
+    }
+
     public Integer getAsn() {
       return asn;
     }
@@ -114,12 +226,24 @@ public Builder setAsn(Integer asn) {
       return this;
     }
 
+
     public RouterBgp build() {
-      return new RouterBgp(asn);
+
+
+
+      return new RouterBgp(
+        advertiseMode,
+        advertisedGroups,
+        advertisedIpRanges,
+        asn
+      );
     }
 
     public Builder clone() {
       Builder newBuilder = new Builder();
+      newBuilder.setAdvertiseMode(this.advertiseMode);
+      newBuilder.addAllAdvertisedGroups(this.advertisedGroups);
+      newBuilder.addAllAdvertisedIpRanges(this.advertisedIpRanges);
       newBuilder.setAsn(this.asn);
       return newBuilder;
     }
@@ -127,7 +251,12 @@ public Builder clone() {
 
   @Override
   public String toString() {
-    return "RouterBgp{" + "asn=" + asn + "}";
+    return "RouterBgp{"
+        + "advertiseMode=" + advertiseMode + ", "
+        + "advertisedGroups=" + advertisedGroups + ", "
+        + "advertisedIpRanges=" + advertisedIpRanges + ", "
+        + "asn=" + asn
+        + "}";
   }
 
   @Override
@@ -137,13 +266,23 @@ public boolean equals(Object o) {
     }
     if (o instanceof RouterBgp) {
       RouterBgp that = (RouterBgp) o;
-      return Objects.equals(this.asn, that.getAsn());
+      return
+          Objects.equals(this.advertiseMode, that.getAdvertiseMode()) &&
+          Objects.equals(this.advertisedGroups, that.getAdvertisedGroupsList()) &&
+          Objects.equals(this.advertisedIpRanges, that.getAdvertisedIpRangesList()) &&
+          Objects.equals(this.asn, that.getAsn())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(asn);
+    return Objects.hash(
+      advertiseMode,
+      advertisedGroups,
+      advertisedIpRanges,
+      asn
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java
index 48c1e59d7e33..353e02d6c034 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java
@@ -32,6 +32,9 @@
 @Generated("by GAPIC")
 @BetaApi
 public final class RouterBgpPeer implements ApiMessage {
+  private final String advertiseMode;
+  private final List advertisedGroups;
+  private final List advertisedIpRanges;
   private final Integer advertisedRoutePriority;
   private final String interfaceName;
   private final String ipAddress;
@@ -40,6 +43,9 @@ public final class RouterBgpPeer implements ApiMessage {
   private final String peerIpAddress;
 
   private RouterBgpPeer() {
+    this.advertiseMode = null;
+    this.advertisedGroups = null;
+    this.advertisedIpRanges = null;
     this.advertisedRoutePriority = null;
     this.interfaceName = null;
     this.ipAddress = null;
@@ -50,6 +56,9 @@ private RouterBgpPeer() {
 
 
   private RouterBgpPeer(
+      String advertiseMode,
+      List advertisedGroups,
+      List advertisedIpRanges,
       Integer advertisedRoutePriority,
       String interfaceName,
       String ipAddress,
@@ -57,6 +66,9 @@ private RouterBgpPeer(
       Integer peerAsn,
       String peerIpAddress
       ) {
+    this.advertiseMode = advertiseMode;
+    this.advertisedGroups = advertisedGroups;
+    this.advertisedIpRanges = advertisedIpRanges;
     this.advertisedRoutePriority = advertisedRoutePriority;
     this.interfaceName = interfaceName;
     this.ipAddress = ipAddress;
@@ -68,6 +80,23 @@ private RouterBgpPeer(
   @Override
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("advertiseMode") && advertiseMode != null) {
+      fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode)));
+    }
+    if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (String item : advertisedGroups) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("advertisedGroups", stringList.build());
+    }
+    if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (RouterAdvertisedIpRange item : advertisedIpRanges) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("advertisedIpRanges", stringList.build());
+    }
     if (fieldNames.contains("advertisedRoutePriority") && advertisedRoutePriority != null) {
       fieldMap.put("advertisedRoutePriority", Collections.singletonList(String.valueOf(advertisedRoutePriority)));
     }
@@ -91,6 +120,15 @@ public Map> populateFieldsInMap(Set fieldNames) {
 
   @Override
   public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("advertiseMode")) {
+      return String.valueOf(advertiseMode);
+    }
+    if (fieldName.equals("advertisedGroups")) {
+      return String.valueOf(advertisedGroups);
+    }
+    if (fieldName.equals("advertisedIpRanges")) {
+      return String.valueOf(advertisedIpRanges);
+    }
     if (fieldName.equals("advertisedRoutePriority")) {
       return String.valueOf(advertisedRoutePriority);
     }
@@ -118,6 +156,18 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  public String getAdvertiseMode() {
+    return advertiseMode;
+  }
+
+  public List getAdvertisedGroupsList() {
+    return advertisedGroups;
+  }
+
+  public List getAdvertisedIpRangesList() {
+    return advertisedIpRanges;
+  }
+
   public Integer getAdvertisedRoutePriority() {
     return advertisedRoutePriority;
   }
@@ -163,6 +213,9 @@ public static RouterBgpPeer getDefaultInstance() {
   }
 
   public static class Builder {
+    private String advertiseMode;
+    private List advertisedGroups;
+    private List advertisedIpRanges;
     private Integer advertisedRoutePriority;
     private String interfaceName;
     private String ipAddress;
@@ -174,6 +227,15 @@ public static class Builder {
 
     public Builder mergeFrom(RouterBgpPeer other) {
       if (other == RouterBgpPeer.getDefaultInstance()) return this;
+      if (other.getAdvertiseMode() != null) {
+        this.advertiseMode = other.advertiseMode;
+      }
+      if (other.getAdvertisedGroupsList() != null) {
+        this.advertisedGroups = other.advertisedGroups;
+      }
+      if (other.getAdvertisedIpRangesList() != null) {
+        this.advertisedIpRanges = other.advertisedIpRanges;
+      }
       if (other.getAdvertisedRoutePriority() != null) {
         this.advertisedRoutePriority = other.advertisedRoutePriority;
       }
@@ -196,6 +258,9 @@ public Builder mergeFrom(RouterBgpPeer other) {
     }
 
     Builder(RouterBgpPeer source) {
+      this.advertiseMode = source.advertiseMode;
+      this.advertisedGroups = source.advertisedGroups;
+      this.advertisedIpRanges = source.advertisedIpRanges;
       this.advertisedRoutePriority = source.advertisedRoutePriority;
       this.interfaceName = source.interfaceName;
       this.ipAddress = source.ipAddress;
@@ -204,6 +269,49 @@ public Builder mergeFrom(RouterBgpPeer other) {
       this.peerIpAddress = source.peerIpAddress;
     }
 
+    public String getAdvertiseMode() {
+      return advertiseMode;
+    }
+
+    public Builder setAdvertiseMode(String advertiseMode) {
+      this.advertiseMode = advertiseMode;
+      return this;
+    }
+
+    public List getAdvertisedGroupsList() {
+      return advertisedGroups;
+    }
+
+    public Builder addAllAdvertisedGroups(List advertisedGroups) {
+      if (this.advertisedGroups == null) {
+        this.advertisedGroups = new ArrayList<>(advertisedGroups.size());
+      }
+      this.advertisedGroups.addAll(advertisedGroups);
+      return this;
+    }
+
+    public Builder addAdvertisedGroups(String advertisedGroups) {
+      this.advertisedGroups.add(advertisedGroups);
+      return this;
+    }
+
+    public List getAdvertisedIpRangesList() {
+      return advertisedIpRanges;
+    }
+
+    public Builder addAllAdvertisedIpRanges(List advertisedIpRanges) {
+      if (this.advertisedIpRanges == null) {
+        this.advertisedIpRanges = new ArrayList<>(advertisedIpRanges.size());
+      }
+      this.advertisedIpRanges.addAll(advertisedIpRanges);
+      return this;
+    }
+
+    public Builder addAdvertisedIpRanges(RouterAdvertisedIpRange advertisedIpRanges) {
+      this.advertisedIpRanges.add(advertisedIpRanges);
+      return this;
+    }
+
     public Integer getAdvertisedRoutePriority() {
       return advertisedRoutePriority;
     }
@@ -265,7 +373,13 @@ public RouterBgpPeer build() {
 
 
 
+
+
+
       return new RouterBgpPeer(
+        advertiseMode,
+        advertisedGroups,
+        advertisedIpRanges,
         advertisedRoutePriority,
         interfaceName,
         ipAddress,
@@ -277,6 +391,9 @@ public RouterBgpPeer build() {
 
     public Builder clone() {
       Builder newBuilder = new Builder();
+      newBuilder.setAdvertiseMode(this.advertiseMode);
+      newBuilder.addAllAdvertisedGroups(this.advertisedGroups);
+      newBuilder.addAllAdvertisedIpRanges(this.advertisedIpRanges);
       newBuilder.setAdvertisedRoutePriority(this.advertisedRoutePriority);
       newBuilder.setInterfaceName(this.interfaceName);
       newBuilder.setIpAddress(this.ipAddress);
@@ -290,6 +407,9 @@ public Builder clone() {
   @Override
   public String toString() {
     return "RouterBgpPeer{"
+        + "advertiseMode=" + advertiseMode + ", "
+        + "advertisedGroups=" + advertisedGroups + ", "
+        + "advertisedIpRanges=" + advertisedIpRanges + ", "
         + "advertisedRoutePriority=" + advertisedRoutePriority + ", "
         + "interfaceName=" + interfaceName + ", "
         + "ipAddress=" + ipAddress + ", "
@@ -307,6 +427,9 @@ public boolean equals(Object o) {
     if (o instanceof RouterBgpPeer) {
       RouterBgpPeer that = (RouterBgpPeer) o;
       return
+          Objects.equals(this.advertiseMode, that.getAdvertiseMode()) &&
+          Objects.equals(this.advertisedGroups, that.getAdvertisedGroupsList()) &&
+          Objects.equals(this.advertisedIpRanges, that.getAdvertisedIpRangesList()) &&
           Objects.equals(this.advertisedRoutePriority, that.getAdvertisedRoutePriority()) &&
           Objects.equals(this.interfaceName, that.getInterfaceName()) &&
           Objects.equals(this.ipAddress, that.getIpAddress()) &&
@@ -321,6 +444,9 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
+      advertiseMode,
+      advertisedGroups,
+      advertisedIpRanges,
       advertisedRoutePriority,
       interfaceName,
       ipAddress,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
index 5e1867c2f50e..afde59eb1f5d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
@@ -53,7 +53,8 @@
  * 
  * try (RouterClient routerClient = RouterClient.create()) {
  *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
- *   Operation response = routerClient.deleteRouter(router);
+ *   String requestId = "";
+ *   Operation response = routerClient.deleteRouter(router, requestId);
  * }
  * 
  * 
@@ -309,19 +310,26 @@ public final UnaryCallable * try (RouterClient routerClient = RouterClient.create()) { * RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - * Operation response = routerClient.deleteRouter(router); + * String requestId = ""; + * Operation response = routerClient.deleteRouter(router, requestId); * } *
* * @param router Name of the Router resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRouter(RouterName router) { + public final Operation deleteRouter(RouterName router, String requestId) { DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder() .setRouter(router == null ? null : router.toString()) + .setRequestId(requestId) .build(); return deleteRouter(request); } @@ -334,19 +342,26 @@ public final Operation deleteRouter(RouterName router) { *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   Operation response = routerClient.deleteRouter(router.toString());
+   *   String requestId = "";
+   *   Operation response = routerClient.deleteRouter(router.toString(), requestId);
    * }
    * 
* * @param router Name of the Router resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRouter(String router) { + public final Operation deleteRouter(String router, String requestId) { DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder() .setRouter(router) + .setRequestId(requestId) .build(); return deleteRouter(request); } @@ -359,8 +374,10 @@ public final Operation deleteRouter(String router) { *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = routerClient.deleteRouter(request);
    * }
@@ -382,8 +399,10 @@ public final Operation deleteRouter(DeleteRouterHttpRequest request) {
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = routerClient.deleteRouterCallable().futureCall(request);
    *   // Do something
@@ -593,21 +612,28 @@ public final UnaryCallable
    * try (RouterClient routerClient = RouterClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.insertRouter(region, routerResource);
+   *   Operation response = routerClient.insertRouter(requestId, region, routerResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRouter(RegionName region, Router routerResource) { + public final Operation insertRouter(String requestId, RegionName region, Router routerResource) { InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setRouterResource(routerResource) .build(); @@ -621,21 +647,28 @@ public final Operation insertRouter(RegionName region, Router routerResource) { * Sample code: *

    * try (RouterClient routerClient = RouterClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.insertRouter(region.toString(), routerResource);
+   *   Operation response = routerClient.insertRouter(requestId, region.toString(), routerResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRouter(String region, Router routerResource) { + public final Operation insertRouter(String requestId, String region, Router routerResource) { InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region) .setRouterResource(routerResource) .build(); @@ -649,9 +682,11 @@ public final Operation insertRouter(String region, Router routerResource) { * Sample code: *

    * try (RouterClient routerClient = RouterClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setRouterResource(routerResource)
    *     .build();
@@ -674,9 +709,11 @@ public final Operation insertRouter(InsertRouterHttpRequest request) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setRouterResource(routerResource)
    *     .build();
@@ -826,27 +863,34 @@ public final UnaryCallable listRoutersCallab
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified Router resource with the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.patchRouter(router, routerResource);
+   *   Operation response = routerClient.patchRouter(router, requestId, routerResource);
    * }
    * 
* - * @param router Name of the Router resource to update. + * @param router Name of the Router resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRouter(RouterName router, Router routerResource) { + public final Operation patchRouter(RouterName router, String requestId, Router routerResource) { PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder() .setRouter(router == null ? null : router.toString()) + .setRequestId(requestId) .setRouterResource(routerResource) .build(); return patchRouter(request); @@ -854,27 +898,34 @@ public final Operation patchRouter(RouterName router, Router routerResource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified Router resource with the data included in the request. This method supports patch semantics. + * 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: *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.patchRouter(router.toString(), routerResource);
+   *   Operation response = routerClient.patchRouter(router.toString(), requestId, routerResource);
    * }
    * 
* - * @param router Name of the Router resource to update. + * @param router Name of the Router resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRouter(String router, Router routerResource) { + public final Operation patchRouter(String router, String requestId, Router routerResource) { PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder() .setRouter(router) + .setRequestId(requestId) .setRouterResource(routerResource) .build(); return patchRouter(request); @@ -882,15 +933,17 @@ public final Operation patchRouter(String router, Router routerResource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified Router resource with the data included in the request. This method supports patch semantics. + * 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: *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
+   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   Operation response = routerClient.patchRouter(request);
@@ -907,15 +960,17 @@ public final Operation patchRouter(PatchRouterHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified Router resource with the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
+   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   ApiFuture<Operation> future = routerClient.patchRouterCallable().futureCall(request);
@@ -1042,21 +1097,28 @@ public final UnaryCallable pre
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.updateRouter(router, routerResource);
+   *   Operation response = routerClient.updateRouter(router, requestId, routerResource);
    * }
    * 
* * @param router Name of the Router resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRouter(RouterName router, Router routerResource) { + public final Operation updateRouter(RouterName router, String requestId, Router routerResource) { UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder() .setRouter(router == null ? null : router.toString()) + .setRequestId(requestId) .setRouterResource(routerResource) .build(); return updateRouter(request); @@ -1070,21 +1132,28 @@ public final Operation updateRouter(RouterName router, Router routerResource) { *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.updateRouter(router.toString(), routerResource);
+   *   Operation response = routerClient.updateRouter(router.toString(), requestId, routerResource);
    * }
    * 
* * @param router Name of the Router resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRouter(String router, Router routerResource) { + public final Operation updateRouter(String router, String requestId, Router routerResource) { UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder() .setRouter(router) + .setRequestId(requestId) .setRouterResource(routerResource) .build(); return updateRouter(request); @@ -1098,9 +1167,11 @@ public final Operation updateRouter(String router, Router routerResource) { *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
+   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   Operation response = routerClient.updateRouter(request);
@@ -1123,9 +1194,11 @@ public final Operation updateRouter(UpdateRouterHttpRequest request) {
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
+   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   ApiFuture<Operation> future = routerClient.updateRouterCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
index 9540e7bc544d..c3db11f9e652 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
@@ -33,11 +33,13 @@
 @BetaApi
 public final class RouterInterface implements ApiMessage {
   private final String ipRange;
+  private final String linkedInterconnectAttachment;
   private final String linkedVpnTunnel;
   private final String name;
 
   private RouterInterface() {
     this.ipRange = null;
+    this.linkedInterconnectAttachment = null;
     this.linkedVpnTunnel = null;
     this.name = null;
   }
@@ -45,10 +47,12 @@ private RouterInterface() {
 
   private RouterInterface(
       String ipRange,
+      String linkedInterconnectAttachment,
       String linkedVpnTunnel,
       String name
       ) {
     this.ipRange = ipRange;
+    this.linkedInterconnectAttachment = linkedInterconnectAttachment;
     this.linkedVpnTunnel = linkedVpnTunnel;
     this.name = name;
   }
@@ -59,6 +63,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("ipRange") && ipRange != null) {
       fieldMap.put("ipRange", Collections.singletonList(String.valueOf(ipRange)));
     }
+    if (fieldNames.contains("linkedInterconnectAttachment") && linkedInterconnectAttachment != null) {
+      fieldMap.put("linkedInterconnectAttachment", Collections.singletonList(String.valueOf(linkedInterconnectAttachment)));
+    }
     if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) {
       fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel)));
     }
@@ -73,6 +80,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("ipRange")) {
       return String.valueOf(ipRange);
     }
+    if (fieldName.equals("linkedInterconnectAttachment")) {
+      return String.valueOf(linkedInterconnectAttachment);
+    }
     if (fieldName.equals("linkedVpnTunnel")) {
       return String.valueOf(linkedVpnTunnel);
     }
@@ -92,6 +102,10 @@ public String getIpRange() {
     return ipRange;
   }
 
+  public String getLinkedInterconnectAttachment() {
+    return linkedInterconnectAttachment;
+  }
+
   public String getLinkedVpnTunnel() {
     return linkedVpnTunnel;
   }
@@ -122,6 +136,7 @@ public static RouterInterface getDefaultInstance() {
 
   public static class Builder {
     private String ipRange;
+    private String linkedInterconnectAttachment;
     private String linkedVpnTunnel;
     private String name;
 
@@ -132,6 +147,9 @@ public Builder mergeFrom(RouterInterface other) {
       if (other.getIpRange() != null) {
         this.ipRange = other.ipRange;
       }
+      if (other.getLinkedInterconnectAttachment() != null) {
+        this.linkedInterconnectAttachment = other.linkedInterconnectAttachment;
+      }
       if (other.getLinkedVpnTunnel() != null) {
         this.linkedVpnTunnel = other.linkedVpnTunnel;
       }
@@ -143,6 +161,7 @@ public Builder mergeFrom(RouterInterface other) {
 
     Builder(RouterInterface source) {
       this.ipRange = source.ipRange;
+      this.linkedInterconnectAttachment = source.linkedInterconnectAttachment;
       this.linkedVpnTunnel = source.linkedVpnTunnel;
       this.name = source.name;
     }
@@ -156,6 +175,15 @@ public Builder setIpRange(String ipRange) {
       return this;
     }
 
+    public String getLinkedInterconnectAttachment() {
+      return linkedInterconnectAttachment;
+    }
+
+    public Builder setLinkedInterconnectAttachment(String linkedInterconnectAttachment) {
+      this.linkedInterconnectAttachment = linkedInterconnectAttachment;
+      return this;
+    }
+
     public String getLinkedVpnTunnel() {
       return linkedVpnTunnel;
     }
@@ -178,8 +206,10 @@ public Builder setName(String name) {
     public RouterInterface build() {
 
 
+
       return new RouterInterface(
         ipRange,
+        linkedInterconnectAttachment,
         linkedVpnTunnel,
         name
       );
@@ -188,6 +218,7 @@ public RouterInterface build() {
     public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setIpRange(this.ipRange);
+      newBuilder.setLinkedInterconnectAttachment(this.linkedInterconnectAttachment);
       newBuilder.setLinkedVpnTunnel(this.linkedVpnTunnel);
       newBuilder.setName(this.name);
       return newBuilder;
@@ -198,6 +229,7 @@ public Builder clone() {
   public String toString() {
     return "RouterInterface{"
         + "ipRange=" + ipRange + ", "
+        + "linkedInterconnectAttachment=" + linkedInterconnectAttachment + ", "
         + "linkedVpnTunnel=" + linkedVpnTunnel + ", "
         + "name=" + name
         + "}";
@@ -212,6 +244,7 @@ public boolean equals(Object o) {
       RouterInterface that = (RouterInterface) o;
       return
           Objects.equals(this.ipRange, that.getIpRange()) &&
+          Objects.equals(this.linkedInterconnectAttachment, that.getLinkedInterconnectAttachment()) &&
           Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel()) &&
           Objects.equals(this.name, that.getName())
           ;
@@ -223,6 +256,7 @@ public boolean equals(Object o) {
   public int hashCode() {
     return Objects.hash(
       ipRange,
+      linkedInterconnectAttachment,
       linkedVpnTunnel,
       name
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
index b15018ebd909..3ec5b4c8861e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
@@ -37,6 +37,7 @@ public final class RouterList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private RouterList() {
     this.id = null;
@@ -44,6 +45,7 @@ private RouterList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private RouterList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(RouterList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(RouterList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public RouterList build() {
 
 
 
 
+
       return new RouterList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java
index f6f7951f6409..277403c2a8a8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java
@@ -17,22 +17,26 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import javax.annotation.Generated;
 
 @Generated("by GAPIC")
 @BetaApi
-public final class RouterName implements ResourceName {
+public final class RouterName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String region;
   private final String router;
   private static final PathTemplate PATH_TEMPLATE =
-      PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}");
 
   private volatile Map fieldValuesMap;
 
@@ -50,12 +54,29 @@ private RouterName(Builder builder) {
     router = Preconditions.checkNotNull(builder.getRouter());
   }
 
-  public static RouterName of(String project, String region, String router) {
-    return newBuilder().setProject(project).setRegion(region).setRouter(router).build();
+  public static RouterName of(
+      String project,
+      String region,
+      String router
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setRouter(router)
+      .build();
   }
 
-  public static String format(String project, String region, String router) {
-    return of(project, region, router).toString();
+  public static String format(
+      String project,
+      String region,
+      String router
+      ) {
+    return of(
+        project,
+        region,
+        router
+        )
+        .toString();
   }
 
   public String getProject() {
@@ -70,6 +91,7 @@ public String getRouter() {
     return router;
   }
 
+
   @Override
   public Map getFieldValuesMap() {
     if (fieldValuesMap == null) {
@@ -90,19 +112,21 @@ public String getFieldValue(String fieldName) {
     return getFieldValuesMap().get(fieldName);
   }
 
+
   public static ResourceNameFactory newFactory() {
     return new ResourceNameFactory() {
-      public RouterName parse(String formattedString) {
-        return RouterName.parse(formattedString);
-      }
+      public RouterName parse(String formattedString) {return RouterName.parse(formattedString);}
     };
   }
 
   public static RouterName parse(String formattedString) {
     Map matchMap =
-        PATH_TEMPLATE.validatedMatch(
-            formattedString, "RouterName.parse: formattedString not in valid format");
-    return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("router"));
+        PATH_TEMPLATE.validatedMatch(formattedString, "RouterName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("router")
+    );
   }
 
   public static boolean isParsableFrom(String formattedString) {
@@ -117,11 +141,9 @@ public static class Builder {
     public String getProject() {
       return project;
     }
-
     public String getRegion() {
       return region;
     }
-
     public String getRouter() {
       return router;
     }
@@ -130,12 +152,10 @@ public Builder setProject(String project) {
       this.project = project;
       return this;
     }
-
     public Builder setRegion(String region) {
       this.region = region;
       return this;
     }
-
     public Builder setRouter(String router) {
       this.router = router;
       return this;
@@ -143,7 +163,7 @@ public Builder setRouter(String router) {
 
     private Builder() {}
 
-    public Builder(RouterName routerName) {
+    public Builder (RouterName routerName) {
       project = routerName.project;
       region = routerName.region;
       router = routerName.router;
@@ -159,7 +179,8 @@ public String toString() {
     return PATH_TEMPLATE.instantiate(
         "project", project,
         "region", region,
-        "router", router);
+        "router", router
+        );
   }
 
   @Override
@@ -169,15 +190,21 @@ public boolean equals(Object o) {
     }
     if (o instanceof RouterName) {
       RouterName that = (RouterName) o;
-      return Objects.equals(this.project, that.getProject())
-          && Objects.equals(this.region, that.getRegion())
-          && Objects.equals(this.router, that.getRouter());
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.router, that.getRouter())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(project, region, router);
+    return Objects.hash(
+      project,
+      region,
+      router
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java
index bbbbde30bb2c..3c7b249ed150 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java
@@ -33,11 +33,13 @@
 @BetaApi
 public final class RouterStatus implements ApiMessage {
   private final List bestRoutes;
+  private final List bestRoutesForRouter;
   private final List bgpPeerStatus;
   private final String network;
 
   private RouterStatus() {
     this.bestRoutes = null;
+    this.bestRoutesForRouter = null;
     this.bgpPeerStatus = null;
     this.network = null;
   }
@@ -45,10 +47,12 @@ private RouterStatus() {
 
   private RouterStatus(
       List bestRoutes,
+      List bestRoutesForRouter,
       List bgpPeerStatus,
       String network
       ) {
     this.bestRoutes = bestRoutes;
+    this.bestRoutesForRouter = bestRoutesForRouter;
     this.bgpPeerStatus = bgpPeerStatus;
     this.network = network;
   }
@@ -63,6 +67,13 @@ public Map> populateFieldsInMap(Set fieldNames) {
       }
       fieldMap.put("bestRoutes", stringList.build());
     }
+    if (fieldNames.contains("bestRoutesForRouter") && bestRoutesForRouter != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (Route item : bestRoutesForRouter) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("bestRoutesForRouter", stringList.build());
+    }
     if (fieldNames.contains("bgpPeerStatus") && bgpPeerStatus != null) {
       ImmutableList.Builder stringList = ImmutableList.builder();
       for (RouterStatusBgpPeerStatus item : bgpPeerStatus) {
@@ -81,6 +92,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("bestRoutes")) {
       return String.valueOf(bestRoutes);
     }
+    if (fieldName.equals("bestRoutesForRouter")) {
+      return String.valueOf(bestRoutesForRouter);
+    }
     if (fieldName.equals("bgpPeerStatus")) {
       return String.valueOf(bgpPeerStatus);
     }
@@ -100,6 +114,10 @@ public List getBestRoutesList() {
     return bestRoutes;
   }
 
+  public List getBestRoutesForRouterList() {
+    return bestRoutesForRouter;
+  }
+
   public List getBgpPeerStatusList() {
     return bgpPeerStatus;
   }
@@ -130,6 +148,7 @@ public static RouterStatus getDefaultInstance() {
 
   public static class Builder {
     private List bestRoutes;
+    private List bestRoutesForRouter;
     private List bgpPeerStatus;
     private String network;
 
@@ -140,6 +159,9 @@ public Builder mergeFrom(RouterStatus other) {
       if (other.getBestRoutesList() != null) {
         this.bestRoutes = other.bestRoutes;
       }
+      if (other.getBestRoutesForRouterList() != null) {
+        this.bestRoutesForRouter = other.bestRoutesForRouter;
+      }
       if (other.getBgpPeerStatusList() != null) {
         this.bgpPeerStatus = other.bgpPeerStatus;
       }
@@ -151,6 +173,7 @@ public Builder mergeFrom(RouterStatus other) {
 
     Builder(RouterStatus source) {
       this.bestRoutes = source.bestRoutes;
+      this.bestRoutesForRouter = source.bestRoutesForRouter;
       this.bgpPeerStatus = source.bgpPeerStatus;
       this.network = source.network;
     }
@@ -172,6 +195,23 @@ public Builder addBestRoutes(Route bestRoutes) {
       return this;
     }
 
+    public List getBestRoutesForRouterList() {
+      return bestRoutesForRouter;
+    }
+
+    public Builder addAllBestRoutesForRouter(List bestRoutesForRouter) {
+      if (this.bestRoutesForRouter == null) {
+        this.bestRoutesForRouter = new ArrayList<>(bestRoutesForRouter.size());
+      }
+      this.bestRoutesForRouter.addAll(bestRoutesForRouter);
+      return this;
+    }
+
+    public Builder addBestRoutesForRouter(Route bestRoutesForRouter) {
+      this.bestRoutesForRouter.add(bestRoutesForRouter);
+      return this;
+    }
+
     public List getBgpPeerStatusList() {
       return bgpPeerStatus;
     }
@@ -202,8 +242,10 @@ public Builder setNetwork(String network) {
     public RouterStatus build() {
 
 
+
       return new RouterStatus(
         bestRoutes,
+        bestRoutesForRouter,
         bgpPeerStatus,
         network
       );
@@ -212,6 +254,7 @@ public RouterStatus build() {
     public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.addAllBestRoutes(this.bestRoutes);
+      newBuilder.addAllBestRoutesForRouter(this.bestRoutesForRouter);
       newBuilder.addAllBgpPeerStatus(this.bgpPeerStatus);
       newBuilder.setNetwork(this.network);
       return newBuilder;
@@ -222,6 +265,7 @@ public Builder clone() {
   public String toString() {
     return "RouterStatus{"
         + "bestRoutes=" + bestRoutes + ", "
+        + "bestRoutesForRouter=" + bestRoutesForRouter + ", "
         + "bgpPeerStatus=" + bgpPeerStatus + ", "
         + "network=" + network
         + "}";
@@ -236,6 +280,7 @@ public boolean equals(Object o) {
       RouterStatus that = (RouterStatus) o;
       return
           Objects.equals(this.bestRoutes, that.getBestRoutesList()) &&
+          Objects.equals(this.bestRoutesForRouter, that.getBestRoutesForRouterList()) &&
           Objects.equals(this.bgpPeerStatus, that.getBgpPeerStatusList()) &&
           Objects.equals(this.network, that.getNetwork())
           ;
@@ -247,6 +292,7 @@ public boolean equals(Object o) {
   public int hashCode() {
     return Objects.hash(
       bestRoutes,
+      bestRoutesForRouter,
       bgpPeerStatus,
       network
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java
index 4753665af903..acc506b8b2bf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -43,8 +46,14 @@ private SerialPortOutput() {
     this.start = null;
   }
 
+
   private SerialPortOutput(
-      String contents, String kind, String next, String selfLink, String start) {
+      String contents,
+      String kind,
+      String next,
+      String selfLink,
+      String start
+      ) {
     this.contents = contents;
     this.kind = kind;
     this.next = next;
@@ -119,24 +128,22 @@ public String getStart() {
     return start;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(SerialPortOutput prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static SerialPortOutput getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final SerialPortOutput DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new SerialPortOutput();
   }
@@ -223,9 +230,19 @@ public Builder setStart(String start) {
       return this;
     }
 
+
     public SerialPortOutput build() {
 
-      return new SerialPortOutput(contents, kind, next, selfLink, start);
+
+
+
+      return new SerialPortOutput(
+        contents,
+        kind,
+        next,
+        selfLink,
+        start
+      );
     }
 
     public Builder clone() {
@@ -242,20 +259,11 @@ public Builder clone() {
   @Override
   public String toString() {
     return "SerialPortOutput{"
-        + "contents="
-        + contents
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "next="
-        + next
-        + ", "
-        + "selfLink="
-        + selfLink
-        + ", "
-        + "start="
-        + start
+        + "contents=" + contents + ", "
+        + "kind=" + kind + ", "
+        + "next=" + next + ", "
+        + "selfLink=" + selfLink + ", "
+        + "start=" + start
         + "}";
   }
 
@@ -266,17 +274,25 @@ public boolean equals(Object o) {
     }
     if (o instanceof SerialPortOutput) {
       SerialPortOutput that = (SerialPortOutput) o;
-      return Objects.equals(this.contents, that.getContents())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.next, that.getNext())
-          && Objects.equals(this.selfLink, that.getSelfLink())
-          && Objects.equals(this.start, that.getStart());
+      return
+          Objects.equals(this.contents, that.getContents()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.next, that.getNext()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.start, that.getStart())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(contents, kind, next, selfLink, start);
+    return Objects.hash(
+      contents,
+      kind,
+      next,
+      selfLink,
+      start
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java
index 2bc312927530..524c7faf89ab 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -39,7 +40,11 @@ private ServiceAccount() {
     this.scopes = null;
   }
 
-  private ServiceAccount(String email, List scopes) {
+
+  private ServiceAccount(
+      String email,
+      List scopes
+      ) {
     this.email = email;
     this.scopes = scopes;
   }
@@ -85,24 +90,22 @@ public List getScopesList() {
     return scopes;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(ServiceAccount prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static ServiceAccount getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final ServiceAccount DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new ServiceAccount();
   }
@@ -155,9 +158,13 @@ public Builder addScopes(String scopes) {
       return this;
     }
 
+
     public ServiceAccount build() {
 
-      return new ServiceAccount(email, scopes);
+      return new ServiceAccount(
+        email,
+        scopes
+      );
     }
 
     public Builder clone() {
@@ -170,7 +177,10 @@ public Builder clone() {
 
   @Override
   public String toString() {
-    return "ServiceAccount{" + "email=" + email + ", " + "scopes=" + scopes + "}";
+    return "ServiceAccount{"
+        + "email=" + email + ", "
+        + "scopes=" + scopes
+        + "}";
   }
 
   @Override
@@ -180,14 +190,19 @@ public boolean equals(Object o) {
     }
     if (o instanceof ServiceAccount) {
       ServiceAccount that = (ServiceAccount) o;
-      return Objects.equals(this.email, that.getEmail())
-          && Objects.equals(this.scopes, that.getScopesList());
+      return
+          Objects.equals(this.email, that.getEmail()) &&
+          Objects.equals(this.scopes, that.getScopesList())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(email, scopes);
+    return Objects.hash(
+      email,
+      scopes
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java
index 871263aa8005..17ec22b5485a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class SetBackendServiceTargetSslProxyHttpRequest implements ApiMess
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource;
   private final String targetSslProxy;
   private final String userIp;
@@ -49,6 +50,7 @@ private SetBackendServiceTargetSslProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetSslProxiesSetBackendServiceRequestResource = null;
     this.targetSslProxy = null;
     this.userIp = null;
@@ -62,6 +64,7 @@ private SetBackendServiceTargetSslProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource,
       String targetSslProxy,
       String userIp
@@ -72,6 +75,7 @@ private SetBackendServiceTargetSslProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetSslProxiesSetBackendServiceRequestResource = targetSslProxiesSetBackendServiceRequestResource;
     this.targetSslProxy = targetSslProxy;
     this.userIp = userIp;
@@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource") && targetSslProxiesSetBackendServiceRequestResource != null) {
       fieldMap.put("targetSslProxiesSetBackendServiceRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetBackendServiceRequestResource)));
     }
@@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetSslProxiesSetBackendServiceRequestResource")) {
       return String.valueOf(targetSslProxiesSetBackendServiceRequestResource);
     }
@@ -172,6 +182,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public TargetSslProxiesSetBackendServiceRequest getTargetSslProxiesSetBackendServiceRequestResource() {
     return targetSslProxiesSetBackendServiceRequestResource;
   }
@@ -211,6 +225,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource;
     private String targetSslProxy;
     private String userIp;
@@ -237,6 +252,9 @@ public Builder mergeFrom(SetBackendServiceTargetSslProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetSslProxiesSetBackendServiceRequestResource() != null) {
         this.targetSslProxiesSetBackendServiceRequestResource = other.targetSslProxiesSetBackendServiceRequestResource;
       }
@@ -256,6 +274,7 @@ public Builder mergeFrom(SetBackendServiceTargetSslProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetSslProxiesSetBackendServiceRequestResource = source.targetSslProxiesSetBackendServiceRequestResource;
       this.targetSslProxy = source.targetSslProxy;
       this.userIp = source.userIp;
@@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public TargetSslProxiesSetBackendServiceRequest getTargetSslProxiesSetBackendServiceRequestResource() {
       return targetSslProxiesSetBackendServiceRequestResource;
     }
@@ -352,6 +380,7 @@ public SetBackendServiceTargetSslProxyHttpRequest build() {
 
 
 
+
       if (targetSslProxy == null) {
         missing += " targetSslProxy";
       }
@@ -366,6 +395,7 @@ public SetBackendServiceTargetSslProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetSslProxiesSetBackendServiceRequestResource,
         targetSslProxy,
         userIp
@@ -380,6 +410,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetSslProxiesSetBackendServiceRequestResource(this.targetSslProxiesSetBackendServiceRequestResource);
       newBuilder.setTargetSslProxy(this.targetSslProxy);
       newBuilder.setUserIp(this.userIp);
@@ -396,6 +427,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetSslProxiesSetBackendServiceRequestResource=" + targetSslProxiesSetBackendServiceRequestResource + ", "
         + "targetSslProxy=" + targetSslProxy + ", "
         + "userIp=" + userIp
@@ -416,6 +448,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetSslProxiesSetBackendServiceRequestResource, that.getTargetSslProxiesSetBackendServiceRequestResource()) &&
           Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
@@ -433,6 +466,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetSslProxiesSetBackendServiceRequestResource,
       targetSslProxy,
       userIp
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java
new file mode 100644
index 000000000000..5d0b6a0691c4
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetBackendServiceTargetTcpProxyHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource;
+  private final String targetTcpProxy;
+  private final String userIp;
+
+  private SetBackendServiceTargetTcpProxyHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.targetTcpProxiesSetBackendServiceRequestResource = null;
+    this.targetTcpProxy = null;
+    this.userIp = null;
+  }
+
+
+  private SetBackendServiceTargetTcpProxyHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource,
+      String targetTcpProxy,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.targetTcpProxiesSetBackendServiceRequestResource = targetTcpProxiesSetBackendServiceRequestResource;
+    this.targetTcpProxy = targetTcpProxy;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("targetTcpProxiesSetBackendServiceRequestResource") && targetTcpProxiesSetBackendServiceRequestResource != null) {
+      fieldMap.put("targetTcpProxiesSetBackendServiceRequestResource", Collections.singletonList(String.valueOf(targetTcpProxiesSetBackendServiceRequestResource)));
+    }
+    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
+      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("targetTcpProxiesSetBackendServiceRequestResource")) {
+      return String.valueOf(targetTcpProxiesSetBackendServiceRequestResource);
+    }
+    if (fieldName.equals("targetTcpProxy")) {
+      return String.valueOf(targetTcpProxy);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public TargetTcpProxiesSetBackendServiceRequest getApiMessageRequestBody() {
+    return targetTcpProxiesSetBackendServiceRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public TargetTcpProxiesSetBackendServiceRequest getTargetTcpProxiesSetBackendServiceRequestResource() {
+    return targetTcpProxiesSetBackendServiceRequestResource;
+  }
+
+  public String getTargetTcpProxy() {
+    return targetTcpProxy;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetBackendServiceTargetTcpProxyHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetBackendServiceTargetTcpProxyHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetBackendServiceTargetTcpProxyHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetBackendServiceTargetTcpProxyHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource;
+    private String targetTcpProxy;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetBackendServiceTargetTcpProxyHttpRequest other) {
+      if (other == SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getTargetTcpProxiesSetBackendServiceRequestResource() != null) {
+        this.targetTcpProxiesSetBackendServiceRequestResource = other.targetTcpProxiesSetBackendServiceRequestResource;
+      }
+      if (other.getTargetTcpProxy() != null) {
+        this.targetTcpProxy = other.targetTcpProxy;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetBackendServiceTargetTcpProxyHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.targetTcpProxiesSetBackendServiceRequestResource = source.targetTcpProxiesSetBackendServiceRequestResource;
+      this.targetTcpProxy = source.targetTcpProxy;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public TargetTcpProxiesSetBackendServiceRequest getTargetTcpProxiesSetBackendServiceRequestResource() {
+      return targetTcpProxiesSetBackendServiceRequestResource;
+    }
+
+    public Builder setTargetTcpProxiesSetBackendServiceRequestResource(TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) {
+      this.targetTcpProxiesSetBackendServiceRequestResource = targetTcpProxiesSetBackendServiceRequestResource;
+      return this;
+    }
+
+    public String getTargetTcpProxy() {
+      return targetTcpProxy;
+    }
+
+    public Builder setTargetTcpProxy(String targetTcpProxy) {
+      this.targetTcpProxy = targetTcpProxy;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetBackendServiceTargetTcpProxyHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+
+      if (targetTcpProxy == null) {
+        missing += " targetTcpProxy";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetBackendServiceTargetTcpProxyHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        targetTcpProxiesSetBackendServiceRequestResource,
+        targetTcpProxy,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setTargetTcpProxiesSetBackendServiceRequestResource(this.targetTcpProxiesSetBackendServiceRequestResource);
+      newBuilder.setTargetTcpProxy(this.targetTcpProxy);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetBackendServiceTargetTcpProxyHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "targetTcpProxiesSetBackendServiceRequestResource=" + targetTcpProxiesSetBackendServiceRequestResource + ", "
+        + "targetTcpProxy=" + targetTcpProxy + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetBackendServiceTargetTcpProxyHttpRequest) {
+      SetBackendServiceTargetTcpProxyHttpRequest that = (SetBackendServiceTargetTcpProxyHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.targetTcpProxiesSetBackendServiceRequestResource, that.getTargetTcpProxiesSetBackendServiceRequestResource()) &&
+          Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      targetTcpProxiesSetBackendServiceRequestResource,
+      targetTcpProxy,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java
index 4ec8f2304341..f4e3872d5789 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,6 +39,7 @@ public final class SetBackupTargetPoolHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetPool;
   private final TargetReference targetReferenceResource;
   private final String userIp;
@@ -48,11 +52,13 @@ private SetBackupTargetPoolHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetPool = null;
     this.targetReferenceResource = null;
     this.userIp = null;
   }
 
+
   private SetBackupTargetPoolHttpRequest(
       String access_token,
       String callback,
@@ -61,9 +67,11 @@ private SetBackupTargetPoolHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetPool,
       TargetReference targetReferenceResource,
-      String userIp) {
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.failoverRatio = failoverRatio;
@@ -71,6 +79,7 @@ private SetBackupTargetPoolHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetPool = targetPool;
     this.targetReferenceResource = targetReferenceResource;
     this.userIp = userIp;
@@ -100,13 +109,14 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetPool") && targetPool != null) {
       fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
     }
     if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) {
-      fieldMap.put(
-          "targetReferenceResource",
-          Collections.singletonList(String.valueOf(targetReferenceResource)));
+      fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource)));
     }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
@@ -137,6 +147,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetPool")) {
       return String.valueOf(targetPool);
     }
@@ -183,6 +196,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetPool() {
     return targetPool;
   }
@@ -195,24 +212,22 @@ public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(SetBackupTargetPoolHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static SetBackupTargetPoolHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final SetBackupTargetPoolHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new SetBackupTargetPoolHttpRequest();
   }
@@ -225,6 +240,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetPool;
     private TargetReference targetReferenceResource;
     private String userIp;
@@ -254,6 +270,9 @@ public Builder mergeFrom(SetBackupTargetPoolHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetPool() != null) {
         this.targetPool = other.targetPool;
       }
@@ -274,6 +293,7 @@ public Builder mergeFrom(SetBackupTargetPoolHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetPool = source.targetPool;
       this.targetReferenceResource = source.targetReferenceResource;
       this.userIp = source.userIp;
@@ -342,6 +362,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetPool() {
       return targetPool;
     }
@@ -369,27 +398,38 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public SetBackupTargetPoolHttpRequest build() {
       String missing = "";
 
+
+
+
+
+
+
+
       if (targetPool == null) {
         missing += " targetPool";
       }
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new SetBackupTargetPoolHttpRequest(
-          access_token,
-          callback,
-          failoverRatio,
-          fields,
-          key,
-          prettyPrint,
-          quotaUser,
-          targetPool,
-          targetReferenceResource,
-          userIp);
+        access_token,
+        callback,
+        failoverRatio,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        targetPool,
+        targetReferenceResource,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -401,6 +441,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetPool(this.targetPool);
       newBuilder.setTargetReferenceResource(this.targetReferenceResource);
       newBuilder.setUserIp(this.userIp);
@@ -411,35 +452,17 @@ public Builder clone() {
   @Override
   public String toString() {
     return "SetBackupTargetPoolHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "failoverRatio="
-        + failoverRatio
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "targetPool="
-        + targetPool
-        + ", "
-        + "targetReferenceResource="
-        + targetReferenceResource
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "failoverRatio=" + failoverRatio + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "targetPool=" + targetPool + ", "
+        + "targetReferenceResource=" + targetReferenceResource + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -450,16 +473,19 @@ public boolean equals(Object o) {
     }
     if (o instanceof SetBackupTargetPoolHttpRequest) {
       SetBackupTargetPoolHttpRequest that = (SetBackupTargetPoolHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.failoverRatio, that.getFailoverRatio())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.targetPool, that.getTargetPool())
-          && Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.failoverRatio, that.getFailoverRatio()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.targetPool, that.getTargetPool()) &&
+          Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -467,15 +493,17 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token,
-        callback,
-        failoverRatio,
-        fields,
-        key,
-        prettyPrint,
-        quotaUser,
-        targetPool,
-        targetReferenceResource,
-        userIp);
+      access_token,
+      callback,
+      failoverRatio,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      targetPool,
+      targetReferenceResource,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java
index c39ec922033b..8a0eb0096ab6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetCommonInstanceMetadataProjectHttpRequest implements ApiMes
   private final String prettyPrint;
   private final String project;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetCommonInstanceMetadataProjectHttpRequest() {
@@ -51,6 +52,7 @@ private SetCommonInstanceMetadataProjectHttpRequest() {
     this.prettyPrint = null;
     this.project = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetCommonInstanceMetadataProjectHttpRequest(
       String prettyPrint,
       String project,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetCommonInstanceMetadataProjectHttpRequest(
     this.prettyPrint = prettyPrint;
     this.project = project;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String prettyPrint;
     private String project;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetCommonInstanceMetadataProjectHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetCommonInstanceMetadataProjectHttpRequest other) {
       this.prettyPrint = source.prettyPrint;
       this.project = source.project;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetCommonInstanceMetadataProjectHttpRequest build() {
       }
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetCommonInstanceMetadataProjectHttpRequest build() {
         prettyPrint,
         project,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setProject(this.project);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "prettyPrint=" + prettyPrint + ", "
         + "project=" + project + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.project, that.getProject()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       prettyPrint,
       project,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java
new file mode 100644
index 000000000000..942e68fe848a
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetDeletionProtectionInstanceHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final Boolean deletionProtection;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String resource;
+  private final String userIp;
+
+  private SetDeletionProtectionInstanceHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.deletionProtection = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.resource = null;
+    this.userIp = null;
+  }
+
+
+  private SetDeletionProtectionInstanceHttpRequest(
+      String access_token,
+      String callback,
+      Boolean deletionProtection,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String resource,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.deletionProtection = deletionProtection;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.resource = resource;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("deletionProtection") && deletionProtection != null) {
+      fieldMap.put("deletionProtection", Collections.singletonList(String.valueOf(deletionProtection)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("resource") && resource != null) {
+      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("deletionProtection")) {
+      return String.valueOf(deletionProtection);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("resource")) {
+      return String.valueOf(resource);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public Boolean getDeletionProtection() {
+    return deletionProtection;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetDeletionProtectionInstanceHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetDeletionProtectionInstanceHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetDeletionProtectionInstanceHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetDeletionProtectionInstanceHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private Boolean deletionProtection;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String resource;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetDeletionProtectionInstanceHttpRequest other) {
+      if (other == SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getDeletionProtection() != null) {
+        this.deletionProtection = other.deletionProtection;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getResource() != null) {
+        this.resource = other.resource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetDeletionProtectionInstanceHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.deletionProtection = source.deletionProtection;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.resource = source.resource;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public Boolean getDeletionProtection() {
+      return deletionProtection;
+    }
+
+    public Builder setDeletionProtection(Boolean deletionProtection) {
+      this.deletionProtection = deletionProtection;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getResource() {
+      return resource;
+    }
+
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetDeletionProtectionInstanceHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+
+      if (resource == null) {
+        missing += " resource";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetDeletionProtectionInstanceHttpRequest(
+        access_token,
+        callback,
+        deletionProtection,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        resource,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setDeletionProtection(this.deletionProtection);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setResource(this.resource);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetDeletionProtectionInstanceHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "deletionProtection=" + deletionProtection + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "resource=" + resource + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetDeletionProtectionInstanceHttpRequest) {
+      SetDeletionProtectionInstanceHttpRequest that = (SetDeletionProtectionInstanceHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.deletionProtection, that.getDeletionProtection()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.resource, that.getResource()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      deletionProtection,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      resource,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java
index f177ee3810b9..2065de1fe2c0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java
@@ -41,6 +41,7 @@ public final class SetDiskAutoDeleteInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetDiskAutoDeleteInstanceHttpRequest() {
@@ -53,6 +54,7 @@ private SetDiskAutoDeleteInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -67,6 +69,7 @@ private SetDiskAutoDeleteInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -78,6 +81,7 @@ private SetDiskAutoDeleteInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -111,6 +115,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -146,6 +153,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -194,6 +204,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -228,6 +242,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -261,6 +276,9 @@ public Builder mergeFrom(SetDiskAutoDeleteInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -277,6 +295,7 @@ public Builder mergeFrom(SetDiskAutoDeleteInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -361,6 +380,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -389,6 +417,7 @@ public SetDiskAutoDeleteInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -402,6 +431,7 @@ public SetDiskAutoDeleteInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -417,6 +447,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -434,6 +465,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -455,6 +487,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -473,6 +506,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java
index 40b119a599ae..f3743332b447 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetInstanceTemplateInstanceGroupManagerHttpRequest implements
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetInstanceTemplateInstanceGroupManagerHttpRequest() {
@@ -51,6 +52,7 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetInstanceTemplateInstanceGroupManagerHttpRequest othe
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetInstanceTemplateInstanceGroupManagerHttpRequest othe
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetInstanceTemplateInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetInstanceTemplateInstanceGroupManagerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java
index b795769afdd6..827919040348 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetInstanceTemplateRegionInstanceGroupManagerHttpRequest impl
   private final String prettyPrint;
   private final String quotaUser;
   private final RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource;
+  private final String requestId;
   private final String userIp;
 
   private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest() {
@@ -51,6 +52,7 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest() {
     this.prettyPrint = null;
     this.quotaUser = null;
     this.regionInstanceGroupManagersSetTemplateRequestResource = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest(
       String prettyPrint,
       String quotaUser,
       RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest(
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
     this.regionInstanceGroupManagersSetTemplateRequestResource = regionInstanceGroupManagersSetTemplateRequestResource;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource") && regionInstanceGroupManagersSetTemplateRequestResource != null) {
       fieldMap.put("regionInstanceGroupManagersSetTemplateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("regionInstanceGroupManagersSetTemplateRequestResource")) {
       return String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public RegionInstanceGroupManagersSetTemplateRequest getRegionInstanceGroupManag
     return regionInstanceGroupManagersSetTemplateRequestResource;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String prettyPrint;
     private String quotaUser;
     private RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetInstanceTemplateRegionInstanceGroupManagerHttpReques
       if (other.getRegionInstanceGroupManagersSetTemplateRequestResource() != null) {
         this.regionInstanceGroupManagersSetTemplateRequestResource = other.regionInstanceGroupManagersSetTemplateRequestResource;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetInstanceTemplateRegionInstanceGroupManagerHttpReques
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
       this.regionInstanceGroupManagersSetTemplateRequestResource = source.regionInstanceGroupManagersSetTemplateRequestResource;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setRegionInstanceGroupManagersSetTemplateRequestResource(RegionIn
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetInstanceTemplateRegionInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetInstanceTemplateRegionInstanceGroupManagerHttpRequest build() {
         prettyPrint,
         quotaUser,
         regionInstanceGroupManagersSetTemplateRequestResource,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
       newBuilder.setRegionInstanceGroupManagersSetTemplateRequestResource(this.regionInstanceGroupManagersSetTemplateRequestResource);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
         + "regionInstanceGroupManagersSetTemplateRequestResource=" + regionInstanceGroupManagersSetTemplateRequestResource + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
           Objects.equals(this.regionInstanceGroupManagersSetTemplateRequestResource, that.getRegionInstanceGroupManagersSetTemplateRequestResource()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       prettyPrint,
       quotaUser,
       regionInstanceGroupManagersSetTemplateRequestResource,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java
new file mode 100644
index 000000000000..072b74b6024a
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetLabelsDiskHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String resource;
+  private final String userIp;
+  private final ZoneSetLabelsRequest zoneSetLabelsRequestResource;
+
+  private SetLabelsDiskHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.resource = null;
+    this.userIp = null;
+    this.zoneSetLabelsRequestResource = null;
+  }
+
+
+  private SetLabelsDiskHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String resource,
+      String userIp,
+      ZoneSetLabelsRequest zoneSetLabelsRequestResource
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.resource = resource;
+    this.userIp = userIp;
+    this.zoneSetLabelsRequestResource = zoneSetLabelsRequestResource;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("resource") && resource != null) {
+      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    if (fieldNames.contains("zoneSetLabelsRequestResource") && zoneSetLabelsRequestResource != null) {
+      fieldMap.put("zoneSetLabelsRequestResource", Collections.singletonList(String.valueOf(zoneSetLabelsRequestResource)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("resource")) {
+      return String.valueOf(resource);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    if (fieldName.equals("zoneSetLabelsRequestResource")) {
+      return String.valueOf(zoneSetLabelsRequestResource);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ZoneSetLabelsRequest getApiMessageRequestBody() {
+    return zoneSetLabelsRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public ZoneSetLabelsRequest getZoneSetLabelsRequestResource() {
+    return zoneSetLabelsRequestResource;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetLabelsDiskHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetLabelsDiskHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetLabelsDiskHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetLabelsDiskHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String resource;
+    private String userIp;
+    private ZoneSetLabelsRequest zoneSetLabelsRequestResource;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetLabelsDiskHttpRequest other) {
+      if (other == SetLabelsDiskHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getResource() != null) {
+        this.resource = other.resource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      if (other.getZoneSetLabelsRequestResource() != null) {
+        this.zoneSetLabelsRequestResource = other.zoneSetLabelsRequestResource;
+      }
+      return this;
+    }
+
+    Builder(SetLabelsDiskHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.resource = source.resource;
+      this.userIp = source.userIp;
+      this.zoneSetLabelsRequestResource = source.zoneSetLabelsRequestResource;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getResource() {
+      return resource;
+    }
+
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public ZoneSetLabelsRequest getZoneSetLabelsRequestResource() {
+      return zoneSetLabelsRequestResource;
+    }
+
+    public Builder setZoneSetLabelsRequestResource(ZoneSetLabelsRequest zoneSetLabelsRequestResource) {
+      this.zoneSetLabelsRequestResource = zoneSetLabelsRequestResource;
+      return this;
+    }
+
+
+    public SetLabelsDiskHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+      if (resource == null) {
+        missing += " resource";
+      }
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetLabelsDiskHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        resource,
+        userIp,
+        zoneSetLabelsRequestResource
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setResource(this.resource);
+      newBuilder.setUserIp(this.userIp);
+      newBuilder.setZoneSetLabelsRequestResource(this.zoneSetLabelsRequestResource);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetLabelsDiskHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "resource=" + resource + ", "
+        + "userIp=" + userIp + ", "
+        + "zoneSetLabelsRequestResource=" + zoneSetLabelsRequestResource
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetLabelsDiskHttpRequest) {
+      SetLabelsDiskHttpRequest that = (SetLabelsDiskHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.resource, that.getResource()) &&
+          Objects.equals(this.userIp, that.getUserIp()) &&
+          Objects.equals(this.zoneSetLabelsRequestResource, that.getZoneSetLabelsRequestResource())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      resource,
+      userIp,
+      zoneSetLabelsRequestResource
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java
new file mode 100644
index 000000000000..e61b64dbeb14
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetLabelsImageHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final GlobalSetLabelsRequest globalSetLabelsRequestResource;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String resource;
+  private final String userIp;
+
+  private SetLabelsImageHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.globalSetLabelsRequestResource = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.resource = null;
+    this.userIp = null;
+  }
+
+
+  private SetLabelsImageHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      GlobalSetLabelsRequest globalSetLabelsRequestResource,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String resource,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.globalSetLabelsRequestResource = globalSetLabelsRequestResource;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.resource = resource;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("globalSetLabelsRequestResource") && globalSetLabelsRequestResource != null) {
+      fieldMap.put("globalSetLabelsRequestResource", Collections.singletonList(String.valueOf(globalSetLabelsRequestResource)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("resource") && resource != null) {
+      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("globalSetLabelsRequestResource")) {
+      return String.valueOf(globalSetLabelsRequestResource);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("resource")) {
+      return String.valueOf(resource);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public GlobalSetLabelsRequest getApiMessageRequestBody() {
+    return globalSetLabelsRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public GlobalSetLabelsRequest getGlobalSetLabelsRequestResource() {
+    return globalSetLabelsRequestResource;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetLabelsImageHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetLabelsImageHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetLabelsImageHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetLabelsImageHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private GlobalSetLabelsRequest globalSetLabelsRequestResource;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String resource;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetLabelsImageHttpRequest other) {
+      if (other == SetLabelsImageHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getGlobalSetLabelsRequestResource() != null) {
+        this.globalSetLabelsRequestResource = other.globalSetLabelsRequestResource;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getResource() != null) {
+        this.resource = other.resource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetLabelsImageHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.globalSetLabelsRequestResource = source.globalSetLabelsRequestResource;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.resource = source.resource;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public GlobalSetLabelsRequest getGlobalSetLabelsRequestResource() {
+      return globalSetLabelsRequestResource;
+    }
+
+    public Builder setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest globalSetLabelsRequestResource) {
+      this.globalSetLabelsRequestResource = globalSetLabelsRequestResource;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getResource() {
+      return resource;
+    }
+
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetLabelsImageHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+      if (resource == null) {
+        missing += " resource";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetLabelsImageHttpRequest(
+        access_token,
+        callback,
+        fields,
+        globalSetLabelsRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        resource,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setGlobalSetLabelsRequestResource(this.globalSetLabelsRequestResource);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setResource(this.resource);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetLabelsImageHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "globalSetLabelsRequestResource=" + globalSetLabelsRequestResource + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "resource=" + resource + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetLabelsImageHttpRequest) {
+      SetLabelsImageHttpRequest that = (SetLabelsImageHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.globalSetLabelsRequestResource, that.getGlobalSetLabelsRequestResource()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.resource, that.getResource()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      globalSetLabelsRequestResource,
+      key,
+      prettyPrint,
+      quotaUser,
+      resource,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java
new file mode 100644
index 000000000000..6441e7169605
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetLabelsInstanceHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String instance;
+  private final InstancesSetLabelsRequest instancesSetLabelsRequestResource;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private SetLabelsInstanceHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.instance = null;
+    this.instancesSetLabelsRequestResource = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private SetLabelsInstanceHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String instance,
+      InstancesSetLabelsRequest instancesSetLabelsRequestResource,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.instance = instance;
+    this.instancesSetLabelsRequestResource = instancesSetLabelsRequestResource;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("instance") && instance != null) {
+      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
+    }
+    if (fieldNames.contains("instancesSetLabelsRequestResource") && instancesSetLabelsRequestResource != null) {
+      fieldMap.put("instancesSetLabelsRequestResource", Collections.singletonList(String.valueOf(instancesSetLabelsRequestResource)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("instance")) {
+      return String.valueOf(instance);
+    }
+    if (fieldName.equals("instancesSetLabelsRequestResource")) {
+      return String.valueOf(instancesSetLabelsRequestResource);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public InstancesSetLabelsRequest getApiMessageRequestBody() {
+    return instancesSetLabelsRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInstance() {
+    return instance;
+  }
+
+  public InstancesSetLabelsRequest getInstancesSetLabelsRequestResource() {
+    return instancesSetLabelsRequestResource;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetLabelsInstanceHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetLabelsInstanceHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetLabelsInstanceHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetLabelsInstanceHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String instance;
+    private InstancesSetLabelsRequest instancesSetLabelsRequestResource;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetLabelsInstanceHttpRequest other) {
+      if (other == SetLabelsInstanceHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInstance() != null) {
+        this.instance = other.instance;
+      }
+      if (other.getInstancesSetLabelsRequestResource() != null) {
+        this.instancesSetLabelsRequestResource = other.instancesSetLabelsRequestResource;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetLabelsInstanceHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.instance = source.instance;
+      this.instancesSetLabelsRequestResource = source.instancesSetLabelsRequestResource;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInstance() {
+      return instance;
+    }
+
+    public Builder setInstance(String instance) {
+      this.instance = instance;
+      return this;
+    }
+
+    public InstancesSetLabelsRequest getInstancesSetLabelsRequestResource() {
+      return instancesSetLabelsRequestResource;
+    }
+
+    public Builder setInstancesSetLabelsRequestResource(InstancesSetLabelsRequest instancesSetLabelsRequestResource) {
+      this.instancesSetLabelsRequestResource = instancesSetLabelsRequestResource;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetLabelsInstanceHttpRequest build() {
+      String missing = "";
+
+
+
+      if (instance == null) {
+        missing += " instance";
+      }
+
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetLabelsInstanceHttpRequest(
+        access_token,
+        callback,
+        fields,
+        instance,
+        instancesSetLabelsRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInstance(this.instance);
+      newBuilder.setInstancesSetLabelsRequestResource(this.instancesSetLabelsRequestResource);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetLabelsInstanceHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instance=" + instance + ", "
+        + "instancesSetLabelsRequestResource=" + instancesSetLabelsRequestResource + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetLabelsInstanceHttpRequest) {
+      SetLabelsInstanceHttpRequest that = (SetLabelsInstanceHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instance, that.getInstance()) &&
+          Objects.equals(this.instancesSetLabelsRequestResource, that.getInstancesSetLabelsRequestResource()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      instance,
+      instancesSetLabelsRequestResource,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java
new file mode 100644
index 000000000000..04dfa5cc1712
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java
@@ -0,0 +1,441 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetLabelsSnapshotHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final GlobalSetLabelsRequest globalSetLabelsRequestResource;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String resource;
+  private final String userIp;
+
+  private SetLabelsSnapshotHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.globalSetLabelsRequestResource = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.resource = null;
+    this.userIp = null;
+  }
+
+
+  private SetLabelsSnapshotHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      GlobalSetLabelsRequest globalSetLabelsRequestResource,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String resource,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.globalSetLabelsRequestResource = globalSetLabelsRequestResource;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.resource = resource;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("globalSetLabelsRequestResource") && globalSetLabelsRequestResource != null) {
+      fieldMap.put("globalSetLabelsRequestResource", Collections.singletonList(String.valueOf(globalSetLabelsRequestResource)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("resource") && resource != null) {
+      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("globalSetLabelsRequestResource")) {
+      return String.valueOf(globalSetLabelsRequestResource);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("resource")) {
+      return String.valueOf(resource);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public GlobalSetLabelsRequest getApiMessageRequestBody() {
+    return globalSetLabelsRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public GlobalSetLabelsRequest getGlobalSetLabelsRequestResource() {
+    return globalSetLabelsRequestResource;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetLabelsSnapshotHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetLabelsSnapshotHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetLabelsSnapshotHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetLabelsSnapshotHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private GlobalSetLabelsRequest globalSetLabelsRequestResource;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String resource;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetLabelsSnapshotHttpRequest other) {
+      if (other == SetLabelsSnapshotHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getGlobalSetLabelsRequestResource() != null) {
+        this.globalSetLabelsRequestResource = other.globalSetLabelsRequestResource;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getResource() != null) {
+        this.resource = other.resource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetLabelsSnapshotHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.globalSetLabelsRequestResource = source.globalSetLabelsRequestResource;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.resource = source.resource;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public GlobalSetLabelsRequest getGlobalSetLabelsRequestResource() {
+      return globalSetLabelsRequestResource;
+    }
+
+    public Builder setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest globalSetLabelsRequestResource) {
+      this.globalSetLabelsRequestResource = globalSetLabelsRequestResource;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getResource() {
+      return resource;
+    }
+
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetLabelsSnapshotHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+      if (resource == null) {
+        missing += " resource";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetLabelsSnapshotHttpRequest(
+        access_token,
+        callback,
+        fields,
+        globalSetLabelsRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        resource,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setGlobalSetLabelsRequestResource(this.globalSetLabelsRequestResource);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setResource(this.resource);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetLabelsSnapshotHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "globalSetLabelsRequestResource=" + globalSetLabelsRequestResource + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "resource=" + resource + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetLabelsSnapshotHttpRequest) {
+      SetLabelsSnapshotHttpRequest that = (SetLabelsSnapshotHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.globalSetLabelsRequestResource, that.getGlobalSetLabelsRequestResource()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.resource, that.getResource()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      globalSetLabelsRequestResource,
+      key,
+      prettyPrint,
+      quotaUser,
+      resource,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java
new file mode 100644
index 000000000000..052ae71d7fbc
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetMachineResourcesInstanceHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String instance;
+  private final InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private SetMachineResourcesInstanceHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.instance = null;
+    this.instancesSetMachineResourcesRequestResource = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private SetMachineResourcesInstanceHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String instance,
+      InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.instance = instance;
+    this.instancesSetMachineResourcesRequestResource = instancesSetMachineResourcesRequestResource;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("instance") && instance != null) {
+      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
+    }
+    if (fieldNames.contains("instancesSetMachineResourcesRequestResource") && instancesSetMachineResourcesRequestResource != null) {
+      fieldMap.put("instancesSetMachineResourcesRequestResource", Collections.singletonList(String.valueOf(instancesSetMachineResourcesRequestResource)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("instance")) {
+      return String.valueOf(instance);
+    }
+    if (fieldName.equals("instancesSetMachineResourcesRequestResource")) {
+      return String.valueOf(instancesSetMachineResourcesRequestResource);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public InstancesSetMachineResourcesRequest getApiMessageRequestBody() {
+    return instancesSetMachineResourcesRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInstance() {
+    return instance;
+  }
+
+  public InstancesSetMachineResourcesRequest getInstancesSetMachineResourcesRequestResource() {
+    return instancesSetMachineResourcesRequestResource;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetMachineResourcesInstanceHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetMachineResourcesInstanceHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetMachineResourcesInstanceHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetMachineResourcesInstanceHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String instance;
+    private InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetMachineResourcesInstanceHttpRequest other) {
+      if (other == SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInstance() != null) {
+        this.instance = other.instance;
+      }
+      if (other.getInstancesSetMachineResourcesRequestResource() != null) {
+        this.instancesSetMachineResourcesRequestResource = other.instancesSetMachineResourcesRequestResource;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetMachineResourcesInstanceHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.instance = source.instance;
+      this.instancesSetMachineResourcesRequestResource = source.instancesSetMachineResourcesRequestResource;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInstance() {
+      return instance;
+    }
+
+    public Builder setInstance(String instance) {
+      this.instance = instance;
+      return this;
+    }
+
+    public InstancesSetMachineResourcesRequest getInstancesSetMachineResourcesRequestResource() {
+      return instancesSetMachineResourcesRequestResource;
+    }
+
+    public Builder setInstancesSetMachineResourcesRequestResource(InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) {
+      this.instancesSetMachineResourcesRequestResource = instancesSetMachineResourcesRequestResource;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetMachineResourcesInstanceHttpRequest build() {
+      String missing = "";
+
+
+
+      if (instance == null) {
+        missing += " instance";
+      }
+
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetMachineResourcesInstanceHttpRequest(
+        access_token,
+        callback,
+        fields,
+        instance,
+        instancesSetMachineResourcesRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInstance(this.instance);
+      newBuilder.setInstancesSetMachineResourcesRequestResource(this.instancesSetMachineResourcesRequestResource);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetMachineResourcesInstanceHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instance=" + instance + ", "
+        + "instancesSetMachineResourcesRequestResource=" + instancesSetMachineResourcesRequestResource + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetMachineResourcesInstanceHttpRequest) {
+      SetMachineResourcesInstanceHttpRequest that = (SetMachineResourcesInstanceHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instance, that.getInstance()) &&
+          Objects.equals(this.instancesSetMachineResourcesRequestResource, that.getInstancesSetMachineResourcesRequestResource()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      instance,
+      instancesSetMachineResourcesRequestResource,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java
index 19e1597c4278..8da9b084dc2f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetMachineTypeInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetMachineTypeInstanceHttpRequest() {
@@ -51,6 +52,7 @@ private SetMachineTypeInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetMachineTypeInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetMachineTypeInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetMachineTypeInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetMachineTypeInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetMachineTypeInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetMachineTypeInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java
index 963c3d39d7e2..daa40e8beb1d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetMetadataInstanceHttpRequest implements ApiMessage {
   private final Metadata metadataResource;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetMetadataInstanceHttpRequest() {
@@ -51,6 +52,7 @@ private SetMetadataInstanceHttpRequest() {
     this.metadataResource = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetMetadataInstanceHttpRequest(
       Metadata metadataResource,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetMetadataInstanceHttpRequest(
     this.metadataResource = metadataResource;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private Metadata metadataResource;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetMetadataInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetMetadataInstanceHttpRequest other) {
       this.metadataResource = source.metadataResource;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetMetadataInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetMetadataInstanceHttpRequest build() {
         metadataResource,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setMetadataResource(this.metadataResource);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "metadataResource=" + metadataResource + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.metadataResource, that.getMetadataResource()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       metadataResource,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java
new file mode 100644
index 000000000000..2210c0a292bd
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetMinCpuPlatformInstanceHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String instance;
+  private final InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private SetMinCpuPlatformInstanceHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.instance = null;
+    this.instancesSetMinCpuPlatformRequestResource = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+
+  private SetMinCpuPlatformInstanceHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String instance,
+      InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.instance = instance;
+    this.instancesSetMinCpuPlatformRequestResource = instancesSetMinCpuPlatformRequestResource;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("instance") && instance != null) {
+      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
+    }
+    if (fieldNames.contains("instancesSetMinCpuPlatformRequestResource") && instancesSetMinCpuPlatformRequestResource != null) {
+      fieldMap.put("instancesSetMinCpuPlatformRequestResource", Collections.singletonList(String.valueOf(instancesSetMinCpuPlatformRequestResource)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("instance")) {
+      return String.valueOf(instance);
+    }
+    if (fieldName.equals("instancesSetMinCpuPlatformRequestResource")) {
+      return String.valueOf(instancesSetMinCpuPlatformRequestResource);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public InstancesSetMinCpuPlatformRequest getApiMessageRequestBody() {
+    return instancesSetMinCpuPlatformRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getInstance() {
+    return instance;
+  }
+
+  public InstancesSetMinCpuPlatformRequest getInstancesSetMinCpuPlatformRequestResource() {
+    return instancesSetMinCpuPlatformRequestResource;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetMinCpuPlatformInstanceHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetMinCpuPlatformInstanceHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetMinCpuPlatformInstanceHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetMinCpuPlatformInstanceHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String instance;
+    private InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetMinCpuPlatformInstanceHttpRequest other) {
+      if (other == SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInstance() != null) {
+        this.instance = other.instance;
+      }
+      if (other.getInstancesSetMinCpuPlatformRequestResource() != null) {
+        this.instancesSetMinCpuPlatformRequestResource = other.instancesSetMinCpuPlatformRequestResource;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetMinCpuPlatformInstanceHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.instance = source.instance;
+      this.instancesSetMinCpuPlatformRequestResource = source.instancesSetMinCpuPlatformRequestResource;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getInstance() {
+      return instance;
+    }
+
+    public Builder setInstance(String instance) {
+      this.instance = instance;
+      return this;
+    }
+
+    public InstancesSetMinCpuPlatformRequest getInstancesSetMinCpuPlatformRequestResource() {
+      return instancesSetMinCpuPlatformRequestResource;
+    }
+
+    public Builder setInstancesSetMinCpuPlatformRequestResource(InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) {
+      this.instancesSetMinCpuPlatformRequestResource = instancesSetMinCpuPlatformRequestResource;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetMinCpuPlatformInstanceHttpRequest build() {
+      String missing = "";
+
+
+
+      if (instance == null) {
+        missing += " instance";
+      }
+
+
+
+
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetMinCpuPlatformInstanceHttpRequest(
+        access_token,
+        callback,
+        fields,
+        instance,
+        instancesSetMinCpuPlatformRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInstance(this.instance);
+      newBuilder.setInstancesSetMinCpuPlatformRequestResource(this.instancesSetMinCpuPlatformRequestResource);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetMinCpuPlatformInstanceHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instance=" + instance + ", "
+        + "instancesSetMinCpuPlatformRequestResource=" + instancesSetMinCpuPlatformRequestResource + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetMinCpuPlatformInstanceHttpRequest) {
+      SetMinCpuPlatformInstanceHttpRequest that = (SetMinCpuPlatformInstanceHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instance, that.getInstance()) &&
+          Objects.equals(this.instancesSetMinCpuPlatformRequestResource, that.getInstancesSetMinCpuPlatformRequestResource()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      instance,
+      instancesSetMinCpuPlatformRequestResource,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java
index 18468d7a5377..3533150576ad 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetNamedPortsInstanceGroupHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetNamedPortsInstanceGroupHttpRequest() {
@@ -51,6 +52,7 @@ private SetNamedPortsInstanceGroupHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetNamedPortsInstanceGroupHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetNamedPortsInstanceGroupHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetNamedPortsInstanceGroupHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetNamedPortsInstanceGroupHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetNamedPortsInstanceGroupHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetNamedPortsInstanceGroupHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java
index d91366a58ff6..fff6e2312872 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetNamedPortsRegionInstanceGroupHttpRequest implements ApiMes
   private final String prettyPrint;
   private final String quotaUser;
   private final RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource;
+  private final String requestId;
   private final String userIp;
 
   private SetNamedPortsRegionInstanceGroupHttpRequest() {
@@ -51,6 +52,7 @@ private SetNamedPortsRegionInstanceGroupHttpRequest() {
     this.prettyPrint = null;
     this.quotaUser = null;
     this.regionInstanceGroupsSetNamedPortsRequestResource = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetNamedPortsRegionInstanceGroupHttpRequest(
       String prettyPrint,
       String quotaUser,
       RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetNamedPortsRegionInstanceGroupHttpRequest(
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
     this.regionInstanceGroupsSetNamedPortsRequestResource = regionInstanceGroupsSetNamedPortsRequestResource;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource") && regionInstanceGroupsSetNamedPortsRequestResource != null) {
       fieldMap.put("regionInstanceGroupsSetNamedPortsRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("regionInstanceGroupsSetNamedPortsRequestResource")) {
       return String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public RegionInstanceGroupsSetNamedPortsRequest getRegionInstanceGroupsSetNamedP
     return regionInstanceGroupsSetNamedPortsRequestResource;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String prettyPrint;
     private String quotaUser;
     private RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetNamedPortsRegionInstanceGroupHttpRequest other) {
       if (other.getRegionInstanceGroupsSetNamedPortsRequestResource() != null) {
         this.regionInstanceGroupsSetNamedPortsRequestResource = other.regionInstanceGroupsSetNamedPortsRequestResource;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetNamedPortsRegionInstanceGroupHttpRequest other) {
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
       this.regionInstanceGroupsSetNamedPortsRequestResource = source.regionInstanceGroupsSetNamedPortsRequestResource;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setRegionInstanceGroupsSetNamedPortsRequestResource(RegionInstanc
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetNamedPortsRegionInstanceGroupHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetNamedPortsRegionInstanceGroupHttpRequest build() {
         prettyPrint,
         quotaUser,
         regionInstanceGroupsSetNamedPortsRequestResource,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
       newBuilder.setRegionInstanceGroupsSetNamedPortsRequestResource(this.regionInstanceGroupsSetNamedPortsRequestResource);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
         + "regionInstanceGroupsSetNamedPortsRequestResource=" + regionInstanceGroupsSetNamedPortsRequestResource + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
           Objects.equals(this.regionInstanceGroupsSetNamedPortsRequestResource, that.getRegionInstanceGroupsSetNamedPortsRequestResource()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       prettyPrint,
       quotaUser,
       regionInstanceGroupsSetNamedPortsRequestResource,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java
new file mode 100644
index 000000000000..d2573941fadb
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetPrivateIpGoogleAccessSubnetworkHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String subnetwork;
+  private final SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource;
+  private final String userIp;
+
+  private SetPrivateIpGoogleAccessSubnetworkHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.subnetwork = null;
+    this.subnetworksSetPrivateIpGoogleAccessRequestResource = null;
+    this.userIp = null;
+  }
+
+
+  private SetPrivateIpGoogleAccessSubnetworkHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String subnetwork,
+      SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.subnetwork = subnetwork;
+    this.subnetworksSetPrivateIpGoogleAccessRequestResource = subnetworksSetPrivateIpGoogleAccessRequestResource;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("subnetwork") && subnetwork != null) {
+      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
+    }
+    if (fieldNames.contains("subnetworksSetPrivateIpGoogleAccessRequestResource") && subnetworksSetPrivateIpGoogleAccessRequestResource != null) {
+      fieldMap.put("subnetworksSetPrivateIpGoogleAccessRequestResource", Collections.singletonList(String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("subnetwork")) {
+      return String.valueOf(subnetwork);
+    }
+    if (fieldName.equals("subnetworksSetPrivateIpGoogleAccessRequestResource")) {
+      return String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public SubnetworksSetPrivateIpGoogleAccessRequest getApiMessageRequestBody() {
+    return subnetworksSetPrivateIpGoogleAccessRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getSubnetwork() {
+    return subnetwork;
+  }
+
+  public SubnetworksSetPrivateIpGoogleAccessRequest getSubnetworksSetPrivateIpGoogleAccessRequestResource() {
+    return subnetworksSetPrivateIpGoogleAccessRequestResource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetPrivateIpGoogleAccessSubnetworkHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetPrivateIpGoogleAccessSubnetworkHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetPrivateIpGoogleAccessSubnetworkHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetPrivateIpGoogleAccessSubnetworkHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String subnetwork;
+    private SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetPrivateIpGoogleAccessSubnetworkHttpRequest other) {
+      if (other == SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getSubnetwork() != null) {
+        this.subnetwork = other.subnetwork;
+      }
+      if (other.getSubnetworksSetPrivateIpGoogleAccessRequestResource() != null) {
+        this.subnetworksSetPrivateIpGoogleAccessRequestResource = other.subnetworksSetPrivateIpGoogleAccessRequestResource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetPrivateIpGoogleAccessSubnetworkHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.subnetwork = source.subnetwork;
+      this.subnetworksSetPrivateIpGoogleAccessRequestResource = source.subnetworksSetPrivateIpGoogleAccessRequestResource;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getSubnetwork() {
+      return subnetwork;
+    }
+
+    public Builder setSubnetwork(String subnetwork) {
+      this.subnetwork = subnetwork;
+      return this;
+    }
+
+    public SubnetworksSetPrivateIpGoogleAccessRequest getSubnetworksSetPrivateIpGoogleAccessRequestResource() {
+      return subnetworksSetPrivateIpGoogleAccessRequestResource;
+    }
+
+    public Builder setSubnetworksSetPrivateIpGoogleAccessRequestResource(SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) {
+      this.subnetworksSetPrivateIpGoogleAccessRequestResource = subnetworksSetPrivateIpGoogleAccessRequestResource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetPrivateIpGoogleAccessSubnetworkHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+      if (subnetwork == null) {
+        missing += " subnetwork";
+      }
+
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetPrivateIpGoogleAccessSubnetworkHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        subnetwork,
+        subnetworksSetPrivateIpGoogleAccessRequestResource,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setSubnetwork(this.subnetwork);
+      newBuilder.setSubnetworksSetPrivateIpGoogleAccessRequestResource(this.subnetworksSetPrivateIpGoogleAccessRequestResource);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetPrivateIpGoogleAccessSubnetworkHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "subnetwork=" + subnetwork + ", "
+        + "subnetworksSetPrivateIpGoogleAccessRequestResource=" + subnetworksSetPrivateIpGoogleAccessRequestResource + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetPrivateIpGoogleAccessSubnetworkHttpRequest) {
+      SetPrivateIpGoogleAccessSubnetworkHttpRequest that = (SetPrivateIpGoogleAccessSubnetworkHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.subnetwork, that.getSubnetwork()) &&
+          Objects.equals(this.subnetworksSetPrivateIpGoogleAccessRequestResource, that.getSubnetworksSetPrivateIpGoogleAccessRequestResource()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      subnetwork,
+      subnetworksSetPrivateIpGoogleAccessRequestResource,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java
index 25a402b8f326..5c4504bcd8fc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class SetProxyHeaderTargetSslProxyHttpRequest implements ApiMessage
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource;
   private final String targetSslProxy;
   private final String userIp;
@@ -49,6 +50,7 @@ private SetProxyHeaderTargetSslProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetSslProxiesSetProxyHeaderRequestResource = null;
     this.targetSslProxy = null;
     this.userIp = null;
@@ -62,6 +64,7 @@ private SetProxyHeaderTargetSslProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource,
       String targetSslProxy,
       String userIp
@@ -72,6 +75,7 @@ private SetProxyHeaderTargetSslProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetSslProxiesSetProxyHeaderRequestResource = targetSslProxiesSetProxyHeaderRequestResource;
     this.targetSslProxy = targetSslProxy;
     this.userIp = userIp;
@@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource") && targetSslProxiesSetProxyHeaderRequestResource != null) {
       fieldMap.put("targetSslProxiesSetProxyHeaderRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource)));
     }
@@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetSslProxiesSetProxyHeaderRequestResource")) {
       return String.valueOf(targetSslProxiesSetProxyHeaderRequestResource);
     }
@@ -172,6 +182,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public TargetSslProxiesSetProxyHeaderRequest getTargetSslProxiesSetProxyHeaderRequestResource() {
     return targetSslProxiesSetProxyHeaderRequestResource;
   }
@@ -211,6 +225,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource;
     private String targetSslProxy;
     private String userIp;
@@ -237,6 +252,9 @@ public Builder mergeFrom(SetProxyHeaderTargetSslProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetSslProxiesSetProxyHeaderRequestResource() != null) {
         this.targetSslProxiesSetProxyHeaderRequestResource = other.targetSslProxiesSetProxyHeaderRequestResource;
       }
@@ -256,6 +274,7 @@ public Builder mergeFrom(SetProxyHeaderTargetSslProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetSslProxiesSetProxyHeaderRequestResource = source.targetSslProxiesSetProxyHeaderRequestResource;
       this.targetSslProxy = source.targetSslProxy;
       this.userIp = source.userIp;
@@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public TargetSslProxiesSetProxyHeaderRequest getTargetSslProxiesSetProxyHeaderRequestResource() {
       return targetSslProxiesSetProxyHeaderRequestResource;
     }
@@ -352,6 +380,7 @@ public SetProxyHeaderTargetSslProxyHttpRequest build() {
 
 
 
+
       if (targetSslProxy == null) {
         missing += " targetSslProxy";
       }
@@ -366,6 +395,7 @@ public SetProxyHeaderTargetSslProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetSslProxiesSetProxyHeaderRequestResource,
         targetSslProxy,
         userIp
@@ -380,6 +410,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetSslProxiesSetProxyHeaderRequestResource(this.targetSslProxiesSetProxyHeaderRequestResource);
       newBuilder.setTargetSslProxy(this.targetSslProxy);
       newBuilder.setUserIp(this.userIp);
@@ -396,6 +427,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetSslProxiesSetProxyHeaderRequestResource=" + targetSslProxiesSetProxyHeaderRequestResource + ", "
         + "targetSslProxy=" + targetSslProxy + ", "
         + "userIp=" + userIp
@@ -416,6 +448,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetSslProxiesSetProxyHeaderRequestResource, that.getTargetSslProxiesSetProxyHeaderRequestResource()) &&
           Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
@@ -433,6 +466,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetSslProxiesSetProxyHeaderRequestResource,
       targetSslProxy,
       userIp
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java
new file mode 100644
index 000000000000..7c4ee59d03b5
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class SetProxyHeaderTargetTcpProxyHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource;
+  private final String targetTcpProxy;
+  private final String userIp;
+
+  private SetProxyHeaderTargetTcpProxyHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.targetTcpProxiesSetProxyHeaderRequestResource = null;
+    this.targetTcpProxy = null;
+    this.userIp = null;
+  }
+
+
+  private SetProxyHeaderTargetTcpProxyHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource,
+      String targetTcpProxy,
+      String userIp
+      ) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.targetTcpProxiesSetProxyHeaderRequestResource = targetTcpProxiesSetProxyHeaderRequestResource;
+    this.targetTcpProxy = targetTcpProxy;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("access_token") && access_token != null) {
+      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
+    }
+    if (fieldNames.contains("callback") && callback != null) {
+      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
+    }
+    if (fieldNames.contains("fields") && fields != null) {
+      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
+    }
+    if (fieldNames.contains("key") && key != null) {
+      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
+    }
+    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
+      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
+    }
+    if (fieldNames.contains("quotaUser") && quotaUser != null) {
+      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
+    }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
+    if (fieldNames.contains("targetTcpProxiesSetProxyHeaderRequestResource") && targetTcpProxiesSetProxyHeaderRequestResource != null) {
+      fieldMap.put("targetTcpProxiesSetProxyHeaderRequestResource", Collections.singletonList(String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource)));
+    }
+    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
+      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
+    }
+    if (fieldNames.contains("userIp") && userIp != null) {
+      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return String.valueOf(access_token);
+    }
+    if (fieldName.equals("callback")) {
+      return String.valueOf(callback);
+    }
+    if (fieldName.equals("fields")) {
+      return String.valueOf(fields);
+    }
+    if (fieldName.equals("key")) {
+      return String.valueOf(key);
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return String.valueOf(prettyPrint);
+    }
+    if (fieldName.equals("quotaUser")) {
+      return String.valueOf(quotaUser);
+    }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
+    if (fieldName.equals("targetTcpProxiesSetProxyHeaderRequestResource")) {
+      return String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource);
+    }
+    if (fieldName.equals("targetTcpProxy")) {
+      return String.valueOf(targetTcpProxy);
+    }
+    if (fieldName.equals("userIp")) {
+      return String.valueOf(userIp);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public TargetTcpProxiesSetProxyHeaderRequest getApiMessageRequestBody() {
+    return targetTcpProxiesSetProxyHeaderRequestResource;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public TargetTcpProxiesSetProxyHeaderRequest getTargetTcpProxiesSetProxyHeaderRequestResource() {
+    return targetTcpProxiesSetProxyHeaderRequestResource;
+  }
+
+  public String getTargetTcpProxy() {
+    return targetTcpProxy;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(SetProxyHeaderTargetTcpProxyHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static SetProxyHeaderTargetTcpProxyHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final SetProxyHeaderTargetTcpProxyHttpRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new SetProxyHeaderTargetTcpProxyHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource;
+    private String targetTcpProxy;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(SetProxyHeaderTargetTcpProxyHttpRequest other) {
+      if (other == SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getTargetTcpProxiesSetProxyHeaderRequestResource() != null) {
+        this.targetTcpProxiesSetProxyHeaderRequestResource = other.targetTcpProxiesSetProxyHeaderRequestResource;
+      }
+      if (other.getTargetTcpProxy() != null) {
+        this.targetTcpProxy = other.targetTcpProxy;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(SetProxyHeaderTargetTcpProxyHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.targetTcpProxiesSetProxyHeaderRequestResource = source.targetTcpProxiesSetProxyHeaderRequestResource;
+      this.targetTcpProxy = source.targetTcpProxy;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public TargetTcpProxiesSetProxyHeaderRequest getTargetTcpProxiesSetProxyHeaderRequestResource() {
+      return targetTcpProxiesSetProxyHeaderRequestResource;
+    }
+
+    public Builder setTargetTcpProxiesSetProxyHeaderRequestResource(TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) {
+      this.targetTcpProxiesSetProxyHeaderRequestResource = targetTcpProxiesSetProxyHeaderRequestResource;
+      return this;
+    }
+
+    public String getTargetTcpProxy() {
+      return targetTcpProxy;
+    }
+
+    public Builder setTargetTcpProxy(String targetTcpProxy) {
+      this.targetTcpProxy = targetTcpProxy;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+
+    public SetProxyHeaderTargetTcpProxyHttpRequest build() {
+      String missing = "";
+
+
+
+
+
+
+
+
+      if (targetTcpProxy == null) {
+        missing += " targetTcpProxy";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new SetProxyHeaderTargetTcpProxyHttpRequest(
+        access_token,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        targetTcpProxiesSetProxyHeaderRequestResource,
+        targetTcpProxy,
+        userIp
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setTargetTcpProxiesSetProxyHeaderRequestResource(this.targetTcpProxiesSetProxyHeaderRequestResource);
+      newBuilder.setTargetTcpProxy(this.targetTcpProxy);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "SetProxyHeaderTargetTcpProxyHttpRequest{"
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "targetTcpProxiesSetProxyHeaderRequestResource=" + targetTcpProxiesSetProxyHeaderRequestResource + ", "
+        + "targetTcpProxy=" + targetTcpProxy + ", "
+        + "userIp=" + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof SetProxyHeaderTargetTcpProxyHttpRequest) {
+      SetProxyHeaderTargetTcpProxyHttpRequest that = (SetProxyHeaderTargetTcpProxyHttpRequest) o;
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.targetTcpProxiesSetProxyHeaderRequestResource, that.getTargetTcpProxiesSetProxyHeaderRequestResource()) &&
+          Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      access_token,
+      callback,
+      fields,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      targetTcpProxiesSetProxyHeaderRequestResource,
+      targetTcpProxy,
+      userIp
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java
index 42f40f716806..5a9b1e6b60ab 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java
@@ -39,6 +39,7 @@ public final class SetSchedulingInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final Scheduling schedulingResource;
   private final String userIp;
 
@@ -50,6 +51,7 @@ private SetSchedulingInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.schedulingResource = null;
     this.userIp = null;
   }
@@ -63,6 +65,7 @@ private SetSchedulingInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       Scheduling schedulingResource,
       String userIp
       ) {
@@ -73,6 +76,7 @@ private SetSchedulingInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.schedulingResource = schedulingResource;
     this.userIp = userIp;
   }
@@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("schedulingResource") && schedulingResource != null) {
       fieldMap.put("schedulingResource", Collections.singletonList(String.valueOf(schedulingResource)));
     }
@@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("schedulingResource")) {
       return String.valueOf(schedulingResource);
     }
@@ -176,6 +186,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public Scheduling getSchedulingResource() {
     return schedulingResource;
   }
@@ -212,6 +226,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private Scheduling schedulingResource;
     private String userIp;
 
@@ -240,6 +255,9 @@ public Builder mergeFrom(SetSchedulingInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getSchedulingResource() != null) {
         this.schedulingResource = other.schedulingResource;
       }
@@ -257,6 +275,7 @@ public Builder mergeFrom(SetSchedulingInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.schedulingResource = source.schedulingResource;
       this.userIp = source.userIp;
     }
@@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public Scheduling getSchedulingResource() {
       return schedulingResource;
     }
@@ -356,6 +384,7 @@ public SetSchedulingInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -367,6 +396,7 @@ public SetSchedulingInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         schedulingResource,
         userIp
       );
@@ -381,6 +411,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setSchedulingResource(this.schedulingResource);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -397,6 +428,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "schedulingResource=" + schedulingResource + ", "
         + "userIp=" + userIp
         + "}";
@@ -417,6 +449,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.schedulingResource, that.getSchedulingResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -434,6 +467,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       schedulingResource,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java
index f1455670eea2..2a9d055f32b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetServiceAccountInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetServiceAccountInstanceHttpRequest() {
@@ -51,6 +52,7 @@ private SetServiceAccountInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetServiceAccountInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetServiceAccountInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetServiceAccountInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetServiceAccountInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetServiceAccountInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetServiceAccountInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java
index 0c1d867a0acd..50899537dcbe 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class SetSslCertificatesTargetHttpsProxyHttpRequest implements ApiM
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource;
   private final String targetHttpsProxy;
   private final String userIp;
@@ -49,6 +50,7 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetHttpsProxiesSetSslCertificatesRequestResource = null;
     this.targetHttpsProxy = null;
     this.userIp = null;
@@ -62,6 +64,7 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource,
       String targetHttpsProxy,
       String userIp
@@ -72,6 +75,7 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetHttpsProxiesSetSslCertificatesRequestResource = targetHttpsProxiesSetSslCertificatesRequestResource;
     this.targetHttpsProxy = targetHttpsProxy;
     this.userIp = userIp;
@@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource") && targetHttpsProxiesSetSslCertificatesRequestResource != null) {
       fieldMap.put("targetHttpsProxiesSetSslCertificatesRequestResource", Collections.singletonList(String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource)));
     }
@@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetHttpsProxiesSetSslCertificatesRequestResource")) {
       return String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource);
     }
@@ -172,6 +182,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public TargetHttpsProxiesSetSslCertificatesRequest getTargetHttpsProxiesSetSslCertificatesRequestResource() {
     return targetHttpsProxiesSetSslCertificatesRequestResource;
   }
@@ -211,6 +225,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource;
     private String targetHttpsProxy;
     private String userIp;
@@ -237,6 +252,9 @@ public Builder mergeFrom(SetSslCertificatesTargetHttpsProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetHttpsProxiesSetSslCertificatesRequestResource() != null) {
         this.targetHttpsProxiesSetSslCertificatesRequestResource = other.targetHttpsProxiesSetSslCertificatesRequestResource;
       }
@@ -256,6 +274,7 @@ public Builder mergeFrom(SetSslCertificatesTargetHttpsProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetHttpsProxiesSetSslCertificatesRequestResource = source.targetHttpsProxiesSetSslCertificatesRequestResource;
       this.targetHttpsProxy = source.targetHttpsProxy;
       this.userIp = source.userIp;
@@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public TargetHttpsProxiesSetSslCertificatesRequest getTargetHttpsProxiesSetSslCertificatesRequestResource() {
       return targetHttpsProxiesSetSslCertificatesRequestResource;
     }
@@ -352,6 +380,7 @@ public SetSslCertificatesTargetHttpsProxyHttpRequest build() {
 
 
 
+
       if (targetHttpsProxy == null) {
         missing += " targetHttpsProxy";
       }
@@ -366,6 +395,7 @@ public SetSslCertificatesTargetHttpsProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetHttpsProxiesSetSslCertificatesRequestResource,
         targetHttpsProxy,
         userIp
@@ -380,6 +410,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetHttpsProxiesSetSslCertificatesRequestResource(this.targetHttpsProxiesSetSslCertificatesRequestResource);
       newBuilder.setTargetHttpsProxy(this.targetHttpsProxy);
       newBuilder.setUserIp(this.userIp);
@@ -396,6 +427,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetHttpsProxiesSetSslCertificatesRequestResource=" + targetHttpsProxiesSetSslCertificatesRequestResource + ", "
         + "targetHttpsProxy=" + targetHttpsProxy + ", "
         + "userIp=" + userIp
@@ -416,6 +448,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetHttpsProxiesSetSslCertificatesRequestResource, that.getTargetHttpsProxiesSetSslCertificatesRequestResource()) &&
           Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
@@ -433,6 +466,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetHttpsProxiesSetSslCertificatesRequestResource,
       targetHttpsProxy,
       userIp
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java
index 098d19ada6b6..16ac28d1d552 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class SetSslCertificatesTargetSslProxyHttpRequest implements ApiMes
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource;
   private final String targetSslProxy;
   private final String userIp;
@@ -49,6 +50,7 @@ private SetSslCertificatesTargetSslProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetSslProxiesSetSslCertificatesRequestResource = null;
     this.targetSslProxy = null;
     this.userIp = null;
@@ -62,6 +64,7 @@ private SetSslCertificatesTargetSslProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource,
       String targetSslProxy,
       String userIp
@@ -72,6 +75,7 @@ private SetSslCertificatesTargetSslProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetSslProxiesSetSslCertificatesRequestResource = targetSslProxiesSetSslCertificatesRequestResource;
     this.targetSslProxy = targetSslProxy;
     this.userIp = userIp;
@@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource") && targetSslProxiesSetSslCertificatesRequestResource != null) {
       fieldMap.put("targetSslProxiesSetSslCertificatesRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetSslCertificatesRequestResource)));
     }
@@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetSslProxiesSetSslCertificatesRequestResource")) {
       return String.valueOf(targetSslProxiesSetSslCertificatesRequestResource);
     }
@@ -172,6 +182,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public TargetSslProxiesSetSslCertificatesRequest getTargetSslProxiesSetSslCertificatesRequestResource() {
     return targetSslProxiesSetSslCertificatesRequestResource;
   }
@@ -211,6 +225,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource;
     private String targetSslProxy;
     private String userIp;
@@ -237,6 +252,9 @@ public Builder mergeFrom(SetSslCertificatesTargetSslProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetSslProxiesSetSslCertificatesRequestResource() != null) {
         this.targetSslProxiesSetSslCertificatesRequestResource = other.targetSslProxiesSetSslCertificatesRequestResource;
       }
@@ -256,6 +274,7 @@ public Builder mergeFrom(SetSslCertificatesTargetSslProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetSslProxiesSetSslCertificatesRequestResource = source.targetSslProxiesSetSslCertificatesRequestResource;
       this.targetSslProxy = source.targetSslProxy;
       this.userIp = source.userIp;
@@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public TargetSslProxiesSetSslCertificatesRequest getTargetSslProxiesSetSslCertificatesRequestResource() {
       return targetSslProxiesSetSslCertificatesRequestResource;
     }
@@ -352,6 +380,7 @@ public SetSslCertificatesTargetSslProxyHttpRequest build() {
 
 
 
+
       if (targetSslProxy == null) {
         missing += " targetSslProxy";
       }
@@ -366,6 +395,7 @@ public SetSslCertificatesTargetSslProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetSslProxiesSetSslCertificatesRequestResource,
         targetSslProxy,
         userIp
@@ -380,6 +410,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetSslProxiesSetSslCertificatesRequestResource(this.targetSslProxiesSetSslCertificatesRequestResource);
       newBuilder.setTargetSslProxy(this.targetSslProxy);
       newBuilder.setUserIp(this.userIp);
@@ -396,6 +427,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetSslProxiesSetSslCertificatesRequestResource=" + targetSslProxiesSetSslCertificatesRequestResource + ", "
         + "targetSslProxy=" + targetSslProxy + ", "
         + "userIp=" + userIp
@@ -416,6 +448,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetSslProxiesSetSslCertificatesRequestResource, that.getTargetSslProxiesSetSslCertificatesRequestResource()) &&
           Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) &&
           Objects.equals(this.userIp, that.getUserIp())
@@ -433,6 +466,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetSslProxiesSetSslCertificatesRequestResource,
       targetSslProxy,
       userIp
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java
index d63b583ee9ff..284827bbf593 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java
@@ -39,6 +39,7 @@ public final class SetTagsInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final Tags tagsResource;
   private final String userIp;
 
@@ -50,6 +51,7 @@ private SetTagsInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.tagsResource = null;
     this.userIp = null;
   }
@@ -63,6 +65,7 @@ private SetTagsInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       Tags tagsResource,
       String userIp
       ) {
@@ -73,6 +76,7 @@ private SetTagsInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.tagsResource = tagsResource;
     this.userIp = userIp;
   }
@@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("tagsResource") && tagsResource != null) {
       fieldMap.put("tagsResource", Collections.singletonList(String.valueOf(tagsResource)));
     }
@@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("tagsResource")) {
       return String.valueOf(tagsResource);
     }
@@ -176,6 +186,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public Tags getTagsResource() {
     return tagsResource;
   }
@@ -212,6 +226,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private Tags tagsResource;
     private String userIp;
 
@@ -240,6 +255,9 @@ public Builder mergeFrom(SetTagsInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTagsResource() != null) {
         this.tagsResource = other.tagsResource;
       }
@@ -257,6 +275,7 @@ public Builder mergeFrom(SetTagsInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.tagsResource = source.tagsResource;
       this.userIp = source.userIp;
     }
@@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public Tags getTagsResource() {
       return tagsResource;
     }
@@ -356,6 +384,7 @@ public SetTagsInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -367,6 +396,7 @@ public SetTagsInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         tagsResource,
         userIp
       );
@@ -381,6 +411,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTagsResource(this.tagsResource);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -397,6 +428,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "tagsResource=" + tagsResource + ", "
         + "userIp=" + userIp
         + "}";
@@ -417,6 +449,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.tagsResource, that.getTagsResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -434,6 +467,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       tagsResource,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java
index 26aada1f3486..388d7a3e2a4a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java
@@ -39,6 +39,7 @@ public final class SetTargetForwardingRuleHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final TargetReference targetReferenceResource;
   private final String userIp;
 
@@ -50,6 +51,7 @@ private SetTargetForwardingRuleHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetReferenceResource = null;
     this.userIp = null;
   }
@@ -63,6 +65,7 @@ private SetTargetForwardingRuleHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       TargetReference targetReferenceResource,
       String userIp
       ) {
@@ -73,6 +76,7 @@ private SetTargetForwardingRuleHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetReferenceResource = targetReferenceResource;
     this.userIp = userIp;
   }
@@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) {
       fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource)));
     }
@@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetReferenceResource")) {
       return String.valueOf(targetReferenceResource);
     }
@@ -176,6 +186,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public TargetReference getTargetReferenceResource() {
     return targetReferenceResource;
   }
@@ -212,6 +226,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private TargetReference targetReferenceResource;
     private String userIp;
 
@@ -240,6 +255,9 @@ public Builder mergeFrom(SetTargetForwardingRuleHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetReferenceResource() != null) {
         this.targetReferenceResource = other.targetReferenceResource;
       }
@@ -257,6 +275,7 @@ public Builder mergeFrom(SetTargetForwardingRuleHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetReferenceResource = source.targetReferenceResource;
       this.userIp = source.userIp;
     }
@@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public TargetReference getTargetReferenceResource() {
       return targetReferenceResource;
     }
@@ -356,6 +384,7 @@ public SetTargetForwardingRuleHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -367,6 +396,7 @@ public SetTargetForwardingRuleHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetReferenceResource,
         userIp
       );
@@ -381,6 +411,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetReferenceResource(this.targetReferenceResource);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -397,6 +428,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetReferenceResource=" + targetReferenceResource + ", "
         + "userIp=" + userIp
         + "}";
@@ -417,6 +449,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -434,6 +467,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetReferenceResource,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java
index 2321a4571f81..fc410a2e4b6a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java
@@ -39,6 +39,7 @@ public final class SetTargetGlobalForwardingRuleHttpRequest implements ApiMessag
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final TargetReference targetReferenceResource;
   private final String userIp;
 
@@ -50,6 +51,7 @@ private SetTargetGlobalForwardingRuleHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetReferenceResource = null;
     this.userIp = null;
   }
@@ -63,6 +65,7 @@ private SetTargetGlobalForwardingRuleHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       TargetReference targetReferenceResource,
       String userIp
       ) {
@@ -73,6 +76,7 @@ private SetTargetGlobalForwardingRuleHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetReferenceResource = targetReferenceResource;
     this.userIp = userIp;
   }
@@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) {
       fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource)));
     }
@@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetReferenceResource")) {
       return String.valueOf(targetReferenceResource);
     }
@@ -176,6 +186,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public TargetReference getTargetReferenceResource() {
     return targetReferenceResource;
   }
@@ -212,6 +226,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private TargetReference targetReferenceResource;
     private String userIp;
 
@@ -240,6 +255,9 @@ public Builder mergeFrom(SetTargetGlobalForwardingRuleHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetReferenceResource() != null) {
         this.targetReferenceResource = other.targetReferenceResource;
       }
@@ -257,6 +275,7 @@ public Builder mergeFrom(SetTargetGlobalForwardingRuleHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetReferenceResource = source.targetReferenceResource;
       this.userIp = source.userIp;
     }
@@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public TargetReference getTargetReferenceResource() {
       return targetReferenceResource;
     }
@@ -356,6 +384,7 @@ public SetTargetGlobalForwardingRuleHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -367,6 +396,7 @@ public SetTargetGlobalForwardingRuleHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetReferenceResource,
         userIp
       );
@@ -381,6 +411,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetReferenceResource(this.targetReferenceResource);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -397,6 +428,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetReferenceResource=" + targetReferenceResource + ", "
         + "userIp=" + userIp
         + "}";
@@ -417,6 +449,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -434,6 +467,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetReferenceResource,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java
index ca8da858cd38..ace005f07516 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetTargetPoolsInstanceGroupManagerHttpRequest implements ApiM
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private SetTargetPoolsInstanceGroupManagerHttpRequest() {
@@ -51,6 +52,7 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetTargetPoolsInstanceGroupManagerHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetTargetPoolsInstanceGroupManagerHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetTargetPoolsInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetTargetPoolsInstanceGroupManagerHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java
index b247b831b081..c2afba50ab7a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java
@@ -40,6 +40,7 @@ public final class SetTargetPoolsRegionInstanceGroupManagerHttpRequest implement
   private final String prettyPrint;
   private final String quotaUser;
   private final RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource;
+  private final String requestId;
   private final String userIp;
 
   private SetTargetPoolsRegionInstanceGroupManagerHttpRequest() {
@@ -51,6 +52,7 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest() {
     this.prettyPrint = null;
     this.quotaUser = null;
     this.regionInstanceGroupManagersSetTargetPoolsRequestResource = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest(
       String prettyPrint,
       String quotaUser,
       RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest(
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
     this.regionInstanceGroupManagersSetTargetPoolsRequestResource = regionInstanceGroupManagersSetTargetPoolsRequestResource;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource") && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) {
       fieldMap.put("regionInstanceGroupManagersSetTargetPoolsRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("regionInstanceGroupManagersSetTargetPoolsRequestResource")) {
       return String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public RegionInstanceGroupManagersSetTargetPoolsRequest getRegionInstanceGroupMa
     return regionInstanceGroupManagersSetTargetPoolsRequestResource;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String prettyPrint;
     private String quotaUser;
     private RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(SetTargetPoolsRegionInstanceGroupManagerHttpRequest oth
       if (other.getRegionInstanceGroupManagersSetTargetPoolsRequestResource() != null) {
         this.regionInstanceGroupManagersSetTargetPoolsRequestResource = other.regionInstanceGroupManagersSetTargetPoolsRequestResource;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(SetTargetPoolsRegionInstanceGroupManagerHttpRequest oth
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
       this.regionInstanceGroupManagersSetTargetPoolsRequestResource = source.regionInstanceGroupManagersSetTargetPoolsRequestResource;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setRegionInstanceGroupManagersSetTargetPoolsRequestResource(Regio
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public SetTargetPoolsRegionInstanceGroupManagerHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public SetTargetPoolsRegionInstanceGroupManagerHttpRequest build() {
         prettyPrint,
         quotaUser,
         regionInstanceGroupManagersSetTargetPoolsRequestResource,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
       newBuilder.setRegionInstanceGroupManagersSetTargetPoolsRequestResource(this.regionInstanceGroupManagersSetTargetPoolsRequestResource);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
         + "regionInstanceGroupManagersSetTargetPoolsRequestResource=" + regionInstanceGroupManagersSetTargetPoolsRequestResource + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
           Objects.equals(this.regionInstanceGroupManagersSetTargetPoolsRequestResource, that.getRegionInstanceGroupManagersSetTargetPoolsRequestResource()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       prettyPrint,
       quotaUser,
       regionInstanceGroupManagersSetTargetPoolsRequestResource,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java
index 39f07c689ca6..74f41fa04713 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class SetUrlMapTargetHttpProxyHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetHttpProxy;
   private final UrlMapReference urlMapReferenceResource;
   private final String userIp;
@@ -49,6 +50,7 @@ private SetUrlMapTargetHttpProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetHttpProxy = null;
     this.urlMapReferenceResource = null;
     this.userIp = null;
@@ -62,6 +64,7 @@ private SetUrlMapTargetHttpProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetHttpProxy,
       UrlMapReference urlMapReferenceResource,
       String userIp
@@ -72,6 +75,7 @@ private SetUrlMapTargetHttpProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetHttpProxy = targetHttpProxy;
     this.urlMapReferenceResource = urlMapReferenceResource;
     this.userIp = userIp;
@@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) {
       fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy)));
     }
@@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetHttpProxy")) {
       return String.valueOf(targetHttpProxy);
     }
@@ -172,6 +182,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetHttpProxy() {
     return targetHttpProxy;
   }
@@ -211,6 +225,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetHttpProxy;
     private UrlMapReference urlMapReferenceResource;
     private String userIp;
@@ -237,6 +252,9 @@ public Builder mergeFrom(SetUrlMapTargetHttpProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetHttpProxy() != null) {
         this.targetHttpProxy = other.targetHttpProxy;
       }
@@ -256,6 +274,7 @@ public Builder mergeFrom(SetUrlMapTargetHttpProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetHttpProxy = source.targetHttpProxy;
       this.urlMapReferenceResource = source.urlMapReferenceResource;
       this.userIp = source.userIp;
@@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetHttpProxy() {
       return targetHttpProxy;
     }
@@ -351,6 +379,7 @@ public SetUrlMapTargetHttpProxyHttpRequest build() {
 
 
 
+
       if (targetHttpProxy == null) {
         missing += " targetHttpProxy";
       }
@@ -366,6 +395,7 @@ public SetUrlMapTargetHttpProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetHttpProxy,
         urlMapReferenceResource,
         userIp
@@ -380,6 +410,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetHttpProxy(this.targetHttpProxy);
       newBuilder.setUrlMapReferenceResource(this.urlMapReferenceResource);
       newBuilder.setUserIp(this.userIp);
@@ -396,6 +427,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetHttpProxy=" + targetHttpProxy + ", "
         + "urlMapReferenceResource=" + urlMapReferenceResource + ", "
         + "userIp=" + userIp
@@ -416,6 +448,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) &&
           Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
@@ -433,6 +466,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetHttpProxy,
       urlMapReferenceResource,
       userIp
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java
index 3c4de0d6049b..08537d9c18e4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java
@@ -38,6 +38,7 @@ public final class SetUrlMapTargetHttpsProxyHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String targetHttpsProxy;
   private final UrlMapReference urlMapReferenceResource;
   private final String userIp;
@@ -49,6 +50,7 @@ private SetUrlMapTargetHttpsProxyHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.targetHttpsProxy = null;
     this.urlMapReferenceResource = null;
     this.userIp = null;
@@ -62,6 +64,7 @@ private SetUrlMapTargetHttpsProxyHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String targetHttpsProxy,
       UrlMapReference urlMapReferenceResource,
       String userIp
@@ -72,6 +75,7 @@ private SetUrlMapTargetHttpsProxyHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.targetHttpsProxy = targetHttpsProxy;
     this.urlMapReferenceResource = urlMapReferenceResource;
     this.userIp = userIp;
@@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
       fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
     }
@@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("targetHttpsProxy")) {
       return String.valueOf(targetHttpsProxy);
     }
@@ -172,6 +182,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getTargetHttpsProxy() {
     return targetHttpsProxy;
   }
@@ -211,6 +225,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String targetHttpsProxy;
     private UrlMapReference urlMapReferenceResource;
     private String userIp;
@@ -237,6 +252,9 @@ public Builder mergeFrom(SetUrlMapTargetHttpsProxyHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getTargetHttpsProxy() != null) {
         this.targetHttpsProxy = other.targetHttpsProxy;
       }
@@ -256,6 +274,7 @@ public Builder mergeFrom(SetUrlMapTargetHttpsProxyHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.targetHttpsProxy = source.targetHttpsProxy;
       this.urlMapReferenceResource = source.urlMapReferenceResource;
       this.userIp = source.userIp;
@@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getTargetHttpsProxy() {
       return targetHttpsProxy;
     }
@@ -351,6 +379,7 @@ public SetUrlMapTargetHttpsProxyHttpRequest build() {
 
 
 
+
       if (targetHttpsProxy == null) {
         missing += " targetHttpsProxy";
       }
@@ -366,6 +395,7 @@ public SetUrlMapTargetHttpsProxyHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         targetHttpsProxy,
         urlMapReferenceResource,
         userIp
@@ -380,6 +410,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setTargetHttpsProxy(this.targetHttpsProxy);
       newBuilder.setUrlMapReferenceResource(this.urlMapReferenceResource);
       newBuilder.setUserIp(this.userIp);
@@ -396,6 +427,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "targetHttpsProxy=" + targetHttpsProxy + ", "
         + "urlMapReferenceResource=" + urlMapReferenceResource + ", "
         + "userIp=" + userIp
@@ -416,6 +448,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) &&
           Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
@@ -433,6 +466,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       targetHttpsProxy,
       urlMapReferenceResource,
       userIp
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java
index 872e9f58ecb9..b92a227709be 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java
@@ -39,6 +39,7 @@ public final class SetUsageExportBucketProjectHttpRequest implements ApiMessage
   private final String prettyPrint;
   private final String project;
   private final String quotaUser;
+  private final String requestId;
   private final UsageExportLocation usageExportLocationResource;
   private final String userIp;
 
@@ -50,6 +51,7 @@ private SetUsageExportBucketProjectHttpRequest() {
     this.prettyPrint = null;
     this.project = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.usageExportLocationResource = null;
     this.userIp = null;
   }
@@ -63,6 +65,7 @@ private SetUsageExportBucketProjectHttpRequest(
       String prettyPrint,
       String project,
       String quotaUser,
+      String requestId,
       UsageExportLocation usageExportLocationResource,
       String userIp
       ) {
@@ -73,6 +76,7 @@ private SetUsageExportBucketProjectHttpRequest(
     this.prettyPrint = prettyPrint;
     this.project = project;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.usageExportLocationResource = usageExportLocationResource;
     this.userIp = userIp;
   }
@@ -101,6 +105,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("usageExportLocationResource") && usageExportLocationResource != null) {
       fieldMap.put("usageExportLocationResource", Collections.singletonList(String.valueOf(usageExportLocationResource)));
     }
@@ -133,6 +140,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("usageExportLocationResource")) {
       return String.valueOf(usageExportLocationResource);
     }
@@ -176,6 +186,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public UsageExportLocation getUsageExportLocationResource() {
     return usageExportLocationResource;
   }
@@ -212,6 +226,7 @@ public static class Builder {
     private String prettyPrint;
     private String project;
     private String quotaUser;
+    private String requestId;
     private UsageExportLocation usageExportLocationResource;
     private String userIp;
 
@@ -240,6 +255,9 @@ public Builder mergeFrom(SetUsageExportBucketProjectHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUsageExportLocationResource() != null) {
         this.usageExportLocationResource = other.usageExportLocationResource;
       }
@@ -257,6 +275,7 @@ public Builder mergeFrom(SetUsageExportBucketProjectHttpRequest other) {
       this.prettyPrint = source.prettyPrint;
       this.project = source.project;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.usageExportLocationResource = source.usageExportLocationResource;
       this.userIp = source.userIp;
     }
@@ -324,6 +343,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public UsageExportLocation getUsageExportLocationResource() {
       return usageExportLocationResource;
     }
@@ -356,6 +384,7 @@ public SetUsageExportBucketProjectHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -367,6 +396,7 @@ public SetUsageExportBucketProjectHttpRequest build() {
         prettyPrint,
         project,
         quotaUser,
+        requestId,
         usageExportLocationResource,
         userIp
       );
@@ -381,6 +411,7 @@ public Builder clone() {
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setProject(this.project);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUsageExportLocationResource(this.usageExportLocationResource);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -397,6 +428,7 @@ public String toString() {
         + "prettyPrint=" + prettyPrint + ", "
         + "project=" + project + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "usageExportLocationResource=" + usageExportLocationResource + ", "
         + "userIp=" + userIp
         + "}";
@@ -417,6 +449,7 @@ public boolean equals(Object o) {
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.project, that.getProject()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.usageExportLocationResource, that.getUsageExportLocationResource()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
@@ -434,6 +467,7 @@ public int hashCode() {
       prettyPrint,
       project,
       quotaUser,
+      requestId,
       usageExportLocationResource,
       userIp
     );
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java
index 6e2670f39c54..1c75c47d8bae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java
@@ -37,6 +37,8 @@ public final class Snapshot implements ApiMessage {
   private final String diskSizeGb;
   private final String id;
   private final String kind;
+  private final String labelFingerprint;
+  private final Map labels;
   private final List licenses;
   private final String name;
   private final String selfLink;
@@ -54,6 +56,8 @@ private Snapshot() {
     this.diskSizeGb = null;
     this.id = null;
     this.kind = null;
+    this.labelFingerprint = null;
+    this.labels = null;
     this.licenses = null;
     this.name = null;
     this.selfLink = null;
@@ -73,6 +77,8 @@ private Snapshot(
       String diskSizeGb,
       String id,
       String kind,
+      String labelFingerprint,
+      Map labels,
       List licenses,
       String name,
       String selfLink,
@@ -89,6 +95,8 @@ private Snapshot(
     this.diskSizeGb = diskSizeGb;
     this.id = id;
     this.kind = kind;
+    this.labelFingerprint = labelFingerprint;
+    this.labels = labels;
     this.licenses = licenses;
     this.name = name;
     this.selfLink = selfLink;
@@ -119,6 +127,12 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("kind") && kind != null) {
       fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
     }
+    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
+      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
+    }
+    if (fieldNames.contains("labels") && labels != null) {
+      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
+    }
     if (fieldNames.contains("licenses") && licenses != null) {
       ImmutableList.Builder stringList = ImmutableList.builder();
       for (String item : licenses) {
@@ -173,6 +187,12 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("kind")) {
       return String.valueOf(kind);
     }
+    if (fieldName.equals("labelFingerprint")) {
+      return String.valueOf(labelFingerprint);
+    }
+    if (fieldName.equals("labels")) {
+      return String.valueOf(labels);
+    }
     if (fieldName.equals("licenses")) {
       return String.valueOf(licenses);
     }
@@ -232,6 +252,14 @@ public String getKind() {
     return kind;
   }
 
+  public String getLabelFingerprint() {
+    return labelFingerprint;
+  }
+
+  public Map getLabelsMap() {
+    return labels;
+  }
+
   public List getLicensesList() {
     return licenses;
   }
@@ -298,6 +326,8 @@ public static class Builder {
     private String diskSizeGb;
     private String id;
     private String kind;
+    private String labelFingerprint;
+    private Map labels;
     private List licenses;
     private String name;
     private String selfLink;
@@ -328,6 +358,12 @@ public Builder mergeFrom(Snapshot other) {
       if (other.getKind() != null) {
         this.kind = other.kind;
       }
+      if (other.getLabelFingerprint() != null) {
+        this.labelFingerprint = other.labelFingerprint;
+      }
+      if (other.getLabelsMap() != null) {
+        this.labels = other.labels;
+      }
       if (other.getLicensesList() != null) {
         this.licenses = other.licenses;
       }
@@ -367,6 +403,8 @@ public Builder mergeFrom(Snapshot other) {
       this.diskSizeGb = source.diskSizeGb;
       this.id = source.id;
       this.kind = source.kind;
+      this.labelFingerprint = source.labelFingerprint;
+      this.labels = source.labels;
       this.licenses = source.licenses;
       this.name = source.name;
       this.selfLink = source.selfLink;
@@ -424,6 +462,24 @@ public Builder setKind(String kind) {
       return this;
     }
 
+    public String getLabelFingerprint() {
+      return labelFingerprint;
+    }
+
+    public Builder setLabelFingerprint(String labelFingerprint) {
+      this.labelFingerprint = labelFingerprint;
+      return this;
+    }
+
+    public Map getLabelsMap() {
+      return labels;
+    }
+
+    public Builder putAllLabels(Map labels) {
+      this.labels = labels;
+      return this;
+    }
+
     public List getLicensesList() {
       return licenses;
     }
@@ -538,12 +594,16 @@ public Snapshot build() {
 
 
 
+
+
       return new Snapshot(
         creationTimestamp,
         description,
         diskSizeGb,
         id,
         kind,
+        labelFingerprint,
+        labels,
         licenses,
         name,
         selfLink,
@@ -564,6 +624,8 @@ public Builder clone() {
       newBuilder.setDiskSizeGb(this.diskSizeGb);
       newBuilder.setId(this.id);
       newBuilder.setKind(this.kind);
+      newBuilder.setLabelFingerprint(this.labelFingerprint);
+      newBuilder.putAllLabels(this.labels);
       newBuilder.addAllLicenses(this.licenses);
       newBuilder.setName(this.name);
       newBuilder.setSelfLink(this.selfLink);
@@ -586,6 +648,8 @@ public String toString() {
         + "diskSizeGb=" + diskSizeGb + ", "
         + "id=" + id + ", "
         + "kind=" + kind + ", "
+        + "labelFingerprint=" + labelFingerprint + ", "
+        + "labels=" + labels + ", "
         + "licenses=" + licenses + ", "
         + "name=" + name + ", "
         + "selfLink=" + selfLink + ", "
@@ -612,6 +676,8 @@ public boolean equals(Object o) {
           Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) &&
           Objects.equals(this.id, that.getId()) &&
           Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) &&
+          Objects.equals(this.labels, that.getLabelsMap()) &&
           Objects.equals(this.licenses, that.getLicensesList()) &&
           Objects.equals(this.name, that.getName()) &&
           Objects.equals(this.selfLink, that.getSelfLink()) &&
@@ -635,6 +701,8 @@ public int hashCode() {
       diskSizeGb,
       id,
       kind,
+      labelFingerprint,
+      labels,
       licenses,
       name,
       selfLink,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
index ec3ecb94aed0..6785ebb24a6a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+ *   String requestId = "";
  *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- *   Operation response = snapshotClient.deleteSnapshot(snapshot);
+ *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
  * }
  * 
  * 
@@ -177,19 +178,26 @@ public SnapshotStub getStub() { * Sample code: *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   String requestId = "";
    *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   Operation response = snapshotClient.deleteSnapshot(snapshot);
+   *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param snapshot Name of the Snapshot resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSnapshot(SnapshotName snapshot) { + public final Operation deleteSnapshot(String requestId, SnapshotName snapshot) { DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder() + .setRequestId(requestId) .setSnapshot(snapshot == null ? null : snapshot.toString()) .build(); return deleteSnapshot(request); @@ -204,19 +212,26 @@ public final Operation deleteSnapshot(SnapshotName snapshot) { * Sample code: *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   String requestId = "";
    *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   Operation response = snapshotClient.deleteSnapshot(snapshot.toString());
+   *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param snapshot Name of the Snapshot resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSnapshot(String snapshot) { + public final Operation deleteSnapshot(String requestId, String snapshot) { DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder() + .setRequestId(requestId) .setSnapshot(snapshot) .build(); return deleteSnapshot(request); @@ -231,8 +246,10 @@ public final Operation deleteSnapshot(String snapshot) { * Sample code: *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   String requestId = "";
    *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
    *     .build();
    *   Operation response = snapshotClient.deleteSnapshot(request);
@@ -256,8 +273,10 @@ public final Operation deleteSnapshot(DeleteSnapshotHttpRequest request) {
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   String requestId = "";
    *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
    *     .build();
    *   ApiFuture<Operation> future = snapshotClient.deleteSnapshotCallable().futureCall(request);
@@ -499,6 +518,111 @@ public final UnaryCallable listSnapshots
     return stub.listSnapshotsCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
+   *
+   * Sample code:
+   * 

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   Operation response = snapshotClient.setLabelsSnapshot(resource, globalSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param globalSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsSnapshot(ProjectSnapshotName resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) { + + SetLabelsSnapshotHttpRequest request = + SetLabelsSnapshotHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource) + .build(); + return setLabelsSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   Operation response = snapshotClient.setLabelsSnapshot(resource.toString(), globalSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param globalSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsSnapshot(String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) { + + SetLabelsSnapshotHttpRequest request = + SetLabelsSnapshotHttpRequest.newBuilder() + .setResource(resource) + .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource) + .build(); + return setLabelsSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   SetLabelsSnapshotHttpRequest request = SetLabelsSnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+   *     .build();
+   *   Operation response = snapshotClient.setLabelsSnapshot(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsSnapshot(SetLabelsSnapshotHttpRequest request) { + return setLabelsSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + *

+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
+   *   SetLabelsSnapshotHttpRequest request = SetLabelsSnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = snapshotClient.setLabelsSnapshotCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setLabelsSnapshotCallable() { + return stub.setLabelsSnapshotCallable(); + } + @Override public final void close() throws Exception { stub.close(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java index 53942a47d8e9..1ee03fc40f73 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java @@ -37,6 +37,7 @@ public final class SnapshotList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private SnapshotList() { this.id = null; @@ -44,6 +45,7 @@ private SnapshotList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private SnapshotList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(SnapshotList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(SnapshotList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public SnapshotList build() { + return new SnapshotList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java index 0f557b09e554..202bca3e4936 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class SnapshotName implements ResourceName { +public final class SnapshotName implements com.google.api.resourcenames.ResourceName { private final String project; private final String snapshot; private static final PathTemplate PATH_TEMPLATE = diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java index 3b76a7a7a68d..f3722e9df2cf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java @@ -106,6 +106,13 @@ public PagedCallSettings setLabelsSnapshotSettings() { + return ((SnapshotStubSettings) getStubSettings()).setLabelsSnapshotSettings(); + } + public static final SnapshotSettings create(SnapshotStubSettings stub) throws IOException { return new SnapshotSettings.Builder(stub.toBuilder()).build(); @@ -246,6 +253,13 @@ public PagedCallSettings.Builder setLabelsSnapshotSettings() { + return getStubSettingsBuilder().setLabelsSnapshotSettings(); + } + @Override public SnapshotSettings build() throws IOException { return new SnapshotSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java index 8723760eca02..8f5d06336f3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java @@ -53,7 +53,8 @@ * * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) { * SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); - * Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate); + * String requestId = ""; + * Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId); * } * *
@@ -176,19 +177,26 @@ public SslCertificateStub getStub() { *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
-   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
+   *   String requestId = "";
+   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
    * }
    * 
* * @param sslCertificate Name of the SslCertificate resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslCertificate(SslCertificateName sslCertificate) { + public final Operation deleteSslCertificate(SslCertificateName sslCertificate, String requestId) { DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder() .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) + .setRequestId(requestId) .build(); return deleteSslCertificate(request); } @@ -201,19 +209,26 @@ public final Operation deleteSslCertificate(SslCertificateName sslCertificate) { *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
-   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString());
+   *   String requestId = "";
+   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString(), requestId);
    * }
    * 
* * @param sslCertificate Name of the SslCertificate resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslCertificate(String sslCertificate) { + public final Operation deleteSslCertificate(String sslCertificate, String requestId) { DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder() .setSslCertificate(sslCertificate) + .setRequestId(requestId) .build(); return deleteSslCertificate(request); } @@ -226,8 +241,10 @@ public final Operation deleteSslCertificate(String sslCertificate) { *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = sslCertificateClient.deleteSslCertificate(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest requ
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = sslCertificateClient.deleteSslCertificateCallable().futureCall(request);
    *   // Do something
@@ -365,21 +384,28 @@ public final UnaryCallable getSslC
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
-   *   Operation response = sslCertificateClient.insertSslCertificate(project, sslCertificateResource);
+   *   Operation response = sslCertificateClient.insertSslCertificate(requestId, project, sslCertificateResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. + * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSslCertificate(ProjectName project, SslCertificate sslCertificateResource) { + public final Operation insertSslCertificate(String requestId, ProjectName project, SslCertificate sslCertificateResource) { InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setSslCertificateResource(sslCertificateResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertSslCertificate(ProjectName project, SslCertificate * Sample code: *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
-   *   Operation response = sslCertificateClient.insertSslCertificate(project.toString(), sslCertificateResource);
+   *   Operation response = sslCertificateClient.insertSslCertificate(requestId, project.toString(), sslCertificateResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. + * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSslCertificate(String project, SslCertificate sslCertificateResource) { + public final Operation insertSslCertificate(String requestId, String project, SslCertificate sslCertificateResource) { InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setSslCertificateResource(sslCertificateResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertSslCertificate(String project, SslCertificate sslCe * Sample code: *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
    *   InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setSslCertificateResource(sslCertificateResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertSslCertificate(InsertSslCertificateHttpRequest requ
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
    *   InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setSslCertificateResource(sslCertificateResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java
index b7716df69e54..6a7bde97b7df 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java
@@ -37,6 +37,7 @@ public final class SslCertificateList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private SslCertificateList() {
     this.id = null;
@@ -44,6 +45,7 @@ private SslCertificateList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private SslCertificateList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(SslCertificateList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(SslCertificateList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public SslCertificateList build() {
 
 
 
 
+
       return new SslCertificateList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java
index 7d2e287ee3ea..6a94c9c7b435 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java
@@ -17,21 +17,25 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import javax.annotation.Generated;
 
 @Generated("by GAPIC")
 @BetaApi
-public final class SslCertificateName implements ResourceName {
+public final class SslCertificateName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String sslCertificate;
   private static final PathTemplate PATH_TEMPLATE =
-      PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}");
 
   private volatile Map fieldValuesMap;
 
@@ -48,12 +52,25 @@ private SslCertificateName(Builder builder) {
     sslCertificate = Preconditions.checkNotNull(builder.getSslCertificate());
   }
 
-  public static SslCertificateName of(String project, String sslCertificate) {
-    return newBuilder().setProject(project).setSslCertificate(sslCertificate).build();
+  public static SslCertificateName of(
+      String project,
+      String sslCertificate
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setSslCertificate(sslCertificate)
+      .build();
   }
 
-  public static String format(String project, String sslCertificate) {
-    return of(project, sslCertificate).toString();
+  public static String format(
+      String project,
+      String sslCertificate
+      ) {
+    return of(
+        project,
+        sslCertificate
+        )
+        .toString();
   }
 
   public String getProject() {
@@ -64,6 +81,7 @@ public String getSslCertificate() {
     return sslCertificate;
   }
 
+
   @Override
   public Map getFieldValuesMap() {
     if (fieldValuesMap == null) {
@@ -83,19 +101,20 @@ public String getFieldValue(String fieldName) {
     return getFieldValuesMap().get(fieldName);
   }
 
+
   public static ResourceNameFactory newFactory() {
     return new ResourceNameFactory() {
-      public SslCertificateName parse(String formattedString) {
-        return SslCertificateName.parse(formattedString);
-      }
+      public SslCertificateName parse(String formattedString) {return SslCertificateName.parse(formattedString);}
     };
   }
 
   public static SslCertificateName parse(String formattedString) {
     Map matchMap =
-        PATH_TEMPLATE.validatedMatch(
-            formattedString, "SslCertificateName.parse: formattedString not in valid format");
-    return of(matchMap.get("project"), matchMap.get("sslCertificate"));
+        PATH_TEMPLATE.validatedMatch(formattedString, "SslCertificateName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("sslCertificate")
+    );
   }
 
   public static boolean isParsableFrom(String formattedString) {
@@ -109,7 +128,6 @@ public static class Builder {
     public String getProject() {
       return project;
     }
-
     public String getSslCertificate() {
       return sslCertificate;
     }
@@ -118,7 +136,6 @@ public Builder setProject(String project) {
       this.project = project;
       return this;
     }
-
     public Builder setSslCertificate(String sslCertificate) {
       this.sslCertificate = sslCertificate;
       return this;
@@ -126,7 +143,7 @@ public Builder setSslCertificate(String sslCertificate) {
 
     private Builder() {}
 
-    public Builder(SslCertificateName sslCertificateName) {
+    public Builder (SslCertificateName sslCertificateName) {
       project = sslCertificateName.project;
       sslCertificate = sslCertificateName.sslCertificate;
     }
@@ -140,7 +157,8 @@ public SslCertificateName build() {
   public String toString() {
     return PATH_TEMPLATE.instantiate(
         "project", project,
-        "sslCertificate", sslCertificate);
+        "sslCertificate", sslCertificate
+        );
   }
 
   @Override
@@ -150,14 +168,19 @@ public boolean equals(Object o) {
     }
     if (o instanceof SslCertificateName) {
       SslCertificateName that = (SslCertificateName) o;
-      return Objects.equals(this.project, that.getProject())
-          && Objects.equals(this.sslCertificate, that.getSslCertificate());
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.sslCertificate, that.getSslCertificate())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(project, sslCertificate);
+    return Objects.hash(
+      project,
+      sslCertificate
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java
index 152ddeff5d48..6fcd514d1b54 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,6 +39,7 @@ public final class StartInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private StartInstanceHttpRequest() {
@@ -46,9 +50,11 @@ private StartInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
+
   private StartInstanceHttpRequest(
       String access_token,
       String callback,
@@ -57,7 +63,9 @@ private StartInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      String userIp) {
+      String requestId,
+      String userIp
+      ) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -65,6 +73,7 @@ private StartInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -92,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -121,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -161,28 +176,30 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(StartInstanceHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static StartInstanceHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final StartInstanceHttpRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new StartInstanceHttpRequest();
   }
@@ -195,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -222,6 +240,9 @@ public Builder mergeFrom(StartInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -236,6 +257,7 @@ public Builder mergeFrom(StartInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -302,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -311,18 +342,34 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
+
     public StartInstanceHttpRequest build() {
       String missing = "";
 
+
+
       if (instance == null) {
         missing += " instance";
       }
 
+
+
+
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new StartInstanceHttpRequest(
-          access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp);
+        access_token,
+        callback,
+        fields,
+        instance,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp
+      );
     }
 
     public Builder clone() {
@@ -334,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -342,29 +390,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "StartInstanceHttpRequest{"
-        + "access_token="
-        + access_token
-        + ", "
-        + "callback="
-        + callback
-        + ", "
-        + "fields="
-        + fields
-        + ", "
-        + "instance="
-        + instance
-        + ", "
-        + "key="
-        + key
-        + ", "
-        + "prettyPrint="
-        + prettyPrint
-        + ", "
-        + "quotaUser="
-        + quotaUser
-        + ", "
-        + "userIp="
-        + userIp
+        + "access_token=" + access_token + ", "
+        + "callback=" + callback + ", "
+        + "fields=" + fields + ", "
+        + "instance=" + instance + ", "
+        + "key=" + key + ", "
+        + "prettyPrint=" + prettyPrint + ", "
+        + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
+        + "userIp=" + userIp
         + "}";
   }
 
@@ -375,14 +409,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof StartInstanceHttpRequest) {
       StartInstanceHttpRequest that = (StartInstanceHttpRequest) o;
-      return Objects.equals(this.access_token, that.getAccessToken())
-          && Objects.equals(this.callback, that.getCallback())
-          && Objects.equals(this.fields, that.getFields())
-          && Objects.equals(this.instance, that.getInstance())
-          && Objects.equals(this.key, that.getKey())
-          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
-          && Objects.equals(this.quotaUser, that.getQuotaUser())
-          && Objects.equals(this.userIp, that.getUserIp());
+      return
+          Objects.equals(this.access_token, that.getAccessToken()) &&
+          Objects.equals(this.callback, that.getCallback()) &&
+          Objects.equals(this.fields, that.getFields()) &&
+          Objects.equals(this.instance, that.getInstance()) &&
+          Objects.equals(this.key, that.getKey()) &&
+          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
+          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
+          Objects.equals(this.userIp, that.getUserIp())
+          ;
     }
     return false;
   }
@@ -390,6 +427,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp);
+      access_token,
+      callback,
+      fields,
+      instance,
+      key,
+      prettyPrint,
+      quotaUser,
+      requestId,
+      userIp
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java
index 4824ec430416..314517246381 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java
@@ -40,6 +40,7 @@ public final class StartWithEncryptionKeyInstanceHttpRequest implements ApiMessa
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private StartWithEncryptionKeyInstanceHttpRequest() {
@@ -51,6 +52,7 @@ private StartWithEncryptionKeyInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -64,6 +66,7 @@ private StartWithEncryptionKeyInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -74,6 +77,7 @@ private StartWithEncryptionKeyInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -180,6 +190,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -213,6 +227,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -243,6 +258,9 @@ public Builder mergeFrom(StartWithEncryptionKeyInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -258,6 +276,7 @@ public Builder mergeFrom(StartWithEncryptionKeyInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -356,6 +384,7 @@ public StartWithEncryptionKeyInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -368,6 +397,7 @@ public StartWithEncryptionKeyInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -382,6 +412,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -398,6 +429,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -418,6 +450,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -435,6 +468,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java
index 7c5a50ffd4a5..a42f10345e4d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java
@@ -39,6 +39,7 @@ public final class StopInstanceHttpRequest implements ApiMessage {
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
+  private final String requestId;
   private final String userIp;
 
   private StopInstanceHttpRequest() {
@@ -49,6 +50,7 @@ private StopInstanceHttpRequest() {
     this.key = null;
     this.prettyPrint = null;
     this.quotaUser = null;
+    this.requestId = null;
     this.userIp = null;
   }
 
@@ -61,6 +63,7 @@ private StopInstanceHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
+      String requestId,
       String userIp
       ) {
     this.access_token = access_token;
@@ -70,6 +73,7 @@ private StopInstanceHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
+    this.requestId = requestId;
     this.userIp = userIp;
   }
 
@@ -97,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
+    if (fieldNames.contains("requestId") && requestId != null) {
+      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
+    }
     if (fieldNames.contains("userIp") && userIp != null) {
       fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
     }
@@ -126,6 +133,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("quotaUser")) {
       return String.valueOf(quotaUser);
     }
+    if (fieldName.equals("requestId")) {
+      return String.valueOf(requestId);
+    }
     if (fieldName.equals("userIp")) {
       return String.valueOf(userIp);
     }
@@ -166,6 +176,10 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
+  public String getRequestId() {
+    return requestId;
+  }
+
   public String getUserIp() {
     return userIp;
   }
@@ -198,6 +212,7 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
+    private String requestId;
     private String userIp;
 
     Builder() {}
@@ -225,6 +240,9 @@ public Builder mergeFrom(StopInstanceHttpRequest other) {
       if (other.getQuotaUser() != null) {
         this.quotaUser = other.quotaUser;
       }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
       if (other.getUserIp() != null) {
         this.userIp = other.userIp;
       }
@@ -239,6 +257,7 @@ public Builder mergeFrom(StopInstanceHttpRequest other) {
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
 
@@ -305,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
     public String getUserIp() {
       return userIp;
     }
@@ -327,6 +355,7 @@ public StopInstanceHttpRequest build() {
 
 
 
+
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
@@ -338,6 +367,7 @@ public StopInstanceHttpRequest build() {
         key,
         prettyPrint,
         quotaUser,
+        requestId,
         userIp
       );
     }
@@ -351,6 +381,7 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
     }
@@ -366,6 +397,7 @@ public String toString() {
         + "key=" + key + ", "
         + "prettyPrint=" + prettyPrint + ", "
         + "quotaUser=" + quotaUser + ", "
+        + "requestId=" + requestId + ", "
         + "userIp=" + userIp
         + "}";
   }
@@ -385,6 +417,7 @@ public boolean equals(Object o) {
           Objects.equals(this.key, that.getKey()) &&
           Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
           Objects.equals(this.quotaUser, that.getQuotaUser()) &&
+          Objects.equals(this.requestId, that.getRequestId()) &&
           Objects.equals(this.userIp, that.getUserIp())
           ;
     }
@@ -401,6 +434,7 @@ public int hashCode() {
       key,
       prettyPrint,
       quotaUser,
+      requestId,
       userIp
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java
index a3d8de56c02c..eb16487c754e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java
@@ -34,25 +34,31 @@
 public final class Subnetwork implements ApiMessage {
   private final String creationTimestamp;
   private final String description;
+  private final String fingerprint;
   private final String gatewayAddress;
   private final String id;
   private final String ipCidrRange;
   private final String kind;
   private final String name;
   private final String network;
+  private final Boolean privateIpGoogleAccess;
   private final String region;
+  private final List secondaryIpRanges;
   private final String selfLink;
 
   private Subnetwork() {
     this.creationTimestamp = null;
     this.description = null;
+    this.fingerprint = null;
     this.gatewayAddress = null;
     this.id = null;
     this.ipCidrRange = null;
     this.kind = null;
     this.name = null;
     this.network = null;
+    this.privateIpGoogleAccess = null;
     this.region = null;
+    this.secondaryIpRanges = null;
     this.selfLink = null;
   }
 
@@ -60,24 +66,30 @@ private Subnetwork() {
   private Subnetwork(
       String creationTimestamp,
       String description,
+      String fingerprint,
       String gatewayAddress,
       String id,
       String ipCidrRange,
       String kind,
       String name,
       String network,
+      Boolean privateIpGoogleAccess,
       String region,
+      List secondaryIpRanges,
       String selfLink
       ) {
     this.creationTimestamp = creationTimestamp;
     this.description = description;
+    this.fingerprint = fingerprint;
     this.gatewayAddress = gatewayAddress;
     this.id = id;
     this.ipCidrRange = ipCidrRange;
     this.kind = kind;
     this.name = name;
     this.network = network;
+    this.privateIpGoogleAccess = privateIpGoogleAccess;
     this.region = region;
+    this.secondaryIpRanges = secondaryIpRanges;
     this.selfLink = selfLink;
   }
 
@@ -90,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("description") && description != null) {
       fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
     }
+    if (fieldNames.contains("fingerprint") && fingerprint != null) {
+      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
+    }
     if (fieldNames.contains("gatewayAddress") && gatewayAddress != null) {
       fieldMap.put("gatewayAddress", Collections.singletonList(String.valueOf(gatewayAddress)));
     }
@@ -108,9 +123,19 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("network") && network != null) {
       fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
     }
+    if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) {
+      fieldMap.put("privateIpGoogleAccess", Collections.singletonList(String.valueOf(privateIpGoogleAccess)));
+    }
     if (fieldNames.contains("region") && region != null) {
       fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
     }
+    if (fieldNames.contains("secondaryIpRanges") && secondaryIpRanges != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (SubnetworkSecondaryRange item : secondaryIpRanges) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("secondaryIpRanges", stringList.build());
+    }
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
@@ -125,6 +150,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("description")) {
       return String.valueOf(description);
     }
+    if (fieldName.equals("fingerprint")) {
+      return String.valueOf(fingerprint);
+    }
     if (fieldName.equals("gatewayAddress")) {
       return String.valueOf(gatewayAddress);
     }
@@ -143,9 +171,15 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("network")) {
       return String.valueOf(network);
     }
+    if (fieldName.equals("privateIpGoogleAccess")) {
+      return String.valueOf(privateIpGoogleAccess);
+    }
     if (fieldName.equals("region")) {
       return String.valueOf(region);
     }
+    if (fieldName.equals("secondaryIpRanges")) {
+      return String.valueOf(secondaryIpRanges);
+    }
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
@@ -166,6 +200,10 @@ public String getDescription() {
     return description;
   }
 
+  public String getFingerprint() {
+    return fingerprint;
+  }
+
   public String getGatewayAddress() {
     return gatewayAddress;
   }
@@ -190,10 +228,18 @@ public String getNetwork() {
     return network;
   }
 
+  public Boolean getPrivateIpGoogleAccess() {
+    return privateIpGoogleAccess;
+  }
+
   public String getRegion() {
     return region;
   }
 
+  public List getSecondaryIpRangesList() {
+    return secondaryIpRanges;
+  }
+
   public String getSelfLink() {
     return selfLink;
   }
@@ -221,13 +267,16 @@ public static Subnetwork getDefaultInstance() {
   public static class Builder {
     private String creationTimestamp;
     private String description;
+    private String fingerprint;
     private String gatewayAddress;
     private String id;
     private String ipCidrRange;
     private String kind;
     private String name;
     private String network;
+    private Boolean privateIpGoogleAccess;
     private String region;
+    private List secondaryIpRanges;
     private String selfLink;
 
     Builder() {}
@@ -240,6 +289,9 @@ public Builder mergeFrom(Subnetwork other) {
       if (other.getDescription() != null) {
         this.description = other.description;
       }
+      if (other.getFingerprint() != null) {
+        this.fingerprint = other.fingerprint;
+      }
       if (other.getGatewayAddress() != null) {
         this.gatewayAddress = other.gatewayAddress;
       }
@@ -258,9 +310,15 @@ public Builder mergeFrom(Subnetwork other) {
       if (other.getNetwork() != null) {
         this.network = other.network;
       }
+      if (other.getPrivateIpGoogleAccess() != null) {
+        this.privateIpGoogleAccess = other.privateIpGoogleAccess;
+      }
       if (other.getRegion() != null) {
         this.region = other.region;
       }
+      if (other.getSecondaryIpRangesList() != null) {
+        this.secondaryIpRanges = other.secondaryIpRanges;
+      }
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
@@ -270,13 +328,16 @@ public Builder mergeFrom(Subnetwork other) {
     Builder(Subnetwork source) {
       this.creationTimestamp = source.creationTimestamp;
       this.description = source.description;
+      this.fingerprint = source.fingerprint;
       this.gatewayAddress = source.gatewayAddress;
       this.id = source.id;
       this.ipCidrRange = source.ipCidrRange;
       this.kind = source.kind;
       this.name = source.name;
       this.network = source.network;
+      this.privateIpGoogleAccess = source.privateIpGoogleAccess;
       this.region = source.region;
+      this.secondaryIpRanges = source.secondaryIpRanges;
       this.selfLink = source.selfLink;
     }
 
@@ -298,6 +359,15 @@ public Builder setDescription(String description) {
       return this;
     }
 
+    public String getFingerprint() {
+      return fingerprint;
+    }
+
+    public Builder setFingerprint(String fingerprint) {
+      this.fingerprint = fingerprint;
+      return this;
+    }
+
     public String getGatewayAddress() {
       return gatewayAddress;
     }
@@ -352,6 +422,15 @@ public Builder setNetwork(String network) {
       return this;
     }
 
+    public Boolean getPrivateIpGoogleAccess() {
+      return privateIpGoogleAccess;
+    }
+
+    public Builder setPrivateIpGoogleAccess(Boolean privateIpGoogleAccess) {
+      this.privateIpGoogleAccess = privateIpGoogleAccess;
+      return this;
+    }
+
     public String getRegion() {
       return region;
     }
@@ -361,6 +440,23 @@ public Builder setRegion(String region) {
       return this;
     }
 
+    public List getSecondaryIpRangesList() {
+      return secondaryIpRanges;
+    }
+
+    public Builder addAllSecondaryIpRanges(List secondaryIpRanges) {
+      if (this.secondaryIpRanges == null) {
+        this.secondaryIpRanges = new ArrayList<>(secondaryIpRanges.size());
+      }
+      this.secondaryIpRanges.addAll(secondaryIpRanges);
+      return this;
+    }
+
+    public Builder addSecondaryIpRanges(SubnetworkSecondaryRange secondaryIpRanges) {
+      this.secondaryIpRanges.add(secondaryIpRanges);
+      return this;
+    }
+
     public String getSelfLink() {
       return selfLink;
     }
@@ -381,16 +477,22 @@ public Subnetwork build() {
 
 
 
+
+
+
       return new Subnetwork(
         creationTimestamp,
         description,
+        fingerprint,
         gatewayAddress,
         id,
         ipCidrRange,
         kind,
         name,
         network,
+        privateIpGoogleAccess,
         region,
+        secondaryIpRanges,
         selfLink
       );
     }
@@ -399,13 +501,16 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setCreationTimestamp(this.creationTimestamp);
       newBuilder.setDescription(this.description);
+      newBuilder.setFingerprint(this.fingerprint);
       newBuilder.setGatewayAddress(this.gatewayAddress);
       newBuilder.setId(this.id);
       newBuilder.setIpCidrRange(this.ipCidrRange);
       newBuilder.setKind(this.kind);
       newBuilder.setName(this.name);
       newBuilder.setNetwork(this.network);
+      newBuilder.setPrivateIpGoogleAccess(this.privateIpGoogleAccess);
       newBuilder.setRegion(this.region);
+      newBuilder.addAllSecondaryIpRanges(this.secondaryIpRanges);
       newBuilder.setSelfLink(this.selfLink);
       return newBuilder;
     }
@@ -416,13 +521,16 @@ public String toString() {
     return "Subnetwork{"
         + "creationTimestamp=" + creationTimestamp + ", "
         + "description=" + description + ", "
+        + "fingerprint=" + fingerprint + ", "
         + "gatewayAddress=" + gatewayAddress + ", "
         + "id=" + id + ", "
         + "ipCidrRange=" + ipCidrRange + ", "
         + "kind=" + kind + ", "
         + "name=" + name + ", "
         + "network=" + network + ", "
+        + "privateIpGoogleAccess=" + privateIpGoogleAccess + ", "
         + "region=" + region + ", "
+        + "secondaryIpRanges=" + secondaryIpRanges + ", "
         + "selfLink=" + selfLink
         + "}";
   }
@@ -437,13 +545,16 @@ public boolean equals(Object o) {
       return
           Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
           Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.fingerprint, that.getFingerprint()) &&
           Objects.equals(this.gatewayAddress, that.getGatewayAddress()) &&
           Objects.equals(this.id, that.getId()) &&
           Objects.equals(this.ipCidrRange, that.getIpCidrRange()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.name, that.getName()) &&
           Objects.equals(this.network, that.getNetwork()) &&
+          Objects.equals(this.privateIpGoogleAccess, that.getPrivateIpGoogleAccess()) &&
           Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.secondaryIpRanges, that.getSecondaryIpRangesList()) &&
           Objects.equals(this.selfLink, that.getSelfLink())
           ;
     }
@@ -455,13 +566,16 @@ public int hashCode() {
     return Objects.hash(
       creationTimestamp,
       description,
+      fingerprint,
       gatewayAddress,
       id,
       ipCidrRange,
       kind,
       name,
       network,
+      privateIpGoogleAccess,
       region,
+      secondaryIpRanges,
       selfLink
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java
index 3349e053d3f5..4a6d2931192b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java
@@ -37,6 +37,7 @@ public final class SubnetworkAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private SubnetworkAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private SubnetworkAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private SubnetworkAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(SubnetworkAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(SubnetworkAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public SubnetworkAggregatedList build() {
 
 
 
 
+
       return new SubnetworkAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
index 19383a8370a2..5319b3e8e779 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
@@ -23,12 +23,22 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.SubnetworkStub;
 import com.google.cloud.compute.v1.stub.SubnetworkStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -42,39 +52,41 @@
  * 
  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+ *   String requestId = "";
  *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
- *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
+ *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the subnetworkClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). + *

Note: close() needs to be called on the subnetworkClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * *

This class can be customized by passing in a custom instance of SubnetworkSettings to * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -104,14 +116,19 @@ public class SubnetworkClient implements BackgroundResource {
   private final SubnetworkSettings settings;
   private final SubnetworkStub stub;
 
-  /** Constructs an instance of SubnetworkClient with default settings. */
+
+
+  /**
+   * Constructs an instance of SubnetworkClient with default settings.
+   */
   public static final SubnetworkClient create() throws IOException {
     return create(SubnetworkSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of SubnetworkClient, using the given settings. The channels are created
-   * based on the settings passed in, or defaults for any settings that are not set.
+   * Constructs an instance of SubnetworkClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
   public static final SubnetworkClient create(SubnetworkSettings settings) throws IOException {
     return new SubnetworkClient(settings);
@@ -127,8 +144,9 @@ public static final SubnetworkClient create(SubnetworkStub stub) {
   }
 
   /**
-   * Constructs an instance of SubnetworkClient, using the given settings. This is protected so that
-   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
+   * Constructs an instance of SubnetworkClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
   protected SubnetworkClient(SubnetworkSettings settings) throws IOException {
     this.settings = settings;
@@ -150,12 +168,12 @@ public SubnetworkStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -169,12 +187,11 @@ public SubnetworkStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
-      ProjectName project) {
+  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(ProjectName project) {
     AggregatedListSubnetworksHttpRequest request =
         AggregatedListSubnetworksHttpRequest.newBuilder()
-            .setProject(project == null ? null : project.toString())
-            .build();
+        .setProject(project == null ? null : project.toString())
+        .build();
     return aggregatedListSubnetworks(request);
   }
 
@@ -182,8 +199,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -199,7 +215,9 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
   @BetaApi
   public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(String project) {
     AggregatedListSubnetworksHttpRequest request =
-        AggregatedListSubnetworksHttpRequest.newBuilder().setProject(project).build();
+        AggregatedListSubnetworksHttpRequest.newBuilder()
+        .setProject(project)
+        .build();
     return aggregatedListSubnetworks(request);
   }
 
@@ -207,8 +225,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(St
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -225,17 +242,16 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
-      AggregatedListSubnetworksHttpRequest request) {
-    return aggregatedListSubnetworksPagedCallable().call(request);
+  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(AggregatedListSubnetworksHttpRequest request) {
+    return aggregatedListSubnetworksPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -251,9 +267,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
    * 
*/ @BetaApi - public final UnaryCallable< - AggregatedListSubnetworksHttpRequest, AggregatedListSubnetworksPagedResponse> - aggregatedListSubnetworksPagedCallable() { + public final UnaryCallable aggregatedListSubnetworksPagedCallable() { return stub.aggregatedListSubnetworksPagedCallable(); } @@ -261,8 +275,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks( /** * Retrieves an aggregated list of subnetworks. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -285,8 +298,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
    * 
*/ @BetaApi - public final UnaryCallable - aggregatedListSubnetworksCallable() { + public final UnaryCallable aggregatedListSubnetworksCallable() { return stub.aggregatedListSubnetworksCallable(); } @@ -294,25 +306,31 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks( /** * Deletes the specified subnetwork. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
-   *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
+   *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSubnetwork(SubnetworkName subnetwork) { + public final Operation deleteSubnetwork(String requestId, SubnetworkName subnetwork) { DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder() - .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .build(); return deleteSubnetwork(request); } @@ -320,23 +338,31 @@ public final Operation deleteSubnetwork(SubnetworkName subnetwork) { /** * Deletes the specified subnetwork. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
-   *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork.toString());
+   *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSubnetwork(String subnetwork) { + public final Operation deleteSubnetwork(String requestId, String subnetwork) { DeleteSubnetworkHttpRequest request = - DeleteSubnetworkHttpRequest.newBuilder().setSubnetwork(subnetwork).build(); + DeleteSubnetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .build(); return deleteSubnetwork(request); } @@ -344,12 +370,13 @@ public final Operation deleteSubnetwork(String subnetwork) { /** * Deletes the specified subnetwork. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .build();
    *   Operation response = subnetworkClient.deleteSubnetwork(request);
@@ -368,12 +395,13 @@ public final Operation deleteSubnetwork(DeleteSubnetworkHttpRequest request) {
   /**
    * Deletes the specified subnetwork.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .build();
    *   ApiFuture<Operation> future = subnetworkClient.deleteSubnetworkCallable().futureCall(request);
@@ -391,31 +419,34 @@ public final UnaryCallable deleteSubnetw
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
-   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource);
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to update. * @param subnetworksExpandIpCidrRangeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation expandIpCidrRangeSubnetwork( - SubnetworkName subnetwork, - SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + public final Operation expandIpCidrRangeSubnetwork(String requestId, SubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() - .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) - .setSubnetworksExpandIpCidrRangeRequestResource( - subnetworksExpandIpCidrRangeRequestResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource) + .build(); return expandIpCidrRangeSubnetwork(request); } @@ -423,31 +454,34 @@ public final Operation expandIpCidrRangeSubnetwork( /** * Expands the IP CIDR range of the subnetwork to a specified value. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
-   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(subnetwork.toString(), subnetworksExpandIpCidrRangeRequestResource);
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(requestId, subnetwork.toString(), subnetworksExpandIpCidrRangeRequestResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to update. * @param subnetworksExpandIpCidrRangeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation expandIpCidrRangeSubnetwork( - String subnetwork, - SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + public final Operation expandIpCidrRangeSubnetwork(String requestId, String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() - .setSubnetwork(subnetwork) - .setSubnetworksExpandIpCidrRangeRequestResource( - subnetworksExpandIpCidrRangeRequestResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource) + .build(); return expandIpCidrRangeSubnetwork(request); } @@ -455,13 +489,14 @@ public final Operation expandIpCidrRangeSubnetwork( /** * Expands the IP CIDR range of the subnetwork to a specified value. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
    *     .build();
@@ -473,8 +508,7 @@ public final Operation expandIpCidrRangeSubnetwork(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation expandIpCidrRangeSubnetwork(
-      ExpandIpCidrRangeSubnetworkHttpRequest request) {
+  public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHttpRequest request) {
     return expandIpCidrRangeSubnetworkCallable().call(request);
   }
 
@@ -482,13 +516,14 @@ public final Operation expandIpCidrRangeSubnetwork(
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
    *     .build();
@@ -499,8 +534,7 @@ public final Operation expandIpCidrRangeSubnetwork(
    * 
*/ @BetaApi - public final UnaryCallable - expandIpCidrRangeSubnetworkCallable() { + public final UnaryCallable expandIpCidrRangeSubnetworkCallable() { return stub.expandIpCidrRangeSubnetworkCallable(); } @@ -508,8 +542,7 @@ public final Operation expandIpCidrRangeSubnetwork( /** * Returns the specified subnetwork. Get a list of available subnetworks list() request. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -525,8 +558,8 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) {
 
     GetSubnetworkHttpRequest request =
         GetSubnetworkHttpRequest.newBuilder()
-            .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
-            .build();
+        .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
+        .build();
     return getSubnetwork(request);
   }
 
@@ -534,8 +567,7 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -550,7 +582,9 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) {
   public final Subnetwork getSubnetwork(String subnetwork) {
 
     GetSubnetworkHttpRequest request =
-        GetSubnetworkHttpRequest.newBuilder().setSubnetwork(subnetwork).build();
+        GetSubnetworkHttpRequest.newBuilder()
+        .setSubnetwork(subnetwork)
+        .build();
     return getSubnetwork(request);
   }
 
@@ -558,8 +592,7 @@ public final Subnetwork getSubnetwork(String subnetwork) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -582,8 +615,7 @@ public final Subnetwork getSubnetwork(GetSubnetworkHttpRequest request) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -605,28 +637,34 @@ public final UnaryCallable getSubnetworkCa
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
-   *   Operation response = subnetworkClient.insertSubnetwork(region, subnetworkResource);
+   *   Operation response = subnetworkClient.insertSubnetwork(requestId, region, subnetworkResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param subnetworkResource A Subnetwork resource. + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSubnetwork(RegionName region, Subnetwork subnetworkResource) { + public final Operation insertSubnetwork(String requestId, RegionName region, Subnetwork subnetworkResource) { InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder() - .setRegion(region == null ? null : region.toString()) - .setSubnetworkResource(subnetworkResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setSubnetworkResource(subnetworkResource) + .build(); return insertSubnetwork(request); } @@ -634,28 +672,34 @@ public final Operation insertSubnetwork(RegionName region, Subnetwork subnetwork /** * Creates a subnetwork in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
-   *   Operation response = subnetworkClient.insertSubnetwork(region.toString(), subnetworkResource);
+   *   Operation response = subnetworkClient.insertSubnetwork(requestId, region.toString(), subnetworkResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param subnetworkResource A Subnetwork resource. + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSubnetwork(String region, Subnetwork subnetworkResource) { + public final Operation insertSubnetwork(String requestId, String region, Subnetwork subnetworkResource) { InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder() - .setRegion(region) - .setSubnetworkResource(subnetworkResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setSubnetworkResource(subnetworkResource) + .build(); return insertSubnetwork(request); } @@ -663,13 +707,14 @@ public final Operation insertSubnetwork(String region, Subnetwork subnetworkReso /** * Creates a subnetwork in the specified project using the data included in the request. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setSubnetworkResource(subnetworkResource)
    *     .build();
@@ -689,13 +734,14 @@ public final Operation insertSubnetwork(InsertSubnetworkHttpRequest request) {
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setSubnetworkResource(subnetworkResource)
    *     .build();
@@ -714,8 +760,7 @@ public final UnaryCallable insertSubnetw
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -732,8 +777,8 @@ public final UnaryCallable insertSubnetw
   public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
     ListSubnetworksHttpRequest request =
         ListSubnetworksHttpRequest.newBuilder()
-            .setRegion(region == null ? null : region.toString())
-            .build();
+        .setRegion(region == null ? null : region.toString())
+        .build();
     return listSubnetworks(request);
   }
 
@@ -741,8 +786,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -758,7 +802,9 @@ public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
   @BetaApi
   public final ListSubnetworksPagedResponse listSubnetworks(String region) {
     ListSubnetworksHttpRequest request =
-        ListSubnetworksHttpRequest.newBuilder().setRegion(region).build();
+        ListSubnetworksHttpRequest.newBuilder()
+        .setRegion(region)
+        .build();
     return listSubnetworks(request);
   }
 
@@ -766,8 +812,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -785,15 +830,15 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
    */
   @BetaApi
   public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpRequest request) {
-    return listSubnetworksPagedCallable().call(request);
+    return listSubnetworksPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -809,8 +854,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpReq
    * 
*/ @BetaApi - public final UnaryCallable - listSubnetworksPagedCallable() { + public final UnaryCallable listSubnetworksPagedCallable() { return stub.listSubnetworksPagedCallable(); } @@ -818,8 +862,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpReq /** * Retrieves a list of subnetworks available to the specified project. * - *

Sample code: - * + * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -846,6 +889,252 @@ public final UnaryCallable listSubne
     return stub.listSubnetworksCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.
+   *
+   * Sample code:
+   * 

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   Operation response = subnetworkClient.patchSubnetwork(requestId, subnetwork, subnetworkResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param subnetwork Name of the Subnetwork resource to patch. + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchSubnetwork(String requestId, SubnetworkName subnetwork, Subnetwork subnetworkResource) { + + PatchSubnetworkHttpRequest request = + PatchSubnetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworkResource(subnetworkResource) + .build(); + return patchSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   Operation response = subnetworkClient.patchSubnetwork(requestId, subnetwork.toString(), subnetworkResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param subnetwork Name of the Subnetwork resource to patch. + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchSubnetwork(String requestId, String subnetwork, Subnetwork subnetworkResource) { + + PatchSubnetworkHttpRequest request = + PatchSubnetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .setSubnetworkResource(subnetworkResource) + .build(); + return patchSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSubnetwork(subnetwork.toString())
+   *     .setSubnetworkResource(subnetworkResource)
+   *     .build();
+   *   Operation response = subnetworkClient.patchSubnetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchSubnetwork(PatchSubnetworkHttpRequest request) { + return patchSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
+   *   PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSubnetwork(subnetwork.toString())
+   *     .setSubnetworkResource(subnetworkResource)
+   *     .build();
+   *   ApiFuture<Operation> future = subnetworkClient.patchSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchSubnetworkCallable() { + return stub.patchSubnetworkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
+   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param subnetwork Name of the Subnetwork resource. + * @param subnetworksSetPrivateIpGoogleAccessRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, SubnetworkName subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { + + SetPrivateIpGoogleAccessSubnetworkHttpRequest request = + SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource) + .build(); + return setPrivateIpGoogleAccessSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
+   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork.toString(), subnetworksSetPrivateIpGoogleAccessRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param subnetwork Name of the Subnetwork resource. + * @param subnetworksSetPrivateIpGoogleAccessRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, String subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { + + SetPrivateIpGoogleAccessSubnetworkHttpRequest request = + SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder() + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource) + .build(); + return setPrivateIpGoogleAccessSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
+   *   SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSubnetwork(subnetwork.toString())
+   *     .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource)
+   *     .build();
+   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setPrivateIpGoogleAccessSubnetwork(SetPrivateIpGoogleAccessSubnetworkHttpRequest request) { + return setPrivateIpGoogleAccessSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * Sample code: + *

+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   String requestId = "";
+   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
+   *   SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSubnetwork(subnetwork.toString())
+   *     .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = subnetworkClient.setPrivateIpGoogleAccessSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { + return stub.setPrivateIpGoogleAccessSubnetworkCallable(); + } + @Override public final void close() throws Exception { stub.close(); @@ -876,20 +1165,15 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListSubnetworksPagedResponse - extends AbstractPagedListResponse< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList, - AggregatedListSubnetworksPage, - AggregatedListSubnetworksFixedSizeCollection> { + public static class AggregatedListSubnetworksPagedResponse extends AbstractPagedListResponse< + AggregatedListSubnetworksHttpRequest, + SubnetworkAggregatedList, + SubnetworksScopedList, + AggregatedListSubnetworksPage, + AggregatedListSubnetworksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList> - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = AggregatedListSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -897,8 +1181,7 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public AggregatedListSubnetworksPagedResponse apply( - AggregatedListSubnetworksPage input) { + public AggregatedListSubnetworksPagedResponse apply(AggregatedListSubnetworksPage input) { return new AggregatedListSubnetworksPagedResponse(input); } }); @@ -907,21 +1190,18 @@ public AggregatedListSubnetworksPagedResponse apply( private AggregatedListSubnetworksPagedResponse(AggregatedListSubnetworksPage page) { super(page, AggregatedListSubnetworksFixedSizeCollection.createEmptyCollection()); } + + } - public static class AggregatedListSubnetworksPage - extends AbstractPage< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList, - AggregatedListSubnetworksPage> { + public static class AggregatedListSubnetworksPage extends AbstractPage< + AggregatedListSubnetworksHttpRequest, + SubnetworkAggregatedList, + SubnetworksScopedList, + AggregatedListSubnetworksPage> { private AggregatedListSubnetworksPage( - PageContext< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList> - context, + PageContext context, SubnetworkAggregatedList response) { super(context, response); } @@ -932,37 +1212,31 @@ private static AggregatedListSubnetworksPage createEmptyPage() { @Override protected AggregatedListSubnetworksPage createPage( - PageContext< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList> - context, + PageContext context, SubnetworkAggregatedList response) { return new AggregatedListSubnetworksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList> - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class AggregatedListSubnetworksFixedSizeCollection - extends AbstractFixedSizeCollection< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList, - AggregatedListSubnetworksPage, - AggregatedListSubnetworksFixedSizeCollection> { + public static class AggregatedListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListSubnetworksHttpRequest, + SubnetworkAggregatedList, + SubnetworksScopedList, + AggregatedListSubnetworksPage, + AggregatedListSubnetworksFixedSizeCollection> { - private AggregatedListSubnetworksFixedSizeCollection( - List pages, int collectionSize) { + private AggregatedListSubnetworksFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -975,15 +1249,15 @@ protected AggregatedListSubnetworksFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListSubnetworksFixedSizeCollection(pages, collectionSize); } - } - public static class ListSubnetworksPagedResponse - extends AbstractPagedListResponse< - ListSubnetworksHttpRequest, - SubnetworkList, - Subnetwork, - ListSubnetworksPage, - ListSubnetworksFixedSizeCollection> { + + } + public static class ListSubnetworksPagedResponse extends AbstractPagedListResponse< + ListSubnetworksHttpRequest, + SubnetworkList, + Subnetwork, + ListSubnetworksPage, + ListSubnetworksFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1003,11 +1277,15 @@ public ListSubnetworksPagedResponse apply(ListSubnetworksPage input) { private ListSubnetworksPagedResponse(ListSubnetworksPage page) { super(page, ListSubnetworksFixedSizeCollection.createEmptyCollection()); } + + } - public static class ListSubnetworksPage - extends AbstractPage< - ListSubnetworksHttpRequest, SubnetworkList, Subnetwork, ListSubnetworksPage> { + public static class ListSubnetworksPage extends AbstractPage< + ListSubnetworksHttpRequest, + SubnetworkList, + Subnetwork, + ListSubnetworksPage> { private ListSubnetworksPage( PageContext context, @@ -1032,18 +1310,20 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class ListSubnetworksFixedSizeCollection - extends AbstractFixedSizeCollection< - ListSubnetworksHttpRequest, - SubnetworkList, - Subnetwork, - ListSubnetworksPage, - ListSubnetworksFixedSizeCollection> { + public static class ListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection< + ListSubnetworksHttpRequest, + SubnetworkList, + Subnetwork, + ListSubnetworksPage, + ListSubnetworksFixedSizeCollection> { - private ListSubnetworksFixedSizeCollection( - List pages, int collectionSize) { + private ListSubnetworksFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -1056,5 +1336,7 @@ protected ListSubnetworksFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListSubnetworksFixedSizeCollection(pages, collectionSize); } + + } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java index 6fbb3eb8406c..312f61f050b0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java @@ -37,6 +37,7 @@ public final class SubnetworkList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private SubnetworkList() { this.id = null; @@ -44,6 +45,7 @@ private SubnetworkList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private SubnetworkList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(SubnetworkList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(SubnetworkList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public SubnetworkList build() { + return new SubnetworkList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java index 0cadfd41d9f3..c033f453a625 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class SubnetworkName implements ResourceName { +public final class SubnetworkName implements com.google.api.resourcenames.ResourceName { private final String project; private final String region; private final String subnetwork; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java new file mode 100644 index 000000000000..d679ffab04f8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworkSecondaryRange implements ApiMessage { + private final String ipCidrRange; + private final String rangeName; + + private SubnetworkSecondaryRange() { + this.ipCidrRange = null; + this.rangeName = null; + } + + + private SubnetworkSecondaryRange( + String ipCidrRange, + String rangeName + ) { + this.ipCidrRange = ipCidrRange; + this.rangeName = rangeName; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); + } + if (fieldNames.contains("rangeName") && rangeName != null) { + fieldMap.put("rangeName", Collections.singletonList(String.valueOf(rangeName))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } + if (fieldName.equals("rangeName")) { + return String.valueOf(rangeName); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public String getRangeName() { + return rangeName; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SubnetworkSecondaryRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SubnetworkSecondaryRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SubnetworkSecondaryRange DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SubnetworkSecondaryRange(); + } + + public static class Builder { + private String ipCidrRange; + private String rangeName; + + Builder() {} + + public Builder mergeFrom(SubnetworkSecondaryRange other) { + if (other == SubnetworkSecondaryRange.getDefaultInstance()) return this; + if (other.getIpCidrRange() != null) { + this.ipCidrRange = other.ipCidrRange; + } + if (other.getRangeName() != null) { + this.rangeName = other.rangeName; + } + return this; + } + + Builder(SubnetworkSecondaryRange source) { + this.ipCidrRange = source.ipCidrRange; + this.rangeName = source.rangeName; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public Builder setIpCidrRange(String ipCidrRange) { + this.ipCidrRange = ipCidrRange; + return this; + } + + public String getRangeName() { + return rangeName; + } + + public Builder setRangeName(String rangeName) { + this.rangeName = rangeName; + return this; + } + + + public SubnetworkSecondaryRange build() { + + return new SubnetworkSecondaryRange( + ipCidrRange, + rangeName + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIpCidrRange(this.ipCidrRange); + newBuilder.setRangeName(this.rangeName); + return newBuilder; + } + } + + @Override + public String toString() { + return "SubnetworkSecondaryRange{" + + "ipCidrRange=" + ipCidrRange + ", " + + "rangeName=" + rangeName + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworkSecondaryRange) { + SubnetworkSecondaryRange that = (SubnetworkSecondaryRange) o; + return + Objects.equals(this.ipCidrRange, that.getIpCidrRange()) && + Objects.equals(this.rangeName, that.getRangeName()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + ipCidrRange, + rangeName + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java index ad08ace8b7a3..91f238533c27 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java @@ -128,6 +128,20 @@ public PagedCallSettings patchSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).patchSubnetworkSettings(); + } + + /** + * Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork. + */ + public UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).setPrivateIpGoogleAccessSubnetworkSettings(); + } + public static final SubnetworkSettings create(SubnetworkStubSettings stub) throws IOException { return new SubnetworkSettings.Builder(stub.toBuilder()).build(); @@ -289,6 +303,20 @@ public PagedCallSettings.Builder patchSubnetworkSettings() { + return getStubSettingsBuilder().patchSubnetworkSettings(); + } + + /** + * Returns the builder for the settings used for calls to setPrivateIpGoogleAccessSubnetwork. + */ + public UnaryCallSettings.Builder setPrivateIpGoogleAccessSubnetworkSettings() { + return getStubSettingsBuilder().setPrivateIpGoogleAccessSubnetworkSettings(); + } + @Override public SubnetworkSettings build() throws IOException { return new SubnetworkSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java new file mode 100644 index 000000000000..eb9159a40633 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SubnetworksSetPrivateIpGoogleAccessRequest implements ApiMessage { + private final Boolean privateIpGoogleAccess; + + private SubnetworksSetPrivateIpGoogleAccessRequest() { + this.privateIpGoogleAccess = null; + } + + + private SubnetworksSetPrivateIpGoogleAccessRequest( + Boolean privateIpGoogleAccess + ) { + this.privateIpGoogleAccess = privateIpGoogleAccess; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { + fieldMap.put("privateIpGoogleAccess", Collections.singletonList(String.valueOf(privateIpGoogleAccess))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("privateIpGoogleAccess")) { + return String.valueOf(privateIpGoogleAccess); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Boolean getPrivateIpGoogleAccess() { + return privateIpGoogleAccess; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(SubnetworksSetPrivateIpGoogleAccessRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static SubnetworksSetPrivateIpGoogleAccessRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final SubnetworksSetPrivateIpGoogleAccessRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new SubnetworksSetPrivateIpGoogleAccessRequest(); + } + + public static class Builder { + private Boolean privateIpGoogleAccess; + + Builder() {} + + public Builder mergeFrom(SubnetworksSetPrivateIpGoogleAccessRequest other) { + if (other == SubnetworksSetPrivateIpGoogleAccessRequest.getDefaultInstance()) return this; + if (other.getPrivateIpGoogleAccess() != null) { + this.privateIpGoogleAccess = other.privateIpGoogleAccess; + } + return this; + } + + Builder(SubnetworksSetPrivateIpGoogleAccessRequest source) { + this.privateIpGoogleAccess = source.privateIpGoogleAccess; + } + + public Boolean getPrivateIpGoogleAccess() { + return privateIpGoogleAccess; + } + + public Builder setPrivateIpGoogleAccess(Boolean privateIpGoogleAccess) { + this.privateIpGoogleAccess = privateIpGoogleAccess; + return this; + } + + + public SubnetworksSetPrivateIpGoogleAccessRequest build() { + return new SubnetworksSetPrivateIpGoogleAccessRequest( + privateIpGoogleAccess + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setPrivateIpGoogleAccess(this.privateIpGoogleAccess); + return newBuilder; + } + } + + @Override + public String toString() { + return "SubnetworksSetPrivateIpGoogleAccessRequest{" + + "privateIpGoogleAccess=" + privateIpGoogleAccess + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SubnetworksSetPrivateIpGoogleAccessRequest) { + SubnetworksSetPrivateIpGoogleAccessRequest that = (SubnetworksSetPrivateIpGoogleAccessRequest) o; + return + Objects.equals(this.privateIpGoogleAccess, that.getPrivateIpGoogleAccess()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + privateIpGoogleAccess + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java index ea693832d2dd..4e2d4d0a8c0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,6 +39,7 @@ public final class SwitchToCustomModeNetworkHttpRequest implements ApiMessage { private final String network; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private SwitchToCustomModeNetworkHttpRequest() { @@ -46,9 +50,11 @@ private SwitchToCustomModeNetworkHttpRequest() { this.network = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } + private SwitchToCustomModeNetworkHttpRequest( String access_token, String callback, @@ -57,7 +63,9 @@ private SwitchToCustomModeNetworkHttpRequest( String network, String prettyPrint, String quotaUser, - String userIp) { + String requestId, + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -65,6 +73,7 @@ private SwitchToCustomModeNetworkHttpRequest( this.network = network; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -92,6 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -121,6 +133,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -161,28 +176,30 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(SwitchToCustomModeNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static SwitchToCustomModeNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final SwitchToCustomModeNetworkHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new SwitchToCustomModeNetworkHttpRequest(); } @@ -195,6 +212,7 @@ public static class Builder { private String network; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -222,6 +240,9 @@ public Builder mergeFrom(SwitchToCustomModeNetworkHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -236,6 +257,7 @@ public Builder mergeFrom(SwitchToCustomModeNetworkHttpRequest other) { this.network = source.network; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -302,6 +324,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -311,18 +342,34 @@ public Builder setUserIp(String userIp) { return this; } + public SwitchToCustomModeNetworkHttpRequest build() { String missing = ""; + + + if (network == null) { missing += " network"; } + + + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SwitchToCustomModeNetworkHttpRequest( - access_token, callback, fields, key, network, prettyPrint, quotaUser, userIp); + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + requestId, + userIp + ); } public Builder clone() { @@ -334,6 +381,7 @@ public Builder clone() { newBuilder.setNetwork(this.network); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -342,29 +390,15 @@ public Builder clone() { @Override public String toString() { return "SwitchToCustomModeNetworkHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "key=" - + key - + ", " - + "network=" - + network - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "network=" + network + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + "}"; } @@ -375,14 +409,17 @@ public boolean equals(Object o) { } if (o instanceof SwitchToCustomModeNetworkHttpRequest) { SwitchToCustomModeNetworkHttpRequest that = (SwitchToCustomModeNetworkHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.network, that.getNetwork()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.network, that.getNetwork()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -390,6 +427,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, callback, fields, key, network, prettyPrint, quotaUser, userIp); + access_token, + callback, + fields, + key, + network, + prettyPrint, + quotaUser, + requestId, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java index fe267ad9e87a..1c9140eab5bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java @@ -52,8 +52,9 @@ *
  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+ *   String requestId = "";
  *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
- *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
+ *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
  * }
  * 
  * 
@@ -175,19 +176,26 @@ public TargetHttpProxyStub getStub() { * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
-   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpProxy(TargetHttpProxyName targetHttpProxy) { + public final Operation deleteTargetHttpProxy(String requestId, TargetHttpProxyName targetHttpProxy) { DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) .build(); return deleteTargetHttpProxy(request); @@ -200,19 +208,26 @@ public final Operation deleteTargetHttpProxy(TargetHttpProxyName targetHttpProxy * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
-   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy.toString());
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpProxy(String targetHttpProxy) { + public final Operation deleteTargetHttpProxy(String requestId, String targetHttpProxy) { DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy) .build(); return deleteTargetHttpProxy(request); @@ -225,8 +240,10 @@ public final Operation deleteTargetHttpProxy(String targetHttpProxy) { * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
    *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(request);
@@ -248,8 +265,10 @@ public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest re
    * Sample code:
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetHttpProxyClient.deleteTargetHttpProxyCallable().futureCall(request);
@@ -365,21 +384,28 @@ public final UnaryCallable getTa
    * Sample code:
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(project, targetHttpProxyResource);
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(requestId, project, targetHttpProxyResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. + * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpProxy(ProjectName project, TargetHttpProxy targetHttpProxyResource) { + public final Operation insertTargetHttpProxy(String requestId, ProjectName project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetHttpProxyResource(targetHttpProxyResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertTargetHttpProxy(ProjectName project, TargetHttpProx * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(project.toString(), targetHttpProxyResource);
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(requestId, project.toString(), targetHttpProxyResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. + * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpProxy(String project, TargetHttpProxy targetHttpProxyResource) { + public final Operation insertTargetHttpProxy(String requestId, String project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setTargetHttpProxyResource(targetHttpProxyResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertTargetHttpProxy(String project, TargetHttpProxy tar * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
    *   InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpProxyResource(targetHttpProxyResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertTargetHttpProxy(InsertTargetHttpProxyHttpRequest re
    * Sample code:
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
    *   InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpProxyResource(targetHttpProxyResource)
    *     .build();
@@ -603,21 +640,28 @@ public final UnaryCallable
    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource);
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpProxy(TargetHttpProxyName targetHttpProxy, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpProxy(String requestId, TargetHttpProxyName targetHttpProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); @@ -631,21 +675,28 @@ public final Operation setUrlMapTargetHttpProxy(TargetHttpProxyName targetHttpPr * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(targetHttpProxy.toString(), urlMapReferenceResource);
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(requestId, targetHttpProxy.toString(), urlMapReferenceResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpProxy(String targetHttpProxy, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpProxy(String requestId, String targetHttpProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); @@ -659,9 +710,11 @@ public final Operation setUrlMapTargetHttpProxy(String targetHttpProxy, UrlMapRe * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
@@ -684,9 +737,11 @@ public final Operation setUrlMapTargetHttpProxy(SetUrlMapTargetHttpProxyHttpRequ
    * Sample code:
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+   *   String requestId = "";
    *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java
index 11e986d4774f..ee5261de5b9b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -36,6 +37,7 @@ public final class TargetHttpProxyList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetHttpProxyList() {
     this.id = null;
@@ -43,15 +45,24 @@ private TargetHttpProxyList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
+
   private TargetHttpProxyList(
-      String id, List items, String kind, String nextPageToken, String selfLink) {
+      String id,
+      List items,
+      String kind,
+      String nextPageToken,
+      String selfLink,
+      Warning warning
+      ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -76,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -96,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -125,24 +142,26 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetHttpProxyList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetHttpProxyList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetHttpProxyList DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetHttpProxyList();
   }
@@ -153,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -173,6 +193,9 @@ public Builder mergeFrom(TargetHttpProxyList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -182,6 +205,7 @@ public Builder mergeFrom(TargetHttpProxyList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -237,9 +261,30 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
     public TargetHttpProxyList build() {
 
-      return new TargetHttpProxyList(id, items, kind, nextPageToken, selfLink);
+
+
+
+
+      return new TargetHttpProxyList(
+        id,
+        items,
+        kind,
+        nextPageToken,
+        selfLink,
+        warning
+      );
     }
 
     public Builder clone() {
@@ -249,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -256,20 +302,12 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetHttpProxyList{"
-        + "id="
-        + id
-        + ", "
-        + "items="
-        + items
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "nextPageToken="
-        + nextPageToken
-        + ", "
-        + "selfLink="
-        + selfLink
+        + "id=" + id + ", "
+        + "items=" + items + ", "
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -280,17 +318,27 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetHttpProxyList) {
       TargetHttpProxyList that = (TargetHttpProxyList) o;
-      return Objects.equals(this.id, that.getId())
-          && Objects.equals(this.items, that.getItemsList())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.nextPageToken, that.getNextPageToken())
-          && Objects.equals(this.selfLink, that.getSelfLink());
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.items, that.getItemsList()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(id, items, kind, nextPageToken, selfLink);
+    return Objects.hash(
+      id,
+      items,
+      kind,
+      nextPageToken,
+      selfLink,
+      warning
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java
index 9c26c614a253..8dbbdfdb65a5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class TargetHttpProxyName implements ResourceName {
+public final class TargetHttpProxyName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String targetHttpProxy;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java
index 498d2a85d90c..0b05858e24c5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java
@@ -18,7 +18,9 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -36,7 +38,10 @@ private TargetHttpsProxiesSetSslCertificatesRequest() {
     this.sslCertificates = null;
   }
 
-  private TargetHttpsProxiesSetSslCertificatesRequest(List sslCertificates) {
+
+  private TargetHttpsProxiesSetSslCertificatesRequest(
+      List sslCertificates
+      ) {
     this.sslCertificates = sslCertificates;
   }
 
@@ -71,24 +76,22 @@ public List getSslCertificatesList() {
     return sslCertificates;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetHttpsProxiesSetSslCertificatesRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetHttpsProxiesSetSslCertificatesRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetHttpsProxiesSetSslCertificatesRequest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetHttpsProxiesSetSslCertificatesRequest();
   }
@@ -127,8 +130,11 @@ public Builder addSslCertificates(String sslCertificates) {
       return this;
     }
 
+
     public TargetHttpsProxiesSetSslCertificatesRequest build() {
-      return new TargetHttpsProxiesSetSslCertificatesRequest(sslCertificates);
+      return new TargetHttpsProxiesSetSslCertificatesRequest(
+        sslCertificates
+      );
     }
 
     public Builder clone() {
@@ -141,8 +147,7 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetHttpsProxiesSetSslCertificatesRequest{"
-        + "sslCertificates="
-        + sslCertificates
+        + "sslCertificates=" + sslCertificates
         + "}";
   }
 
@@ -152,15 +157,18 @@ public boolean equals(Object o) {
       return true;
     }
     if (o instanceof TargetHttpsProxiesSetSslCertificatesRequest) {
-      TargetHttpsProxiesSetSslCertificatesRequest that =
-          (TargetHttpsProxiesSetSslCertificatesRequest) o;
-      return Objects.equals(this.sslCertificates, that.getSslCertificatesList());
+      TargetHttpsProxiesSetSslCertificatesRequest that = (TargetHttpsProxiesSetSslCertificatesRequest) o;
+      return
+          Objects.equals(this.sslCertificates, that.getSslCertificatesList())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(sslCertificates);
+    return Objects.hash(
+      sslCertificates
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java
index 17d954396bbe..8a3cbb58a1f5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -51,6 +52,7 @@ private TargetHttpsProxy() {
     this.urlMap = null;
   }
 
+
   private TargetHttpsProxy(
       String creationTimestamp,
       String description,
@@ -59,7 +61,8 @@ private TargetHttpsProxy(
       String name,
       String selfLink,
       List sslCertificates,
-      String urlMap) {
+      String urlMap
+      ) {
     this.creationTimestamp = creationTimestamp;
     this.description = description;
     this.id = id;
@@ -74,8 +77,7 @@ private TargetHttpsProxy(
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
     if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
     }
     if (fieldNames.contains("description") && description != null) {
       fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
@@ -172,24 +174,22 @@ public String getUrlMap() {
     return urlMap;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetHttpsProxy prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetHttpsProxy getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetHttpsProxy DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetHttpsProxy();
   }
@@ -326,10 +326,25 @@ public Builder setUrlMap(String urlMap) {
       return this;
     }
 
+
     public TargetHttpsProxy build() {
 
+
+
+
+
+
+
       return new TargetHttpsProxy(
-          creationTimestamp, description, id, kind, name, selfLink, sslCertificates, urlMap);
+        creationTimestamp,
+        description,
+        id,
+        kind,
+        name,
+        selfLink,
+        sslCertificates,
+        urlMap
+      );
     }
 
     public Builder clone() {
@@ -349,29 +364,14 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetHttpsProxy{"
-        + "creationTimestamp="
-        + creationTimestamp
-        + ", "
-        + "description="
-        + description
-        + ", "
-        + "id="
-        + id
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "name="
-        + name
-        + ", "
-        + "selfLink="
-        + selfLink
-        + ", "
-        + "sslCertificates="
-        + sslCertificates
-        + ", "
-        + "urlMap="
-        + urlMap
+        + "creationTimestamp=" + creationTimestamp + ", "
+        + "description=" + description + ", "
+        + "id=" + id + ", "
+        + "kind=" + kind + ", "
+        + "name=" + name + ", "
+        + "selfLink=" + selfLink + ", "
+        + "sslCertificates=" + sslCertificates + ", "
+        + "urlMap=" + urlMap
         + "}";
   }
 
@@ -382,14 +382,16 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetHttpsProxy) {
       TargetHttpsProxy that = (TargetHttpsProxy) o;
-      return Objects.equals(this.creationTimestamp, that.getCreationTimestamp())
-          && Objects.equals(this.description, that.getDescription())
-          && Objects.equals(this.id, that.getId())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.name, that.getName())
-          && Objects.equals(this.selfLink, that.getSelfLink())
-          && Objects.equals(this.sslCertificates, that.getSslCertificatesList())
-          && Objects.equals(this.urlMap, that.getUrlMap());
+      return
+          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.name, that.getName()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.sslCertificates, that.getSslCertificatesList()) &&
+          Objects.equals(this.urlMap, that.getUrlMap())
+          ;
     }
     return false;
   }
@@ -397,6 +399,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        creationTimestamp, description, id, kind, name, selfLink, sslCertificates, urlMap);
+      creationTimestamp,
+      description,
+      id,
+      kind,
+      name,
+      selfLink,
+      sslCertificates,
+      urlMap
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
index 3a64d503aa8b..42616a719fba 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
@@ -53,7 +53,8 @@
  * 
  * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
  *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
- *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
+ *   String requestId = "";
+ *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
  * }
  * 
  * 
@@ -176,19 +177,26 @@ public TargetHttpsProxyStub getStub() { *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
+   *   String requestId = "";
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy) { + public final Operation deleteTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, String requestId) { DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) .build(); return deleteTargetHttpsProxy(request); } @@ -201,19 +209,26 @@ public final Operation deleteTargetHttpsProxy(TargetHttpsProxyName targetHttpsPr *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString());
+   *   String requestId = "";
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString(), requestId);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpsProxy(String targetHttpsProxy) { + public final Operation deleteTargetHttpsProxy(String targetHttpsProxy, String requestId) { DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) .build(); return deleteTargetHttpsProxy(request); } @@ -226,8 +241,10 @@ public final Operation deleteTargetHttpsProxy(String targetHttpsProxy) { *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.deleteTargetHttpsProxyCallable().futureCall(request);
    *   // Do something
@@ -365,21 +384,28 @@ public final UnaryCallable get
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(project, targetHttpsProxyResource);
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(requestId, project, targetHttpsProxyResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. + * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpsProxy(ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { + public final Operation insertTargetHttpsProxy(String requestId, ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetHttpsProxyResource(targetHttpsProxyResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertTargetHttpsProxy(ProjectName project, TargetHttpsPr * Sample code: *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(project.toString(), targetHttpsProxyResource);
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(requestId, project.toString(), targetHttpsProxyResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. + * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpsProxy(String project, TargetHttpsProxy targetHttpsProxyResource) { + public final Operation insertTargetHttpsProxy(String requestId, String project, TargetHttpsProxy targetHttpsProxyResource) { InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setTargetHttpsProxyResource(targetHttpsProxyResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertTargetHttpsProxy(String project, TargetHttpsProxy t * Sample code: *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
    *   InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpsProxyResource(targetHttpsProxyResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertTargetHttpsProxy(InsertTargetHttpsProxyHttpRequest
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
    *   InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpsProxyResource(targetHttpsProxyResource)
    *     .build();
@@ -604,21 +641,28 @@ public final UnaryCallable
    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetHttpsProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, String requestId, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource) .build(); return setSslCertificatesTargetHttpsProxy(request); @@ -632,21 +676,28 @@ public final Operation setSslCertificatesTargetHttpsProxy(TargetHttpsProxyName t *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy.toString(), targetHttpsProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy.toString(), requestId, targetHttpsProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetHttpsProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProxy, String requestId, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource) .build(); return setSslCertificatesTargetHttpsProxy(request); @@ -660,9 +711,11 @@ public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProx *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(request);
@@ -685,9 +738,11 @@ public final Operation setSslCertificatesTargetHttpsProxy(SetSslCertificatesTarg
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxyCallable().futureCall(request);
@@ -709,21 +764,28 @@ public final UnaryCallable
    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource);
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, String requestId, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); return setUrlMapTargetHttpsProxy(request); @@ -737,21 +799,28 @@ public final Operation setUrlMapTargetHttpsProxy(TargetHttpsProxyName targetHttp *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy.toString(), urlMapReferenceResource);
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy.toString(), requestId, urlMapReferenceResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, String requestId, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); return setUrlMapTargetHttpsProxy(request); @@ -765,9 +834,11 @@ public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, UrlMap *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
    *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(request);
@@ -790,9 +861,11 @@ public final Operation setUrlMapTargetHttpsProxy(SetUrlMapTargetHttpsProxyHttpRe
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.setUrlMapTargetHttpsProxyCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
index fd839b821f05..55a860d89018 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -36,6 +37,7 @@ public final class TargetHttpsProxyList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetHttpsProxyList() {
     this.id = null;
@@ -43,15 +45,24 @@ private TargetHttpsProxyList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
+
   private TargetHttpsProxyList(
-      String id, List items, String kind, String nextPageToken, String selfLink) {
+      String id,
+      List items,
+      String kind,
+      String nextPageToken,
+      String selfLink,
+      Warning warning
+      ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -76,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -96,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -125,24 +142,26 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetHttpsProxyList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetHttpsProxyList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetHttpsProxyList DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetHttpsProxyList();
   }
@@ -153,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -173,6 +193,9 @@ public Builder mergeFrom(TargetHttpsProxyList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -182,6 +205,7 @@ public Builder mergeFrom(TargetHttpsProxyList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -237,9 +261,30 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
     public TargetHttpsProxyList build() {
 
-      return new TargetHttpsProxyList(id, items, kind, nextPageToken, selfLink);
+
+
+
+
+      return new TargetHttpsProxyList(
+        id,
+        items,
+        kind,
+        nextPageToken,
+        selfLink,
+        warning
+      );
     }
 
     public Builder clone() {
@@ -249,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -256,20 +302,12 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetHttpsProxyList{"
-        + "id="
-        + id
-        + ", "
-        + "items="
-        + items
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "nextPageToken="
-        + nextPageToken
-        + ", "
-        + "selfLink="
-        + selfLink
+        + "id=" + id + ", "
+        + "items=" + items + ", "
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -280,17 +318,27 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetHttpsProxyList) {
       TargetHttpsProxyList that = (TargetHttpsProxyList) o;
-      return Objects.equals(this.id, that.getId())
-          && Objects.equals(this.items, that.getItemsList())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.nextPageToken, that.getNextPageToken())
-          && Objects.equals(this.selfLink, that.getSelfLink());
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.items, that.getItemsList()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(id, items, kind, nextPageToken, selfLink);
+    return Objects.hash(
+      id,
+      items,
+      kind,
+      nextPageToken,
+      selfLink,
+      warning
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java
index 87c97f1280eb..fd182573ae73 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class TargetHttpsProxyName implements ResourceName {
+public final class TargetHttpsProxyName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String targetHttpsProxy;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java
index 90843287c914..45c8e006014b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java
@@ -37,6 +37,7 @@ public final class TargetInstanceAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetInstanceAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private TargetInstanceAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private TargetInstanceAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(TargetInstanceAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(TargetInstanceAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public TargetInstanceAggregatedList build() {
 
 
 
 
+
       return new TargetInstanceAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
index 190e458cb2de..6bede29094e1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+ *   String requestId = "";
  *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
- *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
+ *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
  * }
  * 
  * 
@@ -308,19 +309,26 @@ public final UnaryCallable * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) { + * String requestId = ""; * TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); - * Operation response = targetInstanceClient.deleteTargetInstance(targetInstance); + * Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance); * } *
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetInstance Name of the TargetInstance resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetInstance(TargetInstanceName targetInstance) { + public final Operation deleteTargetInstance(String requestId, TargetInstanceName targetInstance) { DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder() + .setRequestId(requestId) .setTargetInstance(targetInstance == null ? null : targetInstance.toString()) .build(); return deleteTargetInstance(request); @@ -333,19 +341,26 @@ public final Operation deleteTargetInstance(TargetInstanceName targetInstance) { * Sample code: *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   String requestId = "";
    *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
-   *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance.toString());
+   *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetInstance Name of the TargetInstance resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetInstance(String targetInstance) { + public final Operation deleteTargetInstance(String requestId, String targetInstance) { DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder() + .setRequestId(requestId) .setTargetInstance(targetInstance) .build(); return deleteTargetInstance(request); @@ -358,8 +373,10 @@ public final Operation deleteTargetInstance(String targetInstance) { * Sample code: *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   String requestId = "";
    *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetInstance(targetInstance.toString())
    *     .build();
    *   Operation response = targetInstanceClient.deleteTargetInstance(request);
@@ -381,8 +398,10 @@ public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest requ
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+   *   String requestId = "";
    *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetInstance(targetInstance.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetInstanceClient.deleteTargetInstanceCallable().futureCall(request);
@@ -499,21 +518,28 @@ public final UnaryCallable getTarg
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
-   *   Operation response = targetInstanceClient.insertTargetInstance(zone, targetInstanceResource);
+   *   Operation response = targetInstanceClient.insertTargetInstance(zone, requestId, targetInstanceResource);
    * }
    * 
* * @param zone Name of the zone scoping this request. - * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetInstance(ZoneName zone, TargetInstance targetInstanceResource) { + public final Operation insertTargetInstance(ZoneName zone, String requestId, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) .setTargetInstanceResource(targetInstanceResource) .build(); return insertTargetInstance(request); @@ -527,21 +553,28 @@ public final Operation insertTargetInstance(ZoneName zone, TargetInstance target *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
-   *   Operation response = targetInstanceClient.insertTargetInstance(zone.toString(), targetInstanceResource);
+   *   Operation response = targetInstanceClient.insertTargetInstance(zone.toString(), requestId, targetInstanceResource);
    * }
    * 
* * @param zone Name of the zone scoping this request. - * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetInstance(String zone, TargetInstance targetInstanceResource) { + public final Operation insertTargetInstance(String zone, String requestId, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() .setZone(zone) + .setRequestId(requestId) .setTargetInstanceResource(targetInstanceResource) .build(); return insertTargetInstance(request); @@ -555,9 +588,11 @@ public final Operation insertTargetInstance(String zone, TargetInstance targetIn *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setTargetInstanceResource(targetInstanceResource)
    *     .build();
    *   Operation response = targetInstanceClient.insertTargetInstance(request);
@@ -580,9 +615,11 @@ public final Operation insertTargetInstance(InsertTargetInstanceHttpRequest requ
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
    *     .setZone(zone.toString())
+   *     .setRequestId(requestId)
    *     .setTargetInstanceResource(targetInstanceResource)
    *     .build();
    *   ApiFuture<Operation> future = targetInstanceClient.insertTargetInstanceCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java
index 877ec8d726ca..feacb6ef081e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java
@@ -37,6 +37,7 @@ public final class TargetInstanceList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetInstanceList() {
     this.id = null;
@@ -44,6 +45,7 @@ private TargetInstanceList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private TargetInstanceList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(TargetInstanceList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(TargetInstanceList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public TargetInstanceList build() {
 
 
 
 
+
       return new TargetInstanceList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java
index c4abd864f795..743d148acb6a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class TargetInstanceName implements ResourceName {
+public final class TargetInstanceName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String targetInstance;
   private final String zone;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java
index fad41b9422dd..6a596ac9e736 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java
@@ -37,6 +37,7 @@ public final class TargetPoolAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetPoolAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private TargetPoolAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private TargetPoolAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(TargetPoolAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(TargetPoolAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public TargetPoolAggregatedList build() {
 
 
 
 
+
       return new TargetPoolAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
index 7e2f51bbf6b1..d371c03bf73e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
@@ -53,8 +53,9 @@
  * 
  * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
  *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+ *   String requestId = "";
  *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
- *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
+ *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
  * }
  * 
  * 
@@ -177,21 +178,28 @@ public TargetPoolStub getStub() { *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to add a health check to. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addHealthCheckTargetPool(TargetPoolName targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + public final Operation addHealthCheckTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) .build(); return addHealthCheckTargetPool(request); @@ -205,21 +213,28 @@ public final Operation addHealthCheckTargetPool(TargetPoolName targetPool, Targe *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool.toString(), targetPoolsAddHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool.toString(), requestId, targetPoolsAddHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to add a health check to. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addHealthCheckTargetPool(String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + public final Operation addHealthCheckTargetPool(String targetPool, String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) + .setRequestId(requestId) .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) .build(); return addHealthCheckTargetPool(request); @@ -233,9 +248,11 @@ public final Operation addHealthCheckTargetPool(String targetPool, TargetPoolsAd *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.addHealthCheckTargetPool(request);
@@ -258,9 +275,11 @@ public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequ
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.addHealthCheckTargetPoolCallable().futureCall(request);
@@ -282,21 +301,28 @@ public final UnaryCallable addHe
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource);
+   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to add instances to. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstanceTargetPool(TargetPoolName targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + public final Operation addInstanceTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) .build(); return addInstanceTargetPool(request); @@ -310,21 +336,28 @@ public final Operation addInstanceTargetPool(TargetPoolName targetPool, TargetPo *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool.toString(), targetPoolsAddInstanceRequestResource);
+   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool.toString(), requestId, targetPoolsAddInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to add instances to. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstanceTargetPool(String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + public final Operation addInstanceTargetPool(String targetPool, String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) + .setRequestId(requestId) .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) .build(); return addInstanceTargetPool(request); @@ -338,9 +371,11 @@ public final Operation addInstanceTargetPool(String targetPool, TargetPoolsAddIn *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.addInstanceTargetPool(request);
@@ -363,9 +398,11 @@ public final Operation addInstanceTargetPool(AddInstanceTargetPoolHttpRequest re
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.addInstanceTargetPoolCallable().futureCall(request);
@@ -520,19 +557,26 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   Operation response = targetPoolClient.deleteTargetPool(targetPool);
+   *   String requestId = "";
+   *   Operation response = targetPoolClient.deleteTargetPool(targetPool, requestId);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetPool(TargetPoolName targetPool) { + public final Operation deleteTargetPool(TargetPoolName targetPool, String requestId) { DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) .build(); return deleteTargetPool(request); } @@ -545,19 +589,26 @@ public final Operation deleteTargetPool(TargetPoolName targetPool) { *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   Operation response = targetPoolClient.deleteTargetPool(targetPool.toString());
+   *   String requestId = "";
+   *   Operation response = targetPoolClient.deleteTargetPool(targetPool.toString(), requestId);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetPool(String targetPool) { + public final Operation deleteTargetPool(String targetPool, String requestId) { DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) + .setRequestId(requestId) .build(); return deleteTargetPool(request); } @@ -570,8 +621,10 @@ public final Operation deleteTargetPool(String targetPool) { *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = targetPoolClient.deleteTargetPool(request);
    * }
@@ -593,8 +646,10 @@ public final Operation deleteTargetPool(DeleteTargetPoolHttpRequest request) {
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.deleteTargetPoolCallable().futureCall(request);
    *   // Do something
@@ -814,21 +869,28 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
-   *   Operation response = targetPoolClient.insertTargetPool(region, targetPoolResource);
+   *   Operation response = targetPoolClient.insertTargetPool(requestId, region, targetPoolResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, associated HttpHealthCheck resources, and the fallback target pool. + * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetPool(RegionName region, TargetPool targetPoolResource) { + public final Operation insertTargetPool(String requestId, RegionName region, TargetPool targetPoolResource) { InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setTargetPoolResource(targetPoolResource) .build(); @@ -842,21 +904,28 @@ public final Operation insertTargetPool(RegionName region, TargetPool targetPool * Sample code: *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
-   *   Operation response = targetPoolClient.insertTargetPool(region.toString(), targetPoolResource);
+   *   Operation response = targetPoolClient.insertTargetPool(requestId, region.toString(), targetPoolResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, associated HttpHealthCheck resources, and the fallback target pool. + * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetPool(String region, TargetPool targetPoolResource) { + public final Operation insertTargetPool(String requestId, String region, TargetPool targetPoolResource) { InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region) .setTargetPoolResource(targetPoolResource) .build(); @@ -870,9 +939,11 @@ public final Operation insertTargetPool(String region, TargetPool targetPoolReso * Sample code: *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetPoolResource(targetPoolResource)
    *     .build();
@@ -895,9 +966,11 @@ public final Operation insertTargetPool(InsertTargetPoolHttpRequest request) {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetPoolResource(targetPoolResource)
    *     .build();
@@ -1053,21 +1126,28 @@ public final UnaryCallable listTarge
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to remove health checks from. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeHealthCheckTargetPool(TargetPoolName targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + public final Operation removeHealthCheckTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource) .build(); return removeHealthCheckTargetPool(request); @@ -1081,21 +1161,28 @@ public final Operation removeHealthCheckTargetPool(TargetPoolName targetPool, Ta *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool.toString(), targetPoolsRemoveHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool.toString(), requestId, targetPoolsRemoveHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to remove health checks from. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeHealthCheckTargetPool(String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + public final Operation removeHealthCheckTargetPool(String targetPool, String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) + .setRequestId(requestId) .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource) .build(); return removeHealthCheckTargetPool(request); @@ -1109,9 +1196,11 @@ public final Operation removeHealthCheckTargetPool(String targetPool, TargetPool *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.removeHealthCheckTargetPool(request);
@@ -1134,9 +1223,11 @@ public final Operation removeHealthCheckTargetPool(RemoveHealthCheckTargetPoolHt
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.removeHealthCheckTargetPoolCallable().futureCall(request);
@@ -1158,21 +1249,28 @@ public final UnaryCallable re
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource);
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to remove instances from. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstanceTargetPool(TargetPoolName targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + public final Operation removeInstanceTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) .build(); return removeInstanceTargetPool(request); @@ -1186,21 +1284,28 @@ public final Operation removeInstanceTargetPool(TargetPoolName targetPool, Targe *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool.toString(), targetPoolsRemoveInstanceRequestResource);
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool.toString(), requestId, targetPoolsRemoveInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to remove instances from. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstanceTargetPool(String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + public final Operation removeInstanceTargetPool(String targetPool, String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) + .setRequestId(requestId) .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) .build(); return removeInstanceTargetPool(request); @@ -1214,9 +1319,11 @@ public final Operation removeInstanceTargetPool(String targetPool, TargetPoolsRe *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.removeInstanceTargetPool(request);
@@ -1239,9 +1346,11 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.removeInstanceTargetPoolCallable().futureCall(request);
@@ -1263,23 +1372,30 @@ public final UnaryCallable remov
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource);
+   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool, requestId, failoverRatio, targetReferenceResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to set a backup pool for. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param failoverRatio New failoverRatio value for the target pool. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackupTargetPool(TargetPoolName targetPool, Float failoverRatio, TargetReference targetReferenceResource) { + public final Operation setBackupTargetPool(TargetPoolName targetPool, String requestId, Float failoverRatio, TargetReference targetReferenceResource) { SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) .setFailoverRatio(failoverRatio) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -1294,23 +1410,30 @@ public final Operation setBackupTargetPool(TargetPoolName targetPool, Float fail *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool.toString(), failoverRatio, targetReferenceResource);
+   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool.toString(), requestId, failoverRatio, targetReferenceResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to set a backup pool for. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param failoverRatio New failoverRatio value for the target pool. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackupTargetPool(String targetPool, Float failoverRatio, TargetReference targetReferenceResource) { + public final Operation setBackupTargetPool(String targetPool, String requestId, Float failoverRatio, TargetReference targetReferenceResource) { SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) + .setRequestId(requestId) .setFailoverRatio(failoverRatio) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -1325,10 +1448,12 @@ public final Operation setBackupTargetPool(String targetPool, Float failoverRati *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setFailoverRatio(failoverRatio)
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
@@ -1352,10 +1477,12 @@ public final Operation setBackupTargetPool(SetBackupTargetPoolHttpRequest reques
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
+   *     .setRequestId(requestId)
    *     .setFailoverRatio(failoverRatio)
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java
index de34cf340414..c2fc01490661 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -39,7 +40,11 @@ private TargetPoolInstanceHealth() {
     this.kind = null;
   }
 
-  private TargetPoolInstanceHealth(List healthStatus, String kind) {
+
+  private TargetPoolInstanceHealth(
+      List healthStatus,
+      String kind
+      ) {
     this.healthStatus = healthStatus;
     this.kind = kind;
   }
@@ -85,24 +90,22 @@ public String getKind() {
     return kind;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetPoolInstanceHealth prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetPoolInstanceHealth getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetPoolInstanceHealth DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetPoolInstanceHealth();
   }
@@ -155,9 +158,13 @@ public Builder setKind(String kind) {
       return this;
     }
 
+
     public TargetPoolInstanceHealth build() {
 
-      return new TargetPoolInstanceHealth(healthStatus, kind);
+      return new TargetPoolInstanceHealth(
+        healthStatus,
+        kind
+      );
     }
 
     public Builder clone() {
@@ -171,11 +178,8 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetPoolInstanceHealth{"
-        + "healthStatus="
-        + healthStatus
-        + ", "
-        + "kind="
-        + kind
+        + "healthStatus=" + healthStatus + ", "
+        + "kind=" + kind
         + "}";
   }
 
@@ -186,14 +190,19 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetPoolInstanceHealth) {
       TargetPoolInstanceHealth that = (TargetPoolInstanceHealth) o;
-      return Objects.equals(this.healthStatus, that.getHealthStatusList())
-          && Objects.equals(this.kind, that.getKind());
+      return
+          Objects.equals(this.healthStatus, that.getHealthStatusList()) &&
+          Objects.equals(this.kind, that.getKind())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(healthStatus, kind);
+    return Objects.hash(
+      healthStatus,
+      kind
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java
index 1d044f196d47..a2d37556b1da 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java
@@ -37,6 +37,7 @@ public final class TargetPoolList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetPoolList() {
     this.id = null;
@@ -44,6 +45,7 @@ private TargetPoolList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private TargetPoolList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(TargetPoolList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(TargetPoolList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public TargetPoolList build() {
 
 
 
 
+
       return new TargetPoolList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java
index 642fca8dd7d3..c421f0c889c5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java
@@ -17,23 +17,26 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import javax.annotation.Generated;
 
 @Generated("by GAPIC")
 @BetaApi
-public final class TargetPoolName implements ResourceName {
+public final class TargetPoolName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String region;
   private final String targetPool;
   private static final PathTemplate PATH_TEMPLATE =
-      PathTemplate.createWithoutUrlEncoding(
-          "projects/{project}/regions/{region}/targetPools/{targetPool}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetPools/{targetPool}");
 
   private volatile Map fieldValuesMap;
 
@@ -51,12 +54,29 @@ private TargetPoolName(Builder builder) {
     targetPool = Preconditions.checkNotNull(builder.getTargetPool());
   }
 
-  public static TargetPoolName of(String project, String region, String targetPool) {
-    return newBuilder().setProject(project).setRegion(region).setTargetPool(targetPool).build();
+  public static TargetPoolName of(
+      String project,
+      String region,
+      String targetPool
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setTargetPool(targetPool)
+      .build();
   }
 
-  public static String format(String project, String region, String targetPool) {
-    return of(project, region, targetPool).toString();
+  public static String format(
+      String project,
+      String region,
+      String targetPool
+      ) {
+    return of(
+        project,
+        region,
+        targetPool
+        )
+        .toString();
   }
 
   public String getProject() {
@@ -71,6 +91,7 @@ public String getTargetPool() {
     return targetPool;
   }
 
+
   @Override
   public Map getFieldValuesMap() {
     if (fieldValuesMap == null) {
@@ -91,19 +112,21 @@ public String getFieldValue(String fieldName) {
     return getFieldValuesMap().get(fieldName);
   }
 
+
   public static ResourceNameFactory newFactory() {
     return new ResourceNameFactory() {
-      public TargetPoolName parse(String formattedString) {
-        return TargetPoolName.parse(formattedString);
-      }
+      public TargetPoolName parse(String formattedString) {return TargetPoolName.parse(formattedString);}
     };
   }
 
   public static TargetPoolName parse(String formattedString) {
     Map matchMap =
-        PATH_TEMPLATE.validatedMatch(
-            formattedString, "TargetPoolName.parse: formattedString not in valid format");
-    return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("targetPool"));
+        PATH_TEMPLATE.validatedMatch(formattedString, "TargetPoolName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("targetPool")
+    );
   }
 
   public static boolean isParsableFrom(String formattedString) {
@@ -118,11 +141,9 @@ public static class Builder {
     public String getProject() {
       return project;
     }
-
     public String getRegion() {
       return region;
     }
-
     public String getTargetPool() {
       return targetPool;
     }
@@ -131,12 +152,10 @@ public Builder setProject(String project) {
       this.project = project;
       return this;
     }
-
     public Builder setRegion(String region) {
       this.region = region;
       return this;
     }
-
     public Builder setTargetPool(String targetPool) {
       this.targetPool = targetPool;
       return this;
@@ -144,7 +163,7 @@ public Builder setTargetPool(String targetPool) {
 
     private Builder() {}
 
-    public Builder(TargetPoolName targetPoolName) {
+    public Builder (TargetPoolName targetPoolName) {
       project = targetPoolName.project;
       region = targetPoolName.region;
       targetPool = targetPoolName.targetPool;
@@ -160,7 +179,8 @@ public String toString() {
     return PATH_TEMPLATE.instantiate(
         "project", project,
         "region", region,
-        "targetPool", targetPool);
+        "targetPool", targetPool
+        );
   }
 
   @Override
@@ -170,15 +190,21 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetPoolName) {
       TargetPoolName that = (TargetPoolName) o;
-      return Objects.equals(this.project, that.getProject())
-          && Objects.equals(this.region, that.getRegion())
-          && Objects.equals(this.targetPool, that.getTargetPool());
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.targetPool, that.getTargetPool())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(project, region, targetPool);
+    return Objects.hash(
+      project,
+      region,
+      targetPool
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java
index c9282e24fafa..e3febccb9f3f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -35,7 +38,10 @@ private TargetReference() {
     this.target = null;
   }
 
-  private TargetReference(String target) {
+
+  private TargetReference(
+      String target
+      ) {
     this.target = target;
   }
 
@@ -66,24 +72,22 @@ public String getTarget() {
     return target;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetReference prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetReference getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetReference DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetReference();
   }
@@ -114,8 +118,11 @@ public Builder setTarget(String target) {
       return this;
     }
 
+
     public TargetReference build() {
-      return new TargetReference(target);
+      return new TargetReference(
+        target
+      );
     }
 
     public Builder clone() {
@@ -127,7 +134,9 @@ public Builder clone() {
 
   @Override
   public String toString() {
-    return "TargetReference{" + "target=" + target + "}";
+    return "TargetReference{"
+        + "target=" + target
+        + "}";
   }
 
   @Override
@@ -137,13 +146,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetReference) {
       TargetReference that = (TargetReference) o;
-      return Objects.equals(this.target, that.getTarget());
+      return
+          Objects.equals(this.target, that.getTarget())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(target);
+    return Objects.hash(
+      target
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java
index c046122d154c..bc7b55987ca2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java
@@ -18,6 +18,7 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -53,6 +54,7 @@ private TargetSslProxy() {
     this.sslCertificates = null;
   }
 
+
   private TargetSslProxy(
       String creationTimestamp,
       String description,
@@ -62,7 +64,8 @@ private TargetSslProxy(
       String proxyHeader,
       String selfLink,
       String service,
-      List sslCertificates) {
+      List sslCertificates
+      ) {
     this.creationTimestamp = creationTimestamp;
     this.description = description;
     this.id = id;
@@ -78,8 +81,7 @@ private TargetSslProxy(
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
     if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
     }
     if (fieldNames.contains("description") && description != null) {
       fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
@@ -186,24 +188,22 @@ public List getSslCertificatesList() {
     return sslCertificates;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(TargetSslProxy prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static TargetSslProxy getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final TargetSslProxy DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new TargetSslProxy();
   }
@@ -354,18 +354,27 @@ public Builder addSslCertificates(String sslCertificates) {
       return this;
     }
 
+
     public TargetSslProxy build() {
 
+
+
+
+
+
+
+
       return new TargetSslProxy(
-          creationTimestamp,
-          description,
-          id,
-          kind,
-          name,
-          proxyHeader,
-          selfLink,
-          service,
-          sslCertificates);
+        creationTimestamp,
+        description,
+        id,
+        kind,
+        name,
+        proxyHeader,
+        selfLink,
+        service,
+        sslCertificates
+      );
     }
 
     public Builder clone() {
@@ -386,32 +395,15 @@ public Builder clone() {
   @Override
   public String toString() {
     return "TargetSslProxy{"
-        + "creationTimestamp="
-        + creationTimestamp
-        + ", "
-        + "description="
-        + description
-        + ", "
-        + "id="
-        + id
-        + ", "
-        + "kind="
-        + kind
-        + ", "
-        + "name="
-        + name
-        + ", "
-        + "proxyHeader="
-        + proxyHeader
-        + ", "
-        + "selfLink="
-        + selfLink
-        + ", "
-        + "service="
-        + service
-        + ", "
-        + "sslCertificates="
-        + sslCertificates
+        + "creationTimestamp=" + creationTimestamp + ", "
+        + "description=" + description + ", "
+        + "id=" + id + ", "
+        + "kind=" + kind + ", "
+        + "name=" + name + ", "
+        + "proxyHeader=" + proxyHeader + ", "
+        + "selfLink=" + selfLink + ", "
+        + "service=" + service + ", "
+        + "sslCertificates=" + sslCertificates
         + "}";
   }
 
@@ -422,15 +414,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof TargetSslProxy) {
       TargetSslProxy that = (TargetSslProxy) o;
-      return Objects.equals(this.creationTimestamp, that.getCreationTimestamp())
-          && Objects.equals(this.description, that.getDescription())
-          && Objects.equals(this.id, that.getId())
-          && Objects.equals(this.kind, that.getKind())
-          && Objects.equals(this.name, that.getName())
-          && Objects.equals(this.proxyHeader, that.getProxyHeader())
-          && Objects.equals(this.selfLink, that.getSelfLink())
-          && Objects.equals(this.service, that.getService())
-          && Objects.equals(this.sslCertificates, that.getSslCertificatesList());
+      return
+          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.name, that.getName()) &&
+          Objects.equals(this.proxyHeader, that.getProxyHeader()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.service, that.getService()) &&
+          Objects.equals(this.sslCertificates, that.getSslCertificatesList())
+          ;
     }
     return false;
   }
@@ -438,14 +432,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-        creationTimestamp,
-        description,
-        id,
-        kind,
-        name,
-        proxyHeader,
-        selfLink,
-        service,
-        sslCertificates);
+      creationTimestamp,
+      description,
+      id,
+      kind,
+      name,
+      proxyHeader,
+      selfLink,
+      service,
+      sslCertificates
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
index eac94b44fc41..ba7396412395 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
@@ -53,7 +53,8 @@
  * 
  * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
  *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
- *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
+ *   String requestId = "";
+ *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
  * }
  * 
  * 
@@ -176,19 +177,26 @@ public TargetSslProxyStub getStub() { *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
+   *   String requestId = "";
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetSslProxy(TargetSslProxyName targetSslProxy) { + public final Operation deleteTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId) { DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) .build(); return deleteTargetSslProxy(request); } @@ -201,19 +209,26 @@ public final Operation deleteTargetSslProxy(TargetSslProxyName targetSslProxy) { *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString());
+   *   String requestId = "";
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString(), requestId);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetSslProxy(String targetSslProxy) { + public final Operation deleteTargetSslProxy(String targetSslProxy, String requestId) { DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) .build(); return deleteTargetSslProxy(request); } @@ -226,8 +241,10 @@ public final Operation deleteTargetSslProxy(String targetSslProxy) { *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = targetSslProxyClient.deleteTargetSslProxy(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest requ
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.deleteTargetSslProxyCallable().futureCall(request);
    *   // Do something
@@ -365,21 +384,28 @@ public final UnaryCallable getTarg
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
-   *   Operation response = targetSslProxyClient.insertTargetSslProxy(project, targetSslProxyResource);
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(requestId, project, targetSslProxyResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. + * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetSslProxy(ProjectName project, TargetSslProxy targetSslProxyResource) { + public final Operation insertTargetSslProxy(String requestId, ProjectName project, TargetSslProxy targetSslProxyResource) { InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetSslProxyResource(targetSslProxyResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertTargetSslProxy(ProjectName project, TargetSslProxy * Sample code: *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
-   *   Operation response = targetSslProxyClient.insertTargetSslProxy(project.toString(), targetSslProxyResource);
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(requestId, project.toString(), targetSslProxyResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. + * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetSslProxy(String project, TargetSslProxy targetSslProxyResource) { + public final Operation insertTargetSslProxy(String requestId, String project, TargetSslProxy targetSslProxyResource) { InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setTargetSslProxyResource(targetSslProxyResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertTargetSslProxy(String project, TargetSslProxy targe * Sample code: *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
    *   InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetSslProxyResource(targetSslProxyResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertTargetSslProxy(InsertTargetSslProxyHttpRequest requ
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
    *   InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetSslProxyResource(targetSslProxyResource)
    *     .build();
@@ -604,21 +641,28 @@ public final UnaryCallable
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource);
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackendServiceTargetSslProxy(TargetSslProxyName targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + public final Operation setBackendServiceTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource) .build(); return setBackendServiceTargetSslProxy(request); @@ -632,21 +676,28 @@ public final Operation setBackendServiceTargetSslProxy(TargetSslProxyName target *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetBackendServiceRequestResource);
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetBackendServiceRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource) .build(); return setBackendServiceTargetSslProxy(request); @@ -660,9 +711,11 @@ public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, Ta *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(request);
@@ -685,9 +738,11 @@ public final Operation setBackendServiceTargetSslProxy(SetBackendServiceTargetSs
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setBackendServiceTargetSslProxyCallable().futureCall(request);
@@ -709,21 +764,28 @@ public final UnaryCallable
    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource);
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setProxyHeaderTargetSslProxy(TargetSslProxyName targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + public final Operation setProxyHeaderTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource) .build(); return setProxyHeaderTargetSslProxy(request); @@ -737,21 +799,28 @@ public final Operation setProxyHeaderTargetSslProxy(TargetSslProxyName targetSsl *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetProxyHeaderRequestResource);
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetProxyHeaderRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource) .build(); return setProxyHeaderTargetSslProxy(request); @@ -765,9 +834,11 @@ public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, Targe *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(request);
@@ -790,9 +861,11 @@ public final Operation setProxyHeaderTargetSslProxy(SetProxyHeaderTargetSslProxy
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setProxyHeaderTargetSslProxyCallable().futureCall(request);
@@ -814,21 +887,28 @@ public final UnaryCallable s
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetSslProxy(TargetSslProxyName targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource) .build(); return setSslCertificatesTargetSslProxy(request); @@ -842,21 +922,28 @@ public final Operation setSslCertificatesTargetSslProxy(TargetSslProxyName targe *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource) .build(); return setSslCertificatesTargetSslProxy(request); @@ -870,9 +957,11 @@ public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, T *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(request);
@@ -895,9 +984,11 @@ public final Operation setSslCertificatesTargetSslProxy(SetSslCertificatesTarget
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setSslCertificatesTargetSslProxyCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java
index e2ae4b43c25b..bbf25f4bb122 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java
@@ -37,6 +37,7 @@ public final class TargetSslProxyList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private TargetSslProxyList() {
     this.id = null;
@@ -44,6 +45,7 @@ private TargetSslProxyList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private TargetSslProxyList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(TargetSslProxyList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(TargetSslProxyList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public TargetSslProxyList build() {
 
 
 
 
+
       return new TargetSslProxyList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java
index fd411b8c3b6f..220db0ac6cb5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class TargetSslProxyName implements ResourceName {
+public final class TargetSslProxyName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String targetSslProxy;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java
new file mode 100644
index 000000000000..82c45bf2dd29
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class TargetTcpProxiesSetBackendServiceRequest implements ApiMessage {
+  private final String service;
+
+  private TargetTcpProxiesSetBackendServiceRequest() {
+    this.service = null;
+  }
+
+
+  private TargetTcpProxiesSetBackendServiceRequest(
+      String service
+      ) {
+    this.service = service;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("service") && service != null) {
+      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("service")) {
+      return String.valueOf(service);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getService() {
+    return service;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(TargetTcpProxiesSetBackendServiceRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static TargetTcpProxiesSetBackendServiceRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final TargetTcpProxiesSetBackendServiceRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new TargetTcpProxiesSetBackendServiceRequest();
+  }
+
+  public static class Builder {
+    private String service;
+
+    Builder() {}
+
+    public Builder mergeFrom(TargetTcpProxiesSetBackendServiceRequest other) {
+      if (other == TargetTcpProxiesSetBackendServiceRequest.getDefaultInstance()) return this;
+      if (other.getService() != null) {
+        this.service = other.service;
+      }
+      return this;
+    }
+
+    Builder(TargetTcpProxiesSetBackendServiceRequest source) {
+      this.service = source.service;
+    }
+
+    public String getService() {
+      return service;
+    }
+
+    public Builder setService(String service) {
+      this.service = service;
+      return this;
+    }
+
+
+    public TargetTcpProxiesSetBackendServiceRequest build() {
+      return new TargetTcpProxiesSetBackendServiceRequest(
+        service
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setService(this.service);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "TargetTcpProxiesSetBackendServiceRequest{"
+        + "service=" + service
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof TargetTcpProxiesSetBackendServiceRequest) {
+      TargetTcpProxiesSetBackendServiceRequest that = (TargetTcpProxiesSetBackendServiceRequest) o;
+      return
+          Objects.equals(this.service, that.getService())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      service
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java
new file mode 100644
index 000000000000..6935393b8511
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class TargetTcpProxiesSetProxyHeaderRequest implements ApiMessage {
+  private final String proxyHeader;
+
+  private TargetTcpProxiesSetProxyHeaderRequest() {
+    this.proxyHeader = null;
+  }
+
+
+  private TargetTcpProxiesSetProxyHeaderRequest(
+      String proxyHeader
+      ) {
+    this.proxyHeader = proxyHeader;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
+      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("proxyHeader")) {
+      return String.valueOf(proxyHeader);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getProxyHeader() {
+    return proxyHeader;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(TargetTcpProxiesSetProxyHeaderRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static TargetTcpProxiesSetProxyHeaderRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final TargetTcpProxiesSetProxyHeaderRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new TargetTcpProxiesSetProxyHeaderRequest();
+  }
+
+  public static class Builder {
+    private String proxyHeader;
+
+    Builder() {}
+
+    public Builder mergeFrom(TargetTcpProxiesSetProxyHeaderRequest other) {
+      if (other == TargetTcpProxiesSetProxyHeaderRequest.getDefaultInstance()) return this;
+      if (other.getProxyHeader() != null) {
+        this.proxyHeader = other.proxyHeader;
+      }
+      return this;
+    }
+
+    Builder(TargetTcpProxiesSetProxyHeaderRequest source) {
+      this.proxyHeader = source.proxyHeader;
+    }
+
+    public String getProxyHeader() {
+      return proxyHeader;
+    }
+
+    public Builder setProxyHeader(String proxyHeader) {
+      this.proxyHeader = proxyHeader;
+      return this;
+    }
+
+
+    public TargetTcpProxiesSetProxyHeaderRequest build() {
+      return new TargetTcpProxiesSetProxyHeaderRequest(
+        proxyHeader
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setProxyHeader(this.proxyHeader);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "TargetTcpProxiesSetProxyHeaderRequest{"
+        + "proxyHeader=" + proxyHeader
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof TargetTcpProxiesSetProxyHeaderRequest) {
+      TargetTcpProxiesSetProxyHeaderRequest that = (TargetTcpProxiesSetProxyHeaderRequest) o;
+      return
+          Objects.equals(this.proxyHeader, that.getProxyHeader())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      proxyHeader
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java
new file mode 100644
index 000000000000..958c78a249bd
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java
@@ -0,0 +1,400 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class TargetTcpProxy implements ApiMessage {
+  private final String creationTimestamp;
+  private final String description;
+  private final String id;
+  private final String kind;
+  private final String name;
+  private final String proxyHeader;
+  private final String selfLink;
+  private final String service;
+
+  private TargetTcpProxy() {
+    this.creationTimestamp = null;
+    this.description = null;
+    this.id = null;
+    this.kind = null;
+    this.name = null;
+    this.proxyHeader = null;
+    this.selfLink = null;
+    this.service = null;
+  }
+
+
+  private TargetTcpProxy(
+      String creationTimestamp,
+      String description,
+      String id,
+      String kind,
+      String name,
+      String proxyHeader,
+      String selfLink,
+      String service
+      ) {
+    this.creationTimestamp = creationTimestamp;
+    this.description = description;
+    this.id = id;
+    this.kind = kind;
+    this.name = name;
+    this.proxyHeader = proxyHeader;
+    this.selfLink = selfLink;
+    this.service = service;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
+      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+    }
+    if (fieldNames.contains("description") && description != null) {
+      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
+    }
+    if (fieldNames.contains("id") && id != null) {
+      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
+    }
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("name") && name != null) {
+      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
+    }
+    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
+      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
+    }
+    if (fieldNames.contains("selfLink") && selfLink != null) {
+      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
+    }
+    if (fieldNames.contains("service") && service != null) {
+      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("creationTimestamp")) {
+      return String.valueOf(creationTimestamp);
+    }
+    if (fieldName.equals("description")) {
+      return String.valueOf(description);
+    }
+    if (fieldName.equals("id")) {
+      return String.valueOf(id);
+    }
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("name")) {
+      return String.valueOf(name);
+    }
+    if (fieldName.equals("proxyHeader")) {
+      return String.valueOf(proxyHeader);
+    }
+    if (fieldName.equals("selfLink")) {
+      return String.valueOf(selfLink);
+    }
+    if (fieldName.equals("service")) {
+      return String.valueOf(service);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getCreationTimestamp() {
+    return creationTimestamp;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public String getProxyHeader() {
+    return proxyHeader;
+  }
+
+  public String getSelfLink() {
+    return selfLink;
+  }
+
+  public String getService() {
+    return service;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(TargetTcpProxy prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static TargetTcpProxy getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final TargetTcpProxy DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new TargetTcpProxy();
+  }
+
+  public static class Builder {
+    private String creationTimestamp;
+    private String description;
+    private String id;
+    private String kind;
+    private String name;
+    private String proxyHeader;
+    private String selfLink;
+    private String service;
+
+    Builder() {}
+
+    public Builder mergeFrom(TargetTcpProxy other) {
+      if (other == TargetTcpProxy.getDefaultInstance()) return this;
+      if (other.getCreationTimestamp() != null) {
+        this.creationTimestamp = other.creationTimestamp;
+      }
+      if (other.getDescription() != null) {
+        this.description = other.description;
+      }
+      if (other.getId() != null) {
+        this.id = other.id;
+      }
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getName() != null) {
+        this.name = other.name;
+      }
+      if (other.getProxyHeader() != null) {
+        this.proxyHeader = other.proxyHeader;
+      }
+      if (other.getSelfLink() != null) {
+        this.selfLink = other.selfLink;
+      }
+      if (other.getService() != null) {
+        this.service = other.service;
+      }
+      return this;
+    }
+
+    Builder(TargetTcpProxy source) {
+      this.creationTimestamp = source.creationTimestamp;
+      this.description = source.description;
+      this.id = source.id;
+      this.kind = source.kind;
+      this.name = source.name;
+      this.proxyHeader = source.proxyHeader;
+      this.selfLink = source.selfLink;
+      this.service = source.service;
+    }
+
+    public String getCreationTimestamp() {
+      return creationTimestamp;
+    }
+
+    public Builder setCreationTimestamp(String creationTimestamp) {
+      this.creationTimestamp = creationTimestamp;
+      return this;
+    }
+
+    public String getDescription() {
+      return description;
+    }
+
+    public Builder setDescription(String description) {
+      this.description = description;
+      return this;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public Builder setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getName() {
+      return name;
+    }
+
+    public Builder setName(String name) {
+      this.name = name;
+      return this;
+    }
+
+    public String getProxyHeader() {
+      return proxyHeader;
+    }
+
+    public Builder setProxyHeader(String proxyHeader) {
+      this.proxyHeader = proxyHeader;
+      return this;
+    }
+
+    public String getSelfLink() {
+      return selfLink;
+    }
+
+    public Builder setSelfLink(String selfLink) {
+      this.selfLink = selfLink;
+      return this;
+    }
+
+    public String getService() {
+      return service;
+    }
+
+    public Builder setService(String service) {
+      this.service = service;
+      return this;
+    }
+
+
+    public TargetTcpProxy build() {
+
+
+
+
+
+
+
+      return new TargetTcpProxy(
+        creationTimestamp,
+        description,
+        id,
+        kind,
+        name,
+        proxyHeader,
+        selfLink,
+        service
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setCreationTimestamp(this.creationTimestamp);
+      newBuilder.setDescription(this.description);
+      newBuilder.setId(this.id);
+      newBuilder.setKind(this.kind);
+      newBuilder.setName(this.name);
+      newBuilder.setProxyHeader(this.proxyHeader);
+      newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setService(this.service);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "TargetTcpProxy{"
+        + "creationTimestamp=" + creationTimestamp + ", "
+        + "description=" + description + ", "
+        + "id=" + id + ", "
+        + "kind=" + kind + ", "
+        + "name=" + name + ", "
+        + "proxyHeader=" + proxyHeader + ", "
+        + "selfLink=" + selfLink + ", "
+        + "service=" + service
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof TargetTcpProxy) {
+      TargetTcpProxy that = (TargetTcpProxy) o;
+      return
+          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.name, that.getName()) &&
+          Objects.equals(this.proxyHeader, that.getProxyHeader()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.service, that.getService())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      creationTimestamp,
+      description,
+      id,
+      kind,
+      name,
+      proxyHeader,
+      selfLink,
+      service
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
new file mode 100644
index 000000000000..c42080b239ce
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
@@ -0,0 +1,999 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.paging.FixedSizeCollection;
+import com.google.api.gax.paging.Page;
+import com.google.api.gax.rpc.ApiExceptions;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.cloud.compute.v1.stub.TargetTcpProxyStub;
+import com.google.cloud.compute.v1.stub.TargetTcpProxyStubSettings;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Creates and runs virtual machines on Google Cloud Platform.
+ *
+ * 

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+ *   String requestId = "";
+ *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+ *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the targetTcpProxyClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of TargetTcpProxySettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * TargetTcpProxySettings targetTcpProxySettings =
+ *     TargetTcpProxySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TargetTcpProxyClient targetTcpProxyClient =
+ *     TargetTcpProxyClient.create(targetTcpProxySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TargetTcpProxySettings targetTcpProxySettings =
+ *     TargetTcpProxySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TargetTcpProxyClient targetTcpProxyClient =
+ *     TargetTcpProxyClient.create(targetTcpProxySettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetTcpProxyClient implements BackgroundResource { + private final TargetTcpProxySettings settings; + private final TargetTcpProxyStub stub; + + + + /** + * Constructs an instance of TargetTcpProxyClient with default settings. + */ + public static final TargetTcpProxyClient create() throws IOException { + return create(TargetTcpProxySettings.newBuilder().build()); + } + + /** + * Constructs an instance of TargetTcpProxyClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final TargetTcpProxyClient create(TargetTcpProxySettings settings) throws IOException { + return new TargetTcpProxyClient(settings); + } + + /** + * Constructs an instance of TargetTcpProxyClient, using the given stub for making calls. This is for + * advanced usage - prefer to use TargetTcpProxySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TargetTcpProxyClient create(TargetTcpProxyStub stub) { + return new TargetTcpProxyClient(stub); + } + + /** + * Constructs an instance of TargetTcpProxyClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected TargetTcpProxyClient(TargetTcpProxySettings settings) throws IOException { + this.settings = settings; + this.stub = ((TargetTcpProxyStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TargetTcpProxyClient(TargetTcpProxyStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TargetTcpProxySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetTcpProxyStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetTcpProxy resource. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetTcpProxy(String requestId, TargetTcpProxyName targetTcpProxy) { + + DeleteTargetTcpProxyHttpRequest request = + DeleteTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .build(); + return deleteTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetTcpProxy resource. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy.toString());
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetTcpProxy(String requestId, String targetTcpProxy) { + + DeleteTargetTcpProxyHttpRequest request = + DeleteTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy) + .build(); + return deleteTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetTcpProxy resource. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .build();
+   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteTargetTcpProxy(DeleteTargetTcpProxyHttpRequest request) { + return deleteTargetTcpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified TargetTcpProxy resource. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = targetTcpProxyClient.deleteTargetTcpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteTargetTcpProxyCallable() { + return stub.deleteTargetTcpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(targetTcpProxy);
+   * }
+   * 
+ * + * @param targetTcpProxy Name of the TargetTcpProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetTcpProxy getTargetTcpProxy(TargetTcpProxyName targetTcpProxy) { + + GetTargetTcpProxyHttpRequest request = + GetTargetTcpProxyHttpRequest.newBuilder() + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .build(); + return getTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(targetTcpProxy.toString());
+   * }
+   * 
+ * + * @param targetTcpProxy Name of the TargetTcpProxy resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetTcpProxy getTargetTcpProxy(String targetTcpProxy) { + + GetTargetTcpProxyHttpRequest request = + GetTargetTcpProxyHttpRequest.newBuilder() + .setTargetTcpProxy(targetTcpProxy) + .build(); + return getTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder()
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .build();
+   *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest request) { + return getTargetTcpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder()
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .build();
+   *   ApiFuture<TargetTcpProxy> future = targetTcpProxyClient.getTargetTcpProxyCallable().futureCall(request);
+   *   // Do something
+   *   TargetTcpProxy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getTargetTcpProxyCallable() { + return stub.getTargetTcpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
+   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(requestId, project, targetTcpProxyResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetTcpProxy(String requestId, ProjectName project, TargetTcpProxy targetTcpProxyResource) { + + InsertTargetTcpProxyHttpRequest request = + InsertTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setTargetTcpProxyResource(targetTcpProxyResource) + .build(); + return insertTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
+   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(requestId, project.toString(), targetTcpProxyResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetTcpProxy(String requestId, String project, TargetTcpProxy targetTcpProxyResource) { + + InsertTargetTcpProxyHttpRequest request = + InsertTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setTargetTcpProxyResource(targetTcpProxyResource) + .build(); + return insertTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
+   *   InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setTargetTcpProxyResource(targetTcpProxyResource)
+   *     .build();
+   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertTargetTcpProxy(InsertTargetTcpProxyHttpRequest request) { + return insertTargetTcpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
+   *   InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setTargetTcpProxyResource(targetTcpProxyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetTcpProxyClient.insertTargetTcpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertTargetTcpProxyCallable() { + return stub.insertTargetTcpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetTcpProxy element : targetTcpProxyClient.listTargetTcpProxies(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ProjectName project) { + ListTargetTcpProxiesHttpRequest request = + ListTargetTcpProxiesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listTargetTcpProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (TargetTcpProxy element : targetTcpProxyClient.listTargetTcpProxies(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(String project) { + ListTargetTcpProxiesHttpRequest request = + ListTargetTcpProxiesHttpRequest.newBuilder() + .setProject(project) + .build(); + return listTargetTcpProxies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetTcpProxiesHttpRequest request = ListTargetTcpProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (TargetTcpProxy element : targetTcpProxyClient.listTargetTcpProxies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ListTargetTcpProxiesHttpRequest request) { + return listTargetTcpProxiesPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetTcpProxiesHttpRequest request = ListTargetTcpProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListTargetTcpProxiesPagedResponse> future = targetTcpProxyClient.listTargetTcpProxiesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TargetTcpProxy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetTcpProxiesPagedCallable() { + return stub.listTargetTcpProxiesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListTargetTcpProxiesHttpRequest request = ListTargetTcpProxiesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     TargetTcpProxyList response = targetTcpProxyClient.listTargetTcpProxiesCallable().call(request);
+   *     for (TargetTcpProxy element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listTargetTcpProxiesCallable() { + return stub.listTargetTcpProxiesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
+   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param targetTcpProxiesSetBackendServiceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackendServiceTargetTcpProxy(String requestId, TargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { + + SetBackendServiceTargetTcpProxyHttpRequest request = + SetBackendServiceTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource) + .build(); + return setBackendServiceTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
+   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetBackendServiceRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param targetTcpProxiesSetBackendServiceRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackendServiceTargetTcpProxy(String requestId, String targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { + + SetBackendServiceTargetTcpProxyHttpRequest request = + SetBackendServiceTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy) + .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource) + .build(); + return setBackendServiceTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
+   *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource)
+   *     .build();
+   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setBackendServiceTargetTcpProxy(SetBackendServiceTargetTcpProxyHttpRequest request) { + return setBackendServiceTargetTcpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the BackendService for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
+   *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetTcpProxyClient.setBackendServiceTargetTcpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setBackendServiceTargetTcpProxyCallable() { + return stub.setBackendServiceTargetTcpProxyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param targetTcpProxiesSetProxyHeaderRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setProxyHeaderTargetTcpProxy(String requestId, TargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { + + SetProxyHeaderTargetTcpProxyHttpRequest request = + SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource) + .build(); + return setProxyHeaderTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetProxyHeaderRequestResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param targetTcpProxiesSetProxyHeaderRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setProxyHeaderTargetTcpProxy(String requestId, String targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { + + SetProxyHeaderTargetTcpProxyHttpRequest request = + SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder() + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy) + .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource) + .build(); + return setProxyHeaderTargetTcpProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource)
+   *     .build();
+   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setProxyHeaderTargetTcpProxy(SetProxyHeaderTargetTcpProxyHttpRequest request) { + return setProxyHeaderTargetTcpProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * Sample code: + *

+   * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+   *   String requestId = "";
+   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
+   *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setTargetTcpProxy(targetTcpProxy.toString())
+   *     .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetTcpProxyClient.setProxyHeaderTargetTcpProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setProxyHeaderTargetTcpProxyCallable() { + return stub.setProxyHeaderTargetTcpProxyCallable(); + } + + @Override + public final void close() throws Exception { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTargetTcpProxiesPagedResponse extends AbstractPagedListResponse< + ListTargetTcpProxiesHttpRequest, + TargetTcpProxyList, + TargetTcpProxy, + ListTargetTcpProxiesPage, + ListTargetTcpProxiesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTargetTcpProxiesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTargetTcpProxiesPagedResponse apply(ListTargetTcpProxiesPage input) { + return new ListTargetTcpProxiesPagedResponse(input); + } + }); + } + + private ListTargetTcpProxiesPagedResponse(ListTargetTcpProxiesPage page) { + super(page, ListTargetTcpProxiesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListTargetTcpProxiesPage extends AbstractPage< + ListTargetTcpProxiesHttpRequest, + TargetTcpProxyList, + TargetTcpProxy, + ListTargetTcpProxiesPage> { + + private ListTargetTcpProxiesPage( + PageContext context, + TargetTcpProxyList response) { + super(context, response); + } + + private static ListTargetTcpProxiesPage createEmptyPage() { + return new ListTargetTcpProxiesPage(null, null); + } + + @Override + protected ListTargetTcpProxiesPage createPage( + PageContext context, + TargetTcpProxyList response) { + return new ListTargetTcpProxiesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListTargetTcpProxiesFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetTcpProxiesHttpRequest, + TargetTcpProxyList, + TargetTcpProxy, + ListTargetTcpProxiesPage, + ListTargetTcpProxiesFixedSizeCollection> { + + private ListTargetTcpProxiesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTargetTcpProxiesFixedSizeCollection createEmptyCollection() { + return new ListTargetTcpProxiesFixedSizeCollection(null, 0); + } + + @Override + protected ListTargetTcpProxiesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTargetTcpProxiesFixedSizeCollection(pages, collectionSize); + } + + + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java new file mode 100644 index 000000000000..6560f4910bf3 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java @@ -0,0 +1,344 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TargetTcpProxyList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private TargetTcpProxyList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + + private TargetTcpProxyList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning + ) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetTcpProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TargetTcpProxyList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static TargetTcpProxyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final TargetTcpProxyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TargetTcpProxyList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(TargetTcpProxyList other) { + if (other == TargetTcpProxyList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(TargetTcpProxyList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(TargetTcpProxy items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + + public TargetTcpProxyList build() { + + + + + + return new TargetTcpProxyList( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "TargetTcpProxyList{" + + "id=" + id + ", " + + "items=" + items + ", " + + "kind=" + kind + ", " + + "nextPageToken=" + nextPageToken + ", " + + "selfLink=" + selfLink + ", " + + "warning=" + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetTcpProxyList) { + TargetTcpProxyList that = (TargetTcpProxyList) o; + return + Objects.equals(this.id, that.getId()) && + Objects.equals(this.items, that.getItemsList()) && + Objects.equals(this.kind, that.getKind()) && + Objects.equals(this.nextPageToken, that.getNextPageToken()) && + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + id, + items, + kind, + nextPageToken, + selfLink, + warning + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java new file mode 100644 index 000000000000..ecb39d760036 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java @@ -0,0 +1,186 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class TargetTcpProxyName implements com.google.api.resourcenames.ResourceName { + private final String project; + private final String targetTcpProxy; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/targetTcpProxies/{targetTcpProxy}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TargetTcpProxyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + targetTcpProxy = Preconditions.checkNotNull(builder.getTargetTcpProxy()); + } + + public static TargetTcpProxyName of( + String project, + String targetTcpProxy + ) { + return newBuilder() + .setProject(project) + .setTargetTcpProxy(targetTcpProxy) + .build(); + } + + public static String format( + String project, + String targetTcpProxy + ) { + return of( + project, + targetTcpProxy + ) + .toString(); + } + + public String getProject() { + return project; + } + + public String getTargetTcpProxy() { + return targetTcpProxy; + } + + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("targetTcpProxy", targetTcpProxy); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public TargetTcpProxyName parse(String formattedString) {return TargetTcpProxyName.parse(formattedString);} + }; + } + + public static TargetTcpProxyName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "TargetTcpProxyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("targetTcpProxy") + ); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String targetTcpProxy; + + public String getProject() { + return project; + } + public String getTargetTcpProxy() { + return targetTcpProxy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + public Builder setTargetTcpProxy(String targetTcpProxy) { + this.targetTcpProxy = targetTcpProxy; + return this; + } + + private Builder() {} + + public Builder (TargetTcpProxyName targetTcpProxyName) { + project = targetTcpProxyName.project; + targetTcpProxy = targetTcpProxyName.targetTcpProxy; + } + + public TargetTcpProxyName build() { + return new TargetTcpProxyName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "targetTcpProxy", targetTcpProxy + ); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TargetTcpProxyName) { + TargetTcpProxyName that = (TargetTcpProxyName) o; + return + Objects.equals(this.project, that.getProject()) && + Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + project, + targetTcpProxy + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java new file mode 100644 index 000000000000..c2026bbef507 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import com.google.cloud.compute.v1.stub.TargetTcpProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetTcpProxyClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetTcpProxy to 30 seconds: + * + *

+ * 
+ * TargetTcpProxySettings.Builder targetTcpProxySettingsBuilder =
+ *     TargetTcpProxySettings.newBuilder();
+ * targetTcpProxySettingsBuilder.deleteTargetTcpProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetTcpProxySettings targetTcpProxySettings = targetTcpProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetTcpProxySettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to deleteTargetTcpProxy. + */ + public UnaryCallSettings deleteTargetTcpProxySettings() { + return ((TargetTcpProxyStubSettings) getStubSettings()).deleteTargetTcpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to getTargetTcpProxy. + */ + public UnaryCallSettings getTargetTcpProxySettings() { + return ((TargetTcpProxyStubSettings) getStubSettings()).getTargetTcpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to insertTargetTcpProxy. + */ + public UnaryCallSettings insertTargetTcpProxySettings() { + return ((TargetTcpProxyStubSettings) getStubSettings()).insertTargetTcpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to listTargetTcpProxies. + */ + public PagedCallSettings listTargetTcpProxiesSettings() { + return ((TargetTcpProxyStubSettings) getStubSettings()).listTargetTcpProxiesSettings(); + } + + /** + * Returns the object with the settings used for calls to setBackendServiceTargetTcpProxy. + */ + public UnaryCallSettings setBackendServiceTargetTcpProxySettings() { + return ((TargetTcpProxyStubSettings) getStubSettings()).setBackendServiceTargetTcpProxySettings(); + } + + /** + * Returns the object with the settings used for calls to setProxyHeaderTargetTcpProxy. + */ + public UnaryCallSettings setProxyHeaderTargetTcpProxySettings() { + return ((TargetTcpProxyStubSettings) getStubSettings()).setProxyHeaderTargetTcpProxySettings(); + } + + + public static final TargetTcpProxySettings create(TargetTcpProxyStubSettings stub) throws IOException { + return new TargetTcpProxySettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TargetTcpProxyStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return TargetTcpProxyStubSettings.getDefaultEndpoint(); + } + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return TargetTcpProxyStubSettings.getDefaultServicePort(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return TargetTcpProxyStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TargetTcpProxyStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return TargetTcpProxyStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TargetTcpProxyStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TargetTcpProxyStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetTcpProxySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for TargetTcpProxySettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TargetTcpProxyStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TargetTcpProxyStubSettings.newBuilder()); + } + + protected Builder(TargetTcpProxySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TargetTcpProxyStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public TargetTcpProxyStubSettings.Builder getStubSettingsBuilder() { + return ((TargetTcpProxyStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetTcpProxy. + */ + public UnaryCallSettings.Builder deleteTargetTcpProxySettings() { + return getStubSettingsBuilder().deleteTargetTcpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to getTargetTcpProxy. + */ + public UnaryCallSettings.Builder getTargetTcpProxySettings() { + return getStubSettingsBuilder().getTargetTcpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to insertTargetTcpProxy. + */ + public UnaryCallSettings.Builder insertTargetTcpProxySettings() { + return getStubSettingsBuilder().insertTargetTcpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to listTargetTcpProxies. + */ + public PagedCallSettings.Builder listTargetTcpProxiesSettings() { + return getStubSettingsBuilder().listTargetTcpProxiesSettings(); + } + + /** + * Returns the builder for the settings used for calls to setBackendServiceTargetTcpProxy. + */ + public UnaryCallSettings.Builder setBackendServiceTargetTcpProxySettings() { + return getStubSettingsBuilder().setBackendServiceTargetTcpProxySettings(); + } + + /** + * Returns the builder for the settings used for calls to setProxyHeaderTargetTcpProxy. + */ + public UnaryCallSettings.Builder setProxyHeaderTargetTcpProxySettings() { + return getStubSettingsBuilder().setProxyHeaderTargetTcpProxySettings(); + } + + @Override + public TargetTcpProxySettings build() throws IOException { + return new TargetTcpProxySettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java index 0c96312cb6f1..1d334e0e5b7a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java @@ -37,6 +37,7 @@ public final class TargetVpnGatewayAggregatedList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private TargetVpnGatewayAggregatedList() { this.id = null; @@ -44,6 +45,7 @@ private TargetVpnGatewayAggregatedList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private TargetVpnGatewayAggregatedList( Map items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -128,6 +138,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -154,6 +168,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -174,6 +189,9 @@ public Builder mergeFrom(TargetVpnGatewayAggregatedList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -183,6 +201,7 @@ public Builder mergeFrom(TargetVpnGatewayAggregatedList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public TargetVpnGatewayAggregatedList build() { + return new TargetVpnGatewayAggregatedList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -252,6 +282,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -263,7 +294,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -279,7 +311,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsMap()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -292,7 +325,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java index 4a5df169b842..b82d53b0fbdd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java @@ -23,12 +23,22 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStub; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import java.io.Closeable; import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -42,40 +52,41 @@ *
  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+ *   String requestId = "";
  *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
- *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
+ *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: + *

The surface of this class includes several types of Java methods for each of the API's methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. * *

This class can be customized by passing in a custom instance of TargetVpnGatewaySettings to * create(). For example: * - *

To customize credentials: + * To customize credentials: * *

  * 
@@ -105,23 +116,27 @@ public class TargetVpnGatewayClient implements BackgroundResource {
   private final TargetVpnGatewaySettings settings;
   private final TargetVpnGatewayStub stub;
 
-  /** Constructs an instance of TargetVpnGatewayClient with default settings. */
+
+
+  /**
+   * Constructs an instance of TargetVpnGatewayClient with default settings.
+   */
   public static final TargetVpnGatewayClient create() throws IOException {
     return create(TargetVpnGatewaySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given settings. The channels are
-   * created based on the settings passed in, or defaults for any settings that are not set.
+   * Constructs an instance of TargetVpnGatewayClient, using the given settings.
+   * The channels are created based on the settings passed in, or defaults for any
+   * settings that are not set.
    */
-  public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings)
-      throws IOException {
+  public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings) throws IOException {
     return new TargetVpnGatewayClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This
-   * is for advanced usage - prefer to use TargetVpnGatewaySettings}.
+   * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This is for
+   * advanced usage - prefer to use TargetVpnGatewaySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) {
@@ -129,9 +144,9 @@ public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given settings. This is protected
-   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
-   * preferred.
+   * Constructs an instance of TargetVpnGatewayClient, using the given settings.
+   * This is protected so that it is easy to make a subclass, but otherwise, the static
+   * factory methods should be preferred.
    */
   protected TargetVpnGatewayClient(TargetVpnGatewaySettings settings) throws IOException {
     this.settings = settings;
@@ -153,12 +168,12 @@ public TargetVpnGatewayStub getStub() {
     return stub;
   }
 
+
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -172,12 +187,11 @@ public TargetVpnGatewayStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
-      ProjectName project) {
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(ProjectName project) {
     AggregatedListTargetVpnGatewaysHttpRequest request =
         AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
-            .setProject(project == null ? null : project.toString())
-            .build();
+        .setProject(project == null ? null : project.toString())
+        .build();
     return aggregatedListTargetVpnGateways(request);
   }
 
@@ -185,8 +199,7 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -200,10 +213,11 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
-      String project) {
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(String project) {
     AggregatedListTargetVpnGatewaysHttpRequest request =
-        AggregatedListTargetVpnGatewaysHttpRequest.newBuilder().setProject(project).build();
+        AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
+        .setProject(project)
+        .build();
     return aggregatedListTargetVpnGateways(request);
   }
 
@@ -211,8 +225,7 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -229,17 +242,16 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
-      AggregatedListTargetVpnGatewaysHttpRequest request) {
-    return aggregatedListTargetVpnGatewaysPagedCallable().call(request);
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(AggregatedListTargetVpnGatewaysHttpRequest request) {
+    return aggregatedListTargetVpnGatewaysPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -255,9 +267,7 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * 
*/ @BetaApi - public final UnaryCallable< - AggregatedListTargetVpnGatewaysHttpRequest, AggregatedListTargetVpnGatewaysPagedResponse> - aggregatedListTargetVpnGatewaysPagedCallable() { + public final UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { return stub.aggregatedListTargetVpnGatewaysPagedCallable(); } @@ -265,8 +275,7 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp /** * Retrieves an aggregated list of target VPN gateways. * - *

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -289,9 +298,7 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * 
*/ @BetaApi - public final UnaryCallable< - AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList> - aggregatedListTargetVpnGatewaysCallable() { + public final UnaryCallable aggregatedListTargetVpnGatewaysCallable() { return stub.aggregatedListTargetVpnGatewaysCallable(); } @@ -299,25 +306,31 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp /** * Deletes the specified target VPN gateway. * - *

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
-   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetVpnGateway Name of the target VPN gateway to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetVpnGateway(TargetVpnGatewayName targetVpnGateway) { + public final Operation deleteTargetVpnGateway(String requestId, TargetVpnGatewayName targetVpnGateway) { DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder() - .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) - .build(); + .setRequestId(requestId) + .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) + .build(); return deleteTargetVpnGateway(request); } @@ -325,25 +338,31 @@ public final Operation deleteTargetVpnGateway(TargetVpnGatewayName targetVpnGate /** * Deletes the specified target VPN gateway. * - *

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
-   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway.toString());
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param targetVpnGateway Name of the target VPN gateway to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetVpnGateway(String targetVpnGateway) { + public final Operation deleteTargetVpnGateway(String requestId, String targetVpnGateway) { DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder() - .setTargetVpnGateway(targetVpnGateway) - .build(); + .setRequestId(requestId) + .setTargetVpnGateway(targetVpnGateway) + .build(); return deleteTargetVpnGateway(request); } @@ -351,12 +370,13 @@ public final Operation deleteTargetVpnGateway(String targetVpnGateway) { /** * Deletes the specified target VPN gateway. * - *

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetVpnGateway(targetVpnGateway.toString())
    *     .build();
    *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(request);
@@ -375,12 +395,13 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
   /**
    * Deletes the specified target VPN gateway.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setTargetVpnGateway(targetVpnGateway.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetVpnGatewayClient.deleteTargetVpnGatewayCallable().futureCall(request);
@@ -390,18 +411,15 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - deleteTargetVpnGatewayCallable() { + public final UnaryCallable deleteTargetVpnGatewayCallable() { return stub.deleteTargetVpnGatewayCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making - * a list() request. - * - *

Sample code: + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -417,18 +435,16 @@ public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpn
 
     GetTargetVpnGatewayHttpRequest request =
         GetTargetVpnGatewayHttpRequest.newBuilder()
-            .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
-            .build();
+        .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
+        .build();
     return getTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
-   * a list() request.
-   *
-   * 

Sample code: + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -443,17 +459,17 @@ public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpn
   public final TargetVpnGateway getTargetVpnGateway(String targetVpnGateway) {
 
     GetTargetVpnGatewayHttpRequest request =
-        GetTargetVpnGatewayHttpRequest.newBuilder().setTargetVpnGateway(targetVpnGateway).build();
+        GetTargetVpnGatewayHttpRequest.newBuilder()
+        .setTargetVpnGateway(targetVpnGateway)
+        .build();
     return getTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
-   * a list() request.
-   *
-   * 

Sample code: + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -474,11 +490,9 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
-   * a list() request.
-   *
-   * 

Sample code: + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -492,85 +506,92 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - getTargetVpnGatewayCallable() { + public final UnaryCallable getTargetVpnGatewayCallable() { return stub.getTargetVpnGatewayCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the - * request. - * - *

Sample code: + * Creates a target VPN gateway in the specified project and region using the data included in the request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
-   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(region, targetVpnGatewayResource);
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param targetVpnGatewayResource Represents a Target VPN gateway resource. + * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetVpnGateway( - RegionName region, TargetVpnGateway targetVpnGatewayResource) { + public final Operation insertTargetVpnGateway(String requestId, RegionName region, TargetVpnGateway targetVpnGatewayResource) { InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder() - .setRegion(region == null ? null : region.toString()) - .setTargetVpnGatewayResource(targetVpnGatewayResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setTargetVpnGatewayResource(targetVpnGatewayResource) + .build(); return insertTargetVpnGateway(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the - * request. - * - *

Sample code: + * Creates a target VPN gateway in the specified project and region using the data included in the request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
-   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(region.toString(), targetVpnGatewayResource);
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(requestId, region.toString(), targetVpnGatewayResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param targetVpnGatewayResource Represents a Target VPN gateway resource. + * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetVpnGateway( - String region, TargetVpnGateway targetVpnGatewayResource) { + public final Operation insertTargetVpnGateway(String requestId, String region, TargetVpnGateway targetVpnGatewayResource) { InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder() - .setRegion(region) - .setTargetVpnGatewayResource(targetVpnGatewayResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setTargetVpnGatewayResource(targetVpnGatewayResource) + .build(); return insertTargetVpnGateway(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the - * request. - * - *

Sample code: + * Creates a target VPN gateway in the specified project and region using the data included in the request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetVpnGatewayResource(targetVpnGatewayResource)
    *     .build();
@@ -588,16 +609,16 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a target VPN gateway in the specified project and region using the data included in the
-   * request.
-   *
-   * 

Sample code: + * Creates a target VPN gateway in the specified project and region using the data included in the request. * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetVpnGatewayResource(targetVpnGatewayResource)
    *     .build();
@@ -608,8 +629,7 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable - insertTargetVpnGatewayCallable() { + public final UnaryCallable insertTargetVpnGatewayCallable() { return stub.insertTargetVpnGatewayCallable(); } @@ -617,8 +637,7 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest /** * Retrieves a list of target VPN gateways available to the specified project and region. * - *

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -635,8 +654,8 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
   public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName region) {
     ListTargetVpnGatewaysHttpRequest request =
         ListTargetVpnGatewaysHttpRequest.newBuilder()
-            .setRegion(region == null ? null : region.toString())
-            .build();
+        .setRegion(region == null ? null : region.toString())
+        .build();
     return listTargetVpnGateways(request);
   }
 
@@ -644,8 +663,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -661,7 +679,9 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName
   @BetaApi
   public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String region) {
     ListTargetVpnGatewaysHttpRequest request =
-        ListTargetVpnGatewaysHttpRequest.newBuilder().setRegion(region).build();
+        ListTargetVpnGatewaysHttpRequest.newBuilder()
+        .setRegion(region)
+        .build();
     return listTargetVpnGateways(request);
   }
 
@@ -669,8 +689,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -687,17 +706,16 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(
-      ListTargetVpnGatewaysHttpRequest request) {
-    return listTargetVpnGatewaysPagedCallable().call(request);
+  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTargetVpnGatewaysHttpRequest request) {
+    return listTargetVpnGatewaysPagedCallable()
+        .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * 

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -713,8 +731,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(
    * 
*/ @BetaApi - public final UnaryCallable - listTargetVpnGatewaysPagedCallable() { + public final UnaryCallable listTargetVpnGatewaysPagedCallable() { return stub.listTargetVpnGatewaysPagedCallable(); } @@ -722,8 +739,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways( /** * Retrieves a list of target VPN gateways available to the specified project and region. * - *

Sample code: - * + * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
@@ -746,8 +762,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(
    * 
*/ @BetaApi - public final UnaryCallable - listTargetVpnGatewaysCallable() { + public final UnaryCallable listTargetVpnGatewaysCallable() { return stub.listTargetVpnGatewaysCallable(); } @@ -781,31 +796,23 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListTargetVpnGatewaysPagedResponse - extends AbstractPagedListResponse< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage, - AggregatedListTargetVpnGatewaysFixedSizeCollection> { + public static class AggregatedListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { public static ApiFuture createAsync( - PageContext< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList> - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListTargetVpnGatewaysPage.createEmptyPage() - .createPageAsync(context, futureResponse); + AggregatedListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction< - AggregatedListTargetVpnGatewaysPage, AggregatedListTargetVpnGatewaysPagedResponse>() { + new ApiFunction() { @Override - public AggregatedListTargetVpnGatewaysPagedResponse apply( - AggregatedListTargetVpnGatewaysPage input) { + public AggregatedListTargetVpnGatewaysPagedResponse apply(AggregatedListTargetVpnGatewaysPage input) { return new AggregatedListTargetVpnGatewaysPagedResponse(input); } }); @@ -814,21 +821,18 @@ public AggregatedListTargetVpnGatewaysPagedResponse apply( private AggregatedListTargetVpnGatewaysPagedResponse(AggregatedListTargetVpnGatewaysPage page) { super(page, AggregatedListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); } + + } - public static class AggregatedListTargetVpnGatewaysPage - extends AbstractPage< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage> { + public static class AggregatedListTargetVpnGatewaysPage extends AbstractPage< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage> { private AggregatedListTargetVpnGatewaysPage( - PageContext< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList> - context, + PageContext context, TargetVpnGatewayAggregatedList response) { super(context, response); } @@ -839,37 +843,31 @@ private static AggregatedListTargetVpnGatewaysPage createEmptyPage() { @Override protected AggregatedListTargetVpnGatewaysPage createPage( - PageContext< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList> - context, + PageContext context, TargetVpnGatewayAggregatedList response) { return new AggregatedListTargetVpnGatewaysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList> - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class AggregatedListTargetVpnGatewaysFixedSizeCollection - extends AbstractFixedSizeCollection< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage, - AggregatedListTargetVpnGatewaysFixedSizeCollection> { + public static class AggregatedListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< + AggregatedListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, + AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { - private AggregatedListTargetVpnGatewaysFixedSizeCollection( - List pages, int collectionSize) { + private AggregatedListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -882,19 +880,18 @@ protected AggregatedListTargetVpnGatewaysFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); } - } - public static class ListTargetVpnGatewaysPagedResponse - extends AbstractPagedListResponse< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage, - ListTargetVpnGatewaysFixedSizeCollection> { + + } + public static class ListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage, + ListTargetVpnGatewaysFixedSizeCollection> { public static ApiFuture createAsync( - PageContext - context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -911,18 +908,18 @@ public ListTargetVpnGatewaysPagedResponse apply(ListTargetVpnGatewaysPage input) private ListTargetVpnGatewaysPagedResponse(ListTargetVpnGatewaysPage page) { super(page, ListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); } + + } - public static class ListTargetVpnGatewaysPage - extends AbstractPage< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage> { + public static class ListTargetVpnGatewaysPage extends AbstractPage< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage> { private ListTargetVpnGatewaysPage( - PageContext - context, + PageContext context, TargetVpnGatewayList response) { super(context, response); } @@ -933,31 +930,31 @@ private static ListTargetVpnGatewaysPage createEmptyPage() { @Override protected ListTargetVpnGatewaysPage createPage( - PageContext - context, + PageContext context, TargetVpnGatewayList response) { return new ListTargetVpnGatewaysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext - context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } + + + + } - public static class ListTargetVpnGatewaysFixedSizeCollection - extends AbstractFixedSizeCollection< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage, - ListTargetVpnGatewaysFixedSizeCollection> { + public static class ListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< + ListTargetVpnGatewaysHttpRequest, + TargetVpnGatewayList, + TargetVpnGateway, + ListTargetVpnGatewaysPage, + ListTargetVpnGatewaysFixedSizeCollection> { - private ListTargetVpnGatewaysFixedSizeCollection( - List pages, int collectionSize) { + private ListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } @@ -970,5 +967,7 @@ protected ListTargetVpnGatewaysFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); } + + } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java index da5a02f82bd8..96555bee7946 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java @@ -37,6 +37,7 @@ public final class TargetVpnGatewayList implements ApiMessage { private final String kind; private final String nextPageToken; private final String selfLink; + private final Warning warning; private TargetVpnGatewayList() { this.id = null; @@ -44,6 +45,7 @@ private TargetVpnGatewayList() { this.kind = null; this.nextPageToken = null; this.selfLink = null; + this.warning = null; } @@ -52,13 +54,15 @@ private TargetVpnGatewayList( List items, String kind, String nextPageToken, - String selfLink + String selfLink, + Warning warning ) { this.id = id; this.items = items; this.kind = kind; this.nextPageToken = nextPageToken; this.selfLink = selfLink; + this.warning = warning; } @Override @@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } return fieldMap; } @@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @@ -132,6 +142,10 @@ public String getSelfLink() { return selfLink; } + public Warning getWarning() { + return warning; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -158,6 +172,7 @@ public static class Builder { private String kind; private String nextPageToken; private String selfLink; + private Warning warning; Builder() {} @@ -178,6 +193,9 @@ public Builder mergeFrom(TargetVpnGatewayList other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getWarning() != null) { + this.warning = other.warning; + } return this; } @@ -187,6 +205,7 @@ public Builder mergeFrom(TargetVpnGatewayList other) { this.kind = source.kind; this.nextPageToken = source.nextPageToken; this.selfLink = source.selfLink; + this.warning = source.warning; } public String getId() { @@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) { return this; } + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + public TargetVpnGatewayList build() { + return new TargetVpnGatewayList( id, items, kind, nextPageToken, - selfLink + selfLink, + warning ); } @@ -264,6 +294,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setNextPageToken(this.nextPageToken); newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); return newBuilder; } } @@ -275,7 +306,8 @@ public String toString() { + "items=" + items + ", " + "kind=" + kind + ", " + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + + "selfLink=" + selfLink + ", " + + "warning=" + warning + "}"; } @@ -291,7 +323,8 @@ public boolean equals(Object o) { Objects.equals(this.items, that.getItemsList()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) + Objects.equals(this.selfLink, that.getSelfLink()) && + Objects.equals(this.warning, that.getWarning()) ; } return false; @@ -304,7 +337,8 @@ public int hashCode() { items, kind, nextPageToken, - selfLink + selfLink, + warning ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java index 7cf01894ec7a..2ac2a7859cb2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java @@ -17,7 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,7 +31,7 @@ @Generated("by GAPIC") @BetaApi -public final class TargetVpnGatewayName implements ResourceName { +public final class TargetVpnGatewayName implements com.google.api.resourcenames.ResourceName { private final String project; private final String region; private final String targetVpnGateway; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java index 81f4c5bbe9ee..48ed9f78bf64 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java @@ -18,6 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -39,7 +40,11 @@ private TargetVpnGatewaysScopedList() { this.warning = null; } - private TargetVpnGatewaysScopedList(List targetVpnGateways, Warning warning) { + + private TargetVpnGatewaysScopedList( + List targetVpnGateways, + Warning warning + ) { this.targetVpnGateways = targetVpnGateways; this.warning = warning; } @@ -85,24 +90,22 @@ public Warning getWarning() { return warning; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(TargetVpnGatewaysScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static TargetVpnGatewaysScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final TargetVpnGatewaysScopedList DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new TargetVpnGatewaysScopedList(); } @@ -155,9 +158,13 @@ public Builder setWarning(Warning warning) { return this; } + public TargetVpnGatewaysScopedList build() { - return new TargetVpnGatewaysScopedList(targetVpnGateways, warning); + return new TargetVpnGatewaysScopedList( + targetVpnGateways, + warning + ); } public Builder clone() { @@ -171,11 +178,8 @@ public Builder clone() { @Override public String toString() { return "TargetVpnGatewaysScopedList{" - + "targetVpnGateways=" - + targetVpnGateways - + ", " - + "warning=" - + warning + + "targetVpnGateways=" + targetVpnGateways + ", " + + "warning=" + warning + "}"; } @@ -186,14 +190,19 @@ public boolean equals(Object o) { } if (o instanceof TargetVpnGatewaysScopedList) { TargetVpnGatewaysScopedList that = (TargetVpnGatewaysScopedList) o; - return Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList()) - && Objects.equals(this.warning, that.getWarning()); + return + Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList()) && + Objects.equals(this.warning, that.getWarning()) + ; } return false; } @Override public int hashCode() { - return Objects.hash(targetVpnGateways, warning); + return Objects.hash( + targetVpnGateways, + warning + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java new file mode 100644 index 000000000000..bdd8382816fb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java @@ -0,0 +1,511 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateAccessConfigInstanceHttpRequest implements ApiMessage { + private final AccessConfig accessConfigResource; + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String networkInterface; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private UpdateAccessConfigInstanceHttpRequest() { + this.accessConfigResource = null; + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.networkInterface = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private UpdateAccessConfigInstanceHttpRequest( + AccessConfig accessConfigResource, + String access_token, + String callback, + String fields, + String instance, + String key, + String networkInterface, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.accessConfigResource = accessConfigResource; + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.networkInterface = networkInterface; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { + fieldMap.put("accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("accessConfigResource")) { + return String.valueOf(accessConfigResource); + } + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("networkInterface")) { + return String.valueOf(networkInterface); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public AccessConfig getApiMessageRequestBody() { + return accessConfigResource; + } + + public AccessConfig getAccessConfigResource() { + return accessConfigResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateAccessConfigInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateAccessConfigInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateAccessConfigInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateAccessConfigInstanceHttpRequest(); + } + + public static class Builder { + private AccessConfig accessConfigResource; + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String networkInterface; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateAccessConfigInstanceHttpRequest other) { + if (other == UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessConfigResource() != null) { + this.accessConfigResource = other.accessConfigResource; + } + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetworkInterface() != null) { + this.networkInterface = other.networkInterface; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateAccessConfigInstanceHttpRequest source) { + this.accessConfigResource = source.accessConfigResource; + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.networkInterface = source.networkInterface; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public AccessConfig getAccessConfigResource() { + return accessConfigResource; + } + + public Builder setAccessConfigResource(AccessConfig accessConfigResource) { + this.accessConfigResource = accessConfigResource; + return this; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public Builder setNetworkInterface(String networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateAccessConfigInstanceHttpRequest build() { + String missing = ""; + + + + + if (instance == null) { + missing += " instance"; + } + + if (networkInterface == null) { + missing += " networkInterface"; + } + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateAccessConfigInstanceHttpRequest( + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessConfigResource(this.accessConfigResource); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setNetworkInterface(this.networkInterface); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateAccessConfigInstanceHttpRequest{" + + "accessConfigResource=" + accessConfigResource + ", " + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "networkInterface=" + networkInterface + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateAccessConfigInstanceHttpRequest) { + UpdateAccessConfigInstanceHttpRequest that = (UpdateAccessConfigInstanceHttpRequest) o; + return + Objects.equals(this.accessConfigResource, that.getAccessConfigResource()) && + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.networkInterface, that.getNetworkInterface()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index 5069f79fd234..644fe00e8599 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateAutoscalerHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private final String zone; @@ -52,6 +53,7 @@ private UpdateAutoscalerHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; this.zone = null; } @@ -66,6 +68,7 @@ private UpdateAutoscalerHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp, String zone ) { @@ -77,6 +80,7 @@ private UpdateAutoscalerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; this.zone = zone; } @@ -108,6 +112,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -143,6 +150,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -190,6 +200,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -227,6 +241,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; private String zone; @@ -258,6 +273,9 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -276,6 +294,7 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; this.zone = source.zone; } @@ -352,6 +371,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -382,6 +410,7 @@ public UpdateAutoscalerHttpRequest build() { + if (zone == null) { missing += " zone"; } @@ -397,6 +426,7 @@ public UpdateAutoscalerHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); @@ -412,6 +442,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -429,6 +460,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + ", " + "zone=" + zone + "}"; @@ -450,6 +482,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) && Objects.equals(this.zone, that.getZone()) ; @@ -468,6 +501,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp, zone ); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java new file mode 100644 index 000000000000..68ff06ee267e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateBackendBucketHttpRequest implements ApiMessage { + private final String access_token; + private final String backendBucket; + private final BackendBucket backendBucketResource; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private UpdateBackendBucketHttpRequest() { + this.access_token = null; + this.backendBucket = null; + this.backendBucketResource = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private UpdateBackendBucketHttpRequest( + String access_token, + String backendBucket, + BackendBucket backendBucketResource, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.backendBucket = backendBucket; + this.backendBucketResource = backendBucketResource; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucket") && backendBucket != null) { + fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); + } + if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { + fieldMap.put("backendBucketResource", Collections.singletonList(String.valueOf(backendBucketResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("backendBucket")) { + return String.valueOf(backendBucket); + } + if (fieldName.equals("backendBucketResource")) { + return String.valueOf(backendBucketResource); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public BackendBucket getApiMessageRequestBody() { + return backendBucketResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getBackendBucket() { + return backendBucket; + } + + public BackendBucket getBackendBucketResource() { + return backendBucketResource; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateBackendBucketHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateBackendBucketHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateBackendBucketHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateBackendBucketHttpRequest(); + } + + public static class Builder { + private String access_token; + private String backendBucket; + private BackendBucket backendBucketResource; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateBackendBucketHttpRequest other) { + if (other == UpdateBackendBucketHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getBackendBucket() != null) { + this.backendBucket = other.backendBucket; + } + if (other.getBackendBucketResource() != null) { + this.backendBucketResource = other.backendBucketResource; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateBackendBucketHttpRequest source) { + this.access_token = source.access_token; + this.backendBucket = source.backendBucket; + this.backendBucketResource = source.backendBucketResource; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getBackendBucket() { + return backendBucket; + } + + public Builder setBackendBucket(String backendBucket) { + this.backendBucket = backendBucket; + return this; + } + + public BackendBucket getBackendBucketResource() { + return backendBucketResource; + } + + public Builder setBackendBucketResource(BackendBucket backendBucketResource) { + this.backendBucketResource = backendBucketResource; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateBackendBucketHttpRequest build() { + String missing = ""; + + if (backendBucket == null) { + missing += " backendBucket"; + } + + + + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateBackendBucketHttpRequest( + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setBackendBucket(this.backendBucket); + newBuilder.setBackendBucketResource(this.backendBucketResource); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateBackendBucketHttpRequest{" + + "access_token=" + access_token + ", " + + "backendBucket=" + backendBucket + ", " + + "backendBucketResource=" + backendBucketResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateBackendBucketHttpRequest) { + UpdateBackendBucketHttpRequest that = (UpdateBackendBucketHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.backendBucket, that.getBackendBucket()) && + Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index 64ef351ce193..9510f42023ac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateBackendServiceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private UpdateBackendServiceHttpRequest() { @@ -51,6 +52,7 @@ private UpdateBackendServiceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private UpdateBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private UpdateBackendServiceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public UpdateBackendServiceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public UpdateBackendServiceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index 53827e96d236..5d5fcf173d24 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private UpdateFirewallHttpRequest() { @@ -51,6 +52,7 @@ private UpdateFirewallHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private UpdateFirewallHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private UpdateFirewallHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public UpdateFirewallHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public UpdateFirewallHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index 93b4cb146835..15f6fd851a06 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private UpdateHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private UpdateHealthCheckHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private UpdateHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private UpdateHealthCheckHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public UpdateHealthCheckHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public UpdateHealthCheckHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index c28c311f1643..5931fe675408 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private UpdateHttpHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private UpdateHttpHealthCheckHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private UpdateHttpHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private UpdateHttpHealthCheckHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public UpdateHttpHealthCheckHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public UpdateHttpHealthCheckHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index de704a2afbfa..3bb05902a0f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private UpdateHttpsHealthCheckHttpRequest() { @@ -51,6 +52,7 @@ private UpdateHttpsHealthCheckHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private UpdateHttpsHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private UpdateHttpsHealthCheckHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public UpdateHttpsHealthCheckHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public UpdateHttpsHealthCheckHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java new file mode 100644 index 000000000000..104613a5413a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -0,0 +1,511 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String instance; + private final String key; + private final String networkInterface; + private final NetworkInterface networkInterfaceResource; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private UpdateNetworkInterfaceInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.instance = null; + this.key = null; + this.networkInterface = null; + this.networkInterfaceResource = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + + private UpdateNetworkInterfaceInstanceHttpRequest( + String access_token, + String callback, + String fields, + String instance, + String key, + String networkInterface, + NetworkInterface networkInterfaceResource, + String prettyPrint, + String quotaUser, + String requestId, + String userIp + ) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.instance = instance; + this.key = key; + this.networkInterface = networkInterface; + this.networkInterfaceResource = networkInterfaceResource; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("networkInterfaceResource") && networkInterfaceResource != null) { + fieldMap.put("networkInterfaceResource", Collections.singletonList(String.valueOf(networkInterfaceResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("networkInterface")) { + return String.valueOf(networkInterface); + } + if (fieldName.equals("networkInterfaceResource")) { + return String.valueOf(networkInterfaceResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public NetworkInterface getApiMessageRequestBody() { + return networkInterfaceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getInstance() { + return instance; + } + + public String getKey() { + return key; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public NetworkInterface getNetworkInterfaceResource() { + return networkInterfaceResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(UpdateNetworkInterfaceInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static UpdateNetworkInterfaceInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final UpdateNetworkInterfaceInstanceHttpRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new UpdateNetworkInterfaceInstanceHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String instance; + private String key; + private String networkInterface; + private NetworkInterface networkInterfaceResource; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) { + if (other == UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInstance() != null) { + this.instance = other.instance; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNetworkInterface() != null) { + this.networkInterface = other.networkInterface; + } + if (other.getNetworkInterfaceResource() != null) { + this.networkInterfaceResource = other.networkInterfaceResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(UpdateNetworkInterfaceInstanceHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.instance = source.instance; + this.key = source.key; + this.networkInterface = source.networkInterface; + this.networkInterfaceResource = source.networkInterfaceResource; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInstance() { + return instance; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNetworkInterface() { + return networkInterface; + } + + public Builder setNetworkInterface(String networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + public NetworkInterface getNetworkInterfaceResource() { + return networkInterfaceResource; + } + + public Builder setNetworkInterfaceResource(NetworkInterface networkInterfaceResource) { + this.networkInterfaceResource = networkInterfaceResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + + public UpdateNetworkInterfaceInstanceHttpRequest build() { + String missing = ""; + + + + if (instance == null) { + missing += " instance"; + } + + if (networkInterface == null) { + missing += " networkInterface"; + } + + + + + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new UpdateNetworkInterfaceInstanceHttpRequest( + access_token, + callback, + fields, + instance, + key, + networkInterface, + networkInterfaceResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInstance(this.instance); + newBuilder.setKey(this.key); + newBuilder.setNetworkInterface(this.networkInterface); + newBuilder.setNetworkInterfaceResource(this.networkInterfaceResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "UpdateNetworkInterfaceInstanceHttpRequest{" + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "instance=" + instance + ", " + + "key=" + key + ", " + + "networkInterface=" + networkInterface + ", " + + "networkInterfaceResource=" + networkInterfaceResource + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UpdateNetworkInterfaceInstanceHttpRequest) { + UpdateNetworkInterfaceInstanceHttpRequest that = (UpdateNetworkInterfaceInstanceHttpRequest) o; + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.instance, that.getInstance()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.networkInterface, that.getNetworkInterface()) && + Objects.equals(this.networkInterfaceResource, that.getNetworkInterfaceResource()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + instance, + key, + networkInterface, + networkInterfaceResource, + prettyPrint, + quotaUser, + requestId, + userIp + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index 974cfb8f187d..f23958df894b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,6 +41,7 @@ public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String region; + private final String requestId; private final String userIp; private UpdateRegionAutoscalerHttpRequest() { @@ -50,9 +54,11 @@ private UpdateRegionAutoscalerHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.region = null; + this.requestId = null; this.userIp = null; } + private UpdateRegionAutoscalerHttpRequest( String access_token, String autoscaler, @@ -63,7 +69,9 @@ private UpdateRegionAutoscalerHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp) { + String requestId, + String userIp + ) { this.access_token = access_token; this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; @@ -73,6 +81,7 @@ private UpdateRegionAutoscalerHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.region = region; + this.requestId = requestId; this.userIp = userIp; } @@ -86,8 +95,7 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -107,6 +115,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -142,6 +153,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("region")) { return String.valueOf(region); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -190,28 +204,30 @@ public String getRegion() { return region; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(UpdateRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final UpdateRegionAutoscalerHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new UpdateRegionAutoscalerHttpRequest(); } @@ -226,6 +242,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String region; + private String requestId; private String userIp; Builder() {} @@ -259,6 +276,9 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { if (other.getRegion() != null) { this.region = other.region; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -275,6 +295,7 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.region = source.region; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -359,6 +380,15 @@ public Builder setRegion(String region) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -368,27 +398,38 @@ public Builder setUserIp(String userIp) { return this; } + public UpdateRegionAutoscalerHttpRequest build() { String missing = ""; + + + + + + + if (region == null) { missing += " region"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRegionAutoscalerHttpRequest( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); } public Builder clone() { @@ -402,6 +443,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -410,35 +452,17 @@ public Builder clone() { @Override public String toString() { return "UpdateRegionAutoscalerHttpRequest{" - + "access_token=" - + access_token - + ", " - + "autoscaler=" - + autoscaler - + ", " - + "autoscalerResource=" - + autoscalerResource - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "key=" - + key - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "region=" - + region - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "autoscaler=" + autoscaler + ", " + + "autoscalerResource=" + autoscalerResource + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "region=" + region + ", " + + "requestId=" + requestId + ", " + + "userIp=" + userIp + "}"; } @@ -449,16 +473,19 @@ public boolean equals(Object o) { } if (o instanceof UpdateRegionAutoscalerHttpRequest) { UpdateRegionAutoscalerHttpRequest that = (UpdateRegionAutoscalerHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.autoscaler, that.getAutoscaler()) - && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.region, that.getRegion()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.autoscaler, that.getAutoscaler()) && + Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.region, that.getRegion()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -466,15 +493,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index 2ce0678a5c59..821bffbdb0a2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -40,6 +40,7 @@ public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; private UpdateRegionBackendServiceHttpRequest() { @@ -51,6 +52,7 @@ private UpdateRegionBackendServiceHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } @@ -64,6 +66,7 @@ private UpdateRegionBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String userIp ) { this.access_token = access_token; @@ -74,6 +77,7 @@ private UpdateRegionBackendServiceHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -104,6 +108,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -136,6 +143,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -180,6 +190,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } @@ -213,6 +227,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} @@ -243,6 +258,9 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -258,6 +276,7 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -333,6 +352,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -356,6 +384,7 @@ public UpdateRegionBackendServiceHttpRequest build() { + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } @@ -368,6 +397,7 @@ public UpdateRegionBackendServiceHttpRequest build() { key, prettyPrint, quotaUser, + requestId, userIp ); } @@ -382,6 +412,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -398,6 +429,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "userIp=" + userIp + "}"; } @@ -418,6 +450,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.userIp, that.getUserIp()) ; } @@ -435,6 +468,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, userIp ); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index 94f5cdffeaef..0d7fc9b87893 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -17,6 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -35,6 +38,7 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String router; private final Router routerResource; private final String userIp; @@ -46,11 +50,13 @@ private UpdateRouterHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.router = null; this.routerResource = null; this.userIp = null; } + private UpdateRouterHttpRequest( String access_token, String callback, @@ -58,15 +64,18 @@ private UpdateRouterHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String router, Router routerResource, - String userIp) { + String userIp + ) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.router = router; this.routerResource = routerResource; this.userIp = userIp; @@ -93,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("router") && router != null) { fieldMap.put("router", Collections.singletonList(String.valueOf(router))); } @@ -125,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("router")) { return String.valueOf(router); } @@ -167,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getRouter() { return router; } @@ -179,24 +198,22 @@ public String getUserIp() { return userIp; } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(UpdateRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final UpdateRouterHttpRequest DEFAULT_INSTANCE; - static { DEFAULT_INSTANCE = new UpdateRouterHttpRequest(); } @@ -208,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String router; private Router routerResource; private String userIp; @@ -234,6 +252,9 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getRouter() != null) { this.router = other.router; } @@ -253,6 +274,7 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.router = source.router; this.routerResource = source.routerResource; this.userIp = source.userIp; @@ -312,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getRouter() { return router; } @@ -339,26 +370,36 @@ public Builder setUserIp(String userIp) { return this; } + public UpdateRouterHttpRequest build() { String missing = ""; + + + + + + if (router == null) { missing += " router"; } + if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - routerResource, - userIp); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + router, + routerResource, + userIp + ); } public Builder clone() { @@ -369,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setRouter(this.router); newBuilder.setRouterResource(this.routerResource); newBuilder.setUserIp(this.userIp); @@ -379,32 +421,16 @@ public Builder clone() { @Override public String toString() { return "UpdateRouterHttpRequest{" - + "access_token=" - + access_token - + ", " - + "callback=" - + callback - + ", " - + "fields=" - + fields - + ", " - + "key=" - + key - + ", " - + "prettyPrint=" - + prettyPrint - + ", " - + "quotaUser=" - + quotaUser - + ", " - + "router=" - + router - + ", " - + "routerResource=" - + routerResource - + ", " - + "userIp=" - + userIp + + "access_token=" + access_token + ", " + + "callback=" + callback + ", " + + "fields=" + fields + ", " + + "key=" + key + ", " + + "prettyPrint=" + prettyPrint + ", " + + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + + "router=" + router + ", " + + "routerResource=" + routerResource + ", " + + "userIp=" + userIp + "}"; } @@ -415,15 +441,18 @@ public boolean equals(Object o) { } if (o instanceof UpdateRouterHttpRequest) { UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o; - return Objects.equals(this.access_token, that.getAccessToken()) - && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fields, that.getFields()) - && Objects.equals(this.key, that.getKey()) - && Objects.equals(this.prettyPrint, that.getPrettyPrint()) - && Objects.equals(this.quotaUser, that.getQuotaUser()) - && Objects.equals(this.router, that.getRouter()) - && Objects.equals(this.routerResource, that.getRouterResource()) - && Objects.equals(this.userIp, that.getUserIp()); + return + Objects.equals(this.access_token, that.getAccessToken()) && + Objects.equals(this.callback, that.getCallback()) && + Objects.equals(this.fields, that.getFields()) && + Objects.equals(this.key, that.getKey()) && + Objects.equals(this.prettyPrint, that.getPrettyPrint()) && + Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && + Objects.equals(this.router, that.getRouter()) && + Objects.equals(this.routerResource, that.getRouterResource()) && + Objects.equals(this.userIp, that.getUserIp()) + ; } return false; } @@ -431,14 +460,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - routerResource, - userIp); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + router, + routerResource, + userIp + ); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index 873e3c3a264a..52fae79df46c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -38,6 +38,7 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private final String key; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String urlMap; private final UrlMap urlMapResource; private final String userIp; @@ -49,6 +50,7 @@ private UpdateUrlMapHttpRequest() { this.key = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.urlMap = null; this.urlMapResource = null; this.userIp = null; @@ -62,6 +64,7 @@ private UpdateUrlMapHttpRequest( String key, String prettyPrint, String quotaUser, + String requestId, String urlMap, UrlMap urlMapResource, String userIp @@ -72,6 +75,7 @@ private UpdateUrlMapHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.urlMap = urlMap; this.urlMapResource = urlMapResource; this.userIp = userIp; @@ -98,6 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("urlMap") && urlMap != null) { fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); } @@ -130,6 +137,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("urlMap")) { return String.valueOf(urlMap); } @@ -172,6 +182,10 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUrlMap() { return urlMap; } @@ -211,6 +225,7 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; + private String requestId; private String urlMap; private UrlMap urlMapResource; private String userIp; @@ -237,6 +252,9 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUrlMap() != null) { this.urlMap = other.urlMap; } @@ -256,6 +274,7 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.urlMap = source.urlMap; this.urlMapResource = source.urlMapResource; this.userIp = source.userIp; @@ -315,6 +334,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUrlMap() { return urlMap; } @@ -351,6 +379,7 @@ public UpdateUrlMapHttpRequest build() { + if (urlMap == null) { missing += " urlMap"; } @@ -366,6 +395,7 @@ public UpdateUrlMapHttpRequest build() { key, prettyPrint, quotaUser, + requestId, urlMap, urlMapResource, userIp @@ -380,6 +410,7 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUrlMap(this.urlMap); newBuilder.setUrlMapResource(this.urlMapResource); newBuilder.setUserIp(this.userIp); @@ -396,6 +427,7 @@ public String toString() { + "key=" + key + ", " + "prettyPrint=" + prettyPrint + ", " + "quotaUser=" + quotaUser + ", " + + "requestId=" + requestId + ", " + "urlMap=" + urlMap + ", " + "urlMapResource=" + urlMapResource + ", " + "userIp=" + userIp @@ -416,6 +448,7 @@ public boolean equals(Object o) { Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) && Objects.equals(this.quotaUser, that.getQuotaUser()) && + Objects.equals(this.requestId, that.getRequestId()) && Objects.equals(this.urlMap, that.getUrlMap()) && Objects.equals(this.urlMapResource, that.getUrlMapResource()) && Objects.equals(this.userIp, that.getUserIp()) @@ -433,6 +466,7 @@ public int hashCode() { key, prettyPrint, quotaUser, + requestId, urlMap, urlMapResource, userIp diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java index 2d6f3374c132..9d8b4f25e489 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java @@ -53,7 +53,8 @@ * * try (UrlMapClient urlMapClient = UrlMapClient.create()) { * UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); - * Operation response = urlMapClient.deleteUrlMap(urlMap); + * String requestId = ""; + * Operation response = urlMapClient.deleteUrlMap(urlMap, requestId); * } * *
@@ -176,19 +177,26 @@ public UrlMapStub getStub() { *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   Operation response = urlMapClient.deleteUrlMap(urlMap);
+   *   String requestId = "";
+   *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteUrlMap(UrlMapName urlMap) { + public final Operation deleteUrlMap(UrlMapName urlMap, String requestId) { DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) .build(); return deleteUrlMap(request); } @@ -201,19 +209,26 @@ public final Operation deleteUrlMap(UrlMapName urlMap) { *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString());
+   *   String requestId = "";
+   *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString(), requestId);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteUrlMap(String urlMap) { + public final Operation deleteUrlMap(String urlMap, String requestId) { DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) + .setRequestId(requestId) .build(); return deleteUrlMap(request); } @@ -226,8 +241,10 @@ public final Operation deleteUrlMap(String urlMap) { *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = urlMapClient.deleteUrlMap(request);
    * }
@@ -249,8 +266,10 @@ public final Operation deleteUrlMap(DeleteUrlMapHttpRequest request) {
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.deleteUrlMapCallable().futureCall(request);
    *   // Do something
@@ -365,21 +384,28 @@ public final UnaryCallable getUrlMapCallable() {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.insertUrlMap(project, urlMapResource);
+   *   Operation response = urlMapClient.insertUrlMap(requestId, project, urlMapResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertUrlMap(ProjectName project, UrlMap urlMapResource) { + public final Operation insertUrlMap(String requestId, ProjectName project, UrlMap urlMapResource) { InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setUrlMapResource(urlMapResource) .build(); @@ -393,21 +419,28 @@ public final Operation insertUrlMap(ProjectName project, UrlMap urlMapResource) * Sample code: *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.insertUrlMap(project.toString(), urlMapResource);
+   *   Operation response = urlMapClient.insertUrlMap(requestId, project.toString(), urlMapResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertUrlMap(String project, UrlMap urlMapResource) { + public final Operation insertUrlMap(String requestId, String project, UrlMap urlMapResource) { InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder() + .setRequestId(requestId) .setProject(project) .setUrlMapResource(urlMapResource) .build(); @@ -421,9 +454,11 @@ public final Operation insertUrlMap(String project, UrlMap urlMapResource) { * Sample code: *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUrlMapResource(urlMapResource)
    *     .build();
@@ -446,9 +481,11 @@ public final Operation insertUrlMap(InsertUrlMapHttpRequest request) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
+   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUrlMapResource(urlMapResource)
    *     .build();
@@ -471,21 +508,28 @@ public final UnaryCallable insertUrlMapCalla
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
-   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource);
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource);
    * }
    * 
* * @param urlMap Name of the UrlMap scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param cacheInvalidationRuleResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation invalidateCacheUrlMap(UrlMapName urlMap, CacheInvalidationRule cacheInvalidationRuleResource) { + public final Operation invalidateCacheUrlMap(UrlMapName urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) { InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) .build(); return invalidateCacheUrlMap(request); @@ -499,21 +543,28 @@ public final Operation invalidateCacheUrlMap(UrlMapName urlMap, CacheInvalidatio *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
-   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), cacheInvalidationRuleResource);
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), requestId, cacheInvalidationRuleResource);
    * }
    * 
* * @param urlMap Name of the UrlMap scoping this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param cacheInvalidationRuleResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation invalidateCacheUrlMap(String urlMap, CacheInvalidationRule cacheInvalidationRuleResource) { + public final Operation invalidateCacheUrlMap(String urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) { InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) + .setRequestId(requestId) .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) .build(); return invalidateCacheUrlMap(request); @@ -527,9 +578,11 @@ public final Operation invalidateCacheUrlMap(String urlMap, CacheInvalidationRul *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .setCacheInvalidationRuleResource(cacheInvalidationRuleResource)
    *     .build();
    *   Operation response = urlMapClient.invalidateCacheUrlMap(request);
@@ -552,9 +605,11 @@ public final Operation invalidateCacheUrlMap(InvalidateCacheUrlMapHttpRequest re
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .setCacheInvalidationRuleResource(cacheInvalidationRuleResource)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.invalidateCacheUrlMapCallable().futureCall(request);
@@ -703,27 +758,34 @@ public final UnaryCallable listUrlMapsCallab
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.patchUrlMap(urlMap, urlMapResource);
+   *   Operation response = urlMapClient.patchUrlMap(urlMap, requestId, urlMapResource);
    * }
    * 
* - * @param urlMap Name of the UrlMap resource to update. + * @param urlMap Name of the UrlMap resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchUrlMap(UrlMapName urlMap, UrlMap urlMapResource) { + public final Operation patchUrlMap(UrlMapName urlMap, String requestId, UrlMap urlMapResource) { PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return patchUrlMap(request); @@ -731,27 +793,34 @@ public final Operation patchUrlMap(UrlMapName urlMap, UrlMap urlMapResource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics. + * 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: *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), urlMapResource);
+   *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), requestId, urlMapResource);
    * }
    * 
* - * @param urlMap Name of the UrlMap resource to update. + * @param urlMap Name of the UrlMap resource to patch. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchUrlMap(String urlMap, UrlMap urlMapResource) { + public final Operation patchUrlMap(String urlMap, String requestId, UrlMap urlMapResource) { PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) + .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return patchUrlMap(request); @@ -759,15 +828,17 @@ public final Operation patchUrlMap(String urlMap, UrlMap urlMapResource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics. + * 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: *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   Operation response = urlMapClient.patchUrlMap(request);
@@ -784,15 +855,17 @@ public final Operation patchUrlMap(PatchUrlMapHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified UrlMap resource with the data included in the request. This method supports patch semantics.
+   * 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:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.patchUrlMapCallable().futureCall(request);
@@ -814,21 +887,28 @@ public final UnaryCallable patchUrlMapCallabl
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.updateUrlMap(urlMap, urlMapResource);
+   *   Operation response = urlMapClient.updateUrlMap(urlMap, requestId, urlMapResource);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateUrlMap(UrlMapName urlMap, UrlMap urlMapResource) { + public final Operation updateUrlMap(UrlMapName urlMap, String requestId, UrlMap urlMapResource) { UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return updateUrlMap(request); @@ -842,21 +922,28 @@ public final Operation updateUrlMap(UrlMapName urlMap, UrlMap urlMapResource) { *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), urlMapResource);
+   *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), requestId, urlMapResource);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to update. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateUrlMap(String urlMap, UrlMap urlMapResource) { + public final Operation updateUrlMap(String urlMap, String requestId, UrlMap urlMapResource) { UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) + .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return updateUrlMap(request); @@ -870,9 +957,11 @@ public final Operation updateUrlMap(String urlMap, UrlMap urlMapResource) { *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   Operation response = urlMapClient.updateUrlMap(request);
@@ -895,9 +984,11 @@ public final Operation updateUrlMap(UpdateUrlMapHttpRequest request) {
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
+   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.updateUrlMapCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java
index dacd44f351a6..004d963c3369 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java
@@ -37,6 +37,7 @@ public final class UrlMapList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private UrlMapList() {
     this.id = null;
@@ -44,6 +45,7 @@ private UrlMapList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private UrlMapList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(UrlMapList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(UrlMapList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public UrlMapList build() {
 
 
 
 
+
       return new UrlMapList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java
index ecf765d37354..b862f97272b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java
@@ -17,21 +17,25 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import javax.annotation.Generated;
 
 @Generated("by GAPIC")
 @BetaApi
-public final class UrlMapName implements ResourceName {
+public final class UrlMapName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String urlMap;
   private static final PathTemplate PATH_TEMPLATE =
-      PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}");
 
   private volatile Map fieldValuesMap;
 
@@ -48,12 +52,25 @@ private UrlMapName(Builder builder) {
     urlMap = Preconditions.checkNotNull(builder.getUrlMap());
   }
 
-  public static UrlMapName of(String project, String urlMap) {
-    return newBuilder().setProject(project).setUrlMap(urlMap).build();
+  public static UrlMapName of(
+      String project,
+      String urlMap
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setUrlMap(urlMap)
+      .build();
   }
 
-  public static String format(String project, String urlMap) {
-    return of(project, urlMap).toString();
+  public static String format(
+      String project,
+      String urlMap
+      ) {
+    return of(
+        project,
+        urlMap
+        )
+        .toString();
   }
 
   public String getProject() {
@@ -64,6 +81,7 @@ public String getUrlMap() {
     return urlMap;
   }
 
+
   @Override
   public Map getFieldValuesMap() {
     if (fieldValuesMap == null) {
@@ -83,19 +101,20 @@ public String getFieldValue(String fieldName) {
     return getFieldValuesMap().get(fieldName);
   }
 
+
   public static ResourceNameFactory newFactory() {
     return new ResourceNameFactory() {
-      public UrlMapName parse(String formattedString) {
-        return UrlMapName.parse(formattedString);
-      }
+      public UrlMapName parse(String formattedString) {return UrlMapName.parse(formattedString);}
     };
   }
 
   public static UrlMapName parse(String formattedString) {
     Map matchMap =
-        PATH_TEMPLATE.validatedMatch(
-            formattedString, "UrlMapName.parse: formattedString not in valid format");
-    return of(matchMap.get("project"), matchMap.get("urlMap"));
+        PATH_TEMPLATE.validatedMatch(formattedString, "UrlMapName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("urlMap")
+    );
   }
 
   public static boolean isParsableFrom(String formattedString) {
@@ -109,7 +128,6 @@ public static class Builder {
     public String getProject() {
       return project;
     }
-
     public String getUrlMap() {
       return urlMap;
     }
@@ -118,7 +136,6 @@ public Builder setProject(String project) {
       this.project = project;
       return this;
     }
-
     public Builder setUrlMap(String urlMap) {
       this.urlMap = urlMap;
       return this;
@@ -126,7 +143,7 @@ public Builder setUrlMap(String urlMap) {
 
     private Builder() {}
 
-    public Builder(UrlMapName urlMapName) {
+    public Builder (UrlMapName urlMapName) {
       project = urlMapName.project;
       urlMap = urlMapName.urlMap;
     }
@@ -140,7 +157,8 @@ public UrlMapName build() {
   public String toString() {
     return PATH_TEMPLATE.instantiate(
         "project", project,
-        "urlMap", urlMap);
+        "urlMap", urlMap
+        );
   }
 
   @Override
@@ -150,14 +168,19 @@ public boolean equals(Object o) {
     }
     if (o instanceof UrlMapName) {
       UrlMapName that = (UrlMapName) o;
-      return Objects.equals(this.project, that.getProject())
-          && Objects.equals(this.urlMap, that.getUrlMap());
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.urlMap, that.getUrlMap())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(project, urlMap);
+    return Objects.hash(
+      project,
+      urlMap
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java
index 54eac934b2bb..2af65b332d4f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -35,7 +38,10 @@ private UrlMapReference() {
     this.urlMap = null;
   }
 
-  private UrlMapReference(String urlMap) {
+
+  private UrlMapReference(
+      String urlMap
+      ) {
     this.urlMap = urlMap;
   }
 
@@ -66,24 +72,22 @@ public String getUrlMap() {
     return urlMap;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(UrlMapReference prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static UrlMapReference getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final UrlMapReference DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new UrlMapReference();
   }
@@ -114,8 +118,11 @@ public Builder setUrlMap(String urlMap) {
       return this;
     }
 
+
     public UrlMapReference build() {
-      return new UrlMapReference(urlMap);
+      return new UrlMapReference(
+        urlMap
+      );
     }
 
     public Builder clone() {
@@ -127,7 +134,9 @@ public Builder clone() {
 
   @Override
   public String toString() {
-    return "UrlMapReference{" + "urlMap=" + urlMap + "}";
+    return "UrlMapReference{"
+        + "urlMap=" + urlMap
+        + "}";
   }
 
   @Override
@@ -137,13 +146,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof UrlMapReference) {
       UrlMapReference that = (UrlMapReference) o;
-      return Objects.equals(this.urlMap, that.getUrlMap());
+      return
+          Objects.equals(this.urlMap, that.getUrlMap())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(urlMap);
+    return Objects.hash(
+      urlMap
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java
index 6c9cee06b282..e434b2bf9a68 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java
@@ -17,6 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -41,7 +44,13 @@ private UrlMapTest() {
     this.service = null;
   }
 
-  private UrlMapTest(String description, String host, String path, String service) {
+
+  private UrlMapTest(
+      String description,
+      String host,
+      String path,
+      String service
+      ) {
     this.description = description;
     this.host = host;
     this.path = path;
@@ -105,24 +114,22 @@ public String getService() {
     return service;
   }
 
+
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-
   public static Builder newBuilder(UrlMapTest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
-
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static UrlMapTest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
-
   private static final UrlMapTest DEFAULT_INSTANCE;
-
   static {
     DEFAULT_INSTANCE = new UrlMapTest();
   }
@@ -195,9 +202,17 @@ public Builder setService(String service) {
       return this;
     }
 
+
     public UrlMapTest build() {
 
-      return new UrlMapTest(description, host, path, service);
+
+
+      return new UrlMapTest(
+        description,
+        host,
+        path,
+        service
+      );
     }
 
     public Builder clone() {
@@ -213,17 +228,10 @@ public Builder clone() {
   @Override
   public String toString() {
     return "UrlMapTest{"
-        + "description="
-        + description
-        + ", "
-        + "host="
-        + host
-        + ", "
-        + "path="
-        + path
-        + ", "
-        + "service="
-        + service
+        + "description=" + description + ", "
+        + "host=" + host + ", "
+        + "path=" + path + ", "
+        + "service=" + service
         + "}";
   }
 
@@ -234,16 +242,23 @@ public boolean equals(Object o) {
     }
     if (o instanceof UrlMapTest) {
       UrlMapTest that = (UrlMapTest) o;
-      return Objects.equals(this.description, that.getDescription())
-          && Objects.equals(this.host, that.getHost())
-          && Objects.equals(this.path, that.getPath())
-          && Objects.equals(this.service, that.getService());
+      return
+          Objects.equals(this.description, that.getDescription()) &&
+          Objects.equals(this.host, that.getHost()) &&
+          Objects.equals(this.path, that.getPath()) &&
+          Objects.equals(this.service, that.getService())
+          ;
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(description, host, path, service);
+    return Objects.hash(
+      description,
+      host,
+      path,
+      service
+    );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java
index e90faa666fa0..688d7773fda0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java
@@ -37,6 +37,7 @@ public final class VpnTunnelAggregatedList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private VpnTunnelAggregatedList() {
     this.id = null;
@@ -44,6 +45,7 @@ private VpnTunnelAggregatedList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private VpnTunnelAggregatedList(
       Map items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -79,6 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -99,6 +106,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -128,6 +138,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -154,6 +168,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -174,6 +189,9 @@ public Builder mergeFrom(VpnTunnelAggregatedList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -183,6 +201,7 @@ public Builder mergeFrom(VpnTunnelAggregatedList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -230,18 +249,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public VpnTunnelAggregatedList build() {
 
 
 
 
+
       return new VpnTunnelAggregatedList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -252,6 +282,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -263,7 +294,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -279,7 +311,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsMap()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -292,7 +325,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
index fed7bb72aaa0..a8e7379ac76c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
@@ -52,8 +52,9 @@
  * 
  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+ *   String requestId = "";
  *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
- *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
+ *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
  * }
  * 
  * 
@@ -308,19 +309,26 @@ public final UnaryCallable * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) { + * String requestId = ""; * VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); - * Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel); + * Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel); * } *
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param vpnTunnel Name of the VpnTunnel resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteVpnTunnel(VpnTunnelName vpnTunnel) { + public final Operation deleteVpnTunnel(String requestId, VpnTunnelName vpnTunnel) { DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder() + .setRequestId(requestId) .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString()) .build(); return deleteVpnTunnel(request); @@ -333,19 +341,26 @@ public final Operation deleteVpnTunnel(VpnTunnelName vpnTunnel) { * Sample code: *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
-   *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel.toString());
+   *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel.toString());
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param vpnTunnel Name of the VpnTunnel resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteVpnTunnel(String vpnTunnel) { + public final Operation deleteVpnTunnel(String requestId, String vpnTunnel) { DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder() + .setRequestId(requestId) .setVpnTunnel(vpnTunnel) .build(); return deleteVpnTunnel(request); @@ -358,8 +373,10 @@ public final Operation deleteVpnTunnel(String vpnTunnel) { * Sample code: *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setVpnTunnel(vpnTunnel.toString())
    *     .build();
    *   Operation response = vpnTunnelClient.deleteVpnTunnel(request);
@@ -381,8 +398,10 @@ public final Operation deleteVpnTunnel(DeleteVpnTunnelHttpRequest request) {
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setVpnTunnel(vpnTunnel.toString())
    *     .build();
    *   ApiFuture<Operation> future = vpnTunnelClient.deleteVpnTunnelCallable().futureCall(request);
@@ -498,21 +517,28 @@ public final UnaryCallable getVpnTunnelCalla
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
-   *   Operation response = vpnTunnelClient.insertVpnTunnel(region, vpnTunnelResource);
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(requestId, region, vpnTunnelResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param vpnTunnelResource + * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertVpnTunnel(RegionName region, VpnTunnel vpnTunnelResource) { + public final Operation insertVpnTunnel(String requestId, RegionName region, VpnTunnel vpnTunnelResource) { InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setVpnTunnelResource(vpnTunnelResource) .build(); @@ -526,21 +552,28 @@ public final Operation insertVpnTunnel(RegionName region, VpnTunnel vpnTunnelRes * Sample code: *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
-   *   Operation response = vpnTunnelClient.insertVpnTunnel(region.toString(), vpnTunnelResource);
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(requestId, region.toString(), vpnTunnelResource);
    * }
    * 
* + * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param vpnTunnelResource + * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertVpnTunnel(String region, VpnTunnel vpnTunnelResource) { + public final Operation insertVpnTunnel(String requestId, String region, VpnTunnel vpnTunnelResource) { InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder() + .setRequestId(requestId) .setRegion(region) .setVpnTunnelResource(vpnTunnelResource) .build(); @@ -554,9 +587,11 @@ public final Operation insertVpnTunnel(String region, VpnTunnel vpnTunnelResourc * Sample code: *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setVpnTunnelResource(vpnTunnelResource)
    *     .build();
@@ -579,9 +614,11 @@ public final Operation insertVpnTunnel(InsertVpnTunnelHttpRequest request) {
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+   *   String requestId = "";
    *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setVpnTunnelResource(vpnTunnelResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
index 752c4474b1a6..b3192f22bee3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
@@ -37,6 +37,7 @@ public final class VpnTunnelList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private VpnTunnelList() {
     this.id = null;
@@ -44,6 +45,7 @@ private VpnTunnelList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private VpnTunnelList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(VpnTunnelList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(VpnTunnelList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public VpnTunnelList build() {
 
 
 
 
+
       return new VpnTunnelList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java
index 113cec4c852c..391ce9fef848 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class VpnTunnelName implements ResourceName {
+public final class VpnTunnelName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String region;
   private final String vpnTunnel;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java
new file mode 100644
index 000000000000..44f3ea53d736
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java
@@ -0,0 +1,344 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class XpnHostList implements ApiMessage {
+  private final String id;
+  private final List items;
+  private final String kind;
+  private final String nextPageToken;
+  private final String selfLink;
+  private final Warning warning;
+
+  private XpnHostList() {
+    this.id = null;
+    this.items = null;
+    this.kind = null;
+    this.nextPageToken = null;
+    this.selfLink = null;
+    this.warning = null;
+  }
+
+
+  private XpnHostList(
+      String id,
+      List items,
+      String kind,
+      String nextPageToken,
+      String selfLink,
+      Warning warning
+      ) {
+    this.id = id;
+    this.items = items;
+    this.kind = kind;
+    this.nextPageToken = nextPageToken;
+    this.selfLink = selfLink;
+    this.warning = warning;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("id") && id != null) {
+      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
+    }
+    if (fieldNames.contains("items") && items != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (Project item : items) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("items", stringList.build());
+    }
+    if (fieldNames.contains("kind") && kind != null) {
+      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
+    }
+    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
+      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
+    }
+    if (fieldNames.contains("selfLink") && selfLink != null) {
+      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
+    }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("id")) {
+      return String.valueOf(id);
+    }
+    if (fieldName.equals("items")) {
+      return String.valueOf(items);
+    }
+    if (fieldName.equals("kind")) {
+      return String.valueOf(kind);
+    }
+    if (fieldName.equals("nextPageToken")) {
+      return String.valueOf(nextPageToken);
+    }
+    if (fieldName.equals("selfLink")) {
+      return String.valueOf(selfLink);
+    }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public List getItemsList() {
+    return items;
+  }
+
+  public String getKind() {
+    return kind;
+  }
+
+  public String getNextPageToken() {
+    return nextPageToken;
+  }
+
+  public String getSelfLink() {
+    return selfLink;
+  }
+
+  public Warning getWarning() {
+    return warning;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(XpnHostList prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static XpnHostList getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final XpnHostList DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new XpnHostList();
+  }
+
+  public static class Builder {
+    private String id;
+    private List items;
+    private String kind;
+    private String nextPageToken;
+    private String selfLink;
+    private Warning warning;
+
+    Builder() {}
+
+    public Builder mergeFrom(XpnHostList other) {
+      if (other == XpnHostList.getDefaultInstance()) return this;
+      if (other.getId() != null) {
+        this.id = other.id;
+      }
+      if (other.getItemsList() != null) {
+        this.items = other.items;
+      }
+      if (other.getKind() != null) {
+        this.kind = other.kind;
+      }
+      if (other.getNextPageToken() != null) {
+        this.nextPageToken = other.nextPageToken;
+      }
+      if (other.getSelfLink() != null) {
+        this.selfLink = other.selfLink;
+      }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
+      return this;
+    }
+
+    Builder(XpnHostList source) {
+      this.id = source.id;
+      this.items = source.items;
+      this.kind = source.kind;
+      this.nextPageToken = source.nextPageToken;
+      this.selfLink = source.selfLink;
+      this.warning = source.warning;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public Builder setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public List getItemsList() {
+      return items;
+    }
+
+    public Builder addAllItems(List items) {
+      if (this.items == null) {
+        this.items = new ArrayList<>(items.size());
+      }
+      this.items.addAll(items);
+      return this;
+    }
+
+    public Builder addItems(Project items) {
+      this.items.add(items);
+      return this;
+    }
+
+    public String getKind() {
+      return kind;
+    }
+
+    public Builder setKind(String kind) {
+      this.kind = kind;
+      return this;
+    }
+
+    public String getNextPageToken() {
+      return nextPageToken;
+    }
+
+    public Builder setNextPageToken(String nextPageToken) {
+      this.nextPageToken = nextPageToken;
+      return this;
+    }
+
+    public String getSelfLink() {
+      return selfLink;
+    }
+
+    public Builder setSelfLink(String selfLink) {
+      this.selfLink = selfLink;
+      return this;
+    }
+
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
+
+    public XpnHostList build() {
+
+
+
+
+
+      return new XpnHostList(
+        id,
+        items,
+        kind,
+        nextPageToken,
+        selfLink,
+        warning
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setId(this.id);
+      newBuilder.addAllItems(this.items);
+      newBuilder.setKind(this.kind);
+      newBuilder.setNextPageToken(this.nextPageToken);
+      newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "XpnHostList{"
+        + "id=" + id + ", "
+        + "items=" + items + ", "
+        + "kind=" + kind + ", "
+        + "nextPageToken=" + nextPageToken + ", "
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof XpnHostList) {
+      XpnHostList that = (XpnHostList) o;
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.items, that.getItemsList()) &&
+          Objects.equals(this.kind, that.getKind()) &&
+          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      id,
+      items,
+      kind,
+      nextPageToken,
+      selfLink,
+      warning
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java
new file mode 100644
index 000000000000..a13f729fc341
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.ApiMessage;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+import javax.annotation.Nullable;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class XpnResourceId implements ApiMessage {
+  private final String id;
+  private final String type;
+
+  private XpnResourceId() {
+    this.id = null;
+    this.type = null;
+  }
+
+
+  private XpnResourceId(
+      String id,
+      String type
+      ) {
+    this.id = id;
+    this.type = type;
+  }
+
+  @Override
+  public Map> populateFieldsInMap(Set fieldNames) {
+    Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("id") && id != null) {
+      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
+    }
+    if (fieldNames.contains("type") && type != null) {
+      fieldMap.put("type", Collections.singletonList(String.valueOf(type)));
+    }
+    return fieldMap;
+  }
+
+  @Override
+  public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("id")) {
+      return String.valueOf(id);
+    }
+    if (fieldName.equals("type")) {
+      return String.valueOf(type);
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(XpnResourceId prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static XpnResourceId getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+  private static final XpnResourceId DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new XpnResourceId();
+  }
+
+  public static class Builder {
+    private String id;
+    private String type;
+
+    Builder() {}
+
+    public Builder mergeFrom(XpnResourceId other) {
+      if (other == XpnResourceId.getDefaultInstance()) return this;
+      if (other.getId() != null) {
+        this.id = other.id;
+      }
+      if (other.getType() != null) {
+        this.type = other.type;
+      }
+      return this;
+    }
+
+    Builder(XpnResourceId source) {
+      this.id = source.id;
+      this.type = source.type;
+    }
+
+    public String getId() {
+      return id;
+    }
+
+    public Builder setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public String getType() {
+      return type;
+    }
+
+    public Builder setType(String type) {
+      this.type = type;
+      return this;
+    }
+
+
+    public XpnResourceId build() {
+
+      return new XpnResourceId(
+        id,
+        type
+      );
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setId(this.id);
+      newBuilder.setType(this.type);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "XpnResourceId{"
+        + "id=" + id + ", "
+        + "type=" + type
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof XpnResourceId) {
+      XpnResourceId that = (XpnResourceId) o;
+      return
+          Objects.equals(this.id, that.getId()) &&
+          Objects.equals(this.type, that.getType())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      id,
+      type
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java
index d7347cfa5999..d81eb6ae32b1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java
@@ -32,6 +32,7 @@
 @Generated("by GAPIC")
 @BetaApi
 public final class Zone implements ApiMessage {
+  private final List availableCpuPlatforms;
   private final String creationTimestamp;
   private final DeprecationStatus deprecated;
   private final String description;
@@ -43,6 +44,7 @@ public final class Zone implements ApiMessage {
   private final String status;
 
   private Zone() {
+    this.availableCpuPlatforms = null;
     this.creationTimestamp = null;
     this.deprecated = null;
     this.description = null;
@@ -56,6 +58,7 @@ private Zone() {
 
 
   private Zone(
+      List availableCpuPlatforms,
       String creationTimestamp,
       DeprecationStatus deprecated,
       String description,
@@ -66,6 +69,7 @@ private Zone(
       String selfLink,
       String status
       ) {
+    this.availableCpuPlatforms = availableCpuPlatforms;
     this.creationTimestamp = creationTimestamp;
     this.deprecated = deprecated;
     this.description = description;
@@ -80,6 +84,13 @@ private Zone(
   @Override
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
+    if (fieldNames.contains("availableCpuPlatforms") && availableCpuPlatforms != null) {
+      ImmutableList.Builder stringList = ImmutableList.builder();
+      for (String item : availableCpuPlatforms) {
+        stringList.add(item.toString());
+      }
+      fieldMap.put("availableCpuPlatforms", stringList.build());
+    }
     if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
       fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
     }
@@ -112,6 +123,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
 
   @Override
   public String getFieldStringValue(String fieldName) {
+    if (fieldName.equals("availableCpuPlatforms")) {
+      return String.valueOf(availableCpuPlatforms);
+    }
     if (fieldName.equals("creationTimestamp")) {
       return String.valueOf(creationTimestamp);
     }
@@ -148,6 +162,10 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  public List getAvailableCpuPlatformsList() {
+    return availableCpuPlatforms;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
@@ -205,6 +223,7 @@ public static Zone getDefaultInstance() {
   }
 
   public static class Builder {
+    private List availableCpuPlatforms;
     private String creationTimestamp;
     private DeprecationStatus deprecated;
     private String description;
@@ -219,6 +238,9 @@ public static class Builder {
 
     public Builder mergeFrom(Zone other) {
       if (other == Zone.getDefaultInstance()) return this;
+      if (other.getAvailableCpuPlatformsList() != null) {
+        this.availableCpuPlatforms = other.availableCpuPlatforms;
+      }
       if (other.getCreationTimestamp() != null) {
         this.creationTimestamp = other.creationTimestamp;
       }
@@ -250,6 +272,7 @@ public Builder mergeFrom(Zone other) {
     }
 
     Builder(Zone source) {
+      this.availableCpuPlatforms = source.availableCpuPlatforms;
       this.creationTimestamp = source.creationTimestamp;
       this.deprecated = source.deprecated;
       this.description = source.description;
@@ -261,6 +284,23 @@ public Builder mergeFrom(Zone other) {
       this.status = source.status;
     }
 
+    public List getAvailableCpuPlatformsList() {
+      return availableCpuPlatforms;
+    }
+
+    public Builder addAllAvailableCpuPlatforms(List availableCpuPlatforms) {
+      if (this.availableCpuPlatforms == null) {
+        this.availableCpuPlatforms = new ArrayList<>(availableCpuPlatforms.size());
+      }
+      this.availableCpuPlatforms.addAll(availableCpuPlatforms);
+      return this;
+    }
+
+    public Builder addAvailableCpuPlatforms(String availableCpuPlatforms) {
+      this.availableCpuPlatforms.add(availableCpuPlatforms);
+      return this;
+    }
+
     public String getCreationTimestamp() {
       return creationTimestamp;
     }
@@ -352,7 +392,9 @@ public Zone build() {
 
 
 
+
       return new Zone(
+        availableCpuPlatforms,
         creationTimestamp,
         deprecated,
         description,
@@ -367,6 +409,7 @@ public Zone build() {
 
     public Builder clone() {
       Builder newBuilder = new Builder();
+      newBuilder.addAllAvailableCpuPlatforms(this.availableCpuPlatforms);
       newBuilder.setCreationTimestamp(this.creationTimestamp);
       newBuilder.setDeprecated(this.deprecated);
       newBuilder.setDescription(this.description);
@@ -383,6 +426,7 @@ public Builder clone() {
   @Override
   public String toString() {
     return "Zone{"
+        + "availableCpuPlatforms=" + availableCpuPlatforms + ", "
         + "creationTimestamp=" + creationTimestamp + ", "
         + "deprecated=" + deprecated + ", "
         + "description=" + description + ", "
@@ -403,6 +447,7 @@ public boolean equals(Object o) {
     if (o instanceof Zone) {
       Zone that = (Zone) o;
       return
+          Objects.equals(this.availableCpuPlatforms, that.getAvailableCpuPlatformsList()) &&
           Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
           Objects.equals(this.deprecated, that.getDeprecated()) &&
           Objects.equals(this.description, that.getDescription()) &&
@@ -420,6 +465,7 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
+      availableCpuPlatforms,
       creationTimestamp,
       deprecated,
       description,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
index efcf91e9dc5f..a2adfe34bdd0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
@@ -37,6 +37,7 @@ public final class ZoneList implements ApiMessage {
   private final String kind;
   private final String nextPageToken;
   private final String selfLink;
+  private final Warning warning;
 
   private ZoneList() {
     this.id = null;
@@ -44,6 +45,7 @@ private ZoneList() {
     this.kind = null;
     this.nextPageToken = null;
     this.selfLink = null;
+    this.warning = null;
   }
 
 
@@ -52,13 +54,15 @@ private ZoneList(
       List items,
       String kind,
       String nextPageToken,
-      String selfLink
+      String selfLink,
+      Warning warning
       ) {
     this.id = id;
     this.items = items;
     this.kind = kind;
     this.nextPageToken = nextPageToken;
     this.selfLink = selfLink;
+    this.warning = warning;
   }
 
   @Override
@@ -83,6 +87,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("selfLink") && selfLink != null) {
       fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
     }
+    if (fieldNames.contains("warning") && warning != null) {
+      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
+    }
     return fieldMap;
   }
 
@@ -103,6 +110,9 @@ public String getFieldStringValue(String fieldName) {
     if (fieldName.equals("selfLink")) {
       return String.valueOf(selfLink);
     }
+    if (fieldName.equals("warning")) {
+      return String.valueOf(warning);
+    }
     return null;
   }
 
@@ -132,6 +142,10 @@ public String getSelfLink() {
     return selfLink;
   }
 
+  public Warning getWarning() {
+    return warning;
+  }
+
 
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
@@ -158,6 +172,7 @@ public static class Builder {
     private String kind;
     private String nextPageToken;
     private String selfLink;
+    private Warning warning;
 
     Builder() {}
 
@@ -178,6 +193,9 @@ public Builder mergeFrom(ZoneList other) {
       if (other.getSelfLink() != null) {
         this.selfLink = other.selfLink;
       }
+      if (other.getWarning() != null) {
+        this.warning = other.warning;
+      }
       return this;
     }
 
@@ -187,6 +205,7 @@ public Builder mergeFrom(ZoneList other) {
       this.kind = source.kind;
       this.nextPageToken = source.nextPageToken;
       this.selfLink = source.selfLink;
+      this.warning = source.warning;
     }
 
     public String getId() {
@@ -242,18 +261,29 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
+    public Warning getWarning() {
+      return warning;
+    }
+
+    public Builder setWarning(Warning warning) {
+      this.warning = warning;
+      return this;
+    }
+
 
     public ZoneList build() {
 
 
 
 
+
       return new ZoneList(
         id,
         items,
         kind,
         nextPageToken,
-        selfLink
+        selfLink,
+        warning
       );
     }
 
@@ -264,6 +294,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setNextPageToken(this.nextPageToken);
       newBuilder.setSelfLink(this.selfLink);
+      newBuilder.setWarning(this.warning);
       return newBuilder;
     }
   }
@@ -275,7 +306,8 @@ public String toString() {
         + "items=" + items + ", "
         + "kind=" + kind + ", "
         + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink
+        + "selfLink=" + selfLink + ", "
+        + "warning=" + warning
         + "}";
   }
 
@@ -291,7 +323,8 @@ public boolean equals(Object o) {
           Objects.equals(this.items, that.getItemsList()) &&
           Objects.equals(this.kind, that.getKind()) &&
           Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
+          Objects.equals(this.selfLink, that.getSelfLink()) &&
+          Objects.equals(this.warning, that.getWarning())
           ;
     }
     return false;
@@ -304,7 +337,8 @@ public int hashCode() {
       items,
       kind,
       nextPageToken,
-      selfLink
+      selfLink,
+      warning
     );
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java
index 67312bdfa023..618e5b90426e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java
@@ -17,7 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceName;
 import com.google.api.resourcenames.ResourceNameFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -32,7 +31,7 @@
 
 @Generated("by GAPIC")
 @BetaApi
-public final class ZoneName implements ResourceName {
+public final class ZoneName implements com.google.api.resourcenames.ResourceName {
   private final String project;
   private final String zone;
   private static final PathTemplate PATH_TEMPLATE =
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java
index be5ae3508d41..3f791014e24d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java
@@ -15,23 +15,45 @@
  */
 package com.google.cloud.compute.v1;
 
-import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
-
 import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
+import com.google.api.gax.core.CredentialsProvider;
+import com.google.api.gax.core.ExecutorProvider;
+import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
+import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.HeaderProvider;
+import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.auth.Credentials;
+import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
 import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
+import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -40,15 +62,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default - * port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteZoneOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteZoneOperation to 30 seconds: * *

  * 
@@ -63,55 +85,70 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ZoneOperationSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to deleteZoneOperation. */
+  /**
+   * Returns the object with the settings used for calls to deleteZoneOperation.
+   */
   public UnaryCallSettings deleteZoneOperationSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).deleteZoneOperationSettings();
   }
 
-  /** Returns the object with the settings used for calls to getZoneOperation. */
+  /**
+   * Returns the object with the settings used for calls to getZoneOperation.
+   */
   public UnaryCallSettings getZoneOperationSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).getZoneOperationSettings();
   }
 
-  /** Returns the object with the settings used for calls to listZoneOperations. */
-  public PagedCallSettings<
-          ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
-      listZoneOperationsSettings() {
+  /**
+   * Returns the object with the settings used for calls to listZoneOperations.
+   */
+  public PagedCallSettings listZoneOperationsSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).listZoneOperationsSettings();
   }
 
-  public static final ZoneOperationSettings create(ZoneOperationStubSettings stub)
-      throws IOException {
+
+  public static final ZoneOperationSettings create(ZoneOperationStubSettings stub) throws IOException {
     return new ZoneOperationSettings.Builder(stub.toBuilder()).build();
   }
 
-  /** Returns a builder for the default ExecutorProvider for this service. */
+  /**
+   * Returns a builder for the default ExecutorProvider for this service.
+   */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ZoneOperationStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /** Returns the default service endpoint. */
-  public static String getDefaultEndpoint() {
-    return ZoneOperationStubSettings.getDefaultEndpoint();
-  }
-  /** Returns the default service port. */
+  /**
+   * Returns the default service endpoint.
+   */
+   public static String getDefaultEndpoint() {
+     return ZoneOperationStubSettings.getDefaultEndpoint();
+   }
+  /**
+   * Returns the default service port.
+   */
   public static int getDefaultServicePort() {
     return ZoneOperationStubSettings.getDefaultServicePort();
   }
 
-  /** Returns the default service scopes. */
+
+  /**
+   * Returns the default service scopes.
+   */
   public static List getDefaultServiceScopes() {
     return ZoneOperationStubSettings.getDefaultServiceScopes();
   }
 
-  /** Returns a builder for the default credentials for this service. */
+
+  /**
+   * Returns a builder for the default credentials for this service.
+   */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ZoneOperationStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder
-      defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
     return ZoneOperationStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -124,17 +161,23 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ZoneOperationStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /** Returns a builder containing all the values of this settings class. */
+  /**
+   * Returns a builder containing all the values of this settings class.
+   */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -143,7 +186,9 @@ protected ZoneOperationSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /** Builder for ZoneOperationSettings. */
+  /**
+   * Builder for ZoneOperationSettings.
+   */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -165,6 +210,7 @@ protected Builder(ZoneOperationStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
+
     public ZoneOperationStubSettings.Builder getStubSettingsBuilder() {
       return ((ZoneOperationStubSettings.Builder) getStubSettings());
     }
@@ -172,31 +218,31 @@ public ZoneOperationStubSettings.Builder getStubSettingsBuilder() {
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * 

Note: This method does not support applying settings to streaming methods. + * Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** Returns the builder for the settings used for calls to deleteZoneOperation. */ - public UnaryCallSettings.Builder - deleteZoneOperationSettings() { + /** + * Returns the builder for the settings used for calls to deleteZoneOperation. + */ + public UnaryCallSettings.Builder deleteZoneOperationSettings() { return getStubSettingsBuilder().deleteZoneOperationSettings(); } - /** Returns the builder for the settings used for calls to getZoneOperation. */ - public UnaryCallSettings.Builder - getZoneOperationSettings() { + /** + * Returns the builder for the settings used for calls to getZoneOperation. + */ + public UnaryCallSettings.Builder getZoneOperationSettings() { return getStubSettingsBuilder().getZoneOperationSettings(); } - /** Returns the builder for the settings used for calls to listZoneOperations. */ - public PagedCallSettings.Builder< - ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse> - listZoneOperationsSettings() { + /** + * Returns the builder for the settings used for calls to listZoneOperations. + */ + public PagedCallSettings.Builder listZoneOperationsSettings() { return getStubSettingsBuilder().listZoneOperationsSettings(); } @@ -205,4 +251,4 @@ public ZoneOperationSettings build() throws IOException { return new ZoneOperationSettings(this); } } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java new file mode 100644 index 000000000000..7844be031583 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ZoneSetLabelsRequest implements ApiMessage { + private final String labelFingerprint; + private final Map labels; + + private ZoneSetLabelsRequest() { + this.labelFingerprint = null; + this.labels = null; + } + + + private ZoneSetLabelsRequest( + String labelFingerprint, + Map labels + ) { + this.labelFingerprint = labelFingerprint; + this.labels = labels; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Map getLabelsMap() { + return labels; + } + + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ZoneSetLabelsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + public static ZoneSetLabelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + private static final ZoneSetLabelsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ZoneSetLabelsRequest(); + } + + public static class Builder { + private String labelFingerprint; + private Map labels; + + Builder() {} + + public Builder mergeFrom(ZoneSetLabelsRequest other) { + if (other == ZoneSetLabelsRequest.getDefaultInstance()) return this; + if (other.getLabelFingerprint() != null) { + this.labelFingerprint = other.labelFingerprint; + } + if (other.getLabelsMap() != null) { + this.labels = other.labels; + } + return this; + } + + Builder(ZoneSetLabelsRequest source) { + this.labelFingerprint = source.labelFingerprint; + this.labels = source.labels; + } + + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Builder setLabelFingerprint(String labelFingerprint) { + this.labelFingerprint = labelFingerprint; + return this; + } + + public Map getLabelsMap() { + return labels; + } + + public Builder putAllLabels(Map labels) { + this.labels = labels; + return this; + } + + + public ZoneSetLabelsRequest build() { + + return new ZoneSetLabelsRequest( + labelFingerprint, + labels + ); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setLabelFingerprint(this.labelFingerprint); + newBuilder.putAllLabels(this.labels); + return newBuilder; + } + } + + @Override + public String toString() { + return "ZoneSetLabelsRequest{" + + "labelFingerprint=" + labelFingerprint + ", " + + "labels=" + labels + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ZoneSetLabelsRequest) { + ZoneSetLabelsRequest that = (ZoneSetLabelsRequest) o; + return + Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && + Objects.equals(this.labels, that.getLabelsMap()) + ; + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + labelFingerprint, + labels + ); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java index 671d81b24fb5..8b27e0b5ee57 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java @@ -19,6 +19,22 @@ * * The interfaces provided are listed below, along with usage samples. * + * ===================== + * AcceleratorTypeClient + * ===================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for AcceleratorTypeClient: + *

+ * 
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
+ * }
+ * 
+ * 
+ * * ============= * AddressClient * ============= @@ -30,7 +46,8 @@ * * try (AddressClient addressClient = AddressClient.create()) { * AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - * Operation response = addressClient.deleteAddress(address); + * String requestId = ""; + * Operation response = addressClient.deleteAddress(address, requestId); * } * *
@@ -46,7 +63,25 @@ * * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - * Operation response = autoscalerClient.deleteAutoscaler(autoscaler); + * String requestId = ""; + * Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId); + * } + * + *
+ * + * =================== + * BackendBucketClient + * =================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for BackendBucketClient: + *
+ * 
+ * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+ *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+ *   String requestId = "";
+ *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
  * }
  * 
  * 
@@ -61,8 +96,9 @@ *
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+ *   String requestId = "";
  *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
- *   Operation response = backendServiceClient.deleteBackendService(backendService);
+ *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
  * }
  * 
  * 
@@ -94,8 +130,10 @@ * * try (DiskClient diskClient = DiskClient.create()) { * DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + * String requestId = ""; + * Boolean guestFlush = false; * Snapshot snapshotResource = Snapshot.newBuilder().build(); - * Operation response = diskClient.createSnapshotDisk(disk, snapshotResource); + * Operation response = diskClient.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource); * } * *
@@ -111,7 +149,8 @@ * * try (FirewallClient firewallClient = FirewallClient.create()) { * FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); - * Operation response = firewallClient.deleteFirewall(firewall); + * String requestId = ""; + * Operation response = firewallClient.deleteFirewall(firewall, requestId); * } * *
@@ -126,8 +165,9 @@ *
  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
+ *   String requestId = "";
  *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
- *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
+ *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
  * }
  * 
  * 
@@ -143,7 +183,8 @@ * * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) { * ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); - * Operation response = globalAddressClient.deleteGlobalAddress(address); + * String requestId = ""; + * Operation response = globalAddressClient.deleteGlobalAddress(address, requestId); * } * *
@@ -158,8 +199,9 @@ *
  * 
  * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
+ *   String requestId = "";
  *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
- *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
+ *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
  * }
  * 
  * 
@@ -190,8 +232,9 @@ *
  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
+ *   String requestId = "";
  *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
- *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
+ *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
  * }
  * 
  * 
@@ -206,8 +249,9 @@ *
  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
+ *   String requestId = "";
  *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
- *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
+ *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
  * }
  * 
  * 
@@ -223,7 +267,8 @@ * * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - * Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck); + * String requestId = ""; + * Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId); * } * *
@@ -239,7 +284,8 @@ * * try (ImageClient imageClient = ImageClient.create()) { * ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); - * Operation response = imageClient.deleteImage(image); + * String requestId = ""; + * Operation response = imageClient.deleteImage(image, requestId); * } * *
@@ -254,9 +300,10 @@ *
  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+ *   String requestId = "";
  *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
  *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
@@ -271,9 +318,10 @@ *
  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
+ *   String requestId = "";
  *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
  *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
+ *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
  * }
  * 
  * 
@@ -289,7 +337,8 @@ * * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) { * InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - * Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate); + * String requestId = ""; + * Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId); * } * *
@@ -306,24 +355,75 @@ * try (InstanceClient instanceClient = InstanceClient.create()) { * InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; + * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); * } * *
* - * ============ - * LicensClient - * ============ + * ============================ + * InterconnectAttachmentClient + * ============================ * * Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Sample for LicensClient: + * Sample for InterconnectAttachmentClient: *
  * 
- * try (LicensClient licensClient = LicensClient.create()) {
+ * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+ *   String requestId = "";
+ *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+ *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
+ * }
+ * 
+ * 
+ * + * ========================== + * InterconnectLocationClient + * ========================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for InterconnectLocationClient: + *
+ * 
+ * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
+ *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+ *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
+ * }
+ * 
+ * 
+ * + * ================== + * InterconnectClient + * ================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for InterconnectClient: + *
+ * 
+ * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+ *   String requestId = "";
+ *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+ *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
+ * }
+ * 
+ * 
+ * + * ============= + * LicenseClient + * ============= + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for LicenseClient: + *
+ * 
+ * try (LicenseClient licenseClient = LicenseClient.create()) {
  *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
- *   License response = licensClient.getLicens(license);
+ *   License response = licenseClient.getLicense(license);
  * }
  * 
  * 
@@ -354,8 +454,10 @@ *
  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
+ *   String requestId = "";
  *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
- *   Operation response = networkClient.deleteNetwork(network);
+ *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
+ *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
  * }
  * 
  * 
@@ -370,8 +472,9 @@ *
  * 
  * try (ProjectClient projectClient = ProjectClient.create()) {
+ *   String requestId = "";
  *   ProjectName project = ProjectName.of("[PROJECT]");
- *   Project response = projectClient.getProject(project);
+ *   Operation response = projectClient.disableXpnHostProject(requestId, project);
  * }
  * 
  * 
@@ -387,7 +490,8 @@ * * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) { * ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - * Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler); + * String requestId = ""; + * Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler, requestId); * } * *
@@ -402,8 +506,25 @@ *
  * 
  * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
+ *   String requestId = "";
  *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
- *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
+ *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService);
+ * }
+ * 
+ * 
+ * + * ====================== + * RegionCommitmentClient + * ====================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for RegionCommitmentClient: + *
+ * 
+ * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
+ *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+ *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment);
  * }
  * 
  * 
@@ -418,9 +539,10 @@ *
  * 
  * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+ *   String requestId = "";
  *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
  *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
@@ -484,7 +606,8 @@ * * try (RouterClient routerClient = RouterClient.create()) { * RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - * Operation response = routerClient.deleteRouter(router); + * String requestId = ""; + * Operation response = routerClient.deleteRouter(router, requestId); * } * *
@@ -500,7 +623,8 @@ * * try (RouteClient routeClient = RouteClient.create()) { * RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); - * Operation response = routeClient.deleteRoute(route); + * String requestId = ""; + * Operation response = routeClient.deleteRoute(route, requestId); * } * *
@@ -515,8 +639,9 @@ *
  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+ *   String requestId = "";
  *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- *   Operation response = snapshotClient.deleteSnapshot(snapshot);
+ *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
  * }
  * 
  * 
@@ -532,7 +657,8 @@ * * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) { * SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); - * Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate); + * String requestId = ""; + * Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId); * } * *
@@ -547,8 +673,9 @@ *
  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+ *   String requestId = "";
  *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
- *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
+ *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
  * }
  * 
  * 
@@ -563,8 +690,9 @@ *
  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
+ *   String requestId = "";
  *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
- *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
+ *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
  * }
  * 
  * 
@@ -580,7 +708,8 @@ * * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) { * TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - * Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy); + * String requestId = ""; + * Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId); * } * *
@@ -595,8 +724,9 @@ *
  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
+ *   String requestId = "";
  *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
- *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
+ *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
  * }
  * 
  * 
@@ -612,8 +742,9 @@ * * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) { * TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + * String requestId = ""; * TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); - * Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); + * Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource); * } * *
@@ -629,7 +760,25 @@ * * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) { * TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - * Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy); + * String requestId = ""; + * Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId); + * } + * + *
+ * + * ==================== + * TargetTcpProxyClient + * ==================== + * + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + * Sample for TargetTcpProxyClient: + *
+ * 
+ * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
+ *   String requestId = "";
+ *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+ *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
  * }
  * 
  * 
@@ -644,8 +793,9 @@ *
  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
+ *   String requestId = "";
  *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
- *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
+ *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
  * }
  * 
  * 
@@ -661,7 +811,8 @@ * * try (UrlMapClient urlMapClient = UrlMapClient.create()) { * UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); - * Operation response = urlMapClient.deleteUrlMap(urlMap); + * String requestId = ""; + * Operation response = urlMapClient.deleteUrlMap(urlMap, requestId); * } * *
@@ -676,8 +827,9 @@ *
  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
+ *   String requestId = "";
  *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
- *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
+ *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
  * }
  * 
  * 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java new file mode 100644 index 000000000000..d106e02536e1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java @@ -0,0 +1,71 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AcceleratorType; +import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import com.google.cloud.compute.v1.AcceleratorTypeList; +import com.google.cloud.compute.v1.AcceleratorTypeName; +import com.google.cloud.compute.v1.AcceleratorTypesScopedList; +import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; +import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AcceleratorTypeStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListAcceleratorTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListAcceleratorTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListAcceleratorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListAcceleratorTypesCallable()"); + } + + @BetaApi + public UnaryCallable getAcceleratorTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getAcceleratorTypeCallable()"); + } + + @BetaApi + public UnaryCallable listAcceleratorTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listAcceleratorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java new file mode 100644 index 000000000000..9c88b86bc9cc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java @@ -0,0 +1,471 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AcceleratorType; +import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import com.google.cloud.compute.v1.AcceleratorTypeList; +import com.google.cloud.compute.v1.AcceleratorTypesScopedList; +import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; +import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AcceleratorTypeStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getAcceleratorType to 30 seconds: + * + *

+ * 
+ * AcceleratorTypeStubSettings.Builder acceleratorTypeSettingsBuilder =
+ *     AcceleratorTypeStubSettings.newBuilder();
+ * acceleratorTypeSettingsBuilder.getAcceleratorTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AcceleratorTypeStubSettings acceleratorTypeSettings = acceleratorTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class AcceleratorTypeStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListAcceleratorTypesSettings; + private final UnaryCallSettings getAcceleratorTypeSettings; + private final PagedCallSettings listAcceleratorTypesSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListAcceleratorTypes. + */ + public PagedCallSettings aggregatedListAcceleratorTypesSettings() { + return aggregatedListAcceleratorTypesSettings; + } + + /** + * Returns the object with the settings used for calls to getAcceleratorType. + */ + public UnaryCallSettings getAcceleratorTypeSettings() { + return getAcceleratorTypeSettings; + } + + /** + * Returns the object with the settings used for calls to listAcceleratorTypes. + */ + public PagedCallSettings listAcceleratorTypesSettings() { + return listAcceleratorTypesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AcceleratorTypeStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAcceleratorTypeStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AcceleratorTypeStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AcceleratorTypeStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListAcceleratorTypesSettings = settingsBuilder.aggregatedListAcceleratorTypesSettings().build(); + getAcceleratorTypeSettings = settingsBuilder.getAcceleratorTypeSettings().build(); + listAcceleratorTypesSettings = settingsBuilder.listAcceleratorTypesSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListAcceleratorTypesHttpRequest injectToken(AggregatedListAcceleratorTypesHttpRequest payload, String token) { + return AggregatedListAcceleratorTypesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListAcceleratorTypesHttpRequest injectPageSize(AggregatedListAcceleratorTypesHttpRequest payload, int pageSize) { + return AggregatedListAcceleratorTypesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListAcceleratorTypesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AcceleratorTypeAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(AcceleratorTypeAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_ACCELERATOR_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListAcceleratorTypesHttpRequest injectToken(ListAcceleratorTypesHttpRequest payload, String token) { + return ListAcceleratorTypesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListAcceleratorTypesHttpRequest injectPageSize(ListAcceleratorTypesHttpRequest payload, int pageSize) { + return ListAcceleratorTypesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListAcceleratorTypesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(AcceleratorTypeList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(AcceleratorTypeList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListAcceleratorTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context); + return AggregatedListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_ACCELERATOR_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAcceleratorTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context); + return ListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for AcceleratorTypeStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListAcceleratorTypesSettings; + private final UnaryCallSettings.Builder getAcceleratorTypeSettings; + private final PagedCallSettings.Builder listAcceleratorTypesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListAcceleratorTypesSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); + + getAcceleratorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listAcceleratorTypesSettings = PagedCallSettings.newBuilder( + LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListAcceleratorTypesSettings, + getAcceleratorTypeSettings, + listAcceleratorTypesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListAcceleratorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getAcceleratorTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listAcceleratorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(AcceleratorTypeStubSettings settings) { + super(settings); + + aggregatedListAcceleratorTypesSettings = settings.aggregatedListAcceleratorTypesSettings.toBuilder(); + getAcceleratorTypeSettings = settings.getAcceleratorTypeSettings.toBuilder(); + listAcceleratorTypesSettings = settings.listAcceleratorTypesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListAcceleratorTypesSettings, + getAcceleratorTypeSettings, + listAcceleratorTypesSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListAcceleratorTypes. + */ + public PagedCallSettings.Builder aggregatedListAcceleratorTypesSettings() { + return aggregatedListAcceleratorTypesSettings; + } + + /** + * Returns the builder for the settings used for calls to getAcceleratorType. + */ + public UnaryCallSettings.Builder getAcceleratorTypeSettings() { + return getAcceleratorTypeSettings; + } + + /** + * Returns the builder for the settings used for calls to listAcceleratorTypes. + */ + public PagedCallSettings.Builder listAcceleratorTypesSettings() { + return listAcceleratorTypesSettings; + } + + @Override + public AcceleratorTypeStubSettings build() throws IOException { + return new AcceleratorTypeStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java new file mode 100644 index 000000000000..1ae4d55048c0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.BackendBucket; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import com.google.cloud.compute.v1.BackendBucketList; +import com.google.cloud.compute.v1.BackendBucketName; +import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; +import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; +import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class BackendBucketStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteBackendBucketCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackendBucketCallable()"); + } + + @BetaApi + public UnaryCallable getBackendBucketCallable() { + throw new UnsupportedOperationException("Not implemented: getBackendBucketCallable()"); + } + + @BetaApi + public UnaryCallable insertBackendBucketCallable() { + throw new UnsupportedOperationException("Not implemented: insertBackendBucketCallable()"); + } + + @BetaApi + public UnaryCallable listBackendBucketsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackendBucketsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listBackendBucketsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackendBucketsCallable()"); + } + + @BetaApi + public UnaryCallable patchBackendBucketCallable() { + throw new UnsupportedOperationException("Not implemented: patchBackendBucketCallable()"); + } + + @BetaApi + public UnaryCallable updateBackendBucketCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackendBucketCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java new file mode 100644 index 000000000000..c79bc83e6bb2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.BackendBucket; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import com.google.cloud.compute.v1.BackendBucketList; +import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; +import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; +import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; +import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link BackendBucketStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteBackendBucket to 30 seconds: + * + *

+ * 
+ * BackendBucketStubSettings.Builder backendBucketSettingsBuilder =
+ *     BackendBucketStubSettings.newBuilder();
+ * backendBucketSettingsBuilder.deleteBackendBucketSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * BackendBucketStubSettings backendBucketSettings = backendBucketSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class BackendBucketStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteBackendBucketSettings; + private final UnaryCallSettings getBackendBucketSettings; + private final UnaryCallSettings insertBackendBucketSettings; + private final PagedCallSettings listBackendBucketsSettings; + private final UnaryCallSettings patchBackendBucketSettings; + private final UnaryCallSettings updateBackendBucketSettings; + + /** + * Returns the object with the settings used for calls to deleteBackendBucket. + */ + public UnaryCallSettings deleteBackendBucketSettings() { + return deleteBackendBucketSettings; + } + + /** + * Returns the object with the settings used for calls to getBackendBucket. + */ + public UnaryCallSettings getBackendBucketSettings() { + return getBackendBucketSettings; + } + + /** + * Returns the object with the settings used for calls to insertBackendBucket. + */ + public UnaryCallSettings insertBackendBucketSettings() { + return insertBackendBucketSettings; + } + + /** + * Returns the object with the settings used for calls to listBackendBuckets. + */ + public PagedCallSettings listBackendBucketsSettings() { + return listBackendBucketsSettings; + } + + /** + * Returns the object with the settings used for calls to patchBackendBucket. + */ + public UnaryCallSettings patchBackendBucketSettings() { + return patchBackendBucketSettings; + } + + /** + * Returns the object with the settings used for calls to updateBackendBucket. + */ + public UnaryCallSettings updateBackendBucketSettings() { + return updateBackendBucketSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BackendBucketStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonBackendBucketStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BackendBucketStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BackendBucketStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteBackendBucketSettings = settingsBuilder.deleteBackendBucketSettings().build(); + getBackendBucketSettings = settingsBuilder.getBackendBucketSettings().build(); + insertBackendBucketSettings = settingsBuilder.insertBackendBucketSettings().build(); + listBackendBucketsSettings = settingsBuilder.listBackendBucketsSettings().build(); + patchBackendBucketSettings = settingsBuilder.patchBackendBucketSettings().build(); + updateBackendBucketSettings = settingsBuilder.updateBackendBucketSettings().build(); + } + + private static final PagedListDescriptor LIST_BACKEND_BUCKETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListBackendBucketsHttpRequest injectToken(ListBackendBucketsHttpRequest payload, String token) { + return ListBackendBucketsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListBackendBucketsHttpRequest injectPageSize(ListBackendBucketsHttpRequest payload, int pageSize) { + return ListBackendBucketsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListBackendBucketsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(BackendBucketList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(BackendBucketList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_BACKEND_BUCKETS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackendBucketsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKEND_BUCKETS_PAGE_STR_DESC, request, context); + return ListBackendBucketsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for BackendBucketStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteBackendBucketSettings; + private final UnaryCallSettings.Builder getBackendBucketSettings; + private final UnaryCallSettings.Builder insertBackendBucketSettings; + private final PagedCallSettings.Builder listBackendBucketsSettings; + private final UnaryCallSettings.Builder patchBackendBucketSettings; + private final UnaryCallSettings.Builder updateBackendBucketSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listBackendBucketsSettings = PagedCallSettings.newBuilder( + LIST_BACKEND_BUCKETS_PAGE_STR_FACT); + + patchBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteBackendBucketSettings, + getBackendBucketSettings, + insertBackendBucketSettings, + listBackendBucketsSettings, + patchBackendBucketSettings, + updateBackendBucketSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteBackendBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBackendBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertBackendBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listBackendBucketsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchBackendBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateBackendBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(BackendBucketStubSettings settings) { + super(settings); + + deleteBackendBucketSettings = settings.deleteBackendBucketSettings.toBuilder(); + getBackendBucketSettings = settings.getBackendBucketSettings.toBuilder(); + insertBackendBucketSettings = settings.insertBackendBucketSettings.toBuilder(); + listBackendBucketsSettings = settings.listBackendBucketsSettings.toBuilder(); + patchBackendBucketSettings = settings.patchBackendBucketSettings.toBuilder(); + updateBackendBucketSettings = settings.updateBackendBucketSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteBackendBucketSettings, + getBackendBucketSettings, + insertBackendBucketSettings, + listBackendBucketsSettings, + patchBackendBucketSettings, + updateBackendBucketSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteBackendBucket. + */ + public UnaryCallSettings.Builder deleteBackendBucketSettings() { + return deleteBackendBucketSettings; + } + + /** + * Returns the builder for the settings used for calls to getBackendBucket. + */ + public UnaryCallSettings.Builder getBackendBucketSettings() { + return getBackendBucketSettings; + } + + /** + * Returns the builder for the settings used for calls to insertBackendBucket. + */ + public UnaryCallSettings.Builder insertBackendBucketSettings() { + return insertBackendBucketSettings; + } + + /** + * Returns the builder for the settings used for calls to listBackendBuckets. + */ + public PagedCallSettings.Builder listBackendBucketsSettings() { + return listBackendBucketsSettings; + } + + /** + * Returns the builder for the settings used for calls to patchBackendBucket. + */ + public UnaryCallSettings.Builder patchBackendBucketSettings() { + return patchBackendBucketSettings; + } + + /** + * Returns the builder for the settings used for calls to updateBackendBucket. + */ + public UnaryCallSettings.Builder updateBackendBucketSettings() { + return updateBackendBucketSettings; + } + + @Override + public BackendBucketStubSettings build() throws IOException { + return new BackendBucketStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java index 8d2ea0d902bc..53a4f22b0ada 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java @@ -35,8 +35,11 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.ResourceName; +import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.ZoneName; +import com.google.cloud.compute.v1.ZoneSetLabelsRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -95,4 +98,9 @@ public UnaryCallable resizeDiskCallable() { throw new UnsupportedOperationException("Not implemented: resizeDiskCallable()"); } + @BetaApi + public UnaryCallable setLabelsDiskCallable() { + throw new UnsupportedOperationException("Not implemented: setLabelsDiskCallable()"); + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java index 2fbab0b0a3b9..274924d92803 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java @@ -56,6 +56,7 @@ import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -116,6 +117,7 @@ public class DiskStubSettings extends StubSettings { private final UnaryCallSettings insertDiskSettings; private final PagedCallSettings listDisksSettings; private final UnaryCallSettings resizeDiskSettings; + private final UnaryCallSettings setLabelsDiskSettings; /** * Returns the object with the settings used for calls to aggregatedListDisks. @@ -166,6 +168,13 @@ public UnaryCallSettings resizeDiskSettings() return resizeDiskSettings; } + /** + * Returns the object with the settings used for calls to setLabelsDisk. + */ + public UnaryCallSettings setLabelsDiskSettings() { + return setLabelsDiskSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public DiskStub createStub() throws IOException { @@ -265,6 +274,7 @@ protected DiskStubSettings(Builder settingsBuilder) throws IOException { insertDiskSettings = settingsBuilder.insertDiskSettings().build(); listDisksSettings = settingsBuilder.listDisksSettings().build(); resizeDiskSettings = settingsBuilder.resizeDiskSettings().build(); + setLabelsDiskSettings = settingsBuilder.setLabelsDiskSettings().build(); } private static final PagedListDescriptor AGGREGATED_LIST_DISKS_PAGE_STR_DESC = @@ -377,6 +387,7 @@ public static class Builder extends StubSettings.Builder insertDiskSettings; private final PagedCallSettings.Builder listDisksSettings; private final UnaryCallSettings.Builder resizeDiskSettings; + private final UnaryCallSettings.Builder setLabelsDiskSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -432,6 +443,8 @@ protected Builder(ClientContext clientContext) { resizeDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setLabelsDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListDisksSettings, createSnapshotDiskSettings, @@ -439,7 +452,8 @@ protected Builder(ClientContext clientContext) { getDiskSettings, insertDiskSettings, listDisksSettings, - resizeDiskSettings + resizeDiskSettings, + setLabelsDiskSettings ); initDefaults(this); @@ -484,6 +498,10 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setLabelsDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -497,6 +515,7 @@ protected Builder(DiskStubSettings settings) { insertDiskSettings = settings.insertDiskSettings.toBuilder(); listDisksSettings = settings.listDisksSettings.toBuilder(); resizeDiskSettings = settings.resizeDiskSettings.toBuilder(); + setLabelsDiskSettings = settings.setLabelsDiskSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListDisksSettings, @@ -505,7 +524,8 @@ protected Builder(DiskStubSettings settings) { getDiskSettings, insertDiskSettings, listDisksSettings, - resizeDiskSettings + resizeDiskSettings, + setLabelsDiskSettings ); } @@ -572,6 +592,13 @@ public UnaryCallSettings.Builder resizeDiskSet return resizeDiskSettings; } + /** + * Returns the builder for the settings used for calls to setLabelsDisk. + */ + public UnaryCallSettings.Builder setLabelsDiskSettings() { + return setLabelsDiskSettings; + } + @Override public DiskStubSettings build() throws IOException { return new DiskStubSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java index e655806544db..efee9618f647 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java @@ -15,8 +15,6 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; - import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -24,9 +22,12 @@ import com.google.cloud.compute.v1.AddressList; import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectAddressName; +import com.google.cloud.compute.v1.ProjectName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -39,6 +40,7 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalAddressStub implements BackgroundResource { + @BetaApi public UnaryCallable deleteGlobalAddressCallable() { throw new UnsupportedOperationException("Not implemented: deleteGlobalAddressCallable()"); @@ -55,8 +57,7 @@ public UnaryCallable insertGlobalAddr } @BetaApi - public UnaryCallable - listGlobalAddressesPagedCallable() { + public UnaryCallable listGlobalAddressesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalAddressesPagedCallable()"); } @@ -64,4 +65,5 @@ public UnaryCallable insertGlobalAddr public UnaryCallable listGlobalAddressesCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalAddressesCallable()"); } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java new file mode 100644 index 000000000000..8752d5fb77ae --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java @@ -0,0 +1,99 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AcceleratorType; +import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import com.google.cloud.compute.v1.AcceleratorTypeList; +import com.google.cloud.compute.v1.AcceleratorTypeName; +import com.google.cloud.compute.v1.AcceleratorTypeSettings; +import com.google.cloud.compute.v1.AcceleratorTypesScopedList; +import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; +import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonAcceleratorTypeCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java new file mode 100644 index 000000000000..6c108cb4ae8d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java @@ -0,0 +1,237 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AcceleratorType; +import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import com.google.cloud.compute.v1.AcceleratorTypeList; +import com.google.cloud.compute.v1.AcceleratorTypeName; +import com.google.cloud.compute.v1.AcceleratorTypeSettings; +import com.google.cloud.compute.v1.AcceleratorTypesScopedList; +import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; +import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListAcceleratorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.acceleratorTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/acceleratorTypes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AcceleratorTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getAcceleratorTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.acceleratorTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAcceleratorTypeHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(AcceleratorTypeName.newFactory()) + .setResourceNameField("acceleratorType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AcceleratorType.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listAcceleratorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.acceleratorTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAcceleratorTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/acceleratorTypes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AcceleratorTypeList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListAcceleratorTypesCallable; + private final UnaryCallable aggregatedListAcceleratorTypesPagedCallable; + private final UnaryCallable getAcceleratorTypeCallable; + private final UnaryCallable listAcceleratorTypesCallable; + private final UnaryCallable listAcceleratorTypesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonAcceleratorTypeStub create(AcceleratorTypeStubSettings settings) throws IOException { + return new HttpJsonAcceleratorTypeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAcceleratorTypeStub create(ClientContext clientContext) throws IOException { + return new HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonAcceleratorTypeStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAcceleratorTypeStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAcceleratorTypeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAcceleratorTypeStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListAcceleratorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListAcceleratorTypesMethodDescriptor) + .build(); + HttpJsonCallSettings getAcceleratorTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAcceleratorTypeMethodDescriptor) + .build(); + HttpJsonCallSettings listAcceleratorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAcceleratorTypesMethodDescriptor) + .build(); + + this.aggregatedListAcceleratorTypesCallable = callableFactory.createUnaryCallable(aggregatedListAcceleratorTypesTransportSettings,settings.aggregatedListAcceleratorTypesSettings(), clientContext); + this.aggregatedListAcceleratorTypesPagedCallable = callableFactory.createPagedCallable(aggregatedListAcceleratorTypesTransportSettings,settings.aggregatedListAcceleratorTypesSettings(), clientContext); + this.getAcceleratorTypeCallable = callableFactory.createUnaryCallable(getAcceleratorTypeTransportSettings,settings.getAcceleratorTypeSettings(), clientContext); + this.listAcceleratorTypesCallable = callableFactory.createUnaryCallable(listAcceleratorTypesTransportSettings,settings.listAcceleratorTypesSettings(), clientContext); + this.listAcceleratorTypesPagedCallable = callableFactory.createPagedCallable(listAcceleratorTypesTransportSettings,settings.listAcceleratorTypesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListAcceleratorTypesPagedCallable() { + return aggregatedListAcceleratorTypesPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListAcceleratorTypesCallable() { + return aggregatedListAcceleratorTypesCallable; + } + + @BetaApi + public UnaryCallable getAcceleratorTypeCallable() { + return getAcceleratorTypeCallable; + } + + @BetaApi + public UnaryCallable listAcceleratorTypesPagedCallable() { + return listAcceleratorTypesPagedCallable; + } + + @BetaApi + public UnaryCallable listAcceleratorTypesCallable() { + return listAcceleratorTypesCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java index 7ee564100d11..088c00a23cd8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -93,6 +93,7 @@ public class HttpJsonAddressStub extends AddressStub { .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(AddressName.newFactory()) .setResourceNameField("address") @@ -131,6 +132,7 @@ public class HttpJsonAddressStub extends AddressStub { .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java index 5c73beb81093..3c16815b7878 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -95,6 +95,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(AutoscalerName.newFactory()) .setResourceNameField("autoscaler") @@ -133,6 +134,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") @@ -172,7 +174,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet( - "autoscaler" + "autoscaler", "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") @@ -192,7 +194,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet( - "autoscaler" + "autoscaler", "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java new file mode 100644 index 000000000000..26897ac69b13 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.BackendBucket; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import com.google.cloud.compute.v1.BackendBucketList; +import com.google.cloud.compute.v1.BackendBucketName; +import com.google.cloud.compute.v1.BackendBucketSettings; +import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; +import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; +import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonBackendBucketCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java new file mode 100644 index 000000000000..23c11bb1c266 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java @@ -0,0 +1,323 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.BackendBucket; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import com.google.cloud.compute.v1.BackendBucketList; +import com.google.cloud.compute.v1.BackendBucketName; +import com.google.cloud.compute.v1.BackendBucketSettings; +import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; +import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; +import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonBackendBucketStub extends BackendBucketStub { + @InternalApi + public static final ApiMethodDescriptor deleteBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(BackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(BackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendBucket.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listBackendBucketsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListBackendBucketsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendBucketList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(BackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(BackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteBackendBucketCallable; + private final UnaryCallable getBackendBucketCallable; + private final UnaryCallable insertBackendBucketCallable; + private final UnaryCallable listBackendBucketsCallable; + private final UnaryCallable listBackendBucketsPagedCallable; + private final UnaryCallable patchBackendBucketCallable; + private final UnaryCallable updateBackendBucketCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonBackendBucketStub create(BackendBucketStubSettings settings) throws IOException { + return new HttpJsonBackendBucketStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonBackendBucketStub create(ClientContext clientContext) throws IOException { + return new HttpJsonBackendBucketStub(BackendBucketStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonBackendBucketStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonBackendBucketStub(BackendBucketStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonBackendBucketStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonBackendBucketStub(BackendBucketStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonBackendBucketCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonBackendBucketStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonBackendBucketStub(BackendBucketStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings getBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings insertBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings listBackendBucketsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackendBucketsMethodDescriptor) + .build(); + HttpJsonCallSettings patchBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings updateBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackendBucketMethodDescriptor) + .build(); + + this.deleteBackendBucketCallable = callableFactory.createUnaryCallable(deleteBackendBucketTransportSettings,settings.deleteBackendBucketSettings(), clientContext); + this.getBackendBucketCallable = callableFactory.createUnaryCallable(getBackendBucketTransportSettings,settings.getBackendBucketSettings(), clientContext); + this.insertBackendBucketCallable = callableFactory.createUnaryCallable(insertBackendBucketTransportSettings,settings.insertBackendBucketSettings(), clientContext); + this.listBackendBucketsCallable = callableFactory.createUnaryCallable(listBackendBucketsTransportSettings,settings.listBackendBucketsSettings(), clientContext); + this.listBackendBucketsPagedCallable = callableFactory.createPagedCallable(listBackendBucketsTransportSettings,settings.listBackendBucketsSettings(), clientContext); + this.patchBackendBucketCallable = callableFactory.createUnaryCallable(patchBackendBucketTransportSettings,settings.patchBackendBucketSettings(), clientContext); + this.updateBackendBucketCallable = callableFactory.createUnaryCallable(updateBackendBucketTransportSettings,settings.updateBackendBucketSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteBackendBucketCallable() { + return deleteBackendBucketCallable; + } + + @BetaApi + public UnaryCallable getBackendBucketCallable() { + return getBackendBucketCallable; + } + + @BetaApi + public UnaryCallable insertBackendBucketCallable() { + return insertBackendBucketCallable; + } + + @BetaApi + public UnaryCallable listBackendBucketsPagedCallable() { + return listBackendBucketsPagedCallable; + } + + @BetaApi + public UnaryCallable listBackendBucketsCallable() { + return listBackendBucketsCallable; + } + + @BetaApi + public UnaryCallable patchBackendBucketCallable() { + return patchBackendBucketCallable; + } + + @BetaApi + public UnaryCallable updateBackendBucketCallable() { + return updateBackendBucketCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java index 387538f45d2c..09d1f2d1e81d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -97,6 +97,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(BackendServiceName.newFactory()) .setResourceNameField("backendService") @@ -154,6 +155,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -193,6 +195,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(BackendServiceName.newFactory()) .setResourceNameField("backendService") @@ -212,6 +215,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(BackendServiceName.newFactory()) .setResourceNameField("backendService") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java index b6fe838d7704..4f4922251f3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java @@ -58,8 +58,11 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.ResourceName; +import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.ZoneName; +import com.google.cloud.compute.v1.ZoneSetLabelsRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index e838748d42b5..ecf727e4c988 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -15,9 +15,6 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; - import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -29,6 +26,7 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; @@ -36,17 +34,30 @@ import com.google.cloud.compute.v1.DeleteDiskHttpRequest; import com.google.cloud.compute.v1.Disk; import com.google.cloud.compute.v1.DiskAggregatedList; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.DiskList; import com.google.cloud.compute.v1.DiskName; +import com.google.cloud.compute.v1.DiskSettings; +import com.google.cloud.compute.v1.DisksResizeRequest; +import com.google.cloud.compute.v1.DisksScopedList; import com.google.cloud.compute.v1.GetDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.ResourceName; +import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; +import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.ZoneName; +import com.google.cloud.compute.v1.ZoneSetLabelsRequest; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,67 +71,65 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonDiskStub extends DiskStub { @InternalApi - public static final ApiMethodDescriptor - aggregatedListDisksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) - .setQueryParams( - Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskAggregatedList.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor aggregatedListDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskAggregatedList.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - createSnapshotDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.createSnapshot") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(DiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor createSnapshotDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.createSnapshot") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) + .setQueryParams(Sets.newHashSet( + "guestFlush", "requestId" + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - deleteDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(DiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor deleteDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi public static final ApiMethodDescriptor getDiskMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -130,7 +139,8 @@ public class HttpJsonDiskStub extends DiskStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) - .setQueryParams(Sets.newHashSet()) + .setQueryParams(Sets.newHashSet( + )) .setResourceNameFactory(DiskName.newFactory()) .setResourceNameField("disk") .build()) @@ -139,75 +149,90 @@ public class HttpJsonDiskStub extends DiskStub { .setResponseInstance(Disk.getDefaultInstance()) .build()) .build(); - @InternalApi - public static final ApiMethodDescriptor - insertDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) - .setQueryParams(Sets.newHashSet("sourceImage")) - .setResourceNameFactory(ZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor insertDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams(Sets.newHashSet( + "requestId", "sourceImage" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - listDisksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) - .setQueryParams( - Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) - .setResourceNameFactory(ZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskList.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor listDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskList.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - resizeDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.resize") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(DiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor resizeDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(DiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setLabelsDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; - private final UnaryCallable - aggregatedListDisksCallable; - private final UnaryCallable - aggregatedListDisksPagedCallable; + private final UnaryCallable aggregatedListDisksCallable; + private final UnaryCallable aggregatedListDisksPagedCallable; private final UnaryCallable createSnapshotDiskCallable; private final UnaryCallable deleteDiskCallable; private final UnaryCallable getDiskCallable; @@ -215,9 +240,9 @@ public class HttpJsonDiskStub extends DiskStub { private final UnaryCallable listDisksCallable; private final UnaryCallable listDisksPagedCallable; private final UnaryCallable resizeDiskCallable; + private final UnaryCallable setLabelsDiskCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonDiskStub create(DiskStubSettings settings) throws IOException { return new HttpJsonDiskStub(settings, ClientContext.create(settings)); } @@ -226,42 +251,35 @@ public static final HttpJsonDiskStub create(ClientContext clientContext) throws return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonDiskStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonDiskStub( - DiskStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonDiskStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonDiskStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + * Constructs an instance of HttpJsonDiskStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) - throws IOException { + protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonDiskCallableFactory()); } /** - * Constructs an instance of HttpJsonDiskStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + * Constructs an instance of HttpJsonDiskStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonDiskStub( - DiskStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { + protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings - aggregatedListDisksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListDisksMethodDescriptor) - .build(); - HttpJsonCallSettings - createSnapshotDiskTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSnapshotDiskMethodDescriptor) - .build(); + HttpJsonCallSettings aggregatedListDisksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListDisksMethodDescriptor) + .build(); + HttpJsonCallSettings createSnapshotDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotDiskMethodDescriptor) + .build(); HttpJsonCallSettings deleteDiskTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteDiskMethodDescriptor) @@ -282,53 +300,32 @@ protected HttpJsonDiskStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(resizeDiskMethodDescriptor) .build(); + HttpJsonCallSettings setLabelsDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsDiskMethodDescriptor) + .build(); - this.aggregatedListDisksCallable = - callableFactory.createUnaryCallable( - aggregatedListDisksTransportSettings, - settings.aggregatedListDisksSettings(), - clientContext); - this.aggregatedListDisksPagedCallable = - callableFactory.createPagedCallable( - aggregatedListDisksTransportSettings, - settings.aggregatedListDisksSettings(), - clientContext); - this.createSnapshotDiskCallable = - callableFactory.createUnaryCallable( - createSnapshotDiskTransportSettings, - settings.createSnapshotDiskSettings(), - clientContext); - this.deleteDiskCallable = - callableFactory.createUnaryCallable( - deleteDiskTransportSettings, settings.deleteDiskSettings(), clientContext); - this.getDiskCallable = - callableFactory.createUnaryCallable( - getDiskTransportSettings, settings.getDiskSettings(), clientContext); - this.insertDiskCallable = - callableFactory.createUnaryCallable( - insertDiskTransportSettings, settings.insertDiskSettings(), clientContext); - this.listDisksCallable = - callableFactory.createUnaryCallable( - listDisksTransportSettings, settings.listDisksSettings(), clientContext); - this.listDisksPagedCallable = - callableFactory.createPagedCallable( - listDisksTransportSettings, settings.listDisksSettings(), clientContext); - this.resizeDiskCallable = - callableFactory.createUnaryCallable( - resizeDiskTransportSettings, settings.resizeDiskSettings(), clientContext); + this.aggregatedListDisksCallable = callableFactory.createUnaryCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); + this.aggregatedListDisksPagedCallable = callableFactory.createPagedCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); + this.createSnapshotDiskCallable = callableFactory.createUnaryCallable(createSnapshotDiskTransportSettings,settings.createSnapshotDiskSettings(), clientContext); + this.deleteDiskCallable = callableFactory.createUnaryCallable(deleteDiskTransportSettings,settings.deleteDiskSettings(), clientContext); + this.getDiskCallable = callableFactory.createUnaryCallable(getDiskTransportSettings,settings.getDiskSettings(), clientContext); + this.insertDiskCallable = callableFactory.createUnaryCallable(insertDiskTransportSettings,settings.insertDiskSettings(), clientContext); + this.listDisksCallable = callableFactory.createUnaryCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); + this.listDisksPagedCallable = callableFactory.createPagedCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); + this.resizeDiskCallable = callableFactory.createUnaryCallable(resizeDiskTransportSettings,settings.resizeDiskSettings(), clientContext); + this.setLabelsDiskCallable = callableFactory.createUnaryCallable(setLabelsDiskTransportSettings,settings.setLabelsDiskSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable - aggregatedListDisksPagedCallable() { + public UnaryCallable aggregatedListDisksPagedCallable() { return aggregatedListDisksPagedCallable; } @BetaApi - public UnaryCallable - aggregatedListDisksCallable() { + public UnaryCallable aggregatedListDisksCallable() { return aggregatedListDisksCallable; } @@ -367,6 +364,11 @@ public UnaryCallable resizeDiskCallable() { return resizeDiskCallable; } + @BetaApi + public UnaryCallable setLabelsDiskCallable() { + return setLabelsDiskCallable; + } + @Override public final void close() throws Exception { shutdown(); @@ -396,4 +398,5 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java index 3bc50a415364..bd1cfbf7ecaf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -70,6 +70,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(FirewallName.newFactory()) .setResourceNameField("firewall") @@ -108,6 +109,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -147,6 +149,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(FirewallName.newFactory()) .setResourceNameField("firewall") @@ -166,6 +169,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(FirewallName.newFactory()) .setResourceNameField("firewall") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java index 6b877cffec9a..149bd90bf2a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -95,6 +95,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ForwardingRuleName.newFactory()) .setResourceNameField("forwardingRule") @@ -133,6 +134,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -172,6 +174,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ForwardingRuleName.newFactory()) .setResourceNameField("forwardingRule") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java index aa75842603a5..ba45af41eea7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -68,6 +68,7 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectAddressName.newFactory()) .setResourceNameField("address") @@ -106,6 +107,7 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java index 8d6bec3d7056..7b8c4918e8c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -70,6 +70,7 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setRequestInstance(DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) .setResourceNameField("forwardingRule") @@ -108,6 +109,7 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setRequestInstance(InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -147,6 +149,7 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setRequestInstance(SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}/setTarget")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) .setResourceNameField("forwardingRule") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java index 4eee744b6b10..5d52abf153dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -70,6 +70,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HealthCheckName.newFactory()) .setResourceNameField("healthCheck") @@ -108,6 +109,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -147,6 +149,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HealthCheckName.newFactory()) .setResourceNameField("healthCheck") @@ -166,6 +169,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HealthCheckName.newFactory()) .setResourceNameField("healthCheck") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index b23145fac407..87f0f57f499e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -70,6 +70,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HttpHealthCheckName.newFactory()) .setResourceNameField("httpHealthCheck") @@ -108,6 +109,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -147,6 +149,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HttpHealthCheckName.newFactory()) .setResourceNameField("httpHealthCheck") @@ -166,6 +169,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HttpHealthCheckName.newFactory()) .setResourceNameField("httpHealthCheck") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 48f35e7103a5..af1341131283 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -70,6 +70,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HttpsHealthCheckName.newFactory()) .setResourceNameField("httpsHealthCheck") @@ -108,6 +109,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -147,6 +149,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HttpsHealthCheckName.newFactory()) .setResourceNameField("httpsHealthCheck") @@ -166,6 +169,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(HttpsHealthCheckName.newFactory()) .setResourceNameField("httpsHealthCheck") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java index 01b6b1c43e74..4cf158cb2851 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java @@ -46,6 +46,7 @@ import com.google.cloud.compute.v1.FamilyName; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.Image; import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; @@ -54,7 +55,9 @@ import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectImageName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index 0af37c62dd70..7916420834f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -35,6 +35,7 @@ import com.google.cloud.compute.v1.FamilyName; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.Image; import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; @@ -43,7 +44,9 @@ import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectImageName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; @@ -72,6 +75,7 @@ public class HttpJsonImageStub extends ImageStub { .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ImageName.newFactory()) .setResourceNameField("image") @@ -91,6 +95,7 @@ public class HttpJsonImageStub extends ImageStub { .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}/deprecate")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ImageName.newFactory()) .setResourceNameField("image") @@ -148,6 +153,7 @@ public class HttpJsonImageStub extends ImageStub { .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams(Sets.newHashSet( + "forceCreate", "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -177,6 +183,25 @@ public class HttpJsonImageStub extends ImageStub { .setResponseInstance(ImageList.getDefaultInstance()) .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor setLabelsImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectImageName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; private final UnaryCallable deleteImageCallable; @@ -186,6 +211,7 @@ public class HttpJsonImageStub extends ImageStub { private final UnaryCallable insertImageCallable; private final UnaryCallable listImagesCallable; private final UnaryCallable listImagesPagedCallable; + private final UnaryCallable setLabelsImageCallable; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonImageStub create(ImageStubSettings settings) throws IOException { @@ -241,6 +267,10 @@ protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientCont HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listImagesMethodDescriptor) .build(); + HttpJsonCallSettings setLabelsImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsImageMethodDescriptor) + .build(); this.deleteImageCallable = callableFactory.createUnaryCallable(deleteImageTransportSettings,settings.deleteImageSettings(), clientContext); this.deprecateImageCallable = callableFactory.createUnaryCallable(deprecateImageTransportSettings,settings.deprecateImageSettings(), clientContext); @@ -249,6 +279,7 @@ protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientCont this.insertImageCallable = callableFactory.createUnaryCallable(insertImageTransportSettings,settings.insertImageSettings(), clientContext); this.listImagesCallable = callableFactory.createUnaryCallable(listImagesTransportSettings,settings.listImagesSettings(), clientContext); this.listImagesPagedCallable = callableFactory.createPagedCallable(listImagesTransportSettings,settings.listImagesSettings(), clientContext); + this.setLabelsImageCallable = callableFactory.createUnaryCallable(setLabelsImageTransportSettings,settings.setLabelsImageSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -288,6 +319,11 @@ public UnaryCallable listImagesCallable() { return listImagesCallable; } + @BetaApi + public UnaryCallable setLabelsImageCallable() { + return setLabelsImageCallable; + } + @Override public final void close() throws Exception { shutdown(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java index 4ed7f958caaa..305097eb222a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java @@ -15,15 +15,93 @@ */ package com.google.cloud.compute.v1.stub; +import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AccessConfig; +import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; +import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.AttachedDisk; +import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetInstanceHttpRequest; +import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; +import com.google.cloud.compute.v1.InsertInstanceHttpRequest; +import com.google.cloud.compute.v1.Instance; +import com.google.cloud.compute.v1.InstanceAggregatedList; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; +import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceListReferrers; +import com.google.cloud.compute.v1.InstanceName; +import com.google.cloud.compute.v1.InstanceSettings; +import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.InstancesSetLabelsRequest; +import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest; +import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; +import com.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; +import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; +import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; +import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; +import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.NetworkInterface; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectZoneInstanceName; +import com.google.cloud.compute.v1.Reference; +import com.google.cloud.compute.v1.ResetInstanceHttpRequest; +import com.google.cloud.compute.v1.Scheduling; +import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; +import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMinCpuPlatformInstanceHttpRequest; +import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; +import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; +import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; +import com.google.cloud.compute.v1.StartInstanceHttpRequest; +import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; +import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.Tags; +import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; +import com.google.cloud.compute.v1.ZoneName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,18 +118,16 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -59,7 +135,6 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index c7fdd7d97011..e81e92b39c6c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -86,6 +86,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -125,6 +126,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -144,6 +146,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -182,6 +185,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") @@ -241,6 +245,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -260,7 +265,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) .setQueryParams(Sets.newHashSet( - "size" + "requestId", "size" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -280,6 +285,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -299,6 +305,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestInstance(SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java index 3921277dbcc5..d59dfe56eea8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -84,6 +84,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupName.newFactory()) .setResourceNameField("instanceGroup") @@ -123,6 +124,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupName.newFactory()) .setResourceNameField("instanceGroup") @@ -161,6 +163,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") @@ -220,6 +223,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestInstance(RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupName.newFactory()) .setResourceNameField("instanceGroup") @@ -239,6 +243,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestInstance(SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceGroupName.newFactory()) .setResourceNameField("instanceGroup") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index 152be2825cbe..57c1ce7fd0e9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -44,23 +44,36 @@ import com.google.cloud.compute.v1.InstanceAggregatedList; import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceListReferrers; import com.google.cloud.compute.v1.InstanceName; import com.google.cloud.compute.v1.InstanceSettings; import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.InstancesSetLabelsRequest; +import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest; import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; +import com.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.NetworkInterface; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectZoneInstanceName; +import com.google.cloud.compute.v1.Reference; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; import com.google.cloud.compute.v1.Scheduling; import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMinCpuPlatformInstanceHttpRequest; import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; @@ -68,6 +81,8 @@ import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; import com.google.cloud.compute.v1.Tags; +import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import com.google.cloud.compute.v1.ZoneName; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; @@ -97,7 +112,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/addAccessConfig")) .setQueryParams(Sets.newHashSet( - "networkInterface" + "networkInterface", "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -137,6 +152,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/attachDisk")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -156,6 +172,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -175,7 +192,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) .setQueryParams(Sets.newHashSet( - "accessConfig", "networkInterface" + "accessConfig", "networkInterface", "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -195,7 +212,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/detachDisk")) .setQueryParams(Sets.newHashSet( - "deviceName" + "deviceName", "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -254,6 +271,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") @@ -284,6 +302,26 @@ public class HttpJsonInstanceStub extends InstanceStub { .build()) .build(); @InternalApi + public static final ApiMethodDescriptor listReferrersInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.listReferrers") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListReferrersInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/referrers")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceListReferrers.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor resetInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.instances.reset") @@ -293,6 +331,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -303,6 +342,26 @@ public class HttpJsonInstanceStub extends InstanceStub { .build()) .build(); @InternalApi + public static final ApiMethodDescriptor setDeletionProtectionInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setDeletionProtection") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{resource}/setDeletionProtection")) + .setQueryParams(Sets.newHashSet( + "deletionProtection", "requestId" + )) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setDiskAutoDeleteInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.instances.setDiskAutoDelete") @@ -312,7 +371,47 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) .setQueryParams(Sets.newHashSet( - "autoDelete", "deviceName" + "autoDelete", "deviceName", "requestId" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setLabelsInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setLabels")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setMachineResourcesInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMachineResources") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMachineResources")) + .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -332,6 +431,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMachineType")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -351,6 +451,27 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMetadata")) .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setMinCpuPlatformInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMinCpuPlatform") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")) + .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -370,6 +491,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setScheduling")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -389,6 +511,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setServiceAccount")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -408,6 +531,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setTags")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -427,6 +551,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -446,6 +571,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -465,6 +591,47 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateAccessConfigInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.updateAccessConfig") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/updateAccessConfig")) + .setQueryParams(Sets.newHashSet( + "networkInterface", "requestId" + )) + .setResourceNameFactory(InstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor updateNetworkInterfaceInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.updateNetworkInterface") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")) + .setQueryParams(Sets.newHashSet( + "networkInterface", "requestId" )) .setResourceNameFactory(InstanceName.newFactory()) .setResourceNameField("instance") @@ -488,16 +655,24 @@ public class HttpJsonInstanceStub extends InstanceStub { private final UnaryCallable insertInstanceCallable; private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; + private final UnaryCallable listReferrersInstancesCallable; + private final UnaryCallable listReferrersInstancesPagedCallable; private final UnaryCallable resetInstanceCallable; + private final UnaryCallable setDeletionProtectionInstanceCallable; private final UnaryCallable setDiskAutoDeleteInstanceCallable; + private final UnaryCallable setLabelsInstanceCallable; + private final UnaryCallable setMachineResourcesInstanceCallable; private final UnaryCallable setMachineTypeInstanceCallable; private final UnaryCallable setMetadataInstanceCallable; + private final UnaryCallable setMinCpuPlatformInstanceCallable; private final UnaryCallable setSchedulingInstanceCallable; private final UnaryCallable setServiceAccountInstanceCallable; private final UnaryCallable setTagsInstanceCallable; private final UnaryCallable startInstanceCallable; private final UnaryCallable startWithEncryptionKeyInstanceCallable; private final UnaryCallable stopInstanceCallable; + private final UnaryCallable updateAccessConfigInstanceCallable; + private final UnaryCallable updateNetworkInterfaceInstanceCallable; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonInstanceStub create(InstanceStubSettings settings) throws IOException { @@ -569,14 +744,30 @@ protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listInstancesMethodDescriptor) .build(); + HttpJsonCallSettings listReferrersInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listReferrersInstancesMethodDescriptor) + .build(); HttpJsonCallSettings resetInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(resetInstanceMethodDescriptor) .build(); + HttpJsonCallSettings setDeletionProtectionInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDeletionProtectionInstanceMethodDescriptor) + .build(); HttpJsonCallSettings setDiskAutoDeleteInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setDiskAutoDeleteInstanceMethodDescriptor) .build(); + HttpJsonCallSettings setLabelsInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings setMachineResourcesInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMachineResourcesInstanceMethodDescriptor) + .build(); HttpJsonCallSettings setMachineTypeInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setMachineTypeInstanceMethodDescriptor) @@ -585,6 +776,10 @@ protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setMetadataInstanceMethodDescriptor) .build(); + HttpJsonCallSettings setMinCpuPlatformInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMinCpuPlatformInstanceMethodDescriptor) + .build(); HttpJsonCallSettings setSchedulingInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setSchedulingInstanceMethodDescriptor) @@ -609,6 +804,14 @@ protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(stopInstanceMethodDescriptor) .build(); + HttpJsonCallSettings updateAccessConfigInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAccessConfigInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings updateNetworkInterfaceInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateNetworkInterfaceInstanceMethodDescriptor) + .build(); this.addAccessConfigInstanceCallable = callableFactory.createUnaryCallable(addAccessConfigInstanceTransportSettings,settings.addAccessConfigInstanceSettings(), clientContext); this.aggregatedListInstancesCallable = callableFactory.createUnaryCallable(aggregatedListInstancesTransportSettings,settings.aggregatedListInstancesSettings(), clientContext); @@ -622,16 +825,24 @@ protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clie this.insertInstanceCallable = callableFactory.createUnaryCallable(insertInstanceTransportSettings,settings.insertInstanceSettings(), clientContext); this.listInstancesCallable = callableFactory.createUnaryCallable(listInstancesTransportSettings,settings.listInstancesSettings(), clientContext); this.listInstancesPagedCallable = callableFactory.createPagedCallable(listInstancesTransportSettings,settings.listInstancesSettings(), clientContext); + this.listReferrersInstancesCallable = callableFactory.createUnaryCallable(listReferrersInstancesTransportSettings,settings.listReferrersInstancesSettings(), clientContext); + this.listReferrersInstancesPagedCallable = callableFactory.createPagedCallable(listReferrersInstancesTransportSettings,settings.listReferrersInstancesSettings(), clientContext); this.resetInstanceCallable = callableFactory.createUnaryCallable(resetInstanceTransportSettings,settings.resetInstanceSettings(), clientContext); + this.setDeletionProtectionInstanceCallable = callableFactory.createUnaryCallable(setDeletionProtectionInstanceTransportSettings,settings.setDeletionProtectionInstanceSettings(), clientContext); this.setDiskAutoDeleteInstanceCallable = callableFactory.createUnaryCallable(setDiskAutoDeleteInstanceTransportSettings,settings.setDiskAutoDeleteInstanceSettings(), clientContext); + this.setLabelsInstanceCallable = callableFactory.createUnaryCallable(setLabelsInstanceTransportSettings,settings.setLabelsInstanceSettings(), clientContext); + this.setMachineResourcesInstanceCallable = callableFactory.createUnaryCallable(setMachineResourcesInstanceTransportSettings,settings.setMachineResourcesInstanceSettings(), clientContext); this.setMachineTypeInstanceCallable = callableFactory.createUnaryCallable(setMachineTypeInstanceTransportSettings,settings.setMachineTypeInstanceSettings(), clientContext); this.setMetadataInstanceCallable = callableFactory.createUnaryCallable(setMetadataInstanceTransportSettings,settings.setMetadataInstanceSettings(), clientContext); + this.setMinCpuPlatformInstanceCallable = callableFactory.createUnaryCallable(setMinCpuPlatformInstanceTransportSettings,settings.setMinCpuPlatformInstanceSettings(), clientContext); this.setSchedulingInstanceCallable = callableFactory.createUnaryCallable(setSchedulingInstanceTransportSettings,settings.setSchedulingInstanceSettings(), clientContext); this.setServiceAccountInstanceCallable = callableFactory.createUnaryCallable(setServiceAccountInstanceTransportSettings,settings.setServiceAccountInstanceSettings(), clientContext); this.setTagsInstanceCallable = callableFactory.createUnaryCallable(setTagsInstanceTransportSettings,settings.setTagsInstanceSettings(), clientContext); this.startInstanceCallable = callableFactory.createUnaryCallable(startInstanceTransportSettings,settings.startInstanceSettings(), clientContext); this.startWithEncryptionKeyInstanceCallable = callableFactory.createUnaryCallable(startWithEncryptionKeyInstanceTransportSettings,settings.startWithEncryptionKeyInstanceSettings(), clientContext); this.stopInstanceCallable = callableFactory.createUnaryCallable(stopInstanceTransportSettings,settings.stopInstanceSettings(), clientContext); + this.updateAccessConfigInstanceCallable = callableFactory.createUnaryCallable(updateAccessConfigInstanceTransportSettings,settings.updateAccessConfigInstanceSettings(), clientContext); + this.updateNetworkInterfaceInstanceCallable = callableFactory.createUnaryCallable(updateNetworkInterfaceInstanceTransportSettings,settings.updateNetworkInterfaceInstanceSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -696,16 +907,41 @@ public UnaryCallable listInstancesCallab return listInstancesCallable; } + @BetaApi + public UnaryCallable listReferrersInstancesPagedCallable() { + return listReferrersInstancesPagedCallable; + } + + @BetaApi + public UnaryCallable listReferrersInstancesCallable() { + return listReferrersInstancesCallable; + } + @BetaApi public UnaryCallable resetInstanceCallable() { return resetInstanceCallable; } + @BetaApi + public UnaryCallable setDeletionProtectionInstanceCallable() { + return setDeletionProtectionInstanceCallable; + } + @BetaApi public UnaryCallable setDiskAutoDeleteInstanceCallable() { return setDiskAutoDeleteInstanceCallable; } + @BetaApi + public UnaryCallable setLabelsInstanceCallable() { + return setLabelsInstanceCallable; + } + + @BetaApi + public UnaryCallable setMachineResourcesInstanceCallable() { + return setMachineResourcesInstanceCallable; + } + @BetaApi public UnaryCallable setMachineTypeInstanceCallable() { return setMachineTypeInstanceCallable; @@ -716,6 +952,11 @@ public UnaryCallable setMetadataInsta return setMetadataInstanceCallable; } + @BetaApi + public UnaryCallable setMinCpuPlatformInstanceCallable() { + return setMinCpuPlatformInstanceCallable; + } + @BetaApi public UnaryCallable setSchedulingInstanceCallable() { return setSchedulingInstanceCallable; @@ -746,6 +987,16 @@ public UnaryCallable stopInstanceCallable() return stopInstanceCallable; } + @BetaApi + public UnaryCallable updateAccessConfigInstanceCallable() { + return updateAccessConfigInstanceCallable; + } + + @BetaApi + public UnaryCallable updateNetworkInterfaceInstanceCallable() { + return updateNetworkInterfaceInstanceCallable; + } + @Override public final void close() throws Exception { shutdown(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index e6a3603dd4ab..63007b6646ac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -68,6 +68,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates/{instanceTemplate}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(InstanceTemplateName.newFactory()) .setResourceNameField("instanceTemplate") @@ -106,6 +107,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java new file mode 100644 index 000000000000..39ac86fcf328 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.DeleteInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InterconnectAttachment; +import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import com.google.cloud.compute.v1.InterconnectAttachmentList; +import com.google.cloud.compute.v1.InterconnectAttachmentName; +import com.google.cloud.compute.v1.InterconnectAttachmentSettings; +import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; +import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInterconnectAttachmentCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java new file mode 100644 index 000000000000..d81d4c25f33b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java @@ -0,0 +1,302 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.DeleteInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InterconnectAttachment; +import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import com.google.cloud.compute.v1.InterconnectAttachmentList; +import com.google.cloud.compute.v1.InterconnectAttachmentName; +import com.google.cloud.compute.v1.InterconnectAttachmentSettings; +import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; +import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListInterconnectAttachmentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/interconnectAttachments")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectAttachmentAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor deleteInterconnectAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(InterconnectAttachmentName.newFactory()) + .setResourceNameField("interconnectAttachment") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getInterconnectAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectAttachmentHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InterconnectAttachmentName.newFactory()) + .setResourceNameField("interconnectAttachment") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectAttachment.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertInterconnectAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInterconnectAttachmentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectAttachmentList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListInterconnectAttachmentsCallable; + private final UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable; + private final UnaryCallable deleteInterconnectAttachmentCallable; + private final UnaryCallable getInterconnectAttachmentCallable; + private final UnaryCallable insertInterconnectAttachmentCallable; + private final UnaryCallable listInterconnectAttachmentsCallable; + private final UnaryCallable listInterconnectAttachmentsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInterconnectAttachmentStub create(InterconnectAttachmentStubSettings settings) throws IOException { + return new HttpJsonInterconnectAttachmentStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInterconnectAttachmentStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInterconnectAttachmentStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInterconnectAttachmentStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInterconnectAttachmentCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInterconnectAttachmentStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListInterconnectAttachmentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListInterconnectAttachmentsMethodDescriptor) + .build(); + HttpJsonCallSettings deleteInterconnectAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInterconnectAttachmentMethodDescriptor) + .build(); + HttpJsonCallSettings getInterconnectAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInterconnectAttachmentMethodDescriptor) + .build(); + HttpJsonCallSettings insertInterconnectAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInterconnectAttachmentMethodDescriptor) + .build(); + HttpJsonCallSettings listInterconnectAttachmentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInterconnectAttachmentsMethodDescriptor) + .build(); + + this.aggregatedListInterconnectAttachmentsCallable = callableFactory.createUnaryCallable(aggregatedListInterconnectAttachmentsTransportSettings,settings.aggregatedListInterconnectAttachmentsSettings(), clientContext); + this.aggregatedListInterconnectAttachmentsPagedCallable = callableFactory.createPagedCallable(aggregatedListInterconnectAttachmentsTransportSettings,settings.aggregatedListInterconnectAttachmentsSettings(), clientContext); + this.deleteInterconnectAttachmentCallable = callableFactory.createUnaryCallable(deleteInterconnectAttachmentTransportSettings,settings.deleteInterconnectAttachmentSettings(), clientContext); + this.getInterconnectAttachmentCallable = callableFactory.createUnaryCallable(getInterconnectAttachmentTransportSettings,settings.getInterconnectAttachmentSettings(), clientContext); + this.insertInterconnectAttachmentCallable = callableFactory.createUnaryCallable(insertInterconnectAttachmentTransportSettings,settings.insertInterconnectAttachmentSettings(), clientContext); + this.listInterconnectAttachmentsCallable = callableFactory.createUnaryCallable(listInterconnectAttachmentsTransportSettings,settings.listInterconnectAttachmentsSettings(), clientContext); + this.listInterconnectAttachmentsPagedCallable = callableFactory.createPagedCallable(listInterconnectAttachmentsTransportSettings,settings.listInterconnectAttachmentsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable() { + return aggregatedListInterconnectAttachmentsPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListInterconnectAttachmentsCallable() { + return aggregatedListInterconnectAttachmentsCallable; + } + + @BetaApi + public UnaryCallable deleteInterconnectAttachmentCallable() { + return deleteInterconnectAttachmentCallable; + } + + @BetaApi + public UnaryCallable getInterconnectAttachmentCallable() { + return getInterconnectAttachmentCallable; + } + + @BetaApi + public UnaryCallable insertInterconnectAttachmentCallable() { + return insertInterconnectAttachmentCallable; + } + + @BetaApi + public UnaryCallable listInterconnectAttachmentsPagedCallable() { + return listInterconnectAttachmentsPagedCallable; + } + + @BetaApi + public UnaryCallable listInterconnectAttachmentsCallable() { + return listInterconnectAttachmentsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java new file mode 100644 index 000000000000..60465c5a1a7c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java @@ -0,0 +1,97 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; +import com.google.cloud.compute.v1.Interconnect; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.InterconnectName; +import com.google.cloud.compute.v1.InterconnectSettings; +import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInterconnectCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java new file mode 100644 index 000000000000..f6aba354e52c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; +import com.google.cloud.compute.v1.InterconnectLocation; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import com.google.cloud.compute.v1.InterconnectLocationList; +import com.google.cloud.compute.v1.InterconnectLocationName; +import com.google.cloud.compute.v1.InterconnectLocationSettings; +import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonInterconnectLocationCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java new file mode 100644 index 000000000000..40733fd9918b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java @@ -0,0 +1,194 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; +import com.google.cloud.compute.v1.InterconnectLocation; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import com.google.cloud.compute.v1.InterconnectLocationList; +import com.google.cloud.compute.v1.InterconnectLocationName; +import com.google.cloud.compute.v1.InterconnectLocationSettings; +import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { + @InternalApi + public static final ApiMethodDescriptor getInterconnectLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectLocations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectLocationHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnectLocations/{interconnectLocation}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InterconnectLocationName.newFactory()) + .setResourceNameField("interconnectLocation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectLocation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInterconnectLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectLocations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectLocationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnectLocations")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectLocationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getInterconnectLocationCallable; + private final UnaryCallable listInterconnectLocationsCallable; + private final UnaryCallable listInterconnectLocationsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInterconnectLocationStub create(InterconnectLocationStubSettings settings) throws IOException { + return new HttpJsonInterconnectLocationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInterconnectLocationStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInterconnectLocationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInterconnectLocationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInterconnectLocationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInterconnectLocationStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getInterconnectLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInterconnectLocationMethodDescriptor) + .build(); + HttpJsonCallSettings listInterconnectLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInterconnectLocationsMethodDescriptor) + .build(); + + this.getInterconnectLocationCallable = callableFactory.createUnaryCallable(getInterconnectLocationTransportSettings,settings.getInterconnectLocationSettings(), clientContext); + this.listInterconnectLocationsCallable = callableFactory.createUnaryCallable(listInterconnectLocationsTransportSettings,settings.listInterconnectLocationsSettings(), clientContext); + this.listInterconnectLocationsPagedCallable = callableFactory.createPagedCallable(listInterconnectLocationsTransportSettings,settings.listInterconnectLocationsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getInterconnectLocationCallable() { + return getInterconnectLocationCallable; + } + + @BetaApi + public UnaryCallable listInterconnectLocationsPagedCallable() { + return listInterconnectLocationsPagedCallable; + } + + @BetaApi + public UnaryCallable listInterconnectLocationsCallable() { + return listInterconnectLocationsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java new file mode 100644 index 000000000000..288c05ff237a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -0,0 +1,291 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; +import com.google.cloud.compute.v1.Interconnect; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.InterconnectName; +import com.google.cloud.compute.v1.InterconnectSettings; +import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonInterconnectStub extends InterconnectStub { + @InternalApi + public static final ApiMethodDescriptor deleteInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(InterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(InterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Interconnect.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listInterconnectsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor patchInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(InterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteInterconnectCallable; + private final UnaryCallable getInterconnectCallable; + private final UnaryCallable insertInterconnectCallable; + private final UnaryCallable listInterconnectsCallable; + private final UnaryCallable listInterconnectsPagedCallable; + private final UnaryCallable patchInterconnectCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonInterconnectStub create(InterconnectStubSettings settings) throws IOException { + return new HttpJsonInterconnectStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonInterconnectStub create(ClientContext clientContext) throws IOException { + return new HttpJsonInterconnectStub(InterconnectStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonInterconnectStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInterconnectStub(InterconnectStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonInterconnectStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInterconnectStub(InterconnectStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonInterconnectCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonInterconnectStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonInterconnectStub(InterconnectStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInterconnectMethodDescriptor) + .build(); + HttpJsonCallSettings getInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInterconnectMethodDescriptor) + .build(); + HttpJsonCallSettings insertInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInterconnectMethodDescriptor) + .build(); + HttpJsonCallSettings listInterconnectsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInterconnectsMethodDescriptor) + .build(); + HttpJsonCallSettings patchInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchInterconnectMethodDescriptor) + .build(); + + this.deleteInterconnectCallable = callableFactory.createUnaryCallable(deleteInterconnectTransportSettings,settings.deleteInterconnectSettings(), clientContext); + this.getInterconnectCallable = callableFactory.createUnaryCallable(getInterconnectTransportSettings,settings.getInterconnectSettings(), clientContext); + this.insertInterconnectCallable = callableFactory.createUnaryCallable(insertInterconnectTransportSettings,settings.insertInterconnectSettings(), clientContext); + this.listInterconnectsCallable = callableFactory.createUnaryCallable(listInterconnectsTransportSettings,settings.listInterconnectsSettings(), clientContext); + this.listInterconnectsPagedCallable = callableFactory.createPagedCallable(listInterconnectsTransportSettings,settings.listInterconnectsSettings(), clientContext); + this.patchInterconnectCallable = callableFactory.createUnaryCallable(patchInterconnectTransportSettings,settings.patchInterconnectSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteInterconnectCallable() { + return deleteInterconnectCallable; + } + + @BetaApi + public UnaryCallable getInterconnectCallable() { + return getInterconnectCallable; + } + + @BetaApi + public UnaryCallable insertInterconnectCallable() { + return insertInterconnectCallable; + } + + @BetaApi + public UnaryCallable listInterconnectsPagedCallable() { + return listInterconnectsPagedCallable; + } + + @BetaApi + public UnaryCallable listInterconnectsCallable() { + return listInterconnectsCallable; + } + + @BetaApi + public UnaryCallable patchInterconnectCallable() { + return patchInterconnectCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java new file mode 100644 index 000000000000..a8d78e8140a9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java @@ -0,0 +1,90 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicenseName; +import com.google.cloud.compute.v1.LicenseSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonLicenseCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java new file mode 100644 index 000000000000..52349aed1cbe --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -0,0 +1,152 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicenseName; +import com.google.cloud.compute.v1.LicenseSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonLicenseStub extends LicenseStub { + @InternalApi + public static final ApiMethodDescriptor getLicenseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetLicenseHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(LicenseName.newFactory()) + .setResourceNameField("license") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(License.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable getLicenseCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonLicenseStub create(LicenseStubSettings settings) throws IOException { + return new HttpJsonLicenseStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonLicenseStub create(ClientContext clientContext) throws IOException { + return new HttpJsonLicenseStub(LicenseStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonLicenseStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLicenseStub(LicenseStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonLicenseStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonLicenseStub(LicenseStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonLicenseCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonLicenseStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonLicenseStub(LicenseStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getLicenseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLicenseMethodDescriptor) + .build(); + + this.getLicenseCallable = callableFactory.createUnaryCallable(getLicenseTransportSettings,settings.getLicenseSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getLicenseCallable() { + return getLicenseCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java index e035188fd2e1..b8403327301a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java @@ -40,6 +40,7 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; import com.google.cloud.compute.v1.GetNetworkHttpRequest; import com.google.cloud.compute.v1.InsertNetworkHttpRequest; @@ -49,8 +50,12 @@ import com.google.cloud.compute.v1.NetworkList; import com.google.cloud.compute.v1.NetworkName; import com.google.cloud.compute.v1.NetworkSettings; +import com.google.cloud.compute.v1.NetworksAddPeeringRequest; +import com.google.cloud.compute.v1.NetworksRemovePeeringRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchNetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java index 793370d46202..88aa318bf939 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -29,6 +29,7 @@ import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; import com.google.cloud.compute.v1.GetNetworkHttpRequest; import com.google.cloud.compute.v1.InsertNetworkHttpRequest; @@ -38,8 +39,12 @@ import com.google.cloud.compute.v1.NetworkList; import com.google.cloud.compute.v1.NetworkName; import com.google.cloud.compute.v1.NetworkSettings; +import com.google.cloud.compute.v1.NetworksAddPeeringRequest; +import com.google.cloud.compute.v1.NetworksRemovePeeringRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchNetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; @@ -60,6 +65,26 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonNetworkStub extends NetworkStub { @InternalApi + public static final ApiMethodDescriptor addPeeringNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.addPeering") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddPeeringNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/addPeering")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(NetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor deleteNetworkMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.networks.delete") @@ -69,6 +94,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(NetworkName.newFactory()) .setResourceNameField("network") @@ -107,6 +133,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -137,6 +164,46 @@ public class HttpJsonNetworkStub extends NetworkStub { .build()) .build(); @InternalApi + public static final ApiMethodDescriptor patchNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(NetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor removePeeringNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.removePeering") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemovePeeringNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/removePeering")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(NetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor switchToCustomModeNetworkMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.networks.switchToCustomMode") @@ -146,6 +213,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/switchToCustomMode")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(NetworkName.newFactory()) .setResourceNameField("network") @@ -157,11 +225,14 @@ public class HttpJsonNetworkStub extends NetworkStub { .build(); private final BackgroundResource backgroundResources; + private final UnaryCallable addPeeringNetworkCallable; private final UnaryCallable deleteNetworkCallable; private final UnaryCallable getNetworkCallable; private final UnaryCallable insertNetworkCallable; private final UnaryCallable listNetworksCallable; private final UnaryCallable listNetworksPagedCallable; + private final UnaryCallable patchNetworkCallable; + private final UnaryCallable removePeeringNetworkCallable; private final UnaryCallable switchToCustomModeNetworkCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -194,6 +265,10 @@ protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext client protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + HttpJsonCallSettings addPeeringNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addPeeringNetworkMethodDescriptor) + .build(); HttpJsonCallSettings deleteNetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteNetworkMethodDescriptor) @@ -210,21 +285,37 @@ protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext client HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listNetworksMethodDescriptor) .build(); + HttpJsonCallSettings patchNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchNetworkMethodDescriptor) + .build(); + HttpJsonCallSettings removePeeringNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removePeeringNetworkMethodDescriptor) + .build(); HttpJsonCallSettings switchToCustomModeNetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(switchToCustomModeNetworkMethodDescriptor) .build(); + this.addPeeringNetworkCallable = callableFactory.createUnaryCallable(addPeeringNetworkTransportSettings,settings.addPeeringNetworkSettings(), clientContext); this.deleteNetworkCallable = callableFactory.createUnaryCallable(deleteNetworkTransportSettings,settings.deleteNetworkSettings(), clientContext); this.getNetworkCallable = callableFactory.createUnaryCallable(getNetworkTransportSettings,settings.getNetworkSettings(), clientContext); this.insertNetworkCallable = callableFactory.createUnaryCallable(insertNetworkTransportSettings,settings.insertNetworkSettings(), clientContext); this.listNetworksCallable = callableFactory.createUnaryCallable(listNetworksTransportSettings,settings.listNetworksSettings(), clientContext); this.listNetworksPagedCallable = callableFactory.createPagedCallable(listNetworksTransportSettings,settings.listNetworksSettings(), clientContext); + this.patchNetworkCallable = callableFactory.createUnaryCallable(patchNetworkTransportSettings,settings.patchNetworkSettings(), clientContext); + this.removePeeringNetworkCallable = callableFactory.createUnaryCallable(removePeeringNetworkTransportSettings,settings.removePeeringNetworkSettings(), clientContext); this.switchToCustomModeNetworkCallable = callableFactory.createUnaryCallable(switchToCustomModeNetworkTransportSettings,settings.switchToCustomModeNetworkSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } + @BetaApi + public UnaryCallable addPeeringNetworkCallable() { + return addPeeringNetworkCallable; + } + @BetaApi public UnaryCallable deleteNetworkCallable() { return deleteNetworkCallable; @@ -250,6 +341,16 @@ public UnaryCallable listNetworksCallable( return listNetworksCallable; } + @BetaApi + public UnaryCallable patchNetworkCallable() { + return patchNetworkCallable; + } + + @BetaApi + public UnaryCallable removePeeringNetworkCallable() { + return removePeeringNetworkCallable; + } + @BetaApi public UnaryCallable switchToCustomModeNetworkCallable() { return switchToCustomModeNetworkCallable; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java index 31ca3fe880da..acfa4b145233 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java @@ -40,19 +40,34 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest; +import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.DiskMoveRequest; +import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest; +import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.GetProjectHttpRequest; +import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest; +import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest; import com.google.cloud.compute.v1.InstanceMoveRequest; +import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest; import com.google.cloud.compute.v1.Metadata; import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Project; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectSettings; +import com.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; +import com.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; +import com.google.cloud.compute.v1.ProjectsGetXpnResources; +import com.google.cloud.compute.v1.ProjectsListXpnHostsRequest; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; import com.google.cloud.compute.v1.UsageExportLocation; +import com.google.cloud.compute.v1.XpnHostList; +import com.google.cloud.compute.v1.XpnResourceId; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index 3fe62a4578aa..a48b87db9f08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -29,19 +29,34 @@ import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest; +import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.DiskMoveRequest; +import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest; +import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.GetProjectHttpRequest; +import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest; +import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest; import com.google.cloud.compute.v1.InstanceMoveRequest; +import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest; import com.google.cloud.compute.v1.Metadata; import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Project; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectSettings; +import com.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; +import com.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; +import com.google.cloud.compute.v1.ProjectsGetXpnResources; +import com.google.cloud.compute.v1.ProjectsListXpnHostsRequest; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; import com.google.cloud.compute.v1.UsageExportLocation; +import com.google.cloud.compute.v1.XpnHostList; +import com.google.cloud.compute.v1.XpnResourceId; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; @@ -61,6 +76,86 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonProjectStub extends ProjectStub { @InternalApi + public static final ApiMethodDescriptor disableXpnHostProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.disableXpnHost") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DisableXpnHostProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/disableXpnHost")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor disableXpnResourceProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.disableXpnResource") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DisableXpnResourceProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/disableXpnResource")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor enableXpnHostProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.enableXpnHost") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(EnableXpnHostProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/enableXpnHost")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor enableXpnResourceProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.enableXpnResource") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(EnableXpnResourceProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/enableXpnResource")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getProjectMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.projects.get") @@ -80,6 +175,65 @@ public class HttpJsonProjectStub extends ProjectStub { .build()) .build(); @InternalApi + public static final ApiMethodDescriptor getXpnHostProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.getXpnHost") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetXpnHostProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/getXpnHost")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Project.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getXpnResourcesProjectsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.getXpnResources") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/getXpnResources")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "order_by", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ProjectsGetXpnResources.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listXpnHostsProjectsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.listXpnHosts") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListXpnHostsProjectsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/listXpnHosts")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "order_by", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(XpnHostList.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor moveDiskProjectMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.projects.moveDisk") @@ -89,6 +243,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveDisk")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -108,6 +263,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveInstance")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -127,6 +283,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestInstance(SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -146,6 +303,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestInstance(SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -157,7 +315,16 @@ public class HttpJsonProjectStub extends ProjectStub { .build(); private final BackgroundResource backgroundResources; + private final UnaryCallable disableXpnHostProjectCallable; + private final UnaryCallable disableXpnResourceProjectCallable; + private final UnaryCallable enableXpnHostProjectCallable; + private final UnaryCallable enableXpnResourceProjectCallable; private final UnaryCallable getProjectCallable; + private final UnaryCallable getXpnHostProjectCallable; + private final UnaryCallable getXpnResourcesProjectsCallable; + private final UnaryCallable getXpnResourcesProjectsPagedCallable; + private final UnaryCallable listXpnHostsProjectsCallable; + private final UnaryCallable listXpnHostsProjectsPagedCallable; private final UnaryCallable moveDiskProjectCallable; private final UnaryCallable moveInstanceProjectCallable; private final UnaryCallable setCommonInstanceMetadataProjectCallable; @@ -193,10 +360,38 @@ protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext client protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + HttpJsonCallSettings disableXpnHostProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableXpnHostProjectMethodDescriptor) + .build(); + HttpJsonCallSettings disableXpnResourceProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableXpnResourceProjectMethodDescriptor) + .build(); + HttpJsonCallSettings enableXpnHostProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableXpnHostProjectMethodDescriptor) + .build(); + HttpJsonCallSettings enableXpnResourceProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableXpnResourceProjectMethodDescriptor) + .build(); HttpJsonCallSettings getProjectTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getProjectMethodDescriptor) .build(); + HttpJsonCallSettings getXpnHostProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getXpnHostProjectMethodDescriptor) + .build(); + HttpJsonCallSettings getXpnResourcesProjectsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getXpnResourcesProjectsMethodDescriptor) + .build(); + HttpJsonCallSettings listXpnHostsProjectsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listXpnHostsProjectsMethodDescriptor) + .build(); HttpJsonCallSettings moveDiskProjectTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(moveDiskProjectMethodDescriptor) @@ -214,7 +409,16 @@ protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext client .setMethodDescriptor(setUsageExportBucketProjectMethodDescriptor) .build(); + this.disableXpnHostProjectCallable = callableFactory.createUnaryCallable(disableXpnHostProjectTransportSettings,settings.disableXpnHostProjectSettings(), clientContext); + this.disableXpnResourceProjectCallable = callableFactory.createUnaryCallable(disableXpnResourceProjectTransportSettings,settings.disableXpnResourceProjectSettings(), clientContext); + this.enableXpnHostProjectCallable = callableFactory.createUnaryCallable(enableXpnHostProjectTransportSettings,settings.enableXpnHostProjectSettings(), clientContext); + this.enableXpnResourceProjectCallable = callableFactory.createUnaryCallable(enableXpnResourceProjectTransportSettings,settings.enableXpnResourceProjectSettings(), clientContext); this.getProjectCallable = callableFactory.createUnaryCallable(getProjectTransportSettings,settings.getProjectSettings(), clientContext); + this.getXpnHostProjectCallable = callableFactory.createUnaryCallable(getXpnHostProjectTransportSettings,settings.getXpnHostProjectSettings(), clientContext); + this.getXpnResourcesProjectsCallable = callableFactory.createUnaryCallable(getXpnResourcesProjectsTransportSettings,settings.getXpnResourcesProjectsSettings(), clientContext); + this.getXpnResourcesProjectsPagedCallable = callableFactory.createPagedCallable(getXpnResourcesProjectsTransportSettings,settings.getXpnResourcesProjectsSettings(), clientContext); + this.listXpnHostsProjectsCallable = callableFactory.createUnaryCallable(listXpnHostsProjectsTransportSettings,settings.listXpnHostsProjectsSettings(), clientContext); + this.listXpnHostsProjectsPagedCallable = callableFactory.createPagedCallable(listXpnHostsProjectsTransportSettings,settings.listXpnHostsProjectsSettings(), clientContext); this.moveDiskProjectCallable = callableFactory.createUnaryCallable(moveDiskProjectTransportSettings,settings.moveDiskProjectSettings(), clientContext); this.moveInstanceProjectCallable = callableFactory.createUnaryCallable(moveInstanceProjectTransportSettings,settings.moveInstanceProjectSettings(), clientContext); this.setCommonInstanceMetadataProjectCallable = callableFactory.createUnaryCallable(setCommonInstanceMetadataProjectTransportSettings,settings.setCommonInstanceMetadataProjectSettings(), clientContext); @@ -223,11 +427,56 @@ protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext client backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } + @BetaApi + public UnaryCallable disableXpnHostProjectCallable() { + return disableXpnHostProjectCallable; + } + + @BetaApi + public UnaryCallable disableXpnResourceProjectCallable() { + return disableXpnResourceProjectCallable; + } + + @BetaApi + public UnaryCallable enableXpnHostProjectCallable() { + return enableXpnHostProjectCallable; + } + + @BetaApi + public UnaryCallable enableXpnResourceProjectCallable() { + return enableXpnResourceProjectCallable; + } + @BetaApi public UnaryCallable getProjectCallable() { return getProjectCallable; } + @BetaApi + public UnaryCallable getXpnHostProjectCallable() { + return getXpnHostProjectCallable; + } + + @BetaApi + public UnaryCallable getXpnResourcesProjectsPagedCallable() { + return getXpnResourcesProjectsPagedCallable; + } + + @BetaApi + public UnaryCallable getXpnResourcesProjectsCallable() { + return getXpnResourcesProjectsCallable; + } + + @BetaApi + public UnaryCallable listXpnHostsProjectsPagedCallable() { + return listXpnHostsProjectsPagedCallable; + } + + @BetaApi + public UnaryCallable listXpnHostsProjectsCallable() { + return listXpnHostsProjectsCallable; + } + @BetaApi public UnaryCallable moveDiskProjectCallable() { return moveDiskProjectCallable; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java index 92462d8cdbd1..a5edd12fdf0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -70,6 +70,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) .setResourceNameField("autoscaler") @@ -108,6 +109,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -147,7 +149,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet( - "autoscaler" + "autoscaler", "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -167,7 +169,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet( - "autoscaler" + "autoscaler", "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java index 237db578a029..0b8932b4676b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java @@ -15,15 +15,54 @@ */ package com.google.cloud.compute.v1.stub; +import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.BackendService; +import com.google.cloud.compute.v1.BackendServiceGroupHealth; +import com.google.cloud.compute.v1.BackendServiceList; +import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import com.google.cloud.compute.v1.RegionBackendServiceSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.ResourceGroupReference; +import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,18 +79,16 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -59,7 +96,6 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java index fa77a4123b2f..74cd83124995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -73,6 +73,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestInstance(DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) .setResourceNameField("backendService") @@ -130,6 +131,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestInstance(InsertRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -169,6 +171,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) .setResourceNameField("backendService") @@ -188,6 +191,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestInstance(UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) .setResourceNameField("backendService") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java index 3c7b493c70f1..ce7ecaa68e00 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java @@ -15,15 +15,47 @@ */ package com.google.cloud.compute.v1.stub; +import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetRegionHttpRequest; +import com.google.cloud.compute.v1.ListRegionsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.Region; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import com.google.cloud.compute.v1.RegionList; +import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.RegionSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,18 +72,16 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -59,7 +89,6 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java new file mode 100644 index 000000000000..67eacc9323cb --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java @@ -0,0 +1,100 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest; +import com.google.cloud.compute.v1.Commitment; +import com.google.cloud.compute.v1.CommitmentAggregatedList; +import com.google.cloud.compute.v1.CommitmentList; +import com.google.cloud.compute.v1.CommitmentName; +import com.google.cloud.compute.v1.CommitmentsScopedList; +import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest; +import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; +import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; +import com.google.cloud.compute.v1.RegionCommitmentSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionCommitmentCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java new file mode 100644 index 000000000000..7f1461bf6542 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java @@ -0,0 +1,270 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest; +import com.google.cloud.compute.v1.Commitment; +import com.google.cloud.compute.v1.CommitmentAggregatedList; +import com.google.cloud.compute.v1.CommitmentList; +import com.google.cloud.compute.v1.CommitmentName; +import com.google.cloud.compute.v1.CommitmentsScopedList; +import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest; +import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; +import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; +import com.google.cloud.compute.v1.RegionCommitmentSettings; +import com.google.cloud.compute.v1.RegionName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { + @InternalApi + public static final ApiMethodDescriptor aggregatedListRegionCommitmentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/commitments")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(CommitmentAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getRegionCommitmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionCommitmentHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments/{commitment}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(CommitmentName.newFactory()) + .setResourceNameField("commitment") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Commitment.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertRegionCommitmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionCommitmentHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listRegionCommitmentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionCommitmentsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(RegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(CommitmentList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable aggregatedListRegionCommitmentsCallable; + private final UnaryCallable aggregatedListRegionCommitmentsPagedCallable; + private final UnaryCallable getRegionCommitmentCallable; + private final UnaryCallable insertRegionCommitmentCallable; + private final UnaryCallable listRegionCommitmentsCallable; + private final UnaryCallable listRegionCommitmentsPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionCommitmentStub create(RegionCommitmentStubSettings settings) throws IOException { + return new HttpJsonRegionCommitmentStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionCommitmentStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionCommitmentStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionCommitmentStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionCommitmentCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionCommitmentStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings aggregatedListRegionCommitmentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListRegionCommitmentsMethodDescriptor) + .build(); + HttpJsonCallSettings getRegionCommitmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionCommitmentMethodDescriptor) + .build(); + HttpJsonCallSettings insertRegionCommitmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionCommitmentMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionCommitmentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionCommitmentsMethodDescriptor) + .build(); + + this.aggregatedListRegionCommitmentsCallable = callableFactory.createUnaryCallable(aggregatedListRegionCommitmentsTransportSettings,settings.aggregatedListRegionCommitmentsSettings(), clientContext); + this.aggregatedListRegionCommitmentsPagedCallable = callableFactory.createPagedCallable(aggregatedListRegionCommitmentsTransportSettings,settings.aggregatedListRegionCommitmentsSettings(), clientContext); + this.getRegionCommitmentCallable = callableFactory.createUnaryCallable(getRegionCommitmentTransportSettings,settings.getRegionCommitmentSettings(), clientContext); + this.insertRegionCommitmentCallable = callableFactory.createUnaryCallable(insertRegionCommitmentTransportSettings,settings.insertRegionCommitmentSettings(), clientContext); + this.listRegionCommitmentsCallable = callableFactory.createUnaryCallable(listRegionCommitmentsTransportSettings,settings.listRegionCommitmentsSettings(), clientContext); + this.listRegionCommitmentsPagedCallable = callableFactory.createPagedCallable(listRegionCommitmentsTransportSettings,settings.listRegionCommitmentsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable aggregatedListRegionCommitmentsPagedCallable() { + return aggregatedListRegionCommitmentsPagedCallable; + } + + @BetaApi + public UnaryCallable aggregatedListRegionCommitmentsCallable() { + return aggregatedListRegionCommitmentsCallable; + } + + @BetaApi + public UnaryCallable getRegionCommitmentCallable() { + return getRegionCommitmentCallable; + } + + @BetaApi + public UnaryCallable insertRegionCommitmentCallable() { + return insertRegionCommitmentCallable; + } + + @BetaApi + public UnaryCallable listRegionCommitmentsPagedCallable() { + return listRegionCommitmentsPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionCommitmentsCallable() { + return listRegionCommitmentsCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index df1bce025a37..cc5f86a0b7d0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -81,6 +81,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(AbandonInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -100,6 +101,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -119,6 +121,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -157,6 +160,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -216,6 +220,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -235,7 +240,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) .setQueryParams(Sets.newHashSet( - "size" + "requestId", "size" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -255,6 +260,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") @@ -274,6 +280,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestInstance(SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) .setResourceNameField("instanceGroupManager") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java index c7e077bd3953..02d93942d7ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -132,6 +132,7 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestInstance(SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) .setResourceNameField("instanceGroup") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index faf429b67f99..7bb53b6590f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -15,8 +15,6 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; - import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -28,6 +26,7 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteRouteHttpRequest; @@ -37,10 +36,16 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.Route; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; import com.google.cloud.compute.v1.RouteList; import com.google.cloud.compute.v1.RouteName; +import com.google.cloud.compute.v1.RouteSettings; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -54,25 +59,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRouteStub extends RouteStub { @InternalApi - public static final ApiMethodDescriptor - deleteRouteMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(RouteName.newFactory()) - .setResourceNameField("route") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor deleteRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(RouteName.newFactory()) + .setResourceNameField("route") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi public static final ApiMethodDescriptor getRouteMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -82,7 +87,8 @@ public class HttpJsonRouteStub extends RouteStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) - .setQueryParams(Sets.newHashSet()) + .setQueryParams(Sets.newHashSet( + )) .setResourceNameFactory(RouteName.newFactory()) .setResourceNameField("route") .build()) @@ -91,59 +97,55 @@ public class HttpJsonRouteStub extends RouteStub { .setResponseInstance(Route.getDefaultInstance()) .build()) .build(); - @InternalApi - public static final ApiMethodDescriptor - insertRouteMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor insertRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - listRoutesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes")) - .setQueryParams( - Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RouteList.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor listRoutesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouteList.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; private final UnaryCallable deleteRouteCallable; private final UnaryCallable getRouteCallable; private final UnaryCallable insertRouteCallable; private final UnaryCallable listRoutesCallable; - private final UnaryCallable - listRoutesPagedCallable; + private final UnaryCallable listRoutesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRouteStub create(RouteStubSettings settings) throws IOException { return new HttpJsonRouteStub(settings, ClientContext.create(settings)); } @@ -152,32 +154,25 @@ public static final HttpJsonRouteStub create(ClientContext clientContext) throws return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRouteStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRouteStub( - RouteStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRouteStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRouteStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. + * Constructs an instance of HttpJsonRouteStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) - throws IOException { + protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonRouteCallableFactory()); } /** - * Constructs an instance of HttpJsonRouteStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. + * Constructs an instance of HttpJsonRouteStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonRouteStub( - RouteStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { + protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteRouteTransportSettings = @@ -197,21 +192,11 @@ protected HttpJsonRouteStub( .setMethodDescriptor(listRoutesMethodDescriptor) .build(); - this.deleteRouteCallable = - callableFactory.createUnaryCallable( - deleteRouteTransportSettings, settings.deleteRouteSettings(), clientContext); - this.getRouteCallable = - callableFactory.createUnaryCallable( - getRouteTransportSettings, settings.getRouteSettings(), clientContext); - this.insertRouteCallable = - callableFactory.createUnaryCallable( - insertRouteTransportSettings, settings.insertRouteSettings(), clientContext); - this.listRoutesCallable = - callableFactory.createUnaryCallable( - listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); - this.listRoutesPagedCallable = - callableFactory.createPagedCallable( - listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); + this.deleteRouteCallable = callableFactory.createUnaryCallable(deleteRouteTransportSettings,settings.deleteRouteSettings(), clientContext); + this.getRouteCallable = callableFactory.createUnaryCallable(getRouteTransportSettings,settings.getRouteSettings(), clientContext); + this.insertRouteCallable = callableFactory.createUnaryCallable(insertRouteTransportSettings,settings.insertRouteSettings(), clientContext); + this.listRoutesCallable = callableFactory.createUnaryCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); + this.listRoutesPagedCallable = callableFactory.createPagedCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -270,4 +255,5 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index bebdcdb85a25..18a36c10fefe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -99,6 +99,7 @@ public class HttpJsonRouterStub extends RouterStub { .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RouterName.newFactory()) .setResourceNameField("router") @@ -156,6 +157,7 @@ public class HttpJsonRouterStub extends RouterStub { .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -195,6 +197,7 @@ public class HttpJsonRouterStub extends RouterStub { .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RouterName.newFactory()) .setResourceNameField("router") @@ -233,6 +236,7 @@ public class HttpJsonRouterStub extends RouterStub { .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RouterName.newFactory()) .setResourceNameField("router") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java index 599733850786..e8dfc05ce3fb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java @@ -15,15 +15,51 @@ */ package com.google.cloud.compute.v1.stub; +import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.GlobalSetLabelsRequest; +import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectSnapshotName; +import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; +import com.google.cloud.compute.v1.Snapshot; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.SnapshotName; +import com.google.cloud.compute.v1.SnapshotSettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,18 +76,16 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -59,7 +93,6 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 32fc3592b974..6c648fccfc37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -31,9 +31,12 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectSnapshotName; +import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; @@ -67,6 +70,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(SnapshotName.newFactory()) .setResourceNameField("snapshot") @@ -115,12 +119,32 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setResponseInstance(SnapshotList.getDefaultInstance()) .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor setLabelsSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsSnapshotHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(ProjectSnapshotName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; private final UnaryCallable deleteSnapshotCallable; private final UnaryCallable getSnapshotCallable; private final UnaryCallable listSnapshotsCallable; private final UnaryCallable listSnapshotsPagedCallable; + private final UnaryCallable setLabelsSnapshotCallable; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonSnapshotStub create(SnapshotStubSettings settings) throws IOException { @@ -164,11 +188,16 @@ protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) .build(); + HttpJsonCallSettings setLabelsSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsSnapshotMethodDescriptor) + .build(); this.deleteSnapshotCallable = callableFactory.createUnaryCallable(deleteSnapshotTransportSettings,settings.deleteSnapshotSettings(), clientContext); this.getSnapshotCallable = callableFactory.createUnaryCallable(getSnapshotTransportSettings,settings.getSnapshotSettings(), clientContext); this.listSnapshotsCallable = callableFactory.createUnaryCallable(listSnapshotsTransportSettings,settings.listSnapshotsSettings(), clientContext); this.listSnapshotsPagedCallable = callableFactory.createPagedCallable(listSnapshotsTransportSettings,settings.listSnapshotsSettings(), clientContext); + this.setLabelsSnapshotCallable = callableFactory.createUnaryCallable(setLabelsSnapshotTransportSettings,settings.setLabelsSnapshotSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -193,6 +222,11 @@ public UnaryCallable listSnapshotsCallab return listSnapshotsCallable; } + @BetaApi + public UnaryCallable setLabelsSnapshotCallable() { + return setLabelsSnapshotCallable; + } + @Override public final void close() throws Exception { shutdown(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java index c53686e259dc..204a4671c6c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -68,6 +68,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(SslCertificateName.newFactory()) .setResourceNameField("sslCertificate") @@ -106,6 +107,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java index efa57a8f71f3..6494d889a56f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java @@ -47,8 +47,10 @@ import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; @@ -58,6 +60,7 @@ import com.google.cloud.compute.v1.SubnetworkSettings; import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index f8c83c67ac1f..840bc96b3891 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -36,8 +36,10 @@ import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; @@ -47,6 +49,7 @@ import com.google.cloud.compute.v1.SubnetworkSettings; import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; @@ -95,6 +98,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(SubnetworkName.newFactory()) .setResourceNameField("subnetwork") @@ -114,6 +118,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestInstance(ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(SubnetworkName.newFactory()) .setResourceNameField("subnetwork") @@ -152,6 +157,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -181,6 +187,46 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setResponseInstance(SubnetworkList.getDefaultInstance()) .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor patchSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(SubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setPrivateIpGoogleAccessSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.setPrivateIpGoogleAccess") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(SubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; private final UnaryCallable aggregatedListSubnetworksCallable; @@ -191,6 +237,8 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { private final UnaryCallable insertSubnetworkCallable; private final UnaryCallable listSubnetworksCallable; private final UnaryCallable listSubnetworksPagedCallable; + private final UnaryCallable patchSubnetworkCallable; + private final UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonSubnetworkStub create(SubnetworkStubSettings settings) throws IOException { @@ -246,6 +294,14 @@ protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSubnetworksMethodDescriptor) .build(); + HttpJsonCallSettings patchSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchSubnetworkMethodDescriptor) + .build(); + HttpJsonCallSettings setPrivateIpGoogleAccessSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setPrivateIpGoogleAccessSubnetworkMethodDescriptor) + .build(); this.aggregatedListSubnetworksCallable = callableFactory.createUnaryCallable(aggregatedListSubnetworksTransportSettings,settings.aggregatedListSubnetworksSettings(), clientContext); this.aggregatedListSubnetworksPagedCallable = callableFactory.createPagedCallable(aggregatedListSubnetworksTransportSettings,settings.aggregatedListSubnetworksSettings(), clientContext); @@ -255,6 +311,8 @@ protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext this.insertSubnetworkCallable = callableFactory.createUnaryCallable(insertSubnetworkTransportSettings,settings.insertSubnetworkSettings(), clientContext); this.listSubnetworksCallable = callableFactory.createUnaryCallable(listSubnetworksTransportSettings,settings.listSubnetworksSettings(), clientContext); this.listSubnetworksPagedCallable = callableFactory.createPagedCallable(listSubnetworksTransportSettings,settings.listSubnetworksSettings(), clientContext); + this.patchSubnetworkCallable = callableFactory.createUnaryCallable(patchSubnetworkTransportSettings,settings.patchSubnetworkSettings(), clientContext); + this.setPrivateIpGoogleAccessSubnetworkCallable = callableFactory.createUnaryCallable(setPrivateIpGoogleAccessSubnetworkTransportSettings,settings.setPrivateIpGoogleAccessSubnetworkSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -299,6 +357,16 @@ public UnaryCallable listSubnetworks return listSubnetworksCallable; } + @BetaApi + public UnaryCallable patchSubnetworkCallable() { + return patchSubnetworkCallable; + } + + @BetaApi + public UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { + return setPrivateIpGoogleAccessSubnetworkCallable; + } + @Override public final void close() throws Exception { shutdown(); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java index 1ff6fa3de2be..bda7b730d96f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -70,6 +70,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies/{targetHttpProxy}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetHttpProxyName.newFactory()) .setResourceNameField("targetHttpProxy") @@ -108,6 +109,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -147,6 +149,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetHttpProxyName.newFactory()) .setResourceNameField("targetHttpProxy") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index a0051ca3599b..d58c952bc385 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -72,6 +72,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies/{targetHttpsProxy}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetHttpsProxyName.newFactory()) .setResourceNameField("targetHttpsProxy") @@ -110,6 +111,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ProjectName.newFactory()) .setResourceNameField("project") @@ -149,6 +151,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestInstance(SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetHttpsProxyName.newFactory()) .setResourceNameField("targetHttpsProxy") @@ -168,6 +171,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetHttpsProxyName.newFactory()) .setResourceNameField("targetHttpsProxy") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java index 6b35676e76ed..1c5b327f24d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -93,6 +93,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances/{targetInstance}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetInstanceName.newFactory()) .setResourceNameField("targetInstance") @@ -131,6 +132,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(ZoneName.newFactory()) .setResourceNameField("zone") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java index 2c9b4229d931..86182101cbfc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -86,6 +86,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetPoolName.newFactory()) .setResourceNameField("targetPool") @@ -105,6 +106,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/addInstance")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetPoolName.newFactory()) .setResourceNameField("targetPool") @@ -144,6 +146,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetPoolName.newFactory()) .setResourceNameField("targetPool") @@ -201,6 +204,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") @@ -240,6 +244,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetPoolName.newFactory()) .setResourceNameField("targetPool") @@ -259,6 +264,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetPoolName.newFactory()) .setResourceNameField("targetPool") @@ -278,7 +284,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/setBackup")) .setQueryParams(Sets.newHashSet( - "failoverRatio" + "failoverRatio", "requestId" )) .setResourceNameFactory(TargetPoolName.newFactory()) .setResourceNameField("targetPool") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index 0c6bcf30299a..746448a68fd5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -15,8 +15,6 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; - import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -28,6 +26,7 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; @@ -39,11 +38,20 @@ import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; import com.google.cloud.compute.v1.TargetSslProxy; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; import com.google.cloud.compute.v1.TargetSslProxyList; import com.google.cloud.compute.v1.TargetSslProxyName; +import com.google.cloud.compute.v1.TargetSslProxySettings; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -57,297 +65,222 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { @InternalApi - public static final ApiMethodDescriptor - deleteTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor deleteTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - getTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetSslProxy.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor getTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxy.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - insertTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor insertTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - listTargetSslProxiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) - .setQueryParams( - Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetSslProxyList.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor listTargetSslProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxyList.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - setBackendServiceTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setBackendService") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter - .newBuilder() - .setRequestInstance( - SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create( - "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor setBackendServiceTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setBackendService") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - setProxyHeaderTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setProxyHeader") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter - .newBuilder() - .setRequestInstance( - SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create( - "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor setProxyHeaderTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setProxyHeader") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - setSslCertificatesTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setSslCertificates") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter - .newBuilder() - .setRequestInstance( - SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create( - "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(TargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor setSslCertificatesTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setSslCertificates") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; - private final UnaryCallable - deleteTargetSslProxyCallable; - private final UnaryCallable - getTargetSslProxyCallable; - private final UnaryCallable - insertTargetSslProxyCallable; - private final UnaryCallable - listTargetSslProxiesCallable; - private final UnaryCallable - listTargetSslProxiesPagedCallable; - private final UnaryCallable - setBackendServiceTargetSslProxyCallable; - private final UnaryCallable - setProxyHeaderTargetSslProxyCallable; - private final UnaryCallable - setSslCertificatesTargetSslProxyCallable; + private final UnaryCallable deleteTargetSslProxyCallable; + private final UnaryCallable getTargetSslProxyCallable; + private final UnaryCallable insertTargetSslProxyCallable; + private final UnaryCallable listTargetSslProxiesCallable; + private final UnaryCallable listTargetSslProxiesPagedCallable; + private final UnaryCallable setBackendServiceTargetSslProxyCallable; + private final UnaryCallable setProxyHeaderTargetSslProxyCallable; + private final UnaryCallable setSslCertificatesTargetSslProxyCallable; private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) - throws IOException { + public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) throws IOException { return new HttpJsonTargetSslProxyStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonTargetSslProxyStub( - TargetSslProxyStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetSslProxyStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetSslProxyStub( - TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonTargetSslProxyStub( - TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetSslProxyCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonTargetSslProxyStub( - TargetSslProxyStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { + protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings - deleteTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings - getTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings - insertTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings - listTargetSslProxiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) - .build(); - HttpJsonCallSettings - setBackendServiceTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings - setProxyHeaderTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings - setSslCertificatesTargetSslProxyTransportSettings = - HttpJsonCallSettings - .newBuilder() - .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) - .build(); - - this.deleteTargetSslProxyCallable = - callableFactory.createUnaryCallable( - deleteTargetSslProxyTransportSettings, - settings.deleteTargetSslProxySettings(), - clientContext); - this.getTargetSslProxyCallable = - callableFactory.createUnaryCallable( - getTargetSslProxyTransportSettings, - settings.getTargetSslProxySettings(), - clientContext); - this.insertTargetSslProxyCallable = - callableFactory.createUnaryCallable( - insertTargetSslProxyTransportSettings, - settings.insertTargetSslProxySettings(), - clientContext); - this.listTargetSslProxiesCallable = - callableFactory.createUnaryCallable( - listTargetSslProxiesTransportSettings, - settings.listTargetSslProxiesSettings(), - clientContext); - this.listTargetSslProxiesPagedCallable = - callableFactory.createPagedCallable( - listTargetSslProxiesTransportSettings, - settings.listTargetSslProxiesSettings(), - clientContext); - this.setBackendServiceTargetSslProxyCallable = - callableFactory.createUnaryCallable( - setBackendServiceTargetSslProxyTransportSettings, - settings.setBackendServiceTargetSslProxySettings(), - clientContext); - this.setProxyHeaderTargetSslProxyCallable = - callableFactory.createUnaryCallable( - setProxyHeaderTargetSslProxyTransportSettings, - settings.setProxyHeaderTargetSslProxySettings(), - clientContext); - this.setSslCertificatesTargetSslProxyCallable = - callableFactory.createUnaryCallable( - setSslCertificatesTargetSslProxyTransportSettings, - settings.setSslCertificatesTargetSslProxySettings(), - clientContext); + HttpJsonCallSettings deleteTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetSslProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings setBackendServiceTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings setProxyHeaderTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings setSslCertificatesTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) + .build(); + + this.deleteTargetSslProxyCallable = callableFactory.createUnaryCallable(deleteTargetSslProxyTransportSettings,settings.deleteTargetSslProxySettings(), clientContext); + this.getTargetSslProxyCallable = callableFactory.createUnaryCallable(getTargetSslProxyTransportSettings,settings.getTargetSslProxySettings(), clientContext); + this.insertTargetSslProxyCallable = callableFactory.createUnaryCallable(insertTargetSslProxyTransportSettings,settings.insertTargetSslProxySettings(), clientContext); + this.listTargetSslProxiesCallable = callableFactory.createUnaryCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); + this.listTargetSslProxiesPagedCallable = callableFactory.createPagedCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); + this.setBackendServiceTargetSslProxyCallable = callableFactory.createUnaryCallable(setBackendServiceTargetSslProxyTransportSettings,settings.setBackendServiceTargetSslProxySettings(), clientContext); + this.setProxyHeaderTargetSslProxyCallable = callableFactory.createUnaryCallable(setProxyHeaderTargetSslProxyTransportSettings,settings.setProxyHeaderTargetSslProxySettings(), clientContext); + this.setSslCertificatesTargetSslProxyCallable = callableFactory.createUnaryCallable(setSslCertificatesTargetSslProxyTransportSettings,settings.setSslCertificatesTargetSslProxySettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -368,32 +301,27 @@ public UnaryCallable insertTargetSsl } @BetaApi - public UnaryCallable - listTargetSslProxiesPagedCallable() { + public UnaryCallable listTargetSslProxiesPagedCallable() { return listTargetSslProxiesPagedCallable; } @BetaApi - public UnaryCallable - listTargetSslProxiesCallable() { + public UnaryCallable listTargetSslProxiesCallable() { return listTargetSslProxiesCallable; } @BetaApi - public UnaryCallable - setBackendServiceTargetSslProxyCallable() { + public UnaryCallable setBackendServiceTargetSslProxyCallable() { return setBackendServiceTargetSslProxyCallable; } @BetaApi - public UnaryCallable - setProxyHeaderTargetSslProxyCallable() { + public UnaryCallable setProxyHeaderTargetSslProxyCallable() { return setProxyHeaderTargetSslProxyCallable; } @BetaApi - public UnaryCallable - setSslCertificatesTargetSslProxyCallable() { + public UnaryCallable setSslCertificatesTargetSslProxyCallable() { return setSslCertificatesTargetSslProxyCallable; } @@ -426,4 +354,5 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java new file mode 100644 index 000000000000..536e9d64bda1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java @@ -0,0 +1,100 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetTcpProxy; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetTcpProxyList; +import com.google.cloud.compute.v1.TargetTcpProxyName; +import com.google.cloud.compute.v1.TargetTcpProxySettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonTargetTcpProxyCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java new file mode 100644 index 000000000000..c56474fd61c6 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java @@ -0,0 +1,325 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetTcpProxy; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetTcpProxyList; +import com.google.cloud.compute.v1.TargetTcpProxyName; +import com.google.cloud.compute.v1.TargetTcpProxySettings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { + @InternalApi + public static final ApiMethodDescriptor deleteTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor getTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(TargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetTcpProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor insertTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor listTargetTcpProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetTcpProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetTcpProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setBackendServiceTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.setBackendService") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi + public static final ApiMethodDescriptor setProxyHeaderTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.setProxyHeader") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(TargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteTargetTcpProxyCallable; + private final UnaryCallable getTargetTcpProxyCallable; + private final UnaryCallable insertTargetTcpProxyCallable; + private final UnaryCallable listTargetTcpProxiesCallable; + private final UnaryCallable listTargetTcpProxiesPagedCallable; + private final UnaryCallable setBackendServiceTargetTcpProxyCallable; + private final UnaryCallable setProxyHeaderTargetTcpProxyCallable; + + private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonTargetTcpProxyStub create(TargetTcpProxyStubSettings settings) throws IOException { + return new HttpJsonTargetTcpProxyStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTargetTcpProxyStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonTargetTcpProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTargetTcpProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonTargetTcpProxyCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTargetTcpProxyStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings getTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings insertTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings listTargetTcpProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetTcpProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings setBackendServiceTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackendServiceTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings setProxyHeaderTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setProxyHeaderTargetTcpProxyMethodDescriptor) + .build(); + + this.deleteTargetTcpProxyCallable = callableFactory.createUnaryCallable(deleteTargetTcpProxyTransportSettings,settings.deleteTargetTcpProxySettings(), clientContext); + this.getTargetTcpProxyCallable = callableFactory.createUnaryCallable(getTargetTcpProxyTransportSettings,settings.getTargetTcpProxySettings(), clientContext); + this.insertTargetTcpProxyCallable = callableFactory.createUnaryCallable(insertTargetTcpProxyTransportSettings,settings.insertTargetTcpProxySettings(), clientContext); + this.listTargetTcpProxiesCallable = callableFactory.createUnaryCallable(listTargetTcpProxiesTransportSettings,settings.listTargetTcpProxiesSettings(), clientContext); + this.listTargetTcpProxiesPagedCallable = callableFactory.createPagedCallable(listTargetTcpProxiesTransportSettings,settings.listTargetTcpProxiesSettings(), clientContext); + this.setBackendServiceTargetTcpProxyCallable = callableFactory.createUnaryCallable(setBackendServiceTargetTcpProxyTransportSettings,settings.setBackendServiceTargetTcpProxySettings(), clientContext); + this.setProxyHeaderTargetTcpProxyCallable = callableFactory.createUnaryCallable(setProxyHeaderTargetTcpProxyTransportSettings,settings.setProxyHeaderTargetTcpProxySettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteTargetTcpProxyCallable() { + return deleteTargetTcpProxyCallable; + } + + @BetaApi + public UnaryCallable getTargetTcpProxyCallable() { + return getTargetTcpProxyCallable; + } + + @BetaApi + public UnaryCallable insertTargetTcpProxyCallable() { + return insertTargetTcpProxyCallable; + } + + @BetaApi + public UnaryCallable listTargetTcpProxiesPagedCallable() { + return listTargetTcpProxiesPagedCallable; + } + + @BetaApi + public UnaryCallable listTargetTcpProxiesCallable() { + return listTargetTcpProxiesCallable; + } + + @BetaApi + public UnaryCallable setBackendServiceTargetTcpProxyCallable() { + return setBackendServiceTargetTcpProxyCallable; + } + + @BetaApi + public UnaryCallable setProxyHeaderTargetTcpProxyCallable() { + return setProxyHeaderTargetTcpProxyCallable; + } + + @Override + public final void close() throws Exception { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java index 72d70a811a1a..63bdda81e43b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -93,6 +93,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(TargetVpnGatewayName.newFactory()) .setResourceNameField("targetVpnGateway") @@ -131,6 +132,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index 0289f799924c..3e4ea51b2baa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -15,8 +15,6 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; - import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -28,8 +26,10 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.CacheInvalidationRule; import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; import com.google.cloud.compute.v1.GetUrlMapHttpRequest; import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; @@ -40,12 +40,19 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; import com.google.cloud.compute.v1.UrlMap; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; import com.google.cloud.compute.v1.UrlMapList; import com.google.cloud.compute.v1.UrlMapName; +import com.google.cloud.compute.v1.UrlMapSettings; +import com.google.cloud.compute.v1.UrlMapsValidateRequest; import com.google.cloud.compute.v1.UrlMapsValidateResponse; import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,25 +66,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonUrlMapStub extends UrlMapStub { @InternalApi - public static final ApiMethodDescriptor - deleteUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor deleteUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi public static final ApiMethodDescriptor getUrlMapMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -87,7 +94,8 @@ public class HttpJsonUrlMapStub extends UrlMapStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet()) + .setQueryParams(Sets.newHashSet( + )) .setResourceNameFactory(UrlMapName.newFactory()) .setResourceNameField("urlMap") .build()) @@ -96,147 +104,138 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setResponseInstance(UrlMap.getDefaultInstance()) .build()) .build(); - @InternalApi - public static final ApiMethodDescriptor - insertUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor insertUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - invalidateCacheUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.invalidateCache") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor invalidateCacheUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.invalidateCache") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - listUrlMapsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) - .setQueryParams( - Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(UrlMapList.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor listUrlMapsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams(Sets.newHashSet( + "filter", "maxResults", "orderBy", "pageToken" + )) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapList.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - patchUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor patchUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - updateUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor updateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet( + "requestId" + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); @InternalApi - public static final ApiMethodDescriptor - validateUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.validate") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate( - PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) - .setQueryParams(Sets.newHashSet()) - .setResourceNameFactory(UrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) - .build()) - .build(); - + public static final ApiMethodDescriptor validateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.validate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) + .setQueryParams(Sets.newHashSet( + )) + .setResourceNameFactory(UrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) + .build()) + .build(); private final BackgroundResource backgroundResources; private final UnaryCallable deleteUrlMapCallable; private final UnaryCallable getUrlMapCallable; private final UnaryCallable insertUrlMapCallable; - private final UnaryCallable - invalidateCacheUrlMapCallable; + private final UnaryCallable invalidateCacheUrlMapCallable; private final UnaryCallable listUrlMapsCallable; - private final UnaryCallable - listUrlMapsPagedCallable; + private final UnaryCallable listUrlMapsPagedCallable; private final UnaryCallable patchUrlMapCallable; private final UnaryCallable updateUrlMapCallable; - private final UnaryCallable - validateUrlMapCallable; + private final UnaryCallable validateUrlMapCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonUrlMapStub create(UrlMapStubSettings settings) throws IOException { return new HttpJsonUrlMapStub(settings, ClientContext.create(settings)); } @@ -245,32 +244,25 @@ public static final HttpJsonUrlMapStub create(ClientContext clientContext) throw return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonUrlMapStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonUrlMapStub( - UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonUrlMapStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonUrlMapStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) - throws IOException { + protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonUrlMapCallableFactory()); } /** - * Constructs an instance of HttpJsonUrlMapStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - protected HttpJsonUrlMapStub( - UrlMapStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { + protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteUrlMapTransportSettings = @@ -285,11 +277,10 @@ protected HttpJsonUrlMapStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertUrlMapMethodDescriptor) .build(); - HttpJsonCallSettings - invalidateCacheUrlMapTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) - .build(); + HttpJsonCallSettings invalidateCacheUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) + .build(); HttpJsonCallSettings listUrlMapsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listUrlMapsMethodDescriptor) @@ -302,41 +293,20 @@ protected HttpJsonUrlMapStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateUrlMapMethodDescriptor) .build(); - HttpJsonCallSettings - validateUrlMapTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(validateUrlMapMethodDescriptor) - .build(); + HttpJsonCallSettings validateUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(validateUrlMapMethodDescriptor) + .build(); - this.deleteUrlMapCallable = - callableFactory.createUnaryCallable( - deleteUrlMapTransportSettings, settings.deleteUrlMapSettings(), clientContext); - this.getUrlMapCallable = - callableFactory.createUnaryCallable( - getUrlMapTransportSettings, settings.getUrlMapSettings(), clientContext); - this.insertUrlMapCallable = - callableFactory.createUnaryCallable( - insertUrlMapTransportSettings, settings.insertUrlMapSettings(), clientContext); - this.invalidateCacheUrlMapCallable = - callableFactory.createUnaryCallable( - invalidateCacheUrlMapTransportSettings, - settings.invalidateCacheUrlMapSettings(), - clientContext); - this.listUrlMapsCallable = - callableFactory.createUnaryCallable( - listUrlMapsTransportSettings, settings.listUrlMapsSettings(), clientContext); - this.listUrlMapsPagedCallable = - callableFactory.createPagedCallable( - listUrlMapsTransportSettings, settings.listUrlMapsSettings(), clientContext); - this.patchUrlMapCallable = - callableFactory.createUnaryCallable( - patchUrlMapTransportSettings, settings.patchUrlMapSettings(), clientContext); - this.updateUrlMapCallable = - callableFactory.createUnaryCallable( - updateUrlMapTransportSettings, settings.updateUrlMapSettings(), clientContext); - this.validateUrlMapCallable = - callableFactory.createUnaryCallable( - validateUrlMapTransportSettings, settings.validateUrlMapSettings(), clientContext); + this.deleteUrlMapCallable = callableFactory.createUnaryCallable(deleteUrlMapTransportSettings,settings.deleteUrlMapSettings(), clientContext); + this.getUrlMapCallable = callableFactory.createUnaryCallable(getUrlMapTransportSettings,settings.getUrlMapSettings(), clientContext); + this.insertUrlMapCallable = callableFactory.createUnaryCallable(insertUrlMapTransportSettings,settings.insertUrlMapSettings(), clientContext); + this.invalidateCacheUrlMapCallable = callableFactory.createUnaryCallable(invalidateCacheUrlMapTransportSettings,settings.invalidateCacheUrlMapSettings(), clientContext); + this.listUrlMapsCallable = callableFactory.createUnaryCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); + this.listUrlMapsPagedCallable = callableFactory.createPagedCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); + this.patchUrlMapCallable = callableFactory.createUnaryCallable(patchUrlMapTransportSettings,settings.patchUrlMapSettings(), clientContext); + this.updateUrlMapCallable = callableFactory.createUnaryCallable(updateUrlMapTransportSettings,settings.updateUrlMapSettings(), clientContext); + this.validateUrlMapCallable = callableFactory.createUnaryCallable(validateUrlMapTransportSettings,settings.validateUrlMapSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -357,14 +327,12 @@ public UnaryCallable insertUrlMapCallable() } @BetaApi - public UnaryCallable - invalidateCacheUrlMapCallable() { + public UnaryCallable invalidateCacheUrlMapCallable() { return invalidateCacheUrlMapCallable; } @BetaApi - public UnaryCallable - listUrlMapsPagedCallable() { + public UnaryCallable listUrlMapsPagedCallable() { return listUrlMapsPagedCallable; } @@ -384,8 +352,7 @@ public UnaryCallable updateUrlMapCallable() } @BetaApi - public UnaryCallable - validateUrlMapCallable() { + public UnaryCallable validateUrlMapCallable() { return validateUrlMapCallable; } @@ -418,4 +385,5 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java index 303a85fdf7ca..6f2bde9206e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -93,6 +93,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(VpnTunnelName.newFactory()) .setResourceNameField("vpnTunnel") @@ -131,6 +132,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams(Sets.newHashSet( + "requestId" )) .setResourceNameFactory(RegionName.newFactory()) .setResourceNameField("region") diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index b33901fdfc9f..ab60bba1ebd6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -15,19 +15,20 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; - import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpsHealthCheck; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpsHealthCheckList; +import com.google.cloud.compute.v1.HttpsHealthCheckName; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; +import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; import javax.annotation.Generated; @@ -41,46 +42,40 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HttpsHealthCheckStub implements BackgroundResource { + @BetaApi - public UnaryCallable - deleteHttpsHealthCheckCallable() { + public UnaryCallable deleteHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: deleteHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable - getHttpsHealthCheckCallable() { + public UnaryCallable getHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable - insertHttpsHealthCheckCallable() { + public UnaryCallable insertHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: insertHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable - listHttpsHealthChecksPagedCallable() { - throw new UnsupportedOperationException( - "Not implemented: listHttpsHealthChecksPagedCallable()"); + public UnaryCallable listHttpsHealthChecksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksPagedCallable()"); } @BetaApi - public UnaryCallable - listHttpsHealthChecksCallable() { + public UnaryCallable listHttpsHealthChecksCallable() { throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksCallable()"); } @BetaApi - public UnaryCallable - patchHttpsHealthCheckCallable() { + public UnaryCallable patchHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: patchHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable - updateHttpsHealthCheckCallable() { + public UnaryCallable updateHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: updateHttpsHealthCheckCallable()"); } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java index c1ab2fe9f40c..821f0fb5493c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java @@ -24,6 +24,7 @@ import com.google.cloud.compute.v1.FamilyName; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; +import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.Image; import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; @@ -31,7 +32,9 @@ import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectImageName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -80,4 +83,9 @@ public UnaryCallable listImagesCallable() { throw new UnsupportedOperationException("Not implemented: listImagesCallable()"); } + @BetaApi + public UnaryCallable setLabelsImageCallable() { + throw new UnsupportedOperationException("Not implemented: setLabelsImageCallable()"); + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java index 51545db1b581..3889901a96e0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; - import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,6 +30,8 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -39,21 +41,26 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; import com.google.cloud.compute.v1.Image; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -64,15 +71,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default - * port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteImage to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteImage to 30 seconds: * *

  * 
@@ -87,56 +94,76 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ImageStubSettings extends StubSettings {
-  /** The default scopes of the service. */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
-      ImmutableList.builder()
-          .add("https://www.googleapis.com/auth/cloud-platform")
-          .add("https://www.googleapis.com/auth/compute")
-          .add("https://www.googleapis.com/auth/compute.readonly")
-          .add("https://www.googleapis.com/auth/devstorage.full_control")
-          .add("https://www.googleapis.com/auth/devstorage.read_only")
-          .add("https://www.googleapis.com/auth/devstorage.read_write")
-          .build();
+  /**
+   * The default scopes of the service.
+   */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
+      .add("https://www.googleapis.com/auth/cloud-platform")
+      .add("https://www.googleapis.com/auth/compute")
+      .add("https://www.googleapis.com/auth/compute.readonly")
+      .add("https://www.googleapis.com/auth/devstorage.full_control")
+      .add("https://www.googleapis.com/auth/devstorage.read_only")
+      .add("https://www.googleapis.com/auth/devstorage.read_write")
+      .build();
 
   private final UnaryCallSettings deleteImageSettings;
   private final UnaryCallSettings deprecateImageSettings;
   private final UnaryCallSettings getImageSettings;
   private final UnaryCallSettings getFromFamilyImageSettings;
   private final UnaryCallSettings insertImageSettings;
-  private final PagedCallSettings
-      listImagesSettings;
+  private final PagedCallSettings listImagesSettings;
+  private final UnaryCallSettings setLabelsImageSettings;
 
-  /** Returns the object with the settings used for calls to deleteImage. */
+  /**
+   * Returns the object with the settings used for calls to deleteImage.
+   */
   public UnaryCallSettings deleteImageSettings() {
     return deleteImageSettings;
   }
 
-  /** Returns the object with the settings used for calls to deprecateImage. */
+  /**
+   * Returns the object with the settings used for calls to deprecateImage.
+   */
   public UnaryCallSettings deprecateImageSettings() {
     return deprecateImageSettings;
   }
 
-  /** Returns the object with the settings used for calls to getImage. */
+  /**
+   * Returns the object with the settings used for calls to getImage.
+   */
   public UnaryCallSettings getImageSettings() {
     return getImageSettings;
   }
 
-  /** Returns the object with the settings used for calls to getFromFamilyImage. */
+  /**
+   * Returns the object with the settings used for calls to getFromFamilyImage.
+   */
   public UnaryCallSettings getFromFamilyImageSettings() {
     return getFromFamilyImageSettings;
   }
 
-  /** Returns the object with the settings used for calls to insertImage. */
+  /**
+   * Returns the object with the settings used for calls to insertImage.
+   */
   public UnaryCallSettings insertImageSettings() {
     return insertImageSettings;
   }
 
-  /** Returns the object with the settings used for calls to listImages. */
-  public PagedCallSettings
-      listImagesSettings() {
+  /**
+   * Returns the object with the settings used for calls to listImages.
+   */
+  public PagedCallSettings listImagesSettings() {
     return listImagesSettings;
   }
 
+  /**
+   * Returns the object with the settings used for calls to setLabelsImage.
+   */
+  public UnaryCallSettings setLabelsImageSettings() {
+    return setLabelsImageSettings;
+  }
+
+
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ImageStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -149,34 +176,47 @@ public ImageStub createStub() throws IOException {
     }
   }
 
-  /** Returns a builder for the default ExecutorProvider for this service. */
+  /**
+   * Returns a builder for the default ExecutorProvider for this service.
+   */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /** Returns the default service endpoint. */
+  /**
+   * Returns the default service endpoint.
+   */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /** Returns the default service port. */
+  /**
+   * Returns the default service port.
+   */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-  /** Returns the default service scopes. */
+
+  /**
+   * Returns the default service scopes.
+   */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-  /** Returns a builder for the default credentials for this service. */
+
+  /**
+   * Returns a builder for the default credentials for this service.
+   */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+    return GoogleCredentialsProvider.newBuilder()
+        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+        ;
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder
-      defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -188,22 +228,26 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ImageStubSettings.class))
-        .setTransportToken(
-            GaxHttpJsonProperties.getHttpJsonTokenName(),
-            GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /** Returns a builder containing all the values of this settings class. */
+  /**
+   * Returns a builder containing all the values of this settings class.
+   */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -217,87 +261,82 @@ protected ImageStubSettings(Builder settingsBuilder) throws IOException {
     getFromFamilyImageSettings = settingsBuilder.getFromFamilyImageSettings().build();
     insertImageSettings = settingsBuilder.insertImageSettings().build();
     listImagesSettings = settingsBuilder.listImagesSettings().build();
+    setLabelsImageSettings = settingsBuilder.setLabelsImageSettings().build();
   }
 
-  private static final PagedListDescriptor
-      LIST_IMAGES_PAGE_STR_DESC =
-          new PagedListDescriptor() {
-            @Override
-            public String emptyToken() {
-              return "";
-            }
-
-            @Override
-            public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) {
-              return ListImagesHttpRequest.newBuilder(payload).setPageToken(token).build();
-            }
-
-            @Override
-            public ListImagesHttpRequest injectPageSize(
-                ListImagesHttpRequest payload, int pageSize) {
-              return ListImagesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
-            }
-
-            @Override
-            public Integer extractPageSize(ListImagesHttpRequest payload) {
-              return payload.getMaxResults();
-            }
-
-            @Override
-            public String extractNextToken(ImageList payload) {
-              return payload.getNextPageToken();
-            }
-
-            @Override
-            public Iterable extractResources(ImageList payload) {
-              return payload.getItemsList();
-            }
-          };
-
-  private static final PagedListResponseFactory<
-          ListImagesHttpRequest, ImageList, ListImagesPagedResponse>
-      LIST_IMAGES_PAGE_STR_FACT =
-          new PagedListResponseFactory<
-              ListImagesHttpRequest, ImageList, ListImagesPagedResponse>() {
-            @Override
-            public ApiFuture getFuturePagedResponse(
-                UnaryCallable callable,
-                ListImagesHttpRequest request,
-                ApiCallContext context,
-                ApiFuture futureResponse) {
-              PageContext pageContext =
-                  PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context);
-              return ListImagesPagedResponse.createAsync(pageContext, futureResponse);
-            }
-          };
-
-  /** Builder for ImageStubSettings. */
+  private static final PagedListDescriptor LIST_IMAGES_PAGE_STR_DESC =
+      new PagedListDescriptor() {
+        @Override
+        public String emptyToken() {
+          return "";
+        }
+        @Override
+        public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) {
+          return ListImagesHttpRequest
+            .newBuilder(payload)
+            .setPageToken(token)
+            .build();
+        }
+        @Override
+        public ListImagesHttpRequest injectPageSize(ListImagesHttpRequest payload, int pageSize) {
+          return ListImagesHttpRequest
+            .newBuilder(payload)
+            .setMaxResults(pageSize)
+            .build();
+        }
+        @Override
+        public Integer extractPageSize(ListImagesHttpRequest payload) {
+          return payload.getMaxResults();
+        }
+        @Override
+        public String extractNextToken(ImageList payload) {
+          return payload.getNextPageToken();
+        }
+        @Override
+        public Iterable extractResources(ImageList payload) {
+          return payload.getItemsList();
+        }
+      };
+
+  private static final PagedListResponseFactory LIST_IMAGES_PAGE_STR_FACT =
+      new PagedListResponseFactory() {
+        @Override
+        public ApiFuture getFuturePagedResponse(
+            UnaryCallable callable,
+            ListImagesHttpRequest request,
+            ApiCallContext context,
+            ApiFuture futureResponse) {
+          PageContext pageContext =
+              PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context);
+          return ListImagesPagedResponse.createAsync(pageContext, futureResponse);
+        }
+      };
+
+
+  /**
+   * Builder for ImageStubSettings.
+   */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder deleteImageSettings;
-    private final UnaryCallSettings.Builder
-        deprecateImageSettings;
+    private final UnaryCallSettings.Builder deprecateImageSettings;
     private final UnaryCallSettings.Builder getImageSettings;
-    private final UnaryCallSettings.Builder
-        getFromFamilyImageSettings;
+    private final UnaryCallSettings.Builder getFromFamilyImageSettings;
     private final UnaryCallSettings.Builder insertImageSettings;
-    private final PagedCallSettings.Builder<
-            ListImagesHttpRequest, ImageList, ListImagesPagedResponse>
-        listImagesSettings;
+    private final PagedCallSettings.Builder listImagesSettings;
+    private final UnaryCallSettings.Builder setLabelsImageSettings;
 
-    private static final ImmutableMap>
-        RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions =
-          ImmutableMap.builder();
+      ImmutableMap.Builder> definitions = ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(
-              Lists.newArrayList(
-                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "non_idempotent",
+          ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -306,16 +345,15 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings =
-          RetrySettings.newBuilder()
-              .setInitialRetryDelay(Duration.ofMillis(100L))
-              .setRetryDelayMultiplier(1.3)
-              .setMaxRetryDelay(Duration.ofMillis(60000L))
-              .setInitialRpcTimeout(Duration.ofMillis(20000L))
-              .setRpcTimeoutMultiplier(1.0)
-              .setMaxRpcTimeout(Duration.ofMillis(20000L))
-              .setTotalTimeout(Duration.ofMillis(600000L))
-              .build();
+      settings = RetrySettings.newBuilder()
+          .setInitialRetryDelay(Duration.ofMillis(100L))
+          .setRetryDelayMultiplier(1.3)
+          .setMaxRetryDelay(Duration.ofMillis(60000L))
+          .setInitialRpcTimeout(Duration.ofMillis(20000L))
+          .setRpcTimeoutMultiplier(1.0)
+          .setMaxRpcTimeout(Duration.ofMillis(20000L))
+          .setTotalTimeout(Duration.ofMillis(600000L))
+          .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -337,16 +375,20 @@ protected Builder(ClientContext clientContext) {
 
       insertImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listImagesSettings = PagedCallSettings.newBuilder(LIST_IMAGES_PAGE_STR_FACT);
+      listImagesSettings = PagedCallSettings.newBuilder(
+          LIST_IMAGES_PAGE_STR_FACT);
+
+      setLabelsImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders =
-          ImmutableList.>of(
-              deleteImageSettings,
-              deprecateImageSettings,
-              getImageSettings,
-              getFromFamilyImageSettings,
-              insertImageSettings,
-              listImagesSettings);
+      unaryMethodSettingsBuilders = ImmutableList.>of(
+          deleteImageSettings,
+          deprecateImageSettings,
+          getImageSettings,
+          getFromFamilyImageSettings,
+          insertImageSettings,
+          listImagesSettings,
+          setLabelsImageSettings
+      );
 
       initDefaults(this);
     }
@@ -362,36 +404,34 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder
-          .deleteImageSettings()
+      builder.deleteImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .deprecateImageSettings()
+      builder.deprecateImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .getImageSettings()
+      builder.getImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .getFromFamilyImageSettings()
+      builder.getFromFamilyImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .insertImageSettings()
+      builder.insertImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .listImagesSettings()
+      builder.listImagesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder.setLabelsImageSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       return builder;
     }
 
@@ -404,24 +444,25 @@ protected Builder(ImageStubSettings settings) {
       getFromFamilyImageSettings = settings.getFromFamilyImageSettings.toBuilder();
       insertImageSettings = settings.insertImageSettings.toBuilder();
       listImagesSettings = settings.listImagesSettings.toBuilder();
-
-      unaryMethodSettingsBuilders =
-          ImmutableList.>of(
-              deleteImageSettings,
-              deprecateImageSettings,
-              getImageSettings,
-              getFromFamilyImageSettings,
-              insertImageSettings,
-              listImagesSettings);
+      setLabelsImageSettings = settings.setLabelsImageSettings.toBuilder();
+
+      unaryMethodSettingsBuilders = ImmutableList.>of(
+          deleteImageSettings,
+          deprecateImageSettings,
+          getImageSettings,
+          getFromFamilyImageSettings,
+          insertImageSettings,
+          listImagesSettings,
+          setLabelsImageSettings
+      );
     }
 
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * 

Note: This method does not support applying settings to streaming methods. + * Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -430,42 +471,58 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to deleteImage. */ + /** + * Returns the builder for the settings used for calls to deleteImage. + */ public UnaryCallSettings.Builder deleteImageSettings() { return deleteImageSettings; } - /** Returns the builder for the settings used for calls to deprecateImage. */ - public UnaryCallSettings.Builder - deprecateImageSettings() { + /** + * Returns the builder for the settings used for calls to deprecateImage. + */ + public UnaryCallSettings.Builder deprecateImageSettings() { return deprecateImageSettings; } - /** Returns the builder for the settings used for calls to getImage. */ + /** + * Returns the builder for the settings used for calls to getImage. + */ public UnaryCallSettings.Builder getImageSettings() { return getImageSettings; } - /** Returns the builder for the settings used for calls to getFromFamilyImage. */ - public UnaryCallSettings.Builder - getFromFamilyImageSettings() { + /** + * Returns the builder for the settings used for calls to getFromFamilyImage. + */ + public UnaryCallSettings.Builder getFromFamilyImageSettings() { return getFromFamilyImageSettings; } - /** Returns the builder for the settings used for calls to insertImage. */ + /** + * Returns the builder for the settings used for calls to insertImage. + */ public UnaryCallSettings.Builder insertImageSettings() { return insertImageSettings; } - /** Returns the builder for the settings used for calls to listImages. */ - public PagedCallSettings.Builder - listImagesSettings() { + /** + * Returns the builder for the settings used for calls to listImages. + */ + public PagedCallSettings.Builder listImagesSettings() { return listImagesSettings; } + /** + * Returns the builder for the settings used for calls to setLabelsImage. + */ + public UnaryCallSettings.Builder setLabelsImageSettings() { + return setLabelsImageSettings; + } + @Override public ImageStubSettings build() throws IOException { return new ImageStubSettings(this); } } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java index f4f668f45e35..f6b5db588bd4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java @@ -33,22 +33,35 @@ import com.google.cloud.compute.v1.InstanceAggregatedList; import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceListReferrers; import com.google.cloud.compute.v1.InstanceName; import com.google.cloud.compute.v1.InstancesScopedList; +import com.google.cloud.compute.v1.InstancesSetLabelsRequest; +import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest; import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; +import com.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; import com.google.cloud.compute.v1.Metadata; +import com.google.cloud.compute.v1.NetworkInterface; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectZoneInstanceName; +import com.google.cloud.compute.v1.Reference; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; import com.google.cloud.compute.v1.Scheduling; import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMinCpuPlatformInstanceHttpRequest; import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; @@ -56,6 +69,8 @@ import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; import com.google.cloud.compute.v1.Tags; +import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import com.google.cloud.compute.v1.ZoneName; import javax.annotation.Generated; @@ -130,16 +145,41 @@ public UnaryCallable listInstancesCallab throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); } + @BetaApi + public UnaryCallable listReferrersInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listReferrersInstancesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listReferrersInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listReferrersInstancesCallable()"); + } + @BetaApi public UnaryCallable resetInstanceCallable() { throw new UnsupportedOperationException("Not implemented: resetInstanceCallable()"); } + @BetaApi + public UnaryCallable setDeletionProtectionInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setDeletionProtectionInstanceCallable()"); + } + @BetaApi public UnaryCallable setDiskAutoDeleteInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setDiskAutoDeleteInstanceCallable()"); } + @BetaApi + public UnaryCallable setLabelsInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setLabelsInstanceCallable()"); + } + + @BetaApi + public UnaryCallable setMachineResourcesInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setMachineResourcesInstanceCallable()"); + } + @BetaApi public UnaryCallable setMachineTypeInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setMachineTypeInstanceCallable()"); @@ -150,6 +190,11 @@ public UnaryCallable setMetadataInsta throw new UnsupportedOperationException("Not implemented: setMetadataInstanceCallable()"); } + @BetaApi + public UnaryCallable setMinCpuPlatformInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setMinCpuPlatformInstanceCallable()"); + } + @BetaApi public UnaryCallable setSchedulingInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setSchedulingInstanceCallable()"); @@ -180,4 +225,14 @@ public UnaryCallable stopInstanceCallable() throw new UnsupportedOperationException("Not implemented: stopInstanceCallable()"); } + @BetaApi + public UnaryCallable updateAccessConfigInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateAccessConfigInstanceCallable()"); + } + + @BetaApi + public UnaryCallable updateNetworkInterfaceInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateNetworkInterfaceInstanceCallable()"); + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java index 6e3a31e3dccc..0e29349bc88c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java @@ -55,21 +55,31 @@ import com.google.cloud.compute.v1.InstanceAggregatedList; import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.InstanceList; +import com.google.cloud.compute.v1.InstanceListReferrers; import com.google.cloud.compute.v1.InstancesScopedList; import com.google.cloud.compute.v1.ListInstancesHttpRequest; +import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Reference; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; import com.google.cloud.compute.v1.SerialPortOutput; +import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; +import com.google.cloud.compute.v1.SetMinCpuPlatformInstanceHttpRequest; import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; import com.google.cloud.compute.v1.StartInstanceHttpRequest; import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; +import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -133,16 +143,23 @@ public class InstanceStubSettings extends StubSettings { private final UnaryCallSettings getSerialPortOutputInstanceSettings; private final UnaryCallSettings insertInstanceSettings; private final PagedCallSettings listInstancesSettings; + private final PagedCallSettings listReferrersInstancesSettings; private final UnaryCallSettings resetInstanceSettings; + private final UnaryCallSettings setDeletionProtectionInstanceSettings; private final UnaryCallSettings setDiskAutoDeleteInstanceSettings; + private final UnaryCallSettings setLabelsInstanceSettings; + private final UnaryCallSettings setMachineResourcesInstanceSettings; private final UnaryCallSettings setMachineTypeInstanceSettings; private final UnaryCallSettings setMetadataInstanceSettings; + private final UnaryCallSettings setMinCpuPlatformInstanceSettings; private final UnaryCallSettings setSchedulingInstanceSettings; private final UnaryCallSettings setServiceAccountInstanceSettings; private final UnaryCallSettings setTagsInstanceSettings; private final UnaryCallSettings startInstanceSettings; private final UnaryCallSettings startWithEncryptionKeyInstanceSettings; private final UnaryCallSettings stopInstanceSettings; + private final UnaryCallSettings updateAccessConfigInstanceSettings; + private final UnaryCallSettings updateNetworkInterfaceInstanceSettings; /** * Returns the object with the settings used for calls to addAccessConfigInstance. @@ -214,6 +231,13 @@ public PagedCallSettings listReferrersInstancesSettings() { + return listReferrersInstancesSettings; + } + /** * Returns the object with the settings used for calls to resetInstance. */ @@ -221,6 +245,13 @@ public UnaryCallSettings resetInstanceSetti return resetInstanceSettings; } + /** + * Returns the object with the settings used for calls to setDeletionProtectionInstance. + */ + public UnaryCallSettings setDeletionProtectionInstanceSettings() { + return setDeletionProtectionInstanceSettings; + } + /** * Returns the object with the settings used for calls to setDiskAutoDeleteInstance. */ @@ -228,6 +259,20 @@ public UnaryCallSettings setDis return setDiskAutoDeleteInstanceSettings; } + /** + * Returns the object with the settings used for calls to setLabelsInstance. + */ + public UnaryCallSettings setLabelsInstanceSettings() { + return setLabelsInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to setMachineResourcesInstance. + */ + public UnaryCallSettings setMachineResourcesInstanceSettings() { + return setMachineResourcesInstanceSettings; + } + /** * Returns the object with the settings used for calls to setMachineTypeInstance. */ @@ -242,6 +287,13 @@ public UnaryCallSettings setMetadataI return setMetadataInstanceSettings; } + /** + * Returns the object with the settings used for calls to setMinCpuPlatformInstance. + */ + public UnaryCallSettings setMinCpuPlatformInstanceSettings() { + return setMinCpuPlatformInstanceSettings; + } + /** * Returns the object with the settings used for calls to setSchedulingInstance. */ @@ -284,6 +336,20 @@ public UnaryCallSettings stopInstanceSetting return stopInstanceSettings; } + /** + * Returns the object with the settings used for calls to updateAccessConfigInstance. + */ + public UnaryCallSettings updateAccessConfigInstanceSettings() { + return updateAccessConfigInstanceSettings; + } + + /** + * Returns the object with the settings used for calls to updateNetworkInterfaceInstance. + */ + public UnaryCallSettings updateNetworkInterfaceInstanceSettings() { + return updateNetworkInterfaceInstanceSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public InstanceStub createStub() throws IOException { @@ -386,16 +452,23 @@ protected InstanceStubSettings(Builder settingsBuilder) throws IOException { getSerialPortOutputInstanceSettings = settingsBuilder.getSerialPortOutputInstanceSettings().build(); insertInstanceSettings = settingsBuilder.insertInstanceSettings().build(); listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + listReferrersInstancesSettings = settingsBuilder.listReferrersInstancesSettings().build(); resetInstanceSettings = settingsBuilder.resetInstanceSettings().build(); + setDeletionProtectionInstanceSettings = settingsBuilder.setDeletionProtectionInstanceSettings().build(); setDiskAutoDeleteInstanceSettings = settingsBuilder.setDiskAutoDeleteInstanceSettings().build(); + setLabelsInstanceSettings = settingsBuilder.setLabelsInstanceSettings().build(); + setMachineResourcesInstanceSettings = settingsBuilder.setMachineResourcesInstanceSettings().build(); setMachineTypeInstanceSettings = settingsBuilder.setMachineTypeInstanceSettings().build(); setMetadataInstanceSettings = settingsBuilder.setMetadataInstanceSettings().build(); + setMinCpuPlatformInstanceSettings = settingsBuilder.setMinCpuPlatformInstanceSettings().build(); setSchedulingInstanceSettings = settingsBuilder.setSchedulingInstanceSettings().build(); setServiceAccountInstanceSettings = settingsBuilder.setServiceAccountInstanceSettings().build(); setTagsInstanceSettings = settingsBuilder.setTagsInstanceSettings().build(); startInstanceSettings = settingsBuilder.startInstanceSettings().build(); startWithEncryptionKeyInstanceSettings = settingsBuilder.startWithEncryptionKeyInstanceSettings().build(); stopInstanceSettings = settingsBuilder.stopInstanceSettings().build(); + updateAccessConfigInstanceSettings = settingsBuilder.updateAccessConfigInstanceSettings().build(); + updateNetworkInterfaceInstanceSettings = settingsBuilder.updateNetworkInterfaceInstanceSettings().build(); } private static final PagedListDescriptor AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC = @@ -466,6 +539,40 @@ public Iterable extractResources(InstanceList payload) { } }; + private static final PagedListDescriptor LIST_REFERRERS_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListReferrersInstancesHttpRequest injectToken(ListReferrersInstancesHttpRequest payload, String token) { + return ListReferrersInstancesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListReferrersInstancesHttpRequest injectPageSize(ListReferrersInstancesHttpRequest payload, int pageSize) { + return ListReferrersInstancesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListReferrersInstancesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InstanceListReferrers payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InstanceListReferrers payload) { + return payload.getItemsList(); + } + }; + private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT = new PagedListResponseFactory() { @Override @@ -494,6 +601,20 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory LIST_REFERRERS_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListReferrersInstancesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REFERRERS_INSTANCES_PAGE_STR_DESC, request, context); + return ListReferrersInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** * Builder for InstanceStubSettings. @@ -511,16 +632,23 @@ public static class Builder extends StubSettings.Builder getSerialPortOutputInstanceSettings; private final UnaryCallSettings.Builder insertInstanceSettings; private final PagedCallSettings.Builder listInstancesSettings; + private final PagedCallSettings.Builder listReferrersInstancesSettings; private final UnaryCallSettings.Builder resetInstanceSettings; + private final UnaryCallSettings.Builder setDeletionProtectionInstanceSettings; private final UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings; + private final UnaryCallSettings.Builder setLabelsInstanceSettings; + private final UnaryCallSettings.Builder setMachineResourcesInstanceSettings; private final UnaryCallSettings.Builder setMachineTypeInstanceSettings; private final UnaryCallSettings.Builder setMetadataInstanceSettings; + private final UnaryCallSettings.Builder setMinCpuPlatformInstanceSettings; private final UnaryCallSettings.Builder setSchedulingInstanceSettings; private final UnaryCallSettings.Builder setServiceAccountInstanceSettings; private final UnaryCallSettings.Builder setTagsInstanceSettings; private final UnaryCallSettings.Builder startInstanceSettings; private final UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings; private final UnaryCallSettings.Builder stopInstanceSettings; + private final UnaryCallSettings.Builder updateAccessConfigInstanceSettings; + private final UnaryCallSettings.Builder updateNetworkInterfaceInstanceSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -582,14 +710,25 @@ protected Builder(ClientContext clientContext) { listInstancesSettings = PagedCallSettings.newBuilder( LIST_INSTANCES_PAGE_STR_FACT); + listReferrersInstancesSettings = PagedCallSettings.newBuilder( + LIST_REFERRERS_INSTANCES_PAGE_STR_FACT); + resetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDeletionProtectionInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDiskAutoDeleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setLabelsInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setMachineResourcesInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setMachineTypeInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setMetadataInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setMinCpuPlatformInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setSchedulingInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setServiceAccountInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -602,6 +741,10 @@ protected Builder(ClientContext clientContext) { stopInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAccessConfigInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateNetworkInterfaceInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( addAccessConfigInstanceSettings, aggregatedListInstancesSettings, @@ -613,16 +756,23 @@ protected Builder(ClientContext clientContext) { getSerialPortOutputInstanceSettings, insertInstanceSettings, listInstancesSettings, + listReferrersInstancesSettings, resetInstanceSettings, + setDeletionProtectionInstanceSettings, setDiskAutoDeleteInstanceSettings, + setLabelsInstanceSettings, + setMachineResourcesInstanceSettings, setMachineTypeInstanceSettings, setMetadataInstanceSettings, + setMinCpuPlatformInstanceSettings, setSchedulingInstanceSettings, setServiceAccountInstanceSettings, setTagsInstanceSettings, startInstanceSettings, startWithEncryptionKeyInstanceSettings, - stopInstanceSettings + stopInstanceSettings, + updateAccessConfigInstanceSettings, + updateNetworkInterfaceInstanceSettings ); initDefaults(this); @@ -679,14 +829,30 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.listReferrersInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.resetInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setDeletionProtectionInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setDiskAutoDeleteInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setLabelsInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setMachineResourcesInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setMachineTypeInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); @@ -695,6 +861,10 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setMinCpuPlatformInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.setSchedulingInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); @@ -719,6 +889,14 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.updateAccessConfigInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateNetworkInterfaceInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -735,16 +913,23 @@ protected Builder(InstanceStubSettings settings) { getSerialPortOutputInstanceSettings = settings.getSerialPortOutputInstanceSettings.toBuilder(); insertInstanceSettings = settings.insertInstanceSettings.toBuilder(); listInstancesSettings = settings.listInstancesSettings.toBuilder(); + listReferrersInstancesSettings = settings.listReferrersInstancesSettings.toBuilder(); resetInstanceSettings = settings.resetInstanceSettings.toBuilder(); + setDeletionProtectionInstanceSettings = settings.setDeletionProtectionInstanceSettings.toBuilder(); setDiskAutoDeleteInstanceSettings = settings.setDiskAutoDeleteInstanceSettings.toBuilder(); + setLabelsInstanceSettings = settings.setLabelsInstanceSettings.toBuilder(); + setMachineResourcesInstanceSettings = settings.setMachineResourcesInstanceSettings.toBuilder(); setMachineTypeInstanceSettings = settings.setMachineTypeInstanceSettings.toBuilder(); setMetadataInstanceSettings = settings.setMetadataInstanceSettings.toBuilder(); + setMinCpuPlatformInstanceSettings = settings.setMinCpuPlatformInstanceSettings.toBuilder(); setSchedulingInstanceSettings = settings.setSchedulingInstanceSettings.toBuilder(); setServiceAccountInstanceSettings = settings.setServiceAccountInstanceSettings.toBuilder(); setTagsInstanceSettings = settings.setTagsInstanceSettings.toBuilder(); startInstanceSettings = settings.startInstanceSettings.toBuilder(); startWithEncryptionKeyInstanceSettings = settings.startWithEncryptionKeyInstanceSettings.toBuilder(); stopInstanceSettings = settings.stopInstanceSettings.toBuilder(); + updateAccessConfigInstanceSettings = settings.updateAccessConfigInstanceSettings.toBuilder(); + updateNetworkInterfaceInstanceSettings = settings.updateNetworkInterfaceInstanceSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( addAccessConfigInstanceSettings, @@ -757,16 +942,23 @@ protected Builder(InstanceStubSettings settings) { getSerialPortOutputInstanceSettings, insertInstanceSettings, listInstancesSettings, + listReferrersInstancesSettings, resetInstanceSettings, + setDeletionProtectionInstanceSettings, setDiskAutoDeleteInstanceSettings, + setLabelsInstanceSettings, + setMachineResourcesInstanceSettings, setMachineTypeInstanceSettings, setMetadataInstanceSettings, + setMinCpuPlatformInstanceSettings, setSchedulingInstanceSettings, setServiceAccountInstanceSettings, setTagsInstanceSettings, startInstanceSettings, startWithEncryptionKeyInstanceSettings, - stopInstanceSettings + stopInstanceSettings, + updateAccessConfigInstanceSettings, + updateNetworkInterfaceInstanceSettings ); } @@ -854,6 +1046,13 @@ public PagedCallSettings.Builder listReferrersInstancesSettings() { + return listReferrersInstancesSettings; + } + /** * Returns the builder for the settings used for calls to resetInstance. */ @@ -861,6 +1060,13 @@ public UnaryCallSettings.Builder resetInsta return resetInstanceSettings; } + /** + * Returns the builder for the settings used for calls to setDeletionProtectionInstance. + */ + public UnaryCallSettings.Builder setDeletionProtectionInstanceSettings() { + return setDeletionProtectionInstanceSettings; + } + /** * Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. */ @@ -868,6 +1074,20 @@ public UnaryCallSettings.Builder setLabelsInstanceSettings() { + return setLabelsInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to setMachineResourcesInstance. + */ + public UnaryCallSettings.Builder setMachineResourcesInstanceSettings() { + return setMachineResourcesInstanceSettings; + } + /** * Returns the builder for the settings used for calls to setMachineTypeInstance. */ @@ -882,6 +1102,13 @@ public UnaryCallSettings.Builder setM return setMetadataInstanceSettings; } + /** + * Returns the builder for the settings used for calls to setMinCpuPlatformInstance. + */ + public UnaryCallSettings.Builder setMinCpuPlatformInstanceSettings() { + return setMinCpuPlatformInstanceSettings; + } + /** * Returns the builder for the settings used for calls to setSchedulingInstance. */ @@ -924,6 +1151,20 @@ public UnaryCallSettings.Builder stopInstanc return stopInstanceSettings; } + /** + * Returns the builder for the settings used for calls to updateAccessConfigInstance. + */ + public UnaryCallSettings.Builder updateAccessConfigInstanceSettings() { + return updateAccessConfigInstanceSettings; + } + + /** + * Returns the builder for the settings used for calls to updateNetworkInterfaceInstance. + */ + public UnaryCallSettings.Builder updateNetworkInterfaceInstanceSettings() { + return updateNetworkInterfaceInstanceSettings; + } + @Override public InstanceStubSettings build() throws IOException { return new InstanceStubSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java new file mode 100644 index 000000000000..4f09b76ddb01 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.DeleteInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InterconnectAttachment; +import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import com.google.cloud.compute.v1.InterconnectAttachmentList; +import com.google.cloud.compute.v1.InterconnectAttachmentName; +import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; +import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RegionName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InterconnectAttachmentStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInterconnectAttachmentsPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListInterconnectAttachmentsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListInterconnectAttachmentsCallable()"); + } + + @BetaApi + public UnaryCallable deleteInterconnectAttachmentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInterconnectAttachmentCallable()"); + } + + @BetaApi + public UnaryCallable getInterconnectAttachmentCallable() { + throw new UnsupportedOperationException("Not implemented: getInterconnectAttachmentCallable()"); + } + + @BetaApi + public UnaryCallable insertInterconnectAttachmentCallable() { + throw new UnsupportedOperationException("Not implemented: insertInterconnectAttachmentCallable()"); + } + + @BetaApi + public UnaryCallable listInterconnectAttachmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInterconnectAttachmentsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInterconnectAttachmentsCallable() { + throw new UnsupportedOperationException("Not implemented: listInterconnectAttachmentsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java new file mode 100644 index 000000000000..9d04aaeb181d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java @@ -0,0 +1,526 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.DeleteInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; +import com.google.cloud.compute.v1.InterconnectAttachment; +import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import com.google.cloud.compute.v1.InterconnectAttachmentList; +import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; +import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InterconnectAttachmentStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteInterconnectAttachment to 30 seconds: + * + *

+ * 
+ * InterconnectAttachmentStubSettings.Builder interconnectAttachmentSettingsBuilder =
+ *     InterconnectAttachmentStubSettings.newBuilder();
+ * interconnectAttachmentSettingsBuilder.deleteInterconnectAttachmentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InterconnectAttachmentStubSettings interconnectAttachmentSettings = interconnectAttachmentSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectAttachmentStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListInterconnectAttachmentsSettings; + private final UnaryCallSettings deleteInterconnectAttachmentSettings; + private final UnaryCallSettings getInterconnectAttachmentSettings; + private final UnaryCallSettings insertInterconnectAttachmentSettings; + private final PagedCallSettings listInterconnectAttachmentsSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListInterconnectAttachments. + */ + public PagedCallSettings aggregatedListInterconnectAttachmentsSettings() { + return aggregatedListInterconnectAttachmentsSettings; + } + + /** + * Returns the object with the settings used for calls to deleteInterconnectAttachment. + */ + public UnaryCallSettings deleteInterconnectAttachmentSettings() { + return deleteInterconnectAttachmentSettings; + } + + /** + * Returns the object with the settings used for calls to getInterconnectAttachment. + */ + public UnaryCallSettings getInterconnectAttachmentSettings() { + return getInterconnectAttachmentSettings; + } + + /** + * Returns the object with the settings used for calls to insertInterconnectAttachment. + */ + public UnaryCallSettings insertInterconnectAttachmentSettings() { + return insertInterconnectAttachmentSettings; + } + + /** + * Returns the object with the settings used for calls to listInterconnectAttachments. + */ + public PagedCallSettings listInterconnectAttachmentsSettings() { + return listInterconnectAttachmentsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InterconnectAttachmentStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInterconnectAttachmentStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InterconnectAttachmentStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InterconnectAttachmentStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListInterconnectAttachmentsSettings = settingsBuilder.aggregatedListInterconnectAttachmentsSettings().build(); + deleteInterconnectAttachmentSettings = settingsBuilder.deleteInterconnectAttachmentSettings().build(); + getInterconnectAttachmentSettings = settingsBuilder.getInterconnectAttachmentSettings().build(); + insertInterconnectAttachmentSettings = settingsBuilder.insertInterconnectAttachmentSettings().build(); + listInterconnectAttachmentsSettings = settingsBuilder.listInterconnectAttachmentsSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListInterconnectAttachmentsHttpRequest injectToken(AggregatedListInterconnectAttachmentsHttpRequest payload, String token) { + return AggregatedListInterconnectAttachmentsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListInterconnectAttachmentsHttpRequest injectPageSize(AggregatedListInterconnectAttachmentsHttpRequest payload, int pageSize) { + return AggregatedListInterconnectAttachmentsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListInterconnectAttachmentsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InterconnectAttachmentAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InterconnectAttachmentAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInterconnectAttachmentsHttpRequest injectToken(ListInterconnectAttachmentsHttpRequest payload, String token) { + return ListInterconnectAttachmentsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInterconnectAttachmentsHttpRequest injectPageSize(ListInterconnectAttachmentsHttpRequest payload, int pageSize) { + return ListInterconnectAttachmentsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInterconnectAttachmentsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InterconnectAttachmentList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InterconnectAttachmentList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListInterconnectAttachmentsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC, request, context); + return AggregatedListInterconnectAttachmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInterconnectAttachmentsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC, request, context); + return ListInterconnectAttachmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InterconnectAttachmentStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListInterconnectAttachmentsSettings; + private final UnaryCallSettings.Builder deleteInterconnectAttachmentSettings; + private final UnaryCallSettings.Builder getInterconnectAttachmentSettings; + private final UnaryCallSettings.Builder insertInterconnectAttachmentSettings; + private final PagedCallSettings.Builder listInterconnectAttachmentsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListInterconnectAttachmentsSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT); + + deleteInterconnectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getInterconnectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertInterconnectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInterconnectAttachmentsSettings = PagedCallSettings.newBuilder( + LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListInterconnectAttachmentsSettings, + deleteInterconnectAttachmentSettings, + getInterconnectAttachmentSettings, + insertInterconnectAttachmentSettings, + listInterconnectAttachmentsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListInterconnectAttachmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteInterconnectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getInterconnectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertInterconnectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInterconnectAttachmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InterconnectAttachmentStubSettings settings) { + super(settings); + + aggregatedListInterconnectAttachmentsSettings = settings.aggregatedListInterconnectAttachmentsSettings.toBuilder(); + deleteInterconnectAttachmentSettings = settings.deleteInterconnectAttachmentSettings.toBuilder(); + getInterconnectAttachmentSettings = settings.getInterconnectAttachmentSettings.toBuilder(); + insertInterconnectAttachmentSettings = settings.insertInterconnectAttachmentSettings.toBuilder(); + listInterconnectAttachmentsSettings = settings.listInterconnectAttachmentsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListInterconnectAttachmentsSettings, + deleteInterconnectAttachmentSettings, + getInterconnectAttachmentSettings, + insertInterconnectAttachmentSettings, + listInterconnectAttachmentsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListInterconnectAttachments. + */ + public PagedCallSettings.Builder aggregatedListInterconnectAttachmentsSettings() { + return aggregatedListInterconnectAttachmentsSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteInterconnectAttachment. + */ + public UnaryCallSettings.Builder deleteInterconnectAttachmentSettings() { + return deleteInterconnectAttachmentSettings; + } + + /** + * Returns the builder for the settings used for calls to getInterconnectAttachment. + */ + public UnaryCallSettings.Builder getInterconnectAttachmentSettings() { + return getInterconnectAttachmentSettings; + } + + /** + * Returns the builder for the settings used for calls to insertInterconnectAttachment. + */ + public UnaryCallSettings.Builder insertInterconnectAttachmentSettings() { + return insertInterconnectAttachmentSettings; + } + + /** + * Returns the builder for the settings used for calls to listInterconnectAttachments. + */ + public PagedCallSettings.Builder listInterconnectAttachmentsSettings() { + return listInterconnectAttachmentsSettings; + } + + @Override + public InterconnectAttachmentStubSettings build() throws IOException { + return new InterconnectAttachmentStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java new file mode 100644 index 000000000000..2935202ce006 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java @@ -0,0 +1,56 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; +import com.google.cloud.compute.v1.InterconnectLocation; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import com.google.cloud.compute.v1.InterconnectLocationList; +import com.google.cloud.compute.v1.InterconnectLocationName; +import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InterconnectLocationStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getInterconnectLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getInterconnectLocationCallable()"); + } + + @BetaApi + public UnaryCallable listInterconnectLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInterconnectLocationsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInterconnectLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listInterconnectLocationsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java new file mode 100644 index 000000000000..383a047572e0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java @@ -0,0 +1,392 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; +import com.google.cloud.compute.v1.InterconnectLocation; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import com.google.cloud.compute.v1.InterconnectLocationList; +import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InterconnectLocationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getInterconnectLocation to 30 seconds: + * + *

+ * 
+ * InterconnectLocationStubSettings.Builder interconnectLocationSettingsBuilder =
+ *     InterconnectLocationStubSettings.newBuilder();
+ * interconnectLocationSettingsBuilder.getInterconnectLocationSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InterconnectLocationStubSettings interconnectLocationSettings = interconnectLocationSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectLocationStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getInterconnectLocationSettings; + private final PagedCallSettings listInterconnectLocationsSettings; + + /** + * Returns the object with the settings used for calls to getInterconnectLocation. + */ + public UnaryCallSettings getInterconnectLocationSettings() { + return getInterconnectLocationSettings; + } + + /** + * Returns the object with the settings used for calls to listInterconnectLocations. + */ + public PagedCallSettings listInterconnectLocationsSettings() { + return listInterconnectLocationsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InterconnectLocationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInterconnectLocationStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InterconnectLocationStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InterconnectLocationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getInterconnectLocationSettings = settingsBuilder.getInterconnectLocationSettings().build(); + listInterconnectLocationsSettings = settingsBuilder.listInterconnectLocationsSettings().build(); + } + + private static final PagedListDescriptor LIST_INTERCONNECT_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInterconnectLocationsHttpRequest injectToken(ListInterconnectLocationsHttpRequest payload, String token) { + return ListInterconnectLocationsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInterconnectLocationsHttpRequest injectPageSize(ListInterconnectLocationsHttpRequest payload, int pageSize) { + return ListInterconnectLocationsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInterconnectLocationsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InterconnectLocationList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InterconnectLocationList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_INTERCONNECT_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInterconnectLocationsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INTERCONNECT_LOCATIONS_PAGE_STR_DESC, request, context); + return ListInterconnectLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InterconnectLocationStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getInterconnectLocationSettings; + private final PagedCallSettings.Builder listInterconnectLocationsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getInterconnectLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInterconnectLocationsSettings = PagedCallSettings.newBuilder( + LIST_INTERCONNECT_LOCATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getInterconnectLocationSettings, + listInterconnectLocationsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getInterconnectLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInterconnectLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InterconnectLocationStubSettings settings) { + super(settings); + + getInterconnectLocationSettings = settings.getInterconnectLocationSettings.toBuilder(); + listInterconnectLocationsSettings = settings.listInterconnectLocationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getInterconnectLocationSettings, + listInterconnectLocationsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getInterconnectLocation. + */ + public UnaryCallSettings.Builder getInterconnectLocationSettings() { + return getInterconnectLocationSettings; + } + + /** + * Returns the builder for the settings used for calls to listInterconnectLocations. + */ + public PagedCallSettings.Builder listInterconnectLocationsSettings() { + return listInterconnectLocationsSettings; + } + + @Override + public InterconnectLocationStubSettings build() throws IOException { + return new InterconnectLocationStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java new file mode 100644 index 000000000000..179187f32dcd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java @@ -0,0 +1,75 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; +import com.google.cloud.compute.v1.Interconnect; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.InterconnectName; +import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; +import com.google.cloud.compute.v1.ProjectName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class InterconnectStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteInterconnectCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInterconnectCallable()"); + } + + @BetaApi + public UnaryCallable getInterconnectCallable() { + throw new UnsupportedOperationException("Not implemented: getInterconnectCallable()"); + } + + @BetaApi + public UnaryCallable insertInterconnectCallable() { + throw new UnsupportedOperationException("Not implemented: insertInterconnectCallable()"); + } + + @BetaApi + public UnaryCallable listInterconnectsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInterconnectsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listInterconnectsCallable() { + throw new UnsupportedOperationException("Not implemented: listInterconnectsCallable()"); + } + + @BetaApi + public UnaryCallable patchInterconnectCallable() { + throw new UnsupportedOperationException("Not implemented: patchInterconnectCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java new file mode 100644 index 000000000000..4e0d9e7849fe --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java @@ -0,0 +1,474 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetInterconnectHttpRequest; +import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; +import com.google.cloud.compute.v1.Interconnect; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link InterconnectStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteInterconnect to 30 seconds: + * + *

+ * 
+ * InterconnectStubSettings.Builder interconnectSettingsBuilder =
+ *     InterconnectStubSettings.newBuilder();
+ * interconnectSettingsBuilder.deleteInterconnectSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * InterconnectStubSettings interconnectSettings = interconnectSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class InterconnectStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteInterconnectSettings; + private final UnaryCallSettings getInterconnectSettings; + private final UnaryCallSettings insertInterconnectSettings; + private final PagedCallSettings listInterconnectsSettings; + private final UnaryCallSettings patchInterconnectSettings; + + /** + * Returns the object with the settings used for calls to deleteInterconnect. + */ + public UnaryCallSettings deleteInterconnectSettings() { + return deleteInterconnectSettings; + } + + /** + * Returns the object with the settings used for calls to getInterconnect. + */ + public UnaryCallSettings getInterconnectSettings() { + return getInterconnectSettings; + } + + /** + * Returns the object with the settings used for calls to insertInterconnect. + */ + public UnaryCallSettings insertInterconnectSettings() { + return insertInterconnectSettings; + } + + /** + * Returns the object with the settings used for calls to listInterconnects. + */ + public PagedCallSettings listInterconnectsSettings() { + return listInterconnectsSettings; + } + + /** + * Returns the object with the settings used for calls to patchInterconnect. + */ + public UnaryCallSettings patchInterconnectSettings() { + return patchInterconnectSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public InterconnectStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonInterconnectStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InterconnectStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected InterconnectStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteInterconnectSettings = settingsBuilder.deleteInterconnectSettings().build(); + getInterconnectSettings = settingsBuilder.getInterconnectSettings().build(); + insertInterconnectSettings = settingsBuilder.insertInterconnectSettings().build(); + listInterconnectsSettings = settingsBuilder.listInterconnectsSettings().build(); + patchInterconnectSettings = settingsBuilder.patchInterconnectSettings().build(); + } + + private static final PagedListDescriptor LIST_INTERCONNECTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListInterconnectsHttpRequest injectToken(ListInterconnectsHttpRequest payload, String token) { + return ListInterconnectsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListInterconnectsHttpRequest injectPageSize(ListInterconnectsHttpRequest payload, int pageSize) { + return ListInterconnectsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListInterconnectsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(InterconnectList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(InterconnectList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_INTERCONNECTS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInterconnectsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INTERCONNECTS_PAGE_STR_DESC, request, context); + return ListInterconnectsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for InterconnectStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteInterconnectSettings; + private final UnaryCallSettings.Builder getInterconnectSettings; + private final UnaryCallSettings.Builder insertInterconnectSettings; + private final PagedCallSettings.Builder listInterconnectsSettings; + private final UnaryCallSettings.Builder patchInterconnectSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listInterconnectsSettings = PagedCallSettings.newBuilder( + LIST_INTERCONNECTS_PAGE_STR_FACT); + + patchInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteInterconnectSettings, + getInterconnectSettings, + insertInterconnectSettings, + listInterconnectsSettings, + patchInterconnectSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteInterconnectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getInterconnectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertInterconnectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listInterconnectsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.patchInterconnectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(InterconnectStubSettings settings) { + super(settings); + + deleteInterconnectSettings = settings.deleteInterconnectSettings.toBuilder(); + getInterconnectSettings = settings.getInterconnectSettings.toBuilder(); + insertInterconnectSettings = settings.insertInterconnectSettings.toBuilder(); + listInterconnectsSettings = settings.listInterconnectsSettings.toBuilder(); + patchInterconnectSettings = settings.patchInterconnectSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteInterconnectSettings, + getInterconnectSettings, + insertInterconnectSettings, + listInterconnectsSettings, + patchInterconnectSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteInterconnect. + */ + public UnaryCallSettings.Builder deleteInterconnectSettings() { + return deleteInterconnectSettings; + } + + /** + * Returns the builder for the settings used for calls to getInterconnect. + */ + public UnaryCallSettings.Builder getInterconnectSettings() { + return getInterconnectSettings; + } + + /** + * Returns the builder for the settings used for calls to insertInterconnect. + */ + public UnaryCallSettings.Builder insertInterconnectSettings() { + return insertInterconnectSettings; + } + + /** + * Returns the builder for the settings used for calls to listInterconnects. + */ + public PagedCallSettings.Builder listInterconnectsSettings() { + return listInterconnectsSettings; + } + + /** + * Returns the builder for the settings used for calls to patchInterconnect. + */ + public UnaryCallSettings.Builder patchInterconnectSettings() { + return patchInterconnectSettings; + } + + @Override + public InterconnectStubSettings build() throws IOException { + return new InterconnectStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java new file mode 100644 index 000000000000..70279de3e4ea --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicenseName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class LicenseStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable getLicenseCallable() { + throw new UnsupportedOperationException("Not implemented: getLicenseCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java new file mode 100644 index 000000000000..51b2375cc135 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.License; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LicenseStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getLicense to 30 seconds: + * + *

+ * 
+ * LicenseStubSettings.Builder licenseSettingsBuilder =
+ *     LicenseStubSettings.newBuilder();
+ * licenseSettingsBuilder.getLicenseSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LicenseStubSettings licenseSettings = licenseSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicenseStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getLicenseSettings; + + /** + * Returns the object with the settings used for calls to getLicense. + */ + public UnaryCallSettings getLicenseSettings() { + return getLicenseSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LicenseStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonLicenseStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LicenseStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LicenseStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getLicenseSettings = settingsBuilder.getLicenseSettings().build(); + } + + + + + /** + * Builder for LicenseStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getLicenseSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getLicenseSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.getLicenseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(LicenseStubSettings settings) { + super(settings); + + getLicenseSettings = settings.getLicenseSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + getLicenseSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to getLicense. + */ + public UnaryCallSettings.Builder getLicenseSettings() { + return getLicenseSettings; + } + + @Override + public LicenseStubSettings build() throws IOException { + return new LicenseStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java index cf84117b76c5..80f6c27daff4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java @@ -18,6 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; import com.google.cloud.compute.v1.GetNetworkHttpRequest; import com.google.cloud.compute.v1.InsertNetworkHttpRequest; @@ -26,8 +27,12 @@ import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.NetworkList; import com.google.cloud.compute.v1.NetworkName; +import com.google.cloud.compute.v1.NetworksAddPeeringRequest; +import com.google.cloud.compute.v1.NetworksRemovePeeringRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchNetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; import javax.annotation.Generated; @@ -42,6 +47,11 @@ public abstract class NetworkStub implements BackgroundResource { + @BetaApi + public UnaryCallable addPeeringNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: addPeeringNetworkCallable()"); + } + @BetaApi public UnaryCallable deleteNetworkCallable() { throw new UnsupportedOperationException("Not implemented: deleteNetworkCallable()"); @@ -67,6 +77,16 @@ public UnaryCallable listNetworksCallable( throw new UnsupportedOperationException("Not implemented: listNetworksCallable()"); } + @BetaApi + public UnaryCallable patchNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: patchNetworkCallable()"); + } + + @BetaApi + public UnaryCallable removePeeringNetworkCallable() { + throw new UnsupportedOperationException("Not implemented: removePeeringNetworkCallable()"); + } + @BetaApi public UnaryCallable switchToCustomModeNetworkCallable() { throw new UnsupportedOperationException("Not implemented: switchToCustomModeNetworkCallable()"); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java index 9c6fbe709267..bfb4184e902f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java @@ -42,6 +42,7 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; import com.google.cloud.compute.v1.GetNetworkHttpRequest; import com.google.cloud.compute.v1.InsertNetworkHttpRequest; @@ -50,6 +51,8 @@ import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.NetworkList; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchNetworkHttpRequest; +import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -77,13 +80,13 @@ * *

The builder of this class is recursive, so contained classes are themselves builders. * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteNetwork to 30 seconds: + * object. For example, to set the total timeout of addPeeringNetwork to 30 seconds: * *

  * 
  * NetworkStubSettings.Builder networkSettingsBuilder =
  *     NetworkStubSettings.newBuilder();
- * networkSettingsBuilder.deleteNetworkSettings().getRetrySettings().toBuilder()
+ * networkSettingsBuilder.addPeeringNetworkSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * NetworkStubSettings networkSettings = networkSettingsBuilder.build();
  * 
@@ -104,12 +107,22 @@ public class NetworkStubSettings extends StubSettings {
       .add("https://www.googleapis.com/auth/devstorage.read_write")
       .build();
 
+  private final UnaryCallSettings addPeeringNetworkSettings;
   private final UnaryCallSettings deleteNetworkSettings;
   private final UnaryCallSettings getNetworkSettings;
   private final UnaryCallSettings insertNetworkSettings;
   private final PagedCallSettings listNetworksSettings;
+  private final UnaryCallSettings patchNetworkSettings;
+  private final UnaryCallSettings removePeeringNetworkSettings;
   private final UnaryCallSettings switchToCustomModeNetworkSettings;
 
+  /**
+   * Returns the object with the settings used for calls to addPeeringNetwork.
+   */
+  public UnaryCallSettings addPeeringNetworkSettings() {
+    return addPeeringNetworkSettings;
+  }
+
   /**
    * Returns the object with the settings used for calls to deleteNetwork.
    */
@@ -138,6 +151,20 @@ public PagedCallSettings patchNetworkSettings() {
+    return patchNetworkSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to removePeeringNetwork.
+   */
+  public UnaryCallSettings removePeeringNetworkSettings() {
+    return removePeeringNetworkSettings;
+  }
+
   /**
    * Returns the object with the settings used for calls to switchToCustomModeNetwork.
    */
@@ -237,10 +264,13 @@ public Builder toBuilder() {
   protected NetworkStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    addPeeringNetworkSettings = settingsBuilder.addPeeringNetworkSettings().build();
     deleteNetworkSettings = settingsBuilder.deleteNetworkSettings().build();
     getNetworkSettings = settingsBuilder.getNetworkSettings().build();
     insertNetworkSettings = settingsBuilder.insertNetworkSettings().build();
     listNetworksSettings = settingsBuilder.listNetworksSettings().build();
+    patchNetworkSettings = settingsBuilder.patchNetworkSettings().build();
+    removePeeringNetworkSettings = settingsBuilder.removePeeringNetworkSettings().build();
     switchToCustomModeNetworkSettings = settingsBuilder.switchToCustomModeNetworkSettings().build();
   }
 
@@ -299,10 +329,13 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder addPeeringNetworkSettings;
     private final UnaryCallSettings.Builder deleteNetworkSettings;
     private final UnaryCallSettings.Builder getNetworkSettings;
     private final UnaryCallSettings.Builder insertNetworkSettings;
     private final PagedCallSettings.Builder listNetworksSettings;
+    private final UnaryCallSettings.Builder patchNetworkSettings;
+    private final UnaryCallSettings.Builder removePeeringNetworkSettings;
     private final UnaryCallSettings.Builder switchToCustomModeNetworkSettings;
 
     private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
@@ -343,6 +376,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      addPeeringNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       deleteNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -352,13 +387,20 @@ protected Builder(ClientContext clientContext) {
       listNetworksSettings = PagedCallSettings.newBuilder(
           LIST_NETWORKS_PAGE_STR_FACT);
 
+      patchNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      removePeeringNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       switchToCustomModeNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       unaryMethodSettingsBuilders = ImmutableList.>of(
+          addPeeringNetworkSettings,
           deleteNetworkSettings,
           getNetworkSettings,
           insertNetworkSettings,
           listNetworksSettings,
+          patchNetworkSettings,
+          removePeeringNetworkSettings,
           switchToCustomModeNetworkSettings
       );
 
@@ -376,6 +418,10 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder.addPeeringNetworkSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder.deleteNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
@@ -392,6 +438,14 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder.patchNetworkSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder.removePeeringNetworkSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder.switchToCustomModeNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
@@ -402,17 +456,23 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(NetworkStubSettings settings) {
       super(settings);
 
+      addPeeringNetworkSettings = settings.addPeeringNetworkSettings.toBuilder();
       deleteNetworkSettings = settings.deleteNetworkSettings.toBuilder();
       getNetworkSettings = settings.getNetworkSettings.toBuilder();
       insertNetworkSettings = settings.insertNetworkSettings.toBuilder();
       listNetworksSettings = settings.listNetworksSettings.toBuilder();
+      patchNetworkSettings = settings.patchNetworkSettings.toBuilder();
+      removePeeringNetworkSettings = settings.removePeeringNetworkSettings.toBuilder();
       switchToCustomModeNetworkSettings = settings.switchToCustomModeNetworkSettings.toBuilder();
 
       unaryMethodSettingsBuilders = ImmutableList.>of(
+          addPeeringNetworkSettings,
           deleteNetworkSettings,
           getNetworkSettings,
           insertNetworkSettings,
           listNetworksSettings,
+          patchNetworkSettings,
+          removePeeringNetworkSettings,
           switchToCustomModeNetworkSettings
       );
     }
@@ -431,6 +491,13 @@ public Builder applyToAllUnaryMethods(ApiFunction addPeeringNetworkSettings() {
+      return addPeeringNetworkSettings;
+    }
+
     /**
      * Returns the builder for the settings used for calls to deleteNetwork.
      */
@@ -459,6 +526,20 @@ public PagedCallSettings.Builder patchNetworkSettings() {
+      return patchNetworkSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to removePeeringNetwork.
+     */
+    public UnaryCallSettings.Builder removePeeringNetworkSettings() {
+      return removePeeringNetworkSettings;
+    }
+
     /**
      * Returns the builder for the settings used for calls to switchToCustomModeNetwork.
      */
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java
index 9aa6c3302f58..e9e356d111a3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java
@@ -18,18 +18,33 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.BackgroundResource;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest;
+import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest;
 import com.google.cloud.compute.v1.DiskMoveRequest;
+import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest;
+import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest;
 import com.google.cloud.compute.v1.GetProjectHttpRequest;
+import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest;
+import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest;
 import com.google.cloud.compute.v1.InstanceMoveRequest;
+import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest;
 import com.google.cloud.compute.v1.Metadata;
 import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest;
 import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.Project;
+import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse;
+import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest;
+import com.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest;
+import com.google.cloud.compute.v1.ProjectsGetXpnResources;
+import com.google.cloud.compute.v1.ProjectsListXpnHostsRequest;
 import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest;
 import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest;
 import com.google.cloud.compute.v1.UsageExportLocation;
+import com.google.cloud.compute.v1.XpnHostList;
+import com.google.cloud.compute.v1.XpnResourceId;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
@@ -43,11 +58,56 @@
 public abstract class ProjectStub implements BackgroundResource {
 
 
+  @BetaApi
+  public UnaryCallable disableXpnHostProjectCallable() {
+    throw new UnsupportedOperationException("Not implemented: disableXpnHostProjectCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable disableXpnResourceProjectCallable() {
+    throw new UnsupportedOperationException("Not implemented: disableXpnResourceProjectCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable enableXpnHostProjectCallable() {
+    throw new UnsupportedOperationException("Not implemented: enableXpnHostProjectCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable enableXpnResourceProjectCallable() {
+    throw new UnsupportedOperationException("Not implemented: enableXpnResourceProjectCallable()");
+  }
+
   @BetaApi
   public UnaryCallable getProjectCallable() {
     throw new UnsupportedOperationException("Not implemented: getProjectCallable()");
   }
 
+  @BetaApi
+  public UnaryCallable getXpnHostProjectCallable() {
+    throw new UnsupportedOperationException("Not implemented: getXpnHostProjectCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable getXpnResourcesProjectsPagedCallable() {
+    throw new UnsupportedOperationException("Not implemented: getXpnResourcesProjectsPagedCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable getXpnResourcesProjectsCallable() {
+    throw new UnsupportedOperationException("Not implemented: getXpnResourcesProjectsCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable listXpnHostsProjectsPagedCallable() {
+    throw new UnsupportedOperationException("Not implemented: listXpnHostsProjectsPagedCallable()");
+  }
+
+  @BetaApi
+  public UnaryCallable listXpnHostsProjectsCallable() {
+    throw new UnsupportedOperationException("Not implemented: listXpnHostsProjectsCallable()");
+  }
+
   @BetaApi
   public UnaryCallable moveDiskProjectCallable() {
     throw new UnsupportedOperationException("Not implemented: moveDiskProjectCallable()");
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java
index d468b27cb4a0..03e716f2ca9d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java
@@ -16,6 +16,7 @@
 package com.google.cloud.compute.v1.stub;
 
 import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.CredentialsProvider;
 import com.google.api.gax.core.ExecutorProvider;
@@ -26,22 +27,40 @@
 import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
 import com.google.api.gax.rpc.HeaderProvider;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
 import com.google.api.gax.rpc.StatusCode;
 import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
 import com.google.auth.Credentials;
+import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest;
+import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest;
+import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest;
+import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest;
 import com.google.cloud.compute.v1.GetProjectHttpRequest;
+import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest;
+import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest;
+import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest;
 import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest;
 import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.Project;
+import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse;
+import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse;
+import com.google.cloud.compute.v1.ProjectsGetXpnResources;
 import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest;
 import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest;
+import com.google.cloud.compute.v1.XpnHostList;
+import com.google.cloud.compute.v1.XpnResourceId;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
@@ -68,13 +87,13 @@
  *
  * 

The builder of this class is recursive, so contained classes are themselves builders. * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getProject to 30 seconds: + * object. For example, to set the total timeout of disableXpnHostProject to 30 seconds: * *

  * 
  * ProjectStubSettings.Builder projectSettingsBuilder =
  *     ProjectStubSettings.newBuilder();
- * projectSettingsBuilder.getProjectSettings().getRetrySettings().toBuilder()
+ * projectSettingsBuilder.disableXpnHostProjectSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * ProjectStubSettings projectSettings = projectSettingsBuilder.build();
  * 
@@ -95,12 +114,47 @@ public class ProjectStubSettings extends StubSettings {
       .add("https://www.googleapis.com/auth/devstorage.read_write")
       .build();
 
+  private final UnaryCallSettings disableXpnHostProjectSettings;
+  private final UnaryCallSettings disableXpnResourceProjectSettings;
+  private final UnaryCallSettings enableXpnHostProjectSettings;
+  private final UnaryCallSettings enableXpnResourceProjectSettings;
   private final UnaryCallSettings getProjectSettings;
+  private final UnaryCallSettings getXpnHostProjectSettings;
+  private final PagedCallSettings getXpnResourcesProjectsSettings;
+  private final PagedCallSettings listXpnHostsProjectsSettings;
   private final UnaryCallSettings moveDiskProjectSettings;
   private final UnaryCallSettings moveInstanceProjectSettings;
   private final UnaryCallSettings setCommonInstanceMetadataProjectSettings;
   private final UnaryCallSettings setUsageExportBucketProjectSettings;
 
+  /**
+   * Returns the object with the settings used for calls to disableXpnHostProject.
+   */
+  public UnaryCallSettings disableXpnHostProjectSettings() {
+    return disableXpnHostProjectSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to disableXpnResourceProject.
+   */
+  public UnaryCallSettings disableXpnResourceProjectSettings() {
+    return disableXpnResourceProjectSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to enableXpnHostProject.
+   */
+  public UnaryCallSettings enableXpnHostProjectSettings() {
+    return enableXpnHostProjectSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to enableXpnResourceProject.
+   */
+  public UnaryCallSettings enableXpnResourceProjectSettings() {
+    return enableXpnResourceProjectSettings;
+  }
+
   /**
    * Returns the object with the settings used for calls to getProject.
    */
@@ -108,6 +162,27 @@ public UnaryCallSettings getProjectSettings() {
     return getProjectSettings;
   }
 
+  /**
+   * Returns the object with the settings used for calls to getXpnHostProject.
+   */
+  public UnaryCallSettings getXpnHostProjectSettings() {
+    return getXpnHostProjectSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to getXpnResourcesProjects.
+   */
+  public PagedCallSettings getXpnResourcesProjectsSettings() {
+    return getXpnResourcesProjectsSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to listXpnHostsProjects.
+   */
+  public PagedCallSettings listXpnHostsProjectsSettings() {
+    return listXpnHostsProjectsSettings;
+  }
+
   /**
    * Returns the object with the settings used for calls to moveDiskProject.
    */
@@ -228,14 +303,115 @@ public Builder toBuilder() {
   protected ProjectStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    disableXpnHostProjectSettings = settingsBuilder.disableXpnHostProjectSettings().build();
+    disableXpnResourceProjectSettings = settingsBuilder.disableXpnResourceProjectSettings().build();
+    enableXpnHostProjectSettings = settingsBuilder.enableXpnHostProjectSettings().build();
+    enableXpnResourceProjectSettings = settingsBuilder.enableXpnResourceProjectSettings().build();
     getProjectSettings = settingsBuilder.getProjectSettings().build();
+    getXpnHostProjectSettings = settingsBuilder.getXpnHostProjectSettings().build();
+    getXpnResourcesProjectsSettings = settingsBuilder.getXpnResourcesProjectsSettings().build();
+    listXpnHostsProjectsSettings = settingsBuilder.listXpnHostsProjectsSettings().build();
     moveDiskProjectSettings = settingsBuilder.moveDiskProjectSettings().build();
     moveInstanceProjectSettings = settingsBuilder.moveInstanceProjectSettings().build();
     setCommonInstanceMetadataProjectSettings = settingsBuilder.setCommonInstanceMetadataProjectSettings().build();
     setUsageExportBucketProjectSettings = settingsBuilder.setUsageExportBucketProjectSettings().build();
   }
 
-
+  private static final PagedListDescriptor GET_XPN_RESOURCES_PROJECTS_PAGE_STR_DESC =
+      new PagedListDescriptor() {
+        @Override
+        public String emptyToken() {
+          return "";
+        }
+        @Override
+        public GetXpnResourcesProjectsHttpRequest injectToken(GetXpnResourcesProjectsHttpRequest payload, String token) {
+          return GetXpnResourcesProjectsHttpRequest
+            .newBuilder(payload)
+            .setPageToken(token)
+            .build();
+        }
+        @Override
+        public GetXpnResourcesProjectsHttpRequest injectPageSize(GetXpnResourcesProjectsHttpRequest payload, int pageSize) {
+          return GetXpnResourcesProjectsHttpRequest
+            .newBuilder(payload)
+            .setMaxResults(pageSize)
+            .build();
+        }
+        @Override
+        public Integer extractPageSize(GetXpnResourcesProjectsHttpRequest payload) {
+          return payload.getMaxResults();
+        }
+        @Override
+        public String extractNextToken(ProjectsGetXpnResources payload) {
+          return payload.getNextPageToken();
+        }
+        @Override
+        public Iterable extractResources(ProjectsGetXpnResources payload) {
+          return payload.getResourcesList();
+        }
+      };
+
+  private static final PagedListDescriptor LIST_XPN_HOSTS_PROJECTS_PAGE_STR_DESC =
+      new PagedListDescriptor() {
+        @Override
+        public String emptyToken() {
+          return "";
+        }
+        @Override
+        public ListXpnHostsProjectsHttpRequest injectToken(ListXpnHostsProjectsHttpRequest payload, String token) {
+          return ListXpnHostsProjectsHttpRequest
+            .newBuilder(payload)
+            .setPageToken(token)
+            .build();
+        }
+        @Override
+        public ListXpnHostsProjectsHttpRequest injectPageSize(ListXpnHostsProjectsHttpRequest payload, int pageSize) {
+          return ListXpnHostsProjectsHttpRequest
+            .newBuilder(payload)
+            .setMaxResults(pageSize)
+            .build();
+        }
+        @Override
+        public Integer extractPageSize(ListXpnHostsProjectsHttpRequest payload) {
+          return payload.getMaxResults();
+        }
+        @Override
+        public String extractNextToken(XpnHostList payload) {
+          return payload.getNextPageToken();
+        }
+        @Override
+        public Iterable extractResources(XpnHostList payload) {
+          return payload.getItemsList();
+        }
+      };
+
+  private static final PagedListResponseFactory GET_XPN_RESOURCES_PROJECTS_PAGE_STR_FACT =
+      new PagedListResponseFactory() {
+        @Override
+        public ApiFuture getFuturePagedResponse(
+            UnaryCallable callable,
+            GetXpnResourcesProjectsHttpRequest request,
+            ApiCallContext context,
+            ApiFuture futureResponse) {
+          PageContext pageContext =
+              PageContext.create(callable, GET_XPN_RESOURCES_PROJECTS_PAGE_STR_DESC, request, context);
+          return GetXpnResourcesProjectsPagedResponse.createAsync(pageContext, futureResponse);
+        }
+      };
+
+  private static final PagedListResponseFactory LIST_XPN_HOSTS_PROJECTS_PAGE_STR_FACT =
+      new PagedListResponseFactory() {
+        @Override
+        public ApiFuture getFuturePagedResponse(
+            UnaryCallable callable,
+            ListXpnHostsProjectsHttpRequest request,
+            ApiCallContext context,
+            ApiFuture futureResponse) {
+          PageContext pageContext =
+              PageContext.create(callable, LIST_XPN_HOSTS_PROJECTS_PAGE_STR_DESC, request, context);
+          return ListXpnHostsProjectsPagedResponse.createAsync(pageContext, futureResponse);
+        }
+      };
 
 
   /**
@@ -244,7 +420,14 @@ protected ProjectStubSettings(Builder settingsBuilder) throws IOException {
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder disableXpnHostProjectSettings;
+    private final UnaryCallSettings.Builder disableXpnResourceProjectSettings;
+    private final UnaryCallSettings.Builder enableXpnHostProjectSettings;
+    private final UnaryCallSettings.Builder enableXpnResourceProjectSettings;
     private final UnaryCallSettings.Builder getProjectSettings;
+    private final UnaryCallSettings.Builder getXpnHostProjectSettings;
+    private final PagedCallSettings.Builder getXpnResourcesProjectsSettings;
+    private final PagedCallSettings.Builder listXpnHostsProjectsSettings;
     private final UnaryCallSettings.Builder moveDiskProjectSettings;
     private final UnaryCallSettings.Builder moveInstanceProjectSettings;
     private final UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings;
@@ -288,8 +471,24 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      disableXpnHostProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      disableXpnResourceProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      enableXpnHostProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      enableXpnResourceProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       getProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
+      getXpnHostProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      getXpnResourcesProjectsSettings = PagedCallSettings.newBuilder(
+          GET_XPN_RESOURCES_PROJECTS_PAGE_STR_FACT);
+
+      listXpnHostsProjectsSettings = PagedCallSettings.newBuilder(
+          LIST_XPN_HOSTS_PROJECTS_PAGE_STR_FACT);
+
       moveDiskProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       moveInstanceProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -299,7 +498,14 @@ protected Builder(ClientContext clientContext) {
       setUsageExportBucketProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       unaryMethodSettingsBuilders = ImmutableList.>of(
+          disableXpnHostProjectSettings,
+          disableXpnResourceProjectSettings,
+          enableXpnHostProjectSettings,
+          enableXpnResourceProjectSettings,
           getProjectSettings,
+          getXpnHostProjectSettings,
+          getXpnResourcesProjectsSettings,
+          listXpnHostsProjectsSettings,
           moveDiskProjectSettings,
           moveInstanceProjectSettings,
           setCommonInstanceMetadataProjectSettings,
@@ -320,10 +526,38 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder.disableXpnHostProjectSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder.disableXpnResourceProjectSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder.enableXpnHostProjectSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder.enableXpnResourceProjectSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder.getProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder.getXpnHostProjectSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder.getXpnResourcesProjectsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder.listXpnHostsProjectsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder.moveDiskProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
@@ -346,14 +580,28 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ProjectStubSettings settings) {
       super(settings);
 
+      disableXpnHostProjectSettings = settings.disableXpnHostProjectSettings.toBuilder();
+      disableXpnResourceProjectSettings = settings.disableXpnResourceProjectSettings.toBuilder();
+      enableXpnHostProjectSettings = settings.enableXpnHostProjectSettings.toBuilder();
+      enableXpnResourceProjectSettings = settings.enableXpnResourceProjectSettings.toBuilder();
       getProjectSettings = settings.getProjectSettings.toBuilder();
+      getXpnHostProjectSettings = settings.getXpnHostProjectSettings.toBuilder();
+      getXpnResourcesProjectsSettings = settings.getXpnResourcesProjectsSettings.toBuilder();
+      listXpnHostsProjectsSettings = settings.listXpnHostsProjectsSettings.toBuilder();
       moveDiskProjectSettings = settings.moveDiskProjectSettings.toBuilder();
       moveInstanceProjectSettings = settings.moveInstanceProjectSettings.toBuilder();
       setCommonInstanceMetadataProjectSettings = settings.setCommonInstanceMetadataProjectSettings.toBuilder();
       setUsageExportBucketProjectSettings = settings.setUsageExportBucketProjectSettings.toBuilder();
 
       unaryMethodSettingsBuilders = ImmutableList.>of(
+          disableXpnHostProjectSettings,
+          disableXpnResourceProjectSettings,
+          enableXpnHostProjectSettings,
+          enableXpnResourceProjectSettings,
           getProjectSettings,
+          getXpnHostProjectSettings,
+          getXpnResourcesProjectsSettings,
+          listXpnHostsProjectsSettings,
           moveDiskProjectSettings,
           moveInstanceProjectSettings,
           setCommonInstanceMetadataProjectSettings,
@@ -375,6 +623,34 @@ public Builder applyToAllUnaryMethods(ApiFunction disableXpnHostProjectSettings() {
+      return disableXpnHostProjectSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to disableXpnResourceProject.
+     */
+    public UnaryCallSettings.Builder disableXpnResourceProjectSettings() {
+      return disableXpnResourceProjectSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to enableXpnHostProject.
+     */
+    public UnaryCallSettings.Builder enableXpnHostProjectSettings() {
+      return enableXpnHostProjectSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to enableXpnResourceProject.
+     */
+    public UnaryCallSettings.Builder enableXpnResourceProjectSettings() {
+      return enableXpnResourceProjectSettings;
+    }
+
     /**
      * Returns the builder for the settings used for calls to getProject.
      */
@@ -382,6 +658,27 @@ public UnaryCallSettings.Builder getProjectSetti
       return getProjectSettings;
     }
 
+    /**
+     * Returns the builder for the settings used for calls to getXpnHostProject.
+     */
+    public UnaryCallSettings.Builder getXpnHostProjectSettings() {
+      return getXpnHostProjectSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to getXpnResourcesProjects.
+     */
+    public PagedCallSettings.Builder getXpnResourcesProjectsSettings() {
+      return getXpnResourcesProjectsSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to listXpnHostsProjects.
+     */
+    public PagedCallSettings.Builder listXpnHostsProjectsSettings() {
+      return listXpnHostsProjectsSettings;
+    }
+
     /**
      * Returns the builder for the settings used for calls to moveDiskProject.
      */
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java
new file mode 100644
index 000000000000..b22a9f290ba7
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest;
+import com.google.cloud.compute.v1.Commitment;
+import com.google.cloud.compute.v1.CommitmentAggregatedList;
+import com.google.cloud.compute.v1.CommitmentList;
+import com.google.cloud.compute.v1.CommitmentName;
+import com.google.cloud.compute.v1.CommitmentsScopedList;
+import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest;
+import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest;
+import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectName;
+import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse;
+import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse;
+import com.google.cloud.compute.v1.RegionName;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Base stub class for compute.
+ *
+ * 

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionCommitmentStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable aggregatedListRegionCommitmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListRegionCommitmentsPagedCallable()"); + } + + @BetaApi + public UnaryCallable aggregatedListRegionCommitmentsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListRegionCommitmentsCallable()"); + } + + @BetaApi + public UnaryCallable getRegionCommitmentCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionCommitmentCallable()"); + } + + @BetaApi + public UnaryCallable insertRegionCommitmentCallable() { + throw new UnsupportedOperationException("Not implemented: insertRegionCommitmentCallable()"); + } + + @BetaApi + public UnaryCallable listRegionCommitmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionCommitmentsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionCommitmentsCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionCommitmentsCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java new file mode 100644 index 000000000000..24c5909ba899 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java @@ -0,0 +1,499 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest; +import com.google.cloud.compute.v1.Commitment; +import com.google.cloud.compute.v1.CommitmentAggregatedList; +import com.google.cloud.compute.v1.CommitmentList; +import com.google.cloud.compute.v1.CommitmentsScopedList; +import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest; +import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; +import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; +import com.google.cloud.compute.v1.Operation; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionCommitmentStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of getRegionCommitment to 30 seconds: + * + *

+ * 
+ * RegionCommitmentStubSettings.Builder regionCommitmentSettingsBuilder =
+ *     RegionCommitmentStubSettings.newBuilder();
+ * regionCommitmentSettingsBuilder.getRegionCommitmentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionCommitmentStubSettings regionCommitmentSettings = regionCommitmentSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class RegionCommitmentStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings aggregatedListRegionCommitmentsSettings; + private final UnaryCallSettings getRegionCommitmentSettings; + private final UnaryCallSettings insertRegionCommitmentSettings; + private final PagedCallSettings listRegionCommitmentsSettings; + + /** + * Returns the object with the settings used for calls to aggregatedListRegionCommitments. + */ + public PagedCallSettings aggregatedListRegionCommitmentsSettings() { + return aggregatedListRegionCommitmentsSettings; + } + + /** + * Returns the object with the settings used for calls to getRegionCommitment. + */ + public UnaryCallSettings getRegionCommitmentSettings() { + return getRegionCommitmentSettings; + } + + /** + * Returns the object with the settings used for calls to insertRegionCommitment. + */ + public UnaryCallSettings insertRegionCommitmentSettings() { + return insertRegionCommitmentSettings; + } + + /** + * Returns the object with the settings used for calls to listRegionCommitments. + */ + public PagedCallSettings listRegionCommitmentsSettings() { + return listRegionCommitmentsSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionCommitmentStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionCommitmentStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionCommitmentStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionCommitmentStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListRegionCommitmentsSettings = settingsBuilder.aggregatedListRegionCommitmentsSettings().build(); + getRegionCommitmentSettings = settingsBuilder.getRegionCommitmentSettings().build(); + insertRegionCommitmentSettings = settingsBuilder.insertRegionCommitmentSettings().build(); + listRegionCommitmentsSettings = settingsBuilder.listRegionCommitmentsSettings().build(); + } + + private static final PagedListDescriptor AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public AggregatedListRegionCommitmentsHttpRequest injectToken(AggregatedListRegionCommitmentsHttpRequest payload, String token) { + return AggregatedListRegionCommitmentsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public AggregatedListRegionCommitmentsHttpRequest injectPageSize(AggregatedListRegionCommitmentsHttpRequest payload, int pageSize) { + return AggregatedListRegionCommitmentsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(AggregatedListRegionCommitmentsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(CommitmentAggregatedList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(CommitmentAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor LIST_REGION_COMMITMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListRegionCommitmentsHttpRequest injectToken(ListRegionCommitmentsHttpRequest payload, String token) { + return ListRegionCommitmentsHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListRegionCommitmentsHttpRequest injectPageSize(ListRegionCommitmentsHttpRequest payload, int pageSize) { + return ListRegionCommitmentsHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListRegionCommitmentsHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(CommitmentList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(CommitmentList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListRegionCommitmentsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_DESC, request, context); + return AggregatedListRegionCommitmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_REGION_COMMITMENTS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionCommitmentsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_COMMITMENTS_PAGE_STR_DESC, request, context); + return ListRegionCommitmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for RegionCommitmentStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder aggregatedListRegionCommitmentsSettings; + private final UnaryCallSettings.Builder getRegionCommitmentSettings; + private final UnaryCallSettings.Builder insertRegionCommitmentSettings; + private final PagedCallSettings.Builder listRegionCommitmentsSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListRegionCommitmentsSettings = PagedCallSettings.newBuilder( + AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_FACT); + + getRegionCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRegionCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionCommitmentsSettings = PagedCallSettings.newBuilder( + LIST_REGION_COMMITMENTS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListRegionCommitmentsSettings, + getRegionCommitmentSettings, + insertRegionCommitmentSettings, + listRegionCommitmentsSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.aggregatedListRegionCommitmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getRegionCommitmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertRegionCommitmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listRegionCommitmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionCommitmentStubSettings settings) { + super(settings); + + aggregatedListRegionCommitmentsSettings = settings.aggregatedListRegionCommitmentsSettings.toBuilder(); + getRegionCommitmentSettings = settings.getRegionCommitmentSettings.toBuilder(); + insertRegionCommitmentSettings = settings.insertRegionCommitmentSettings.toBuilder(); + listRegionCommitmentsSettings = settings.listRegionCommitmentsSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + aggregatedListRegionCommitmentsSettings, + getRegionCommitmentSettings, + insertRegionCommitmentSettings, + listRegionCommitmentsSettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to aggregatedListRegionCommitments. + */ + public PagedCallSettings.Builder aggregatedListRegionCommitmentsSettings() { + return aggregatedListRegionCommitmentsSettings; + } + + /** + * Returns the builder for the settings used for calls to getRegionCommitment. + */ + public UnaryCallSettings.Builder getRegionCommitmentSettings() { + return getRegionCommitmentSettings; + } + + /** + * Returns the builder for the settings used for calls to insertRegionCommitment. + */ + public UnaryCallSettings.Builder insertRegionCommitmentSettings() { + return insertRegionCommitmentSettings; + } + + /** + * Returns the builder for the settings used for calls to listRegionCommitments. + */ + public PagedCallSettings.Builder listRegionCommitmentsSettings() { + return listRegionCommitmentsSettings; + } + + @Override + public RegionCommitmentStubSettings build() throws IOException { + return new RegionCommitmentStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java index c4b6ae380ec4..16ecc59e1863 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java @@ -20,9 +20,12 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; +import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectSnapshotName; +import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; @@ -60,4 +63,9 @@ public UnaryCallable listSnapshotsCallab throw new UnsupportedOperationException("Not implemented: listSnapshotsCallable()"); } + @BetaApi + public UnaryCallable setLabelsSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: setLabelsSnapshotCallable()"); + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java index 3ae65b73cd29..3fe0a5cfc5c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; - import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,6 +30,8 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -39,18 +41,23 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; +import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -61,15 +68,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default - * port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteSnapshot to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteSnapshot to 30 seconds: * *

  * 
@@ -84,39 +91,52 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SnapshotStubSettings extends StubSettings {
-  /** The default scopes of the service. */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
-      ImmutableList.builder()
-          .add("https://www.googleapis.com/auth/cloud-platform")
-          .add("https://www.googleapis.com/auth/compute")
-          .add("https://www.googleapis.com/auth/compute.readonly")
-          .add("https://www.googleapis.com/auth/devstorage.full_control")
-          .add("https://www.googleapis.com/auth/devstorage.read_only")
-          .add("https://www.googleapis.com/auth/devstorage.read_write")
-          .build();
+  /**
+   * The default scopes of the service.
+   */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
+      .add("https://www.googleapis.com/auth/cloud-platform")
+      .add("https://www.googleapis.com/auth/compute")
+      .add("https://www.googleapis.com/auth/compute.readonly")
+      .add("https://www.googleapis.com/auth/devstorage.full_control")
+      .add("https://www.googleapis.com/auth/devstorage.read_only")
+      .add("https://www.googleapis.com/auth/devstorage.read_write")
+      .build();
 
   private final UnaryCallSettings deleteSnapshotSettings;
   private final UnaryCallSettings getSnapshotSettings;
-  private final PagedCallSettings<
-          ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
-      listSnapshotsSettings;
+  private final PagedCallSettings listSnapshotsSettings;
+  private final UnaryCallSettings setLabelsSnapshotSettings;
 
-  /** Returns the object with the settings used for calls to deleteSnapshot. */
+  /**
+   * Returns the object with the settings used for calls to deleteSnapshot.
+   */
   public UnaryCallSettings deleteSnapshotSettings() {
     return deleteSnapshotSettings;
   }
 
-  /** Returns the object with the settings used for calls to getSnapshot. */
+  /**
+   * Returns the object with the settings used for calls to getSnapshot.
+   */
   public UnaryCallSettings getSnapshotSettings() {
     return getSnapshotSettings;
   }
 
-  /** Returns the object with the settings used for calls to listSnapshots. */
-  public PagedCallSettings
-      listSnapshotsSettings() {
+  /**
+   * Returns the object with the settings used for calls to listSnapshots.
+   */
+  public PagedCallSettings listSnapshotsSettings() {
     return listSnapshotsSettings;
   }
 
+  /**
+   * Returns the object with the settings used for calls to setLabelsSnapshot.
+   */
+  public UnaryCallSettings setLabelsSnapshotSettings() {
+    return setLabelsSnapshotSettings;
+  }
+
+
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public SnapshotStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -129,34 +149,47 @@ public SnapshotStub createStub() throws IOException {
     }
   }
 
-  /** Returns a builder for the default ExecutorProvider for this service. */
+  /**
+   * Returns a builder for the default ExecutorProvider for this service.
+   */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /** Returns the default service endpoint. */
+  /**
+   * Returns the default service endpoint.
+   */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /** Returns the default service port. */
+  /**
+   * Returns the default service port.
+   */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-  /** Returns the default service scopes. */
+
+  /**
+   * Returns the default service scopes.
+   */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-  /** Returns a builder for the default credentials for this service. */
+
+  /**
+   * Returns a builder for the default credentials for this service.
+   */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+    return GoogleCredentialsProvider.newBuilder()
+        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+        ;
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder
-      defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -168,22 +201,26 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SnapshotStubSettings.class))
-        .setTransportToken(
-            GaxHttpJsonProperties.getHttpJsonTokenName(),
-            GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /** Returns a new builder for this class. */
+  /**
+   * Returns a new builder for this class.
+   */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /** Returns a builder containing all the values of this settings class. */
+  /**
+   * Returns a builder containing all the values of this settings class.
+   */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -194,84 +231,79 @@ protected SnapshotStubSettings(Builder settingsBuilder) throws IOException {
     deleteSnapshotSettings = settingsBuilder.deleteSnapshotSettings().build();
     getSnapshotSettings = settingsBuilder.getSnapshotSettings().build();
     listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build();
+    setLabelsSnapshotSettings = settingsBuilder.setLabelsSnapshotSettings().build();
   }
 
-  private static final PagedListDescriptor
-      LIST_SNAPSHOTS_PAGE_STR_DESC =
-          new PagedListDescriptor() {
-            @Override
-            public String emptyToken() {
-              return "";
-            }
-
-            @Override
-            public ListSnapshotsHttpRequest injectToken(
-                ListSnapshotsHttpRequest payload, String token) {
-              return ListSnapshotsHttpRequest.newBuilder(payload).setPageToken(token).build();
-            }
-
-            @Override
-            public ListSnapshotsHttpRequest injectPageSize(
-                ListSnapshotsHttpRequest payload, int pageSize) {
-              return ListSnapshotsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
-            }
-
-            @Override
-            public Integer extractPageSize(ListSnapshotsHttpRequest payload) {
-              return payload.getMaxResults();
-            }
-
-            @Override
-            public String extractNextToken(SnapshotList payload) {
-              return payload.getNextPageToken();
-            }
-
-            @Override
-            public Iterable extractResources(SnapshotList payload) {
-              return payload.getItemsList();
-            }
-          };
-
-  private static final PagedListResponseFactory<
-          ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
-      LIST_SNAPSHOTS_PAGE_STR_FACT =
-          new PagedListResponseFactory<
-              ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>() {
-            @Override
-            public ApiFuture getFuturePagedResponse(
-                UnaryCallable callable,
-                ListSnapshotsHttpRequest request,
-                ApiCallContext context,
-                ApiFuture futureResponse) {
-              PageContext pageContext =
-                  PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context);
-              return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse);
-            }
-          };
-
-  /** Builder for SnapshotStubSettings. */
+  private static final PagedListDescriptor LIST_SNAPSHOTS_PAGE_STR_DESC =
+      new PagedListDescriptor() {
+        @Override
+        public String emptyToken() {
+          return "";
+        }
+        @Override
+        public ListSnapshotsHttpRequest injectToken(ListSnapshotsHttpRequest payload, String token) {
+          return ListSnapshotsHttpRequest
+            .newBuilder(payload)
+            .setPageToken(token)
+            .build();
+        }
+        @Override
+        public ListSnapshotsHttpRequest injectPageSize(ListSnapshotsHttpRequest payload, int pageSize) {
+          return ListSnapshotsHttpRequest
+            .newBuilder(payload)
+            .setMaxResults(pageSize)
+            .build();
+        }
+        @Override
+        public Integer extractPageSize(ListSnapshotsHttpRequest payload) {
+          return payload.getMaxResults();
+        }
+        @Override
+        public String extractNextToken(SnapshotList payload) {
+          return payload.getNextPageToken();
+        }
+        @Override
+        public Iterable extractResources(SnapshotList payload) {
+          return payload.getItemsList();
+        }
+      };
+
+  private static final PagedListResponseFactory LIST_SNAPSHOTS_PAGE_STR_FACT =
+      new PagedListResponseFactory() {
+        @Override
+        public ApiFuture getFuturePagedResponse(
+            UnaryCallable callable,
+            ListSnapshotsHttpRequest request,
+            ApiCallContext context,
+            ApiFuture futureResponse) {
+          PageContext pageContext =
+              PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context);
+          return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse);
+        }
+      };
+
+
+  /**
+   * Builder for SnapshotStubSettings.
+   */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        deleteSnapshotSettings;
+    private final UnaryCallSettings.Builder deleteSnapshotSettings;
     private final UnaryCallSettings.Builder getSnapshotSettings;
-    private final PagedCallSettings.Builder<
-            ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
-        listSnapshotsSettings;
+    private final PagedCallSettings.Builder listSnapshotsSettings;
+    private final UnaryCallSettings.Builder setLabelsSnapshotSettings;
 
-    private static final ImmutableMap>
-        RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions =
-          ImmutableMap.builder();
+      ImmutableMap.Builder> definitions = ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(
-              Lists.newArrayList(
-                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "non_idempotent",
+          ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -280,16 +312,15 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings =
-          RetrySettings.newBuilder()
-              .setInitialRetryDelay(Duration.ofMillis(100L))
-              .setRetryDelayMultiplier(1.3)
-              .setMaxRetryDelay(Duration.ofMillis(60000L))
-              .setInitialRpcTimeout(Duration.ofMillis(20000L))
-              .setRpcTimeoutMultiplier(1.0)
-              .setMaxRpcTimeout(Duration.ofMillis(20000L))
-              .setTotalTimeout(Duration.ofMillis(600000L))
-              .build();
+      settings = RetrySettings.newBuilder()
+          .setInitialRetryDelay(Duration.ofMillis(100L))
+          .setRetryDelayMultiplier(1.3)
+          .setMaxRetryDelay(Duration.ofMillis(60000L))
+          .setInitialRpcTimeout(Duration.ofMillis(20000L))
+          .setRpcTimeoutMultiplier(1.0)
+          .setMaxRpcTimeout(Duration.ofMillis(20000L))
+          .setTotalTimeout(Duration.ofMillis(600000L))
+          .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -305,11 +336,17 @@ protected Builder(ClientContext clientContext) {
 
       getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT);
+      listSnapshotsSettings = PagedCallSettings.newBuilder(
+          LIST_SNAPSHOTS_PAGE_STR_FACT);
+
+      setLabelsSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders =
-          ImmutableList.>of(
-              deleteSnapshotSettings, getSnapshotSettings, listSnapshotsSettings);
+      unaryMethodSettingsBuilders = ImmutableList.>of(
+          deleteSnapshotSettings,
+          getSnapshotSettings,
+          listSnapshotsSettings,
+          setLabelsSnapshotSettings
+      );
 
       initDefaults(this);
     }
@@ -325,21 +362,22 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder
-          .deleteSnapshotSettings()
+      builder.deleteSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .getSnapshotSettings()
+      builder.getSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .listSnapshotsSettings()
+      builder.listSnapshotsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder.setLabelsSnapshotSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       return builder;
     }
 
@@ -349,19 +387,22 @@ protected Builder(SnapshotStubSettings settings) {
       deleteSnapshotSettings = settings.deleteSnapshotSettings.toBuilder();
       getSnapshotSettings = settings.getSnapshotSettings.toBuilder();
       listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder();
-
-      unaryMethodSettingsBuilders =
-          ImmutableList.>of(
-              deleteSnapshotSettings, getSnapshotSettings, listSnapshotsSettings);
+      setLabelsSnapshotSettings = settings.setLabelsSnapshotSettings.toBuilder();
+
+      unaryMethodSettingsBuilders = ImmutableList.>of(
+          deleteSnapshotSettings,
+          getSnapshotSettings,
+          listSnapshotsSettings,
+          setLabelsSnapshotSettings
+      );
     }
 
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * 

Note: This method does not support applying settings to streaming methods. + * Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -370,27 +411,37 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to deleteSnapshot. */ - public UnaryCallSettings.Builder - deleteSnapshotSettings() { + /** + * Returns the builder for the settings used for calls to deleteSnapshot. + */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { return deleteSnapshotSettings; } - /** Returns the builder for the settings used for calls to getSnapshot. */ + /** + * Returns the builder for the settings used for calls to getSnapshot. + */ public UnaryCallSettings.Builder getSnapshotSettings() { return getSnapshotSettings; } - /** Returns the builder for the settings used for calls to listSnapshots. */ - public PagedCallSettings.Builder< - ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> - listSnapshotsSettings() { + /** + * Returns the builder for the settings used for calls to listSnapshots. + */ + public PagedCallSettings.Builder listSnapshotsSettings() { return listSnapshotsSettings; } + /** + * Returns the builder for the settings used for calls to setLabelsSnapshot. + */ + public UnaryCallSettings.Builder setLabelsSnapshotSettings() { + return setLabelsSnapshotSettings; + } + @Override public SnapshotStubSettings build() throws IOException { return new SnapshotStubSettings(this); } } -} +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java index 39100b457fc7..0270218722a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java @@ -25,8 +25,10 @@ import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.RegionName; +import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; @@ -35,6 +37,7 @@ import com.google.cloud.compute.v1.SubnetworkName; import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -88,4 +91,14 @@ public UnaryCallable listSubnetworks throw new UnsupportedOperationException("Not implemented: listSubnetworksCallable()"); } + @BetaApi + public UnaryCallable patchSubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: patchSubnetworkCallable()"); + } + + @BetaApi + public UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: setPrivateIpGoogleAccessSubnetworkCallable()"); + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java index 086c062c2253..edd379bbb78c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java @@ -49,6 +49,8 @@ import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; +import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; @@ -114,6 +116,8 @@ public class SubnetworkStubSettings extends StubSettings private final UnaryCallSettings getSubnetworkSettings; private final UnaryCallSettings insertSubnetworkSettings; private final PagedCallSettings listSubnetworksSettings; + private final UnaryCallSettings patchSubnetworkSettings; + private final UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings; /** * Returns the object with the settings used for calls to aggregatedListSubnetworks. @@ -157,6 +161,20 @@ public PagedCallSettings patchSubnetworkSettings() { + return patchSubnetworkSettings; + } + + /** + * Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork. + */ + public UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings() { + return setPrivateIpGoogleAccessSubnetworkSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public SubnetworkStub createStub() throws IOException { @@ -255,6 +273,8 @@ protected SubnetworkStubSettings(Builder settingsBuilder) throws IOException { getSubnetworkSettings = settingsBuilder.getSubnetworkSettings().build(); insertSubnetworkSettings = settingsBuilder.insertSubnetworkSettings().build(); listSubnetworksSettings = settingsBuilder.listSubnetworksSettings().build(); + patchSubnetworkSettings = settingsBuilder.patchSubnetworkSettings().build(); + setPrivateIpGoogleAccessSubnetworkSettings = settingsBuilder.setPrivateIpGoogleAccessSubnetworkSettings().build(); } private static final PagedListDescriptor AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC = @@ -366,6 +386,8 @@ public static class Builder extends StubSettings.Builder getSubnetworkSettings; private final UnaryCallSettings.Builder insertSubnetworkSettings; private final PagedCallSettings.Builder listSubnetworksSettings; + private final UnaryCallSettings.Builder patchSubnetworkSettings; + private final UnaryCallSettings.Builder setPrivateIpGoogleAccessSubnetworkSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -419,13 +441,19 @@ protected Builder(ClientContext clientContext) { listSubnetworksSettings = PagedCallSettings.newBuilder( LIST_SUBNETWORKS_PAGE_STR_FACT); + patchSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setPrivateIpGoogleAccessSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListSubnetworksSettings, deleteSubnetworkSettings, expandIpCidrRangeSubnetworkSettings, getSubnetworkSettings, insertSubnetworkSettings, - listSubnetworksSettings + listSubnetworksSettings, + patchSubnetworkSettings, + setPrivateIpGoogleAccessSubnetworkSettings ); initDefaults(this); @@ -466,6 +494,14 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder.patchSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setPrivateIpGoogleAccessSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -478,6 +514,8 @@ protected Builder(SubnetworkStubSettings settings) { getSubnetworkSettings = settings.getSubnetworkSettings.toBuilder(); insertSubnetworkSettings = settings.insertSubnetworkSettings.toBuilder(); listSubnetworksSettings = settings.listSubnetworksSettings.toBuilder(); + patchSubnetworkSettings = settings.patchSubnetworkSettings.toBuilder(); + setPrivateIpGoogleAccessSubnetworkSettings = settings.setPrivateIpGoogleAccessSubnetworkSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListSubnetworksSettings, @@ -485,7 +523,9 @@ protected Builder(SubnetworkStubSettings settings) { expandIpCidrRangeSubnetworkSettings, getSubnetworkSettings, insertSubnetworkSettings, - listSubnetworksSettings + listSubnetworksSettings, + patchSubnetworkSettings, + setPrivateIpGoogleAccessSubnetworkSettings ); } @@ -545,6 +585,20 @@ public PagedCallSettings.Builder patchSubnetworkSettings() { + return patchSubnetworkSettings; + } + + /** + * Returns the builder for the settings used for calls to setPrivateIpGoogleAccessSubnetwork. + */ + public UnaryCallSettings.Builder setPrivateIpGoogleAccessSubnetworkSettings() { + return setPrivateIpGoogleAccessSubnetworkSettings; + } + @Override public SubnetworkStubSettings build() throws IOException { return new SubnetworkStubSettings(this); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java new file mode 100644 index 000000000000..d754630513ac --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java @@ -0,0 +1,83 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; +import com.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; +import com.google.cloud.compute.v1.TargetTcpProxy; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetTcpProxyList; +import com.google.cloud.compute.v1.TargetTcpProxyName; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TargetTcpProxyStub implements BackgroundResource { + + + @BetaApi + public UnaryCallable deleteTargetTcpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTargetTcpProxyCallable()"); + } + + @BetaApi + public UnaryCallable getTargetTcpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: getTargetTcpProxyCallable()"); + } + + @BetaApi + public UnaryCallable insertTargetTcpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: insertTargetTcpProxyCallable()"); + } + + @BetaApi + public UnaryCallable listTargetTcpProxiesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetTcpProxiesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listTargetTcpProxiesCallable() { + throw new UnsupportedOperationException("Not implemented: listTargetTcpProxiesCallable()"); + } + + @BetaApi + public UnaryCallable setBackendServiceTargetTcpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setBackendServiceTargetTcpProxyCallable()"); + } + + @BetaApi + public UnaryCallable setProxyHeaderTargetTcpProxyCallable() { + throw new UnsupportedOperationException("Not implemented: setProxyHeaderTargetTcpProxyCallable()"); + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java new file mode 100644 index 000000000000..97ef3380a24f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.GetTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; +import com.google.cloud.compute.v1.TargetTcpProxy; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import com.google.cloud.compute.v1.TargetTcpProxyList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link TargetTcpProxyStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. For example, to set the total timeout of deleteTargetTcpProxy to 30 seconds: + * + *

+ * 
+ * TargetTcpProxyStubSettings.Builder targetTcpProxySettingsBuilder =
+ *     TargetTcpProxyStubSettings.newBuilder();
+ * targetTcpProxySettingsBuilder.deleteTargetTcpProxySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * TargetTcpProxyStubSettings targetTcpProxySettings = targetTcpProxySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class TargetTcpProxyStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteTargetTcpProxySettings; + private final UnaryCallSettings getTargetTcpProxySettings; + private final UnaryCallSettings insertTargetTcpProxySettings; + private final PagedCallSettings listTargetTcpProxiesSettings; + private final UnaryCallSettings setBackendServiceTargetTcpProxySettings; + private final UnaryCallSettings setProxyHeaderTargetTcpProxySettings; + + /** + * Returns the object with the settings used for calls to deleteTargetTcpProxy. + */ + public UnaryCallSettings deleteTargetTcpProxySettings() { + return deleteTargetTcpProxySettings; + } + + /** + * Returns the object with the settings used for calls to getTargetTcpProxy. + */ + public UnaryCallSettings getTargetTcpProxySettings() { + return getTargetTcpProxySettings; + } + + /** + * Returns the object with the settings used for calls to insertTargetTcpProxy. + */ + public UnaryCallSettings insertTargetTcpProxySettings() { + return insertTargetTcpProxySettings; + } + + /** + * Returns the object with the settings used for calls to listTargetTcpProxies. + */ + public PagedCallSettings listTargetTcpProxiesSettings() { + return listTargetTcpProxiesSettings; + } + + /** + * Returns the object with the settings used for calls to setBackendServiceTargetTcpProxy. + */ + public UnaryCallSettings setBackendServiceTargetTcpProxySettings() { + return setBackendServiceTargetTcpProxySettings; + } + + /** + * Returns the object with the settings used for calls to setProxyHeaderTargetTcpProxy. + */ + public UnaryCallSettings setProxyHeaderTargetTcpProxySettings() { + return setProxyHeaderTargetTcpProxySettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TargetTcpProxyStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTargetTcpProxyStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** + * Returns the default service port. + */ + public static int getDefaultServicePort() { + return 443; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetTcpProxyStubSettings.class)) + .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TargetTcpProxyStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteTargetTcpProxySettings = settingsBuilder.deleteTargetTcpProxySettings().build(); + getTargetTcpProxySettings = settingsBuilder.getTargetTcpProxySettings().build(); + insertTargetTcpProxySettings = settingsBuilder.insertTargetTcpProxySettings().build(); + listTargetTcpProxiesSettings = settingsBuilder.listTargetTcpProxiesSettings().build(); + setBackendServiceTargetTcpProxySettings = settingsBuilder.setBackendServiceTargetTcpProxySettings().build(); + setProxyHeaderTargetTcpProxySettings = settingsBuilder.setProxyHeaderTargetTcpProxySettings().build(); + } + + private static final PagedListDescriptor LIST_TARGET_TCP_PROXIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListTargetTcpProxiesHttpRequest injectToken(ListTargetTcpProxiesHttpRequest payload, String token) { + return ListTargetTcpProxiesHttpRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListTargetTcpProxiesHttpRequest injectPageSize(ListTargetTcpProxiesHttpRequest payload, int pageSize) { + return ListTargetTcpProxiesHttpRequest + .newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListTargetTcpProxiesHttpRequest payload) { + return payload.getMaxResults(); + } + @Override + public String extractNextToken(TargetTcpProxyList payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(TargetTcpProxyList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory LIST_TARGET_TCP_PROXIES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTargetTcpProxiesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TARGET_TCP_PROXIES_PAGE_STR_DESC, request, context); + return ListTargetTcpProxiesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + + /** + * Builder for TargetTcpProxyStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder deleteTargetTcpProxySettings; + private final UnaryCallSettings.Builder getTargetTcpProxySettings; + private final UnaryCallSettings.Builder insertTargetTcpProxySettings; + private final PagedCallSettings.Builder listTargetTcpProxiesSettings; + private final UnaryCallSettings.Builder setBackendServiceTargetTcpProxySettings; + private final UnaryCallSettings.Builder setProxyHeaderTargetTcpProxySettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listTargetTcpProxiesSettings = PagedCallSettings.newBuilder( + LIST_TARGET_TCP_PROXIES_PAGE_STR_FACT); + + setBackendServiceTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setProxyHeaderTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetTcpProxySettings, + getTargetTcpProxySettings, + insertTargetTcpProxySettings, + listTargetTcpProxiesSettings, + setBackendServiceTargetTcpProxySettings, + setProxyHeaderTargetTcpProxySettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.deleteTargetTcpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getTargetTcpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.insertTargetTcpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listTargetTcpProxiesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setBackendServiceTargetTcpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.setProxyHeaderTargetTcpProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(TargetTcpProxyStubSettings settings) { + super(settings); + + deleteTargetTcpProxySettings = settings.deleteTargetTcpProxySettings.toBuilder(); + getTargetTcpProxySettings = settings.getTargetTcpProxySettings.toBuilder(); + insertTargetTcpProxySettings = settings.insertTargetTcpProxySettings.toBuilder(); + listTargetTcpProxiesSettings = settings.listTargetTcpProxiesSettings.toBuilder(); + setBackendServiceTargetTcpProxySettings = settings.setBackendServiceTargetTcpProxySettings.toBuilder(); + setProxyHeaderTargetTcpProxySettings = settings.setProxyHeaderTargetTcpProxySettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + deleteTargetTcpProxySettings, + getTargetTcpProxySettings, + insertTargetTcpProxySettings, + listTargetTcpProxiesSettings, + setBackendServiceTargetTcpProxySettings, + setProxyHeaderTargetTcpProxySettings + ); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to deleteTargetTcpProxy. + */ + public UnaryCallSettings.Builder deleteTargetTcpProxySettings() { + return deleteTargetTcpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to getTargetTcpProxy. + */ + public UnaryCallSettings.Builder getTargetTcpProxySettings() { + return getTargetTcpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to insertTargetTcpProxy. + */ + public UnaryCallSettings.Builder insertTargetTcpProxySettings() { + return insertTargetTcpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to listTargetTcpProxies. + */ + public PagedCallSettings.Builder listTargetTcpProxiesSettings() { + return listTargetTcpProxiesSettings; + } + + /** + * Returns the builder for the settings used for calls to setBackendServiceTargetTcpProxy. + */ + public UnaryCallSettings.Builder setBackendServiceTargetTcpProxySettings() { + return setBackendServiceTargetTcpProxySettings; + } + + /** + * Returns the builder for the settings used for calls to setProxyHeaderTargetTcpProxy. + */ + public UnaryCallSettings.Builder setProxyHeaderTargetTcpProxySettings() { + return setProxyHeaderTargetTcpProxySettings; + } + + @Override + public TargetTcpProxyStubSettings build() throws IOException { + return new TargetTcpProxyStubSettings(this); + } + } +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java new file mode 100644 index 000000000000..597fd37778a9 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java @@ -0,0 +1,244 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import com.google.cloud.compute.v1.stub.AcceleratorTypeStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.aggregatedListAcceleratorTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.getAcceleratorTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.listAcceleratorTypesMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class AcceleratorTypeClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAcceleratorTypesMethodDescriptor, + getAcceleratorTypeMethodDescriptor, + listAcceleratorTypesMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, AcceleratorTypeStubSettings.getDefaultEndpoint()); + + private static AcceleratorTypeClient client; + private static AcceleratorTypeSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + AcceleratorTypeSettings.newBuilder() + .setTransportChannelProvider( + AcceleratorTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + AcceleratorTypeClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListAcceleratorTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + AcceleratorTypesScopedList itemsItem = AcceleratorTypesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + AcceleratorTypeAggregatedList expectedResponse = AcceleratorTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListAcceleratorTypesPagedResponse pagedListResponse = client.aggregatedListAcceleratorTypes(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListAcceleratorTypesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListAcceleratorTypes(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getAcceleratorTypeTest() { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + Integer maximumCardsPerInstance = 1883669166; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + AcceleratorType expectedResponse = AcceleratorType.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setMaximumCardsPerInstance(maximumCardsPerInstance) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); + + AcceleratorType actualResponse = + client.getAcceleratorType(acceleratorType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getAcceleratorTypeExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); + + client.getAcceleratorType(acceleratorType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listAcceleratorTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + AcceleratorType itemsElement = AcceleratorType.newBuilder().build(); + List items = Arrays.asList(itemsElement); + AcceleratorTypeList expectedResponse = AcceleratorTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listAcceleratorTypesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + + client.listAcceleratorTypes(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index 96efa68744ce..e7541c51e0ce 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -189,9 +189,10 @@ public void deleteAddressTest() { mockService.addResponse(expectedResponse); AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteAddress(address); + client.deleteAddress(address, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -211,8 +212,9 @@ public void deleteAddressExceptionTest() throws Exception { try { AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + String requestId = "requestId37109963"; - client.deleteAddress(address); + client.deleteAddress(address, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -223,23 +225,29 @@ public void deleteAddressExceptionTest() throws Exception { @SuppressWarnings("all") public void getAddressTest() { ProjectAddressName address2 = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String addressType = "addressType264307877"; String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + String ipVersion = "ipVersion-1315653184"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String description = "description-1724546052"; String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; String status = "status-892481550"; Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) + .setAddressType(addressType) .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) .setCreationTimestamp(creationTimestamp) .setName(name) - .setDescription(description) .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -324,11 +332,12 @@ public void insertAddressTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Address addressResource = Address.newBuilder().build(); Operation actualResponse = - client.insertAddress(region, addressResource); + client.insertAddress(requestId, region, addressResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -347,10 +356,11 @@ public void insertAddressExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Address addressResource = Address.newBuilder().build(); - client.insertAddress(region, addressResource); + client.insertAddress(requestId, region, addressResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index b615d1b6834a..9dd3be679506 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; - import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -35,7 +25,16 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -52,18 +51,18 @@ @javax.annotation.Generated("by GAPIC") public class AutoscalerClientTest { - private static final List METHOD_DESCRIPTORS = - ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListAutoscalersMethodDescriptor, - deleteAutoscalerMethodDescriptor, - getAutoscalerMethodDescriptor, - insertAutoscalerMethodDescriptor, - listAutoscalersMethodDescriptor, - patchAutoscalerMethodDescriptor, - updateAutoscalerMethodDescriptor)); - private static final MockHttpService mockService = - new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAutoscalersMethodDescriptor, + deleteAutoscalerMethodDescriptor, + getAutoscalerMethodDescriptor, + insertAutoscalerMethodDescriptor, + listAutoscalersMethodDescriptor, + patchAutoscalerMethodDescriptor, + updateAutoscalerMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); private static AutoscalerClient client; private static AutoscalerSettings clientSettings; @@ -72,13 +71,13 @@ public class AutoscalerClientTest { public static void setUp() throws IOException { clientSettings = AutoscalerSettings.newBuilder() - .setTransportChannelProvider( - AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = AutoscalerClient.create(clientSettings); + .setTransportChannelProvider( + AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + AutoscalerClient.create(clientSettings); } @After @@ -101,47 +100,37 @@ public void aggregatedListAutoscalersTest() { AutoscalersScopedList itemsItem = AutoscalersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - AutoscalerAggregatedList expectedResponse = - AutoscalerAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + AutoscalerAggregatedList expectedResponse = AutoscalerAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListAutoscalersPagedResponse pagedListResponse = - client.aggregatedListAutoscalers(project); + AggregatedListAutoscalersPagedResponse pagedListResponse = client.aggregatedListAutoscalers(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals( - expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void aggregatedListAutoscalersExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -178,64 +167,58 @@ public void deleteAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + String requestId = "requestId37109963"; - Operation actualResponse = client.deleteAutoscaler(autoscaler); + Operation actualResponse = + client.deleteAutoscaler(autoscaler, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void deleteAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + String requestId = "requestId37109963"; - client.deleteAutoscaler(autoscaler); + client.deleteAutoscaler(autoscaler, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -253,47 +236,41 @@ public void getAutoscalerTest() { String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; String target = "target-880905839"; - Autoscaler expectedResponse = - Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setTarget(target) - .build(); + Autoscaler expectedResponse = Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .setTarget(target) + .build(); mockService.addResponse(expectedResponse); AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - Autoscaler actualResponse = client.getAutoscaler(autoscaler); + Autoscaler actualResponse = + client.getAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void getAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -330,66 +307,60 @@ public void insertAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.insertAutoscaler(zone, autoscalerResource); + Operation actualResponse = + client.insertAutoscaler(zone, requestId, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void insertAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.insertAutoscaler(zone, autoscalerResource); + client.insertAutoscaler(zone, requestId, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -405,14 +376,13 @@ public void listAutoscalersTest() { String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); - AutoscalerList expectedResponse = - AutoscalerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + AutoscalerList expectedResponse = AutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); @@ -421,29 +391,22 @@ public void listAutoscalersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void listAutoscalersExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -480,68 +443,62 @@ public void patchAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.patchAutoscaler(autoscaler, zone, autoscalerResource); + Operation actualResponse = + client.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void patchAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String autoscaler = "autoscaler517258967"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.patchAutoscaler(autoscaler, zone, autoscalerResource); + client.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -572,71 +529,66 @@ public void updateAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.updateAutoscaler(autoscaler, zone, autoscalerResource); + Operation actualResponse = + client.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void updateAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String autoscaler = "autoscaler517258967"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.updateAutoscaler(autoscaler, zone, autoscalerResource); + client.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java new file mode 100644 index 000000000000..cc4b0a05c5be --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java @@ -0,0 +1,530 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import com.google.cloud.compute.v1.stub.BackendBucketStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.deleteBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.getBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.insertBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.listBackendBucketsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.patchBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.updateBackendBucketMethodDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class BackendBucketClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteBackendBucketMethodDescriptor, + getBackendBucketMethodDescriptor, + insertBackendBucketMethodDescriptor, + listBackendBucketsMethodDescriptor, + patchBackendBucketMethodDescriptor, + updateBackendBucketMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, BackendBucketStubSettings.getDefaultEndpoint()); + + private static BackendBucketClient client; + private static BackendBucketSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + BackendBucketSettings.newBuilder() + .setTransportChannelProvider( + BackendBucketSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + BackendBucketClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteBackendBucketTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String requestId = "requestId37109963"; + + Operation actualResponse = + client.deleteBackendBucket(backendBucket, requestId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteBackendBucketExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String requestId = "requestId37109963"; + + client.deleteBackendBucket(backendBucket, requestId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBackendBucketTest() { + String bucketName = "bucketName283610048"; + Boolean enableCdn = false; + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + BackendBucket expectedResponse = BackendBucket.newBuilder() + .setBucketName(bucketName) + .setEnableCdn(enableCdn) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + + BackendBucket actualResponse = + client.getBackendBucket(backendBucket); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getBackendBucketExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + + client.getBackendBucket(backendBucket); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertBackendBucketTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); + + Operation actualResponse = + client.insertBackendBucket(requestId, project, backendBucketResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertBackendBucketExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); + + client.insertBackendBucket(requestId, project, backendBucketResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBackendBucketsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + BackendBucket itemsElement = BackendBucket.newBuilder().build(); + List items = Arrays.asList(itemsElement); + BackendBucketList expectedResponse = BackendBucketList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListBackendBucketsPagedResponse pagedListResponse = client.listBackendBuckets(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listBackendBucketsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listBackendBuckets(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchBackendBucketTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String requestId = "requestId37109963"; + BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); + + Operation actualResponse = + client.patchBackendBucket(backendBucket, requestId, backendBucketResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchBackendBucketExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String requestId = "requestId37109963"; + BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); + + client.patchBackendBucket(backendBucket, requestId, backendBucketResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBackendBucketTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String requestId = "requestId37109963"; + BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); + + Operation actualResponse = + client.updateBackendBucket(backendBucket, requestId, backendBucketResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateBackendBucketExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String requestId = "requestId37109963"; + BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); + + client.updateBackendBucket(backendBucket, requestId, backendBucketResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index 07c96cfa00ba..f37845980f38 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -194,10 +194,11 @@ public void deleteBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); Operation actualResponse = - client.deleteBackendService(backendService); + client.deleteBackendService(requestId, backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -216,9 +217,10 @@ public void deleteBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - client.deleteBackendService(backendService); + client.deleteBackendService(requestId, backendService); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -386,11 +388,12 @@ public void insertBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.insertBackendService(project, backendServiceResource); + client.insertBackendService(requestId, project, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -409,10 +412,11 @@ public void insertBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.insertBackendService(project, backendServiceResource); + client.insertBackendService(requestId, project, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -520,11 +524,12 @@ public void patchBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.patchBackendService(backendService, backendServiceResource); + client.patchBackendService(requestId, backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -543,10 +548,11 @@ public void patchBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.patchBackendService(backendService, backendServiceResource); + client.patchBackendService(requestId, backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -602,11 +608,12 @@ public void updateBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.updateBackendService(backendService, backendServiceResource); + client.updateBackendService(requestId, backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -625,10 +632,11 @@ public void updateBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.updateBackendService(backendService, backendServiceResource); + client.updateBackendService(requestId, backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 59b447addd99..24b84581e94f 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -35,6 +35,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.insertDiskMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.listDisksMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.resizeDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.setLabelsDiskMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -59,7 +60,8 @@ public class DiskClientTest { getDiskMethodDescriptor, insertDiskMethodDescriptor, listDisksMethodDescriptor, - resizeDiskMethodDescriptor + resizeDiskMethodDescriptor, + setLabelsDiskMethodDescriptor )); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, DiskStubSettings.getDefaultEndpoint()); @@ -193,10 +195,12 @@ public void createSnapshotDiskTest() { mockService.addResponse(expectedResponse); DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + String requestId = "requestId37109963"; + Boolean guestFlush = false; Snapshot snapshotResource = Snapshot.newBuilder().build(); Operation actualResponse = - client.createSnapshotDisk(disk, snapshotResource); + client.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -216,9 +220,11 @@ public void createSnapshotDiskExceptionTest() throws Exception { try { DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + String requestId = "requestId37109963"; + Boolean guestFlush = false; Snapshot snapshotResource = Snapshot.newBuilder().build(); - client.createSnapshotDisk(disk, snapshotResource); + client.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -275,9 +281,10 @@ public void deleteDiskTest() { mockService.addResponse(expectedResponse); DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteDisk(disk); + client.deleteDisk(disk, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -297,8 +304,9 @@ public void deleteDiskExceptionTest() throws Exception { try { DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + String requestId = "requestId37109963"; - client.deleteDisk(disk); + client.deleteDisk(disk, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -310,37 +318,39 @@ public void deleteDiskExceptionTest() throws Exception { public void getDiskTest() { String sizeGb = "sizeGb2105542105"; String sourceSnapshotId = "sourceSnapshotId-1511650478"; - String sourceImageId = "sourceImageId-2092155357"; String lastDetachTimestamp = "lastDetachTimestamp-480399885"; - String kind = "kind3292052"; String description = "description-1724546052"; String sourceSnapshot = "sourceSnapshot-947679896"; String type = "type3575610"; - String lastAttachTimestamp = "lastAttachTimestamp-2105323995"; - String selfLink = "selfLink-1691268851"; + String labelFingerprint = "labelFingerprint714995737"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String options = "options-1249474914"; String id = "id3355"; + String sourceImageId = "sourceImageId-2092155357"; + String kind = "kind3292052"; + String lastAttachTimestamp = "lastAttachTimestamp-2105323995"; + String selfLink = "selfLink-1691268851"; + String name = "name3373707"; String sourceImage = "sourceImage1661056055"; String status = "status-892481550"; Disk expectedResponse = Disk.newBuilder() .setSizeGb(sizeGb) .setSourceSnapshotId(sourceSnapshotId) - .setSourceImageId(sourceImageId) .setLastDetachTimestamp(lastDetachTimestamp) - .setKind(kind) .setDescription(description) .setSourceSnapshot(sourceSnapshot) .setType(type) - .setLastAttachTimestamp(lastAttachTimestamp) - .setSelfLink(selfLink) + .setLabelFingerprint(labelFingerprint) .setZone(zone.toString()) .setCreationTimestamp(creationTimestamp) - .setName(name) .setOptions(options) .setId(id) + .setSourceImageId(sourceImageId) + .setKind(kind) + .setLastAttachTimestamp(lastAttachTimestamp) + .setSelfLink(selfLink) + .setName(name) .setSourceImage(sourceImage) .setStatus(status) .build(); @@ -427,11 +437,12 @@ public void insertDiskTest() { mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; String sourceImage = "sourceImage1661056055"; Disk diskResource = Disk.newBuilder().build(); Operation actualResponse = - client.insertDisk(zone, sourceImage, diskResource); + client.insertDisk(zone, requestId, sourceImage, diskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -451,10 +462,11 @@ public void insertDiskExceptionTest() throws Exception { try { ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; String sourceImage = "sourceImage1661056055"; Disk diskResource = Disk.newBuilder().build(); - client.insertDisk(zone, sourceImage, diskResource); + client.insertDisk(zone, requestId, sourceImage, diskResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -563,10 +575,11 @@ public void resizeDiskTest() { mockService.addResponse(expectedResponse); DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + String requestId = "requestId37109963"; DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); Operation actualResponse = - client.resizeDisk(disk, disksResizeRequestResource); + client.resizeDisk(disk, requestId, disksResizeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -586,9 +599,94 @@ public void resizeDiskExceptionTest() throws Exception { try { DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + String requestId = "requestId37109963"; DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); - client.resizeDisk(disk, disksResizeRequestResource); + client.resizeDisk(disk, requestId, disksResizeRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setLabelsDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + String requestId = "requestId37109963"; + ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build(); + + Operation actualResponse = + client.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setLabelsDiskExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + String requestId = "requestId37109963"; + ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build(); + + client.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java index 1082ffb3705b..a544e79fdf2a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -137,9 +137,10 @@ public void deleteFirewallTest() { mockService.addResponse(expectedResponse); FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteFirewall(firewall); + client.deleteFirewall(firewall, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -159,8 +160,9 @@ public void deleteFirewallExceptionTest() throws Exception { try { FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + String requestId = "requestId37109963"; - client.deleteFirewall(firewall); + client.deleteFirewall(firewall, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -171,20 +173,24 @@ public void deleteFirewallExceptionTest() throws Exception { @SuppressWarnings("all") public void getFirewallTest() { String kind = "kind3292052"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; - String id = "id3355"; + Integer priority = 1165461084; NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String direction = "direction-962590849"; Firewall expectedResponse = Firewall.newBuilder() .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) - .setId(id) + .setPriority(priority) .setNetwork(network.toString()) .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setDirection(direction) .build(); mockService.addResponse(expectedResponse); @@ -268,11 +274,12 @@ public void insertFirewallTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Firewall firewallResource = Firewall.newBuilder().build(); Operation actualResponse = - client.insertFirewall(project, firewallResource); + client.insertFirewall(requestId, project, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -291,10 +298,11 @@ public void insertFirewallExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Firewall firewallResource = Firewall.newBuilder().build(); - client.insertFirewall(project, firewallResource); + client.insertFirewall(requestId, project, firewallResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -403,10 +411,11 @@ public void patchFirewallTest() { mockService.addResponse(expectedResponse); FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); Operation actualResponse = - client.patchFirewall(firewall, firewallResource); + client.patchFirewall(firewall, requestId, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -426,9 +435,10 @@ public void patchFirewallExceptionTest() throws Exception { try { FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - client.patchFirewall(firewall, firewallResource); + client.patchFirewall(firewall, requestId, firewallResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -485,10 +495,11 @@ public void updateFirewallTest() { mockService.addResponse(expectedResponse); FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); Operation actualResponse = - client.updateFirewall(firewall, firewallResource); + client.updateFirewall(firewall, requestId, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -508,9 +519,10 @@ public void updateFirewallExceptionTest() throws Exception { try { FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]"); + String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - client.updateFirewall(firewall, firewallResource); + client.updateFirewall(firewall, requestId, firewallResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 4d567934a89a..e4635281d5d8 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -190,10 +190,11 @@ public void deleteForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); Operation actualResponse = - client.deleteForwardingRule(forwardingRule); + client.deleteForwardingRule(requestId, forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -212,9 +213,10 @@ public void deleteForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); - client.deleteForwardingRule(forwardingRule); + client.deleteForwardingRule(requestId, forwardingRule); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -233,6 +235,7 @@ public void getForwardingRuleTest() { NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String target = "target-880905839"; + String ipVersion = "ipVersion-1315653184"; SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; @@ -249,6 +252,7 @@ public void getForwardingRuleTest() { .setNetwork(network.toString()) .setSelfLink(selfLink) .setTarget(target) + .setIpVersion(ipVersion) .setSubnetwork(subnetwork.toString()) .setCreationTimestamp(creationTimestamp) .setName(name) @@ -338,11 +342,12 @@ public void insertForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); Operation actualResponse = - client.insertForwardingRule(region, forwardingRuleResource); + client.insertForwardingRule(requestId, region, forwardingRuleResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -361,10 +366,11 @@ public void insertForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); - client.insertForwardingRule(region, forwardingRuleResource); + client.insertForwardingRule(requestId, region, forwardingRuleResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -472,11 +478,12 @@ public void setTargetForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = - client.setTargetForwardingRule(forwardingRule, targetReferenceResource); + client.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -495,10 +502,11 @@ public void setTargetForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); - client.setTargetForwardingRule(forwardingRule, targetReferenceResource); + client.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index a72626516a79..a8688c573084 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -133,9 +133,10 @@ public void deleteGlobalAddressTest() { mockService.addResponse(expectedResponse); ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteGlobalAddress(address); + client.deleteGlobalAddress(address, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -155,8 +156,9 @@ public void deleteGlobalAddressExceptionTest() throws Exception { try { ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String requestId = "requestId37109963"; - client.deleteGlobalAddress(address); + client.deleteGlobalAddress(address, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -167,23 +169,29 @@ public void deleteGlobalAddressExceptionTest() throws Exception { @SuppressWarnings("all") public void getGlobalAddressTest() { ProjectAddressName address2 = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String addressType = "addressType264307877"; String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + String ipVersion = "ipVersion-1315653184"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String description = "description-1724546052"; String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; String status = "status-892481550"; Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) + .setAddressType(addressType) .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) .setCreationTimestamp(creationTimestamp) .setName(name) - .setDescription(description) .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -268,11 +276,12 @@ public void insertGlobalAddressTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Address addressResource = Address.newBuilder().build(); Operation actualResponse = - client.insertGlobalAddress(project, addressResource); + client.insertGlobalAddress(requestId, project, addressResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -291,10 +300,11 @@ public void insertGlobalAddressExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Address addressResource = Address.newBuilder().build(); - client.insertGlobalAddress(project, addressResource); + client.insertGlobalAddress(requestId, project, addressResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index 25fe6423bf3d..4dbee8fb6556 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -134,10 +134,11 @@ public void deleteGlobalForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); Operation actualResponse = - client.deleteGlobalForwardingRule(forwardingRule); + client.deleteGlobalForwardingRule(requestId, forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -156,9 +157,10 @@ public void deleteGlobalForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); - client.deleteGlobalForwardingRule(forwardingRule); + client.deleteGlobalForwardingRule(requestId, forwardingRule); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -177,6 +179,7 @@ public void getGlobalForwardingRuleTest() { NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String target = "target-880905839"; + String ipVersion = "ipVersion-1315653184"; SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; @@ -193,6 +196,7 @@ public void getGlobalForwardingRuleTest() { .setNetwork(network.toString()) .setSelfLink(selfLink) .setTarget(target) + .setIpVersion(ipVersion) .setSubnetwork(subnetwork.toString()) .setCreationTimestamp(creationTimestamp) .setName(name) @@ -282,11 +286,12 @@ public void insertGlobalForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); Operation actualResponse = - client.insertGlobalForwardingRule(project, forwardingRuleResource); + client.insertGlobalForwardingRule(requestId, project, forwardingRuleResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -305,10 +310,11 @@ public void insertGlobalForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); - client.insertGlobalForwardingRule(project, forwardingRuleResource); + client.insertGlobalForwardingRule(requestId, project, forwardingRuleResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -416,11 +422,12 @@ public void setTargetGlobalForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = - client.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource); + client.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -439,10 +446,11 @@ public void setTargetGlobalForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); - client.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource); + client.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java index 6c5a8db1794a..544598e7cf5b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -136,10 +136,11 @@ public void deleteHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); Operation actualResponse = - client.deleteHealthCheck(healthCheck); + client.deleteHealthCheck(requestId, healthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -158,9 +159,10 @@ public void deleteHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); - client.deleteHealthCheck(healthCheck); + client.deleteHealthCheck(requestId, healthCheck); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -276,11 +278,12 @@ public void insertHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); Operation actualResponse = - client.insertHealthCheck(project, healthCheckResource); + client.insertHealthCheck(requestId, project, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -299,10 +302,11 @@ public void insertHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - client.insertHealthCheck(project, healthCheckResource); + client.insertHealthCheck(requestId, project, healthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -410,11 +414,12 @@ public void patchHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); Operation actualResponse = - client.patchHealthCheck(healthCheck, healthCheckResource); + client.patchHealthCheck(requestId, healthCheck, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -433,10 +438,11 @@ public void patchHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - client.patchHealthCheck(healthCheck, healthCheckResource); + client.patchHealthCheck(requestId, healthCheck, healthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -492,11 +498,12 @@ public void updateHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); Operation actualResponse = - client.updateHealthCheck(healthCheck, healthCheckResource); + client.updateHealthCheck(requestId, healthCheck, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -515,10 +522,11 @@ public void updateHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - client.updateHealthCheck(healthCheck, healthCheckResource); + client.updateHealthCheck(requestId, healthCheck, healthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index f82d6bb2085c..a8baddf13b7c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -136,10 +136,11 @@ public void deleteHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); Operation actualResponse = - client.deleteHttpHealthCheck(httpHealthCheck); + client.deleteHttpHealthCheck(requestId, httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -158,9 +159,10 @@ public void deleteHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - client.deleteHttpHealthCheck(httpHealthCheck); + client.deleteHttpHealthCheck(requestId, httpHealthCheck); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -280,11 +282,12 @@ public void insertHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = - client.insertHttpHealthCheck(project, httpHealthCheckResource); + client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -303,10 +306,11 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); - client.insertHttpHealthCheck(project, httpHealthCheckResource); + client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -414,11 +418,12 @@ public void patchHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = - client.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -437,10 +442,11 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); - client.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -496,11 +502,12 @@ public void updateHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = - client.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -519,10 +526,11 @@ public void updateHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); - client.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); + client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index 0ebb0bc6a4cb..404e85822cc6 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -137,9 +137,10 @@ public void deleteHttpsHealthCheckTest() { mockService.addResponse(expectedResponse); HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteHttpsHealthCheck(httpsHealthCheck); + client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -159,8 +160,9 @@ public void deleteHttpsHealthCheckExceptionTest() throws Exception { try { HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + String requestId = "requestId37109963"; - client.deleteHttpsHealthCheck(httpsHealthCheck); + client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -280,11 +282,12 @@ public void insertHttpsHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); Operation actualResponse = - client.insertHttpsHealthCheck(project, httpsHealthCheckResource); + client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -303,10 +306,11 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); - client.insertHttpsHealthCheck(project, httpsHealthCheckResource); + client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -415,10 +419,11 @@ public void patchHttpsHealthCheckTest() { mockService.addResponse(expectedResponse); HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); Operation actualResponse = - client.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -438,9 +443,10 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { try { HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); - client.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -497,10 +503,11 @@ public void updateHttpsHealthCheckTest() { mockService.addResponse(expectedResponse); HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); Operation actualResponse = - client.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -520,9 +527,10 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception { try { HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); - client.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); + client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index 4c13f0164749..7fe68b8ba195 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -32,6 +32,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.insertImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.listImagesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.setLabelsImageMethodDescriptor; import com.google.cloud.compute.v1.stub.ImageStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -56,7 +57,8 @@ public class ImageClientTest { getImageMethodDescriptor, getFromFamilyImageMethodDescriptor, insertImageMethodDescriptor, - listImagesMethodDescriptor + listImagesMethodDescriptor, + setLabelsImageMethodDescriptor )); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, ImageStubSettings.getDefaultEndpoint()); @@ -137,9 +139,10 @@ public void deleteImageTest() { mockService.addResponse(expectedResponse); ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteImage(image); + client.deleteImage(image, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -159,8 +162,9 @@ public void deleteImageExceptionTest() throws Exception { try { ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + String requestId = "requestId37109963"; - client.deleteImage(image); + client.deleteImage(image, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -217,10 +221,11 @@ public void deprecateImageTest() { mockService.addResponse(expectedResponse); ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + String requestId = "requestId37109963"; DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); Operation actualResponse = - client.deprecateImage(image, deprecationStatusResource); + client.deprecateImage(image, requestId, deprecationStatusResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -240,9 +245,10 @@ public void deprecateImageExceptionTest() throws Exception { try { ImageName image = ImageName.of("[PROJECT]", "[IMAGE]"); + String requestId = "requestId37109963"; DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); - client.deprecateImage(image, deprecationStatusResource); + client.deprecateImage(image, requestId, deprecationStatusResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -252,30 +258,40 @@ public void deprecateImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getImageTest() { + String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String description = "description-1724546052"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String labelFingerprint = "labelFingerprint714995737"; + String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; String sourceDisk = "sourceDisk-85117119"; String sourceDiskId = "sourceDiskId-1693292839"; + String sourceImageId = "sourceImageId-2092155357"; String kind = "kind3292052"; - String description = "description-1724546052"; String selfLink = "selfLink-1691268851"; String sourceType = "sourceType-84625186"; - String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String archiveSizeBytes = "archiveSizeBytes-1766390198"; - String id = "id3355"; + String sourceImage = "sourceImage1661056055"; FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]"); String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; Image expectedResponse = Image.newBuilder() + .setSourceSnapshotId(sourceSnapshotId) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setLabelFingerprint(labelFingerprint) + .setCreationTimestamp(creationTimestamp) + .setId(id) .setSourceDisk(sourceDisk) .setSourceDiskId(sourceDiskId) + .setSourceImageId(sourceImageId) .setKind(kind) - .setDescription(description) .setSelfLink(selfLink) .setSourceType(sourceType) - .setCreationTimestamp(creationTimestamp) .setName(name) .setArchiveSizeBytes(archiveSizeBytes) - .setId(id) + .setSourceImage(sourceImage) .setFamily(family.toString()) .setDiskSizeGb(diskSizeGb) .setStatus(status) @@ -316,30 +332,40 @@ public void getImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getFromFamilyImageTest() { + String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String description = "description-1724546052"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String labelFingerprint = "labelFingerprint714995737"; + String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; String sourceDisk = "sourceDisk-85117119"; String sourceDiskId = "sourceDiskId-1693292839"; + String sourceImageId = "sourceImageId-2092155357"; String kind = "kind3292052"; - String description = "description-1724546052"; String selfLink = "selfLink-1691268851"; String sourceType = "sourceType-84625186"; - String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String archiveSizeBytes = "archiveSizeBytes-1766390198"; - String id = "id3355"; + String sourceImage = "sourceImage1661056055"; FamilyName family2 = FamilyName.of("[PROJECT]", "[FAMILY]"); String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; Image expectedResponse = Image.newBuilder() + .setSourceSnapshotId(sourceSnapshotId) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setLabelFingerprint(labelFingerprint) + .setCreationTimestamp(creationTimestamp) + .setId(id) .setSourceDisk(sourceDisk) .setSourceDiskId(sourceDiskId) + .setSourceImageId(sourceImageId) .setKind(kind) - .setDescription(description) .setSelfLink(selfLink) .setSourceType(sourceType) - .setCreationTimestamp(creationTimestamp) .setName(name) .setArchiveSizeBytes(archiveSizeBytes) - .setId(id) + .setSourceImage(sourceImage) .setFamily(family2.toString()) .setDiskSizeGb(diskSizeGb) .setStatus(status) @@ -426,11 +452,13 @@ public void insertImageTest() { .build(); mockService.addResponse(expectedResponse); + Boolean forceCreate = true; + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Image imageResource = Image.newBuilder().build(); Operation actualResponse = - client.insertImage(project, imageResource); + client.insertImage(forceCreate, requestId, project, imageResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -449,10 +477,12 @@ public void insertImageExceptionTest() throws Exception { mockService.addException(exception); try { + Boolean forceCreate = true; + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Image imageResource = Image.newBuilder().build(); - client.insertImage(project, imageResource); + client.insertImage(forceCreate, requestId, project, imageResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -511,4 +541,86 @@ public void listImagesExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setLabelsImageTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + + Operation actualResponse = + client.setLabelsImage(resource, globalSetLabelsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setLabelsImageExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + + client.setLabelsImage(resource, globalSetLabelsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index 6fc689d5acd7..dc307cd10c10 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -27,6 +27,7 @@ import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.addAccessConfigInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.aggregatedListInstancesMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.attachDiskInstanceMethodDescriptor; @@ -37,16 +38,23 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.getSerialPortOutputInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.insertInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.listInstancesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.listReferrersInstancesMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.resetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setDeletionProtectionInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setDiskAutoDeleteInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setLabelsInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMachineResourcesInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMachineTypeInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMetadataInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMinCpuPlatformInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setSchedulingInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setServiceAccountInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setTagsInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.startInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.startWithEncryptionKeyInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.stopInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.updateAccessConfigInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.updateNetworkInterfaceInstanceMethodDescriptor; import com.google.cloud.compute.v1.stub.InstanceStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -76,16 +84,23 @@ public class InstanceClientTest { getSerialPortOutputInstanceMethodDescriptor, insertInstanceMethodDescriptor, listInstancesMethodDescriptor, + listReferrersInstancesMethodDescriptor, resetInstanceMethodDescriptor, + setDeletionProtectionInstanceMethodDescriptor, setDiskAutoDeleteInstanceMethodDescriptor, + setLabelsInstanceMethodDescriptor, + setMachineResourcesInstanceMethodDescriptor, setMachineTypeInstanceMethodDescriptor, setMetadataInstanceMethodDescriptor, + setMinCpuPlatformInstanceMethodDescriptor, setSchedulingInstanceMethodDescriptor, setServiceAccountInstanceMethodDescriptor, setTagsInstanceMethodDescriptor, startInstanceMethodDescriptor, startWithEncryptionKeyInstanceMethodDescriptor, - stopInstanceMethodDescriptor + stopInstanceMethodDescriptor, + updateAccessConfigInstanceMethodDescriptor, + updateNetworkInterfaceInstanceMethodDescriptor )); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, InstanceStubSettings.getDefaultEndpoint()); @@ -167,10 +182,11 @@ public void addAccessConfigInstanceTest() { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); Operation actualResponse = - client.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + client.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -191,9 +207,10 @@ public void addAccessConfigInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - client.addAccessConfigInstance(instance, networkInterface, accessConfigResource); + client.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -303,10 +320,11 @@ public void attachDiskInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); Operation actualResponse = - client.attachDiskInstance(instance, attachedDiskResource); + client.attachDiskInstance(instance, requestId, attachedDiskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -326,9 +344,10 @@ public void attachDiskInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - client.attachDiskInstance(instance, attachedDiskResource); + client.attachDiskInstance(instance, requestId, attachedDiskResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -385,9 +404,10 @@ public void deleteInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteInstance(instance); + client.deleteInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -407,8 +427,9 @@ public void deleteInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; - client.deleteInstance(instance); + client.deleteInstance(instance, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -466,10 +487,11 @@ public void deleteAccessConfigInstanceTest() { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; String accessConfig = "accessConfig-464014723"; Operation actualResponse = - client.deleteAccessConfigInstance(instance, networkInterface, accessConfig); + client.deleteAccessConfigInstance(instance, networkInterface, requestId, accessConfig); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -490,9 +512,10 @@ public void deleteAccessConfigInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; String accessConfig = "accessConfig-464014723"; - client.deleteAccessConfigInstance(instance, networkInterface, accessConfig); + client.deleteAccessConfigInstance(instance, networkInterface, requestId, accessConfig); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -549,10 +572,11 @@ public void detachDiskInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; String deviceName = "deviceName-1543071020"; Operation actualResponse = - client.detachDiskInstance(instance, deviceName); + client.detachDiskInstance(instance, requestId, deviceName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -572,9 +596,10 @@ public void detachDiskInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; String deviceName = "deviceName-1543071020"; - client.detachDiskInstance(instance, deviceName); + client.detachDiskInstance(instance, requestId, deviceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -588,8 +613,12 @@ public void getInstanceTest() { String kind = "kind3292052"; String description = "description-1724546052"; String cpuPlatform = "cpuPlatform947156266"; + Boolean startRestricted = true; + String labelFingerprint = "labelFingerprint714995737"; String statusMessage = "statusMessage-239442758"; + Boolean deletionProtection = true; String selfLink = "selfLink-1691268851"; + String minCpuPlatform = "minCpuPlatform-1367699977"; ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; @@ -601,8 +630,12 @@ public void getInstanceTest() { .setKind(kind) .setDescription(description) .setCpuPlatform(cpuPlatform) + .setStartRestricted(startRestricted) + .setLabelFingerprint(labelFingerprint) .setStatusMessage(statusMessage) + .setDeletionProtection(deletionProtection) .setSelfLink(selfLink) + .setMinCpuPlatform(minCpuPlatform) .setZone(zone.toString()) .setCreationTimestamp(creationTimestamp) .setName(name) @@ -745,10 +778,11 @@ public void insertInstanceTest() { mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Instance instanceResource = Instance.newBuilder().build(); Operation actualResponse = - client.insertInstance(zone, instanceResource); + client.insertInstance(zone, requestId, instanceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -768,9 +802,10 @@ public void insertInstanceExceptionTest() throws Exception { try { ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; Instance instanceResource = Instance.newBuilder().build(); - client.insertInstance(zone, instanceResource); + client.insertInstance(zone, requestId, instanceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -829,6 +864,58 @@ public void listInstancesExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void listReferrersInstancesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Reference itemsElement = Reference.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InstanceListReferrers expectedResponse = InstanceListReferrers.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + ListReferrersInstancesPagedResponse pagedListResponse = client.listReferrersInstances(instance); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listReferrersInstancesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + client.listReferrersInstances(instance); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void resetInstanceTest() { @@ -879,9 +966,10 @@ public void resetInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.resetInstance(instance); + client.resetInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -901,8 +989,93 @@ public void resetInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + + client.resetInstance(instance, requestId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setDeletionProtectionInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + String requestId = "requestId37109963"; + Boolean deletionProtection = true; + + Operation actualResponse = + client.setDeletionProtectionInstance(resource, requestId, deletionProtection); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } - client.resetInstance(instance); + @Test + @SuppressWarnings("all") + public void setDeletionProtectionInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + String requestId = "requestId37109963"; + Boolean deletionProtection = true; + + client.setDeletionProtectionInstance(resource, requestId, deletionProtection); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -959,11 +1132,12 @@ public void setDiskAutoDeleteInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Boolean autoDelete = false; String deviceName = "deviceName-1543071020"; Operation actualResponse = - client.setDiskAutoDeleteInstance(instance, autoDelete, deviceName); + client.setDiskAutoDeleteInstance(instance, requestId, autoDelete, deviceName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -983,10 +1157,179 @@ public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Boolean autoDelete = false; String deviceName = "deviceName-1543071020"; - client.setDiskAutoDeleteInstance(instance, autoDelete, deviceName); + client.setDiskAutoDeleteInstance(instance, requestId, autoDelete, deviceName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setLabelsInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build(); + + Operation actualResponse = + client.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setLabelsInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build(); + + client.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setMachineResourcesInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build(); + + Operation actualResponse = + client.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setMachineResourcesInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build(); + + client.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1043,10 +1386,11 @@ public void setMachineTypeInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); Operation actualResponse = - client.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource); + client.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1066,9 +1410,10 @@ public void setMachineTypeInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); - client.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource); + client.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1125,10 +1470,11 @@ public void setMetadataInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Metadata metadataResource = Metadata.newBuilder().build(); Operation actualResponse = - client.setMetadataInstance(instance, metadataResource); + client.setMetadataInstance(instance, requestId, metadataResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1148,9 +1494,94 @@ public void setMetadataInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Metadata metadataResource = Metadata.newBuilder().build(); - client.setMetadataInstance(instance, metadataResource); + client.setMetadataInstance(instance, requestId, metadataResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setMinCpuPlatformInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build(); + + Operation actualResponse = + client.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setMinCpuPlatformInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build(); + + client.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1207,10 +1638,11 @@ public void setSchedulingInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Scheduling schedulingResource = Scheduling.newBuilder().build(); Operation actualResponse = - client.setSchedulingInstance(instance, schedulingResource); + client.setSchedulingInstance(instance, requestId, schedulingResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1230,9 +1662,10 @@ public void setSchedulingInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Scheduling schedulingResource = Scheduling.newBuilder().build(); - client.setSchedulingInstance(instance, schedulingResource); + client.setSchedulingInstance(instance, requestId, schedulingResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1289,10 +1722,11 @@ public void setServiceAccountInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); Operation actualResponse = - client.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource); + client.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1312,9 +1746,10 @@ public void setServiceAccountInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); - client.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource); + client.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1371,10 +1806,11 @@ public void setTagsInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Tags tagsResource = Tags.newBuilder().build(); Operation actualResponse = - client.setTagsInstance(instance, tagsResource); + client.setTagsInstance(instance, requestId, tagsResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1394,9 +1830,10 @@ public void setTagsInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Tags tagsResource = Tags.newBuilder().build(); - client.setTagsInstance(instance, tagsResource); + client.setTagsInstance(instance, requestId, tagsResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1453,9 +1890,10 @@ public void startInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.startInstance(instance); + client.startInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1475,8 +1913,9 @@ public void startInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; - client.startInstance(instance); + client.startInstance(instance, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1533,10 +1972,11 @@ public void startWithEncryptionKeyInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); Operation actualResponse = - client.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource); + client.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1556,9 +1996,10 @@ public void startWithEncryptionKeyInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); - client.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource); + client.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1615,9 +2056,10 @@ public void stopInstanceTest() { mockService.addResponse(expectedResponse); InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.stopInstance(instance); + client.stopInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1637,8 +2079,181 @@ public void stopInstanceExceptionTest() throws Exception { try { InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String requestId = "requestId37109963"; + + client.stopInstance(instance, requestId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateAccessConfigInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; + AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); + + Operation actualResponse = + client.updateAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateAccessConfigInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; + AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); + + client.updateAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateNetworkInterfaceInstanceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; + NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); + + Operation actualResponse = + client.updateNetworkInterfaceInstance(instance, networkInterface, requestId, networkInterfaceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void updateNetworkInterfaceInstanceExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + String networkInterface = "networkInterface902258792"; + String requestId = "requestId37109963"; + NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); - client.stopInstance(instance); + client.updateNetworkInterfaceInstance(instance, networkInterface, requestId, networkInterfaceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index f1799b86c4de..6fa718c7955a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -15,6 +15,16 @@ */ package com.google.cloud.compute.v1; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; @@ -27,17 +37,6 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.listInstancesInstanceGroupsMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.removeInstancesInstanceGroupMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.setNamedPortsInstanceGroupMethodDescriptor; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -55,20 +54,20 @@ @javax.annotation.Generated("by GAPIC") public class InstanceGroupClientTest { - private static final List METHOD_DESCRIPTORS = - ImmutableList.copyOf( - Lists.newArrayList( - addInstancesInstanceGroupMethodDescriptor, - aggregatedListInstanceGroupsMethodDescriptor, - deleteInstanceGroupMethodDescriptor, - getInstanceGroupMethodDescriptor, - insertInstanceGroupMethodDescriptor, - listInstanceGroupsMethodDescriptor, - listInstancesInstanceGroupsMethodDescriptor, - removeInstancesInstanceGroupMethodDescriptor, - setNamedPortsInstanceGroupMethodDescriptor)); - private static final MockHttpService mockService = - new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + addInstancesInstanceGroupMethodDescriptor, + aggregatedListInstanceGroupsMethodDescriptor, + deleteInstanceGroupMethodDescriptor, + getInstanceGroupMethodDescriptor, + insertInstanceGroupMethodDescriptor, + listInstanceGroupsMethodDescriptor, + listInstancesInstanceGroupsMethodDescriptor, + removeInstancesInstanceGroupMethodDescriptor, + setNamedPortsInstanceGroupMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); private static InstanceGroupClient client; private static InstanceGroupSettings clientSettings; @@ -77,13 +76,13 @@ public class InstanceGroupClientTest { public static void setUp() throws IOException { clientSettings = InstanceGroupSettings.newBuilder() - .setTransportChannelProvider( - InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = InstanceGroupClient.create(clientSettings); + .setTransportChannelProvider( + InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + InstanceGroupClient.create(clientSettings); } @After @@ -120,71 +119,60 @@ public void addInstancesInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = - InstanceGroupsAddInstancesRequest.newBuilder().build(); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); Operation actualResponse = - client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); + client.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void addInstancesInstanceGroupExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = - InstanceGroupsAddInstancesRequest.newBuilder().build(); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); - client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); + client.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -201,47 +189,37 @@ public void aggregatedListInstanceGroupsTest() { InstanceGroupsScopedList itemsItem = InstanceGroupsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - InstanceGroupAggregatedList expectedResponse = - InstanceGroupAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + InstanceGroupAggregatedList expectedResponse = InstanceGroupAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListInstanceGroupsPagedResponse pagedListResponse = - client.aggregatedListInstanceGroups(project); + AggregatedListInstanceGroupsPagedResponse pagedListResponse = client.aggregatedListInstanceGroups(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals( - expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -278,66 +256,58 @@ public void deleteInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - Operation actualResponse = client.deleteInstanceGroup(instanceGroup); + Operation actualResponse = + client.deleteInstanceGroup(requestId, instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void deleteInstanceGroupExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - client.deleteInstanceGroup(instanceGroup); + client.deleteInstanceGroup(requestId, instanceGroup); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -359,55 +329,45 @@ public void getInstanceGroupTest() { String name = "name3373707"; String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); - InstanceGroup expectedResponse = - InstanceGroup.newBuilder() - .setKind(kind) - .setDescription(description) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setSize(size) - .setZone(zone.toString()) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InstanceGroup expectedResponse = InstanceGroup.newBuilder() + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setSize(size) + .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroup actualResponse = client.getInstanceGroup(instanceGroup); + InstanceGroup actualResponse = + client.getInstanceGroup(instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void getInstanceGroupExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); client.getInstanceGroup(instanceGroup); Assert.fail("No exception raised"); @@ -440,66 +400,60 @@ public void insertInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); - Operation actualResponse = client.insertInstanceGroup(zone, instanceGroupResource); + Operation actualResponse = + client.insertInstanceGroup(zone, requestId, instanceGroupResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void insertInstanceGroupExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); - client.insertInstanceGroup(zone, instanceGroupResource); + client.insertInstanceGroup(zone, requestId, instanceGroupResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -515,14 +469,13 @@ public void listInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupList expectedResponse = - InstanceGroupList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupList expectedResponse = InstanceGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); @@ -531,29 +484,22 @@ public void listInstanceGroupsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void listInstanceGroupsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -575,57 +521,43 @@ public void listInstancesInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupsListInstances expectedResponse = - InstanceGroupsListInstances.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupsListInstances expectedResponse = InstanceGroupsListInstances.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = - InstanceGroupsListInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); - ListInstancesInstanceGroupsPagedResponse pagedListResponse = - client.listInstancesInstanceGroups( - instanceGroup, instanceGroupsListInstancesRequestResource); + ListInstancesInstanceGroupsPagedResponse pagedListResponse = client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void listInstancesInstanceGroupsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = - InstanceGroupsListInstancesRequest.newBuilder().build(); + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); Assert.fail("No exception raised"); @@ -658,73 +590,60 @@ public void removeInstancesInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = - InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); Operation actualResponse = - client.removeInstancesInstanceGroup( - instanceGroup, instanceGroupsRemoveInstancesRequestResource); + client.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void removeInstancesInstanceGroupExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = - InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); - client.removeInstancesInstanceGroup( - instanceGroup, instanceGroupsRemoveInstancesRequestResource); + client.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -755,75 +674,64 @@ public void setNamedPortsInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = - InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); Operation actualResponse = - client.setNamedPortsInstanceGroup( - instanceGroup, instanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void setNamedPortsInstanceGroupExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - InstanceGroupName instanceGroup = - InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = - InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + String requestId = "requestId37109963"; + InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); - client.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index 6ffc2d77c07c..39bc6e8bec3c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -149,11 +149,12 @@ public void abandonInstancesInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); Operation actualResponse = - client.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + client.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -172,10 +173,11 @@ public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception mockService.addException(exception); try { + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); - client.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + client.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -284,10 +286,11 @@ public void deleteInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = - client.deleteInstanceGroupManager(instanceGroupManager); + client.deleteInstanceGroupManager(requestId, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -306,9 +309,10 @@ public void deleteInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - client.deleteInstanceGroupManager(instanceGroupManager); + client.deleteInstanceGroupManager(requestId, instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -364,11 +368,12 @@ public void deleteInstancesInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); Operation actualResponse = - client.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + client.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -387,10 +392,11 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception mockService.addException(exception); try { + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); - client.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + client.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -511,10 +517,11 @@ public void insertInstanceGroupManagerTest() { mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); Operation actualResponse = - client.insertInstanceGroupManager(zone, instanceGroupManagerResource); + client.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -534,9 +541,10 @@ public void insertInstanceGroupManagerExceptionTest() throws Exception { try { ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); - client.insertInstanceGroupManager(zone, instanceGroupManagerResource); + client.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -681,11 +689,12 @@ public void recreateInstancesInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); Operation actualResponse = - client.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + client.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -704,10 +713,11 @@ public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exceptio mockService.addException(exception); try { + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); - client.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + client.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -764,10 +774,11 @@ public void resizeInstanceGroupManagerTest() { mockService.addResponse(expectedResponse); Integer size = 3530753; + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = - client.resizeInstanceGroupManager(size, instanceGroupManager); + client.resizeInstanceGroupManager(size, requestId, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -787,9 +798,10 @@ public void resizeInstanceGroupManagerExceptionTest() throws Exception { try { Integer size = 3530753; + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - client.resizeInstanceGroupManager(size, instanceGroupManager); + client.resizeInstanceGroupManager(size, requestId, instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -845,11 +857,12 @@ public void setInstanceTemplateInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); Operation actualResponse = - client.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + client.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -868,10 +881,11 @@ public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Except mockService.addException(exception); try { + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); - client.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + client.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -927,11 +941,12 @@ public void setTargetPoolsInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); Operation actualResponse = - client.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + client.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -950,10 +965,11 @@ public void setTargetPoolsInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); - client.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + client.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index c75fa5b18bb9..c4fc4de348b4 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -133,9 +133,10 @@ public void deleteInstanceTemplateTest() { mockService.addResponse(expectedResponse); InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteInstanceTemplate(instanceTemplate); + client.deleteInstanceTemplate(instanceTemplate, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -155,8 +156,9 @@ public void deleteInstanceTemplateExceptionTest() throws Exception { try { InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + String requestId = "requestId37109963"; - client.deleteInstanceTemplate(instanceTemplate); + client.deleteInstanceTemplate(instanceTemplate, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -262,11 +264,12 @@ public void insertInstanceTemplateTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build(); Operation actualResponse = - client.insertInstanceTemplate(project, instanceTemplateResource); + client.insertInstanceTemplate(requestId, project, instanceTemplateResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -285,10 +288,11 @@ public void insertInstanceTemplateExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build(); - client.insertInstanceTemplate(project, instanceTemplateResource); + client.insertInstanceTemplate(requestId, project, instanceTemplateResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java new file mode 100644 index 000000000000..0f20542613cf --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java @@ -0,0 +1,424 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.aggregatedListInterconnectAttachmentsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.deleteInterconnectAttachmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.getInterconnectAttachmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.insertInterconnectAttachmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.listInterconnectAttachmentsMethodDescriptor; +import com.google.cloud.compute.v1.stub.InterconnectAttachmentStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InterconnectAttachmentClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListInterconnectAttachmentsMethodDescriptor, + deleteInterconnectAttachmentMethodDescriptor, + getInterconnectAttachmentMethodDescriptor, + insertInterconnectAttachmentMethodDescriptor, + listInterconnectAttachmentsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InterconnectAttachmentStubSettings.getDefaultEndpoint()); + + private static InterconnectAttachmentClient client; + private static InterconnectAttachmentSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InterconnectAttachmentSettings.newBuilder() + .setTransportChannelProvider( + InterconnectAttachmentSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + InterconnectAttachmentClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInterconnectAttachmentsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InterconnectAttachmentsScopedList itemsItem = InterconnectAttachmentsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + InterconnectAttachmentAggregatedList expectedResponse = InterconnectAttachmentAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListInterconnectAttachmentsPagedResponse pagedListResponse = client.aggregatedListInterconnectAttachments(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListInterconnectAttachmentsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListInterconnectAttachments(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteInterconnectAttachmentTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + + Operation actualResponse = + client.deleteInterconnectAttachment(requestId, interconnectAttachment); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInterconnectAttachmentExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + + client.deleteInterconnectAttachment(requestId, interconnectAttachment); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInterconnectAttachmentTest() { + String cloudRouterIpAddress = "cloudRouterIpAddress1361134600"; + String operationalStatus = "operationalStatus1274812671"; + String kind = "kind3292052"; + String googleReferenceId = "googleReferenceId534944469"; + String description = "description-1724546052"; + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + String customerRouterIpAddress = "customerRouterIpAddress-741266063"; + String selfLink = "selfLink-1691268851"; + RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InterconnectAttachment expectedResponse = InterconnectAttachment.newBuilder() + .setCloudRouterIpAddress(cloudRouterIpAddress) + .setOperationalStatus(operationalStatus) + .setKind(kind) + .setGoogleReferenceId(googleReferenceId) + .setDescription(description) + .setInterconnect(interconnect.toString()) + .setCustomerRouterIpAddress(customerRouterIpAddress) + .setSelfLink(selfLink) + .setRouter(router.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); + mockService.addResponse(expectedResponse); + + InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + + InterconnectAttachment actualResponse = + client.getInterconnectAttachment(interconnectAttachment); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInterconnectAttachmentExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + + client.getInterconnectAttachment(interconnectAttachment); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertInterconnectAttachmentTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build(); + + Operation actualResponse = + client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertInterconnectAttachmentExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build(); + + client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInterconnectAttachmentsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InterconnectAttachment itemsElement = InterconnectAttachment.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InterconnectAttachmentList expectedResponse = InterconnectAttachmentList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListInterconnectAttachmentsPagedResponse pagedListResponse = client.listInterconnectAttachments(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInterconnectAttachmentsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listInterconnectAttachments(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java new file mode 100644 index 000000000000..bb8ca10df935 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java @@ -0,0 +1,464 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.deleteInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.getInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.insertInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.listInterconnectsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.patchInterconnectMethodDescriptor; +import com.google.cloud.compute.v1.stub.InterconnectStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InterconnectClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteInterconnectMethodDescriptor, + getInterconnectMethodDescriptor, + insertInterconnectMethodDescriptor, + listInterconnectsMethodDescriptor, + patchInterconnectMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InterconnectStubSettings.getDefaultEndpoint()); + + private static InterconnectClient client; + private static InterconnectSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InterconnectSettings.newBuilder() + .setTransportChannelProvider( + InterconnectSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + InterconnectClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteInterconnectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + + Operation actualResponse = + client.deleteInterconnect(requestId, interconnect); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteInterconnectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + + client.deleteInterconnect(requestId, interconnect); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInterconnectTest() { + String operationalStatus = "operationalStatus1274812671"; + String interconnectType = "interconnectType2125777995"; + String peerIpAddress = "peerIpAddress-1939747879"; + String kind = "kind3292052"; + Integer requestedLinkCount = 1118793211; + String googleReferenceId = "googleReferenceId534944469"; + String description = "description-1724546052"; + String customerName = "customerName-2143818164"; + String selfLink = "selfLink-1691268851"; + Boolean adminEnabled = false; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String linkType = "linkType-1624275873"; + String location = "location1901043637"; + Integer provisionedLinkCount = 1199724171; + String id = "id3355"; + String googleIpAddress = "googleIpAddress1516847778"; + String nocContactEmail = "nocContactEmail1087814656"; + Interconnect expectedResponse = Interconnect.newBuilder() + .setOperationalStatus(operationalStatus) + .setInterconnectType(interconnectType) + .setPeerIpAddress(peerIpAddress) + .setKind(kind) + .setRequestedLinkCount(requestedLinkCount) + .setGoogleReferenceId(googleReferenceId) + .setDescription(description) + .setCustomerName(customerName) + .setSelfLink(selfLink) + .setAdminEnabled(adminEnabled) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setLinkType(linkType) + .setLocation(location) + .setProvisionedLinkCount(provisionedLinkCount) + .setId(id) + .setGoogleIpAddress(googleIpAddress) + .setNocContactEmail(nocContactEmail) + .build(); + mockService.addResponse(expectedResponse); + + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + + Interconnect actualResponse = + client.getInterconnect(interconnect); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInterconnectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + + client.getInterconnect(interconnect); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertInterconnectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + Interconnect interconnectResource = Interconnect.newBuilder().build(); + + Operation actualResponse = + client.insertInterconnect(requestId, project, interconnectResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertInterconnectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + Interconnect interconnectResource = Interconnect.newBuilder().build(); + + client.insertInterconnect(requestId, project, interconnectResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInterconnectsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Interconnect itemsElement = Interconnect.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InterconnectList expectedResponse = InterconnectList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListInterconnectsPagedResponse pagedListResponse = client.listInterconnects(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInterconnectsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listInterconnects(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchInterconnectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + Interconnect interconnectResource = Interconnect.newBuilder().build(); + + Operation actualResponse = + client.patchInterconnect(requestId, interconnect, interconnectResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchInterconnectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + Interconnect interconnectResource = Interconnect.newBuilder().build(); + + client.patchInterconnect(requestId, interconnect, interconnectResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java new file mode 100644 index 000000000000..bbf9fce1e31b --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectLocationStub.getInterconnectLocationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectLocationStub.listInterconnectLocationsMethodDescriptor; +import com.google.cloud.compute.v1.stub.InterconnectLocationStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class InterconnectLocationClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + getInterconnectLocationMethodDescriptor, + listInterconnectLocationsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, InterconnectLocationStubSettings.getDefaultEndpoint()); + + private static InterconnectLocationClient client; + private static InterconnectLocationSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + InterconnectLocationSettings.newBuilder() + .setTransportChannelProvider( + InterconnectLocationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + InterconnectLocationClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getInterconnectLocationTest() { + String continent = "continent-403427916"; + ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + String city = "city3053931"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String peeringdbFacilityId = "peeringdbFacilityId-303818"; + String availabilityZone = "availabilityZone-378410992"; + String facilityProviderFacilityId = "facilityProviderFacilityId-1523343611"; + String selfLink = "selfLink-1691268851"; + String facilityProvider = "facilityProvider2143916045"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + InterconnectLocation expectedResponse = InterconnectLocation.newBuilder() + .setContinent(continent) + .setAddress(address.toString()) + .setCity(city) + .setKind(kind) + .setDescription(description) + .setPeeringdbFacilityId(peeringdbFacilityId) + .setAvailabilityZone(availabilityZone) + .setFacilityProviderFacilityId(facilityProviderFacilityId) + .setSelfLink(selfLink) + .setFacilityProvider(facilityProvider) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .build(); + mockService.addResponse(expectedResponse); + + InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]"); + + InterconnectLocation actualResponse = + client.getInterconnectLocation(interconnectLocation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getInterconnectLocationExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]"); + + client.getInterconnectLocation(interconnectLocation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listInterconnectLocationsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + InterconnectLocation itemsElement = InterconnectLocation.newBuilder().build(); + List items = Arrays.asList(itemsElement); + InterconnectLocationList expectedResponse = InterconnectLocationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListInterconnectLocationsPagedResponse pagedListResponse = client.listInterconnectLocations(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listInterconnectLocationsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listInterconnectLocations(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java similarity index 83% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java rename to google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java index 8ce2dfa4adfd..b7046bc93e1d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java @@ -25,8 +25,8 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.stub.HttpJsonLicensStub.getLicensMethodDescriptor; -import com.google.cloud.compute.v1.stub.LicensStubSettings; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.getLicenseMethodDescriptor; +import com.google.cloud.compute.v1.stub.LicenseStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -41,29 +41,29 @@ import org.junit.Test; @javax.annotation.Generated("by GAPIC") -public class LicensClientTest { +public class LicenseClientTest { private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( Lists.newArrayList( - getLicensMethodDescriptor + getLicenseMethodDescriptor )); private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, LicensStubSettings.getDefaultEndpoint()); + = new MockHttpService(METHOD_DESCRIPTORS, LicenseStubSettings.getDefaultEndpoint()); - private static LicensClient client; - private static LicensSettings clientSettings; + private static LicenseClient client; + private static LicenseSettings clientSettings; @BeforeClass public static void setUp() throws IOException { clientSettings = - LicensSettings.newBuilder() + LicenseSettings.newBuilder() .setTransportChannelProvider( - LicensSettings.defaultHttpJsonTransportProviderBuilder() + LicenseSettings.defaultHttpJsonTransportProviderBuilder() .setHttpTransport(mockService).build()) .setCredentialsProvider(NoCredentialsProvider.create()) .build(); client = - LicensClient.create(clientSettings); + LicenseClient.create(clientSettings); } @After @@ -78,7 +78,7 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") - public void getLicensTest() { + public void getLicenseTest() { Boolean chargesUseFee = true; String kind = "kind3292052"; String name = "name3373707"; @@ -94,7 +94,7 @@ public void getLicensTest() { LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]"); License actualResponse = - client.getLicens(license); + client.getLicense(license); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -108,14 +108,14 @@ public void getLicensTest() { @Test @SuppressWarnings("all") - public void getLicensExceptionTest() throws Exception { + public void getLicenseExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]"); - client.getLicens(license); + client.getLicense(license); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java index 5d717332f490..1a85b91609c2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -26,10 +26,13 @@ import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.addPeeringNetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.deleteNetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.getNetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.insertNetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.listNetworksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.patchNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.removePeeringNetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.switchToCustomModeNetworkMethodDescriptor; import com.google.cloud.compute.v1.stub.NetworkStubSettings; import com.google.common.collect.ImmutableList; @@ -50,10 +53,13 @@ public class NetworkClientTest { private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( Lists.newArrayList( + addPeeringNetworkMethodDescriptor, deleteNetworkMethodDescriptor, getNetworkMethodDescriptor, insertNetworkMethodDescriptor, listNetworksMethodDescriptor, + patchNetworkMethodDescriptor, + removePeeringNetworkMethodDescriptor, switchToCustomModeNetworkMethodDescriptor )); private static final MockHttpService mockService @@ -85,6 +91,90 @@ public static void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void addPeeringNetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); + + Operation actualResponse = + client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void addPeeringNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); + + client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void deleteNetworkTest() { @@ -134,10 +224,11 @@ public void deleteNetworkTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); Operation actualResponse = - client.deleteNetwork(network); + client.deleteNetwork(requestId, network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -156,9 +247,10 @@ public void deleteNetworkExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); - client.deleteNetwork(network); + client.deleteNetwork(requestId, network); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -270,11 +362,12 @@ public void insertNetworkTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Network networkResource = Network.newBuilder().build(); Operation actualResponse = - client.insertNetwork(project, networkResource); + client.insertNetwork(requestId, project, networkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -293,10 +386,11 @@ public void insertNetworkExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Network networkResource = Network.newBuilder().build(); - client.insertNetwork(project, networkResource); + client.insertNetwork(requestId, project, networkResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -355,6 +449,174 @@ public void listNetworksExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void patchNetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + Network networkResource = Network.newBuilder().build(); + + Operation actualResponse = + client.patchNetwork(requestId, network, networkResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + Network networkResource = Network.newBuilder().build(); + + client.patchNetwork(requestId, network, networkResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void removePeeringNetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build(); + + Operation actualResponse = + client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void removePeeringNetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build(); + + client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void switchToCustomModeNetworkTest() { @@ -404,10 +666,11 @@ public void switchToCustomModeNetworkTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); Operation actualResponse = - client.switchToCustomModeNetwork(network); + client.switchToCustomModeNetwork(requestId, network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -426,9 +689,10 @@ public void switchToCustomModeNetworkExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); - client.switchToCustomModeNetwork(network); + client.switchToCustomModeNetwork(requestId, network); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index abd0847731b9..1db942d94bf3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -15,12 +15,6 @@ */ package com.google.cloud.compute.v1; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveDiskProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; - import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -31,11 +25,28 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.disableXpnHostProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.disableXpnResourceProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.enableXpnHostProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.enableXpnResourceProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getXpnHostProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.getXpnResourcesProjectsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.listXpnHostsProjectsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveDiskProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; import com.google.cloud.compute.v1.stub.ProjectStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,16 +56,23 @@ @javax.annotation.Generated("by GAPIC") public class ProjectClientTest { - private static final List METHOD_DESCRIPTORS = - ImmutableList.copyOf( - Lists.newArrayList( - getProjectMethodDescriptor, - moveDiskProjectMethodDescriptor, - moveInstanceProjectMethodDescriptor, - setCommonInstanceMetadataProjectMethodDescriptor, - setUsageExportBucketProjectMethodDescriptor)); - private static final MockHttpService mockService = - new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + disableXpnHostProjectMethodDescriptor, + disableXpnResourceProjectMethodDescriptor, + enableXpnHostProjectMethodDescriptor, + enableXpnResourceProjectMethodDescriptor, + getProjectMethodDescriptor, + getXpnHostProjectMethodDescriptor, + getXpnResourcesProjectsMethodDescriptor, + listXpnHostsProjectsMethodDescriptor, + moveDiskProjectMethodDescriptor, + moveInstanceProjectMethodDescriptor, + setCommonInstanceMetadataProjectMethodDescriptor, + setUsageExportBucketProjectMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); private static ProjectClient client; private static ProjectSettings clientSettings; @@ -63,13 +81,13 @@ public class ProjectClientTest { public static void setUp() throws IOException { clientSettings = ProjectSettings.newBuilder() - .setTransportChannelProvider( - ProjectSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = ProjectClient.create(clientSettings); + .setTransportChannelProvider( + ProjectSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + ProjectClient.create(clientSettings); } @After @@ -82,9 +100,342 @@ public static void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void disableXpnHostProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + + Operation actualResponse = + client.disableXpnHostProject(requestId, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void disableXpnHostProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + + client.disableXpnHostProject(requestId, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void disableXpnResourceProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build(); + + Operation actualResponse = + client.disableXpnResourceProject(requestId, project, projectsDisableXpnResourceRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void disableXpnResourceProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build(); + + client.disableXpnResourceProject(requestId, project, projectsDisableXpnResourceRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void enableXpnHostProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + + Operation actualResponse = + client.enableXpnHostProject(requestId, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void enableXpnHostProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + + client.enableXpnHostProject(requestId, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void enableXpnResourceProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build(); + + Operation actualResponse = + client.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void enableXpnResourceProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build(); + + client.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void getProjectTest() { + String xpnProjectStatus = "xpnProjectStatus-308451647"; String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; @@ -92,44 +443,37 @@ public void getProjectTest() { String id = "id3355"; String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; - Project expectedResponse = - Project.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setDefaultServiceAccount(defaultServiceAccount) - .setSelfLink(selfLink) - .build(); + Project expectedResponse = Project.newBuilder() + .setXpnProjectStatus(xpnProjectStatus) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultServiceAccount(defaultServiceAccount) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - Project actualResponse = client.getProject(project); + Project actualResponse = + client.getProject(project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void getProjectExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -142,6 +486,162 @@ public void getProjectExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getXpnHostProjectTest() { + String xpnProjectStatus = "xpnProjectStatus-308451647"; + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String defaultServiceAccount = "defaultServiceAccount-1848771419"; + String selfLink = "selfLink-1691268851"; + Project expectedResponse = Project.newBuilder() + .setXpnProjectStatus(xpnProjectStatus) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultServiceAccount(defaultServiceAccount) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + Project actualResponse = + client.getXpnHostProject(project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getXpnHostProjectExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.getXpnHostProject(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getXpnResourcesProjectsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + XpnResourceId resourcesElement = XpnResourceId.newBuilder().build(); + List resources = Arrays.asList(resourcesElement); + ProjectsGetXpnResources expectedResponse = ProjectsGetXpnResources.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .addAllResources(resources) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + GetXpnResourcesProjectsPagedResponse pagedListResponse = client.getXpnResourcesProjects(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getXpnResourcesProjectsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.getXpnResourcesProjects(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listXpnHostsProjectsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Project itemsElement = Project.newBuilder().build(); + List items = Arrays.asList(itemsElement); + XpnHostList expectedResponse = XpnHostList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build(); + + ListXpnHostsProjectsPagedResponse pagedListResponse = client.listXpnHostsProjects(project, projectsListXpnHostsRequestResource); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listXpnHostsProjectsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build(); + + client.listXpnHostsProjects(project, projectsListXpnHostsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void moveDiskProjectTest() { @@ -166,66 +666,60 @@ public void moveDiskProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); - Operation actualResponse = client.moveDiskProject(project, diskMoveRequestResource); + Operation actualResponse = + client.moveDiskProject(requestId, project, diskMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void moveDiskProjectExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); - client.moveDiskProject(project, diskMoveRequestResource); + client.moveDiskProject(requestId, project, diskMoveRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -256,66 +750,60 @@ public void moveInstanceProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); - Operation actualResponse = client.moveInstanceProject(project, instanceMoveRequestResource); + Operation actualResponse = + client.moveInstanceProject(requestId, project, instanceMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void moveInstanceProjectExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); - client.moveInstanceProject(project, instanceMoveRequestResource); + client.moveInstanceProject(requestId, project, instanceMoveRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -346,66 +834,60 @@ public void setCommonInstanceMetadataProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Metadata metadataResource = Metadata.newBuilder().build(); - Operation actualResponse = client.setCommonInstanceMetadataProject(project, metadataResource); + Operation actualResponse = + client.setCommonInstanceMetadataProject(requestId, project, metadataResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Metadata metadataResource = Metadata.newBuilder().build(); - client.setCommonInstanceMetadataProject(project, metadataResource); + client.setCommonInstanceMetadataProject(requestId, project, metadataResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -436,70 +918,64 @@ public void setUsageExportBucketProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build(); Operation actualResponse = - client.setUsageExportBucketProject(project, usageExportLocationResource); + client.setUsageExportBucketProject(requestId, project, usageExportLocationResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void setUsageExportBucketProjectExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build(); - client.setUsageExportBucketProject(project, usageExportLocationResource); + client.setUsageExportBucketProject(requestId, project, usageExportLocationResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index 72356c713715..820e50448858 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -15,14 +15,6 @@ */ package com.google.cloud.compute.v1; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; - import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -33,12 +25,21 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -48,17 +49,17 @@ @javax.annotation.Generated("by GAPIC") public class RegionAutoscalerClientTest { - private static final List METHOD_DESCRIPTORS = - ImmutableList.copyOf( - Lists.newArrayList( - deleteRegionAutoscalerMethodDescriptor, - getRegionAutoscalerMethodDescriptor, - insertRegionAutoscalerMethodDescriptor, - listRegionAutoscalersMethodDescriptor, - patchRegionAutoscalerMethodDescriptor, - updateRegionAutoscalerMethodDescriptor)); - private static final MockHttpService mockService = - new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionAutoscalerMethodDescriptor, + getRegionAutoscalerMethodDescriptor, + insertRegionAutoscalerMethodDescriptor, + listRegionAutoscalersMethodDescriptor, + patchRegionAutoscalerMethodDescriptor, + updateRegionAutoscalerMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); private static RegionAutoscalerClient client; private static RegionAutoscalerSettings clientSettings; @@ -67,13 +68,13 @@ public class RegionAutoscalerClientTest { public static void setUp() throws IOException { clientSettings = RegionAutoscalerSettings.newBuilder() - .setTransportChannelProvider( - RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = RegionAutoscalerClient.create(clientSettings); + .setTransportChannelProvider( + RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + RegionAutoscalerClient.create(clientSettings); } @After @@ -110,66 +111,58 @@ public void deleteRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAutoscalerName autoscaler = - ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + String requestId = "requestId37109963"; - Operation actualResponse = client.deleteRegionAutoscaler(autoscaler); + Operation actualResponse = + client.deleteRegionAutoscaler(autoscaler, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void deleteRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAutoscalerName autoscaler = - ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + String requestId = "requestId37109963"; - client.deleteRegionAutoscaler(autoscaler); + client.deleteRegionAutoscaler(autoscaler, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -187,53 +180,45 @@ public void getRegionAutoscalerTest() { String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; String target = "target-880905839"; - Autoscaler expectedResponse = - Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setTarget(target) - .build(); + Autoscaler expectedResponse = Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .setTarget(target) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAutoscalerName autoscaler = - ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - Autoscaler actualResponse = client.getRegionAutoscaler(autoscaler); + Autoscaler actualResponse = + client.getRegionAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void getRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAutoscalerName autoscaler = - ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); client.getRegionAutoscaler(autoscaler); Assert.fail("No exception raised"); @@ -266,66 +251,60 @@ public void insertRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.insertRegionAutoscaler(region, autoscalerResource); + Operation actualResponse = + client.insertRegionAutoscaler(requestId, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void insertRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.insertRegionAutoscaler(region, autoscalerResource); + client.insertRegionAutoscaler(requestId, region, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -341,14 +320,13 @@ public void listRegionAutoscalersTest() { String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionAutoscalerList expectedResponse = - RegionAutoscalerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionAutoscalerList expectedResponse = RegionAutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); RegionName region = RegionName.of("[PROJECT]", "[REGION]"); @@ -357,29 +335,22 @@ public void listRegionAutoscalersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void listRegionAutoscalersExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -416,68 +387,62 @@ public void patchRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); + Operation actualResponse = + client.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void patchRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String autoscaler = "autoscaler517258967"; + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); + client.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -508,72 +473,66 @@ public void updateRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); Operation actualResponse = - client.updateRegionAutoscaler(autoscaler, region, autoscalerResource); + client.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void updateRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String autoscaler = "autoscaler517258967"; + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.updateRegionAutoscaler(autoscaler, region, autoscalerResource); + client.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java index c0c5387e4c47..800b95ef2507 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -138,10 +138,11 @@ public void deleteRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); Operation actualResponse = - client.deleteRegionBackendService(backendService); + client.deleteRegionBackendService(requestId, backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -160,9 +161,10 @@ public void deleteRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - client.deleteRegionBackendService(backendService); + client.deleteRegionBackendService(requestId, backendService); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -330,11 +332,12 @@ public void insertRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.insertRegionBackendService(region, backendServiceResource); + client.insertRegionBackendService(requestId, region, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -353,10 +356,11 @@ public void insertRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.insertRegionBackendService(region, backendServiceResource); + client.insertRegionBackendService(requestId, region, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -464,11 +468,12 @@ public void patchRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.patchRegionBackendService(backendService, backendServiceResource); + client.patchRegionBackendService(requestId, backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -487,10 +492,11 @@ public void patchRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.patchRegionBackendService(backendService, backendServiceResource); + client.patchRegionBackendService(requestId, backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -546,11 +552,12 @@ public void updateRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.updateRegionBackendService(backendService, backendServiceResource); + client.updateRegionBackendService(requestId, backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -569,10 +576,11 @@ public void updateRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.updateRegionBackendService(backendService, backendServiceResource); + client.updateRegionBackendService(requestId, backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java new file mode 100644 index 000000000000..45f7b039574c --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java @@ -0,0 +1,338 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.aggregatedListRegionCommitmentsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.getRegionCommitmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.insertRegionCommitmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.listRegionCommitmentsMethodDescriptor; +import com.google.cloud.compute.v1.stub.RegionCommitmentStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionCommitmentClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListRegionCommitmentsMethodDescriptor, + getRegionCommitmentMethodDescriptor, + insertRegionCommitmentMethodDescriptor, + listRegionCommitmentsMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, RegionCommitmentStubSettings.getDefaultEndpoint()); + + private static RegionCommitmentClient client; + private static RegionCommitmentSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionCommitmentSettings.newBuilder() + .setTransportChannelProvider( + RegionCommitmentSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + RegionCommitmentClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListRegionCommitmentsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + CommitmentsScopedList itemsItem = CommitmentsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + CommitmentAggregatedList expectedResponse = CommitmentAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListRegionCommitmentsPagedResponse pagedListResponse = client.aggregatedListRegionCommitments(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListRegionCommitmentsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListRegionCommitments(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRegionCommitmentTest() { + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String endTimestamp = "endTimestamp1004967602"; + String plan = "plan3443497"; + String startTimestamp = "startTimestamp-1526966919"; + String status = "status-892481550"; + Commitment expectedResponse = Commitment.newBuilder() + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .setEndTimestamp(endTimestamp) + .setPlan(plan) + .setStartTimestamp(startTimestamp) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); + + Commitment actualResponse = + client.getRegionCommitment(commitment); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionCommitmentExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); + + client.getRegionCommitment(commitment); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRegionCommitmentTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region2 = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Commitment commitmentResource = Commitment.newBuilder().build(); + + Operation actualResponse = + client.insertRegionCommitment(requestId, region, commitmentResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRegionCommitmentExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + Commitment commitmentResource = Commitment.newBuilder().build(); + + client.insertRegionCommitment(requestId, region, commitmentResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionCommitmentsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Commitment itemsElement = Commitment.newBuilder().build(); + List items = Arrays.asList(itemsElement); + CommitmentList expectedResponse = CommitmentList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + ListRegionCommitmentsPagedResponse pagedListResponse = client.listRegionCommitments(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionCommitmentsExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionCommitments(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java index 19280e440938..2188e03877f5 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -301,11 +301,12 @@ public void setNamedPortsRegionInstanceGroupTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); Operation actualResponse = - client.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsRegionInstanceGroup(requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -324,10 +325,11 @@ public void setNamedPortsRegionInstanceGroupExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); - client.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsRegionInstanceGroup(requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index ea2893f3f750..06497170a9d2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -146,11 +146,12 @@ public void abandonInstancesRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); Operation actualResponse = - client.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + client.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -169,10 +170,11 @@ public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exc mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); - client.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + client.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -228,10 +230,11 @@ public void deleteRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = - client.deleteRegionInstanceGroupManager(instanceGroupManager); + client.deleteRegionInstanceGroupManager(requestId, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -250,9 +253,10 @@ public void deleteRegionInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - client.deleteRegionInstanceGroupManager(instanceGroupManager); + client.deleteRegionInstanceGroupManager(requestId, instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -308,11 +312,12 @@ public void deleteInstancesRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); Operation actualResponse = - client.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + client.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -331,10 +336,11 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); - client.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + client.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -454,11 +460,12 @@ public void insertRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); Operation actualResponse = - client.insertRegionInstanceGroupManager(region, instanceGroupManagerResource); + client.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -477,10 +484,11 @@ public void insertRegionInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); - client.insertRegionInstanceGroupManager(region, instanceGroupManagerResource); + client.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -625,11 +633,12 @@ public void recreateInstancesRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); Operation actualResponse = - client.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + client.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -648,10 +657,11 @@ public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Ex mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); - client.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + client.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -708,10 +718,11 @@ public void resizeRegionInstanceGroupManagerTest() { mockService.addResponse(expectedResponse); Integer size = 3530753; + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = - client.resizeRegionInstanceGroupManager(size, instanceGroupManager); + client.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -731,9 +742,10 @@ public void resizeRegionInstanceGroupManagerExceptionTest() throws Exception { try { Integer size = 3530753; + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - client.resizeRegionInstanceGroupManager(size, instanceGroupManager); + client.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -789,11 +801,12 @@ public void setInstanceTemplateRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); Operation actualResponse = - client.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + client.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -812,10 +825,11 @@ public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); - client.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + client.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -871,11 +885,12 @@ public void setTargetPoolsRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); Operation actualResponse = - client.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + client.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -894,10 +909,11 @@ public void setTargetPoolsRegionInstanceGroupManagerExceptionTest() throws Excep mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); - client.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + client.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java index 0a031e82838e..77f10d0a7da3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -133,9 +133,10 @@ public void deleteRouteTest() { mockService.addResponse(expectedResponse); RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteRoute(route); + client.deleteRoute(route, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -155,8 +156,9 @@ public void deleteRouteExceptionTest() throws Exception { try { RouteName route = RouteName.of("[PROJECT]", "[ROUTE]"); + String requestId = "requestId37109963"; - client.deleteRoute(route); + client.deleteRoute(route, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -168,6 +170,7 @@ public void deleteRouteExceptionTest() throws Exception { public void getRouteTest() { String nextHopGateway = "nextHopGateway-159695614"; String kind = "kind3292052"; + String nextHopPeering = "nextHopPeering-661059074"; String description = "description-1724546052"; Integer priority = 1165461084; String nextHopNetwork = "nextHopNetwork1872908524"; @@ -183,6 +186,7 @@ public void getRouteTest() { Route expectedResponse = Route.newBuilder() .setNextHopGateway(nextHopGateway) .setKind(kind) + .setNextHopPeering(nextHopPeering) .setDescription(description) .setPriority(priority) .setNextHopNetwork(nextHopNetwork) @@ -278,11 +282,12 @@ public void insertRouteTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Route routeResource = Route.newBuilder().build(); Operation actualResponse = - client.insertRoute(project, routeResource); + client.insertRoute(requestId, project, routeResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -301,10 +306,11 @@ public void insertRouteExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Route routeResource = Route.newBuilder().build(); - client.insertRoute(project, routeResource); + client.insertRoute(requestId, project, routeResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 3c04fb3c53e3..0e672ea4a924 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -197,9 +197,10 @@ public void deleteRouterTest() { mockService.addResponse(expectedResponse); RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteRouter(router); + client.deleteRouter(router, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -219,8 +220,9 @@ public void deleteRouterExceptionTest() throws Exception { try { RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String requestId = "requestId37109963"; - client.deleteRouter(router); + client.deleteRouter(router, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -370,11 +372,12 @@ public void insertRouterTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Router routerResource = Router.newBuilder().build(); Operation actualResponse = - client.insertRouter(region, routerResource); + client.insertRouter(requestId, region, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -393,10 +396,11 @@ public void insertRouterExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Router routerResource = Router.newBuilder().build(); - client.insertRouter(region, routerResource); + client.insertRouter(requestId, region, routerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -505,10 +509,11 @@ public void patchRouterTest() { mockService.addResponse(expectedResponse); RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); Operation actualResponse = - client.patchRouter(router, routerResource); + client.patchRouter(router, requestId, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -528,9 +533,10 @@ public void patchRouterExceptionTest() throws Exception { try { RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - client.patchRouter(router, routerResource); + client.patchRouter(router, requestId, routerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -626,10 +632,11 @@ public void updateRouterTest() { mockService.addResponse(expectedResponse); RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); Operation actualResponse = - client.updateRouter(router, routerResource); + client.updateRouter(router, requestId, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -649,9 +656,10 @@ public void updateRouterExceptionTest() throws Exception { try { RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - client.updateRouter(router, routerResource); + client.updateRouter(router, requestId, routerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index 9f2757b9f6ad..e96ea16acdbf 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -29,6 +29,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.deleteSnapshotMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.getSnapshotMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.listSnapshotsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.setLabelsSnapshotMethodDescriptor; import com.google.cloud.compute.v1.stub.SnapshotStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -50,7 +51,8 @@ public class SnapshotClientTest { Lists.newArrayList( deleteSnapshotMethodDescriptor, getSnapshotMethodDescriptor, - listSnapshotsMethodDescriptor + listSnapshotsMethodDescriptor, + setLabelsSnapshotMethodDescriptor )); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, SnapshotStubSettings.getDefaultEndpoint()); @@ -130,10 +132,11 @@ public void deleteSnapshotTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); Operation actualResponse = - client.deleteSnapshot(snapshot); + client.deleteSnapshot(requestId, snapshot); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -152,9 +155,10 @@ public void deleteSnapshotExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - client.deleteSnapshot(snapshot); + client.deleteSnapshot(requestId, snapshot); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -168,6 +172,7 @@ public void getSnapshotTest() { String sourceDiskId = "sourceDiskId-1693292839"; String kind = "kind3292052"; String description = "description-1724546052"; + String labelFingerprint = "labelFingerprint714995737"; String selfLink = "selfLink-1691268851"; String storageBytesStatus = "storageBytesStatus1027609994"; String storageBytes = "storageBytes2035244455"; @@ -181,6 +186,7 @@ public void getSnapshotTest() { .setSourceDiskId(sourceDiskId) .setKind(kind) .setDescription(description) + .setLabelFingerprint(labelFingerprint) .setSelfLink(selfLink) .setStorageBytesStatus(storageBytesStatus) .setStorageBytes(storageBytes) @@ -275,4 +281,86 @@ public void listSnapshotsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setLabelsSnapshotTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + + Operation actualResponse = + client.setLabelsSnapshot(resource, globalSetLabelsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setLabelsSnapshotExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + + client.setLabelsSnapshot(resource, globalSetLabelsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java index 42cd9cf6b4d9..b41ba14e18da 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -133,9 +133,10 @@ public void deleteSslCertificateTest() { mockService.addResponse(expectedResponse); SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteSslCertificate(sslCertificate); + client.deleteSslCertificate(sslCertificate, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -155,8 +156,9 @@ public void deleteSslCertificateExceptionTest() throws Exception { try { SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + String requestId = "requestId37109963"; - client.deleteSslCertificate(sslCertificate); + client.deleteSslCertificate(sslCertificate, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -266,11 +268,12 @@ public void insertSslCertificateTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); SslCertificate sslCertificateResource = SslCertificate.newBuilder().build(); Operation actualResponse = - client.insertSslCertificate(project, sslCertificateResource); + client.insertSslCertificate(requestId, project, sslCertificateResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -289,10 +292,11 @@ public void insertSslCertificateExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); SslCertificate sslCertificateResource = SslCertificate.newBuilder().build(); - client.insertSslCertificate(project, sslCertificateResource); + client.insertSslCertificate(requestId, project, sslCertificateResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index c54ad7c420ab..c9c91faf539f 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -33,6 +33,8 @@ import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.getSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.insertSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.listSubnetworksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.patchSubnetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.setPrivateIpGoogleAccessSubnetworkMethodDescriptor; import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -57,7 +59,9 @@ public class SubnetworkClientTest { expandIpCidrRangeSubnetworkMethodDescriptor, getSubnetworkMethodDescriptor, insertSubnetworkMethodDescriptor, - listSubnetworksMethodDescriptor + listSubnetworksMethodDescriptor, + patchSubnetworkMethodDescriptor, + setPrivateIpGoogleAccessSubnetworkMethodDescriptor )); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, SubnetworkStubSettings.getDefaultEndpoint()); @@ -190,10 +194,11 @@ public void deleteSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Operation actualResponse = - client.deleteSubnetwork(subnetwork); + client.deleteSubnetwork(requestId, subnetwork); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -212,9 +217,10 @@ public void deleteSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - client.deleteSubnetwork(subnetwork); + client.deleteSubnetwork(requestId, subnetwork); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -270,11 +276,12 @@ public void expandIpCidrRangeSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); Operation actualResponse = - client.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource); + client.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -293,10 +300,11 @@ public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); - client.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource); + client.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -306,27 +314,31 @@ public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSubnetworkTest() { + Boolean privateIpGoogleAccess = true; String kind = "kind3292052"; + String description = "description-1724546052"; + NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; String name = "name3373707"; - String description = "description-1724546052"; String gatewayAddress = "gatewayAddress-77003527"; String id = "id3355"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); String ipCidrRange = "ipCidrRange-2049366326"; - NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]"); - String selfLink = "selfLink-1691268851"; Subnetwork expectedResponse = Subnetwork.newBuilder() + .setPrivateIpGoogleAccess(privateIpGoogleAccess) .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) .setName(name) - .setDescription(description) .setGatewayAddress(gatewayAddress) .setId(id) .setRegion(region.toString()) .setIpCidrRange(ipCidrRange) - .setNetwork(network.toString()) - .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -410,11 +422,12 @@ public void insertSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); Operation actualResponse = - client.insertSubnetwork(region, subnetworkResource); + client.insertSubnetwork(requestId, region, subnetworkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -433,10 +446,11 @@ public void insertSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - client.insertSubnetwork(region, subnetworkResource); + client.insertSubnetwork(requestId, region, subnetworkResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -495,4 +509,172 @@ public void listSubnetworksExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void patchSubnetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); + + Operation actualResponse = + client.patchSubnetwork(requestId, subnetwork, subnetworkResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void patchSubnetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); + + client.patchSubnetwork(requestId, subnetwork, subnetworkResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setPrivateIpGoogleAccessSubnetworkTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); + + Operation actualResponse = + client.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setPrivateIpGoogleAccessSubnetworkExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); + + client.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + } \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java index 514e4f015346..06bb99030fa0 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -134,10 +134,11 @@ public void deleteTargetHttpProxyTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); Operation actualResponse = - client.deleteTargetHttpProxy(targetHttpProxy); + client.deleteTargetHttpProxy(requestId, targetHttpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -156,9 +157,10 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); - client.deleteTargetHttpProxy(targetHttpProxy); + client.deleteTargetHttpProxy(requestId, targetHttpProxy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -266,11 +268,12 @@ public void insertTargetHttpProxyTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build(); Operation actualResponse = - client.insertTargetHttpProxy(project, targetHttpProxyResource); + client.insertTargetHttpProxy(requestId, project, targetHttpProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -289,10 +292,11 @@ public void insertTargetHttpProxyExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build(); - client.insertTargetHttpProxy(project, targetHttpProxyResource); + client.insertTargetHttpProxy(requestId, project, targetHttpProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -400,11 +404,12 @@ public void setUrlMapTargetHttpProxyTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); Operation actualResponse = - client.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource); + client.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -423,10 +428,11 @@ public void setUrlMapTargetHttpProxyExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); - client.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource); + client.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 2fcf2599aab9..41167c782ea2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -15,14 +15,6 @@ */ package com.google.cloud.compute.v1; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; - import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -33,12 +25,21 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -48,17 +49,17 @@ @javax.annotation.Generated("by GAPIC") public class TargetHttpsProxyClientTest { - private static final List METHOD_DESCRIPTORS = - ImmutableList.copyOf( - Lists.newArrayList( - deleteTargetHttpsProxyMethodDescriptor, - getTargetHttpsProxyMethodDescriptor, - insertTargetHttpsProxyMethodDescriptor, - listTargetHttpsProxiesMethodDescriptor, - setSslCertificatesTargetHttpsProxyMethodDescriptor, - setUrlMapTargetHttpsProxyMethodDescriptor)); - private static final MockHttpService mockService = - new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetHttpsProxyMethodDescriptor, + getTargetHttpsProxyMethodDescriptor, + insertTargetHttpsProxyMethodDescriptor, + listTargetHttpsProxiesMethodDescriptor, + setSslCertificatesTargetHttpsProxyMethodDescriptor, + setUrlMapTargetHttpsProxyMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); private static TargetHttpsProxyClient client; private static TargetHttpsProxySettings clientSettings; @@ -67,13 +68,13 @@ public class TargetHttpsProxyClientTest { public static void setUp() throws IOException { clientSettings = TargetHttpsProxySettings.newBuilder() - .setTransportChannelProvider( - TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TargetHttpsProxyClient.create(clientSettings); + .setTransportChannelProvider( + TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + TargetHttpsProxyClient.create(clientSettings); } @After @@ -110,66 +111,58 @@ public void deleteTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; - Operation actualResponse = client.deleteTargetHttpsProxy(targetHttpsProxy); + Operation actualResponse = + client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void deleteTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; - client.deleteTargetHttpsProxy(targetHttpsProxy); + client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -186,50 +179,40 @@ public void getTargetHttpsProxyTest() { String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - TargetHttpsProxy expectedResponse = - TargetHttpsProxy.newBuilder() - .setUrlMap(urlMap.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + TargetHttpsProxy expectedResponse = TargetHttpsProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxy actualResponse = client.getTargetHttpsProxy(targetHttpsProxy); + TargetHttpsProxy actualResponse = + client.getTargetHttpsProxy(targetHttpsProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void getTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); client.getTargetHttpsProxy(targetHttpsProxy); Assert.fail("No exception raised"); @@ -262,66 +245,60 @@ public void insertTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); - Operation actualResponse = client.insertTargetHttpsProxy(project, targetHttpsProxyResource); + Operation actualResponse = + client.insertTargetHttpsProxy(requestId, project, targetHttpsProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void insertTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); - client.insertTargetHttpsProxy(project, targetHttpsProxyResource); + client.insertTargetHttpsProxy(requestId, project, targetHttpsProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -337,14 +314,13 @@ public void listTargetHttpsProxiesTest() { String selfLink = "selfLink-1691268851"; TargetHttpsProxy itemsElement = TargetHttpsProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetHttpsProxyList expectedResponse = - TargetHttpsProxyList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetHttpsProxyList expectedResponse = TargetHttpsProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -353,29 +329,22 @@ public void listTargetHttpsProxiesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void listTargetHttpsProxiesExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -412,75 +381,60 @@ public void setSslCertificatesTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxiesSetSslCertificatesRequest - targetHttpsProxiesSetSslCertificatesRequestResource = - TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; + TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = - client.setSslCertificatesTargetHttpsProxy( - targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxiesSetSslCertificatesRequest - targetHttpsProxiesSetSslCertificatesRequestResource = - TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); - - client.setSslCertificatesTargetHttpsProxy( - targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; + TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + + client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -511,72 +465,64 @@ public void setUrlMapTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = - Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); Operation actualResponse = - client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); + client.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); } @Test @SuppressWarnings("all") public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - TargetHttpsProxyName targetHttpsProxy = - TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); - client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); + client.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } -} + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java index 6f4b1258f243..a9aabe2c5063 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -188,10 +188,11 @@ public void deleteTargetInstanceTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); Operation actualResponse = - client.deleteTargetInstance(targetInstance); + client.deleteTargetInstance(requestId, targetInstance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -210,9 +211,10 @@ public void deleteTargetInstanceExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); - client.deleteTargetInstance(targetInstance); + client.deleteTargetInstance(requestId, targetInstance); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -325,10 +327,11 @@ public void insertTargetInstanceTest() { mockService.addResponse(expectedResponse); ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); Operation actualResponse = - client.insertTargetInstance(zone, targetInstanceResource); + client.insertTargetInstance(zone, requestId, targetInstanceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -348,9 +351,10 @@ public void insertTargetInstanceExceptionTest() throws Exception { try { ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String requestId = "requestId37109963"; TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); - client.insertTargetInstance(zone, targetInstanceResource); + client.insertTargetInstance(zone, requestId, targetInstanceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java index c6a2a6169656..4897c6775312 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -148,10 +148,11 @@ public void addHealthCheckTargetPoolTest() { mockService.addResponse(expectedResponse); TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); Operation actualResponse = - client.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); + client.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -171,9 +172,10 @@ public void addHealthCheckTargetPoolExceptionTest() throws Exception { try { TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); - client.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); + client.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -230,10 +232,11 @@ public void addInstanceTargetPoolTest() { mockService.addResponse(expectedResponse); TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); Operation actualResponse = - client.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource); + client.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -253,9 +256,10 @@ public void addInstanceTargetPoolExceptionTest() throws Exception { try { TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); - client.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource); + client.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -365,9 +369,10 @@ public void deleteTargetPoolTest() { mockService.addResponse(expectedResponse); TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteTargetPool(targetPool); + client.deleteTargetPool(targetPool, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -387,8 +392,9 @@ public void deleteTargetPoolExceptionTest() throws Exception { try { TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; - client.deleteTargetPool(targetPool); + client.deleteTargetPool(targetPool, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -544,11 +550,12 @@ public void insertTargetPoolTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); TargetPool targetPoolResource = TargetPool.newBuilder().build(); Operation actualResponse = - client.insertTargetPool(region, targetPoolResource); + client.insertTargetPool(requestId, region, targetPoolResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -567,10 +574,11 @@ public void insertTargetPoolExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); TargetPool targetPoolResource = TargetPool.newBuilder().build(); - client.insertTargetPool(region, targetPoolResource); + client.insertTargetPool(requestId, region, targetPoolResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -679,10 +687,11 @@ public void removeHealthCheckTargetPoolTest() { mockService.addResponse(expectedResponse); TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); Operation actualResponse = - client.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource); + client.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -702,9 +711,10 @@ public void removeHealthCheckTargetPoolExceptionTest() throws Exception { try { TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); - client.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource); + client.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -761,10 +771,11 @@ public void removeInstanceTargetPoolTest() { mockService.addResponse(expectedResponse); TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); Operation actualResponse = - client.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource); + client.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -784,9 +795,10 @@ public void removeInstanceTargetPoolExceptionTest() throws Exception { try { TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); - client.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource); + client.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -843,11 +855,12 @@ public void setBackupTargetPoolTest() { mockService.addResponse(expectedResponse); TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; Float failoverRatio = -8.6107481E7F; TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = - client.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource); + client.setBackupTargetPool(targetPool, requestId, failoverRatio, targetReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -867,10 +880,11 @@ public void setBackupTargetPoolExceptionTest() throws Exception { try { TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + String requestId = "requestId37109963"; Float failoverRatio = -8.6107481E7F; TargetReference targetReferenceResource = TargetReference.newBuilder().build(); - client.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource); + client.setBackupTargetPool(targetPool, requestId, failoverRatio, targetReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java index 94ebdc834e5d..84122ee7a8cd 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -139,9 +139,10 @@ public void deleteTargetSslProxyTest() { mockService.addResponse(expectedResponse); TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteTargetSslProxy(targetSslProxy); + client.deleteTargetSslProxy(targetSslProxy, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -161,8 +162,9 @@ public void deleteTargetSslProxyExceptionTest() throws Exception { try { TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; - client.deleteTargetSslProxy(targetSslProxy); + client.deleteTargetSslProxy(targetSslProxy, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -272,11 +274,12 @@ public void insertTargetSslProxyTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); Operation actualResponse = - client.insertTargetSslProxy(project, targetSslProxyResource); + client.insertTargetSslProxy(requestId, project, targetSslProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -295,10 +298,11 @@ public void insertTargetSslProxyExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); - client.insertTargetSslProxy(project, targetSslProxyResource); + client.insertTargetSslProxy(requestId, project, targetSslProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -407,10 +411,11 @@ public void setBackendServiceTargetSslProxyTest() { mockService.addResponse(expectedResponse); TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); Operation actualResponse = - client.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + client.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -430,9 +435,10 @@ public void setBackendServiceTargetSslProxyExceptionTest() throws Exception { try { TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); - client.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + client.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -489,10 +495,11 @@ public void setProxyHeaderTargetSslProxyTest() { mockService.addResponse(expectedResponse); TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); Operation actualResponse = - client.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + client.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -512,9 +519,10 @@ public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception { try { TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); - client.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + client.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -571,10 +579,11 @@ public void setSslCertificatesTargetSslProxyTest() { mockService.addResponse(expectedResponse); TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = - client.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -594,9 +603,10 @@ public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception { try { TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); - client.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java new file mode 100644 index 000000000000..f34ccf108a68 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java @@ -0,0 +1,530 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.deleteTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.getTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.insertTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.listTargetTcpProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.setBackendServiceTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.setProxyHeaderTargetTcpProxyMethodDescriptor; +import com.google.cloud.compute.v1.stub.TargetTcpProxyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class TargetTcpProxyClientTest { + + private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetTcpProxyMethodDescriptor, + getTargetTcpProxyMethodDescriptor, + insertTargetTcpProxyMethodDescriptor, + listTargetTcpProxiesMethodDescriptor, + setBackendServiceTargetTcpProxyMethodDescriptor, + setProxyHeaderTargetTcpProxyMethodDescriptor + )); + private static final MockHttpService mockService + = new MockHttpService(METHOD_DESCRIPTORS, TargetTcpProxyStubSettings.getDefaultEndpoint()); + + private static TargetTcpProxyClient client; + private static TargetTcpProxySettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + TargetTcpProxySettings.newBuilder() + .setTransportChannelProvider( + TargetTcpProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService).build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = + TargetTcpProxyClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetTcpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + + Operation actualResponse = + client.deleteTargetTcpProxy(requestId, targetTcpProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteTargetTcpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + + client.deleteTargetTcpProxy(requestId, targetTcpProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTargetTcpProxyTest() { + String kind = "kind3292052"; + String service = "service1984153269"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String proxyHeader = "proxyHeader-1987109506"; + String selfLink = "selfLink-1691268851"; + TargetTcpProxy expectedResponse = TargetTcpProxy.newBuilder() + .setKind(kind) + .setService(service) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setProxyHeader(proxyHeader) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + + TargetTcpProxy actualResponse = + client.getTargetTcpProxy(targetTcpProxy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void getTargetTcpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + + client.getTargetTcpProxy(targetTcpProxy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertTargetTcpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build(); + + Operation actualResponse = + client.insertTargetTcpProxy(requestId, project, targetTcpProxyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void insertTargetTcpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build(); + + client.insertTargetTcpProxy(requestId, project, targetTcpProxyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listTargetTcpProxiesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + TargetTcpProxy itemsElement = TargetTcpProxy.newBuilder().build(); + List items = Arrays.asList(itemsElement); + TargetTcpProxyList expectedResponse = TargetTcpProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListTargetTcpProxiesPagedResponse pagedListResponse = client.listTargetTcpProxies(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), + resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void listTargetTcpProxiesExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listTargetTcpProxies(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setBackendServiceTargetTcpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); + + Operation actualResponse = + client.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setBackendServiceTargetTcpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); + + client.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setProxyHeaderTargetTcpProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + RegionName region = RegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); + + Operation actualResponse = + client.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = mockService.getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); + Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey).matches()); + } + + @Test + @SuppressWarnings("all") + public void setProxyHeaderTargetTcpProxyExceptionTest() throws Exception { + ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); + + client.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + +} \ No newline at end of file diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java index b6867eb03f6e..45b3056d0a66 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -188,10 +188,11 @@ public void deleteTargetVpnGatewayTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); Operation actualResponse = - client.deleteTargetVpnGateway(targetVpnGateway); + client.deleteTargetVpnGateway(requestId, targetVpnGateway); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -210,9 +211,10 @@ public void deleteTargetVpnGatewayExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); - client.deleteTargetVpnGateway(targetVpnGateway); + client.deleteTargetVpnGateway(requestId, targetVpnGateway); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -324,11 +326,12 @@ public void insertTargetVpnGatewayTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build(); Operation actualResponse = - client.insertTargetVpnGateway(region, targetVpnGatewayResource); + client.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -347,10 +350,11 @@ public void insertTargetVpnGatewayExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build(); - client.insertTargetVpnGateway(region, targetVpnGatewayResource); + client.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java index 9dc527b50b5b..75931112bd02 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -141,9 +141,10 @@ public void deleteUrlMapTest() { mockService.addResponse(expectedResponse); UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; Operation actualResponse = - client.deleteUrlMap(urlMap); + client.deleteUrlMap(urlMap, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -163,8 +164,9 @@ public void deleteUrlMapExceptionTest() throws Exception { try { UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; - client.deleteUrlMap(urlMap); + client.deleteUrlMap(urlMap, requestId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -274,11 +276,12 @@ public void insertUrlMapTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UrlMap urlMapResource = UrlMap.newBuilder().build(); Operation actualResponse = - client.insertUrlMap(project, urlMapResource); + client.insertUrlMap(requestId, project, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -297,10 +300,11 @@ public void insertUrlMapExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UrlMap urlMapResource = UrlMap.newBuilder().build(); - client.insertUrlMap(project, urlMapResource); + client.insertUrlMap(requestId, project, urlMapResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -357,10 +361,11 @@ public void invalidateCacheUrlMapTest() { mockService.addResponse(expectedResponse); UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); Operation actualResponse = - client.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource); + client.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -380,9 +385,10 @@ public void invalidateCacheUrlMapExceptionTest() throws Exception { try { UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); - client.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource); + client.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -491,10 +497,11 @@ public void patchUrlMapTest() { mockService.addResponse(expectedResponse); UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); Operation actualResponse = - client.patchUrlMap(urlMap, urlMapResource); + client.patchUrlMap(urlMap, requestId, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -514,9 +521,10 @@ public void patchUrlMapExceptionTest() throws Exception { try { UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - client.patchUrlMap(urlMap, urlMapResource); + client.patchUrlMap(urlMap, requestId, urlMapResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -573,10 +581,11 @@ public void updateUrlMapTest() { mockService.addResponse(expectedResponse); UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); Operation actualResponse = - client.updateUrlMap(urlMap, urlMapResource); + client.updateUrlMap(urlMap, requestId, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -596,9 +605,10 @@ public void updateUrlMapExceptionTest() throws Exception { try { UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]"); + String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - client.updateUrlMap(urlMap, urlMapResource); + client.updateUrlMap(urlMap, requestId, urlMapResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java index 251e92a45968..37a95bb7160b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -188,10 +188,11 @@ public void deleteVpnTunnelTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); Operation actualResponse = - client.deleteVpnTunnel(vpnTunnel); + client.deleteVpnTunnel(requestId, vpnTunnel); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -210,9 +211,10 @@ public void deleteVpnTunnelExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); - client.deleteVpnTunnel(vpnTunnel); + client.deleteVpnTunnel(requestId, vpnTunnel); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -336,11 +338,12 @@ public void insertVpnTunnelTest() { .build(); mockService.addResponse(expectedResponse); + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); Operation actualResponse = - client.insertVpnTunnel(region, vpnTunnelResource); + client.insertVpnTunnel(requestId, region, vpnTunnelResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -359,10 +362,11 @@ public void insertVpnTunnelExceptionTest() throws Exception { mockService.addException(exception); try { + String requestId = "requestId37109963"; RegionName region = RegionName.of("[PROJECT]", "[REGION]"); VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); - client.insertVpnTunnel(region, vpnTunnelResource); + client.insertVpnTunnel(requestId, region, vpnTunnelResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception From 5e2d1914b55f249562b2376b92f3df5ebecea009 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 3 Apr 2018 16:41:18 -0700 Subject: [PATCH 11/42] regen from toolkit not master, doesn't work --- .../compute/v1/AcceleratorTypeClient.java | 24 +- .../cloud/compute/v1/AddressClient.java | 44 +-- .../cloud/compute/v1/AutoscalerClient.java | 64 ++--- .../cloud/compute/v1/BackendBucketClient.java | 42 +-- .../compute/v1/BackendServiceClient.java | 52 ++-- .../google/cloud/compute/v1/DiskClient.java | 74 ++--- .../cloud/compute/v1/DiskTypeClient.java | 24 +- .../cloud/compute/v1/FirewallClient.java | 42 +-- .../compute/v1/ForwardingRuleClient.java | 54 ++-- .../compute/v1/GlobalOperationClient.java | 22 +- .../cloud/compute/v1/HealthCheckClient.java | 42 +-- .../compute/v1/HttpHealthCheckClient.java | 42 +-- .../compute/v1/HttpsHealthCheckClient.java | 42 +-- .../google/cloud/compute/v1/ImageClient.java | 50 ++-- .../cloud/compute/v1/InstanceClient.java | 264 +++++++++--------- .../cloud/compute/v1/InstanceGroupClient.java | 86 +++--- .../v1/InstanceGroupManagerClient.java | 114 ++++---- .../compute/v1/InstanceTemplateClient.java | 22 +- .../v1/InterconnectAttachmentClient.java | 44 +-- .../cloud/compute/v1/InterconnectClient.java | 32 +-- .../v1/InterconnectLocationClient.java | 12 +- .../cloud/compute/v1/LicenseClient.java | 12 +- .../cloud/compute/v1/MachineTypeClient.java | 24 +- .../cloud/compute/v1/NetworkClient.java | 62 ++-- .../compute/v1/ProjectBackendBucketName.java | 186 ++++++++++++ .../compute/v1/ProjectBackendServiceName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectFamilyName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectFirewallName.java | 186 ++++++++++++ .../compute/v1/ProjectHealthCheckName.java | 186 ++++++++++++ .../v1/ProjectHttpHealthCheckName.java | 186 ++++++++++++ .../v1/ProjectHttpsHealthCheckName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectImageName.java | 2 +- .../v1/ProjectInstanceTemplateName.java | 186 ++++++++++++ .../v1/ProjectInterconnectLocationName.java | 186 ++++++++++++ .../compute/v1/ProjectInterconnectName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectLicenseName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectNetworkName.java | 186 ++++++++++++ .../compute/v1/ProjectOperationName.java | 186 ++++++++++++ .../compute/v1/ProjectRegionAddressName.java | 210 ++++++++++++++ .../v1/ProjectRegionCommitmentName.java | 210 ++++++++++++++ .../v1/ProjectRegionForwardingRuleName.java | 210 ++++++++++++++ ...ojectRegionInterconnectAttachmentName.java | 210 ++++++++++++++ .../cloud/compute/v1/ProjectRegionName.java | 186 ++++++++++++ .../compute/v1/ProjectRegionRouterName.java | 210 ++++++++++++++ .../v1/ProjectRegionSubnetworkName.java | 210 ++++++++++++++ .../v1/ProjectRegionTargetPoolName.java | 210 ++++++++++++++ .../v1/ProjectRegionTargetVpnGatewayName.java | 210 ++++++++++++++ .../v1/ProjectRegionVpnTunnelName.java | 210 ++++++++++++++ .../cloud/compute/v1/ProjectRouteName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectSnapshotName.java | 2 +- .../compute/v1/ProjectSslCertificateName.java | 186 ++++++++++++ .../v1/ProjectTargetHttpProxyName.java | 186 ++++++++++++ .../v1/ProjectTargetHttpsProxyName.java | 186 ++++++++++++ .../compute/v1/ProjectTargetSslProxyName.java | 186 ++++++++++++ .../compute/v1/ProjectTargetTcpProxyName.java | 186 ++++++++++++ .../cloud/compute/v1/ProjectUrlMapName.java | 186 ++++++++++++ .../v1/ProjectZoneAcceleratorTypeName.java | 210 ++++++++++++++ .../compute/v1/ProjectZoneAutoscalerName.java | 210 ++++++++++++++ .../cloud/compute/v1/ProjectZoneDiskName.java | 210 ++++++++++++++ .../compute/v1/ProjectZoneDiskTypeName.java | 210 ++++++++++++++ .../ProjectZoneInstanceGroupManagerName.java | 210 ++++++++++++++ .../v1/ProjectZoneInstanceGroupName.java | 210 ++++++++++++++ .../compute/v1/ProjectZoneInstanceName.java | 50 ++-- .../v1/ProjectZoneMachineTypeName.java | 210 ++++++++++++++ .../cloud/compute/v1/ProjectZoneName.java | 186 ++++++++++++ .../v1/ProjectZoneTargetInstanceName.java | 210 ++++++++++++++ .../compute/v1/RegionAutoscalerClient.java | 42 +-- .../v1/RegionBackendServiceClient.java | 22 +- .../google/cloud/compute/v1/RegionClient.java | 12 +- .../compute/v1/RegionCommitmentClient.java | 34 +-- .../compute/v1/RegionInstanceGroupClient.java | 12 +- .../v1/RegionInstanceGroupManagerClient.java | 22 +- .../compute/v1/RegionOperationClient.java | 12 +- .../google/cloud/compute/v1/RouteClient.java | 22 +- .../google/cloud/compute/v1/RouterClient.java | 84 +++--- .../cloud/compute/v1/SnapshotClient.java | 30 +- .../compute/v1/SslCertificateClient.java | 22 +- .../cloud/compute/v1/SubnetworkClient.java | 74 ++--- .../compute/v1/TargetHttpProxyClient.java | 32 +-- .../compute/v1/TargetHttpsProxyClient.java | 42 +-- .../compute/v1/TargetInstanceClient.java | 44 +-- .../cloud/compute/v1/TargetPoolClient.java | 104 +++---- .../compute/v1/TargetSslProxyClient.java | 52 ++-- .../compute/v1/TargetTcpProxyClient.java | 42 +-- .../compute/v1/TargetVpnGatewayClient.java | 44 +-- .../google/cloud/compute/v1/UrlMapClient.java | 62 ++-- .../cloud/compute/v1/VpnTunnelClient.java | 44 +-- .../google/cloud/compute/v1/ZoneClient.java | 12 +- .../cloud/compute/v1/ZoneOperationClient.java | 12 +- .../google/cloud/compute/v1/package-info.java | 82 +++--- .../compute/v1/stub/AcceleratorTypeStub.java | 4 +- .../cloud/compute/v1/stub/AddressStub.java | 4 +- .../cloud/compute/v1/stub/AutoscalerStub.java | 4 +- .../compute/v1/stub/BackendBucketStub.java | 2 +- .../compute/v1/stub/BackendServiceStub.java | 2 +- .../cloud/compute/v1/stub/DiskStub.java | 5 +- .../cloud/compute/v1/stub/DiskTypeStub.java | 4 +- .../cloud/compute/v1/stub/FirewallStub.java | 2 +- .../compute/v1/stub/ForwardingRuleStub.java | 4 +- .../compute/v1/stub/GlobalOperationStub.java | 2 +- .../compute/v1/stub/HealthCheckStub.java | 2 +- .../compute/v1/stub/HttpHealthCheckStub.java | 2 +- ...ttpJsonAcceleratorTypeCallableFactory.java | 4 +- .../v1/stub/HttpJsonAcceleratorTypeStub.java | 8 +- .../stub/HttpJsonAddressCallableFactory.java | 4 +- .../compute/v1/stub/HttpJsonAddressStub.java | 12 +- .../HttpJsonAutoscalerCallableFactory.java | 4 +- .../v1/stub/HttpJsonAutoscalerStub.java | 16 +- .../HttpJsonBackendBucketCallableFactory.java | 2 +- .../v1/stub/HttpJsonBackendBucketStub.java | 10 +- ...HttpJsonBackendServiceCallableFactory.java | 2 +- .../v1/stub/HttpJsonBackendServiceStub.java | 12 +- .../v1/stub/HttpJsonDiskCallableFactory.java | 5 +- .../compute/v1/stub/HttpJsonDiskStub.java | 19 +- .../stub/HttpJsonDiskTypeCallableFactory.java | 4 +- .../compute/v1/stub/HttpJsonDiskTypeStub.java | 8 +- .../stub/HttpJsonFirewallCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonFirewallStub.java | 10 +- ...HttpJsonForwardingRuleCallableFactory.java | 4 +- .../v1/stub/HttpJsonForwardingRuleStub.java | 14 +- ...ttpJsonGlobalOperationCallableFactory.java | 2 +- .../v1/stub/HttpJsonGlobalOperationStub.java | 6 +- .../HttpJsonHealthCheckCallableFactory.java | 2 +- .../v1/stub/HttpJsonHealthCheckStub.java | 10 +- ...ttpJsonHttpHealthCheckCallableFactory.java | 2 +- .../v1/stub/HttpJsonHttpHealthCheckStub.java | 10 +- ...tpJsonHttpsHealthCheckCallableFactory.java | 2 +- .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 10 +- .../v1/stub/HttpJsonImageCallableFactory.java | 3 +- .../compute/v1/stub/HttpJsonImageStub.java | 11 +- .../stub/HttpJsonInstanceCallableFactory.java | 3 +- .../HttpJsonInstanceGroupCallableFactory.java | 4 +- ...onInstanceGroupManagerCallableFactory.java | 4 +- .../HttpJsonInstanceGroupManagerStub.java | 26 +- .../v1/stub/HttpJsonInstanceGroupStub.java | 20 +- .../compute/v1/stub/HttpJsonInstanceStub.java | 53 ++-- ...tpJsonInstanceTemplateCallableFactory.java | 2 +- .../v1/stub/HttpJsonInstanceTemplateStub.java | 6 +- ...InterconnectAttachmentCallableFactory.java | 4 +- .../HttpJsonInterconnectAttachmentStub.java | 12 +- .../HttpJsonInterconnectCallableFactory.java | 2 +- ...onInterconnectLocationCallableFactory.java | 2 +- .../HttpJsonInterconnectLocationStub.java | 4 +- .../v1/stub/HttpJsonInterconnectStub.java | 8 +- .../stub/HttpJsonLicenseCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonLicenseStub.java | 4 +- .../HttpJsonMachineTypeCallableFactory.java | 4 +- .../v1/stub/HttpJsonMachineTypeStub.java | 8 +- .../stub/HttpJsonNetworkCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonNetworkStub.java | 14 +- ...tpJsonRegionAutoscalerCallableFactory.java | 2 +- .../v1/stub/HttpJsonRegionAutoscalerStub.java | 10 +- ...onRegionBackendServiceCallableFactory.java | 2 +- .../HttpJsonRegionBackendServiceStub.java | 6 +- .../stub/HttpJsonRegionCallableFactory.java | 2 +- ...tpJsonRegionCommitmentCallableFactory.java | 4 +- .../v1/stub/HttpJsonRegionCommitmentStub.java | 10 +- ...sonRegionInstanceGroupCallableFactory.java | 2 +- ...onInstanceGroupManagerCallableFactory.java | 2 +- ...ttpJsonRegionInstanceGroupManagerStub.java | 6 +- .../stub/HttpJsonRegionInstanceGroupStub.java | 4 +- ...ttpJsonRegionOperationCallableFactory.java | 2 +- .../v1/stub/HttpJsonRegionOperationStub.java | 4 +- .../compute/v1/stub/HttpJsonRegionStub.java | 4 +- .../v1/stub/HttpJsonRouteCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonRouteStub.java | 6 +- .../stub/HttpJsonRouterCallableFactory.java | 4 +- .../compute/v1/stub/HttpJsonRouterStub.java | 20 +- .../stub/HttpJsonSnapshotCallableFactory.java | 1 - .../compute/v1/stub/HttpJsonSnapshotStub.java | 5 +- ...HttpJsonSslCertificateCallableFactory.java | 2 +- .../v1/stub/HttpJsonSslCertificateStub.java | 6 +- .../HttpJsonSubnetworkCallableFactory.java | 4 +- .../v1/stub/HttpJsonSubnetworkStub.java | 18 +- ...ttpJsonTargetHttpProxyCallableFactory.java | 2 +- .../v1/stub/HttpJsonTargetHttpProxyStub.java | 8 +- ...tpJsonTargetHttpsProxyCallableFactory.java | 2 +- .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 10 +- ...HttpJsonTargetInstanceCallableFactory.java | 4 +- .../v1/stub/HttpJsonTargetInstanceStub.java | 12 +- .../HttpJsonTargetPoolCallableFactory.java | 4 +- .../v1/stub/HttpJsonTargetPoolStub.java | 24 +- ...HttpJsonTargetSslProxyCallableFactory.java | 2 +- .../v1/stub/HttpJsonTargetSslProxyStub.java | 12 +- ...HttpJsonTargetTcpProxyCallableFactory.java | 2 +- .../v1/stub/HttpJsonTargetTcpProxyStub.java | 10 +- ...tpJsonTargetVpnGatewayCallableFactory.java | 4 +- .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 12 +- .../stub/HttpJsonUrlMapCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonUrlMapStub.java | 14 +- .../HttpJsonVpnTunnelCallableFactory.java | 4 +- .../v1/stub/HttpJsonVpnTunnelStub.java | 12 +- .../v1/stub/HttpJsonZoneCallableFactory.java | 2 +- .../HttpJsonZoneOperationCallableFactory.java | 2 +- .../v1/stub/HttpJsonZoneOperationStub.java | 4 +- .../compute/v1/stub/HttpJsonZoneStub.java | 4 +- .../compute/v1/stub/HttpsHealthCheckStub.java | 2 +- .../cloud/compute/v1/stub/ImageStub.java | 3 +- .../v1/stub/InstanceGroupManagerStub.java | 4 +- .../compute/v1/stub/InstanceGroupStub.java | 4 +- .../cloud/compute/v1/stub/InstanceStub.java | 3 +- .../compute/v1/stub/InstanceTemplateStub.java | 2 +- .../v1/stub/InterconnectAttachmentStub.java | 4 +- .../v1/stub/InterconnectLocationStub.java | 2 +- .../compute/v1/stub/InterconnectStub.java | 2 +- .../cloud/compute/v1/stub/LicenseStub.java | 2 +- .../compute/v1/stub/MachineTypeStub.java | 4 +- .../cloud/compute/v1/stub/NetworkStub.java | 2 +- .../compute/v1/stub/RegionAutoscalerStub.java | 2 +- .../v1/stub/RegionBackendServiceStub.java | 2 +- .../compute/v1/stub/RegionCommitmentStub.java | 4 +- .../stub/RegionInstanceGroupManagerStub.java | 2 +- .../v1/stub/RegionInstanceGroupStub.java | 2 +- .../compute/v1/stub/RegionOperationStub.java | 2 +- .../cloud/compute/v1/stub/RegionStub.java | 2 +- .../cloud/compute/v1/stub/RouteStub.java | 2 +- .../cloud/compute/v1/stub/RouterStub.java | 4 +- .../cloud/compute/v1/stub/SnapshotStub.java | 1 - .../compute/v1/stub/SslCertificateStub.java | 2 +- .../cloud/compute/v1/stub/SubnetworkStub.java | 4 +- .../compute/v1/stub/TargetHttpProxyStub.java | 2 +- .../compute/v1/stub/TargetHttpsProxyStub.java | 2 +- .../compute/v1/stub/TargetInstanceStub.java | 4 +- .../cloud/compute/v1/stub/TargetPoolStub.java | 4 +- .../compute/v1/stub/TargetSslProxyStub.java | 2 +- .../compute/v1/stub/TargetTcpProxyStub.java | 2 +- .../compute/v1/stub/TargetVpnGatewayStub.java | 4 +- .../cloud/compute/v1/stub/UrlMapStub.java | 2 +- .../cloud/compute/v1/stub/VpnTunnelStub.java | 4 +- .../compute/v1/stub/ZoneOperationStub.java | 2 +- .../cloud/compute/v1/stub/ZoneStub.java | 2 +- .../compute/v1/AcceleratorTypeClientTest.java | 10 +- .../cloud/compute/v1/AddressClientTest.java | 28 +- .../compute/v1/AutoscalerClientTest.java | 44 +-- .../compute/v1/BackendBucketClientTest.java | 32 +-- .../compute/v1/BackendServiceClientTest.java | 38 +-- .../cloud/compute/v1/DiskClientTest.java | 50 ++-- .../cloud/compute/v1/DiskTypeClientTest.java | 10 +- .../cloud/compute/v1/FirewallClientTest.java | 34 +-- .../compute/v1/ForwardingRuleClientTest.java | 40 +-- .../compute/v1/GlobalAddressClientTest.java | 12 +- .../v1/GlobalForwardingRuleClientTest.java | 20 +- .../compute/v1/GlobalOperationClientTest.java | 12 +- .../compute/v1/HealthCheckClientTest.java | 32 +-- .../compute/v1/HttpHealthCheckClientTest.java | 32 +-- .../v1/HttpsHealthCheckClientTest.java | 32 +-- .../cloud/compute/v1/ImageClientTest.java | 40 +-- .../cloud/compute/v1/InstanceClientTest.java | 196 ++++++------- .../compute/v1/InstanceGroupClientTest.java | 60 ++-- .../v1/InstanceGroupManagerClientTest.java | 84 +++--- .../v1/InstanceTemplateClientTest.java | 16 +- .../v1/InterconnectAttachmentClientTest.java | 30 +- .../compute/v1/InterconnectClientTest.java | 24 +- .../v1/InterconnectLocationClientTest.java | 4 +- .../cloud/compute/v1/LicensClientTest.java | 125 +++++++++ .../cloud/compute/v1/LicenseClientTest.java | 4 +- .../compute/v1/MachineTypeClientTest.java | 10 +- .../cloud/compute/v1/NetworkClientTest.java | 48 ++-- .../cloud/compute/v1/ProjectClientTest.java | 32 +-- .../v1/RegionAutoscalerClientTest.java | 36 +-- .../v1/RegionBackendServiceClientTest.java | 26 +- .../cloud/compute/v1/RegionClientTest.java | 4 +- .../v1/RegionCommitmentClientTest.java | 18 +- .../v1/RegionInstanceGroupClientTest.java | 16 +- .../RegionInstanceGroupManagerClientTest.java | 48 ++-- .../compute/v1/RegionOperationClientTest.java | 8 +- .../cloud/compute/v1/RouteClientTest.java | 18 +- .../cloud/compute/v1/RouterClientTest.java | 52 ++-- .../cloud/compute/v1/SnapshotClientTest.java | 20 +- .../compute/v1/SslCertificateClientTest.java | 16 +- .../compute/v1/SubnetworkClientTest.java | 52 ++-- .../compute/v1/TargetHttpProxyClientTest.java | 26 +- .../v1/TargetHttpsProxyClientTest.java | 34 +-- .../compute/v1/TargetInstanceClientTest.java | 28 +- .../compute/v1/TargetPoolClientTest.java | 70 ++--- .../compute/v1/TargetSslProxyClientTest.java | 40 +-- .../compute/v1/TargetTcpProxyClientTest.java | 32 +-- .../v1/TargetVpnGatewayClientTest.java | 28 +- .../cloud/compute/v1/UrlMapClientTest.java | 44 +-- .../cloud/compute/v1/VpnTunnelClientTest.java | 30 +- .../cloud/compute/v1/ZoneClientTest.java | 6 +- .../compute/v1/ZoneOperationClientTest.java | 8 +- .../cloud/compute/v1/it/ITComputeTest.java | 7 +- 283 files changed, 10151 insertions(+), 2373 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java index acf6e178bccf..7d9ab432884d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java @@ -52,7 +52,7 @@ *
  * 
  * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
- *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
  *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
  * }
  * 
@@ -308,7 +308,7 @@ public final UnaryCallable
    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
    *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
    * }
    * 
@@ -317,7 +317,7 @@ public final UnaryCallable * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) { - * AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); + * ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); * AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType.toString()); * } *
@@ -358,7 +358,7 @@ public final AcceleratorType getAcceleratorType(String acceleratorType) { * Sample code: *

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
    *   GetAcceleratorTypeHttpRequest request = GetAcceleratorTypeHttpRequest.newBuilder()
    *     .setAcceleratorType(acceleratorType.toString())
    *     .build();
@@ -381,7 +381,7 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeHttpRequest re
    * Sample code:
    * 

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+   *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
    *   GetAcceleratorTypeHttpRequest request = GetAcceleratorTypeHttpRequest.newBuilder()
    *     .setAcceleratorType(acceleratorType.toString())
    *     .build();
@@ -403,7 +403,7 @@ public final UnaryCallable getAc
    * Sample code:
    * 

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -414,7 +414,7 @@ public final UnaryCallable getAc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ZoneName zone) {
+  public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ProjectZoneName zone) {
     ListAcceleratorTypesHttpRequest request =
         ListAcceleratorTypesHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -429,7 +429,7 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ZoneName zon
    * Sample code:
    * 

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -455,7 +455,7 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String zone)
    * Sample code:
    * 

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -481,7 +481,7 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ListAccelera
    * Sample code:
    * 

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -505,7 +505,7 @@ public final UnaryCallable
    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java
index c461be348dfa..0652a682cd77 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (AddressClient addressClient = AddressClient.create()) {
- *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
  *   String requestId = "";
  *   Operation response = addressClient.deleteAddress(address, requestId);
  * }
@@ -309,7 +309,7 @@ public final UnaryCallable
    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   String requestId = "";
    *   Operation response = addressClient.deleteAddress(address, requestId);
    * }
@@ -324,7 +324,7 @@ public final UnaryCallable
    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   String requestId = "";
    *   Operation response = addressClient.deleteAddress(address.toString(), requestId);
    * }
@@ -373,7 +373,7 @@ public final Operation deleteAddress(String address, String requestId) {
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   String requestId = "";
    *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
@@ -398,7 +398,7 @@ public final Operation deleteAddress(DeleteAddressHttpRequest request) {
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   String requestId = "";
    *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteAddressCal
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   Address response = addressClient.getAddress(address);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteAddressCal * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Address getAddress(AddressName address) { + public final Address getAddress(ProjectRegionAddressName address) { GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final Address getAddress(AddressName address) { * Sample code: *

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   Address response = addressClient.getAddress(address.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final Address getAddress(String address) { * Sample code: *

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final Address getAddress(GetAddressHttpRequest request) {
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+   *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
    *   GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
    *     .build();
@@ -518,7 +518,7 @@ public final UnaryCallable getAddressCallable()
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   Operation response = addressClient.insertAddress(requestId, region, addressResource);
    * }
@@ -534,7 +534,7 @@ public final UnaryCallable getAddressCallable()
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertAddress(String requestId, RegionName region, Address addressResource) {
+  public final Operation insertAddress(String requestId, ProjectRegionName region, Address addressResource) {
 
     InsertAddressHttpRequest request =
         InsertAddressHttpRequest.newBuilder()
@@ -553,7 +553,7 @@ public final Operation insertAddress(String requestId, RegionName region, Addres
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   Operation response = addressClient.insertAddress(requestId, region.toString(), addressResource);
    * }
@@ -588,7 +588,7 @@ public final Operation insertAddress(String requestId, String region, Address ad
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -615,7 +615,7 @@ public final Operation insertAddress(InsertAddressHttpRequest request) {
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -640,7 +640,7 @@ public final UnaryCallable insertAddressCal
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Address element : addressClient.listAddresses(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable insertAddressCal
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListAddressesPagedResponse listAddresses(RegionName region) {
+  public final ListAddressesPagedResponse listAddresses(ProjectRegionName region) {
     ListAddressesHttpRequest request =
         ListAddressesHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -666,7 +666,7 @@ public final ListAddressesPagedResponse listAddresses(RegionName region) {
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Address element : addressClient.listAddresses(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListAddressesPagedResponse listAddresses(String region) {
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListAddressesPagedResponse listAddresses(ListAddressesHttpRequest r
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * Sample code:
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java
index 9a4b6e40e201..989942abb28a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
- *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
  *   String requestId = "";
  *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId);
  * }
@@ -309,7 +309,7 @@ public final UnaryCallable
    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   String requestId = "";
    *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId);
    * }
@@ -324,7 +324,7 @@ public final UnaryCallable
    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   String requestId = "";
    *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString(), requestId);
    * }
@@ -373,7 +373,7 @@ public final Operation deleteAutoscaler(String autoscaler, String requestId) {
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   String requestId = "";
    *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
@@ -398,7 +398,7 @@ public final Operation deleteAutoscaler(DeleteAutoscalerHttpRequest request) {
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   String requestId = "";
    *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteAutosca
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   Autoscaler response = autoscalerClient.getAutoscaler(autoscaler);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteAutosca * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Autoscaler getAutoscaler(AutoscalerName autoscaler) { + public final Autoscaler getAutoscaler(ProjectZoneAutoscalerName autoscaler) { GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final Autoscaler getAutoscaler(AutoscalerName autoscaler) { * Sample code: *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   Autoscaler response = autoscalerClient.getAutoscaler(autoscaler.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final Autoscaler getAutoscaler(String autoscaler) { * Sample code: *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final Autoscaler getAutoscaler(GetAutoscalerHttpRequest request) {
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+   *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
    *   GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
    *     .build();
@@ -517,7 +517,7 @@ public final UnaryCallable getAutoscalerCa
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = autoscalerClient.insertAutoscaler(zone, requestId, autoscalerResource);
@@ -534,7 +534,7 @@ public final UnaryCallable getAutoscalerCa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertAutoscaler(ZoneName zone, String requestId, Autoscaler autoscalerResource) {
+  public final Operation insertAutoscaler(ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) {
 
     InsertAutoscalerHttpRequest request =
         InsertAutoscalerHttpRequest.newBuilder()
@@ -552,7 +552,7 @@ public final Operation insertAutoscaler(ZoneName zone, String requestId, Autosca
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = autoscalerClient.insertAutoscaler(zone.toString(), requestId, autoscalerResource);
@@ -587,7 +587,7 @@ public final Operation insertAutoscaler(String zone, String requestId, Autoscale
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
@@ -614,7 +614,7 @@ public final Operation insertAutoscaler(InsertAutoscalerHttpRequest request) {
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
@@ -640,7 +640,7 @@ public final UnaryCallable insertAutosca
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Autoscaler element : autoscalerClient.listAutoscalers(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable insertAutosca
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListAutoscalersPagedResponse listAutoscalers(ZoneName zone) {
+  public final ListAutoscalersPagedResponse listAutoscalers(ProjectZoneName zone) {
     ListAutoscalersHttpRequest request =
         ListAutoscalersHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -666,7 +666,7 @@ public final ListAutoscalersPagedResponse listAutoscalers(ZoneName zone) {
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Autoscaler element : autoscalerClient.listAutoscalers(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListAutoscalersPagedResponse listAutoscalers(String zone) {
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListAutoscalersPagedResponse listAutoscalers(ListAutoscalersHttpReq
    * Sample code:
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -774,7 +774,7 @@ public final UnaryCallable listAutos
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource);
@@ -792,7 +792,7 @@ public final UnaryCallable listAutos
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchAutoscaler(String autoscaler, ZoneName zone, String requestId, Autoscaler autoscalerResource) {
+  public final Operation patchAutoscaler(String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) {
 
     PatchAutoscalerHttpRequest request =
         PatchAutoscalerHttpRequest.newBuilder()
@@ -812,7 +812,7 @@ public final Operation patchAutoscaler(String autoscaler, ZoneName zone, String
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), requestId, autoscalerResource);
@@ -850,7 +850,7 @@ public final Operation patchAutoscaler(String autoscaler, String zone, String re
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
@@ -879,7 +879,7 @@ public final Operation patchAutoscaler(PatchAutoscalerHttpRequest request) {
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
@@ -907,7 +907,7 @@ public final UnaryCallable patchAutoscale
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource);
@@ -925,7 +925,7 @@ public final UnaryCallable patchAutoscale
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateAutoscaler(String autoscaler, ZoneName zone, String requestId, Autoscaler autoscalerResource) {
+  public final Operation updateAutoscaler(String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) {
 
     UpdateAutoscalerHttpRequest request =
         UpdateAutoscalerHttpRequest.newBuilder()
@@ -945,7 +945,7 @@ public final Operation updateAutoscaler(String autoscaler, ZoneName zone, String
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), requestId, autoscalerResource);
@@ -983,7 +983,7 @@ public final Operation updateAutoscaler(String autoscaler, String zone, String r
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder()
@@ -1012,7 +1012,7 @@ public final Operation updateAutoscaler(UpdateAutoscalerHttpRequest request) {
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java
index a07f250661cd..b124d5b5c5ad 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
- *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+ *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
  *   String requestId = "";
  *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
  * }
@@ -176,7 +176,7 @@ public BackendBucketStub getStub() {
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
    * }
@@ -191,7 +191,7 @@ public BackendBucketStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteBackendBucket(BackendBucketName backendBucket, String requestId) {
+  public final Operation deleteBackendBucket(ProjectBackendBucketName backendBucket, String requestId) {
 
     DeleteBackendBucketHttpRequest request =
         DeleteBackendBucketHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteBackendBucket(BackendBucketName backendBucket, Stri
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteBackendBucket(String backendBucket, String requestI
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
@@ -265,7 +265,7 @@ public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest reques
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteBack
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   BackendBucket response = backendBucketClient.getBackendBucket(backendBucket);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteBack * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final BackendBucket getBackendBucket(BackendBucketName backendBucket) { + public final BackendBucket getBackendBucket(ProjectBackendBucketName backendBucket) { GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final BackendBucket getBackendBucket(BackendBucketName backendBucket) { * Sample code: *

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   BackendBucket response = backendBucketClient.getBackendBucket(backendBucket.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final BackendBucket getBackendBucket(String backendBucket) { * Sample code: *

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request)
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
    *     .build();
@@ -640,7 +640,7 @@ public final UnaryCallable lis
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.patchBackendBucket(backendBucket, requestId, backendBucketResource);
@@ -657,7 +657,7 @@ public final UnaryCallable lis
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchBackendBucket(BackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) {
+  public final Operation patchBackendBucket(ProjectBackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) {
 
     PatchBackendBucketHttpRequest request =
         PatchBackendBucketHttpRequest.newBuilder()
@@ -675,7 +675,7 @@ public final Operation patchBackendBucket(BackendBucketName backendBucket, Strin
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.patchBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
@@ -710,7 +710,7 @@ public final Operation patchBackendBucket(String backendBucket, String requestId
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
@@ -737,7 +737,7 @@ public final Operation patchBackendBucket(PatchBackendBucketHttpRequest request)
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
@@ -763,7 +763,7 @@ public final UnaryCallable patchBacken
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.updateBackendBucket(backendBucket, requestId, backendBucketResource);
@@ -780,7 +780,7 @@ public final UnaryCallable patchBacken
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateBackendBucket(BackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) {
+  public final Operation updateBackendBucket(ProjectBackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) {
 
     UpdateBackendBucketHttpRequest request =
         UpdateBackendBucketHttpRequest.newBuilder()
@@ -798,7 +798,7 @@ public final Operation updateBackendBucket(BackendBucketName backendBucket, Stri
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.updateBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
@@ -833,7 +833,7 @@ public final Operation updateBackendBucket(String backendBucket, String requestI
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
@@ -860,7 +860,7 @@ public final Operation updateBackendBucket(UpdateBackendBucketHttpRequest reques
    * Sample code:
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
index 4861dfc65cc9..7be6d3256993 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
@@ -53,7 +53,7 @@
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
  *   String requestId = "";
- *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+ *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
  *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) { * String requestId = ""; - * BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + * ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); * Operation response = backendServiceClient.deleteBackendService(requestId, backendService.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteBackendService(String requestId, String backendServ *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
@@ -399,7 +399,7 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteBac
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService response = backendServiceClient.getBackendService(backendService);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteBac * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final BackendService getBackendService(BackendServiceName backendService) { + public final BackendService getBackendService(ProjectBackendServiceName backendService) { GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final BackendService getBackendService(BackendServiceName backendService) * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService response = backendServiceClient.getBackendService(backendService.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final BackendService getBackendService(String backendService) { * Sample code: *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final BackendService getBackendService(GetBackendServiceHttpRequest reque
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
    *     .build();
@@ -517,7 +517,7 @@ public final UnaryCallable getBack
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(backendService, resourceGroupReferenceResource);
    * }
@@ -528,7 +528,7 @@ public final UnaryCallable getBack
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final BackendServiceGroupHealth getHealthBackendService(BackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource) {
+  public final BackendServiceGroupHealth getHealthBackendService(ProjectBackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource) {
 
     GetHealthBackendServiceHttpRequest request =
         GetHealthBackendServiceHttpRequest.newBuilder()
@@ -545,7 +545,7 @@ public final BackendServiceGroupHealth getHealthBackendService(BackendServiceNam
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(backendService.toString(), resourceGroupReferenceResource);
    * }
@@ -573,7 +573,7 @@ public final BackendServiceGroupHealth getHealthBackendService(String backendSer
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
@@ -598,7 +598,7 @@ public final BackendServiceGroupHealth getHealthBackendService(GetHealthBackendS
    * Sample code:
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
@@ -879,7 +879,7 @@ public final UnaryCallable l
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.patchBackendService(requestId, backendService, backendServiceResource);
    * }
@@ -895,7 +895,7 @@ public final UnaryCallable l
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchBackendService(String requestId, BackendServiceName backendService, BackendService backendServiceResource) {
+  public final Operation patchBackendService(String requestId, ProjectBackendServiceName backendService, BackendService backendServiceResource) {
 
     PatchBackendServiceHttpRequest request =
         PatchBackendServiceHttpRequest.newBuilder()
@@ -914,7 +914,7 @@ public final Operation patchBackendService(String requestId, BackendServiceName
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.patchBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
@@ -949,7 +949,7 @@ public final Operation patchBackendService(String requestId, String backendServi
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -976,7 +976,7 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1002,7 +1002,7 @@ public final UnaryCallable patchBacke
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.updateBackendService(requestId, backendService, backendServiceResource);
    * }
@@ -1018,7 +1018,7 @@ public final UnaryCallable patchBacke
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateBackendService(String requestId, BackendServiceName backendService, BackendService backendServiceResource) {
+  public final Operation updateBackendService(String requestId, ProjectBackendServiceName backendService, BackendService backendServiceResource) {
 
     UpdateBackendServiceHttpRequest request =
         UpdateBackendServiceHttpRequest.newBuilder()
@@ -1037,7 +1037,7 @@ public final Operation updateBackendService(String requestId, BackendServiceName
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.updateBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
@@ -1072,7 +1072,7 @@ public final Operation updateBackendService(String requestId, String backendServ
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1099,7 +1099,7 @@ public final Operation updateBackendService(UpdateBackendServiceHttpRequest requ
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
index c7df2218aa9d..b587d6cc7733 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (DiskClient diskClient = DiskClient.create()) {
- *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+ *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
  *   String requestId = "";
  *   Boolean guestFlush = false;
  *   Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -311,7 +311,7 @@ public final UnaryCallable a
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -330,7 +330,7 @@ public final UnaryCallable a
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation createSnapshotDisk(DiskName disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) {
+  public final Operation createSnapshotDisk(ProjectZoneDiskName disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) {
 
     CreateSnapshotDiskHttpRequest request =
         CreateSnapshotDiskHttpRequest.newBuilder()
@@ -349,7 +349,7 @@ public final Operation createSnapshotDisk(DiskName disk, String requestId, Boole
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -387,7 +387,7 @@ public final Operation createSnapshotDisk(String disk, String requestId, Boolean
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -416,7 +416,7 @@ public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request)
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -444,7 +444,7 @@ public final UnaryCallable createSnaps
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   Operation response = diskClient.deleteDisk(disk, requestId);
    * }
@@ -459,7 +459,7 @@ public final UnaryCallable createSnaps
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteDisk(DiskName disk, String requestId) {
+  public final Operation deleteDisk(ProjectZoneDiskName disk, String requestId) {
 
     DeleteDiskHttpRequest request =
         DeleteDiskHttpRequest.newBuilder()
@@ -476,7 +476,7 @@ public final Operation deleteDisk(DiskName disk, String requestId) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   Operation response = diskClient.deleteDisk(disk.toString(), requestId);
    * }
@@ -508,7 +508,7 @@ public final Operation deleteDisk(String disk, String requestId) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
@@ -533,7 +533,7 @@ public final Operation deleteDisk(DeleteDiskHttpRequest request) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
@@ -557,7 +557,7 @@ public final UnaryCallable deleteDiskCallable(
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   Disk response = diskClient.getDisk(disk);
    * }
    * 
@@ -566,7 +566,7 @@ public final UnaryCallable deleteDiskCallable( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Disk getDisk(DiskName disk) { + public final Disk getDisk(ProjectZoneDiskName disk) { GetDiskHttpRequest request = GetDiskHttpRequest.newBuilder() @@ -582,7 +582,7 @@ public final Disk getDisk(DiskName disk) { * Sample code: *

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   Disk response = diskClient.getDisk(disk.toString());
    * }
    * 
@@ -607,7 +607,7 @@ public final Disk getDisk(String disk) { * Sample code: *

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   GetDiskHttpRequest request = GetDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
    *     .build();
@@ -630,7 +630,7 @@ public final Disk getDisk(GetDiskHttpRequest request) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   GetDiskHttpRequest request = GetDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
    *     .build();
@@ -652,7 +652,7 @@ public final UnaryCallable getDiskCallable() {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
@@ -671,7 +671,7 @@ public final UnaryCallable getDiskCallable() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertDisk(ZoneName zone, String requestId, String sourceImage, Disk diskResource) {
+  public final Operation insertDisk(ProjectZoneName zone, String requestId, String sourceImage, Disk diskResource) {
 
     InsertDiskHttpRequest request =
         InsertDiskHttpRequest.newBuilder()
@@ -690,7 +690,7 @@ public final Operation insertDisk(ZoneName zone, String requestId, String source
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
@@ -728,7 +728,7 @@ public final Operation insertDisk(String zone, String requestId, String sourceIm
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
@@ -757,7 +757,7 @@ public final Operation insertDisk(InsertDiskHttpRequest request) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
@@ -785,7 +785,7 @@ public final UnaryCallable insertDiskCallable(
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Disk element : diskClient.listDisks(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -796,7 +796,7 @@ public final UnaryCallable insertDiskCallable(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListDisksPagedResponse listDisks(ZoneName zone) {
+  public final ListDisksPagedResponse listDisks(ProjectZoneName zone) {
     ListDisksHttpRequest request =
         ListDisksHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -811,7 +811,7 @@ public final ListDisksPagedResponse listDisks(ZoneName zone) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Disk element : diskClient.listDisks(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -837,7 +837,7 @@ public final ListDisksPagedResponse listDisks(String zone) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -863,7 +863,7 @@ public final ListDisksPagedResponse listDisks(ListDisksHttpRequest request) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -887,7 +887,7 @@ public final UnaryCallable listDis
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -918,7 +918,7 @@ public final UnaryCallable listDisksCallable() {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   Operation response = diskClient.resizeDisk(disk, requestId, disksResizeRequestResource);
@@ -935,7 +935,7 @@ public final UnaryCallable listDisksCallable() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation resizeDisk(DiskName disk, String requestId, DisksResizeRequest disksResizeRequestResource) {
+  public final Operation resizeDisk(ProjectZoneDiskName disk, String requestId, DisksResizeRequest disksResizeRequestResource) {
 
     ResizeDiskHttpRequest request =
         ResizeDiskHttpRequest.newBuilder()
@@ -953,7 +953,7 @@ public final Operation resizeDisk(DiskName disk, String requestId, DisksResizeRe
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   Operation response = diskClient.resizeDisk(disk.toString(), requestId, disksResizeRequestResource);
@@ -988,7 +988,7 @@ public final Operation resizeDisk(String disk, String requestId, DisksResizeRequ
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
@@ -1015,7 +1015,7 @@ public final Operation resizeDisk(ResizeDiskHttpRequest request) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
@@ -1041,7 +1041,7 @@ public final UnaryCallable resizeDiskCallable(
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   Operation response = diskClient.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource);
@@ -1058,7 +1058,7 @@ public final UnaryCallable resizeDiskCallable(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setLabelsDisk(ResourceName resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) {
+  public final Operation setLabelsDisk(ProjectZoneDiskName resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) {
 
     SetLabelsDiskHttpRequest request =
         SetLabelsDiskHttpRequest.newBuilder()
@@ -1076,7 +1076,7 @@ public final Operation setLabelsDisk(ResourceName resource, String requestId, Zo
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   Operation response = diskClient.setLabelsDisk(resource.toString(), requestId, zoneSetLabelsRequestResource);
@@ -1111,7 +1111,7 @@ public final Operation setLabelsDisk(String resource, String requestId, ZoneSetL
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
@@ -1138,7 +1138,7 @@ public final Operation setLabelsDisk(SetLabelsDiskHttpRequest request) {
    * Sample code:
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java
index da3a6b973f97..50f46a9edf2d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
- *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+ *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
  *   DiskType response = diskTypeClient.getDiskType(diskType);
  * }
  * 
@@ -308,7 +308,7 @@ public final UnaryCallable
    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
    *   DiskType response = diskTypeClient.getDiskType(diskType);
    * }
    * 
@@ -317,7 +317,7 @@ public final UnaryCallable * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) { - * DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); + * ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); * DiskType response = diskTypeClient.getDiskType(diskType.toString()); * } *
@@ -358,7 +358,7 @@ public final DiskType getDiskType(String diskType) { * Sample code: *

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
    *   GetDiskTypeHttpRequest request = GetDiskTypeHttpRequest.newBuilder()
    *     .setDiskType(diskType.toString())
    *     .build();
@@ -381,7 +381,7 @@ public final DiskType getDiskType(GetDiskTypeHttpRequest request) {
    * Sample code:
    * 

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+   *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
    *   GetDiskTypeHttpRequest request = GetDiskTypeHttpRequest.newBuilder()
    *     .setDiskType(diskType.toString())
    *     .build();
@@ -403,7 +403,7 @@ public final UnaryCallable getDiskTypeCallable
    * Sample code:
    * 

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (DiskType element : diskTypeClient.listDiskTypes(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -414,7 +414,7 @@ public final UnaryCallable getDiskTypeCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListDiskTypesPagedResponse listDiskTypes(ZoneName zone) {
+  public final ListDiskTypesPagedResponse listDiskTypes(ProjectZoneName zone) {
     ListDiskTypesHttpRequest request =
         ListDiskTypesHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -429,7 +429,7 @@ public final ListDiskTypesPagedResponse listDiskTypes(ZoneName zone) {
    * Sample code:
    * 

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (DiskType element : diskTypeClient.listDiskTypes(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -455,7 +455,7 @@ public final ListDiskTypesPagedResponse listDiskTypes(String zone) {
    * Sample code:
    * 

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -481,7 +481,7 @@ public final ListDiskTypesPagedResponse listDiskTypes(ListDiskTypesHttpRequest r
    * Sample code:
    * 

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -505,7 +505,7 @@ public final UnaryCallable
    * Sample code:
    * 

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java
index b8ffc383b1c2..6c758bd0dd23 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (FirewallClient firewallClient = FirewallClient.create()) {
- *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+ *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
  *   String requestId = "";
  *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
  * }
@@ -176,7 +176,7 @@ public FirewallStub getStub() {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
    * }
@@ -191,7 +191,7 @@ public FirewallStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteFirewall(FirewallName firewall, String requestId) {
+  public final Operation deleteFirewall(ProjectFirewallName firewall, String requestId) {
 
     DeleteFirewallHttpRequest request =
         DeleteFirewallHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteFirewall(FirewallName firewall, String requestId) {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Operation response = firewallClient.deleteFirewall(firewall.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteFirewall(String firewall, String requestId) {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
@@ -265,7 +265,7 @@ public final Operation deleteFirewall(DeleteFirewallHttpRequest request) {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteFirewallC
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   Firewall response = firewallClient.getFirewall(firewall);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteFirewallC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Firewall getFirewall(FirewallName firewall) { + public final Firewall getFirewall(ProjectFirewallName firewall) { GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final Firewall getFirewall(FirewallName firewall) { * Sample code: *

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   Firewall response = firewallClient.getFirewall(firewall.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final Firewall getFirewall(String firewall) { * Sample code: *

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final Firewall getFirewall(GetFirewallHttpRequest request) {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
    *     .build();
@@ -640,7 +640,7 @@ public final UnaryCallable listFirewalls
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.patchFirewall(firewall, requestId, firewallResource);
@@ -657,7 +657,7 @@ public final UnaryCallable listFirewalls
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchFirewall(FirewallName firewall, String requestId, Firewall firewallResource) {
+  public final Operation patchFirewall(ProjectFirewallName firewall, String requestId, Firewall firewallResource) {
 
     PatchFirewallHttpRequest request =
         PatchFirewallHttpRequest.newBuilder()
@@ -675,7 +675,7 @@ public final Operation patchFirewall(FirewallName firewall, String requestId, Fi
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.patchFirewall(firewall.toString(), requestId, firewallResource);
@@ -710,7 +710,7 @@ public final Operation patchFirewall(String firewall, String requestId, Firewall
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
@@ -737,7 +737,7 @@ public final Operation patchFirewall(PatchFirewallHttpRequest request) {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
@@ -763,7 +763,7 @@ public final UnaryCallable patchFirewallCal
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.updateFirewall(firewall, requestId, firewallResource);
@@ -780,7 +780,7 @@ public final UnaryCallable patchFirewallCal
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateFirewall(FirewallName firewall, String requestId, Firewall firewallResource) {
+  public final Operation updateFirewall(ProjectFirewallName firewall, String requestId, Firewall firewallResource) {
 
     UpdateFirewallHttpRequest request =
         UpdateFirewallHttpRequest.newBuilder()
@@ -798,7 +798,7 @@ public final Operation updateFirewall(FirewallName firewall, String requestId, F
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.updateFirewall(firewall.toString(), requestId, firewallResource);
@@ -833,7 +833,7 @@ public final Operation updateFirewall(String firewall, String requestId, Firewal
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
@@ -860,7 +860,7 @@ public final Operation updateFirewall(UpdateFirewallHttpRequest request) {
    * Sample code:
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
index 7fc079f502c8..9746594d7a1e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
@@ -53,7 +53,7 @@
  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
  *   String requestId = "";
- *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+ *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
  *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) { * String requestId = ""; - * ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + * ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); * Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteForwardingRule(String requestId, String forwardingR *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
@@ -399,7 +399,7 @@ public final Operation deleteForwardingRule(DeleteForwardingRuleHttpRequest requ
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteFor
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   ForwardingRule response = forwardingRuleClient.getForwardingRule(forwardingRule);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteFor * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ForwardingRule getForwardingRule(ForwardingRuleName forwardingRule) { + public final ForwardingRule getForwardingRule(ProjectRegionForwardingRuleName forwardingRule) { GetForwardingRuleHttpRequest request = GetForwardingRuleHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final ForwardingRule getForwardingRule(ForwardingRuleName forwardingRule) * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   ForwardingRule response = forwardingRuleClient.getForwardingRule(forwardingRule.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final ForwardingRule getForwardingRule(String forwardingRule) { * Sample code: *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   GetForwardingRuleHttpRequest request = GetForwardingRuleHttpRequest.newBuilder()
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final ForwardingRule getForwardingRule(GetForwardingRuleHttpRequest reque
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   GetForwardingRuleHttpRequest request = GetForwardingRuleHttpRequest.newBuilder()
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
@@ -518,7 +518,7 @@ public final UnaryCallable getForw
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   Operation response = forwardingRuleClient.insertForwardingRule(requestId, region, forwardingRuleResource);
    * }
@@ -534,7 +534,7 @@ public final UnaryCallable getForw
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertForwardingRule(String requestId, RegionName region, ForwardingRule forwardingRuleResource) {
+  public final Operation insertForwardingRule(String requestId, ProjectRegionName region, ForwardingRule forwardingRuleResource) {
 
     InsertForwardingRuleHttpRequest request =
         InsertForwardingRuleHttpRequest.newBuilder()
@@ -553,7 +553,7 @@ public final Operation insertForwardingRule(String requestId, RegionName region,
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   Operation response = forwardingRuleClient.insertForwardingRule(requestId, region.toString(), forwardingRuleResource);
    * }
@@ -588,7 +588,7 @@ public final Operation insertForwardingRule(String requestId, String region, For
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -615,7 +615,7 @@ public final Operation insertForwardingRule(InsertForwardingRuleHttpRequest requ
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -640,7 +640,7 @@ public final UnaryCallable insertFor
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (ForwardingRule element : forwardingRuleClient.listForwardingRules(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable insertFor
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListForwardingRulesPagedResponse listForwardingRules(RegionName region) {
+  public final ListForwardingRulesPagedResponse listForwardingRules(ProjectRegionName region) {
     ListForwardingRulesHttpRequest request =
         ListForwardingRulesHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -666,7 +666,7 @@ public final ListForwardingRulesPagedResponse listForwardingRules(RegionName reg
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (ForwardingRule element : forwardingRuleClient.listForwardingRules(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListForwardingRulesPagedResponse listForwardingRules(String region)
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListForwardingRulesPagedResponse listForwardingRules(ListForwarding
    * Sample code:
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -774,7 +774,7 @@ public final UnaryCallable l
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   Operation response = forwardingRuleClient.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource);
    * }
@@ -790,7 +790,7 @@ public final UnaryCallable l
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetForwardingRule(String requestId, ForwardingRuleName forwardingRule, TargetReference targetReferenceResource) {
+  public final Operation setTargetForwardingRule(String requestId, ProjectRegionForwardingRuleName forwardingRule, TargetReference targetReferenceResource) {
 
     SetTargetForwardingRuleHttpRequest request =
         SetTargetForwardingRuleHttpRequest.newBuilder()
@@ -809,7 +809,7 @@ public final Operation setTargetForwardingRule(String requestId, ForwardingRuleN
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   Operation response = forwardingRuleClient.setTargetForwardingRule(requestId, forwardingRule.toString(), targetReferenceResource);
    * }
@@ -844,7 +844,7 @@ public final Operation setTargetForwardingRule(String requestId, String forwardi
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -871,7 +871,7 @@ public final Operation setTargetForwardingRule(SetTargetForwardingRuleHttpReques
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+   *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java
index 4554d5aa137f..6ebbcf6e96b1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
- *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+ *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
  *   globalOperationClient.deleteGlobalOperation(operation);
  * }
  * 
@@ -308,7 +308,7 @@ public final UnaryCallable
    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   globalOperationClient.deleteGlobalOperation(operation);
    * }
    * 
@@ -317,7 +317,7 @@ public final UnaryCallable * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) { - * OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]"); + * ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]"); * globalOperationClient.deleteGlobalOperation(operation.toString()); * } *
@@ -358,7 +358,7 @@ public final void deleteGlobalOperation(String operation) { * Sample code: *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   DeleteGlobalOperationHttpRequest request = DeleteGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -381,7 +381,7 @@ public final void deleteGlobalOperation(DeleteGlobalOperationHttpRequest request
    * Sample code:
    * 

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   DeleteGlobalOperationHttpRequest request = DeleteGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -403,7 +403,7 @@ public final UnaryCallable deleteGlobalO
    * Sample code:
    * 

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   Operation response = globalOperationClient.getGlobalOperation(operation);
    * }
    * 
@@ -412,7 +412,7 @@ public final UnaryCallable deleteGlobalO * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation getGlobalOperation(OperationName operation) { + public final Operation getGlobalOperation(ProjectOperationName operation) { GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder() @@ -428,7 +428,7 @@ public final Operation getGlobalOperation(OperationName operation) { * Sample code: *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   Operation response = globalOperationClient.getGlobalOperation(operation.toString());
    * }
    * 
@@ -453,7 +453,7 @@ public final Operation getGlobalOperation(String operation) { * Sample code: *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -476,7 +476,7 @@ public final Operation getGlobalOperation(GetGlobalOperationHttpRequest request)
    * Sample code:
    * 

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
    *   GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
index a27aaa13a7b0..18d51af9f56f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
@@ -53,7 +53,7 @@
  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
  *   String requestId = "";
- *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+ *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
  *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
  * }
  * 
@@ -177,7 +177,7 @@ public HealthCheckStub getStub() {
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
    * }
    * 
@@ -191,7 +191,7 @@ public HealthCheckStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHealthCheck(String requestId, HealthCheckName healthCheck) { + public final Operation deleteHealthCheck(String requestId, ProjectHealthCheckName healthCheck) { DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder() @@ -209,7 +209,7 @@ public final Operation deleteHealthCheck(String requestId, HealthCheckName healt *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck.toString());
    * }
    * 
@@ -241,7 +241,7 @@ public final Operation deleteHealthCheck(String requestId, String healthCheck) { *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
@@ -266,7 +266,7 @@ public final Operation deleteHealthCheck(DeleteHealthCheckHttpRequest request) {
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteHealth
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck response = healthCheckClient.getHealthCheck(healthCheck);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteHealth * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HealthCheck getHealthCheck(HealthCheckName healthCheck) { + public final HealthCheck getHealthCheck(ProjectHealthCheckName healthCheck) { GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final HealthCheck getHealthCheck(HealthCheckName healthCheck) { * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck response = healthCheckClient.getHealthCheck(healthCheck.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final HealthCheck getHealthCheck(String healthCheck) { * Sample code: *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder()
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final HealthCheck getHealthCheck(GetHealthCheckHttpRequest request) {
    * Sample code:
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder()
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable listHea
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck, healthCheckResource);
    * }
@@ -657,7 +657,7 @@ public final UnaryCallable listHea
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchHealthCheck(String requestId, HealthCheckName healthCheck, HealthCheck healthCheckResource) {
+  public final Operation patchHealthCheck(String requestId, ProjectHealthCheckName healthCheck, HealthCheck healthCheckResource) {
 
     PatchHealthCheckHttpRequest request =
         PatchHealthCheckHttpRequest.newBuilder()
@@ -676,7 +676,7 @@ public final Operation patchHealthCheck(String requestId, HealthCheckName health
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
    * }
@@ -711,7 +711,7 @@ public final Operation patchHealthCheck(String requestId, String healthCheck, He
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -738,7 +738,7 @@ public final Operation patchHealthCheck(PatchHealthCheckHttpRequest request) {
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -764,7 +764,7 @@ public final UnaryCallable patchHealthCh
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck, healthCheckResource);
    * }
@@ -780,7 +780,7 @@ public final UnaryCallable patchHealthCh
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateHealthCheck(String requestId, HealthCheckName healthCheck, HealthCheck healthCheckResource) {
+  public final Operation updateHealthCheck(String requestId, ProjectHealthCheckName healthCheck, HealthCheck healthCheckResource) {
 
     UpdateHealthCheckHttpRequest request =
         UpdateHealthCheckHttpRequest.newBuilder()
@@ -799,7 +799,7 @@ public final Operation updateHealthCheck(String requestId, HealthCheckName healt
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
    * }
@@ -834,7 +834,7 @@ public final Operation updateHealthCheck(String requestId, String healthCheck, H
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -861,7 +861,7 @@ public final Operation updateHealthCheck(UpdateHealthCheckHttpRequest request) {
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
index ffac5b2078d1..2b4134ebd171 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
@@ -53,7 +53,7 @@
  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
  *   String requestId = "";
- *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+ *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
  *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
  * }
  * 
@@ -177,7 +177,7 @@ public HttpHealthCheckStub getStub() {
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
    * }
    * 
@@ -191,7 +191,7 @@ public HttpHealthCheckStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpHealthCheck(String requestId, HttpHealthCheckName httpHealthCheck) { + public final Operation deleteHttpHealthCheck(String requestId, ProjectHttpHealthCheckName httpHealthCheck) { DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder() @@ -209,7 +209,7 @@ public final Operation deleteHttpHealthCheck(String requestId, HttpHealthCheckNa *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck.toString());
    * }
    * 
@@ -241,7 +241,7 @@ public final Operation deleteHttpHealthCheck(String requestId, String httpHealth *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
@@ -266,7 +266,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteHt
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteHt * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck(HttpHealthCheckName httpHealthCheck) { + public final HttpHealthCheck getHttpHealthCheck(ProjectHttpHealthCheckName httpHealthCheck) { GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final HttpHealthCheck getHttpHealthCheck(HttpHealthCheckName httpHealthCh * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { * Sample code: *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re
    * Sample code:
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
@@ -657,7 +657,7 @@ public final UnaryCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchHttpHealthCheck(String requestId, HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) {
+  public final Operation patchHttpHealthCheck(String requestId, ProjectHttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) {
 
     PatchHttpHealthCheckHttpRequest request =
         PatchHttpHealthCheckHttpRequest.newBuilder()
@@ -676,7 +676,7 @@ public final Operation patchHttpHealthCheck(String requestId, HttpHealthCheckNam
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
    * }
@@ -711,7 +711,7 @@ public final Operation patchHttpHealthCheck(String requestId, String httpHealthC
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -738,7 +738,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -764,7 +764,7 @@ public final UnaryCallable patchHttp
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
@@ -780,7 +780,7 @@ public final UnaryCallable patchHttp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateHttpHealthCheck(String requestId, HttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) {
+  public final Operation updateHttpHealthCheck(String requestId, ProjectHttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) {
 
     UpdateHttpHealthCheckHttpRequest request =
         UpdateHttpHealthCheckHttpRequest.newBuilder()
@@ -799,7 +799,7 @@ public final Operation updateHttpHealthCheck(String requestId, HttpHealthCheckNa
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
    * }
@@ -834,7 +834,7 @@ public final Operation updateHttpHealthCheck(String requestId, String httpHealth
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -861,7 +861,7 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
index 83e6a1a95bbb..588347df41a4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
- *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+ *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
  *   String requestId = "";
  *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
  * }
@@ -176,7 +176,7 @@ public HttpsHealthCheckStub getStub() {
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
    * }
@@ -191,7 +191,7 @@ public HttpsHealthCheckStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, String requestId) {
+  public final Operation deleteHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck, String requestId) {
 
     DeleteHttpsHealthCheckHttpRequest request =
         DeleteHttpsHealthCheckHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteHttpsHealthCheck(HttpsHealthCheckName httpsHealthCh
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteHttpsHealthCheck(String httpsHealthCheck, String re
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
@@ -265,7 +265,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteH
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteH * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck) { + public final HttpsHealthCheck getHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(HttpsHealthCheckName httpsHeal * Sample code: *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { * Sample code: *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
    *     .build();
@@ -640,7 +640,7 @@ public final UnaryCallable
    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
@@ -657,7 +657,7 @@ public final UnaryCallable
    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
@@ -710,7 +710,7 @@ public final Operation patchHttpsHealthCheck(String httpsHealthCheck, String req
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
@@ -737,7 +737,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
@@ -763,7 +763,7 @@ public final UnaryCallable patchHtt
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
@@ -780,7 +780,7 @@ public final UnaryCallable patchHtt
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateHttpsHealthCheck(HttpsHealthCheckName httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) {
+  public final Operation updateHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) {
 
     UpdateHttpsHealthCheckHttpRequest request =
         UpdateHttpsHealthCheckHttpRequest.newBuilder()
@@ -798,7 +798,7 @@ public final Operation updateHttpsHealthCheck(HttpsHealthCheckName httpsHealthCh
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
@@ -833,7 +833,7 @@ public final Operation updateHttpsHealthCheck(String httpsHealthCheck, String re
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
@@ -860,7 +860,7 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest
    * Sample code:
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
index 2f45a38c4b69..bd94552fbf75 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (ImageClient imageClient = ImageClient.create()) {
- *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+ *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
  *   String requestId = "";
  *   Operation response = imageClient.deleteImage(image, requestId);
  * }
@@ -176,7 +176,7 @@ public ImageStub getStub() {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   Operation response = imageClient.deleteImage(image, requestId);
    * }
@@ -191,7 +191,7 @@ public ImageStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteImage(ImageName image, String requestId) {
+  public final Operation deleteImage(ProjectImageName image, String requestId) {
 
     DeleteImageHttpRequest request =
         DeleteImageHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteImage(ImageName image, String requestId) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   Operation response = imageClient.deleteImage(image.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteImage(String image, String requestId) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
@@ -265,7 +265,7 @@ public final Operation deleteImage(DeleteImageHttpRequest request) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
@@ -291,7 +291,7 @@ public final UnaryCallable deleteImageCallabl
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   Operation response = imageClient.deprecateImage(image, requestId, deprecationStatusResource);
@@ -308,7 +308,7 @@ public final UnaryCallable deleteImageCallabl
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deprecateImage(ImageName image, String requestId, DeprecationStatus deprecationStatusResource) {
+  public final Operation deprecateImage(ProjectImageName image, String requestId, DeprecationStatus deprecationStatusResource) {
 
     DeprecateImageHttpRequest request =
         DeprecateImageHttpRequest.newBuilder()
@@ -328,7 +328,7 @@ public final Operation deprecateImage(ImageName image, String requestId, Depreca
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   Operation response = imageClient.deprecateImage(image.toString(), requestId, deprecationStatusResource);
@@ -365,7 +365,7 @@ public final Operation deprecateImage(String image, String requestId, Deprecatio
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
@@ -394,7 +394,7 @@ public final Operation deprecateImage(DeprecateImageHttpRequest request) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
@@ -420,7 +420,7 @@ public final UnaryCallable deprecateImageC
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   Image response = imageClient.getImage(image);
    * }
    * 
@@ -429,7 +429,7 @@ public final UnaryCallable deprecateImageC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Image getImage(ImageName image) { + public final Image getImage(ProjectImageName image) { GetImageHttpRequest request = GetImageHttpRequest.newBuilder() @@ -445,7 +445,7 @@ public final Image getImage(ImageName image) { * Sample code: *

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   Image response = imageClient.getImage(image.toString());
    * }
    * 
@@ -470,7 +470,7 @@ public final Image getImage(String image) { * Sample code: *

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   GetImageHttpRequest request = GetImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
    *     .build();
@@ -493,7 +493,7 @@ public final Image getImage(GetImageHttpRequest request) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   GetImageHttpRequest request = GetImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
    *     .build();
@@ -515,7 +515,7 @@ public final UnaryCallable getImageCallable() {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
    *   Image response = imageClient.getFromFamilyImage(family);
    * }
    * 
@@ -524,7 +524,7 @@ public final UnaryCallable getImageCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Image getFromFamilyImage(FamilyName family) { + public final Image getFromFamilyImage(ProjectFamilyName family) { GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder() @@ -540,7 +540,7 @@ public final Image getFromFamilyImage(FamilyName family) { * Sample code: *

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
    *   Image response = imageClient.getFromFamilyImage(family.toString());
    * }
    * 
@@ -565,7 +565,7 @@ public final Image getFromFamilyImage(String family) { * Sample code: *

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
    *   GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder()
    *     .setFamily(family.toString())
    *     .build();
@@ -588,7 +588,7 @@ public final Image getFromFamilyImage(GetFromFamilyImageHttpRequest request) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
    *   GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder()
    *     .setFamily(family.toString())
    *     .build();
@@ -876,7 +876,7 @@ public final UnaryCallable listImagesCallable(
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = imageClient.setLabelsImage(resource, globalSetLabelsRequestResource);
    * }
@@ -904,7 +904,7 @@ public final Operation setLabelsImage(ProjectImageName resource, GlobalSetLabels
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = imageClient.setLabelsImage(resource.toString(), globalSetLabelsRequestResource);
    * }
@@ -932,7 +932,7 @@ public final Operation setLabelsImage(String resource, GlobalSetLabelsRequest gl
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsImageHttpRequest request = SetLabelsImageHttpRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -957,7 +957,7 @@ public final Operation setLabelsImage(SetLabelsImageHttpRequest request) {
    * Sample code:
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsImageHttpRequest request = SetLabelsImageHttpRequest.newBuilder()
    *     .setResource(resource.toString())
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java
index eebca093ff0e..709c7b32e18a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (InstanceClient instanceClient = InstanceClient.create()) {
- *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+ *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
  *   String networkInterface = "";
  *   String requestId = "";
  *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -178,7 +178,7 @@ public InstanceStub getStub() {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -197,7 +197,7 @@ public InstanceStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation addAccessConfigInstance(InstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) {
+  public final Operation addAccessConfigInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) {
 
     AddAccessConfigInstanceHttpRequest request =
         AddAccessConfigInstanceHttpRequest.newBuilder()
@@ -216,7 +216,7 @@ public final Operation addAccessConfigInstance(InstanceName instance, String net
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -254,7 +254,7 @@ public final Operation addAccessConfigInstance(String instance, String networkIn
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -283,7 +283,7 @@ public final Operation addAccessConfigInstance(AddAccessConfigInstanceHttpReques
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -444,7 +444,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   Operation response = instanceClient.attachDiskInstance(instance, requestId, attachedDiskResource);
@@ -461,7 +461,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   Operation response = instanceClient.attachDiskInstance(instance.toString(), requestId, attachedDiskResource);
@@ -514,7 +514,7 @@ public final Operation attachDiskInstance(String instance, String requestId, Att
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
@@ -541,7 +541,7 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request)
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
@@ -567,7 +567,7 @@ public final UnaryCallable attachDiskI
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.deleteInstance(instance, requestId);
    * }
@@ -582,7 +582,7 @@ public final UnaryCallable attachDiskI
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstance(InstanceName instance, String requestId) {
+  public final Operation deleteInstance(ProjectZoneInstanceName instance, String requestId) {
 
     DeleteInstanceHttpRequest request =
         DeleteInstanceHttpRequest.newBuilder()
@@ -599,7 +599,7 @@ public final Operation deleteInstance(InstanceName instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.deleteInstance(instance.toString(), requestId);
    * }
@@ -631,7 +631,7 @@ public final Operation deleteInstance(String instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -656,7 +656,7 @@ public final Operation deleteInstance(DeleteInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -680,7 +680,7 @@ public final UnaryCallable deleteInstanceC
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   String accessConfig = "";
@@ -699,7 +699,7 @@ public final UnaryCallable deleteInstanceC
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteAccessConfigInstance(InstanceName instance, String networkInterface, String requestId, String accessConfig) {
+  public final Operation deleteAccessConfigInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, String accessConfig) {
 
     DeleteAccessConfigInstanceHttpRequest request =
         DeleteAccessConfigInstanceHttpRequest.newBuilder()
@@ -718,7 +718,7 @@ public final Operation deleteAccessConfigInstance(InstanceName instance, String
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   String accessConfig = "";
@@ -756,7 +756,7 @@ public final Operation deleteAccessConfigInstance(String instance, String networ
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   String accessConfig = "";
@@ -785,7 +785,7 @@ public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttp
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   String accessConfig = "";
@@ -813,7 +813,7 @@ public final UnaryCallable del
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   String deviceName = "";
    *   Operation response = instanceClient.detachDiskInstance(instance, requestId, deviceName);
@@ -830,7 +830,7 @@ public final UnaryCallable del
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation detachDiskInstance(InstanceName instance, String requestId, String deviceName) {
+  public final Operation detachDiskInstance(ProjectZoneInstanceName instance, String requestId, String deviceName) {
 
     DetachDiskInstanceHttpRequest request =
         DetachDiskInstanceHttpRequest.newBuilder()
@@ -848,7 +848,7 @@ public final Operation detachDiskInstance(InstanceName instance, String requestI
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   String deviceName = "";
    *   Operation response = instanceClient.detachDiskInstance(instance.toString(), requestId, deviceName);
@@ -883,7 +883,7 @@ public final Operation detachDiskInstance(String instance, String requestId, Str
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   String deviceName = "";
    *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
@@ -910,7 +910,7 @@ public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request)
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   String deviceName = "";
    *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
@@ -936,7 +936,7 @@ public final UnaryCallable detachDiskI
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   Instance response = instanceClient.getInstance(instance);
    * }
    * 
@@ -945,7 +945,7 @@ public final UnaryCallable detachDiskI * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Instance getInstance(InstanceName instance) { + public final Instance getInstance(ProjectZoneInstanceName instance) { GetInstanceHttpRequest request = GetInstanceHttpRequest.newBuilder() @@ -961,7 +961,7 @@ public final Instance getInstance(InstanceName instance) { * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   Instance response = instanceClient.getInstance(instance.toString());
    * }
    * 
@@ -986,7 +986,7 @@ public final Instance getInstance(String instance) { * Sample code: *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   GetInstanceHttpRequest request = GetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
    *     .build();
@@ -1009,7 +1009,7 @@ public final Instance getInstance(GetInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   GetInstanceHttpRequest request = GetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
    *     .build();
@@ -1031,7 +1031,7 @@ public final UnaryCallable getInstanceCallable
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   Integer port = 0;
    *   String start = "";
    *   SerialPortOutput response = instanceClient.getSerialPortOutputInstance(instance, port, start);
@@ -1044,7 +1044,7 @@ public final UnaryCallable getInstanceCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final SerialPortOutput getSerialPortOutputInstance(InstanceName instance, Integer port, String start) {
+  public final SerialPortOutput getSerialPortOutputInstance(ProjectZoneInstanceName instance, Integer port, String start) {
 
     GetSerialPortOutputInstanceHttpRequest request =
         GetSerialPortOutputInstanceHttpRequest.newBuilder()
@@ -1062,7 +1062,7 @@ public final SerialPortOutput getSerialPortOutputInstance(InstanceName instance,
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   Integer port = 0;
    *   String start = "";
    *   SerialPortOutput response = instanceClient.getSerialPortOutputInstance(instance.toString(), port, start);
@@ -1093,7 +1093,7 @@ public final SerialPortOutput getSerialPortOutputInstance(String instance, Integ
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   Integer port = 0;
    *   String start = "";
    *   GetSerialPortOutputInstanceHttpRequest request = GetSerialPortOutputInstanceHttpRequest.newBuilder()
@@ -1120,7 +1120,7 @@ public final SerialPortOutput getSerialPortOutputInstance(GetSerialPortOutputIns
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   Integer port = 0;
    *   String start = "";
    *   GetSerialPortOutputInstanceHttpRequest request = GetSerialPortOutputInstanceHttpRequest.newBuilder()
@@ -1146,7 +1146,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   Operation response = instanceClient.insertInstance(zone, requestId, instanceResource);
@@ -1163,7 +1163,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   Operation response = instanceClient.insertInstance(zone.toString(), requestId, instanceResource);
@@ -1216,7 +1216,7 @@ public final Operation insertInstance(String zone, String requestId, Instance in
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
@@ -1243,7 +1243,7 @@ public final Operation insertInstance(InsertInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
@@ -1269,7 +1269,7 @@ public final UnaryCallable insertInstanceC
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Instance element : instanceClient.listInstances(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -1280,7 +1280,7 @@ public final UnaryCallable insertInstanceC
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstancesPagedResponse listInstances(ZoneName zone) {
+  public final ListInstancesPagedResponse listInstances(ProjectZoneName zone) {
     ListInstancesHttpRequest request =
         ListInstancesHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -1295,7 +1295,7 @@ public final ListInstancesPagedResponse listInstances(ZoneName zone) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Instance element : instanceClient.listInstances(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -1321,7 +1321,7 @@ public final ListInstancesPagedResponse listInstances(String zone) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -1347,7 +1347,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesHttpRequest r
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -1371,7 +1371,7 @@ public final UnaryCallable
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -1402,7 +1402,7 @@ public final UnaryCallable listInstances
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   for (Reference element : instanceClient.listReferrersInstances(instance).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -1413,7 +1413,7 @@ public final UnaryCallable listInstances
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListReferrersInstancesPagedResponse listReferrersInstances(InstanceName instance) {
+  public final ListReferrersInstancesPagedResponse listReferrersInstances(ProjectZoneInstanceName instance) {
     ListReferrersInstancesHttpRequest request =
         ListReferrersInstancesHttpRequest.newBuilder()
         .setInstance(instance == null ? null : instance.toString())
@@ -1428,7 +1428,7 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(Instance
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   for (Reference element : instanceClient.listReferrersInstances(instance.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -1454,7 +1454,7 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(String i
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
    *     .build();
@@ -1480,7 +1480,7 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(ListRefe
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
    *     .build();
@@ -1504,7 +1504,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
    *     .build();
@@ -1535,7 +1535,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.resetInstance(instance, requestId);
    * }
@@ -1550,7 +1550,7 @@ public final UnaryCallable
    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.resetInstance(instance.toString(), requestId);
    * }
@@ -1599,7 +1599,7 @@ public final Operation resetInstance(String instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -1624,7 +1624,7 @@ public final Operation resetInstance(ResetInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -1648,7 +1648,7 @@ public final UnaryCallable resetInstanceCal
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   Operation response = instanceClient.setDeletionProtectionInstance(resource, requestId, deletionProtection);
@@ -1683,7 +1683,7 @@ public final Operation setDeletionProtectionInstance(ProjectZoneInstanceName res
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   Operation response = instanceClient.setDeletionProtectionInstance(resource.toString(), requestId, deletionProtection);
@@ -1718,7 +1718,7 @@ public final Operation setDeletionProtectionInstance(String resource, String req
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
@@ -1745,7 +1745,7 @@ public final Operation setDeletionProtectionInstance(SetDeletionProtectionInstan
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
@@ -1771,7 +1771,7 @@ public final UnaryCallable
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
@@ -1790,7 +1790,7 @@ public final UnaryCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setDiskAutoDeleteInstance(InstanceName instance, String requestId, Boolean autoDelete, String deviceName) {
+  public final Operation setDiskAutoDeleteInstance(ProjectZoneInstanceName instance, String requestId, Boolean autoDelete, String deviceName) {
 
     SetDiskAutoDeleteInstanceHttpRequest request =
         SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
@@ -1809,7 +1809,7 @@ public final Operation setDiskAutoDeleteInstance(InstanceName instance, String r
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
@@ -1847,7 +1847,7 @@ public final Operation setDiskAutoDeleteInstance(String instance, String request
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
@@ -1876,7 +1876,7 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
@@ -1904,7 +1904,7 @@ public final UnaryCallable setD
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
    *   Operation response = instanceClient.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource);
@@ -1921,7 +1921,7 @@ public final UnaryCallable setD
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setLabelsInstance(InstanceName instance, String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) {
+  public final Operation setLabelsInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) {
 
     SetLabelsInstanceHttpRequest request =
         SetLabelsInstanceHttpRequest.newBuilder()
@@ -1939,7 +1939,7 @@ public final Operation setLabelsInstance(InstanceName instance, String requestId
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
    *   Operation response = instanceClient.setLabelsInstance(instance.toString(), requestId, instancesSetLabelsRequestResource);
@@ -1974,7 +1974,7 @@ public final Operation setLabelsInstance(String instance, String requestId, Inst
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
    *   SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder()
@@ -2001,7 +2001,7 @@ public final Operation setLabelsInstance(SetLabelsInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
    *   SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder()
@@ -2027,7 +2027,7 @@ public final UnaryCallable setLabelsIns
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
    *   Operation response = instanceClient.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource);
@@ -2044,7 +2044,7 @@ public final UnaryCallable setLabelsIns
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setMachineResourcesInstance(InstanceName instance, String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) {
+  public final Operation setMachineResourcesInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) {
 
     SetMachineResourcesInstanceHttpRequest request =
         SetMachineResourcesInstanceHttpRequest.newBuilder()
@@ -2062,7 +2062,7 @@ public final Operation setMachineResourcesInstance(InstanceName instance, String
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
    *   Operation response = instanceClient.setMachineResourcesInstance(instance.toString(), requestId, instancesSetMachineResourcesRequestResource);
@@ -2097,7 +2097,7 @@ public final Operation setMachineResourcesInstance(String instance, String reque
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
    *   SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder()
@@ -2124,7 +2124,7 @@ public final Operation setMachineResourcesInstance(SetMachineResourcesInstanceHt
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
    *   SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder()
@@ -2150,7 +2150,7 @@ public final UnaryCallable se
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
    *   Operation response = instanceClient.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource);
@@ -2167,7 +2167,7 @@ public final UnaryCallable se
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setMachineTypeInstance(InstanceName instance, String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) {
+  public final Operation setMachineTypeInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) {
 
     SetMachineTypeInstanceHttpRequest request =
         SetMachineTypeInstanceHttpRequest.newBuilder()
@@ -2185,7 +2185,7 @@ public final Operation setMachineTypeInstance(InstanceName instance, String requ
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
    *   Operation response = instanceClient.setMachineTypeInstance(instance.toString(), requestId, instancesSetMachineTypeRequestResource);
@@ -2220,7 +2220,7 @@ public final Operation setMachineTypeInstance(String instance, String requestId,
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
    *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
@@ -2247,7 +2247,7 @@ public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
    *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
@@ -2273,7 +2273,7 @@ public final UnaryCallable setMach
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   Operation response = instanceClient.setMetadataInstance(instance, requestId, metadataResource);
@@ -2290,7 +2290,7 @@ public final UnaryCallable setMach
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setMetadataInstance(InstanceName instance, String requestId, Metadata metadataResource) {
+  public final Operation setMetadataInstance(ProjectZoneInstanceName instance, String requestId, Metadata metadataResource) {
 
     SetMetadataInstanceHttpRequest request =
         SetMetadataInstanceHttpRequest.newBuilder()
@@ -2308,7 +2308,7 @@ public final Operation setMetadataInstance(InstanceName instance, String request
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   Operation response = instanceClient.setMetadataInstance(instance.toString(), requestId, metadataResource);
@@ -2343,7 +2343,7 @@ public final Operation setMetadataInstance(String instance, String requestId, Me
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
@@ -2370,7 +2370,7 @@ public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest reques
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
@@ -2396,7 +2396,7 @@ public final UnaryCallable setMetadat
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
    *   Operation response = instanceClient.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource);
@@ -2413,7 +2413,7 @@ public final UnaryCallable setMetadat
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setMinCpuPlatformInstance(InstanceName instance, String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) {
+  public final Operation setMinCpuPlatformInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) {
 
     SetMinCpuPlatformInstanceHttpRequest request =
         SetMinCpuPlatformInstanceHttpRequest.newBuilder()
@@ -2431,7 +2431,7 @@ public final Operation setMinCpuPlatformInstance(InstanceName instance, String r
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
    *   Operation response = instanceClient.setMinCpuPlatformInstance(instance.toString(), requestId, instancesSetMinCpuPlatformRequestResource);
@@ -2466,7 +2466,7 @@ public final Operation setMinCpuPlatformInstance(String instance, String request
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
    *   SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder()
@@ -2493,7 +2493,7 @@ public final Operation setMinCpuPlatformInstance(SetMinCpuPlatformInstanceHttpRe
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
    *   SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder()
@@ -2519,7 +2519,7 @@ public final UnaryCallable setM
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   Operation response = instanceClient.setSchedulingInstance(instance, requestId, schedulingResource);
@@ -2536,7 +2536,7 @@ public final UnaryCallable setM
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setSchedulingInstance(InstanceName instance, String requestId, Scheduling schedulingResource) {
+  public final Operation setSchedulingInstance(ProjectZoneInstanceName instance, String requestId, Scheduling schedulingResource) {
 
     SetSchedulingInstanceHttpRequest request =
         SetSchedulingInstanceHttpRequest.newBuilder()
@@ -2554,7 +2554,7 @@ public final Operation setSchedulingInstance(InstanceName instance, String reque
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   Operation response = instanceClient.setSchedulingInstance(instance.toString(), requestId, schedulingResource);
@@ -2589,7 +2589,7 @@ public final Operation setSchedulingInstance(String instance, String requestId,
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
@@ -2616,7 +2616,7 @@ public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest re
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
@@ -2642,7 +2642,7 @@ public final UnaryCallable setSched
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   Operation response = instanceClient.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource);
@@ -2659,7 +2659,7 @@ public final UnaryCallable setSched
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setServiceAccountInstance(InstanceName instance, String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) {
+  public final Operation setServiceAccountInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) {
 
     SetServiceAccountInstanceHttpRequest request =
         SetServiceAccountInstanceHttpRequest.newBuilder()
@@ -2677,7 +2677,7 @@ public final Operation setServiceAccountInstance(InstanceName instance, String r
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   Operation response = instanceClient.setServiceAccountInstance(instance.toString(), requestId, instancesSetServiceAccountRequestResource);
@@ -2712,7 +2712,7 @@ public final Operation setServiceAccountInstance(String instance, String request
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
@@ -2739,7 +2739,7 @@ public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRe
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
@@ -2765,7 +2765,7 @@ public final UnaryCallable setS
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   Operation response = instanceClient.setTagsInstance(instance, requestId, tagsResource);
@@ -2782,7 +2782,7 @@ public final UnaryCallable setS
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTagsInstance(InstanceName instance, String requestId, Tags tagsResource) {
+  public final Operation setTagsInstance(ProjectZoneInstanceName instance, String requestId, Tags tagsResource) {
 
     SetTagsInstanceHttpRequest request =
         SetTagsInstanceHttpRequest.newBuilder()
@@ -2800,7 +2800,7 @@ public final Operation setTagsInstance(InstanceName instance, String requestId,
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   Operation response = instanceClient.setTagsInstance(instance.toString(), requestId, tagsResource);
@@ -2835,7 +2835,7 @@ public final Operation setTagsInstance(String instance, String requestId, Tags t
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
@@ -2862,7 +2862,7 @@ public final Operation setTagsInstance(SetTagsInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
@@ -2888,7 +2888,7 @@ public final UnaryCallable setTagsInstanc
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.startInstance(instance, requestId);
    * }
@@ -2903,7 +2903,7 @@ public final UnaryCallable setTagsInstanc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation startInstance(InstanceName instance, String requestId) {
+  public final Operation startInstance(ProjectZoneInstanceName instance, String requestId) {
 
     StartInstanceHttpRequest request =
         StartInstanceHttpRequest.newBuilder()
@@ -2920,7 +2920,7 @@ public final Operation startInstance(InstanceName instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.startInstance(instance.toString(), requestId);
    * }
@@ -2952,7 +2952,7 @@ public final Operation startInstance(String instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -2977,7 +2977,7 @@ public final Operation startInstance(StartInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -3001,7 +3001,7 @@ public final UnaryCallable startInstanceCal
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource);
@@ -3018,7 +3018,7 @@ public final UnaryCallable startInstanceCal
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation startWithEncryptionKeyInstance(InstanceName instance, String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) {
+  public final Operation startWithEncryptionKeyInstance(ProjectZoneInstanceName instance, String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) {
 
     StartWithEncryptionKeyInstanceHttpRequest request =
         StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
@@ -3036,7 +3036,7 @@ public final Operation startWithEncryptionKeyInstance(InstanceName instance, Str
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance.toString(), requestId, instancesStartWithEncryptionKeyRequestResource);
@@ -3071,7 +3071,7 @@ public final Operation startWithEncryptionKeyInstance(String instance, String re
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
@@ -3098,7 +3098,7 @@ public final Operation startWithEncryptionKeyInstance(StartWithEncryptionKeyInst
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
@@ -3124,7 +3124,7 @@ public final UnaryCallable
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.stopInstance(instance, requestId);
    * }
@@ -3139,7 +3139,7 @@ public final UnaryCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation stopInstance(InstanceName instance, String requestId) {
+  public final Operation stopInstance(ProjectZoneInstanceName instance, String requestId) {
 
     StopInstanceHttpRequest request =
         StopInstanceHttpRequest.newBuilder()
@@ -3156,7 +3156,7 @@ public final Operation stopInstance(InstanceName instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   Operation response = instanceClient.stopInstance(instance.toString(), requestId);
    * }
@@ -3188,7 +3188,7 @@ public final Operation stopInstance(String instance, String requestId) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -3213,7 +3213,7 @@ public final Operation stopInstance(StopInstanceHttpRequest request) {
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String requestId = "";
    *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
@@ -3237,7 +3237,7 @@ public final UnaryCallable stopInstanceCalla
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -3256,7 +3256,7 @@ public final UnaryCallable stopInstanceCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateAccessConfigInstance(InstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) {
+  public final Operation updateAccessConfigInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) {
 
     UpdateAccessConfigInstanceHttpRequest request =
         UpdateAccessConfigInstanceHttpRequest.newBuilder()
@@ -3275,7 +3275,7 @@ public final Operation updateAccessConfigInstance(InstanceName instance, String
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -3313,7 +3313,7 @@ public final Operation updateAccessConfigInstance(String instance, String networ
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -3342,7 +3342,7 @@ public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttp
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -3370,7 +3370,7 @@ public final UnaryCallable upd
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
@@ -3389,7 +3389,7 @@ public final UnaryCallable upd
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateNetworkInterfaceInstance(InstanceName instance, String networkInterface, String requestId, NetworkInterface networkInterfaceResource) {
+  public final Operation updateNetworkInterfaceInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, NetworkInterface networkInterfaceResource) {
 
     UpdateNetworkInterfaceInstanceHttpRequest request =
         UpdateNetworkInterfaceInstanceHttpRequest.newBuilder()
@@ -3408,7 +3408,7 @@ public final Operation updateNetworkInterfaceInstance(InstanceName instance, Str
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
@@ -3446,7 +3446,7 @@ public final Operation updateNetworkInterfaceInstance(String instance, String ne
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
@@ -3475,7 +3475,7 @@ public final Operation updateNetworkInterfaceInstance(UpdateNetworkInterfaceInst
    * Sample code:
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
    *   String requestId = "";
    *   NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java
index e5024e7ecb4f..94afe5aa1f75 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java
@@ -53,7 +53,7 @@
  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
  *   String requestId = "";
- *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+ *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
  *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
  *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
  * }
@@ -178,7 +178,7 @@ public InstanceGroupStub getStub() {
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
    * }
@@ -194,7 +194,7 @@ public InstanceGroupStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation addInstancesInstanceGroup(String requestId, InstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) {
+  public final Operation addInstancesInstanceGroup(String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) {
 
     AddInstancesInstanceGroupHttpRequest request =
         AddInstancesInstanceGroupHttpRequest.newBuilder()
@@ -213,7 +213,7 @@ public final Operation addInstancesInstanceGroup(String requestId, InstanceGroup
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsAddInstancesRequestResource);
    * }
@@ -248,7 +248,7 @@ public final Operation addInstancesInstanceGroup(String requestId, String instan
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -275,7 +275,7 @@ public final Operation addInstancesInstanceGroup(AddInstancesInstanceGroupHttpRe
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -434,7 +434,7 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   Operation response = instanceGroupClient.deleteInstanceGroup(requestId, instanceGroup);
    * }
    * 
@@ -448,7 +448,7 @@ public final UnaryCallable * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) { * String requestId = ""; - * InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + * ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); * Operation response = instanceGroupClient.deleteInstanceGroup(requestId, instanceGroup.toString()); * } *
@@ -498,7 +498,7 @@ public final Operation deleteInstanceGroup(String requestId, String instanceGrou *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
@@ -523,7 +523,7 @@ public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest reques
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
@@ -546,7 +546,7 @@ public final UnaryCallable deleteInst
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroup response = instanceGroupClient.getInstanceGroup(instanceGroup);
    * }
    * 
@@ -555,7 +555,7 @@ public final UnaryCallable deleteInst * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final InstanceGroup getInstanceGroup(InstanceGroupName instanceGroup) { + public final InstanceGroup getInstanceGroup(ProjectZoneInstanceGroupName instanceGroup) { GetInstanceGroupHttpRequest request = GetInstanceGroupHttpRequest.newBuilder() @@ -571,7 +571,7 @@ public final InstanceGroup getInstanceGroup(InstanceGroupName instanceGroup) { * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroup response = instanceGroupClient.getInstanceGroup(instanceGroup.toString());
    * }
    * 
@@ -596,7 +596,7 @@ public final InstanceGroup getInstanceGroup(String instanceGroup) { * Sample code: *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   GetInstanceGroupHttpRequest request = GetInstanceGroupHttpRequest.newBuilder()
    *     .setInstanceGroup(instanceGroup.toString())
    *     .build();
@@ -619,7 +619,7 @@ public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request)
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   GetInstanceGroupHttpRequest request = GetInstanceGroupHttpRequest.newBuilder()
    *     .setInstanceGroup(instanceGroup.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable getInstan
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   Operation response = instanceGroupClient.insertInstanceGroup(zone, requestId, instanceGroupResource);
@@ -658,7 +658,7 @@ public final UnaryCallable getInstan
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertInstanceGroup(ZoneName zone, String requestId, InstanceGroup instanceGroupResource) {
+  public final Operation insertInstanceGroup(ProjectZoneName zone, String requestId, InstanceGroup instanceGroupResource) {
 
     InsertInstanceGroupHttpRequest request =
         InsertInstanceGroupHttpRequest.newBuilder()
@@ -676,7 +676,7 @@ public final Operation insertInstanceGroup(ZoneName zone, String requestId, Inst
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   Operation response = instanceGroupClient.insertInstanceGroup(zone.toString(), requestId, instanceGroupResource);
@@ -711,7 +711,7 @@ public final Operation insertInstanceGroup(String zone, String requestId, Instan
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
@@ -738,7 +738,7 @@ public final Operation insertInstanceGroup(InsertInstanceGroupHttpRequest reques
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
@@ -764,7 +764,7 @@ public final UnaryCallable insertInst
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (InstanceGroup element : instanceGroupClient.listInstanceGroups(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -775,7 +775,7 @@ public final UnaryCallable insertInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupsPagedResponse listInstanceGroups(ZoneName zone) {
+  public final ListInstanceGroupsPagedResponse listInstanceGroups(ProjectZoneName zone) {
     ListInstanceGroupsHttpRequest request =
         ListInstanceGroupsHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -790,7 +790,7 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(ZoneName zone) {
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (InstanceGroup element : instanceGroupClient.listInstanceGroups(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -816,7 +816,7 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(String zone) {
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstanceGroupsHttpRequest request = ListInstanceGroupsHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -842,7 +842,7 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(ListInstanceGrou
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstanceGroupsHttpRequest request = ListInstanceGroupsHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -866,7 +866,7 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstanceGroupsHttpRequest request = ListInstanceGroupsHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -897,7 +897,7 @@ public final UnaryCallable lis
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
    *   for (InstanceWithNamedPorts element : instanceGroupClient.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource).iterateAll()) {
    *     // doThingsWith(element);
@@ -910,7 +910,7 @@ public final UnaryCallable lis
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(InstanceGroupName instanceGroup, InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) {
+  public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) {
     ListInstancesInstanceGroupsHttpRequest request =
         ListInstancesInstanceGroupsHttpRequest.newBuilder()
         .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString())
@@ -926,7 +926,7 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
    *   for (InstanceWithNamedPorts element : instanceGroupClient.listInstancesInstanceGroups(instanceGroup.toString(), instanceGroupsListInstancesRequestResource).iterateAll()) {
    *     // doThingsWith(element);
@@ -955,7 +955,7 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
    *   ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder()
    *     .setInstanceGroup(instanceGroup.toString())
@@ -983,7 +983,7 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    * Sample code:
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
    *   ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder()
    *     .setInstanceGroup(instanceGroup.toString())
@@ -1009,7 +1009,7 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
    *   ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder()
    *     .setInstanceGroup(instanceGroup.toString())
@@ -1045,7 +1045,7 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource);
    * }
@@ -1061,7 +1061,7 @@ public final UnaryCallable
    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsRemoveInstancesRequestResource);
    * }
@@ -1119,7 +1119,7 @@ public final Operation removeInstancesInstanceGroup(String requestId, String ins
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1148,7 +1148,7 @@ public final Operation removeInstancesInstanceGroup(RemoveInstancesInstanceGroup
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1174,7 +1174,7 @@ public final UnaryCallable r
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource);
    * }
@@ -1190,7 +1190,7 @@ public final UnaryCallable r
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setNamedPortsInstanceGroup(String requestId, InstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) {
+  public final Operation setNamedPortsInstanceGroup(String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) {
 
     SetNamedPortsInstanceGroupHttpRequest request =
         SetNamedPortsInstanceGroupHttpRequest.newBuilder()
@@ -1209,7 +1209,7 @@ public final Operation setNamedPortsInstanceGroup(String requestId, InstanceGrou
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsSetNamedPortsRequestResource);
    * }
@@ -1244,7 +1244,7 @@ public final Operation setNamedPortsInstanceGroup(String requestId, String insta
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1271,7 +1271,7 @@ public final Operation setNamedPortsInstanceGroup(SetNamedPortsInstanceGroupHttp
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+   *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
index 23818fc071f4..63b62bc8234d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
@@ -53,7 +53,7 @@
  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
  *   String requestId = "";
- *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+ *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
  *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
  *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
  * }
@@ -182,7 +182,7 @@ public InstanceGroupManagerStub getStub() {
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
    * }
@@ -198,7 +198,7 @@ public InstanceGroupManagerStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) {
+  public final Operation abandonInstancesInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) {
 
     AbandonInstancesInstanceGroupManagerHttpRequest request =
         AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
@@ -221,7 +221,7 @@ public final Operation abandonInstancesInstanceGroupManager(String requestId, In
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersAbandonInstancesRequestResource);
    * }
@@ -260,7 +260,7 @@ public final Operation abandonInstancesInstanceGroupManager(String requestId, St
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -291,7 +291,7 @@ public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInst
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -450,7 +450,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(requestId, instanceGroupManager);
    * }
    * 
@@ -464,7 +464,7 @@ public final UnaryCallable * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) { * String requestId = ""; - * InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + * ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); * Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(requestId, instanceGroupManager.toString()); * } *
@@ -514,7 +514,7 @@ public final Operation deleteInstanceGroupManager(String requestId, String insta *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
@@ -539,7 +539,7 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
@@ -567,7 +567,7 @@ public final UnaryCallable del
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
    * }
@@ -583,7 +583,7 @@ public final UnaryCallable del
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) {
+  public final Operation deleteInstancesInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) {
 
     DeleteInstancesInstanceGroupManagerHttpRequest request =
         DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
@@ -606,7 +606,7 @@ public final Operation deleteInstancesInstanceGroupManager(String requestId, Ins
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersDeleteInstancesRequestResource);
    * }
@@ -645,7 +645,7 @@ public final Operation deleteInstancesInstanceGroupManager(String requestId, Str
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -676,7 +676,7 @@ public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstan
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -701,7 +701,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManager response = instanceGroupManagerClient.getInstanceGroupManager(instanceGroupManager);
    * }
    * 
@@ -710,7 +710,7 @@ public final UnaryCallable * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) { - * InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + * ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); * InstanceGroupManager response = instanceGroupManagerClient.getInstanceGroupManager(instanceGroupManager.toString()); * } *
@@ -751,7 +751,7 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa * Sample code: *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   GetInstanceGroupManagerHttpRequest request = GetInstanceGroupManagerHttpRequest.newBuilder()
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
@@ -774,7 +774,7 @@ public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManage
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   GetInstanceGroupManagerHttpRequest request = GetInstanceGroupManagerHttpRequest.newBuilder()
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
@@ -798,7 +798,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource);
@@ -815,7 +815,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone.toString(), requestId, instanceGroupManagerResource);
@@ -872,7 +872,7 @@ public final Operation insertInstanceGroupManager(String zone, String requestId,
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
@@ -901,7 +901,7 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
@@ -927,7 +927,7 @@ public final UnaryCallable ins
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (InstanceGroupManager element : instanceGroupManagerClient.listInstanceGroupManagers(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -938,7 +938,7 @@ public final UnaryCallable ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ZoneName zone) {
+  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ProjectZoneName zone) {
     ListInstanceGroupManagersHttpRequest request =
         ListInstanceGroupManagersHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -953,7 +953,7 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Zo
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (InstanceGroupManager element : instanceGroupManagerClient.listInstanceGroupManagers(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -979,7 +979,7 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(St
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstanceGroupManagersHttpRequest request = ListInstanceGroupManagersHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -1005,7 +1005,7 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Li
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstanceGroupManagersHttpRequest request = ListInstanceGroupManagersHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -1029,7 +1029,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListInstanceGroupManagersHttpRequest request = ListInstanceGroupManagersHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -1060,7 +1060,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersListManagedInstancesResponse response = instanceGroupManagerClient.listManagedInstancesInstanceGroupManagers(instanceGroupManager);
    * }
    * 
@@ -1069,7 +1069,7 @@ public final UnaryCallable * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) { - * InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + * ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); * InstanceGroupManagersListManagedInstancesResponse response = instanceGroupManagerClient.listManagedInstancesInstanceGroupManagers(instanceGroupManager.toString()); * } *
@@ -1110,7 +1110,7 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan * Sample code: *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   ListManagedInstancesInstanceGroupManagersHttpRequest request = ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
@@ -1133,7 +1133,7 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   ListManagedInstancesInstanceGroupManagersHttpRequest request = ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
@@ -1160,7 +1160,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
    * }
@@ -1176,7 +1176,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersRecreateInstancesRequestResource);
    * }
@@ -1238,7 +1238,7 @@ public final Operation recreateInstancesInstanceGroupManager(String requestId, S
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1269,7 +1269,7 @@ public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesIn
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1298,7 +1298,7 @@ public final UnaryCallable
@@ -1313,7 +1313,7 @@ public final UnaryCallable
@@ -1372,7 +1372,7 @@ public final Operation resizeInstanceGroupManager(Integer size, String requestId * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) { * Integer size = 0; * String requestId = ""; - * InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + * ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); * ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() * .setSize(size) * .setRequestId(requestId) @@ -1401,7 +1401,7 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) { * Integer size = 0; * String requestId = ""; - * InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + * ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); * ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() * .setSize(size) * .setRequestId(requestId) @@ -1426,7 +1426,7 @@ public final UnaryCallable res *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
    * }
@@ -1442,7 +1442,7 @@ public final UnaryCallable res
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateInstanceGroupManager(String requestId, InstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) {
+  public final Operation setInstanceTemplateInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) {
 
     SetInstanceTemplateInstanceGroupManagerHttpRequest request =
         SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
@@ -1461,7 +1461,7 @@ public final Operation setInstanceTemplateInstanceGroupManager(String requestId,
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersSetInstanceTemplateRequestResource);
    * }
@@ -1496,7 +1496,7 @@ public final Operation setInstanceTemplateInstanceGroupManager(String requestId,
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1523,7 +1523,7 @@ public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTempla
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1549,7 +1549,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
    * }
@@ -1565,7 +1565,7 @@ public final UnaryCallable
    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersSetTargetPoolsRequestResource);
    * }
@@ -1619,7 +1619,7 @@ public final Operation setTargetPoolsInstanceGroupManager(String requestId, Stri
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1646,7 +1646,7 @@ public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstance
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
index 3791a8bd9de1..ead882fa1359 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
- *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+ *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
  *   String requestId = "";
  *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
  * }
@@ -176,7 +176,7 @@ public InstanceTemplateStub getStub() {
    * Sample code:
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
    * }
@@ -191,7 +191,7 @@ public InstanceTemplateStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstanceTemplate(InstanceTemplateName instanceTemplate, String requestId) {
+  public final Operation deleteInstanceTemplate(ProjectInstanceTemplateName instanceTemplate, String requestId) {
 
     DeleteInstanceTemplateHttpRequest request =
         DeleteInstanceTemplateHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteInstanceTemplate(InstanceTemplateName instanceTempl
    * Sample code:
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteInstanceTemplate(String instanceTemplate, String re
    * Sample code:
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
@@ -265,7 +265,7 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
    * Sample code:
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteI
    * Sample code:
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(instanceTemplate);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteI * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceTemplate) { + public final InstanceTemplate getInstanceTemplate(ProjectInstanceTemplateName instanceTemplate) { GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final InstanceTemplate getInstanceTemplate(InstanceTemplateName instanceT * Sample code: *

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(instanceTemplate.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final InstanceTemplate getInstanceTemplate(String instanceTemplate) { * Sample code: *

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
    * Sample code:
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
index 8318875456e6..94871618b46f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
@@ -53,7 +53,7 @@
  * 
  * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
  *   String requestId = "";
- *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+ *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
  *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) { * String requestId = ""; - * InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + * ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); * Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteInterconnectAttachment(String requestId, String int *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInterconnectAttachment(interconnectAttachment.toString())
@@ -399,7 +399,7 @@ public final Operation deleteInterconnectAttachment(DeleteInterconnectAttachment
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInterconnectAttachment(interconnectAttachment.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable d
    * Sample code:
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(interconnectAttachment);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable d * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final InterconnectAttachment getInterconnectAttachment(InterconnectAttachmentName interconnectAttachment) { + public final InterconnectAttachment getInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment) { GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final InterconnectAttachment getInterconnectAttachment(InterconnectAttach * Sample code: *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(interconnectAttachment.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final InterconnectAttachment getInterconnectAttachment(String interconnec * Sample code: *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder()
    *     .setInterconnectAttachment(interconnectAttachment.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final InterconnectAttachment getInterconnectAttachment(GetInterconnectAtt
    * Sample code:
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder()
    *     .setInterconnectAttachment(interconnectAttachment.toString())
    *     .build();
@@ -518,7 +518,7 @@ public final UnaryCallable
    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
    *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource);
    * }
@@ -534,7 +534,7 @@ public final UnaryCallable
    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
    *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(requestId, region.toString(), interconnectAttachmentResource);
    * }
@@ -588,7 +588,7 @@ public final Operation insertInterconnectAttachment(String requestId, String reg
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
    *   InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -615,7 +615,7 @@ public final Operation insertInterconnectAttachment(InsertInterconnectAttachment
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
    *   InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -640,7 +640,7 @@ public final UnaryCallable i
    * Sample code:
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable i
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(RegionName region) {
+  public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(ProjectRegionName region) {
     ListInterconnectAttachmentsHttpRequest request =
         ListInterconnectAttachmentsHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -666,7 +666,7 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
    * Sample code:
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
    * Sample code:
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
    * Sample code:
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java
index 3d5c5b5f4485..06e8012bbc96 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java
@@ -53,7 +53,7 @@
  * 
  * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
  *   String requestId = "";
- *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+ *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
  *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
  * }
  * 
@@ -177,7 +177,7 @@ public InterconnectStub getStub() {
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
    * }
    * 
@@ -191,7 +191,7 @@ public InterconnectStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnect(String requestId, InterconnectName interconnect) { + public final Operation deleteInterconnect(String requestId, ProjectInterconnectName interconnect) { DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder() @@ -209,7 +209,7 @@ public final Operation deleteInterconnect(String requestId, InterconnectName int *

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect.toString());
    * }
    * 
@@ -241,7 +241,7 @@ public final Operation deleteInterconnect(String requestId, String interconnect) *

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
@@ -266,7 +266,7 @@ public final Operation deleteInterconnect(DeleteInterconnectHttpRequest request)
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteInter
    * Sample code:
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect response = interconnectClient.getInterconnect(interconnect);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteInter * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Interconnect getInterconnect(InterconnectName interconnect) { + public final Interconnect getInterconnect(ProjectInterconnectName interconnect) { GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final Interconnect getInterconnect(InterconnectName interconnect) { * Sample code: *

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect response = interconnectClient.getInterconnect(interconnect.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final Interconnect getInterconnect(String interconnect) { * Sample code: *

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder()
    *     .setInterconnect(interconnect.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final Interconnect getInterconnect(GetInterconnectHttpRequest request) {
    * Sample code:
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder()
    *     .setInterconnect(interconnect.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable listI
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect, interconnectResource);
    * }
@@ -657,7 +657,7 @@ public final UnaryCallable listI
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchInterconnect(String requestId, InterconnectName interconnect, Interconnect interconnectResource) {
+  public final Operation patchInterconnect(String requestId, ProjectInterconnectName interconnect, Interconnect interconnectResource) {
 
     PatchInterconnectHttpRequest request =
         PatchInterconnectHttpRequest.newBuilder()
@@ -676,7 +676,7 @@ public final Operation patchInterconnect(String requestId, InterconnectName inte
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect.toString(), interconnectResource);
    * }
@@ -711,7 +711,7 @@ public final Operation patchInterconnect(String requestId, String interconnect,
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -738,7 +738,7 @@ public final Operation patchInterconnect(PatchInterconnectHttpRequest request) {
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java
index 8181d074d258..953be5b551b4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
- *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+ *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
  *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
  * }
  * 
@@ -175,7 +175,7 @@ public InterconnectLocationStub getStub() {
    * Sample code:
    * 

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
    * }
    * 
@@ -184,7 +184,7 @@ public InterconnectLocationStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final InterconnectLocation getInterconnectLocation(InterconnectLocationName interconnectLocation) { + public final InterconnectLocation getInterconnectLocation(ProjectInterconnectLocationName interconnectLocation) { GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder() @@ -200,7 +200,7 @@ public final InterconnectLocation getInterconnectLocation(InterconnectLocationNa * Sample code: *

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation.toString());
    * }
    * 
@@ -225,7 +225,7 @@ public final InterconnectLocation getInterconnectLocation(String interconnectLoc * Sample code: *

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder()
    *     .setInterconnectLocation(interconnectLocation.toString())
    *     .build();
@@ -248,7 +248,7 @@ public final InterconnectLocation getInterconnectLocation(GetInterconnectLocatio
    * Sample code:
    * 

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder()
    *     .setInterconnectLocation(interconnectLocation.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
index 635e62bba859..86919dddc601 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (LicenseClient licenseClient = LicenseClient.create()) {
- *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+ *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
  *   License response = licenseClient.getLicense(license);
  * }
  * 
@@ -175,7 +175,7 @@ public LicenseStub getStub() {
    * Sample code:
    * 

    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
    *   License response = licenseClient.getLicense(license);
    * }
    * 
@@ -184,7 +184,7 @@ public LicenseStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final License getLicense(LicenseName license) { + public final License getLicense(ProjectLicenseName license) { GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder() @@ -200,7 +200,7 @@ public final License getLicense(LicenseName license) { * Sample code: *

    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
    *   License response = licenseClient.getLicense(license.toString());
    * }
    * 
@@ -225,7 +225,7 @@ public final License getLicense(String license) { * Sample code: *

    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
    *   GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder()
    *     .setLicense(license.toString())
    *     .build();
@@ -248,7 +248,7 @@ public final License getLicense(GetLicenseHttpRequest request) {
    * Sample code:
    * 

    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
    *   GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder()
    *     .setLicense(license.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java
index b3a500027885..13cd6c8012e3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
- *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+ *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
  *   MachineType response = machineTypeClient.getMachineType(machineType);
  * }
  * 
@@ -308,7 +308,7 @@ public final UnaryCallable
    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
    *   MachineType response = machineTypeClient.getMachineType(machineType);
    * }
    * 
@@ -317,7 +317,7 @@ public final UnaryCallable * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) { - * MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + * ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); * MachineType response = machineTypeClient.getMachineType(machineType.toString()); * } *
@@ -358,7 +358,7 @@ public final MachineType getMachineType(String machineType) { * Sample code: *

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
    *   GetMachineTypeHttpRequest request = GetMachineTypeHttpRequest.newBuilder()
    *     .setMachineType(machineType.toString())
    *     .build();
@@ -381,7 +381,7 @@ public final MachineType getMachineType(GetMachineTypeHttpRequest request) {
    * Sample code:
    * 

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+   *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
    *   GetMachineTypeHttpRequest request = GetMachineTypeHttpRequest.newBuilder()
    *     .setMachineType(machineType.toString())
    *     .build();
@@ -403,7 +403,7 @@ public final UnaryCallable getMachineTyp
    * Sample code:
    * 

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (MachineType element : machineTypeClient.listMachineTypes(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -414,7 +414,7 @@ public final UnaryCallable getMachineTyp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListMachineTypesPagedResponse listMachineTypes(ZoneName zone) {
+  public final ListMachineTypesPagedResponse listMachineTypes(ProjectZoneName zone) {
     ListMachineTypesHttpRequest request =
         ListMachineTypesHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -429,7 +429,7 @@ public final ListMachineTypesPagedResponse listMachineTypes(ZoneName zone) {
    * Sample code:
    * 

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (MachineType element : machineTypeClient.listMachineTypes(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -455,7 +455,7 @@ public final ListMachineTypesPagedResponse listMachineTypes(String zone) {
    * Sample code:
    * 

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListMachineTypesHttpRequest request = ListMachineTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -481,7 +481,7 @@ public final ListMachineTypesPagedResponse listMachineTypes(ListMachineTypesHttp
    * Sample code:
    * 

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListMachineTypesHttpRequest request = ListMachineTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -505,7 +505,7 @@ public final UnaryCallable
    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListMachineTypesHttpRequest request = ListMachineTypesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java
index 37dd5924f34b..430f2065ec00 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java
@@ -53,7 +53,7 @@
  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
  *   String requestId = "";
- *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+ *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
  *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
  *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
  * }
@@ -178,7 +178,7 @@ public NetworkStub getStub() {
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
    * }
@@ -194,7 +194,7 @@ public NetworkStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation addPeeringNetwork(String requestId, NetworkName network, NetworksAddPeeringRequest networksAddPeeringRequestResource) {
+  public final Operation addPeeringNetwork(String requestId, ProjectNetworkName network, NetworksAddPeeringRequest networksAddPeeringRequestResource) {
 
     AddPeeringNetworkHttpRequest request =
         AddPeeringNetworkHttpRequest.newBuilder()
@@ -213,7 +213,7 @@ public final Operation addPeeringNetwork(String requestId, NetworkName network,
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   Operation response = networkClient.addPeeringNetwork(requestId, network.toString(), networksAddPeeringRequestResource);
    * }
@@ -248,7 +248,7 @@ public final Operation addPeeringNetwork(String requestId, String network, Netwo
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -275,7 +275,7 @@ public final Operation addPeeringNetwork(AddPeeringNetworkHttpRequest request) {
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -301,7 +301,7 @@ public final UnaryCallable addPeeringNe
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.deleteNetwork(requestId, network);
    * }
    * 
@@ -315,7 +315,7 @@ public final UnaryCallable addPeeringNe * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteNetwork(String requestId, NetworkName network) { + public final Operation deleteNetwork(String requestId, ProjectNetworkName network) { DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder() @@ -333,7 +333,7 @@ public final Operation deleteNetwork(String requestId, NetworkName network) { *

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.deleteNetwork(requestId, network.toString());
    * }
    * 
@@ -365,7 +365,7 @@ public final Operation deleteNetwork(String requestId, String network) { *

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -390,7 +390,7 @@ public final Operation deleteNetwork(DeleteNetworkHttpRequest request) {
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -413,7 +413,7 @@ public final UnaryCallable deleteNetworkCal
    * Sample code:
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network response = networkClient.getNetwork(network);
    * }
    * 
@@ -422,7 +422,7 @@ public final UnaryCallable deleteNetworkCal * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Network getNetwork(NetworkName network) { + public final Network getNetwork(ProjectNetworkName network) { GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Network getNetwork(NetworkName network) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network response = networkClient.getNetwork(network.toString());
    * }
    * 
@@ -463,7 +463,7 @@ public final Network getNetwork(String network) { * Sample code: *

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder()
    *     .setNetwork(network.toString())
    *     .build();
@@ -486,7 +486,7 @@ public final Network getNetwork(GetNetworkHttpRequest request) {
    * Sample code:
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder()
    *     .setNetwork(network.toString())
    *     .build();
@@ -765,7 +765,7 @@ public final UnaryCallable listNetworksCal
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   Operation response = networkClient.patchNetwork(requestId, network, networkResource);
    * }
@@ -781,7 +781,7 @@ public final UnaryCallable listNetworksCal
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchNetwork(String requestId, NetworkName network, Network networkResource) {
+  public final Operation patchNetwork(String requestId, ProjectNetworkName network, Network networkResource) {
 
     PatchNetworkHttpRequest request =
         PatchNetworkHttpRequest.newBuilder()
@@ -800,7 +800,7 @@ public final Operation patchNetwork(String requestId, NetworkName network, Netwo
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   Operation response = networkClient.patchNetwork(requestId, network.toString(), networkResource);
    * }
@@ -835,7 +835,7 @@ public final Operation patchNetwork(String requestId, String network, Network ne
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -862,7 +862,7 @@ public final Operation patchNetwork(PatchNetworkHttpRequest request) {
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -888,7 +888,7 @@ public final UnaryCallable patchNetworkCalla
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   Operation response = networkClient.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource);
    * }
@@ -904,7 +904,7 @@ public final UnaryCallable patchNetworkCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation removePeeringNetwork(String requestId, NetworkName network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) {
+  public final Operation removePeeringNetwork(String requestId, ProjectNetworkName network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) {
 
     RemovePeeringNetworkHttpRequest request =
         RemovePeeringNetworkHttpRequest.newBuilder()
@@ -923,7 +923,7 @@ public final Operation removePeeringNetwork(String requestId, NetworkName networ
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   Operation response = networkClient.removePeeringNetwork(requestId, network.toString(), networksRemovePeeringRequestResource);
    * }
@@ -958,7 +958,7 @@ public final Operation removePeeringNetwork(String requestId, String network, Ne
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -985,7 +985,7 @@ public final Operation removePeeringNetwork(RemovePeeringNetworkHttpRequest requ
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1011,7 +1011,7 @@ public final UnaryCallable removePee
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network);
    * }
    * 
@@ -1025,7 +1025,7 @@ public final UnaryCallable removePee * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation switchToCustomModeNetwork(String requestId, NetworkName network) { + public final Operation switchToCustomModeNetwork(String requestId, ProjectNetworkName network) { SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder() @@ -1043,7 +1043,7 @@ public final Operation switchToCustomModeNetwork(String requestId, NetworkName n *

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network.toString());
    * }
    * 
@@ -1075,7 +1075,7 @@ public final Operation switchToCustomModeNetwork(String requestId, String networ *

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -1100,7 +1100,7 @@ public final Operation switchToCustomModeNetwork(SwitchToCustomModeNetworkHttpRe
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java
new file mode 100644
index 000000000000..049faf4cc280
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectBackendBucketName implements com.google.api.resourcenames.ResourceName {
+  private final String backendBucket;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/backendBuckets/{backendBucket}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectBackendBucketName(Builder builder) {
+    backendBucket = Preconditions.checkNotNull(builder.getBackendBucket());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectBackendBucketName of(
+      String backendBucket,
+      String project
+      ) {
+    return newBuilder()
+    .setBackendBucket(backendBucket)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String backendBucket,
+      String project
+      ) {
+    return of(
+        backendBucket,
+        project
+        )
+        .toString();
+  }
+
+  public String getBackendBucket() {
+    return backendBucket;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("backendBucket", backendBucket);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectBackendBucketName parse(String formattedString) {return ProjectBackendBucketName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectBackendBucketName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectBackendBucketName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("backendBucket"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String backendBucket;
+    private String project;
+
+    public String getBackendBucket() {
+      return backendBucket;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setBackendBucket(String backendBucket) {
+      this.backendBucket = backendBucket;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectBackendBucketName projectBackendBucketName) {
+      backendBucket = projectBackendBucketName.backendBucket;
+      project = projectBackendBucketName.project;
+    }
+
+    public ProjectBackendBucketName build() {
+      return new ProjectBackendBucketName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "backendBucket", backendBucket,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectBackendBucketName) {
+      ProjectBackendBucketName that = (ProjectBackendBucketName) o;
+      return
+          Objects.equals(this.backendBucket, that.getBackendBucket()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      backendBucket,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java
new file mode 100644
index 000000000000..f35735edd8e5
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectBackendServiceName implements com.google.api.resourcenames.ResourceName {
+  private final String backendService;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/backendServices/{backendService}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectBackendServiceName(Builder builder) {
+    backendService = Preconditions.checkNotNull(builder.getBackendService());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectBackendServiceName of(
+      String backendService,
+      String project
+      ) {
+    return newBuilder()
+    .setBackendService(backendService)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String backendService,
+      String project
+      ) {
+    return of(
+        backendService,
+        project
+        )
+        .toString();
+  }
+
+  public String getBackendService() {
+    return backendService;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("backendService", backendService);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectBackendServiceName parse(String formattedString) {return ProjectBackendServiceName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectBackendServiceName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectBackendServiceName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("backendService"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String backendService;
+    private String project;
+
+    public String getBackendService() {
+      return backendService;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setBackendService(String backendService) {
+      this.backendService = backendService;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectBackendServiceName projectBackendServiceName) {
+      backendService = projectBackendServiceName.backendService;
+      project = projectBackendServiceName.project;
+    }
+
+    public ProjectBackendServiceName build() {
+      return new ProjectBackendServiceName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "backendService", backendService,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectBackendServiceName) {
+      ProjectBackendServiceName that = (ProjectBackendServiceName) o;
+      return
+          Objects.equals(this.backendService, that.getBackendService()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      backendService,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java
new file mode 100644
index 000000000000..5d1af59abf60
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectFamilyName implements com.google.api.resourcenames.ResourceName {
+  private final String family;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/family/{family}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectFamilyName(Builder builder) {
+    family = Preconditions.checkNotNull(builder.getFamily());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectFamilyName of(
+      String family,
+      String project
+      ) {
+    return newBuilder()
+    .setFamily(family)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String family,
+      String project
+      ) {
+    return of(
+        family,
+        project
+        )
+        .toString();
+  }
+
+  public String getFamily() {
+    return family;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("family", family);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectFamilyName parse(String formattedString) {return ProjectFamilyName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectFamilyName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectFamilyName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("family"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String family;
+    private String project;
+
+    public String getFamily() {
+      return family;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setFamily(String family) {
+      this.family = family;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectFamilyName projectFamilyName) {
+      family = projectFamilyName.family;
+      project = projectFamilyName.project;
+    }
+
+    public ProjectFamilyName build() {
+      return new ProjectFamilyName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "family", family,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectFamilyName) {
+      ProjectFamilyName that = (ProjectFamilyName) o;
+      return
+          Objects.equals(this.family, that.getFamily()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      family,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java
new file mode 100644
index 000000000000..edaadf7be272
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectFirewallName implements com.google.api.resourcenames.ResourceName {
+  private final String firewall;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/firewalls/{firewall}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectFirewallName(Builder builder) {
+    firewall = Preconditions.checkNotNull(builder.getFirewall());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectFirewallName of(
+      String firewall,
+      String project
+      ) {
+    return newBuilder()
+    .setFirewall(firewall)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String firewall,
+      String project
+      ) {
+    return of(
+        firewall,
+        project
+        )
+        .toString();
+  }
+
+  public String getFirewall() {
+    return firewall;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("firewall", firewall);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectFirewallName parse(String formattedString) {return ProjectFirewallName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectFirewallName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectFirewallName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("firewall"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String firewall;
+    private String project;
+
+    public String getFirewall() {
+      return firewall;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setFirewall(String firewall) {
+      this.firewall = firewall;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectFirewallName projectFirewallName) {
+      firewall = projectFirewallName.firewall;
+      project = projectFirewallName.project;
+    }
+
+    public ProjectFirewallName build() {
+      return new ProjectFirewallName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "firewall", firewall,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectFirewallName) {
+      ProjectFirewallName that = (ProjectFirewallName) o;
+      return
+          Objects.equals(this.firewall, that.getFirewall()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      firewall,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java
new file mode 100644
index 000000000000..eb0c727d3a58
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectHealthCheckName implements com.google.api.resourcenames.ResourceName {
+  private final String healthCheck;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/healthChecks/{healthCheck}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectHealthCheckName(Builder builder) {
+    healthCheck = Preconditions.checkNotNull(builder.getHealthCheck());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectHealthCheckName of(
+      String healthCheck,
+      String project
+      ) {
+    return newBuilder()
+    .setHealthCheck(healthCheck)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String healthCheck,
+      String project
+      ) {
+    return of(
+        healthCheck,
+        project
+        )
+        .toString();
+  }
+
+  public String getHealthCheck() {
+    return healthCheck;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("healthCheck", healthCheck);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectHealthCheckName parse(String formattedString) {return ProjectHealthCheckName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectHealthCheckName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectHealthCheckName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("healthCheck"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String healthCheck;
+    private String project;
+
+    public String getHealthCheck() {
+      return healthCheck;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setHealthCheck(String healthCheck) {
+      this.healthCheck = healthCheck;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectHealthCheckName projectHealthCheckName) {
+      healthCheck = projectHealthCheckName.healthCheck;
+      project = projectHealthCheckName.project;
+    }
+
+    public ProjectHealthCheckName build() {
+      return new ProjectHealthCheckName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "healthCheck", healthCheck,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectHealthCheckName) {
+      ProjectHealthCheckName that = (ProjectHealthCheckName) o;
+      return
+          Objects.equals(this.healthCheck, that.getHealthCheck()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      healthCheck,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java
new file mode 100644
index 000000000000..b198348dea02
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectHttpHealthCheckName implements com.google.api.resourcenames.ResourceName {
+  private final String httpHealthCheck;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/httpHealthChecks/{httpHealthCheck}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectHttpHealthCheckName(Builder builder) {
+    httpHealthCheck = Preconditions.checkNotNull(builder.getHttpHealthCheck());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectHttpHealthCheckName of(
+      String httpHealthCheck,
+      String project
+      ) {
+    return newBuilder()
+    .setHttpHealthCheck(httpHealthCheck)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String httpHealthCheck,
+      String project
+      ) {
+    return of(
+        httpHealthCheck,
+        project
+        )
+        .toString();
+  }
+
+  public String getHttpHealthCheck() {
+    return httpHealthCheck;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("httpHealthCheck", httpHealthCheck);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectHttpHealthCheckName parse(String formattedString) {return ProjectHttpHealthCheckName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectHttpHealthCheckName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectHttpHealthCheckName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("httpHealthCheck"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String httpHealthCheck;
+    private String project;
+
+    public String getHttpHealthCheck() {
+      return httpHealthCheck;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setHttpHealthCheck(String httpHealthCheck) {
+      this.httpHealthCheck = httpHealthCheck;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectHttpHealthCheckName projectHttpHealthCheckName) {
+      httpHealthCheck = projectHttpHealthCheckName.httpHealthCheck;
+      project = projectHttpHealthCheckName.project;
+    }
+
+    public ProjectHttpHealthCheckName build() {
+      return new ProjectHttpHealthCheckName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "httpHealthCheck", httpHealthCheck,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectHttpHealthCheckName) {
+      ProjectHttpHealthCheckName that = (ProjectHttpHealthCheckName) o;
+      return
+          Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      httpHealthCheck,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java
new file mode 100644
index 000000000000..50f4a96cbeca
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectHttpsHealthCheckName implements com.google.api.resourcenames.ResourceName {
+  private final String httpsHealthCheck;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/httpsHealthChecks/{httpsHealthCheck}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectHttpsHealthCheckName(Builder builder) {
+    httpsHealthCheck = Preconditions.checkNotNull(builder.getHttpsHealthCheck());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectHttpsHealthCheckName of(
+      String httpsHealthCheck,
+      String project
+      ) {
+    return newBuilder()
+    .setHttpsHealthCheck(httpsHealthCheck)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String httpsHealthCheck,
+      String project
+      ) {
+    return of(
+        httpsHealthCheck,
+        project
+        )
+        .toString();
+  }
+
+  public String getHttpsHealthCheck() {
+    return httpsHealthCheck;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("httpsHealthCheck", httpsHealthCheck);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectHttpsHealthCheckName parse(String formattedString) {return ProjectHttpsHealthCheckName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectHttpsHealthCheckName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectHttpsHealthCheckName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("httpsHealthCheck"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String httpsHealthCheck;
+    private String project;
+
+    public String getHttpsHealthCheck() {
+      return httpsHealthCheck;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setHttpsHealthCheck(String httpsHealthCheck) {
+      this.httpsHealthCheck = httpsHealthCheck;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectHttpsHealthCheckName projectHttpsHealthCheckName) {
+      httpsHealthCheck = projectHttpsHealthCheckName.httpsHealthCheck;
+      project = projectHttpsHealthCheckName.project;
+    }
+
+    public ProjectHttpsHealthCheckName build() {
+      return new ProjectHttpsHealthCheckName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "httpsHealthCheck", httpsHealthCheck,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectHttpsHealthCheckName) {
+      ProjectHttpsHealthCheckName that = (ProjectHttpsHealthCheckName) o;
+      return
+          Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      httpsHealthCheck,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java
index e97db6a82f8b..ad69b7736f21 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java
@@ -35,7 +35,7 @@ public final class ProjectImageName implements com.google.api.resourcenames.Reso
   private final String project;
   private final String resource;
   private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/images/{resource}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/images/{image}");
 
   private volatile Map fieldValuesMap;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java
new file mode 100644
index 000000000000..0cb5a187ea39
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectInstanceTemplateName implements com.google.api.resourcenames.ResourceName {
+  private final String instanceTemplate;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/instanceTemplates/{instanceTemplate}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectInstanceTemplateName(Builder builder) {
+    instanceTemplate = Preconditions.checkNotNull(builder.getInstanceTemplate());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectInstanceTemplateName of(
+      String instanceTemplate,
+      String project
+      ) {
+    return newBuilder()
+    .setInstanceTemplate(instanceTemplate)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String instanceTemplate,
+      String project
+      ) {
+    return of(
+        instanceTemplate,
+        project
+        )
+        .toString();
+  }
+
+  public String getInstanceTemplate() {
+    return instanceTemplate;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("instanceTemplate", instanceTemplate);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectInstanceTemplateName parse(String formattedString) {return ProjectInstanceTemplateName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectInstanceTemplateName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectInstanceTemplateName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("instanceTemplate"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String instanceTemplate;
+    private String project;
+
+    public String getInstanceTemplate() {
+      return instanceTemplate;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setInstanceTemplate(String instanceTemplate) {
+      this.instanceTemplate = instanceTemplate;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectInstanceTemplateName projectInstanceTemplateName) {
+      instanceTemplate = projectInstanceTemplateName.instanceTemplate;
+      project = projectInstanceTemplateName.project;
+    }
+
+    public ProjectInstanceTemplateName build() {
+      return new ProjectInstanceTemplateName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "instanceTemplate", instanceTemplate,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectInstanceTemplateName) {
+      ProjectInstanceTemplateName that = (ProjectInstanceTemplateName) o;
+      return
+          Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      instanceTemplate,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java
new file mode 100644
index 000000000000..032c76151860
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectInterconnectLocationName implements com.google.api.resourcenames.ResourceName {
+  private final String interconnectLocation;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnectLocations/{interconnectLocation}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectInterconnectLocationName(Builder builder) {
+    interconnectLocation = Preconditions.checkNotNull(builder.getInterconnectLocation());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectInterconnectLocationName of(
+      String interconnectLocation,
+      String project
+      ) {
+    return newBuilder()
+    .setInterconnectLocation(interconnectLocation)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String interconnectLocation,
+      String project
+      ) {
+    return of(
+        interconnectLocation,
+        project
+        )
+        .toString();
+  }
+
+  public String getInterconnectLocation() {
+    return interconnectLocation;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("interconnectLocation", interconnectLocation);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectInterconnectLocationName parse(String formattedString) {return ProjectInterconnectLocationName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectInterconnectLocationName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectInterconnectLocationName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("interconnectLocation"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String interconnectLocation;
+    private String project;
+
+    public String getInterconnectLocation() {
+      return interconnectLocation;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setInterconnectLocation(String interconnectLocation) {
+      this.interconnectLocation = interconnectLocation;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectInterconnectLocationName projectInterconnectLocationName) {
+      interconnectLocation = projectInterconnectLocationName.interconnectLocation;
+      project = projectInterconnectLocationName.project;
+    }
+
+    public ProjectInterconnectLocationName build() {
+      return new ProjectInterconnectLocationName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "interconnectLocation", interconnectLocation,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectInterconnectLocationName) {
+      ProjectInterconnectLocationName that = (ProjectInterconnectLocationName) o;
+      return
+          Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      interconnectLocation,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java
new file mode 100644
index 000000000000..8a164d30a23e
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectInterconnectName implements com.google.api.resourcenames.ResourceName {
+  private final String interconnect;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnects/{interconnect}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectInterconnectName(Builder builder) {
+    interconnect = Preconditions.checkNotNull(builder.getInterconnect());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectInterconnectName of(
+      String interconnect,
+      String project
+      ) {
+    return newBuilder()
+    .setInterconnect(interconnect)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String interconnect,
+      String project
+      ) {
+    return of(
+        interconnect,
+        project
+        )
+        .toString();
+  }
+
+  public String getInterconnect() {
+    return interconnect;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("interconnect", interconnect);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectInterconnectName parse(String formattedString) {return ProjectInterconnectName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectInterconnectName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectInterconnectName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("interconnect"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String interconnect;
+    private String project;
+
+    public String getInterconnect() {
+      return interconnect;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setInterconnect(String interconnect) {
+      this.interconnect = interconnect;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectInterconnectName projectInterconnectName) {
+      interconnect = projectInterconnectName.interconnect;
+      project = projectInterconnectName.project;
+    }
+
+    public ProjectInterconnectName build() {
+      return new ProjectInterconnectName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "interconnect", interconnect,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectInterconnectName) {
+      ProjectInterconnectName that = (ProjectInterconnectName) o;
+      return
+          Objects.equals(this.interconnect, that.getInterconnect()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      interconnect,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java
new file mode 100644
index 000000000000..448b97d14906
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectLicenseName implements com.google.api.resourcenames.ResourceName {
+  private final String license;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/licenses/{license}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectLicenseName(Builder builder) {
+    license = Preconditions.checkNotNull(builder.getLicense());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectLicenseName of(
+      String license,
+      String project
+      ) {
+    return newBuilder()
+    .setLicense(license)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String license,
+      String project
+      ) {
+    return of(
+        license,
+        project
+        )
+        .toString();
+  }
+
+  public String getLicense() {
+    return license;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("license", license);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectLicenseName parse(String formattedString) {return ProjectLicenseName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectLicenseName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectLicenseName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("license"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String license;
+    private String project;
+
+    public String getLicense() {
+      return license;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setLicense(String license) {
+      this.license = license;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectLicenseName projectLicenseName) {
+      license = projectLicenseName.license;
+      project = projectLicenseName.project;
+    }
+
+    public ProjectLicenseName build() {
+      return new ProjectLicenseName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "license", license,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectLicenseName) {
+      ProjectLicenseName that = (ProjectLicenseName) o;
+      return
+          Objects.equals(this.license, that.getLicense()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      license,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java
new file mode 100644
index 000000000000..1ab3521f9c0b
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectNetworkName implements com.google.api.resourcenames.ResourceName {
+  private final String network;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectNetworkName(Builder builder) {
+    network = Preconditions.checkNotNull(builder.getNetwork());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectNetworkName of(
+      String network,
+      String project
+      ) {
+    return newBuilder()
+    .setNetwork(network)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String network,
+      String project
+      ) {
+    return of(
+        network,
+        project
+        )
+        .toString();
+  }
+
+  public String getNetwork() {
+    return network;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("network", network);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectNetworkName parse(String formattedString) {return ProjectNetworkName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectNetworkName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectNetworkName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("network"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String network;
+    private String project;
+
+    public String getNetwork() {
+      return network;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setNetwork(String network) {
+      this.network = network;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectNetworkName projectNetworkName) {
+      network = projectNetworkName.network;
+      project = projectNetworkName.project;
+    }
+
+    public ProjectNetworkName build() {
+      return new ProjectNetworkName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "network", network,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectNetworkName) {
+      ProjectNetworkName that = (ProjectNetworkName) o;
+      return
+          Objects.equals(this.network, that.getNetwork()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      network,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java
new file mode 100644
index 000000000000..9721821c6771
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectOperationName implements com.google.api.resourcenames.ResourceName {
+  private final String operation;
+  private final String project;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/operations/{operation}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectOperationName(Builder builder) {
+    operation = Preconditions.checkNotNull(builder.getOperation());
+    project = Preconditions.checkNotNull(builder.getProject());
+  }
+
+  public static ProjectOperationName of(
+      String operation,
+      String project
+      ) {
+    return newBuilder()
+    .setOperation(operation)
+    .setProject(project)
+      .build();
+  }
+
+  public static String format(
+      String operation,
+      String project
+      ) {
+    return of(
+        operation,
+        project
+        )
+        .toString();
+  }
+
+  public String getOperation() {
+    return operation;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("operation", operation);
+          fieldMapBuilder.put("project", project);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectOperationName parse(String formattedString) {return ProjectOperationName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectOperationName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectOperationName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("operation"),
+      matchMap.get("project")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String operation;
+    private String project;
+
+    public String getOperation() {
+      return operation;
+    }
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setOperation(String operation) {
+      this.operation = operation;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectOperationName projectOperationName) {
+      operation = projectOperationName.operation;
+      project = projectOperationName.project;
+    }
+
+    public ProjectOperationName build() {
+      return new ProjectOperationName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "operation", operation,
+        "project", project
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectOperationName) {
+      ProjectOperationName that = (ProjectOperationName) o;
+      return
+          Objects.equals(this.operation, that.getOperation()) &&
+          Objects.equals(this.project, that.getProject())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      operation,
+      project
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java
new file mode 100644
index 000000000000..0edc2c85315c
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionAddressName implements com.google.api.resourcenames.ResourceName {
+  private final String address;
+  private final String project;
+  private final String region;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/addresses/{address}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionAddressName(Builder builder) {
+    address = Preconditions.checkNotNull(builder.getAddress());
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+  }
+
+  public static ProjectRegionAddressName of(
+      String address,
+      String project,
+      String region
+      ) {
+    return newBuilder()
+    .setAddress(address)
+    .setProject(project)
+    .setRegion(region)
+      .build();
+  }
+
+  public static String format(
+      String address,
+      String project,
+      String region
+      ) {
+    return of(
+        address,
+        project,
+        region
+        )
+        .toString();
+  }
+
+  public String getAddress() {
+    return address;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("address", address);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionAddressName parse(String formattedString) {return ProjectRegionAddressName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionAddressName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionAddressName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("address"),
+      matchMap.get("project"),
+      matchMap.get("region")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String address;
+    private String project;
+    private String region;
+
+    public String getAddress() {
+      return address;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setAddress(String address) {
+      this.address = address;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionAddressName projectRegionAddressName) {
+      address = projectRegionAddressName.address;
+      project = projectRegionAddressName.project;
+      region = projectRegionAddressName.region;
+    }
+
+    public ProjectRegionAddressName build() {
+      return new ProjectRegionAddressName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "address", address,
+        "project", project,
+        "region", region
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionAddressName) {
+      ProjectRegionAddressName that = (ProjectRegionAddressName) o;
+      return
+          Objects.equals(this.address, that.getAddress()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      address,
+      project,
+      region
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java
new file mode 100644
index 000000000000..3a4d1e322f31
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionCommitmentName implements com.google.api.resourcenames.ResourceName {
+  private final String commitment;
+  private final String project;
+  private final String region;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/commitments/{commitment}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionCommitmentName(Builder builder) {
+    commitment = Preconditions.checkNotNull(builder.getCommitment());
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+  }
+
+  public static ProjectRegionCommitmentName of(
+      String commitment,
+      String project,
+      String region
+      ) {
+    return newBuilder()
+    .setCommitment(commitment)
+    .setProject(project)
+    .setRegion(region)
+      .build();
+  }
+
+  public static String format(
+      String commitment,
+      String project,
+      String region
+      ) {
+    return of(
+        commitment,
+        project,
+        region
+        )
+        .toString();
+  }
+
+  public String getCommitment() {
+    return commitment;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("commitment", commitment);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionCommitmentName parse(String formattedString) {return ProjectRegionCommitmentName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionCommitmentName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionCommitmentName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("commitment"),
+      matchMap.get("project"),
+      matchMap.get("region")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String commitment;
+    private String project;
+    private String region;
+
+    public String getCommitment() {
+      return commitment;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setCommitment(String commitment) {
+      this.commitment = commitment;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionCommitmentName projectRegionCommitmentName) {
+      commitment = projectRegionCommitmentName.commitment;
+      project = projectRegionCommitmentName.project;
+      region = projectRegionCommitmentName.region;
+    }
+
+    public ProjectRegionCommitmentName build() {
+      return new ProjectRegionCommitmentName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "commitment", commitment,
+        "project", project,
+        "region", region
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionCommitmentName) {
+      ProjectRegionCommitmentName that = (ProjectRegionCommitmentName) o;
+      return
+          Objects.equals(this.commitment, that.getCommitment()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      commitment,
+      project,
+      region
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java
new file mode 100644
index 000000000000..917672740e8c
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionForwardingRuleName implements com.google.api.resourcenames.ResourceName {
+  private final String forwardingRule;
+  private final String project;
+  private final String region;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/forwardingRules/{forwardingRule}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionForwardingRuleName(Builder builder) {
+    forwardingRule = Preconditions.checkNotNull(builder.getForwardingRule());
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+  }
+
+  public static ProjectRegionForwardingRuleName of(
+      String forwardingRule,
+      String project,
+      String region
+      ) {
+    return newBuilder()
+    .setForwardingRule(forwardingRule)
+    .setProject(project)
+    .setRegion(region)
+      .build();
+  }
+
+  public static String format(
+      String forwardingRule,
+      String project,
+      String region
+      ) {
+    return of(
+        forwardingRule,
+        project,
+        region
+        )
+        .toString();
+  }
+
+  public String getForwardingRule() {
+    return forwardingRule;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("forwardingRule", forwardingRule);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionForwardingRuleName parse(String formattedString) {return ProjectRegionForwardingRuleName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionForwardingRuleName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionForwardingRuleName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("forwardingRule"),
+      matchMap.get("project"),
+      matchMap.get("region")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String forwardingRule;
+    private String project;
+    private String region;
+
+    public String getForwardingRule() {
+      return forwardingRule;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setForwardingRule(String forwardingRule) {
+      this.forwardingRule = forwardingRule;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionForwardingRuleName projectRegionForwardingRuleName) {
+      forwardingRule = projectRegionForwardingRuleName.forwardingRule;
+      project = projectRegionForwardingRuleName.project;
+      region = projectRegionForwardingRuleName.region;
+    }
+
+    public ProjectRegionForwardingRuleName build() {
+      return new ProjectRegionForwardingRuleName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "forwardingRule", forwardingRule,
+        "project", project,
+        "region", region
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionForwardingRuleName) {
+      ProjectRegionForwardingRuleName that = (ProjectRegionForwardingRuleName) o;
+      return
+          Objects.equals(this.forwardingRule, that.getForwardingRule()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      forwardingRule,
+      project,
+      region
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java
new file mode 100644
index 000000000000..2a0044c79f43
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionInterconnectAttachmentName implements com.google.api.resourcenames.ResourceName {
+  private final String interconnectAttachment;
+  private final String project;
+  private final String region;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionInterconnectAttachmentName(Builder builder) {
+    interconnectAttachment = Preconditions.checkNotNull(builder.getInterconnectAttachment());
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+  }
+
+  public static ProjectRegionInterconnectAttachmentName of(
+      String interconnectAttachment,
+      String project,
+      String region
+      ) {
+    return newBuilder()
+    .setInterconnectAttachment(interconnectAttachment)
+    .setProject(project)
+    .setRegion(region)
+      .build();
+  }
+
+  public static String format(
+      String interconnectAttachment,
+      String project,
+      String region
+      ) {
+    return of(
+        interconnectAttachment,
+        project,
+        region
+        )
+        .toString();
+  }
+
+  public String getInterconnectAttachment() {
+    return interconnectAttachment;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("interconnectAttachment", interconnectAttachment);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionInterconnectAttachmentName parse(String formattedString) {return ProjectRegionInterconnectAttachmentName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionInterconnectAttachmentName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionInterconnectAttachmentName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("interconnectAttachment"),
+      matchMap.get("project"),
+      matchMap.get("region")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String interconnectAttachment;
+    private String project;
+    private String region;
+
+    public String getInterconnectAttachment() {
+      return interconnectAttachment;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setInterconnectAttachment(String interconnectAttachment) {
+      this.interconnectAttachment = interconnectAttachment;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionInterconnectAttachmentName projectRegionInterconnectAttachmentName) {
+      interconnectAttachment = projectRegionInterconnectAttachmentName.interconnectAttachment;
+      project = projectRegionInterconnectAttachmentName.project;
+      region = projectRegionInterconnectAttachmentName.region;
+    }
+
+    public ProjectRegionInterconnectAttachmentName build() {
+      return new ProjectRegionInterconnectAttachmentName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "interconnectAttachment", interconnectAttachment,
+        "project", project,
+        "region", region
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionInterconnectAttachmentName) {
+      ProjectRegionInterconnectAttachmentName that = (ProjectRegionInterconnectAttachmentName) o;
+      return
+          Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      interconnectAttachment,
+      project,
+      region
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java
new file mode 100644
index 000000000000..7161420221cb
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String region;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+  }
+
+  public static ProjectRegionName of(
+      String project,
+      String region
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String region
+      ) {
+    return of(
+        project,
+        region
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionName parse(String formattedString) {return ProjectRegionName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String region;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionName projectRegionName) {
+      project = projectRegionName.project;
+      region = projectRegionName.region;
+    }
+
+    public ProjectRegionName build() {
+      return new ProjectRegionName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "region", region
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionName) {
+      ProjectRegionName that = (ProjectRegionName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      region
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java
new file mode 100644
index 000000000000..e27282d1f4f4
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionRouterName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String region;
+  private final String router;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionRouterName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+    router = Preconditions.checkNotNull(builder.getRouter());
+  }
+
+  public static ProjectRegionRouterName of(
+      String project,
+      String region,
+      String router
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setRouter(router)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String region,
+      String router
+      ) {
+    return of(
+        project,
+        region,
+        router
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public String getRouter() {
+    return router;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldMapBuilder.put("router", router);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionRouterName parse(String formattedString) {return ProjectRegionRouterName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionRouterName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionRouterName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("router")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String region;
+    private String router;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+    public String getRouter() {
+      return router;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+    public Builder setRouter(String router) {
+      this.router = router;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionRouterName projectRegionRouterName) {
+      project = projectRegionRouterName.project;
+      region = projectRegionRouterName.region;
+      router = projectRegionRouterName.router;
+    }
+
+    public ProjectRegionRouterName build() {
+      return new ProjectRegionRouterName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "region", region,
+        "router", router
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionRouterName) {
+      ProjectRegionRouterName that = (ProjectRegionRouterName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.router, that.getRouter())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      region,
+      router
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java
new file mode 100644
index 000000000000..f63f11d34a1a
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionSubnetworkName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String region;
+  private final String subnetwork;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/subnetworks/{subnetwork}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionSubnetworkName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+    subnetwork = Preconditions.checkNotNull(builder.getSubnetwork());
+  }
+
+  public static ProjectRegionSubnetworkName of(
+      String project,
+      String region,
+      String subnetwork
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setSubnetwork(subnetwork)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String region,
+      String subnetwork
+      ) {
+    return of(
+        project,
+        region,
+        subnetwork
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public String getSubnetwork() {
+    return subnetwork;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldMapBuilder.put("subnetwork", subnetwork);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionSubnetworkName parse(String formattedString) {return ProjectRegionSubnetworkName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionSubnetworkName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionSubnetworkName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("subnetwork")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String region;
+    private String subnetwork;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+    public String getSubnetwork() {
+      return subnetwork;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+    public Builder setSubnetwork(String subnetwork) {
+      this.subnetwork = subnetwork;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionSubnetworkName projectRegionSubnetworkName) {
+      project = projectRegionSubnetworkName.project;
+      region = projectRegionSubnetworkName.region;
+      subnetwork = projectRegionSubnetworkName.subnetwork;
+    }
+
+    public ProjectRegionSubnetworkName build() {
+      return new ProjectRegionSubnetworkName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "region", region,
+        "subnetwork", subnetwork
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionSubnetworkName) {
+      ProjectRegionSubnetworkName that = (ProjectRegionSubnetworkName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.subnetwork, that.getSubnetwork())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      region,
+      subnetwork
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java
new file mode 100644
index 000000000000..55eab1fb42ce
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionTargetPoolName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String region;
+  private final String targetPool;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetPools/{targetPool}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionTargetPoolName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+    targetPool = Preconditions.checkNotNull(builder.getTargetPool());
+  }
+
+  public static ProjectRegionTargetPoolName of(
+      String project,
+      String region,
+      String targetPool
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setTargetPool(targetPool)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String region,
+      String targetPool
+      ) {
+    return of(
+        project,
+        region,
+        targetPool
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public String getTargetPool() {
+    return targetPool;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldMapBuilder.put("targetPool", targetPool);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionTargetPoolName parse(String formattedString) {return ProjectRegionTargetPoolName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionTargetPoolName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionTargetPoolName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("targetPool")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String region;
+    private String targetPool;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+    public String getTargetPool() {
+      return targetPool;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+    public Builder setTargetPool(String targetPool) {
+      this.targetPool = targetPool;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionTargetPoolName projectRegionTargetPoolName) {
+      project = projectRegionTargetPoolName.project;
+      region = projectRegionTargetPoolName.region;
+      targetPool = projectRegionTargetPoolName.targetPool;
+    }
+
+    public ProjectRegionTargetPoolName build() {
+      return new ProjectRegionTargetPoolName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "region", region,
+        "targetPool", targetPool
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionTargetPoolName) {
+      ProjectRegionTargetPoolName that = (ProjectRegionTargetPoolName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.targetPool, that.getTargetPool())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      region,
+      targetPool
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java
new file mode 100644
index 000000000000..d795fe473579
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionTargetVpnGatewayName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String region;
+  private final String targetVpnGateway;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionTargetVpnGatewayName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+    targetVpnGateway = Preconditions.checkNotNull(builder.getTargetVpnGateway());
+  }
+
+  public static ProjectRegionTargetVpnGatewayName of(
+      String project,
+      String region,
+      String targetVpnGateway
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setTargetVpnGateway(targetVpnGateway)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String region,
+      String targetVpnGateway
+      ) {
+    return of(
+        project,
+        region,
+        targetVpnGateway
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public String getTargetVpnGateway() {
+    return targetVpnGateway;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldMapBuilder.put("targetVpnGateway", targetVpnGateway);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionTargetVpnGatewayName parse(String formattedString) {return ProjectRegionTargetVpnGatewayName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionTargetVpnGatewayName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionTargetVpnGatewayName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("targetVpnGateway")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String region;
+    private String targetVpnGateway;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+    public String getTargetVpnGateway() {
+      return targetVpnGateway;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+    public Builder setTargetVpnGateway(String targetVpnGateway) {
+      this.targetVpnGateway = targetVpnGateway;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionTargetVpnGatewayName projectRegionTargetVpnGatewayName) {
+      project = projectRegionTargetVpnGatewayName.project;
+      region = projectRegionTargetVpnGatewayName.region;
+      targetVpnGateway = projectRegionTargetVpnGatewayName.targetVpnGateway;
+    }
+
+    public ProjectRegionTargetVpnGatewayName build() {
+      return new ProjectRegionTargetVpnGatewayName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "region", region,
+        "targetVpnGateway", targetVpnGateway
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionTargetVpnGatewayName) {
+      ProjectRegionTargetVpnGatewayName that = (ProjectRegionTargetVpnGatewayName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      region,
+      targetVpnGateway
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java
new file mode 100644
index 000000000000..f61e9348b7de
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRegionVpnTunnelName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String region;
+  private final String vpnTunnel;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRegionVpnTunnelName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    region = Preconditions.checkNotNull(builder.getRegion());
+    vpnTunnel = Preconditions.checkNotNull(builder.getVpnTunnel());
+  }
+
+  public static ProjectRegionVpnTunnelName of(
+      String project,
+      String region,
+      String vpnTunnel
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRegion(region)
+    .setVpnTunnel(vpnTunnel)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String region,
+      String vpnTunnel
+      ) {
+    return of(
+        project,
+        region,
+        vpnTunnel
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public String getVpnTunnel() {
+    return vpnTunnel;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("region", region);
+          fieldMapBuilder.put("vpnTunnel", vpnTunnel);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRegionVpnTunnelName parse(String formattedString) {return ProjectRegionVpnTunnelName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRegionVpnTunnelName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionVpnTunnelName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("region"),
+      matchMap.get("vpnTunnel")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String region;
+    private String vpnTunnel;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRegion() {
+      return region;
+    }
+    public String getVpnTunnel() {
+      return vpnTunnel;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+    public Builder setVpnTunnel(String vpnTunnel) {
+      this.vpnTunnel = vpnTunnel;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRegionVpnTunnelName projectRegionVpnTunnelName) {
+      project = projectRegionVpnTunnelName.project;
+      region = projectRegionVpnTunnelName.region;
+      vpnTunnel = projectRegionVpnTunnelName.vpnTunnel;
+    }
+
+    public ProjectRegionVpnTunnelName build() {
+      return new ProjectRegionVpnTunnelName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "region", region,
+        "vpnTunnel", vpnTunnel
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRegionVpnTunnelName) {
+      ProjectRegionVpnTunnelName that = (ProjectRegionVpnTunnelName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.region, that.getRegion()) &&
+          Objects.equals(this.vpnTunnel, that.getVpnTunnel())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      region,
+      vpnTunnel
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java
new file mode 100644
index 000000000000..09cdc4be96b3
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectRouteName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String route;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/routes/{route}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectRouteName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    route = Preconditions.checkNotNull(builder.getRoute());
+  }
+
+  public static ProjectRouteName of(
+      String project,
+      String route
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setRoute(route)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String route
+      ) {
+    return of(
+        project,
+        route
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getRoute() {
+    return route;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("route", route);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectRouteName parse(String formattedString) {return ProjectRouteName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectRouteName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRouteName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("route")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String route;
+
+    public String getProject() {
+      return project;
+    }
+    public String getRoute() {
+      return route;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setRoute(String route) {
+      this.route = route;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectRouteName projectRouteName) {
+      project = projectRouteName.project;
+      route = projectRouteName.route;
+    }
+
+    public ProjectRouteName build() {
+      return new ProjectRouteName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "route", route
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectRouteName) {
+      ProjectRouteName that = (ProjectRouteName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.route, that.getRoute())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      route
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java
index 05ef8a5d2404..fd6440f264b2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java
@@ -35,7 +35,7 @@ public final class ProjectSnapshotName implements com.google.api.resourcenames.R
   private final String project;
   private final String resource;
   private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{resource}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{snapshot}");
 
   private volatile Map fieldValuesMap;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java
new file mode 100644
index 000000000000..87fff2765464
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectSslCertificateName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String sslCertificate;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectSslCertificateName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    sslCertificate = Preconditions.checkNotNull(builder.getSslCertificate());
+  }
+
+  public static ProjectSslCertificateName of(
+      String project,
+      String sslCertificate
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setSslCertificate(sslCertificate)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String sslCertificate
+      ) {
+    return of(
+        project,
+        sslCertificate
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getSslCertificate() {
+    return sslCertificate;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("sslCertificate", sslCertificate);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectSslCertificateName parse(String formattedString) {return ProjectSslCertificateName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectSslCertificateName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectSslCertificateName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("sslCertificate")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String sslCertificate;
+
+    public String getProject() {
+      return project;
+    }
+    public String getSslCertificate() {
+      return sslCertificate;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setSslCertificate(String sslCertificate) {
+      this.sslCertificate = sslCertificate;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectSslCertificateName projectSslCertificateName) {
+      project = projectSslCertificateName.project;
+      sslCertificate = projectSslCertificateName.sslCertificate;
+    }
+
+    public ProjectSslCertificateName build() {
+      return new ProjectSslCertificateName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "sslCertificate", sslCertificate
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectSslCertificateName) {
+      ProjectSslCertificateName that = (ProjectSslCertificateName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.sslCertificate, that.getSslCertificate())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      sslCertificate
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java
new file mode 100644
index 000000000000..559380ce183e
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectTargetHttpProxyName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String targetHttpProxy;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpProxies/{targetHttpProxy}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectTargetHttpProxyName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    targetHttpProxy = Preconditions.checkNotNull(builder.getTargetHttpProxy());
+  }
+
+  public static ProjectTargetHttpProxyName of(
+      String project,
+      String targetHttpProxy
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setTargetHttpProxy(targetHttpProxy)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String targetHttpProxy
+      ) {
+    return of(
+        project,
+        targetHttpProxy
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getTargetHttpProxy() {
+    return targetHttpProxy;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("targetHttpProxy", targetHttpProxy);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectTargetHttpProxyName parse(String formattedString) {return ProjectTargetHttpProxyName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectTargetHttpProxyName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetHttpProxyName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("targetHttpProxy")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String targetHttpProxy;
+
+    public String getProject() {
+      return project;
+    }
+    public String getTargetHttpProxy() {
+      return targetHttpProxy;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setTargetHttpProxy(String targetHttpProxy) {
+      this.targetHttpProxy = targetHttpProxy;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectTargetHttpProxyName projectTargetHttpProxyName) {
+      project = projectTargetHttpProxyName.project;
+      targetHttpProxy = projectTargetHttpProxyName.targetHttpProxy;
+    }
+
+    public ProjectTargetHttpProxyName build() {
+      return new ProjectTargetHttpProxyName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "targetHttpProxy", targetHttpProxy
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectTargetHttpProxyName) {
+      ProjectTargetHttpProxyName that = (ProjectTargetHttpProxyName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      targetHttpProxy
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java
new file mode 100644
index 000000000000..769dc84f32e0
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectTargetHttpsProxyName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String targetHttpsProxy;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpsProxies/{targetHttpsProxy}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectTargetHttpsProxyName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    targetHttpsProxy = Preconditions.checkNotNull(builder.getTargetHttpsProxy());
+  }
+
+  public static ProjectTargetHttpsProxyName of(
+      String project,
+      String targetHttpsProxy
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setTargetHttpsProxy(targetHttpsProxy)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String targetHttpsProxy
+      ) {
+    return of(
+        project,
+        targetHttpsProxy
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getTargetHttpsProxy() {
+    return targetHttpsProxy;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("targetHttpsProxy", targetHttpsProxy);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectTargetHttpsProxyName parse(String formattedString) {return ProjectTargetHttpsProxyName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectTargetHttpsProxyName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetHttpsProxyName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("targetHttpsProxy")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String targetHttpsProxy;
+
+    public String getProject() {
+      return project;
+    }
+    public String getTargetHttpsProxy() {
+      return targetHttpsProxy;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setTargetHttpsProxy(String targetHttpsProxy) {
+      this.targetHttpsProxy = targetHttpsProxy;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectTargetHttpsProxyName projectTargetHttpsProxyName) {
+      project = projectTargetHttpsProxyName.project;
+      targetHttpsProxy = projectTargetHttpsProxyName.targetHttpsProxy;
+    }
+
+    public ProjectTargetHttpsProxyName build() {
+      return new ProjectTargetHttpsProxyName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "targetHttpsProxy", targetHttpsProxy
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectTargetHttpsProxyName) {
+      ProjectTargetHttpsProxyName that = (ProjectTargetHttpsProxyName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      targetHttpsProxy
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java
new file mode 100644
index 000000000000..4faa9c9ffde5
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectTargetSslProxyName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String targetSslProxy;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/targetSslProxies/{targetSslProxy}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectTargetSslProxyName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    targetSslProxy = Preconditions.checkNotNull(builder.getTargetSslProxy());
+  }
+
+  public static ProjectTargetSslProxyName of(
+      String project,
+      String targetSslProxy
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setTargetSslProxy(targetSslProxy)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String targetSslProxy
+      ) {
+    return of(
+        project,
+        targetSslProxy
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getTargetSslProxy() {
+    return targetSslProxy;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("targetSslProxy", targetSslProxy);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectTargetSslProxyName parse(String formattedString) {return ProjectTargetSslProxyName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectTargetSslProxyName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetSslProxyName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("targetSslProxy")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String targetSslProxy;
+
+    public String getProject() {
+      return project;
+    }
+    public String getTargetSslProxy() {
+      return targetSslProxy;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setTargetSslProxy(String targetSslProxy) {
+      this.targetSslProxy = targetSslProxy;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectTargetSslProxyName projectTargetSslProxyName) {
+      project = projectTargetSslProxyName.project;
+      targetSslProxy = projectTargetSslProxyName.targetSslProxy;
+    }
+
+    public ProjectTargetSslProxyName build() {
+      return new ProjectTargetSslProxyName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "targetSslProxy", targetSslProxy
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectTargetSslProxyName) {
+      ProjectTargetSslProxyName that = (ProjectTargetSslProxyName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.targetSslProxy, that.getTargetSslProxy())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      targetSslProxy
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java
new file mode 100644
index 000000000000..a48c75349b47
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectTargetTcpProxyName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String targetTcpProxy;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/targetTcpProxies/{targetTcpProxy}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectTargetTcpProxyName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    targetTcpProxy = Preconditions.checkNotNull(builder.getTargetTcpProxy());
+  }
+
+  public static ProjectTargetTcpProxyName of(
+      String project,
+      String targetTcpProxy
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setTargetTcpProxy(targetTcpProxy)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String targetTcpProxy
+      ) {
+    return of(
+        project,
+        targetTcpProxy
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getTargetTcpProxy() {
+    return targetTcpProxy;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("targetTcpProxy", targetTcpProxy);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectTargetTcpProxyName parse(String formattedString) {return ProjectTargetTcpProxyName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectTargetTcpProxyName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetTcpProxyName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("targetTcpProxy")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String targetTcpProxy;
+
+    public String getProject() {
+      return project;
+    }
+    public String getTargetTcpProxy() {
+      return targetTcpProxy;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setTargetTcpProxy(String targetTcpProxy) {
+      this.targetTcpProxy = targetTcpProxy;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectTargetTcpProxyName projectTargetTcpProxyName) {
+      project = projectTargetTcpProxyName.project;
+      targetTcpProxy = projectTargetTcpProxyName.targetTcpProxy;
+    }
+
+    public ProjectTargetTcpProxyName build() {
+      return new ProjectTargetTcpProxyName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "targetTcpProxy", targetTcpProxy
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectTargetTcpProxyName) {
+      ProjectTargetTcpProxyName that = (ProjectTargetTcpProxyName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      targetTcpProxy
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java
new file mode 100644
index 000000000000..e62e352bc3af
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectUrlMapName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String urlMap;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectUrlMapName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    urlMap = Preconditions.checkNotNull(builder.getUrlMap());
+  }
+
+  public static ProjectUrlMapName of(
+      String project,
+      String urlMap
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setUrlMap(urlMap)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String urlMap
+      ) {
+    return of(
+        project,
+        urlMap
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getUrlMap() {
+    return urlMap;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("urlMap", urlMap);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectUrlMapName parse(String formattedString) {return ProjectUrlMapName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectUrlMapName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectUrlMapName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("urlMap")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String urlMap;
+
+    public String getProject() {
+      return project;
+    }
+    public String getUrlMap() {
+      return urlMap;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setUrlMap(String urlMap) {
+      this.urlMap = urlMap;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectUrlMapName projectUrlMapName) {
+      project = projectUrlMapName.project;
+      urlMap = projectUrlMapName.urlMap;
+    }
+
+    public ProjectUrlMapName build() {
+      return new ProjectUrlMapName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "urlMap", urlMap
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectUrlMapName) {
+      ProjectUrlMapName that = (ProjectUrlMapName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.urlMap, that.getUrlMap())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      urlMap
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java
new file mode 100644
index 000000000000..4ccc9aade486
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneAcceleratorTypeName implements com.google.api.resourcenames.ResourceName {
+  private final String acceleratorType;
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneAcceleratorTypeName(Builder builder) {
+    acceleratorType = Preconditions.checkNotNull(builder.getAcceleratorType());
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneAcceleratorTypeName of(
+      String acceleratorType,
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setAcceleratorType(acceleratorType)
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String acceleratorType,
+      String project,
+      String zone
+      ) {
+    return of(
+        acceleratorType,
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getAcceleratorType() {
+    return acceleratorType;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("acceleratorType", acceleratorType);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneAcceleratorTypeName parse(String formattedString) {return ProjectZoneAcceleratorTypeName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneAcceleratorTypeName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneAcceleratorTypeName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("acceleratorType"),
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String acceleratorType;
+    private String project;
+    private String zone;
+
+    public String getAcceleratorType() {
+      return acceleratorType;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setAcceleratorType(String acceleratorType) {
+      this.acceleratorType = acceleratorType;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneAcceleratorTypeName projectZoneAcceleratorTypeName) {
+      acceleratorType = projectZoneAcceleratorTypeName.acceleratorType;
+      project = projectZoneAcceleratorTypeName.project;
+      zone = projectZoneAcceleratorTypeName.zone;
+    }
+
+    public ProjectZoneAcceleratorTypeName build() {
+      return new ProjectZoneAcceleratorTypeName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "acceleratorType", acceleratorType,
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneAcceleratorTypeName) {
+      ProjectZoneAcceleratorTypeName that = (ProjectZoneAcceleratorTypeName) o;
+      return
+          Objects.equals(this.acceleratorType, that.getAcceleratorType()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      acceleratorType,
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java
new file mode 100644
index 000000000000..90c9da18a057
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneAutoscalerName implements com.google.api.resourcenames.ResourceName {
+  private final String autoscaler;
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/autoscalers/{autoscaler}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneAutoscalerName(Builder builder) {
+    autoscaler = Preconditions.checkNotNull(builder.getAutoscaler());
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneAutoscalerName of(
+      String autoscaler,
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setAutoscaler(autoscaler)
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String autoscaler,
+      String project,
+      String zone
+      ) {
+    return of(
+        autoscaler,
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getAutoscaler() {
+    return autoscaler;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("autoscaler", autoscaler);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneAutoscalerName parse(String formattedString) {return ProjectZoneAutoscalerName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneAutoscalerName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneAutoscalerName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("autoscaler"),
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String autoscaler;
+    private String project;
+    private String zone;
+
+    public String getAutoscaler() {
+      return autoscaler;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setAutoscaler(String autoscaler) {
+      this.autoscaler = autoscaler;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneAutoscalerName projectZoneAutoscalerName) {
+      autoscaler = projectZoneAutoscalerName.autoscaler;
+      project = projectZoneAutoscalerName.project;
+      zone = projectZoneAutoscalerName.zone;
+    }
+
+    public ProjectZoneAutoscalerName build() {
+      return new ProjectZoneAutoscalerName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "autoscaler", autoscaler,
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneAutoscalerName) {
+      ProjectZoneAutoscalerName that = (ProjectZoneAutoscalerName) o;
+      return
+          Objects.equals(this.autoscaler, that.getAutoscaler()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      autoscaler,
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java
new file mode 100644
index 000000000000..6c657f6023cf
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneDiskName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String resource;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{disk}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneDiskName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    resource = Preconditions.checkNotNull(builder.getResource());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneDiskName of(
+      String project,
+      String resource,
+      String zone
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setResource(resource)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String resource,
+      String zone
+      ) {
+    return of(
+        project,
+        resource,
+        zone
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getResource() {
+    return resource;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("resource", resource);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneDiskName parse(String formattedString) {return ProjectZoneDiskName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneDiskName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneDiskName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("resource"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String resource;
+    private String zone;
+
+    public String getProject() {
+      return project;
+    }
+    public String getResource() {
+      return resource;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setResource(String resource) {
+      this.resource = resource;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneDiskName projectZoneDiskName) {
+      project = projectZoneDiskName.project;
+      resource = projectZoneDiskName.resource;
+      zone = projectZoneDiskName.zone;
+    }
+
+    public ProjectZoneDiskName build() {
+      return new ProjectZoneDiskName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "resource", resource,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneDiskName) {
+      ProjectZoneDiskName that = (ProjectZoneDiskName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.resource, that.getResource()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      resource,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java
new file mode 100644
index 000000000000..bbb69f01e882
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneDiskTypeName implements com.google.api.resourcenames.ResourceName {
+  private final String diskType;
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/diskTypes/{diskType}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneDiskTypeName(Builder builder) {
+    diskType = Preconditions.checkNotNull(builder.getDiskType());
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneDiskTypeName of(
+      String diskType,
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setDiskType(diskType)
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String diskType,
+      String project,
+      String zone
+      ) {
+    return of(
+        diskType,
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getDiskType() {
+    return diskType;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("diskType", diskType);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneDiskTypeName parse(String formattedString) {return ProjectZoneDiskTypeName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneDiskTypeName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneDiskTypeName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("diskType"),
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String diskType;
+    private String project;
+    private String zone;
+
+    public String getDiskType() {
+      return diskType;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setDiskType(String diskType) {
+      this.diskType = diskType;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneDiskTypeName projectZoneDiskTypeName) {
+      diskType = projectZoneDiskTypeName.diskType;
+      project = projectZoneDiskTypeName.project;
+      zone = projectZoneDiskTypeName.zone;
+    }
+
+    public ProjectZoneDiskTypeName build() {
+      return new ProjectZoneDiskTypeName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "diskType", diskType,
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneDiskTypeName) {
+      ProjectZoneDiskTypeName that = (ProjectZoneDiskTypeName) o;
+      return
+          Objects.equals(this.diskType, that.getDiskType()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      diskType,
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java
new file mode 100644
index 000000000000..3fffc6dcd292
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneInstanceGroupManagerName implements com.google.api.resourcenames.ResourceName {
+  private final String instanceGroupManager;
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneInstanceGroupManagerName(Builder builder) {
+    instanceGroupManager = Preconditions.checkNotNull(builder.getInstanceGroupManager());
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneInstanceGroupManagerName of(
+      String instanceGroupManager,
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setInstanceGroupManager(instanceGroupManager)
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String instanceGroupManager,
+      String project,
+      String zone
+      ) {
+    return of(
+        instanceGroupManager,
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getInstanceGroupManager() {
+    return instanceGroupManager;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("instanceGroupManager", instanceGroupManager);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneInstanceGroupManagerName parse(String formattedString) {return ProjectZoneInstanceGroupManagerName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneInstanceGroupManagerName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceGroupManagerName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("instanceGroupManager"),
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String instanceGroupManager;
+    private String project;
+    private String zone;
+
+    public String getInstanceGroupManager() {
+      return instanceGroupManager;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setInstanceGroupManager(String instanceGroupManager) {
+      this.instanceGroupManager = instanceGroupManager;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneInstanceGroupManagerName projectZoneInstanceGroupManagerName) {
+      instanceGroupManager = projectZoneInstanceGroupManagerName.instanceGroupManager;
+      project = projectZoneInstanceGroupManagerName.project;
+      zone = projectZoneInstanceGroupManagerName.zone;
+    }
+
+    public ProjectZoneInstanceGroupManagerName build() {
+      return new ProjectZoneInstanceGroupManagerName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "instanceGroupManager", instanceGroupManager,
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneInstanceGroupManagerName) {
+      ProjectZoneInstanceGroupManagerName that = (ProjectZoneInstanceGroupManagerName) o;
+      return
+          Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      instanceGroupManager,
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java
new file mode 100644
index 000000000000..dc9ce3422830
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneInstanceGroupName implements com.google.api.resourcenames.ResourceName {
+  private final String instanceGroup;
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneInstanceGroupName(Builder builder) {
+    instanceGroup = Preconditions.checkNotNull(builder.getInstanceGroup());
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneInstanceGroupName of(
+      String instanceGroup,
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setInstanceGroup(instanceGroup)
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String instanceGroup,
+      String project,
+      String zone
+      ) {
+    return of(
+        instanceGroup,
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getInstanceGroup() {
+    return instanceGroup;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("instanceGroup", instanceGroup);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneInstanceGroupName parse(String formattedString) {return ProjectZoneInstanceGroupName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneInstanceGroupName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceGroupName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("instanceGroup"),
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String instanceGroup;
+    private String project;
+    private String zone;
+
+    public String getInstanceGroup() {
+      return instanceGroup;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setInstanceGroup(String instanceGroup) {
+      this.instanceGroup = instanceGroup;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneInstanceGroupName projectZoneInstanceGroupName) {
+      instanceGroup = projectZoneInstanceGroupName.instanceGroup;
+      project = projectZoneInstanceGroupName.project;
+      zone = projectZoneInstanceGroupName.zone;
+    }
+
+    public ProjectZoneInstanceGroupName build() {
+      return new ProjectZoneInstanceGroupName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "instanceGroup", instanceGroup,
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneInstanceGroupName) {
+      ProjectZoneInstanceGroupName that = (ProjectZoneInstanceGroupName) o;
+      return
+          Objects.equals(this.instanceGroup, that.getInstanceGroup()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      instanceGroup,
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java
index a50f2a54840d..8fee586088fa 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java
@@ -32,11 +32,11 @@
 @Generated("by GAPIC")
 @BetaApi
 public final class ProjectZoneInstanceName implements com.google.api.resourcenames.ResourceName {
+  private final String instance;
   private final String project;
-  private final String resource;
   private final String zone;
   private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{resource}");
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}");
 
   private volatile Map fieldValuesMap;
 
@@ -49,42 +49,42 @@ public Builder toBuilder() {
   }
 
   private ProjectZoneInstanceName(Builder builder) {
+    instance = Preconditions.checkNotNull(builder.getInstance());
     project = Preconditions.checkNotNull(builder.getProject());
-    resource = Preconditions.checkNotNull(builder.getResource());
     zone = Preconditions.checkNotNull(builder.getZone());
   }
 
   public static ProjectZoneInstanceName of(
+      String instance,
       String project,
-      String resource,
       String zone
       ) {
     return newBuilder()
+    .setInstance(instance)
     .setProject(project)
-    .setResource(resource)
     .setZone(zone)
       .build();
   }
 
   public static String format(
+      String instance,
       String project,
-      String resource,
       String zone
       ) {
     return of(
+        instance,
         project,
-        resource,
         zone
         )
         .toString();
   }
 
-  public String getProject() {
-    return project;
+  public String getInstance() {
+    return instance;
   }
 
-  public String getResource() {
-    return resource;
+  public String getProject() {
+    return project;
   }
 
   public String getZone() {
@@ -98,8 +98,8 @@ public Map getFieldValuesMap() {
       synchronized (this) {
         if (fieldValuesMap == null) {
           ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("instance", instance);
           fieldMapBuilder.put("project", project);
-          fieldMapBuilder.put("resource", resource);
           fieldMapBuilder.put("zone", zone);
           fieldValuesMap = fieldMapBuilder.build();
         }
@@ -123,8 +123,8 @@ public static ProjectZoneInstanceName parse(String formattedString) {
     Map matchMap =
         PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceName.parse: formattedString not in valid format");
     return of(
+      matchMap.get("instance"),
       matchMap.get("project"),
-      matchMap.get("resource"),
       matchMap.get("zone")
     );
   }
@@ -134,26 +134,26 @@ public static boolean isParsableFrom(String formattedString) {
   }
 
   public static class Builder {
+    private String instance;
     private String project;
-    private String resource;
     private String zone;
 
+    public String getInstance() {
+      return instance;
+    }
     public String getProject() {
       return project;
     }
-    public String getResource() {
-      return resource;
-    }
     public String getZone() {
       return zone;
     }
 
-    public Builder setProject(String project) {
-      this.project = project;
+    public Builder setInstance(String instance) {
+      this.instance = instance;
       return this;
     }
-    public Builder setResource(String resource) {
-      this.resource = resource;
+    public Builder setProject(String project) {
+      this.project = project;
       return this;
     }
     public Builder setZone(String zone) {
@@ -164,8 +164,8 @@ public Builder setZone(String zone) {
     private Builder() {}
 
     public Builder (ProjectZoneInstanceName projectZoneInstanceName) {
+      instance = projectZoneInstanceName.instance;
       project = projectZoneInstanceName.project;
-      resource = projectZoneInstanceName.resource;
       zone = projectZoneInstanceName.zone;
     }
 
@@ -177,8 +177,8 @@ public ProjectZoneInstanceName build() {
   @Override
   public String toString() {
     return PATH_TEMPLATE.instantiate(
+        "instance", instance,
         "project", project,
-        "resource", resource,
         "zone", zone
         );
   }
@@ -191,8 +191,8 @@ public boolean equals(Object o) {
     if (o instanceof ProjectZoneInstanceName) {
       ProjectZoneInstanceName that = (ProjectZoneInstanceName) o;
       return
+          Objects.equals(this.instance, that.getInstance()) &&
           Objects.equals(this.project, that.getProject()) &&
-          Objects.equals(this.resource, that.getResource()) &&
           Objects.equals(this.zone, that.getZone())
           ;
     }
@@ -202,8 +202,8 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
+      instance,
       project,
-      resource,
       zone
     );
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java
new file mode 100644
index 000000000000..363cd6c2caaa
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneMachineTypeName implements com.google.api.resourcenames.ResourceName {
+  private final String machineType;
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/machineTypes/{machineType}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneMachineTypeName(Builder builder) {
+    machineType = Preconditions.checkNotNull(builder.getMachineType());
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneMachineTypeName of(
+      String machineType,
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setMachineType(machineType)
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String machineType,
+      String project,
+      String zone
+      ) {
+    return of(
+        machineType,
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getMachineType() {
+    return machineType;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("machineType", machineType);
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneMachineTypeName parse(String formattedString) {return ProjectZoneMachineTypeName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneMachineTypeName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneMachineTypeName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("machineType"),
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String machineType;
+    private String project;
+    private String zone;
+
+    public String getMachineType() {
+      return machineType;
+    }
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setMachineType(String machineType) {
+      this.machineType = machineType;
+      return this;
+    }
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneMachineTypeName projectZoneMachineTypeName) {
+      machineType = projectZoneMachineTypeName.machineType;
+      project = projectZoneMachineTypeName.project;
+      zone = projectZoneMachineTypeName.zone;
+    }
+
+    public ProjectZoneMachineTypeName build() {
+      return new ProjectZoneMachineTypeName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "machineType", machineType,
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneMachineTypeName) {
+      ProjectZoneMachineTypeName that = (ProjectZoneMachineTypeName) o;
+      return
+          Objects.equals(this.machineType, that.getMachineType()) &&
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      machineType,
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java
new file mode 100644
index 000000000000..9af1dc6772e4
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneName of(
+      String project,
+      String zone
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String zone
+      ) {
+    return of(
+        project,
+        zone
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneName parse(String formattedString) {return ProjectZoneName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String zone;
+
+    public String getProject() {
+      return project;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneName projectZoneName) {
+      project = projectZoneName.project;
+      zone = projectZoneName.zone;
+    }
+
+    public ProjectZoneName build() {
+      return new ProjectZoneName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneName) {
+      ProjectZoneName that = (ProjectZoneName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java
new file mode 100644
index 000000000000..8b679e520ffc
--- /dev/null
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.core.BetaApi;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceNameFactory;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Generated;
+
+@Generated("by GAPIC")
+@BetaApi
+public final class ProjectZoneTargetInstanceName implements com.google.api.resourcenames.ResourceName {
+  private final String project;
+  private final String targetInstance;
+  private final String zone;
+  private static final PathTemplate PATH_TEMPLATE =
+        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/targetInstances/{targetInstance}");
+
+  private volatile Map fieldValuesMap;
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ProjectZoneTargetInstanceName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    targetInstance = Preconditions.checkNotNull(builder.getTargetInstance());
+    zone = Preconditions.checkNotNull(builder.getZone());
+  }
+
+  public static ProjectZoneTargetInstanceName of(
+      String project,
+      String targetInstance,
+      String zone
+      ) {
+    return newBuilder()
+    .setProject(project)
+    .setTargetInstance(targetInstance)
+    .setZone(zone)
+      .build();
+  }
+
+  public static String format(
+      String project,
+      String targetInstance,
+      String zone
+      ) {
+    return of(
+        project,
+        targetInstance,
+        zone
+        )
+        .toString();
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getTargetInstance() {
+    return targetInstance;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+
+  @Override
+  public Map getFieldValuesMap() {
+    if (fieldValuesMap == null) {
+      synchronized (this) {
+        if (fieldValuesMap == null) {
+          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+          fieldMapBuilder.put("project", project);
+          fieldMapBuilder.put("targetInstance", targetInstance);
+          fieldMapBuilder.put("zone", zone);
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+
+  public static ResourceNameFactory newFactory() {
+    return new ResourceNameFactory() {
+      public ProjectZoneTargetInstanceName parse(String formattedString) {return ProjectZoneTargetInstanceName.parse(formattedString);}
+    };
+  }
+
+  public static ProjectZoneTargetInstanceName parse(String formattedString) {
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneTargetInstanceName.parse: formattedString not in valid format");
+    return of(
+      matchMap.get("project"),
+      matchMap.get("targetInstance"),
+      matchMap.get("zone")
+    );
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PATH_TEMPLATE.matches(formattedString);
+  }
+
+  public static class Builder {
+    private String project;
+    private String targetInstance;
+    private String zone;
+
+    public String getProject() {
+      return project;
+    }
+    public String getTargetInstance() {
+      return targetInstance;
+    }
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+    public Builder setTargetInstance(String targetInstance) {
+      this.targetInstance = targetInstance;
+      return this;
+    }
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    private Builder() {}
+
+    public Builder (ProjectZoneTargetInstanceName projectZoneTargetInstanceName) {
+      project = projectZoneTargetInstanceName.project;
+      targetInstance = projectZoneTargetInstanceName.targetInstance;
+      zone = projectZoneTargetInstanceName.zone;
+    }
+
+    public ProjectZoneTargetInstanceName build() {
+      return new ProjectZoneTargetInstanceName(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return PATH_TEMPLATE.instantiate(
+        "project", project,
+        "targetInstance", targetInstance,
+        "zone", zone
+        );
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ProjectZoneTargetInstanceName) {
+      ProjectZoneTargetInstanceName that = (ProjectZoneTargetInstanceName) o;
+      return
+          Objects.equals(this.project, that.getProject()) &&
+          Objects.equals(this.targetInstance, that.getTargetInstance()) &&
+          Objects.equals(this.zone, that.getZone())
+          ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+      project,
+      targetInstance,
+      zone
+    );
+  }
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
index 92579cef081d..32d3331a0ace 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
@@ -385,7 +385,7 @@ public final UnaryCallable getRegion
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(requestId, region, autoscalerResource);
    * }
@@ -401,7 +401,7 @@ public final UnaryCallable getRegion
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertRegionAutoscaler(String requestId, RegionName region, Autoscaler autoscalerResource) {
+  public final Operation insertRegionAutoscaler(String requestId, ProjectRegionName region, Autoscaler autoscalerResource) {
 
     InsertRegionAutoscalerHttpRequest request =
         InsertRegionAutoscalerHttpRequest.newBuilder()
@@ -420,7 +420,7 @@ public final Operation insertRegionAutoscaler(String requestId, RegionName regio
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(requestId, region.toString(), autoscalerResource);
    * }
@@ -455,7 +455,7 @@ public final Operation insertRegionAutoscaler(String requestId, String region, A
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -482,7 +482,7 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -507,7 +507,7 @@ public final UnaryCallable insertR
    * Sample code:
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Autoscaler element : regionAutoscalerClient.listRegionAutoscalers(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -518,7 +518,7 @@ public final UnaryCallable insertR
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName region) {
+  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ProjectRegionName region) {
     ListRegionAutoscalersHttpRequest request =
         ListRegionAutoscalersHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -533,7 +533,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(RegionName
    * Sample code:
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Autoscaler element : regionAutoscalerClient.listRegionAutoscalers(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -559,7 +559,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
    * Sample code:
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -585,7 +585,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegion
    * Sample code:
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -609,7 +609,7 @@ public final UnaryCallable
    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionAutoscalersHttpRequest request = ListRegionAutoscalersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -642,7 +642,7 @@ public final UnaryCallable patchReg
    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
    * }
@@ -792,7 +792,7 @@ public final UnaryCallable patchReg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateRegionAutoscaler(String autoscaler, String requestId, RegionName region, Autoscaler autoscalerResource) {
+  public final Operation updateRegionAutoscaler(String autoscaler, String requestId, ProjectRegionName region, Autoscaler autoscalerResource) {
 
     UpdateRegionAutoscalerHttpRequest request =
         UpdateRegionAutoscalerHttpRequest.newBuilder()
@@ -813,7 +813,7 @@ public final Operation updateRegionAutoscaler(String autoscaler, String requestI
    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, requestId, region.toString(), autoscalerResource);
    * }
@@ -851,7 +851,7 @@ public final Operation updateRegionAutoscaler(String autoscaler, String requestI
    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
@@ -880,7 +880,7 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java
index 81e5a2a8aeef..752a321b8401 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java
@@ -490,7 +490,7 @@ public final UnaryCallable
    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = regionBackendServiceClient.insertRegionBackendService(requestId, region, backendServiceResource);
    * }
@@ -506,7 +506,7 @@ public final UnaryCallable
    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = regionBackendServiceClient.insertRegionBackendService(requestId, region.toString(), backendServiceResource);
    * }
@@ -560,7 +560,7 @@ public final Operation insertRegionBackendService(String requestId, String regio
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -587,7 +587,7 @@ public final Operation insertRegionBackendService(InsertRegionBackendServiceHttp
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -612,7 +612,7 @@ public final UnaryCallable ins
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (BackendService element : regionBackendServiceClient.listRegionBackendServices(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -623,7 +623,7 @@ public final UnaryCallable ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionBackendServicesPagedResponse listRegionBackendServices(RegionName region) {
+  public final ListRegionBackendServicesPagedResponse listRegionBackendServices(ProjectRegionName region) {
     ListRegionBackendServicesHttpRequest request =
         ListRegionBackendServicesHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -638,7 +638,7 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(Re
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (BackendService element : regionBackendServiceClient.listRegionBackendServices(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -664,7 +664,7 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(St
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -690,7 +690,7 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(Li
    * Sample code:
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -714,7 +714,7 @@ public final UnaryCallable
    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java
index 8cc8421eeb58..ea57817c8f0d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (RegionClient regionClient = RegionClient.create()) {
- *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+ *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
  *   Region response = regionClient.getRegion(region);
  * }
  * 
@@ -175,7 +175,7 @@ public RegionStub getStub() {
    * Sample code:
    * 

    * try (RegionClient regionClient = RegionClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Region response = regionClient.getRegion(region);
    * }
    * 
@@ -184,7 +184,7 @@ public RegionStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Region getRegion(RegionName region) { + public final Region getRegion(ProjectRegionName region) { GetRegionHttpRequest request = GetRegionHttpRequest.newBuilder() @@ -200,7 +200,7 @@ public final Region getRegion(RegionName region) { * Sample code: *

    * try (RegionClient regionClient = RegionClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Region response = regionClient.getRegion(region.toString());
    * }
    * 
@@ -225,7 +225,7 @@ public final Region getRegion(String region) { * Sample code: *

    * try (RegionClient regionClient = RegionClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   GetRegionHttpRequest request = GetRegionHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -248,7 +248,7 @@ public final Region getRegion(GetRegionHttpRequest request) {
    * Sample code:
    * 

    * try (RegionClient regionClient = RegionClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   GetRegionHttpRequest request = GetRegionHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
index 3ef115fd3936..8279bca17534 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
- *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+ *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
  *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment);
  * }
  * 
@@ -308,7 +308,7 @@ public final UnaryCallable
    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
    *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment);
    * }
    * 
@@ -317,7 +317,7 @@ public final UnaryCallable * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) { - * CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); + * ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); * Commitment response = regionCommitmentClient.getRegionCommitment(commitment.toString()); * } *
@@ -358,7 +358,7 @@ public final Commitment getRegionCommitment(String commitment) { * Sample code: *

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
    *   GetRegionCommitmentHttpRequest request = GetRegionCommitmentHttpRequest.newBuilder()
    *     .setCommitment(commitment.toString())
    *     .build();
@@ -381,7 +381,7 @@ public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest reque
    * Sample code:
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+   *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
    *   GetRegionCommitmentHttpRequest request = GetRegionCommitmentHttpRequest.newBuilder()
    *     .setCommitment(commitment.toString())
    *     .build();
@@ -404,7 +404,7 @@ public final UnaryCallable getRegion
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
    *   Operation response = regionCommitmentClient.insertRegionCommitment(requestId, region, commitmentResource);
    * }
@@ -422,7 +422,7 @@ public final UnaryCallable getRegion
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertRegionCommitment(String requestId, RegionName region, Commitment commitmentResource) {
+  public final Operation insertRegionCommitment(String requestId, ProjectRegionName region, Commitment commitmentResource) {
 
     InsertRegionCommitmentHttpRequest request =
         InsertRegionCommitmentHttpRequest.newBuilder()
@@ -441,7 +441,7 @@ public final Operation insertRegionCommitment(String requestId, RegionName regio
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
    *   Operation response = regionCommitmentClient.insertRegionCommitment(requestId, region.toString(), commitmentResource);
    * }
@@ -478,7 +478,7 @@ public final Operation insertRegionCommitment(String requestId, String region, C
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
    *   InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -505,7 +505,7 @@ public final Operation insertRegionCommitment(InsertRegionCommitmentHttpRequest
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
    *   InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -530,7 +530,7 @@ public final UnaryCallable insertR
    * Sample code:
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Commitment element : regionCommitmentClient.listRegionCommitments(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -541,7 +541,7 @@ public final UnaryCallable insertR
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionCommitmentsPagedResponse listRegionCommitments(RegionName region) {
+  public final ListRegionCommitmentsPagedResponse listRegionCommitments(ProjectRegionName region) {
     ListRegionCommitmentsHttpRequest request =
         ListRegionCommitmentsHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -556,7 +556,7 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(RegionName
    * Sample code:
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Commitment element : regionCommitmentClient.listRegionCommitments(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -582,7 +582,7 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(String reg
    * Sample code:
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionCommitmentsHttpRequest request = ListRegionCommitmentsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -608,7 +608,7 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(ListRegion
    * Sample code:
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionCommitmentsHttpRequest request = ListRegionCommitmentsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -632,7 +632,7 @@ public final UnaryCallable
    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionCommitmentsHttpRequest request = ListRegionCommitmentsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java
index e1dd2ac50684..9ebce541d9c1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java
@@ -270,7 +270,7 @@ public final UnaryCallable get
    * Sample code:
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -281,7 +281,7 @@ public final UnaryCallable get
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(RegionName region) {
+  public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(ProjectRegionName region) {
     ListRegionInstanceGroupsHttpRequest request =
         ListRegionInstanceGroupsHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -296,7 +296,7 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(Regi
    * Sample code:
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -322,7 +322,7 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(Stri
    * Sample code:
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -348,7 +348,7 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(List
    * Sample code:
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -372,7 +372,7 @@ public final UnaryCallable
    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
index aef8056d12ad..cb5d6b5b7584 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
@@ -666,7 +666,7 @@ public final UnaryCallable
    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource);
    * }
@@ -682,7 +682,7 @@ public final UnaryCallable
    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(requestId, region.toString(), instanceGroupManagerResource);
    * }
@@ -740,7 +740,7 @@ public final Operation insertRegionInstanceGroupManager(String requestId, String
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -769,7 +769,7 @@ public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGrou
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -794,7 +794,7 @@ public final UnaryCallable
    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -805,7 +805,7 @@ public final UnaryCallable
    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -846,7 +846,7 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -872,7 +872,7 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -896,7 +896,7 @@ public final UnaryCallable
    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java
index 6562e0070890..2f6fcd78cedb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java
@@ -365,7 +365,7 @@ public final UnaryCallable getRegionOp
    * Sample code:
    * 

    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Operation element : regionOperationClient.listRegionOperations(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -376,7 +376,7 @@ public final UnaryCallable getRegionOp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionOperationsPagedResponse listRegionOperations(RegionName region) {
+  public final ListRegionOperationsPagedResponse listRegionOperations(ProjectRegionName region) {
     ListRegionOperationsHttpRequest request =
         ListRegionOperationsHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -391,7 +391,7 @@ public final ListRegionOperationsPagedResponse listRegionOperations(RegionName r
    * Sample code:
    * 

    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Operation element : regionOperationClient.listRegionOperations(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -417,7 +417,7 @@ public final ListRegionOperationsPagedResponse listRegionOperations(String regio
    * Sample code:
    * 

    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionOperationsHttpRequest request = ListRegionOperationsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -443,7 +443,7 @@ public final ListRegionOperationsPagedResponse listRegionOperations(ListRegionOp
    * Sample code:
    * 

    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionOperationsHttpRequest request = ListRegionOperationsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -467,7 +467,7 @@ public final UnaryCallable
    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRegionOperationsHttpRequest request = ListRegionOperationsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java
index c0b81ed6f5a4..ae594fb3a232 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (RouteClient routeClient = RouteClient.create()) {
- *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+ *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
  *   String requestId = "";
  *   Operation response = routeClient.deleteRoute(route, requestId);
  * }
@@ -176,7 +176,7 @@ public RouteStub getStub() {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   Operation response = routeClient.deleteRoute(route, requestId);
    * }
@@ -191,7 +191,7 @@ public RouteStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteRoute(RouteName route, String requestId) {
+  public final Operation deleteRoute(ProjectRouteName route, String requestId) {
 
     DeleteRouteHttpRequest request =
         DeleteRouteHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteRoute(RouteName route, String requestId) {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   Operation response = routeClient.deleteRoute(route.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteRoute(String route, String requestId) {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
@@ -265,7 +265,7 @@ public final Operation deleteRoute(DeleteRouteHttpRequest request) {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteRouteCallabl
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   Route response = routeClient.getRoute(route);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteRouteCallabl * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Route getRoute(RouteName route) { + public final Route getRoute(ProjectRouteName route) { GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final Route getRoute(RouteName route) { * Sample code: *

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   Route response = routeClient.getRoute(route.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final Route getRoute(String route) { * Sample code: *

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final Route getRoute(GetRouteHttpRequest request) {
    * Sample code:
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
    *   GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
index afde59eb1f5d..101e686c5003 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (RouterClient routerClient = RouterClient.create()) {
- *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+ *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
  *   String requestId = "";
  *   Operation response = routerClient.deleteRouter(router, requestId);
  * }
@@ -309,7 +309,7 @@ public final UnaryCallable
    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Operation response = routerClient.deleteRouter(router, requestId);
    * }
@@ -324,7 +324,7 @@ public final UnaryCallable
    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Operation response = routerClient.deleteRouter(router.toString(), requestId);
    * }
@@ -373,7 +373,7 @@ public final Operation deleteRouter(String router, String requestId) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
@@ -398,7 +398,7 @@ public final Operation deleteRouter(DeleteRouterHttpRequest request) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteRouterCalla
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   Router response = routerClient.getRouter(router);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteRouterCalla * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Router getRouter(RouterName router) { + public final Router getRouter(ProjectRegionRouterName router) { GetRouterHttpRequest request = GetRouterHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final Router getRouter(RouterName router) { * Sample code: *

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   Router response = routerClient.getRouter(router.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final Router getRouter(String router) { * Sample code: *

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   GetRouterHttpRequest request = GetRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final Router getRouter(GetRouterHttpRequest request) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   GetRouterHttpRequest request = GetRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
    *     .build();
@@ -517,7 +517,7 @@ public final UnaryCallable getRouterCallable() {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   RouterStatusResponse response = routerClient.getRouterStatusRouter(router);
    * }
    * 
@@ -526,7 +526,7 @@ public final UnaryCallable getRouterCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final RouterStatusResponse getRouterStatusRouter(RouterName router) { + public final RouterStatusResponse getRouterStatusRouter(ProjectRegionRouterName router) { GetRouterStatusRouterHttpRequest request = GetRouterStatusRouterHttpRequest.newBuilder() @@ -542,7 +542,7 @@ public final RouterStatusResponse getRouterStatusRouter(RouterName router) { * Sample code: *

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   RouterStatusResponse response = routerClient.getRouterStatusRouter(router.toString());
    * }
    * 
@@ -567,7 +567,7 @@ public final RouterStatusResponse getRouterStatusRouter(String router) { * Sample code: *

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   GetRouterStatusRouterHttpRequest request = GetRouterStatusRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
    *     .build();
@@ -590,7 +590,7 @@ public final RouterStatusResponse getRouterStatusRouter(GetRouterStatusRouterHtt
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   GetRouterStatusRouterHttpRequest request = GetRouterStatusRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
    *     .build();
@@ -613,7 +613,7 @@ public final UnaryCallable
    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   Operation response = routerClient.insertRouter(requestId, region, routerResource);
    * }
@@ -629,7 +629,7 @@ public final UnaryCallable
    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   Operation response = routerClient.insertRouter(requestId, region.toString(), routerResource);
    * }
@@ -683,7 +683,7 @@ public final Operation insertRouter(String requestId, String region, Router rout
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -710,7 +710,7 @@ public final Operation insertRouter(InsertRouterHttpRequest request) {
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -735,7 +735,7 @@ public final UnaryCallable insertRouterCalla
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Router element : routerClient.listRouters(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -746,7 +746,7 @@ public final UnaryCallable insertRouterCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRoutersPagedResponse listRouters(RegionName region) {
+  public final ListRoutersPagedResponse listRouters(ProjectRegionName region) {
     ListRoutersHttpRequest request =
         ListRoutersHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -761,7 +761,7 @@ public final ListRoutersPagedResponse listRouters(RegionName region) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Router element : routerClient.listRouters(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -787,7 +787,7 @@ public final ListRoutersPagedResponse listRouters(String region) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -813,7 +813,7 @@ public final ListRoutersPagedResponse listRouters(ListRoutersHttpRequest request
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -837,7 +837,7 @@ public final UnaryCallable lis
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -868,7 +868,7 @@ public final UnaryCallable listRoutersCallab
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   Operation response = routerClient.patchRouter(router, requestId, routerResource);
@@ -885,7 +885,7 @@ public final UnaryCallable listRoutersCallab
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchRouter(RouterName router, String requestId, Router routerResource) {
+  public final Operation patchRouter(ProjectRegionRouterName router, String requestId, Router routerResource) {
 
     PatchRouterHttpRequest request =
         PatchRouterHttpRequest.newBuilder()
@@ -903,7 +903,7 @@ public final Operation patchRouter(RouterName router, String requestId, Router r
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   Operation response = routerClient.patchRouter(router.toString(), requestId, routerResource);
@@ -938,7 +938,7 @@ public final Operation patchRouter(String router, String requestId, Router route
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
@@ -965,7 +965,7 @@ public final Operation patchRouter(PatchRouterHttpRequest request) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
@@ -991,7 +991,7 @@ public final UnaryCallable patchRouterCallabl
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   Router routerResource = Router.newBuilder().build();
    *   RoutersPreviewResponse response = routerClient.previewRouter(router, routerResource);
    * }
@@ -1002,7 +1002,7 @@ public final UnaryCallable patchRouterCallabl
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RoutersPreviewResponse previewRouter(RouterName router, Router routerResource) {
+  public final RoutersPreviewResponse previewRouter(ProjectRegionRouterName router, Router routerResource) {
 
     PreviewRouterHttpRequest request =
         PreviewRouterHttpRequest.newBuilder()
@@ -1019,7 +1019,7 @@ public final RoutersPreviewResponse previewRouter(RouterName router, Router rout
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   Router routerResource = Router.newBuilder().build();
    *   RoutersPreviewResponse response = routerClient.previewRouter(router.toString(), routerResource);
    * }
@@ -1047,7 +1047,7 @@ public final RoutersPreviewResponse previewRouter(String router, Router routerRe
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   Router routerResource = Router.newBuilder().build();
    *   PreviewRouterHttpRequest request = PreviewRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
@@ -1072,7 +1072,7 @@ public final RoutersPreviewResponse previewRouter(PreviewRouterHttpRequest reque
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   Router routerResource = Router.newBuilder().build();
    *   PreviewRouterHttpRequest request = PreviewRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
@@ -1096,7 +1096,7 @@ public final UnaryCallable pre
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   Operation response = routerClient.updateRouter(router, requestId, routerResource);
@@ -1113,7 +1113,7 @@ public final UnaryCallable pre
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateRouter(RouterName router, String requestId, Router routerResource) {
+  public final Operation updateRouter(ProjectRegionRouterName router, String requestId, Router routerResource) {
 
     UpdateRouterHttpRequest request =
         UpdateRouterHttpRequest.newBuilder()
@@ -1131,7 +1131,7 @@ public final Operation updateRouter(RouterName router, String requestId, Router
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   Operation response = routerClient.updateRouter(router.toString(), requestId, routerResource);
@@ -1166,7 +1166,7 @@ public final Operation updateRouter(String router, String requestId, Router rout
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
@@ -1193,7 +1193,7 @@ public final Operation updateRouter(UpdateRouterHttpRequest request) {
    * Sample code:
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
    *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
index 6785ebb24a6a..e3405523c02a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
@@ -53,7 +53,7 @@
  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
  *   String requestId = "";
- *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
  *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
  * }
  * 
@@ -179,7 +179,7 @@ public SnapshotStub getStub() {
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
    * }
    * 
@@ -193,7 +193,7 @@ public SnapshotStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSnapshot(String requestId, SnapshotName snapshot) { + public final Operation deleteSnapshot(String requestId, ProjectSnapshotName snapshot) { DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder() @@ -213,7 +213,7 @@ public final Operation deleteSnapshot(String requestId, SnapshotName snapshot) { *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot.toString());
    * }
    * 
@@ -247,7 +247,7 @@ public final Operation deleteSnapshot(String requestId, String snapshot) { *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
@@ -274,7 +274,7 @@ public final Operation deleteSnapshot(DeleteSnapshotHttpRequest request) {
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
@@ -297,7 +297,7 @@ public final UnaryCallable deleteSnapshotC
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Snapshot response = snapshotClient.getSnapshot(snapshot);
    * }
    * 
@@ -306,7 +306,7 @@ public final UnaryCallable deleteSnapshotC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Snapshot getSnapshot(SnapshotName snapshot) { + public final Snapshot getSnapshot(ProjectSnapshotName snapshot) { GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder() @@ -322,7 +322,7 @@ public final Snapshot getSnapshot(SnapshotName snapshot) { * Sample code: *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Snapshot response = snapshotClient.getSnapshot(snapshot.toString());
    * }
    * 
@@ -347,7 +347,7 @@ public final Snapshot getSnapshot(String snapshot) { * Sample code: *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder()
    *     .setSnapshot(snapshot.toString())
    *     .build();
@@ -370,7 +370,7 @@ public final Snapshot getSnapshot(GetSnapshotHttpRequest request) {
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder()
    *     .setSnapshot(snapshot.toString())
    *     .build();
@@ -525,7 +525,7 @@ public final UnaryCallable listSnapshots
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = snapshotClient.setLabelsSnapshot(resource, globalSetLabelsRequestResource);
    * }
@@ -553,7 +553,7 @@ public final Operation setLabelsSnapshot(ProjectSnapshotName resource, GlobalSet
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = snapshotClient.setLabelsSnapshot(resource.toString(), globalSetLabelsRequestResource);
    * }
@@ -581,7 +581,7 @@ public final Operation setLabelsSnapshot(String resource, GlobalSetLabelsRequest
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsSnapshotHttpRequest request = SetLabelsSnapshotHttpRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -606,7 +606,7 @@ public final Operation setLabelsSnapshot(SetLabelsSnapshotHttpRequest request) {
    * Sample code:
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsSnapshotHttpRequest request = SetLabelsSnapshotHttpRequest.newBuilder()
    *     .setResource(resource.toString())
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java
index 8f5d06336f3a..9bfe0ce06f2a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
- *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+ *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
  *   String requestId = "";
  *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
  * }
@@ -176,7 +176,7 @@ public SslCertificateStub getStub() {
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
    * }
@@ -191,7 +191,7 @@ public SslCertificateStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteSslCertificate(SslCertificateName sslCertificate, String requestId) {
+  public final Operation deleteSslCertificate(ProjectSslCertificateName sslCertificate, String requestId) {
 
     DeleteSslCertificateHttpRequest request =
         DeleteSslCertificateHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteSslCertificate(SslCertificateName sslCertificate, S
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteSslCertificate(String sslCertificate, String reques
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
@@ -265,7 +265,7 @@ public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest requ
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteSsl
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteSsl * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final SslCertificate getSslCertificate(SslCertificateName sslCertificate) { + public final SslCertificate getSslCertificate(ProjectSslCertificateName sslCertificate) { GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final SslCertificate getSslCertificate(SslCertificateName sslCertificate) * Sample code: *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final SslCertificate getSslCertificate(String sslCertificate) { * Sample code: *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest reque
    * Sample code:
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
index 5319b3e8e779..451b648e67f4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
@@ -53,7 +53,7 @@
  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
  *   String requestId = "";
- *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+ *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
  *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) { * String requestId = ""; - * SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + * ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); * Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteSubnetwork(String requestId, String subnetwork) { *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
@@ -399,7 +399,7 @@ public final Operation deleteSubnetwork(DeleteSubnetworkHttpRequest request) {
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
@@ -423,7 +423,7 @@ public final UnaryCallable deleteSubnetw
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource);
    * }
@@ -439,7 +439,7 @@ public final UnaryCallable deleteSubnetw
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation expandIpCidrRangeSubnetwork(String requestId, SubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) {
+  public final Operation expandIpCidrRangeSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) {
 
     ExpandIpCidrRangeSubnetworkHttpRequest request =
         ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
@@ -458,7 +458,7 @@ public final Operation expandIpCidrRangeSubnetwork(String requestId, SubnetworkN
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(requestId, subnetwork.toString(), subnetworksExpandIpCidrRangeRequestResource);
    * }
@@ -493,7 +493,7 @@ public final Operation expandIpCidrRangeSubnetwork(String requestId, String subn
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -520,7 +520,7 @@ public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHt
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -545,7 +545,7 @@ public final UnaryCallable ex
    * Sample code:
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork response = subnetworkClient.getSubnetwork(subnetwork);
    * }
    * 
@@ -554,7 +554,7 @@ public final UnaryCallable ex * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Subnetwork getSubnetwork(SubnetworkName subnetwork) { + public final Subnetwork getSubnetwork(ProjectRegionSubnetworkName subnetwork) { GetSubnetworkHttpRequest request = GetSubnetworkHttpRequest.newBuilder() @@ -570,7 +570,7 @@ public final Subnetwork getSubnetwork(SubnetworkName subnetwork) { * Sample code: *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork response = subnetworkClient.getSubnetwork(subnetwork.toString());
    * }
    * 
@@ -595,7 +595,7 @@ public final Subnetwork getSubnetwork(String subnetwork) { * Sample code: *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   GetSubnetworkHttpRequest request = GetSubnetworkHttpRequest.newBuilder()
    *     .setSubnetwork(subnetwork.toString())
    *     .build();
@@ -618,7 +618,7 @@ public final Subnetwork getSubnetwork(GetSubnetworkHttpRequest request) {
    * Sample code:
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   GetSubnetworkHttpRequest request = GetSubnetworkHttpRequest.newBuilder()
    *     .setSubnetwork(subnetwork.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable getSubnetworkCa
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   Operation response = subnetworkClient.insertSubnetwork(requestId, region, subnetworkResource);
    * }
@@ -657,7 +657,7 @@ public final UnaryCallable getSubnetworkCa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertSubnetwork(String requestId, RegionName region, Subnetwork subnetworkResource) {
+  public final Operation insertSubnetwork(String requestId, ProjectRegionName region, Subnetwork subnetworkResource) {
 
     InsertSubnetworkHttpRequest request =
         InsertSubnetworkHttpRequest.newBuilder()
@@ -676,7 +676,7 @@ public final Operation insertSubnetwork(String requestId, RegionName region, Sub
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   Operation response = subnetworkClient.insertSubnetwork(requestId, region.toString(), subnetworkResource);
    * }
@@ -711,7 +711,7 @@ public final Operation insertSubnetwork(String requestId, String region, Subnetw
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -738,7 +738,7 @@ public final Operation insertSubnetwork(InsertSubnetworkHttpRequest request) {
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -763,7 +763,7 @@ public final UnaryCallable insertSubnetw
    * Sample code:
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Subnetwork element : subnetworkClient.listSubnetworks(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -774,7 +774,7 @@ public final UnaryCallable insertSubnetw
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
+  public final ListSubnetworksPagedResponse listSubnetworks(ProjectRegionName region) {
     ListSubnetworksHttpRequest request =
         ListSubnetworksHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -789,7 +789,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(RegionName region) {
    * Sample code:
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (Subnetwork element : subnetworkClient.listSubnetworks(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -815,7 +815,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
    * Sample code:
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListSubnetworksHttpRequest request = ListSubnetworksHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -841,7 +841,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpReq
    * Sample code:
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListSubnetworksHttpRequest request = ListSubnetworksHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -865,7 +865,7 @@ public final UnaryCallable
    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListSubnetworksHttpRequest request = ListSubnetworksHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -897,7 +897,7 @@ public final UnaryCallable listSubne
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   Operation response = subnetworkClient.patchSubnetwork(requestId, subnetwork, subnetworkResource);
    * }
@@ -913,7 +913,7 @@ public final UnaryCallable listSubne
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchSubnetwork(String requestId, SubnetworkName subnetwork, Subnetwork subnetworkResource) {
+  public final Operation patchSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork, Subnetwork subnetworkResource) {
 
     PatchSubnetworkHttpRequest request =
         PatchSubnetworkHttpRequest.newBuilder()
@@ -932,7 +932,7 @@ public final Operation patchSubnetwork(String requestId, SubnetworkName subnetwo
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   Operation response = subnetworkClient.patchSubnetwork(requestId, subnetwork.toString(), subnetworkResource);
    * }
@@ -967,7 +967,7 @@ public final Operation patchSubnetwork(String requestId, String subnetwork, Subn
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -994,7 +994,7 @@ public final Operation patchSubnetwork(PatchSubnetworkHttpRequest request) {
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1020,7 +1020,7 @@ public final UnaryCallable patchSubnetwor
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
    *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource);
    * }
@@ -1036,7 +1036,7 @@ public final UnaryCallable patchSubnetwor
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, SubnetworkName subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) {
+  public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) {
 
     SetPrivateIpGoogleAccessSubnetworkHttpRequest request =
         SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
@@ -1055,7 +1055,7 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, Subn
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
    *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork.toString(), subnetworksSetPrivateIpGoogleAccessRequestResource);
    * }
@@ -1090,7 +1090,7 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, Stri
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
    *   SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1117,7 +1117,7 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(SetPrivateIpGoogleAcce
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
-   *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+   *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
    *   SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java
index 1c9140eab5bc..5fba0efa73f3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java
@@ -53,7 +53,7 @@
  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
  *   String requestId = "";
- *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+ *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
  *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
  * }
  * 
@@ -177,7 +177,7 @@ public TargetHttpProxyStub getStub() {
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
    * }
    * 
@@ -191,7 +191,7 @@ public TargetHttpProxyStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpProxy(String requestId, TargetHttpProxyName targetHttpProxy) { + public final Operation deleteTargetHttpProxy(String requestId, ProjectTargetHttpProxyName targetHttpProxy) { DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder() @@ -209,7 +209,7 @@ public final Operation deleteTargetHttpProxy(String requestId, TargetHttpProxyNa *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy.toString());
    * }
    * 
@@ -241,7 +241,7 @@ public final Operation deleteTargetHttpProxy(String requestId, String targetHttp *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
@@ -266,7 +266,7 @@ public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest re
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteTa
    * Sample code:
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(targetHttpProxy);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteTa * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetHttpProxy getTargetHttpProxy(TargetHttpProxyName targetHttpProxy) { + public final TargetHttpProxy getTargetHttpProxy(ProjectTargetHttpProxyName targetHttpProxy) { GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final TargetHttpProxy getTargetHttpProxy(TargetHttpProxyName targetHttpPr * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(targetHttpProxy.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final TargetHttpProxy getTargetHttpProxy(String targetHttpProxy) { * Sample code: *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder()
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest re
    * Sample code:
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder()
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable
    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource);
    * }
@@ -657,7 +657,7 @@ public final UnaryCallable
    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(requestId, targetHttpProxy.toString(), urlMapReferenceResource);
    * }
@@ -711,7 +711,7 @@ public final Operation setUrlMapTargetHttpProxy(String requestId, String targetH
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -738,7 +738,7 @@ public final Operation setUrlMapTargetHttpProxy(SetUrlMapTargetHttpProxyHttpRequ
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
index 42616a719fba..295aeb957ada 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
- *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+ *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
  *   String requestId = "";
  *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
  * }
@@ -176,7 +176,7 @@ public TargetHttpsProxyStub getStub() {
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
    * }
@@ -191,7 +191,7 @@ public TargetHttpsProxyStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy, String requestId) {
+  public final Operation deleteTargetHttpsProxy(ProjectTargetHttpsProxyName targetHttpsProxy, String requestId) {
 
     DeleteTargetHttpsProxyHttpRequest request =
         DeleteTargetHttpsProxyHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteTargetHttpsProxy(TargetHttpsProxyName targetHttpsPr
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteTargetHttpsProxy(String targetHttpsProxy, String re
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
@@ -265,7 +265,7 @@ public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteT
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(targetHttpsProxy);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteT * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetHttpsProxy getTargetHttpsProxy(TargetHttpsProxyName targetHttpsProxy) { + public final TargetHttpsProxy getTargetHttpsProxy(ProjectTargetHttpsProxyName targetHttpsProxy) { GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final TargetHttpsProxy getTargetHttpsProxy(TargetHttpsProxyName targetHtt * Sample code: *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(targetHttpsProxy.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final TargetHttpsProxy getTargetHttpsProxy(String targetHttpsProxy) { * Sample code: *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
    *     .build();
@@ -640,7 +640,7 @@ public final UnaryCallable
    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource);
@@ -657,7 +657,7 @@ public final UnaryCallable
    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy.toString(), requestId, targetHttpsProxiesSetSslCertificatesRequestResource);
@@ -710,7 +710,7 @@ public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProx
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
@@ -737,7 +737,7 @@ public final Operation setSslCertificatesTargetHttpsProxy(SetSslCertificatesTarg
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
@@ -763,7 +763,7 @@ public final UnaryCallable
    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource);
@@ -780,7 +780,7 @@ public final UnaryCallable
    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy.toString(), requestId, urlMapReferenceResource);
@@ -833,7 +833,7 @@ public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, String
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
@@ -860,7 +860,7 @@ public final Operation setUrlMapTargetHttpsProxy(SetUrlMapTargetHttpsProxyHttpRe
    * Sample code:
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
index 6bede29094e1..1443cb5cd549 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
@@ -53,7 +53,7 @@
  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
  *   String requestId = "";
- *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+ *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
  *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) { * String requestId = ""; - * TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + * ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); * Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteTargetInstance(String requestId, String targetInsta *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetInstance(targetInstance.toString())
@@ -399,7 +399,7 @@ public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest requ
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetInstance(targetInstance.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteTar
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   TargetInstance response = targetInstanceClient.getTargetInstance(targetInstance);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteTar * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetInstance getTargetInstance(TargetInstanceName targetInstance) { + public final TargetInstance getTargetInstance(ProjectZoneTargetInstanceName targetInstance) { GetTargetInstanceHttpRequest request = GetTargetInstanceHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final TargetInstance getTargetInstance(TargetInstanceName targetInstance) * Sample code: *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   TargetInstance response = targetInstanceClient.getTargetInstance(targetInstance.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final TargetInstance getTargetInstance(String targetInstance) { * Sample code: *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   GetTargetInstanceHttpRequest request = GetTargetInstanceHttpRequest.newBuilder()
    *     .setTargetInstance(targetInstance.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest reque
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+   *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   GetTargetInstanceHttpRequest request = GetTargetInstanceHttpRequest.newBuilder()
    *     .setTargetInstance(targetInstance.toString())
    *     .build();
@@ -517,7 +517,7 @@ public final UnaryCallable getTarg
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   Operation response = targetInstanceClient.insertTargetInstance(zone, requestId, targetInstanceResource);
@@ -534,7 +534,7 @@ public final UnaryCallable getTarg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertTargetInstance(ZoneName zone, String requestId, TargetInstance targetInstanceResource) {
+  public final Operation insertTargetInstance(ProjectZoneName zone, String requestId, TargetInstance targetInstanceResource) {
 
     InsertTargetInstanceHttpRequest request =
         InsertTargetInstanceHttpRequest.newBuilder()
@@ -552,7 +552,7 @@ public final Operation insertTargetInstance(ZoneName zone, String requestId, Tar
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   Operation response = targetInstanceClient.insertTargetInstance(zone.toString(), requestId, targetInstanceResource);
@@ -587,7 +587,7 @@ public final Operation insertTargetInstance(String zone, String requestId, Targe
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
@@ -614,7 +614,7 @@ public final Operation insertTargetInstance(InsertTargetInstanceHttpRequest requ
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
@@ -640,7 +640,7 @@ public final UnaryCallable insertTar
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (TargetInstance element : targetInstanceClient.listTargetInstances(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable insertTar
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetInstancesPagedResponse listTargetInstances(ZoneName zone) {
+  public final ListTargetInstancesPagedResponse listTargetInstances(ProjectZoneName zone) {
     ListTargetInstancesHttpRequest request =
         ListTargetInstancesHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -666,7 +666,7 @@ public final ListTargetInstancesPagedResponse listTargetInstances(ZoneName zone)
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (TargetInstance element : targetInstanceClient.listTargetInstances(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListTargetInstancesPagedResponse listTargetInstances(String zone) {
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListTargetInstancesHttpRequest request = ListTargetInstancesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListTargetInstancesPagedResponse listTargetInstances(ListTargetInst
    * Sample code:
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListTargetInstancesHttpRequest request = ListTargetInstancesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListTargetInstancesHttpRequest request = ListTargetInstancesHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
index d371c03bf73e..ab623f8f3aa7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
- *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+ *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
  *   String requestId = "";
  *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
  *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
@@ -177,7 +177,7 @@ public TargetPoolStub getStub() {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
@@ -194,7 +194,7 @@ public TargetPoolStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation addHealthCheckTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) {
+  public final Operation addHealthCheckTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) {
 
     AddHealthCheckTargetPoolHttpRequest request =
         AddHealthCheckTargetPoolHttpRequest.newBuilder()
@@ -212,7 +212,7 @@ public final Operation addHealthCheckTargetPool(TargetPoolName targetPool, Strin
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool.toString(), requestId, targetPoolsAddHealthCheckRequestResource);
@@ -247,7 +247,7 @@ public final Operation addHealthCheckTargetPool(String targetPool, String reques
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
@@ -274,7 +274,7 @@ public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequ
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
@@ -300,7 +300,7 @@ public final UnaryCallable addHe
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource);
@@ -317,7 +317,7 @@ public final UnaryCallable addHe
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation addInstanceTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) {
+  public final Operation addInstanceTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) {
 
     AddInstanceTargetPoolHttpRequest request =
         AddInstanceTargetPoolHttpRequest.newBuilder()
@@ -335,7 +335,7 @@ public final Operation addInstanceTargetPool(TargetPoolName targetPool, String r
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool.toString(), requestId, targetPoolsAddInstanceRequestResource);
@@ -370,7 +370,7 @@ public final Operation addInstanceTargetPool(String targetPool, String requestId
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
@@ -397,7 +397,7 @@ public final Operation addInstanceTargetPool(AddInstanceTargetPoolHttpRequest re
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
@@ -556,7 +556,7 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   Operation response = targetPoolClient.deleteTargetPool(targetPool, requestId);
    * }
@@ -571,7 +571,7 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   Operation response = targetPoolClient.deleteTargetPool(targetPool.toString(), requestId);
    * }
@@ -620,7 +620,7 @@ public final Operation deleteTargetPool(String targetPool, String requestId) {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
@@ -645,7 +645,7 @@ public final Operation deleteTargetPool(DeleteTargetPoolHttpRequest request) {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
@@ -669,7 +669,7 @@ public final UnaryCallable deleteTargetP
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   TargetPool response = targetPoolClient.getTargetPool(targetPool);
    * }
    * 
@@ -678,7 +678,7 @@ public final UnaryCallable deleteTargetP * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetPool getTargetPool(TargetPoolName targetPool) { + public final TargetPool getTargetPool(ProjectRegionTargetPoolName targetPool) { GetTargetPoolHttpRequest request = GetTargetPoolHttpRequest.newBuilder() @@ -694,7 +694,7 @@ public final TargetPool getTargetPool(TargetPoolName targetPool) { * Sample code: *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   TargetPool response = targetPoolClient.getTargetPool(targetPool.toString());
    * }
    * 
@@ -719,7 +719,7 @@ public final TargetPool getTargetPool(String targetPool) { * Sample code: *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   GetTargetPoolHttpRequest request = GetTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final TargetPool getTargetPool(GetTargetPoolHttpRequest request) {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   GetTargetPoolHttpRequest request = GetTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
    *     .build();
@@ -764,7 +764,7 @@ public final UnaryCallable getTargetPoolCa
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
    *   TargetPoolInstanceHealth response = targetPoolClient.getHealthTargetPool(targetPool, instanceReferenceResource);
    * }
@@ -775,7 +775,7 @@ public final UnaryCallable getTargetPoolCa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final TargetPoolInstanceHealth getHealthTargetPool(TargetPoolName targetPool, InstanceReference instanceReferenceResource) {
+  public final TargetPoolInstanceHealth getHealthTargetPool(ProjectRegionTargetPoolName targetPool, InstanceReference instanceReferenceResource) {
 
     GetHealthTargetPoolHttpRequest request =
         GetHealthTargetPoolHttpRequest.newBuilder()
@@ -792,7 +792,7 @@ public final TargetPoolInstanceHealth getHealthTargetPool(TargetPoolName targetP
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
    *   TargetPoolInstanceHealth response = targetPoolClient.getHealthTargetPool(targetPool.toString(), instanceReferenceResource);
    * }
@@ -820,7 +820,7 @@ public final TargetPoolInstanceHealth getHealthTargetPool(String targetPool, Ins
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
    *   GetHealthTargetPoolHttpRequest request = GetHealthTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
@@ -845,7 +845,7 @@ public final TargetPoolInstanceHealth getHealthTargetPool(GetHealthTargetPoolHtt
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
    *   GetHealthTargetPoolHttpRequest request = GetHealthTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
@@ -870,7 +870,7 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   Operation response = targetPoolClient.insertTargetPool(requestId, region, targetPoolResource);
    * }
@@ -886,7 +886,7 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   Operation response = targetPoolClient.insertTargetPool(requestId, region.toString(), targetPoolResource);
    * }
@@ -940,7 +940,7 @@ public final Operation insertTargetPool(String requestId, String region, TargetP
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -967,7 +967,7 @@ public final Operation insertTargetPool(InsertTargetPoolHttpRequest request) {
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -992,7 +992,7 @@ public final UnaryCallable insertTargetP
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (TargetPool element : targetPoolClient.listTargetPools(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -1003,7 +1003,7 @@ public final UnaryCallable insertTargetP
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetPoolsPagedResponse listTargetPools(RegionName region) {
+  public final ListTargetPoolsPagedResponse listTargetPools(ProjectRegionName region) {
     ListTargetPoolsHttpRequest request =
         ListTargetPoolsHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -1018,7 +1018,7 @@ public final ListTargetPoolsPagedResponse listTargetPools(RegionName region) {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (TargetPool element : targetPoolClient.listTargetPools(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -1044,7 +1044,7 @@ public final ListTargetPoolsPagedResponse listTargetPools(String region) {
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListTargetPoolsHttpRequest request = ListTargetPoolsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -1070,7 +1070,7 @@ public final ListTargetPoolsPagedResponse listTargetPools(ListTargetPoolsHttpReq
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListTargetPoolsHttpRequest request = ListTargetPoolsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -1094,7 +1094,7 @@ public final UnaryCallable
    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListTargetPoolsHttpRequest request = ListTargetPoolsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -1125,7 +1125,7 @@ public final UnaryCallable listTarge
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource);
@@ -1142,7 +1142,7 @@ public final UnaryCallable listTarge
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation removeHealthCheckTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) {
+  public final Operation removeHealthCheckTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) {
 
     RemoveHealthCheckTargetPoolHttpRequest request =
         RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
@@ -1160,7 +1160,7 @@ public final Operation removeHealthCheckTargetPool(TargetPoolName targetPool, St
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool.toString(), requestId, targetPoolsRemoveHealthCheckRequestResource);
@@ -1195,7 +1195,7 @@ public final Operation removeHealthCheckTargetPool(String targetPool, String req
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
@@ -1222,7 +1222,7 @@ public final Operation removeHealthCheckTargetPool(RemoveHealthCheckTargetPoolHt
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
@@ -1248,7 +1248,7 @@ public final UnaryCallable re
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource);
@@ -1265,7 +1265,7 @@ public final UnaryCallable re
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation removeInstanceTargetPool(TargetPoolName targetPool, String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) {
+  public final Operation removeInstanceTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) {
 
     RemoveInstanceTargetPoolHttpRequest request =
         RemoveInstanceTargetPoolHttpRequest.newBuilder()
@@ -1283,7 +1283,7 @@ public final Operation removeInstanceTargetPool(TargetPoolName targetPool, Strin
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool.toString(), requestId, targetPoolsRemoveInstanceRequestResource);
@@ -1318,7 +1318,7 @@ public final Operation removeInstanceTargetPool(String targetPool, String reques
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
@@ -1345,7 +1345,7 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
@@ -1371,7 +1371,7 @@ public final UnaryCallable remov
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
@@ -1390,7 +1390,7 @@ public final UnaryCallable remov
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setBackupTargetPool(TargetPoolName targetPool, String requestId, Float failoverRatio, TargetReference targetReferenceResource) {
+  public final Operation setBackupTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, Float failoverRatio, TargetReference targetReferenceResource) {
 
     SetBackupTargetPoolHttpRequest request =
         SetBackupTargetPoolHttpRequest.newBuilder()
@@ -1409,7 +1409,7 @@ public final Operation setBackupTargetPool(TargetPoolName targetPool, String req
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
@@ -1447,7 +1447,7 @@ public final Operation setBackupTargetPool(String targetPool, String requestId,
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
@@ -1476,7 +1476,7 @@ public final Operation setBackupTargetPool(SetBackupTargetPoolHttpRequest reques
    * Sample code:
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+   *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
    *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
index ba7396412395..9bb29c35a1a1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
- *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+ *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
  *   String requestId = "";
  *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
  * }
@@ -176,7 +176,7 @@ public TargetSslProxyStub getStub() {
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
    * }
@@ -191,7 +191,7 @@ public TargetSslProxyStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId) {
+  public final Operation deleteTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId) {
 
     DeleteTargetSslProxyHttpRequest request =
         DeleteTargetSslProxyHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteTargetSslProxy(TargetSslProxyName targetSslProxy, S
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteTargetSslProxy(String targetSslProxy, String reques
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
@@ -265,7 +265,7 @@ public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest requ
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteTar
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(targetSslProxy);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteTar * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetSslProxy getTargetSslProxy(TargetSslProxyName targetSslProxy) { + public final TargetSslProxy getTargetSslProxy(ProjectTargetSslProxyName targetSslProxy) { GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final TargetSslProxy getTargetSslProxy(TargetSslProxyName targetSslProxy) * Sample code: *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(targetSslProxy.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final TargetSslProxy getTargetSslProxy(String targetSslProxy) { * Sample code: *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest reque
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
    *     .build();
@@ -640,7 +640,7 @@ public final UnaryCallable
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource);
@@ -657,7 +657,7 @@ public final UnaryCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setBackendServiceTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) {
+  public final Operation setBackendServiceTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) {
 
     SetBackendServiceTargetSslProxyHttpRequest request =
         SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
@@ -675,7 +675,7 @@ public final Operation setBackendServiceTargetSslProxy(TargetSslProxyName target
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetBackendServiceRequestResource);
@@ -710,7 +710,7 @@ public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, St
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
@@ -737,7 +737,7 @@ public final Operation setBackendServiceTargetSslProxy(SetBackendServiceTargetSs
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
@@ -763,7 +763,7 @@ public final UnaryCallable
    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource);
@@ -780,7 +780,7 @@ public final UnaryCallable
    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetProxyHeaderRequestResource);
@@ -833,7 +833,7 @@ public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, Strin
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
@@ -860,7 +860,7 @@ public final Operation setProxyHeaderTargetSslProxy(SetProxyHeaderTargetSslProxy
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
@@ -886,7 +886,7 @@ public final UnaryCallable s
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource);
@@ -903,7 +903,7 @@ public final UnaryCallable s
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setSslCertificatesTargetSslProxy(TargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) {
+  public final Operation setSslCertificatesTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) {
 
     SetSslCertificatesTargetSslProxyHttpRequest request =
         SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
@@ -921,7 +921,7 @@ public final Operation setSslCertificatesTargetSslProxy(TargetSslProxyName targe
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetSslCertificatesRequestResource);
@@ -956,7 +956,7 @@ public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, S
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
@@ -983,7 +983,7 @@ public final Operation setSslCertificatesTargetSslProxy(SetSslCertificatesTarget
    * Sample code:
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
index c42080b239ce..6670424f55cc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
@@ -53,7 +53,7 @@
  * 
  * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
  *   String requestId = "";
- *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+ *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
  *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
  * }
  * 
@@ -177,7 +177,7 @@ public TargetTcpProxyStub getStub() {
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
    * }
    * 
@@ -191,7 +191,7 @@ public TargetTcpProxyStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetTcpProxy(String requestId, TargetTcpProxyName targetTcpProxy) { + public final Operation deleteTargetTcpProxy(String requestId, ProjectTargetTcpProxyName targetTcpProxy) { DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder() @@ -209,7 +209,7 @@ public final Operation deleteTargetTcpProxy(String requestId, TargetTcpProxyName *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy.toString());
    * }
    * 
@@ -241,7 +241,7 @@ public final Operation deleteTargetTcpProxy(String requestId, String targetTcpPr *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
@@ -266,7 +266,7 @@ public final Operation deleteTargetTcpProxy(DeleteTargetTcpProxyHttpRequest requ
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteTar
    * Sample code:
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(targetTcpProxy);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteTar * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetTcpProxy getTargetTcpProxy(TargetTcpProxyName targetTcpProxy) { + public final TargetTcpProxy getTargetTcpProxy(ProjectTargetTcpProxyName targetTcpProxy) { GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final TargetTcpProxy getTargetTcpProxy(TargetTcpProxyName targetTcpProxy) * Sample code: *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(targetTcpProxy.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final TargetTcpProxy getTargetTcpProxy(String targetTcpProxy) { * Sample code: *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder()
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest reque
    * Sample code:
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder()
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .build();
@@ -641,7 +641,7 @@ public final UnaryCallable
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource);
    * }
@@ -657,7 +657,7 @@ public final UnaryCallable
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setBackendServiceTargetTcpProxy(String requestId, TargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) {
+  public final Operation setBackendServiceTargetTcpProxy(String requestId, ProjectTargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) {
 
     SetBackendServiceTargetTcpProxyHttpRequest request =
         SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
@@ -676,7 +676,7 @@ public final Operation setBackendServiceTargetTcpProxy(String requestId, TargetT
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetBackendServiceRequestResource);
    * }
@@ -711,7 +711,7 @@ public final Operation setBackendServiceTargetTcpProxy(String requestId, String
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -738,7 +738,7 @@ public final Operation setBackendServiceTargetTcpProxy(SetBackendServiceTargetTc
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -764,7 +764,7 @@ public final UnaryCallable
    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource);
    * }
@@ -780,7 +780,7 @@ public final UnaryCallable
    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetProxyHeaderRequestResource);
    * }
@@ -834,7 +834,7 @@ public final Operation setProxyHeaderTargetTcpProxy(String requestId, String tar
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -861,7 +861,7 @@ public final Operation setProxyHeaderTargetTcpProxy(SetProxyHeaderTargetTcpProxy
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java
index b82d53b0fbdd..49e8554842be 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java
@@ -53,7 +53,7 @@
  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
  *   String requestId = "";
- *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+ *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
  *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) { * String requestId = ""; - * TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + * ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); * Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteTargetVpnGateway(String requestId, String targetVpn *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetVpnGateway(targetVpnGateway.toString())
@@ -399,7 +399,7 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetVpnGateway(targetVpnGateway.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteT
    * Sample code:
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   TargetVpnGateway response = targetVpnGatewayClient.getTargetVpnGateway(targetVpnGateway);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteT * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpnGateway) { + public final TargetVpnGateway getTargetVpnGateway(ProjectRegionTargetVpnGatewayName targetVpnGateway) { GetTargetVpnGatewayHttpRequest request = GetTargetVpnGatewayHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final TargetVpnGateway getTargetVpnGateway(TargetVpnGatewayName targetVpn * Sample code: *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   TargetVpnGateway response = targetVpnGatewayClient.getTargetVpnGateway(targetVpnGateway.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final TargetVpnGateway getTargetVpnGateway(String targetVpnGateway) { * Sample code: *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   GetTargetVpnGatewayHttpRequest request = GetTargetVpnGatewayHttpRequest.newBuilder()
    *     .setTargetVpnGateway(targetVpnGateway.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
    * Sample code:
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+   *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   GetTargetVpnGatewayHttpRequest request = GetTargetVpnGatewayHttpRequest.newBuilder()
    *     .setTargetVpnGateway(targetVpnGateway.toString())
    *     .build();
@@ -518,7 +518,7 @@ public final UnaryCallable get
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource);
    * }
@@ -534,7 +534,7 @@ public final UnaryCallable get
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertTargetVpnGateway(String requestId, RegionName region, TargetVpnGateway targetVpnGatewayResource) {
+  public final Operation insertTargetVpnGateway(String requestId, ProjectRegionName region, TargetVpnGateway targetVpnGatewayResource) {
 
     InsertTargetVpnGatewayHttpRequest request =
         InsertTargetVpnGatewayHttpRequest.newBuilder()
@@ -553,7 +553,7 @@ public final Operation insertTargetVpnGateway(String requestId, RegionName regio
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(requestId, region.toString(), targetVpnGatewayResource);
    * }
@@ -588,7 +588,7 @@ public final Operation insertTargetVpnGateway(String requestId, String region, T
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -615,7 +615,7 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -640,7 +640,7 @@ public final UnaryCallable insertT
    * Sample code:
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (TargetVpnGateway element : targetVpnGatewayClient.listTargetVpnGateways(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable insertT
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName region) {
+  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ProjectRegionName region) {
     ListTargetVpnGatewaysHttpRequest request =
         ListTargetVpnGatewaysHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -666,7 +666,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(RegionName
    * Sample code:
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (TargetVpnGateway element : targetVpnGatewayClient.listTargetVpnGateways(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
    * Sample code:
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListTargetVpnGatewaysHttpRequest request = ListTargetVpnGatewaysHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTarget
    * Sample code:
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListTargetVpnGatewaysHttpRequest request = ListTargetVpnGatewaysHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListTargetVpnGatewaysHttpRequest request = ListTargetVpnGatewaysHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java
index 9d8b4f25e489..76ff129104de 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
- *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+ *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
  *   String requestId = "";
  *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
  * }
@@ -176,7 +176,7 @@ public UrlMapStub getStub() {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
    * }
@@ -191,7 +191,7 @@ public UrlMapStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteUrlMap(UrlMapName urlMap, String requestId) {
+  public final Operation deleteUrlMap(ProjectUrlMapName urlMap, String requestId) {
 
     DeleteUrlMapHttpRequest request =
         DeleteUrlMapHttpRequest.newBuilder()
@@ -208,7 +208,7 @@ public final Operation deleteUrlMap(UrlMapName urlMap, String requestId) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString(), requestId);
    * }
@@ -240,7 +240,7 @@ public final Operation deleteUrlMap(String urlMap, String requestId) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -265,7 +265,7 @@ public final Operation deleteUrlMap(DeleteUrlMapHttpRequest request) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -289,7 +289,7 @@ public final UnaryCallable deleteUrlMapCalla
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMap response = urlMapClient.getUrlMap(urlMap);
    * }
    * 
@@ -298,7 +298,7 @@ public final UnaryCallable deleteUrlMapCalla * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final UrlMap getUrlMap(UrlMapName urlMap) { + public final UrlMap getUrlMap(ProjectUrlMapName urlMap) { GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder() @@ -314,7 +314,7 @@ public final UrlMap getUrlMap(UrlMapName urlMap) { * Sample code: *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMap response = urlMapClient.getUrlMap(urlMap.toString());
    * }
    * 
@@ -339,7 +339,7 @@ public final UrlMap getUrlMap(String urlMap) { * Sample code: *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
    *     .build();
@@ -362,7 +362,7 @@ public final UrlMap getUrlMap(GetUrlMapHttpRequest request) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
    *     .build();
@@ -507,7 +507,7 @@ public final UnaryCallable insertUrlMapCalla
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource);
@@ -524,7 +524,7 @@ public final UnaryCallable insertUrlMapCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation invalidateCacheUrlMap(UrlMapName urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) {
+  public final Operation invalidateCacheUrlMap(ProjectUrlMapName urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) {
 
     InvalidateCacheUrlMapHttpRequest request =
         InvalidateCacheUrlMapHttpRequest.newBuilder()
@@ -542,7 +542,7 @@ public final Operation invalidateCacheUrlMap(UrlMapName urlMap, String requestId
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), requestId, cacheInvalidationRuleResource);
@@ -577,7 +577,7 @@ public final Operation invalidateCacheUrlMap(String urlMap, String requestId, Ca
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
@@ -604,7 +604,7 @@ public final Operation invalidateCacheUrlMap(InvalidateCacheUrlMapHttpRequest re
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
@@ -763,7 +763,7 @@ public final UnaryCallable listUrlMapsCallab
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.patchUrlMap(urlMap, requestId, urlMapResource);
@@ -780,7 +780,7 @@ public final UnaryCallable listUrlMapsCallab
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation patchUrlMap(UrlMapName urlMap, String requestId, UrlMap urlMapResource) {
+  public final Operation patchUrlMap(ProjectUrlMapName urlMap, String requestId, UrlMap urlMapResource) {
 
     PatchUrlMapHttpRequest request =
         PatchUrlMapHttpRequest.newBuilder()
@@ -798,7 +798,7 @@ public final Operation patchUrlMap(UrlMapName urlMap, String requestId, UrlMap u
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), requestId, urlMapResource);
@@ -833,7 +833,7 @@ public final Operation patchUrlMap(String urlMap, String requestId, UrlMap urlMa
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
@@ -860,7 +860,7 @@ public final Operation patchUrlMap(PatchUrlMapHttpRequest request) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
@@ -886,7 +886,7 @@ public final UnaryCallable patchUrlMapCallabl
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.updateUrlMap(urlMap, requestId, urlMapResource);
@@ -903,7 +903,7 @@ public final UnaryCallable patchUrlMapCallabl
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateUrlMap(UrlMapName urlMap, String requestId, UrlMap urlMapResource) {
+  public final Operation updateUrlMap(ProjectUrlMapName urlMap, String requestId, UrlMap urlMapResource) {
 
     UpdateUrlMapHttpRequest request =
         UpdateUrlMapHttpRequest.newBuilder()
@@ -921,7 +921,7 @@ public final Operation updateUrlMap(UrlMapName urlMap, String requestId, UrlMap
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), requestId, urlMapResource);
@@ -956,7 +956,7 @@ public final Operation updateUrlMap(String urlMap, String requestId, UrlMap urlM
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
@@ -983,7 +983,7 @@ public final Operation updateUrlMap(UpdateUrlMapHttpRequest request) {
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
@@ -1009,7 +1009,7 @@ public final UnaryCallable updateUrlMapCalla
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(urlMap, urlMapsValidateRequestResource);
    * }
@@ -1020,7 +1020,7 @@ public final UnaryCallable updateUrlMapCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final UrlMapsValidateResponse validateUrlMap(UrlMapName urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) {
+  public final UrlMapsValidateResponse validateUrlMap(ProjectUrlMapName urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) {
 
     ValidateUrlMapHttpRequest request =
         ValidateUrlMapHttpRequest.newBuilder()
@@ -1037,7 +1037,7 @@ public final UrlMapsValidateResponse validateUrlMap(UrlMapName urlMap, UrlMapsVa
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(urlMap.toString(), urlMapsValidateRequestResource);
    * }
@@ -1065,7 +1065,7 @@ public final UrlMapsValidateResponse validateUrlMap(String urlMap, UrlMapsValida
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   ValidateUrlMapHttpRequest request = ValidateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -1090,7 +1090,7 @@ public final UrlMapsValidateResponse validateUrlMap(ValidateUrlMapHttpRequest re
    * Sample code:
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   ValidateUrlMapHttpRequest request = ValidateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
index a8e7379ac76c..d0a5a45e6f46 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
@@ -53,7 +53,7 @@
  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
  *   String requestId = "";
- *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+ *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
  *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
  * }
  * 
@@ -310,7 +310,7 @@ public final UnaryCallable
    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
    * }
    * 
@@ -324,7 +324,7 @@ public final UnaryCallable * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) { * String requestId = ""; - * VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + * ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); * Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel.toString()); * } *
@@ -374,7 +374,7 @@ public final Operation deleteVpnTunnel(String requestId, String vpnTunnel) { *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setVpnTunnel(vpnTunnel.toString())
@@ -399,7 +399,7 @@ public final Operation deleteVpnTunnel(DeleteVpnTunnelHttpRequest request) {
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setVpnTunnel(vpnTunnel.toString())
@@ -422,7 +422,7 @@ public final UnaryCallable deleteVpnTunne
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   VpnTunnel response = vpnTunnelClient.getVpnTunnel(vpnTunnel);
    * }
    * 
@@ -431,7 +431,7 @@ public final UnaryCallable deleteVpnTunne * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final VpnTunnel getVpnTunnel(VpnTunnelName vpnTunnel) { + public final VpnTunnel getVpnTunnel(ProjectRegionVpnTunnelName vpnTunnel) { GetVpnTunnelHttpRequest request = GetVpnTunnelHttpRequest.newBuilder() @@ -447,7 +447,7 @@ public final VpnTunnel getVpnTunnel(VpnTunnelName vpnTunnel) { * Sample code: *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   VpnTunnel response = vpnTunnelClient.getVpnTunnel(vpnTunnel.toString());
    * }
    * 
@@ -472,7 +472,7 @@ public final VpnTunnel getVpnTunnel(String vpnTunnel) { * Sample code: *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   GetVpnTunnelHttpRequest request = GetVpnTunnelHttpRequest.newBuilder()
    *     .setVpnTunnel(vpnTunnel.toString())
    *     .build();
@@ -495,7 +495,7 @@ public final VpnTunnel getVpnTunnel(GetVpnTunnelHttpRequest request) {
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+   *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   GetVpnTunnelHttpRequest request = GetVpnTunnelHttpRequest.newBuilder()
    *     .setVpnTunnel(vpnTunnel.toString())
    *     .build();
@@ -518,7 +518,7 @@ public final UnaryCallable getVpnTunnelCalla
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   Operation response = vpnTunnelClient.insertVpnTunnel(requestId, region, vpnTunnelResource);
    * }
@@ -534,7 +534,7 @@ public final UnaryCallable getVpnTunnelCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertVpnTunnel(String requestId, RegionName region, VpnTunnel vpnTunnelResource) {
+  public final Operation insertVpnTunnel(String requestId, ProjectRegionName region, VpnTunnel vpnTunnelResource) {
 
     InsertVpnTunnelHttpRequest request =
         InsertVpnTunnelHttpRequest.newBuilder()
@@ -553,7 +553,7 @@ public final Operation insertVpnTunnel(String requestId, RegionName region, VpnT
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   Operation response = vpnTunnelClient.insertVpnTunnel(requestId, region.toString(), vpnTunnelResource);
    * }
@@ -588,7 +588,7 @@ public final Operation insertVpnTunnel(String requestId, String region, VpnTunne
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -615,7 +615,7 @@ public final Operation insertVpnTunnel(InsertVpnTunnelHttpRequest request) {
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -640,7 +640,7 @@ public final UnaryCallable insertVpnTunne
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (VpnTunnel element : vpnTunnelClient.listVpnTunnels(region).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -651,7 +651,7 @@ public final UnaryCallable insertVpnTunne
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListVpnTunnelsPagedResponse listVpnTunnels(RegionName region) {
+  public final ListVpnTunnelsPagedResponse listVpnTunnels(ProjectRegionName region) {
     ListVpnTunnelsHttpRequest request =
         ListVpnTunnelsHttpRequest.newBuilder()
         .setRegion(region == null ? null : region.toString())
@@ -666,7 +666,7 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(RegionName region) {
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   for (VpnTunnel element : vpnTunnelClient.listVpnTunnels(region.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -692,7 +692,7 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(String region) {
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListVpnTunnelsHttpRequest request = ListVpnTunnelsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -718,7 +718,7 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(ListVpnTunnelsHttpReques
    * Sample code:
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListVpnTunnelsHttpRequest request = ListVpnTunnelsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
@@ -742,7 +742,7 @@ public final UnaryCallable
    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ListVpnTunnelsHttpRequest request = ListVpnTunnelsHttpRequest.newBuilder()
    *     .setRegion(region.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java
index d4aa79597d73..5e45b10244ac 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java
@@ -52,7 +52,7 @@
  * 
  * 
  * try (ZoneClient zoneClient = ZoneClient.create()) {
- *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+ *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
  *   Zone response = zoneClient.getZone(zone);
  * }
  * 
@@ -175,7 +175,7 @@ public ZoneStub getStub() {
    * Sample code:
    * 

    * try (ZoneClient zoneClient = ZoneClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   Zone response = zoneClient.getZone(zone);
    * }
    * 
@@ -184,7 +184,7 @@ public ZoneStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Zone getZone(ZoneName zone) { + public final Zone getZone(ProjectZoneName zone) { GetZoneHttpRequest request = GetZoneHttpRequest.newBuilder() @@ -200,7 +200,7 @@ public final Zone getZone(ZoneName zone) { * Sample code: *

    * try (ZoneClient zoneClient = ZoneClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   Zone response = zoneClient.getZone(zone.toString());
    * }
    * 
@@ -225,7 +225,7 @@ public final Zone getZone(String zone) { * Sample code: *

    * try (ZoneClient zoneClient = ZoneClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   GetZoneHttpRequest request = GetZoneHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -248,7 +248,7 @@ public final Zone getZone(GetZoneHttpRequest request) {
    * Sample code:
    * 

    * try (ZoneClient zoneClient = ZoneClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   GetZoneHttpRequest request = GetZoneHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java
index 393315ece23e..f64d65e68bc5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java
@@ -365,7 +365,7 @@ public final UnaryCallable getZoneOperat
    * Sample code:
    * 

    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Operation element : zoneOperationClient.listZoneOperations(zone).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -376,7 +376,7 @@ public final UnaryCallable getZoneOperat
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListZoneOperationsPagedResponse listZoneOperations(ZoneName zone) {
+  public final ListZoneOperationsPagedResponse listZoneOperations(ProjectZoneName zone) {
     ListZoneOperationsHttpRequest request =
         ListZoneOperationsHttpRequest.newBuilder()
         .setZone(zone == null ? null : zone.toString())
@@ -391,7 +391,7 @@ public final ListZoneOperationsPagedResponse listZoneOperations(ZoneName zone) {
    * Sample code:
    * 

    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   for (Operation element : zoneOperationClient.listZoneOperations(zone.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -417,7 +417,7 @@ public final ListZoneOperationsPagedResponse listZoneOperations(String zone) {
    * Sample code:
    * 

    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -443,7 +443,7 @@ public final ListZoneOperationsPagedResponse listZoneOperations(ListZoneOperatio
    * Sample code:
    * 

    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
@@ -467,7 +467,7 @@ public final UnaryCallable
    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
-   *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder()
    *     .setZone(zone.toString())
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java
index 8b27e0b5ee57..8857e13ed332 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java
@@ -29,7 +29,7 @@
  * 
  * 
  * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
- *   AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
  *   AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
  * }
  * 
@@ -45,7 +45,7 @@
  * 
  * 
  * try (AddressClient addressClient = AddressClient.create()) {
- *   AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
  *   String requestId = "";
  *   Operation response = addressClient.deleteAddress(address, requestId);
  * }
@@ -62,7 +62,7 @@
  * 
  * 
  * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
- *   AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
  *   String requestId = "";
  *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId);
  * }
@@ -79,7 +79,7 @@
  * 
  * 
  * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
- *   BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+ *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
  *   String requestId = "";
  *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
  * }
@@ -97,7 +97,7 @@
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
  *   String requestId = "";
- *   BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+ *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
  *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
  * }
  * 
@@ -113,7 +113,7 @@
  * 
  * 
  * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
- *   DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+ *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
  *   DiskType response = diskTypeClient.getDiskType(diskType);
  * }
  * 
@@ -129,7 +129,7 @@
  * 
  * 
  * try (DiskClient diskClient = DiskClient.create()) {
- *   DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+ *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
  *   String requestId = "";
  *   Boolean guestFlush = false;
  *   Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -148,7 +148,7 @@
  * 
  * 
  * try (FirewallClient firewallClient = FirewallClient.create()) {
- *   FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+ *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
  *   String requestId = "";
  *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
  * }
@@ -166,7 +166,7 @@
  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
  *   String requestId = "";
- *   ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+ *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
  *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
  * }
  * 
@@ -216,7 +216,7 @@
  * 
  * 
  * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
- *   OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+ *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
  *   globalOperationClient.deleteGlobalOperation(operation);
  * }
  * 
@@ -233,7 +233,7 @@
  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
  *   String requestId = "";
- *   HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+ *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
  *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
  * }
  * 
@@ -250,7 +250,7 @@
  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
  *   String requestId = "";
- *   HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+ *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
  *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
  * }
  * 
@@ -266,7 +266,7 @@
  * 
  * 
  * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
- *   HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+ *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
  *   String requestId = "";
  *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
  * }
@@ -283,7 +283,7 @@
  * 
  * 
  * try (ImageClient imageClient = ImageClient.create()) {
- *   ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+ *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
  *   String requestId = "";
  *   Operation response = imageClient.deleteImage(image, requestId);
  * }
@@ -301,7 +301,7 @@
  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
  *   String requestId = "";
- *   InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+ *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
  *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
  *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
  * }
@@ -319,7 +319,7 @@
  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
  *   String requestId = "";
- *   InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+ *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
  *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
  *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
  * }
@@ -336,7 +336,7 @@
  * 
  * 
  * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
- *   InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+ *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
  *   String requestId = "";
  *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
  * }
@@ -353,7 +353,7 @@
  * 
  * 
  * try (InstanceClient instanceClient = InstanceClient.create()) {
- *   InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+ *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
  *   String networkInterface = "";
  *   String requestId = "";
  *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -373,7 +373,7 @@
  * 
  * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
  *   String requestId = "";
- *   InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+ *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
  *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
  * }
  * 
@@ -389,7 +389,7 @@
  * 
  * 
  * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
- *   InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+ *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
  *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
  * }
  * 
@@ -406,7 +406,7 @@
  * 
  * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
  *   String requestId = "";
- *   InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+ *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
  *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
  * }
  * 
@@ -422,7 +422,7 @@
  * 
  * 
  * try (LicenseClient licenseClient = LicenseClient.create()) {
- *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+ *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
  *   License response = licenseClient.getLicense(license);
  * }
  * 
@@ -438,7 +438,7 @@
  * 
  * 
  * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
- *   MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+ *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
  *   MachineType response = machineTypeClient.getMachineType(machineType);
  * }
  * 
@@ -455,7 +455,7 @@
  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
  *   String requestId = "";
- *   NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+ *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
  *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
  *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
  * }
@@ -523,7 +523,7 @@
  * 
  * 
  * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
- *   CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+ *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
  *   Commitment response = regionCommitmentClient.getRegionCommitment(commitment);
  * }
  * 
@@ -589,7 +589,7 @@
  * 
  * 
  * try (RegionClient regionClient = RegionClient.create()) {
- *   RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+ *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
  *   Region response = regionClient.getRegion(region);
  * }
  * 
@@ -605,7 +605,7 @@
  * 
  * 
  * try (RouterClient routerClient = RouterClient.create()) {
- *   RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+ *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
  *   String requestId = "";
  *   Operation response = routerClient.deleteRouter(router, requestId);
  * }
@@ -622,7 +622,7 @@
  * 
  * 
  * try (RouteClient routeClient = RouteClient.create()) {
- *   RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+ *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
  *   String requestId = "";
  *   Operation response = routeClient.deleteRoute(route, requestId);
  * }
@@ -640,7 +640,7 @@
  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
  *   String requestId = "";
- *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
  *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
  * }
  * 
@@ -656,7 +656,7 @@
  * 
  * 
  * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
- *   SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+ *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
  *   String requestId = "";
  *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
  * }
@@ -674,7 +674,7 @@
  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
  *   String requestId = "";
- *   SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+ *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
  *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
  * }
  * 
@@ -691,7 +691,7 @@
  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
  *   String requestId = "";
- *   TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+ *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
  *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
  * }
  * 
@@ -707,7 +707,7 @@
  * 
  * 
  * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
- *   TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+ *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
  *   String requestId = "";
  *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
  * }
@@ -725,7 +725,7 @@
  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
  *   String requestId = "";
- *   TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+ *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
  *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
  * }
  * 
@@ -741,7 +741,7 @@
  * 
  * 
  * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
- *   TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+ *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
  *   String requestId = "";
  *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
  *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
@@ -759,7 +759,7 @@
  * 
  * 
  * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
- *   TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+ *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
  *   String requestId = "";
  *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
  * }
@@ -777,7 +777,7 @@
  * 
  * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
  *   String requestId = "";
- *   TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+ *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
  *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
  * }
  * 
@@ -794,7 +794,7 @@
  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
  *   String requestId = "";
- *   TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+ *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
  *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
  * }
  * 
@@ -810,7 +810,7 @@
  * 
  * 
  * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
- *   UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+ *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
  *   String requestId = "";
  *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
  * }
@@ -828,7 +828,7 @@
  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
  *   String requestId = "";
- *   VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+ *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
  *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
  * }
  * 
@@ -860,7 +860,7 @@
  * 
  * 
  * try (ZoneClient zoneClient = ZoneClient.create()) {
- *   ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+ *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
  *   Zone response = zoneClient.getZone(zone);
  * }
  * 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java
index d106e02536e1..69644ab415b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java
@@ -23,13 +23,13 @@
 import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse;
 import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse;
 import com.google.cloud.compute.v1.AcceleratorTypeList;
-import com.google.cloud.compute.v1.AcceleratorTypeName;
 import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
 import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest;
 import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest;
 import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneAcceleratorTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java
index a359c8b1c24c..bdeae3e9c852 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java
@@ -23,7 +23,6 @@
 import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse;
 import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse;
 import com.google.cloud.compute.v1.AddressList;
-import com.google.cloud.compute.v1.AddressName;
 import com.google.cloud.compute.v1.AddressesScopedList;
 import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest;
 import com.google.cloud.compute.v1.DeleteAddressHttpRequest;
@@ -32,7 +31,8 @@
 import com.google.cloud.compute.v1.ListAddressesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionAddressName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java
index 544200ef9eea..1bd9453ddfae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java
@@ -24,7 +24,6 @@
 import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse;
 import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.AutoscalerList;
-import com.google.cloud.compute.v1.AutoscalerName;
 import com.google.cloud.compute.v1.AutoscalersScopedList;
 import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.GetAutoscalerHttpRequest;
@@ -33,8 +32,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneAutoscalerName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java
index 1ae4d55048c0..deac39409204 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java
@@ -21,13 +21,13 @@
 import com.google.cloud.compute.v1.BackendBucket;
 import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse;
 import com.google.cloud.compute.v1.BackendBucketList;
-import com.google.cloud.compute.v1.BackendBucketName;
 import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.GetBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest;
+import com.google.cloud.compute.v1.ProjectBackendBucketName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java
index 91d66c942e75..7adf47d79eef 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java
@@ -25,7 +25,6 @@
 import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse;
 import com.google.cloud.compute.v1.BackendServiceGroupHealth;
 import com.google.cloud.compute.v1.BackendServiceList;
-import com.google.cloud.compute.v1.BackendServiceName;
 import com.google.cloud.compute.v1.BackendServicesScopedList;
 import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetBackendServiceHttpRequest;
@@ -34,6 +33,7 @@
 import com.google.cloud.compute.v1.ListBackendServicesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest;
+import com.google.cloud.compute.v1.ProjectBackendServiceName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ResourceGroupReference;
 import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java
index 53a4f22b0ada..d5804b2d6c5d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java
@@ -26,7 +26,6 @@
 import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse;
 import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse;
 import com.google.cloud.compute.v1.DiskList;
-import com.google.cloud.compute.v1.DiskName;
 import com.google.cloud.compute.v1.DisksResizeRequest;
 import com.google.cloud.compute.v1.DisksScopedList;
 import com.google.cloud.compute.v1.GetDiskHttpRequest;
@@ -34,11 +33,11 @@
 import com.google.cloud.compute.v1.ListDisksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneDiskName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ResizeDiskHttpRequest;
-import com.google.cloud.compute.v1.ResourceName;
 import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest;
 import com.google.cloud.compute.v1.Snapshot;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java
index f99bfdf6c027..ddb575442ea8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java
@@ -24,12 +24,12 @@
 import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse;
 import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse;
 import com.google.cloud.compute.v1.DiskTypeList;
-import com.google.cloud.compute.v1.DiskTypeName;
 import com.google.cloud.compute.v1.DiskTypesScopedList;
 import com.google.cloud.compute.v1.GetDiskTypeHttpRequest;
 import com.google.cloud.compute.v1.ListDiskTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneDiskTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java
index 12fbd2206b44..6e70d3075b07 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java
@@ -22,12 +22,12 @@
 import com.google.cloud.compute.v1.Firewall;
 import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse;
 import com.google.cloud.compute.v1.FirewallList;
-import com.google.cloud.compute.v1.FirewallName;
 import com.google.cloud.compute.v1.GetFirewallHttpRequest;
 import com.google.cloud.compute.v1.InsertFirewallHttpRequest;
 import com.google.cloud.compute.v1.ListFirewallsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchFirewallHttpRequest;
+import com.google.cloud.compute.v1.ProjectFirewallName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateFirewallHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java
index a0ab3bebf6a4..95d7480a96e6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java
@@ -25,14 +25,14 @@
 import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse;
 import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse;
 import com.google.cloud.compute.v1.ForwardingRuleList;
-import com.google.cloud.compute.v1.ForwardingRuleName;
 import com.google.cloud.compute.v1.ForwardingRulesScopedList;
 import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest;
 import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest;
 import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionForwardingRuleName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest;
 import com.google.cloud.compute.v1.TargetReference;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java
index aa274b647a0a..fa2e65636ded 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java
@@ -27,9 +27,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationAggregatedList;
 import com.google.cloud.compute.v1.OperationList;
-import com.google.cloud.compute.v1.OperationName;
 import com.google.cloud.compute.v1.OperationsScopedList;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectOperationName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java
index b208bb3f46d1..9b223b55ab74 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java
@@ -23,11 +23,11 @@
 import com.google.cloud.compute.v1.HealthCheck;
 import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HealthCheckList;
-import com.google.cloud.compute.v1.HealthCheckName;
 import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java
index 2ceb0cd73019..6654c52ee485 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java
@@ -23,11 +23,11 @@
 import com.google.cloud.compute.v1.HttpHealthCheck;
 import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HttpHealthCheckList;
-import com.google.cloud.compute.v1.HttpHealthCheckName;
 import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHttpHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java
index 8752d5fb77ae..4d95989d072b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java
@@ -45,14 +45,14 @@
 import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse;
 import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse;
 import com.google.cloud.compute.v1.AcceleratorTypeList;
-import com.google.cloud.compute.v1.AcceleratorTypeName;
 import com.google.cloud.compute.v1.AcceleratorTypeSettings;
 import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
 import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest;
 import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest;
 import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneAcceleratorTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import com.google.longrunning.Operation;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java
index 6c108cb4ae8d..ae19f526e877 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java
@@ -34,14 +34,14 @@
 import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse;
 import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse;
 import com.google.cloud.compute.v1.AcceleratorTypeList;
-import com.google.cloud.compute.v1.AcceleratorTypeName;
 import com.google.cloud.compute.v1.AcceleratorTypeSettings;
 import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
 import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest;
 import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest;
 import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneAcceleratorTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -91,7 +91,7 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(AcceleratorTypeName.newFactory())
+                  .setResourceNameFactory(ProjectZoneAcceleratorTypeName.newFactory())
                   .setResourceNameField("acceleratorType")
                   .build())
           .setResponseParser(
@@ -111,7 +111,7 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java
index 4af14212fc10..9af87f4a03f3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java
@@ -45,7 +45,6 @@
 import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse;
 import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse;
 import com.google.cloud.compute.v1.AddressList;
-import com.google.cloud.compute.v1.AddressName;
 import com.google.cloud.compute.v1.AddressSettings;
 import com.google.cloud.compute.v1.AddressesScopedList;
 import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest;
@@ -55,7 +54,8 @@
 import com.google.cloud.compute.v1.ListAddressesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionAddressName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java
index 088c00a23cd8..6794575e870c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java
@@ -34,7 +34,6 @@
 import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse;
 import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse;
 import com.google.cloud.compute.v1.AddressList;
-import com.google.cloud.compute.v1.AddressName;
 import com.google.cloud.compute.v1.AddressSettings;
 import com.google.cloud.compute.v1.AddressesScopedList;
 import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest;
@@ -44,7 +43,8 @@
 import com.google.cloud.compute.v1.ListAddressesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionAddressName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -95,7 +95,7 @@ public class HttpJsonAddressStub extends AddressStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(AddressName.newFactory())
+                  .setResourceNameFactory(ProjectRegionAddressName.newFactory())
                   .setResourceNameField("address")
                   .build())
           .setResponseParser(
@@ -114,7 +114,7 @@ public class HttpJsonAddressStub extends AddressStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses/{address}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(AddressName.newFactory())
+                  .setResourceNameFactory(ProjectRegionAddressName.newFactory())
                   .setResourceNameField("address")
                   .build())
           .setResponseParser(
@@ -134,7 +134,7 @@ public class HttpJsonAddressStub extends AddressStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -154,7 +154,7 @@ public class HttpJsonAddressStub extends AddressStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java
index 6ddc5058b19a..6acda02bd88a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java
@@ -46,7 +46,6 @@
 import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse;
 import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.AutoscalerList;
-import com.google.cloud.compute.v1.AutoscalerName;
 import com.google.cloud.compute.v1.AutoscalerSettings;
 import com.google.cloud.compute.v1.AutoscalersScopedList;
 import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest;
@@ -56,8 +55,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneAutoscalerName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java
index 3c16815b7878..af8d39ec32a9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java
@@ -35,7 +35,6 @@
 import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse;
 import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.AutoscalerList;
-import com.google.cloud.compute.v1.AutoscalerName;
 import com.google.cloud.compute.v1.AutoscalerSettings;
 import com.google.cloud.compute.v1.AutoscalersScopedList;
 import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest;
@@ -45,8 +44,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneAutoscalerName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -97,7 +97,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(AutoscalerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneAutoscalerName.newFactory())
                   .setResourceNameField("autoscaler")
                   .build())
           .setResponseParser(
@@ -116,7 +116,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(AutoscalerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneAutoscalerName.newFactory())
                   .setResourceNameField("autoscaler")
                   .build())
           .setResponseParser(
@@ -136,7 +136,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -156,7 +156,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -176,7 +176,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "autoscaler",    "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -196,7 +196,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "autoscaler",    "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java
index 26897ac69b13..79f360b9b155 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java
@@ -43,7 +43,6 @@
 import com.google.cloud.compute.v1.BackendBucket;
 import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse;
 import com.google.cloud.compute.v1.BackendBucketList;
-import com.google.cloud.compute.v1.BackendBucketName;
 import com.google.cloud.compute.v1.BackendBucketSettings;
 import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.GetBackendBucketHttpRequest;
@@ -51,6 +50,7 @@
 import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest;
+import com.google.cloud.compute.v1.ProjectBackendBucketName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java
index 23c11bb1c266..d02a6973e276 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java
@@ -32,7 +32,6 @@
 import com.google.cloud.compute.v1.BackendBucket;
 import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse;
 import com.google.cloud.compute.v1.BackendBucketList;
-import com.google.cloud.compute.v1.BackendBucketName;
 import com.google.cloud.compute.v1.BackendBucketSettings;
 import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.GetBackendBucketHttpRequest;
@@ -40,6 +39,7 @@
 import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest;
+import com.google.cloud.compute.v1.ProjectBackendBucketName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -72,7 +72,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(BackendBucketName.newFactory())
+                  .setResourceNameFactory(ProjectBackendBucketName.newFactory())
                   .setResourceNameField("backendBucket")
                   .build())
           .setResponseParser(
@@ -91,7 +91,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(BackendBucketName.newFactory())
+                  .setResourceNameFactory(ProjectBackendBucketName.newFactory())
                   .setResourceNameField("backendBucket")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(BackendBucketName.newFactory())
+                  .setResourceNameFactory(ProjectBackendBucketName.newFactory())
                   .setResourceNameField("backendBucket")
                   .build())
           .setResponseParser(
@@ -171,7 +171,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(BackendBucketName.newFactory())
+                  .setResourceNameFactory(ProjectBackendBucketName.newFactory())
                   .setResourceNameField("backendBucket")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java
index 87e6a2698157..27de4cc1ce43 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java
@@ -47,7 +47,6 @@
 import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse;
 import com.google.cloud.compute.v1.BackendServiceGroupHealth;
 import com.google.cloud.compute.v1.BackendServiceList;
-import com.google.cloud.compute.v1.BackendServiceName;
 import com.google.cloud.compute.v1.BackendServiceSettings;
 import com.google.cloud.compute.v1.BackendServicesScopedList;
 import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest;
@@ -57,6 +56,7 @@
 import com.google.cloud.compute.v1.ListBackendServicesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest;
+import com.google.cloud.compute.v1.ProjectBackendServiceName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ResourceGroupReference;
 import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java
index 09d1f2d1e81d..64847bc8deb7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java
@@ -36,7 +36,6 @@
 import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse;
 import com.google.cloud.compute.v1.BackendServiceGroupHealth;
 import com.google.cloud.compute.v1.BackendServiceList;
-import com.google.cloud.compute.v1.BackendServiceName;
 import com.google.cloud.compute.v1.BackendServiceSettings;
 import com.google.cloud.compute.v1.BackendServicesScopedList;
 import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest;
@@ -46,6 +45,7 @@
 import com.google.cloud.compute.v1.ListBackendServicesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest;
+import com.google.cloud.compute.v1.ProjectBackendServiceName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ResourceGroupReference;
 import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest;
@@ -99,7 +99,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(BackendServiceName.newFactory())
+                  .setResourceNameFactory(ProjectBackendServiceName.newFactory())
                   .setResourceNameField("backendService")
                   .build())
           .setResponseParser(
@@ -118,7 +118,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(BackendServiceName.newFactory())
+                  .setResourceNameFactory(ProjectBackendServiceName.newFactory())
                   .setResourceNameField("backendService")
                   .build())
           .setResponseParser(
@@ -137,7 +137,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}/getHealth"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(BackendServiceName.newFactory())
+                  .setResourceNameFactory(ProjectBackendServiceName.newFactory())
                   .setResourceNameField("backendService")
                   .build())
           .setResponseParser(
@@ -197,7 +197,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(BackendServiceName.newFactory())
+                  .setResourceNameFactory(ProjectBackendServiceName.newFactory())
                   .setResourceNameField("backendService")
                   .build())
           .setResponseParser(
@@ -217,7 +217,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(BackendServiceName.newFactory())
+                  .setResourceNameFactory(ProjectBackendServiceName.newFactory())
                   .setResourceNameField("backendService")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java
index 4f4922251f3a..3f5829c5f038 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java
@@ -48,7 +48,6 @@
 import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse;
 import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse;
 import com.google.cloud.compute.v1.DiskList;
-import com.google.cloud.compute.v1.DiskName;
 import com.google.cloud.compute.v1.DiskSettings;
 import com.google.cloud.compute.v1.DisksResizeRequest;
 import com.google.cloud.compute.v1.DisksScopedList;
@@ -57,11 +56,11 @@
 import com.google.cloud.compute.v1.ListDisksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneDiskName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ResizeDiskHttpRequest;
-import com.google.cloud.compute.v1.ResourceName;
 import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest;
 import com.google.cloud.compute.v1.Snapshot;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java
index ecf727e4c988..480546c60e47 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java
@@ -37,7 +37,6 @@
 import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse;
 import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse;
 import com.google.cloud.compute.v1.DiskList;
-import com.google.cloud.compute.v1.DiskName;
 import com.google.cloud.compute.v1.DiskSettings;
 import com.google.cloud.compute.v1.DisksResizeRequest;
 import com.google.cloud.compute.v1.DisksScopedList;
@@ -46,11 +45,11 @@
 import com.google.cloud.compute.v1.ListDisksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneDiskName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ResizeDiskHttpRequest;
-import com.google.cloud.compute.v1.ResourceName;
 import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest;
 import com.google.cloud.compute.v1.Snapshot;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -102,7 +101,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setQueryParams(Sets.newHashSet(
                                      "guestFlush",    "requestId"
                                      ))
-                  .setResourceNameFactory(DiskName.newFactory())
+                  .setResourceNameFactory(ProjectZoneDiskName.newFactory())
                   .setResourceNameField("disk")
                   .build())
           .setResponseParser(
@@ -122,7 +121,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(DiskName.newFactory())
+                  .setResourceNameFactory(ProjectZoneDiskName.newFactory())
                   .setResourceNameField("disk")
                   .build())
           .setResponseParser(
@@ -141,7 +140,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(DiskName.newFactory())
+                  .setResourceNameFactory(ProjectZoneDiskName.newFactory())
                   .setResourceNameField("disk")
                   .build())
           .setResponseParser(
@@ -161,7 +160,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId",    "sourceImage"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -181,7 +180,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -201,7 +200,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(DiskName.newFactory())
+                  .setResourceNameFactory(ProjectZoneDiskName.newFactory())
                   .setResourceNameField("disk")
                   .build())
           .setResponseParser(
@@ -221,7 +220,7 @@ public class HttpJsonDiskStub extends DiskStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ResourceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneDiskName.newFactory())
                   .setResourceNameField("resource")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java
index ea52e4309a3e..446bc4f96c23 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java
@@ -46,13 +46,13 @@
 import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse;
 import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse;
 import com.google.cloud.compute.v1.DiskTypeList;
-import com.google.cloud.compute.v1.DiskTypeName;
 import com.google.cloud.compute.v1.DiskTypeSettings;
 import com.google.cloud.compute.v1.DiskTypesScopedList;
 import com.google.cloud.compute.v1.GetDiskTypeHttpRequest;
 import com.google.cloud.compute.v1.ListDiskTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneDiskTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import com.google.longrunning.Operation;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java
index b43fdc51c306..53a053aac2cd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java
@@ -35,13 +35,13 @@
 import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse;
 import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse;
 import com.google.cloud.compute.v1.DiskTypeList;
-import com.google.cloud.compute.v1.DiskTypeName;
 import com.google.cloud.compute.v1.DiskTypeSettings;
 import com.google.cloud.compute.v1.DiskTypesScopedList;
 import com.google.cloud.compute.v1.GetDiskTypeHttpRequest;
 import com.google.cloud.compute.v1.ListDiskTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneDiskTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -91,7 +91,7 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(DiskTypeName.newFactory())
+                  .setResourceNameFactory(ProjectZoneDiskTypeName.newFactory())
                   .setResourceNameField("diskType")
                   .build())
           .setResponseParser(
@@ -111,7 +111,7 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java
index 6bfc27bebede..6181d176c090 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java
@@ -44,13 +44,13 @@
 import com.google.cloud.compute.v1.Firewall;
 import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse;
 import com.google.cloud.compute.v1.FirewallList;
-import com.google.cloud.compute.v1.FirewallName;
 import com.google.cloud.compute.v1.FirewallSettings;
 import com.google.cloud.compute.v1.GetFirewallHttpRequest;
 import com.google.cloud.compute.v1.InsertFirewallHttpRequest;
 import com.google.cloud.compute.v1.ListFirewallsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchFirewallHttpRequest;
+import com.google.cloud.compute.v1.ProjectFirewallName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateFirewallHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java
index bd1cfbf7ecaf..4118655f0375 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java
@@ -33,13 +33,13 @@
 import com.google.cloud.compute.v1.Firewall;
 import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse;
 import com.google.cloud.compute.v1.FirewallList;
-import com.google.cloud.compute.v1.FirewallName;
 import com.google.cloud.compute.v1.FirewallSettings;
 import com.google.cloud.compute.v1.GetFirewallHttpRequest;
 import com.google.cloud.compute.v1.InsertFirewallHttpRequest;
 import com.google.cloud.compute.v1.ListFirewallsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchFirewallHttpRequest;
+import com.google.cloud.compute.v1.ProjectFirewallName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateFirewallHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -72,7 +72,7 @@ public class HttpJsonFirewallStub extends FirewallStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(FirewallName.newFactory())
+                  .setResourceNameFactory(ProjectFirewallName.newFactory())
                   .setResourceNameField("firewall")
                   .build())
           .setResponseParser(
@@ -91,7 +91,7 @@ public class HttpJsonFirewallStub extends FirewallStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(FirewallName.newFactory())
+                  .setResourceNameFactory(ProjectFirewallName.newFactory())
                   .setResourceNameField("firewall")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonFirewallStub extends FirewallStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(FirewallName.newFactory())
+                  .setResourceNameFactory(ProjectFirewallName.newFactory())
                   .setResourceNameField("firewall")
                   .build())
           .setResponseParser(
@@ -171,7 +171,7 @@ public class HttpJsonFirewallStub extends FirewallStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(FirewallName.newFactory())
+                  .setResourceNameFactory(ProjectFirewallName.newFactory())
                   .setResourceNameField("firewall")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java
index ead882f0c257..efd553e9e420 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java
@@ -47,7 +47,6 @@
 import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse;
 import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse;
 import com.google.cloud.compute.v1.ForwardingRuleList;
-import com.google.cloud.compute.v1.ForwardingRuleName;
 import com.google.cloud.compute.v1.ForwardingRuleSettings;
 import com.google.cloud.compute.v1.ForwardingRulesScopedList;
 import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest;
@@ -55,7 +54,8 @@
 import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionForwardingRuleName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest;
 import com.google.cloud.compute.v1.TargetReference;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java
index 149bd90bf2a1..a6a3b1d84617 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java
@@ -36,7 +36,6 @@
 import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse;
 import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse;
 import com.google.cloud.compute.v1.ForwardingRuleList;
-import com.google.cloud.compute.v1.ForwardingRuleName;
 import com.google.cloud.compute.v1.ForwardingRuleSettings;
 import com.google.cloud.compute.v1.ForwardingRulesScopedList;
 import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest;
@@ -44,7 +43,8 @@
 import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionForwardingRuleName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest;
 import com.google.cloud.compute.v1.TargetReference;
 import com.google.common.collect.ImmutableMap;
@@ -97,7 +97,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ForwardingRuleName.newFactory())
+                  .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory())
                   .setResourceNameField("forwardingRule")
                   .build())
           .setResponseParser(
@@ -116,7 +116,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(ForwardingRuleName.newFactory())
+                  .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory())
                   .setResourceNameField("forwardingRule")
                   .build())
           .setResponseParser(
@@ -136,7 +136,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -156,7 +156,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -176,7 +176,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ForwardingRuleName.newFactory())
+                  .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory())
                   .setResourceNameField("forwardingRule")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java
index 7e7024faf669..db7887a5b509 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java
@@ -50,9 +50,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationAggregatedList;
 import com.google.cloud.compute.v1.OperationList;
-import com.google.cloud.compute.v1.OperationName;
 import com.google.cloud.compute.v1.OperationsScopedList;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectOperationName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java
index 94497845a597..50385267bb65 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java
@@ -39,9 +39,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationAggregatedList;
 import com.google.cloud.compute.v1.OperationList;
-import com.google.cloud.compute.v1.OperationName;
 import com.google.cloud.compute.v1.OperationsScopedList;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectOperationName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -91,7 +91,7 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/operations/{operation}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(OperationName.newFactory())
+                  .setResourceNameFactory(ProjectOperationName.newFactory())
                   .setResourceNameField("operation")
                   .build())
           .build();
@@ -106,7 +106,7 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/operations/{operation}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(OperationName.newFactory())
+                  .setResourceNameFactory(ProjectOperationName.newFactory())
                   .setResourceNameField("operation")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java
index a5f298355e74..8560e6f605f1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java
@@ -45,12 +45,12 @@
 import com.google.cloud.compute.v1.HealthCheck;
 import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HealthCheckList;
-import com.google.cloud.compute.v1.HealthCheckName;
 import com.google.cloud.compute.v1.HealthCheckSettings;
 import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java
index 5d52abf153dd..69bd40f3f417 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java
@@ -34,12 +34,12 @@
 import com.google.cloud.compute.v1.HealthCheck;
 import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HealthCheckList;
-import com.google.cloud.compute.v1.HealthCheckName;
 import com.google.cloud.compute.v1.HealthCheckSettings;
 import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -72,7 +72,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHealthCheckName.newFactory())
                   .setResourceNameField("healthCheck")
                   .build())
           .setResponseParser(
@@ -91,7 +91,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(HealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHealthCheckName.newFactory())
                   .setResourceNameField("healthCheck")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHealthCheckName.newFactory())
                   .setResourceNameField("healthCheck")
                   .build())
           .setResponseParser(
@@ -171,7 +171,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHealthCheckName.newFactory())
                   .setResourceNameField("healthCheck")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java
index 68c18b08ff97..2f3fe05ccaae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java
@@ -45,12 +45,12 @@
 import com.google.cloud.compute.v1.HttpHealthCheck;
 import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HttpHealthCheckList;
-import com.google.cloud.compute.v1.HttpHealthCheckName;
 import com.google.cloud.compute.v1.HttpHealthCheckSettings;
 import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHttpHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java
index 87f0f57f499e..a32e49795f3c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java
@@ -34,12 +34,12 @@
 import com.google.cloud.compute.v1.HttpHealthCheck;
 import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HttpHealthCheckList;
-import com.google.cloud.compute.v1.HttpHealthCheckName;
 import com.google.cloud.compute.v1.HttpHealthCheckSettings;
 import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHttpHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -72,7 +72,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HttpHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory())
                   .setResourceNameField("httpHealthCheck")
                   .build())
           .setResponseParser(
@@ -91,7 +91,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(HttpHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory())
                   .setResourceNameField("httpHealthCheck")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HttpHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory())
                   .setResourceNameField("httpHealthCheck")
                   .build())
           .setResponseParser(
@@ -171,7 +171,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HttpHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory())
                   .setResourceNameField("httpHealthCheck")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java
index bcdbe457fda3..081645642280 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java
@@ -45,12 +45,12 @@
 import com.google.cloud.compute.v1.HttpsHealthCheck;
 import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HttpsHealthCheckList;
-import com.google.cloud.compute.v1.HttpsHealthCheckName;
 import com.google.cloud.compute.v1.HttpsHealthCheckSettings;
 import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHttpsHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java
index af1341131283..9089d18dcd0a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java
@@ -34,12 +34,12 @@
 import com.google.cloud.compute.v1.HttpsHealthCheck;
 import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HttpsHealthCheckList;
-import com.google.cloud.compute.v1.HttpsHealthCheckName;
 import com.google.cloud.compute.v1.HttpsHealthCheckSettings;
 import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHttpsHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -72,7 +72,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HttpsHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory())
                   .setResourceNameField("httpsHealthCheck")
                   .build())
           .setResponseParser(
@@ -91,7 +91,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(HttpsHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory())
                   .setResourceNameField("httpsHealthCheck")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HttpsHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory())
                   .setResourceNameField("httpsHealthCheck")
                   .build())
           .setResponseParser(
@@ -171,7 +171,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(HttpsHealthCheckName.newFactory())
+                  .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory())
                   .setResourceNameField("httpsHealthCheck")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java
index 4cf158cb2851..648daabc08b4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java
@@ -43,18 +43,17 @@
 import com.google.cloud.compute.v1.DeleteImageHttpRequest;
 import com.google.cloud.compute.v1.DeprecateImageHttpRequest;
 import com.google.cloud.compute.v1.DeprecationStatus;
-import com.google.cloud.compute.v1.FamilyName;
 import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest;
 import com.google.cloud.compute.v1.GetImageHttpRequest;
 import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
 import com.google.cloud.compute.v1.Image;
 import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse;
 import com.google.cloud.compute.v1.ImageList;
-import com.google.cloud.compute.v1.ImageName;
 import com.google.cloud.compute.v1.ImageSettings;
 import com.google.cloud.compute.v1.InsertImageHttpRequest;
 import com.google.cloud.compute.v1.ListImagesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectFamilyName;
 import com.google.cloud.compute.v1.ProjectImageName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.SetLabelsImageHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java
index 7916420834f3..8048a460dd88 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java
@@ -32,18 +32,17 @@
 import com.google.cloud.compute.v1.DeleteImageHttpRequest;
 import com.google.cloud.compute.v1.DeprecateImageHttpRequest;
 import com.google.cloud.compute.v1.DeprecationStatus;
-import com.google.cloud.compute.v1.FamilyName;
 import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest;
 import com.google.cloud.compute.v1.GetImageHttpRequest;
 import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
 import com.google.cloud.compute.v1.Image;
 import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse;
 import com.google.cloud.compute.v1.ImageList;
-import com.google.cloud.compute.v1.ImageName;
 import com.google.cloud.compute.v1.ImageSettings;
 import com.google.cloud.compute.v1.InsertImageHttpRequest;
 import com.google.cloud.compute.v1.ListImagesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectFamilyName;
 import com.google.cloud.compute.v1.ProjectImageName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.SetLabelsImageHttpRequest;
@@ -77,7 +76,7 @@ public class HttpJsonImageStub extends ImageStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ImageName.newFactory())
+                  .setResourceNameFactory(ProjectImageName.newFactory())
                   .setResourceNameField("image")
                   .build())
           .setResponseParser(
@@ -97,7 +96,7 @@ public class HttpJsonImageStub extends ImageStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ImageName.newFactory())
+                  .setResourceNameFactory(ProjectImageName.newFactory())
                   .setResourceNameField("image")
                   .build())
           .setResponseParser(
@@ -116,7 +115,7 @@ public class HttpJsonImageStub extends ImageStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/images/{image}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(ImageName.newFactory())
+                  .setResourceNameFactory(ProjectImageName.newFactory())
                   .setResourceNameField("image")
                   .build())
           .setResponseParser(
@@ -135,7 +134,7 @@ public class HttpJsonImageStub extends ImageStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/images/family/{family}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(FamilyName.newFactory())
+                  .setResourceNameFactory(ProjectFamilyName.newFactory())
                   .setResourceNameField("family")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java
index 305097eb222a..0314f1d8a628 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java
@@ -58,7 +58,6 @@
 import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse;
 import com.google.cloud.compute.v1.InstanceList;
 import com.google.cloud.compute.v1.InstanceListReferrers;
-import com.google.cloud.compute.v1.InstanceName;
 import com.google.cloud.compute.v1.InstanceSettings;
 import com.google.cloud.compute.v1.InstancesScopedList;
 import com.google.cloud.compute.v1.InstancesSetLabelsRequest;
@@ -74,6 +73,7 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ProjectZoneInstanceName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.Reference;
 import com.google.cloud.compute.v1.ResetInstanceHttpRequest;
 import com.google.cloud.compute.v1.Scheduling;
@@ -94,7 +94,6 @@
 import com.google.cloud.compute.v1.Tags;
 import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest;
 import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java
index 293d754c49a3..c4611e17b7ea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java
@@ -51,7 +51,6 @@
 import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse;
 import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse;
 import com.google.cloud.compute.v1.InstanceGroupList;
-import com.google.cloud.compute.v1.InstanceGroupName;
 import com.google.cloud.compute.v1.InstanceGroupSettings;
 import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupsListInstances;
@@ -64,9 +63,10 @@
 import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneInstanceGroupName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest;
 import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java
index 68aa6f18d2da..73141d6b8759 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java
@@ -51,7 +51,6 @@
 import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse;
 import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse;
 import com.google.cloud.compute.v1.InstanceGroupManagerList;
-import com.google.cloud.compute.v1.InstanceGroupManagerName;
 import com.google.cloud.compute.v1.InstanceGroupManagerSettings;
 import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest;
@@ -64,11 +63,12 @@
 import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneInstanceGroupManagerName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java
index e81e92b39c6c..8a7182984827 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java
@@ -40,7 +40,6 @@
 import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse;
 import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse;
 import com.google.cloud.compute.v1.InstanceGroupManagerList;
-import com.google.cloud.compute.v1.InstanceGroupManagerName;
 import com.google.cloud.compute.v1.InstanceGroupManagerSettings;
 import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest;
@@ -53,11 +52,12 @@
 import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneInstanceGroupManagerName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -88,7 +88,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -128,7 +128,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -148,7 +148,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -167,7 +167,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -187,7 +187,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -207,7 +207,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -227,7 +227,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "order_by",    "pageToken"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -247,7 +247,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -267,7 +267,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId",    "size"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -287,7 +287,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
@@ -307,7 +307,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupManagerName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory())
                   .setResourceNameField("instanceGroupManager")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java
index d59dfe56eea8..8c617fb4f532 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java
@@ -40,7 +40,6 @@
 import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse;
 import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse;
 import com.google.cloud.compute.v1.InstanceGroupList;
-import com.google.cloud.compute.v1.InstanceGroupName;
 import com.google.cloud.compute.v1.InstanceGroupSettings;
 import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupsListInstances;
@@ -53,9 +52,10 @@
 import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneInstanceGroupName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest;
 import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -86,7 +86,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory())
                   .setResourceNameField("instanceGroup")
                   .build())
           .setResponseParser(
@@ -126,7 +126,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory())
                   .setResourceNameField("instanceGroup")
                   .build())
           .setResponseParser(
@@ -145,7 +145,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InstanceGroupName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory())
                   .setResourceNameField("instanceGroup")
                   .build())
           .setResponseParser(
@@ -165,7 +165,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -185,7 +185,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -205,7 +205,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(InstanceGroupName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory())
                   .setResourceNameField("instanceGroup")
                   .build())
           .setResponseParser(
@@ -225,7 +225,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory())
                   .setResourceNameField("instanceGroup")
                   .build())
           .setResponseParser(
@@ -245,7 +245,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceGroupName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory())
                   .setResourceNameField("instanceGroup")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java
index 57c1ce7fd0e9..c804819cccc5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java
@@ -47,7 +47,6 @@
 import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse;
 import com.google.cloud.compute.v1.InstanceList;
 import com.google.cloud.compute.v1.InstanceListReferrers;
-import com.google.cloud.compute.v1.InstanceName;
 import com.google.cloud.compute.v1.InstanceSettings;
 import com.google.cloud.compute.v1.InstancesScopedList;
 import com.google.cloud.compute.v1.InstancesSetLabelsRequest;
@@ -63,6 +62,7 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ProjectZoneInstanceName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.Reference;
 import com.google.cloud.compute.v1.ResetInstanceHttpRequest;
 import com.google.cloud.compute.v1.Scheduling;
@@ -83,7 +83,6 @@
 import com.google.cloud.compute.v1.Tags;
 import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest;
 import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -114,7 +113,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "networkInterface",    "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -154,7 +153,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -174,7 +173,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -194,7 +193,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "accessConfig",    "networkInterface",    "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -214,7 +213,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "deviceName",    "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -233,7 +232,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -253,7 +252,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "port",    "start"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -273,7 +272,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -293,7 +292,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -313,7 +312,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -333,7 +332,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -373,7 +372,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "autoDelete",    "deviceName",    "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -393,7 +392,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -413,7 +412,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -433,7 +432,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -453,7 +452,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -473,7 +472,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -493,7 +492,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -513,7 +512,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -533,7 +532,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -553,7 +552,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -573,7 +572,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -593,7 +592,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -613,7 +612,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "networkInterface",    "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
@@ -633,7 +632,7 @@ public class HttpJsonInstanceStub extends InstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "networkInterface",    "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneInstanceName.newFactory())
                   .setResourceNameField("instance")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java
index c5c267d0acd5..82089a05d878 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java
@@ -46,10 +46,10 @@
 import com.google.cloud.compute.v1.InstanceTemplate;
 import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse;
 import com.google.cloud.compute.v1.InstanceTemplateList;
-import com.google.cloud.compute.v1.InstanceTemplateName;
 import com.google.cloud.compute.v1.InstanceTemplateSettings;
 import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectInstanceTemplateName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java
index 63007b6646ac..53ee6b2ff05c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java
@@ -35,10 +35,10 @@
 import com.google.cloud.compute.v1.InstanceTemplate;
 import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse;
 import com.google.cloud.compute.v1.InstanceTemplateList;
-import com.google.cloud.compute.v1.InstanceTemplateName;
 import com.google.cloud.compute.v1.InstanceTemplateSettings;
 import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectInstanceTemplateName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -70,7 +70,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InstanceTemplateName.newFactory())
+                  .setResourceNameFactory(ProjectInstanceTemplateName.newFactory())
                   .setResourceNameField("instanceTemplate")
                   .build())
           .setResponseParser(
@@ -89,7 +89,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates/{instanceTemplate}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InstanceTemplateName.newFactory())
+                  .setResourceNameFactory(ProjectInstanceTemplateName.newFactory())
                   .setResourceNameField("instanceTemplate")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java
index 39ac86fcf328..efe3ec02bded 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java
@@ -49,13 +49,13 @@
 import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse;
 import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectAttachmentList;
-import com.google.cloud.compute.v1.InterconnectAttachmentName;
 import com.google.cloud.compute.v1.InterconnectAttachmentSettings;
 import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList;
 import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java
index d81d4c25f33b..3b236f40f7c1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java
@@ -38,13 +38,13 @@
 import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse;
 import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectAttachmentList;
-import com.google.cloud.compute.v1.InterconnectAttachmentName;
 import com.google.cloud.compute.v1.InterconnectAttachmentSettings;
 import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList;
 import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -95,7 +95,7 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InterconnectAttachmentName.newFactory())
+                  .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory())
                   .setResourceNameField("interconnectAttachment")
                   .build())
           .setResponseParser(
@@ -114,7 +114,7 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InterconnectAttachmentName.newFactory())
+                  .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory())
                   .setResourceNameField("interconnectAttachment")
                   .build())
           .setResponseParser(
@@ -134,7 +134,7 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -154,7 +154,7 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java
index 60465c5a1a7c..32c50938db04 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java
@@ -46,11 +46,11 @@
 import com.google.cloud.compute.v1.Interconnect;
 import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectList;
-import com.google.cloud.compute.v1.InterconnectName;
 import com.google.cloud.compute.v1.InterconnectSettings;
 import com.google.cloud.compute.v1.ListInterconnectsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchInterconnectHttpRequest;
+import com.google.cloud.compute.v1.ProjectInterconnectName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java
index f6aba354e52c..9db9396cbaef 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java
@@ -44,9 +44,9 @@
 import com.google.cloud.compute.v1.InterconnectLocation;
 import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectLocationList;
-import com.google.cloud.compute.v1.InterconnectLocationName;
 import com.google.cloud.compute.v1.InterconnectLocationSettings;
 import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest;
+import com.google.cloud.compute.v1.ProjectInterconnectLocationName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java
index 40733fd9918b..e6aac8e57c50 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java
@@ -33,9 +33,9 @@
 import com.google.cloud.compute.v1.InterconnectLocation;
 import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectLocationList;
-import com.google.cloud.compute.v1.InterconnectLocationName;
 import com.google.cloud.compute.v1.InterconnectLocationSettings;
 import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest;
+import com.google.cloud.compute.v1.ProjectInterconnectLocationName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -66,7 +66,7 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/interconnectLocations/{interconnectLocation}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InterconnectLocationName.newFactory())
+                  .setResourceNameFactory(ProjectInterconnectLocationName.newFactory())
                   .setResourceNameField("interconnectLocation")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java
index 288c05ff237a..f31810570295 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java
@@ -35,11 +35,11 @@
 import com.google.cloud.compute.v1.Interconnect;
 import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectList;
-import com.google.cloud.compute.v1.InterconnectName;
 import com.google.cloud.compute.v1.InterconnectSettings;
 import com.google.cloud.compute.v1.ListInterconnectsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchInterconnectHttpRequest;
+import com.google.cloud.compute.v1.ProjectInterconnectName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -71,7 +71,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InterconnectName.newFactory())
+                  .setResourceNameFactory(ProjectInterconnectName.newFactory())
                   .setResourceNameField("interconnect")
                   .build())
           .setResponseParser(
@@ -90,7 +90,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(InterconnectName.newFactory())
+                  .setResourceNameFactory(ProjectInterconnectName.newFactory())
                   .setResourceNameField("interconnect")
                   .build())
           .setResponseParser(
@@ -150,7 +150,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(InterconnectName.newFactory())
+                  .setResourceNameFactory(ProjectInterconnectName.newFactory())
                   .setResourceNameField("interconnect")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java
index a8d78e8140a9..7969daf63b82 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java
@@ -42,8 +42,8 @@
 import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.GetLicenseHttpRequest;
 import com.google.cloud.compute.v1.License;
-import com.google.cloud.compute.v1.LicenseName;
 import com.google.cloud.compute.v1.LicenseSettings;
+import com.google.cloud.compute.v1.ProjectLicenseName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import com.google.longrunning.Operation;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java
index 52349aed1cbe..a179bc818719 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java
@@ -31,8 +31,8 @@
 import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.GetLicenseHttpRequest;
 import com.google.cloud.compute.v1.License;
-import com.google.cloud.compute.v1.LicenseName;
 import com.google.cloud.compute.v1.LicenseSettings;
+import com.google.cloud.compute.v1.ProjectLicenseName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -62,7 +62,7 @@ public class HttpJsonLicenseStub extends LicenseStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(LicenseName.newFactory())
+                  .setResourceNameFactory(ProjectLicenseName.newFactory())
                   .setResourceNameField("license")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java
index a20d3a4d8604..601bccb80c19 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java
@@ -48,11 +48,11 @@
 import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse;
 import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse;
 import com.google.cloud.compute.v1.MachineTypeList;
-import com.google.cloud.compute.v1.MachineTypeName;
 import com.google.cloud.compute.v1.MachineTypeSettings;
 import com.google.cloud.compute.v1.MachineTypesScopedList;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneMachineTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import com.google.longrunning.Operation;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java
index 3295cab00f41..3100c8d3a90a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java
@@ -37,11 +37,11 @@
 import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse;
 import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse;
 import com.google.cloud.compute.v1.MachineTypeList;
-import com.google.cloud.compute.v1.MachineTypeName;
 import com.google.cloud.compute.v1.MachineTypeSettings;
 import com.google.cloud.compute.v1.MachineTypesScopedList;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneMachineTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -91,7 +91,7 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(MachineTypeName.newFactory())
+                  .setResourceNameFactory(ProjectZoneMachineTypeName.newFactory())
                   .setResourceNameField("machineType")
                   .build())
           .setResponseParser(
@@ -111,7 +111,7 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java
index b8403327301a..d02dfb08384b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java
@@ -48,13 +48,13 @@
 import com.google.cloud.compute.v1.Network;
 import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse;
 import com.google.cloud.compute.v1.NetworkList;
-import com.google.cloud.compute.v1.NetworkName;
 import com.google.cloud.compute.v1.NetworkSettings;
 import com.google.cloud.compute.v1.NetworksAddPeeringRequest;
 import com.google.cloud.compute.v1.NetworksRemovePeeringRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchNetworkHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectNetworkName;
 import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest;
 import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java
index 88aa318bf939..12159d6494a1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java
@@ -37,13 +37,13 @@
 import com.google.cloud.compute.v1.Network;
 import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse;
 import com.google.cloud.compute.v1.NetworkList;
-import com.google.cloud.compute.v1.NetworkName;
 import com.google.cloud.compute.v1.NetworkSettings;
 import com.google.cloud.compute.v1.NetworksAddPeeringRequest;
 import com.google.cloud.compute.v1.NetworksRemovePeeringRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchNetworkHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectNetworkName;
 import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest;
 import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -76,7 +76,7 @@ public class HttpJsonNetworkStub extends NetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(NetworkName.newFactory())
+                  .setResourceNameFactory(ProjectNetworkName.newFactory())
                   .setResourceNameField("network")
                   .build())
           .setResponseParser(
@@ -96,7 +96,7 @@ public class HttpJsonNetworkStub extends NetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(NetworkName.newFactory())
+                  .setResourceNameFactory(ProjectNetworkName.newFactory())
                   .setResourceNameField("network")
                   .build())
           .setResponseParser(
@@ -115,7 +115,7 @@ public class HttpJsonNetworkStub extends NetworkStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(NetworkName.newFactory())
+                  .setResourceNameFactory(ProjectNetworkName.newFactory())
                   .setResourceNameField("network")
                   .build())
           .setResponseParser(
@@ -175,7 +175,7 @@ public class HttpJsonNetworkStub extends NetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(NetworkName.newFactory())
+                  .setResourceNameFactory(ProjectNetworkName.newFactory())
                   .setResourceNameField("network")
                   .build())
           .setResponseParser(
@@ -195,7 +195,7 @@ public class HttpJsonNetworkStub extends NetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(NetworkName.newFactory())
+                  .setResourceNameFactory(ProjectNetworkName.newFactory())
                   .setResourceNameField("network")
                   .build())
           .setResponseParser(
@@ -215,7 +215,7 @@ public class HttpJsonNetworkStub extends NetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(NetworkName.newFactory())
+                  .setResourceNameFactory(ProjectNetworkName.newFactory())
                   .setResourceNameField("network")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java
index fcd290fceae8..990388814afd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java
@@ -48,10 +48,10 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.ProjectRegionAutoscalerName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.RegionAutoscalerList;
 import com.google.cloud.compute.v1.RegionAutoscalerSettings;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java
index a5edd12fdf0e..43c9a8548f8c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java
@@ -37,10 +37,10 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.ProjectRegionAutoscalerName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.RegionAutoscalerList;
 import com.google.cloud.compute.v1.RegionAutoscalerSettings;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -111,7 +111,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -131,7 +131,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "autoscaler",    "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -171,7 +171,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub {
                   .setQueryParams(Sets.newHashSet(
                                      "autoscaler",    "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java
index 0b8932b4676b..b2c006b2957a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java
@@ -51,9 +51,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.ProjectRegionBackendServiceName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse;
 import com.google.cloud.compute.v1.RegionBackendServiceSettings;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.ResourceGroupReference;
 import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java
index 74cd83124995..924ba902d627 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java
@@ -40,9 +40,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.ProjectRegionBackendServiceName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse;
 import com.google.cloud.compute.v1.RegionBackendServiceSettings;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.ResourceGroupReference;
 import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest;
 import com.google.common.collect.ImmutableMap;
@@ -133,7 +133,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -153,7 +153,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java
index ce7ecaa68e00..232307c4a396 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java
@@ -43,10 +43,10 @@
 import com.google.cloud.compute.v1.GetRegionHttpRequest;
 import com.google.cloud.compute.v1.ListRegionsHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.Region;
 import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse;
 import com.google.cloud.compute.v1.RegionList;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.RegionSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java
index 67eacc9323cb..7c9b830fd6ab 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java
@@ -44,17 +44,17 @@
 import com.google.cloud.compute.v1.Commitment;
 import com.google.cloud.compute.v1.CommitmentAggregatedList;
 import com.google.cloud.compute.v1.CommitmentList;
-import com.google.cloud.compute.v1.CommitmentName;
 import com.google.cloud.compute.v1.CommitmentsScopedList;
 import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest;
 import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest;
 import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRegionCommitmentName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse;
 import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse;
 import com.google.cloud.compute.v1.RegionCommitmentSettings;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java
index 7f1461bf6542..2db31d476c79 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java
@@ -33,17 +33,17 @@
 import com.google.cloud.compute.v1.Commitment;
 import com.google.cloud.compute.v1.CommitmentAggregatedList;
 import com.google.cloud.compute.v1.CommitmentList;
-import com.google.cloud.compute.v1.CommitmentName;
 import com.google.cloud.compute.v1.CommitmentsScopedList;
 import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest;
 import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest;
 import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRegionCommitmentName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse;
 import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse;
 import com.google.cloud.compute.v1.RegionCommitmentSettings;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -93,7 +93,7 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments/{commitment}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(CommitmentName.newFactory())
+                  .setResourceNameFactory(ProjectRegionCommitmentName.newFactory())
                   .setResourceNameField("commitment")
                   .build())
           .setResponseParser(
@@ -113,7 +113,7 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -133,7 +133,7 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java
index 9e211fa13df9..af939575c892 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java
@@ -47,6 +47,7 @@
 import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse;
 import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse;
 import com.google.cloud.compute.v1.RegionInstanceGroupList;
@@ -54,7 +55,6 @@
 import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances;
 import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java
index dadd8de78e82..746fed18200f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java
@@ -50,6 +50,7 @@
 import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest;
 import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagerList;
@@ -60,7 +61,6 @@
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java
index cc5f86a0b7d0..b6b19cbb1837 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java
@@ -39,6 +39,7 @@
 import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest;
 import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagerList;
@@ -49,7 +50,6 @@
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest;
@@ -162,7 +162,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -182,7 +182,7 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java
index 02d93942d7ee..fc42530d8f6d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java
@@ -36,6 +36,7 @@
 import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse;
 import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse;
 import com.google.cloud.compute.v1.RegionInstanceGroupList;
@@ -43,7 +44,6 @@
 import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances;
 import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -94,7 +94,7 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java
index 74b59d8d3702..a18d1af2fa12 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java
@@ -45,8 +45,8 @@
 import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationList;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.ProjectRegionOperationName;
-import com.google.cloud.compute.v1.RegionName;
 import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse;
 import com.google.cloud.compute.v1.RegionOperationSettings;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java
index 529fb39840d3..5c9e69a114f2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java
@@ -34,8 +34,8 @@
 import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationList;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.ProjectRegionOperationName;
-import com.google.cloud.compute.v1.RegionName;
 import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse;
 import com.google.cloud.compute.v1.RegionOperationSettings;
 import com.google.common.collect.ImmutableMap;
@@ -102,7 +102,7 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java
index 38b7b52369a0..791ac0368856 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java
@@ -32,10 +32,10 @@
 import com.google.cloud.compute.v1.GetRegionHttpRequest;
 import com.google.cloud.compute.v1.ListRegionsHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.Region;
 import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse;
 import com.google.cloud.compute.v1.RegionList;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.RegionSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -66,7 +66,7 @@ public class HttpJsonRegionStub extends RegionStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java
index d0af233c5651..01d1d5cbf69e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java
@@ -46,10 +46,10 @@
 import com.google.cloud.compute.v1.ListRoutesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRouteName;
 import com.google.cloud.compute.v1.Route;
 import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse;
 import com.google.cloud.compute.v1.RouteList;
-import com.google.cloud.compute.v1.RouteName;
 import com.google.cloud.compute.v1.RouteSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java
index 7bb53b6590f4..5dd1c0701fbd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java
@@ -35,10 +35,10 @@
 import com.google.cloud.compute.v1.ListRoutesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRouteName;
 import com.google.cloud.compute.v1.Route;
 import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse;
 import com.google.cloud.compute.v1.RouteList;
-import com.google.cloud.compute.v1.RouteName;
 import com.google.cloud.compute.v1.RouteSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -70,7 +70,7 @@ public class HttpJsonRouteStub extends RouteStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RouteName.newFactory())
+                  .setResourceNameFactory(ProjectRouteName.newFactory())
                   .setResourceNameField("route")
                   .build())
           .setResponseParser(
@@ -89,7 +89,7 @@ public class HttpJsonRouteStub extends RouteStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(RouteName.newFactory())
+                  .setResourceNameFactory(ProjectRouteName.newFactory())
                   .setResourceNameField("route")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java
index e1c1a0f1e5db..b18b7cf98d4e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java
@@ -50,13 +50,13 @@
 import com.google.cloud.compute.v1.PatchRouterHttpRequest;
 import com.google.cloud.compute.v1.PreviewRouterHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionRouterName;
 import com.google.cloud.compute.v1.Router;
 import com.google.cloud.compute.v1.RouterAggregatedList;
 import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse;
 import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse;
 import com.google.cloud.compute.v1.RouterList;
-import com.google.cloud.compute.v1.RouterName;
 import com.google.cloud.compute.v1.RouterSettings;
 import com.google.cloud.compute.v1.RouterStatusResponse;
 import com.google.cloud.compute.v1.RoutersPreviewResponse;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java
index 18a36c10fefe..79c7ec9c3454 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java
@@ -39,13 +39,13 @@
 import com.google.cloud.compute.v1.PatchRouterHttpRequest;
 import com.google.cloud.compute.v1.PreviewRouterHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionRouterName;
 import com.google.cloud.compute.v1.Router;
 import com.google.cloud.compute.v1.RouterAggregatedList;
 import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse;
 import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse;
 import com.google.cloud.compute.v1.RouterList;
-import com.google.cloud.compute.v1.RouterName;
 import com.google.cloud.compute.v1.RouterSettings;
 import com.google.cloud.compute.v1.RouterStatusResponse;
 import com.google.cloud.compute.v1.RoutersPreviewResponse;
@@ -101,7 +101,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RouterName.newFactory())
+                  .setResourceNameFactory(ProjectRegionRouterName.newFactory())
                   .setResourceNameField("router")
                   .build())
           .setResponseParser(
@@ -120,7 +120,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(RouterName.newFactory())
+                  .setResourceNameFactory(ProjectRegionRouterName.newFactory())
                   .setResourceNameField("router")
                   .build())
           .setResponseParser(
@@ -139,7 +139,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}/getRouterStatus"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(RouterName.newFactory())
+                  .setResourceNameFactory(ProjectRegionRouterName.newFactory())
                   .setResourceNameField("router")
                   .build())
           .setResponseParser(
@@ -159,7 +159,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -179,7 +179,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -199,7 +199,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RouterName.newFactory())
+                  .setResourceNameFactory(ProjectRegionRouterName.newFactory())
                   .setResourceNameField("router")
                   .build())
           .setResponseParser(
@@ -218,7 +218,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}/preview"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(RouterName.newFactory())
+                  .setResourceNameFactory(ProjectRegionRouterName.newFactory())
                   .setResourceNameField("router")
                   .build())
           .setResponseParser(
@@ -238,7 +238,7 @@ public class HttpJsonRouterStub extends RouterStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RouterName.newFactory())
+                  .setResourceNameFactory(ProjectRegionRouterName.newFactory())
                   .setResourceNameField("router")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java
index e8dfc05ce3fb..c982c2ffe9b1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java
@@ -51,7 +51,6 @@
 import com.google.cloud.compute.v1.Snapshot;
 import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse;
 import com.google.cloud.compute.v1.SnapshotList;
-import com.google.cloud.compute.v1.SnapshotName;
 import com.google.cloud.compute.v1.SnapshotSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java
index 6c648fccfc37..78172a7893d7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java
@@ -40,7 +40,6 @@
 import com.google.cloud.compute.v1.Snapshot;
 import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse;
 import com.google.cloud.compute.v1.SnapshotList;
-import com.google.cloud.compute.v1.SnapshotName;
 import com.google.cloud.compute.v1.SnapshotSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -72,7 +71,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(SnapshotName.newFactory())
+                  .setResourceNameFactory(ProjectSnapshotName.newFactory())
                   .setResourceNameField("snapshot")
                   .build())
           .setResponseParser(
@@ -91,7 +90,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(SnapshotName.newFactory())
+                  .setResourceNameFactory(ProjectSnapshotName.newFactory())
                   .setResourceNameField("snapshot")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java
index 7f472fa98e0e..4179672ce850 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java
@@ -46,10 +46,10 @@
 import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectSslCertificateName;
 import com.google.cloud.compute.v1.SslCertificate;
 import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse;
 import com.google.cloud.compute.v1.SslCertificateList;
-import com.google.cloud.compute.v1.SslCertificateName;
 import com.google.cloud.compute.v1.SslCertificateSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java
index 204a4671c6c3..04d16fc1d370 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java
@@ -35,10 +35,10 @@
 import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectSslCertificateName;
 import com.google.cloud.compute.v1.SslCertificate;
 import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse;
 import com.google.cloud.compute.v1.SslCertificateList;
-import com.google.cloud.compute.v1.SslCertificateName;
 import com.google.cloud.compute.v1.SslCertificateSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -70,7 +70,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(SslCertificateName.newFactory())
+                  .setResourceNameFactory(ProjectSslCertificateName.newFactory())
                   .setResourceNameField("sslCertificate")
                   .build())
           .setResponseParser(
@@ -89,7 +89,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(SslCertificateName.newFactory())
+                  .setResourceNameFactory(ProjectSslCertificateName.newFactory())
                   .setResourceNameField("sslCertificate")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java
index 6494d889a56f..bc4579f92d2c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java
@@ -49,14 +49,14 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionSubnetworkName;
 import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest;
 import com.google.cloud.compute.v1.Subnetwork;
 import com.google.cloud.compute.v1.SubnetworkAggregatedList;
 import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse;
 import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse;
 import com.google.cloud.compute.v1.SubnetworkList;
-import com.google.cloud.compute.v1.SubnetworkName;
 import com.google.cloud.compute.v1.SubnetworkSettings;
 import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest;
 import com.google.cloud.compute.v1.SubnetworksScopedList;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java
index 840bc96b3891..32ec4d01710e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java
@@ -38,14 +38,14 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionSubnetworkName;
 import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest;
 import com.google.cloud.compute.v1.Subnetwork;
 import com.google.cloud.compute.v1.SubnetworkAggregatedList;
 import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse;
 import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse;
 import com.google.cloud.compute.v1.SubnetworkList;
-import com.google.cloud.compute.v1.SubnetworkName;
 import com.google.cloud.compute.v1.SubnetworkSettings;
 import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest;
 import com.google.cloud.compute.v1.SubnetworksScopedList;
@@ -100,7 +100,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(SubnetworkName.newFactory())
+                  .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory())
                   .setResourceNameField("subnetwork")
                   .build())
           .setResponseParser(
@@ -120,7 +120,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(SubnetworkName.newFactory())
+                  .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory())
                   .setResourceNameField("subnetwork")
                   .build())
           .setResponseParser(
@@ -139,7 +139,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(SubnetworkName.newFactory())
+                  .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory())
                   .setResourceNameField("subnetwork")
                   .build())
           .setResponseParser(
@@ -159,7 +159,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -179,7 +179,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -199,7 +199,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(SubnetworkName.newFactory())
+                  .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory())
                   .setResourceNameField("subnetwork")
                   .build())
           .setResponseParser(
@@ -219,7 +219,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(SubnetworkName.newFactory())
+                  .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory())
                   .setResourceNameField("subnetwork")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java
index 2acdd04ec37b..5914152fbb5a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java
@@ -46,11 +46,11 @@
 import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetHttpProxyName;
 import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetHttpProxy;
 import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetHttpProxyList;
-import com.google.cloud.compute.v1.TargetHttpProxyName;
 import com.google.cloud.compute.v1.TargetHttpProxySettings;
 import com.google.cloud.compute.v1.UrlMapReference;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java
index bda7b730d96f..7134ad75e01d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java
@@ -35,11 +35,11 @@
 import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetHttpProxyName;
 import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetHttpProxy;
 import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetHttpProxyList;
-import com.google.cloud.compute.v1.TargetHttpProxyName;
 import com.google.cloud.compute.v1.TargetHttpProxySettings;
 import com.google.cloud.compute.v1.UrlMapReference;
 import com.google.common.collect.ImmutableMap;
@@ -72,7 +72,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetHttpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory())
                   .setResourceNameField("targetHttpProxy")
                   .build())
           .setResponseParser(
@@ -91,7 +91,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies/{targetHttpProxy}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetHttpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory())
                   .setResourceNameField("targetHttpProxy")
                   .build())
           .setResponseParser(
@@ -151,7 +151,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetHttpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory())
                   .setResourceNameField("targetHttpProxy")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java
index 5d01e27d6c23..e3f538e6d3b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java
@@ -46,13 +46,13 @@
 import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName;
 import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest;
 import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest;
 import com.google.cloud.compute.v1.TargetHttpsProxy;
 import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetHttpsProxyList;
-import com.google.cloud.compute.v1.TargetHttpsProxyName;
 import com.google.cloud.compute.v1.TargetHttpsProxySettings;
 import com.google.cloud.compute.v1.UrlMapReference;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java
index d58c952bc385..257ed3feb370 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java
@@ -35,13 +35,13 @@
 import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName;
 import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest;
 import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest;
 import com.google.cloud.compute.v1.TargetHttpsProxy;
 import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetHttpsProxyList;
-import com.google.cloud.compute.v1.TargetHttpsProxyName;
 import com.google.cloud.compute.v1.TargetHttpsProxySettings;
 import com.google.cloud.compute.v1.UrlMapReference;
 import com.google.common.collect.ImmutableMap;
@@ -74,7 +74,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetHttpsProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory())
                   .setResourceNameField("targetHttpsProxy")
                   .build())
           .setResponseParser(
@@ -93,7 +93,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies/{targetHttpsProxy}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetHttpsProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory())
                   .setResourceNameField("targetHttpsProxy")
                   .build())
           .setResponseParser(
@@ -153,7 +153,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetHttpsProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory())
                   .setResourceNameField("targetHttpsProxy")
                   .build())
           .setResponseParser(
@@ -173,7 +173,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetHttpsProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory())
                   .setResourceNameField("targetHttpsProxy")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java
index 1d0ca0cd7341..33f289c7d9b4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java
@@ -47,15 +47,15 @@
 import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneName;
+import com.google.cloud.compute.v1.ProjectZoneTargetInstanceName;
 import com.google.cloud.compute.v1.TargetInstance;
 import com.google.cloud.compute.v1.TargetInstanceAggregatedList;
 import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse;
 import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse;
 import com.google.cloud.compute.v1.TargetInstanceList;
-import com.google.cloud.compute.v1.TargetInstanceName;
 import com.google.cloud.compute.v1.TargetInstanceSettings;
 import com.google.cloud.compute.v1.TargetInstancesScopedList;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java
index 1c5b327f24d7..2e3016aa13f2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java
@@ -36,15 +36,15 @@
 import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneName;
+import com.google.cloud.compute.v1.ProjectZoneTargetInstanceName;
 import com.google.cloud.compute.v1.TargetInstance;
 import com.google.cloud.compute.v1.TargetInstanceAggregatedList;
 import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse;
 import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse;
 import com.google.cloud.compute.v1.TargetInstanceList;
-import com.google.cloud.compute.v1.TargetInstanceName;
 import com.google.cloud.compute.v1.TargetInstanceSettings;
 import com.google.cloud.compute.v1.TargetInstancesScopedList;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import java.io.IOException;
@@ -95,7 +95,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetInstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneTargetInstanceName.newFactory())
                   .setResourceNameField("targetInstance")
                   .build())
           .setResponseParser(
@@ -114,7 +114,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances/{targetInstance}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetInstanceName.newFactory())
+                  .setResourceNameFactory(ProjectZoneTargetInstanceName.newFactory())
                   .setResourceNameField("targetInstance")
                   .build())
           .setResponseParser(
@@ -134,7 +134,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
@@ -154,7 +154,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java
index 186870c31e0f..22502615bf51 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java
@@ -51,7 +51,8 @@
 import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionTargetPoolName;
 import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest;
 import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest;
 import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest;
@@ -61,7 +62,6 @@
 import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse;
 import com.google.cloud.compute.v1.TargetPoolInstanceHealth;
 import com.google.cloud.compute.v1.TargetPoolList;
-import com.google.cloud.compute.v1.TargetPoolName;
 import com.google.cloud.compute.v1.TargetPoolSettings;
 import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest;
 import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java
index 86182101cbfc..6b8de1db055a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java
@@ -40,7 +40,8 @@
 import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionTargetPoolName;
 import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest;
 import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest;
 import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest;
@@ -50,7 +51,6 @@
 import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse;
 import com.google.cloud.compute.v1.TargetPoolInstanceHealth;
 import com.google.cloud.compute.v1.TargetPoolList;
-import com.google.cloud.compute.v1.TargetPoolName;
 import com.google.cloud.compute.v1.TargetPoolSettings;
 import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest;
 import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest;
@@ -88,7 +88,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -108,7 +108,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -148,7 +148,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -167,7 +167,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -186,7 +186,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/getHealth"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -206,7 +206,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -226,7 +226,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -246,7 +246,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -266,7 +266,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
@@ -286,7 +286,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub {
                   .setQueryParams(Sets.newHashSet(
                                      "failoverRatio",    "requestId"
                                      ))
-                  .setResourceNameFactory(TargetPoolName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory())
                   .setResourceNameField("targetPool")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java
index 1144cb66a456..e4a54b709aca 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java
@@ -46,6 +46,7 @@
 import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetSslProxyName;
 import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest;
 import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest;
 import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest;
@@ -55,7 +56,6 @@
 import com.google.cloud.compute.v1.TargetSslProxy;
 import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetSslProxyList;
-import com.google.cloud.compute.v1.TargetSslProxyName;
 import com.google.cloud.compute.v1.TargetSslProxySettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java
index 746448a68fd5..8c8a6df99098 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java
@@ -35,6 +35,7 @@
 import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetSslProxyName;
 import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest;
 import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest;
 import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest;
@@ -44,7 +45,6 @@
 import com.google.cloud.compute.v1.TargetSslProxy;
 import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetSslProxyList;
-import com.google.cloud.compute.v1.TargetSslProxyName;
 import com.google.cloud.compute.v1.TargetSslProxySettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -76,7 +76,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetSslProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetSslProxyName.newFactory())
                   .setResourceNameField("targetSslProxy")
                   .build())
           .setResponseParser(
@@ -95,7 +95,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetSslProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetSslProxyName.newFactory())
                   .setResourceNameField("targetSslProxy")
                   .build())
           .setResponseParser(
@@ -155,7 +155,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetSslProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetSslProxyName.newFactory())
                   .setResourceNameField("targetSslProxy")
                   .build())
           .setResponseParser(
@@ -175,7 +175,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetSslProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetSslProxyName.newFactory())
                   .setResourceNameField("targetSslProxy")
                   .build())
           .setResponseParser(
@@ -195,7 +195,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetSslProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetSslProxyName.newFactory())
                   .setResourceNameField("targetSslProxy")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java
index 536e9d64bda1..fae5145d52db 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java
@@ -46,6 +46,7 @@
 import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetTcpProxyName;
 import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest;
 import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest;
@@ -53,7 +54,6 @@
 import com.google.cloud.compute.v1.TargetTcpProxy;
 import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetTcpProxyList;
-import com.google.cloud.compute.v1.TargetTcpProxyName;
 import com.google.cloud.compute.v1.TargetTcpProxySettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java
index c56474fd61c6..ccbf35f8ce07 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java
@@ -35,6 +35,7 @@
 import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetTcpProxyName;
 import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest;
 import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest;
@@ -42,7 +43,6 @@
 import com.google.cloud.compute.v1.TargetTcpProxy;
 import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetTcpProxyList;
-import com.google.cloud.compute.v1.TargetTcpProxyName;
 import com.google.cloud.compute.v1.TargetTcpProxySettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -74,7 +74,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetTcpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory())
                   .setResourceNameField("targetTcpProxy")
                   .build())
           .setResponseParser(
@@ -93,7 +93,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetTcpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory())
                   .setResourceNameField("targetTcpProxy")
                   .build())
           .setResponseParser(
@@ -153,7 +153,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetTcpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory())
                   .setResourceNameField("targetTcpProxy")
                   .build())
           .setResponseParser(
@@ -173,7 +173,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetTcpProxyName.newFactory())
+                  .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory())
                   .setResourceNameField("targetTcpProxy")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java
index 129100fa1e58..63220ce29ad0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java
@@ -47,13 +47,13 @@
 import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionTargetVpnGatewayName;
 import com.google.cloud.compute.v1.TargetVpnGateway;
 import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList;
 import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse;
 import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse;
 import com.google.cloud.compute.v1.TargetVpnGatewayList;
-import com.google.cloud.compute.v1.TargetVpnGatewayName;
 import com.google.cloud.compute.v1.TargetVpnGatewaySettings;
 import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java
index 63bdda81e43b..f12af34d92a1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java
@@ -36,13 +36,13 @@
 import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionTargetVpnGatewayName;
 import com.google.cloud.compute.v1.TargetVpnGateway;
 import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList;
 import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse;
 import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse;
 import com.google.cloud.compute.v1.TargetVpnGatewayList;
-import com.google.cloud.compute.v1.TargetVpnGatewayName;
 import com.google.cloud.compute.v1.TargetVpnGatewaySettings;
 import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList;
 import com.google.common.collect.ImmutableMap;
@@ -95,7 +95,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(TargetVpnGatewayName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetVpnGatewayName.newFactory())
                   .setResourceNameField("targetVpnGateway")
                   .build())
           .setResponseParser(
@@ -114,7 +114,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(TargetVpnGatewayName.newFactory())
+                  .setResourceNameFactory(ProjectRegionTargetVpnGatewayName.newFactory())
                   .setResourceNameField("targetVpnGateway")
                   .build())
           .setResponseParser(
@@ -134,7 +134,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -154,7 +154,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java
index 3eb4808078de..4d472fe1133a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java
@@ -49,11 +49,11 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchUrlMapHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectUrlMapName;
 import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest;
 import com.google.cloud.compute.v1.UrlMap;
 import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse;
 import com.google.cloud.compute.v1.UrlMapList;
-import com.google.cloud.compute.v1.UrlMapName;
 import com.google.cloud.compute.v1.UrlMapSettings;
 import com.google.cloud.compute.v1.UrlMapsValidateRequest;
 import com.google.cloud.compute.v1.UrlMapsValidateResponse;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java
index 3e4ea51b2baa..ed4d8dddb18a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java
@@ -38,11 +38,11 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchUrlMapHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectUrlMapName;
 import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest;
 import com.google.cloud.compute.v1.UrlMap;
 import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse;
 import com.google.cloud.compute.v1.UrlMapList;
-import com.google.cloud.compute.v1.UrlMapName;
 import com.google.cloud.compute.v1.UrlMapSettings;
 import com.google.cloud.compute.v1.UrlMapsValidateRequest;
 import com.google.cloud.compute.v1.UrlMapsValidateResponse;
@@ -77,7 +77,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(UrlMapName.newFactory())
+                  .setResourceNameFactory(ProjectUrlMapName.newFactory())
                   .setResourceNameField("urlMap")
                   .build())
           .setResponseParser(
@@ -96,7 +96,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(UrlMapName.newFactory())
+                  .setResourceNameFactory(ProjectUrlMapName.newFactory())
                   .setResourceNameField("urlMap")
                   .build())
           .setResponseParser(
@@ -136,7 +136,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(UrlMapName.newFactory())
+                  .setResourceNameFactory(ProjectUrlMapName.newFactory())
                   .setResourceNameField("urlMap")
                   .build())
           .setResponseParser(
@@ -176,7 +176,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(UrlMapName.newFactory())
+                  .setResourceNameFactory(ProjectUrlMapName.newFactory())
                   .setResourceNameField("urlMap")
                   .build())
           .setResponseParser(
@@ -196,7 +196,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(UrlMapName.newFactory())
+                  .setResourceNameFactory(ProjectUrlMapName.newFactory())
                   .setResourceNameField("urlMap")
                   .build())
           .setResponseParser(
@@ -215,7 +215,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub {
                   .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(UrlMapName.newFactory())
+                  .setResourceNameFactory(ProjectUrlMapName.newFactory())
                   .setResourceNameField("urlMap")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java
index 2a68d72a1729..cb0e4b0ae0cd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java
@@ -47,13 +47,13 @@
 import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionVpnTunnelName;
 import com.google.cloud.compute.v1.VpnTunnel;
 import com.google.cloud.compute.v1.VpnTunnelAggregatedList;
 import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse;
 import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse;
 import com.google.cloud.compute.v1.VpnTunnelList;
-import com.google.cloud.compute.v1.VpnTunnelName;
 import com.google.cloud.compute.v1.VpnTunnelSettings;
 import com.google.cloud.compute.v1.VpnTunnelsScopedList;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java
index 6f2bde9206e7..af64a086aafa 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java
@@ -36,13 +36,13 @@
 import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionVpnTunnelName;
 import com.google.cloud.compute.v1.VpnTunnel;
 import com.google.cloud.compute.v1.VpnTunnelAggregatedList;
 import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse;
 import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse;
 import com.google.cloud.compute.v1.VpnTunnelList;
-import com.google.cloud.compute.v1.VpnTunnelName;
 import com.google.cloud.compute.v1.VpnTunnelSettings;
 import com.google.cloud.compute.v1.VpnTunnelsScopedList;
 import com.google.common.collect.ImmutableMap;
@@ -95,7 +95,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(VpnTunnelName.newFactory())
+                  .setResourceNameFactory(ProjectRegionVpnTunnelName.newFactory())
                   .setResourceNameField("vpnTunnel")
                   .build())
           .setResponseParser(
@@ -114,7 +114,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub {
                   .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(VpnTunnelName.newFactory())
+                  .setResourceNameFactory(ProjectRegionVpnTunnelName.newFactory())
                   .setResourceNameField("vpnTunnel")
                   .build())
           .setResponseParser(
@@ -134,7 +134,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub {
                   .setQueryParams(Sets.newHashSet(
                                      "requestId"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
@@ -154,7 +154,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(RegionName.newFactory())
+                  .setResourceNameFactory(ProjectRegionName.newFactory())
                   .setResourceNameField("region")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java
index e4d5d1ccc44c..2290fa468058 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java
@@ -43,10 +43,10 @@
 import com.google.cloud.compute.v1.GetZoneHttpRequest;
 import com.google.cloud.compute.v1.ListZonesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.Zone;
 import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse;
 import com.google.cloud.compute.v1.ZoneList;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.cloud.compute.v1.ZoneSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java
index d9a0764865e6..4faff1a7a862 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java
@@ -45,8 +45,8 @@
 import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationList;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ProjectZoneOperationName;
-import com.google.cloud.compute.v1.ZoneName;
 import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
 import com.google.cloud.compute.v1.ZoneOperationSettings;
 import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java
index 7c7e14d7983f..3bb63d2625c2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java
@@ -34,8 +34,8 @@
 import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationList;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ProjectZoneOperationName;
-import com.google.cloud.compute.v1.ZoneName;
 import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
 import com.google.cloud.compute.v1.ZoneOperationSettings;
 import com.google.common.collect.ImmutableMap;
@@ -102,7 +102,7 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub {
                   .setQueryParams(Sets.newHashSet(
                                      "filter",    "maxResults",    "orderBy",    "pageToken"
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java
index 9a5408247a45..66e5deb10657 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java
@@ -32,10 +32,10 @@
 import com.google.cloud.compute.v1.GetZoneHttpRequest;
 import com.google.cloud.compute.v1.ListZonesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.Zone;
 import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse;
 import com.google.cloud.compute.v1.ZoneList;
-import com.google.cloud.compute.v1.ZoneName;
 import com.google.cloud.compute.v1.ZoneSettings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -66,7 +66,7 @@ public class HttpJsonZoneStub extends ZoneStub {
                   .setPathTemplate(PathTemplate.create("{project}/zones/{zone}"))
                   .setQueryParams(Sets.newHashSet(
                                      ))
-                  .setResourceNameFactory(ZoneName.newFactory())
+                  .setResourceNameFactory(ProjectZoneName.newFactory())
                   .setResourceNameField("zone")
                   .build())
           .setResponseParser(
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java
index ab60bba1ebd6..2ab2bf21bb75 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java
@@ -23,11 +23,11 @@
 import com.google.cloud.compute.v1.HttpsHealthCheck;
 import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.HttpsHealthCheckList;
-import com.google.cloud.compute.v1.HttpsHealthCheckName;
 import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest;
 import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest;
+import com.google.cloud.compute.v1.ProjectHttpsHealthCheckName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java
index 821f0fb5493c..83fa80866769 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java
@@ -21,17 +21,16 @@
 import com.google.cloud.compute.v1.DeleteImageHttpRequest;
 import com.google.cloud.compute.v1.DeprecateImageHttpRequest;
 import com.google.cloud.compute.v1.DeprecationStatus;
-import com.google.cloud.compute.v1.FamilyName;
 import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest;
 import com.google.cloud.compute.v1.GetImageHttpRequest;
 import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
 import com.google.cloud.compute.v1.Image;
 import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse;
 import com.google.cloud.compute.v1.ImageList;
-import com.google.cloud.compute.v1.ImageName;
 import com.google.cloud.compute.v1.InsertImageHttpRequest;
 import com.google.cloud.compute.v1.ListImagesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectFamilyName;
 import com.google.cloud.compute.v1.ProjectImageName;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.SetLabelsImageHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java
index 997265cd530c..a6cf4123ee89 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java
@@ -29,7 +29,6 @@
 import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse;
 import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse;
 import com.google.cloud.compute.v1.InstanceGroupManagerList;
-import com.google.cloud.compute.v1.InstanceGroupManagerName;
 import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse;
@@ -41,11 +40,12 @@
 import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneInstanceGroupManagerName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java
index 11dffda5776b..0efb1ba1aecf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java
@@ -29,7 +29,6 @@
 import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse;
 import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse;
 import com.google.cloud.compute.v1.InstanceGroupList;
-import com.google.cloud.compute.v1.InstanceGroupName;
 import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest;
 import com.google.cloud.compute.v1.InstanceGroupsListInstances;
 import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest;
@@ -41,9 +40,10 @@
 import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneInstanceGroupName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest;
 import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java
index f6b5db588bd4..b57e62973011 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java
@@ -36,7 +36,6 @@
 import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse;
 import com.google.cloud.compute.v1.InstanceList;
 import com.google.cloud.compute.v1.InstanceListReferrers;
-import com.google.cloud.compute.v1.InstanceName;
 import com.google.cloud.compute.v1.InstancesScopedList;
 import com.google.cloud.compute.v1.InstancesSetLabelsRequest;
 import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest;
@@ -51,6 +50,7 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ProjectZoneInstanceName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.Reference;
 import com.google.cloud.compute.v1.ResetInstanceHttpRequest;
 import com.google.cloud.compute.v1.Scheduling;
@@ -71,7 +71,6 @@
 import com.google.cloud.compute.v1.Tags;
 import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest;
 import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest;
-import com.google.cloud.compute.v1.ZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java
index 4f032e7eab27..2975c6978c93 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java
@@ -24,9 +24,9 @@
 import com.google.cloud.compute.v1.InstanceTemplate;
 import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse;
 import com.google.cloud.compute.v1.InstanceTemplateList;
-import com.google.cloud.compute.v1.InstanceTemplateName;
 import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ProjectInstanceTemplateName;
 import com.google.cloud.compute.v1.ProjectName;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java
index 4f09b76ddb01..1a737f7e4b5f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java
@@ -27,12 +27,12 @@
 import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse;
 import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectAttachmentList;
-import com.google.cloud.compute.v1.InterconnectAttachmentName;
 import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList;
 import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java
index 2935202ce006..d9f13458b918 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java
@@ -22,8 +22,8 @@
 import com.google.cloud.compute.v1.InterconnectLocation;
 import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectLocationList;
-import com.google.cloud.compute.v1.InterconnectLocationName;
 import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest;
+import com.google.cloud.compute.v1.ProjectInterconnectLocationName;
 import com.google.cloud.compute.v1.ProjectName;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java
index 179187f32dcd..c2309e90613a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java
@@ -24,10 +24,10 @@
 import com.google.cloud.compute.v1.Interconnect;
 import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse;
 import com.google.cloud.compute.v1.InterconnectList;
-import com.google.cloud.compute.v1.InterconnectName;
 import com.google.cloud.compute.v1.ListInterconnectsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchInterconnectHttpRequest;
+import com.google.cloud.compute.v1.ProjectInterconnectName;
 import com.google.cloud.compute.v1.ProjectName;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java
index 70279de3e4ea..217cfac7d791 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java
@@ -20,7 +20,7 @@
 import com.google.api.gax.rpc.UnaryCallable;
 import com.google.cloud.compute.v1.GetLicenseHttpRequest;
 import com.google.cloud.compute.v1.License;
-import com.google.cloud.compute.v1.LicenseName;
+import com.google.cloud.compute.v1.ProjectLicenseName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java
index 4c6e9eed2a9f..725b4d26e3e3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java
@@ -26,10 +26,10 @@
 import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse;
 import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse;
 import com.google.cloud.compute.v1.MachineTypeList;
-import com.google.cloud.compute.v1.MachineTypeName;
 import com.google.cloud.compute.v1.MachineTypesScopedList;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.ZoneName;
+import com.google.cloud.compute.v1.ProjectZoneMachineTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java
index 80f6c27daff4..9f7c65488ef4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java
@@ -26,12 +26,12 @@
 import com.google.cloud.compute.v1.Network;
 import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse;
 import com.google.cloud.compute.v1.NetworkList;
-import com.google.cloud.compute.v1.NetworkName;
 import com.google.cloud.compute.v1.NetworksAddPeeringRequest;
 import com.google.cloud.compute.v1.NetworksRemovePeeringRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchNetworkHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectNetworkName;
 import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest;
 import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java
index 55a020e5e644..f441c54d7115 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java
@@ -26,9 +26,9 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest;
 import com.google.cloud.compute.v1.ProjectRegionAutoscalerName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.RegionAutoscalerList;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java
index 0091d8b00605..eeab923373c1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java
@@ -29,8 +29,8 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.ProjectRegionBackendServiceName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.ResourceGroupReference;
 import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest;
 import javax.annotation.Generated;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java
index b22a9f290ba7..f698f7cab48f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java
@@ -22,16 +22,16 @@
 import com.google.cloud.compute.v1.Commitment;
 import com.google.cloud.compute.v1.CommitmentAggregatedList;
 import com.google.cloud.compute.v1.CommitmentList;
-import com.google.cloud.compute.v1.CommitmentName;
 import com.google.cloud.compute.v1.CommitmentsScopedList;
 import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest;
 import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest;
 import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRegionCommitmentName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse;
 import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse;
-import com.google.cloud.compute.v1.RegionName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java
index 9d29fe290b05..d9aa69869567 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java
@@ -28,6 +28,7 @@
 import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest;
 import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagerList;
@@ -37,7 +38,6 @@
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest;
 import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java
index 3147151301ed..e822307d133b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java
@@ -25,13 +25,13 @@
 import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse;
 import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse;
 import com.google.cloud.compute.v1.RegionInstanceGroupList;
 import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances;
 import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest;
 import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest;
-import com.google.cloud.compute.v1.RegionName;
 import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java
index 103b8c96485b..43a8d3c20ca3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java
@@ -23,8 +23,8 @@
 import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationList;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.ProjectRegionOperationName;
-import com.google.cloud.compute.v1.RegionName;
 import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java
index c4826fea323b..bceb24c0281d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java
@@ -21,10 +21,10 @@
 import com.google.cloud.compute.v1.GetRegionHttpRequest;
 import com.google.cloud.compute.v1.ListRegionsHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRegionName;
 import com.google.cloud.compute.v1.Region;
 import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse;
 import com.google.cloud.compute.v1.RegionList;
-import com.google.cloud.compute.v1.RegionName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java
index 51ab5756bf05..7eb6dac869fc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java
@@ -24,10 +24,10 @@
 import com.google.cloud.compute.v1.ListRoutesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectRouteName;
 import com.google.cloud.compute.v1.Route;
 import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse;
 import com.google.cloud.compute.v1.RouteList;
-import com.google.cloud.compute.v1.RouteName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java
index 8eeac0c72117..b70ce7006cfe 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java
@@ -28,13 +28,13 @@
 import com.google.cloud.compute.v1.PatchRouterHttpRequest;
 import com.google.cloud.compute.v1.PreviewRouterHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionRouterName;
 import com.google.cloud.compute.v1.Router;
 import com.google.cloud.compute.v1.RouterAggregatedList;
 import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse;
 import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse;
 import com.google.cloud.compute.v1.RouterList;
-import com.google.cloud.compute.v1.RouterName;
 import com.google.cloud.compute.v1.RouterStatusResponse;
 import com.google.cloud.compute.v1.RoutersPreviewResponse;
 import com.google.cloud.compute.v1.RoutersScopedList;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java
index 16ecc59e1863..3d2b0c65080a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java
@@ -29,7 +29,6 @@
 import com.google.cloud.compute.v1.Snapshot;
 import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse;
 import com.google.cloud.compute.v1.SnapshotList;
-import com.google.cloud.compute.v1.SnapshotName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java
index b6e4f48f8930..dd92d3a2b6f6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java
@@ -24,10 +24,10 @@
 import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectSslCertificateName;
 import com.google.cloud.compute.v1.SslCertificate;
 import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse;
 import com.google.cloud.compute.v1.SslCertificateList;
-import com.google.cloud.compute.v1.SslCertificateName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java
index 0270218722a8..26805ce3e39f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java
@@ -27,14 +27,14 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionSubnetworkName;
 import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest;
 import com.google.cloud.compute.v1.Subnetwork;
 import com.google.cloud.compute.v1.SubnetworkAggregatedList;
 import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse;
 import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse;
 import com.google.cloud.compute.v1.SubnetworkList;
-import com.google.cloud.compute.v1.SubnetworkName;
 import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest;
 import com.google.cloud.compute.v1.SubnetworksScopedList;
 import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java
index 770b99bd5292..d2145f238e9a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java
@@ -24,11 +24,11 @@
 import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetHttpProxyName;
 import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetHttpProxy;
 import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetHttpProxyList;
-import com.google.cloud.compute.v1.TargetHttpProxyName;
 import com.google.cloud.compute.v1.UrlMapReference;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java
index 82070df364b7..9eef249a5b2c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java
@@ -24,13 +24,13 @@
 import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName;
 import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest;
 import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest;
 import com.google.cloud.compute.v1.TargetHttpsProxy;
 import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetHttpsProxyList;
-import com.google.cloud.compute.v1.TargetHttpsProxyName;
 import com.google.cloud.compute.v1.UrlMapReference;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java
index 544cd9abb8c1..49696fda137a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java
@@ -25,14 +25,14 @@
 import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneName;
+import com.google.cloud.compute.v1.ProjectZoneTargetInstanceName;
 import com.google.cloud.compute.v1.TargetInstance;
 import com.google.cloud.compute.v1.TargetInstanceAggregatedList;
 import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse;
 import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse;
 import com.google.cloud.compute.v1.TargetInstanceList;
-import com.google.cloud.compute.v1.TargetInstanceName;
 import com.google.cloud.compute.v1.TargetInstancesScopedList;
-import com.google.cloud.compute.v1.ZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java
index 15577cd3ad23..0e89154c78e1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java
@@ -29,7 +29,8 @@
 import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionTargetPoolName;
 import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest;
 import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest;
 import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest;
@@ -39,7 +40,6 @@
 import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse;
 import com.google.cloud.compute.v1.TargetPoolInstanceHealth;
 import com.google.cloud.compute.v1.TargetPoolList;
-import com.google.cloud.compute.v1.TargetPoolName;
 import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest;
 import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest;
 import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java
index 6d140f2aad68..2d36a127ea4b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java
@@ -24,6 +24,7 @@
 import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetSslProxyName;
 import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest;
 import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest;
 import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest;
@@ -33,7 +34,6 @@
 import com.google.cloud.compute.v1.TargetSslProxy;
 import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetSslProxyList;
-import com.google.cloud.compute.v1.TargetSslProxyName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java
index d754630513ac..99e6a24bb1bd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java
@@ -24,6 +24,7 @@
 import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectTargetTcpProxyName;
 import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest;
 import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest;
 import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest;
@@ -31,7 +32,6 @@
 import com.google.cloud.compute.v1.TargetTcpProxy;
 import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse;
 import com.google.cloud.compute.v1.TargetTcpProxyList;
-import com.google.cloud.compute.v1.TargetTcpProxyName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java
index 1330e1c0a6e7..660da543e491 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java
@@ -25,13 +25,13 @@
 import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionTargetVpnGatewayName;
 import com.google.cloud.compute.v1.TargetVpnGateway;
 import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList;
 import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse;
 import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse;
 import com.google.cloud.compute.v1.TargetVpnGatewayList;
-import com.google.cloud.compute.v1.TargetVpnGatewayName;
 import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java
index a73e6a4f1430..5c2f0def888d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java
@@ -27,11 +27,11 @@
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.PatchUrlMapHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectUrlMapName;
 import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest;
 import com.google.cloud.compute.v1.UrlMap;
 import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse;
 import com.google.cloud.compute.v1.UrlMapList;
-import com.google.cloud.compute.v1.UrlMapName;
 import com.google.cloud.compute.v1.UrlMapsValidateRequest;
 import com.google.cloud.compute.v1.UrlMapsValidateResponse;
 import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java
index 9628a3a2992a..7a7ea8818a7d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java
@@ -25,13 +25,13 @@
 import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.ProjectName;
-import com.google.cloud.compute.v1.RegionName;
+import com.google.cloud.compute.v1.ProjectRegionName;
+import com.google.cloud.compute.v1.ProjectRegionVpnTunnelName;
 import com.google.cloud.compute.v1.VpnTunnel;
 import com.google.cloud.compute.v1.VpnTunnelAggregatedList;
 import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse;
 import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse;
 import com.google.cloud.compute.v1.VpnTunnelList;
-import com.google.cloud.compute.v1.VpnTunnelName;
 import com.google.cloud.compute.v1.VpnTunnelsScopedList;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java
index 58e815c6acb5..b67b253c3fb1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java
@@ -23,8 +23,8 @@
 import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
 import com.google.cloud.compute.v1.OperationList;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ProjectZoneOperationName;
-import com.google.cloud.compute.v1.ZoneName;
 import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse;
 import javax.annotation.Generated;
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java
index c415ed28482a..5cc8ce61da48 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java
@@ -21,10 +21,10 @@
 import com.google.cloud.compute.v1.GetZoneHttpRequest;
 import com.google.cloud.compute.v1.ListZonesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.Zone;
 import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse;
 import com.google.cloud.compute.v1.ZoneList;
-import com.google.cloud.compute.v1.ZoneName;
 import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java
index 597fd37778a9..ea6c2e54826d 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java
@@ -138,7 +138,7 @@ public void aggregatedListAcceleratorTypesExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getAcceleratorTypeTest() {
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -158,7 +158,7 @@ public void getAcceleratorTypeTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+    ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
 
     AcceleratorType actualResponse =
         client.getAcceleratorType(acceleratorType);
@@ -180,7 +180,7 @@ public void getAcceleratorTypeExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      AcceleratorTypeName acceleratorType = AcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+      ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
 
       client.getAcceleratorType(acceleratorType);
       Assert.fail("No exception raised");
@@ -207,7 +207,7 @@ public void listAcceleratorTypesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(zone);
 
@@ -232,7 +232,7 @@ public void listAcceleratorTypesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listAcceleratorTypes(zone);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java
index e7541c51e0ce..aedde8a54728 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java
@@ -150,7 +150,7 @@ public void deleteAddressTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -159,7 +159,7 @@ public void deleteAddressTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -188,7 +188,7 @@ public void deleteAddressTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+    ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -211,7 +211,7 @@ public void deleteAddressExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+      ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
       String requestId = "requestId37109963";
 
       client.deleteAddress(address, requestId);
@@ -230,11 +230,11 @@ public void getAddressTest() {
     String description = "description-1724546052";
     String selfLink = "selfLink-1691268851";
     String ipVersion = "ipVersion-1315653184";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String status = "status-892481550";
     Address expectedResponse = Address.newBuilder()
       .setAddress(address2.toString())
@@ -252,7 +252,7 @@ public void getAddressTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+    ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
 
     Address actualResponse =
         client.getAddress(address);
@@ -274,7 +274,7 @@ public void getAddressExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      AddressName address = AddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+      ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
 
       client.getAddress(address);
       Assert.fail("No exception raised");
@@ -294,7 +294,7 @@ public void insertAddressTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -303,7 +303,7 @@ public void insertAddressTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -333,7 +333,7 @@ public void insertAddressTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Address addressResource = Address.newBuilder().build();
 
     Operation actualResponse =
@@ -357,7 +357,7 @@ public void insertAddressExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Address addressResource = Address.newBuilder().build();
 
       client.insertAddress(requestId, region, addressResource);
@@ -385,7 +385,7 @@ public void listAddressesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListAddressesPagedResponse pagedListResponse = client.listAddresses(region);
 
@@ -410,7 +410,7 @@ public void listAddressesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listAddresses(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java
index 9dd3be679506..8fb3febd187a 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java
@@ -154,7 +154,7 @@ public void deleteAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -163,7 +163,7 @@ public void deleteAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -192,7 +192,7 @@ public void deleteAutoscalerTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+    ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -215,7 +215,7 @@ public void deleteAutoscalerExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+      ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
       String requestId = "requestId37109963";
 
       client.deleteAutoscaler(autoscaler, requestId);
@@ -228,13 +228,13 @@ public void deleteAutoscalerExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getAutoscalerTest() {
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String description = "description-1724546052";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String selfLink = "selfLink-1691268851";
     String status = "status-892481550";
     String target = "target-880905839";
@@ -252,7 +252,7 @@ public void getAutoscalerTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+    ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
 
     Autoscaler actualResponse =
         client.getAutoscaler(autoscaler);
@@ -274,7 +274,7 @@ public void getAutoscalerExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      AutoscalerName autoscaler = AutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+      ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
 
       client.getAutoscaler(autoscaler);
       Assert.fail("No exception raised");
@@ -294,7 +294,7 @@ public void insertAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -303,7 +303,7 @@ public void insertAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -332,7 +332,7 @@ public void insertAutoscalerTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
@@ -356,7 +356,7 @@ public void insertAutoscalerExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
@@ -385,7 +385,7 @@ public void listAutoscalersTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListAutoscalersPagedResponse pagedListResponse = client.listAutoscalers(zone);
 
@@ -410,7 +410,7 @@ public void listAutoscalersExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listAutoscalers(zone);
       Assert.fail("No exception raised");
@@ -430,7 +430,7 @@ public void patchAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -439,7 +439,7 @@ public void patchAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -469,7 +469,7 @@ public void patchAutoscalerTest() {
     mockService.addResponse(expectedResponse);
 
     String autoscaler = "autoscaler517258967";
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
@@ -494,7 +494,7 @@ public void patchAutoscalerExceptionTest() throws Exception {
 
     try {
       String autoscaler = "autoscaler517258967";
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
@@ -516,7 +516,7 @@ public void updateAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -525,7 +525,7 @@ public void updateAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -555,7 +555,7 @@ public void updateAutoscalerTest() {
     mockService.addResponse(expectedResponse);
 
     String autoscaler = "autoscaler517258967";
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
@@ -580,7 +580,7 @@ public void updateAutoscalerExceptionTest() throws Exception {
 
     try {
       String autoscaler = "autoscaler517258967";
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java
index cc4b0a05c5be..5b02008c8c87 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java
@@ -98,7 +98,7 @@ public void deleteBackendBucketTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteBackendBucketTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -136,7 +136,7 @@ public void deleteBackendBucketTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+    ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -159,7 +159,7 @@ public void deleteBackendBucketExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+      ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
       String requestId = "requestId37109963";
 
       client.deleteBackendBucket(backendBucket, requestId);
@@ -192,7 +192,7 @@ public void getBackendBucketTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+    ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
 
     BackendBucket actualResponse =
         client.getBackendBucket(backendBucket);
@@ -214,7 +214,7 @@ public void getBackendBucketExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+      ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
 
       client.getBackendBucket(backendBucket);
       Assert.fail("No exception raised");
@@ -234,7 +234,7 @@ public void insertBackendBucketTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -243,7 +243,7 @@ public void insertBackendBucketTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -370,7 +370,7 @@ public void patchBackendBucketTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -379,7 +379,7 @@ public void patchBackendBucketTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -408,7 +408,7 @@ public void patchBackendBucketTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+    ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
     String requestId = "requestId37109963";
     BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
 
@@ -432,7 +432,7 @@ public void patchBackendBucketExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+      ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
       String requestId = "requestId37109963";
       BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
 
@@ -454,7 +454,7 @@ public void updateBackendBucketTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -463,7 +463,7 @@ public void updateBackendBucketTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -492,7 +492,7 @@ public void updateBackendBucketTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+    ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
     String requestId = "requestId37109963";
     BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
 
@@ -516,7 +516,7 @@ public void updateBackendBucketExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      BackendBucketName backendBucket = BackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+      ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
       String requestId = "requestId37109963";
       BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java
index f37845980f38..d889a6c2eaf1 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java
@@ -156,7 +156,7 @@ public void deleteBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -165,7 +165,7 @@ public void deleteBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -195,7 +195,7 @@ public void deleteBackendServiceTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
 
     Operation actualResponse =
         client.deleteBackendService(requestId, backendService);
@@ -218,7 +218,7 @@ public void deleteBackendServiceExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+      ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
 
       client.deleteBackendService(requestId, backendService);
       Assert.fail("No exception raised");
@@ -245,7 +245,7 @@ public void getBackendServiceTest() {
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     BackendService expectedResponse = BackendService.newBuilder()
       .setAffinityCookieTtlSec(affinityCookieTtlSec)
       .setKind(kind)
@@ -266,7 +266,7 @@ public void getBackendServiceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
 
     BackendService actualResponse =
         client.getBackendService(backendService);
@@ -288,7 +288,7 @@ public void getBackendServiceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+      ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
 
       client.getBackendService(backendService);
       Assert.fail("No exception raised");
@@ -306,7 +306,7 @@ public void getHealthBackendServiceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
     ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
 
     BackendServiceGroupHealth actualResponse =
@@ -329,7 +329,7 @@ public void getHealthBackendServiceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+      ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
       ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
 
       client.getHealthBackendService(backendService, resourceGroupReferenceResource);
@@ -350,7 +350,7 @@ public void insertBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -359,7 +359,7 @@ public void insertBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -486,7 +486,7 @@ public void patchBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -495,7 +495,7 @@ public void patchBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -525,7 +525,7 @@ public void patchBackendServiceTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
     BackendService backendServiceResource = BackendService.newBuilder().build();
 
     Operation actualResponse =
@@ -549,7 +549,7 @@ public void patchBackendServiceExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+      ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
       BackendService backendServiceResource = BackendService.newBuilder().build();
 
       client.patchBackendService(requestId, backendService, backendServiceResource);
@@ -570,7 +570,7 @@ public void updateBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -579,7 +579,7 @@ public void updateBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -609,7 +609,7 @@ public void updateBackendServiceTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
     BackendService backendServiceResource = BackendService.newBuilder().build();
 
     Operation actualResponse =
@@ -633,7 +633,7 @@ public void updateBackendServiceExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+      ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
       BackendService backendServiceResource = BackendService.newBuilder().build();
 
       client.updateBackendService(requestId, backendService, backendServiceResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java
index 24b84581e94f..294a8846e368 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java
@@ -156,7 +156,7 @@ public void createSnapshotDiskTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -165,7 +165,7 @@ public void createSnapshotDiskTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -194,7 +194,7 @@ public void createSnapshotDiskTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+    ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
     String requestId = "requestId37109963";
     Boolean guestFlush = false;
     Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -219,7 +219,7 @@ public void createSnapshotDiskExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+      ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
       String requestId = "requestId37109963";
       Boolean guestFlush = false;
       Snapshot snapshotResource = Snapshot.newBuilder().build();
@@ -242,7 +242,7 @@ public void deleteDiskTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -251,7 +251,7 @@ public void deleteDiskTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -280,7 +280,7 @@ public void deleteDiskTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+    ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -303,7 +303,7 @@ public void deleteDiskExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+      ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
       String requestId = "requestId37109963";
 
       client.deleteDisk(disk, requestId);
@@ -323,7 +323,7 @@ public void getDiskTest() {
     String sourceSnapshot = "sourceSnapshot-947679896";
     String type = "type3575610";
     String labelFingerprint = "labelFingerprint714995737";
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String creationTimestamp = "creationTimestamp567396278";
     String options = "options-1249474914";
     String id = "id3355";
@@ -356,7 +356,7 @@ public void getDiskTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+    ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
 
     Disk actualResponse =
         client.getDisk(disk);
@@ -378,7 +378,7 @@ public void getDiskExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+      ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
 
       client.getDisk(disk);
       Assert.fail("No exception raised");
@@ -398,7 +398,7 @@ public void insertDiskTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -407,7 +407,7 @@ public void insertDiskTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -436,7 +436,7 @@ public void insertDiskTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     String sourceImage = "sourceImage1661056055";
     Disk diskResource = Disk.newBuilder().build();
@@ -461,7 +461,7 @@ public void insertDiskExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       String sourceImage = "sourceImage1661056055";
       Disk diskResource = Disk.newBuilder().build();
@@ -491,7 +491,7 @@ public void listDisksTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListDisksPagedResponse pagedListResponse = client.listDisks(zone);
 
@@ -516,7 +516,7 @@ public void listDisksExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listDisks(zone);
       Assert.fail("No exception raised");
@@ -536,7 +536,7 @@ public void resizeDiskTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -545,7 +545,7 @@ public void resizeDiskTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -574,7 +574,7 @@ public void resizeDiskTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+    ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
     String requestId = "requestId37109963";
     DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
 
@@ -598,7 +598,7 @@ public void resizeDiskExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      DiskName disk = DiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+      ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
       String requestId = "requestId37109963";
       DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
 
@@ -620,7 +620,7 @@ public void setLabelsDiskTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -629,7 +629,7 @@ public void setLabelsDiskTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -658,7 +658,7 @@ public void setLabelsDiskTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+    ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
     String requestId = "requestId37109963";
     ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
 
@@ -682,7 +682,7 @@ public void setLabelsDiskExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ResourceName resource = ResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+      ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
       String requestId = "requestId37109963";
       ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java
index edbd89e72741..c9567bc794ba 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java
@@ -139,7 +139,7 @@ public void aggregatedListDiskTypesExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void getDiskTypeTest() {
     String defaultDiskSizeGb = "defaultDiskSizeGb807490165";
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -160,7 +160,7 @@ public void getDiskTypeTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+    ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
 
     DiskType actualResponse =
         client.getDiskType(diskType);
@@ -182,7 +182,7 @@ public void getDiskTypeExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      DiskTypeName diskType = DiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
+      ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
 
       client.getDiskType(diskType);
       Assert.fail("No exception raised");
@@ -209,7 +209,7 @@ public void listDiskTypesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListDiskTypesPagedResponse pagedListResponse = client.listDiskTypes(zone);
 
@@ -234,7 +234,7 @@ public void listDiskTypesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listDiskTypes(zone);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java
index a544e79fdf2a..b0359dc8d469 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java
@@ -98,7 +98,7 @@ public void deleteFirewallTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteFirewallTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -136,7 +136,7 @@ public void deleteFirewallTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+    ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -159,7 +159,7 @@ public void deleteFirewallExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+      ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
       String requestId = "requestId37109963";
 
       client.deleteFirewall(firewall, requestId);
@@ -175,7 +175,7 @@ public void getFirewallTest() {
     String kind = "kind3292052";
     String description = "description-1724546052";
     Integer priority = 1165461084;
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -194,7 +194,7 @@ public void getFirewallTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+    ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
 
     Firewall actualResponse =
         client.getFirewall(firewall);
@@ -216,7 +216,7 @@ public void getFirewallExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+      ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
 
       client.getFirewall(firewall);
       Assert.fail("No exception raised");
@@ -236,7 +236,7 @@ public void insertFirewallTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -245,7 +245,7 @@ public void insertFirewallTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -372,7 +372,7 @@ public void patchFirewallTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -381,7 +381,7 @@ public void patchFirewallTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -410,7 +410,7 @@ public void patchFirewallTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+    ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
     String requestId = "requestId37109963";
     Firewall firewallResource = Firewall.newBuilder().build();
 
@@ -434,7 +434,7 @@ public void patchFirewallExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+      ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
       String requestId = "requestId37109963";
       Firewall firewallResource = Firewall.newBuilder().build();
 
@@ -456,7 +456,7 @@ public void updateFirewallTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -465,7 +465,7 @@ public void updateFirewallTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -494,7 +494,7 @@ public void updateFirewallTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+    ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
     String requestId = "requestId37109963";
     Firewall firewallResource = Firewall.newBuilder().build();
 
@@ -518,7 +518,7 @@ public void updateFirewallExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      FirewallName firewall = FirewallName.of("[PROJECT]", "[FIREWALL]");
+      ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
       String requestId = "requestId37109963";
       Firewall firewallResource = Firewall.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java
index e4635281d5d8..4b8f109fde66 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java
@@ -152,7 +152,7 @@ public void deleteForwardingRuleTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -161,7 +161,7 @@ public void deleteForwardingRuleTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -191,7 +191,7 @@ public void deleteForwardingRuleTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+    ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
 
     Operation actualResponse =
         client.deleteForwardingRule(requestId, forwardingRule);
@@ -214,7 +214,7 @@ public void deleteForwardingRuleExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+      ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
 
       client.deleteForwardingRule(requestId, forwardingRule);
       Assert.fail("No exception raised");
@@ -229,19 +229,19 @@ public void getForwardingRuleTest() {
     String portRange = "portRange217518079";
     String kind = "kind3292052";
     String iPProtocol = "iPProtocol323774237";
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
     String description = "description-1724546052";
     String loadBalancingScheme = "loadBalancingScheme1974502980";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     String target = "target-880905839";
     String ipVersion = "ipVersion-1315653184";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
     String iPAddress = "iPAddress-551149873";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     ForwardingRule expectedResponse = ForwardingRule.newBuilder()
       .setPortRange(portRange)
       .setKind(kind)
@@ -262,7 +262,7 @@ public void getForwardingRuleTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+    ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
 
     ForwardingRule actualResponse =
         client.getForwardingRule(forwardingRule);
@@ -284,7 +284,7 @@ public void getForwardingRuleExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+      ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
 
       client.getForwardingRule(forwardingRule);
       Assert.fail("No exception raised");
@@ -304,7 +304,7 @@ public void insertForwardingRuleTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -313,7 +313,7 @@ public void insertForwardingRuleTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -343,7 +343,7 @@ public void insertForwardingRuleTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
 
     Operation actualResponse =
@@ -367,7 +367,7 @@ public void insertForwardingRuleExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
 
       client.insertForwardingRule(requestId, region, forwardingRuleResource);
@@ -395,7 +395,7 @@ public void listForwardingRulesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListForwardingRulesPagedResponse pagedListResponse = client.listForwardingRules(region);
 
@@ -420,7 +420,7 @@ public void listForwardingRulesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listForwardingRules(region);
       Assert.fail("No exception raised");
@@ -440,7 +440,7 @@ public void setTargetForwardingRuleTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -449,7 +449,7 @@ public void setTargetForwardingRuleTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -479,7 +479,7 @@ public void setTargetForwardingRuleTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+    ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
     TargetReference targetReferenceResource = TargetReference.newBuilder().build();
 
     Operation actualResponse =
@@ -503,7 +503,7 @@ public void setTargetForwardingRuleExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      ForwardingRuleName forwardingRule = ForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
+      ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
       TargetReference targetReferenceResource = TargetReference.newBuilder().build();
 
       client.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java
index a8688c573084..da132639161a 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java
@@ -94,7 +94,7 @@ public void deleteGlobalAddressTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -103,7 +103,7 @@ public void deleteGlobalAddressTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -174,11 +174,11 @@ public void getGlobalAddressTest() {
     String description = "description-1724546052";
     String selfLink = "selfLink-1691268851";
     String ipVersion = "ipVersion-1315653184";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String status = "status-892481550";
     Address expectedResponse = Address.newBuilder()
       .setAddress(address2.toString())
@@ -238,7 +238,7 @@ public void insertGlobalAddressTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -247,7 +247,7 @@ public void insertGlobalAddressTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java
index 4dbee8fb6556..def10b699f90 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java
@@ -96,7 +96,7 @@ public void deleteGlobalForwardingRuleTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -105,7 +105,7 @@ public void deleteGlobalForwardingRuleTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -173,19 +173,19 @@ public void getGlobalForwardingRuleTest() {
     String portRange = "portRange217518079";
     String kind = "kind3292052";
     String iPProtocol = "iPProtocol323774237";
-    BackendServiceName backendService = BackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+    ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
     String description = "description-1724546052";
     String loadBalancingScheme = "loadBalancingScheme1974502980";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     String target = "target-880905839";
     String ipVersion = "ipVersion-1315653184";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
     String iPAddress = "iPAddress-551149873";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     ForwardingRule expectedResponse = ForwardingRule.newBuilder()
       .setPortRange(portRange)
       .setKind(kind)
@@ -248,7 +248,7 @@ public void insertGlobalForwardingRuleTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -257,7 +257,7 @@ public void insertGlobalForwardingRuleTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -384,7 +384,7 @@ public void setTargetGlobalForwardingRuleTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -393,7 +393,7 @@ public void setTargetGlobalForwardingRuleTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java
index 9c7f3b888813..21a2d2be2501 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java
@@ -142,7 +142,7 @@ public void aggregatedListGlobalOperationsExceptionTest() throws Exception {
   public void deleteGlobalOperationTest() {
     mockService.addNullResponse();
 
-    OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+    ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
 
     client.deleteGlobalOperation(operation);
 
@@ -162,7 +162,7 @@ public void deleteGlobalOperationExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+      ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
 
       client.deleteGlobalOperation(operation);
       Assert.fail("No exception raised");
@@ -182,7 +182,7 @@ public void getGlobalOperationTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -191,7 +191,7 @@ public void getGlobalOperationTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -220,7 +220,7 @@ public void getGlobalOperationTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+    ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
 
     Operation actualResponse =
         client.getGlobalOperation(operation);
@@ -242,7 +242,7 @@ public void getGlobalOperationExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      OperationName operation = OperationName.of("[PROJECT]", "[OPERATION]");
+      ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
 
       client.getGlobalOperation(operation);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java
index 544598e7cf5b..b8c21347b397 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java
@@ -98,7 +98,7 @@ public void deleteHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -137,7 +137,7 @@ public void deleteHealthCheckTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+    ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
 
     Operation actualResponse =
         client.deleteHealthCheck(requestId, healthCheck);
@@ -160,7 +160,7 @@ public void deleteHealthCheckExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+      ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
 
       client.deleteHealthCheck(requestId, healthCheck);
       Assert.fail("No exception raised");
@@ -198,7 +198,7 @@ public void getHealthCheckTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+    ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
 
     HealthCheck actualResponse =
         client.getHealthCheck(healthCheck);
@@ -220,7 +220,7 @@ public void getHealthCheckExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+      ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
 
       client.getHealthCheck(healthCheck);
       Assert.fail("No exception raised");
@@ -240,7 +240,7 @@ public void insertHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -249,7 +249,7 @@ public void insertHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -376,7 +376,7 @@ public void patchHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -385,7 +385,7 @@ public void patchHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -415,7 +415,7 @@ public void patchHealthCheckTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+    ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
     HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
 
     Operation actualResponse =
@@ -439,7 +439,7 @@ public void patchHealthCheckExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+      ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
       HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
 
       client.patchHealthCheck(requestId, healthCheck, healthCheckResource);
@@ -460,7 +460,7 @@ public void updateHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -469,7 +469,7 @@ public void updateHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -499,7 +499,7 @@ public void updateHealthCheckTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+    ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
     HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
 
     Operation actualResponse =
@@ -523,7 +523,7 @@ public void updateHealthCheckExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      HealthCheckName healthCheck = HealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+      ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
       HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
 
       client.updateHealthCheck(requestId, healthCheck, healthCheckResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java
index a8baddf13b7c..6d22aeba32e5 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java
@@ -98,7 +98,7 @@ public void deleteHttpHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteHttpHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -137,7 +137,7 @@ public void deleteHttpHealthCheckTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+    ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
 
     Operation actualResponse =
         client.deleteHttpHealthCheck(requestId, httpHealthCheck);
@@ -160,7 +160,7 @@ public void deleteHttpHealthCheckExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+      ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
 
       client.deleteHttpHealthCheck(requestId, httpHealthCheck);
       Assert.fail("No exception raised");
@@ -202,7 +202,7 @@ public void getHttpHealthCheckTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+    ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
 
     HttpHealthCheck actualResponse =
         client.getHttpHealthCheck(httpHealthCheck);
@@ -224,7 +224,7 @@ public void getHttpHealthCheckExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+      ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
 
       client.getHttpHealthCheck(httpHealthCheck);
       Assert.fail("No exception raised");
@@ -244,7 +244,7 @@ public void insertHttpHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -253,7 +253,7 @@ public void insertHttpHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -380,7 +380,7 @@ public void patchHttpHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -389,7 +389,7 @@ public void patchHttpHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -419,7 +419,7 @@ public void patchHttpHealthCheckTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+    ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
     HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
 
     Operation actualResponse =
@@ -443,7 +443,7 @@ public void patchHttpHealthCheckExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+      ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
       HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
 
       client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
@@ -464,7 +464,7 @@ public void updateHttpHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -473,7 +473,7 @@ public void updateHttpHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -503,7 +503,7 @@ public void updateHttpHealthCheckTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+    ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
     HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
 
     Operation actualResponse =
@@ -527,7 +527,7 @@ public void updateHttpHealthCheckExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      HttpHealthCheckName httpHealthCheck = HttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+      ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
       HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
 
       client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java
index 404e85822cc6..4d623c4acfb6 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java
@@ -98,7 +98,7 @@ public void deleteHttpsHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteHttpsHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -136,7 +136,7 @@ public void deleteHttpsHealthCheckTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+    ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -159,7 +159,7 @@ public void deleteHttpsHealthCheckExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+      ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
       String requestId = "requestId37109963";
 
       client.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
@@ -202,7 +202,7 @@ public void getHttpsHealthCheckTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+    ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
 
     HttpsHealthCheck actualResponse =
         client.getHttpsHealthCheck(httpsHealthCheck);
@@ -224,7 +224,7 @@ public void getHttpsHealthCheckExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+      ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
 
       client.getHttpsHealthCheck(httpsHealthCheck);
       Assert.fail("No exception raised");
@@ -244,7 +244,7 @@ public void insertHttpsHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -253,7 +253,7 @@ public void insertHttpsHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -380,7 +380,7 @@ public void patchHttpsHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -389,7 +389,7 @@ public void patchHttpsHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -418,7 +418,7 @@ public void patchHttpsHealthCheckTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+    ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
     String requestId = "requestId37109963";
     HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
 
@@ -442,7 +442,7 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+      ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
       String requestId = "requestId37109963";
       HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
 
@@ -464,7 +464,7 @@ public void updateHttpsHealthCheckTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -473,7 +473,7 @@ public void updateHttpsHealthCheckTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -502,7 +502,7 @@ public void updateHttpsHealthCheckTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+    ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
     String requestId = "requestId37109963";
     HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
 
@@ -526,7 +526,7 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      HttpsHealthCheckName httpsHealthCheck = HttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+      ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
       String requestId = "requestId37109963";
       HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java
index 7fe68b8ba195..e67ffba028f7 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java
@@ -100,7 +100,7 @@ public void deleteImageTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -109,7 +109,7 @@ public void deleteImageTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -138,7 +138,7 @@ public void deleteImageTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+    ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -161,7 +161,7 @@ public void deleteImageExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+      ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
       String requestId = "requestId37109963";
 
       client.deleteImage(image, requestId);
@@ -182,7 +182,7 @@ public void deprecateImageTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -191,7 +191,7 @@ public void deprecateImageTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -220,7 +220,7 @@ public void deprecateImageTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+    ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
     String requestId = "requestId37109963";
     DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
 
@@ -244,7 +244,7 @@ public void deprecateImageExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+      ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
       String requestId = "requestId37109963";
       DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
 
@@ -273,7 +273,7 @@ public void getImageTest() {
     String name = "name3373707";
     String archiveSizeBytes = "archiveSizeBytes-1766390198";
     String sourceImage = "sourceImage1661056055";
-    FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+    ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
     String diskSizeGb = "diskSizeGb-757478089";
     String status = "status-892481550";
     Image expectedResponse = Image.newBuilder()
@@ -298,7 +298,7 @@ public void getImageTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+    ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
 
     Image actualResponse =
         client.getImage(image);
@@ -320,7 +320,7 @@ public void getImageExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ImageName image = ImageName.of("[PROJECT]", "[IMAGE]");
+      ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
 
       client.getImage(image);
       Assert.fail("No exception raised");
@@ -347,7 +347,7 @@ public void getFromFamilyImageTest() {
     String name = "name3373707";
     String archiveSizeBytes = "archiveSizeBytes-1766390198";
     String sourceImage = "sourceImage1661056055";
-    FamilyName family2 = FamilyName.of("[PROJECT]", "[FAMILY]");
+    ProjectFamilyName family2 = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
     String diskSizeGb = "diskSizeGb-757478089";
     String status = "status-892481550";
     Image expectedResponse = Image.newBuilder()
@@ -372,7 +372,7 @@ public void getFromFamilyImageTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+    ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
 
     Image actualResponse =
         client.getFromFamilyImage(family);
@@ -394,7 +394,7 @@ public void getFromFamilyImageExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      FamilyName family = FamilyName.of("[PROJECT]", "[FAMILY]");
+      ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
 
       client.getFromFamilyImage(family);
       Assert.fail("No exception raised");
@@ -414,7 +414,7 @@ public void insertImageTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -423,7 +423,7 @@ public void insertImageTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -552,7 +552,7 @@ public void setLabelsImageTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -561,7 +561,7 @@ public void setLabelsImageTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -590,7 +590,7 @@ public void setLabelsImageTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+    ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
     GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -613,7 +613,7 @@ public void setLabelsImageExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[RESOURCE]");
+      ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
       GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
 
       client.setLabelsImage(resource, globalSetLabelsRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java
index dc307cd10c10..b42b6f0f59cc 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java
@@ -142,7 +142,7 @@ public void addAccessConfigInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -151,7 +151,7 @@ public void addAccessConfigInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -180,7 +180,7 @@ public void addAccessConfigInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String networkInterface = "networkInterface902258792";
     String requestId = "requestId37109963";
     AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -205,7 +205,7 @@ public void addAccessConfigInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String networkInterface = "networkInterface902258792";
       String requestId = "requestId37109963";
       AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -281,7 +281,7 @@ public void attachDiskInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -290,7 +290,7 @@ public void attachDiskInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -319,7 +319,7 @@ public void attachDiskInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
 
@@ -343,7 +343,7 @@ public void attachDiskInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
 
@@ -365,7 +365,7 @@ public void deleteInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -374,7 +374,7 @@ public void deleteInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -403,7 +403,7 @@ public void deleteInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -426,7 +426,7 @@ public void deleteInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
 
       client.deleteInstance(instance, requestId);
@@ -447,7 +447,7 @@ public void deleteAccessConfigInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -456,7 +456,7 @@ public void deleteAccessConfigInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -485,7 +485,7 @@ public void deleteAccessConfigInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String networkInterface = "networkInterface902258792";
     String requestId = "requestId37109963";
     String accessConfig = "accessConfig-464014723";
@@ -510,7 +510,7 @@ public void deleteAccessConfigInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String networkInterface = "networkInterface902258792";
       String requestId = "requestId37109963";
       String accessConfig = "accessConfig-464014723";
@@ -533,7 +533,7 @@ public void detachDiskInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -542,7 +542,7 @@ public void detachDiskInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -571,7 +571,7 @@ public void detachDiskInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     String deviceName = "deviceName-1543071020";
 
@@ -595,7 +595,7 @@ public void detachDiskInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       String deviceName = "deviceName-1543071020";
 
@@ -619,11 +619,11 @@ public void getInstanceTest() {
     Boolean deletionProtection = true;
     String selfLink = "selfLink-1691268851";
     String minCpuPlatform = "minCpuPlatform-1367699977";
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
-    MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+    ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
     String status = "status-892481550";
     Instance expectedResponse = Instance.newBuilder()
       .setCanIpForward(canIpForward)
@@ -645,7 +645,7 @@ public void getInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
 
     Instance actualResponse =
         client.getInstance(instance);
@@ -667,7 +667,7 @@ public void getInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
 
       client.getInstance(instance);
       Assert.fail("No exception raised");
@@ -693,7 +693,7 @@ public void getSerialPortOutputInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     Integer port = 3446913;
     String start = "start109757538";
 
@@ -717,7 +717,7 @@ public void getSerialPortOutputInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       Integer port = 3446913;
       String start = "start109757538";
 
@@ -739,7 +739,7 @@ public void insertInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -748,7 +748,7 @@ public void insertInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -777,7 +777,7 @@ public void insertInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     Instance instanceResource = Instance.newBuilder().build();
 
@@ -801,7 +801,7 @@ public void insertInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       Instance instanceResource = Instance.newBuilder().build();
 
@@ -830,7 +830,7 @@ public void listInstancesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListInstancesPagedResponse pagedListResponse = client.listInstances(zone);
 
@@ -855,7 +855,7 @@ public void listInstancesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listInstances(zone);
       Assert.fail("No exception raised");
@@ -882,7 +882,7 @@ public void listReferrersInstancesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
 
     ListReferrersInstancesPagedResponse pagedListResponse = client.listReferrersInstances(instance);
 
@@ -907,7 +907,7 @@ public void listReferrersInstancesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
 
       client.listReferrersInstances(instance);
       Assert.fail("No exception raised");
@@ -927,7 +927,7 @@ public void resetInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -936,7 +936,7 @@ public void resetInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -965,7 +965,7 @@ public void resetInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -988,7 +988,7 @@ public void resetInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
 
       client.resetInstance(instance, requestId);
@@ -1009,7 +1009,7 @@ public void setDeletionProtectionInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1018,7 +1018,7 @@ public void setDeletionProtectionInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1047,7 +1047,7 @@ public void setDeletionProtectionInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+    ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     Boolean deletionProtection = true;
 
@@ -1071,7 +1071,7 @@ public void setDeletionProtectionInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+      ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       Boolean deletionProtection = true;
 
@@ -1093,7 +1093,7 @@ public void setDiskAutoDeleteInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1102,7 +1102,7 @@ public void setDiskAutoDeleteInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1131,7 +1131,7 @@ public void setDiskAutoDeleteInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     Boolean autoDelete = false;
     String deviceName = "deviceName-1543071020";
@@ -1156,7 +1156,7 @@ public void setDiskAutoDeleteInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       Boolean autoDelete = false;
       String deviceName = "deviceName-1543071020";
@@ -1179,7 +1179,7 @@ public void setLabelsInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1188,7 +1188,7 @@ public void setLabelsInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1217,7 +1217,7 @@ public void setLabelsInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
 
@@ -1241,7 +1241,7 @@ public void setLabelsInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
 
@@ -1263,7 +1263,7 @@ public void setMachineResourcesInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1272,7 +1272,7 @@ public void setMachineResourcesInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1301,7 +1301,7 @@ public void setMachineResourcesInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
 
@@ -1325,7 +1325,7 @@ public void setMachineResourcesInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
 
@@ -1347,7 +1347,7 @@ public void setMachineTypeInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1356,7 +1356,7 @@ public void setMachineTypeInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1385,7 +1385,7 @@ public void setMachineTypeInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
 
@@ -1409,7 +1409,7 @@ public void setMachineTypeInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
 
@@ -1431,7 +1431,7 @@ public void setMetadataInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1440,7 +1440,7 @@ public void setMetadataInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1469,7 +1469,7 @@ public void setMetadataInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     Metadata metadataResource = Metadata.newBuilder().build();
 
@@ -1493,7 +1493,7 @@ public void setMetadataInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       Metadata metadataResource = Metadata.newBuilder().build();
 
@@ -1515,7 +1515,7 @@ public void setMinCpuPlatformInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1524,7 +1524,7 @@ public void setMinCpuPlatformInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1553,7 +1553,7 @@ public void setMinCpuPlatformInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
 
@@ -1577,7 +1577,7 @@ public void setMinCpuPlatformInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
 
@@ -1599,7 +1599,7 @@ public void setSchedulingInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1608,7 +1608,7 @@ public void setSchedulingInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1637,7 +1637,7 @@ public void setSchedulingInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     Scheduling schedulingResource = Scheduling.newBuilder().build();
 
@@ -1661,7 +1661,7 @@ public void setSchedulingInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       Scheduling schedulingResource = Scheduling.newBuilder().build();
 
@@ -1683,7 +1683,7 @@ public void setServiceAccountInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1692,7 +1692,7 @@ public void setServiceAccountInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1721,7 +1721,7 @@ public void setServiceAccountInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
 
@@ -1745,7 +1745,7 @@ public void setServiceAccountInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
 
@@ -1767,7 +1767,7 @@ public void setTagsInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1776,7 +1776,7 @@ public void setTagsInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1805,7 +1805,7 @@ public void setTagsInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     Tags tagsResource = Tags.newBuilder().build();
 
@@ -1829,7 +1829,7 @@ public void setTagsInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       Tags tagsResource = Tags.newBuilder().build();
 
@@ -1851,7 +1851,7 @@ public void startInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1860,7 +1860,7 @@ public void startInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1889,7 +1889,7 @@ public void startInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -1912,7 +1912,7 @@ public void startInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
 
       client.startInstance(instance, requestId);
@@ -1933,7 +1933,7 @@ public void startWithEncryptionKeyInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -1942,7 +1942,7 @@ public void startWithEncryptionKeyInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -1971,7 +1971,7 @@ public void startWithEncryptionKeyInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
     InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
 
@@ -1995,7 +1995,7 @@ public void startWithEncryptionKeyInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
       InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
 
@@ -2017,7 +2017,7 @@ public void stopInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -2026,7 +2026,7 @@ public void stopInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -2055,7 +2055,7 @@ public void stopInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -2078,7 +2078,7 @@ public void stopInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String requestId = "requestId37109963";
 
       client.stopInstance(instance, requestId);
@@ -2099,7 +2099,7 @@ public void updateAccessConfigInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -2108,7 +2108,7 @@ public void updateAccessConfigInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -2137,7 +2137,7 @@ public void updateAccessConfigInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String networkInterface = "networkInterface902258792";
     String requestId = "requestId37109963";
     AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -2162,7 +2162,7 @@ public void updateAccessConfigInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String networkInterface = "networkInterface902258792";
       String requestId = "requestId37109963";
       AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
@@ -2185,7 +2185,7 @@ public void updateNetworkInterfaceInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -2194,7 +2194,7 @@ public void updateNetworkInterfaceInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -2223,7 +2223,7 @@ public void updateNetworkInterfaceInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
     String networkInterface = "networkInterface902258792";
     String requestId = "requestId37109963";
     NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
@@ -2248,7 +2248,7 @@ public void updateNetworkInterfaceInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+      ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
       String networkInterface = "networkInterface902258792";
       String requestId = "requestId37109963";
       NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java
index 6fa718c7955a..ff9620b7d354 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java
@@ -106,7 +106,7 @@ public void addInstancesInstanceGroupTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -115,7 +115,7 @@ public void addInstancesInstanceGroupTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -145,7 +145,7 @@ public void addInstancesInstanceGroupTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
     InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -169,7 +169,7 @@ public void addInstancesInstanceGroupExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+      ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
       InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
 
       client.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
@@ -243,7 +243,7 @@ public void deleteInstanceGroupTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -252,7 +252,7 @@ public void deleteInstanceGroupTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -282,7 +282,7 @@ public void deleteInstanceGroupTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
 
     Operation actualResponse =
         client.deleteInstanceGroup(requestId, instanceGroup);
@@ -305,7 +305,7 @@ public void deleteInstanceGroupExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+      ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
 
       client.deleteInstanceGroup(requestId, instanceGroup);
       Assert.fail("No exception raised");
@@ -319,16 +319,16 @@ public void deleteInstanceGroupExceptionTest() throws Exception {
   public void getInstanceGroupTest() {
     String kind = "kind3292052";
     String description = "description-1724546052";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     Integer size = 3530753;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     String creationTimestamp = "creationTimestamp567396278";
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InstanceGroup expectedResponse = InstanceGroup.newBuilder()
       .setKind(kind)
       .setDescription(description)
@@ -345,7 +345,7 @@ public void getInstanceGroupTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
 
     InstanceGroup actualResponse =
         client.getInstanceGroup(instanceGroup);
@@ -367,7 +367,7 @@ public void getInstanceGroupExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+      ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
 
       client.getInstanceGroup(instanceGroup);
       Assert.fail("No exception raised");
@@ -387,7 +387,7 @@ public void insertInstanceGroupTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -396,7 +396,7 @@ public void insertInstanceGroupTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -425,7 +425,7 @@ public void insertInstanceGroupTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
 
@@ -449,7 +449,7 @@ public void insertInstanceGroupExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
 
@@ -478,7 +478,7 @@ public void listInstanceGroupsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListInstanceGroupsPagedResponse pagedListResponse = client.listInstanceGroups(zone);
 
@@ -503,7 +503,7 @@ public void listInstanceGroupsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listInstanceGroups(zone);
       Assert.fail("No exception raised");
@@ -530,7 +530,7 @@ public void listInstancesInstanceGroupsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
     InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
 
     ListInstancesInstanceGroupsPagedResponse pagedListResponse = client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource);
@@ -556,7 +556,7 @@ public void listInstancesInstanceGroupsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+      ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
       InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build();
 
       client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource);
@@ -577,7 +577,7 @@ public void removeInstancesInstanceGroupTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -586,7 +586,7 @@ public void removeInstancesInstanceGroupTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -616,7 +616,7 @@ public void removeInstancesInstanceGroupTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
     InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -640,7 +640,7 @@ public void removeInstancesInstanceGroupExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+      ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
       InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
 
       client.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource);
@@ -661,7 +661,7 @@ public void setNamedPortsInstanceGroupTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -670,7 +670,7 @@ public void setNamedPortsInstanceGroupTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -700,7 +700,7 @@ public void setNamedPortsInstanceGroupTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
     InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -724,7 +724,7 @@ public void setNamedPortsInstanceGroupExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+      ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
       InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
 
       client.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java
index 39bc6e8bec3c..564f0f909fc6 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java
@@ -111,7 +111,7 @@ public void abandonInstancesInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -120,7 +120,7 @@ public void abandonInstancesInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -150,7 +150,7 @@ public void abandonInstancesInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
     InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -174,7 +174,7 @@ public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
       InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
 
       client.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
@@ -248,7 +248,7 @@ public void deleteInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -257,7 +257,7 @@ public void deleteInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -287,7 +287,7 @@ public void deleteInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
     Operation actualResponse =
         client.deleteInstanceGroupManager(requestId, instanceGroupManager);
@@ -310,7 +310,7 @@ public void deleteInstanceGroupManagerExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
       client.deleteInstanceGroupManager(requestId, instanceGroupManager);
       Assert.fail("No exception raised");
@@ -330,7 +330,7 @@ public void deleteInstancesInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -339,7 +339,7 @@ public void deleteInstancesInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -369,7 +369,7 @@ public void deleteInstancesInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
     InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -393,7 +393,7 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
       InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
 
       client.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
@@ -406,19 +406,19 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception
   @Test
   @SuppressWarnings("all")
   public void getInstanceGroupManagerTest() {
-    InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+    ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
     String kind = "kind3292052";
     String description = "description-1724546052";
     String baseInstanceName = "baseInstanceName389106439";
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
     String selfLink = "selfLink-1691268851";
     Integer targetSize = 2084603409;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String creationTimestamp = "creationTimestamp567396278";
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder()
       .setInstanceTemplate(instanceTemplate.toString())
       .setKind(kind)
@@ -436,7 +436,7 @@ public void getInstanceGroupManagerTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
     InstanceGroupManager actualResponse =
         client.getInstanceGroupManager(instanceGroupManager);
@@ -458,7 +458,7 @@ public void getInstanceGroupManagerExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
       client.getInstanceGroupManager(instanceGroupManager);
       Assert.fail("No exception raised");
@@ -478,7 +478,7 @@ public void insertInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -487,7 +487,7 @@ public void insertInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -516,7 +516,7 @@ public void insertInstanceGroupManagerTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
 
@@ -540,7 +540,7 @@ public void insertInstanceGroupManagerExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
 
@@ -569,7 +569,7 @@ public void listInstanceGroupManagersTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListInstanceGroupManagersPagedResponse pagedListResponse = client.listInstanceGroupManagers(zone);
 
@@ -594,7 +594,7 @@ public void listInstanceGroupManagersExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listInstanceGroupManagers(zone);
       Assert.fail("No exception raised");
@@ -609,7 +609,7 @@ public void listManagedInstancesInstanceGroupManagersTest() {
     InstanceGroupManagersListManagedInstancesResponse expectedResponse = InstanceGroupManagersListManagedInstancesResponse.newBuilder().build();
     mockService.addResponse(expectedResponse);
 
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
     InstanceGroupManagersListManagedInstancesResponse actualResponse =
         client.listManagedInstancesInstanceGroupManagers(instanceGroupManager);
@@ -631,7 +631,7 @@ public void listManagedInstancesInstanceGroupManagersExceptionTest() throws Exce
     mockService.addException(exception);
 
     try {
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
       client.listManagedInstancesInstanceGroupManagers(instanceGroupManager);
       Assert.fail("No exception raised");
@@ -651,7 +651,7 @@ public void recreateInstancesInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -660,7 +660,7 @@ public void recreateInstancesInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -690,7 +690,7 @@ public void recreateInstancesInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
     InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -714,7 +714,7 @@ public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exceptio
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
       InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
 
       client.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
@@ -735,7 +735,7 @@ public void resizeInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -744,7 +744,7 @@ public void resizeInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -775,7 +775,7 @@ public void resizeInstanceGroupManagerTest() {
 
     Integer size = 3530753;
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
     Operation actualResponse =
         client.resizeInstanceGroupManager(size, requestId, instanceGroupManager);
@@ -799,7 +799,7 @@ public void resizeInstanceGroupManagerExceptionTest() throws Exception {
     try {
       Integer size = 3530753;
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
 
       client.resizeInstanceGroupManager(size, requestId, instanceGroupManager);
       Assert.fail("No exception raised");
@@ -819,7 +819,7 @@ public void setInstanceTemplateInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -828,7 +828,7 @@ public void setInstanceTemplateInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -858,7 +858,7 @@ public void setInstanceTemplateInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
     InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -882,7 +882,7 @@ public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Except
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
       InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
 
       client.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
@@ -903,7 +903,7 @@ public void setTargetPoolsInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -912,7 +912,7 @@ public void setTargetPoolsInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -942,7 +942,7 @@ public void setTargetPoolsInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+    ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
     InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -966,7 +966,7 @@ public void setTargetPoolsInstanceGroupManagerExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InstanceGroupManagerName instanceGroupManager = InstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+      ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
       InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
 
       client.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java
index c4fc4de348b4..e908d3c9472e 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java
@@ -94,7 +94,7 @@ public void deleteInstanceTemplateTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -103,7 +103,7 @@ public void deleteInstanceTemplateTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -132,7 +132,7 @@ public void deleteInstanceTemplateTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+    ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -155,7 +155,7 @@ public void deleteInstanceTemplateExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+      ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
       String requestId = "requestId37109963";
 
       client.deleteInstanceTemplate(instanceTemplate, requestId);
@@ -184,7 +184,7 @@ public void getInstanceTemplateTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+    ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
 
     InstanceTemplate actualResponse =
         client.getInstanceTemplate(instanceTemplate);
@@ -206,7 +206,7 @@ public void getInstanceTemplateExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+      ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
 
       client.getInstanceTemplate(instanceTemplate);
       Assert.fail("No exception raised");
@@ -226,7 +226,7 @@ public void insertInstanceTemplateTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -235,7 +235,7 @@ public void insertInstanceTemplateTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java
index 0f20542613cf..f624ff289c67 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java
@@ -150,7 +150,7 @@ public void deleteInterconnectAttachmentTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -159,7 +159,7 @@ public void deleteInterconnectAttachmentTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -189,7 +189,7 @@ public void deleteInterconnectAttachmentTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+    ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
 
     Operation actualResponse =
         client.deleteInterconnectAttachment(requestId, interconnectAttachment);
@@ -212,7 +212,7 @@ public void deleteInterconnectAttachmentExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+      ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
 
       client.deleteInterconnectAttachment(requestId, interconnectAttachment);
       Assert.fail("No exception raised");
@@ -229,14 +229,14 @@ public void getInterconnectAttachmentTest() {
     String kind = "kind3292052";
     String googleReferenceId = "googleReferenceId534944469";
     String description = "description-1724546052";
-    InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+    ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
     String customerRouterIpAddress = "customerRouterIpAddress-741266063";
     String selfLink = "selfLink-1691268851";
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InterconnectAttachment expectedResponse = InterconnectAttachment.newBuilder()
       .setCloudRouterIpAddress(cloudRouterIpAddress)
       .setOperationalStatus(operationalStatus)
@@ -254,7 +254,7 @@ public void getInterconnectAttachmentTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+    ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
 
     InterconnectAttachment actualResponse =
         client.getInterconnectAttachment(interconnectAttachment);
@@ -276,7 +276,7 @@ public void getInterconnectAttachmentExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InterconnectAttachmentName interconnectAttachment = InterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+      ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
 
       client.getInterconnectAttachment(interconnectAttachment);
       Assert.fail("No exception raised");
@@ -296,7 +296,7 @@ public void insertInterconnectAttachmentTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -305,7 +305,7 @@ public void insertInterconnectAttachmentTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -335,7 +335,7 @@ public void insertInterconnectAttachmentTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
 
     Operation actualResponse =
@@ -359,7 +359,7 @@ public void insertInterconnectAttachmentExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
 
       client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource);
@@ -387,7 +387,7 @@ public void listInterconnectAttachmentsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListInterconnectAttachmentsPagedResponse pagedListResponse = client.listInterconnectAttachments(region);
 
@@ -412,7 +412,7 @@ public void listInterconnectAttachmentsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listInterconnectAttachments(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java
index bb8ca10df935..b13216d97431 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java
@@ -96,7 +96,7 @@ public void deleteInterconnectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -105,7 +105,7 @@ public void deleteInterconnectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -135,7 +135,7 @@ public void deleteInterconnectTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+    ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
 
     Operation actualResponse =
         client.deleteInterconnect(requestId, interconnect);
@@ -158,7 +158,7 @@ public void deleteInterconnectExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+      ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
 
       client.deleteInterconnect(requestId, interconnect);
       Assert.fail("No exception raised");
@@ -210,7 +210,7 @@ public void getInterconnectTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+    ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
 
     Interconnect actualResponse =
         client.getInterconnect(interconnect);
@@ -232,7 +232,7 @@ public void getInterconnectExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+      ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
 
       client.getInterconnect(interconnect);
       Assert.fail("No exception raised");
@@ -252,7 +252,7 @@ public void insertInterconnectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -261,7 +261,7 @@ public void insertInterconnectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -388,7 +388,7 @@ public void patchInterconnectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -397,7 +397,7 @@ public void patchInterconnectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -427,7 +427,7 @@ public void patchInterconnectTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+    ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
     Interconnect interconnectResource = Interconnect.newBuilder().build();
 
     Operation actualResponse =
@@ -451,7 +451,7 @@ public void patchInterconnectExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      InterconnectName interconnect = InterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+      ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
       Interconnect interconnectResource = Interconnect.newBuilder().build();
 
       client.patchInterconnect(requestId, interconnect, interconnectResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java
index bbf9fce1e31b..c8066cdbd6c9 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java
@@ -112,7 +112,7 @@ public void getInterconnectLocationTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+    ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
 
     InterconnectLocation actualResponse =
         client.getInterconnectLocation(interconnectLocation);
@@ -134,7 +134,7 @@ public void getInterconnectLocationExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      InterconnectLocationName interconnectLocation = InterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+      ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
 
       client.getInterconnectLocation(interconnectLocation);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java
new file mode 100644
index 000000000000..8ce2dfa4adfd
--- /dev/null
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.compute.v1;
+
+import com.google.api.gax.core.NoCredentialsProvider;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.testing.MockHttpService;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ApiException;
+import com.google.api.gax.rpc.ApiExceptionFactory;
+import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.gax.rpc.StatusCode.Code;
+import com.google.api.gax.rpc.testing.FakeStatusCode;
+import static com.google.cloud.compute.v1.stub.HttpJsonLicensStub.getLicensMethodDescriptor;
+import com.google.cloud.compute.v1.stub.LicensStubSettings;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@javax.annotation.Generated("by GAPIC")
+public class LicensClientTest {
+
+   private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf(
+        Lists.newArrayList(
+          getLicensMethodDescriptor
+        ));
+  private static final MockHttpService mockService
+      = new MockHttpService(METHOD_DESCRIPTORS, LicensStubSettings.getDefaultEndpoint());
+
+  private static LicensClient client;
+  private static LicensSettings clientSettings;
+
+  @BeforeClass
+  public static void setUp() throws IOException {
+    clientSettings =
+        LicensSettings.newBuilder()
+           .setTransportChannelProvider(
+               LicensSettings.defaultHttpJsonTransportProviderBuilder()
+                   .setHttpTransport(mockService).build())
+           .setCredentialsProvider(NoCredentialsProvider.create())
+           .build();
+    client =
+       LicensClient.create(clientSettings);
+  }
+
+  @After
+  public void cleanUp() {
+    mockService.reset();
+  }
+
+  @AfterClass
+  public static void tearDown() throws Exception {
+    client.close();
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void getLicensTest() {
+    Boolean chargesUseFee = true;
+    String kind = "kind3292052";
+    String name = "name3373707";
+    String selfLink = "selfLink-1691268851";
+    License expectedResponse = License.newBuilder()
+      .setChargesUseFee(chargesUseFee)
+      .setKind(kind)
+      .setName(name)
+      .setSelfLink(selfLink)
+      .build();
+    mockService.addResponse(expectedResponse);
+
+    LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+
+    License actualResponse =
+        client.getLicens(license);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey = mockService.getRequestHeaders()
+        .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next();
+    Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+        .matcher(apiClientHeaderKey).matches());
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void getLicensExceptionTest() throws Exception {
+    ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+
+      client.getLicens(license);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
+}
\ No newline at end of file
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java
index b7046bc93e1d..21a49fedbc97 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java
@@ -91,7 +91,7 @@ public void getLicenseTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+    ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
 
     License actualResponse =
         client.getLicense(license);
@@ -113,7 +113,7 @@ public void getLicenseExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
+      ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
 
       client.getLicense(license);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java
index e06844c21fb1..d4e6e37bd1b2 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java
@@ -146,7 +146,7 @@ public void getMachineTypeTest() {
     Integer memoryMb = 1726613907;
     Integer maximumPersistentDisks = 1033091853;
     String maximumPersistentDisksSizeGb = "maximumPersistentDisksSizeGb-1993209177";
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
@@ -168,7 +168,7 @@ public void getMachineTypeTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+    ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
 
     MachineType actualResponse =
         client.getMachineType(machineType);
@@ -190,7 +190,7 @@ public void getMachineTypeExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      MachineTypeName machineType = MachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
+      ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
 
       client.getMachineType(machineType);
       Assert.fail("No exception raised");
@@ -217,7 +217,7 @@ public void listMachineTypesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListMachineTypesPagedResponse pagedListResponse = client.listMachineTypes(zone);
 
@@ -242,7 +242,7 @@ public void listMachineTypesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listMachineTypes(zone);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java
index 1a85b91609c2..8fe3da6e38c0 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java
@@ -102,7 +102,7 @@ public void addPeeringNetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -111,7 +111,7 @@ public void addPeeringNetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -141,7 +141,7 @@ public void addPeeringNetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -165,7 +165,7 @@ public void addPeeringNetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+      ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
       NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
 
       client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
@@ -186,7 +186,7 @@ public void deleteNetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -195,7 +195,7 @@ public void deleteNetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -225,7 +225,7 @@ public void deleteNetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
 
     Operation actualResponse =
         client.deleteNetwork(requestId, network);
@@ -248,7 +248,7 @@ public void deleteNetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+      ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
 
       client.deleteNetwork(requestId, network);
       Assert.fail("No exception raised");
@@ -282,7 +282,7 @@ public void getNetworkTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
 
     Network actualResponse =
         client.getNetwork(network);
@@ -304,7 +304,7 @@ public void getNetworkExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+      ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
 
       client.getNetwork(network);
       Assert.fail("No exception raised");
@@ -324,7 +324,7 @@ public void insertNetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -333,7 +333,7 @@ public void insertNetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -460,7 +460,7 @@ public void patchNetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -469,7 +469,7 @@ public void patchNetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -499,7 +499,7 @@ public void patchNetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     Network networkResource = Network.newBuilder().build();
 
     Operation actualResponse =
@@ -523,7 +523,7 @@ public void patchNetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+      ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
       Network networkResource = Network.newBuilder().build();
 
       client.patchNetwork(requestId, network, networkResource);
@@ -544,7 +544,7 @@ public void removePeeringNetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -553,7 +553,7 @@ public void removePeeringNetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -583,7 +583,7 @@ public void removePeeringNetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -607,7 +607,7 @@ public void removePeeringNetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+      ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
       NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
 
       client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource);
@@ -628,7 +628,7 @@ public void switchToCustomModeNetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -637,7 +637,7 @@ public void switchToCustomModeNetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -667,7 +667,7 @@ public void switchToCustomModeNetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
 
     Operation actualResponse =
         client.switchToCustomModeNetwork(requestId, network);
@@ -690,7 +690,7 @@ public void switchToCustomModeNetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+      ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
 
       client.switchToCustomModeNetwork(requestId, network);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java
index 1db942d94bf3..d05268977586 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java
@@ -111,7 +111,7 @@ public void disableXpnHostProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -120,7 +120,7 @@ public void disableXpnHostProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -193,7 +193,7 @@ public void disableXpnResourceProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -202,7 +202,7 @@ public void disableXpnResourceProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -277,7 +277,7 @@ public void enableXpnHostProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -286,7 +286,7 @@ public void enableXpnHostProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -359,7 +359,7 @@ public void enableXpnResourceProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -368,7 +368,7 @@ public void enableXpnResourceProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -653,7 +653,7 @@ public void moveDiskProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -662,7 +662,7 @@ public void moveDiskProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -737,7 +737,7 @@ public void moveInstanceProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -746,7 +746,7 @@ public void moveInstanceProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -821,7 +821,7 @@ public void setCommonInstanceMetadataProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -830,7 +830,7 @@ public void setCommonInstanceMetadataProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -905,7 +905,7 @@ public void setUsageExportBucketProjectTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -914,7 +914,7 @@ public void setUsageExportBucketProjectTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java
index 820e50448858..9b67424aedbf 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java
@@ -98,7 +98,7 @@ public void deleteRegionAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteRegionAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -172,13 +172,13 @@ public void deleteRegionAutoscalerExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getRegionAutoscalerTest() {
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String description = "description-1724546052";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String selfLink = "selfLink-1691268851";
     String status = "status-892481550";
     String target = "target-880905839";
@@ -238,7 +238,7 @@ public void insertRegionAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -247,7 +247,7 @@ public void insertRegionAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -277,7 +277,7 @@ public void insertRegionAutoscalerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
     Operation actualResponse =
@@ -301,7 +301,7 @@ public void insertRegionAutoscalerExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
       client.insertRegionAutoscaler(requestId, region, autoscalerResource);
@@ -329,7 +329,7 @@ public void listRegionAutoscalersTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRegionAutoscalersPagedResponse pagedListResponse = client.listRegionAutoscalers(region);
 
@@ -354,7 +354,7 @@ public void listRegionAutoscalersExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRegionAutoscalers(region);
       Assert.fail("No exception raised");
@@ -374,7 +374,7 @@ public void patchRegionAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -383,7 +383,7 @@ public void patchRegionAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -414,7 +414,7 @@ public void patchRegionAutoscalerTest() {
 
     String autoscaler = "autoscaler517258967";
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
     Operation actualResponse =
@@ -439,7 +439,7 @@ public void patchRegionAutoscalerExceptionTest() throws Exception {
     try {
       String autoscaler = "autoscaler517258967";
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
       client.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
@@ -460,7 +460,7 @@ public void updateRegionAutoscalerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -469,7 +469,7 @@ public void updateRegionAutoscalerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -500,7 +500,7 @@ public void updateRegionAutoscalerTest() {
 
     String autoscaler = "autoscaler517258967";
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
     Operation actualResponse =
@@ -525,7 +525,7 @@ public void updateRegionAutoscalerExceptionTest() throws Exception {
     try {
       String autoscaler = "autoscaler517258967";
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
 
       client.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java
index 800b95ef2507..9a3b35af7b93 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java
@@ -100,7 +100,7 @@ public void deleteRegionBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -109,7 +109,7 @@ public void deleteRegionBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -189,7 +189,7 @@ public void getRegionBackendServiceTest() {
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     BackendService expectedResponse = BackendService.newBuilder()
       .setAffinityCookieTtlSec(affinityCookieTtlSec)
       .setKind(kind)
@@ -294,7 +294,7 @@ public void insertRegionBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -303,7 +303,7 @@ public void insertRegionBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -333,7 +333,7 @@ public void insertRegionBackendServiceTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     BackendService backendServiceResource = BackendService.newBuilder().build();
 
     Operation actualResponse =
@@ -357,7 +357,7 @@ public void insertRegionBackendServiceExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       BackendService backendServiceResource = BackendService.newBuilder().build();
 
       client.insertRegionBackendService(requestId, region, backendServiceResource);
@@ -385,7 +385,7 @@ public void listRegionBackendServicesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRegionBackendServicesPagedResponse pagedListResponse = client.listRegionBackendServices(region);
 
@@ -410,7 +410,7 @@ public void listRegionBackendServicesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRegionBackendServices(region);
       Assert.fail("No exception raised");
@@ -430,7 +430,7 @@ public void patchRegionBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -439,7 +439,7 @@ public void patchRegionBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -514,7 +514,7 @@ public void updateRegionBackendServiceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -523,7 +523,7 @@ public void updateRegionBackendServiceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java
index 0cd938a806c3..4acef13bb1a4 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java
@@ -100,7 +100,7 @@ public void getRegionTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     Region actualResponse =
         client.getRegion(region);
@@ -122,7 +122,7 @@ public void getRegionExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.getRegion(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java
index 45f7b039574c..a98fdab5c25f 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java
@@ -147,7 +147,7 @@ public void getRegionCommitmentTest() {
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String endTimestamp = "endTimestamp1004967602";
     String plan = "plan3443497";
     String startTimestamp = "startTimestamp-1526966919";
@@ -168,7 +168,7 @@ public void getRegionCommitmentTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+    ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
 
     Commitment actualResponse =
         client.getRegionCommitment(commitment);
@@ -190,7 +190,7 @@ public void getRegionCommitmentExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      CommitmentName commitment = CommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
+      ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
 
       client.getRegionCommitment(commitment);
       Assert.fail("No exception raised");
@@ -210,7 +210,7 @@ public void insertRegionCommitmentTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -219,7 +219,7 @@ public void insertRegionCommitmentTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -249,7 +249,7 @@ public void insertRegionCommitmentTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Commitment commitmentResource = Commitment.newBuilder().build();
 
     Operation actualResponse =
@@ -273,7 +273,7 @@ public void insertRegionCommitmentExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Commitment commitmentResource = Commitment.newBuilder().build();
 
       client.insertRegionCommitment(requestId, region, commitmentResource);
@@ -301,7 +301,7 @@ public void listRegionCommitmentsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRegionCommitmentsPagedResponse pagedListResponse = client.listRegionCommitments(region);
 
@@ -326,7 +326,7 @@ public void listRegionCommitmentsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRegionCommitments(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java
index 2188e03877f5..2672ab4e7b4d 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java
@@ -89,16 +89,16 @@ public static void tearDown() throws Exception {
   public void getRegionInstanceGroupTest() {
     String kind = "kind3292052";
     String description = "description-1724546052";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     Integer size = 3530753;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     String creationTimestamp = "creationTimestamp567396278";
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InstanceGroup expectedResponse = InstanceGroup.newBuilder()
       .setKind(kind)
       .setDescription(description)
@@ -164,7 +164,7 @@ public void listRegionInstanceGroupsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRegionInstanceGroupsPagedResponse pagedListResponse = client.listRegionInstanceGroups(region);
 
@@ -189,7 +189,7 @@ public void listRegionInstanceGroupsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRegionInstanceGroups(region);
       Assert.fail("No exception raised");
@@ -263,7 +263,7 @@ public void setNamedPortsRegionInstanceGroupTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -272,7 +272,7 @@ public void setNamedPortsRegionInstanceGroupTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java
index 06497170a9d2..eae2e6958105 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java
@@ -108,7 +108,7 @@ public void abandonInstancesRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -117,7 +117,7 @@ public void abandonInstancesRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -192,7 +192,7 @@ public void deleteRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -201,7 +201,7 @@ public void deleteRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -274,7 +274,7 @@ public void deleteInstancesRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -283,7 +283,7 @@ public void deleteInstancesRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -350,19 +350,19 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce
   @Test
   @SuppressWarnings("all")
   public void getRegionInstanceGroupManagerTest() {
-    InstanceTemplateName instanceTemplate = InstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+    ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
     String kind = "kind3292052";
     String description = "description-1724546052";
     String baseInstanceName = "baseInstanceName389106439";
-    InstanceGroupName instanceGroup = InstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
+    ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
     String selfLink = "selfLink-1691268851";
     Integer targetSize = 2084603409;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String creationTimestamp = "creationTimestamp567396278";
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder()
       .setInstanceTemplate(instanceTemplate.toString())
       .setKind(kind)
@@ -422,7 +422,7 @@ public void insertRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -431,7 +431,7 @@ public void insertRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -461,7 +461,7 @@ public void insertRegionInstanceGroupManagerTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
 
     Operation actualResponse =
@@ -485,7 +485,7 @@ public void insertRegionInstanceGroupManagerExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
 
       client.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource);
@@ -513,7 +513,7 @@ public void listRegionInstanceGroupManagersTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRegionInstanceGroupManagersPagedResponse pagedListResponse = client.listRegionInstanceGroupManagers(region);
 
@@ -538,7 +538,7 @@ public void listRegionInstanceGroupManagersExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRegionInstanceGroupManagers(region);
       Assert.fail("No exception raised");
@@ -595,7 +595,7 @@ public void recreateInstancesRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -604,7 +604,7 @@ public void recreateInstancesRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -679,7 +679,7 @@ public void resizeRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -688,7 +688,7 @@ public void resizeRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -763,7 +763,7 @@ public void setInstanceTemplateRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -772,7 +772,7 @@ public void setInstanceTemplateRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -847,7 +847,7 @@ public void setTargetPoolsRegionInstanceGroupManagerTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -856,7 +856,7 @@ public void setTargetPoolsRegionInstanceGroupManagerTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java
index 89578e70cf28..d4081cce35ba 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java
@@ -126,7 +126,7 @@ public void getRegionOperationTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -135,7 +135,7 @@ public void getRegionOperationTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -213,7 +213,7 @@ public void listRegionOperationsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRegionOperationsPagedResponse pagedListResponse = client.listRegionOperations(region);
 
@@ -238,7 +238,7 @@ public void listRegionOperationsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRegionOperations(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java
index 77f10d0a7da3..ac7634c65948 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java
@@ -94,7 +94,7 @@ public void deleteRouteTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -103,7 +103,7 @@ public void deleteRouteTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -132,7 +132,7 @@ public void deleteRouteTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+    ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -155,7 +155,7 @@ public void deleteRouteExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+      ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
       String requestId = "requestId37109963";
 
       client.deleteRoute(route, requestId);
@@ -174,7 +174,7 @@ public void getRouteTest() {
     String description = "description-1724546052";
     Integer priority = 1165461084;
     String nextHopNetwork = "nextHopNetwork1872908524";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     String nextHopInstance = "nextHopInstance1467250071";
     String creationTimestamp = "creationTimestamp567396278";
@@ -202,7 +202,7 @@ public void getRouteTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+    ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
 
     Route actualResponse =
         client.getRoute(route);
@@ -224,7 +224,7 @@ public void getRouteExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouteName route = RouteName.of("[PROJECT]", "[ROUTE]");
+      ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
 
       client.getRoute(route);
       Assert.fail("No exception raised");
@@ -244,7 +244,7 @@ public void insertRouteTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -253,7 +253,7 @@ public void insertRouteTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java
index 0e672ea4a924..1f795b5f6e40 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java
@@ -158,7 +158,7 @@ public void deleteRouterTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -167,7 +167,7 @@ public void deleteRouterTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -196,7 +196,7 @@ public void deleteRouterTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -219,7 +219,7 @@ public void deleteRouterExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+      ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
       String requestId = "requestId37109963";
 
       client.deleteRouter(router, requestId);
@@ -237,8 +237,8 @@ public void getRouterTest() {
     String name = "name3373707";
     String description = "description-1724546052";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     Router expectedResponse = Router.newBuilder()
       .setKind(kind)
@@ -252,7 +252,7 @@ public void getRouterTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
 
     Router actualResponse =
         client.getRouter(router);
@@ -274,7 +274,7 @@ public void getRouterExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+      ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
 
       client.getRouter(router);
       Assert.fail("No exception raised");
@@ -292,7 +292,7 @@ public void getRouterStatusRouterTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
 
     RouterStatusResponse actualResponse =
         client.getRouterStatusRouter(router);
@@ -314,7 +314,7 @@ public void getRouterStatusRouterExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+      ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
 
       client.getRouterStatusRouter(router);
       Assert.fail("No exception raised");
@@ -334,7 +334,7 @@ public void insertRouterTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -343,7 +343,7 @@ public void insertRouterTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -373,7 +373,7 @@ public void insertRouterTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Router routerResource = Router.newBuilder().build();
 
     Operation actualResponse =
@@ -397,7 +397,7 @@ public void insertRouterExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Router routerResource = Router.newBuilder().build();
 
       client.insertRouter(requestId, region, routerResource);
@@ -425,7 +425,7 @@ public void listRoutersTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListRoutersPagedResponse pagedListResponse = client.listRouters(region);
 
@@ -450,7 +450,7 @@ public void listRoutersExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listRouters(region);
       Assert.fail("No exception raised");
@@ -470,7 +470,7 @@ public void patchRouterTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -479,7 +479,7 @@ public void patchRouterTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -508,7 +508,7 @@ public void patchRouterTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
     String requestId = "requestId37109963";
     Router routerResource = Router.newBuilder().build();
 
@@ -532,7 +532,7 @@ public void patchRouterExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+      ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
       String requestId = "requestId37109963";
       Router routerResource = Router.newBuilder().build();
 
@@ -549,7 +549,7 @@ public void previewRouterTest() {
     RoutersPreviewResponse expectedResponse = RoutersPreviewResponse.newBuilder().build();
     mockService.addResponse(expectedResponse);
 
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
     Router routerResource = Router.newBuilder().build();
 
     RoutersPreviewResponse actualResponse =
@@ -572,7 +572,7 @@ public void previewRouterExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+      ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
       Router routerResource = Router.newBuilder().build();
 
       client.previewRouter(router, routerResource);
@@ -593,7 +593,7 @@ public void updateRouterTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -602,7 +602,7 @@ public void updateRouterTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -631,7 +631,7 @@ public void updateRouterTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
     String requestId = "requestId37109963";
     Router routerResource = Router.newBuilder().build();
 
@@ -655,7 +655,7 @@ public void updateRouterExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+      ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
       String requestId = "requestId37109963";
       Router routerResource = Router.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java
index e96ea16acdbf..9b9b31a87180 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java
@@ -94,7 +94,7 @@ public void deleteSnapshotTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -103,7 +103,7 @@ public void deleteSnapshotTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -133,7 +133,7 @@ public void deleteSnapshotTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+    ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
 
     Operation actualResponse =
         client.deleteSnapshot(requestId, snapshot);
@@ -156,7 +156,7 @@ public void deleteSnapshotExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+      ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
 
       client.deleteSnapshot(requestId, snapshot);
       Assert.fail("No exception raised");
@@ -198,7 +198,7 @@ public void getSnapshotTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+    ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
 
     Snapshot actualResponse =
         client.getSnapshot(snapshot);
@@ -220,7 +220,7 @@ public void getSnapshotExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+      ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
 
       client.getSnapshot(snapshot);
       Assert.fail("No exception raised");
@@ -292,7 +292,7 @@ public void setLabelsSnapshotTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -301,7 +301,7 @@ public void setLabelsSnapshotTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -330,7 +330,7 @@ public void setLabelsSnapshotTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+    ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
     GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -353,7 +353,7 @@ public void setLabelsSnapshotExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[RESOURCE]");
+      ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
       GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
 
       client.setLabelsSnapshot(resource, globalSetLabelsRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java
index b41ba14e18da..444754680e86 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java
@@ -94,7 +94,7 @@ public void deleteSslCertificateTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -103,7 +103,7 @@ public void deleteSslCertificateTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -132,7 +132,7 @@ public void deleteSslCertificateTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+    ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -155,7 +155,7 @@ public void deleteSslCertificateExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+      ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
       String requestId = "requestId37109963";
 
       client.deleteSslCertificate(sslCertificate, requestId);
@@ -188,7 +188,7 @@ public void getSslCertificateTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+    ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
 
     SslCertificate actualResponse =
         client.getSslCertificate(sslCertificate);
@@ -210,7 +210,7 @@ public void getSslCertificateExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      SslCertificateName sslCertificate = SslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+      ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
 
       client.getSslCertificate(sslCertificate);
       Assert.fail("No exception raised");
@@ -230,7 +230,7 @@ public void insertSslCertificateTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -239,7 +239,7 @@ public void insertSslCertificateTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java
index c9c91faf539f..655216d0dcc9 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java
@@ -156,7 +156,7 @@ public void deleteSubnetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -165,7 +165,7 @@ public void deleteSubnetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -195,7 +195,7 @@ public void deleteSubnetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
 
     Operation actualResponse =
         client.deleteSubnetwork(requestId, subnetwork);
@@ -218,7 +218,7 @@ public void deleteSubnetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+      ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
 
       client.deleteSubnetwork(requestId, subnetwork);
       Assert.fail("No exception raised");
@@ -238,7 +238,7 @@ public void expandIpCidrRangeSubnetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -247,7 +247,7 @@ public void expandIpCidrRangeSubnetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -277,7 +277,7 @@ public void expandIpCidrRangeSubnetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -301,7 +301,7 @@ public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+      ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
       SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
 
       client.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource);
@@ -317,14 +317,14 @@ public void getSubnetworkTest() {
     Boolean privateIpGoogleAccess = true;
     String kind = "kind3292052";
     String description = "description-1724546052";
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     String creationTimestamp = "creationTimestamp567396278";
     String fingerprint = "fingerprint-1375934236";
     String name = "name3373707";
     String gatewayAddress = "gatewayAddress-77003527";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String ipCidrRange = "ipCidrRange-2049366326";
     Subnetwork expectedResponse = Subnetwork.newBuilder()
       .setPrivateIpGoogleAccess(privateIpGoogleAccess)
@@ -342,7 +342,7 @@ public void getSubnetworkTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
 
     Subnetwork actualResponse =
         client.getSubnetwork(subnetwork);
@@ -364,7 +364,7 @@ public void getSubnetworkExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+      ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
 
       client.getSubnetwork(subnetwork);
       Assert.fail("No exception raised");
@@ -384,7 +384,7 @@ public void insertSubnetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -393,7 +393,7 @@ public void insertSubnetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -423,7 +423,7 @@ public void insertSubnetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
 
     Operation actualResponse =
@@ -447,7 +447,7 @@ public void insertSubnetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
 
       client.insertSubnetwork(requestId, region, subnetworkResource);
@@ -475,7 +475,7 @@ public void listSubnetworksTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListSubnetworksPagedResponse pagedListResponse = client.listSubnetworks(region);
 
@@ -500,7 +500,7 @@ public void listSubnetworksExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listSubnetworks(region);
       Assert.fail("No exception raised");
@@ -520,7 +520,7 @@ public void patchSubnetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -529,7 +529,7 @@ public void patchSubnetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -559,7 +559,7 @@ public void patchSubnetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
 
     Operation actualResponse =
@@ -583,7 +583,7 @@ public void patchSubnetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+      ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
       Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
 
       client.patchSubnetwork(requestId, subnetwork, subnetworkResource);
@@ -604,7 +604,7 @@ public void setPrivateIpGoogleAccessSubnetworkTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -613,7 +613,7 @@ public void setPrivateIpGoogleAccessSubnetworkTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -643,7 +643,7 @@ public void setPrivateIpGoogleAccessSubnetworkTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+    ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
     SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -667,7 +667,7 @@ public void setPrivateIpGoogleAccessSubnetworkExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      SubnetworkName subnetwork = SubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
+      ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
       SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
 
       client.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java
index 06bb99030fa0..a0885637aa53 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java
@@ -96,7 +96,7 @@ public void deleteTargetHttpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -105,7 +105,7 @@ public void deleteTargetHttpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -135,7 +135,7 @@ public void deleteTargetHttpProxyTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+    ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
 
     Operation actualResponse =
         client.deleteTargetHttpProxy(requestId, targetHttpProxy);
@@ -158,7 +158,7 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+      ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
 
       client.deleteTargetHttpProxy(requestId, targetHttpProxy);
       Assert.fail("No exception raised");
@@ -170,7 +170,7 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getTargetHttpProxyTest() {
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -188,7 +188,7 @@ public void getTargetHttpProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+    ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
 
     TargetHttpProxy actualResponse =
         client.getTargetHttpProxy(targetHttpProxy);
@@ -210,7 +210,7 @@ public void getTargetHttpProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+      ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
 
       client.getTargetHttpProxy(targetHttpProxy);
       Assert.fail("No exception raised");
@@ -230,7 +230,7 @@ public void insertTargetHttpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -239,7 +239,7 @@ public void insertTargetHttpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -366,7 +366,7 @@ public void setUrlMapTargetHttpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -375,7 +375,7 @@ public void setUrlMapTargetHttpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -405,7 +405,7 @@ public void setUrlMapTargetHttpProxyTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+    ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
     UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
 
     Operation actualResponse =
@@ -429,7 +429,7 @@ public void setUrlMapTargetHttpProxyExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetHttpProxyName targetHttpProxy = TargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+      ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
       UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
 
       client.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java
index 41167c782ea2..0cb05694e412 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java
@@ -98,7 +98,7 @@ public void deleteTargetHttpsProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteTargetHttpsProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -136,7 +136,7 @@ public void deleteTargetHttpsProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+    ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -159,7 +159,7 @@ public void deleteTargetHttpsProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+      ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
       String requestId = "requestId37109963";
 
       client.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
@@ -172,7 +172,7 @@ public void deleteTargetHttpsProxyExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getTargetHttpsProxyTest() {
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -190,7 +190,7 @@ public void getTargetHttpsProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+    ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
 
     TargetHttpsProxy actualResponse =
         client.getTargetHttpsProxy(targetHttpsProxy);
@@ -212,7 +212,7 @@ public void getTargetHttpsProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+      ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
 
       client.getTargetHttpsProxy(targetHttpsProxy);
       Assert.fail("No exception raised");
@@ -232,7 +232,7 @@ public void insertTargetHttpsProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -241,7 +241,7 @@ public void insertTargetHttpsProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -368,7 +368,7 @@ public void setSslCertificatesTargetHttpsProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -377,7 +377,7 @@ public void setSslCertificatesTargetHttpsProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -406,7 +406,7 @@ public void setSslCertificatesTargetHttpsProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+    ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
     String requestId = "requestId37109963";
     TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
 
@@ -430,7 +430,7 @@ public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+      ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
       String requestId = "requestId37109963";
       TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
 
@@ -452,7 +452,7 @@ public void setUrlMapTargetHttpsProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -461,7 +461,7 @@ public void setUrlMapTargetHttpsProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -490,7 +490,7 @@ public void setUrlMapTargetHttpsProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+    ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
     String requestId = "requestId37109963";
     UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
 
@@ -514,7 +514,7 @@ public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetHttpsProxyName targetHttpsProxy = TargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+      ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
       String requestId = "requestId37109963";
       UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java
index a9aabe2c5063..3c87d662b70d 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java
@@ -150,7 +150,7 @@ public void deleteTargetInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -159,7 +159,7 @@ public void deleteTargetInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -189,7 +189,7 @@ public void deleteTargetInstanceTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+    ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
 
     Operation actualResponse =
         client.deleteTargetInstance(requestId, targetInstance);
@@ -212,7 +212,7 @@ public void deleteTargetInstanceExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+      ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
 
       client.deleteTargetInstance(requestId, targetInstance);
       Assert.fail("No exception raised");
@@ -224,8 +224,8 @@ public void deleteTargetInstanceExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getTargetInstanceTest() {
-    InstanceName instance = InstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String kind = "kind3292052";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -246,7 +246,7 @@ public void getTargetInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+    ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
 
     TargetInstance actualResponse =
         client.getTargetInstance(targetInstance);
@@ -268,7 +268,7 @@ public void getTargetInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetInstanceName targetInstance = TargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
+      ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
 
       client.getTargetInstance(targetInstance);
       Assert.fail("No exception raised");
@@ -288,7 +288,7 @@ public void insertTargetInstanceTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone2 = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -297,7 +297,7 @@ public void insertTargetInstanceTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -326,7 +326,7 @@ public void insertTargetInstanceTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String requestId = "requestId37109963";
     TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
 
@@ -350,7 +350,7 @@ public void insertTargetInstanceExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
       String requestId = "requestId37109963";
       TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
 
@@ -379,7 +379,7 @@ public void listTargetInstancesTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListTargetInstancesPagedResponse pagedListResponse = client.listTargetInstances(zone);
 
@@ -404,7 +404,7 @@ public void listTargetInstancesExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listTargetInstances(zone);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java
index 4897c6775312..879f47d46905 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java
@@ -109,7 +109,7 @@ public void addHealthCheckTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -118,7 +118,7 @@ public void addHealthCheckTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -147,7 +147,7 @@ public void addHealthCheckTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     String requestId = "requestId37109963";
     TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
 
@@ -171,7 +171,7 @@ public void addHealthCheckTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       String requestId = "requestId37109963";
       TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
 
@@ -193,7 +193,7 @@ public void addInstanceTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -202,7 +202,7 @@ public void addInstanceTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -231,7 +231,7 @@ public void addInstanceTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     String requestId = "requestId37109963";
     TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
 
@@ -255,7 +255,7 @@ public void addInstanceTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       String requestId = "requestId37109963";
       TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
 
@@ -330,7 +330,7 @@ public void deleteTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -339,7 +339,7 @@ public void deleteTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -368,7 +368,7 @@ public void deleteTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -391,7 +391,7 @@ public void deleteTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       String requestId = "requestId37109963";
 
       client.deleteTargetPool(targetPool, requestId);
@@ -411,7 +411,7 @@ public void getTargetPoolTest() {
     String description = "description-1724546052";
     Float failoverRatio = -8.6107481E7F;
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String backupPool = "backupPool1119626361";
     String selfLink = "selfLink-1691268851";
     TargetPool expectedResponse = TargetPool.newBuilder()
@@ -428,7 +428,7 @@ public void getTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
 
     TargetPool actualResponse =
         client.getTargetPool(targetPool);
@@ -450,7 +450,7 @@ public void getTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
 
       client.getTargetPool(targetPool);
       Assert.fail("No exception raised");
@@ -468,7 +468,7 @@ public void getHealthTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
 
     TargetPoolInstanceHealth actualResponse =
@@ -491,7 +491,7 @@ public void getHealthTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
 
       client.getHealthTargetPool(targetPool, instanceReferenceResource);
@@ -512,7 +512,7 @@ public void insertTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -521,7 +521,7 @@ public void insertTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -551,7 +551,7 @@ public void insertTargetPoolTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     TargetPool targetPoolResource = TargetPool.newBuilder().build();
 
     Operation actualResponse =
@@ -575,7 +575,7 @@ public void insertTargetPoolExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       TargetPool targetPoolResource = TargetPool.newBuilder().build();
 
       client.insertTargetPool(requestId, region, targetPoolResource);
@@ -603,7 +603,7 @@ public void listTargetPoolsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListTargetPoolsPagedResponse pagedListResponse = client.listTargetPools(region);
 
@@ -628,7 +628,7 @@ public void listTargetPoolsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listTargetPools(region);
       Assert.fail("No exception raised");
@@ -648,7 +648,7 @@ public void removeHealthCheckTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -657,7 +657,7 @@ public void removeHealthCheckTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -686,7 +686,7 @@ public void removeHealthCheckTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     String requestId = "requestId37109963";
     TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
 
@@ -710,7 +710,7 @@ public void removeHealthCheckTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       String requestId = "requestId37109963";
       TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
 
@@ -732,7 +732,7 @@ public void removeInstanceTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -741,7 +741,7 @@ public void removeInstanceTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -770,7 +770,7 @@ public void removeInstanceTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     String requestId = "requestId37109963";
     TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
 
@@ -794,7 +794,7 @@ public void removeInstanceTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       String requestId = "requestId37109963";
       TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
 
@@ -816,7 +816,7 @@ public void setBackupTargetPoolTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -825,7 +825,7 @@ public void setBackupTargetPoolTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -854,7 +854,7 @@ public void setBackupTargetPoolTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+    ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
     String requestId = "requestId37109963";
     Float failoverRatio = -8.6107481E7F;
     TargetReference targetReferenceResource = TargetReference.newBuilder().build();
@@ -879,7 +879,7 @@ public void setBackupTargetPoolExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetPoolName targetPool = TargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
+      ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
       String requestId = "requestId37109963";
       Float failoverRatio = -8.6107481E7F;
       TargetReference targetReferenceResource = TargetReference.newBuilder().build();
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java
index 84122ee7a8cd..14158337d4a5 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java
@@ -100,7 +100,7 @@ public void deleteTargetSslProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -109,7 +109,7 @@ public void deleteTargetSslProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -138,7 +138,7 @@ public void deleteTargetSslProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+    ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -161,7 +161,7 @@ public void deleteTargetSslProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+      ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
       String requestId = "requestId37109963";
 
       client.deleteTargetSslProxy(targetSslProxy, requestId);
@@ -194,7 +194,7 @@ public void getTargetSslProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+    ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
 
     TargetSslProxy actualResponse =
         client.getTargetSslProxy(targetSslProxy);
@@ -216,7 +216,7 @@ public void getTargetSslProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+      ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
 
       client.getTargetSslProxy(targetSslProxy);
       Assert.fail("No exception raised");
@@ -236,7 +236,7 @@ public void insertTargetSslProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -245,7 +245,7 @@ public void insertTargetSslProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -372,7 +372,7 @@ public void setBackendServiceTargetSslProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -381,7 +381,7 @@ public void setBackendServiceTargetSslProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -410,7 +410,7 @@ public void setBackendServiceTargetSslProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+    ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
     String requestId = "requestId37109963";
     TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
 
@@ -434,7 +434,7 @@ public void setBackendServiceTargetSslProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+      ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
       String requestId = "requestId37109963";
       TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
 
@@ -456,7 +456,7 @@ public void setProxyHeaderTargetSslProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -465,7 +465,7 @@ public void setProxyHeaderTargetSslProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -494,7 +494,7 @@ public void setProxyHeaderTargetSslProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+    ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
     String requestId = "requestId37109963";
     TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
 
@@ -518,7 +518,7 @@ public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+      ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
       String requestId = "requestId37109963";
       TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
 
@@ -540,7 +540,7 @@ public void setSslCertificatesTargetSslProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -549,7 +549,7 @@ public void setSslCertificatesTargetSslProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -578,7 +578,7 @@ public void setSslCertificatesTargetSslProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+    ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
     String requestId = "requestId37109963";
     TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
 
@@ -602,7 +602,7 @@ public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetSslProxyName targetSslProxy = TargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+      ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
       String requestId = "requestId37109963";
       TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
 
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java
index f34ccf108a68..1fbc16cbe0ec 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java
@@ -98,7 +98,7 @@ public void deleteTargetTcpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -107,7 +107,7 @@ public void deleteTargetTcpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -137,7 +137,7 @@ public void deleteTargetTcpProxyTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+    ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
 
     Operation actualResponse =
         client.deleteTargetTcpProxy(requestId, targetTcpProxy);
@@ -160,7 +160,7 @@ public void deleteTargetTcpProxyExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+      ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
 
       client.deleteTargetTcpProxy(requestId, targetTcpProxy);
       Assert.fail("No exception raised");
@@ -192,7 +192,7 @@ public void getTargetTcpProxyTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+    ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
 
     TargetTcpProxy actualResponse =
         client.getTargetTcpProxy(targetTcpProxy);
@@ -214,7 +214,7 @@ public void getTargetTcpProxyExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+      ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
 
       client.getTargetTcpProxy(targetTcpProxy);
       Assert.fail("No exception raised");
@@ -234,7 +234,7 @@ public void insertTargetTcpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -243,7 +243,7 @@ public void insertTargetTcpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -370,7 +370,7 @@ public void setBackendServiceTargetTcpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -379,7 +379,7 @@ public void setBackendServiceTargetTcpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -409,7 +409,7 @@ public void setBackendServiceTargetTcpProxyTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+    ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
     TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -433,7 +433,7 @@ public void setBackendServiceTargetTcpProxyExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+      ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
       TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
 
       client.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource);
@@ -454,7 +454,7 @@ public void setProxyHeaderTargetTcpProxyTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -463,7 +463,7 @@ public void setProxyHeaderTargetTcpProxyTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -493,7 +493,7 @@ public void setProxyHeaderTargetTcpProxyTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+    ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
     TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
 
     Operation actualResponse =
@@ -517,7 +517,7 @@ public void setProxyHeaderTargetTcpProxyExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetTcpProxyName targetTcpProxy = TargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+      ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
       TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
 
       client.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java
index 45b3056d0a66..092270a7ece7 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java
@@ -150,7 +150,7 @@ public void deleteTargetVpnGatewayTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -159,7 +159,7 @@ public void deleteTargetVpnGatewayTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -189,7 +189,7 @@ public void deleteTargetVpnGatewayTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+    ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
 
     Operation actualResponse =
         client.deleteTargetVpnGateway(requestId, targetVpnGateway);
@@ -212,7 +212,7 @@ public void deleteTargetVpnGatewayExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+      ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
 
       client.deleteTargetVpnGateway(requestId, targetVpnGateway);
       Assert.fail("No exception raised");
@@ -229,8 +229,8 @@ public void getTargetVpnGatewayTest() {
     String name = "name3373707";
     String description = "description-1724546052";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
-    NetworkName network = NetworkName.of("[PROJECT]", "[NETWORK]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+    ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
     String selfLink = "selfLink-1691268851";
     String status = "status-892481550";
     TargetVpnGateway expectedResponse = TargetVpnGateway.newBuilder()
@@ -246,7 +246,7 @@ public void getTargetVpnGatewayTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+    ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
 
     TargetVpnGateway actualResponse =
         client.getTargetVpnGateway(targetVpnGateway);
@@ -268,7 +268,7 @@ public void getTargetVpnGatewayExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+      ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
 
       client.getTargetVpnGateway(targetVpnGateway);
       Assert.fail("No exception raised");
@@ -288,7 +288,7 @@ public void insertTargetVpnGatewayTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -297,7 +297,7 @@ public void insertTargetVpnGatewayTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -327,7 +327,7 @@ public void insertTargetVpnGatewayTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
 
     Operation actualResponse =
@@ -351,7 +351,7 @@ public void insertTargetVpnGatewayExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
 
       client.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource);
@@ -379,7 +379,7 @@ public void listTargetVpnGatewaysTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListTargetVpnGatewaysPagedResponse pagedListResponse = client.listTargetVpnGateways(region);
 
@@ -404,7 +404,7 @@ public void listTargetVpnGatewaysExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listTargetVpnGateways(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java
index 75931112bd02..c6da9d875235 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java
@@ -102,7 +102,7 @@ public void deleteUrlMapTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -111,7 +111,7 @@ public void deleteUrlMapTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -140,7 +140,7 @@ public void deleteUrlMapTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     String requestId = "requestId37109963";
 
     Operation actualResponse =
@@ -163,7 +163,7 @@ public void deleteUrlMapExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+      ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
       String requestId = "requestId37109963";
 
       client.deleteUrlMap(urlMap, requestId);
@@ -196,7 +196,7 @@ public void getUrlMapTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
 
     UrlMap actualResponse =
         client.getUrlMap(urlMap);
@@ -218,7 +218,7 @@ public void getUrlMapExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+      ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
 
       client.getUrlMap(urlMap);
       Assert.fail("No exception raised");
@@ -238,7 +238,7 @@ public void insertUrlMapTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -247,7 +247,7 @@ public void insertUrlMapTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -322,7 +322,7 @@ public void invalidateCacheUrlMapTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -331,7 +331,7 @@ public void invalidateCacheUrlMapTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -360,7 +360,7 @@ public void invalidateCacheUrlMapTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     String requestId = "requestId37109963";
     CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
 
@@ -384,7 +384,7 @@ public void invalidateCacheUrlMapExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+      ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
       String requestId = "requestId37109963";
       CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
 
@@ -458,7 +458,7 @@ public void patchUrlMapTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -467,7 +467,7 @@ public void patchUrlMapTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -496,7 +496,7 @@ public void patchUrlMapTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     String requestId = "requestId37109963";
     UrlMap urlMapResource = UrlMap.newBuilder().build();
 
@@ -520,7 +520,7 @@ public void patchUrlMapExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+      ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
       String requestId = "requestId37109963";
       UrlMap urlMapResource = UrlMap.newBuilder().build();
 
@@ -542,7 +542,7 @@ public void updateUrlMapTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -551,7 +551,7 @@ public void updateUrlMapTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -580,7 +580,7 @@ public void updateUrlMapTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     String requestId = "requestId37109963";
     UrlMap urlMapResource = UrlMap.newBuilder().build();
 
@@ -604,7 +604,7 @@ public void updateUrlMapExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+      ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
       String requestId = "requestId37109963";
       UrlMap urlMapResource = UrlMap.newBuilder().build();
 
@@ -621,7 +621,7 @@ public void validateUrlMapTest() {
     UrlMapsValidateResponse expectedResponse = UrlMapsValidateResponse.newBuilder().build();
     mockService.addResponse(expectedResponse);
 
-    UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+    ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
     UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
 
     UrlMapsValidateResponse actualResponse =
@@ -644,7 +644,7 @@ public void validateUrlMapExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      UrlMapName urlMap = UrlMapName.of("[PROJECT]", "[URL_MAP]");
+      ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
       UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
 
       client.validateUrlMap(urlMap, urlMapsValidateRequestResource);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java
index 37a95bb7160b..e5c095c56b37 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java
@@ -150,7 +150,7 @@ public void deleteVpnTunnelTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -159,7 +159,7 @@ public void deleteVpnTunnelTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -189,7 +189,7 @@ public void deleteVpnTunnelTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+    ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
 
     Operation actualResponse =
         client.deleteVpnTunnel(requestId, vpnTunnel);
@@ -212,7 +212,7 @@ public void deleteVpnTunnelExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+      ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
 
       client.deleteVpnTunnel(requestId, vpnTunnel);
       Assert.fail("No exception raised");
@@ -229,15 +229,15 @@ public void getVpnTunnelTest() {
     String description = "description-1724546052";
     Integer ikeVersion = 1292118044;
     String selfLink = "selfLink-1691268851";
-    RouterName router = RouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+    ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
     String detailedStatus = "detailedStatus-740240799";
     String peerIp = "peerIp-690492124";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String sharedSecret = "sharedSecret-154938422";
-    TargetVpnGatewayName targetVpnGateway = TargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
+    ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
     String status = "status-892481550";
     VpnTunnel expectedResponse = VpnTunnel.newBuilder()
       .setSharedSecretHash(sharedSecretHash)
@@ -258,7 +258,7 @@ public void getVpnTunnelTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+    ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
 
     VpnTunnel actualResponse =
         client.getVpnTunnel(vpnTunnel);
@@ -280,7 +280,7 @@ public void getVpnTunnelExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      VpnTunnelName vpnTunnel = VpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
+      ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
 
       client.getVpnTunnel(vpnTunnel);
       Assert.fail("No exception raised");
@@ -300,7 +300,7 @@ public void insertVpnTunnelTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -309,7 +309,7 @@ public void insertVpnTunnelTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region2 = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -339,7 +339,7 @@ public void insertVpnTunnelTest() {
     mockService.addResponse(expectedResponse);
 
     String requestId = "requestId37109963";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
 
     Operation actualResponse =
@@ -363,7 +363,7 @@ public void insertVpnTunnelExceptionTest() throws Exception {
 
     try {
       String requestId = "requestId37109963";
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
       VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
 
       client.insertVpnTunnel(requestId, region, vpnTunnelResource);
@@ -391,7 +391,7 @@ public void listVpnTunnelsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
     ListVpnTunnelsPagedResponse pagedListResponse = client.listVpnTunnels(region);
 
@@ -416,7 +416,7 @@ public void listVpnTunnelsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+      ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
 
       client.listVpnTunnels(region);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java
index ac87bd38b760..cef554719f45 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java
@@ -87,7 +87,7 @@ public void getZoneTest() {
     String name = "name3373707";
     String description = "description-1724546052";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String selfLink = "selfLink-1691268851";
     String status = "status-892481550";
     Zone expectedResponse = Zone.newBuilder()
@@ -102,7 +102,7 @@ public void getZoneTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     Zone actualResponse =
         client.getZone(zone);
@@ -124,7 +124,7 @@ public void getZoneExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.getZone(zone);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java
index f3315753f23a..22ac205e602f 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java
@@ -126,7 +126,7 @@ public void getZoneOperationTest() {
     String selfLink = "selfLink-1691268851";
     String insertTime = "insertTime-103148397";
     Integer httpErrorStatusCode = 1386087020;
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
     String targetLink = "targetLink-2084812312";
     String creationTimestamp = "creationTimestamp567396278";
     String name = "name3373707";
@@ -135,7 +135,7 @@ public void getZoneOperationTest() {
     String startTime = "startTime-1573145462";
     String endTime = "endTime1725551537";
     String id = "id3355";
-    RegionName region = RegionName.of("[PROJECT]", "[REGION]");
+    ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
     String clientOperationId = "clientOperationId-239630617";
     String user = "user3599307";
     String status = "status-892481550";
@@ -213,7 +213,7 @@ public void listZoneOperationsTest() {
       .build();
     mockService.addResponse(expectedResponse);
 
-    ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+    ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
     ListZoneOperationsPagedResponse pagedListResponse = client.listZoneOperations(zone);
 
@@ -238,7 +238,7 @@ public void listZoneOperationsExceptionTest() throws Exception {
     mockService.addException(exception);
 
     try {
-      ZoneName zone = ZoneName.of("[PROJECT]", "[ZONE]");
+      ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
 
       client.listZoneOperations(zone);
       Assert.fail("No exception raised");
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java
index 884e0bb44c59..4662f685621f 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java
@@ -33,6 +33,8 @@
 import com.google.cloud.compute.v1.DiskTypesScopedList;
 import com.google.cloud.compute.v1.ListDiskTypesHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
+import com.google.cloud.compute.v1.ProjectZoneDiskTypeName;
+import com.google.cloud.compute.v1.ProjectZoneName;
 import com.google.cloud.compute.v1.ZoneName;
 import com.google.common.collect.Lists;
 import java.io.IOException;
@@ -75,7 +77,8 @@ public static void tearDown() throws Exception {
 
   @Test
   public void testGetDiskType() {
-    DiskType diskType = diskTypeClient.getDiskType(DiskTypeName.of(DISK_TYPE, DEFAULT_PROJECT, ZONE));
+    DiskType diskType = diskTypeClient.getDiskType(
+        ProjectZoneDiskTypeName.of(DISK_TYPE, DEFAULT_PROJECT, ZONE));
     DiskTypeName returnDiskName = DiskTypeName.parse(trimUrl(diskType.getSelfLink()));
     assertEquals(ZONE, returnDiskName.getZone());
     assertEquals(DISK_TYPE, returnDiskName.getDiskType());
@@ -87,7 +90,7 @@ public void testGetDiskType() {
 
   @Test
   public void testListDiskTypes() {
-    Page diskPage = diskTypeClient.listDiskTypes(ZoneName.of(DEFAULT_PROJECT, ZONE)).getPage();
+    Page diskPage = diskTypeClient.listDiskTypes(ProjectZoneName.of(DEFAULT_PROJECT, ZONE)).getPage();
     Iterator diskTypeIterator = diskPage.iterateAll().iterator();
     assertTrue(diskTypeIterator.hasNext());
     while (diskTypeIterator.hasNext()) {

From 5ea733b81a2aa0e412c341c963eca0d9eb517475 Mon Sep 17 00:00:00 2001
From: Andrea Lin 
Date: Tue, 3 Apr 2018 16:43:32 -0700
Subject: [PATCH 12/42] remove LicensClientTest.java

---
 .../cloud/compute/v1/LicensClientTest.java    | 125 ------------------
 1 file changed, 125 deletions(-)
 delete mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java

diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java
deleted file mode 100644
index 8ce2dfa4adfd..000000000000
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicensClientTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2018 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.compute.v1;
-
-import com.google.api.gax.core.NoCredentialsProvider;
-import com.google.api.gax.httpjson.ApiMethodDescriptor;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.testing.MockHttpService;
-import com.google.api.gax.rpc.ApiClientHeaderProvider;
-import com.google.api.gax.rpc.ApiException;
-import com.google.api.gax.rpc.ApiExceptionFactory;
-import com.google.api.gax.rpc.InvalidArgumentException;
-import com.google.api.gax.rpc.StatusCode.Code;
-import com.google.api.gax.rpc.testing.FakeStatusCode;
-import static com.google.cloud.compute.v1.stub.HttpJsonLicensStub.getLicensMethodDescriptor;
-import com.google.cloud.compute.v1.stub.LicensStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-@javax.annotation.Generated("by GAPIC")
-public class LicensClientTest {
-
-   private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf(
-        Lists.newArrayList(
-          getLicensMethodDescriptor
-        ));
-  private static final MockHttpService mockService
-      = new MockHttpService(METHOD_DESCRIPTORS, LicensStubSettings.getDefaultEndpoint());
-
-  private static LicensClient client;
-  private static LicensSettings clientSettings;
-
-  @BeforeClass
-  public static void setUp() throws IOException {
-    clientSettings =
-        LicensSettings.newBuilder()
-           .setTransportChannelProvider(
-               LicensSettings.defaultHttpJsonTransportProviderBuilder()
-                   .setHttpTransport(mockService).build())
-           .setCredentialsProvider(NoCredentialsProvider.create())
-           .build();
-    client =
-       LicensClient.create(clientSettings);
-  }
-
-  @After
-  public void cleanUp() {
-    mockService.reset();
-  }
-
-  @AfterClass
-  public static void tearDown() throws Exception {
-    client.close();
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void getLicensTest() {
-    Boolean chargesUseFee = true;
-    String kind = "kind3292052";
-    String name = "name3373707";
-    String selfLink = "selfLink-1691268851";
-    License expectedResponse = License.newBuilder()
-      .setChargesUseFee(chargesUseFee)
-      .setKind(kind)
-      .setName(name)
-      .setSelfLink(selfLink)
-      .build();
-    mockService.addResponse(expectedResponse);
-
-    LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
-
-    License actualResponse =
-        client.getLicens(license);
-    Assert.assertEquals(expectedResponse, actualResponse);
-
-    List actualRequests = mockService.getRequestPaths();
-    Assert.assertEquals(1, actualRequests.size());
-
-    String apiClientHeaderKey = mockService.getRequestHeaders()
-        .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next();
-    Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
-        .matcher(apiClientHeaderKey).matches());
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void getLicensExceptionTest() throws Exception {
-    ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false);
-    mockService.addException(exception);
-
-    try {
-      LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
-
-      client.getLicens(license);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
-}
\ No newline at end of file

From 832e1cabb757d448e5e1b84b23c1a9453aec4372 Mon Sep 17 00:00:00 2001
From: Andrea Lin 
Date: Fri, 13 Apr 2018 15:48:41 -0700
Subject: [PATCH 13/42] regen from artman

---
 .../compute/deprecated/it/ITComputeTest.java  |    1 +
 ...tancesInstanceGroupManagerHttpRequest.java |  179 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  182 +-
 .../cloud/compute/v1/AcceleratorConfig.java   |   41 +-
 .../cloud/compute/v1/AcceleratorType.java     |  123 +-
 .../v1/AcceleratorTypeAggregatedList.java     |   75 +-
 .../compute/v1/AcceleratorTypeClient.java     |  296 +--
 .../cloud/compute/v1/AcceleratorTypeList.java |   73 +-
 .../cloud/compute/v1/AcceleratorTypeName.java |  210 --
 .../compute/v1/AcceleratorTypeSettings.java   |  160 +-
 .../v1/AcceleratorTypesScopedList.java        |   39 +-
 .../google/cloud/compute/v1/AccessConfig.java |   78 +-
 .../AddAccessConfigInstanceHttpRequest.java   |  138 +-
 .../AddHealthCheckTargetPoolHttpRequest.java  |  147 +-
 .../v1/AddInstanceTargetPoolHttpRequest.java  |  141 +-
 .../AddInstancesInstanceGroupHttpRequest.java |  147 +-
 .../v1/AddPeeringNetworkHttpRequest.java      |  137 +-
 .../com/google/cloud/compute/v1/Address.java  |  161 +-
 .../compute/v1/AddressAggregatedList.java     |   75 +-
 .../cloud/compute/v1/AddressClient.java       |  366 ++-
 .../google/cloud/compute/v1/AddressList.java  |   73 +-
 .../google/cloud/compute/v1/AddressName.java  |  210 --
 .../cloud/compute/v1/AddressSettings.java     |  159 +-
 .../cloud/compute/v1/AddressesScopedList.java |   37 +-
 ...egatedListAcceleratorTypesHttpRequest.java |  151 +-
 .../AggregatedListAddressesHttpRequest.java   |  148 +-
 .../AggregatedListAutoscalersHttpRequest.java |  148 +-
 ...regatedListBackendServicesHttpRequest.java |  148 +-
 .../AggregatedListDiskTypesHttpRequest.java   |  148 +-
 .../v1/AggregatedListDisksHttpRequest.java    |  148 +-
 ...regatedListForwardingRulesHttpRequest.java |  148 +-
 ...egatedListGlobalOperationsHttpRequest.java |  151 +-
 ...dListInstanceGroupManagersHttpRequest.java |  151 +-
 ...gregatedListInstanceGroupsHttpRequest.java |  148 +-
 .../AggregatedListInstancesHttpRequest.java   |  148 +-
 ...istInterconnectAttachmentsHttpRequest.java |  154 +-
 ...AggregatedListMachineTypesHttpRequest.java |  148 +-
 ...gatedListRegionCommitmentsHttpRequest.java |  151 +-
 .../v1/AggregatedListRoutersHttpRequest.java  |  148 +-
 .../AggregatedListSubnetworksHttpRequest.java |  148 +-
 ...regatedListTargetInstancesHttpRequest.java |  148 +-
 .../AggregatedListTargetPoolsHttpRequest.java |  148 +-
 ...gatedListTargetVpnGatewaysHttpRequest.java |  151 +-
 .../AggregatedListVpnTunnelsHttpRequest.java  |  148 +-
 .../google/cloud/compute/v1/AliasIpRange.java |   44 +-
 .../com/google/cloud/compute/v1/Allowed.java  |   37 +-
 .../v1/AttachDiskInstanceHttpRequest.java     |  129 +-
 .../google/cloud/compute/v1/AttachedDisk.java |  161 +-
 .../v1/AttachedDiskInitializeParams.java      |   77 +-
 .../google/cloud/compute/v1/Autoscaler.java   |  153 +-
 .../compute/v1/AutoscalerAggregatedList.java  |   75 +-
 .../cloud/compute/v1/AutoscalerClient.java    |  561 +++--
 .../cloud/compute/v1/AutoscalerList.java      |   73 +-
 .../cloud/compute/v1/AutoscalerName.java      |  210 --
 .../cloud/compute/v1/AutoscalerSettings.java  |  187 +-
 .../compute/v1/AutoscalerStatusDetails.java   |   39 +-
 .../compute/v1/AutoscalersScopedList.java     |   39 +-
 .../cloud/compute/v1/AutoscalingPolicy.java   |   97 +-
 .../v1/AutoscalingPolicyCpuUtilization.java   |   36 +-
 ...oscalingPolicyCustomMetricUtilization.java |   56 +-
 ...scalingPolicyLoadBalancingUtilization.java |   38 +-
 .../com/google/cloud/compute/v1/Backend.java  |  123 +-
 .../cloud/compute/v1/BackendBucket.java       |   94 +-
 .../cloud/compute/v1/BackendBucketClient.java |  514 +++--
 .../cloud/compute/v1/BackendBucketList.java   |   73 +-
 .../compute/v1/BackendBucketSettings.java     |  183 +-
 .../cloud/compute/v1/BackendService.java      |  258 ++-
 .../v1/BackendServiceAggregatedList.java      |   75 +-
 .../compute/v1/BackendServiceCdnPolicy.java   |   33 +-
 .../compute/v1/BackendServiceClient.java      |  729 +++---
 .../compute/v1/BackendServiceGroupHealth.java |   39 +-
 .../cloud/compute/v1/BackendServiceIAP.java   |   63 +-
 .../cloud/compute/v1/BackendServiceList.java  |   73 +-
 .../compute/v1/BackendServiceSettings.java    |  223 +-
 .../compute/v1/BackendServicesScopedList.java |   39 +-
 .../compute/v1/CacheInvalidationRule.java     |   38 +-
 .../cloud/compute/v1/CacheKeyPolicy.java      |   73 +-
 .../google/cloud/compute/v1/Commitment.java   |  161 +-
 .../compute/v1/CommitmentAggregatedList.java  |   75 +-
 .../cloud/compute/v1/CommitmentList.java      |   73 +-
 .../cloud/compute/v1/CommitmentName.java      |  210 --
 .../compute/v1/CommitmentsScopedList.java     |   39 +-
 .../cloud/compute/v1/ConnectionDraining.java  |   36 +-
 .../v1/CreateSnapshotDiskHttpRequest.java     |  137 +-
 .../compute/v1/CustomerEncryptionKey.java     |   39 +-
 .../CustomerEncryptionKeyProtectedDisk.java   |   43 +-
 .../com/google/cloud/compute/v1/Data.java     |   38 +-
 ...DeleteAccessConfigInstanceHttpRequest.java |  134 +-
 .../compute/v1/DeleteAddressHttpRequest.java  |   99 +-
 .../v1/DeleteAutoscalerHttpRequest.java       |  107 +-
 .../v1/DeleteBackendBucketHttpRequest.java    |  115 +-
 .../v1/DeleteBackendServiceHttpRequest.java   |  115 +-
 .../compute/v1/DeleteDiskHttpRequest.java     |   99 +-
 .../compute/v1/DeleteFirewallHttpRequest.java |   99 +-
 .../v1/DeleteForwardingRuleHttpRequest.java   |  115 +-
 .../v1/DeleteGlobalAddressHttpRequest.java    |   99 +-
 ...DeleteGlobalForwardingRuleHttpRequest.java |  115 +-
 .../v1/DeleteGlobalOperationHttpRequest.java  |   90 +-
 .../v1/DeleteHealthCheckHttpRequest.java      |  115 +-
 .../v1/DeleteHttpHealthCheckHttpRequest.java  |  115 +-
 .../v1/DeleteHttpsHealthCheckHttpRequest.java |  115 +-
 .../compute/v1/DeleteImageHttpRequest.java    |   99 +-
 .../v1/DeleteInstanceGroupHttpRequest.java    |  115 +-
 ...DeleteInstanceGroupManagerHttpRequest.java |  118 +-
 .../compute/v1/DeleteInstanceHttpRequest.java |   99 +-
 .../v1/DeleteInstanceTemplateHttpRequest.java |  115 +-
 ...tancesInstanceGroupManagerHttpRequest.java |  176 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  179 +-
 ...leteInterconnectAttachmentHttpRequest.java |  119 +-
 .../v1/DeleteInterconnectHttpRequest.java     |  115 +-
 ...est.java => DeleteLicenseHttpRequest.java} |  153 +-
 .../compute/v1/DeleteNetworkHttpRequest.java  |   99 +-
 .../v1/DeleteRegionAutoscalerHttpRequest.java |  107 +-
 ...DeleteRegionBackendServiceHttpRequest.java |  115 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  121 +-
 .../v1/DeleteRegionOperationHttpRequest.java  |   90 +-
 .../compute/v1/DeleteRouteHttpRequest.java    |   99 +-
 .../compute/v1/DeleteRouterHttpRequest.java   |   99 +-
 .../compute/v1/DeleteSnapshotHttpRequest.java |   99 +-
 .../v1/DeleteSslCertificateHttpRequest.java   |  115 +-
 .../v1/DeleteSslPolicyHttpRequest.java        |  436 ++++
 .../v1/DeleteSubnetworkHttpRequest.java       |  107 +-
 .../v1/DeleteTargetHttpProxyHttpRequest.java  |  115 +-
 .../v1/DeleteTargetHttpsProxyHttpRequest.java |  115 +-
 .../v1/DeleteTargetInstanceHttpRequest.java   |  115 +-
 .../v1/DeleteTargetPoolHttpRequest.java       |  107 +-
 .../v1/DeleteTargetSslProxyHttpRequest.java   |  115 +-
 .../v1/DeleteTargetTcpProxyHttpRequest.java   |  115 +-
 .../v1/DeleteTargetVpnGatewayHttpRequest.java |  115 +-
 .../compute/v1/DeleteUrlMapHttpRequest.java   |   99 +-
 .../v1/DeleteVpnTunnelHttpRequest.java        |  108 +-
 .../v1/DeleteZoneOperationHttpRequest.java    |   90 +-
 .../com/google/cloud/compute/v1/Denied.java   |   37 +-
 .../compute/v1/DeprecateImageHttpRequest.java |  130 +-
 .../cloud/compute/v1/DeprecationStatus.java   |   70 +-
 .../v1/DetachDiskInstanceHttpRequest.java     |  124 +-
 .../v1/DisableXpnHostProjectHttpRequest.java  |   99 +-
 .../DisableXpnResourceProjectHttpRequest.java |  147 +-
 .../com/google/cloud/compute/v1/Disk.java     |  360 +--
 .../cloud/compute/v1/DiskAggregatedList.java  |   75 +-
 .../google/cloud/compute/v1/DiskClient.java   |  626 ++---
 .../com/google/cloud/compute/v1/DiskList.java |   73 +-
 .../cloud/compute/v1/DiskMoveRequest.java     |   41 +-
 .../com/google/cloud/compute/v1/DiskName.java |  210 --
 .../google/cloud/compute/v1/DiskSettings.java |  183 +-
 .../com/google/cloud/compute/v1/DiskType.java |  133 +-
 .../compute/v1/DiskTypeAggregatedList.java    |   75 +-
 .../cloud/compute/v1/DiskTypeClient.java      |  242 +-
 .../google/cloud/compute/v1/DiskTypeList.java |   73 +-
 .../cloud/compute/v1/DiskTypeSettings.java    |  143 +-
 .../cloud/compute/v1/DiskTypesScopedList.java |   37 +-
 .../cloud/compute/v1/DisksResizeRequest.java  |   33 +-
 .../cloud/compute/v1/DisksScopedList.java     |   37 +-
 .../v1/EnableXpnHostProjectHttpRequest.java   |   99 +-
 .../EnableXpnResourceProjectHttpRequest.java  |  147 +-
 .../com/google/cloud/compute/v1/Error.java    |   32 +-
 .../com/google/cloud/compute/v1/Errors.java   |   51 +-
 ...xpandIpCidrRangeSubnetworkHttpRequest.java |  150 +-
 .../com/google/cloud/compute/v1/Firewall.java |  205 +-
 .../cloud/compute/v1/FirewallClient.java      |  456 ++--
 .../google/cloud/compute/v1/FirewallList.java |   73 +-
 .../cloud/compute/v1/FirewallSettings.java    |  164 +-
 .../cloud/compute/v1/ForwardingRule.java      |  208 +-
 .../v1/ForwardingRuleAggregatedList.java      |   75 +-
 .../compute/v1/ForwardingRuleClient.java      |  510 +++--
 .../cloud/compute/v1/ForwardingRuleList.java  |   73 +-
 .../cloud/compute/v1/ForwardingRuleName.java  |  210 --
 .../compute/v1/ForwardingRuleSettings.java    |  195 +-
 .../compute/v1/ForwardingRulesScopedList.java |   39 +-
 .../v1/GetAcceleratorTypeHttpRequest.java     |   91 +-
 .../compute/v1/GetAddressHttpRequest.java     |   90 +-
 .../compute/v1/GetAutoscalerHttpRequest.java  |   90 +-
 .../v1/GetBackendBucketHttpRequest.java       |   90 +-
 .../v1/GetBackendServiceHttpRequest.java      |   90 +-
 .../cloud/compute/v1/GetDiskHttpRequest.java  |   91 +-
 .../compute/v1/GetDiskTypeHttpRequest.java    |   90 +-
 .../compute/v1/GetFirewallHttpRequest.java    |   90 +-
 .../v1/GetForwardingRuleHttpRequest.java      |   90 +-
 .../v1/GetFromFamilyImageHttpRequest.java     |   90 +-
 .../v1/GetGlobalAddressHttpRequest.java       |   90 +-
 .../GetGlobalForwardingRuleHttpRequest.java   |   90 +-
 .../v1/GetGlobalOperationHttpRequest.java     |   90 +-
 .../GetHealthBackendServiceHttpRequest.java   |  126 +-
 .../compute/v1/GetHealthCheckHttpRequest.java |   90 +-
 ...HealthRegionBackendServiceHttpRequest.java |  126 +-
 .../v1/GetHealthTargetPoolHttpRequest.java    |  119 +-
 .../v1/GetHttpHealthCheckHttpRequest.java     |   90 +-
 .../v1/GetHttpsHealthCheckHttpRequest.java    |   90 +-
 .../cloud/compute/v1/GetImageHttpRequest.java |   91 +-
 .../v1/GetInstanceGroupHttpRequest.java       |   90 +-
 .../GetInstanceGroupManagerHttpRequest.java   |  100 +-
 .../compute/v1/GetInstanceHttpRequest.java    |   90 +-
 .../v1/GetInstanceTemplateHttpRequest.java    |   90 +-
 .../GetInterconnectAttachmentHttpRequest.java |  108 +-
 .../v1/GetInterconnectHttpRequest.java        |   90 +-
 .../GetInterconnectLocationHttpRequest.java   |  100 +-
 .../compute/v1/GetLicenseCodeHttpRequest.java |  395 ++++
 .../compute/v1/GetLicenseHttpRequest.java     |   90 +-
 .../compute/v1/GetMachineTypeHttpRequest.java |   90 +-
 .../compute/v1/GetNetworkHttpRequest.java     |   90 +-
 .../compute/v1/GetProjectHttpRequest.java     |   90 +-
 .../v1/GetRegionAutoscalerHttpRequest.java    |   90 +-
 .../GetRegionBackendServiceHttpRequest.java   |   90 +-
 .../v1/GetRegionCommitmentHttpRequest.java    |   90 +-
 .../compute/v1/GetRegionHttpRequest.java      |   90 +-
 .../v1/GetRegionInstanceGroupHttpRequest.java |   90 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  100 +-
 .../v1/GetRegionOperationHttpRequest.java     |   90 +-
 .../cloud/compute/v1/GetRouteHttpRequest.java |   91 +-
 .../compute/v1/GetRouterHttpRequest.java      |   90 +-
 .../v1/GetRouterStatusRouterHttpRequest.java  |   90 +-
 ...etSerialPortOutputInstanceHttpRequest.java |  117 +-
 .../compute/v1/GetSnapshotHttpRequest.java    |   90 +-
 .../v1/GetSslCertificateHttpRequest.java      |   90 +-
 .../compute/v1/GetSslPolicyHttpRequest.java   |  395 ++++
 .../compute/v1/GetSubnetworkHttpRequest.java  |   90 +-
 .../v1/GetTargetHttpProxyHttpRequest.java     |   90 +-
 .../v1/GetTargetHttpsProxyHttpRequest.java    |   90 +-
 .../v1/GetTargetInstanceHttpRequest.java      |   90 +-
 .../compute/v1/GetTargetPoolHttpRequest.java  |   90 +-
 .../v1/GetTargetSslProxyHttpRequest.java      |   90 +-
 .../v1/GetTargetTcpProxyHttpRequest.java      |   90 +-
 .../v1/GetTargetVpnGatewayHttpRequest.java    |   90 +-
 .../compute/v1/GetUrlMapHttpRequest.java      |   90 +-
 .../compute/v1/GetVpnTunnelHttpRequest.java   |   91 +-
 .../v1/GetXpnHostProjectHttpRequest.java      |   90 +-
 .../GetXpnResourcesProjectsHttpRequest.java   |  148 +-
 .../cloud/compute/v1/GetZoneHttpRequest.java  |   92 +-
 .../v1/GetZoneOperationHttpRequest.java       |   90 +-
 .../cloud/compute/v1/GlobalAddressClient.java |  326 +--
 .../compute/v1/GlobalAddressSettings.java     |  158 +-
 .../v1/GlobalForwardingRuleClient.java        |  466 ++--
 .../v1/GlobalForwardingRuleSettings.java      |  192 +-
 .../compute/v1/GlobalOperationClient.java     |  337 ++-
 .../compute/v1/GlobalOperationSettings.java   |  164 +-
 .../compute/v1/GlobalSetLabelsRequest.java    |   41 +-
 .../cloud/compute/v1/GuestOsFeature.java      |   33 +-
 .../cloud/compute/v1/HTTPHealthCheck.java     |   70 +-
 .../cloud/compute/v1/HTTPSHealthCheck.java    |   70 +-
 .../google/cloud/compute/v1/HealthCheck.java  |  188 +-
 .../cloud/compute/v1/HealthCheckClient.java   |  481 ++--
 .../cloud/compute/v1/HealthCheckList.java     |   73 +-
 .../compute/v1/HealthCheckReference.java      |   33 +-
 .../cloud/compute/v1/HealthCheckSettings.java |  171 +-
 .../google/cloud/compute/v1/HealthStatus.java |   61 +-
 .../com/google/cloud/compute/v1/HostRule.java |   49 +-
 .../cloud/compute/v1/HttpHealthCheck.java     |  166 +-
 .../compute/v1/HttpHealthCheckClient.java     |  533 +++--
 .../cloud/compute/v1/HttpHealthCheckList.java |   73 +-
 .../compute/v1/HttpHealthCheckSettings.java   |  189 +-
 .../cloud/compute/v1/HttpsHealthCheck.java    |  166 +-
 .../compute/v1/HttpsHealthCheckClient.java    |  545 +++--
 .../compute/v1/HttpsHealthCheckList.java      |   73 +-
 .../compute/v1/HttpsHealthCheckSettings.java  |  191 +-
 .../com/google/cloud/compute/v1/Image.java    |  380 ++--
 .../google/cloud/compute/v1/ImageClient.java  |  492 ++--
 .../google/cloud/compute/v1/ImageList.java    |   73 +-
 .../cloud/compute/v1/ImageSettings.java       |  171 +-
 .../compute/v1/InsertAddressHttpRequest.java  |  126 +-
 .../v1/InsertAutoscalerHttpRequest.java       |  130 +-
 .../v1/InsertBackendBucketHttpRequest.java    |  130 +-
 .../v1/InsertBackendServiceHttpRequest.java   |  130 +-
 .../compute/v1/InsertDiskHttpRequest.java     |  138 +-
 .../compute/v1/InsertFirewallHttpRequest.java |  126 +-
 .../v1/InsertForwardingRuleHttpRequest.java   |  130 +-
 .../v1/InsertGlobalAddressHttpRequest.java    |  126 +-
 ...InsertGlobalForwardingRuleHttpRequest.java |  130 +-
 .../v1/InsertHealthCheckHttpRequest.java      |  129 +-
 .../v1/InsertHttpHealthCheckHttpRequest.java  |  130 +-
 .../v1/InsertHttpsHealthCheckHttpRequest.java |  130 +-
 .../compute/v1/InsertImageHttpRequest.java    |  137 +-
 .../v1/InsertInstanceGroupHttpRequest.java    |  131 +-
 ...InsertInstanceGroupManagerHttpRequest.java |  138 +-
 .../compute/v1/InsertInstanceHttpRequest.java |  164 +-
 .../v1/InsertInstanceTemplateHttpRequest.java |  130 +-
 ...sertInterconnectAttachmentHttpRequest.java |  137 +-
 .../v1/InsertInterconnectHttpRequest.java     |  129 +-
 .../compute/v1/InsertLicenseHttpRequest.java  |  479 ++++
 .../compute/v1/InsertNetworkHttpRequest.java  |  126 +-
 .../v1/InsertRegionAutoscalerHttpRequest.java |  129 +-
 ...InsertRegionBackendServiceHttpRequest.java |  130 +-
 .../v1/InsertRegionCommitmentHttpRequest.java |  129 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  140 +-
 .../compute/v1/InsertRouteHttpRequest.java    |  126 +-
 .../compute/v1/InsertRouterHttpRequest.java   |  126 +-
 .../v1/InsertSslCertificateHttpRequest.java   |  130 +-
 .../v1/InsertSslPolicyHttpRequest.java        |  480 ++++
 .../v1/InsertSubnetworkHttpRequest.java       |  129 +-
 .../v1/InsertTargetHttpProxyHttpRequest.java  |  130 +-
 .../v1/InsertTargetHttpsProxyHttpRequest.java |  130 +-
 .../v1/InsertTargetInstanceHttpRequest.java   |  131 +-
 .../v1/InsertTargetPoolHttpRequest.java       |  129 +-
 .../v1/InsertTargetSslProxyHttpRequest.java   |  130 +-
 .../v1/InsertTargetTcpProxyHttpRequest.java   |  130 +-
 .../v1/InsertTargetVpnGatewayHttpRequest.java |  130 +-
 .../compute/v1/InsertUrlMapHttpRequest.java   |  126 +-
 .../v1/InsertVpnTunnelHttpRequest.java        |  129 +-
 .../com/google/cloud/compute/v1/Instance.java |  285 +--
 .../compute/v1/InstanceAggregatedList.java    |   75 +-
 .../cloud/compute/v1/InstanceClient.java      | 2019 ++++++++++-------
 .../cloud/compute/v1/InstanceGroup.java       |  161 +-
 .../v1/InstanceGroupAggregatedList.java       |   75 +-
 .../cloud/compute/v1/InstanceGroupClient.java |  840 ++++---
 .../cloud/compute/v1/InstanceGroupList.java   |   73 +-
 .../compute/v1/InstanceGroupManager.java      |  194 +-
 .../InstanceGroupManagerActionsSummary.java   |  109 +-
 .../InstanceGroupManagerAggregatedList.java   |   74 +-
 .../v1/InstanceGroupManagerClient.java        | 1290 +++++++----
 .../compute/v1/InstanceGroupManagerList.java  |   73 +-
 .../compute/v1/InstanceGroupManagerName.java  |  210 --
 .../v1/InstanceGroupManagerSettings.java      |  286 ++-
 ...eGroupManagersAbandonInstancesRequest.java |   35 +-
 ...ceGroupManagersDeleteInstancesRequest.java |   35 +-
 ...pManagersListManagedInstancesResponse.java |   36 +-
 ...GroupManagersRecreateInstancesRequest.java |   35 +-
 .../v1/InstanceGroupManagersScopedList.java   |   38 +-
 ...oupManagersSetInstanceTemplateRequest.java |   38 +-
 ...nceGroupManagersSetTargetPoolsRequest.java |   42 +-
 .../cloud/compute/v1/InstanceGroupName.java   |  210 --
 .../compute/v1/InstanceGroupSettings.java     |  240 +-
 .../v1/InstanceGroupsAddInstancesRequest.java |   32 +-
 .../v1/InstanceGroupsListInstances.java       |   73 +-
 .../InstanceGroupsListInstancesRequest.java   |   33 +-
 .../InstanceGroupsRemoveInstancesRequest.java |   32 +-
 .../compute/v1/InstanceGroupsScopedList.java  |   39 +-
 .../InstanceGroupsSetNamedPortsRequest.java   |   39 +-
 .../google/cloud/compute/v1/InstanceList.java |   73 +-
 .../compute/v1/InstanceListReferrers.java     |   73 +-
 .../cloud/compute/v1/InstanceMoveRequest.java |   41 +-
 .../google/cloud/compute/v1/InstanceName.java |  210 --
 .../cloud/compute/v1/InstanceProperties.java  |  147 +-
 .../cloud/compute/v1/InstanceReference.java   |   33 +-
 .../cloud/compute/v1/InstanceSettings.java    |  449 ++--
 .../cloud/compute/v1/InstanceTemplate.java    |   86 +-
 .../compute/v1/InstanceTemplateClient.java    |  390 ++--
 .../compute/v1/InstanceTemplateList.java      |   73 +-
 .../compute/v1/InstanceTemplateSettings.java  |  163 +-
 .../compute/v1/InstanceWithNamedPorts.java    |   49 +-
 .../cloud/compute/v1/InstancesScopedList.java |   37 +-
 .../compute/v1/InstancesSetLabelsRequest.java |   41 +-
 .../InstancesSetMachineResourcesRequest.java  |   32 +-
 .../v1/InstancesSetMachineTypeRequest.java    |   33 +-
 .../v1/InstancesSetMinCpuPlatformRequest.java |   33 +-
 .../v1/InstancesSetServiceAccountRequest.java |   39 +-
 ...nstancesStartWithEncryptionKeyRequest.java |   32 +-
 .../google/cloud/compute/v1/Interconnect.java |  261 ++-
 .../compute/v1/InterconnectAttachment.java    |  194 +-
 .../InterconnectAttachmentAggregatedList.java |   74 +-
 .../v1/InterconnectAttachmentClient.java      |  499 ++--
 .../v1/InterconnectAttachmentList.java        |   73 +-
 .../v1/InterconnectAttachmentName.java        |  210 --
 .../v1/InterconnectAttachmentPrivateInfo.java |   33 +-
 .../v1/InterconnectAttachmentSettings.java    |  193 +-
 .../v1/InterconnectAttachmentsScopedList.java |   41 +-
 .../compute/v1/InterconnectCircuitInfo.java   |   50 +-
 .../cloud/compute/v1/InterconnectClient.java  |  420 ++--
 .../cloud/compute/v1/InterconnectList.java    |   73 +-
 .../compute/v1/InterconnectLocation.java      |  179 +-
 .../v1/InterconnectLocationClient.java        |  231 +-
 .../compute/v1/InterconnectLocationList.java  |   73 +-
 .../v1/InterconnectLocationRegionInfo.java    |   50 +-
 .../v1/InterconnectLocationSettings.java      |  141 +-
 .../v1/InterconnectOutageNotification.java    |   89 +-
 .../compute/v1/InterconnectSettings.java      |  163 +-
 .../v1/InvalidateCacheUrlMapHttpRequest.java  |  137 +-
 .../com/google/cloud/compute/v1/Items.java    |   38 +-
 .../google/cloud/compute/v1/LicensClient.java |  297 ---
 .../cloud/compute/v1/LicensSettings.java      |  218 --
 .../com/google/cloud/compute/v1/License.java  |  269 ++-
 .../cloud/compute/v1/LicenseClient.java       |  702 +++++-
 .../google/cloud/compute/v1/LicenseCode.java  |  451 ++++
 .../cloud/compute/v1/LicenseCodeClient.java   |  390 ++++
 .../compute/v1/LicenseCodeLicenseAlias.java   |  185 ++
 .../cloud/compute/v1/LicenseCodeSettings.java |  193 ++
 .../v1/LicenseResourceRequirements.java       |  185 ++
 .../cloud/compute/v1/LicenseSettings.java     |  147 +-
 .../compute/v1/LicensesListResponse.java      |  296 +++
 .../v1/ListAcceleratorTypesHttpRequest.java   |  149 +-
 .../compute/v1/ListAddressesHttpRequest.java  |  148 +-
 .../v1/ListAutoscalersHttpRequest.java        |  149 +-
 ...ailableFeaturesSslPoliciesHttpRequest.java |  550 +++++
 .../v1/ListBackendBucketsHttpRequest.java     |  148 +-
 .../v1/ListBackendServicesHttpRequest.java    |  148 +-
 .../compute/v1/ListDiskTypesHttpRequest.java  |  149 +-
 .../compute/v1/ListDisksHttpRequest.java      |  149 +-
 .../compute/v1/ListFirewallsHttpRequest.java  |  148 +-
 .../v1/ListForwardingRulesHttpRequest.java    |  148 +-
 .../v1/ListGlobalAddressesHttpRequest.java    |  148 +-
 .../ListGlobalForwardingRulesHttpRequest.java |  148 +-
 .../v1/ListGlobalOperationsHttpRequest.java   |  148 +-
 .../v1/ListHealthChecksHttpRequest.java       |  148 +-
 .../v1/ListHttpHealthChecksHttpRequest.java   |  148 +-
 .../v1/ListHttpsHealthChecksHttpRequest.java  |  148 +-
 .../compute/v1/ListImagesHttpRequest.java     |  148 +-
 .../ListInstanceGroupManagersHttpRequest.java |  149 +-
 .../v1/ListInstanceGroupsHttpRequest.java     |  149 +-
 .../v1/ListInstanceTemplatesHttpRequest.java  |  148 +-
 .../compute/v1/ListInstancesHttpRequest.java  |  149 +-
 ...istInstancesInstanceGroupsHttpRequest.java |  180 +-
 ...tancesRegionInstanceGroupsHttpRequest.java |  202 +-
 ...istInterconnectAttachmentsHttpRequest.java |  148 +-
 .../ListInterconnectLocationsHttpRequest.java |  148 +-
 .../v1/ListInterconnectsHttpRequest.java      |  148 +-
 .../compute/v1/ListLicensesHttpRequest.java   |  549 +++++
 .../v1/ListMachineTypesHttpRequest.java       |  149 +-
 ...ancesInstanceGroupManagersHttpRequest.java |  157 +-
 ...egionInstanceGroupManagersHttpRequest.java |  163 +-
 .../compute/v1/ListNetworksHttpRequest.java   |  148 +-
 .../v1/ListReferrersInstancesHttpRequest.java |  148 +-
 .../v1/ListRegionAutoscalersHttpRequest.java  |  148 +-
 .../ListRegionBackendServicesHttpRequest.java |  148 +-
 .../v1/ListRegionCommitmentsHttpRequest.java  |  148 +-
 ...egionInstanceGroupManagersHttpRequest.java |  151 +-
 .../ListRegionInstanceGroupsHttpRequest.java  |  148 +-
 .../v1/ListRegionOperationsHttpRequest.java   |  148 +-
 .../compute/v1/ListRegionsHttpRequest.java    |  148 +-
 .../compute/v1/ListRoutersHttpRequest.java    |  148 +-
 .../compute/v1/ListRoutesHttpRequest.java     |  148 +-
 .../compute/v1/ListSnapshotsHttpRequest.java  |  148 +-
 .../v1/ListSslCertificatesHttpRequest.java    |  148 +-
 .../v1/ListSslPoliciesHttpRequest.java        |  549 +++++
 .../v1/ListSubnetworksHttpRequest.java        |  148 +-
 .../v1/ListTargetHttpProxiesHttpRequest.java  |  148 +-
 .../v1/ListTargetHttpsProxiesHttpRequest.java |  148 +-
 .../v1/ListTargetInstancesHttpRequest.java    |  149 +-
 .../v1/ListTargetPoolsHttpRequest.java        |  148 +-
 .../v1/ListTargetSslProxiesHttpRequest.java   |  148 +-
 .../v1/ListTargetTcpProxiesHttpRequest.java   |  148 +-
 .../v1/ListTargetVpnGatewaysHttpRequest.java  |  148 +-
 .../compute/v1/ListUrlMapsHttpRequest.java    |  148 +-
 .../compute/v1/ListVpnTunnelsHttpRequest.java |  148 +-
 .../v1/ListXpnHostsProjectsHttpRequest.java   |  171 +-
 .../v1/ListZoneOperationsHttpRequest.java     |  149 +-
 .../compute/v1/ListZonesHttpRequest.java      |  148 +-
 .../google/cloud/compute/v1/MachineType.java  |  195 +-
 .../compute/v1/MachineTypeAggregatedList.java |   75 +-
 .../cloud/compute/v1/MachineTypeClient.java   |  274 ++-
 .../cloud/compute/v1/MachineTypeList.java     |   73 +-
 .../cloud/compute/v1/MachineTypeName.java     |  210 --
 .../cloud/compute/v1/MachineTypeSettings.java |  147 +-
 .../compute/v1/MachineTypesScopedList.java    |   39 +-
 .../cloud/compute/v1/ManagedInstance.java     |   66 +-
 .../v1/ManagedInstanceLastAttempt.java        |   33 +-
 .../com/google/cloud/compute/v1/Metadata.java |   49 +-
 .../v1/MoveDiskProjectHttpRequest.java        |  130 +-
 .../v1/MoveInstanceProjectHttpRequest.java    |  130 +-
 .../google/cloud/compute/v1/NamedPort.java    |   38 +-
 .../com/google/cloud/compute/v1/Network.java  |  154 +-
 .../cloud/compute/v1/NetworkClient.java       |  599 ++---
 .../cloud/compute/v1/NetworkInterface.java    |   89 +-
 .../google/cloud/compute/v1/NetworkList.java  |   73 +-
 .../cloud/compute/v1/NetworkPeering.java      |   70 +-
 .../compute/v1/NetworkRoutingConfig.java      |   33 +-
 .../cloud/compute/v1/NetworkSettings.java     |  186 +-
 .../compute/v1/NetworksAddPeeringRequest.java |   51 +-
 .../v1/NetworksRemovePeeringRequest.java      |   33 +-
 .../google/cloud/compute/v1/Operation.java    |  277 +--
 .../compute/v1/OperationAggregatedList.java   |   75 +-
 .../cloud/compute/v1/OperationList.java       |   73 +-
 .../compute/v1/OperationsScopedList.java      |   37 +-
 .../v1/PatchAutoscalerHttpRequest.java        |  141 +-
 .../v1/PatchBackendBucketHttpRequest.java     |  130 +-
 .../v1/PatchBackendServiceHttpRequest.java    |  130 +-
 .../compute/v1/PatchFirewallHttpRequest.java  |  126 +-
 .../v1/PatchHealthCheckHttpRequest.java       |  129 +-
 .../v1/PatchHttpHealthCheckHttpRequest.java   |  130 +-
 .../v1/PatchHttpsHealthCheckHttpRequest.java  |  130 +-
 .../v1/PatchInterconnectHttpRequest.java      |  129 +-
 .../compute/v1/PatchNetworkHttpRequest.java   |  126 +-
 .../v1/PatchRegionAutoscalerHttpRequest.java  |  140 +-
 .../PatchRegionBackendServiceHttpRequest.java |  130 +-
 .../compute/v1/PatchRouterHttpRequest.java    |  126 +-
 .../compute/v1/PatchSslPolicyHttpRequest.java |  480 ++++
 .../v1/PatchSubnetworkHttpRequest.java        |  129 +-
 .../compute/v1/PatchUrlMapHttpRequest.java    |  126 +-
 .../google/cloud/compute/v1/PathMatcher.java  |   58 +-
 .../com/google/cloud/compute/v1/PathRule.java |   37 +-
 .../compute/v1/PreviewRouterHttpRequest.java  |  115 +-
 .../com/google/cloud/compute/v1/Project.java  |  161 +-
 .../compute/v1/ProjectBackendBucketName.java  |  186 --
 .../compute/v1/ProjectBackendServiceName.java |  186 --
 .../cloud/compute/v1/ProjectClient.java       |  835 ++++---
 .../cloud/compute/v1/ProjectFamilyName.java   |  186 --
 .../cloud/compute/v1/ProjectFirewallName.java |  186 --
 ...ame.java => ProjectGlobalAddressName.java} |   83 +-
 ...va => ProjectGlobalBackendBucketName.java} |   85 +-
 ...a => ProjectGlobalBackendServiceName.java} |   85 +-
 ...me.java => ProjectGlobalFirewallName.java} |   84 +-
 ...a => ProjectGlobalForwardingRuleName.java} |   85 +-
 ...java => ProjectGlobalHealthCheckName.java} |   84 +-
 ... => ProjectGlobalHttpHealthCheckName.java} |   85 +-
 ...=> ProjectGlobalHttpsHealthCheckName.java} |   85 +-
 ...java => ProjectGlobalImageFamilyName.java} |   84 +-
 ...eName.java => ProjectGlobalImageName.java} |   83 +-
 ...va => ProjectGlobalImageResourceName.java} |   84 +-
 ...=> ProjectGlobalInstanceTemplateName.java} |   85 +-
 ...rojectGlobalInterconnectLocationName.java} |   86 +-
 ...ava => ProjectGlobalInterconnectName.java} |   85 +-
 ...java => ProjectGlobalLicenseCodeName.java} |  114 +-
 .../ProjectGlobalLicenseCodeResourceName.java |  164 ++
 ...ame.java => ProjectGlobalLicenseName.java} |   83 +-
 ... => ProjectGlobalLicenseResourceName.java} |   84 +-
 ...ame.java => ProjectGlobalNetworkName.java} |   83 +-
 ...e.java => ProjectGlobalOperationName.java} |   84 +-
 ...eName.java => ProjectGlobalRouteName.java} |   83 +-
 ...me.java => ProjectGlobalSnapshotName.java} |   84 +-
 .../v1/ProjectGlobalSnapshotResourceName.java |  164 ++
 ...a => ProjectGlobalSslCertificateName.java} |   85 +-
 ...e.java => ProjectGlobalSslPolicyName.java} |  104 +-
 ... => ProjectGlobalTargetHttpProxyName.java} |   85 +-
 ...=> ProjectGlobalTargetHttpsProxyName.java} |   85 +-
 ...a => ProjectGlobalTargetSslProxyName.java} |   85 +-
 ...a => ProjectGlobalTargetTcpProxyName.java} |   85 +-
 ...Name.java => ProjectGlobalUrlMapName.java} |   83 +-
 .../compute/v1/ProjectHealthCheckName.java    |  186 --
 .../v1/ProjectHttpHealthCheckName.java        |  186 --
 .../v1/ProjectHttpsHealthCheckName.java       |  186 --
 .../v1/ProjectInstanceTemplateName.java       |  186 --
 .../v1/ProjectInterconnectLocationName.java   |  186 --
 .../compute/v1/ProjectInterconnectName.java   |  186 --
 .../cloud/compute/v1/ProjectLicenseName.java  |  186 --
 .../google/cloud/compute/v1/ProjectName.java  |   54 +-
 .../cloud/compute/v1/ProjectNetworkName.java  |  186 --
 .../compute/v1/ProjectOperationName.java      |  186 --
 .../compute/v1/ProjectRegionAddressName.java  |   74 +-
 .../v1/ProjectRegionAutoscalerName.java       |   75 +-
 .../v1/ProjectRegionBackendServiceName.java   |   76 +-
 .../v1/ProjectRegionCommitmentName.java       |   75 +-
 .../v1/ProjectRegionForwardingRuleName.java   |   76 +-
 ...ProjectRegionInstanceGroupManagerName.java |   75 +-
 .../v1/ProjectRegionInstanceGroupName.java    |   76 +-
 ...ojectRegionInterconnectAttachmentName.java |   76 +-
 .../cloud/compute/v1/ProjectRegionName.java   |   63 +-
 .../v1/ProjectRegionOperationName.java        |   75 +-
 .../compute/v1/ProjectRegionRouterName.java   |   73 +-
 .../v1/ProjectRegionSubnetworkName.java       |   75 +-
 .../v1/ProjectRegionTargetPoolName.java       |   75 +-
 .../v1/ProjectRegionTargetVpnGatewayName.java |   76 +-
 .../v1/ProjectRegionVpnTunnelName.java        |   75 +-
 .../cloud/compute/v1/ProjectSettings.java     |  264 +--
 .../compute/v1/ProjectSslCertificateName.java |  186 --
 .../v1/ProjectTargetHttpProxyName.java        |   65 +-
 .../v1/ProjectTargetHttpsProxyName.java       |   65 +-
 .../compute/v1/ProjectTargetSslProxyName.java |  186 --
 .../compute/v1/ProjectTargetTcpProxyName.java |  186 --
 .../v1/ProjectZoneAcceleratorTypeName.java    |   76 +-
 .../compute/v1/ProjectZoneAutoscalerName.java |   75 +-
 .../cloud/compute/v1/ProjectZoneDiskName.java |  107 +-
 ....java => ProjectZoneDiskResourceName.java} |   96 +-
 .../compute/v1/ProjectZoneDiskTypeName.java   |   73 +-
 .../ProjectZoneInstanceGroupManagerName.java  |   76 +-
 .../v1/ProjectZoneInstanceGroupName.java      |   75 +-
 .../compute/v1/ProjectZoneInstanceName.java   |   73 +-
 ...a => ProjectZoneInstanceResourceName.java} |  128 +-
 .../v1/ProjectZoneMachineTypeName.java        |   75 +-
 .../cloud/compute/v1/ProjectZoneName.java     |   63 +-
 .../compute/v1/ProjectZoneOperationName.java  |   74 +-
 .../v1/ProjectZoneTargetInstanceName.java     |   78 +-
 .../v1/ProjectsDisableXpnResourceRequest.java |   33 +-
 .../v1/ProjectsEnableXpnResourceRequest.java  |   33 +-
 .../compute/v1/ProjectsGetXpnResources.java   |   48 +-
 .../v1/ProjectsListXpnHostsRequest.java       |   33 +-
 .../com/google/cloud/compute/v1/Quota.java    |   46 +-
 .../com/google/cloud/compute/v1/RawDisk.java  |   51 +-
 ...tancesInstanceGroupManagerHttpRequest.java |  179 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  179 +-
 .../google/cloud/compute/v1/Reference.java    |   61 +-
 .../com/google/cloud/compute/v1/Region.java   |  128 +-
 .../compute/v1/RegionAutoscalerClient.java    |  484 ++--
 .../compute/v1/RegionAutoscalerList.java      |   73 +-
 .../compute/v1/RegionAutoscalerSettings.java  |  191 +-
 .../v1/RegionBackendServiceClient.java        |  582 +++--
 .../v1/RegionBackendServiceSettings.java      |  227 +-
 .../google/cloud/compute/v1/RegionClient.java |  171 +-
 .../compute/v1/RegionCommitmentClient.java    |  381 ++--
 .../compute/v1/RegionCommitmentSettings.java  |  174 +-
 .../compute/v1/RegionInstanceGroupClient.java |  413 ++--
 .../compute/v1/RegionInstanceGroupList.java   |   73 +-
 .../v1/RegionInstanceGroupManagerClient.java  | 1129 +++++----
 .../v1/RegionInstanceGroupManagerList.java    |   73 +-
 .../RegionInstanceGroupManagerSettings.java   |  296 +--
 ...eGroupManagersAbandonInstancesRequest.java |   38 +-
 ...ceGroupManagersDeleteInstancesRequest.java |   38 +-
 ...nceGroupManagersListInstancesResponse.java |   37 +-
 ...nInstanceGroupManagersRecreateRequest.java |   35 +-
 ...nceGroupManagersSetTargetPoolsRequest.java |   44 +-
 ...stanceGroupManagersSetTemplateRequest.java |   35 +-
 .../v1/RegionInstanceGroupSettings.java       |  175 +-
 .../v1/RegionInstanceGroupsListInstances.java |   72 +-
 ...ionInstanceGroupsListInstancesRequest.java |   41 +-
 ...ionInstanceGroupsSetNamedPortsRequest.java |   39 +-
 .../google/cloud/compute/v1/RegionList.java   |   73 +-
 .../google/cloud/compute/v1/RegionName.java   |  186 --
 .../compute/v1/RegionOperationClient.java     |  191 +-
 .../compute/v1/RegionOperationSettings.java   |  141 +-
 .../cloud/compute/v1/RegionSettings.java      |  122 +-
 ...emoveHealthCheckTargetPoolHttpRequest.java |  150 +-
 .../RemoveInstanceTargetPoolHttpRequest.java  |  147 +-
 ...moveInstancesInstanceGroupHttpRequest.java |  153 +-
 .../v1/RemovePeeringNetworkHttpRequest.java   |  138 +-
 .../compute/v1/ResetInstanceHttpRequest.java  |   99 +-
 .../compute/v1/ResizeDiskHttpRequest.java     |  130 +-
 ...ResizeInstanceGroupManagerHttpRequest.java |  127 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  130 +-
 .../cloud/compute/v1/ResourceCommitment.java  |   39 +-
 .../compute/v1/ResourceGroupReference.java    |   33 +-
 .../com/google/cloud/compute/v1/Route.java    |  205 +-
 .../google/cloud/compute/v1/RouteClient.java  |  335 +--
 .../google/cloud/compute/v1/RouteList.java    |   73 +-
 .../cloud/compute/v1/RouteSettings.java       |  138 +-
 .../com/google/cloud/compute/v1/Router.java   |  139 +-
 .../compute/v1/RouterAdvertisedIpRange.java   |   41 +-
 .../compute/v1/RouterAggregatedList.java      |   75 +-
 .../google/cloud/compute/v1/RouterBgp.java    |   55 +-
 .../cloud/compute/v1/RouterBgpPeer.java       |  118 +-
 .../google/cloud/compute/v1/RouterClient.java |  580 ++---
 .../cloud/compute/v1/RouterInterface.java     |   68 +-
 .../google/cloud/compute/v1/RouterList.java   |   73 +-
 .../google/cloud/compute/v1/RouterName.java   |  210 --
 .../cloud/compute/v1/RouterSettings.java      |  202 +-
 .../google/cloud/compute/v1/RouterStatus.java |   55 +-
 .../compute/v1/RouterStatusBgpPeerStatus.java |  125 +-
 .../compute/v1/RouterStatusResponse.java      |   39 +-
 .../compute/v1/RoutersPreviewResponse.java    |   33 +-
 .../cloud/compute/v1/RoutersScopedList.java   |   37 +-
 .../cloud/compute/v1/SSLHealthCheck.java      |   70 +-
 .../google/cloud/compute/v1/Scheduling.java   |   54 +-
 .../google/cloud/compute/v1/ScratchDisks.java |   33 +-
 .../cloud/compute/v1/SerialPortOutput.java    |   70 +-
 .../cloud/compute/v1/ServiceAccount.java      |   37 +-
 ...ckendServiceTargetSslProxyHttpRequest.java |  169 +-
 ...ckendServiceTargetTcpProxyHttpRequest.java |  169 +-
 .../v1/SetBackupTargetPoolHttpRequest.java    |  141 +-
 ...monInstanceMetadataProjectHttpRequest.java |  129 +-
 ...DeletionProtectionInstanceHttpRequest.java |  129 +-
 .../SetDiskAutoDeleteInstanceHttpRequest.java |  133 +-
 ...mplateInstanceGroupManagerHttpRequest.java |  179 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  182 +-
 .../compute/v1/SetLabelsDiskHttpRequest.java  |  137 +-
 .../compute/v1/SetLabelsImageHttpRequest.java |  126 +-
 .../v1/SetLabelsInstanceHttpRequest.java      |  137 +-
 .../v1/SetLabelsSnapshotHttpRequest.java      |  126 +-
 ...etMachineResourcesInstanceHttpRequest.java |  150 +-
 .../v1/SetMachineTypeInstanceHttpRequest.java |  141 +-
 .../v1/SetMetadataInstanceHttpRequest.java    |  126 +-
 .../SetMinCpuPlatformInstanceHttpRequest.java |  147 +-
 ...SetNamedPortsInstanceGroupHttpRequest.java |  147 +-
 ...edPortsRegionInstanceGroupHttpRequest.java |  169 +-
 ...teIpGoogleAccessSubnetworkHttpRequest.java |  170 +-
 ...tProxyHeaderTargetSslProxyHttpRequest.java |  156 +-
 ...tProxyHeaderTargetTcpProxyHttpRequest.java |  156 +-
 .../v1/SetSchedulingInstanceHttpRequest.java  |  129 +-
 .../SetServiceAccountInstanceHttpRequest.java |  147 +-
 ...rtificatesTargetHttpsProxyHttpRequest.java |  173 +-
 ...CertificatesTargetSslProxyHttpRequest.java |  170 +-
 ...tSslPolicyTargetHttpsProxyHttpRequest.java |  481 ++++
 ...SetSslPolicyTargetSslProxyHttpRequest.java |  481 ++++
 .../v1/SetTagsInstanceHttpRequest.java        |  126 +-
 .../SetTargetForwardingRuleHttpRequest.java   |  130 +-
 ...TargetGlobalForwardingRuleHttpRequest.java |  130 +-
 ...tPoolsInstanceGroupManagerHttpRequest.java |  173 +-
 ...RegionInstanceGroupManagerHttpRequest.java |  179 +-
 .../SetUrlMapTargetHttpProxyHttpRequest.java  |  130 +-
 .../SetUrlMapTargetHttpsProxyHttpRequest.java |  130 +-
 ...etUsageExportBucketProjectHttpRequest.java |  130 +-
 .../com/google/cloud/compute/v1/Snapshot.java |  263 ++-
 .../cloud/compute/v1/SnapshotClient.java      |  317 +--
 .../google/cloud/compute/v1/SnapshotList.java |   73 +-
 .../cloud/compute/v1/SnapshotSettings.java    |  145 +-
 .../cloud/compute/v1/SslCertificate.java      |   94 +-
 .../compute/v1/SslCertificateClient.java      |  343 +--
 .../cloud/compute/v1/SslCertificateList.java  |   73 +-
 .../compute/v1/SslCertificateSettings.java    |  161 +-
 .../cloud/compute/v1/SslPoliciesList.java     |  333 +++
 ...PoliciesListAvailableFeaturesResponse.java |  162 ++
 .../google/cloud/compute/v1/SslPolicy.java    |  580 +++++
 .../cloud/compute/v1/SslPolicyClient.java     | 1019 +++++++++
 .../cloud/compute/v1/SslPolicyReference.java  |  149 ++
 .../cloud/compute/v1/SslPolicySettings.java   |  243 ++
 .../compute/v1/StartInstanceHttpRequest.java  |   99 +-
 ...tWithEncryptionKeyInstanceHttpRequest.java |  166 +-
 .../compute/v1/StopInstanceHttpRequest.java   |   99 +-
 .../google/cloud/compute/v1/Subnetwork.java   |  165 +-
 .../compute/v1/SubnetworkAggregatedList.java  |   75 +-
 .../cloud/compute/v1/SubnetworkClient.java    |  628 ++---
 .../cloud/compute/v1/SubnetworkList.java      |   73 +-
 .../cloud/compute/v1/SubnetworkName.java      |  210 --
 .../compute/v1/SubnetworkSecondaryRange.java  |   41 +-
 .../cloud/compute/v1/SubnetworkSettings.java  |  203 +-
 .../SubnetworksExpandIpCidrRangeRequest.java  |   33 +-
 .../compute/v1/SubnetworksScopedList.java     |   39 +-
 ...tworksSetPrivateIpGoogleAccessRequest.java |   39 +-
 .../SwitchToCustomModeNetworkHttpRequest.java |   99 +-
 .../cloud/compute/v1/TCPHealthCheck.java      |   70 +-
 .../com/google/cloud/compute/v1/Tags.java     |   37 +-
 .../cloud/compute/v1/TargetHttpProxy.java     |   87 +-
 .../compute/v1/TargetHttpProxyClient.java     |  410 ++--
 .../cloud/compute/v1/TargetHttpProxyList.java |   73 +-
 .../compute/v1/TargetHttpProxySettings.java   |  176 +-
 ...HttpsProxiesSetSslCertificatesRequest.java |   34 +-
 .../cloud/compute/v1/TargetHttpsProxy.java    |  141 +-
 .../compute/v1/TargetHttpsProxyClient.java    |  657 ++++--
 .../compute/v1/TargetHttpsProxyList.java      |   73 +-
 .../compute/v1/TargetHttpsProxySettings.java  |  203 +-
 .../cloud/compute/v1/TargetInstance.java      |  103 +-
 .../v1/TargetInstanceAggregatedList.java      |   75 +-
 .../compute/v1/TargetInstanceClient.java      |  437 ++--
 .../cloud/compute/v1/TargetInstanceList.java  |   73 +-
 .../cloud/compute/v1/TargetInstanceName.java  |  210 --
 .../compute/v1/TargetInstanceSettings.java    |  181 +-
 .../compute/v1/TargetInstancesScopedList.java |   39 +-
 .../google/cloud/compute/v1/TargetPool.java   |  150 +-
 .../compute/v1/TargetPoolAggregatedList.java  |   75 +-
 .../cloud/compute/v1/TargetPoolClient.java    |  808 ++++---
 .../compute/v1/TargetPoolInstanceHealth.java  |   39 +-
 .../cloud/compute/v1/TargetPoolList.java      |   73 +-
 .../cloud/compute/v1/TargetPoolName.java      |  210 --
 .../cloud/compute/v1/TargetPoolSettings.java  |  249 +-
 .../v1/TargetPoolsAddHealthCheckRequest.java  |   32 +-
 .../v1/TargetPoolsAddInstanceRequest.java     |   32 +-
 .../TargetPoolsRemoveHealthCheckRequest.java  |   32 +-
 .../v1/TargetPoolsRemoveInstanceRequest.java  |   32 +-
 .../compute/v1/TargetPoolsScopedList.java     |   39 +-
 .../cloud/compute/v1/TargetReference.java     |   33 +-
 ...getSslProxiesSetBackendServiceRequest.java |   33 +-
 ...TargetSslProxiesSetProxyHeaderRequest.java |   33 +-
 ...etSslProxiesSetSslCertificatesRequest.java |   34 +-
 .../cloud/compute/v1/TargetSslProxy.java      |  148 +-
 .../compute/v1/TargetSslProxyClient.java      |  749 +++---
 .../cloud/compute/v1/TargetSslProxyList.java  |   73 +-
 .../compute/v1/TargetSslProxySettings.java    |  219 +-
 ...getTcpProxiesSetBackendServiceRequest.java |   33 +-
 ...TargetTcpProxiesSetProxyHeaderRequest.java |   33 +-
 .../cloud/compute/v1/TargetTcpProxy.java      |   94 +-
 .../compute/v1/TargetTcpProxyClient.java      |  511 +++--
 .../cloud/compute/v1/TargetTcpProxyList.java  |   73 +-
 .../compute/v1/TargetTcpProxySettings.java    |  192 +-
 .../cloud/compute/v1/TargetVpnGateway.java    |  139 +-
 .../v1/TargetVpnGatewayAggregatedList.java    |   75 +-
 .../compute/v1/TargetVpnGatewayClient.java    |  452 ++--
 .../compute/v1/TargetVpnGatewayList.java      |   73 +-
 .../compute/v1/TargetVpnGatewayName.java      |  210 --
 .../compute/v1/TargetVpnGatewaySettings.java  |  190 +-
 .../v1/TargetVpnGatewaysScopedList.java       |   39 +-
 .../google/cloud/compute/v1/TestFailure.java  |   61 +-
 ...tIamPermissionsLicenseCodeHttpRequest.java |  449 ++++
 .../TestIamPermissionsLicenseHttpRequest.java |  449 ++++
 .../compute/v1/TestPermissionsRequest.java    |  162 ++
 .../compute/v1/TestPermissionsResponse.java   |  162 ++
 ...UpdateAccessConfigInstanceHttpRequest.java |  138 +-
 .../v1/UpdateAutoscalerHttpRequest.java       |  141 +-
 .../v1/UpdateBackendBucketHttpRequest.java    |  130 +-
 .../v1/UpdateBackendServiceHttpRequest.java   |  130 +-
 .../compute/v1/UpdateFirewallHttpRequest.java |  126 +-
 .../v1/UpdateHealthCheckHttpRequest.java      |  129 +-
 .../v1/UpdateHttpHealthCheckHttpRequest.java  |  130 +-
 .../v1/UpdateHttpsHealthCheckHttpRequest.java |  130 +-
 ...teNetworkInterfaceInstanceHttpRequest.java |  142 +-
 .../v1/UpdateRegionAutoscalerHttpRequest.java |  140 +-
 ...UpdateRegionBackendServiceHttpRequest.java |  130 +-
 .../compute/v1/UpdateRouterHttpRequest.java   |  126 +-
 .../compute/v1/UpdateUrlMapHttpRequest.java   |  126 +-
 .../com/google/cloud/compute/v1/UrlMap.java   |  139 +-
 .../google/cloud/compute/v1/UrlMapClient.java |  607 ++---
 .../google/cloud/compute/v1/UrlMapList.java   |   73 +-
 .../cloud/compute/v1/UrlMapReference.java     |   33 +-
 .../cloud/compute/v1/UrlMapSettings.java      |  182 +-
 .../google/cloud/compute/v1/UrlMapTest.java   |   61 +-
 .../compute/v1/UrlMapValidationResult.java    |   55 +-
 .../compute/v1/UrlMapsValidateRequest.java    |   33 +-
 .../compute/v1/UrlMapsValidateResponse.java   |   33 +-
 .../cloud/compute/v1/UsageExportLocation.java |   41 +-
 .../compute/v1/ValidateUrlMapHttpRequest.java |  126 +-
 .../google/cloud/compute/v1/VpnTunnel.java    |  205 +-
 .../compute/v1/VpnTunnelAggregatedList.java   |   75 +-
 .../cloud/compute/v1/VpnTunnelClient.java     |  390 ++--
 .../cloud/compute/v1/VpnTunnelList.java       |   73 +-
 .../cloud/compute/v1/VpnTunnelName.java       |  210 --
 .../cloud/compute/v1/VpnTunnelSettings.java   |  165 +-
 .../compute/v1/VpnTunnelsScopedList.java      |   37 +-
 .../com/google/cloud/compute/v1/Warning.java  |   44 +-
 .../com/google/cloud/compute/v1/Warnings.java |   44 +-
 .../google/cloud/compute/v1/XpnHostList.java  |   73 +-
 .../cloud/compute/v1/XpnResourceId.java       |   38 +-
 .../com/google/cloud/compute/v1/Zone.java     |  128 +-
 .../google/cloud/compute/v1/ZoneClient.java   |  158 +-
 .../com/google/cloud/compute/v1/ZoneList.java |   73 +-
 .../com/google/cloud/compute/v1/ZoneName.java |  186 --
 .../cloud/compute/v1/ZoneOperationClient.java |  184 +-
 .../compute/v1/ZoneOperationSettings.java     |  141 +-
 .../compute/v1/ZoneSetLabelsRequest.java      |   41 +-
 .../google/cloud/compute/v1/ZoneSettings.java |  122 +-
 .../google/cloud/compute/v1/package-info.java |  535 +++--
 .../compute/v1/stub/AcceleratorTypeStub.java  |   36 +-
 .../v1/stub/AcceleratorTypeStubSettings.java  |  493 ++--
 .../cloud/compute/v1/stub/AddressStub.java    |   26 +-
 .../compute/v1/stub/AddressStubSettings.java  |  487 ++--
 .../cloud/compute/v1/stub/AutoscalerStub.java |   26 +-
 .../v1/stub/AutoscalerStubSettings.java       |  546 ++---
 .../compute/v1/stub/BackendBucketStub.java    |   16 +-
 .../v1/stub/BackendBucketStubSettings.java    |  424 ++--
 .../compute/v1/stub/BackendServiceStub.java   |   36 +-
 .../v1/stub/BackendServiceStubSettings.java   |  629 ++---
 .../cloud/compute/v1/stub/DiskStub.java       |   23 +-
 .../compute/v1/stub/DiskStubSettings.java     |  522 ++---
 .../cloud/compute/v1/stub/DiskTypeStub.java   |   26 +-
 .../compute/v1/stub/DiskTypeStubSettings.java |  448 ++--
 .../cloud/compute/v1/stub/FirewallStub.java   |   13 +-
 .../compute/v1/stub/FirewallStubSettings.java |  377 ++-
 .../compute/v1/stub/ForwardingRuleStub.java   |   37 +-
 .../v1/stub/ForwardingRuleStubSettings.java   |  574 ++---
 .../compute/v1/stub/GlobalAddressStub.java    |   13 +-
 .../v1/stub/GlobalAddressStubSettings.java    |  366 ++-
 .../v1/stub/GlobalForwardingRuleStub.java     |   41 +-
 .../GlobalForwardingRuleStubSettings.java     |  433 ++--
 .../compute/v1/stub/GlobalOperationStub.java  |   32 +-
 .../v1/stub/GlobalOperationStubSettings.java  |  511 +++--
 .../compute/v1/stub/HealthCheckStub.java      |   13 +-
 .../v1/stub/HealthCheckStubSettings.java      |  404 ++--
 .../compute/v1/stub/HttpHealthCheckStub.java  |   28 +-
 .../v1/stub/HttpHealthCheckStubSettings.java  |  434 ++--
 ...ttpJsonAcceleratorTypeCallableFactory.java |   54 +-
 .../v1/stub/HttpJsonAcceleratorTypeStub.java  |  271 ++-
 .../stub/HttpJsonAddressCallableFactory.java  |   56 +-
 .../compute/v1/stub/HttpJsonAddressStub.java  |  300 +--
 .../HttpJsonAutoscalerCallableFactory.java    |   58 +-
 .../v1/stub/HttpJsonAutoscalerStub.java       |  400 ++--
 .../HttpJsonBackendBucketCallableFactory.java |   53 +-
 .../v1/stub/HttpJsonBackendBucketStub.java    |  402 ++--
 ...HttpJsonBackendServiceCallableFactory.java |   60 +-
 .../v1/stub/HttpJsonBackendServiceStub.java   |  558 +++--
 .../v1/stub/HttpJsonDiskCallableFactory.java  |   62 +-
 .../compute/v1/stub/HttpJsonDiskStub.java     |  398 ++--
 .../stub/HttpJsonDiskTypeCallableFactory.java |   54 +-
 .../compute/v1/stub/HttpJsonDiskTypeStub.java |  219 +-
 .../stub/HttpJsonFirewallCallableFactory.java |   53 +-
 .../compute/v1/stub/HttpJsonFirewallStub.java |  309 +--
 ...HttpJsonForwardingRuleCallableFactory.java |   58 +-
 .../v1/stub/HttpJsonForwardingRuleStub.java   |  444 ++--
 .../HttpJsonGlobalAddressCallableFactory.java |   51 +-
 .../v1/stub/HttpJsonGlobalAddressStub.java    |  275 ++-
 ...onGlobalForwardingRuleCallableFactory.java |   53 +-
 .../HttpJsonGlobalForwardingRuleStub.java     |  371 +--
 ...ttpJsonGlobalOperationCallableFactory.java |   53 +-
 .../v1/stub/HttpJsonGlobalOperationStub.java  |  305 ++-
 .../HttpJsonHealthCheckCallableFactory.java   |   53 +-
 .../v1/stub/HttpJsonHealthCheckStub.java      |  361 +--
 ...ttpJsonHttpHealthCheckCallableFactory.java |   53 +-
 .../v1/stub/HttpJsonHttpHealthCheckStub.java  |  426 ++--
 ...tpJsonHttpsHealthCheckCallableFactory.java |   53 +-
 .../v1/stub/HttpJsonHttpsHealthCheckStub.java |  430 ++--
 .../v1/stub/HttpJsonImageCallableFactory.java |   57 +-
 .../compute/v1/stub/HttpJsonImageStub.java    |  322 +--
 .../stub/HttpJsonInstanceCallableFactory.java |   94 +-
 .../HttpJsonInstanceGroupCallableFactory.java |   67 +-
 ...onInstanceGroupManagerCallableFactory.java |   69 +-
 .../HttpJsonInstanceGroupManagerStub.java     |  879 ++++---
 .../v1/stub/HttpJsonInstanceGroupStub.java    |  647 +++---
 .../compute/v1/stub/HttpJsonInstanceStub.java | 1601 +++++++------
 ...tpJsonInstanceTemplateCallableFactory.java |   51 +-
 .../v1/stub/HttpJsonInstanceTemplateStub.java |  306 +--
 ...InterconnectAttachmentCallableFactory.java |   56 +-
 .../HttpJsonInterconnectAttachmentStub.java   |  412 ++--
 .../HttpJsonInterconnectCallableFactory.java  |   52 +-
 ...onInterconnectLocationCallableFactory.java |   49 +-
 .../HttpJsonInterconnectLocationStub.java     |  193 +-
 .../v1/stub/HttpJsonInterconnectStub.java     |  334 +--
 .../compute/v1/stub/HttpJsonLicensStub.java   |  152 --
 .../stub/HttpJsonLicenseCallableFactory.java  |   45 +-
 ...> HttpJsonLicenseCodeCallableFactory.java} |   47 +-
 .../v1/stub/HttpJsonLicenseCodeStub.java      |  207 ++
 .../compute/v1/stub/HttpJsonLicenseStub.java  |  248 +-
 .../HttpJsonMachineTypeCallableFactory.java   |   54 +-
 .../v1/stub/HttpJsonMachineTypeStub.java      |  236 +-
 .../stub/HttpJsonNetworkCallableFactory.java  |   57 +-
 .../compute/v1/stub/HttpJsonNetworkStub.java  |  438 ++--
 .../stub/HttpJsonProjectCallableFactory.java  |   68 +-
 .../compute/v1/stub/HttpJsonProjectStub.java  |  740 +++---
 ...tpJsonRegionAutoscalerCallableFactory.java |   53 +-
 .../v1/stub/HttpJsonRegionAutoscalerStub.java |  425 ++--
 ...onRegionBackendServiceCallableFactory.java |   56 +-
 .../HttpJsonRegionBackendServiceStub.java     |  500 ++--
 .../stub/HttpJsonRegionCallableFactory.java   |   49 +-
 ...tpJsonRegionCommitmentCallableFactory.java |   55 +-
 .../v1/stub/HttpJsonRegionCommitmentStub.java |  323 +--
 ...sonRegionInstanceGroupCallableFactory.java |   56 +-
 ...onInstanceGroupManagerCallableFactory.java |   67 +-
 ...ttpJsonRegionInstanceGroupManagerStub.java |  811 ++++---
 .../stub/HttpJsonRegionInstanceGroupStub.java |  345 +--
 ...ttpJsonRegionOperationCallableFactory.java |   49 +-
 .../v1/stub/HttpJsonRegionOperationStub.java  |  223 +-
 .../compute/v1/stub/HttpJsonRegionStub.java   |  103 +-
 .../v1/stub/HttpJsonRouteCallableFactory.java |   51 +-
 .../compute/v1/stub/HttpJsonRouteStub.java    |  188 +-
 .../stub/HttpJsonRouterCallableFactory.java   |   62 +-
 .../compute/v1/stub/HttpJsonRouterStub.java   |  469 ++--
 .../stub/HttpJsonSnapshotCallableFactory.java |   52 +-
 .../compute/v1/stub/HttpJsonSnapshotStub.java |  238 +-
 ...HttpJsonSslCertificateCallableFactory.java |   51 +-
 .../v1/stub/HttpJsonSslCertificateStub.java   |  294 +--
 .../HttpJsonSslPolicyCallableFactory.java     |   65 +
 .../v1/stub/HttpJsonSslPolicyStub.java        |  370 +++
 .../HttpJsonSubnetworkCallableFactory.java    |   61 +-
 .../v1/stub/HttpJsonSubnetworkStub.java       |  493 ++--
 ...ttpJsonTargetHttpProxyCallableFactory.java |   53 +-
 .../v1/stub/HttpJsonTargetHttpProxyStub.java  |  366 +--
 ...tpJsonTargetHttpsProxyCallableFactory.java |   55 +-
 .../v1/stub/HttpJsonTargetHttpsProxyStub.java |  478 ++--
 ...HttpJsonTargetInstanceCallableFactory.java |   56 +-
 .../v1/stub/HttpJsonTargetInstanceStub.java   |  380 ++--
 .../HttpJsonTargetPoolCallableFactory.java    |   69 +-
 .../v1/stub/HttpJsonTargetPoolStub.java       |  691 +++---
 ...HttpJsonTargetSslProxyCallableFactory.java |   57 +-
 .../v1/stub/HttpJsonTargetSslProxyStub.java   |  531 +++--
 ...HttpJsonTargetTcpProxyCallableFactory.java |   55 +-
 .../v1/stub/HttpJsonTargetTcpProxyStub.java   |  424 ++--
 ...tpJsonTargetVpnGatewayCallableFactory.java |   56 +-
 .../v1/stub/HttpJsonTargetVpnGatewayStub.java |  392 ++--
 .../stub/HttpJsonUrlMapCallableFactory.java   |   58 +-
 .../compute/v1/stub/HttpJsonUrlMapStub.java   |  394 ++--
 .../HttpJsonVpnTunnelCallableFactory.java     |   56 +-
 .../v1/stub/HttpJsonVpnTunnelStub.java        |  304 +--
 .../v1/stub/HttpJsonZoneCallableFactory.java  |   49 +-
 .../HttpJsonZoneOperationCallableFactory.java |   49 +-
 .../v1/stub/HttpJsonZoneOperationStub.java    |  209 +-
 .../compute/v1/stub/HttpJsonZoneStub.java     |   95 +-
 .../compute/v1/stub/HttpsHealthCheckStub.java |   34 +-
 .../v1/stub/HttpsHealthCheckStubSettings.java |  439 ++--
 .../cloud/compute/v1/stub/ImageStub.java      |   13 +-
 .../compute/v1/stub/ImageStubSettings.java    |  384 ++--
 .../v1/stub/InstanceGroupManagerStub.java     |  102 +-
 .../InstanceGroupManagerStubSettings.java     |  793 ++++---
 .../compute/v1/stub/InstanceGroupStub.java    |   68 +-
 .../v1/stub/InstanceGroupStubSettings.java    |  796 ++++---
 .../cloud/compute/v1/stub/InstanceStub.java   |  110 +-
 .../compute/v1/stub/InstanceStubSettings.java | 1212 +++++-----
 .../compute/v1/stub/InstanceTemplateStub.java |   28 +-
 .../v1/stub/InstanceTemplateStubSettings.java |  383 ++--
 .../v1/stub/InterconnectAttachmentStub.java   |   57 +-
 .../InterconnectAttachmentStubSettings.java   |  582 ++---
 .../v1/stub/InterconnectLocationStub.java     |   22 +-
 .../InterconnectLocationStubSettings.java     |  340 +--
 .../compute/v1/stub/InterconnectStub.java     |   13 +-
 .../v1/stub/InterconnectStubSettings.java     |  387 ++--
 .../compute/v1/stub/LicensStubSettings.java   |  309 ---
 .../{LicensStub.java => LicenseCodeStub.java} |   23 +-
 .../v1/stub/LicenseCodeStubSettings.java      |  314 +++
 .../cloud/compute/v1/stub/LicenseStub.java    |   40 +-
 .../compute/v1/stub/LicenseStubSettings.java  |  338 ++-
 .../compute/v1/stub/MachineTypeStub.java      |   30 +-
 .../v1/stub/MachineTypeStubSettings.java      |  468 ++--
 .../cloud/compute/v1/stub/NetworkStub.java    |   18 +-
 .../compute/v1/stub/NetworkStubSettings.java  |  429 ++--
 .../cloud/compute/v1/stub/ProjectStub.java    |   55 +-
 .../compute/v1/stub/ProjectStubSettings.java  |  705 +++---
 .../compute/v1/stub/RegionAutoscalerStub.java |   31 +-
 .../v1/stub/RegionAutoscalerStubSettings.java |  439 ++--
 .../v1/stub/RegionBackendServiceStub.java     |   50 +-
 .../RegionBackendServiceStubSettings.java     |  491 ++--
 .../compute/v1/stub/RegionCommitmentStub.java |   39 +-
 .../v1/stub/RegionCommitmentStubSettings.java |  520 +++--
 .../stub/RegionInstanceGroupManagerStub.java  |   90 +-
 ...egionInstanceGroupManagerStubSettings.java |  686 +++---
 .../v1/stub/RegionInstanceGroupStub.java      |   48 +-
 .../stub/RegionInstanceGroupStubSettings.java |  541 +++--
 .../compute/v1/stub/RegionOperationStub.java  |   16 +-
 .../v1/stub/RegionOperationStubSettings.java  |  342 ++-
 .../cloud/compute/v1/stub/RegionStub.java     |   13 +-
 .../compute/v1/stub/RegionStubSettings.java   |  288 ++-
 .../cloud/compute/v1/stub/RouteStub.java      |   10 +-
 .../compute/v1/stub/RouteStubSettings.java    |  315 ++-
 .../cloud/compute/v1/stub/RouterStub.java     |   29 +-
 .../compute/v1/stub/RouterStubSettings.java   |  569 +++--
 .../cloud/compute/v1/stub/SnapshotStub.java   |   14 +-
 .../compute/v1/stub/SnapshotStubSettings.java |  339 ++-
 .../compute/v1/stub/SslCertificateStub.java   |   16 +-
 .../v1/stub/SslCertificateStubSettings.java   |  376 ++-
 .../cloud/compute/v1/stub/SslPolicyStub.java  |   86 +
 .../v1/stub/SslPolicyStubSettings.java        |  490 ++++
 .../cloud/compute/v1/stub/SubnetworkStub.java |   40 +-
 .../v1/stub/SubnetworkStubSettings.java       |  592 ++---
 .../compute/v1/stub/TargetHttpProxyStub.java  |   32 +-
 .../v1/stub/TargetHttpProxyStubSettings.java  |  409 ++--
 .../compute/v1/stub/TargetHttpsProxyStub.java |   47 +-
 .../v1/stub/TargetHttpsProxyStubSettings.java |  472 ++--
 .../compute/v1/stub/TargetInstanceStub.java   |   33 +-
 .../v1/stub/TargetInstanceStubSettings.java   |  547 ++---
 .../cloud/compute/v1/stub/TargetPoolStub.java |   50 +-
 .../v1/stub/TargetPoolStubSettings.java       |  675 +++---
 .../compute/v1/stub/TargetSslProxyStub.java   |   45 +-
 .../v1/stub/TargetSslProxyStubSettings.java   |  508 +++--
 .../compute/v1/stub/TargetTcpProxyStub.java   |   30 +-
 .../v1/stub/TargetTcpProxyStubSettings.java   |  448 ++--
 .../compute/v1/stub/TargetVpnGatewayStub.java |   45 +-
 .../v1/stub/TargetVpnGatewayStubSettings.java |  554 ++---
 .../cloud/compute/v1/stub/UrlMapStub.java     |   21 +-
 .../compute/v1/stub/UrlMapStubSettings.java   |  415 ++--
 .../cloud/compute/v1/stub/VpnTunnelStub.java  |   26 +-
 .../v1/stub/VpnTunnelStubSettings.java        |  502 ++--
 .../compute/v1/stub/ZoneOperationStub.java    |   13 +-
 .../v1/stub/ZoneOperationStubSettings.java    |  324 ++-
 .../cloud/compute/v1/stub/ZoneStub.java       |   10 +-
 .../compute/v1/stub/ZoneStubSettings.java     |  284 ++-
 .../compute/v1/AcceleratorTypeClientTest.java |  168 +-
 .../cloud/compute/v1/AddressClientTest.java   |  331 +--
 .../compute/v1/AutoscalerClientTest.java      |  460 ++--
 .../compute/v1/BackendBucketClientTest.java   |  421 ++--
 .../compute/v1/BackendServiceClientTest.java  |  520 +++--
 .../cloud/compute/v1/DiskClientTest.java      |  539 +++--
 .../cloud/compute/v1/DiskTypeClientTest.java  |  170 +-
 .../cloud/compute/v1/FirewallClientTest.java  |  426 ++--
 .../compute/v1/ForwardingRuleClientTest.java  |  414 ++--
 .../compute/v1/GlobalAddressClientTest.java   |  283 ++-
 .../v1/GlobalForwardingRuleClientTest.java    |  374 +--
 .../compute/v1/GlobalOperationClientTest.java |  222 +-
 .../compute/v1/HealthCheckClientTest.java     |  433 ++--
 .../compute/v1/HttpHealthCheckClientTest.java |  431 ++--
 .../v1/HttpsHealthCheckClientTest.java        |  431 ++--
 .../cloud/compute/v1/ImageClientTest.java     |  525 +++--
 .../cloud/compute/v1/InstanceClientTest.java  | 1987 +++++++++-------
 .../compute/v1/InstanceGroupClientTest.java   |  646 +++---
 .../v1/InstanceGroupManagerClientTest.java    |  895 +++++---
 .../v1/InstanceTemplateClientTest.java        |  267 ++-
 .../v1/InterconnectAttachmentClientTest.java  |  345 +--
 .../compute/v1/InterconnectClientTest.java    |  369 +--
 .../v1/InterconnectLocationClientTest.java    |  139 +-
 .../cloud/compute/v1/LicenseClientTest.java   |  381 +++-
 .../compute/v1/LicenseCodeClientTest.java     |  192 ++
 .../compute/v1/MachineTypeClientTest.java     |  178 +-
 .../cloud/compute/v1/NetworkClientTest.java   |  582 ++---
 .../cloud/compute/v1/ProjectClientTest.java   |  790 ++++---
 .../v1/RegionAutoscalerClientTest.java        |  416 ++--
 .../v1/RegionBackendServiceClientTest.java    |  480 ++--
 .../cloud/compute/v1/RegionClientTest.java    |  115 +-
 .../v1/RegionCommitmentClientTest.java        |  248 +-
 .../v1/RegionInstanceGroupClientTest.java     |  288 ++-
 .../RegionInstanceGroupManagerClientTest.java |  871 ++++---
 .../compute/v1/RegionOperationClientTest.java |  178 +-
 .../cloud/compute/v1/RouteClientTest.java     |  286 +--
 .../cloud/compute/v1/RouterClientTest.java    |  537 +++--
 .../cloud/compute/v1/SnapshotClientTest.java  |  292 +--
 .../compute/v1/SslCertificateClientTest.java  |  271 ++-
 .../cloud/compute/v1/SslPolicyClientTest.java |  538 +++++
 .../compute/v1/SubnetworkClientTest.java      |  583 +++--
 .../compute/v1/TargetHttpProxyClientTest.java |  346 +--
 .../v1/TargetHttpsProxyClientTest.java        |  536 +++--
 .../compute/v1/TargetInstanceClientTest.java  |  323 +--
 .../compute/v1/TargetPoolClientTest.java      |  766 ++++---
 .../compute/v1/TargetSslProxyClientTest.java  |  630 +++--
 .../compute/v1/TargetTcpProxyClientTest.java  |  445 ++--
 .../v1/TargetVpnGatewayClientTest.java        |  322 +--
 .../cloud/compute/v1/UrlMapClientTest.java    |  533 +++--
 .../cloud/compute/v1/VpnTunnelClientTest.java |  338 +--
 .../cloud/compute/v1/ZoneClientTest.java      |  117 +-
 .../compute/v1/ZoneOperationClientTest.java   |  178 +-
 .../cloud/compute/v1/it/ITComputeTest.java    |  154 --
 1056 files changed, 101944 insertions(+), 91015 deletions(-)
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{GetLicensHttpRequest.java => DeleteLicenseHttpRequest.java} (73%)
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ProjectAddressName.java => ProjectGlobalAddressName.java} (62%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{BackendBucketName.java => ProjectGlobalBackendBucketName.java} (62%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{BackendServiceName.java => ProjectGlobalBackendServiceName.java} (62%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{FirewallName.java => ProjectGlobalFirewallName.java} (64%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ProjectForwardingRuleName.java => ProjectGlobalForwardingRuleName.java} (60%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HealthCheckName.java => ProjectGlobalHealthCheckName.java} (63%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HttpHealthCheckName.java => ProjectGlobalHttpHealthCheckName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HttpsHealthCheckName.java => ProjectGlobalHttpsHealthCheckName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{FamilyName.java => ProjectGlobalImageFamilyName.java} (63%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ImageName.java => ProjectGlobalImageName.java} (65%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ProjectImageName.java => ProjectGlobalImageResourceName.java} (62%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{InstanceTemplateName.java => ProjectGlobalInstanceTemplateName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{InterconnectLocationName.java => ProjectGlobalInterconnectLocationName.java} (60%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{InterconnectName.java => ProjectGlobalInterconnectName.java} (62%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ProjectRouteName.java => ProjectGlobalLicenseCodeName.java} (54%)
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{LicenseName.java => ProjectGlobalLicenseName.java} (64%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ProjectSnapshotName.java => ProjectGlobalLicenseResourceName.java} (62%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{NetworkName.java => ProjectGlobalNetworkName.java} (64%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{OperationName.java => ProjectGlobalOperationName.java} (63%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{RouteName.java => ProjectGlobalRouteName.java} (65%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{SnapshotName.java => ProjectGlobalSnapshotName.java} (64%)
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{SslCertificateName.java => ProjectGlobalSslCertificateName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ProjectUrlMapName.java => ProjectGlobalSslPolicyName.java} (55%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{TargetHttpProxyName.java => ProjectGlobalTargetHttpProxyName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{TargetHttpsProxyName.java => ProjectGlobalTargetHttpsProxyName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{TargetSslProxyName.java => ProjectGlobalTargetSslProxyName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{TargetTcpProxyName.java => ProjectGlobalTargetTcpProxyName.java} (61%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{UrlMapName.java => ProjectGlobalUrlMapName.java} (64%)
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{ResourceName.java => ProjectZoneDiskResourceName.java} (64%)
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{DiskTypeName.java => ProjectZoneInstanceResourceName.java} (55%)
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/{HttpJsonLicensCallableFactory.java => HttpJsonLicenseCodeCallableFactory.java} (51%)
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java
 delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java
 rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/{LicensStub.java => LicenseCodeStub.java} (61%)
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java
 create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java
 create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java
 create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java
 delete mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java

diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java
index 943d915ced9c..03627e8ce452 100644
--- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java
+++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java
@@ -90,6 +90,7 @@
 import org.junit.Test;
 import org.junit.rules.Timeout;
 
+@Ignore
 public class ITComputeTest {
 
   private static final String REGION = "us-central1";
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java
index 207b4929732e..b9a26621f369 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -36,7 +33,8 @@ public final class AbandonInstancesInstanceGroupManagerHttpRequest implements Ap
   private final String callback;
   private final String fields;
   private final String instanceGroupManager;
-  private final InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource;
+  private final InstanceGroupManagersAbandonInstancesRequest
+      instanceGroupManagersAbandonInstancesRequestResource;
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
@@ -56,24 +54,24 @@ private AbandonInstancesInstanceGroupManagerHttpRequest() {
     this.userIp = null;
   }
 
-
   private AbandonInstancesInstanceGroupManagerHttpRequest(
       String access_token,
       String callback,
       String fields,
       String instanceGroupManager,
-      InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource,
+      InstanceGroupManagersAbandonInstancesRequest
+          instanceGroupManagersAbandonInstancesRequestResource,
       String key,
       String prettyPrint,
       String quotaUser,
       String requestId,
-      String userIp
-      ) {
+      String userIp) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
     this.instanceGroupManager = instanceGroupManager;
-    this.instanceGroupManagersAbandonInstancesRequestResource = instanceGroupManagersAbandonInstancesRequestResource;
+    this.instanceGroupManagersAbandonInstancesRequestResource =
+        instanceGroupManagersAbandonInstancesRequestResource;
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
@@ -94,10 +92,15 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
     }
     if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
+      fieldMap.put(
+          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
     }
-    if (fieldNames.contains("instanceGroupManagersAbandonInstancesRequestResource") && instanceGroupManagersAbandonInstancesRequestResource != null) {
-      fieldMap.put("instanceGroupManagersAbandonInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersAbandonInstancesRequestResource)));
+    if (fieldNames.contains("instanceGroupManagersAbandonInstancesRequestResource")
+        && instanceGroupManagersAbandonInstancesRequestResource != null) {
+      fieldMap.put(
+          "instanceGroupManagersAbandonInstancesRequestResource",
+          Collections.singletonList(
+              String.valueOf(instanceGroupManagersAbandonInstancesRequestResource)));
     }
     if (fieldNames.contains("key") && key != null) {
       fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
@@ -174,7 +177,8 @@ public String getInstanceGroupManager() {
     return instanceGroupManager;
   }
 
-  public InstanceGroupManagersAbandonInstancesRequest getInstanceGroupManagersAbandonInstancesRequestResource() {
+  public InstanceGroupManagersAbandonInstancesRequest
+      getInstanceGroupManagersAbandonInstancesRequestResource() {
     return instanceGroupManagersAbandonInstancesRequestResource;
   }
 
@@ -198,22 +202,24 @@ public String getUserIp() {
     return userIp;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(AbandonInstancesInstanceGroupManagerHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static AbandonInstancesInstanceGroupManagerHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final AbandonInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new AbandonInstancesInstanceGroupManagerHttpRequest();
   }
@@ -223,7 +229,8 @@ public static class Builder {
     private String callback;
     private String fields;
     private String instanceGroupManager;
-    private InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource;
+    private InstanceGroupManagersAbandonInstancesRequest
+        instanceGroupManagersAbandonInstancesRequestResource;
     private String key;
     private String prettyPrint;
     private String quotaUser;
@@ -233,7 +240,8 @@ public static class Builder {
     Builder() {}
 
     public Builder mergeFrom(AbandonInstancesInstanceGroupManagerHttpRequest other) {
-      if (other == AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this;
+      if (other == AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance())
+        return this;
       if (other.getAccessToken() != null) {
         this.access_token = other.access_token;
       }
@@ -247,7 +255,8 @@ public Builder mergeFrom(AbandonInstancesInstanceGroupManagerHttpRequest other)
         this.instanceGroupManager = other.instanceGroupManager;
       }
       if (other.getInstanceGroupManagersAbandonInstancesRequestResource() != null) {
-        this.instanceGroupManagersAbandonInstancesRequestResource = other.instanceGroupManagersAbandonInstancesRequestResource;
+        this.instanceGroupManagersAbandonInstancesRequestResource =
+            other.instanceGroupManagersAbandonInstancesRequestResource;
       }
       if (other.getKey() != null) {
         this.key = other.key;
@@ -272,7 +281,8 @@ public Builder mergeFrom(AbandonInstancesInstanceGroupManagerHttpRequest other)
       this.callback = source.callback;
       this.fields = source.fields;
       this.instanceGroupManager = source.instanceGroupManager;
-      this.instanceGroupManagersAbandonInstancesRequestResource = source.instanceGroupManagersAbandonInstancesRequestResource;
+      this.instanceGroupManagersAbandonInstancesRequestResource =
+          source.instanceGroupManagersAbandonInstancesRequestResource;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
@@ -316,12 +326,16 @@ public Builder setInstanceGroupManager(String instanceGroupManager) {
       return this;
     }
 
-    public InstanceGroupManagersAbandonInstancesRequest getInstanceGroupManagersAbandonInstancesRequestResource() {
+    public InstanceGroupManagersAbandonInstancesRequest
+        getInstanceGroupManagersAbandonInstancesRequestResource() {
       return instanceGroupManagersAbandonInstancesRequestResource;
     }
 
-    public Builder setInstanceGroupManagersAbandonInstancesRequestResource(InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) {
-      this.instanceGroupManagersAbandonInstancesRequestResource = instanceGroupManagersAbandonInstancesRequestResource;
+    public Builder setInstanceGroupManagersAbandonInstancesRequestResource(
+        InstanceGroupManagersAbandonInstancesRequest
+            instanceGroupManagersAbandonInstancesRequestResource) {
+      this.instanceGroupManagersAbandonInstancesRequestResource =
+          instanceGroupManagersAbandonInstancesRequestResource;
       return this;
     }
 
@@ -370,36 +384,27 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
-
     public AbandonInstancesInstanceGroupManagerHttpRequest build() {
       String missing = "";
 
-
-
       if (instanceGroupManager == null) {
         missing += " instanceGroupManager";
       }
 
-
-
-
-
-
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new AbandonInstancesInstanceGroupManagerHttpRequest(
-        access_token,
-        callback,
-        fields,
-        instanceGroupManager,
-        instanceGroupManagersAbandonInstancesRequestResource,
-        key,
-        prettyPrint,
-        quotaUser,
-        requestId,
-        userIp
-      );
+          access_token,
+          callback,
+          fields,
+          instanceGroupManager,
+          instanceGroupManagersAbandonInstancesRequestResource,
+          key,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
     }
 
     public Builder clone() {
@@ -408,7 +413,8 @@ public Builder clone() {
       newBuilder.setCallback(this.callback);
       newBuilder.setFields(this.fields);
       newBuilder.setInstanceGroupManager(this.instanceGroupManager);
-      newBuilder.setInstanceGroupManagersAbandonInstancesRequestResource(this.instanceGroupManagersAbandonInstancesRequestResource);
+      newBuilder.setInstanceGroupManagersAbandonInstancesRequestResource(
+          this.instanceGroupManagersAbandonInstancesRequestResource);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
@@ -421,16 +427,35 @@ public Builder clone() {
   @Override
   public String toString() {
     return "AbandonInstancesInstanceGroupManagerHttpRequest{"
-        + "access_token=" + access_token + ", "
-        + "callback=" + callback + ", "
-        + "fields=" + fields + ", "
-        + "instanceGroupManager=" + instanceGroupManager + ", "
-        + "instanceGroupManagersAbandonInstancesRequestResource=" + instanceGroupManagersAbandonInstancesRequestResource + ", "
-        + "key=" + key + ", "
-        + "prettyPrint=" + prettyPrint + ", "
-        + "quotaUser=" + quotaUser + ", "
-        + "requestId=" + requestId + ", "
-        + "userIp=" + userIp
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "instanceGroupManager="
+        + instanceGroupManager
+        + ", "
+        + "instanceGroupManagersAbandonInstancesRequestResource="
+        + instanceGroupManagersAbandonInstancesRequestResource
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
         + "}";
   }
 
@@ -440,19 +465,20 @@ public boolean equals(Object o) {
       return true;
     }
     if (o instanceof AbandonInstancesInstanceGroupManagerHttpRequest) {
-      AbandonInstancesInstanceGroupManagerHttpRequest that = (AbandonInstancesInstanceGroupManagerHttpRequest) o;
-      return
-          Objects.equals(this.access_token, that.getAccessToken()) &&
-          Objects.equals(this.callback, that.getCallback()) &&
-          Objects.equals(this.fields, that.getFields()) &&
-          Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) &&
-          Objects.equals(this.instanceGroupManagersAbandonInstancesRequestResource, that.getInstanceGroupManagersAbandonInstancesRequestResource()) &&
-          Objects.equals(this.key, that.getKey()) &&
-          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
-          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
-          Objects.equals(this.requestId, that.getRequestId()) &&
-          Objects.equals(this.userIp, that.getUserIp())
-          ;
+      AbandonInstancesInstanceGroupManagerHttpRequest that =
+          (AbandonInstancesInstanceGroupManagerHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager())
+          && Objects.equals(
+              this.instanceGroupManagersAbandonInstancesRequestResource,
+              that.getInstanceGroupManagersAbandonInstancesRequestResource())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
     }
     return false;
   }
@@ -460,16 +486,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-      access_token,
-      callback,
-      fields,
-      instanceGroupManager,
-      instanceGroupManagersAbandonInstancesRequestResource,
-      key,
-      prettyPrint,
-      quotaUser,
-      requestId,
-      userIp
-    );
+        access_token,
+        callback,
+        fields,
+        instanceGroupManager,
+        instanceGroupManagersAbandonInstancesRequestResource,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java
index 6481fbe386aa..1ccb72d73dc8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -39,7 +36,8 @@ public final class AbandonInstancesRegionInstanceGroupManagerHttpRequest impleme
   private final String key;
   private final String prettyPrint;
   private final String quotaUser;
-  private final RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource;
+  private final RegionInstanceGroupManagersAbandonInstancesRequest
+      regionInstanceGroupManagersAbandonInstancesRequestResource;
   private final String requestId;
   private final String userIp;
 
@@ -56,7 +54,6 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest() {
     this.userIp = null;
   }
 
-
   private AbandonInstancesRegionInstanceGroupManagerHttpRequest(
       String access_token,
       String callback,
@@ -65,10 +62,10 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest(
       String key,
       String prettyPrint,
       String quotaUser,
-      RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource,
+      RegionInstanceGroupManagersAbandonInstancesRequest
+          regionInstanceGroupManagersAbandonInstancesRequestResource,
       String requestId,
-      String userIp
-      ) {
+      String userIp) {
     this.access_token = access_token;
     this.callback = callback;
     this.fields = fields;
@@ -76,7 +73,8 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest(
     this.key = key;
     this.prettyPrint = prettyPrint;
     this.quotaUser = quotaUser;
-    this.regionInstanceGroupManagersAbandonInstancesRequestResource = regionInstanceGroupManagersAbandonInstancesRequestResource;
+    this.regionInstanceGroupManagersAbandonInstancesRequestResource =
+        regionInstanceGroupManagersAbandonInstancesRequestResource;
     this.requestId = requestId;
     this.userIp = userIp;
   }
@@ -94,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
     }
     if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
+      fieldMap.put(
+          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
     }
     if (fieldNames.contains("key") && key != null) {
       fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
@@ -105,8 +104,12 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("quotaUser") && quotaUser != null) {
       fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
     }
-    if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource") && regionInstanceGroupManagersAbandonInstancesRequestResource != null) {
-      fieldMap.put("regionInstanceGroupManagersAbandonInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource)));
+    if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource")
+        && regionInstanceGroupManagersAbandonInstancesRequestResource != null) {
+      fieldMap.put(
+          "regionInstanceGroupManagersAbandonInstancesRequestResource",
+          Collections.singletonList(
+              String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource)));
     }
     if (fieldNames.contains("requestId") && requestId != null) {
       fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
@@ -186,7 +189,8 @@ public String getQuotaUser() {
     return quotaUser;
   }
 
-  public RegionInstanceGroupManagersAbandonInstancesRequest getRegionInstanceGroupManagersAbandonInstancesRequestResource() {
+  public RegionInstanceGroupManagersAbandonInstancesRequest
+      getRegionInstanceGroupManagersAbandonInstancesRequestResource() {
     return regionInstanceGroupManagersAbandonInstancesRequestResource;
   }
 
@@ -198,22 +202,25 @@ public String getUserIp() {
     return userIp;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-  public static Builder newBuilder(AbandonInstancesRegionInstanceGroupManagerHttpRequest prototype) {
+
+  public static Builder newBuilder(
+      AbandonInstancesRegionInstanceGroupManagerHttpRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static AbandonInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final AbandonInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new AbandonInstancesRegionInstanceGroupManagerHttpRequest();
   }
@@ -226,14 +233,16 @@ public static class Builder {
     private String key;
     private String prettyPrint;
     private String quotaUser;
-    private RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource;
+    private RegionInstanceGroupManagersAbandonInstancesRequest
+        regionInstanceGroupManagersAbandonInstancesRequestResource;
     private String requestId;
     private String userIp;
 
     Builder() {}
 
     public Builder mergeFrom(AbandonInstancesRegionInstanceGroupManagerHttpRequest other) {
-      if (other == AbandonInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this;
+      if (other == AbandonInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance())
+        return this;
       if (other.getAccessToken() != null) {
         this.access_token = other.access_token;
       }
@@ -256,7 +265,8 @@ public Builder mergeFrom(AbandonInstancesRegionInstanceGroupManagerHttpRequest o
         this.quotaUser = other.quotaUser;
       }
       if (other.getRegionInstanceGroupManagersAbandonInstancesRequestResource() != null) {
-        this.regionInstanceGroupManagersAbandonInstancesRequestResource = other.regionInstanceGroupManagersAbandonInstancesRequestResource;
+        this.regionInstanceGroupManagersAbandonInstancesRequestResource =
+            other.regionInstanceGroupManagersAbandonInstancesRequestResource;
       }
       if (other.getRequestId() != null) {
         this.requestId = other.requestId;
@@ -275,7 +285,8 @@ public Builder mergeFrom(AbandonInstancesRegionInstanceGroupManagerHttpRequest o
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
       this.quotaUser = source.quotaUser;
-      this.regionInstanceGroupManagersAbandonInstancesRequestResource = source.regionInstanceGroupManagersAbandonInstancesRequestResource;
+      this.regionInstanceGroupManagersAbandonInstancesRequestResource =
+          source.regionInstanceGroupManagersAbandonInstancesRequestResource;
       this.requestId = source.requestId;
       this.userIp = source.userIp;
     }
@@ -343,12 +354,16 @@ public Builder setQuotaUser(String quotaUser) {
       return this;
     }
 
-    public RegionInstanceGroupManagersAbandonInstancesRequest getRegionInstanceGroupManagersAbandonInstancesRequestResource() {
+    public RegionInstanceGroupManagersAbandonInstancesRequest
+        getRegionInstanceGroupManagersAbandonInstancesRequestResource() {
       return regionInstanceGroupManagersAbandonInstancesRequestResource;
     }
 
-    public Builder setRegionInstanceGroupManagersAbandonInstancesRequestResource(RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) {
-      this.regionInstanceGroupManagersAbandonInstancesRequestResource = regionInstanceGroupManagersAbandonInstancesRequestResource;
+    public Builder setRegionInstanceGroupManagersAbandonInstancesRequestResource(
+        RegionInstanceGroupManagersAbandonInstancesRequest
+            regionInstanceGroupManagersAbandonInstancesRequestResource) {
+      this.regionInstanceGroupManagersAbandonInstancesRequestResource =
+          regionInstanceGroupManagersAbandonInstancesRequestResource;
       return this;
     }
 
@@ -370,36 +385,27 @@ public Builder setUserIp(String userIp) {
       return this;
     }
 
-
     public AbandonInstancesRegionInstanceGroupManagerHttpRequest build() {
       String missing = "";
 
-
-
       if (instanceGroupManager == null) {
         missing += " instanceGroupManager";
       }
 
-
-
-
-
-
       if (!missing.isEmpty()) {
         throw new IllegalStateException("Missing required properties:" + missing);
       }
       return new AbandonInstancesRegionInstanceGroupManagerHttpRequest(
-        access_token,
-        callback,
-        fields,
-        instanceGroupManager,
-        key,
-        prettyPrint,
-        quotaUser,
-        regionInstanceGroupManagersAbandonInstancesRequestResource,
-        requestId,
-        userIp
-      );
+          access_token,
+          callback,
+          fields,
+          instanceGroupManager,
+          key,
+          prettyPrint,
+          quotaUser,
+          regionInstanceGroupManagersAbandonInstancesRequestResource,
+          requestId,
+          userIp);
     }
 
     public Builder clone() {
@@ -411,7 +417,8 @@ public Builder clone() {
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
       newBuilder.setQuotaUser(this.quotaUser);
-      newBuilder.setRegionInstanceGroupManagersAbandonInstancesRequestResource(this.regionInstanceGroupManagersAbandonInstancesRequestResource);
+      newBuilder.setRegionInstanceGroupManagersAbandonInstancesRequestResource(
+          this.regionInstanceGroupManagersAbandonInstancesRequestResource);
       newBuilder.setRequestId(this.requestId);
       newBuilder.setUserIp(this.userIp);
       return newBuilder;
@@ -421,16 +428,35 @@ public Builder clone() {
   @Override
   public String toString() {
     return "AbandonInstancesRegionInstanceGroupManagerHttpRequest{"
-        + "access_token=" + access_token + ", "
-        + "callback=" + callback + ", "
-        + "fields=" + fields + ", "
-        + "instanceGroupManager=" + instanceGroupManager + ", "
-        + "key=" + key + ", "
-        + "prettyPrint=" + prettyPrint + ", "
-        + "quotaUser=" + quotaUser + ", "
-        + "regionInstanceGroupManagersAbandonInstancesRequestResource=" + regionInstanceGroupManagersAbandonInstancesRequestResource + ", "
-        + "requestId=" + requestId + ", "
-        + "userIp=" + userIp
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "instanceGroupManager="
+        + instanceGroupManager
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "regionInstanceGroupManagersAbandonInstancesRequestResource="
+        + regionInstanceGroupManagersAbandonInstancesRequestResource
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
         + "}";
   }
 
@@ -440,19 +466,20 @@ public boolean equals(Object o) {
       return true;
     }
     if (o instanceof AbandonInstancesRegionInstanceGroupManagerHttpRequest) {
-      AbandonInstancesRegionInstanceGroupManagerHttpRequest that = (AbandonInstancesRegionInstanceGroupManagerHttpRequest) o;
-      return
-          Objects.equals(this.access_token, that.getAccessToken()) &&
-          Objects.equals(this.callback, that.getCallback()) &&
-          Objects.equals(this.fields, that.getFields()) &&
-          Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) &&
-          Objects.equals(this.key, that.getKey()) &&
-          Objects.equals(this.prettyPrint, that.getPrettyPrint()) &&
-          Objects.equals(this.quotaUser, that.getQuotaUser()) &&
-          Objects.equals(this.regionInstanceGroupManagersAbandonInstancesRequestResource, that.getRegionInstanceGroupManagersAbandonInstancesRequestResource()) &&
-          Objects.equals(this.requestId, that.getRequestId()) &&
-          Objects.equals(this.userIp, that.getUserIp())
-          ;
+      AbandonInstancesRegionInstanceGroupManagerHttpRequest that =
+          (AbandonInstancesRegionInstanceGroupManagerHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(
+              this.regionInstanceGroupManagersAbandonInstancesRequestResource,
+              that.getRegionInstanceGroupManagersAbandonInstancesRequestResource())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
     }
     return false;
   }
@@ -460,16 +487,15 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-      access_token,
-      callback,
-      fields,
-      instanceGroupManager,
-      key,
-      prettyPrint,
-      quotaUser,
-      regionInstanceGroupManagersAbandonInstancesRequestResource,
-      requestId,
-      userIp
-    );
+        access_token,
+        callback,
+        fields,
+        instanceGroupManager,
+        key,
+        prettyPrint,
+        quotaUser,
+        regionInstanceGroupManagersAbandonInstancesRequestResource,
+        requestId,
+        userIp);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java
index 0232c0e03db6..78206f41eb00 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -40,11 +37,7 @@ private AcceleratorConfig() {
     this.acceleratorType = null;
   }
 
-
-  private AcceleratorConfig(
-      Integer acceleratorCount,
-      String acceleratorType
-      ) {
+  private AcceleratorConfig(Integer acceleratorCount, String acceleratorType) {
     this.acceleratorCount = acceleratorCount;
     this.acceleratorType = acceleratorType;
   }
@@ -86,22 +79,24 @@ public String getAcceleratorType() {
     return acceleratorType;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(AcceleratorConfig prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static AcceleratorConfig getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final AcceleratorConfig DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new AcceleratorConfig();
   }
@@ -146,13 +141,9 @@ public Builder setAcceleratorType(String acceleratorType) {
       return this;
     }
 
-
     public AcceleratorConfig build() {
 
-      return new AcceleratorConfig(
-        acceleratorCount,
-        acceleratorType
-      );
+      return new AcceleratorConfig(acceleratorCount, acceleratorType);
     }
 
     public Builder clone() {
@@ -166,8 +157,11 @@ public Builder clone() {
   @Override
   public String toString() {
     return "AcceleratorConfig{"
-        + "acceleratorCount=" + acceleratorCount + ", "
-        + "acceleratorType=" + acceleratorType
+        + "acceleratorCount="
+        + acceleratorCount
+        + ", "
+        + "acceleratorType="
+        + acceleratorType
         + "}";
   }
 
@@ -178,19 +172,14 @@ public boolean equals(Object o) {
     }
     if (o instanceof AcceleratorConfig) {
       AcceleratorConfig that = (AcceleratorConfig) o;
-      return
-          Objects.equals(this.acceleratorCount, that.getAcceleratorCount()) &&
-          Objects.equals(this.acceleratorType, that.getAcceleratorType())
-          ;
+      return Objects.equals(this.acceleratorCount, that.getAcceleratorCount())
+          && Objects.equals(this.acceleratorType, that.getAcceleratorType());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      acceleratorCount,
-      acceleratorType
-    );
+    return Objects.hash(acceleratorCount, acceleratorType);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java
index d205857c3034..77d140001d40 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -54,7 +51,6 @@ private AcceleratorType() {
     this.zone = null;
   }
 
-
   private AcceleratorType(
       String creationTimestamp,
       DeprecationStatus deprecated,
@@ -64,8 +60,7 @@ private AcceleratorType(
       Integer maximumCardsPerInstance,
       String name,
       String selfLink,
-      String zone
-      ) {
+      String zone) {
     this.creationTimestamp = creationTimestamp;
     this.deprecated = deprecated;
     this.description = description;
@@ -81,7 +76,8 @@ private AcceleratorType(
   public Map> populateFieldsInMap(Set fieldNames) {
     Map> fieldMap = new HashMap<>();
     if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+      fieldMap.put(
+          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
     }
     if (fieldNames.contains("deprecated") && deprecated != null) {
       fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
@@ -96,7 +92,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
     }
     if (fieldNames.contains("maximumCardsPerInstance") && maximumCardsPerInstance != null) {
-      fieldMap.put("maximumCardsPerInstance", Collections.singletonList(String.valueOf(maximumCardsPerInstance)));
+      fieldMap.put(
+          "maximumCardsPerInstance",
+          Collections.singletonList(String.valueOf(maximumCardsPerInstance)));
     }
     if (fieldNames.contains("name") && name != null) {
       fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
@@ -184,22 +182,24 @@ public String getZone() {
     return zone;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(AcceleratorType prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static AcceleratorType getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final AcceleratorType DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new AcceleratorType();
   }
@@ -342,27 +342,18 @@ public Builder setZone(String zone) {
       return this;
     }
 
-
     public AcceleratorType build() {
 
-
-
-
-
-
-
-
       return new AcceleratorType(
-        creationTimestamp,
-        deprecated,
-        description,
-        id,
-        kind,
-        maximumCardsPerInstance,
-        name,
-        selfLink,
-        zone
-      );
+          creationTimestamp,
+          deprecated,
+          description,
+          id,
+          kind,
+          maximumCardsPerInstance,
+          name,
+          selfLink,
+          zone);
     }
 
     public Builder clone() {
@@ -383,15 +374,32 @@ public Builder clone() {
   @Override
   public String toString() {
     return "AcceleratorType{"
-        + "creationTimestamp=" + creationTimestamp + ", "
-        + "deprecated=" + deprecated + ", "
-        + "description=" + description + ", "
-        + "id=" + id + ", "
-        + "kind=" + kind + ", "
-        + "maximumCardsPerInstance=" + maximumCardsPerInstance + ", "
-        + "name=" + name + ", "
-        + "selfLink=" + selfLink + ", "
-        + "zone=" + zone
+        + "creationTimestamp="
+        + creationTimestamp
+        + ", "
+        + "deprecated="
+        + deprecated
+        + ", "
+        + "description="
+        + description
+        + ", "
+        + "id="
+        + id
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "maximumCardsPerInstance="
+        + maximumCardsPerInstance
+        + ", "
+        + "name="
+        + name
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "zone="
+        + zone
         + "}";
   }
 
@@ -402,17 +410,15 @@ public boolean equals(Object o) {
     }
     if (o instanceof AcceleratorType) {
       AcceleratorType that = (AcceleratorType) o;
-      return
-          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
-          Objects.equals(this.deprecated, that.getDeprecated()) &&
-          Objects.equals(this.description, that.getDescription()) &&
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.maximumCardsPerInstance, that.getMaximumCardsPerInstance()) &&
-          Objects.equals(this.name, that.getName()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.zone, that.getZone())
-          ;
+      return Objects.equals(this.creationTimestamp, that.getCreationTimestamp())
+          && Objects.equals(this.deprecated, that.getDeprecated())
+          && Objects.equals(this.description, that.getDescription())
+          && Objects.equals(this.id, that.getId())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.maximumCardsPerInstance, that.getMaximumCardsPerInstance())
+          && Objects.equals(this.name, that.getName())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.zone, that.getZone());
     }
     return false;
   }
@@ -420,15 +426,14 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-      creationTimestamp,
-      deprecated,
-      description,
-      id,
-      kind,
-      maximumCardsPerInstance,
-      name,
-      selfLink,
-      zone
-    );
+        creationTimestamp,
+        deprecated,
+        description,
+        id,
+        kind,
+        maximumCardsPerInstance,
+        name,
+        selfLink,
+        zone);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java
index 36e7b66c77ca..07b2d2dfd939 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -48,15 +45,13 @@ private AcceleratorTypeAggregatedList() {
     this.warning = null;
   }
 
-
   private AcceleratorTypeAggregatedList(
       String id,
       Map items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -142,22 +137,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(AcceleratorTypeAggregatedList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static AcceleratorTypeAggregatedList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final AcceleratorTypeAggregatedList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new AcceleratorTypeAggregatedList();
   }
@@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public AcceleratorTypeAggregatedList build() {
 
-
-
-
-
-      return new AcceleratorTypeAggregatedList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new AcceleratorTypeAggregatedList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -290,12 +275,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "AcceleratorTypeAggregatedList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -306,27 +302,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof AcceleratorTypeAggregatedList) {
       AcceleratorTypeAggregatedList that = (AcceleratorTypeAggregatedList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsMap()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsMap())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java
index 7d9ab432884d..06e1cc88e56e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java
@@ -23,22 +23,12 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
-import com.google.api.gax.paging.FixedSizeCollection;
-import com.google.api.gax.paging.Page;
-import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.AcceleratorTypeStub;
 import com.google.cloud.compute.v1.stub.AcceleratorTypeStubSettings;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import java.io.Closeable;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -58,34 +48,34 @@
  * 
  * 
* - *

Note: close() needs to be called on the acceleratorTypeClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the acceleratorTypeClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of AcceleratorTypeSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class AcceleratorTypeClient implements BackgroundResource {
   private final AcceleratorTypeSettings settings;
   private final AcceleratorTypeStub stub;
 
-
-
-  /**
-   * Constructs an instance of AcceleratorTypeClient with default settings.
-   */
+  /** Constructs an instance of AcceleratorTypeClient with default settings. */
   public static final AcceleratorTypeClient create() throws IOException {
     return create(AcceleratorTypeSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of AcceleratorTypeClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of AcceleratorTypeClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final AcceleratorTypeClient create(AcceleratorTypeSettings settings) throws IOException {
+  public static final AcceleratorTypeClient create(AcceleratorTypeSettings settings)
+      throws IOException {
     return new AcceleratorTypeClient(settings);
   }
 
   /**
-   * Constructs an instance of AcceleratorTypeClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use AcceleratorTypeSettings}.
+   * Constructs an instance of AcceleratorTypeClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use AcceleratorTypeSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final AcceleratorTypeClient create(AcceleratorTypeStub stub) {
@@ -143,9 +129,9 @@ public static final AcceleratorTypeClient create(AcceleratorTypeStub stub) {
   }
 
   /**
-   * Constructs an instance of AcceleratorTypeClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of AcceleratorTypeClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected AcceleratorTypeClient(AcceleratorTypeSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public AcceleratorTypeStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of accelerator types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -186,11 +172,12 @@ public AcceleratorTypeStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(ProjectName project) {
+  public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(
+      ProjectName project) {
     AggregatedListAcceleratorTypesHttpRequest request =
         AggregatedListAcceleratorTypesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListAcceleratorTypes(request);
   }
 
@@ -198,7 +185,8 @@ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAccelerat
   /**
    * Retrieves an aggregated list of accelerator types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -212,11 +200,10 @@ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAccelerat
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(String project) {
+  public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(
+      String project) {
     AggregatedListAcceleratorTypesHttpRequest request =
-        AggregatedListAcceleratorTypesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListAcceleratorTypesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListAcceleratorTypes(request);
   }
 
@@ -224,7 +211,8 @@ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAccelerat
   /**
    * Retrieves an aggregated list of accelerator types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +229,17 @@ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAccelerat
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(AggregatedListAcceleratorTypesHttpRequest request) {
-    return aggregatedListAcceleratorTypesPagedCallable()
-        .call(request);
+  public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(
+      AggregatedListAcceleratorTypesHttpRequest request) {
+    return aggregatedListAcceleratorTypesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of accelerator types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +255,9 @@ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAccelerat
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListAcceleratorTypesPagedCallable() { + public final UnaryCallable< + AggregatedListAcceleratorTypesHttpRequest, AggregatedListAcceleratorTypesPagedResponse> + aggregatedListAcceleratorTypesPagedCallable() { return stub.aggregatedListAcceleratorTypesPagedCallable(); } @@ -274,7 +265,8 @@ public final UnaryCallableSample code: + * *

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,15 +289,19 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListAcceleratorTypesCallable() { + public final UnaryCallable< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList> + aggregatedListAcceleratorTypesCallable() { return stub.aggregatedListAcceleratorTypesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. + * Returns the specified accelerator type. Get a list of available accelerator types by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
@@ -321,16 +317,18 @@ public final AcceleratorType getAcceleratorType(ProjectZoneAcceleratorTypeName a
 
     GetAcceleratorTypeHttpRequest request =
         GetAcceleratorTypeHttpRequest.newBuilder()
-        .setAcceleratorType(acceleratorType == null ? null : acceleratorType.toString())
-        .build();
+            .setAcceleratorType(acceleratorType == null ? null : acceleratorType.toString())
+            .build();
     return getAcceleratorType(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request.
+   * Returns the specified accelerator type. Get a list of available accelerator types by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
@@ -345,17 +343,17 @@ public final AcceleratorType getAcceleratorType(ProjectZoneAcceleratorTypeName a
   public final AcceleratorType getAcceleratorType(String acceleratorType) {
 
     GetAcceleratorTypeHttpRequest request =
-        GetAcceleratorTypeHttpRequest.newBuilder()
-        .setAcceleratorType(acceleratorType)
-        .build();
+        GetAcceleratorTypeHttpRequest.newBuilder().setAcceleratorType(acceleratorType).build();
     return getAcceleratorType(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request.
+   * Returns the specified accelerator type. Get a list of available accelerator types by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
@@ -376,9 +374,11 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified accelerator type. Get a list of available accelerator types by making a list() request.
+   * Returns the specified accelerator type. Get a list of available accelerator types by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
@@ -392,7 +392,8 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable getAcceleratorTypeCallable() { + public final UnaryCallable + getAcceleratorTypeCallable() { return stub.getAcceleratorTypeCallable(); } @@ -400,7 +401,8 @@ public final UnaryCallable getAc /** * Retrieves a list of accelerator types available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -417,8 +419,8 @@ public final UnaryCallable getAc
   public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ProjectZoneName zone) {
     ListAcceleratorTypesHttpRequest request =
         ListAcceleratorTypesHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listAcceleratorTypes(request);
   }
 
@@ -426,7 +428,8 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ProjectZoneN
   /**
    * Retrieves a list of accelerator types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -442,9 +445,7 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ProjectZoneN
   @BetaApi
   public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String zone) {
     ListAcceleratorTypesHttpRequest request =
-        ListAcceleratorTypesHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListAcceleratorTypesHttpRequest.newBuilder().setZone(zone).build();
     return listAcceleratorTypes(request);
   }
 
@@ -452,7 +453,8 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String zone)
   /**
    * Retrieves a list of accelerator types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -469,16 +471,17 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String zone)
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ListAcceleratorTypesHttpRequest request) {
-    return listAcceleratorTypesPagedCallable()
-        .call(request);
+  public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(
+      ListAcceleratorTypesHttpRequest request) {
+    return listAcceleratorTypesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of accelerator types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -494,7 +497,8 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ListAccelera
    * 
*/ @BetaApi - public final UnaryCallable listAcceleratorTypesPagedCallable() { + public final UnaryCallable + listAcceleratorTypesPagedCallable() { return stub.listAcceleratorTypesPagedCallable(); } @@ -502,7 +506,8 @@ public final UnaryCallableSample code: + * *

    * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -525,12 +530,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listAcceleratorTypesCallable() { + public final UnaryCallable + listAcceleratorTypesCallable() { return stub.listAcceleratorTypesCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -559,23 +565,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListAcceleratorTypesPagedResponse extends AbstractPagedListResponse< - AggregatedListAcceleratorTypesHttpRequest, - AcceleratorTypeAggregatedList, - AcceleratorTypesScopedList, - AggregatedListAcceleratorTypesPage, - AggregatedListAcceleratorTypesFixedSizeCollection> { + public static class AggregatedListAcceleratorTypesPagedResponse + extends AbstractPagedListResponse< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList, AggregatedListAcceleratorTypesPage, + AggregatedListAcceleratorTypesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListAcceleratorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListAcceleratorTypesPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListAcceleratorTypesPage, AggregatedListAcceleratorTypesPagedResponse>() { @Override - public AggregatedListAcceleratorTypesPagedResponse apply(AggregatedListAcceleratorTypesPage input) { + public AggregatedListAcceleratorTypesPagedResponse apply( + AggregatedListAcceleratorTypesPage input) { return new AggregatedListAcceleratorTypesPagedResponse(input); } }); @@ -584,18 +595,18 @@ public AggregatedListAcceleratorTypesPagedResponse apply(AggregatedListAccelerat private AggregatedListAcceleratorTypesPagedResponse(AggregatedListAcceleratorTypesPage page) { super(page, AggregatedListAcceleratorTypesFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListAcceleratorTypesPage extends AbstractPage< - AggregatedListAcceleratorTypesHttpRequest, - AcceleratorTypeAggregatedList, - AcceleratorTypesScopedList, - AggregatedListAcceleratorTypesPage> { + public static class AggregatedListAcceleratorTypesPage + extends AbstractPage< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList, AggregatedListAcceleratorTypesPage> { private AggregatedListAcceleratorTypesPage( - PageContext context, + PageContext< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList> + context, AcceleratorTypeAggregatedList response) { super(context, response); } @@ -606,31 +617,33 @@ private static AggregatedListAcceleratorTypesPage createEmptyPage() { @Override protected AggregatedListAcceleratorTypesPage createPage( - PageContext context, + PageContext< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList> + context, AcceleratorTypeAggregatedList response) { return new AggregatedListAcceleratorTypesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListAcceleratorTypesFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListAcceleratorTypesHttpRequest, - AcceleratorTypeAggregatedList, - AcceleratorTypesScopedList, - AggregatedListAcceleratorTypesPage, - AggregatedListAcceleratorTypesFixedSizeCollection> { + public static class AggregatedListAcceleratorTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AcceleratorTypesScopedList, AggregatedListAcceleratorTypesPage, + AggregatedListAcceleratorTypesFixedSizeCollection> { - private AggregatedListAcceleratorTypesFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListAcceleratorTypesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -643,15 +656,12 @@ protected AggregatedListAcceleratorTypesFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListAcceleratorTypesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListAcceleratorTypesPagedResponse extends AbstractPagedListResponse< - ListAcceleratorTypesHttpRequest, - AcceleratorTypeList, - AcceleratorType, - ListAcceleratorTypesPage, - ListAcceleratorTypesFixedSizeCollection> { + + public static class ListAcceleratorTypesPagedResponse + extends AbstractPagedListResponse< + ListAcceleratorTypesHttpRequest, AcceleratorTypeList, AcceleratorType, + ListAcceleratorTypesPage, ListAcceleratorTypesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -671,15 +681,12 @@ public ListAcceleratorTypesPagedResponse apply(ListAcceleratorTypesPage input) { private ListAcceleratorTypesPagedResponse(ListAcceleratorTypesPage page) { super(page, ListAcceleratorTypesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListAcceleratorTypesPage extends AbstractPage< - ListAcceleratorTypesHttpRequest, - AcceleratorTypeList, - AcceleratorType, - ListAcceleratorTypesPage> { + public static class ListAcceleratorTypesPage + extends AbstractPage< + ListAcceleratorTypesHttpRequest, AcceleratorTypeList, AcceleratorType, + ListAcceleratorTypesPage> { private ListAcceleratorTypesPage( PageContext context, @@ -704,20 +711,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListAcceleratorTypesFixedSizeCollection extends AbstractFixedSizeCollection< - ListAcceleratorTypesHttpRequest, - AcceleratorTypeList, - AcceleratorType, - ListAcceleratorTypesPage, - ListAcceleratorTypesFixedSizeCollection> { + public static class ListAcceleratorTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAcceleratorTypesHttpRequest, AcceleratorTypeList, AcceleratorType, + ListAcceleratorTypesPage, ListAcceleratorTypesFixedSizeCollection> { - private ListAcceleratorTypesFixedSizeCollection(List pages, int collectionSize) { + private ListAcceleratorTypesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -730,7 +732,5 @@ protected ListAcceleratorTypesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListAcceleratorTypesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java index 8d191acc8064..d978fdcbf654 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private AcceleratorTypeList() { this.warning = null; } - private AcceleratorTypeList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AcceleratorTypeList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AcceleratorTypeList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AcceleratorTypeList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AcceleratorTypeList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public AcceleratorTypeList build() { - - - - - return new AcceleratorTypeList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new AcceleratorTypeList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "AcceleratorTypeList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof AcceleratorTypeList) { AcceleratorTypeList that = (AcceleratorTypeList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java deleted file mode 100644 index f7f5ae1e5320..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class AcceleratorTypeName implements com.google.api.resourcenames.ResourceName { - private final String acceleratorType; - private final String project; - private final String zone; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private AcceleratorTypeName(Builder builder) { - acceleratorType = Preconditions.checkNotNull(builder.getAcceleratorType()); - project = Preconditions.checkNotNull(builder.getProject()); - zone = Preconditions.checkNotNull(builder.getZone()); - } - - public static AcceleratorTypeName of( - String acceleratorType, - String project, - String zone - ) { - return newBuilder() - .setAcceleratorType(acceleratorType) - .setProject(project) - .setZone(zone) - .build(); - } - - public static String format( - String acceleratorType, - String project, - String zone - ) { - return of( - acceleratorType, - project, - zone - ) - .toString(); - } - - public String getAcceleratorType() { - return acceleratorType; - } - - public String getProject() { - return project; - } - - public String getZone() { - return zone; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("acceleratorType", acceleratorType); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("zone", zone); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public AcceleratorTypeName parse(String formattedString) {return AcceleratorTypeName.parse(formattedString);} - }; - } - - public static AcceleratorTypeName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "AcceleratorTypeName.parse: formattedString not in valid format"); - return of( - matchMap.get("acceleratorType"), - matchMap.get("project"), - matchMap.get("zone") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String acceleratorType; - private String project; - private String zone; - - public String getAcceleratorType() { - return acceleratorType; - } - public String getProject() { - return project; - } - public String getZone() { - return zone; - } - - public Builder setAcceleratorType(String acceleratorType) { - this.acceleratorType = acceleratorType; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - private Builder() {} - - public Builder (AcceleratorTypeName acceleratorTypeName) { - acceleratorType = acceleratorTypeName.acceleratorType; - project = acceleratorTypeName.project; - zone = acceleratorTypeName.zone; - } - - public AcceleratorTypeName build() { - return new AcceleratorTypeName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "acceleratorType", acceleratorType, - "project", project, - "zone", zone - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof AcceleratorTypeName) { - AcceleratorTypeName that = (AcceleratorTypeName) o; - return - Objects.equals(this.acceleratorType, that.getAcceleratorType()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - acceleratorType, - project, - zone - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java index e67d28d549d6..e69d012333a7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; import com.google.cloud.compute.v1.stub.AcceleratorTypeStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getAcceleratorType to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getAcceleratorType to 30 seconds: * *

  * 
@@ -86,70 +64,60 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class AcceleratorTypeSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListAcceleratorTypes.
-   */
-  public PagedCallSettings aggregatedListAcceleratorTypesSettings() {
-    return ((AcceleratorTypeStubSettings) getStubSettings()).aggregatedListAcceleratorTypesSettings();
-  }
-
-  /**
-   * Returns the object with the settings used for calls to getAcceleratorType.
-   */
-  public UnaryCallSettings getAcceleratorTypeSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListAcceleratorTypes. */
+  public PagedCallSettings<
+          AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+          AggregatedListAcceleratorTypesPagedResponse>
+      aggregatedListAcceleratorTypesSettings() {
+    return ((AcceleratorTypeStubSettings) getStubSettings())
+        .aggregatedListAcceleratorTypesSettings();
+  }
+
+  /** Returns the object with the settings used for calls to getAcceleratorType. */
+  public UnaryCallSettings
+      getAcceleratorTypeSettings() {
     return ((AcceleratorTypeStubSettings) getStubSettings()).getAcceleratorTypeSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listAcceleratorTypes.
-   */
-  public PagedCallSettings listAcceleratorTypesSettings() {
+  /** Returns the object with the settings used for calls to listAcceleratorTypes. */
+  public PagedCallSettings<
+          ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse>
+      listAcceleratorTypesSettings() {
     return ((AcceleratorTypeStubSettings) getStubSettings()).listAcceleratorTypesSettings();
   }
 
-
-  public static final AcceleratorTypeSettings create(AcceleratorTypeStubSettings stub) throws IOException {
+  public static final AcceleratorTypeSettings create(AcceleratorTypeStubSettings stub)
+      throws IOException {
     return new AcceleratorTypeSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return AcceleratorTypeStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return AcceleratorTypeStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return AcceleratorTypeStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return AcceleratorTypeStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return AcceleratorTypeStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return AcceleratorTypeStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return AcceleratorTypeStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -162,23 +130,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return AcceleratorTypeStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -187,9 +149,7 @@ protected AcceleratorTypeSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for AcceleratorTypeSettings.
-   */
+  /** Builder for AcceleratorTypeSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -211,39 +171,41 @@ protected Builder(AcceleratorTypeStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public AcceleratorTypeStubSettings.Builder getStubSettingsBuilder() {
       return ((AcceleratorTypeStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListAcceleratorTypes. - */ - public PagedCallSettings.Builder aggregatedListAcceleratorTypesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListAcceleratorTypes. */ + public PagedCallSettings.Builder< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AggregatedListAcceleratorTypesPagedResponse> + aggregatedListAcceleratorTypesSettings() { return getStubSettingsBuilder().aggregatedListAcceleratorTypesSettings(); } - /** - * Returns the builder for the settings used for calls to getAcceleratorType. - */ - public UnaryCallSettings.Builder getAcceleratorTypeSettings() { + /** Returns the builder for the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings.Builder + getAcceleratorTypeSettings() { return getStubSettingsBuilder().getAcceleratorTypeSettings(); } - /** - * Returns the builder for the settings used for calls to listAcceleratorTypes. - */ - public PagedCallSettings.Builder listAcceleratorTypesSettings() { + /** Returns the builder for the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings.Builder< + ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { return getStubSettingsBuilder().listAcceleratorTypesSettings(); } @@ -252,4 +214,4 @@ public AcceleratorTypeSettings build() throws IOException { return new AcceleratorTypeSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java index 1fd769311445..ae1279524908 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private AcceleratorTypesScopedList() { this.warning = null; } - - private AcceleratorTypesScopedList( - List acceleratorTypes, - Warning warning - ) { + private AcceleratorTypesScopedList(List acceleratorTypes, Warning warning) { this.acceleratorTypes = acceleratorTypes; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AcceleratorTypesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AcceleratorTypesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AcceleratorTypesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AcceleratorTypesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public AcceleratorTypesScopedList build() { - return new AcceleratorTypesScopedList( - acceleratorTypes, - warning - ); + return new AcceleratorTypesScopedList(acceleratorTypes, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "AcceleratorTypesScopedList{" - + "acceleratorTypes=" + acceleratorTypes + ", " - + "warning=" + warning + + "acceleratorTypes=" + + acceleratorTypes + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof AcceleratorTypesScopedList) { AcceleratorTypesScopedList that = (AcceleratorTypesScopedList) o; - return - Objects.equals(this.acceleratorTypes, that.getAcceleratorTypesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.acceleratorTypes, that.getAcceleratorTypesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - acceleratorTypes, - warning - ); + return Objects.hash(acceleratorTypes, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java index c97a9a679e20..6f2d287a7072 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private AccessConfig() { this.type = null; } - private AccessConfig( String kind, String name, String natIP, String publicPtrDomainName, Boolean setPublicPtr, - String type - ) { + String type) { this.kind = kind; this.name = name; this.natIP = natIP; @@ -78,7 +73,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("natIP", Collections.singletonList(String.valueOf(natIP))); } if (fieldNames.contains("publicPtrDomainName") && publicPtrDomainName != null) { - fieldMap.put("publicPtrDomainName", Collections.singletonList(String.valueOf(publicPtrDomainName))); + fieldMap.put( + "publicPtrDomainName", Collections.singletonList(String.valueOf(publicPtrDomainName))); } if (fieldNames.contains("setPublicPtr") && setPublicPtr != null) { fieldMap.put("setPublicPtr", Collections.singletonList(String.valueOf(setPublicPtr))); @@ -142,22 +138,24 @@ public String getType() { return type; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AccessConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AccessConfig getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AccessConfig DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AccessConfig(); } @@ -258,21 +256,9 @@ public Builder setType(String type) { return this; } - public AccessConfig build() { - - - - - return new AccessConfig( - kind, - name, - natIP, - publicPtrDomainName, - setPublicPtr, - type - ); + return new AccessConfig(kind, name, natIP, publicPtrDomainName, setPublicPtr, type); } public Builder clone() { @@ -290,12 +276,23 @@ public Builder clone() { @Override public String toString() { return "AccessConfig{" - + "kind=" + kind + ", " - + "name=" + name + ", " - + "natIP=" + natIP + ", " - + "publicPtrDomainName=" + publicPtrDomainName + ", " - + "setPublicPtr=" + setPublicPtr + ", " - + "type=" + type + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "natIP=" + + natIP + + ", " + + "publicPtrDomainName=" + + publicPtrDomainName + + ", " + + "setPublicPtr=" + + setPublicPtr + + ", " + + "type=" + + type + "}"; } @@ -306,27 +303,18 @@ public boolean equals(Object o) { } if (o instanceof AccessConfig) { AccessConfig that = (AccessConfig) o; - return - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.natIP, that.getNatIP()) && - Objects.equals(this.publicPtrDomainName, that.getPublicPtrDomainName()) && - Objects.equals(this.setPublicPtr, that.getSetPublicPtr()) && - Objects.equals(this.type, that.getType()) - ; + return Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.natIP, that.getNatIP()) + && Objects.equals(this.publicPtrDomainName, that.getPublicPtrDomainName()) + && Objects.equals(this.setPublicPtr, that.getSetPublicPtr()) + && Objects.equals(this.type, that.getType()); } return false; } @Override public int hashCode() { - return Objects.hash( - kind, - name, - natIP, - publicPtrDomainName, - setPublicPtr, - type - ); + return Objects.hash(kind, name, natIP, publicPtrDomainName, setPublicPtr, type); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java index 6b91d932bcff..62f3e600b067 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private AddAccessConfigInstanceHttpRequest() { this.userIp = null; } - private AddAccessConfigInstanceHttpRequest( AccessConfig accessConfigResource, String access_token, @@ -70,8 +66,7 @@ private AddAccessConfigInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.accessConfigResource = accessConfigResource; this.access_token = access_token; this.callback = callback; @@ -89,7 +84,8 @@ private AddAccessConfigInstanceHttpRequest( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { - fieldMap.put("accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); + fieldMap.put( + "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); } if (fieldNames.contains("access_token") && access_token != null) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); @@ -212,22 +208,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddAccessConfigInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddAccessConfigInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddAccessConfigInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddAccessConfigInstanceHttpRequest(); } @@ -398,13 +396,9 @@ public Builder setUserIp(String userIp) { return this; } - public AddAccessConfigInstanceHttpRequest build() { String missing = ""; - - - if (instance == null) { missing += " instance"; } @@ -413,25 +407,21 @@ public AddAccessConfigInstanceHttpRequest build() { missing += " networkInterface"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AddAccessConfigInstanceHttpRequest( - accessConfigResource, - access_token, - callback, - fields, - instance, - key, - networkInterface, - prettyPrint, - quotaUser, - requestId, - userIp - ); + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -454,17 +444,38 @@ public Builder clone() { @Override public String toString() { return "AddAccessConfigInstanceHttpRequest{" - + "accessConfigResource=" + accessConfigResource + ", " - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "networkInterface=" + networkInterface + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "accessConfigResource=" + + accessConfigResource + + ", " + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "networkInterface=" + + networkInterface + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -475,19 +486,17 @@ public boolean equals(Object o) { } if (o instanceof AddAccessConfigInstanceHttpRequest) { AddAccessConfigInstanceHttpRequest that = (AddAccessConfigInstanceHttpRequest) o; - return - Objects.equals(this.accessConfigResource, that.getAccessConfigResource()) && - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.networkInterface, that.getNetworkInterface()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.accessConfigResource, that.getAccessConfigResource()) + && Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.networkInterface, that.getNetworkInterface()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -495,17 +504,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - accessConfigResource, - access_token, - callback, - fields, - instance, - key, - networkInterface, - prettyPrint, - quotaUser, - requestId, - userIp - ); + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java index ff6380a03acf..b1faf9156468 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private AddHealthCheckTargetPoolHttpRequest() { this.userIp = null; } - private AddHealthCheckTargetPoolHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private AddHealthCheckTargetPoolHttpRequest( String requestId, String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -108,8 +103,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } - if (fieldNames.contains("targetPoolsAddHealthCheckRequestResource") && targetPoolsAddHealthCheckRequestResource != null) { - fieldMap.put("targetPoolsAddHealthCheckRequestResource", Collections.singletonList(String.valueOf(targetPoolsAddHealthCheckRequestResource))); + if (fieldNames.contains("targetPoolsAddHealthCheckRequestResource") + && targetPoolsAddHealthCheckRequestResource != null) { + fieldMap.put( + "targetPoolsAddHealthCheckRequestResource", + Collections.singletonList(String.valueOf(targetPoolsAddHealthCheckRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddHealthCheckTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddHealthCheckTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddHealthCheckTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddHealthCheckTargetPoolHttpRequest(); } @@ -259,7 +259,8 @@ public Builder mergeFrom(AddHealthCheckTargetPoolHttpRequest other) { this.targetPool = other.targetPool; } if (other.getTargetPoolsAddHealthCheckRequestResource() != null) { - this.targetPoolsAddHealthCheckRequestResource = other.targetPoolsAddHealthCheckRequestResource; + this.targetPoolsAddHealthCheckRequestResource = + other.targetPoolsAddHealthCheckRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -276,7 +277,8 @@ public Builder mergeFrom(AddHealthCheckTargetPoolHttpRequest other) { this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.targetPool = source.targetPool; - this.targetPoolsAddHealthCheckRequestResource = source.targetPoolsAddHealthCheckRequestResource; + this.targetPoolsAddHealthCheckRequestResource = + source.targetPoolsAddHealthCheckRequestResource; this.userIp = source.userIp; } @@ -356,7 +358,8 @@ public TargetPoolsAddHealthCheckRequest getTargetPoolsAddHealthCheckRequestResou return targetPoolsAddHealthCheckRequestResource; } - public Builder setTargetPoolsAddHealthCheckRequestResource(TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + public Builder setTargetPoolsAddHealthCheckRequestResource( + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { this.targetPoolsAddHealthCheckRequestResource = targetPoolsAddHealthCheckRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public AddHealthCheckTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AddHealthCheckTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsAddHealthCheckRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsAddHealthCheckRequestResource, + userIp); } public Builder clone() { @@ -412,7 +406,8 @@ public Builder clone() { newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); - newBuilder.setTargetPoolsAddHealthCheckRequestResource(this.targetPoolsAddHealthCheckRequestResource); + newBuilder.setTargetPoolsAddHealthCheckRequestResource( + this.targetPoolsAddHealthCheckRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "AddHealthCheckTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetPool=" + targetPool + ", " - + "targetPoolsAddHealthCheckRequestResource=" + targetPoolsAddHealthCheckRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetPool=" + + targetPool + + ", " + + "targetPoolsAddHealthCheckRequestResource=" + + targetPoolsAddHealthCheckRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof AddHealthCheckTargetPoolHttpRequest) { AddHealthCheckTargetPoolHttpRequest that = (AddHealthCheckTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.targetPoolsAddHealthCheckRequestResource, that.getTargetPoolsAddHealthCheckRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals( + this.targetPoolsAddHealthCheckRequestResource, + that.getTargetPoolsAddHealthCheckRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsAddHealthCheckRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsAddHealthCheckRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java index e5b1b09ea0e4..7a944fcdd6b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private AddInstanceTargetPoolHttpRequest() { this.userIp = null; } - private AddInstanceTargetPoolHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private AddInstanceTargetPoolHttpRequest( String requestId, String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -108,8 +103,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } - if (fieldNames.contains("targetPoolsAddInstanceRequestResource") && targetPoolsAddInstanceRequestResource != null) { - fieldMap.put("targetPoolsAddInstanceRequestResource", Collections.singletonList(String.valueOf(targetPoolsAddInstanceRequestResource))); + if (fieldNames.contains("targetPoolsAddInstanceRequestResource") + && targetPoolsAddInstanceRequestResource != null) { + fieldMap.put( + "targetPoolsAddInstanceRequestResource", + Collections.singletonList(String.valueOf(targetPoolsAddInstanceRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddInstanceTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddInstanceTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddInstanceTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddInstanceTargetPoolHttpRequest(); } @@ -356,7 +356,8 @@ public TargetPoolsAddInstanceRequest getTargetPoolsAddInstanceRequestResource() return targetPoolsAddInstanceRequestResource; } - public Builder setTargetPoolsAddInstanceRequestResource(TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + public Builder setTargetPoolsAddInstanceRequestResource( + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { this.targetPoolsAddInstanceRequestResource = targetPoolsAddInstanceRequestResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public AddInstanceTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AddInstanceTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsAddInstanceRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsAddInstanceRequestResource, + userIp); } public Builder clone() { @@ -412,7 +404,8 @@ public Builder clone() { newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); - newBuilder.setTargetPoolsAddInstanceRequestResource(this.targetPoolsAddInstanceRequestResource); + newBuilder.setTargetPoolsAddInstanceRequestResource( + this.targetPoolsAddInstanceRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -421,16 +414,35 @@ public Builder clone() { @Override public String toString() { return "AddInstanceTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetPool=" + targetPool + ", " - + "targetPoolsAddInstanceRequestResource=" + targetPoolsAddInstanceRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetPool=" + + targetPool + + ", " + + "targetPoolsAddInstanceRequestResource=" + + targetPoolsAddInstanceRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +453,18 @@ public boolean equals(Object o) { } if (o instanceof AddInstanceTargetPoolHttpRequest) { AddInstanceTargetPoolHttpRequest that = (AddInstanceTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.targetPoolsAddInstanceRequestResource, that.getTargetPoolsAddInstanceRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals( + this.targetPoolsAddInstanceRequestResource, + that.getTargetPoolsAddInstanceRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +472,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsAddInstanceRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsAddInstanceRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java index 8d5c47bced1a..2585c5368b99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private AddInstancesInstanceGroupHttpRequest() { this.userIp = null; } - private AddInstancesInstanceGroupHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private AddInstancesInstanceGroupHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instanceGroup") && instanceGroup != null) { fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); } - if (fieldNames.contains("instanceGroupsAddInstancesRequestResource") && instanceGroupsAddInstancesRequestResource != null) { - fieldMap.put("instanceGroupsAddInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsAddInstancesRequestResource))); + if (fieldNames.contains("instanceGroupsAddInstancesRequestResource") + && instanceGroupsAddInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsAddInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsAddInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddInstancesInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddInstancesInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddInstancesInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddInstancesInstanceGroupHttpRequest(); } @@ -247,7 +247,8 @@ public Builder mergeFrom(AddInstancesInstanceGroupHttpRequest other) { this.instanceGroup = other.instanceGroup; } if (other.getInstanceGroupsAddInstancesRequestResource() != null) { - this.instanceGroupsAddInstancesRequestResource = other.instanceGroupsAddInstancesRequestResource; + this.instanceGroupsAddInstancesRequestResource = + other.instanceGroupsAddInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +273,8 @@ public Builder mergeFrom(AddInstancesInstanceGroupHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instanceGroup = source.instanceGroup; - this.instanceGroupsAddInstancesRequestResource = source.instanceGroupsAddInstancesRequestResource; + this.instanceGroupsAddInstancesRequestResource = + source.instanceGroupsAddInstancesRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -320,7 +322,8 @@ public InstanceGroupsAddInstancesRequest getInstanceGroupsAddInstancesRequestRes return instanceGroupsAddInstancesRequestResource; } - public Builder setInstanceGroupsAddInstancesRequestResource(InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + public Builder setInstanceGroupsAddInstancesRequestResource( + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { this.instanceGroupsAddInstancesRequestResource = instanceGroupsAddInstancesRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public AddInstancesInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AddInstancesInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - instanceGroupsAddInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + instanceGroupsAddInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +402,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroup(this.instanceGroup); - newBuilder.setInstanceGroupsAddInstancesRequestResource(this.instanceGroupsAddInstancesRequestResource); + newBuilder.setInstanceGroupsAddInstancesRequestResource( + this.instanceGroupsAddInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "AddInstancesInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "instanceGroupsAddInstancesRequestResource=" + instanceGroupsAddInstancesRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "instanceGroupsAddInstancesRequestResource=" + + instanceGroupsAddInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof AddInstancesInstanceGroupHttpRequest) { AddInstancesInstanceGroupHttpRequest that = (AddInstancesInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.instanceGroupsAddInstancesRequestResource, that.getInstanceGroupsAddInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals( + this.instanceGroupsAddInstancesRequestResource, + that.getInstanceGroupsAddInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - instanceGroupsAddInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + instanceGroupsAddInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java index b0a2a6e73b74..01f04c528b36 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private AddPeeringNetworkHttpRequest() { this.userIp = null; } - private AddPeeringNetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private AddPeeringNetworkHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -99,8 +94,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("network") && network != null) { fieldMap.put("network", Collections.singletonList(String.valueOf(network))); } - if (fieldNames.contains("networksAddPeeringRequestResource") && networksAddPeeringRequestResource != null) { - fieldMap.put("networksAddPeeringRequestResource", Collections.singletonList(String.valueOf(networksAddPeeringRequestResource))); + if (fieldNames.contains("networksAddPeeringRequestResource") + && networksAddPeeringRequestResource != null) { + fieldMap.put( + "networksAddPeeringRequestResource", + Collections.singletonList(String.valueOf(networksAddPeeringRequestResource))); } if (fieldNames.contains("prettyPrint") && prettyPrint != null) { fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddPeeringNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddPeeringNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddPeeringNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddPeeringNetworkHttpRequest(); } @@ -329,7 +329,8 @@ public NetworksAddPeeringRequest getNetworksAddPeeringRequestResource() { return networksAddPeeringRequestResource; } - public Builder setNetworksAddPeeringRequestResource(NetworksAddPeeringRequest networksAddPeeringRequestResource) { + public Builder setNetworksAddPeeringRequestResource( + NetworksAddPeeringRequest networksAddPeeringRequestResource) { this.networksAddPeeringRequestResource = networksAddPeeringRequestResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public AddPeeringNetworkHttpRequest build() { String missing = ""; - - - if (network == null) { missing += " network"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AddPeeringNetworkHttpRequest( - access_token, - callback, - fields, - key, - network, - networksAddPeeringRequestResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + network, + networksAddPeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "AddPeeringNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "network=" + network + ", " - + "networksAddPeeringRequestResource=" + networksAddPeeringRequestResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "network=" + + network + + ", " + + "networksAddPeeringRequestResource=" + + networksAddPeeringRequestResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +452,17 @@ public boolean equals(Object o) { } if (o instanceof AddPeeringNetworkHttpRequest) { AddPeeringNetworkHttpRequest that = (AddPeeringNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.networksAddPeeringRequestResource, that.getNetworksAddPeeringRequestResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals( + this.networksAddPeeringRequestResource, that.getNetworksAddPeeringRequestResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +470,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - network, - networksAddPeeringRequestResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + network, + networksAddPeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java index 0d8a567e31d8..bf5fb8f70e1c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -62,7 +61,6 @@ private Address() { this.users = null; } - private Address( String address, String addressType, @@ -76,8 +74,7 @@ private Address( String selfLink, String status, String subnetwork, - List users - ) { + List users) { this.address = address; this.addressType = addressType; this.creationTimestamp = creationTimestamp; @@ -103,7 +100,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("addressType", Collections.singletonList(String.valueOf(addressType))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -244,22 +242,24 @@ public List getUsersList() { return users; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Address prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Address getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Address DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Address(); } @@ -466,35 +466,22 @@ public Builder addUsers(String users) { return this; } - public Address build() { - - - - - - - - - - - return new Address( - address, - addressType, - creationTimestamp, - description, - id, - ipVersion, - kind, - name, - region, - selfLink, - status, - subnetwork, - users - ); + address, + addressType, + creationTimestamp, + description, + id, + ipVersion, + kind, + name, + region, + selfLink, + status, + subnetwork, + users); } public Builder clone() { @@ -519,19 +506,44 @@ public Builder clone() { @Override public String toString() { return "Address{" - + "address=" + address + ", " - + "addressType=" + addressType + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "ipVersion=" + ipVersion + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "status=" + status + ", " - + "subnetwork=" + subnetwork + ", " - + "users=" + users + + "address=" + + address + + ", " + + "addressType=" + + addressType + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "ipVersion=" + + ipVersion + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "status=" + + status + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "users=" + + users + "}"; } @@ -542,21 +554,19 @@ public boolean equals(Object o) { } if (o instanceof Address) { Address that = (Address) o; - return - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.addressType, that.getAddressType()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.ipVersion, that.getIpVersion()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.users, that.getUsersList()) - ; + return Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.addressType, that.getAddressType()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.ipVersion, that.getIpVersion()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.users, that.getUsersList()); } return false; } @@ -564,19 +574,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - address, - addressType, - creationTimestamp, - description, - id, - ipVersion, - kind, - name, - region, - selfLink, - status, - subnetwork, - users - ); + address, + addressType, + creationTimestamp, + description, + id, + ipVersion, + kind, + name, + region, + selfLink, + status, + subnetwork, + users); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java index 8a9d5f2d2e5f..089c2a50cbab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private AddressAggregatedList() { this.warning = null; } - private AddressAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddressAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddressAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddressAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddressAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public AddressAggregatedList build() { - - - - - return new AddressAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new AddressAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "AddressAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof AddressAggregatedList) { AddressAggregatedList that = (AddressAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java index 0652a682cd77..804540bf73d6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.AddressStub; import com.google.cloud.compute.v1.stub.AddressStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,33 @@ * *

* - *

Note: close() needs to be called on the addressClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the addressClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of AddressSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of AddressSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class AddressClient implements BackgroundResource {
   private final AddressSettings settings;
   private final AddressStub stub;
 
-
-
-  /**
-   * Constructs an instance of AddressClient with default settings.
-   */
+  /** Constructs an instance of AddressClient with default settings. */
   public static final AddressClient create() throws IOException {
     return create(AddressSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of AddressClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of AddressClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final AddressClient create(AddressSettings settings) throws IOException {
     return new AddressClient(settings);
@@ -144,9 +128,8 @@ public static final AddressClient create(AddressStub stub) {
   }
 
   /**
-   * Constructs an instance of AddressClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of AddressClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected AddressClient(AddressSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +151,12 @@ public AddressStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -190,8 +173,8 @@ public AddressStub getStub() {
   public final AggregatedListAddressesPagedResponse aggregatedListAddresses(ProjectName project) {
     AggregatedListAddressesHttpRequest request =
         AggregatedListAddressesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListAddresses(request);
   }
 
@@ -199,7 +182,8 @@ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(Projec
   /**
    * Retrieves an aggregated list of addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -215,9 +199,7 @@ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(Projec
   @BetaApi
   public final AggregatedListAddressesPagedResponse aggregatedListAddresses(String project) {
     AggregatedListAddressesHttpRequest request =
-        AggregatedListAddressesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListAddressesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListAddresses(request);
   }
 
@@ -225,7 +207,8 @@ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(String
   /**
    * Retrieves an aggregated list of addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +225,17 @@ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListAddressesPagedResponse aggregatedListAddresses(AggregatedListAddressesHttpRequest request) {
-    return aggregatedListAddressesPagedCallable()
-        .call(request);
+  public final AggregatedListAddressesPagedResponse aggregatedListAddresses(
+      AggregatedListAddressesHttpRequest request) {
+    return aggregatedListAddressesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +251,9 @@ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(Aggreg
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListAddressesPagedCallable() { + public final UnaryCallable< + AggregatedListAddressesHttpRequest, AggregatedListAddressesPagedResponse> + aggregatedListAddressesPagedCallable() { return stub.aggregatedListAddressesPagedCallable(); } @@ -275,7 +261,8 @@ public final UnaryCallableSample code: + * *

    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +285,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListAddressesCallable() { + public final UnaryCallable + aggregatedListAddressesCallable() { return stub.aggregatedListAddressesCallable(); } @@ -306,7 +294,8 @@ public final UnaryCallableSample code: + * *

    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -316,11 +305,15 @@ public final UnaryCallable
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -328,9 +321,9 @@ public final Operation deleteAddress(ProjectRegionAddressName address, String re DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder() - .setAddress(address == null ? null : address.toString()) - .setRequestId(requestId) - .build(); + .setAddress(address == null ? null : address.toString()) + .setRequestId(requestId) + .build(); return deleteAddress(request); } @@ -338,7 +331,8 @@ public final Operation deleteAddress(ProjectRegionAddressName address, String re /** * Deletes the specified address resource. * - * Sample code: + *

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -348,21 +342,22 @@ public final Operation deleteAddress(ProjectRegionAddressName address, String re
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteAddress(String address, String requestId) { DeleteAddressHttpRequest request = - DeleteAddressHttpRequest.newBuilder() - .setAddress(address) - .setRequestId(requestId) - .build(); + DeleteAddressHttpRequest.newBuilder().setAddress(address).setRequestId(requestId).build(); return deleteAddress(request); } @@ -370,7 +365,8 @@ public final Operation deleteAddress(String address, String requestId) { /** * Deletes the specified address resource. * - * Sample code: + *

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -395,7 +391,8 @@ public final Operation deleteAddress(DeleteAddressHttpRequest request) {
   /**
    * Deletes the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -419,7 +416,8 @@ public final UnaryCallable deleteAddressCal
   /**
    * Returns the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -435,8 +433,8 @@ public final Address getAddress(ProjectRegionAddressName address) {
 
     GetAddressHttpRequest request =
         GetAddressHttpRequest.newBuilder()
-        .setAddress(address == null ? null : address.toString())
-        .build();
+            .setAddress(address == null ? null : address.toString())
+            .build();
     return getAddress(request);
   }
 
@@ -444,7 +442,8 @@ public final Address getAddress(ProjectRegionAddressName address) {
   /**
    * Returns the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -458,10 +457,7 @@ public final Address getAddress(ProjectRegionAddressName address) {
   @BetaApi
   public final Address getAddress(String address) {
 
-    GetAddressHttpRequest request =
-        GetAddressHttpRequest.newBuilder()
-        .setAddress(address)
-        .build();
+    GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder().setAddress(address).build();
     return getAddress(request);
   }
 
@@ -469,7 +465,8 @@ public final Address getAddress(String address) {
   /**
    * Returns the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -492,7 +489,8 @@ public final Address getAddress(GetAddressHttpRequest request) {
   /**
    * Returns the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
@@ -514,7 +512,8 @@ public final UnaryCallable getAddressCallable()
   /**
    * Creates an address resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
@@ -524,24 +523,31 @@ public final UnaryCallable getAddressCallable()
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for + * v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAddress(String requestId, ProjectRegionName region, Address addressResource) { + public final Operation insertAddress( + String requestId, ProjectRegionName region, Address addressResource) { InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setAddressResource(addressResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAddressResource(addressResource) + .build(); return insertAddress(request); } @@ -549,7 +555,8 @@ public final Operation insertAddress(String requestId, ProjectRegionName region, /** * Creates an address resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
@@ -559,13 +566,19 @@ public final Operation insertAddress(String requestId, ProjectRegionName region,
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for + * v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -573,10 +586,10 @@ public final Operation insertAddress(String requestId, String region, Address ad InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setAddressResource(addressResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setAddressResource(addressResource) + .build(); return insertAddress(request); } @@ -584,7 +597,8 @@ public final Operation insertAddress(String requestId, String region, Address ad /** * Creates an address resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
@@ -611,7 +625,8 @@ public final Operation insertAddress(InsertAddressHttpRequest request) {
   /**
    * Creates an address resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   String requestId = "";
@@ -637,7 +652,8 @@ public final UnaryCallable insertAddressCal
   /**
    * Retrieves a list of addresses contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -654,8 +670,8 @@ public final UnaryCallable insertAddressCal
   public final ListAddressesPagedResponse listAddresses(ProjectRegionName region) {
     ListAddressesHttpRequest request =
         ListAddressesHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listAddresses(request);
   }
 
@@ -663,7 +679,8 @@ public final ListAddressesPagedResponse listAddresses(ProjectRegionName region)
   /**
    * Retrieves a list of addresses contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -679,9 +696,7 @@ public final ListAddressesPagedResponse listAddresses(ProjectRegionName region)
   @BetaApi
   public final ListAddressesPagedResponse listAddresses(String region) {
     ListAddressesHttpRequest request =
-        ListAddressesHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListAddressesHttpRequest.newBuilder().setRegion(region).build();
     return listAddresses(request);
   }
 
@@ -689,7 +704,8 @@ public final ListAddressesPagedResponse listAddresses(String region) {
   /**
    * Retrieves a list of addresses contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -707,15 +723,15 @@ public final ListAddressesPagedResponse listAddresses(String region) {
    */
   @BetaApi
   public final ListAddressesPagedResponse listAddresses(ListAddressesHttpRequest request) {
-    return listAddressesPagedCallable()
-        .call(request);
+    return listAddressesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of addresses contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -731,7 +747,8 @@ public final ListAddressesPagedResponse listAddresses(ListAddressesHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable listAddressesPagedCallable() { + public final UnaryCallable + listAddressesPagedCallable() { return stub.listAddressesPagedCallable(); } @@ -739,7 +756,8 @@ public final UnaryCallable /** * Retrieves a list of addresses contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -767,7 +785,7 @@ public final UnaryCallable listAddressesC
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -796,15 +814,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListAddressesPagedResponse extends AbstractPagedListResponse<
-      AggregatedListAddressesHttpRequest,
-      AddressAggregatedList,
-      AddressesScopedList,
-      AggregatedListAddressesPage,
-      AggregatedListAddressesFixedSizeCollection> {
+  public static class AggregatedListAddressesPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListAddressesHttpRequest, AddressAggregatedList, AddressesScopedList,
+          AggregatedListAddressesPage, AggregatedListAddressesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
-        PageContext context,
+        PageContext
+            context,
         ApiFuture futureResponse) {
       ApiFuture futurePage =
           AggregatedListAddressesPage.createEmptyPage().createPageAsync(context, futureResponse);
@@ -821,18 +838,16 @@ public AggregatedListAddressesPagedResponse apply(AggregatedListAddressesPage in
     private AggregatedListAddressesPagedResponse(AggregatedListAddressesPage page) {
       super(page, AggregatedListAddressesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListAddressesPage extends AbstractPage<
-      AggregatedListAddressesHttpRequest,
-      AddressAggregatedList,
-      AddressesScopedList,
-      AggregatedListAddressesPage> {
+  public static class AggregatedListAddressesPage
+      extends AbstractPage<
+          AggregatedListAddressesHttpRequest, AddressAggregatedList, AddressesScopedList,
+          AggregatedListAddressesPage> {
 
     private AggregatedListAddressesPage(
-        PageContext context,
+        PageContext
+            context,
         AddressAggregatedList response) {
       super(context, response);
     }
@@ -843,31 +858,28 @@ private static AggregatedListAddressesPage createEmptyPage() {
 
     @Override
     protected AggregatedListAddressesPage createPage(
-        PageContext context,
+        PageContext
+            context,
         AddressAggregatedList response) {
       return new AggregatedListAddressesPage(context, response);
     }
 
     @Override
     public ApiFuture createPageAsync(
-        PageContext context,
+        PageContext
+            context,
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListAddressesFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListAddressesHttpRequest,
-      AddressAggregatedList,
-      AddressesScopedList,
-      AggregatedListAddressesPage,
-      AggregatedListAddressesFixedSizeCollection> {
+  public static class AggregatedListAddressesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListAddressesHttpRequest, AddressAggregatedList, AddressesScopedList,
+          AggregatedListAddressesPage, AggregatedListAddressesFixedSizeCollection> {
 
-    private AggregatedListAddressesFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListAddressesFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -880,15 +892,12 @@ protected AggregatedListAddressesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListAddressesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListAddressesPagedResponse extends AbstractPagedListResponse<
-      ListAddressesHttpRequest,
-      AddressList,
-      Address,
-      ListAddressesPage,
-      ListAddressesFixedSizeCollection> {
+
+  public static class ListAddressesPagedResponse
+      extends AbstractPagedListResponse<
+          ListAddressesHttpRequest, AddressList, Address, ListAddressesPage,
+          ListAddressesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -908,19 +917,13 @@ public ListAddressesPagedResponse apply(ListAddressesPage input) {
     private ListAddressesPagedResponse(ListAddressesPage page) {
       super(page, ListAddressesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListAddressesPage extends AbstractPage<
-      ListAddressesHttpRequest,
-      AddressList,
-      Address,
-      ListAddressesPage> {
+  public static class ListAddressesPage
+      extends AbstractPage {
 
     private ListAddressesPage(
-        PageContext context,
-        AddressList response) {
+        PageContext context, AddressList response) {
       super(context, response);
     }
 
@@ -930,8 +933,7 @@ private static ListAddressesPage createEmptyPage() {
 
     @Override
     protected ListAddressesPage createPage(
-        PageContext context,
-        AddressList response) {
+        PageContext context, AddressList response) {
       return new ListAddressesPage(context, response);
     }
 
@@ -941,18 +943,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListAddressesFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListAddressesHttpRequest,
-      AddressList,
-      Address,
-      ListAddressesPage,
-      ListAddressesFixedSizeCollection> {
+  public static class ListAddressesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListAddressesHttpRequest, AddressList, Address, ListAddressesPage,
+          ListAddressesFixedSizeCollection> {
 
     private ListAddressesFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -967,7 +963,5 @@ protected ListAddressesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListAddressesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
index e48fb1a16d62..936e44245a21 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private AddressList() {
     this.warning = null;
   }
 
-
   private AddressList(
       String id,
       List
items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddressList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddressList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddressList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddressList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public AddressList build() { - - - - - return new AddressList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new AddressList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "AddressList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof AddressList) { AddressList that = (AddressList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java deleted file mode 100644 index da59ddada873..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class AddressName implements com.google.api.resourcenames.ResourceName { - private final String address; - private final String project; - private final String region; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/addresses/{address}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private AddressName(Builder builder) { - address = Preconditions.checkNotNull(builder.getAddress()); - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - } - - public static AddressName of( - String address, - String project, - String region - ) { - return newBuilder() - .setAddress(address) - .setProject(project) - .setRegion(region) - .build(); - } - - public static String format( - String address, - String project, - String region - ) { - return of( - address, - project, - region - ) - .toString(); - } - - public String getAddress() { - return address; - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("address", address); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public AddressName parse(String formattedString) {return AddressName.parse(formattedString);} - }; - } - - public static AddressName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "AddressName.parse: formattedString not in valid format"); - return of( - matchMap.get("address"), - matchMap.get("project"), - matchMap.get("region") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String address; - private String project; - private String region; - - public String getAddress() { - return address; - } - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - - public Builder setAddress(String address) { - this.address = address; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - - private Builder() {} - - public Builder (AddressName addressName) { - address = addressName.address; - project = addressName.project; - region = addressName.region; - } - - public AddressName build() { - return new AddressName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "address", address, - "project", project, - "region", region - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof AddressName) { - AddressName that = (AddressName) o; - return - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - address, - project, - region - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java index ab370194f470..c9725c831762 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; -import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; import com.google.cloud.compute.v1.stub.AddressStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteAddress to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteAddress to 30 seconds: * *

  * 
@@ -86,84 +64,66 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class AddressSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListAddresses.
-   */
-  public PagedCallSettings aggregatedListAddressesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListAddresses. */
+  public PagedCallSettings<
+          AggregatedListAddressesHttpRequest, AddressAggregatedList,
+          AggregatedListAddressesPagedResponse>
+      aggregatedListAddressesSettings() {
     return ((AddressStubSettings) getStubSettings()).aggregatedListAddressesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteAddress.
-   */
+  /** Returns the object with the settings used for calls to deleteAddress. */
   public UnaryCallSettings deleteAddressSettings() {
     return ((AddressStubSettings) getStubSettings()).deleteAddressSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getAddress.
-   */
+  /** Returns the object with the settings used for calls to getAddress. */
   public UnaryCallSettings getAddressSettings() {
     return ((AddressStubSettings) getStubSettings()).getAddressSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertAddress.
-   */
+  /** Returns the object with the settings used for calls to insertAddress. */
   public UnaryCallSettings insertAddressSettings() {
     return ((AddressStubSettings) getStubSettings()).insertAddressSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listAddresses.
-   */
-  public PagedCallSettings listAddressesSettings() {
+  /** Returns the object with the settings used for calls to listAddresses. */
+  public PagedCallSettings
+      listAddressesSettings() {
     return ((AddressStubSettings) getStubSettings()).listAddressesSettings();
   }
 
-
   public static final AddressSettings create(AddressStubSettings stub) throws IOException {
     return new AddressSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return AddressStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return AddressStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return AddressStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return AddressStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return AddressStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return AddressStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return AddressStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -176,23 +136,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return AddressStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -201,9 +155,7 @@ protected AddressSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for AddressSettings.
-   */
+  /** Builder for AddressSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -225,53 +177,50 @@ protected Builder(AddressStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public AddressStubSettings.Builder getStubSettingsBuilder() {
       return ((AddressStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListAddresses. - */ - public PagedCallSettings.Builder aggregatedListAddressesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListAddresses. */ + public PagedCallSettings.Builder< + AggregatedListAddressesHttpRequest, AddressAggregatedList, + AggregatedListAddressesPagedResponse> + aggregatedListAddressesSettings() { return getStubSettingsBuilder().aggregatedListAddressesSettings(); } - /** - * Returns the builder for the settings used for calls to deleteAddress. - */ + /** Returns the builder for the settings used for calls to deleteAddress. */ public UnaryCallSettings.Builder deleteAddressSettings() { return getStubSettingsBuilder().deleteAddressSettings(); } - /** - * Returns the builder for the settings used for calls to getAddress. - */ + /** Returns the builder for the settings used for calls to getAddress. */ public UnaryCallSettings.Builder getAddressSettings() { return getStubSettingsBuilder().getAddressSettings(); } - /** - * Returns the builder for the settings used for calls to insertAddress. - */ + /** Returns the builder for the settings used for calls to insertAddress. */ public UnaryCallSettings.Builder insertAddressSettings() { return getStubSettingsBuilder().insertAddressSettings(); } - /** - * Returns the builder for the settings used for calls to listAddresses. - */ - public PagedCallSettings.Builder listAddressesSettings() { + /** Returns the builder for the settings used for calls to listAddresses. */ + public PagedCallSettings.Builder< + ListAddressesHttpRequest, AddressList, ListAddressesPagedResponse> + listAddressesSettings() { return getStubSettingsBuilder().listAddressesSettings(); } @@ -280,4 +229,4 @@ public AddressSettings build() throws IOException { return new AddressSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java index 4f5641437f4c..e98751340740 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private AddressesScopedList() { this.warning = null; } - - private AddressesScopedList( - List

addresses, - Warning warning - ) { + private AddressesScopedList(List
addresses, Warning warning) { this.addresses = addresses; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AddressesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AddressesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AddressesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AddressesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public AddressesScopedList build() { - return new AddressesScopedList( - addresses, - warning - ); + return new AddressesScopedList(addresses, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "AddressesScopedList{" - + "addresses=" + addresses + ", " - + "warning=" + warning - + "}"; + return "AddressesScopedList{" + "addresses=" + addresses + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof AddressesScopedList) { AddressesScopedList that = (AddressesScopedList) o; - return - Objects.equals(this.addresses, that.getAddressesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.addresses, that.getAddressesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - addresses, - warning - ); + return Objects.hash(addresses, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java index 326d0ae1242e..12b9d6c85154 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListAcceleratorTypesHttpRequest() { this.userIp = null; } - private AggregatedListAcceleratorTypesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListAcceleratorTypesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListAcceleratorTypesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListAcceleratorTypesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListAcceleratorTypesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListAcceleratorTypesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListAcceleratorTypesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListAcceleratorTypesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListAcceleratorTypesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListAcceleratorTypesHttpRequest) { - AggregatedListAcceleratorTypesHttpRequest that = (AggregatedListAcceleratorTypesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListAcceleratorTypesHttpRequest that = + (AggregatedListAcceleratorTypesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java index cf0ddb59ac99..83487619deab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListAddressesHttpRequest() { this.userIp = null; } - private AggregatedListAddressesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListAddressesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListAddressesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListAddressesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListAddressesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListAddressesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListAddressesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListAddressesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListAddressesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListAddressesHttpRequest) { AggregatedListAddressesHttpRequest that = (AggregatedListAddressesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java index 6f42491c2885..9abfaa836482 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListAutoscalersHttpRequest() { this.userIp = null; } - private AggregatedListAutoscalersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListAutoscalersHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListAutoscalersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListAutoscalersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListAutoscalersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListAutoscalersHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListAutoscalersHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListAutoscalersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListAutoscalersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListAutoscalersHttpRequest) { AggregatedListAutoscalersHttpRequest that = (AggregatedListAutoscalersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java index 894e48f279b8..eb79e6cb84f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListBackendServicesHttpRequest() { this.userIp = null; } - private AggregatedListBackendServicesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListBackendServicesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListBackendServicesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListBackendServicesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListBackendServicesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListBackendServicesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListBackendServicesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListBackendServicesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListBackendServicesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListBackendServicesHttpRequest) { AggregatedListBackendServicesHttpRequest that = (AggregatedListBackendServicesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java index e0bc892b3a6b..a75b2af098ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListDiskTypesHttpRequest() { this.userIp = null; } - private AggregatedListDiskTypesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListDiskTypesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListDiskTypesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListDiskTypesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListDiskTypesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListDiskTypesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListDiskTypesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListDiskTypesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListDiskTypesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListDiskTypesHttpRequest) { AggregatedListDiskTypesHttpRequest that = (AggregatedListDiskTypesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java index 2f889d325d2d..233312cc74e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListDisksHttpRequest() { this.userIp = null; } - private AggregatedListDisksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListDisksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListDisksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListDisksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListDisksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListDisksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListDisksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListDisksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListDisksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListDisksHttpRequest) { AggregatedListDisksHttpRequest that = (AggregatedListDisksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java index d167b4bc8a55..b660e858c440 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListForwardingRulesHttpRequest() { this.userIp = null; } - private AggregatedListForwardingRulesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListForwardingRulesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListForwardingRulesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListForwardingRulesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListForwardingRulesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListForwardingRulesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListForwardingRulesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListForwardingRulesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListForwardingRulesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListForwardingRulesHttpRequest) { AggregatedListForwardingRulesHttpRequest that = (AggregatedListForwardingRulesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java index 1b11d1dae87e..bf09eaf8d2ed 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListGlobalOperationsHttpRequest() { this.userIp = null; } - private AggregatedListGlobalOperationsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListGlobalOperationsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListGlobalOperationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListGlobalOperationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListGlobalOperationsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListGlobalOperationsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListGlobalOperationsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListGlobalOperationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListGlobalOperationsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListGlobalOperationsHttpRequest) { - AggregatedListGlobalOperationsHttpRequest that = (AggregatedListGlobalOperationsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListGlobalOperationsHttpRequest that = + (AggregatedListGlobalOperationsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java index 83725fe87875..856200d39650 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListInstanceGroupManagersHttpRequest() { this.userIp = null; } - private AggregatedListInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListInstanceGroupManagersHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListInstanceGroupManagersHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListInstanceGroupManagersHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListInstanceGroupManagersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListInstanceGroupManagersHttpRequest) { - AggregatedListInstanceGroupManagersHttpRequest that = (AggregatedListInstanceGroupManagersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListInstanceGroupManagersHttpRequest that = + (AggregatedListInstanceGroupManagersHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java index 60c1fcde17bf..646396f2bb92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListInstanceGroupsHttpRequest() { this.userIp = null; } - private AggregatedListInstanceGroupsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListInstanceGroupsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListInstanceGroupsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListInstanceGroupsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListInstanceGroupsHttpRequest) { AggregatedListInstanceGroupsHttpRequest that = (AggregatedListInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java index 752bd786bcb3..423c1ce14128 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListInstancesHttpRequest() { this.userIp = null; } - private AggregatedListInstancesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListInstancesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListInstancesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListInstancesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListInstancesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListInstancesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListInstancesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListInstancesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListInstancesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListInstancesHttpRequest) { AggregatedListInstancesHttpRequest that = (AggregatedListInstancesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java index 789d72277abf..76e22de8c8ad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListInterconnectAttachmentsHttpRequest() { this.userIp = null; } - private AggregatedListInterconnectAttachmentsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListInterconnectAttachmentsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListInterconnectAttachmentsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListInterconnectAttachmentsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListInterconnectAttachmentsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListInterconnectAttachmentsHttpRequest(); } @@ -263,7 +260,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(AggregatedListInterconnectAttachmentsHttpRequest other) { - if (other == AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) return this; + if (other == AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -426,40 +424,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListInterconnectAttachmentsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListInterconnectAttachmentsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +470,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListInterconnectAttachmentsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +514,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListInterconnectAttachmentsHttpRequest) { - AggregatedListInterconnectAttachmentsHttpRequest that = (AggregatedListInterconnectAttachmentsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListInterconnectAttachmentsHttpRequest that = + (AggregatedListInterconnectAttachmentsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +535,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java index 55bfca104b20..048534c3d74a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListMachineTypesHttpRequest() { this.userIp = null; } - private AggregatedListMachineTypesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListMachineTypesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListMachineTypesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListMachineTypesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListMachineTypesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListMachineTypesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListMachineTypesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListMachineTypesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListMachineTypesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListMachineTypesHttpRequest) { AggregatedListMachineTypesHttpRequest that = (AggregatedListMachineTypesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java index 3a526dadcc95..bf7348b89619 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListRegionCommitmentsHttpRequest() { this.userIp = null; } - private AggregatedListRegionCommitmentsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListRegionCommitmentsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListRegionCommitmentsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListRegionCommitmentsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListRegionCommitmentsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListRegionCommitmentsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListRegionCommitmentsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListRegionCommitmentsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListRegionCommitmentsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListRegionCommitmentsHttpRequest) { - AggregatedListRegionCommitmentsHttpRequest that = (AggregatedListRegionCommitmentsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListRegionCommitmentsHttpRequest that = + (AggregatedListRegionCommitmentsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java index ac0485db4ee3..8cf47d8bf4c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListRoutersHttpRequest() { this.userIp = null; } - private AggregatedListRoutersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListRoutersHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListRoutersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListRoutersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListRoutersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListRoutersHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListRoutersHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListRoutersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListRoutersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListRoutersHttpRequest) { AggregatedListRoutersHttpRequest that = (AggregatedListRoutersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java index 1f63479c0a03..a99349acb6ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListSubnetworksHttpRequest() { this.userIp = null; } - private AggregatedListSubnetworksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListSubnetworksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListSubnetworksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListSubnetworksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListSubnetworksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListSubnetworksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListSubnetworksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListSubnetworksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListSubnetworksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListSubnetworksHttpRequest) { AggregatedListSubnetworksHttpRequest that = (AggregatedListSubnetworksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java index 4e6a1f63aa91..6e2c49c6b09f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListTargetInstancesHttpRequest() { this.userIp = null; } - private AggregatedListTargetInstancesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListTargetInstancesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListTargetInstancesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListTargetInstancesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListTargetInstancesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListTargetInstancesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListTargetInstancesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListTargetInstancesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListTargetInstancesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListTargetInstancesHttpRequest) { AggregatedListTargetInstancesHttpRequest that = (AggregatedListTargetInstancesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java index 6fedb5f443cb..be52b0d6b37d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListTargetPoolsHttpRequest() { this.userIp = null; } - private AggregatedListTargetPoolsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListTargetPoolsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListTargetPoolsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListTargetPoolsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListTargetPoolsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListTargetPoolsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListTargetPoolsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListTargetPoolsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListTargetPoolsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListTargetPoolsHttpRequest) { AggregatedListTargetPoolsHttpRequest that = (AggregatedListTargetPoolsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java index b8cb1ab29d97..67e1c0a94a9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListTargetVpnGatewaysHttpRequest() { this.userIp = null; } - private AggregatedListTargetVpnGatewaysHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListTargetVpnGatewaysHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListTargetVpnGatewaysHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListTargetVpnGatewaysHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListTargetVpnGatewaysHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListTargetVpnGatewaysHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListTargetVpnGatewaysHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListTargetVpnGatewaysHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListTargetVpnGatewaysHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof AggregatedListTargetVpnGatewaysHttpRequest) { - AggregatedListTargetVpnGatewaysHttpRequest that = (AggregatedListTargetVpnGatewaysHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + AggregatedListTargetVpnGatewaysHttpRequest that = + (AggregatedListTargetVpnGatewaysHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java index 51df06608e7d..f3706a16d0ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private AggregatedListVpnTunnelsHttpRequest() { this.userIp = null; } - private AggregatedListVpnTunnelsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private AggregatedListVpnTunnelsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AggregatedListVpnTunnelsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AggregatedListVpnTunnelsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AggregatedListVpnTunnelsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AggregatedListVpnTunnelsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public AggregatedListVpnTunnelsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AggregatedListVpnTunnelsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "AggregatedListVpnTunnelsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof AggregatedListVpnTunnelsHttpRequest) { AggregatedListVpnTunnelsHttpRequest that = (AggregatedListVpnTunnelsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java index 4b6098009405..cc3041ce98f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private AliasIpRange() { this.subnetworkRangeName = null; } - - private AliasIpRange( - String ipCidrRange, - String subnetworkRangeName - ) { + private AliasIpRange(String ipCidrRange, String subnetworkRangeName) { this.ipCidrRange = ipCidrRange; this.subnetworkRangeName = subnetworkRangeName; } @@ -56,7 +49,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); } if (fieldNames.contains("subnetworkRangeName") && subnetworkRangeName != null) { - fieldMap.put("subnetworkRangeName", Collections.singletonList(String.valueOf(subnetworkRangeName))); + fieldMap.put( + "subnetworkRangeName", Collections.singletonList(String.valueOf(subnetworkRangeName))); } return fieldMap; } @@ -86,22 +80,24 @@ public String getSubnetworkRangeName() { return subnetworkRangeName; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AliasIpRange prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AliasIpRange getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AliasIpRange DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AliasIpRange(); } @@ -146,13 +142,9 @@ public Builder setSubnetworkRangeName(String subnetworkRangeName) { return this; } - public AliasIpRange build() { - return new AliasIpRange( - ipCidrRange, - subnetworkRangeName - ); + return new AliasIpRange(ipCidrRange, subnetworkRangeName); } public Builder clone() { @@ -166,8 +158,11 @@ public Builder clone() { @Override public String toString() { return "AliasIpRange{" - + "ipCidrRange=" + ipCidrRange + ", " - + "subnetworkRangeName=" + subnetworkRangeName + + "ipCidrRange=" + + ipCidrRange + + ", " + + "subnetworkRangeName=" + + subnetworkRangeName + "}"; } @@ -178,19 +173,14 @@ public boolean equals(Object o) { } if (o instanceof AliasIpRange) { AliasIpRange that = (AliasIpRange) o; - return - Objects.equals(this.ipCidrRange, that.getIpCidrRange()) && - Objects.equals(this.subnetworkRangeName, that.getSubnetworkRangeName()) - ; + return Objects.equals(this.ipCidrRange, that.getIpCidrRange()) + && Objects.equals(this.subnetworkRangeName, that.getSubnetworkRangeName()); } return false; } @Override public int hashCode() { - return Objects.hash( - ipCidrRange, - subnetworkRangeName - ); + return Objects.hash(ipCidrRange, subnetworkRangeName); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java index c12c96954b60..b51dc3456385 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private Allowed() { this.ports = null; } - - private Allowed( - String iPProtocol, - List ports - ) { + private Allowed(String iPProtocol, List ports) { this.iPProtocol = iPProtocol; this.ports = ports; } @@ -90,22 +85,24 @@ public List getPortsList() { return ports; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Allowed prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Allowed getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Allowed DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Allowed(); } @@ -158,13 +155,9 @@ public Builder addPorts(String ports) { return this; } - public Allowed build() { - return new Allowed( - iPProtocol, - ports - ); + return new Allowed(iPProtocol, ports); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "Allowed{" - + "iPProtocol=" + iPProtocol + ", " - + "ports=" + ports - + "}"; + return "Allowed{" + "iPProtocol=" + iPProtocol + ", " + "ports=" + ports + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof Allowed) { Allowed that = (Allowed) o; - return - Objects.equals(this.iPProtocol, that.getIPProtocol()) && - Objects.equals(this.ports, that.getPortsList()) - ; + return Objects.equals(this.iPProtocol, that.getIPProtocol()) + && Objects.equals(this.ports, that.getPortsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - iPProtocol, - ports - ); + return Objects.hash(iPProtocol, ports); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index a9a7769635b2..395dd15f0ad0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private AttachDiskInstanceHttpRequest() { this.userIp = null; } - private AttachDiskInstanceHttpRequest( String access_token, AttachedDisk attachedDiskResource, @@ -67,8 +63,7 @@ private AttachDiskInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.attachedDiskResource = attachedDiskResource; this.callback = callback; @@ -88,7 +83,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } if (fieldNames.contains("attachedDiskResource") && attachedDiskResource != null) { - fieldMap.put("attachedDiskResource", Collections.singletonList(String.valueOf(attachedDiskResource))); + fieldMap.put( + "attachedDiskResource", Collections.singletonList(String.valueOf(attachedDiskResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AttachDiskInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AttachDiskInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AttachDiskInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AttachDiskInstanceHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public AttachDiskInstanceHttpRequest build() { String missing = ""; - - - if (instance == null) { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new AttachDiskInstanceHttpRequest( - access_token, - attachedDiskResource, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + attachedDiskResource, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "AttachDiskInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "attachedDiskResource=" + attachedDiskResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "attachedDiskResource=" + + attachedDiskResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof AttachDiskInstanceHttpRequest) { AttachDiskInstanceHttpRequest that = (AttachDiskInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.attachedDiskResource, that.getAttachedDiskResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.attachedDiskResource, that.getAttachedDiskResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - attachedDiskResource, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + attachedDiskResource, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java index 44f45f3d6360..9039024f2ef4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -62,7 +61,6 @@ private AttachedDisk() { this.type = null; } - private AttachedDisk( Boolean autoDelete, Boolean boot, @@ -76,8 +74,7 @@ private AttachedDisk( List licenses, String mode, String source, - String type - ) { + String type) { this.autoDelete = autoDelete; this.boot = boot; this.deviceName = deviceName; @@ -106,7 +103,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); } if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); } if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -248,22 +246,24 @@ public String getType() { return type; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AttachedDisk prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AttachedDisk getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AttachedDisk DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AttachedDisk(); } @@ -478,35 +478,22 @@ public Builder setType(String type) { return this; } - public AttachedDisk build() { - - - - - - - - - - - return new AttachedDisk( - autoDelete, - boot, - deviceName, - diskEncryptionKey, - guestOsFeatures, - index, - initializeParams, - interface2, - kind, - licenses, - mode, - source, - type - ); + autoDelete, + boot, + deviceName, + diskEncryptionKey, + guestOsFeatures, + index, + initializeParams, + interface2, + kind, + licenses, + mode, + source, + type); } public Builder clone() { @@ -531,19 +518,44 @@ public Builder clone() { @Override public String toString() { return "AttachedDisk{" - + "autoDelete=" + autoDelete + ", " - + "boot=" + boot + ", " - + "deviceName=" + deviceName + ", " - + "diskEncryptionKey=" + diskEncryptionKey + ", " - + "guestOsFeatures=" + guestOsFeatures + ", " - + "index=" + index + ", " - + "initializeParams=" + initializeParams + ", " - + "interface2=" + interface2 + ", " - + "kind=" + kind + ", " - + "licenses=" + licenses + ", " - + "mode=" + mode + ", " - + "source=" + source + ", " - + "type=" + type + + "autoDelete=" + + autoDelete + + ", " + + "boot=" + + boot + + ", " + + "deviceName=" + + deviceName + + ", " + + "diskEncryptionKey=" + + diskEncryptionKey + + ", " + + "guestOsFeatures=" + + guestOsFeatures + + ", " + + "index=" + + index + + ", " + + "initializeParams=" + + initializeParams + + ", " + + "interface2=" + + interface2 + + ", " + + "kind=" + + kind + + ", " + + "licenses=" + + licenses + + ", " + + "mode=" + + mode + + ", " + + "source=" + + source + + ", " + + "type=" + + type + "}"; } @@ -554,21 +566,19 @@ public boolean equals(Object o) { } if (o instanceof AttachedDisk) { AttachedDisk that = (AttachedDisk) o; - return - Objects.equals(this.autoDelete, that.getAutoDelete()) && - Objects.equals(this.boot, that.getBoot()) && - Objects.equals(this.deviceName, that.getDeviceName()) && - Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && - Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) && - Objects.equals(this.index, that.getIndex()) && - Objects.equals(this.initializeParams, that.getInitializeParams()) && - Objects.equals(this.interface2, that.getInterface()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.licenses, that.getLicensesList()) && - Objects.equals(this.mode, that.getMode()) && - Objects.equals(this.source, that.getSource()) && - Objects.equals(this.type, that.getType()) - ; + return Objects.equals(this.autoDelete, that.getAutoDelete()) + && Objects.equals(this.boot, that.getBoot()) + && Objects.equals(this.deviceName, that.getDeviceName()) + && Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) + && Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) + && Objects.equals(this.index, that.getIndex()) + && Objects.equals(this.initializeParams, that.getInitializeParams()) + && Objects.equals(this.interface2, that.getInterface()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.licenses, that.getLicensesList()) + && Objects.equals(this.mode, that.getMode()) + && Objects.equals(this.source, that.getSource()) + && Objects.equals(this.type, that.getType()); } return false; } @@ -576,19 +586,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - autoDelete, - boot, - deviceName, - diskEncryptionKey, - guestOsFeatures, - index, - initializeParams, - interface2, - kind, - licenses, - mode, - source, - type - ); + autoDelete, + boot, + deviceName, + diskEncryptionKey, + guestOsFeatures, + index, + initializeParams, + interface2, + kind, + licenses, + mode, + source, + type); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java index 3ce07fdc702c..ebc8f214e56b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private AttachedDiskInitializeParams() { this.sourceImageEncryptionKey = null; } - private AttachedDiskInitializeParams( String diskName, String diskSizeGb, String diskType, Map labels, String sourceImage, - CustomerEncryptionKey sourceImageEncryptionKey - ) { + CustomerEncryptionKey sourceImageEncryptionKey) { this.diskName = diskName; this.diskSizeGb = diskSizeGb; this.diskType = diskType; @@ -84,7 +79,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); } if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); } return fieldMap; } @@ -142,22 +139,24 @@ public CustomerEncryptionKey getSourceImageEncryptionKey() { return sourceImageEncryptionKey; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AttachedDiskInitializeParams prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AttachedDiskInitializeParams getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AttachedDiskInitializeParams DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AttachedDiskInitializeParams(); } @@ -258,21 +257,10 @@ public Builder setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncr return this; } - public AttachedDiskInitializeParams build() { - - - - return new AttachedDiskInitializeParams( - diskName, - diskSizeGb, - diskType, - labels, - sourceImage, - sourceImageEncryptionKey - ); + diskName, diskSizeGb, diskType, labels, sourceImage, sourceImageEncryptionKey); } public Builder clone() { @@ -290,12 +278,23 @@ public Builder clone() { @Override public String toString() { return "AttachedDiskInitializeParams{" - + "diskName=" + diskName + ", " - + "diskSizeGb=" + diskSizeGb + ", " - + "diskType=" + diskType + ", " - + "labels=" + labels + ", " - + "sourceImage=" + sourceImage + ", " - + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + + "diskName=" + + diskName + + ", " + + "diskSizeGb=" + + diskSizeGb + + ", " + + "diskType=" + + diskType + + ", " + + "labels=" + + labels + + ", " + + "sourceImage=" + + sourceImage + + ", " + + "sourceImageEncryptionKey=" + + sourceImageEncryptionKey + "}"; } @@ -306,14 +305,12 @@ public boolean equals(Object o) { } if (o instanceof AttachedDiskInitializeParams) { AttachedDiskInitializeParams that = (AttachedDiskInitializeParams) o; - return - Objects.equals(this.diskName, that.getDiskName()) && - Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && - Objects.equals(this.diskType, that.getDiskType()) && - Objects.equals(this.labels, that.getLabelsMap()) && - Objects.equals(this.sourceImage, that.getSourceImage()) && - Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) - ; + return Objects.equals(this.diskName, that.getDiskName()) + && Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) + && Objects.equals(this.diskType, that.getDiskType()) + && Objects.equals(this.labels, that.getLabelsMap()) + && Objects.equals(this.sourceImage, that.getSourceImage()) + && Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()); } return false; } @@ -321,12 +318,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - diskName, - diskSizeGb, - diskType, - labels, - sourceImage, - sourceImageEncryptionKey - ); + diskName, diskSizeGb, diskType, labels, sourceImage, sourceImageEncryptionKey); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java index 27214ce4436f..0c6b2d8ed12e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -60,7 +59,6 @@ private Autoscaler() { this.zone = null; } - private Autoscaler( AutoscalingPolicy autoscalingPolicy, String creationTimestamp, @@ -73,8 +71,7 @@ private Autoscaler( String status, List statusDetails, String target, - String zone - ) { + String zone) { this.autoscalingPolicy = autoscalingPolicy; this.creationTimestamp = creationTimestamp; this.description = description; @@ -93,10 +90,12 @@ private Autoscaler( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("autoscalingPolicy") && autoscalingPolicy != null) { - fieldMap.put("autoscalingPolicy", Collections.singletonList(String.valueOf(autoscalingPolicy))); + fieldMap.put( + "autoscalingPolicy", Collections.singletonList(String.valueOf(autoscalingPolicy))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -230,22 +229,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Autoscaler prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Autoscaler getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Autoscaler DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Autoscaler(); } @@ -438,33 +439,21 @@ public Builder setZone(String zone) { return this; } - public Autoscaler build() { - - - - - - - - - - return new Autoscaler( - autoscalingPolicy, - creationTimestamp, - description, - id, - kind, - name, - region, - selfLink, - status, - statusDetails, - target, - zone - ); + autoscalingPolicy, + creationTimestamp, + description, + id, + kind, + name, + region, + selfLink, + status, + statusDetails, + target, + zone); } public Builder clone() { @@ -488,18 +477,41 @@ public Builder clone() { @Override public String toString() { return "Autoscaler{" - + "autoscalingPolicy=" + autoscalingPolicy + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "status=" + status + ", " - + "statusDetails=" + statusDetails + ", " - + "target=" + target + ", " - + "zone=" + zone + + "autoscalingPolicy=" + + autoscalingPolicy + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "status=" + + status + + ", " + + "statusDetails=" + + statusDetails + + ", " + + "target=" + + target + + ", " + + "zone=" + + zone + "}"; } @@ -510,20 +522,18 @@ public boolean equals(Object o) { } if (o instanceof Autoscaler) { Autoscaler that = (Autoscaler) o; - return - Objects.equals(this.autoscalingPolicy, that.getAutoscalingPolicy()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.statusDetails, that.getStatusDetailsList()) && - Objects.equals(this.target, that.getTarget()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.autoscalingPolicy, that.getAutoscalingPolicy()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.statusDetails, that.getStatusDetailsList()) + && Objects.equals(this.target, that.getTarget()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -531,18 +541,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - autoscalingPolicy, - creationTimestamp, - description, - id, - kind, - name, - region, - selfLink, - status, - statusDetails, - target, - zone - ); + autoscalingPolicy, + creationTimestamp, + description, + id, + kind, + name, + region, + selfLink, + status, + statusDetails, + target, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java index 6f5827f70c72..af7e74834ac5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private AutoscalerAggregatedList() { this.warning = null; } - private AutoscalerAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalerAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalerAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalerAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalerAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public AutoscalerAggregatedList build() { - - - - - return new AutoscalerAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new AutoscalerAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "AutoscalerAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof AutoscalerAggregatedList) { AutoscalerAggregatedList that = (AutoscalerAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java index 989942abb28a..c60b22c30843 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.AutoscalerStub; import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,33 @@ * *
* - *

Note: close() needs to be called on the autoscalerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the autoscalerClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of AutoscalerSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class AutoscalerClient implements BackgroundResource {
   private final AutoscalerSettings settings;
   private final AutoscalerStub stub;
 
-
-
-  /**
-   * Constructs an instance of AutoscalerClient with default settings.
-   */
+  /** Constructs an instance of AutoscalerClient with default settings. */
   public static final AutoscalerClient create() throws IOException {
     return create(AutoscalerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of AutoscalerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of AutoscalerClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final AutoscalerClient create(AutoscalerSettings settings) throws IOException {
     return new AutoscalerClient(settings);
@@ -144,9 +128,8 @@ public static final AutoscalerClient create(AutoscalerStub stub) {
   }
 
   /**
-   * Constructs an instance of AutoscalerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of AutoscalerClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected AutoscalerClient(AutoscalerSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +151,12 @@ public AutoscalerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of autoscalers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,11 +170,12 @@ public AutoscalerStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(ProjectName project) {
+  public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(
+      ProjectName project) {
     AggregatedListAutoscalersHttpRequest request =
         AggregatedListAutoscalersHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListAutoscalers(request);
   }
 
@@ -199,7 +183,8 @@ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(Pr
   /**
    * Retrieves an aggregated list of autoscalers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -215,9 +200,7 @@ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(Pr
   @BetaApi
   public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(String project) {
     AggregatedListAutoscalersHttpRequest request =
-        AggregatedListAutoscalersHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListAutoscalersHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListAutoscalers(request);
   }
 
@@ -225,7 +208,8 @@ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(St
   /**
    * Retrieves an aggregated list of autoscalers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +226,17 @@ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(AggregatedListAutoscalersHttpRequest request) {
-    return aggregatedListAutoscalersPagedCallable()
-        .call(request);
+  public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(
+      AggregatedListAutoscalersHttpRequest request) {
+    return aggregatedListAutoscalersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of autoscalers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +252,9 @@ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(Ag
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListAutoscalersPagedCallable() { + public final UnaryCallable< + AggregatedListAutoscalersHttpRequest, AggregatedListAutoscalersPagedResponse> + aggregatedListAutoscalersPagedCallable() { return stub.aggregatedListAutoscalersPagedCallable(); } @@ -275,7 +262,8 @@ public final UnaryCallableSample code: + * *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +286,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListAutoscalersCallable() { + public final UnaryCallable + aggregatedListAutoscalersCallable() { return stub.aggregatedListAutoscalersCallable(); } @@ -306,7 +295,8 @@ public final UnaryCallableSample code: + * *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -316,11 +306,15 @@ public final UnaryCallable
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -328,9 +322,9 @@ public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler, St DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) - .setRequestId(requestId) - .build(); + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .setRequestId(requestId) + .build(); return deleteAutoscaler(request); } @@ -338,7 +332,8 @@ public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler, St /** * Deletes the specified autoscaler. * - * Sample code: + *

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -348,11 +343,15 @@ public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler, St
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -360,9 +359,9 @@ public final Operation deleteAutoscaler(String autoscaler, String requestId) { DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .build(); return deleteAutoscaler(request); } @@ -370,7 +369,8 @@ public final Operation deleteAutoscaler(String autoscaler, String requestId) { /** * Deletes the specified autoscaler. * - * Sample code: + *

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -395,7 +395,8 @@ public final Operation deleteAutoscaler(DeleteAutoscalerHttpRequest request) {
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -417,9 +418,11 @@ public final UnaryCallable deleteAutosca
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.
+   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -435,16 +438,18 @@ public final Autoscaler getAutoscaler(ProjectZoneAutoscalerName autoscaler) {
 
     GetAutoscalerHttpRequest request =
         GetAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
-        .build();
+            .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+            .build();
     return getAutoscaler(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.
+   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -459,17 +464,17 @@ public final Autoscaler getAutoscaler(ProjectZoneAutoscalerName autoscaler) {
   public final Autoscaler getAutoscaler(String autoscaler) {
 
     GetAutoscalerHttpRequest request =
-        GetAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .build();
+        GetAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
     return getAutoscaler(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.
+   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -490,9 +495,11 @@ public final Autoscaler getAutoscaler(GetAutoscalerHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.
+   * Returns the specified autoscaler resource. Get a list of available autoscalers by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
@@ -514,7 +521,8 @@ public final UnaryCallable getAutoscalerCa
   /**
    * Creates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -525,23 +533,32 @@ public final UnaryCallable getAutoscalerCa
    * 
* * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAutoscaler(ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { + public final Operation insertAutoscaler( + ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setAutoscalerResource(autoscalerResource) - .build(); + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setAutoscalerResource(autoscalerResource) + .build(); return insertAutoscaler(request); } @@ -549,7 +566,8 @@ public final Operation insertAutoscaler(ProjectZoneName zone, String requestId, /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -560,23 +578,32 @@ public final Operation insertAutoscaler(ProjectZoneName zone, String requestId,
    * 
* * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAutoscaler(String zone, String requestId, Autoscaler autoscalerResource) { + public final Operation insertAutoscaler( + String zone, String requestId, Autoscaler autoscalerResource) { InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setAutoscalerResource(autoscalerResource) - .build(); + .setZone(zone) + .setRequestId(requestId) + .setAutoscalerResource(autoscalerResource) + .build(); return insertAutoscaler(request); } @@ -584,7 +611,8 @@ public final Operation insertAutoscaler(String zone, String requestId, Autoscale /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -611,7 +639,8 @@ public final Operation insertAutoscaler(InsertAutoscalerHttpRequest request) {
   /**
    * Creates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -637,7 +666,8 @@ public final UnaryCallable insertAutosca
   /**
    * Retrieves a list of autoscalers contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -654,8 +684,8 @@ public final UnaryCallable insertAutosca
   public final ListAutoscalersPagedResponse listAutoscalers(ProjectZoneName zone) {
     ListAutoscalersHttpRequest request =
         ListAutoscalersHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listAutoscalers(request);
   }
 
@@ -663,7 +693,8 @@ public final ListAutoscalersPagedResponse listAutoscalers(ProjectZoneName zone)
   /**
    * Retrieves a list of autoscalers contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -679,9 +710,7 @@ public final ListAutoscalersPagedResponse listAutoscalers(ProjectZoneName zone)
   @BetaApi
   public final ListAutoscalersPagedResponse listAutoscalers(String zone) {
     ListAutoscalersHttpRequest request =
-        ListAutoscalersHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListAutoscalersHttpRequest.newBuilder().setZone(zone).build();
     return listAutoscalers(request);
   }
 
@@ -689,7 +718,8 @@ public final ListAutoscalersPagedResponse listAutoscalers(String zone) {
   /**
    * Retrieves a list of autoscalers contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -707,15 +737,15 @@ public final ListAutoscalersPagedResponse listAutoscalers(String zone) {
    */
   @BetaApi
   public final ListAutoscalersPagedResponse listAutoscalers(ListAutoscalersHttpRequest request) {
-    return listAutoscalersPagedCallable()
-        .call(request);
+    return listAutoscalersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of autoscalers contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -731,7 +761,8 @@ public final ListAutoscalersPagedResponse listAutoscalers(ListAutoscalersHttpReq
    * 
*/ @BetaApi - public final UnaryCallable listAutoscalersPagedCallable() { + public final UnaryCallable + listAutoscalersPagedCallable() { return stub.listAutoscalersPagedCallable(); } @@ -739,7 +770,8 @@ public final UnaryCallableSample code: + * *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -768,9 +800,11 @@ public final UnaryCallable listAutos
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -783,32 +817,43 @@ public final UnaryCallable listAutos
    *
    * @param autoscaler Name of the autoscaler to patch.
    * @param zone Name of the zone for this request.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchAutoscaler(String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { + public final Operation patchAutoscaler( + String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setAutoscalerResource(autoscalerResource) + .build(); return patchAutoscaler(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -821,32 +866,43 @@ public final Operation patchAutoscaler(String autoscaler, ProjectZoneName zone,
    *
    * @param autoscaler Name of the autoscaler to patch.
    * @param zone Name of the zone for this request.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchAutoscaler(String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { + public final Operation patchAutoscaler( + String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setZone(zone) - .setRequestId(requestId) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setZone(zone) + .setRequestId(requestId) + .setAutoscalerResource(autoscalerResource) + .build(); return patchAutoscaler(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -873,9 +929,11 @@ public final Operation patchAutoscaler(PatchAutoscalerHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -903,7 +961,8 @@ public final UnaryCallable patchAutoscale
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -916,24 +975,33 @@ public final UnaryCallable patchAutoscale
    *
    * @param autoscaler Name of the autoscaler to update.
    * @param zone Name of the zone for this request.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateAutoscaler(String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { + public final Operation updateAutoscaler( + String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setAutoscalerResource(autoscalerResource) + .build(); return updateAutoscaler(request); } @@ -941,7 +1009,8 @@ public final Operation updateAutoscaler(String autoscaler, ProjectZoneName zone, /** * Updates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -954,24 +1023,33 @@ public final Operation updateAutoscaler(String autoscaler, ProjectZoneName zone,
    *
    * @param autoscaler Name of the autoscaler to update.
    * @param zone Name of the zone for this request.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateAutoscaler(String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { + public final Operation updateAutoscaler( + String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setZone(zone) - .setRequestId(requestId) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setZone(zone) + .setRequestId(requestId) + .setAutoscalerResource(autoscalerResource) + .build(); return updateAutoscaler(request); } @@ -979,7 +1057,8 @@ public final Operation updateAutoscaler(String autoscaler, String zone, String r /** * Updates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -1008,7 +1087,8 @@ public final Operation updateAutoscaler(UpdateAutoscalerHttpRequest request) {
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -1033,7 +1113,7 @@ public final UnaryCallable updateAutosca
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -1062,15 +1142,16 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListAutoscalersPagedResponse extends AbstractPagedListResponse<
-      AggregatedListAutoscalersHttpRequest,
-      AutoscalerAggregatedList,
-      AutoscalersScopedList,
-      AggregatedListAutoscalersPage,
-      AggregatedListAutoscalersFixedSizeCollection> {
+  public static class AggregatedListAutoscalersPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList, AutoscalersScopedList,
+          AggregatedListAutoscalersPage, AggregatedListAutoscalersFixedSizeCollection> {
 
     public static ApiFuture createAsync(
-        PageContext context,
+        PageContext<
+                AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+                AutoscalersScopedList>
+            context,
         ApiFuture futureResponse) {
       ApiFuture futurePage =
           AggregatedListAutoscalersPage.createEmptyPage().createPageAsync(context, futureResponse);
@@ -1078,7 +1159,8 @@ public static ApiFuture createAsync(
           futurePage,
           new ApiFunction() {
             @Override
-            public AggregatedListAutoscalersPagedResponse apply(AggregatedListAutoscalersPage input) {
+            public AggregatedListAutoscalersPagedResponse apply(
+                AggregatedListAutoscalersPage input) {
               return new AggregatedListAutoscalersPagedResponse(input);
             }
           });
@@ -1087,18 +1169,18 @@ public AggregatedListAutoscalersPagedResponse apply(AggregatedListAutoscalersPag
     private AggregatedListAutoscalersPagedResponse(AggregatedListAutoscalersPage page) {
       super(page, AggregatedListAutoscalersFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListAutoscalersPage extends AbstractPage<
-      AggregatedListAutoscalersHttpRequest,
-      AutoscalerAggregatedList,
-      AutoscalersScopedList,
-      AggregatedListAutoscalersPage> {
+  public static class AggregatedListAutoscalersPage
+      extends AbstractPage<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList, AutoscalersScopedList,
+          AggregatedListAutoscalersPage> {
 
     private AggregatedListAutoscalersPage(
-        PageContext context,
+        PageContext<
+                AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+                AutoscalersScopedList>
+            context,
         AutoscalerAggregatedList response) {
       super(context, response);
     }
@@ -1109,31 +1191,32 @@ private static AggregatedListAutoscalersPage createEmptyPage() {
 
     @Override
     protected AggregatedListAutoscalersPage createPage(
-        PageContext context,
+        PageContext<
+                AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+                AutoscalersScopedList>
+            context,
         AutoscalerAggregatedList response) {
       return new AggregatedListAutoscalersPage(context, response);
     }
 
     @Override
     public ApiFuture createPageAsync(
-        PageContext context,
+        PageContext<
+                AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+                AutoscalersScopedList>
+            context,
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListAutoscalersHttpRequest,
-      AutoscalerAggregatedList,
-      AutoscalersScopedList,
-      AggregatedListAutoscalersPage,
-      AggregatedListAutoscalersFixedSizeCollection> {
+  public static class AggregatedListAutoscalersFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList, AutoscalersScopedList,
+          AggregatedListAutoscalersPage, AggregatedListAutoscalersFixedSizeCollection> {
 
-    private AggregatedListAutoscalersFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListAutoscalersFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -1146,15 +1229,12 @@ protected AggregatedListAutoscalersFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListAutoscalersFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListAutoscalersPagedResponse extends AbstractPagedListResponse<
-      ListAutoscalersHttpRequest,
-      AutoscalerList,
-      Autoscaler,
-      ListAutoscalersPage,
-      ListAutoscalersFixedSizeCollection> {
+
+  public static class ListAutoscalersPagedResponse
+      extends AbstractPagedListResponse<
+          ListAutoscalersHttpRequest, AutoscalerList, Autoscaler, ListAutoscalersPage,
+          ListAutoscalersFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -1174,15 +1254,11 @@ public ListAutoscalersPagedResponse apply(ListAutoscalersPage input) {
     private ListAutoscalersPagedResponse(ListAutoscalersPage page) {
       super(page, ListAutoscalersFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListAutoscalersPage extends AbstractPage<
-      ListAutoscalersHttpRequest,
-      AutoscalerList,
-      Autoscaler,
-      ListAutoscalersPage> {
+  public static class ListAutoscalersPage
+      extends AbstractPage<
+          ListAutoscalersHttpRequest, AutoscalerList, Autoscaler, ListAutoscalersPage> {
 
     private ListAutoscalersPage(
         PageContext context,
@@ -1207,20 +1283,15 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListAutoscalersHttpRequest,
-      AutoscalerList,
-      Autoscaler,
-      ListAutoscalersPage,
-      ListAutoscalersFixedSizeCollection> {
+  public static class ListAutoscalersFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListAutoscalersHttpRequest, AutoscalerList, Autoscaler, ListAutoscalersPage,
+          ListAutoscalersFixedSizeCollection> {
 
-    private ListAutoscalersFixedSizeCollection(List pages, int collectionSize) {
+    private ListAutoscalersFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -1233,7 +1304,5 @@ protected ListAutoscalersFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListAutoscalersFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java
index 5b660006bd91..c2f9aafcc324 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private AutoscalerList() {
     this.warning = null;
   }
 
-
   private AutoscalerList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(AutoscalerList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static AutoscalerList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final AutoscalerList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new AutoscalerList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public AutoscalerList build() {
 
-
-
-
-
-      return new AutoscalerList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new AutoscalerList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "AutoscalerList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof AutoscalerList) {
       AutoscalerList that = (AutoscalerList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java
deleted file mode 100644
index 7fe59dd1e221..000000000000
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerName.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 2018 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.compute.v1;
-
-import com.google.api.core.BetaApi;
-import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceNameFactory;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Generated;
-
-@Generated("by GAPIC")
-@BetaApi
-public final class AutoscalerName implements com.google.api.resourcenames.ResourceName {
-  private final String autoscaler;
-  private final String project;
-  private final String zone;
-  private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/autoscalers/{autoscaler}");
-
-  private volatile Map fieldValuesMap;
-
-  public static Builder newBuilder() {
-    return new Builder();
-  }
-
-  public Builder toBuilder() {
-    return new Builder(this);
-  }
-
-  private AutoscalerName(Builder builder) {
-    autoscaler = Preconditions.checkNotNull(builder.getAutoscaler());
-    project = Preconditions.checkNotNull(builder.getProject());
-    zone = Preconditions.checkNotNull(builder.getZone());
-  }
-
-  public static AutoscalerName of(
-      String autoscaler,
-      String project,
-      String zone
-      ) {
-    return newBuilder()
-    .setAutoscaler(autoscaler)
-    .setProject(project)
-    .setZone(zone)
-      .build();
-  }
-
-  public static String format(
-      String autoscaler,
-      String project,
-      String zone
-      ) {
-    return of(
-        autoscaler,
-        project,
-        zone
-        )
-        .toString();
-  }
-
-  public String getAutoscaler() {
-    return autoscaler;
-  }
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getZone() {
-    return zone;
-  }
-
-
-  @Override
-  public Map getFieldValuesMap() {
-    if (fieldValuesMap == null) {
-      synchronized (this) {
-        if (fieldValuesMap == null) {
-          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
-          fieldMapBuilder.put("autoscaler", autoscaler);
-          fieldMapBuilder.put("project", project);
-          fieldMapBuilder.put("zone", zone);
-          fieldValuesMap = fieldMapBuilder.build();
-        }
-      }
-    }
-    return fieldValuesMap;
-  }
-
-  public String getFieldValue(String fieldName) {
-    return getFieldValuesMap().get(fieldName);
-  }
-
-
-  public static ResourceNameFactory newFactory() {
-    return new ResourceNameFactory() {
-      public AutoscalerName parse(String formattedString) {return AutoscalerName.parse(formattedString);}
-    };
-  }
-
-  public static AutoscalerName parse(String formattedString) {
-    Map matchMap =
-        PATH_TEMPLATE.validatedMatch(formattedString, "AutoscalerName.parse: formattedString not in valid format");
-    return of(
-      matchMap.get("autoscaler"),
-      matchMap.get("project"),
-      matchMap.get("zone")
-    );
-  }
-
-  public static boolean isParsableFrom(String formattedString) {
-    return PATH_TEMPLATE.matches(formattedString);
-  }
-
-  public static class Builder {
-    private String autoscaler;
-    private String project;
-    private String zone;
-
-    public String getAutoscaler() {
-      return autoscaler;
-    }
-    public String getProject() {
-      return project;
-    }
-    public String getZone() {
-      return zone;
-    }
-
-    public Builder setAutoscaler(String autoscaler) {
-      this.autoscaler = autoscaler;
-      return this;
-    }
-    public Builder setProject(String project) {
-      this.project = project;
-      return this;
-    }
-    public Builder setZone(String zone) {
-      this.zone = zone;
-      return this;
-    }
-
-    private Builder() {}
-
-    public Builder (AutoscalerName autoscalerName) {
-      autoscaler = autoscalerName.autoscaler;
-      project = autoscalerName.project;
-      zone = autoscalerName.zone;
-    }
-
-    public AutoscalerName build() {
-      return new AutoscalerName(this);
-    }
-  }
-
-  @Override
-  public String toString() {
-    return PATH_TEMPLATE.instantiate(
-        "autoscaler", autoscaler,
-        "project", project,
-        "zone", zone
-        );
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o instanceof AutoscalerName) {
-      AutoscalerName that = (AutoscalerName) o;
-      return
-          Objects.equals(this.autoscaler, that.getAutoscaler()) &&
-          Objects.equals(this.project, that.getProject()) &&
-          Objects.equals(this.zone, that.getZone())
-          ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(
-      autoscaler,
-      project,
-      zone
-    );
-  }
-}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java
index ee4ddc935c37..9b935d48a5d6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java
@@ -15,46 +15,24 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse;
+import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse;
-import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse;
 import com.google.cloud.compute.v1.stub.AutoscalerStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -63,15 +41,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteAutoscaler to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteAutoscaler to 30 seconds: * *

  * 
@@ -86,98 +64,76 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class AutoscalerSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListAutoscalers.
-   */
-  public PagedCallSettings aggregatedListAutoscalersSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListAutoscalers. */
+  public PagedCallSettings<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+          AggregatedListAutoscalersPagedResponse>
+      aggregatedListAutoscalersSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).aggregatedListAutoscalersSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to deleteAutoscaler. */
   public UnaryCallSettings deleteAutoscalerSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).deleteAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to getAutoscaler. */
   public UnaryCallSettings getAutoscalerSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).getAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to insertAutoscaler. */
   public UnaryCallSettings insertAutoscalerSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).insertAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listAutoscalers.
-   */
-  public PagedCallSettings listAutoscalersSettings() {
+  /** Returns the object with the settings used for calls to listAutoscalers. */
+  public PagedCallSettings
+      listAutoscalersSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).listAutoscalersSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to patchAutoscaler. */
   public UnaryCallSettings patchAutoscalerSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).patchAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to updateAutoscaler. */
   public UnaryCallSettings updateAutoscalerSettings() {
     return ((AutoscalerStubSettings) getStubSettings()).updateAutoscalerSettings();
   }
 
-
   public static final AutoscalerSettings create(AutoscalerStubSettings stub) throws IOException {
     return new AutoscalerSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return AutoscalerStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return AutoscalerStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return AutoscalerStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return AutoscalerStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return AutoscalerStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return AutoscalerStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return AutoscalerStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -190,23 +146,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return AutoscalerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -215,9 +165,7 @@ protected AutoscalerSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for AutoscalerSettings.
-   */
+  /** Builder for AutoscalerSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -239,67 +187,64 @@ protected Builder(AutoscalerStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public AutoscalerStubSettings.Builder getStubSettingsBuilder() {
       return ((AutoscalerStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListAutoscalers. - */ - public PagedCallSettings.Builder aggregatedListAutoscalersSettings() { + /** Returns the builder for the settings used for calls to aggregatedListAutoscalers. */ + public PagedCallSettings.Builder< + AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList, + AggregatedListAutoscalersPagedResponse> + aggregatedListAutoscalersSettings() { return getStubSettingsBuilder().aggregatedListAutoscalersSettings(); } - /** - * Returns the builder for the settings used for calls to deleteAutoscaler. - */ - public UnaryCallSettings.Builder deleteAutoscalerSettings() { + /** Returns the builder for the settings used for calls to deleteAutoscaler. */ + public UnaryCallSettings.Builder + deleteAutoscalerSettings() { return getStubSettingsBuilder().deleteAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to getAutoscaler. - */ + /** Returns the builder for the settings used for calls to getAutoscaler. */ public UnaryCallSettings.Builder getAutoscalerSettings() { return getStubSettingsBuilder().getAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to insertAutoscaler. - */ - public UnaryCallSettings.Builder insertAutoscalerSettings() { + /** Returns the builder for the settings used for calls to insertAutoscaler. */ + public UnaryCallSettings.Builder + insertAutoscalerSettings() { return getStubSettingsBuilder().insertAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to listAutoscalers. - */ - public PagedCallSettings.Builder listAutoscalersSettings() { + /** Returns the builder for the settings used for calls to listAutoscalers. */ + public PagedCallSettings.Builder< + ListAutoscalersHttpRequest, AutoscalerList, ListAutoscalersPagedResponse> + listAutoscalersSettings() { return getStubSettingsBuilder().listAutoscalersSettings(); } - /** - * Returns the builder for the settings used for calls to patchAutoscaler. - */ - public UnaryCallSettings.Builder patchAutoscalerSettings() { + /** Returns the builder for the settings used for calls to patchAutoscaler. */ + public UnaryCallSettings.Builder + patchAutoscalerSettings() { return getStubSettingsBuilder().patchAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to updateAutoscaler. - */ - public UnaryCallSettings.Builder updateAutoscalerSettings() { + /** Returns the builder for the settings used for calls to updateAutoscaler. */ + public UnaryCallSettings.Builder + updateAutoscalerSettings() { return getStubSettingsBuilder().updateAutoscalerSettings(); } @@ -308,4 +253,4 @@ public AutoscalerSettings build() throws IOException { return new AutoscalerSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java index 1465230b2a49..846838c8c2a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private AutoscalerStatusDetails() { this.type = null; } - - private AutoscalerStatusDetails( - String message, - String type - ) { + private AutoscalerStatusDetails(String message, String type) { this.message = message; this.type = type; } @@ -86,22 +79,24 @@ public String getType() { return type; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalerStatusDetails prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalerStatusDetails getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalerStatusDetails DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalerStatusDetails(); } @@ -146,13 +141,9 @@ public Builder setType(String type) { return this; } - public AutoscalerStatusDetails build() { - return new AutoscalerStatusDetails( - message, - type - ); + return new AutoscalerStatusDetails(message, type); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "AutoscalerStatusDetails{" - + "message=" + message + ", " - + "type=" + type - + "}"; + return "AutoscalerStatusDetails{" + "message=" + message + ", " + "type=" + type + "}"; } @Override @@ -178,19 +166,14 @@ public boolean equals(Object o) { } if (o instanceof AutoscalerStatusDetails) { AutoscalerStatusDetails that = (AutoscalerStatusDetails) o; - return - Objects.equals(this.message, that.getMessage()) && - Objects.equals(this.type, that.getType()) - ; + return Objects.equals(this.message, that.getMessage()) + && Objects.equals(this.type, that.getType()); } return false; } @Override public int hashCode() { - return Objects.hash( - message, - type - ); + return Objects.hash(message, type); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java index 3e4947231cb6..33fd70094e0c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private AutoscalersScopedList() { this.warning = null; } - - private AutoscalersScopedList( - List autoscalers, - Warning warning - ) { + private AutoscalersScopedList(List autoscalers, Warning warning) { this.autoscalers = autoscalers; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalersScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalersScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalersScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalersScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public AutoscalersScopedList build() { - return new AutoscalersScopedList( - autoscalers, - warning - ); + return new AutoscalersScopedList(autoscalers, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "AutoscalersScopedList{" - + "autoscalers=" + autoscalers + ", " - + "warning=" + warning + + "autoscalers=" + + autoscalers + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof AutoscalersScopedList) { AutoscalersScopedList that = (AutoscalersScopedList) o; - return - Objects.equals(this.autoscalers, that.getAutoscalersList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.autoscalers, that.getAutoscalersList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - autoscalers, - warning - ); + return Objects.hash(autoscalers, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java index cae18926b1f9..e229455b299f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private AutoscalingPolicy() { this.minNumReplicas = null; } - private AutoscalingPolicy( Integer coolDownPeriodSec, AutoscalingPolicyCpuUtilization cpuUtilization, List customMetricUtilizations, AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization, Integer maxNumReplicas, - Integer minNumReplicas - ) { + Integer minNumReplicas) { this.coolDownPeriodSec = coolDownPeriodSec; this.cpuUtilization = cpuUtilization; this.customMetricUtilizations = customMetricUtilizations; @@ -69,7 +66,8 @@ private AutoscalingPolicy( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("coolDownPeriodSec") && coolDownPeriodSec != null) { - fieldMap.put("coolDownPeriodSec", Collections.singletonList(String.valueOf(coolDownPeriodSec))); + fieldMap.put( + "coolDownPeriodSec", Collections.singletonList(String.valueOf(coolDownPeriodSec))); } if (fieldNames.contains("cpuUtilization") && cpuUtilization != null) { fieldMap.put("cpuUtilization", Collections.singletonList(String.valueOf(cpuUtilization))); @@ -82,7 +80,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("customMetricUtilizations", stringList.build()); } if (fieldNames.contains("loadBalancingUtilization") && loadBalancingUtilization != null) { - fieldMap.put("loadBalancingUtilization", Collections.singletonList(String.valueOf(loadBalancingUtilization))); + fieldMap.put( + "loadBalancingUtilization", + Collections.singletonList(String.valueOf(loadBalancingUtilization))); } if (fieldNames.contains("maxNumReplicas") && maxNumReplicas != null) { fieldMap.put("maxNumReplicas", Collections.singletonList(String.valueOf(maxNumReplicas))); @@ -146,22 +146,24 @@ public Integer getMinNumReplicas() { return minNumReplicas; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalingPolicy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalingPolicy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalingPolicy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalingPolicy(); } @@ -230,7 +232,8 @@ public List getCustomMetricUtilization return customMetricUtilizations; } - public Builder addAllCustomMetricUtilizations(List customMetricUtilizations) { + public Builder addAllCustomMetricUtilizations( + List customMetricUtilizations) { if (this.customMetricUtilizations == null) { this.customMetricUtilizations = new ArrayList<>(customMetricUtilizations.size()); } @@ -238,7 +241,8 @@ public Builder addAllCustomMetricUtilizations(List> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put("utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + fieldMap.put( + "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); } return fieldMap; } @@ -72,22 +67,24 @@ public Double getUtilizationTarget() { return utilizationTarget; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalingPolicyCpuUtilization prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalingPolicyCpuUtilization getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalingPolicyCpuUtilization DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalingPolicyCpuUtilization(); } @@ -118,11 +115,8 @@ public Builder setUtilizationTarget(Double utilizationTarget) { return this; } - public AutoscalingPolicyCpuUtilization build() { - return new AutoscalingPolicyCpuUtilization( - utilizationTarget - ); + return new AutoscalingPolicyCpuUtilization(utilizationTarget); } public Builder clone() { @@ -134,9 +128,7 @@ public Builder clone() { @Override public String toString() { - return "AutoscalingPolicyCpuUtilization{" - + "utilizationTarget=" + utilizationTarget - + "}"; + return "AutoscalingPolicyCpuUtilization{" + "utilizationTarget=" + utilizationTarget + "}"; } @Override @@ -146,17 +138,13 @@ public boolean equals(Object o) { } if (o instanceof AutoscalingPolicyCpuUtilization) { AutoscalingPolicyCpuUtilization that = (AutoscalingPolicyCpuUtilization) o; - return - Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) - ; + return Objects.equals(this.utilizationTarget, that.getUtilizationTarget()); } return false; } @Override public int hashCode() { - return Objects.hash( - utilizationTarget - ); + return Objects.hash(utilizationTarget); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java index 8e033cd9c425..c72326ca0f8c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,8 @@ private AutoscalingPolicyCustomMetricUtilization() { this.utilizationTargetType = null; } - private AutoscalingPolicyCustomMetricUtilization( - String metric, - Double utilizationTarget, - String utilizationTargetType - ) { + String metric, Double utilizationTarget, String utilizationTargetType) { this.metric = metric; this.utilizationTarget = utilizationTarget; this.utilizationTargetType = utilizationTargetType; @@ -60,10 +53,13 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); } if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put("utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + fieldMap.put( + "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); } if (fieldNames.contains("utilizationTargetType") && utilizationTargetType != null) { - fieldMap.put("utilizationTargetType", Collections.singletonList(String.valueOf(utilizationTargetType))); + fieldMap.put( + "utilizationTargetType", + Collections.singletonList(String.valueOf(utilizationTargetType))); } return fieldMap; } @@ -100,22 +96,24 @@ public String getUtilizationTargetType() { return utilizationTargetType; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalingPolicyCustomMetricUtilization prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalingPolicyCustomMetricUtilization getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalingPolicyCustomMetricUtilization DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalingPolicyCustomMetricUtilization(); } @@ -174,15 +172,10 @@ public Builder setUtilizationTargetType(String utilizationTargetType) { return this; } - public AutoscalingPolicyCustomMetricUtilization build() { - return new AutoscalingPolicyCustomMetricUtilization( - metric, - utilizationTarget, - utilizationTargetType - ); + metric, utilizationTarget, utilizationTargetType); } public Builder clone() { @@ -197,9 +190,14 @@ public Builder clone() { @Override public String toString() { return "AutoscalingPolicyCustomMetricUtilization{" - + "metric=" + metric + ", " - + "utilizationTarget=" + utilizationTarget + ", " - + "utilizationTargetType=" + utilizationTargetType + + "metric=" + + metric + + ", " + + "utilizationTarget=" + + utilizationTarget + + ", " + + "utilizationTargetType=" + + utilizationTargetType + "}"; } @@ -210,21 +208,15 @@ public boolean equals(Object o) { } if (o instanceof AutoscalingPolicyCustomMetricUtilization) { AutoscalingPolicyCustomMetricUtilization that = (AutoscalingPolicyCustomMetricUtilization) o; - return - Objects.equals(this.metric, that.getMetric()) && - Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) && - Objects.equals(this.utilizationTargetType, that.getUtilizationTargetType()) - ; + return Objects.equals(this.metric, that.getMetric()) + && Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) + && Objects.equals(this.utilizationTargetType, that.getUtilizationTargetType()); } return false; } @Override public int hashCode() { - return Objects.hash( - metric, - utilizationTarget, - utilizationTargetType - ); + return Objects.hash(metric, utilizationTarget, utilizationTargetType); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java index f2362f6dbf7e..ecdd43a850a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private AutoscalingPolicyLoadBalancingUtilization() { this.utilizationTarget = null; } - - private AutoscalingPolicyLoadBalancingUtilization( - Double utilizationTarget - ) { + private AutoscalingPolicyLoadBalancingUtilization(Double utilizationTarget) { this.utilizationTarget = utilizationTarget; } @@ -49,7 +43,8 @@ private AutoscalingPolicyLoadBalancingUtilization( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put("utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + fieldMap.put( + "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); } return fieldMap; } @@ -72,22 +67,24 @@ public Double getUtilizationTarget() { return utilizationTarget; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(AutoscalingPolicyLoadBalancingUtilization prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static AutoscalingPolicyLoadBalancingUtilization getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final AutoscalingPolicyLoadBalancingUtilization DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new AutoscalingPolicyLoadBalancingUtilization(); } @@ -118,11 +115,8 @@ public Builder setUtilizationTarget(Double utilizationTarget) { return this; } - public AutoscalingPolicyLoadBalancingUtilization build() { - return new AutoscalingPolicyLoadBalancingUtilization( - utilizationTarget - ); + return new AutoscalingPolicyLoadBalancingUtilization(utilizationTarget); } public Builder clone() { @@ -135,7 +129,8 @@ public Builder clone() { @Override public String toString() { return "AutoscalingPolicyLoadBalancingUtilization{" - + "utilizationTarget=" + utilizationTarget + + "utilizationTarget=" + + utilizationTarget + "}"; } @@ -145,18 +140,15 @@ public boolean equals(Object o) { return true; } if (o instanceof AutoscalingPolicyLoadBalancingUtilization) { - AutoscalingPolicyLoadBalancingUtilization that = (AutoscalingPolicyLoadBalancingUtilization) o; - return - Objects.equals(this.utilizationTarget, that.getUtilizationTarget()) - ; + AutoscalingPolicyLoadBalancingUtilization that = + (AutoscalingPolicyLoadBalancingUtilization) o; + return Objects.equals(this.utilizationTarget, that.getUtilizationTarget()); } return false; } @Override public int hashCode() { - return Objects.hash( - utilizationTarget - ); + return Objects.hash(utilizationTarget); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java index 388f9f82ff9e..47c88237a96f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private Backend() { this.maxUtilization = null; } - private Backend( String balancingMode, Float capacityScaler, @@ -64,8 +60,7 @@ private Backend( Integer maxConnectionsPerInstance, Integer maxRate, Float maxRatePerInstance, - Float maxUtilization - ) { + Float maxUtilization) { this.balancingMode = balancingMode; this.capacityScaler = capacityScaler; this.description = description; @@ -96,13 +91,16 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("maxConnections", Collections.singletonList(String.valueOf(maxConnections))); } if (fieldNames.contains("maxConnectionsPerInstance") && maxConnectionsPerInstance != null) { - fieldMap.put("maxConnectionsPerInstance", Collections.singletonList(String.valueOf(maxConnectionsPerInstance))); + fieldMap.put( + "maxConnectionsPerInstance", + Collections.singletonList(String.valueOf(maxConnectionsPerInstance))); } if (fieldNames.contains("maxRate") && maxRate != null) { fieldMap.put("maxRate", Collections.singletonList(String.valueOf(maxRate))); } if (fieldNames.contains("maxRatePerInstance") && maxRatePerInstance != null) { - fieldMap.put("maxRatePerInstance", Collections.singletonList(String.valueOf(maxRatePerInstance))); + fieldMap.put( + "maxRatePerInstance", Collections.singletonList(String.valueOf(maxRatePerInstance))); } if (fieldNames.contains("maxUtilization") && maxUtilization != null) { fieldMap.put("maxUtilization", Collections.singletonList(String.valueOf(maxUtilization))); @@ -184,22 +182,24 @@ public Float getMaxUtilization() { return maxUtilization; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Backend prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Backend getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Backend DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Backend(); } @@ -342,27 +342,18 @@ public Builder setMaxUtilization(Float maxUtilization) { return this; } - public Backend build() { - - - - - - - return new Backend( - balancingMode, - capacityScaler, - description, - group, - maxConnections, - maxConnectionsPerInstance, - maxRate, - maxRatePerInstance, - maxUtilization - ); + balancingMode, + capacityScaler, + description, + group, + maxConnections, + maxConnectionsPerInstance, + maxRate, + maxRatePerInstance, + maxUtilization); } public Builder clone() { @@ -383,15 +374,32 @@ public Builder clone() { @Override public String toString() { return "Backend{" - + "balancingMode=" + balancingMode + ", " - + "capacityScaler=" + capacityScaler + ", " - + "description=" + description + ", " - + "group=" + group + ", " - + "maxConnections=" + maxConnections + ", " - + "maxConnectionsPerInstance=" + maxConnectionsPerInstance + ", " - + "maxRate=" + maxRate + ", " - + "maxRatePerInstance=" + maxRatePerInstance + ", " - + "maxUtilization=" + maxUtilization + + "balancingMode=" + + balancingMode + + ", " + + "capacityScaler=" + + capacityScaler + + ", " + + "description=" + + description + + ", " + + "group=" + + group + + ", " + + "maxConnections=" + + maxConnections + + ", " + + "maxConnectionsPerInstance=" + + maxConnectionsPerInstance + + ", " + + "maxRate=" + + maxRate + + ", " + + "maxRatePerInstance=" + + maxRatePerInstance + + ", " + + "maxUtilization=" + + maxUtilization + "}"; } @@ -402,17 +410,15 @@ public boolean equals(Object o) { } if (o instanceof Backend) { Backend that = (Backend) o; - return - Objects.equals(this.balancingMode, that.getBalancingMode()) && - Objects.equals(this.capacityScaler, that.getCapacityScaler()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.group, that.getGroup()) && - Objects.equals(this.maxConnections, that.getMaxConnections()) && - Objects.equals(this.maxConnectionsPerInstance, that.getMaxConnectionsPerInstance()) && - Objects.equals(this.maxRate, that.getMaxRate()) && - Objects.equals(this.maxRatePerInstance, that.getMaxRatePerInstance()) && - Objects.equals(this.maxUtilization, that.getMaxUtilization()) - ; + return Objects.equals(this.balancingMode, that.getBalancingMode()) + && Objects.equals(this.capacityScaler, that.getCapacityScaler()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.group, that.getGroup()) + && Objects.equals(this.maxConnections, that.getMaxConnections()) + && Objects.equals(this.maxConnectionsPerInstance, that.getMaxConnectionsPerInstance()) + && Objects.equals(this.maxRate, that.getMaxRate()) + && Objects.equals(this.maxRatePerInstance, that.getMaxRatePerInstance()) + && Objects.equals(this.maxUtilization, that.getMaxUtilization()); } return false; } @@ -420,15 +426,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - balancingMode, - capacityScaler, - description, - group, - maxConnections, - maxConnectionsPerInstance, - maxRate, - maxRatePerInstance, - maxUtilization - ); + balancingMode, + capacityScaler, + description, + group, + maxConnections, + maxConnectionsPerInstance, + maxRate, + maxRatePerInstance, + maxUtilization); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java index a078a3f4acef..96bf4e7e748e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private BackendBucket() { this.selfLink = null; } - private BackendBucket( String bucketName, String creationTimestamp, @@ -61,8 +57,7 @@ private BackendBucket( String id, String kind, String name, - String selfLink - ) { + String selfLink) { this.bucketName = bucketName; this.creationTimestamp = creationTimestamp; this.description = description; @@ -80,7 +75,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -170,22 +166,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendBucket prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendBucket getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendBucket DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendBucket(); } @@ -314,25 +312,10 @@ public Builder setSelfLink(String selfLink) { return this; } - public BackendBucket build() { - - - - - - return new BackendBucket( - bucketName, - creationTimestamp, - description, - enableCdn, - id, - kind, - name, - selfLink - ); + bucketName, creationTimestamp, description, enableCdn, id, kind, name, selfLink); } public Builder clone() { @@ -352,14 +335,29 @@ public Builder clone() { @Override public String toString() { return "BackendBucket{" - + "bucketName=" + bucketName + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "enableCdn=" + enableCdn + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + + "bucketName=" + + bucketName + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "enableCdn=" + + enableCdn + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -370,16 +368,14 @@ public boolean equals(Object o) { } if (o instanceof BackendBucket) { BackendBucket that = (BackendBucket) o; - return - Objects.equals(this.bucketName, that.getBucketName()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.enableCdn, that.getEnableCdn()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.bucketName, that.getBucketName()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.enableCdn, that.getEnableCdn()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @@ -387,14 +383,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - bucketName, - creationTimestamp, - description, - enableCdn, - id, - kind, - name, - selfLink - ); + bucketName, creationTimestamp, description, enableCdn, id, kind, name, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java index b124d5b5c5ad..c50d1ce9c7d5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.BackendBucketStub; import com.google.cloud.compute.v1.stub.BackendBucketStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,7 +42,7 @@ *

  * 
  * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
- *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+ *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
  *   String requestId = "";
  *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
  * }
@@ -60,33 +50,32 @@
  * 
* *

Note: close() needs to be called on the backendBucketClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of BackendBucketSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class BackendBucketClient implements BackgroundResource {
   private final BackendBucketSettings settings;
   private final BackendBucketStub stub;
 
-
-
-  /**
-   * Constructs an instance of BackendBucketClient with default settings.
-   */
+  /** Constructs an instance of BackendBucketClient with default settings. */
   public static final BackendBucketClient create() throws IOException {
     return create(BackendBucketSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of BackendBucketClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of BackendBucketClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final BackendBucketClient create(BackendBucketSettings settings) throws IOException {
+  public static final BackendBucketClient create(BackendBucketSettings settings)
+      throws IOException {
     return new BackendBucketClient(settings);
   }
 
   /**
-   * Constructs an instance of BackendBucketClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use BackendBucketSettings}.
+   * Constructs an instance of BackendBucketClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use BackendBucketSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final BackendBucketClient create(BackendBucketStub stub) {
@@ -144,9 +129,9 @@ public static final BackendBucketClient create(BackendBucketStub stub) {
   }
 
   /**
-   * Constructs an instance of BackendBucketClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of BackendBucketClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected BackendBucketClient(BackendBucketSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +153,41 @@ public BackendBucketStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified BackendBucket resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendBucket(ProjectBackendBucketName backendBucket, String requestId) { + public final Operation deleteBackendBucket( + ProjectGlobalBackendBucketName backendBucket, String requestId) { DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .setRequestId(requestId) - .build(); + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setRequestId(requestId) + .build(); return deleteBackendBucket(request); } @@ -205,21 +195,26 @@ public final Operation deleteBackendBucket(ProjectBackendBucketName backendBucke /** * Deletes the specified BackendBucket resource. * - * Sample code: + *

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket.toString(), requestId);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +222,9 @@ public final Operation deleteBackendBucket(String backendBucket, String requestI DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket) - .setRequestId(requestId) - .build(); + .setBackendBucket(backendBucket) + .setRequestId(requestId) + .build(); return deleteBackendBucket(request); } @@ -237,10 +232,11 @@ public final Operation deleteBackendBucket(String backendBucket, String requestI /** * Deletes the specified BackendBucket resource. * - * Sample code: + *

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
@@ -262,10 +258,11 @@ public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest reques
   /**
    * Deletes the specified BackendBucket resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
@@ -278,18 +275,21 @@ public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable deleteBackendBucketCallable() { + public final UnaryCallable + deleteBackendBucketCallable() { return stub.deleteBackendBucketCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making + * a list() request. + * + *

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   BackendBucket response = backendBucketClient.getBackendBucket(backendBucket);
    * }
    * 
@@ -298,23 +298,25 @@ public final UnaryCallable deleteBack * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final BackendBucket getBackendBucket(ProjectBackendBucketName backendBucket) { + public final BackendBucket getBackendBucket(ProjectGlobalBackendBucketName backendBucket) { GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .build(); + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .build(); return getBackendBucket(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making + * a list() request. + * + *

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   BackendBucket response = backendBucketClient.getBackendBucket(backendBucket.toString());
    * }
    * 
@@ -326,20 +328,20 @@ public final BackendBucket getBackendBucket(ProjectBackendBucketName backendBuck public final BackendBucket getBackendBucket(String backendBucket) { GetBackendBucketHttpRequest request = - GetBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket) - .build(); + GetBackendBucketHttpRequest.newBuilder().setBackendBucket(backendBucket).build(); return getBackendBucket(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. + * Returns the specified BackendBucket resource. Get a list of available backend buckets by making + * a list() request. + * + *

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
    *     .build();
@@ -357,12 +359,14 @@ public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request)
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request.
+   * Returns the specified BackendBucket resource. Get a list of available backend buckets by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   GetBackendBucketHttpRequest request = GetBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
    *     .build();
@@ -373,15 +377,18 @@ public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable getBackendBucketCallable() { + public final UnaryCallable + getBackendBucketCallable() { return stub.getBackendBucketCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a BackendBucket resource in the specified project using the data included in the request. + * Creates a BackendBucket resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   String requestId = "";
@@ -391,32 +398,40 @@ public final UnaryCallable getBacken
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage + * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendBucket(String requestId, ProjectName project, BackendBucket backendBucketResource) { + public final Operation insertBackendBucket( + String requestId, ProjectName project, BackendBucket backendBucketResource) { InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setBackendBucketResource(backendBucketResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setBackendBucketResource(backendBucketResource) + .build(); return insertBackendBucket(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a BackendBucket resource in the specified project using the data included in the request. + * Creates a BackendBucket resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   String requestId = "";
@@ -426,32 +441,40 @@ public final Operation insertBackendBucket(String requestId, ProjectName project
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage + * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendBucket(String requestId, String project, BackendBucket backendBucketResource) { + public final Operation insertBackendBucket( + String requestId, String project, BackendBucket backendBucketResource) { InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setBackendBucketResource(backendBucketResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setBackendBucketResource(backendBucketResource) + .build(); return insertBackendBucket(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a BackendBucket resource in the specified project using the data included in the request. + * Creates a BackendBucket resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   String requestId = "";
@@ -476,9 +499,11 @@ public final Operation insertBackendBucket(InsertBackendBucketHttpRequest reques
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a BackendBucket resource in the specified project using the data included in the request.
+   * Creates a BackendBucket resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   String requestId = "";
@@ -496,7 +521,8 @@ public final Operation insertBackendBucket(InsertBackendBucketHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable insertBackendBucketCallable() { + public final UnaryCallable + insertBackendBucketCallable() { return stub.insertBackendBucketCallable(); } @@ -504,7 +530,8 @@ public final UnaryCallable insertBack /** * Retrieves the list of BackendBucket resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +548,8 @@ public final UnaryCallable insertBack
   public final ListBackendBucketsPagedResponse listBackendBuckets(ProjectName project) {
     ListBackendBucketsHttpRequest request =
         ListBackendBucketsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listBackendBuckets(request);
   }
 
@@ -530,7 +557,8 @@ public final ListBackendBucketsPagedResponse listBackendBuckets(ProjectName proj
   /**
    * Retrieves the list of BackendBucket resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +574,7 @@ public final ListBackendBucketsPagedResponse listBackendBuckets(ProjectName proj
   @BetaApi
   public final ListBackendBucketsPagedResponse listBackendBuckets(String project) {
     ListBackendBucketsHttpRequest request =
-        ListBackendBucketsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListBackendBucketsHttpRequest.newBuilder().setProject(project).build();
     return listBackendBuckets(request);
   }
 
@@ -556,7 +582,8 @@ public final ListBackendBucketsPagedResponse listBackendBuckets(String project)
   /**
    * Retrieves the list of BackendBucket resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +600,17 @@ public final ListBackendBucketsPagedResponse listBackendBuckets(String project)
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListBackendBucketsPagedResponse listBackendBuckets(ListBackendBucketsHttpRequest request) {
-    return listBackendBucketsPagedCallable()
-        .call(request);
+  public final ListBackendBucketsPagedResponse listBackendBuckets(
+      ListBackendBucketsHttpRequest request) {
+    return listBackendBucketsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of BackendBucket resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +626,8 @@ public final ListBackendBucketsPagedResponse listBackendBuckets(ListBackendBucke
    * 
*/ @BetaApi - public final UnaryCallable listBackendBucketsPagedCallable() { + public final UnaryCallable + listBackendBucketsPagedCallable() { return stub.listBackendBucketsPagedCallable(); } @@ -606,7 +635,8 @@ public final UnaryCallableSample code: + * *

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,18 +659,21 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listBackendBucketsCallable() { + public final UnaryCallable + listBackendBucketsCallable() { return stub.listBackendBucketsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.patchBackendBucket(backendBucket, requestId, backendBucketResource);
@@ -648,34 +681,44 @@ public final UnaryCallable lis
    * 
* * @param backendBucket Name of the BackendBucket resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage + * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchBackendBucket(ProjectBackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) { + public final Operation patchBackendBucket( + ProjectGlobalBackendBucketName backendBucket, + String requestId, + BackendBucket backendBucketResource) { PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .setRequestId(requestId) - .setBackendBucketResource(backendBucketResource) - .build(); + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); return patchBackendBucket(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.patchBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
@@ -683,34 +726,42 @@ public final Operation patchBackendBucket(ProjectBackendBucketName backendBucket
    * 
* * @param backendBucket Name of the BackendBucket resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage + * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchBackendBucket(String backendBucket, String requestId, BackendBucket backendBucketResource) { + public final Operation patchBackendBucket( + String backendBucket, String requestId, BackendBucket backendBucketResource) { PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket) - .setRequestId(requestId) - .setBackendBucketResource(backendBucketResource) - .build(); + .setBackendBucket(backendBucket) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); return patchBackendBucket(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
@@ -732,12 +783,14 @@ public final Operation patchBackendBucket(PatchBackendBucketHttpRequest request)
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
@@ -752,7 +805,8 @@ public final Operation patchBackendBucket(PatchBackendBucketHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable patchBackendBucketCallable() { + public final UnaryCallable + patchBackendBucketCallable() { return stub.patchBackendBucketCallable(); } @@ -760,10 +814,11 @@ public final UnaryCallable patchBacken /** * Updates the specified BackendBucket resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.updateBackendBucket(backendBucket, requestId, backendBucketResource);
@@ -771,23 +826,31 @@ public final UnaryCallable patchBacken
    * 
* * @param backendBucket Name of the BackendBucket resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage + * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateBackendBucket(ProjectBackendBucketName backendBucket, String requestId, BackendBucket backendBucketResource) { + public final Operation updateBackendBucket( + ProjectGlobalBackendBucketName backendBucket, + String requestId, + BackendBucket backendBucketResource) { UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .setRequestId(requestId) - .setBackendBucketResource(backendBucketResource) - .build(); + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); return updateBackendBucket(request); } @@ -795,10 +858,11 @@ public final Operation updateBackendBucket(ProjectBackendBucketName backendBucke /** * Updates the specified BackendBucket resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   Operation response = backendBucketClient.updateBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
@@ -806,23 +870,29 @@ public final Operation updateBackendBucket(ProjectBackendBucketName backendBucke
    * 
* * @param backendBucket Name of the BackendBucket resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage bucket. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage + * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateBackendBucket(String backendBucket, String requestId, BackendBucket backendBucketResource) { + public final Operation updateBackendBucket( + String backendBucket, String requestId, BackendBucket backendBucketResource) { UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket) - .setRequestId(requestId) - .setBackendBucketResource(backendBucketResource) - .build(); + .setBackendBucket(backendBucket) + .setRequestId(requestId) + .setBackendBucketResource(backendBucketResource) + .build(); return updateBackendBucket(request); } @@ -830,10 +900,11 @@ public final Operation updateBackendBucket(String backendBucket, String requestI /** * Updates the specified BackendBucket resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
@@ -857,10 +928,11 @@ public final Operation updateBackendBucket(UpdateBackendBucketHttpRequest reques
   /**
    * Updates the specified BackendBucket resource with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
    *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
@@ -875,12 +947,13 @@ public final Operation updateBackendBucket(UpdateBackendBucketHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable updateBackendBucketCallable() { + public final UnaryCallable + updateBackendBucketCallable() { return stub.updateBackendBucketCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -909,12 +982,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListBackendBucketsPagedResponse extends AbstractPagedListResponse< - ListBackendBucketsHttpRequest, - BackendBucketList, - BackendBucket, - ListBackendBucketsPage, - ListBackendBucketsFixedSizeCollection> { + public static class ListBackendBucketsPagedResponse + extends AbstractPagedListResponse< + ListBackendBucketsHttpRequest, BackendBucketList, BackendBucket, ListBackendBucketsPage, + ListBackendBucketsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -934,15 +1005,11 @@ public ListBackendBucketsPagedResponse apply(ListBackendBucketsPage input) { private ListBackendBucketsPagedResponse(ListBackendBucketsPage page) { super(page, ListBackendBucketsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListBackendBucketsPage extends AbstractPage< - ListBackendBucketsHttpRequest, - BackendBucketList, - BackendBucket, - ListBackendBucketsPage> { + public static class ListBackendBucketsPage + extends AbstractPage< + ListBackendBucketsHttpRequest, BackendBucketList, BackendBucket, ListBackendBucketsPage> { private ListBackendBucketsPage( PageContext context, @@ -967,20 +1034,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListBackendBucketsFixedSizeCollection extends AbstractFixedSizeCollection< - ListBackendBucketsHttpRequest, - BackendBucketList, - BackendBucket, - ListBackendBucketsPage, - ListBackendBucketsFixedSizeCollection> { + public static class ListBackendBucketsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackendBucketsHttpRequest, BackendBucketList, BackendBucket, ListBackendBucketsPage, + ListBackendBucketsFixedSizeCollection> { - private ListBackendBucketsFixedSizeCollection(List pages, int collectionSize) { + private ListBackendBucketsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -993,7 +1055,5 @@ protected ListBackendBucketsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListBackendBucketsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java index 4e60355ce9fd..603ca247d2ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private BackendBucketList() { this.warning = null; } - private BackendBucketList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendBucketList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendBucketList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendBucketList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendBucketList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public BackendBucketList build() { - - - - - return new BackendBucketList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new BackendBucketList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "BackendBucketList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof BackendBucketList) { BackendBucketList that = (BackendBucketList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java index c88878f63c52..2fdb143cb2c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; import com.google.cloud.compute.v1.stub.BackendBucketStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteBackendBucket to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteBackendBucket to 30 seconds: * *

  * 
@@ -85,91 +63,73 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class BackendBucketSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteBackendBucket.
-   */
-  public UnaryCallSettings deleteBackendBucketSettings() {
+  /** Returns the object with the settings used for calls to deleteBackendBucket. */
+  public UnaryCallSettings
+      deleteBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).deleteBackendBucketSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getBackendBucket.
-   */
+  /** Returns the object with the settings used for calls to getBackendBucket. */
   public UnaryCallSettings getBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).getBackendBucketSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertBackendBucket.
-   */
-  public UnaryCallSettings insertBackendBucketSettings() {
+  /** Returns the object with the settings used for calls to insertBackendBucket. */
+  public UnaryCallSettings
+      insertBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).insertBackendBucketSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listBackendBuckets.
-   */
-  public PagedCallSettings listBackendBucketsSettings() {
+  /** Returns the object with the settings used for calls to listBackendBuckets. */
+  public PagedCallSettings<
+          ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse>
+      listBackendBucketsSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).listBackendBucketsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchBackendBucket.
-   */
+  /** Returns the object with the settings used for calls to patchBackendBucket. */
   public UnaryCallSettings patchBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).patchBackendBucketSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateBackendBucket.
-   */
-  public UnaryCallSettings updateBackendBucketSettings() {
+  /** Returns the object with the settings used for calls to updateBackendBucket. */
+  public UnaryCallSettings
+      updateBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).updateBackendBucketSettings();
   }
 
-
-  public static final BackendBucketSettings create(BackendBucketStubSettings stub) throws IOException {
+  public static final BackendBucketSettings create(BackendBucketStubSettings stub)
+      throws IOException {
     return new BackendBucketSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return BackendBucketStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return BackendBucketStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return BackendBucketStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return BackendBucketStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return BackendBucketStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return BackendBucketStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return BackendBucketStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +142,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return BackendBucketStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +161,7 @@ protected BackendBucketSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for BackendBucketSettings.
-   */
+  /** Builder for BackendBucketSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +183,57 @@ protected Builder(BackendBucketStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public BackendBucketStubSettings.Builder getStubSettingsBuilder() {
       return ((BackendBucketStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteBackendBucket. - */ - public UnaryCallSettings.Builder deleteBackendBucketSettings() { + /** Returns the builder for the settings used for calls to deleteBackendBucket. */ + public UnaryCallSettings.Builder + deleteBackendBucketSettings() { return getStubSettingsBuilder().deleteBackendBucketSettings(); } - /** - * Returns the builder for the settings used for calls to getBackendBucket. - */ - public UnaryCallSettings.Builder getBackendBucketSettings() { + /** Returns the builder for the settings used for calls to getBackendBucket. */ + public UnaryCallSettings.Builder + getBackendBucketSettings() { return getStubSettingsBuilder().getBackendBucketSettings(); } - /** - * Returns the builder for the settings used for calls to insertBackendBucket. - */ - public UnaryCallSettings.Builder insertBackendBucketSettings() { + /** Returns the builder for the settings used for calls to insertBackendBucket. */ + public UnaryCallSettings.Builder + insertBackendBucketSettings() { return getStubSettingsBuilder().insertBackendBucketSettings(); } - /** - * Returns the builder for the settings used for calls to listBackendBuckets. - */ - public PagedCallSettings.Builder listBackendBucketsSettings() { + /** Returns the builder for the settings used for calls to listBackendBuckets. */ + public PagedCallSettings.Builder< + ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse> + listBackendBucketsSettings() { return getStubSettingsBuilder().listBackendBucketsSettings(); } - /** - * Returns the builder for the settings used for calls to patchBackendBucket. - */ - public UnaryCallSettings.Builder patchBackendBucketSettings() { + /** Returns the builder for the settings used for calls to patchBackendBucket. */ + public UnaryCallSettings.Builder + patchBackendBucketSettings() { return getStubSettingsBuilder().patchBackendBucketSettings(); } - /** - * Returns the builder for the settings used for calls to updateBackendBucket. - */ - public UnaryCallSettings.Builder updateBackendBucketSettings() { + /** Returns the builder for the settings used for calls to updateBackendBucket. */ + public UnaryCallSettings.Builder + updateBackendBucketSettings() { return getStubSettingsBuilder().updateBackendBucketSettings(); } @@ -293,4 +242,4 @@ public BackendBucketSettings build() throws IOException { return new BackendBucketSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java index eff88f318ee1..20ad95f049f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -78,7 +77,6 @@ private BackendService() { this.timeoutSec = null; } - private BackendService( Integer affinityCookieTtlSec, List backends, @@ -100,8 +98,7 @@ private BackendService( String region, String selfLink, String sessionAffinity, - Integer timeoutSec - ) { + Integer timeoutSec) { this.affinityCookieTtlSec = affinityCookieTtlSec; this.backends = backends; this.cdnPolicy = cdnPolicy; @@ -129,7 +126,8 @@ private BackendService( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("affinityCookieTtlSec") && affinityCookieTtlSec != null) { - fieldMap.put("affinityCookieTtlSec", Collections.singletonList(String.valueOf(affinityCookieTtlSec))); + fieldMap.put( + "affinityCookieTtlSec", Collections.singletonList(String.valueOf(affinityCookieTtlSec))); } if (fieldNames.contains("backends") && backends != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -142,10 +140,12 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("cdnPolicy", Collections.singletonList(String.valueOf(cdnPolicy))); } if (fieldNames.contains("connectionDraining") && connectionDraining != null) { - fieldMap.put("connectionDraining", Collections.singletonList(String.valueOf(connectionDraining))); + fieldMap.put( + "connectionDraining", Collections.singletonList(String.valueOf(connectionDraining))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -173,7 +173,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { - fieldMap.put("loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); + fieldMap.put( + "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); } if (fieldNames.contains("name") && name != null) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); @@ -360,22 +361,24 @@ public Integer getTimeoutSec() { return timeoutSec; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendService prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendService getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendService DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendService(); } @@ -702,51 +705,30 @@ public Builder setTimeoutSec(Integer timeoutSec) { return this; } - public BackendService build() { - - - - - - - - - - - - - - - - - - - return new BackendService( - affinityCookieTtlSec, - backends, - cdnPolicy, - connectionDraining, - creationTimestamp, - description, - enableCDN, - fingerprint, - healthChecks, - iap, - id, - kind, - loadBalancingScheme, - name, - port, - portName, - protocol, - region, - selfLink, - sessionAffinity, - timeoutSec - ); + affinityCookieTtlSec, + backends, + cdnPolicy, + connectionDraining, + creationTimestamp, + description, + enableCDN, + fingerprint, + healthChecks, + iap, + id, + kind, + loadBalancingScheme, + name, + port, + portName, + protocol, + region, + selfLink, + sessionAffinity, + timeoutSec); } public Builder clone() { @@ -779,27 +761,68 @@ public Builder clone() { @Override public String toString() { return "BackendService{" - + "affinityCookieTtlSec=" + affinityCookieTtlSec + ", " - + "backends=" + backends + ", " - + "cdnPolicy=" + cdnPolicy + ", " - + "connectionDraining=" + connectionDraining + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "enableCDN=" + enableCDN + ", " - + "fingerprint=" + fingerprint + ", " - + "healthChecks=" + healthChecks + ", " - + "iap=" + iap + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "loadBalancingScheme=" + loadBalancingScheme + ", " - + "name=" + name + ", " - + "port=" + port + ", " - + "portName=" + portName + ", " - + "protocol=" + protocol + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "sessionAffinity=" + sessionAffinity + ", " - + "timeoutSec=" + timeoutSec + + "affinityCookieTtlSec=" + + affinityCookieTtlSec + + ", " + + "backends=" + + backends + + ", " + + "cdnPolicy=" + + cdnPolicy + + ", " + + "connectionDraining=" + + connectionDraining + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "enableCDN=" + + enableCDN + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "healthChecks=" + + healthChecks + + ", " + + "iap=" + + iap + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "loadBalancingScheme=" + + loadBalancingScheme + + ", " + + "name=" + + name + + ", " + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "protocol=" + + protocol + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "sessionAffinity=" + + sessionAffinity + + ", " + + "timeoutSec=" + + timeoutSec + "}"; } @@ -810,29 +833,27 @@ public boolean equals(Object o) { } if (o instanceof BackendService) { BackendService that = (BackendService) o; - return - Objects.equals(this.affinityCookieTtlSec, that.getAffinityCookieTtlSec()) && - Objects.equals(this.backends, that.getBackendsList()) && - Objects.equals(this.cdnPolicy, that.getCdnPolicy()) && - Objects.equals(this.connectionDraining, that.getConnectionDraining()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.enableCDN, that.getEnableCDN()) && - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.healthChecks, that.getHealthChecksList()) && - Objects.equals(this.iap, that.getIap()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.portName, that.getPortName()) && - Objects.equals(this.protocol, that.getProtocol()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sessionAffinity, that.getSessionAffinity()) && - Objects.equals(this.timeoutSec, that.getTimeoutSec()) - ; + return Objects.equals(this.affinityCookieTtlSec, that.getAffinityCookieTtlSec()) + && Objects.equals(this.backends, that.getBackendsList()) + && Objects.equals(this.cdnPolicy, that.getCdnPolicy()) + && Objects.equals(this.connectionDraining, that.getConnectionDraining()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.enableCDN, that.getEnableCDN()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.healthChecks, that.getHealthChecksList()) + && Objects.equals(this.iap, that.getIap()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.protocol, that.getProtocol()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sessionAffinity, that.getSessionAffinity()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()); } return false; } @@ -840,27 +861,26 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - affinityCookieTtlSec, - backends, - cdnPolicy, - connectionDraining, - creationTimestamp, - description, - enableCDN, - fingerprint, - healthChecks, - iap, - id, - kind, - loadBalancingScheme, - name, - port, - portName, - protocol, - region, - selfLink, - sessionAffinity, - timeoutSec - ); + affinityCookieTtlSec, + backends, + cdnPolicy, + connectionDraining, + creationTimestamp, + description, + enableCDN, + fingerprint, + healthChecks, + iap, + id, + kind, + loadBalancingScheme, + name, + port, + portName, + protocol, + region, + selfLink, + sessionAffinity, + timeoutSec); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java index 6151ad5637d7..213fd39884fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private BackendServiceAggregatedList() { this.warning = null; } - private BackendServiceAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServiceAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServiceAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServiceAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServiceAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public BackendServiceAggregatedList build() { - - - - - return new BackendServiceAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new BackendServiceAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "BackendServiceAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof BackendServiceAggregatedList) { BackendServiceAggregatedList that = (BackendServiceAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java index 1f76f7aa094a..e00f03c76397 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private BackendServiceCdnPolicy() { this.cacheKeyPolicy = null; } - - private BackendServiceCdnPolicy( - CacheKeyPolicy cacheKeyPolicy - ) { + private BackendServiceCdnPolicy(CacheKeyPolicy cacheKeyPolicy) { this.cacheKeyPolicy = cacheKeyPolicy; } @@ -72,22 +66,24 @@ public CacheKeyPolicy getCacheKeyPolicy() { return cacheKeyPolicy; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServiceCdnPolicy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServiceCdnPolicy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServiceCdnPolicy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServiceCdnPolicy(); } @@ -118,11 +114,8 @@ public Builder setCacheKeyPolicy(CacheKeyPolicy cacheKeyPolicy) { return this; } - public BackendServiceCdnPolicy build() { - return new BackendServiceCdnPolicy( - cacheKeyPolicy - ); + return new BackendServiceCdnPolicy(cacheKeyPolicy); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "BackendServiceCdnPolicy{" - + "cacheKeyPolicy=" + cacheKeyPolicy - + "}"; + return "BackendServiceCdnPolicy{" + "cacheKeyPolicy=" + cacheKeyPolicy + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof BackendServiceCdnPolicy) { BackendServiceCdnPolicy that = (BackendServiceCdnPolicy) o; - return - Objects.equals(this.cacheKeyPolicy, that.getCacheKeyPolicy()) - ; + return Objects.equals(this.cacheKeyPolicy, that.getCacheKeyPolicy()); } return false; } @Override public int hashCode() { - return Objects.hash( - cacheKeyPolicy - ); + return Objects.hash(cacheKeyPolicy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java index 7be6d3256993..7bdfe9a4fe00 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.BackendServiceStub; import com.google.cloud.compute.v1.stub.BackendServiceStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,39 @@ * * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) { * String requestId = ""; - * ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + * ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); * Operation response = backendServiceClient.deleteBackendService(requestId, backendService); * } * *

* *

Note: close() needs to be called on the backendServiceClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of BackendServiceSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class BackendServiceClient implements BackgroundResource {
   private final BackendServiceSettings settings;
   private final BackendServiceStub stub;
 
-
-
-  /**
-   * Constructs an instance of BackendServiceClient with default settings.
-   */
+  /** Constructs an instance of BackendServiceClient with default settings. */
   public static final BackendServiceClient create() throws IOException {
     return create(BackendServiceSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of BackendServiceClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of BackendServiceClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final BackendServiceClient create(BackendServiceSettings settings) throws IOException {
+  public static final BackendServiceClient create(BackendServiceSettings settings)
+      throws IOException {
     return new BackendServiceClient(settings);
   }
 
   /**
-   * Constructs an instance of BackendServiceClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use BackendServiceSettings}.
+   * Constructs an instance of BackendServiceClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use BackendServiceSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final BackendServiceClient create(BackendServiceStub stub) {
@@ -144,9 +129,9 @@ public static final BackendServiceClient create(BackendServiceStub stub) {
   }
 
   /**
-   * Constructs an instance of BackendServiceClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of BackendServiceClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected BackendServiceClient(BackendServiceSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +153,13 @@ public BackendServiceStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of all BackendService resources, regional and global, available to the specified project.
+   * Retrieves the list of all BackendService resources, regional and global, available to the
+   * specified project.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,19 +173,22 @@ public BackendServiceStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(ProjectName project) {
+  public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(
+      ProjectName project) {
     AggregatedListBackendServicesHttpRequest request =
         AggregatedListBackendServicesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListBackendServices(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of all BackendService resources, regional and global, available to the specified project.
+   * Retrieves the list of all BackendService resources, regional and global, available to the
+   * specified project.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -213,19 +202,20 @@ public final AggregatedListBackendServicesPagedResponse aggregatedListBackendSer
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(String project) {
+  public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(
+      String project) {
     AggregatedListBackendServicesHttpRequest request =
-        AggregatedListBackendServicesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListBackendServicesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListBackendServices(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of all BackendService resources, regional and global, available to the specified project.
+   * Retrieves the list of all BackendService resources, regional and global, available to the
+   * specified project.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +232,18 @@ public final AggregatedListBackendServicesPagedResponse aggregatedListBackendSer
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(AggregatedListBackendServicesHttpRequest request) {
-    return aggregatedListBackendServicesPagedCallable()
-        .call(request);
+  public final AggregatedListBackendServicesPagedResponse aggregatedListBackendServices(
+      AggregatedListBackendServicesHttpRequest request) {
+    return aggregatedListBackendServicesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of all BackendService resources, regional and global, available to the specified project.
+   * Retrieves the list of all BackendService resources, regional and global, available to the
+   * specified project.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,15 +259,19 @@ public final AggregatedListBackendServicesPagedResponse aggregatedListBackendSer
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListBackendServicesPagedCallable() { + public final UnaryCallable< + AggregatedListBackendServicesHttpRequest, AggregatedListBackendServicesPagedResponse> + aggregatedListBackendServicesPagedCallable() { return stub.aggregatedListBackendServicesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * Retrieves the list of all BackendService resources, regional and global, available to the + * specified project. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +294,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListBackendServicesCallable() { + public final UnaryCallable + aggregatedListBackendServicesCallable() { return stub.aggregatedListBackendServicesCallable(); } @@ -306,31 +303,37 @@ public final UnaryCallableSample code: + * *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendService(String requestId, ProjectBackendServiceName backendService) { + public final Operation deleteBackendService( + String requestId, ProjectGlobalBackendServiceName backendService) { DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService == null ? null : backendService.toString()) - .build(); + .setRequestId(requestId) + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); return deleteBackendService(request); } @@ -338,20 +341,25 @@ public final Operation deleteBackendService(String requestId, ProjectBackendServ /** * Deletes the specified BackendService resource. * - * Sample code: + *

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -360,9 +368,9 @@ public final Operation deleteBackendService(String requestId, String backendServ DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .build(); + .setRequestId(requestId) + .setBackendService(backendService) + .build(); return deleteBackendService(request); } @@ -370,11 +378,12 @@ public final Operation deleteBackendService(String requestId, String backendServ /** * Deletes the specified BackendService resource. * - * Sample code: + *

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
@@ -395,11 +404,12 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ
   /**
    * Deletes the specified BackendService resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
@@ -411,18 +421,21 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable deleteBackendServiceCallable() { + public final UnaryCallable + deleteBackendServiceCallable() { return stub.deleteBackendServiceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * Returns the specified BackendService resource. Get a list of available backend services by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService response = backendServiceClient.getBackendService(backendService);
    * }
    * 
@@ -431,23 +444,25 @@ public final UnaryCallable deleteBac * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final BackendService getBackendService(ProjectBackendServiceName backendService) { + public final BackendService getBackendService(ProjectGlobalBackendServiceName backendService) { GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder() - .setBackendService(backendService == null ? null : backendService.toString()) - .build(); + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); return getBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * Returns the specified BackendService resource. Get a list of available backend services by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService response = backendServiceClient.getBackendService(backendService.toString());
    * }
    * 
@@ -459,20 +474,20 @@ public final BackendService getBackendService(ProjectBackendServiceName backendS public final BackendService getBackendService(String backendService) { GetBackendServiceHttpRequest request = - GetBackendServiceHttpRequest.newBuilder() - .setBackendService(backendService) - .build(); + GetBackendServiceHttpRequest.newBuilder().setBackendService(backendService).build(); return getBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by making a list() request. + * Returns the specified BackendService resource. Get a list of available backend services by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
    *     .build();
@@ -490,12 +505,14 @@ public final BackendService getBackendService(GetBackendServiceHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified BackendService resource. Get a list of available backend services by making a list() request.
+   * Returns the specified BackendService resource. Get a list of available backend services by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   GetBackendServiceHttpRequest request = GetBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
    *     .build();
@@ -506,7 +523,8 @@ public final BackendService getBackendService(GetBackendServiceHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getBackendServiceCallable() { + public final UnaryCallable + getBackendServiceCallable() { return stub.getBackendServiceCallable(); } @@ -514,27 +532,31 @@ public final UnaryCallable getBack /** * Gets the most recent health check results for this BackendService. * - * Sample code: + *

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(backendService, resourceGroupReferenceResource);
    * }
    * 
* - * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param backendService Name of the BackendService resource to which the queried instance + * belongs. * @param resourceGroupReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final BackendServiceGroupHealth getHealthBackendService(ProjectBackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource) { + public final BackendServiceGroupHealth getHealthBackendService( + ProjectGlobalBackendServiceName backendService, + ResourceGroupReference resourceGroupReferenceResource) { GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder() - .setBackendService(backendService == null ? null : backendService.toString()) - .setResourceGroupReferenceResource(resourceGroupReferenceResource) - .build(); + .setBackendService(backendService == null ? null : backendService.toString()) + .setResourceGroupReferenceResource(resourceGroupReferenceResource) + .build(); return getHealthBackendService(request); } @@ -542,27 +564,30 @@ public final BackendServiceGroupHealth getHealthBackendService(ProjectBackendSer /** * Gets the most recent health check results for this BackendService. * - * Sample code: + *

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   BackendServiceGroupHealth response = backendServiceClient.getHealthBackendService(backendService.toString(), resourceGroupReferenceResource);
    * }
    * 
* - * @param backendService Name of the BackendService resource to which the queried instance belongs. + * @param backendService Name of the BackendService resource to which the queried instance + * belongs. * @param resourceGroupReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final BackendServiceGroupHealth getHealthBackendService(String backendService, ResourceGroupReference resourceGroupReferenceResource) { + public final BackendServiceGroupHealth getHealthBackendService( + String backendService, ResourceGroupReference resourceGroupReferenceResource) { GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder() - .setBackendService(backendService) - .setResourceGroupReferenceResource(resourceGroupReferenceResource) - .build(); + .setBackendService(backendService) + .setResourceGroupReferenceResource(resourceGroupReferenceResource) + .build(); return getHealthBackendService(request); } @@ -570,10 +595,11 @@ public final BackendServiceGroupHealth getHealthBackendService(String backendSer /** * Gets the most recent health check results for this BackendService. * - * Sample code: + *

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
@@ -587,7 +613,8 @@ public final BackendServiceGroupHealth getHealthBackendService(String backendSer
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final BackendServiceGroupHealth getHealthBackendService(GetHealthBackendServiceHttpRequest request) {
+  public final BackendServiceGroupHealth getHealthBackendService(
+      GetHealthBackendServiceHttpRequest request) {
     return getHealthBackendServiceCallable().call(request);
   }
 
@@ -595,10 +622,11 @@ public final BackendServiceGroupHealth getHealthBackendService(GetHealthBackendS
   /**
    * Gets the most recent health check results for this BackendService.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
    *   GetHealthBackendServiceHttpRequest request = GetHealthBackendServiceHttpRequest.newBuilder()
    *     .setBackendService(backendService.toString())
@@ -611,15 +639,19 @@ public final BackendServiceGroupHealth getHealthBackendService(GetHealthBackendS
    * 
*/ @BetaApi - public final UnaryCallable getHealthBackendServiceCallable() { + public final UnaryCallable + getHealthBackendServiceCallable() { return stub.getHealthBackendServiceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * Creates a BackendService resource in the specified project using the data included in the + * request. There are several restrictions and guidelines to keep in mind when creating a backend + * service. Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
@@ -629,32 +661,42 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendService(String requestId, ProjectName project, BackendService backendServiceResource) { + public final Operation insertBackendService( + String requestId, ProjectName project, BackendService backendServiceResource) { InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); return insertBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * Creates a BackendService resource in the specified project using the data included in the + * request. There are several restrictions and guidelines to keep in mind when creating a backend + * service. Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
@@ -664,32 +706,42 @@ public final Operation insertBackendService(String requestId, ProjectName projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendService(String requestId, String project, BackendService backendServiceResource) { + public final Operation insertBackendService( + String requestId, String project, BackendService backendServiceResource) { InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setBackendServiceResource(backendServiceResource) + .build(); return insertBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + * Creates a BackendService resource in the specified project using the data included in the + * request. There are several restrictions and guidelines to keep in mind when creating a backend + * service. Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
@@ -714,9 +766,12 @@ public final Operation insertBackendService(InsertBackendServiceHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read  Restrictions and Guidelines for more information.
+   * Creates a BackendService resource in the specified project using the data included in the
+   * request. There are several restrictions and guidelines to keep in mind when creating a backend
+   * service. Read Restrictions and Guidelines for more information.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
@@ -734,7 +789,8 @@ public final Operation insertBackendService(InsertBackendServiceHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable insertBackendServiceCallable() { + public final UnaryCallable + insertBackendServiceCallable() { return stub.insertBackendServiceCallable(); } @@ -742,7 +798,8 @@ public final UnaryCallable insertBac /** * Retrieves the list of BackendService resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -759,8 +816,8 @@ public final UnaryCallable insertBac
   public final ListBackendServicesPagedResponse listBackendServices(ProjectName project) {
     ListBackendServicesHttpRequest request =
         ListBackendServicesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listBackendServices(request);
   }
 
@@ -768,7 +825,8 @@ public final ListBackendServicesPagedResponse listBackendServices(ProjectName pr
   /**
    * Retrieves the list of BackendService resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -784,9 +842,7 @@ public final ListBackendServicesPagedResponse listBackendServices(ProjectName pr
   @BetaApi
   public final ListBackendServicesPagedResponse listBackendServices(String project) {
     ListBackendServicesHttpRequest request =
-        ListBackendServicesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListBackendServicesHttpRequest.newBuilder().setProject(project).build();
     return listBackendServices(request);
   }
 
@@ -794,7 +850,8 @@ public final ListBackendServicesPagedResponse listBackendServices(String project
   /**
    * Retrieves the list of BackendService resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -811,16 +868,17 @@ public final ListBackendServicesPagedResponse listBackendServices(String project
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListBackendServicesPagedResponse listBackendServices(ListBackendServicesHttpRequest request) {
-    return listBackendServicesPagedCallable()
-        .call(request);
+  public final ListBackendServicesPagedResponse listBackendServices(
+      ListBackendServicesHttpRequest request) {
+    return listBackendServicesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of BackendService resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -836,7 +894,8 @@ public final ListBackendServicesPagedResponse listBackendServices(ListBackendSer
    * 
*/ @BetaApi - public final UnaryCallable listBackendServicesPagedCallable() { + public final UnaryCallable + listBackendServicesPagedCallable() { return stub.listBackendServicesPagedCallable(); } @@ -844,7 +903,8 @@ public final UnaryCallableSample code: + * *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -867,89 +927,118 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listBackendServicesCallable() { + public final UnaryCallable + listBackendServicesCallable() { return stub.listBackendServicesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * Patches the specified BackendService resource with the data included in the request. There are + * several restrictions and guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.patchBackendService(requestId, backendService, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchBackendService(String requestId, ProjectBackendServiceName backendService, BackendService backendServiceResource) { + public final Operation patchBackendService( + String requestId, + ProjectGlobalBackendServiceName backendService, + BackendService backendServiceResource) { PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService == null ? null : backendService.toString()) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); return patchBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * Patches the specified BackendService resource with the data included in the request. There are + * several restrictions and guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.patchBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchBackendService(String requestId, String backendService, BackendService backendServiceResource) { + public final Operation patchBackendService( + String requestId, String backendService, BackendService backendServiceResource) { PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); return patchBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * Patches the specified BackendService resource with the data included in the request. There are + * several restrictions and guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -970,13 +1059,17 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
+   * Patches the specified BackendService resource with the data included in the request. There are
+   * several restrictions and guidelines to keep in mind when updating a backend service. Read
+   * Restrictions and Guidelines for more information. This method supports PATCH semantics and uses
+   * the JSON merge patch format and processing rules.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -990,89 +1083,115 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable patchBackendServiceCallable() { + public final UnaryCallable + patchBackendServiceCallable() { return stub.patchBackendServiceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * Updates the specified BackendService resource with the data included in the request. There are + * several restrictions and guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.updateBackendService(requestId, backendService, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateBackendService(String requestId, ProjectBackendServiceName backendService, BackendService backendServiceResource) { + public final Operation updateBackendService( + String requestId, + ProjectGlobalBackendServiceName backendService, + BackendService backendServiceResource) { UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService == null ? null : backendService.toString()) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); return updateBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * Updates the specified BackendService resource with the data included in the request. There are + * several restrictions and guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   Operation response = backendServiceClient.updateBackendService(requestId, backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateBackendService(String requestId, String backendService, BackendService backendServiceResource) { + public final Operation updateBackendService( + String requestId, String backendService, BackendService backendServiceResource) { UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); return updateBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * Updates the specified BackendService resource with the data included in the request. There are + * several restrictions and guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1093,13 +1212,16 @@ public final Operation updateBackendService(UpdateBackendServiceHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information.
+   * Updates the specified BackendService resource with the data included in the request. There are
+   * several restrictions and guidelines to keep in mind when updating a backend service. Read
+   * Restrictions and Guidelines for more information.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
    *   String requestId = "";
-   *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -1113,12 +1235,13 @@ public final Operation updateBackendService(UpdateBackendServiceHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable updateBackendServiceCallable() { + public final UnaryCallable + updateBackendServiceCallable() { return stub.updateBackendServiceCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1147,23 +1270,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListBackendServicesPagedResponse extends AbstractPagedListResponse< - AggregatedListBackendServicesHttpRequest, - BackendServiceAggregatedList, - BackendServicesScopedList, - AggregatedListBackendServicesPage, - AggregatedListBackendServicesFixedSizeCollection> { + public static class AggregatedListBackendServicesPagedResponse + extends AbstractPagedListResponse< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList, AggregatedListBackendServicesPage, + AggregatedListBackendServicesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListBackendServicesPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListBackendServicesPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListBackendServicesPage, AggregatedListBackendServicesPagedResponse>() { @Override - public AggregatedListBackendServicesPagedResponse apply(AggregatedListBackendServicesPage input) { + public AggregatedListBackendServicesPagedResponse apply( + AggregatedListBackendServicesPage input) { return new AggregatedListBackendServicesPagedResponse(input); } }); @@ -1172,18 +1300,18 @@ public AggregatedListBackendServicesPagedResponse apply(AggregatedListBackendSer private AggregatedListBackendServicesPagedResponse(AggregatedListBackendServicesPage page) { super(page, AggregatedListBackendServicesFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListBackendServicesPage extends AbstractPage< - AggregatedListBackendServicesHttpRequest, - BackendServiceAggregatedList, - BackendServicesScopedList, - AggregatedListBackendServicesPage> { + public static class AggregatedListBackendServicesPage + extends AbstractPage< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList, AggregatedListBackendServicesPage> { private AggregatedListBackendServicesPage( - PageContext context, + PageContext< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList> + context, BackendServiceAggregatedList response) { super(context, response); } @@ -1194,31 +1322,33 @@ private static AggregatedListBackendServicesPage createEmptyPage() { @Override protected AggregatedListBackendServicesPage createPage( - PageContext context, + PageContext< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList> + context, BackendServiceAggregatedList response) { return new AggregatedListBackendServicesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListBackendServicesFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListBackendServicesHttpRequest, - BackendServiceAggregatedList, - BackendServicesScopedList, - AggregatedListBackendServicesPage, - AggregatedListBackendServicesFixedSizeCollection> { + public static class AggregatedListBackendServicesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + BackendServicesScopedList, AggregatedListBackendServicesPage, + AggregatedListBackendServicesFixedSizeCollection> { - private AggregatedListBackendServicesFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListBackendServicesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1231,15 +1361,12 @@ protected AggregatedListBackendServicesFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListBackendServicesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListBackendServicesPagedResponse extends AbstractPagedListResponse< - ListBackendServicesHttpRequest, - BackendServiceList, - BackendService, - ListBackendServicesPage, - ListBackendServicesFixedSizeCollection> { + + public static class ListBackendServicesPagedResponse + extends AbstractPagedListResponse< + ListBackendServicesHttpRequest, BackendServiceList, BackendService, + ListBackendServicesPage, ListBackendServicesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1259,15 +1386,12 @@ public ListBackendServicesPagedResponse apply(ListBackendServicesPage input) { private ListBackendServicesPagedResponse(ListBackendServicesPage page) { super(page, ListBackendServicesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListBackendServicesPage extends AbstractPage< - ListBackendServicesHttpRequest, - BackendServiceList, - BackendService, - ListBackendServicesPage> { + public static class ListBackendServicesPage + extends AbstractPage< + ListBackendServicesHttpRequest, BackendServiceList, BackendService, + ListBackendServicesPage> { private ListBackendServicesPage( PageContext context, @@ -1292,20 +1416,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListBackendServicesFixedSizeCollection extends AbstractFixedSizeCollection< - ListBackendServicesHttpRequest, - BackendServiceList, - BackendService, - ListBackendServicesPage, - ListBackendServicesFixedSizeCollection> { + public static class ListBackendServicesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackendServicesHttpRequest, BackendServiceList, BackendService, + ListBackendServicesPage, ListBackendServicesFixedSizeCollection> { - private ListBackendServicesFixedSizeCollection(List pages, int collectionSize) { + private ListBackendServicesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1318,7 +1437,5 @@ protected ListBackendServicesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListBackendServicesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java index 7ef040b63790..28ff6b520dff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private BackendServiceGroupHealth() { this.kind = null; } - - private BackendServiceGroupHealth( - List healthStatus, - String kind - ) { + private BackendServiceGroupHealth(List healthStatus, String kind) { this.healthStatus = healthStatus; this.kind = kind; } @@ -90,22 +85,24 @@ public String getKind() { return kind; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServiceGroupHealth prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServiceGroupHealth getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServiceGroupHealth DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServiceGroupHealth(); } @@ -158,13 +155,9 @@ public Builder setKind(String kind) { return this; } - public BackendServiceGroupHealth build() { - return new BackendServiceGroupHealth( - healthStatus, - kind - ); + return new BackendServiceGroupHealth(healthStatus, kind); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "BackendServiceGroupHealth{" - + "healthStatus=" + healthStatus + ", " - + "kind=" + kind + + "healthStatus=" + + healthStatus + + ", " + + "kind=" + + kind + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof BackendServiceGroupHealth) { BackendServiceGroupHealth that = (BackendServiceGroupHealth) o; - return - Objects.equals(this.healthStatus, that.getHealthStatusList()) && - Objects.equals(this.kind, that.getKind()) - ; + return Objects.equals(this.healthStatus, that.getHealthStatusList()) + && Objects.equals(this.kind, that.getKind()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthStatus, - kind - ); + return Objects.hash(healthStatus, kind); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java index 013bf76fda03..5dc77ed986f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,13 +41,11 @@ private BackendServiceIAP() { this.oauth2ClientSecretSha256 = null; } - private BackendServiceIAP( Boolean enabled, String oauth2ClientId, String oauth2ClientSecret, - String oauth2ClientSecretSha256 - ) { + String oauth2ClientSecretSha256) { this.enabled = enabled; this.oauth2ClientId = oauth2ClientId; this.oauth2ClientSecret = oauth2ClientSecret; @@ -67,10 +62,13 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("oauth2ClientId", Collections.singletonList(String.valueOf(oauth2ClientId))); } if (fieldNames.contains("oauth2ClientSecret") && oauth2ClientSecret != null) { - fieldMap.put("oauth2ClientSecret", Collections.singletonList(String.valueOf(oauth2ClientSecret))); + fieldMap.put( + "oauth2ClientSecret", Collections.singletonList(String.valueOf(oauth2ClientSecret))); } if (fieldNames.contains("oauth2ClientSecretSha256") && oauth2ClientSecretSha256 != null) { - fieldMap.put("oauth2ClientSecretSha256", Collections.singletonList(String.valueOf(oauth2ClientSecretSha256))); + fieldMap.put( + "oauth2ClientSecretSha256", + Collections.singletonList(String.valueOf(oauth2ClientSecretSha256))); } return fieldMap; } @@ -114,22 +112,24 @@ public String getOauth2ClientSecretSha256() { return oauth2ClientSecretSha256; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServiceIAP prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServiceIAP getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServiceIAP DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServiceIAP(); } @@ -202,17 +202,10 @@ public Builder setOauth2ClientSecretSha256(String oauth2ClientSecretSha256) { return this; } - public BackendServiceIAP build() { - - return new BackendServiceIAP( - enabled, - oauth2ClientId, - oauth2ClientSecret, - oauth2ClientSecretSha256 - ); + enabled, oauth2ClientId, oauth2ClientSecret, oauth2ClientSecretSha256); } public Builder clone() { @@ -228,10 +221,17 @@ public Builder clone() { @Override public String toString() { return "BackendServiceIAP{" - + "enabled=" + enabled + ", " - + "oauth2ClientId=" + oauth2ClientId + ", " - + "oauth2ClientSecret=" + oauth2ClientSecret + ", " - + "oauth2ClientSecretSha256=" + oauth2ClientSecretSha256 + + "enabled=" + + enabled + + ", " + + "oauth2ClientId=" + + oauth2ClientId + + ", " + + "oauth2ClientSecret=" + + oauth2ClientSecret + + ", " + + "oauth2ClientSecretSha256=" + + oauth2ClientSecretSha256 + "}"; } @@ -242,23 +242,16 @@ public boolean equals(Object o) { } if (o instanceof BackendServiceIAP) { BackendServiceIAP that = (BackendServiceIAP) o; - return - Objects.equals(this.enabled, that.getEnabled()) && - Objects.equals(this.oauth2ClientId, that.getOauth2ClientId()) && - Objects.equals(this.oauth2ClientSecret, that.getOauth2ClientSecret()) && - Objects.equals(this.oauth2ClientSecretSha256, that.getOauth2ClientSecretSha256()) - ; + return Objects.equals(this.enabled, that.getEnabled()) + && Objects.equals(this.oauth2ClientId, that.getOauth2ClientId()) + && Objects.equals(this.oauth2ClientSecret, that.getOauth2ClientSecret()) + && Objects.equals(this.oauth2ClientSecretSha256, that.getOauth2ClientSecretSha256()); } return false; } @Override public int hashCode() { - return Objects.hash( - enabled, - oauth2ClientId, - oauth2ClientSecret, - oauth2ClientSecretSha256 - ); + return Objects.hash(enabled, oauth2ClientId, oauth2ClientSecret, oauth2ClientSecretSha256); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java index c70811d88f1e..3f6c7a98681c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private BackendServiceList() { this.warning = null; } - private BackendServiceList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServiceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServiceList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServiceList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServiceList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public BackendServiceList build() { - - - - - return new BackendServiceList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new BackendServiceList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "BackendServiceList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof BackendServiceList) { BackendServiceList that = (BackendServiceList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java index f91f156010a5..23e8c5e4fd55 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; import com.google.cloud.compute.v1.stub.BackendServiceStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteBackendService to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteBackendService to 30 seconds: * *

  * 
@@ -86,105 +64,89 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class BackendServiceSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListBackendServices.
-   */
-  public PagedCallSettings aggregatedListBackendServicesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListBackendServices. */
+  public PagedCallSettings<
+          AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+          AggregatedListBackendServicesPagedResponse>
+      aggregatedListBackendServicesSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).aggregatedListBackendServicesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteBackendService.
-   */
-  public UnaryCallSettings deleteBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to deleteBackendService. */
+  public UnaryCallSettings
+      deleteBackendServiceSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).deleteBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getBackendService.
-   */
-  public UnaryCallSettings getBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getBackendService. */
+  public UnaryCallSettings
+      getBackendServiceSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).getBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthBackendService.
-   */
-  public UnaryCallSettings getHealthBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getHealthBackendService. */
+  public UnaryCallSettings
+      getHealthBackendServiceSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).getHealthBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertBackendService.
-   */
-  public UnaryCallSettings insertBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to insertBackendService. */
+  public UnaryCallSettings
+      insertBackendServiceSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).insertBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listBackendServices.
-   */
-  public PagedCallSettings listBackendServicesSettings() {
+  /** Returns the object with the settings used for calls to listBackendServices. */
+  public PagedCallSettings<
+          ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse>
+      listBackendServicesSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).listBackendServicesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchBackendService.
-   */
-  public UnaryCallSettings patchBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to patchBackendService. */
+  public UnaryCallSettings
+      patchBackendServiceSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).patchBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateBackendService.
-   */
-  public UnaryCallSettings updateBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to updateBackendService. */
+  public UnaryCallSettings
+      updateBackendServiceSettings() {
     return ((BackendServiceStubSettings) getStubSettings()).updateBackendServiceSettings();
   }
 
-
-  public static final BackendServiceSettings create(BackendServiceStubSettings stub) throws IOException {
+  public static final BackendServiceSettings create(BackendServiceStubSettings stub)
+      throws IOException {
     return new BackendServiceSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return BackendServiceStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return BackendServiceStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return BackendServiceStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return BackendServiceStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return BackendServiceStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return BackendServiceStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return BackendServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -197,23 +159,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return BackendServiceStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -222,9 +178,7 @@ protected BackendServiceSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for BackendServiceSettings.
-   */
+  /** Builder for BackendServiceSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -246,74 +200,71 @@ protected Builder(BackendServiceStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public BackendServiceStubSettings.Builder getStubSettingsBuilder() {
       return ((BackendServiceStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListBackendServices. - */ - public PagedCallSettings.Builder aggregatedListBackendServicesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListBackendServices. */ + public PagedCallSettings.Builder< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + AggregatedListBackendServicesPagedResponse> + aggregatedListBackendServicesSettings() { return getStubSettingsBuilder().aggregatedListBackendServicesSettings(); } - /** - * Returns the builder for the settings used for calls to deleteBackendService. - */ - public UnaryCallSettings.Builder deleteBackendServiceSettings() { + /** Returns the builder for the settings used for calls to deleteBackendService. */ + public UnaryCallSettings.Builder + deleteBackendServiceSettings() { return getStubSettingsBuilder().deleteBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to getBackendService. - */ - public UnaryCallSettings.Builder getBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getBackendService. */ + public UnaryCallSettings.Builder + getBackendServiceSettings() { return getStubSettingsBuilder().getBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to getHealthBackendService. - */ - public UnaryCallSettings.Builder getHealthBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getHealthBackendService. */ + public UnaryCallSettings.Builder + getHealthBackendServiceSettings() { return getStubSettingsBuilder().getHealthBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to insertBackendService. - */ - public UnaryCallSettings.Builder insertBackendServiceSettings() { + /** Returns the builder for the settings used for calls to insertBackendService. */ + public UnaryCallSettings.Builder + insertBackendServiceSettings() { return getStubSettingsBuilder().insertBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to listBackendServices. - */ - public PagedCallSettings.Builder listBackendServicesSettings() { + /** Returns the builder for the settings used for calls to listBackendServices. */ + public PagedCallSettings.Builder< + ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse> + listBackendServicesSettings() { return getStubSettingsBuilder().listBackendServicesSettings(); } - /** - * Returns the builder for the settings used for calls to patchBackendService. - */ - public UnaryCallSettings.Builder patchBackendServiceSettings() { + /** Returns the builder for the settings used for calls to patchBackendService. */ + public UnaryCallSettings.Builder + patchBackendServiceSettings() { return getStubSettingsBuilder().patchBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to updateBackendService. - */ - public UnaryCallSettings.Builder updateBackendServiceSettings() { + /** Returns the builder for the settings used for calls to updateBackendService. */ + public UnaryCallSettings.Builder + updateBackendServiceSettings() { return getStubSettingsBuilder().updateBackendServiceSettings(); } @@ -322,4 +273,4 @@ public BackendServiceSettings build() throws IOException { return new BackendServiceSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java index 563b74fc4894..0d964ea5d92d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private BackendServicesScopedList() { this.warning = null; } - - private BackendServicesScopedList( - List backendServices, - Warning warning - ) { + private BackendServicesScopedList(List backendServices, Warning warning) { this.backendServices = backendServices; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(BackendServicesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static BackendServicesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final BackendServicesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new BackendServicesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public BackendServicesScopedList build() { - return new BackendServicesScopedList( - backendServices, - warning - ); + return new BackendServicesScopedList(backendServices, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "BackendServicesScopedList{" - + "backendServices=" + backendServices + ", " - + "warning=" + warning + + "backendServices=" + + backendServices + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof BackendServicesScopedList) { BackendServicesScopedList that = (BackendServicesScopedList) o; - return - Objects.equals(this.backendServices, that.getBackendServicesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.backendServices, that.getBackendServicesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - backendServices, - warning - ); + return Objects.hash(backendServices, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java index 67e5ce2ffbb5..0a8d49d8c913 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private CacheInvalidationRule() { this.path = null; } - - private CacheInvalidationRule( - String host, - String path - ) { + private CacheInvalidationRule(String host, String path) { this.host = host; this.path = path; } @@ -86,22 +79,24 @@ public String getPath() { return path; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CacheInvalidationRule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CacheInvalidationRule getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CacheInvalidationRule DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CacheInvalidationRule(); } @@ -146,13 +141,9 @@ public Builder setPath(String path) { return this; } - public CacheInvalidationRule build() { - return new CacheInvalidationRule( - host, - path - ); + return new CacheInvalidationRule(host, path); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "CacheInvalidationRule{" - + "host=" + host + ", " - + "path=" + path - + "}"; + return "CacheInvalidationRule{" + "host=" + host + ", " + "path=" + path + "}"; } @Override @@ -178,19 +166,13 @@ public boolean equals(Object o) { } if (o instanceof CacheInvalidationRule) { CacheInvalidationRule that = (CacheInvalidationRule) o; - return - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.path, that.getPath()) - ; + return Objects.equals(this.host, that.getHost()) && Objects.equals(this.path, that.getPath()); } return false; } @Override public int hashCode() { - return Objects.hash( - host, - path - ); + return Objects.hash(host, path); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java index 81eedc4f6f44..521b6a093360 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -46,14 +45,12 @@ private CacheKeyPolicy() { this.queryStringWhitelist = null; } - private CacheKeyPolicy( Boolean includeHost, Boolean includeProtocol, Boolean includeQueryString, List queryStringBlacklist, - List queryStringWhitelist - ) { + List queryStringWhitelist) { this.includeHost = includeHost; this.includeProtocol = includeProtocol; this.includeQueryString = includeQueryString; @@ -71,7 +68,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("includeProtocol", Collections.singletonList(String.valueOf(includeProtocol))); } if (fieldNames.contains("includeQueryString") && includeQueryString != null) { - fieldMap.put("includeQueryString", Collections.singletonList(String.valueOf(includeQueryString))); + fieldMap.put( + "includeQueryString", Collections.singletonList(String.valueOf(includeQueryString))); } if (fieldNames.contains("queryStringBlacklist") && queryStringBlacklist != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -136,22 +134,24 @@ public List getQueryStringWhitelistList() { return queryStringWhitelist; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CacheKeyPolicy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CacheKeyPolicy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CacheKeyPolicy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CacheKeyPolicy(); } @@ -254,19 +254,14 @@ public Builder addQueryStringWhitelist(String queryStringWhitelist) { return this; } - public CacheKeyPolicy build() { - - - return new CacheKeyPolicy( - includeHost, - includeProtocol, - includeQueryString, - queryStringBlacklist, - queryStringWhitelist - ); + includeHost, + includeProtocol, + includeQueryString, + queryStringBlacklist, + queryStringWhitelist); } public Builder clone() { @@ -283,11 +278,20 @@ public Builder clone() { @Override public String toString() { return "CacheKeyPolicy{" - + "includeHost=" + includeHost + ", " - + "includeProtocol=" + includeProtocol + ", " - + "includeQueryString=" + includeQueryString + ", " - + "queryStringBlacklist=" + queryStringBlacklist + ", " - + "queryStringWhitelist=" + queryStringWhitelist + + "includeHost=" + + includeHost + + ", " + + "includeProtocol=" + + includeProtocol + + ", " + + "includeQueryString=" + + includeQueryString + + ", " + + "queryStringBlacklist=" + + queryStringBlacklist + + ", " + + "queryStringWhitelist=" + + queryStringWhitelist + "}"; } @@ -298,13 +302,11 @@ public boolean equals(Object o) { } if (o instanceof CacheKeyPolicy) { CacheKeyPolicy that = (CacheKeyPolicy) o; - return - Objects.equals(this.includeHost, that.getIncludeHost()) && - Objects.equals(this.includeProtocol, that.getIncludeProtocol()) && - Objects.equals(this.includeQueryString, that.getIncludeQueryString()) && - Objects.equals(this.queryStringBlacklist, that.getQueryStringBlacklistList()) && - Objects.equals(this.queryStringWhitelist, that.getQueryStringWhitelistList()) - ; + return Objects.equals(this.includeHost, that.getIncludeHost()) + && Objects.equals(this.includeProtocol, that.getIncludeProtocol()) + && Objects.equals(this.includeQueryString, that.getIncludeQueryString()) + && Objects.equals(this.queryStringBlacklist, that.getQueryStringBlacklistList()) + && Objects.equals(this.queryStringWhitelist, that.getQueryStringWhitelistList()); } return false; } @@ -312,11 +314,10 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - includeHost, - includeProtocol, - includeQueryString, - queryStringBlacklist, - queryStringWhitelist - ); + includeHost, + includeProtocol, + includeQueryString, + queryStringBlacklist, + queryStringWhitelist); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java index 4bd7e140b597..5bd07d7e5efd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -62,7 +61,6 @@ private Commitment() { this.statusMessage = null; } - private Commitment( String creationTimestamp, String description, @@ -76,8 +74,7 @@ private Commitment( String selfLink, String startTimestamp, String status, - String statusMessage - ) { + String statusMessage) { this.creationTimestamp = creationTimestamp; this.description = description; this.endTimestamp = endTimestamp; @@ -97,7 +94,8 @@ private Commitment( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -244,22 +242,24 @@ public String getStatusMessage() { return statusMessage; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Commitment prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Commitment getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Commitment DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Commitment(); } @@ -466,35 +466,22 @@ public Builder setStatusMessage(String statusMessage) { return this; } - public Commitment build() { - - - - - - - - - - - return new Commitment( - creationTimestamp, - description, - endTimestamp, - id, - kind, - name, - plan, - region, - resources, - selfLink, - startTimestamp, - status, - statusMessage - ); + creationTimestamp, + description, + endTimestamp, + id, + kind, + name, + plan, + region, + resources, + selfLink, + startTimestamp, + status, + statusMessage); } public Builder clone() { @@ -519,19 +506,44 @@ public Builder clone() { @Override public String toString() { return "Commitment{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "endTimestamp=" + endTimestamp + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "plan=" + plan + ", " - + "region=" + region + ", " - + "resources=" + resources + ", " - + "selfLink=" + selfLink + ", " - + "startTimestamp=" + startTimestamp + ", " - + "status=" + status + ", " - + "statusMessage=" + statusMessage + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "endTimestamp=" + + endTimestamp + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "plan=" + + plan + + ", " + + "region=" + + region + + ", " + + "resources=" + + resources + + ", " + + "selfLink=" + + selfLink + + ", " + + "startTimestamp=" + + startTimestamp + + ", " + + "status=" + + status + + ", " + + "statusMessage=" + + statusMessage + "}"; } @@ -542,21 +554,19 @@ public boolean equals(Object o) { } if (o instanceof Commitment) { Commitment that = (Commitment) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.endTimestamp, that.getEndTimestamp()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.plan, that.getPlan()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.resources, that.getResourcesList()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.startTimestamp, that.getStartTimestamp()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.statusMessage, that.getStatusMessage()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.endTimestamp, that.getEndTimestamp()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.plan, that.getPlan()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.resources, that.getResourcesList()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.startTimestamp, that.getStartTimestamp()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.statusMessage, that.getStatusMessage()); } return false; } @@ -564,19 +574,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - endTimestamp, - id, - kind, - name, - plan, - region, - resources, - selfLink, - startTimestamp, - status, - statusMessage - ); + creationTimestamp, + description, + endTimestamp, + id, + kind, + name, + plan, + region, + resources, + selfLink, + startTimestamp, + status, + statusMessage); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java index a1bbaad81b57..0a9cf4e5b86b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private CommitmentAggregatedList() { this.warning = null; } - private CommitmentAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CommitmentAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CommitmentAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CommitmentAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CommitmentAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public CommitmentAggregatedList build() { - - - - - return new CommitmentAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new CommitmentAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "CommitmentAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof CommitmentAggregatedList) { CommitmentAggregatedList that = (CommitmentAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java index a23f84d786b4..c67292729f6c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private CommitmentList() { this.warning = null; } - private CommitmentList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CommitmentList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CommitmentList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CommitmentList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CommitmentList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public CommitmentList build() { - - - - - return new CommitmentList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new CommitmentList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "CommitmentList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof CommitmentList) { CommitmentList that = (CommitmentList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java deleted file mode 100644 index 6fe4360657f2..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class CommitmentName implements com.google.api.resourcenames.ResourceName { - private final String commitment; - private final String project; - private final String region; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/commitments/{commitment}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private CommitmentName(Builder builder) { - commitment = Preconditions.checkNotNull(builder.getCommitment()); - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - } - - public static CommitmentName of( - String commitment, - String project, - String region - ) { - return newBuilder() - .setCommitment(commitment) - .setProject(project) - .setRegion(region) - .build(); - } - - public static String format( - String commitment, - String project, - String region - ) { - return of( - commitment, - project, - region - ) - .toString(); - } - - public String getCommitment() { - return commitment; - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("commitment", commitment); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public CommitmentName parse(String formattedString) {return CommitmentName.parse(formattedString);} - }; - } - - public static CommitmentName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "CommitmentName.parse: formattedString not in valid format"); - return of( - matchMap.get("commitment"), - matchMap.get("project"), - matchMap.get("region") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String commitment; - private String project; - private String region; - - public String getCommitment() { - return commitment; - } - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - - public Builder setCommitment(String commitment) { - this.commitment = commitment; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - - private Builder() {} - - public Builder (CommitmentName commitmentName) { - commitment = commitmentName.commitment; - project = commitmentName.project; - region = commitmentName.region; - } - - public CommitmentName build() { - return new CommitmentName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "commitment", commitment, - "project", project, - "region", region - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof CommitmentName) { - CommitmentName that = (CommitmentName) o; - return - Objects.equals(this.commitment, that.getCommitment()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - commitment, - project, - region - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java index de67bb7df8f7..ae7cb02bbbfc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private CommitmentsScopedList() { this.warning = null; } - - private CommitmentsScopedList( - List commitments, - Warning warning - ) { + private CommitmentsScopedList(List commitments, Warning warning) { this.commitments = commitments; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CommitmentsScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CommitmentsScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CommitmentsScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CommitmentsScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public CommitmentsScopedList build() { - return new CommitmentsScopedList( - commitments, - warning - ); + return new CommitmentsScopedList(commitments, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "CommitmentsScopedList{" - + "commitments=" + commitments + ", " - + "warning=" + warning + + "commitments=" + + commitments + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof CommitmentsScopedList) { CommitmentsScopedList that = (CommitmentsScopedList) o; - return - Objects.equals(this.commitments, that.getCommitmentsList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.commitments, that.getCommitmentsList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - commitments, - warning - ); + return Objects.hash(commitments, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java index e0a09e5c5865..1f6c0b898838 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ConnectionDraining() { this.drainingTimeoutSec = null; } - - private ConnectionDraining( - Integer drainingTimeoutSec - ) { + private ConnectionDraining(Integer drainingTimeoutSec) { this.drainingTimeoutSec = drainingTimeoutSec; } @@ -49,7 +43,8 @@ private ConnectionDraining( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("drainingTimeoutSec") && drainingTimeoutSec != null) { - fieldMap.put("drainingTimeoutSec", Collections.singletonList(String.valueOf(drainingTimeoutSec))); + fieldMap.put( + "drainingTimeoutSec", Collections.singletonList(String.valueOf(drainingTimeoutSec))); } return fieldMap; } @@ -72,22 +67,24 @@ public Integer getDrainingTimeoutSec() { return drainingTimeoutSec; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ConnectionDraining prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ConnectionDraining getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ConnectionDraining DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ConnectionDraining(); } @@ -118,11 +115,8 @@ public Builder setDrainingTimeoutSec(Integer drainingTimeoutSec) { return this; } - public ConnectionDraining build() { - return new ConnectionDraining( - drainingTimeoutSec - ); + return new ConnectionDraining(drainingTimeoutSec); } public Builder clone() { @@ -134,9 +128,7 @@ public Builder clone() { @Override public String toString() { - return "ConnectionDraining{" - + "drainingTimeoutSec=" + drainingTimeoutSec - + "}"; + return "ConnectionDraining{" + "drainingTimeoutSec=" + drainingTimeoutSec + "}"; } @Override @@ -146,17 +138,13 @@ public boolean equals(Object o) { } if (o instanceof ConnectionDraining) { ConnectionDraining that = (ConnectionDraining) o; - return - Objects.equals(this.drainingTimeoutSec, that.getDrainingTimeoutSec()) - ; + return Objects.equals(this.drainingTimeoutSec, that.getDrainingTimeoutSec()); } return false; } @Override public int hashCode() { - return Objects.hash( - drainingTimeoutSec - ); + return Objects.hash(drainingTimeoutSec); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java index 56803b35982b..22e34f75bc37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private CreateSnapshotDiskHttpRequest() { this.userIp = null; } - private CreateSnapshotDiskHttpRequest( String access_token, String callback, @@ -70,8 +66,7 @@ private CreateSnapshotDiskHttpRequest( String quotaUser, String requestId, Snapshot snapshotResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.disk = disk; @@ -212,22 +207,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CreateSnapshotDiskHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CreateSnapshotDiskHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CreateSnapshotDiskHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CreateSnapshotDiskHttpRequest(); } @@ -398,38 +395,28 @@ public Builder setUserIp(String userIp) { return this; } - public CreateSnapshotDiskHttpRequest build() { String missing = ""; - if (disk == null) { missing += " disk"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new CreateSnapshotDiskHttpRequest( - access_token, - callback, - disk, - fields, - guestFlush, - key, - prettyPrint, - quotaUser, - requestId, - snapshotResource, - userIp - ); + access_token, + callback, + disk, + fields, + guestFlush, + key, + prettyPrint, + quotaUser, + requestId, + snapshotResource, + userIp); } public Builder clone() { @@ -452,17 +439,38 @@ public Builder clone() { @Override public String toString() { return "CreateSnapshotDiskHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "disk=" + disk + ", " - + "fields=" + fields + ", " - + "guestFlush=" + guestFlush + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "snapshotResource=" + snapshotResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "guestFlush=" + + guestFlush + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "snapshotResource=" + + snapshotResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -473,19 +481,17 @@ public boolean equals(Object o) { } if (o instanceof CreateSnapshotDiskHttpRequest) { CreateSnapshotDiskHttpRequest that = (CreateSnapshotDiskHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.disk, that.getDisk()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.guestFlush, that.getGuestFlush()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.snapshotResource, that.getSnapshotResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.guestFlush, that.getGuestFlush()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.snapshotResource, that.getSnapshotResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -493,17 +499,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - disk, - fields, - guestFlush, - key, - prettyPrint, - quotaUser, - requestId, - snapshotResource, - userIp - ); + access_token, + callback, + disk, + fields, + guestFlush, + key, + prettyPrint, + quotaUser, + requestId, + snapshotResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java index b7f1d51b070f..9535453d1ed2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private CustomerEncryptionKey() { this.sha256 = null; } - - private CustomerEncryptionKey( - String rawKey, - String sha256 - ) { + private CustomerEncryptionKey(String rawKey, String sha256) { this.rawKey = rawKey; this.sha256 = sha256; } @@ -86,22 +79,24 @@ public String getSha256() { return sha256; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CustomerEncryptionKey prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CustomerEncryptionKey getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CustomerEncryptionKey DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CustomerEncryptionKey(); } @@ -146,13 +141,9 @@ public Builder setSha256(String sha256) { return this; } - public CustomerEncryptionKey build() { - return new CustomerEncryptionKey( - rawKey, - sha256 - ); + return new CustomerEncryptionKey(rawKey, sha256); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "CustomerEncryptionKey{" - + "rawKey=" + rawKey + ", " - + "sha256=" + sha256 - + "}"; + return "CustomerEncryptionKey{" + "rawKey=" + rawKey + ", " + "sha256=" + sha256 + "}"; } @Override @@ -178,19 +166,14 @@ public boolean equals(Object o) { } if (o instanceof CustomerEncryptionKey) { CustomerEncryptionKey that = (CustomerEncryptionKey) o; - return - Objects.equals(this.rawKey, that.getRawKey()) && - Objects.equals(this.sha256, that.getSha256()) - ; + return Objects.equals(this.rawKey, that.getRawKey()) + && Objects.equals(this.sha256, that.getSha256()); } return false; } @Override public int hashCode() { - return Objects.hash( - rawKey, - sha256 - ); + return Objects.hash(rawKey, sha256); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java index 0bee694253f2..a7e25e4ff78d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,8 @@ private CustomerEncryptionKeyProtectedDisk() { this.source = null; } - private CustomerEncryptionKeyProtectedDisk( - CustomerEncryptionKey diskEncryptionKey, - String source - ) { + CustomerEncryptionKey diskEncryptionKey, String source) { this.diskEncryptionKey = diskEncryptionKey; this.source = source; } @@ -53,7 +47,8 @@ private CustomerEncryptionKeyProtectedDisk( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); } if (fieldNames.contains("source") && source != null) { fieldMap.put("source", Collections.singletonList(String.valueOf(source))); @@ -86,22 +81,24 @@ public String getSource() { return source; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(CustomerEncryptionKeyProtectedDisk prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static CustomerEncryptionKeyProtectedDisk getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final CustomerEncryptionKeyProtectedDisk DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new CustomerEncryptionKeyProtectedDisk(); } @@ -146,13 +143,9 @@ public Builder setSource(String source) { return this; } - public CustomerEncryptionKeyProtectedDisk build() { - return new CustomerEncryptionKeyProtectedDisk( - diskEncryptionKey, - source - ); + return new CustomerEncryptionKeyProtectedDisk(diskEncryptionKey, source); } public Builder clone() { @@ -166,8 +159,11 @@ public Builder clone() { @Override public String toString() { return "CustomerEncryptionKeyProtectedDisk{" - + "diskEncryptionKey=" + diskEncryptionKey + ", " - + "source=" + source + + "diskEncryptionKey=" + + diskEncryptionKey + + ", " + + "source=" + + source + "}"; } @@ -178,19 +174,14 @@ public boolean equals(Object o) { } if (o instanceof CustomerEncryptionKeyProtectedDisk) { CustomerEncryptionKeyProtectedDisk that = (CustomerEncryptionKeyProtectedDisk) o; - return - Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && - Objects.equals(this.source, that.getSource()) - ; + return Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) + && Objects.equals(this.source, that.getSource()); } return false; } @Override public int hashCode() { - return Objects.hash( - diskEncryptionKey, - source - ); + return Objects.hash(diskEncryptionKey, source); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java index a10d08cfbe3a..1984f5b20e4c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private Data() { this.value = null; } - - private Data( - String key, - String value - ) { + private Data(String key, String value) { this.key = key; this.value = value; } @@ -86,22 +79,24 @@ public String getValue() { return value; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Data prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Data getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Data DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Data(); } @@ -146,13 +141,9 @@ public Builder setValue(String value) { return this; } - public Data build() { - return new Data( - key, - value - ); + return new Data(key, value); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "Data{" - + "key=" + key + ", " - + "value=" + value - + "}"; + return "Data{" + "key=" + key + ", " + "value=" + value + "}"; } @Override @@ -178,19 +166,13 @@ public boolean equals(Object o) { } if (o instanceof Data) { Data that = (Data) o; - return - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.value, that.getValue()) - ; + return Objects.equals(this.key, that.getKey()) && Objects.equals(this.value, that.getValue()); } return false; } @Override public int hashCode() { - return Objects.hash( - key, - value - ); + return Objects.hash(key, value); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java index 67c2beb60f3f..fb7423784f94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private DeleteAccessConfigInstanceHttpRequest() { this.userIp = null; } - private DeleteAccessConfigInstanceHttpRequest( String accessConfig, String access_token, @@ -70,8 +66,7 @@ private DeleteAccessConfigInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.accessConfig = accessConfig; this.access_token = access_token; this.callback = callback; @@ -212,22 +207,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteAccessConfigInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteAccessConfigInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteAccessConfigInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteAccessConfigInstanceHttpRequest(); } @@ -398,15 +395,12 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteAccessConfigInstanceHttpRequest build() { String missing = ""; if (accessConfig == null) { missing += " accessConfig"; } - - if (instance == null) { missing += " instance"; } @@ -415,25 +409,21 @@ public DeleteAccessConfigInstanceHttpRequest build() { missing += " networkInterface"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteAccessConfigInstanceHttpRequest( - accessConfig, - access_token, - callback, - fields, - instance, - key, - networkInterface, - prettyPrint, - quotaUser, - requestId, - userIp - ); + accessConfig, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -456,17 +446,38 @@ public Builder clone() { @Override public String toString() { return "DeleteAccessConfigInstanceHttpRequest{" - + "accessConfig=" + accessConfig + ", " - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "networkInterface=" + networkInterface + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "accessConfig=" + + accessConfig + + ", " + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "networkInterface=" + + networkInterface + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -477,19 +488,17 @@ public boolean equals(Object o) { } if (o instanceof DeleteAccessConfigInstanceHttpRequest) { DeleteAccessConfigInstanceHttpRequest that = (DeleteAccessConfigInstanceHttpRequest) o; - return - Objects.equals(this.accessConfig, that.getAccessConfig()) && - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.networkInterface, that.getNetworkInterface()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.accessConfig, that.getAccessConfig()) + && Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.networkInterface, that.getNetworkInterface()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -497,17 +506,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - accessConfig, - access_token, - callback, - fields, - instance, - key, - networkInterface, - prettyPrint, - quotaUser, - requestId, - userIp - ); + accessConfig, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java index 845d10a60fba..3aed29febb4b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteAddressHttpRequest() { this.userIp = null; } - private DeleteAddressHttpRequest( String access_token, String address, @@ -64,8 +60,7 @@ private DeleteAddressHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.address = address; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteAddressHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteAddressHttpRequest build() { String missing = ""; @@ -350,26 +346,11 @@ public DeleteAddressHttpRequest build() { missing += " address"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteAddressHttpRequest( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "address=" + address + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "address=" + + address + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteAddressHttpRequest) { DeleteAddressHttpRequest that = (DeleteAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java index 6fde0cb63849..501172a2ea9d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteAutoscalerHttpRequest() { this.userIp = null; } - private DeleteAutoscalerHttpRequest( String access_token, String autoscaler, @@ -64,8 +60,7 @@ private DeleteAutoscalerHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteAutoscalerHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteAutoscalerHttpRequest build() { String missing = ""; @@ -350,26 +346,19 @@ public DeleteAutoscalerHttpRequest build() { missing += " autoscaler"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteAutoscalerHttpRequest( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteAutoscalerHttpRequest) { DeleteAutoscalerHttpRequest that = (DeleteAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, autoscaler, callback, fields, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java index 159a5e81b972..41386c1527a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteBackendBucketHttpRequest() { this.userIp = null; } - private DeleteBackendBucketHttpRequest( String access_token, String backendBucket, @@ -64,8 +60,7 @@ private DeleteBackendBucketHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendBucket = backendBucket; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteBackendBucketHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteBackendBucketHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteBackendBucketHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteBackendBucketHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteBackendBucketHttpRequest build() { String missing = ""; @@ -350,26 +346,19 @@ public DeleteBackendBucketHttpRequest build() { missing += " backendBucket"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteBackendBucketHttpRequest( - access_token, - backendBucket, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucket, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteBackendBucketHttpRequest{" - + "access_token=" + access_token + ", " - + "backendBucket=" + backendBucket + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendBucket=" + + backendBucket + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteBackendBucketHttpRequest) { DeleteBackendBucketHttpRequest that = (DeleteBackendBucketHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendBucket, that.getBackendBucket()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendBucket, that.getBackendBucket()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendBucket, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucket, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java index 3b9d715a571d..fc9ec286591d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteBackendServiceHttpRequest() { this.userIp = null; } - private DeleteBackendServiceHttpRequest( String access_token, String backendService, @@ -64,8 +60,7 @@ private DeleteBackendServiceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteBackendServiceHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteBackendServiceHttpRequest build() { String missing = ""; @@ -350,26 +346,19 @@ public DeleteBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteBackendServiceHttpRequest) { DeleteBackendServiceHttpRequest that = (DeleteBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java index d5ffd4b33a9e..4f400cea4939 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteDiskHttpRequest() { this.userIp = null; } - private DeleteDiskHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteDiskHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.disk = disk; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteDiskHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteDiskHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteDiskHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteDiskHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteDiskHttpRequest build() { String missing = ""; - if (disk == null) { missing += " disk"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteDiskHttpRequest( - access_token, - callback, - disk, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, disk, fields, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteDiskHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "disk=" + disk + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteDiskHttpRequest) { DeleteDiskHttpRequest that = (DeleteDiskHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.disk, that.getDisk()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - disk, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, disk, fields, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java index b564a8ee391c..0a95cdb91268 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteFirewallHttpRequest() { this.userIp = null; } - private DeleteFirewallHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteFirewallHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteFirewallHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteFirewallHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteFirewallHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteFirewallHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteFirewallHttpRequest build() { String missing = ""; - - if (firewall == null) { missing += " firewall"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteFirewallHttpRequest( - access_token, - callback, - fields, - firewall, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, firewall, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteFirewallHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "firewall=" + firewall + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "firewall=" + + firewall + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteFirewallHttpRequest) { DeleteFirewallHttpRequest that = (DeleteFirewallHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.firewall, that.getFirewall()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.firewall, that.getFirewall()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - firewall, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, firewall, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java index 5eb2e56f0b7c..ba1826a2c7a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteForwardingRuleHttpRequest() { this.userIp = null; } - private DeleteForwardingRuleHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteForwardingRuleHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteForwardingRuleHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteForwardingRuleHttpRequest build() { String missing = ""; - - if (forwardingRule == null) { missing += " forwardingRule"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRule=" + forwardingRule + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRule=" + + forwardingRule + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteForwardingRuleHttpRequest) { DeleteForwardingRuleHttpRequest that = (DeleteForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java index f8cdbf9d831d..a19eb85ef20c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteGlobalAddressHttpRequest() { this.userIp = null; } - private DeleteGlobalAddressHttpRequest( String access_token, String address, @@ -64,8 +60,7 @@ private DeleteGlobalAddressHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.address = address; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteGlobalAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteGlobalAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteGlobalAddressHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteGlobalAddressHttpRequest build() { String missing = ""; @@ -350,26 +346,11 @@ public DeleteGlobalAddressHttpRequest build() { missing += " address"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteGlobalAddressHttpRequest( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteGlobalAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "address=" + address + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "address=" + + address + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteGlobalAddressHttpRequest) { DeleteGlobalAddressHttpRequest that = (DeleteGlobalAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java index 8afebb7a5b27..ccc7cd90e76b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteGlobalForwardingRuleHttpRequest() { this.userIp = null; } - private DeleteGlobalForwardingRuleHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteGlobalForwardingRuleHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteGlobalForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteGlobalForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteGlobalForwardingRuleHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteGlobalForwardingRuleHttpRequest build() { String missing = ""; - - if (forwardingRule == null) { missing += " forwardingRule"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteGlobalForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteGlobalForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRule=" + forwardingRule + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRule=" + + forwardingRule + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteGlobalForwardingRuleHttpRequest) { DeleteGlobalForwardingRuleHttpRequest that = (DeleteGlobalForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java index c0015de99be7..dffbfeba8a65 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteGlobalOperationHttpRequest() { this.userIp = null; } - private DeleteGlobalOperationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteGlobalOperationHttpRequest( String operation, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteGlobalOperationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteGlobalOperationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteGlobalOperationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteGlobalOperationHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteGlobalOperationHttpRequest build() { String missing = ""; - - - if (operation == null) { missing += " operation"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteGlobalOperationHttpRequest( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteGlobalOperationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "operation=" + operation + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "operation=" + + operation + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteGlobalOperationHttpRequest) { DeleteGlobalOperationHttpRequest that = (DeleteGlobalOperationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java index 31bf88988994..d597ed87bc26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteHealthCheckHttpRequest() { this.userIp = null; } - private DeleteHealthCheckHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteHealthCheckHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteHealthCheckHttpRequest build() { String missing = ""; - - if (healthCheck == null) { missing += " healthCheck"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteHealthCheckHttpRequest( - access_token, - callback, - fields, - healthCheck, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheck, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "healthCheck=" + healthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "healthCheck=" + + healthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteHealthCheckHttpRequest) { DeleteHealthCheckHttpRequest that = (DeleteHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.healthCheck, that.getHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - healthCheck, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheck, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java index 03ec48d5b1a7..d98cdc2eaff1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteHttpHealthCheckHttpRequest() { this.userIp = null; } - private DeleteHttpHealthCheckHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteHttpHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteHttpHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteHttpHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteHttpHealthCheckHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteHttpHealthCheckHttpRequest build() { String missing = ""; - - if (httpHealthCheck == null) { missing += " httpHealthCheck"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteHttpHealthCheckHttpRequest( - access_token, - callback, - fields, - httpHealthCheck, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheck, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteHttpHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpHealthCheck=" + httpHealthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpHealthCheck=" + + httpHealthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteHttpHealthCheckHttpRequest) { DeleteHttpHealthCheckHttpRequest that = (DeleteHttpHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpHealthCheck, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheck, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java index 3c7ec91b2ef1..ea083fec6dd1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteHttpsHealthCheckHttpRequest() { this.userIp = null; } - private DeleteHttpsHealthCheckHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteHttpsHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteHttpsHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteHttpsHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteHttpsHealthCheckHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteHttpsHealthCheckHttpRequest build() { String missing = ""; - - if (httpsHealthCheck == null) { missing += " httpsHealthCheck"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteHttpsHealthCheckHttpRequest( - access_token, - callback, - fields, - httpsHealthCheck, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheck, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteHttpsHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpsHealthCheck=" + httpsHealthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpsHealthCheck=" + + httpsHealthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteHttpsHealthCheckHttpRequest) { DeleteHttpsHealthCheckHttpRequest that = (DeleteHttpsHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpsHealthCheck, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheck, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java index 1fc732fdeed4..f192fa56ff6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteImageHttpRequest() { this.userIp = null; } - private DeleteImageHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteImageHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteImageHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteImageHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteImageHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteImageHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteImageHttpRequest build() { String missing = ""; - - if (image == null) { missing += " image"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteImageHttpRequest( - access_token, - callback, - fields, - image, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, image, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteImageHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "image=" + image + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "image=" + + image + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteImageHttpRequest) { DeleteImageHttpRequest that = (DeleteImageHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.image, that.getImage()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.image, that.getImage()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - image, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, image, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java index 55f3820cbdce..f1049a23f64d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteInstanceGroupHttpRequest() { this.userIp = null; } - private DeleteInstanceGroupHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteInstanceGroupHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInstanceGroupHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteInstanceGroupHttpRequest) { DeleteInstanceGroupHttpRequest that = (DeleteInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java index 92add41e3e2d..3716bb27c6fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteInstanceGroupManagerHttpRequest() { this.userIp = null; } - private DeleteInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -90,7 +85,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +180,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInstanceGroupManagerHttpRequest(); } @@ -342,34 +340,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +380,32 @@ public Builder clone() { @Override public String toString() { return "DeleteInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +416,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteInstanceGroupManagerHttpRequest) { DeleteInstanceGroupManagerHttpRequest that = (DeleteInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +432,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java index 8c343c6c3647..673d763e1b3b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteInstanceHttpRequest() { this.userIp = null; } - private DeleteInstanceHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInstanceHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteInstanceHttpRequest) { DeleteInstanceHttpRequest that = (DeleteInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java index 6c390254eeea..91e9b81e9b8d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteInstanceTemplateHttpRequest() { this.userIp = null; } - private DeleteInstanceTemplateHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteInstanceTemplateHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInstanceTemplateHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInstanceTemplateHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInstanceTemplateHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInstanceTemplateHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInstanceTemplateHttpRequest build() { String missing = ""; - - if (instanceTemplate == null) { missing += " instanceTemplate"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInstanceTemplateHttpRequest( - access_token, - callback, - fields, - instanceTemplate, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceTemplate, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteInstanceTemplateHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceTemplate=" + instanceTemplate + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceTemplate=" + + instanceTemplate + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteInstanceTemplateHttpRequest) { DeleteInstanceTemplateHttpRequest that = (DeleteInstanceTemplateHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceTemplate, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceTemplate, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java index e48772c68eb6..d02f3aa75879 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,7 +33,8 @@ public final class DeleteInstancesInstanceGroupManagerHttpRequest implements Api private final String callback; private final String fields; private final String instanceGroupManager; - private final InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource; + private final InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -56,24 +54,24 @@ private DeleteInstancesInstanceGroupManagerHttpRequest() { this.userIp = null; } - private DeleteInstancesInstanceGroupManagerHttpRequest( String access_token, String callback, String fields, String instanceGroupManager, - InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, + InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource, String key, String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instanceGroupManager = instanceGroupManager; - this.instanceGroupManagersDeleteInstancesRequestResource = instanceGroupManagersDeleteInstancesRequestResource; + this.instanceGroupManagersDeleteInstancesRequestResource = + instanceGroupManagersDeleteInstancesRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -94,10 +92,15 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } - if (fieldNames.contains("instanceGroupManagersDeleteInstancesRequestResource") && instanceGroupManagersDeleteInstancesRequestResource != null) { - fieldMap.put("instanceGroupManagersDeleteInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersDeleteInstancesRequestResource))); + if (fieldNames.contains("instanceGroupManagersDeleteInstancesRequestResource") + && instanceGroupManagersDeleteInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupManagersDeleteInstancesRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersDeleteInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -174,7 +177,8 @@ public String getInstanceGroupManager() { return instanceGroupManager; } - public InstanceGroupManagersDeleteInstancesRequest getInstanceGroupManagersDeleteInstancesRequestResource() { + public InstanceGroupManagersDeleteInstancesRequest + getInstanceGroupManagersDeleteInstancesRequestResource() { return instanceGroupManagersDeleteInstancesRequestResource; } @@ -198,22 +202,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInstancesInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInstancesInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInstancesInstanceGroupManagerHttpRequest(); } @@ -223,7 +229,8 @@ public static class Builder { private String callback; private String fields; private String instanceGroupManager; - private InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource; + private InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource; private String key; private String prettyPrint; private String quotaUser; @@ -247,7 +254,8 @@ public Builder mergeFrom(DeleteInstancesInstanceGroupManagerHttpRequest other) { this.instanceGroupManager = other.instanceGroupManager; } if (other.getInstanceGroupManagersDeleteInstancesRequestResource() != null) { - this.instanceGroupManagersDeleteInstancesRequestResource = other.instanceGroupManagersDeleteInstancesRequestResource; + this.instanceGroupManagersDeleteInstancesRequestResource = + other.instanceGroupManagersDeleteInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +280,8 @@ public Builder mergeFrom(DeleteInstancesInstanceGroupManagerHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instanceGroupManager = source.instanceGroupManager; - this.instanceGroupManagersDeleteInstancesRequestResource = source.instanceGroupManagersDeleteInstancesRequestResource; + this.instanceGroupManagersDeleteInstancesRequestResource = + source.instanceGroupManagersDeleteInstancesRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -316,12 +325,16 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { return this; } - public InstanceGroupManagersDeleteInstancesRequest getInstanceGroupManagersDeleteInstancesRequestResource() { + public InstanceGroupManagersDeleteInstancesRequest + getInstanceGroupManagersDeleteInstancesRequestResource() { return instanceGroupManagersDeleteInstancesRequestResource; } - public Builder setInstanceGroupManagersDeleteInstancesRequestResource(InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { - this.instanceGroupManagersDeleteInstancesRequestResource = instanceGroupManagersDeleteInstancesRequestResource; + public Builder setInstanceGroupManagersDeleteInstancesRequestResource( + InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource) { + this.instanceGroupManagersDeleteInstancesRequestResource = + instanceGroupManagersDeleteInstancesRequestResource; return this; } @@ -370,36 +383,27 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInstancesInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInstancesInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersDeleteInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersDeleteInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +412,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroupManager(this.instanceGroupManager); - newBuilder.setInstanceGroupManagersDeleteInstancesRequestResource(this.instanceGroupManagersDeleteInstancesRequestResource); + newBuilder.setInstanceGroupManagersDeleteInstancesRequestResource( + this.instanceGroupManagersDeleteInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +426,35 @@ public Builder clone() { @Override public String toString() { return "DeleteInstancesInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "instanceGroupManagersDeleteInstancesRequestResource=" + instanceGroupManagersDeleteInstancesRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagersDeleteInstancesRequestResource=" + + instanceGroupManagersDeleteInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +464,20 @@ public boolean equals(Object o) { return true; } if (o instanceof DeleteInstancesInstanceGroupManagerHttpRequest) { - DeleteInstancesInstanceGroupManagerHttpRequest that = (DeleteInstancesInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.instanceGroupManagersDeleteInstancesRequestResource, that.getInstanceGroupManagersDeleteInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + DeleteInstancesInstanceGroupManagerHttpRequest that = + (DeleteInstancesInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagersDeleteInstancesRequestResource, + that.getInstanceGroupManagersDeleteInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +485,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersDeleteInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersDeleteInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java index da67c3e6ef0f..8b1b4978b59f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class DeleteInstancesRegionInstanceGroupManagerHttpRequest implemen private final String key; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource; + private final RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource; private final String requestId; private final String userIp; @@ -56,7 +54,6 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private DeleteInstancesRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -65,10 +62,10 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, - RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, + RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +73,8 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupManagersDeleteInstancesRequestResource = regionInstanceGroupManagersDeleteInstancesRequestResource; + this.regionInstanceGroupManagersDeleteInstancesRequestResource = + regionInstanceGroupManagersDeleteInstancesRequestResource; this.requestId = requestId; this.userIp = userIp; } @@ -94,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -105,8 +104,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource") && regionInstanceGroupManagersDeleteInstancesRequestResource != null) { - fieldMap.put("regionInstanceGroupManagersDeleteInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource))); + if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource") + && regionInstanceGroupManagersDeleteInstancesRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersDeleteInstancesRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource))); } if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); @@ -186,7 +189,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupManagersDeleteInstancesRequest getRegionInstanceGroupManagersDeleteInstancesRequestResource() { + public RegionInstanceGroupManagersDeleteInstancesRequest + getRegionInstanceGroupManagersDeleteInstancesRequestResource() { return regionInstanceGroupManagersDeleteInstancesRequestResource; } @@ -198,22 +202,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInstancesRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInstancesRegionInstanceGroupManagerHttpRequest(); } @@ -226,14 +232,16 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource; + private RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource; private String requestId; private String userIp; Builder() {} public Builder mergeFrom(DeleteInstancesRegionInstanceGroupManagerHttpRequest other) { - if (other == DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -256,7 +264,8 @@ public Builder mergeFrom(DeleteInstancesRegionInstanceGroupManagerHttpRequest ot this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupManagersDeleteInstancesRequestResource() != null) { - this.regionInstanceGroupManagersDeleteInstancesRequestResource = other.regionInstanceGroupManagersDeleteInstancesRequestResource; + this.regionInstanceGroupManagersDeleteInstancesRequestResource = + other.regionInstanceGroupManagersDeleteInstancesRequestResource; } if (other.getRequestId() != null) { this.requestId = other.requestId; @@ -275,7 +284,8 @@ public Builder mergeFrom(DeleteInstancesRegionInstanceGroupManagerHttpRequest ot this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupManagersDeleteInstancesRequestResource = source.regionInstanceGroupManagersDeleteInstancesRequestResource; + this.regionInstanceGroupManagersDeleteInstancesRequestResource = + source.regionInstanceGroupManagersDeleteInstancesRequestResource; this.requestId = source.requestId; this.userIp = source.userIp; } @@ -343,12 +353,16 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupManagersDeleteInstancesRequest getRegionInstanceGroupManagersDeleteInstancesRequestResource() { + public RegionInstanceGroupManagersDeleteInstancesRequest + getRegionInstanceGroupManagersDeleteInstancesRequestResource() { return regionInstanceGroupManagersDeleteInstancesRequestResource; } - public Builder setRegionInstanceGroupManagersDeleteInstancesRequestResource(RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { - this.regionInstanceGroupManagersDeleteInstancesRequestResource = regionInstanceGroupManagersDeleteInstancesRequestResource; + public Builder setRegionInstanceGroupManagersDeleteInstancesRequestResource( + RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource) { + this.regionInstanceGroupManagersDeleteInstancesRequestResource = + regionInstanceGroupManagersDeleteInstancesRequestResource; return this; } @@ -370,36 +384,27 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInstancesRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInstancesRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersDeleteInstancesRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersDeleteInstancesRequestResource, + requestId, + userIp); } public Builder clone() { @@ -411,7 +416,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupManagersDeleteInstancesRequestResource(this.regionInstanceGroupManagersDeleteInstancesRequestResource); + newBuilder.setRegionInstanceGroupManagersDeleteInstancesRequestResource( + this.regionInstanceGroupManagersDeleteInstancesRequestResource); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +427,35 @@ public Builder clone() { @Override public String toString() { return "DeleteInstancesRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupManagersDeleteInstancesRequestResource=" + regionInstanceGroupManagersDeleteInstancesRequestResource + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupManagersDeleteInstancesRequestResource=" + + regionInstanceGroupManagersDeleteInstancesRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +465,20 @@ public boolean equals(Object o) { return true; } if (o instanceof DeleteInstancesRegionInstanceGroupManagerHttpRequest) { - DeleteInstancesRegionInstanceGroupManagerHttpRequest that = (DeleteInstancesRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupManagersDeleteInstancesRequestResource, that.getRegionInstanceGroupManagersDeleteInstancesRequestResource()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + DeleteInstancesRegionInstanceGroupManagerHttpRequest that = + (DeleteInstancesRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupManagersDeleteInstancesRequestResource, + that.getRegionInstanceGroupManagersDeleteInstancesRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +486,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersDeleteInstancesRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersDeleteInstancesRequestResource, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java index 5df37d464305..a954333c2313 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteInterconnectAttachmentHttpRequest() { this.userIp = null; } - private DeleteInterconnectAttachmentHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteInterconnectAttachmentHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -90,7 +85,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) { - fieldMap.put("interconnectAttachment", Collections.singletonList(String.valueOf(interconnectAttachment))); + fieldMap.put( + "interconnectAttachment", + Collections.singletonList(String.valueOf(interconnectAttachment))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +181,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInterconnectAttachmentHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInterconnectAttachmentHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInterconnectAttachmentHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInterconnectAttachmentHttpRequest(); } @@ -342,34 +341,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInterconnectAttachmentHttpRequest build() { String missing = ""; - - if (interconnectAttachment == null) { missing += " interconnectAttachment"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInterconnectAttachmentHttpRequest( - access_token, - callback, - fields, - interconnectAttachment, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnectAttachment, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +381,32 @@ public Builder clone() { @Override public String toString() { return "DeleteInterconnectAttachmentHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnectAttachment=" + interconnectAttachment + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnectAttachment=" + + interconnectAttachment + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +417,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteInterconnectAttachmentHttpRequest) { DeleteInterconnectAttachmentHttpRequest that = (DeleteInterconnectAttachmentHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +433,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnectAttachment, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnectAttachment, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java index f6704a45dadd..6b47502e9489 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteInterconnectHttpRequest() { this.userIp = null; } - private DeleteInterconnectHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteInterconnectHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteInterconnectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteInterconnectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteInterconnectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteInterconnectHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteInterconnectHttpRequest build() { String missing = ""; - - if (interconnect == null) { missing += " interconnect"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteInterconnectHttpRequest( - access_token, - callback, - fields, - interconnect, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnect, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteInterconnectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnect=" + interconnect + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnect=" + + interconnect + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteInterconnectHttpRequest) { DeleteInterconnectHttpRequest that = (DeleteInterconnectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnect, that.getInterconnect()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnect, that.getInterconnect()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnect, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnect, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java similarity index 73% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java index f59cbb63288d..6746f152dc4d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicensHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -31,7 +28,7 @@ @Generated("by GAPIC") @BetaApi -public final class GetLicensHttpRequest implements ApiMessage { +public final class DeleteLicenseHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; @@ -39,9 +36,10 @@ public final class GetLicensHttpRequest implements ApiMessage { private final String license; private final String prettyPrint; private final String quotaUser; + private final String requestId; private final String userIp; - private GetLicensHttpRequest() { + private DeleteLicenseHttpRequest() { this.access_token = null; this.callback = null; this.fields = null; @@ -49,11 +47,11 @@ private GetLicensHttpRequest() { this.license = null; this.prettyPrint = null; this.quotaUser = null; + this.requestId = null; this.userIp = null; } - - private GetLicensHttpRequest( + private DeleteLicenseHttpRequest( String access_token, String callback, String fields, @@ -61,8 +59,8 @@ private GetLicensHttpRequest( String license, String prettyPrint, String quotaUser, - String userIp - ) { + String requestId, + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -70,6 +68,7 @@ private GetLicensHttpRequest( this.license = license; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; + this.requestId = requestId; this.userIp = userIp; } @@ -97,6 +96,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -126,6 +128,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("quotaUser")) { return String.valueOf(quotaUser); } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -166,28 +171,34 @@ public String getQuotaUser() { return quotaUser; } + public String getRequestId() { + return requestId; + } + public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(GetLicensHttpRequest prototype) { + + public static Builder newBuilder(DeleteLicenseHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static GetLicensHttpRequest getDefaultInstance() { + public static DeleteLicenseHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final GetLicensHttpRequest DEFAULT_INSTANCE; + + private static final DeleteLicenseHttpRequest DEFAULT_INSTANCE; + static { - DEFAULT_INSTANCE = new GetLicensHttpRequest(); + DEFAULT_INSTANCE = new DeleteLicenseHttpRequest(); } public static class Builder { @@ -198,12 +209,13 @@ public static class Builder { private String license; private String prettyPrint; private String quotaUser; + private String requestId; private String userIp; Builder() {} - public Builder mergeFrom(GetLicensHttpRequest other) { - if (other == GetLicensHttpRequest.getDefaultInstance()) return this; + public Builder mergeFrom(DeleteLicenseHttpRequest other) { + if (other == DeleteLicenseHttpRequest.getDefaultInstance()) return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -225,13 +237,16 @@ public Builder mergeFrom(GetLicensHttpRequest other) { if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } return this; } - Builder(GetLicensHttpRequest source) { + Builder(DeleteLicenseHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; this.fields = source.fields; @@ -239,6 +254,7 @@ public Builder mergeFrom(GetLicensHttpRequest other) { this.license = source.license; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; + this.requestId = source.requestId; this.userIp = source.userIp; } @@ -305,6 +321,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + public String getUserIp() { return userIp; } @@ -314,32 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - - public GetLicensHttpRequest build() { + public DeleteLicenseHttpRequest build() { String missing = ""; - - - if (license == null) { missing += " license"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } - return new GetLicensHttpRequest( - access_token, - callback, - fields, - key, - license, - prettyPrint, - quotaUser, - userIp - ); + return new DeleteLicenseHttpRequest( + access_token, callback, fields, key, license, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -351,6 +362,7 @@ public Builder clone() { newBuilder.setLicense(this.license); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -358,15 +370,33 @@ public Builder clone() { @Override public String toString() { - return "GetLicensHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "license=" + license + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + return "DeleteLicenseHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "license=" + + license + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -375,18 +405,17 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof GetLicensHttpRequest) { - GetLicensHttpRequest that = (GetLicensHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.license, that.getLicense()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + if (o instanceof DeleteLicenseHttpRequest) { + DeleteLicenseHttpRequest that = (DeleteLicenseHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.license, that.getLicense()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - license, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, license, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java index 18a1da6940f9..c0091faaf314 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteNetworkHttpRequest() { this.userIp = null; } - private DeleteNetworkHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteNetworkHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteNetworkHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteNetworkHttpRequest build() { String missing = ""; - - - if (network == null) { missing += " network"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteNetworkHttpRequest( - access_token, - callback, - fields, - key, - network, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, network, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "network=" + network + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "network=" + + network + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteNetworkHttpRequest) { DeleteNetworkHttpRequest that = (DeleteNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - network, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, network, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java index 11958472654b..e2f86b272efa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteRegionAutoscalerHttpRequest() { this.userIp = null; } - private DeleteRegionAutoscalerHttpRequest( String access_token, String autoscaler, @@ -64,8 +60,7 @@ private DeleteRegionAutoscalerHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRegionAutoscalerHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRegionAutoscalerHttpRequest build() { String missing = ""; @@ -350,26 +346,19 @@ public DeleteRegionAutoscalerHttpRequest build() { missing += " autoscaler"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRegionAutoscalerHttpRequest( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + autoscaler, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteRegionAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteRegionAutoscalerHttpRequest) { DeleteRegionAutoscalerHttpRequest that = (DeleteRegionAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, autoscaler, callback, fields, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java index 47a4531a1000..8ba0bf3ce1fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteRegionBackendServiceHttpRequest() { this.userIp = null; } - private DeleteRegionBackendServiceHttpRequest( String access_token, String backendService, @@ -64,8 +60,7 @@ private DeleteRegionBackendServiceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRegionBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRegionBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRegionBackendServiceHttpRequest(); } @@ -342,7 +339,6 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRegionBackendServiceHttpRequest build() { String missing = ""; @@ -350,26 +346,19 @@ public DeleteRegionBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRegionBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteRegionBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteRegionBackendServiceHttpRequest) { DeleteRegionBackendServiceHttpRequest that = (DeleteRegionBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java index c0db3e65c9e5..9d007d07395c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private DeleteRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteRegionInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -90,7 +85,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +180,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRegionInstanceGroupManagerHttpRequest(); } @@ -342,34 +340,26 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -390,15 +380,32 @@ public Builder clone() { @Override public String toString() { return "DeleteRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -408,18 +415,17 @@ public boolean equals(Object o) { return true; } if (o instanceof DeleteRegionInstanceGroupManagerHttpRequest) { - DeleteRegionInstanceGroupManagerHttpRequest that = (DeleteRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + DeleteRegionInstanceGroupManagerHttpRequest that = + (DeleteRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +433,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java index 240e2a8351d0..0aa04d0347fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteRegionOperationHttpRequest() { this.userIp = null; } - private DeleteRegionOperationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteRegionOperationHttpRequest( String operation, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRegionOperationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRegionOperationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRegionOperationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRegionOperationHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRegionOperationHttpRequest build() { String missing = ""; - - - if (operation == null) { missing += " operation"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRegionOperationHttpRequest( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteRegionOperationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "operation=" + operation + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "operation=" + + operation + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteRegionOperationHttpRequest) { DeleteRegionOperationHttpRequest that = (DeleteRegionOperationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java index b5940ea8626c..169f670aaefb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteRouteHttpRequest() { this.userIp = null; } - private DeleteRouteHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteRouteHttpRequest( String quotaUser, String requestId, String route, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRouteHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRouteHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRouteHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRouteHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRouteHttpRequest build() { String missing = ""; - - - - - - if (route == null) { missing += " route"; } @@ -360,16 +350,7 @@ public DeleteRouteHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRouteHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - route, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, route, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteRouteHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "route=" + route + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "route=" + + route + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteRouteHttpRequest) { DeleteRouteHttpRequest that = (DeleteRouteHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.route, that.getRoute()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.route, that.getRoute()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - route, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, route, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java index aaaa9cdae270..2b2c5dffd844 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteRouterHttpRequest() { this.userIp = null; } - private DeleteRouterHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteRouterHttpRequest( String quotaUser, String requestId, String router, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteRouterHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteRouterHttpRequest build() { String missing = ""; - - - - - - if (router == null) { missing += " router"; } @@ -360,16 +350,7 @@ public DeleteRouterHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, router, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "router=" + router + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "router=" + + router + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteRouterHttpRequest) { DeleteRouterHttpRequest that = (DeleteRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, router, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java index 9e76b5c9aee9..bc41b7100059 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteSnapshotHttpRequest() { this.userIp = null; } - private DeleteSnapshotHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteSnapshotHttpRequest( String quotaUser, String requestId, String snapshot, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteSnapshotHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteSnapshotHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteSnapshotHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteSnapshotHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteSnapshotHttpRequest build() { String missing = ""; - - - - - - if (snapshot == null) { missing += " snapshot"; } @@ -360,16 +350,7 @@ public DeleteSnapshotHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteSnapshotHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - snapshot, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, snapshot, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteSnapshotHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "snapshot=" + snapshot + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "snapshot=" + + snapshot + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteSnapshotHttpRequest) { DeleteSnapshotHttpRequest that = (DeleteSnapshotHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.snapshot, that.getSnapshot()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.snapshot, that.getSnapshot()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - snapshot, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, snapshot, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java index 17905af89720..45c38ccbdb4b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteSslCertificateHttpRequest() { this.userIp = null; } - private DeleteSslCertificateHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteSslCertificateHttpRequest( String quotaUser, String requestId, String sslCertificate, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteSslCertificateHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteSslCertificateHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteSslCertificateHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteSslCertificateHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteSslCertificateHttpRequest build() { String missing = ""; - - - - - - if (sslCertificate == null) { missing += " sslCertificate"; } @@ -360,16 +350,15 @@ public DeleteSslCertificateHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteSslCertificateHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - sslCertificate, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslCertificate, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteSslCertificateHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "sslCertificate=" + sslCertificate + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslCertificate=" + + sslCertificate + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteSslCertificateHttpRequest) { DeleteSslCertificateHttpRequest that = (DeleteSslCertificateHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.sslCertificate, that.getSslCertificate()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslCertificate, that.getSslCertificate()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - sslCertificate, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslCertificate, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java new file mode 100644 index 000000000000..dabf1a10aadc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java @@ -0,0 +1,436 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteSslPolicyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String sslPolicy; + private final String userIp; + + private DeleteSslPolicyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.sslPolicy = null; + this.userIp = null; + } + + private DeleteSslPolicyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String sslPolicy, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.sslPolicy = sslPolicy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(DeleteSslPolicyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteSslPolicyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final DeleteSslPolicyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new DeleteSslPolicyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String sslPolicy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteSslPolicyHttpRequest other) { + if (other == DeleteSslPolicyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSslPolicy() != null) { + this.sslPolicy = other.sslPolicy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteSslPolicyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.sslPolicy = source.sslPolicy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public DeleteSslPolicyHttpRequest build() { + String missing = ""; + + if (sslPolicy == null) { + missing += " sslPolicy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteSslPolicyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicy, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSslPolicy(this.sslPolicy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteSslPolicyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslPolicy=" + + sslPolicy + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteSslPolicyHttpRequest) { + DeleteSslPolicyHttpRequest that = (DeleteSslPolicyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslPolicy, that.getSslPolicy()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, sslPolicy, userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java index a2c1698689c7..92553629d430 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteSubnetworkHttpRequest() { this.userIp = null; } - private DeleteSubnetworkHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteSubnetworkHttpRequest( String quotaUser, String requestId, String subnetwork, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteSubnetworkHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteSubnetworkHttpRequest build() { String missing = ""; - - - - - - if (subnetwork == null) { missing += " subnetwork"; } @@ -360,16 +350,15 @@ public DeleteSubnetworkHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "subnetwork=" + subnetwork + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteSubnetworkHttpRequest) { DeleteSubnetworkHttpRequest that = (DeleteSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, subnetwork, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java index 16e580db46bd..1ec62978cef3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetHttpProxyHttpRequest() { this.userIp = null; } - private DeleteTargetHttpProxyHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetHttpProxyHttpRequest( String quotaUser, String requestId, String targetHttpProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetHttpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetHttpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetHttpProxyHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetHttpProxyHttpRequest build() { String missing = ""; - - - - - - if (targetHttpProxy == null) { missing += " targetHttpProxy"; } @@ -360,16 +350,15 @@ public DeleteTargetHttpProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetHttpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpProxy, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetHttpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpProxy=" + targetHttpProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpProxy=" + + targetHttpProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetHttpProxyHttpRequest) { DeleteTargetHttpProxyHttpRequest that = (DeleteTargetHttpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java index fc92ef4b9adf..1adb6c8e9987 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetHttpsProxyHttpRequest() { this.userIp = null; } - private DeleteTargetHttpsProxyHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetHttpsProxyHttpRequest( String quotaUser, String requestId, String targetHttpsProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetHttpsProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetHttpsProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetHttpsProxyHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetHttpsProxyHttpRequest build() { String missing = ""; - - - - - - if (targetHttpsProxy == null) { missing += " targetHttpsProxy"; } @@ -360,16 +350,15 @@ public DeleteTargetHttpsProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetHttpsProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpsProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxy, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetHttpsProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpsProxy=" + targetHttpsProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpsProxy=" + + targetHttpsProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetHttpsProxyHttpRequest) { DeleteTargetHttpsProxyHttpRequest that = (DeleteTargetHttpsProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpsProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java index 3f0ac5096c30..4ae64c4505e0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetInstanceHttpRequest() { this.userIp = null; } - private DeleteTargetInstanceHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetInstanceHttpRequest( String quotaUser, String requestId, String targetInstance, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetInstanceHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetInstanceHttpRequest build() { String missing = ""; - - - - - - if (targetInstance == null) { missing += " targetInstance"; } @@ -360,16 +350,15 @@ public DeleteTargetInstanceHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetInstanceHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetInstance, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetInstance, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetInstance=" + targetInstance + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetInstance=" + + targetInstance + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetInstanceHttpRequest) { DeleteTargetInstanceHttpRequest that = (DeleteTargetInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetInstance, that.getTargetInstance()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetInstance, that.getTargetInstance()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetInstance, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetInstance, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java index 4f85a3066941..c520c4629eee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetPoolHttpRequest() { this.userIp = null; } - private DeleteTargetPoolHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetPoolHttpRequest( String quotaUser, String requestId, String targetPool, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetPoolHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } @@ -360,16 +350,15 @@ public DeleteTargetPoolHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetPool=" + targetPool + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetPool=" + + targetPool + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetPoolHttpRequest) { DeleteTargetPoolHttpRequest that = (DeleteTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, targetPool, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java index fa2bdcaf3456..58c4c718a276 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetSslProxyHttpRequest() { this.userIp = null; } - private DeleteTargetSslProxyHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetSslProxyHttpRequest( String quotaUser, String requestId, String targetSslProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetSslProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetSslProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetSslProxyHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetSslProxyHttpRequest build() { String missing = ""; - - - - - - if (targetSslProxy == null) { missing += " targetSslProxy"; } @@ -360,16 +350,15 @@ public DeleteTargetSslProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetSslProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxy, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetSslProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetSslProxy=" + targetSslProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetSslProxy=" + + targetSslProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetSslProxyHttpRequest) { DeleteTargetSslProxyHttpRequest that = (DeleteTargetSslProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java index da35f00851da..20e042141905 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetTcpProxyHttpRequest() { this.userIp = null; } - private DeleteTargetTcpProxyHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetTcpProxyHttpRequest( String quotaUser, String requestId, String targetTcpProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetTcpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetTcpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetTcpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetTcpProxyHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetTcpProxyHttpRequest build() { String missing = ""; - - - - - - if (targetTcpProxy == null) { missing += " targetTcpProxy"; } @@ -360,16 +350,15 @@ public DeleteTargetTcpProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetTcpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetTcpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetTcpProxy, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetTcpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetTcpProxy=" + targetTcpProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetTcpProxy=" + + targetTcpProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetTcpProxyHttpRequest) { DeleteTargetTcpProxyHttpRequest that = (DeleteTargetTcpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetTcpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetTcpProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java index c39570ffeb45..f9dc3744a64d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteTargetVpnGatewayHttpRequest() { this.userIp = null; } - private DeleteTargetVpnGatewayHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteTargetVpnGatewayHttpRequest( String quotaUser, String requestId, String targetVpnGateway, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteTargetVpnGatewayHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteTargetVpnGatewayHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteTargetVpnGatewayHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteTargetVpnGatewayHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteTargetVpnGatewayHttpRequest build() { String missing = ""; - - - - - - if (targetVpnGateway == null) { missing += " targetVpnGateway"; } @@ -360,16 +350,15 @@ public DeleteTargetVpnGatewayHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteTargetVpnGatewayHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetVpnGateway, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetVpnGateway, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "DeleteTargetVpnGatewayHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetVpnGateway=" + targetVpnGateway + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetVpnGateway=" + + targetVpnGateway + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteTargetVpnGatewayHttpRequest) { DeleteTargetVpnGatewayHttpRequest that = (DeleteTargetVpnGatewayHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetVpnGateway, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetVpnGateway, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java index f45f70c8ec39..ce830ad22a39 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteUrlMapHttpRequest() { this.userIp = null; } - private DeleteUrlMapHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteUrlMapHttpRequest( String quotaUser, String requestId, String urlMap, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteUrlMapHttpRequest(); } @@ -342,16 +339,9 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteUrlMapHttpRequest build() { String missing = ""; - - - - - - if (urlMap == null) { missing += " urlMap"; } @@ -360,16 +350,7 @@ public DeleteUrlMapHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, urlMap, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DeleteUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "urlMap=" + urlMap + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "urlMap=" + + urlMap + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteUrlMapHttpRequest) { DeleteUrlMapHttpRequest that = (DeleteUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, urlMap, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java index 16b59809675e..04c41adf8d23 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DeleteVpnTunnelHttpRequest() { this.vpnTunnel = null; } - private DeleteVpnTunnelHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DeleteVpnTunnelHttpRequest( String quotaUser, String requestId, String userIp, - String vpnTunnel - ) { + String vpnTunnel) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getVpnTunnel() { return vpnTunnel; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteVpnTunnelHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteVpnTunnelHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteVpnTunnelHttpRequest(); } @@ -342,17 +339,9 @@ public Builder setVpnTunnel(String vpnTunnel) { return this; } - public DeleteVpnTunnelHttpRequest build() { String missing = ""; - - - - - - - if (vpnTunnel == null) { missing += " vpnTunnel"; } @@ -360,16 +349,15 @@ public DeleteVpnTunnelHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteVpnTunnelHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - vpnTunnel - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + vpnTunnel); } public Builder clone() { @@ -390,15 +378,32 @@ public Builder clone() { @Override public String toString() { return "DeleteVpnTunnelHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "vpnTunnel=" + vpnTunnel + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "vpnTunnel=" + + vpnTunnel + "}"; } @@ -409,17 +414,15 @@ public boolean equals(Object o) { } if (o instanceof DeleteVpnTunnelHttpRequest) { DeleteVpnTunnelHttpRequest that = (DeleteVpnTunnelHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.vpnTunnel, that.getVpnTunnel()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.vpnTunnel, that.getVpnTunnel()); } return false; } @@ -427,15 +430,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - vpnTunnel - ); + access_token, callback, fields, key, prettyPrint, quotaUser, requestId, userIp, vpnTunnel); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java index bb50690c4cb8..ddb4f4ffd11b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private DeleteZoneOperationHttpRequest() { this.userIp = null; } - private DeleteZoneOperationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private DeleteZoneOperationHttpRequest( String operation, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeleteZoneOperationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeleteZoneOperationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeleteZoneOperationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeleteZoneOperationHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public DeleteZoneOperationHttpRequest build() { String missing = ""; - - - if (operation == null) { missing += " operation"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeleteZoneOperationHttpRequest( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "DeleteZoneOperationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "operation=" + operation + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "operation=" + + operation + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof DeleteZoneOperationHttpRequest) { DeleteZoneOperationHttpRequest that = (DeleteZoneOperationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java index 5b58c9173a6a..8d93d2ea8590 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private Denied() { this.ports = null; } - - private Denied( - String iPProtocol, - List ports - ) { + private Denied(String iPProtocol, List ports) { this.iPProtocol = iPProtocol; this.ports = ports; } @@ -90,22 +85,24 @@ public List getPortsList() { return ports; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Denied prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Denied getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Denied DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Denied(); } @@ -158,13 +155,9 @@ public Builder addPorts(String ports) { return this; } - public Denied build() { - return new Denied( - iPProtocol, - ports - ); + return new Denied(iPProtocol, ports); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "Denied{" - + "iPProtocol=" + iPProtocol + ", " - + "ports=" + ports - + "}"; + return "Denied{" + "iPProtocol=" + iPProtocol + ", " + "ports=" + ports + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof Denied) { Denied that = (Denied) o; - return - Objects.equals(this.iPProtocol, that.getIPProtocol()) && - Objects.equals(this.ports, that.getPortsList()) - ; + return Objects.equals(this.iPProtocol, that.getIPProtocol()) + && Objects.equals(this.ports, that.getPortsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - iPProtocol, - ports - ); + return Objects.hash(iPProtocol, ports); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java index 116ac13076c3..663b4d0f8606 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private DeprecateImageHttpRequest() { this.userIp = null; } - private DeprecateImageHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private DeprecateImageHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.deprecationStatusResource = deprecationStatusResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); } if (fieldNames.contains("deprecationStatusResource") && deprecationStatusResource != null) { - fieldMap.put("deprecationStatusResource", Collections.singletonList(String.valueOf(deprecationStatusResource))); + fieldMap.put( + "deprecationStatusResource", + Collections.singletonList(String.valueOf(deprecationStatusResource))); } if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeprecateImageHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeprecateImageHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeprecateImageHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeprecateImageHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public DeprecateImageHttpRequest build() { String missing = ""; - - - if (image == null) { missing += " image"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DeprecateImageHttpRequest( - access_token, - callback, - deprecationStatusResource, - fields, - image, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + deprecationStatusResource, + fields, + image, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "DeprecateImageHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "deprecationStatusResource=" + deprecationStatusResource + ", " - + "fields=" + fields + ", " - + "image=" + image + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "deprecationStatusResource=" + + deprecationStatusResource + + ", " + + "fields=" + + fields + + ", " + + "image=" + + image + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof DeprecateImageHttpRequest) { DeprecateImageHttpRequest that = (DeprecateImageHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.deprecationStatusResource, that.getDeprecationStatusResource()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.image, that.getImage()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.deprecationStatusResource, that.getDeprecationStatusResource()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.image, that.getImage()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - deprecationStatusResource, - fields, - image, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + deprecationStatusResource, + fields, + image, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java index 4804140dbb3b..6a5068384d9b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private DeprecationStatus() { this.state = null; } - private DeprecationStatus( - String deleted, - String deprecated, - String obsolete, - String replacement, - String state - ) { + String deleted, String deprecated, String obsolete, String replacement, String state) { this.deleted = deleted; this.deprecated = deprecated; this.obsolete = obsolete; @@ -128,22 +119,24 @@ public String getState() { return state; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DeprecationStatus prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DeprecationStatus getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DeprecationStatus DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DeprecationStatus(); } @@ -230,19 +223,9 @@ public Builder setState(String state) { return this; } - public DeprecationStatus build() { - - - - return new DeprecationStatus( - deleted, - deprecated, - obsolete, - replacement, - state - ); + return new DeprecationStatus(deleted, deprecated, obsolete, replacement, state); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "DeprecationStatus{" - + "deleted=" + deleted + ", " - + "deprecated=" + deprecated + ", " - + "obsolete=" + obsolete + ", " - + "replacement=" + replacement + ", " - + "state=" + state + + "deleted=" + + deleted + + ", " + + "deprecated=" + + deprecated + + ", " + + "obsolete=" + + obsolete + + ", " + + "replacement=" + + replacement + + ", " + + "state=" + + state + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof DeprecationStatus) { DeprecationStatus that = (DeprecationStatus) o; - return - Objects.equals(this.deleted, that.getDeleted()) && - Objects.equals(this.deprecated, that.getDeprecated()) && - Objects.equals(this.obsolete, that.getObsolete()) && - Objects.equals(this.replacement, that.getReplacement()) && - Objects.equals(this.state, that.getState()) - ; + return Objects.equals(this.deleted, that.getDeleted()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.obsolete, that.getObsolete()) + && Objects.equals(this.replacement, that.getReplacement()) + && Objects.equals(this.state, that.getState()); } return false; } @Override public int hashCode() { - return Objects.hash( - deleted, - deprecated, - obsolete, - replacement, - state - ); + return Objects.hash(deleted, deprecated, obsolete, replacement, state); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java index 2ef2d67f90db..abaf1ce24c20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private DetachDiskInstanceHttpRequest() { this.userIp = null; } - private DetachDiskInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private DetachDiskInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.deviceName = deviceName; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DetachDiskInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DetachDiskInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DetachDiskInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DetachDiskInstanceHttpRequest(); } @@ -370,11 +367,9 @@ public Builder setUserIp(String userIp) { return this; } - public DetachDiskInstanceHttpRequest build() { String missing = ""; - if (deviceName == null) { missing += " deviceName"; } @@ -383,25 +378,20 @@ public DetachDiskInstanceHttpRequest build() { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DetachDiskInstanceHttpRequest( - access_token, - callback, - deviceName, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -423,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "DetachDiskInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "deviceName=" + deviceName + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "deviceName=" + + deviceName + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -443,18 +452,16 @@ public boolean equals(Object o) { } if (o instanceof DetachDiskInstanceHttpRequest) { DetachDiskInstanceHttpRequest that = (DetachDiskInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.deviceName, that.getDeviceName()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.deviceName, that.getDeviceName()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -462,16 +469,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - deviceName, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java index 38b8fbe66e9c..60345cd24532 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private DisableXpnHostProjectHttpRequest() { this.userIp = null; } - private DisableXpnHostProjectHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private DisableXpnHostProjectHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DisableXpnHostProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DisableXpnHostProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DisableXpnHostProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DisableXpnHostProjectHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public DisableXpnHostProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DisableXpnHostProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "DisableXpnHostProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof DisableXpnHostProjectHttpRequest) { DisableXpnHostProjectHttpRequest that = (DisableXpnHostProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java index 6ff09081ff4b..3add0970478b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private DisableXpnResourceProjectHttpRequest() { this.userIp = null; } - private DisableXpnResourceProjectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private DisableXpnResourceProjectHttpRequest( ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -102,8 +97,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("project") && project != null) { fieldMap.put("project", Collections.singletonList(String.valueOf(project))); } - if (fieldNames.contains("projectsDisableXpnResourceRequestResource") && projectsDisableXpnResourceRequestResource != null) { - fieldMap.put("projectsDisableXpnResourceRequestResource", Collections.singletonList(String.valueOf(projectsDisableXpnResourceRequestResource))); + if (fieldNames.contains("projectsDisableXpnResourceRequestResource") + && projectsDisableXpnResourceRequestResource != null) { + fieldMap.put( + "projectsDisableXpnResourceRequestResource", + Collections.singletonList(String.valueOf(projectsDisableXpnResourceRequestResource))); } if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DisableXpnResourceProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DisableXpnResourceProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DisableXpnResourceProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DisableXpnResourceProjectHttpRequest(); } @@ -253,7 +253,8 @@ public Builder mergeFrom(DisableXpnResourceProjectHttpRequest other) { this.project = other.project; } if (other.getProjectsDisableXpnResourceRequestResource() != null) { - this.projectsDisableXpnResourceRequestResource = other.projectsDisableXpnResourceRequestResource; + this.projectsDisableXpnResourceRequestResource = + other.projectsDisableXpnResourceRequestResource; } if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; @@ -274,7 +275,8 @@ public Builder mergeFrom(DisableXpnResourceProjectHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.project = source.project; - this.projectsDisableXpnResourceRequestResource = source.projectsDisableXpnResourceRequestResource; + this.projectsDisableXpnResourceRequestResource = + source.projectsDisableXpnResourceRequestResource; this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.userIp = source.userIp; @@ -338,7 +340,8 @@ public ProjectsDisableXpnResourceRequest getProjectsDisableXpnResourceRequestRes return projectsDisableXpnResourceRequestResource; } - public Builder setProjectsDisableXpnResourceRequestResource(ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { + public Builder setProjectsDisableXpnResourceRequestResource( + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { this.projectsDisableXpnResourceRequestResource = projectsDisableXpnResourceRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public DisableXpnResourceProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new DisableXpnResourceProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - projectsDisableXpnResourceRequestResource, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsDisableXpnResourceRequestResource, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -410,7 +404,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); - newBuilder.setProjectsDisableXpnResourceRequestResource(this.projectsDisableXpnResourceRequestResource); + newBuilder.setProjectsDisableXpnResourceRequestResource( + this.projectsDisableXpnResourceRequestResource); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "DisableXpnResourceProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "projectsDisableXpnResourceRequestResource=" + projectsDisableXpnResourceRequestResource + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "projectsDisableXpnResourceRequestResource=" + + projectsDisableXpnResourceRequestResource + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof DisableXpnResourceProjectHttpRequest) { DisableXpnResourceProjectHttpRequest that = (DisableXpnResourceProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.projectsDisableXpnResourceRequestResource, that.getProjectsDisableXpnResourceRequestResource()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals( + this.projectsDisableXpnResourceRequestResource, + that.getProjectsDisableXpnResourceRequestResource()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - projectsDisableXpnResourceRequestResource, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsDisableXpnResourceRequestResource, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java index 1b0fc8fac81f..4a32a093e2ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,6 +41,7 @@ public final class Disk implements ApiMessage { private final Map labels; private final String lastAttachTimestamp; private final String lastDetachTimestamp; + private final List licenseCodes; private final List licenses; private final String name; private final String options; @@ -69,6 +69,7 @@ private Disk() { this.labels = null; this.lastAttachTimestamp = null; this.lastDetachTimestamp = null; + this.licenseCodes = null; this.licenses = null; this.name = null; this.options = null; @@ -86,7 +87,6 @@ private Disk() { this.zone = null; } - private Disk( String creationTimestamp, String description, @@ -98,6 +98,7 @@ private Disk( Map labels, String lastAttachTimestamp, String lastDetachTimestamp, + List licenseCodes, List licenses, String name, String options, @@ -112,8 +113,7 @@ private Disk( String status, String type, List users, - String zone - ) { + String zone) { this.creationTimestamp = creationTimestamp; this.description = description; this.diskEncryptionKey = diskEncryptionKey; @@ -124,6 +124,7 @@ private Disk( this.labels = labels; this.lastAttachTimestamp = lastAttachTimestamp; this.lastDetachTimestamp = lastDetachTimestamp; + this.licenseCodes = licenseCodes; this.licenses = licenses; this.name = name; this.options = options; @@ -145,13 +146,15 @@ private Disk( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put("diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); } if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -173,10 +176,19 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); } if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) { - fieldMap.put("lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); + fieldMap.put( + "lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); } if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) { - fieldMap.put("lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); + fieldMap.put( + "lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); + } + if (fieldNames.contains("licenseCodes") && licenseCodes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenseCodes) { + stringList.add(item.toString()); + } + fieldMap.put("licenseCodes", stringList.build()); } if (fieldNames.contains("licenses") && licenses != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -201,7 +213,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); } if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); } if (fieldNames.contains("sourceImageId") && sourceImageId != null) { fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); @@ -210,7 +224,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); } if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { - fieldMap.put("sourceSnapshotEncryptionKey", Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); + fieldMap.put( + "sourceSnapshotEncryptionKey", + Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); } if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); @@ -266,6 +282,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("lastDetachTimestamp")) { return String.valueOf(lastDetachTimestamp); } + if (fieldName.equals("licenseCodes")) { + return String.valueOf(licenseCodes); + } if (fieldName.equals("licenses")) { return String.valueOf(licenses); } @@ -360,6 +379,10 @@ public String getLastDetachTimestamp() { return lastDetachTimestamp; } + public List getLicenseCodesList() { + return licenseCodes; + } + public List getLicensesList() { return licenses; } @@ -420,22 +443,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Disk prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Disk getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Disk DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Disk(); } @@ -451,6 +476,7 @@ public static class Builder { private Map labels; private String lastAttachTimestamp; private String lastDetachTimestamp; + private List licenseCodes; private List licenses; private String name; private String options; @@ -501,6 +527,9 @@ public Builder mergeFrom(Disk other) { if (other.getLastDetachTimestamp() != null) { this.lastDetachTimestamp = other.lastDetachTimestamp; } + if (other.getLicenseCodesList() != null) { + this.licenseCodes = other.licenseCodes; + } if (other.getLicensesList() != null) { this.licenses = other.licenses; } @@ -560,6 +589,7 @@ public Builder mergeFrom(Disk other) { this.labels = source.labels; this.lastAttachTimestamp = source.lastAttachTimestamp; this.lastDetachTimestamp = source.lastDetachTimestamp; + this.licenseCodes = source.licenseCodes; this.licenses = source.licenses; this.name = source.name; this.options = source.options; @@ -675,6 +705,23 @@ public Builder setLastDetachTimestamp(String lastDetachTimestamp) { return this; } + public List getLicenseCodesList() { + return licenseCodes; + } + + public Builder addAllLicenseCodes(List licenseCodes) { + if (this.licenseCodes == null) { + this.licenseCodes = new ArrayList<>(licenseCodes.size()); + } + this.licenseCodes.addAll(licenseCodes); + return this; + } + + public Builder addLicenseCodes(String licenseCodes) { + this.licenseCodes.add(licenseCodes); + return this; + } + public List getLicensesList() { return licenses; } @@ -768,7 +815,8 @@ public CustomerEncryptionKey getSourceSnapshotEncryptionKey() { return sourceSnapshotEncryptionKey; } - public Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey) { + public Builder setSourceSnapshotEncryptionKey( + CustomerEncryptionKey sourceSnapshotEncryptionKey) { this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey; return this; } @@ -826,59 +874,35 @@ public Builder setZone(String zone) { return this; } - public Disk build() { - - - - - - - - - - - - - - - - - - - - - - - return new Disk( - creationTimestamp, - description, - diskEncryptionKey, - guestOsFeatures, - id, - kind, - labelFingerprint, - labels, - lastAttachTimestamp, - lastDetachTimestamp, - licenses, - name, - options, - selfLink, - sizeGb, - sourceImage, - sourceImageEncryptionKey, - sourceImageId, - sourceSnapshot, - sourceSnapshotEncryptionKey, - sourceSnapshotId, - status, - type, - users, - zone - ); + creationTimestamp, + description, + diskEncryptionKey, + guestOsFeatures, + id, + kind, + labelFingerprint, + labels, + lastAttachTimestamp, + lastDetachTimestamp, + licenseCodes, + licenses, + name, + options, + selfLink, + sizeGb, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + status, + type, + users, + zone); } public Builder clone() { @@ -893,6 +917,7 @@ public Builder clone() { newBuilder.putAllLabels(this.labels); newBuilder.setLastAttachTimestamp(this.lastAttachTimestamp); newBuilder.setLastDetachTimestamp(this.lastDetachTimestamp); + newBuilder.addAllLicenseCodes(this.licenseCodes); newBuilder.addAllLicenses(this.licenses); newBuilder.setName(this.name); newBuilder.setOptions(this.options); @@ -915,31 +940,83 @@ public Builder clone() { @Override public String toString() { return "Disk{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "diskEncryptionKey=" + diskEncryptionKey + ", " - + "guestOsFeatures=" + guestOsFeatures + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + ", " - + "lastAttachTimestamp=" + lastAttachTimestamp + ", " - + "lastDetachTimestamp=" + lastDetachTimestamp + ", " - + "licenses=" + licenses + ", " - + "name=" + name + ", " - + "options=" + options + ", " - + "selfLink=" + selfLink + ", " - + "sizeGb=" + sizeGb + ", " - + "sourceImage=" + sourceImage + ", " - + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + ", " - + "sourceImageId=" + sourceImageId + ", " - + "sourceSnapshot=" + sourceSnapshot + ", " - + "sourceSnapshotEncryptionKey=" + sourceSnapshotEncryptionKey + ", " - + "sourceSnapshotId=" + sourceSnapshotId + ", " - + "status=" + status + ", " - + "type=" + type + ", " - + "users=" + users + ", " - + "zone=" + zone + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "diskEncryptionKey=" + + diskEncryptionKey + + ", " + + "guestOsFeatures=" + + guestOsFeatures + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + + ", " + + "lastAttachTimestamp=" + + lastAttachTimestamp + + ", " + + "lastDetachTimestamp=" + + lastDetachTimestamp + + ", " + + "licenseCodes=" + + licenseCodes + + ", " + + "licenses=" + + licenses + + ", " + + "name=" + + name + + ", " + + "options=" + + options + + ", " + + "selfLink=" + + selfLink + + ", " + + "sizeGb=" + + sizeGb + + ", " + + "sourceImage=" + + sourceImage + + ", " + + "sourceImageEncryptionKey=" + + sourceImageEncryptionKey + + ", " + + "sourceImageId=" + + sourceImageId + + ", " + + "sourceSnapshot=" + + sourceSnapshot + + ", " + + "sourceSnapshotEncryptionKey=" + + sourceSnapshotEncryptionKey + + ", " + + "sourceSnapshotId=" + + sourceSnapshotId + + ", " + + "status=" + + status + + ", " + + "type=" + + type + + ", " + + "users=" + + users + + ", " + + "zone=" + + zone + "}"; } @@ -950,33 +1027,32 @@ public boolean equals(Object o) { } if (o instanceof Disk) { Disk that = (Disk) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) && - Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) && - Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp()) && - Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp()) && - Objects.equals(this.licenses, that.getLicensesList()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.options, that.getOptions()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sizeGb, that.getSizeGb()) && - Objects.equals(this.sourceImage, that.getSourceImage()) && - Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) && - Objects.equals(this.sourceImageId, that.getSourceImageId()) && - Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) && - Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) && - Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.type, that.getType()) && - Objects.equals(this.users, that.getUsersList()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.diskEncryptionKey, that.getDiskEncryptionKey()) + && Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()) + && Objects.equals(this.lastAttachTimestamp, that.getLastAttachTimestamp()) + && Objects.equals(this.lastDetachTimestamp, that.getLastDetachTimestamp()) + && Objects.equals(this.licenseCodes, that.getLicenseCodesList()) + && Objects.equals(this.licenses, that.getLicensesList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.options, that.getOptions()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sizeGb, that.getSizeGb()) + && Objects.equals(this.sourceImage, that.getSourceImage()) + && Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) + && Objects.equals(this.sourceImageId, that.getSourceImageId()) + && Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) + && Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) + && Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.type, that.getType()) + && Objects.equals(this.users, that.getUsersList()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -984,31 +1060,31 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - diskEncryptionKey, - guestOsFeatures, - id, - kind, - labelFingerprint, - labels, - lastAttachTimestamp, - lastDetachTimestamp, - licenses, - name, - options, - selfLink, - sizeGb, - sourceImage, - sourceImageEncryptionKey, - sourceImageId, - sourceSnapshot, - sourceSnapshotEncryptionKey, - sourceSnapshotId, - status, - type, - users, - zone - ); + creationTimestamp, + description, + diskEncryptionKey, + guestOsFeatures, + id, + kind, + labelFingerprint, + labels, + lastAttachTimestamp, + lastDetachTimestamp, + licenseCodes, + licenses, + name, + options, + selfLink, + sizeGb, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + status, + type, + users, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java index b9fffd676c49..e9267403e344 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private DiskAggregatedList() { this.warning = null; } - private DiskAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DiskAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DiskAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DiskAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DiskAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public DiskAggregatedList build() { - - - - - return new DiskAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new DiskAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "DiskAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof DiskAggregatedList) { DiskAggregatedList that = (DiskAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java index b587d6cc7733..ea95fbe574dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.DiskStub; import com.google.cloud.compute.v1.stub.DiskStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,34 +51,33 @@ * *

* - *

Note: close() needs to be called on the diskClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the diskClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of DiskSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of DiskSettings to create(). For + * example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -118,19 +107,14 @@ public class DiskClient implements BackgroundResource {
   private final DiskSettings settings;
   private final DiskStub stub;
 
-
-
-  /**
-   * Constructs an instance of DiskClient with default settings.
-   */
+  /** Constructs an instance of DiskClient with default settings. */
   public static final DiskClient create() throws IOException {
     return create(DiskSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of DiskClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of DiskClient, using the given settings. The channels are created based
+   * on the settings passed in, or defaults for any settings that are not set.
    */
   public static final DiskClient create(DiskSettings settings) throws IOException {
     return new DiskClient(settings);
@@ -146,9 +130,8 @@ public static final DiskClient create(DiskStub stub) {
   }
 
   /**
-   * Constructs an instance of DiskClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of DiskClient, using the given settings. This is protected so that it is
+   * easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected DiskClient(DiskSettings settings) throws IOException {
     this.settings = settings;
@@ -170,12 +153,12 @@ public DiskStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of persistent disks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -192,8 +175,8 @@ public DiskStub getStub() {
   public final AggregatedListDisksPagedResponse aggregatedListDisks(ProjectName project) {
     AggregatedListDisksHttpRequest request =
         AggregatedListDisksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListDisks(request);
   }
 
@@ -201,7 +184,8 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks(ProjectName pr
   /**
    * Retrieves an aggregated list of persistent disks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -217,9 +201,7 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks(ProjectName pr
   @BetaApi
   public final AggregatedListDisksPagedResponse aggregatedListDisks(String project) {
     AggregatedListDisksHttpRequest request =
-        AggregatedListDisksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListDisksHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListDisks(request);
   }
 
@@ -227,7 +209,8 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks(String project
   /**
    * Retrieves an aggregated list of persistent disks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -244,16 +227,17 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks(String project
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListDisksPagedResponse aggregatedListDisks(AggregatedListDisksHttpRequest request) {
-    return aggregatedListDisksPagedCallable()
-        .call(request);
+  public final AggregatedListDisksPagedResponse aggregatedListDisks(
+      AggregatedListDisksHttpRequest request) {
+    return aggregatedListDisksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of persistent disks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -269,7 +253,8 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks(AggregatedList
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListDisksPagedCallable() { + public final UnaryCallable + aggregatedListDisksPagedCallable() { return stub.aggregatedListDisksPagedCallable(); } @@ -277,7 +262,8 @@ public final UnaryCallableSample code: + * *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -300,7 +286,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListDisksCallable() { + public final UnaryCallable + aggregatedListDisksCallable() { return stub.aggregatedListDisksCallable(); } @@ -308,7 +295,8 @@ public final UnaryCallable a /** * Creates a snapshot of a specified persistent disk. * - * Sample code: + *

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -320,25 +308,31 @@ public final UnaryCallable a
    * 
* * @param disk Name of the persistent disk to snapshot. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param guestFlush - * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==) + * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots + * ==) (== resource_for v1.snapshots ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation createSnapshotDisk(ProjectZoneDiskName disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { + public final Operation createSnapshotDisk( + ProjectZoneDiskName disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() - .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) - .setGuestFlush(guestFlush) - .setSnapshotResource(snapshotResource) - .build(); + .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .setGuestFlush(guestFlush) + .setSnapshotResource(snapshotResource) + .build(); return createSnapshotDisk(request); } @@ -346,7 +340,8 @@ public final Operation createSnapshotDisk(ProjectZoneDiskName disk, String reque /** * Creates a snapshot of a specified persistent disk. * - * Sample code: + *

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -358,25 +353,31 @@ public final Operation createSnapshotDisk(ProjectZoneDiskName disk, String reque
    * 
* * @param disk Name of the persistent disk to snapshot. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param guestFlush - * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==) + * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots + * ==) (== resource_for v1.snapshots ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation createSnapshotDisk(String disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { + public final Operation createSnapshotDisk( + String disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() - .setDisk(disk) - .setRequestId(requestId) - .setGuestFlush(guestFlush) - .setSnapshotResource(snapshotResource) - .build(); + .setDisk(disk) + .setRequestId(requestId) + .setGuestFlush(guestFlush) + .setSnapshotResource(snapshotResource) + .build(); return createSnapshotDisk(request); } @@ -384,7 +385,8 @@ public final Operation createSnapshotDisk(String disk, String requestId, Boolean /** * Creates a snapshot of a specified persistent disk. * - * Sample code: + *

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -413,7 +415,8 @@ public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request)
   /**
    * Creates a snapshot of a specified persistent disk.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -433,15 +436,19 @@ public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable createSnapshotDiskCallable() { + public final UnaryCallable + createSnapshotDiskCallable() { return stub.createSnapshotDiskCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -451,11 +458,15 @@ public final UnaryCallable createSnaps
    * 
* * @param disk Name of the persistent disk to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -463,17 +474,20 @@ public final Operation deleteDisk(ProjectZoneDiskName disk, String requestId) { DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder() - .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) - .build(); + .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .build(); return deleteDisk(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -483,29 +497,33 @@ public final Operation deleteDisk(ProjectZoneDiskName disk, String requestId) {
    * 
* * @param disk Name of the persistent disk to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteDisk(String disk, String requestId) { DeleteDiskHttpRequest request = - DeleteDiskHttpRequest.newBuilder() - .setDisk(disk) - .setRequestId(requestId) - .build(); + DeleteDiskHttpRequest.newBuilder().setDisk(disk).setRequestId(requestId).build(); return deleteDisk(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -528,9 +546,12 @@ public final Operation deleteDisk(DeleteDiskHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -552,9 +573,11 @@ public final UnaryCallable deleteDiskCallable(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
+   * Returns a specified persistent disk. Get a list of available persistent disks by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -569,17 +592,17 @@ public final UnaryCallable deleteDiskCallable(
   public final Disk getDisk(ProjectZoneDiskName disk) {
 
     GetDiskHttpRequest request =
-        GetDiskHttpRequest.newBuilder()
-        .setDisk(disk == null ? null : disk.toString())
-        .build();
+        GetDiskHttpRequest.newBuilder().setDisk(disk == null ? null : disk.toString()).build();
     return getDisk(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
+   * Returns a specified persistent disk. Get a list of available persistent disks by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -593,18 +616,17 @@ public final Disk getDisk(ProjectZoneDiskName disk) {
   @BetaApi
   public final Disk getDisk(String disk) {
 
-    GetDiskHttpRequest request =
-        GetDiskHttpRequest.newBuilder()
-        .setDisk(disk)
-        .build();
+    GetDiskHttpRequest request = GetDiskHttpRequest.newBuilder().setDisk(disk).build();
     return getDisk(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
+   * Returns a specified persistent disk. Get a list of available persistent disks by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -625,9 +647,11 @@ public final Disk getDisk(GetDiskHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
+   * Returns a specified persistent disk. Get a list of available persistent disks by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -647,9 +671,13 @@ public final UnaryCallable getDiskCallable() {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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.
+   * Creates a persistent disk in the specified project using the data in the request. You can
+   * create a disk with a sourceImage, a sourceSnapshot, 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -661,33 +689,43 @@ public final UnaryCallable getDiskCallable() {
    * 
* * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param sourceImage Optional. Source image to restore onto a disk. - * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==) + * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertDisk(ProjectZoneName zone, String requestId, String sourceImage, Disk diskResource) { + public final Operation insertDisk( + ProjectZoneName zone, String requestId, String sourceImage, Disk diskResource) { InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setSourceImage(sourceImage) - .setDiskResource(diskResource) - .build(); + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setSourceImage(sourceImage) + .setDiskResource(diskResource) + .build(); return insertDisk(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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. + * Creates a persistent disk in the specified project using the data in the request. You can + * create a disk with a sourceImage, a sourceSnapshot, 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -699,33 +737,43 @@ public final Operation insertDisk(ProjectZoneName zone, String requestId, String
    * 
* * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param sourceImage Optional. Source image to restore onto a disk. - * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==) + * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertDisk(String zone, String requestId, String sourceImage, Disk diskResource) { + public final Operation insertDisk( + String zone, String requestId, String sourceImage, Disk diskResource) { InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setSourceImage(sourceImage) - .setDiskResource(diskResource) - .build(); + .setZone(zone) + .setRequestId(requestId) + .setSourceImage(sourceImage) + .setDiskResource(diskResource) + .build(); return insertDisk(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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. + * Creates a persistent disk in the specified project using the data in the request. You can + * create a disk with a sourceImage, a sourceSnapshot, 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -752,9 +800,13 @@ public final Operation insertDisk(InsertDiskHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, 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.
+   * Creates a persistent disk in the specified project using the data in the request. You can
+   * create a disk with a sourceImage, a sourceSnapshot, 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: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -782,7 +834,8 @@ public final UnaryCallable insertDiskCallable(
   /**
    * Retrieves a list of persistent disks contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -798,9 +851,7 @@ public final UnaryCallable insertDiskCallable(
   @BetaApi
   public final ListDisksPagedResponse listDisks(ProjectZoneName zone) {
     ListDisksHttpRequest request =
-        ListDisksHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+        ListDisksHttpRequest.newBuilder().setZone(zone == null ? null : zone.toString()).build();
     return listDisks(request);
   }
 
@@ -808,7 +859,8 @@ public final ListDisksPagedResponse listDisks(ProjectZoneName zone) {
   /**
    * Retrieves a list of persistent disks contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -823,10 +875,7 @@ public final ListDisksPagedResponse listDisks(ProjectZoneName zone) {
    */
   @BetaApi
   public final ListDisksPagedResponse listDisks(String zone) {
-    ListDisksHttpRequest request =
-        ListDisksHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+    ListDisksHttpRequest request = ListDisksHttpRequest.newBuilder().setZone(zone).build();
     return listDisks(request);
   }
 
@@ -834,7 +883,8 @@ public final ListDisksPagedResponse listDisks(String zone) {
   /**
    * Retrieves a list of persistent disks contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -852,15 +902,15 @@ public final ListDisksPagedResponse listDisks(String zone) {
    */
   @BetaApi
   public final ListDisksPagedResponse listDisks(ListDisksHttpRequest request) {
-    return listDisksPagedCallable()
-        .call(request);
+    return listDisksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of persistent disks contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -876,7 +926,8 @@ public final ListDisksPagedResponse listDisks(ListDisksHttpRequest request) {
    * 
*/ @BetaApi - public final UnaryCallable listDisksPagedCallable() { + public final UnaryCallable + listDisksPagedCallable() { return stub.listDisksPagedCallable(); } @@ -884,7 +935,8 @@ public final UnaryCallable listDis /** * Retrieves a list of persistent disks contained within the specified zone. * - * Sample code: + *

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -915,7 +967,8 @@ public final UnaryCallable listDisksCallable() {
   /**
    * Resizes the specified persistent disk. You can only increase the size of the disk.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -926,23 +979,28 @@ public final UnaryCallable listDisksCallable() {
    * 
* * @param disk The name of the persistent disk. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param disksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeDisk(ProjectZoneDiskName disk, String requestId, DisksResizeRequest disksResizeRequestResource) { + public final Operation resizeDisk( + ProjectZoneDiskName disk, String requestId, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() - .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) - .setDisksResizeRequestResource(disksResizeRequestResource) - .build(); + .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .setDisksResizeRequestResource(disksResizeRequestResource) + .build(); return resizeDisk(request); } @@ -950,7 +1008,8 @@ public final Operation resizeDisk(ProjectZoneDiskName disk, String requestId, Di /** * Resizes the specified persistent disk. You can only increase the size of the disk. * - * Sample code: + *

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -961,23 +1020,28 @@ public final Operation resizeDisk(ProjectZoneDiskName disk, String requestId, Di
    * 
* * @param disk The name of the persistent disk. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param disksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeDisk(String disk, String requestId, DisksResizeRequest disksResizeRequestResource) { + public final Operation resizeDisk( + String disk, String requestId, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() - .setDisk(disk) - .setRequestId(requestId) - .setDisksResizeRequestResource(disksResizeRequestResource) - .build(); + .setDisk(disk) + .setRequestId(requestId) + .setDisksResizeRequestResource(disksResizeRequestResource) + .build(); return resizeDisk(request); } @@ -985,7 +1049,8 @@ public final Operation resizeDisk(String disk, String requestId, DisksResizeRequ /** * Resizes the specified persistent disk. You can only increase the size of the disk. * - * Sample code: + *

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -1012,7 +1077,8 @@ public final Operation resizeDisk(ResizeDiskHttpRequest request) {
   /**
    * Resizes the specified persistent disk. You can only increase the size of the disk.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
@@ -1036,12 +1102,14 @@ public final UnaryCallable resizeDiskCallable(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on a disk. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   Operation response = diskClient.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource);
@@ -1049,34 +1117,43 @@ public final UnaryCallable resizeDiskCallable(
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param zoneSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setLabelsDisk(ProjectZoneDiskName resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + public final Operation setLabelsDisk( + ProjectZoneDiskResourceName resource, + String requestId, + ZoneSetLabelsRequest zoneSetLabelsRequestResource) { SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .setRequestId(requestId) - .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) - .build(); + .setResource(resource == null ? null : resource.toString()) + .setRequestId(requestId) + .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) + .build(); return setLabelsDisk(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources + * documentation. + * + *

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   Operation response = diskClient.setLabelsDisk(resource.toString(), requestId, zoneSetLabelsRequestResource);
@@ -1084,34 +1161,41 @@ public final Operation setLabelsDisk(ProjectZoneDiskName resource, String reques
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param zoneSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setLabelsDisk(String resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + public final Operation setLabelsDisk( + String resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder() - .setResource(resource) - .setRequestId(requestId) - .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) - .build(); + .setResource(resource) + .setRequestId(requestId) + .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) + .build(); return setLabelsDisk(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources + * documentation. + * + *

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
@@ -1133,12 +1217,14 @@ public final Operation setLabelsDisk(SetLabelsDiskHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on a disk. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (DiskClient diskClient = DiskClient.create()) {
-   *   ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
@@ -1158,7 +1244,7 @@ public final UnaryCallable setLabelsDiskCal
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -1187,12 +1273,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListDisksPagedResponse extends AbstractPagedListResponse<
-      AggregatedListDisksHttpRequest,
-      DiskAggregatedList,
-      DisksScopedList,
-      AggregatedListDisksPage,
-      AggregatedListDisksFixedSizeCollection> {
+  public static class AggregatedListDisksPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, DisksScopedList,
+          AggregatedListDisksPage, AggregatedListDisksFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -1212,15 +1296,12 @@ public AggregatedListDisksPagedResponse apply(AggregatedListDisksPage input) {
     private AggregatedListDisksPagedResponse(AggregatedListDisksPage page) {
       super(page, AggregatedListDisksFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListDisksPage extends AbstractPage<
-      AggregatedListDisksHttpRequest,
-      DiskAggregatedList,
-      DisksScopedList,
-      AggregatedListDisksPage> {
+  public static class AggregatedListDisksPage
+      extends AbstractPage<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, DisksScopedList,
+          AggregatedListDisksPage> {
 
     private AggregatedListDisksPage(
         PageContext context,
@@ -1245,20 +1326,15 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListDisksFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListDisksHttpRequest,
-      DiskAggregatedList,
-      DisksScopedList,
-      AggregatedListDisksPage,
-      AggregatedListDisksFixedSizeCollection> {
+  public static class AggregatedListDisksFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, DisksScopedList,
+          AggregatedListDisksPage, AggregatedListDisksFixedSizeCollection> {
 
-    private AggregatedListDisksFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListDisksFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -1271,15 +1347,11 @@ protected AggregatedListDisksFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListDisksFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListDisksPagedResponse extends AbstractPagedListResponse<
-      ListDisksHttpRequest,
-      DiskList,
-      Disk,
-      ListDisksPage,
-      ListDisksFixedSizeCollection> {
+
+  public static class ListDisksPagedResponse
+      extends AbstractPagedListResponse<
+          ListDisksHttpRequest, DiskList, Disk, ListDisksPage, ListDisksFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -1299,19 +1371,13 @@ public ListDisksPagedResponse apply(ListDisksPage input) {
     private ListDisksPagedResponse(ListDisksPage page) {
       super(page, ListDisksFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListDisksPage extends AbstractPage<
-      ListDisksHttpRequest,
-      DiskList,
-      Disk,
-      ListDisksPage> {
+  public static class ListDisksPage
+      extends AbstractPage {
 
     private ListDisksPage(
-        PageContext context,
-        DiskList response) {
+        PageContext context, DiskList response) {
       super(context, response);
     }
 
@@ -1321,8 +1387,7 @@ private static ListDisksPage createEmptyPage() {
 
     @Override
     protected ListDisksPage createPage(
-        PageContext context,
-        DiskList response) {
+        PageContext context, DiskList response) {
       return new ListDisksPage(context, response);
     }
 
@@ -1332,18 +1397,11 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListDisksFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListDisksHttpRequest,
-      DiskList,
-      Disk,
-      ListDisksPage,
-      ListDisksFixedSizeCollection> {
+  public static class ListDisksFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListDisksHttpRequest, DiskList, Disk, ListDisksPage, ListDisksFixedSizeCollection> {
 
     private ListDisksFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -1358,7 +1416,5 @@ protected ListDisksFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListDisksFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java
index 71d6483182a6..9aa240ff1239 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private DiskList() {
     this.warning = null;
   }
 
-
   private DiskList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(DiskList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DiskList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final DiskList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new DiskList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public DiskList build() {
 
-
-
-
-
-      return new DiskList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new DiskList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DiskList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof DiskList) {
       DiskList that = (DiskList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java
index 6bc5ed24ffa2..28420b92da74 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -40,11 +37,7 @@ private DiskMoveRequest() {
     this.targetDisk = null;
   }
 
-
-  private DiskMoveRequest(
-      String destinationZone,
-      String targetDisk
-      ) {
+  private DiskMoveRequest(String destinationZone, String targetDisk) {
     this.destinationZone = destinationZone;
     this.targetDisk = targetDisk;
   }
@@ -86,22 +79,24 @@ public String getTargetDisk() {
     return targetDisk;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(DiskMoveRequest prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DiskMoveRequest getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final DiskMoveRequest DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new DiskMoveRequest();
   }
@@ -146,13 +141,9 @@ public Builder setTargetDisk(String targetDisk) {
       return this;
     }
 
-
     public DiskMoveRequest build() {
 
-      return new DiskMoveRequest(
-        destinationZone,
-        targetDisk
-      );
+      return new DiskMoveRequest(destinationZone, targetDisk);
     }
 
     public Builder clone() {
@@ -166,8 +157,11 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DiskMoveRequest{"
-        + "destinationZone=" + destinationZone + ", "
-        + "targetDisk=" + targetDisk
+        + "destinationZone="
+        + destinationZone
+        + ", "
+        + "targetDisk="
+        + targetDisk
         + "}";
   }
 
@@ -178,19 +172,14 @@ public boolean equals(Object o) {
     }
     if (o instanceof DiskMoveRequest) {
       DiskMoveRequest that = (DiskMoveRequest) o;
-      return
-          Objects.equals(this.destinationZone, that.getDestinationZone()) &&
-          Objects.equals(this.targetDisk, that.getTargetDisk())
-          ;
+      return Objects.equals(this.destinationZone, that.getDestinationZone())
+          && Objects.equals(this.targetDisk, that.getTargetDisk());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      destinationZone,
-      targetDisk
-    );
+    return Objects.hash(destinationZone, targetDisk);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java
deleted file mode 100644
index 7d05b7340f59..000000000000
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskName.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 2018 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.compute.v1;
-
-import com.google.api.core.BetaApi;
-import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceNameFactory;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Generated;
-
-@Generated("by GAPIC")
-@BetaApi
-public final class DiskName implements com.google.api.resourcenames.ResourceName {
-  private final String disk;
-  private final String project;
-  private final String zone;
-  private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{disk}");
-
-  private volatile Map fieldValuesMap;
-
-  public static Builder newBuilder() {
-    return new Builder();
-  }
-
-  public Builder toBuilder() {
-    return new Builder(this);
-  }
-
-  private DiskName(Builder builder) {
-    disk = Preconditions.checkNotNull(builder.getDisk());
-    project = Preconditions.checkNotNull(builder.getProject());
-    zone = Preconditions.checkNotNull(builder.getZone());
-  }
-
-  public static DiskName of(
-      String disk,
-      String project,
-      String zone
-      ) {
-    return newBuilder()
-    .setDisk(disk)
-    .setProject(project)
-    .setZone(zone)
-      .build();
-  }
-
-  public static String format(
-      String disk,
-      String project,
-      String zone
-      ) {
-    return of(
-        disk,
-        project,
-        zone
-        )
-        .toString();
-  }
-
-  public String getDisk() {
-    return disk;
-  }
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getZone() {
-    return zone;
-  }
-
-
-  @Override
-  public Map getFieldValuesMap() {
-    if (fieldValuesMap == null) {
-      synchronized (this) {
-        if (fieldValuesMap == null) {
-          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
-          fieldMapBuilder.put("disk", disk);
-          fieldMapBuilder.put("project", project);
-          fieldMapBuilder.put("zone", zone);
-          fieldValuesMap = fieldMapBuilder.build();
-        }
-      }
-    }
-    return fieldValuesMap;
-  }
-
-  public String getFieldValue(String fieldName) {
-    return getFieldValuesMap().get(fieldName);
-  }
-
-
-  public static ResourceNameFactory newFactory() {
-    return new ResourceNameFactory() {
-      public DiskName parse(String formattedString) {return DiskName.parse(formattedString);}
-    };
-  }
-
-  public static DiskName parse(String formattedString) {
-    Map matchMap =
-        PATH_TEMPLATE.validatedMatch(formattedString, "DiskName.parse: formattedString not in valid format");
-    return of(
-      matchMap.get("disk"),
-      matchMap.get("project"),
-      matchMap.get("zone")
-    );
-  }
-
-  public static boolean isParsableFrom(String formattedString) {
-    return PATH_TEMPLATE.matches(formattedString);
-  }
-
-  public static class Builder {
-    private String disk;
-    private String project;
-    private String zone;
-
-    public String getDisk() {
-      return disk;
-    }
-    public String getProject() {
-      return project;
-    }
-    public String getZone() {
-      return zone;
-    }
-
-    public Builder setDisk(String disk) {
-      this.disk = disk;
-      return this;
-    }
-    public Builder setProject(String project) {
-      this.project = project;
-      return this;
-    }
-    public Builder setZone(String zone) {
-      this.zone = zone;
-      return this;
-    }
-
-    private Builder() {}
-
-    public Builder (DiskName diskName) {
-      disk = diskName.disk;
-      project = diskName.project;
-      zone = diskName.zone;
-    }
-
-    public DiskName build() {
-      return new DiskName(this);
-    }
-  }
-
-  @Override
-  public String toString() {
-    return PATH_TEMPLATE.instantiate(
-        "disk", disk,
-        "project", project,
-        "zone", zone
-        );
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o instanceof DiskName) {
-      DiskName that = (DiskName) o;
-      return
-          Objects.equals(this.disk, that.getDisk()) &&
-          Objects.equals(this.project, that.getProject()) &&
-          Objects.equals(this.zone, that.getZone())
-          ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(
-      disk,
-      project,
-      zone
-    );
-  }
-}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java
index 4f0c59d8a0c1..e4c3d5e4d196 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java
@@ -15,46 +15,24 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse;
+import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse;
-import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse;
 import com.google.cloud.compute.v1.stub.DiskStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -63,15 +41,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of createSnapshotDisk to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSnapshotDisk to 30 seconds: * *

  * 
@@ -86,105 +64,80 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class DiskSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListDisks.
-   */
-  public PagedCallSettings aggregatedListDisksSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListDisks. */
+  public PagedCallSettings<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
+      aggregatedListDisksSettings() {
     return ((DiskStubSettings) getStubSettings()).aggregatedListDisksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to createSnapshotDisk.
-   */
+  /** Returns the object with the settings used for calls to createSnapshotDisk. */
   public UnaryCallSettings createSnapshotDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).createSnapshotDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteDisk.
-   */
+  /** Returns the object with the settings used for calls to deleteDisk. */
   public UnaryCallSettings deleteDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).deleteDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getDisk.
-   */
+  /** Returns the object with the settings used for calls to getDisk. */
   public UnaryCallSettings getDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).getDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertDisk.
-   */
+  /** Returns the object with the settings used for calls to insertDisk. */
   public UnaryCallSettings insertDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).insertDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listDisks.
-   */
-  public PagedCallSettings listDisksSettings() {
+  /** Returns the object with the settings used for calls to listDisks. */
+  public PagedCallSettings
+      listDisksSettings() {
     return ((DiskStubSettings) getStubSettings()).listDisksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeDisk.
-   */
+  /** Returns the object with the settings used for calls to resizeDisk. */
   public UnaryCallSettings resizeDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).resizeDiskSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsDisk.
-   */
+  /** Returns the object with the settings used for calls to setLabelsDisk. */
   public UnaryCallSettings setLabelsDiskSettings() {
     return ((DiskStubSettings) getStubSettings()).setLabelsDiskSettings();
   }
 
-
   public static final DiskSettings create(DiskStubSettings stub) throws IOException {
     return new DiskSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return DiskStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return DiskStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return DiskStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return DiskStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DiskStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return DiskStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return DiskStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -197,23 +150,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return DiskStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -222,9 +169,7 @@ protected DiskSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for DiskSettings.
-   */
+  /** Builder for DiskSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -246,73 +191,63 @@ protected Builder(DiskStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public DiskStubSettings.Builder getStubSettingsBuilder() {
       return ((DiskStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListDisks. - */ - public PagedCallSettings.Builder aggregatedListDisksSettings() { + /** Returns the builder for the settings used for calls to aggregatedListDisks. */ + public PagedCallSettings.Builder< + AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse> + aggregatedListDisksSettings() { return getStubSettingsBuilder().aggregatedListDisksSettings(); } - /** - * Returns the builder for the settings used for calls to createSnapshotDisk. - */ - public UnaryCallSettings.Builder createSnapshotDiskSettings() { + /** Returns the builder for the settings used for calls to createSnapshotDisk. */ + public UnaryCallSettings.Builder + createSnapshotDiskSettings() { return getStubSettingsBuilder().createSnapshotDiskSettings(); } - /** - * Returns the builder for the settings used for calls to deleteDisk. - */ + /** Returns the builder for the settings used for calls to deleteDisk. */ public UnaryCallSettings.Builder deleteDiskSettings() { return getStubSettingsBuilder().deleteDiskSettings(); } - /** - * Returns the builder for the settings used for calls to getDisk. - */ + /** Returns the builder for the settings used for calls to getDisk. */ public UnaryCallSettings.Builder getDiskSettings() { return getStubSettingsBuilder().getDiskSettings(); } - /** - * Returns the builder for the settings used for calls to insertDisk. - */ + /** Returns the builder for the settings used for calls to insertDisk. */ public UnaryCallSettings.Builder insertDiskSettings() { return getStubSettingsBuilder().insertDiskSettings(); } - /** - * Returns the builder for the settings used for calls to listDisks. - */ - public PagedCallSettings.Builder listDisksSettings() { + /** Returns the builder for the settings used for calls to listDisks. */ + public PagedCallSettings.Builder + listDisksSettings() { return getStubSettingsBuilder().listDisksSettings(); } - /** - * Returns the builder for the settings used for calls to resizeDisk. - */ + /** Returns the builder for the settings used for calls to resizeDisk. */ public UnaryCallSettings.Builder resizeDiskSettings() { return getStubSettingsBuilder().resizeDiskSettings(); } - /** - * Returns the builder for the settings used for calls to setLabelsDisk. - */ + /** Returns the builder for the settings used for calls to setLabelsDisk. */ public UnaryCallSettings.Builder setLabelsDiskSettings() { return getStubSettingsBuilder().setLabelsDiskSettings(); } @@ -322,4 +257,4 @@ public DiskSettings build() throws IOException { return new DiskSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java index 9dc9879cf632..a3283274dd37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private DiskType() { this.zone = null; } - private DiskType( String creationTimestamp, String defaultDiskSizeGb, @@ -67,8 +63,7 @@ private DiskType( String name, String selfLink, String validDiskSize, - String zone - ) { + String zone) { this.creationTimestamp = creationTimestamp; this.defaultDiskSizeGb = defaultDiskSizeGb; this.deprecated = deprecated; @@ -85,10 +80,12 @@ private DiskType( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("defaultDiskSizeGb") && defaultDiskSizeGb != null) { - fieldMap.put("defaultDiskSizeGb", Collections.singletonList(String.valueOf(defaultDiskSizeGb))); + fieldMap.put( + "defaultDiskSizeGb", Collections.singletonList(String.valueOf(defaultDiskSizeGb))); } if (fieldNames.contains("deprecated") && deprecated != null) { fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); @@ -198,22 +195,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DiskType prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DiskType getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DiskType DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DiskType(); } @@ -370,29 +369,19 @@ public Builder setZone(String zone) { return this; } - public DiskType build() { - - - - - - - - return new DiskType( - creationTimestamp, - defaultDiskSizeGb, - deprecated, - description, - id, - kind, - name, - selfLink, - validDiskSize, - zone - ); + creationTimestamp, + defaultDiskSizeGb, + deprecated, + description, + id, + kind, + name, + selfLink, + validDiskSize, + zone); } public Builder clone() { @@ -414,16 +403,35 @@ public Builder clone() { @Override public String toString() { return "DiskType{" - + "creationTimestamp=" + creationTimestamp + ", " - + "defaultDiskSizeGb=" + defaultDiskSizeGb + ", " - + "deprecated=" + deprecated + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + ", " - + "validDiskSize=" + validDiskSize + ", " - + "zone=" + zone + + "creationTimestamp=" + + creationTimestamp + + ", " + + "defaultDiskSizeGb=" + + defaultDiskSizeGb + + ", " + + "deprecated=" + + deprecated + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "validDiskSize=" + + validDiskSize + + ", " + + "zone=" + + zone + "}"; } @@ -434,18 +442,16 @@ public boolean equals(Object o) { } if (o instanceof DiskType) { DiskType that = (DiskType) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.defaultDiskSizeGb, that.getDefaultDiskSizeGb()) && - Objects.equals(this.deprecated, that.getDeprecated()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.validDiskSize, that.getValidDiskSize()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.defaultDiskSizeGb, that.getDefaultDiskSizeGb()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.validDiskSize, that.getValidDiskSize()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -453,16 +459,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - defaultDiskSizeGb, - deprecated, - description, - id, - kind, - name, - selfLink, - validDiskSize, - zone - ); + creationTimestamp, + defaultDiskSizeGb, + deprecated, + description, + id, + kind, + name, + selfLink, + validDiskSize, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java index 9b76cb606445..b41efcfa2bfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private DiskTypeAggregatedList() { this.warning = null; } - private DiskTypeAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DiskTypeAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DiskTypeAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DiskTypeAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DiskTypeAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public DiskTypeAggregatedList build() { - - - - - return new DiskTypeAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new DiskTypeAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "DiskTypeAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof DiskTypeAggregatedList) { DiskTypeAggregatedList that = (DiskTypeAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java index 50f46a9edf2d..31482c88ecc8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.DiskTypeStub; import com.google.cloud.compute.v1.stub.DiskTypeStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,33 @@ * *

* - *

Note: close() needs to be called on the diskTypeClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the diskTypeClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of DiskTypeSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of DiskTypeSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +104,14 @@ public class DiskTypeClient implements BackgroundResource {
   private final DiskTypeSettings settings;
   private final DiskTypeStub stub;
 
-
-
-  /**
-   * Constructs an instance of DiskTypeClient with default settings.
-   */
+  /** Constructs an instance of DiskTypeClient with default settings. */
   public static final DiskTypeClient create() throws IOException {
     return create(DiskTypeSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of DiskTypeClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of DiskTypeClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final DiskTypeClient create(DiskTypeSettings settings) throws IOException {
     return new DiskTypeClient(settings);
@@ -143,9 +127,8 @@ public static final DiskTypeClient create(DiskTypeStub stub) {
   }
 
   /**
-   * Constructs an instance of DiskTypeClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of DiskTypeClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected DiskTypeClient(DiskTypeSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +150,12 @@ public DiskTypeStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of disk types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -189,8 +172,8 @@ public DiskTypeStub getStub() {
   public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(ProjectName project) {
     AggregatedListDiskTypesHttpRequest request =
         AggregatedListDiskTypesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListDiskTypes(request);
   }
 
@@ -198,7 +181,8 @@ public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(Projec
   /**
    * Retrieves an aggregated list of disk types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -214,9 +198,7 @@ public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(Projec
   @BetaApi
   public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(String project) {
     AggregatedListDiskTypesHttpRequest request =
-        AggregatedListDiskTypesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListDiskTypesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListDiskTypes(request);
   }
 
@@ -224,7 +206,8 @@ public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(String
   /**
    * Retrieves an aggregated list of disk types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +224,17 @@ public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(AggregatedListDiskTypesHttpRequest request) {
-    return aggregatedListDiskTypesPagedCallable()
-        .call(request);
+  public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(
+      AggregatedListDiskTypesHttpRequest request) {
+    return aggregatedListDiskTypesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of disk types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +250,9 @@ public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes(Aggreg
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListDiskTypesPagedCallable() { + public final UnaryCallable< + AggregatedListDiskTypesHttpRequest, AggregatedListDiskTypesPagedResponse> + aggregatedListDiskTypesPagedCallable() { return stub.aggregatedListDiskTypesPagedCallable(); } @@ -274,7 +260,8 @@ public final UnaryCallableSample code: + * *

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,7 +284,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListDiskTypesCallable() { + public final UnaryCallable + aggregatedListDiskTypesCallable() { return stub.aggregatedListDiskTypesCallable(); } @@ -305,7 +293,8 @@ public final UnaryCallableSample code: + * *

    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
@@ -321,8 +310,8 @@ public final DiskType getDiskType(ProjectZoneDiskTypeName diskType) {
 
     GetDiskTypeHttpRequest request =
         GetDiskTypeHttpRequest.newBuilder()
-        .setDiskType(diskType == null ? null : diskType.toString())
-        .build();
+            .setDiskType(diskType == null ? null : diskType.toString())
+            .build();
     return getDiskType(request);
   }
 
@@ -330,7 +319,8 @@ public final DiskType getDiskType(ProjectZoneDiskTypeName diskType) {
   /**
    * Returns the specified disk type. Get a list of available disk types by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
@@ -345,9 +335,7 @@ public final DiskType getDiskType(ProjectZoneDiskTypeName diskType) {
   public final DiskType getDiskType(String diskType) {
 
     GetDiskTypeHttpRequest request =
-        GetDiskTypeHttpRequest.newBuilder()
-        .setDiskType(diskType)
-        .build();
+        GetDiskTypeHttpRequest.newBuilder().setDiskType(diskType).build();
     return getDiskType(request);
   }
 
@@ -355,7 +343,8 @@ public final DiskType getDiskType(String diskType) {
   /**
    * Returns the specified disk type. Get a list of available disk types by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
@@ -378,7 +367,8 @@ public final DiskType getDiskType(GetDiskTypeHttpRequest request) {
   /**
    * Returns the specified disk type. Get a list of available disk types by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]");
@@ -400,7 +390,8 @@ public final UnaryCallable getDiskTypeCallable
   /**
    * Retrieves a list of disk types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -417,8 +408,8 @@ public final UnaryCallable getDiskTypeCallable
   public final ListDiskTypesPagedResponse listDiskTypes(ProjectZoneName zone) {
     ListDiskTypesHttpRequest request =
         ListDiskTypesHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listDiskTypes(request);
   }
 
@@ -426,7 +417,8 @@ public final ListDiskTypesPagedResponse listDiskTypes(ProjectZoneName zone) {
   /**
    * Retrieves a list of disk types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -441,10 +433,7 @@ public final ListDiskTypesPagedResponse listDiskTypes(ProjectZoneName zone) {
    */
   @BetaApi
   public final ListDiskTypesPagedResponse listDiskTypes(String zone) {
-    ListDiskTypesHttpRequest request =
-        ListDiskTypesHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+    ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder().setZone(zone).build();
     return listDiskTypes(request);
   }
 
@@ -452,7 +441,8 @@ public final ListDiskTypesPagedResponse listDiskTypes(String zone) {
   /**
    * Retrieves a list of disk types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -470,15 +460,15 @@ public final ListDiskTypesPagedResponse listDiskTypes(String zone) {
    */
   @BetaApi
   public final ListDiskTypesPagedResponse listDiskTypes(ListDiskTypesHttpRequest request) {
-    return listDiskTypesPagedCallable()
-        .call(request);
+    return listDiskTypesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of disk types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -494,7 +484,8 @@ public final ListDiskTypesPagedResponse listDiskTypes(ListDiskTypesHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable listDiskTypesPagedCallable() { + public final UnaryCallable + listDiskTypesPagedCallable() { return stub.listDiskTypesPagedCallable(); } @@ -502,7 +493,8 @@ public final UnaryCallable /** * Retrieves a list of disk types available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -530,7 +522,7 @@ public final UnaryCallable listDiskTypes
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -559,15 +551,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListDiskTypesPagedResponse extends AbstractPagedListResponse<
-      AggregatedListDiskTypesHttpRequest,
-      DiskTypeAggregatedList,
-      DiskTypesScopedList,
-      AggregatedListDiskTypesPage,
-      AggregatedListDiskTypesFixedSizeCollection> {
+  public static class AggregatedListDiskTypesPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, DiskTypesScopedList,
+          AggregatedListDiskTypesPage, AggregatedListDiskTypesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
-        PageContext context,
+        PageContext
+            context,
         ApiFuture futureResponse) {
       ApiFuture futurePage =
           AggregatedListDiskTypesPage.createEmptyPage().createPageAsync(context, futureResponse);
@@ -584,18 +575,16 @@ public AggregatedListDiskTypesPagedResponse apply(AggregatedListDiskTypesPage in
     private AggregatedListDiskTypesPagedResponse(AggregatedListDiskTypesPage page) {
       super(page, AggregatedListDiskTypesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListDiskTypesPage extends AbstractPage<
-      AggregatedListDiskTypesHttpRequest,
-      DiskTypeAggregatedList,
-      DiskTypesScopedList,
-      AggregatedListDiskTypesPage> {
+  public static class AggregatedListDiskTypesPage
+      extends AbstractPage<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, DiskTypesScopedList,
+          AggregatedListDiskTypesPage> {
 
     private AggregatedListDiskTypesPage(
-        PageContext context,
+        PageContext
+            context,
         DiskTypeAggregatedList response) {
       super(context, response);
     }
@@ -606,31 +595,28 @@ private static AggregatedListDiskTypesPage createEmptyPage() {
 
     @Override
     protected AggregatedListDiskTypesPage createPage(
-        PageContext context,
+        PageContext
+            context,
         DiskTypeAggregatedList response) {
       return new AggregatedListDiskTypesPage(context, response);
     }
 
     @Override
     public ApiFuture createPageAsync(
-        PageContext context,
+        PageContext
+            context,
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListDiskTypesFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListDiskTypesHttpRequest,
-      DiskTypeAggregatedList,
-      DiskTypesScopedList,
-      AggregatedListDiskTypesPage,
-      AggregatedListDiskTypesFixedSizeCollection> {
+  public static class AggregatedListDiskTypesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, DiskTypesScopedList,
+          AggregatedListDiskTypesPage, AggregatedListDiskTypesFixedSizeCollection> {
 
-    private AggregatedListDiskTypesFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListDiskTypesFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -643,15 +629,12 @@ protected AggregatedListDiskTypesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListDiskTypesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListDiskTypesPagedResponse extends AbstractPagedListResponse<
-      ListDiskTypesHttpRequest,
-      DiskTypeList,
-      DiskType,
-      ListDiskTypesPage,
-      ListDiskTypesFixedSizeCollection> {
+
+  public static class ListDiskTypesPagedResponse
+      extends AbstractPagedListResponse<
+          ListDiskTypesHttpRequest, DiskTypeList, DiskType, ListDiskTypesPage,
+          ListDiskTypesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -671,15 +654,10 @@ public ListDiskTypesPagedResponse apply(ListDiskTypesPage input) {
     private ListDiskTypesPagedResponse(ListDiskTypesPage page) {
       super(page, ListDiskTypesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListDiskTypesPage extends AbstractPage<
-      ListDiskTypesHttpRequest,
-      DiskTypeList,
-      DiskType,
-      ListDiskTypesPage> {
+  public static class ListDiskTypesPage
+      extends AbstractPage {
 
     private ListDiskTypesPage(
         PageContext context,
@@ -704,18 +682,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListDiskTypesFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListDiskTypesHttpRequest,
-      DiskTypeList,
-      DiskType,
-      ListDiskTypesPage,
-      ListDiskTypesFixedSizeCollection> {
+  public static class ListDiskTypesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListDiskTypesHttpRequest, DiskTypeList, DiskType, ListDiskTypesPage,
+          ListDiskTypesFixedSizeCollection> {
 
     private ListDiskTypesFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -730,7 +702,5 @@ protected ListDiskTypesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListDiskTypesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java
index d169597bbbac..ebd739b3d4ff 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private DiskTypeList() {
     this.warning = null;
   }
 
-
   private DiskTypeList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(DiskTypeList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static DiskTypeList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final DiskTypeList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new DiskTypeList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public DiskTypeList build() {
 
-
-
-
-
-      return new DiskTypeList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new DiskTypeList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "DiskTypeList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof DiskTypeList) {
       DiskTypeList that = (DiskTypeList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java
index 1a121be13fbf..53299aac8849 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java
@@ -15,46 +15,24 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse;
+import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse;
-import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse;
 import com.google.cloud.compute.v1.stub.DiskTypeStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -63,15 +41,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getDiskType to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getDiskType to 30 seconds: * *

  * 
@@ -86,70 +64,56 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class DiskTypeSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListDiskTypes.
-   */
-  public PagedCallSettings aggregatedListDiskTypesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListDiskTypes. */
+  public PagedCallSettings<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+          AggregatedListDiskTypesPagedResponse>
+      aggregatedListDiskTypesSettings() {
     return ((DiskTypeStubSettings) getStubSettings()).aggregatedListDiskTypesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getDiskType.
-   */
+  /** Returns the object with the settings used for calls to getDiskType. */
   public UnaryCallSettings getDiskTypeSettings() {
     return ((DiskTypeStubSettings) getStubSettings()).getDiskTypeSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listDiskTypes.
-   */
-  public PagedCallSettings listDiskTypesSettings() {
+  /** Returns the object with the settings used for calls to listDiskTypes. */
+  public PagedCallSettings
+      listDiskTypesSettings() {
     return ((DiskTypeStubSettings) getStubSettings()).listDiskTypesSettings();
   }
 
-
   public static final DiskTypeSettings create(DiskTypeStubSettings stub) throws IOException {
     return new DiskTypeSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return DiskTypeStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return DiskTypeStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return DiskTypeStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return DiskTypeStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DiskTypeStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return DiskTypeStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return DiskTypeStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -162,23 +126,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return DiskTypeStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -187,9 +145,7 @@ protected DiskTypeSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for DiskTypeSettings.
-   */
+  /** Builder for DiskTypeSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -211,39 +167,40 @@ protected Builder(DiskTypeStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public DiskTypeStubSettings.Builder getStubSettingsBuilder() {
       return ((DiskTypeStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListDiskTypes. - */ - public PagedCallSettings.Builder aggregatedListDiskTypesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListDiskTypes. */ + public PagedCallSettings.Builder< + AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, + AggregatedListDiskTypesPagedResponse> + aggregatedListDiskTypesSettings() { return getStubSettingsBuilder().aggregatedListDiskTypesSettings(); } - /** - * Returns the builder for the settings used for calls to getDiskType. - */ + /** Returns the builder for the settings used for calls to getDiskType. */ public UnaryCallSettings.Builder getDiskTypeSettings() { return getStubSettingsBuilder().getDiskTypeSettings(); } - /** - * Returns the builder for the settings used for calls to listDiskTypes. - */ - public PagedCallSettings.Builder listDiskTypesSettings() { + /** Returns the builder for the settings used for calls to listDiskTypes. */ + public PagedCallSettings.Builder< + ListDiskTypesHttpRequest, DiskTypeList, ListDiskTypesPagedResponse> + listDiskTypesSettings() { return getStubSettingsBuilder().listDiskTypesSettings(); } @@ -252,4 +209,4 @@ public DiskTypeSettings build() throws IOException { return new DiskTypeSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java index 44673da3fa2d..03ace04edf50 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private DiskTypesScopedList() { this.warning = null; } - - private DiskTypesScopedList( - List diskTypes, - Warning warning - ) { + private DiskTypesScopedList(List diskTypes, Warning warning) { this.diskTypes = diskTypes; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DiskTypesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DiskTypesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DiskTypesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DiskTypesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public DiskTypesScopedList build() { - return new DiskTypesScopedList( - diskTypes, - warning - ); + return new DiskTypesScopedList(diskTypes, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "DiskTypesScopedList{" - + "diskTypes=" + diskTypes + ", " - + "warning=" + warning - + "}"; + return "DiskTypesScopedList{" + "diskTypes=" + diskTypes + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof DiskTypesScopedList) { DiskTypesScopedList that = (DiskTypesScopedList) o; - return - Objects.equals(this.diskTypes, that.getDiskTypesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.diskTypes, that.getDiskTypesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - diskTypes, - warning - ); + return Objects.hash(diskTypes, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java index f2c3fe1925cf..6f833e5e86d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private DisksResizeRequest() { this.sizeGb = null; } - - private DisksResizeRequest( - String sizeGb - ) { + private DisksResizeRequest(String sizeGb) { this.sizeGb = sizeGb; } @@ -72,22 +66,24 @@ public String getSizeGb() { return sizeGb; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DisksResizeRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DisksResizeRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DisksResizeRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DisksResizeRequest(); } @@ -118,11 +114,8 @@ public Builder setSizeGb(String sizeGb) { return this; } - public DisksResizeRequest build() { - return new DisksResizeRequest( - sizeGb - ); + return new DisksResizeRequest(sizeGb); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "DisksResizeRequest{" - + "sizeGb=" + sizeGb - + "}"; + return "DisksResizeRequest{" + "sizeGb=" + sizeGb + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof DisksResizeRequest) { DisksResizeRequest that = (DisksResizeRequest) o; - return - Objects.equals(this.sizeGb, that.getSizeGb()) - ; + return Objects.equals(this.sizeGb, that.getSizeGb()); } return false; } @Override public int hashCode() { - return Objects.hash( - sizeGb - ); + return Objects.hash(sizeGb); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java index 43cc1f116e0f..25d5992e60fd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private DisksScopedList() { this.warning = null; } - - private DisksScopedList( - List disks, - Warning warning - ) { + private DisksScopedList(List disks, Warning warning) { this.disks = disks; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(DisksScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static DisksScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final DisksScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new DisksScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public DisksScopedList build() { - return new DisksScopedList( - disks, - warning - ); + return new DisksScopedList(disks, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "DisksScopedList{" - + "disks=" + disks + ", " - + "warning=" + warning - + "}"; + return "DisksScopedList{" + "disks=" + disks + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof DisksScopedList) { DisksScopedList that = (DisksScopedList) o; - return - Objects.equals(this.disks, that.getDisksList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.disks, that.getDisksList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - disks, - warning - ); + return Objects.hash(disks, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java index 3c6783547fac..80bee960b45c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private EnableXpnHostProjectHttpRequest() { this.userIp = null; } - private EnableXpnHostProjectHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private EnableXpnHostProjectHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(EnableXpnHostProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static EnableXpnHostProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final EnableXpnHostProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new EnableXpnHostProjectHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public EnableXpnHostProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new EnableXpnHostProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "EnableXpnHostProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof EnableXpnHostProjectHttpRequest) { EnableXpnHostProjectHttpRequest that = (EnableXpnHostProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java index 700d682229ec..b8318817bae1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private EnableXpnResourceProjectHttpRequest() { this.userIp = null; } - private EnableXpnResourceProjectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private EnableXpnResourceProjectHttpRequest( ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -102,8 +97,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("project") && project != null) { fieldMap.put("project", Collections.singletonList(String.valueOf(project))); } - if (fieldNames.contains("projectsEnableXpnResourceRequestResource") && projectsEnableXpnResourceRequestResource != null) { - fieldMap.put("projectsEnableXpnResourceRequestResource", Collections.singletonList(String.valueOf(projectsEnableXpnResourceRequestResource))); + if (fieldNames.contains("projectsEnableXpnResourceRequestResource") + && projectsEnableXpnResourceRequestResource != null) { + fieldMap.put( + "projectsEnableXpnResourceRequestResource", + Collections.singletonList(String.valueOf(projectsEnableXpnResourceRequestResource))); } if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(EnableXpnResourceProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static EnableXpnResourceProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final EnableXpnResourceProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new EnableXpnResourceProjectHttpRequest(); } @@ -253,7 +253,8 @@ public Builder mergeFrom(EnableXpnResourceProjectHttpRequest other) { this.project = other.project; } if (other.getProjectsEnableXpnResourceRequestResource() != null) { - this.projectsEnableXpnResourceRequestResource = other.projectsEnableXpnResourceRequestResource; + this.projectsEnableXpnResourceRequestResource = + other.projectsEnableXpnResourceRequestResource; } if (other.getQuotaUser() != null) { this.quotaUser = other.quotaUser; @@ -274,7 +275,8 @@ public Builder mergeFrom(EnableXpnResourceProjectHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.project = source.project; - this.projectsEnableXpnResourceRequestResource = source.projectsEnableXpnResourceRequestResource; + this.projectsEnableXpnResourceRequestResource = + source.projectsEnableXpnResourceRequestResource; this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.userIp = source.userIp; @@ -338,7 +340,8 @@ public ProjectsEnableXpnResourceRequest getProjectsEnableXpnResourceRequestResou return projectsEnableXpnResourceRequestResource; } - public Builder setProjectsEnableXpnResourceRequestResource(ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + public Builder setProjectsEnableXpnResourceRequestResource( + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { this.projectsEnableXpnResourceRequestResource = projectsEnableXpnResourceRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public EnableXpnResourceProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new EnableXpnResourceProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - projectsEnableXpnResourceRequestResource, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsEnableXpnResourceRequestResource, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -410,7 +404,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setProject(this.project); - newBuilder.setProjectsEnableXpnResourceRequestResource(this.projectsEnableXpnResourceRequestResource); + newBuilder.setProjectsEnableXpnResourceRequestResource( + this.projectsEnableXpnResourceRequestResource); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "EnableXpnResourceProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "projectsEnableXpnResourceRequestResource=" + projectsEnableXpnResourceRequestResource + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "projectsEnableXpnResourceRequestResource=" + + projectsEnableXpnResourceRequestResource + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof EnableXpnResourceProjectHttpRequest) { EnableXpnResourceProjectHttpRequest that = (EnableXpnResourceProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.projectsEnableXpnResourceRequestResource, that.getProjectsEnableXpnResourceRequestResource()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals( + this.projectsEnableXpnResourceRequestResource, + that.getProjectsEnableXpnResourceRequestResource()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - projectsEnableXpnResourceRequestResource, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsEnableXpnResourceRequestResource, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java index da44bda46c2a..b75652abd576 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private Error() { this.errors = null; } - - private Error( - List errors - ) { + private Error(List errors) { this.errors = errors; } @@ -76,22 +71,24 @@ public List getErrorsList() { return errors; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Error prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Error getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Error DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Error(); } @@ -130,11 +127,8 @@ public Builder addErrors(Errors errors) { return this; } - public Error build() { - return new Error( - errors - ); + return new Error(errors); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "Error{" - + "errors=" + errors - + "}"; + return "Error{" + "errors=" + errors + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof Error) { Error that = (Error) o; - return - Objects.equals(this.errors, that.getErrorsList()) - ; + return Objects.equals(this.errors, that.getErrorsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - errors - ); + return Objects.hash(errors); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index d9d1e491ba49..4a8dc4f78995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private Errors() { this.message = null; } - - private Errors( - String code, - String location, - String message - ) { + private Errors(String code, String location, String message) { this.code = code; this.location = location; this.message = message; @@ -100,22 +92,24 @@ public String getMessage() { return message; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Errors prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Errors getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Errors DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Errors(); } @@ -174,15 +168,9 @@ public Builder setMessage(String message) { return this; } - public Errors build() { - - return new Errors( - code, - location, - message - ); + return new Errors(code, location, message); } public Builder clone() { @@ -197,9 +185,14 @@ public Builder clone() { @Override public String toString() { return "Errors{" - + "code=" + code + ", " - + "location=" + location + ", " - + "message=" + message + + "code=" + + code + + ", " + + "location=" + + location + + ", " + + "message=" + + message + "}"; } @@ -210,21 +203,15 @@ public boolean equals(Object o) { } if (o instanceof Errors) { Errors that = (Errors) o; - return - Objects.equals(this.code, that.getCode()) && - Objects.equals(this.location, that.getLocation()) && - Objects.equals(this.message, that.getMessage()) - ; + return Objects.equals(this.code, that.getCode()) + && Objects.equals(this.location, that.getLocation()) + && Objects.equals(this.message, that.getMessage()); } return false; } @Override public int hashCode() { - return Objects.hash( - code, - location, - message - ); + return Objects.hash(code, location, message); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java index 13be69f63692..5ce3c75029fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private ExpandIpCidrRangeSubnetworkHttpRequest() { this.userIp = null; } - private ExpandIpCidrRangeSubnetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private ExpandIpCidrRangeSubnetworkHttpRequest( String requestId, String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -108,8 +103,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("subnetwork") && subnetwork != null) { fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); } - if (fieldNames.contains("subnetworksExpandIpCidrRangeRequestResource") && subnetworksExpandIpCidrRangeRequestResource != null) { - fieldMap.put("subnetworksExpandIpCidrRangeRequestResource", Collections.singletonList(String.valueOf(subnetworksExpandIpCidrRangeRequestResource))); + if (fieldNames.contains("subnetworksExpandIpCidrRangeRequestResource") + && subnetworksExpandIpCidrRangeRequestResource != null) { + fieldMap.put( + "subnetworksExpandIpCidrRangeRequestResource", + Collections.singletonList(String.valueOf(subnetworksExpandIpCidrRangeRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ExpandIpCidrRangeSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ExpandIpCidrRangeSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ExpandIpCidrRangeSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ExpandIpCidrRangeSubnetworkHttpRequest(); } @@ -259,7 +259,8 @@ public Builder mergeFrom(ExpandIpCidrRangeSubnetworkHttpRequest other) { this.subnetwork = other.subnetwork; } if (other.getSubnetworksExpandIpCidrRangeRequestResource() != null) { - this.subnetworksExpandIpCidrRangeRequestResource = other.subnetworksExpandIpCidrRangeRequestResource; + this.subnetworksExpandIpCidrRangeRequestResource = + other.subnetworksExpandIpCidrRangeRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -276,7 +277,8 @@ public Builder mergeFrom(ExpandIpCidrRangeSubnetworkHttpRequest other) { this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.subnetwork = source.subnetwork; - this.subnetworksExpandIpCidrRangeRequestResource = source.subnetworksExpandIpCidrRangeRequestResource; + this.subnetworksExpandIpCidrRangeRequestResource = + source.subnetworksExpandIpCidrRangeRequestResource; this.userIp = source.userIp; } @@ -356,8 +358,10 @@ public SubnetworksExpandIpCidrRangeRequest getSubnetworksExpandIpCidrRangeReques return subnetworksExpandIpCidrRangeRequestResource; } - public Builder setSubnetworksExpandIpCidrRangeRequestResource(SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { - this.subnetworksExpandIpCidrRangeRequestResource = subnetworksExpandIpCidrRangeRequestResource; + public Builder setSubnetworksExpandIpCidrRangeRequestResource( + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + this.subnetworksExpandIpCidrRangeRequestResource = + subnetworksExpandIpCidrRangeRequestResource; return this; } @@ -370,36 +374,27 @@ public Builder setUserIp(String userIp) { return this; } - public ExpandIpCidrRangeSubnetworkHttpRequest build() { String missing = ""; - - - - - - if (subnetwork == null) { missing += " subnetwork"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ExpandIpCidrRangeSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - subnetworksExpandIpCidrRangeRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworksExpandIpCidrRangeRequestResource, + userIp); } public Builder clone() { @@ -412,7 +407,8 @@ public Builder clone() { newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setSubnetwork(this.subnetwork); - newBuilder.setSubnetworksExpandIpCidrRangeRequestResource(this.subnetworksExpandIpCidrRangeRequestResource); + newBuilder.setSubnetworksExpandIpCidrRangeRequestResource( + this.subnetworksExpandIpCidrRangeRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -421,16 +417,35 @@ public Builder clone() { @Override public String toString() { return "ExpandIpCidrRangeSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "subnetwork=" + subnetwork + ", " - + "subnetworksExpandIpCidrRangeRequestResource=" + subnetworksExpandIpCidrRangeRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "subnetworksExpandIpCidrRangeRequestResource=" + + subnetworksExpandIpCidrRangeRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +456,18 @@ public boolean equals(Object o) { } if (o instanceof ExpandIpCidrRangeSubnetworkHttpRequest) { ExpandIpCidrRangeSubnetworkHttpRequest that = (ExpandIpCidrRangeSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.subnetworksExpandIpCidrRangeRequestResource, that.getSubnetworksExpandIpCidrRangeRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals( + this.subnetworksExpandIpCidrRangeRequestResource, + that.getSubnetworksExpandIpCidrRangeRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +475,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - subnetworksExpandIpCidrRangeRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworksExpandIpCidrRangeRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java index bdfc7b01837c..016bb754a7a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -70,7 +69,6 @@ private Firewall() { this.targetTags = null; } - private Firewall( List allowed, String creationTimestamp, @@ -88,8 +86,7 @@ private Firewall( List sourceServiceAccounts, List sourceTags, List targetServiceAccounts, - List targetTags - ) { + List targetTags) { this.allowed = allowed; this.creationTimestamp = creationTimestamp; this.denied = denied; @@ -120,7 +117,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("allowed", stringList.build()); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("denied") && denied != null) { ImmutableList.Builder stringList = ImmutableList.builder(); @@ -328,22 +326,24 @@ public List getTargetTagsList() { return targetTags; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Firewall prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Firewall getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Firewall DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Firewall(); } @@ -662,43 +662,26 @@ public Builder addTargetTags(String targetTags) { return this; } - public Firewall build() { - - - - - - - - - - - - - - - return new Firewall( - allowed, - creationTimestamp, - denied, - description, - destinationRanges, - direction, - id, - kind, - name, - network, - priority, - selfLink, - sourceRanges, - sourceServiceAccounts, - sourceTags, - targetServiceAccounts, - targetTags - ); + allowed, + creationTimestamp, + denied, + description, + destinationRanges, + direction, + id, + kind, + name, + network, + priority, + selfLink, + sourceRanges, + sourceServiceAccounts, + sourceTags, + targetServiceAccounts, + targetTags); } public Builder clone() { @@ -727,23 +710,56 @@ public Builder clone() { @Override public String toString() { return "Firewall{" - + "allowed=" + allowed + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "denied=" + denied + ", " - + "description=" + description + ", " - + "destinationRanges=" + destinationRanges + ", " - + "direction=" + direction + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "priority=" + priority + ", " - + "selfLink=" + selfLink + ", " - + "sourceRanges=" + sourceRanges + ", " - + "sourceServiceAccounts=" + sourceServiceAccounts + ", " - + "sourceTags=" + sourceTags + ", " - + "targetServiceAccounts=" + targetServiceAccounts + ", " - + "targetTags=" + targetTags + + "allowed=" + + allowed + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "denied=" + + denied + + ", " + + "description=" + + description + + ", " + + "destinationRanges=" + + destinationRanges + + ", " + + "direction=" + + direction + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "priority=" + + priority + + ", " + + "selfLink=" + + selfLink + + ", " + + "sourceRanges=" + + sourceRanges + + ", " + + "sourceServiceAccounts=" + + sourceServiceAccounts + + ", " + + "sourceTags=" + + sourceTags + + ", " + + "targetServiceAccounts=" + + targetServiceAccounts + + ", " + + "targetTags=" + + targetTags + "}"; } @@ -754,25 +770,23 @@ public boolean equals(Object o) { } if (o instanceof Firewall) { Firewall that = (Firewall) o; - return - Objects.equals(this.allowed, that.getAllowedList()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.denied, that.getDeniedList()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.destinationRanges, that.getDestinationRangesList()) && - Objects.equals(this.direction, that.getDirection()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.priority, that.getPriority()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sourceRanges, that.getSourceRangesList()) && - Objects.equals(this.sourceServiceAccounts, that.getSourceServiceAccountsList()) && - Objects.equals(this.sourceTags, that.getSourceTagsList()) && - Objects.equals(this.targetServiceAccounts, that.getTargetServiceAccountsList()) && - Objects.equals(this.targetTags, that.getTargetTagsList()) - ; + return Objects.equals(this.allowed, that.getAllowedList()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.denied, that.getDeniedList()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.destinationRanges, that.getDestinationRangesList()) + && Objects.equals(this.direction, that.getDirection()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.priority, that.getPriority()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sourceRanges, that.getSourceRangesList()) + && Objects.equals(this.sourceServiceAccounts, that.getSourceServiceAccountsList()) + && Objects.equals(this.sourceTags, that.getSourceTagsList()) + && Objects.equals(this.targetServiceAccounts, that.getTargetServiceAccountsList()) + && Objects.equals(this.targetTags, that.getTargetTagsList()); } return false; } @@ -780,23 +794,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - allowed, - creationTimestamp, - denied, - description, - destinationRanges, - direction, - id, - kind, - name, - network, - priority, - selfLink, - sourceRanges, - sourceServiceAccounts, - sourceTags, - targetServiceAccounts, - targetTags - ); + allowed, + creationTimestamp, + denied, + description, + destinationRanges, + direction, + id, + kind, + name, + network, + priority, + selfLink, + sourceRanges, + sourceServiceAccounts, + sourceTags, + targetServiceAccounts, + targetTags); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java index 6c758bd0dd23..511a875dc96d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.FirewallStub; import com.google.cloud.compute.v1.stub.FirewallStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,40 @@ *

  * 
  * try (FirewallClient firewallClient = FirewallClient.create()) {
- *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+ *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
  *   String requestId = "";
  *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the firewallClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the firewallClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of FirewallSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of FirewallSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class FirewallClient implements BackgroundResource {
   private final FirewallSettings settings;
   private final FirewallStub stub;
 
-
-
-  /**
-   * Constructs an instance of FirewallClient with default settings.
-   */
+  /** Constructs an instance of FirewallClient with default settings. */
   public static final FirewallClient create() throws IOException {
     return create(FirewallSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of FirewallClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of FirewallClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final FirewallClient create(FirewallSettings settings) throws IOException {
     return new FirewallClient(settings);
@@ -144,9 +128,8 @@ public static final FirewallClient create(FirewallStub stub) {
   }
 
   /**
-   * Constructs an instance of FirewallClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of FirewallClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected FirewallClient(FirewallSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +151,40 @@ public FirewallStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
    * }
    * 
* * @param firewall Name of the firewall rule to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteFirewall(ProjectFirewallName firewall, String requestId) { + public final Operation deleteFirewall(ProjectGlobalFirewallName firewall, String requestId) { DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .setRequestId(requestId) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .setRequestId(requestId) + .build(); return deleteFirewall(request); } @@ -205,21 +192,26 @@ public final Operation deleteFirewall(ProjectFirewallName firewall, String reque /** * Deletes the specified firewall. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Operation response = firewallClient.deleteFirewall(firewall.toString(), requestId);
    * }
    * 
* * @param firewall Name of the firewall rule to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +219,9 @@ public final Operation deleteFirewall(String firewall, String requestId) { DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .setRequestId(requestId) - .build(); + .setFirewall(firewall) + .setRequestId(requestId) + .build(); return deleteFirewall(request); } @@ -237,10 +229,11 @@ public final Operation deleteFirewall(String firewall, String requestId) { /** * Deletes the specified firewall. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
@@ -262,10 +255,11 @@ public final Operation deleteFirewall(DeleteFirewallHttpRequest request) {
   /**
    * Deletes the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
@@ -286,10 +280,11 @@ public final UnaryCallable deleteFirewallC
   /**
    * Returns the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   Firewall response = firewallClient.getFirewall(firewall);
    * }
    * 
@@ -298,12 +293,12 @@ public final UnaryCallable deleteFirewallC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Firewall getFirewall(ProjectFirewallName firewall) { + public final Firewall getFirewall(ProjectGlobalFirewallName firewall) { GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .build(); return getFirewall(request); } @@ -311,10 +306,11 @@ public final Firewall getFirewall(ProjectFirewallName firewall) { /** * Returns the specified firewall. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   Firewall response = firewallClient.getFirewall(firewall.toString());
    * }
    * 
@@ -326,9 +322,7 @@ public final Firewall getFirewall(ProjectFirewallName firewall) { public final Firewall getFirewall(String firewall) { GetFirewallHttpRequest request = - GetFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .build(); + GetFirewallHttpRequest.newBuilder().setFirewall(firewall).build(); return getFirewall(request); } @@ -336,10 +330,11 @@ public final Firewall getFirewall(String firewall) { /** * Returns the specified firewall. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
    *     .build();
@@ -359,10 +354,11 @@ public final Firewall getFirewall(GetFirewallHttpRequest request) {
   /**
    * Returns the specified firewall.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   GetFirewallHttpRequest request = GetFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
    *     .build();
@@ -381,7 +377,8 @@ public final UnaryCallable getFirewallCallable
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   String requestId = "";
@@ -391,24 +388,29 @@ public final UnaryCallable getFirewallCallable
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertFirewall(String requestId, ProjectName project, Firewall firewallResource) { + public final Operation insertFirewall( + String requestId, ProjectName project, Firewall firewallResource) { InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setFirewallResource(firewallResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setFirewallResource(firewallResource) + .build(); return insertFirewall(request); } @@ -416,7 +418,8 @@ public final Operation insertFirewall(String requestId, ProjectName project, Fir /** * Creates a firewall rule in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   String requestId = "";
@@ -426,24 +429,29 @@ public final Operation insertFirewall(String requestId, ProjectName project, Fir
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertFirewall(String requestId, String project, Firewall firewallResource) { + public final Operation insertFirewall( + String requestId, String project, Firewall firewallResource) { InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setFirewallResource(firewallResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setFirewallResource(firewallResource) + .build(); return insertFirewall(request); } @@ -451,7 +459,8 @@ public final Operation insertFirewall(String requestId, String project, Firewall /** * Creates a firewall rule in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   String requestId = "";
@@ -478,7 +487,8 @@ public final Operation insertFirewall(InsertFirewallHttpRequest request) {
   /**
    * Creates a firewall rule in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   String requestId = "";
@@ -504,7 +514,8 @@ public final UnaryCallable insertFirewallC
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +532,8 @@ public final UnaryCallable insertFirewallC
   public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
     ListFirewallsHttpRequest request =
         ListFirewallsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listFirewalls(request);
   }
 
@@ -530,7 +541,8 @@ public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +558,7 @@ public final ListFirewallsPagedResponse listFirewalls(ProjectName project) {
   @BetaApi
   public final ListFirewallsPagedResponse listFirewalls(String project) {
     ListFirewallsHttpRequest request =
-        ListFirewallsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListFirewallsHttpRequest.newBuilder().setProject(project).build();
     return listFirewalls(request);
   }
 
@@ -556,7 +566,8 @@ public final ListFirewallsPagedResponse listFirewalls(String project) {
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -574,15 +585,15 @@ public final ListFirewallsPagedResponse listFirewalls(String project) {
    */
   @BetaApi
   public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest request) {
-    return listFirewallsPagedCallable()
-        .call(request);
+    return listFirewallsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of firewall rules available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +609,8 @@ public final ListFirewallsPagedResponse listFirewalls(ListFirewallsHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable listFirewallsPagedCallable() { + public final UnaryCallable + listFirewallsPagedCallable() { return stub.listFirewallsPagedCallable(); } @@ -606,7 +618,8 @@ public final UnaryCallable /** * Retrieves the list of firewall rules available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -635,12 +648,14 @@ public final UnaryCallable listFirewalls
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.patchFirewall(firewall, requestId, firewallResource);
@@ -648,34 +663,41 @@ public final UnaryCallable listFirewalls
    * 
* * @param firewall Name of the firewall rule to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchFirewall(ProjectFirewallName firewall, String requestId, Firewall firewallResource) { + public final Operation patchFirewall( + ProjectGlobalFirewallName firewall, String requestId, Firewall firewallResource) { PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .setRequestId(requestId) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return patchFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.patchFirewall(firewall.toString(), requestId, firewallResource);
@@ -683,34 +705,41 @@ public final Operation patchFirewall(ProjectFirewallName firewall, String reques
    * 
* * @param firewall Name of the firewall rule to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchFirewall(String firewall, String requestId, Firewall firewallResource) { + public final Operation patchFirewall( + String firewall, String requestId, Firewall firewallResource) { PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .setRequestId(requestId) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return patchFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
@@ -732,12 +761,14 @@ public final Operation patchFirewall(PatchFirewallHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
@@ -758,12 +789,15 @@ public final UnaryCallable patchFirewallCal
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.
+   * Updates the specified firewall rule with the data included in the request. The PUT method can
+   * only update the following fields of firewall rule: allowed, description, sourceRanges,
+   * sourceTags, targetTags.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.updateFirewall(firewall, requestId, firewallResource);
@@ -771,34 +805,42 @@ public final UnaryCallable patchFirewallCal
    * 
* * @param firewall Name of the firewall rule to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateFirewall(ProjectFirewallName firewall, String requestId, Firewall firewallResource) { + public final Operation updateFirewall( + ProjectGlobalFirewallName firewall, String requestId, Firewall firewallResource) { UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder() - .setFirewall(firewall == null ? null : firewall.toString()) - .setRequestId(requestId) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall == null ? null : firewall.toString()) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return updateFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. + * Updates the specified firewall rule with the data included in the request. The PUT method can + * only update the following fields of firewall rule: allowed, description, sourceRanges, + * sourceTags, targetTags. + * + *

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   Operation response = firewallClient.updateFirewall(firewall.toString(), requestId, firewallResource);
@@ -806,34 +848,42 @@ public final Operation updateFirewall(ProjectFirewallName firewall, String reque
    * 
* * @param firewall Name of the firewall rule to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateFirewall(String firewall, String requestId, Firewall firewallResource) { + public final Operation updateFirewall( + String firewall, String requestId, Firewall firewallResource) { UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .setRequestId(requestId) - .setFirewallResource(firewallResource) - .build(); + .setFirewall(firewall) + .setRequestId(requestId) + .setFirewallResource(firewallResource) + .build(); return updateFirewall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. + * Updates the specified firewall rule with the data included in the request. The PUT method can + * only update the following fields of firewall rule: allowed, description, sourceRanges, + * sourceTags, targetTags. + * + *

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
@@ -855,12 +905,15 @@ public final Operation updateFirewall(UpdateFirewallHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.
+   * Updates the specified firewall rule with the data included in the request. The PUT method can
+   * only update the following fields of firewall rule: allowed, description, sourceRanges,
+   * sourceTags, targetTags.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+   *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
    *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
@@ -880,7 +933,7 @@ public final UnaryCallable updateFirewallC
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -909,12 +962,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListFirewallsPagedResponse extends AbstractPagedListResponse<
-      ListFirewallsHttpRequest,
-      FirewallList,
-      Firewall,
-      ListFirewallsPage,
-      ListFirewallsFixedSizeCollection> {
+  public static class ListFirewallsPagedResponse
+      extends AbstractPagedListResponse<
+          ListFirewallsHttpRequest, FirewallList, Firewall, ListFirewallsPage,
+          ListFirewallsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -934,15 +985,10 @@ public ListFirewallsPagedResponse apply(ListFirewallsPage input) {
     private ListFirewallsPagedResponse(ListFirewallsPage page) {
       super(page, ListFirewallsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListFirewallsPage extends AbstractPage<
-      ListFirewallsHttpRequest,
-      FirewallList,
-      Firewall,
-      ListFirewallsPage> {
+  public static class ListFirewallsPage
+      extends AbstractPage {
 
     private ListFirewallsPage(
         PageContext context,
@@ -967,18 +1013,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListFirewallsFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListFirewallsHttpRequest,
-      FirewallList,
-      Firewall,
-      ListFirewallsPage,
-      ListFirewallsFixedSizeCollection> {
+  public static class ListFirewallsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListFirewallsHttpRequest, FirewallList, Firewall, ListFirewallsPage,
+          ListFirewallsFixedSizeCollection> {
 
     private ListFirewallsFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -993,7 +1033,5 @@ protected ListFirewallsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListFirewallsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
index 772b119c7069..e89c70bc0bad 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private FirewallList() {
     this.warning = null;
   }
 
-
   private FirewallList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(FirewallList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static FirewallList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final FirewallList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new FirewallList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public FirewallList build() {
 
-
-
-
-
-      return new FirewallList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new FirewallList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "FirewallList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof FirewallList) {
       FirewallList that = (FirewallList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java
index bd2a538d9263..2a72ff8e6082 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java
@@ -15,45 +15,23 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse;
 import com.google.cloud.compute.v1.stub.FirewallStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -62,15 +40,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteFirewall to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteFirewall to 30 seconds: * *

  * 
@@ -85,91 +63,68 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class FirewallSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteFirewall.
-   */
+  /** Returns the object with the settings used for calls to deleteFirewall. */
   public UnaryCallSettings deleteFirewallSettings() {
     return ((FirewallStubSettings) getStubSettings()).deleteFirewallSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getFirewall.
-   */
+  /** Returns the object with the settings used for calls to getFirewall. */
   public UnaryCallSettings getFirewallSettings() {
     return ((FirewallStubSettings) getStubSettings()).getFirewallSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertFirewall.
-   */
+  /** Returns the object with the settings used for calls to insertFirewall. */
   public UnaryCallSettings insertFirewallSettings() {
     return ((FirewallStubSettings) getStubSettings()).insertFirewallSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listFirewalls.
-   */
-  public PagedCallSettings listFirewallsSettings() {
+  /** Returns the object with the settings used for calls to listFirewalls. */
+  public PagedCallSettings
+      listFirewallsSettings() {
     return ((FirewallStubSettings) getStubSettings()).listFirewallsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchFirewall.
-   */
+  /** Returns the object with the settings used for calls to patchFirewall. */
   public UnaryCallSettings patchFirewallSettings() {
     return ((FirewallStubSettings) getStubSettings()).patchFirewallSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateFirewall.
-   */
+  /** Returns the object with the settings used for calls to updateFirewall. */
   public UnaryCallSettings updateFirewallSettings() {
     return ((FirewallStubSettings) getStubSettings()).updateFirewallSettings();
   }
 
-
   public static final FirewallSettings create(FirewallStubSettings stub) throws IOException {
     return new FirewallSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return FirewallStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return FirewallStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return FirewallStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return FirewallStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return FirewallStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return FirewallStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return FirewallStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +137,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return FirewallStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +156,7 @@ protected FirewallSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for FirewallSettings.
-   */
+  /** Builder for FirewallSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +178,55 @@ protected Builder(FirewallStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public FirewallStubSettings.Builder getStubSettingsBuilder() {
       return ((FirewallStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteFirewall. - */ - public UnaryCallSettings.Builder deleteFirewallSettings() { + /** Returns the builder for the settings used for calls to deleteFirewall. */ + public UnaryCallSettings.Builder + deleteFirewallSettings() { return getStubSettingsBuilder().deleteFirewallSettings(); } - /** - * Returns the builder for the settings used for calls to getFirewall. - */ + /** Returns the builder for the settings used for calls to getFirewall. */ public UnaryCallSettings.Builder getFirewallSettings() { return getStubSettingsBuilder().getFirewallSettings(); } - /** - * Returns the builder for the settings used for calls to insertFirewall. - */ - public UnaryCallSettings.Builder insertFirewallSettings() { + /** Returns the builder for the settings used for calls to insertFirewall. */ + public UnaryCallSettings.Builder + insertFirewallSettings() { return getStubSettingsBuilder().insertFirewallSettings(); } - /** - * Returns the builder for the settings used for calls to listFirewalls. - */ - public PagedCallSettings.Builder listFirewallsSettings() { + /** Returns the builder for the settings used for calls to listFirewalls. */ + public PagedCallSettings.Builder< + ListFirewallsHttpRequest, FirewallList, ListFirewallsPagedResponse> + listFirewallsSettings() { return getStubSettingsBuilder().listFirewallsSettings(); } - /** - * Returns the builder for the settings used for calls to patchFirewall. - */ + /** Returns the builder for the settings used for calls to patchFirewall. */ public UnaryCallSettings.Builder patchFirewallSettings() { return getStubSettingsBuilder().patchFirewallSettings(); } - /** - * Returns the builder for the settings used for calls to updateFirewall. - */ - public UnaryCallSettings.Builder updateFirewallSettings() { + /** Returns the builder for the settings used for calls to updateFirewall. */ + public UnaryCallSettings.Builder + updateFirewallSettings() { return getStubSettingsBuilder().updateFirewallSettings(); } @@ -293,4 +235,4 @@ public FirewallSettings build() throws IOException { return new FirewallSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java index 016b5af03259..1acc4698d122 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -70,7 +69,6 @@ private ForwardingRule() { this.target = null; } - private ForwardingRule( String backendService, String creationTimestamp, @@ -88,8 +86,7 @@ private ForwardingRule( String region, String selfLink, String subnetwork, - String target - ) { + String target) { this.backendService = backendService; this.creationTimestamp = creationTimestamp; this.description = description; @@ -116,7 +113,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -137,7 +135,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { - fieldMap.put("loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); + fieldMap.put( + "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); } if (fieldNames.contains("name") && name != null) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); @@ -300,22 +299,24 @@ public String getTarget() { return target; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ForwardingRule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ForwardingRule getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ForwardingRule DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ForwardingRule(); } @@ -578,43 +579,26 @@ public Builder setTarget(String target) { return this; } - public ForwardingRule build() { - - - - - - - - - - - - - - - return new ForwardingRule( - backendService, - creationTimestamp, - description, - iPAddress, - iPProtocol, - id, - ipVersion, - kind, - loadBalancingScheme, - name, - network, - portRange, - ports, - region, - selfLink, - subnetwork, - target - ); + backendService, + creationTimestamp, + description, + iPAddress, + iPProtocol, + id, + ipVersion, + kind, + loadBalancingScheme, + name, + network, + portRange, + ports, + region, + selfLink, + subnetwork, + target); } public Builder clone() { @@ -643,23 +627,56 @@ public Builder clone() { @Override public String toString() { return "ForwardingRule{" - + "backendService=" + backendService + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "iPAddress=" + iPAddress + ", " - + "iPProtocol=" + iPProtocol + ", " - + "id=" + id + ", " - + "ipVersion=" + ipVersion + ", " - + "kind=" + kind + ", " - + "loadBalancingScheme=" + loadBalancingScheme + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "portRange=" + portRange + ", " - + "ports=" + ports + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "subnetwork=" + subnetwork + ", " - + "target=" + target + + "backendService=" + + backendService + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "iPAddress=" + + iPAddress + + ", " + + "iPProtocol=" + + iPProtocol + + ", " + + "id=" + + id + + ", " + + "ipVersion=" + + ipVersion + + ", " + + "kind=" + + kind + + ", " + + "loadBalancingScheme=" + + loadBalancingScheme + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "portRange=" + + portRange + + ", " + + "ports=" + + ports + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "target=" + + target + "}"; } @@ -670,25 +687,23 @@ public boolean equals(Object o) { } if (o instanceof ForwardingRule) { ForwardingRule that = (ForwardingRule) o; - return - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.iPAddress, that.getIPAddress()) && - Objects.equals(this.iPProtocol, that.getIPProtocol()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.ipVersion, that.getIpVersion()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.portRange, that.getPortRange()) && - Objects.equals(this.ports, that.getPortsList()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.target, that.getTarget()) - ; + return Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.iPAddress, that.getIPAddress()) + && Objects.equals(this.iPProtocol, that.getIPProtocol()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.ipVersion, that.getIpVersion()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.portRange, that.getPortRange()) + && Objects.equals(this.ports, that.getPortsList()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.target, that.getTarget()); } return false; } @@ -696,23 +711,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - backendService, - creationTimestamp, - description, - iPAddress, - iPProtocol, - id, - ipVersion, - kind, - loadBalancingScheme, - name, - network, - portRange, - ports, - region, - selfLink, - subnetwork, - target - ); + backendService, + creationTimestamp, + description, + iPAddress, + iPProtocol, + id, + ipVersion, + kind, + loadBalancingScheme, + name, + network, + portRange, + ports, + region, + selfLink, + subnetwork, + target); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java index d6fc7946c739..55a82726164a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private ForwardingRuleAggregatedList() { this.warning = null; } - private ForwardingRuleAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ForwardingRuleAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ForwardingRuleAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ForwardingRuleAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ForwardingRuleAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public ForwardingRuleAggregatedList build() { - - - - - return new ForwardingRuleAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new ForwardingRuleAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "ForwardingRuleAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof ForwardingRuleAggregatedList) { ForwardingRuleAggregatedList that = (ForwardingRuleAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java index 9746594d7a1e..a08aca630c5a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.ForwardingRuleStub; import com.google.cloud.compute.v1.stub.ForwardingRuleStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,33 +50,32 @@ *

* *

Note: close() needs to be called on the forwardingRuleClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of ForwardingRuleSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class ForwardingRuleClient implements BackgroundResource {
   private final ForwardingRuleSettings settings;
   private final ForwardingRuleStub stub;
 
-
-
-  /**
-   * Constructs an instance of ForwardingRuleClient with default settings.
-   */
+  /** Constructs an instance of ForwardingRuleClient with default settings. */
   public static final ForwardingRuleClient create() throws IOException {
     return create(ForwardingRuleSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of ForwardingRuleClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of ForwardingRuleClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final ForwardingRuleClient create(ForwardingRuleSettings settings) throws IOException {
+  public static final ForwardingRuleClient create(ForwardingRuleSettings settings)
+      throws IOException {
     return new ForwardingRuleClient(settings);
   }
 
   /**
-   * Constructs an instance of ForwardingRuleClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use ForwardingRuleSettings}.
+   * Constructs an instance of ForwardingRuleClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use ForwardingRuleSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final ForwardingRuleClient create(ForwardingRuleStub stub) {
@@ -144,9 +129,9 @@ public static final ForwardingRuleClient create(ForwardingRuleStub stub) {
   }
 
   /**
-   * Constructs an instance of ForwardingRuleClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of ForwardingRuleClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected ForwardingRuleClient(ForwardingRuleSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +153,12 @@ public ForwardingRuleStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of forwarding rules.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,11 +172,12 @@ public ForwardingRuleStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(ProjectName project) {
+  public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(
+      ProjectName project) {
     AggregatedListForwardingRulesHttpRequest request =
         AggregatedListForwardingRulesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListForwardingRules(request);
   }
 
@@ -199,7 +185,8 @@ public final AggregatedListForwardingRulesPagedResponse aggregatedListForwarding
   /**
    * Retrieves an aggregated list of forwarding rules.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -213,11 +200,10 @@ public final AggregatedListForwardingRulesPagedResponse aggregatedListForwarding
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(String project) {
+  public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(
+      String project) {
     AggregatedListForwardingRulesHttpRequest request =
-        AggregatedListForwardingRulesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListForwardingRulesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListForwardingRules(request);
   }
 
@@ -225,7 +211,8 @@ public final AggregatedListForwardingRulesPagedResponse aggregatedListForwarding
   /**
    * Retrieves an aggregated list of forwarding rules.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +229,17 @@ public final AggregatedListForwardingRulesPagedResponse aggregatedListForwarding
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(AggregatedListForwardingRulesHttpRequest request) {
-    return aggregatedListForwardingRulesPagedCallable()
-        .call(request);
+  public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules(
+      AggregatedListForwardingRulesHttpRequest request) {
+    return aggregatedListForwardingRulesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of forwarding rules.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +255,9 @@ public final AggregatedListForwardingRulesPagedResponse aggregatedListForwarding
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListForwardingRulesPagedCallable() { + public final UnaryCallable< + AggregatedListForwardingRulesHttpRequest, AggregatedListForwardingRulesPagedResponse> + aggregatedListForwardingRulesPagedCallable() { return stub.aggregatedListForwardingRulesPagedCallable(); } @@ -275,7 +265,8 @@ public final UnaryCallableSample code: + * *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +289,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListForwardingRulesCallable() { + public final UnaryCallable + aggregatedListForwardingRulesCallable() { return stub.aggregatedListForwardingRulesCallable(); } @@ -306,7 +298,8 @@ public final UnaryCallableSample code: + * *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -315,22 +308,27 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteForwardingRule(String requestId, ProjectRegionForwardingRuleName forwardingRule) { + public final Operation deleteForwardingRule( + String requestId, ProjectRegionForwardingRuleName forwardingRule) { DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); return deleteForwardingRule(request); } @@ -338,7 +336,8 @@ public final Operation deleteForwardingRule(String requestId, ProjectRegionForwa /** * Deletes the specified ForwardingRule resource. * - * Sample code: + *

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -347,11 +346,15 @@ public final Operation deleteForwardingRule(String requestId, ProjectRegionForwa
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -360,9 +363,9 @@ public final Operation deleteForwardingRule(String requestId, String forwardingR DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule) + .build(); return deleteForwardingRule(request); } @@ -370,7 +373,8 @@ public final Operation deleteForwardingRule(String requestId, String forwardingR /** * Deletes the specified ForwardingRule resource. * - * Sample code: + *

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -395,7 +399,8 @@ public final Operation deleteForwardingRule(DeleteForwardingRuleHttpRequest requ
   /**
    * Deletes the specified ForwardingRule resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -411,7 +416,8 @@ public final Operation deleteForwardingRule(DeleteForwardingRuleHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable deleteForwardingRuleCallable() { + public final UnaryCallable + deleteForwardingRuleCallable() { return stub.deleteForwardingRuleCallable(); } @@ -419,7 +425,8 @@ public final UnaryCallable deleteFor /** * Returns the specified ForwardingRule resource. * - * Sample code: + *

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
@@ -435,8 +442,8 @@ public final ForwardingRule getForwardingRule(ProjectRegionForwardingRuleName fo
 
     GetForwardingRuleHttpRequest request =
         GetForwardingRuleHttpRequest.newBuilder()
-        .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString())
-        .build();
+            .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString())
+            .build();
     return getForwardingRule(request);
   }
 
@@ -444,7 +451,8 @@ public final ForwardingRule getForwardingRule(ProjectRegionForwardingRuleName fo
   /**
    * Returns the specified ForwardingRule resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
@@ -459,9 +467,7 @@ public final ForwardingRule getForwardingRule(ProjectRegionForwardingRuleName fo
   public final ForwardingRule getForwardingRule(String forwardingRule) {
 
     GetForwardingRuleHttpRequest request =
-        GetForwardingRuleHttpRequest.newBuilder()
-        .setForwardingRule(forwardingRule)
-        .build();
+        GetForwardingRuleHttpRequest.newBuilder().setForwardingRule(forwardingRule).build();
     return getForwardingRule(request);
   }
 
@@ -469,7 +475,8 @@ public final ForwardingRule getForwardingRule(String forwardingRule) {
   /**
    * Returns the specified ForwardingRule resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
@@ -492,7 +499,8 @@ public final ForwardingRule getForwardingRule(GetForwardingRuleHttpRequest reque
   /**
    * Returns the specified ForwardingRule resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
@@ -506,15 +514,18 @@ public final ForwardingRule getForwardingRule(GetForwardingRuleHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getForwardingRuleCallable() { + public final UnaryCallable + getForwardingRuleCallable() { return stub.getForwardingRuleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * Creates a ForwardingRule resource in the specified project and region using the data included + * in the request. + * + *

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -524,32 +535,44 @@ public final UnaryCallable getForw
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies + * which pool of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== + * resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== + * resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) + * (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertForwardingRule(String requestId, ProjectRegionName region, ForwardingRule forwardingRuleResource) { + public final Operation insertForwardingRule( + String requestId, ProjectRegionName region, ForwardingRule forwardingRuleResource) { InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setForwardingRuleResource(forwardingRuleResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setForwardingRuleResource(forwardingRuleResource) + .build(); return insertForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * Creates a ForwardingRule resource in the specified project and region using the data included + * in the request. + * + *

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -559,32 +582,44 @@ public final Operation insertForwardingRule(String requestId, ProjectRegionName
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies + * which pool of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== + * resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== + * resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) + * (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertForwardingRule(String requestId, String region, ForwardingRule forwardingRuleResource) { + public final Operation insertForwardingRule( + String requestId, String region, ForwardingRule forwardingRuleResource) { InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setForwardingRuleResource(forwardingRuleResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setForwardingRuleResource(forwardingRuleResource) + .build(); return insertForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * Creates a ForwardingRule resource in the specified project and region using the data included + * in the request. + * + *

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -609,9 +644,11 @@ public final Operation insertForwardingRule(InsertForwardingRuleHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a ForwardingRule resource in the specified project and region using the data included in the request.
+   * Creates a ForwardingRule resource in the specified project and region using the data included
+   * in the request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -629,7 +666,8 @@ public final Operation insertForwardingRule(InsertForwardingRuleHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable insertForwardingRuleCallable() { + public final UnaryCallable + insertForwardingRuleCallable() { return stub.insertForwardingRuleCallable(); } @@ -637,7 +675,8 @@ public final UnaryCallable insertFor /** * Retrieves a list of ForwardingRule resources available to the specified project and region. * - * Sample code: + *

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -654,8 +693,8 @@ public final UnaryCallable insertFor
   public final ListForwardingRulesPagedResponse listForwardingRules(ProjectRegionName region) {
     ListForwardingRulesHttpRequest request =
         ListForwardingRulesHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listForwardingRules(request);
   }
 
@@ -663,7 +702,8 @@ public final ListForwardingRulesPagedResponse listForwardingRules(ProjectRegionN
   /**
    * Retrieves a list of ForwardingRule resources available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -679,9 +719,7 @@ public final ListForwardingRulesPagedResponse listForwardingRules(ProjectRegionN
   @BetaApi
   public final ListForwardingRulesPagedResponse listForwardingRules(String region) {
     ListForwardingRulesHttpRequest request =
-        ListForwardingRulesHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListForwardingRulesHttpRequest.newBuilder().setRegion(region).build();
     return listForwardingRules(request);
   }
 
@@ -689,7 +727,8 @@ public final ListForwardingRulesPagedResponse listForwardingRules(String region)
   /**
    * Retrieves a list of ForwardingRule resources available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -706,16 +745,17 @@ public final ListForwardingRulesPagedResponse listForwardingRules(String region)
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListForwardingRulesPagedResponse listForwardingRules(ListForwardingRulesHttpRequest request) {
-    return listForwardingRulesPagedCallable()
-        .call(request);
+  public final ListForwardingRulesPagedResponse listForwardingRules(
+      ListForwardingRulesHttpRequest request) {
+    return listForwardingRulesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of ForwardingRule resources available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -731,7 +771,8 @@ public final ListForwardingRulesPagedResponse listForwardingRules(ListForwarding
    * 
*/ @BetaApi - public final UnaryCallable listForwardingRulesPagedCallable() { + public final UnaryCallable + listForwardingRulesPagedCallable() { return stub.listForwardingRulesPagedCallable(); } @@ -739,7 +780,8 @@ public final UnaryCallableSample code: + * *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -762,15 +804,18 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listForwardingRulesCallable() { + public final UnaryCallable + listForwardingRulesCallable() { return stub.listForwardingRulesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * Changes target URL for forwarding rule. The new target should be of the same type as the old + * target. + * + *

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -780,32 +825,41 @@ public final UnaryCallable l
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetForwardingRule(String requestId, ProjectRegionForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetForwardingRule( + String requestId, + ProjectRegionForwardingRuleName forwardingRule, + TargetReference targetReferenceResource) { SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) - .setTargetReferenceResource(targetReferenceResource) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .setTargetReferenceResource(targetReferenceResource) + .build(); return setTargetForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * Changes target URL for forwarding rule. The new target should be of the same type as the old + * target. + * + *

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -815,32 +869,39 @@ public final Operation setTargetForwardingRule(String requestId, ProjectRegionFo
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetForwardingRule(String requestId, String forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetForwardingRule( + String requestId, String forwardingRule, TargetReference targetReferenceResource) { SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule) - .setTargetReferenceResource(targetReferenceResource) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule) + .setTargetReferenceResource(targetReferenceResource) + .build(); return setTargetForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * Changes target URL for forwarding rule. The new target should be of the same type as the old + * target. + * + *

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -865,9 +926,11 @@ public final Operation setTargetForwardingRule(SetTargetForwardingRuleHttpReques
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes target URL for forwarding rule. The new target should be of the same type as the old target.
+   * Changes target URL for forwarding rule. The new target should be of the same type as the old
+   * target.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -885,12 +948,13 @@ public final Operation setTargetForwardingRule(SetTargetForwardingRuleHttpReques
    * 
*/ @BetaApi - public final UnaryCallable setTargetForwardingRuleCallable() { + public final UnaryCallable + setTargetForwardingRuleCallable() { return stub.setTargetForwardingRuleCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -919,23 +983,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListForwardingRulesPagedResponse extends AbstractPagedListResponse< - AggregatedListForwardingRulesHttpRequest, - ForwardingRuleAggregatedList, - ForwardingRulesScopedList, - AggregatedListForwardingRulesPage, - AggregatedListForwardingRulesFixedSizeCollection> { + public static class AggregatedListForwardingRulesPagedResponse + extends AbstractPagedListResponse< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList, AggregatedListForwardingRulesPage, + AggregatedListForwardingRulesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListForwardingRulesPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListForwardingRulesPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListForwardingRulesPage, AggregatedListForwardingRulesPagedResponse>() { @Override - public AggregatedListForwardingRulesPagedResponse apply(AggregatedListForwardingRulesPage input) { + public AggregatedListForwardingRulesPagedResponse apply( + AggregatedListForwardingRulesPage input) { return new AggregatedListForwardingRulesPagedResponse(input); } }); @@ -944,18 +1013,18 @@ public AggregatedListForwardingRulesPagedResponse apply(AggregatedListForwarding private AggregatedListForwardingRulesPagedResponse(AggregatedListForwardingRulesPage page) { super(page, AggregatedListForwardingRulesFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListForwardingRulesPage extends AbstractPage< - AggregatedListForwardingRulesHttpRequest, - ForwardingRuleAggregatedList, - ForwardingRulesScopedList, - AggregatedListForwardingRulesPage> { + public static class AggregatedListForwardingRulesPage + extends AbstractPage< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList, AggregatedListForwardingRulesPage> { private AggregatedListForwardingRulesPage( - PageContext context, + PageContext< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList> + context, ForwardingRuleAggregatedList response) { super(context, response); } @@ -966,31 +1035,33 @@ private static AggregatedListForwardingRulesPage createEmptyPage() { @Override protected AggregatedListForwardingRulesPage createPage( - PageContext context, + PageContext< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList> + context, ForwardingRuleAggregatedList response) { return new AggregatedListForwardingRulesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListForwardingRulesFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListForwardingRulesHttpRequest, - ForwardingRuleAggregatedList, - ForwardingRulesScopedList, - AggregatedListForwardingRulesPage, - AggregatedListForwardingRulesFixedSizeCollection> { + public static class AggregatedListForwardingRulesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + ForwardingRulesScopedList, AggregatedListForwardingRulesPage, + AggregatedListForwardingRulesFixedSizeCollection> { - private AggregatedListForwardingRulesFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListForwardingRulesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1003,15 +1074,12 @@ protected AggregatedListForwardingRulesFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListForwardingRulesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListForwardingRulesPagedResponse extends AbstractPagedListResponse< - ListForwardingRulesHttpRequest, - ForwardingRuleList, - ForwardingRule, - ListForwardingRulesPage, - ListForwardingRulesFixedSizeCollection> { + + public static class ListForwardingRulesPagedResponse + extends AbstractPagedListResponse< + ListForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule, + ListForwardingRulesPage, ListForwardingRulesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1031,15 +1099,12 @@ public ListForwardingRulesPagedResponse apply(ListForwardingRulesPage input) { private ListForwardingRulesPagedResponse(ListForwardingRulesPage page) { super(page, ListForwardingRulesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListForwardingRulesPage extends AbstractPage< - ListForwardingRulesHttpRequest, - ForwardingRuleList, - ForwardingRule, - ListForwardingRulesPage> { + public static class ListForwardingRulesPage + extends AbstractPage< + ListForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule, + ListForwardingRulesPage> { private ListForwardingRulesPage( PageContext context, @@ -1064,20 +1129,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListForwardingRulesFixedSizeCollection extends AbstractFixedSizeCollection< - ListForwardingRulesHttpRequest, - ForwardingRuleList, - ForwardingRule, - ListForwardingRulesPage, - ListForwardingRulesFixedSizeCollection> { + public static class ListForwardingRulesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule, + ListForwardingRulesPage, ListForwardingRulesFixedSizeCollection> { - private ListForwardingRulesFixedSizeCollection(List pages, int collectionSize) { + private ListForwardingRulesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1090,7 +1150,5 @@ protected ListForwardingRulesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListForwardingRulesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java index 49c74049f2b3..f33b52c9b425 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private ForwardingRuleList() { this.warning = null; } - private ForwardingRuleList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ForwardingRuleList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ForwardingRuleList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ForwardingRuleList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ForwardingRuleList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public ForwardingRuleList build() { - - - - - return new ForwardingRuleList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new ForwardingRuleList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "ForwardingRuleList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof ForwardingRuleList) { ForwardingRuleList that = (ForwardingRuleList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java deleted file mode 100644 index 4b4ee030abb2..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ForwardingRuleName implements com.google.api.resourcenames.ResourceName { - private final String forwardingRule; - private final String project; - private final String region; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/forwardingRules/{forwardingRule}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ForwardingRuleName(Builder builder) { - forwardingRule = Preconditions.checkNotNull(builder.getForwardingRule()); - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - } - - public static ForwardingRuleName of( - String forwardingRule, - String project, - String region - ) { - return newBuilder() - .setForwardingRule(forwardingRule) - .setProject(project) - .setRegion(region) - .build(); - } - - public static String format( - String forwardingRule, - String project, - String region - ) { - return of( - forwardingRule, - project, - region - ) - .toString(); - } - - public String getForwardingRule() { - return forwardingRule; - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("forwardingRule", forwardingRule); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ForwardingRuleName parse(String formattedString) {return ForwardingRuleName.parse(formattedString);} - }; - } - - public static ForwardingRuleName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ForwardingRuleName.parse: formattedString not in valid format"); - return of( - matchMap.get("forwardingRule"), - matchMap.get("project"), - matchMap.get("region") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String forwardingRule; - private String project; - private String region; - - public String getForwardingRule() { - return forwardingRule; - } - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - - public Builder setForwardingRule(String forwardingRule) { - this.forwardingRule = forwardingRule; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - - private Builder() {} - - public Builder (ForwardingRuleName forwardingRuleName) { - forwardingRule = forwardingRuleName.forwardingRule; - project = forwardingRuleName.project; - region = forwardingRuleName.region; - } - - public ForwardingRuleName build() { - return new ForwardingRuleName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "forwardingRule", forwardingRule, - "project", project, - "region", region - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ForwardingRuleName) { - ForwardingRuleName that = (ForwardingRuleName) o; - return - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - forwardingRule, - project, - region - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java index c4a673cab649..74fb77d239ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; -import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; import com.google.cloud.compute.v1.stub.ForwardingRuleStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteForwardingRule to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteForwardingRule to 30 seconds: * *

  * 
@@ -86,91 +64,77 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ForwardingRuleSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListForwardingRules.
-   */
-  public PagedCallSettings aggregatedListForwardingRulesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListForwardingRules. */
+  public PagedCallSettings<
+          AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+          AggregatedListForwardingRulesPagedResponse>
+      aggregatedListForwardingRulesSettings() {
     return ((ForwardingRuleStubSettings) getStubSettings()).aggregatedListForwardingRulesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteForwardingRule.
-   */
-  public UnaryCallSettings deleteForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to deleteForwardingRule. */
+  public UnaryCallSettings
+      deleteForwardingRuleSettings() {
     return ((ForwardingRuleStubSettings) getStubSettings()).deleteForwardingRuleSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getForwardingRule.
-   */
-  public UnaryCallSettings getForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to getForwardingRule. */
+  public UnaryCallSettings
+      getForwardingRuleSettings() {
     return ((ForwardingRuleStubSettings) getStubSettings()).getForwardingRuleSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertForwardingRule.
-   */
-  public UnaryCallSettings insertForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to insertForwardingRule. */
+  public UnaryCallSettings
+      insertForwardingRuleSettings() {
     return ((ForwardingRuleStubSettings) getStubSettings()).insertForwardingRuleSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listForwardingRules.
-   */
-  public PagedCallSettings listForwardingRulesSettings() {
+  /** Returns the object with the settings used for calls to listForwardingRules. */
+  public PagedCallSettings<
+          ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse>
+      listForwardingRulesSettings() {
     return ((ForwardingRuleStubSettings) getStubSettings()).listForwardingRulesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTargetForwardingRule.
-   */
-  public UnaryCallSettings setTargetForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to setTargetForwardingRule. */
+  public UnaryCallSettings
+      setTargetForwardingRuleSettings() {
     return ((ForwardingRuleStubSettings) getStubSettings()).setTargetForwardingRuleSettings();
   }
 
-
-  public static final ForwardingRuleSettings create(ForwardingRuleStubSettings stub) throws IOException {
+  public static final ForwardingRuleSettings create(ForwardingRuleStubSettings stub)
+      throws IOException {
     return new ForwardingRuleSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ForwardingRuleStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return ForwardingRuleStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return ForwardingRuleStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return ForwardingRuleStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return ForwardingRuleStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ForwardingRuleStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return ForwardingRuleStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -183,23 +147,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ForwardingRuleStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -208,9 +166,7 @@ protected ForwardingRuleSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for ForwardingRuleSettings.
-   */
+  /** Builder for ForwardingRuleSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -232,60 +188,59 @@ protected Builder(ForwardingRuleStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public ForwardingRuleStubSettings.Builder getStubSettingsBuilder() {
       return ((ForwardingRuleStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListForwardingRules. - */ - public PagedCallSettings.Builder aggregatedListForwardingRulesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListForwardingRules. */ + public PagedCallSettings.Builder< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + AggregatedListForwardingRulesPagedResponse> + aggregatedListForwardingRulesSettings() { return getStubSettingsBuilder().aggregatedListForwardingRulesSettings(); } - /** - * Returns the builder for the settings used for calls to deleteForwardingRule. - */ - public UnaryCallSettings.Builder deleteForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to deleteForwardingRule. */ + public UnaryCallSettings.Builder + deleteForwardingRuleSettings() { return getStubSettingsBuilder().deleteForwardingRuleSettings(); } - /** - * Returns the builder for the settings used for calls to getForwardingRule. - */ - public UnaryCallSettings.Builder getForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to getForwardingRule. */ + public UnaryCallSettings.Builder + getForwardingRuleSettings() { return getStubSettingsBuilder().getForwardingRuleSettings(); } - /** - * Returns the builder for the settings used for calls to insertForwardingRule. - */ - public UnaryCallSettings.Builder insertForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to insertForwardingRule. */ + public UnaryCallSettings.Builder + insertForwardingRuleSettings() { return getStubSettingsBuilder().insertForwardingRuleSettings(); } - /** - * Returns the builder for the settings used for calls to listForwardingRules. - */ - public PagedCallSettings.Builder listForwardingRulesSettings() { + /** Returns the builder for the settings used for calls to listForwardingRules. */ + public PagedCallSettings.Builder< + ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse> + listForwardingRulesSettings() { return getStubSettingsBuilder().listForwardingRulesSettings(); } - /** - * Returns the builder for the settings used for calls to setTargetForwardingRule. - */ - public UnaryCallSettings.Builder setTargetForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to setTargetForwardingRule. */ + public UnaryCallSettings.Builder + setTargetForwardingRuleSettings() { return getStubSettingsBuilder().setTargetForwardingRuleSettings(); } @@ -294,4 +249,4 @@ public ForwardingRuleSettings build() throws IOException { return new ForwardingRuleSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java index 21c06d5b9119..4202d67f4da6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private ForwardingRulesScopedList() { this.warning = null; } - - private ForwardingRulesScopedList( - List forwardingRules, - Warning warning - ) { + private ForwardingRulesScopedList(List forwardingRules, Warning warning) { this.forwardingRules = forwardingRules; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ForwardingRulesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ForwardingRulesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ForwardingRulesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ForwardingRulesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public ForwardingRulesScopedList build() { - return new ForwardingRulesScopedList( - forwardingRules, - warning - ); + return new ForwardingRulesScopedList(forwardingRules, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "ForwardingRulesScopedList{" - + "forwardingRules=" + forwardingRules + ", " - + "warning=" + warning + + "forwardingRules=" + + forwardingRules + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof ForwardingRulesScopedList) { ForwardingRulesScopedList that = (ForwardingRulesScopedList) o; - return - Objects.equals(this.forwardingRules, that.getForwardingRulesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.forwardingRules, that.getForwardingRulesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - forwardingRules, - warning - ); + return Objects.hash(forwardingRules, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java index 7f9c2cdd8d94..7ab02b6274bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetAcceleratorTypeHttpRequest() { this.userIp = null; } - private GetAcceleratorTypeHttpRequest( String acceleratorType, String access_token, @@ -61,8 +57,7 @@ private GetAcceleratorTypeHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.acceleratorType = acceleratorType; this.access_token = access_token; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetAcceleratorTypeHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetAcceleratorTypeHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetAcceleratorTypeHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetAcceleratorTypeHttpRequest(); } @@ -314,32 +311,17 @@ public Builder setUserIp(String userIp) { return this; } - public GetAcceleratorTypeHttpRequest build() { String missing = ""; if (acceleratorType == null) { missing += " acceleratorType"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetAcceleratorTypeHttpRequest( - acceleratorType, - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + acceleratorType, access_token, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +341,29 @@ public Builder clone() { @Override public String toString() { return "GetAcceleratorTypeHttpRequest{" - + "acceleratorType=" + acceleratorType + ", " - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "acceleratorType=" + + acceleratorType + + ", " + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +374,14 @@ public boolean equals(Object o) { } if (o instanceof GetAcceleratorTypeHttpRequest) { GetAcceleratorTypeHttpRequest that = (GetAcceleratorTypeHttpRequest) o; - return - Objects.equals(this.acceleratorType, that.getAcceleratorType()) && - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.acceleratorType, that.getAcceleratorType()) + && Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +389,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - acceleratorType, - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + acceleratorType, access_token, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java index ae8f674b2faf..ca2a1a1e5e4e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetAddressHttpRequest() { this.userIp = null; } - private GetAddressHttpRequest( String access_token, String address, @@ -61,8 +57,7 @@ private GetAddressHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.address = address; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetAddressHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetAddressHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetAddressHttpRequest build() { missing += " address"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetAddressHttpRequest( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "address=" + address + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "address=" + + address + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetAddressHttpRequest) { GetAddressHttpRequest that = (GetAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java index 7434bae2114c..c2f3d68b5372 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetAutoscalerHttpRequest() { this.userIp = null; } - private GetAutoscalerHttpRequest( String access_token, String autoscaler, @@ -61,8 +57,7 @@ private GetAutoscalerHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetAutoscalerHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetAutoscalerHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetAutoscalerHttpRequest build() { missing += " autoscaler"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetAutoscalerHttpRequest( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, autoscaler, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetAutoscalerHttpRequest) { GetAutoscalerHttpRequest that = (GetAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, autoscaler, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java index 15c594ecd964..34d156febed3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetBackendBucketHttpRequest() { this.userIp = null; } - private GetBackendBucketHttpRequest( String access_token, String backendBucket, @@ -61,8 +57,7 @@ private GetBackendBucketHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendBucket = backendBucket; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetBackendBucketHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetBackendBucketHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetBackendBucketHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetBackendBucketHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetBackendBucketHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetBackendBucketHttpRequest build() { missing += " backendBucket"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetBackendBucketHttpRequest( - access_token, - backendBucket, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendBucket, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetBackendBucketHttpRequest{" - + "access_token=" + access_token + ", " - + "backendBucket=" + backendBucket + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendBucket=" + + backendBucket + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetBackendBucketHttpRequest) { GetBackendBucketHttpRequest that = (GetBackendBucketHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendBucket, that.getBackendBucket()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendBucket, that.getBackendBucket()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendBucket, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendBucket, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java index 3ecfe8e20cf6..9341bbee372b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetBackendServiceHttpRequest() { this.userIp = null; } - private GetBackendServiceHttpRequest( String access_token, String backendService, @@ -61,8 +57,7 @@ private GetBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetBackendServiceHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetBackendServiceHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetBackendServiceHttpRequest) { GetBackendServiceHttpRequest that = (GetBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java index 621e43321bbd..6ad9763c7b67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetDiskHttpRequest() { this.userIp = null; } - private GetDiskHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetDiskHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.disk = disk; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetDiskHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetDiskHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetDiskHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetDiskHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetDiskHttpRequest build() { String missing = ""; - if (disk == null) { missing += " disk"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetDiskHttpRequest( - access_token, - callback, - disk, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, disk, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetDiskHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "disk=" + disk + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,31 +375,20 @@ public boolean equals(Object o) { } if (o instanceof GetDiskHttpRequest) { GetDiskHttpRequest that = (GetDiskHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.disk, that.getDisk()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @Override public int hashCode() { - return Objects.hash( - access_token, - callback, - disk, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + return Objects.hash(access_token, callback, disk, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java index d3690c707115..ae90dd62b439 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetDiskTypeHttpRequest() { this.userIp = null; } - private GetDiskTypeHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetDiskTypeHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.diskType = diskType; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetDiskTypeHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetDiskTypeHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetDiskTypeHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetDiskTypeHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetDiskTypeHttpRequest build() { String missing = ""; - if (diskType == null) { missing += " diskType"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetDiskTypeHttpRequest( - access_token, - callback, - diskType, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, diskType, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetDiskTypeHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "diskType=" + diskType + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "diskType=" + + diskType + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetDiskTypeHttpRequest) { GetDiskTypeHttpRequest that = (GetDiskTypeHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.diskType, that.getDiskType()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.diskType, that.getDiskType()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - diskType, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, diskType, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java index 8c65512d533d..7c2ef0032da2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetFirewallHttpRequest() { this.userIp = null; } - private GetFirewallHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetFirewallHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetFirewallHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetFirewallHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetFirewallHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetFirewallHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetFirewallHttpRequest build() { String missing = ""; - - if (firewall == null) { missing += " firewall"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetFirewallHttpRequest( - access_token, - callback, - fields, - firewall, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, firewall, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetFirewallHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "firewall=" + firewall + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "firewall=" + + firewall + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetFirewallHttpRequest) { GetFirewallHttpRequest that = (GetFirewallHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.firewall, that.getFirewall()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.firewall, that.getFirewall()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - firewall, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, firewall, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java index 6b4853924411..56699ab4db3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetForwardingRuleHttpRequest() { this.userIp = null; } - private GetForwardingRuleHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetForwardingRuleHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetForwardingRuleHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetForwardingRuleHttpRequest build() { String missing = ""; - - if (forwardingRule == null) { missing += " forwardingRule"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, forwardingRule, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRule=" + forwardingRule + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRule=" + + forwardingRule + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetForwardingRuleHttpRequest) { GetForwardingRuleHttpRequest that = (GetForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, forwardingRule, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java index df6eba7e6001..77c615dbaa89 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetFromFamilyImageHttpRequest() { this.userIp = null; } - private GetFromFamilyImageHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetFromFamilyImageHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.family = family; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetFromFamilyImageHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetFromFamilyImageHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetFromFamilyImageHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetFromFamilyImageHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetFromFamilyImageHttpRequest build() { String missing = ""; - if (family == null) { missing += " family"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetFromFamilyImageHttpRequest( - access_token, - callback, - family, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, family, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetFromFamilyImageHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "family=" + family + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "family=" + + family + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetFromFamilyImageHttpRequest) { GetFromFamilyImageHttpRequest that = (GetFromFamilyImageHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.family, that.getFamily()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.family, that.getFamily()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - family, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, family, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java index efc91ea85a21..aca1109f15d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetGlobalAddressHttpRequest() { this.userIp = null; } - private GetGlobalAddressHttpRequest( String access_token, String address, @@ -61,8 +57,7 @@ private GetGlobalAddressHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.address = address; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetGlobalAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetGlobalAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetGlobalAddressHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetGlobalAddressHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetGlobalAddressHttpRequest build() { missing += " address"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetGlobalAddressHttpRequest( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetGlobalAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "address=" + address + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "address=" + + address + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetGlobalAddressHttpRequest) { GetGlobalAddressHttpRequest that = (GetGlobalAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - address, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, address, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java index 0f0c9865cd9a..3859ea6d568b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetGlobalForwardingRuleHttpRequest() { this.userIp = null; } - private GetGlobalForwardingRuleHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetGlobalForwardingRuleHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetGlobalForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetGlobalForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetGlobalForwardingRuleHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetGlobalForwardingRuleHttpRequest build() { String missing = ""; - - if (forwardingRule == null) { missing += " forwardingRule"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetGlobalForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, forwardingRule, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetGlobalForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRule=" + forwardingRule + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRule=" + + forwardingRule + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetGlobalForwardingRuleHttpRequest) { GetGlobalForwardingRuleHttpRequest that = (GetGlobalForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, forwardingRule, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java index 463218134782..671ec05feb62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetGlobalOperationHttpRequest() { this.userIp = null; } - private GetGlobalOperationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetGlobalOperationHttpRequest( String operation, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetGlobalOperationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetGlobalOperationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetGlobalOperationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetGlobalOperationHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetGlobalOperationHttpRequest build() { String missing = ""; - - - if (operation == null) { missing += " operation"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetGlobalOperationHttpRequest( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetGlobalOperationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "operation=" + operation + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "operation=" + + operation + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetGlobalOperationHttpRequest) { GetGlobalOperationHttpRequest that = (GetGlobalOperationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java index 515d63d69685..fbebc8ba2fbb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private GetHealthBackendServiceHttpRequest() { this.userIp = null; } - private GetHealthBackendServiceHttpRequest( String access_token, String backendService, @@ -64,8 +60,7 @@ private GetHealthBackendServiceHttpRequest( String prettyPrint, String quotaUser, ResourceGroupReference resourceGroupReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -101,8 +96,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("resourceGroupReferenceResource") && resourceGroupReferenceResource != null) { - fieldMap.put("resourceGroupReferenceResource", Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); + if (fieldNames.contains("resourceGroupReferenceResource") + && resourceGroupReferenceResource != null) { + fieldMap.put( + "resourceGroupReferenceResource", + Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -184,22 +182,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetHealthBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetHealthBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetHealthBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetHealthBackendServiceHttpRequest(); } @@ -328,7 +328,8 @@ public ResourceGroupReference getResourceGroupReferenceResource() { return resourceGroupReferenceResource; } - public Builder setResourceGroupReferenceResource(ResourceGroupReference resourceGroupReferenceResource) { + public Builder setResourceGroupReferenceResource( + ResourceGroupReference resourceGroupReferenceResource) { this.resourceGroupReferenceResource = resourceGroupReferenceResource; return this; } @@ -342,7 +343,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetHealthBackendServiceHttpRequest build() { String missing = ""; @@ -350,26 +350,19 @@ public GetHealthBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetHealthBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - resourceGroupReferenceResource, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp); } public Builder clone() { @@ -390,15 +383,32 @@ public Builder clone() { @Override public String toString() { return "GetHealthBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "resourceGroupReferenceResource=" + resourceGroupReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resourceGroupReferenceResource=" + + resourceGroupReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +419,16 @@ public boolean equals(Object o) { } if (o instanceof GetHealthBackendServiceHttpRequest) { GetHealthBackendServiceHttpRequest that = (GetHealthBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.resourceGroupReferenceResource, that.getResourceGroupReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.resourceGroupReferenceResource, that.getResourceGroupReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +436,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - resourceGroupReferenceResource, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java index 7325dc49853a..cc1198822080 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetHealthCheckHttpRequest() { this.userIp = null; } - private GetHealthCheckHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetHealthCheckHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetHealthCheckHttpRequest build() { String missing = ""; - - if (healthCheck == null) { missing += " healthCheck"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetHealthCheckHttpRequest( - access_token, - callback, - fields, - healthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, healthCheck, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "healthCheck=" + healthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "healthCheck=" + + healthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetHealthCheckHttpRequest) { GetHealthCheckHttpRequest that = (GetHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.healthCheck, that.getHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - healthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, healthCheck, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java index 7f88880bf242..7a65116d9166 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private GetHealthRegionBackendServiceHttpRequest() { this.userIp = null; } - private GetHealthRegionBackendServiceHttpRequest( String access_token, String backendService, @@ -64,8 +60,7 @@ private GetHealthRegionBackendServiceHttpRequest( String prettyPrint, String quotaUser, ResourceGroupReference resourceGroupReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -101,8 +96,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("resourceGroupReferenceResource") && resourceGroupReferenceResource != null) { - fieldMap.put("resourceGroupReferenceResource", Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); + if (fieldNames.contains("resourceGroupReferenceResource") + && resourceGroupReferenceResource != null) { + fieldMap.put( + "resourceGroupReferenceResource", + Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -184,22 +182,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetHealthRegionBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetHealthRegionBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetHealthRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetHealthRegionBackendServiceHttpRequest(); } @@ -328,7 +328,8 @@ public ResourceGroupReference getResourceGroupReferenceResource() { return resourceGroupReferenceResource; } - public Builder setResourceGroupReferenceResource(ResourceGroupReference resourceGroupReferenceResource) { + public Builder setResourceGroupReferenceResource( + ResourceGroupReference resourceGroupReferenceResource) { this.resourceGroupReferenceResource = resourceGroupReferenceResource; return this; } @@ -342,7 +343,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetHealthRegionBackendServiceHttpRequest build() { String missing = ""; @@ -350,26 +350,19 @@ public GetHealthRegionBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetHealthRegionBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - resourceGroupReferenceResource, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp); } public Builder clone() { @@ -390,15 +383,32 @@ public Builder clone() { @Override public String toString() { return "GetHealthRegionBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "resourceGroupReferenceResource=" + resourceGroupReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resourceGroupReferenceResource=" + + resourceGroupReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +419,16 @@ public boolean equals(Object o) { } if (o instanceof GetHealthRegionBackendServiceHttpRequest) { GetHealthRegionBackendServiceHttpRequest that = (GetHealthRegionBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.resourceGroupReferenceResource, that.getResourceGroupReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.resourceGroupReferenceResource, that.getResourceGroupReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +436,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - resourceGroupReferenceResource, - userIp - ); + access_token, + backendService, + callback, + fields, + key, + prettyPrint, + quotaUser, + resourceGroupReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java index 916478cf37d1..37fc9330ce5e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private GetHealthTargetPoolHttpRequest() { this.userIp = null; } - private GetHealthTargetPoolHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private GetHealthTargetPoolHttpRequest( String prettyPrint, String quotaUser, String targetPool, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -90,7 +85,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceReferenceResource") && instanceReferenceResource != null) { - fieldMap.put("instanceReferenceResource", Collections.singletonList(String.valueOf(instanceReferenceResource))); + fieldMap.put( + "instanceReferenceResource", + Collections.singletonList(String.valueOf(instanceReferenceResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +181,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetHealthTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetHealthTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetHealthTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetHealthTargetPoolHttpRequest(); } @@ -342,16 +341,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetHealthTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } @@ -360,16 +352,15 @@ public GetHealthTargetPoolHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetHealthTargetPoolHttpRequest( - access_token, - callback, - fields, - instanceReferenceResource, - key, - prettyPrint, - quotaUser, - targetPool, - userIp - ); + access_token, + callback, + fields, + instanceReferenceResource, + key, + prettyPrint, + quotaUser, + targetPool, + userIp); } public Builder clone() { @@ -390,15 +381,32 @@ public Builder clone() { @Override public String toString() { return "GetHealthTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceReferenceResource=" + instanceReferenceResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetPool=" + targetPool + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceReferenceResource=" + + instanceReferenceResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetPool=" + + targetPool + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +417,15 @@ public boolean equals(Object o) { } if (o instanceof GetHealthTargetPoolHttpRequest) { GetHealthTargetPoolHttpRequest that = (GetHealthTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceReferenceResource, that.getInstanceReferenceResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceReferenceResource, that.getInstanceReferenceResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +433,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceReferenceResource, - key, - prettyPrint, - quotaUser, - targetPool, - userIp - ); + access_token, + callback, + fields, + instanceReferenceResource, + key, + prettyPrint, + quotaUser, + targetPool, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java index 5d4fef3c724c..56e4c1dfdf72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetHttpHealthCheckHttpRequest() { this.userIp = null; } - private GetHttpHealthCheckHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetHttpHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetHttpHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetHttpHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetHttpHealthCheckHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetHttpHealthCheckHttpRequest build() { String missing = ""; - - if (httpHealthCheck == null) { missing += " httpHealthCheck"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetHttpHealthCheckHttpRequest( - access_token, - callback, - fields, - httpHealthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, httpHealthCheck, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetHttpHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpHealthCheck=" + httpHealthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpHealthCheck=" + + httpHealthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetHttpHealthCheckHttpRequest) { GetHttpHealthCheckHttpRequest that = (GetHttpHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpHealthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, httpHealthCheck, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java index b8ae1b23a425..2c552dcad757 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetHttpsHealthCheckHttpRequest() { this.userIp = null; } - private GetHttpsHealthCheckHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetHttpsHealthCheckHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetHttpsHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetHttpsHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetHttpsHealthCheckHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetHttpsHealthCheckHttpRequest build() { String missing = ""; - - if (httpsHealthCheck == null) { missing += " httpsHealthCheck"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetHttpsHealthCheckHttpRequest( - access_token, - callback, - fields, - httpsHealthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, httpsHealthCheck, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetHttpsHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpsHealthCheck=" + httpsHealthCheck + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpsHealthCheck=" + + httpsHealthCheck + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetHttpsHealthCheckHttpRequest) { GetHttpsHealthCheckHttpRequest that = (GetHttpsHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpsHealthCheck, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, httpsHealthCheck, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java index 0b87b479fd03..3d3bde96e1be 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetImageHttpRequest() { this.userIp = null; } - private GetImageHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetImageHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetImageHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetImageHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetImageHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetImageHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetImageHttpRequest build() { String missing = ""; - - if (image == null) { missing += " image"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetImageHttpRequest( - access_token, - callback, - fields, - image, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, image, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetImageHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "image=" + image + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "image=" + + image + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,31 +375,20 @@ public boolean equals(Object o) { } if (o instanceof GetImageHttpRequest) { GetImageHttpRequest that = (GetImageHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.image, that.getImage()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.image, that.getImage()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @Override public int hashCode() { - return Objects.hash( - access_token, - callback, - fields, - image, - key, - prettyPrint, - quotaUser, - userIp - ); + return Objects.hash(access_token, callback, fields, image, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java index 5f1271ff9b5c..4c13c2749ca6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInstanceGroupHttpRequest() { this.userIp = null; } - private GetInstanceGroupHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInstanceGroupHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInstanceGroupHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetInstanceGroupHttpRequest) { GetInstanceGroupHttpRequest that = (GetInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java index a2c117fd32ec..5b8e5d2a6c08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInstanceGroupManagerHttpRequest() { this.userIp = null; } - private GetInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -86,7 +81,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -170,22 +166,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInstanceGroupManagerHttpRequest(); } @@ -314,32 +312,25 @@ public Builder setUserIp(String userIp) { return this; } - public GetInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -359,14 +350,29 @@ public Builder clone() { @Override public String toString() { return "GetInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +383,14 @@ public boolean equals(Object o) { } if (o instanceof GetInstanceGroupManagerHttpRequest) { GetInstanceGroupManagerHttpRequest that = (GetInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +398,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroupManager, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java index 6fc34419fe86..be3a9305efae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInstanceHttpRequest() { this.userIp = null; } - private GetInstanceHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInstanceHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInstanceHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetInstanceHttpRequest) { GetInstanceHttpRequest that = (GetInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java index ba26f1095d46..f6fac3c4c386 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInstanceTemplateHttpRequest() { this.userIp = null; } - private GetInstanceTemplateHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInstanceTemplateHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInstanceTemplateHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInstanceTemplateHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInstanceTemplateHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInstanceTemplateHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetInstanceTemplateHttpRequest build() { String missing = ""; - - if (instanceTemplate == null) { missing += " instanceTemplate"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInstanceTemplateHttpRequest( - access_token, - callback, - fields, - instanceTemplate, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceTemplate, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetInstanceTemplateHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceTemplate=" + instanceTemplate + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceTemplate=" + + instanceTemplate + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetInstanceTemplateHttpRequest) { GetInstanceTemplateHttpRequest that = (GetInstanceTemplateHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceTemplate, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceTemplate, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java index 4c10e3281f60..18b251663554 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInterconnectAttachmentHttpRequest() { this.userIp = null; } - private GetInterconnectAttachmentHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInterconnectAttachmentHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -86,7 +81,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) { - fieldMap.put("interconnectAttachment", Collections.singletonList(String.valueOf(interconnectAttachment))); + fieldMap.put( + "interconnectAttachment", + Collections.singletonList(String.valueOf(interconnectAttachment))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -170,22 +167,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInterconnectAttachmentHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInterconnectAttachmentHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInterconnectAttachmentHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInterconnectAttachmentHttpRequest(); } @@ -314,32 +313,25 @@ public Builder setUserIp(String userIp) { return this; } - public GetInterconnectAttachmentHttpRequest build() { String missing = ""; - - if (interconnectAttachment == null) { missing += " interconnectAttachment"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInterconnectAttachmentHttpRequest( - access_token, - callback, - fields, - interconnectAttachment, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + interconnectAttachment, + key, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -359,14 +351,29 @@ public Builder clone() { @Override public String toString() { return "GetInterconnectAttachmentHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnectAttachment=" + interconnectAttachment + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnectAttachment=" + + interconnectAttachment + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +384,14 @@ public boolean equals(Object o) { } if (o instanceof GetInterconnectAttachmentHttpRequest) { GetInterconnectAttachmentHttpRequest that = (GetInterconnectAttachmentHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +399,13 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnectAttachment, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + interconnectAttachment, + key, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java index e307dce68a52..40467ffc4fa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInterconnectHttpRequest() { this.userIp = null; } - private GetInterconnectHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInterconnectHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInterconnectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInterconnectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInterconnectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInterconnectHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetInterconnectHttpRequest build() { String missing = ""; - - if (interconnect == null) { missing += " interconnect"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInterconnectHttpRequest( - access_token, - callback, - fields, - interconnect, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, interconnect, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetInterconnectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnect=" + interconnect + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnect=" + + interconnect + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetInterconnectHttpRequest) { GetInterconnectHttpRequest that = (GetInterconnectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnect, that.getInterconnect()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnect, that.getInterconnect()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnect, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, interconnect, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java index 43ad397b48c8..d60b56dc3d3b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetInterconnectLocationHttpRequest() { this.userIp = null; } - private GetInterconnectLocationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetInterconnectLocationHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -86,7 +81,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("interconnectLocation") && interconnectLocation != null) { - fieldMap.put("interconnectLocation", Collections.singletonList(String.valueOf(interconnectLocation))); + fieldMap.put( + "interconnectLocation", Collections.singletonList(String.valueOf(interconnectLocation))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -170,22 +166,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetInterconnectLocationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetInterconnectLocationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetInterconnectLocationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetInterconnectLocationHttpRequest(); } @@ -314,32 +312,25 @@ public Builder setUserIp(String userIp) { return this; } - public GetInterconnectLocationHttpRequest build() { String missing = ""; - - if (interconnectLocation == null) { missing += " interconnectLocation"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetInterconnectLocationHttpRequest( - access_token, - callback, - fields, - interconnectLocation, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + interconnectLocation, + key, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -359,14 +350,29 @@ public Builder clone() { @Override public String toString() { return "GetInterconnectLocationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnectLocation=" + interconnectLocation + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnectLocation=" + + interconnectLocation + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +383,14 @@ public boolean equals(Object o) { } if (o instanceof GetInterconnectLocationHttpRequest) { GetInterconnectLocationHttpRequest that = (GetInterconnectLocationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +398,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnectLocation, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, interconnectLocation, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java new file mode 100644 index 000000000000..5cb7a6f14f2e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java @@ -0,0 +1,395 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetLicenseCodeHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String licenseCode; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetLicenseCodeHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.licenseCode = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + private GetLicenseCodeHttpRequest( + String access_token, + String callback, + String fields, + String key, + String licenseCode, + String prettyPrint, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.licenseCode = licenseCode; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("licenseCode") && licenseCode != null) { + fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("licenseCode")) { + return String.valueOf(licenseCode); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getLicenseCode() { + return licenseCode; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetLicenseCodeHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetLicenseCodeHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetLicenseCodeHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetLicenseCodeHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String licenseCode; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetLicenseCodeHttpRequest other) { + if (other == GetLicenseCodeHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getLicenseCode() != null) { + this.licenseCode = other.licenseCode; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetLicenseCodeHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.licenseCode = source.licenseCode; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getLicenseCode() { + return licenseCode; + } + + public Builder setLicenseCode(String licenseCode) { + this.licenseCode = licenseCode; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetLicenseCodeHttpRequest build() { + String missing = ""; + + if (licenseCode == null) { + missing += " licenseCode"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetLicenseCodeHttpRequest( + access_token, callback, fields, key, licenseCode, prettyPrint, quotaUser, userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setLicenseCode(this.licenseCode); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetLicenseCodeHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "licenseCode=" + + licenseCode + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetLicenseCodeHttpRequest) { + GetLicenseCodeHttpRequest that = (GetLicenseCodeHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.licenseCode, that.getLicenseCode()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, licenseCode, prettyPrint, quotaUser, userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java index 2cec36bb2e0a..af7142f32723 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetLicenseHttpRequest() { this.userIp = null; } - private GetLicenseHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetLicenseHttpRequest( String license, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetLicenseHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetLicenseHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetLicenseHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetLicenseHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetLicenseHttpRequest build() { String missing = ""; - - - if (license == null) { missing += " license"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetLicenseHttpRequest( - access_token, - callback, - fields, - key, - license, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, license, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetLicenseHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "license=" + license + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "license=" + + license + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetLicenseHttpRequest) { GetLicenseHttpRequest that = (GetLicenseHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.license, that.getLicense()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.license, that.getLicense()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - license, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, license, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java index fd753f290575..751b2506dead 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetMachineTypeHttpRequest() { this.userIp = null; } - private GetMachineTypeHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetMachineTypeHttpRequest( String machineType, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetMachineTypeHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetMachineTypeHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetMachineTypeHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetMachineTypeHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetMachineTypeHttpRequest build() { String missing = ""; - - - if (machineType == null) { missing += " machineType"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetMachineTypeHttpRequest( - access_token, - callback, - fields, - key, - machineType, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, machineType, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetMachineTypeHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "machineType=" + machineType + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "machineType=" + + machineType + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetMachineTypeHttpRequest) { GetMachineTypeHttpRequest that = (GetMachineTypeHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.machineType, that.getMachineType()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.machineType, that.getMachineType()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - machineType, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, machineType, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java index b45b347c3644..4aa9fe8fd792 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetNetworkHttpRequest() { this.userIp = null; } - private GetNetworkHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetNetworkHttpRequest( String network, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetNetworkHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetNetworkHttpRequest build() { String missing = ""; - - - if (network == null) { missing += " network"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetNetworkHttpRequest( - access_token, - callback, - fields, - key, - network, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, network, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "network=" + network + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "network=" + + network + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetNetworkHttpRequest) { GetNetworkHttpRequest that = (GetNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - network, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, network, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java index 4adb4bc34121..f7aff07b6c3b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetProjectHttpRequest() { this.userIp = null; } - private GetProjectHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetProjectHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetProjectHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetProjectHttpRequest) { GetProjectHttpRequest that = (GetProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java index f9e4ca853a0d..2a9ea9bae395 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionAutoscalerHttpRequest() { this.userIp = null; } - private GetRegionAutoscalerHttpRequest( String access_token, String autoscaler, @@ -61,8 +57,7 @@ private GetRegionAutoscalerHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionAutoscalerHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionAutoscalerHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetRegionAutoscalerHttpRequest build() { missing += " autoscaler"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionAutoscalerHttpRequest( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, autoscaler, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionAutoscalerHttpRequest) { GetRegionAutoscalerHttpRequest that = (GetRegionAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, autoscaler, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java index e57a7e3febd6..69e9f7e76887 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionBackendServiceHttpRequest() { this.userIp = null; } - private GetRegionBackendServiceHttpRequest( String access_token, String backendService, @@ -61,8 +57,7 @@ private GetRegionBackendServiceHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.callback = callback; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionBackendServiceHttpRequest(); } @@ -314,7 +311,6 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionBackendServiceHttpRequest build() { String missing = ""; @@ -322,24 +318,11 @@ public GetRegionBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionBackendServiceHttpRequest( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionBackendServiceHttpRequest) { GetRegionBackendServiceHttpRequest that = (GetRegionBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, backendService, callback, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java index 56e8e32682a8..0a9f807f127f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionCommitmentHttpRequest() { this.userIp = null; } - private GetRegionCommitmentHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRegionCommitmentHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.commitment = commitment; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionCommitmentHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionCommitmentHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionCommitmentHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionCommitmentHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionCommitmentHttpRequest build() { String missing = ""; - if (commitment == null) { missing += " commitment"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionCommitmentHttpRequest( - access_token, - callback, - commitment, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, commitment, fields, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionCommitmentHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "commitment=" + commitment + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "commitment=" + + commitment + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionCommitmentHttpRequest) { GetRegionCommitmentHttpRequest that = (GetRegionCommitmentHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.commitment, that.getCommitment()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.commitment, that.getCommitment()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - commitment, - fields, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, commitment, fields, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java index a00910597f70..88050280800a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionHttpRequest() { this.userIp = null; } - private GetRegionHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRegionHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } @@ -331,15 +322,7 @@ public GetRegionHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, region, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionHttpRequest) { GetRegionHttpRequest that = (GetRegionHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, region, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java index dc8795624c12..7ff9e320f782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionInstanceGroupHttpRequest() { this.userIp = null; } - private GetRegionInstanceGroupHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRegionInstanceGroupHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionInstanceGroupHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionInstanceGroupHttpRequest) { GetRegionInstanceGroupHttpRequest that = (GetRegionInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroup, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java index 8d491533e2a8..212d7e16382d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private GetRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRegionInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -86,7 +81,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -170,22 +166,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionInstanceGroupManagerHttpRequest(); } @@ -314,32 +312,25 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -359,14 +350,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +383,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionInstanceGroupManagerHttpRequest) { GetRegionInstanceGroupManagerHttpRequest that = (GetRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +398,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, instanceGroupManager, key, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java index 4988e19f8288..e5bbdf3b129b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRegionOperationHttpRequest() { this.userIp = null; } - private GetRegionOperationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRegionOperationHttpRequest( String operation, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRegionOperationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRegionOperationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRegionOperationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRegionOperationHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetRegionOperationHttpRequest build() { String missing = ""; - - - if (operation == null) { missing += " operation"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRegionOperationHttpRequest( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRegionOperationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "operation=" + operation + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "operation=" + + operation + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRegionOperationHttpRequest) { GetRegionOperationHttpRequest that = (GetRegionOperationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java index 863e7b936ed2..52f9b6cb4342 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRouteHttpRequest() { this.userIp = null; } - private GetRouteHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRouteHttpRequest( String prettyPrint, String quotaUser, String route, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRouteHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRouteHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRouteHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRouteHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetRouteHttpRequest build() { String missing = ""; - - - - - if (route == null) { missing += " route"; } @@ -331,15 +322,7 @@ public GetRouteHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRouteHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - route, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, route, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRouteHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "route=" + route + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "route=" + + route + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,31 +375,20 @@ public boolean equals(Object o) { } if (o instanceof GetRouteHttpRequest) { GetRouteHttpRequest that = (GetRouteHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.route, that.getRoute()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.route, that.getRoute()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @Override public int hashCode() { - return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - route, - userIp - ); + return Objects.hash(access_token, callback, fields, key, prettyPrint, quotaUser, route, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java index e921d4f6dea3..0ce4cd7991a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRouterHttpRequest() { this.userIp = null; } - private GetRouterHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRouterHttpRequest( String prettyPrint, String quotaUser, String router, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRouterHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetRouterHttpRequest build() { String missing = ""; - - - - - if (router == null) { missing += " router"; } @@ -331,15 +322,7 @@ public GetRouterHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "router=" + router + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "router=" + + router + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRouterHttpRequest) { GetRouterHttpRequest that = (GetRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java index 889d4c16a038..161f201fe023 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetRouterStatusRouterHttpRequest() { this.userIp = null; } - private GetRouterStatusRouterHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetRouterStatusRouterHttpRequest( String prettyPrint, String quotaUser, String router, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetRouterStatusRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetRouterStatusRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetRouterStatusRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetRouterStatusRouterHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetRouterStatusRouterHttpRequest build() { String missing = ""; - - - - - if (router == null) { missing += " router"; } @@ -331,15 +322,7 @@ public GetRouterStatusRouterHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetRouterStatusRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetRouterStatusRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "router=" + router + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "router=" + + router + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetRouterStatusRouterHttpRequest) { GetRouterStatusRouterHttpRequest that = (GetRouterStatusRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, router, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java index 5eec44a0167d..887cf3504e42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private GetSerialPortOutputInstanceHttpRequest() { this.userIp = null; } - private GetSerialPortOutputInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private GetSerialPortOutputInstanceHttpRequest( String prettyPrint, String quotaUser, String start, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetSerialPortOutputInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetSerialPortOutputInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetSerialPortOutputInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetSerialPortOutputInstanceHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public GetSerialPortOutputInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetSerialPortOutputInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - port, - prettyPrint, - quotaUser, - start, - userIp - ); + access_token, + callback, + fields, + instance, + key, + port, + prettyPrint, + quotaUser, + start, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "GetSerialPortOutputInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "port=" + port + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "start=" + start + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "port=" + + port + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "start=" + + start + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof GetSerialPortOutputInstanceHttpRequest) { GetSerialPortOutputInstanceHttpRequest that = (GetSerialPortOutputInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.start, that.getStart()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.start, that.getStart()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - port, - prettyPrint, - quotaUser, - start, - userIp - ); + access_token, callback, fields, instance, key, port, prettyPrint, quotaUser, start, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java index cef8f1598984..712e57a23357 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetSnapshotHttpRequest() { this.userIp = null; } - private GetSnapshotHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetSnapshotHttpRequest( String prettyPrint, String quotaUser, String snapshot, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetSnapshotHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetSnapshotHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetSnapshotHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetSnapshotHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetSnapshotHttpRequest build() { String missing = ""; - - - - - if (snapshot == null) { missing += " snapshot"; } @@ -331,15 +322,7 @@ public GetSnapshotHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetSnapshotHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - snapshot, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, snapshot, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetSnapshotHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "snapshot=" + snapshot + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "snapshot=" + + snapshot + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetSnapshotHttpRequest) { GetSnapshotHttpRequest that = (GetSnapshotHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.snapshot, that.getSnapshot()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.snapshot, that.getSnapshot()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - snapshot, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, snapshot, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java index 77122017824b..6a891e246f99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetSslCertificateHttpRequest() { this.userIp = null; } - private GetSslCertificateHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetSslCertificateHttpRequest( String prettyPrint, String quotaUser, String sslCertificate, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetSslCertificateHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetSslCertificateHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetSslCertificateHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetSslCertificateHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetSslCertificateHttpRequest build() { String missing = ""; - - - - - if (sslCertificate == null) { missing += " sslCertificate"; } @@ -331,15 +322,7 @@ public GetSslCertificateHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetSslCertificateHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - sslCertificate, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, sslCertificate, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetSslCertificateHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "sslCertificate=" + sslCertificate + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "sslCertificate=" + + sslCertificate + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetSslCertificateHttpRequest) { GetSslCertificateHttpRequest that = (GetSslCertificateHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.sslCertificate, that.getSslCertificate()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.sslCertificate, that.getSslCertificate()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - sslCertificate, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, sslCertificate, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java new file mode 100644 index 000000000000..d08405a2fbce --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java @@ -0,0 +1,395 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetSslPolicyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String sslPolicy; + private final String userIp; + + private GetSslPolicyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.sslPolicy = null; + this.userIp = null; + } + + private GetSslPolicyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String sslPolicy, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.sslPolicy = sslPolicy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetSslPolicyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetSslPolicyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetSslPolicyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetSslPolicyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String sslPolicy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetSslPolicyHttpRequest other) { + if (other == GetSslPolicyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getSslPolicy() != null) { + this.sslPolicy = other.sslPolicy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetSslPolicyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.sslPolicy = source.sslPolicy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetSslPolicyHttpRequest build() { + String missing = ""; + + if (sslPolicy == null) { + missing += " sslPolicy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetSslPolicyHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, sslPolicy, userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setSslPolicy(this.sslPolicy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetSslPolicyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "sslPolicy=" + + sslPolicy + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetSslPolicyHttpRequest) { + GetSslPolicyHttpRequest that = (GetSslPolicyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.sslPolicy, that.getSslPolicy()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, sslPolicy, userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java index 5f1a1e6bb172..6ef53c597515 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetSubnetworkHttpRequest() { this.userIp = null; } - private GetSubnetworkHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetSubnetworkHttpRequest( String prettyPrint, String quotaUser, String subnetwork, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetSubnetworkHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetSubnetworkHttpRequest build() { String missing = ""; - - - - - if (subnetwork == null) { missing += " subnetwork"; } @@ -331,15 +322,7 @@ public GetSubnetworkHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - subnetwork, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, subnetwork, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "subnetwork=" + subnetwork + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetSubnetworkHttpRequest) { GetSubnetworkHttpRequest that = (GetSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - subnetwork, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, subnetwork, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java index 99ecd8f5c346..1bbe06ba5a44 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetHttpProxyHttpRequest() { this.userIp = null; } - private GetTargetHttpProxyHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetHttpProxyHttpRequest( String prettyPrint, String quotaUser, String targetHttpProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetHttpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetHttpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetHttpProxyHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetHttpProxyHttpRequest build() { String missing = ""; - - - - - if (targetHttpProxy == null) { missing += " targetHttpProxy"; } @@ -331,15 +322,7 @@ public GetTargetHttpProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetHttpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetHttpProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetHttpProxy, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetHttpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetHttpProxy=" + targetHttpProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetHttpProxy=" + + targetHttpProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetHttpProxyHttpRequest) { GetTargetHttpProxyHttpRequest that = (GetTargetHttpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetHttpProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetHttpProxy, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java index 4fa049faeb9b..44582e4c58e9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetHttpsProxyHttpRequest() { this.userIp = null; } - private GetTargetHttpsProxyHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetHttpsProxyHttpRequest( String prettyPrint, String quotaUser, String targetHttpsProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetHttpsProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetHttpsProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetHttpsProxyHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetHttpsProxyHttpRequest build() { String missing = ""; - - - - - if (targetHttpsProxy == null) { missing += " targetHttpsProxy"; } @@ -331,15 +322,7 @@ public GetTargetHttpsProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetHttpsProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetHttpsProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetHttpsProxy, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetHttpsProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetHttpsProxy=" + targetHttpsProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetHttpsProxy=" + + targetHttpsProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetHttpsProxyHttpRequest) { GetTargetHttpsProxyHttpRequest that = (GetTargetHttpsProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetHttpsProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetHttpsProxy, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java index 827f3f8ccdbb..89e81f5d6846 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetInstanceHttpRequest() { this.userIp = null; } - private GetTargetInstanceHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetInstanceHttpRequest( String prettyPrint, String quotaUser, String targetInstance, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetInstanceHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetInstanceHttpRequest build() { String missing = ""; - - - - - if (targetInstance == null) { missing += " targetInstance"; } @@ -331,15 +322,7 @@ public GetTargetInstanceHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetInstanceHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetInstance, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetInstance, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetInstance=" + targetInstance + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetInstance=" + + targetInstance + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetInstanceHttpRequest) { GetTargetInstanceHttpRequest that = (GetTargetInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetInstance, that.getTargetInstance()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetInstance, that.getTargetInstance()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetInstance, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetInstance, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java index 2abcff9f7549..7f75ff18a016 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetPoolHttpRequest() { this.userIp = null; } - private GetTargetPoolHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetPoolHttpRequest( String prettyPrint, String quotaUser, String targetPool, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetPoolHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetPoolHttpRequest build() { String missing = ""; - - - - - if (targetPool == null) { missing += " targetPool"; } @@ -331,15 +322,7 @@ public GetTargetPoolHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetPool, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetPool, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetPool=" + targetPool + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetPool=" + + targetPool + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetPoolHttpRequest) { GetTargetPoolHttpRequest that = (GetTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetPool, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetPool, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java index 867a3b23a0ff..5f5b29916400 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetSslProxyHttpRequest() { this.userIp = null; } - private GetTargetSslProxyHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetSslProxyHttpRequest( String prettyPrint, String quotaUser, String targetSslProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetSslProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetSslProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetSslProxyHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetSslProxyHttpRequest build() { String missing = ""; - - - - - if (targetSslProxy == null) { missing += " targetSslProxy"; } @@ -331,15 +322,7 @@ public GetTargetSslProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetSslProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetSslProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetSslProxy, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetSslProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetSslProxy=" + targetSslProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetSslProxy=" + + targetSslProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetSslProxyHttpRequest) { GetTargetSslProxyHttpRequest that = (GetTargetSslProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetSslProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetSslProxy, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java index f303e77ca864..3f83752b1fd6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetTcpProxyHttpRequest() { this.userIp = null; } - private GetTargetTcpProxyHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetTcpProxyHttpRequest( String prettyPrint, String quotaUser, String targetTcpProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetTcpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetTcpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetTcpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetTcpProxyHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetTcpProxyHttpRequest build() { String missing = ""; - - - - - if (targetTcpProxy == null) { missing += " targetTcpProxy"; } @@ -331,15 +322,7 @@ public GetTargetTcpProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetTcpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetTcpProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetTcpProxy, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetTcpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetTcpProxy=" + targetTcpProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetTcpProxy=" + + targetTcpProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetTcpProxyHttpRequest) { GetTargetTcpProxyHttpRequest that = (GetTargetTcpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetTcpProxy, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetTcpProxy, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java index 16eadbdeb109..a198980dc3cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetTargetVpnGatewayHttpRequest() { this.userIp = null; } - private GetTargetVpnGatewayHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetTargetVpnGatewayHttpRequest( String prettyPrint, String quotaUser, String targetVpnGateway, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetTargetVpnGatewayHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetTargetVpnGatewayHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetTargetVpnGatewayHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetTargetVpnGatewayHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetTargetVpnGatewayHttpRequest build() { String missing = ""; - - - - - if (targetVpnGateway == null) { missing += " targetVpnGateway"; } @@ -331,15 +322,7 @@ public GetTargetVpnGatewayHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetTargetVpnGatewayHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetVpnGateway, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetVpnGateway, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetTargetVpnGatewayHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "targetVpnGateway=" + targetVpnGateway + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "targetVpnGateway=" + + targetVpnGateway + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetTargetVpnGatewayHttpRequest) { GetTargetVpnGatewayHttpRequest that = (GetTargetVpnGatewayHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - targetVpnGateway, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, targetVpnGateway, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java index 44b7e0624e8d..a81d5bea67ca 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetUrlMapHttpRequest() { this.userIp = null; } - private GetUrlMapHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetUrlMapHttpRequest( String prettyPrint, String quotaUser, String urlMap, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetUrlMapHttpRequest(); } @@ -314,15 +311,9 @@ public Builder setUserIp(String userIp) { return this; } - public GetUrlMapHttpRequest build() { String missing = ""; - - - - - if (urlMap == null) { missing += " urlMap"; } @@ -331,15 +322,7 @@ public GetUrlMapHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - urlMap, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, urlMap, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "urlMap=" + urlMap + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "urlMap=" + + urlMap + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetUrlMapHttpRequest) { GetUrlMapHttpRequest that = (GetUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - urlMap, - userIp - ); + access_token, callback, fields, key, prettyPrint, quotaUser, urlMap, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java index be78c2e64d94..cd1792e0e4b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetVpnTunnelHttpRequest() { this.vpnTunnel = null; } - private GetVpnTunnelHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetVpnTunnelHttpRequest( String prettyPrint, String quotaUser, String userIp, - String vpnTunnel - ) { + String vpnTunnel) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getVpnTunnel() { return vpnTunnel; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetVpnTunnelHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetVpnTunnelHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetVpnTunnelHttpRequest(); } @@ -314,16 +311,9 @@ public Builder setVpnTunnel(String vpnTunnel) { return this; } - public GetVpnTunnelHttpRequest build() { String missing = ""; - - - - - - if (vpnTunnel == null) { missing += " vpnTunnel"; } @@ -331,15 +321,7 @@ public GetVpnTunnelHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetVpnTunnelHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp, - vpnTunnel - ); + access_token, callback, fields, key, prettyPrint, quotaUser, userIp, vpnTunnel); } public Builder clone() { @@ -359,14 +341,29 @@ public Builder clone() { @Override public String toString() { return "GetVpnTunnelHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "vpnTunnel=" + vpnTunnel + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "vpnTunnel=" + + vpnTunnel + "}"; } @@ -377,16 +374,14 @@ public boolean equals(Object o) { } if (o instanceof GetVpnTunnelHttpRequest) { GetVpnTunnelHttpRequest that = (GetVpnTunnelHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.vpnTunnel, that.getVpnTunnel()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.vpnTunnel, that.getVpnTunnel()); } return false; } @@ -394,14 +389,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp, - vpnTunnel - ); + access_token, callback, fields, key, prettyPrint, quotaUser, userIp, vpnTunnel); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java index b2d9f7b8d3e7..c36a0d8a2d34 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetXpnHostProjectHttpRequest() { this.userIp = null; } - private GetXpnHostProjectHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetXpnHostProjectHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetXpnHostProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetXpnHostProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetXpnHostProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetXpnHostProjectHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetXpnHostProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetXpnHostProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetXpnHostProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetXpnHostProjectHttpRequest) { GetXpnHostProjectHttpRequest that = (GetXpnHostProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, callback, fields, key, prettyPrint, project, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java index 170c829f4df9..049f445bd406 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private GetXpnResourcesProjectsHttpRequest() { this.userIp = null; } - private GetXpnResourcesProjectsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private GetXpnResourcesProjectsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetXpnResourcesProjectsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetXpnResourcesProjectsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetXpnResourcesProjectsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetXpnResourcesProjectsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public GetXpnResourcesProjectsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetXpnResourcesProjectsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "GetXpnResourcesProjectsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof GetXpnResourcesProjectsHttpRequest) { GetXpnResourcesProjectsHttpRequest that = (GetXpnResourcesProjectsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java index 17619f09814b..602b07ab97e2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetZoneHttpRequest() { this.zone = null; } - private GetZoneHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetZoneHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetZoneHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetZoneHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetZoneHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetZoneHttpRequest(); } @@ -314,16 +311,9 @@ public Builder setZone(String zone) { return this; } - public GetZoneHttpRequest build() { String missing = ""; - - - - - - if (zone == null) { missing += " zone"; } @@ -331,15 +321,7 @@ public GetZoneHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new GetZoneHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, callback, fields, key, prettyPrint, quotaUser, userIp, zone); } public Builder clone() { @@ -359,14 +341,29 @@ public Builder clone() { @Override public String toString() { return "GetZoneHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -377,31 +374,20 @@ public boolean equals(Object o) { } if (o instanceof GetZoneHttpRequest) { GetZoneHttpRequest that = (GetZoneHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - userIp, - zone - ); + return Objects.hash(access_token, callback, fields, key, prettyPrint, quotaUser, userIp, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java index 5b7dc23b83c1..d2f32e90abf6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private GetZoneOperationHttpRequest() { this.userIp = null; } - private GetZoneOperationHttpRequest( String access_token, String callback, @@ -61,8 +57,7 @@ private GetZoneOperationHttpRequest( String operation, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -170,22 +165,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GetZoneOperationHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GetZoneOperationHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GetZoneOperationHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GetZoneOperationHttpRequest(); } @@ -314,32 +311,18 @@ public Builder setUserIp(String userIp) { return this; } - public GetZoneOperationHttpRequest build() { String missing = ""; - - - if (operation == null) { missing += " operation"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new GetZoneOperationHttpRequest( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } public Builder clone() { @@ -359,14 +342,29 @@ public Builder clone() { @Override public String toString() { return "GetZoneOperationHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "operation=" + operation + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "operation=" + + operation + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -377,16 +375,14 @@ public boolean equals(Object o) { } if (o instanceof GetZoneOperationHttpRequest) { GetZoneOperationHttpRequest that = (GetZoneOperationHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -394,14 +390,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - operation, - prettyPrint, - quotaUser, - userIp - ); + access_token, callback, fields, key, operation, prettyPrint, quotaUser, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java index 04e17f038757..8f41a300a955 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.GlobalAddressStub; import com.google.cloud.compute.v1.stub.GlobalAddressStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,7 +42,7 @@ *

  * 
  * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
- *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+ *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
  *   String requestId = "";
  *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
  * }
@@ -60,33 +50,32 @@
  * 
* *

Note: close() needs to be called on the globalAddressClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of GlobalAddressSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class GlobalAddressClient implements BackgroundResource {
   private final GlobalAddressSettings settings;
   private final GlobalAddressStub stub;
 
-
-
-  /**
-   * Constructs an instance of GlobalAddressClient with default settings.
-   */
+  /** Constructs an instance of GlobalAddressClient with default settings. */
   public static final GlobalAddressClient create() throws IOException {
     return create(GlobalAddressSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of GlobalAddressClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of GlobalAddressClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final GlobalAddressClient create(GlobalAddressSettings settings) throws IOException {
+  public static final GlobalAddressClient create(GlobalAddressSettings settings)
+      throws IOException {
     return new GlobalAddressClient(settings);
   }
 
   /**
-   * Constructs an instance of GlobalAddressClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use GlobalAddressSettings}.
+   * Constructs an instance of GlobalAddressClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use GlobalAddressSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final GlobalAddressClient create(GlobalAddressStub stub) {
@@ -144,9 +129,9 @@ public static final GlobalAddressClient create(GlobalAddressStub stub) {
   }
 
   /**
-   * Constructs an instance of GlobalAddressClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of GlobalAddressClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected GlobalAddressClient(GlobalAddressSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +153,40 @@ public GlobalAddressStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   String requestId = "";
    *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
    * }
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalAddress(ProjectAddressName address, String requestId) { + public final Operation deleteGlobalAddress(ProjectGlobalAddressName address, String requestId) { DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder() - .setAddress(address == null ? null : address.toString()) - .setRequestId(requestId) - .build(); + .setAddress(address == null ? null : address.toString()) + .setRequestId(requestId) + .build(); return deleteGlobalAddress(request); } @@ -205,21 +194,26 @@ public final Operation deleteGlobalAddress(ProjectAddressName address, String re /** * Deletes the specified address resource. * - * Sample code: + *

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   String requestId = "";
    *   Operation response = globalAddressClient.deleteGlobalAddress(address.toString(), requestId);
    * }
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +221,9 @@ public final Operation deleteGlobalAddress(String address, String requestId) { DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder() - .setAddress(address) - .setRequestId(requestId) - .build(); + .setAddress(address) + .setRequestId(requestId) + .build(); return deleteGlobalAddress(request); } @@ -237,10 +231,11 @@ public final Operation deleteGlobalAddress(String address, String requestId) { /** * Deletes the specified address resource. * - * Sample code: + *

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   String requestId = "";
    *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
@@ -262,10 +257,11 @@ public final Operation deleteGlobalAddress(DeleteGlobalAddressHttpRequest reques
   /**
    * Deletes the specified address resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   String requestId = "";
    *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
@@ -278,18 +274,21 @@ public final Operation deleteGlobalAddress(DeleteGlobalAddressHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable deleteGlobalAddressCallable() { + public final UnaryCallable + deleteGlobalAddressCallable() { return stub.deleteGlobalAddressCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() request. + * Returns the specified address resource. Get a list of available addresses by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   Address response = globalAddressClient.getGlobalAddress(address);
    * }
    * 
@@ -298,23 +297,25 @@ public final UnaryCallable deleteGlob * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Address getGlobalAddress(ProjectAddressName address) { + public final Address getGlobalAddress(ProjectGlobalAddressName address) { GetGlobalAddressHttpRequest request = GetGlobalAddressHttpRequest.newBuilder() - .setAddress(address == null ? null : address.toString()) - .build(); + .setAddress(address == null ? null : address.toString()) + .build(); return getGlobalAddress(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() request. + * Returns the specified address resource. Get a list of available addresses by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   Address response = globalAddressClient.getGlobalAddress(address.toString());
    * }
    * 
@@ -326,20 +327,20 @@ public final Address getGlobalAddress(ProjectAddressName address) { public final Address getGlobalAddress(String address) { GetGlobalAddressHttpRequest request = - GetGlobalAddressHttpRequest.newBuilder() - .setAddress(address) - .build(); + GetGlobalAddressHttpRequest.newBuilder().setAddress(address).build(); return getGlobalAddress(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() request. + * Returns the specified address resource. Get a list of available addresses by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   GetGlobalAddressHttpRequest request = GetGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
    *     .build();
@@ -357,12 +358,14 @@ public final Address getGlobalAddress(GetGlobalAddressHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified address resource. Get a list of available addresses by making a list() request.
+   * Returns the specified address resource. Get a list of available addresses by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+   *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
    *   GetGlobalAddressHttpRequest request = GetGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
    *     .build();
@@ -381,7 +384,8 @@ public final UnaryCallable getGlobalAddres
   /**
    * Creates an address resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   String requestId = "";
@@ -391,24 +395,31 @@ public final UnaryCallable getGlobalAddres
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for + * v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalAddress(String requestId, ProjectName project, Address addressResource) { + public final Operation insertGlobalAddress( + String requestId, ProjectName project, Address addressResource) { InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setAddressResource(addressResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setAddressResource(addressResource) + .build(); return insertGlobalAddress(request); } @@ -416,7 +427,8 @@ public final Operation insertGlobalAddress(String requestId, ProjectName project /** * Creates an address resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   String requestId = "";
@@ -426,24 +438,31 @@ public final Operation insertGlobalAddress(String requestId, ProjectName project
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) + * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for + * v1.globalAddresses ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalAddress(String requestId, String project, Address addressResource) { + public final Operation insertGlobalAddress( + String requestId, String project, Address addressResource) { InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setAddressResource(addressResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setAddressResource(addressResource) + .build(); return insertGlobalAddress(request); } @@ -451,7 +470,8 @@ public final Operation insertGlobalAddress(String requestId, String project, Add /** * Creates an address resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   String requestId = "";
@@ -478,7 +498,8 @@ public final Operation insertGlobalAddress(InsertGlobalAddressHttpRequest reques
   /**
    * Creates an address resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   String requestId = "";
@@ -496,7 +517,8 @@ public final Operation insertGlobalAddress(InsertGlobalAddressHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable insertGlobalAddressCallable() { + public final UnaryCallable + insertGlobalAddressCallable() { return stub.insertGlobalAddressCallable(); } @@ -504,7 +526,8 @@ public final UnaryCallable insertGlob /** * Retrieves a list of global addresses. * - * Sample code: + *

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +544,8 @@ public final UnaryCallable insertGlob
   public final ListGlobalAddressesPagedResponse listGlobalAddresses(ProjectName project) {
     ListGlobalAddressesHttpRequest request =
         ListGlobalAddressesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listGlobalAddresses(request);
   }
 
@@ -530,7 +553,8 @@ public final ListGlobalAddressesPagedResponse listGlobalAddresses(ProjectName pr
   /**
    * Retrieves a list of global addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +570,7 @@ public final ListGlobalAddressesPagedResponse listGlobalAddresses(ProjectName pr
   @BetaApi
   public final ListGlobalAddressesPagedResponse listGlobalAddresses(String project) {
     ListGlobalAddressesHttpRequest request =
-        ListGlobalAddressesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListGlobalAddressesHttpRequest.newBuilder().setProject(project).build();
     return listGlobalAddresses(request);
   }
 
@@ -556,7 +578,8 @@ public final ListGlobalAddressesPagedResponse listGlobalAddresses(String project
   /**
    * Retrieves a list of global addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +596,17 @@ public final ListGlobalAddressesPagedResponse listGlobalAddresses(String project
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListGlobalAddressesPagedResponse listGlobalAddresses(ListGlobalAddressesHttpRequest request) {
-    return listGlobalAddressesPagedCallable()
-        .call(request);
+  public final ListGlobalAddressesPagedResponse listGlobalAddresses(
+      ListGlobalAddressesHttpRequest request) {
+    return listGlobalAddressesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of global addresses.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +622,8 @@ public final ListGlobalAddressesPagedResponse listGlobalAddresses(ListGlobalAddr
    * 
*/ @BetaApi - public final UnaryCallable listGlobalAddressesPagedCallable() { + public final UnaryCallable + listGlobalAddressesPagedCallable() { return stub.listGlobalAddressesPagedCallable(); } @@ -606,7 +631,8 @@ public final UnaryCallableSample code: + * *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,12 +655,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listGlobalAddressesCallable() { + public final UnaryCallable + listGlobalAddressesCallable() { return stub.listGlobalAddressesCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -663,12 +690,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListGlobalAddressesPagedResponse extends AbstractPagedListResponse< - ListGlobalAddressesHttpRequest, - AddressList, - Address, - ListGlobalAddressesPage, - ListGlobalAddressesFixedSizeCollection> { + public static class ListGlobalAddressesPagedResponse + extends AbstractPagedListResponse< + ListGlobalAddressesHttpRequest, AddressList, Address, ListGlobalAddressesPage, + ListGlobalAddressesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -688,15 +713,11 @@ public ListGlobalAddressesPagedResponse apply(ListGlobalAddressesPage input) { private ListGlobalAddressesPagedResponse(ListGlobalAddressesPage page) { super(page, ListGlobalAddressesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListGlobalAddressesPage extends AbstractPage< - ListGlobalAddressesHttpRequest, - AddressList, - Address, - ListGlobalAddressesPage> { + public static class ListGlobalAddressesPage + extends AbstractPage< + ListGlobalAddressesHttpRequest, AddressList, Address, ListGlobalAddressesPage> { private ListGlobalAddressesPage( PageContext context, @@ -721,20 +742,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListGlobalAddressesFixedSizeCollection extends AbstractFixedSizeCollection< - ListGlobalAddressesHttpRequest, - AddressList, - Address, - ListGlobalAddressesPage, - ListGlobalAddressesFixedSizeCollection> { + public static class ListGlobalAddressesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListGlobalAddressesHttpRequest, AddressList, Address, ListGlobalAddressesPage, + ListGlobalAddressesFixedSizeCollection> { - private ListGlobalAddressesFixedSizeCollection(List pages, int collectionSize) { + private ListGlobalAddressesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -747,7 +763,5 @@ protected ListGlobalAddressesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListGlobalAddressesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java index cf03a2bdfb41..bd52222065dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; import com.google.cloud.compute.v1.stub.GlobalAddressStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteGlobalAddress to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteGlobalAddress to 30 seconds: * *

  * 
@@ -85,77 +63,62 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class GlobalAddressSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteGlobalAddress.
-   */
-  public UnaryCallSettings deleteGlobalAddressSettings() {
+  /** Returns the object with the settings used for calls to deleteGlobalAddress. */
+  public UnaryCallSettings
+      deleteGlobalAddressSettings() {
     return ((GlobalAddressStubSettings) getStubSettings()).deleteGlobalAddressSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getGlobalAddress.
-   */
+  /** Returns the object with the settings used for calls to getGlobalAddress. */
   public UnaryCallSettings getGlobalAddressSettings() {
     return ((GlobalAddressStubSettings) getStubSettings()).getGlobalAddressSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertGlobalAddress.
-   */
-  public UnaryCallSettings insertGlobalAddressSettings() {
+  /** Returns the object with the settings used for calls to insertGlobalAddress. */
+  public UnaryCallSettings
+      insertGlobalAddressSettings() {
     return ((GlobalAddressStubSettings) getStubSettings()).insertGlobalAddressSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listGlobalAddresses.
-   */
-  public PagedCallSettings listGlobalAddressesSettings() {
+  /** Returns the object with the settings used for calls to listGlobalAddresses. */
+  public PagedCallSettings<
+          ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse>
+      listGlobalAddressesSettings() {
     return ((GlobalAddressStubSettings) getStubSettings()).listGlobalAddressesSettings();
   }
 
-
-  public static final GlobalAddressSettings create(GlobalAddressStubSettings stub) throws IOException {
+  public static final GlobalAddressSettings create(GlobalAddressStubSettings stub)
+      throws IOException {
     return new GlobalAddressSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return GlobalAddressStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return GlobalAddressStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return GlobalAddressStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return GlobalAddressStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return GlobalAddressStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return GlobalAddressStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return GlobalAddressStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -168,23 +131,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return GlobalAddressStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -193,9 +150,7 @@ protected GlobalAddressSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for GlobalAddressSettings.
-   */
+  /** Builder for GlobalAddressSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -217,46 +172,45 @@ protected Builder(GlobalAddressStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public GlobalAddressStubSettings.Builder getStubSettingsBuilder() {
       return ((GlobalAddressStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteGlobalAddress. - */ - public UnaryCallSettings.Builder deleteGlobalAddressSettings() { + /** Returns the builder for the settings used for calls to deleteGlobalAddress. */ + public UnaryCallSettings.Builder + deleteGlobalAddressSettings() { return getStubSettingsBuilder().deleteGlobalAddressSettings(); } - /** - * Returns the builder for the settings used for calls to getGlobalAddress. - */ - public UnaryCallSettings.Builder getGlobalAddressSettings() { + /** Returns the builder for the settings used for calls to getGlobalAddress. */ + public UnaryCallSettings.Builder + getGlobalAddressSettings() { return getStubSettingsBuilder().getGlobalAddressSettings(); } - /** - * Returns the builder for the settings used for calls to insertGlobalAddress. - */ - public UnaryCallSettings.Builder insertGlobalAddressSettings() { + /** Returns the builder for the settings used for calls to insertGlobalAddress. */ + public UnaryCallSettings.Builder + insertGlobalAddressSettings() { return getStubSettingsBuilder().insertGlobalAddressSettings(); } - /** - * Returns the builder for the settings used for calls to listGlobalAddresses. - */ - public PagedCallSettings.Builder listGlobalAddressesSettings() { + /** Returns the builder for the settings used for calls to listGlobalAddresses. */ + public PagedCallSettings.Builder< + ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse> + listGlobalAddressesSettings() { return getStubSettingsBuilder().listGlobalAddressesSettings(); } @@ -265,4 +219,4 @@ public GlobalAddressSettings build() throws IOException { return new GlobalAddressSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java index c37774ea2d5d..e856065ff0e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStub; import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,40 @@ * * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) { * String requestId = ""; - * ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + * ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); * Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule); * } * *

* - *

Note: close() needs to be called on the globalForwardingRuleClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the globalForwardingRuleClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of GlobalForwardingRuleSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of GlobalForwardingRuleSettings + * to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class GlobalForwardingRuleClient implements BackgroundResource {
   private final GlobalForwardingRuleSettings settings;
   private final GlobalForwardingRuleStub stub;
 
-
-
-  /**
-   * Constructs an instance of GlobalForwardingRuleClient with default settings.
-   */
+  /** Constructs an instance of GlobalForwardingRuleClient with default settings. */
   public static final GlobalForwardingRuleClient create() throws IOException {
     return create(GlobalForwardingRuleSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of GlobalForwardingRuleClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of GlobalForwardingRuleClient, using the given settings. The channels
+   * are created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final GlobalForwardingRuleClient create(GlobalForwardingRuleSettings settings) throws IOException {
+  public static final GlobalForwardingRuleClient create(GlobalForwardingRuleSettings settings)
+      throws IOException {
     return new GlobalForwardingRuleClient(settings);
   }
 
   /**
-   * Constructs an instance of GlobalForwardingRuleClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use GlobalForwardingRuleSettings}.
+   * Constructs an instance of GlobalForwardingRuleClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use GlobalForwardingRuleSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final GlobalForwardingRuleClient create(GlobalForwardingRuleStub stub) {
@@ -144,9 +130,9 @@ public static final GlobalForwardingRuleClient create(GlobalForwardingRuleStub s
   }
 
   /**
-   * Constructs an instance of GlobalForwardingRuleClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of GlobalForwardingRuleClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
   protected GlobalForwardingRuleClient(GlobalForwardingRuleSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +154,41 @@ public GlobalForwardingRuleStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified GlobalForwardingRule resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalForwardingRule(String requestId, ProjectForwardingRuleName forwardingRule) { + public final Operation deleteGlobalForwardingRule( + String requestId, ProjectGlobalForwardingRuleName forwardingRule) { DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); return deleteGlobalForwardingRule(request); } @@ -205,20 +196,25 @@ public final Operation deleteGlobalForwardingRule(String requestId, ProjectForwa /** * Deletes the specified GlobalForwardingRule resource. * - * Sample code: + *

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +223,9 @@ public final Operation deleteGlobalForwardingRule(String requestId, String forwa DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule) + .build(); return deleteGlobalForwardingRule(request); } @@ -237,11 +233,12 @@ public final Operation deleteGlobalForwardingRule(String requestId, String forwa /** * Deletes the specified GlobalForwardingRule resource. * - * Sample code: + *

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
@@ -262,11 +259,12 @@ public final Operation deleteGlobalForwardingRule(DeleteGlobalForwardingRuleHttp
   /**
    * Deletes the specified GlobalForwardingRule resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
@@ -278,18 +276,21 @@ public final Operation deleteGlobalForwardingRule(DeleteGlobalForwardingRuleHttp
    * 
*/ @BetaApi - public final UnaryCallable deleteGlobalForwardingRuleCallable() { + public final UnaryCallable + deleteGlobalForwardingRuleCallable() { return stub.deleteGlobalForwardingRuleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   ForwardingRule response = globalForwardingRuleClient.getGlobalForwardingRule(forwardingRule);
    * }
    * 
@@ -298,23 +299,26 @@ public final UnaryCallable del * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ForwardingRule getGlobalForwardingRule(ProjectForwardingRuleName forwardingRule) { + public final ForwardingRule getGlobalForwardingRule( + ProjectGlobalForwardingRuleName forwardingRule) { GetGlobalForwardingRuleHttpRequest request = GetGlobalForwardingRuleHttpRequest.newBuilder() - .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) - .build(); + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .build(); return getGlobalForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   ForwardingRule response = globalForwardingRuleClient.getGlobalForwardingRule(forwardingRule.toString());
    * }
    * 
@@ -326,20 +330,20 @@ public final ForwardingRule getGlobalForwardingRule(ProjectForwardingRuleName fo public final ForwardingRule getGlobalForwardingRule(String forwardingRule) { GetGlobalForwardingRuleHttpRequest request = - GetGlobalForwardingRuleHttpRequest.newBuilder() - .setForwardingRule(forwardingRule) - .build(); + GetGlobalForwardingRuleHttpRequest.newBuilder().setForwardingRule(forwardingRule).build(); return getGlobalForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. + * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   GetGlobalForwardingRuleHttpRequest request = GetGlobalForwardingRuleHttpRequest.newBuilder()
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
@@ -357,12 +361,14 @@ public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpR
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.
+   * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules
+   * by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   GetGlobalForwardingRuleHttpRequest request = GetGlobalForwardingRuleHttpRequest.newBuilder()
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
@@ -373,15 +379,18 @@ public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpR
    * 
*/ @BetaApi - public final UnaryCallable getGlobalForwardingRuleCallable() { + public final UnaryCallable + getGlobalForwardingRuleCallable() { return stub.getGlobalForwardingRuleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * Creates a GlobalForwardingRule resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -391,32 +400,44 @@ public final UnaryCallable g
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies + * which pool of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== + * resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== + * resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) + * (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalForwardingRule(String requestId, ProjectName project, ForwardingRule forwardingRuleResource) { + public final Operation insertGlobalForwardingRule( + String requestId, ProjectName project, ForwardingRule forwardingRuleResource) { InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setForwardingRuleResource(forwardingRuleResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setForwardingRuleResource(forwardingRuleResource) + .build(); return insertGlobalForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * Creates a GlobalForwardingRule resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -426,32 +447,44 @@ public final Operation insertGlobalForwardingRule(String requestId, ProjectName
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) + * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies + * which pool of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== + * resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== + * resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) + * (== resource_for v1.regionForwardingRules ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalForwardingRule(String requestId, String project, ForwardingRule forwardingRuleResource) { + public final Operation insertGlobalForwardingRule( + String requestId, String project, ForwardingRule forwardingRuleResource) { InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setForwardingRuleResource(forwardingRuleResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setForwardingRuleResource(forwardingRuleResource) + .build(); return insertGlobalForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * Creates a GlobalForwardingRule resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -476,9 +509,11 @@ public final Operation insertGlobalForwardingRule(InsertGlobalForwardingRuleHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a GlobalForwardingRule resource in the specified project using the data included in the request.
+   * Creates a GlobalForwardingRule resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
@@ -496,7 +531,8 @@ public final Operation insertGlobalForwardingRule(InsertGlobalForwardingRuleHttp
    * 
*/ @BetaApi - public final UnaryCallable insertGlobalForwardingRuleCallable() { + public final UnaryCallable + insertGlobalForwardingRuleCallable() { return stub.insertGlobalForwardingRuleCallable(); } @@ -504,7 +540,8 @@ public final UnaryCallable ins /** * Retrieves a list of GlobalForwardingRule resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -518,11 +555,12 @@ public final UnaryCallable ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(ProjectName project) {
+  public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(
+      ProjectName project) {
     ListGlobalForwardingRulesHttpRequest request =
         ListGlobalForwardingRulesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listGlobalForwardingRules(request);
   }
 
@@ -530,7 +568,8 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(Pr
   /**
    * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +585,7 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(Pr
   @BetaApi
   public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(String project) {
     ListGlobalForwardingRulesHttpRequest request =
-        ListGlobalForwardingRulesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListGlobalForwardingRulesHttpRequest.newBuilder().setProject(project).build();
     return listGlobalForwardingRules(request);
   }
 
@@ -556,7 +593,8 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(St
   /**
    * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +611,17 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(ListGlobalForwardingRulesHttpRequest request) {
-    return listGlobalForwardingRulesPagedCallable()
-        .call(request);
+  public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(
+      ListGlobalForwardingRulesHttpRequest request) {
+    return listGlobalForwardingRulesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of GlobalForwardingRule resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +637,9 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(Li
    * 
*/ @BetaApi - public final UnaryCallable listGlobalForwardingRulesPagedCallable() { + public final UnaryCallable< + ListGlobalForwardingRulesHttpRequest, ListGlobalForwardingRulesPagedResponse> + listGlobalForwardingRulesPagedCallable() { return stub.listGlobalForwardingRulesPagedCallable(); } @@ -606,7 +647,8 @@ public final UnaryCallableSample code: + * *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,89 +671,108 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listGlobalForwardingRulesCallable() { + public final UnaryCallable + listGlobalForwardingRulesCallable() { return stub.listGlobalForwardingRulesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same + * type as the old target. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetGlobalForwardingRule(String requestId, ProjectForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetGlobalForwardingRule( + String requestId, + ProjectGlobalForwardingRuleName forwardingRule, + TargetReference targetReferenceResource) { SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) - .setTargetReferenceResource(targetReferenceResource) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) + .setTargetReferenceResource(targetReferenceResource) + .build(); return setTargetGlobalForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same + * type as the old target. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(requestId, forwardingRule.toString(), targetReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetGlobalForwardingRule(String requestId, String forwardingRule, TargetReference targetReferenceResource) { + public final Operation setTargetGlobalForwardingRule( + String requestId, String forwardingRule, TargetReference targetReferenceResource) { SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule) - .setTargetReferenceResource(targetReferenceResource) - .build(); + .setRequestId(requestId) + .setForwardingRule(forwardingRule) + .setTargetReferenceResource(targetReferenceResource) + .build(); return setTargetGlobalForwardingRule(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same + * type as the old target. + * + *

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -726,19 +787,22 @@ public final Operation setTargetGlobalForwardingRule(String requestId, String fo
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetGlobalForwardingRule(SetTargetGlobalForwardingRuleHttpRequest request) {
+  public final Operation setTargetGlobalForwardingRule(
+      SetTargetGlobalForwardingRuleHttpRequest request) {
     return setTargetGlobalForwardingRuleCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.
+   * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same
+   * type as the old target.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
    *   String requestId = "";
-   *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+   *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -752,12 +816,13 @@ public final Operation setTargetGlobalForwardingRule(SetTargetGlobalForwardingRu
    * 
*/ @BetaApi - public final UnaryCallable setTargetGlobalForwardingRuleCallable() { + public final UnaryCallable + setTargetGlobalForwardingRuleCallable() { return stub.setTargetGlobalForwardingRuleCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -786,15 +851,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListGlobalForwardingRulesPagedResponse extends AbstractPagedListResponse< - ListGlobalForwardingRulesHttpRequest, - ForwardingRuleList, - ForwardingRule, - ListGlobalForwardingRulesPage, - ListGlobalForwardingRulesFixedSizeCollection> { + public static class ListGlobalForwardingRulesPagedResponse + extends AbstractPagedListResponse< + ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule, + ListGlobalForwardingRulesPage, ListGlobalForwardingRulesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListGlobalForwardingRulesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -802,7 +866,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public ListGlobalForwardingRulesPagedResponse apply(ListGlobalForwardingRulesPage input) { + public ListGlobalForwardingRulesPagedResponse apply( + ListGlobalForwardingRulesPage input) { return new ListGlobalForwardingRulesPagedResponse(input); } }); @@ -811,18 +876,16 @@ public ListGlobalForwardingRulesPagedResponse apply(ListGlobalForwardingRulesPag private ListGlobalForwardingRulesPagedResponse(ListGlobalForwardingRulesPage page) { super(page, ListGlobalForwardingRulesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListGlobalForwardingRulesPage extends AbstractPage< - ListGlobalForwardingRulesHttpRequest, - ForwardingRuleList, - ForwardingRule, - ListGlobalForwardingRulesPage> { + public static class ListGlobalForwardingRulesPage + extends AbstractPage< + ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule, + ListGlobalForwardingRulesPage> { private ListGlobalForwardingRulesPage( - PageContext context, + PageContext + context, ForwardingRuleList response) { super(context, response); } @@ -833,31 +896,28 @@ private static ListGlobalForwardingRulesPage createEmptyPage() { @Override protected ListGlobalForwardingRulesPage createPage( - PageContext context, + PageContext + context, ForwardingRuleList response) { return new ListGlobalForwardingRulesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListGlobalForwardingRulesFixedSizeCollection extends AbstractFixedSizeCollection< - ListGlobalForwardingRulesHttpRequest, - ForwardingRuleList, - ForwardingRule, - ListGlobalForwardingRulesPage, - ListGlobalForwardingRulesFixedSizeCollection> { + public static class ListGlobalForwardingRulesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule, + ListGlobalForwardingRulesPage, ListGlobalForwardingRulesFixedSizeCollection> { - private ListGlobalForwardingRulesFixedSizeCollection(List pages, int collectionSize) { + private ListGlobalForwardingRulesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -870,7 +930,5 @@ protected ListGlobalForwardingRulesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListGlobalForwardingRulesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java index 8eba9797810f..6316339fd069 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteGlobalForwardingRule to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteGlobalForwardingRule to 30 seconds: * *

  * 
@@ -85,84 +63,74 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class GlobalForwardingRuleSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteGlobalForwardingRule.
-   */
-  public UnaryCallSettings deleteGlobalForwardingRuleSettings() {
-    return ((GlobalForwardingRuleStubSettings) getStubSettings()).deleteGlobalForwardingRuleSettings();
+  /** Returns the object with the settings used for calls to deleteGlobalForwardingRule. */
+  public UnaryCallSettings
+      deleteGlobalForwardingRuleSettings() {
+    return ((GlobalForwardingRuleStubSettings) getStubSettings())
+        .deleteGlobalForwardingRuleSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getGlobalForwardingRule.
-   */
-  public UnaryCallSettings getGlobalForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to getGlobalForwardingRule. */
+  public UnaryCallSettings
+      getGlobalForwardingRuleSettings() {
     return ((GlobalForwardingRuleStubSettings) getStubSettings()).getGlobalForwardingRuleSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertGlobalForwardingRule.
-   */
-  public UnaryCallSettings insertGlobalForwardingRuleSettings() {
-    return ((GlobalForwardingRuleStubSettings) getStubSettings()).insertGlobalForwardingRuleSettings();
+  /** Returns the object with the settings used for calls to insertGlobalForwardingRule. */
+  public UnaryCallSettings
+      insertGlobalForwardingRuleSettings() {
+    return ((GlobalForwardingRuleStubSettings) getStubSettings())
+        .insertGlobalForwardingRuleSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listGlobalForwardingRules.
-   */
-  public PagedCallSettings listGlobalForwardingRulesSettings() {
-    return ((GlobalForwardingRuleStubSettings) getStubSettings()).listGlobalForwardingRulesSettings();
+  /** Returns the object with the settings used for calls to listGlobalForwardingRules. */
+  public PagedCallSettings<
+          ListGlobalForwardingRulesHttpRequest, ForwardingRuleList,
+          ListGlobalForwardingRulesPagedResponse>
+      listGlobalForwardingRulesSettings() {
+    return ((GlobalForwardingRuleStubSettings) getStubSettings())
+        .listGlobalForwardingRulesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTargetGlobalForwardingRule.
-   */
-  public UnaryCallSettings setTargetGlobalForwardingRuleSettings() {
-    return ((GlobalForwardingRuleStubSettings) getStubSettings()).setTargetGlobalForwardingRuleSettings();
+  /** Returns the object with the settings used for calls to setTargetGlobalForwardingRule. */
+  public UnaryCallSettings
+      setTargetGlobalForwardingRuleSettings() {
+    return ((GlobalForwardingRuleStubSettings) getStubSettings())
+        .setTargetGlobalForwardingRuleSettings();
   }
 
-
-  public static final GlobalForwardingRuleSettings create(GlobalForwardingRuleStubSettings stub) throws IOException {
+  public static final GlobalForwardingRuleSettings create(GlobalForwardingRuleStubSettings stub)
+      throws IOException {
     return new GlobalForwardingRuleSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return GlobalForwardingRuleStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return GlobalForwardingRuleStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return GlobalForwardingRuleStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return GlobalForwardingRuleStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return GlobalForwardingRuleStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return GlobalForwardingRuleStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return GlobalForwardingRuleStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -175,23 +143,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return GlobalForwardingRuleStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -200,10 +162,9 @@ protected GlobalForwardingRuleSettings(Builder settingsBuilder) throws IOExcepti
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for GlobalForwardingRuleSettings.
-   */
-  public static class Builder extends ClientSettings.Builder {
+  /** Builder for GlobalForwardingRuleSettings. */
+  public static class Builder
+      extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
     }
@@ -224,53 +185,52 @@ protected Builder(GlobalForwardingRuleStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public GlobalForwardingRuleStubSettings.Builder getStubSettingsBuilder() {
       return ((GlobalForwardingRuleStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteGlobalForwardingRule. - */ - public UnaryCallSettings.Builder deleteGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to deleteGlobalForwardingRule. */ + public UnaryCallSettings.Builder + deleteGlobalForwardingRuleSettings() { return getStubSettingsBuilder().deleteGlobalForwardingRuleSettings(); } - /** - * Returns the builder for the settings used for calls to getGlobalForwardingRule. - */ - public UnaryCallSettings.Builder getGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to getGlobalForwardingRule. */ + public UnaryCallSettings.Builder + getGlobalForwardingRuleSettings() { return getStubSettingsBuilder().getGlobalForwardingRuleSettings(); } - /** - * Returns the builder for the settings used for calls to insertGlobalForwardingRule. - */ - public UnaryCallSettings.Builder insertGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to insertGlobalForwardingRule. */ + public UnaryCallSettings.Builder + insertGlobalForwardingRuleSettings() { return getStubSettingsBuilder().insertGlobalForwardingRuleSettings(); } - /** - * Returns the builder for the settings used for calls to listGlobalForwardingRules. - */ - public PagedCallSettings.Builder listGlobalForwardingRulesSettings() { + /** Returns the builder for the settings used for calls to listGlobalForwardingRules. */ + public PagedCallSettings.Builder< + ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, + ListGlobalForwardingRulesPagedResponse> + listGlobalForwardingRulesSettings() { return getStubSettingsBuilder().listGlobalForwardingRulesSettings(); } - /** - * Returns the builder for the settings used for calls to setTargetGlobalForwardingRule. - */ - public UnaryCallSettings.Builder setTargetGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to setTargetGlobalForwardingRule. */ + public UnaryCallSettings.Builder + setTargetGlobalForwardingRuleSettings() { return getStubSettingsBuilder().setTargetGlobalForwardingRuleSettings(); } @@ -279,4 +239,4 @@ public GlobalForwardingRuleSettings build() throws IOException { return new GlobalForwardingRuleSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java index 6ebbcf6e96b1..4abce4f4900c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.GlobalOperationStub; import com.google.cloud.compute.v1.stub.GlobalOperationStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,40 +42,40 @@ *

  * 
  * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
- *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+ *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
  *   globalOperationClient.deleteGlobalOperation(operation);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the globalOperationClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the globalOperationClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of GlobalOperationSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class GlobalOperationClient implements BackgroundResource {
   private final GlobalOperationSettings settings;
   private final GlobalOperationStub stub;
 
-
-
-  /**
-   * Constructs an instance of GlobalOperationClient with default settings.
-   */
+  /** Constructs an instance of GlobalOperationClient with default settings. */
   public static final GlobalOperationClient create() throws IOException {
     return create(GlobalOperationSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of GlobalOperationClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of GlobalOperationClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final GlobalOperationClient create(GlobalOperationSettings settings) throws IOException {
+  public static final GlobalOperationClient create(GlobalOperationSettings settings)
+      throws IOException {
     return new GlobalOperationClient(settings);
   }
 
   /**
-   * Constructs an instance of GlobalOperationClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use GlobalOperationSettings}.
+   * Constructs an instance of GlobalOperationClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use GlobalOperationSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final GlobalOperationClient create(GlobalOperationStub stub) {
@@ -143,9 +129,9 @@ public static final GlobalOperationClient create(GlobalOperationStub stub) {
   }
 
   /**
-   * Constructs an instance of GlobalOperationClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of GlobalOperationClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected GlobalOperationClient(GlobalOperationSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public GlobalOperationStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of all operations.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -186,11 +172,12 @@ public GlobalOperationStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(ProjectName project) {
+  public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(
+      ProjectName project) {
     AggregatedListGlobalOperationsHttpRequest request =
         AggregatedListGlobalOperationsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListGlobalOperations(request);
   }
 
@@ -198,7 +185,8 @@ public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOpe
   /**
    * Retrieves an aggregated list of all operations.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -212,11 +200,10 @@ public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOpe
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(String project) {
+  public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(
+      String project) {
     AggregatedListGlobalOperationsHttpRequest request =
-        AggregatedListGlobalOperationsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListGlobalOperationsHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListGlobalOperations(request);
   }
 
@@ -224,7 +211,8 @@ public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOpe
   /**
    * Retrieves an aggregated list of all operations.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +229,17 @@ public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOpe
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(AggregatedListGlobalOperationsHttpRequest request) {
-    return aggregatedListGlobalOperationsPagedCallable()
-        .call(request);
+  public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOperations(
+      AggregatedListGlobalOperationsHttpRequest request) {
+    return aggregatedListGlobalOperationsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of all operations.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +255,9 @@ public final AggregatedListGlobalOperationsPagedResponse aggregatedListGlobalOpe
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListGlobalOperationsPagedCallable() { + public final UnaryCallable< + AggregatedListGlobalOperationsHttpRequest, AggregatedListGlobalOperationsPagedResponse> + aggregatedListGlobalOperationsPagedCallable() { return stub.aggregatedListGlobalOperationsPagedCallable(); } @@ -274,7 +265,8 @@ public final UnaryCallableSample code: + * *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,7 +289,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListGlobalOperationsCallable() { + public final UnaryCallable + aggregatedListGlobalOperationsCallable() { return stub.aggregatedListGlobalOperationsCallable(); } @@ -305,10 +298,11 @@ public final UnaryCallableSample code: + * *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   globalOperationClient.deleteGlobalOperation(operation);
    * }
    * 
@@ -317,12 +311,12 @@ public final UnaryCallableSample code: + * *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   globalOperationClient.deleteGlobalOperation(operation.toString());
    * }
    * 
@@ -345,9 +340,7 @@ public final void deleteGlobalOperation(ProjectOperationName operation) { public final void deleteGlobalOperation(String operation) { DeleteGlobalOperationHttpRequest request = - DeleteGlobalOperationHttpRequest.newBuilder() - .setOperation(operation) - .build(); + DeleteGlobalOperationHttpRequest.newBuilder().setOperation(operation).build(); deleteGlobalOperation(request); } @@ -355,10 +348,11 @@ public final void deleteGlobalOperation(String operation) { /** * Deletes the specified Operations resource. * - * Sample code: + *

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   DeleteGlobalOperationHttpRequest request = DeleteGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -378,10 +372,11 @@ public final void deleteGlobalOperation(DeleteGlobalOperationHttpRequest request
   /**
    * Deletes the specified Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   DeleteGlobalOperationHttpRequest request = DeleteGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -392,18 +387,21 @@ public final void deleteGlobalOperation(DeleteGlobalOperationHttpRequest request
    * 
*/ @BetaApi - public final UnaryCallable deleteGlobalOperationCallable() { + public final UnaryCallable + deleteGlobalOperationCallable() { return stub.deleteGlobalOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * Retrieves the specified Operations resource. Get a list of operations by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   Operation response = globalOperationClient.getGlobalOperation(operation);
    * }
    * 
@@ -412,23 +410,25 @@ public final UnaryCallable deleteGlobalO * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation getGlobalOperation(ProjectOperationName operation) { + public final Operation getGlobalOperation(ProjectGlobalOperationName operation) { GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder() - .setOperation(operation == null ? null : operation.toString()) - .build(); + .setOperation(operation == null ? null : operation.toString()) + .build(); return getGlobalOperation(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * Retrieves the specified Operations resource. Get a list of operations by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   Operation response = globalOperationClient.getGlobalOperation(operation.toString());
    * }
    * 
@@ -440,20 +440,20 @@ public final Operation getGlobalOperation(ProjectOperationName operation) { public final Operation getGlobalOperation(String operation) { GetGlobalOperationHttpRequest request = - GetGlobalOperationHttpRequest.newBuilder() - .setOperation(operation) - .build(); + GetGlobalOperationHttpRequest.newBuilder().setOperation(operation).build(); return getGlobalOperation(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() request. + * Retrieves the specified Operations resource. Get a list of operations by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -471,12 +471,14 @@ public final Operation getGlobalOperation(GetGlobalOperationHttpRequest request)
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the specified Operations resource. Get a list of operations by making a list() request.
+   * Retrieves the specified Operations resource. Get a list of operations by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
-   *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+   *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
    *   GetGlobalOperationHttpRequest request = GetGlobalOperationHttpRequest.newBuilder()
    *     .setOperation(operation.toString())
    *     .build();
@@ -487,7 +489,8 @@ public final Operation getGlobalOperation(GetGlobalOperationHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable getGlobalOperationCallable() { + public final UnaryCallable + getGlobalOperationCallable() { return stub.getGlobalOperationCallable(); } @@ -495,7 +498,8 @@ public final UnaryCallable getGlobalOp /** * Retrieves a list of Operation resources contained within the specified project. * - * Sample code: + *

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -512,8 +516,8 @@ public final UnaryCallable getGlobalOp
   public final ListGlobalOperationsPagedResponse listGlobalOperations(ProjectName project) {
     ListGlobalOperationsHttpRequest request =
         ListGlobalOperationsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listGlobalOperations(request);
   }
 
@@ -521,7 +525,8 @@ public final ListGlobalOperationsPagedResponse listGlobalOperations(ProjectName
   /**
    * Retrieves a list of Operation resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -537,9 +542,7 @@ public final ListGlobalOperationsPagedResponse listGlobalOperations(ProjectName
   @BetaApi
   public final ListGlobalOperationsPagedResponse listGlobalOperations(String project) {
     ListGlobalOperationsHttpRequest request =
-        ListGlobalOperationsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListGlobalOperationsHttpRequest.newBuilder().setProject(project).build();
     return listGlobalOperations(request);
   }
 
@@ -547,7 +550,8 @@ public final ListGlobalOperationsPagedResponse listGlobalOperations(String proje
   /**
    * Retrieves a list of Operation resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -564,16 +568,17 @@ public final ListGlobalOperationsPagedResponse listGlobalOperations(String proje
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListGlobalOperationsPagedResponse listGlobalOperations(ListGlobalOperationsHttpRequest request) {
-    return listGlobalOperationsPagedCallable()
-        .call(request);
+  public final ListGlobalOperationsPagedResponse listGlobalOperations(
+      ListGlobalOperationsHttpRequest request) {
+    return listGlobalOperationsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of Operation resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -589,7 +594,8 @@ public final ListGlobalOperationsPagedResponse listGlobalOperations(ListGlobalOp
    * 
*/ @BetaApi - public final UnaryCallable listGlobalOperationsPagedCallable() { + public final UnaryCallable + listGlobalOperationsPagedCallable() { return stub.listGlobalOperationsPagedCallable(); } @@ -597,7 +603,8 @@ public final UnaryCallableSample code: + * *

    * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -620,12 +627,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listGlobalOperationsCallable() { + public final UnaryCallable + listGlobalOperationsCallable() { return stub.listGlobalOperationsCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -654,23 +662,27 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListGlobalOperationsPagedResponse extends AbstractPagedListResponse< - AggregatedListGlobalOperationsHttpRequest, - OperationAggregatedList, - OperationsScopedList, - AggregatedListGlobalOperationsPage, - AggregatedListGlobalOperationsFixedSizeCollection> { + public static class AggregatedListGlobalOperationsPagedResponse + extends AbstractPagedListResponse< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, OperationsScopedList, + AggregatedListGlobalOperationsPage, AggregatedListGlobalOperationsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, + OperationsScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListGlobalOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListGlobalOperationsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListGlobalOperationsPage, AggregatedListGlobalOperationsPagedResponse>() { @Override - public AggregatedListGlobalOperationsPagedResponse apply(AggregatedListGlobalOperationsPage input) { + public AggregatedListGlobalOperationsPagedResponse apply( + AggregatedListGlobalOperationsPage input) { return new AggregatedListGlobalOperationsPagedResponse(input); } }); @@ -679,18 +691,18 @@ public AggregatedListGlobalOperationsPagedResponse apply(AggregatedListGlobalOpe private AggregatedListGlobalOperationsPagedResponse(AggregatedListGlobalOperationsPage page) { super(page, AggregatedListGlobalOperationsFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListGlobalOperationsPage extends AbstractPage< - AggregatedListGlobalOperationsHttpRequest, - OperationAggregatedList, - OperationsScopedList, - AggregatedListGlobalOperationsPage> { + public static class AggregatedListGlobalOperationsPage + extends AbstractPage< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, OperationsScopedList, + AggregatedListGlobalOperationsPage> { private AggregatedListGlobalOperationsPage( - PageContext context, + PageContext< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, + OperationsScopedList> + context, OperationAggregatedList response) { super(context, response); } @@ -701,31 +713,32 @@ private static AggregatedListGlobalOperationsPage createEmptyPage() { @Override protected AggregatedListGlobalOperationsPage createPage( - PageContext context, + PageContext< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, + OperationsScopedList> + context, OperationAggregatedList response) { return new AggregatedListGlobalOperationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, + OperationsScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListGlobalOperationsFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListGlobalOperationsHttpRequest, - OperationAggregatedList, - OperationsScopedList, - AggregatedListGlobalOperationsPage, - AggregatedListGlobalOperationsFixedSizeCollection> { + public static class AggregatedListGlobalOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, OperationsScopedList, + AggregatedListGlobalOperationsPage, AggregatedListGlobalOperationsFixedSizeCollection> { - private AggregatedListGlobalOperationsFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListGlobalOperationsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -738,15 +751,12 @@ protected AggregatedListGlobalOperationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListGlobalOperationsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListGlobalOperationsPagedResponse extends AbstractPagedListResponse< - ListGlobalOperationsHttpRequest, - OperationList, - Operation, - ListGlobalOperationsPage, - ListGlobalOperationsFixedSizeCollection> { + + public static class ListGlobalOperationsPagedResponse + extends AbstractPagedListResponse< + ListGlobalOperationsHttpRequest, OperationList, Operation, ListGlobalOperationsPage, + ListGlobalOperationsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -766,15 +776,11 @@ public ListGlobalOperationsPagedResponse apply(ListGlobalOperationsPage input) { private ListGlobalOperationsPagedResponse(ListGlobalOperationsPage page) { super(page, ListGlobalOperationsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListGlobalOperationsPage extends AbstractPage< - ListGlobalOperationsHttpRequest, - OperationList, - Operation, - ListGlobalOperationsPage> { + public static class ListGlobalOperationsPage + extends AbstractPage< + ListGlobalOperationsHttpRequest, OperationList, Operation, ListGlobalOperationsPage> { private ListGlobalOperationsPage( PageContext context, @@ -799,20 +805,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListGlobalOperationsFixedSizeCollection extends AbstractFixedSizeCollection< - ListGlobalOperationsHttpRequest, - OperationList, - Operation, - ListGlobalOperationsPage, - ListGlobalOperationsFixedSizeCollection> { + public static class ListGlobalOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListGlobalOperationsHttpRequest, OperationList, Operation, ListGlobalOperationsPage, + ListGlobalOperationsFixedSizeCollection> { - private ListGlobalOperationsFixedSizeCollection(List pages, int collectionSize) { + private ListGlobalOperationsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -825,7 +826,5 @@ protected ListGlobalOperationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListGlobalOperationsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java index 892f282427aa..428017102ace 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; -import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; import com.google.cloud.compute.v1.stub.GlobalOperationStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteGlobalOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteGlobalOperation to 30 seconds: * *

  * 
@@ -86,77 +64,64 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class GlobalOperationSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListGlobalOperations.
-   */
-  public PagedCallSettings aggregatedListGlobalOperationsSettings() {
-    return ((GlobalOperationStubSettings) getStubSettings()).aggregatedListGlobalOperationsSettings();
+  /** Returns the object with the settings used for calls to aggregatedListGlobalOperations. */
+  public PagedCallSettings<
+          AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+          AggregatedListGlobalOperationsPagedResponse>
+      aggregatedListGlobalOperationsSettings() {
+    return ((GlobalOperationStubSettings) getStubSettings())
+        .aggregatedListGlobalOperationsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteGlobalOperation.
-   */
+  /** Returns the object with the settings used for calls to deleteGlobalOperation. */
   public UnaryCallSettings deleteGlobalOperationSettings() {
     return ((GlobalOperationStubSettings) getStubSettings()).deleteGlobalOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getGlobalOperation.
-   */
+  /** Returns the object with the settings used for calls to getGlobalOperation. */
   public UnaryCallSettings getGlobalOperationSettings() {
     return ((GlobalOperationStubSettings) getStubSettings()).getGlobalOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listGlobalOperations.
-   */
-  public PagedCallSettings listGlobalOperationsSettings() {
+  /** Returns the object with the settings used for calls to listGlobalOperations. */
+  public PagedCallSettings<
+          ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse>
+      listGlobalOperationsSettings() {
     return ((GlobalOperationStubSettings) getStubSettings()).listGlobalOperationsSettings();
   }
 
-
-  public static final GlobalOperationSettings create(GlobalOperationStubSettings stub) throws IOException {
+  public static final GlobalOperationSettings create(GlobalOperationStubSettings stub)
+      throws IOException {
     return new GlobalOperationSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return GlobalOperationStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return GlobalOperationStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return GlobalOperationStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return GlobalOperationStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return GlobalOperationStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return GlobalOperationStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return GlobalOperationStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -169,23 +134,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return GlobalOperationStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -194,9 +153,7 @@ protected GlobalOperationSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for GlobalOperationSettings.
-   */
+  /** Builder for GlobalOperationSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -218,46 +175,47 @@ protected Builder(GlobalOperationStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public GlobalOperationStubSettings.Builder getStubSettingsBuilder() {
       return ((GlobalOperationStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListGlobalOperations. - */ - public PagedCallSettings.Builder aggregatedListGlobalOperationsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListGlobalOperations. */ + public PagedCallSettings.Builder< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, + AggregatedListGlobalOperationsPagedResponse> + aggregatedListGlobalOperationsSettings() { return getStubSettingsBuilder().aggregatedListGlobalOperationsSettings(); } - /** - * Returns the builder for the settings used for calls to deleteGlobalOperation. - */ - public UnaryCallSettings.Builder deleteGlobalOperationSettings() { + /** Returns the builder for the settings used for calls to deleteGlobalOperation. */ + public UnaryCallSettings.Builder + deleteGlobalOperationSettings() { return getStubSettingsBuilder().deleteGlobalOperationSettings(); } - /** - * Returns the builder for the settings used for calls to getGlobalOperation. - */ - public UnaryCallSettings.Builder getGlobalOperationSettings() { + /** Returns the builder for the settings used for calls to getGlobalOperation. */ + public UnaryCallSettings.Builder + getGlobalOperationSettings() { return getStubSettingsBuilder().getGlobalOperationSettings(); } - /** - * Returns the builder for the settings used for calls to listGlobalOperations. - */ - public PagedCallSettings.Builder listGlobalOperationsSettings() { + /** Returns the builder for the settings used for calls to listGlobalOperations. */ + public PagedCallSettings.Builder< + ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse> + listGlobalOperationsSettings() { return getStubSettingsBuilder().listGlobalOperationsSettings(); } @@ -266,4 +224,4 @@ public GlobalOperationSettings build() throws IOException { return new GlobalOperationSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java index 0d4f9d7dc3fd..dc6bf9e24a7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private GlobalSetLabelsRequest() { this.labels = null; } - - private GlobalSetLabelsRequest( - String labelFingerprint, - Map labels - ) { + private GlobalSetLabelsRequest(String labelFingerprint, Map labels) { this.labelFingerprint = labelFingerprint; this.labels = labels; } @@ -86,22 +79,24 @@ public Map getLabelsMap() { return labels; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GlobalSetLabelsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GlobalSetLabelsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GlobalSetLabelsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GlobalSetLabelsRequest(); } @@ -146,13 +141,9 @@ public Builder putAllLabels(Map labels) { return this; } - public GlobalSetLabelsRequest build() { - return new GlobalSetLabelsRequest( - labelFingerprint, - labels - ); + return new GlobalSetLabelsRequest(labelFingerprint, labels); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "GlobalSetLabelsRequest{" - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof GlobalSetLabelsRequest) { GlobalSetLabelsRequest that = (GlobalSetLabelsRequest) o; - return - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) - ; + return Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - labelFingerprint, - labels - ); + return Objects.hash(labelFingerprint, labels); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java index 404e42a99166..081a717689cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private GuestOsFeature() { this.type = null; } - - private GuestOsFeature( - String type - ) { + private GuestOsFeature(String type) { this.type = type; } @@ -72,22 +66,24 @@ public String getType() { return type; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(GuestOsFeature prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static GuestOsFeature getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final GuestOsFeature DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new GuestOsFeature(); } @@ -118,11 +114,8 @@ public Builder setType(String type) { return this; } - public GuestOsFeature build() { - return new GuestOsFeature( - type - ); + return new GuestOsFeature(type); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "GuestOsFeature{" - + "type=" + type - + "}"; + return "GuestOsFeature{" + "type=" + type + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof GuestOsFeature) { GuestOsFeature that = (GuestOsFeature) o; - return - Objects.equals(this.type, that.getType()) - ; + return Objects.equals(this.type, that.getType()); } return false; } @Override public int hashCode() { - return Objects.hash( - type - ); + return Objects.hash(type); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java index c5349c870abc..6d08ac66fdcd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private HTTPHealthCheck() { this.requestPath = null; } - private HTTPHealthCheck( - String host, - Integer port, - String portName, - String proxyHeader, - String requestPath - ) { + String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; this.port = port; this.portName = portName; @@ -128,22 +119,24 @@ public String getRequestPath() { return requestPath; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HTTPHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HTTPHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HTTPHealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HTTPHealthCheck(); } @@ -230,19 +223,9 @@ public Builder setRequestPath(String requestPath) { return this; } - public HTTPHealthCheck build() { - - - - return new HTTPHealthCheck( - host, - port, - portName, - proxyHeader, - requestPath - ); + return new HTTPHealthCheck(host, port, portName, proxyHeader, requestPath); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "HTTPHealthCheck{" - + "host=" + host + ", " - + "port=" + port + ", " - + "portName=" + portName + ", " - + "proxyHeader=" + proxyHeader + ", " - + "requestPath=" + requestPath + + "host=" + + host + + ", " + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "requestPath=" + + requestPath + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof HTTPHealthCheck) { HTTPHealthCheck that = (HTTPHealthCheck) o; - return - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.portName, that.getPortName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.requestPath, that.getRequestPath()) - ; + return Objects.equals(this.host, that.getHost()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.requestPath, that.getRequestPath()); } return false; } @Override public int hashCode() { - return Objects.hash( - host, - port, - portName, - proxyHeader, - requestPath - ); + return Objects.hash(host, port, portName, proxyHeader, requestPath); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java index a65287471367..f680875f6a13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private HTTPSHealthCheck() { this.requestPath = null; } - private HTTPSHealthCheck( - String host, - Integer port, - String portName, - String proxyHeader, - String requestPath - ) { + String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; this.port = port; this.portName = portName; @@ -128,22 +119,24 @@ public String getRequestPath() { return requestPath; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HTTPSHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HTTPSHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HTTPSHealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HTTPSHealthCheck(); } @@ -230,19 +223,9 @@ public Builder setRequestPath(String requestPath) { return this; } - public HTTPSHealthCheck build() { - - - - return new HTTPSHealthCheck( - host, - port, - portName, - proxyHeader, - requestPath - ); + return new HTTPSHealthCheck(host, port, portName, proxyHeader, requestPath); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "HTTPSHealthCheck{" - + "host=" + host + ", " - + "port=" + port + ", " - + "portName=" + portName + ", " - + "proxyHeader=" + proxyHeader + ", " - + "requestPath=" + requestPath + + "host=" + + host + + ", " + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "requestPath=" + + requestPath + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof HTTPSHealthCheck) { HTTPSHealthCheck that = (HTTPSHealthCheck) o; - return - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.portName, that.getPortName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.requestPath, that.getRequestPath()) - ; + return Objects.equals(this.host, that.getHost()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.requestPath, that.getRequestPath()); } return false; } @Override public int hashCode() { - return Objects.hash( - host, - port, - portName, - proxyHeader, - requestPath - ); + return Objects.hash(host, port, portName, proxyHeader, requestPath); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java index 3a5e581ef1a9..d7078351de88 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -66,7 +63,6 @@ private HealthCheck() { this.unhealthyThreshold = null; } - private HealthCheck( Integer checkIntervalSec, String creationTimestamp, @@ -82,8 +78,7 @@ private HealthCheck( TCPHealthCheck tcpHealthCheck, Integer timeoutSec, String type, - Integer unhealthyThreshold - ) { + Integer unhealthyThreshold) { this.checkIntervalSec = checkIntervalSec; this.creationTimestamp = creationTimestamp; this.description = description; @@ -108,7 +103,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -147,7 +143,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("type", Collections.singletonList(String.valueOf(type))); } if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put("unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); } return fieldMap; } @@ -268,22 +265,24 @@ public Integer getUnhealthyThreshold() { return unhealthyThreshold; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HealthCheck(); } @@ -510,39 +509,24 @@ public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { return this; } - public HealthCheck build() { - - - - - - - - - - - - - return new HealthCheck( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - httpHealthCheck, - httpsHealthCheck, - id, - kind, - name, - selfLink, - sslHealthCheck, - tcpHealthCheck, - timeoutSec, - type, - unhealthyThreshold - ); + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + httpHealthCheck, + httpsHealthCheck, + id, + kind, + name, + selfLink, + sslHealthCheck, + tcpHealthCheck, + timeoutSec, + type, + unhealthyThreshold); } public Builder clone() { @@ -569,21 +553,50 @@ public Builder clone() { @Override public String toString() { return "HealthCheck{" - + "checkIntervalSec=" + checkIntervalSec + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "healthyThreshold=" + healthyThreshold + ", " - + "httpHealthCheck=" + httpHealthCheck + ", " - + "httpsHealthCheck=" + httpsHealthCheck + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + ", " - + "sslHealthCheck=" + sslHealthCheck + ", " - + "tcpHealthCheck=" + tcpHealthCheck + ", " - + "timeoutSec=" + timeoutSec + ", " - + "type=" + type + ", " - + "unhealthyThreshold=" + unhealthyThreshold + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + + "httpHealthCheck=" + + httpHealthCheck + + ", " + + "httpsHealthCheck=" + + httpsHealthCheck + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "sslHealthCheck=" + + sslHealthCheck + + ", " + + "tcpHealthCheck=" + + tcpHealthCheck + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "type=" + + type + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + "}"; } @@ -594,23 +607,21 @@ public boolean equals(Object o) { } if (o instanceof HealthCheck) { HealthCheck that = (HealthCheck) o; - return - Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) && - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sslHealthCheck, that.getSslHealthCheck()) && - Objects.equals(this.tcpHealthCheck, that.getTcpHealthCheck()) && - Objects.equals(this.timeoutSec, that.getTimeoutSec()) && - Objects.equals(this.type, that.getType()) && - Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()) - ; + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sslHealthCheck, that.getSslHealthCheck()) + && Objects.equals(this.tcpHealthCheck, that.getTcpHealthCheck()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.type, that.getType()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); } return false; } @@ -618,21 +629,20 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - httpHealthCheck, - httpsHealthCheck, - id, - kind, - name, - selfLink, - sslHealthCheck, - tcpHealthCheck, - timeoutSec, - type, - unhealthyThreshold - ); + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + httpHealthCheck, + httpsHealthCheck, + id, + kind, + name, + selfLink, + sslHealthCheck, + tcpHealthCheck, + timeoutSec, + type, + unhealthyThreshold); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java index 18d51af9f56f..e3e81526af85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.HealthCheckStub; import com.google.cloud.compute.v1.stub.HealthCheckStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,39 @@ * * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) { * String requestId = ""; - * ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + * ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); * Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck); * } * *

* - *

Note: close() needs to be called on the healthCheckClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the healthCheckClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of HealthCheckSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class HealthCheckClient implements BackgroundResource {
   private final HealthCheckSettings settings;
   private final HealthCheckStub stub;
 
-
-
-  /**
-   * Constructs an instance of HealthCheckClient with default settings.
-   */
+  /** Constructs an instance of HealthCheckClient with default settings. */
   public static final HealthCheckClient create() throws IOException {
     return create(HealthCheckSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of HealthCheckClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of HealthCheckClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final HealthCheckClient create(HealthCheckSettings settings) throws IOException {
     return new HealthCheckClient(settings);
@@ -144,9 +128,9 @@ public static final HealthCheckClient create(HealthCheckStub stub) {
   }
 
   /**
-   * Constructs an instance of HealthCheckClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of HealthCheckClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected HealthCheckClient(HealthCheckSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +152,41 @@ public HealthCheckStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified HealthCheck resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHealthCheck(String requestId, ProjectHealthCheckName healthCheck) { + public final Operation deleteHealthCheck( + String requestId, ProjectGlobalHealthCheckName healthCheck) { DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) - .build(); + .setRequestId(requestId) + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .build(); return deleteHealthCheck(request); } @@ -205,20 +194,25 @@ public final Operation deleteHealthCheck(String requestId, ProjectHealthCheckNam /** * Deletes the specified HealthCheck resource. * - * Sample code: + *

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +221,9 @@ public final Operation deleteHealthCheck(String requestId, String healthCheck) { DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck) - .build(); + .setRequestId(requestId) + .setHealthCheck(healthCheck) + .build(); return deleteHealthCheck(request); } @@ -237,11 +231,12 @@ public final Operation deleteHealthCheck(String requestId, String healthCheck) { /** * Deletes the specified HealthCheck resource. * - * Sample code: + *

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
@@ -262,11 +257,12 @@ public final Operation deleteHealthCheck(DeleteHealthCheckHttpRequest request) {
   /**
    * Deletes the specified HealthCheck resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
@@ -284,12 +280,14 @@ public final UnaryCallable deleteHealth
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request.
+   * Returns the specified HealthCheck resource. Get a list of available health checks by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck response = healthCheckClient.getHealthCheck(healthCheck);
    * }
    * 
@@ -298,23 +296,25 @@ public final UnaryCallable deleteHealth * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HealthCheck getHealthCheck(ProjectHealthCheckName healthCheck) { + public final HealthCheck getHealthCheck(ProjectGlobalHealthCheckName healthCheck) { GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder() - .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) - .build(); + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .build(); return getHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. + * Returns the specified HealthCheck resource. Get a list of available health checks by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck response = healthCheckClient.getHealthCheck(healthCheck.toString());
    * }
    * 
@@ -326,20 +326,20 @@ public final HealthCheck getHealthCheck(ProjectHealthCheckName healthCheck) { public final HealthCheck getHealthCheck(String healthCheck) { GetHealthCheckHttpRequest request = - GetHealthCheckHttpRequest.newBuilder() - .setHealthCheck(healthCheck) - .build(); + GetHealthCheckHttpRequest.newBuilder().setHealthCheck(healthCheck).build(); return getHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. + * Returns the specified HealthCheck resource. Get a list of available health checks by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder()
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
@@ -357,12 +357,14 @@ public final HealthCheck getHealthCheck(GetHealthCheckHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request.
+   * Returns the specified HealthCheck resource. Get a list of available health checks by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest.newBuilder()
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
@@ -381,7 +383,8 @@ public final UnaryCallable getHealthChec
   /**
    * Creates a HealthCheck resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
@@ -391,24 +394,31 @@ public final UnaryCallable getHealthChec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the supported + * protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHealthCheck(String requestId, ProjectName project, HealthCheck healthCheckResource) { + public final Operation insertHealthCheck( + String requestId, ProjectName project, HealthCheck healthCheckResource) { InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setHealthCheckResource(healthCheckResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setHealthCheckResource(healthCheckResource) + .build(); return insertHealthCheck(request); } @@ -416,7 +426,8 @@ public final Operation insertHealthCheck(String requestId, ProjectName project, /** * Creates a HealthCheck resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
@@ -426,24 +437,31 @@ public final Operation insertHealthCheck(String requestId, ProjectName project,
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the supported + * protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHealthCheck(String requestId, String project, HealthCheck healthCheckResource) { + public final Operation insertHealthCheck( + String requestId, String project, HealthCheck healthCheckResource) { InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setHealthCheckResource(healthCheckResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setHealthCheckResource(healthCheckResource) + .build(); return insertHealthCheck(request); } @@ -451,7 +469,8 @@ public final Operation insertHealthCheck(String requestId, String project, Healt /** * Creates a HealthCheck resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
@@ -478,7 +497,8 @@ public final Operation insertHealthCheck(InsertHealthCheckHttpRequest request) {
   /**
    * Creates a HealthCheck resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
@@ -504,7 +524,8 @@ public final UnaryCallable insertHealth
   /**
    * Retrieves the list of HealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +542,8 @@ public final UnaryCallable insertHealth
   public final ListHealthChecksPagedResponse listHealthChecks(ProjectName project) {
     ListHealthChecksHttpRequest request =
         ListHealthChecksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listHealthChecks(request);
   }
 
@@ -530,7 +551,8 @@ public final ListHealthChecksPagedResponse listHealthChecks(ProjectName project)
   /**
    * Retrieves the list of HealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +568,7 @@ public final ListHealthChecksPagedResponse listHealthChecks(ProjectName project)
   @BetaApi
   public final ListHealthChecksPagedResponse listHealthChecks(String project) {
     ListHealthChecksHttpRequest request =
-        ListHealthChecksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListHealthChecksHttpRequest.newBuilder().setProject(project).build();
     return listHealthChecks(request);
   }
 
@@ -556,7 +576,8 @@ public final ListHealthChecksPagedResponse listHealthChecks(String project) {
   /**
    * Retrieves the list of HealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -574,15 +595,15 @@ public final ListHealthChecksPagedResponse listHealthChecks(String project) {
    */
   @BetaApi
   public final ListHealthChecksPagedResponse listHealthChecks(ListHealthChecksHttpRequest request) {
-    return listHealthChecksPagedCallable()
-        .call(request);
+    return listHealthChecksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of HealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +619,8 @@ public final ListHealthChecksPagedResponse listHealthChecks(ListHealthChecksHttp
    * 
*/ @BetaApi - public final UnaryCallable listHealthChecksPagedCallable() { + public final UnaryCallable + listHealthChecksPagedCallable() { return stub.listHealthChecksPagedCallable(); } @@ -606,7 +628,8 @@ public final UnaryCallableSample code: + * *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,89 +652,110 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listHealthChecksCallable() { + public final UnaryCallable + listHealthChecksCallable() { return stub.listHealthChecksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck, healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to patch. - * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the supported + * protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHealthCheck(String requestId, ProjectHealthCheckName healthCheck, HealthCheck healthCheckResource) { + public final Operation patchHealthCheck( + String requestId, ProjectGlobalHealthCheckName healthCheck, HealthCheck healthCheckResource) { PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) - .setHealthCheckResource(healthCheckResource) - .build(); + .setRequestId(requestId) + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .setHealthCheckResource(healthCheckResource) + .build(); return patchHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to patch. - * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the supported + * protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHealthCheck(String requestId, String healthCheck, HealthCheck healthCheckResource) { + public final Operation patchHealthCheck( + String requestId, String healthCheck, HealthCheck healthCheckResource) { PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck) - .setHealthCheckResource(healthCheckResource) - .build(); + .setRequestId(requestId) + .setHealthCheck(healthCheck) + .setHealthCheckResource(healthCheckResource) + .build(); return patchHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -732,13 +776,15 @@ public final Operation patchHealthCheck(PatchHealthCheckHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -760,34 +806,42 @@ public final UnaryCallable patchHealthCh
   /**
    * Updates a HealthCheck resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck, healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to update. - * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the supported + * protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHealthCheck(String requestId, ProjectHealthCheckName healthCheck, HealthCheck healthCheckResource) { + public final Operation updateHealthCheck( + String requestId, ProjectGlobalHealthCheckName healthCheck, HealthCheck healthCheckResource) { UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) - .setHealthCheckResource(healthCheckResource) - .build(); + .setRequestId(requestId) + .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) + .setHealthCheckResource(healthCheckResource) + .build(); return updateHealthCheck(request); } @@ -795,34 +849,42 @@ public final Operation updateHealthCheck(String requestId, ProjectHealthCheckNam /** * Updates a HealthCheck resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to update. - * @param healthCheckResource An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. + * @param healthCheckResource An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the supported + * protocols. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHealthCheck(String requestId, String healthCheck, HealthCheck healthCheckResource) { + public final Operation updateHealthCheck( + String requestId, String healthCheck, HealthCheck healthCheckResource) { UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck) - .setHealthCheckResource(healthCheckResource) - .build(); + .setRequestId(requestId) + .setHealthCheck(healthCheck) + .setHealthCheckResource(healthCheckResource) + .build(); return updateHealthCheck(request); } @@ -830,11 +892,12 @@ public final Operation updateHealthCheck(String requestId, String healthCheck, H /** * Updates a HealthCheck resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -857,11 +920,12 @@ public final Operation updateHealthCheck(UpdateHealthCheckHttpRequest request) {
   /**
    * Updates a HealthCheck resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+   *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -880,7 +944,7 @@ public final UnaryCallable updateHealth
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -909,12 +973,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListHealthChecksPagedResponse extends AbstractPagedListResponse<
-      ListHealthChecksHttpRequest,
-      HealthCheckList,
-      HealthCheck,
-      ListHealthChecksPage,
-      ListHealthChecksFixedSizeCollection> {
+  public static class ListHealthChecksPagedResponse
+      extends AbstractPagedListResponse<
+          ListHealthChecksHttpRequest, HealthCheckList, HealthCheck, ListHealthChecksPage,
+          ListHealthChecksFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -934,15 +996,11 @@ public ListHealthChecksPagedResponse apply(ListHealthChecksPage input) {
     private ListHealthChecksPagedResponse(ListHealthChecksPage page) {
       super(page, ListHealthChecksFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListHealthChecksPage extends AbstractPage<
-      ListHealthChecksHttpRequest,
-      HealthCheckList,
-      HealthCheck,
-      ListHealthChecksPage> {
+  public static class ListHealthChecksPage
+      extends AbstractPage<
+          ListHealthChecksHttpRequest, HealthCheckList, HealthCheck, ListHealthChecksPage> {
 
     private ListHealthChecksPage(
         PageContext context,
@@ -967,20 +1025,15 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListHealthChecksHttpRequest,
-      HealthCheckList,
-      HealthCheck,
-      ListHealthChecksPage,
-      ListHealthChecksFixedSizeCollection> {
+  public static class ListHealthChecksFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListHealthChecksHttpRequest, HealthCheckList, HealthCheck, ListHealthChecksPage,
+          ListHealthChecksFixedSizeCollection> {
 
-    private ListHealthChecksFixedSizeCollection(List pages, int collectionSize) {
+    private ListHealthChecksFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -993,7 +1046,5 @@ protected ListHealthChecksFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListHealthChecksFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
index 9c419e92ec86..c65a4b4bde8a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private HealthCheckList() {
     this.warning = null;
   }
 
-
   private HealthCheckList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(HealthCheckList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static HealthCheckList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final HealthCheckList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new HealthCheckList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public HealthCheckList build() {
 
-
-
-
-
-      return new HealthCheckList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new HealthCheckList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "HealthCheckList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof HealthCheckList) {
       HealthCheckList that = (HealthCheckList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java
index 5670951074ac..fb7cd5b85d53 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -38,10 +35,7 @@ private HealthCheckReference() {
     this.healthCheck = null;
   }
 
-
-  private HealthCheckReference(
-      String healthCheck
-      ) {
+  private HealthCheckReference(String healthCheck) {
     this.healthCheck = healthCheck;
   }
 
@@ -72,22 +66,24 @@ public String getHealthCheck() {
     return healthCheck;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(HealthCheckReference prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static HealthCheckReference getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final HealthCheckReference DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new HealthCheckReference();
   }
@@ -118,11 +114,8 @@ public Builder setHealthCheck(String healthCheck) {
       return this;
     }
 
-
     public HealthCheckReference build() {
-      return new HealthCheckReference(
-        healthCheck
-      );
+      return new HealthCheckReference(healthCheck);
     }
 
     public Builder clone() {
@@ -134,9 +127,7 @@ public Builder clone() {
 
   @Override
   public String toString() {
-    return "HealthCheckReference{"
-        + "healthCheck=" + healthCheck
-        + "}";
+    return "HealthCheckReference{" + "healthCheck=" + healthCheck + "}";
   }
 
   @Override
@@ -146,17 +137,13 @@ public boolean equals(Object o) {
     }
     if (o instanceof HealthCheckReference) {
       HealthCheckReference that = (HealthCheckReference) o;
-      return
-          Objects.equals(this.healthCheck, that.getHealthCheck())
-          ;
+      return Objects.equals(this.healthCheck, that.getHealthCheck());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      healthCheck
-    );
+    return Objects.hash(healthCheck);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java
index dbeba0bb15e7..0f824fe1e44c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java
@@ -15,45 +15,23 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse;
 import com.google.cloud.compute.v1.stub.HealthCheckStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -62,15 +40,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteHealthCheck to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteHealthCheck to 30 seconds: * *

  * 
@@ -85,91 +63,69 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class HealthCheckSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to deleteHealthCheck. */
   public UnaryCallSettings deleteHealthCheckSettings() {
     return ((HealthCheckStubSettings) getStubSettings()).deleteHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to getHealthCheck. */
   public UnaryCallSettings getHealthCheckSettings() {
     return ((HealthCheckStubSettings) getStubSettings()).getHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to insertHealthCheck. */
   public UnaryCallSettings insertHealthCheckSettings() {
     return ((HealthCheckStubSettings) getStubSettings()).insertHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listHealthChecks.
-   */
-  public PagedCallSettings listHealthChecksSettings() {
+  /** Returns the object with the settings used for calls to listHealthChecks. */
+  public PagedCallSettings<
+          ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse>
+      listHealthChecksSettings() {
     return ((HealthCheckStubSettings) getStubSettings()).listHealthChecksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to patchHealthCheck. */
   public UnaryCallSettings patchHealthCheckSettings() {
     return ((HealthCheckStubSettings) getStubSettings()).patchHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to updateHealthCheck. */
   public UnaryCallSettings updateHealthCheckSettings() {
     return ((HealthCheckStubSettings) getStubSettings()).updateHealthCheckSettings();
   }
 
-
   public static final HealthCheckSettings create(HealthCheckStubSettings stub) throws IOException {
     return new HealthCheckSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return HealthCheckStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return HealthCheckStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return HealthCheckStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return HealthCheckStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return HealthCheckStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return HealthCheckStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return HealthCheckStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +138,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return HealthCheckStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +157,7 @@ protected HealthCheckSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for HealthCheckSettings.
-   */
+  /** Builder for HealthCheckSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +179,57 @@ protected Builder(HealthCheckStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public HealthCheckStubSettings.Builder getStubSettingsBuilder() {
       return ((HealthCheckStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteHealthCheck. - */ - public UnaryCallSettings.Builder deleteHealthCheckSettings() { + /** Returns the builder for the settings used for calls to deleteHealthCheck. */ + public UnaryCallSettings.Builder + deleteHealthCheckSettings() { return getStubSettingsBuilder().deleteHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to getHealthCheck. - */ - public UnaryCallSettings.Builder getHealthCheckSettings() { + /** Returns the builder for the settings used for calls to getHealthCheck. */ + public UnaryCallSettings.Builder + getHealthCheckSettings() { return getStubSettingsBuilder().getHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to insertHealthCheck. - */ - public UnaryCallSettings.Builder insertHealthCheckSettings() { + /** Returns the builder for the settings used for calls to insertHealthCheck. */ + public UnaryCallSettings.Builder + insertHealthCheckSettings() { return getStubSettingsBuilder().insertHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to listHealthChecks. - */ - public PagedCallSettings.Builder listHealthChecksSettings() { + /** Returns the builder for the settings used for calls to listHealthChecks. */ + public PagedCallSettings.Builder< + ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse> + listHealthChecksSettings() { return getStubSettingsBuilder().listHealthChecksSettings(); } - /** - * Returns the builder for the settings used for calls to patchHealthCheck. - */ - public UnaryCallSettings.Builder patchHealthCheckSettings() { + /** Returns the builder for the settings used for calls to patchHealthCheck. */ + public UnaryCallSettings.Builder + patchHealthCheckSettings() { return getStubSettingsBuilder().patchHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to updateHealthCheck. - */ - public UnaryCallSettings.Builder updateHealthCheckSettings() { + /** Returns the builder for the settings used for calls to updateHealthCheck. */ + public UnaryCallSettings.Builder + updateHealthCheckSettings() { return getStubSettingsBuilder().updateHealthCheckSettings(); } @@ -293,4 +238,4 @@ public HealthCheckSettings build() throws IOException { return new HealthCheckSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java index 512427c88a90..b31d9a53e69a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,13 +41,7 @@ private HealthStatus() { this.port = null; } - - private HealthStatus( - String healthState, - String instance, - String ipAddress, - Integer port - ) { + private HealthStatus(String healthState, String instance, String ipAddress, Integer port) { this.healthState = healthState; this.instance = instance; this.ipAddress = ipAddress; @@ -114,22 +105,24 @@ public Integer getPort() { return port; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HealthStatus prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HealthStatus getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HealthStatus DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HealthStatus(); } @@ -202,17 +195,9 @@ public Builder setPort(Integer port) { return this; } - public HealthStatus build() { - - - return new HealthStatus( - healthState, - instance, - ipAddress, - port - ); + return new HealthStatus(healthState, instance, ipAddress, port); } public Builder clone() { @@ -228,10 +213,17 @@ public Builder clone() { @Override public String toString() { return "HealthStatus{" - + "healthState=" + healthState + ", " - + "instance=" + instance + ", " - + "ipAddress=" + ipAddress + ", " - + "port=" + port + + "healthState=" + + healthState + + ", " + + "instance=" + + instance + + ", " + + "ipAddress=" + + ipAddress + + ", " + + "port=" + + port + "}"; } @@ -242,23 +234,16 @@ public boolean equals(Object o) { } if (o instanceof HealthStatus) { HealthStatus that = (HealthStatus) o; - return - Objects.equals(this.healthState, that.getHealthState()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.ipAddress, that.getIpAddress()) && - Objects.equals(this.port, that.getPort()) - ; + return Objects.equals(this.healthState, that.getHealthState()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.ipAddress, that.getIpAddress()) + && Objects.equals(this.port, that.getPort()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthState, - instance, - ipAddress, - port - ); + return Objects.hash(healthState, instance, ipAddress, port); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java index ef0a4b0dd8f9..7e814efe1324 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,12 +41,7 @@ private HostRule() { this.pathMatcher = null; } - - private HostRule( - String description, - List hosts, - String pathMatcher - ) { + private HostRule(String description, List hosts, String pathMatcher) { this.description = description; this.hosts = hosts; this.pathMatcher = pathMatcher; @@ -104,22 +98,24 @@ public String getPathMatcher() { return pathMatcher; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HostRule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HostRule getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HostRule DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HostRule(); } @@ -186,15 +182,9 @@ public Builder setPathMatcher(String pathMatcher) { return this; } - public HostRule build() { - - return new HostRule( - description, - hosts, - pathMatcher - ); + return new HostRule(description, hosts, pathMatcher); } public Builder clone() { @@ -209,9 +199,14 @@ public Builder clone() { @Override public String toString() { return "HostRule{" - + "description=" + description + ", " - + "hosts=" + hosts + ", " - + "pathMatcher=" + pathMatcher + + "description=" + + description + + ", " + + "hosts=" + + hosts + + ", " + + "pathMatcher=" + + pathMatcher + "}"; } @@ -222,21 +217,15 @@ public boolean equals(Object o) { } if (o instanceof HostRule) { HostRule that = (HostRule) o; - return - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.hosts, that.getHostsList()) && - Objects.equals(this.pathMatcher, that.getPathMatcher()) - ; + return Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.hosts, that.getHostsList()) + && Objects.equals(this.pathMatcher, that.getPathMatcher()); } return false; } @Override public int hashCode() { - return Objects.hash( - description, - hosts, - pathMatcher - ); + return Objects.hash(description, hosts, pathMatcher); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java index 847dcc0dfa0d..7f9c75dd4fa0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -62,7 +59,6 @@ private HttpHealthCheck() { this.unhealthyThreshold = null; } - private HttpHealthCheck( Integer checkIntervalSec, String creationTimestamp, @@ -76,8 +72,7 @@ private HttpHealthCheck( String requestPath, String selfLink, Integer timeoutSec, - Integer unhealthyThreshold - ) { + Integer unhealthyThreshold) { this.checkIntervalSec = checkIntervalSec; this.creationTimestamp = creationTimestamp; this.description = description; @@ -100,7 +95,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -133,7 +129,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); } if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put("unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); } return fieldMap; } @@ -240,22 +237,24 @@ public Integer getUnhealthyThreshold() { return unhealthyThreshold; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HttpHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HttpHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HttpHealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HttpHealthCheck(); } @@ -454,35 +453,22 @@ public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { return this; } - public HttpHealthCheck build() { - - - - - - - - - - - return new HttpHealthCheck( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold - ); + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); } public Builder clone() { @@ -507,19 +493,44 @@ public Builder clone() { @Override public String toString() { return "HttpHealthCheck{" - + "checkIntervalSec=" + checkIntervalSec + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "healthyThreshold=" + healthyThreshold + ", " - + "host=" + host + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "port=" + port + ", " - + "requestPath=" + requestPath + ", " - + "selfLink=" + selfLink + ", " - + "timeoutSec=" + timeoutSec + ", " - + "unhealthyThreshold=" + unhealthyThreshold + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + + "host=" + + host + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "port=" + + port + + ", " + + "requestPath=" + + requestPath + + ", " + + "selfLink=" + + selfLink + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + "}"; } @@ -530,21 +541,19 @@ public boolean equals(Object o) { } if (o instanceof HttpHealthCheck) { HttpHealthCheck that = (HttpHealthCheck) o; - return - Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) && - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.requestPath, that.getRequestPath()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.timeoutSec, that.getTimeoutSec()) && - Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()) - ; + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.requestPath, that.getRequestPath()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); } return false; } @@ -552,19 +561,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold - ); + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java index 2b4134ebd171..b9a350c6b32b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.HttpHealthCheckStub; import com.google.cloud.compute.v1.stub.HttpHealthCheckStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,40 @@ * * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; - * ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); * Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck); * } * *

* - *

Note: close() needs to be called on the httpHealthCheckClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the httpHealthCheckClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of HttpHealthCheckSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class HttpHealthCheckClient implements BackgroundResource {
   private final HttpHealthCheckSettings settings;
   private final HttpHealthCheckStub stub;
 
-
-
-  /**
-   * Constructs an instance of HttpHealthCheckClient with default settings.
-   */
+  /** Constructs an instance of HttpHealthCheckClient with default settings. */
   public static final HttpHealthCheckClient create() throws IOException {
     return create(HttpHealthCheckSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of HttpHealthCheckClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of HttpHealthCheckClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final HttpHealthCheckClient create(HttpHealthCheckSettings settings) throws IOException {
+  public static final HttpHealthCheckClient create(HttpHealthCheckSettings settings)
+      throws IOException {
     return new HttpHealthCheckClient(settings);
   }
 
   /**
-   * Constructs an instance of HttpHealthCheckClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use HttpHealthCheckSettings}.
+   * Constructs an instance of HttpHealthCheckClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use HttpHealthCheckSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final HttpHealthCheckClient create(HttpHealthCheckStub stub) {
@@ -144,9 +130,9 @@ public static final HttpHealthCheckClient create(HttpHealthCheckStub stub) {
   }
 
   /**
-   * Constructs an instance of HttpHealthCheckClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of HttpHealthCheckClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected HttpHealthCheckClient(HttpHealthCheckSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +154,41 @@ public HttpHealthCheckStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified HttpHealthCheck resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpHealthCheck(String requestId, ProjectHttpHealthCheckName httpHealthCheck) { + public final Operation deleteHttpHealthCheck( + String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck) { DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) - .build(); + .setRequestId(requestId) + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .build(); return deleteHttpHealthCheck(request); } @@ -205,20 +196,25 @@ public final Operation deleteHttpHealthCheck(String requestId, ProjectHttpHealth /** * Deletes the specified HttpHealthCheck resource. * - * Sample code: + *

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +223,9 @@ public final Operation deleteHttpHealthCheck(String requestId, String httpHealth DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck) - .build(); + .setRequestId(requestId) + .setHttpHealthCheck(httpHealthCheck) + .build(); return deleteHttpHealthCheck(request); } @@ -237,11 +233,12 @@ public final Operation deleteHttpHealthCheck(String requestId, String httpHealth /** * Deletes the specified HttpHealthCheck resource. * - * Sample code: + *

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
@@ -262,11 +259,12 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re
   /**
    * Deletes the specified HttpHealthCheck resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
@@ -278,18 +276,21 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable deleteHttpHealthCheckCallable() { + public final UnaryCallable + deleteHttpHealthCheckCallable() { return stub.deleteHttpHealthCheckCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
    * }
    * 
@@ -298,23 +299,26 @@ public final UnaryCallable deleteHt * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck(ProjectHttpHealthCheckName httpHealthCheck) { + public final HttpHealthCheck getHttpHealthCheck( + ProjectGlobalHttpHealthCheckName httpHealthCheck) { GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() - .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) - .build(); + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .build(); return getHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
    * }
    * 
@@ -326,20 +330,20 @@ public final HttpHealthCheck getHttpHealthCheck(ProjectHttpHealthCheckName httpH public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { GetHttpHealthCheckHttpRequest request = - GetHttpHealthCheckHttpRequest.newBuilder() - .setHttpHealthCheck(httpHealthCheck) - .build(); + GetHttpHealthCheckHttpRequest.newBuilder().setHttpHealthCheck(httpHealthCheck).build(); return getHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. + * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
@@ -357,12 +361,14 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request.
+   * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
@@ -373,15 +379,18 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable getHttpHealthCheckCallable() { + public final UnaryCallable + getHttpHealthCheckCallable() { return stub.getHttpHealthCheckCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * Creates a HttpHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
@@ -391,32 +400,40 @@ public final UnaryCallable getHt
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpHealthCheck(String requestId, ProjectName project, HttpHealthCheck httpHealthCheckResource) { + public final Operation insertHttpHealthCheck( + String requestId, ProjectName project, HttpHealthCheck httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setHttpHealthCheckResource(httpHealthCheckResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); return insertHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * Creates a HttpHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
@@ -426,32 +443,40 @@ public final Operation insertHttpHealthCheck(String requestId, ProjectName proje
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpHealthCheck(String requestId, String project, HttpHealthCheck httpHealthCheckResource) { + public final Operation insertHttpHealthCheck( + String requestId, String project, HttpHealthCheck httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setHttpHealthCheckResource(httpHealthCheckResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); return insertHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * Creates a HttpHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
@@ -476,9 +501,11 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a HttpHealthCheck resource in the specified project using the data included in the request.
+   * Creates a HttpHealthCheck resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
@@ -496,7 +523,8 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable insertHttpHealthCheckCallable() { + public final UnaryCallable + insertHttpHealthCheckCallable() { return stub.insertHttpHealthCheckCallable(); } @@ -504,7 +532,8 @@ public final UnaryCallable insertHt /** * Retrieves the list of HttpHealthCheck resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +550,8 @@ public final UnaryCallable insertHt
   public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName project) {
     ListHttpHealthChecksHttpRequest request =
         ListHttpHealthChecksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listHttpHealthChecks(request);
   }
 
@@ -530,7 +559,8 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName
   /**
    * Retrieves the list of HttpHealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +576,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName
   @BetaApi
   public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String project) {
     ListHttpHealthChecksHttpRequest request =
-        ListHttpHealthChecksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListHttpHealthChecksHttpRequest.newBuilder().setProject(project).build();
     return listHttpHealthChecks(request);
   }
 
@@ -556,7 +584,8 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String proje
   /**
    * Retrieves the list of HttpHealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +602,17 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String proje
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ListHttpHealthChecksHttpRequest request) {
-    return listHttpHealthChecksPagedCallable()
-        .call(request);
+  public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
+      ListHttpHealthChecksHttpRequest request) {
+    return listHttpHealthChecksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of HttpHealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +628,8 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ListHttpHeal
    * 
*/ @BetaApi - public final UnaryCallable listHttpHealthChecksPagedCallable() { + public final UnaryCallable + listHttpHealthChecksPagedCallable() { return stub.listHttpHealthChecksPagedCallable(); } @@ -606,7 +637,8 @@ public final UnaryCallableSample code: + * *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,89 +661,113 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listHttpHealthChecksCallable() { + public final UnaryCallable + listHttpHealthChecksCallable() { return stub.listHttpHealthChecksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck 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. + * Updates a HttpHealthCheck 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: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. - * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpHealthCheck(String requestId, ProjectHttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation patchHttpHealthCheck( + String requestId, + ProjectGlobalHttpHealthCheckName httpHealthCheck, + HttpHealthCheck httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) - .setHttpHealthCheckResource(httpHealthCheckResource) - .build(); + .setRequestId(requestId) + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); return patchHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck 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. + * Updates a HttpHealthCheck 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: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. - * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpHealthCheck(String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation patchHttpHealthCheck( + String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck) - .setHttpHealthCheckResource(httpHealthCheckResource) - .build(); + .setRequestId(requestId) + .setHttpHealthCheck(httpHealthCheck) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); return patchHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck 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. + * Updates a HttpHealthCheck 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: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -732,13 +788,16 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpHealthCheck 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.
+   * Updates a HttpHealthCheck 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: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -752,89 +811,110 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable patchHttpHealthCheckCallable() { + public final UnaryCallable + patchHttpHealthCheckCallable() { return stub.patchHttpHealthCheckCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * Updates a HttpHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to update. - * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpHealthCheck(String requestId, ProjectHttpHealthCheckName httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation updateHttpHealthCheck( + String requestId, + ProjectGlobalHttpHealthCheckName httpHealthCheck, + HttpHealthCheck httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) - .setHttpHealthCheckResource(httpHealthCheckResource) - .build(); + .setRequestId(requestId) + .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); return updateHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * Updates a HttpHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to update. - * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. + * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTP. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpHealthCheck(String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + public final Operation updateHttpHealthCheck( + String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck) - .setHttpHealthCheckResource(httpHealthCheckResource) - .build(); + .setRequestId(requestId) + .setHttpHealthCheck(httpHealthCheck) + .setHttpHealthCheckResource(httpHealthCheckResource) + .build(); return updateHttpHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * Updates a HttpHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -855,13 +935,15 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpHealthCheck resource in the specified project using the data included in the request.
+   * Updates a HttpHealthCheck resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
-   *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+   *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -875,12 +957,13 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable updateHttpHealthCheckCallable() { + public final UnaryCallable + updateHttpHealthCheckCallable() { return stub.updateHttpHealthCheckCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -909,12 +992,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListHttpHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpHealthChecksHttpRequest, - HttpHealthCheckList, - HttpHealthCheck, - ListHttpHealthChecksPage, - ListHttpHealthChecksFixedSizeCollection> { + public static class ListHttpHealthChecksPagedResponse + extends AbstractPagedListResponse< + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -934,15 +1015,12 @@ public ListHttpHealthChecksPagedResponse apply(ListHttpHealthChecksPage input) { private ListHttpHealthChecksPagedResponse(ListHttpHealthChecksPage page) { super(page, ListHttpHealthChecksFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListHttpHealthChecksPage extends AbstractPage< - ListHttpHealthChecksHttpRequest, - HttpHealthCheckList, - HttpHealthCheck, - ListHttpHealthChecksPage> { + public static class ListHttpHealthChecksPage + extends AbstractPage< + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksPage> { private ListHttpHealthChecksPage( PageContext context, @@ -967,20 +1045,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListHttpHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpHealthChecksHttpRequest, - HttpHealthCheckList, - HttpHealthCheck, - ListHttpHealthChecksPage, - ListHttpHealthChecksFixedSizeCollection> { + public static class ListHttpHealthChecksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { - private ListHttpHealthChecksFixedSizeCollection(List pages, int collectionSize) { + private ListHttpHealthChecksFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -993,7 +1066,5 @@ protected ListHttpHealthChecksFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListHttpHealthChecksFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java index ad9def279706..ea58f3cb633c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private HttpHealthCheckList() { this.warning = null; } - private HttpHealthCheckList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HttpHealthCheckList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HttpHealthCheckList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HttpHealthCheckList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HttpHealthCheckList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public HttpHealthCheckList build() { - - - - - return new HttpHealthCheckList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new HttpHealthCheckList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "HttpHealthCheckList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof HttpHealthCheckList) { HttpHealthCheckList that = (HttpHealthCheckList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java index ba8b5ac32b64..15442370928d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; import com.google.cloud.compute.v1.stub.HttpHealthCheckStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteHttpHealthCheck to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteHttpHealthCheck to 30 seconds: * *

  * 
@@ -85,91 +63,75 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class HttpHealthCheckSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteHttpHealthCheck.
-   */
-  public UnaryCallSettings deleteHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to deleteHttpHealthCheck. */
+  public UnaryCallSettings
+      deleteHttpHealthCheckSettings() {
     return ((HttpHealthCheckStubSettings) getStubSettings()).deleteHttpHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHttpHealthCheck.
-   */
-  public UnaryCallSettings getHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to getHttpHealthCheck. */
+  public UnaryCallSettings
+      getHttpHealthCheckSettings() {
     return ((HttpHealthCheckStubSettings) getStubSettings()).getHttpHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertHttpHealthCheck.
-   */
-  public UnaryCallSettings insertHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to insertHttpHealthCheck. */
+  public UnaryCallSettings
+      insertHttpHealthCheckSettings() {
     return ((HttpHealthCheckStubSettings) getStubSettings()).insertHttpHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listHttpHealthChecks.
-   */
-  public PagedCallSettings listHttpHealthChecksSettings() {
+  /** Returns the object with the settings used for calls to listHttpHealthChecks. */
+  public PagedCallSettings<
+          ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse>
+      listHttpHealthChecksSettings() {
     return ((HttpHealthCheckStubSettings) getStubSettings()).listHttpHealthChecksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchHttpHealthCheck.
-   */
-  public UnaryCallSettings patchHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to patchHttpHealthCheck. */
+  public UnaryCallSettings
+      patchHttpHealthCheckSettings() {
     return ((HttpHealthCheckStubSettings) getStubSettings()).patchHttpHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateHttpHealthCheck.
-   */
-  public UnaryCallSettings updateHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to updateHttpHealthCheck. */
+  public UnaryCallSettings
+      updateHttpHealthCheckSettings() {
     return ((HttpHealthCheckStubSettings) getStubSettings()).updateHttpHealthCheckSettings();
   }
 
-
-  public static final HttpHealthCheckSettings create(HttpHealthCheckStubSettings stub) throws IOException {
+  public static final HttpHealthCheckSettings create(HttpHealthCheckStubSettings stub)
+      throws IOException {
     return new HttpHealthCheckSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return HttpHealthCheckStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return HttpHealthCheckStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return HttpHealthCheckStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return HttpHealthCheckStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return HttpHealthCheckStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return HttpHealthCheckStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return HttpHealthCheckStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +144,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return HttpHealthCheckStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +163,7 @@ protected HttpHealthCheckSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for HttpHealthCheckSettings.
-   */
+  /** Builder for HttpHealthCheckSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +185,57 @@ protected Builder(HttpHealthCheckStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public HttpHealthCheckStubSettings.Builder getStubSettingsBuilder() {
       return ((HttpHealthCheckStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteHttpHealthCheck. - */ - public UnaryCallSettings.Builder deleteHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to deleteHttpHealthCheck. */ + public UnaryCallSettings.Builder + deleteHttpHealthCheckSettings() { return getStubSettingsBuilder().deleteHttpHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to getHttpHealthCheck. - */ - public UnaryCallSettings.Builder getHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ + public UnaryCallSettings.Builder + getHttpHealthCheckSettings() { return getStubSettingsBuilder().getHttpHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to insertHttpHealthCheck. - */ - public UnaryCallSettings.Builder insertHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to insertHttpHealthCheck. */ + public UnaryCallSettings.Builder + insertHttpHealthCheckSettings() { return getStubSettingsBuilder().insertHttpHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to listHttpHealthChecks. - */ - public PagedCallSettings.Builder listHttpHealthChecksSettings() { + /** Returns the builder for the settings used for calls to listHttpHealthChecks. */ + public PagedCallSettings.Builder< + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse> + listHttpHealthChecksSettings() { return getStubSettingsBuilder().listHttpHealthChecksSettings(); } - /** - * Returns the builder for the settings used for calls to patchHttpHealthCheck. - */ - public UnaryCallSettings.Builder patchHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to patchHttpHealthCheck. */ + public UnaryCallSettings.Builder + patchHttpHealthCheckSettings() { return getStubSettingsBuilder().patchHttpHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to updateHttpHealthCheck. - */ - public UnaryCallSettings.Builder updateHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to updateHttpHealthCheck. */ + public UnaryCallSettings.Builder + updateHttpHealthCheckSettings() { return getStubSettingsBuilder().updateHttpHealthCheckSettings(); } @@ -293,4 +244,4 @@ public HttpHealthCheckSettings build() throws IOException { return new HttpHealthCheckSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java index be2790e60d80..013459ba0fab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -62,7 +59,6 @@ private HttpsHealthCheck() { this.unhealthyThreshold = null; } - private HttpsHealthCheck( Integer checkIntervalSec, String creationTimestamp, @@ -76,8 +72,7 @@ private HttpsHealthCheck( String requestPath, String selfLink, Integer timeoutSec, - Integer unhealthyThreshold - ) { + Integer unhealthyThreshold) { this.checkIntervalSec = checkIntervalSec; this.creationTimestamp = creationTimestamp; this.description = description; @@ -100,7 +95,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -133,7 +129,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); } if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put("unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); } return fieldMap; } @@ -240,22 +237,24 @@ public Integer getUnhealthyThreshold() { return unhealthyThreshold; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HttpsHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HttpsHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HttpsHealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HttpsHealthCheck(); } @@ -454,35 +453,22 @@ public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { return this; } - public HttpsHealthCheck build() { - - - - - - - - - - - return new HttpsHealthCheck( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold - ); + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); } public Builder clone() { @@ -507,19 +493,44 @@ public Builder clone() { @Override public String toString() { return "HttpsHealthCheck{" - + "checkIntervalSec=" + checkIntervalSec + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "healthyThreshold=" + healthyThreshold + ", " - + "host=" + host + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "port=" + port + ", " - + "requestPath=" + requestPath + ", " - + "selfLink=" + selfLink + ", " - + "timeoutSec=" + timeoutSec + ", " - + "unhealthyThreshold=" + unhealthyThreshold + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + + "host=" + + host + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "port=" + + port + + ", " + + "requestPath=" + + requestPath + + ", " + + "selfLink=" + + selfLink + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + "}"; } @@ -530,21 +541,19 @@ public boolean equals(Object o) { } if (o instanceof HttpsHealthCheck) { HttpsHealthCheck that = (HttpsHealthCheck) o; - return - Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) && - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.requestPath, that.getRequestPath()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.timeoutSec, that.getTimeoutSec()) && - Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()) - ; + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.requestPath, that.getRequestPath()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); } return false; } @@ -552,19 +561,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold - ); + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java index 588347df41a4..0566c71391df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.HttpsHealthCheckStub; import com.google.cloud.compute.v1.stub.HttpsHealthCheckStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,41 @@ *

  * 
  * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
- *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+ *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
  *   String requestId = "";
  *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the httpsHealthCheckClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the httpsHealthCheckClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of HttpsHealthCheckSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class HttpsHealthCheckClient implements BackgroundResource {
   private final HttpsHealthCheckSettings settings;
   private final HttpsHealthCheckStub stub;
 
-
-
-  /**
-   * Constructs an instance of HttpsHealthCheckClient with default settings.
-   */
+  /** Constructs an instance of HttpsHealthCheckClient with default settings. */
   public static final HttpsHealthCheckClient create() throws IOException {
     return create(HttpsHealthCheckSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of HttpsHealthCheckClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of HttpsHealthCheckClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final HttpsHealthCheckClient create(HttpsHealthCheckSettings settings) throws IOException {
+  public static final HttpsHealthCheckClient create(HttpsHealthCheckSettings settings)
+      throws IOException {
     return new HttpsHealthCheckClient(settings);
   }
 
   /**
-   * Constructs an instance of HttpsHealthCheckClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use HttpsHealthCheckSettings}.
+   * Constructs an instance of HttpsHealthCheckClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use HttpsHealthCheckSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final HttpsHealthCheckClient create(HttpsHealthCheckStub stub) {
@@ -144,9 +130,9 @@ public static final HttpsHealthCheckClient create(HttpsHealthCheckStub stub) {
   }
 
   /**
-   * Constructs an instance of HttpsHealthCheckClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of HttpsHealthCheckClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected HttpsHealthCheckClient(HttpsHealthCheckSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +154,41 @@ public HttpsHealthCheckStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified HttpsHealthCheck resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck, String requestId) { + public final Operation deleteHttpsHealthCheck( + ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId) { DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .setRequestId(requestId) - .build(); + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setRequestId(requestId) + .build(); return deleteHttpsHealthCheck(request); } @@ -205,21 +196,26 @@ public final Operation deleteHttpsHealthCheck(ProjectHttpsHealthCheckName httpsH /** * Deletes the specified HttpsHealthCheck resource. * - * Sample code: + *

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString(), requestId);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +223,9 @@ public final Operation deleteHttpsHealthCheck(String httpsHealthCheck, String re DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck) - .setRequestId(requestId) - .build(); + .setHttpsHealthCheck(httpsHealthCheck) + .setRequestId(requestId) + .build(); return deleteHttpsHealthCheck(request); } @@ -237,10 +233,11 @@ public final Operation deleteHttpsHealthCheck(String httpsHealthCheck, String re /** * Deletes the specified HttpsHealthCheck resource. * - * Sample code: + *

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
@@ -262,10 +259,11 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest
   /**
    * Deletes the specified HttpsHealthCheck resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
@@ -278,18 +276,21 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteHttpsHealthCheckCallable() { + public final UnaryCallable + deleteHttpsHealthCheckCallable() { return stub.deleteHttpsHealthCheckCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
    * }
    * 
@@ -298,23 +299,26 @@ public final UnaryCallable deleteH * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck) { + public final HttpsHealthCheck getHttpsHealthCheck( + ProjectGlobalHttpsHealthCheckName httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .build(); + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .build(); return getHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
    * }
    * 
@@ -326,20 +330,20 @@ public final HttpsHealthCheck getHttpsHealthCheck(ProjectHttpsHealthCheckName ht public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = - GetHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck) - .build(); + GetHttpsHealthCheckHttpRequest.newBuilder().setHttpsHealthCheck(httpsHealthCheck).build(); return getHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. + * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
    *     .build();
@@ -357,12 +361,14 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request.
+   * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
    *     .build();
@@ -373,15 +379,18 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable getHttpsHealthCheckCallable() { + public final UnaryCallable + getHttpsHealthCheckCallable() { return stub.getHttpsHealthCheckCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * Creates a HttpsHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   String requestId = "";
@@ -391,32 +400,40 @@ public final UnaryCallable get
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpsHealthCheck(String requestId, ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation insertHttpsHealthCheck( + String requestId, ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setHttpsHealthCheckResource(httpsHealthCheckResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); return insertHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * Creates a HttpsHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   String requestId = "";
@@ -426,32 +443,40 @@ public final Operation insertHttpsHealthCheck(String requestId, ProjectName proj
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHttpsHealthCheck(String requestId, String project, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation insertHttpsHealthCheck( + String requestId, String project, HttpsHealthCheck httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setHttpsHealthCheckResource(httpsHealthCheckResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); return insertHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * Creates a HttpsHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   String requestId = "";
@@ -476,9 +501,11 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a HttpsHealthCheck resource in the specified project using the data included in the request.
+   * Creates a HttpsHealthCheck resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   String requestId = "";
@@ -496,7 +523,8 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertHttpsHealthCheckCallable() { + public final UnaryCallable + insertHttpsHealthCheckCallable() { return stub.insertHttpsHealthCheckCallable(); } @@ -504,7 +532,8 @@ public final UnaryCallable insertH /** * Retrieves the list of HttpsHealthCheck resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +550,8 @@ public final UnaryCallable insertH
   public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectName project) {
     ListHttpsHealthChecksHttpRequest request =
         ListHttpsHealthChecksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listHttpsHealthChecks(request);
   }
 
@@ -530,7 +559,8 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectNam
   /**
    * Retrieves the list of HttpsHealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +576,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectNam
   @BetaApi
   public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String project) {
     ListHttpsHealthChecksHttpRequest request =
-        ListHttpsHealthChecksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListHttpsHealthChecksHttpRequest.newBuilder().setProject(project).build();
     return listHttpsHealthChecks(request);
   }
 
@@ -556,7 +584,8 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String pro
   /**
    * Retrieves the list of HttpsHealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +602,17 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String pro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ListHttpsHealthChecksHttpRequest request) {
-    return listHttpsHealthChecksPagedCallable()
-        .call(request);
+  public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
+      ListHttpsHealthChecksHttpRequest request) {
+    return listHttpsHealthChecksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of HttpsHealthCheck resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +628,8 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ListHttpsH
    * 
*/ @BetaApi - public final UnaryCallable listHttpsHealthChecksPagedCallable() { + public final UnaryCallable + listHttpsHealthChecksPagedCallable() { return stub.listHttpsHealthChecksPagedCallable(); } @@ -606,7 +637,8 @@ public final UnaryCallableSample code: + * *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,18 +661,22 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listHttpsHealthChecksCallable() { + public final UnaryCallable + listHttpsHealthChecksCallable() { return stub.listHttpsHealthChecksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck 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. + * Updates a HttpsHealthCheck 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: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
@@ -648,34 +684,45 @@ public final UnaryCallable
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation patchHttpsHealthCheck( + ProjectGlobalHttpsHealthCheckName httpsHealthCheck, + String requestId, + HttpsHealthCheck httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .setRequestId(requestId) - .setHttpsHealthCheckResource(httpsHealthCheckResource) - .build(); + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setRequestId(requestId) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); return patchHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck 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. + * Updates a HttpsHealthCheck 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: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
@@ -683,34 +730,43 @@ public final Operation patchHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHe
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHttpsHealthCheck(String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation patchHttpsHealthCheck( + String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck) - .setRequestId(requestId) - .setHttpsHealthCheckResource(httpsHealthCheckResource) - .build(); + .setHttpsHealthCheck(httpsHealthCheck) + .setRequestId(requestId) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); return patchHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck 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. + * Updates a HttpsHealthCheck 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: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
@@ -732,12 +788,15 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpsHealthCheck 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.
+   * Updates a HttpsHealthCheck 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: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
@@ -752,18 +811,21 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable patchHttpsHealthCheckCallable() { + public final UnaryCallable + patchHttpsHealthCheckCallable() { return stub.patchHttpsHealthCheckCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * Updates a HttpsHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
@@ -771,34 +833,44 @@ public final UnaryCallable patchHtt
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpsHealthCheck(ProjectHttpsHealthCheckName httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation updateHttpsHealthCheck( + ProjectGlobalHttpsHealthCheckName httpsHealthCheck, + String requestId, + HttpsHealthCheck httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .setRequestId(requestId) - .setHttpsHealthCheckResource(httpsHealthCheckResource) - .build(); + .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) + .setRequestId(requestId) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); return updateHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * Updates a HttpsHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
@@ -806,34 +878,42 @@ public final Operation updateHttpsHealthCheck(ProjectHttpsHealthCheckName httpsH
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template + * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHttpsHealthCheck(String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + public final Operation updateHttpsHealthCheck( + String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() - .setHttpsHealthCheck(httpsHealthCheck) - .setRequestId(requestId) - .setHttpsHealthCheckResource(httpsHealthCheckResource) - .build(); + .setHttpsHealthCheck(httpsHealthCheck) + .setRequestId(requestId) + .setHttpsHealthCheckResource(httpsHealthCheckResource) + .build(); return updateHttpsHealthCheck(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * Updates a HttpsHealthCheck resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
@@ -855,12 +935,14 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates a HttpsHealthCheck resource in the specified project using the data included in the request.
+   * Updates a HttpsHealthCheck resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+   *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
    *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
@@ -875,12 +957,13 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable updateHttpsHealthCheckCallable() { + public final UnaryCallable + updateHttpsHealthCheckCallable() { return stub.updateHttpsHealthCheckCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -909,15 +992,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListHttpsHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpsHealthChecksHttpRequest, - HttpsHealthCheckList, - HttpsHealthCheck, - ListHttpsHealthChecksPage, - ListHttpsHealthChecksFixedSizeCollection> { + public static class ListHttpsHealthChecksPagedResponse + extends AbstractPagedListResponse< + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListHttpsHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -934,18 +1016,16 @@ public ListHttpsHealthChecksPagedResponse apply(ListHttpsHealthChecksPage input) private ListHttpsHealthChecksPagedResponse(ListHttpsHealthChecksPage page) { super(page, ListHttpsHealthChecksFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListHttpsHealthChecksPage extends AbstractPage< - ListHttpsHealthChecksHttpRequest, - HttpsHealthCheckList, - HttpsHealthCheck, - ListHttpsHealthChecksPage> { + public static class ListHttpsHealthChecksPage + extends AbstractPage< + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksPage> { private ListHttpsHealthChecksPage( - PageContext context, + PageContext + context, HttpsHealthCheckList response) { super(context, response); } @@ -956,31 +1036,28 @@ private static ListHttpsHealthChecksPage createEmptyPage() { @Override protected ListHttpsHealthChecksPage createPage( - PageContext context, + PageContext + context, HttpsHealthCheckList response) { return new ListHttpsHealthChecksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListHttpsHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpsHealthChecksHttpRequest, - HttpsHealthCheckList, - HttpsHealthCheck, - ListHttpsHealthChecksPage, - ListHttpsHealthChecksFixedSizeCollection> { + public static class ListHttpsHealthChecksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { - private ListHttpsHealthChecksFixedSizeCollection(List pages, int collectionSize) { + private ListHttpsHealthChecksFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -993,7 +1070,5 @@ protected ListHttpsHealthChecksFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListHttpsHealthChecksFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java index d1b0769d9451..5f06beffbed9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private HttpsHealthCheckList() { this.warning = null; } - private HttpsHealthCheckList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(HttpsHealthCheckList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static HttpsHealthCheckList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final HttpsHealthCheckList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new HttpsHealthCheckList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public HttpsHealthCheckList build() { - - - - - return new HttpsHealthCheckList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new HttpsHealthCheckList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "HttpsHealthCheckList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof HttpsHealthCheckList) { HttpsHealthCheckList that = (HttpsHealthCheckList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java index 8372d0abcfa1..3d8aaecdd7f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; import com.google.cloud.compute.v1.stub.HttpsHealthCheckStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteHttpsHealthCheck to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteHttpsHealthCheck to 30 seconds: * *

  * 
@@ -85,91 +63,76 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class HttpsHealthCheckSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteHttpsHealthCheck.
-   */
-  public UnaryCallSettings deleteHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to deleteHttpsHealthCheck. */
+  public UnaryCallSettings
+      deleteHttpsHealthCheckSettings() {
     return ((HttpsHealthCheckStubSettings) getStubSettings()).deleteHttpsHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHttpsHealthCheck.
-   */
-  public UnaryCallSettings getHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to getHttpsHealthCheck. */
+  public UnaryCallSettings
+      getHttpsHealthCheckSettings() {
     return ((HttpsHealthCheckStubSettings) getStubSettings()).getHttpsHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertHttpsHealthCheck.
-   */
-  public UnaryCallSettings insertHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to insertHttpsHealthCheck. */
+  public UnaryCallSettings
+      insertHttpsHealthCheckSettings() {
     return ((HttpsHealthCheckStubSettings) getStubSettings()).insertHttpsHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listHttpsHealthChecks.
-   */
-  public PagedCallSettings listHttpsHealthChecksSettings() {
+  /** Returns the object with the settings used for calls to listHttpsHealthChecks. */
+  public PagedCallSettings<
+          ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList,
+          ListHttpsHealthChecksPagedResponse>
+      listHttpsHealthChecksSettings() {
     return ((HttpsHealthCheckStubSettings) getStubSettings()).listHttpsHealthChecksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchHttpsHealthCheck.
-   */
-  public UnaryCallSettings patchHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to patchHttpsHealthCheck. */
+  public UnaryCallSettings
+      patchHttpsHealthCheckSettings() {
     return ((HttpsHealthCheckStubSettings) getStubSettings()).patchHttpsHealthCheckSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateHttpsHealthCheck.
-   */
-  public UnaryCallSettings updateHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to updateHttpsHealthCheck. */
+  public UnaryCallSettings
+      updateHttpsHealthCheckSettings() {
     return ((HttpsHealthCheckStubSettings) getStubSettings()).updateHttpsHealthCheckSettings();
   }
 
-
-  public static final HttpsHealthCheckSettings create(HttpsHealthCheckStubSettings stub) throws IOException {
+  public static final HttpsHealthCheckSettings create(HttpsHealthCheckStubSettings stub)
+      throws IOException {
     return new HttpsHealthCheckSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return HttpsHealthCheckStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return HttpsHealthCheckStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return HttpsHealthCheckStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return HttpsHealthCheckStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return HttpsHealthCheckStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return HttpsHealthCheckStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return HttpsHealthCheckStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +145,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return HttpsHealthCheckStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +164,7 @@ protected HttpsHealthCheckSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for HttpsHealthCheckSettings.
-   */
+  /** Builder for HttpsHealthCheckSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +186,58 @@ protected Builder(HttpsHealthCheckStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public HttpsHealthCheckStubSettings.Builder getStubSettingsBuilder() {
       return ((HttpsHealthCheckStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteHttpsHealthCheck. - */ - public UnaryCallSettings.Builder deleteHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to deleteHttpsHealthCheck. */ + public UnaryCallSettings.Builder + deleteHttpsHealthCheckSettings() { return getStubSettingsBuilder().deleteHttpsHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to getHttpsHealthCheck. - */ - public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ + public UnaryCallSettings.Builder + getHttpsHealthCheckSettings() { return getStubSettingsBuilder().getHttpsHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to insertHttpsHealthCheck. - */ - public UnaryCallSettings.Builder insertHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to insertHttpsHealthCheck. */ + public UnaryCallSettings.Builder + insertHttpsHealthCheckSettings() { return getStubSettingsBuilder().insertHttpsHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to listHttpsHealthChecks. - */ - public PagedCallSettings.Builder listHttpsHealthChecksSettings() { + /** Returns the builder for the settings used for calls to listHttpsHealthChecks. */ + public PagedCallSettings.Builder< + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, + ListHttpsHealthChecksPagedResponse> + listHttpsHealthChecksSettings() { return getStubSettingsBuilder().listHttpsHealthChecksSettings(); } - /** - * Returns the builder for the settings used for calls to patchHttpsHealthCheck. - */ - public UnaryCallSettings.Builder patchHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to patchHttpsHealthCheck. */ + public UnaryCallSettings.Builder + patchHttpsHealthCheckSettings() { return getStubSettingsBuilder().patchHttpsHealthCheckSettings(); } - /** - * Returns the builder for the settings used for calls to updateHttpsHealthCheck. - */ - public UnaryCallSettings.Builder updateHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to updateHttpsHealthCheck. */ + public UnaryCallSettings.Builder + updateHttpsHealthCheckSettings() { return getStubSettingsBuilder().updateHttpsHealthCheckSettings(); } @@ -293,4 +246,4 @@ public HttpsHealthCheckSettings build() throws IOException { return new HttpsHealthCheckSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java index ac18a40526ee..12d4d8d3e135 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -44,6 +43,7 @@ public final class Image implements ApiMessage { private final String kind; private final String labelFingerprint; private final Map labels; + private final List licenseCodes; private final List licenses; private final String name; private final RawDisk rawDisk; @@ -73,6 +73,7 @@ private Image() { this.kind = null; this.labelFingerprint = null; this.labels = null; + this.licenseCodes = null; this.licenses = null; this.name = null; this.rawDisk = null; @@ -90,7 +91,6 @@ private Image() { this.status = null; } - private Image( String archiveSizeBytes, String creationTimestamp, @@ -104,6 +104,7 @@ private Image( String kind, String labelFingerprint, Map labels, + List licenseCodes, List licenses, String name, RawDisk rawDisk, @@ -118,8 +119,7 @@ private Image( CustomerEncryptionKey sourceSnapshotEncryptionKey, String sourceSnapshotId, String sourceType, - String status - ) { + String status) { this.archiveSizeBytes = archiveSizeBytes; this.creationTimestamp = creationTimestamp; this.deprecated = deprecated; @@ -132,6 +132,7 @@ private Image( this.kind = kind; this.labelFingerprint = labelFingerprint; this.labels = labels; + this.licenseCodes = licenseCodes; this.licenses = licenses; this.name = name; this.rawDisk = rawDisk; @@ -156,7 +157,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("archiveSizeBytes", Collections.singletonList(String.valueOf(archiveSizeBytes))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("deprecated") && deprecated != null) { fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); @@ -181,7 +183,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); } if (fieldNames.contains("imageEncryptionKey") && imageEncryptionKey != null) { - fieldMap.put("imageEncryptionKey", Collections.singletonList(String.valueOf(imageEncryptionKey))); + fieldMap.put( + "imageEncryptionKey", Collections.singletonList(String.valueOf(imageEncryptionKey))); } if (fieldNames.contains("kind") && kind != null) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); @@ -192,6 +195,13 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("labels") && labels != null) { fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); } + if (fieldNames.contains("licenseCodes") && licenseCodes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenseCodes) { + stringList.add(item.toString()); + } + fieldMap.put("licenseCodes", stringList.build()); + } if (fieldNames.contains("licenses") && licenses != null) { ImmutableList.Builder stringList = ImmutableList.builder(); for (String item : licenses) { @@ -212,7 +222,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); } if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { - fieldMap.put("sourceDiskEncryptionKey", Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); + fieldMap.put( + "sourceDiskEncryptionKey", + Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); } if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); @@ -221,7 +233,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); } if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put("sourceImageEncryptionKey", Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); } if (fieldNames.contains("sourceImageId") && sourceImageId != null) { fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); @@ -230,7 +244,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); } if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { - fieldMap.put("sourceSnapshotEncryptionKey", Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); + fieldMap.put( + "sourceSnapshotEncryptionKey", + Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); } if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); @@ -282,6 +298,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("labels")) { return String.valueOf(labels); } + if (fieldName.equals("licenseCodes")) { + return String.valueOf(licenseCodes); + } if (fieldName.equals("licenses")) { return String.valueOf(licenses); } @@ -384,6 +403,10 @@ public Map getLabelsMap() { return labels; } + public List getLicenseCodesList() { + return licenseCodes; + } + public List getLicensesList() { return licenses; } @@ -444,22 +467,24 @@ public String getStatus() { return status; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Image prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Image getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Image DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Image(); } @@ -477,6 +502,7 @@ public static class Builder { private String kind; private String labelFingerprint; private Map labels; + private List licenseCodes; private List licenses; private String name; private RawDisk rawDisk; @@ -533,6 +559,9 @@ public Builder mergeFrom(Image other) { if (other.getLabelsMap() != null) { this.labels = other.labels; } + if (other.getLicenseCodesList() != null) { + this.licenseCodes = other.licenseCodes; + } if (other.getLicensesList() != null) { this.licenses = other.licenses; } @@ -594,6 +623,7 @@ public Builder mergeFrom(Image other) { this.kind = source.kind; this.labelFingerprint = source.labelFingerprint; this.labels = source.labels; + this.licenseCodes = source.licenseCodes; this.licenses = source.licenses; this.name = source.name; this.rawDisk = source.rawDisk; @@ -727,6 +757,23 @@ public Builder putAllLabels(Map labels) { return this; } + public List getLicenseCodesList() { + return licenseCodes; + } + + public Builder addAllLicenseCodes(List licenseCodes) { + if (this.licenseCodes == null) { + this.licenseCodes = new ArrayList<>(licenseCodes.size()); + } + this.licenseCodes.addAll(licenseCodes); + return this; + } + + public Builder addLicenseCodes(String licenseCodes) { + this.licenseCodes.add(licenseCodes); + return this; + } + public List getLicensesList() { return licenses; } @@ -838,7 +885,8 @@ public CustomerEncryptionKey getSourceSnapshotEncryptionKey() { return sourceSnapshotEncryptionKey; } - public Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey) { + public Builder setSourceSnapshotEncryptionKey( + CustomerEncryptionKey sourceSnapshotEncryptionKey) { this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey; return this; } @@ -870,63 +918,37 @@ public Builder setStatus(String status) { return this; } - public Image build() { - - - - - - - - - - - - - - - - - - - - - - - - - return new Image( - archiveSizeBytes, - creationTimestamp, - deprecated, - description, - diskSizeGb, - family, - guestOsFeatures, - id, - imageEncryptionKey, - kind, - labelFingerprint, - labels, - licenses, - name, - rawDisk, - selfLink, - sourceDisk, - sourceDiskEncryptionKey, - sourceDiskId, - sourceImage, - sourceImageEncryptionKey, - sourceImageId, - sourceSnapshot, - sourceSnapshotEncryptionKey, - sourceSnapshotId, - sourceType, - status - ); + archiveSizeBytes, + creationTimestamp, + deprecated, + description, + diskSizeGb, + family, + guestOsFeatures, + id, + imageEncryptionKey, + kind, + labelFingerprint, + labels, + licenseCodes, + licenses, + name, + rawDisk, + selfLink, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + sourceType, + status); } public Builder clone() { @@ -943,6 +965,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setLabelFingerprint(this.labelFingerprint); newBuilder.putAllLabels(this.labels); + newBuilder.addAllLicenseCodes(this.licenseCodes); newBuilder.addAllLicenses(this.licenses); newBuilder.setName(this.name); newBuilder.setRawDisk(this.rawDisk); @@ -965,33 +988,89 @@ public Builder clone() { @Override public String toString() { return "Image{" - + "archiveSizeBytes=" + archiveSizeBytes + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "deprecated=" + deprecated + ", " - + "description=" + description + ", " - + "diskSizeGb=" + diskSizeGb + ", " - + "family=" + family + ", " - + "guestOsFeatures=" + guestOsFeatures + ", " - + "id=" + id + ", " - + "imageEncryptionKey=" + imageEncryptionKey + ", " - + "kind=" + kind + ", " - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + ", " - + "licenses=" + licenses + ", " - + "name=" + name + ", " - + "rawDisk=" + rawDisk + ", " - + "selfLink=" + selfLink + ", " - + "sourceDisk=" + sourceDisk + ", " - + "sourceDiskEncryptionKey=" + sourceDiskEncryptionKey + ", " - + "sourceDiskId=" + sourceDiskId + ", " - + "sourceImage=" + sourceImage + ", " - + "sourceImageEncryptionKey=" + sourceImageEncryptionKey + ", " - + "sourceImageId=" + sourceImageId + ", " - + "sourceSnapshot=" + sourceSnapshot + ", " - + "sourceSnapshotEncryptionKey=" + sourceSnapshotEncryptionKey + ", " - + "sourceSnapshotId=" + sourceSnapshotId + ", " - + "sourceType=" + sourceType + ", " - + "status=" + status + + "archiveSizeBytes=" + + archiveSizeBytes + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "deprecated=" + + deprecated + + ", " + + "description=" + + description + + ", " + + "diskSizeGb=" + + diskSizeGb + + ", " + + "family=" + + family + + ", " + + "guestOsFeatures=" + + guestOsFeatures + + ", " + + "id=" + + id + + ", " + + "imageEncryptionKey=" + + imageEncryptionKey + + ", " + + "kind=" + + kind + + ", " + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + + ", " + + "licenseCodes=" + + licenseCodes + + ", " + + "licenses=" + + licenses + + ", " + + "name=" + + name + + ", " + + "rawDisk=" + + rawDisk + + ", " + + "selfLink=" + + selfLink + + ", " + + "sourceDisk=" + + sourceDisk + + ", " + + "sourceDiskEncryptionKey=" + + sourceDiskEncryptionKey + + ", " + + "sourceDiskId=" + + sourceDiskId + + ", " + + "sourceImage=" + + sourceImage + + ", " + + "sourceImageEncryptionKey=" + + sourceImageEncryptionKey + + ", " + + "sourceImageId=" + + sourceImageId + + ", " + + "sourceSnapshot=" + + sourceSnapshot + + ", " + + "sourceSnapshotEncryptionKey=" + + sourceSnapshotEncryptionKey + + ", " + + "sourceSnapshotId=" + + sourceSnapshotId + + ", " + + "sourceType=" + + sourceType + + ", " + + "status=" + + status + "}"; } @@ -1002,35 +1081,34 @@ public boolean equals(Object o) { } if (o instanceof Image) { Image that = (Image) o; - return - Objects.equals(this.archiveSizeBytes, that.getArchiveSizeBytes()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.deprecated, that.getDeprecated()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && - Objects.equals(this.family, that.getFamily()) && - Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.imageEncryptionKey, that.getImageEncryptionKey()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) && - Objects.equals(this.licenses, that.getLicensesList()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.rawDisk, that.getRawDisk()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sourceDisk, that.getSourceDisk()) && - Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) && - Objects.equals(this.sourceDiskId, that.getSourceDiskId()) && - Objects.equals(this.sourceImage, that.getSourceImage()) && - Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) && - Objects.equals(this.sourceImageId, that.getSourceImageId()) && - Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) && - Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) && - Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) && - Objects.equals(this.sourceType, that.getSourceType()) && - Objects.equals(this.status, that.getStatus()) - ; + return Objects.equals(this.archiveSizeBytes, that.getArchiveSizeBytes()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) + && Objects.equals(this.family, that.getFamily()) + && Objects.equals(this.guestOsFeatures, that.getGuestOsFeaturesList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.imageEncryptionKey, that.getImageEncryptionKey()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()) + && Objects.equals(this.licenseCodes, that.getLicenseCodesList()) + && Objects.equals(this.licenses, that.getLicensesList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.rawDisk, that.getRawDisk()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sourceDisk, that.getSourceDisk()) + && Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) + && Objects.equals(this.sourceDiskId, that.getSourceDiskId()) + && Objects.equals(this.sourceImage, that.getSourceImage()) + && Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey()) + && Objects.equals(this.sourceImageId, that.getSourceImageId()) + && Objects.equals(this.sourceSnapshot, that.getSourceSnapshot()) + && Objects.equals(this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey()) + && Objects.equals(this.sourceSnapshotId, that.getSourceSnapshotId()) + && Objects.equals(this.sourceType, that.getSourceType()) + && Objects.equals(this.status, that.getStatus()); } return false; } @@ -1038,33 +1116,33 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - archiveSizeBytes, - creationTimestamp, - deprecated, - description, - diskSizeGb, - family, - guestOsFeatures, - id, - imageEncryptionKey, - kind, - labelFingerprint, - labels, - licenses, - name, - rawDisk, - selfLink, - sourceDisk, - sourceDiskEncryptionKey, - sourceDiskId, - sourceImage, - sourceImageEncryptionKey, - sourceImageId, - sourceSnapshot, - sourceSnapshotEncryptionKey, - sourceSnapshotId, - sourceType, - status - ); + archiveSizeBytes, + creationTimestamp, + deprecated, + description, + diskSizeGb, + family, + guestOsFeatures, + id, + imageEncryptionKey, + kind, + labelFingerprint, + labels, + licenseCodes, + licenses, + name, + rawDisk, + selfLink, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + sourceImage, + sourceImageEncryptionKey, + sourceImageId, + sourceSnapshot, + sourceSnapshotEncryptionKey, + sourceSnapshotId, + sourceType, + status); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java index bd94552fbf75..f07ce33cdf42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.ImageStub; import com.google.cloud.compute.v1.stub.ImageStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,40 @@ *

  * 
  * try (ImageClient imageClient = ImageClient.create()) {
- *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+ *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
  *   String requestId = "";
  *   Operation response = imageClient.deleteImage(image, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the imageClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the imageClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of ImageSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of ImageSettings to create(). For + * example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class ImageClient implements BackgroundResource {
   private final ImageSettings settings;
   private final ImageStub stub;
 
-
-
-  /**
-   * Constructs an instance of ImageClient with default settings.
-   */
+  /** Constructs an instance of ImageClient with default settings. */
   public static final ImageClient create() throws IOException {
     return create(ImageSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of ImageClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of ImageClient, using the given settings. The channels are created based
+   * on the settings passed in, or defaults for any settings that are not set.
    */
   public static final ImageClient create(ImageSettings settings) throws IOException {
     return new ImageClient(settings);
@@ -144,9 +128,8 @@ public static final ImageClient create(ImageStub stub) {
   }
 
   /**
-   * Constructs an instance of ImageClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of ImageClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected ImageClient(ImageSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +151,40 @@ public ImageStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified image.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   Operation response = imageClient.deleteImage(image, requestId);
    * }
    * 
* * @param image Name of the image resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteImage(ProjectImageName image, String requestId) { + public final Operation deleteImage(ProjectGlobalImageName image, String requestId) { DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder() - .setImage(image == null ? null : image.toString()) - .setRequestId(requestId) - .build(); + .setImage(image == null ? null : image.toString()) + .setRequestId(requestId) + .build(); return deleteImage(request); } @@ -205,31 +192,33 @@ public final Operation deleteImage(ProjectImageName image, String requestId) { /** * Deletes the specified image. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   Operation response = imageClient.deleteImage(image.toString(), requestId);
    * }
    * 
* * @param image Name of the image resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteImage(String image, String requestId) { DeleteImageHttpRequest request = - DeleteImageHttpRequest.newBuilder() - .setImage(image) - .setRequestId(requestId) - .build(); + DeleteImageHttpRequest.newBuilder().setImage(image).setRequestId(requestId).build(); return deleteImage(request); } @@ -237,10 +226,11 @@ public final Operation deleteImage(String image, String requestId) { /** * Deletes the specified image. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
@@ -262,10 +252,11 @@ public final Operation deleteImage(DeleteImageHttpRequest request) {
   /**
    * Deletes the specified image.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
@@ -286,12 +277,13 @@ public final UnaryCallable deleteImageCallabl
   /**
    * Sets the deprecation status of an image.
    *
-   * If an empty request body is given, clears the deprecation status instead.
+   * 

If an empty request body is given, clears the deprecation status instead. + * + *

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   Operation response = imageClient.deprecateImage(image, requestId, deprecationStatusResource);
@@ -299,23 +291,28 @@ public final UnaryCallable deleteImageCallabl
    * 
* * @param image Image name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param deprecationStatusResource Deprecation status for a public resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deprecateImage(ProjectImageName image, String requestId, DeprecationStatus deprecationStatusResource) { + public final Operation deprecateImage( + ProjectGlobalImageName image, String requestId, DeprecationStatus deprecationStatusResource) { DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder() - .setImage(image == null ? null : image.toString()) - .setRequestId(requestId) - .setDeprecationStatusResource(deprecationStatusResource) - .build(); + .setImage(image == null ? null : image.toString()) + .setRequestId(requestId) + .setDeprecationStatusResource(deprecationStatusResource) + .build(); return deprecateImage(request); } @@ -323,12 +320,13 @@ public final Operation deprecateImage(ProjectImageName image, String requestId, /** * Sets the deprecation status of an image. * - * If an empty request body is given, clears the deprecation status instead. + *

If an empty request body is given, clears the deprecation status instead. + * + *

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   Operation response = imageClient.deprecateImage(image.toString(), requestId, deprecationStatusResource);
@@ -336,23 +334,28 @@ public final Operation deprecateImage(ProjectImageName image, String requestId,
    * 
* * @param image Image name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param deprecationStatusResource Deprecation status for a public resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deprecateImage(String image, String requestId, DeprecationStatus deprecationStatusResource) { + public final Operation deprecateImage( + String image, String requestId, DeprecationStatus deprecationStatusResource) { DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder() - .setImage(image) - .setRequestId(requestId) - .setDeprecationStatusResource(deprecationStatusResource) - .build(); + .setImage(image) + .setRequestId(requestId) + .setDeprecationStatusResource(deprecationStatusResource) + .build(); return deprecateImage(request); } @@ -360,12 +363,13 @@ public final Operation deprecateImage(String image, String requestId, Deprecatio /** * Sets the deprecation status of an image. * - * If an empty request body is given, clears the deprecation status instead. + *

If an empty request body is given, clears the deprecation status instead. + * + *

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
@@ -389,12 +393,13 @@ public final Operation deprecateImage(DeprecateImageHttpRequest request) {
   /**
    * Sets the deprecation status of an image.
    *
-   * If an empty request body is given, clears the deprecation status instead.
+   * 

If an empty request body is given, clears the deprecation status instead. + * + *

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
@@ -417,10 +422,11 @@ public final UnaryCallable deprecateImageC
   /**
    * Returns the specified image. Get a list of available images by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   Image response = imageClient.getImage(image);
    * }
    * 
@@ -429,12 +435,10 @@ public final UnaryCallable deprecateImageC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Image getImage(ProjectImageName image) { + public final Image getImage(ProjectGlobalImageName image) { GetImageHttpRequest request = - GetImageHttpRequest.newBuilder() - .setImage(image == null ? null : image.toString()) - .build(); + GetImageHttpRequest.newBuilder().setImage(image == null ? null : image.toString()).build(); return getImage(request); } @@ -442,10 +446,11 @@ public final Image getImage(ProjectImageName image) { /** * Returns the specified image. Get a list of available images by making a list() request. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   Image response = imageClient.getImage(image.toString());
    * }
    * 
@@ -456,10 +461,7 @@ public final Image getImage(ProjectImageName image) { @BetaApi public final Image getImage(String image) { - GetImageHttpRequest request = - GetImageHttpRequest.newBuilder() - .setImage(image) - .build(); + GetImageHttpRequest request = GetImageHttpRequest.newBuilder().setImage(image).build(); return getImage(request); } @@ -467,10 +469,11 @@ public final Image getImage(String image) { /** * Returns the specified image. Get a list of available images by making a list() request. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   GetImageHttpRequest request = GetImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
    *     .build();
@@ -490,10 +493,11 @@ public final Image getImage(GetImageHttpRequest request) {
   /**
    * Returns the specified image. Get a list of available images by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
    *   GetImageHttpRequest request = GetImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
    *     .build();
@@ -512,10 +516,11 @@ public final UnaryCallable getImageCallable() {
   /**
    * Returns the latest image that is part of an image family and is not deprecated.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]");
    *   Image response = imageClient.getFromFamilyImage(family);
    * }
    * 
@@ -524,12 +529,12 @@ public final UnaryCallable getImageCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Image getFromFamilyImage(ProjectFamilyName family) { + public final Image getFromFamilyImage(ProjectGlobalImageFamilyName family) { GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder() - .setFamily(family == null ? null : family.toString()) - .build(); + .setFamily(family == null ? null : family.toString()) + .build(); return getFromFamilyImage(request); } @@ -537,10 +542,11 @@ public final Image getFromFamilyImage(ProjectFamilyName family) { /** * Returns the latest image that is part of an image family and is not deprecated. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]");
    *   Image response = imageClient.getFromFamilyImage(family.toString());
    * }
    * 
@@ -552,9 +558,7 @@ public final Image getFromFamilyImage(ProjectFamilyName family) { public final Image getFromFamilyImage(String family) { GetFromFamilyImageHttpRequest request = - GetFromFamilyImageHttpRequest.newBuilder() - .setFamily(family) - .build(); + GetFromFamilyImageHttpRequest.newBuilder().setFamily(family).build(); return getFromFamilyImage(request); } @@ -562,10 +566,11 @@ public final Image getFromFamilyImage(String family) { /** * Returns the latest image that is part of an image family and is not deprecated. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]");
    *   GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder()
    *     .setFamily(family.toString())
    *     .build();
@@ -585,10 +590,11 @@ public final Image getFromFamilyImage(GetFromFamilyImageHttpRequest request) {
   /**
    * Returns the latest image that is part of an image family and is not deprecated.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]");
+   *   ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]");
    *   GetFromFamilyImageHttpRequest request = GetFromFamilyImageHttpRequest.newBuilder()
    *     .setFamily(family.toString())
    *     .build();
@@ -607,7 +613,8 @@ public final UnaryCallable getFromFamilyIm
   /**
    * Creates an image in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
@@ -619,25 +626,31 @@ public final UnaryCallable getFromFamilyIm
    * 
* * @param forceCreate Force image creation if true. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==) + * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for + * v1.images ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertImage(Boolean forceCreate, String requestId, ProjectName project, Image imageResource) { + public final Operation insertImage( + Boolean forceCreate, String requestId, ProjectName project, Image imageResource) { InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder() - .setForceCreate(forceCreate) - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setImageResource(imageResource) - .build(); + .setForceCreate(forceCreate) + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setImageResource(imageResource) + .build(); return insertImage(request); } @@ -645,7 +658,8 @@ public final Operation insertImage(Boolean forceCreate, String requestId, Projec /** * Creates an image in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
@@ -657,25 +671,31 @@ public final Operation insertImage(Boolean forceCreate, String requestId, Projec
    * 
* * @param forceCreate Force image creation if true. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==) + * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for + * v1.images ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertImage(Boolean forceCreate, String requestId, String project, Image imageResource) { + public final Operation insertImage( + Boolean forceCreate, String requestId, String project, Image imageResource) { InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder() - .setForceCreate(forceCreate) - .setRequestId(requestId) - .setProject(project) - .setImageResource(imageResource) - .build(); + .setForceCreate(forceCreate) + .setRequestId(requestId) + .setProject(project) + .setImageResource(imageResource) + .build(); return insertImage(request); } @@ -683,7 +703,8 @@ public final Operation insertImage(Boolean forceCreate, String requestId, String /** * Creates an image in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
@@ -712,7 +733,8 @@ public final Operation insertImage(InsertImageHttpRequest request) {
   /**
    * Creates an image in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
@@ -738,9 +760,14 @@ public final UnaryCallable insertImageCallabl
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -757,16 +784,21 @@ public final UnaryCallable insertImageCallabl
   public final ListImagesPagedResponse listImages(ProjectName project) {
     ListImagesHttpRequest request =
         ListImagesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listImages(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -781,18 +813,20 @@ public final ListImagesPagedResponse listImages(ProjectName project) {
    */
   @BetaApi
   public final ListImagesPagedResponse listImages(String project) {
-    ListImagesHttpRequest request =
-        ListImagesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+    ListImagesHttpRequest request = ListImagesHttpRequest.newBuilder().setProject(project).build();
     return listImages(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -810,15 +844,19 @@ public final ListImagesPagedResponse listImages(String project) {
    */
   @BetaApi
   public final ListImagesPagedResponse listImages(ListImagesHttpRequest request) {
-    return listImagesPagedCallable()
-        .call(request);
+    return listImagesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -834,15 +872,21 @@ public final ListImagesPagedResponse listImages(ListImagesHttpRequest request) {
    * 
*/ @BetaApi - public final UnaryCallable listImagesPagedCallable() { + public final UnaryCallable + listImagesPagedCallable() { return stub.listImagesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -871,12 +915,14 @@ public final UnaryCallable listImagesCallable(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on an image. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = imageClient.setLabelsImage(resource, globalSetLabelsRequestResource);
    * }
@@ -887,24 +933,28 @@ public final UnaryCallable listImagesCallable(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setLabelsImage(ProjectImageName resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) {
+  public final Operation setLabelsImage(
+      ProjectGlobalImageResourceName resource,
+      GlobalSetLabelsRequest globalSetLabelsRequestResource) {
 
     SetLabelsImageHttpRequest request =
         SetLabelsImageHttpRequest.newBuilder()
-        .setResource(resource == null ? null : resource.toString())
-        .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
-        .build();
+            .setResource(resource == null ? null : resource.toString())
+            .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+            .build();
     return setLabelsImage(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on an image. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = imageClient.setLabelsImage(resource.toString(), globalSetLabelsRequestResource);
    * }
@@ -915,24 +965,27 @@ public final Operation setLabelsImage(ProjectImageName resource, GlobalSetLabels
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setLabelsImage(String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) {
+  public final Operation setLabelsImage(
+      String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) {
 
     SetLabelsImageHttpRequest request =
         SetLabelsImageHttpRequest.newBuilder()
-        .setResource(resource)
-        .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
-        .build();
+            .setResource(resource)
+            .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+            .build();
     return setLabelsImage(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on an image. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsImageHttpRequest request = SetLabelsImageHttpRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -952,12 +1005,14 @@ public final Operation setLabelsImage(SetLabelsImageHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on an image. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ImageClient imageClient = ImageClient.create()) {
-   *   ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsImageHttpRequest request = SetLabelsImageHttpRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -975,7 +1030,7 @@ public final UnaryCallable setLabelsImageC
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -1004,12 +1059,9 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListImagesPagedResponse extends AbstractPagedListResponse<
-      ListImagesHttpRequest,
-      ImageList,
-      Image,
-      ListImagesPage,
-      ListImagesFixedSizeCollection> {
+  public static class ListImagesPagedResponse
+      extends AbstractPagedListResponse<
+          ListImagesHttpRequest, ImageList, Image, ListImagesPage, ListImagesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -1029,19 +1081,13 @@ public ListImagesPagedResponse apply(ListImagesPage input) {
     private ListImagesPagedResponse(ListImagesPage page) {
       super(page, ListImagesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListImagesPage extends AbstractPage<
-      ListImagesHttpRequest,
-      ImageList,
-      Image,
-      ListImagesPage> {
+  public static class ListImagesPage
+      extends AbstractPage {
 
     private ListImagesPage(
-        PageContext context,
-        ImageList response) {
+        PageContext context, ImageList response) {
       super(context, response);
     }
 
@@ -1051,8 +1097,7 @@ private static ListImagesPage createEmptyPage() {
 
     @Override
     protected ListImagesPage createPage(
-        PageContext context,
-        ImageList response) {
+        PageContext context, ImageList response) {
       return new ListImagesPage(context, response);
     }
 
@@ -1062,18 +1107,11 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListImagesFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListImagesHttpRequest,
-      ImageList,
-      Image,
-      ListImagesPage,
-      ListImagesFixedSizeCollection> {
+  public static class ListImagesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListImagesHttpRequest, ImageList, Image, ListImagesPage, ListImagesFixedSizeCollection> {
 
     private ListImagesFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -1088,7 +1126,5 @@ protected ListImagesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListImagesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java
index ff414c3ef688..8fa51eaa64e3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private ImageList() {
     this.warning = null;
   }
 
-
   private ImageList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(ImageList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static ImageList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final ImageList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new ImageList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public ImageList build() {
 
-
-
-
-
-      return new ImageList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new ImageList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "ImageList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof ImageList) {
       ImageList that = (ImageList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java
index c434e2bafc60..3bcbb10f1c6d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java
@@ -15,45 +15,23 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse;
 import com.google.cloud.compute.v1.stub.ImageStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -62,15 +40,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteImage to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteImage to 30 seconds: * *

  * 
@@ -85,98 +63,73 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ImageSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteImage.
-   */
+  /** Returns the object with the settings used for calls to deleteImage. */
   public UnaryCallSettings deleteImageSettings() {
     return ((ImageStubSettings) getStubSettings()).deleteImageSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deprecateImage.
-   */
+  /** Returns the object with the settings used for calls to deprecateImage. */
   public UnaryCallSettings deprecateImageSettings() {
     return ((ImageStubSettings) getStubSettings()).deprecateImageSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getImage.
-   */
+  /** Returns the object with the settings used for calls to getImage. */
   public UnaryCallSettings getImageSettings() {
     return ((ImageStubSettings) getStubSettings()).getImageSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getFromFamilyImage.
-   */
+  /** Returns the object with the settings used for calls to getFromFamilyImage. */
   public UnaryCallSettings getFromFamilyImageSettings() {
     return ((ImageStubSettings) getStubSettings()).getFromFamilyImageSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertImage.
-   */
+  /** Returns the object with the settings used for calls to insertImage. */
   public UnaryCallSettings insertImageSettings() {
     return ((ImageStubSettings) getStubSettings()).insertImageSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listImages.
-   */
-  public PagedCallSettings listImagesSettings() {
+  /** Returns the object with the settings used for calls to listImages. */
+  public PagedCallSettings
+      listImagesSettings() {
     return ((ImageStubSettings) getStubSettings()).listImagesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsImage.
-   */
+  /** Returns the object with the settings used for calls to setLabelsImage. */
   public UnaryCallSettings setLabelsImageSettings() {
     return ((ImageStubSettings) getStubSettings()).setLabelsImageSettings();
   }
 
-
   public static final ImageSettings create(ImageStubSettings stub) throws IOException {
     return new ImageSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ImageStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return ImageStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return ImageStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return ImageStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return ImageStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ImageStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return ImageStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -189,23 +142,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ImageStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -214,9 +161,7 @@ protected ImageSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for ImageSettings.
-   */
+  /** Builder for ImageSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -238,67 +183,59 @@ protected Builder(ImageStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public ImageStubSettings.Builder getStubSettingsBuilder() {
       return ((ImageStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteImage. - */ + /** Returns the builder for the settings used for calls to deleteImage. */ public UnaryCallSettings.Builder deleteImageSettings() { return getStubSettingsBuilder().deleteImageSettings(); } - /** - * Returns the builder for the settings used for calls to deprecateImage. - */ - public UnaryCallSettings.Builder deprecateImageSettings() { + /** Returns the builder for the settings used for calls to deprecateImage. */ + public UnaryCallSettings.Builder + deprecateImageSettings() { return getStubSettingsBuilder().deprecateImageSettings(); } - /** - * Returns the builder for the settings used for calls to getImage. - */ + /** Returns the builder for the settings used for calls to getImage. */ public UnaryCallSettings.Builder getImageSettings() { return getStubSettingsBuilder().getImageSettings(); } - /** - * Returns the builder for the settings used for calls to getFromFamilyImage. - */ - public UnaryCallSettings.Builder getFromFamilyImageSettings() { + /** Returns the builder for the settings used for calls to getFromFamilyImage. */ + public UnaryCallSettings.Builder + getFromFamilyImageSettings() { return getStubSettingsBuilder().getFromFamilyImageSettings(); } - /** - * Returns the builder for the settings used for calls to insertImage. - */ + /** Returns the builder for the settings used for calls to insertImage. */ public UnaryCallSettings.Builder insertImageSettings() { return getStubSettingsBuilder().insertImageSettings(); } - /** - * Returns the builder for the settings used for calls to listImages. - */ - public PagedCallSettings.Builder listImagesSettings() { + /** Returns the builder for the settings used for calls to listImages. */ + public PagedCallSettings.Builder + listImagesSettings() { return getStubSettingsBuilder().listImagesSettings(); } - /** - * Returns the builder for the settings used for calls to setLabelsImage. - */ - public UnaryCallSettings.Builder setLabelsImageSettings() { + /** Returns the builder for the settings used for calls to setLabelsImage. */ + public UnaryCallSettings.Builder + setLabelsImageSettings() { return getStubSettingsBuilder().setLabelsImageSettings(); } @@ -307,4 +244,4 @@ public ImageSettings build() throws IOException { return new ImageSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java index fdfd9ff1d223..ea752693f8d2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertAddressHttpRequest() { this.userIp = null; } - private InsertAddressHttpRequest( String access_token, Address addressResource, @@ -67,8 +63,7 @@ private InsertAddressHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.addressResource = addressResource; this.callback = callback; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertAddressHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertAddressHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertAddressHttpRequest( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "addressResource=" + addressResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "addressResource=" + + addressResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertAddressHttpRequest) { InsertAddressHttpRequest that = (InsertAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.addressResource, that.getAddressResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.addressResource, that.getAddressResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java index 56d8d2285e85..6a96da87124d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertAutoscalerHttpRequest() { this.zone = null; } - private InsertAutoscalerHttpRequest( String access_token, Autoscaler autoscalerResource, @@ -67,8 +63,7 @@ private InsertAutoscalerHttpRequest( String quotaUser, String requestId, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.autoscalerResource = autoscalerResource; this.callback = callback; @@ -88,7 +83,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +194,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertAutoscalerHttpRequest(); } @@ -370,18 +368,9 @@ public Builder setZone(String zone) { return this; } - public InsertAutoscalerHttpRequest build() { String missing = ""; - - - - - - - - if (zone == null) { missing += " zone"; } @@ -389,17 +378,16 @@ public InsertAutoscalerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertAutoscalerHttpRequest( - access_token, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertAutoscalerHttpRequest) { InsertAutoscalerHttpRequest that = (InsertAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java index 6e790d55670e..42c4e361e50b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertBackendBucketHttpRequest() { this.userIp = null; } - private InsertBackendBucketHttpRequest( String access_token, BackendBucket backendBucketResource, @@ -67,8 +63,7 @@ private InsertBackendBucketHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendBucketResource = backendBucketResource; this.callback = callback; @@ -88,7 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { - fieldMap.put("backendBucketResource", Collections.singletonList(String.valueOf(backendBucketResource))); + fieldMap.put( + "backendBucketResource", + Collections.singletonList(String.valueOf(backendBucketResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertBackendBucketHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertBackendBucketHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertBackendBucketHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertBackendBucketHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertBackendBucketHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertBackendBucketHttpRequest( - access_token, - backendBucketResource, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertBackendBucketHttpRequest{" - + "access_token=" + access_token + ", " - + "backendBucketResource=" + backendBucketResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendBucketResource=" + + backendBucketResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertBackendBucketHttpRequest) { InsertBackendBucketHttpRequest that = (InsertBackendBucketHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendBucketResource, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java index 3688ba735208..42fcd7be40a2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertBackendServiceHttpRequest() { this.userIp = null; } - private InsertBackendServiceHttpRequest( String access_token, BackendService backendServiceResource, @@ -67,8 +63,7 @@ private InsertBackendServiceHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendServiceResource = backendServiceResource; this.callback = callback; @@ -88,7 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertBackendServiceHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertBackendServiceHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertBackendServiceHttpRequest( - access_token, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendServiceResource=" + backendServiceResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendServiceResource=" + + backendServiceResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertBackendServiceHttpRequest) { InsertBackendServiceHttpRequest that = (InsertBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java index 6d71e4c6928f..3b1b60e75f6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private InsertDiskHttpRequest() { this.zone = null; } - private InsertDiskHttpRequest( String access_token, String callback, @@ -70,8 +66,7 @@ private InsertDiskHttpRequest( String requestId, String sourceImage, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.diskResource = diskResource; @@ -212,22 +207,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertDiskHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertDiskHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertDiskHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertDiskHttpRequest(); } @@ -398,19 +395,9 @@ public Builder setZone(String zone) { return this; } - public InsertDiskHttpRequest build() { String missing = ""; - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -418,18 +405,17 @@ public InsertDiskHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertDiskHttpRequest( - access_token, - callback, - diskResource, - fields, - key, - prettyPrint, - quotaUser, - requestId, - sourceImage, - userIp, - zone - ); + access_token, + callback, + diskResource, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sourceImage, + userIp, + zone); } public Builder clone() { @@ -452,17 +438,38 @@ public Builder clone() { @Override public String toString() { return "InsertDiskHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "diskResource=" + diskResource + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "sourceImage=" + sourceImage + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "diskResource=" + + diskResource + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sourceImage=" + + sourceImage + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -473,19 +480,17 @@ public boolean equals(Object o) { } if (o instanceof InsertDiskHttpRequest) { InsertDiskHttpRequest that = (InsertDiskHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.diskResource, that.getDiskResource()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.sourceImage, that.getSourceImage()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.diskResource, that.getDiskResource()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sourceImage, that.getSourceImage()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -493,17 +498,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - diskResource, - fields, - key, - prettyPrint, - quotaUser, - requestId, - sourceImage, - userIp, - zone - ); + access_token, + callback, + diskResource, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sourceImage, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java index f5176afa87ae..83dc075807f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertFirewallHttpRequest() { this.userIp = null; } - private InsertFirewallHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertFirewallHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertFirewallHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertFirewallHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertFirewallHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertFirewallHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertFirewallHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertFirewallHttpRequest( - access_token, - callback, - fields, - firewallResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + firewallResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertFirewallHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "firewallResource=" + firewallResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "firewallResource=" + + firewallResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertFirewallHttpRequest) { InsertFirewallHttpRequest that = (InsertFirewallHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.firewallResource, that.getFirewallResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.firewallResource, that.getFirewallResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - firewallResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + firewallResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java index f2b9614e5a0b..b19b538ab343 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertForwardingRuleHttpRequest() { this.userIp = null; } - private InsertForwardingRuleHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertForwardingRuleHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { - fieldMap.put("forwardingRuleResource", Collections.singletonList(String.valueOf(forwardingRuleResource))); + fieldMap.put( + "forwardingRuleResource", + Collections.singletonList(String.valueOf(forwardingRuleResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertForwardingRuleHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertForwardingRuleHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRuleResource, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRuleResource=" + forwardingRuleResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRuleResource=" + + forwardingRuleResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertForwardingRuleHttpRequest) { InsertForwardingRuleHttpRequest that = (InsertForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRuleResource, that.getForwardingRuleResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRuleResource, that.getForwardingRuleResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRuleResource, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java index 84f5a9675d18..eabad11cacd9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertGlobalAddressHttpRequest() { this.userIp = null; } - private InsertGlobalAddressHttpRequest( String access_token, Address addressResource, @@ -67,8 +63,7 @@ private InsertGlobalAddressHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.addressResource = addressResource; this.callback = callback; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertGlobalAddressHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertGlobalAddressHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertGlobalAddressHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertGlobalAddressHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertGlobalAddressHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertGlobalAddressHttpRequest( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertGlobalAddressHttpRequest{" - + "access_token=" + access_token + ", " - + "addressResource=" + addressResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "addressResource=" + + addressResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertGlobalAddressHttpRequest) { InsertGlobalAddressHttpRequest that = (InsertGlobalAddressHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.addressResource, that.getAddressResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.addressResource, that.getAddressResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - addressResource, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + addressResource, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java index f573b501a552..88c75c705ec6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertGlobalForwardingRuleHttpRequest() { this.userIp = null; } - private InsertGlobalForwardingRuleHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertGlobalForwardingRuleHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { - fieldMap.put("forwardingRuleResource", Collections.singletonList(String.valueOf(forwardingRuleResource))); + fieldMap.put( + "forwardingRuleResource", + Collections.singletonList(String.valueOf(forwardingRuleResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertGlobalForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertGlobalForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertGlobalForwardingRuleHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertGlobalForwardingRuleHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertGlobalForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRuleResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertGlobalForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRuleResource=" + forwardingRuleResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRuleResource=" + + forwardingRuleResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertGlobalForwardingRuleHttpRequest) { InsertGlobalForwardingRuleHttpRequest that = (InsertGlobalForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRuleResource, that.getForwardingRuleResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRuleResource, that.getForwardingRuleResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRuleResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forwardingRuleResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java index 737d7b1bed13..54634df42917 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertHealthCheckHttpRequest() { this.userIp = null; } - private InsertHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertHealthCheckHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { - fieldMap.put("healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + fieldMap.put( + "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertHealthCheckHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertHealthCheckHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertHealthCheckHttpRequest( - access_token, - callback, - fields, - healthCheckResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheckResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "healthCheckResource=" + healthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "healthCheckResource=" + + healthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertHealthCheckHttpRequest) { InsertHealthCheckHttpRequest that = (InsertHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - healthCheckResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheckResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java index 0837aca326b2..57622c55347b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertHttpHealthCheckHttpRequest() { this.userIp = null; } - private InsertHttpHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertHttpHealthCheckHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { - fieldMap.put("httpHealthCheckResource", Collections.singletonList(String.valueOf(httpHealthCheckResource))); + fieldMap.put( + "httpHealthCheckResource", + Collections.singletonList(String.valueOf(httpHealthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertHttpHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertHttpHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertHttpHealthCheckHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertHttpHealthCheckHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertHttpHealthCheckHttpRequest( - access_token, - callback, - fields, - httpHealthCheckResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertHttpHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpHealthCheckResource=" + httpHealthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpHealthCheckResource=" + + httpHealthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertHttpHealthCheckHttpRequest) { InsertHttpHealthCheckHttpRequest that = (InsertHttpHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpHealthCheckResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java index 689b3442fa3f..3ea591eb9fe7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertHttpsHealthCheckHttpRequest() { this.userIp = null; } - private InsertHttpsHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertHttpsHealthCheckHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { - fieldMap.put("httpsHealthCheckResource", Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + fieldMap.put( + "httpsHealthCheckResource", + Collections.singletonList(String.valueOf(httpsHealthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertHttpsHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertHttpsHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertHttpsHealthCheckHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertHttpsHealthCheckHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertHttpsHealthCheckHttpRequest( - access_token, - callback, - fields, - httpsHealthCheckResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertHttpsHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpsHealthCheckResource=" + httpsHealthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpsHealthCheckResource=" + + httpsHealthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertHttpsHealthCheckHttpRequest) { InsertHttpsHealthCheckHttpRequest that = (InsertHttpsHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpsHealthCheckResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheckResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java index df46f604cd5d..85e548a840ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private InsertImageHttpRequest() { this.userIp = null; } - private InsertImageHttpRequest( String access_token, String callback, @@ -70,8 +66,7 @@ private InsertImageHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -212,22 +207,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertImageHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertImageHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertImageHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertImageHttpRequest(); } @@ -398,38 +395,28 @@ public Builder setUserIp(String userIp) { return this; } - public InsertImageHttpRequest build() { String missing = ""; - - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertImageHttpRequest( - access_token, - callback, - fields, - forceCreate, - imageResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forceCreate, + imageResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -452,17 +439,38 @@ public Builder clone() { @Override public String toString() { return "InsertImageHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forceCreate=" + forceCreate + ", " - + "imageResource=" + imageResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forceCreate=" + + forceCreate + + ", " + + "imageResource=" + + imageResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -473,19 +481,17 @@ public boolean equals(Object o) { } if (o instanceof InsertImageHttpRequest) { InsertImageHttpRequest that = (InsertImageHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forceCreate, that.getForceCreate()) && - Objects.equals(this.imageResource, that.getImageResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forceCreate, that.getForceCreate()) + && Objects.equals(this.imageResource, that.getImageResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -493,17 +499,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forceCreate, - imageResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + forceCreate, + imageResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java index 41eb5994c2f1..e164d6cae1b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertInstanceGroupHttpRequest() { this.zone = null; } - private InsertInstanceGroupHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertInstanceGroupHttpRequest( String quotaUser, String requestId, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupResource") && instanceGroupResource != null) { - fieldMap.put("instanceGroupResource", Collections.singletonList(String.valueOf(instanceGroupResource))); + fieldMap.put( + "instanceGroupResource", + Collections.singletonList(String.valueOf(instanceGroupResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInstanceGroupHttpRequest(); } @@ -370,18 +369,9 @@ public Builder setZone(String zone) { return this; } - public InsertInstanceGroupHttpRequest build() { String missing = ""; - - - - - - - - if (zone == null) { missing += " zone"; } @@ -389,17 +379,16 @@ public InsertInstanceGroupHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroupResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + callback, + fields, + instanceGroupResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupResource=" + instanceGroupResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupResource=" + + instanceGroupResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertInstanceGroupHttpRequest) { InsertInstanceGroupHttpRequest that = (InsertInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupResource, that.getInstanceGroupResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupResource, that.getInstanceGroupResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + callback, + fields, + instanceGroupResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java index de032f11e807..57a03d1b5920 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertInstanceGroupManagerHttpRequest() { this.zone = null; } - private InsertInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertInstanceGroupManagerHttpRequest( String quotaUser, String requestId, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -93,8 +88,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("instanceGroupManagerResource") && instanceGroupManagerResource != null) { - fieldMap.put("instanceGroupManagerResource", Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + if (fieldNames.contains("instanceGroupManagerResource") + && instanceGroupManagerResource != null) { + fieldMap.put( + "instanceGroupManagerResource", + Collections.singletonList(String.valueOf(instanceGroupManagerResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInstanceGroupManagerHttpRequest(); } @@ -311,7 +311,8 @@ public InstanceGroupManager getInstanceGroupManagerResource() { return instanceGroupManagerResource; } - public Builder setInstanceGroupManagerResource(InstanceGroupManager instanceGroupManagerResource) { + public Builder setInstanceGroupManagerResource( + InstanceGroupManager instanceGroupManagerResource) { this.instanceGroupManagerResource = instanceGroupManagerResource; return this; } @@ -370,18 +371,9 @@ public Builder setZone(String zone) { return this; } - public InsertInstanceGroupManagerHttpRequest build() { String missing = ""; - - - - - - - - if (zone == null) { missing += " zone"; } @@ -389,17 +381,16 @@ public InsertInstanceGroupManagerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } public Builder clone() { @@ -421,16 +412,35 @@ public Builder clone() { @Override public String toString() { return "InsertInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManagerResource=" + instanceGroupManagerResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManagerResource=" + + instanceGroupManagerResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -441,18 +451,17 @@ public boolean equals(Object o) { } if (o instanceof InsertInstanceGroupManagerHttpRequest) { InsertInstanceGroupManagerHttpRequest that = (InsertInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -460,16 +469,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java index ff25d86de933..fcff5ddf431b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,6 +37,7 @@ public final class InsertInstanceHttpRequest implements ApiMessage { private final String prettyPrint; private final String quotaUser; private final String requestId; + private final String sourceInstanceTemplate; private final String userIp; private final String zone; @@ -52,11 +50,11 @@ private InsertInstanceHttpRequest() { this.prettyPrint = null; this.quotaUser = null; this.requestId = null; + this.sourceInstanceTemplate = null; this.userIp = null; this.zone = null; } - private InsertInstanceHttpRequest( String access_token, String callback, @@ -66,9 +64,9 @@ private InsertInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, + String sourceInstanceTemplate, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -77,6 +75,7 @@ private InsertInstanceHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; + this.sourceInstanceTemplate = sourceInstanceTemplate; this.userIp = userIp; this.zone = zone; } @@ -108,6 +107,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } + if (fieldNames.contains("sourceInstanceTemplate") && sourceInstanceTemplate != null) { + fieldMap.put( + "sourceInstanceTemplate", + Collections.singletonList(String.valueOf(sourceInstanceTemplate))); + } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } @@ -143,6 +147,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("requestId")) { return String.valueOf(requestId); } + if (fieldName.equals("sourceInstanceTemplate")) { + return String.valueOf(sourceInstanceTemplate); + } if (fieldName.equals("userIp")) { return String.valueOf(userIp); } @@ -190,6 +197,10 @@ public String getRequestId() { return requestId; } + public String getSourceInstanceTemplate() { + return sourceInstanceTemplate; + } + public String getUserIp() { return userIp; } @@ -198,22 +209,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInstanceHttpRequest(); } @@ -227,6 +240,7 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String requestId; + private String sourceInstanceTemplate; private String userIp; private String zone; @@ -258,6 +272,9 @@ public Builder mergeFrom(InsertInstanceHttpRequest other) { if (other.getRequestId() != null) { this.requestId = other.requestId; } + if (other.getSourceInstanceTemplate() != null) { + this.sourceInstanceTemplate = other.sourceInstanceTemplate; + } if (other.getUserIp() != null) { this.userIp = other.userIp; } @@ -276,6 +293,7 @@ public Builder mergeFrom(InsertInstanceHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; + this.sourceInstanceTemplate = source.sourceInstanceTemplate; this.userIp = source.userIp; this.zone = source.zone; } @@ -352,6 +370,15 @@ public Builder setRequestId(String requestId) { return this; } + public String getSourceInstanceTemplate() { + return sourceInstanceTemplate; + } + + public Builder setSourceInstanceTemplate(String sourceInstanceTemplate) { + this.sourceInstanceTemplate = sourceInstanceTemplate; + return this; + } + public String getUserIp() { return userIp; } @@ -370,18 +397,9 @@ public Builder setZone(String zone) { return this; } - public InsertInstanceHttpRequest build() { String missing = ""; - - - - - - - - if (zone == null) { missing += " zone"; } @@ -389,17 +407,17 @@ public InsertInstanceHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInstanceHttpRequest( - access_token, - callback, - fields, - instanceResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + callback, + fields, + instanceResource, + key, + prettyPrint, + quotaUser, + requestId, + sourceInstanceTemplate, + userIp, + zone); } public Builder clone() { @@ -412,6 +430,7 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); + newBuilder.setSourceInstanceTemplate(this.sourceInstanceTemplate); newBuilder.setUserIp(this.userIp); newBuilder.setZone(this.zone); return newBuilder; @@ -421,16 +440,38 @@ public Builder clone() { @Override public String toString() { return "InsertInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceResource=" + instanceResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceResource=" + + instanceResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sourceInstanceTemplate=" + + sourceInstanceTemplate + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -441,18 +482,17 @@ public boolean equals(Object o) { } if (o instanceof InsertInstanceHttpRequest) { InsertInstanceHttpRequest that = (InsertInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceResource, that.getInstanceResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceResource, that.getInstanceResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sourceInstanceTemplate, that.getSourceInstanceTemplate()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -460,16 +500,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + callback, + fields, + instanceResource, + key, + prettyPrint, + quotaUser, + requestId, + sourceInstanceTemplate, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java index 849fe15275df..f63f92b4f8ad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertInstanceTemplateHttpRequest() { this.userIp = null; } - private InsertInstanceTemplateHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertInstanceTemplateHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceTemplateResource") && instanceTemplateResource != null) { - fieldMap.put("instanceTemplateResource", Collections.singletonList(String.valueOf(instanceTemplateResource))); + fieldMap.put( + "instanceTemplateResource", + Collections.singletonList(String.valueOf(instanceTemplateResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInstanceTemplateHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInstanceTemplateHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInstanceTemplateHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInstanceTemplateHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertInstanceTemplateHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInstanceTemplateHttpRequest( - access_token, - callback, - fields, - instanceTemplateResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceTemplateResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertInstanceTemplateHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceTemplateResource=" + instanceTemplateResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceTemplateResource=" + + instanceTemplateResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertInstanceTemplateHttpRequest) { InsertInstanceTemplateHttpRequest that = (InsertInstanceTemplateHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceTemplateResource, that.getInstanceTemplateResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceTemplateResource, that.getInstanceTemplateResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceTemplateResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceTemplateResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java index 9636ed39c80e..a8ac39739e70 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertInterconnectAttachmentHttpRequest() { this.userIp = null; } - private InsertInterconnectAttachmentHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertInterconnectAttachmentHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -93,8 +88,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("interconnectAttachmentResource") && interconnectAttachmentResource != null) { - fieldMap.put("interconnectAttachmentResource", Collections.singletonList(String.valueOf(interconnectAttachmentResource))); + if (fieldNames.contains("interconnectAttachmentResource") + && interconnectAttachmentResource != null) { + fieldMap.put( + "interconnectAttachmentResource", + Collections.singletonList(String.valueOf(interconnectAttachmentResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInterconnectAttachmentHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInterconnectAttachmentHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInterconnectAttachmentHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInterconnectAttachmentHttpRequest(); } @@ -311,7 +311,8 @@ public InterconnectAttachment getInterconnectAttachmentResource() { return interconnectAttachmentResource; } - public Builder setInterconnectAttachmentResource(InterconnectAttachment interconnectAttachmentResource) { + public Builder setInterconnectAttachmentResource( + InterconnectAttachment interconnectAttachmentResource) { this.interconnectAttachmentResource = interconnectAttachmentResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertInterconnectAttachmentHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInterconnectAttachmentHttpRequest( - access_token, - callback, - fields, - interconnectAttachmentResource, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnectAttachmentResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "InsertInterconnectAttachmentHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnectAttachmentResource=" + interconnectAttachmentResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnectAttachmentResource=" + + interconnectAttachmentResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +452,17 @@ public boolean equals(Object o) { } if (o instanceof InsertInterconnectAttachmentHttpRequest) { InsertInterconnectAttachmentHttpRequest that = (InsertInterconnectAttachmentHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnectAttachmentResource, that.getInterconnectAttachmentResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.interconnectAttachmentResource, that.getInterconnectAttachmentResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +470,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnectAttachmentResource, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnectAttachmentResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java index 33083f62f13c..9ddb8551c356 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertInterconnectHttpRequest() { this.userIp = null; } - private InsertInterconnectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertInterconnectHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("interconnectResource") && interconnectResource != null) { - fieldMap.put("interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); + fieldMap.put( + "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertInterconnectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertInterconnectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertInterconnectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertInterconnectHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertInterconnectHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertInterconnectHttpRequest( - access_token, - callback, - fields, - interconnectResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnectResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertInterconnectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnectResource=" + interconnectResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnectResource=" + + interconnectResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertInterconnectHttpRequest) { InsertInterconnectHttpRequest that = (InsertInterconnectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnectResource, that.getInterconnectResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnectResource, that.getInterconnectResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnectResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnectResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java new file mode 100644 index 000000000000..fe43d76ababc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java @@ -0,0 +1,479 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertLicenseHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final License licenseResource; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private InsertLicenseHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.licenseResource = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private InsertLicenseHttpRequest( + String access_token, + String callback, + String fields, + String key, + License licenseResource, + String prettyPrint, + String project, + String quotaUser, + String requestId, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.licenseResource = licenseResource; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("licenseResource") && licenseResource != null) { + fieldMap.put("licenseResource", Collections.singletonList(String.valueOf(licenseResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("licenseResource")) { + return String.valueOf(licenseResource); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public License getApiMessageRequestBody() { + return licenseResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public License getLicenseResource() { + return licenseResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(InsertLicenseHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertLicenseHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final InsertLicenseHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new InsertLicenseHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private License licenseResource; + private String prettyPrint; + private String project; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertLicenseHttpRequest other) { + if (other == InsertLicenseHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getLicenseResource() != null) { + this.licenseResource = other.licenseResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertLicenseHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.licenseResource = source.licenseResource; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public License getLicenseResource() { + return licenseResource; + } + + public Builder setLicenseResource(License licenseResource) { + this.licenseResource = licenseResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public InsertLicenseHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertLicenseHttpRequest( + access_token, + callback, + fields, + key, + licenseResource, + prettyPrint, + project, + quotaUser, + requestId, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setLicenseResource(this.licenseResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertLicenseHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "licenseResource=" + + licenseResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertLicenseHttpRequest) { + InsertLicenseHttpRequest that = (InsertLicenseHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.licenseResource, that.getLicenseResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + licenseResource, + prettyPrint, + project, + quotaUser, + requestId, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java index 921d6fe924b4..c3f9aa063165 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertNetworkHttpRequest() { this.userIp = null; } - private InsertNetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertNetworkHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertNetworkHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertNetworkHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertNetworkHttpRequest( - access_token, - callback, - fields, - key, - networkResource, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + networkResource, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "networkResource=" + networkResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "networkResource=" + + networkResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertNetworkHttpRequest) { InsertNetworkHttpRequest that = (InsertNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.networkResource, that.getNetworkResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.networkResource, that.getNetworkResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - networkResource, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + networkResource, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java index 19d9cb11d313..596244b18249 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertRegionAutoscalerHttpRequest() { this.userIp = null; } - private InsertRegionAutoscalerHttpRequest( String access_token, Autoscaler autoscalerResource, @@ -67,8 +63,7 @@ private InsertRegionAutoscalerHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscalerResource = autoscalerResource; this.callback = callback; @@ -88,7 +83,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertRegionAutoscalerHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertRegionAutoscalerHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertRegionAutoscalerHttpRequest( - access_token, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertRegionAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertRegionAutoscalerHttpRequest) { InsertRegionAutoscalerHttpRequest that = (InsertRegionAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java index 3810eeae9bae..99e8a70e4722 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertRegionBackendServiceHttpRequest() { this.userIp = null; } - private InsertRegionBackendServiceHttpRequest( String access_token, BackendService backendServiceResource, @@ -67,8 +63,7 @@ private InsertRegionBackendServiceHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendServiceResource = backendServiceResource; this.callback = callback; @@ -88,7 +83,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertRegionBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertRegionBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertRegionBackendServiceHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertRegionBackendServiceHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertRegionBackendServiceHttpRequest( - access_token, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertRegionBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendServiceResource=" + backendServiceResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendServiceResource=" + + backendServiceResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertRegionBackendServiceHttpRequest) { InsertRegionBackendServiceHttpRequest that = (InsertRegionBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java index 1107014d9769..b20ba9542536 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertRegionCommitmentHttpRequest() { this.userIp = null; } - private InsertRegionCommitmentHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertRegionCommitmentHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.commitmentResource = commitmentResource; @@ -91,7 +86,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); } if (fieldNames.contains("commitmentResource") && commitmentResource != null) { - fieldMap.put("commitmentResource", Collections.singletonList(String.valueOf(commitmentResource))); + fieldMap.put( + "commitmentResource", Collections.singletonList(String.valueOf(commitmentResource))); } if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertRegionCommitmentHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertRegionCommitmentHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertRegionCommitmentHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertRegionCommitmentHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertRegionCommitmentHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertRegionCommitmentHttpRequest( - access_token, - callback, - commitmentResource, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + commitmentResource, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertRegionCommitmentHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "commitmentResource=" + commitmentResource + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "commitmentResource=" + + commitmentResource + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertRegionCommitmentHttpRequest) { InsertRegionCommitmentHttpRequest that = (InsertRegionCommitmentHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.commitmentResource, that.getCommitmentResource()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.commitmentResource, that.getCommitmentResource()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - commitmentResource, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + commitmentResource, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java index 33ac3d02d1ca..7f446083c85b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private InsertRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertRegionInstanceGroupManagerHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -93,8 +88,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("instanceGroupManagerResource") && instanceGroupManagerResource != null) { - fieldMap.put("instanceGroupManagerResource", Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + if (fieldNames.contains("instanceGroupManagerResource") + && instanceGroupManagerResource != null) { + fieldMap.put( + "instanceGroupManagerResource", + Collections.singletonList(String.valueOf(instanceGroupManagerResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertRegionInstanceGroupManagerHttpRequest(); } @@ -311,7 +311,8 @@ public InstanceGroupManager getInstanceGroupManagerResource() { return instanceGroupManagerResource; } - public Builder setInstanceGroupManagerResource(InstanceGroupManager instanceGroupManagerResource) { + public Builder setInstanceGroupManagerResource( + InstanceGroupManager instanceGroupManagerResource) { this.instanceGroupManagerResource = instanceGroupManagerResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "InsertRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManagerResource=" + instanceGroupManagerResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManagerResource=" + + instanceGroupManagerResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +451,19 @@ public boolean equals(Object o) { return true; } if (o instanceof InsertRegionInstanceGroupManagerHttpRequest) { - InsertRegionInstanceGroupManagerHttpRequest that = (InsertRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + InsertRegionInstanceGroupManagerHttpRequest that = + (InsertRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +471,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManagerResource, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java index 329fa3c40959..15c2d58f3f02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertRouteHttpRequest() { this.userIp = null; } - private InsertRouteHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertRouteHttpRequest( String quotaUser, String requestId, Route routeResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertRouteHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertRouteHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertRouteHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertRouteHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertRouteHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertRouteHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - routeResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + routeResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertRouteHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "routeResource=" + routeResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "routeResource=" + + routeResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertRouteHttpRequest) { InsertRouteHttpRequest that = (InsertRouteHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.routeResource, that.getRouteResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.routeResource, that.getRouteResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - routeResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + routeResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java index 278c16212e76..9224aaeac65e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertRouterHttpRequest() { this.userIp = null; } - private InsertRouterHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertRouterHttpRequest( String region, String requestId, Router routerResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertRouterHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertRouterHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + routerResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "routerResource=" + routerResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "routerResource=" + + routerResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertRouterHttpRequest) { InsertRouterHttpRequest that = (InsertRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.routerResource, that.getRouterResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.routerResource, that.getRouterResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + routerResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java index 58242f848c52..d24619b7bdc8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertSslCertificateHttpRequest() { this.userIp = null; } - private InsertSslCertificateHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertSslCertificateHttpRequest( String quotaUser, String requestId, SslCertificate sslCertificateResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("sslCertificateResource") && sslCertificateResource != null) { - fieldMap.put("sslCertificateResource", Collections.singletonList(String.valueOf(sslCertificateResource))); + fieldMap.put( + "sslCertificateResource", + Collections.singletonList(String.valueOf(sslCertificateResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertSslCertificateHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertSslCertificateHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertSslCertificateHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertSslCertificateHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertSslCertificateHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertSslCertificateHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - sslCertificateResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + sslCertificateResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertSslCertificateHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "sslCertificateResource=" + sslCertificateResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslCertificateResource=" + + sslCertificateResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertSslCertificateHttpRequest) { InsertSslCertificateHttpRequest that = (InsertSslCertificateHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.sslCertificateResource, that.getSslCertificateResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslCertificateResource, that.getSslCertificateResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - sslCertificateResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + sslCertificateResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java new file mode 100644 index 000000000000..dedc433cbc2c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java @@ -0,0 +1,480 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertSslPolicyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String requestId; + private final SslPolicy sslPolicyResource; + private final String userIp; + + private InsertSslPolicyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.requestId = null; + this.sslPolicyResource = null; + this.userIp = null; + } + + private InsertSslPolicyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + String quotaUser, + String requestId, + SslPolicy sslPolicyResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.sslPolicyResource = sslPolicyResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) { + fieldMap.put( + "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("sslPolicyResource")) { + return String.valueOf(sslPolicyResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public SslPolicy getApiMessageRequestBody() { + return sslPolicyResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public SslPolicy getSslPolicyResource() { + return sslPolicyResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(InsertSslPolicyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertSslPolicyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final InsertSslPolicyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new InsertSslPolicyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private String quotaUser; + private String requestId; + private SslPolicy sslPolicyResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertSslPolicyHttpRequest other) { + if (other == InsertSslPolicyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSslPolicyResource() != null) { + this.sslPolicyResource = other.sslPolicyResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertSslPolicyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.sslPolicyResource = source.sslPolicyResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public SslPolicy getSslPolicyResource() { + return sslPolicyResource; + } + + public Builder setSslPolicyResource(SslPolicy sslPolicyResource) { + this.sslPolicyResource = sslPolicyResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public InsertSslPolicyHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertSslPolicyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + sslPolicyResource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSslPolicyResource(this.sslPolicyResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertSslPolicyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslPolicyResource=" + + sslPolicyResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertSslPolicyHttpRequest) { + InsertSslPolicyHttpRequest that = (InsertSslPolicyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslPolicyResource, that.getSslPolicyResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + sslPolicyResource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java index 3f40e3f46e99..98bec8e85e85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertSubnetworkHttpRequest() { this.userIp = null; } - private InsertSubnetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertSubnetworkHttpRequest( String region, String requestId, Subnetwork subnetworkResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { - fieldMap.put("subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); + fieldMap.put( + "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertSubnetworkHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertSubnetworkHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - subnetworkResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + subnetworkResource, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "subnetworkResource=" + subnetworkResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "subnetworkResource=" + + subnetworkResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertSubnetworkHttpRequest) { InsertSubnetworkHttpRequest that = (InsertSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - subnetworkResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + subnetworkResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java index 250d84a91ab2..f001e2403a26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetHttpProxyHttpRequest() { this.userIp = null; } - private InsertTargetHttpProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetHttpProxyHttpRequest( String quotaUser, String requestId, TargetHttpProxy targetHttpProxyResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetHttpProxyResource") && targetHttpProxyResource != null) { - fieldMap.put("targetHttpProxyResource", Collections.singletonList(String.valueOf(targetHttpProxyResource))); + fieldMap.put( + "targetHttpProxyResource", + Collections.singletonList(String.valueOf(targetHttpProxyResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetHttpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetHttpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetHttpProxyHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertTargetHttpProxyHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetHttpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetHttpProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetHttpProxyResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetHttpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpProxyResource=" + targetHttpProxyResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpProxyResource=" + + targetHttpProxyResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetHttpProxyHttpRequest) { InsertTargetHttpProxyHttpRequest that = (InsertTargetHttpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpProxyResource, that.getTargetHttpProxyResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetHttpProxyResource, that.getTargetHttpProxyResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetHttpProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetHttpProxyResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java index 5b6c5d2e9009..2e357705b953 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetHttpsProxyHttpRequest() { this.userIp = null; } - private InsertTargetHttpsProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetHttpsProxyHttpRequest( String quotaUser, String requestId, TargetHttpsProxy targetHttpsProxyResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetHttpsProxyResource") && targetHttpsProxyResource != null) { - fieldMap.put("targetHttpsProxyResource", Collections.singletonList(String.valueOf(targetHttpsProxyResource))); + fieldMap.put( + "targetHttpsProxyResource", + Collections.singletonList(String.valueOf(targetHttpsProxyResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetHttpsProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetHttpsProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetHttpsProxyHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertTargetHttpsProxyHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetHttpsProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetHttpsProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetHttpsProxyResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetHttpsProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpsProxyResource=" + targetHttpsProxyResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpsProxyResource=" + + targetHttpsProxyResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetHttpsProxyHttpRequest) { InsertTargetHttpsProxyHttpRequest that = (InsertTargetHttpsProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpsProxyResource, that.getTargetHttpsProxyResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetHttpsProxyResource, that.getTargetHttpsProxyResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetHttpsProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetHttpsProxyResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java index 44c862b55350..bfaa6abf741b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetInstanceHttpRequest() { this.zone = null; } - private InsertTargetInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetInstanceHttpRequest( String requestId, TargetInstance targetInstanceResource, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -106,7 +101,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetInstanceResource") && targetInstanceResource != null) { - fieldMap.put("targetInstanceResource", Collections.singletonList(String.valueOf(targetInstanceResource))); + fieldMap.put( + "targetInstanceResource", + Collections.singletonList(String.valueOf(targetInstanceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetInstanceHttpRequest(); } @@ -370,18 +369,9 @@ public Builder setZone(String zone) { return this; } - public InsertTargetInstanceHttpRequest build() { String missing = ""; - - - - - - - - if (zone == null) { missing += " zone"; } @@ -389,17 +379,16 @@ public InsertTargetInstanceHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetInstanceHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetInstanceResource, - userIp, - zone - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetInstanceResource, + userIp, + zone); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetInstanceResource=" + targetInstanceResource + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetInstanceResource=" + + targetInstanceResource + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetInstanceHttpRequest) { InsertTargetInstanceHttpRequest that = (InsertTargetInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetInstanceResource, that.getTargetInstanceResource()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetInstanceResource, that.getTargetInstanceResource()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetInstanceResource, - userIp, - zone - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetInstanceResource, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java index a1f40f273f35..c42a2c6d5718 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetPoolHttpRequest() { this.userIp = null; } - private InsertTargetPoolHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetPoolHttpRequest( String region, String requestId, TargetPool targetPoolResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetPoolResource") && targetPoolResource != null) { - fieldMap.put("targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource))); + fieldMap.put( + "targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetPoolHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertTargetPoolHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - targetPoolResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + targetPoolResource, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "targetPoolResource=" + targetPoolResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "targetPoolResource=" + + targetPoolResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetPoolHttpRequest) { InsertTargetPoolHttpRequest that = (InsertTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPoolResource, that.getTargetPoolResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPoolResource, that.getTargetPoolResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - targetPoolResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + targetPoolResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java index a6a4653c6477..7ca1cfa1fd4d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetSslProxyHttpRequest() { this.userIp = null; } - private InsertTargetSslProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetSslProxyHttpRequest( String quotaUser, String requestId, TargetSslProxy targetSslProxyResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetSslProxyResource") && targetSslProxyResource != null) { - fieldMap.put("targetSslProxyResource", Collections.singletonList(String.valueOf(targetSslProxyResource))); + fieldMap.put( + "targetSslProxyResource", + Collections.singletonList(String.valueOf(targetSslProxyResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetSslProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetSslProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetSslProxyHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertTargetSslProxyHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetSslProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetSslProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetSslProxyResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetSslProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetSslProxyResource=" + targetSslProxyResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetSslProxyResource=" + + targetSslProxyResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetSslProxyHttpRequest) { InsertTargetSslProxyHttpRequest that = (InsertTargetSslProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetSslProxyResource, that.getTargetSslProxyResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetSslProxyResource, that.getTargetSslProxyResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetSslProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetSslProxyResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java index 939e6fd0748b..bebf9bf2660e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetTcpProxyHttpRequest() { this.userIp = null; } - private InsertTargetTcpProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetTcpProxyHttpRequest( String quotaUser, String requestId, TargetTcpProxy targetTcpProxyResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetTcpProxyResource") && targetTcpProxyResource != null) { - fieldMap.put("targetTcpProxyResource", Collections.singletonList(String.valueOf(targetTcpProxyResource))); + fieldMap.put( + "targetTcpProxyResource", + Collections.singletonList(String.valueOf(targetTcpProxyResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetTcpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetTcpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetTcpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetTcpProxyHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertTargetTcpProxyHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetTcpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetTcpProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetTcpProxyResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetTcpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetTcpProxyResource=" + targetTcpProxyResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetTcpProxyResource=" + + targetTcpProxyResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetTcpProxyHttpRequest) { InsertTargetTcpProxyHttpRequest that = (InsertTargetTcpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetTcpProxyResource, that.getTargetTcpProxyResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetTcpProxyResource, that.getTargetTcpProxyResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - targetTcpProxyResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + targetTcpProxyResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java index f87b47926198..33eea30cd206 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertTargetVpnGatewayHttpRequest() { this.userIp = null; } - private InsertTargetVpnGatewayHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertTargetVpnGatewayHttpRequest( String region, String requestId, TargetVpnGateway targetVpnGatewayResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetVpnGatewayResource") && targetVpnGatewayResource != null) { - fieldMap.put("targetVpnGatewayResource", Collections.singletonList(String.valueOf(targetVpnGatewayResource))); + fieldMap.put( + "targetVpnGatewayResource", + Collections.singletonList(String.valueOf(targetVpnGatewayResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertTargetVpnGatewayHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertTargetVpnGatewayHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertTargetVpnGatewayHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertTargetVpnGatewayHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertTargetVpnGatewayHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertTargetVpnGatewayHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - targetVpnGatewayResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + targetVpnGatewayResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "InsertTargetVpnGatewayHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "targetVpnGatewayResource=" + targetVpnGatewayResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "targetVpnGatewayResource=" + + targetVpnGatewayResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof InsertTargetVpnGatewayHttpRequest) { InsertTargetVpnGatewayHttpRequest that = (InsertTargetVpnGatewayHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetVpnGatewayResource, that.getTargetVpnGatewayResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetVpnGatewayResource, that.getTargetVpnGatewayResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - targetVpnGatewayResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + targetVpnGatewayResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java index 2b24f4e1311d..f6a4a3a1ac2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertUrlMapHttpRequest() { this.userIp = null; } - private InsertUrlMapHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertUrlMapHttpRequest( String quotaUser, String requestId, UrlMap urlMapResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertUrlMapHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public InsertUrlMapHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + urlMapResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "InsertUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "urlMapResource=" + urlMapResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "urlMapResource=" + + urlMapResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof InsertUrlMapHttpRequest) { InsertUrlMapHttpRequest that = (InsertUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.urlMapResource, that.getUrlMapResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.urlMapResource, that.getUrlMapResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + urlMapResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java index e01cf410bc14..fb7470850b13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InsertVpnTunnelHttpRequest() { this.vpnTunnelResource = null; } - private InsertVpnTunnelHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private InsertVpnTunnelHttpRequest( String region, String requestId, String userIp, - VpnTunnel vpnTunnelResource - ) { + VpnTunnel vpnTunnelResource) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -112,7 +107,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) { - fieldMap.put("vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); + fieldMap.put( + "vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); } return fieldMap; } @@ -198,22 +194,24 @@ public VpnTunnel getVpnTunnelResource() { return vpnTunnelResource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InsertVpnTunnelHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InsertVpnTunnelHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InsertVpnTunnelHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InsertVpnTunnelHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setVpnTunnelResource(VpnTunnel vpnTunnelResource) { return this; } - public InsertVpnTunnelHttpRequest build() { String missing = ""; - - - - - if (region == null) { missing += " region"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new InsertVpnTunnelHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp, - vpnTunnelResource - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp, + vpnTunnelResource); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "InsertVpnTunnelHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "vpnTunnelResource=" + vpnTunnelResource + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "vpnTunnelResource=" + + vpnTunnelResource + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof InsertVpnTunnelHttpRequest) { InsertVpnTunnelHttpRequest that = (InsertVpnTunnelHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.vpnTunnelResource, that.getVpnTunnelResource()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp, - vpnTunnelResource - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp, + vpnTunnelResource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java index f6287c7d4f11..3dae75547c94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -84,7 +83,6 @@ private Instance() { this.zone = null; } - private Instance( Boolean canIpForward, String cpuPlatform, @@ -109,8 +107,7 @@ private Instance( String status, String statusMessage, Tags tags, - String zone - ) { + String zone) { this.canIpForward = canIpForward; this.cpuPlatform = cpuPlatform; this.creationTimestamp = creationTimestamp; @@ -147,10 +144,12 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("cpuPlatform", Collections.singletonList(String.valueOf(cpuPlatform))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("deletionProtection") && deletionProtection != null) { - fieldMap.put("deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); + fieldMap.put( + "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -410,22 +409,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Instance prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Instance getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Instance DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Instance(); } @@ -810,57 +811,33 @@ public Builder setZone(String zone) { return this; } - public Instance build() { - - - - - - - - - - - - - - - - - - - - - - return new Instance( - canIpForward, - cpuPlatform, - creationTimestamp, - deletionProtection, - description, - disks, - guestAccelerators, - id, - kind, - labelFingerprint, - labels, - machineType, - metadata, - minCpuPlatform, - name, - networkInterfaces, - scheduling, - selfLink, - serviceAccounts, - startRestricted, - status, - statusMessage, - tags, - zone - ); + canIpForward, + cpuPlatform, + creationTimestamp, + deletionProtection, + description, + disks, + guestAccelerators, + id, + kind, + labelFingerprint, + labels, + machineType, + metadata, + minCpuPlatform, + name, + networkInterfaces, + scheduling, + selfLink, + serviceAccounts, + startRestricted, + status, + statusMessage, + tags, + zone); } public Builder clone() { @@ -896,30 +873,77 @@ public Builder clone() { @Override public String toString() { return "Instance{" - + "canIpForward=" + canIpForward + ", " - + "cpuPlatform=" + cpuPlatform + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "deletionProtection=" + deletionProtection + ", " - + "description=" + description + ", " - + "disks=" + disks + ", " - + "guestAccelerators=" + guestAccelerators + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + ", " - + "machineType=" + machineType + ", " - + "metadata=" + metadata + ", " - + "minCpuPlatform=" + minCpuPlatform + ", " - + "name=" + name + ", " - + "networkInterfaces=" + networkInterfaces + ", " - + "scheduling=" + scheduling + ", " - + "selfLink=" + selfLink + ", " - + "serviceAccounts=" + serviceAccounts + ", " - + "startRestricted=" + startRestricted + ", " - + "status=" + status + ", " - + "statusMessage=" + statusMessage + ", " - + "tags=" + tags + ", " - + "zone=" + zone + + "canIpForward=" + + canIpForward + + ", " + + "cpuPlatform=" + + cpuPlatform + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "deletionProtection=" + + deletionProtection + + ", " + + "description=" + + description + + ", " + + "disks=" + + disks + + ", " + + "guestAccelerators=" + + guestAccelerators + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + + ", " + + "machineType=" + + machineType + + ", " + + "metadata=" + + metadata + + ", " + + "minCpuPlatform=" + + minCpuPlatform + + ", " + + "name=" + + name + + ", " + + "networkInterfaces=" + + networkInterfaces + + ", " + + "scheduling=" + + scheduling + + ", " + + "selfLink=" + + selfLink + + ", " + + "serviceAccounts=" + + serviceAccounts + + ", " + + "startRestricted=" + + startRestricted + + ", " + + "status=" + + status + + ", " + + "statusMessage=" + + statusMessage + + ", " + + "tags=" + + tags + + ", " + + "zone=" + + zone + "}"; } @@ -930,32 +954,30 @@ public boolean equals(Object o) { } if (o instanceof Instance) { Instance that = (Instance) o; - return - Objects.equals(this.canIpForward, that.getCanIpForward()) && - Objects.equals(this.cpuPlatform, that.getCpuPlatform()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.deletionProtection, that.getDeletionProtection()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.disks, that.getDisksList()) && - Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) && - Objects.equals(this.machineType, that.getMachineType()) && - Objects.equals(this.metadata, that.getMetadata()) && - Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) && - Objects.equals(this.scheduling, that.getScheduling()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) && - Objects.equals(this.startRestricted, that.getStartRestricted()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.statusMessage, that.getStatusMessage()) && - Objects.equals(this.tags, that.getTags()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.canIpForward, that.getCanIpForward()) + && Objects.equals(this.cpuPlatform, that.getCpuPlatform()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.deletionProtection, that.getDeletionProtection()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.disks, that.getDisksList()) + && Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()) + && Objects.equals(this.machineType, that.getMachineType()) + && Objects.equals(this.metadata, that.getMetadata()) + && Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) + && Objects.equals(this.scheduling, that.getScheduling()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) + && Objects.equals(this.startRestricted, that.getStartRestricted()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.statusMessage, that.getStatusMessage()) + && Objects.equals(this.tags, that.getTags()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -963,30 +985,29 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - canIpForward, - cpuPlatform, - creationTimestamp, - deletionProtection, - description, - disks, - guestAccelerators, - id, - kind, - labelFingerprint, - labels, - machineType, - metadata, - minCpuPlatform, - name, - networkInterfaces, - scheduling, - selfLink, - serviceAccounts, - startRestricted, - status, - statusMessage, - tags, - zone - ); + canIpForward, + cpuPlatform, + creationTimestamp, + deletionProtection, + description, + disks, + guestAccelerators, + id, + kind, + labelFingerprint, + labels, + machineType, + metadata, + minCpuPlatform, + name, + networkInterfaces, + scheduling, + selfLink, + serviceAccounts, + startRestricted, + status, + statusMessage, + tags, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java index 59d41443fe78..876eb432086d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private InstanceAggregatedList() { this.warning = null; } - private InstanceAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceAggregatedList build() { - - - - - return new InstanceAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "InstanceAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceAggregatedList) { InstanceAggregatedList that = (InstanceAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java index 709c7b32e18a..a341e110a9ae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InstanceStub; import com.google.cloud.compute.v1.stub.InstanceStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,34 +51,33 @@ * *

* - *

Note: close() needs to be called on the instanceClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the instanceClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of InstanceSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of InstanceSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -118,19 +107,14 @@ public class InstanceClient implements BackgroundResource {
   private final InstanceSettings settings;
   private final InstanceStub stub;
 
-
-
-  /**
-   * Constructs an instance of InstanceClient with default settings.
-   */
+  /** Constructs an instance of InstanceClient with default settings. */
   public static final InstanceClient create() throws IOException {
     return create(InstanceSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InstanceClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final InstanceClient create(InstanceSettings settings) throws IOException {
     return new InstanceClient(settings);
@@ -146,9 +130,8 @@ public static final InstanceClient create(InstanceStub stub) {
   }
 
   /**
-   * Constructs an instance of InstanceClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InstanceClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected InstanceClient(InstanceSettings settings) throws IOException {
     this.settings = settings;
@@ -170,12 +153,12 @@ public InstanceStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Adds an access config to an instance's network interface.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -188,24 +171,33 @@ public InstanceStub getStub() {
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface to add to this instance.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported.
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param accessConfigResource An access configuration attached to an instance's network + * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addAccessConfigInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { + public final Operation addAccessConfigInstance( + ProjectZoneInstanceName instance, + String networkInterface, + String requestId, + AccessConfig accessConfigResource) { AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setAccessConfigResource(accessConfigResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfigResource(accessConfigResource) + .build(); return addAccessConfigInstance(request); } @@ -213,7 +205,8 @@ public final Operation addAccessConfigInstance(ProjectZoneInstanceName instance, /** * Adds an access config to an instance's network interface. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -226,24 +219,33 @@ public final Operation addAccessConfigInstance(ProjectZoneInstanceName instance,
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface to add to this instance.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported.
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param accessConfigResource An access configuration attached to an instance's network + * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addAccessConfigInstance(String instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { + public final Operation addAccessConfigInstance( + String instance, + String networkInterface, + String requestId, + AccessConfig accessConfigResource) { AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setAccessConfigResource(accessConfigResource) - .build(); + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfigResource(accessConfigResource) + .build(); return addAccessConfigInstance(request); } @@ -251,7 +253,8 @@ public final Operation addAccessConfigInstance(String instance, String networkIn /** * Adds an access config to an instance's network interface. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -280,7 +283,8 @@ public final Operation addAccessConfigInstance(AddAccessConfigInstanceHttpReques
   /**
    * Adds an access config to an instance's network interface.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -300,7 +304,8 @@ public final Operation addAccessConfigInstance(AddAccessConfigInstanceHttpReques
    * 
*/ @BetaApi - public final UnaryCallable addAccessConfigInstanceCallable() { + public final UnaryCallable + addAccessConfigInstanceCallable() { return stub.addAccessConfigInstanceCallable(); } @@ -308,7 +313,8 @@ public final UnaryCallable addAcc /** * Retrieves aggregated list of instances. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -325,8 +331,8 @@ public final UnaryCallable addAcc
   public final AggregatedListInstancesPagedResponse aggregatedListInstances(ProjectName project) {
     AggregatedListInstancesHttpRequest request =
         AggregatedListInstancesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListInstances(request);
   }
 
@@ -334,7 +340,8 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances(Projec
   /**
    * Retrieves aggregated list of instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -350,9 +357,7 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances(Projec
   @BetaApi
   public final AggregatedListInstancesPagedResponse aggregatedListInstances(String project) {
     AggregatedListInstancesHttpRequest request =
-        AggregatedListInstancesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListInstancesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListInstances(request);
   }
 
@@ -360,7 +365,8 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances(String
   /**
    * Retrieves aggregated list of instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -377,16 +383,17 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances(String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstancesPagedResponse aggregatedListInstances(AggregatedListInstancesHttpRequest request) {
-    return aggregatedListInstancesPagedCallable()
-        .call(request);
+  public final AggregatedListInstancesPagedResponse aggregatedListInstances(
+      AggregatedListInstancesHttpRequest request) {
+    return aggregatedListInstancesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves aggregated list of instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -402,7 +409,9 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances(Aggreg
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListInstancesPagedCallable() { + public final UnaryCallable< + AggregatedListInstancesHttpRequest, AggregatedListInstancesPagedResponse> + aggregatedListInstancesPagedCallable() { return stub.aggregatedListInstancesPagedCallable(); } @@ -410,7 +419,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -433,15 +443,19 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListInstancesCallable() { + public final UnaryCallable + aggregatedListInstancesCallable() { return stub.aggregatedListInstancesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -452,31 +466,39 @@ public final UnaryCallable
* * @param instance The instance name for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation attachDiskInstance(ProjectZoneInstanceName instance, String requestId, AttachedDisk attachedDiskResource) { + public final Operation attachDiskInstance( + ProjectZoneInstanceName instance, String requestId, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setAttachedDiskResource(attachedDiskResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setAttachedDiskResource(attachedDiskResource) + .build(); return attachDiskInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -487,31 +509,39 @@ public final Operation attachDiskInstance(ProjectZoneInstanceName instance, Stri
    * 
* * @param instance The instance name for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation attachDiskInstance(String instance, String requestId, AttachedDisk attachedDiskResource) { + public final Operation attachDiskInstance( + String instance, String requestId, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setAttachedDiskResource(attachedDiskResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setAttachedDiskResource(attachedDiskResource) + .build(); return attachDiskInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -536,9 +566,12 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request)
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -556,15 +589,18 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable attachDiskInstanceCallable() { + public final UnaryCallable + attachDiskInstanceCallable() { return stub.attachDiskInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an + * Instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -574,11 +610,15 @@ public final UnaryCallable attachDiskI
    * 
* * @param instance Name of the instance resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -586,17 +626,19 @@ public final Operation deleteInstance(ProjectZoneInstanceName instance, String r DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .build(); return deleteInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an + * Instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -606,11 +648,15 @@ public final Operation deleteInstance(ProjectZoneInstanceName instance, String r
    * 
* * @param instance Name of the instance resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -618,17 +664,19 @@ public final Operation deleteInstance(String instance, String requestId) { DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .build(); return deleteInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * Deletes the specified Instance resource. For more information, see Stopping or Deleting an + * Instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -651,9 +699,11 @@ public final Operation deleteInstance(DeleteInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
+   * Deletes the specified Instance resource. For more information, see Stopping or Deleting an
+   * Instance.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -677,7 +727,8 @@ public final UnaryCallable deleteInstanceC
   /**
    * Deletes an access config from an instance's network interface.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -690,24 +741,32 @@ public final UnaryCallable deleteInstanceC
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param accessConfig The name of the access config to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAccessConfigInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, String accessConfig) { + public final Operation deleteAccessConfigInstance( + ProjectZoneInstanceName instance, + String networkInterface, + String requestId, + String accessConfig) { DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setAccessConfig(accessConfig) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfig(accessConfig) + .build(); return deleteAccessConfigInstance(request); } @@ -715,7 +774,8 @@ public final Operation deleteAccessConfigInstance(ProjectZoneInstanceName instan /** * Deletes an access config from an instance's network interface. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -728,24 +788,29 @@ public final Operation deleteAccessConfigInstance(ProjectZoneInstanceName instan
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param accessConfig The name of the access config to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAccessConfigInstance(String instance, String networkInterface, String requestId, String accessConfig) { + public final Operation deleteAccessConfigInstance( + String instance, String networkInterface, String requestId, String accessConfig) { DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setAccessConfig(accessConfig) - .build(); + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfig(accessConfig) + .build(); return deleteAccessConfigInstance(request); } @@ -753,7 +818,8 @@ public final Operation deleteAccessConfigInstance(String instance, String networ /** * Deletes an access config from an instance's network interface. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -782,7 +848,8 @@ public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttp
   /**
    * Deletes an access config from an instance's network interface.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -802,7 +869,8 @@ public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttp
    * 
*/ @BetaApi - public final UnaryCallable deleteAccessConfigInstanceCallable() { + public final UnaryCallable + deleteAccessConfigInstanceCallable() { return stub.deleteAccessConfigInstanceCallable(); } @@ -810,7 +878,8 @@ public final UnaryCallable del /** * Detaches a disk from an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -821,23 +890,28 @@ public final UnaryCallable del
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param deviceName Disk device name to detach. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation detachDiskInstance(ProjectZoneInstanceName instance, String requestId, String deviceName) { + public final Operation detachDiskInstance( + ProjectZoneInstanceName instance, String requestId, String deviceName) { DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setDeviceName(deviceName) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setDeviceName(deviceName) + .build(); return detachDiskInstance(request); } @@ -845,7 +919,8 @@ public final Operation detachDiskInstance(ProjectZoneInstanceName instance, Stri /** * Detaches a disk from an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -856,11 +931,15 @@ public final Operation detachDiskInstance(ProjectZoneInstanceName instance, Stri
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param deviceName Disk device name to detach. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -869,10 +948,10 @@ public final Operation detachDiskInstance(String instance, String requestId, Str DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setDeviceName(deviceName) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setDeviceName(deviceName) + .build(); return detachDiskInstance(request); } @@ -880,7 +959,8 @@ public final Operation detachDiskInstance(String instance, String requestId, Str /** * Detaches a disk from an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -907,7 +987,8 @@ public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request)
   /**
    * Detaches a disk from an instance.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -925,15 +1006,18 @@ public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable detachDiskInstanceCallable() { + public final UnaryCallable + detachDiskInstanceCallable() { return stub.detachDiskInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Instance resource. Get a list of available instances by making a list() request. + * Returns the specified Instance resource. Get a list of available instances by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -949,16 +1033,18 @@ public final Instance getInstance(ProjectZoneInstanceName instance) {
 
     GetInstanceHttpRequest request =
         GetInstanceHttpRequest.newBuilder()
-        .setInstance(instance == null ? null : instance.toString())
-        .build();
+            .setInstance(instance == null ? null : instance.toString())
+            .build();
     return getInstance(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Instance resource. Get a list of available instances by making a list() request.
+   * Returns the specified Instance resource. Get a list of available instances by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -973,17 +1059,17 @@ public final Instance getInstance(ProjectZoneInstanceName instance) {
   public final Instance getInstance(String instance) {
 
     GetInstanceHttpRequest request =
-        GetInstanceHttpRequest.newBuilder()
-        .setInstance(instance)
-        .build();
+        GetInstanceHttpRequest.newBuilder().setInstance(instance).build();
     return getInstance(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Instance resource. Get a list of available instances by making a list() request.
+   * Returns the specified Instance resource. Get a list of available instances by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1004,9 +1090,11 @@ public final Instance getInstance(GetInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Instance resource. Get a list of available instances by making a list() request.
+   * Returns the specified Instance resource. Get a list of available instances by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1028,7 +1116,8 @@ public final UnaryCallable getInstanceCallable
   /**
    * Returns the specified instance's serial port output.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1040,18 +1129,22 @@ public final UnaryCallable getInstanceCallable
    *
    * @param instance Name of the instance scoping this request.
    * @param port Specifies which COM or serial port to retrieve data from.
-   * @param start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.
+   * @param start Returns output starting from a specific byte position. Use this to page through
+   *     output when the output is too large to return in a single request. For the initial request,
+   *     leave this field unspecified. For subsequent calls, this field should be set to the next
+   *     value returned in the previous call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final SerialPortOutput getSerialPortOutputInstance(ProjectZoneInstanceName instance, Integer port, String start) {
+  public final SerialPortOutput getSerialPortOutputInstance(
+      ProjectZoneInstanceName instance, Integer port, String start) {
 
     GetSerialPortOutputInstanceHttpRequest request =
         GetSerialPortOutputInstanceHttpRequest.newBuilder()
-        .setInstance(instance == null ? null : instance.toString())
-        .setPort(port)
-        .setStart(start)
-        .build();
+            .setInstance(instance == null ? null : instance.toString())
+            .setPort(port)
+            .setStart(start)
+            .build();
     return getSerialPortOutputInstance(request);
   }
 
@@ -1059,7 +1152,8 @@ public final SerialPortOutput getSerialPortOutputInstance(ProjectZoneInstanceNam
   /**
    * Returns the specified instance's serial port output.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1071,18 +1165,22 @@ public final SerialPortOutput getSerialPortOutputInstance(ProjectZoneInstanceNam
    *
    * @param instance Name of the instance scoping this request.
    * @param port Specifies which COM or serial port to retrieve data from.
-   * @param start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.
+   * @param start Returns output starting from a specific byte position. Use this to page through
+   *     output when the output is too large to return in a single request. For the initial request,
+   *     leave this field unspecified. For subsequent calls, this field should be set to the next
+   *     value returned in the previous call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final SerialPortOutput getSerialPortOutputInstance(String instance, Integer port, String start) {
+  public final SerialPortOutput getSerialPortOutputInstance(
+      String instance, Integer port, String start) {
 
     GetSerialPortOutputInstanceHttpRequest request =
         GetSerialPortOutputInstanceHttpRequest.newBuilder()
-        .setInstance(instance)
-        .setPort(port)
-        .setStart(start)
-        .build();
+            .setInstance(instance)
+            .setPort(port)
+            .setStart(start)
+            .build();
     return getSerialPortOutputInstance(request);
   }
 
@@ -1090,7 +1188,8 @@ public final SerialPortOutput getSerialPortOutputInstance(String instance, Integ
   /**
    * Returns the specified instance's serial port output.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1109,7 +1208,8 @@ public final SerialPortOutput getSerialPortOutputInstance(String instance, Integ
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final SerialPortOutput getSerialPortOutputInstance(GetSerialPortOutputInstanceHttpRequest request) {
+  public final SerialPortOutput getSerialPortOutputInstance(
+      GetSerialPortOutputInstanceHttpRequest request) {
     return getSerialPortOutputInstanceCallable().call(request);
   }
 
@@ -1117,7 +1217,8 @@ public final SerialPortOutput getSerialPortOutputInstance(GetSerialPortOutputIns
   /**
    * Returns the specified instance's serial port output.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1135,7 +1236,8 @@ public final SerialPortOutput getSerialPortOutputInstance(GetSerialPortOutputIns
    * 
*/ @BetaApi - public final UnaryCallable getSerialPortOutputInstanceCallable() { + public final UnaryCallable + getSerialPortOutputInstanceCallable() { return stub.getSerialPortOutputInstanceCallable(); } @@ -1143,34 +1245,52 @@ public final UnaryCallableSample code: + * *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
-   *   Operation response = instanceClient.insertInstance(zone, requestId, instanceResource);
+   *   Operation response = instanceClient.insertInstance(sourceInstanceTemplate, zone, requestId, instanceResource);
    * }
    * 
* + * @param 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/global/instanceTemplates/instanceTemplate + * - projects/project/global/global/instanceTemplates/instanceTemplate - + * global/instancesTemplates/instanceTemplate * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== + * resource_for v1.instances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstance(ProjectZoneName zone, String requestId, Instance instanceResource) { + public final Operation insertInstance( + String sourceInstanceTemplate, + ProjectZoneName zone, + String requestId, + Instance instanceResource) { InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setInstanceResource(instanceResource) - .build(); + .setSourceInstanceTemplate(sourceInstanceTemplate) + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setInstanceResource(instanceResource) + .build(); return insertInstance(request); } @@ -1178,34 +1298,49 @@ public final Operation insertInstance(ProjectZoneName zone, String requestId, In /** * Creates an instance resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
-   *   Operation response = instanceClient.insertInstance(zone.toString(), requestId, instanceResource);
+   *   Operation response = instanceClient.insertInstance(sourceInstanceTemplate, zone.toString(), requestId, instanceResource);
    * }
    * 
* + * @param 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/global/instanceTemplates/instanceTemplate + * - projects/project/global/global/instanceTemplates/instanceTemplate - + * global/instancesTemplates/instanceTemplate * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== + * resource_for v1.instances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstance(String zone, String requestId, Instance instanceResource) { + public final Operation insertInstance( + String sourceInstanceTemplate, String zone, String requestId, Instance instanceResource) { InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setInstanceResource(instanceResource) - .build(); + .setSourceInstanceTemplate(sourceInstanceTemplate) + .setZone(zone) + .setRequestId(requestId) + .setInstanceResource(instanceResource) + .build(); return insertInstance(request); } @@ -1213,13 +1348,16 @@ public final Operation insertInstance(String zone, String requestId, Instance in /** * Creates an instance resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
+   *     .setSourceInstanceTemplate(sourceInstanceTemplate)
    *     .setZone(zone.toString())
    *     .setRequestId(requestId)
    *     .setInstanceResource(instanceResource)
@@ -1240,13 +1378,16 @@ public final Operation insertInstance(InsertInstanceHttpRequest request) {
   /**
    * Creates an instance resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
    *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
+   *     .setSourceInstanceTemplate(sourceInstanceTemplate)
    *     .setZone(zone.toString())
    *     .setRequestId(requestId)
    *     .setInstanceResource(instanceResource)
@@ -1266,7 +1407,8 @@ public final UnaryCallable insertInstanceC
   /**
    * Retrieves the list of instances contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1283,8 +1425,8 @@ public final UnaryCallable insertInstanceC
   public final ListInstancesPagedResponse listInstances(ProjectZoneName zone) {
     ListInstancesHttpRequest request =
         ListInstancesHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listInstances(request);
   }
 
@@ -1292,7 +1434,8 @@ public final ListInstancesPagedResponse listInstances(ProjectZoneName zone) {
   /**
    * Retrieves the list of instances contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1307,10 +1450,7 @@ public final ListInstancesPagedResponse listInstances(ProjectZoneName zone) {
    */
   @BetaApi
   public final ListInstancesPagedResponse listInstances(String zone) {
-    ListInstancesHttpRequest request =
-        ListInstancesHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+    ListInstancesHttpRequest request = ListInstancesHttpRequest.newBuilder().setZone(zone).build();
     return listInstances(request);
   }
 
@@ -1318,7 +1458,8 @@ public final ListInstancesPagedResponse listInstances(String zone) {
   /**
    * Retrieves the list of instances contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1336,15 +1477,15 @@ public final ListInstancesPagedResponse listInstances(String zone) {
    */
   @BetaApi
   public final ListInstancesPagedResponse listInstances(ListInstancesHttpRequest request) {
-    return listInstancesPagedCallable()
-        .call(request);
+    return listInstancesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of instances contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1360,7 +1501,8 @@ public final ListInstancesPagedResponse listInstances(ListInstancesHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable listInstancesPagedCallable() { + public final UnaryCallable + listInstancesPagedCallable() { return stub.listInstancesPagedCallable(); } @@ -1368,7 +1510,8 @@ public final UnaryCallable /** * Retrieves the list of instances contained within the specified zone. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1399,7 +1542,8 @@ public final UnaryCallable listInstances
   /**
    * Retrieves the list of referrers to instances contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1409,15 +1553,17 @@ public final UnaryCallable listInstances
    * }
    * 
* - * @param instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param instance Name of the target instance scoping this request, or '-' if the request should + * span over all instances in the container. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ListReferrersInstancesPagedResponse listReferrersInstances(ProjectZoneInstanceName instance) { + public final ListReferrersInstancesPagedResponse listReferrersInstances( + ProjectZoneInstanceName instance) { ListReferrersInstancesHttpRequest request = ListReferrersInstancesHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .build(); return listReferrersInstances(request); } @@ -1425,7 +1571,8 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(ProjectZ /** * Retrieves the list of referrers to instances contained within the specified zone. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1435,15 +1582,14 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(ProjectZ
    * }
    * 
* - * @param instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param instance Name of the target instance scoping this request, or '-' if the request should + * span over all instances in the container. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final ListReferrersInstancesPagedResponse listReferrersInstances(String instance) { ListReferrersInstancesHttpRequest request = - ListReferrersInstancesHttpRequest.newBuilder() - .setInstance(instance) - .build(); + ListReferrersInstancesHttpRequest.newBuilder().setInstance(instance).build(); return listReferrersInstances(request); } @@ -1451,7 +1597,8 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(String i /** * Retrieves the list of referrers to instances contained within the specified zone. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1468,16 +1615,17 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(String i
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListReferrersInstancesPagedResponse listReferrersInstances(ListReferrersInstancesHttpRequest request) {
-    return listReferrersInstancesPagedCallable()
-        .call(request);
+  public final ListReferrersInstancesPagedResponse listReferrersInstances(
+      ListReferrersInstancesHttpRequest request) {
+    return listReferrersInstancesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of referrers to instances contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1493,7 +1641,8 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(ListRefe
    * 
*/ @BetaApi - public final UnaryCallable listReferrersInstancesPagedCallable() { + public final UnaryCallable + listReferrersInstancesPagedCallable() { return stub.listReferrersInstancesPagedCallable(); } @@ -1501,7 +1650,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1524,7 +1674,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listReferrersInstancesCallable() { + public final UnaryCallable + listReferrersInstancesCallable() { return stub.listReferrersInstancesCallable(); } @@ -1532,7 +1683,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1542,11 +1694,15 @@ public final UnaryCallable
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -1554,9 +1710,9 @@ public final Operation resetInstance(ProjectZoneInstanceName instance, String re ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .build(); return resetInstance(request); } @@ -1564,7 +1720,8 @@ public final Operation resetInstance(ProjectZoneInstanceName instance, String re /** * Performs a reset on the instance. For more information, see Resetting an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1574,21 +1731,22 @@ public final Operation resetInstance(ProjectZoneInstanceName instance, String re
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resetInstance(String instance, String requestId) { ResetInstanceHttpRequest request = - ResetInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .build(); + ResetInstanceHttpRequest.newBuilder().setInstance(instance).setRequestId(requestId).build(); return resetInstance(request); } @@ -1596,7 +1754,8 @@ public final Operation resetInstance(String instance, String requestId) { /** * Performs a reset on the instance. For more information, see Resetting an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1621,7 +1780,8 @@ public final Operation resetInstance(ResetInstanceHttpRequest request) {
   /**
    * Performs a reset on the instance. For more information, see Resetting an instance.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1645,10 +1805,11 @@ public final UnaryCallable resetInstanceCal
   /**
    * Sets deletion protection on the instance.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   Operation response = instanceClient.setDeletionProtectionInstance(resource, requestId, deletionProtection);
@@ -1656,23 +1817,28 @@ public final UnaryCallable resetInstanceCal
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param deletionProtection Whether the resource should be protected against deletion. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setDeletionProtectionInstance(ProjectZoneInstanceName resource, String requestId, Boolean deletionProtection) { + public final Operation setDeletionProtectionInstance( + ProjectZoneInstanceResourceName resource, String requestId, Boolean deletionProtection) { SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .setRequestId(requestId) - .setDeletionProtection(deletionProtection) - .build(); + .setResource(resource == null ? null : resource.toString()) + .setRequestId(requestId) + .setDeletionProtection(deletionProtection) + .build(); return setDeletionProtectionInstance(request); } @@ -1680,10 +1846,11 @@ public final Operation setDeletionProtectionInstance(ProjectZoneInstanceName res /** * Sets deletion protection on the instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   Operation response = instanceClient.setDeletionProtectionInstance(resource.toString(), requestId, deletionProtection);
@@ -1691,23 +1858,28 @@ public final Operation setDeletionProtectionInstance(ProjectZoneInstanceName res
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param deletionProtection Whether the resource should be protected against deletion. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setDeletionProtectionInstance(String resource, String requestId, Boolean deletionProtection) { + public final Operation setDeletionProtectionInstance( + String resource, String requestId, Boolean deletionProtection) { SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder() - .setResource(resource) - .setRequestId(requestId) - .setDeletionProtection(deletionProtection) - .build(); + .setResource(resource) + .setRequestId(requestId) + .setDeletionProtection(deletionProtection) + .build(); return setDeletionProtectionInstance(request); } @@ -1715,10 +1887,11 @@ public final Operation setDeletionProtectionInstance(String resource, String req /** * Sets deletion protection on the instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
@@ -1734,7 +1907,8 @@ public final Operation setDeletionProtectionInstance(String resource, String req
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setDeletionProtectionInstance(SetDeletionProtectionInstanceHttpRequest request) {
+  public final Operation setDeletionProtectionInstance(
+      SetDeletionProtectionInstanceHttpRequest request) {
     return setDeletionProtectionInstanceCallable().call(request);
   }
 
@@ -1742,10 +1916,11 @@ public final Operation setDeletionProtectionInstance(SetDeletionProtectionInstan
   /**
    * Sets deletion protection on the instance.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
    *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
@@ -1760,7 +1935,8 @@ public final Operation setDeletionProtectionInstance(SetDeletionProtectionInstan
    * 
*/ @BetaApi - public final UnaryCallable setDeletionProtectionInstanceCallable() { + public final UnaryCallable + setDeletionProtectionInstanceCallable() { return stub.setDeletionProtectionInstanceCallable(); } @@ -1768,7 +1944,8 @@ public final UnaryCallable /** * Sets the auto-delete flag for a disk attached to an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1780,25 +1957,30 @@ public final UnaryCallable
    * 
* * @param instance The instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param autoDelete Whether to auto-delete the disk when the instance is deleted. * @param deviceName The device name of the disk to modify. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setDiskAutoDeleteInstance(ProjectZoneInstanceName instance, String requestId, Boolean autoDelete, String deviceName) { + public final Operation setDiskAutoDeleteInstance( + ProjectZoneInstanceName instance, String requestId, Boolean autoDelete, String deviceName) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setAutoDelete(autoDelete) - .setDeviceName(deviceName) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setAutoDelete(autoDelete) + .setDeviceName(deviceName) + .build(); return setDiskAutoDeleteInstance(request); } @@ -1806,7 +1988,8 @@ public final Operation setDiskAutoDeleteInstance(ProjectZoneInstanceName instanc /** * Sets the auto-delete flag for a disk attached to an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1818,25 +2001,30 @@ public final Operation setDiskAutoDeleteInstance(ProjectZoneInstanceName instanc
    * 
* * @param instance The instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param autoDelete Whether to auto-delete the disk when the instance is deleted. * @param deviceName The device name of the disk to modify. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setDiskAutoDeleteInstance(String instance, String requestId, Boolean autoDelete, String deviceName) { + public final Operation setDiskAutoDeleteInstance( + String instance, String requestId, Boolean autoDelete, String deviceName) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setAutoDelete(autoDelete) - .setDeviceName(deviceName) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setAutoDelete(autoDelete) + .setDeviceName(deviceName) + .build(); return setDiskAutoDeleteInstance(request); } @@ -1844,7 +2032,8 @@ public final Operation setDiskAutoDeleteInstance(String instance, String request /** * Sets the auto-delete flag for a disk attached to an instance. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1873,7 +2062,8 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe
   /**
    * Sets the auto-delete flag for a disk attached to an instance.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1893,15 +2083,18 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe
    * 
*/ @BetaApi - public final UnaryCallable setDiskAutoDeleteInstanceCallable() { + public final UnaryCallable + setDiskAutoDeleteInstanceCallable() { return stub.setDiskAutoDeleteInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * Sets labels on an instance. To learn more about labels, read the Labeling Resources + * documentation. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1912,31 +2105,40 @@ public final UnaryCallable setD
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setLabelsInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) { + public final Operation setLabelsInstance( + ProjectZoneInstanceName instance, + String requestId, + InstancesSetLabelsRequest instancesSetLabelsRequestResource) { SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) + .build(); return setLabelsInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * Sets labels on an instance. To learn more about labels, read the Labeling Resources + * documentation. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1947,31 +2149,40 @@ public final Operation setLabelsInstance(ProjectZoneInstanceName instance, Strin
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setLabelsInstance(String instance, String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) { + public final Operation setLabelsInstance( + String instance, + String requestId, + InstancesSetLabelsRequest instancesSetLabelsRequestResource) { SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) + .build(); return setLabelsInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * Sets labels on an instance. To learn more about labels, read the Labeling Resources + * documentation. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -1996,9 +2207,11 @@ public final Operation setLabelsInstance(SetLabelsInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
+   * Sets labels on an instance. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2022,9 +2235,11 @@ public final UnaryCallable setLabelsIns
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
+   * Changes the number and/or type of accelerator for a stopped instance to the values specified in
+   * the request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2035,31 +2250,41 @@ public final UnaryCallable setLabelsIns
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineResourcesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineResourcesInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { + public final Operation setMachineResourcesInstance( + ProjectZoneInstanceName instance, + String requestId, + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetMachineResourcesRequestResource( + instancesSetMachineResourcesRequestResource) + .build(); return setMachineResourcesInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * Changes the number and/or type of accelerator for a stopped instance to the values specified in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2070,31 +2295,41 @@ public final Operation setMachineResourcesInstance(ProjectZoneInstanceName insta
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineResourcesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineResourcesInstance(String instance, String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { + public final Operation setMachineResourcesInstance( + String instance, + String requestId, + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetMachineResourcesRequestResource( + instancesSetMachineResourcesRequestResource) + .build(); return setMachineResourcesInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * Changes the number and/or type of accelerator for a stopped instance to the values specified in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2113,15 +2348,18 @@ public final Operation setMachineResourcesInstance(String instance, String reque
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setMachineResourcesInstance(SetMachineResourcesInstanceHttpRequest request) {
+  public final Operation setMachineResourcesInstance(
+      SetMachineResourcesInstanceHttpRequest request) {
     return setMachineResourcesInstanceCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
+   * Changes the number and/or type of accelerator for a stopped instance to the values specified in
+   * the request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2139,7 +2377,8 @@ public final Operation setMachineResourcesInstance(SetMachineResourcesInstanceHt
    * 
*/ @BetaApi - public final UnaryCallable setMachineResourcesInstanceCallable() { + public final UnaryCallable + setMachineResourcesInstanceCallable() { return stub.setMachineResourcesInstanceCallable(); } @@ -2147,7 +2386,8 @@ public final UnaryCallable se /** * Changes the machine type for a stopped instance to the machine type specified in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2158,23 +2398,30 @@ public final UnaryCallable se
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineTypeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineTypeInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + public final Operation setMachineTypeInstance( + ProjectZoneInstanceName instance, + String requestId, + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .build(); return setMachineTypeInstance(request); } @@ -2182,7 +2429,8 @@ public final Operation setMachineTypeInstance(ProjectZoneInstanceName instance, /** * Changes the machine type for a stopped instance to the machine type specified in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2193,23 +2441,30 @@ public final Operation setMachineTypeInstance(ProjectZoneInstanceName instance,
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineTypeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMachineTypeInstance(String instance, String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + public final Operation setMachineTypeInstance( + String instance, + String requestId, + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) + .build(); return setMachineTypeInstance(request); } @@ -2217,7 +2472,8 @@ public final Operation setMachineTypeInstance(String instance, String requestId, /** * Changes the machine type for a stopped instance to the machine type specified in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2244,7 +2500,8 @@ public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest
   /**
    * Changes the machine type for a stopped instance to the machine type specified in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2262,7 +2519,8 @@ public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable setMachineTypeInstanceCallable() { + public final UnaryCallable + setMachineTypeInstanceCallable() { return stub.setMachineTypeInstanceCallable(); } @@ -2270,7 +2528,8 @@ public final UnaryCallable setMach /** * Sets metadata for the specified instance to the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2281,23 +2540,28 @@ public final UnaryCallable setMach
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMetadataInstance(ProjectZoneInstanceName instance, String requestId, Metadata metadataResource) { + public final Operation setMetadataInstance( + ProjectZoneInstanceName instance, String requestId, Metadata metadataResource) { SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setMetadataResource(metadataResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setMetadataResource(metadataResource) + .build(); return setMetadataInstance(request); } @@ -2305,7 +2569,8 @@ public final Operation setMetadataInstance(ProjectZoneInstanceName instance, Str /** * Sets metadata for the specified instance to the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2316,23 +2581,28 @@ public final Operation setMetadataInstance(ProjectZoneInstanceName instance, Str
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMetadataInstance(String instance, String requestId, Metadata metadataResource) { + public final Operation setMetadataInstance( + String instance, String requestId, Metadata metadataResource) { SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setMetadataResource(metadataResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setMetadataResource(metadataResource) + .build(); return setMetadataInstance(request); } @@ -2340,7 +2610,8 @@ public final Operation setMetadataInstance(String instance, String requestId, Me /** * Sets metadata for the specified instance to the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2367,7 +2638,8 @@ public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest reques
   /**
    * Sets metadata for the specified instance to the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2385,15 +2657,18 @@ public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable setMetadataInstanceCallable() { + public final UnaryCallable + setMetadataInstanceCallable() { return stub.setMetadataInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2404,31 +2679,40 @@ public final UnaryCallable setMetadat
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetMinCpuPlatformRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMinCpuPlatformInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { + public final Operation setMinCpuPlatformInstance( + ProjectZoneInstanceName instance, + String requestId, + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) + .build(); return setMinCpuPlatformInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2439,31 +2723,40 @@ public final Operation setMinCpuPlatformInstance(ProjectZoneInstanceName instanc
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetMinCpuPlatformRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMinCpuPlatformInstance(String instance, String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { + public final Operation setMinCpuPlatformInstance( + String instance, + String requestId, + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) + .build(); return setMinCpuPlatformInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2488,9 +2781,11 @@ public final Operation setMinCpuPlatformInstance(SetMinCpuPlatformInstanceHttpRe
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2508,7 +2803,8 @@ public final Operation setMinCpuPlatformInstance(SetMinCpuPlatformInstanceHttpRe
    * 
*/ @BetaApi - public final UnaryCallable setMinCpuPlatformInstanceCallable() { + public final UnaryCallable + setMinCpuPlatformInstanceCallable() { return stub.setMinCpuPlatformInstanceCallable(); } @@ -2516,7 +2812,8 @@ public final UnaryCallable setM /** * Sets an instance's scheduling options. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2527,23 +2824,28 @@ public final UnaryCallable setM
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param schedulingResource Sets the scheduling options for an Instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSchedulingInstance(ProjectZoneInstanceName instance, String requestId, Scheduling schedulingResource) { + public final Operation setSchedulingInstance( + ProjectZoneInstanceName instance, String requestId, Scheduling schedulingResource) { SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setSchedulingResource(schedulingResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setSchedulingResource(schedulingResource) + .build(); return setSchedulingInstance(request); } @@ -2551,7 +2853,8 @@ public final Operation setSchedulingInstance(ProjectZoneInstanceName instance, S /** * Sets an instance's scheduling options. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2562,23 +2865,28 @@ public final Operation setSchedulingInstance(ProjectZoneInstanceName instance, S
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param schedulingResource Sets the scheduling options for an Instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSchedulingInstance(String instance, String requestId, Scheduling schedulingResource) { + public final Operation setSchedulingInstance( + String instance, String requestId, Scheduling schedulingResource) { SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setSchedulingResource(schedulingResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setSchedulingResource(schedulingResource) + .build(); return setSchedulingInstance(request); } @@ -2586,7 +2894,8 @@ public final Operation setSchedulingInstance(String instance, String requestId, /** * Sets an instance's scheduling options. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2613,7 +2922,8 @@ public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest re
   /**
    * Sets an instance's scheduling options.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2631,15 +2941,18 @@ public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable setSchedulingInstanceCallable() { + public final UnaryCallable + setSchedulingInstanceCallable() { return stub.setSchedulingInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * Sets the service account on the instance. For more information, read Changing the service + * account and access scopes for an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2650,31 +2963,40 @@ public final UnaryCallable setSched
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetServiceAccountRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setServiceAccountInstance(ProjectZoneInstanceName instance, String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + public final Operation setServiceAccountInstance( + ProjectZoneInstanceName instance, + String requestId, + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) + .build(); return setServiceAccountInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * Sets the service account on the instance. For more information, read Changing the service + * account and access scopes for an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2685,31 +3007,40 @@ public final Operation setServiceAccountInstance(ProjectZoneInstanceName instanc
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesSetServiceAccountRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setServiceAccountInstance(String instance, String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + public final Operation setServiceAccountInstance( + String instance, + String requestId, + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) + .build(); return setServiceAccountInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * Sets the service account on the instance. For more information, read Changing the service + * account and access scopes for an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2734,9 +3065,11 @@ public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRe
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
+   * Sets the service account on the instance. For more information, read Changing the service
+   * account and access scopes for an instance.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2754,7 +3087,8 @@ public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRe
    * 
*/ @BetaApi - public final UnaryCallable setServiceAccountInstanceCallable() { + public final UnaryCallable + setServiceAccountInstanceCallable() { return stub.setServiceAccountInstanceCallable(); } @@ -2762,7 +3096,8 @@ public final UnaryCallable setS /** * Sets tags for the specified instance to the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2773,23 +3108,28 @@ public final UnaryCallable setS
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param tagsResource A set of instance tags. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTagsInstance(ProjectZoneInstanceName instance, String requestId, Tags tagsResource) { + public final Operation setTagsInstance( + ProjectZoneInstanceName instance, String requestId, Tags tagsResource) { SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setTagsResource(tagsResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setTagsResource(tagsResource) + .build(); return setTagsInstance(request); } @@ -2797,7 +3137,8 @@ public final Operation setTagsInstance(ProjectZoneInstanceName instance, String /** * Sets tags for the specified instance to the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2808,11 +3149,15 @@ public final Operation setTagsInstance(ProjectZoneInstanceName instance, String
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param tagsResource A set of instance tags. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2821,10 +3166,10 @@ public final Operation setTagsInstance(String instance, String requestId, Tags t SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setTagsResource(tagsResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setTagsResource(tagsResource) + .build(); return setTagsInstance(request); } @@ -2832,7 +3177,8 @@ public final Operation setTagsInstance(String instance, String requestId, Tags t /** * Sets tags for the specified instance to the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2859,7 +3205,8 @@ public final Operation setTagsInstance(SetTagsInstanceHttpRequest request) {
   /**
    * Sets tags for the specified instance to the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2883,9 +3230,11 @@ public final UnaryCallable setTagsInstanc
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
+   * Starts an instance that was stopped using the using the instances().stop method. For more
+   * information, see Restart an instance.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2895,11 +3244,15 @@ public final UnaryCallable setTagsInstanc
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -2907,17 +3260,19 @@ public final Operation startInstance(ProjectZoneInstanceName instance, String re StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .build(); return startInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * Starts an instance that was stopped using the using the instances().stop method. For more + * information, see Restart an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2927,29 +3282,32 @@ public final Operation startInstance(ProjectZoneInstanceName instance, String re
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation startInstance(String instance, String requestId) { StartInstanceHttpRequest request = - StartInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .build(); + StartInstanceHttpRequest.newBuilder().setInstance(instance).setRequestId(requestId).build(); return startInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * Starts an instance that was stopped using the using the instances().stop method. For more + * information, see Restart an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2972,9 +3330,11 @@ public final Operation startInstance(StartInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
+   * Starts an instance that was stopped using the using the instances().stop method. For more
+   * information, see Restart an instance.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -2996,9 +3356,11 @@ public final UnaryCallable startInstanceCal
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
+   * Starts an instance that was stopped using the using the instances().stop method. For more
+   * information, see Restart an instance.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3009,31 +3371,41 @@ public final UnaryCallable startInstanceCal
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesStartWithEncryptionKeyRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startWithEncryptionKeyInstance(ProjectZoneInstanceName instance, String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + public final Operation startWithEncryptionKeyInstance( + ProjectZoneInstanceName instance, + String requestId, + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .setInstancesStartWithEncryptionKeyRequestResource( + instancesStartWithEncryptionKeyRequestResource) + .build(); return startWithEncryptionKeyInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * Starts an instance that was stopped using the using the instances().stop method. For more + * information, see Restart an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3044,31 +3416,41 @@ public final Operation startWithEncryptionKeyInstance(ProjectZoneInstanceName in
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instancesStartWithEncryptionKeyRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startWithEncryptionKeyInstance(String instance, String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + public final Operation startWithEncryptionKeyInstance( + String instance, + String requestId, + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource) - .build(); + .setInstance(instance) + .setRequestId(requestId) + .setInstancesStartWithEncryptionKeyRequestResource( + instancesStartWithEncryptionKeyRequestResource) + .build(); return startWithEncryptionKeyInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. + * Starts an instance that was stopped using the using the instances().stop method. For more + * information, see Restart an instance. + * + *

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3087,15 +3469,18 @@ public final Operation startWithEncryptionKeyInstance(String instance, String re
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation startWithEncryptionKeyInstance(StartWithEncryptionKeyInstanceHttpRequest request) {
+  public final Operation startWithEncryptionKeyInstance(
+      StartWithEncryptionKeyInstanceHttpRequest request) {
     return startWithEncryptionKeyInstanceCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
+   * Starts an instance that was stopped using the using the instances().stop method. For more
+   * information, see Restart an instance.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3113,15 +3498,20 @@ public final Operation startWithEncryptionKeyInstance(StartWithEncryptionKeyInst
    * 
*/ @BetaApi - public final UnaryCallable startWithEncryptionKeyInstanceCallable() { + public final UnaryCallable + startWithEncryptionKeyInstanceCallable() { return stub.startWithEncryptionKeyInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3131,11 +3521,15 @@ public final UnaryCallable
    * 
* * @param instance Name of the instance resource to stop. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -3143,17 +3537,21 @@ public final Operation stopInstance(ProjectZoneInstanceName instance, String req StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setRequestId(requestId) + .build(); return stopInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3163,29 +3561,34 @@ public final Operation stopInstance(ProjectZoneInstanceName instance, String req
    * 
* * @param instance Name of the instance resource to stop. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation stopInstance(String instance, String requestId) { StopInstanceHttpRequest request = - StopInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .build(); + StopInstanceHttpRequest.newBuilder().setInstance(instance).setRequestId(requestId).build(); return stopInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3208,9 +3611,13 @@ public final Operation stopInstance(StopInstanceHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3232,9 +3639,12 @@ public final UnaryCallable stopInstanceCalla
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3247,32 +3657,44 @@ public final UnaryCallable stopInstanceCalla
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface where the access config is attached.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported.
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param accessConfigResource An access configuration attached to an instance's network + * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateAccessConfigInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { + public final Operation updateAccessConfigInstance( + ProjectZoneInstanceName instance, + String networkInterface, + String requestId, + AccessConfig accessConfigResource) { UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setAccessConfigResource(accessConfigResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfigResource(accessConfigResource) + .build(); return updateAccessConfigInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3285,32 +3707,44 @@ public final Operation updateAccessConfigInstance(ProjectZoneInstanceName instan
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface where the access config is attached.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
-   * @param accessConfigResource An access configuration attached to an instance's network interface. Only one access config per instance is supported.
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param accessConfigResource An access configuration attached to an instance's network + * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateAccessConfigInstance(String instance, String networkInterface, String requestId, AccessConfig accessConfigResource) { + public final Operation updateAccessConfigInstance( + String instance, + String networkInterface, + String requestId, + AccessConfig accessConfigResource) { UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setAccessConfigResource(accessConfigResource) - .build(); + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setAccessConfigResource(accessConfigResource) + .build(); return updateAccessConfigInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3337,9 +3771,12 @@ public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3359,7 +3796,8 @@ public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttp
    * 
*/ @BetaApi - public final UnaryCallable updateAccessConfigInstanceCallable() { + public final UnaryCallable + updateAccessConfigInstanceCallable() { return stub.updateAccessConfigInstanceCallable(); } @@ -3367,7 +3805,8 @@ public final UnaryCallable upd /** * Updates an instance's network interface. This method follows PATCH semantics. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3380,24 +3819,32 @@ public final UnaryCallable upd
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface to update.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param networkInterfaceResource A network interface resource attached to an instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateNetworkInterfaceInstance(ProjectZoneInstanceName instance, String networkInterface, String requestId, NetworkInterface networkInterfaceResource) { + public final Operation updateNetworkInterfaceInstance( + ProjectZoneInstanceName instance, + String networkInterface, + String requestId, + NetworkInterface networkInterfaceResource) { UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() - .setInstance(instance == null ? null : instance.toString()) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setNetworkInterfaceResource(networkInterfaceResource) - .build(); + .setInstance(instance == null ? null : instance.toString()) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setNetworkInterfaceResource(networkInterfaceResource) + .build(); return updateNetworkInterfaceInstance(request); } @@ -3405,7 +3852,8 @@ public final Operation updateNetworkInterfaceInstance(ProjectZoneInstanceName in /** * Updates an instance's network interface. This method follows PATCH semantics. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3418,24 +3866,32 @@ public final Operation updateNetworkInterfaceInstance(ProjectZoneInstanceName in
    *
    * @param instance The instance name for this request.
    * @param networkInterface The name of the network interface to update.
-   * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
-   *
-   * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
-   *
-   * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
+   * @param requestId An optional request ID to identify requests. Specify a unique request ID so
+   *     that if you must retry your request, the server will know to ignore the request if it has
+   *     already been completed.
+   *     

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param networkInterfaceResource A network interface resource attached to an instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateNetworkInterfaceInstance(String instance, String networkInterface, String requestId, NetworkInterface networkInterfaceResource) { + public final Operation updateNetworkInterfaceInstance( + String instance, + String networkInterface, + String requestId, + NetworkInterface networkInterfaceResource) { UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setNetworkInterface(networkInterface) - .setRequestId(requestId) - .setNetworkInterfaceResource(networkInterfaceResource) - .build(); + .setInstance(instance) + .setNetworkInterface(networkInterface) + .setRequestId(requestId) + .setNetworkInterfaceResource(networkInterfaceResource) + .build(); return updateNetworkInterfaceInstance(request); } @@ -3443,7 +3899,8 @@ public final Operation updateNetworkInterfaceInstance(String instance, String ne /** * Updates an instance's network interface. This method follows PATCH semantics. * - * Sample code: + *

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3464,7 +3921,8 @@ public final Operation updateNetworkInterfaceInstance(String instance, String ne
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation updateNetworkInterfaceInstance(UpdateNetworkInterfaceInstanceHttpRequest request) {
+  public final Operation updateNetworkInterfaceInstance(
+      UpdateNetworkInterfaceInstanceHttpRequest request) {
     return updateNetworkInterfaceInstanceCallable().call(request);
   }
 
@@ -3472,7 +3930,8 @@ public final Operation updateNetworkInterfaceInstance(UpdateNetworkInterfaceInst
   /**
    * Updates an instance's network interface. This method follows PATCH semantics.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
@@ -3492,12 +3951,13 @@ public final Operation updateNetworkInterfaceInstance(UpdateNetworkInterfaceInst
    * 
*/ @BetaApi - public final UnaryCallable updateNetworkInterfaceInstanceCallable() { + public final UnaryCallable + updateNetworkInterfaceInstanceCallable() { return stub.updateNetworkInterfaceInstanceCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -3526,15 +3986,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListInstancesPagedResponse extends AbstractPagedListResponse< - AggregatedListInstancesHttpRequest, - InstanceAggregatedList, - InstancesScopedList, - AggregatedListInstancesPage, - AggregatedListInstancesFixedSizeCollection> { + public static class AggregatedListInstancesPagedResponse + extends AbstractPagedListResponse< + AggregatedListInstancesHttpRequest, InstanceAggregatedList, InstancesScopedList, + AggregatedListInstancesPage, AggregatedListInstancesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = AggregatedListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -3551,18 +4010,16 @@ public AggregatedListInstancesPagedResponse apply(AggregatedListInstancesPage in private AggregatedListInstancesPagedResponse(AggregatedListInstancesPage page) { super(page, AggregatedListInstancesFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListInstancesPage extends AbstractPage< - AggregatedListInstancesHttpRequest, - InstanceAggregatedList, - InstancesScopedList, - AggregatedListInstancesPage> { + public static class AggregatedListInstancesPage + extends AbstractPage< + AggregatedListInstancesHttpRequest, InstanceAggregatedList, InstancesScopedList, + AggregatedListInstancesPage> { private AggregatedListInstancesPage( - PageContext context, + PageContext + context, InstanceAggregatedList response) { super(context, response); } @@ -3573,31 +4030,28 @@ private static AggregatedListInstancesPage createEmptyPage() { @Override protected AggregatedListInstancesPage createPage( - PageContext context, + PageContext + context, InstanceAggregatedList response) { return new AggregatedListInstancesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListInstancesFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListInstancesHttpRequest, - InstanceAggregatedList, - InstancesScopedList, - AggregatedListInstancesPage, - AggregatedListInstancesFixedSizeCollection> { + public static class AggregatedListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListInstancesHttpRequest, InstanceAggregatedList, InstancesScopedList, + AggregatedListInstancesPage, AggregatedListInstancesFixedSizeCollection> { - private AggregatedListInstancesFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListInstancesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -3610,15 +4064,12 @@ protected AggregatedListInstancesFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListInstancesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInstancesPagedResponse extends AbstractPagedListResponse< - ListInstancesHttpRequest, - InstanceList, - Instance, - ListInstancesPage, - ListInstancesFixedSizeCollection> { + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesHttpRequest, InstanceList, Instance, ListInstancesPage, + ListInstancesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -3638,15 +4089,10 @@ public ListInstancesPagedResponse apply(ListInstancesPage input) { private ListInstancesPagedResponse(ListInstancesPage page) { super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstancesPage extends AbstractPage< - ListInstancesHttpRequest, - InstanceList, - Instance, - ListInstancesPage> { + public static class ListInstancesPage + extends AbstractPage { private ListInstancesPage( PageContext context, @@ -3671,18 +4117,12 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstancesFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstancesHttpRequest, - InstanceList, - Instance, - ListInstancesPage, - ListInstancesFixedSizeCollection> { + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesHttpRequest, InstanceList, Instance, ListInstancesPage, + ListInstancesFixedSizeCollection> { private ListInstancesFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); @@ -3697,15 +4137,12 @@ protected ListInstancesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstancesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListReferrersInstancesPagedResponse extends AbstractPagedListResponse< - ListReferrersInstancesHttpRequest, - InstanceListReferrers, - Reference, - ListReferrersInstancesPage, - ListReferrersInstancesFixedSizeCollection> { + + public static class ListReferrersInstancesPagedResponse + extends AbstractPagedListResponse< + ListReferrersInstancesHttpRequest, InstanceListReferrers, Reference, + ListReferrersInstancesPage, ListReferrersInstancesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -3725,15 +4162,12 @@ public ListReferrersInstancesPagedResponse apply(ListReferrersInstancesPage inpu private ListReferrersInstancesPagedResponse(ListReferrersInstancesPage page) { super(page, ListReferrersInstancesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListReferrersInstancesPage extends AbstractPage< - ListReferrersInstancesHttpRequest, - InstanceListReferrers, - Reference, - ListReferrersInstancesPage> { + public static class ListReferrersInstancesPage + extends AbstractPage< + ListReferrersInstancesHttpRequest, InstanceListReferrers, Reference, + ListReferrersInstancesPage> { private ListReferrersInstancesPage( PageContext context, @@ -3758,20 +4192,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListReferrersInstancesFixedSizeCollection extends AbstractFixedSizeCollection< - ListReferrersInstancesHttpRequest, - InstanceListReferrers, - Reference, - ListReferrersInstancesPage, - ListReferrersInstancesFixedSizeCollection> { + public static class ListReferrersInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListReferrersInstancesHttpRequest, InstanceListReferrers, Reference, + ListReferrersInstancesPage, ListReferrersInstancesFixedSizeCollection> { - private ListReferrersInstancesFixedSizeCollection(List pages, int collectionSize) { + private ListReferrersInstancesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -3784,7 +4213,5 @@ protected ListReferrersInstancesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListReferrersInstancesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java index 30f2f45ff32a..83954bf65eae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -62,7 +61,6 @@ private InstanceGroup() { this.zone = null; } - private InstanceGroup( String creationTimestamp, String description, @@ -76,8 +74,7 @@ private InstanceGroup( String selfLink, Integer size, String subnetwork, - String zone - ) { + String zone) { this.creationTimestamp = creationTimestamp; this.description = description; this.fingerprint = fingerprint; @@ -97,7 +94,8 @@ private InstanceGroup( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -244,22 +242,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroup prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroup getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroup DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroup(); } @@ -466,35 +466,22 @@ public Builder setZone(String zone) { return this; } - public InstanceGroup build() { - - - - - - - - - - - return new InstanceGroup( - creationTimestamp, - description, - fingerprint, - id, - kind, - name, - namedPorts, - network, - region, - selfLink, - size, - subnetwork, - zone - ); + creationTimestamp, + description, + fingerprint, + id, + kind, + name, + namedPorts, + network, + region, + selfLink, + size, + subnetwork, + zone); } public Builder clone() { @@ -519,19 +506,44 @@ public Builder clone() { @Override public String toString() { return "InstanceGroup{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "fingerprint=" + fingerprint + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "namedPorts=" + namedPorts + ", " - + "network=" + network + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "size=" + size + ", " - + "subnetwork=" + subnetwork + ", " - + "zone=" + zone + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "namedPorts=" + + namedPorts + + ", " + + "network=" + + network + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "size=" + + size + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "zone=" + + zone + "}"; } @@ -542,21 +554,19 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroup) { InstanceGroup that = (InstanceGroup) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.namedPorts, that.getNamedPortsList()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.size, that.getSize()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.namedPorts, that.getNamedPortsList()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.size, that.getSize()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -564,19 +574,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - fingerprint, - id, - kind, - name, - namedPorts, - network, - region, - selfLink, - size, - subnetwork, - zone - ); + creationTimestamp, + description, + fingerprint, + id, + kind, + name, + namedPorts, + network, + region, + selfLink, + size, + subnetwork, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java index c00154ba169e..e26acc7fa38c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private InstanceGroupAggregatedList() { this.warning = null; } - private InstanceGroupAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupAggregatedList build() { - - - - - return new InstanceGroupAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceGroupAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupAggregatedList) { InstanceGroupAggregatedList that = (InstanceGroupAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java index 94afe5aa1f75..65f8ebd06cf8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InstanceGroupStub; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,33 +51,32 @@ *
* *

Note: close() needs to be called on the instanceGroupClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of InstanceGroupSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -117,27 +106,23 @@ public class InstanceGroupClient implements BackgroundResource {
   private final InstanceGroupSettings settings;
   private final InstanceGroupStub stub;
 
-
-
-  /**
-   * Constructs an instance of InstanceGroupClient with default settings.
-   */
+  /** Constructs an instance of InstanceGroupClient with default settings. */
   public static final InstanceGroupClient create() throws IOException {
     return create(InstanceGroupSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceGroupClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InstanceGroupClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InstanceGroupClient create(InstanceGroupSettings settings) throws IOException {
+  public static final InstanceGroupClient create(InstanceGroupSettings settings)
+      throws IOException {
     return new InstanceGroupClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceGroupClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InstanceGroupSettings}.
+   * Constructs an instance of InstanceGroupClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use InstanceGroupSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceGroupClient create(InstanceGroupStub stub) {
@@ -145,9 +130,9 @@ public static final InstanceGroupClient create(InstanceGroupStub stub) {
   }
 
   /**
-   * Constructs an instance of InstanceGroupClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InstanceGroupClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected InstanceGroupClient(InstanceGroupSettings settings) throws IOException {
     this.settings = settings;
@@ -169,12 +154,13 @@ public InstanceGroupStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -184,32 +170,41 @@ public InstanceGroupStub getStub() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where you are adding instances. * @param instanceGroupsAddInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstancesInstanceGroup(String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + public final Operation addInstancesInstanceGroup( + String requestId, + ProjectZoneInstanceGroupName instanceGroup, + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) + .build(); return addInstancesInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -219,32 +214,41 @@ public final Operation addInstancesInstanceGroup(String requestId, ProjectZoneIn
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where you are adding instances. * @param instanceGroupsAddInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstancesInstanceGroup(String requestId, String instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { + public final Operation addInstancesInstanceGroup( + String requestId, + String instanceGroup, + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup) - .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup) + .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) + .build(); return addInstancesInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -269,9 +273,11 @@ public final Operation addInstancesInstanceGroup(AddInstancesInstanceGroupHttpRe
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -289,7 +295,8 @@ public final Operation addInstancesInstanceGroup(AddInstancesInstanceGroupHttpRe
    * 
*/ @BetaApi - public final UnaryCallable addInstancesInstanceGroupCallable() { + public final UnaryCallable + addInstancesInstanceGroupCallable() { return stub.addInstancesInstanceGroupCallable(); } @@ -297,7 +304,8 @@ public final UnaryCallable addI /** * Retrieves the list of instance groups and sorts them by zone. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -311,11 +319,12 @@ public final UnaryCallable addI
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(ProjectName project) {
+  public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(
+      ProjectName project) {
     AggregatedListInstanceGroupsHttpRequest request =
         AggregatedListInstanceGroupsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListInstanceGroups(request);
   }
 
@@ -323,7 +332,8 @@ public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGro
   /**
    * Retrieves the list of instance groups and sorts them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -337,11 +347,10 @@ public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(String project) {
+  public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(
+      String project) {
     AggregatedListInstanceGroupsHttpRequest request =
-        AggregatedListInstanceGroupsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListInstanceGroupsHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListInstanceGroups(request);
   }
 
@@ -349,7 +358,8 @@ public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGro
   /**
    * Retrieves the list of instance groups and sorts them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -366,16 +376,17 @@ public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(AggregatedListInstanceGroupsHttpRequest request) {
-    return aggregatedListInstanceGroupsPagedCallable()
-        .call(request);
+  public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGroups(
+      AggregatedListInstanceGroupsHttpRequest request) {
+    return aggregatedListInstanceGroupsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of instance groups and sorts them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -391,7 +402,9 @@ public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGro
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListInstanceGroupsPagedCallable() { + public final UnaryCallable< + AggregatedListInstanceGroupsHttpRequest, AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsPagedCallable() { return stub.aggregatedListInstanceGroupsPagedCallable(); } @@ -399,7 +412,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -422,15 +436,19 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListInstanceGroupsCallable() { + public final UnaryCallable + aggregatedListInstanceGroupsCallable() { return stub.aggregatedListInstanceGroupsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -439,30 +457,38 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroup(String requestId, ProjectZoneInstanceGroupName instanceGroup) { + public final Operation deleteInstanceGroup( + String requestId, ProjectZoneInstanceGroupName instanceGroup) { DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .build(); return deleteInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -471,11 +497,15 @@ public final Operation deleteInstanceGroup(String requestId, ProjectZoneInstance
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -484,17 +514,20 @@ public final Operation deleteInstanceGroup(String requestId, String instanceGrou DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup) + .build(); return deleteInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -517,9 +550,12 @@ public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest reques
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -535,15 +571,18 @@ public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable deleteInstanceGroupCallable() { + public final UnaryCallable + deleteInstanceGroupCallable() { return stub.deleteInstanceGroupCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance group. Get a list of available instance groups by making a list() request. + * Returns the specified instance group. Get a list of available instance groups by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -559,16 +598,18 @@ public final InstanceGroup getInstanceGroup(ProjectZoneInstanceGroupName instanc
 
     GetInstanceGroupHttpRequest request =
         GetInstanceGroupHttpRequest.newBuilder()
-        .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString())
-        .build();
+            .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString())
+            .build();
     return getInstanceGroup(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance group. Get a list of available instance groups by making a list() request.
+   * Returns the specified instance group. Get a list of available instance groups by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -583,17 +624,17 @@ public final InstanceGroup getInstanceGroup(ProjectZoneInstanceGroupName instanc
   public final InstanceGroup getInstanceGroup(String instanceGroup) {
 
     GetInstanceGroupHttpRequest request =
-        GetInstanceGroupHttpRequest.newBuilder()
-        .setInstanceGroup(instanceGroup)
-        .build();
+        GetInstanceGroupHttpRequest.newBuilder().setInstanceGroup(instanceGroup).build();
     return getInstanceGroup(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance group. Get a list of available instance groups by making a list() request.
+   * Returns the specified instance group. Get a list of available instance groups by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -614,9 +655,11 @@ public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request)
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance group. Get a list of available instance groups by making a list() request.
+   * Returns the specified instance group. Get a list of available instance groups by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -630,15 +673,18 @@ public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable getInstanceGroupCallable() { + public final UnaryCallable + getInstanceGroupCallable() { return stub.getInstanceGroupCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates an instance group in the specified project using the parameters that are included in the request. + * Creates an instance group in the specified project using the parameters that are included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -649,31 +695,40 @@ public final UnaryCallable getInstan
    * 
* * @param zone The name of the zone where you want to create the instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== + * resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== + * resource_for v1.regionInstanceGroups ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroup(ProjectZoneName zone, String requestId, InstanceGroup instanceGroupResource) { + public final Operation insertInstanceGroup( + ProjectZoneName zone, String requestId, InstanceGroup instanceGroupResource) { InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setInstanceGroupResource(instanceGroupResource) - .build(); + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setInstanceGroupResource(instanceGroupResource) + .build(); return insertInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates an instance group in the specified project using the parameters that are included in the request. + * Creates an instance group in the specified project using the parameters that are included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -684,31 +739,40 @@ public final Operation insertInstanceGroup(ProjectZoneName zone, String requestI
    * 
* * @param zone The name of the zone where you want to create the instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== + * resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== + * resource_for v1.regionInstanceGroups ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroup(String zone, String requestId, InstanceGroup instanceGroupResource) { + public final Operation insertInstanceGroup( + String zone, String requestId, InstanceGroup instanceGroupResource) { InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setInstanceGroupResource(instanceGroupResource) - .build(); + .setZone(zone) + .setRequestId(requestId) + .setInstanceGroupResource(instanceGroupResource) + .build(); return insertInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates an instance group in the specified project using the parameters that are included in the request. + * Creates an instance group in the specified project using the parameters that are included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -733,9 +797,11 @@ public final Operation insertInstanceGroup(InsertInstanceGroupHttpRequest reques
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates an instance group in the specified project using the parameters that are included in the request.
+   * Creates an instance group in the specified project using the parameters that are included in
+   * the request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -753,7 +819,8 @@ public final Operation insertInstanceGroup(InsertInstanceGroupHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable insertInstanceGroupCallable() { + public final UnaryCallable + insertInstanceGroupCallable() { return stub.insertInstanceGroupCallable(); } @@ -761,7 +828,8 @@ public final UnaryCallable insertInst /** * Retrieves the list of instance groups that are located in the specified project and zone. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -778,8 +846,8 @@ public final UnaryCallable insertInst
   public final ListInstanceGroupsPagedResponse listInstanceGroups(ProjectZoneName zone) {
     ListInstanceGroupsHttpRequest request =
         ListInstanceGroupsHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listInstanceGroups(request);
   }
 
@@ -787,7 +855,8 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(ProjectZoneName
   /**
    * Retrieves the list of instance groups that are located in the specified project and zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -803,9 +872,7 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(ProjectZoneName
   @BetaApi
   public final ListInstanceGroupsPagedResponse listInstanceGroups(String zone) {
     ListInstanceGroupsHttpRequest request =
-        ListInstanceGroupsHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListInstanceGroupsHttpRequest.newBuilder().setZone(zone).build();
     return listInstanceGroups(request);
   }
 
@@ -813,7 +880,8 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(String zone) {
   /**
    * Retrieves the list of instance groups that are located in the specified project and zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -830,16 +898,17 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(String zone) {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupsPagedResponse listInstanceGroups(ListInstanceGroupsHttpRequest request) {
-    return listInstanceGroupsPagedCallable()
-        .call(request);
+  public final ListInstanceGroupsPagedResponse listInstanceGroups(
+      ListInstanceGroupsHttpRequest request) {
+    return listInstanceGroupsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of instance groups that are located in the specified project and zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -855,7 +924,8 @@ public final ListInstanceGroupsPagedResponse listInstanceGroups(ListInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable listInstanceGroupsPagedCallable() { + public final UnaryCallable + listInstanceGroupsPagedCallable() { return stub.listInstanceGroupsPagedCallable(); } @@ -863,7 +933,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -886,7 +957,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstanceGroupsCallable() { + public final UnaryCallable + listInstanceGroupsCallable() { return stub.listInstanceGroupsCallable(); } @@ -894,7 +966,8 @@ public final UnaryCallable lis /** * Lists the instances in the specified instance group. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -905,17 +978,21 @@ public final UnaryCallable lis
    * }
    * 
* - * @param instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param instanceGroup The name of the instance group from which you want to generate a list of + * included instances. * @param instanceGroupsListInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups( + ProjectZoneInstanceGroupName instanceGroup, + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder() - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource) - .build(); + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsListInstancesRequestResource( + instanceGroupsListInstancesRequestResource) + .build(); return listInstancesInstanceGroups(request); } @@ -923,7 +1000,8 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup /** * Lists the instances in the specified instance group. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -934,17 +1012,21 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    * }
    * 
* - * @param instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param instanceGroup The name of the instance group from which you want to generate a list of + * included instances. * @param instanceGroupsListInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(String instanceGroup, InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups( + String instanceGroup, + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { ListInstancesInstanceGroupsHttpRequest request = ListInstancesInstanceGroupsHttpRequest.newBuilder() - .setInstanceGroup(instanceGroup) - .setInstanceGroupsListInstancesRequestResource(instanceGroupsListInstancesRequestResource) - .build(); + .setInstanceGroup(instanceGroup) + .setInstanceGroupsListInstancesRequestResource( + instanceGroupsListInstancesRequestResource) + .build(); return listInstancesInstanceGroups(request); } @@ -952,7 +1034,8 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup /** * Lists the instances in the specified instance group. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -971,16 +1054,17 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(ListInstancesInstanceGroupsHttpRequest request) {
-    return listInstancesInstanceGroupsPagedCallable()
-        .call(request);
+  public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroups(
+      ListInstancesInstanceGroupsHttpRequest request) {
+    return listInstancesInstanceGroupsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Lists the instances in the specified instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -998,7 +1082,9 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    * 
*/ @BetaApi - public final UnaryCallable listInstancesInstanceGroupsPagedCallable() { + public final UnaryCallable< + ListInstancesInstanceGroupsHttpRequest, ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsPagedCallable() { return stub.listInstancesInstanceGroupsPagedCallable(); } @@ -1006,7 +1092,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
@@ -1031,17 +1118,22 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstancesInstanceGroupsCallable() { + public final UnaryCallable + listInstancesInstanceGroupsCallable() { return stub.listInstancesInstanceGroupsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Removes one or more instances from the specified instance group, but does not delete those instances. + * 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. + *

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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1051,34 +1143,47 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceGroup The name of the instance group where the specified instances will be removed. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceGroup The name of the instance group where the specified instances will be + * removed. * @param instanceGroupsRemoveInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstancesInstanceGroup(String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + public final Operation removeInstancesInstanceGroup( + String requestId, + ProjectZoneInstanceGroupName instanceGroup, + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsRemoveInstancesRequestResource( + instanceGroupsRemoveInstancesRequestResource) + .build(); return removeInstancesInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Removes one or more instances from the specified instance group, but does not delete those instances. + * 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. + *

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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1088,34 +1193,47 @@ public final Operation removeInstancesInstanceGroup(String requestId, ProjectZon
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceGroup The name of the instance group where the specified instances will be removed. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceGroup The name of the instance group where the specified instances will be + * removed. * @param instanceGroupsRemoveInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstancesInstanceGroup(String requestId, String instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + public final Operation removeInstancesInstanceGroup( + String requestId, + String instanceGroup, + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup) - .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup) + .setInstanceGroupsRemoveInstancesRequestResource( + instanceGroupsRemoveInstancesRequestResource) + .build(); return removeInstancesInstanceGroup(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Removes one or more instances from the specified instance group, but does not delete those instances. + * 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. + *

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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1134,17 +1252,22 @@ public final Operation removeInstancesInstanceGroup(String requestId, String ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation removeInstancesInstanceGroup(RemoveInstancesInstanceGroupHttpRequest request) {
+  public final Operation removeInstancesInstanceGroup(
+      RemoveInstancesInstanceGroupHttpRequest request) {
     return removeInstancesInstanceGroupCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Removes one or more instances from the specified instance group, but does not delete those instances.
+   * 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. * - * 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: * - * Sample code: *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1162,7 +1285,8 @@ public final Operation removeInstancesInstanceGroup(RemoveInstancesInstanceGroup
    * 
*/ @BetaApi - public final UnaryCallable removeInstancesInstanceGroupCallable() { + public final UnaryCallable + removeInstancesInstanceGroupCallable() { return stub.removeInstancesInstanceGroupCallable(); } @@ -1170,7 +1294,8 @@ public final UnaryCallable r /** * Sets the named ports for the specified instance group. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1180,24 +1305,32 @@ public final UnaryCallable r
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the named ports are updated. * @param instanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsInstanceGroup(String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsInstanceGroup( + String requestId, + ProjectZoneInstanceGroupName instanceGroup, + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setInstanceGroupsSetNamedPortsRequestResource( + instanceGroupsSetNamedPortsRequestResource) + .build(); return setNamedPortsInstanceGroup(request); } @@ -1205,7 +1338,8 @@ public final Operation setNamedPortsInstanceGroup(String requestId, ProjectZoneI /** * Sets the named ports for the specified instance group. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1215,24 +1349,32 @@ public final Operation setNamedPortsInstanceGroup(String requestId, ProjectZoneI
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the named ports are updated. * @param instanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsInstanceGroup(String requestId, String instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsInstanceGroup( + String requestId, + String instanceGroup, + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup) - .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup) + .setInstanceGroupsSetNamedPortsRequestResource( + instanceGroupsSetNamedPortsRequestResource) + .build(); return setNamedPortsInstanceGroup(request); } @@ -1240,7 +1382,8 @@ public final Operation setNamedPortsInstanceGroup(String requestId, String insta /** * Sets the named ports for the specified instance group. * - * Sample code: + *

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1267,7 +1410,8 @@ public final Operation setNamedPortsInstanceGroup(SetNamedPortsInstanceGroupHttp
   /**
    * Sets the named ports for the specified instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   String requestId = "";
@@ -1285,12 +1429,13 @@ public final Operation setNamedPortsInstanceGroup(SetNamedPortsInstanceGroupHttp
    * 
*/ @BetaApi - public final UnaryCallable setNamedPortsInstanceGroupCallable() { + public final UnaryCallable + setNamedPortsInstanceGroupCallable() { return stub.setNamedPortsInstanceGroupCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1319,23 +1464,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListInstanceGroupsPagedResponse extends AbstractPagedListResponse< - AggregatedListInstanceGroupsHttpRequest, - InstanceGroupAggregatedList, - InstanceGroupsScopedList, - AggregatedListInstanceGroupsPage, - AggregatedListInstanceGroupsFixedSizeCollection> { + public static class AggregatedListInstanceGroupsPagedResponse + extends AbstractPagedListResponse< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList, AggregatedListInstanceGroupsPage, + AggregatedListInstanceGroupsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListInstanceGroupsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListInstanceGroupsPage, AggregatedListInstanceGroupsPagedResponse>() { @Override - public AggregatedListInstanceGroupsPagedResponse apply(AggregatedListInstanceGroupsPage input) { + public AggregatedListInstanceGroupsPagedResponse apply( + AggregatedListInstanceGroupsPage input) { return new AggregatedListInstanceGroupsPagedResponse(input); } }); @@ -1344,18 +1494,18 @@ public AggregatedListInstanceGroupsPagedResponse apply(AggregatedListInstanceGro private AggregatedListInstanceGroupsPagedResponse(AggregatedListInstanceGroupsPage page) { super(page, AggregatedListInstanceGroupsFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListInstanceGroupsPage extends AbstractPage< - AggregatedListInstanceGroupsHttpRequest, - InstanceGroupAggregatedList, - InstanceGroupsScopedList, - AggregatedListInstanceGroupsPage> { + public static class AggregatedListInstanceGroupsPage + extends AbstractPage< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList, AggregatedListInstanceGroupsPage> { private AggregatedListInstanceGroupsPage( - PageContext context, + PageContext< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList> + context, InstanceGroupAggregatedList response) { super(context, response); } @@ -1366,31 +1516,33 @@ private static AggregatedListInstanceGroupsPage createEmptyPage() { @Override protected AggregatedListInstanceGroupsPage createPage( - PageContext context, + PageContext< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList> + context, InstanceGroupAggregatedList response) { return new AggregatedListInstanceGroupsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListInstanceGroupsHttpRequest, - InstanceGroupAggregatedList, - InstanceGroupsScopedList, - AggregatedListInstanceGroupsPage, - AggregatedListInstanceGroupsFixedSizeCollection> { + public static class AggregatedListInstanceGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + InstanceGroupsScopedList, AggregatedListInstanceGroupsPage, + AggregatedListInstanceGroupsFixedSizeCollection> { - private AggregatedListInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListInstanceGroupsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1403,15 +1555,12 @@ protected AggregatedListInstanceGroupsFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListInstanceGroupsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInstanceGroupsPagedResponse extends AbstractPagedListResponse< - ListInstanceGroupsHttpRequest, - InstanceGroupList, - InstanceGroup, - ListInstanceGroupsPage, - ListInstanceGroupsFixedSizeCollection> { + + public static class ListInstanceGroupsPagedResponse + extends AbstractPagedListResponse< + ListInstanceGroupsHttpRequest, InstanceGroupList, InstanceGroup, ListInstanceGroupsPage, + ListInstanceGroupsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1431,15 +1580,11 @@ public ListInstanceGroupsPagedResponse apply(ListInstanceGroupsPage input) { private ListInstanceGroupsPagedResponse(ListInstanceGroupsPage page) { super(page, ListInstanceGroupsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstanceGroupsPage extends AbstractPage< - ListInstanceGroupsHttpRequest, - InstanceGroupList, - InstanceGroup, - ListInstanceGroupsPage> { + public static class ListInstanceGroupsPage + extends AbstractPage< + ListInstanceGroupsHttpRequest, InstanceGroupList, InstanceGroup, ListInstanceGroupsPage> { private ListInstanceGroupsPage( PageContext context, @@ -1464,20 +1609,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstanceGroupsHttpRequest, - InstanceGroupList, - InstanceGroup, - ListInstanceGroupsPage, - ListInstanceGroupsFixedSizeCollection> { + public static class ListInstanceGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstanceGroupsHttpRequest, InstanceGroupList, InstanceGroup, ListInstanceGroupsPage, + ListInstanceGroupsFixedSizeCollection> { - private ListInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + private ListInstanceGroupsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1490,26 +1630,30 @@ protected ListInstanceGroupsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceGroupsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInstancesInstanceGroupsPagedResponse extends AbstractPagedListResponse< - ListInstancesInstanceGroupsHttpRequest, - InstanceGroupsListInstances, - InstanceWithNamedPorts, - ListInstancesInstanceGroupsPage, - ListInstancesInstanceGroupsFixedSizeCollection> { + + public static class ListInstancesInstanceGroupsPagedResponse + extends AbstractPagedListResponse< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts, ListInstancesInstanceGroupsPage, + ListInstancesInstanceGroupsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts> + context, ApiFuture futureResponse) { ApiFuture futurePage = - ListInstancesInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + ListInstancesInstanceGroupsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + ListInstancesInstanceGroupsPage, ListInstancesInstanceGroupsPagedResponse>() { @Override - public ListInstancesInstanceGroupsPagedResponse apply(ListInstancesInstanceGroupsPage input) { + public ListInstancesInstanceGroupsPagedResponse apply( + ListInstancesInstanceGroupsPage input) { return new ListInstancesInstanceGroupsPagedResponse(input); } }); @@ -1518,18 +1662,18 @@ public ListInstancesInstanceGroupsPagedResponse apply(ListInstancesInstanceGroup private ListInstancesInstanceGroupsPagedResponse(ListInstancesInstanceGroupsPage page) { super(page, ListInstancesInstanceGroupsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstancesInstanceGroupsPage extends AbstractPage< - ListInstancesInstanceGroupsHttpRequest, - InstanceGroupsListInstances, - InstanceWithNamedPorts, - ListInstancesInstanceGroupsPage> { + public static class ListInstancesInstanceGroupsPage + extends AbstractPage< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts, ListInstancesInstanceGroupsPage> { private ListInstancesInstanceGroupsPage( - PageContext context, + PageContext< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts> + context, InstanceGroupsListInstances response) { super(context, response); } @@ -1540,31 +1684,33 @@ private static ListInstancesInstanceGroupsPage createEmptyPage() { @Override protected ListInstancesInstanceGroupsPage createPage( - PageContext context, + PageContext< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts> + context, InstanceGroupsListInstances response) { return new ListInstancesInstanceGroupsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstancesInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstancesInstanceGroupsHttpRequest, - InstanceGroupsListInstances, - InstanceWithNamedPorts, - ListInstancesInstanceGroupsPage, - ListInstancesInstanceGroupsFixedSizeCollection> { + public static class ListInstancesInstanceGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + InstanceWithNamedPorts, ListInstancesInstanceGroupsPage, + ListInstancesInstanceGroupsFixedSizeCollection> { - private ListInstancesInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + private ListInstancesInstanceGroupsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1577,7 +1723,5 @@ protected ListInstancesInstanceGroupsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstancesInstanceGroupsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java index 59b59460690f..61e7a98c78bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InstanceGroupList() { this.warning = null; } - private InstanceGroupList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupList build() { - - - - - return new InstanceGroupList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceGroupList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupList) { InstanceGroupList that = (InstanceGroupList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java index 56796afeb6a0..2a5b1234ee97 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -68,7 +67,6 @@ private InstanceGroupManager() { this.zone = null; } - private InstanceGroupManager( String baseInstanceName, String creationTimestamp, @@ -85,8 +83,7 @@ private InstanceGroupManager( String selfLink, List targetPools, Integer targetSize, - String zone - ) { + String zone) { this.baseInstanceName = baseInstanceName; this.creationTimestamp = creationTimestamp; this.currentActions = currentActions; @@ -112,7 +109,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("baseInstanceName", Collections.singletonList(String.valueOf(baseInstanceName))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("currentActions") && currentActions != null) { fieldMap.put("currentActions", Collections.singletonList(String.valueOf(currentActions))); @@ -290,22 +288,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManager prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManager getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManager DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManager(); } @@ -562,41 +562,25 @@ public Builder setZone(String zone) { return this; } - public InstanceGroupManager build() { - - - - - - - - - - - - - - return new InstanceGroupManager( - baseInstanceName, - creationTimestamp, - currentActions, - description, - fingerprint, - id, - instanceGroup, - instanceTemplate, - kind, - name, - namedPorts, - region, - selfLink, - targetPools, - targetSize, - zone - ); + baseInstanceName, + creationTimestamp, + currentActions, + description, + fingerprint, + id, + instanceGroup, + instanceTemplate, + kind, + name, + namedPorts, + region, + selfLink, + targetPools, + targetSize, + zone); } public Builder clone() { @@ -624,22 +608,53 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManager{" - + "baseInstanceName=" + baseInstanceName + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "currentActions=" + currentActions + ", " - + "description=" + description + ", " - + "fingerprint=" + fingerprint + ", " - + "id=" + id + ", " - + "instanceGroup=" + instanceGroup + ", " - + "instanceTemplate=" + instanceTemplate + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "namedPorts=" + namedPorts + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "targetPools=" + targetPools + ", " - + "targetSize=" + targetSize + ", " - + "zone=" + zone + + "baseInstanceName=" + + baseInstanceName + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "currentActions=" + + currentActions + + ", " + + "description=" + + description + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "id=" + + id + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "instanceTemplate=" + + instanceTemplate + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "namedPorts=" + + namedPorts + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "targetPools=" + + targetPools + + ", " + + "targetSize=" + + targetSize + + ", " + + "zone=" + + zone + "}"; } @@ -650,24 +665,22 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupManager) { InstanceGroupManager that = (InstanceGroupManager) o; - return - Objects.equals(this.baseInstanceName, that.getBaseInstanceName()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.currentActions, that.getCurrentActions()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.namedPorts, that.getNamedPortsList()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.targetPools, that.getTargetPoolsList()) && - Objects.equals(this.targetSize, that.getTargetSize()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.baseInstanceName, that.getBaseInstanceName()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.currentActions, that.getCurrentActions()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.namedPorts, that.getNamedPortsList()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.targetPools, that.getTargetPoolsList()) + && Objects.equals(this.targetSize, that.getTargetSize()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -675,22 +688,21 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - baseInstanceName, - creationTimestamp, - currentActions, - description, - fingerprint, - id, - instanceGroup, - instanceTemplate, - kind, - name, - namedPorts, - region, - selfLink, - targetPools, - targetSize, - zone - ); + baseInstanceName, + creationTimestamp, + currentActions, + description, + fingerprint, + id, + instanceGroup, + instanceTemplate, + kind, + name, + namedPorts, + region, + selfLink, + targetPools, + targetSize, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java index 3523709d86db..4ffb882381ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private InstanceGroupManagerActionsSummary() { this.restarting = null; } - private InstanceGroupManagerActionsSummary( Integer abandoning, Integer creating, @@ -61,8 +57,7 @@ private InstanceGroupManagerActionsSummary( Integer none, Integer recreating, Integer refreshing, - Integer restarting - ) { + Integer restarting) { this.abandoning = abandoning; this.creating = creating; this.creatingWithoutRetries = creatingWithoutRetries; @@ -83,7 +78,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("creating", Collections.singletonList(String.valueOf(creating))); } if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) { - fieldMap.put("creatingWithoutRetries", Collections.singletonList(String.valueOf(creatingWithoutRetries))); + fieldMap.put( + "creatingWithoutRetries", + Collections.singletonList(String.valueOf(creatingWithoutRetries))); } if (fieldNames.contains("deleting") && deleting != null) { fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting))); @@ -170,22 +167,24 @@ public Integer getRestarting() { return restarting; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagerActionsSummary prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagerActionsSummary getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagerActionsSummary DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagerActionsSummary(); } @@ -314,25 +313,17 @@ public Builder setRestarting(Integer restarting) { return this; } - public InstanceGroupManagerActionsSummary build() { - - - - - - return new InstanceGroupManagerActionsSummary( - abandoning, - creating, - creatingWithoutRetries, - deleting, - none, - recreating, - refreshing, - restarting - ); + abandoning, + creating, + creatingWithoutRetries, + deleting, + none, + recreating, + refreshing, + restarting); } public Builder clone() { @@ -352,14 +343,29 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagerActionsSummary{" - + "abandoning=" + abandoning + ", " - + "creating=" + creating + ", " - + "creatingWithoutRetries=" + creatingWithoutRetries + ", " - + "deleting=" + deleting + ", " - + "none=" + none + ", " - + "recreating=" + recreating + ", " - + "refreshing=" + refreshing + ", " - + "restarting=" + restarting + + "abandoning=" + + abandoning + + ", " + + "creating=" + + creating + + ", " + + "creatingWithoutRetries=" + + creatingWithoutRetries + + ", " + + "deleting=" + + deleting + + ", " + + "none=" + + none + + ", " + + "recreating=" + + recreating + + ", " + + "refreshing=" + + refreshing + + ", " + + "restarting=" + + restarting + "}"; } @@ -370,16 +376,14 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupManagerActionsSummary) { InstanceGroupManagerActionsSummary that = (InstanceGroupManagerActionsSummary) o; - return - Objects.equals(this.abandoning, that.getAbandoning()) && - Objects.equals(this.creating, that.getCreating()) && - Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries()) && - Objects.equals(this.deleting, that.getDeleting()) && - Objects.equals(this.none, that.getNone()) && - Objects.equals(this.recreating, that.getRecreating()) && - Objects.equals(this.refreshing, that.getRefreshing()) && - Objects.equals(this.restarting, that.getRestarting()) - ; + return Objects.equals(this.abandoning, that.getAbandoning()) + && Objects.equals(this.creating, that.getCreating()) + && Objects.equals(this.creatingWithoutRetries, that.getCreatingWithoutRetries()) + && Objects.equals(this.deleting, that.getDeleting()) + && Objects.equals(this.none, that.getNone()) + && Objects.equals(this.recreating, that.getRecreating()) + && Objects.equals(this.refreshing, that.getRefreshing()) + && Objects.equals(this.restarting, that.getRestarting()); } return false; } @@ -387,14 +391,13 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - abandoning, - creating, - creatingWithoutRetries, - deleting, - none, - recreating, - refreshing, - restarting - ); + abandoning, + creating, + creatingWithoutRetries, + deleting, + none, + recreating, + refreshing, + restarting); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java index 47df696c2b98..f6d9303baa32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private InstanceGroupManagerAggregatedList() { this.warning = null; } - private InstanceGroupManagerAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagerAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagerAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagerAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagerAggregatedList(); } @@ -258,21 +255,10 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupManagerAggregatedList build() { - - - - return new InstanceGroupManagerAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +276,23 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagerAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +303,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupManagerAggregatedList) { InstanceGroupManagerAggregatedList that = (InstanceGroupManagerAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java index 63b62bc8234d..91a2f4b2b7a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InstanceGroupManagerStub; import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,34 +50,34 @@ *
*
* - *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the instanceGroupManagerClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of InstanceGroupManagerSettings + * to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -117,27 +107,23 @@ public class InstanceGroupManagerClient implements BackgroundResource {
   private final InstanceGroupManagerSettings settings;
   private final InstanceGroupManagerStub stub;
 
-
-
-  /**
-   * Constructs an instance of InstanceGroupManagerClient with default settings.
-   */
+  /** Constructs an instance of InstanceGroupManagerClient with default settings. */
   public static final InstanceGroupManagerClient create() throws IOException {
     return create(InstanceGroupManagerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InstanceGroupManagerClient, using the given settings. The channels
+   * are created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings) throws IOException {
+  public static final InstanceGroupManagerClient create(InstanceGroupManagerSettings settings)
+      throws IOException {
     return new InstanceGroupManagerClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InstanceGroupManagerSettings}.
+   * Constructs an instance of InstanceGroupManagerClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use InstanceGroupManagerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceGroupManagerClient create(InstanceGroupManagerStub stub) {
@@ -145,9 +131,9 @@ public static final InstanceGroupManagerClient create(InstanceGroupManagerStub s
   }
 
   /**
-   * Constructs an instance of InstanceGroupManagerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InstanceGroupManagerClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
   protected InstanceGroupManagerClient(InstanceGroupManagerSettings settings) throws IOException {
     this.settings = settings;
@@ -169,16 +155,24 @@ public InstanceGroupManagerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -188,36 +182,55 @@ public InstanceGroupManagerStub getStub() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesInstanceGroupManager( + String requestId, + ProjectZoneInstanceGroupManagerName instanceGroupManager, + InstanceGroupManagersAbandonInstancesRequest + instanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersAbandonInstancesRequestResource( + instanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -227,36 +240,54 @@ public final Operation abandonInstancesInstanceGroupManager(String requestId, Pr
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesInstanceGroupManager( + String requestId, + String instanceGroupManager, + InstanceGroupManagersAbandonInstancesRequest + instanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersAbandonInstancesRequestResource( + instanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. + *

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -275,19 +306,29 @@ public final Operation abandonInstancesInstanceGroupManager(String requestId, St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation abandonInstancesInstanceGroupManager(
+      AbandonInstancesInstanceGroupManagerHttpRequest request) {
     return abandonInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -305,7 +346,8 @@ public final Operation abandonInstancesInstanceGroupManager(AbandonInstancesInst
    * 
*/ @BetaApi - public final UnaryCallable abandonInstancesInstanceGroupManagerCallable() { + public final UnaryCallable + abandonInstancesInstanceGroupManagerCallable() { return stub.abandonInstancesInstanceGroupManagerCallable(); } @@ -313,7 +355,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -327,11 +370,12 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -353,11 +398,10 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(String project) {
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
+      String project) {
     AggregatedListInstanceGroupManagersHttpRequest request =
-        AggregatedListInstanceGroupManagersHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListInstanceGroupManagersHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListInstanceGroupManagers(request);
   }
 
@@ -365,7 +409,8 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -382,16 +427,17 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(AggregatedListInstanceGroupManagersHttpRequest request) {
-    return aggregatedListInstanceGroupManagersPagedCallable()
-        .call(request);
+  public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInstanceGroupManagers(
+      AggregatedListInstanceGroupManagersHttpRequest request) {
+    return aggregatedListInstanceGroupManagersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of managed instance groups and groups them by zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -407,7 +453,10 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { + public final UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersPagedCallable() { return stub.aggregatedListInstanceGroupManagersPagedCallable(); } @@ -415,7 +464,8 @@ public final UnaryCallableSample code: + * *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -438,15 +488,20 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListInstanceGroupManagersCallable() { + public final UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersCallable() { return stub.aggregatedListInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -455,30 +510,39 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager) { + public final Operation deleteInstanceGroupManager( + String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager) { DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return deleteInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -487,11 +551,15 @@ public final Operation deleteInstanceGroupManager(String requestId, ProjectZoneI
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -500,17 +568,20 @@ public final Operation deleteInstanceGroupManager(String requestId, String insta DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return deleteInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -533,9 +604,12 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -551,19 +625,28 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable deleteInstanceGroupManagerCallable() { + public final UnaryCallable + deleteInstanceGroupManagerCallable() { return stub.deleteInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. + *

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -573,36 +656,54 @@ public final UnaryCallable del
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesInstanceGroupManager( + String requestId, + ProjectZoneInstanceGroupManagerName instanceGroupManager, + InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersDeleteInstancesRequestResource( + instanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -612,36 +713,53 @@ public final Operation deleteInstancesInstanceGroupManager(String requestId, Pro
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesInstanceGroupManager( + String requestId, + String instanceGroupManager, + InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersDeleteInstancesRequestResource( + instanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -660,19 +778,28 @@ public final Operation deleteInstancesInstanceGroupManager(String requestId, Str
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteInstancesInstanceGroupManager(
+      DeleteInstancesInstanceGroupManagerHttpRequest request) {
     return deleteInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * 

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -690,15 +817,18 @@ public final Operation deleteInstancesInstanceGroupManager(DeleteInstancesInstan
    * 
*/ @BetaApi - public final UnaryCallable deleteInstancesInstanceGroupManagerCallable() { + public final UnaryCallable + deleteInstancesInstanceGroupManagerCallable() { return stub.deleteInstancesInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. + * Returns all of the details about the specified managed instance group. Get a list of available + * managed instance groups by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -710,20 +840,24 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -739,16 +873,18 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa
 
     GetInstanceGroupManagerHttpRequest request =
         GetInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return getInstanceGroupManager(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request.
+   * Returns all of the details about the specified managed instance group. Get a list of available
+   * managed instance groups by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -763,15 +899,18 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManagerHttpRequest request) {
+  public final InstanceGroupManager getInstanceGroupManager(
+      GetInstanceGroupManagerHttpRequest request) {
     return getInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request.
+   * Returns all of the details about the specified managed instance group. Get a list of available
+   * managed instance groups by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -785,17 +924,24 @@ public final InstanceGroupManager getInstanceGroupManager(GetInstanceGroupManage
    * 
*/ @BetaApi - public final UnaryCallable getInstanceGroupManagerCallable() { + public final UnaryCallable + getInstanceGroupManagerCallable() { return stub.getInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. * - * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -806,33 +952,47 @@ public final UnaryCallable
* * @param zone The name of the zone where you want to create the managed instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroupManager(ProjectZoneName zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertInstanceGroupManager( + ProjectZoneName zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. * - * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -843,33 +1003,47 @@ public final Operation insertInstanceGroupManager(ProjectZoneName zone, String r
    * 
* * @param zone The name of the zone where you want to create the managed instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroupManager(String zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertInstanceGroupManager( + String zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setZone(zone) + .setRequestId(requestId) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. + *

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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -894,11 +1068,17 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After
+   * the group is created, it schedules an action to create instances in the group 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. * - * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -916,15 +1096,18 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable insertInstanceGroupManagerCallable() { + public final UnaryCallable + insertInstanceGroupManagerCallable() { return stub.insertInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * Retrieves a list of managed instance groups that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -938,19 +1121,22 @@ public final UnaryCallable ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ProjectZoneName zone) {
+  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
+      ProjectZoneName zone) {
     ListInstanceGroupManagersHttpRequest request =
         ListInstanceGroupManagersHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and zone.
+   * Retrieves a list of managed instance groups that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -966,17 +1152,17 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Pr
   @BetaApi
   public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(String zone) {
     ListInstanceGroupManagersHttpRequest request =
-        ListInstanceGroupManagersHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListInstanceGroupManagersHttpRequest.newBuilder().setZone(zone).build();
     return listInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and zone.
+   * Retrieves a list of managed instance groups that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -993,16 +1179,18 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(ListInstanceGroupManagersHttpRequest request) {
-    return listInstanceGroupManagersPagedCallable()
-        .call(request);
+  public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
+      ListInstanceGroupManagersHttpRequest request) {
+    return listInstanceGroupManagersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of managed instance groups that are contained within the specified project and zone.
+   * Retrieves a list of managed instance groups that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1018,15 +1206,19 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(Li
    * 
*/ @BetaApi - public final UnaryCallable listInstanceGroupManagersPagedCallable() { + public final UnaryCallable< + ListInstanceGroupManagersHttpRequest, ListInstanceGroupManagersPagedResponse> + listInstanceGroupManagersPagedCallable() { return stub.listInstanceGroupManagersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * Retrieves a list of managed instance groups that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -1049,15 +1241,20 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstanceGroupManagersCallable() { + public final UnaryCallable + listInstanceGroupManagersCallable() { return stub.listInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1069,20 +1266,27 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1094,20 +1298,25 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(String instanceGroupManager) {
+  public final InstanceGroupManagersListManagedInstancesResponse
+      listManagedInstancesInstanceGroupManagers(String instanceGroupManager) {
 
     ListManagedInstancesInstanceGroupManagersHttpRequest request =
         ListManagedInstancesInstanceGroupManagersHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return listManagedInstancesInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1122,15 +1331,21 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManagersListManagedInstancesResponse listManagedInstancesInstanceGroupManagers(ListManagedInstancesInstanceGroupManagersHttpRequest request) {
+  public final InstanceGroupManagersListManagedInstancesResponse
+      listManagedInstancesInstanceGroupManagers(
+          ListManagedInstancesInstanceGroupManagersHttpRequest request) {
     return listManagedInstancesInstanceGroupManagersCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
@@ -1144,19 +1359,29 @@ public final InstanceGroupManagersListManagedInstancesResponse listManagedInstan
    * 
*/ @BetaApi - public final UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { + public final UnaryCallable< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersCallable() { return stub.listManagedInstancesInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1166,36 +1391,53 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersRecreateInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { + public final Operation recreateInstancesInstanceGroupManager( + String requestId, + ProjectZoneInstanceGroupManagerName instanceGroupManager, + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource) { RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersRecreateInstancesRequestResource( + instanceGroupManagersRecreateInstancesRequestResource) + .build(); return recreateInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1205,36 +1447,52 @@ public final Operation recreateInstancesInstanceGroupManager(String requestId, P
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersRecreateInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { + public final Operation recreateInstancesInstanceGroupManager( + String requestId, + String instanceGroupManager, + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource) { RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersRecreateInstancesRequestResource( + instanceGroupManagersRecreateInstancesRequestResource) + .build(); return recreateInstancesInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * 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. + *

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1253,19 +1511,27 @@ public final Operation recreateInstancesInstanceGroupManager(String requestId, S
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesInstanceGroupManagerHttpRequest request) {
+  public final Operation recreateInstancesInstanceGroupManager(
+      RecreateInstancesInstanceGroupManagerHttpRequest request) {
     return recreateInstancesInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The
+   * instances are deleted and recreated using the current instance template for the managed
+   * instance group. This operation is marked as DONE when the action is scheduled even if the
+   * instances have not yet been recreated. You must separately verify the status of the recreating
+   * 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1283,17 +1549,25 @@ public final Operation recreateInstancesInstanceGroupManager(RecreateInstancesIn
    * 
*/ @BetaApi - public final UnaryCallable recreateInstancesInstanceGroupManagerCallable() { + public final UnaryCallable + recreateInstancesInstanceGroupManagerCallable() { return stub.recreateInstancesInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. * - * 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. + *

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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1303,34 +1577,49 @@ public final UnaryCallable
* - * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeInstanceGroupManager(Integer size, String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager) { + public final Operation resizeInstanceGroupManager( + Integer size, String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return resizeInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. * - * 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. + *

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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1340,34 +1629,48 @@ public final Operation resizeInstanceGroupManager(Integer size, String requestId
    * }
    * 
* - * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeInstanceGroupManager(Integer size, String requestId, String instanceGroupManager) { + public final Operation resizeInstanceGroupManager( + Integer size, String requestId, String instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return resizeInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

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. * - * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1392,11 +1695,18 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
    *
-   * 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.
+   * 

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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1414,15 +1724,18 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
    * 
*/ @BetaApi - public final UnaryCallable resizeInstanceGroupManagerCallable() { + public final UnaryCallable + resizeInstanceGroupManagerCallable() { return stub.resizeInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. + * 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 recreate them. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1432,32 +1745,44 @@ public final UnaryCallable res
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetInstanceTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { + public final Operation setInstanceTemplateInstanceGroupManager( + String requestId, + ProjectZoneInstanceGroupManagerName instanceGroupManager, + InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource) { SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersSetInstanceTemplateRequestResource( + instanceGroupManagersSetInstanceTemplateRequestResource) + .build(); return setInstanceTemplateInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. + * 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 recreate them. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1467,32 +1792,43 @@ public final Operation setInstanceTemplateInstanceGroupManager(String requestId,
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetInstanceTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { + public final Operation setInstanceTemplateInstanceGroupManager( + String requestId, + String instanceGroupManager, + InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource) { SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersSetInstanceTemplateRequestResource( + instanceGroupManagersSetInstanceTemplateRequestResource) + .build(); return setInstanceTemplateInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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 recreate them. + * 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 recreate them. + * + *

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1511,15 +1847,18 @@ public final Operation setInstanceTemplateInstanceGroupManager(String requestId,
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTemplateInstanceGroupManagerHttpRequest request) {
+  public final Operation setInstanceTemplateInstanceGroupManager(
+      SetInstanceTemplateInstanceGroupManagerHttpRequest request) {
     return setInstanceTemplateInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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 recreate them.
+   * 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 recreate them.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1537,15 +1876,21 @@ public final Operation setInstanceTemplateInstanceGroupManager(SetInstanceTempla
    * 
*/ @BetaApi - public final UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { + public final UnaryCallable + setInstanceTemplateInstanceGroupManagerCallable() { return stub.setInstanceTemplateInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1555,32 +1900,47 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsInstanceGroupManager(String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsInstanceGroupManager( + String requestId, + ProjectZoneInstanceGroupManagerName instanceGroupManager, + InstanceGroupManagersSetTargetPoolsRequest + instanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagersSetTargetPoolsRequestResource( + instanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1590,32 +1950,46 @@ public final Operation setTargetPoolsInstanceGroupManager(String requestId, Proj
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsInstanceGroupManager(String requestId, String instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsInstanceGroupManager( + String requestId, + String instanceGroupManager, + InstanceGroupManagersSetTargetPoolsRequest + instanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagersSetTargetPoolsRequestResource( + instanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1634,15 +2008,21 @@ public final Operation setTargetPoolsInstanceGroupManager(String requestId, Stri
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstanceGroupManagerHttpRequest request) {
+  public final Operation setTargetPoolsInstanceGroupManager(
+      SetTargetPoolsInstanceGroupManagerHttpRequest request) {
     return setTargetPoolsInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1660,12 +2040,13 @@ public final Operation setTargetPoolsInstanceGroupManager(SetTargetPoolsInstance
    * 
*/ @BetaApi - public final UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { + public final UnaryCallable + setTargetPoolsInstanceGroupManagerCallable() { return stub.setTargetPoolsInstanceGroupManagerCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1694,43 +2075,50 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersFixedSizeCollection> { + public static class AggregatedListInstanceGroupManagersPagedResponse + extends AbstractPagedListResponse< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListInstanceGroupManagersPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersPagedResponse>() { @Override - public AggregatedListInstanceGroupManagersPagedResponse apply(AggregatedListInstanceGroupManagersPage input) { + public AggregatedListInstanceGroupManagersPagedResponse apply( + AggregatedListInstanceGroupManagersPage input) { return new AggregatedListInstanceGroupManagersPagedResponse(input); } }); } - private AggregatedListInstanceGroupManagersPagedResponse(AggregatedListInstanceGroupManagersPage page) { + private AggregatedListInstanceGroupManagersPagedResponse( + AggregatedListInstanceGroupManagersPage page) { super(page, AggregatedListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListInstanceGroupManagersPage extends AbstractPage< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage> { + public static class AggregatedListInstanceGroupManagersPage + extends AbstractPage< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, AggregatedListInstanceGroupManagersPage> { private AggregatedListInstanceGroupManagersPage( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, InstanceGroupManagerAggregatedList response) { super(context, response); } @@ -1741,31 +2129,33 @@ private static AggregatedListInstanceGroupManagersPage createEmptyPage() { @Override protected AggregatedListInstanceGroupManagersPage createPage( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, InstanceGroupManagerAggregatedList response) { return new AggregatedListInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListInstanceGroupManagersHttpRequest, - InstanceGroupManagerAggregatedList, - InstanceGroupManagersScopedList, - AggregatedListInstanceGroupManagersPage, - AggregatedListInstanceGroupManagersFixedSizeCollection> { + public static class AggregatedListInstanceGroupManagersFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + InstanceGroupManagersScopedList, AggregatedListInstanceGroupManagersPage, + AggregatedListInstanceGroupManagersFixedSizeCollection> { - private AggregatedListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListInstanceGroupManagersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1778,18 +2168,18 @@ protected AggregatedListInstanceGroupManagersFixedSizeCollection createCollectio List pages, int collectionSize) { return new AggregatedListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage, - ListInstanceGroupManagersFixedSizeCollection> { + + public static class ListInstanceGroupManagersPagedResponse + extends AbstractPagedListResponse< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, InstanceGroupManager, + ListInstanceGroupManagersPage, ListInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1797,7 +2187,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public ListInstanceGroupManagersPagedResponse apply(ListInstanceGroupManagersPage input) { + public ListInstanceGroupManagersPagedResponse apply( + ListInstanceGroupManagersPage input) { return new ListInstanceGroupManagersPagedResponse(input); } }); @@ -1806,18 +2197,18 @@ public ListInstanceGroupManagersPagedResponse apply(ListInstanceGroupManagersPag private ListInstanceGroupManagersPagedResponse(ListInstanceGroupManagersPage page) { super(page, ListInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstanceGroupManagersPage extends AbstractPage< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage> { + public static class ListInstanceGroupManagersPage + extends AbstractPage< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, InstanceGroupManager, + ListInstanceGroupManagersPage> { private ListInstanceGroupManagersPage( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, + InstanceGroupManager> + context, InstanceGroupManagerList response) { super(context, response); } @@ -1828,31 +2219,32 @@ private static ListInstanceGroupManagersPage createEmptyPage() { @Override protected ListInstanceGroupManagersPage createPage( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, + InstanceGroupManager> + context, InstanceGroupManagerList response) { return new ListInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstanceGroupManagersHttpRequest, - InstanceGroupManagerList, - InstanceGroupManager, - ListInstanceGroupManagersPage, - ListInstanceGroupManagersFixedSizeCollection> { + public static class ListInstanceGroupManagersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, InstanceGroupManager, + ListInstanceGroupManagersPage, ListInstanceGroupManagersFixedSizeCollection> { - private ListInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + private ListInstanceGroupManagersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1865,7 +2257,5 @@ protected ListInstanceGroupManagersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java index eb82383a883d..d2b342712b58 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InstanceGroupManagerList() { this.warning = null; } - private InstanceGroupManagerList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagerList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagerList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagerList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagerList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupManagerList build() { - - - - - return new InstanceGroupManagerList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceGroupManagerList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagerList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupManagerList) { InstanceGroupManagerList that = (InstanceGroupManagerList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java deleted file mode 100644 index db04a2b850a1..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class InstanceGroupManagerName implements com.google.api.resourcenames.ResourceName { - private final String instanceGroupManager; - private final String project; - private final String zone; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private InstanceGroupManagerName(Builder builder) { - instanceGroupManager = Preconditions.checkNotNull(builder.getInstanceGroupManager()); - project = Preconditions.checkNotNull(builder.getProject()); - zone = Preconditions.checkNotNull(builder.getZone()); - } - - public static InstanceGroupManagerName of( - String instanceGroupManager, - String project, - String zone - ) { - return newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setProject(project) - .setZone(zone) - .build(); - } - - public static String format( - String instanceGroupManager, - String project, - String zone - ) { - return of( - instanceGroupManager, - project, - zone - ) - .toString(); - } - - public String getInstanceGroupManager() { - return instanceGroupManager; - } - - public String getProject() { - return project; - } - - public String getZone() { - return zone; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("instanceGroupManager", instanceGroupManager); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("zone", zone); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InstanceGroupManagerName parse(String formattedString) {return InstanceGroupManagerName.parse(formattedString);} - }; - } - - public static InstanceGroupManagerName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InstanceGroupManagerName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceGroupManager"), - matchMap.get("project"), - matchMap.get("zone") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String instanceGroupManager; - private String project; - private String zone; - - public String getInstanceGroupManager() { - return instanceGroupManager; - } - public String getProject() { - return project; - } - public String getZone() { - return zone; - } - - public Builder setInstanceGroupManager(String instanceGroupManager) { - this.instanceGroupManager = instanceGroupManager; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - private Builder() {} - - public Builder (InstanceGroupManagerName instanceGroupManagerName) { - instanceGroupManager = instanceGroupManagerName.instanceGroupManager; - project = instanceGroupManagerName.project; - zone = instanceGroupManagerName.zone; - } - - public InstanceGroupManagerName build() { - return new InstanceGroupManagerName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "instanceGroupManager", instanceGroupManager, - "project", project, - "zone", zone - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof InstanceGroupManagerName) { - InstanceGroupManagerName that = (InstanceGroupManagerName) o; - return - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - instanceGroupManager, - project, - zone - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java index 02e782687226..4cb377e2ba58 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of abandonInstancesInstanceGroupManager to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of abandonInstancesInstanceGroupManager to 30 seconds: * *

  * 
@@ -89,130 +67,133 @@ public class InstanceGroupManagerSettings extends ClientSettings abandonInstancesInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).abandonInstancesInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      abandonInstancesInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .abandonInstancesInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstanceGroupManagers.
-   */
-  public PagedCallSettings aggregatedListInstanceGroupManagersSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).aggregatedListInstanceGroupManagersSettings();
+  /** Returns the object with the settings used for calls to aggregatedListInstanceGroupManagers. */
+  public PagedCallSettings<
+          AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+          AggregatedListInstanceGroupManagersPagedResponse>
+      aggregatedListInstanceGroupManagersSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .aggregatedListInstanceGroupManagersSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceGroupManager.
-   */
-  public UnaryCallSettings deleteInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).deleteInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to deleteInstanceGroupManager. */
+  public UnaryCallSettings
+      deleteInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .deleteInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstancesInstanceGroupManager.
-   */
-  public UnaryCallSettings deleteInstancesInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).deleteInstancesInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to deleteInstancesInstanceGroupManager. */
+  public UnaryCallSettings
+      deleteInstancesInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .deleteInstancesInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceGroupManager.
-   */
-  public UnaryCallSettings getInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to getInstanceGroupManager. */
+  public UnaryCallSettings
+      getInstanceGroupManagerSettings() {
     return ((InstanceGroupManagerStubSettings) getStubSettings()).getInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceGroupManager.
-   */
-  public UnaryCallSettings insertInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).insertInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to insertInstanceGroupManager. */
+  public UnaryCallSettings
+      insertInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .insertInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceGroupManagers.
-   */
-  public PagedCallSettings listInstanceGroupManagersSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).listInstanceGroupManagersSettings();
+  /** Returns the object with the settings used for calls to listInstanceGroupManagers. */
+  public PagedCallSettings<
+          ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+          ListInstanceGroupManagersPagedResponse>
+      listInstanceGroupManagersSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .listInstanceGroupManagersSettings();
   }
 
   /**
-   * Returns the object with the settings used for calls to listManagedInstancesInstanceGroupManagers.
+   * Returns the object with the settings used for calls to
+   * listManagedInstancesInstanceGroupManagers.
    */
-  public UnaryCallSettings listManagedInstancesInstanceGroupManagersSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).listManagedInstancesInstanceGroupManagersSettings();
+  public UnaryCallSettings<
+          ListManagedInstancesInstanceGroupManagersHttpRequest,
+          InstanceGroupManagersListManagedInstancesResponse>
+      listManagedInstancesInstanceGroupManagersSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .listManagedInstancesInstanceGroupManagersSettings();
   }
 
   /**
    * Returns the object with the settings used for calls to recreateInstancesInstanceGroupManager.
    */
-  public UnaryCallSettings recreateInstancesInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).recreateInstancesInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      recreateInstancesInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .recreateInstancesInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeInstanceGroupManager.
-   */
-  public UnaryCallSettings resizeInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).resizeInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to resizeInstanceGroupManager. */
+  public UnaryCallSettings
+      resizeInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .resizeInstanceGroupManagerSettings();
   }
 
   /**
    * Returns the object with the settings used for calls to setInstanceTemplateInstanceGroupManager.
    */
-  public UnaryCallSettings setInstanceTemplateInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).setInstanceTemplateInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      setInstanceTemplateInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .setInstanceTemplateInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTargetPoolsInstanceGroupManager.
-   */
-  public UnaryCallSettings setTargetPoolsInstanceGroupManagerSettings() {
-    return ((InstanceGroupManagerStubSettings) getStubSettings()).setTargetPoolsInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to setTargetPoolsInstanceGroupManager. */
+  public UnaryCallSettings
+      setTargetPoolsInstanceGroupManagerSettings() {
+    return ((InstanceGroupManagerStubSettings) getStubSettings())
+        .setTargetPoolsInstanceGroupManagerSettings();
   }
 
-
-  public static final InstanceGroupManagerSettings create(InstanceGroupManagerStubSettings stub) throws IOException {
+  public static final InstanceGroupManagerSettings create(InstanceGroupManagerStubSettings stub)
+      throws IOException {
     return new InstanceGroupManagerSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstanceGroupManagerStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InstanceGroupManagerStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InstanceGroupManagerStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InstanceGroupManagerStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InstanceGroupManagerStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InstanceGroupManagerStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstanceGroupManagerStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -225,23 +206,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InstanceGroupManagerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -250,10 +225,9 @@ protected InstanceGroupManagerSettings(Builder settingsBuilder) throws IOExcepti
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InstanceGroupManagerSettings.
-   */
-  public static class Builder extends ClientSettings.Builder {
+  /** Builder for InstanceGroupManagerSettings. */
+  public static class Builder
+      extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
     }
@@ -274,102 +248,114 @@ protected Builder(InstanceGroupManagerStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InstanceGroupManagerStubSettings.Builder getStubSettingsBuilder() {
       return ((InstanceGroupManagerStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } /** * Returns the builder for the settings used for calls to abandonInstancesInstanceGroupManager. */ - public UnaryCallSettings.Builder abandonInstancesInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + abandonInstancesInstanceGroupManagerSettings() { return getStubSettingsBuilder().abandonInstancesInstanceGroupManagerSettings(); } /** * Returns the builder for the settings used for calls to aggregatedListInstanceGroupManagers. */ - public PagedCallSettings.Builder aggregatedListInstanceGroupManagersSettings() { + public PagedCallSettings.Builder< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersSettings() { return getStubSettingsBuilder().aggregatedListInstanceGroupManagersSettings(); } - /** - * Returns the builder for the settings used for calls to deleteInstanceGroupManager. - */ - public UnaryCallSettings.Builder deleteInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceGroupManager. */ + public UnaryCallSettings.Builder + deleteInstanceGroupManagerSettings() { return getStubSettingsBuilder().deleteInstanceGroupManagerSettings(); } /** * Returns the builder for the settings used for calls to deleteInstancesInstanceGroupManager. */ - public UnaryCallSettings.Builder deleteInstancesInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + deleteInstancesInstanceGroupManagerSettings() { return getStubSettingsBuilder().deleteInstancesInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to getInstanceGroupManager. - */ - public UnaryCallSettings.Builder getInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to getInstanceGroupManager. */ + public UnaryCallSettings.Builder + getInstanceGroupManagerSettings() { return getStubSettingsBuilder().getInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to insertInstanceGroupManager. - */ - public UnaryCallSettings.Builder insertInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to insertInstanceGroupManager. */ + public UnaryCallSettings.Builder + insertInstanceGroupManagerSettings() { return getStubSettingsBuilder().insertInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to listInstanceGroupManagers. - */ - public PagedCallSettings.Builder listInstanceGroupManagersSettings() { + /** Returns the builder for the settings used for calls to listInstanceGroupManagers. */ + public PagedCallSettings.Builder< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, + ListInstanceGroupManagersPagedResponse> + listInstanceGroupManagersSettings() { return getStubSettingsBuilder().listInstanceGroupManagersSettings(); } /** - * Returns the builder for the settings used for calls to listManagedInstancesInstanceGroupManagers. + * Returns the builder for the settings used for calls to + * listManagedInstancesInstanceGroupManagers. */ - public UnaryCallSettings.Builder listManagedInstancesInstanceGroupManagersSettings() { + public UnaryCallSettings.Builder< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersSettings() { return getStubSettingsBuilder().listManagedInstancesInstanceGroupManagersSettings(); } /** * Returns the builder for the settings used for calls to recreateInstancesInstanceGroupManager. */ - public UnaryCallSettings.Builder recreateInstancesInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + recreateInstancesInstanceGroupManagerSettings() { return getStubSettingsBuilder().recreateInstancesInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to resizeInstanceGroupManager. - */ - public UnaryCallSettings.Builder resizeInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to resizeInstanceGroupManager. */ + public UnaryCallSettings.Builder + resizeInstanceGroupManagerSettings() { return getStubSettingsBuilder().resizeInstanceGroupManagerSettings(); } /** - * Returns the builder for the settings used for calls to setInstanceTemplateInstanceGroupManager. + * Returns the builder for the settings used for calls to + * setInstanceTemplateInstanceGroupManager. */ - public UnaryCallSettings.Builder setInstanceTemplateInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + setInstanceTemplateInstanceGroupManagerSettings() { return getStubSettingsBuilder().setInstanceTemplateInstanceGroupManagerSettings(); } /** * Returns the builder for the settings used for calls to setTargetPoolsInstanceGroupManager. */ - public UnaryCallSettings.Builder setTargetPoolsInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + setTargetPoolsInstanceGroupManagerSettings() { return getStubSettingsBuilder().setTargetPoolsInstanceGroupManagerSettings(); } @@ -378,4 +364,4 @@ public InstanceGroupManagerSettings build() throws IOException { return new InstanceGroupManagerSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java index 6e1647c5d5f5..b38c1b293980 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstanceGroupManagersAbandonInstancesRequest() { this.instances = null; } - - private InstanceGroupManagersAbandonInstancesRequest( - List instances - ) { + private InstanceGroupManagersAbandonInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersAbandonInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersAbandonInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersAbandonInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersAbandonInstancesRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(String instances) { return this; } - public InstanceGroupManagersAbandonInstancesRequest build() { - return new InstanceGroupManagersAbandonInstancesRequest( - instances - ); + return new InstanceGroupManagersAbandonInstancesRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupManagersAbandonInstancesRequest{" - + "instances=" + instances - + "}"; + return "InstanceGroupManagersAbandonInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -157,18 +149,15 @@ public boolean equals(Object o) { return true; } if (o instanceof InstanceGroupManagersAbandonInstancesRequest) { - InstanceGroupManagersAbandonInstancesRequest that = (InstanceGroupManagersAbandonInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + InstanceGroupManagersAbandonInstancesRequest that = + (InstanceGroupManagersAbandonInstancesRequest) o; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java index 51f49fc42fb2..c96ff91fdfbc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstanceGroupManagersDeleteInstancesRequest() { this.instances = null; } - - private InstanceGroupManagersDeleteInstancesRequest( - List instances - ) { + private InstanceGroupManagersDeleteInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersDeleteInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersDeleteInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersDeleteInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersDeleteInstancesRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(String instances) { return this; } - public InstanceGroupManagersDeleteInstancesRequest build() { - return new InstanceGroupManagersDeleteInstancesRequest( - instances - ); + return new InstanceGroupManagersDeleteInstancesRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupManagersDeleteInstancesRequest{" - + "instances=" + instances - + "}"; + return "InstanceGroupManagersDeleteInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -157,18 +149,15 @@ public boolean equals(Object o) { return true; } if (o instanceof InstanceGroupManagersDeleteInstancesRequest) { - InstanceGroupManagersDeleteInstancesRequest that = (InstanceGroupManagersDeleteInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + InstanceGroupManagersDeleteInstancesRequest that = + (InstanceGroupManagersDeleteInstancesRequest) o; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java index 0a493ca6bede..6b0747ba2282 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,8 @@ private InstanceGroupManagersListManagedInstancesResponse() { this.managedInstances = null; } - private InstanceGroupManagersListManagedInstancesResponse( - List managedInstances - ) { + List managedInstances) { this.managedInstances = managedInstances; } @@ -76,22 +72,24 @@ public List getManagedInstancesList() { return managedInstances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersListManagedInstancesResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersListManagedInstancesResponse getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersListManagedInstancesResponse DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersListManagedInstancesResponse(); } @@ -102,7 +100,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(InstanceGroupManagersListManagedInstancesResponse other) { - if (other == InstanceGroupManagersListManagedInstancesResponse.getDefaultInstance()) return this; + if (other == InstanceGroupManagersListManagedInstancesResponse.getDefaultInstance()) + return this; if (other.getManagedInstancesList() != null) { this.managedInstances = other.managedInstances; } @@ -130,11 +129,8 @@ public Builder addManagedInstances(ManagedInstance managedInstances) { return this; } - public InstanceGroupManagersListManagedInstancesResponse build() { - return new InstanceGroupManagersListManagedInstancesResponse( - managedInstances - ); + return new InstanceGroupManagersListManagedInstancesResponse(managedInstances); } public Builder clone() { @@ -147,7 +143,8 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagersListManagedInstancesResponse{" - + "managedInstances=" + managedInstances + + "managedInstances=" + + managedInstances + "}"; } @@ -157,18 +154,15 @@ public boolean equals(Object o) { return true; } if (o instanceof InstanceGroupManagersListManagedInstancesResponse) { - InstanceGroupManagersListManagedInstancesResponse that = (InstanceGroupManagersListManagedInstancesResponse) o; - return - Objects.equals(this.managedInstances, that.getManagedInstancesList()) - ; + InstanceGroupManagersListManagedInstancesResponse that = + (InstanceGroupManagersListManagedInstancesResponse) o; + return Objects.equals(this.managedInstances, that.getManagedInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - managedInstances - ); + return Objects.hash(managedInstances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java index 06f585bde163..d672f3af897c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstanceGroupManagersRecreateInstancesRequest() { this.instances = null; } - - private InstanceGroupManagersRecreateInstancesRequest( - List instances - ) { + private InstanceGroupManagersRecreateInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersRecreateInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersRecreateInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersRecreateInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersRecreateInstancesRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(String instances) { return this; } - public InstanceGroupManagersRecreateInstancesRequest build() { - return new InstanceGroupManagersRecreateInstancesRequest( - instances - ); + return new InstanceGroupManagersRecreateInstancesRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupManagersRecreateInstancesRequest{" - + "instances=" + instances - + "}"; + return "InstanceGroupManagersRecreateInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -157,18 +149,15 @@ public boolean equals(Object o) { return true; } if (o instanceof InstanceGroupManagersRecreateInstancesRequest) { - InstanceGroupManagersRecreateInstancesRequest that = (InstanceGroupManagersRecreateInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + InstanceGroupManagersRecreateInstancesRequest that = + (InstanceGroupManagersRecreateInstancesRequest) o; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java index 011fbf0724d9..7a09476e60bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,8 @@ private InstanceGroupManagersScopedList() { this.warning = null; } - private InstanceGroupManagersScopedList( - List instanceGroupManagers, - Warning warning - ) { + List instanceGroupManagers, Warning warning) { this.instanceGroupManagers = instanceGroupManagers; this.warning = warning; } @@ -90,22 +86,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersScopedList(); } @@ -158,13 +156,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupManagersScopedList build() { - return new InstanceGroupManagersScopedList( - instanceGroupManagers, - warning - ); + return new InstanceGroupManagersScopedList(instanceGroupManagers, warning); } public Builder clone() { @@ -178,8 +172,11 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagersScopedList{" - + "instanceGroupManagers=" + instanceGroupManagers + ", " - + "warning=" + warning + + "instanceGroupManagers=" + + instanceGroupManagers + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +187,14 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupManagersScopedList) { InstanceGroupManagersScopedList that = (InstanceGroupManagersScopedList) o; - return - Objects.equals(this.instanceGroupManagers, that.getInstanceGroupManagersList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.instanceGroupManagers, that.getInstanceGroupManagersList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceGroupManagers, - warning - ); + return Objects.hash(instanceGroupManagers, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java index 43396f32f2f3..6b8d4fdc5c1e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private InstanceGroupManagersSetInstanceTemplateRequest() { this.instanceTemplate = null; } - - private InstanceGroupManagersSetInstanceTemplateRequest( - String instanceTemplate - ) { + private InstanceGroupManagersSetInstanceTemplateRequest(String instanceTemplate) { this.instanceTemplate = instanceTemplate; } @@ -72,22 +66,24 @@ public String getInstanceTemplate() { return instanceTemplate; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersSetInstanceTemplateRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersSetInstanceTemplateRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersSetInstanceTemplateRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersSetInstanceTemplateRequest(); } @@ -98,7 +94,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(InstanceGroupManagersSetInstanceTemplateRequest other) { - if (other == InstanceGroupManagersSetInstanceTemplateRequest.getDefaultInstance()) return this; + if (other == InstanceGroupManagersSetInstanceTemplateRequest.getDefaultInstance()) + return this; if (other.getInstanceTemplate() != null) { this.instanceTemplate = other.instanceTemplate; } @@ -118,11 +115,8 @@ public Builder setInstanceTemplate(String instanceTemplate) { return this; } - public InstanceGroupManagersSetInstanceTemplateRequest build() { - return new InstanceGroupManagersSetInstanceTemplateRequest( - instanceTemplate - ); + return new InstanceGroupManagersSetInstanceTemplateRequest(instanceTemplate); } public Builder clone() { @@ -135,7 +129,8 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagersSetInstanceTemplateRequest{" - + "instanceTemplate=" + instanceTemplate + + "instanceTemplate=" + + instanceTemplate + "}"; } @@ -145,18 +140,15 @@ public boolean equals(Object o) { return true; } if (o instanceof InstanceGroupManagersSetInstanceTemplateRequest) { - InstanceGroupManagersSetInstanceTemplateRequest that = (InstanceGroupManagersSetInstanceTemplateRequest) o; - return - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) - ; + InstanceGroupManagersSetInstanceTemplateRequest that = + (InstanceGroupManagersSetInstanceTemplateRequest) o; + return Objects.equals(this.instanceTemplate, that.getInstanceTemplate()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceTemplate - ); + return Objects.hash(instanceTemplate); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java index 02d00154a3a1..03c59c8515e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private InstanceGroupManagersSetTargetPoolsRequest() { this.targetPools = null; } - - private InstanceGroupManagersSetTargetPoolsRequest( - String fingerprint, - List targetPools - ) { + private InstanceGroupManagersSetTargetPoolsRequest(String fingerprint, List targetPools) { this.fingerprint = fingerprint; this.targetPools = targetPools; } @@ -90,22 +85,24 @@ public List getTargetPoolsList() { return targetPools; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupManagersSetTargetPoolsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupManagersSetTargetPoolsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupManagersSetTargetPoolsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupManagersSetTargetPoolsRequest(); } @@ -158,13 +155,9 @@ public Builder addTargetPools(String targetPools) { return this; } - public InstanceGroupManagersSetTargetPoolsRequest build() { - return new InstanceGroupManagersSetTargetPoolsRequest( - fingerprint, - targetPools - ); + return new InstanceGroupManagersSetTargetPoolsRequest(fingerprint, targetPools); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupManagersSetTargetPoolsRequest{" - + "fingerprint=" + fingerprint + ", " - + "targetPools=" + targetPools + + "fingerprint=" + + fingerprint + + ", " + + "targetPools=" + + targetPools + "}"; } @@ -189,20 +185,16 @@ public boolean equals(Object o) { return true; } if (o instanceof InstanceGroupManagersSetTargetPoolsRequest) { - InstanceGroupManagersSetTargetPoolsRequest that = (InstanceGroupManagersSetTargetPoolsRequest) o; - return - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.targetPools, that.getTargetPoolsList()) - ; + InstanceGroupManagersSetTargetPoolsRequest that = + (InstanceGroupManagersSetTargetPoolsRequest) o; + return Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.targetPools, that.getTargetPoolsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - fingerprint, - targetPools - ); + return Objects.hash(fingerprint, targetPools); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java deleted file mode 100644 index 2533830b5eb0..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class InstanceGroupName implements com.google.api.resourcenames.ResourceName { - private final String instanceGroup; - private final String project; - private final String zone; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private InstanceGroupName(Builder builder) { - instanceGroup = Preconditions.checkNotNull(builder.getInstanceGroup()); - project = Preconditions.checkNotNull(builder.getProject()); - zone = Preconditions.checkNotNull(builder.getZone()); - } - - public static InstanceGroupName of( - String instanceGroup, - String project, - String zone - ) { - return newBuilder() - .setInstanceGroup(instanceGroup) - .setProject(project) - .setZone(zone) - .build(); - } - - public static String format( - String instanceGroup, - String project, - String zone - ) { - return of( - instanceGroup, - project, - zone - ) - .toString(); - } - - public String getInstanceGroup() { - return instanceGroup; - } - - public String getProject() { - return project; - } - - public String getZone() { - return zone; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("instanceGroup", instanceGroup); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("zone", zone); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InstanceGroupName parse(String formattedString) {return InstanceGroupName.parse(formattedString);} - }; - } - - public static InstanceGroupName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InstanceGroupName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceGroup"), - matchMap.get("project"), - matchMap.get("zone") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String instanceGroup; - private String project; - private String zone; - - public String getInstanceGroup() { - return instanceGroup; - } - public String getProject() { - return project; - } - public String getZone() { - return zone; - } - - public Builder setInstanceGroup(String instanceGroup) { - this.instanceGroup = instanceGroup; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - private Builder() {} - - public Builder (InstanceGroupName instanceGroupName) { - instanceGroup = instanceGroupName.instanceGroup; - project = instanceGroupName.project; - zone = instanceGroupName.zone; - } - - public InstanceGroupName build() { - return new InstanceGroupName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "instanceGroup", instanceGroup, - "project", project, - "zone", zone - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof InstanceGroupName) { - InstanceGroupName that = (InstanceGroupName) o; - return - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - instanceGroup, - project, - zone - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java index 2a2788e688f9..c0d40b559eba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java @@ -15,47 +15,25 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -64,15 +42,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: * *

  * 
@@ -87,112 +65,96 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceGroupSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to addInstancesInstanceGroup.
-   */
-  public UnaryCallSettings addInstancesInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to addInstancesInstanceGroup. */
+  public UnaryCallSettings
+      addInstancesInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).addInstancesInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstanceGroups.
-   */
-  public PagedCallSettings aggregatedListInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListInstanceGroups. */
+  public PagedCallSettings<
+          AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+          AggregatedListInstanceGroupsPagedResponse>
+      aggregatedListInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).aggregatedListInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceGroup.
-   */
-  public UnaryCallSettings deleteInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to deleteInstanceGroup. */
+  public UnaryCallSettings
+      deleteInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).deleteInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceGroup.
-   */
+  /** Returns the object with the settings used for calls to getInstanceGroup. */
   public UnaryCallSettings getInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).getInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceGroup.
-   */
-  public UnaryCallSettings insertInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to insertInstanceGroup. */
+  public UnaryCallSettings
+      insertInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).insertInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceGroups.
-   */
-  public PagedCallSettings listInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstanceGroups. */
+  public PagedCallSettings<
+          ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
+      listInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).listInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstancesInstanceGroups.
-   */
-  public PagedCallSettings listInstancesInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstancesInstanceGroups. */
+  public PagedCallSettings<
+          ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+          ListInstancesInstanceGroupsPagedResponse>
+      listInstancesInstanceGroupsSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).listInstancesInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeInstancesInstanceGroup.
-   */
-  public UnaryCallSettings removeInstancesInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to removeInstancesInstanceGroup. */
+  public UnaryCallSettings
+      removeInstancesInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).removeInstancesInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setNamedPortsInstanceGroup.
-   */
-  public UnaryCallSettings setNamedPortsInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to setNamedPortsInstanceGroup. */
+  public UnaryCallSettings
+      setNamedPortsInstanceGroupSettings() {
     return ((InstanceGroupStubSettings) getStubSettings()).setNamedPortsInstanceGroupSettings();
   }
 
-
-  public static final InstanceGroupSettings create(InstanceGroupStubSettings stub) throws IOException {
+  public static final InstanceGroupSettings create(InstanceGroupStubSettings stub)
+      throws IOException {
     return new InstanceGroupSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstanceGroupStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InstanceGroupStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InstanceGroupStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InstanceGroupStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InstanceGroupStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InstanceGroupStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstanceGroupStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -205,23 +167,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InstanceGroupStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -230,9 +186,7 @@ protected InstanceGroupSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InstanceGroupSettings.
-   */
+  /** Builder for InstanceGroupSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -254,81 +208,79 @@ protected Builder(InstanceGroupStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InstanceGroupStubSettings.Builder getStubSettingsBuilder() {
       return ((InstanceGroupStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to addInstancesInstanceGroup. - */ - public UnaryCallSettings.Builder addInstancesInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to addInstancesInstanceGroup. */ + public UnaryCallSettings.Builder + addInstancesInstanceGroupSettings() { return getStubSettingsBuilder().addInstancesInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to aggregatedListInstanceGroups. - */ - public PagedCallSettings.Builder aggregatedListInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListInstanceGroups. */ + public PagedCallSettings.Builder< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsSettings() { return getStubSettingsBuilder().aggregatedListInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to deleteInstanceGroup. - */ - public UnaryCallSettings.Builder deleteInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceGroup. */ + public UnaryCallSettings.Builder + deleteInstanceGroupSettings() { return getStubSettingsBuilder().deleteInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to getInstanceGroup. - */ - public UnaryCallSettings.Builder getInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to getInstanceGroup. */ + public UnaryCallSettings.Builder + getInstanceGroupSettings() { return getStubSettingsBuilder().getInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to insertInstanceGroup. - */ - public UnaryCallSettings.Builder insertInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to insertInstanceGroup. */ + public UnaryCallSettings.Builder + insertInstanceGroupSettings() { return getStubSettingsBuilder().insertInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to listInstanceGroups. - */ - public PagedCallSettings.Builder listInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse> + listInstanceGroupsSettings() { return getStubSettingsBuilder().listInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to listInstancesInstanceGroups. - */ - public PagedCallSettings.Builder listInstancesInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstancesInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsSettings() { return getStubSettingsBuilder().listInstancesInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to removeInstancesInstanceGroup. - */ - public UnaryCallSettings.Builder removeInstancesInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to removeInstancesInstanceGroup. */ + public UnaryCallSettings.Builder + removeInstancesInstanceGroupSettings() { return getStubSettingsBuilder().removeInstancesInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. - */ - public UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. */ + public UnaryCallSettings.Builder + setNamedPortsInstanceGroupSettings() { return getStubSettingsBuilder().setNamedPortsInstanceGroupSettings(); } @@ -337,4 +289,4 @@ public InstanceGroupSettings build() throws IOException { return new InstanceGroupSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java index e888ad71d02f..ba597e29026d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstanceGroupsAddInstancesRequest() { this.instances = null; } - - private InstanceGroupsAddInstancesRequest( - List instances - ) { + private InstanceGroupsAddInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsAddInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsAddInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsAddInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsAddInstancesRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(InstanceReference instances) { return this; } - public InstanceGroupsAddInstancesRequest build() { - return new InstanceGroupsAddInstancesRequest( - instances - ); + return new InstanceGroupsAddInstancesRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupsAddInstancesRequest{" - + "instances=" + instances - + "}"; + return "InstanceGroupsAddInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsAddInstancesRequest) { InstanceGroupsAddInstancesRequest that = (InstanceGroupsAddInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java index 2ee64af07096..95d0d999162f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InstanceGroupsListInstances() { this.warning = null; } - private InstanceGroupsListInstances( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsListInstances prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsListInstances getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsListInstances DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsListInstances(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupsListInstances build() { - - - - - return new InstanceGroupsListInstances( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceGroupsListInstances(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupsListInstances{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsListInstances) { InstanceGroupsListInstances that = (InstanceGroupsListInstances) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java index 1d63da0f01ab..25fe971e58c5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private InstanceGroupsListInstancesRequest() { this.instanceState = null; } - - private InstanceGroupsListInstancesRequest( - String instanceState - ) { + private InstanceGroupsListInstancesRequest(String instanceState) { this.instanceState = instanceState; } @@ -72,22 +66,24 @@ public String getInstanceState() { return instanceState; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsListInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsListInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsListInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsListInstancesRequest(); } @@ -118,11 +114,8 @@ public Builder setInstanceState(String instanceState) { return this; } - public InstanceGroupsListInstancesRequest build() { - return new InstanceGroupsListInstancesRequest( - instanceState - ); + return new InstanceGroupsListInstancesRequest(instanceState); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupsListInstancesRequest{" - + "instanceState=" + instanceState - + "}"; + return "InstanceGroupsListInstancesRequest{" + "instanceState=" + instanceState + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsListInstancesRequest) { InstanceGroupsListInstancesRequest that = (InstanceGroupsListInstancesRequest) o; - return - Objects.equals(this.instanceState, that.getInstanceState()) - ; + return Objects.equals(this.instanceState, that.getInstanceState()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceState - ); + return Objects.hash(instanceState); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java index 88869b5cd248..e08eb75e9557 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstanceGroupsRemoveInstancesRequest() { this.instances = null; } - - private InstanceGroupsRemoveInstancesRequest( - List instances - ) { + private InstanceGroupsRemoveInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsRemoveInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsRemoveInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsRemoveInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsRemoveInstancesRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(InstanceReference instances) { return this; } - public InstanceGroupsRemoveInstancesRequest build() { - return new InstanceGroupsRemoveInstancesRequest( - instances - ); + return new InstanceGroupsRemoveInstancesRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceGroupsRemoveInstancesRequest{" - + "instances=" + instances - + "}"; + return "InstanceGroupsRemoveInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsRemoveInstancesRequest) { InstanceGroupsRemoveInstancesRequest that = (InstanceGroupsRemoveInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java index 7060edf0b460..ad9dbc96e281 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private InstanceGroupsScopedList() { this.warning = null; } - - private InstanceGroupsScopedList( - List instanceGroups, - Warning warning - ) { + private InstanceGroupsScopedList(List instanceGroups, Warning warning) { this.instanceGroups = instanceGroups; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceGroupsScopedList build() { - return new InstanceGroupsScopedList( - instanceGroups, - warning - ); + return new InstanceGroupsScopedList(instanceGroups, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupsScopedList{" - + "instanceGroups=" + instanceGroups + ", " - + "warning=" + warning + + "instanceGroups=" + + instanceGroups + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsScopedList) { InstanceGroupsScopedList that = (InstanceGroupsScopedList) o; - return - Objects.equals(this.instanceGroups, that.getInstanceGroupsList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.instanceGroups, that.getInstanceGroupsList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceGroups, - warning - ); + return Objects.hash(instanceGroups, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java index d1b0265e3407..7dabe633d62a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private InstanceGroupsSetNamedPortsRequest() { this.namedPorts = null; } - - private InstanceGroupsSetNamedPortsRequest( - String fingerprint, - List namedPorts - ) { + private InstanceGroupsSetNamedPortsRequest(String fingerprint, List namedPorts) { this.fingerprint = fingerprint; this.namedPorts = namedPorts; } @@ -90,22 +85,24 @@ public List getNamedPortsList() { return namedPorts; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceGroupsSetNamedPortsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceGroupsSetNamedPortsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceGroupsSetNamedPortsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceGroupsSetNamedPortsRequest(); } @@ -158,13 +155,9 @@ public Builder addNamedPorts(NamedPort namedPorts) { return this; } - public InstanceGroupsSetNamedPortsRequest build() { - return new InstanceGroupsSetNamedPortsRequest( - fingerprint, - namedPorts - ); + return new InstanceGroupsSetNamedPortsRequest(fingerprint, namedPorts); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "InstanceGroupsSetNamedPortsRequest{" - + "fingerprint=" + fingerprint + ", " - + "namedPorts=" + namedPorts + + "fingerprint=" + + fingerprint + + ", " + + "namedPorts=" + + namedPorts + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof InstanceGroupsSetNamedPortsRequest) { InstanceGroupsSetNamedPortsRequest that = (InstanceGroupsSetNamedPortsRequest) o; - return - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.namedPorts, that.getNamedPortsList()) - ; + return Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.namedPorts, that.getNamedPortsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - fingerprint, - namedPorts - ); + return Objects.hash(fingerprint, namedPorts); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java index 9c2d9179488a..d941f757c9d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InstanceList() { this.warning = null; } - private InstanceList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceList build() { - - - - - return new InstanceList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InstanceList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceList) { InstanceList that = (InstanceList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java index 060142fee1ff..5b68399cdcfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InstanceListReferrers() { this.warning = null; } - private InstanceListReferrers( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceListReferrers prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceListReferrers getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceListReferrers DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceListReferrers(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceListReferrers build() { - - - - - return new InstanceListReferrers( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceListReferrers(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InstanceListReferrers{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceListReferrers) { InstanceListReferrers that = (InstanceListReferrers) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java index 4fd1cfc5474d..9bcd0e989942 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private InstanceMoveRequest() { this.targetInstance = null; } - - private InstanceMoveRequest( - String destinationZone, - String targetInstance - ) { + private InstanceMoveRequest(String destinationZone, String targetInstance) { this.destinationZone = destinationZone; this.targetInstance = targetInstance; } @@ -86,22 +79,24 @@ public String getTargetInstance() { return targetInstance; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceMoveRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceMoveRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceMoveRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceMoveRequest(); } @@ -146,13 +141,9 @@ public Builder setTargetInstance(String targetInstance) { return this; } - public InstanceMoveRequest build() { - return new InstanceMoveRequest( - destinationZone, - targetInstance - ); + return new InstanceMoveRequest(destinationZone, targetInstance); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "InstanceMoveRequest{" - + "destinationZone=" + destinationZone + ", " - + "targetInstance=" + targetInstance + + "destinationZone=" + + destinationZone + + ", " + + "targetInstance=" + + targetInstance + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof InstanceMoveRequest) { InstanceMoveRequest that = (InstanceMoveRequest) o; - return - Objects.equals(this.destinationZone, that.getDestinationZone()) && - Objects.equals(this.targetInstance, that.getTargetInstance()) - ; + return Objects.equals(this.destinationZone, that.getDestinationZone()) + && Objects.equals(this.targetInstance, that.getTargetInstance()); } return false; } @Override public int hashCode() { - return Objects.hash( - destinationZone, - targetInstance - ); + return Objects.hash(destinationZone, targetInstance); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java deleted file mode 100644 index d89dd3dc6a0c..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class InstanceName implements com.google.api.resourcenames.ResourceName { - private final String instance; - private final String project; - private final String zone; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private InstanceName(Builder builder) { - instance = Preconditions.checkNotNull(builder.getInstance()); - project = Preconditions.checkNotNull(builder.getProject()); - zone = Preconditions.checkNotNull(builder.getZone()); - } - - public static InstanceName of( - String instance, - String project, - String zone - ) { - return newBuilder() - .setInstance(instance) - .setProject(project) - .setZone(zone) - .build(); - } - - public static String format( - String instance, - String project, - String zone - ) { - return of( - instance, - project, - zone - ) - .toString(); - } - - public String getInstance() { - return instance; - } - - public String getProject() { - return project; - } - - public String getZone() { - return zone; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("instance", instance); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("zone", zone); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InstanceName parse(String formattedString) {return InstanceName.parse(formattedString);} - }; - } - - public static InstanceName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InstanceName.parse: formattedString not in valid format"); - return of( - matchMap.get("instance"), - matchMap.get("project"), - matchMap.get("zone") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String instance; - private String project; - private String zone; - - public String getInstance() { - return instance; - } - public String getProject() { - return project; - } - public String getZone() { - return zone; - } - - public Builder setInstance(String instance) { - this.instance = instance; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - private Builder() {} - - public Builder (InstanceName instanceName) { - instance = instanceName.instance; - project = instanceName.project; - zone = instanceName.zone; - } - - public InstanceName build() { - return new InstanceName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "instance", instance, - "project", project, - "zone", zone - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof InstanceName) { - InstanceName that = (InstanceName) o; - return - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - instance, - project, - zone - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java index 20b2f00fc34d..31bacf16a954 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -60,7 +59,6 @@ private InstanceProperties() { this.tags = null; } - private InstanceProperties( Boolean canIpForward, String description, @@ -73,8 +71,7 @@ private InstanceProperties( List networkInterfaces, Scheduling scheduling, List serviceAccounts, - Tags tags - ) { + Tags tags) { this.canIpForward = canIpForward; this.description = description; this.disks = disks; @@ -242,22 +239,24 @@ public Tags getTags() { return tags; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceProperties prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceProperties getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceProperties DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceProperties(); } @@ -474,33 +473,21 @@ public Builder setTags(Tags tags) { return this; } - public InstanceProperties build() { - - - - - - - - - - return new InstanceProperties( - canIpForward, - description, - disks, - guestAccelerators, - labels, - machineType, - metadata, - minCpuPlatform, - networkInterfaces, - scheduling, - serviceAccounts, - tags - ); + canIpForward, + description, + disks, + guestAccelerators, + labels, + machineType, + metadata, + minCpuPlatform, + networkInterfaces, + scheduling, + serviceAccounts, + tags); } public Builder clone() { @@ -524,18 +511,41 @@ public Builder clone() { @Override public String toString() { return "InstanceProperties{" - + "canIpForward=" + canIpForward + ", " - + "description=" + description + ", " - + "disks=" + disks + ", " - + "guestAccelerators=" + guestAccelerators + ", " - + "labels=" + labels + ", " - + "machineType=" + machineType + ", " - + "metadata=" + metadata + ", " - + "minCpuPlatform=" + minCpuPlatform + ", " - + "networkInterfaces=" + networkInterfaces + ", " - + "scheduling=" + scheduling + ", " - + "serviceAccounts=" + serviceAccounts + ", " - + "tags=" + tags + + "canIpForward=" + + canIpForward + + ", " + + "description=" + + description + + ", " + + "disks=" + + disks + + ", " + + "guestAccelerators=" + + guestAccelerators + + ", " + + "labels=" + + labels + + ", " + + "machineType=" + + machineType + + ", " + + "metadata=" + + metadata + + ", " + + "minCpuPlatform=" + + minCpuPlatform + + ", " + + "networkInterfaces=" + + networkInterfaces + + ", " + + "scheduling=" + + scheduling + + ", " + + "serviceAccounts=" + + serviceAccounts + + ", " + + "tags=" + + tags + "}"; } @@ -546,20 +556,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceProperties) { InstanceProperties that = (InstanceProperties) o; - return - Objects.equals(this.canIpForward, that.getCanIpForward()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.disks, that.getDisksList()) && - Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) && - Objects.equals(this.labels, that.getLabelsMap()) && - Objects.equals(this.machineType, that.getMachineType()) && - Objects.equals(this.metadata, that.getMetadata()) && - Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) && - Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) && - Objects.equals(this.scheduling, that.getScheduling()) && - Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) && - Objects.equals(this.tags, that.getTags()) - ; + return Objects.equals(this.canIpForward, that.getCanIpForward()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.disks, that.getDisksList()) + && Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) + && Objects.equals(this.labels, that.getLabelsMap()) + && Objects.equals(this.machineType, that.getMachineType()) + && Objects.equals(this.metadata, that.getMetadata()) + && Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) + && Objects.equals(this.networkInterfaces, that.getNetworkInterfacesList()) + && Objects.equals(this.scheduling, that.getScheduling()) + && Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) + && Objects.equals(this.tags, that.getTags()); } return false; } @@ -567,18 +575,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - canIpForward, - description, - disks, - guestAccelerators, - labels, - machineType, - metadata, - minCpuPlatform, - networkInterfaces, - scheduling, - serviceAccounts, - tags - ); + canIpForward, + description, + disks, + guestAccelerators, + labels, + machineType, + metadata, + minCpuPlatform, + networkInterfaces, + scheduling, + serviceAccounts, + tags); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java index 414e2ed1425f..a2688b582701 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private InstanceReference() { this.instance = null; } - - private InstanceReference( - String instance - ) { + private InstanceReference(String instance) { this.instance = instance; } @@ -72,22 +66,24 @@ public String getInstance() { return instance; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceReference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceReference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceReference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceReference(); } @@ -118,11 +114,8 @@ public Builder setInstance(String instance) { return this; } - public InstanceReference build() { - return new InstanceReference( - instance - ); + return new InstanceReference(instance); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "InstanceReference{" - + "instance=" + instance - + "}"; + return "InstanceReference{" + "instance=" + instance + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof InstanceReference) { InstanceReference that = (InstanceReference) o; - return - Objects.equals(this.instance, that.getInstance()) - ; + return Objects.equals(this.instance, that.getInstance()); } return false; } @Override public int hashCode() { - return Objects.hash( - instance - ); + return Objects.hash(instance); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java index 7ba9333a96bf..73793a15bbbc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java @@ -15,47 +15,25 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.stub.InstanceStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -64,15 +42,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addAccessConfigInstance to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addAccessConfigInstance to 30 seconds: * *

  * 
@@ -87,238 +65,193 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to addAccessConfigInstance.
-   */
-  public UnaryCallSettings addAccessConfigInstanceSettings() {
+  /** Returns the object with the settings used for calls to addAccessConfigInstance. */
+  public UnaryCallSettings
+      addAccessConfigInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).addAccessConfigInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstances.
-   */
-  public PagedCallSettings aggregatedListInstancesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListInstances. */
+  public PagedCallSettings<
+          AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+          AggregatedListInstancesPagedResponse>
+      aggregatedListInstancesSettings() {
     return ((InstanceStubSettings) getStubSettings()).aggregatedListInstancesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to attachDiskInstance.
-   */
+  /** Returns the object with the settings used for calls to attachDiskInstance. */
   public UnaryCallSettings attachDiskInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).attachDiskInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstance.
-   */
+  /** Returns the object with the settings used for calls to deleteInstance. */
   public UnaryCallSettings deleteInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).deleteInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteAccessConfigInstance.
-   */
-  public UnaryCallSettings deleteAccessConfigInstanceSettings() {
+  /** Returns the object with the settings used for calls to deleteAccessConfigInstance. */
+  public UnaryCallSettings
+      deleteAccessConfigInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).deleteAccessConfigInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to detachDiskInstance.
-   */
+  /** Returns the object with the settings used for calls to detachDiskInstance. */
   public UnaryCallSettings detachDiskInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).detachDiskInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstance.
-   */
+  /** Returns the object with the settings used for calls to getInstance. */
   public UnaryCallSettings getInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).getInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSerialPortOutputInstance.
-   */
-  public UnaryCallSettings getSerialPortOutputInstanceSettings() {
+  /** Returns the object with the settings used for calls to getSerialPortOutputInstance. */
+  public UnaryCallSettings
+      getSerialPortOutputInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).getSerialPortOutputInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstance.
-   */
+  /** Returns the object with the settings used for calls to insertInstance. */
   public UnaryCallSettings insertInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).insertInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstances.
-   */
-  public PagedCallSettings listInstancesSettings() {
+  /** Returns the object with the settings used for calls to listInstances. */
+  public PagedCallSettings
+      listInstancesSettings() {
     return ((InstanceStubSettings) getStubSettings()).listInstancesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listReferrersInstances.
-   */
-  public PagedCallSettings listReferrersInstancesSettings() {
+  /** Returns the object with the settings used for calls to listReferrersInstances. */
+  public PagedCallSettings<
+          ListReferrersInstancesHttpRequest, InstanceListReferrers,
+          ListReferrersInstancesPagedResponse>
+      listReferrersInstancesSettings() {
     return ((InstanceStubSettings) getStubSettings()).listReferrersInstancesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to resetInstance.
-   */
+  /** Returns the object with the settings used for calls to resetInstance. */
   public UnaryCallSettings resetInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).resetInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setDeletionProtectionInstance.
-   */
-  public UnaryCallSettings setDeletionProtectionInstanceSettings() {
+  /** Returns the object with the settings used for calls to setDeletionProtectionInstance. */
+  public UnaryCallSettings
+      setDeletionProtectionInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setDeletionProtectionInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setDiskAutoDeleteInstance.
-   */
-  public UnaryCallSettings setDiskAutoDeleteInstanceSettings() {
+  /** Returns the object with the settings used for calls to setDiskAutoDeleteInstance. */
+  public UnaryCallSettings
+      setDiskAutoDeleteInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setDiskAutoDeleteInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsInstance.
-   */
+  /** Returns the object with the settings used for calls to setLabelsInstance. */
   public UnaryCallSettings setLabelsInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setLabelsInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMachineResourcesInstance.
-   */
-  public UnaryCallSettings setMachineResourcesInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMachineResourcesInstance. */
+  public UnaryCallSettings
+      setMachineResourcesInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setMachineResourcesInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMachineTypeInstance.
-   */
-  public UnaryCallSettings setMachineTypeInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMachineTypeInstance. */
+  public UnaryCallSettings
+      setMachineTypeInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setMachineTypeInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMetadataInstance.
-   */
-  public UnaryCallSettings setMetadataInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMetadataInstance. */
+  public UnaryCallSettings
+      setMetadataInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setMetadataInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMinCpuPlatformInstance.
-   */
-  public UnaryCallSettings setMinCpuPlatformInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMinCpuPlatformInstance. */
+  public UnaryCallSettings
+      setMinCpuPlatformInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setMinCpuPlatformInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setSchedulingInstance.
-   */
-  public UnaryCallSettings setSchedulingInstanceSettings() {
+  /** Returns the object with the settings used for calls to setSchedulingInstance. */
+  public UnaryCallSettings
+      setSchedulingInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setSchedulingInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setServiceAccountInstance.
-   */
-  public UnaryCallSettings setServiceAccountInstanceSettings() {
+  /** Returns the object with the settings used for calls to setServiceAccountInstance. */
+  public UnaryCallSettings
+      setServiceAccountInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setServiceAccountInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTagsInstance.
-   */
+  /** Returns the object with the settings used for calls to setTagsInstance. */
   public UnaryCallSettings setTagsInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).setTagsInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to startInstance.
-   */
+  /** Returns the object with the settings used for calls to startInstance. */
   public UnaryCallSettings startInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).startInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to startWithEncryptionKeyInstance.
-   */
-  public UnaryCallSettings startWithEncryptionKeyInstanceSettings() {
+  /** Returns the object with the settings used for calls to startWithEncryptionKeyInstance. */
+  public UnaryCallSettings
+      startWithEncryptionKeyInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).startWithEncryptionKeyInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to stopInstance.
-   */
+  /** Returns the object with the settings used for calls to stopInstance. */
   public UnaryCallSettings stopInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).stopInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateAccessConfigInstance.
-   */
-  public UnaryCallSettings updateAccessConfigInstanceSettings() {
+  /** Returns the object with the settings used for calls to updateAccessConfigInstance. */
+  public UnaryCallSettings
+      updateAccessConfigInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).updateAccessConfigInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateNetworkInterfaceInstance.
-   */
-  public UnaryCallSettings updateNetworkInterfaceInstanceSettings() {
+  /** Returns the object with the settings used for calls to updateNetworkInterfaceInstance. */
+  public UnaryCallSettings
+      updateNetworkInterfaceInstanceSettings() {
     return ((InstanceStubSettings) getStubSettings()).updateNetworkInterfaceInstanceSettings();
   }
 
-
   public static final InstanceSettings create(InstanceStubSettings stub) throws IOException {
     return new InstanceSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstanceStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InstanceStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InstanceStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InstanceStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InstanceStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InstanceStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstanceStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -331,23 +264,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InstanceStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -356,9 +283,7 @@ protected InstanceSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InstanceSettings.
-   */
+  /** Builder for InstanceSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -380,207 +305,183 @@ protected Builder(InstanceStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InstanceStubSettings.Builder getStubSettingsBuilder() {
       return ((InstanceStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to addAccessConfigInstance. - */ - public UnaryCallSettings.Builder addAccessConfigInstanceSettings() { + /** Returns the builder for the settings used for calls to addAccessConfigInstance. */ + public UnaryCallSettings.Builder + addAccessConfigInstanceSettings() { return getStubSettingsBuilder().addAccessConfigInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to aggregatedListInstances. - */ - public PagedCallSettings.Builder aggregatedListInstancesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListInstances. */ + public PagedCallSettings.Builder< + AggregatedListInstancesHttpRequest, InstanceAggregatedList, + AggregatedListInstancesPagedResponse> + aggregatedListInstancesSettings() { return getStubSettingsBuilder().aggregatedListInstancesSettings(); } - /** - * Returns the builder for the settings used for calls to attachDiskInstance. - */ - public UnaryCallSettings.Builder attachDiskInstanceSettings() { + /** Returns the builder for the settings used for calls to attachDiskInstance. */ + public UnaryCallSettings.Builder + attachDiskInstanceSettings() { return getStubSettingsBuilder().attachDiskInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to deleteInstance. - */ - public UnaryCallSettings.Builder deleteInstanceSettings() { + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder + deleteInstanceSettings() { return getStubSettingsBuilder().deleteInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to deleteAccessConfigInstance. - */ - public UnaryCallSettings.Builder deleteAccessConfigInstanceSettings() { + /** Returns the builder for the settings used for calls to deleteAccessConfigInstance. */ + public UnaryCallSettings.Builder + deleteAccessConfigInstanceSettings() { return getStubSettingsBuilder().deleteAccessConfigInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to detachDiskInstance. - */ - public UnaryCallSettings.Builder detachDiskInstanceSettings() { + /** Returns the builder for the settings used for calls to detachDiskInstance. */ + public UnaryCallSettings.Builder + detachDiskInstanceSettings() { return getStubSettingsBuilder().detachDiskInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to getInstance. - */ + /** Returns the builder for the settings used for calls to getInstance. */ public UnaryCallSettings.Builder getInstanceSettings() { return getStubSettingsBuilder().getInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to getSerialPortOutputInstance. - */ - public UnaryCallSettings.Builder getSerialPortOutputInstanceSettings() { + /** Returns the builder for the settings used for calls to getSerialPortOutputInstance. */ + public UnaryCallSettings.Builder + getSerialPortOutputInstanceSettings() { return getStubSettingsBuilder().getSerialPortOutputInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to insertInstance. - */ - public UnaryCallSettings.Builder insertInstanceSettings() { + /** Returns the builder for the settings used for calls to insertInstance. */ + public UnaryCallSettings.Builder + insertInstanceSettings() { return getStubSettingsBuilder().insertInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to listInstances. - */ - public PagedCallSettings.Builder listInstancesSettings() { + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesHttpRequest, InstanceList, ListInstancesPagedResponse> + listInstancesSettings() { return getStubSettingsBuilder().listInstancesSettings(); } - /** - * Returns the builder for the settings used for calls to listReferrersInstances. - */ - public PagedCallSettings.Builder listReferrersInstancesSettings() { + /** Returns the builder for the settings used for calls to listReferrersInstances. */ + public PagedCallSettings.Builder< + ListReferrersInstancesHttpRequest, InstanceListReferrers, + ListReferrersInstancesPagedResponse> + listReferrersInstancesSettings() { return getStubSettingsBuilder().listReferrersInstancesSettings(); } - /** - * Returns the builder for the settings used for calls to resetInstance. - */ + /** Returns the builder for the settings used for calls to resetInstance. */ public UnaryCallSettings.Builder resetInstanceSettings() { return getStubSettingsBuilder().resetInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setDeletionProtectionInstance. - */ - public UnaryCallSettings.Builder setDeletionProtectionInstanceSettings() { + /** Returns the builder for the settings used for calls to setDeletionProtectionInstance. */ + public UnaryCallSettings.Builder + setDeletionProtectionInstanceSettings() { return getStubSettingsBuilder().setDeletionProtectionInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. - */ - public UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings() { + /** Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. */ + public UnaryCallSettings.Builder + setDiskAutoDeleteInstanceSettings() { return getStubSettingsBuilder().setDiskAutoDeleteInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setLabelsInstance. - */ - public UnaryCallSettings.Builder setLabelsInstanceSettings() { + /** Returns the builder for the settings used for calls to setLabelsInstance. */ + public UnaryCallSettings.Builder + setLabelsInstanceSettings() { return getStubSettingsBuilder().setLabelsInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setMachineResourcesInstance. - */ - public UnaryCallSettings.Builder setMachineResourcesInstanceSettings() { + /** Returns the builder for the settings used for calls to setMachineResourcesInstance. */ + public UnaryCallSettings.Builder + setMachineResourcesInstanceSettings() { return getStubSettingsBuilder().setMachineResourcesInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setMachineTypeInstance. - */ - public UnaryCallSettings.Builder setMachineTypeInstanceSettings() { + /** Returns the builder for the settings used for calls to setMachineTypeInstance. */ + public UnaryCallSettings.Builder + setMachineTypeInstanceSettings() { return getStubSettingsBuilder().setMachineTypeInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setMetadataInstance. - */ - public UnaryCallSettings.Builder setMetadataInstanceSettings() { + /** Returns the builder for the settings used for calls to setMetadataInstance. */ + public UnaryCallSettings.Builder + setMetadataInstanceSettings() { return getStubSettingsBuilder().setMetadataInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setMinCpuPlatformInstance. - */ - public UnaryCallSettings.Builder setMinCpuPlatformInstanceSettings() { + /** Returns the builder for the settings used for calls to setMinCpuPlatformInstance. */ + public UnaryCallSettings.Builder + setMinCpuPlatformInstanceSettings() { return getStubSettingsBuilder().setMinCpuPlatformInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setSchedulingInstance. - */ - public UnaryCallSettings.Builder setSchedulingInstanceSettings() { + /** Returns the builder for the settings used for calls to setSchedulingInstance. */ + public UnaryCallSettings.Builder + setSchedulingInstanceSettings() { return getStubSettingsBuilder().setSchedulingInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setServiceAccountInstance. - */ - public UnaryCallSettings.Builder setServiceAccountInstanceSettings() { + /** Returns the builder for the settings used for calls to setServiceAccountInstance. */ + public UnaryCallSettings.Builder + setServiceAccountInstanceSettings() { return getStubSettingsBuilder().setServiceAccountInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to setTagsInstance. - */ - public UnaryCallSettings.Builder setTagsInstanceSettings() { + /** Returns the builder for the settings used for calls to setTagsInstance. */ + public UnaryCallSettings.Builder + setTagsInstanceSettings() { return getStubSettingsBuilder().setTagsInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to startInstance. - */ + /** Returns the builder for the settings used for calls to startInstance. */ public UnaryCallSettings.Builder startInstanceSettings() { return getStubSettingsBuilder().startInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to startWithEncryptionKeyInstance. - */ - public UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings() { + /** Returns the builder for the settings used for calls to startWithEncryptionKeyInstance. */ + public UnaryCallSettings.Builder + startWithEncryptionKeyInstanceSettings() { return getStubSettingsBuilder().startWithEncryptionKeyInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to stopInstance. - */ + /** Returns the builder for the settings used for calls to stopInstance. */ public UnaryCallSettings.Builder stopInstanceSettings() { return getStubSettingsBuilder().stopInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to updateAccessConfigInstance. - */ - public UnaryCallSettings.Builder updateAccessConfigInstanceSettings() { + /** Returns the builder for the settings used for calls to updateAccessConfigInstance. */ + public UnaryCallSettings.Builder + updateAccessConfigInstanceSettings() { return getStubSettingsBuilder().updateAccessConfigInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to updateNetworkInterfaceInstance. - */ - public UnaryCallSettings.Builder updateNetworkInterfaceInstanceSettings() { + /** Returns the builder for the settings used for calls to updateNetworkInterfaceInstance. */ + public UnaryCallSettings.Builder + updateNetworkInterfaceInstanceSettings() { return getStubSettingsBuilder().updateNetworkInterfaceInstanceSettings(); } @@ -589,4 +490,4 @@ public InstanceSettings build() throws IOException { return new InstanceSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java index a1f965b37e67..0aab1348c662 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -50,7 +47,6 @@ private InstanceTemplate() { this.selfLink = null; } - private InstanceTemplate( String creationTimestamp, String description, @@ -58,8 +54,7 @@ private InstanceTemplate( String kind, String name, InstanceProperties properties, - String selfLink - ) { + String selfLink) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -73,7 +68,8 @@ private InstanceTemplate( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -156,22 +152,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceTemplate prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceTemplate getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceTemplate DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceTemplate(); } @@ -286,23 +284,10 @@ public Builder setSelfLink(String selfLink) { return this; } - public InstanceTemplate build() { - - - - - return new InstanceTemplate( - creationTimestamp, - description, - id, - kind, - name, - properties, - selfLink - ); + creationTimestamp, description, id, kind, name, properties, selfLink); } public Builder clone() { @@ -321,13 +306,26 @@ public Builder clone() { @Override public String toString() { return "InstanceTemplate{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "properties=" + properties + ", " - + "selfLink=" + selfLink + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "properties=" + + properties + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -338,29 +336,19 @@ public boolean equals(Object o) { } if (o instanceof InstanceTemplate) { InstanceTemplate that = (InstanceTemplate) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.properties, that.getProperties()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.properties, that.getProperties()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @Override public int hashCode() { - return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - properties, - selfLink - ); + return Objects.hash(creationTimestamp, description, id, kind, name, properties, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java index ead882fa1359..b3251d0afab2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InstanceTemplateStub; import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,41 @@ *

  * 
  * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
- *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+ *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
  *   String requestId = "";
  *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the instanceTemplateClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of InstanceTemplateSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class InstanceTemplateClient implements BackgroundResource {
   private final InstanceTemplateSettings settings;
   private final InstanceTemplateStub stub;
 
-
-
-  /**
-   * Constructs an instance of InstanceTemplateClient with default settings.
-   */
+  /** Constructs an instance of InstanceTemplateClient with default settings. */
   public static final InstanceTemplateClient create() throws IOException {
     return create(InstanceTemplateSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InstanceTemplateClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InstanceTemplateClient create(InstanceTemplateSettings settings) throws IOException {
+  public static final InstanceTemplateClient create(InstanceTemplateSettings settings)
+      throws IOException {
     return new InstanceTemplateClient(settings);
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InstanceTemplateSettings}.
+   * Constructs an instance of InstanceTemplateClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use InstanceTemplateSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InstanceTemplateClient create(InstanceTemplateStub stub) {
@@ -144,9 +130,9 @@ public static final InstanceTemplateClient create(InstanceTemplateStub stub) {
   }
 
   /**
-   * Constructs an instance of InstanceTemplateClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InstanceTemplateClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected InstanceTemplateClient(InstanceTemplateSettings settings) throws IOException {
     this.settings = settings;
@@ -168,58 +154,70 @@ public InstanceTemplateStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group.
+   * Deletes the specified instance template. Deleting an instance template is permanent and cannot
+   * be undone. It's not possible to delete templates which are in use by an instance group.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
    * }
    * 
* * @param instanceTemplate The name of the instance template to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceTemplate(ProjectInstanceTemplateName instanceTemplate, String requestId) { + public final Operation deleteInstanceTemplate( + ProjectGlobalInstanceTemplateName instanceTemplate, String requestId) { DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder() - .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) - .setRequestId(requestId) - .build(); + .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) + .setRequestId(requestId) + .build(); return deleteInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group. + * Deletes the specified instance template. Deleting an instance template is permanent and cannot + * be undone. It's not possible to delete templates which are in use by an instance group. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString(), requestId);
    * }
    * 
* * @param instanceTemplate The name of the instance template to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,20 +225,22 @@ public final Operation deleteInstanceTemplate(String instanceTemplate, String re DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder() - .setInstanceTemplate(instanceTemplate) - .setRequestId(requestId) - .build(); + .setInstanceTemplate(instanceTemplate) + .setRequestId(requestId) + .build(); return deleteInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group. + * Deletes the specified instance template. Deleting an instance template is permanent and cannot + * be undone. It's not possible to delete templates which are in use by an instance group. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
@@ -260,12 +260,14 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group.
+   * Deletes the specified instance template. Deleting an instance template is permanent and cannot
+   * be undone. It's not possible to delete templates which are in use by an instance group.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
@@ -278,18 +280,21 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteInstanceTemplateCallable() { + public final UnaryCallable + deleteInstanceTemplateCallable() { return stub.deleteInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * Returns the specified instance template. Get a list of available instance templates by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(instanceTemplate);
    * }
    * 
@@ -298,23 +303,26 @@ public final UnaryCallable deleteI * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final InstanceTemplate getInstanceTemplate(ProjectInstanceTemplateName instanceTemplate) { + public final InstanceTemplate getInstanceTemplate( + ProjectGlobalInstanceTemplateName instanceTemplate) { GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder() - .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) - .build(); + .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) + .build(); return getInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * Returns the specified instance template. Get a list of available instance templates by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   InstanceTemplate response = instanceTemplateClient.getInstanceTemplate(instanceTemplate.toString());
    * }
    * 
@@ -326,20 +334,20 @@ public final InstanceTemplate getInstanceTemplate(ProjectInstanceTemplateName in public final InstanceTemplate getInstanceTemplate(String instanceTemplate) { GetInstanceTemplateHttpRequest request = - GetInstanceTemplateHttpRequest.newBuilder() - .setInstanceTemplate(instanceTemplate) - .build(); + GetInstanceTemplateHttpRequest.newBuilder().setInstanceTemplate(instanceTemplate).build(); return getInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a list() request. + * Returns the specified instance template. Get a list of available instance templates by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
    *     .build();
@@ -357,12 +365,14 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified instance template. Get a list of available instance templates by making a list() request.
+   * Returns the specified instance template. Get a list of available instance templates by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+   *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
    *   GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
    *     .build();
@@ -373,15 +383,20 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable getInstanceTemplateCallable() { + public final UnaryCallable + getInstanceTemplateCallable() { return stub.getInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   String requestId = "";
@@ -391,32 +406,42 @@ public final UnaryCallable get
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param instanceTemplateResource An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) + * @param instanceTemplateResource An Instance Template resource. (== resource_for + * beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceTemplate(String requestId, ProjectName project, InstanceTemplate instanceTemplateResource) { + public final Operation insertInstanceTemplate( + String requestId, ProjectName project, InstanceTemplate instanceTemplateResource) { InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setInstanceTemplateResource(instanceTemplateResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setInstanceTemplateResource(instanceTemplateResource) + .build(); return insertInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   String requestId = "";
@@ -426,32 +451,42 @@ public final Operation insertInstanceTemplate(String requestId, ProjectName proj
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param instanceTemplateResource An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) + * @param instanceTemplateResource An Instance Template resource. (== resource_for + * beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceTemplate(String requestId, String project, InstanceTemplate instanceTemplateResource) { + public final Operation insertInstanceTemplate( + String requestId, String project, InstanceTemplate instanceTemplateResource) { InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setInstanceTemplateResource(instanceTemplateResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setInstanceTemplateResource(instanceTemplateResource) + .build(); return insertInstanceTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   String requestId = "";
@@ -476,9 +511,13 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   String requestId = "";
@@ -496,15 +535,18 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertInstanceTemplateCallable() { + public final UnaryCallable + insertInstanceTemplateCallable() { return stub.insertInstanceTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of instance templates that are contained within the specified project and zone. + * Retrieves a list of instance templates that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,16 +563,18 @@ public final UnaryCallable insertI
   public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectName project) {
     ListInstanceTemplatesHttpRequest request =
         ListInstanceTemplatesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listInstanceTemplates(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and zone.
+   * Retrieves a list of instance templates that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,17 +590,17 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ProjectNam
   @BetaApi
   public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String project) {
     ListInstanceTemplatesHttpRequest request =
-        ListInstanceTemplatesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListInstanceTemplatesHttpRequest.newBuilder().setProject(project).build();
     return listInstanceTemplates(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and zone.
+   * Retrieves a list of instance templates that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +617,18 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(String pro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ListInstanceTemplatesHttpRequest request) {
-    return listInstanceTemplatesPagedCallable()
-        .call(request);
+  public final ListInstanceTemplatesPagedResponse listInstanceTemplates(
+      ListInstanceTemplatesHttpRequest request) {
+    return listInstanceTemplatesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves a list of instance templates that are contained within the specified project and zone.
+   * Retrieves a list of instance templates that are contained within the specified project and
+   * zone.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,15 +644,18 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates(ListInstan
    * 
*/ @BetaApi - public final UnaryCallable listInstanceTemplatesPagedCallable() { + public final UnaryCallable + listInstanceTemplatesPagedCallable() { return stub.listInstanceTemplatesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves a list of instance templates that are contained within the specified project and zone. + * Retrieves a list of instance templates that are contained within the specified project and + * zone. + * + *

Sample code: * - * Sample code: *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,12 +678,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstanceTemplatesCallable() { + public final UnaryCallable + listInstanceTemplatesCallable() { return stub.listInstanceTemplatesCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -663,15 +713,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListInstanceTemplatesPagedResponse extends AbstractPagedListResponse< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage, - ListInstanceTemplatesFixedSizeCollection> { + public static class ListInstanceTemplatesPagedResponse + extends AbstractPagedListResponse< + ListInstanceTemplatesHttpRequest, InstanceTemplateList, InstanceTemplate, + ListInstanceTemplatesPage, ListInstanceTemplatesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListInstanceTemplatesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -688,18 +737,16 @@ public ListInstanceTemplatesPagedResponse apply(ListInstanceTemplatesPage input) private ListInstanceTemplatesPagedResponse(ListInstanceTemplatesPage page) { super(page, ListInstanceTemplatesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstanceTemplatesPage extends AbstractPage< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage> { + public static class ListInstanceTemplatesPage + extends AbstractPage< + ListInstanceTemplatesHttpRequest, InstanceTemplateList, InstanceTemplate, + ListInstanceTemplatesPage> { private ListInstanceTemplatesPage( - PageContext context, + PageContext + context, InstanceTemplateList response) { super(context, response); } @@ -710,31 +757,28 @@ private static ListInstanceTemplatesPage createEmptyPage() { @Override protected ListInstanceTemplatesPage createPage( - PageContext context, + PageContext + context, InstanceTemplateList response) { return new ListInstanceTemplatesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstanceTemplatesFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstanceTemplatesHttpRequest, - InstanceTemplateList, - InstanceTemplate, - ListInstanceTemplatesPage, - ListInstanceTemplatesFixedSizeCollection> { + public static class ListInstanceTemplatesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstanceTemplatesHttpRequest, InstanceTemplateList, InstanceTemplate, + ListInstanceTemplatesPage, ListInstanceTemplatesFixedSizeCollection> { - private ListInstanceTemplatesFixedSizeCollection(List pages, int collectionSize) { + private ListInstanceTemplatesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -747,7 +791,5 @@ protected ListInstanceTemplatesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstanceTemplatesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java index e9f10a7c9f7f..978a2165ef68 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InstanceTemplateList() { this.warning = null; } - private InstanceTemplateList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceTemplateList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceTemplateList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceTemplateList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceTemplateList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstanceTemplateList build() { - - - - - return new InstanceTemplateList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InstanceTemplateList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InstanceTemplateList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InstanceTemplateList) { InstanceTemplateList that = (InstanceTemplateList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java index 62589deb971a..2b625d92365d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteInstanceTemplate to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteInstanceTemplate to 30 seconds: * *

  * 
@@ -85,77 +63,64 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceTemplateSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceTemplate.
-   */
-  public UnaryCallSettings deleteInstanceTemplateSettings() {
+  /** Returns the object with the settings used for calls to deleteInstanceTemplate. */
+  public UnaryCallSettings
+      deleteInstanceTemplateSettings() {
     return ((InstanceTemplateStubSettings) getStubSettings()).deleteInstanceTemplateSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceTemplate.
-   */
-  public UnaryCallSettings getInstanceTemplateSettings() {
+  /** Returns the object with the settings used for calls to getInstanceTemplate. */
+  public UnaryCallSettings
+      getInstanceTemplateSettings() {
     return ((InstanceTemplateStubSettings) getStubSettings()).getInstanceTemplateSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceTemplate.
-   */
-  public UnaryCallSettings insertInstanceTemplateSettings() {
+  /** Returns the object with the settings used for calls to insertInstanceTemplate. */
+  public UnaryCallSettings
+      insertInstanceTemplateSettings() {
     return ((InstanceTemplateStubSettings) getStubSettings()).insertInstanceTemplateSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceTemplates.
-   */
-  public PagedCallSettings listInstanceTemplatesSettings() {
+  /** Returns the object with the settings used for calls to listInstanceTemplates. */
+  public PagedCallSettings<
+          ListInstanceTemplatesHttpRequest, InstanceTemplateList,
+          ListInstanceTemplatesPagedResponse>
+      listInstanceTemplatesSettings() {
     return ((InstanceTemplateStubSettings) getStubSettings()).listInstanceTemplatesSettings();
   }
 
-
-  public static final InstanceTemplateSettings create(InstanceTemplateStubSettings stub) throws IOException {
+  public static final InstanceTemplateSettings create(InstanceTemplateStubSettings stub)
+      throws IOException {
     return new InstanceTemplateSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstanceTemplateStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InstanceTemplateStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InstanceTemplateStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InstanceTemplateStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InstanceTemplateStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InstanceTemplateStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstanceTemplateStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -168,23 +133,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InstanceTemplateStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -193,9 +152,7 @@ protected InstanceTemplateSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InstanceTemplateSettings.
-   */
+  /** Builder for InstanceTemplateSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -217,46 +174,46 @@ protected Builder(InstanceTemplateStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InstanceTemplateStubSettings.Builder getStubSettingsBuilder() {
       return ((InstanceTemplateStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteInstanceTemplate. - */ - public UnaryCallSettings.Builder deleteInstanceTemplateSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceTemplate. */ + public UnaryCallSettings.Builder + deleteInstanceTemplateSettings() { return getStubSettingsBuilder().deleteInstanceTemplateSettings(); } - /** - * Returns the builder for the settings used for calls to getInstanceTemplate. - */ - public UnaryCallSettings.Builder getInstanceTemplateSettings() { + /** Returns the builder for the settings used for calls to getInstanceTemplate. */ + public UnaryCallSettings.Builder + getInstanceTemplateSettings() { return getStubSettingsBuilder().getInstanceTemplateSettings(); } - /** - * Returns the builder for the settings used for calls to insertInstanceTemplate. - */ - public UnaryCallSettings.Builder insertInstanceTemplateSettings() { + /** Returns the builder for the settings used for calls to insertInstanceTemplate. */ + public UnaryCallSettings.Builder + insertInstanceTemplateSettings() { return getStubSettingsBuilder().insertInstanceTemplateSettings(); } - /** - * Returns the builder for the settings used for calls to listInstanceTemplates. - */ - public PagedCallSettings.Builder listInstanceTemplatesSettings() { + /** Returns the builder for the settings used for calls to listInstanceTemplates. */ + public PagedCallSettings.Builder< + ListInstanceTemplatesHttpRequest, InstanceTemplateList, + ListInstanceTemplatesPagedResponse> + listInstanceTemplatesSettings() { return getStubSettingsBuilder().listInstanceTemplatesSettings(); } @@ -265,4 +222,4 @@ public InstanceTemplateSettings build() throws IOException { return new InstanceTemplateSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java index 11faf51f5123..d5a2289c923f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,12 +41,7 @@ private InstanceWithNamedPorts() { this.status = null; } - - private InstanceWithNamedPorts( - String instance, - List namedPorts, - String status - ) { + private InstanceWithNamedPorts(String instance, List namedPorts, String status) { this.instance = instance; this.namedPorts = namedPorts; this.status = status; @@ -104,22 +98,24 @@ public String getStatus() { return status; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstanceWithNamedPorts prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstanceWithNamedPorts getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstanceWithNamedPorts DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstanceWithNamedPorts(); } @@ -186,15 +182,9 @@ public Builder setStatus(String status) { return this; } - public InstanceWithNamedPorts build() { - - return new InstanceWithNamedPorts( - instance, - namedPorts, - status - ); + return new InstanceWithNamedPorts(instance, namedPorts, status); } public Builder clone() { @@ -209,9 +199,14 @@ public Builder clone() { @Override public String toString() { return "InstanceWithNamedPorts{" - + "instance=" + instance + ", " - + "namedPorts=" + namedPorts + ", " - + "status=" + status + + "instance=" + + instance + + ", " + + "namedPorts=" + + namedPorts + + ", " + + "status=" + + status + "}"; } @@ -222,21 +217,15 @@ public boolean equals(Object o) { } if (o instanceof InstanceWithNamedPorts) { InstanceWithNamedPorts that = (InstanceWithNamedPorts) o; - return - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.namedPorts, that.getNamedPortsList()) && - Objects.equals(this.status, that.getStatus()) - ; + return Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.namedPorts, that.getNamedPortsList()) + && Objects.equals(this.status, that.getStatus()); } return false; } @Override public int hashCode() { - return Objects.hash( - instance, - namedPorts, - status - ); + return Objects.hash(instance, namedPorts, status); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java index d488ca668a2e..a90d6ddd0e7f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private InstancesScopedList() { this.warning = null; } - - private InstancesScopedList( - List instances, - Warning warning - ) { + private InstancesScopedList(List instances, Warning warning) { this.instances = instances; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public InstancesScopedList build() { - return new InstancesScopedList( - instances, - warning - ); + return new InstancesScopedList(instances, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "InstancesScopedList{" - + "instances=" + instances + ", " - + "warning=" + warning - + "}"; + return "InstancesScopedList{" + "instances=" + instances + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof InstancesScopedList) { InstancesScopedList that = (InstancesScopedList) o; - return - Objects.equals(this.instances, that.getInstancesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.instances, that.getInstancesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances, - warning - ); + return Objects.hash(instances, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java index 139023807398..8f5854007be7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private InstancesSetLabelsRequest() { this.labels = null; } - - private InstancesSetLabelsRequest( - String labelFingerprint, - Map labels - ) { + private InstancesSetLabelsRequest(String labelFingerprint, Map labels) { this.labelFingerprint = labelFingerprint; this.labels = labels; } @@ -86,22 +79,24 @@ public Map getLabelsMap() { return labels; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesSetLabelsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesSetLabelsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesSetLabelsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesSetLabelsRequest(); } @@ -146,13 +141,9 @@ public Builder putAllLabels(Map labels) { return this; } - public InstancesSetLabelsRequest build() { - return new InstancesSetLabelsRequest( - labelFingerprint, - labels - ); + return new InstancesSetLabelsRequest(labelFingerprint, labels); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "InstancesSetLabelsRequest{" - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof InstancesSetLabelsRequest) { InstancesSetLabelsRequest that = (InstancesSetLabelsRequest) o; - return - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) - ; + return Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - labelFingerprint, - labels - ); + return Objects.hash(labelFingerprint, labels); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java index 19d7aa1543a2..edc382e08ae0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstancesSetMachineResourcesRequest() { this.guestAccelerators = null; } - - private InstancesSetMachineResourcesRequest( - List guestAccelerators - ) { + private InstancesSetMachineResourcesRequest(List guestAccelerators) { this.guestAccelerators = guestAccelerators; } @@ -76,22 +71,24 @@ public List getGuestAcceleratorsList() { return guestAccelerators; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesSetMachineResourcesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesSetMachineResourcesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesSetMachineResourcesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesSetMachineResourcesRequest(); } @@ -130,11 +127,8 @@ public Builder addGuestAccelerators(AcceleratorConfig guestAccelerators) { return this; } - public InstancesSetMachineResourcesRequest build() { - return new InstancesSetMachineResourcesRequest( - guestAccelerators - ); + return new InstancesSetMachineResourcesRequest(guestAccelerators); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstancesSetMachineResourcesRequest{" - + "guestAccelerators=" + guestAccelerators - + "}"; + return "InstancesSetMachineResourcesRequest{" + "guestAccelerators=" + guestAccelerators + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof InstancesSetMachineResourcesRequest) { InstancesSetMachineResourcesRequest that = (InstancesSetMachineResourcesRequest) o; - return - Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()) - ; + return Objects.equals(this.guestAccelerators, that.getGuestAcceleratorsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - guestAccelerators - ); + return Objects.hash(guestAccelerators); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java index ed8f60bf97f7..0fafbb310071 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private InstancesSetMachineTypeRequest() { this.machineType = null; } - - private InstancesSetMachineTypeRequest( - String machineType - ) { + private InstancesSetMachineTypeRequest(String machineType) { this.machineType = machineType; } @@ -72,22 +66,24 @@ public String getMachineType() { return machineType; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesSetMachineTypeRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesSetMachineTypeRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesSetMachineTypeRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesSetMachineTypeRequest(); } @@ -118,11 +114,8 @@ public Builder setMachineType(String machineType) { return this; } - public InstancesSetMachineTypeRequest build() { - return new InstancesSetMachineTypeRequest( - machineType - ); + return new InstancesSetMachineTypeRequest(machineType); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "InstancesSetMachineTypeRequest{" - + "machineType=" + machineType - + "}"; + return "InstancesSetMachineTypeRequest{" + "machineType=" + machineType + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof InstancesSetMachineTypeRequest) { InstancesSetMachineTypeRequest that = (InstancesSetMachineTypeRequest) o; - return - Objects.equals(this.machineType, that.getMachineType()) - ; + return Objects.equals(this.machineType, that.getMachineType()); } return false; } @Override public int hashCode() { - return Objects.hash( - machineType - ); + return Objects.hash(machineType); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java index 63b34e4502cf..b8a75edb1d66 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private InstancesSetMinCpuPlatformRequest() { this.minCpuPlatform = null; } - - private InstancesSetMinCpuPlatformRequest( - String minCpuPlatform - ) { + private InstancesSetMinCpuPlatformRequest(String minCpuPlatform) { this.minCpuPlatform = minCpuPlatform; } @@ -72,22 +66,24 @@ public String getMinCpuPlatform() { return minCpuPlatform; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesSetMinCpuPlatformRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesSetMinCpuPlatformRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesSetMinCpuPlatformRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesSetMinCpuPlatformRequest(); } @@ -118,11 +114,8 @@ public Builder setMinCpuPlatform(String minCpuPlatform) { return this; } - public InstancesSetMinCpuPlatformRequest build() { - return new InstancesSetMinCpuPlatformRequest( - minCpuPlatform - ); + return new InstancesSetMinCpuPlatformRequest(minCpuPlatform); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "InstancesSetMinCpuPlatformRequest{" - + "minCpuPlatform=" + minCpuPlatform - + "}"; + return "InstancesSetMinCpuPlatformRequest{" + "minCpuPlatform=" + minCpuPlatform + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof InstancesSetMinCpuPlatformRequest) { InstancesSetMinCpuPlatformRequest that = (InstancesSetMinCpuPlatformRequest) o; - return - Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()) - ; + return Objects.equals(this.minCpuPlatform, that.getMinCpuPlatform()); } return false; } @Override public int hashCode() { - return Objects.hash( - minCpuPlatform - ); + return Objects.hash(minCpuPlatform); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java index 77bf1c60183c..756984e0496c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private InstancesSetServiceAccountRequest() { this.scopes = null; } - - private InstancesSetServiceAccountRequest( - String email, - List scopes - ) { + private InstancesSetServiceAccountRequest(String email, List scopes) { this.email = email; this.scopes = scopes; } @@ -90,22 +85,24 @@ public List getScopesList() { return scopes; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesSetServiceAccountRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesSetServiceAccountRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesSetServiceAccountRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesSetServiceAccountRequest(); } @@ -158,13 +155,9 @@ public Builder addScopes(String scopes) { return this; } - public InstancesSetServiceAccountRequest build() { - return new InstancesSetServiceAccountRequest( - email, - scopes - ); + return new InstancesSetServiceAccountRequest(email, scopes); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "InstancesSetServiceAccountRequest{" - + "email=" + email + ", " - + "scopes=" + scopes + + "email=" + + email + + ", " + + "scopes=" + + scopes + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof InstancesSetServiceAccountRequest) { InstancesSetServiceAccountRequest that = (InstancesSetServiceAccountRequest) o; - return - Objects.equals(this.email, that.getEmail()) && - Objects.equals(this.scopes, that.getScopesList()) - ; + return Objects.equals(this.email, that.getEmail()) + && Objects.equals(this.scopes, that.getScopesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - email, - scopes - ); + return Objects.hash(email, scopes); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java index e2c4671b9b48..7622b603c226 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private InstancesStartWithEncryptionKeyRequest() { this.disks = null; } - - private InstancesStartWithEncryptionKeyRequest( - List disks - ) { + private InstancesStartWithEncryptionKeyRequest(List disks) { this.disks = disks; } @@ -76,22 +71,24 @@ public List getDisksList() { return disks; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InstancesStartWithEncryptionKeyRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InstancesStartWithEncryptionKeyRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InstancesStartWithEncryptionKeyRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InstancesStartWithEncryptionKeyRequest(); } @@ -130,11 +127,8 @@ public Builder addDisks(CustomerEncryptionKeyProtectedDisk disks) { return this; } - public InstancesStartWithEncryptionKeyRequest build() { - return new InstancesStartWithEncryptionKeyRequest( - disks - ); + return new InstancesStartWithEncryptionKeyRequest(disks); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "InstancesStartWithEncryptionKeyRequest{" - + "disks=" + disks - + "}"; + return "InstancesStartWithEncryptionKeyRequest{" + "disks=" + disks + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof InstancesStartWithEncryptionKeyRequest) { InstancesStartWithEncryptionKeyRequest that = (InstancesStartWithEncryptionKeyRequest) o; - return - Objects.equals(this.disks, that.getDisksList()) - ; + return Objects.equals(this.disks, that.getDisksList()); } return false; } @Override public int hashCode() { - return Objects.hash( - disks - ); + return Objects.hash(disks); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java index f73b4b7bbc0e..066e1fb0cea4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -78,7 +77,6 @@ private Interconnect() { this.selfLink = null; } - private Interconnect( Boolean adminEnabled, List circuitInfos, @@ -100,8 +98,7 @@ private Interconnect( String peerIpAddress, Integer provisionedLinkCount, Integer requestedLinkCount, - String selfLink - ) { + String selfLink) { this.adminEnabled = adminEnabled; this.circuitInfos = circuitInfos; this.creationTimestamp = creationTimestamp; @@ -139,7 +136,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("circuitInfos", stringList.build()); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("customerName") && customerName != null) { fieldMap.put("customerName", Collections.singletonList(String.valueOf(customerName))); @@ -158,7 +156,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("googleIpAddress", Collections.singletonList(String.valueOf(googleIpAddress))); } if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { - fieldMap.put("googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); + fieldMap.put( + "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); @@ -189,16 +188,19 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("nocContactEmail", Collections.singletonList(String.valueOf(nocContactEmail))); } if (fieldNames.contains("operationalStatus") && operationalStatus != null) { - fieldMap.put("operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); + fieldMap.put( + "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); } if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); } if (fieldNames.contains("provisionedLinkCount") && provisionedLinkCount != null) { - fieldMap.put("provisionedLinkCount", Collections.singletonList(String.valueOf(provisionedLinkCount))); + fieldMap.put( + "provisionedLinkCount", Collections.singletonList(String.valueOf(provisionedLinkCount))); } if (fieldNames.contains("requestedLinkCount") && requestedLinkCount != null) { - fieldMap.put("requestedLinkCount", Collections.singletonList(String.valueOf(requestedLinkCount))); + fieldMap.put( + "requestedLinkCount", Collections.singletonList(String.valueOf(requestedLinkCount))); } if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); @@ -364,22 +366,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Interconnect prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Interconnect getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Interconnect DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Interconnect(); } @@ -714,51 +718,30 @@ public Builder setSelfLink(String selfLink) { return this; } - public Interconnect build() { - - - - - - - - - - - - - - - - - - - return new Interconnect( - adminEnabled, - circuitInfos, - creationTimestamp, - customerName, - description, - expectedOutages, - googleIpAddress, - googleReferenceId, - id, - interconnectAttachments, - interconnectType, - kind, - linkType, - location, - name, - nocContactEmail, - operationalStatus, - peerIpAddress, - provisionedLinkCount, - requestedLinkCount, - selfLink - ); + adminEnabled, + circuitInfos, + creationTimestamp, + customerName, + description, + expectedOutages, + googleIpAddress, + googleReferenceId, + id, + interconnectAttachments, + interconnectType, + kind, + linkType, + location, + name, + nocContactEmail, + operationalStatus, + peerIpAddress, + provisionedLinkCount, + requestedLinkCount, + selfLink); } public Builder clone() { @@ -791,27 +774,68 @@ public Builder clone() { @Override public String toString() { return "Interconnect{" - + "adminEnabled=" + adminEnabled + ", " - + "circuitInfos=" + circuitInfos + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "customerName=" + customerName + ", " - + "description=" + description + ", " - + "expectedOutages=" + expectedOutages + ", " - + "googleIpAddress=" + googleIpAddress + ", " - + "googleReferenceId=" + googleReferenceId + ", " - + "id=" + id + ", " - + "interconnectAttachments=" + interconnectAttachments + ", " - + "interconnectType=" + interconnectType + ", " - + "kind=" + kind + ", " - + "linkType=" + linkType + ", " - + "location=" + location + ", " - + "name=" + name + ", " - + "nocContactEmail=" + nocContactEmail + ", " - + "operationalStatus=" + operationalStatus + ", " - + "peerIpAddress=" + peerIpAddress + ", " - + "provisionedLinkCount=" + provisionedLinkCount + ", " - + "requestedLinkCount=" + requestedLinkCount + ", " - + "selfLink=" + selfLink + + "adminEnabled=" + + adminEnabled + + ", " + + "circuitInfos=" + + circuitInfos + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "customerName=" + + customerName + + ", " + + "description=" + + description + + ", " + + "expectedOutages=" + + expectedOutages + + ", " + + "googleIpAddress=" + + googleIpAddress + + ", " + + "googleReferenceId=" + + googleReferenceId + + ", " + + "id=" + + id + + ", " + + "interconnectAttachments=" + + interconnectAttachments + + ", " + + "interconnectType=" + + interconnectType + + ", " + + "kind=" + + kind + + ", " + + "linkType=" + + linkType + + ", " + + "location=" + + location + + ", " + + "name=" + + name + + ", " + + "nocContactEmail=" + + nocContactEmail + + ", " + + "operationalStatus=" + + operationalStatus + + ", " + + "peerIpAddress=" + + peerIpAddress + + ", " + + "provisionedLinkCount=" + + provisionedLinkCount + + ", " + + "requestedLinkCount=" + + requestedLinkCount + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -822,29 +846,27 @@ public boolean equals(Object o) { } if (o instanceof Interconnect) { Interconnect that = (Interconnect) o; - return - Objects.equals(this.adminEnabled, that.getAdminEnabled()) && - Objects.equals(this.circuitInfos, that.getCircuitInfosList()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.customerName, that.getCustomerName()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.expectedOutages, that.getExpectedOutagesList()) && - Objects.equals(this.googleIpAddress, that.getGoogleIpAddress()) && - Objects.equals(this.googleReferenceId, that.getGoogleReferenceId()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.interconnectAttachments, that.getInterconnectAttachmentsList()) && - Objects.equals(this.interconnectType, that.getInterconnectType()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.linkType, that.getLinkType()) && - Objects.equals(this.location, that.getLocation()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.nocContactEmail, that.getNocContactEmail()) && - Objects.equals(this.operationalStatus, that.getOperationalStatus()) && - Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) && - Objects.equals(this.provisionedLinkCount, that.getProvisionedLinkCount()) && - Objects.equals(this.requestedLinkCount, that.getRequestedLinkCount()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.adminEnabled, that.getAdminEnabled()) + && Objects.equals(this.circuitInfos, that.getCircuitInfosList()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.customerName, that.getCustomerName()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.expectedOutages, that.getExpectedOutagesList()) + && Objects.equals(this.googleIpAddress, that.getGoogleIpAddress()) + && Objects.equals(this.googleReferenceId, that.getGoogleReferenceId()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.interconnectAttachments, that.getInterconnectAttachmentsList()) + && Objects.equals(this.interconnectType, that.getInterconnectType()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.linkType, that.getLinkType()) + && Objects.equals(this.location, that.getLocation()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.nocContactEmail, that.getNocContactEmail()) + && Objects.equals(this.operationalStatus, that.getOperationalStatus()) + && Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) + && Objects.equals(this.provisionedLinkCount, that.getProvisionedLinkCount()) + && Objects.equals(this.requestedLinkCount, that.getRequestedLinkCount()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @@ -852,27 +874,26 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - adminEnabled, - circuitInfos, - creationTimestamp, - customerName, - description, - expectedOutages, - googleIpAddress, - googleReferenceId, - id, - interconnectAttachments, - interconnectType, - kind, - linkType, - location, - name, - nocContactEmail, - operationalStatus, - peerIpAddress, - provisionedLinkCount, - requestedLinkCount, - selfLink - ); + adminEnabled, + circuitInfos, + creationTimestamp, + customerName, + description, + expectedOutages, + googleIpAddress, + googleReferenceId, + id, + interconnectAttachments, + interconnectType, + kind, + linkType, + location, + name, + nocContactEmail, + operationalStatus, + peerIpAddress, + provisionedLinkCount, + requestedLinkCount, + selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java index 1d0935883a8f..25ad248755c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -64,7 +61,6 @@ private InterconnectAttachment() { this.selfLink = null; } - private InterconnectAttachment( String cloudRouterIpAddress, String creationTimestamp, @@ -79,8 +75,7 @@ private InterconnectAttachment( InterconnectAttachmentPrivateInfo privateInterconnectInfo, String region, String router, - String selfLink - ) { + String selfLink) { this.cloudRouterIpAddress = cloudRouterIpAddress; this.creationTimestamp = creationTimestamp; this.customerRouterIpAddress = customerRouterIpAddress; @@ -101,19 +96,24 @@ private InterconnectAttachment( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("cloudRouterIpAddress") && cloudRouterIpAddress != null) { - fieldMap.put("cloudRouterIpAddress", Collections.singletonList(String.valueOf(cloudRouterIpAddress))); + fieldMap.put( + "cloudRouterIpAddress", Collections.singletonList(String.valueOf(cloudRouterIpAddress))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("customerRouterIpAddress") && customerRouterIpAddress != null) { - fieldMap.put("customerRouterIpAddress", Collections.singletonList(String.valueOf(customerRouterIpAddress))); + fieldMap.put( + "customerRouterIpAddress", + Collections.singletonList(String.valueOf(customerRouterIpAddress))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { - fieldMap.put("googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); + fieldMap.put( + "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); @@ -128,10 +128,13 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } if (fieldNames.contains("operationalStatus") && operationalStatus != null) { - fieldMap.put("operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); + fieldMap.put( + "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); } if (fieldNames.contains("privateInterconnectInfo") && privateInterconnectInfo != null) { - fieldMap.put("privateInterconnectInfo", Collections.singletonList(String.valueOf(privateInterconnectInfo))); + fieldMap.put( + "privateInterconnectInfo", + Collections.singletonList(String.valueOf(privateInterconnectInfo))); } if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); @@ -254,22 +257,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectAttachment prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectAttachment getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectAttachment DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectAttachment(); } @@ -450,7 +455,8 @@ public InterconnectAttachmentPrivateInfo getPrivateInterconnectInfo() { return privateInterconnectInfo; } - public Builder setPrivateInterconnectInfo(InterconnectAttachmentPrivateInfo privateInterconnectInfo) { + public Builder setPrivateInterconnectInfo( + InterconnectAttachmentPrivateInfo privateInterconnectInfo) { this.privateInterconnectInfo = privateInterconnectInfo; return this; } @@ -482,37 +488,23 @@ public Builder setSelfLink(String selfLink) { return this; } - public InterconnectAttachment build() { - - - - - - - - - - - - return new InterconnectAttachment( - cloudRouterIpAddress, - creationTimestamp, - customerRouterIpAddress, - description, - googleReferenceId, - id, - interconnect, - kind, - name, - operationalStatus, - privateInterconnectInfo, - region, - router, - selfLink - ); + cloudRouterIpAddress, + creationTimestamp, + customerRouterIpAddress, + description, + googleReferenceId, + id, + interconnect, + kind, + name, + operationalStatus, + privateInterconnectInfo, + region, + router, + selfLink); } public Builder clone() { @@ -538,20 +530,47 @@ public Builder clone() { @Override public String toString() { return "InterconnectAttachment{" - + "cloudRouterIpAddress=" + cloudRouterIpAddress + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "customerRouterIpAddress=" + customerRouterIpAddress + ", " - + "description=" + description + ", " - + "googleReferenceId=" + googleReferenceId + ", " - + "id=" + id + ", " - + "interconnect=" + interconnect + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "operationalStatus=" + operationalStatus + ", " - + "privateInterconnectInfo=" + privateInterconnectInfo + ", " - + "region=" + region + ", " - + "router=" + router + ", " - + "selfLink=" + selfLink + + "cloudRouterIpAddress=" + + cloudRouterIpAddress + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "customerRouterIpAddress=" + + customerRouterIpAddress + + ", " + + "description=" + + description + + ", " + + "googleReferenceId=" + + googleReferenceId + + ", " + + "id=" + + id + + ", " + + "interconnect=" + + interconnect + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "operationalStatus=" + + operationalStatus + + ", " + + "privateInterconnectInfo=" + + privateInterconnectInfo + + ", " + + "region=" + + region + + ", " + + "router=" + + router + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -562,22 +581,20 @@ public boolean equals(Object o) { } if (o instanceof InterconnectAttachment) { InterconnectAttachment that = (InterconnectAttachment) o; - return - Objects.equals(this.cloudRouterIpAddress, that.getCloudRouterIpAddress()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.customerRouterIpAddress, that.getCustomerRouterIpAddress()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.googleReferenceId, that.getGoogleReferenceId()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.interconnect, that.getInterconnect()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.operationalStatus, that.getOperationalStatus()) && - Objects.equals(this.privateInterconnectInfo, that.getPrivateInterconnectInfo()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.cloudRouterIpAddress, that.getCloudRouterIpAddress()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.customerRouterIpAddress, that.getCustomerRouterIpAddress()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.googleReferenceId, that.getGoogleReferenceId()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.interconnect, that.getInterconnect()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.operationalStatus, that.getOperationalStatus()) + && Objects.equals(this.privateInterconnectInfo, that.getPrivateInterconnectInfo()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @@ -585,20 +602,19 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - cloudRouterIpAddress, - creationTimestamp, - customerRouterIpAddress, - description, - googleReferenceId, - id, - interconnect, - kind, - name, - operationalStatus, - privateInterconnectInfo, - region, - router, - selfLink - ); + cloudRouterIpAddress, + creationTimestamp, + customerRouterIpAddress, + description, + googleReferenceId, + id, + interconnect, + kind, + name, + operationalStatus, + privateInterconnectInfo, + region, + router, + selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java index 5092f8fce112..ef8b07654665 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private InterconnectAttachmentAggregatedList() { this.warning = null; } - private InterconnectAttachmentAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectAttachmentAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectAttachmentAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectAttachmentAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectAttachmentAggregatedList(); } @@ -258,21 +255,10 @@ public Builder setWarning(Warning warning) { return this; } - public InterconnectAttachmentAggregatedList build() { - - - - return new InterconnectAttachmentAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +276,23 @@ public Builder clone() { @Override public String toString() { return "InterconnectAttachmentAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +303,18 @@ public boolean equals(Object o) { } if (o instanceof InterconnectAttachmentAggregatedList) { InterconnectAttachmentAggregatedList that = (InterconnectAttachmentAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java index 94871618b46f..b9307b67ed40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InterconnectAttachmentStub; import com.google.cloud.compute.v1.stub.InterconnectAttachmentStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,34 @@ * *

* - *

Note: close() needs to be called on the interconnectAttachmentClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the interconnectAttachmentClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of InterconnectAttachmentSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of InterconnectAttachmentSettings + * to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class InterconnectAttachmentClient implements BackgroundResource {
   private final InterconnectAttachmentSettings settings;
   private final InterconnectAttachmentStub stub;
 
-
-
-  /**
-   * Constructs an instance of InterconnectAttachmentClient with default settings.
-   */
+  /** Constructs an instance of InterconnectAttachmentClient with default settings. */
   public static final InterconnectAttachmentClient create() throws IOException {
     return create(InterconnectAttachmentSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InterconnectAttachmentClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InterconnectAttachmentClient, using the given settings. The channels
+   * are created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InterconnectAttachmentClient create(InterconnectAttachmentSettings settings) throws IOException {
+  public static final InterconnectAttachmentClient create(InterconnectAttachmentSettings settings)
+      throws IOException {
     return new InterconnectAttachmentClient(settings);
   }
 
   /**
-   * Constructs an instance of InterconnectAttachmentClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InterconnectAttachmentSettings}.
+   * Constructs an instance of InterconnectAttachmentClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use InterconnectAttachmentSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InterconnectAttachmentClient create(InterconnectAttachmentStub stub) {
@@ -144,11 +130,12 @@ public static final InterconnectAttachmentClient create(InterconnectAttachmentSt
   }
 
   /**
-   * Constructs an instance of InterconnectAttachmentClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InterconnectAttachmentClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
-  protected InterconnectAttachmentClient(InterconnectAttachmentSettings settings) throws IOException {
+  protected InterconnectAttachmentClient(InterconnectAttachmentSettings settings)
+      throws IOException {
     this.settings = settings;
     this.stub = ((InterconnectAttachmentStubSettings) settings.getStubSettings()).createStub();
   }
@@ -168,12 +155,12 @@ public InterconnectAttachmentStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of interconnect attachments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,11 +174,12 @@ public InterconnectAttachmentStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(ProjectName project) {
+  public final AggregatedListInterconnectAttachmentsPagedResponse
+      aggregatedListInterconnectAttachments(ProjectName project) {
     AggregatedListInterconnectAttachmentsHttpRequest request =
         AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListInterconnectAttachments(request);
   }
 
@@ -199,7 +187,8 @@ public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListIn
   /**
    * Retrieves an aggregated list of interconnect attachments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -213,11 +202,10 @@ public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListIn
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(String project) {
+  public final AggregatedListInterconnectAttachmentsPagedResponse
+      aggregatedListInterconnectAttachments(String project) {
     AggregatedListInterconnectAttachmentsHttpRequest request =
-        AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListInterconnectAttachmentsHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListInterconnectAttachments(request);
   }
 
@@ -225,7 +213,8 @@ public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListIn
   /**
    * Retrieves an aggregated list of interconnect attachments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +231,18 @@ public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListIn
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(AggregatedListInterconnectAttachmentsHttpRequest request) {
-    return aggregatedListInterconnectAttachmentsPagedCallable()
-        .call(request);
+  public final AggregatedListInterconnectAttachmentsPagedResponse
+      aggregatedListInterconnectAttachments(
+          AggregatedListInterconnectAttachmentsHttpRequest request) {
+    return aggregatedListInterconnectAttachmentsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of interconnect attachments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +258,10 @@ public final AggregatedListInterconnectAttachmentsPagedResponse aggregatedListIn
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable() { + public final UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, + AggregatedListInterconnectAttachmentsPagedResponse> + aggregatedListInterconnectAttachmentsPagedCallable() { return stub.aggregatedListInterconnectAttachmentsPagedCallable(); } @@ -275,7 +269,8 @@ public final UnaryCallableSample code: + * *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +293,9 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListInterconnectAttachmentsCallable() { + public final UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList> + aggregatedListInterconnectAttachmentsCallable() { return stub.aggregatedListInterconnectAttachmentsCallable(); } @@ -306,7 +303,8 @@ public final UnaryCallableSample code: + * *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -315,22 +313,28 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param interconnectAttachment Name of the interconnect attachment to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnectAttachment(String requestId, ProjectRegionInterconnectAttachmentName interconnectAttachment) { + public final Operation deleteInterconnectAttachment( + String requestId, ProjectRegionInterconnectAttachmentName interconnectAttachment) { DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnectAttachment(interconnectAttachment == null ? null : interconnectAttachment.toString()) - .build(); + .setRequestId(requestId) + .setInterconnectAttachment( + interconnectAttachment == null ? null : interconnectAttachment.toString()) + .build(); return deleteInterconnectAttachment(request); } @@ -338,7 +342,8 @@ public final Operation deleteInterconnectAttachment(String requestId, ProjectReg /** * Deletes the specified interconnect attachment. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -347,22 +352,27 @@ public final Operation deleteInterconnectAttachment(String requestId, ProjectReg
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param interconnectAttachment Name of the interconnect attachment to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnectAttachment(String requestId, String interconnectAttachment) { + public final Operation deleteInterconnectAttachment( + String requestId, String interconnectAttachment) { DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnectAttachment(interconnectAttachment) - .build(); + .setRequestId(requestId) + .setInterconnectAttachment(interconnectAttachment) + .build(); return deleteInterconnectAttachment(request); } @@ -370,7 +380,8 @@ public final Operation deleteInterconnectAttachment(String requestId, String int /** * Deletes the specified interconnect attachment. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -387,7 +398,8 @@ public final Operation deleteInterconnectAttachment(String requestId, String int
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInterconnectAttachment(DeleteInterconnectAttachmentHttpRequest request) {
+  public final Operation deleteInterconnectAttachment(
+      DeleteInterconnectAttachmentHttpRequest request) {
     return deleteInterconnectAttachmentCallable().call(request);
   }
 
@@ -395,7 +407,8 @@ public final Operation deleteInterconnectAttachment(DeleteInterconnectAttachment
   /**
    * Deletes the specified interconnect attachment.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -411,7 +424,8 @@ public final Operation deleteInterconnectAttachment(DeleteInterconnectAttachment
    * 
*/ @BetaApi - public final UnaryCallable deleteInterconnectAttachmentCallable() { + public final UnaryCallable + deleteInterconnectAttachmentCallable() { return stub.deleteInterconnectAttachmentCallable(); } @@ -419,7 +433,8 @@ public final UnaryCallable d /** * Returns the specified interconnect attachment. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
@@ -431,12 +446,14 @@ public final UnaryCallable d
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InterconnectAttachment getInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment) {
+  public final InterconnectAttachment getInterconnectAttachment(
+      ProjectRegionInterconnectAttachmentName interconnectAttachment) {
 
     GetInterconnectAttachmentHttpRequest request =
         GetInterconnectAttachmentHttpRequest.newBuilder()
-        .setInterconnectAttachment(interconnectAttachment == null ? null : interconnectAttachment.toString())
-        .build();
+            .setInterconnectAttachment(
+                interconnectAttachment == null ? null : interconnectAttachment.toString())
+            .build();
     return getInterconnectAttachment(request);
   }
 
@@ -444,7 +461,8 @@ public final InterconnectAttachment getInterconnectAttachment(ProjectRegionInter
   /**
    * Returns the specified interconnect attachment.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
@@ -460,8 +478,8 @@ public final InterconnectAttachment getInterconnectAttachment(String interconnec
 
     GetInterconnectAttachmentHttpRequest request =
         GetInterconnectAttachmentHttpRequest.newBuilder()
-        .setInterconnectAttachment(interconnectAttachment)
-        .build();
+            .setInterconnectAttachment(interconnectAttachment)
+            .build();
     return getInterconnectAttachment(request);
   }
 
@@ -469,7 +487,8 @@ public final InterconnectAttachment getInterconnectAttachment(String interconnec
   /**
    * Returns the specified interconnect attachment.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
@@ -484,7 +503,8 @@ public final InterconnectAttachment getInterconnectAttachment(String interconnec
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InterconnectAttachment getInterconnectAttachment(GetInterconnectAttachmentHttpRequest request) {
+  public final InterconnectAttachment getInterconnectAttachment(
+      GetInterconnectAttachmentHttpRequest request) {
     return getInterconnectAttachmentCallable().call(request);
   }
 
@@ -492,7 +512,8 @@ public final InterconnectAttachment getInterconnectAttachment(GetInterconnectAtt
   /**
    * Returns the specified interconnect attachment.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
@@ -506,15 +527,18 @@ public final InterconnectAttachment getInterconnectAttachment(GetInterconnectAtt
    * 
*/ @BetaApi - public final UnaryCallable getInterconnectAttachmentCallable() { + public final UnaryCallable + getInterconnectAttachmentCallable() { return stub.getInterconnectAttachmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates an InterconnectAttachment in the specified project using the data included in the request. + * Creates an InterconnectAttachment in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -524,32 +548,43 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) + * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) + * resource. For more information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInterconnectAttachment(String requestId, ProjectRegionName region, InterconnectAttachment interconnectAttachmentResource) { + public final Operation insertInterconnectAttachment( + String requestId, + ProjectRegionName region, + InterconnectAttachment interconnectAttachmentResource) { InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setInterconnectAttachmentResource(interconnectAttachmentResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setInterconnectAttachmentResource(interconnectAttachmentResource) + .build(); return insertInterconnectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates an InterconnectAttachment in the specified project using the data included in the request. + * Creates an InterconnectAttachment in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -559,32 +594,41 @@ public final Operation insertInterconnectAttachment(String requestId, ProjectReg
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) + * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) + * resource. For more information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInterconnectAttachment(String requestId, String region, InterconnectAttachment interconnectAttachmentResource) { + public final Operation insertInterconnectAttachment( + String requestId, String region, InterconnectAttachment interconnectAttachmentResource) { InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setInterconnectAttachmentResource(interconnectAttachmentResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setInterconnectAttachmentResource(interconnectAttachmentResource) + .build(); return insertInterconnectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates an InterconnectAttachment in the specified project using the data included in the request. + * Creates an InterconnectAttachment in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -603,15 +647,18 @@ public final Operation insertInterconnectAttachment(String requestId, String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertInterconnectAttachment(InsertInterconnectAttachmentHttpRequest request) {
+  public final Operation insertInterconnectAttachment(
+      InsertInterconnectAttachmentHttpRequest request) {
     return insertInterconnectAttachmentCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates an InterconnectAttachment in the specified project using the data included in the request.
+   * Creates an InterconnectAttachment in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   String requestId = "";
@@ -629,7 +676,8 @@ public final Operation insertInterconnectAttachment(InsertInterconnectAttachment
    * 
*/ @BetaApi - public final UnaryCallable insertInterconnectAttachmentCallable() { + public final UnaryCallable + insertInterconnectAttachmentCallable() { return stub.insertInterconnectAttachmentCallable(); } @@ -637,7 +685,8 @@ public final UnaryCallable i /** * Retrieves the list of interconnect attachments contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -651,11 +700,12 @@ public final UnaryCallable i
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(ProjectRegionName region) {
+  public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(
+      ProjectRegionName region) {
     ListInterconnectAttachmentsHttpRequest request =
         ListInterconnectAttachmentsHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listInterconnectAttachments(request);
   }
 
@@ -663,7 +713,8 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
   /**
    * Retrieves the list of interconnect attachments contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -679,9 +730,7 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
   @BetaApi
   public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(String region) {
     ListInterconnectAttachmentsHttpRequest request =
-        ListInterconnectAttachmentsHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListInterconnectAttachmentsHttpRequest.newBuilder().setRegion(region).build();
     return listInterconnectAttachments(request);
   }
 
@@ -689,7 +738,8 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
   /**
    * Retrieves the list of interconnect attachments contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -706,16 +756,17 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(ListInterconnectAttachmentsHttpRequest request) {
-    return listInterconnectAttachmentsPagedCallable()
-        .call(request);
+  public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(
+      ListInterconnectAttachmentsHttpRequest request) {
+    return listInterconnectAttachmentsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of interconnect attachments contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -731,7 +782,9 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
    * 
*/ @BetaApi - public final UnaryCallable listInterconnectAttachmentsPagedCallable() { + public final UnaryCallable< + ListInterconnectAttachmentsHttpRequest, ListInterconnectAttachmentsPagedResponse> + listInterconnectAttachmentsPagedCallable() { return stub.listInterconnectAttachmentsPagedCallable(); } @@ -739,7 +792,8 @@ public final UnaryCallableSample code: + * *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -762,12 +816,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInterconnectAttachmentsCallable() { + public final UnaryCallable + listInterconnectAttachmentsCallable() { return stub.listInterconnectAttachmentsCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -796,43 +851,50 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListInterconnectAttachmentsPagedResponse extends AbstractPagedListResponse< - AggregatedListInterconnectAttachmentsHttpRequest, - InterconnectAttachmentAggregatedList, - InterconnectAttachmentsScopedList, - AggregatedListInterconnectAttachmentsPage, - AggregatedListInterconnectAttachmentsFixedSizeCollection> { + public static class AggregatedListInterconnectAttachmentsPagedResponse + extends AbstractPagedListResponse< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList, + InterconnectAttachmentsScopedList, AggregatedListInterconnectAttachmentsPage, + AggregatedListInterconnectAttachmentsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, InterconnectAttachmentsScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListInterconnectAttachmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListInterconnectAttachmentsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListInterconnectAttachmentsPage, + AggregatedListInterconnectAttachmentsPagedResponse>() { @Override - public AggregatedListInterconnectAttachmentsPagedResponse apply(AggregatedListInterconnectAttachmentsPage input) { + public AggregatedListInterconnectAttachmentsPagedResponse apply( + AggregatedListInterconnectAttachmentsPage input) { return new AggregatedListInterconnectAttachmentsPagedResponse(input); } }); } - private AggregatedListInterconnectAttachmentsPagedResponse(AggregatedListInterconnectAttachmentsPage page) { + private AggregatedListInterconnectAttachmentsPagedResponse( + AggregatedListInterconnectAttachmentsPage page) { super(page, AggregatedListInterconnectAttachmentsFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListInterconnectAttachmentsPage extends AbstractPage< - AggregatedListInterconnectAttachmentsHttpRequest, - InterconnectAttachmentAggregatedList, - InterconnectAttachmentsScopedList, - AggregatedListInterconnectAttachmentsPage> { + public static class AggregatedListInterconnectAttachmentsPage + extends AbstractPage< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList, + InterconnectAttachmentsScopedList, AggregatedListInterconnectAttachmentsPage> { private AggregatedListInterconnectAttachmentsPage( - PageContext context, + PageContext< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, InterconnectAttachmentsScopedList> + context, InterconnectAttachmentAggregatedList response) { super(context, response); } @@ -843,35 +905,38 @@ private static AggregatedListInterconnectAttachmentsPage createEmptyPage() { @Override protected AggregatedListInterconnectAttachmentsPage createPage( - PageContext context, + PageContext< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, InterconnectAttachmentsScopedList> + context, InterconnectAttachmentAggregatedList response) { return new AggregatedListInterconnectAttachmentsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListInterconnectAttachmentsHttpRequest, + InterconnectAttachmentAggregatedList, InterconnectAttachmentsScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListInterconnectAttachmentsFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListInterconnectAttachmentsHttpRequest, - InterconnectAttachmentAggregatedList, - InterconnectAttachmentsScopedList, - AggregatedListInterconnectAttachmentsPage, - AggregatedListInterconnectAttachmentsFixedSizeCollection> { + public static class AggregatedListInterconnectAttachmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList, + InterconnectAttachmentsScopedList, AggregatedListInterconnectAttachmentsPage, + AggregatedListInterconnectAttachmentsFixedSizeCollection> { - private AggregatedListInterconnectAttachmentsFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListInterconnectAttachmentsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } - private static AggregatedListInterconnectAttachmentsFixedSizeCollection createEmptyCollection() { + private static AggregatedListInterconnectAttachmentsFixedSizeCollection + createEmptyCollection() { return new AggregatedListInterconnectAttachmentsFixedSizeCollection(null, 0); } @@ -880,26 +945,30 @@ protected AggregatedListInterconnectAttachmentsFixedSizeCollection createCollect List pages, int collectionSize) { return new AggregatedListInterconnectAttachmentsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInterconnectAttachmentsPagedResponse extends AbstractPagedListResponse< - ListInterconnectAttachmentsHttpRequest, - InterconnectAttachmentList, - InterconnectAttachment, - ListInterconnectAttachmentsPage, - ListInterconnectAttachmentsFixedSizeCollection> { + + public static class ListInterconnectAttachmentsPagedResponse + extends AbstractPagedListResponse< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment, ListInterconnectAttachmentsPage, + ListInterconnectAttachmentsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment> + context, ApiFuture futureResponse) { ApiFuture futurePage = - ListInterconnectAttachmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + ListInterconnectAttachmentsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + ListInterconnectAttachmentsPage, ListInterconnectAttachmentsPagedResponse>() { @Override - public ListInterconnectAttachmentsPagedResponse apply(ListInterconnectAttachmentsPage input) { + public ListInterconnectAttachmentsPagedResponse apply( + ListInterconnectAttachmentsPage input) { return new ListInterconnectAttachmentsPagedResponse(input); } }); @@ -908,18 +977,18 @@ public ListInterconnectAttachmentsPagedResponse apply(ListInterconnectAttachment private ListInterconnectAttachmentsPagedResponse(ListInterconnectAttachmentsPage page) { super(page, ListInterconnectAttachmentsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInterconnectAttachmentsPage extends AbstractPage< - ListInterconnectAttachmentsHttpRequest, - InterconnectAttachmentList, - InterconnectAttachment, - ListInterconnectAttachmentsPage> { + public static class ListInterconnectAttachmentsPage + extends AbstractPage< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment, ListInterconnectAttachmentsPage> { private ListInterconnectAttachmentsPage( - PageContext context, + PageContext< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment> + context, InterconnectAttachmentList response) { super(context, response); } @@ -930,31 +999,33 @@ private static ListInterconnectAttachmentsPage createEmptyPage() { @Override protected ListInterconnectAttachmentsPage createPage( - PageContext context, + PageContext< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment> + context, InterconnectAttachmentList response) { return new ListInterconnectAttachmentsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInterconnectAttachmentsFixedSizeCollection extends AbstractFixedSizeCollection< - ListInterconnectAttachmentsHttpRequest, - InterconnectAttachmentList, - InterconnectAttachment, - ListInterconnectAttachmentsPage, - ListInterconnectAttachmentsFixedSizeCollection> { + public static class ListInterconnectAttachmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + InterconnectAttachment, ListInterconnectAttachmentsPage, + ListInterconnectAttachmentsFixedSizeCollection> { - private ListInterconnectAttachmentsFixedSizeCollection(List pages, int collectionSize) { + private ListInterconnectAttachmentsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -967,7 +1038,5 @@ protected ListInterconnectAttachmentsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInterconnectAttachmentsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java index 1103e1b6c6b1..886515f693f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InterconnectAttachmentList() { this.warning = null; } - private InterconnectAttachmentList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectAttachmentList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectAttachmentList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectAttachmentList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectAttachmentList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InterconnectAttachmentList build() { - - - - - return new InterconnectAttachmentList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InterconnectAttachmentList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InterconnectAttachmentList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InterconnectAttachmentList) { InterconnectAttachmentList that = (InterconnectAttachmentList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java deleted file mode 100644 index 151a168624cb..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class InterconnectAttachmentName implements com.google.api.resourcenames.ResourceName { - private final String interconnectAttachment; - private final String project; - private final String region; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private InterconnectAttachmentName(Builder builder) { - interconnectAttachment = Preconditions.checkNotNull(builder.getInterconnectAttachment()); - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - } - - public static InterconnectAttachmentName of( - String interconnectAttachment, - String project, - String region - ) { - return newBuilder() - .setInterconnectAttachment(interconnectAttachment) - .setProject(project) - .setRegion(region) - .build(); - } - - public static String format( - String interconnectAttachment, - String project, - String region - ) { - return of( - interconnectAttachment, - project, - region - ) - .toString(); - } - - public String getInterconnectAttachment() { - return interconnectAttachment; - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("interconnectAttachment", interconnectAttachment); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InterconnectAttachmentName parse(String formattedString) {return InterconnectAttachmentName.parse(formattedString);} - }; - } - - public static InterconnectAttachmentName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InterconnectAttachmentName.parse: formattedString not in valid format"); - return of( - matchMap.get("interconnectAttachment"), - matchMap.get("project"), - matchMap.get("region") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String interconnectAttachment; - private String project; - private String region; - - public String getInterconnectAttachment() { - return interconnectAttachment; - } - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - - public Builder setInterconnectAttachment(String interconnectAttachment) { - this.interconnectAttachment = interconnectAttachment; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - - private Builder() {} - - public Builder (InterconnectAttachmentName interconnectAttachmentName) { - interconnectAttachment = interconnectAttachmentName.interconnectAttachment; - project = interconnectAttachmentName.project; - region = interconnectAttachmentName.region; - } - - public InterconnectAttachmentName build() { - return new InterconnectAttachmentName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "interconnectAttachment", interconnectAttachment, - "project", project, - "region", region - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof InterconnectAttachmentName) { - InterconnectAttachmentName that = (InterconnectAttachmentName) o; - return - Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - interconnectAttachment, - project, - region - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java index bce867527052..ee63f13390c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private InterconnectAttachmentPrivateInfo() { this.tag8021q = null; } - - private InterconnectAttachmentPrivateInfo( - Integer tag8021q - ) { + private InterconnectAttachmentPrivateInfo(Integer tag8021q) { this.tag8021q = tag8021q; } @@ -72,22 +66,24 @@ public Integer getTag8021q() { return tag8021q; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectAttachmentPrivateInfo prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectAttachmentPrivateInfo getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectAttachmentPrivateInfo DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectAttachmentPrivateInfo(); } @@ -118,11 +114,8 @@ public Builder setTag8021q(Integer tag8021q) { return this; } - public InterconnectAttachmentPrivateInfo build() { - return new InterconnectAttachmentPrivateInfo( - tag8021q - ); + return new InterconnectAttachmentPrivateInfo(tag8021q); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "InterconnectAttachmentPrivateInfo{" - + "tag8021q=" + tag8021q - + "}"; + return "InterconnectAttachmentPrivateInfo{" + "tag8021q=" + tag8021q + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof InterconnectAttachmentPrivateInfo) { InterconnectAttachmentPrivateInfo that = (InterconnectAttachmentPrivateInfo) o; - return - Objects.equals(this.tag8021q, that.getTag8021q()) - ; + return Objects.equals(this.tag8021q, that.getTag8021q()); } return false; } @Override public int hashCode() { - return Objects.hash( - tag8021q - ); + return Objects.hash(tag8021q); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java index 278c04f6e295..b9ceb362f0d1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; import com.google.cloud.compute.v1.stub.InterconnectAttachmentStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteInterconnectAttachment to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteInterconnectAttachment to 30 seconds: * *

  * 
@@ -89,81 +67,76 @@ public class InterconnectAttachmentSettings extends ClientSettings aggregatedListInterconnectAttachmentsSettings() {
-    return ((InterconnectAttachmentStubSettings) getStubSettings()).aggregatedListInterconnectAttachmentsSettings();
+  public PagedCallSettings<
+          AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList,
+          AggregatedListInterconnectAttachmentsPagedResponse>
+      aggregatedListInterconnectAttachmentsSettings() {
+    return ((InterconnectAttachmentStubSettings) getStubSettings())
+        .aggregatedListInterconnectAttachmentsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInterconnectAttachment.
-   */
-  public UnaryCallSettings deleteInterconnectAttachmentSettings() {
-    return ((InterconnectAttachmentStubSettings) getStubSettings()).deleteInterconnectAttachmentSettings();
+  /** Returns the object with the settings used for calls to deleteInterconnectAttachment. */
+  public UnaryCallSettings
+      deleteInterconnectAttachmentSettings() {
+    return ((InterconnectAttachmentStubSettings) getStubSettings())
+        .deleteInterconnectAttachmentSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInterconnectAttachment.
-   */
-  public UnaryCallSettings getInterconnectAttachmentSettings() {
-    return ((InterconnectAttachmentStubSettings) getStubSettings()).getInterconnectAttachmentSettings();
+  /** Returns the object with the settings used for calls to getInterconnectAttachment. */
+  public UnaryCallSettings
+      getInterconnectAttachmentSettings() {
+    return ((InterconnectAttachmentStubSettings) getStubSettings())
+        .getInterconnectAttachmentSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInterconnectAttachment.
-   */
-  public UnaryCallSettings insertInterconnectAttachmentSettings() {
-    return ((InterconnectAttachmentStubSettings) getStubSettings()).insertInterconnectAttachmentSettings();
+  /** Returns the object with the settings used for calls to insertInterconnectAttachment. */
+  public UnaryCallSettings
+      insertInterconnectAttachmentSettings() {
+    return ((InterconnectAttachmentStubSettings) getStubSettings())
+        .insertInterconnectAttachmentSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInterconnectAttachments.
-   */
-  public PagedCallSettings listInterconnectAttachmentsSettings() {
-    return ((InterconnectAttachmentStubSettings) getStubSettings()).listInterconnectAttachmentsSettings();
+  /** Returns the object with the settings used for calls to listInterconnectAttachments. */
+  public PagedCallSettings<
+          ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+          ListInterconnectAttachmentsPagedResponse>
+      listInterconnectAttachmentsSettings() {
+    return ((InterconnectAttachmentStubSettings) getStubSettings())
+        .listInterconnectAttachmentsSettings();
   }
 
-
-  public static final InterconnectAttachmentSettings create(InterconnectAttachmentStubSettings stub) throws IOException {
+  public static final InterconnectAttachmentSettings create(InterconnectAttachmentStubSettings stub)
+      throws IOException {
     return new InterconnectAttachmentSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InterconnectAttachmentStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InterconnectAttachmentStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InterconnectAttachmentStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InterconnectAttachmentStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InterconnectAttachmentStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InterconnectAttachmentStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InterconnectAttachmentStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -176,23 +149,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InterconnectAttachmentStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -201,10 +168,9 @@ protected InterconnectAttachmentSettings(Builder settingsBuilder) throws IOExcep
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InterconnectAttachmentSettings.
-   */
-  public static class Builder extends ClientSettings.Builder {
+  /** Builder for InterconnectAttachmentSettings. */
+  public static class Builder
+      extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
     }
@@ -225,53 +191,56 @@ protected Builder(InterconnectAttachmentStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InterconnectAttachmentStubSettings.Builder getStubSettingsBuilder() {
       return ((InterconnectAttachmentStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } /** * Returns the builder for the settings used for calls to aggregatedListInterconnectAttachments. */ - public PagedCallSettings.Builder aggregatedListInterconnectAttachmentsSettings() { + public PagedCallSettings.Builder< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList, + AggregatedListInterconnectAttachmentsPagedResponse> + aggregatedListInterconnectAttachmentsSettings() { return getStubSettingsBuilder().aggregatedListInterconnectAttachmentsSettings(); } - /** - * Returns the builder for the settings used for calls to deleteInterconnectAttachment. - */ - public UnaryCallSettings.Builder deleteInterconnectAttachmentSettings() { + /** Returns the builder for the settings used for calls to deleteInterconnectAttachment. */ + public UnaryCallSettings.Builder + deleteInterconnectAttachmentSettings() { return getStubSettingsBuilder().deleteInterconnectAttachmentSettings(); } - /** - * Returns the builder for the settings used for calls to getInterconnectAttachment. - */ - public UnaryCallSettings.Builder getInterconnectAttachmentSettings() { + /** Returns the builder for the settings used for calls to getInterconnectAttachment. */ + public UnaryCallSettings.Builder + getInterconnectAttachmentSettings() { return getStubSettingsBuilder().getInterconnectAttachmentSettings(); } - /** - * Returns the builder for the settings used for calls to insertInterconnectAttachment. - */ - public UnaryCallSettings.Builder insertInterconnectAttachmentSettings() { + /** Returns the builder for the settings used for calls to insertInterconnectAttachment. */ + public UnaryCallSettings.Builder + insertInterconnectAttachmentSettings() { return getStubSettingsBuilder().insertInterconnectAttachmentSettings(); } - /** - * Returns the builder for the settings used for calls to listInterconnectAttachments. - */ - public PagedCallSettings.Builder listInterconnectAttachmentsSettings() { + /** Returns the builder for the settings used for calls to listInterconnectAttachments. */ + public PagedCallSettings.Builder< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + ListInterconnectAttachmentsPagedResponse> + listInterconnectAttachmentsSettings() { return getStubSettingsBuilder().listInterconnectAttachmentsSettings(); } @@ -280,4 +249,4 @@ public InterconnectAttachmentSettings build() throws IOException { return new InterconnectAttachmentSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java index f6395deb86cb..82d0e16c6d6f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,8 @@ private InterconnectAttachmentsScopedList() { this.warning = null; } - private InterconnectAttachmentsScopedList( - List interconnectAttachments, - Warning warning - ) { + List interconnectAttachments, Warning warning) { this.interconnectAttachments = interconnectAttachments; this.warning = warning; } @@ -90,22 +86,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectAttachmentsScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectAttachmentsScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectAttachmentsScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectAttachmentsScopedList(); } @@ -136,7 +134,8 @@ public List getInterconnectAttachmentsList() { return interconnectAttachments; } - public Builder addAllInterconnectAttachments(List interconnectAttachments) { + public Builder addAllInterconnectAttachments( + List interconnectAttachments) { if (this.interconnectAttachments == null) { this.interconnectAttachments = new ArrayList<>(interconnectAttachments.size()); } @@ -158,13 +157,9 @@ public Builder setWarning(Warning warning) { return this; } - public InterconnectAttachmentsScopedList build() { - return new InterconnectAttachmentsScopedList( - interconnectAttachments, - warning - ); + return new InterconnectAttachmentsScopedList(interconnectAttachments, warning); } public Builder clone() { @@ -178,8 +173,11 @@ public Builder clone() { @Override public String toString() { return "InterconnectAttachmentsScopedList{" - + "interconnectAttachments=" + interconnectAttachments + ", " - + "warning=" + warning + + "interconnectAttachments=" + + interconnectAttachments + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +188,14 @@ public boolean equals(Object o) { } if (o instanceof InterconnectAttachmentsScopedList) { InterconnectAttachmentsScopedList that = (InterconnectAttachmentsScopedList) o; - return - Objects.equals(this.interconnectAttachments, that.getInterconnectAttachmentsList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.interconnectAttachments, that.getInterconnectAttachmentsList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - interconnectAttachments, - warning - ); + return Objects.hash(interconnectAttachments, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java index 54fb17161bb6..5d48c4f7d3d2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,8 @@ private InterconnectCircuitInfo() { this.googleDemarcId = null; } - private InterconnectCircuitInfo( - String customerDemarcId, - String googleCircuitId, - String googleDemarcId - ) { + String customerDemarcId, String googleCircuitId, String googleDemarcId) { this.customerDemarcId = customerDemarcId; this.googleCircuitId = googleCircuitId; this.googleDemarcId = googleDemarcId; @@ -100,22 +93,24 @@ public String getGoogleDemarcId() { return googleDemarcId; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectCircuitInfo prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectCircuitInfo getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectCircuitInfo DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectCircuitInfo(); } @@ -174,15 +169,9 @@ public Builder setGoogleDemarcId(String googleDemarcId) { return this; } - public InterconnectCircuitInfo build() { - - return new InterconnectCircuitInfo( - customerDemarcId, - googleCircuitId, - googleDemarcId - ); + return new InterconnectCircuitInfo(customerDemarcId, googleCircuitId, googleDemarcId); } public Builder clone() { @@ -197,9 +186,14 @@ public Builder clone() { @Override public String toString() { return "InterconnectCircuitInfo{" - + "customerDemarcId=" + customerDemarcId + ", " - + "googleCircuitId=" + googleCircuitId + ", " - + "googleDemarcId=" + googleDemarcId + + "customerDemarcId=" + + customerDemarcId + + ", " + + "googleCircuitId=" + + googleCircuitId + + ", " + + "googleDemarcId=" + + googleDemarcId + "}"; } @@ -210,21 +204,15 @@ public boolean equals(Object o) { } if (o instanceof InterconnectCircuitInfo) { InterconnectCircuitInfo that = (InterconnectCircuitInfo) o; - return - Objects.equals(this.customerDemarcId, that.getCustomerDemarcId()) && - Objects.equals(this.googleCircuitId, that.getGoogleCircuitId()) && - Objects.equals(this.googleDemarcId, that.getGoogleDemarcId()) - ; + return Objects.equals(this.customerDemarcId, that.getCustomerDemarcId()) + && Objects.equals(this.googleCircuitId, that.getGoogleCircuitId()) + && Objects.equals(this.googleDemarcId, that.getGoogleDemarcId()); } return false; } @Override public int hashCode() { - return Objects.hash( - customerDemarcId, - googleCircuitId, - googleDemarcId - ); + return Objects.hash(customerDemarcId, googleCircuitId, googleDemarcId); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java index 06e8012bbc96..9cae049b25d9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.InterconnectStub; import com.google.cloud.compute.v1.stub.InterconnectStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,39 @@ * * try (InterconnectClient interconnectClient = InterconnectClient.create()) { * String requestId = ""; - * ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + * ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); * Operation response = interconnectClient.deleteInterconnect(requestId, interconnect); * } * *

* *

Note: close() needs to be called on the interconnectClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of InterconnectSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,22 @@ public class InterconnectClient implements BackgroundResource {
   private final InterconnectSettings settings;
   private final InterconnectStub stub;
 
-
-
-  /**
-   * Constructs an instance of InterconnectClient with default settings.
-   */
+  /** Constructs an instance of InterconnectClient with default settings. */
   public static final InterconnectClient create() throws IOException {
     return create(InterconnectSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InterconnectClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InterconnectClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final InterconnectClient create(InterconnectSettings settings) throws IOException {
     return new InterconnectClient(settings);
   }
 
   /**
-   * Constructs an instance of InterconnectClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InterconnectSettings}.
+   * Constructs an instance of InterconnectClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use InterconnectSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InterconnectClient create(InterconnectStub stub) {
@@ -144,9 +128,9 @@ public static final InterconnectClient create(InterconnectStub stub) {
   }
 
   /**
-   * Constructs an instance of InterconnectClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InterconnectClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected InterconnectClient(InterconnectSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +152,41 @@ public InterconnectStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified interconnect.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnect(String requestId, ProjectInterconnectName interconnect) { + public final Operation deleteInterconnect( + String requestId, ProjectGlobalInterconnectName interconnect) { DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnect(interconnect == null ? null : interconnect.toString()) - .build(); + .setRequestId(requestId) + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .build(); return deleteInterconnect(request); } @@ -205,20 +194,25 @@ public final Operation deleteInterconnect(String requestId, ProjectInterconnectN /** * Deletes the specified interconnect. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +221,9 @@ public final Operation deleteInterconnect(String requestId, String interconnect) DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnect(interconnect) - .build(); + .setRequestId(requestId) + .setInterconnect(interconnect) + .build(); return deleteInterconnect(request); } @@ -237,11 +231,12 @@ public final Operation deleteInterconnect(String requestId, String interconnect) /** * Deletes the specified interconnect. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
@@ -262,11 +257,12 @@ public final Operation deleteInterconnect(DeleteInterconnectHttpRequest request)
   /**
    * Deletes the specified interconnect.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
@@ -278,18 +274,21 @@ public final Operation deleteInterconnect(DeleteInterconnectHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable deleteInterconnectCallable() { + public final UnaryCallable + deleteInterconnectCallable() { return stub.deleteInterconnectCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * Returns the specified interconnect. Get a list of available interconnects by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect response = interconnectClient.getInterconnect(interconnect);
    * }
    * 
@@ -298,23 +297,25 @@ public final UnaryCallable deleteInter * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Interconnect getInterconnect(ProjectInterconnectName interconnect) { + public final Interconnect getInterconnect(ProjectGlobalInterconnectName interconnect) { GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder() - .setInterconnect(interconnect == null ? null : interconnect.toString()) - .build(); + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .build(); return getInterconnect(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * Returns the specified interconnect. Get a list of available interconnects by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect response = interconnectClient.getInterconnect(interconnect.toString());
    * }
    * 
@@ -326,20 +327,20 @@ public final Interconnect getInterconnect(ProjectInterconnectName interconnect) public final Interconnect getInterconnect(String interconnect) { GetInterconnectHttpRequest request = - GetInterconnectHttpRequest.newBuilder() - .setInterconnect(interconnect) - .build(); + GetInterconnectHttpRequest.newBuilder().setInterconnect(interconnect).build(); return getInterconnect(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * Returns the specified interconnect. Get a list of available interconnects by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder()
    *     .setInterconnect(interconnect.toString())
    *     .build();
@@ -357,12 +358,14 @@ public final Interconnect getInterconnect(GetInterconnectHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified interconnect. Get a list of available interconnects by making a list() request.
+   * Returns the specified interconnect. Get a list of available interconnects by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   GetInterconnectHttpRequest request = GetInterconnectHttpRequest.newBuilder()
    *     .setInterconnect(interconnect.toString())
    *     .build();
@@ -381,7 +384,8 @@ public final UnaryCallable getIntercon
   /**
    * Creates a Interconnect in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
@@ -391,24 +395,32 @@ public final UnaryCallable getIntercon
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is + * a dedicated connection between Google's network and your on-premises network. For more + * information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== + * resource_for beta.interconnects ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInterconnect(String requestId, ProjectName project, Interconnect interconnectResource) { + public final Operation insertInterconnect( + String requestId, ProjectName project, Interconnect interconnectResource) { InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setInterconnectResource(interconnectResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setInterconnectResource(interconnectResource) + .build(); return insertInterconnect(request); } @@ -416,7 +428,8 @@ public final Operation insertInterconnect(String requestId, ProjectName project, /** * Creates a Interconnect in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
@@ -426,24 +439,32 @@ public final Operation insertInterconnect(String requestId, ProjectName project,
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is + * a dedicated connection between Google's network and your on-premises network. For more + * information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== + * resource_for beta.interconnects ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInterconnect(String requestId, String project, Interconnect interconnectResource) { + public final Operation insertInterconnect( + String requestId, String project, Interconnect interconnectResource) { InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setInterconnectResource(interconnectResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setInterconnectResource(interconnectResource) + .build(); return insertInterconnect(request); } @@ -451,7 +472,8 @@ public final Operation insertInterconnect(String requestId, String project, Inte /** * Creates a Interconnect in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
@@ -478,7 +500,8 @@ public final Operation insertInterconnect(InsertInterconnectHttpRequest request)
   /**
    * Creates a Interconnect in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
@@ -496,7 +519,8 @@ public final Operation insertInterconnect(InsertInterconnectHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable insertInterconnectCallable() { + public final UnaryCallable + insertInterconnectCallable() { return stub.insertInterconnectCallable(); } @@ -504,7 +528,8 @@ public final UnaryCallable insertInter /** * Retrieves the list of interconnect available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +546,8 @@ public final UnaryCallable insertInter
   public final ListInterconnectsPagedResponse listInterconnects(ProjectName project) {
     ListInterconnectsHttpRequest request =
         ListInterconnectsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listInterconnects(request);
   }
 
@@ -530,7 +555,8 @@ public final ListInterconnectsPagedResponse listInterconnects(ProjectName projec
   /**
    * Retrieves the list of interconnect available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +572,7 @@ public final ListInterconnectsPagedResponse listInterconnects(ProjectName projec
   @BetaApi
   public final ListInterconnectsPagedResponse listInterconnects(String project) {
     ListInterconnectsHttpRequest request =
-        ListInterconnectsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListInterconnectsHttpRequest.newBuilder().setProject(project).build();
     return listInterconnects(request);
   }
 
@@ -556,7 +580,8 @@ public final ListInterconnectsPagedResponse listInterconnects(String project) {
   /**
    * Retrieves the list of interconnect available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +598,17 @@ public final ListInterconnectsPagedResponse listInterconnects(String project) {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInterconnectsPagedResponse listInterconnects(ListInterconnectsHttpRequest request) {
-    return listInterconnectsPagedCallable()
-        .call(request);
+  public final ListInterconnectsPagedResponse listInterconnects(
+      ListInterconnectsHttpRequest request) {
+    return listInterconnectsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of interconnect available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +624,8 @@ public final ListInterconnectsPagedResponse listInterconnects(ListInterconnectsH
    * 
*/ @BetaApi - public final UnaryCallable listInterconnectsPagedCallable() { + public final UnaryCallable + listInterconnectsPagedCallable() { return stub.listInterconnectsPagedCallable(); } @@ -606,7 +633,8 @@ public final UnaryCallableSample code: + * *

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,89 +657,114 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInterconnectsCallable() { + public final UnaryCallable + listInterconnectsCallable() { return stub.listInterconnectsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect, interconnectResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to update. - * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is + * a dedicated connection between Google's network and your on-premises network. For more + * information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== + * resource_for beta.interconnects ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchInterconnect(String requestId, ProjectInterconnectName interconnect, Interconnect interconnectResource) { + public final Operation patchInterconnect( + String requestId, + ProjectGlobalInterconnectName interconnect, + Interconnect interconnectResource) { PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnect(interconnect == null ? null : interconnect.toString()) - .setInterconnectResource(interconnectResource) - .build(); + .setRequestId(requestId) + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .setInterconnectResource(interconnectResource) + .build(); return patchInterconnect(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect.toString(), interconnectResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to update. - * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is + * a dedicated connection between Google's network and your on-premises network. For more + * information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== + * resource_for beta.interconnects ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchInterconnect(String requestId, String interconnect, Interconnect interconnectResource) { + public final Operation patchInterconnect( + String requestId, String interconnect, Interconnect interconnectResource) { PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnect(interconnect) - .setInterconnectResource(interconnectResource) - .build(); + .setRequestId(requestId) + .setInterconnect(interconnect) + .setInterconnectResource(interconnectResource) + .build(); return patchInterconnect(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -732,13 +785,15 @@ public final Operation patchInterconnect(PatchInterconnectHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
    *   String requestId = "";
-   *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -757,7 +812,7 @@ public final UnaryCallable patchInterco
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -786,12 +841,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListInterconnectsPagedResponse extends AbstractPagedListResponse<
-      ListInterconnectsHttpRequest,
-      InterconnectList,
-      Interconnect,
-      ListInterconnectsPage,
-      ListInterconnectsFixedSizeCollection> {
+  public static class ListInterconnectsPagedResponse
+      extends AbstractPagedListResponse<
+          ListInterconnectsHttpRequest, InterconnectList, Interconnect, ListInterconnectsPage,
+          ListInterconnectsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -811,15 +864,11 @@ public ListInterconnectsPagedResponse apply(ListInterconnectsPage input) {
     private ListInterconnectsPagedResponse(ListInterconnectsPage page) {
       super(page, ListInterconnectsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListInterconnectsPage extends AbstractPage<
-      ListInterconnectsHttpRequest,
-      InterconnectList,
-      Interconnect,
-      ListInterconnectsPage> {
+  public static class ListInterconnectsPage
+      extends AbstractPage<
+          ListInterconnectsHttpRequest, InterconnectList, Interconnect, ListInterconnectsPage> {
 
     private ListInterconnectsPage(
         PageContext context,
@@ -844,20 +893,15 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListInterconnectsFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListInterconnectsHttpRequest,
-      InterconnectList,
-      Interconnect,
-      ListInterconnectsPage,
-      ListInterconnectsFixedSizeCollection> {
+  public static class ListInterconnectsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListInterconnectsHttpRequest, InterconnectList, Interconnect, ListInterconnectsPage,
+          ListInterconnectsFixedSizeCollection> {
 
-    private ListInterconnectsFixedSizeCollection(List pages, int collectionSize) {
+    private ListInterconnectsFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -870,7 +914,5 @@ protected ListInterconnectsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListInterconnectsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java
index 9081f9c9225f..a08d3dc5b512 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private InterconnectList() {
     this.warning = null;
   }
 
-
   private InterconnectList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(InterconnectList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static InterconnectList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final InterconnectList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new InterconnectList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public InterconnectList build() {
 
-
-
-
-
-      return new InterconnectList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new InterconnectList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "InterconnectList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof InterconnectList) {
       InterconnectList that = (InterconnectList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java
index 02104992ca70..821c975a5d3e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -64,7 +63,6 @@ private InterconnectLocation() {
     this.selfLink = null;
   }
 
-
   private InterconnectLocation(
       String address,
       String availabilityZone,
@@ -79,8 +77,7 @@ private InterconnectLocation(
       String name,
       String peeringdbFacilityId,
       List regionInfos,
-      String selfLink
-      ) {
+      String selfLink) {
     this.address = address;
     this.availabilityZone = availabilityZone;
     this.city = city;
@@ -113,7 +110,8 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("continent", Collections.singletonList(String.valueOf(continent)));
     }
     if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
+      fieldMap.put(
+          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
     }
     if (fieldNames.contains("description") && description != null) {
       fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
@@ -122,7 +120,9 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("facilityProvider", Collections.singletonList(String.valueOf(facilityProvider)));
     }
     if (fieldNames.contains("facilityProviderFacilityId") && facilityProviderFacilityId != null) {
-      fieldMap.put("facilityProviderFacilityId", Collections.singletonList(String.valueOf(facilityProviderFacilityId)));
+      fieldMap.put(
+          "facilityProviderFacilityId",
+          Collections.singletonList(String.valueOf(facilityProviderFacilityId)));
     }
     if (fieldNames.contains("id") && id != null) {
       fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
@@ -134,7 +134,8 @@ public Map> populateFieldsInMap(Set fieldNames) {
       fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
     }
     if (fieldNames.contains("peeringdbFacilityId") && peeringdbFacilityId != null) {
-      fieldMap.put("peeringdbFacilityId", Collections.singletonList(String.valueOf(peeringdbFacilityId)));
+      fieldMap.put(
+          "peeringdbFacilityId", Collections.singletonList(String.valueOf(peeringdbFacilityId)));
     }
     if (fieldNames.contains("regionInfos") && regionInfos != null) {
       ImmutableList.Builder stringList = ImmutableList.builder();
@@ -258,22 +259,24 @@ public String getSelfLink() {
     return selfLink;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(InterconnectLocation prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static InterconnectLocation getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final InterconnectLocation DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new InterconnectLocation();
   }
@@ -494,37 +497,23 @@ public Builder setSelfLink(String selfLink) {
       return this;
     }
 
-
     public InterconnectLocation build() {
 
-
-
-
-
-
-
-
-
-
-
-
-
       return new InterconnectLocation(
-        address,
-        availabilityZone,
-        city,
-        continent,
-        creationTimestamp,
-        description,
-        facilityProvider,
-        facilityProviderFacilityId,
-        id,
-        kind,
-        name,
-        peeringdbFacilityId,
-        regionInfos,
-        selfLink
-      );
+          address,
+          availabilityZone,
+          city,
+          continent,
+          creationTimestamp,
+          description,
+          facilityProvider,
+          facilityProviderFacilityId,
+          id,
+          kind,
+          name,
+          peeringdbFacilityId,
+          regionInfos,
+          selfLink);
     }
 
     public Builder clone() {
@@ -550,20 +539,47 @@ public Builder clone() {
   @Override
   public String toString() {
     return "InterconnectLocation{"
-        + "address=" + address + ", "
-        + "availabilityZone=" + availabilityZone + ", "
-        + "city=" + city + ", "
-        + "continent=" + continent + ", "
-        + "creationTimestamp=" + creationTimestamp + ", "
-        + "description=" + description + ", "
-        + "facilityProvider=" + facilityProvider + ", "
-        + "facilityProviderFacilityId=" + facilityProviderFacilityId + ", "
-        + "id=" + id + ", "
-        + "kind=" + kind + ", "
-        + "name=" + name + ", "
-        + "peeringdbFacilityId=" + peeringdbFacilityId + ", "
-        + "regionInfos=" + regionInfos + ", "
-        + "selfLink=" + selfLink
+        + "address="
+        + address
+        + ", "
+        + "availabilityZone="
+        + availabilityZone
+        + ", "
+        + "city="
+        + city
+        + ", "
+        + "continent="
+        + continent
+        + ", "
+        + "creationTimestamp="
+        + creationTimestamp
+        + ", "
+        + "description="
+        + description
+        + ", "
+        + "facilityProvider="
+        + facilityProvider
+        + ", "
+        + "facilityProviderFacilityId="
+        + facilityProviderFacilityId
+        + ", "
+        + "id="
+        + id
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "name="
+        + name
+        + ", "
+        + "peeringdbFacilityId="
+        + peeringdbFacilityId
+        + ", "
+        + "regionInfos="
+        + regionInfos
+        + ", "
+        + "selfLink="
+        + selfLink
         + "}";
   }
 
@@ -574,22 +590,20 @@ public boolean equals(Object o) {
     }
     if (o instanceof InterconnectLocation) {
       InterconnectLocation that = (InterconnectLocation) o;
-      return
-          Objects.equals(this.address, that.getAddress()) &&
-          Objects.equals(this.availabilityZone, that.getAvailabilityZone()) &&
-          Objects.equals(this.city, that.getCity()) &&
-          Objects.equals(this.continent, that.getContinent()) &&
-          Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) &&
-          Objects.equals(this.description, that.getDescription()) &&
-          Objects.equals(this.facilityProvider, that.getFacilityProvider()) &&
-          Objects.equals(this.facilityProviderFacilityId, that.getFacilityProviderFacilityId()) &&
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.name, that.getName()) &&
-          Objects.equals(this.peeringdbFacilityId, that.getPeeringdbFacilityId()) &&
-          Objects.equals(this.regionInfos, that.getRegionInfosList()) &&
-          Objects.equals(this.selfLink, that.getSelfLink())
-          ;
+      return Objects.equals(this.address, that.getAddress())
+          && Objects.equals(this.availabilityZone, that.getAvailabilityZone())
+          && Objects.equals(this.city, that.getCity())
+          && Objects.equals(this.continent, that.getContinent())
+          && Objects.equals(this.creationTimestamp, that.getCreationTimestamp())
+          && Objects.equals(this.description, that.getDescription())
+          && Objects.equals(this.facilityProvider, that.getFacilityProvider())
+          && Objects.equals(this.facilityProviderFacilityId, that.getFacilityProviderFacilityId())
+          && Objects.equals(this.id, that.getId())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.name, that.getName())
+          && Objects.equals(this.peeringdbFacilityId, that.getPeeringdbFacilityId())
+          && Objects.equals(this.regionInfos, that.getRegionInfosList())
+          && Objects.equals(this.selfLink, that.getSelfLink());
     }
     return false;
   }
@@ -597,20 +611,19 @@ public boolean equals(Object o) {
   @Override
   public int hashCode() {
     return Objects.hash(
-      address,
-      availabilityZone,
-      city,
-      continent,
-      creationTimestamp,
-      description,
-      facilityProvider,
-      facilityProviderFacilityId,
-      id,
-      kind,
-      name,
-      peeringdbFacilityId,
-      regionInfos,
-      selfLink
-    );
+        address,
+        availabilityZone,
+        city,
+        continent,
+        creationTimestamp,
+        description,
+        facilityProvider,
+        facilityProviderFacilityId,
+        id,
+        kind,
+        name,
+        peeringdbFacilityId,
+        regionInfos,
+        selfLink);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java
index 953be5b551b4..95fcb5e8a62f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java
@@ -23,22 +23,12 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
-import com.google.api.gax.paging.FixedSizeCollection;
-import com.google.api.gax.paging.Page;
-import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.InterconnectLocationStub;
 import com.google.cloud.compute.v1.stub.InterconnectLocationStubSettings;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import java.io.Closeable;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -52,40 +42,40 @@
  * 
  * 
  * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
- *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+ *   ProjectGlobalInterconnectLocationName interconnectLocation = ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
  *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the interconnectLocationClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the interconnectLocationClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of InterconnectLocationSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of InterconnectLocationSettings + * to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class InterconnectLocationClient implements BackgroundResource {
   private final InterconnectLocationSettings settings;
   private final InterconnectLocationStub stub;
 
-
-
-  /**
-   * Constructs an instance of InterconnectLocationClient with default settings.
-   */
+  /** Constructs an instance of InterconnectLocationClient with default settings. */
   public static final InterconnectLocationClient create() throws IOException {
     return create(InterconnectLocationSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of InterconnectLocationClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of InterconnectLocationClient, using the given settings. The channels
+   * are created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final InterconnectLocationClient create(InterconnectLocationSettings settings) throws IOException {
+  public static final InterconnectLocationClient create(InterconnectLocationSettings settings)
+      throws IOException {
     return new InterconnectLocationClient(settings);
   }
 
   /**
-   * Constructs an instance of InterconnectLocationClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use InterconnectLocationSettings}.
+   * Constructs an instance of InterconnectLocationClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use InterconnectLocationSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final InterconnectLocationClient create(InterconnectLocationStub stub) {
@@ -143,9 +129,9 @@ public static final InterconnectLocationClient create(InterconnectLocationStub s
   }
 
   /**
-   * Constructs an instance of InterconnectLocationClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of InterconnectLocationClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
   protected InterconnectLocationClient(InterconnectLocationSettings settings) throws IOException {
     this.settings = settings;
@@ -167,15 +153,16 @@ public InterconnectLocationStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request.
+   * Returns the details for the specified interconnect location. Get a list of available
+   * interconnect locations by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectGlobalInterconnectLocationName interconnectLocation = ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
    * }
    * 
@@ -184,23 +171,27 @@ public InterconnectLocationStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final InterconnectLocation getInterconnectLocation(ProjectInterconnectLocationName interconnectLocation) { + public final InterconnectLocation getInterconnectLocation( + ProjectGlobalInterconnectLocationName interconnectLocation) { GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder() - .setInterconnectLocation(interconnectLocation == null ? null : interconnectLocation.toString()) - .build(); + .setInterconnectLocation( + interconnectLocation == null ? null : interconnectLocation.toString()) + .build(); return getInterconnectLocation(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request. + * Returns the details for the specified interconnect location. Get a list of available + * interconnect locations by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectGlobalInterconnectLocationName interconnectLocation = ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation.toString());
    * }
    * 
@@ -213,19 +204,21 @@ public final InterconnectLocation getInterconnectLocation(String interconnectLoc GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder() - .setInterconnectLocation(interconnectLocation) - .build(); + .setInterconnectLocation(interconnectLocation) + .build(); return getInterconnectLocation(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request. + * Returns the details for the specified interconnect location. Get a list of available + * interconnect locations by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectGlobalInterconnectLocationName interconnectLocation = ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder()
    *     .setInterconnectLocation(interconnectLocation.toString())
    *     .build();
@@ -237,18 +230,21 @@ public final InterconnectLocation getInterconnectLocation(String interconnectLoc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InterconnectLocation getInterconnectLocation(GetInterconnectLocationHttpRequest request) {
+  public final InterconnectLocation getInterconnectLocation(
+      GetInterconnectLocationHttpRequest request) {
     return getInterconnectLocationCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request.
+   * Returns the details for the specified interconnect location. Get a list of available
+   * interconnect locations by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
-   *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+   *   ProjectGlobalInterconnectLocationName interconnectLocation = ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
    *   GetInterconnectLocationHttpRequest request = GetInterconnectLocationHttpRequest.newBuilder()
    *     .setInterconnectLocation(interconnectLocation.toString())
    *     .build();
@@ -259,7 +255,8 @@ public final InterconnectLocation getInterconnectLocation(GetInterconnectLocatio
    * 
*/ @BetaApi - public final UnaryCallable getInterconnectLocationCallable() { + public final UnaryCallable + getInterconnectLocationCallable() { return stub.getInterconnectLocationCallable(); } @@ -267,7 +264,8 @@ public final UnaryCallableSample code: + * *

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -281,11 +279,12 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -309,9 +309,7 @@ public final ListInterconnectLocationsPagedResponse listInterconnectLocations(Pr
   @BetaApi
   public final ListInterconnectLocationsPagedResponse listInterconnectLocations(String project) {
     ListInterconnectLocationsHttpRequest request =
-        ListInterconnectLocationsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListInterconnectLocationsHttpRequest.newBuilder().setProject(project).build();
     return listInterconnectLocations(request);
   }
 
@@ -319,7 +317,8 @@ public final ListInterconnectLocationsPagedResponse listInterconnectLocations(St
   /**
    * Retrieves the list of interconnect locations available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -336,16 +335,17 @@ public final ListInterconnectLocationsPagedResponse listInterconnectLocations(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInterconnectLocationsPagedResponse listInterconnectLocations(ListInterconnectLocationsHttpRequest request) {
-    return listInterconnectLocationsPagedCallable()
-        .call(request);
+  public final ListInterconnectLocationsPagedResponse listInterconnectLocations(
+      ListInterconnectLocationsHttpRequest request) {
+    return listInterconnectLocationsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of interconnect locations available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -361,7 +361,9 @@ public final ListInterconnectLocationsPagedResponse listInterconnectLocations(Li
    * 
*/ @BetaApi - public final UnaryCallable listInterconnectLocationsPagedCallable() { + public final UnaryCallable< + ListInterconnectLocationsHttpRequest, ListInterconnectLocationsPagedResponse> + listInterconnectLocationsPagedCallable() { return stub.listInterconnectLocationsPagedCallable(); } @@ -369,7 +371,8 @@ public final UnaryCallableSample code: + * *

    * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -392,12 +395,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInterconnectLocationsCallable() { + public final UnaryCallable + listInterconnectLocationsCallable() { return stub.listInterconnectLocationsCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -426,15 +430,16 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListInterconnectLocationsPagedResponse extends AbstractPagedListResponse< - ListInterconnectLocationsHttpRequest, - InterconnectLocationList, - InterconnectLocation, - ListInterconnectLocationsPage, - ListInterconnectLocationsFixedSizeCollection> { + public static class ListInterconnectLocationsPagedResponse + extends AbstractPagedListResponse< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, InterconnectLocation, + ListInterconnectLocationsPage, ListInterconnectLocationsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, + InterconnectLocation> + context, ApiFuture futureResponse) { ApiFuture futurePage = ListInterconnectLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -442,7 +447,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public ListInterconnectLocationsPagedResponse apply(ListInterconnectLocationsPage input) { + public ListInterconnectLocationsPagedResponse apply( + ListInterconnectLocationsPage input) { return new ListInterconnectLocationsPagedResponse(input); } }); @@ -451,18 +457,18 @@ public ListInterconnectLocationsPagedResponse apply(ListInterconnectLocationsPag private ListInterconnectLocationsPagedResponse(ListInterconnectLocationsPage page) { super(page, ListInterconnectLocationsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInterconnectLocationsPage extends AbstractPage< - ListInterconnectLocationsHttpRequest, - InterconnectLocationList, - InterconnectLocation, - ListInterconnectLocationsPage> { + public static class ListInterconnectLocationsPage + extends AbstractPage< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, InterconnectLocation, + ListInterconnectLocationsPage> { private ListInterconnectLocationsPage( - PageContext context, + PageContext< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, + InterconnectLocation> + context, InterconnectLocationList response) { super(context, response); } @@ -473,31 +479,32 @@ private static ListInterconnectLocationsPage createEmptyPage() { @Override protected ListInterconnectLocationsPage createPage( - PageContext context, + PageContext< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, + InterconnectLocation> + context, InterconnectLocationList response) { return new ListInterconnectLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, + InterconnectLocation> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInterconnectLocationsFixedSizeCollection extends AbstractFixedSizeCollection< - ListInterconnectLocationsHttpRequest, - InterconnectLocationList, - InterconnectLocation, - ListInterconnectLocationsPage, - ListInterconnectLocationsFixedSizeCollection> { + public static class ListInterconnectLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, InterconnectLocation, + ListInterconnectLocationsPage, ListInterconnectLocationsFixedSizeCollection> { - private ListInterconnectLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListInterconnectLocationsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -510,7 +517,5 @@ protected ListInterconnectLocationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInterconnectLocationsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java index d5ba537a563a..21efdc1eaa2b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private InterconnectLocationList() { this.warning = null; } - private InterconnectLocationList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectLocationList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectLocationList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectLocationList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectLocationList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public InterconnectLocationList build() { - - - - - return new InterconnectLocationList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new InterconnectLocationList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "InterconnectLocationList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof InterconnectLocationList) { InterconnectLocationList that = (InterconnectLocationList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java index e281d763e9bd..2046dd98aef0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,8 @@ private InterconnectLocationRegionInfo() { this.region = null; } - private InterconnectLocationRegionInfo( - String expectedRttMs, - String locationPresence, - String region - ) { + String expectedRttMs, String locationPresence, String region) { this.expectedRttMs = expectedRttMs; this.locationPresence = locationPresence; this.region = region; @@ -100,22 +93,24 @@ public String getRegion() { return region; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectLocationRegionInfo prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectLocationRegionInfo getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectLocationRegionInfo DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectLocationRegionInfo(); } @@ -174,15 +169,9 @@ public Builder setRegion(String region) { return this; } - public InterconnectLocationRegionInfo build() { - - return new InterconnectLocationRegionInfo( - expectedRttMs, - locationPresence, - region - ); + return new InterconnectLocationRegionInfo(expectedRttMs, locationPresence, region); } public Builder clone() { @@ -197,9 +186,14 @@ public Builder clone() { @Override public String toString() { return "InterconnectLocationRegionInfo{" - + "expectedRttMs=" + expectedRttMs + ", " - + "locationPresence=" + locationPresence + ", " - + "region=" + region + + "expectedRttMs=" + + expectedRttMs + + ", " + + "locationPresence=" + + locationPresence + + ", " + + "region=" + + region + "}"; } @@ -210,21 +204,15 @@ public boolean equals(Object o) { } if (o instanceof InterconnectLocationRegionInfo) { InterconnectLocationRegionInfo that = (InterconnectLocationRegionInfo) o; - return - Objects.equals(this.expectedRttMs, that.getExpectedRttMs()) && - Objects.equals(this.locationPresence, that.getLocationPresence()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.expectedRttMs, that.getExpectedRttMs()) + && Objects.equals(this.locationPresence, that.getLocationPresence()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - expectedRttMs, - locationPresence, - region - ); + return Objects.hash(expectedRttMs, locationPresence, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java index d51c80c7d0ab..1790f9052aac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; import com.google.cloud.compute.v1.stub.InterconnectLocationStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getInterconnectLocation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getInterconnectLocation to 30 seconds: * *

  * 
@@ -85,63 +63,53 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InterconnectLocationSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to getInterconnectLocation.
-   */
-  public UnaryCallSettings getInterconnectLocationSettings() {
+  /** Returns the object with the settings used for calls to getInterconnectLocation. */
+  public UnaryCallSettings
+      getInterconnectLocationSettings() {
     return ((InterconnectLocationStubSettings) getStubSettings()).getInterconnectLocationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInterconnectLocations.
-   */
-  public PagedCallSettings listInterconnectLocationsSettings() {
-    return ((InterconnectLocationStubSettings) getStubSettings()).listInterconnectLocationsSettings();
+  /** Returns the object with the settings used for calls to listInterconnectLocations. */
+  public PagedCallSettings<
+          ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+          ListInterconnectLocationsPagedResponse>
+      listInterconnectLocationsSettings() {
+    return ((InterconnectLocationStubSettings) getStubSettings())
+        .listInterconnectLocationsSettings();
   }
 
-
-  public static final InterconnectLocationSettings create(InterconnectLocationStubSettings stub) throws IOException {
+  public static final InterconnectLocationSettings create(InterconnectLocationStubSettings stub)
+      throws IOException {
     return new InterconnectLocationSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InterconnectLocationStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InterconnectLocationStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InterconnectLocationStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InterconnectLocationStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InterconnectLocationStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InterconnectLocationStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InterconnectLocationStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -154,23 +122,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InterconnectLocationStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -179,10 +141,9 @@ protected InterconnectLocationSettings(Builder settingsBuilder) throws IOExcepti
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InterconnectLocationSettings.
-   */
-  public static class Builder extends ClientSettings.Builder {
+  /** Builder for InterconnectLocationSettings. */
+  public static class Builder
+      extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
     }
@@ -203,32 +164,34 @@ protected Builder(InterconnectLocationStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InterconnectLocationStubSettings.Builder getStubSettingsBuilder() {
       return ((InterconnectLocationStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to getInterconnectLocation. - */ - public UnaryCallSettings.Builder getInterconnectLocationSettings() { + /** Returns the builder for the settings used for calls to getInterconnectLocation. */ + public UnaryCallSettings.Builder + getInterconnectLocationSettings() { return getStubSettingsBuilder().getInterconnectLocationSettings(); } - /** - * Returns the builder for the settings used for calls to listInterconnectLocations. - */ - public PagedCallSettings.Builder listInterconnectLocationsSettings() { + /** Returns the builder for the settings used for calls to listInterconnectLocations. */ + public PagedCallSettings.Builder< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, + ListInterconnectLocationsPagedResponse> + listInterconnectLocationsSettings() { return getStubSettingsBuilder().listInterconnectLocationsSettings(); } @@ -237,4 +200,4 @@ public InterconnectLocationSettings build() throws IOException { return new InterconnectLocationSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java index e97fa3dc3889..ba87f2fb6546 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -52,7 +51,6 @@ private InterconnectOutageNotification() { this.state = null; } - private InterconnectOutageNotification( List affectedCircuits, String description, @@ -61,8 +59,7 @@ private InterconnectOutageNotification( String name, String source, String startTime, - String state - ) { + String state) { this.affectedCircuits = affectedCircuits; this.description = description; this.endTime = endTime; @@ -174,22 +171,24 @@ public String getState() { return state; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InterconnectOutageNotification prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InterconnectOutageNotification getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InterconnectOutageNotification DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InterconnectOutageNotification(); } @@ -326,25 +325,10 @@ public Builder setState(String state) { return this; } - public InterconnectOutageNotification build() { - - - - - - return new InterconnectOutageNotification( - affectedCircuits, - description, - endTime, - issueType, - name, - source, - startTime, - state - ); + affectedCircuits, description, endTime, issueType, name, source, startTime, state); } public Builder clone() { @@ -364,14 +348,29 @@ public Builder clone() { @Override public String toString() { return "InterconnectOutageNotification{" - + "affectedCircuits=" + affectedCircuits + ", " - + "description=" + description + ", " - + "endTime=" + endTime + ", " - + "issueType=" + issueType + ", " - + "name=" + name + ", " - + "source=" + source + ", " - + "startTime=" + startTime + ", " - + "state=" + state + + "affectedCircuits=" + + affectedCircuits + + ", " + + "description=" + + description + + ", " + + "endTime=" + + endTime + + ", " + + "issueType=" + + issueType + + ", " + + "name=" + + name + + ", " + + "source=" + + source + + ", " + + "startTime=" + + startTime + + ", " + + "state=" + + state + "}"; } @@ -382,16 +381,14 @@ public boolean equals(Object o) { } if (o instanceof InterconnectOutageNotification) { InterconnectOutageNotification that = (InterconnectOutageNotification) o; - return - Objects.equals(this.affectedCircuits, that.getAffectedCircuitsList()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.endTime, that.getEndTime()) && - Objects.equals(this.issueType, that.getIssueType()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.source, that.getSource()) && - Objects.equals(this.startTime, that.getStartTime()) && - Objects.equals(this.state, that.getState()) - ; + return Objects.equals(this.affectedCircuits, that.getAffectedCircuitsList()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.endTime, that.getEndTime()) + && Objects.equals(this.issueType, that.getIssueType()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.source, that.getSource()) + && Objects.equals(this.startTime, that.getStartTime()) + && Objects.equals(this.state, that.getState()); } return false; } @@ -399,14 +396,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - affectedCircuits, - description, - endTime, - issueType, - name, - source, - startTime, - state - ); + affectedCircuits, description, endTime, issueType, name, source, startTime, state); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java index fa44a10337b8..78e2d446cd47 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; import com.google.cloud.compute.v1.stub.InterconnectStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteInterconnect to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteInterconnect to 30 seconds: * *

  * 
@@ -85,84 +63,65 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InterconnectSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteInterconnect.
-   */
+  /** Returns the object with the settings used for calls to deleteInterconnect. */
   public UnaryCallSettings deleteInterconnectSettings() {
     return ((InterconnectStubSettings) getStubSettings()).deleteInterconnectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInterconnect.
-   */
+  /** Returns the object with the settings used for calls to getInterconnect. */
   public UnaryCallSettings getInterconnectSettings() {
     return ((InterconnectStubSettings) getStubSettings()).getInterconnectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInterconnect.
-   */
+  /** Returns the object with the settings used for calls to insertInterconnect. */
   public UnaryCallSettings insertInterconnectSettings() {
     return ((InterconnectStubSettings) getStubSettings()).insertInterconnectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInterconnects.
-   */
-  public PagedCallSettings listInterconnectsSettings() {
+  /** Returns the object with the settings used for calls to listInterconnects. */
+  public PagedCallSettings<
+          ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse>
+      listInterconnectsSettings() {
     return ((InterconnectStubSettings) getStubSettings()).listInterconnectsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchInterconnect.
-   */
+  /** Returns the object with the settings used for calls to patchInterconnect. */
   public UnaryCallSettings patchInterconnectSettings() {
     return ((InterconnectStubSettings) getStubSettings()).patchInterconnectSettings();
   }
 
-
-  public static final InterconnectSettings create(InterconnectStubSettings stub) throws IOException {
+  public static final InterconnectSettings create(InterconnectStubSettings stub)
+      throws IOException {
     return new InterconnectSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InterconnectStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return InterconnectStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return InterconnectStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return InterconnectStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return InterconnectStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return InterconnectStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InterconnectStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -175,23 +134,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return InterconnectStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -200,9 +153,7 @@ protected InterconnectSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for InterconnectSettings.
-   */
+  /** Builder for InterconnectSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -224,53 +175,51 @@ protected Builder(InterconnectStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public InterconnectStubSettings.Builder getStubSettingsBuilder() {
       return ((InterconnectStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteInterconnect. - */ - public UnaryCallSettings.Builder deleteInterconnectSettings() { + /** Returns the builder for the settings used for calls to deleteInterconnect. */ + public UnaryCallSettings.Builder + deleteInterconnectSettings() { return getStubSettingsBuilder().deleteInterconnectSettings(); } - /** - * Returns the builder for the settings used for calls to getInterconnect. - */ - public UnaryCallSettings.Builder getInterconnectSettings() { + /** Returns the builder for the settings used for calls to getInterconnect. */ + public UnaryCallSettings.Builder + getInterconnectSettings() { return getStubSettingsBuilder().getInterconnectSettings(); } - /** - * Returns the builder for the settings used for calls to insertInterconnect. - */ - public UnaryCallSettings.Builder insertInterconnectSettings() { + /** Returns the builder for the settings used for calls to insertInterconnect. */ + public UnaryCallSettings.Builder + insertInterconnectSettings() { return getStubSettingsBuilder().insertInterconnectSettings(); } - /** - * Returns the builder for the settings used for calls to listInterconnects. - */ - public PagedCallSettings.Builder listInterconnectsSettings() { + /** Returns the builder for the settings used for calls to listInterconnects. */ + public PagedCallSettings.Builder< + ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse> + listInterconnectsSettings() { return getStubSettingsBuilder().listInterconnectsSettings(); } - /** - * Returns the builder for the settings used for calls to patchInterconnect. - */ - public UnaryCallSettings.Builder patchInterconnectSettings() { + /** Returns the builder for the settings used for calls to patchInterconnect. */ + public UnaryCallSettings.Builder + patchInterconnectSettings() { return getStubSettingsBuilder().patchInterconnectSettings(); } @@ -279,4 +228,4 @@ public InterconnectSettings build() throws IOException { return new InterconnectSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java index 94d2414965c1..264ee694bb6f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private InvalidateCacheUrlMapHttpRequest() { this.userIp = null; } - private InvalidateCacheUrlMapHttpRequest( String access_token, CacheInvalidationRule cacheInvalidationRuleResource, @@ -67,8 +63,7 @@ private InvalidateCacheUrlMapHttpRequest( String quotaUser, String requestId, String urlMap, - String userIp - ) { + String userIp) { this.access_token = access_token; this.cacheInvalidationRuleResource = cacheInvalidationRuleResource; this.callback = callback; @@ -87,8 +82,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("access_token") && access_token != null) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); } - if (fieldNames.contains("cacheInvalidationRuleResource") && cacheInvalidationRuleResource != null) { - fieldMap.put("cacheInvalidationRuleResource", Collections.singletonList(String.valueOf(cacheInvalidationRuleResource))); + if (fieldNames.contains("cacheInvalidationRuleResource") + && cacheInvalidationRuleResource != null) { + fieldMap.put( + "cacheInvalidationRuleResource", + Collections.singletonList(String.valueOf(cacheInvalidationRuleResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(InvalidateCacheUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static InvalidateCacheUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final InvalidateCacheUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new InvalidateCacheUrlMapHttpRequest(); } @@ -293,7 +293,8 @@ public CacheInvalidationRule getCacheInvalidationRuleResource() { return cacheInvalidationRuleResource; } - public Builder setCacheInvalidationRuleResource(CacheInvalidationRule cacheInvalidationRuleResource) { + public Builder setCacheInvalidationRuleResource( + CacheInvalidationRule cacheInvalidationRuleResource) { this.cacheInvalidationRuleResource = cacheInvalidationRuleResource; return this; } @@ -370,17 +371,9 @@ public Builder setUserIp(String userIp) { return this; } - public InvalidateCacheUrlMapHttpRequest build() { String missing = ""; - - - - - - - if (urlMap == null) { missing += " urlMap"; } @@ -389,17 +382,16 @@ public InvalidateCacheUrlMapHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new InvalidateCacheUrlMapHttpRequest( - access_token, - cacheInvalidationRuleResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - userIp - ); + access_token, + cacheInvalidationRuleResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + urlMap, + userIp); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "InvalidateCacheUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "cacheInvalidationRuleResource=" + cacheInvalidationRuleResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "urlMap=" + urlMap + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "cacheInvalidationRuleResource=" + + cacheInvalidationRuleResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "urlMap=" + + urlMap + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +452,17 @@ public boolean equals(Object o) { } if (o instanceof InvalidateCacheUrlMapHttpRequest) { InvalidateCacheUrlMapHttpRequest that = (InvalidateCacheUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.cacheInvalidationRuleResource, that.getCacheInvalidationRuleResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals( + this.cacheInvalidationRuleResource, that.getCacheInvalidationRuleResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +470,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - cacheInvalidationRuleResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - userIp - ); + access_token, + cacheInvalidationRuleResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + urlMap, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java index e4235c930543..d405d453faa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private Items() { this.value = null; } - - private Items( - String key, - String value - ) { + private Items(String key, String value) { this.key = key; this.value = value; } @@ -86,22 +79,24 @@ public String getValue() { return value; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Items prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Items getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Items DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Items(); } @@ -146,13 +141,9 @@ public Builder setValue(String value) { return this; } - public Items build() { - return new Items( - key, - value - ); + return new Items(key, value); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "Items{" - + "key=" + key + ", " - + "value=" + value - + "}"; + return "Items{" + "key=" + key + ", " + "value=" + value + "}"; } @Override @@ -178,19 +166,13 @@ public boolean equals(Object o) { } if (o instanceof Items) { Items that = (Items) o; - return - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.value, that.getValue()) - ; + return Objects.equals(this.key, that.getKey()) && Objects.equals(this.value, that.getValue()); } return false; } @Override public int hashCode() { - return Objects.hash( - key, - value - ); + return Objects.hash(key, value); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java deleted file mode 100644 index 962bd1469701..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensClient.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.stub.LicensStub; -import com.google.cloud.compute.v1.stub.LicensStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND SERVICE -/** - * Service Description: Creates and runs virtual machines on Google Cloud Platform. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

- * 
- * try (LicensClient licensClient = LicensClient.create()) {
- *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
- *   License response = licensClient.getLicens(license);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the licensClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). - * - *

The surface of this class includes several types of Java methods for each of the API's methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. - * - *

This class can be customized by passing in a custom instance of LicensSettings to - * create(). For example: - * - * To customize credentials: - * - *

- * 
- * LicensSettings licensSettings =
- *     LicensSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * LicensClient licensClient =
- *     LicensClient.create(licensSettings);
- * 
- * 
- * - * To customize the endpoint: - * - *
- * 
- * LicensSettings licensSettings =
- *     LicensSettings.newBuilder().setEndpoint(myEndpoint).build();
- * LicensClient licensClient =
- *     LicensClient.create(licensSettings);
- * 
- * 
- */ -@Generated("by GAPIC v0.0.5") -@BetaApi -public class LicensClient implements BackgroundResource { - private final LicensSettings settings; - private final LicensStub stub; - - - - /** - * Constructs an instance of LicensClient with default settings. - */ - public static final LicensClient create() throws IOException { - return create(LicensSettings.newBuilder().build()); - } - - /** - * Constructs an instance of LicensClient, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. - */ - public static final LicensClient create(LicensSettings settings) throws IOException { - return new LicensClient(settings); - } - - /** - * Constructs an instance of LicensClient, using the given stub for making calls. This is for - * advanced usage - prefer to use LicensSettings}. - */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public static final LicensClient create(LicensStub stub) { - return new LicensClient(stub); - } - - /** - * Constructs an instance of LicensClient, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected LicensClient(LicensSettings settings) throws IOException { - this.settings = settings; - this.stub = ((LicensStubSettings) settings.getStubSettings()).createStub(); - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - protected LicensClient(LicensStub stub) { - this.settings = null; - this.stub = stub; - } - - public final LicensSettings getSettings() { - return settings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public LicensStub getStub() { - return stub; - } - - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Returns the specified License resource. - * - * Sample code: - *

-   * try (LicensClient licensClient = LicensClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
-   *   License response = licensClient.getLicens(license);
-   * }
-   * 
- * - * @param license Name of the License resource to return. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi - public final License getLicens(LicenseName license) { - - GetLicensHttpRequest request = - GetLicensHttpRequest.newBuilder() - .setLicense(license == null ? null : license.toString()) - .build(); - return getLicens(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Returns the specified License resource. - * - * Sample code: - *

-   * try (LicensClient licensClient = LicensClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
-   *   License response = licensClient.getLicens(license.toString());
-   * }
-   * 
- * - * @param license Name of the License resource to return. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi - public final License getLicens(String license) { - - GetLicensHttpRequest request = - GetLicensHttpRequest.newBuilder() - .setLicense(license) - .build(); - return getLicens(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Returns the specified License resource. - * - * Sample code: - *

-   * try (LicensClient licensClient = LicensClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
-   *   GetLicensHttpRequest request = GetLicensHttpRequest.newBuilder()
-   *     .setLicense(license.toString())
-   *     .build();
-   *   License response = licensClient.getLicens(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi - public final License getLicens(GetLicensHttpRequest request) { - return getLicensCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Returns the specified License resource. - * - * Sample code: - *

-   * try (LicensClient licensClient = LicensClient.create()) {
-   *   LicenseName license = LicenseName.of("[PROJECT]", "[LICENSE]");
-   *   GetLicensHttpRequest request = GetLicensHttpRequest.newBuilder()
-   *     .setLicense(license.toString())
-   *     .build();
-   *   ApiFuture<License> future = licensClient.getLicensCallable().futureCall(request);
-   *   // Do something
-   *   License response = future.get();
-   * }
-   * 
- */ - @BetaApi - public final UnaryCallable getLicensCallable() { - return stub.getLicensCallable(); - } - - @Override - public final void close() throws Exception { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } - - -} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java deleted file mode 100644 index 794d346abff0..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensSettings.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; -import com.google.cloud.compute.v1.stub.LicensStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link LicensClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getLicens to 30 seconds: - * - *

- * 
- * LicensSettings.Builder licensSettingsBuilder =
- *     LicensSettings.newBuilder();
- * licensSettingsBuilder.getLicensSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * LicensSettings licensSettings = licensSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by GAPIC v0.0.5") -@BetaApi -public class LicensSettings extends ClientSettings { - /** - * Returns the object with the settings used for calls to getLicens. - */ - public UnaryCallSettings getLicensSettings() { - return ((LicensStubSettings) getStubSettings()).getLicensSettings(); - } - - - public static final LicensSettings create(LicensStubSettings stub) throws IOException { - return new LicensSettings.Builder(stub.toBuilder()).build(); - } - - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return LicensStubSettings.defaultExecutorProviderBuilder(); - } - - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return LicensStubSettings.getDefaultEndpoint(); - } - /** - * Returns the default service port. - */ - public static int getDefaultServicePort() { - return LicensStubSettings.getDefaultServicePort(); - } - - - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return LicensStubSettings.getDefaultServiceScopes(); - } - - - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return LicensStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { - return LicensStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return LicensStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return LicensStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** - * Returns a builder containing all the values of this settings class. - */ - public Builder toBuilder() { - return new Builder(this); - } - - protected LicensSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** - * Builder for LicensSettings. - */ - public static class Builder extends ClientSettings.Builder { - protected Builder() throws IOException { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(LicensStubSettings.newBuilder(clientContext)); - } - - private static Builder createDefault() { - return new Builder(LicensStubSettings.newBuilder()); - } - - protected Builder(LicensSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(LicensStubSettings.Builder stubSettings) { - super(stubSettings); - } - - - public LicensStubSettings.Builder getStubSettingsBuilder() { - return ((LicensStubSettings.Builder) getStubSettings()); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** - * Returns the builder for the settings used for calls to getLicens. - */ - public UnaryCallSettings.Builder getLicensSettings() { - return getStubSettingsBuilder().getLicensSettings(); - } - - @Override - public LicensSettings build() throws IOException { - return new LicensSettings(this); - } - } -} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java index 2bc6ff8c223f..4e0c9b885395 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -33,28 +30,50 @@ @BetaApi public final class License implements ApiMessage { private final Boolean chargesUseFee; + private final String creationTimestamp; + private final String description; + private final String id; private final String kind; + private final String licenseCode; private final String name; + private final LicenseResourceRequirements resourceRequirements; private final String selfLink; + private final Boolean transferable; private License() { this.chargesUseFee = null; + this.creationTimestamp = null; + this.description = null; + this.id = null; this.kind = null; + this.licenseCode = null; this.name = null; + this.resourceRequirements = null; this.selfLink = null; + this.transferable = null; } - private License( Boolean chargesUseFee, + String creationTimestamp, + String description, + String id, String kind, + String licenseCode, String name, - String selfLink - ) { + LicenseResourceRequirements resourceRequirements, + String selfLink, + Boolean transferable) { this.chargesUseFee = chargesUseFee; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; this.kind = kind; + this.licenseCode = licenseCode; this.name = name; + this.resourceRequirements = resourceRequirements; this.selfLink = selfLink; + this.transferable = transferable; } @Override @@ -63,15 +82,35 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("chargesUseFee") && chargesUseFee != null) { fieldMap.put("chargesUseFee", Collections.singletonList(String.valueOf(chargesUseFee))); } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } if (fieldNames.contains("kind") && kind != null) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } + if (fieldNames.contains("licenseCode") && licenseCode != null) { + fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode))); + } if (fieldNames.contains("name") && name != null) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } + if (fieldNames.contains("resourceRequirements") && resourceRequirements != null) { + fieldMap.put( + "resourceRequirements", Collections.singletonList(String.valueOf(resourceRequirements))); + } if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } + if (fieldNames.contains("transferable") && transferable != null) { + fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable))); + } return fieldMap; } @@ -80,15 +119,33 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("chargesUseFee")) { return String.valueOf(chargesUseFee); } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } if (fieldName.equals("kind")) { return String.valueOf(kind); } + if (fieldName.equals("licenseCode")) { + return String.valueOf(licenseCode); + } if (fieldName.equals("name")) { return String.valueOf(name); } + if (fieldName.equals("resourceRequirements")) { + return String.valueOf(resourceRequirements); + } if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } + if (fieldName.equals("transferable")) { + return String.valueOf(transferable); + } return null; } @@ -102,43 +159,75 @@ public Boolean getChargesUseFee() { return chargesUseFee; } + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + public String getKind() { return kind; } + public String getLicenseCode() { + return licenseCode; + } + public String getName() { return name; } + public LicenseResourceRequirements getResourceRequirements() { + return resourceRequirements; + } + public String getSelfLink() { return selfLink; } + public Boolean getTransferable() { + return transferable; + } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(License prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static License getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final License DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new License(); } public static class Builder { private Boolean chargesUseFee; + private String creationTimestamp; + private String description; + private String id; private String kind; + private String licenseCode; private String name; + private LicenseResourceRequirements resourceRequirements; private String selfLink; + private Boolean transferable; Builder() {} @@ -147,23 +236,47 @@ public Builder mergeFrom(License other) { if (other.getChargesUseFee() != null) { this.chargesUseFee = other.chargesUseFee; } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } if (other.getKind() != null) { this.kind = other.kind; } + if (other.getLicenseCode() != null) { + this.licenseCode = other.licenseCode; + } if (other.getName() != null) { this.name = other.name; } + if (other.getResourceRequirements() != null) { + this.resourceRequirements = other.resourceRequirements; + } if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getTransferable() != null) { + this.transferable = other.transferable; + } return this; } Builder(License source) { this.chargesUseFee = source.chargesUseFee; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; this.kind = source.kind; + this.licenseCode = source.licenseCode; this.name = source.name; + this.resourceRequirements = source.resourceRequirements; this.selfLink = source.selfLink; + this.transferable = source.transferable; } public Boolean getChargesUseFee() { @@ -175,6 +288,33 @@ public Builder setChargesUseFee(Boolean chargesUseFee) { return this; } + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + public String getKind() { return kind; } @@ -184,6 +324,15 @@ public Builder setKind(String kind) { return this; } + public String getLicenseCode() { + return licenseCode; + } + + public Builder setLicenseCode(String licenseCode) { + this.licenseCode = licenseCode; + return this; + } + public String getName() { return name; } @@ -193,6 +342,15 @@ public Builder setName(String name) { return this; } + public LicenseResourceRequirements getResourceRequirements() { + return resourceRequirements; + } + + public Builder setResourceRequirements(LicenseResourceRequirements resourceRequirements) { + this.resourceRequirements = resourceRequirements; + return this; + } + public String getSelfLink() { return selfLink; } @@ -202,25 +360,42 @@ public Builder setSelfLink(String selfLink) { return this; } + public Boolean getTransferable() { + return transferable; + } - public License build() { - + public Builder setTransferable(Boolean transferable) { + this.transferable = transferable; + return this; + } + public License build() { return new License( - chargesUseFee, - kind, - name, - selfLink - ); + chargesUseFee, + creationTimestamp, + description, + id, + kind, + licenseCode, + name, + resourceRequirements, + selfLink, + transferable); } public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setChargesUseFee(this.chargesUseFee); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); newBuilder.setKind(this.kind); + newBuilder.setLicenseCode(this.licenseCode); newBuilder.setName(this.name); + newBuilder.setResourceRequirements(this.resourceRequirements); newBuilder.setSelfLink(this.selfLink); + newBuilder.setTransferable(this.transferable); return newBuilder; } } @@ -228,10 +403,35 @@ public Builder clone() { @Override public String toString() { return "License{" - + "chargesUseFee=" + chargesUseFee + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + + "chargesUseFee=" + + chargesUseFee + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "licenseCode=" + + licenseCode + + ", " + + "name=" + + name + + ", " + + "resourceRequirements=" + + resourceRequirements + + ", " + + "selfLink=" + + selfLink + + ", " + + "transferable=" + + transferable + "}"; } @@ -242,12 +442,16 @@ public boolean equals(Object o) { } if (o instanceof License) { License that = (License) o; - return - Objects.equals(this.chargesUseFee, that.getChargesUseFee()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.chargesUseFee, that.getChargesUseFee()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.licenseCode, that.getLicenseCode()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.resourceRequirements, that.getResourceRequirements()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.transferable, that.getTransferable()); } return false; } @@ -255,10 +459,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - chargesUseFee, - kind, - name, - selfLink - ); + chargesUseFee, + creationTimestamp, + description, + id, + kind, + licenseCode, + name, + resourceRequirements, + selfLink, + transferable); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java index 86919dddc601..36b653193073 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.LicenseStub; import com.google.cloud.compute.v1.stub.LicenseStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,40 +42,40 @@ *
  * 
  * try (LicenseClient licenseClient = LicenseClient.create()) {
- *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
- *   License response = licenseClient.getLicense(license);
+ *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
+ *   String requestId = "";
+ *   Operation response = licenseClient.deleteLicense(license, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the licenseClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the licenseClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of LicenseSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of LicenseSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +105,14 @@ public class LicenseClient implements BackgroundResource {
   private final LicenseSettings settings;
   private final LicenseStub stub;
 
-
-
-  /**
-   * Constructs an instance of LicenseClient with default settings.
-   */
+  /** Constructs an instance of LicenseClient with default settings. */
   public static final LicenseClient create() throws IOException {
     return create(LicenseSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of LicenseClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of LicenseClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final LicenseClient create(LicenseSettings settings) throws IOException {
     return new LicenseClient(settings);
@@ -143,9 +128,8 @@ public static final LicenseClient create(LicenseStub stub) {
   }
 
   /**
-   * Constructs an instance of LicenseClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of LicenseClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected LicenseClient(LicenseSettings settings) throws IOException {
     this.settings = settings;
@@ -167,15 +151,137 @@ public LicenseStub getStub() {
     return stub;
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Deletes the specified license.
+   *
+   * 

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   String requestId = "";
+   *   Operation response = licenseClient.deleteLicense(license, requestId);
+   * }
+   * 
+ * + * @param license Name of the license resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteLicense(ProjectGlobalLicenseName license, String requestId) { + + DeleteLicenseHttpRequest request = + DeleteLicenseHttpRequest.newBuilder() + .setLicense(license == null ? null : license.toString()) + .setRequestId(requestId) + .build(); + return deleteLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified license. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   String requestId = "";
+   *   Operation response = licenseClient.deleteLicense(license.toString(), requestId);
+   * }
+   * 
+ * + * @param license Name of the license resource to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteLicense(String license, String requestId) { + + DeleteLicenseHttpRequest request = + DeleteLicenseHttpRequest.newBuilder().setLicense(license).setRequestId(requestId).build(); + return deleteLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified license. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   String requestId = "";
+   *   DeleteLicenseHttpRequest request = DeleteLicenseHttpRequest.newBuilder()
+   *     .setLicense(license.toString())
+   *     .setRequestId(requestId)
+   *     .build();
+   *   Operation response = licenseClient.deleteLicense(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteLicense(DeleteLicenseHttpRequest request) { + return deleteLicenseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified license. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   String requestId = "";
+   *   DeleteLicenseHttpRequest request = DeleteLicenseHttpRequest.newBuilder()
+   *     .setLicense(license.toString())
+   *     .setRequestId(requestId)
+   *     .build();
+   *   ApiFuture<Operation> future = licenseClient.deleteLicenseCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteLicenseCallable() { + return stub.deleteLicenseCallable(); + } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns the specified License resource. * - * Sample code: + *

Sample code: + * *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
    *   License response = licenseClient.getLicense(license);
    * }
    * 
@@ -184,12 +290,12 @@ public LicenseStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final License getLicense(ProjectLicenseName license) { + public final License getLicense(ProjectGlobalLicenseName license) { GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder() - .setLicense(license == null ? null : license.toString()) - .build(); + .setLicense(license == null ? null : license.toString()) + .build(); return getLicense(request); } @@ -197,10 +303,11 @@ public final License getLicense(ProjectLicenseName license) { /** * Returns the specified License resource. * - * Sample code: + *

Sample code: + * *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
    *   License response = licenseClient.getLicense(license.toString());
    * }
    * 
@@ -211,10 +318,7 @@ public final License getLicense(ProjectLicenseName license) { @BetaApi public final License getLicense(String license) { - GetLicenseHttpRequest request = - GetLicenseHttpRequest.newBuilder() - .setLicense(license) - .build(); + GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder().setLicense(license).build(); return getLicense(request); } @@ -222,10 +326,11 @@ public final License getLicense(String license) { /** * Returns the specified License resource. * - * Sample code: + *

Sample code: + * *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
    *   GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder()
    *     .setLicense(license.toString())
    *     .build();
@@ -245,10 +350,11 @@ public final License getLicense(GetLicenseHttpRequest request) {
   /**
    * Returns the specified License resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
+   *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
    *   GetLicenseHttpRequest request = GetLicenseHttpRequest.newBuilder()
    *     .setLicense(license.toString())
    *     .build();
@@ -263,8 +369,414 @@ public final UnaryCallable getLicenseCallable()
     return stub.getLicenseCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Create a License resource in the specified project.
+   *
+   * 

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   License licenseResource = License.newBuilder().build();
+   *   Operation response = licenseClient.insertLicense(requestId, project, licenseResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param licenseResource A license resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertLicense( + String requestId, ProjectName project, License licenseResource) { + + InsertLicenseHttpRequest request = + InsertLicenseHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setLicenseResource(licenseResource) + .build(); + return insertLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a License resource in the specified project. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   License licenseResource = License.newBuilder().build();
+   *   Operation response = licenseClient.insertLicense(requestId, project.toString(), licenseResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param licenseResource A license resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertLicense(String requestId, String project, License licenseResource) { + + InsertLicenseHttpRequest request = + InsertLicenseHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setLicenseResource(licenseResource) + .build(); + return insertLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a License resource in the specified project. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   License licenseResource = License.newBuilder().build();
+   *   InsertLicenseHttpRequest request = InsertLicenseHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setLicenseResource(licenseResource)
+   *     .build();
+   *   Operation response = licenseClient.insertLicense(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertLicense(InsertLicenseHttpRequest request) { + return insertLicenseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Create a License resource in the specified project. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   License licenseResource = License.newBuilder().build();
+   *   InsertLicenseHttpRequest request = InsertLicenseHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setLicenseResource(licenseResource)
+   *     .build();
+   *   ApiFuture<Operation> future = licenseClient.insertLicenseCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertLicenseCallable() { + return stub.insertLicenseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 8. 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. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (License element : licenseClient.listLicenses(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListLicensesPagedResponse listLicenses(ProjectName project) { + ListLicensesHttpRequest request = + ListLicensesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listLicenses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 8. 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. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (License element : licenseClient.listLicenses(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListLicensesPagedResponse listLicenses(String project) { + ListLicensesHttpRequest request = + ListLicensesHttpRequest.newBuilder().setProject(project).build(); + return listLicenses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 8. 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. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListLicensesHttpRequest request = ListLicensesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (License element : licenseClient.listLicenses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListLicensesPagedResponse listLicenses(ListLicensesHttpRequest request) { + return listLicensesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 8. 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. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListLicensesHttpRequest request = ListLicensesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListLicensesPagedResponse> future = licenseClient.listLicensesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (License element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listLicensesPagedCallable() { + return stub.listLicensesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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 8. 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. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListLicensesHttpRequest request = ListLicensesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     LicensesListResponse response = licenseClient.listLicensesCallable().call(request);
+   *     for (License element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listLicensesCallable() { + return stub.listLicensesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = licenseClient.testIamPermissionsLicense(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsLicense( + ProjectGlobalLicenseResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsLicenseHttpRequest request = + TestIamPermissionsLicenseHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = licenseClient.testIamPermissionsLicense(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsLicense( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsLicenseHttpRequest request = + TestIamPermissionsLicenseHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsLicenseHttpRequest request = TestIamPermissionsLicenseHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = licenseClient.testIamPermissionsLicense(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsLicense( + TestIamPermissionsLicenseHttpRequest request) { + return testIamPermissionsLicenseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsLicenseHttpRequest request = TestIamPermissionsLicenseHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = licenseClient.testIamPermissionsLicenseCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsLicenseCallable() { + return stub.testIamPermissionsLicenseCallable(); + } + @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -293,5 +805,77 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } + public static class ListLicensesPagedResponse + extends AbstractPagedListResponse< + ListLicensesHttpRequest, LicensesListResponse, License, ListLicensesPage, + ListLicensesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLicensesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListLicensesPagedResponse apply(ListLicensesPage input) { + return new ListLicensesPagedResponse(input); + } + }); + } + + private ListLicensesPagedResponse(ListLicensesPage page) { + super(page, ListLicensesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLicensesPage + extends AbstractPage< + ListLicensesHttpRequest, LicensesListResponse, License, ListLicensesPage> { + + private ListLicensesPage( + PageContext context, + LicensesListResponse response) { + super(context, response); + } -} \ No newline at end of file + private static ListLicensesPage createEmptyPage() { + return new ListLicensesPage(null, null); + } + + @Override + protected ListLicensesPage createPage( + PageContext context, + LicensesListResponse response) { + return new ListLicensesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLicensesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLicensesHttpRequest, LicensesListResponse, License, ListLicensesPage, + ListLicensesFixedSizeCollection> { + + private ListLicensesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLicensesFixedSizeCollection createEmptyCollection() { + return new ListLicensesFixedSizeCollection(null, 0); + } + + @Override + protected ListLicensesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLicensesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java new file mode 100644 index 000000000000..5752223ce642 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java @@ -0,0 +1,451 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class LicenseCode implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final List licenseAlias; + private final String name; + private final String selfLink; + private final String state; + private final Boolean transferable; + + private LicenseCode() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.licenseAlias = null; + this.name = null; + this.selfLink = null; + this.state = null; + this.transferable = null; + } + + private LicenseCode( + String creationTimestamp, + String description, + String id, + String kind, + List licenseAlias, + String name, + String selfLink, + String state, + Boolean transferable) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.licenseAlias = licenseAlias; + this.name = name; + this.selfLink = selfLink; + this.state = state; + this.transferable = transferable; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenseAlias") && licenseAlias != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (LicenseCodeLicenseAlias item : licenseAlias) { + stringList.add(item.toString()); + } + fieldMap.put("licenseAlias", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + if (fieldNames.contains("transferable") && transferable != null) { + fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("licenseAlias")) { + return String.valueOf(licenseAlias); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("state")) { + return String.valueOf(state); + } + if (fieldName.equals("transferable")) { + return String.valueOf(transferable); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public List getLicenseAliasList() { + return licenseAlias; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public String getState() { + return state; + } + + public Boolean getTransferable() { + return transferable; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(LicenseCode prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static LicenseCode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final LicenseCode DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new LicenseCode(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private List licenseAlias; + private String name; + private String selfLink; + private String state; + private Boolean transferable; + + Builder() {} + + public Builder mergeFrom(LicenseCode other) { + if (other == LicenseCode.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLicenseAliasList() != null) { + this.licenseAlias = other.licenseAlias; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getState() != null) { + this.state = other.state; + } + if (other.getTransferable() != null) { + this.transferable = other.transferable; + } + return this; + } + + Builder(LicenseCode source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.licenseAlias = source.licenseAlias; + this.name = source.name; + this.selfLink = source.selfLink; + this.state = source.state; + this.transferable = source.transferable; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public List getLicenseAliasList() { + return licenseAlias; + } + + public Builder addAllLicenseAlias(List licenseAlias) { + if (this.licenseAlias == null) { + this.licenseAlias = new ArrayList<>(licenseAlias.size()); + } + this.licenseAlias.addAll(licenseAlias); + return this; + } + + public Builder addLicenseAlias(LicenseCodeLicenseAlias licenseAlias) { + this.licenseAlias.add(licenseAlias); + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getState() { + return state; + } + + public Builder setState(String state) { + this.state = state; + return this; + } + + public Boolean getTransferable() { + return transferable; + } + + public Builder setTransferable(Boolean transferable) { + this.transferable = transferable; + return this; + } + + public LicenseCode build() { + + return new LicenseCode( + creationTimestamp, + description, + id, + kind, + licenseAlias, + name, + selfLink, + state, + transferable); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.addAllLicenseAlias(this.licenseAlias); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setState(this.state); + newBuilder.setTransferable(this.transferable); + return newBuilder; + } + } + + @Override + public String toString() { + return "LicenseCode{" + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "licenseAlias=" + + licenseAlias + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "state=" + + state + + ", " + + "transferable=" + + transferable + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LicenseCode) { + LicenseCode that = (LicenseCode) o; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.licenseAlias, that.getLicenseAliasList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.state, that.getState()) + && Objects.equals(this.transferable, that.getTransferable()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + kind, + licenseAlias, + name, + selfLink, + state, + transferable); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java new file mode 100644 index 000000000000..993d5c422efd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java @@ -0,0 +1,390 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.LicenseCodeStub; +import com.google.cloud.compute.v1.stub.LicenseCodeStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+ *   ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]");
+ *   LicenseCode response = licenseCodeClient.getLicenseCode(licenseCode);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the licenseCodeClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of LicenseCodeSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * LicenseCodeSettings licenseCodeSettings =
+ *     LicenseCodeSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LicenseCodeClient licenseCodeClient =
+ *     LicenseCodeClient.create(licenseCodeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * LicenseCodeSettings licenseCodeSettings =
+ *     LicenseCodeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LicenseCodeClient licenseCodeClient =
+ *     LicenseCodeClient.create(licenseCodeSettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicenseCodeClient implements BackgroundResource { + private final LicenseCodeSettings settings; + private final LicenseCodeStub stub; + + /** Constructs an instance of LicenseCodeClient with default settings. */ + public static final LicenseCodeClient create() throws IOException { + return create(LicenseCodeSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LicenseCodeClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final LicenseCodeClient create(LicenseCodeSettings settings) throws IOException { + return new LicenseCodeClient(settings); + } + + /** + * Constructs an instance of LicenseCodeClient, using the given stub for making calls. This is for + * advanced usage - prefer to use LicenseCodeSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final LicenseCodeClient create(LicenseCodeStub stub) { + return new LicenseCodeClient(stub); + } + + /** + * Constructs an instance of LicenseCodeClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected LicenseCodeClient(LicenseCodeSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LicenseCodeStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected LicenseCodeClient(LicenseCodeStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LicenseCodeSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LicenseCodeStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Return a specified license code. License codes are mirrored across all projects that have + * permissions to read the License Code. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]");
+   *   LicenseCode response = licenseCodeClient.getLicenseCode(licenseCode);
+   * }
+   * 
+ * + * @param licenseCode Number corresponding to the License code resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final LicenseCode getLicenseCode(ProjectGlobalLicenseCodeName licenseCode) { + + GetLicenseCodeHttpRequest request = + GetLicenseCodeHttpRequest.newBuilder() + .setLicenseCode(licenseCode == null ? null : licenseCode.toString()) + .build(); + return getLicenseCode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Return a specified license code. License codes are mirrored across all projects that have + * permissions to read the License Code. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]");
+   *   LicenseCode response = licenseCodeClient.getLicenseCode(licenseCode.toString());
+   * }
+   * 
+ * + * @param licenseCode Number corresponding to the License code resource to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final LicenseCode getLicenseCode(String licenseCode) { + + GetLicenseCodeHttpRequest request = + GetLicenseCodeHttpRequest.newBuilder().setLicenseCode(licenseCode).build(); + return getLicenseCode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Return a specified license code. License codes are mirrored across all projects that have + * permissions to read the License Code. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]");
+   *   GetLicenseCodeHttpRequest request = GetLicenseCodeHttpRequest.newBuilder()
+   *     .setLicenseCode(licenseCode.toString())
+   *     .build();
+   *   LicenseCode response = licenseCodeClient.getLicenseCode(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final LicenseCode getLicenseCode(GetLicenseCodeHttpRequest request) { + return getLicenseCodeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Return a specified license code. License codes are mirrored across all projects that have + * permissions to read the License Code. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]");
+   *   GetLicenseCodeHttpRequest request = GetLicenseCodeHttpRequest.newBuilder()
+   *     .setLicenseCode(licenseCode.toString())
+   *     .build();
+   *   ApiFuture<LicenseCode> future = licenseCodeClient.getLicenseCodeCallable().futureCall(request);
+   *   // Do something
+   *   LicenseCode response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getLicenseCodeCallable() { + return stub.getLicenseCodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeResourceName resource = ProjectGlobalLicenseCodeResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = licenseCodeClient.testIamPermissionsLicenseCode(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsLicenseCode( + ProjectGlobalLicenseCodeResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsLicenseCodeHttpRequest request = + TestIamPermissionsLicenseCodeHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsLicenseCode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeResourceName resource = ProjectGlobalLicenseCodeResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = licenseCodeClient.testIamPermissionsLicenseCode(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsLicenseCode( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsLicenseCodeHttpRequest request = + TestIamPermissionsLicenseCodeHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsLicenseCode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeResourceName resource = ProjectGlobalLicenseCodeResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsLicenseCodeHttpRequest request = TestIamPermissionsLicenseCodeHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = licenseCodeClient.testIamPermissionsLicenseCode(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsLicenseCode( + TestIamPermissionsLicenseCodeHttpRequest request) { + return testIamPermissionsLicenseCodeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+   *   ProjectGlobalLicenseCodeResourceName resource = ProjectGlobalLicenseCodeResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsLicenseCodeHttpRequest request = TestIamPermissionsLicenseCodeHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = licenseCodeClient.testIamPermissionsLicenseCodeCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsLicenseCodeCallable() { + return stub.testIamPermissionsLicenseCodeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java new file mode 100644 index 000000000000..0a6acb8c0f41 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java @@ -0,0 +1,185 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class LicenseCodeLicenseAlias implements ApiMessage { + private final String description; + private final String selfLink; + + private LicenseCodeLicenseAlias() { + this.description = null; + this.selfLink = null; + } + + private LicenseCodeLicenseAlias(String description, String selfLink) { + this.description = description; + this.selfLink = selfLink; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getDescription() { + return description; + } + + public String getSelfLink() { + return selfLink; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(LicenseCodeLicenseAlias prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static LicenseCodeLicenseAlias getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final LicenseCodeLicenseAlias DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new LicenseCodeLicenseAlias(); + } + + public static class Builder { + private String description; + private String selfLink; + + Builder() {} + + public Builder mergeFrom(LicenseCodeLicenseAlias other) { + if (other == LicenseCodeLicenseAlias.getDefaultInstance()) return this; + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + return this; + } + + Builder(LicenseCodeLicenseAlias source) { + this.description = source.description; + this.selfLink = source.selfLink; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public LicenseCodeLicenseAlias build() { + + return new LicenseCodeLicenseAlias(description, selfLink); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setDescription(this.description); + newBuilder.setSelfLink(this.selfLink); + return newBuilder; + } + } + + @Override + public String toString() { + return "LicenseCodeLicenseAlias{" + + "description=" + + description + + ", " + + "selfLink=" + + selfLink + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LicenseCodeLicenseAlias) { + LicenseCodeLicenseAlias that = (LicenseCodeLicenseAlias) o; + return Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.selfLink, that.getSelfLink()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(description, selfLink); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java new file mode 100644 index 000000000000..70a10592d8e9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java @@ -0,0 +1,193 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.LicenseCodeStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LicenseCodeClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getLicenseCode to 30 seconds: + * + *

+ * 
+ * LicenseCodeSettings.Builder licenseCodeSettingsBuilder =
+ *     LicenseCodeSettings.newBuilder();
+ * licenseCodeSettingsBuilder.getLicenseCodeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LicenseCodeSettings licenseCodeSettings = licenseCodeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicenseCodeSettings extends ClientSettings { + /** Returns the object with the settings used for calls to getLicenseCode. */ + public UnaryCallSettings getLicenseCodeSettings() { + return ((LicenseCodeStubSettings) getStubSettings()).getLicenseCodeSettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissionsLicenseCode. */ + public UnaryCallSettings + testIamPermissionsLicenseCodeSettings() { + return ((LicenseCodeStubSettings) getStubSettings()).testIamPermissionsLicenseCodeSettings(); + } + + public static final LicenseCodeSettings create(LicenseCodeStubSettings stub) throws IOException { + return new LicenseCodeSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LicenseCodeStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return LicenseCodeStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return LicenseCodeStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return LicenseCodeStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LicenseCodeStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return LicenseCodeStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LicenseCodeStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LicenseCodeStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LicenseCodeSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for LicenseCodeSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(LicenseCodeStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(LicenseCodeStubSettings.newBuilder()); + } + + protected Builder(LicenseCodeSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LicenseCodeStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public LicenseCodeStubSettings.Builder getStubSettingsBuilder() { + return ((LicenseCodeStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getLicenseCode. */ + public UnaryCallSettings.Builder + getLicenseCodeSettings() { + return getStubSettingsBuilder().getLicenseCodeSettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissionsLicenseCode. */ + public UnaryCallSettings.Builder< + TestIamPermissionsLicenseCodeHttpRequest, TestPermissionsResponse> + testIamPermissionsLicenseCodeSettings() { + return getStubSettingsBuilder().testIamPermissionsLicenseCodeSettings(); + } + + @Override + public LicenseCodeSettings build() throws IOException { + return new LicenseCodeSettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java new file mode 100644 index 000000000000..40228b44df36 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java @@ -0,0 +1,185 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class LicenseResourceRequirements implements ApiMessage { + private final Integer minGuestCpuCount; + private final Integer minMemoryMb; + + private LicenseResourceRequirements() { + this.minGuestCpuCount = null; + this.minMemoryMb = null; + } + + private LicenseResourceRequirements(Integer minGuestCpuCount, Integer minMemoryMb) { + this.minGuestCpuCount = minGuestCpuCount; + this.minMemoryMb = minMemoryMb; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("minGuestCpuCount") && minGuestCpuCount != null) { + fieldMap.put("minGuestCpuCount", Collections.singletonList(String.valueOf(minGuestCpuCount))); + } + if (fieldNames.contains("minMemoryMb") && minMemoryMb != null) { + fieldMap.put("minMemoryMb", Collections.singletonList(String.valueOf(minMemoryMb))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("minGuestCpuCount")) { + return String.valueOf(minGuestCpuCount); + } + if (fieldName.equals("minMemoryMb")) { + return String.valueOf(minMemoryMb); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getMinGuestCpuCount() { + return minGuestCpuCount; + } + + public Integer getMinMemoryMb() { + return minMemoryMb; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(LicenseResourceRequirements prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static LicenseResourceRequirements getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final LicenseResourceRequirements DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new LicenseResourceRequirements(); + } + + public static class Builder { + private Integer minGuestCpuCount; + private Integer minMemoryMb; + + Builder() {} + + public Builder mergeFrom(LicenseResourceRequirements other) { + if (other == LicenseResourceRequirements.getDefaultInstance()) return this; + if (other.getMinGuestCpuCount() != null) { + this.minGuestCpuCount = other.minGuestCpuCount; + } + if (other.getMinMemoryMb() != null) { + this.minMemoryMb = other.minMemoryMb; + } + return this; + } + + Builder(LicenseResourceRequirements source) { + this.minGuestCpuCount = source.minGuestCpuCount; + this.minMemoryMb = source.minMemoryMb; + } + + public Integer getMinGuestCpuCount() { + return minGuestCpuCount; + } + + public Builder setMinGuestCpuCount(Integer minGuestCpuCount) { + this.minGuestCpuCount = minGuestCpuCount; + return this; + } + + public Integer getMinMemoryMb() { + return minMemoryMb; + } + + public Builder setMinMemoryMb(Integer minMemoryMb) { + this.minMemoryMb = minMemoryMb; + return this; + } + + public LicenseResourceRequirements build() { + + return new LicenseResourceRequirements(minGuestCpuCount, minMemoryMb); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setMinGuestCpuCount(this.minGuestCpuCount); + newBuilder.setMinMemoryMb(this.minMemoryMb); + return newBuilder; + } + } + + @Override + public String toString() { + return "LicenseResourceRequirements{" + + "minGuestCpuCount=" + + minGuestCpuCount + + ", " + + "minMemoryMb=" + + minMemoryMb + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LicenseResourceRequirements) { + LicenseResourceRequirements that = (LicenseResourceRequirements) o; + return Objects.equals(this.minGuestCpuCount, that.getMinGuestCpuCount()) + && Objects.equals(this.minMemoryMb, that.getMinMemoryMb()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(minGuestCpuCount, minMemoryMb); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java index 8a958ce76a1c..8f9d1b11e474 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java @@ -15,37 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.LicenseClient.ListLicensesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.stub.LicenseStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -54,21 +40,21 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getLicense to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteLicense to 30 seconds: * *

  * 
  * LicenseSettings.Builder licenseSettingsBuilder =
  *     LicenseSettings.newBuilder();
- * licenseSettingsBuilder.getLicenseSettings().getRetrySettings().toBuilder()
+ * licenseSettingsBuilder.deleteLicenseSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * LicenseSettings licenseSettings = licenseSettingsBuilder.build();
  * 
@@ -77,56 +63,64 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class LicenseSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to getLicense.
-   */
+  /** Returns the object with the settings used for calls to deleteLicense. */
+  public UnaryCallSettings deleteLicenseSettings() {
+    return ((LicenseStubSettings) getStubSettings()).deleteLicenseSettings();
+  }
+
+  /** Returns the object with the settings used for calls to getLicense. */
   public UnaryCallSettings getLicenseSettings() {
     return ((LicenseStubSettings) getStubSettings()).getLicenseSettings();
   }
 
+  /** Returns the object with the settings used for calls to insertLicense. */
+  public UnaryCallSettings insertLicenseSettings() {
+    return ((LicenseStubSettings) getStubSettings()).insertLicenseSettings();
+  }
+
+  /** Returns the object with the settings used for calls to listLicenses. */
+  public PagedCallSettings
+      listLicensesSettings() {
+    return ((LicenseStubSettings) getStubSettings()).listLicensesSettings();
+  }
+
+  /** Returns the object with the settings used for calls to testIamPermissionsLicense. */
+  public UnaryCallSettings
+      testIamPermissionsLicenseSettings() {
+    return ((LicenseStubSettings) getStubSettings()).testIamPermissionsLicenseSettings();
+  }
 
   public static final LicenseSettings create(LicenseStubSettings stub) throws IOException {
     return new LicenseSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return LicenseStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return LicenseStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return LicenseStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return LicenseStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return LicenseStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return LicenseStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return LicenseStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -139,23 +133,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return LicenseStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -164,9 +152,7 @@ protected LicenseSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for LicenseSettings.
-   */
+  /** Builder for LicenseSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -188,31 +174,54 @@ protected Builder(LicenseStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public LicenseStubSettings.Builder getStubSettingsBuilder() {
       return ((LicenseStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to getLicense. - */ + /** Returns the builder for the settings used for calls to deleteLicense. */ + public UnaryCallSettings.Builder deleteLicenseSettings() { + return getStubSettingsBuilder().deleteLicenseSettings(); + } + + /** Returns the builder for the settings used for calls to getLicense. */ public UnaryCallSettings.Builder getLicenseSettings() { return getStubSettingsBuilder().getLicenseSettings(); } + /** Returns the builder for the settings used for calls to insertLicense. */ + public UnaryCallSettings.Builder insertLicenseSettings() { + return getStubSettingsBuilder().insertLicenseSettings(); + } + + /** Returns the builder for the settings used for calls to listLicenses. */ + public PagedCallSettings.Builder< + ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse> + listLicensesSettings() { + return getStubSettingsBuilder().listLicensesSettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissionsLicense. */ + public UnaryCallSettings.Builder + testIamPermissionsLicenseSettings() { + return getStubSettingsBuilder().testIamPermissionsLicenseSettings(); + } + @Override public LicenseSettings build() throws IOException { return new LicenseSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java new file mode 100644 index 000000000000..c26fff8ac1bd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java @@ -0,0 +1,296 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class LicensesListResponse implements ApiMessage { + private final String id; + private final List items; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private LicensesListResponse() { + this.id = null; + this.items = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private LicensesListResponse( + String id, List items, String nextPageToken, String selfLink, Warning warning) { + this.id = id; + this.items = items; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (License item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(LicensesListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static LicensesListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final LicensesListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new LicensesListResponse(); + } + + public static class Builder { + private String id; + private List items; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(LicensesListResponse other) { + if (other == LicensesListResponse.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(LicensesListResponse source) { + this.id = source.id; + this.items = source.items; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(License items) { + this.items.add(items); + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public LicensesListResponse build() { + + return new LicensesListResponse(id, items, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "LicensesListResponse{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LicensesListResponse) { + LicensesListResponse that = (LicensesListResponse) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java index b41fce9dbcc7..5059c1664405 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListAcceleratorTypesHttpRequest() { this.zone = null; } - private ListAcceleratorTypesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListAcceleratorTypesHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListAcceleratorTypesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListAcceleratorTypesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListAcceleratorTypesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListAcceleratorTypesHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListAcceleratorTypesHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListAcceleratorTypesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListAcceleratorTypesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListAcceleratorTypesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListAcceleratorTypesHttpRequest) { ListAcceleratorTypesHttpRequest that = (ListAcceleratorTypesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java index eee7428ad7ff..f49ce42acd49 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListAddressesHttpRequest() { this.userIp = null; } - private ListAddressesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListAddressesHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListAddressesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListAddressesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListAddressesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListAddressesHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListAddressesHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListAddressesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListAddressesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListAddressesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListAddressesHttpRequest) { ListAddressesHttpRequest that = (ListAddressesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java index 0840b48beb4c..754c7ec43bc7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListAutoscalersHttpRequest() { this.zone = null; } - private ListAutoscalersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListAutoscalersHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListAutoscalersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListAutoscalersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListAutoscalersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListAutoscalersHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListAutoscalersHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListAutoscalersHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListAutoscalersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListAutoscalersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListAutoscalersHttpRequest) { ListAutoscalersHttpRequest that = (ListAutoscalersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java new file mode 100644 index 000000000000..370573626da8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java @@ -0,0 +1,550 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListAvailableFeaturesSslPoliciesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListAvailableFeaturesSslPoliciesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + private ListAvailableFeaturesSslPoliciesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListAvailableFeaturesSslPoliciesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListAvailableFeaturesSslPoliciesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListAvailableFeaturesSslPoliciesHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListAvailableFeaturesSslPoliciesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListAvailableFeaturesSslPoliciesHttpRequest other) { + if (other == ListAvailableFeaturesSslPoliciesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListAvailableFeaturesSslPoliciesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListAvailableFeaturesSslPoliciesHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListAvailableFeaturesSslPoliciesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListAvailableFeaturesSslPoliciesHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListAvailableFeaturesSslPoliciesHttpRequest) { + ListAvailableFeaturesSslPoliciesHttpRequest that = + (ListAvailableFeaturesSslPoliciesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java index ee345bb44308..2831420c3b72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListBackendBucketsHttpRequest() { this.userIp = null; } - private ListBackendBucketsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListBackendBucketsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListBackendBucketsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListBackendBucketsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListBackendBucketsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListBackendBucketsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListBackendBucketsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListBackendBucketsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListBackendBucketsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListBackendBucketsHttpRequest) { ListBackendBucketsHttpRequest that = (ListBackendBucketsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java index dffd8c704b48..4468629a8f8b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListBackendServicesHttpRequest() { this.userIp = null; } - private ListBackendServicesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListBackendServicesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListBackendServicesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListBackendServicesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListBackendServicesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListBackendServicesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListBackendServicesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListBackendServicesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListBackendServicesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListBackendServicesHttpRequest) { ListBackendServicesHttpRequest that = (ListBackendServicesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java index 359256b1b022..463aaa944660 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListDiskTypesHttpRequest() { this.zone = null; } - private ListDiskTypesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListDiskTypesHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListDiskTypesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListDiskTypesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListDiskTypesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListDiskTypesHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListDiskTypesHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListDiskTypesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListDiskTypesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListDiskTypesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListDiskTypesHttpRequest) { ListDiskTypesHttpRequest that = (ListDiskTypesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java index be037e5275d0..d1c92e50b928 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListDisksHttpRequest() { this.zone = null; } - private ListDisksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListDisksHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListDisksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListDisksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListDisksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListDisksHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListDisksHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListDisksHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListDisksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListDisksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListDisksHttpRequest) { ListDisksHttpRequest that = (ListDisksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java index d51a138ced6f..8d901b420a57 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListFirewallsHttpRequest() { this.userIp = null; } - private ListFirewallsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListFirewallsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListFirewallsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListFirewallsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListFirewallsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListFirewallsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListFirewallsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListFirewallsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListFirewallsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListFirewallsHttpRequest) { ListFirewallsHttpRequest that = (ListFirewallsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java index fa7f0f9e03f9..a37aeed865f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListForwardingRulesHttpRequest() { this.userIp = null; } - private ListForwardingRulesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListForwardingRulesHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListForwardingRulesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListForwardingRulesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListForwardingRulesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListForwardingRulesHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListForwardingRulesHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListForwardingRulesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListForwardingRulesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListForwardingRulesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListForwardingRulesHttpRequest) { ListForwardingRulesHttpRequest that = (ListForwardingRulesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java index 554668907450..bd891abd7674 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListGlobalAddressesHttpRequest() { this.userIp = null; } - private ListGlobalAddressesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListGlobalAddressesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListGlobalAddressesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListGlobalAddressesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListGlobalAddressesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListGlobalAddressesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListGlobalAddressesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListGlobalAddressesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListGlobalAddressesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListGlobalAddressesHttpRequest) { ListGlobalAddressesHttpRequest that = (ListGlobalAddressesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java index 06b0a928143c..5ff5a403047b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListGlobalForwardingRulesHttpRequest() { this.userIp = null; } - private ListGlobalForwardingRulesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListGlobalForwardingRulesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListGlobalForwardingRulesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListGlobalForwardingRulesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListGlobalForwardingRulesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListGlobalForwardingRulesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListGlobalForwardingRulesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListGlobalForwardingRulesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListGlobalForwardingRulesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListGlobalForwardingRulesHttpRequest) { ListGlobalForwardingRulesHttpRequest that = (ListGlobalForwardingRulesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java index 99c9f5c16299..b05ed6fcb18a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListGlobalOperationsHttpRequest() { this.userIp = null; } - private ListGlobalOperationsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListGlobalOperationsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListGlobalOperationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListGlobalOperationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListGlobalOperationsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListGlobalOperationsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListGlobalOperationsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListGlobalOperationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListGlobalOperationsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListGlobalOperationsHttpRequest) { ListGlobalOperationsHttpRequest that = (ListGlobalOperationsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java index a2d542bd77c0..c089be938173 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListHealthChecksHttpRequest() { this.userIp = null; } - private ListHealthChecksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListHealthChecksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListHealthChecksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListHealthChecksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListHealthChecksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListHealthChecksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListHealthChecksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListHealthChecksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListHealthChecksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListHealthChecksHttpRequest) { ListHealthChecksHttpRequest that = (ListHealthChecksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java index 7da5e9349dfb..b46175cf9aea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListHttpHealthChecksHttpRequest() { this.userIp = null; } - private ListHttpHealthChecksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListHttpHealthChecksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListHttpHealthChecksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListHttpHealthChecksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListHttpHealthChecksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListHttpHealthChecksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListHttpHealthChecksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListHttpHealthChecksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListHttpHealthChecksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListHttpHealthChecksHttpRequest) { ListHttpHealthChecksHttpRequest that = (ListHttpHealthChecksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java index cf63c6ff93e2..7e37b6d7686d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListHttpsHealthChecksHttpRequest() { this.userIp = null; } - private ListHttpsHealthChecksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListHttpsHealthChecksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListHttpsHealthChecksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListHttpsHealthChecksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListHttpsHealthChecksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListHttpsHealthChecksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListHttpsHealthChecksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListHttpsHealthChecksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListHttpsHealthChecksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListHttpsHealthChecksHttpRequest) { ListHttpsHealthChecksHttpRequest that = (ListHttpsHealthChecksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java index 709cda218261..2871c11599ab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListImagesHttpRequest() { this.userIp = null; } - private ListImagesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListImagesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListImagesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListImagesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListImagesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListImagesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListImagesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListImagesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListImagesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListImagesHttpRequest) { ListImagesHttpRequest that = (ListImagesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java index fc05960c2259..4a3a8e3174c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInstanceGroupManagersHttpRequest() { this.zone = null; } - private ListInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInstanceGroupManagersHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstanceGroupManagersHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListInstanceGroupManagersHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListInstanceGroupManagersHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListInstanceGroupManagersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListInstanceGroupManagersHttpRequest) { ListInstanceGroupManagersHttpRequest that = (ListInstanceGroupManagersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java index 37f448462625..065f8f3f7726 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInstanceGroupsHttpRequest() { this.zone = null; } - private ListInstanceGroupsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInstanceGroupsHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstanceGroupsHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListInstanceGroupsHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListInstanceGroupsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListInstanceGroupsHttpRequest) { ListInstanceGroupsHttpRequest that = (ListInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java index bd982d36bd7a..3dff877bf30d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInstanceTemplatesHttpRequest() { this.userIp = null; } - private ListInstanceTemplatesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInstanceTemplatesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstanceTemplatesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstanceTemplatesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstanceTemplatesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstanceTemplatesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListInstanceTemplatesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstanceTemplatesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListInstanceTemplatesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListInstanceTemplatesHttpRequest) { ListInstanceTemplatesHttpRequest that = (ListInstanceTemplatesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java index 689cf32dbe6d..35744f497336 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInstancesHttpRequest() { this.zone = null; } - private ListInstancesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInstancesHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstancesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstancesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstancesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstancesHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListInstancesHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListInstancesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstancesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListInstancesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListInstancesHttpRequest) { ListInstancesHttpRequest that = (ListInstancesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java index 8ce925c89077..3b4ef6048d60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -62,7 +59,6 @@ private ListInstancesInstanceGroupsHttpRequest() { this.userIp = null; } - private ListInstancesInstanceGroupsHttpRequest( String access_token, String callback, @@ -76,8 +72,7 @@ private ListInstancesInstanceGroupsHttpRequest( String pageToken, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -111,8 +106,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instanceGroup") && instanceGroup != null) { fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); } - if (fieldNames.contains("instanceGroupsListInstancesRequestResource") && instanceGroupsListInstancesRequestResource != null) { - fieldMap.put("instanceGroupsListInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); + if (fieldNames.contains("instanceGroupsListInstancesRequestResource") + && instanceGroupsListInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsListInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -240,22 +238,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstancesInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstancesInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstancesInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstancesInstanceGroupsHttpRequest(); } @@ -295,7 +295,8 @@ public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { this.instanceGroup = other.instanceGroup; } if (other.getInstanceGroupsListInstancesRequestResource() != null) { - this.instanceGroupsListInstancesRequestResource = other.instanceGroupsListInstancesRequestResource; + this.instanceGroupsListInstancesRequestResource = + other.instanceGroupsListInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -327,7 +328,8 @@ public Builder mergeFrom(ListInstancesInstanceGroupsHttpRequest other) { this.fields = source.fields; this.filter = source.filter; this.instanceGroup = source.instanceGroup; - this.instanceGroupsListInstancesRequestResource = source.instanceGroupsListInstancesRequestResource; + this.instanceGroupsListInstancesRequestResource = + source.instanceGroupsListInstancesRequestResource; this.key = source.key; this.maxResults = source.maxResults; this.orderBy = source.orderBy; @@ -386,7 +388,8 @@ public InstanceGroupsListInstancesRequest getInstanceGroupsListInstancesRequestR return instanceGroupsListInstancesRequestResource; } - public Builder setInstanceGroupsListInstancesRequestResource(InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { + public Builder setInstanceGroupsListInstancesRequestResource( + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource) { this.instanceGroupsListInstancesRequestResource = instanceGroupsListInstancesRequestResource; return this; } @@ -454,42 +457,30 @@ public Builder setUserIp(String userIp) { return this; } - public ListInstancesInstanceGroupsHttpRequest build() { String missing = ""; - - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstancesInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - instanceGroup, - instanceGroupsListInstancesRequestResource, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -499,7 +490,8 @@ public Builder clone() { newBuilder.setFields(this.fields); newBuilder.setFilter(this.filter); newBuilder.setInstanceGroup(this.instanceGroup); - newBuilder.setInstanceGroupsListInstancesRequestResource(this.instanceGroupsListInstancesRequestResource); + newBuilder.setInstanceGroupsListInstancesRequestResource( + this.instanceGroupsListInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setMaxResults(this.maxResults); newBuilder.setOrderBy(this.orderBy); @@ -514,19 +506,44 @@ public Builder clone() { @Override public String toString() { return "ListInstancesInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "instanceGroup=" + instanceGroup + ", " - + "instanceGroupsListInstancesRequestResource=" + instanceGroupsListInstancesRequestResource + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "instanceGroupsListInstancesRequestResource=" + + instanceGroupsListInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -537,21 +554,21 @@ public boolean equals(Object o) { } if (o instanceof ListInstancesInstanceGroupsHttpRequest) { ListInstancesInstanceGroupsHttpRequest that = (ListInstancesInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.instanceGroupsListInstancesRequestResource, that.getInstanceGroupsListInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals( + this.instanceGroupsListInstancesRequestResource, + that.getInstanceGroupsListInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -559,19 +576,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instanceGroup, - instanceGroupsListInstancesRequestResource, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroup, + instanceGroupsListInstancesRequestResource, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java index fae1f741c2e4..78bfd32bbd0a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -43,7 +40,8 @@ public final class ListInstancesRegionInstanceGroupsHttpRequest implements ApiMe private final String pageToken; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource; + private final RegionInstanceGroupsListInstancesRequest + regionInstanceGroupsListInstancesRequestResource; private final String userIp; private ListInstancesRegionInstanceGroupsHttpRequest() { @@ -62,7 +60,6 @@ private ListInstancesRegionInstanceGroupsHttpRequest() { this.userIp = null; } - private ListInstancesRegionInstanceGroupsHttpRequest( String access_token, String callback, @@ -76,8 +73,7 @@ private ListInstancesRegionInstanceGroupsHttpRequest( String prettyPrint, String quotaUser, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -89,7 +85,8 @@ private ListInstancesRegionInstanceGroupsHttpRequest( this.pageToken = pageToken; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupsListInstancesRequestResource = regionInstanceGroupsListInstancesRequestResource; + this.regionInstanceGroupsListInstancesRequestResource = + regionInstanceGroupsListInstancesRequestResource; this.userIp = userIp; } @@ -129,8 +126,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupsListInstancesRequestResource") && regionInstanceGroupsListInstancesRequestResource != null) { - fieldMap.put("regionInstanceGroupsListInstancesRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupsListInstancesRequestResource))); + if (fieldNames.contains("regionInstanceGroupsListInstancesRequestResource") + && regionInstanceGroupsListInstancesRequestResource != null) { + fieldMap.put( + "regionInstanceGroupsListInstancesRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupsListInstancesRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -232,7 +233,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupsListInstancesRequest getRegionInstanceGroupsListInstancesRequestResource() { + public RegionInstanceGroupsListInstancesRequest + getRegionInstanceGroupsListInstancesRequestResource() { return regionInstanceGroupsListInstancesRequestResource; } @@ -240,22 +242,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInstancesRegionInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInstancesRegionInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInstancesRegionInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInstancesRegionInstanceGroupsHttpRequest(); } @@ -272,7 +276,8 @@ public static class Builder { private String pageToken; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource; + private RegionInstanceGroupsListInstancesRequest + regionInstanceGroupsListInstancesRequestResource; private String userIp; Builder() {} @@ -313,7 +318,8 @@ public Builder mergeFrom(ListInstancesRegionInstanceGroupsHttpRequest other) { this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupsListInstancesRequestResource() != null) { - this.regionInstanceGroupsListInstancesRequestResource = other.regionInstanceGroupsListInstancesRequestResource; + this.regionInstanceGroupsListInstancesRequestResource = + other.regionInstanceGroupsListInstancesRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -333,7 +339,8 @@ public Builder mergeFrom(ListInstancesRegionInstanceGroupsHttpRequest other) { this.pageToken = source.pageToken; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupsListInstancesRequestResource = source.regionInstanceGroupsListInstancesRequestResource; + this.regionInstanceGroupsListInstancesRequestResource = + source.regionInstanceGroupsListInstancesRequestResource; this.userIp = source.userIp; } @@ -436,12 +443,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupsListInstancesRequest getRegionInstanceGroupsListInstancesRequestResource() { + public RegionInstanceGroupsListInstancesRequest + getRegionInstanceGroupsListInstancesRequestResource() { return regionInstanceGroupsListInstancesRequestResource; } - public Builder setRegionInstanceGroupsListInstancesRequestResource(RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { - this.regionInstanceGroupsListInstancesRequestResource = regionInstanceGroupsListInstancesRequestResource; + public Builder setRegionInstanceGroupsListInstancesRequestResource( + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { + this.regionInstanceGroupsListInstancesRequestResource = + regionInstanceGroupsListInstancesRequestResource; return this; } @@ -454,42 +464,30 @@ public Builder setUserIp(String userIp) { return this; } - public ListInstancesRegionInstanceGroupsHttpRequest build() { String missing = ""; - - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInstancesRegionInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - instanceGroup, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - regionInstanceGroupsListInstancesRequestResource, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroup, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + regionInstanceGroupsListInstancesRequestResource, + userIp); } public Builder clone() { @@ -505,7 +503,8 @@ public Builder clone() { newBuilder.setPageToken(this.pageToken); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupsListInstancesRequestResource(this.regionInstanceGroupsListInstancesRequestResource); + newBuilder.setRegionInstanceGroupsListInstancesRequestResource( + this.regionInstanceGroupsListInstancesRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -514,19 +513,44 @@ public Builder clone() { @Override public String toString() { return "ListInstancesRegionInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "instanceGroup=" + instanceGroup + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupsListInstancesRequestResource=" + regionInstanceGroupsListInstancesRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupsListInstancesRequestResource=" + + regionInstanceGroupsListInstancesRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -536,22 +560,23 @@ public boolean equals(Object o) { return true; } if (o instanceof ListInstancesRegionInstanceGroupsHttpRequest) { - ListInstancesRegionInstanceGroupsHttpRequest that = (ListInstancesRegionInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupsListInstancesRequestResource, that.getRegionInstanceGroupsListInstancesRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + ListInstancesRegionInstanceGroupsHttpRequest that = + (ListInstancesRegionInstanceGroupsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupsListInstancesRequestResource, + that.getRegionInstanceGroupsListInstancesRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -559,19 +584,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instanceGroup, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - regionInstanceGroupsListInstancesRequestResource, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroup, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + regionInstanceGroupsListInstancesRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java index b144bd21afbe..4314af4017c7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInterconnectAttachmentsHttpRequest() { this.userIp = null; } - private ListInterconnectAttachmentsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInterconnectAttachmentsHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInterconnectAttachmentsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInterconnectAttachmentsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInterconnectAttachmentsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInterconnectAttachmentsHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListInterconnectAttachmentsHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListInterconnectAttachmentsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInterconnectAttachmentsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListInterconnectAttachmentsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListInterconnectAttachmentsHttpRequest) { ListInterconnectAttachmentsHttpRequest that = (ListInterconnectAttachmentsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java index 1868751cd7b6..35b25d7679e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInterconnectLocationsHttpRequest() { this.userIp = null; } - private ListInterconnectLocationsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInterconnectLocationsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInterconnectLocationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInterconnectLocationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInterconnectLocationsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInterconnectLocationsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListInterconnectLocationsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInterconnectLocationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListInterconnectLocationsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListInterconnectLocationsHttpRequest) { ListInterconnectLocationsHttpRequest that = (ListInterconnectLocationsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java index f3ce98d47a54..a8099c0b40ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListInterconnectsHttpRequest() { this.userIp = null; } - private ListInterconnectsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListInterconnectsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListInterconnectsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListInterconnectsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListInterconnectsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListInterconnectsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListInterconnectsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListInterconnectsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListInterconnectsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListInterconnectsHttpRequest) { ListInterconnectsHttpRequest that = (ListInterconnectsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java new file mode 100644 index 000000000000..965e04fc88f5 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java @@ -0,0 +1,549 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListLicensesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListLicensesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + private ListLicensesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListLicensesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListLicensesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListLicensesHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListLicensesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListLicensesHttpRequest other) { + if (other == ListLicensesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListLicensesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListLicensesHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListLicensesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListLicensesHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListLicensesHttpRequest) { + ListLicensesHttpRequest that = (ListLicensesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java index ca62639c1a7f..1c468d4aab5f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListMachineTypesHttpRequest() { this.zone = null; } - private ListMachineTypesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListMachineTypesHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListMachineTypesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListMachineTypesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListMachineTypesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListMachineTypesHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListMachineTypesHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListMachineTypesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListMachineTypesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListMachineTypesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListMachineTypesHttpRequest) { ListMachineTypesHttpRequest that = (ListMachineTypesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java index e1db51e1a4b1..fd91b32e5133 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListManagedInstancesInstanceGroupManagersHttpRequest() { this.userIp = null; } - private ListManagedInstancesInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListManagedInstancesInstanceGroupManagersHttpRequest( String pageToken, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -105,7 +100,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -226,22 +222,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListManagedInstancesInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListManagedInstancesInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListManagedInstancesInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListManagedInstancesInstanceGroupManagersHttpRequest(); } @@ -263,7 +261,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(ListManagedInstancesInstanceGroupManagersHttpRequest other) { - if (other == ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other == ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -426,40 +425,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListManagedInstancesInstanceGroupManagersHttpRequest build() { String missing = ""; - - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListManagedInstancesInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - instanceGroupManager, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +471,41 @@ public Builder clone() { @Override public String toString() { return "ListManagedInstancesInstanceGroupManagersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +515,20 @@ public boolean equals(Object o) { return true; } if (o instanceof ListManagedInstancesInstanceGroupManagersHttpRequest) { - ListManagedInstancesInstanceGroupManagersHttpRequest that = (ListManagedInstancesInstanceGroupManagersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + ListManagedInstancesInstanceGroupManagersHttpRequest that = + (ListManagedInstancesInstanceGroupManagersHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +536,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instanceGroupManager, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java index af2a3b23a7db..38a4ca194dff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -31,7 +28,8 @@ @Generated("by GAPIC") @BetaApi -public final class ListManagedInstancesRegionInstanceGroupManagersHttpRequest implements ApiMessage { +public final class ListManagedInstancesRegionInstanceGroupManagersHttpRequest + implements ApiMessage { private final String access_token; private final String callback; private final String fields; @@ -60,7 +58,6 @@ private ListManagedInstancesRegionInstanceGroupManagersHttpRequest() { this.userIp = null; } - private ListManagedInstancesRegionInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -73,8 +70,7 @@ private ListManagedInstancesRegionInstanceGroupManagersHttpRequest( String pageToken, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -105,7 +101,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -226,22 +223,25 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(ListManagedInstancesRegionInstanceGroupManagersHttpRequest prototype) { + + public static Builder newBuilder( + ListManagedInstancesRegionInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListManagedInstancesRegionInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListManagedInstancesRegionInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListManagedInstancesRegionInstanceGroupManagersHttpRequest(); } @@ -263,7 +263,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(ListManagedInstancesRegionInstanceGroupManagersHttpRequest other) { - if (other == ListManagedInstancesRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) return this; + if (other == ListManagedInstancesRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -426,40 +427,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListManagedInstancesRegionInstanceGroupManagersHttpRequest build() { String missing = ""; - - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListManagedInstancesRegionInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - instanceGroupManager, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +473,41 @@ public Builder clone() { @Override public String toString() { return "ListManagedInstancesRegionInstanceGroupManagersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +517,20 @@ public boolean equals(Object o) { return true; } if (o instanceof ListManagedInstancesRegionInstanceGroupManagersHttpRequest) { - ListManagedInstancesRegionInstanceGroupManagersHttpRequest that = (ListManagedInstancesRegionInstanceGroupManagersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + ListManagedInstancesRegionInstanceGroupManagersHttpRequest that = + (ListManagedInstancesRegionInstanceGroupManagersHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +538,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instanceGroupManager, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instanceGroupManager, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java index a042b64daca9..3833c085e618 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListNetworksHttpRequest() { this.userIp = null; } - private ListNetworksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListNetworksHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListNetworksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListNetworksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListNetworksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListNetworksHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListNetworksHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListNetworksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListNetworksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListNetworksHttpRequest) { ListNetworksHttpRequest that = (ListNetworksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java index 4f6771093068..fecf7b8aac5b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListReferrersInstancesHttpRequest() { this.userIp = null; } - private ListReferrersInstancesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListReferrersInstancesHttpRequest( String pageToken, String prettyPrint, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListReferrersInstancesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListReferrersInstancesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListReferrersInstancesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListReferrersInstancesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListReferrersInstancesHttpRequest build() { String missing = ""; - - - if (instance == null) { missing += " instance"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListReferrersInstancesHttpRequest( - access_token, - callback, - fields, - filter, - instance, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instance, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListReferrersInstancesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListReferrersInstancesHttpRequest) { ListReferrersInstancesHttpRequest that = (ListReferrersInstancesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - instance, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + instance, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java index fe7547813893..fa2545c4b03d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionAutoscalersHttpRequest() { this.userIp = null; } - private ListRegionAutoscalersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionAutoscalersHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionAutoscalersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionAutoscalersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionAutoscalersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionAutoscalersHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionAutoscalersHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionAutoscalersHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionAutoscalersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionAutoscalersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionAutoscalersHttpRequest) { ListRegionAutoscalersHttpRequest that = (ListRegionAutoscalersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java index d80fd2babb50..584dc381f80e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionBackendServicesHttpRequest() { this.userIp = null; } - private ListRegionBackendServicesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionBackendServicesHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionBackendServicesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionBackendServicesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionBackendServicesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionBackendServicesHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionBackendServicesHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionBackendServicesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionBackendServicesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionBackendServicesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionBackendServicesHttpRequest) { ListRegionBackendServicesHttpRequest that = (ListRegionBackendServicesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java index 5c298e9abd5d..4a991b0cb9c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionCommitmentsHttpRequest() { this.userIp = null; } - private ListRegionCommitmentsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionCommitmentsHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionCommitmentsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionCommitmentsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionCommitmentsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionCommitmentsHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionCommitmentsHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionCommitmentsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionCommitmentsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionCommitmentsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionCommitmentsHttpRequest) { ListRegionCommitmentsHttpRequest that = (ListRegionCommitmentsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java index cd58b0310b81..ce71d45770a6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionInstanceGroupManagersHttpRequest() { this.userIp = null; } - private ListRegionInstanceGroupManagersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionInstanceGroupManagersHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionInstanceGroupManagersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionInstanceGroupManagersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionInstanceGroupManagersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionInstanceGroupManagersHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionInstanceGroupManagersHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionInstanceGroupManagersHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionInstanceGroupManagersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionInstanceGroupManagersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -504,21 +513,20 @@ public boolean equals(Object o) { return true; } if (o instanceof ListRegionInstanceGroupManagersHttpRequest) { - ListRegionInstanceGroupManagersHttpRequest that = (ListRegionInstanceGroupManagersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + ListRegionInstanceGroupManagersHttpRequest that = + (ListRegionInstanceGroupManagersHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +534,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java index a9a73a4bcd3d..22da113346da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionInstanceGroupsHttpRequest() { this.userIp = null; } - private ListRegionInstanceGroupsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionInstanceGroupsHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionInstanceGroupsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionInstanceGroupsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionInstanceGroupsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionInstanceGroupsHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionInstanceGroupsHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionInstanceGroupsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionInstanceGroupsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionInstanceGroupsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionInstanceGroupsHttpRequest) { ListRegionInstanceGroupsHttpRequest that = (ListRegionInstanceGroupsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java index d5ac4a3a9c94..371fc05e0284 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionOperationsHttpRequest() { this.userIp = null; } - private ListRegionOperationsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionOperationsHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionOperationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionOperationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionOperationsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionOperationsHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionOperationsHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRegionOperationsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionOperationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionOperationsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionOperationsHttpRequest) { ListRegionOperationsHttpRequest that = (ListRegionOperationsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java index 5a6b9b5b0170..4f87e0ad4103 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRegionsHttpRequest() { this.userIp = null; } - private ListRegionsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRegionsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRegionsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRegionsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRegionsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRegionsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListRegionsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRegionsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRegionsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRegionsHttpRequest) { ListRegionsHttpRequest that = (ListRegionsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java index 716360bfb585..2a4e4adb9262 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRoutersHttpRequest() { this.userIp = null; } - private ListRoutersHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRoutersHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRoutersHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRoutersHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRoutersHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRoutersHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListRoutersHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListRoutersHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRoutersHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRoutersHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRoutersHttpRequest) { ListRoutersHttpRequest that = (ListRoutersHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java index 0f1402be0cd4..766e05a72202 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListRoutesHttpRequest() { this.userIp = null; } - private ListRoutesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListRoutesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListRoutesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListRoutesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListRoutesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListRoutesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListRoutesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListRoutesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListRoutesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListRoutesHttpRequest) { ListRoutesHttpRequest that = (ListRoutesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java index 469f4f722d02..c6fb14db309c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListSnapshotsHttpRequest() { this.userIp = null; } - private ListSnapshotsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListSnapshotsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListSnapshotsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListSnapshotsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListSnapshotsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListSnapshotsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListSnapshotsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListSnapshotsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListSnapshotsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListSnapshotsHttpRequest) { ListSnapshotsHttpRequest that = (ListSnapshotsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java index 511de85bfd2a..7df078c07b2f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListSslCertificatesHttpRequest() { this.userIp = null; } - private ListSslCertificatesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListSslCertificatesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListSslCertificatesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListSslCertificatesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListSslCertificatesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListSslCertificatesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListSslCertificatesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListSslCertificatesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListSslCertificatesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListSslCertificatesHttpRequest) { ListSslCertificatesHttpRequest that = (ListSslCertificatesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java new file mode 100644 index 000000000000..4e8674f51aa7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java @@ -0,0 +1,549 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListSslPoliciesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListSslPoliciesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + private ListSslPoliciesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("project")) { + return String.valueOf(project); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListSslPoliciesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListSslPoliciesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListSslPoliciesHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListSslPoliciesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListSslPoliciesHttpRequest other) { + if (other == ListSslPoliciesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListSslPoliciesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListSslPoliciesHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListSslPoliciesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListSslPoliciesHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListSslPoliciesHttpRequest) { + ListSslPoliciesHttpRequest that = (ListSslPoliciesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java index 72fccac743d5..30ba879d6c92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListSubnetworksHttpRequest() { this.userIp = null; } - private ListSubnetworksHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListSubnetworksHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListSubnetworksHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListSubnetworksHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListSubnetworksHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListSubnetworksHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListSubnetworksHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListSubnetworksHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListSubnetworksHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListSubnetworksHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListSubnetworksHttpRequest) { ListSubnetworksHttpRequest that = (ListSubnetworksHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java index ad3429da957d..103aaf931bfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetHttpProxiesHttpRequest() { this.userIp = null; } - private ListTargetHttpProxiesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetHttpProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetHttpProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetHttpProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetHttpProxiesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetHttpProxiesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetHttpProxiesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetHttpProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetHttpProxiesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetHttpProxiesHttpRequest) { ListTargetHttpProxiesHttpRequest that = (ListTargetHttpProxiesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java index 7d0d7cdadfbf..530a1db7d30f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetHttpsProxiesHttpRequest() { this.userIp = null; } - private ListTargetHttpsProxiesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetHttpsProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetHttpsProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetHttpsProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetHttpsProxiesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetHttpsProxiesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetHttpsProxiesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetHttpsProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetHttpsProxiesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetHttpsProxiesHttpRequest) { ListTargetHttpsProxiesHttpRequest that = (ListTargetHttpsProxiesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java index 53709f611142..d0573cfc9162 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetInstancesHttpRequest() { this.zone = null; } - private ListTargetInstancesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetInstancesHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetInstancesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetInstancesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetInstancesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetInstancesHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListTargetInstancesHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListTargetInstancesHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetInstancesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetInstancesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetInstancesHttpRequest) { ListTargetInstancesHttpRequest that = (ListTargetInstancesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java index 15f3b3fc6c72..758a7b8191a6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetPoolsHttpRequest() { this.userIp = null; } - private ListTargetPoolsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetPoolsHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetPoolsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetPoolsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetPoolsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetPoolsHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetPoolsHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListTargetPoolsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetPoolsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetPoolsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetPoolsHttpRequest) { ListTargetPoolsHttpRequest that = (ListTargetPoolsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java index ae290b934b14..468717b78089 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetSslProxiesHttpRequest() { this.userIp = null; } - private ListTargetSslProxiesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetSslProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetSslProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetSslProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetSslProxiesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetSslProxiesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetSslProxiesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetSslProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetSslProxiesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetSslProxiesHttpRequest) { ListTargetSslProxiesHttpRequest that = (ListTargetSslProxiesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java index 276d37c215fa..2ac3f7bd32c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetTcpProxiesHttpRequest() { this.userIp = null; } - private ListTargetTcpProxiesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetTcpProxiesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetTcpProxiesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetTcpProxiesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetTcpProxiesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetTcpProxiesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetTcpProxiesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetTcpProxiesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetTcpProxiesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetTcpProxiesHttpRequest) { ListTargetTcpProxiesHttpRequest that = (ListTargetTcpProxiesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java index 8916ab7b9b5b..db242544a50d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListTargetVpnGatewaysHttpRequest() { this.userIp = null; } - private ListTargetVpnGatewaysHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListTargetVpnGatewaysHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListTargetVpnGatewaysHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListTargetVpnGatewaysHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListTargetVpnGatewaysHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListTargetVpnGatewaysHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListTargetVpnGatewaysHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListTargetVpnGatewaysHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListTargetVpnGatewaysHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListTargetVpnGatewaysHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListTargetVpnGatewaysHttpRequest) { ListTargetVpnGatewaysHttpRequest that = (ListTargetVpnGatewaysHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java index 7cc5342dd488..553367d73cd3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListUrlMapsHttpRequest() { this.userIp = null; } - private ListUrlMapsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListUrlMapsHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListUrlMapsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListUrlMapsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListUrlMapsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListUrlMapsHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListUrlMapsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListUrlMapsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListUrlMapsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListUrlMapsHttpRequest) { ListUrlMapsHttpRequest that = (ListUrlMapsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java index 56b33e876276..d269ea2a36aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListVpnTunnelsHttpRequest() { this.userIp = null; } - private ListVpnTunnelsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListVpnTunnelsHttpRequest( String prettyPrint, String quotaUser, String region, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListVpnTunnelsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListVpnTunnelsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListVpnTunnelsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListVpnTunnelsHttpRequest(); } @@ -426,19 +423,9 @@ public Builder setUserIp(String userIp) { return this; } - public ListVpnTunnelsHttpRequest build() { String missing = ""; - - - - - - - - - if (region == null) { missing += " region"; } @@ -447,19 +434,18 @@ public ListVpnTunnelsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListVpnTunnelsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListVpnTunnelsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListVpnTunnelsHttpRequest) { ListVpnTunnelsHttpRequest that = (ListVpnTunnelsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - region, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java index 09729a2b645f..0419581ecf6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -62,7 +59,6 @@ private ListXpnHostsProjectsHttpRequest() { this.userIp = null; } - private ListXpnHostsProjectsHttpRequest( String access_token, String callback, @@ -76,8 +72,7 @@ private ListXpnHostsProjectsHttpRequest( String project, ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -126,8 +121,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("project") && project != null) { fieldMap.put("project", Collections.singletonList(String.valueOf(project))); } - if (fieldNames.contains("projectsListXpnHostsRequestResource") && projectsListXpnHostsRequestResource != null) { - fieldMap.put("projectsListXpnHostsRequestResource", Collections.singletonList(String.valueOf(projectsListXpnHostsRequestResource))); + if (fieldNames.contains("projectsListXpnHostsRequestResource") + && projectsListXpnHostsRequestResource != null) { + fieldMap.put( + "projectsListXpnHostsRequestResource", + Collections.singletonList(String.valueOf(projectsListXpnHostsRequestResource))); } if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); @@ -240,22 +238,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListXpnHostsProjectsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListXpnHostsProjectsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListXpnHostsProjectsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListXpnHostsProjectsHttpRequest(); } @@ -431,7 +431,8 @@ public ProjectsListXpnHostsRequest getProjectsListXpnHostsRequestResource() { return projectsListXpnHostsRequestResource; } - public Builder setProjectsListXpnHostsRequestResource(ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) { + public Builder setProjectsListXpnHostsRequestResource( + ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) { this.projectsListXpnHostsRequestResource = projectsListXpnHostsRequestResource; return this; } @@ -454,42 +455,30 @@ public Builder setUserIp(String userIp) { return this; } - public ListXpnHostsProjectsHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListXpnHostsProjectsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - projectsListXpnHostsRequestResource, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + projectsListXpnHostsRequestResource, + quotaUser, + userIp); } public Builder clone() { @@ -514,19 +503,44 @@ public Builder clone() { @Override public String toString() { return "ListXpnHostsProjectsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "projectsListXpnHostsRequestResource=" + projectsListXpnHostsRequestResource + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "projectsListXpnHostsRequestResource=" + + projectsListXpnHostsRequestResource + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -537,21 +551,21 @@ public boolean equals(Object o) { } if (o instanceof ListXpnHostsProjectsHttpRequest) { ListXpnHostsProjectsHttpRequest that = (ListXpnHostsProjectsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.projectsListXpnHostsRequestResource, that.getProjectsListXpnHostsRequestResource()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals( + this.projectsListXpnHostsRequestResource, + that.getProjectsListXpnHostsRequestResource()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -559,19 +573,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - projectsListXpnHostsRequestResource, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + projectsListXpnHostsRequestResource, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java index 8289de971b9c..9ecdd6e33fd3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListZoneOperationsHttpRequest() { this.zone = null; } - private ListZoneOperationsHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListZoneOperationsHttpRequest( String prettyPrint, String quotaUser, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListZoneOperationsHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListZoneOperationsHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListZoneOperationsHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListZoneOperationsHttpRequest(); } @@ -426,20 +423,9 @@ public Builder setZone(String zone) { return this; } - public ListZoneOperationsHttpRequest build() { String missing = ""; - - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -447,19 +433,18 @@ public ListZoneOperationsHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ListZoneOperationsHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } public Builder clone() { @@ -483,18 +468,41 @@ public Builder clone() { @Override public String toString() { return "ListZoneOperationsHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -505,20 +513,18 @@ public boolean equals(Object o) { } if (o instanceof ListZoneOperationsHttpRequest) { ListZoneOperationsHttpRequest that = (ListZoneOperationsHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -526,18 +532,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - quotaUser, - userIp, - zone - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java index 469fbc73477c..7054df81e8f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -60,7 +57,6 @@ private ListZonesHttpRequest() { this.userIp = null; } - private ListZonesHttpRequest( String access_token, String callback, @@ -73,8 +69,7 @@ private ListZonesHttpRequest( String prettyPrint, String project, String quotaUser, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -226,22 +221,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ListZonesHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ListZonesHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ListZonesHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ListZonesHttpRequest(); } @@ -426,40 +423,29 @@ public Builder setUserIp(String userIp) { return this; } - public ListZonesHttpRequest build() { String missing = ""; - - - - - - - - if (project == null) { missing += " project"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ListZonesHttpRequest( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } public Builder clone() { @@ -483,18 +469,41 @@ public Builder clone() { @Override public String toString() { return "ListZonesHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "filter=" + filter + ", " - + "key=" + key + ", " - + "maxResults=" + maxResults + ", " - + "orderBy=" + orderBy + ", " - + "pageToken=" + pageToken + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + "}"; } @@ -505,20 +514,18 @@ public boolean equals(Object o) { } if (o instanceof ListZonesHttpRequest) { ListZonesHttpRequest that = (ListZonesHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.filter, that.getFilter()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.maxResults, that.getMaxResults()) && - Objects.equals(this.orderBy, that.getOrderBy()) && - Objects.equals(this.pageToken, that.getPageToken()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -526,18 +533,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - filter, - key, - maxResults, - orderBy, - pageToken, - prettyPrint, - project, - quotaUser, - userIp - ); + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java index 002ca334dc5e..c85c7f8f01bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -66,7 +65,6 @@ private MachineType() { this.zone = null; } - private MachineType( String creationTimestamp, DeprecationStatus deprecated, @@ -82,8 +80,7 @@ private MachineType( String name, List scratchDisks, String selfLink, - String zone - ) { + String zone) { this.creationTimestamp = creationTimestamp; this.deprecated = deprecated; this.description = description; @@ -105,7 +102,8 @@ private MachineType( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("deprecated") && deprecated != null) { fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); @@ -129,10 +127,15 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } if (fieldNames.contains("maximumPersistentDisks") && maximumPersistentDisks != null) { - fieldMap.put("maximumPersistentDisks", Collections.singletonList(String.valueOf(maximumPersistentDisks))); + fieldMap.put( + "maximumPersistentDisks", + Collections.singletonList(String.valueOf(maximumPersistentDisks))); } - if (fieldNames.contains("maximumPersistentDisksSizeGb") && maximumPersistentDisksSizeGb != null) { - fieldMap.put("maximumPersistentDisksSizeGb", Collections.singletonList(String.valueOf(maximumPersistentDisksSizeGb))); + if (fieldNames.contains("maximumPersistentDisksSizeGb") + && maximumPersistentDisksSizeGb != null) { + fieldMap.put( + "maximumPersistentDisksSizeGb", + Collections.singletonList(String.valueOf(maximumPersistentDisksSizeGb))); } if (fieldNames.contains("memoryMb") && memoryMb != null) { fieldMap.put("memoryMb", Collections.singletonList(String.valueOf(memoryMb))); @@ -272,22 +275,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(MachineType prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static MachineType getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final MachineType DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new MachineType(); } @@ -522,39 +527,24 @@ public Builder setZone(String zone) { return this; } - public MachineType build() { - - - - - - - - - - - - - return new MachineType( - creationTimestamp, - deprecated, - description, - guestCpus, - id, - imageSpaceGb, - isSharedCpu, - kind, - maximumPersistentDisks, - maximumPersistentDisksSizeGb, - memoryMb, - name, - scratchDisks, - selfLink, - zone - ); + creationTimestamp, + deprecated, + description, + guestCpus, + id, + imageSpaceGb, + isSharedCpu, + kind, + maximumPersistentDisks, + maximumPersistentDisksSizeGb, + memoryMb, + name, + scratchDisks, + selfLink, + zone); } public Builder clone() { @@ -581,21 +571,50 @@ public Builder clone() { @Override public String toString() { return "MachineType{" - + "creationTimestamp=" + creationTimestamp + ", " - + "deprecated=" + deprecated + ", " - + "description=" + description + ", " - + "guestCpus=" + guestCpus + ", " - + "id=" + id + ", " - + "imageSpaceGb=" + imageSpaceGb + ", " - + "isSharedCpu=" + isSharedCpu + ", " - + "kind=" + kind + ", " - + "maximumPersistentDisks=" + maximumPersistentDisks + ", " - + "maximumPersistentDisksSizeGb=" + maximumPersistentDisksSizeGb + ", " - + "memoryMb=" + memoryMb + ", " - + "name=" + name + ", " - + "scratchDisks=" + scratchDisks + ", " - + "selfLink=" + selfLink + ", " - + "zone=" + zone + + "creationTimestamp=" + + creationTimestamp + + ", " + + "deprecated=" + + deprecated + + ", " + + "description=" + + description + + ", " + + "guestCpus=" + + guestCpus + + ", " + + "id=" + + id + + ", " + + "imageSpaceGb=" + + imageSpaceGb + + ", " + + "isSharedCpu=" + + isSharedCpu + + ", " + + "kind=" + + kind + + ", " + + "maximumPersistentDisks=" + + maximumPersistentDisks + + ", " + + "maximumPersistentDisksSizeGb=" + + maximumPersistentDisksSizeGb + + ", " + + "memoryMb=" + + memoryMb + + ", " + + "name=" + + name + + ", " + + "scratchDisks=" + + scratchDisks + + ", " + + "selfLink=" + + selfLink + + ", " + + "zone=" + + zone + "}"; } @@ -606,23 +625,22 @@ public boolean equals(Object o) { } if (o instanceof MachineType) { MachineType that = (MachineType) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.deprecated, that.getDeprecated()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.guestCpus, that.getGuestCpus()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.imageSpaceGb, that.getImageSpaceGb()) && - Objects.equals(this.isSharedCpu, that.getIsSharedCpu()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.maximumPersistentDisks, that.getMaximumPersistentDisks()) && - Objects.equals(this.maximumPersistentDisksSizeGb, that.getMaximumPersistentDisksSizeGb()) && - Objects.equals(this.memoryMb, that.getMemoryMb()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.scratchDisks, that.getScratchDisksList()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.guestCpus, that.getGuestCpus()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.imageSpaceGb, that.getImageSpaceGb()) + && Objects.equals(this.isSharedCpu, that.getIsSharedCpu()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.maximumPersistentDisks, that.getMaximumPersistentDisks()) + && Objects.equals( + this.maximumPersistentDisksSizeGb, that.getMaximumPersistentDisksSizeGb()) + && Objects.equals(this.memoryMb, that.getMemoryMb()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.scratchDisks, that.getScratchDisksList()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -630,21 +648,20 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - deprecated, - description, - guestCpus, - id, - imageSpaceGb, - isSharedCpu, - kind, - maximumPersistentDisks, - maximumPersistentDisksSizeGb, - memoryMb, - name, - scratchDisks, - selfLink, - zone - ); + creationTimestamp, + deprecated, + description, + guestCpus, + id, + imageSpaceGb, + isSharedCpu, + kind, + maximumPersistentDisks, + maximumPersistentDisksSizeGb, + memoryMb, + name, + scratchDisks, + selfLink, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java index 9e54ac011d08..9f950f37c44a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private MachineTypeAggregatedList() { this.warning = null; } - private MachineTypeAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(MachineTypeAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static MachineTypeAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final MachineTypeAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new MachineTypeAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public MachineTypeAggregatedList build() { - - - - - return new MachineTypeAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new MachineTypeAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "MachineTypeAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof MachineTypeAggregatedList) { MachineTypeAggregatedList that = (MachineTypeAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java index 13cd6c8012e3..2d8209cba1aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.MachineTypeStub; import com.google.cloud.compute.v1.stub.MachineTypeStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,33 @@ * *

* - *

Note: close() needs to be called on the machineTypeClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the machineTypeClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of MachineTypeSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +104,14 @@ public class MachineTypeClient implements BackgroundResource {
   private final MachineTypeSettings settings;
   private final MachineTypeStub stub;
 
-
-
-  /**
-   * Constructs an instance of MachineTypeClient with default settings.
-   */
+  /** Constructs an instance of MachineTypeClient with default settings. */
   public static final MachineTypeClient create() throws IOException {
     return create(MachineTypeSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of MachineTypeClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of MachineTypeClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final MachineTypeClient create(MachineTypeSettings settings) throws IOException {
     return new MachineTypeClient(settings);
@@ -143,9 +127,9 @@ public static final MachineTypeClient create(MachineTypeStub stub) {
   }
 
   /**
-   * Constructs an instance of MachineTypeClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of MachineTypeClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected MachineTypeClient(MachineTypeSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +151,12 @@ public MachineTypeStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of machine types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -186,11 +170,12 @@ public MachineTypeStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(ProjectName project) {
+  public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
+      ProjectName project) {
     AggregatedListMachineTypesHttpRequest request =
         AggregatedListMachineTypesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListMachineTypes(request);
   }
 
@@ -198,7 +183,8 @@ public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
   /**
    * Retrieves an aggregated list of machine types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -214,9 +200,7 @@ public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
   @BetaApi
   public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(String project) {
     AggregatedListMachineTypesHttpRequest request =
-        AggregatedListMachineTypesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListMachineTypesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListMachineTypes(request);
   }
 
@@ -224,7 +208,8 @@ public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
   /**
    * Retrieves an aggregated list of machine types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +226,17 @@ public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(AggregatedListMachineTypesHttpRequest request) {
-    return aggregatedListMachineTypesPagedCallable()
-        .call(request);
+  public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
+      AggregatedListMachineTypesHttpRequest request) {
+    return aggregatedListMachineTypesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of machine types.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +252,9 @@ public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes(
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListMachineTypesPagedCallable() { + public final UnaryCallable< + AggregatedListMachineTypesHttpRequest, AggregatedListMachineTypesPagedResponse> + aggregatedListMachineTypesPagedCallable() { return stub.aggregatedListMachineTypesPagedCallable(); } @@ -274,7 +262,8 @@ public final UnaryCallableSample code: + * *

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,15 +286,18 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListMachineTypesCallable() { + public final UnaryCallable + aggregatedListMachineTypesCallable() { return stub.aggregatedListMachineTypesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified machine type. Get a list of available machine types by making a list() request. + * Returns the specified machine type. Get a list of available machine types by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
@@ -321,16 +313,18 @@ public final MachineType getMachineType(ProjectZoneMachineTypeName machineType)
 
     GetMachineTypeHttpRequest request =
         GetMachineTypeHttpRequest.newBuilder()
-        .setMachineType(machineType == null ? null : machineType.toString())
-        .build();
+            .setMachineType(machineType == null ? null : machineType.toString())
+            .build();
     return getMachineType(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified machine type. Get a list of available machine types by making a list() request.
+   * Returns the specified machine type. Get a list of available machine types by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
@@ -345,17 +339,17 @@ public final MachineType getMachineType(ProjectZoneMachineTypeName machineType)
   public final MachineType getMachineType(String machineType) {
 
     GetMachineTypeHttpRequest request =
-        GetMachineTypeHttpRequest.newBuilder()
-        .setMachineType(machineType)
-        .build();
+        GetMachineTypeHttpRequest.newBuilder().setMachineType(machineType).build();
     return getMachineType(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified machine type. Get a list of available machine types by making a list() request.
+   * Returns the specified machine type. Get a list of available machine types by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
@@ -376,9 +370,11 @@ public final MachineType getMachineType(GetMachineTypeHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified machine type. Get a list of available machine types by making a list() request.
+   * Returns the specified machine type. Get a list of available machine types by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]");
@@ -400,7 +396,8 @@ public final UnaryCallable getMachineTyp
   /**
    * Retrieves a list of machine types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -417,8 +414,8 @@ public final UnaryCallable getMachineTyp
   public final ListMachineTypesPagedResponse listMachineTypes(ProjectZoneName zone) {
     ListMachineTypesHttpRequest request =
         ListMachineTypesHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listMachineTypes(request);
   }
 
@@ -426,7 +423,8 @@ public final ListMachineTypesPagedResponse listMachineTypes(ProjectZoneName zone
   /**
    * Retrieves a list of machine types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -442,9 +440,7 @@ public final ListMachineTypesPagedResponse listMachineTypes(ProjectZoneName zone
   @BetaApi
   public final ListMachineTypesPagedResponse listMachineTypes(String zone) {
     ListMachineTypesHttpRequest request =
-        ListMachineTypesHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListMachineTypesHttpRequest.newBuilder().setZone(zone).build();
     return listMachineTypes(request);
   }
 
@@ -452,7 +448,8 @@ public final ListMachineTypesPagedResponse listMachineTypes(String zone) {
   /**
    * Retrieves a list of machine types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -470,15 +467,15 @@ public final ListMachineTypesPagedResponse listMachineTypes(String zone) {
    */
   @BetaApi
   public final ListMachineTypesPagedResponse listMachineTypes(ListMachineTypesHttpRequest request) {
-    return listMachineTypesPagedCallable()
-        .call(request);
+    return listMachineTypesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of machine types available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -494,7 +491,8 @@ public final ListMachineTypesPagedResponse listMachineTypes(ListMachineTypesHttp
    * 
*/ @BetaApi - public final UnaryCallable listMachineTypesPagedCallable() { + public final UnaryCallable + listMachineTypesPagedCallable() { return stub.listMachineTypesPagedCallable(); } @@ -502,7 +500,8 @@ public final UnaryCallableSample code: + * *

    * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -525,12 +524,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listMachineTypesCallable() { + public final UnaryCallable + listMachineTypesCallable() { return stub.listMachineTypesCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -559,23 +559,26 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListMachineTypesPagedResponse extends AbstractPagedListResponse< - AggregatedListMachineTypesHttpRequest, - MachineTypeAggregatedList, - MachineTypesScopedList, - AggregatedListMachineTypesPage, - AggregatedListMachineTypesFixedSizeCollection> { + public static class AggregatedListMachineTypesPagedResponse + extends AbstractPagedListResponse< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, MachineTypesScopedList, + AggregatedListMachineTypesPage, AggregatedListMachineTypesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, + MachineTypesScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = AggregatedListMachineTypesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListMachineTypesPage, AggregatedListMachineTypesPagedResponse>() { @Override - public AggregatedListMachineTypesPagedResponse apply(AggregatedListMachineTypesPage input) { + public AggregatedListMachineTypesPagedResponse apply( + AggregatedListMachineTypesPage input) { return new AggregatedListMachineTypesPagedResponse(input); } }); @@ -584,18 +587,18 @@ public AggregatedListMachineTypesPagedResponse apply(AggregatedListMachineTypesP private AggregatedListMachineTypesPagedResponse(AggregatedListMachineTypesPage page) { super(page, AggregatedListMachineTypesFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListMachineTypesPage extends AbstractPage< - AggregatedListMachineTypesHttpRequest, - MachineTypeAggregatedList, - MachineTypesScopedList, - AggregatedListMachineTypesPage> { + public static class AggregatedListMachineTypesPage + extends AbstractPage< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, MachineTypesScopedList, + AggregatedListMachineTypesPage> { private AggregatedListMachineTypesPage( - PageContext context, + PageContext< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, + MachineTypesScopedList> + context, MachineTypeAggregatedList response) { super(context, response); } @@ -606,31 +609,32 @@ private static AggregatedListMachineTypesPage createEmptyPage() { @Override protected AggregatedListMachineTypesPage createPage( - PageContext context, + PageContext< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, + MachineTypesScopedList> + context, MachineTypeAggregatedList response) { return new AggregatedListMachineTypesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, + MachineTypesScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListMachineTypesFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListMachineTypesHttpRequest, - MachineTypeAggregatedList, - MachineTypesScopedList, - AggregatedListMachineTypesPage, - AggregatedListMachineTypesFixedSizeCollection> { + public static class AggregatedListMachineTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, MachineTypesScopedList, + AggregatedListMachineTypesPage, AggregatedListMachineTypesFixedSizeCollection> { - private AggregatedListMachineTypesFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListMachineTypesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -643,15 +647,12 @@ protected AggregatedListMachineTypesFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListMachineTypesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListMachineTypesPagedResponse extends AbstractPagedListResponse< - ListMachineTypesHttpRequest, - MachineTypeList, - MachineType, - ListMachineTypesPage, - ListMachineTypesFixedSizeCollection> { + + public static class ListMachineTypesPagedResponse + extends AbstractPagedListResponse< + ListMachineTypesHttpRequest, MachineTypeList, MachineType, ListMachineTypesPage, + ListMachineTypesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -671,15 +672,11 @@ public ListMachineTypesPagedResponse apply(ListMachineTypesPage input) { private ListMachineTypesPagedResponse(ListMachineTypesPage page) { super(page, ListMachineTypesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListMachineTypesPage extends AbstractPage< - ListMachineTypesHttpRequest, - MachineTypeList, - MachineType, - ListMachineTypesPage> { + public static class ListMachineTypesPage + extends AbstractPage< + ListMachineTypesHttpRequest, MachineTypeList, MachineType, ListMachineTypesPage> { private ListMachineTypesPage( PageContext context, @@ -704,20 +701,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListMachineTypesFixedSizeCollection extends AbstractFixedSizeCollection< - ListMachineTypesHttpRequest, - MachineTypeList, - MachineType, - ListMachineTypesPage, - ListMachineTypesFixedSizeCollection> { + public static class ListMachineTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMachineTypesHttpRequest, MachineTypeList, MachineType, ListMachineTypesPage, + ListMachineTypesFixedSizeCollection> { - private ListMachineTypesFixedSizeCollection(List pages, int collectionSize) { + private ListMachineTypesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -730,7 +722,5 @@ protected ListMachineTypesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListMachineTypesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java index 8d2fc4a2e58d..89d1b36936cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private MachineTypeList() { this.warning = null; } - private MachineTypeList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(MachineTypeList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static MachineTypeList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final MachineTypeList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new MachineTypeList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public MachineTypeList build() { - - - - - return new MachineTypeList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new MachineTypeList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "MachineTypeList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof MachineTypeList) { MachineTypeList that = (MachineTypeList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java deleted file mode 100644 index b231a4cbb0c1..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class MachineTypeName implements com.google.api.resourcenames.ResourceName { - private final String machineType; - private final String project; - private final String zone; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/machineTypes/{machineType}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private MachineTypeName(Builder builder) { - machineType = Preconditions.checkNotNull(builder.getMachineType()); - project = Preconditions.checkNotNull(builder.getProject()); - zone = Preconditions.checkNotNull(builder.getZone()); - } - - public static MachineTypeName of( - String machineType, - String project, - String zone - ) { - return newBuilder() - .setMachineType(machineType) - .setProject(project) - .setZone(zone) - .build(); - } - - public static String format( - String machineType, - String project, - String zone - ) { - return of( - machineType, - project, - zone - ) - .toString(); - } - - public String getMachineType() { - return machineType; - } - - public String getProject() { - return project; - } - - public String getZone() { - return zone; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("machineType", machineType); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("zone", zone); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public MachineTypeName parse(String formattedString) {return MachineTypeName.parse(formattedString);} - }; - } - - public static MachineTypeName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "MachineTypeName.parse: formattedString not in valid format"); - return of( - matchMap.get("machineType"), - matchMap.get("project"), - matchMap.get("zone") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String machineType; - private String project; - private String zone; - - public String getMachineType() { - return machineType; - } - public String getProject() { - return project; - } - public String getZone() { - return zone; - } - - public Builder setMachineType(String machineType) { - this.machineType = machineType; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - private Builder() {} - - public Builder (MachineTypeName machineTypeName) { - machineType = machineTypeName.machineType; - project = machineTypeName.project; - zone = machineTypeName.zone; - } - - public MachineTypeName build() { - return new MachineTypeName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "machineType", machineType, - "project", project, - "zone", zone - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof MachineTypeName) { - MachineTypeName that = (MachineTypeName) o; - return - Objects.equals(this.machineType, that.getMachineType()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - machineType, - project, - zone - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java index bd694ff8863d..2334b16208f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; import com.google.cloud.compute.v1.stub.MachineTypeStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getMachineType to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getMachineType to 30 seconds: * *

  * 
@@ -86,70 +64,57 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class MachineTypeSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListMachineTypes.
-   */
-  public PagedCallSettings aggregatedListMachineTypesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListMachineTypes. */
+  public PagedCallSettings<
+          AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+          AggregatedListMachineTypesPagedResponse>
+      aggregatedListMachineTypesSettings() {
     return ((MachineTypeStubSettings) getStubSettings()).aggregatedListMachineTypesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getMachineType.
-   */
+  /** Returns the object with the settings used for calls to getMachineType. */
   public UnaryCallSettings getMachineTypeSettings() {
     return ((MachineTypeStubSettings) getStubSettings()).getMachineTypeSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listMachineTypes.
-   */
-  public PagedCallSettings listMachineTypesSettings() {
+  /** Returns the object with the settings used for calls to listMachineTypes. */
+  public PagedCallSettings<
+          ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse>
+      listMachineTypesSettings() {
     return ((MachineTypeStubSettings) getStubSettings()).listMachineTypesSettings();
   }
 
-
   public static final MachineTypeSettings create(MachineTypeStubSettings stub) throws IOException {
     return new MachineTypeSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return MachineTypeStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return MachineTypeStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return MachineTypeStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return MachineTypeStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return MachineTypeStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return MachineTypeStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return MachineTypeStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -162,23 +127,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return MachineTypeStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -187,9 +146,7 @@ protected MachineTypeSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for MachineTypeSettings.
-   */
+  /** Builder for MachineTypeSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -211,39 +168,41 @@ protected Builder(MachineTypeStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public MachineTypeStubSettings.Builder getStubSettingsBuilder() {
       return ((MachineTypeStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListMachineTypes. - */ - public PagedCallSettings.Builder aggregatedListMachineTypesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListMachineTypes. */ + public PagedCallSettings.Builder< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, + AggregatedListMachineTypesPagedResponse> + aggregatedListMachineTypesSettings() { return getStubSettingsBuilder().aggregatedListMachineTypesSettings(); } - /** - * Returns the builder for the settings used for calls to getMachineType. - */ - public UnaryCallSettings.Builder getMachineTypeSettings() { + /** Returns the builder for the settings used for calls to getMachineType. */ + public UnaryCallSettings.Builder + getMachineTypeSettings() { return getStubSettingsBuilder().getMachineTypeSettings(); } - /** - * Returns the builder for the settings used for calls to listMachineTypes. - */ - public PagedCallSettings.Builder listMachineTypesSettings() { + /** Returns the builder for the settings used for calls to listMachineTypes. */ + public PagedCallSettings.Builder< + ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse> + listMachineTypesSettings() { return getStubSettingsBuilder().listMachineTypesSettings(); } @@ -252,4 +211,4 @@ public MachineTypeSettings build() throws IOException { return new MachineTypeSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java index 93991e33ef6b..2f41edbc6d61 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private MachineTypesScopedList() { this.warning = null; } - - private MachineTypesScopedList( - List machineTypes, - Warning warning - ) { + private MachineTypesScopedList(List machineTypes, Warning warning) { this.machineTypes = machineTypes; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(MachineTypesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static MachineTypesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final MachineTypesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new MachineTypesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public MachineTypesScopedList build() { - return new MachineTypesScopedList( - machineTypes, - warning - ); + return new MachineTypesScopedList(machineTypes, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "MachineTypesScopedList{" - + "machineTypes=" + machineTypes + ", " - + "warning=" + warning + + "machineTypes=" + + machineTypes + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof MachineTypesScopedList) { MachineTypesScopedList that = (MachineTypesScopedList) o; - return - Objects.equals(this.machineTypes, that.getMachineTypesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.machineTypes, that.getMachineTypesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - machineTypes, - warning - ); + return Objects.hash(machineTypes, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java index 10568e797fcb..f496bf31d2c4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,12 @@ private ManagedInstance() { this.lastAttempt = null; } - private ManagedInstance( String currentAction, String id, String instance, String instanceStatus, - ManagedInstanceLastAttempt lastAttempt - ) { + ManagedInstanceLastAttempt lastAttempt) { this.currentAction = currentAction; this.id = id; this.instance = instance; @@ -128,22 +123,24 @@ public ManagedInstanceLastAttempt getLastAttempt() { return lastAttempt; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ManagedInstance prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ManagedInstance getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ManagedInstance DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ManagedInstance(); } @@ -230,19 +227,9 @@ public Builder setLastAttempt(ManagedInstanceLastAttempt lastAttempt) { return this; } - public ManagedInstance build() { - - - - return new ManagedInstance( - currentAction, - id, - instance, - instanceStatus, - lastAttempt - ); + return new ManagedInstance(currentAction, id, instance, instanceStatus, lastAttempt); } public Builder clone() { @@ -259,11 +246,20 @@ public Builder clone() { @Override public String toString() { return "ManagedInstance{" - + "currentAction=" + currentAction + ", " - + "id=" + id + ", " - + "instance=" + instance + ", " - + "instanceStatus=" + instanceStatus + ", " - + "lastAttempt=" + lastAttempt + + "currentAction=" + + currentAction + + ", " + + "id=" + + id + + ", " + + "instance=" + + instance + + ", " + + "instanceStatus=" + + instanceStatus + + ", " + + "lastAttempt=" + + lastAttempt + "}"; } @@ -274,25 +270,17 @@ public boolean equals(Object o) { } if (o instanceof ManagedInstance) { ManagedInstance that = (ManagedInstance) o; - return - Objects.equals(this.currentAction, that.getCurrentAction()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instanceStatus, that.getInstanceStatus()) && - Objects.equals(this.lastAttempt, that.getLastAttempt()) - ; + return Objects.equals(this.currentAction, that.getCurrentAction()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.instanceStatus, that.getInstanceStatus()) + && Objects.equals(this.lastAttempt, that.getLastAttempt()); } return false; } @Override public int hashCode() { - return Objects.hash( - currentAction, - id, - instance, - instanceStatus, - lastAttempt - ); + return Objects.hash(currentAction, id, instance, instanceStatus, lastAttempt); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java index 8f1ed351e4a7..0398c6007add 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ManagedInstanceLastAttempt() { this.errors = null; } - - private ManagedInstanceLastAttempt( - Errors errors - ) { + private ManagedInstanceLastAttempt(Errors errors) { this.errors = errors; } @@ -72,22 +66,24 @@ public Errors getErrors() { return errors; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ManagedInstanceLastAttempt prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ManagedInstanceLastAttempt getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ManagedInstanceLastAttempt DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ManagedInstanceLastAttempt(); } @@ -118,11 +114,8 @@ public Builder setErrors(Errors errors) { return this; } - public ManagedInstanceLastAttempt build() { - return new ManagedInstanceLastAttempt( - errors - ); + return new ManagedInstanceLastAttempt(errors); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "ManagedInstanceLastAttempt{" - + "errors=" + errors - + "}"; + return "ManagedInstanceLastAttempt{" + "errors=" + errors + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof ManagedInstanceLastAttempt) { ManagedInstanceLastAttempt that = (ManagedInstanceLastAttempt) o; - return - Objects.equals(this.errors, that.getErrors()) - ; + return Objects.equals(this.errors, that.getErrors()); } return false; } @Override public int hashCode() { - return Objects.hash( - errors - ); + return Objects.hash(errors); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java index 53e39bd50ed9..95c758ea3f70 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,12 +41,7 @@ private Metadata() { this.kind = null; } - - private Metadata( - String fingerprint, - List items, - String kind - ) { + private Metadata(String fingerprint, List items, String kind) { this.fingerprint = fingerprint; this.items = items; this.kind = kind; @@ -104,22 +98,24 @@ public String getKind() { return kind; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Metadata prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Metadata getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Metadata DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Metadata(); } @@ -186,15 +182,9 @@ public Builder setKind(String kind) { return this; } - public Metadata build() { - - return new Metadata( - fingerprint, - items, - kind - ); + return new Metadata(fingerprint, items, kind); } public Builder clone() { @@ -209,9 +199,14 @@ public Builder clone() { @Override public String toString() { return "Metadata{" - + "fingerprint=" + fingerprint + ", " - + "items=" + items + ", " - + "kind=" + kind + + "fingerprint=" + + fingerprint + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + "}"; } @@ -222,21 +217,15 @@ public boolean equals(Object o) { } if (o instanceof Metadata) { Metadata that = (Metadata) o; - return - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) - ; + return Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()); } return false; } @Override public int hashCode() { - return Objects.hash( - fingerprint, - items, - kind - ); + return Objects.hash(fingerprint, items, kind); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java index 12fea23a42a7..5605995652de 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private MoveDiskProjectHttpRequest() { this.userIp = null; } - private MoveDiskProjectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private MoveDiskProjectHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.diskMoveRequestResource = diskMoveRequestResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); } if (fieldNames.contains("diskMoveRequestResource") && diskMoveRequestResource != null) { - fieldMap.put("diskMoveRequestResource", Collections.singletonList(String.valueOf(diskMoveRequestResource))); + fieldMap.put( + "diskMoveRequestResource", + Collections.singletonList(String.valueOf(diskMoveRequestResource))); } if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(MoveDiskProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static MoveDiskProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final MoveDiskProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new MoveDiskProjectHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public MoveDiskProjectHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new MoveDiskProjectHttpRequest( - access_token, - callback, - diskMoveRequestResource, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + diskMoveRequestResource, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "MoveDiskProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "diskMoveRequestResource=" + diskMoveRequestResource + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "diskMoveRequestResource=" + + diskMoveRequestResource + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof MoveDiskProjectHttpRequest) { MoveDiskProjectHttpRequest that = (MoveDiskProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.diskMoveRequestResource, that.getDiskMoveRequestResource()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.diskMoveRequestResource, that.getDiskMoveRequestResource()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - diskMoveRequestResource, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + diskMoveRequestResource, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java index 3208b47de269..f370b4161b53 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private MoveInstanceProjectHttpRequest() { this.userIp = null; } - private MoveInstanceProjectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private MoveInstanceProjectHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceMoveRequestResource") && instanceMoveRequestResource != null) { - fieldMap.put("instanceMoveRequestResource", Collections.singletonList(String.valueOf(instanceMoveRequestResource))); + fieldMap.put( + "instanceMoveRequestResource", + Collections.singletonList(String.valueOf(instanceMoveRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(MoveInstanceProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static MoveInstanceProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final MoveInstanceProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new MoveInstanceProjectHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public MoveInstanceProjectHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new MoveInstanceProjectHttpRequest( - access_token, - callback, - fields, - instanceMoveRequestResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceMoveRequestResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "MoveInstanceProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceMoveRequestResource=" + instanceMoveRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceMoveRequestResource=" + + instanceMoveRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof MoveInstanceProjectHttpRequest) { MoveInstanceProjectHttpRequest that = (MoveInstanceProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceMoveRequestResource, that.getInstanceMoveRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceMoveRequestResource, that.getInstanceMoveRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceMoveRequestResource, - key, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceMoveRequestResource, + key, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java index 905c2d3148d4..2d5d450c6dd7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private NamedPort() { this.port = null; } - - private NamedPort( - String name, - Integer port - ) { + private NamedPort(String name, Integer port) { this.name = name; this.port = port; } @@ -86,22 +79,24 @@ public Integer getPort() { return port; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NamedPort prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NamedPort getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NamedPort DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NamedPort(); } @@ -146,13 +141,9 @@ public Builder setPort(Integer port) { return this; } - public NamedPort build() { - return new NamedPort( - name, - port - ); + return new NamedPort(name, port); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "NamedPort{" - + "name=" + name + ", " - + "port=" + port - + "}"; + return "NamedPort{" + "name=" + name + ", " + "port=" + port + "}"; } @Override @@ -178,19 +166,13 @@ public boolean equals(Object o) { } if (o instanceof NamedPort) { NamedPort that = (NamedPort) o; - return - Objects.equals(this.name, that.getName()) && - Objects.equals(this.port, that.getPort()) - ; + return Objects.equals(this.name, that.getName()) && Objects.equals(this.port, that.getPort()); } return false; } @Override public int hashCode() { - return Objects.hash( - name, - port - ); + return Objects.hash(name, port); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java index 9e5ebf482317..48da3336168b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -60,7 +59,6 @@ private Network() { this.subnetworks = null; } - private Network( Boolean autoCreateSubnetworks, String creationTimestamp, @@ -73,8 +71,7 @@ private Network( List peerings, NetworkRoutingConfig routingConfig, String selfLink, - List subnetworks - ) { + List subnetworks) { this.autoCreateSubnetworks = autoCreateSubnetworks; this.creationTimestamp = creationTimestamp; this.description = description; @@ -93,10 +90,13 @@ private Network( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("autoCreateSubnetworks") && autoCreateSubnetworks != null) { - fieldMap.put("autoCreateSubnetworks", Collections.singletonList(String.valueOf(autoCreateSubnetworks))); + fieldMap.put( + "autoCreateSubnetworks", + Collections.singletonList(String.valueOf(autoCreateSubnetworks))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -234,22 +234,24 @@ public List getSubnetworksList() { return subnetworks; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Network prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Network getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Network DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Network(); } @@ -450,33 +452,21 @@ public Builder addSubnetworks(String subnetworks) { return this; } - public Network build() { - - - - - - - - - - return new Network( - autoCreateSubnetworks, - creationTimestamp, - description, - gatewayIPv4, - iPv4Range, - id, - kind, - name, - peerings, - routingConfig, - selfLink, - subnetworks - ); + autoCreateSubnetworks, + creationTimestamp, + description, + gatewayIPv4, + iPv4Range, + id, + kind, + name, + peerings, + routingConfig, + selfLink, + subnetworks); } public Builder clone() { @@ -500,18 +490,41 @@ public Builder clone() { @Override public String toString() { return "Network{" - + "autoCreateSubnetworks=" + autoCreateSubnetworks + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "gatewayIPv4=" + gatewayIPv4 + ", " - + "iPv4Range=" + iPv4Range + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "peerings=" + peerings + ", " - + "routingConfig=" + routingConfig + ", " - + "selfLink=" + selfLink + ", " - + "subnetworks=" + subnetworks + + "autoCreateSubnetworks=" + + autoCreateSubnetworks + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "gatewayIPv4=" + + gatewayIPv4 + + ", " + + "iPv4Range=" + + iPv4Range + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "peerings=" + + peerings + + ", " + + "routingConfig=" + + routingConfig + + ", " + + "selfLink=" + + selfLink + + ", " + + "subnetworks=" + + subnetworks + "}"; } @@ -522,20 +535,18 @@ public boolean equals(Object o) { } if (o instanceof Network) { Network that = (Network) o; - return - Objects.equals(this.autoCreateSubnetworks, that.getAutoCreateSubnetworks()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.gatewayIPv4, that.getGatewayIPv4()) && - Objects.equals(this.iPv4Range, that.getIPv4Range()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.peerings, that.getPeeringsList()) && - Objects.equals(this.routingConfig, that.getRoutingConfig()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.subnetworks, that.getSubnetworksList()) - ; + return Objects.equals(this.autoCreateSubnetworks, that.getAutoCreateSubnetworks()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.gatewayIPv4, that.getGatewayIPv4()) + && Objects.equals(this.iPv4Range, that.getIPv4Range()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.peerings, that.getPeeringsList()) + && Objects.equals(this.routingConfig, that.getRoutingConfig()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.subnetworks, that.getSubnetworksList()); } return false; } @@ -543,18 +554,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - autoCreateSubnetworks, - creationTimestamp, - description, - gatewayIPv4, - iPv4Range, - id, - kind, - name, - peerings, - routingConfig, - selfLink, - subnetworks - ); + autoCreateSubnetworks, + creationTimestamp, + description, + gatewayIPv4, + iPv4Range, + id, + kind, + name, + peerings, + routingConfig, + selfLink, + subnetworks); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java index 430f2065ec00..e6664d05a169 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.NetworkStub; import com.google.cloud.compute.v1.stub.NetworkStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,41 +43,40 @@ * * try (NetworkClient networkClient = NetworkClient.create()) { * String requestId = ""; - * ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + * ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); * NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); * Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); * } * *

* - *

Note: close() needs to be called on the networkClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the networkClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of NetworkSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of NetworkSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -117,19 +106,14 @@ public class NetworkClient implements BackgroundResource {
   private final NetworkSettings settings;
   private final NetworkStub stub;
 
-
-
-  /**
-   * Constructs an instance of NetworkClient with default settings.
-   */
+  /** Constructs an instance of NetworkClient with default settings. */
   public static final NetworkClient create() throws IOException {
     return create(NetworkSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of NetworkClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of NetworkClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final NetworkClient create(NetworkSettings settings) throws IOException {
     return new NetworkClient(settings);
@@ -145,9 +129,8 @@ public static final NetworkClient create(NetworkStub stub) {
   }
 
   /**
-   * Constructs an instance of NetworkClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of NetworkClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected NetworkClient(NetworkSettings settings) throws IOException {
     this.settings = settings;
@@ -169,39 +152,46 @@ public NetworkStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Adds a peering to the specified network.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to add peering to. * @param networksAddPeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addPeeringNetwork(String requestId, ProjectNetworkName network, NetworksAddPeeringRequest networksAddPeeringRequestResource) { + public final Operation addPeeringNetwork( + String requestId, + ProjectGlobalNetworkName network, + NetworksAddPeeringRequest networksAddPeeringRequestResource) { AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network == null ? null : network.toString()) - .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) - .build(); + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) + .build(); return addPeeringNetwork(request); } @@ -209,34 +199,42 @@ public final Operation addPeeringNetwork(String requestId, ProjectNetworkName ne /** * Adds a peering to the specified network. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   Operation response = networkClient.addPeeringNetwork(requestId, network.toString(), networksAddPeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to add peering to. * @param networksAddPeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addPeeringNetwork(String requestId, String network, NetworksAddPeeringRequest networksAddPeeringRequestResource) { + public final Operation addPeeringNetwork( + String requestId, + String network, + NetworksAddPeeringRequest networksAddPeeringRequestResource) { AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network) - .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) - .build(); + .setRequestId(requestId) + .setNetwork(network) + .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) + .build(); return addPeeringNetwork(request); } @@ -244,11 +242,12 @@ public final Operation addPeeringNetwork(String requestId, String network, Netwo /** * Adds a peering to the specified network. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -271,11 +270,12 @@ public final Operation addPeeringNetwork(AddPeeringNetworkHttpRequest request) {
   /**
    * Adds a peering to the specified network.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -297,31 +297,36 @@ public final UnaryCallable addPeeringNe
   /**
    * Deletes the specified network.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.deleteNetwork(requestId, network);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteNetwork(String requestId, ProjectNetworkName network) { + public final Operation deleteNetwork(String requestId, ProjectGlobalNetworkName network) { DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network == null ? null : network.toString()) - .build(); + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .build(); return deleteNetwork(request); } @@ -329,20 +334,25 @@ public final Operation deleteNetwork(String requestId, ProjectNetworkName networ /** * Deletes the specified network. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.deleteNetwork(requestId, network.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -350,10 +360,7 @@ public final Operation deleteNetwork(String requestId, ProjectNetworkName networ public final Operation deleteNetwork(String requestId, String network) { DeleteNetworkHttpRequest request = - DeleteNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network) - .build(); + DeleteNetworkHttpRequest.newBuilder().setRequestId(requestId).setNetwork(network).build(); return deleteNetwork(request); } @@ -361,11 +368,12 @@ public final Operation deleteNetwork(String requestId, String network) { /** * Deletes the specified network. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -386,11 +394,12 @@ public final Operation deleteNetwork(DeleteNetworkHttpRequest request) {
   /**
    * Deletes the specified network.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -410,10 +419,11 @@ public final UnaryCallable deleteNetworkCal
   /**
    * Returns the specified network. Get a list of available networks by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network response = networkClient.getNetwork(network);
    * }
    * 
@@ -422,12 +432,12 @@ public final UnaryCallable deleteNetworkCal * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Network getNetwork(ProjectNetworkName network) { + public final Network getNetwork(ProjectGlobalNetworkName network) { GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder() - .setNetwork(network == null ? null : network.toString()) - .build(); + .setNetwork(network == null ? null : network.toString()) + .build(); return getNetwork(request); } @@ -435,10 +445,11 @@ public final Network getNetwork(ProjectNetworkName network) { /** * Returns the specified network. Get a list of available networks by making a list() request. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network response = networkClient.getNetwork(network.toString());
    * }
    * 
@@ -449,10 +460,7 @@ public final Network getNetwork(ProjectNetworkName network) { @BetaApi public final Network getNetwork(String network) { - GetNetworkHttpRequest request = - GetNetworkHttpRequest.newBuilder() - .setNetwork(network) - .build(); + GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder().setNetwork(network).build(); return getNetwork(request); } @@ -460,10 +468,11 @@ public final Network getNetwork(String network) { /** * Returns the specified network. Get a list of available networks by making a list() request. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder()
    *     .setNetwork(network.toString())
    *     .build();
@@ -483,10 +492,11 @@ public final Network getNetwork(GetNetworkHttpRequest request) {
   /**
    * Returns the specified network. Get a list of available networks by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   GetNetworkHttpRequest request = GetNetworkHttpRequest.newBuilder()
    *     .setNetwork(network.toString())
    *     .build();
@@ -505,7 +515,8 @@ public final UnaryCallable getNetworkCallable()
   /**
    * Creates a network in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
@@ -515,24 +526,30 @@ public final UnaryCallable getNetworkCallable()
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertNetwork(String requestId, ProjectName project, Network networkResource) { + public final Operation insertNetwork( + String requestId, ProjectName project, Network networkResource) { InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setNetworkResource(networkResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setNetworkResource(networkResource) + .build(); return insertNetwork(request); } @@ -540,7 +557,8 @@ public final Operation insertNetwork(String requestId, ProjectName project, Netw /** * Creates a network in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
@@ -550,13 +568,18 @@ public final Operation insertNetwork(String requestId, ProjectName project, Netw
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -564,10 +587,10 @@ public final Operation insertNetwork(String requestId, String project, Network n InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setNetworkResource(networkResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setNetworkResource(networkResource) + .build(); return insertNetwork(request); } @@ -575,7 +598,8 @@ public final Operation insertNetwork(String requestId, String project, Network n /** * Creates a network in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
@@ -602,7 +626,8 @@ public final Operation insertNetwork(InsertNetworkHttpRequest request) {
   /**
    * Creates a network in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
@@ -628,7 +653,8 @@ public final UnaryCallable insertNetworkCal
   /**
    * Retrieves the list of networks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -645,8 +671,8 @@ public final UnaryCallable insertNetworkCal
   public final ListNetworksPagedResponse listNetworks(ProjectName project) {
     ListNetworksHttpRequest request =
         ListNetworksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listNetworks(request);
   }
 
@@ -654,7 +680,8 @@ public final ListNetworksPagedResponse listNetworks(ProjectName project) {
   /**
    * Retrieves the list of networks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -670,9 +697,7 @@ public final ListNetworksPagedResponse listNetworks(ProjectName project) {
   @BetaApi
   public final ListNetworksPagedResponse listNetworks(String project) {
     ListNetworksHttpRequest request =
-        ListNetworksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListNetworksHttpRequest.newBuilder().setProject(project).build();
     return listNetworks(request);
   }
 
@@ -680,7 +705,8 @@ public final ListNetworksPagedResponse listNetworks(String project) {
   /**
    * Retrieves the list of networks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -698,15 +724,15 @@ public final ListNetworksPagedResponse listNetworks(String project) {
    */
   @BetaApi
   public final ListNetworksPagedResponse listNetworks(ListNetworksHttpRequest request) {
-    return listNetworksPagedCallable()
-        .call(request);
+    return listNetworksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of networks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -722,7 +748,8 @@ public final ListNetworksPagedResponse listNetworks(ListNetworksHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable listNetworksPagedCallable() { + public final UnaryCallable + listNetworksPagedCallable() { return stub.listNetworksPagedCallable(); } @@ -730,7 +757,8 @@ public final UnaryCallable l /** * Retrieves the list of networks available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -759,60 +787,75 @@ public final UnaryCallable listNetworksCal
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.
+   * Patches the specified network with the data included in the request. Only the following fields
+   * can be modified: routingConfig.routingMode.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   Operation response = networkClient.patchNetwork(requestId, network, networkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to update. - * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchNetwork(String requestId, ProjectNetworkName network, Network networkResource) { + public final Operation patchNetwork( + String requestId, ProjectGlobalNetworkName network, Network networkResource) { PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network == null ? null : network.toString()) - .setNetworkResource(networkResource) - .build(); + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .setNetworkResource(networkResource) + .build(); return patchNetwork(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * Patches the specified network with the data included in the request. Only the following fields + * can be modified: routingConfig.routingMode. + * + *

Sample code: * - * Sample code: *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   Operation response = networkClient.patchNetwork(requestId, network.toString(), networkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to update. - * @param networkResource Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) + * @param networkResource Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -820,22 +863,24 @@ public final Operation patchNetwork(String requestId, String network, Network ne PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network) - .setNetworkResource(networkResource) - .build(); + .setRequestId(requestId) + .setNetwork(network) + .setNetworkResource(networkResource) + .build(); return patchNetwork(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * Patches the specified network with the data included in the request. Only the following fields + * can be modified: routingConfig.routingMode. + * + *

Sample code: * - * Sample code: *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -856,13 +901,15 @@ public final Operation patchNetwork(PatchNetworkHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.
+   * Patches the specified network with the data included in the request. Only the following fields
+   * can be modified: routingConfig.routingMode.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -884,34 +931,42 @@ public final UnaryCallable patchNetworkCalla
   /**
    * Removes a peering from the specified network.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   Operation response = networkClient.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to remove peering from. * @param networksRemovePeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removePeeringNetwork(String requestId, ProjectNetworkName network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + public final Operation removePeeringNetwork( + String requestId, + ProjectGlobalNetworkName network, + NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network == null ? null : network.toString()) - .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) - .build(); + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) + .build(); return removePeeringNetwork(request); } @@ -919,34 +974,42 @@ public final Operation removePeeringNetwork(String requestId, ProjectNetworkName /** * Removes a peering from the specified network. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   Operation response = networkClient.removePeeringNetwork(requestId, network.toString(), networksRemovePeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to remove peering from. * @param networksRemovePeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removePeeringNetwork(String requestId, String network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + public final Operation removePeeringNetwork( + String requestId, + String network, + NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network) - .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) - .build(); + .setRequestId(requestId) + .setNetwork(network) + .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) + .build(); return removePeeringNetwork(request); } @@ -954,11 +1017,12 @@ public final Operation removePeeringNetwork(String requestId, String network, Ne /** * Removes a peering from the specified network. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -981,11 +1045,12 @@ public final Operation removePeeringNetwork(RemovePeeringNetworkHttpRequest requ
   /**
    * Removes a peering from the specified network.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -999,7 +1064,8 @@ public final Operation removePeeringNetwork(RemovePeeringNetworkHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable removePeeringNetworkCallable() { + public final UnaryCallable + removePeeringNetworkCallable() { return stub.removePeeringNetworkCallable(); } @@ -1007,31 +1073,37 @@ public final UnaryCallable removePee /** * Switches the network mode from auto subnet mode to custom subnet mode. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation switchToCustomModeNetwork(String requestId, ProjectNetworkName network) { + public final Operation switchToCustomModeNetwork( + String requestId, ProjectGlobalNetworkName network) { SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network == null ? null : network.toString()) - .build(); + .setRequestId(requestId) + .setNetwork(network == null ? null : network.toString()) + .build(); return switchToCustomModeNetwork(request); } @@ -1039,20 +1111,25 @@ public final Operation switchToCustomModeNetwork(String requestId, ProjectNetwor /** * Switches the network mode from auto subnet mode to custom subnet mode. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1061,9 +1138,9 @@ public final Operation switchToCustomModeNetwork(String requestId, String networ SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network) - .build(); + .setRequestId(requestId) + .setNetwork(network) + .build(); return switchToCustomModeNetwork(request); } @@ -1071,11 +1148,12 @@ public final Operation switchToCustomModeNetwork(String requestId, String networ /** * Switches the network mode from auto subnet mode to custom subnet mode. * - * Sample code: + *

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -1096,11 +1174,12 @@ public final Operation switchToCustomModeNetwork(SwitchToCustomModeNetworkHttpRe
   /**
    * Switches the network mode from auto subnet mode to custom subnet mode.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
    *   String requestId = "";
-   *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+   *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
@@ -1112,12 +1191,13 @@ public final Operation switchToCustomModeNetwork(SwitchToCustomModeNetworkHttpRe
    * 
*/ @BetaApi - public final UnaryCallable switchToCustomModeNetworkCallable() { + public final UnaryCallable + switchToCustomModeNetworkCallable() { return stub.switchToCustomModeNetworkCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1146,12 +1226,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListNetworksPagedResponse extends AbstractPagedListResponse< - ListNetworksHttpRequest, - NetworkList, - Network, - ListNetworksPage, - ListNetworksFixedSizeCollection> { + public static class ListNetworksPagedResponse + extends AbstractPagedListResponse< + ListNetworksHttpRequest, NetworkList, Network, ListNetworksPage, + ListNetworksFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1171,19 +1249,13 @@ public ListNetworksPagedResponse apply(ListNetworksPage input) { private ListNetworksPagedResponse(ListNetworksPage page) { super(page, ListNetworksFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListNetworksPage extends AbstractPage< - ListNetworksHttpRequest, - NetworkList, - Network, - ListNetworksPage> { + public static class ListNetworksPage + extends AbstractPage { private ListNetworksPage( - PageContext context, - NetworkList response) { + PageContext context, NetworkList response) { super(context, response); } @@ -1193,8 +1265,7 @@ private static ListNetworksPage createEmptyPage() { @Override protected ListNetworksPage createPage( - PageContext context, - NetworkList response) { + PageContext context, NetworkList response) { return new ListNetworksPage(context, response); } @@ -1204,18 +1275,12 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListNetworksFixedSizeCollection extends AbstractFixedSizeCollection< - ListNetworksHttpRequest, - NetworkList, - Network, - ListNetworksPage, - ListNetworksFixedSizeCollection> { + public static class ListNetworksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNetworksHttpRequest, NetworkList, Network, ListNetworksPage, + ListNetworksFixedSizeCollection> { private ListNetworksFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); @@ -1230,7 +1295,5 @@ protected ListNetworksFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListNetworksFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java index 6d3ac87f83d8..cf8da9d0ed2f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -52,7 +51,6 @@ private NetworkInterface() { this.subnetwork = null; } - private NetworkInterface( List accessConfigs, List aliasIpRanges, @@ -61,8 +59,7 @@ private NetworkInterface( String name, String network, String networkIP, - String subnetwork - ) { + String subnetwork) { this.accessConfigs = accessConfigs; this.aliasIpRanges = aliasIpRanges; this.fingerprint = fingerprint; @@ -178,22 +175,24 @@ public String getSubnetwork() { return subnetwork; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NetworkInterface prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NetworkInterface getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NetworkInterface DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NetworkInterface(); } @@ -338,25 +337,10 @@ public Builder setSubnetwork(String subnetwork) { return this; } - public NetworkInterface build() { - - - - - - return new NetworkInterface( - accessConfigs, - aliasIpRanges, - fingerprint, - kind, - name, - network, - networkIP, - subnetwork - ); + accessConfigs, aliasIpRanges, fingerprint, kind, name, network, networkIP, subnetwork); } public Builder clone() { @@ -376,14 +360,29 @@ public Builder clone() { @Override public String toString() { return "NetworkInterface{" - + "accessConfigs=" + accessConfigs + ", " - + "aliasIpRanges=" + aliasIpRanges + ", " - + "fingerprint=" + fingerprint + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "networkIP=" + networkIP + ", " - + "subnetwork=" + subnetwork + + "accessConfigs=" + + accessConfigs + + ", " + + "aliasIpRanges=" + + aliasIpRanges + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "networkIP=" + + networkIP + + ", " + + "subnetwork=" + + subnetwork + "}"; } @@ -394,16 +393,14 @@ public boolean equals(Object o) { } if (o instanceof NetworkInterface) { NetworkInterface that = (NetworkInterface) o; - return - Objects.equals(this.accessConfigs, that.getAccessConfigsList()) && - Objects.equals(this.aliasIpRanges, that.getAliasIpRangesList()) && - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.networkIP, that.getNetworkIP()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) - ; + return Objects.equals(this.accessConfigs, that.getAccessConfigsList()) + && Objects.equals(this.aliasIpRanges, that.getAliasIpRangesList()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.networkIP, that.getNetworkIP()) + && Objects.equals(this.subnetwork, that.getSubnetwork()); } return false; } @@ -411,14 +408,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - accessConfigs, - aliasIpRanges, - fingerprint, - kind, - name, - network, - networkIP, - subnetwork - ); + accessConfigs, aliasIpRanges, fingerprint, kind, name, network, networkIP, subnetwork); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java index 656cc261b12b..b2cf2cdf80e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private NetworkList() { this.warning = null; } - private NetworkList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NetworkList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NetworkList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NetworkList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NetworkList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public NetworkList build() { - - - - - return new NetworkList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new NetworkList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "NetworkList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof NetworkList) { NetworkList that = (NetworkList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java index 5ac29faa47ef..0d6bdca5b111 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private NetworkPeering() { this.stateDetails = null; } - private NetworkPeering( - Boolean autoCreateRoutes, - String name, - String network, - String state, - String stateDetails - ) { + Boolean autoCreateRoutes, String name, String network, String state, String stateDetails) { this.autoCreateRoutes = autoCreateRoutes; this.name = name; this.network = network; @@ -128,22 +119,24 @@ public String getStateDetails() { return stateDetails; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NetworkPeering prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NetworkPeering getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NetworkPeering DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NetworkPeering(); } @@ -230,19 +223,9 @@ public Builder setStateDetails(String stateDetails) { return this; } - public NetworkPeering build() { - - - - return new NetworkPeering( - autoCreateRoutes, - name, - network, - state, - stateDetails - ); + return new NetworkPeering(autoCreateRoutes, name, network, state, stateDetails); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "NetworkPeering{" - + "autoCreateRoutes=" + autoCreateRoutes + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "state=" + state + ", " - + "stateDetails=" + stateDetails + + "autoCreateRoutes=" + + autoCreateRoutes + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "state=" + + state + + ", " + + "stateDetails=" + + stateDetails + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof NetworkPeering) { NetworkPeering that = (NetworkPeering) o; - return - Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.state, that.getState()) && - Objects.equals(this.stateDetails, that.getStateDetails()) - ; + return Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.state, that.getState()) + && Objects.equals(this.stateDetails, that.getStateDetails()); } return false; } @Override public int hashCode() { - return Objects.hash( - autoCreateRoutes, - name, - network, - state, - stateDetails - ); + return Objects.hash(autoCreateRoutes, name, network, state, stateDetails); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java index 580ef4880229..ee9f3c89ec24 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private NetworkRoutingConfig() { this.routingMode = null; } - - private NetworkRoutingConfig( - String routingMode - ) { + private NetworkRoutingConfig(String routingMode) { this.routingMode = routingMode; } @@ -72,22 +66,24 @@ public String getRoutingMode() { return routingMode; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NetworkRoutingConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NetworkRoutingConfig getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NetworkRoutingConfig DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NetworkRoutingConfig(); } @@ -118,11 +114,8 @@ public Builder setRoutingMode(String routingMode) { return this; } - public NetworkRoutingConfig build() { - return new NetworkRoutingConfig( - routingMode - ); + return new NetworkRoutingConfig(routingMode); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "NetworkRoutingConfig{" - + "routingMode=" + routingMode - + "}"; + return "NetworkRoutingConfig{" + "routingMode=" + routingMode + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof NetworkRoutingConfig) { NetworkRoutingConfig that = (NetworkRoutingConfig) o; - return - Objects.equals(this.routingMode, that.getRoutingMode()) - ; + return Objects.equals(this.routingMode, that.getRoutingMode()); } return false; } @Override public int hashCode() { - return Objects.hash( - routingMode - ); + return Objects.hash(routingMode); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java index 1b745c9bdcb6..ef1e6d4fdddb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.stub.NetworkStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addPeeringNetwork to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addPeeringNetwork to 30 seconds: * *

  * 
@@ -85,105 +63,80 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class NetworkSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to addPeeringNetwork.
-   */
+  /** Returns the object with the settings used for calls to addPeeringNetwork. */
   public UnaryCallSettings addPeeringNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).addPeeringNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteNetwork.
-   */
+  /** Returns the object with the settings used for calls to deleteNetwork. */
   public UnaryCallSettings deleteNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).deleteNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getNetwork.
-   */
+  /** Returns the object with the settings used for calls to getNetwork. */
   public UnaryCallSettings getNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).getNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertNetwork.
-   */
+  /** Returns the object with the settings used for calls to insertNetwork. */
   public UnaryCallSettings insertNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).insertNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listNetworks.
-   */
-  public PagedCallSettings listNetworksSettings() {
+  /** Returns the object with the settings used for calls to listNetworks. */
+  public PagedCallSettings
+      listNetworksSettings() {
     return ((NetworkStubSettings) getStubSettings()).listNetworksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchNetwork.
-   */
+  /** Returns the object with the settings used for calls to patchNetwork. */
   public UnaryCallSettings patchNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).patchNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to removePeeringNetwork.
-   */
-  public UnaryCallSettings removePeeringNetworkSettings() {
+  /** Returns the object with the settings used for calls to removePeeringNetwork. */
+  public UnaryCallSettings
+      removePeeringNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).removePeeringNetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to switchToCustomModeNetwork.
-   */
-  public UnaryCallSettings switchToCustomModeNetworkSettings() {
+  /** Returns the object with the settings used for calls to switchToCustomModeNetwork. */
+  public UnaryCallSettings
+      switchToCustomModeNetworkSettings() {
     return ((NetworkStubSettings) getStubSettings()).switchToCustomModeNetworkSettings();
   }
 
-
   public static final NetworkSettings create(NetworkStubSettings stub) throws IOException {
     return new NetworkSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return NetworkStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return NetworkStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return NetworkStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return NetworkStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return NetworkStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return NetworkStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return NetworkStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -196,23 +149,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return NetworkStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -221,9 +168,7 @@ protected NetworkSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for NetworkSettings.
-   */
+  /** Builder for NetworkSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -245,74 +190,65 @@ protected Builder(NetworkStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public NetworkStubSettings.Builder getStubSettingsBuilder() {
       return ((NetworkStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to addPeeringNetwork. - */ - public UnaryCallSettings.Builder addPeeringNetworkSettings() { + /** Returns the builder for the settings used for calls to addPeeringNetwork. */ + public UnaryCallSettings.Builder + addPeeringNetworkSettings() { return getStubSettingsBuilder().addPeeringNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to deleteNetwork. - */ + /** Returns the builder for the settings used for calls to deleteNetwork. */ public UnaryCallSettings.Builder deleteNetworkSettings() { return getStubSettingsBuilder().deleteNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to getNetwork. - */ + /** Returns the builder for the settings used for calls to getNetwork. */ public UnaryCallSettings.Builder getNetworkSettings() { return getStubSettingsBuilder().getNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to insertNetwork. - */ + /** Returns the builder for the settings used for calls to insertNetwork. */ public UnaryCallSettings.Builder insertNetworkSettings() { return getStubSettingsBuilder().insertNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to listNetworks. - */ - public PagedCallSettings.Builder listNetworksSettings() { + /** Returns the builder for the settings used for calls to listNetworks. */ + public PagedCallSettings.Builder< + ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse> + listNetworksSettings() { return getStubSettingsBuilder().listNetworksSettings(); } - /** - * Returns the builder for the settings used for calls to patchNetwork. - */ + /** Returns the builder for the settings used for calls to patchNetwork. */ public UnaryCallSettings.Builder patchNetworkSettings() { return getStubSettingsBuilder().patchNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to removePeeringNetwork. - */ - public UnaryCallSettings.Builder removePeeringNetworkSettings() { + /** Returns the builder for the settings used for calls to removePeeringNetwork. */ + public UnaryCallSettings.Builder + removePeeringNetworkSettings() { return getStubSettingsBuilder().removePeeringNetworkSettings(); } - /** - * Returns the builder for the settings used for calls to switchToCustomModeNetwork. - */ - public UnaryCallSettings.Builder switchToCustomModeNetworkSettings() { + /** Returns the builder for the settings used for calls to switchToCustomModeNetwork. */ + public UnaryCallSettings.Builder + switchToCustomModeNetworkSettings() { return getStubSettingsBuilder().switchToCustomModeNetworkSettings(); } @@ -321,4 +257,4 @@ public NetworkSettings build() throws IOException { return new NetworkSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java index 54f2050785b4..a964e5b5c782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private NetworksAddPeeringRequest() { this.peerNetwork = null; } - - private NetworksAddPeeringRequest( - Boolean autoCreateRoutes, - String name, - String peerNetwork - ) { + private NetworksAddPeeringRequest(Boolean autoCreateRoutes, String name, String peerNetwork) { this.autoCreateRoutes = autoCreateRoutes; this.name = name; this.peerNetwork = peerNetwork; @@ -100,22 +92,24 @@ public String getPeerNetwork() { return peerNetwork; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NetworksAddPeeringRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NetworksAddPeeringRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NetworksAddPeeringRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NetworksAddPeeringRequest(); } @@ -174,15 +168,9 @@ public Builder setPeerNetwork(String peerNetwork) { return this; } - public NetworksAddPeeringRequest build() { - - return new NetworksAddPeeringRequest( - autoCreateRoutes, - name, - peerNetwork - ); + return new NetworksAddPeeringRequest(autoCreateRoutes, name, peerNetwork); } public Builder clone() { @@ -197,9 +185,14 @@ public Builder clone() { @Override public String toString() { return "NetworksAddPeeringRequest{" - + "autoCreateRoutes=" + autoCreateRoutes + ", " - + "name=" + name + ", " - + "peerNetwork=" + peerNetwork + + "autoCreateRoutes=" + + autoCreateRoutes + + ", " + + "name=" + + name + + ", " + + "peerNetwork=" + + peerNetwork + "}"; } @@ -210,21 +203,15 @@ public boolean equals(Object o) { } if (o instanceof NetworksAddPeeringRequest) { NetworksAddPeeringRequest that = (NetworksAddPeeringRequest) o; - return - Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.peerNetwork, that.getPeerNetwork()) - ; + return Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.peerNetwork, that.getPeerNetwork()); } return false; } @Override public int hashCode() { - return Objects.hash( - autoCreateRoutes, - name, - peerNetwork - ); + return Objects.hash(autoCreateRoutes, name, peerNetwork); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java index 0c16877da697..cf35ffa8be25 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private NetworksRemovePeeringRequest() { this.name = null; } - - private NetworksRemovePeeringRequest( - String name - ) { + private NetworksRemovePeeringRequest(String name) { this.name = name; } @@ -72,22 +66,24 @@ public String getName() { return name; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(NetworksRemovePeeringRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static NetworksRemovePeeringRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final NetworksRemovePeeringRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new NetworksRemovePeeringRequest(); } @@ -118,11 +114,8 @@ public Builder setName(String name) { return this; } - public NetworksRemovePeeringRequest build() { - return new NetworksRemovePeeringRequest( - name - ); + return new NetworksRemovePeeringRequest(name); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "NetworksRemovePeeringRequest{" - + "name=" + name - + "}"; + return "NetworksRemovePeeringRequest{" + "name=" + name + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof NetworksRemovePeeringRequest) { NetworksRemovePeeringRequest that = (NetworksRemovePeeringRequest) o; - return - Objects.equals(this.name, that.getName()) - ; + return Objects.equals(this.name, that.getName()); } return false; } @Override public int hashCode() { - return Objects.hash( - name - ); + return Objects.hash(name); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java index b16cb9cd080d..1c4bfddfdd70 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -82,7 +81,6 @@ private Operation() { this.zone = null; } - private Operation( String clientOperationId, String creationTimestamp, @@ -106,8 +104,7 @@ private Operation( String targetLink, String user, List warnings, - String zone - ) { + String zone) { this.clientOperationId = clientOperationId; this.creationTimestamp = creationTimestamp; this.description = description; @@ -137,10 +134,12 @@ private Operation( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("clientOperationId") && clientOperationId != null) { - fieldMap.put("clientOperationId", Collections.singletonList(String.valueOf(clientOperationId))); + fieldMap.put( + "clientOperationId", Collections.singletonList(String.valueOf(clientOperationId))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -155,7 +154,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("httpErrorMessage", Collections.singletonList(String.valueOf(httpErrorMessage))); } if (fieldNames.contains("httpErrorStatusCode") && httpErrorStatusCode != null) { - fieldMap.put("httpErrorStatusCode", Collections.singletonList(String.valueOf(httpErrorStatusCode))); + fieldMap.put( + "httpErrorStatusCode", Collections.singletonList(String.valueOf(httpErrorStatusCode))); } if (fieldNames.contains("id") && id != null) { fieldMap.put("id", Collections.singletonList(String.valueOf(id))); @@ -384,22 +384,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Operation prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Operation getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Operation DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Operation(); } @@ -746,55 +748,32 @@ public Builder setZone(String zone) { return this; } - public Operation build() { - - - - - - - - - - - - - - - - - - - - - return new Operation( - clientOperationId, - creationTimestamp, - description, - endTime, - error, - httpErrorMessage, - httpErrorStatusCode, - id, - insertTime, - kind, - name, - operationType, - progress, - region, - selfLink, - startTime, - status, - statusMessage, - targetId, - targetLink, - user, - warnings, - zone - ); + clientOperationId, + creationTimestamp, + description, + endTime, + error, + httpErrorMessage, + httpErrorStatusCode, + id, + insertTime, + kind, + name, + operationType, + progress, + region, + selfLink, + startTime, + status, + statusMessage, + targetId, + targetLink, + user, + warnings, + zone); } public Builder clone() { @@ -829,29 +808,74 @@ public Builder clone() { @Override public String toString() { return "Operation{" - + "clientOperationId=" + clientOperationId + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "endTime=" + endTime + ", " - + "error=" + error + ", " - + "httpErrorMessage=" + httpErrorMessage + ", " - + "httpErrorStatusCode=" + httpErrorStatusCode + ", " - + "id=" + id + ", " - + "insertTime=" + insertTime + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "operationType=" + operationType + ", " - + "progress=" + progress + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "startTime=" + startTime + ", " - + "status=" + status + ", " - + "statusMessage=" + statusMessage + ", " - + "targetId=" + targetId + ", " - + "targetLink=" + targetLink + ", " - + "user=" + user + ", " - + "warnings=" + warnings + ", " - + "zone=" + zone + + "clientOperationId=" + + clientOperationId + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "endTime=" + + endTime + + ", " + + "error=" + + error + + ", " + + "httpErrorMessage=" + + httpErrorMessage + + ", " + + "httpErrorStatusCode=" + + httpErrorStatusCode + + ", " + + "id=" + + id + + ", " + + "insertTime=" + + insertTime + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "operationType=" + + operationType + + ", " + + "progress=" + + progress + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "startTime=" + + startTime + + ", " + + "status=" + + status + + ", " + + "statusMessage=" + + statusMessage + + ", " + + "targetId=" + + targetId + + ", " + + "targetLink=" + + targetLink + + ", " + + "user=" + + user + + ", " + + "warnings=" + + warnings + + ", " + + "zone=" + + zone + "}"; } @@ -862,31 +886,29 @@ public boolean equals(Object o) { } if (o instanceof Operation) { Operation that = (Operation) o; - return - Objects.equals(this.clientOperationId, that.getClientOperationId()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.endTime, that.getEndTime()) && - Objects.equals(this.error, that.getError()) && - Objects.equals(this.httpErrorMessage, that.getHttpErrorMessage()) && - Objects.equals(this.httpErrorStatusCode, that.getHttpErrorStatusCode()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.insertTime, that.getInsertTime()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.operationType, that.getOperationType()) && - Objects.equals(this.progress, that.getProgress()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.startTime, that.getStartTime()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.statusMessage, that.getStatusMessage()) && - Objects.equals(this.targetId, that.getTargetId()) && - Objects.equals(this.targetLink, that.getTargetLink()) && - Objects.equals(this.user, that.getUser()) && - Objects.equals(this.warnings, that.getWarningsList()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.clientOperationId, that.getClientOperationId()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.endTime, that.getEndTime()) + && Objects.equals(this.error, that.getError()) + && Objects.equals(this.httpErrorMessage, that.getHttpErrorMessage()) + && Objects.equals(this.httpErrorStatusCode, that.getHttpErrorStatusCode()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.insertTime, that.getInsertTime()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.operationType, that.getOperationType()) + && Objects.equals(this.progress, that.getProgress()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.startTime, that.getStartTime()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.statusMessage, that.getStatusMessage()) + && Objects.equals(this.targetId, that.getTargetId()) + && Objects.equals(this.targetLink, that.getTargetLink()) + && Objects.equals(this.user, that.getUser()) + && Objects.equals(this.warnings, that.getWarningsList()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -894,29 +916,28 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - clientOperationId, - creationTimestamp, - description, - endTime, - error, - httpErrorMessage, - httpErrorStatusCode, - id, - insertTime, - kind, - name, - operationType, - progress, - region, - selfLink, - startTime, - status, - statusMessage, - targetId, - targetLink, - user, - warnings, - zone - ); + clientOperationId, + creationTimestamp, + description, + endTime, + error, + httpErrorMessage, + httpErrorStatusCode, + id, + insertTime, + kind, + name, + operationType, + progress, + region, + selfLink, + startTime, + status, + statusMessage, + targetId, + targetLink, + user, + warnings, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java index 8c827f601957..5c7fa68a5c07 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private OperationAggregatedList() { this.warning = null; } - private OperationAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(OperationAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static OperationAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final OperationAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new OperationAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public OperationAggregatedList build() { - - - - - return new OperationAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new OperationAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "OperationAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof OperationAggregatedList) { OperationAggregatedList that = (OperationAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java index 5844eb80a5e2..d48e70e4f295 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private OperationList() { this.warning = null; } - private OperationList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(OperationList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static OperationList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final OperationList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new OperationList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public OperationList build() { - - - - - return new OperationList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new OperationList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "OperationList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof OperationList) { OperationList that = (OperationList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java index 5b714ea22727..9fff272b34bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private OperationsScopedList() { this.warning = null; } - - private OperationsScopedList( - List operations, - Warning warning - ) { + private OperationsScopedList(List operations, Warning warning) { this.operations = operations; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(OperationsScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static OperationsScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final OperationsScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new OperationsScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public OperationsScopedList build() { - return new OperationsScopedList( - operations, - warning - ); + return new OperationsScopedList(operations, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "OperationsScopedList{" - + "operations=" + operations + ", " - + "warning=" + warning - + "}"; + return "OperationsScopedList{" + "operations=" + operations + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof OperationsScopedList) { OperationsScopedList that = (OperationsScopedList) o; - return - Objects.equals(this.operations, that.getOperationsList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.operations, that.getOperationsList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - operations, - warning - ); + return Objects.hash(operations, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index 7df6f2224229..e1b438e32537 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private PatchAutoscalerHttpRequest() { this.zone = null; } - private PatchAutoscalerHttpRequest( String access_token, String autoscaler, @@ -70,8 +66,7 @@ private PatchAutoscalerHttpRequest( String quotaUser, String requestId, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; @@ -95,7 +90,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -212,22 +208,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchAutoscalerHttpRequest(); } @@ -398,19 +396,9 @@ public Builder setZone(String zone) { return this; } - public PatchAutoscalerHttpRequest build() { String missing = ""; - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -418,18 +406,17 @@ public PatchAutoscalerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchAutoscalerHttpRequest( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } public Builder clone() { @@ -452,17 +439,38 @@ public Builder clone() { @Override public String toString() { return "PatchAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -473,19 +481,17 @@ public boolean equals(Object o) { } if (o instanceof PatchAutoscalerHttpRequest) { PatchAutoscalerHttpRequest that = (PatchAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -493,17 +499,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java index 04819b1c5fa2..89a83330fd88 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchBackendBucketHttpRequest() { this.userIp = null; } - private PatchBackendBucketHttpRequest( String access_token, String backendBucket, @@ -67,8 +63,7 @@ private PatchBackendBucketHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendBucket = backendBucket; this.backendBucketResource = backendBucketResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); } if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { - fieldMap.put("backendBucketResource", Collections.singletonList(String.valueOf(backendBucketResource))); + fieldMap.put( + "backendBucketResource", + Collections.singletonList(String.valueOf(backendBucketResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchBackendBucketHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchBackendBucketHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchBackendBucketHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchBackendBucketHttpRequest(); } @@ -370,7 +369,6 @@ public Builder setUserIp(String userIp) { return this; } - public PatchBackendBucketHttpRequest build() { String missing = ""; @@ -378,28 +376,20 @@ public PatchBackendBucketHttpRequest build() { missing += " backendBucket"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchBackendBucketHttpRequest( - access_token, - backendBucket, - backendBucketResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "PatchBackendBucketHttpRequest{" - + "access_token=" + access_token + ", " - + "backendBucket=" + backendBucket + ", " - + "backendBucketResource=" + backendBucketResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendBucket=" + + backendBucket + + ", " + + "backendBucketResource=" + + backendBucketResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof PatchBackendBucketHttpRequest) { PatchBackendBucketHttpRequest that = (PatchBackendBucketHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendBucket, that.getBackendBucket()) && - Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendBucket, that.getBackendBucket()) + && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendBucket, - backendBucketResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index 3249e46d5a80..63c92c498405 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchBackendServiceHttpRequest() { this.userIp = null; } - private PatchBackendServiceHttpRequest( String access_token, String backendService, @@ -67,8 +63,7 @@ private PatchBackendServiceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.backendServiceResource = backendServiceResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); } if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchBackendServiceHttpRequest(); } @@ -370,7 +369,6 @@ public Builder setUserIp(String userIp) { return this; } - public PatchBackendServiceHttpRequest build() { String missing = ""; @@ -378,28 +376,20 @@ public PatchBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchBackendServiceHttpRequest( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "PatchBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "backendServiceResource=" + backendServiceResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "backendServiceResource=" + + backendServiceResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof PatchBackendServiceHttpRequest) { PatchBackendServiceHttpRequest that = (PatchBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index 3910dc99b807..4a7c2fae0014 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchFirewallHttpRequest() { this.userIp = null; } - private PatchFirewallHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchFirewallHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchFirewallHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchFirewallHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchFirewallHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchFirewallHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchFirewallHttpRequest build() { String missing = ""; - - if (firewall == null) { missing += " firewall"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchFirewallHttpRequest( - access_token, - callback, - fields, - firewall, - firewallResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "PatchFirewallHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "firewall=" + firewall + ", " - + "firewallResource=" + firewallResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "firewall=" + + firewall + + ", " + + "firewallResource=" + + firewallResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof PatchFirewallHttpRequest) { PatchFirewallHttpRequest that = (PatchFirewallHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.firewall, that.getFirewall()) && - Objects.equals(this.firewallResource, that.getFirewallResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.firewall, that.getFirewall()) + && Objects.equals(this.firewallResource, that.getFirewallResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - firewall, - firewallResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index 0087f5f0fc19..069a5579dae6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchHealthCheckHttpRequest() { this.userIp = null; } - private PatchHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); } if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { - fieldMap.put("healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + fieldMap.put( + "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchHealthCheckHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchHealthCheckHttpRequest build() { String missing = ""; - - if (healthCheck == null) { missing += " healthCheck"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchHealthCheckHttpRequest( - access_token, - callback, - fields, - healthCheck, - healthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "PatchHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "healthCheck=" + healthCheck + ", " - + "healthCheckResource=" + healthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "healthCheck=" + + healthCheck + + ", " + + "healthCheckResource=" + + healthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof PatchHealthCheckHttpRequest) { PatchHealthCheckHttpRequest that = (PatchHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.healthCheck, that.getHealthCheck()) + && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - healthCheck, - healthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index da8719683aab..7c19dba609e6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchHttpHealthCheckHttpRequest() { this.userIp = null; } - private PatchHttpHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchHttpHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); } if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { - fieldMap.put("httpHealthCheckResource", Collections.singletonList(String.valueOf(httpHealthCheckResource))); + fieldMap.put( + "httpHealthCheckResource", + Collections.singletonList(String.valueOf(httpHealthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchHttpHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchHttpHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchHttpHealthCheckHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchHttpHealthCheckHttpRequest build() { String missing = ""; - - if (httpHealthCheck == null) { missing += " httpHealthCheck"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchHttpHealthCheckHttpRequest( - access_token, - callback, - fields, - httpHealthCheck, - httpHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "PatchHttpHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpHealthCheck=" + httpHealthCheck + ", " - + "httpHealthCheckResource=" + httpHealthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpHealthCheck=" + + httpHealthCheck + + ", " + + "httpHealthCheckResource=" + + httpHealthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof PatchHttpHealthCheckHttpRequest) { PatchHttpHealthCheckHttpRequest that = (PatchHttpHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpHealthCheck, - httpHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index ec82df41c043..2a35068d4ccc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchHttpsHealthCheckHttpRequest() { this.userIp = null; } - private PatchHttpsHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchHttpsHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); } if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { - fieldMap.put("httpsHealthCheckResource", Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + fieldMap.put( + "httpsHealthCheckResource", + Collections.singletonList(String.valueOf(httpsHealthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchHttpsHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchHttpsHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchHttpsHealthCheckHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchHttpsHealthCheckHttpRequest build() { String missing = ""; - - if (httpsHealthCheck == null) { missing += " httpsHealthCheck"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchHttpsHealthCheckHttpRequest( - access_token, - callback, - fields, - httpsHealthCheck, - httpsHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "PatchHttpsHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpsHealthCheck=" + httpsHealthCheck + ", " - + "httpsHealthCheckResource=" + httpsHealthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpsHealthCheck=" + + httpsHealthCheck + + ", " + + "httpsHealthCheckResource=" + + httpsHealthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof PatchHttpsHealthCheckHttpRequest) { PatchHttpsHealthCheckHttpRequest that = (PatchHttpsHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) + && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpsHealthCheck, - httpsHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java index 8ac114d779e2..74192f22a4b8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchInterconnectHttpRequest() { this.userIp = null; } - private PatchInterconnectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchInterconnectHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); } if (fieldNames.contains("interconnectResource") && interconnectResource != null) { - fieldMap.put("interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); + fieldMap.put( + "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchInterconnectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchInterconnectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchInterconnectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchInterconnectHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchInterconnectHttpRequest build() { String missing = ""; - - if (interconnect == null) { missing += " interconnect"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchInterconnectHttpRequest( - access_token, - callback, - fields, - interconnect, - interconnectResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnect, + interconnectResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "PatchInterconnectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "interconnect=" + interconnect + ", " - + "interconnectResource=" + interconnectResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnect=" + + interconnect + + ", " + + "interconnectResource=" + + interconnectResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof PatchInterconnectHttpRequest) { PatchInterconnectHttpRequest that = (PatchInterconnectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.interconnect, that.getInterconnect()) && - Objects.equals(this.interconnectResource, that.getInterconnectResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnect, that.getInterconnect()) + && Objects.equals(this.interconnectResource, that.getInterconnectResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - interconnect, - interconnectResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + interconnect, + interconnectResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java index f5fbf6293f21..2d9202c8cc87 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchNetworkHttpRequest() { this.userIp = null; } - private PatchNetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchNetworkHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchNetworkHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchNetworkHttpRequest build() { String missing = ""; - - - if (network == null) { missing += " network"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchNetworkHttpRequest( - access_token, - callback, - fields, - key, - network, - networkResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + network, + networkResource, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "PatchNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "network=" + network + ", " - + "networkResource=" + networkResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "network=" + + network + + ", " + + "networkResource=" + + networkResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof PatchNetworkHttpRequest) { PatchNetworkHttpRequest that = (PatchNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.networkResource, that.getNetworkResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.networkResource, that.getNetworkResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - network, - networkResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + network, + networkResource, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index bc8e111af76a..dd3d15c4d300 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private PatchRegionAutoscalerHttpRequest() { this.userIp = null; } - private PatchRegionAutoscalerHttpRequest( String access_token, String autoscaler, @@ -70,8 +66,7 @@ private PatchRegionAutoscalerHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; @@ -95,7 +90,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -212,22 +208,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchRegionAutoscalerHttpRequest(); } @@ -398,38 +396,28 @@ public Builder setUserIp(String userIp) { return this; } - public PatchRegionAutoscalerHttpRequest build() { String missing = ""; - - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchRegionAutoscalerHttpRequest( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -452,17 +440,38 @@ public Builder clone() { @Override public String toString() { return "PatchRegionAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -473,19 +482,17 @@ public boolean equals(Object o) { } if (o instanceof PatchRegionAutoscalerHttpRequest) { PatchRegionAutoscalerHttpRequest that = (PatchRegionAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -493,17 +500,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index 4e6c0efcb0a4..62ac1effe9c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchRegionBackendServiceHttpRequest() { this.userIp = null; } - private PatchRegionBackendServiceHttpRequest( String access_token, String backendService, @@ -67,8 +63,7 @@ private PatchRegionBackendServiceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.backendServiceResource = backendServiceResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); } if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchRegionBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchRegionBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchRegionBackendServiceHttpRequest(); } @@ -370,7 +369,6 @@ public Builder setUserIp(String userIp) { return this; } - public PatchRegionBackendServiceHttpRequest build() { String missing = ""; @@ -378,28 +376,20 @@ public PatchRegionBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchRegionBackendServiceHttpRequest( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "PatchRegionBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "backendServiceResource=" + backendServiceResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "backendServiceResource=" + + backendServiceResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof PatchRegionBackendServiceHttpRequest) { PatchRegionBackendServiceHttpRequest that = (PatchRegionBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index 3c7406a4ad99..5162364dd1b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchRouterHttpRequest() { this.userIp = null; } - private PatchRouterHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchRouterHttpRequest( String requestId, String router, Router routerResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchRouterHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchRouterHttpRequest build() { String missing = ""; - - - - - - if (router == null) { missing += " router"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + router, + routerResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "PatchRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "router=" + router + ", " - + "routerResource=" + routerResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "router=" + + router + + ", " + + "routerResource=" + + routerResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof PatchRouterHttpRequest) { PatchRouterHttpRequest that = (PatchRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.routerResource, that.getRouterResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.routerResource, that.getRouterResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + router, + routerResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java new file mode 100644 index 000000000000..a026878f2905 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java @@ -0,0 +1,480 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchSslPolicyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String sslPolicy; + private final SslPolicy sslPolicyResource; + private final String userIp; + + private PatchSslPolicyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.sslPolicy = null; + this.sslPolicyResource = null; + this.userIp = null; + } + + private PatchSslPolicyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String sslPolicy, + SslPolicy sslPolicyResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.sslPolicy = sslPolicy; + this.sslPolicyResource = sslPolicyResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) { + fieldMap.put( + "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } + if (fieldName.equals("sslPolicyResource")) { + return String.valueOf(sslPolicyResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public SslPolicy getApiMessageRequestBody() { + return sslPolicyResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public SslPolicy getSslPolicyResource() { + return sslPolicyResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(PatchSslPolicyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchSslPolicyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final PatchSslPolicyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new PatchSslPolicyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String sslPolicy; + private SslPolicy sslPolicyResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchSslPolicyHttpRequest other) { + if (other == PatchSslPolicyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSslPolicy() != null) { + this.sslPolicy = other.sslPolicy; + } + if (other.getSslPolicyResource() != null) { + this.sslPolicyResource = other.sslPolicyResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchSslPolicyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.sslPolicy = source.sslPolicy; + this.sslPolicyResource = source.sslPolicyResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + public SslPolicy getSslPolicyResource() { + return sslPolicyResource; + } + + public Builder setSslPolicyResource(SslPolicy sslPolicyResource) { + this.sslPolicyResource = sslPolicyResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public PatchSslPolicyHttpRequest build() { + String missing = ""; + + if (sslPolicy == null) { + missing += " sslPolicy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchSslPolicyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicy, + sslPolicyResource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSslPolicy(this.sslPolicy); + newBuilder.setSslPolicyResource(this.sslPolicyResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchSslPolicyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslPolicy=" + + sslPolicy + + ", " + + "sslPolicyResource=" + + sslPolicyResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchSslPolicyHttpRequest) { + PatchSslPolicyHttpRequest that = (PatchSslPolicyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslPolicy, that.getSslPolicy()) + && Objects.equals(this.sslPolicyResource, that.getSslPolicyResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicy, + sslPolicyResource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java index 9ac3b8b54779..a95f50f20073 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchSubnetworkHttpRequest() { this.userIp = null; } - private PatchSubnetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchSubnetworkHttpRequest( String requestId, String subnetwork, Subnetwork subnetworkResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); } if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { - fieldMap.put("subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); + fieldMap.put( + "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchSubnetworkHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchSubnetworkHttpRequest build() { String missing = ""; - - - - - - if (subnetwork == null) { missing += " subnetwork"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - subnetworkResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworkResource, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "PatchSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "subnetwork=" + subnetwork + ", " - + "subnetworkResource=" + subnetworkResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "subnetworkResource=" + + subnetworkResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof PatchSubnetworkHttpRequest) { PatchSubnetworkHttpRequest that = (PatchSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals(this.subnetworkResource, that.getSubnetworkResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - subnetworkResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworkResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index 6d46be5537c4..4a4afacb909a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private PatchUrlMapHttpRequest() { this.userIp = null; } - private PatchUrlMapHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private PatchUrlMapHttpRequest( String requestId, String urlMap, UrlMap urlMapResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PatchUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PatchUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PatchUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PatchUrlMapHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public PatchUrlMapHttpRequest build() { String missing = ""; - - - - - - if (urlMap == null) { missing += " urlMap"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PatchUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + urlMap, + urlMapResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "PatchUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "urlMap=" + urlMap + ", " - + "urlMapResource=" + urlMapResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "urlMap=" + + urlMap + + ", " + + "urlMapResource=" + + urlMapResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof PatchUrlMapHttpRequest) { PatchUrlMapHttpRequest that = (PatchUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.urlMapResource, that.getUrlMapResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals(this.urlMapResource, that.getUrlMapResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + urlMap, + urlMapResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java index 318e6f33e645..07f69275395b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -44,13 +43,8 @@ private PathMatcher() { this.pathRules = null; } - private PathMatcher( - String defaultService, - String description, - String name, - List pathRules - ) { + String defaultService, String description, String name, List pathRules) { this.defaultService = defaultService; this.description = description; this.name = name; @@ -118,22 +112,24 @@ public List getPathRulesList() { return pathRules; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PathMatcher prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PathMatcher getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PathMatcher DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PathMatcher(); } @@ -214,17 +210,9 @@ public Builder addPathRules(PathRule pathRules) { return this; } - public PathMatcher build() { - - - return new PathMatcher( - defaultService, - description, - name, - pathRules - ); + return new PathMatcher(defaultService, description, name, pathRules); } public Builder clone() { @@ -240,10 +228,17 @@ public Builder clone() { @Override public String toString() { return "PathMatcher{" - + "defaultService=" + defaultService + ", " - + "description=" + description + ", " - + "name=" + name + ", " - + "pathRules=" + pathRules + + "defaultService=" + + defaultService + + ", " + + "description=" + + description + + ", " + + "name=" + + name + + ", " + + "pathRules=" + + pathRules + "}"; } @@ -254,23 +249,16 @@ public boolean equals(Object o) { } if (o instanceof PathMatcher) { PathMatcher that = (PathMatcher) o; - return - Objects.equals(this.defaultService, that.getDefaultService()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.pathRules, that.getPathRulesList()) - ; + return Objects.equals(this.defaultService, that.getDefaultService()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.pathRules, that.getPathRulesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - defaultService, - description, - name, - pathRules - ); + return Objects.hash(defaultService, description, name, pathRules); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java index d1129e6f234b..968ee3b56b68 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private PathRule() { this.service = null; } - - private PathRule( - List paths, - String service - ) { + private PathRule(List paths, String service) { this.paths = paths; this.service = service; } @@ -90,22 +85,24 @@ public String getService() { return service; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PathRule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PathRule getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PathRule DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PathRule(); } @@ -158,13 +155,9 @@ public Builder setService(String service) { return this; } - public PathRule build() { - return new PathRule( - paths, - service - ); + return new PathRule(paths, service); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "PathRule{" - + "paths=" + paths + ", " - + "service=" + service - + "}"; + return "PathRule{" + "paths=" + paths + ", " + "service=" + service + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof PathRule) { PathRule that = (PathRule) o; - return - Objects.equals(this.paths, that.getPathsList()) && - Objects.equals(this.service, that.getService()) - ; + return Objects.equals(this.paths, that.getPathsList()) + && Objects.equals(this.service, that.getService()); } return false; } @Override public int hashCode() { - return Objects.hash( - paths, - service - ); + return Objects.hash(paths, service); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java index 1a6e5a3ef46c..abbed54809b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private PreviewRouterHttpRequest() { this.userIp = null; } - private PreviewRouterHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private PreviewRouterHttpRequest( String quotaUser, String router, Router routerResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(PreviewRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static PreviewRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final PreviewRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new PreviewRouterHttpRequest(); } @@ -342,34 +339,26 @@ public Builder setUserIp(String userIp) { return this; } - public PreviewRouterHttpRequest build() { String missing = ""; - - - - - if (router == null) { missing += " router"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new PreviewRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp); } public Builder clone() { @@ -390,15 +379,32 @@ public Builder clone() { @Override public String toString() { return "PreviewRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "router=" + router + ", " - + "routerResource=" + routerResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "router=" + + router + + ", " + + "routerResource=" + + routerResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +415,15 @@ public boolean equals(Object o) { } if (o instanceof PreviewRouterHttpRequest) { PreviewRouterHttpRequest that = (PreviewRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.routerResource, that.getRouterResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.routerResource, that.getRouterResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +431,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + router, + routerResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java index d32b98e40cd3..c39ee68b0057 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -60,7 +59,6 @@ private Project() { this.xpnProjectStatus = null; } - private Project( Metadata commonInstanceMetadata, String creationTimestamp, @@ -73,8 +71,7 @@ private Project( List quotas, String selfLink, UsageExportLocation usageExportLocation, - String xpnProjectStatus - ) { + String xpnProjectStatus) { this.commonInstanceMetadata = commonInstanceMetadata; this.creationTimestamp = creationTimestamp; this.defaultServiceAccount = defaultServiceAccount; @@ -93,13 +90,18 @@ private Project( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("commonInstanceMetadata") && commonInstanceMetadata != null) { - fieldMap.put("commonInstanceMetadata", Collections.singletonList(String.valueOf(commonInstanceMetadata))); + fieldMap.put( + "commonInstanceMetadata", + Collections.singletonList(String.valueOf(commonInstanceMetadata))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("defaultServiceAccount") && defaultServiceAccount != null) { - fieldMap.put("defaultServiceAccount", Collections.singletonList(String.valueOf(defaultServiceAccount))); + fieldMap.put( + "defaultServiceAccount", + Collections.singletonList(String.valueOf(defaultServiceAccount))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -131,7 +133,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } if (fieldNames.contains("usageExportLocation") && usageExportLocation != null) { - fieldMap.put("usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation))); + fieldMap.put( + "usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation))); } if (fieldNames.contains("xpnProjectStatus") && xpnProjectStatus != null) { fieldMap.put("xpnProjectStatus", Collections.singletonList(String.valueOf(xpnProjectStatus))); @@ -234,22 +237,24 @@ public String getXpnProjectStatus() { return xpnProjectStatus; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Project prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Project getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Project DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Project(); } @@ -450,33 +455,21 @@ public Builder setXpnProjectStatus(String xpnProjectStatus) { return this; } - public Project build() { - - - - - - - - - - return new Project( - commonInstanceMetadata, - creationTimestamp, - defaultServiceAccount, - description, - enabledFeatures, - id, - kind, - name, - quotas, - selfLink, - usageExportLocation, - xpnProjectStatus - ); + commonInstanceMetadata, + creationTimestamp, + defaultServiceAccount, + description, + enabledFeatures, + id, + kind, + name, + quotas, + selfLink, + usageExportLocation, + xpnProjectStatus); } public Builder clone() { @@ -500,18 +493,41 @@ public Builder clone() { @Override public String toString() { return "Project{" - + "commonInstanceMetadata=" + commonInstanceMetadata + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "defaultServiceAccount=" + defaultServiceAccount + ", " - + "description=" + description + ", " - + "enabledFeatures=" + enabledFeatures + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "quotas=" + quotas + ", " - + "selfLink=" + selfLink + ", " - + "usageExportLocation=" + usageExportLocation + ", " - + "xpnProjectStatus=" + xpnProjectStatus + + "commonInstanceMetadata=" + + commonInstanceMetadata + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "defaultServiceAccount=" + + defaultServiceAccount + + ", " + + "description=" + + description + + ", " + + "enabledFeatures=" + + enabledFeatures + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "quotas=" + + quotas + + ", " + + "selfLink=" + + selfLink + + ", " + + "usageExportLocation=" + + usageExportLocation + + ", " + + "xpnProjectStatus=" + + xpnProjectStatus + "}"; } @@ -522,20 +538,18 @@ public boolean equals(Object o) { } if (o instanceof Project) { Project that = (Project) o; - return - Objects.equals(this.commonInstanceMetadata, that.getCommonInstanceMetadata()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.defaultServiceAccount, that.getDefaultServiceAccount()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.enabledFeatures, that.getEnabledFeaturesList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.quotas, that.getQuotasList()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.usageExportLocation, that.getUsageExportLocation()) && - Objects.equals(this.xpnProjectStatus, that.getXpnProjectStatus()) - ; + return Objects.equals(this.commonInstanceMetadata, that.getCommonInstanceMetadata()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.defaultServiceAccount, that.getDefaultServiceAccount()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.enabledFeatures, that.getEnabledFeaturesList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.quotas, that.getQuotasList()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.usageExportLocation, that.getUsageExportLocation()) + && Objects.equals(this.xpnProjectStatus, that.getXpnProjectStatus()); } return false; } @@ -543,18 +557,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - commonInstanceMetadata, - creationTimestamp, - defaultServiceAccount, - description, - enabledFeatures, - id, - kind, - name, - quotas, - selfLink, - usageExportLocation, - xpnProjectStatus - ); + commonInstanceMetadata, + creationTimestamp, + defaultServiceAccount, + description, + enabledFeatures, + id, + kind, + name, + quotas, + selfLink, + usageExportLocation, + xpnProjectStatus); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java deleted file mode 100644 index 049faf4cc280..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendBucketName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectBackendBucketName implements com.google.api.resourcenames.ResourceName { - private final String backendBucket; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/backendBuckets/{backendBucket}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectBackendBucketName(Builder builder) { - backendBucket = Preconditions.checkNotNull(builder.getBackendBucket()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectBackendBucketName of( - String backendBucket, - String project - ) { - return newBuilder() - .setBackendBucket(backendBucket) - .setProject(project) - .build(); - } - - public static String format( - String backendBucket, - String project - ) { - return of( - backendBucket, - project - ) - .toString(); - } - - public String getBackendBucket() { - return backendBucket; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("backendBucket", backendBucket); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectBackendBucketName parse(String formattedString) {return ProjectBackendBucketName.parse(formattedString);} - }; - } - - public static ProjectBackendBucketName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectBackendBucketName.parse: formattedString not in valid format"); - return of( - matchMap.get("backendBucket"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String backendBucket; - private String project; - - public String getBackendBucket() { - return backendBucket; - } - public String getProject() { - return project; - } - - public Builder setBackendBucket(String backendBucket) { - this.backendBucket = backendBucket; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectBackendBucketName projectBackendBucketName) { - backendBucket = projectBackendBucketName.backendBucket; - project = projectBackendBucketName.project; - } - - public ProjectBackendBucketName build() { - return new ProjectBackendBucketName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "backendBucket", backendBucket, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectBackendBucketName) { - ProjectBackendBucketName that = (ProjectBackendBucketName) o; - return - Objects.equals(this.backendBucket, that.getBackendBucket()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - backendBucket, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java deleted file mode 100644 index f35735edd8e5..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectBackendServiceName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectBackendServiceName implements com.google.api.resourcenames.ResourceName { - private final String backendService; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/backendServices/{backendService}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectBackendServiceName(Builder builder) { - backendService = Preconditions.checkNotNull(builder.getBackendService()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectBackendServiceName of( - String backendService, - String project - ) { - return newBuilder() - .setBackendService(backendService) - .setProject(project) - .build(); - } - - public static String format( - String backendService, - String project - ) { - return of( - backendService, - project - ) - .toString(); - } - - public String getBackendService() { - return backendService; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("backendService", backendService); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectBackendServiceName parse(String formattedString) {return ProjectBackendServiceName.parse(formattedString);} - }; - } - - public static ProjectBackendServiceName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectBackendServiceName.parse: formattedString not in valid format"); - return of( - matchMap.get("backendService"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String backendService; - private String project; - - public String getBackendService() { - return backendService; - } - public String getProject() { - return project; - } - - public Builder setBackendService(String backendService) { - this.backendService = backendService; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectBackendServiceName projectBackendServiceName) { - backendService = projectBackendServiceName.backendService; - project = projectBackendServiceName.project; - } - - public ProjectBackendServiceName build() { - return new ProjectBackendServiceName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "backendService", backendService, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectBackendServiceName) { - ProjectBackendServiceName that = (ProjectBackendServiceName) o; - return - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - backendService, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java index c56ff8a30e30..3c684c877a17 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.ProjectStub; import com.google.cloud.compute.v1.stub.ProjectStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,33 @@ * *

* - *

Note: close() needs to be called on the projectClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the projectClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of ProjectSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of ProjectSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class ProjectClient implements BackgroundResource {
   private final ProjectSettings settings;
   private final ProjectStub stub;
 
-
-
-  /**
-   * Constructs an instance of ProjectClient with default settings.
-   */
+  /** Constructs an instance of ProjectClient with default settings. */
   public static final ProjectClient create() throws IOException {
     return create(ProjectSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of ProjectClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of ProjectClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final ProjectClient create(ProjectSettings settings) throws IOException {
     return new ProjectClient(settings);
@@ -144,9 +128,8 @@ public static final ProjectClient create(ProjectStub stub) {
   }
 
   /**
-   * Constructs an instance of ProjectClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of ProjectClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected ProjectClient(ProjectSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +151,12 @@ public ProjectStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Disable this project as a shared VPC host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -182,11 +165,15 @@ public ProjectStub getStub() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -195,9 +182,9 @@ public final Operation disableXpnHostProject(String requestId, ProjectName proje DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .build(); return disableXpnHostProject(request); } @@ -205,7 +192,8 @@ public final Operation disableXpnHostProject(String requestId, ProjectName proje /** * Disable this project as a shared VPC host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -214,11 +202,15 @@ public final Operation disableXpnHostProject(String requestId, ProjectName proje
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +219,9 @@ public final Operation disableXpnHostProject(String requestId, String project) { DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .build(); + .setRequestId(requestId) + .setProject(project) + .build(); return disableXpnHostProject(request); } @@ -237,7 +229,8 @@ public final Operation disableXpnHostProject(String requestId, String project) { /** * Disable this project as a shared VPC host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -262,7 +255,8 @@ public final Operation disableXpnHostProject(DisableXpnHostProjectHttpRequest re
   /**
    * Disable this project as a shared VPC host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -278,7 +272,8 @@ public final Operation disableXpnHostProject(DisableXpnHostProjectHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable disableXpnHostProjectCallable() { + public final UnaryCallable + disableXpnHostProjectCallable() { return stub.disableXpnHostProjectCallable(); } @@ -286,7 +281,8 @@ public final UnaryCallable disableX /** * Disable a serivce resource (a.k.a service project) associated with this host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -296,24 +292,31 @@ public final UnaryCallable disableX
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsDisableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation disableXpnResourceProject(String requestId, ProjectName project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { + public final Operation disableXpnResourceProject( + String requestId, + ProjectName project, + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) + .build(); return disableXpnResourceProject(request); } @@ -321,7 +324,8 @@ public final Operation disableXpnResourceProject(String requestId, ProjectName p /** * Disable a serivce resource (a.k.a service project) associated with this host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -331,24 +335,31 @@ public final Operation disableXpnResourceProject(String requestId, ProjectName p
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsDisableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation disableXpnResourceProject(String requestId, String project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { + public final Operation disableXpnResourceProject( + String requestId, + String project, + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) + .build(); return disableXpnResourceProject(request); } @@ -356,7 +367,8 @@ public final Operation disableXpnResourceProject(String requestId, String projec /** * Disable a serivce resource (a.k.a service project) associated with this host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -383,7 +395,8 @@ public final Operation disableXpnResourceProject(DisableXpnResourceProjectHttpRe
   /**
    * Disable a serivce resource (a.k.a service project) associated with this host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -401,7 +414,8 @@ public final Operation disableXpnResourceProject(DisableXpnResourceProjectHttpRe
    * 
*/ @BetaApi - public final UnaryCallable disableXpnResourceProjectCallable() { + public final UnaryCallable + disableXpnResourceProjectCallable() { return stub.disableXpnResourceProjectCallable(); } @@ -409,7 +423,8 @@ public final UnaryCallable disa /** * Enable this project as a shared VPC host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -418,11 +433,15 @@ public final UnaryCallable disa
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -431,9 +450,9 @@ public final Operation enableXpnHostProject(String requestId, ProjectName projec EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .build(); return enableXpnHostProject(request); } @@ -441,7 +460,8 @@ public final Operation enableXpnHostProject(String requestId, ProjectName projec /** * Enable this project as a shared VPC host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -450,11 +470,15 @@ public final Operation enableXpnHostProject(String requestId, ProjectName projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -463,9 +487,9 @@ public final Operation enableXpnHostProject(String requestId, String project) { EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .build(); + .setRequestId(requestId) + .setProject(project) + .build(); return enableXpnHostProject(request); } @@ -473,7 +497,8 @@ public final Operation enableXpnHostProject(String requestId, String project) { /** * Enable this project as a shared VPC host project. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -498,7 +523,8 @@ public final Operation enableXpnHostProject(EnableXpnHostProjectHttpRequest requ
   /**
    * Enable this project as a shared VPC host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -514,15 +540,18 @@ public final Operation enableXpnHostProject(EnableXpnHostProjectHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable enableXpnHostProjectCallable() { + public final UnaryCallable + enableXpnHostProjectCallable() { return stub.enableXpnHostProjectCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -532,32 +561,41 @@ public final UnaryCallable enableXpn
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsEnableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation enableXpnResourceProject(String requestId, ProjectName project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + public final Operation enableXpnResourceProject( + String requestId, + ProjectName project, + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) + .build(); return enableXpnResourceProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -567,32 +605,41 @@ public final Operation enableXpnResourceProject(String requestId, ProjectName pr
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsEnableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation enableXpnResourceProject(String requestId, String project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + public final Operation enableXpnResourceProject( + String requestId, + String project, + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) + .build(); return enableXpnResourceProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -617,9 +664,11 @@ public final Operation enableXpnResourceProject(EnableXpnResourceProjectHttpRequ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -637,7 +686,8 @@ public final Operation enableXpnResourceProject(EnableXpnResourceProjectHttpRequ
    * 
*/ @BetaApi - public final UnaryCallable enableXpnResourceProjectCallable() { + public final UnaryCallable + enableXpnResourceProjectCallable() { return stub.enableXpnResourceProjectCallable(); } @@ -645,7 +695,8 @@ public final UnaryCallable enabl /** * Returns the specified Project resource. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -661,8 +712,8 @@ public final Project getProject(ProjectName project) {
 
     GetProjectHttpRequest request =
         GetProjectHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return getProject(request);
   }
 
@@ -670,7 +721,8 @@ public final Project getProject(ProjectName project) {
   /**
    * Returns the specified Project resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -684,10 +736,7 @@ public final Project getProject(ProjectName project) {
   @BetaApi
   public final Project getProject(String project) {
 
-    GetProjectHttpRequest request =
-        GetProjectHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+    GetProjectHttpRequest request = GetProjectHttpRequest.newBuilder().setProject(project).build();
     return getProject(request);
   }
 
@@ -695,7 +744,8 @@ public final Project getProject(String project) {
   /**
    * Returns the specified Project resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -718,7 +768,8 @@ private final Project getProject(GetProjectHttpRequest request) {
   /**
    * Returns the specified Project resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -740,7 +791,8 @@ public final UnaryCallable getProjectCallable()
   /**
    * Get the shared VPC host project that this project links to. May be empty if no link exists.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -756,8 +808,8 @@ public final Project getXpnHostProject(ProjectName project) {
 
     GetXpnHostProjectHttpRequest request =
         GetXpnHostProjectHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return getXpnHostProject(request);
   }
 
@@ -765,7 +817,8 @@ public final Project getXpnHostProject(ProjectName project) {
   /**
    * Get the shared VPC host project that this project links to. May be empty if no link exists.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -780,9 +833,7 @@ public final Project getXpnHostProject(ProjectName project) {
   public final Project getXpnHostProject(String project) {
 
     GetXpnHostProjectHttpRequest request =
-        GetXpnHostProjectHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        GetXpnHostProjectHttpRequest.newBuilder().setProject(project).build();
     return getXpnHostProject(request);
   }
 
@@ -790,7 +841,8 @@ public final Project getXpnHostProject(String project) {
   /**
    * Get the shared VPC host project that this project links to. May be empty if no link exists.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -813,7 +865,8 @@ private final Project getXpnHostProject(GetXpnHostProjectHttpRequest request) {
   /**
    * Get the shared VPC host project that this project links to. May be empty if no link exists.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -835,7 +888,8 @@ public final UnaryCallable getXpnHostProj
   /**
    * Get service resources (a.k.a service project) associated with this host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -852,8 +906,8 @@ public final UnaryCallable getXpnHostProj
   public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(ProjectName project) {
     GetXpnResourcesProjectsHttpRequest request =
         GetXpnResourcesProjectsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return getXpnResourcesProjects(request);
   }
 
@@ -861,7 +915,8 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(Projec
   /**
    * Get service resources (a.k.a service project) associated with this host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -877,9 +932,7 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(Projec
   @BetaApi
   public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(String project) {
     GetXpnResourcesProjectsHttpRequest request =
-        GetXpnResourcesProjectsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        GetXpnResourcesProjectsHttpRequest.newBuilder().setProject(project).build();
     return getXpnResourcesProjects(request);
   }
 
@@ -887,7 +940,8 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(String
   /**
    * Get service resources (a.k.a service project) associated with this host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -904,16 +958,17 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(GetXpnResourcesProjectsHttpRequest request) {
-    return getXpnResourcesProjectsPagedCallable()
-        .call(request);
+  public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(
+      GetXpnResourcesProjectsHttpRequest request) {
+    return getXpnResourcesProjectsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Get service resources (a.k.a service project) associated with this host project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -929,7 +984,9 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(GetXpn
    * 
*/ @BetaApi - public final UnaryCallable getXpnResourcesProjectsPagedCallable() { + public final UnaryCallable< + GetXpnResourcesProjectsHttpRequest, GetXpnResourcesProjectsPagedResponse> + getXpnResourcesProjectsPagedCallable() { return stub.getXpnResourcesProjectsPagedCallable(); } @@ -937,7 +994,8 @@ public final UnaryCallableSample code: + * *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -960,7 +1018,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable getXpnResourcesProjectsCallable() { + public final UnaryCallable + getXpnResourcesProjectsCallable() { return stub.getXpnResourcesProjectsCallable(); } @@ -968,7 +1027,8 @@ public final UnaryCallableSample code: + * *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -984,12 +1044,13 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -1013,12 +1075,13 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(ProjectName
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(String project, ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) {
+  public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(
+      String project, ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource) {
     ListXpnHostsProjectsHttpRequest request =
         ListXpnHostsProjectsHttpRequest.newBuilder()
-        .setProject(project)
-        .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource)
-        .build();
+            .setProject(project)
+            .setProjectsListXpnHostsRequestResource(projectsListXpnHostsRequestResource)
+            .build();
     return listXpnHostsProjects(request);
   }
 
@@ -1026,7 +1089,8 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(String proje
   /**
    * List all shared VPC host projects visible to the user in an organization.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -1045,16 +1109,17 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(String proje
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(ListXpnHostsProjectsHttpRequest request) {
-    return listXpnHostsProjectsPagedCallable()
-        .call(request);
+  public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(
+      ListXpnHostsProjectsHttpRequest request) {
+    return listXpnHostsProjectsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * List all shared VPC host projects visible to the user in an organization.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -1072,7 +1137,8 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(ListXpnHosts
    * 
*/ @BetaApi - public final UnaryCallable listXpnHostsProjectsPagedCallable() { + public final UnaryCallable + listXpnHostsProjectsPagedCallable() { return stub.listXpnHostsProjectsPagedCallable(); } @@ -1080,7 +1146,8 @@ public final UnaryCallableSample code: + * *

    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -1105,7 +1172,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listXpnHostsProjectsCallable() { + public final UnaryCallable + listXpnHostsProjectsCallable() { return stub.listXpnHostsProjectsCallable(); } @@ -1113,7 +1181,8 @@ public final UnaryCallable listXpn /** * Moves a persistent disk from one zone to another. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1123,24 +1192,29 @@ public final UnaryCallable listXpn
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param diskMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveDiskProject(String requestId, ProjectName project, DiskMoveRequest diskMoveRequestResource) { + public final Operation moveDiskProject( + String requestId, ProjectName project, DiskMoveRequest diskMoveRequestResource) { MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setDiskMoveRequestResource(diskMoveRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setDiskMoveRequestResource(diskMoveRequestResource) + .build(); return moveDiskProject(request); } @@ -1148,7 +1222,8 @@ public final Operation moveDiskProject(String requestId, ProjectName project, Di /** * Moves a persistent disk from one zone to another. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1158,24 +1233,29 @@ public final Operation moveDiskProject(String requestId, ProjectName project, Di
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param diskMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveDiskProject(String requestId, String project, DiskMoveRequest diskMoveRequestResource) { + public final Operation moveDiskProject( + String requestId, String project, DiskMoveRequest diskMoveRequestResource) { MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setDiskMoveRequestResource(diskMoveRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setDiskMoveRequestResource(diskMoveRequestResource) + .build(); return moveDiskProject(request); } @@ -1183,7 +1263,8 @@ public final Operation moveDiskProject(String requestId, String project, DiskMov /** * Moves a persistent disk from one zone to another. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1210,7 +1291,8 @@ public final Operation moveDiskProject(MoveDiskProjectHttpRequest request) {
   /**
    * Moves a persistent disk from one zone to another.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1236,7 +1318,8 @@ public final UnaryCallable moveDiskProjec
   /**
    * Moves an instance and its attached persistent disks from one zone to another.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1246,24 +1329,29 @@ public final UnaryCallable moveDiskProjec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveInstanceProject(String requestId, ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { + public final Operation moveInstanceProject( + String requestId, ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setInstanceMoveRequestResource(instanceMoveRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setInstanceMoveRequestResource(instanceMoveRequestResource) + .build(); return moveInstanceProject(request); } @@ -1271,7 +1359,8 @@ public final Operation moveInstanceProject(String requestId, ProjectName project /** * Moves an instance and its attached persistent disks from one zone to another. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1281,24 +1370,29 @@ public final Operation moveInstanceProject(String requestId, ProjectName project
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveInstanceProject(String requestId, String project, InstanceMoveRequest instanceMoveRequestResource) { + public final Operation moveInstanceProject( + String requestId, String project, InstanceMoveRequest instanceMoveRequestResource) { MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setInstanceMoveRequestResource(instanceMoveRequestResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setInstanceMoveRequestResource(instanceMoveRequestResource) + .build(); return moveInstanceProject(request); } @@ -1306,7 +1400,8 @@ public final Operation moveInstanceProject(String requestId, String project, Ins /** * Moves an instance and its attached persistent disks from one zone to another. * - * Sample code: + *

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1333,7 +1428,8 @@ public final Operation moveInstanceProject(MoveInstanceProjectHttpRequest reques
   /**
    * Moves an instance and its attached persistent disks from one zone to another.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1351,15 +1447,18 @@ public final Operation moveInstanceProject(MoveInstanceProjectHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable moveInstanceProjectCallable() { + public final UnaryCallable + moveInstanceProjectCallable() { return stub.moveInstanceProjectCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata common to all instances within the specified project using the data included in the request. + * Sets metadata common to all instances within the specified project using the data included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1369,32 +1468,39 @@ public final UnaryCallable moveInstan
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setCommonInstanceMetadataProject(String requestId, ProjectName project, Metadata metadataResource) { + public final Operation setCommonInstanceMetadataProject( + String requestId, ProjectName project, Metadata metadataResource) { SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setMetadataResource(metadataResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setMetadataResource(metadataResource) + .build(); return setCommonInstanceMetadataProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata common to all instances within the specified project using the data included in the request. + * Sets metadata common to all instances within the specified project using the data included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1404,32 +1510,39 @@ public final Operation setCommonInstanceMetadataProject(String requestId, Projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setCommonInstanceMetadataProject(String requestId, String project, Metadata metadataResource) { + public final Operation setCommonInstanceMetadataProject( + String requestId, String project, Metadata metadataResource) { SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setMetadataResource(metadataResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setMetadataResource(metadataResource) + .build(); return setCommonInstanceMetadataProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets metadata common to all instances within the specified project using the data included in the request. + * Sets metadata common to all instances within the specified project using the data included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1448,15 +1561,18 @@ public final Operation setCommonInstanceMetadataProject(String requestId, String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setCommonInstanceMetadataProject(SetCommonInstanceMetadataProjectHttpRequest request) {
+  public final Operation setCommonInstanceMetadataProject(
+      SetCommonInstanceMetadataProjectHttpRequest request) {
     return setCommonInstanceMetadataProjectCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets metadata common to all instances within the specified project using the data included in the request.
+   * Sets metadata common to all instances within the specified project using the data included in
+   * the request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1474,15 +1590,18 @@ public final Operation setCommonInstanceMetadataProject(SetCommonInstanceMetadat
    * 
*/ @BetaApi - public final UnaryCallable setCommonInstanceMetadataProjectCallable() { + public final UnaryCallable + setCommonInstanceMetadataProjectCallable() { return stub.setCommonInstanceMetadataProjectCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1492,32 +1611,40 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. + * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily + * usage report. Contains bucket_name and report_name prefix. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUsageExportBucketProject(String requestId, ProjectName project, UsageExportLocation usageExportLocationResource) { + public final Operation setUsageExportBucketProject( + String requestId, ProjectName project, UsageExportLocation usageExportLocationResource) { SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setUsageExportLocationResource(usageExportLocationResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setUsageExportLocationResource(usageExportLocationResource) + .build(); return setUsageExportBucketProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1527,32 +1654,40 @@ public final Operation setUsageExportBucketProject(String requestId, ProjectName
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. + * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily + * usage report. Contains bucket_name and report_name prefix. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUsageExportBucketProject(String requestId, String project, UsageExportLocation usageExportLocationResource) { + public final Operation setUsageExportBucketProject( + String requestId, String project, UsageExportLocation usageExportLocationResource) { SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setUsageExportLocationResource(usageExportLocationResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setUsageExportLocationResource(usageExportLocationResource) + .build(); return setUsageExportBucketProject(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1571,15 +1706,18 @@ public final Operation setUsageExportBucketProject(String requestId, String proj
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setUsageExportBucketProject(SetUsageExportBucketProjectHttpRequest request) {
+  public final Operation setUsageExportBucketProject(
+      SetUsageExportBucketProjectHttpRequest request) {
     return setUsageExportBucketProjectCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (ProjectClient projectClient = ProjectClient.create()) {
    *   String requestId = "";
@@ -1597,12 +1735,13 @@ public final Operation setUsageExportBucketProject(SetUsageExportBucketProjectHt
    * 
*/ @BetaApi - public final UnaryCallable setUsageExportBucketProjectCallable() { + public final UnaryCallable + setUsageExportBucketProjectCallable() { return stub.setUsageExportBucketProjectCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1631,15 +1770,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class GetXpnResourcesProjectsPagedResponse extends AbstractPagedListResponse< - GetXpnResourcesProjectsHttpRequest, - ProjectsGetXpnResources, - XpnResourceId, - GetXpnResourcesProjectsPage, - GetXpnResourcesProjectsFixedSizeCollection> { + public static class GetXpnResourcesProjectsPagedResponse + extends AbstractPagedListResponse< + GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, XpnResourceId, + GetXpnResourcesProjectsPage, GetXpnResourcesProjectsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = GetXpnResourcesProjectsPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1656,18 +1794,16 @@ public GetXpnResourcesProjectsPagedResponse apply(GetXpnResourcesProjectsPage in private GetXpnResourcesProjectsPagedResponse(GetXpnResourcesProjectsPage page) { super(page, GetXpnResourcesProjectsFixedSizeCollection.createEmptyCollection()); } - - } - public static class GetXpnResourcesProjectsPage extends AbstractPage< - GetXpnResourcesProjectsHttpRequest, - ProjectsGetXpnResources, - XpnResourceId, - GetXpnResourcesProjectsPage> { + public static class GetXpnResourcesProjectsPage + extends AbstractPage< + GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, XpnResourceId, + GetXpnResourcesProjectsPage> { private GetXpnResourcesProjectsPage( - PageContext context, + PageContext + context, ProjectsGetXpnResources response) { super(context, response); } @@ -1678,31 +1814,28 @@ private static GetXpnResourcesProjectsPage createEmptyPage() { @Override protected GetXpnResourcesProjectsPage createPage( - PageContext context, + PageContext + context, ProjectsGetXpnResources response) { return new GetXpnResourcesProjectsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class GetXpnResourcesProjectsFixedSizeCollection extends AbstractFixedSizeCollection< - GetXpnResourcesProjectsHttpRequest, - ProjectsGetXpnResources, - XpnResourceId, - GetXpnResourcesProjectsPage, - GetXpnResourcesProjectsFixedSizeCollection> { + public static class GetXpnResourcesProjectsFixedSizeCollection + extends AbstractFixedSizeCollection< + GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, XpnResourceId, + GetXpnResourcesProjectsPage, GetXpnResourcesProjectsFixedSizeCollection> { - private GetXpnResourcesProjectsFixedSizeCollection(List pages, int collectionSize) { + private GetXpnResourcesProjectsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1715,15 +1848,12 @@ protected GetXpnResourcesProjectsFixedSizeCollection createCollection( List pages, int collectionSize) { return new GetXpnResourcesProjectsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListXpnHostsProjectsPagedResponse extends AbstractPagedListResponse< - ListXpnHostsProjectsHttpRequest, - XpnHostList, - Project, - ListXpnHostsProjectsPage, - ListXpnHostsProjectsFixedSizeCollection> { + + public static class ListXpnHostsProjectsPagedResponse + extends AbstractPagedListResponse< + ListXpnHostsProjectsHttpRequest, XpnHostList, Project, ListXpnHostsProjectsPage, + ListXpnHostsProjectsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1743,15 +1873,11 @@ public ListXpnHostsProjectsPagedResponse apply(ListXpnHostsProjectsPage input) { private ListXpnHostsProjectsPagedResponse(ListXpnHostsProjectsPage page) { super(page, ListXpnHostsProjectsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListXpnHostsProjectsPage extends AbstractPage< - ListXpnHostsProjectsHttpRequest, - XpnHostList, - Project, - ListXpnHostsProjectsPage> { + public static class ListXpnHostsProjectsPage + extends AbstractPage< + ListXpnHostsProjectsHttpRequest, XpnHostList, Project, ListXpnHostsProjectsPage> { private ListXpnHostsProjectsPage( PageContext context, @@ -1776,20 +1902,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListXpnHostsProjectsFixedSizeCollection extends AbstractFixedSizeCollection< - ListXpnHostsProjectsHttpRequest, - XpnHostList, - Project, - ListXpnHostsProjectsPage, - ListXpnHostsProjectsFixedSizeCollection> { + public static class ListXpnHostsProjectsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListXpnHostsProjectsHttpRequest, XpnHostList, Project, ListXpnHostsProjectsPage, + ListXpnHostsProjectsFixedSizeCollection> { - private ListXpnHostsProjectsFixedSizeCollection(List pages, int collectionSize) { + private ListXpnHostsProjectsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1802,7 +1923,5 @@ protected ListXpnHostsProjectsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListXpnHostsProjectsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java deleted file mode 100644 index 5d1af59abf60..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFamilyName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectFamilyName implements com.google.api.resourcenames.ResourceName { - private final String family; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/family/{family}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectFamilyName(Builder builder) { - family = Preconditions.checkNotNull(builder.getFamily()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectFamilyName of( - String family, - String project - ) { - return newBuilder() - .setFamily(family) - .setProject(project) - .build(); - } - - public static String format( - String family, - String project - ) { - return of( - family, - project - ) - .toString(); - } - - public String getFamily() { - return family; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("family", family); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectFamilyName parse(String formattedString) {return ProjectFamilyName.parse(formattedString);} - }; - } - - public static ProjectFamilyName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectFamilyName.parse: formattedString not in valid format"); - return of( - matchMap.get("family"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String family; - private String project; - - public String getFamily() { - return family; - } - public String getProject() { - return project; - } - - public Builder setFamily(String family) { - this.family = family; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectFamilyName projectFamilyName) { - family = projectFamilyName.family; - project = projectFamilyName.project; - } - - public ProjectFamilyName build() { - return new ProjectFamilyName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "family", family, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectFamilyName) { - ProjectFamilyName that = (ProjectFamilyName) o; - return - Objects.equals(this.family, that.getFamily()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - family, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java deleted file mode 100644 index edaadf7be272..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectFirewallName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectFirewallName implements com.google.api.resourcenames.ResourceName { - private final String firewall; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/firewalls/{firewall}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectFirewallName(Builder builder) { - firewall = Preconditions.checkNotNull(builder.getFirewall()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectFirewallName of( - String firewall, - String project - ) { - return newBuilder() - .setFirewall(firewall) - .setProject(project) - .build(); - } - - public static String format( - String firewall, - String project - ) { - return of( - firewall, - project - ) - .toString(); - } - - public String getFirewall() { - return firewall; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("firewall", firewall); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectFirewallName parse(String formattedString) {return ProjectFirewallName.parse(formattedString);} - }; - } - - public static ProjectFirewallName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectFirewallName.parse: formattedString not in valid format"); - return of( - matchMap.get("firewall"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String firewall; - private String project; - - public String getFirewall() { - return firewall; - } - public String getProject() { - return project; - } - - public Builder setFirewall(String firewall) { - this.firewall = firewall; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectFirewallName projectFirewallName) { - firewall = projectFirewallName.firewall; - project = projectFirewallName.project; - } - - public ProjectFirewallName build() { - return new ProjectFirewallName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "firewall", firewall, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectFirewallName) { - ProjectFirewallName that = (ProjectFirewallName) o; - return - Objects.equals(this.firewall, that.getFirewall()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - firewall, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java similarity index 62% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java index db6a0c39d912..aef55a983e42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectAddressName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectAddressName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalAddressName implements ResourceName { private final String address; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/addresses/{address}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/addresses/{address}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private ProjectAddressName(Builder builder) { + private ProjectGlobalAddressName(Builder builder) { address = Preconditions.checkNotNull(builder.getAddress()); project = Preconditions.checkNotNull(builder.getProject()); } - public static ProjectAddressName of( - String address, - String project - ) { - return newBuilder() - .setAddress(address) - .setProject(project) - .build(); + public static ProjectGlobalAddressName of(String address, String project) { + return newBuilder().setAddress(address).setProject(project).build(); } - public static String format( - String address, - String project - ) { - return of( - address, - project - ) - .toString(); + public static String format(String address, String project) { + return of(address, project).toString(); } public String getAddress() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectAddressName parse(String formattedString) {return ProjectAddressName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalAddressName parse(String formattedString) { + return ProjectGlobalAddressName.parse(formattedString); + } }; } - public static ProjectAddressName parse(String formattedString) { + public static ProjectGlobalAddressName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectAddressName.parse: formattedString not in valid format"); - return of( - matchMap.get("address"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectGlobalAddressName.parse: formattedString not in valid format"); + return of(matchMap.get("address"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getAddress() { return address; } + public String getProject() { return project; } @@ -136,6 +118,7 @@ public Builder setAddress(String address) { this.address = address; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +126,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (ProjectAddressName projectAddressName) { - address = projectAddressName.address; - project = projectAddressName.project; + public Builder(ProjectGlobalAddressName projectGlobalAddressName) { + address = projectGlobalAddressName.address; + project = projectGlobalAddressName.project; } - public ProjectAddressName build() { - return new ProjectAddressName(this); + public ProjectGlobalAddressName build() { + return new ProjectGlobalAddressName(this); } } @@ -157,8 +140,7 @@ public ProjectAddressName build() { public String toString() { return PATH_TEMPLATE.instantiate( "address", address, - "project", project - ); + "project", project); } @Override @@ -166,21 +148,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ProjectAddressName) { - ProjectAddressName that = (ProjectAddressName) o; - return - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalAddressName) { + ProjectGlobalAddressName that = (ProjectGlobalAddressName) o; + return Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - address, - project - ); + return Objects.hash(address, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java similarity index 62% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java index 1fc90a134a30..2c7efcb5b2f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class BackendBucketName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalBackendBucketName implements ResourceName { private final String backendBucket; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/backendBuckets/{backendBucket}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/backendBuckets/{backendBucket}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private BackendBucketName(Builder builder) { + private ProjectGlobalBackendBucketName(Builder builder) { backendBucket = Preconditions.checkNotNull(builder.getBackendBucket()); project = Preconditions.checkNotNull(builder.getProject()); } - public static BackendBucketName of( - String backendBucket, - String project - ) { - return newBuilder() - .setBackendBucket(backendBucket) - .setProject(project) - .build(); + public static ProjectGlobalBackendBucketName of(String backendBucket, String project) { + return newBuilder().setBackendBucket(backendBucket).setProject(project).build(); } - public static String format( - String backendBucket, - String project - ) { - return of( - backendBucket, - project - ) - .toString(); + public static String format(String backendBucket, String project) { + return of(backendBucket, project).toString(); } public String getBackendBucket() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public BackendBucketName parse(String formattedString) {return BackendBucketName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalBackendBucketName parse(String formattedString) { + return ProjectGlobalBackendBucketName.parse(formattedString); + } }; } - public static BackendBucketName parse(String formattedString) { + public static ProjectGlobalBackendBucketName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "BackendBucketName.parse: formattedString not in valid format"); - return of( - matchMap.get("backendBucket"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalBackendBucketName.parse: formattedString not in valid format"); + return of(matchMap.get("backendBucket"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getBackendBucket() { return backendBucket; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setBackendBucket(String backendBucket) { this.backendBucket = backendBucket; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (BackendBucketName backendBucketName) { - backendBucket = backendBucketName.backendBucket; - project = backendBucketName.project; + public Builder(ProjectGlobalBackendBucketName projectGlobalBackendBucketName) { + backendBucket = projectGlobalBackendBucketName.backendBucket; + project = projectGlobalBackendBucketName.project; } - public BackendBucketName build() { - return new BackendBucketName(this); + public ProjectGlobalBackendBucketName build() { + return new ProjectGlobalBackendBucketName(this); } } @@ -157,8 +142,7 @@ public BackendBucketName build() { public String toString() { return PATH_TEMPLATE.instantiate( "backendBucket", backendBucket, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof BackendBucketName) { - BackendBucketName that = (BackendBucketName) o; - return - Objects.equals(this.backendBucket, that.getBackendBucket()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalBackendBucketName) { + ProjectGlobalBackendBucketName that = (ProjectGlobalBackendBucketName) o; + return Objects.equals(this.backendBucket, that.getBackendBucket()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - backendBucket, - project - ); + return Objects.hash(backendBucket, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java similarity index 62% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java index a40f752c9a54..a134a701f0fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class BackendServiceName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalBackendServiceName implements ResourceName { private final String backendService; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/backendServices/{backendService}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/backendServices/{backendService}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private BackendServiceName(Builder builder) { + private ProjectGlobalBackendServiceName(Builder builder) { backendService = Preconditions.checkNotNull(builder.getBackendService()); project = Preconditions.checkNotNull(builder.getProject()); } - public static BackendServiceName of( - String backendService, - String project - ) { - return newBuilder() - .setBackendService(backendService) - .setProject(project) - .build(); + public static ProjectGlobalBackendServiceName of(String backendService, String project) { + return newBuilder().setBackendService(backendService).setProject(project).build(); } - public static String format( - String backendService, - String project - ) { - return of( - backendService, - project - ) - .toString(); + public static String format(String backendService, String project) { + return of(backendService, project).toString(); } public String getBackendService() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public BackendServiceName parse(String formattedString) {return BackendServiceName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalBackendServiceName parse(String formattedString) { + return ProjectGlobalBackendServiceName.parse(formattedString); + } }; } - public static BackendServiceName parse(String formattedString) { + public static ProjectGlobalBackendServiceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "BackendServiceName.parse: formattedString not in valid format"); - return of( - matchMap.get("backendService"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalBackendServiceName.parse: formattedString not in valid format"); + return of(matchMap.get("backendService"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getBackendService() { return backendService; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setBackendService(String backendService) { this.backendService = backendService; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (BackendServiceName backendServiceName) { - backendService = backendServiceName.backendService; - project = backendServiceName.project; + public Builder(ProjectGlobalBackendServiceName projectGlobalBackendServiceName) { + backendService = projectGlobalBackendServiceName.backendService; + project = projectGlobalBackendServiceName.project; } - public BackendServiceName build() { - return new BackendServiceName(this); + public ProjectGlobalBackendServiceName build() { + return new ProjectGlobalBackendServiceName(this); } } @@ -157,8 +142,7 @@ public BackendServiceName build() { public String toString() { return PATH_TEMPLATE.instantiate( "backendService", backendService, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof BackendServiceName) { - BackendServiceName that = (BackendServiceName) o; - return - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalBackendServiceName) { + ProjectGlobalBackendServiceName that = (ProjectGlobalBackendServiceName) o; + return Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - backendService, - project - ); + return Objects.hash(backendService, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java similarity index 64% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java index 74e2200b7f50..af760bb7c9e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class FirewallName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalFirewallName implements ResourceName { private final String firewall; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/firewalls/{firewall}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/firewalls/{firewall}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private FirewallName(Builder builder) { + private ProjectGlobalFirewallName(Builder builder) { firewall = Preconditions.checkNotNull(builder.getFirewall()); project = Preconditions.checkNotNull(builder.getProject()); } - public static FirewallName of( - String firewall, - String project - ) { - return newBuilder() - .setFirewall(firewall) - .setProject(project) - .build(); + public static ProjectGlobalFirewallName of(String firewall, String project) { + return newBuilder().setFirewall(firewall).setProject(project).build(); } - public static String format( - String firewall, - String project - ) { - return of( - firewall, - project - ) - .toString(); + public static String format(String firewall, String project) { + return of(firewall, project).toString(); } public String getFirewall() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public FirewallName parse(String formattedString) {return FirewallName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalFirewallName parse(String formattedString) { + return ProjectGlobalFirewallName.parse(formattedString); + } }; } - public static FirewallName parse(String formattedString) { + public static ProjectGlobalFirewallName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "FirewallName.parse: formattedString not in valid format"); - return of( - matchMap.get("firewall"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalFirewallName.parse: formattedString not in valid format"); + return of(matchMap.get("firewall"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getFirewall() { return firewall; } + public String getProject() { return project; } @@ -136,6 +119,7 @@ public Builder setFirewall(String firewall) { this.firewall = firewall; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +127,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (FirewallName firewallName) { - firewall = firewallName.firewall; - project = firewallName.project; + public Builder(ProjectGlobalFirewallName projectGlobalFirewallName) { + firewall = projectGlobalFirewallName.firewall; + project = projectGlobalFirewallName.project; } - public FirewallName build() { - return new FirewallName(this); + public ProjectGlobalFirewallName build() { + return new ProjectGlobalFirewallName(this); } } @@ -157,8 +141,7 @@ public FirewallName build() { public String toString() { return PATH_TEMPLATE.instantiate( "firewall", firewall, - "project", project - ); + "project", project); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof FirewallName) { - FirewallName that = (FirewallName) o; - return - Objects.equals(this.firewall, that.getFirewall()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalFirewallName) { + ProjectGlobalFirewallName that = (ProjectGlobalFirewallName) o; + return Objects.equals(this.firewall, that.getFirewall()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - firewall, - project - ); + return Objects.hash(firewall, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java similarity index 60% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java index ffd5d3aeef5d..8fcf192fc910 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectForwardingRuleName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectForwardingRuleName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalForwardingRuleName implements ResourceName { private final String forwardingRule; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/forwardingRules/{forwardingRule}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/forwardingRules/{forwardingRule}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private ProjectForwardingRuleName(Builder builder) { + private ProjectGlobalForwardingRuleName(Builder builder) { forwardingRule = Preconditions.checkNotNull(builder.getForwardingRule()); project = Preconditions.checkNotNull(builder.getProject()); } - public static ProjectForwardingRuleName of( - String forwardingRule, - String project - ) { - return newBuilder() - .setForwardingRule(forwardingRule) - .setProject(project) - .build(); + public static ProjectGlobalForwardingRuleName of(String forwardingRule, String project) { + return newBuilder().setForwardingRule(forwardingRule).setProject(project).build(); } - public static String format( - String forwardingRule, - String project - ) { - return of( - forwardingRule, - project - ) - .toString(); + public static String format(String forwardingRule, String project) { + return of(forwardingRule, project).toString(); } public String getForwardingRule() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectForwardingRuleName parse(String formattedString) {return ProjectForwardingRuleName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalForwardingRuleName parse(String formattedString) { + return ProjectGlobalForwardingRuleName.parse(formattedString); + } }; } - public static ProjectForwardingRuleName parse(String formattedString) { + public static ProjectGlobalForwardingRuleName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectForwardingRuleName.parse: formattedString not in valid format"); - return of( - matchMap.get("forwardingRule"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalForwardingRuleName.parse: formattedString not in valid format"); + return of(matchMap.get("forwardingRule"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getForwardingRule() { return forwardingRule; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setForwardingRule(String forwardingRule) { this.forwardingRule = forwardingRule; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (ProjectForwardingRuleName projectForwardingRuleName) { - forwardingRule = projectForwardingRuleName.forwardingRule; - project = projectForwardingRuleName.project; + public Builder(ProjectGlobalForwardingRuleName projectGlobalForwardingRuleName) { + forwardingRule = projectGlobalForwardingRuleName.forwardingRule; + project = projectGlobalForwardingRuleName.project; } - public ProjectForwardingRuleName build() { - return new ProjectForwardingRuleName(this); + public ProjectGlobalForwardingRuleName build() { + return new ProjectGlobalForwardingRuleName(this); } } @@ -157,8 +142,7 @@ public ProjectForwardingRuleName build() { public String toString() { return PATH_TEMPLATE.instantiate( "forwardingRule", forwardingRule, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ProjectForwardingRuleName) { - ProjectForwardingRuleName that = (ProjectForwardingRuleName) o; - return - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalForwardingRuleName) { + ProjectGlobalForwardingRuleName that = (ProjectGlobalForwardingRuleName) o; + return Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - forwardingRule, - project - ); + return Objects.hash(forwardingRule, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java similarity index 63% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java index 86a2cde0c9f4..30c28b855e22 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class HealthCheckName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalHealthCheckName implements ResourceName { private final String healthCheck; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/healthChecks/{healthCheck}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/healthChecks/{healthCheck}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private HealthCheckName(Builder builder) { + private ProjectGlobalHealthCheckName(Builder builder) { healthCheck = Preconditions.checkNotNull(builder.getHealthCheck()); project = Preconditions.checkNotNull(builder.getProject()); } - public static HealthCheckName of( - String healthCheck, - String project - ) { - return newBuilder() - .setHealthCheck(healthCheck) - .setProject(project) - .build(); + public static ProjectGlobalHealthCheckName of(String healthCheck, String project) { + return newBuilder().setHealthCheck(healthCheck).setProject(project).build(); } - public static String format( - String healthCheck, - String project - ) { - return of( - healthCheck, - project - ) - .toString(); + public static String format(String healthCheck, String project) { + return of(healthCheck, project).toString(); } public String getHealthCheck() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public HealthCheckName parse(String formattedString) {return HealthCheckName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalHealthCheckName parse(String formattedString) { + return ProjectGlobalHealthCheckName.parse(formattedString); + } }; } - public static HealthCheckName parse(String formattedString) { + public static ProjectGlobalHealthCheckName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "HealthCheckName.parse: formattedString not in valid format"); - return of( - matchMap.get("healthCheck"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalHealthCheckName.parse: formattedString not in valid format"); + return of(matchMap.get("healthCheck"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getHealthCheck() { return healthCheck; } + public String getProject() { return project; } @@ -136,6 +119,7 @@ public Builder setHealthCheck(String healthCheck) { this.healthCheck = healthCheck; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +127,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (HealthCheckName healthCheckName) { - healthCheck = healthCheckName.healthCheck; - project = healthCheckName.project; + public Builder(ProjectGlobalHealthCheckName projectGlobalHealthCheckName) { + healthCheck = projectGlobalHealthCheckName.healthCheck; + project = projectGlobalHealthCheckName.project; } - public HealthCheckName build() { - return new HealthCheckName(this); + public ProjectGlobalHealthCheckName build() { + return new ProjectGlobalHealthCheckName(this); } } @@ -157,8 +141,7 @@ public HealthCheckName build() { public String toString() { return PATH_TEMPLATE.instantiate( "healthCheck", healthCheck, - "project", project - ); + "project", project); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HealthCheckName) { - HealthCheckName that = (HealthCheckName) o; - return - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalHealthCheckName) { + ProjectGlobalHealthCheckName that = (ProjectGlobalHealthCheckName) o; + return Objects.equals(this.healthCheck, that.getHealthCheck()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthCheck, - project - ); + return Objects.hash(healthCheck, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java index 3496765f4d67..b4ec6ba5d125 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class HttpHealthCheckName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalHttpHealthCheckName implements ResourceName { private final String httpHealthCheck; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/httpHealthChecks/{httpHealthCheck}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/httpHealthChecks/{httpHealthCheck}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private HttpHealthCheckName(Builder builder) { + private ProjectGlobalHttpHealthCheckName(Builder builder) { httpHealthCheck = Preconditions.checkNotNull(builder.getHttpHealthCheck()); project = Preconditions.checkNotNull(builder.getProject()); } - public static HttpHealthCheckName of( - String httpHealthCheck, - String project - ) { - return newBuilder() - .setHttpHealthCheck(httpHealthCheck) - .setProject(project) - .build(); + public static ProjectGlobalHttpHealthCheckName of(String httpHealthCheck, String project) { + return newBuilder().setHttpHealthCheck(httpHealthCheck).setProject(project).build(); } - public static String format( - String httpHealthCheck, - String project - ) { - return of( - httpHealthCheck, - project - ) - .toString(); + public static String format(String httpHealthCheck, String project) { + return of(httpHealthCheck, project).toString(); } public String getHttpHealthCheck() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public HttpHealthCheckName parse(String formattedString) {return HttpHealthCheckName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalHttpHealthCheckName parse(String formattedString) { + return ProjectGlobalHttpHealthCheckName.parse(formattedString); + } }; } - public static HttpHealthCheckName parse(String formattedString) { + public static ProjectGlobalHttpHealthCheckName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "HttpHealthCheckName.parse: formattedString not in valid format"); - return of( - matchMap.get("httpHealthCheck"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalHttpHealthCheckName.parse: formattedString not in valid format"); + return of(matchMap.get("httpHealthCheck"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getHttpHealthCheck() { return httpHealthCheck; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { this.httpHealthCheck = httpHealthCheck; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (HttpHealthCheckName httpHealthCheckName) { - httpHealthCheck = httpHealthCheckName.httpHealthCheck; - project = httpHealthCheckName.project; + public Builder(ProjectGlobalHttpHealthCheckName projectGlobalHttpHealthCheckName) { + httpHealthCheck = projectGlobalHttpHealthCheckName.httpHealthCheck; + project = projectGlobalHttpHealthCheckName.project; } - public HttpHealthCheckName build() { - return new HttpHealthCheckName(this); + public ProjectGlobalHttpHealthCheckName build() { + return new ProjectGlobalHttpHealthCheckName(this); } } @@ -157,8 +142,7 @@ public HttpHealthCheckName build() { public String toString() { return PATH_TEMPLATE.instantiate( "httpHealthCheck", httpHealthCheck, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HttpHealthCheckName) { - HttpHealthCheckName that = (HttpHealthCheckName) o; - return - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalHttpHealthCheckName) { + ProjectGlobalHttpHealthCheckName that = (ProjectGlobalHttpHealthCheckName) o; + return Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - httpHealthCheck, - project - ); + return Objects.hash(httpHealthCheck, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java index da2e4e96d0ae..1db72f238bf1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class HttpsHealthCheckName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalHttpsHealthCheckName implements ResourceName { private final String httpsHealthCheck; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/httpsHealthChecks/{httpsHealthCheck}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private HttpsHealthCheckName(Builder builder) { + private ProjectGlobalHttpsHealthCheckName(Builder builder) { httpsHealthCheck = Preconditions.checkNotNull(builder.getHttpsHealthCheck()); project = Preconditions.checkNotNull(builder.getProject()); } - public static HttpsHealthCheckName of( - String httpsHealthCheck, - String project - ) { - return newBuilder() - .setHttpsHealthCheck(httpsHealthCheck) - .setProject(project) - .build(); + public static ProjectGlobalHttpsHealthCheckName of(String httpsHealthCheck, String project) { + return newBuilder().setHttpsHealthCheck(httpsHealthCheck).setProject(project).build(); } - public static String format( - String httpsHealthCheck, - String project - ) { - return of( - httpsHealthCheck, - project - ) - .toString(); + public static String format(String httpsHealthCheck, String project) { + return of(httpsHealthCheck, project).toString(); } public String getHttpsHealthCheck() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public HttpsHealthCheckName parse(String formattedString) {return HttpsHealthCheckName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalHttpsHealthCheckName parse(String formattedString) { + return ProjectGlobalHttpsHealthCheckName.parse(formattedString); + } }; } - public static HttpsHealthCheckName parse(String formattedString) { + public static ProjectGlobalHttpsHealthCheckName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "HttpsHealthCheckName.parse: formattedString not in valid format"); - return of( - matchMap.get("httpsHealthCheck"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalHttpsHealthCheckName.parse: formattedString not in valid format"); + return of(matchMap.get("httpsHealthCheck"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getHttpsHealthCheck() { return httpsHealthCheck; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { this.httpsHealthCheck = httpsHealthCheck; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (HttpsHealthCheckName httpsHealthCheckName) { - httpsHealthCheck = httpsHealthCheckName.httpsHealthCheck; - project = httpsHealthCheckName.project; + public Builder(ProjectGlobalHttpsHealthCheckName projectGlobalHttpsHealthCheckName) { + httpsHealthCheck = projectGlobalHttpsHealthCheckName.httpsHealthCheck; + project = projectGlobalHttpsHealthCheckName.project; } - public HttpsHealthCheckName build() { - return new HttpsHealthCheckName(this); + public ProjectGlobalHttpsHealthCheckName build() { + return new ProjectGlobalHttpsHealthCheckName(this); } } @@ -157,8 +142,7 @@ public HttpsHealthCheckName build() { public String toString() { return PATH_TEMPLATE.instantiate( "httpsHealthCheck", httpsHealthCheck, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HttpsHealthCheckName) { - HttpsHealthCheckName that = (HttpsHealthCheckName) o; - return - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalHttpsHealthCheckName) { + ProjectGlobalHttpsHealthCheckName that = (ProjectGlobalHttpsHealthCheckName) o; + return Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - httpsHealthCheck, - project - ); + return Objects.hash(httpsHealthCheck, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java similarity index 63% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java index 1946b47df1ef..13196e0b2749 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FamilyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class FamilyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalImageFamilyName implements ResourceName { private final String family; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/family/{family}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/images/family/{family}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private FamilyName(Builder builder) { + private ProjectGlobalImageFamilyName(Builder builder) { family = Preconditions.checkNotNull(builder.getFamily()); project = Preconditions.checkNotNull(builder.getProject()); } - public static FamilyName of( - String family, - String project - ) { - return newBuilder() - .setFamily(family) - .setProject(project) - .build(); + public static ProjectGlobalImageFamilyName of(String family, String project) { + return newBuilder().setFamily(family).setProject(project).build(); } - public static String format( - String family, - String project - ) { - return of( - family, - project - ) - .toString(); + public static String format(String family, String project) { + return of(family, project).toString(); } public String getFamily() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public FamilyName parse(String formattedString) {return FamilyName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalImageFamilyName parse(String formattedString) { + return ProjectGlobalImageFamilyName.parse(formattedString); + } }; } - public static FamilyName parse(String formattedString) { + public static ProjectGlobalImageFamilyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "FamilyName.parse: formattedString not in valid format"); - return of( - matchMap.get("family"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalImageFamilyName.parse: formattedString not in valid format"); + return of(matchMap.get("family"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getFamily() { return family; } + public String getProject() { return project; } @@ -136,6 +119,7 @@ public Builder setFamily(String family) { this.family = family; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +127,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (FamilyName familyName) { - family = familyName.family; - project = familyName.project; + public Builder(ProjectGlobalImageFamilyName projectGlobalImageFamilyName) { + family = projectGlobalImageFamilyName.family; + project = projectGlobalImageFamilyName.project; } - public FamilyName build() { - return new FamilyName(this); + public ProjectGlobalImageFamilyName build() { + return new ProjectGlobalImageFamilyName(this); } } @@ -157,8 +141,7 @@ public FamilyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "family", family, - "project", project - ); + "project", project); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof FamilyName) { - FamilyName that = (FamilyName) o; - return - Objects.equals(this.family, that.getFamily()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalImageFamilyName) { + ProjectGlobalImageFamilyName that = (ProjectGlobalImageFamilyName) o; + return Objects.equals(this.family, that.getFamily()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - family, - project - ); + return Objects.hash(family, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java similarity index 65% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java index 2a24f4c17246..fc5ca114f751 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ImageName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalImageName implements ResourceName { private final String image; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/images/{image}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/images/{image}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private ImageName(Builder builder) { + private ProjectGlobalImageName(Builder builder) { image = Preconditions.checkNotNull(builder.getImage()); project = Preconditions.checkNotNull(builder.getProject()); } - public static ImageName of( - String image, - String project - ) { - return newBuilder() - .setImage(image) - .setProject(project) - .build(); + public static ProjectGlobalImageName of(String image, String project) { + return newBuilder().setImage(image).setProject(project).build(); } - public static String format( - String image, - String project - ) { - return of( - image, - project - ) - .toString(); + public static String format(String image, String project) { + return of(image, project).toString(); } public String getImage() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ImageName parse(String formattedString) {return ImageName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalImageName parse(String formattedString) { + return ProjectGlobalImageName.parse(formattedString); + } }; } - public static ImageName parse(String formattedString) { + public static ProjectGlobalImageName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ImageName.parse: formattedString not in valid format"); - return of( - matchMap.get("image"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectGlobalImageName.parse: formattedString not in valid format"); + return of(matchMap.get("image"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getImage() { return image; } + public String getProject() { return project; } @@ -136,6 +118,7 @@ public Builder setImage(String image) { this.image = image; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +126,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (ImageName imageName) { - image = imageName.image; - project = imageName.project; + public Builder(ProjectGlobalImageName projectGlobalImageName) { + image = projectGlobalImageName.image; + project = projectGlobalImageName.project; } - public ImageName build() { - return new ImageName(this); + public ProjectGlobalImageName build() { + return new ProjectGlobalImageName(this); } } @@ -157,8 +140,7 @@ public ImageName build() { public String toString() { return PATH_TEMPLATE.instantiate( "image", image, - "project", project - ); + "project", project); } @Override @@ -166,21 +148,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ImageName) { - ImageName that = (ImageName) o; - return - Objects.equals(this.image, that.getImage()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalImageName) { + ProjectGlobalImageName that = (ProjectGlobalImageName) o; + return Objects.equals(this.image, that.getImage()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - image, - project - ); + return Objects.hash(image, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java similarity index 62% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java index ad69b7736f21..72733e2fa001 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectImageName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectImageName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalImageResourceName implements ResourceName { private final String project; private final String resource; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/images/{image}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/images/{resource}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private ProjectImageName(Builder builder) { + private ProjectGlobalImageResourceName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); resource = Preconditions.checkNotNull(builder.getResource()); } - public static ProjectImageName of( - String project, - String resource - ) { - return newBuilder() - .setProject(project) - .setResource(resource) - .build(); + public static ProjectGlobalImageResourceName of(String project, String resource) { + return newBuilder().setProject(project).setResource(resource).build(); } - public static String format( - String project, - String resource - ) { - return of( - project, - resource - ) - .toString(); + public static String format(String project, String resource) { + return of(project, resource).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getResource() { return resource; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectImageName parse(String formattedString) {return ProjectImageName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalImageResourceName parse(String formattedString) { + return ProjectGlobalImageResourceName.parse(formattedString); + } }; } - public static ProjectImageName parse(String formattedString) { + public static ProjectGlobalImageResourceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectImageName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("resource") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalImageResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getProject() { return project; } + public String getResource() { return resource; } @@ -136,6 +119,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setResource(String resource) { this.resource = resource; return this; @@ -143,13 +127,13 @@ public Builder setResource(String resource) { private Builder() {} - public Builder (ProjectImageName projectImageName) { - project = projectImageName.project; - resource = projectImageName.resource; + public Builder(ProjectGlobalImageResourceName projectGlobalImageResourceName) { + project = projectGlobalImageResourceName.project; + resource = projectGlobalImageResourceName.resource; } - public ProjectImageName build() { - return new ProjectImageName(this); + public ProjectGlobalImageResourceName build() { + return new ProjectGlobalImageResourceName(this); } } @@ -157,8 +141,7 @@ public ProjectImageName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "resource", resource - ); + "resource", resource); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ProjectImageName) { - ProjectImageName that = (ProjectImageName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.resource, that.getResource()) - ; + if (o instanceof ProjectGlobalImageResourceName) { + ProjectGlobalImageResourceName that = (ProjectGlobalImageResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - resource - ); + return Objects.hash(project, resource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java index d21c51ecae89..093a5e68b050 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class InstanceTemplateName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalInstanceTemplateName implements ResourceName { private final String instanceTemplate; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/instanceTemplates/{instanceTemplate}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/instanceTemplates/{instanceTemplate}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private InstanceTemplateName(Builder builder) { + private ProjectGlobalInstanceTemplateName(Builder builder) { instanceTemplate = Preconditions.checkNotNull(builder.getInstanceTemplate()); project = Preconditions.checkNotNull(builder.getProject()); } - public static InstanceTemplateName of( - String instanceTemplate, - String project - ) { - return newBuilder() - .setInstanceTemplate(instanceTemplate) - .setProject(project) - .build(); + public static ProjectGlobalInstanceTemplateName of(String instanceTemplate, String project) { + return newBuilder().setInstanceTemplate(instanceTemplate).setProject(project).build(); } - public static String format( - String instanceTemplate, - String project - ) { - return of( - instanceTemplate, - project - ) - .toString(); + public static String format(String instanceTemplate, String project) { + return of(instanceTemplate, project).toString(); } public String getInstanceTemplate() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InstanceTemplateName parse(String formattedString) {return InstanceTemplateName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalInstanceTemplateName parse(String formattedString) { + return ProjectGlobalInstanceTemplateName.parse(formattedString); + } }; } - public static InstanceTemplateName parse(String formattedString) { + public static ProjectGlobalInstanceTemplateName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InstanceTemplateName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceTemplate"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalInstanceTemplateName.parse: formattedString not in valid format"); + return of(matchMap.get("instanceTemplate"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getInstanceTemplate() { return instanceTemplate; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setInstanceTemplate(String instanceTemplate) { this.instanceTemplate = instanceTemplate; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (InstanceTemplateName instanceTemplateName) { - instanceTemplate = instanceTemplateName.instanceTemplate; - project = instanceTemplateName.project; + public Builder(ProjectGlobalInstanceTemplateName projectGlobalInstanceTemplateName) { + instanceTemplate = projectGlobalInstanceTemplateName.instanceTemplate; + project = projectGlobalInstanceTemplateName.project; } - public InstanceTemplateName build() { - return new InstanceTemplateName(this); + public ProjectGlobalInstanceTemplateName build() { + return new ProjectGlobalInstanceTemplateName(this); } } @@ -157,8 +142,7 @@ public InstanceTemplateName build() { public String toString() { return PATH_TEMPLATE.instantiate( "instanceTemplate", instanceTemplate, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof InstanceTemplateName) { - InstanceTemplateName that = (InstanceTemplateName) o; - return - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalInstanceTemplateName) { + ProjectGlobalInstanceTemplateName that = (ProjectGlobalInstanceTemplateName) o; + return Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceTemplate, - project - ); + return Objects.hash(instanceTemplate, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java similarity index 60% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java index f924818e69d0..ec2f643587e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class InterconnectLocationName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalInterconnectLocationName implements ResourceName { private final String interconnectLocation; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnectLocations/{interconnectLocation}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/interconnectLocations/{interconnectLocation}"); private volatile Map fieldValuesMap; @@ -47,30 +44,18 @@ public Builder toBuilder() { return new Builder(this); } - private InterconnectLocationName(Builder builder) { + private ProjectGlobalInterconnectLocationName(Builder builder) { interconnectLocation = Preconditions.checkNotNull(builder.getInterconnectLocation()); project = Preconditions.checkNotNull(builder.getProject()); } - public static InterconnectLocationName of( - String interconnectLocation, - String project - ) { - return newBuilder() - .setInterconnectLocation(interconnectLocation) - .setProject(project) - .build(); + public static ProjectGlobalInterconnectLocationName of( + String interconnectLocation, String project) { + return newBuilder().setInterconnectLocation(interconnectLocation).setProject(project).build(); } - public static String format( - String interconnectLocation, - String project - ) { - return of( - interconnectLocation, - project - ) - .toString(); + public static String format(String interconnectLocation, String project) { + return of(interconnectLocation, project).toString(); } public String getInterconnectLocation() { @@ -81,7 +66,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +85,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InterconnectLocationName parse(String formattedString) {return InterconnectLocationName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalInterconnectLocationName parse(String formattedString) { + return ProjectGlobalInterconnectLocationName.parse(formattedString); + } }; } - public static InterconnectLocationName parse(String formattedString) { + public static ProjectGlobalInterconnectLocationName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InterconnectLocationName.parse: formattedString not in valid format"); - return of( - matchMap.get("interconnectLocation"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalInterconnectLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("interconnectLocation"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +112,7 @@ public static class Builder { public String getInterconnectLocation() { return interconnectLocation; } + public String getProject() { return project; } @@ -136,6 +121,7 @@ public Builder setInterconnectLocation(String interconnectLocation) { this.interconnectLocation = interconnectLocation; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +129,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (InterconnectLocationName interconnectLocationName) { - interconnectLocation = interconnectLocationName.interconnectLocation; - project = interconnectLocationName.project; + public Builder(ProjectGlobalInterconnectLocationName projectGlobalInterconnectLocationName) { + interconnectLocation = projectGlobalInterconnectLocationName.interconnectLocation; + project = projectGlobalInterconnectLocationName.project; } - public InterconnectLocationName build() { - return new InterconnectLocationName(this); + public ProjectGlobalInterconnectLocationName build() { + return new ProjectGlobalInterconnectLocationName(this); } } @@ -157,8 +143,7 @@ public InterconnectLocationName build() { public String toString() { return PATH_TEMPLATE.instantiate( "interconnectLocation", interconnectLocation, - "project", project - ); + "project", project); } @Override @@ -166,21 +151,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof InterconnectLocationName) { - InterconnectLocationName that = (InterconnectLocationName) o; - return - Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalInterconnectLocationName) { + ProjectGlobalInterconnectLocationName that = (ProjectGlobalInterconnectLocationName) o; + return Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - interconnectLocation, - project - ); + return Objects.hash(interconnectLocation, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java similarity index 62% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java index b4176d922512..acda5565c9bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class InterconnectName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalInterconnectName implements ResourceName { private final String interconnect; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnects/{interconnect}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/interconnects/{interconnect}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private InterconnectName(Builder builder) { + private ProjectGlobalInterconnectName(Builder builder) { interconnect = Preconditions.checkNotNull(builder.getInterconnect()); project = Preconditions.checkNotNull(builder.getProject()); } - public static InterconnectName of( - String interconnect, - String project - ) { - return newBuilder() - .setInterconnect(interconnect) - .setProject(project) - .build(); + public static ProjectGlobalInterconnectName of(String interconnect, String project) { + return newBuilder().setInterconnect(interconnect).setProject(project).build(); } - public static String format( - String interconnect, - String project - ) { - return of( - interconnect, - project - ) - .toString(); + public static String format(String interconnect, String project) { + return of(interconnect, project).toString(); } public String getInterconnect() { @@ -81,7 +65,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public InterconnectName parse(String formattedString) {return InterconnectName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalInterconnectName parse(String formattedString) { + return ProjectGlobalInterconnectName.parse(formattedString); + } }; } - public static InterconnectName parse(String formattedString) { + public static ProjectGlobalInterconnectName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "InterconnectName.parse: formattedString not in valid format"); - return of( - matchMap.get("interconnect"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalInterconnectName.parse: formattedString not in valid format"); + return of(matchMap.get("interconnect"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getInterconnect() { return interconnect; } + public String getProject() { return project; } @@ -136,6 +120,7 @@ public Builder setInterconnect(String interconnect) { this.interconnect = interconnect; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +128,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (InterconnectName interconnectName) { - interconnect = interconnectName.interconnect; - project = interconnectName.project; + public Builder(ProjectGlobalInterconnectName projectGlobalInterconnectName) { + interconnect = projectGlobalInterconnectName.interconnect; + project = projectGlobalInterconnectName.project; } - public InterconnectName build() { - return new InterconnectName(this); + public ProjectGlobalInterconnectName build() { + return new ProjectGlobalInterconnectName(this); } } @@ -157,8 +142,7 @@ public InterconnectName build() { public String toString() { return PATH_TEMPLATE.instantiate( "interconnect", interconnect, - "project", project - ); + "project", project); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof InterconnectName) { - InterconnectName that = (InterconnectName) o; - return - Objects.equals(this.interconnect, that.getInterconnect()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalInterconnectName) { + ProjectGlobalInterconnectName that = (ProjectGlobalInterconnectName) o; + return Objects.equals(this.interconnect, that.getInterconnect()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - interconnect, - project - ); + return Objects.hash(interconnect, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java similarity index 54% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java index 09cdc4be96b3..252347a647d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRouteName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRouteName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalLicenseCodeName implements ResourceName { + private final String licenseCode; private final String project; - private final String route; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/routes/{route}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/licenseCodes/{licenseCode}"); private volatile Map fieldValuesMap; @@ -47,49 +43,35 @@ public Builder toBuilder() { return new Builder(this); } - private ProjectRouteName(Builder builder) { + private ProjectGlobalLicenseCodeName(Builder builder) { + licenseCode = Preconditions.checkNotNull(builder.getLicenseCode()); project = Preconditions.checkNotNull(builder.getProject()); - route = Preconditions.checkNotNull(builder.getRoute()); } - public static ProjectRouteName of( - String project, - String route - ) { - return newBuilder() - .setProject(project) - .setRoute(route) - .build(); + public static ProjectGlobalLicenseCodeName of(String licenseCode, String project) { + return newBuilder().setLicenseCode(licenseCode).setProject(project).build(); } - public static String format( - String project, - String route - ) { - return of( - project, - route - ) - .toString(); + public static String format(String licenseCode, String project) { + return of(licenseCode, project).toString(); } - public String getProject() { - return project; + public String getLicenseCode() { + return licenseCode; } - public String getRoute() { - return route; + public String getProject() { + return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("licenseCode", licenseCode); fieldMapBuilder.put("project", project); - fieldMapBuilder.put("route", route); fieldValuesMap = fieldMapBuilder.build(); } } @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectRouteName parse(String formattedString) {return ProjectRouteName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalLicenseCodeName parse(String formattedString) { + return ProjectGlobalLicenseCodeName.parse(formattedString); + } }; } - public static ProjectRouteName parse(String formattedString) { + public static ProjectGlobalLicenseCodeName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRouteName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("route") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalLicenseCodeName.parse: formattedString not in valid format"); + return of(matchMap.get("licenseCode"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -122,43 +104,44 @@ public static boolean isParsableFrom(String formattedString) { } public static class Builder { + private String licenseCode; private String project; - private String route; + + public String getLicenseCode() { + return licenseCode; + } public String getProject() { return project; } - public String getRoute() { - return route; + + public Builder setLicenseCode(String licenseCode) { + this.licenseCode = licenseCode; + return this; } public Builder setProject(String project) { this.project = project; return this; } - public Builder setRoute(String route) { - this.route = route; - return this; - } private Builder() {} - public Builder (ProjectRouteName projectRouteName) { - project = projectRouteName.project; - route = projectRouteName.route; + public Builder(ProjectGlobalLicenseCodeName projectGlobalLicenseCodeName) { + licenseCode = projectGlobalLicenseCodeName.licenseCode; + project = projectGlobalLicenseCodeName.project; } - public ProjectRouteName build() { - return new ProjectRouteName(this); + public ProjectGlobalLicenseCodeName build() { + return new ProjectGlobalLicenseCodeName(this); } } @Override public String toString() { return PATH_TEMPLATE.instantiate( - "project", project, - "route", route - ); + "licenseCode", licenseCode, + "project", project); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ProjectRouteName) { - ProjectRouteName that = (ProjectRouteName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.route, that.getRoute()) - ; + if (o instanceof ProjectGlobalLicenseCodeName) { + ProjectGlobalLicenseCodeName that = (ProjectGlobalLicenseCodeName) o; + return Objects.equals(this.licenseCode, that.getLicenseCode()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - route - ); + return Objects.hash(licenseCode, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java new file mode 100644 index 000000000000..50c6aac69f29 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java @@ -0,0 +1,164 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectGlobalLicenseCodeResourceName implements ResourceName { + private final String project; + private final String resource; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/licenseCodes/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectGlobalLicenseCodeResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public static ProjectGlobalLicenseCodeResourceName of(String project, String resource) { + return newBuilder().setProject(project).setResource(resource).build(); + } + + public static String format(String project, String resource) { + return of(project, resource).toString(); + } + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("resource", resource); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalLicenseCodeResourceName parse(String formattedString) { + return ProjectGlobalLicenseCodeResourceName.parse(formattedString); + } + }; + } + + public static ProjectGlobalLicenseCodeResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalLicenseCodeResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String resource; + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder() {} + + public Builder(ProjectGlobalLicenseCodeResourceName projectGlobalLicenseCodeResourceName) { + project = projectGlobalLicenseCodeResourceName.project; + resource = projectGlobalLicenseCodeResourceName.resource; + } + + public ProjectGlobalLicenseCodeResourceName build() { + return new ProjectGlobalLicenseCodeResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "resource", resource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectGlobalLicenseCodeResourceName) { + ProjectGlobalLicenseCodeResourceName that = (ProjectGlobalLicenseCodeResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, resource); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java similarity index 64% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java index df5423888310..f88ce1ced806 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class LicenseName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalLicenseName implements ResourceName { private final String license; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/licenses/{license}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/licenses/{license}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private LicenseName(Builder builder) { + private ProjectGlobalLicenseName(Builder builder) { license = Preconditions.checkNotNull(builder.getLicense()); project = Preconditions.checkNotNull(builder.getProject()); } - public static LicenseName of( - String license, - String project - ) { - return newBuilder() - .setLicense(license) - .setProject(project) - .build(); + public static ProjectGlobalLicenseName of(String license, String project) { + return newBuilder().setLicense(license).setProject(project).build(); } - public static String format( - String license, - String project - ) { - return of( - license, - project - ) - .toString(); + public static String format(String license, String project) { + return of(license, project).toString(); } public String getLicense() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public LicenseName parse(String formattedString) {return LicenseName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalLicenseName parse(String formattedString) { + return ProjectGlobalLicenseName.parse(formattedString); + } }; } - public static LicenseName parse(String formattedString) { + public static ProjectGlobalLicenseName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "LicenseName.parse: formattedString not in valid format"); - return of( - matchMap.get("license"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectGlobalLicenseName.parse: formattedString not in valid format"); + return of(matchMap.get("license"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getLicense() { return license; } + public String getProject() { return project; } @@ -136,6 +118,7 @@ public Builder setLicense(String license) { this.license = license; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +126,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (LicenseName licenseName) { - license = licenseName.license; - project = licenseName.project; + public Builder(ProjectGlobalLicenseName projectGlobalLicenseName) { + license = projectGlobalLicenseName.license; + project = projectGlobalLicenseName.project; } - public LicenseName build() { - return new LicenseName(this); + public ProjectGlobalLicenseName build() { + return new ProjectGlobalLicenseName(this); } } @@ -157,8 +140,7 @@ public LicenseName build() { public String toString() { return PATH_TEMPLATE.instantiate( "license", license, - "project", project - ); + "project", project); } @Override @@ -166,21 +148,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof LicenseName) { - LicenseName that = (LicenseName) o; - return - Objects.equals(this.license, that.getLicense()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalLicenseName) { + ProjectGlobalLicenseName that = (ProjectGlobalLicenseName) o; + return Objects.equals(this.license, that.getLicense()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - license, - project - ); + return Objects.hash(license, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java similarity index 62% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java index fd6440f264b2..5682cc0d24b0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSnapshotName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectSnapshotName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalLicenseResourceName implements ResourceName { private final String project; private final String resource; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{snapshot}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/licenses/{resource}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private ProjectSnapshotName(Builder builder) { + private ProjectGlobalLicenseResourceName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); resource = Preconditions.checkNotNull(builder.getResource()); } - public static ProjectSnapshotName of( - String project, - String resource - ) { - return newBuilder() - .setProject(project) - .setResource(resource) - .build(); + public static ProjectGlobalLicenseResourceName of(String project, String resource) { + return newBuilder().setProject(project).setResource(resource).build(); } - public static String format( - String project, - String resource - ) { - return of( - project, - resource - ) - .toString(); + public static String format(String project, String resource) { + return of(project, resource).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getResource() { return resource; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectSnapshotName parse(String formattedString) {return ProjectSnapshotName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalLicenseResourceName parse(String formattedString) { + return ProjectGlobalLicenseResourceName.parse(formattedString); + } }; } - public static ProjectSnapshotName parse(String formattedString) { + public static ProjectGlobalLicenseResourceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectSnapshotName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("resource") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalLicenseResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getProject() { return project; } + public String getResource() { return resource; } @@ -136,6 +119,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setResource(String resource) { this.resource = resource; return this; @@ -143,13 +127,13 @@ public Builder setResource(String resource) { private Builder() {} - public Builder (ProjectSnapshotName projectSnapshotName) { - project = projectSnapshotName.project; - resource = projectSnapshotName.resource; + public Builder(ProjectGlobalLicenseResourceName projectGlobalLicenseResourceName) { + project = projectGlobalLicenseResourceName.project; + resource = projectGlobalLicenseResourceName.resource; } - public ProjectSnapshotName build() { - return new ProjectSnapshotName(this); + public ProjectGlobalLicenseResourceName build() { + return new ProjectGlobalLicenseResourceName(this); } } @@ -157,8 +141,7 @@ public ProjectSnapshotName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "resource", resource - ); + "resource", resource); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ProjectSnapshotName) { - ProjectSnapshotName that = (ProjectSnapshotName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.resource, that.getResource()) - ; + if (o instanceof ProjectGlobalLicenseResourceName) { + ProjectGlobalLicenseResourceName that = (ProjectGlobalLicenseResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - resource - ); + return Objects.hash(project, resource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java similarity index 64% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java index 92e245188b13..805e1e5ba77d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class NetworkName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalNetworkName implements ResourceName { private final String network; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/networks/{network}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private NetworkName(Builder builder) { + private ProjectGlobalNetworkName(Builder builder) { network = Preconditions.checkNotNull(builder.getNetwork()); project = Preconditions.checkNotNull(builder.getProject()); } - public static NetworkName of( - String network, - String project - ) { - return newBuilder() - .setNetwork(network) - .setProject(project) - .build(); + public static ProjectGlobalNetworkName of(String network, String project) { + return newBuilder().setNetwork(network).setProject(project).build(); } - public static String format( - String network, - String project - ) { - return of( - network, - project - ) - .toString(); + public static String format(String network, String project) { + return of(network, project).toString(); } public String getNetwork() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public NetworkName parse(String formattedString) {return NetworkName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalNetworkName parse(String formattedString) { + return ProjectGlobalNetworkName.parse(formattedString); + } }; } - public static NetworkName parse(String formattedString) { + public static ProjectGlobalNetworkName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "NetworkName.parse: formattedString not in valid format"); - return of( - matchMap.get("network"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectGlobalNetworkName.parse: formattedString not in valid format"); + return of(matchMap.get("network"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getNetwork() { return network; } + public String getProject() { return project; } @@ -136,6 +118,7 @@ public Builder setNetwork(String network) { this.network = network; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +126,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (NetworkName networkName) { - network = networkName.network; - project = networkName.project; + public Builder(ProjectGlobalNetworkName projectGlobalNetworkName) { + network = projectGlobalNetworkName.network; + project = projectGlobalNetworkName.project; } - public NetworkName build() { - return new NetworkName(this); + public ProjectGlobalNetworkName build() { + return new ProjectGlobalNetworkName(this); } } @@ -157,8 +140,7 @@ public NetworkName build() { public String toString() { return PATH_TEMPLATE.instantiate( "network", network, - "project", project - ); + "project", project); } @Override @@ -166,21 +148,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof NetworkName) { - NetworkName that = (NetworkName) o; - return - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalNetworkName) { + ProjectGlobalNetworkName that = (ProjectGlobalNetworkName) o; + return Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - network, - project - ); + return Objects.hash(network, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java similarity index 63% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java index 176bc98b599c..dac90d0c2d0d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class OperationName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalOperationName implements ResourceName { private final String operation; private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/operations/{operation}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/operations/{operation}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private OperationName(Builder builder) { + private ProjectGlobalOperationName(Builder builder) { operation = Preconditions.checkNotNull(builder.getOperation()); project = Preconditions.checkNotNull(builder.getProject()); } - public static OperationName of( - String operation, - String project - ) { - return newBuilder() - .setOperation(operation) - .setProject(project) - .build(); + public static ProjectGlobalOperationName of(String operation, String project) { + return newBuilder().setOperation(operation).setProject(project).build(); } - public static String format( - String operation, - String project - ) { - return of( - operation, - project - ) - .toString(); + public static String format(String operation, String project) { + return of(operation, project).toString(); } public String getOperation() { @@ -81,7 +64,6 @@ public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public OperationName parse(String formattedString) {return OperationName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalOperationName parse(String formattedString) { + return ProjectGlobalOperationName.parse(formattedString); + } }; } - public static OperationName parse(String formattedString) { + public static ProjectGlobalOperationName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "OperationName.parse: formattedString not in valid format"); - return of( - matchMap.get("operation"), - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalOperationName.parse: formattedString not in valid format"); + return of(matchMap.get("operation"), matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getOperation() { return operation; } + public String getProject() { return project; } @@ -136,6 +119,7 @@ public Builder setOperation(String operation) { this.operation = operation; return this; } + public Builder setProject(String project) { this.project = project; return this; @@ -143,13 +127,13 @@ public Builder setProject(String project) { private Builder() {} - public Builder (OperationName operationName) { - operation = operationName.operation; - project = operationName.project; + public Builder(ProjectGlobalOperationName projectGlobalOperationName) { + operation = projectGlobalOperationName.operation; + project = projectGlobalOperationName.project; } - public OperationName build() { - return new OperationName(this); + public ProjectGlobalOperationName build() { + return new ProjectGlobalOperationName(this); } } @@ -157,8 +141,7 @@ public OperationName build() { public String toString() { return PATH_TEMPLATE.instantiate( "operation", operation, - "project", project - ); + "project", project); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof OperationName) { - OperationName that = (OperationName) o; - return - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.project, that.getProject()) - ; + if (o instanceof ProjectGlobalOperationName) { + ProjectGlobalOperationName that = (ProjectGlobalOperationName) o; + return Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - operation, - project - ); + return Objects.hash(operation, project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java similarity index 65% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java index 7b06a07a381b..f0f855ce083f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class RouteName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalRouteName implements ResourceName { private final String project; private final String route; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/routes/{route}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/routes/{route}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private RouteName(Builder builder) { + private ProjectGlobalRouteName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); route = Preconditions.checkNotNull(builder.getRoute()); } - public static RouteName of( - String project, - String route - ) { - return newBuilder() - .setProject(project) - .setRoute(route) - .build(); + public static ProjectGlobalRouteName of(String project, String route) { + return newBuilder().setProject(project).setRoute(route).build(); } - public static String format( - String project, - String route - ) { - return of( - project, - route - ) - .toString(); + public static String format(String project, String route) { + return of(project, route).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getRoute() { return route; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public RouteName parse(String formattedString) {return RouteName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalRouteName parse(String formattedString) { + return ProjectGlobalRouteName.parse(formattedString); + } }; } - public static RouteName parse(String formattedString) { + public static ProjectGlobalRouteName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "RouteName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("route") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectGlobalRouteName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("route")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getProject() { return project; } + public String getRoute() { return route; } @@ -136,6 +118,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRoute(String route) { this.route = route; return this; @@ -143,13 +126,13 @@ public Builder setRoute(String route) { private Builder() {} - public Builder (RouteName routeName) { - project = routeName.project; - route = routeName.route; + public Builder(ProjectGlobalRouteName projectGlobalRouteName) { + project = projectGlobalRouteName.project; + route = projectGlobalRouteName.route; } - public RouteName build() { - return new RouteName(this); + public ProjectGlobalRouteName build() { + return new ProjectGlobalRouteName(this); } } @@ -157,8 +140,7 @@ public RouteName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "route", route - ); + "route", route); } @Override @@ -166,21 +148,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof RouteName) { - RouteName that = (RouteName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.route, that.getRoute()) - ; + if (o instanceof ProjectGlobalRouteName) { + ProjectGlobalRouteName that = (ProjectGlobalRouteName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.route, that.getRoute()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - route - ); + return Objects.hash(project, route); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java similarity index 64% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java index 202bca3e4936..760421374402 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class SnapshotName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalSnapshotName implements ResourceName { private final String project; private final String snapshot; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{snapshot}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/snapshots/{snapshot}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private SnapshotName(Builder builder) { + private ProjectGlobalSnapshotName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); snapshot = Preconditions.checkNotNull(builder.getSnapshot()); } - public static SnapshotName of( - String project, - String snapshot - ) { - return newBuilder() - .setProject(project) - .setSnapshot(snapshot) - .build(); + public static ProjectGlobalSnapshotName of(String project, String snapshot) { + return newBuilder().setProject(project).setSnapshot(snapshot).build(); } - public static String format( - String project, - String snapshot - ) { - return of( - project, - snapshot - ) - .toString(); + public static String format(String project, String snapshot) { + return of(project, snapshot).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getSnapshot() { return snapshot; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public SnapshotName parse(String formattedString) {return SnapshotName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalSnapshotName parse(String formattedString) { + return ProjectGlobalSnapshotName.parse(formattedString); + } }; } - public static SnapshotName parse(String formattedString) { + public static ProjectGlobalSnapshotName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "SnapshotName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("snapshot") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalSnapshotName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("snapshot")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +110,7 @@ public static class Builder { public String getProject() { return project; } + public String getSnapshot() { return snapshot; } @@ -136,6 +119,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setSnapshot(String snapshot) { this.snapshot = snapshot; return this; @@ -143,13 +127,13 @@ public Builder setSnapshot(String snapshot) { private Builder() {} - public Builder (SnapshotName snapshotName) { - project = snapshotName.project; - snapshot = snapshotName.snapshot; + public Builder(ProjectGlobalSnapshotName projectGlobalSnapshotName) { + project = projectGlobalSnapshotName.project; + snapshot = projectGlobalSnapshotName.snapshot; } - public SnapshotName build() { - return new SnapshotName(this); + public ProjectGlobalSnapshotName build() { + return new ProjectGlobalSnapshotName(this); } } @@ -157,8 +141,7 @@ public SnapshotName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "snapshot", snapshot - ); + "snapshot", snapshot); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof SnapshotName) { - SnapshotName that = (SnapshotName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.snapshot, that.getSnapshot()) - ; + if (o instanceof ProjectGlobalSnapshotName) { + ProjectGlobalSnapshotName that = (ProjectGlobalSnapshotName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.snapshot, that.getSnapshot()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - snapshot - ); + return Objects.hash(project, snapshot); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java new file mode 100644 index 000000000000..08f60e758c27 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java @@ -0,0 +1,164 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectGlobalSnapshotResourceName implements ResourceName { + private final String project; + private final String resource; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/snapshots/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectGlobalSnapshotResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public static ProjectGlobalSnapshotResourceName of(String project, String resource) { + return newBuilder().setProject(project).setResource(resource).build(); + } + + public static String format(String project, String resource) { + return of(project, resource).toString(); + } + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("resource", resource); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalSnapshotResourceName parse(String formattedString) { + return ProjectGlobalSnapshotResourceName.parse(formattedString); + } + }; + } + + public static ProjectGlobalSnapshotResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalSnapshotResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String resource; + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder() {} + + public Builder(ProjectGlobalSnapshotResourceName projectGlobalSnapshotResourceName) { + project = projectGlobalSnapshotResourceName.project; + resource = projectGlobalSnapshotResourceName.resource; + } + + public ProjectGlobalSnapshotResourceName build() { + return new ProjectGlobalSnapshotResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "resource", resource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectGlobalSnapshotResourceName) { + ProjectGlobalSnapshotResourceName that = (ProjectGlobalSnapshotResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, resource); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java index 6a94c9c7b435..a04a3956ff02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class SslCertificateName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalSslCertificateName implements ResourceName { private final String project; private final String sslCertificate; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/sslCertificates/{sslCertificate}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private SslCertificateName(Builder builder) { + private ProjectGlobalSslCertificateName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); sslCertificate = Preconditions.checkNotNull(builder.getSslCertificate()); } - public static SslCertificateName of( - String project, - String sslCertificate - ) { - return newBuilder() - .setProject(project) - .setSslCertificate(sslCertificate) - .build(); + public static ProjectGlobalSslCertificateName of(String project, String sslCertificate) { + return newBuilder().setProject(project).setSslCertificate(sslCertificate).build(); } - public static String format( - String project, - String sslCertificate - ) { - return of( - project, - sslCertificate - ) - .toString(); + public static String format(String project, String sslCertificate) { + return of(project, sslCertificate).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getSslCertificate() { return sslCertificate; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public SslCertificateName parse(String formattedString) {return SslCertificateName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalSslCertificateName parse(String formattedString) { + return ProjectGlobalSslCertificateName.parse(formattedString); + } }; } - public static SslCertificateName parse(String formattedString) { + public static ProjectGlobalSslCertificateName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "SslCertificateName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("sslCertificate") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalSslCertificateName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("sslCertificate")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getSslCertificate() { return sslCertificate; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setSslCertificate(String sslCertificate) { this.sslCertificate = sslCertificate; return this; @@ -143,13 +128,13 @@ public Builder setSslCertificate(String sslCertificate) { private Builder() {} - public Builder (SslCertificateName sslCertificateName) { - project = sslCertificateName.project; - sslCertificate = sslCertificateName.sslCertificate; + public Builder(ProjectGlobalSslCertificateName projectGlobalSslCertificateName) { + project = projectGlobalSslCertificateName.project; + sslCertificate = projectGlobalSslCertificateName.sslCertificate; } - public SslCertificateName build() { - return new SslCertificateName(this); + public ProjectGlobalSslCertificateName build() { + return new ProjectGlobalSslCertificateName(this); } } @@ -157,8 +142,7 @@ public SslCertificateName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "sslCertificate", sslCertificate - ); + "sslCertificate", sslCertificate); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof SslCertificateName) { - SslCertificateName that = (SslCertificateName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.sslCertificate, that.getSslCertificate()) - ; + if (o instanceof ProjectGlobalSslCertificateName) { + ProjectGlobalSslCertificateName that = (ProjectGlobalSslCertificateName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.sslCertificate, that.getSslCertificate()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - sslCertificate - ); + return Objects.hash(project, sslCertificate); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java similarity index 55% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java index e62e352bc3af..ed5f7b2fc474 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectUrlMapName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectUrlMapName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalSslPolicyName implements ResourceName { private final String project; - private final String urlMap; + private final String sslPolicy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/sslPolicies/{sslPolicy}"); private volatile Map fieldValuesMap; @@ -47,41 +43,27 @@ public Builder toBuilder() { return new Builder(this); } - private ProjectUrlMapName(Builder builder) { + private ProjectGlobalSslPolicyName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); - urlMap = Preconditions.checkNotNull(builder.getUrlMap()); + sslPolicy = Preconditions.checkNotNull(builder.getSslPolicy()); } - public static ProjectUrlMapName of( - String project, - String urlMap - ) { - return newBuilder() - .setProject(project) - .setUrlMap(urlMap) - .build(); + public static ProjectGlobalSslPolicyName of(String project, String sslPolicy) { + return newBuilder().setProject(project).setSslPolicy(sslPolicy).build(); } - public static String format( - String project, - String urlMap - ) { - return of( - project, - urlMap - ) - .toString(); + public static String format(String project, String sslPolicy) { + return of(project, sslPolicy).toString(); } public String getProject() { return project; } - public String getUrlMap() { - return urlMap; + public String getSslPolicy() { + return sslPolicy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -89,7 +71,7 @@ public Map getFieldValuesMap() { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); fieldMapBuilder.put("project", project); - fieldMapBuilder.put("urlMap", urlMap); + fieldMapBuilder.put("sslPolicy", sslPolicy); fieldValuesMap = fieldMapBuilder.build(); } } @@ -101,20 +83,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectUrlMapName parse(String formattedString) {return ProjectUrlMapName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalSslPolicyName parse(String formattedString) { + return ProjectGlobalSslPolicyName.parse(formattedString); + } }; } - public static ProjectUrlMapName parse(String formattedString) { + public static ProjectGlobalSslPolicyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectUrlMapName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("urlMap") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalSslPolicyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("sslPolicy")); } public static boolean isParsableFrom(String formattedString) { @@ -123,33 +105,35 @@ public static boolean isParsableFrom(String formattedString) { public static class Builder { private String project; - private String urlMap; + private String sslPolicy; public String getProject() { return project; } - public String getUrlMap() { - return urlMap; + + public String getSslPolicy() { + return sslPolicy; } public Builder setProject(String project) { this.project = project; return this; } - public Builder setUrlMap(String urlMap) { - this.urlMap = urlMap; + + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; return this; } private Builder() {} - public Builder (ProjectUrlMapName projectUrlMapName) { - project = projectUrlMapName.project; - urlMap = projectUrlMapName.urlMap; + public Builder(ProjectGlobalSslPolicyName projectGlobalSslPolicyName) { + project = projectGlobalSslPolicyName.project; + sslPolicy = projectGlobalSslPolicyName.sslPolicy; } - public ProjectUrlMapName build() { - return new ProjectUrlMapName(this); + public ProjectGlobalSslPolicyName build() { + return new ProjectGlobalSslPolicyName(this); } } @@ -157,8 +141,7 @@ public ProjectUrlMapName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "urlMap", urlMap - ); + "sslPolicy", sslPolicy); } @Override @@ -166,21 +149,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ProjectUrlMapName) { - ProjectUrlMapName that = (ProjectUrlMapName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.urlMap, that.getUrlMap()) - ; + if (o instanceof ProjectGlobalSslPolicyName) { + ProjectGlobalSslPolicyName that = (ProjectGlobalSslPolicyName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.sslPolicy, that.getSslPolicy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - urlMap - ); + return Objects.hash(project, sslPolicy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java index 8dbbdfdb65a5..aae231fe38c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class TargetHttpProxyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalTargetHttpProxyName implements ResourceName { private final String project; private final String targetHttpProxy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpProxies/{targetHttpProxy}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/targetHttpProxies/{targetHttpProxy}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private TargetHttpProxyName(Builder builder) { + private ProjectGlobalTargetHttpProxyName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); targetHttpProxy = Preconditions.checkNotNull(builder.getTargetHttpProxy()); } - public static TargetHttpProxyName of( - String project, - String targetHttpProxy - ) { - return newBuilder() - .setProject(project) - .setTargetHttpProxy(targetHttpProxy) - .build(); + public static ProjectGlobalTargetHttpProxyName of(String project, String targetHttpProxy) { + return newBuilder().setProject(project).setTargetHttpProxy(targetHttpProxy).build(); } - public static String format( - String project, - String targetHttpProxy - ) { - return of( - project, - targetHttpProxy - ) - .toString(); + public static String format(String project, String targetHttpProxy) { + return of(project, targetHttpProxy).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getTargetHttpProxy() { return targetHttpProxy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetHttpProxyName parse(String formattedString) {return TargetHttpProxyName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalTargetHttpProxyName parse(String formattedString) { + return ProjectGlobalTargetHttpProxyName.parse(formattedString); + } }; } - public static TargetHttpProxyName parse(String formattedString) { + public static ProjectGlobalTargetHttpProxyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetHttpProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetHttpProxy") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalTargetHttpProxyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetHttpProxy")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getTargetHttpProxy() { return targetHttpProxy; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetHttpProxy(String targetHttpProxy) { this.targetHttpProxy = targetHttpProxy; return this; @@ -143,13 +128,13 @@ public Builder setTargetHttpProxy(String targetHttpProxy) { private Builder() {} - public Builder (TargetHttpProxyName targetHttpProxyName) { - project = targetHttpProxyName.project; - targetHttpProxy = targetHttpProxyName.targetHttpProxy; + public Builder(ProjectGlobalTargetHttpProxyName projectGlobalTargetHttpProxyName) { + project = projectGlobalTargetHttpProxyName.project; + targetHttpProxy = projectGlobalTargetHttpProxyName.targetHttpProxy; } - public TargetHttpProxyName build() { - return new TargetHttpProxyName(this); + public ProjectGlobalTargetHttpProxyName build() { + return new ProjectGlobalTargetHttpProxyName(this); } } @@ -157,8 +142,7 @@ public TargetHttpProxyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "targetHttpProxy", targetHttpProxy - ); + "targetHttpProxy", targetHttpProxy); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof TargetHttpProxyName) { - TargetHttpProxyName that = (TargetHttpProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) - ; + if (o instanceof ProjectGlobalTargetHttpProxyName) { + ProjectGlobalTargetHttpProxyName that = (ProjectGlobalTargetHttpProxyName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetHttpProxy - ); + return Objects.hash(project, targetHttpProxy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java index fd182573ae73..23608e827f62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class TargetHttpsProxyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalTargetHttpsProxyName implements ResourceName { private final String project; private final String targetHttpsProxy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpsProxies/{targetHttpsProxy}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private TargetHttpsProxyName(Builder builder) { + private ProjectGlobalTargetHttpsProxyName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); targetHttpsProxy = Preconditions.checkNotNull(builder.getTargetHttpsProxy()); } - public static TargetHttpsProxyName of( - String project, - String targetHttpsProxy - ) { - return newBuilder() - .setProject(project) - .setTargetHttpsProxy(targetHttpsProxy) - .build(); + public static ProjectGlobalTargetHttpsProxyName of(String project, String targetHttpsProxy) { + return newBuilder().setProject(project).setTargetHttpsProxy(targetHttpsProxy).build(); } - public static String format( - String project, - String targetHttpsProxy - ) { - return of( - project, - targetHttpsProxy - ) - .toString(); + public static String format(String project, String targetHttpsProxy) { + return of(project, targetHttpsProxy).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getTargetHttpsProxy() { return targetHttpsProxy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetHttpsProxyName parse(String formattedString) {return TargetHttpsProxyName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalTargetHttpsProxyName parse(String formattedString) { + return ProjectGlobalTargetHttpsProxyName.parse(formattedString); + } }; } - public static TargetHttpsProxyName parse(String formattedString) { + public static ProjectGlobalTargetHttpsProxyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetHttpsProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetHttpsProxy") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalTargetHttpsProxyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetHttpsProxy")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getTargetHttpsProxy() { return targetHttpsProxy; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetHttpsProxy(String targetHttpsProxy) { this.targetHttpsProxy = targetHttpsProxy; return this; @@ -143,13 +128,13 @@ public Builder setTargetHttpsProxy(String targetHttpsProxy) { private Builder() {} - public Builder (TargetHttpsProxyName targetHttpsProxyName) { - project = targetHttpsProxyName.project; - targetHttpsProxy = targetHttpsProxyName.targetHttpsProxy; + public Builder(ProjectGlobalTargetHttpsProxyName projectGlobalTargetHttpsProxyName) { + project = projectGlobalTargetHttpsProxyName.project; + targetHttpsProxy = projectGlobalTargetHttpsProxyName.targetHttpsProxy; } - public TargetHttpsProxyName build() { - return new TargetHttpsProxyName(this); + public ProjectGlobalTargetHttpsProxyName build() { + return new ProjectGlobalTargetHttpsProxyName(this); } } @@ -157,8 +142,7 @@ public TargetHttpsProxyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "targetHttpsProxy", targetHttpsProxy - ); + "targetHttpsProxy", targetHttpsProxy); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof TargetHttpsProxyName) { - TargetHttpsProxyName that = (TargetHttpsProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) - ; + if (o instanceof ProjectGlobalTargetHttpsProxyName) { + ProjectGlobalTargetHttpsProxyName that = (ProjectGlobalTargetHttpsProxyName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetHttpsProxy - ); + return Objects.hash(project, targetHttpsProxy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java index 220db0ac6cb5..834d4a5f3e59 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class TargetSslProxyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalTargetSslProxyName implements ResourceName { private final String project; private final String targetSslProxy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetSslProxies/{targetSslProxy}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/targetSslProxies/{targetSslProxy}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private TargetSslProxyName(Builder builder) { + private ProjectGlobalTargetSslProxyName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); targetSslProxy = Preconditions.checkNotNull(builder.getTargetSslProxy()); } - public static TargetSslProxyName of( - String project, - String targetSslProxy - ) { - return newBuilder() - .setProject(project) - .setTargetSslProxy(targetSslProxy) - .build(); + public static ProjectGlobalTargetSslProxyName of(String project, String targetSslProxy) { + return newBuilder().setProject(project).setTargetSslProxy(targetSslProxy).build(); } - public static String format( - String project, - String targetSslProxy - ) { - return of( - project, - targetSslProxy - ) - .toString(); + public static String format(String project, String targetSslProxy) { + return of(project, targetSslProxy).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getTargetSslProxy() { return targetSslProxy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetSslProxyName parse(String formattedString) {return TargetSslProxyName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalTargetSslProxyName parse(String formattedString) { + return ProjectGlobalTargetSslProxyName.parse(formattedString); + } }; } - public static TargetSslProxyName parse(String formattedString) { + public static ProjectGlobalTargetSslProxyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetSslProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetSslProxy") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalTargetSslProxyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetSslProxy")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getTargetSslProxy() { return targetSslProxy; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetSslProxy(String targetSslProxy) { this.targetSslProxy = targetSslProxy; return this; @@ -143,13 +128,13 @@ public Builder setTargetSslProxy(String targetSslProxy) { private Builder() {} - public Builder (TargetSslProxyName targetSslProxyName) { - project = targetSslProxyName.project; - targetSslProxy = targetSslProxyName.targetSslProxy; + public Builder(ProjectGlobalTargetSslProxyName projectGlobalTargetSslProxyName) { + project = projectGlobalTargetSslProxyName.project; + targetSslProxy = projectGlobalTargetSslProxyName.targetSslProxy; } - public TargetSslProxyName build() { - return new TargetSslProxyName(this); + public ProjectGlobalTargetSslProxyName build() { + return new ProjectGlobalTargetSslProxyName(this); } } @@ -157,8 +142,7 @@ public TargetSslProxyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "targetSslProxy", targetSslProxy - ); + "targetSslProxy", targetSslProxy); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof TargetSslProxyName) { - TargetSslProxyName that = (TargetSslProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) - ; + if (o instanceof ProjectGlobalTargetSslProxyName) { + ProjectGlobalTargetSslProxyName that = (ProjectGlobalTargetSslProxyName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetSslProxy - ); + return Objects.hash(project, targetSslProxy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java index ecb39d760036..48fdf255fb01 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class TargetTcpProxyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalTargetTcpProxyName implements ResourceName { private final String project; private final String targetTcpProxy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetTcpProxies/{targetTcpProxy}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/targetTcpProxies/{targetTcpProxy}"); private volatile Map fieldValuesMap; @@ -47,30 +44,17 @@ public Builder toBuilder() { return new Builder(this); } - private TargetTcpProxyName(Builder builder) { + private ProjectGlobalTargetTcpProxyName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); targetTcpProxy = Preconditions.checkNotNull(builder.getTargetTcpProxy()); } - public static TargetTcpProxyName of( - String project, - String targetTcpProxy - ) { - return newBuilder() - .setProject(project) - .setTargetTcpProxy(targetTcpProxy) - .build(); + public static ProjectGlobalTargetTcpProxyName of(String project, String targetTcpProxy) { + return newBuilder().setProject(project).setTargetTcpProxy(targetTcpProxy).build(); } - public static String format( - String project, - String targetTcpProxy - ) { - return of( - project, - targetTcpProxy - ) - .toString(); + public static String format(String project, String targetTcpProxy) { + return of(project, targetTcpProxy).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getTargetTcpProxy() { return targetTcpProxy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetTcpProxyName parse(String formattedString) {return TargetTcpProxyName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalTargetTcpProxyName parse(String formattedString) { + return ProjectGlobalTargetTcpProxyName.parse(formattedString); + } }; } - public static TargetTcpProxyName parse(String formattedString) { + public static ProjectGlobalTargetTcpProxyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetTcpProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetTcpProxy") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalTargetTcpProxyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetTcpProxy")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getTargetTcpProxy() { return targetTcpProxy; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetTcpProxy(String targetTcpProxy) { this.targetTcpProxy = targetTcpProxy; return this; @@ -143,13 +128,13 @@ public Builder setTargetTcpProxy(String targetTcpProxy) { private Builder() {} - public Builder (TargetTcpProxyName targetTcpProxyName) { - project = targetTcpProxyName.project; - targetTcpProxy = targetTcpProxyName.targetTcpProxy; + public Builder(ProjectGlobalTargetTcpProxyName projectGlobalTargetTcpProxyName) { + project = projectGlobalTargetTcpProxyName.project; + targetTcpProxy = projectGlobalTargetTcpProxyName.targetTcpProxy; } - public TargetTcpProxyName build() { - return new TargetTcpProxyName(this); + public ProjectGlobalTargetTcpProxyName build() { + return new ProjectGlobalTargetTcpProxyName(this); } } @@ -157,8 +142,7 @@ public TargetTcpProxyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "targetTcpProxy", targetTcpProxy - ); + "targetTcpProxy", targetTcpProxy); } @Override @@ -166,21 +150,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof TargetTcpProxyName) { - TargetTcpProxyName that = (TargetTcpProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) - ; + if (o instanceof ProjectGlobalTargetTcpProxyName) { + ProjectGlobalTargetTcpProxyName that = (ProjectGlobalTargetTcpProxyName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetTcpProxy - ); + return Objects.hash(project, targetTcpProxy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java similarity index 64% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java index b862f97272b9..dbfdfa721a57 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class UrlMapName implements com.google.api.resourcenames.ResourceName { +public final class ProjectGlobalUrlMapName implements ResourceName { private final String project; private final String urlMap; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/urlMaps/{urlMap}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/global/urlMaps/{urlMap}"); private volatile Map fieldValuesMap; @@ -47,30 +43,17 @@ public Builder toBuilder() { return new Builder(this); } - private UrlMapName(Builder builder) { + private ProjectGlobalUrlMapName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); urlMap = Preconditions.checkNotNull(builder.getUrlMap()); } - public static UrlMapName of( - String project, - String urlMap - ) { - return newBuilder() - .setProject(project) - .setUrlMap(urlMap) - .build(); + public static ProjectGlobalUrlMapName of(String project, String urlMap) { + return newBuilder().setProject(project).setUrlMap(urlMap).build(); } - public static String format( - String project, - String urlMap - ) { - return of( - project, - urlMap - ) - .toString(); + public static String format(String project, String urlMap) { + return of(project, urlMap).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getUrlMap() { return urlMap; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public UrlMapName parse(String formattedString) {return UrlMapName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalUrlMapName parse(String formattedString) { + return ProjectGlobalUrlMapName.parse(formattedString); + } }; } - public static UrlMapName parse(String formattedString) { + public static ProjectGlobalUrlMapName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "UrlMapName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("urlMap") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectGlobalUrlMapName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("urlMap")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getProject() { return project; } + public String getUrlMap() { return urlMap; } @@ -136,6 +118,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setUrlMap(String urlMap) { this.urlMap = urlMap; return this; @@ -143,13 +126,13 @@ public Builder setUrlMap(String urlMap) { private Builder() {} - public Builder (UrlMapName urlMapName) { - project = urlMapName.project; - urlMap = urlMapName.urlMap; + public Builder(ProjectGlobalUrlMapName projectGlobalUrlMapName) { + project = projectGlobalUrlMapName.project; + urlMap = projectGlobalUrlMapName.urlMap; } - public UrlMapName build() { - return new UrlMapName(this); + public ProjectGlobalUrlMapName build() { + return new ProjectGlobalUrlMapName(this); } } @@ -157,8 +140,7 @@ public UrlMapName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "urlMap", urlMap - ); + "urlMap", urlMap); } @Override @@ -166,21 +148,16 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof UrlMapName) { - UrlMapName that = (UrlMapName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.urlMap, that.getUrlMap()) - ; + if (o instanceof ProjectGlobalUrlMapName) { + ProjectGlobalUrlMapName that = (ProjectGlobalUrlMapName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - urlMap - ); + return Objects.hash(project, urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java deleted file mode 100644 index eb0c727d3a58..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHealthCheckName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectHealthCheckName implements com.google.api.resourcenames.ResourceName { - private final String healthCheck; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/healthChecks/{healthCheck}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectHealthCheckName(Builder builder) { - healthCheck = Preconditions.checkNotNull(builder.getHealthCheck()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectHealthCheckName of( - String healthCheck, - String project - ) { - return newBuilder() - .setHealthCheck(healthCheck) - .setProject(project) - .build(); - } - - public static String format( - String healthCheck, - String project - ) { - return of( - healthCheck, - project - ) - .toString(); - } - - public String getHealthCheck() { - return healthCheck; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("healthCheck", healthCheck); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectHealthCheckName parse(String formattedString) {return ProjectHealthCheckName.parse(formattedString);} - }; - } - - public static ProjectHealthCheckName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectHealthCheckName.parse: formattedString not in valid format"); - return of( - matchMap.get("healthCheck"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String healthCheck; - private String project; - - public String getHealthCheck() { - return healthCheck; - } - public String getProject() { - return project; - } - - public Builder setHealthCheck(String healthCheck) { - this.healthCheck = healthCheck; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectHealthCheckName projectHealthCheckName) { - healthCheck = projectHealthCheckName.healthCheck; - project = projectHealthCheckName.project; - } - - public ProjectHealthCheckName build() { - return new ProjectHealthCheckName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "healthCheck", healthCheck, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectHealthCheckName) { - ProjectHealthCheckName that = (ProjectHealthCheckName) o; - return - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - healthCheck, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java deleted file mode 100644 index b198348dea02..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpHealthCheckName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectHttpHealthCheckName implements com.google.api.resourcenames.ResourceName { - private final String httpHealthCheck; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/httpHealthChecks/{httpHealthCheck}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectHttpHealthCheckName(Builder builder) { - httpHealthCheck = Preconditions.checkNotNull(builder.getHttpHealthCheck()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectHttpHealthCheckName of( - String httpHealthCheck, - String project - ) { - return newBuilder() - .setHttpHealthCheck(httpHealthCheck) - .setProject(project) - .build(); - } - - public static String format( - String httpHealthCheck, - String project - ) { - return of( - httpHealthCheck, - project - ) - .toString(); - } - - public String getHttpHealthCheck() { - return httpHealthCheck; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("httpHealthCheck", httpHealthCheck); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectHttpHealthCheckName parse(String formattedString) {return ProjectHttpHealthCheckName.parse(formattedString);} - }; - } - - public static ProjectHttpHealthCheckName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectHttpHealthCheckName.parse: formattedString not in valid format"); - return of( - matchMap.get("httpHealthCheck"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String httpHealthCheck; - private String project; - - public String getHttpHealthCheck() { - return httpHealthCheck; - } - public String getProject() { - return project; - } - - public Builder setHttpHealthCheck(String httpHealthCheck) { - this.httpHealthCheck = httpHealthCheck; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectHttpHealthCheckName projectHttpHealthCheckName) { - httpHealthCheck = projectHttpHealthCheckName.httpHealthCheck; - project = projectHttpHealthCheckName.project; - } - - public ProjectHttpHealthCheckName build() { - return new ProjectHttpHealthCheckName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "httpHealthCheck", httpHealthCheck, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectHttpHealthCheckName) { - ProjectHttpHealthCheckName that = (ProjectHttpHealthCheckName) o; - return - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - httpHealthCheck, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java deleted file mode 100644 index 50f4a96cbeca..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectHttpsHealthCheckName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectHttpsHealthCheckName implements com.google.api.resourcenames.ResourceName { - private final String httpsHealthCheck; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/httpsHealthChecks/{httpsHealthCheck}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectHttpsHealthCheckName(Builder builder) { - httpsHealthCheck = Preconditions.checkNotNull(builder.getHttpsHealthCheck()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectHttpsHealthCheckName of( - String httpsHealthCheck, - String project - ) { - return newBuilder() - .setHttpsHealthCheck(httpsHealthCheck) - .setProject(project) - .build(); - } - - public static String format( - String httpsHealthCheck, - String project - ) { - return of( - httpsHealthCheck, - project - ) - .toString(); - } - - public String getHttpsHealthCheck() { - return httpsHealthCheck; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("httpsHealthCheck", httpsHealthCheck); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectHttpsHealthCheckName parse(String formattedString) {return ProjectHttpsHealthCheckName.parse(formattedString);} - }; - } - - public static ProjectHttpsHealthCheckName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectHttpsHealthCheckName.parse: formattedString not in valid format"); - return of( - matchMap.get("httpsHealthCheck"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String httpsHealthCheck; - private String project; - - public String getHttpsHealthCheck() { - return httpsHealthCheck; - } - public String getProject() { - return project; - } - - public Builder setHttpsHealthCheck(String httpsHealthCheck) { - this.httpsHealthCheck = httpsHealthCheck; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectHttpsHealthCheckName projectHttpsHealthCheckName) { - httpsHealthCheck = projectHttpsHealthCheckName.httpsHealthCheck; - project = projectHttpsHealthCheckName.project; - } - - public ProjectHttpsHealthCheckName build() { - return new ProjectHttpsHealthCheckName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "httpsHealthCheck", httpsHealthCheck, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectHttpsHealthCheckName) { - ProjectHttpsHealthCheckName that = (ProjectHttpsHealthCheckName) o; - return - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - httpsHealthCheck, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java deleted file mode 100644 index 0cb5a187ea39..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInstanceTemplateName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectInstanceTemplateName implements com.google.api.resourcenames.ResourceName { - private final String instanceTemplate; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/instanceTemplates/{instanceTemplate}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectInstanceTemplateName(Builder builder) { - instanceTemplate = Preconditions.checkNotNull(builder.getInstanceTemplate()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectInstanceTemplateName of( - String instanceTemplate, - String project - ) { - return newBuilder() - .setInstanceTemplate(instanceTemplate) - .setProject(project) - .build(); - } - - public static String format( - String instanceTemplate, - String project - ) { - return of( - instanceTemplate, - project - ) - .toString(); - } - - public String getInstanceTemplate() { - return instanceTemplate; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("instanceTemplate", instanceTemplate); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectInstanceTemplateName parse(String formattedString) {return ProjectInstanceTemplateName.parse(formattedString);} - }; - } - - public static ProjectInstanceTemplateName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectInstanceTemplateName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceTemplate"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String instanceTemplate; - private String project; - - public String getInstanceTemplate() { - return instanceTemplate; - } - public String getProject() { - return project; - } - - public Builder setInstanceTemplate(String instanceTemplate) { - this.instanceTemplate = instanceTemplate; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectInstanceTemplateName projectInstanceTemplateName) { - instanceTemplate = projectInstanceTemplateName.instanceTemplate; - project = projectInstanceTemplateName.project; - } - - public ProjectInstanceTemplateName build() { - return new ProjectInstanceTemplateName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "instanceTemplate", instanceTemplate, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectInstanceTemplateName) { - ProjectInstanceTemplateName that = (ProjectInstanceTemplateName) o; - return - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - instanceTemplate, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java deleted file mode 100644 index 032c76151860..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectLocationName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectInterconnectLocationName implements com.google.api.resourcenames.ResourceName { - private final String interconnectLocation; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnectLocations/{interconnectLocation}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectInterconnectLocationName(Builder builder) { - interconnectLocation = Preconditions.checkNotNull(builder.getInterconnectLocation()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectInterconnectLocationName of( - String interconnectLocation, - String project - ) { - return newBuilder() - .setInterconnectLocation(interconnectLocation) - .setProject(project) - .build(); - } - - public static String format( - String interconnectLocation, - String project - ) { - return of( - interconnectLocation, - project - ) - .toString(); - } - - public String getInterconnectLocation() { - return interconnectLocation; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("interconnectLocation", interconnectLocation); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectInterconnectLocationName parse(String formattedString) {return ProjectInterconnectLocationName.parse(formattedString);} - }; - } - - public static ProjectInterconnectLocationName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectInterconnectLocationName.parse: formattedString not in valid format"); - return of( - matchMap.get("interconnectLocation"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String interconnectLocation; - private String project; - - public String getInterconnectLocation() { - return interconnectLocation; - } - public String getProject() { - return project; - } - - public Builder setInterconnectLocation(String interconnectLocation) { - this.interconnectLocation = interconnectLocation; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectInterconnectLocationName projectInterconnectLocationName) { - interconnectLocation = projectInterconnectLocationName.interconnectLocation; - project = projectInterconnectLocationName.project; - } - - public ProjectInterconnectLocationName build() { - return new ProjectInterconnectLocationName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "interconnectLocation", interconnectLocation, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectInterconnectLocationName) { - ProjectInterconnectLocationName that = (ProjectInterconnectLocationName) o; - return - Objects.equals(this.interconnectLocation, that.getInterconnectLocation()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - interconnectLocation, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java deleted file mode 100644 index 8a164d30a23e..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectInterconnectName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectInterconnectName implements com.google.api.resourcenames.ResourceName { - private final String interconnect; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/interconnects/{interconnect}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectInterconnectName(Builder builder) { - interconnect = Preconditions.checkNotNull(builder.getInterconnect()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectInterconnectName of( - String interconnect, - String project - ) { - return newBuilder() - .setInterconnect(interconnect) - .setProject(project) - .build(); - } - - public static String format( - String interconnect, - String project - ) { - return of( - interconnect, - project - ) - .toString(); - } - - public String getInterconnect() { - return interconnect; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("interconnect", interconnect); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectInterconnectName parse(String formattedString) {return ProjectInterconnectName.parse(formattedString);} - }; - } - - public static ProjectInterconnectName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectInterconnectName.parse: formattedString not in valid format"); - return of( - matchMap.get("interconnect"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String interconnect; - private String project; - - public String getInterconnect() { - return interconnect; - } - public String getProject() { - return project; - } - - public Builder setInterconnect(String interconnect) { - this.interconnect = interconnect; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectInterconnectName projectInterconnectName) { - interconnect = projectInterconnectName.interconnect; - project = projectInterconnectName.project; - } - - public ProjectInterconnectName build() { - return new ProjectInterconnectName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "interconnect", interconnect, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectInterconnectName) { - ProjectInterconnectName that = (ProjectInterconnectName) o; - return - Objects.equals(this.interconnect, that.getInterconnect()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - interconnect, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java deleted file mode 100644 index 448b97d14906..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectLicenseName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectLicenseName implements com.google.api.resourcenames.ResourceName { - private final String license; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/licenses/{license}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectLicenseName(Builder builder) { - license = Preconditions.checkNotNull(builder.getLicense()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectLicenseName of( - String license, - String project - ) { - return newBuilder() - .setLicense(license) - .setProject(project) - .build(); - } - - public static String format( - String license, - String project - ) { - return of( - license, - project - ) - .toString(); - } - - public String getLicense() { - return license; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("license", license); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectLicenseName parse(String formattedString) {return ProjectLicenseName.parse(formattedString);} - }; - } - - public static ProjectLicenseName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectLicenseName.parse: formattedString not in valid format"); - return of( - matchMap.get("license"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String license; - private String project; - - public String getLicense() { - return license; - } - public String getProject() { - return project; - } - - public Builder setLicense(String license) { - this.license = license; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectLicenseName projectLicenseName) { - license = projectLicenseName.license; - project = projectLicenseName.project; - } - - public ProjectLicenseName build() { - return new ProjectLicenseName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "license", license, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectLicenseName) { - ProjectLicenseName that = (ProjectLicenseName) o; - return - Objects.equals(this.license, that.getLicense()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - license, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java index d331ea1cc15e..7000e41a698b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java @@ -17,24 +17,20 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectName implements com.google.api.resourcenames.ResourceName { +public final class ProjectName implements ResourceName { private final String project; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}"); private volatile Map fieldValuesMap; @@ -50,28 +46,18 @@ private ProjectName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); } - public static ProjectName of( - String project - ) { - return newBuilder() - .setProject(project) - .build(); + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); } - public static String format( - String project - ) { - return of( - project - ) - .toString(); + public static String format(String project) { + return of(project).toString(); } public String getProject() { return project; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -90,19 +76,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectName parse(String formattedString) {return ProjectName.parse(formattedString);} + public ProjectName parse(String formattedString) { + return ProjectName.parse(formattedString); + } }; } public static ProjectName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectName.parse: formattedString not in valid format"); - return of( - matchMap.get("project") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); } public static boolean isParsableFrom(String formattedString) { @@ -123,7 +109,7 @@ public Builder setProject(String project) { private Builder() {} - public Builder (ProjectName projectName) { + public Builder(ProjectName projectName) { project = projectName.project; } @@ -134,9 +120,7 @@ public ProjectName build() { @Override public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project - ); + return PATH_TEMPLATE.instantiate("project", project); } @Override @@ -146,17 +130,13 @@ public boolean equals(Object o) { } if (o instanceof ProjectName) { ProjectName that = (ProjectName) o; - return - Objects.equals(this.project, that.getProject()) - ; + return Objects.equals(this.project, that.getProject()); } return false; } @Override public int hashCode() { - return Objects.hash( - project - ); + return Objects.hash(project); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java deleted file mode 100644 index 1ab3521f9c0b..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectNetworkName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectNetworkName implements com.google.api.resourcenames.ResourceName { - private final String network; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/networks/{network}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectNetworkName(Builder builder) { - network = Preconditions.checkNotNull(builder.getNetwork()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectNetworkName of( - String network, - String project - ) { - return newBuilder() - .setNetwork(network) - .setProject(project) - .build(); - } - - public static String format( - String network, - String project - ) { - return of( - network, - project - ) - .toString(); - } - - public String getNetwork() { - return network; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("network", network); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectNetworkName parse(String formattedString) {return ProjectNetworkName.parse(formattedString);} - }; - } - - public static ProjectNetworkName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectNetworkName.parse: formattedString not in valid format"); - return of( - matchMap.get("network"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String network; - private String project; - - public String getNetwork() { - return network; - } - public String getProject() { - return project; - } - - public Builder setNetwork(String network) { - this.network = network; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectNetworkName projectNetworkName) { - network = projectNetworkName.network; - project = projectNetworkName.project; - } - - public ProjectNetworkName build() { - return new ProjectNetworkName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "network", network, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectNetworkName) { - ProjectNetworkName that = (ProjectNetworkName) o; - return - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - network, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java deleted file mode 100644 index 9721821c6771..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectOperationName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectOperationName implements com.google.api.resourcenames.ResourceName { - private final String operation; - private final String project; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/operations/{operation}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectOperationName(Builder builder) { - operation = Preconditions.checkNotNull(builder.getOperation()); - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectOperationName of( - String operation, - String project - ) { - return newBuilder() - .setOperation(operation) - .setProject(project) - .build(); - } - - public static String format( - String operation, - String project - ) { - return of( - operation, - project - ) - .toString(); - } - - public String getOperation() { - return operation; - } - - public String getProject() { - return project; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("operation", operation); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectOperationName parse(String formattedString) {return ProjectOperationName.parse(formattedString);} - }; - } - - public static ProjectOperationName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectOperationName.parse: formattedString not in valid format"); - return of( - matchMap.get("operation"), - matchMap.get("project") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String operation; - private String project; - - public String getOperation() { - return operation; - } - public String getProject() { - return project; - } - - public Builder setOperation(String operation) { - this.operation = operation; - return this; - } - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - public Builder (ProjectOperationName projectOperationName) { - operation = projectOperationName.operation; - project = projectOperationName.project; - } - - public ProjectOperationName build() { - return new ProjectOperationName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "operation", operation, - "project", project - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectOperationName) { - ProjectOperationName that = (ProjectOperationName) o; - return - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.project, that.getProject()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - operation, - project - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java index 0edc2c85315c..4cb6de0afb0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionAddressName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionAddressName implements ResourceName { private final String address; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/addresses/{address}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/addresses/{address}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionAddressName(Builder builder) { region = Preconditions.checkNotNull(builder.getRegion()); } - public static ProjectRegionAddressName of( - String address, - String project, - String region - ) { - return newBuilder() - .setAddress(address) - .setProject(project) - .setRegion(region) - .build(); + public static ProjectRegionAddressName of(String address, String project, String region) { + return newBuilder().setAddress(address).setProject(project).setRegion(region).build(); } - public static String format( - String address, - String project, - String region - ) { - return of( - address, - project, - region - ) - .toString(); + public static String format(String address, String project, String region) { + return of(address, project, region).toString(); } public String getAddress() { @@ -91,7 +71,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionAddressName parse(String formattedString) {return ProjectRegionAddressName.parse(formattedString);} + public ProjectRegionAddressName parse(String formattedString) { + return ProjectRegionAddressName.parse(formattedString); + } }; } public static ProjectRegionAddressName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionAddressName.parse: formattedString not in valid format"); - return of( - matchMap.get("address"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectRegionAddressName.parse: formattedString not in valid format"); + return of(matchMap.get("address"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +118,11 @@ public static class Builder { public String getAddress() { return address; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +131,12 @@ public Builder setAddress(String address) { this.address = address; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +144,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionAddressName projectRegionAddressName) { + public Builder(ProjectRegionAddressName projectRegionAddressName) { address = projectRegionAddressName.address; project = projectRegionAddressName.project; region = projectRegionAddressName.region; @@ -179,8 +160,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "address", address, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +170,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionAddressName) { ProjectRegionAddressName that = (ProjectRegionAddressName) o; - return - Objects.equals(this.address, that.getAddress()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.address, that.getAddress()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - address, - project, - region - ); + return Objects.hash(address, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java index 161df420d42e..c7bc1b56787d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionAutoscalerName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionAutoscalerName implements ResourceName { private final String autoscaler; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/autoscalers/{autoscaler}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/autoscalers/{autoscaler}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionAutoscalerName(Builder builder) { region = Preconditions.checkNotNull(builder.getRegion()); } - public static ProjectRegionAutoscalerName of( - String autoscaler, - String project, - String region - ) { - return newBuilder() - .setAutoscaler(autoscaler) - .setProject(project) - .setRegion(region) - .build(); + public static ProjectRegionAutoscalerName of(String autoscaler, String project, String region) { + return newBuilder().setAutoscaler(autoscaler).setProject(project).setRegion(region).build(); } - public static String format( - String autoscaler, - String project, - String region - ) { - return of( - autoscaler, - project, - region - ) - .toString(); + public static String format(String autoscaler, String project, String region) { + return of(autoscaler, project, region).toString(); } public String getAutoscaler() { @@ -91,7 +71,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionAutoscalerName parse(String formattedString) {return ProjectRegionAutoscalerName.parse(formattedString);} + public ProjectRegionAutoscalerName parse(String formattedString) { + return ProjectRegionAutoscalerName.parse(formattedString); + } }; } public static ProjectRegionAutoscalerName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionAutoscalerName.parse: formattedString not in valid format"); - return of( - matchMap.get("autoscaler"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionAutoscalerName.parse: formattedString not in valid format"); + return of(matchMap.get("autoscaler"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getAutoscaler() { return autoscaler; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +132,12 @@ public Builder setAutoscaler(String autoscaler) { this.autoscaler = autoscaler; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +145,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionAutoscalerName projectRegionAutoscalerName) { + public Builder(ProjectRegionAutoscalerName projectRegionAutoscalerName) { autoscaler = projectRegionAutoscalerName.autoscaler; project = projectRegionAutoscalerName.project; region = projectRegionAutoscalerName.region; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "autoscaler", autoscaler, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionAutoscalerName) { ProjectRegionAutoscalerName that = (ProjectRegionAutoscalerName) o; - return - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - autoscaler, - project, - region - ); + return Objects.hash(autoscaler, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java index 6a88ed3455a6..bc3a61a21492 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionBackendServiceName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionBackendServiceName implements ResourceName { private final String backendService; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/backendServices/{backendService}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/backendServices/{backendService}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectRegionBackendServiceName(Builder builder) { } public static ProjectRegionBackendServiceName of( - String backendService, - String project, - String region - ) { + String backendService, String project, String region) { return newBuilder() - .setBackendService(backendService) - .setProject(project) - .setRegion(region) - .build(); + .setBackendService(backendService) + .setProject(project) + .setRegion(region) + .build(); } - public static String format( - String backendService, - String project, - String region - ) { - return of( - backendService, - project, - region - ) - .toString(); + public static String format(String backendService, String project, String region) { + return of(backendService, project, region).toString(); } public String getBackendService() { @@ -91,7 +76,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionBackendServiceName parse(String formattedString) {return ProjectRegionBackendServiceName.parse(formattedString);} + public ProjectRegionBackendServiceName parse(String formattedString) { + return ProjectRegionBackendServiceName.parse(formattedString); + } }; } public static ProjectRegionBackendServiceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionBackendServiceName.parse: formattedString not in valid format"); - return of( - matchMap.get("backendService"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionBackendServiceName.parse: formattedString not in valid format"); + return of(matchMap.get("backendService"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +124,11 @@ public static class Builder { public String getBackendService() { return backendService; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +137,12 @@ public Builder setBackendService(String backendService) { this.backendService = backendService; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +150,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionBackendServiceName projectRegionBackendServiceName) { + public Builder(ProjectRegionBackendServiceName projectRegionBackendServiceName) { backendService = projectRegionBackendServiceName.backendService; project = projectRegionBackendServiceName.project; region = projectRegionBackendServiceName.region; @@ -179,8 +166,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "backendService", backendService, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +176,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionBackendServiceName) { ProjectRegionBackendServiceName that = (ProjectRegionBackendServiceName) o; - return - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - backendService, - project, - region - ); + return Objects.hash(backendService, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java index 3a4d1e322f31..b7695fdd9fd1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionCommitmentName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionCommitmentName implements ResourceName { private final String commitment; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/commitments/{commitment}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/commitments/{commitment}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionCommitmentName(Builder builder) { region = Preconditions.checkNotNull(builder.getRegion()); } - public static ProjectRegionCommitmentName of( - String commitment, - String project, - String region - ) { - return newBuilder() - .setCommitment(commitment) - .setProject(project) - .setRegion(region) - .build(); + public static ProjectRegionCommitmentName of(String commitment, String project, String region) { + return newBuilder().setCommitment(commitment).setProject(project).setRegion(region).build(); } - public static String format( - String commitment, - String project, - String region - ) { - return of( - commitment, - project, - region - ) - .toString(); + public static String format(String commitment, String project, String region) { + return of(commitment, project, region).toString(); } public String getCommitment() { @@ -91,7 +71,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionCommitmentName parse(String formattedString) {return ProjectRegionCommitmentName.parse(formattedString);} + public ProjectRegionCommitmentName parse(String formattedString) { + return ProjectRegionCommitmentName.parse(formattedString); + } }; } public static ProjectRegionCommitmentName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionCommitmentName.parse: formattedString not in valid format"); - return of( - matchMap.get("commitment"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionCommitmentName.parse: formattedString not in valid format"); + return of(matchMap.get("commitment"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getCommitment() { return commitment; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +132,12 @@ public Builder setCommitment(String commitment) { this.commitment = commitment; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +145,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionCommitmentName projectRegionCommitmentName) { + public Builder(ProjectRegionCommitmentName projectRegionCommitmentName) { commitment = projectRegionCommitmentName.commitment; project = projectRegionCommitmentName.project; region = projectRegionCommitmentName.region; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "commitment", commitment, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionCommitmentName) { ProjectRegionCommitmentName that = (ProjectRegionCommitmentName) o; - return - Objects.equals(this.commitment, that.getCommitment()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.commitment, that.getCommitment()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - commitment, - project, - region - ); + return Objects.hash(commitment, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java index 917672740e8c..8b5c85991c16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionForwardingRuleName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionForwardingRuleName implements ResourceName { private final String forwardingRule; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/forwardingRules/{forwardingRule}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectRegionForwardingRuleName(Builder builder) { } public static ProjectRegionForwardingRuleName of( - String forwardingRule, - String project, - String region - ) { + String forwardingRule, String project, String region) { return newBuilder() - .setForwardingRule(forwardingRule) - .setProject(project) - .setRegion(region) - .build(); + .setForwardingRule(forwardingRule) + .setProject(project) + .setRegion(region) + .build(); } - public static String format( - String forwardingRule, - String project, - String region - ) { - return of( - forwardingRule, - project, - region - ) - .toString(); + public static String format(String forwardingRule, String project, String region) { + return of(forwardingRule, project, region).toString(); } public String getForwardingRule() { @@ -91,7 +76,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionForwardingRuleName parse(String formattedString) {return ProjectRegionForwardingRuleName.parse(formattedString);} + public ProjectRegionForwardingRuleName parse(String formattedString) { + return ProjectRegionForwardingRuleName.parse(formattedString); + } }; } public static ProjectRegionForwardingRuleName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionForwardingRuleName.parse: formattedString not in valid format"); - return of( - matchMap.get("forwardingRule"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionForwardingRuleName.parse: formattedString not in valid format"); + return of(matchMap.get("forwardingRule"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +124,11 @@ public static class Builder { public String getForwardingRule() { return forwardingRule; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +137,12 @@ public Builder setForwardingRule(String forwardingRule) { this.forwardingRule = forwardingRule; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +150,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionForwardingRuleName projectRegionForwardingRuleName) { + public Builder(ProjectRegionForwardingRuleName projectRegionForwardingRuleName) { forwardingRule = projectRegionForwardingRuleName.forwardingRule; project = projectRegionForwardingRuleName.project; region = projectRegionForwardingRuleName.region; @@ -179,8 +166,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "forwardingRule", forwardingRule, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +176,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionForwardingRuleName) { ProjectRegionForwardingRuleName that = (ProjectRegionForwardingRuleName) o; - return - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - forwardingRule, - project, - region - ); + return Objects.hash(forwardingRule, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java index 1b8bcfa01e0a..ca1649753d03 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionInstanceGroupManagerName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionInstanceGroupManagerName implements ResourceName { private final String instanceGroupManager; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectRegionInstanceGroupManagerName(Builder builder) { } public static ProjectRegionInstanceGroupManagerName of( - String instanceGroupManager, - String project, - String region - ) { + String instanceGroupManager, String project, String region) { return newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setProject(project) - .setRegion(region) - .build(); + .setInstanceGroupManager(instanceGroupManager) + .setProject(project) + .setRegion(region) + .build(); } - public static String format( - String instanceGroupManager, - String project, - String region - ) { - return of( - instanceGroupManager, - project, - region - ) - .toString(); + public static String format(String instanceGroupManager, String project, String region) { + return of(instanceGroupManager, project, region).toString(); } public String getInstanceGroupManager() { @@ -91,7 +76,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,21 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionInstanceGroupManagerName parse(String formattedString) {return ProjectRegionInstanceGroupManagerName.parse(formattedString);} + public ProjectRegionInstanceGroupManagerName parse(String formattedString) { + return ProjectRegionInstanceGroupManagerName.parse(formattedString); + } }; } public static ProjectRegionInstanceGroupManagerName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionInstanceGroupManagerName.parse: formattedString not in valid format"); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionInstanceGroupManagerName.parse: formattedString not in valid format"); return of( - matchMap.get("instanceGroupManager"), - matchMap.get("project"), - matchMap.get("region") - ); + matchMap.get("instanceGroupManager"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +125,11 @@ public static class Builder { public String getInstanceGroupManager() { return instanceGroupManager; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +138,12 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { this.instanceGroupManager = instanceGroupManager; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +151,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionInstanceGroupManagerName projectRegionInstanceGroupManagerName) { + public Builder(ProjectRegionInstanceGroupManagerName projectRegionInstanceGroupManagerName) { instanceGroupManager = projectRegionInstanceGroupManagerName.instanceGroupManager; project = projectRegionInstanceGroupManagerName.project; region = projectRegionInstanceGroupManagerName.region; @@ -179,8 +167,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "instanceGroupManager", instanceGroupManager, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +177,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionInstanceGroupManagerName) { ProjectRegionInstanceGroupManagerName that = (ProjectRegionInstanceGroupManagerName) o; - return - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceGroupManager, - project, - region - ); + return Objects.hash(instanceGroupManager, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java index d13ad63d5846..e09951b5afce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionInstanceGroupName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionInstanceGroupName implements ResourceName { private final String instanceGroup; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/instanceGroups/{instanceGroup}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectRegionInstanceGroupName(Builder builder) { } public static ProjectRegionInstanceGroupName of( - String instanceGroup, - String project, - String region - ) { + String instanceGroup, String project, String region) { return newBuilder() - .setInstanceGroup(instanceGroup) - .setProject(project) - .setRegion(region) - .build(); + .setInstanceGroup(instanceGroup) + .setProject(project) + .setRegion(region) + .build(); } - public static String format( - String instanceGroup, - String project, - String region - ) { - return of( - instanceGroup, - project, - region - ) - .toString(); + public static String format(String instanceGroup, String project, String region) { + return of(instanceGroup, project, region).toString(); } public String getInstanceGroup() { @@ -91,7 +76,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionInstanceGroupName parse(String formattedString) {return ProjectRegionInstanceGroupName.parse(formattedString);} + public ProjectRegionInstanceGroupName parse(String formattedString) { + return ProjectRegionInstanceGroupName.parse(formattedString); + } }; } public static ProjectRegionInstanceGroupName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionInstanceGroupName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceGroup"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionInstanceGroupName.parse: formattedString not in valid format"); + return of(matchMap.get("instanceGroup"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +124,11 @@ public static class Builder { public String getInstanceGroup() { return instanceGroup; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +137,12 @@ public Builder setInstanceGroup(String instanceGroup) { this.instanceGroup = instanceGroup; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +150,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionInstanceGroupName projectRegionInstanceGroupName) { + public Builder(ProjectRegionInstanceGroupName projectRegionInstanceGroupName) { instanceGroup = projectRegionInstanceGroupName.instanceGroup; project = projectRegionInstanceGroupName.project; region = projectRegionInstanceGroupName.region; @@ -179,8 +166,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "instanceGroup", instanceGroup, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +176,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionInstanceGroupName) { ProjectRegionInstanceGroupName that = (ProjectRegionInstanceGroupName) o; - return - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceGroup, - project, - region - ); + return Objects.hash(instanceGroup, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java index 2a0044c79f43..300557c1bef4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionInterconnectAttachmentName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionInterconnectAttachmentName implements ResourceName { private final String interconnectAttachment; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectRegionInterconnectAttachmentName(Builder builder) { } public static ProjectRegionInterconnectAttachmentName of( - String interconnectAttachment, - String project, - String region - ) { + String interconnectAttachment, String project, String region) { return newBuilder() - .setInterconnectAttachment(interconnectAttachment) - .setProject(project) - .setRegion(region) - .build(); + .setInterconnectAttachment(interconnectAttachment) + .setProject(project) + .setRegion(region) + .build(); } - public static String format( - String interconnectAttachment, - String project, - String region - ) { - return of( - interconnectAttachment, - project, - region - ) - .toString(); + public static String format(String interconnectAttachment, String project, String region) { + return of(interconnectAttachment, project, region).toString(); } public String getInterconnectAttachment() { @@ -91,7 +76,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,21 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionInterconnectAttachmentName parse(String formattedString) {return ProjectRegionInterconnectAttachmentName.parse(formattedString);} + public ProjectRegionInterconnectAttachmentName parse(String formattedString) { + return ProjectRegionInterconnectAttachmentName.parse(formattedString); + } }; } public static ProjectRegionInterconnectAttachmentName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionInterconnectAttachmentName.parse: formattedString not in valid format"); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionInterconnectAttachmentName.parse: formattedString not in valid format"); return of( - matchMap.get("interconnectAttachment"), - matchMap.get("project"), - matchMap.get("region") - ); + matchMap.get("interconnectAttachment"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +125,11 @@ public static class Builder { public String getInterconnectAttachment() { return interconnectAttachment; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +138,12 @@ public Builder setInterconnectAttachment(String interconnectAttachment) { this.interconnectAttachment = interconnectAttachment; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +151,8 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionInterconnectAttachmentName projectRegionInterconnectAttachmentName) { + public Builder( + ProjectRegionInterconnectAttachmentName projectRegionInterconnectAttachmentName) { interconnectAttachment = projectRegionInterconnectAttachmentName.interconnectAttachment; project = projectRegionInterconnectAttachmentName.project; region = projectRegionInterconnectAttachmentName.region; @@ -179,8 +168,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "interconnectAttachment", interconnectAttachment, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +178,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionInterconnectAttachmentName) { ProjectRegionInterconnectAttachmentName that = (ProjectRegionInterconnectAttachmentName) o; - return - Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - interconnectAttachment, - project, - region - ); + return Objects.hash(interconnectAttachment, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java index 7161420221cb..9c0b0c49530e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionName implements ResourceName { private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}"); private volatile Map fieldValuesMap; @@ -52,25 +48,12 @@ private ProjectRegionName(Builder builder) { region = Preconditions.checkNotNull(builder.getRegion()); } - public static ProjectRegionName of( - String project, - String region - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .build(); + public static ProjectRegionName of(String project, String region) { + return newBuilder().setProject(project).setRegion(region).build(); } - public static String format( - String project, - String region - ) { - return of( - project, - region - ) - .toString(); + public static String format(String project, String region) { + return of(project, region).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionName parse(String formattedString) {return ProjectRegionName.parse(formattedString);} + public ProjectRegionName parse(String formattedString) { + return ProjectRegionName.parse(formattedString); + } }; } public static ProjectRegionName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectRegionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } @@ -136,6 +118,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -143,7 +126,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionName projectRegionName) { + public Builder(ProjectRegionName projectRegionName) { project = projectRegionName.project; region = projectRegionName.region; } @@ -157,8 +140,7 @@ public ProjectRegionName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "region", region - ); + "region", region); } @Override @@ -168,19 +150,14 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionName) { ProjectRegionName that = (ProjectRegionName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region - ); + return Objects.hash(project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java index f0481c8fa5b9..29d5ddab60f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionOperationName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionOperationName implements ResourceName { private final String operation; private final String project; private final String region; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/operations/{operation}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/operations/{operation}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionOperationName(Builder builder) { region = Preconditions.checkNotNull(builder.getRegion()); } - public static ProjectRegionOperationName of( - String operation, - String project, - String region - ) { - return newBuilder() - .setOperation(operation) - .setProject(project) - .setRegion(region) - .build(); + public static ProjectRegionOperationName of(String operation, String project, String region) { + return newBuilder().setOperation(operation).setProject(project).setRegion(region).build(); } - public static String format( - String operation, - String project, - String region - ) { - return of( - operation, - project, - region - ) - .toString(); + public static String format(String operation, String project, String region) { + return of(operation, project, region).toString(); } public String getOperation() { @@ -91,7 +71,6 @@ public String getRegion() { return region; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionOperationName parse(String formattedString) {return ProjectRegionOperationName.parse(formattedString);} + public ProjectRegionOperationName parse(String formattedString) { + return ProjectRegionOperationName.parse(formattedString); + } }; } public static ProjectRegionOperationName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionOperationName.parse: formattedString not in valid format"); - return of( - matchMap.get("operation"), - matchMap.get("project"), - matchMap.get("region") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionOperationName.parse: formattedString not in valid format"); + return of(matchMap.get("operation"), matchMap.get("project"), matchMap.get("region")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getOperation() { return operation; } + public String getProject() { return project; } + public String getRegion() { return region; } @@ -152,10 +132,12 @@ public Builder setOperation(String operation) { this.operation = operation; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; @@ -163,7 +145,7 @@ public Builder setRegion(String region) { private Builder() {} - public Builder (ProjectRegionOperationName projectRegionOperationName) { + public Builder(ProjectRegionOperationName projectRegionOperationName) { operation = projectRegionOperationName.operation; project = projectRegionOperationName.project; region = projectRegionOperationName.region; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "operation", operation, "project", project, - "region", region - ); + "region", region); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionOperationName) { ProjectRegionOperationName that = (ProjectRegionOperationName) o; - return - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; + return Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); } return false; } @Override public int hashCode() { - return Objects.hash( - operation, - project, - region - ); + return Objects.hash(operation, project, region); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java index e27282d1f4f4..bbba1af582e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java @@ -17,26 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionRouterName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionRouterName implements ResourceName { private final String project; private final String region; private final String router; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}"); private volatile Map fieldValuesMap; @@ -54,29 +50,12 @@ private ProjectRegionRouterName(Builder builder) { router = Preconditions.checkNotNull(builder.getRouter()); } - public static ProjectRegionRouterName of( - String project, - String region, - String router - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setRouter(router) - .build(); + public static ProjectRegionRouterName of(String project, String region, String router) { + return newBuilder().setProject(project).setRegion(region).setRouter(router).build(); } - public static String format( - String project, - String region, - String router - ) { - return of( - project, - region, - router - ) - .toString(); + public static String format(String project, String region, String router) { + return of(project, region, router).toString(); } public String getProject() { @@ -91,7 +70,6 @@ public String getRouter() { return router; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +90,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionRouterName parse(String formattedString) {return ProjectRegionRouterName.parse(formattedString);} + public ProjectRegionRouterName parse(String formattedString) { + return ProjectRegionRouterName.parse(formattedString); + } }; } public static ProjectRegionRouterName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionRouterName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("router") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectRegionRouterName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("router")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +117,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getRouter() { return router; } @@ -152,10 +130,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setRouter(String router) { this.router = router; return this; @@ -163,7 +143,7 @@ public Builder setRouter(String router) { private Builder() {} - public Builder (ProjectRegionRouterName projectRegionRouterName) { + public Builder(ProjectRegionRouterName projectRegionRouterName) { project = projectRegionRouterName.project; region = projectRegionRouterName.region; router = projectRegionRouterName.router; @@ -179,8 +159,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "router", router - ); + "router", router); } @Override @@ -190,21 +169,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionRouterName) { ProjectRegionRouterName that = (ProjectRegionRouterName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.router, that.getRouter()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.router, that.getRouter()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - router - ); + return Objects.hash(project, region, router); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java index f63f11d34a1a..08d411226067 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionSubnetworkName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionSubnetworkName implements ResourceName { private final String project; private final String region; private final String subnetwork; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/subnetworks/{subnetwork}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/subnetworks/{subnetwork}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionSubnetworkName(Builder builder) { subnetwork = Preconditions.checkNotNull(builder.getSubnetwork()); } - public static ProjectRegionSubnetworkName of( - String project, - String region, - String subnetwork - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setSubnetwork(subnetwork) - .build(); + public static ProjectRegionSubnetworkName of(String project, String region, String subnetwork) { + return newBuilder().setProject(project).setRegion(region).setSubnetwork(subnetwork).build(); } - public static String format( - String project, - String region, - String subnetwork - ) { - return of( - project, - region, - subnetwork - ) - .toString(); + public static String format(String project, String region, String subnetwork) { + return of(project, region, subnetwork).toString(); } public String getProject() { @@ -91,7 +71,6 @@ public String getSubnetwork() { return subnetwork; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionSubnetworkName parse(String formattedString) {return ProjectRegionSubnetworkName.parse(formattedString);} + public ProjectRegionSubnetworkName parse(String formattedString) { + return ProjectRegionSubnetworkName.parse(formattedString); + } }; } public static ProjectRegionSubnetworkName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionSubnetworkName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("subnetwork") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionSubnetworkName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("subnetwork")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getSubnetwork() { return subnetwork; } @@ -152,10 +132,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setSubnetwork(String subnetwork) { this.subnetwork = subnetwork; return this; @@ -163,7 +145,7 @@ public Builder setSubnetwork(String subnetwork) { private Builder() {} - public Builder (ProjectRegionSubnetworkName projectRegionSubnetworkName) { + public Builder(ProjectRegionSubnetworkName projectRegionSubnetworkName) { project = projectRegionSubnetworkName.project; region = projectRegionSubnetworkName.region; subnetwork = projectRegionSubnetworkName.subnetwork; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "subnetwork", subnetwork - ); + "subnetwork", subnetwork); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionSubnetworkName) { ProjectRegionSubnetworkName that = (ProjectRegionSubnetworkName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.subnetwork, that.getSubnetwork()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - subnetwork - ); + return Objects.hash(project, region, subnetwork); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java index 55eab1fb42ce..99b49c4ece16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionTargetPoolName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionTargetPoolName implements ResourceName { private final String project; private final String region; private final String targetPool; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetPools/{targetPool}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/targetPools/{targetPool}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionTargetPoolName(Builder builder) { targetPool = Preconditions.checkNotNull(builder.getTargetPool()); } - public static ProjectRegionTargetPoolName of( - String project, - String region, - String targetPool - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setTargetPool(targetPool) - .build(); + public static ProjectRegionTargetPoolName of(String project, String region, String targetPool) { + return newBuilder().setProject(project).setRegion(region).setTargetPool(targetPool).build(); } - public static String format( - String project, - String region, - String targetPool - ) { - return of( - project, - region, - targetPool - ) - .toString(); + public static String format(String project, String region, String targetPool) { + return of(project, region, targetPool).toString(); } public String getProject() { @@ -91,7 +71,6 @@ public String getTargetPool() { return targetPool; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionTargetPoolName parse(String formattedString) {return ProjectRegionTargetPoolName.parse(formattedString);} + public ProjectRegionTargetPoolName parse(String formattedString) { + return ProjectRegionTargetPoolName.parse(formattedString); + } }; } public static ProjectRegionTargetPoolName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionTargetPoolName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("targetPool") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionTargetPoolName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("targetPool")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getTargetPool() { return targetPool; } @@ -152,10 +132,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setTargetPool(String targetPool) { this.targetPool = targetPool; return this; @@ -163,7 +145,7 @@ public Builder setTargetPool(String targetPool) { private Builder() {} - public Builder (ProjectRegionTargetPoolName projectRegionTargetPoolName) { + public Builder(ProjectRegionTargetPoolName projectRegionTargetPoolName) { project = projectRegionTargetPoolName.project; region = projectRegionTargetPoolName.region; targetPool = projectRegionTargetPoolName.targetPool; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "targetPool", targetPool - ); + "targetPool", targetPool); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionTargetPoolName) { ProjectRegionTargetPoolName that = (ProjectRegionTargetPoolName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.targetPool, that.getTargetPool()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.targetPool, that.getTargetPool()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - targetPool - ); + return Objects.hash(project, region, targetPool); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java index d795fe473579..d08277e8cb00 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionTargetVpnGatewayName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionTargetVpnGatewayName implements ResourceName { private final String project; private final String region; private final String targetVpnGateway; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectRegionTargetVpnGatewayName(Builder builder) { } public static ProjectRegionTargetVpnGatewayName of( - String project, - String region, - String targetVpnGateway - ) { + String project, String region, String targetVpnGateway) { return newBuilder() - .setProject(project) - .setRegion(region) - .setTargetVpnGateway(targetVpnGateway) - .build(); + .setProject(project) + .setRegion(region) + .setTargetVpnGateway(targetVpnGateway) + .build(); } - public static String format( - String project, - String region, - String targetVpnGateway - ) { - return of( - project, - region, - targetVpnGateway - ) - .toString(); + public static String format(String project, String region, String targetVpnGateway) { + return of(project, region, targetVpnGateway).toString(); } public String getProject() { @@ -91,7 +76,6 @@ public String getTargetVpnGateway() { return targetVpnGateway; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionTargetVpnGatewayName parse(String formattedString) {return ProjectRegionTargetVpnGatewayName.parse(formattedString);} + public ProjectRegionTargetVpnGatewayName parse(String formattedString) { + return ProjectRegionTargetVpnGatewayName.parse(formattedString); + } }; } public static ProjectRegionTargetVpnGatewayName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionTargetVpnGatewayName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("targetVpnGateway") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionTargetVpnGatewayName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("targetVpnGateway")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +124,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getTargetVpnGateway() { return targetVpnGateway; } @@ -152,10 +137,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setTargetVpnGateway(String targetVpnGateway) { this.targetVpnGateway = targetVpnGateway; return this; @@ -163,7 +150,7 @@ public Builder setTargetVpnGateway(String targetVpnGateway) { private Builder() {} - public Builder (ProjectRegionTargetVpnGatewayName projectRegionTargetVpnGatewayName) { + public Builder(ProjectRegionTargetVpnGatewayName projectRegionTargetVpnGatewayName) { project = projectRegionTargetVpnGatewayName.project; region = projectRegionTargetVpnGatewayName.region; targetVpnGateway = projectRegionTargetVpnGatewayName.targetVpnGateway; @@ -179,8 +166,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "targetVpnGateway", targetVpnGateway - ); + "targetVpnGateway", targetVpnGateway); } @Override @@ -190,21 +176,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionTargetVpnGatewayName) { ProjectRegionTargetVpnGatewayName that = (ProjectRegionTargetVpnGatewayName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - targetVpnGateway - ); + return Objects.hash(project, region, targetVpnGateway); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java index f61e9348b7de..bde366102f22 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectRegionVpnTunnelName implements com.google.api.resourcenames.ResourceName { +public final class ProjectRegionVpnTunnelName implements ResourceName { private final String project; private final String region; private final String vpnTunnel; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectRegionVpnTunnelName(Builder builder) { vpnTunnel = Preconditions.checkNotNull(builder.getVpnTunnel()); } - public static ProjectRegionVpnTunnelName of( - String project, - String region, - String vpnTunnel - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setVpnTunnel(vpnTunnel) - .build(); + public static ProjectRegionVpnTunnelName of(String project, String region, String vpnTunnel) { + return newBuilder().setProject(project).setRegion(region).setVpnTunnel(vpnTunnel).build(); } - public static String format( - String project, - String region, - String vpnTunnel - ) { - return of( - project, - region, - vpnTunnel - ) - .toString(); + public static String format(String project, String region, String vpnTunnel) { + return of(project, region, vpnTunnel).toString(); } public String getProject() { @@ -91,7 +71,6 @@ public String getVpnTunnel() { return vpnTunnel; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectRegionVpnTunnelName parse(String formattedString) {return ProjectRegionVpnTunnelName.parse(formattedString);} + public ProjectRegionVpnTunnelName parse(String formattedString) { + return ProjectRegionVpnTunnelName.parse(formattedString); + } }; } public static ProjectRegionVpnTunnelName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectRegionVpnTunnelName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("vpnTunnel") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionVpnTunnelName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("vpnTunnel")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getProject() { return project; } + public String getRegion() { return region; } + public String getVpnTunnel() { return vpnTunnel; } @@ -152,10 +132,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setRegion(String region) { this.region = region; return this; } + public Builder setVpnTunnel(String vpnTunnel) { this.vpnTunnel = vpnTunnel; return this; @@ -163,7 +145,7 @@ public Builder setVpnTunnel(String vpnTunnel) { private Builder() {} - public Builder (ProjectRegionVpnTunnelName projectRegionVpnTunnelName) { + public Builder(ProjectRegionVpnTunnelName projectRegionVpnTunnelName) { project = projectRegionVpnTunnelName.project; region = projectRegionVpnTunnelName.region; vpnTunnel = projectRegionVpnTunnelName.vpnTunnel; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "region", region, - "vpnTunnel", vpnTunnel - ); + "vpnTunnel", vpnTunnel); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectRegionVpnTunnelName) { ProjectRegionVpnTunnelName that = (ProjectRegionVpnTunnelName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.vpnTunnel, that.getVpnTunnel()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.vpnTunnel, that.getVpnTunnel()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - region, - vpnTunnel - ); + return Objects.hash(project, region, vpnTunnel); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java index 587da3ddd3f5..a692a99dd7d2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; -import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; import com.google.cloud.compute.v1.stub.ProjectStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of disableXpnHostProject to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of disableXpnHostProject to 30 seconds: * *

  * 
@@ -86,133 +64,109 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ProjectSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to disableXpnHostProject.
-   */
-  public UnaryCallSettings disableXpnHostProjectSettings() {
+  /** Returns the object with the settings used for calls to disableXpnHostProject. */
+  public UnaryCallSettings
+      disableXpnHostProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).disableXpnHostProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to disableXpnResourceProject.
-   */
-  public UnaryCallSettings disableXpnResourceProjectSettings() {
+  /** Returns the object with the settings used for calls to disableXpnResourceProject. */
+  public UnaryCallSettings
+      disableXpnResourceProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).disableXpnResourceProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to enableXpnHostProject.
-   */
-  public UnaryCallSettings enableXpnHostProjectSettings() {
+  /** Returns the object with the settings used for calls to enableXpnHostProject. */
+  public UnaryCallSettings
+      enableXpnHostProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).enableXpnHostProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to enableXpnResourceProject.
-   */
-  public UnaryCallSettings enableXpnResourceProjectSettings() {
+  /** Returns the object with the settings used for calls to enableXpnResourceProject. */
+  public UnaryCallSettings
+      enableXpnResourceProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).enableXpnResourceProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getProject.
-   */
+  /** Returns the object with the settings used for calls to getProject. */
   public UnaryCallSettings getProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).getProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getXpnHostProject.
-   */
+  /** Returns the object with the settings used for calls to getXpnHostProject. */
   public UnaryCallSettings getXpnHostProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).getXpnHostProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getXpnResourcesProjects.
-   */
-  public PagedCallSettings getXpnResourcesProjectsSettings() {
+  /** Returns the object with the settings used for calls to getXpnResourcesProjects. */
+  public PagedCallSettings<
+          GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources,
+          GetXpnResourcesProjectsPagedResponse>
+      getXpnResourcesProjectsSettings() {
     return ((ProjectStubSettings) getStubSettings()).getXpnResourcesProjectsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listXpnHostsProjects.
-   */
-  public PagedCallSettings listXpnHostsProjectsSettings() {
+  /** Returns the object with the settings used for calls to listXpnHostsProjects. */
+  public PagedCallSettings<
+          ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse>
+      listXpnHostsProjectsSettings() {
     return ((ProjectStubSettings) getStubSettings()).listXpnHostsProjectsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to moveDiskProject.
-   */
+  /** Returns the object with the settings used for calls to moveDiskProject. */
   public UnaryCallSettings moveDiskProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).moveDiskProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to moveInstanceProject.
-   */
-  public UnaryCallSettings moveInstanceProjectSettings() {
+  /** Returns the object with the settings used for calls to moveInstanceProject. */
+  public UnaryCallSettings
+      moveInstanceProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).moveInstanceProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setCommonInstanceMetadataProject.
-   */
-  public UnaryCallSettings setCommonInstanceMetadataProjectSettings() {
+  /** Returns the object with the settings used for calls to setCommonInstanceMetadataProject. */
+  public UnaryCallSettings
+      setCommonInstanceMetadataProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).setCommonInstanceMetadataProjectSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setUsageExportBucketProject.
-   */
-  public UnaryCallSettings setUsageExportBucketProjectSettings() {
+  /** Returns the object with the settings used for calls to setUsageExportBucketProject. */
+  public UnaryCallSettings
+      setUsageExportBucketProjectSettings() {
     return ((ProjectStubSettings) getStubSettings()).setUsageExportBucketProjectSettings();
   }
 
-
   public static final ProjectSettings create(ProjectStubSettings stub) throws IOException {
     return new ProjectSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ProjectStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return ProjectStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return ProjectStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return ProjectStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return ProjectStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ProjectStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return ProjectStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -225,23 +179,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ProjectStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -250,9 +198,7 @@ protected ProjectSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for ProjectSettings.
-   */
+  /** Builder for ProjectSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -274,102 +220,94 @@ protected Builder(ProjectStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public ProjectStubSettings.Builder getStubSettingsBuilder() {
       return ((ProjectStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to disableXpnHostProject. - */ - public UnaryCallSettings.Builder disableXpnHostProjectSettings() { + /** Returns the builder for the settings used for calls to disableXpnHostProject. */ + public UnaryCallSettings.Builder + disableXpnHostProjectSettings() { return getStubSettingsBuilder().disableXpnHostProjectSettings(); } - /** - * Returns the builder for the settings used for calls to disableXpnResourceProject. - */ - public UnaryCallSettings.Builder disableXpnResourceProjectSettings() { + /** Returns the builder for the settings used for calls to disableXpnResourceProject. */ + public UnaryCallSettings.Builder + disableXpnResourceProjectSettings() { return getStubSettingsBuilder().disableXpnResourceProjectSettings(); } - /** - * Returns the builder for the settings used for calls to enableXpnHostProject. - */ - public UnaryCallSettings.Builder enableXpnHostProjectSettings() { + /** Returns the builder for the settings used for calls to enableXpnHostProject. */ + public UnaryCallSettings.Builder + enableXpnHostProjectSettings() { return getStubSettingsBuilder().enableXpnHostProjectSettings(); } - /** - * Returns the builder for the settings used for calls to enableXpnResourceProject. - */ - public UnaryCallSettings.Builder enableXpnResourceProjectSettings() { + /** Returns the builder for the settings used for calls to enableXpnResourceProject. */ + public UnaryCallSettings.Builder + enableXpnResourceProjectSettings() { return getStubSettingsBuilder().enableXpnResourceProjectSettings(); } - /** - * Returns the builder for the settings used for calls to getProject. - */ + /** Returns the builder for the settings used for calls to getProject. */ public UnaryCallSettings.Builder getProjectSettings() { return getStubSettingsBuilder().getProjectSettings(); } - /** - * Returns the builder for the settings used for calls to getXpnHostProject. - */ - public UnaryCallSettings.Builder getXpnHostProjectSettings() { + /** Returns the builder for the settings used for calls to getXpnHostProject. */ + public UnaryCallSettings.Builder + getXpnHostProjectSettings() { return getStubSettingsBuilder().getXpnHostProjectSettings(); } - /** - * Returns the builder for the settings used for calls to getXpnResourcesProjects. - */ - public PagedCallSettings.Builder getXpnResourcesProjectsSettings() { + /** Returns the builder for the settings used for calls to getXpnResourcesProjects. */ + public PagedCallSettings.Builder< + GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, + GetXpnResourcesProjectsPagedResponse> + getXpnResourcesProjectsSettings() { return getStubSettingsBuilder().getXpnResourcesProjectsSettings(); } - /** - * Returns the builder for the settings used for calls to listXpnHostsProjects. - */ - public PagedCallSettings.Builder listXpnHostsProjectsSettings() { + /** Returns the builder for the settings used for calls to listXpnHostsProjects. */ + public PagedCallSettings.Builder< + ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse> + listXpnHostsProjectsSettings() { return getStubSettingsBuilder().listXpnHostsProjectsSettings(); } - /** - * Returns the builder for the settings used for calls to moveDiskProject. - */ - public UnaryCallSettings.Builder moveDiskProjectSettings() { + /** Returns the builder for the settings used for calls to moveDiskProject. */ + public UnaryCallSettings.Builder + moveDiskProjectSettings() { return getStubSettingsBuilder().moveDiskProjectSettings(); } - /** - * Returns the builder for the settings used for calls to moveInstanceProject. - */ - public UnaryCallSettings.Builder moveInstanceProjectSettings() { + /** Returns the builder for the settings used for calls to moveInstanceProject. */ + public UnaryCallSettings.Builder + moveInstanceProjectSettings() { return getStubSettingsBuilder().moveInstanceProjectSettings(); } - /** - * Returns the builder for the settings used for calls to setCommonInstanceMetadataProject. - */ - public UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings() { + /** Returns the builder for the settings used for calls to setCommonInstanceMetadataProject. */ + public UnaryCallSettings.Builder + setCommonInstanceMetadataProjectSettings() { return getStubSettingsBuilder().setCommonInstanceMetadataProjectSettings(); } - /** - * Returns the builder for the settings used for calls to setUsageExportBucketProject. - */ - public UnaryCallSettings.Builder setUsageExportBucketProjectSettings() { + /** Returns the builder for the settings used for calls to setUsageExportBucketProject. */ + public UnaryCallSettings.Builder + setUsageExportBucketProjectSettings() { return getStubSettingsBuilder().setUsageExportBucketProjectSettings(); } @@ -378,4 +316,4 @@ public ProjectSettings build() throws IOException { return new ProjectSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java deleted file mode 100644 index 87fff2765464..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSslCertificateName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectSslCertificateName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String sslCertificate; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/sslCertificates/{sslCertificate}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectSslCertificateName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - sslCertificate = Preconditions.checkNotNull(builder.getSslCertificate()); - } - - public static ProjectSslCertificateName of( - String project, - String sslCertificate - ) { - return newBuilder() - .setProject(project) - .setSslCertificate(sslCertificate) - .build(); - } - - public static String format( - String project, - String sslCertificate - ) { - return of( - project, - sslCertificate - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getSslCertificate() { - return sslCertificate; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("sslCertificate", sslCertificate); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectSslCertificateName parse(String formattedString) {return ProjectSslCertificateName.parse(formattedString);} - }; - } - - public static ProjectSslCertificateName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectSslCertificateName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("sslCertificate") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String sslCertificate; - - public String getProject() { - return project; - } - public String getSslCertificate() { - return sslCertificate; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setSslCertificate(String sslCertificate) { - this.sslCertificate = sslCertificate; - return this; - } - - private Builder() {} - - public Builder (ProjectSslCertificateName projectSslCertificateName) { - project = projectSslCertificateName.project; - sslCertificate = projectSslCertificateName.sslCertificate; - } - - public ProjectSslCertificateName build() { - return new ProjectSslCertificateName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "sslCertificate", sslCertificate - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectSslCertificateName) { - ProjectSslCertificateName that = (ProjectSslCertificateName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.sslCertificate, that.getSslCertificate()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - sslCertificate - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java index 559380ce183e..e5be5d2b4024 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectTargetHttpProxyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectTargetHttpProxyName implements ResourceName { private final String project; private final String targetHttpProxy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpProxies/{targetHttpProxy}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/targetHttpProxies/{targetHttpProxy}"); private volatile Map fieldValuesMap; @@ -52,25 +49,12 @@ private ProjectTargetHttpProxyName(Builder builder) { targetHttpProxy = Preconditions.checkNotNull(builder.getTargetHttpProxy()); } - public static ProjectTargetHttpProxyName of( - String project, - String targetHttpProxy - ) { - return newBuilder() - .setProject(project) - .setTargetHttpProxy(targetHttpProxy) - .build(); + public static ProjectTargetHttpProxyName of(String project, String targetHttpProxy) { + return newBuilder().setProject(project).setTargetHttpProxy(targetHttpProxy).build(); } - public static String format( - String project, - String targetHttpProxy - ) { - return of( - project, - targetHttpProxy - ) - .toString(); + public static String format(String project, String targetHttpProxy) { + return of(project, targetHttpProxy).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getTargetHttpProxy() { return targetHttpProxy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectTargetHttpProxyName parse(String formattedString) {return ProjectTargetHttpProxyName.parse(formattedString);} + public ProjectTargetHttpProxyName parse(String formattedString) { + return ProjectTargetHttpProxyName.parse(formattedString); + } }; } public static ProjectTargetHttpProxyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetHttpProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetHttpProxy") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectTargetHttpProxyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetHttpProxy")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getTargetHttpProxy() { return targetHttpProxy; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetHttpProxy(String targetHttpProxy) { this.targetHttpProxy = targetHttpProxy; return this; @@ -143,7 +128,7 @@ public Builder setTargetHttpProxy(String targetHttpProxy) { private Builder() {} - public Builder (ProjectTargetHttpProxyName projectTargetHttpProxyName) { + public Builder(ProjectTargetHttpProxyName projectTargetHttpProxyName) { project = projectTargetHttpProxyName.project; targetHttpProxy = projectTargetHttpProxyName.targetHttpProxy; } @@ -157,8 +142,7 @@ public ProjectTargetHttpProxyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "targetHttpProxy", targetHttpProxy - ); + "targetHttpProxy", targetHttpProxy); } @Override @@ -168,19 +152,14 @@ public boolean equals(Object o) { } if (o instanceof ProjectTargetHttpProxyName) { ProjectTargetHttpProxyName that = (ProjectTargetHttpProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetHttpProxy - ); + return Objects.hash(project, targetHttpProxy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java index 769dc84f32e0..d44dfb7fc890 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java @@ -17,25 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectTargetHttpsProxyName implements com.google.api.resourcenames.ResourceName { +public final class ProjectTargetHttpsProxyName implements ResourceName { private final String project; private final String targetHttpsProxy; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetHttpsProxies/{targetHttpsProxy}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/targetHttpsProxies/{targetHttpsProxy}"); private volatile Map fieldValuesMap; @@ -52,25 +49,12 @@ private ProjectTargetHttpsProxyName(Builder builder) { targetHttpsProxy = Preconditions.checkNotNull(builder.getTargetHttpsProxy()); } - public static ProjectTargetHttpsProxyName of( - String project, - String targetHttpsProxy - ) { - return newBuilder() - .setProject(project) - .setTargetHttpsProxy(targetHttpsProxy) - .build(); + public static ProjectTargetHttpsProxyName of(String project, String targetHttpsProxy) { + return newBuilder().setProject(project).setTargetHttpsProxy(targetHttpsProxy).build(); } - public static String format( - String project, - String targetHttpsProxy - ) { - return of( - project, - targetHttpsProxy - ) - .toString(); + public static String format(String project, String targetHttpsProxy) { + return of(project, targetHttpsProxy).toString(); } public String getProject() { @@ -81,7 +65,6 @@ public String getTargetHttpsProxy() { return targetHttpsProxy; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +84,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectTargetHttpsProxyName parse(String formattedString) {return ProjectTargetHttpsProxyName.parse(formattedString);} + public ProjectTargetHttpsProxyName parse(String formattedString) { + return ProjectTargetHttpsProxyName.parse(formattedString); + } }; } public static ProjectTargetHttpsProxyName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetHttpsProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetHttpsProxy") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectTargetHttpsProxyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetHttpsProxy")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +111,7 @@ public static class Builder { public String getProject() { return project; } + public String getTargetHttpsProxy() { return targetHttpsProxy; } @@ -136,6 +120,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetHttpsProxy(String targetHttpsProxy) { this.targetHttpsProxy = targetHttpsProxy; return this; @@ -143,7 +128,7 @@ public Builder setTargetHttpsProxy(String targetHttpsProxy) { private Builder() {} - public Builder (ProjectTargetHttpsProxyName projectTargetHttpsProxyName) { + public Builder(ProjectTargetHttpsProxyName projectTargetHttpsProxyName) { project = projectTargetHttpsProxyName.project; targetHttpsProxy = projectTargetHttpsProxyName.targetHttpsProxy; } @@ -157,8 +142,7 @@ public ProjectTargetHttpsProxyName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "targetHttpsProxy", targetHttpsProxy - ); + "targetHttpsProxy", targetHttpsProxy); } @Override @@ -168,19 +152,14 @@ public boolean equals(Object o) { } if (o instanceof ProjectTargetHttpsProxyName) { ProjectTargetHttpsProxyName that = (ProjectTargetHttpsProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetHttpsProxy - ); + return Objects.hash(project, targetHttpsProxy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java deleted file mode 100644 index 4faa9c9ffde5..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetSslProxyName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectTargetSslProxyName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String targetSslProxy; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetSslProxies/{targetSslProxy}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectTargetSslProxyName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - targetSslProxy = Preconditions.checkNotNull(builder.getTargetSslProxy()); - } - - public static ProjectTargetSslProxyName of( - String project, - String targetSslProxy - ) { - return newBuilder() - .setProject(project) - .setTargetSslProxy(targetSslProxy) - .build(); - } - - public static String format( - String project, - String targetSslProxy - ) { - return of( - project, - targetSslProxy - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getTargetSslProxy() { - return targetSslProxy; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("targetSslProxy", targetSslProxy); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectTargetSslProxyName parse(String formattedString) {return ProjectTargetSslProxyName.parse(formattedString);} - }; - } - - public static ProjectTargetSslProxyName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetSslProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetSslProxy") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String targetSslProxy; - - public String getProject() { - return project; - } - public String getTargetSslProxy() { - return targetSslProxy; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setTargetSslProxy(String targetSslProxy) { - this.targetSslProxy = targetSslProxy; - return this; - } - - private Builder() {} - - public Builder (ProjectTargetSslProxyName projectTargetSslProxyName) { - project = projectTargetSslProxyName.project; - targetSslProxy = projectTargetSslProxyName.targetSslProxy; - } - - public ProjectTargetSslProxyName build() { - return new ProjectTargetSslProxyName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "targetSslProxy", targetSslProxy - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectTargetSslProxyName) { - ProjectTargetSslProxyName that = (ProjectTargetSslProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - targetSslProxy - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java deleted file mode 100644 index a48c75349b47..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetTcpProxyName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class ProjectTargetTcpProxyName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String targetTcpProxy; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/targetTcpProxies/{targetTcpProxy}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectTargetTcpProxyName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - targetTcpProxy = Preconditions.checkNotNull(builder.getTargetTcpProxy()); - } - - public static ProjectTargetTcpProxyName of( - String project, - String targetTcpProxy - ) { - return newBuilder() - .setProject(project) - .setTargetTcpProxy(targetTcpProxy) - .build(); - } - - public static String format( - String project, - String targetTcpProxy - ) { - return of( - project, - targetTcpProxy - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getTargetTcpProxy() { - return targetTcpProxy; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("targetTcpProxy", targetTcpProxy); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ProjectTargetTcpProxyName parse(String formattedString) {return ProjectTargetTcpProxyName.parse(formattedString);} - }; - } - - public static ProjectTargetTcpProxyName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectTargetTcpProxyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetTcpProxy") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String targetTcpProxy; - - public String getProject() { - return project; - } - public String getTargetTcpProxy() { - return targetTcpProxy; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setTargetTcpProxy(String targetTcpProxy) { - this.targetTcpProxy = targetTcpProxy; - return this; - } - - private Builder() {} - - public Builder (ProjectTargetTcpProxyName projectTargetTcpProxyName) { - project = projectTargetTcpProxyName.project; - targetTcpProxy = projectTargetTcpProxyName.targetTcpProxy; - } - - public ProjectTargetTcpProxyName build() { - return new ProjectTargetTcpProxyName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "targetTcpProxy", targetTcpProxy - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectTargetTcpProxyName) { - ProjectTargetTcpProxyName that = (ProjectTargetTcpProxyName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - targetTcpProxy - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java index 4ccc9aade486..77961f185427 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneAcceleratorTypeName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneAcceleratorTypeName implements ResourceName { private final String acceleratorType; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectZoneAcceleratorTypeName(Builder builder) { } public static ProjectZoneAcceleratorTypeName of( - String acceleratorType, - String project, - String zone - ) { + String acceleratorType, String project, String zone) { return newBuilder() - .setAcceleratorType(acceleratorType) - .setProject(project) - .setZone(zone) - .build(); + .setAcceleratorType(acceleratorType) + .setProject(project) + .setZone(zone) + .build(); } - public static String format( - String acceleratorType, - String project, - String zone - ) { - return of( - acceleratorType, - project, - zone - ) - .toString(); + public static String format(String acceleratorType, String project, String zone) { + return of(acceleratorType, project, zone).toString(); } public String getAcceleratorType() { @@ -91,7 +76,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneAcceleratorTypeName parse(String formattedString) {return ProjectZoneAcceleratorTypeName.parse(formattedString);} + public ProjectZoneAcceleratorTypeName parse(String formattedString) { + return ProjectZoneAcceleratorTypeName.parse(formattedString); + } }; } public static ProjectZoneAcceleratorTypeName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneAcceleratorTypeName.parse: formattedString not in valid format"); - return of( - matchMap.get("acceleratorType"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneAcceleratorTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("acceleratorType"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +124,11 @@ public static class Builder { public String getAcceleratorType() { return acceleratorType; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +137,12 @@ public Builder setAcceleratorType(String acceleratorType) { this.acceleratorType = acceleratorType; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +150,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneAcceleratorTypeName projectZoneAcceleratorTypeName) { + public Builder(ProjectZoneAcceleratorTypeName projectZoneAcceleratorTypeName) { acceleratorType = projectZoneAcceleratorTypeName.acceleratorType; project = projectZoneAcceleratorTypeName.project; zone = projectZoneAcceleratorTypeName.zone; @@ -179,8 +166,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "acceleratorType", acceleratorType, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +176,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneAcceleratorTypeName) { ProjectZoneAcceleratorTypeName that = (ProjectZoneAcceleratorTypeName) o; - return - Objects.equals(this.acceleratorType, that.getAcceleratorType()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.acceleratorType, that.getAcceleratorType()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - acceleratorType, - project, - zone - ); + return Objects.hash(acceleratorType, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java index 90c9da18a057..844036b94c7b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneAutoscalerName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneAutoscalerName implements ResourceName { private final String autoscaler; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/autoscalers/{autoscaler}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectZoneAutoscalerName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneAutoscalerName of( - String autoscaler, - String project, - String zone - ) { - return newBuilder() - .setAutoscaler(autoscaler) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneAutoscalerName of(String autoscaler, String project, String zone) { + return newBuilder().setAutoscaler(autoscaler).setProject(project).setZone(zone).build(); } - public static String format( - String autoscaler, - String project, - String zone - ) { - return of( - autoscaler, - project, - zone - ) - .toString(); + public static String format(String autoscaler, String project, String zone) { + return of(autoscaler, project, zone).toString(); } public String getAutoscaler() { @@ -91,7 +71,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneAutoscalerName parse(String formattedString) {return ProjectZoneAutoscalerName.parse(formattedString);} + public ProjectZoneAutoscalerName parse(String formattedString) { + return ProjectZoneAutoscalerName.parse(formattedString); + } }; } public static ProjectZoneAutoscalerName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneAutoscalerName.parse: formattedString not in valid format"); - return of( - matchMap.get("autoscaler"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneAutoscalerName.parse: formattedString not in valid format"); + return of(matchMap.get("autoscaler"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getAutoscaler() { return autoscaler; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +132,12 @@ public Builder setAutoscaler(String autoscaler) { this.autoscaler = autoscaler; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +145,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneAutoscalerName projectZoneAutoscalerName) { + public Builder(ProjectZoneAutoscalerName projectZoneAutoscalerName) { autoscaler = projectZoneAutoscalerName.autoscaler; project = projectZoneAutoscalerName.project; zone = projectZoneAutoscalerName.zone; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "autoscaler", autoscaler, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneAutoscalerName) { ProjectZoneAutoscalerName that = (ProjectZoneAutoscalerName) o; - return - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - autoscaler, - project, - zone - ); + return Objects.hash(autoscaler, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java index 6c657f6023cf..02b80985090e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java @@ -17,26 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneDiskName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneDiskName implements ResourceName { + private final String disk; private final String project; - private final String resource; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{disk}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{disk}"); private volatile Map fieldValuesMap; @@ -49,57 +45,39 @@ public Builder toBuilder() { } private ProjectZoneDiskName(Builder builder) { + disk = Preconditions.checkNotNull(builder.getDisk()); project = Preconditions.checkNotNull(builder.getProject()); - resource = Preconditions.checkNotNull(builder.getResource()); zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneDiskName of( - String project, - String resource, - String zone - ) { - return newBuilder() - .setProject(project) - .setResource(resource) - .setZone(zone) - .build(); + public static ProjectZoneDiskName of(String disk, String project, String zone) { + return newBuilder().setDisk(disk).setProject(project).setZone(zone).build(); } - public static String format( - String project, - String resource, - String zone - ) { - return of( - project, - resource, - zone - ) - .toString(); + public static String format(String disk, String project, String zone) { + return of(disk, project, zone).toString(); } - public String getProject() { - return project; + public String getDisk() { + return disk; } - public String getResource() { - return resource; + public String getProject() { + return project; } public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("disk", disk); fieldMapBuilder.put("project", project); - fieldMapBuilder.put("resource", resource); fieldMapBuilder.put("zone", zone); fieldValuesMap = fieldMapBuilder.build(); } @@ -112,21 +90,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneDiskName parse(String formattedString) {return ProjectZoneDiskName.parse(formattedString);} + public ProjectZoneDiskName parse(String formattedString) { + return ProjectZoneDiskName.parse(formattedString); + } }; } public static ProjectZoneDiskName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneDiskName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("resource"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneDiskName.parse: formattedString not in valid format"); + return of(matchMap.get("disk"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -134,28 +110,32 @@ public static boolean isParsableFrom(String formattedString) { } public static class Builder { + private String disk; private String project; - private String resource; private String zone; + public String getDisk() { + return disk; + } + public String getProject() { return project; } - public String getResource() { - return resource; - } + public String getZone() { return zone; } - public Builder setProject(String project) { - this.project = project; + public Builder setDisk(String disk) { + this.disk = disk; return this; } - public Builder setResource(String resource) { - this.resource = resource; + + public Builder setProject(String project) { + this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,9 +143,9 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneDiskName projectZoneDiskName) { + public Builder(ProjectZoneDiskName projectZoneDiskName) { + disk = projectZoneDiskName.disk; project = projectZoneDiskName.project; - resource = projectZoneDiskName.resource; zone = projectZoneDiskName.zone; } @@ -177,10 +157,9 @@ public ProjectZoneDiskName build() { @Override public String toString() { return PATH_TEMPLATE.instantiate( + "disk", disk, "project", project, - "resource", resource, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +169,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneDiskName) { ProjectZoneDiskName that = (ProjectZoneDiskName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.resource, that.getResource()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - resource, - zone - ); + return Objects.hash(disk, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java similarity index 64% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java index a81896038ca6..6f359423c07b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java @@ -17,26 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ResourceName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneDiskResourceName implements ResourceName { private final String project; private final String resource; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{resource}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/disks/{resource}"); private volatile Map fieldValuesMap; @@ -48,35 +44,18 @@ public Builder toBuilder() { return new Builder(this); } - private ResourceName(Builder builder) { + private ProjectZoneDiskResourceName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); resource = Preconditions.checkNotNull(builder.getResource()); zone = Preconditions.checkNotNull(builder.getZone()); } - public static ResourceName of( - String project, - String resource, - String zone - ) { - return newBuilder() - .setProject(project) - .setResource(resource) - .setZone(zone) - .build(); + public static ProjectZoneDiskResourceName of(String project, String resource, String zone) { + return newBuilder().setProject(project).setResource(resource).setZone(zone).build(); } - public static String format( - String project, - String resource, - String zone - ) { - return of( - project, - resource, - zone - ) - .toString(); + public static String format(String project, String resource, String zone) { + return of(project, resource, zone).toString(); } public String getProject() { @@ -91,7 +70,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +90,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public ResourceName parse(String formattedString) {return ResourceName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectZoneDiskResourceName parse(String formattedString) { + return ProjectZoneDiskResourceName.parse(formattedString); + } }; } - public static ResourceName parse(String formattedString) { + public static ProjectZoneDiskResourceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ResourceName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("resource"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneDiskResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +118,11 @@ public static class Builder { public String getProject() { return project; } + public String getResource() { return resource; } + public String getZone() { return zone; } @@ -152,10 +131,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setResource(String resource) { this.resource = resource; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,14 +144,14 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ResourceName resourceName) { - project = resourceName.project; - resource = resourceName.resource; - zone = resourceName.zone; + public Builder(ProjectZoneDiskResourceName projectZoneDiskResourceName) { + project = projectZoneDiskResourceName.project; + resource = projectZoneDiskResourceName.resource; + zone = projectZoneDiskResourceName.zone; } - public ResourceName build() { - return new ResourceName(this); + public ProjectZoneDiskResourceName build() { + return new ProjectZoneDiskResourceName(this); } } @@ -179,8 +160,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "resource", resource, - "zone", zone - ); + "zone", zone); } @Override @@ -188,23 +168,17 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ResourceName) { - ResourceName that = (ResourceName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.resource, that.getResource()) && - Objects.equals(this.zone, that.getZone()) - ; + if (o instanceof ProjectZoneDiskResourceName) { + ProjectZoneDiskResourceName that = (ProjectZoneDiskResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - resource, - zone - ); + return Objects.hash(project, resource, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java index bbb69f01e882..d230dd0b4f1a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java @@ -17,26 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneDiskTypeName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneDiskTypeName implements ResourceName { private final String diskType; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/diskTypes/{diskType}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/diskTypes/{diskType}"); private volatile Map fieldValuesMap; @@ -54,29 +50,12 @@ private ProjectZoneDiskTypeName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneDiskTypeName of( - String diskType, - String project, - String zone - ) { - return newBuilder() - .setDiskType(diskType) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneDiskTypeName of(String diskType, String project, String zone) { + return newBuilder().setDiskType(diskType).setProject(project).setZone(zone).build(); } - public static String format( - String diskType, - String project, - String zone - ) { - return of( - diskType, - project, - zone - ) - .toString(); + public static String format(String diskType, String project, String zone) { + return of(diskType, project, zone).toString(); } public String getDiskType() { @@ -91,7 +70,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +90,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneDiskTypeName parse(String formattedString) {return ProjectZoneDiskTypeName.parse(formattedString);} + public ProjectZoneDiskTypeName parse(String formattedString) { + return ProjectZoneDiskTypeName.parse(formattedString); + } }; } public static ProjectZoneDiskTypeName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneDiskTypeName.parse: formattedString not in valid format"); - return of( - matchMap.get("diskType"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneDiskTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("diskType"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +117,11 @@ public static class Builder { public String getDiskType() { return diskType; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +130,12 @@ public Builder setDiskType(String diskType) { this.diskType = diskType; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +143,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneDiskTypeName projectZoneDiskTypeName) { + public Builder(ProjectZoneDiskTypeName projectZoneDiskTypeName) { diskType = projectZoneDiskTypeName.diskType; project = projectZoneDiskTypeName.project; zone = projectZoneDiskTypeName.zone; @@ -179,8 +159,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "diskType", diskType, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +169,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneDiskTypeName) { ProjectZoneDiskTypeName that = (ProjectZoneDiskTypeName) o; - return - Objects.equals(this.diskType, that.getDiskType()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.diskType, that.getDiskType()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - diskType, - project, - zone - ); + return Objects.hash(diskType, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java index 3fffc6dcd292..51be0e7b6809 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneInstanceGroupManagerName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneInstanceGroupManagerName implements ResourceName { private final String instanceGroupManager; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"); private volatile Map fieldValuesMap; @@ -55,28 +52,16 @@ private ProjectZoneInstanceGroupManagerName(Builder builder) { } public static ProjectZoneInstanceGroupManagerName of( - String instanceGroupManager, - String project, - String zone - ) { + String instanceGroupManager, String project, String zone) { return newBuilder() - .setInstanceGroupManager(instanceGroupManager) - .setProject(project) - .setZone(zone) - .build(); + .setInstanceGroupManager(instanceGroupManager) + .setProject(project) + .setZone(zone) + .build(); } - public static String format( - String instanceGroupManager, - String project, - String zone - ) { - return of( - instanceGroupManager, - project, - zone - ) - .toString(); + public static String format(String instanceGroupManager, String project, String zone) { + return of(instanceGroupManager, project, zone).toString(); } public String getInstanceGroupManager() { @@ -91,7 +76,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +96,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneInstanceGroupManagerName parse(String formattedString) {return ProjectZoneInstanceGroupManagerName.parse(formattedString);} + public ProjectZoneInstanceGroupManagerName parse(String formattedString) { + return ProjectZoneInstanceGroupManagerName.parse(formattedString); + } }; } public static ProjectZoneInstanceGroupManagerName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceGroupManagerName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceGroupManager"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneInstanceGroupManagerName.parse: formattedString not in valid format"); + return of(matchMap.get("instanceGroupManager"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +124,11 @@ public static class Builder { public String getInstanceGroupManager() { return instanceGroupManager; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +137,12 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { this.instanceGroupManager = instanceGroupManager; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +150,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneInstanceGroupManagerName projectZoneInstanceGroupManagerName) { + public Builder(ProjectZoneInstanceGroupManagerName projectZoneInstanceGroupManagerName) { instanceGroupManager = projectZoneInstanceGroupManagerName.instanceGroupManager; project = projectZoneInstanceGroupManagerName.project; zone = projectZoneInstanceGroupManagerName.zone; @@ -179,8 +166,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "instanceGroupManager", instanceGroupManager, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +176,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneInstanceGroupManagerName) { ProjectZoneInstanceGroupManagerName that = (ProjectZoneInstanceGroupManagerName) o; - return - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceGroupManager, - project, - zone - ); + return Objects.hash(instanceGroupManager, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java index dc9ce3422830..9a6fea50f40f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneInstanceGroupName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneInstanceGroupName implements ResourceName { private final String instanceGroup; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectZoneInstanceGroupName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneInstanceGroupName of( - String instanceGroup, - String project, - String zone - ) { - return newBuilder() - .setInstanceGroup(instanceGroup) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneInstanceGroupName of(String instanceGroup, String project, String zone) { + return newBuilder().setInstanceGroup(instanceGroup).setProject(project).setZone(zone).build(); } - public static String format( - String instanceGroup, - String project, - String zone - ) { - return of( - instanceGroup, - project, - zone - ) - .toString(); + public static String format(String instanceGroup, String project, String zone) { + return of(instanceGroup, project, zone).toString(); } public String getInstanceGroup() { @@ -91,7 +71,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneInstanceGroupName parse(String formattedString) {return ProjectZoneInstanceGroupName.parse(formattedString);} + public ProjectZoneInstanceGroupName parse(String formattedString) { + return ProjectZoneInstanceGroupName.parse(formattedString); + } }; } public static ProjectZoneInstanceGroupName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceGroupName.parse: formattedString not in valid format"); - return of( - matchMap.get("instanceGroup"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneInstanceGroupName.parse: formattedString not in valid format"); + return of(matchMap.get("instanceGroup"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getInstanceGroup() { return instanceGroup; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +132,12 @@ public Builder setInstanceGroup(String instanceGroup) { this.instanceGroup = instanceGroup; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +145,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneInstanceGroupName projectZoneInstanceGroupName) { + public Builder(ProjectZoneInstanceGroupName projectZoneInstanceGroupName) { instanceGroup = projectZoneInstanceGroupName.instanceGroup; project = projectZoneInstanceGroupName.project; zone = projectZoneInstanceGroupName.zone; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "instanceGroup", instanceGroup, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneInstanceGroupName) { ProjectZoneInstanceGroupName that = (ProjectZoneInstanceGroupName) o; - return - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceGroup, - project, - zone - ); + return Objects.hash(instanceGroup, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java index 8fee586088fa..4fca6509e6b3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java @@ -17,26 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneInstanceName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneInstanceName implements ResourceName { private final String instance; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}"); private volatile Map fieldValuesMap; @@ -54,29 +50,12 @@ private ProjectZoneInstanceName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneInstanceName of( - String instance, - String project, - String zone - ) { - return newBuilder() - .setInstance(instance) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneInstanceName of(String instance, String project, String zone) { + return newBuilder().setInstance(instance).setProject(project).setZone(zone).build(); } - public static String format( - String instance, - String project, - String zone - ) { - return of( - instance, - project, - zone - ) - .toString(); + public static String format(String instance, String project, String zone) { + return of(instance, project, zone).toString(); } public String getInstance() { @@ -91,7 +70,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +90,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneInstanceName parse(String formattedString) {return ProjectZoneInstanceName.parse(formattedString);} + public ProjectZoneInstanceName parse(String formattedString) { + return ProjectZoneInstanceName.parse(formattedString); + } }; } public static ProjectZoneInstanceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneInstanceName.parse: formattedString not in valid format"); - return of( - matchMap.get("instance"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneInstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("instance"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +117,11 @@ public static class Builder { public String getInstance() { return instance; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +130,12 @@ public Builder setInstance(String instance) { this.instance = instance; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +143,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneInstanceName projectZoneInstanceName) { + public Builder(ProjectZoneInstanceName projectZoneInstanceName) { instance = projectZoneInstanceName.instance; project = projectZoneInstanceName.project; zone = projectZoneInstanceName.zone; @@ -179,8 +159,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "instance", instance, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +169,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneInstanceName) { ProjectZoneInstanceName that = (ProjectZoneInstanceName) o; - return - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - instance, - project, - zone - ); + return Objects.hash(instance, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java similarity index 55% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java index 238e7f2dba1a..1d449695937d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java @@ -17,26 +17,22 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class DiskTypeName implements com.google.api.resourcenames.ResourceName { - private final String diskType; +public final class ProjectZoneInstanceResourceName implements ResourceName { private final String project; + private final String resource; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/diskTypes/{diskType}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{resource}"); private volatile Map fieldValuesMap; @@ -48,58 +44,40 @@ public Builder toBuilder() { return new Builder(this); } - private DiskTypeName(Builder builder) { - diskType = Preconditions.checkNotNull(builder.getDiskType()); + private ProjectZoneInstanceResourceName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); + resource = Preconditions.checkNotNull(builder.getResource()); zone = Preconditions.checkNotNull(builder.getZone()); } - public static DiskTypeName of( - String diskType, - String project, - String zone - ) { - return newBuilder() - .setDiskType(diskType) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneInstanceResourceName of(String project, String resource, String zone) { + return newBuilder().setProject(project).setResource(resource).setZone(zone).build(); } - public static String format( - String diskType, - String project, - String zone - ) { - return of( - diskType, - project, - zone - ) - .toString(); - } - - public String getDiskType() { - return diskType; + public static String format(String project, String resource, String zone) { + return of(project, resource, zone).toString(); } public String getProject() { return project; } + public String getResource() { + return resource; + } + public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("diskType", diskType); fieldMapBuilder.put("project", project); + fieldMapBuilder.put("resource", resource); fieldMapBuilder.put("zone", zone); fieldValuesMap = fieldMapBuilder.build(); } @@ -112,21 +90,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public DiskTypeName parse(String formattedString) {return DiskTypeName.parse(formattedString);} + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectZoneInstanceResourceName parse(String formattedString) { + return ProjectZoneInstanceResourceName.parse(formattedString); + } }; } - public static DiskTypeName parse(String formattedString) { + public static ProjectZoneInstanceResourceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "DiskTypeName.parse: formattedString not in valid format"); - return of( - matchMap.get("diskType"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneInstanceResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -134,28 +111,32 @@ public static boolean isParsableFrom(String formattedString) { } public static class Builder { - private String diskType; private String project; + private String resource; private String zone; - public String getDiskType() { - return diskType; - } public String getProject() { return project; } + + public String getResource() { + return resource; + } + public String getZone() { return zone; } - public Builder setDiskType(String diskType) { - this.diskType = diskType; - return this; - } public Builder setProject(String project) { this.project = project; return this; } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,24 +144,23 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (DiskTypeName diskTypeName) { - diskType = diskTypeName.diskType; - project = diskTypeName.project; - zone = diskTypeName.zone; + public Builder(ProjectZoneInstanceResourceName projectZoneInstanceResourceName) { + project = projectZoneInstanceResourceName.project; + resource = projectZoneInstanceResourceName.resource; + zone = projectZoneInstanceResourceName.zone; } - public DiskTypeName build() { - return new DiskTypeName(this); + public ProjectZoneInstanceResourceName build() { + return new ProjectZoneInstanceResourceName(this); } } @Override public String toString() { return PATH_TEMPLATE.instantiate( - "diskType", diskType, "project", project, - "zone", zone - ); + "resource", resource, + "zone", zone); } @Override @@ -188,23 +168,17 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof DiskTypeName) { - DiskTypeName that = (DiskTypeName) o; - return - Objects.equals(this.diskType, that.getDiskType()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + if (o instanceof ProjectZoneInstanceResourceName) { + ProjectZoneInstanceResourceName that = (ProjectZoneInstanceResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - diskType, - project, - zone - ); + return Objects.hash(project, resource, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java index 363cd6c2caaa..12c3210fc2dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneMachineTypeName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneMachineTypeName implements ResourceName { private final String machineType; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/machineTypes/{machineType}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/machineTypes/{machineType}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectZoneMachineTypeName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneMachineTypeName of( - String machineType, - String project, - String zone - ) { - return newBuilder() - .setMachineType(machineType) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneMachineTypeName of(String machineType, String project, String zone) { + return newBuilder().setMachineType(machineType).setProject(project).setZone(zone).build(); } - public static String format( - String machineType, - String project, - String zone - ) { - return of( - machineType, - project, - zone - ) - .toString(); + public static String format(String machineType, String project, String zone) { + return of(machineType, project, zone).toString(); } public String getMachineType() { @@ -91,7 +71,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneMachineTypeName parse(String formattedString) {return ProjectZoneMachineTypeName.parse(formattedString);} + public ProjectZoneMachineTypeName parse(String formattedString) { + return ProjectZoneMachineTypeName.parse(formattedString); + } }; } public static ProjectZoneMachineTypeName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneMachineTypeName.parse: formattedString not in valid format"); - return of( - matchMap.get("machineType"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneMachineTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("machineType"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +119,11 @@ public static class Builder { public String getMachineType() { return machineType; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +132,12 @@ public Builder setMachineType(String machineType) { this.machineType = machineType; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +145,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneMachineTypeName projectZoneMachineTypeName) { + public Builder(ProjectZoneMachineTypeName projectZoneMachineTypeName) { machineType = projectZoneMachineTypeName.machineType; project = projectZoneMachineTypeName.project; zone = projectZoneMachineTypeName.zone; @@ -179,8 +161,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "machineType", machineType, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +171,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneMachineTypeName) { ProjectZoneMachineTypeName that = (ProjectZoneMachineTypeName) o; - return - Objects.equals(this.machineType, that.getMachineType()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.machineType, that.getMachineType()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - machineType, - project, - zone - ); + return Objects.hash(machineType, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java index 9af1dc6772e4..ee24baa1290b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneName implements ResourceName { private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}"); + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}"); private volatile Map fieldValuesMap; @@ -52,25 +48,12 @@ private ProjectZoneName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneName of( - String project, - String zone - ) { - return newBuilder() - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneName of(String project, String zone) { + return newBuilder().setProject(project).setZone(zone).build(); } - public static String format( - String project, - String zone - ) { - return of( - project, - zone - ) - .toString(); + public static String format(String project, String zone) { + return of(project, zone).toString(); } public String getProject() { @@ -81,7 +64,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -101,20 +83,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneName parse(String formattedString) {return ProjectZoneName.parse(formattedString);} + public ProjectZoneName parse(String formattedString) { + return ProjectZoneName.parse(formattedString); + } }; } public static ProjectZoneName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -128,6 +109,7 @@ public static class Builder { public String getProject() { return project; } + public String getZone() { return zone; } @@ -136,6 +118,7 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -143,7 +126,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneName projectZoneName) { + public Builder(ProjectZoneName projectZoneName) { project = projectZoneName.project; zone = projectZoneName.zone; } @@ -157,8 +140,7 @@ public ProjectZoneName build() { public String toString() { return PATH_TEMPLATE.instantiate( "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -168,19 +150,14 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneName) { ProjectZoneName that = (ProjectZoneName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - zone - ); + return Objects.hash(project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java index b5806a9f39f3..e74c23d3e1a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneOperationName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneOperationName implements ResourceName { private final String operation; private final String project; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/operations/{operation}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/operations/{operation}"); private volatile Map fieldValuesMap; @@ -54,29 +51,12 @@ private ProjectZoneOperationName(Builder builder) { zone = Preconditions.checkNotNull(builder.getZone()); } - public static ProjectZoneOperationName of( - String operation, - String project, - String zone - ) { - return newBuilder() - .setOperation(operation) - .setProject(project) - .setZone(zone) - .build(); + public static ProjectZoneOperationName of(String operation, String project, String zone) { + return newBuilder().setOperation(operation).setProject(project).setZone(zone).build(); } - public static String format( - String operation, - String project, - String zone - ) { - return of( - operation, - project, - zone - ) - .toString(); + public static String format(String operation, String project, String zone) { + return of(operation, project, zone).toString(); } public String getOperation() { @@ -91,7 +71,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +91,19 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneOperationName parse(String formattedString) {return ProjectZoneOperationName.parse(formattedString);} + public ProjectZoneOperationName parse(String formattedString) { + return ProjectZoneOperationName.parse(formattedString); + } }; } public static ProjectZoneOperationName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneOperationName.parse: formattedString not in valid format"); - return of( - matchMap.get("operation"), - matchMap.get("project"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneOperationName.parse: formattedString not in valid format"); + return of(matchMap.get("operation"), matchMap.get("project"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +118,11 @@ public static class Builder { public String getOperation() { return operation; } + public String getProject() { return project; } + public String getZone() { return zone; } @@ -152,10 +131,12 @@ public Builder setOperation(String operation) { this.operation = operation; return this; } + public Builder setProject(String project) { this.project = project; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +144,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneOperationName projectZoneOperationName) { + public Builder(ProjectZoneOperationName projectZoneOperationName) { operation = projectZoneOperationName.operation; project = projectZoneOperationName.project; zone = projectZoneOperationName.zone; @@ -179,8 +160,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "operation", operation, "project", project, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +170,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneOperationName) { ProjectZoneOperationName that = (ProjectZoneOperationName) o; - return - Objects.equals(this.operation, that.getOperation()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.operation, that.getOperation()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - operation, - project, - zone - ); + return Objects.hash(operation, project, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java index 8b679e520ffc..29ec279246f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java @@ -17,26 +17,23 @@ import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.api.resourcenames.ResourceNameFactory; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; @Generated("by GAPIC") @BetaApi -public final class ProjectZoneTargetInstanceName implements com.google.api.resourcenames.ResourceName { +public final class ProjectZoneTargetInstanceName implements ResourceName { private final String project; private final String targetInstance; private final String zone; private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/targetInstances/{targetInstance}"); + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/targetInstances/{targetInstance}"); private volatile Map fieldValuesMap; @@ -55,28 +52,12 @@ private ProjectZoneTargetInstanceName(Builder builder) { } public static ProjectZoneTargetInstanceName of( - String project, - String targetInstance, - String zone - ) { - return newBuilder() - .setProject(project) - .setTargetInstance(targetInstance) - .setZone(zone) - .build(); - } - - public static String format( - String project, - String targetInstance, - String zone - ) { - return of( - project, - targetInstance, - zone - ) - .toString(); + String project, String targetInstance, String zone) { + return newBuilder().setProject(project).setTargetInstance(targetInstance).setZone(zone).build(); + } + + public static String format(String project, String targetInstance, String zone) { + return of(project, targetInstance, zone).toString(); } public String getProject() { @@ -91,7 +72,6 @@ public String getZone() { return zone; } - @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { @@ -112,21 +92,20 @@ public String getFieldValue(String fieldName) { return getFieldValuesMap().get(fieldName); } - public static ResourceNameFactory newFactory() { return new ResourceNameFactory() { - public ProjectZoneTargetInstanceName parse(String formattedString) {return ProjectZoneTargetInstanceName.parse(formattedString);} + public ProjectZoneTargetInstanceName parse(String formattedString) { + return ProjectZoneTargetInstanceName.parse(formattedString); + } }; } public static ProjectZoneTargetInstanceName parse(String formattedString) { Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "ProjectZoneTargetInstanceName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetInstance"), - matchMap.get("zone") - ); + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneTargetInstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("targetInstance"), matchMap.get("zone")); } public static boolean isParsableFrom(String formattedString) { @@ -141,9 +120,11 @@ public static class Builder { public String getProject() { return project; } + public String getTargetInstance() { return targetInstance; } + public String getZone() { return zone; } @@ -152,10 +133,12 @@ public Builder setProject(String project) { this.project = project; return this; } + public Builder setTargetInstance(String targetInstance) { this.targetInstance = targetInstance; return this; } + public Builder setZone(String zone) { this.zone = zone; return this; @@ -163,7 +146,7 @@ public Builder setZone(String zone) { private Builder() {} - public Builder (ProjectZoneTargetInstanceName projectZoneTargetInstanceName) { + public Builder(ProjectZoneTargetInstanceName projectZoneTargetInstanceName) { project = projectZoneTargetInstanceName.project; targetInstance = projectZoneTargetInstanceName.targetInstance; zone = projectZoneTargetInstanceName.zone; @@ -179,8 +162,7 @@ public String toString() { return PATH_TEMPLATE.instantiate( "project", project, "targetInstance", targetInstance, - "zone", zone - ); + "zone", zone); } @Override @@ -190,21 +172,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectZoneTargetInstanceName) { ProjectZoneTargetInstanceName that = (ProjectZoneTargetInstanceName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetInstance, that.getTargetInstance()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.targetInstance, that.getTargetInstance()) + && Objects.equals(this.zone, that.getZone()); } return false; } @Override public int hashCode() { - return Objects.hash( - project, - targetInstance, - zone - ); + return Objects.hash(project, targetInstance, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java index 462b436ba3ac..2d2681b02469 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ProjectsDisableXpnResourceRequest() { this.xpnResource = null; } - - private ProjectsDisableXpnResourceRequest( - XpnResourceId xpnResource - ) { + private ProjectsDisableXpnResourceRequest(XpnResourceId xpnResource) { this.xpnResource = xpnResource; } @@ -72,22 +66,24 @@ public XpnResourceId getXpnResource() { return xpnResource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ProjectsDisableXpnResourceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ProjectsDisableXpnResourceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ProjectsDisableXpnResourceRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ProjectsDisableXpnResourceRequest(); } @@ -118,11 +114,8 @@ public Builder setXpnResource(XpnResourceId xpnResource) { return this; } - public ProjectsDisableXpnResourceRequest build() { - return new ProjectsDisableXpnResourceRequest( - xpnResource - ); + return new ProjectsDisableXpnResourceRequest(xpnResource); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "ProjectsDisableXpnResourceRequest{" - + "xpnResource=" + xpnResource - + "}"; + return "ProjectsDisableXpnResourceRequest{" + "xpnResource=" + xpnResource + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof ProjectsDisableXpnResourceRequest) { ProjectsDisableXpnResourceRequest that = (ProjectsDisableXpnResourceRequest) o; - return - Objects.equals(this.xpnResource, that.getXpnResource()) - ; + return Objects.equals(this.xpnResource, that.getXpnResource()); } return false; } @Override public int hashCode() { - return Objects.hash( - xpnResource - ); + return Objects.hash(xpnResource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java index e3ef7fb9e333..93d202170c86 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ProjectsEnableXpnResourceRequest() { this.xpnResource = null; } - - private ProjectsEnableXpnResourceRequest( - XpnResourceId xpnResource - ) { + private ProjectsEnableXpnResourceRequest(XpnResourceId xpnResource) { this.xpnResource = xpnResource; } @@ -72,22 +66,24 @@ public XpnResourceId getXpnResource() { return xpnResource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ProjectsEnableXpnResourceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ProjectsEnableXpnResourceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ProjectsEnableXpnResourceRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ProjectsEnableXpnResourceRequest(); } @@ -118,11 +114,8 @@ public Builder setXpnResource(XpnResourceId xpnResource) { return this; } - public ProjectsEnableXpnResourceRequest build() { - return new ProjectsEnableXpnResourceRequest( - xpnResource - ); + return new ProjectsEnableXpnResourceRequest(xpnResource); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "ProjectsEnableXpnResourceRequest{" - + "xpnResource=" + xpnResource - + "}"; + return "ProjectsEnableXpnResourceRequest{" + "xpnResource=" + xpnResource + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof ProjectsEnableXpnResourceRequest) { ProjectsEnableXpnResourceRequest that = (ProjectsEnableXpnResourceRequest) o; - return - Objects.equals(this.xpnResource, that.getXpnResource()) - ; + return Objects.equals(this.xpnResource, that.getXpnResource()); } return false; } @Override public int hashCode() { - return Objects.hash( - xpnResource - ); + return Objects.hash(xpnResource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java index 86042210efea..03735a00d02e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,12 +41,8 @@ private ProjectsGetXpnResources() { this.resources = null; } - private ProjectsGetXpnResources( - String kind, - String nextPageToken, - List resources - ) { + String kind, String nextPageToken, List resources) { this.kind = kind; this.nextPageToken = nextPageToken; this.resources = resources; @@ -104,22 +99,24 @@ public List getResourcesList() { return resources; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ProjectsGetXpnResources prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ProjectsGetXpnResources getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ProjectsGetXpnResources DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ProjectsGetXpnResources(); } @@ -186,15 +183,9 @@ public Builder addResources(XpnResourceId resources) { return this; } - public ProjectsGetXpnResources build() { - - return new ProjectsGetXpnResources( - kind, - nextPageToken, - resources - ); + return new ProjectsGetXpnResources(kind, nextPageToken, resources); } public Builder clone() { @@ -209,9 +200,14 @@ public Builder clone() { @Override public String toString() { return "ProjectsGetXpnResources{" - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "resources=" + resources + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "resources=" + + resources + "}"; } @@ -222,21 +218,15 @@ public boolean equals(Object o) { } if (o instanceof ProjectsGetXpnResources) { ProjectsGetXpnResources that = (ProjectsGetXpnResources) o; - return - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.resources, that.getResourcesList()) - ; + return Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.resources, that.getResourcesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - kind, - nextPageToken, - resources - ); + return Objects.hash(kind, nextPageToken, resources); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java index 92110fd0fe48..15a07bb7ad48 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ProjectsListXpnHostsRequest() { this.organization = null; } - - private ProjectsListXpnHostsRequest( - String organization - ) { + private ProjectsListXpnHostsRequest(String organization) { this.organization = organization; } @@ -72,22 +66,24 @@ public String getOrganization() { return organization; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ProjectsListXpnHostsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ProjectsListXpnHostsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ProjectsListXpnHostsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ProjectsListXpnHostsRequest(); } @@ -118,11 +114,8 @@ public Builder setOrganization(String organization) { return this; } - public ProjectsListXpnHostsRequest build() { - return new ProjectsListXpnHostsRequest( - organization - ); + return new ProjectsListXpnHostsRequest(organization); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "ProjectsListXpnHostsRequest{" - + "organization=" + organization - + "}"; + return "ProjectsListXpnHostsRequest{" + "organization=" + organization + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof ProjectsListXpnHostsRequest) { ProjectsListXpnHostsRequest that = (ProjectsListXpnHostsRequest) o; - return - Objects.equals(this.organization, that.getOrganization()) - ; + return Objects.equals(this.organization, that.getOrganization()); } return false; } @Override public int hashCode() { - return Objects.hash( - organization - ); + return Objects.hash(organization); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java index 00eff7049361..bec535da0955 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private Quota() { this.usage = null; } - - private Quota( - Double limit, - String metric, - Double usage - ) { + private Quota(Double limit, String metric, Double usage) { this.limit = limit; this.metric = metric; this.usage = usage; @@ -100,22 +92,24 @@ public Double getUsage() { return usage; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Quota prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Quota getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Quota DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Quota(); } @@ -174,15 +168,9 @@ public Builder setUsage(Double usage) { return this; } - public Quota build() { - - return new Quota( - limit, - metric, - usage - ); + return new Quota(limit, metric, usage); } public Builder clone() { @@ -196,11 +184,7 @@ public Builder clone() { @Override public String toString() { - return "Quota{" - + "limit=" + limit + ", " - + "metric=" + metric + ", " - + "usage=" + usage - + "}"; + return "Quota{" + "limit=" + limit + ", " + "metric=" + metric + ", " + "usage=" + usage + "}"; } @Override @@ -210,21 +194,15 @@ public boolean equals(Object o) { } if (o instanceof Quota) { Quota that = (Quota) o; - return - Objects.equals(this.limit, that.getLimit()) && - Objects.equals(this.metric, that.getMetric()) && - Objects.equals(this.usage, that.getUsage()) - ; + return Objects.equals(this.limit, that.getLimit()) + && Objects.equals(this.metric, that.getMetric()) + && Objects.equals(this.usage, that.getUsage()); } return false; } @Override public int hashCode() { - return Objects.hash( - limit, - metric, - usage - ); + return Objects.hash(limit, metric, usage); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java index 6aca6b7df6c0..f40843794cd0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private RawDisk() { this.source = null; } - - private RawDisk( - String containerType, - String sha1Checksum, - String source - ) { + private RawDisk(String containerType, String sha1Checksum, String source) { this.containerType = containerType; this.sha1Checksum = sha1Checksum; this.source = source; @@ -100,22 +92,24 @@ public String getSource() { return source; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RawDisk prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RawDisk getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RawDisk DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RawDisk(); } @@ -174,15 +168,9 @@ public Builder setSource(String source) { return this; } - public RawDisk build() { - - return new RawDisk( - containerType, - sha1Checksum, - source - ); + return new RawDisk(containerType, sha1Checksum, source); } public Builder clone() { @@ -197,9 +185,14 @@ public Builder clone() { @Override public String toString() { return "RawDisk{" - + "containerType=" + containerType + ", " - + "sha1Checksum=" + sha1Checksum + ", " - + "source=" + source + + "containerType=" + + containerType + + ", " + + "sha1Checksum=" + + sha1Checksum + + ", " + + "source=" + + source + "}"; } @@ -210,21 +203,15 @@ public boolean equals(Object o) { } if (o instanceof RawDisk) { RawDisk that = (RawDisk) o; - return - Objects.equals(this.containerType, that.getContainerType()) && - Objects.equals(this.sha1Checksum, that.getSha1Checksum()) && - Objects.equals(this.source, that.getSource()) - ; + return Objects.equals(this.containerType, that.getContainerType()) + && Objects.equals(this.sha1Checksum, that.getSha1Checksum()) + && Objects.equals(this.source, that.getSource()); } return false; } @Override public int hashCode() { - return Objects.hash( - containerType, - sha1Checksum, - source - ); + return Objects.hash(containerType, sha1Checksum, source); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java index 6de0f978c844..fa3fa9b56115 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,7 +33,8 @@ public final class RecreateInstancesInstanceGroupManagerHttpRequest implements A private final String callback; private final String fields; private final String instanceGroupManager; - private final InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource; + private final InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -56,24 +54,24 @@ private RecreateInstancesInstanceGroupManagerHttpRequest() { this.userIp = null; } - private RecreateInstancesInstanceGroupManagerHttpRequest( String access_token, String callback, String fields, String instanceGroupManager, - InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource, String key, String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instanceGroupManager = instanceGroupManager; - this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource; + this.instanceGroupManagersRecreateInstancesRequestResource = + instanceGroupManagersRecreateInstancesRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -94,10 +92,15 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } - if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") && instanceGroupManagersRecreateInstancesRequestResource != null) { - fieldMap.put("instanceGroupManagersRecreateInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); + if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") + && instanceGroupManagersRecreateInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupManagersRecreateInstancesRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -174,7 +177,8 @@ public String getInstanceGroupManager() { return instanceGroupManager; } - public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() { + public InstanceGroupManagersRecreateInstancesRequest + getInstanceGroupManagersRecreateInstancesRequestResource() { return instanceGroupManagersRecreateInstancesRequestResource; } @@ -198,22 +202,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RecreateInstancesInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RecreateInstancesInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RecreateInstancesInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RecreateInstancesInstanceGroupManagerHttpRequest(); } @@ -223,7 +229,8 @@ public static class Builder { private String callback; private String fields; private String instanceGroupManager; - private InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource; + private InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource; private String key; private String prettyPrint; private String quotaUser; @@ -233,7 +240,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) { - if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -247,7 +255,8 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) this.instanceGroupManager = other.instanceGroupManager; } if (other.getInstanceGroupManagersRecreateInstancesRequestResource() != null) { - this.instanceGroupManagersRecreateInstancesRequestResource = other.instanceGroupManagersRecreateInstancesRequestResource; + this.instanceGroupManagersRecreateInstancesRequestResource = + other.instanceGroupManagersRecreateInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +281,8 @@ public Builder mergeFrom(RecreateInstancesInstanceGroupManagerHttpRequest other) this.callback = source.callback; this.fields = source.fields; this.instanceGroupManager = source.instanceGroupManager; - this.instanceGroupManagersRecreateInstancesRequestResource = source.instanceGroupManagersRecreateInstancesRequestResource; + this.instanceGroupManagersRecreateInstancesRequestResource = + source.instanceGroupManagersRecreateInstancesRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -316,12 +326,16 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { return this; } - public InstanceGroupManagersRecreateInstancesRequest getInstanceGroupManagersRecreateInstancesRequestResource() { + public InstanceGroupManagersRecreateInstancesRequest + getInstanceGroupManagersRecreateInstancesRequestResource() { return instanceGroupManagersRecreateInstancesRequestResource; } - public Builder setInstanceGroupManagersRecreateInstancesRequestResource(InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { - this.instanceGroupManagersRecreateInstancesRequestResource = instanceGroupManagersRecreateInstancesRequestResource; + public Builder setInstanceGroupManagersRecreateInstancesRequestResource( + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource) { + this.instanceGroupManagersRecreateInstancesRequestResource = + instanceGroupManagersRecreateInstancesRequestResource; return this; } @@ -370,36 +384,27 @@ public Builder setUserIp(String userIp) { return this; } - public RecreateInstancesInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RecreateInstancesInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersRecreateInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersRecreateInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +413,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroupManager(this.instanceGroupManager); - newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource(this.instanceGroupManagersRecreateInstancesRequestResource); + newBuilder.setInstanceGroupManagersRecreateInstancesRequestResource( + this.instanceGroupManagersRecreateInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +427,35 @@ public Builder clone() { @Override public String toString() { return "RecreateInstancesInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "instanceGroupManagersRecreateInstancesRequestResource=" + instanceGroupManagersRecreateInstancesRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagersRecreateInstancesRequestResource=" + + instanceGroupManagersRecreateInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +465,20 @@ public boolean equals(Object o) { return true; } if (o instanceof RecreateInstancesInstanceGroupManagerHttpRequest) { - RecreateInstancesInstanceGroupManagerHttpRequest that = (RecreateInstancesInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.instanceGroupManagersRecreateInstancesRequestResource, that.getInstanceGroupManagersRecreateInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + RecreateInstancesInstanceGroupManagerHttpRequest that = + (RecreateInstancesInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagersRecreateInstancesRequestResource, + that.getInstanceGroupManagersRecreateInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +486,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersRecreateInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersRecreateInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java index 8333d43fab82..0448b906a2da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class RecreateInstancesRegionInstanceGroupManagerHttpRequest implem private final String key; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource; + private final RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource; private final String requestId; private final String userIp; @@ -56,7 +54,6 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private RecreateInstancesRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -67,8 +64,7 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest( String quotaUser, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +72,8 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource; + this.regionInstanceGroupManagersRecreateRequestResource = + regionInstanceGroupManagersRecreateRequestResource; this.requestId = requestId; this.userIp = userIp; } @@ -94,7 +91,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -105,8 +103,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") && regionInstanceGroupManagersRecreateRequestResource != null) { - fieldMap.put("regionInstanceGroupManagersRecreateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); + if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") + && regionInstanceGroupManagersRecreateRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersRecreateRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); } if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); @@ -186,7 +188,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() { + public RegionInstanceGroupManagersRecreateRequest + getRegionInstanceGroupManagersRecreateRequestResource() { return regionInstanceGroupManagersRecreateRequestResource; } @@ -198,22 +201,25 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) { + + public static Builder newBuilder( + RecreateInstancesRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RecreateInstancesRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RecreateInstancesRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RecreateInstancesRegionInstanceGroupManagerHttpRequest(); } @@ -226,14 +232,16 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource; + private RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource; private String requestId; private String userIp; Builder() {} public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest other) { - if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -256,7 +264,8 @@ public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupManagersRecreateRequestResource() != null) { - this.regionInstanceGroupManagersRecreateRequestResource = other.regionInstanceGroupManagersRecreateRequestResource; + this.regionInstanceGroupManagersRecreateRequestResource = + other.regionInstanceGroupManagersRecreateRequestResource; } if (other.getRequestId() != null) { this.requestId = other.requestId; @@ -275,7 +284,8 @@ public Builder mergeFrom(RecreateInstancesRegionInstanceGroupManagerHttpRequest this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupManagersRecreateRequestResource = source.regionInstanceGroupManagersRecreateRequestResource; + this.regionInstanceGroupManagersRecreateRequestResource = + source.regionInstanceGroupManagersRecreateRequestResource; this.requestId = source.requestId; this.userIp = source.userIp; } @@ -343,12 +353,16 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupManagersRecreateRequest getRegionInstanceGroupManagersRecreateRequestResource() { + public RegionInstanceGroupManagersRecreateRequest + getRegionInstanceGroupManagersRecreateRequestResource() { return regionInstanceGroupManagersRecreateRequestResource; } - public Builder setRegionInstanceGroupManagersRecreateRequestResource(RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { - this.regionInstanceGroupManagersRecreateRequestResource = regionInstanceGroupManagersRecreateRequestResource; + public Builder setRegionInstanceGroupManagersRecreateRequestResource( + RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource) { + this.regionInstanceGroupManagersRecreateRequestResource = + regionInstanceGroupManagersRecreateRequestResource; return this; } @@ -370,36 +384,27 @@ public Builder setUserIp(String userIp) { return this; } - public RecreateInstancesRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RecreateInstancesRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersRecreateRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersRecreateRequestResource, + requestId, + userIp); } public Builder clone() { @@ -411,7 +416,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupManagersRecreateRequestResource(this.regionInstanceGroupManagersRecreateRequestResource); + newBuilder.setRegionInstanceGroupManagersRecreateRequestResource( + this.regionInstanceGroupManagersRecreateRequestResource); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +427,35 @@ public Builder clone() { @Override public String toString() { return "RecreateInstancesRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupManagersRecreateRequestResource=" + regionInstanceGroupManagersRecreateRequestResource + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupManagersRecreateRequestResource=" + + regionInstanceGroupManagersRecreateRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +465,20 @@ public boolean equals(Object o) { return true; } if (o instanceof RecreateInstancesRegionInstanceGroupManagerHttpRequest) { - RecreateInstancesRegionInstanceGroupManagerHttpRequest that = (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupManagersRecreateRequestResource, that.getRegionInstanceGroupManagersRecreateRequestResource()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + RecreateInstancesRegionInstanceGroupManagerHttpRequest that = + (RecreateInstancesRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupManagersRecreateRequestResource, + that.getRegionInstanceGroupManagersRecreateRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +486,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersRecreateRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersRecreateRequestResource, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java index 307bfdb61b1d..c445cf9c6833 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,13 +41,7 @@ private Reference() { this.target = null; } - - private Reference( - String kind, - String referenceType, - String referrer, - String target - ) { + private Reference(String kind, String referenceType, String referrer, String target) { this.kind = kind; this.referenceType = referenceType; this.referrer = referrer; @@ -114,22 +105,24 @@ public String getTarget() { return target; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Reference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Reference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Reference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Reference(); } @@ -202,17 +195,9 @@ public Builder setTarget(String target) { return this; } - public Reference build() { - - - return new Reference( - kind, - referenceType, - referrer, - target - ); + return new Reference(kind, referenceType, referrer, target); } public Builder clone() { @@ -228,10 +213,17 @@ public Builder clone() { @Override public String toString() { return "Reference{" - + "kind=" + kind + ", " - + "referenceType=" + referenceType + ", " - + "referrer=" + referrer + ", " - + "target=" + target + + "kind=" + + kind + + ", " + + "referenceType=" + + referenceType + + ", " + + "referrer=" + + referrer + + ", " + + "target=" + + target + "}"; } @@ -242,23 +234,16 @@ public boolean equals(Object o) { } if (o instanceof Reference) { Reference that = (Reference) o; - return - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.referenceType, that.getReferenceType()) && - Objects.equals(this.referrer, that.getReferrer()) && - Objects.equals(this.target, that.getTarget()) - ; + return Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.referenceType, that.getReferenceType()) + && Objects.equals(this.referrer, that.getReferrer()) + && Objects.equals(this.target, that.getTarget()); } return false; } @Override public int hashCode() { - return Objects.hash( - kind, - referenceType, - referrer, - target - ); + return Objects.hash(kind, referenceType, referrer, target); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java index ccf4e9bcaed3..dfbe4ed281ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -56,7 +55,6 @@ private Region() { this.zones = null; } - private Region( String creationTimestamp, DeprecationStatus deprecated, @@ -67,8 +65,7 @@ private Region( List quotas, String selfLink, String status, - List zones - ) { + List zones) { this.creationTimestamp = creationTimestamp; this.deprecated = deprecated; this.description = description; @@ -85,7 +82,8 @@ private Region( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("deprecated") && deprecated != null) { fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); @@ -206,22 +204,24 @@ public List getZonesList() { return zones; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Region prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Region getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Region DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Region(); } @@ -394,29 +394,19 @@ public Builder addZones(String zones) { return this; } - public Region build() { - - - - - - - - return new Region( - creationTimestamp, - deprecated, - description, - id, - kind, - name, - quotas, - selfLink, - status, - zones - ); + creationTimestamp, + deprecated, + description, + id, + kind, + name, + quotas, + selfLink, + status, + zones); } public Builder clone() { @@ -438,16 +428,35 @@ public Builder clone() { @Override public String toString() { return "Region{" - + "creationTimestamp=" + creationTimestamp + ", " - + "deprecated=" + deprecated + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "quotas=" + quotas + ", " - + "selfLink=" + selfLink + ", " - + "status=" + status + ", " - + "zones=" + zones + + "creationTimestamp=" + + creationTimestamp + + ", " + + "deprecated=" + + deprecated + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "quotas=" + + quotas + + ", " + + "selfLink=" + + selfLink + + ", " + + "status=" + + status + + ", " + + "zones=" + + zones + "}"; } @@ -458,18 +467,16 @@ public boolean equals(Object o) { } if (o instanceof Region) { Region that = (Region) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.deprecated, that.getDeprecated()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.quotas, that.getQuotasList()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.zones, that.getZonesList()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.quotas, that.getQuotasList()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.zones, that.getZonesList()); } return false; } @@ -477,16 +484,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - deprecated, - description, - id, - kind, - name, - quotas, - selfLink, - status, - zones - ); + creationTimestamp, + deprecated, + description, + id, + kind, + name, + quotas, + selfLink, + status, + zones); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java index 32d3331a0ace..39c506f898e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionAutoscalerStub; import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,34 @@ * *

* - *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the regionAutoscalerClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of RegionAutoscalerSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class RegionAutoscalerClient implements BackgroundResource {
   private final RegionAutoscalerSettings settings;
   private final RegionAutoscalerStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionAutoscalerClient with default settings.
-   */
+  /** Constructs an instance of RegionAutoscalerClient with default settings. */
   public static final RegionAutoscalerClient create() throws IOException {
     return create(RegionAutoscalerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionAutoscalerClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings) throws IOException {
+  public static final RegionAutoscalerClient create(RegionAutoscalerSettings settings)
+      throws IOException {
     return new RegionAutoscalerClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionAutoscalerSettings}.
+   * Constructs an instance of RegionAutoscalerClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use RegionAutoscalerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) {
@@ -144,9 +130,9 @@ public static final RegionAutoscalerClient create(RegionAutoscalerStub stub) {
   }
 
   /**
-   * Constructs an instance of RegionAutoscalerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionAutoscalerClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected RegionAutoscalerClient(RegionAutoscalerSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +154,12 @@ public RegionAutoscalerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -183,21 +169,26 @@ public RegionAutoscalerStub getStub() {
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autoscaler, String requestId) { + public final Operation deleteRegionAutoscaler( + ProjectRegionAutoscalerName autoscaler, String requestId) { DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) - .setRequestId(requestId) - .build(); + .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) + .setRequestId(requestId) + .build(); return deleteRegionAutoscaler(request); } @@ -205,7 +196,8 @@ public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autosc /** * Deletes the specified autoscaler. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -215,11 +207,15 @@ public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autosc
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +223,9 @@ public final Operation deleteRegionAutoscaler(String autoscaler, String requestI DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .build(); return deleteRegionAutoscaler(request); } @@ -237,7 +233,8 @@ public final Operation deleteRegionAutoscaler(String autoscaler, String requestI /** * Deletes the specified autoscaler. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -262,7 +259,8 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
   /**
    * Deletes the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -278,7 +276,8 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteRegionAutoscalerCallable() { + public final UnaryCallable + deleteRegionAutoscalerCallable() { return stub.deleteRegionAutoscalerCallable(); } @@ -286,7 +285,8 @@ public final UnaryCallable deleteR /** * Returns the specified autoscaler. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -302,8 +302,8 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
 
     GetRegionAutoscalerHttpRequest request =
         GetRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
-        .build();
+            .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+            .build();
     return getRegionAutoscaler(request);
   }
 
@@ -311,7 +311,8 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
   /**
    * Returns the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -326,9 +327,7 @@ public final Autoscaler getRegionAutoscaler(ProjectRegionAutoscalerName autoscal
   public final Autoscaler getRegionAutoscaler(String autoscaler) {
 
     GetRegionAutoscalerHttpRequest request =
-        GetRegionAutoscalerHttpRequest.newBuilder()
-        .setAutoscaler(autoscaler)
-        .build();
+        GetRegionAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
     return getRegionAutoscaler(request);
   }
 
@@ -336,7 +335,8 @@ public final Autoscaler getRegionAutoscaler(String autoscaler) {
   /**
    * Returns the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -359,7 +359,8 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
   /**
    * Returns the specified autoscaler.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
@@ -373,7 +374,8 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getRegionAutoscalerCallable() { + public final UnaryCallable + getRegionAutoscalerCallable() { return stub.getRegionAutoscalerCallable(); } @@ -381,7 +383,8 @@ public final UnaryCallable getRegion /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
@@ -391,24 +394,33 @@ public final UnaryCallable getRegion
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionAutoscaler(String requestId, ProjectRegionName region, Autoscaler autoscalerResource) { + public final Operation insertRegionAutoscaler( + String requestId, ProjectRegionName region, Autoscaler autoscalerResource) { InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return insertRegionAutoscaler(request); } @@ -416,7 +428,8 @@ public final Operation insertRegionAutoscaler(String requestId, ProjectRegionNam /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
@@ -426,24 +439,33 @@ public final Operation insertRegionAutoscaler(String requestId, ProjectRegionNam
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionAutoscaler(String requestId, String region, Autoscaler autoscalerResource) { + public final Operation insertRegionAutoscaler( + String requestId, String region, Autoscaler autoscalerResource) { InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return insertRegionAutoscaler(request); } @@ -451,7 +473,8 @@ public final Operation insertRegionAutoscaler(String requestId, String region, A /** * Creates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
@@ -478,7 +501,8 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
   /**
    * Creates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String requestId = "";
@@ -496,7 +520,8 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertRegionAutoscalerCallable() { + public final UnaryCallable + insertRegionAutoscalerCallable() { return stub.insertRegionAutoscalerCallable(); } @@ -504,7 +529,8 @@ public final UnaryCallable insertR /** * Retrieves a list of autoscalers contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -521,8 +547,8 @@ public final UnaryCallable insertR
   public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ProjectRegionName region) {
     ListRegionAutoscalersHttpRequest request =
         ListRegionAutoscalersHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRegionAutoscalers(request);
   }
 
@@ -530,7 +556,8 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ProjectReg
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -546,9 +573,7 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ProjectReg
   @BetaApi
   public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String region) {
     ListRegionAutoscalersHttpRequest request =
-        ListRegionAutoscalersHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionAutoscalersHttpRequest.newBuilder().setRegion(region).build();
     return listRegionAutoscalers(request);
   }
 
@@ -556,7 +581,8 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -573,16 +599,17 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegionAutoscalersHttpRequest request) {
-    return listRegionAutoscalersPagedCallable()
-        .call(request);
+  public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(
+      ListRegionAutoscalersHttpRequest request) {
+    return listRegionAutoscalersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of autoscalers contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -598,7 +625,8 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(ListRegion
    * 
*/ @BetaApi - public final UnaryCallable listRegionAutoscalersPagedCallable() { + public final UnaryCallable + listRegionAutoscalersPagedCallable() { return stub.listRegionAutoscalersPagedCallable(); } @@ -606,7 +634,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -629,15 +658,18 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionAutoscalersCallable() { + public final UnaryCallable + listRegionAutoscalersCallable() { return stub.listRegionAutoscalersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -649,33 +681,47 @@ public final UnaryCallable
* * @param autoscaler Name of the autoscaler to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionAutoscaler(String autoscaler, String requestId, ProjectRegionName region, Autoscaler autoscalerResource) { + public final Operation patchRegionAutoscaler( + String autoscaler, + String requestId, + ProjectRegionName region, + Autoscaler autoscalerResource) { PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return patchRegionAutoscaler(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -687,33 +733,44 @@ public final Operation patchRegionAutoscaler(String autoscaler, String requestId
    * 
* * @param autoscaler Name of the autoscaler to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionAutoscaler(String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { + public final Operation patchRegionAutoscaler( + String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return patchRegionAutoscaler(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -740,9 +797,11 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -762,7 +821,8 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable patchRegionAutoscalerCallable() { + public final UnaryCallable + patchRegionAutoscalerCallable() { return stub.patchRegionAutoscalerCallable(); } @@ -770,7 +830,8 @@ public final UnaryCallable patchReg /** * Updates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -782,25 +843,37 @@ public final UnaryCallable patchReg
    * 
* * @param autoscaler Name of the autoscaler to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionAutoscaler(String autoscaler, String requestId, ProjectRegionName region, Autoscaler autoscalerResource) { + public final Operation updateRegionAutoscaler( + String autoscaler, + String requestId, + ProjectRegionName region, + Autoscaler autoscalerResource) { UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setAutoscalerResource(autoscalerResource) + .build(); return updateRegionAutoscaler(request); } @@ -808,7 +881,8 @@ public final Operation updateRegionAutoscaler(String autoscaler, String requestI /** * Updates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -820,25 +894,34 @@ public final Operation updateRegionAutoscaler(String autoscaler, String requestI
    * 
* * @param autoscaler Name of the autoscaler to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) + * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to + * automatically scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling Groups of + * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== + * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionAutoscaler(String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { + public final Operation updateRegionAutoscaler( + String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .setRegion(region) - .setAutoscalerResource(autoscalerResource) - .build(); + .setAutoscaler(autoscaler) + .setRequestId(requestId) + .setRegion(region) + .setAutoscalerResource(autoscalerResource) + .build(); return updateRegionAutoscaler(request); } @@ -846,7 +929,8 @@ public final Operation updateRegionAutoscaler(String autoscaler, String requestI /** * Updates an autoscaler in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -875,7 +959,8 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
   /**
    * Updates an autoscaler in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
@@ -895,12 +980,13 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable updateRegionAutoscalerCallable() { + public final UnaryCallable + updateRegionAutoscalerCallable() { return stub.updateRegionAutoscalerCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -929,12 +1015,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionAutoscalersPagedResponse extends AbstractPagedListResponse< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage, - ListRegionAutoscalersFixedSizeCollection> { + public static class ListRegionAutoscalersPagedResponse + extends AbstractPagedListResponse< + ListRegionAutoscalersHttpRequest, RegionAutoscalerList, Autoscaler, + ListRegionAutoscalersPage, ListRegionAutoscalersFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -954,15 +1038,12 @@ public ListRegionAutoscalersPagedResponse apply(ListRegionAutoscalersPage input) private ListRegionAutoscalersPagedResponse(ListRegionAutoscalersPage page) { super(page, ListRegionAutoscalersFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionAutoscalersPage extends AbstractPage< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage> { + public static class ListRegionAutoscalersPage + extends AbstractPage< + ListRegionAutoscalersHttpRequest, RegionAutoscalerList, Autoscaler, + ListRegionAutoscalersPage> { private ListRegionAutoscalersPage( PageContext context, @@ -987,20 +1068,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionAutoscalersFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionAutoscalersHttpRequest, - RegionAutoscalerList, - Autoscaler, - ListRegionAutoscalersPage, - ListRegionAutoscalersFixedSizeCollection> { + public static class ListRegionAutoscalersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionAutoscalersHttpRequest, RegionAutoscalerList, Autoscaler, + ListRegionAutoscalersPage, ListRegionAutoscalersFixedSizeCollection> { - private ListRegionAutoscalersFixedSizeCollection(List pages, int collectionSize) { + private ListRegionAutoscalersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1013,7 +1089,5 @@ protected ListRegionAutoscalersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionAutoscalersFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java index 9ce2f75eb73e..5ad459a5be6e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private RegionAutoscalerList() { this.warning = null; } - private RegionAutoscalerList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionAutoscalerList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionAutoscalerList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionAutoscalerList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionAutoscalerList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public RegionAutoscalerList build() { - - - - - return new RegionAutoscalerList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new RegionAutoscalerList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "RegionAutoscalerList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof RegionAutoscalerList) { RegionAutoscalerList that = (RegionAutoscalerList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java index e4c01674da70..a4673a6d2a45 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRegionAutoscaler to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRegionAutoscaler to 30 seconds: * *

  * 
@@ -85,91 +63,76 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionAutoscalerSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteRegionAutoscaler.
-   */
-  public UnaryCallSettings deleteRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to deleteRegionAutoscaler. */
+  public UnaryCallSettings
+      deleteRegionAutoscalerSettings() {
     return ((RegionAutoscalerStubSettings) getStubSettings()).deleteRegionAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionAutoscaler.
-   */
-  public UnaryCallSettings getRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to getRegionAutoscaler. */
+  public UnaryCallSettings
+      getRegionAutoscalerSettings() {
     return ((RegionAutoscalerStubSettings) getStubSettings()).getRegionAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionAutoscaler.
-   */
-  public UnaryCallSettings insertRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to insertRegionAutoscaler. */
+  public UnaryCallSettings
+      insertRegionAutoscalerSettings() {
     return ((RegionAutoscalerStubSettings) getStubSettings()).insertRegionAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionAutoscalers.
-   */
-  public PagedCallSettings listRegionAutoscalersSettings() {
+  /** Returns the object with the settings used for calls to listRegionAutoscalers. */
+  public PagedCallSettings<
+          ListRegionAutoscalersHttpRequest, RegionAutoscalerList,
+          ListRegionAutoscalersPagedResponse>
+      listRegionAutoscalersSettings() {
     return ((RegionAutoscalerStubSettings) getStubSettings()).listRegionAutoscalersSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchRegionAutoscaler.
-   */
-  public UnaryCallSettings patchRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to patchRegionAutoscaler. */
+  public UnaryCallSettings
+      patchRegionAutoscalerSettings() {
     return ((RegionAutoscalerStubSettings) getStubSettings()).patchRegionAutoscalerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateRegionAutoscaler.
-   */
-  public UnaryCallSettings updateRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to updateRegionAutoscaler. */
+  public UnaryCallSettings
+      updateRegionAutoscalerSettings() {
     return ((RegionAutoscalerStubSettings) getStubSettings()).updateRegionAutoscalerSettings();
   }
 
-
-  public static final RegionAutoscalerSettings create(RegionAutoscalerStubSettings stub) throws IOException {
+  public static final RegionAutoscalerSettings create(RegionAutoscalerStubSettings stub)
+      throws IOException {
     return new RegionAutoscalerSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionAutoscalerStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionAutoscalerStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionAutoscalerStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionAutoscalerStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionAutoscalerStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionAutoscalerStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionAutoscalerStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +145,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionAutoscalerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +164,7 @@ protected RegionAutoscalerSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionAutoscalerSettings.
-   */
+  /** Builder for RegionAutoscalerSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +186,58 @@ protected Builder(RegionAutoscalerStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionAutoscalerStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionAutoscalerStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteRegionAutoscaler. - */ - public UnaryCallSettings.Builder deleteRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to deleteRegionAutoscaler. */ + public UnaryCallSettings.Builder + deleteRegionAutoscalerSettings() { return getStubSettingsBuilder().deleteRegionAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to getRegionAutoscaler. - */ - public UnaryCallSettings.Builder getRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to getRegionAutoscaler. */ + public UnaryCallSettings.Builder + getRegionAutoscalerSettings() { return getStubSettingsBuilder().getRegionAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to insertRegionAutoscaler. - */ - public UnaryCallSettings.Builder insertRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to insertRegionAutoscaler. */ + public UnaryCallSettings.Builder + insertRegionAutoscalerSettings() { return getStubSettingsBuilder().insertRegionAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to listRegionAutoscalers. - */ - public PagedCallSettings.Builder listRegionAutoscalersSettings() { + /** Returns the builder for the settings used for calls to listRegionAutoscalers. */ + public PagedCallSettings.Builder< + ListRegionAutoscalersHttpRequest, RegionAutoscalerList, + ListRegionAutoscalersPagedResponse> + listRegionAutoscalersSettings() { return getStubSettingsBuilder().listRegionAutoscalersSettings(); } - /** - * Returns the builder for the settings used for calls to patchRegionAutoscaler. - */ - public UnaryCallSettings.Builder patchRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to patchRegionAutoscaler. */ + public UnaryCallSettings.Builder + patchRegionAutoscalerSettings() { return getStubSettingsBuilder().patchRegionAutoscalerSettings(); } - /** - * Returns the builder for the settings used for calls to updateRegionAutoscaler. - */ - public UnaryCallSettings.Builder updateRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to updateRegionAutoscaler. */ + public UnaryCallSettings.Builder + updateRegionAutoscalerSettings() { return getStubSettingsBuilder().updateRegionAutoscalerSettings(); } @@ -293,4 +246,4 @@ public RegionAutoscalerSettings build() throws IOException { return new RegionAutoscalerSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java index 752a321b8401..34ca5c12aa85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionBackendServiceStub; import com.google.cloud.compute.v1.stub.RegionBackendServiceStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,34 @@ * *

* - *

Note: close() needs to be called on the regionBackendServiceClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the regionBackendServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of RegionBackendServiceSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of RegionBackendServiceSettings + * to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class RegionBackendServiceClient implements BackgroundResource {
   private final RegionBackendServiceSettings settings;
   private final RegionBackendServiceStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionBackendServiceClient with default settings.
-   */
+  /** Constructs an instance of RegionBackendServiceClient with default settings. */
   public static final RegionBackendServiceClient create() throws IOException {
     return create(RegionBackendServiceSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionBackendServiceClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionBackendServiceClient, using the given settings. The channels
+   * are created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final RegionBackendServiceClient create(RegionBackendServiceSettings settings) throws IOException {
+  public static final RegionBackendServiceClient create(RegionBackendServiceSettings settings)
+      throws IOException {
     return new RegionBackendServiceClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionBackendServiceClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionBackendServiceSettings}.
+   * Constructs an instance of RegionBackendServiceClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use RegionBackendServiceSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionBackendServiceClient create(RegionBackendServiceStub stub) {
@@ -144,9 +130,9 @@ public static final RegionBackendServiceClient create(RegionBackendServiceStub s
   }
 
   /**
-   * Constructs an instance of RegionBackendServiceClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionBackendServiceClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
   protected RegionBackendServiceClient(RegionBackendServiceSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +154,12 @@ public RegionBackendServiceStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified regional BackendService resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -182,22 +168,27 @@ public RegionBackendServiceStub getStub() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionBackendService(String requestId, ProjectRegionBackendServiceName backendService) { + public final Operation deleteRegionBackendService( + String requestId, ProjectRegionBackendServiceName backendService) { DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService == null ? null : backendService.toString()) - .build(); + .setRequestId(requestId) + .setBackendService(backendService == null ? null : backendService.toString()) + .build(); return deleteRegionBackendService(request); } @@ -205,7 +196,8 @@ public final Operation deleteRegionBackendService(String requestId, ProjectRegio /** * Deletes the specified regional BackendService resource. * - * Sample code: + *

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -214,11 +206,15 @@ public final Operation deleteRegionBackendService(String requestId, ProjectRegio
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +223,9 @@ public final Operation deleteRegionBackendService(String requestId, String backe DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .build(); + .setRequestId(requestId) + .setBackendService(backendService) + .build(); return deleteRegionBackendService(request); } @@ -237,7 +233,8 @@ public final Operation deleteRegionBackendService(String requestId, String backe /** * Deletes the specified regional BackendService resource. * - * Sample code: + *

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -262,7 +259,8 @@ public final Operation deleteRegionBackendService(DeleteRegionBackendServiceHttp
   /**
    * Deletes the specified regional BackendService resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -278,7 +276,8 @@ public final Operation deleteRegionBackendService(DeleteRegionBackendServiceHttp
    * 
*/ @BetaApi - public final UnaryCallable deleteRegionBackendServiceCallable() { + public final UnaryCallable + deleteRegionBackendServiceCallable() { return stub.deleteRegionBackendServiceCallable(); } @@ -286,7 +285,8 @@ public final UnaryCallable del /** * Returns the specified regional BackendService resource. * - * Sample code: + *

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -298,12 +298,13 @@ public final UnaryCallable del
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final BackendService getRegionBackendService(ProjectRegionBackendServiceName backendService) {
+  public final BackendService getRegionBackendService(
+      ProjectRegionBackendServiceName backendService) {
 
     GetRegionBackendServiceHttpRequest request =
         GetRegionBackendServiceHttpRequest.newBuilder()
-        .setBackendService(backendService == null ? null : backendService.toString())
-        .build();
+            .setBackendService(backendService == null ? null : backendService.toString())
+            .build();
     return getRegionBackendService(request);
   }
 
@@ -311,7 +312,8 @@ public final BackendService getRegionBackendService(ProjectRegionBackendServiceN
   /**
    * Returns the specified regional BackendService resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -326,9 +328,7 @@ public final BackendService getRegionBackendService(ProjectRegionBackendServiceN
   public final BackendService getRegionBackendService(String backendService) {
 
     GetRegionBackendServiceHttpRequest request =
-        GetRegionBackendServiceHttpRequest.newBuilder()
-        .setBackendService(backendService)
-        .build();
+        GetRegionBackendServiceHttpRequest.newBuilder().setBackendService(backendService).build();
     return getRegionBackendService(request);
   }
 
@@ -336,7 +336,8 @@ public final BackendService getRegionBackendService(String backendService) {
   /**
    * Returns the specified regional BackendService resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -359,7 +360,8 @@ public final BackendService getRegionBackendService(GetRegionBackendServiceHttpR
   /**
    * Returns the specified regional BackendService resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -373,7 +375,8 @@ public final BackendService getRegionBackendService(GetRegionBackendServiceHttpR
    * 
*/ @BetaApi - public final UnaryCallable getRegionBackendServiceCallable() { + public final UnaryCallable + getRegionBackendServiceCallable() { return stub.getRegionBackendServiceCallable(); } @@ -381,7 +384,8 @@ public final UnaryCallable g /** * Gets the most recent health check results for this regional BackendService. * - * Sample code: + *

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -395,13 +399,15 @@ public final UnaryCallable g
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final BackendServiceGroupHealth getHealthRegionBackendService(ProjectRegionBackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource) {
+  public final BackendServiceGroupHealth getHealthRegionBackendService(
+      ProjectRegionBackendServiceName backendService,
+      ResourceGroupReference resourceGroupReferenceResource) {
 
     GetHealthRegionBackendServiceHttpRequest request =
         GetHealthRegionBackendServiceHttpRequest.newBuilder()
-        .setBackendService(backendService == null ? null : backendService.toString())
-        .setResourceGroupReferenceResource(resourceGroupReferenceResource)
-        .build();
+            .setBackendService(backendService == null ? null : backendService.toString())
+            .setResourceGroupReferenceResource(resourceGroupReferenceResource)
+            .build();
     return getHealthRegionBackendService(request);
   }
 
@@ -409,7 +415,8 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(ProjectRegi
   /**
    * Gets the most recent health check results for this regional BackendService.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -423,13 +430,14 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(ProjectRegi
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final BackendServiceGroupHealth getHealthRegionBackendService(String backendService, ResourceGroupReference resourceGroupReferenceResource) {
+  public final BackendServiceGroupHealth getHealthRegionBackendService(
+      String backendService, ResourceGroupReference resourceGroupReferenceResource) {
 
     GetHealthRegionBackendServiceHttpRequest request =
         GetHealthRegionBackendServiceHttpRequest.newBuilder()
-        .setBackendService(backendService)
-        .setResourceGroupReferenceResource(resourceGroupReferenceResource)
-        .build();
+            .setBackendService(backendService)
+            .setResourceGroupReferenceResource(resourceGroupReferenceResource)
+            .build();
     return getHealthRegionBackendService(request);
   }
 
@@ -437,7 +445,8 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(String back
   /**
    * Gets the most recent health check results for this regional BackendService.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -454,7 +463,8 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(String back
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final BackendServiceGroupHealth getHealthRegionBackendService(GetHealthRegionBackendServiceHttpRequest request) {
+  public final BackendServiceGroupHealth getHealthRegionBackendService(
+      GetHealthRegionBackendServiceHttpRequest request) {
     return getHealthRegionBackendServiceCallable().call(request);
   }
 
@@ -462,7 +472,8 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(GetHealthRe
   /**
    * Gets the most recent health check results for this regional BackendService.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
@@ -478,15 +489,19 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(GetHealthRe
    * 
*/ @BetaApi - public final UnaryCallable getHealthRegionBackendServiceCallable() { + public final UnaryCallable + getHealthRegionBackendServiceCallable() { return stub.getHealthRegionBackendServiceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * Creates a regional BackendService resource in the specified project using the data included in + * the request. There are several restrictions and guidelines to keep in mind when creating a + * regional backend service. Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -496,32 +511,42 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionBackendService(String requestId, ProjectRegionName region, BackendService backendServiceResource) { + public final Operation insertRegionBackendService( + String requestId, ProjectRegionName region, BackendService backendServiceResource) { InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); return insertRegionBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * Creates a regional BackendService resource in the specified project using the data included in + * the request. There are several restrictions and guidelines to keep in mind when creating a + * regional backend service. Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -531,32 +556,42 @@ public final Operation insertRegionBackendService(String requestId, ProjectRegio
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionBackendService(String requestId, String region, BackendService backendServiceResource) { + public final Operation insertRegionBackendService( + String requestId, String region, BackendService backendServiceResource) { InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setBackendServiceResource(backendServiceResource) + .build(); return insertRegionBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + * Creates a regional BackendService resource in the specified project using the data included in + * the request. There are several restrictions and guidelines to keep in mind when creating a + * regional backend service. Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -581,9 +616,12 @@ public final Operation insertRegionBackendService(InsertRegionBackendServiceHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read  Restrictions and Guidelines for more information.
+   * Creates a regional BackendService resource in the specified project using the data included in
+   * the request. There are several restrictions and guidelines to keep in mind when creating a
+   * regional backend service. Read Restrictions and Guidelines for more information.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -601,15 +639,18 @@ public final Operation insertRegionBackendService(InsertRegionBackendServiceHttp
    * 
*/ @BetaApi - public final UnaryCallable insertRegionBackendServiceCallable() { + public final UnaryCallable + insertRegionBackendServiceCallable() { return stub.insertRegionBackendServiceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * Retrieves the list of regional BackendService resources available to the specified project in + * the given region. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -623,19 +664,22 @@ public final UnaryCallable ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionBackendServicesPagedResponse listRegionBackendServices(ProjectRegionName region) {
+  public final ListRegionBackendServicesPagedResponse listRegionBackendServices(
+      ProjectRegionName region) {
     ListRegionBackendServicesHttpRequest request =
         ListRegionBackendServicesHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRegionBackendServices(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of regional BackendService resources available to the specified project in the given region.
+   * Retrieves the list of regional BackendService resources available to the specified project in
+   * the given region.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -651,17 +695,17 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(Pr
   @BetaApi
   public final ListRegionBackendServicesPagedResponse listRegionBackendServices(String region) {
     ListRegionBackendServicesHttpRequest request =
-        ListRegionBackendServicesHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionBackendServicesHttpRequest.newBuilder().setRegion(region).build();
     return listRegionBackendServices(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of regional BackendService resources available to the specified project in the given region.
+   * Retrieves the list of regional BackendService resources available to the specified project in
+   * the given region.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -678,16 +722,18 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionBackendServicesPagedResponse listRegionBackendServices(ListRegionBackendServicesHttpRequest request) {
-    return listRegionBackendServicesPagedCallable()
-        .call(request);
+  public final ListRegionBackendServicesPagedResponse listRegionBackendServices(
+      ListRegionBackendServicesHttpRequest request) {
+    return listRegionBackendServicesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Retrieves the list of regional BackendService resources available to the specified project in the given region.
+   * Retrieves the list of regional BackendService resources available to the specified project in
+   * the given region.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -703,15 +749,19 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(Li
    * 
*/ @BetaApi - public final UnaryCallable listRegionBackendServicesPagedCallable() { + public final UnaryCallable< + ListRegionBackendServicesHttpRequest, ListRegionBackendServicesPagedResponse> + listRegionBackendServicesPagedCallable() { return stub.listRegionBackendServicesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * Retrieves the list of regional BackendService resources available to the specified project in + * the given region. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -734,15 +784,20 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionBackendServicesCallable() { + public final UnaryCallable + listRegionBackendServicesCallable() { return stub.listRegionBackendServicesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * Updates the specified regional BackendService resource with the data included in the request. + * There are several restrictions and guidelines to keep in mind when updating a backend service. + * Read Restrictions and Guidelines for more information. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -752,32 +807,45 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionBackendService(String requestId, ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { + public final Operation patchRegionBackendService( + String requestId, + ProjectRegionBackendServiceName backendService, + BackendService backendServiceResource) { PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService == null ? null : backendService.toString()) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); return patchRegionBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * Updates the specified regional BackendService resource with the data included in the request. + * There are several restrictions and guidelines to keep in mind when updating a backend service. + * Read Restrictions and Guidelines for more information. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -787,32 +855,43 @@ public final Operation patchRegionBackendService(String requestId, ProjectRegion
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRegionBackendService(String requestId, String backendService, BackendService backendServiceResource) { + public final Operation patchRegionBackendService( + String requestId, String backendService, BackendService backendServiceResource) { PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); return patchRegionBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * Updates the specified regional BackendService resource with the data included in the request. + * There are several restrictions and guidelines to keep in mind when updating a backend service. + * Read Restrictions and Guidelines for more information. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -837,9 +916,13 @@ public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRe
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
+   * Updates the specified regional BackendService resource with the data included in the request.
+   * There are several restrictions and guidelines to keep in mind when updating a backend service.
+   * Read Restrictions and Guidelines for more information. This method supports PATCH semantics and
+   * uses the JSON merge patch format and processing rules.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -857,15 +940,19 @@ public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRe
    * 
*/ @BetaApi - public final UnaryCallable patchRegionBackendServiceCallable() { + public final UnaryCallable + patchRegionBackendServiceCallable() { return stub.patchRegionBackendServiceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * Updates the specified regional BackendService resource with the data included in the request. + * There are several restrictions and guidelines to keep in mind when updating a backend service. + * Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -875,32 +962,44 @@ public final UnaryCallable patc
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionBackendService(String requestId, ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { + public final Operation updateRegionBackendService( + String requestId, + ProjectRegionBackendServiceName backendService, + BackendService backendServiceResource) { UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService == null ? null : backendService.toString()) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService == null ? null : backendService.toString()) + .setBackendServiceResource(backendServiceResource) + .build(); return updateRegionBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * Updates the specified regional BackendService resource with the data included in the request. + * There are several restrictions and guidelines to keep in mind when updating a backend service. + * Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -910,32 +1009,42 @@ public final Operation updateRegionBackendService(String requestId, ProjectRegio
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. - * @param backendServiceResource A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) + * @param backendServiceResource A BackendService resource. This resource defines a group of + * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRegionBackendService(String requestId, String backendService, BackendService backendServiceResource) { + public final Operation updateRegionBackendService( + String requestId, String backendService, BackendService backendServiceResource) { UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .setBackendServiceResource(backendServiceResource) - .build(); + .setRequestId(requestId) + .setBackendService(backendService) + .setBackendServiceResource(backendServiceResource) + .build(); return updateRegionBackendService(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + * Updates the specified regional BackendService resource with the data included in the request. + * There are several restrictions and guidelines to keep in mind when updating a backend service. + * Read Restrictions and Guidelines for more information. + * + *

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -960,9 +1069,12 @@ public final Operation updateRegionBackendService(UpdateRegionBackendServiceHttp
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information.
+   * Updates the specified regional BackendService resource with the data included in the request.
+   * There are several restrictions and guidelines to keep in mind when updating a backend service.
+   * Read Restrictions and Guidelines for more information.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
    *   String requestId = "";
@@ -980,12 +1092,13 @@ public final Operation updateRegionBackendService(UpdateRegionBackendServiceHttp
    * 
*/ @BetaApi - public final UnaryCallable updateRegionBackendServiceCallable() { + public final UnaryCallable + updateRegionBackendServiceCallable() { return stub.updateRegionBackendServiceCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1014,15 +1127,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionBackendServicesPagedResponse extends AbstractPagedListResponse< - ListRegionBackendServicesHttpRequest, - BackendServiceList, - BackendService, - ListRegionBackendServicesPage, - ListRegionBackendServicesFixedSizeCollection> { + public static class ListRegionBackendServicesPagedResponse + extends AbstractPagedListResponse< + ListRegionBackendServicesHttpRequest, BackendServiceList, BackendService, + ListRegionBackendServicesPage, ListRegionBackendServicesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListRegionBackendServicesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1030,7 +1142,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public ListRegionBackendServicesPagedResponse apply(ListRegionBackendServicesPage input) { + public ListRegionBackendServicesPagedResponse apply( + ListRegionBackendServicesPage input) { return new ListRegionBackendServicesPagedResponse(input); } }); @@ -1039,18 +1152,16 @@ public ListRegionBackendServicesPagedResponse apply(ListRegionBackendServicesPag private ListRegionBackendServicesPagedResponse(ListRegionBackendServicesPage page) { super(page, ListRegionBackendServicesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionBackendServicesPage extends AbstractPage< - ListRegionBackendServicesHttpRequest, - BackendServiceList, - BackendService, - ListRegionBackendServicesPage> { + public static class ListRegionBackendServicesPage + extends AbstractPage< + ListRegionBackendServicesHttpRequest, BackendServiceList, BackendService, + ListRegionBackendServicesPage> { private ListRegionBackendServicesPage( - PageContext context, + PageContext + context, BackendServiceList response) { super(context, response); } @@ -1061,31 +1172,28 @@ private static ListRegionBackendServicesPage createEmptyPage() { @Override protected ListRegionBackendServicesPage createPage( - PageContext context, + PageContext + context, BackendServiceList response) { return new ListRegionBackendServicesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionBackendServicesFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionBackendServicesHttpRequest, - BackendServiceList, - BackendService, - ListRegionBackendServicesPage, - ListRegionBackendServicesFixedSizeCollection> { + public static class ListRegionBackendServicesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionBackendServicesHttpRequest, BackendServiceList, BackendService, + ListRegionBackendServicesPage, ListRegionBackendServicesFixedSizeCollection> { - private ListRegionBackendServicesFixedSizeCollection(List pages, int collectionSize) { + private ListRegionBackendServicesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1098,7 +1206,5 @@ protected ListRegionBackendServicesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionBackendServicesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java index 78be1457cdaa..c8efa2a10f56 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; import com.google.cloud.compute.v1.stub.RegionBackendServiceStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRegionBackendService to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRegionBackendService to 30 seconds: * *

  * 
@@ -85,98 +63,88 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionBackendServiceSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteRegionBackendService.
-   */
-  public UnaryCallSettings deleteRegionBackendServiceSettings() {
-    return ((RegionBackendServiceStubSettings) getStubSettings()).deleteRegionBackendServiceSettings();
+  /** Returns the object with the settings used for calls to deleteRegionBackendService. */
+  public UnaryCallSettings
+      deleteRegionBackendServiceSettings() {
+    return ((RegionBackendServiceStubSettings) getStubSettings())
+        .deleteRegionBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionBackendService.
-   */
-  public UnaryCallSettings getRegionBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getRegionBackendService. */
+  public UnaryCallSettings
+      getRegionBackendServiceSettings() {
     return ((RegionBackendServiceStubSettings) getStubSettings()).getRegionBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthRegionBackendService.
-   */
-  public UnaryCallSettings getHealthRegionBackendServiceSettings() {
-    return ((RegionBackendServiceStubSettings) getStubSettings()).getHealthRegionBackendServiceSettings();
+  /** Returns the object with the settings used for calls to getHealthRegionBackendService. */
+  public UnaryCallSettings
+      getHealthRegionBackendServiceSettings() {
+    return ((RegionBackendServiceStubSettings) getStubSettings())
+        .getHealthRegionBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionBackendService.
-   */
-  public UnaryCallSettings insertRegionBackendServiceSettings() {
-    return ((RegionBackendServiceStubSettings) getStubSettings()).insertRegionBackendServiceSettings();
+  /** Returns the object with the settings used for calls to insertRegionBackendService. */
+  public UnaryCallSettings
+      insertRegionBackendServiceSettings() {
+    return ((RegionBackendServiceStubSettings) getStubSettings())
+        .insertRegionBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionBackendServices.
-   */
-  public PagedCallSettings listRegionBackendServicesSettings() {
-    return ((RegionBackendServiceStubSettings) getStubSettings()).listRegionBackendServicesSettings();
+  /** Returns the object with the settings used for calls to listRegionBackendServices. */
+  public PagedCallSettings<
+          ListRegionBackendServicesHttpRequest, BackendServiceList,
+          ListRegionBackendServicesPagedResponse>
+      listRegionBackendServicesSettings() {
+    return ((RegionBackendServiceStubSettings) getStubSettings())
+        .listRegionBackendServicesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchRegionBackendService.
-   */
-  public UnaryCallSettings patchRegionBackendServiceSettings() {
-    return ((RegionBackendServiceStubSettings) getStubSettings()).patchRegionBackendServiceSettings();
+  /** Returns the object with the settings used for calls to patchRegionBackendService. */
+  public UnaryCallSettings
+      patchRegionBackendServiceSettings() {
+    return ((RegionBackendServiceStubSettings) getStubSettings())
+        .patchRegionBackendServiceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateRegionBackendService.
-   */
-  public UnaryCallSettings updateRegionBackendServiceSettings() {
-    return ((RegionBackendServiceStubSettings) getStubSettings()).updateRegionBackendServiceSettings();
+  /** Returns the object with the settings used for calls to updateRegionBackendService. */
+  public UnaryCallSettings
+      updateRegionBackendServiceSettings() {
+    return ((RegionBackendServiceStubSettings) getStubSettings())
+        .updateRegionBackendServiceSettings();
   }
 
-
-  public static final RegionBackendServiceSettings create(RegionBackendServiceStubSettings stub) throws IOException {
+  public static final RegionBackendServiceSettings create(RegionBackendServiceStubSettings stub)
+      throws IOException {
     return new RegionBackendServiceSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionBackendServiceStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionBackendServiceStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionBackendServiceStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionBackendServiceStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionBackendServiceStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionBackendServiceStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionBackendServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -189,23 +157,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionBackendServiceStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -214,10 +176,9 @@ protected RegionBackendServiceSettings(Builder settingsBuilder) throws IOExcepti
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionBackendServiceSettings.
-   */
-  public static class Builder extends ClientSettings.Builder {
+  /** Builder for RegionBackendServiceSettings. */
+  public static class Builder
+      extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
     }
@@ -238,67 +199,65 @@ protected Builder(RegionBackendServiceStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionBackendServiceStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionBackendServiceStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteRegionBackendService. - */ - public UnaryCallSettings.Builder deleteRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to deleteRegionBackendService. */ + public UnaryCallSettings.Builder + deleteRegionBackendServiceSettings() { return getStubSettingsBuilder().deleteRegionBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to getRegionBackendService. - */ - public UnaryCallSettings.Builder getRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getRegionBackendService. */ + public UnaryCallSettings.Builder + getRegionBackendServiceSettings() { return getStubSettingsBuilder().getRegionBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to getHealthRegionBackendService. - */ - public UnaryCallSettings.Builder getHealthRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getHealthRegionBackendService. */ + public UnaryCallSettings.Builder< + GetHealthRegionBackendServiceHttpRequest, BackendServiceGroupHealth> + getHealthRegionBackendServiceSettings() { return getStubSettingsBuilder().getHealthRegionBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to insertRegionBackendService. - */ - public UnaryCallSettings.Builder insertRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to insertRegionBackendService. */ + public UnaryCallSettings.Builder + insertRegionBackendServiceSettings() { return getStubSettingsBuilder().insertRegionBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to listRegionBackendServices. - */ - public PagedCallSettings.Builder listRegionBackendServicesSettings() { + /** Returns the builder for the settings used for calls to listRegionBackendServices. */ + public PagedCallSettings.Builder< + ListRegionBackendServicesHttpRequest, BackendServiceList, + ListRegionBackendServicesPagedResponse> + listRegionBackendServicesSettings() { return getStubSettingsBuilder().listRegionBackendServicesSettings(); } - /** - * Returns the builder for the settings used for calls to patchRegionBackendService. - */ - public UnaryCallSettings.Builder patchRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to patchRegionBackendService. */ + public UnaryCallSettings.Builder + patchRegionBackendServiceSettings() { return getStubSettingsBuilder().patchRegionBackendServiceSettings(); } - /** - * Returns the builder for the settings used for calls to updateRegionBackendService. - */ - public UnaryCallSettings.Builder updateRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to updateRegionBackendService. */ + public UnaryCallSettings.Builder + updateRegionBackendServiceSettings() { return getStubSettingsBuilder().updateRegionBackendServiceSettings(); } @@ -307,4 +266,4 @@ public RegionBackendServiceSettings build() throws IOException { return new RegionBackendServiceSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java index ea57817c8f0d..0c72aba0a6b6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionStub; import com.google.cloud.compute.v1.stub.RegionStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,33 @@ * *

* - *

Note: close() needs to be called on the regionClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the regionClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of RegionSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of RegionSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +104,14 @@ public class RegionClient implements BackgroundResource {
   private final RegionSettings settings;
   private final RegionStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionClient with default settings.
-   */
+  /** Constructs an instance of RegionClient with default settings. */
   public static final RegionClient create() throws IOException {
     return create(RegionSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final RegionClient create(RegionSettings settings) throws IOException {
     return new RegionClient(settings);
@@ -143,9 +127,8 @@ public static final RegionClient create(RegionStub stub) {
   }
 
   /**
-   * Constructs an instance of RegionClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected RegionClient(RegionSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +150,13 @@ public RegionStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Region resource. Get a list of available regions by making a list() request.
+   * Returns the specified Region resource. Get a list of available regions by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -188,16 +172,18 @@ public final Region getRegion(ProjectRegionName region) {
 
     GetRegionHttpRequest request =
         GetRegionHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return getRegion(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Region resource. Get a list of available regions by making a list() request.
+   * Returns the specified Region resource. Get a list of available regions by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -211,18 +197,17 @@ public final Region getRegion(ProjectRegionName region) {
   @BetaApi
   public final Region getRegion(String region) {
 
-    GetRegionHttpRequest request =
-        GetRegionHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+    GetRegionHttpRequest request = GetRegionHttpRequest.newBuilder().setRegion(region).build();
     return getRegion(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Region resource. Get a list of available regions by making a list() request.
+   * Returns the specified Region resource. Get a list of available regions by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -243,9 +228,11 @@ public final Region getRegion(GetRegionHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Region resource. Get a list of available regions by making a list() request.
+   * Returns the specified Region resource. Get a list of available regions by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -267,7 +254,8 @@ public final UnaryCallable getRegionCallable() {
   /**
    * Retrieves the list of region resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -284,8 +272,8 @@ public final UnaryCallable getRegionCallable() {
   public final ListRegionsPagedResponse listRegions(ProjectName project) {
     ListRegionsHttpRequest request =
         ListRegionsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listRegions(request);
   }
 
@@ -293,7 +281,8 @@ public final ListRegionsPagedResponse listRegions(ProjectName project) {
   /**
    * Retrieves the list of region resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -309,9 +298,7 @@ public final ListRegionsPagedResponse listRegions(ProjectName project) {
   @BetaApi
   public final ListRegionsPagedResponse listRegions(String project) {
     ListRegionsHttpRequest request =
-        ListRegionsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListRegionsHttpRequest.newBuilder().setProject(project).build();
     return listRegions(request);
   }
 
@@ -319,7 +306,8 @@ public final ListRegionsPagedResponse listRegions(String project) {
   /**
    * Retrieves the list of region resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -337,15 +325,15 @@ public final ListRegionsPagedResponse listRegions(String project) {
    */
   @BetaApi
   public final ListRegionsPagedResponse listRegions(ListRegionsHttpRequest request) {
-    return listRegionsPagedCallable()
-        .call(request);
+    return listRegionsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of region resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -361,7 +349,8 @@ public final ListRegionsPagedResponse listRegions(ListRegionsHttpRequest request
    * 
*/ @BetaApi - public final UnaryCallable listRegionsPagedCallable() { + public final UnaryCallable + listRegionsPagedCallable() { return stub.listRegionsPagedCallable(); } @@ -369,7 +358,8 @@ public final UnaryCallable lis /** * Retrieves the list of region resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (RegionClient regionClient = RegionClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -397,7 +387,7 @@ public final UnaryCallable listRegionsCallab
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -426,12 +416,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListRegionsPagedResponse extends AbstractPagedListResponse<
-      ListRegionsHttpRequest,
-      RegionList,
-      Region,
-      ListRegionsPage,
-      ListRegionsFixedSizeCollection> {
+  public static class ListRegionsPagedResponse
+      extends AbstractPagedListResponse<
+          ListRegionsHttpRequest, RegionList, Region, ListRegionsPage,
+          ListRegionsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -451,19 +439,13 @@ public ListRegionsPagedResponse apply(ListRegionsPage input) {
     private ListRegionsPagedResponse(ListRegionsPage page) {
       super(page, ListRegionsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListRegionsPage extends AbstractPage<
-      ListRegionsHttpRequest,
-      RegionList,
-      Region,
-      ListRegionsPage> {
+  public static class ListRegionsPage
+      extends AbstractPage {
 
     private ListRegionsPage(
-        PageContext context,
-        RegionList response) {
+        PageContext context, RegionList response) {
       super(context, response);
     }
 
@@ -473,8 +455,7 @@ private static ListRegionsPage createEmptyPage() {
 
     @Override
     protected ListRegionsPage createPage(
-        PageContext context,
-        RegionList response) {
+        PageContext context, RegionList response) {
       return new ListRegionsPage(context, response);
     }
 
@@ -484,18 +465,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListRegionsFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListRegionsHttpRequest,
-      RegionList,
-      Region,
-      ListRegionsPage,
-      ListRegionsFixedSizeCollection> {
+  public static class ListRegionsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListRegionsHttpRequest, RegionList, Region, ListRegionsPage,
+          ListRegionsFixedSizeCollection> {
 
     private ListRegionsFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -510,7 +485,5 @@ protected ListRegionsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListRegionsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
index 8279bca17534..3070c42d1ba3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
@@ -23,22 +23,12 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
-import com.google.api.gax.paging.FixedSizeCollection;
-import com.google.api.gax.paging.Page;
-import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.RegionCommitmentStub;
 import com.google.cloud.compute.v1.stub.RegionCommitmentStubSettings;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import java.io.Closeable;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -58,34 +48,34 @@
  * 
  * 
* - *

Note: close() needs to be called on the regionCommitmentClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the regionCommitmentClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of RegionCommitmentSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class RegionCommitmentClient implements BackgroundResource {
   private final RegionCommitmentSettings settings;
   private final RegionCommitmentStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionCommitmentClient with default settings.
-   */
+  /** Constructs an instance of RegionCommitmentClient with default settings. */
   public static final RegionCommitmentClient create() throws IOException {
     return create(RegionCommitmentSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionCommitmentClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionCommitmentClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final RegionCommitmentClient create(RegionCommitmentSettings settings) throws IOException {
+  public static final RegionCommitmentClient create(RegionCommitmentSettings settings)
+      throws IOException {
     return new RegionCommitmentClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionCommitmentClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionCommitmentSettings}.
+   * Constructs an instance of RegionCommitmentClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use RegionCommitmentSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionCommitmentClient create(RegionCommitmentStub stub) {
@@ -143,9 +129,9 @@ public static final RegionCommitmentClient create(RegionCommitmentStub stub) {
   }
 
   /**
-   * Constructs an instance of RegionCommitmentClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionCommitmentClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected RegionCommitmentClient(RegionCommitmentSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public RegionCommitmentStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of commitments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -186,11 +172,12 @@ public RegionCommitmentStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(ProjectName project) {
+  public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(
+      ProjectName project) {
     AggregatedListRegionCommitmentsHttpRequest request =
         AggregatedListRegionCommitmentsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListRegionCommitments(request);
   }
 
@@ -198,7 +185,8 @@ public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCo
   /**
    * Retrieves an aggregated list of commitments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -212,11 +200,10 @@ public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCo
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(String project) {
+  public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(
+      String project) {
     AggregatedListRegionCommitmentsHttpRequest request =
-        AggregatedListRegionCommitmentsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListRegionCommitmentsHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListRegionCommitments(request);
   }
 
@@ -224,7 +211,8 @@ public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCo
   /**
    * Retrieves an aggregated list of commitments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -241,16 +229,17 @@ public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCo
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(AggregatedListRegionCommitmentsHttpRequest request) {
-    return aggregatedListRegionCommitmentsPagedCallable()
-        .call(request);
+  public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCommitments(
+      AggregatedListRegionCommitmentsHttpRequest request) {
+    return aggregatedListRegionCommitmentsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of commitments.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -266,7 +255,9 @@ public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCo
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListRegionCommitmentsPagedCallable() { + public final UnaryCallable< + AggregatedListRegionCommitmentsHttpRequest, AggregatedListRegionCommitmentsPagedResponse> + aggregatedListRegionCommitmentsPagedCallable() { return stub.aggregatedListRegionCommitmentsPagedCallable(); } @@ -274,7 +265,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -297,15 +289,18 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListRegionCommitmentsCallable() { + public final UnaryCallable + aggregatedListRegionCommitmentsCallable() { return stub.aggregatedListRegionCommitmentsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified commitment resource. Get a list of available commitments by making a list() request. + * Returns the specified commitment resource. Get a list of available commitments by making a + * list() request. + * + *

Sample code: * - * Sample code: *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
@@ -321,16 +316,18 @@ public final Commitment getRegionCommitment(ProjectRegionCommitmentName commitme
 
     GetRegionCommitmentHttpRequest request =
         GetRegionCommitmentHttpRequest.newBuilder()
-        .setCommitment(commitment == null ? null : commitment.toString())
-        .build();
+            .setCommitment(commitment == null ? null : commitment.toString())
+            .build();
     return getRegionCommitment(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified commitment resource. Get a list of available commitments by making a list() request.
+   * Returns the specified commitment resource. Get a list of available commitments by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
@@ -345,17 +342,17 @@ public final Commitment getRegionCommitment(ProjectRegionCommitmentName commitme
   public final Commitment getRegionCommitment(String commitment) {
 
     GetRegionCommitmentHttpRequest request =
-        GetRegionCommitmentHttpRequest.newBuilder()
-        .setCommitment(commitment)
-        .build();
+        GetRegionCommitmentHttpRequest.newBuilder().setCommitment(commitment).build();
     return getRegionCommitment(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified commitment resource. Get a list of available commitments by making a list() request.
+   * Returns the specified commitment resource. Get a list of available commitments by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
@@ -376,9 +373,11 @@ public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified commitment resource. Get a list of available commitments by making a list() request.
+   * Returns the specified commitment resource. Get a list of available commitments by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]");
@@ -392,7 +391,8 @@ public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getRegionCommitmentCallable() { + public final UnaryCallable + getRegionCommitmentCallable() { return stub.getRegionCommitmentCallable(); } @@ -400,7 +400,8 @@ public final UnaryCallable getRegion /** * Creates a commitment in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
@@ -410,26 +411,36 @@ public final UnaryCallable getRegion
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. - * - * Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==) + * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource + * means that you are purchasing a committed use contract with an explicit start and end time. + * You can create commitments based on vCPUs and memory usage and receive discounted rates. + * For full details, read Signing Up for Committed Use Discounts. + *

Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. + * By purchasing a committed use discount, you agree to these terms. Committed use discounts + * will not renew, so you must purchase a new commitment to continue receiving discounts. (== + * resource_for beta.commitments ==) (== resource_for v1.commitments ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionCommitment(String requestId, ProjectRegionName region, Commitment commitmentResource) { + public final Operation insertRegionCommitment( + String requestId, ProjectRegionName region, Commitment commitmentResource) { InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setCommitmentResource(commitmentResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setCommitmentResource(commitmentResource) + .build(); return insertRegionCommitment(request); } @@ -437,7 +448,8 @@ public final Operation insertRegionCommitment(String requestId, ProjectRegionNam /** * Creates a commitment in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
@@ -447,26 +459,36 @@ public final Operation insertRegionCommitment(String requestId, ProjectRegionNam
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. - * - * Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==) + * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource + * means that you are purchasing a committed use contract with an explicit start and end time. + * You can create commitments based on vCPUs and memory usage and receive discounted rates. + * For full details, read Signing Up for Committed Use Discounts. + *

Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. + * By purchasing a committed use discount, you agree to these terms. Committed use discounts + * will not renew, so you must purchase a new commitment to continue receiving discounts. (== + * resource_for beta.commitments ==) (== resource_for v1.commitments ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionCommitment(String requestId, String region, Commitment commitmentResource) { + public final Operation insertRegionCommitment( + String requestId, String region, Commitment commitmentResource) { InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setCommitmentResource(commitmentResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setCommitmentResource(commitmentResource) + .build(); return insertRegionCommitment(request); } @@ -474,7 +496,8 @@ public final Operation insertRegionCommitment(String requestId, String region, C /** * Creates a commitment in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
@@ -501,7 +524,8 @@ public final Operation insertRegionCommitment(InsertRegionCommitmentHttpRequest
   /**
    * Creates a commitment in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   String requestId = "";
@@ -519,7 +543,8 @@ public final Operation insertRegionCommitment(InsertRegionCommitmentHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertRegionCommitmentCallable() { + public final UnaryCallable + insertRegionCommitmentCallable() { return stub.insertRegionCommitmentCallable(); } @@ -527,7 +552,8 @@ public final UnaryCallable insertR /** * Retrieves a list of commitments contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -544,8 +570,8 @@ public final UnaryCallable insertR
   public final ListRegionCommitmentsPagedResponse listRegionCommitments(ProjectRegionName region) {
     ListRegionCommitmentsHttpRequest request =
         ListRegionCommitmentsHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRegionCommitments(request);
   }
 
@@ -553,7 +579,8 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(ProjectReg
   /**
    * Retrieves a list of commitments contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -569,9 +596,7 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(ProjectReg
   @BetaApi
   public final ListRegionCommitmentsPagedResponse listRegionCommitments(String region) {
     ListRegionCommitmentsHttpRequest request =
-        ListRegionCommitmentsHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionCommitmentsHttpRequest.newBuilder().setRegion(region).build();
     return listRegionCommitments(request);
   }
 
@@ -579,7 +604,8 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(String reg
   /**
    * Retrieves a list of commitments contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -596,16 +622,17 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionCommitmentsPagedResponse listRegionCommitments(ListRegionCommitmentsHttpRequest request) {
-    return listRegionCommitmentsPagedCallable()
-        .call(request);
+  public final ListRegionCommitmentsPagedResponse listRegionCommitments(
+      ListRegionCommitmentsHttpRequest request) {
+    return listRegionCommitmentsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of commitments contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -621,7 +648,8 @@ public final ListRegionCommitmentsPagedResponse listRegionCommitments(ListRegion
    * 
*/ @BetaApi - public final UnaryCallable listRegionCommitmentsPagedCallable() { + public final UnaryCallable + listRegionCommitmentsPagedCallable() { return stub.listRegionCommitmentsPagedCallable(); } @@ -629,7 +657,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -652,12 +681,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionCommitmentsCallable() { + public final UnaryCallable + listRegionCommitmentsCallable() { return stub.listRegionCommitmentsCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -686,23 +716,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListRegionCommitmentsPagedResponse extends AbstractPagedListResponse< - AggregatedListRegionCommitmentsHttpRequest, - CommitmentAggregatedList, - CommitmentsScopedList, - AggregatedListRegionCommitmentsPage, - AggregatedListRegionCommitmentsFixedSizeCollection> { + public static class AggregatedListRegionCommitmentsPagedResponse + extends AbstractPagedListResponse< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList, AggregatedListRegionCommitmentsPage, + AggregatedListRegionCommitmentsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListRegionCommitmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListRegionCommitmentsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListRegionCommitmentsPage, AggregatedListRegionCommitmentsPagedResponse>() { @Override - public AggregatedListRegionCommitmentsPagedResponse apply(AggregatedListRegionCommitmentsPage input) { + public AggregatedListRegionCommitmentsPagedResponse apply( + AggregatedListRegionCommitmentsPage input) { return new AggregatedListRegionCommitmentsPagedResponse(input); } }); @@ -711,18 +746,18 @@ public AggregatedListRegionCommitmentsPagedResponse apply(AggregatedListRegionCo private AggregatedListRegionCommitmentsPagedResponse(AggregatedListRegionCommitmentsPage page) { super(page, AggregatedListRegionCommitmentsFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListRegionCommitmentsPage extends AbstractPage< - AggregatedListRegionCommitmentsHttpRequest, - CommitmentAggregatedList, - CommitmentsScopedList, - AggregatedListRegionCommitmentsPage> { + public static class AggregatedListRegionCommitmentsPage + extends AbstractPage< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList, AggregatedListRegionCommitmentsPage> { private AggregatedListRegionCommitmentsPage( - PageContext context, + PageContext< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList> + context, CommitmentAggregatedList response) { super(context, response); } @@ -733,31 +768,33 @@ private static AggregatedListRegionCommitmentsPage createEmptyPage() { @Override protected AggregatedListRegionCommitmentsPage createPage( - PageContext context, + PageContext< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList> + context, CommitmentAggregatedList response) { return new AggregatedListRegionCommitmentsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListRegionCommitmentsFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListRegionCommitmentsHttpRequest, - CommitmentAggregatedList, - CommitmentsScopedList, - AggregatedListRegionCommitmentsPage, - AggregatedListRegionCommitmentsFixedSizeCollection> { + public static class AggregatedListRegionCommitmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + CommitmentsScopedList, AggregatedListRegionCommitmentsPage, + AggregatedListRegionCommitmentsFixedSizeCollection> { - private AggregatedListRegionCommitmentsFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListRegionCommitmentsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -770,15 +807,12 @@ protected AggregatedListRegionCommitmentsFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListRegionCommitmentsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListRegionCommitmentsPagedResponse extends AbstractPagedListResponse< - ListRegionCommitmentsHttpRequest, - CommitmentList, - Commitment, - ListRegionCommitmentsPage, - ListRegionCommitmentsFixedSizeCollection> { + + public static class ListRegionCommitmentsPagedResponse + extends AbstractPagedListResponse< + ListRegionCommitmentsHttpRequest, CommitmentList, Commitment, ListRegionCommitmentsPage, + ListRegionCommitmentsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -798,15 +832,11 @@ public ListRegionCommitmentsPagedResponse apply(ListRegionCommitmentsPage input) private ListRegionCommitmentsPagedResponse(ListRegionCommitmentsPage page) { super(page, ListRegionCommitmentsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionCommitmentsPage extends AbstractPage< - ListRegionCommitmentsHttpRequest, - CommitmentList, - Commitment, - ListRegionCommitmentsPage> { + public static class ListRegionCommitmentsPage + extends AbstractPage< + ListRegionCommitmentsHttpRequest, CommitmentList, Commitment, ListRegionCommitmentsPage> { private ListRegionCommitmentsPage( PageContext context, @@ -831,20 +861,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionCommitmentsFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionCommitmentsHttpRequest, - CommitmentList, - Commitment, - ListRegionCommitmentsPage, - ListRegionCommitmentsFixedSizeCollection> { + public static class ListRegionCommitmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionCommitmentsHttpRequest, CommitmentList, Commitment, ListRegionCommitmentsPage, + ListRegionCommitmentsFixedSizeCollection> { - private ListRegionCommitmentsFixedSizeCollection(List pages, int collectionSize) { + private ListRegionCommitmentsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -857,7 +882,5 @@ protected ListRegionCommitmentsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionCommitmentsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java index 38afd85d590a..4130d0ae75b8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; import com.google.cloud.compute.v1.stub.RegionCommitmentStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getRegionCommitment to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegionCommitment to 30 seconds: * *

  * 
@@ -86,77 +64,66 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionCommitmentSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListRegionCommitments.
-   */
-  public PagedCallSettings aggregatedListRegionCommitmentsSettings() {
-    return ((RegionCommitmentStubSettings) getStubSettings()).aggregatedListRegionCommitmentsSettings();
-  }
-
-  /**
-   * Returns the object with the settings used for calls to getRegionCommitment.
-   */
-  public UnaryCallSettings getRegionCommitmentSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListRegionCommitments. */
+  public PagedCallSettings<
+          AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+          AggregatedListRegionCommitmentsPagedResponse>
+      aggregatedListRegionCommitmentsSettings() {
+    return ((RegionCommitmentStubSettings) getStubSettings())
+        .aggregatedListRegionCommitmentsSettings();
+  }
+
+  /** Returns the object with the settings used for calls to getRegionCommitment. */
+  public UnaryCallSettings
+      getRegionCommitmentSettings() {
     return ((RegionCommitmentStubSettings) getStubSettings()).getRegionCommitmentSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionCommitment.
-   */
-  public UnaryCallSettings insertRegionCommitmentSettings() {
+  /** Returns the object with the settings used for calls to insertRegionCommitment. */
+  public UnaryCallSettings
+      insertRegionCommitmentSettings() {
     return ((RegionCommitmentStubSettings) getStubSettings()).insertRegionCommitmentSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionCommitments.
-   */
-  public PagedCallSettings listRegionCommitmentsSettings() {
+  /** Returns the object with the settings used for calls to listRegionCommitments. */
+  public PagedCallSettings<
+          ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse>
+      listRegionCommitmentsSettings() {
     return ((RegionCommitmentStubSettings) getStubSettings()).listRegionCommitmentsSettings();
   }
 
-
-  public static final RegionCommitmentSettings create(RegionCommitmentStubSettings stub) throws IOException {
+  public static final RegionCommitmentSettings create(RegionCommitmentStubSettings stub)
+      throws IOException {
     return new RegionCommitmentSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionCommitmentStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionCommitmentStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionCommitmentStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionCommitmentStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionCommitmentStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionCommitmentStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionCommitmentStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -169,23 +136,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionCommitmentStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -194,9 +155,7 @@ protected RegionCommitmentSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionCommitmentSettings.
-   */
+  /** Builder for RegionCommitmentSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -218,46 +177,47 @@ protected Builder(RegionCommitmentStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionCommitmentStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionCommitmentStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListRegionCommitments. - */ - public PagedCallSettings.Builder aggregatedListRegionCommitmentsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListRegionCommitments. */ + public PagedCallSettings.Builder< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + AggregatedListRegionCommitmentsPagedResponse> + aggregatedListRegionCommitmentsSettings() { return getStubSettingsBuilder().aggregatedListRegionCommitmentsSettings(); } - /** - * Returns the builder for the settings used for calls to getRegionCommitment. - */ - public UnaryCallSettings.Builder getRegionCommitmentSettings() { + /** Returns the builder for the settings used for calls to getRegionCommitment. */ + public UnaryCallSettings.Builder + getRegionCommitmentSettings() { return getStubSettingsBuilder().getRegionCommitmentSettings(); } - /** - * Returns the builder for the settings used for calls to insertRegionCommitment. - */ - public UnaryCallSettings.Builder insertRegionCommitmentSettings() { + /** Returns the builder for the settings used for calls to insertRegionCommitment. */ + public UnaryCallSettings.Builder + insertRegionCommitmentSettings() { return getStubSettingsBuilder().insertRegionCommitmentSettings(); } - /** - * Returns the builder for the settings used for calls to listRegionCommitments. - */ - public PagedCallSettings.Builder listRegionCommitmentsSettings() { + /** Returns the builder for the settings used for calls to listRegionCommitments. */ + public PagedCallSettings.Builder< + ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse> + listRegionCommitmentsSettings() { return getStubSettingsBuilder().listRegionCommitmentsSettings(); } @@ -266,4 +226,4 @@ public RegionCommitmentSettings build() throws IOException { return new RegionCommitmentSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java index 9ebce541d9c1..c2a70a5cf5cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionInstanceGroupStub; import com.google.cloud.compute.v1.stub.RegionInstanceGroupStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,34 @@ * *

* - *

Note: close() needs to be called on the regionInstanceGroupClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the regionInstanceGroupClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of RegionInstanceGroupSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class RegionInstanceGroupClient implements BackgroundResource {
   private final RegionInstanceGroupSettings settings;
   private final RegionInstanceGroupStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionInstanceGroupClient with default settings.
-   */
+  /** Constructs an instance of RegionInstanceGroupClient with default settings. */
   public static final RegionInstanceGroupClient create() throws IOException {
     return create(RegionInstanceGroupSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionInstanceGroupClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final RegionInstanceGroupClient create(RegionInstanceGroupSettings settings) throws IOException {
+  public static final RegionInstanceGroupClient create(RegionInstanceGroupSettings settings)
+      throws IOException {
     return new RegionInstanceGroupClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionInstanceGroupSettings}.
+   * Constructs an instance of RegionInstanceGroupClient, using the given stub for making calls.
+   * This is for advanced usage - prefer to use RegionInstanceGroupSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionInstanceGroupClient create(RegionInstanceGroupStub stub) {
@@ -143,9 +129,9 @@ public static final RegionInstanceGroupClient create(RegionInstanceGroupStub stu
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionInstanceGroupClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
   protected RegionInstanceGroupClient(RegionInstanceGroupSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public RegionInstanceGroupStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Returns the specified instance group resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -188,8 +174,8 @@ public final InstanceGroup getRegionInstanceGroup(ProjectRegionInstanceGroupName
 
     GetRegionInstanceGroupHttpRequest request =
         GetRegionInstanceGroupHttpRequest.newBuilder()
-        .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString())
-        .build();
+            .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString())
+            .build();
     return getRegionInstanceGroup(request);
   }
 
@@ -197,7 +183,8 @@ public final InstanceGroup getRegionInstanceGroup(ProjectRegionInstanceGroupName
   /**
    * Returns the specified instance group resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -212,9 +199,7 @@ public final InstanceGroup getRegionInstanceGroup(ProjectRegionInstanceGroupName
   public final InstanceGroup getRegionInstanceGroup(String instanceGroup) {
 
     GetRegionInstanceGroupHttpRequest request =
-        GetRegionInstanceGroupHttpRequest.newBuilder()
-        .setInstanceGroup(instanceGroup)
-        .build();
+        GetRegionInstanceGroupHttpRequest.newBuilder().setInstanceGroup(instanceGroup).build();
     return getRegionInstanceGroup(request);
   }
 
@@ -222,7 +207,8 @@ public final InstanceGroup getRegionInstanceGroup(String instanceGroup) {
   /**
    * Returns the specified instance group resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -245,7 +231,8 @@ public final InstanceGroup getRegionInstanceGroup(GetRegionInstanceGroupHttpRequ
   /**
    * Returns the specified instance group resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -259,7 +246,8 @@ public final InstanceGroup getRegionInstanceGroup(GetRegionInstanceGroupHttpRequ
    * 
*/ @BetaApi - public final UnaryCallable getRegionInstanceGroupCallable() { + public final UnaryCallable + getRegionInstanceGroupCallable() { return stub.getRegionInstanceGroupCallable(); } @@ -267,7 +255,8 @@ public final UnaryCallable get /** * Retrieves the list of instance group resources contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -281,11 +270,12 @@ public final UnaryCallable get
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(ProjectRegionName region) {
+  public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(
+      ProjectRegionName region) {
     ListRegionInstanceGroupsHttpRequest request =
         ListRegionInstanceGroupsHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRegionInstanceGroups(request);
   }
 
@@ -293,7 +283,8 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(Proj
   /**
    * Retrieves the list of instance group resources contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -309,9 +300,7 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(Proj
   @BetaApi
   public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(String region) {
     ListRegionInstanceGroupsHttpRequest request =
-        ListRegionInstanceGroupsHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionInstanceGroupsHttpRequest.newBuilder().setRegion(region).build();
     return listRegionInstanceGroups(request);
   }
 
@@ -319,7 +308,8 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(Stri
   /**
    * Retrieves the list of instance group resources contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -336,16 +326,17 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(Stri
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(ListRegionInstanceGroupsHttpRequest request) {
-    return listRegionInstanceGroupsPagedCallable()
-        .call(request);
+  public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(
+      ListRegionInstanceGroupsHttpRequest request) {
+    return listRegionInstanceGroupsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of instance group resources contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -361,7 +352,9 @@ public final ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(List
    * 
*/ @BetaApi - public final UnaryCallable listRegionInstanceGroupsPagedCallable() { + public final UnaryCallable< + ListRegionInstanceGroupsHttpRequest, ListRegionInstanceGroupsPagedResponse> + listRegionInstanceGroupsPagedCallable() { return stub.listRegionInstanceGroupsPagedCallable(); } @@ -369,7 +362,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -392,15 +386,19 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionInstanceGroupsCallable() { + public final UnaryCallable + listRegionInstanceGroupsCallable() { return stub.listRegionInstanceGroupsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -411,25 +409,32 @@ public final UnaryCallable
* - * @param instanceGroup Name of the regional instance group for which we want to list the instances. + * @param instanceGroup Name of the regional instance group for which we want to list the + * instances. * @param regionInstanceGroupsListInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { + public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups( + ProjectRegionInstanceGroupName instanceGroup, + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder() - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource) - .build(); + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setRegionInstanceGroupsListInstancesRequestResource( + regionInstanceGroupsListInstancesRequestResource) + .build(); return listInstancesRegionInstanceGroups(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -440,25 +445,32 @@ public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionI
    * }
    * 
* - * @param instanceGroup Name of the regional instance group for which we want to list the instances. + * @param instanceGroup Name of the regional instance group for which we want to list the + * instances. * @param regionInstanceGroupsListInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(String instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { + public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups( + String instanceGroup, + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource) { ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder() - .setInstanceGroup(instanceGroup) - .setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource) - .build(); + .setInstanceGroup(instanceGroup) + .setRegionInstanceGroupsListInstancesRequestResource( + regionInstanceGroupsListInstancesRequestResource) + .build(); return listInstancesRegionInstanceGroups(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -477,16 +489,19 @@ public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionI
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(ListInstancesRegionInstanceGroupsHttpRequest request) {
-    return listInstancesRegionInstanceGroupsPagedCallable()
-        .call(request);
+  public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(
+      ListInstancesRegionInstanceGroupsHttpRequest request) {
+    return listInstancesRegionInstanceGroupsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -504,15 +519,21 @@ public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionI
    * 
*/ @BetaApi - public final UnaryCallable listInstancesRegionInstanceGroupsPagedCallable() { + public final UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, + ListInstancesRegionInstanceGroupsPagedResponse> + listInstancesRegionInstanceGroupsPagedCallable() { return stub.listInstancesRegionInstanceGroupsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
@@ -537,7 +558,9 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listInstancesRegionInstanceGroupsCallable() { + public final UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances> + listInstancesRegionInstanceGroupsCallable() { return stub.listInstancesRegionInstanceGroupsCallable(); } @@ -545,7 +568,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   String requestId = "";
@@ -555,24 +579,32 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param regionInstanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsRegionInstanceGroup(String requestId, ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsRegionInstanceGroup( + String requestId, + ProjectRegionInstanceGroupName instanceGroup, + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) - .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) + .setRegionInstanceGroupsSetNamedPortsRequestResource( + regionInstanceGroupsSetNamedPortsRequestResource) + .build(); return setNamedPortsRegionInstanceGroup(request); } @@ -580,7 +612,8 @@ public final Operation setNamedPortsRegionInstanceGroup(String requestId, Projec /** * Sets the named ports for the specified regional instance group. * - * Sample code: + *

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   String requestId = "";
@@ -590,24 +623,32 @@ public final Operation setNamedPortsRegionInstanceGroup(String requestId, Projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param regionInstanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setNamedPortsRegionInstanceGroup(String requestId, String instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + public final Operation setNamedPortsRegionInstanceGroup( + String requestId, + String instanceGroup, + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup) - .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroup(instanceGroup) + .setRegionInstanceGroupsSetNamedPortsRequestResource( + regionInstanceGroupsSetNamedPortsRequestResource) + .build(); return setNamedPortsRegionInstanceGroup(request); } @@ -615,7 +656,8 @@ public final Operation setNamedPortsRegionInstanceGroup(String requestId, String /** * Sets the named ports for the specified regional instance group. * - * Sample code: + *

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   String requestId = "";
@@ -634,7 +676,8 @@ public final Operation setNamedPortsRegionInstanceGroup(String requestId, String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInstanceGroupHttpRequest request) {
+  public final Operation setNamedPortsRegionInstanceGroup(
+      SetNamedPortsRegionInstanceGroupHttpRequest request) {
     return setNamedPortsRegionInstanceGroupCallable().call(request);
   }
 
@@ -642,7 +685,8 @@ public final Operation setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInsta
   /**
    * Sets the named ports for the specified regional instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
    *   String requestId = "";
@@ -660,12 +704,13 @@ public final Operation setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInsta
    * 
*/ @BetaApi - public final UnaryCallable setNamedPortsRegionInstanceGroupCallable() { + public final UnaryCallable + setNamedPortsRegionInstanceGroupCallable() { return stub.setNamedPortsRegionInstanceGroupCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -694,15 +739,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionInstanceGroupsPagedResponse extends AbstractPagedListResponse< - ListRegionInstanceGroupsHttpRequest, - RegionInstanceGroupList, - InstanceGroup, - ListRegionInstanceGroupsPage, - ListRegionInstanceGroupsFixedSizeCollection> { + public static class ListRegionInstanceGroupsPagedResponse + extends AbstractPagedListResponse< + ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, InstanceGroup, + ListRegionInstanceGroupsPage, ListRegionInstanceGroupsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListRegionInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -719,18 +763,16 @@ public ListRegionInstanceGroupsPagedResponse apply(ListRegionInstanceGroupsPage private ListRegionInstanceGroupsPagedResponse(ListRegionInstanceGroupsPage page) { super(page, ListRegionInstanceGroupsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionInstanceGroupsPage extends AbstractPage< - ListRegionInstanceGroupsHttpRequest, - RegionInstanceGroupList, - InstanceGroup, - ListRegionInstanceGroupsPage> { + public static class ListRegionInstanceGroupsPage + extends AbstractPage< + ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, InstanceGroup, + ListRegionInstanceGroupsPage> { private ListRegionInstanceGroupsPage( - PageContext context, + PageContext + context, RegionInstanceGroupList response) { super(context, response); } @@ -741,31 +783,28 @@ private static ListRegionInstanceGroupsPage createEmptyPage() { @Override protected ListRegionInstanceGroupsPage createPage( - PageContext context, + PageContext + context, RegionInstanceGroupList response) { return new ListRegionInstanceGroupsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionInstanceGroupsHttpRequest, - RegionInstanceGroupList, - InstanceGroup, - ListRegionInstanceGroupsPage, - ListRegionInstanceGroupsFixedSizeCollection> { + public static class ListRegionInstanceGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, InstanceGroup, + ListRegionInstanceGroupsPage, ListRegionInstanceGroupsFixedSizeCollection> { - private ListRegionInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + private ListRegionInstanceGroupsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -778,46 +817,52 @@ protected ListRegionInstanceGroupsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionInstanceGroupsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListInstancesRegionInstanceGroupsPagedResponse extends AbstractPagedListResponse< - ListInstancesRegionInstanceGroupsHttpRequest, - RegionInstanceGroupsListInstances, - InstanceWithNamedPorts, - ListInstancesRegionInstanceGroupsPage, - ListInstancesRegionInstanceGroupsFixedSizeCollection> { + + public static class ListInstancesRegionInstanceGroupsPagedResponse + extends AbstractPagedListResponse< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts, ListInstancesRegionInstanceGroupsPage, + ListInstancesRegionInstanceGroupsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts> + context, ApiFuture futureResponse) { ApiFuture futurePage = - ListInstancesRegionInstanceGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + ListInstancesRegionInstanceGroupsPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + ListInstancesRegionInstanceGroupsPage, + ListInstancesRegionInstanceGroupsPagedResponse>() { @Override - public ListInstancesRegionInstanceGroupsPagedResponse apply(ListInstancesRegionInstanceGroupsPage input) { + public ListInstancesRegionInstanceGroupsPagedResponse apply( + ListInstancesRegionInstanceGroupsPage input) { return new ListInstancesRegionInstanceGroupsPagedResponse(input); } }); } - private ListInstancesRegionInstanceGroupsPagedResponse(ListInstancesRegionInstanceGroupsPage page) { + private ListInstancesRegionInstanceGroupsPagedResponse( + ListInstancesRegionInstanceGroupsPage page) { super(page, ListInstancesRegionInstanceGroupsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListInstancesRegionInstanceGroupsPage extends AbstractPage< - ListInstancesRegionInstanceGroupsHttpRequest, - RegionInstanceGroupsListInstances, - InstanceWithNamedPorts, - ListInstancesRegionInstanceGroupsPage> { + public static class ListInstancesRegionInstanceGroupsPage + extends AbstractPage< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts, ListInstancesRegionInstanceGroupsPage> { private ListInstancesRegionInstanceGroupsPage( - PageContext context, + PageContext< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts> + context, RegionInstanceGroupsListInstances response) { super(context, response); } @@ -828,31 +873,33 @@ private static ListInstancesRegionInstanceGroupsPage createEmptyPage() { @Override protected ListInstancesRegionInstanceGroupsPage createPage( - PageContext context, + PageContext< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts> + context, RegionInstanceGroupsListInstances response) { return new ListInstancesRegionInstanceGroupsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListInstancesRegionInstanceGroupsFixedSizeCollection extends AbstractFixedSizeCollection< - ListInstancesRegionInstanceGroupsHttpRequest, - RegionInstanceGroupsListInstances, - InstanceWithNamedPorts, - ListInstancesRegionInstanceGroupsPage, - ListInstancesRegionInstanceGroupsFixedSizeCollection> { + public static class ListInstancesRegionInstanceGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + InstanceWithNamedPorts, ListInstancesRegionInstanceGroupsPage, + ListInstancesRegionInstanceGroupsFixedSizeCollection> { - private ListInstancesRegionInstanceGroupsFixedSizeCollection(List pages, int collectionSize) { + private ListInstancesRegionInstanceGroupsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -865,7 +912,5 @@ protected ListInstancesRegionInstanceGroupsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListInstancesRegionInstanceGroupsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java index 4b0df4b6c523..c32961fffa4e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private RegionInstanceGroupList() { this.warning = null; } - private RegionInstanceGroupList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public RegionInstanceGroupList build() { - - - - - return new RegionInstanceGroupList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new RegionInstanceGroupList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupList) { RegionInstanceGroupList that = (RegionInstanceGroupList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java index cb5d6b5b7584..6afd89cbc3b4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStub; import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,34 +50,34 @@ *
*
* - *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of RegionInstanceGroupManagerSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of + * RegionInstanceGroupManagerSettings to create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -117,27 +107,24 @@ public class RegionInstanceGroupManagerClient implements BackgroundResource {
   private final RegionInstanceGroupManagerSettings settings;
   private final RegionInstanceGroupManagerStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionInstanceGroupManagerClient with default settings.
-   */
+  /** Constructs an instance of RegionInstanceGroupManagerClient with default settings. */
   public static final RegionInstanceGroupManagerClient create() throws IOException {
     return create(RegionInstanceGroupManagerSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. The
+   * channels are created based on the settings passed in, or defaults for any settings that are not
+   * set.
    */
-  public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerSettings settings) throws IOException {
+  public static final RegionInstanceGroupManagerClient create(
+      RegionInstanceGroupManagerSettings settings) throws IOException {
     return new RegionInstanceGroupManagerClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionInstanceGroupManagerSettings}.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making
+   * calls. This is for advanced usage - prefer to use RegionInstanceGroupManagerSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerStub stub) {
@@ -145,11 +132,12 @@ public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupM
   }
 
   /**
-   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionInstanceGroupManagerClient, using the given settings. This is
+   * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+   * should be preferred.
    */
-  protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings) throws IOException {
+  protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings)
+      throws IOException {
     this.settings = settings;
     this.stub = ((RegionInstanceGroupManagerStubSettings) settings.getStubSettings()).createStub();
   }
@@ -169,16 +157,24 @@ public RegionInstanceGroupManagerStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -188,36 +184,55 @@ public RegionInstanceGroupManagerStub getStub() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesRegionInstanceGroupManager( + String requestId, + ProjectRegionInstanceGroupManagerName instanceGroupManager, + RegionInstanceGroupManagersAbandonInstancesRequest + regionInstanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersAbandonInstancesRequestResource( + regionInstanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -227,36 +242,54 @@ public final Operation abandonInstancesRegionInstanceGroupManager(String request
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation abandonInstancesRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { + public final Operation abandonInstancesRegionInstanceGroupManager( + String requestId, + String instanceGroupManager, + RegionInstanceGroupManagersAbandonInstancesRequest + regionInstanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersAbandonInstancesRequestResource( + regionInstanceGroupManagersAbandonInstancesRequestResource) + .build(); return abandonInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to remove the specified instances 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. + * Schedules a group action to remove the specified instances 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -275,19 +308,29 @@ public final Operation abandonInstancesRegionInstanceGroupManager(String request
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation abandonInstancesRegionInstanceGroupManager(
+      AbandonInstancesRegionInstanceGroupManagerHttpRequest request) {
     return abandonInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to remove the specified instances 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.
+   * Schedules a group action to remove the specified instances 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.
+   * 

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -305,7 +348,8 @@ public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstanc
    * 
*/ @BetaApi - public final UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable + abandonInstancesRegionInstanceGroupManagerCallable() { return stub.abandonInstancesRegionInstanceGroupManagerCallable(); } @@ -313,7 +357,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -322,22 +367,28 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { + public final Operation deleteRegionInstanceGroupManager( + String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return deleteRegionInstanceGroupManager(request); } @@ -345,7 +396,8 @@ public final Operation deleteRegionInstanceGroupManager(String requestId, Projec /** * Deletes the specified managed instance group and all of the instances in that group. * - * Sample code: + *

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -354,22 +406,27 @@ public final Operation deleteRegionInstanceGroupManager(String requestId, Projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionInstanceGroupManager(String requestId, String instanceGroupManager) { + public final Operation deleteRegionInstanceGroupManager( + String requestId, String instanceGroupManager) { DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return deleteRegionInstanceGroupManager(request); } @@ -377,7 +434,8 @@ public final Operation deleteRegionInstanceGroupManager(String requestId, String /** * Deletes the specified managed instance group and all of the instances in that group. * - * Sample code: + *

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -394,7 +452,8 @@ public final Operation deleteRegionInstanceGroupManager(String requestId, String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteRegionInstanceGroupManager(
+      DeleteRegionInstanceGroupManagerHttpRequest request) {
     return deleteRegionInstanceGroupManagerCallable().call(request);
   }
 
@@ -402,7 +461,8 @@ public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGrou
   /**
    * Deletes the specified managed instance group and all of the instances in that group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -418,19 +478,28 @@ public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable deleteRegionInstanceGroupManagerCallable() { + public final UnaryCallable + deleteRegionInstanceGroupManagerCallable() { return stub.deleteRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. + *

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -440,36 +509,54 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesRegionInstanceGroupManager( + String requestId, + ProjectRegionInstanceGroupManagerName instanceGroupManager, + RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersDeleteInstancesRequestResource( + regionInstanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -479,36 +566,53 @@ public final Operation deleteInstancesRegionInstanceGroupManager(String requestI
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstancesRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { + public final Operation deleteInstancesRegionInstanceGroupManager( + String requestId, + String instanceGroupManager, + RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersDeleteInstancesRequestResource( + regionInstanceGroupManagersDeleteInstancesRequestResource) + .build(); return deleteInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to delete the specified instances in the managed instance group. 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. + * Schedules a group action to delete the specified instances in the managed instance group. 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -527,19 +631,28 @@ public final Operation deleteInstancesRegionInstanceGroupManager(String requestI
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation deleteInstancesRegionInstanceGroupManager(
+      DeleteInstancesRegionInstanceGroupManagerHttpRequest request) {
     return deleteInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to delete the specified instances in the managed instance group. 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.
+   * Schedules a group action to delete the specified instances in the managed instance group. 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -557,7 +670,8 @@ public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstances
    * 
*/ @BetaApi - public final UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable + deleteInstancesRegionInstanceGroupManagerCallable() { return stub.deleteInstancesRegionInstanceGroupManagerCallable(); } @@ -565,7 +679,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -577,12 +692,14 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -606,8 +724,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
 
     GetRegionInstanceGroupManagerHttpRequest request =
         GetRegionInstanceGroupManagerHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return getRegionInstanceGroupManager(request);
   }
 
@@ -615,7 +733,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -630,7 +749,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(String instanceG
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanceGroupManagerHttpRequest request) {
+  public final InstanceGroupManager getRegionInstanceGroupManager(
+      GetRegionInstanceGroupManagerHttpRequest request) {
     return getRegionInstanceGroupManagerCallable().call(request);
   }
 
@@ -638,7 +758,8 @@ public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanc
   /**
    * Returns all of the details about the specified managed instance group.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -652,17 +773,23 @@ public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanc
    * 
*/ @BetaApi - public final UnaryCallable getRegionInstanceGroupManagerCallable() { + public final UnaryCallable + getRegionInstanceGroupManagerCallable() { return stub.getRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. * - * A regional managed instance group can contain up to 2000 instances. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -672,34 +799,49 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionInstanceGroupManager(String requestId, ProjectRegionName region, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertRegionInstanceGroupManager( + String requestId, + ProjectRegionName region, + InstanceGroupManager instanceGroupManagerResource) { InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. * - * A regional managed instance group can contain up to 2000 instances. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -709,34 +851,47 @@ public final Operation insertRegionInstanceGroupManager(String requestId, Projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionInstanceGroupManager(String requestId, String region, InstanceGroupManager instanceGroupManagerResource) { + public final Operation insertRegionInstanceGroupManager( + String requestId, String region, InstanceGroupManager instanceGroupManagerResource) { InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setInstanceGroupManagerResource(instanceGroupManagerResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .build(); return insertRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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. + * Creates a managed instance group using the information that you specify in the request. After + * the group is created, it schedules an action to create instances in the group 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. * - * A regional managed instance group can contain up to 2000 instances. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -755,17 +910,23 @@ public final Operation insertRegionInstanceGroupManager(String requestId, String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation insertRegionInstanceGroupManager(
+      InsertRegionInstanceGroupManagerHttpRequest request) {
     return insertRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.
+   * Creates a managed instance group using the information that you specify in the request. After
+   * the group is created, it schedules an action to create instances in the group 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. * - * A regional managed instance group can contain up to 2000 instances. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -783,7 +944,8 @@ public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable insertRegionInstanceGroupManagerCallable() { + public final UnaryCallable + insertRegionInstanceGroupManagerCallable() { return stub.insertRegionInstanceGroupManagerCallable(); } @@ -791,7 +953,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -805,11 +968,12 @@ public final UnaryCallableSample code:
+   *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -831,11 +996,10 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(String region) {
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
+      String region) {
     ListRegionInstanceGroupManagersHttpRequest request =
-        ListRegionInstanceGroupManagersHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionInstanceGroupManagersHttpRequest.newBuilder().setRegion(region).build();
     return listRegionInstanceGroupManagers(request);
   }
 
@@ -843,7 +1007,8 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -860,16 +1025,17 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(ListRegionInstanceGroupManagersHttpRequest request) {
-    return listRegionInstanceGroupManagersPagedCallable()
-        .call(request);
+  public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(
+      ListRegionInstanceGroupManagersHttpRequest request) {
+    return listRegionInstanceGroupManagersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of managed instance groups that are contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -885,7 +1051,9 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable listRegionInstanceGroupManagersPagedCallable() { + public final UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersPagedCallable() { return stub.listRegionInstanceGroupManagersPagedCallable(); } @@ -893,7 +1061,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -916,15 +1085,19 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionInstanceGroupManagersCallable() { + public final UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList> + listRegionInstanceGroupManagersCallable() { return stub.listRegionInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -936,20 +1109,25 @@ public final UnaryCallableSample code:
    *
-   * Sample code:
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -961,20 +1139,23 @@ public final RegionInstanceGroupManagersListInstancesResponse listManagedInstanc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) {
+  public final RegionInstanceGroupManagersListInstancesResponse
+      listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager) {
 
     ListManagedInstancesRegionInstanceGroupManagersHttpRequest request =
         ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
-        .setInstanceGroupManager(instanceGroupManager)
-        .build();
+            .setInstanceGroupManager(instanceGroupManager)
+            .build();
     return listManagedInstancesRegionInstanceGroupManagers(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -989,15 +1170,19 @@ public final RegionInstanceGroupManagersListInstancesResponse listManagedInstanc
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) {
+  public final RegionInstanceGroupManagersListInstancesResponse
+      listManagedInstancesRegionInstanceGroupManagers(
+          ListManagedInstancesRegionInstanceGroupManagersHttpRequest request) {
     return listManagedInstancesRegionInstanceGroupManagersCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
@@ -1011,19 +1196,29 @@ public final RegionInstanceGroupManagersListInstancesResponse listManagedInstanc
    * 
*/ @BetaApi - public final UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { + public final UnaryCallable< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersCallable() { return stub.listManagedInstancesRegionInstanceGroupManagersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1033,36 +1228,53 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersRecreateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { + public final Operation recreateInstancesRegionInstanceGroupManager( + String requestId, + ProjectRegionInstanceGroupManagerName instanceGroupManager, + RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource) { RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersRecreateRequestResource( + regionInstanceGroupManagersRecreateRequestResource) + .build(); return recreateInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1072,36 +1284,52 @@ public final Operation recreateInstancesRegionInstanceGroupManager(String reques
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersRecreateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation recreateInstancesRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { + public final Operation recreateInstancesRegionInstanceGroupManager( + String requestId, + String instanceGroupManager, + RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource) { RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersRecreateRequestResource( + regionInstanceGroupManagersRecreateRequestResource) + .build(); return recreateInstancesRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * Schedules a group action to recreate the specified instances in the managed instance group. The + * instances are deleted and recreated using the current instance template for the managed + * instance group. This operation is marked as DONE when the action is scheduled even if the + * instances have not yet been recreated. You must separately verify the status of the recreating + * 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. * - * 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. * - * You can specify a maximum of 1000 instances with this method per request. + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1120,19 +1348,27 @@ public final Operation recreateInstancesRegionInstanceGroupManager(String reques
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInstancesRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation recreateInstancesRegionInstanceGroupManager(
+      RecreateInstancesRegionInstanceGroupManagerHttpRequest request) {
     return recreateInstancesRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
+   * Schedules a group action to recreate the specified instances in the managed instance group. The
+   * instances are deleted and recreated using the current instance template for the managed
+   * instance group. This operation is marked as DONE when the action is scheduled even if the
+   * instances have not yet been recreated. You must separately verify the status of the recreating
+   * 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.
+   * 

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. + *

You can specify a maximum of 1000 instances with this method per request. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1150,17 +1386,26 @@ public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInsta
    * 
*/ @BetaApi - public final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { + public final UnaryCallable + recreateInstancesRegionInstanceGroupManagerCallable() { return stub.recreateInstancesRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group + * schedules actions to create new instances using the current instance template. If you decrease + * the size, the group schedules delete actions on one or more 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. + * + *

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. * - * 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: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1171,33 +1416,47 @@ public final UnaryCallable
* * @param size Number of instances that should exist in this instance group manager. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeRegionInstanceGroupManager(Integer size, String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { + public final Operation resizeRegionInstanceGroupManager( + Integer size, String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .build(); return resizeRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group + * schedules actions to create new instances using the current instance template. If you decrease + * the size, the group schedules delete actions on one or more 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. + * + *

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. * - * 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: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1208,33 +1467,46 @@ public final Operation resizeRegionInstanceGroupManager(Integer size, String req
    * 
* * @param size Number of instances that should exist in this instance group manager. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeRegionInstanceGroupManager(Integer size, String requestId, String instanceGroupManager) { + public final Operation resizeRegionInstanceGroupManager( + Integer size, String requestId, String instanceGroupManager) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() - .setSize(size) - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .build(); + .setSize(size) + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .build(); return resizeRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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. + * Changes the intended size for the managed instance group. If you increase the size, the group + * schedules actions to create new instances using the current instance template. If you decrease + * the size, the group schedules delete actions on one or more 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. + * + *

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. * - * 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: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1253,17 +1525,26 @@ public final Operation resizeRegionInstanceGroupManager(Integer size, String req
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation resizeRegionInstanceGroupManager(
+      ResizeRegionInstanceGroupManagerHttpRequest request) {
     return resizeRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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.
+   * Changes the intended size for the managed instance group. If you increase the size, the group
+   * schedules actions to create new instances using the current instance template. If you decrease
+   * the size, the group schedules delete actions on one or more 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.
+   *
+   * 

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. * - * 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: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
@@ -1281,15 +1562,18 @@ public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGrou
    * 
*/ @BetaApi - public final UnaryCallable resizeRegionInstanceGroupManagerCallable() { + public final UnaryCallable + resizeRegionInstanceGroupManagerCallable() { return stub.resizeRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * Sets the instance template to use when creating new instances or recreating instances in this + * group. Existing instances are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1299,32 +1583,44 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param regionInstanceGroupManagersSetTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { + public final Operation setInstanceTemplateRegionInstanceGroupManager( + String requestId, + ProjectRegionInstanceGroupManagerName instanceGroupManager, + RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource) { SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersSetTemplateRequestResource( + regionInstanceGroupManagersSetTemplateRequestResource) + .build(); return setInstanceTemplateRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * Sets the instance template to use when creating new instances or recreating instances in this + * group. Existing instances are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1334,32 +1630,43 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(String requ
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param regionInstanceGroupManagersSetTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setInstanceTemplateRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { + public final Operation setInstanceTemplateRegionInstanceGroupManager( + String requestId, + String instanceGroupManager, + RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource) { SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersSetTemplateRequestResource( + regionInstanceGroupManagersSetTemplateRequestResource) + .build(); return setInstanceTemplateRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * Sets the instance template to use when creating new instances or recreating instances in this + * group. Existing instances are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1378,15 +1685,18 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(String requ
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation setInstanceTemplateRegionInstanceGroupManager(
+      SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request) {
     return setInstanceTemplateRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.
+   * Sets the instance template to use when creating new instances or recreating instances in this
+   * group. Existing instances are not affected.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1404,15 +1714,18 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstance
    * 
*/ @BetaApi - public final UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { + public final UnaryCallable + setInstanceTemplateRegionInstanceGroupManagerCallable() { return stub.setInstanceTemplateRegionInstanceGroupManagerCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * Modifies the target pools to which all new instances in this group are assigned. Existing + * instances in the group are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1422,32 +1735,44 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsRegionInstanceGroupManager(String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsRegionInstanceGroupManager( + String requestId, + ProjectRegionInstanceGroupManagerName instanceGroupManager, + RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager == null ? null : instanceGroupManager.toString()) - .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setRegionInstanceGroupManagersSetTargetPoolsRequestResource( + regionInstanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * Modifies the target pools to which all new instances in this group are assigned. Existing + * instances in the group are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1457,32 +1782,43 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(String requestId
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTargetPoolsRegionInstanceGroupManager(String requestId, String instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { + public final Operation setTargetPoolsRegionInstanceGroupManager( + String requestId, + String instanceGroupManager, + RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroupManager(instanceGroupManager) - .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource) - .build(); + .setRequestId(requestId) + .setInstanceGroupManager(instanceGroupManager) + .setRegionInstanceGroupManagersSetTargetPoolsRequestResource( + regionInstanceGroupManagersSetTargetPoolsRequestResource) + .build(); return setTargetPoolsRegionInstanceGroupManager(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * Modifies the target pools to which all new instances in this group are assigned. Existing + * instances in the group are not affected. + * + *

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1501,15 +1837,18 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(String requestId
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) {
+  public final Operation setTargetPoolsRegionInstanceGroupManager(
+      SetTargetPoolsRegionInstanceGroupManagerHttpRequest request) {
     return setTargetPoolsRegionInstanceGroupManagerCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
+   * Modifies the target pools to which all new instances in this group are assigned. Existing
+   * instances in the group are not affected.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   String requestId = "";
@@ -1527,12 +1866,13 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRe
    * 
*/ @BetaApi - public final UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { + public final UnaryCallable + setTargetPoolsRegionInstanceGroupManagerCallable() { return stub.setTargetPoolsRegionInstanceGroupManagerCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1561,23 +1901,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionInstanceGroupManagersPagedResponse extends AbstractPagedListResponse< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage, - ListRegionInstanceGroupManagersFixedSizeCollection> { + public static class ListRegionInstanceGroupManagersPagedResponse + extends AbstractPagedListResponse< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager, ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { ApiFuture futurePage = - ListRegionInstanceGroupManagersPage.createEmptyPage().createPageAsync(context, futureResponse); + ListRegionInstanceGroupManagersPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + ListRegionInstanceGroupManagersPage, ListRegionInstanceGroupManagersPagedResponse>() { @Override - public ListRegionInstanceGroupManagersPagedResponse apply(ListRegionInstanceGroupManagersPage input) { + public ListRegionInstanceGroupManagersPagedResponse apply( + ListRegionInstanceGroupManagersPage input) { return new ListRegionInstanceGroupManagersPagedResponse(input); } }); @@ -1586,18 +1931,18 @@ public ListRegionInstanceGroupManagersPagedResponse apply(ListRegionInstanceGrou private ListRegionInstanceGroupManagersPagedResponse(ListRegionInstanceGroupManagersPage page) { super(page, ListRegionInstanceGroupManagersFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionInstanceGroupManagersPage extends AbstractPage< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage> { + public static class ListRegionInstanceGroupManagersPage + extends AbstractPage< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager, ListRegionInstanceGroupManagersPage> { private ListRegionInstanceGroupManagersPage( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager> + context, RegionInstanceGroupManagerList response) { super(context, response); } @@ -1608,31 +1953,33 @@ private static ListRegionInstanceGroupManagersPage createEmptyPage() { @Override protected ListRegionInstanceGroupManagersPage createPage( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager> + context, RegionInstanceGroupManagerList response) { return new ListRegionInstanceGroupManagersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionInstanceGroupManagersFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionInstanceGroupManagersHttpRequest, - RegionInstanceGroupManagerList, - InstanceGroupManager, - ListRegionInstanceGroupManagersPage, - ListRegionInstanceGroupManagersFixedSizeCollection> { + public static class ListRegionInstanceGroupManagersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + InstanceGroupManager, ListRegionInstanceGroupManagersPage, + ListRegionInstanceGroupManagersFixedSizeCollection> { - private ListRegionInstanceGroupManagersFixedSizeCollection(List pages, int collectionSize) { + private ListRegionInstanceGroupManagersFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1645,7 +1992,5 @@ protected ListRegionInstanceGroupManagersFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionInstanceGroupManagersFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java index df6c97226e7c..f1f09b5f5466 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private RegionInstanceGroupManagerList() { this.warning = null; } - private RegionInstanceGroupManagerList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagerList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagerList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagerList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagerList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public RegionInstanceGroupManagerList build() { - - - - - return new RegionInstanceGroupManagerList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new RegionInstanceGroupManagerList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupManagerList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupManagerList) { RegionInstanceGroupManagerList that = (RegionInstanceGroupManagerList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java index 0736c1d04482..3618185ab583 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of abandonInstancesRegionInstanceGroupManager to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of abandonInstancesRegionInstanceGroupManager to 30 seconds: * *

  * 
@@ -84,127 +62,139 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class RegionInstanceGroupManagerSettings extends ClientSettings {
+public class RegionInstanceGroupManagerSettings
+    extends ClientSettings {
   /**
-   * Returns the object with the settings used for calls to abandonInstancesRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * abandonInstancesRegionInstanceGroupManager.
    */
-  public UnaryCallSettings abandonInstancesRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).abandonInstancesRegionInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      abandonInstancesRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .abandonInstancesRegionInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings deleteRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).deleteRegionInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to deleteRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      deleteRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .deleteRegionInstanceGroupManagerSettings();
   }
 
   /**
-   * Returns the object with the settings used for calls to deleteInstancesRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * deleteInstancesRegionInstanceGroupManager.
    */
-  public UnaryCallSettings deleteInstancesRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).deleteInstancesRegionInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      deleteInstancesRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .deleteInstancesRegionInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings getRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).getRegionInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to getRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      getRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .getRegionInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings insertRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).insertRegionInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to insertRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      insertRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .insertRegionInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionInstanceGroupManagers.
-   */
-  public PagedCallSettings listRegionInstanceGroupManagersSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).listRegionInstanceGroupManagersSettings();
+  /** Returns the object with the settings used for calls to listRegionInstanceGroupManagers. */
+  public PagedCallSettings<
+          ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+          ListRegionInstanceGroupManagersPagedResponse>
+      listRegionInstanceGroupManagersSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .listRegionInstanceGroupManagersSettings();
   }
 
   /**
-   * Returns the object with the settings used for calls to listManagedInstancesRegionInstanceGroupManagers.
+   * Returns the object with the settings used for calls to
+   * listManagedInstancesRegionInstanceGroupManagers.
    */
-  public UnaryCallSettings listManagedInstancesRegionInstanceGroupManagersSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).listManagedInstancesRegionInstanceGroupManagersSettings();
+  public UnaryCallSettings<
+          ListManagedInstancesRegionInstanceGroupManagersHttpRequest,
+          RegionInstanceGroupManagersListInstancesResponse>
+      listManagedInstancesRegionInstanceGroupManagersSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .listManagedInstancesRegionInstanceGroupManagersSettings();
   }
 
   /**
-   * Returns the object with the settings used for calls to recreateInstancesRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * recreateInstancesRegionInstanceGroupManager.
    */
-  public UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).recreateInstancesRegionInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      recreateInstancesRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .recreateInstancesRegionInstanceGroupManagerSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings resizeRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).resizeRegionInstanceGroupManagerSettings();
+  /** Returns the object with the settings used for calls to resizeRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      resizeRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .resizeRegionInstanceGroupManagerSettings();
   }
 
   /**
-   * Returns the object with the settings used for calls to setInstanceTemplateRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * setInstanceTemplateRegionInstanceGroupManager.
    */
-  public UnaryCallSettings setInstanceTemplateRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).setInstanceTemplateRegionInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      setInstanceTemplateRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .setInstanceTemplateRegionInstanceGroupManagerSettings();
   }
 
   /**
-   * Returns the object with the settings used for calls to setTargetPoolsRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * setTargetPoolsRegionInstanceGroupManager.
    */
-  public UnaryCallSettings setTargetPoolsRegionInstanceGroupManagerSettings() {
-    return ((RegionInstanceGroupManagerStubSettings) getStubSettings()).setTargetPoolsRegionInstanceGroupManagerSettings();
+  public UnaryCallSettings
+      setTargetPoolsRegionInstanceGroupManagerSettings() {
+    return ((RegionInstanceGroupManagerStubSettings) getStubSettings())
+        .setTargetPoolsRegionInstanceGroupManagerSettings();
   }
 
-
-  public static final RegionInstanceGroupManagerSettings create(RegionInstanceGroupManagerStubSettings stub) throws IOException {
+  public static final RegionInstanceGroupManagerSettings create(
+      RegionInstanceGroupManagerStubSettings stub) throws IOException {
     return new RegionInstanceGroupManagerSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionInstanceGroupManagerStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionInstanceGroupManagerStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionInstanceGroupManagerStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionInstanceGroupManagerStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionInstanceGroupManagerStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionInstanceGroupManagerStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionInstanceGroupManagerStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -217,23 +207,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionInstanceGroupManagerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -242,10 +226,9 @@ protected RegionInstanceGroupManagerSettings(Builder settingsBuilder) throws IOE
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionInstanceGroupManagerSettings.
-   */
-  public static class Builder extends ClientSettings.Builder {
+  /** Builder for RegionInstanceGroupManagerSettings. */
+  public static class Builder
+      extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
     }
@@ -266,95 +249,112 @@ protected Builder(RegionInstanceGroupManagerStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionInstanceGroupManagerStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionInstanceGroupManagerStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } /** - * Returns the builder for the settings used for calls to abandonInstancesRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * abandonInstancesRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder abandonInstancesRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + AbandonInstancesRegionInstanceGroupManagerHttpRequest, Operation> + abandonInstancesRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().abandonInstancesRegionInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to deleteRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder deleteRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to deleteRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + deleteRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().deleteRegionInstanceGroupManagerSettings(); } /** - * Returns the builder for the settings used for calls to deleteInstancesRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * deleteInstancesRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder deleteInstancesRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + DeleteInstancesRegionInstanceGroupManagerHttpRequest, Operation> + deleteInstancesRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().deleteInstancesRegionInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to getRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder getRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to getRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + getRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().getRegionInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to insertRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder insertRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to insertRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + insertRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().insertRegionInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to listRegionInstanceGroupManagers. - */ - public PagedCallSettings.Builder listRegionInstanceGroupManagersSettings() { + /** Returns the builder for the settings used for calls to listRegionInstanceGroupManagers. */ + public PagedCallSettings.Builder< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersSettings() { return getStubSettingsBuilder().listRegionInstanceGroupManagersSettings(); } /** - * Returns the builder for the settings used for calls to listManagedInstancesRegionInstanceGroupManagers. + * Returns the builder for the settings used for calls to + * listManagedInstancesRegionInstanceGroupManagers. */ - public UnaryCallSettings.Builder listManagedInstancesRegionInstanceGroupManagersSettings() { + public UnaryCallSettings.Builder< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersSettings() { return getStubSettingsBuilder().listManagedInstancesRegionInstanceGroupManagersSettings(); } /** - * Returns the builder for the settings used for calls to recreateInstancesRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * recreateInstancesRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder recreateInstancesRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + RecreateInstancesRegionInstanceGroupManagerHttpRequest, Operation> + recreateInstancesRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().recreateInstancesRegionInstanceGroupManagerSettings(); } - /** - * Returns the builder for the settings used for calls to resizeRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder resizeRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to resizeRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + resizeRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().resizeRegionInstanceGroupManagerSettings(); } /** - * Returns the builder for the settings used for calls to setInstanceTemplateRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * setInstanceTemplateRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder setInstanceTemplateRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest, Operation> + setInstanceTemplateRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().setInstanceTemplateRegionInstanceGroupManagerSettings(); } /** - * Returns the builder for the settings used for calls to setTargetPoolsRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * setTargetPoolsRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder setTargetPoolsRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + setTargetPoolsRegionInstanceGroupManagerSettings() { return getStubSettingsBuilder().setTargetPoolsRegionInstanceGroupManagerSettings(); } @@ -363,4 +363,4 @@ public RegionInstanceGroupManagerSettings build() throws IOException { return new RegionInstanceGroupManagerSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java index 33360df8476d..3327c7ebb786 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private RegionInstanceGroupManagersAbandonInstancesRequest() { this.instances = null; } - - private RegionInstanceGroupManagersAbandonInstancesRequest( - List instances - ) { + private RegionInstanceGroupManagersAbandonInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagersAbandonInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagersAbandonInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagersAbandonInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagersAbandonInstancesRequest(); } @@ -102,7 +99,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(RegionInstanceGroupManagersAbandonInstancesRequest other) { - if (other == RegionInstanceGroupManagersAbandonInstancesRequest.getDefaultInstance()) return this; + if (other == RegionInstanceGroupManagersAbandonInstancesRequest.getDefaultInstance()) + return this; if (other.getInstancesList() != null) { this.instances = other.instances; } @@ -130,11 +128,8 @@ public Builder addInstances(String instances) { return this; } - public RegionInstanceGroupManagersAbandonInstancesRequest build() { - return new RegionInstanceGroupManagersAbandonInstancesRequest( - instances - ); + return new RegionInstanceGroupManagersAbandonInstancesRequest(instances); } public Builder clone() { @@ -146,9 +141,7 @@ public Builder clone() { @Override public String toString() { - return "RegionInstanceGroupManagersAbandonInstancesRequest{" - + "instances=" + instances - + "}"; + return "RegionInstanceGroupManagersAbandonInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -157,18 +150,15 @@ public boolean equals(Object o) { return true; } if (o instanceof RegionInstanceGroupManagersAbandonInstancesRequest) { - RegionInstanceGroupManagersAbandonInstancesRequest that = (RegionInstanceGroupManagersAbandonInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + RegionInstanceGroupManagersAbandonInstancesRequest that = + (RegionInstanceGroupManagersAbandonInstancesRequest) o; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java index 1ab3b9d238a9..9474e8998620 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private RegionInstanceGroupManagersDeleteInstancesRequest() { this.instances = null; } - - private RegionInstanceGroupManagersDeleteInstancesRequest( - List instances - ) { + private RegionInstanceGroupManagersDeleteInstancesRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagersDeleteInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagersDeleteInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagersDeleteInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagersDeleteInstancesRequest(); } @@ -102,7 +99,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(RegionInstanceGroupManagersDeleteInstancesRequest other) { - if (other == RegionInstanceGroupManagersDeleteInstancesRequest.getDefaultInstance()) return this; + if (other == RegionInstanceGroupManagersDeleteInstancesRequest.getDefaultInstance()) + return this; if (other.getInstancesList() != null) { this.instances = other.instances; } @@ -130,11 +128,8 @@ public Builder addInstances(String instances) { return this; } - public RegionInstanceGroupManagersDeleteInstancesRequest build() { - return new RegionInstanceGroupManagersDeleteInstancesRequest( - instances - ); + return new RegionInstanceGroupManagersDeleteInstancesRequest(instances); } public Builder clone() { @@ -146,9 +141,7 @@ public Builder clone() { @Override public String toString() { - return "RegionInstanceGroupManagersDeleteInstancesRequest{" - + "instances=" + instances - + "}"; + return "RegionInstanceGroupManagersDeleteInstancesRequest{" + "instances=" + instances + "}"; } @Override @@ -157,18 +150,15 @@ public boolean equals(Object o) { return true; } if (o instanceof RegionInstanceGroupManagersDeleteInstancesRequest) { - RegionInstanceGroupManagersDeleteInstancesRequest that = (RegionInstanceGroupManagersDeleteInstancesRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + RegionInstanceGroupManagersDeleteInstancesRequest that = + (RegionInstanceGroupManagersDeleteInstancesRequest) o; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java index 90b87088dcbd..e02308bfa2fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private RegionInstanceGroupManagersListInstancesResponse() { this.managedInstances = null; } - - private RegionInstanceGroupManagersListInstancesResponse( - List managedInstances - ) { + private RegionInstanceGroupManagersListInstancesResponse(List managedInstances) { this.managedInstances = managedInstances; } @@ -76,22 +71,24 @@ public List getManagedInstancesList() { return managedInstances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagersListInstancesResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagersListInstancesResponse getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagersListInstancesResponse DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagersListInstancesResponse(); } @@ -102,7 +99,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(RegionInstanceGroupManagersListInstancesResponse other) { - if (other == RegionInstanceGroupManagersListInstancesResponse.getDefaultInstance()) return this; + if (other == RegionInstanceGroupManagersListInstancesResponse.getDefaultInstance()) + return this; if (other.getManagedInstancesList() != null) { this.managedInstances = other.managedInstances; } @@ -130,11 +128,8 @@ public Builder addManagedInstances(ManagedInstance managedInstances) { return this; } - public RegionInstanceGroupManagersListInstancesResponse build() { - return new RegionInstanceGroupManagersListInstancesResponse( - managedInstances - ); + return new RegionInstanceGroupManagersListInstancesResponse(managedInstances); } public Builder clone() { @@ -147,7 +142,8 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupManagersListInstancesResponse{" - + "managedInstances=" + managedInstances + + "managedInstances=" + + managedInstances + "}"; } @@ -157,18 +153,15 @@ public boolean equals(Object o) { return true; } if (o instanceof RegionInstanceGroupManagersListInstancesResponse) { - RegionInstanceGroupManagersListInstancesResponse that = (RegionInstanceGroupManagersListInstancesResponse) o; - return - Objects.equals(this.managedInstances, that.getManagedInstancesList()) - ; + RegionInstanceGroupManagersListInstancesResponse that = + (RegionInstanceGroupManagersListInstancesResponse) o; + return Objects.equals(this.managedInstances, that.getManagedInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - managedInstances - ); + return Objects.hash(managedInstances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java index 1a2c15c46362..36663c265597 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private RegionInstanceGroupManagersRecreateRequest() { this.instances = null; } - - private RegionInstanceGroupManagersRecreateRequest( - List instances - ) { + private RegionInstanceGroupManagersRecreateRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagersRecreateRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagersRecreateRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagersRecreateRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagersRecreateRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(String instances) { return this; } - public RegionInstanceGroupManagersRecreateRequest build() { - return new RegionInstanceGroupManagersRecreateRequest( - instances - ); + return new RegionInstanceGroupManagersRecreateRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "RegionInstanceGroupManagersRecreateRequest{" - + "instances=" + instances - + "}"; + return "RegionInstanceGroupManagersRecreateRequest{" + "instances=" + instances + "}"; } @Override @@ -157,18 +149,15 @@ public boolean equals(Object o) { return true; } if (o instanceof RegionInstanceGroupManagersRecreateRequest) { - RegionInstanceGroupManagersRecreateRequest that = (RegionInstanceGroupManagersRecreateRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + RegionInstanceGroupManagersRecreateRequest that = + (RegionInstanceGroupManagersRecreateRequest) o; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java index fc809979f180..937044c58ce1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,8 @@ private RegionInstanceGroupManagersSetTargetPoolsRequest() { this.targetPools = null; } - private RegionInstanceGroupManagersSetTargetPoolsRequest( - String fingerprint, - List targetPools - ) { + String fingerprint, List targetPools) { this.fingerprint = fingerprint; this.targetPools = targetPools; } @@ -90,22 +86,24 @@ public List getTargetPoolsList() { return targetPools; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagersSetTargetPoolsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagersSetTargetPoolsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagersSetTargetPoolsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagersSetTargetPoolsRequest(); } @@ -117,7 +115,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(RegionInstanceGroupManagersSetTargetPoolsRequest other) { - if (other == RegionInstanceGroupManagersSetTargetPoolsRequest.getDefaultInstance()) return this; + if (other == RegionInstanceGroupManagersSetTargetPoolsRequest.getDefaultInstance()) + return this; if (other.getFingerprint() != null) { this.fingerprint = other.fingerprint; } @@ -158,13 +157,9 @@ public Builder addTargetPools(String targetPools) { return this; } - public RegionInstanceGroupManagersSetTargetPoolsRequest build() { - return new RegionInstanceGroupManagersSetTargetPoolsRequest( - fingerprint, - targetPools - ); + return new RegionInstanceGroupManagersSetTargetPoolsRequest(fingerprint, targetPools); } public Builder clone() { @@ -178,8 +173,11 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupManagersSetTargetPoolsRequest{" - + "fingerprint=" + fingerprint + ", " - + "targetPools=" + targetPools + + "fingerprint=" + + fingerprint + + ", " + + "targetPools=" + + targetPools + "}"; } @@ -189,20 +187,16 @@ public boolean equals(Object o) { return true; } if (o instanceof RegionInstanceGroupManagersSetTargetPoolsRequest) { - RegionInstanceGroupManagersSetTargetPoolsRequest that = (RegionInstanceGroupManagersSetTargetPoolsRequest) o; - return - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.targetPools, that.getTargetPoolsList()) - ; + RegionInstanceGroupManagersSetTargetPoolsRequest that = + (RegionInstanceGroupManagersSetTargetPoolsRequest) o; + return Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.targetPools, that.getTargetPoolsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - fingerprint, - targetPools - ); + return Objects.hash(fingerprint, targetPools); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java index b98972dd35b3..c4e23696134a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private RegionInstanceGroupManagersSetTemplateRequest() { this.instanceTemplate = null; } - - private RegionInstanceGroupManagersSetTemplateRequest( - String instanceTemplate - ) { + private RegionInstanceGroupManagersSetTemplateRequest(String instanceTemplate) { this.instanceTemplate = instanceTemplate; } @@ -72,22 +66,24 @@ public String getInstanceTemplate() { return instanceTemplate; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupManagersSetTemplateRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupManagersSetTemplateRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupManagersSetTemplateRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupManagersSetTemplateRequest(); } @@ -118,11 +114,8 @@ public Builder setInstanceTemplate(String instanceTemplate) { return this; } - public RegionInstanceGroupManagersSetTemplateRequest build() { - return new RegionInstanceGroupManagersSetTemplateRequest( - instanceTemplate - ); + return new RegionInstanceGroupManagersSetTemplateRequest(instanceTemplate); } public Builder clone() { @@ -135,7 +128,8 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupManagersSetTemplateRequest{" - + "instanceTemplate=" + instanceTemplate + + "instanceTemplate=" + + instanceTemplate + "}"; } @@ -145,18 +139,15 @@ public boolean equals(Object o) { return true; } if (o instanceof RegionInstanceGroupManagersSetTemplateRequest) { - RegionInstanceGroupManagersSetTemplateRequest that = (RegionInstanceGroupManagersSetTemplateRequest) o; - return - Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) - ; + RegionInstanceGroupManagersSetTemplateRequest that = + (RegionInstanceGroupManagersSetTemplateRequest) o; + return Objects.equals(this.instanceTemplate, that.getInstanceTemplate()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceTemplate - ); + return Objects.hash(instanceTemplate); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java index c550efe76946..8f931e750ed2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.stub.RegionInstanceGroupStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getRegionInstanceGroup to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegionInstanceGroup to 30 seconds: * *

  * 
@@ -86,77 +64,68 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionInstanceGroupSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to getRegionInstanceGroup.
-   */
-  public UnaryCallSettings getRegionInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to getRegionInstanceGroup. */
+  public UnaryCallSettings
+      getRegionInstanceGroupSettings() {
     return ((RegionInstanceGroupStubSettings) getStubSettings()).getRegionInstanceGroupSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionInstanceGroups.
-   */
-  public PagedCallSettings listRegionInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listRegionInstanceGroups. */
+  public PagedCallSettings<
+          ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList,
+          ListRegionInstanceGroupsPagedResponse>
+      listRegionInstanceGroupsSettings() {
     return ((RegionInstanceGroupStubSettings) getStubSettings()).listRegionInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstancesRegionInstanceGroups.
-   */
-  public PagedCallSettings listInstancesRegionInstanceGroupsSettings() {
-    return ((RegionInstanceGroupStubSettings) getStubSettings()).listInstancesRegionInstanceGroupsSettings();
+  /** Returns the object with the settings used for calls to listInstancesRegionInstanceGroups. */
+  public PagedCallSettings<
+          ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+          ListInstancesRegionInstanceGroupsPagedResponse>
+      listInstancesRegionInstanceGroupsSettings() {
+    return ((RegionInstanceGroupStubSettings) getStubSettings())
+        .listInstancesRegionInstanceGroupsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setNamedPortsRegionInstanceGroup.
-   */
-  public UnaryCallSettings setNamedPortsRegionInstanceGroupSettings() {
-    return ((RegionInstanceGroupStubSettings) getStubSettings()).setNamedPortsRegionInstanceGroupSettings();
+  /** Returns the object with the settings used for calls to setNamedPortsRegionInstanceGroup. */
+  public UnaryCallSettings
+      setNamedPortsRegionInstanceGroupSettings() {
+    return ((RegionInstanceGroupStubSettings) getStubSettings())
+        .setNamedPortsRegionInstanceGroupSettings();
   }
 
-
-  public static final RegionInstanceGroupSettings create(RegionInstanceGroupStubSettings stub) throws IOException {
+  public static final RegionInstanceGroupSettings create(RegionInstanceGroupStubSettings stub)
+      throws IOException {
     return new RegionInstanceGroupSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionInstanceGroupStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionInstanceGroupStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionInstanceGroupStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionInstanceGroupStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionInstanceGroupStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionInstanceGroupStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionInstanceGroupStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -169,23 +138,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionInstanceGroupStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -194,9 +157,7 @@ protected RegionInstanceGroupSettings(Builder settingsBuilder) throws IOExceptio
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionInstanceGroupSettings.
-   */
+  /** Builder for RegionInstanceGroupSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -218,46 +179,48 @@ protected Builder(RegionInstanceGroupStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionInstanceGroupStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionInstanceGroupStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to getRegionInstanceGroup. - */ - public UnaryCallSettings.Builder getRegionInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to getRegionInstanceGroup. */ + public UnaryCallSettings.Builder + getRegionInstanceGroupSettings() { return getStubSettingsBuilder().getRegionInstanceGroupSettings(); } - /** - * Returns the builder for the settings used for calls to listRegionInstanceGroups. - */ - public PagedCallSettings.Builder listRegionInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listRegionInstanceGroups. */ + public PagedCallSettings.Builder< + ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, + ListRegionInstanceGroupsPagedResponse> + listRegionInstanceGroupsSettings() { return getStubSettingsBuilder().listRegionInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to listInstancesRegionInstanceGroups. - */ - public PagedCallSettings.Builder listInstancesRegionInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstancesRegionInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + ListInstancesRegionInstanceGroupsPagedResponse> + listInstancesRegionInstanceGroupsSettings() { return getStubSettingsBuilder().listInstancesRegionInstanceGroupsSettings(); } - /** - * Returns the builder for the settings used for calls to setNamedPortsRegionInstanceGroup. - */ - public UnaryCallSettings.Builder setNamedPortsRegionInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to setNamedPortsRegionInstanceGroup. */ + public UnaryCallSettings.Builder + setNamedPortsRegionInstanceGroupSettings() { return getStubSettingsBuilder().setNamedPortsRegionInstanceGroupSettings(); } @@ -266,4 +229,4 @@ public RegionInstanceGroupSettings build() throws IOException { return new RegionInstanceGroupSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java index 13fc71db33af..59f1430cc6c7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private RegionInstanceGroupsListInstances() { this.warning = null; } - private RegionInstanceGroupsListInstances( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupsListInstances prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupsListInstances getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupsListInstances DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupsListInstances(); } @@ -270,21 +269,10 @@ public Builder setWarning(Warning warning) { return this; } - public RegionInstanceGroupsListInstances build() { - - - - return new RegionInstanceGroupsListInstances( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +290,23 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupsListInstances{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +317,18 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupsListInstances) { RegionInstanceGroupsListInstances that = (RegionInstanceGroupsListInstances) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java index b4bc7eec48b8..d6bfddceb997 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private RegionInstanceGroupsListInstancesRequest() { this.portName = null; } - - private RegionInstanceGroupsListInstancesRequest( - String instanceState, - String portName - ) { + private RegionInstanceGroupsListInstancesRequest(String instanceState, String portName) { this.instanceState = instanceState; this.portName = portName; } @@ -86,22 +79,24 @@ public String getPortName() { return portName; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupsListInstancesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupsListInstancesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupsListInstancesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupsListInstancesRequest(); } @@ -146,13 +141,9 @@ public Builder setPortName(String portName) { return this; } - public RegionInstanceGroupsListInstancesRequest build() { - return new RegionInstanceGroupsListInstancesRequest( - instanceState, - portName - ); + return new RegionInstanceGroupsListInstancesRequest(instanceState, portName); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupsListInstancesRequest{" - + "instanceState=" + instanceState + ", " - + "portName=" + portName + + "instanceState=" + + instanceState + + ", " + + "portName=" + + portName + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupsListInstancesRequest) { RegionInstanceGroupsListInstancesRequest that = (RegionInstanceGroupsListInstancesRequest) o; - return - Objects.equals(this.instanceState, that.getInstanceState()) && - Objects.equals(this.portName, that.getPortName()) - ; + return Objects.equals(this.instanceState, that.getInstanceState()) + && Objects.equals(this.portName, that.getPortName()); } return false; } @Override public int hashCode() { - return Objects.hash( - instanceState, - portName - ); + return Objects.hash(instanceState, portName); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java index 52718623ce73..5f66c8f0a730 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private RegionInstanceGroupsSetNamedPortsRequest() { this.namedPorts = null; } - - private RegionInstanceGroupsSetNamedPortsRequest( - String fingerprint, - List namedPorts - ) { + private RegionInstanceGroupsSetNamedPortsRequest(String fingerprint, List namedPorts) { this.fingerprint = fingerprint; this.namedPorts = namedPorts; } @@ -90,22 +85,24 @@ public List getNamedPortsList() { return namedPorts; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionInstanceGroupsSetNamedPortsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionInstanceGroupsSetNamedPortsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionInstanceGroupsSetNamedPortsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionInstanceGroupsSetNamedPortsRequest(); } @@ -158,13 +155,9 @@ public Builder addNamedPorts(NamedPort namedPorts) { return this; } - public RegionInstanceGroupsSetNamedPortsRequest build() { - return new RegionInstanceGroupsSetNamedPortsRequest( - fingerprint, - namedPorts - ); + return new RegionInstanceGroupsSetNamedPortsRequest(fingerprint, namedPorts); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "RegionInstanceGroupsSetNamedPortsRequest{" - + "fingerprint=" + fingerprint + ", " - + "namedPorts=" + namedPorts + + "fingerprint=" + + fingerprint + + ", " + + "namedPorts=" + + namedPorts + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof RegionInstanceGroupsSetNamedPortsRequest) { RegionInstanceGroupsSetNamedPortsRequest that = (RegionInstanceGroupsSetNamedPortsRequest) o; - return - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.namedPorts, that.getNamedPortsList()) - ; + return Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.namedPorts, that.getNamedPortsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - fingerprint, - namedPorts - ); + return Objects.hash(fingerprint, namedPorts); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java index c0aa7ed94001..a29b6a2d91c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private RegionList() { this.warning = null; } - private RegionList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RegionList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RegionList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RegionList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RegionList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public RegionList build() { - - - - - return new RegionList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new RegionList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "RegionList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof RegionList) { RegionList that = (RegionList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java deleted file mode 100644 index aef39f3004ec..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionName.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class RegionName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String region; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private RegionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - } - - public static RegionName of( - String project, - String region - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .build(); - } - - public static String format( - String project, - String region - ) { - return of( - project, - region - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public RegionName parse(String formattedString) {return RegionName.parse(formattedString);} - }; - } - - public static RegionName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "RegionName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String region; - - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - - private Builder() {} - - public Builder (RegionName regionName) { - project = regionName.project; - region = regionName.region; - } - - public RegionName build() { - return new RegionName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "region", region - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof RegionName) { - RegionName that = (RegionName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - region - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java index 2f6fcd78cedb..7abb889439e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RegionOperationStub; import com.google.cloud.compute.v1.stub.RegionOperationStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,34 @@ * *

* - *

Note: close() needs to be called on the regionOperationClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the regionOperationClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of RegionOperationSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +105,23 @@ public class RegionOperationClient implements BackgroundResource {
   private final RegionOperationSettings settings;
   private final RegionOperationStub stub;
 
-
-
-  /**
-   * Constructs an instance of RegionOperationClient with default settings.
-   */
+  /** Constructs an instance of RegionOperationClient with default settings. */
   public static final RegionOperationClient create() throws IOException {
     return create(RegionOperationSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RegionOperationClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RegionOperationClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final RegionOperationClient create(RegionOperationSettings settings) throws IOException {
+  public static final RegionOperationClient create(RegionOperationSettings settings)
+      throws IOException {
     return new RegionOperationClient(settings);
   }
 
   /**
-   * Constructs an instance of RegionOperationClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use RegionOperationSettings}.
+   * Constructs an instance of RegionOperationClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use RegionOperationSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final RegionOperationClient create(RegionOperationStub stub) {
@@ -143,9 +129,9 @@ public static final RegionOperationClient create(RegionOperationStub stub) {
   }
 
   /**
-   * Constructs an instance of RegionOperationClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RegionOperationClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected RegionOperationClient(RegionOperationSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +153,12 @@ public RegionOperationStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -188,8 +174,8 @@ public final void deleteRegionOperation(ProjectRegionOperationName operation) {
 
     DeleteRegionOperationHttpRequest request =
         DeleteRegionOperationHttpRequest.newBuilder()
-        .setOperation(operation == null ? null : operation.toString())
-        .build();
+            .setOperation(operation == null ? null : operation.toString())
+            .build();
     deleteRegionOperation(request);
   }
 
@@ -197,7 +183,8 @@ public final void deleteRegionOperation(ProjectRegionOperationName operation) {
   /**
    * Deletes the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -212,9 +199,7 @@ public final void deleteRegionOperation(ProjectRegionOperationName operation) {
   public final void deleteRegionOperation(String operation) {
 
     DeleteRegionOperationHttpRequest request =
-        DeleteRegionOperationHttpRequest.newBuilder()
-        .setOperation(operation)
-        .build();
+        DeleteRegionOperationHttpRequest.newBuilder().setOperation(operation).build();
     deleteRegionOperation(request);
   }
 
@@ -222,7 +207,8 @@ public final void deleteRegionOperation(String operation) {
   /**
    * Deletes the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -245,7 +231,8 @@ public final void deleteRegionOperation(DeleteRegionOperationHttpRequest request
   /**
    * Deletes the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -259,7 +246,8 @@ public final void deleteRegionOperation(DeleteRegionOperationHttpRequest request
    * 
*/ @BetaApi - public final UnaryCallable deleteRegionOperationCallable() { + public final UnaryCallable + deleteRegionOperationCallable() { return stub.deleteRegionOperationCallable(); } @@ -267,7 +255,8 @@ public final UnaryCallable deleteRegionO /** * Retrieves the specified region-specific Operations resource. * - * Sample code: + *

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -283,8 +272,8 @@ public final Operation getRegionOperation(ProjectRegionOperationName operation)
 
     GetRegionOperationHttpRequest request =
         GetRegionOperationHttpRequest.newBuilder()
-        .setOperation(operation == null ? null : operation.toString())
-        .build();
+            .setOperation(operation == null ? null : operation.toString())
+            .build();
     return getRegionOperation(request);
   }
 
@@ -292,7 +281,8 @@ public final Operation getRegionOperation(ProjectRegionOperationName operation)
   /**
    * Retrieves the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -307,9 +297,7 @@ public final Operation getRegionOperation(ProjectRegionOperationName operation)
   public final Operation getRegionOperation(String operation) {
 
     GetRegionOperationHttpRequest request =
-        GetRegionOperationHttpRequest.newBuilder()
-        .setOperation(operation)
-        .build();
+        GetRegionOperationHttpRequest.newBuilder().setOperation(operation).build();
     return getRegionOperation(request);
   }
 
@@ -317,7 +305,8 @@ public final Operation getRegionOperation(String operation) {
   /**
    * Retrieves the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -340,7 +329,8 @@ public final Operation getRegionOperation(GetRegionOperationHttpRequest request)
   /**
    * Retrieves the specified region-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]");
@@ -354,7 +344,8 @@ public final Operation getRegionOperation(GetRegionOperationHttpRequest request)
    * 
*/ @BetaApi - public final UnaryCallable getRegionOperationCallable() { + public final UnaryCallable + getRegionOperationCallable() { return stub.getRegionOperationCallable(); } @@ -362,7 +353,8 @@ public final UnaryCallable getRegionOp /** * Retrieves a list of Operation resources contained within the specified region. * - * Sample code: + *

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -379,8 +371,8 @@ public final UnaryCallable getRegionOp
   public final ListRegionOperationsPagedResponse listRegionOperations(ProjectRegionName region) {
     ListRegionOperationsHttpRequest request =
         ListRegionOperationsHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRegionOperations(request);
   }
 
@@ -388,7 +380,8 @@ public final ListRegionOperationsPagedResponse listRegionOperations(ProjectRegio
   /**
    * Retrieves a list of Operation resources contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -404,9 +397,7 @@ public final ListRegionOperationsPagedResponse listRegionOperations(ProjectRegio
   @BetaApi
   public final ListRegionOperationsPagedResponse listRegionOperations(String region) {
     ListRegionOperationsHttpRequest request =
-        ListRegionOperationsHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListRegionOperationsHttpRequest.newBuilder().setRegion(region).build();
     return listRegionOperations(request);
   }
 
@@ -414,7 +405,8 @@ public final ListRegionOperationsPagedResponse listRegionOperations(String regio
   /**
    * Retrieves a list of Operation resources contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -431,16 +423,17 @@ public final ListRegionOperationsPagedResponse listRegionOperations(String regio
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListRegionOperationsPagedResponse listRegionOperations(ListRegionOperationsHttpRequest request) {
-    return listRegionOperationsPagedCallable()
-        .call(request);
+  public final ListRegionOperationsPagedResponse listRegionOperations(
+      ListRegionOperationsHttpRequest request) {
+    return listRegionOperationsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of Operation resources contained within the specified region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -456,7 +449,8 @@ public final ListRegionOperationsPagedResponse listRegionOperations(ListRegionOp
    * 
*/ @BetaApi - public final UnaryCallable listRegionOperationsPagedCallable() { + public final UnaryCallable + listRegionOperationsPagedCallable() { return stub.listRegionOperationsPagedCallable(); } @@ -464,7 +458,8 @@ public final UnaryCallableSample code: + * *

    * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -487,12 +482,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listRegionOperationsCallable() { + public final UnaryCallable + listRegionOperationsCallable() { return stub.listRegionOperationsCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -521,12 +517,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListRegionOperationsPagedResponse extends AbstractPagedListResponse< - ListRegionOperationsHttpRequest, - OperationList, - Operation, - ListRegionOperationsPage, - ListRegionOperationsFixedSizeCollection> { + public static class ListRegionOperationsPagedResponse + extends AbstractPagedListResponse< + ListRegionOperationsHttpRequest, OperationList, Operation, ListRegionOperationsPage, + ListRegionOperationsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -546,15 +540,11 @@ public ListRegionOperationsPagedResponse apply(ListRegionOperationsPage input) { private ListRegionOperationsPagedResponse(ListRegionOperationsPage page) { super(page, ListRegionOperationsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListRegionOperationsPage extends AbstractPage< - ListRegionOperationsHttpRequest, - OperationList, - Operation, - ListRegionOperationsPage> { + public static class ListRegionOperationsPage + extends AbstractPage< + ListRegionOperationsHttpRequest, OperationList, Operation, ListRegionOperationsPage> { private ListRegionOperationsPage( PageContext context, @@ -579,20 +569,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListRegionOperationsFixedSizeCollection extends AbstractFixedSizeCollection< - ListRegionOperationsHttpRequest, - OperationList, - Operation, - ListRegionOperationsPage, - ListRegionOperationsFixedSizeCollection> { + public static class ListRegionOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionOperationsHttpRequest, OperationList, Operation, ListRegionOperationsPage, + ListRegionOperationsFixedSizeCollection> { - private ListRegionOperationsFixedSizeCollection(List pages, int collectionSize) { + private ListRegionOperationsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -605,7 +590,5 @@ protected ListRegionOperationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRegionOperationsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java index 496bf5ddf023..23390fc28eba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; import com.google.cloud.compute.v1.stub.RegionOperationStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRegionOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRegionOperation to 30 seconds: * *

  * 
@@ -85,70 +63,55 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionOperationSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteRegionOperation.
-   */
+  /** Returns the object with the settings used for calls to deleteRegionOperation. */
   public UnaryCallSettings deleteRegionOperationSettings() {
     return ((RegionOperationStubSettings) getStubSettings()).deleteRegionOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionOperation.
-   */
+  /** Returns the object with the settings used for calls to getRegionOperation. */
   public UnaryCallSettings getRegionOperationSettings() {
     return ((RegionOperationStubSettings) getStubSettings()).getRegionOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionOperations.
-   */
-  public PagedCallSettings listRegionOperationsSettings() {
+  /** Returns the object with the settings used for calls to listRegionOperations. */
+  public PagedCallSettings<
+          ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse>
+      listRegionOperationsSettings() {
     return ((RegionOperationStubSettings) getStubSettings()).listRegionOperationsSettings();
   }
 
-
-  public static final RegionOperationSettings create(RegionOperationStubSettings stub) throws IOException {
+  public static final RegionOperationSettings create(RegionOperationStubSettings stub)
+      throws IOException {
     return new RegionOperationSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionOperationStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionOperationStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionOperationStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionOperationStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionOperationStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionOperationStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionOperationStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -161,23 +124,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionOperationStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -186,9 +143,7 @@ protected RegionOperationSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionOperationSettings.
-   */
+  /** Builder for RegionOperationSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -210,39 +165,39 @@ protected Builder(RegionOperationStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionOperationStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionOperationStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteRegionOperation. - */ - public UnaryCallSettings.Builder deleteRegionOperationSettings() { + /** Returns the builder for the settings used for calls to deleteRegionOperation. */ + public UnaryCallSettings.Builder + deleteRegionOperationSettings() { return getStubSettingsBuilder().deleteRegionOperationSettings(); } - /** - * Returns the builder for the settings used for calls to getRegionOperation. - */ - public UnaryCallSettings.Builder getRegionOperationSettings() { + /** Returns the builder for the settings used for calls to getRegionOperation. */ + public UnaryCallSettings.Builder + getRegionOperationSettings() { return getStubSettingsBuilder().getRegionOperationSettings(); } - /** - * Returns the builder for the settings used for calls to listRegionOperations. - */ - public PagedCallSettings.Builder listRegionOperationsSettings() { + /** Returns the builder for the settings used for calls to listRegionOperations. */ + public PagedCallSettings.Builder< + ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse> + listRegionOperationsSettings() { return getStubSettingsBuilder().listRegionOperationsSettings(); } @@ -251,4 +206,4 @@ public RegionOperationSettings build() throws IOException { return new RegionOperationSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java index 44c823b77f6a..487b6052945d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; import com.google.cloud.compute.v1.stub.RegionStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getRegion to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegion to 30 seconds: * *

  * 
@@ -85,63 +63,48 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to getRegion.
-   */
+  /** Returns the object with the settings used for calls to getRegion. */
   public UnaryCallSettings getRegionSettings() {
     return ((RegionStubSettings) getStubSettings()).getRegionSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegions.
-   */
-  public PagedCallSettings listRegionsSettings() {
+  /** Returns the object with the settings used for calls to listRegions. */
+  public PagedCallSettings
+      listRegionsSettings() {
     return ((RegionStubSettings) getStubSettings()).listRegionsSettings();
   }
 
-
   public static final RegionSettings create(RegionStubSettings stub) throws IOException {
     return new RegionSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RegionStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RegionStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RegionStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RegionStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RegionStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RegionStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RegionStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -154,23 +117,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RegionStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -179,9 +136,7 @@ protected RegionSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RegionSettings.
-   */
+  /** Builder for RegionSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -203,32 +158,31 @@ protected Builder(RegionStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RegionStubSettings.Builder getStubSettingsBuilder() {
       return ((RegionStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to getRegion. - */ + /** Returns the builder for the settings used for calls to getRegion. */ public UnaryCallSettings.Builder getRegionSettings() { return getStubSettingsBuilder().getRegionSettings(); } - /** - * Returns the builder for the settings used for calls to listRegions. - */ - public PagedCallSettings.Builder listRegionsSettings() { + /** Returns the builder for the settings used for calls to listRegions. */ + public PagedCallSettings.Builder + listRegionsSettings() { return getStubSettingsBuilder().listRegionsSettings(); } @@ -237,4 +191,4 @@ public RegionSettings build() throws IOException { return new RegionSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java index 3beed98f0ce3..e95afb751c71 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private RemoveHealthCheckTargetPoolHttpRequest() { this.userIp = null; } - private RemoveHealthCheckTargetPoolHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private RemoveHealthCheckTargetPoolHttpRequest( String requestId, String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -108,8 +103,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } - if (fieldNames.contains("targetPoolsRemoveHealthCheckRequestResource") && targetPoolsRemoveHealthCheckRequestResource != null) { - fieldMap.put("targetPoolsRemoveHealthCheckRequestResource", Collections.singletonList(String.valueOf(targetPoolsRemoveHealthCheckRequestResource))); + if (fieldNames.contains("targetPoolsRemoveHealthCheckRequestResource") + && targetPoolsRemoveHealthCheckRequestResource != null) { + fieldMap.put( + "targetPoolsRemoveHealthCheckRequestResource", + Collections.singletonList(String.valueOf(targetPoolsRemoveHealthCheckRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RemoveHealthCheckTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RemoveHealthCheckTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RemoveHealthCheckTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RemoveHealthCheckTargetPoolHttpRequest(); } @@ -259,7 +259,8 @@ public Builder mergeFrom(RemoveHealthCheckTargetPoolHttpRequest other) { this.targetPool = other.targetPool; } if (other.getTargetPoolsRemoveHealthCheckRequestResource() != null) { - this.targetPoolsRemoveHealthCheckRequestResource = other.targetPoolsRemoveHealthCheckRequestResource; + this.targetPoolsRemoveHealthCheckRequestResource = + other.targetPoolsRemoveHealthCheckRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -276,7 +277,8 @@ public Builder mergeFrom(RemoveHealthCheckTargetPoolHttpRequest other) { this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.targetPool = source.targetPool; - this.targetPoolsRemoveHealthCheckRequestResource = source.targetPoolsRemoveHealthCheckRequestResource; + this.targetPoolsRemoveHealthCheckRequestResource = + source.targetPoolsRemoveHealthCheckRequestResource; this.userIp = source.userIp; } @@ -356,8 +358,10 @@ public TargetPoolsRemoveHealthCheckRequest getTargetPoolsRemoveHealthCheckReques return targetPoolsRemoveHealthCheckRequestResource; } - public Builder setTargetPoolsRemoveHealthCheckRequestResource(TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { - this.targetPoolsRemoveHealthCheckRequestResource = targetPoolsRemoveHealthCheckRequestResource; + public Builder setTargetPoolsRemoveHealthCheckRequestResource( + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + this.targetPoolsRemoveHealthCheckRequestResource = + targetPoolsRemoveHealthCheckRequestResource; return this; } @@ -370,36 +374,27 @@ public Builder setUserIp(String userIp) { return this; } - public RemoveHealthCheckTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RemoveHealthCheckTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsRemoveHealthCheckRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsRemoveHealthCheckRequestResource, + userIp); } public Builder clone() { @@ -412,7 +407,8 @@ public Builder clone() { newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); - newBuilder.setTargetPoolsRemoveHealthCheckRequestResource(this.targetPoolsRemoveHealthCheckRequestResource); + newBuilder.setTargetPoolsRemoveHealthCheckRequestResource( + this.targetPoolsRemoveHealthCheckRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -421,16 +417,35 @@ public Builder clone() { @Override public String toString() { return "RemoveHealthCheckTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetPool=" + targetPool + ", " - + "targetPoolsRemoveHealthCheckRequestResource=" + targetPoolsRemoveHealthCheckRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetPool=" + + targetPool + + ", " + + "targetPoolsRemoveHealthCheckRequestResource=" + + targetPoolsRemoveHealthCheckRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +456,18 @@ public boolean equals(Object o) { } if (o instanceof RemoveHealthCheckTargetPoolHttpRequest) { RemoveHealthCheckTargetPoolHttpRequest that = (RemoveHealthCheckTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.targetPoolsRemoveHealthCheckRequestResource, that.getTargetPoolsRemoveHealthCheckRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals( + this.targetPoolsRemoveHealthCheckRequestResource, + that.getTargetPoolsRemoveHealthCheckRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +475,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsRemoveHealthCheckRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsRemoveHealthCheckRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java index 788455891e07..c9c60f1d8c0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private RemoveInstanceTargetPoolHttpRequest() { this.userIp = null; } - private RemoveInstanceTargetPoolHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private RemoveInstanceTargetPoolHttpRequest( String requestId, String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -108,8 +103,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("targetPool") && targetPool != null) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } - if (fieldNames.contains("targetPoolsRemoveInstanceRequestResource") && targetPoolsRemoveInstanceRequestResource != null) { - fieldMap.put("targetPoolsRemoveInstanceRequestResource", Collections.singletonList(String.valueOf(targetPoolsRemoveInstanceRequestResource))); + if (fieldNames.contains("targetPoolsRemoveInstanceRequestResource") + && targetPoolsRemoveInstanceRequestResource != null) { + fieldMap.put( + "targetPoolsRemoveInstanceRequestResource", + Collections.singletonList(String.valueOf(targetPoolsRemoveInstanceRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RemoveInstanceTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RemoveInstanceTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RemoveInstanceTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RemoveInstanceTargetPoolHttpRequest(); } @@ -259,7 +259,8 @@ public Builder mergeFrom(RemoveInstanceTargetPoolHttpRequest other) { this.targetPool = other.targetPool; } if (other.getTargetPoolsRemoveInstanceRequestResource() != null) { - this.targetPoolsRemoveInstanceRequestResource = other.targetPoolsRemoveInstanceRequestResource; + this.targetPoolsRemoveInstanceRequestResource = + other.targetPoolsRemoveInstanceRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -276,7 +277,8 @@ public Builder mergeFrom(RemoveInstanceTargetPoolHttpRequest other) { this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.targetPool = source.targetPool; - this.targetPoolsRemoveInstanceRequestResource = source.targetPoolsRemoveInstanceRequestResource; + this.targetPoolsRemoveInstanceRequestResource = + source.targetPoolsRemoveInstanceRequestResource; this.userIp = source.userIp; } @@ -356,7 +358,8 @@ public TargetPoolsRemoveInstanceRequest getTargetPoolsRemoveInstanceRequestResou return targetPoolsRemoveInstanceRequestResource; } - public Builder setTargetPoolsRemoveInstanceRequestResource(TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + public Builder setTargetPoolsRemoveInstanceRequestResource( + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { this.targetPoolsRemoveInstanceRequestResource = targetPoolsRemoveInstanceRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public RemoveInstanceTargetPoolHttpRequest build() { String missing = ""; - - - - - - if (targetPool == null) { missing += " targetPool"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RemoveInstanceTargetPoolHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsRemoveInstanceRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsRemoveInstanceRequestResource, + userIp); } public Builder clone() { @@ -412,7 +406,8 @@ public Builder clone() { newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setTargetPool(this.targetPool); - newBuilder.setTargetPoolsRemoveInstanceRequestResource(this.targetPoolsRemoveInstanceRequestResource); + newBuilder.setTargetPoolsRemoveInstanceRequestResource( + this.targetPoolsRemoveInstanceRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "RemoveInstanceTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetPool=" + targetPool + ", " - + "targetPoolsRemoveInstanceRequestResource=" + targetPoolsRemoveInstanceRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetPool=" + + targetPool + + ", " + + "targetPoolsRemoveInstanceRequestResource=" + + targetPoolsRemoveInstanceRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof RemoveInstanceTargetPoolHttpRequest) { RemoveInstanceTargetPoolHttpRequest that = (RemoveInstanceTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.targetPoolsRemoveInstanceRequestResource, that.getTargetPoolsRemoveInstanceRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals( + this.targetPoolsRemoveInstanceRequestResource, + that.getTargetPoolsRemoveInstanceRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetPoolsRemoveInstanceRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetPoolsRemoveInstanceRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java index cfb00726489c..3381247f4eea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private RemoveInstancesInstanceGroupHttpRequest() { this.userIp = null; } - private RemoveInstancesInstanceGroupHttpRequest( String access_token, String callback, @@ -67,13 +63,13 @@ private RemoveInstancesInstanceGroupHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instanceGroup = instanceGroup; - this.instanceGroupsRemoveInstancesRequestResource = instanceGroupsRemoveInstancesRequestResource; + this.instanceGroupsRemoveInstancesRequestResource = + instanceGroupsRemoveInstancesRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -96,8 +92,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instanceGroup") && instanceGroup != null) { fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); } - if (fieldNames.contains("instanceGroupsRemoveInstancesRequestResource") && instanceGroupsRemoveInstancesRequestResource != null) { - fieldMap.put("instanceGroupsRemoveInstancesRequestResource", Collections.singletonList(String.valueOf(instanceGroupsRemoveInstancesRequestResource))); + if (fieldNames.contains("instanceGroupsRemoveInstancesRequestResource") + && instanceGroupsRemoveInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsRemoveInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsRemoveInstancesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +197,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RemoveInstancesInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RemoveInstancesInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RemoveInstancesInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RemoveInstancesInstanceGroupHttpRequest(); } @@ -247,7 +248,8 @@ public Builder mergeFrom(RemoveInstancesInstanceGroupHttpRequest other) { this.instanceGroup = other.instanceGroup; } if (other.getInstanceGroupsRemoveInstancesRequestResource() != null) { - this.instanceGroupsRemoveInstancesRequestResource = other.instanceGroupsRemoveInstancesRequestResource; + this.instanceGroupsRemoveInstancesRequestResource = + other.instanceGroupsRemoveInstancesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +274,8 @@ public Builder mergeFrom(RemoveInstancesInstanceGroupHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instanceGroup = source.instanceGroup; - this.instanceGroupsRemoveInstancesRequestResource = source.instanceGroupsRemoveInstancesRequestResource; + this.instanceGroupsRemoveInstancesRequestResource = + source.instanceGroupsRemoveInstancesRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -320,8 +323,10 @@ public InstanceGroupsRemoveInstancesRequest getInstanceGroupsRemoveInstancesRequ return instanceGroupsRemoveInstancesRequestResource; } - public Builder setInstanceGroupsRemoveInstancesRequestResource(InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { - this.instanceGroupsRemoveInstancesRequestResource = instanceGroupsRemoveInstancesRequestResource; + public Builder setInstanceGroupsRemoveInstancesRequestResource( + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { + this.instanceGroupsRemoveInstancesRequestResource = + instanceGroupsRemoveInstancesRequestResource; return this; } @@ -370,36 +375,27 @@ public Builder setUserIp(String userIp) { return this; } - public RemoveInstancesInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RemoveInstancesInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - instanceGroupsRemoveInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + instanceGroupsRemoveInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +404,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroup(this.instanceGroup); - newBuilder.setInstanceGroupsRemoveInstancesRequestResource(this.instanceGroupsRemoveInstancesRequestResource); + newBuilder.setInstanceGroupsRemoveInstancesRequestResource( + this.instanceGroupsRemoveInstancesRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +418,35 @@ public Builder clone() { @Override public String toString() { return "RemoveInstancesInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "instanceGroupsRemoveInstancesRequestResource=" + instanceGroupsRemoveInstancesRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "instanceGroupsRemoveInstancesRequestResource=" + + instanceGroupsRemoveInstancesRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +457,18 @@ public boolean equals(Object o) { } if (o instanceof RemoveInstancesInstanceGroupHttpRequest) { RemoveInstancesInstanceGroupHttpRequest that = (RemoveInstancesInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.instanceGroupsRemoveInstancesRequestResource, that.getInstanceGroupsRemoveInstancesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals( + this.instanceGroupsRemoveInstancesRequestResource, + that.getInstanceGroupsRemoveInstancesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +476,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - instanceGroupsRemoveInstancesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + instanceGroupsRemoveInstancesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java index 8da267c2ec59..0416828b172e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private RemovePeeringNetworkHttpRequest() { this.userIp = null; } - private RemovePeeringNetworkHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private RemovePeeringNetworkHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -99,8 +94,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("network") && network != null) { fieldMap.put("network", Collections.singletonList(String.valueOf(network))); } - if (fieldNames.contains("networksRemovePeeringRequestResource") && networksRemovePeeringRequestResource != null) { - fieldMap.put("networksRemovePeeringRequestResource", Collections.singletonList(String.valueOf(networksRemovePeeringRequestResource))); + if (fieldNames.contains("networksRemovePeeringRequestResource") + && networksRemovePeeringRequestResource != null) { + fieldMap.put( + "networksRemovePeeringRequestResource", + Collections.singletonList(String.valueOf(networksRemovePeeringRequestResource))); } if (fieldNames.contains("prettyPrint") && prettyPrint != null) { fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RemovePeeringNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RemovePeeringNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RemovePeeringNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RemovePeeringNetworkHttpRequest(); } @@ -329,7 +329,8 @@ public NetworksRemovePeeringRequest getNetworksRemovePeeringRequestResource() { return networksRemovePeeringRequestResource; } - public Builder setNetworksRemovePeeringRequestResource(NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + public Builder setNetworksRemovePeeringRequestResource( + NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { this.networksRemovePeeringRequestResource = networksRemovePeeringRequestResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public RemovePeeringNetworkHttpRequest build() { String missing = ""; - - - if (network == null) { missing += " network"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new RemovePeeringNetworkHttpRequest( - access_token, - callback, - fields, - key, - network, - networksRemovePeeringRequestResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + network, + networksRemovePeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "RemovePeeringNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "network=" + network + ", " - + "networksRemovePeeringRequestResource=" + networksRemovePeeringRequestResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "network=" + + network + + ", " + + "networksRemovePeeringRequestResource=" + + networksRemovePeeringRequestResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +452,18 @@ public boolean equals(Object o) { } if (o instanceof RemovePeeringNetworkHttpRequest) { RemovePeeringNetworkHttpRequest that = (RemovePeeringNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.networksRemovePeeringRequestResource, that.getNetworksRemovePeeringRequestResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals( + this.networksRemovePeeringRequestResource, + that.getNetworksRemovePeeringRequestResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +471,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - network, - networksRemovePeeringRequestResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + network, + networksRemovePeeringRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java index e17e1ba72f69..f18510819b7f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private ResetInstanceHttpRequest() { this.userIp = null; } - private ResetInstanceHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private ResetInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ResetInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ResetInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ResetInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ResetInstanceHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public ResetInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ResetInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "ResetInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof ResetInstanceHttpRequest) { ResetInstanceHttpRequest that = (ResetInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java index 175c4e9b2f0b..46fe780a669e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private ResizeDiskHttpRequest() { this.userIp = null; } - private ResizeDiskHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private ResizeDiskHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.disk = disk; @@ -94,7 +89,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); } if (fieldNames.contains("disksResizeRequestResource") && disksResizeRequestResource != null) { - fieldMap.put("disksResizeRequestResource", Collections.singletonList(String.valueOf(disksResizeRequestResource))); + fieldMap.put( + "disksResizeRequestResource", + Collections.singletonList(String.valueOf(disksResizeRequestResource))); } if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ResizeDiskHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ResizeDiskHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ResizeDiskHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ResizeDiskHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public ResizeDiskHttpRequest build() { String missing = ""; - if (disk == null) { missing += " disk"; } - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ResizeDiskHttpRequest( - access_token, - callback, - disk, - disksResizeRequestResource, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + disk, + disksResizeRequestResource, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "ResizeDiskHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "disk=" + disk + ", " - + "disksResizeRequestResource=" + disksResizeRequestResource + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "disksResizeRequestResource=" + + disksResizeRequestResource + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof ResizeDiskHttpRequest) { ResizeDiskHttpRequest that = (ResizeDiskHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.disk, that.getDisk()) && - Objects.equals(this.disksResizeRequestResource, that.getDisksResizeRequestResource()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.disksResizeRequestResource, that.getDisksResizeRequestResource()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - disk, - disksResizeRequestResource, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + disk, + disksResizeRequestResource, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java index 56e3cf451987..96e9ecdbcdf8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private ResizeInstanceGroupManagerHttpRequest() { this.userIp = null; } - private ResizeInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private ResizeInstanceGroupManagerHttpRequest( String quotaUser, String requestId, Integer size, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ResizeInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ResizeInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ResizeInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ResizeInstanceGroupManagerHttpRequest(); } @@ -370,19 +368,13 @@ public Builder setUserIp(String userIp) { return this; } - public ResizeInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - if (size == null) { missing += " size"; } @@ -391,17 +383,16 @@ public ResizeInstanceGroupManagerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ResizeInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - size, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + size, + userIp); } public Builder clone() { @@ -423,16 +414,35 @@ public Builder clone() { @Override public String toString() { return "ResizeInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "size=" + size + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "size=" + + size + + ", " + + "userIp=" + + userIp + "}"; } @@ -443,18 +453,16 @@ public boolean equals(Object o) { } if (o instanceof ResizeInstanceGroupManagerHttpRequest) { ResizeInstanceGroupManagerHttpRequest that = (ResizeInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.size, that.getSize()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.size, that.getSize()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -462,16 +470,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - size, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + size, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java index 75904592828b..867324d35a91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private ResizeRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private ResizeRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private ResizeRegionInstanceGroupManagerHttpRequest( String quotaUser, String requestId, Integer size, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -94,7 +89,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ResizeRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ResizeRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ResizeRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ResizeRegionInstanceGroupManagerHttpRequest(); } @@ -370,19 +368,13 @@ public Builder setUserIp(String userIp) { return this; } - public ResizeRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - if (size == null) { missing += " size"; } @@ -391,17 +383,16 @@ public ResizeRegionInstanceGroupManagerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new ResizeRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - size, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + size, + userIp); } public Builder clone() { @@ -423,16 +414,35 @@ public Builder clone() { @Override public String toString() { return "ResizeRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "size=" + size + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "size=" + + size + + ", " + + "userIp=" + + userIp + "}"; } @@ -442,19 +452,18 @@ public boolean equals(Object o) { return true; } if (o instanceof ResizeRegionInstanceGroupManagerHttpRequest) { - ResizeRegionInstanceGroupManagerHttpRequest that = (ResizeRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.size, that.getSize()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + ResizeRegionInstanceGroupManagerHttpRequest that = + (ResizeRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.size, that.getSize()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -462,16 +471,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - requestId, - size, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + requestId, + size, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java index 2f48dab044f9..32d6d8680d97 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private ResourceCommitment() { this.type = null; } - - private ResourceCommitment( - String amount, - String type - ) { + private ResourceCommitment(String amount, String type) { this.amount = amount; this.type = type; } @@ -86,22 +79,24 @@ public String getType() { return type; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ResourceCommitment prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ResourceCommitment getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ResourceCommitment DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ResourceCommitment(); } @@ -146,13 +141,9 @@ public Builder setType(String type) { return this; } - public ResourceCommitment build() { - return new ResourceCommitment( - amount, - type - ); + return new ResourceCommitment(amount, type); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "ResourceCommitment{" - + "amount=" + amount + ", " - + "type=" + type - + "}"; + return "ResourceCommitment{" + "amount=" + amount + ", " + "type=" + type + "}"; } @Override @@ -178,19 +166,14 @@ public boolean equals(Object o) { } if (o instanceof ResourceCommitment) { ResourceCommitment that = (ResourceCommitment) o; - return - Objects.equals(this.amount, that.getAmount()) && - Objects.equals(this.type, that.getType()) - ; + return Objects.equals(this.amount, that.getAmount()) + && Objects.equals(this.type, that.getType()); } return false; } @Override public int hashCode() { - return Objects.hash( - amount, - type - ); + return Objects.hash(amount, type); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java index 5b0747058b26..c0af2934011c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ResourceGroupReference() { this.group = null; } - - private ResourceGroupReference( - String group - ) { + private ResourceGroupReference(String group) { this.group = group; } @@ -72,22 +66,24 @@ public String getGroup() { return group; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ResourceGroupReference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ResourceGroupReference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ResourceGroupReference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ResourceGroupReference(); } @@ -118,11 +114,8 @@ public Builder setGroup(String group) { return this; } - public ResourceGroupReference build() { - return new ResourceGroupReference( - group - ); + return new ResourceGroupReference(group); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "ResourceGroupReference{" - + "group=" + group - + "}"; + return "ResourceGroupReference{" + "group=" + group + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof ResourceGroupReference) { ResourceGroupReference that = (ResourceGroupReference) o; - return - Objects.equals(this.group, that.getGroup()) - ; + return Objects.equals(this.group, that.getGroup()); } return false; } @Override public int hashCode() { - return Objects.hash( - group - ); + return Objects.hash(group); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java index 4b494492848e..c98eb0299c8a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -70,7 +69,6 @@ private Route() { this.warnings = null; } - private Route( String creationTimestamp, String description, @@ -88,8 +86,7 @@ private Route( Integer priority, String selfLink, List tags, - List warnings - ) { + List warnings) { this.creationTimestamp = creationTimestamp; this.description = description; this.destRange = destRange; @@ -113,7 +110,8 @@ private Route( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -304,22 +302,24 @@ public List getWarningsList() { return warnings; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Route prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Route getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Route DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Route(); } @@ -590,43 +590,26 @@ public Builder addWarnings(Warnings warnings) { return this; } - public Route build() { - - - - - - - - - - - - - - - return new Route( - creationTimestamp, - description, - destRange, - id, - kind, - name, - network, - nextHopGateway, - nextHopInstance, - nextHopIp, - nextHopNetwork, - nextHopPeering, - nextHopVpnTunnel, - priority, - selfLink, - tags, - warnings - ); + creationTimestamp, + description, + destRange, + id, + kind, + name, + network, + nextHopGateway, + nextHopInstance, + nextHopIp, + nextHopNetwork, + nextHopPeering, + nextHopVpnTunnel, + priority, + selfLink, + tags, + warnings); } public Builder clone() { @@ -655,23 +638,56 @@ public Builder clone() { @Override public String toString() { return "Route{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "destRange=" + destRange + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "nextHopGateway=" + nextHopGateway + ", " - + "nextHopInstance=" + nextHopInstance + ", " - + "nextHopIp=" + nextHopIp + ", " - + "nextHopNetwork=" + nextHopNetwork + ", " - + "nextHopPeering=" + nextHopPeering + ", " - + "nextHopVpnTunnel=" + nextHopVpnTunnel + ", " - + "priority=" + priority + ", " - + "selfLink=" + selfLink + ", " - + "tags=" + tags + ", " - + "warnings=" + warnings + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "destRange=" + + destRange + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "nextHopGateway=" + + nextHopGateway + + ", " + + "nextHopInstance=" + + nextHopInstance + + ", " + + "nextHopIp=" + + nextHopIp + + ", " + + "nextHopNetwork=" + + nextHopNetwork + + ", " + + "nextHopPeering=" + + nextHopPeering + + ", " + + "nextHopVpnTunnel=" + + nextHopVpnTunnel + + ", " + + "priority=" + + priority + + ", " + + "selfLink=" + + selfLink + + ", " + + "tags=" + + tags + + ", " + + "warnings=" + + warnings + "}"; } @@ -682,25 +698,23 @@ public boolean equals(Object o) { } if (o instanceof Route) { Route that = (Route) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.destRange, that.getDestRange()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.nextHopGateway, that.getNextHopGateway()) && - Objects.equals(this.nextHopInstance, that.getNextHopInstance()) && - Objects.equals(this.nextHopIp, that.getNextHopIp()) && - Objects.equals(this.nextHopNetwork, that.getNextHopNetwork()) && - Objects.equals(this.nextHopPeering, that.getNextHopPeering()) && - Objects.equals(this.nextHopVpnTunnel, that.getNextHopVpnTunnel()) && - Objects.equals(this.priority, that.getPriority()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.tags, that.getTagsList()) && - Objects.equals(this.warnings, that.getWarningsList()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.destRange, that.getDestRange()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.nextHopGateway, that.getNextHopGateway()) + && Objects.equals(this.nextHopInstance, that.getNextHopInstance()) + && Objects.equals(this.nextHopIp, that.getNextHopIp()) + && Objects.equals(this.nextHopNetwork, that.getNextHopNetwork()) + && Objects.equals(this.nextHopPeering, that.getNextHopPeering()) + && Objects.equals(this.nextHopVpnTunnel, that.getNextHopVpnTunnel()) + && Objects.equals(this.priority, that.getPriority()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.tags, that.getTagsList()) + && Objects.equals(this.warnings, that.getWarningsList()); } return false; } @@ -708,23 +722,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - destRange, - id, - kind, - name, - network, - nextHopGateway, - nextHopInstance, - nextHopIp, - nextHopNetwork, - nextHopPeering, - nextHopVpnTunnel, - priority, - selfLink, - tags, - warnings - ); + creationTimestamp, + description, + destRange, + id, + kind, + name, + network, + nextHopGateway, + nextHopInstance, + nextHopIp, + nextHopNetwork, + nextHopPeering, + nextHopVpnTunnel, + priority, + selfLink, + tags, + warnings); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java index ae594fb3a232..568a86d39bbe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RouteStub; import com.google.cloud.compute.v1.stub.RouteStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,40 @@ *

  * 
  * try (RouteClient routeClient = RouteClient.create()) {
- *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+ *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
  *   String requestId = "";
  *   Operation response = routeClient.deleteRoute(route, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the routeClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the routeClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of RouteSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of RouteSettings to create(). For + * example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class RouteClient implements BackgroundResource {
   private final RouteSettings settings;
   private final RouteStub stub;
 
-
-
-  /**
-   * Constructs an instance of RouteClient with default settings.
-   */
+  /** Constructs an instance of RouteClient with default settings. */
   public static final RouteClient create() throws IOException {
     return create(RouteSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RouteClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RouteClient, using the given settings. The channels are created based
+   * on the settings passed in, or defaults for any settings that are not set.
    */
   public static final RouteClient create(RouteSettings settings) throws IOException {
     return new RouteClient(settings);
@@ -144,9 +128,8 @@ public static final RouteClient create(RouteStub stub) {
   }
 
   /**
-   * Constructs an instance of RouteClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RouteClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected RouteClient(RouteSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +151,40 @@ public RouteStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified Route resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   Operation response = routeClient.deleteRoute(route, requestId);
    * }
    * 
* * @param route Name of the Route resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRoute(ProjectRouteName route, String requestId) { + public final Operation deleteRoute(ProjectGlobalRouteName route, String requestId) { DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder() - .setRoute(route == null ? null : route.toString()) - .setRequestId(requestId) - .build(); + .setRoute(route == null ? null : route.toString()) + .setRequestId(requestId) + .build(); return deleteRoute(request); } @@ -205,31 +192,33 @@ public final Operation deleteRoute(ProjectRouteName route, String requestId) { /** * Deletes the specified Route resource. * - * Sample code: + *

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   Operation response = routeClient.deleteRoute(route.toString(), requestId);
    * }
    * 
* * @param route Name of the Route resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteRoute(String route, String requestId) { DeleteRouteHttpRequest request = - DeleteRouteHttpRequest.newBuilder() - .setRoute(route) - .setRequestId(requestId) - .build(); + DeleteRouteHttpRequest.newBuilder().setRoute(route).setRequestId(requestId).build(); return deleteRoute(request); } @@ -237,10 +226,11 @@ public final Operation deleteRoute(String route, String requestId) { /** * Deletes the specified Route resource. * - * Sample code: + *

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
@@ -262,10 +252,11 @@ public final Operation deleteRoute(DeleteRouteHttpRequest request) {
   /**
    * Deletes the specified Route resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
@@ -284,12 +275,14 @@ public final UnaryCallable deleteRouteCallabl
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Route resource. Get a list of available routes by making a list() request.
+   * Returns the specified Route resource. Get a list of available routes by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   Route response = routeClient.getRoute(route);
    * }
    * 
@@ -298,23 +291,23 @@ public final UnaryCallable deleteRouteCallabl * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Route getRoute(ProjectRouteName route) { + public final Route getRoute(ProjectGlobalRouteName route) { GetRouteHttpRequest request = - GetRouteHttpRequest.newBuilder() - .setRoute(route == null ? null : route.toString()) - .build(); + GetRouteHttpRequest.newBuilder().setRoute(route == null ? null : route.toString()).build(); return getRoute(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Route resource. Get a list of available routes by making a list() request. + * Returns the specified Route resource. Get a list of available routes by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   Route response = routeClient.getRoute(route.toString());
    * }
    * 
@@ -325,21 +318,20 @@ public final Route getRoute(ProjectRouteName route) { @BetaApi public final Route getRoute(String route) { - GetRouteHttpRequest request = - GetRouteHttpRequest.newBuilder() - .setRoute(route) - .build(); + GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder().setRoute(route).build(); return getRoute(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Route resource. Get a list of available routes by making a list() request. + * Returns the specified Route resource. Get a list of available routes by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
    *     .build();
@@ -357,12 +349,14 @@ public final Route getRoute(GetRouteHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Route resource. Get a list of available routes by making a list() request.
+   * Returns the specified Route resource. Get a list of available routes by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+   *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
    *   GetRouteHttpRequest request = GetRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
    *     .build();
@@ -381,7 +375,8 @@ public final UnaryCallable getRouteCallable() {
   /**
    * Creates a Route resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   String requestId = "";
@@ -391,17 +386,29 @@ public final UnaryCallable getRouteCallable() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param routeResource Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table. - * - * For each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway. - * - * Packets that do not match any route in the sending instance's routing table are dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) + * @param routeResource Represents a Route resource. A route specifies how certain packets should + * be handled by the network. Routes are associated with instances by tags and the set of + * routes for a particular instance is called its routing table. + *

For each packet leaving an instance, the system searches that instance's routing table + * for a single best matching route. Routes match packets by destination IP address, + * preferring smaller or more specific ranges over larger ones. If there is a tie, the system + * selects the route with the smallest priority value. If there is still a tie, it uses the + * layer three and four packet headers to select just one of the remaining matching routes. + * The packet is then forwarded as specified by the nextHop field of the winning route - + * either to another instance destination, an instance gateway, or a Google Compute + * Engine-operated gateway. + *

Packets that do not match any route in the sending instance's routing table are dropped. + * (== resource_for beta.routes ==) (== resource_for v1.routes ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -409,10 +416,10 @@ public final Operation insertRoute(String requestId, ProjectName project, Route InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setRouteResource(routeResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setRouteResource(routeResource) + .build(); return insertRoute(request); } @@ -420,7 +427,8 @@ public final Operation insertRoute(String requestId, ProjectName project, Route /** * Creates a Route resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   String requestId = "";
@@ -430,17 +438,29 @@ public final Operation insertRoute(String requestId, ProjectName project, Route
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param routeResource Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table. - * - * For each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway. - * - * Packets that do not match any route in the sending instance's routing table are dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) + * @param routeResource Represents a Route resource. A route specifies how certain packets should + * be handled by the network. Routes are associated with instances by tags and the set of + * routes for a particular instance is called its routing table. + *

For each packet leaving an instance, the system searches that instance's routing table + * for a single best matching route. Routes match packets by destination IP address, + * preferring smaller or more specific ranges over larger ones. If there is a tie, the system + * selects the route with the smallest priority value. If there is still a tie, it uses the + * layer three and four packet headers to select just one of the remaining matching routes. + * The packet is then forwarded as specified by the nextHop field of the winning route - + * either to another instance destination, an instance gateway, or a Google Compute + * Engine-operated gateway. + *

Packets that do not match any route in the sending instance's routing table are dropped. + * (== resource_for beta.routes ==) (== resource_for v1.routes ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -448,10 +468,10 @@ public final Operation insertRoute(String requestId, String project, Route route InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setRouteResource(routeResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setRouteResource(routeResource) + .build(); return insertRoute(request); } @@ -459,7 +479,8 @@ public final Operation insertRoute(String requestId, String project, Route route /** * Creates a Route resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   String requestId = "";
@@ -486,7 +507,8 @@ public final Operation insertRoute(InsertRouteHttpRequest request) {
   /**
    * Creates a Route resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   String requestId = "";
@@ -512,7 +534,8 @@ public final UnaryCallable insertRouteCallabl
   /**
    * Retrieves the list of Route resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -529,8 +552,8 @@ public final UnaryCallable insertRouteCallabl
   public final ListRoutesPagedResponse listRoutes(ProjectName project) {
     ListRoutesHttpRequest request =
         ListRoutesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listRoutes(request);
   }
 
@@ -538,7 +561,8 @@ public final ListRoutesPagedResponse listRoutes(ProjectName project) {
   /**
    * Retrieves the list of Route resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -553,10 +577,7 @@ public final ListRoutesPagedResponse listRoutes(ProjectName project) {
    */
   @BetaApi
   public final ListRoutesPagedResponse listRoutes(String project) {
-    ListRoutesHttpRequest request =
-        ListRoutesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+    ListRoutesHttpRequest request = ListRoutesHttpRequest.newBuilder().setProject(project).build();
     return listRoutes(request);
   }
 
@@ -564,7 +585,8 @@ public final ListRoutesPagedResponse listRoutes(String project) {
   /**
    * Retrieves the list of Route resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -582,15 +604,15 @@ public final ListRoutesPagedResponse listRoutes(String project) {
    */
   @BetaApi
   public final ListRoutesPagedResponse listRoutes(ListRoutesHttpRequest request) {
-    return listRoutesPagedCallable()
-        .call(request);
+    return listRoutesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of Route resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -606,7 +628,8 @@ public final ListRoutesPagedResponse listRoutes(ListRoutesHttpRequest request) {
    * 
*/ @BetaApi - public final UnaryCallable listRoutesPagedCallable() { + public final UnaryCallable + listRoutesPagedCallable() { return stub.listRoutesPagedCallable(); } @@ -614,7 +637,8 @@ public final UnaryCallable listR /** * Retrieves the list of Route resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -642,7 +666,7 @@ public final UnaryCallable listRoutesCallable(
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -671,12 +695,9 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListRoutesPagedResponse extends AbstractPagedListResponse<
-      ListRoutesHttpRequest,
-      RouteList,
-      Route,
-      ListRoutesPage,
-      ListRoutesFixedSizeCollection> {
+  public static class ListRoutesPagedResponse
+      extends AbstractPagedListResponse<
+          ListRoutesHttpRequest, RouteList, Route, ListRoutesPage, ListRoutesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -696,19 +717,13 @@ public ListRoutesPagedResponse apply(ListRoutesPage input) {
     private ListRoutesPagedResponse(ListRoutesPage page) {
       super(page, ListRoutesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListRoutesPage extends AbstractPage<
-      ListRoutesHttpRequest,
-      RouteList,
-      Route,
-      ListRoutesPage> {
+  public static class ListRoutesPage
+      extends AbstractPage {
 
     private ListRoutesPage(
-        PageContext context,
-        RouteList response) {
+        PageContext context, RouteList response) {
       super(context, response);
     }
 
@@ -718,8 +733,7 @@ private static ListRoutesPage createEmptyPage() {
 
     @Override
     protected ListRoutesPage createPage(
-        PageContext context,
-        RouteList response) {
+        PageContext context, RouteList response) {
       return new ListRoutesPage(context, response);
     }
 
@@ -729,18 +743,11 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListRoutesFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListRoutesHttpRequest,
-      RouteList,
-      Route,
-      ListRoutesPage,
-      ListRoutesFixedSizeCollection> {
+  public static class ListRoutesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListRoutesHttpRequest, RouteList, Route, ListRoutesPage, ListRoutesFixedSizeCollection> {
 
     private ListRoutesFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -755,7 +762,5 @@ protected ListRoutesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListRoutesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
index f5ab82259625..82cdccf0d624 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private RouteList() {
     this.warning = null;
   }
 
-
   private RouteList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(RouteList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static RouteList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final RouteList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new RouteList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public RouteList build() {
 
-
-
-
-
-      return new RouteList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new RouteList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "RouteList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof RouteList) {
       RouteList that = (RouteList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java
index 91ad5009fc52..44c3aea7c9d7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java
@@ -15,45 +15,23 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse;
 import com.google.cloud.compute.v1.stub.RouteStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -62,15 +40,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRoute to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRoute to 30 seconds: * *

  * 
@@ -85,77 +63,58 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RouteSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteRoute.
-   */
+  /** Returns the object with the settings used for calls to deleteRoute. */
   public UnaryCallSettings deleteRouteSettings() {
     return ((RouteStubSettings) getStubSettings()).deleteRouteSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRoute.
-   */
+  /** Returns the object with the settings used for calls to getRoute. */
   public UnaryCallSettings getRouteSettings() {
     return ((RouteStubSettings) getStubSettings()).getRouteSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRoute.
-   */
+  /** Returns the object with the settings used for calls to insertRoute. */
   public UnaryCallSettings insertRouteSettings() {
     return ((RouteStubSettings) getStubSettings()).insertRouteSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRoutes.
-   */
-  public PagedCallSettings listRoutesSettings() {
+  /** Returns the object with the settings used for calls to listRoutes. */
+  public PagedCallSettings
+      listRoutesSettings() {
     return ((RouteStubSettings) getStubSettings()).listRoutesSettings();
   }
 
-
   public static final RouteSettings create(RouteStubSettings stub) throws IOException {
     return new RouteSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RouteStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RouteStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RouteStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RouteStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RouteStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RouteStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RouteStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -168,23 +127,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RouteStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -193,9 +146,7 @@ protected RouteSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RouteSettings.
-   */
+  /** Builder for RouteSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -217,46 +168,41 @@ protected Builder(RouteStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RouteStubSettings.Builder getStubSettingsBuilder() {
       return ((RouteStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteRoute. - */ + /** Returns the builder for the settings used for calls to deleteRoute. */ public UnaryCallSettings.Builder deleteRouteSettings() { return getStubSettingsBuilder().deleteRouteSettings(); } - /** - * Returns the builder for the settings used for calls to getRoute. - */ + /** Returns the builder for the settings used for calls to getRoute. */ public UnaryCallSettings.Builder getRouteSettings() { return getStubSettingsBuilder().getRouteSettings(); } - /** - * Returns the builder for the settings used for calls to insertRoute. - */ + /** Returns the builder for the settings used for calls to insertRoute. */ public UnaryCallSettings.Builder insertRouteSettings() { return getStubSettingsBuilder().insertRouteSettings(); } - /** - * Returns the builder for the settings used for calls to listRoutes. - */ - public PagedCallSettings.Builder listRoutesSettings() { + /** Returns the builder for the settings used for calls to listRoutes. */ + public PagedCallSettings.Builder + listRoutesSettings() { return getStubSettingsBuilder().listRoutesSettings(); } @@ -265,4 +211,4 @@ public RouteSettings build() throws IOException { return new RouteSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java index 239139f4c39d..e97c03183b29 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -58,7 +57,6 @@ private Router() { this.selfLink = null; } - private Router( RouterBgp bgp, List bgpPeers, @@ -70,8 +68,7 @@ private Router( String name, String network, String region, - String selfLink - ) { + String selfLink) { this.bgp = bgp; this.bgpPeers = bgpPeers; this.creationTimestamp = creationTimestamp; @@ -99,7 +96,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("bgpPeers", stringList.build()); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -220,22 +218,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Router prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Router getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Router DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Router(); } @@ -422,31 +422,20 @@ public Builder setSelfLink(String selfLink) { return this; } - public Router build() { - - - - - - - - - return new Router( - bgp, - bgpPeers, - creationTimestamp, - description, - id, - interfaces, - kind, - name, - network, - region, - selfLink - ); + bgp, + bgpPeers, + creationTimestamp, + description, + id, + interfaces, + kind, + name, + network, + region, + selfLink); } public Builder clone() { @@ -469,17 +458,38 @@ public Builder clone() { @Override public String toString() { return "Router{" - + "bgp=" + bgp + ", " - + "bgpPeers=" + bgpPeers + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "interfaces=" + interfaces + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + + "bgp=" + + bgp + + ", " + + "bgpPeers=" + + bgpPeers + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "interfaces=" + + interfaces + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -490,19 +500,17 @@ public boolean equals(Object o) { } if (o instanceof Router) { Router that = (Router) o; - return - Objects.equals(this.bgp, that.getBgp()) && - Objects.equals(this.bgpPeers, that.getBgpPeersList()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.interfaces, that.getInterfacesList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.bgp, that.getBgp()) + && Objects.equals(this.bgpPeers, that.getBgpPeersList()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.interfaces, that.getInterfacesList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @@ -510,17 +518,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - bgp, - bgpPeers, - creationTimestamp, - description, - id, - interfaces, - kind, - name, - network, - region, - selfLink - ); + bgp, + bgpPeers, + creationTimestamp, + description, + id, + interfaces, + kind, + name, + network, + region, + selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java index f4877c6028b3..d740b89abec4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private RouterAdvertisedIpRange() { this.range = null; } - - private RouterAdvertisedIpRange( - String description, - String range - ) { + private RouterAdvertisedIpRange(String description, String range) { this.description = description; this.range = range; } @@ -86,22 +79,24 @@ public String getRange() { return range; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterAdvertisedIpRange prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterAdvertisedIpRange getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterAdvertisedIpRange DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterAdvertisedIpRange(); } @@ -146,13 +141,9 @@ public Builder setRange(String range) { return this; } - public RouterAdvertisedIpRange build() { - return new RouterAdvertisedIpRange( - description, - range - ); + return new RouterAdvertisedIpRange(description, range); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "RouterAdvertisedIpRange{" - + "description=" + description + ", " - + "range=" + range + + "description=" + + description + + ", " + + "range=" + + range + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof RouterAdvertisedIpRange) { RouterAdvertisedIpRange that = (RouterAdvertisedIpRange) o; - return - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.range, that.getRange()) - ; + return Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.range, that.getRange()); } return false; } @Override public int hashCode() { - return Objects.hash( - description, - range - ); + return Objects.hash(description, range); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java index e9b6858abc23..cff265feafde 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private RouterAggregatedList() { this.warning = null; } - private RouterAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public RouterAggregatedList build() { - - - - - return new RouterAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new RouterAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "RouterAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof RouterAggregatedList) { RouterAggregatedList that = (RouterAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java index 8b2dadf80ddd..0aebfe3071b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -44,13 +43,11 @@ private RouterBgp() { this.asn = null; } - private RouterBgp( String advertiseMode, List advertisedGroups, List advertisedIpRanges, - Integer asn - ) { + Integer asn) { this.advertiseMode = advertiseMode; this.advertisedGroups = advertisedGroups; this.advertisedIpRanges = advertisedIpRanges; @@ -122,22 +119,24 @@ public Integer getAsn() { return asn; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterBgp prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterBgp getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterBgp DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterBgp(); } @@ -226,17 +225,9 @@ public Builder setAsn(Integer asn) { return this; } - public RouterBgp build() { - - - return new RouterBgp( - advertiseMode, - advertisedGroups, - advertisedIpRanges, - asn - ); + return new RouterBgp(advertiseMode, advertisedGroups, advertisedIpRanges, asn); } public Builder clone() { @@ -252,10 +243,17 @@ public Builder clone() { @Override public String toString() { return "RouterBgp{" - + "advertiseMode=" + advertiseMode + ", " - + "advertisedGroups=" + advertisedGroups + ", " - + "advertisedIpRanges=" + advertisedIpRanges + ", " - + "asn=" + asn + + "advertiseMode=" + + advertiseMode + + ", " + + "advertisedGroups=" + + advertisedGroups + + ", " + + "advertisedIpRanges=" + + advertisedIpRanges + + ", " + + "asn=" + + asn + "}"; } @@ -266,23 +264,16 @@ public boolean equals(Object o) { } if (o instanceof RouterBgp) { RouterBgp that = (RouterBgp) o; - return - Objects.equals(this.advertiseMode, that.getAdvertiseMode()) && - Objects.equals(this.advertisedGroups, that.getAdvertisedGroupsList()) && - Objects.equals(this.advertisedIpRanges, that.getAdvertisedIpRangesList()) && - Objects.equals(this.asn, that.getAsn()) - ; + return Objects.equals(this.advertiseMode, that.getAdvertiseMode()) + && Objects.equals(this.advertisedGroups, that.getAdvertisedGroupsList()) + && Objects.equals(this.advertisedIpRanges, that.getAdvertisedIpRangesList()) + && Objects.equals(this.asn, that.getAsn()); } return false; } @Override public int hashCode() { - return Objects.hash( - advertiseMode, - advertisedGroups, - advertisedIpRanges, - asn - ); + return Objects.hash(advertiseMode, advertisedGroups, advertisedIpRanges, asn); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java index 353e02d6c034..2520f0b75206 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -54,7 +53,6 @@ private RouterBgpPeer() { this.peerIpAddress = null; } - private RouterBgpPeer( String advertiseMode, List advertisedGroups, @@ -64,8 +62,7 @@ private RouterBgpPeer( String ipAddress, String name, Integer peerAsn, - String peerIpAddress - ) { + String peerIpAddress) { this.advertiseMode = advertiseMode; this.advertisedGroups = advertisedGroups; this.advertisedIpRanges = advertisedIpRanges; @@ -98,7 +95,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("advertisedIpRanges", stringList.build()); } if (fieldNames.contains("advertisedRoutePriority") && advertisedRoutePriority != null) { - fieldMap.put("advertisedRoutePriority", Collections.singletonList(String.valueOf(advertisedRoutePriority))); + fieldMap.put( + "advertisedRoutePriority", + Collections.singletonList(String.valueOf(advertisedRoutePriority))); } if (fieldNames.contains("interfaceName") && interfaceName != null) { fieldMap.put("interfaceName", Collections.singletonList(String.valueOf(interfaceName))); @@ -192,22 +191,24 @@ public String getPeerIpAddress() { return peerIpAddress; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterBgpPeer prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterBgpPeer getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterBgpPeer DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterBgpPeer(); } @@ -366,27 +367,18 @@ public Builder setPeerIpAddress(String peerIpAddress) { return this; } - public RouterBgpPeer build() { - - - - - - - return new RouterBgpPeer( - advertiseMode, - advertisedGroups, - advertisedIpRanges, - advertisedRoutePriority, - interfaceName, - ipAddress, - name, - peerAsn, - peerIpAddress - ); + advertiseMode, + advertisedGroups, + advertisedIpRanges, + advertisedRoutePriority, + interfaceName, + ipAddress, + name, + peerAsn, + peerIpAddress); } public Builder clone() { @@ -407,15 +399,32 @@ public Builder clone() { @Override public String toString() { return "RouterBgpPeer{" - + "advertiseMode=" + advertiseMode + ", " - + "advertisedGroups=" + advertisedGroups + ", " - + "advertisedIpRanges=" + advertisedIpRanges + ", " - + "advertisedRoutePriority=" + advertisedRoutePriority + ", " - + "interfaceName=" + interfaceName + ", " - + "ipAddress=" + ipAddress + ", " - + "name=" + name + ", " - + "peerAsn=" + peerAsn + ", " - + "peerIpAddress=" + peerIpAddress + + "advertiseMode=" + + advertiseMode + + ", " + + "advertisedGroups=" + + advertisedGroups + + ", " + + "advertisedIpRanges=" + + advertisedIpRanges + + ", " + + "advertisedRoutePriority=" + + advertisedRoutePriority + + ", " + + "interfaceName=" + + interfaceName + + ", " + + "ipAddress=" + + ipAddress + + ", " + + "name=" + + name + + ", " + + "peerAsn=" + + peerAsn + + ", " + + "peerIpAddress=" + + peerIpAddress + "}"; } @@ -426,17 +435,15 @@ public boolean equals(Object o) { } if (o instanceof RouterBgpPeer) { RouterBgpPeer that = (RouterBgpPeer) o; - return - Objects.equals(this.advertiseMode, that.getAdvertiseMode()) && - Objects.equals(this.advertisedGroups, that.getAdvertisedGroupsList()) && - Objects.equals(this.advertisedIpRanges, that.getAdvertisedIpRangesList()) && - Objects.equals(this.advertisedRoutePriority, that.getAdvertisedRoutePriority()) && - Objects.equals(this.interfaceName, that.getInterfaceName()) && - Objects.equals(this.ipAddress, that.getIpAddress()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.peerAsn, that.getPeerAsn()) && - Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) - ; + return Objects.equals(this.advertiseMode, that.getAdvertiseMode()) + && Objects.equals(this.advertisedGroups, that.getAdvertisedGroupsList()) + && Objects.equals(this.advertisedIpRanges, that.getAdvertisedIpRangesList()) + && Objects.equals(this.advertisedRoutePriority, that.getAdvertisedRoutePriority()) + && Objects.equals(this.interfaceName, that.getInterfaceName()) + && Objects.equals(this.ipAddress, that.getIpAddress()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.peerAsn, that.getPeerAsn()) + && Objects.equals(this.peerIpAddress, that.getPeerIpAddress()); } return false; } @@ -444,15 +451,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - advertiseMode, - advertisedGroups, - advertisedIpRanges, - advertisedRoutePriority, - interfaceName, - ipAddress, - name, - peerAsn, - peerIpAddress - ); + advertiseMode, + advertisedGroups, + advertisedIpRanges, + advertisedRoutePriority, + interfaceName, + ipAddress, + name, + peerAsn, + peerIpAddress); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java index 101e686c5003..1730ac2b76d1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.RouterStub; import com.google.cloud.compute.v1.stub.RouterStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,33 @@ * *

* - *

Note: close() needs to be called on the routerClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the routerClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of RouterSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of RouterSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class RouterClient implements BackgroundResource {
   private final RouterSettings settings;
   private final RouterStub stub;
 
-
-
-  /**
-   * Constructs an instance of RouterClient with default settings.
-   */
+  /** Constructs an instance of RouterClient with default settings. */
   public static final RouterClient create() throws IOException {
     return create(RouterSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of RouterClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of RouterClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final RouterClient create(RouterSettings settings) throws IOException {
     return new RouterClient(settings);
@@ -144,9 +128,8 @@ public static final RouterClient create(RouterStub stub) {
   }
 
   /**
-   * Constructs an instance of RouterClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of RouterClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected RouterClient(RouterSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +151,12 @@ public RouterStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of routers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -190,8 +173,8 @@ public RouterStub getStub() {
   public final AggregatedListRoutersPagedResponse aggregatedListRouters(ProjectName project) {
     AggregatedListRoutersHttpRequest request =
         AggregatedListRoutersHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListRouters(request);
   }
 
@@ -199,7 +182,8 @@ public final AggregatedListRoutersPagedResponse aggregatedListRouters(ProjectNam
   /**
    * Retrieves an aggregated list of routers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -215,9 +199,7 @@ public final AggregatedListRoutersPagedResponse aggregatedListRouters(ProjectNam
   @BetaApi
   public final AggregatedListRoutersPagedResponse aggregatedListRouters(String project) {
     AggregatedListRoutersHttpRequest request =
-        AggregatedListRoutersHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListRoutersHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListRouters(request);
   }
 
@@ -225,7 +207,8 @@ public final AggregatedListRoutersPagedResponse aggregatedListRouters(String pro
   /**
    * Retrieves an aggregated list of routers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +225,17 @@ public final AggregatedListRoutersPagedResponse aggregatedListRouters(String pro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListRoutersPagedResponse aggregatedListRouters(AggregatedListRoutersHttpRequest request) {
-    return aggregatedListRoutersPagedCallable()
-        .call(request);
+  public final AggregatedListRoutersPagedResponse aggregatedListRouters(
+      AggregatedListRoutersHttpRequest request) {
+    return aggregatedListRoutersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of routers.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +251,8 @@ public final AggregatedListRoutersPagedResponse aggregatedListRouters(Aggregated
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListRoutersPagedCallable() { + public final UnaryCallable + aggregatedListRoutersPagedCallable() { return stub.aggregatedListRoutersPagedCallable(); } @@ -275,7 +260,8 @@ public final UnaryCallableSample code: + * *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +284,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListRoutersCallable() { + public final UnaryCallable + aggregatedListRoutersCallable() { return stub.aggregatedListRoutersCallable(); } @@ -306,7 +293,8 @@ public final UnaryCallableSample code: + * *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -316,11 +304,15 @@ public final UnaryCallable
* * @param router Name of the Router resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -328,9 +320,9 @@ public final Operation deleteRouter(ProjectRegionRouterName router, String reque DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder() - .setRouter(router == null ? null : router.toString()) - .setRequestId(requestId) - .build(); + .setRouter(router == null ? null : router.toString()) + .setRequestId(requestId) + .build(); return deleteRouter(request); } @@ -338,7 +330,8 @@ public final Operation deleteRouter(ProjectRegionRouterName router, String reque /** * Deletes the specified Router resource. * - * Sample code: + *

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -348,21 +341,22 @@ public final Operation deleteRouter(ProjectRegionRouterName router, String reque
    * 
* * @param router Name of the Router resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteRouter(String router, String requestId) { DeleteRouterHttpRequest request = - DeleteRouterHttpRequest.newBuilder() - .setRouter(router) - .setRequestId(requestId) - .build(); + DeleteRouterHttpRequest.newBuilder().setRouter(router).setRequestId(requestId).build(); return deleteRouter(request); } @@ -370,7 +364,8 @@ public final Operation deleteRouter(String router, String requestId) { /** * Deletes the specified Router resource. * - * Sample code: + *

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -395,7 +390,8 @@ public final Operation deleteRouter(DeleteRouterHttpRequest request) {
   /**
    * Deletes the specified Router resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -417,9 +413,11 @@ public final UnaryCallable deleteRouterCalla
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Router resource. Get a list of available routers by making a list() request.
+   * Returns the specified Router resource. Get a list of available routers by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -435,16 +433,18 @@ public final Router getRouter(ProjectRegionRouterName router) {
 
     GetRouterHttpRequest request =
         GetRouterHttpRequest.newBuilder()
-        .setRouter(router == null ? null : router.toString())
-        .build();
+            .setRouter(router == null ? null : router.toString())
+            .build();
     return getRouter(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Router resource. Get a list of available routers by making a list() request.
+   * Returns the specified Router resource. Get a list of available routers by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -458,18 +458,17 @@ public final Router getRouter(ProjectRegionRouterName router) {
   @BetaApi
   public final Router getRouter(String router) {
 
-    GetRouterHttpRequest request =
-        GetRouterHttpRequest.newBuilder()
-        .setRouter(router)
-        .build();
+    GetRouterHttpRequest request = GetRouterHttpRequest.newBuilder().setRouter(router).build();
     return getRouter(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Router resource. Get a list of available routers by making a list() request.
+   * Returns the specified Router resource. Get a list of available routers by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -490,9 +489,11 @@ public final Router getRouter(GetRouterHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Router resource. Get a list of available routers by making a list() request.
+   * Returns the specified Router resource. Get a list of available routers by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -514,7 +515,8 @@ public final UnaryCallable getRouterCallable() {
   /**
    * Retrieves runtime information of the specified router.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -530,8 +532,8 @@ public final RouterStatusResponse getRouterStatusRouter(ProjectRegionRouterName
 
     GetRouterStatusRouterHttpRequest request =
         GetRouterStatusRouterHttpRequest.newBuilder()
-        .setRouter(router == null ? null : router.toString())
-        .build();
+            .setRouter(router == null ? null : router.toString())
+            .build();
     return getRouterStatusRouter(request);
   }
 
@@ -539,7 +541,8 @@ public final RouterStatusResponse getRouterStatusRouter(ProjectRegionRouterName
   /**
    * Retrieves runtime information of the specified router.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -554,9 +557,7 @@ public final RouterStatusResponse getRouterStatusRouter(ProjectRegionRouterName
   public final RouterStatusResponse getRouterStatusRouter(String router) {
 
     GetRouterStatusRouterHttpRequest request =
-        GetRouterStatusRouterHttpRequest.newBuilder()
-        .setRouter(router)
-        .build();
+        GetRouterStatusRouterHttpRequest.newBuilder().setRouter(router).build();
     return getRouterStatusRouter(request);
   }
 
@@ -564,7 +565,8 @@ public final RouterStatusResponse getRouterStatusRouter(String router) {
   /**
    * Retrieves runtime information of the specified router.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -579,7 +581,8 @@ public final RouterStatusResponse getRouterStatusRouter(String router) {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RouterStatusResponse getRouterStatusRouter(GetRouterStatusRouterHttpRequest request) {
+  public final RouterStatusResponse getRouterStatusRouter(
+      GetRouterStatusRouterHttpRequest request) {
     return getRouterStatusRouterCallable().call(request);
   }
 
@@ -587,7 +590,8 @@ public final RouterStatusResponse getRouterStatusRouter(GetRouterStatusRouterHtt
   /**
    * Retrieves runtime information of the specified router.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -601,15 +605,18 @@ public final RouterStatusResponse getRouterStatusRouter(GetRouterStatusRouterHtt
    * 
*/ @BetaApi - public final UnaryCallable getRouterStatusRouterCallable() { + public final UnaryCallable + getRouterStatusRouterCallable() { return stub.getRouterStatusRouterCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a Router resource in the specified project and region using the data included in the request. + * Creates a Router resource in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
@@ -619,32 +626,39 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRouter(String requestId, ProjectRegionName region, Router routerResource) { + public final Operation insertRouter( + String requestId, ProjectRegionName region, Router routerResource) { InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setRouterResource(routerResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setRouterResource(routerResource) + .build(); return insertRouter(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a Router resource in the specified project and region using the data included in the request. + * Creates a Router resource in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
@@ -654,11 +668,15 @@ public final Operation insertRouter(String requestId, ProjectRegionName region,
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -668,18 +686,20 @@ public final Operation insertRouter(String requestId, String region, Router rout InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setRouterResource(routerResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setRouterResource(routerResource) + .build(); return insertRouter(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a Router resource in the specified project and region using the data included in the request. + * Creates a Router resource in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
@@ -704,9 +724,11 @@ public final Operation insertRouter(InsertRouterHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a Router resource in the specified project and region using the data included in the request.
+   * Creates a Router resource in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   String requestId = "";
@@ -732,7 +754,8 @@ public final UnaryCallable insertRouterCalla
   /**
    * Retrieves a list of Router resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -749,8 +772,8 @@ public final UnaryCallable insertRouterCalla
   public final ListRoutersPagedResponse listRouters(ProjectRegionName region) {
     ListRoutersHttpRequest request =
         ListRoutersHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listRouters(request);
   }
 
@@ -758,7 +781,8 @@ public final ListRoutersPagedResponse listRouters(ProjectRegionName region) {
   /**
    * Retrieves a list of Router resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -773,10 +797,7 @@ public final ListRoutersPagedResponse listRouters(ProjectRegionName region) {
    */
   @BetaApi
   public final ListRoutersPagedResponse listRouters(String region) {
-    ListRoutersHttpRequest request =
-        ListRoutersHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+    ListRoutersHttpRequest request = ListRoutersHttpRequest.newBuilder().setRegion(region).build();
     return listRouters(request);
   }
 
@@ -784,7 +805,8 @@ public final ListRoutersPagedResponse listRouters(String region) {
   /**
    * Retrieves a list of Router resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -802,15 +824,15 @@ public final ListRoutersPagedResponse listRouters(String region) {
    */
   @BetaApi
   public final ListRoutersPagedResponse listRouters(ListRoutersHttpRequest request) {
-    return listRoutersPagedCallable()
-        .call(request);
+    return listRoutersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of Router resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -826,7 +848,8 @@ public final ListRoutersPagedResponse listRouters(ListRoutersHttpRequest request
    * 
*/ @BetaApi - public final UnaryCallable listRoutersPagedCallable() { + public final UnaryCallable + listRoutersPagedCallable() { return stub.listRoutersPagedCallable(); } @@ -834,7 +857,8 @@ public final UnaryCallable lis /** * Retrieves a list of Router resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -863,9 +887,11 @@ public final UnaryCallable listRoutersCallab
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -876,31 +902,38 @@ public final UnaryCallable listRoutersCallab
    * 
* * @param router Name of the Router resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRouter(ProjectRegionRouterName router, String requestId, Router routerResource) { + public final Operation patchRouter( + ProjectRegionRouterName router, String requestId, Router routerResource) { PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder() - .setRouter(router == null ? null : router.toString()) - .setRequestId(requestId) - .setRouterResource(routerResource) - .build(); + .setRouter(router == null ? null : router.toString()) + .setRequestId(requestId) + .setRouterResource(routerResource) + .build(); return patchRouter(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -911,11 +944,15 @@ public final Operation patchRouter(ProjectRegionRouterName router, String reques
    * 
* * @param router Name of the Router resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -924,18 +961,20 @@ public final Operation patchRouter(String router, String requestId, Router route PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder() - .setRouter(router) - .setRequestId(requestId) - .setRouterResource(routerResource) - .build(); + .setRouter(router) + .setRequestId(requestId) + .setRouterResource(routerResource) + .build(); return patchRouter(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -960,9 +999,11 @@ public final Operation patchRouter(PatchRouterHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -986,9 +1027,11 @@ public final UnaryCallable patchRouterCallabl
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.
+   * Preview fields auto-generated during router create and update operations. Calling this method
+   * does NOT create or update the router.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1002,21 +1045,24 @@ public final UnaryCallable patchRouterCallabl
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final RoutersPreviewResponse previewRouter(ProjectRegionRouterName router, Router routerResource) {
+  public final RoutersPreviewResponse previewRouter(
+      ProjectRegionRouterName router, Router routerResource) {
 
     PreviewRouterHttpRequest request =
         PreviewRouterHttpRequest.newBuilder()
-        .setRouter(router == null ? null : router.toString())
-        .setRouterResource(routerResource)
-        .build();
+            .setRouter(router == null ? null : router.toString())
+            .setRouterResource(routerResource)
+            .build();
     return previewRouter(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.
+   * Preview fields auto-generated during router create and update operations. Calling this method
+   * does NOT create or update the router.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1034,17 +1080,19 @@ public final RoutersPreviewResponse previewRouter(String router, Router routerRe
 
     PreviewRouterHttpRequest request =
         PreviewRouterHttpRequest.newBuilder()
-        .setRouter(router)
-        .setRouterResource(routerResource)
-        .build();
+            .setRouter(router)
+            .setRouterResource(routerResource)
+            .build();
     return previewRouter(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.
+   * Preview fields auto-generated during router create and update operations. Calling this method
+   * does NOT create or update the router.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1067,9 +1115,11 @@ public final RoutersPreviewResponse previewRouter(PreviewRouterHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.
+   * Preview fields auto-generated during router create and update operations. Calling this method
+   * does NOT create or update the router.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1085,7 +1135,8 @@ public final RoutersPreviewResponse previewRouter(PreviewRouterHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable previewRouterCallable() { + public final UnaryCallable + previewRouterCallable() { return stub.previewRouterCallable(); } @@ -1093,7 +1144,8 @@ public final UnaryCallable pre /** * Updates the specified Router resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1104,23 +1156,28 @@ public final UnaryCallable pre
    * 
* * @param router Name of the Router resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRouter(ProjectRegionRouterName router, String requestId, Router routerResource) { + public final Operation updateRouter( + ProjectRegionRouterName router, String requestId, Router routerResource) { UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder() - .setRouter(router == null ? null : router.toString()) - .setRequestId(requestId) - .setRouterResource(routerResource) - .build(); + .setRouter(router == null ? null : router.toString()) + .setRequestId(requestId) + .setRouterResource(routerResource) + .build(); return updateRouter(request); } @@ -1128,7 +1185,8 @@ public final Operation updateRouter(ProjectRegionRouterName router, String reque /** * Updates the specified Router resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1139,11 +1197,15 @@ public final Operation updateRouter(ProjectRegionRouterName router, String reque
    * 
* * @param router Name of the Router resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1152,10 +1214,10 @@ public final Operation updateRouter(String router, String requestId, Router rout UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder() - .setRouter(router) - .setRequestId(requestId) - .setRouterResource(routerResource) - .build(); + .setRouter(router) + .setRequestId(requestId) + .setRouterResource(routerResource) + .build(); return updateRouter(request); } @@ -1163,7 +1225,8 @@ public final Operation updateRouter(String router, String requestId, Router rout /** * Updates the specified Router resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1190,7 +1253,8 @@ public final Operation updateRouter(UpdateRouterHttpRequest request) {
   /**
    * Updates the specified Router resource with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
@@ -1213,7 +1277,7 @@ public final UnaryCallable updateRouterCalla
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -1242,15 +1306,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListRoutersPagedResponse extends AbstractPagedListResponse<
-      AggregatedListRoutersHttpRequest,
-      RouterAggregatedList,
-      RoutersScopedList,
-      AggregatedListRoutersPage,
-      AggregatedListRoutersFixedSizeCollection> {
+  public static class AggregatedListRoutersPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList, RoutersScopedList,
+          AggregatedListRoutersPage, AggregatedListRoutersFixedSizeCollection> {
 
     public static ApiFuture createAsync(
-        PageContext context,
+        PageContext
+            context,
         ApiFuture futureResponse) {
       ApiFuture futurePage =
           AggregatedListRoutersPage.createEmptyPage().createPageAsync(context, futureResponse);
@@ -1267,18 +1330,16 @@ public AggregatedListRoutersPagedResponse apply(AggregatedListRoutersPage input)
     private AggregatedListRoutersPagedResponse(AggregatedListRoutersPage page) {
       super(page, AggregatedListRoutersFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListRoutersPage extends AbstractPage<
-      AggregatedListRoutersHttpRequest,
-      RouterAggregatedList,
-      RoutersScopedList,
-      AggregatedListRoutersPage> {
+  public static class AggregatedListRoutersPage
+      extends AbstractPage<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList, RoutersScopedList,
+          AggregatedListRoutersPage> {
 
     private AggregatedListRoutersPage(
-        PageContext context,
+        PageContext
+            context,
         RouterAggregatedList response) {
       super(context, response);
     }
@@ -1289,31 +1350,28 @@ private static AggregatedListRoutersPage createEmptyPage() {
 
     @Override
     protected AggregatedListRoutersPage createPage(
-        PageContext context,
+        PageContext
+            context,
         RouterAggregatedList response) {
       return new AggregatedListRoutersPage(context, response);
     }
 
     @Override
     public ApiFuture createPageAsync(
-        PageContext context,
+        PageContext
+            context,
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListRoutersFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListRoutersHttpRequest,
-      RouterAggregatedList,
-      RoutersScopedList,
-      AggregatedListRoutersPage,
-      AggregatedListRoutersFixedSizeCollection> {
+  public static class AggregatedListRoutersFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList, RoutersScopedList,
+          AggregatedListRoutersPage, AggregatedListRoutersFixedSizeCollection> {
 
-    private AggregatedListRoutersFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListRoutersFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -1326,15 +1384,12 @@ protected AggregatedListRoutersFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListRoutersFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListRoutersPagedResponse extends AbstractPagedListResponse<
-      ListRoutersHttpRequest,
-      RouterList,
-      Router,
-      ListRoutersPage,
-      ListRoutersFixedSizeCollection> {
+
+  public static class ListRoutersPagedResponse
+      extends AbstractPagedListResponse<
+          ListRoutersHttpRequest, RouterList, Router, ListRoutersPage,
+          ListRoutersFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -1354,19 +1409,13 @@ public ListRoutersPagedResponse apply(ListRoutersPage input) {
     private ListRoutersPagedResponse(ListRoutersPage page) {
       super(page, ListRoutersFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListRoutersPage extends AbstractPage<
-      ListRoutersHttpRequest,
-      RouterList,
-      Router,
-      ListRoutersPage> {
+  public static class ListRoutersPage
+      extends AbstractPage {
 
     private ListRoutersPage(
-        PageContext context,
-        RouterList response) {
+        PageContext context, RouterList response) {
       super(context, response);
     }
 
@@ -1376,8 +1425,7 @@ private static ListRoutersPage createEmptyPage() {
 
     @Override
     protected ListRoutersPage createPage(
-        PageContext context,
-        RouterList response) {
+        PageContext context, RouterList response) {
       return new ListRoutersPage(context, response);
     }
 
@@ -1387,18 +1435,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListRoutersFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListRoutersHttpRequest,
-      RouterList,
-      Router,
-      ListRoutersPage,
-      ListRoutersFixedSizeCollection> {
+  public static class ListRoutersFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListRoutersHttpRequest, RouterList, Router, ListRoutersPage,
+          ListRoutersFixedSizeCollection> {
 
     private ListRoutersFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -1413,7 +1455,5 @@ protected ListRoutersFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListRoutersFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
index c3db11f9e652..2685c57f2a0a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
@@ -17,9 +17,6 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -44,13 +41,8 @@ private RouterInterface() {
     this.name = null;
   }
 
-
   private RouterInterface(
-      String ipRange,
-      String linkedInterconnectAttachment,
-      String linkedVpnTunnel,
-      String name
-      ) {
+      String ipRange, String linkedInterconnectAttachment, String linkedVpnTunnel, String name) {
     this.ipRange = ipRange;
     this.linkedInterconnectAttachment = linkedInterconnectAttachment;
     this.linkedVpnTunnel = linkedVpnTunnel;
@@ -63,8 +55,11 @@ public Map> populateFieldsInMap(Set fieldNames) {
     if (fieldNames.contains("ipRange") && ipRange != null) {
       fieldMap.put("ipRange", Collections.singletonList(String.valueOf(ipRange)));
     }
-    if (fieldNames.contains("linkedInterconnectAttachment") && linkedInterconnectAttachment != null) {
-      fieldMap.put("linkedInterconnectAttachment", Collections.singletonList(String.valueOf(linkedInterconnectAttachment)));
+    if (fieldNames.contains("linkedInterconnectAttachment")
+        && linkedInterconnectAttachment != null) {
+      fieldMap.put(
+          "linkedInterconnectAttachment",
+          Collections.singletonList(String.valueOf(linkedInterconnectAttachment)));
     }
     if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) {
       fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel)));
@@ -114,22 +109,24 @@ public String getName() {
     return name;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(RouterInterface prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static RouterInterface getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final RouterInterface DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new RouterInterface();
   }
@@ -202,17 +199,9 @@ public Builder setName(String name) {
       return this;
     }
 
-
     public RouterInterface build() {
 
-
-
-      return new RouterInterface(
-        ipRange,
-        linkedInterconnectAttachment,
-        linkedVpnTunnel,
-        name
-      );
+      return new RouterInterface(ipRange, linkedInterconnectAttachment, linkedVpnTunnel, name);
     }
 
     public Builder clone() {
@@ -228,10 +217,17 @@ public Builder clone() {
   @Override
   public String toString() {
     return "RouterInterface{"
-        + "ipRange=" + ipRange + ", "
-        + "linkedInterconnectAttachment=" + linkedInterconnectAttachment + ", "
-        + "linkedVpnTunnel=" + linkedVpnTunnel + ", "
-        + "name=" + name
+        + "ipRange="
+        + ipRange
+        + ", "
+        + "linkedInterconnectAttachment="
+        + linkedInterconnectAttachment
+        + ", "
+        + "linkedVpnTunnel="
+        + linkedVpnTunnel
+        + ", "
+        + "name="
+        + name
         + "}";
   }
 
@@ -242,23 +238,17 @@ public boolean equals(Object o) {
     }
     if (o instanceof RouterInterface) {
       RouterInterface that = (RouterInterface) o;
-      return
-          Objects.equals(this.ipRange, that.getIpRange()) &&
-          Objects.equals(this.linkedInterconnectAttachment, that.getLinkedInterconnectAttachment()) &&
-          Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel()) &&
-          Objects.equals(this.name, that.getName())
-          ;
+      return Objects.equals(this.ipRange, that.getIpRange())
+          && Objects.equals(
+              this.linkedInterconnectAttachment, that.getLinkedInterconnectAttachment())
+          && Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel())
+          && Objects.equals(this.name, that.getName());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      ipRange,
-      linkedInterconnectAttachment,
-      linkedVpnTunnel,
-      name
-    );
+    return Objects.hash(ipRange, linkedInterconnectAttachment, linkedVpnTunnel, name);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
index 3ec5b4c8861e..6a1c16d705b5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private RouterList() {
     this.warning = null;
   }
 
-
   private RouterList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(RouterList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static RouterList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final RouterList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new RouterList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public RouterList build() {
 
-
-
-
-
-      return new RouterList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new RouterList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "RouterList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof RouterList) {
       RouterList that = (RouterList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java
deleted file mode 100644
index 277403c2a8a8..000000000000
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterName.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 2018 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.compute.v1;
-
-import com.google.api.core.BetaApi;
-import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceNameFactory;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Generated;
-
-@Generated("by GAPIC")
-@BetaApi
-public final class RouterName implements com.google.api.resourcenames.ResourceName {
-  private final String project;
-  private final String region;
-  private final String router;
-  private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/routers/{router}");
-
-  private volatile Map fieldValuesMap;
-
-  public static Builder newBuilder() {
-    return new Builder();
-  }
-
-  public Builder toBuilder() {
-    return new Builder(this);
-  }
-
-  private RouterName(Builder builder) {
-    project = Preconditions.checkNotNull(builder.getProject());
-    region = Preconditions.checkNotNull(builder.getRegion());
-    router = Preconditions.checkNotNull(builder.getRouter());
-  }
-
-  public static RouterName of(
-      String project,
-      String region,
-      String router
-      ) {
-    return newBuilder()
-    .setProject(project)
-    .setRegion(region)
-    .setRouter(router)
-      .build();
-  }
-
-  public static String format(
-      String project,
-      String region,
-      String router
-      ) {
-    return of(
-        project,
-        region,
-        router
-        )
-        .toString();
-  }
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getRegion() {
-    return region;
-  }
-
-  public String getRouter() {
-    return router;
-  }
-
-
-  @Override
-  public Map getFieldValuesMap() {
-    if (fieldValuesMap == null) {
-      synchronized (this) {
-        if (fieldValuesMap == null) {
-          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
-          fieldMapBuilder.put("project", project);
-          fieldMapBuilder.put("region", region);
-          fieldMapBuilder.put("router", router);
-          fieldValuesMap = fieldMapBuilder.build();
-        }
-      }
-    }
-    return fieldValuesMap;
-  }
-
-  public String getFieldValue(String fieldName) {
-    return getFieldValuesMap().get(fieldName);
-  }
-
-
-  public static ResourceNameFactory newFactory() {
-    return new ResourceNameFactory() {
-      public RouterName parse(String formattedString) {return RouterName.parse(formattedString);}
-    };
-  }
-
-  public static RouterName parse(String formattedString) {
-    Map matchMap =
-        PATH_TEMPLATE.validatedMatch(formattedString, "RouterName.parse: formattedString not in valid format");
-    return of(
-      matchMap.get("project"),
-      matchMap.get("region"),
-      matchMap.get("router")
-    );
-  }
-
-  public static boolean isParsableFrom(String formattedString) {
-    return PATH_TEMPLATE.matches(formattedString);
-  }
-
-  public static class Builder {
-    private String project;
-    private String region;
-    private String router;
-
-    public String getProject() {
-      return project;
-    }
-    public String getRegion() {
-      return region;
-    }
-    public String getRouter() {
-      return router;
-    }
-
-    public Builder setProject(String project) {
-      this.project = project;
-      return this;
-    }
-    public Builder setRegion(String region) {
-      this.region = region;
-      return this;
-    }
-    public Builder setRouter(String router) {
-      this.router = router;
-      return this;
-    }
-
-    private Builder() {}
-
-    public Builder (RouterName routerName) {
-      project = routerName.project;
-      region = routerName.region;
-      router = routerName.router;
-    }
-
-    public RouterName build() {
-      return new RouterName(this);
-    }
-  }
-
-  @Override
-  public String toString() {
-    return PATH_TEMPLATE.instantiate(
-        "project", project,
-        "region", region,
-        "router", router
-        );
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o instanceof RouterName) {
-      RouterName that = (RouterName) o;
-      return
-          Objects.equals(this.project, that.getProject()) &&
-          Objects.equals(this.region, that.getRegion()) &&
-          Objects.equals(this.router, that.getRouter())
-          ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(
-      project,
-      region,
-      router
-    );
-  }
-}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java
index 0e43780cbda2..c95d9229354f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java
@@ -15,46 +15,24 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse;
+import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse;
-import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse;
 import com.google.cloud.compute.v1.stub.RouterStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -63,15 +41,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRouter to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRouter to 30 seconds: * *

  * 
@@ -86,112 +64,88 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RouterSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListRouters.
-   */
-  public PagedCallSettings aggregatedListRoutersSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListRouters. */
+  public PagedCallSettings<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList,
+          AggregatedListRoutersPagedResponse>
+      aggregatedListRoutersSettings() {
     return ((RouterStubSettings) getStubSettings()).aggregatedListRoutersSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteRouter.
-   */
+  /** Returns the object with the settings used for calls to deleteRouter. */
   public UnaryCallSettings deleteRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).deleteRouterSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRouter.
-   */
+  /** Returns the object with the settings used for calls to getRouter. */
   public UnaryCallSettings getRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).getRouterSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRouterStatusRouter.
-   */
-  public UnaryCallSettings getRouterStatusRouterSettings() {
+  /** Returns the object with the settings used for calls to getRouterStatusRouter. */
+  public UnaryCallSettings
+      getRouterStatusRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).getRouterStatusRouterSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRouter.
-   */
+  /** Returns the object with the settings used for calls to insertRouter. */
   public UnaryCallSettings insertRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).insertRouterSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRouters.
-   */
-  public PagedCallSettings listRoutersSettings() {
+  /** Returns the object with the settings used for calls to listRouters. */
+  public PagedCallSettings
+      listRoutersSettings() {
     return ((RouterStubSettings) getStubSettings()).listRoutersSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchRouter.
-   */
+  /** Returns the object with the settings used for calls to patchRouter. */
   public UnaryCallSettings patchRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).patchRouterSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to previewRouter.
-   */
-  public UnaryCallSettings previewRouterSettings() {
+  /** Returns the object with the settings used for calls to previewRouter. */
+  public UnaryCallSettings
+      previewRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).previewRouterSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateRouter.
-   */
+  /** Returns the object with the settings used for calls to updateRouter. */
   public UnaryCallSettings updateRouterSettings() {
     return ((RouterStubSettings) getStubSettings()).updateRouterSettings();
   }
 
-
   public static final RouterSettings create(RouterStubSettings stub) throws IOException {
     return new RouterSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return RouterStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return RouterStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return RouterStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return RouterStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return RouterStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return RouterStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return RouterStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -204,23 +158,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return RouterStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -229,9 +177,7 @@ protected RouterSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for RouterSettings.
-   */
+  /** Builder for RouterSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -253,80 +199,70 @@ protected Builder(RouterStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public RouterStubSettings.Builder getStubSettingsBuilder() {
       return ((RouterStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListRouters. - */ - public PagedCallSettings.Builder aggregatedListRoutersSettings() { + /** Returns the builder for the settings used for calls to aggregatedListRouters. */ + public PagedCallSettings.Builder< + AggregatedListRoutersHttpRequest, RouterAggregatedList, + AggregatedListRoutersPagedResponse> + aggregatedListRoutersSettings() { return getStubSettingsBuilder().aggregatedListRoutersSettings(); } - /** - * Returns the builder for the settings used for calls to deleteRouter. - */ + /** Returns the builder for the settings used for calls to deleteRouter. */ public UnaryCallSettings.Builder deleteRouterSettings() { return getStubSettingsBuilder().deleteRouterSettings(); } - /** - * Returns the builder for the settings used for calls to getRouter. - */ + /** Returns the builder for the settings used for calls to getRouter. */ public UnaryCallSettings.Builder getRouterSettings() { return getStubSettingsBuilder().getRouterSettings(); } - /** - * Returns the builder for the settings used for calls to getRouterStatusRouter. - */ - public UnaryCallSettings.Builder getRouterStatusRouterSettings() { + /** Returns the builder for the settings used for calls to getRouterStatusRouter. */ + public UnaryCallSettings.Builder + getRouterStatusRouterSettings() { return getStubSettingsBuilder().getRouterStatusRouterSettings(); } - /** - * Returns the builder for the settings used for calls to insertRouter. - */ + /** Returns the builder for the settings used for calls to insertRouter. */ public UnaryCallSettings.Builder insertRouterSettings() { return getStubSettingsBuilder().insertRouterSettings(); } - /** - * Returns the builder for the settings used for calls to listRouters. - */ - public PagedCallSettings.Builder listRoutersSettings() { + /** Returns the builder for the settings used for calls to listRouters. */ + public PagedCallSettings.Builder + listRoutersSettings() { return getStubSettingsBuilder().listRoutersSettings(); } - /** - * Returns the builder for the settings used for calls to patchRouter. - */ + /** Returns the builder for the settings used for calls to patchRouter. */ public UnaryCallSettings.Builder patchRouterSettings() { return getStubSettingsBuilder().patchRouterSettings(); } - /** - * Returns the builder for the settings used for calls to previewRouter. - */ - public UnaryCallSettings.Builder previewRouterSettings() { + /** Returns the builder for the settings used for calls to previewRouter. */ + public UnaryCallSettings.Builder + previewRouterSettings() { return getStubSettingsBuilder().previewRouterSettings(); } - /** - * Returns the builder for the settings used for calls to updateRouter. - */ + /** Returns the builder for the settings used for calls to updateRouter. */ public UnaryCallSettings.Builder updateRouterSettings() { return getStubSettingsBuilder().updateRouterSettings(); } @@ -336,4 +272,4 @@ public RouterSettings build() throws IOException { return new RouterSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java index 3c7b249ed150..87cb1f3d6c20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -44,13 +43,11 @@ private RouterStatus() { this.network = null; } - private RouterStatus( List bestRoutes, List bestRoutesForRouter, List bgpPeerStatus, - String network - ) { + String network) { this.bestRoutes = bestRoutes; this.bestRoutesForRouter = bestRoutesForRouter; this.bgpPeerStatus = bgpPeerStatus; @@ -126,22 +123,24 @@ public String getNetwork() { return network; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterStatus prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterStatus getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterStatus DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterStatus(); } @@ -238,17 +237,9 @@ public Builder setNetwork(String network) { return this; } - public RouterStatus build() { - - - return new RouterStatus( - bestRoutes, - bestRoutesForRouter, - bgpPeerStatus, - network - ); + return new RouterStatus(bestRoutes, bestRoutesForRouter, bgpPeerStatus, network); } public Builder clone() { @@ -264,10 +255,17 @@ public Builder clone() { @Override public String toString() { return "RouterStatus{" - + "bestRoutes=" + bestRoutes + ", " - + "bestRoutesForRouter=" + bestRoutesForRouter + ", " - + "bgpPeerStatus=" + bgpPeerStatus + ", " - + "network=" + network + + "bestRoutes=" + + bestRoutes + + ", " + + "bestRoutesForRouter=" + + bestRoutesForRouter + + ", " + + "bgpPeerStatus=" + + bgpPeerStatus + + ", " + + "network=" + + network + "}"; } @@ -278,23 +276,16 @@ public boolean equals(Object o) { } if (o instanceof RouterStatus) { RouterStatus that = (RouterStatus) o; - return - Objects.equals(this.bestRoutes, that.getBestRoutesList()) && - Objects.equals(this.bestRoutesForRouter, that.getBestRoutesForRouterList()) && - Objects.equals(this.bgpPeerStatus, that.getBgpPeerStatusList()) && - Objects.equals(this.network, that.getNetwork()) - ; + return Objects.equals(this.bestRoutes, that.getBestRoutesList()) + && Objects.equals(this.bestRoutesForRouter, that.getBestRoutesForRouterList()) + && Objects.equals(this.bgpPeerStatus, that.getBgpPeerStatusList()) + && Objects.equals(this.network, that.getNetwork()); } return false; } @Override public int hashCode() { - return Objects.hash( - bestRoutes, - bestRoutesForRouter, - bgpPeerStatus, - network - ); + return Objects.hash(bestRoutes, bestRoutesForRouter, bgpPeerStatus, network); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java index 38a08a623252..abf4198ec76f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -56,7 +55,6 @@ private RouterStatusBgpPeerStatus() { this.uptimeSeconds = null; } - private RouterStatusBgpPeerStatus( List advertisedRoutes, String ipAddress, @@ -67,8 +65,7 @@ private RouterStatusBgpPeerStatus( String state, String status, String uptime, - String uptimeSeconds - ) { + String uptimeSeconds) { this.advertisedRoutes = advertisedRoutes; this.ipAddress = ipAddress; this.linkedVpnTunnel = linkedVpnTunnel; @@ -202,22 +199,24 @@ public String getUptimeSeconds() { return uptimeSeconds; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterStatusBgpPeerStatus prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterStatusBgpPeerStatus getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterStatusBgpPeerStatus DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterStatusBgpPeerStatus(); } @@ -382,29 +381,19 @@ public Builder setUptimeSeconds(String uptimeSeconds) { return this; } - public RouterStatusBgpPeerStatus build() { - - - - - - - - return new RouterStatusBgpPeerStatus( - advertisedRoutes, - ipAddress, - linkedVpnTunnel, - name, - numLearnedRoutes, - peerIpAddress, - state, - status, - uptime, - uptimeSeconds - ); + advertisedRoutes, + ipAddress, + linkedVpnTunnel, + name, + numLearnedRoutes, + peerIpAddress, + state, + status, + uptime, + uptimeSeconds); } public Builder clone() { @@ -426,16 +415,35 @@ public Builder clone() { @Override public String toString() { return "RouterStatusBgpPeerStatus{" - + "advertisedRoutes=" + advertisedRoutes + ", " - + "ipAddress=" + ipAddress + ", " - + "linkedVpnTunnel=" + linkedVpnTunnel + ", " - + "name=" + name + ", " - + "numLearnedRoutes=" + numLearnedRoutes + ", " - + "peerIpAddress=" + peerIpAddress + ", " - + "state=" + state + ", " - + "status=" + status + ", " - + "uptime=" + uptime + ", " - + "uptimeSeconds=" + uptimeSeconds + + "advertisedRoutes=" + + advertisedRoutes + + ", " + + "ipAddress=" + + ipAddress + + ", " + + "linkedVpnTunnel=" + + linkedVpnTunnel + + ", " + + "name=" + + name + + ", " + + "numLearnedRoutes=" + + numLearnedRoutes + + ", " + + "peerIpAddress=" + + peerIpAddress + + ", " + + "state=" + + state + + ", " + + "status=" + + status + + ", " + + "uptime=" + + uptime + + ", " + + "uptimeSeconds=" + + uptimeSeconds + "}"; } @@ -446,18 +454,16 @@ public boolean equals(Object o) { } if (o instanceof RouterStatusBgpPeerStatus) { RouterStatusBgpPeerStatus that = (RouterStatusBgpPeerStatus) o; - return - Objects.equals(this.advertisedRoutes, that.getAdvertisedRoutesList()) && - Objects.equals(this.ipAddress, that.getIpAddress()) && - Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.numLearnedRoutes, that.getNumLearnedRoutes()) && - Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) && - Objects.equals(this.state, that.getState()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.uptime, that.getUptime()) && - Objects.equals(this.uptimeSeconds, that.getUptimeSeconds()) - ; + return Objects.equals(this.advertisedRoutes, that.getAdvertisedRoutesList()) + && Objects.equals(this.ipAddress, that.getIpAddress()) + && Objects.equals(this.linkedVpnTunnel, that.getLinkedVpnTunnel()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.numLearnedRoutes, that.getNumLearnedRoutes()) + && Objects.equals(this.peerIpAddress, that.getPeerIpAddress()) + && Objects.equals(this.state, that.getState()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.uptime, that.getUptime()) + && Objects.equals(this.uptimeSeconds, that.getUptimeSeconds()); } return false; } @@ -465,16 +471,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - advertisedRoutes, - ipAddress, - linkedVpnTunnel, - name, - numLearnedRoutes, - peerIpAddress, - state, - status, - uptime, - uptimeSeconds - ); + advertisedRoutes, + ipAddress, + linkedVpnTunnel, + name, + numLearnedRoutes, + peerIpAddress, + state, + status, + uptime, + uptimeSeconds); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java index 003fb880ce30..b00558dd3b1f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private RouterStatusResponse() { this.result = null; } - - private RouterStatusResponse( - String kind, - RouterStatus result - ) { + private RouterStatusResponse(String kind, RouterStatus result) { this.kind = kind; this.result = result; } @@ -86,22 +79,24 @@ public RouterStatus getResult() { return result; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RouterStatusResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RouterStatusResponse getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RouterStatusResponse DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RouterStatusResponse(); } @@ -146,13 +141,9 @@ public Builder setResult(RouterStatus result) { return this; } - public RouterStatusResponse build() { - return new RouterStatusResponse( - kind, - result - ); + return new RouterStatusResponse(kind, result); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "RouterStatusResponse{" - + "kind=" + kind + ", " - + "result=" + result - + "}"; + return "RouterStatusResponse{" + "kind=" + kind + ", " + "result=" + result + "}"; } @Override @@ -178,19 +166,14 @@ public boolean equals(Object o) { } if (o instanceof RouterStatusResponse) { RouterStatusResponse that = (RouterStatusResponse) o; - return - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.result, that.getResult()) - ; + return Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.result, that.getResult()); } return false; } @Override public int hashCode() { - return Objects.hash( - kind, - result - ); + return Objects.hash(kind, result); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java index 90a3fe8a3dbf..c1311f4462c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private RoutersPreviewResponse() { this.resource = null; } - - private RoutersPreviewResponse( - Router resource - ) { + private RoutersPreviewResponse(Router resource) { this.resource = resource; } @@ -72,22 +66,24 @@ public Router getResource() { return resource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RoutersPreviewResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RoutersPreviewResponse getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RoutersPreviewResponse DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RoutersPreviewResponse(); } @@ -118,11 +114,8 @@ public Builder setResource(Router resource) { return this; } - public RoutersPreviewResponse build() { - return new RoutersPreviewResponse( - resource - ); + return new RoutersPreviewResponse(resource); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "RoutersPreviewResponse{" - + "resource=" + resource - + "}"; + return "RoutersPreviewResponse{" + "resource=" + resource + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof RoutersPreviewResponse) { RoutersPreviewResponse that = (RoutersPreviewResponse) o; - return - Objects.equals(this.resource, that.getResource()) - ; + return Objects.equals(this.resource, that.getResource()); } return false; } @Override public int hashCode() { - return Objects.hash( - resource - ); + return Objects.hash(resource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java index 9096a32e4817..77858274e19e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private RoutersScopedList() { this.warning = null; } - - private RoutersScopedList( - List routers, - Warning warning - ) { + private RoutersScopedList(List routers, Warning warning) { this.routers = routers; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(RoutersScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static RoutersScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final RoutersScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new RoutersScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public RoutersScopedList build() { - return new RoutersScopedList( - routers, - warning - ); + return new RoutersScopedList(routers, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "RoutersScopedList{" - + "routers=" + routers + ", " - + "warning=" + warning - + "}"; + return "RoutersScopedList{" + "routers=" + routers + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof RoutersScopedList) { RoutersScopedList that = (RoutersScopedList) o; - return - Objects.equals(this.routers, that.getRoutersList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.routers, that.getRoutersList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - routers, - warning - ); + return Objects.hash(routers, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java index d9dc9f360eb2..cf70e23f88da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private SSLHealthCheck() { this.response = null; } - private SSLHealthCheck( - Integer port, - String portName, - String proxyHeader, - String request, - String response - ) { + Integer port, String portName, String proxyHeader, String request, String response) { this.port = port; this.portName = portName; this.proxyHeader = proxyHeader; @@ -128,22 +119,24 @@ public String getResponse() { return response; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SSLHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SSLHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SSLHealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SSLHealthCheck(); } @@ -230,19 +223,9 @@ public Builder setResponse(String response) { return this; } - public SSLHealthCheck build() { - - - - return new SSLHealthCheck( - port, - portName, - proxyHeader, - request, - response - ); + return new SSLHealthCheck(port, portName, proxyHeader, request, response); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "SSLHealthCheck{" - + "port=" + port + ", " - + "portName=" + portName + ", " - + "proxyHeader=" + proxyHeader + ", " - + "request=" + request + ", " - + "response=" + response + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "request=" + + request + + ", " + + "response=" + + response + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof SSLHealthCheck) { SSLHealthCheck that = (SSLHealthCheck) o; - return - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.portName, that.getPortName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.request, that.getRequest()) && - Objects.equals(this.response, that.getResponse()) - ; + return Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.request, that.getRequest()) + && Objects.equals(this.response, that.getResponse()); } return false; } @Override public int hashCode() { - return Objects.hash( - port, - portName, - proxyHeader, - request, - response - ); + return Objects.hash(port, portName, proxyHeader, request, response); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java index c8503d297693..b6dede48f68e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,12 +39,7 @@ private Scheduling() { this.preemptible = null; } - - private Scheduling( - Boolean automaticRestart, - String onHostMaintenance, - Boolean preemptible - ) { + private Scheduling(Boolean automaticRestart, String onHostMaintenance, Boolean preemptible) { this.automaticRestart = automaticRestart; this.onHostMaintenance = onHostMaintenance; this.preemptible = preemptible; @@ -60,7 +52,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("automaticRestart", Collections.singletonList(String.valueOf(automaticRestart))); } if (fieldNames.contains("onHostMaintenance") && onHostMaintenance != null) { - fieldMap.put("onHostMaintenance", Collections.singletonList(String.valueOf(onHostMaintenance))); + fieldMap.put( + "onHostMaintenance", Collections.singletonList(String.valueOf(onHostMaintenance))); } if (fieldNames.contains("preemptible") && preemptible != null) { fieldMap.put("preemptible", Collections.singletonList(String.valueOf(preemptible))); @@ -100,22 +93,24 @@ public Boolean getPreemptible() { return preemptible; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Scheduling prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Scheduling getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Scheduling DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Scheduling(); } @@ -174,15 +169,9 @@ public Builder setPreemptible(Boolean preemptible) { return this; } - public Scheduling build() { - - return new Scheduling( - automaticRestart, - onHostMaintenance, - preemptible - ); + return new Scheduling(automaticRestart, onHostMaintenance, preemptible); } public Builder clone() { @@ -197,9 +186,14 @@ public Builder clone() { @Override public String toString() { return "Scheduling{" - + "automaticRestart=" + automaticRestart + ", " - + "onHostMaintenance=" + onHostMaintenance + ", " - + "preemptible=" + preemptible + + "automaticRestart=" + + automaticRestart + + ", " + + "onHostMaintenance=" + + onHostMaintenance + + ", " + + "preemptible=" + + preemptible + "}"; } @@ -210,21 +204,15 @@ public boolean equals(Object o) { } if (o instanceof Scheduling) { Scheduling that = (Scheduling) o; - return - Objects.equals(this.automaticRestart, that.getAutomaticRestart()) && - Objects.equals(this.onHostMaintenance, that.getOnHostMaintenance()) && - Objects.equals(this.preemptible, that.getPreemptible()) - ; + return Objects.equals(this.automaticRestart, that.getAutomaticRestart()) + && Objects.equals(this.onHostMaintenance, that.getOnHostMaintenance()) + && Objects.equals(this.preemptible, that.getPreemptible()); } return false; } @Override public int hashCode() { - return Objects.hash( - automaticRestart, - onHostMaintenance, - preemptible - ); + return Objects.hash(automaticRestart, onHostMaintenance, preemptible); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java index f2d32b3e0b9a..5001ccf5668c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private ScratchDisks() { this.diskGb = null; } - - private ScratchDisks( - Integer diskGb - ) { + private ScratchDisks(Integer diskGb) { this.diskGb = diskGb; } @@ -72,22 +66,24 @@ public Integer getDiskGb() { return diskGb; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ScratchDisks prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ScratchDisks getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ScratchDisks DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ScratchDisks(); } @@ -118,11 +114,8 @@ public Builder setDiskGb(Integer diskGb) { return this; } - public ScratchDisks build() { - return new ScratchDisks( - diskGb - ); + return new ScratchDisks(diskGb); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "ScratchDisks{" - + "diskGb=" + diskGb - + "}"; + return "ScratchDisks{" + "diskGb=" + diskGb + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof ScratchDisks) { ScratchDisks that = (ScratchDisks) o; - return - Objects.equals(this.diskGb, that.getDiskGb()) - ; + return Objects.equals(this.diskGb, that.getDiskGb()); } return false; } @Override public int hashCode() { - return Objects.hash( - diskGb - ); + return Objects.hash(diskGb); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java index acc506b8b2bf..4753665af903 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private SerialPortOutput() { this.start = null; } - private SerialPortOutput( - String contents, - String kind, - String next, - String selfLink, - String start - ) { + String contents, String kind, String next, String selfLink, String start) { this.contents = contents; this.kind = kind; this.next = next; @@ -128,22 +119,24 @@ public String getStart() { return start; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SerialPortOutput prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SerialPortOutput getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SerialPortOutput DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SerialPortOutput(); } @@ -230,19 +223,9 @@ public Builder setStart(String start) { return this; } - public SerialPortOutput build() { - - - - return new SerialPortOutput( - contents, - kind, - next, - selfLink, - start - ); + return new SerialPortOutput(contents, kind, next, selfLink, start); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "SerialPortOutput{" - + "contents=" + contents + ", " - + "kind=" + kind + ", " - + "next=" + next + ", " - + "selfLink=" + selfLink + ", " - + "start=" + start + + "contents=" + + contents + + ", " + + "kind=" + + kind + + ", " + + "next=" + + next + + ", " + + "selfLink=" + + selfLink + + ", " + + "start=" + + start + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof SerialPortOutput) { SerialPortOutput that = (SerialPortOutput) o; - return - Objects.equals(this.contents, that.getContents()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.next, that.getNext()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.start, that.getStart()) - ; + return Objects.equals(this.contents, that.getContents()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.next, that.getNext()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.start, that.getStart()); } return false; } @Override public int hashCode() { - return Objects.hash( - contents, - kind, - next, - selfLink, - start - ); + return Objects.hash(contents, kind, next, selfLink, start); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java index 524c7faf89ab..2bc312927530 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private ServiceAccount() { this.scopes = null; } - - private ServiceAccount( - String email, - List scopes - ) { + private ServiceAccount(String email, List scopes) { this.email = email; this.scopes = scopes; } @@ -90,22 +85,24 @@ public List getScopesList() { return scopes; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ServiceAccount prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ServiceAccount getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ServiceAccount DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ServiceAccount(); } @@ -158,13 +155,9 @@ public Builder addScopes(String scopes) { return this; } - public ServiceAccount build() { - return new ServiceAccount( - email, - scopes - ); + return new ServiceAccount(email, scopes); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "ServiceAccount{" - + "email=" + email + ", " - + "scopes=" + scopes - + "}"; + return "ServiceAccount{" + "email=" + email + ", " + "scopes=" + scopes + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof ServiceAccount) { ServiceAccount that = (ServiceAccount) o; - return - Objects.equals(this.email, that.getEmail()) && - Objects.equals(this.scopes, that.getScopesList()) - ; + return Objects.equals(this.email, that.getEmail()) + && Objects.equals(this.scopes, that.getScopesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - email, - scopes - ); + return Objects.hash(email, scopes); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java index 17ec22b5485a..ec0cedce49c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetBackendServiceTargetSslProxyHttpRequest implements ApiMess private final String prettyPrint; private final String quotaUser; private final String requestId; - private final TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource; + private final TargetSslProxiesSetBackendServiceRequest + targetSslProxiesSetBackendServiceRequestResource; private final String targetSslProxy; private final String userIp; @@ -56,7 +54,6 @@ private SetBackendServiceTargetSslProxyHttpRequest() { this.userIp = null; } - private SetBackendServiceTargetSslProxyHttpRequest( String access_token, String callback, @@ -67,8 +64,7 @@ private SetBackendServiceTargetSslProxyHttpRequest( String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, String targetSslProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +72,8 @@ private SetBackendServiceTargetSslProxyHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; - this.targetSslProxiesSetBackendServiceRequestResource = targetSslProxiesSetBackendServiceRequestResource; + this.targetSslProxiesSetBackendServiceRequestResource = + targetSslProxiesSetBackendServiceRequestResource; this.targetSslProxy = targetSslProxy; this.userIp = userIp; } @@ -105,8 +102,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } - if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource") && targetSslProxiesSetBackendServiceRequestResource != null) { - fieldMap.put("targetSslProxiesSetBackendServiceRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetBackendServiceRequestResource))); + if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource") + && targetSslProxiesSetBackendServiceRequestResource != null) { + fieldMap.put( + "targetSslProxiesSetBackendServiceRequestResource", + Collections.singletonList( + String.valueOf(targetSslProxiesSetBackendServiceRequestResource))); } if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); @@ -186,7 +187,8 @@ public String getRequestId() { return requestId; } - public TargetSslProxiesSetBackendServiceRequest getTargetSslProxiesSetBackendServiceRequestResource() { + public TargetSslProxiesSetBackendServiceRequest + getTargetSslProxiesSetBackendServiceRequestResource() { return targetSslProxiesSetBackendServiceRequestResource; } @@ -198,22 +200,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetBackendServiceTargetSslProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetBackendServiceTargetSslProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetBackendServiceTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetBackendServiceTargetSslProxyHttpRequest(); } @@ -226,7 +230,8 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String requestId; - private TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource; + private TargetSslProxiesSetBackendServiceRequest + targetSslProxiesSetBackendServiceRequestResource; private String targetSslProxy; private String userIp; @@ -256,7 +261,8 @@ public Builder mergeFrom(SetBackendServiceTargetSslProxyHttpRequest other) { this.requestId = other.requestId; } if (other.getTargetSslProxiesSetBackendServiceRequestResource() != null) { - this.targetSslProxiesSetBackendServiceRequestResource = other.targetSslProxiesSetBackendServiceRequestResource; + this.targetSslProxiesSetBackendServiceRequestResource = + other.targetSslProxiesSetBackendServiceRequestResource; } if (other.getTargetSslProxy() != null) { this.targetSslProxy = other.targetSslProxy; @@ -275,7 +281,8 @@ public Builder mergeFrom(SetBackendServiceTargetSslProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; - this.targetSslProxiesSetBackendServiceRequestResource = source.targetSslProxiesSetBackendServiceRequestResource; + this.targetSslProxiesSetBackendServiceRequestResource = + source.targetSslProxiesSetBackendServiceRequestResource; this.targetSslProxy = source.targetSslProxy; this.userIp = source.userIp; } @@ -343,12 +350,15 @@ public Builder setRequestId(String requestId) { return this; } - public TargetSslProxiesSetBackendServiceRequest getTargetSslProxiesSetBackendServiceRequestResource() { + public TargetSslProxiesSetBackendServiceRequest + getTargetSslProxiesSetBackendServiceRequestResource() { return targetSslProxiesSetBackendServiceRequestResource; } - public Builder setTargetSslProxiesSetBackendServiceRequestResource(TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { - this.targetSslProxiesSetBackendServiceRequestResource = targetSslProxiesSetBackendServiceRequestResource; + public Builder setTargetSslProxiesSetBackendServiceRequestResource( + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + this.targetSslProxiesSetBackendServiceRequestResource = + targetSslProxiesSetBackendServiceRequestResource; return this; } @@ -370,17 +380,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetBackendServiceTargetSslProxyHttpRequest build() { String missing = ""; - - - - - - - if (targetSslProxy == null) { missing += " targetSslProxy"; } @@ -389,17 +391,16 @@ public SetBackendServiceTargetSslProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetBackendServiceTargetSslProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxiesSetBackendServiceRequestResource, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxiesSetBackendServiceRequestResource, + targetSslProxy, + userIp); } public Builder clone() { @@ -411,7 +412,8 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); - newBuilder.setTargetSslProxiesSetBackendServiceRequestResource(this.targetSslProxiesSetBackendServiceRequestResource); + newBuilder.setTargetSslProxiesSetBackendServiceRequestResource( + this.targetSslProxiesSetBackendServiceRequestResource); newBuilder.setTargetSslProxy(this.targetSslProxy); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +423,35 @@ public Builder clone() { @Override public String toString() { return "SetBackendServiceTargetSslProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetSslProxiesSetBackendServiceRequestResource=" + targetSslProxiesSetBackendServiceRequestResource + ", " - + "targetSslProxy=" + targetSslProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetSslProxiesSetBackendServiceRequestResource=" + + targetSslProxiesSetBackendServiceRequestResource + + ", " + + "targetSslProxy=" + + targetSslProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +461,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetBackendServiceTargetSslProxyHttpRequest) { - SetBackendServiceTargetSslProxyHttpRequest that = (SetBackendServiceTargetSslProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetSslProxiesSetBackendServiceRequestResource, that.getTargetSslProxiesSetBackendServiceRequestResource()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetBackendServiceTargetSslProxyHttpRequest that = + (SetBackendServiceTargetSslProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetSslProxiesSetBackendServiceRequestResource, + that.getTargetSslProxiesSetBackendServiceRequestResource()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +482,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxiesSetBackendServiceRequestResource, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxiesSetBackendServiceRequestResource, + targetSslProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java index 5d0b6a0691c4..42a0014c88d9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetBackendServiceTargetTcpProxyHttpRequest implements ApiMess private final String prettyPrint; private final String quotaUser; private final String requestId; - private final TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource; + private final TargetTcpProxiesSetBackendServiceRequest + targetTcpProxiesSetBackendServiceRequestResource; private final String targetTcpProxy; private final String userIp; @@ -56,7 +54,6 @@ private SetBackendServiceTargetTcpProxyHttpRequest() { this.userIp = null; } - private SetBackendServiceTargetTcpProxyHttpRequest( String access_token, String callback, @@ -67,8 +64,7 @@ private SetBackendServiceTargetTcpProxyHttpRequest( String requestId, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, String targetTcpProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +72,8 @@ private SetBackendServiceTargetTcpProxyHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; - this.targetTcpProxiesSetBackendServiceRequestResource = targetTcpProxiesSetBackendServiceRequestResource; + this.targetTcpProxiesSetBackendServiceRequestResource = + targetTcpProxiesSetBackendServiceRequestResource; this.targetTcpProxy = targetTcpProxy; this.userIp = userIp; } @@ -105,8 +102,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } - if (fieldNames.contains("targetTcpProxiesSetBackendServiceRequestResource") && targetTcpProxiesSetBackendServiceRequestResource != null) { - fieldMap.put("targetTcpProxiesSetBackendServiceRequestResource", Collections.singletonList(String.valueOf(targetTcpProxiesSetBackendServiceRequestResource))); + if (fieldNames.contains("targetTcpProxiesSetBackendServiceRequestResource") + && targetTcpProxiesSetBackendServiceRequestResource != null) { + fieldMap.put( + "targetTcpProxiesSetBackendServiceRequestResource", + Collections.singletonList( + String.valueOf(targetTcpProxiesSetBackendServiceRequestResource))); } if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); @@ -186,7 +187,8 @@ public String getRequestId() { return requestId; } - public TargetTcpProxiesSetBackendServiceRequest getTargetTcpProxiesSetBackendServiceRequestResource() { + public TargetTcpProxiesSetBackendServiceRequest + getTargetTcpProxiesSetBackendServiceRequestResource() { return targetTcpProxiesSetBackendServiceRequestResource; } @@ -198,22 +200,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetBackendServiceTargetTcpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetBackendServiceTargetTcpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetBackendServiceTargetTcpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetBackendServiceTargetTcpProxyHttpRequest(); } @@ -226,7 +230,8 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String requestId; - private TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource; + private TargetTcpProxiesSetBackendServiceRequest + targetTcpProxiesSetBackendServiceRequestResource; private String targetTcpProxy; private String userIp; @@ -256,7 +261,8 @@ public Builder mergeFrom(SetBackendServiceTargetTcpProxyHttpRequest other) { this.requestId = other.requestId; } if (other.getTargetTcpProxiesSetBackendServiceRequestResource() != null) { - this.targetTcpProxiesSetBackendServiceRequestResource = other.targetTcpProxiesSetBackendServiceRequestResource; + this.targetTcpProxiesSetBackendServiceRequestResource = + other.targetTcpProxiesSetBackendServiceRequestResource; } if (other.getTargetTcpProxy() != null) { this.targetTcpProxy = other.targetTcpProxy; @@ -275,7 +281,8 @@ public Builder mergeFrom(SetBackendServiceTargetTcpProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; - this.targetTcpProxiesSetBackendServiceRequestResource = source.targetTcpProxiesSetBackendServiceRequestResource; + this.targetTcpProxiesSetBackendServiceRequestResource = + source.targetTcpProxiesSetBackendServiceRequestResource; this.targetTcpProxy = source.targetTcpProxy; this.userIp = source.userIp; } @@ -343,12 +350,15 @@ public Builder setRequestId(String requestId) { return this; } - public TargetTcpProxiesSetBackendServiceRequest getTargetTcpProxiesSetBackendServiceRequestResource() { + public TargetTcpProxiesSetBackendServiceRequest + getTargetTcpProxiesSetBackendServiceRequestResource() { return targetTcpProxiesSetBackendServiceRequestResource; } - public Builder setTargetTcpProxiesSetBackendServiceRequestResource(TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { - this.targetTcpProxiesSetBackendServiceRequestResource = targetTcpProxiesSetBackendServiceRequestResource; + public Builder setTargetTcpProxiesSetBackendServiceRequestResource( + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { + this.targetTcpProxiesSetBackendServiceRequestResource = + targetTcpProxiesSetBackendServiceRequestResource; return this; } @@ -370,17 +380,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetBackendServiceTargetTcpProxyHttpRequest build() { String missing = ""; - - - - - - - if (targetTcpProxy == null) { missing += " targetTcpProxy"; } @@ -389,17 +391,16 @@ public SetBackendServiceTargetTcpProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetBackendServiceTargetTcpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetTcpProxiesSetBackendServiceRequestResource, - targetTcpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetTcpProxiesSetBackendServiceRequestResource, + targetTcpProxy, + userIp); } public Builder clone() { @@ -411,7 +412,8 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); - newBuilder.setTargetTcpProxiesSetBackendServiceRequestResource(this.targetTcpProxiesSetBackendServiceRequestResource); + newBuilder.setTargetTcpProxiesSetBackendServiceRequestResource( + this.targetTcpProxiesSetBackendServiceRequestResource); newBuilder.setTargetTcpProxy(this.targetTcpProxy); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +423,35 @@ public Builder clone() { @Override public String toString() { return "SetBackendServiceTargetTcpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetTcpProxiesSetBackendServiceRequestResource=" + targetTcpProxiesSetBackendServiceRequestResource + ", " - + "targetTcpProxy=" + targetTcpProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetTcpProxiesSetBackendServiceRequestResource=" + + targetTcpProxiesSetBackendServiceRequestResource + + ", " + + "targetTcpProxy=" + + targetTcpProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +461,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetBackendServiceTargetTcpProxyHttpRequest) { - SetBackendServiceTargetTcpProxyHttpRequest that = (SetBackendServiceTargetTcpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetTcpProxiesSetBackendServiceRequestResource, that.getTargetTcpProxiesSetBackendServiceRequestResource()) && - Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetBackendServiceTargetTcpProxyHttpRequest that = + (SetBackendServiceTargetTcpProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetTcpProxiesSetBackendServiceRequestResource, + that.getTargetTcpProxiesSetBackendServiceRequestResource()) + && Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +482,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetTcpProxiesSetBackendServiceRequestResource, - targetTcpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetTcpProxiesSetBackendServiceRequestResource, + targetTcpProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java index f4e3872d5789..64316ee60f46 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private SetBackupTargetPoolHttpRequest() { this.userIp = null; } - private SetBackupTargetPoolHttpRequest( String access_token, String callback, @@ -70,8 +66,7 @@ private SetBackupTargetPoolHttpRequest( String requestId, String targetPool, TargetReference targetReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.failoverRatio = failoverRatio; @@ -116,7 +111,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); } if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -212,22 +209,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetBackupTargetPoolHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetBackupTargetPoolHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetBackupTargetPoolHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetBackupTargetPoolHttpRequest(); } @@ -398,38 +397,28 @@ public Builder setUserIp(String userIp) { return this; } - public SetBackupTargetPoolHttpRequest build() { String missing = ""; - - - - - - - if (targetPool == null) { missing += " targetPool"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetBackupTargetPoolHttpRequest( - access_token, - callback, - failoverRatio, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetReferenceResource, - userIp - ); + access_token, + callback, + failoverRatio, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetReferenceResource, + userIp); } public Builder clone() { @@ -452,17 +441,38 @@ public Builder clone() { @Override public String toString() { return "SetBackupTargetPoolHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "failoverRatio=" + failoverRatio + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetPool=" + targetPool + ", " - + "targetReferenceResource=" + targetReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "failoverRatio=" + + failoverRatio + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetPool=" + + targetPool + + ", " + + "targetReferenceResource=" + + targetReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -473,19 +483,17 @@ public boolean equals(Object o) { } if (o instanceof SetBackupTargetPoolHttpRequest) { SetBackupTargetPoolHttpRequest that = (SetBackupTargetPoolHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.failoverRatio, that.getFailoverRatio()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetPool, that.getTargetPool()) && - Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.failoverRatio, that.getFailoverRatio()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetPool, that.getTargetPool()) + && Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -493,17 +501,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - failoverRatio, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetPool, - targetReferenceResource, - userIp - ); + access_token, + callback, + failoverRatio, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetPool, + targetReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java index 8a0eb0096ab6..e1067dfacdec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetCommonInstanceMetadataProjectHttpRequest() { this.userIp = null; } - private SetCommonInstanceMetadataProjectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetCommonInstanceMetadataProjectHttpRequest( String project, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetCommonInstanceMetadataProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetCommonInstanceMetadataProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetCommonInstanceMetadataProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetCommonInstanceMetadataProjectHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetCommonInstanceMetadataProjectHttpRequest build() { String missing = ""; - - - - - if (project == null) { missing += " project"; } - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetCommonInstanceMetadataProjectHttpRequest( - access_token, - callback, - fields, - key, - metadataResource, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + metadataResource, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "SetCommonInstanceMetadataProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "metadataResource=" + metadataResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "metadataResource=" + + metadataResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +447,18 @@ public boolean equals(Object o) { return true; } if (o instanceof SetCommonInstanceMetadataProjectHttpRequest) { - SetCommonInstanceMetadataProjectHttpRequest that = (SetCommonInstanceMetadataProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.metadataResource, that.getMetadataResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetCommonInstanceMetadataProjectHttpRequest that = + (SetCommonInstanceMetadataProjectHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.metadataResource, that.getMetadataResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - metadataResource, - prettyPrint, - project, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + key, + metadataResource, + prettyPrint, + project, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java index 942e68fe848a..74dc10f99e02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetDeletionProtectionInstanceHttpRequest() { this.userIp = null; } - private SetDeletionProtectionInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetDeletionProtectionInstanceHttpRequest( String quotaUser, String requestId, String resource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.deletionProtection = deletionProtection; @@ -91,7 +86,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); } if (fieldNames.contains("deletionProtection") && deletionProtection != null) { - fieldMap.put("deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); + fieldMap.put( + "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); } if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetDeletionProtectionInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetDeletionProtectionInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetDeletionProtectionInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetDeletionProtectionInstanceHttpRequest(); } @@ -370,17 +368,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetDeletionProtectionInstanceHttpRequest build() { String missing = ""; - - - - - - - if (resource == null) { missing += " resource"; } @@ -389,17 +379,16 @@ public SetDeletionProtectionInstanceHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetDeletionProtectionInstanceHttpRequest( - access_token, - callback, - deletionProtection, - fields, - key, - prettyPrint, - quotaUser, - requestId, - resource, - userIp - ); + access_token, + callback, + deletionProtection, + fields, + key, + prettyPrint, + quotaUser, + requestId, + resource, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "SetDeletionProtectionInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "deletionProtection=" + deletionProtection + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "resource=" + resource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "deletionProtection=" + + deletionProtection + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof SetDeletionProtectionInstanceHttpRequest) { SetDeletionProtectionInstanceHttpRequest that = (SetDeletionProtectionInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.deletionProtection, that.getDeletionProtection()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.resource, that.getResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.deletionProtection, that.getDeletionProtection()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - deletionProtection, - fields, - key, - prettyPrint, - quotaUser, - requestId, - resource, - userIp - ); + access_token, + callback, + deletionProtection, + fields, + key, + prettyPrint, + quotaUser, + requestId, + resource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java index 2065de1fe2c0..c71d726e3203 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private SetDiskAutoDeleteInstanceHttpRequest() { this.userIp = null; } - private SetDiskAutoDeleteInstanceHttpRequest( String access_token, Boolean autoDelete, @@ -70,8 +66,7 @@ private SetDiskAutoDeleteInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoDelete = autoDelete; this.callback = callback; @@ -212,22 +207,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetDiskAutoDeleteInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetDiskAutoDeleteInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetDiskAutoDeleteInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetDiskAutoDeleteInstanceHttpRequest(); } @@ -398,7 +395,6 @@ public Builder setUserIp(String userIp) { return this; } - public SetDiskAutoDeleteInstanceHttpRequest build() { String missing = ""; @@ -414,26 +410,21 @@ public SetDiskAutoDeleteInstanceHttpRequest build() { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetDiskAutoDeleteInstanceHttpRequest( - access_token, - autoDelete, - callback, - deviceName, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + autoDelete, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -456,17 +447,38 @@ public Builder clone() { @Override public String toString() { return "SetDiskAutoDeleteInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "autoDelete=" + autoDelete + ", " - + "callback=" + callback + ", " - + "deviceName=" + deviceName + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoDelete=" + + autoDelete + + ", " + + "callback=" + + callback + + ", " + + "deviceName=" + + deviceName + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -477,19 +489,17 @@ public boolean equals(Object o) { } if (o instanceof SetDiskAutoDeleteInstanceHttpRequest) { SetDiskAutoDeleteInstanceHttpRequest that = (SetDiskAutoDeleteInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoDelete, that.getAutoDelete()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.deviceName, that.getDeviceName()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoDelete, that.getAutoDelete()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.deviceName, that.getDeviceName()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -497,17 +507,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoDelete, - callback, - deviceName, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + autoDelete, + callback, + deviceName, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java index f3743332b447..42d118e74ec8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,7 +33,8 @@ public final class SetInstanceTemplateInstanceGroupManagerHttpRequest implements private final String callback; private final String fields; private final String instanceGroupManager; - private final InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource; + private final InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -56,24 +54,24 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest() { this.userIp = null; } - private SetInstanceTemplateInstanceGroupManagerHttpRequest( String access_token, String callback, String fields, String instanceGroupManager, - InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, + InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource, String key, String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instanceGroupManager = instanceGroupManager; - this.instanceGroupManagersSetInstanceTemplateRequestResource = instanceGroupManagersSetInstanceTemplateRequestResource; + this.instanceGroupManagersSetInstanceTemplateRequestResource = + instanceGroupManagersSetInstanceTemplateRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -94,10 +92,15 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } - if (fieldNames.contains("instanceGroupManagersSetInstanceTemplateRequestResource") && instanceGroupManagersSetInstanceTemplateRequestResource != null) { - fieldMap.put("instanceGroupManagersSetInstanceTemplateRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource))); + if (fieldNames.contains("instanceGroupManagersSetInstanceTemplateRequestResource") + && instanceGroupManagersSetInstanceTemplateRequestResource != null) { + fieldMap.put( + "instanceGroupManagersSetInstanceTemplateRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -174,7 +177,8 @@ public String getInstanceGroupManager() { return instanceGroupManager; } - public InstanceGroupManagersSetInstanceTemplateRequest getInstanceGroupManagersSetInstanceTemplateRequestResource() { + public InstanceGroupManagersSetInstanceTemplateRequest + getInstanceGroupManagersSetInstanceTemplateRequestResource() { return instanceGroupManagersSetInstanceTemplateRequestResource; } @@ -198,22 +202,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetInstanceTemplateInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetInstanceTemplateInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetInstanceTemplateInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetInstanceTemplateInstanceGroupManagerHttpRequest(); } @@ -223,7 +229,8 @@ public static class Builder { private String callback; private String fields; private String instanceGroupManager; - private InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource; + private InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource; private String key; private String prettyPrint; private String quotaUser; @@ -233,7 +240,8 @@ public static class Builder { Builder() {} public Builder mergeFrom(SetInstanceTemplateInstanceGroupManagerHttpRequest other) { - if (other == SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -247,7 +255,8 @@ public Builder mergeFrom(SetInstanceTemplateInstanceGroupManagerHttpRequest othe this.instanceGroupManager = other.instanceGroupManager; } if (other.getInstanceGroupManagersSetInstanceTemplateRequestResource() != null) { - this.instanceGroupManagersSetInstanceTemplateRequestResource = other.instanceGroupManagersSetInstanceTemplateRequestResource; + this.instanceGroupManagersSetInstanceTemplateRequestResource = + other.instanceGroupManagersSetInstanceTemplateRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +281,8 @@ public Builder mergeFrom(SetInstanceTemplateInstanceGroupManagerHttpRequest othe this.callback = source.callback; this.fields = source.fields; this.instanceGroupManager = source.instanceGroupManager; - this.instanceGroupManagersSetInstanceTemplateRequestResource = source.instanceGroupManagersSetInstanceTemplateRequestResource; + this.instanceGroupManagersSetInstanceTemplateRequestResource = + source.instanceGroupManagersSetInstanceTemplateRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -316,12 +326,16 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { return this; } - public InstanceGroupManagersSetInstanceTemplateRequest getInstanceGroupManagersSetInstanceTemplateRequestResource() { + public InstanceGroupManagersSetInstanceTemplateRequest + getInstanceGroupManagersSetInstanceTemplateRequestResource() { return instanceGroupManagersSetInstanceTemplateRequestResource; } - public Builder setInstanceGroupManagersSetInstanceTemplateRequestResource(InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { - this.instanceGroupManagersSetInstanceTemplateRequestResource = instanceGroupManagersSetInstanceTemplateRequestResource; + public Builder setInstanceGroupManagersSetInstanceTemplateRequestResource( + InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource) { + this.instanceGroupManagersSetInstanceTemplateRequestResource = + instanceGroupManagersSetInstanceTemplateRequestResource; return this; } @@ -370,36 +384,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetInstanceTemplateInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetInstanceTemplateInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersSetInstanceTemplateRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetInstanceTemplateRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +413,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroupManager(this.instanceGroupManager); - newBuilder.setInstanceGroupManagersSetInstanceTemplateRequestResource(this.instanceGroupManagersSetInstanceTemplateRequestResource); + newBuilder.setInstanceGroupManagersSetInstanceTemplateRequestResource( + this.instanceGroupManagersSetInstanceTemplateRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +427,35 @@ public Builder clone() { @Override public String toString() { return "SetInstanceTemplateInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "instanceGroupManagersSetInstanceTemplateRequestResource=" + instanceGroupManagersSetInstanceTemplateRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagersSetInstanceTemplateRequestResource=" + + instanceGroupManagersSetInstanceTemplateRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +465,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetInstanceTemplateInstanceGroupManagerHttpRequest) { - SetInstanceTemplateInstanceGroupManagerHttpRequest that = (SetInstanceTemplateInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.instanceGroupManagersSetInstanceTemplateRequestResource, that.getInstanceGroupManagersSetInstanceTemplateRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetInstanceTemplateInstanceGroupManagerHttpRequest that = + (SetInstanceTemplateInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagersSetInstanceTemplateRequestResource, + that.getInstanceGroupManagersSetInstanceTemplateRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +486,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersSetInstanceTemplateRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetInstanceTemplateRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java index 827919040348..04073eee5b98 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetInstanceTemplateRegionInstanceGroupManagerHttpRequest impl private final String key; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource; + private final RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource; private final String requestId; private final String userIp; @@ -56,7 +54,6 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -65,10 +62,10 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, - RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, + RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +73,8 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupManagersSetTemplateRequestResource = regionInstanceGroupManagersSetTemplateRequestResource; + this.regionInstanceGroupManagersSetTemplateRequestResource = + regionInstanceGroupManagersSetTemplateRequestResource; this.requestId = requestId; this.userIp = userIp; } @@ -94,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -105,8 +104,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource") && regionInstanceGroupManagersSetTemplateRequestResource != null) { - fieldMap.put("regionInstanceGroupManagersSetTemplateRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource))); + if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource") + && regionInstanceGroupManagersSetTemplateRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersSetTemplateRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource))); } if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); @@ -186,7 +189,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupManagersSetTemplateRequest getRegionInstanceGroupManagersSetTemplateRequestResource() { + public RegionInstanceGroupManagersSetTemplateRequest + getRegionInstanceGroupManagersSetTemplateRequestResource() { return regionInstanceGroupManagersSetTemplateRequestResource; } @@ -198,22 +202,25 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest prototype) { + + public static Builder newBuilder( + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetInstanceTemplateRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetInstanceTemplateRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetInstanceTemplateRegionInstanceGroupManagerHttpRequest(); } @@ -226,14 +233,16 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource; + private RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource; private String requestId; private String userIp; Builder() {} public Builder mergeFrom(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest other) { - if (other == SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -256,7 +265,8 @@ public Builder mergeFrom(SetInstanceTemplateRegionInstanceGroupManagerHttpReques this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupManagersSetTemplateRequestResource() != null) { - this.regionInstanceGroupManagersSetTemplateRequestResource = other.regionInstanceGroupManagersSetTemplateRequestResource; + this.regionInstanceGroupManagersSetTemplateRequestResource = + other.regionInstanceGroupManagersSetTemplateRequestResource; } if (other.getRequestId() != null) { this.requestId = other.requestId; @@ -275,7 +285,8 @@ public Builder mergeFrom(SetInstanceTemplateRegionInstanceGroupManagerHttpReques this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupManagersSetTemplateRequestResource = source.regionInstanceGroupManagersSetTemplateRequestResource; + this.regionInstanceGroupManagersSetTemplateRequestResource = + source.regionInstanceGroupManagersSetTemplateRequestResource; this.requestId = source.requestId; this.userIp = source.userIp; } @@ -343,12 +354,16 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupManagersSetTemplateRequest getRegionInstanceGroupManagersSetTemplateRequestResource() { + public RegionInstanceGroupManagersSetTemplateRequest + getRegionInstanceGroupManagersSetTemplateRequestResource() { return regionInstanceGroupManagersSetTemplateRequestResource; } - public Builder setRegionInstanceGroupManagersSetTemplateRequestResource(RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { - this.regionInstanceGroupManagersSetTemplateRequestResource = regionInstanceGroupManagersSetTemplateRequestResource; + public Builder setRegionInstanceGroupManagersSetTemplateRequestResource( + RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource) { + this.regionInstanceGroupManagersSetTemplateRequestResource = + regionInstanceGroupManagersSetTemplateRequestResource; return this; } @@ -370,36 +385,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetInstanceTemplateRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersSetTemplateRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTemplateRequestResource, + requestId, + userIp); } public Builder clone() { @@ -411,7 +417,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupManagersSetTemplateRequestResource(this.regionInstanceGroupManagersSetTemplateRequestResource); + newBuilder.setRegionInstanceGroupManagersSetTemplateRequestResource( + this.regionInstanceGroupManagersSetTemplateRequestResource); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +428,35 @@ public Builder clone() { @Override public String toString() { return "SetInstanceTemplateRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupManagersSetTemplateRequestResource=" + regionInstanceGroupManagersSetTemplateRequestResource + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupManagersSetTemplateRequestResource=" + + regionInstanceGroupManagersSetTemplateRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +466,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetInstanceTemplateRegionInstanceGroupManagerHttpRequest) { - SetInstanceTemplateRegionInstanceGroupManagerHttpRequest that = (SetInstanceTemplateRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupManagersSetTemplateRequestResource, that.getRegionInstanceGroupManagersSetTemplateRequestResource()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest that = + (SetInstanceTemplateRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupManagersSetTemplateRequestResource, + that.getRegionInstanceGroupManagersSetTemplateRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +487,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersSetTemplateRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTemplateRequestResource, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java index 072b74b6024a..f3217f2bce48 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetLabelsDiskHttpRequest() { this.zoneSetLabelsRequestResource = null; } - private SetLabelsDiskHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetLabelsDiskHttpRequest( String requestId, String resource, String userIp, - ZoneSetLabelsRequest zoneSetLabelsRequestResource - ) { + ZoneSetLabelsRequest zoneSetLabelsRequestResource) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -111,8 +106,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); } - if (fieldNames.contains("zoneSetLabelsRequestResource") && zoneSetLabelsRequestResource != null) { - fieldMap.put("zoneSetLabelsRequestResource", Collections.singletonList(String.valueOf(zoneSetLabelsRequestResource))); + if (fieldNames.contains("zoneSetLabelsRequestResource") + && zoneSetLabelsRequestResource != null) { + fieldMap.put( + "zoneSetLabelsRequestResource", + Collections.singletonList(String.valueOf(zoneSetLabelsRequestResource))); } return fieldMap; } @@ -198,22 +196,24 @@ public ZoneSetLabelsRequest getZoneSetLabelsRequestResource() { return zoneSetLabelsRequestResource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetLabelsDiskHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetLabelsDiskHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetLabelsDiskHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetLabelsDiskHttpRequest(); } @@ -365,41 +365,33 @@ public ZoneSetLabelsRequest getZoneSetLabelsRequestResource() { return zoneSetLabelsRequestResource; } - public Builder setZoneSetLabelsRequestResource(ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + public Builder setZoneSetLabelsRequestResource( + ZoneSetLabelsRequest zoneSetLabelsRequestResource) { this.zoneSetLabelsRequestResource = zoneSetLabelsRequestResource; return this; } - public SetLabelsDiskHttpRequest build() { String missing = ""; - - - - - - if (resource == null) { missing += " resource"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetLabelsDiskHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - resource, - userIp, - zoneSetLabelsRequestResource - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + resource, + userIp, + zoneSetLabelsRequestResource); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "SetLabelsDiskHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "resource=" + resource + ", " - + "userIp=" + userIp + ", " - + "zoneSetLabelsRequestResource=" + zoneSetLabelsRequestResource + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + ", " + + "zoneSetLabelsRequestResource=" + + zoneSetLabelsRequestResource + "}"; } @@ -441,18 +452,17 @@ public boolean equals(Object o) { } if (o instanceof SetLabelsDiskHttpRequest) { SetLabelsDiskHttpRequest that = (SetLabelsDiskHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.resource, that.getResource()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zoneSetLabelsRequestResource, that.getZoneSetLabelsRequestResource()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals( + this.zoneSetLabelsRequestResource, that.getZoneSetLabelsRequestResource()); } return false; } @@ -460,16 +470,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - resource, - userIp, - zoneSetLabelsRequestResource - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + resource, + userIp, + zoneSetLabelsRequestResource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java index e61b64dbeb14..20b77f6a94ac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private SetLabelsImageHttpRequest() { this.userIp = null; } - private SetLabelsImageHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private SetLabelsImageHttpRequest( String prettyPrint, String quotaUser, String resource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -89,8 +84,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("globalSetLabelsRequestResource") && globalSetLabelsRequestResource != null) { - fieldMap.put("globalSetLabelsRequestResource", Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); + if (fieldNames.contains("globalSetLabelsRequestResource") + && globalSetLabelsRequestResource != null) { + fieldMap.put( + "globalSetLabelsRequestResource", + Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +182,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetLabelsImageHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetLabelsImageHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetLabelsImageHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetLabelsImageHttpRequest(); } @@ -292,7 +292,8 @@ public GlobalSetLabelsRequest getGlobalSetLabelsRequestResource() { return globalSetLabelsRequestResource; } - public Builder setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest globalSetLabelsRequestResource) { + public Builder setGlobalSetLabelsRequestResource( + GlobalSetLabelsRequest globalSetLabelsRequestResource) { this.globalSetLabelsRequestResource = globalSetLabelsRequestResource; return this; } @@ -342,16 +343,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetLabelsImageHttpRequest build() { String missing = ""; - - - - - - if (resource == null) { missing += " resource"; } @@ -360,16 +354,15 @@ public SetLabelsImageHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetLabelsImageHttpRequest( - access_token, - callback, - fields, - globalSetLabelsRequestResource, - key, - prettyPrint, - quotaUser, - resource, - userIp - ); + access_token, + callback, + fields, + globalSetLabelsRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); } public Builder clone() { @@ -390,15 +383,32 @@ public Builder clone() { @Override public String toString() { return "SetLabelsImageHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "globalSetLabelsRequestResource=" + globalSetLabelsRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "resource=" + resource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "globalSetLabelsRequestResource=" + + globalSetLabelsRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +419,16 @@ public boolean equals(Object o) { } if (o instanceof SetLabelsImageHttpRequest) { SetLabelsImageHttpRequest that = (SetLabelsImageHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.globalSetLabelsRequestResource, that.getGlobalSetLabelsRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.resource, that.getResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.globalSetLabelsRequestResource, that.getGlobalSetLabelsRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +436,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - globalSetLabelsRequestResource, - key, - prettyPrint, - quotaUser, - resource, - userIp - ); + access_token, + callback, + fields, + globalSetLabelsRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java index 6441e7169605..be8e7c4200b6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetLabelsInstanceHttpRequest() { this.userIp = null; } - private SetLabelsInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetLabelsInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - if (fieldNames.contains("instancesSetLabelsRequestResource") && instancesSetLabelsRequestResource != null) { - fieldMap.put("instancesSetLabelsRequestResource", Collections.singletonList(String.valueOf(instancesSetLabelsRequestResource))); + if (fieldNames.contains("instancesSetLabelsRequestResource") + && instancesSetLabelsRequestResource != null) { + fieldMap.put( + "instancesSetLabelsRequestResource", + Collections.singletonList(String.valueOf(instancesSetLabelsRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetLabelsInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetLabelsInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetLabelsInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetLabelsInstanceHttpRequest(); } @@ -320,7 +320,8 @@ public InstancesSetLabelsRequest getInstancesSetLabelsRequestResource() { return instancesSetLabelsRequestResource; } - public Builder setInstancesSetLabelsRequestResource(InstancesSetLabelsRequest instancesSetLabelsRequestResource) { + public Builder setInstancesSetLabelsRequestResource( + InstancesSetLabelsRequest instancesSetLabelsRequestResource) { this.instancesSetLabelsRequestResource = instancesSetLabelsRequestResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetLabelsInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetLabelsInstanceHttpRequest( - access_token, - callback, - fields, - instance, - instancesSetLabelsRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetLabelsRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +413,35 @@ public Builder clone() { @Override public String toString() { return "SetLabelsInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "instancesSetLabelsRequestResource=" + instancesSetLabelsRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "instancesSetLabelsRequestResource=" + + instancesSetLabelsRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +452,17 @@ public boolean equals(Object o) { } if (o instanceof SetLabelsInstanceHttpRequest) { SetLabelsInstanceHttpRequest that = (SetLabelsInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instancesSetLabelsRequestResource, that.getInstancesSetLabelsRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals( + this.instancesSetLabelsRequestResource, that.getInstancesSetLabelsRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +470,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - instancesSetLabelsRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetLabelsRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java index 04dfa5cc1712..5b4d0d82e0f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private SetLabelsSnapshotHttpRequest() { this.userIp = null; } - private SetLabelsSnapshotHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private SetLabelsSnapshotHttpRequest( String prettyPrint, String quotaUser, String resource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -89,8 +84,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } - if (fieldNames.contains("globalSetLabelsRequestResource") && globalSetLabelsRequestResource != null) { - fieldMap.put("globalSetLabelsRequestResource", Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); + if (fieldNames.contains("globalSetLabelsRequestResource") + && globalSetLabelsRequestResource != null) { + fieldMap.put( + "globalSetLabelsRequestResource", + Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -184,22 +182,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetLabelsSnapshotHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetLabelsSnapshotHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetLabelsSnapshotHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetLabelsSnapshotHttpRequest(); } @@ -292,7 +292,8 @@ public GlobalSetLabelsRequest getGlobalSetLabelsRequestResource() { return globalSetLabelsRequestResource; } - public Builder setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest globalSetLabelsRequestResource) { + public Builder setGlobalSetLabelsRequestResource( + GlobalSetLabelsRequest globalSetLabelsRequestResource) { this.globalSetLabelsRequestResource = globalSetLabelsRequestResource; return this; } @@ -342,16 +343,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetLabelsSnapshotHttpRequest build() { String missing = ""; - - - - - - if (resource == null) { missing += " resource"; } @@ -360,16 +354,15 @@ public SetLabelsSnapshotHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetLabelsSnapshotHttpRequest( - access_token, - callback, - fields, - globalSetLabelsRequestResource, - key, - prettyPrint, - quotaUser, - resource, - userIp - ); + access_token, + callback, + fields, + globalSetLabelsRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); } public Builder clone() { @@ -390,15 +383,32 @@ public Builder clone() { @Override public String toString() { return "SetLabelsSnapshotHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "globalSetLabelsRequestResource=" + globalSetLabelsRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "resource=" + resource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "globalSetLabelsRequestResource=" + + globalSetLabelsRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +419,16 @@ public boolean equals(Object o) { } if (o instanceof SetLabelsSnapshotHttpRequest) { SetLabelsSnapshotHttpRequest that = (SetLabelsSnapshotHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.globalSetLabelsRequestResource, that.getGlobalSetLabelsRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.resource, that.getResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.globalSetLabelsRequestResource, that.getGlobalSetLabelsRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +436,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - globalSetLabelsRequestResource, - key, - prettyPrint, - quotaUser, - resource, - userIp - ); + access_token, + callback, + fields, + globalSetLabelsRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java index 052ae71d7fbc..ff4e738a7a9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetMachineResourcesInstanceHttpRequest() { this.userIp = null; } - private SetMachineResourcesInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetMachineResourcesInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - if (fieldNames.contains("instancesSetMachineResourcesRequestResource") && instancesSetMachineResourcesRequestResource != null) { - fieldMap.put("instancesSetMachineResourcesRequestResource", Collections.singletonList(String.valueOf(instancesSetMachineResourcesRequestResource))); + if (fieldNames.contains("instancesSetMachineResourcesRequestResource") + && instancesSetMachineResourcesRequestResource != null) { + fieldMap.put( + "instancesSetMachineResourcesRequestResource", + Collections.singletonList(String.valueOf(instancesSetMachineResourcesRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetMachineResourcesInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetMachineResourcesInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetMachineResourcesInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetMachineResourcesInstanceHttpRequest(); } @@ -247,7 +247,8 @@ public Builder mergeFrom(SetMachineResourcesInstanceHttpRequest other) { this.instance = other.instance; } if (other.getInstancesSetMachineResourcesRequestResource() != null) { - this.instancesSetMachineResourcesRequestResource = other.instancesSetMachineResourcesRequestResource; + this.instancesSetMachineResourcesRequestResource = + other.instancesSetMachineResourcesRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +273,8 @@ public Builder mergeFrom(SetMachineResourcesInstanceHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instance = source.instance; - this.instancesSetMachineResourcesRequestResource = source.instancesSetMachineResourcesRequestResource; + this.instancesSetMachineResourcesRequestResource = + source.instancesSetMachineResourcesRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -320,8 +322,10 @@ public InstancesSetMachineResourcesRequest getInstancesSetMachineResourcesReques return instancesSetMachineResourcesRequestResource; } - public Builder setInstancesSetMachineResourcesRequestResource(InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { - this.instancesSetMachineResourcesRequestResource = instancesSetMachineResourcesRequestResource; + public Builder setInstancesSetMachineResourcesRequestResource( + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { + this.instancesSetMachineResourcesRequestResource = + instancesSetMachineResourcesRequestResource; return this; } @@ -370,36 +374,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetMachineResourcesInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetMachineResourcesInstanceHttpRequest( - access_token, - callback, - fields, - instance, - instancesSetMachineResourcesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetMachineResourcesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +403,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); - newBuilder.setInstancesSetMachineResourcesRequestResource(this.instancesSetMachineResourcesRequestResource); + newBuilder.setInstancesSetMachineResourcesRequestResource( + this.instancesSetMachineResourcesRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +417,35 @@ public Builder clone() { @Override public String toString() { return "SetMachineResourcesInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "instancesSetMachineResourcesRequestResource=" + instancesSetMachineResourcesRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "instancesSetMachineResourcesRequestResource=" + + instancesSetMachineResourcesRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +456,18 @@ public boolean equals(Object o) { } if (o instanceof SetMachineResourcesInstanceHttpRequest) { SetMachineResourcesInstanceHttpRequest that = (SetMachineResourcesInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instancesSetMachineResourcesRequestResource, that.getInstancesSetMachineResourcesRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals( + this.instancesSetMachineResourcesRequestResource, + that.getInstancesSetMachineResourcesRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +475,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - instancesSetMachineResourcesRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetMachineResourcesRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java index 8da9b084dc2f..87e1801f599a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetMachineTypeInstanceHttpRequest() { this.userIp = null; } - private SetMachineTypeInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetMachineTypeInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - if (fieldNames.contains("instancesSetMachineTypeRequestResource") && instancesSetMachineTypeRequestResource != null) { - fieldMap.put("instancesSetMachineTypeRequestResource", Collections.singletonList(String.valueOf(instancesSetMachineTypeRequestResource))); + if (fieldNames.contains("instancesSetMachineTypeRequestResource") + && instancesSetMachineTypeRequestResource != null) { + fieldMap.put( + "instancesSetMachineTypeRequestResource", + Collections.singletonList(String.valueOf(instancesSetMachineTypeRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetMachineTypeInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetMachineTypeInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetMachineTypeInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetMachineTypeInstanceHttpRequest(); } @@ -320,7 +320,8 @@ public InstancesSetMachineTypeRequest getInstancesSetMachineTypeRequestResource( return instancesSetMachineTypeRequestResource; } - public Builder setInstancesSetMachineTypeRequestResource(InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + public Builder setInstancesSetMachineTypeRequestResource( + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { this.instancesSetMachineTypeRequestResource = instancesSetMachineTypeRequestResource; return this; } @@ -370,36 +371,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetMachineTypeInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetMachineTypeInstanceHttpRequest( - access_token, - callback, - fields, - instance, - instancesSetMachineTypeRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetMachineTypeRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +400,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); - newBuilder.setInstancesSetMachineTypeRequestResource(this.instancesSetMachineTypeRequestResource); + newBuilder.setInstancesSetMachineTypeRequestResource( + this.instancesSetMachineTypeRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +414,35 @@ public Builder clone() { @Override public String toString() { return "SetMachineTypeInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "instancesSetMachineTypeRequestResource=" + instancesSetMachineTypeRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "instancesSetMachineTypeRequestResource=" + + instancesSetMachineTypeRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +453,18 @@ public boolean equals(Object o) { } if (o instanceof SetMachineTypeInstanceHttpRequest) { SetMachineTypeInstanceHttpRequest that = (SetMachineTypeInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instancesSetMachineTypeRequestResource, that.getInstancesSetMachineTypeRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals( + this.instancesSetMachineTypeRequestResource, + that.getInstancesSetMachineTypeRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +472,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - instancesSetMachineTypeRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetMachineTypeRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java index daa40e8beb1d..2df6c66b6f3d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetMetadataInstanceHttpRequest() { this.userIp = null; } - private SetMetadataInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetMetadataInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetMetadataInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetMetadataInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetMetadataInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetMetadataInstanceHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetMetadataInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetMetadataInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - metadataResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + key, + metadataResource, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "SetMetadataInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "metadataResource=" + metadataResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "metadataResource=" + + metadataResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof SetMetadataInstanceHttpRequest) { SetMetadataInstanceHttpRequest that = (SetMetadataInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.metadataResource, that.getMetadataResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.metadataResource, that.getMetadataResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - metadataResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + key, + metadataResource, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java index 2210c0a292bd..7f23570801a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetMinCpuPlatformInstanceHttpRequest() { this.userIp = null; } - private SetMinCpuPlatformInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetMinCpuPlatformInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - if (fieldNames.contains("instancesSetMinCpuPlatformRequestResource") && instancesSetMinCpuPlatformRequestResource != null) { - fieldMap.put("instancesSetMinCpuPlatformRequestResource", Collections.singletonList(String.valueOf(instancesSetMinCpuPlatformRequestResource))); + if (fieldNames.contains("instancesSetMinCpuPlatformRequestResource") + && instancesSetMinCpuPlatformRequestResource != null) { + fieldMap.put( + "instancesSetMinCpuPlatformRequestResource", + Collections.singletonList(String.valueOf(instancesSetMinCpuPlatformRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetMinCpuPlatformInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetMinCpuPlatformInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetMinCpuPlatformInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetMinCpuPlatformInstanceHttpRequest(); } @@ -247,7 +247,8 @@ public Builder mergeFrom(SetMinCpuPlatformInstanceHttpRequest other) { this.instance = other.instance; } if (other.getInstancesSetMinCpuPlatformRequestResource() != null) { - this.instancesSetMinCpuPlatformRequestResource = other.instancesSetMinCpuPlatformRequestResource; + this.instancesSetMinCpuPlatformRequestResource = + other.instancesSetMinCpuPlatformRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +273,8 @@ public Builder mergeFrom(SetMinCpuPlatformInstanceHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instance = source.instance; - this.instancesSetMinCpuPlatformRequestResource = source.instancesSetMinCpuPlatformRequestResource; + this.instancesSetMinCpuPlatformRequestResource = + source.instancesSetMinCpuPlatformRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -320,7 +322,8 @@ public InstancesSetMinCpuPlatformRequest getInstancesSetMinCpuPlatformRequestRes return instancesSetMinCpuPlatformRequestResource; } - public Builder setInstancesSetMinCpuPlatformRequestResource(InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { + public Builder setInstancesSetMinCpuPlatformRequestResource( + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { this.instancesSetMinCpuPlatformRequestResource = instancesSetMinCpuPlatformRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetMinCpuPlatformInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetMinCpuPlatformInstanceHttpRequest( - access_token, - callback, - fields, - instance, - instancesSetMinCpuPlatformRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetMinCpuPlatformRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +402,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); - newBuilder.setInstancesSetMinCpuPlatformRequestResource(this.instancesSetMinCpuPlatformRequestResource); + newBuilder.setInstancesSetMinCpuPlatformRequestResource( + this.instancesSetMinCpuPlatformRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "SetMinCpuPlatformInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "instancesSetMinCpuPlatformRequestResource=" + instancesSetMinCpuPlatformRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "instancesSetMinCpuPlatformRequestResource=" + + instancesSetMinCpuPlatformRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof SetMinCpuPlatformInstanceHttpRequest) { SetMinCpuPlatformInstanceHttpRequest that = (SetMinCpuPlatformInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instancesSetMinCpuPlatformRequestResource, that.getInstancesSetMinCpuPlatformRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals( + this.instancesSetMinCpuPlatformRequestResource, + that.getInstancesSetMinCpuPlatformRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - instancesSetMinCpuPlatformRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetMinCpuPlatformRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java index 3533150576ad..62658c55ce77 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetNamedPortsInstanceGroupHttpRequest() { this.userIp = null; } - private SetNamedPortsInstanceGroupHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetNamedPortsInstanceGroupHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instanceGroup") && instanceGroup != null) { fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); } - if (fieldNames.contains("instanceGroupsSetNamedPortsRequestResource") && instanceGroupsSetNamedPortsRequestResource != null) { - fieldMap.put("instanceGroupsSetNamedPortsRequestResource", Collections.singletonList(String.valueOf(instanceGroupsSetNamedPortsRequestResource))); + if (fieldNames.contains("instanceGroupsSetNamedPortsRequestResource") + && instanceGroupsSetNamedPortsRequestResource != null) { + fieldMap.put( + "instanceGroupsSetNamedPortsRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsSetNamedPortsRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetNamedPortsInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetNamedPortsInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetNamedPortsInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetNamedPortsInstanceGroupHttpRequest(); } @@ -247,7 +247,8 @@ public Builder mergeFrom(SetNamedPortsInstanceGroupHttpRequest other) { this.instanceGroup = other.instanceGroup; } if (other.getInstanceGroupsSetNamedPortsRequestResource() != null) { - this.instanceGroupsSetNamedPortsRequestResource = other.instanceGroupsSetNamedPortsRequestResource; + this.instanceGroupsSetNamedPortsRequestResource = + other.instanceGroupsSetNamedPortsRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +273,8 @@ public Builder mergeFrom(SetNamedPortsInstanceGroupHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instanceGroup = source.instanceGroup; - this.instanceGroupsSetNamedPortsRequestResource = source.instanceGroupsSetNamedPortsRequestResource; + this.instanceGroupsSetNamedPortsRequestResource = + source.instanceGroupsSetNamedPortsRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -320,7 +322,8 @@ public InstanceGroupsSetNamedPortsRequest getInstanceGroupsSetNamedPortsRequestR return instanceGroupsSetNamedPortsRequestResource; } - public Builder setInstanceGroupsSetNamedPortsRequestResource(InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { + public Builder setInstanceGroupsSetNamedPortsRequestResource( + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { this.instanceGroupsSetNamedPortsRequestResource = instanceGroupsSetNamedPortsRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetNamedPortsInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetNamedPortsInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - instanceGroupsSetNamedPortsRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + instanceGroupsSetNamedPortsRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +402,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroup(this.instanceGroup); - newBuilder.setInstanceGroupsSetNamedPortsRequestResource(this.instanceGroupsSetNamedPortsRequestResource); + newBuilder.setInstanceGroupsSetNamedPortsRequestResource( + this.instanceGroupsSetNamedPortsRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "SetNamedPortsInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "instanceGroupsSetNamedPortsRequestResource=" + instanceGroupsSetNamedPortsRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "instanceGroupsSetNamedPortsRequestResource=" + + instanceGroupsSetNamedPortsRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof SetNamedPortsInstanceGroupHttpRequest) { SetNamedPortsInstanceGroupHttpRequest that = (SetNamedPortsInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.instanceGroupsSetNamedPortsRequestResource, that.getInstanceGroupsSetNamedPortsRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals( + this.instanceGroupsSetNamedPortsRequestResource, + that.getInstanceGroupsSetNamedPortsRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - instanceGroupsSetNamedPortsRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + instanceGroupsSetNamedPortsRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java index fff6e2312872..9ac402efdc3d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetNamedPortsRegionInstanceGroupHttpRequest implements ApiMes private final String key; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource; + private final RegionInstanceGroupsSetNamedPortsRequest + regionInstanceGroupsSetNamedPortsRequestResource; private final String requestId; private final String userIp; @@ -56,7 +54,6 @@ private SetNamedPortsRegionInstanceGroupHttpRequest() { this.userIp = null; } - private SetNamedPortsRegionInstanceGroupHttpRequest( String access_token, String callback, @@ -67,8 +64,7 @@ private SetNamedPortsRegionInstanceGroupHttpRequest( String quotaUser, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +72,8 @@ private SetNamedPortsRegionInstanceGroupHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupsSetNamedPortsRequestResource = regionInstanceGroupsSetNamedPortsRequestResource; + this.regionInstanceGroupsSetNamedPortsRequestResource = + regionInstanceGroupsSetNamedPortsRequestResource; this.requestId = requestId; this.userIp = userIp; } @@ -105,8 +102,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource") && regionInstanceGroupsSetNamedPortsRequestResource != null) { - fieldMap.put("regionInstanceGroupsSetNamedPortsRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource))); + if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource") + && regionInstanceGroupsSetNamedPortsRequestResource != null) { + fieldMap.put( + "regionInstanceGroupsSetNamedPortsRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource))); } if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); @@ -186,7 +187,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupsSetNamedPortsRequest getRegionInstanceGroupsSetNamedPortsRequestResource() { + public RegionInstanceGroupsSetNamedPortsRequest + getRegionInstanceGroupsSetNamedPortsRequestResource() { return regionInstanceGroupsSetNamedPortsRequestResource; } @@ -198,22 +200,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetNamedPortsRegionInstanceGroupHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetNamedPortsRegionInstanceGroupHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetNamedPortsRegionInstanceGroupHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetNamedPortsRegionInstanceGroupHttpRequest(); } @@ -226,7 +230,8 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource; + private RegionInstanceGroupsSetNamedPortsRequest + regionInstanceGroupsSetNamedPortsRequestResource; private String requestId; private String userIp; @@ -256,7 +261,8 @@ public Builder mergeFrom(SetNamedPortsRegionInstanceGroupHttpRequest other) { this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupsSetNamedPortsRequestResource() != null) { - this.regionInstanceGroupsSetNamedPortsRequestResource = other.regionInstanceGroupsSetNamedPortsRequestResource; + this.regionInstanceGroupsSetNamedPortsRequestResource = + other.regionInstanceGroupsSetNamedPortsRequestResource; } if (other.getRequestId() != null) { this.requestId = other.requestId; @@ -275,7 +281,8 @@ public Builder mergeFrom(SetNamedPortsRegionInstanceGroupHttpRequest other) { this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupsSetNamedPortsRequestResource = source.regionInstanceGroupsSetNamedPortsRequestResource; + this.regionInstanceGroupsSetNamedPortsRequestResource = + source.regionInstanceGroupsSetNamedPortsRequestResource; this.requestId = source.requestId; this.userIp = source.userIp; } @@ -343,12 +350,15 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupsSetNamedPortsRequest getRegionInstanceGroupsSetNamedPortsRequestResource() { + public RegionInstanceGroupsSetNamedPortsRequest + getRegionInstanceGroupsSetNamedPortsRequestResource() { return regionInstanceGroupsSetNamedPortsRequestResource; } - public Builder setRegionInstanceGroupsSetNamedPortsRequestResource(RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { - this.regionInstanceGroupsSetNamedPortsRequestResource = regionInstanceGroupsSetNamedPortsRequestResource; + public Builder setRegionInstanceGroupsSetNamedPortsRequestResource( + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { + this.regionInstanceGroupsSetNamedPortsRequestResource = + regionInstanceGroupsSetNamedPortsRequestResource; return this; } @@ -370,36 +380,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetNamedPortsRegionInstanceGroupHttpRequest build() { String missing = ""; - - if (instanceGroup == null) { missing += " instanceGroup"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetNamedPortsRegionInstanceGroupHttpRequest( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - regionInstanceGroupsSetNamedPortsRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + regionInstanceGroupsSetNamedPortsRequestResource, + requestId, + userIp); } public Builder clone() { @@ -411,7 +412,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupsSetNamedPortsRequestResource(this.regionInstanceGroupsSetNamedPortsRequestResource); + newBuilder.setRegionInstanceGroupsSetNamedPortsRequestResource( + this.regionInstanceGroupsSetNamedPortsRequestResource); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +423,35 @@ public Builder clone() { @Override public String toString() { return "SetNamedPortsRegionInstanceGroupHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroup=" + instanceGroup + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupsSetNamedPortsRequestResource=" + regionInstanceGroupsSetNamedPortsRequestResource + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroup=" + + instanceGroup + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupsSetNamedPortsRequestResource=" + + regionInstanceGroupsSetNamedPortsRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +461,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetNamedPortsRegionInstanceGroupHttpRequest) { - SetNamedPortsRegionInstanceGroupHttpRequest that = (SetNamedPortsRegionInstanceGroupHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroup, that.getInstanceGroup()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupsSetNamedPortsRequestResource, that.getRegionInstanceGroupsSetNamedPortsRequestResource()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetNamedPortsRegionInstanceGroupHttpRequest that = + (SetNamedPortsRegionInstanceGroupHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroup, that.getInstanceGroup()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupsSetNamedPortsRequestResource, + that.getRegionInstanceGroupsSetNamedPortsRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +482,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroup, - key, - prettyPrint, - quotaUser, - regionInstanceGroupsSetNamedPortsRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroup, + key, + prettyPrint, + quotaUser, + regionInstanceGroupsSetNamedPortsRequestResource, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java index d2573941fadb..773951397df8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,7 +37,8 @@ public final class SetPrivateIpGoogleAccessSubnetworkHttpRequest implements ApiM private final String quotaUser; private final String requestId; private final String subnetwork; - private final SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource; + private final SubnetworksSetPrivateIpGoogleAccessRequest + subnetworksSetPrivateIpGoogleAccessRequestResource; private final String userIp; private SetPrivateIpGoogleAccessSubnetworkHttpRequest() { @@ -56,7 +54,6 @@ private SetPrivateIpGoogleAccessSubnetworkHttpRequest() { this.userIp = null; } - private SetPrivateIpGoogleAccessSubnetworkHttpRequest( String access_token, String callback, @@ -67,8 +64,7 @@ private SetPrivateIpGoogleAccessSubnetworkHttpRequest( String requestId, String subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -77,7 +73,8 @@ private SetPrivateIpGoogleAccessSubnetworkHttpRequest( this.quotaUser = quotaUser; this.requestId = requestId; this.subnetwork = subnetwork; - this.subnetworksSetPrivateIpGoogleAccessRequestResource = subnetworksSetPrivateIpGoogleAccessRequestResource; + this.subnetworksSetPrivateIpGoogleAccessRequestResource = + subnetworksSetPrivateIpGoogleAccessRequestResource; this.userIp = userIp; } @@ -108,8 +105,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("subnetwork") && subnetwork != null) { fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); } - if (fieldNames.contains("subnetworksSetPrivateIpGoogleAccessRequestResource") && subnetworksSetPrivateIpGoogleAccessRequestResource != null) { - fieldMap.put("subnetworksSetPrivateIpGoogleAccessRequestResource", Collections.singletonList(String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource))); + if (fieldNames.contains("subnetworksSetPrivateIpGoogleAccessRequestResource") + && subnetworksSetPrivateIpGoogleAccessRequestResource != null) { + fieldMap.put( + "subnetworksSetPrivateIpGoogleAccessRequestResource", + Collections.singletonList( + String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -190,7 +191,8 @@ public String getSubnetwork() { return subnetwork; } - public SubnetworksSetPrivateIpGoogleAccessRequest getSubnetworksSetPrivateIpGoogleAccessRequestResource() { + public SubnetworksSetPrivateIpGoogleAccessRequest + getSubnetworksSetPrivateIpGoogleAccessRequestResource() { return subnetworksSetPrivateIpGoogleAccessRequestResource; } @@ -198,22 +200,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetPrivateIpGoogleAccessSubnetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetPrivateIpGoogleAccessSubnetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetPrivateIpGoogleAccessSubnetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetPrivateIpGoogleAccessSubnetworkHttpRequest(); } @@ -227,7 +231,8 @@ public static class Builder { private String quotaUser; private String requestId; private String subnetwork; - private SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource; + private SubnetworksSetPrivateIpGoogleAccessRequest + subnetworksSetPrivateIpGoogleAccessRequestResource; private String userIp; Builder() {} @@ -259,7 +264,8 @@ public Builder mergeFrom(SetPrivateIpGoogleAccessSubnetworkHttpRequest other) { this.subnetwork = other.subnetwork; } if (other.getSubnetworksSetPrivateIpGoogleAccessRequestResource() != null) { - this.subnetworksSetPrivateIpGoogleAccessRequestResource = other.subnetworksSetPrivateIpGoogleAccessRequestResource; + this.subnetworksSetPrivateIpGoogleAccessRequestResource = + other.subnetworksSetPrivateIpGoogleAccessRequestResource; } if (other.getUserIp() != null) { this.userIp = other.userIp; @@ -276,7 +282,8 @@ public Builder mergeFrom(SetPrivateIpGoogleAccessSubnetworkHttpRequest other) { this.quotaUser = source.quotaUser; this.requestId = source.requestId; this.subnetwork = source.subnetwork; - this.subnetworksSetPrivateIpGoogleAccessRequestResource = source.subnetworksSetPrivateIpGoogleAccessRequestResource; + this.subnetworksSetPrivateIpGoogleAccessRequestResource = + source.subnetworksSetPrivateIpGoogleAccessRequestResource; this.userIp = source.userIp; } @@ -352,12 +359,16 @@ public Builder setSubnetwork(String subnetwork) { return this; } - public SubnetworksSetPrivateIpGoogleAccessRequest getSubnetworksSetPrivateIpGoogleAccessRequestResource() { + public SubnetworksSetPrivateIpGoogleAccessRequest + getSubnetworksSetPrivateIpGoogleAccessRequestResource() { return subnetworksSetPrivateIpGoogleAccessRequestResource; } - public Builder setSubnetworksSetPrivateIpGoogleAccessRequestResource(SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { - this.subnetworksSetPrivateIpGoogleAccessRequestResource = subnetworksSetPrivateIpGoogleAccessRequestResource; + public Builder setSubnetworksSetPrivateIpGoogleAccessRequestResource( + SubnetworksSetPrivateIpGoogleAccessRequest + subnetworksSetPrivateIpGoogleAccessRequestResource) { + this.subnetworksSetPrivateIpGoogleAccessRequestResource = + subnetworksSetPrivateIpGoogleAccessRequestResource; return this; } @@ -370,36 +381,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetPrivateIpGoogleAccessSubnetworkHttpRequest build() { String missing = ""; - - - - - - if (subnetwork == null) { missing += " subnetwork"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetPrivateIpGoogleAccessSubnetworkHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - subnetworksSetPrivateIpGoogleAccessRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworksSetPrivateIpGoogleAccessRequestResource, + userIp); } public Builder clone() { @@ -412,7 +414,8 @@ public Builder clone() { newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); newBuilder.setSubnetwork(this.subnetwork); - newBuilder.setSubnetworksSetPrivateIpGoogleAccessRequestResource(this.subnetworksSetPrivateIpGoogleAccessRequestResource); + newBuilder.setSubnetworksSetPrivateIpGoogleAccessRequestResource( + this.subnetworksSetPrivateIpGoogleAccessRequestResource); newBuilder.setUserIp(this.userIp); return newBuilder; } @@ -421,16 +424,35 @@ public Builder clone() { @Override public String toString() { return "SetPrivateIpGoogleAccessSubnetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "subnetwork=" + subnetwork + ", " - + "subnetworksSetPrivateIpGoogleAccessRequestResource=" + subnetworksSetPrivateIpGoogleAccessRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "subnetwork=" + + subnetwork + + ", " + + "subnetworksSetPrivateIpGoogleAccessRequestResource=" + + subnetworksSetPrivateIpGoogleAccessRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +462,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetPrivateIpGoogleAccessSubnetworkHttpRequest) { - SetPrivateIpGoogleAccessSubnetworkHttpRequest that = (SetPrivateIpGoogleAccessSubnetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) && - Objects.equals(this.subnetworksSetPrivateIpGoogleAccessRequestResource, that.getSubnetworksSetPrivateIpGoogleAccessRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetPrivateIpGoogleAccessSubnetworkHttpRequest that = + (SetPrivateIpGoogleAccessSubnetworkHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.subnetwork, that.getSubnetwork()) + && Objects.equals( + this.subnetworksSetPrivateIpGoogleAccessRequestResource, + that.getSubnetworksSetPrivateIpGoogleAccessRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +483,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - subnetwork, - subnetworksSetPrivateIpGoogleAccessRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + subnetwork, + subnetworksSetPrivateIpGoogleAccessRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java index 5c4504bcd8fc..13b0df6fae62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetProxyHeaderTargetSslProxyHttpRequest() { this.userIp = null; } - private SetProxyHeaderTargetSslProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetProxyHeaderTargetSslProxyHttpRequest( String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, String targetSslProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +71,8 @@ private SetProxyHeaderTargetSslProxyHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; - this.targetSslProxiesSetProxyHeaderRequestResource = targetSslProxiesSetProxyHeaderRequestResource; + this.targetSslProxiesSetProxyHeaderRequestResource = + targetSslProxiesSetProxyHeaderRequestResource; this.targetSslProxy = targetSslProxy; this.userIp = userIp; } @@ -105,8 +101,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } - if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource") && targetSslProxiesSetProxyHeaderRequestResource != null) { - fieldMap.put("targetSslProxiesSetProxyHeaderRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource))); + if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource") + && targetSslProxiesSetProxyHeaderRequestResource != null) { + fieldMap.put( + "targetSslProxiesSetProxyHeaderRequestResource", + Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource))); } if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); @@ -198,22 +197,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetProxyHeaderTargetSslProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetProxyHeaderTargetSslProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetProxyHeaderTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetProxyHeaderTargetSslProxyHttpRequest(); } @@ -256,7 +257,8 @@ public Builder mergeFrom(SetProxyHeaderTargetSslProxyHttpRequest other) { this.requestId = other.requestId; } if (other.getTargetSslProxiesSetProxyHeaderRequestResource() != null) { - this.targetSslProxiesSetProxyHeaderRequestResource = other.targetSslProxiesSetProxyHeaderRequestResource; + this.targetSslProxiesSetProxyHeaderRequestResource = + other.targetSslProxiesSetProxyHeaderRequestResource; } if (other.getTargetSslProxy() != null) { this.targetSslProxy = other.targetSslProxy; @@ -275,7 +277,8 @@ public Builder mergeFrom(SetProxyHeaderTargetSslProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; - this.targetSslProxiesSetProxyHeaderRequestResource = source.targetSslProxiesSetProxyHeaderRequestResource; + this.targetSslProxiesSetProxyHeaderRequestResource = + source.targetSslProxiesSetProxyHeaderRequestResource; this.targetSslProxy = source.targetSslProxy; this.userIp = source.userIp; } @@ -343,12 +346,15 @@ public Builder setRequestId(String requestId) { return this; } - public TargetSslProxiesSetProxyHeaderRequest getTargetSslProxiesSetProxyHeaderRequestResource() { + public TargetSslProxiesSetProxyHeaderRequest + getTargetSslProxiesSetProxyHeaderRequestResource() { return targetSslProxiesSetProxyHeaderRequestResource; } - public Builder setTargetSslProxiesSetProxyHeaderRequestResource(TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { - this.targetSslProxiesSetProxyHeaderRequestResource = targetSslProxiesSetProxyHeaderRequestResource; + public Builder setTargetSslProxiesSetProxyHeaderRequestResource( + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + this.targetSslProxiesSetProxyHeaderRequestResource = + targetSslProxiesSetProxyHeaderRequestResource; return this; } @@ -370,17 +376,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetProxyHeaderTargetSslProxyHttpRequest build() { String missing = ""; - - - - - - - if (targetSslProxy == null) { missing += " targetSslProxy"; } @@ -389,17 +387,16 @@ public SetProxyHeaderTargetSslProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetProxyHeaderTargetSslProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxiesSetProxyHeaderRequestResource, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxiesSetProxyHeaderRequestResource, + targetSslProxy, + userIp); } public Builder clone() { @@ -411,7 +408,8 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); - newBuilder.setTargetSslProxiesSetProxyHeaderRequestResource(this.targetSslProxiesSetProxyHeaderRequestResource); + newBuilder.setTargetSslProxiesSetProxyHeaderRequestResource( + this.targetSslProxiesSetProxyHeaderRequestResource); newBuilder.setTargetSslProxy(this.targetSslProxy); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +419,35 @@ public Builder clone() { @Override public String toString() { return "SetProxyHeaderTargetSslProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetSslProxiesSetProxyHeaderRequestResource=" + targetSslProxiesSetProxyHeaderRequestResource + ", " - + "targetSslProxy=" + targetSslProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetSslProxiesSetProxyHeaderRequestResource=" + + targetSslProxiesSetProxyHeaderRequestResource + + ", " + + "targetSslProxy=" + + targetSslProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +458,18 @@ public boolean equals(Object o) { } if (o instanceof SetProxyHeaderTargetSslProxyHttpRequest) { SetProxyHeaderTargetSslProxyHttpRequest that = (SetProxyHeaderTargetSslProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetSslProxiesSetProxyHeaderRequestResource, that.getTargetSslProxiesSetProxyHeaderRequestResource()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetSslProxiesSetProxyHeaderRequestResource, + that.getTargetSslProxiesSetProxyHeaderRequestResource()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +477,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxiesSetProxyHeaderRequestResource, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxiesSetProxyHeaderRequestResource, + targetSslProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java index 7c4ee59d03b5..4c2535a0ef40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetProxyHeaderTargetTcpProxyHttpRequest() { this.userIp = null; } - private SetProxyHeaderTargetTcpProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetProxyHeaderTargetTcpProxyHttpRequest( String requestId, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, String targetTcpProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +71,8 @@ private SetProxyHeaderTargetTcpProxyHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; - this.targetTcpProxiesSetProxyHeaderRequestResource = targetTcpProxiesSetProxyHeaderRequestResource; + this.targetTcpProxiesSetProxyHeaderRequestResource = + targetTcpProxiesSetProxyHeaderRequestResource; this.targetTcpProxy = targetTcpProxy; this.userIp = userIp; } @@ -105,8 +101,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } - if (fieldNames.contains("targetTcpProxiesSetProxyHeaderRequestResource") && targetTcpProxiesSetProxyHeaderRequestResource != null) { - fieldMap.put("targetTcpProxiesSetProxyHeaderRequestResource", Collections.singletonList(String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource))); + if (fieldNames.contains("targetTcpProxiesSetProxyHeaderRequestResource") + && targetTcpProxiesSetProxyHeaderRequestResource != null) { + fieldMap.put( + "targetTcpProxiesSetProxyHeaderRequestResource", + Collections.singletonList(String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource))); } if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); @@ -198,22 +197,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetProxyHeaderTargetTcpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetProxyHeaderTargetTcpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetProxyHeaderTargetTcpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetProxyHeaderTargetTcpProxyHttpRequest(); } @@ -256,7 +257,8 @@ public Builder mergeFrom(SetProxyHeaderTargetTcpProxyHttpRequest other) { this.requestId = other.requestId; } if (other.getTargetTcpProxiesSetProxyHeaderRequestResource() != null) { - this.targetTcpProxiesSetProxyHeaderRequestResource = other.targetTcpProxiesSetProxyHeaderRequestResource; + this.targetTcpProxiesSetProxyHeaderRequestResource = + other.targetTcpProxiesSetProxyHeaderRequestResource; } if (other.getTargetTcpProxy() != null) { this.targetTcpProxy = other.targetTcpProxy; @@ -275,7 +277,8 @@ public Builder mergeFrom(SetProxyHeaderTargetTcpProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; - this.targetTcpProxiesSetProxyHeaderRequestResource = source.targetTcpProxiesSetProxyHeaderRequestResource; + this.targetTcpProxiesSetProxyHeaderRequestResource = + source.targetTcpProxiesSetProxyHeaderRequestResource; this.targetTcpProxy = source.targetTcpProxy; this.userIp = source.userIp; } @@ -343,12 +346,15 @@ public Builder setRequestId(String requestId) { return this; } - public TargetTcpProxiesSetProxyHeaderRequest getTargetTcpProxiesSetProxyHeaderRequestResource() { + public TargetTcpProxiesSetProxyHeaderRequest + getTargetTcpProxiesSetProxyHeaderRequestResource() { return targetTcpProxiesSetProxyHeaderRequestResource; } - public Builder setTargetTcpProxiesSetProxyHeaderRequestResource(TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { - this.targetTcpProxiesSetProxyHeaderRequestResource = targetTcpProxiesSetProxyHeaderRequestResource; + public Builder setTargetTcpProxiesSetProxyHeaderRequestResource( + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { + this.targetTcpProxiesSetProxyHeaderRequestResource = + targetTcpProxiesSetProxyHeaderRequestResource; return this; } @@ -370,17 +376,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetProxyHeaderTargetTcpProxyHttpRequest build() { String missing = ""; - - - - - - - if (targetTcpProxy == null) { missing += " targetTcpProxy"; } @@ -389,17 +387,16 @@ public SetProxyHeaderTargetTcpProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetProxyHeaderTargetTcpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetTcpProxiesSetProxyHeaderRequestResource, - targetTcpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetTcpProxiesSetProxyHeaderRequestResource, + targetTcpProxy, + userIp); } public Builder clone() { @@ -411,7 +408,8 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); - newBuilder.setTargetTcpProxiesSetProxyHeaderRequestResource(this.targetTcpProxiesSetProxyHeaderRequestResource); + newBuilder.setTargetTcpProxiesSetProxyHeaderRequestResource( + this.targetTcpProxiesSetProxyHeaderRequestResource); newBuilder.setTargetTcpProxy(this.targetTcpProxy); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +419,35 @@ public Builder clone() { @Override public String toString() { return "SetProxyHeaderTargetTcpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetTcpProxiesSetProxyHeaderRequestResource=" + targetTcpProxiesSetProxyHeaderRequestResource + ", " - + "targetTcpProxy=" + targetTcpProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetTcpProxiesSetProxyHeaderRequestResource=" + + targetTcpProxiesSetProxyHeaderRequestResource + + ", " + + "targetTcpProxy=" + + targetTcpProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +458,18 @@ public boolean equals(Object o) { } if (o instanceof SetProxyHeaderTargetTcpProxyHttpRequest) { SetProxyHeaderTargetTcpProxyHttpRequest that = (SetProxyHeaderTargetTcpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetTcpProxiesSetProxyHeaderRequestResource, that.getTargetTcpProxiesSetProxyHeaderRequestResource()) && - Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetTcpProxiesSetProxyHeaderRequestResource, + that.getTargetTcpProxiesSetProxyHeaderRequestResource()) + && Objects.equals(this.targetTcpProxy, that.getTargetTcpProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +477,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetTcpProxiesSetProxyHeaderRequestResource, - targetTcpProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetTcpProxiesSetProxyHeaderRequestResource, + targetTcpProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java index 5a9b1e6b60ab..a31bdc208c62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetSchedulingInstanceHttpRequest() { this.userIp = null; } - private SetSchedulingInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetSchedulingInstanceHttpRequest( String quotaUser, String requestId, Scheduling schedulingResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("schedulingResource") && schedulingResource != null) { - fieldMap.put("schedulingResource", Collections.singletonList(String.valueOf(schedulingResource))); + fieldMap.put( + "schedulingResource", Collections.singletonList(String.valueOf(schedulingResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetSchedulingInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetSchedulingInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetSchedulingInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetSchedulingInstanceHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetSchedulingInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetSchedulingInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - schedulingResource, - userIp - ); + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + schedulingResource, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "SetSchedulingInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "schedulingResource=" + schedulingResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "schedulingResource=" + + schedulingResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof SetSchedulingInstanceHttpRequest) { SetSchedulingInstanceHttpRequest that = (SetSchedulingInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.schedulingResource, that.getSchedulingResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.schedulingResource, that.getSchedulingResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - schedulingResource, - userIp - ); + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + schedulingResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java index 2a9d055f32b9..346ad7ec664a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetServiceAccountInstanceHttpRequest() { this.userIp = null; } - private SetServiceAccountInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetServiceAccountInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -96,8 +91,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - if (fieldNames.contains("instancesSetServiceAccountRequestResource") && instancesSetServiceAccountRequestResource != null) { - fieldMap.put("instancesSetServiceAccountRequestResource", Collections.singletonList(String.valueOf(instancesSetServiceAccountRequestResource))); + if (fieldNames.contains("instancesSetServiceAccountRequestResource") + && instancesSetServiceAccountRequestResource != null) { + fieldMap.put( + "instancesSetServiceAccountRequestResource", + Collections.singletonList(String.valueOf(instancesSetServiceAccountRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +196,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetServiceAccountInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetServiceAccountInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetServiceAccountInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetServiceAccountInstanceHttpRequest(); } @@ -247,7 +247,8 @@ public Builder mergeFrom(SetServiceAccountInstanceHttpRequest other) { this.instance = other.instance; } if (other.getInstancesSetServiceAccountRequestResource() != null) { - this.instancesSetServiceAccountRequestResource = other.instancesSetServiceAccountRequestResource; + this.instancesSetServiceAccountRequestResource = + other.instancesSetServiceAccountRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +273,8 @@ public Builder mergeFrom(SetServiceAccountInstanceHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instance = source.instance; - this.instancesSetServiceAccountRequestResource = source.instancesSetServiceAccountRequestResource; + this.instancesSetServiceAccountRequestResource = + source.instancesSetServiceAccountRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -320,7 +322,8 @@ public InstancesSetServiceAccountRequest getInstancesSetServiceAccountRequestRes return instancesSetServiceAccountRequestResource; } - public Builder setInstancesSetServiceAccountRequestResource(InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { + public Builder setInstancesSetServiceAccountRequestResource( + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { this.instancesSetServiceAccountRequestResource = instancesSetServiceAccountRequestResource; return this; } @@ -370,36 +373,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetServiceAccountInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetServiceAccountInstanceHttpRequest( - access_token, - callback, - fields, - instance, - instancesSetServiceAccountRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetServiceAccountRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +402,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); - newBuilder.setInstancesSetServiceAccountRequestResource(this.instancesSetServiceAccountRequestResource); + newBuilder.setInstancesSetServiceAccountRequestResource( + this.instancesSetServiceAccountRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "SetServiceAccountInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "instancesSetServiceAccountRequestResource=" + instancesSetServiceAccountRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "instancesSetServiceAccountRequestResource=" + + instancesSetServiceAccountRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +455,18 @@ public boolean equals(Object o) { } if (o instanceof SetServiceAccountInstanceHttpRequest) { SetServiceAccountInstanceHttpRequest that = (SetServiceAccountInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instancesSetServiceAccountRequestResource, that.getInstancesSetServiceAccountRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals( + this.instancesSetServiceAccountRequestResource, + that.getInstancesSetServiceAccountRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +474,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - instancesSetServiceAccountRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesSetServiceAccountRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java index 50899537dcbe..856b6f8dc764 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetSslCertificatesTargetHttpsProxyHttpRequest implements ApiM private final String prettyPrint; private final String quotaUser; private final String requestId; - private final TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource; + private final TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource; private final String targetHttpsProxy; private final String userIp; @@ -56,7 +54,6 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest() { this.userIp = null; } - private SetSslCertificatesTargetHttpsProxyHttpRequest( String access_token, String callback, @@ -65,10 +62,10 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest( String prettyPrint, String quotaUser, String requestId, - TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource, String targetHttpsProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +73,8 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; - this.targetHttpsProxiesSetSslCertificatesRequestResource = targetHttpsProxiesSetSslCertificatesRequestResource; + this.targetHttpsProxiesSetSslCertificatesRequestResource = + targetHttpsProxiesSetSslCertificatesRequestResource; this.targetHttpsProxy = targetHttpsProxy; this.userIp = userIp; } @@ -105,8 +103,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } - if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource") && targetHttpsProxiesSetSslCertificatesRequestResource != null) { - fieldMap.put("targetHttpsProxiesSetSslCertificatesRequestResource", Collections.singletonList(String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource))); + if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource") + && targetHttpsProxiesSetSslCertificatesRequestResource != null) { + fieldMap.put( + "targetHttpsProxiesSetSslCertificatesRequestResource", + Collections.singletonList( + String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource))); } if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); @@ -186,7 +188,8 @@ public String getRequestId() { return requestId; } - public TargetHttpsProxiesSetSslCertificatesRequest getTargetHttpsProxiesSetSslCertificatesRequestResource() { + public TargetHttpsProxiesSetSslCertificatesRequest + getTargetHttpsProxiesSetSslCertificatesRequestResource() { return targetHttpsProxiesSetSslCertificatesRequestResource; } @@ -198,22 +201,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetSslCertificatesTargetHttpsProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetSslCertificatesTargetHttpsProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetSslCertificatesTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetSslCertificatesTargetHttpsProxyHttpRequest(); } @@ -226,7 +231,8 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String requestId; - private TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource; + private TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource; private String targetHttpsProxy; private String userIp; @@ -256,7 +262,8 @@ public Builder mergeFrom(SetSslCertificatesTargetHttpsProxyHttpRequest other) { this.requestId = other.requestId; } if (other.getTargetHttpsProxiesSetSslCertificatesRequestResource() != null) { - this.targetHttpsProxiesSetSslCertificatesRequestResource = other.targetHttpsProxiesSetSslCertificatesRequestResource; + this.targetHttpsProxiesSetSslCertificatesRequestResource = + other.targetHttpsProxiesSetSslCertificatesRequestResource; } if (other.getTargetHttpsProxy() != null) { this.targetHttpsProxy = other.targetHttpsProxy; @@ -275,7 +282,8 @@ public Builder mergeFrom(SetSslCertificatesTargetHttpsProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; - this.targetHttpsProxiesSetSslCertificatesRequestResource = source.targetHttpsProxiesSetSslCertificatesRequestResource; + this.targetHttpsProxiesSetSslCertificatesRequestResource = + source.targetHttpsProxiesSetSslCertificatesRequestResource; this.targetHttpsProxy = source.targetHttpsProxy; this.userIp = source.userIp; } @@ -343,12 +351,16 @@ public Builder setRequestId(String requestId) { return this; } - public TargetHttpsProxiesSetSslCertificatesRequest getTargetHttpsProxiesSetSslCertificatesRequestResource() { + public TargetHttpsProxiesSetSslCertificatesRequest + getTargetHttpsProxiesSetSslCertificatesRequestResource() { return targetHttpsProxiesSetSslCertificatesRequestResource; } - public Builder setTargetHttpsProxiesSetSslCertificatesRequestResource(TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { - this.targetHttpsProxiesSetSslCertificatesRequestResource = targetHttpsProxiesSetSslCertificatesRequestResource; + public Builder setTargetHttpsProxiesSetSslCertificatesRequestResource( + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource) { + this.targetHttpsProxiesSetSslCertificatesRequestResource = + targetHttpsProxiesSetSslCertificatesRequestResource; return this; } @@ -370,17 +382,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetSslCertificatesTargetHttpsProxyHttpRequest build() { String missing = ""; - - - - - - - if (targetHttpsProxy == null) { missing += " targetHttpsProxy"; } @@ -389,17 +393,16 @@ public SetSslCertificatesTargetHttpsProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetSslCertificatesTargetHttpsProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpsProxiesSetSslCertificatesRequestResource, - targetHttpsProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxiesSetSslCertificatesRequestResource, + targetHttpsProxy, + userIp); } public Builder clone() { @@ -411,7 +414,8 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); - newBuilder.setTargetHttpsProxiesSetSslCertificatesRequestResource(this.targetHttpsProxiesSetSslCertificatesRequestResource); + newBuilder.setTargetHttpsProxiesSetSslCertificatesRequestResource( + this.targetHttpsProxiesSetSslCertificatesRequestResource); newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +425,35 @@ public Builder clone() { @Override public String toString() { return "SetSslCertificatesTargetHttpsProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpsProxiesSetSslCertificatesRequestResource=" + targetHttpsProxiesSetSslCertificatesRequestResource + ", " - + "targetHttpsProxy=" + targetHttpsProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpsProxiesSetSslCertificatesRequestResource=" + + targetHttpsProxiesSetSslCertificatesRequestResource + + ", " + + "targetHttpsProxy=" + + targetHttpsProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +463,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetSslCertificatesTargetHttpsProxyHttpRequest) { - SetSslCertificatesTargetHttpsProxyHttpRequest that = (SetSslCertificatesTargetHttpsProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpsProxiesSetSslCertificatesRequestResource, that.getTargetHttpsProxiesSetSslCertificatesRequestResource()) && - Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetSslCertificatesTargetHttpsProxyHttpRequest that = + (SetSslCertificatesTargetHttpsProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetHttpsProxiesSetSslCertificatesRequestResource, + that.getTargetHttpsProxiesSetSslCertificatesRequestResource()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +484,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpsProxiesSetSslCertificatesRequestResource, - targetHttpsProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxiesSetSslCertificatesRequestResource, + targetHttpsProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java index 16ac28d1d552..e569f57696c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetSslCertificatesTargetSslProxyHttpRequest implements ApiMes private final String prettyPrint; private final String quotaUser; private final String requestId; - private final TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource; + private final TargetSslProxiesSetSslCertificatesRequest + targetSslProxiesSetSslCertificatesRequestResource; private final String targetSslProxy; private final String userIp; @@ -56,7 +54,6 @@ private SetSslCertificatesTargetSslProxyHttpRequest() { this.userIp = null; } - private SetSslCertificatesTargetSslProxyHttpRequest( String access_token, String callback, @@ -67,8 +64,7 @@ private SetSslCertificatesTargetSslProxyHttpRequest( String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, String targetSslProxy, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +72,8 @@ private SetSslCertificatesTargetSslProxyHttpRequest( this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; this.requestId = requestId; - this.targetSslProxiesSetSslCertificatesRequestResource = targetSslProxiesSetSslCertificatesRequestResource; + this.targetSslProxiesSetSslCertificatesRequestResource = + targetSslProxiesSetSslCertificatesRequestResource; this.targetSslProxy = targetSslProxy; this.userIp = userIp; } @@ -105,8 +102,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } - if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource") && targetSslProxiesSetSslCertificatesRequestResource != null) { - fieldMap.put("targetSslProxiesSetSslCertificatesRequestResource", Collections.singletonList(String.valueOf(targetSslProxiesSetSslCertificatesRequestResource))); + if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource") + && targetSslProxiesSetSslCertificatesRequestResource != null) { + fieldMap.put( + "targetSslProxiesSetSslCertificatesRequestResource", + Collections.singletonList( + String.valueOf(targetSslProxiesSetSslCertificatesRequestResource))); } if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); @@ -186,7 +187,8 @@ public String getRequestId() { return requestId; } - public TargetSslProxiesSetSslCertificatesRequest getTargetSslProxiesSetSslCertificatesRequestResource() { + public TargetSslProxiesSetSslCertificatesRequest + getTargetSslProxiesSetSslCertificatesRequestResource() { return targetSslProxiesSetSslCertificatesRequestResource; } @@ -198,22 +200,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetSslCertificatesTargetSslProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetSslCertificatesTargetSslProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetSslCertificatesTargetSslProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetSslCertificatesTargetSslProxyHttpRequest(); } @@ -226,7 +230,8 @@ public static class Builder { private String prettyPrint; private String quotaUser; private String requestId; - private TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource; + private TargetSslProxiesSetSslCertificatesRequest + targetSslProxiesSetSslCertificatesRequestResource; private String targetSslProxy; private String userIp; @@ -256,7 +261,8 @@ public Builder mergeFrom(SetSslCertificatesTargetSslProxyHttpRequest other) { this.requestId = other.requestId; } if (other.getTargetSslProxiesSetSslCertificatesRequestResource() != null) { - this.targetSslProxiesSetSslCertificatesRequestResource = other.targetSslProxiesSetSslCertificatesRequestResource; + this.targetSslProxiesSetSslCertificatesRequestResource = + other.targetSslProxiesSetSslCertificatesRequestResource; } if (other.getTargetSslProxy() != null) { this.targetSslProxy = other.targetSslProxy; @@ -275,7 +281,8 @@ public Builder mergeFrom(SetSslCertificatesTargetSslProxyHttpRequest other) { this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; this.requestId = source.requestId; - this.targetSslProxiesSetSslCertificatesRequestResource = source.targetSslProxiesSetSslCertificatesRequestResource; + this.targetSslProxiesSetSslCertificatesRequestResource = + source.targetSslProxiesSetSslCertificatesRequestResource; this.targetSslProxy = source.targetSslProxy; this.userIp = source.userIp; } @@ -343,12 +350,16 @@ public Builder setRequestId(String requestId) { return this; } - public TargetSslProxiesSetSslCertificatesRequest getTargetSslProxiesSetSslCertificatesRequestResource() { + public TargetSslProxiesSetSslCertificatesRequest + getTargetSslProxiesSetSslCertificatesRequestResource() { return targetSslProxiesSetSslCertificatesRequestResource; } - public Builder setTargetSslProxiesSetSslCertificatesRequestResource(TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { - this.targetSslProxiesSetSslCertificatesRequestResource = targetSslProxiesSetSslCertificatesRequestResource; + public Builder setTargetSslProxiesSetSslCertificatesRequestResource( + TargetSslProxiesSetSslCertificatesRequest + targetSslProxiesSetSslCertificatesRequestResource) { + this.targetSslProxiesSetSslCertificatesRequestResource = + targetSslProxiesSetSslCertificatesRequestResource; return this; } @@ -370,17 +381,9 @@ public Builder setUserIp(String userIp) { return this; } - public SetSslCertificatesTargetSslProxyHttpRequest build() { String missing = ""; - - - - - - - if (targetSslProxy == null) { missing += " targetSslProxy"; } @@ -389,17 +392,16 @@ public SetSslCertificatesTargetSslProxyHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new SetSslCertificatesTargetSslProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxiesSetSslCertificatesRequestResource, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxiesSetSslCertificatesRequestResource, + targetSslProxy, + userIp); } public Builder clone() { @@ -411,7 +413,8 @@ public Builder clone() { newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); newBuilder.setRequestId(this.requestId); - newBuilder.setTargetSslProxiesSetSslCertificatesRequestResource(this.targetSslProxiesSetSslCertificatesRequestResource); + newBuilder.setTargetSslProxiesSetSslCertificatesRequestResource( + this.targetSslProxiesSetSslCertificatesRequestResource); newBuilder.setTargetSslProxy(this.targetSslProxy); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +424,35 @@ public Builder clone() { @Override public String toString() { return "SetSslCertificatesTargetSslProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetSslProxiesSetSslCertificatesRequestResource=" + targetSslProxiesSetSslCertificatesRequestResource + ", " - + "targetSslProxy=" + targetSslProxy + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetSslProxiesSetSslCertificatesRequestResource=" + + targetSslProxiesSetSslCertificatesRequestResource + + ", " + + "targetSslProxy=" + + targetSslProxy + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +462,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetSslCertificatesTargetSslProxyHttpRequest) { - SetSslCertificatesTargetSslProxyHttpRequest that = (SetSslCertificatesTargetSslProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetSslProxiesSetSslCertificatesRequestResource, that.getTargetSslProxiesSetSslCertificatesRequestResource()) && - Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetSslCertificatesTargetSslProxyHttpRequest that = + (SetSslCertificatesTargetSslProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetSslProxiesSetSslCertificatesRequestResource, + that.getTargetSslProxiesSetSslCertificatesRequestResource()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +483,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetSslProxiesSetSslCertificatesRequestResource, - targetSslProxy, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetSslProxiesSetSslCertificatesRequestResource, + targetSslProxy, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..57545bbf899e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java @@ -0,0 +1,481 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetSslPolicyTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final SslPolicyReference sslPolicyReferenceResource; + private final String targetHttpsProxy; + private final String userIp; + + private SetSslPolicyTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.sslPolicyReferenceResource = null; + this.targetHttpsProxy = null; + this.userIp = null; + } + + private SetSslPolicyTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + SslPolicyReference sslPolicyReferenceResource, + String targetHttpsProxy, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.sslPolicyReferenceResource = sslPolicyReferenceResource; + this.targetHttpsProxy = targetHttpsProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) { + fieldMap.put( + "sslPolicyReferenceResource", + Collections.singletonList(String.valueOf(sslPolicyReferenceResource))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("sslPolicyReferenceResource")) { + return String.valueOf(sslPolicyReferenceResource); + } + if (fieldName.equals("targetHttpsProxy")) { + return String.valueOf(targetHttpsProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public SslPolicyReference getApiMessageRequestBody() { + return sslPolicyReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public SslPolicyReference getSslPolicyReferenceResource() { + return sslPolicyReferenceResource; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetSslPolicyTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetSslPolicyTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetSslPolicyTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetSslPolicyTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private SslPolicyReference sslPolicyReferenceResource; + private String targetHttpsProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetSslPolicyTargetHttpsProxyHttpRequest other) { + if (other == SetSslPolicyTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSslPolicyReferenceResource() != null) { + this.sslPolicyReferenceResource = other.sslPolicyReferenceResource; + } + if (other.getTargetHttpsProxy() != null) { + this.targetHttpsProxy = other.targetHttpsProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetSslPolicyTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.sslPolicyReferenceResource = source.sslPolicyReferenceResource; + this.targetHttpsProxy = source.targetHttpsProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public SslPolicyReference getSslPolicyReferenceResource() { + return sslPolicyReferenceResource; + } + + public Builder setSslPolicyReferenceResource(SslPolicyReference sslPolicyReferenceResource) { + this.sslPolicyReferenceResource = sslPolicyReferenceResource; + return this; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetSslPolicyTargetHttpsProxyHttpRequest build() { + String missing = ""; + + if (targetHttpsProxy == null) { + missing += " targetHttpsProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetSslPolicyTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicyReferenceResource, + targetHttpsProxy, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSslPolicyReferenceResource(this.sslPolicyReferenceResource); + newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetSslPolicyTargetHttpsProxyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslPolicyReferenceResource=" + + sslPolicyReferenceResource + + ", " + + "targetHttpsProxy=" + + targetHttpsProxy + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetSslPolicyTargetHttpsProxyHttpRequest) { + SetSslPolicyTargetHttpsProxyHttpRequest that = (SetSslPolicyTargetHttpsProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslPolicyReferenceResource, that.getSslPolicyReferenceResource()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicyReferenceResource, + targetHttpsProxy, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java new file mode 100644 index 000000000000..b690cf4f02c0 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java @@ -0,0 +1,481 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetSslPolicyTargetSslProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final SslPolicyReference sslPolicyReferenceResource; + private final String targetSslProxy; + private final String userIp; + + private SetSslPolicyTargetSslProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.sslPolicyReferenceResource = null; + this.targetSslProxy = null; + this.userIp = null; + } + + private SetSslPolicyTargetSslProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + SslPolicyReference sslPolicyReferenceResource, + String targetSslProxy, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.sslPolicyReferenceResource = sslPolicyReferenceResource; + this.targetSslProxy = targetSslProxy; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) { + fieldMap.put( + "sslPolicyReferenceResource", + Collections.singletonList(String.valueOf(sslPolicyReferenceResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("sslPolicyReferenceResource")) { + return String.valueOf(sslPolicyReferenceResource); + } + if (fieldName.equals("targetSslProxy")) { + return String.valueOf(targetSslProxy); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public SslPolicyReference getApiMessageRequestBody() { + return sslPolicyReferenceResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public SslPolicyReference getSslPolicyReferenceResource() { + return sslPolicyReferenceResource; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetSslPolicyTargetSslProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetSslPolicyTargetSslProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetSslPolicyTargetSslProxyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetSslPolicyTargetSslProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private SslPolicyReference sslPolicyReferenceResource; + private String targetSslProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetSslPolicyTargetSslProxyHttpRequest other) { + if (other == SetSslPolicyTargetSslProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSslPolicyReferenceResource() != null) { + this.sslPolicyReferenceResource = other.sslPolicyReferenceResource; + } + if (other.getTargetSslProxy() != null) { + this.targetSslProxy = other.targetSslProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetSslPolicyTargetSslProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.sslPolicyReferenceResource = source.sslPolicyReferenceResource; + this.targetSslProxy = source.targetSslProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public SslPolicyReference getSslPolicyReferenceResource() { + return sslPolicyReferenceResource; + } + + public Builder setSslPolicyReferenceResource(SslPolicyReference sslPolicyReferenceResource) { + this.sslPolicyReferenceResource = sslPolicyReferenceResource; + return this; + } + + public String getTargetSslProxy() { + return targetSslProxy; + } + + public Builder setTargetSslProxy(String targetSslProxy) { + this.targetSslProxy = targetSslProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetSslPolicyTargetSslProxyHttpRequest build() { + String missing = ""; + + if (targetSslProxy == null) { + missing += " targetSslProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetSslPolicyTargetSslProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicyReferenceResource, + targetSslProxy, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSslPolicyReferenceResource(this.sslPolicyReferenceResource); + newBuilder.setTargetSslProxy(this.targetSslProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetSslPolicyTargetSslProxyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "sslPolicyReferenceResource=" + + sslPolicyReferenceResource + + ", " + + "targetSslProxy=" + + targetSslProxy + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetSslPolicyTargetSslProxyHttpRequest) { + SetSslPolicyTargetSslProxyHttpRequest that = (SetSslPolicyTargetSslProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sslPolicyReferenceResource, that.getSslPolicyReferenceResource()) + && Objects.equals(this.targetSslProxy, that.getTargetSslProxy()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + sslPolicyReferenceResource, + targetSslProxy, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java index 284827bbf593..dcb381e82c3c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetTagsInstanceHttpRequest() { this.userIp = null; } - private SetTagsInstanceHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetTagsInstanceHttpRequest( String quotaUser, String requestId, Tags tagsResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetTagsInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetTagsInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetTagsInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetTagsInstanceHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetTagsInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetTagsInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - tagsResource, - userIp - ); + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + tagsResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "SetTagsInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "tagsResource=" + tagsResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "tagsResource=" + + tagsResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof SetTagsInstanceHttpRequest) { SetTagsInstanceHttpRequest that = (SetTagsInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.tagsResource, that.getTagsResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.tagsResource, that.getTagsResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - tagsResource, - userIp - ); + access_token, + callback, + fields, + instance, + key, + prettyPrint, + quotaUser, + requestId, + tagsResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java index 388d7a3e2a4a..8d715bdd6461 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetTargetForwardingRuleHttpRequest() { this.userIp = null; } - private SetTargetForwardingRuleHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetTargetForwardingRuleHttpRequest( String quotaUser, String requestId, TargetReference targetReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetTargetForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetTargetForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetTargetForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetTargetForwardingRuleHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetTargetForwardingRuleHttpRequest build() { String missing = ""; - - if (forwardingRule == null) { missing += " forwardingRule"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetTargetForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - targetReferenceResource, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + targetReferenceResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "SetTargetForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRule=" + forwardingRule + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetReferenceResource=" + targetReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRule=" + + forwardingRule + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetReferenceResource=" + + targetReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof SetTargetForwardingRuleHttpRequest) { SetTargetForwardingRuleHttpRequest that = (SetTargetForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - targetReferenceResource, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + targetReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java index fc410a2e4b6a..5d90c0309c54 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetTargetGlobalForwardingRuleHttpRequest() { this.userIp = null; } - private SetTargetGlobalForwardingRuleHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetTargetGlobalForwardingRuleHttpRequest( String quotaUser, String requestId, TargetReference targetReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put("targetReferenceResource", Collections.singletonList(String.valueOf(targetReferenceResource))); + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetTargetGlobalForwardingRuleHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetTargetGlobalForwardingRuleHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetTargetGlobalForwardingRuleHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetTargetGlobalForwardingRuleHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetTargetGlobalForwardingRuleHttpRequest build() { String missing = ""; - - if (forwardingRule == null) { missing += " forwardingRule"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetTargetGlobalForwardingRuleHttpRequest( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - targetReferenceResource, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + targetReferenceResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "SetTargetGlobalForwardingRuleHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "forwardingRule=" + forwardingRule + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetReferenceResource=" + targetReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "forwardingRule=" + + forwardingRule + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetReferenceResource=" + + targetReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof SetTargetGlobalForwardingRuleHttpRequest) { SetTargetGlobalForwardingRuleHttpRequest that = (SetTargetGlobalForwardingRuleHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.forwardingRule, that.getForwardingRule()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forwardingRule, that.getForwardingRule()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetReferenceResource, that.getTargetReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - forwardingRule, - key, - prettyPrint, - quotaUser, - requestId, - targetReferenceResource, - userIp - ); + access_token, + callback, + fields, + forwardingRule, + key, + prettyPrint, + quotaUser, + requestId, + targetReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java index ace005f07516..b41902cfd6ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,7 +33,8 @@ public final class SetTargetPoolsInstanceGroupManagerHttpRequest implements ApiM private final String callback; private final String fields; private final String instanceGroupManager; - private final InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource; + private final InstanceGroupManagersSetTargetPoolsRequest + instanceGroupManagersSetTargetPoolsRequestResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -56,7 +54,6 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest() { this.userIp = null; } - private SetTargetPoolsInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -67,13 +64,13 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instanceGroupManager = instanceGroupManager; - this.instanceGroupManagersSetTargetPoolsRequestResource = instanceGroupManagersSetTargetPoolsRequestResource; + this.instanceGroupManagersSetTargetPoolsRequestResource = + instanceGroupManagersSetTargetPoolsRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -94,10 +91,15 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } - if (fieldNames.contains("instanceGroupManagersSetTargetPoolsRequestResource") && instanceGroupManagersSetTargetPoolsRequestResource != null) { - fieldMap.put("instanceGroupManagersSetTargetPoolsRequestResource", Collections.singletonList(String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource))); + if (fieldNames.contains("instanceGroupManagersSetTargetPoolsRequestResource") + && instanceGroupManagersSetTargetPoolsRequestResource != null) { + fieldMap.put( + "instanceGroupManagersSetTargetPoolsRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -174,7 +176,8 @@ public String getInstanceGroupManager() { return instanceGroupManager; } - public InstanceGroupManagersSetTargetPoolsRequest getInstanceGroupManagersSetTargetPoolsRequestResource() { + public InstanceGroupManagersSetTargetPoolsRequest + getInstanceGroupManagersSetTargetPoolsRequestResource() { return instanceGroupManagersSetTargetPoolsRequestResource; } @@ -198,22 +201,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetTargetPoolsInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetTargetPoolsInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetTargetPoolsInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetTargetPoolsInstanceGroupManagerHttpRequest(); } @@ -223,7 +228,8 @@ public static class Builder { private String callback; private String fields; private String instanceGroupManager; - private InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource; + private InstanceGroupManagersSetTargetPoolsRequest + instanceGroupManagersSetTargetPoolsRequestResource; private String key; private String prettyPrint; private String quotaUser; @@ -247,7 +253,8 @@ public Builder mergeFrom(SetTargetPoolsInstanceGroupManagerHttpRequest other) { this.instanceGroupManager = other.instanceGroupManager; } if (other.getInstanceGroupManagersSetTargetPoolsRequestResource() != null) { - this.instanceGroupManagersSetTargetPoolsRequestResource = other.instanceGroupManagersSetTargetPoolsRequestResource; + this.instanceGroupManagersSetTargetPoolsRequestResource = + other.instanceGroupManagersSetTargetPoolsRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +279,8 @@ public Builder mergeFrom(SetTargetPoolsInstanceGroupManagerHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instanceGroupManager = source.instanceGroupManager; - this.instanceGroupManagersSetTargetPoolsRequestResource = source.instanceGroupManagersSetTargetPoolsRequestResource; + this.instanceGroupManagersSetTargetPoolsRequestResource = + source.instanceGroupManagersSetTargetPoolsRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -316,12 +324,16 @@ public Builder setInstanceGroupManager(String instanceGroupManager) { return this; } - public InstanceGroupManagersSetTargetPoolsRequest getInstanceGroupManagersSetTargetPoolsRequestResource() { + public InstanceGroupManagersSetTargetPoolsRequest + getInstanceGroupManagersSetTargetPoolsRequestResource() { return instanceGroupManagersSetTargetPoolsRequestResource; } - public Builder setInstanceGroupManagersSetTargetPoolsRequestResource(InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { - this.instanceGroupManagersSetTargetPoolsRequestResource = instanceGroupManagersSetTargetPoolsRequestResource; + public Builder setInstanceGroupManagersSetTargetPoolsRequestResource( + InstanceGroupManagersSetTargetPoolsRequest + instanceGroupManagersSetTargetPoolsRequestResource) { + this.instanceGroupManagersSetTargetPoolsRequestResource = + instanceGroupManagersSetTargetPoolsRequestResource; return this; } @@ -370,36 +382,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetTargetPoolsInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetTargetPoolsInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersSetTargetPoolsRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetTargetPoolsRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +411,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstanceGroupManager(this.instanceGroupManager); - newBuilder.setInstanceGroupManagersSetTargetPoolsRequestResource(this.instanceGroupManagersSetTargetPoolsRequestResource); + newBuilder.setInstanceGroupManagersSetTargetPoolsRequestResource( + this.instanceGroupManagersSetTargetPoolsRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +425,35 @@ public Builder clone() { @Override public String toString() { return "SetTargetPoolsInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "instanceGroupManagersSetTargetPoolsRequestResource=" + instanceGroupManagersSetTargetPoolsRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagersSetTargetPoolsRequestResource=" + + instanceGroupManagersSetTargetPoolsRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +463,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetTargetPoolsInstanceGroupManagerHttpRequest) { - SetTargetPoolsInstanceGroupManagerHttpRequest that = (SetTargetPoolsInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.instanceGroupManagersSetTargetPoolsRequestResource, that.getInstanceGroupManagersSetTargetPoolsRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetTargetPoolsInstanceGroupManagerHttpRequest that = + (SetTargetPoolsInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagersSetTargetPoolsRequestResource, + that.getInstanceGroupManagersSetTargetPoolsRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +484,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - instanceGroupManagersSetTargetPoolsRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + instanceGroupManagersSetTargetPoolsRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java index c2afba50ab7a..d1f6bd78f19b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,7 +36,8 @@ public final class SetTargetPoolsRegionInstanceGroupManagerHttpRequest implement private final String key; private final String prettyPrint; private final String quotaUser; - private final RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource; + private final RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource; private final String requestId; private final String userIp; @@ -56,7 +54,6 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest() { this.userIp = null; } - private SetTargetPoolsRegionInstanceGroupManagerHttpRequest( String access_token, String callback, @@ -65,10 +62,10 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest( String key, String prettyPrint, String quotaUser, - RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, + RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -76,7 +73,8 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest( this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; - this.regionInstanceGroupManagersSetTargetPoolsRequestResource = regionInstanceGroupManagersSetTargetPoolsRequestResource; + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = + regionInstanceGroupManagersSetTargetPoolsRequestResource; this.requestId = requestId; this.userIp = userIp; } @@ -94,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put("instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -105,8 +104,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("quotaUser") && quotaUser != null) { fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); } - if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource") && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) { - fieldMap.put("regionInstanceGroupManagersSetTargetPoolsRequestResource", Collections.singletonList(String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource))); + if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource") + && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersSetTargetPoolsRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource))); } if (fieldNames.contains("requestId") && requestId != null) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); @@ -186,7 +189,8 @@ public String getQuotaUser() { return quotaUser; } - public RegionInstanceGroupManagersSetTargetPoolsRequest getRegionInstanceGroupManagersSetTargetPoolsRequestResource() { + public RegionInstanceGroupManagersSetTargetPoolsRequest + getRegionInstanceGroupManagersSetTargetPoolsRequestResource() { return regionInstanceGroupManagersSetTargetPoolsRequestResource; } @@ -198,22 +202,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetTargetPoolsRegionInstanceGroupManagerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetTargetPoolsRegionInstanceGroupManagerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetTargetPoolsRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetTargetPoolsRegionInstanceGroupManagerHttpRequest(); } @@ -226,14 +232,16 @@ public static class Builder { private String key; private String prettyPrint; private String quotaUser; - private RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource; + private RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource; private String requestId; private String userIp; Builder() {} public Builder mergeFrom(SetTargetPoolsRegionInstanceGroupManagerHttpRequest other) { - if (other == SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) return this; + if (other == SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + return this; if (other.getAccessToken() != null) { this.access_token = other.access_token; } @@ -256,7 +264,8 @@ public Builder mergeFrom(SetTargetPoolsRegionInstanceGroupManagerHttpRequest oth this.quotaUser = other.quotaUser; } if (other.getRegionInstanceGroupManagersSetTargetPoolsRequestResource() != null) { - this.regionInstanceGroupManagersSetTargetPoolsRequestResource = other.regionInstanceGroupManagersSetTargetPoolsRequestResource; + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = + other.regionInstanceGroupManagersSetTargetPoolsRequestResource; } if (other.getRequestId() != null) { this.requestId = other.requestId; @@ -275,7 +284,8 @@ public Builder mergeFrom(SetTargetPoolsRegionInstanceGroupManagerHttpRequest oth this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; - this.regionInstanceGroupManagersSetTargetPoolsRequestResource = source.regionInstanceGroupManagersSetTargetPoolsRequestResource; + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = + source.regionInstanceGroupManagersSetTargetPoolsRequestResource; this.requestId = source.requestId; this.userIp = source.userIp; } @@ -343,12 +353,16 @@ public Builder setQuotaUser(String quotaUser) { return this; } - public RegionInstanceGroupManagersSetTargetPoolsRequest getRegionInstanceGroupManagersSetTargetPoolsRequestResource() { + public RegionInstanceGroupManagersSetTargetPoolsRequest + getRegionInstanceGroupManagersSetTargetPoolsRequestResource() { return regionInstanceGroupManagersSetTargetPoolsRequestResource; } - public Builder setRegionInstanceGroupManagersSetTargetPoolsRequestResource(RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { - this.regionInstanceGroupManagersSetTargetPoolsRequestResource = regionInstanceGroupManagersSetTargetPoolsRequestResource; + public Builder setRegionInstanceGroupManagersSetTargetPoolsRequestResource( + RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource) { + this.regionInstanceGroupManagersSetTargetPoolsRequestResource = + regionInstanceGroupManagersSetTargetPoolsRequestResource; return this; } @@ -370,36 +384,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetTargetPoolsRegionInstanceGroupManagerHttpRequest build() { String missing = ""; - - if (instanceGroupManager == null) { missing += " instanceGroupManager"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetTargetPoolsRegionInstanceGroupManagerHttpRequest( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersSetTargetPoolsRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTargetPoolsRequestResource, + requestId, + userIp); } public Builder clone() { @@ -411,7 +416,8 @@ public Builder clone() { newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); - newBuilder.setRegionInstanceGroupManagersSetTargetPoolsRequestResource(this.regionInstanceGroupManagersSetTargetPoolsRequestResource); + newBuilder.setRegionInstanceGroupManagersSetTargetPoolsRequestResource( + this.regionInstanceGroupManagersSetTargetPoolsRequestResource); newBuilder.setRequestId(this.requestId); newBuilder.setUserIp(this.userIp); return newBuilder; @@ -421,16 +427,35 @@ public Builder clone() { @Override public String toString() { return "SetTargetPoolsRegionInstanceGroupManagerHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instanceGroupManager=" + instanceGroupManager + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "regionInstanceGroupManagersSetTargetPoolsRequestResource=" + regionInstanceGroupManagersSetTargetPoolsRequestResource + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionInstanceGroupManagersSetTargetPoolsRequestResource=" + + regionInstanceGroupManagersSetTargetPoolsRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +465,20 @@ public boolean equals(Object o) { return true; } if (o instanceof SetTargetPoolsRegionInstanceGroupManagerHttpRequest) { - SetTargetPoolsRegionInstanceGroupManagerHttpRequest that = (SetTargetPoolsRegionInstanceGroupManagerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.regionInstanceGroupManagersSetTargetPoolsRequestResource, that.getRegionInstanceGroupManagersSetTargetPoolsRequestResource()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + SetTargetPoolsRegionInstanceGroupManagerHttpRequest that = + (SetTargetPoolsRegionInstanceGroupManagerHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionInstanceGroupManagersSetTargetPoolsRequestResource, + that.getRegionInstanceGroupManagersSetTargetPoolsRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +486,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instanceGroupManager, - key, - prettyPrint, - quotaUser, - regionInstanceGroupManagersSetTargetPoolsRequestResource, - requestId, - userIp - ); + access_token, + callback, + fields, + instanceGroupManager, + key, + prettyPrint, + quotaUser, + regionInstanceGroupManagersSetTargetPoolsRequestResource, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java index 74f41fa04713..cb03dc8c68b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetUrlMapTargetHttpProxyHttpRequest() { this.userIp = null; } - private SetUrlMapTargetHttpProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetUrlMapTargetHttpProxyHttpRequest( String requestId, String targetHttpProxy, UrlMapReference urlMapReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); } if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { - fieldMap.put("urlMapReferenceResource", Collections.singletonList(String.valueOf(urlMapReferenceResource))); + fieldMap.put( + "urlMapReferenceResource", + Collections.singletonList(String.valueOf(urlMapReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetUrlMapTargetHttpProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetUrlMapTargetHttpProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetUrlMapTargetHttpProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetUrlMapTargetHttpProxyHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetUrlMapTargetHttpProxyHttpRequest build() { String missing = ""; - - - - - - if (targetHttpProxy == null) { missing += " targetHttpProxy"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetUrlMapTargetHttpProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpProxy, - urlMapReferenceResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpProxy, + urlMapReferenceResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "SetUrlMapTargetHttpProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpProxy=" + targetHttpProxy + ", " - + "urlMapReferenceResource=" + urlMapReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpProxy=" + + targetHttpProxy + + ", " + + "urlMapReferenceResource=" + + urlMapReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof SetUrlMapTargetHttpProxyHttpRequest) { SetUrlMapTargetHttpProxyHttpRequest that = (SetUrlMapTargetHttpProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) && - Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetHttpProxy, that.getTargetHttpProxy()) + && Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpProxy, - urlMapReferenceResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpProxy, + urlMapReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java index 08537d9c18e4..00ee948a619b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetUrlMapTargetHttpsProxyHttpRequest() { this.userIp = null; } - private SetUrlMapTargetHttpsProxyHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetUrlMapTargetHttpsProxyHttpRequest( String requestId, String targetHttpsProxy, UrlMapReference urlMapReferenceResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); } if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { - fieldMap.put("urlMapReferenceResource", Collections.singletonList(String.valueOf(urlMapReferenceResource))); + fieldMap.put( + "urlMapReferenceResource", + Collections.singletonList(String.valueOf(urlMapReferenceResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetUrlMapTargetHttpsProxyHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetUrlMapTargetHttpsProxyHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetUrlMapTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetUrlMapTargetHttpsProxyHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetUrlMapTargetHttpsProxyHttpRequest build() { String missing = ""; - - - - - - if (targetHttpsProxy == null) { missing += " targetHttpsProxy"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetUrlMapTargetHttpsProxyHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpsProxy, - urlMapReferenceResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxy, + urlMapReferenceResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "SetUrlMapTargetHttpsProxyHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "targetHttpsProxy=" + targetHttpsProxy + ", " - + "urlMapReferenceResource=" + urlMapReferenceResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpsProxy=" + + targetHttpsProxy + + ", " + + "urlMapReferenceResource=" + + urlMapReferenceResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof SetUrlMapTargetHttpsProxyHttpRequest) { SetUrlMapTargetHttpsProxyHttpRequest that = (SetUrlMapTargetHttpsProxyHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) && - Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + && Objects.equals(this.urlMapReferenceResource, that.getUrlMapReferenceResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - targetHttpsProxy, - urlMapReferenceResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxy, + urlMapReferenceResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java index b92a227709be..914272f15daa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private SetUsageExportBucketProjectHttpRequest() { this.userIp = null; } - private SetUsageExportBucketProjectHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private SetUsageExportBucketProjectHttpRequest( String quotaUser, String requestId, UsageExportLocation usageExportLocationResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -109,7 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); } if (fieldNames.contains("usageExportLocationResource") && usageExportLocationResource != null) { - fieldMap.put("usageExportLocationResource", Collections.singletonList(String.valueOf(usageExportLocationResource))); + fieldMap.put( + "usageExportLocationResource", + Collections.singletonList(String.valueOf(usageExportLocationResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SetUsageExportBucketProjectHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SetUsageExportBucketProjectHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SetUsageExportBucketProjectHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SetUsageExportBucketProjectHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public SetUsageExportBucketProjectHttpRequest build() { String missing = ""; - - - - if (project == null) { missing += " project"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SetUsageExportBucketProjectHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - usageExportLocationResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + usageExportLocationResource, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "SetUsageExportBucketProjectHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "project=" + project + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "usageExportLocationResource=" + usageExportLocationResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "usageExportLocationResource=" + + usageExportLocationResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof SetUsageExportBucketProjectHttpRequest) { SetUsageExportBucketProjectHttpRequest that = (SetUsageExportBucketProjectHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.usageExportLocationResource, that.getUsageExportLocationResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.usageExportLocationResource, that.getUsageExportLocationResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - project, - quotaUser, - requestId, - usageExportLocationResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + project, + quotaUser, + requestId, + usageExportLocationResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java index 1c75c47d8bae..67ac4ed48159 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -39,6 +38,7 @@ public final class Snapshot implements ApiMessage { private final String kind; private final String labelFingerprint; private final Map labels; + private final List licenseCodes; private final List licenses; private final String name; private final String selfLink; @@ -58,6 +58,7 @@ private Snapshot() { this.kind = null; this.labelFingerprint = null; this.labels = null; + this.licenseCodes = null; this.licenses = null; this.name = null; this.selfLink = null; @@ -70,7 +71,6 @@ private Snapshot() { this.storageBytesStatus = null; } - private Snapshot( String creationTimestamp, String description, @@ -79,6 +79,7 @@ private Snapshot( String kind, String labelFingerprint, Map labels, + List licenseCodes, List licenses, String name, String selfLink, @@ -88,8 +89,7 @@ private Snapshot( String sourceDiskId, String status, String storageBytes, - String storageBytesStatus - ) { + String storageBytesStatus) { this.creationTimestamp = creationTimestamp; this.description = description; this.diskSizeGb = diskSizeGb; @@ -97,6 +97,7 @@ private Snapshot( this.kind = kind; this.labelFingerprint = labelFingerprint; this.labels = labels; + this.licenseCodes = licenseCodes; this.licenses = licenses; this.name = name; this.selfLink = selfLink; @@ -113,7 +114,8 @@ private Snapshot( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -133,6 +135,13 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("labels") && labels != null) { fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); } + if (fieldNames.contains("licenseCodes") && licenseCodes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenseCodes) { + stringList.add(item.toString()); + } + fieldMap.put("licenseCodes", stringList.build()); + } if (fieldNames.contains("licenses") && licenses != null) { ImmutableList.Builder stringList = ImmutableList.builder(); for (String item : licenses) { @@ -147,13 +156,17 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } if (fieldNames.contains("snapshotEncryptionKey") && snapshotEncryptionKey != null) { - fieldMap.put("snapshotEncryptionKey", Collections.singletonList(String.valueOf(snapshotEncryptionKey))); + fieldMap.put( + "snapshotEncryptionKey", + Collections.singletonList(String.valueOf(snapshotEncryptionKey))); } if (fieldNames.contains("sourceDisk") && sourceDisk != null) { fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); } if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { - fieldMap.put("sourceDiskEncryptionKey", Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); + fieldMap.put( + "sourceDiskEncryptionKey", + Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); } if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); @@ -165,7 +178,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("storageBytes", Collections.singletonList(String.valueOf(storageBytes))); } if (fieldNames.contains("storageBytesStatus") && storageBytesStatus != null) { - fieldMap.put("storageBytesStatus", Collections.singletonList(String.valueOf(storageBytesStatus))); + fieldMap.put( + "storageBytesStatus", Collections.singletonList(String.valueOf(storageBytesStatus))); } return fieldMap; } @@ -193,6 +207,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("labels")) { return String.valueOf(labels); } + if (fieldName.equals("licenseCodes")) { + return String.valueOf(licenseCodes); + } if (fieldName.equals("licenses")) { return String.valueOf(licenses); } @@ -260,6 +277,10 @@ public Map getLabelsMap() { return labels; } + public List getLicenseCodesList() { + return licenseCodes; + } + public List getLicensesList() { return licenses; } @@ -300,22 +321,24 @@ public String getStorageBytesStatus() { return storageBytesStatus; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Snapshot prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Snapshot getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Snapshot DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Snapshot(); } @@ -328,6 +351,7 @@ public static class Builder { private String kind; private String labelFingerprint; private Map labels; + private List licenseCodes; private List licenses; private String name; private String selfLink; @@ -364,6 +388,9 @@ public Builder mergeFrom(Snapshot other) { if (other.getLabelsMap() != null) { this.labels = other.labels; } + if (other.getLicenseCodesList() != null) { + this.licenseCodes = other.licenseCodes; + } if (other.getLicensesList() != null) { this.licenses = other.licenses; } @@ -405,6 +432,7 @@ public Builder mergeFrom(Snapshot other) { this.kind = source.kind; this.labelFingerprint = source.labelFingerprint; this.labels = source.labels; + this.licenseCodes = source.licenseCodes; this.licenses = source.licenses; this.name = source.name; this.selfLink = source.selfLink; @@ -480,6 +508,23 @@ public Builder putAllLabels(Map labels) { return this; } + public List getLicenseCodesList() { + return licenseCodes; + } + + public Builder addAllLicenseCodes(List licenseCodes) { + if (this.licenseCodes == null) { + this.licenseCodes = new ArrayList<>(licenseCodes.size()); + } + this.licenseCodes.addAll(licenseCodes); + return this; + } + + public Builder addLicenseCodes(String licenseCodes) { + this.licenseCodes.add(licenseCodes); + return this; + } + public List getLicensesList() { return licenses; } @@ -578,43 +623,27 @@ public Builder setStorageBytesStatus(String storageBytesStatus) { return this; } - public Snapshot build() { - - - - - - - - - - - - - - - return new Snapshot( - creationTimestamp, - description, - diskSizeGb, - id, - kind, - labelFingerprint, - labels, - licenses, - name, - selfLink, - snapshotEncryptionKey, - sourceDisk, - sourceDiskEncryptionKey, - sourceDiskId, - status, - storageBytes, - storageBytesStatus - ); + creationTimestamp, + description, + diskSizeGb, + id, + kind, + labelFingerprint, + labels, + licenseCodes, + licenses, + name, + selfLink, + snapshotEncryptionKey, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + status, + storageBytes, + storageBytesStatus); } public Builder clone() { @@ -626,6 +655,7 @@ public Builder clone() { newBuilder.setKind(this.kind); newBuilder.setLabelFingerprint(this.labelFingerprint); newBuilder.putAllLabels(this.labels); + newBuilder.addAllLicenseCodes(this.licenseCodes); newBuilder.addAllLicenses(this.licenses); newBuilder.setName(this.name); newBuilder.setSelfLink(this.selfLink); @@ -643,23 +673,59 @@ public Builder clone() { @Override public String toString() { return "Snapshot{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "diskSizeGb=" + diskSizeGb + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + ", " - + "licenses=" + licenses + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + ", " - + "snapshotEncryptionKey=" + snapshotEncryptionKey + ", " - + "sourceDisk=" + sourceDisk + ", " - + "sourceDiskEncryptionKey=" + sourceDiskEncryptionKey + ", " - + "sourceDiskId=" + sourceDiskId + ", " - + "status=" + status + ", " - + "storageBytes=" + storageBytes + ", " - + "storageBytesStatus=" + storageBytesStatus + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "diskSizeGb=" + + diskSizeGb + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + + ", " + + "licenseCodes=" + + licenseCodes + + ", " + + "licenses=" + + licenses + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "snapshotEncryptionKey=" + + snapshotEncryptionKey + + ", " + + "sourceDisk=" + + sourceDisk + + ", " + + "sourceDiskEncryptionKey=" + + sourceDiskEncryptionKey + + ", " + + "sourceDiskId=" + + sourceDiskId + + ", " + + "status=" + + status + + ", " + + "storageBytes=" + + storageBytes + + ", " + + "storageBytesStatus=" + + storageBytesStatus + "}"; } @@ -670,25 +736,24 @@ public boolean equals(Object o) { } if (o instanceof Snapshot) { Snapshot that = (Snapshot) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) && - Objects.equals(this.licenses, that.getLicensesList()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.snapshotEncryptionKey, that.getSnapshotEncryptionKey()) && - Objects.equals(this.sourceDisk, that.getSourceDisk()) && - Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) && - Objects.equals(this.sourceDiskId, that.getSourceDiskId()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.storageBytes, that.getStorageBytes()) && - Objects.equals(this.storageBytesStatus, that.getStorageBytesStatus()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.diskSizeGb, that.getDiskSizeGb()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()) + && Objects.equals(this.licenseCodes, that.getLicenseCodesList()) + && Objects.equals(this.licenses, that.getLicensesList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.snapshotEncryptionKey, that.getSnapshotEncryptionKey()) + && Objects.equals(this.sourceDisk, that.getSourceDisk()) + && Objects.equals(this.sourceDiskEncryptionKey, that.getSourceDiskEncryptionKey()) + && Objects.equals(this.sourceDiskId, that.getSourceDiskId()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.storageBytes, that.getStorageBytes()) + && Objects.equals(this.storageBytesStatus, that.getStorageBytesStatus()); } return false; } @@ -696,23 +761,23 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - diskSizeGb, - id, - kind, - labelFingerprint, - labels, - licenses, - name, - selfLink, - snapshotEncryptionKey, - sourceDisk, - sourceDiskEncryptionKey, - sourceDiskId, - status, - storageBytes, - storageBytesStatus - ); + creationTimestamp, + description, + diskSizeGb, + id, + kind, + labelFingerprint, + labels, + licenseCodes, + licenses, + name, + selfLink, + snapshotEncryptionKey, + sourceDisk, + sourceDiskEncryptionKey, + sourceDiskId, + status, + storageBytes, + storageBytesStatus); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java index e3405523c02a..29b3506b2a6c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.SnapshotStub; import com.google.cloud.compute.v1.stub.SnapshotStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,39 @@ * * try (SnapshotClient snapshotClient = SnapshotClient.create()) { * String requestId = ""; - * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + * ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); * Operation response = snapshotClient.deleteSnapshot(requestId, snapshot); * } * *

* - *

Note: close() needs to be called on the snapshotClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the snapshotClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of SnapshotSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of SnapshotSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class SnapshotClient implements BackgroundResource {
   private final SnapshotSettings settings;
   private final SnapshotStub stub;
 
-
-
-  /**
-   * Constructs an instance of SnapshotClient with default settings.
-   */
+  /** Constructs an instance of SnapshotClient with default settings. */
   public static final SnapshotClient create() throws IOException {
     return create(SnapshotSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of SnapshotClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of SnapshotClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final SnapshotClient create(SnapshotSettings settings) throws IOException {
     return new SnapshotClient(settings);
@@ -144,9 +128,8 @@ public static final SnapshotClient create(SnapshotStub stub) {
   }
 
   /**
-   * Constructs an instance of SnapshotClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of SnapshotClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected SnapshotClient(SnapshotSettings settings) throws IOException {
     this.settings = settings;
@@ -168,61 +151,76 @@ public SnapshotStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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 snaphots.
+   * 

For more information, see Deleting snaphots. + * + *

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param snapshot Name of the Snapshot resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSnapshot(String requestId, ProjectSnapshotName snapshot) { + public final Operation deleteSnapshot(String requestId, ProjectGlobalSnapshotName snapshot) { DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder() - .setRequestId(requestId) - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); + .setRequestId(requestId) + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); return deleteSnapshot(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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 snaphots. * - * For more information, see Deleting snaphots. + *

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param snapshot Name of the Snapshot resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -231,23 +229,27 @@ public final Operation deleteSnapshot(String requestId, String snapshot) { DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder() - .setRequestId(requestId) - .setSnapshot(snapshot) - .build(); + .setRequestId(requestId) + .setSnapshot(snapshot) + .build(); return deleteSnapshot(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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 snaphots. * - * For more information, see Deleting snaphots. + *

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
@@ -266,15 +268,19 @@ public final Operation deleteSnapshot(DeleteSnapshotHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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 snaphots.
+   * 

For more information, see Deleting snaphots. + * + *

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   String requestId = "";
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
@@ -292,12 +298,14 @@ public final UnaryCallable deleteSnapshotC
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request.
+   * Returns the specified Snapshot resource. Get a list of available snapshots by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Snapshot response = snapshotClient.getSnapshot(snapshot);
    * }
    * 
@@ -306,23 +314,25 @@ public final UnaryCallable deleteSnapshotC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Snapshot getSnapshot(ProjectSnapshotName snapshot) { + public final Snapshot getSnapshot(ProjectGlobalSnapshotName snapshot) { GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); return getSnapshot(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. + * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   Snapshot response = snapshotClient.getSnapshot(snapshot.toString());
    * }
    * 
@@ -334,20 +344,20 @@ public final Snapshot getSnapshot(ProjectSnapshotName snapshot) { public final Snapshot getSnapshot(String snapshot) { GetSnapshotHttpRequest request = - GetSnapshotHttpRequest.newBuilder() - .setSnapshot(snapshot) - .build(); + GetSnapshotHttpRequest.newBuilder().setSnapshot(snapshot).build(); return getSnapshot(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. + * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder()
    *     .setSnapshot(snapshot.toString())
    *     .build();
@@ -365,12 +375,14 @@ public final Snapshot getSnapshot(GetSnapshotHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request.
+   * Returns the specified Snapshot resource. Get a list of available snapshots by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder()
    *     .setSnapshot(snapshot.toString())
    *     .build();
@@ -389,7 +401,8 @@ public final UnaryCallable getSnapshotCallable
   /**
    * Retrieves the list of Snapshot resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -406,8 +419,8 @@ public final UnaryCallable getSnapshotCallable
   public final ListSnapshotsPagedResponse listSnapshots(ProjectName project) {
     ListSnapshotsHttpRequest request =
         ListSnapshotsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listSnapshots(request);
   }
 
@@ -415,7 +428,8 @@ public final ListSnapshotsPagedResponse listSnapshots(ProjectName project) {
   /**
    * Retrieves the list of Snapshot resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -431,9 +445,7 @@ public final ListSnapshotsPagedResponse listSnapshots(ProjectName project) {
   @BetaApi
   public final ListSnapshotsPagedResponse listSnapshots(String project) {
     ListSnapshotsHttpRequest request =
-        ListSnapshotsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListSnapshotsHttpRequest.newBuilder().setProject(project).build();
     return listSnapshots(request);
   }
 
@@ -441,7 +453,8 @@ public final ListSnapshotsPagedResponse listSnapshots(String project) {
   /**
    * Retrieves the list of Snapshot resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -459,15 +472,15 @@ public final ListSnapshotsPagedResponse listSnapshots(String project) {
    */
   @BetaApi
   public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsHttpRequest request) {
-    return listSnapshotsPagedCallable()
-        .call(request);
+    return listSnapshotsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of Snapshot resources contained within the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -483,7 +496,8 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsHttpRequest r
    * 
*/ @BetaApi - public final UnaryCallable listSnapshotsPagedCallable() { + public final UnaryCallable + listSnapshotsPagedCallable() { return stub.listSnapshotsPagedCallable(); } @@ -491,7 +505,8 @@ public final UnaryCallable /** * Retrieves the list of Snapshot resources contained within the specified project. * - * Sample code: + *

Sample code: + * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -520,12 +535,14 @@ public final UnaryCallable listSnapshots
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = snapshotClient.setLabelsSnapshot(resource, globalSetLabelsRequestResource);
    * }
@@ -536,24 +553,28 @@ public final UnaryCallable listSnapshots
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setLabelsSnapshot(ProjectSnapshotName resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) {
+  public final Operation setLabelsSnapshot(
+      ProjectGlobalSnapshotResourceName resource,
+      GlobalSetLabelsRequest globalSetLabelsRequestResource) {
 
     SetLabelsSnapshotHttpRequest request =
         SetLabelsSnapshotHttpRequest.newBuilder()
-        .setResource(resource == null ? null : resource.toString())
-        .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
-        .build();
+            .setResource(resource == null ? null : resource.toString())
+            .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+            .build();
     return setLabelsSnapshot(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   Operation response = snapshotClient.setLabelsSnapshot(resource.toString(), globalSetLabelsRequestResource);
    * }
@@ -564,24 +585,27 @@ public final Operation setLabelsSnapshot(ProjectSnapshotName resource, GlobalSet
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setLabelsSnapshot(String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) {
+  public final Operation setLabelsSnapshot(
+      String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource) {
 
     SetLabelsSnapshotHttpRequest request =
         SetLabelsSnapshotHttpRequest.newBuilder()
-        .setResource(resource)
-        .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
-        .build();
+            .setResource(resource)
+            .setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
+            .build();
     return setLabelsSnapshot(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsSnapshotHttpRequest request = SetLabelsSnapshotHttpRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -601,12 +625,14 @@ public final Operation setLabelsSnapshot(SetLabelsSnapshotHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
+   * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources
+   * documentation.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
    *   GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
    *   SetLabelsSnapshotHttpRequest request = SetLabelsSnapshotHttpRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -624,7 +650,7 @@ public final UnaryCallable setLabelsSna
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -653,12 +679,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListSnapshotsPagedResponse extends AbstractPagedListResponse<
-      ListSnapshotsHttpRequest,
-      SnapshotList,
-      Snapshot,
-      ListSnapshotsPage,
-      ListSnapshotsFixedSizeCollection> {
+  public static class ListSnapshotsPagedResponse
+      extends AbstractPagedListResponse<
+          ListSnapshotsHttpRequest, SnapshotList, Snapshot, ListSnapshotsPage,
+          ListSnapshotsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -678,15 +702,10 @@ public ListSnapshotsPagedResponse apply(ListSnapshotsPage input) {
     private ListSnapshotsPagedResponse(ListSnapshotsPage page) {
       super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListSnapshotsPage extends AbstractPage<
-      ListSnapshotsHttpRequest,
-      SnapshotList,
-      Snapshot,
-      ListSnapshotsPage> {
+  public static class ListSnapshotsPage
+      extends AbstractPage {
 
     private ListSnapshotsPage(
         PageContext context,
@@ -711,18 +730,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListSnapshotsFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListSnapshotsHttpRequest,
-      SnapshotList,
-      Snapshot,
-      ListSnapshotsPage,
-      ListSnapshotsFixedSizeCollection> {
+  public static class ListSnapshotsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListSnapshotsHttpRequest, SnapshotList, Snapshot, ListSnapshotsPage,
+          ListSnapshotsFixedSizeCollection> {
 
     private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -737,7 +750,5 @@ protected ListSnapshotsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListSnapshotsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java
index 1ee03fc40f73..198c12f23451 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private SnapshotList() {
     this.warning = null;
   }
 
-
   private SnapshotList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(SnapshotList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static SnapshotList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final SnapshotList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new SnapshotList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public SnapshotList build() {
 
-
-
-
-
-      return new SnapshotList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new SnapshotList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "SnapshotList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof SnapshotList) {
       SnapshotList that = (SnapshotList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java
index f3722e9df2cf..0859dae4568c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java
@@ -15,45 +15,23 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse;
 import com.google.cloud.compute.v1.stub.SnapshotStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -62,15 +40,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSnapshot to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSnapshot to 30 seconds: * *

  * 
@@ -85,77 +63,58 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SnapshotSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteSnapshot.
-   */
+  /** Returns the object with the settings used for calls to deleteSnapshot. */
   public UnaryCallSettings deleteSnapshotSettings() {
     return ((SnapshotStubSettings) getStubSettings()).deleteSnapshotSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSnapshot.
-   */
+  /** Returns the object with the settings used for calls to getSnapshot. */
   public UnaryCallSettings getSnapshotSettings() {
     return ((SnapshotStubSettings) getStubSettings()).getSnapshotSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSnapshots.
-   */
-  public PagedCallSettings listSnapshotsSettings() {
+  /** Returns the object with the settings used for calls to listSnapshots. */
+  public PagedCallSettings
+      listSnapshotsSettings() {
     return ((SnapshotStubSettings) getStubSettings()).listSnapshotsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsSnapshot.
-   */
+  /** Returns the object with the settings used for calls to setLabelsSnapshot. */
   public UnaryCallSettings setLabelsSnapshotSettings() {
     return ((SnapshotStubSettings) getStubSettings()).setLabelsSnapshotSettings();
   }
 
-
   public static final SnapshotSettings create(SnapshotStubSettings stub) throws IOException {
     return new SnapshotSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return SnapshotStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return SnapshotStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return SnapshotStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return SnapshotStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return SnapshotStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return SnapshotStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return SnapshotStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -168,23 +127,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return SnapshotStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -193,9 +146,7 @@ protected SnapshotSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for SnapshotSettings.
-   */
+  /** Builder for SnapshotSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -217,46 +168,44 @@ protected Builder(SnapshotStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public SnapshotStubSettings.Builder getStubSettingsBuilder() {
       return ((SnapshotStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteSnapshot. - */ - public UnaryCallSettings.Builder deleteSnapshotSettings() { + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder + deleteSnapshotSettings() { return getStubSettingsBuilder().deleteSnapshotSettings(); } - /** - * Returns the builder for the settings used for calls to getSnapshot. - */ + /** Returns the builder for the settings used for calls to getSnapshot. */ public UnaryCallSettings.Builder getSnapshotSettings() { return getStubSettingsBuilder().getSnapshotSettings(); } - /** - * Returns the builder for the settings used for calls to listSnapshots. - */ - public PagedCallSettings.Builder listSnapshotsSettings() { + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> + listSnapshotsSettings() { return getStubSettingsBuilder().listSnapshotsSettings(); } - /** - * Returns the builder for the settings used for calls to setLabelsSnapshot. - */ - public UnaryCallSettings.Builder setLabelsSnapshotSettings() { + /** Returns the builder for the settings used for calls to setLabelsSnapshot. */ + public UnaryCallSettings.Builder + setLabelsSnapshotSettings() { return getStubSettingsBuilder().setLabelsSnapshotSettings(); } @@ -265,4 +214,4 @@ public SnapshotSettings build() throws IOException { return new SnapshotSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java index 522c372b8492..ddd5a6eb3410 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private SslCertificate() { this.selfLink = null; } - private SslCertificate( String certificate, String creationTimestamp, @@ -61,8 +57,7 @@ private SslCertificate( String kind, String name, String privateKey, - String selfLink - ) { + String selfLink) { this.certificate = certificate; this.creationTimestamp = creationTimestamp; this.description = description; @@ -80,7 +75,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("certificate", Collections.singletonList(String.valueOf(certificate))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -170,22 +166,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SslCertificate prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SslCertificate getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SslCertificate DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SslCertificate(); } @@ -314,25 +312,10 @@ public Builder setSelfLink(String selfLink) { return this; } - public SslCertificate build() { - - - - - - return new SslCertificate( - certificate, - creationTimestamp, - description, - id, - kind, - name, - privateKey, - selfLink - ); + certificate, creationTimestamp, description, id, kind, name, privateKey, selfLink); } public Builder clone() { @@ -352,14 +335,29 @@ public Builder clone() { @Override public String toString() { return "SslCertificate{" - + "certificate=" + certificate + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "privateKey=" + privateKey + ", " - + "selfLink=" + selfLink + + "certificate=" + + certificate + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "privateKey=" + + privateKey + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -370,16 +368,14 @@ public boolean equals(Object o) { } if (o instanceof SslCertificate) { SslCertificate that = (SslCertificate) o; - return - Objects.equals(this.certificate, that.getCertificate()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.privateKey, that.getPrivateKey()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.certificate, that.getCertificate()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.privateKey, that.getPrivateKey()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @@ -387,14 +383,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - certificate, - creationTimestamp, - description, - id, - kind, - name, - privateKey, - selfLink - ); + certificate, creationTimestamp, description, id, kind, name, privateKey, selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java index 9bfe0ce06f2a..0b7752be6927 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.SslCertificateStub; import com.google.cloud.compute.v1.stub.SslCertificateStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,7 +42,7 @@ *

  * 
  * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
- *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+ *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
  *   String requestId = "";
  *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
  * }
@@ -60,33 +50,32 @@
  * 
* *

Note: close() needs to be called on the sslCertificateClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of SslCertificateSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class SslCertificateClient implements BackgroundResource {
   private final SslCertificateSettings settings;
   private final SslCertificateStub stub;
 
-
-
-  /**
-   * Constructs an instance of SslCertificateClient with default settings.
-   */
+  /** Constructs an instance of SslCertificateClient with default settings. */
   public static final SslCertificateClient create() throws IOException {
     return create(SslCertificateSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of SslCertificateClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of SslCertificateClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final SslCertificateClient create(SslCertificateSettings settings) throws IOException {
+  public static final SslCertificateClient create(SslCertificateSettings settings)
+      throws IOException {
     return new SslCertificateClient(settings);
   }
 
   /**
-   * Constructs an instance of SslCertificateClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use SslCertificateSettings}.
+   * Constructs an instance of SslCertificateClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use SslCertificateSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final SslCertificateClient create(SslCertificateStub stub) {
@@ -144,9 +129,9 @@ public static final SslCertificateClient create(SslCertificateStub stub) {
   }
 
   /**
-   * Constructs an instance of SslCertificateClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of SslCertificateClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected SslCertificateClient(SslCertificateSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +153,41 @@ public SslCertificateStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified SslCertificate resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
    * }
    * 
* * @param sslCertificate Name of the SslCertificate resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslCertificate(ProjectSslCertificateName sslCertificate, String requestId) { + public final Operation deleteSslCertificate( + ProjectGlobalSslCertificateName sslCertificate, String requestId) { DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder() - .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) - .setRequestId(requestId) - .build(); + .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) + .setRequestId(requestId) + .build(); return deleteSslCertificate(request); } @@ -205,21 +195,26 @@ public final Operation deleteSslCertificate(ProjectSslCertificateName sslCertifi /** * Deletes the specified SslCertificate resource. * - * Sample code: + *

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString(), requestId);
    * }
    * 
* * @param sslCertificate Name of the SslCertificate resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +222,9 @@ public final Operation deleteSslCertificate(String sslCertificate, String reques DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder() - .setSslCertificate(sslCertificate) - .setRequestId(requestId) - .build(); + .setSslCertificate(sslCertificate) + .setRequestId(requestId) + .build(); return deleteSslCertificate(request); } @@ -237,10 +232,11 @@ public final Operation deleteSslCertificate(String sslCertificate, String reques /** * Deletes the specified SslCertificate resource. * - * Sample code: + *

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
@@ -262,10 +258,11 @@ public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest requ
   /**
    * Deletes the specified SslCertificate resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
@@ -278,18 +275,21 @@ public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable deleteSslCertificateCallable() { + public final UnaryCallable + deleteSslCertificateCallable() { return stub.deleteSslCertificateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate);
    * }
    * 
@@ -298,23 +298,25 @@ public final UnaryCallable deleteSsl * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final SslCertificate getSslCertificate(ProjectSslCertificateName sslCertificate) { + public final SslCertificate getSslCertificate(ProjectGlobalSslCertificateName sslCertificate) { GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder() - .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) - .build(); + .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) + .build(); return getSslCertificate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   SslCertificate response = sslCertificateClient.getSslCertificate(sslCertificate.toString());
    * }
    * 
@@ -326,20 +328,20 @@ public final SslCertificate getSslCertificate(ProjectSslCertificateName sslCerti public final SslCertificate getSslCertificate(String sslCertificate) { GetSslCertificateHttpRequest request = - GetSslCertificateHttpRequest.newBuilder() - .setSslCertificate(sslCertificate) - .build(); + GetSslCertificateHttpRequest.newBuilder().setSslCertificate(sslCertificate).build(); return getSslCertificate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. + * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
    *     .build();
@@ -357,12 +359,14 @@ public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request.
+   * Returns the specified SslCertificate resource. Get a list of available SSL certificates by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+   *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
    *   GetSslCertificateHttpRequest request = GetSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
    *     .build();
@@ -373,15 +377,18 @@ public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getSslCertificateCallable() { + public final UnaryCallable + getSslCertificateCallable() { return stub.getSslCertificateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a SslCertificate resource in the specified project using the data included in the request. + * Creates a SslCertificate resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   String requestId = "";
@@ -391,32 +398,41 @@ public final UnaryCallable getSslC
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) + * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to + * upload an SSL key and certificate to the load balancer to serve secure connections from the + * user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSslCertificate(String requestId, ProjectName project, SslCertificate sslCertificateResource) { + public final Operation insertSslCertificate( + String requestId, ProjectName project, SslCertificate sslCertificateResource) { InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setSslCertificateResource(sslCertificateResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setSslCertificateResource(sslCertificateResource) + .build(); return insertSslCertificate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a SslCertificate resource in the specified project using the data included in the request. + * Creates a SslCertificate resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   String requestId = "";
@@ -426,32 +442,41 @@ public final Operation insertSslCertificate(String requestId, ProjectName projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) + * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to + * upload an SSL key and certificate to the load balancer to serve secure connections from the + * user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSslCertificate(String requestId, String project, SslCertificate sslCertificateResource) { + public final Operation insertSslCertificate( + String requestId, String project, SslCertificate sslCertificateResource) { InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setSslCertificateResource(sslCertificateResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setSslCertificateResource(sslCertificateResource) + .build(); return insertSslCertificate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a SslCertificate resource in the specified project using the data included in the request. + * Creates a SslCertificate resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   String requestId = "";
@@ -476,9 +501,11 @@ public final Operation insertSslCertificate(InsertSslCertificateHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a SslCertificate resource in the specified project using the data included in the request.
+   * Creates a SslCertificate resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   String requestId = "";
@@ -496,7 +523,8 @@ public final Operation insertSslCertificate(InsertSslCertificateHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable insertSslCertificateCallable() { + public final UnaryCallable + insertSslCertificateCallable() { return stub.insertSslCertificateCallable(); } @@ -504,7 +532,8 @@ public final UnaryCallable insertSsl /** * Retrieves the list of SslCertificate resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +550,8 @@ public final UnaryCallable insertSsl
   public final ListSslCertificatesPagedResponse listSslCertificates(ProjectName project) {
     ListSslCertificatesHttpRequest request =
         ListSslCertificatesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listSslCertificates(request);
   }
 
@@ -530,7 +559,8 @@ public final ListSslCertificatesPagedResponse listSslCertificates(ProjectName pr
   /**
    * Retrieves the list of SslCertificate resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +576,7 @@ public final ListSslCertificatesPagedResponse listSslCertificates(ProjectName pr
   @BetaApi
   public final ListSslCertificatesPagedResponse listSslCertificates(String project) {
     ListSslCertificatesHttpRequest request =
-        ListSslCertificatesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListSslCertificatesHttpRequest.newBuilder().setProject(project).build();
     return listSslCertificates(request);
   }
 
@@ -556,7 +584,8 @@ public final ListSslCertificatesPagedResponse listSslCertificates(String project
   /**
    * Retrieves the list of SslCertificate resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +602,17 @@ public final ListSslCertificatesPagedResponse listSslCertificates(String project
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListSslCertificatesPagedResponse listSslCertificates(ListSslCertificatesHttpRequest request) {
-    return listSslCertificatesPagedCallable()
-        .call(request);
+  public final ListSslCertificatesPagedResponse listSslCertificates(
+      ListSslCertificatesHttpRequest request) {
+    return listSslCertificatesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of SslCertificate resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +628,8 @@ public final ListSslCertificatesPagedResponse listSslCertificates(ListSslCertifi
    * 
*/ @BetaApi - public final UnaryCallable listSslCertificatesPagedCallable() { + public final UnaryCallable + listSslCertificatesPagedCallable() { return stub.listSslCertificatesPagedCallable(); } @@ -606,7 +637,8 @@ public final UnaryCallableSample code: + * *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,12 +661,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listSslCertificatesCallable() { + public final UnaryCallable + listSslCertificatesCallable() { return stub.listSslCertificatesCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -663,12 +696,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListSslCertificatesPagedResponse extends AbstractPagedListResponse< - ListSslCertificatesHttpRequest, - SslCertificateList, - SslCertificate, - ListSslCertificatesPage, - ListSslCertificatesFixedSizeCollection> { + public static class ListSslCertificatesPagedResponse + extends AbstractPagedListResponse< + ListSslCertificatesHttpRequest, SslCertificateList, SslCertificate, + ListSslCertificatesPage, ListSslCertificatesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -688,15 +719,12 @@ public ListSslCertificatesPagedResponse apply(ListSslCertificatesPage input) { private ListSslCertificatesPagedResponse(ListSslCertificatesPage page) { super(page, ListSslCertificatesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListSslCertificatesPage extends AbstractPage< - ListSslCertificatesHttpRequest, - SslCertificateList, - SslCertificate, - ListSslCertificatesPage> { + public static class ListSslCertificatesPage + extends AbstractPage< + ListSslCertificatesHttpRequest, SslCertificateList, SslCertificate, + ListSslCertificatesPage> { private ListSslCertificatesPage( PageContext context, @@ -721,20 +749,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListSslCertificatesFixedSizeCollection extends AbstractFixedSizeCollection< - ListSslCertificatesHttpRequest, - SslCertificateList, - SslCertificate, - ListSslCertificatesPage, - ListSslCertificatesFixedSizeCollection> { + public static class ListSslCertificatesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSslCertificatesHttpRequest, SslCertificateList, SslCertificate, + ListSslCertificatesPage, ListSslCertificatesFixedSizeCollection> { - private ListSslCertificatesFixedSizeCollection(List pages, int collectionSize) { + private ListSslCertificatesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -747,7 +770,5 @@ protected ListSslCertificatesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListSslCertificatesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java index 6a7bde97b7df..cbb9a020d13c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private SslCertificateList() { this.warning = null; } - private SslCertificateList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SslCertificateList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SslCertificateList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SslCertificateList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SslCertificateList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public SslCertificateList build() { - - - - - return new SslCertificateList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new SslCertificateList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "SslCertificateList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof SslCertificateList) { SslCertificateList that = (SslCertificateList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java index 0c6e60bab287..f2f11ac490f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; import com.google.cloud.compute.v1.stub.SslCertificateStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSslCertificate to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSslCertificate to 30 seconds: * *

  * 
@@ -85,77 +63,63 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SslCertificateSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteSslCertificate.
-   */
-  public UnaryCallSettings deleteSslCertificateSettings() {
+  /** Returns the object with the settings used for calls to deleteSslCertificate. */
+  public UnaryCallSettings
+      deleteSslCertificateSettings() {
     return ((SslCertificateStubSettings) getStubSettings()).deleteSslCertificateSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSslCertificate.
-   */
-  public UnaryCallSettings getSslCertificateSettings() {
+  /** Returns the object with the settings used for calls to getSslCertificate. */
+  public UnaryCallSettings
+      getSslCertificateSettings() {
     return ((SslCertificateStubSettings) getStubSettings()).getSslCertificateSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertSslCertificate.
-   */
-  public UnaryCallSettings insertSslCertificateSettings() {
+  /** Returns the object with the settings used for calls to insertSslCertificate. */
+  public UnaryCallSettings
+      insertSslCertificateSettings() {
     return ((SslCertificateStubSettings) getStubSettings()).insertSslCertificateSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSslCertificates.
-   */
-  public PagedCallSettings listSslCertificatesSettings() {
+  /** Returns the object with the settings used for calls to listSslCertificates. */
+  public PagedCallSettings<
+          ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse>
+      listSslCertificatesSettings() {
     return ((SslCertificateStubSettings) getStubSettings()).listSslCertificatesSettings();
   }
 
-
-  public static final SslCertificateSettings create(SslCertificateStubSettings stub) throws IOException {
+  public static final SslCertificateSettings create(SslCertificateStubSettings stub)
+      throws IOException {
     return new SslCertificateSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return SslCertificateStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return SslCertificateStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return SslCertificateStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return SslCertificateStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return SslCertificateStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return SslCertificateStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return SslCertificateStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -168,23 +132,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return SslCertificateStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -193,9 +151,7 @@ protected SslCertificateSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for SslCertificateSettings.
-   */
+  /** Builder for SslCertificateSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -217,46 +173,45 @@ protected Builder(SslCertificateStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public SslCertificateStubSettings.Builder getStubSettingsBuilder() {
       return ((SslCertificateStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteSslCertificate. - */ - public UnaryCallSettings.Builder deleteSslCertificateSettings() { + /** Returns the builder for the settings used for calls to deleteSslCertificate. */ + public UnaryCallSettings.Builder + deleteSslCertificateSettings() { return getStubSettingsBuilder().deleteSslCertificateSettings(); } - /** - * Returns the builder for the settings used for calls to getSslCertificate. - */ - public UnaryCallSettings.Builder getSslCertificateSettings() { + /** Returns the builder for the settings used for calls to getSslCertificate. */ + public UnaryCallSettings.Builder + getSslCertificateSettings() { return getStubSettingsBuilder().getSslCertificateSettings(); } - /** - * Returns the builder for the settings used for calls to insertSslCertificate. - */ - public UnaryCallSettings.Builder insertSslCertificateSettings() { + /** Returns the builder for the settings used for calls to insertSslCertificate. */ + public UnaryCallSettings.Builder + insertSslCertificateSettings() { return getStubSettingsBuilder().insertSslCertificateSettings(); } - /** - * Returns the builder for the settings used for calls to listSslCertificates. - */ - public PagedCallSettings.Builder listSslCertificatesSettings() { + /** Returns the builder for the settings used for calls to listSslCertificates. */ + public PagedCallSettings.Builder< + ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse> + listSslCertificatesSettings() { return getStubSettingsBuilder().listSslCertificatesSettings(); } @@ -265,4 +220,4 @@ public SslCertificateSettings build() throws IOException { return new SslCertificateSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java new file mode 100644 index 000000000000..1f42eb277e9b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java @@ -0,0 +1,333 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SslPoliciesList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private SslPoliciesList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private SslPoliciesList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (SslPolicy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SslPoliciesList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SslPoliciesList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SslPoliciesList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SslPoliciesList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(SslPoliciesList other) { + if (other == SslPoliciesList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(SslPoliciesList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(SslPolicy items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public SslPoliciesList build() { + + return new SslPoliciesList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "SslPoliciesList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslPoliciesList) { + SslPoliciesList that = (SslPoliciesList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java new file mode 100644 index 000000000000..58ef5f0038a9 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SslPoliciesListAvailableFeaturesResponse implements ApiMessage { + private final List features; + + private SslPoliciesListAvailableFeaturesResponse() { + this.features = null; + } + + private SslPoliciesListAvailableFeaturesResponse(List features) { + this.features = features; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("features") && features != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : features) { + stringList.add(item.toString()); + } + fieldMap.put("features", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("features")) { + return String.valueOf(features); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getFeaturesList() { + return features; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SslPoliciesListAvailableFeaturesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SslPoliciesListAvailableFeaturesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SslPoliciesListAvailableFeaturesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SslPoliciesListAvailableFeaturesResponse(); + } + + public static class Builder { + private List features; + + Builder() {} + + public Builder mergeFrom(SslPoliciesListAvailableFeaturesResponse other) { + if (other == SslPoliciesListAvailableFeaturesResponse.getDefaultInstance()) return this; + if (other.getFeaturesList() != null) { + this.features = other.features; + } + return this; + } + + Builder(SslPoliciesListAvailableFeaturesResponse source) { + this.features = source.features; + } + + public List getFeaturesList() { + return features; + } + + public Builder addAllFeatures(List features) { + if (this.features == null) { + this.features = new ArrayList<>(features.size()); + } + this.features.addAll(features); + return this; + } + + public Builder addFeatures(String features) { + this.features.add(features); + return this; + } + + public SslPoliciesListAvailableFeaturesResponse build() { + return new SslPoliciesListAvailableFeaturesResponse(features); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllFeatures(this.features); + return newBuilder; + } + } + + @Override + public String toString() { + return "SslPoliciesListAvailableFeaturesResponse{" + "features=" + features + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslPoliciesListAvailableFeaturesResponse) { + SslPoliciesListAvailableFeaturesResponse that = (SslPoliciesListAvailableFeaturesResponse) o; + return Objects.equals(this.features, that.getFeaturesList()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(features); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java new file mode 100644 index 000000000000..d002cc4c701f --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java @@ -0,0 +1,580 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SslPolicy implements ApiMessage { + private final String creationTimestamp; + private final List customFeatures; + private final String description; + private final List enabledFeatures; + private final String fingerprint; + private final String id; + private final String kind; + private final String minTlsVersion; + private final String name; + private final String profile; + private final String selfLink; + private final List warnings; + + private SslPolicy() { + this.creationTimestamp = null; + this.customFeatures = null; + this.description = null; + this.enabledFeatures = null; + this.fingerprint = null; + this.id = null; + this.kind = null; + this.minTlsVersion = null; + this.name = null; + this.profile = null; + this.selfLink = null; + this.warnings = null; + } + + private SslPolicy( + String creationTimestamp, + List customFeatures, + String description, + List enabledFeatures, + String fingerprint, + String id, + String kind, + String minTlsVersion, + String name, + String profile, + String selfLink, + List warnings) { + this.creationTimestamp = creationTimestamp; + this.customFeatures = customFeatures; + this.description = description; + this.enabledFeatures = enabledFeatures; + this.fingerprint = fingerprint; + this.id = id; + this.kind = kind; + this.minTlsVersion = minTlsVersion; + this.name = name; + this.profile = profile; + this.selfLink = selfLink; + this.warnings = warnings; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("customFeatures") && customFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : customFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("customFeatures", stringList.build()); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : enabledFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("enabledFeatures", stringList.build()); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("minTlsVersion") && minTlsVersion != null) { + fieldMap.put("minTlsVersion", Collections.singletonList(String.valueOf(minTlsVersion))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("profile") && profile != null) { + fieldMap.put("profile", Collections.singletonList(String.valueOf(profile))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warnings") && warnings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Warnings item : warnings) { + stringList.add(item.toString()); + } + fieldMap.put("warnings", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("customFeatures")) { + return String.valueOf(customFeatures); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("enabledFeatures")) { + return String.valueOf(enabledFeatures); + } + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("minTlsVersion")) { + return String.valueOf(minTlsVersion); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("profile")) { + return String.valueOf(profile); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warnings")) { + return String.valueOf(warnings); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public List getCustomFeaturesList() { + return customFeatures; + } + + public String getDescription() { + return description; + } + + public List getEnabledFeaturesList() { + return enabledFeatures; + } + + public String getFingerprint() { + return fingerprint; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getMinTlsVersion() { + return minTlsVersion; + } + + public String getName() { + return name; + } + + public String getProfile() { + return profile; + } + + public String getSelfLink() { + return selfLink; + } + + public List getWarningsList() { + return warnings; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SslPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SslPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SslPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SslPolicy(); + } + + public static class Builder { + private String creationTimestamp; + private List customFeatures; + private String description; + private List enabledFeatures; + private String fingerprint; + private String id; + private String kind; + private String minTlsVersion; + private String name; + private String profile; + private String selfLink; + private List warnings; + + Builder() {} + + public Builder mergeFrom(SslPolicy other) { + if (other == SslPolicy.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getCustomFeaturesList() != null) { + this.customFeatures = other.customFeatures; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getEnabledFeaturesList() != null) { + this.enabledFeatures = other.enabledFeatures; + } + if (other.getFingerprint() != null) { + this.fingerprint = other.fingerprint; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getMinTlsVersion() != null) { + this.minTlsVersion = other.minTlsVersion; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getProfile() != null) { + this.profile = other.profile; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarningsList() != null) { + this.warnings = other.warnings; + } + return this; + } + + Builder(SslPolicy source) { + this.creationTimestamp = source.creationTimestamp; + this.customFeatures = source.customFeatures; + this.description = source.description; + this.enabledFeatures = source.enabledFeatures; + this.fingerprint = source.fingerprint; + this.id = source.id; + this.kind = source.kind; + this.minTlsVersion = source.minTlsVersion; + this.name = source.name; + this.profile = source.profile; + this.selfLink = source.selfLink; + this.warnings = source.warnings; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public List getCustomFeaturesList() { + return customFeatures; + } + + public Builder addAllCustomFeatures(List customFeatures) { + if (this.customFeatures == null) { + this.customFeatures = new ArrayList<>(customFeatures.size()); + } + this.customFeatures.addAll(customFeatures); + return this; + } + + public Builder addCustomFeatures(String customFeatures) { + this.customFeatures.add(customFeatures); + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public List getEnabledFeaturesList() { + return enabledFeatures; + } + + public Builder addAllEnabledFeatures(List enabledFeatures) { + if (this.enabledFeatures == null) { + this.enabledFeatures = new ArrayList<>(enabledFeatures.size()); + } + this.enabledFeatures.addAll(enabledFeatures); + return this; + } + + public Builder addEnabledFeatures(String enabledFeatures) { + this.enabledFeatures.add(enabledFeatures); + return this; + } + + public String getFingerprint() { + return fingerprint; + } + + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getMinTlsVersion() { + return minTlsVersion; + } + + public Builder setMinTlsVersion(String minTlsVersion) { + this.minTlsVersion = minTlsVersion; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getProfile() { + return profile; + } + + public Builder setProfile(String profile) { + this.profile = profile; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public List getWarningsList() { + return warnings; + } + + public Builder addAllWarnings(List warnings) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(warnings.size()); + } + this.warnings.addAll(warnings); + return this; + } + + public Builder addWarnings(Warnings warnings) { + this.warnings.add(warnings); + return this; + } + + public SslPolicy build() { + + return new SslPolicy( + creationTimestamp, + customFeatures, + description, + enabledFeatures, + fingerprint, + id, + kind, + minTlsVersion, + name, + profile, + selfLink, + warnings); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.addAllCustomFeatures(this.customFeatures); + newBuilder.setDescription(this.description); + newBuilder.addAllEnabledFeatures(this.enabledFeatures); + newBuilder.setFingerprint(this.fingerprint); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setMinTlsVersion(this.minTlsVersion); + newBuilder.setName(this.name); + newBuilder.setProfile(this.profile); + newBuilder.setSelfLink(this.selfLink); + newBuilder.addAllWarnings(this.warnings); + return newBuilder; + } + } + + @Override + public String toString() { + return "SslPolicy{" + + "creationTimestamp=" + + creationTimestamp + + ", " + + "customFeatures=" + + customFeatures + + ", " + + "description=" + + description + + ", " + + "enabledFeatures=" + + enabledFeatures + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "minTlsVersion=" + + minTlsVersion + + ", " + + "name=" + + name + + ", " + + "profile=" + + profile + + ", " + + "selfLink=" + + selfLink + + ", " + + "warnings=" + + warnings + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslPolicy) { + SslPolicy that = (SslPolicy) o; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.customFeatures, that.getCustomFeaturesList()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.enabledFeatures, that.getEnabledFeaturesList()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.minTlsVersion, that.getMinTlsVersion()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.profile, that.getProfile()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warnings, that.getWarningsList()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + customFeatures, + description, + enabledFeatures, + fingerprint, + id, + kind, + minTlsVersion, + name, + profile, + selfLink, + warnings); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java new file mode 100644 index 000000000000..e421111351dd --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.SslPolicyStub; +import com.google.cloud.compute.v1.stub.SslPolicyStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+ *   String requestId = "";
+ *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+ *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the sslPolicyClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SslPolicySettings to create(). + * For example: + * + *

To customize credentials: + * + *

+ * 
+ * SslPolicySettings sslPolicySettings =
+ *     SslPolicySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SslPolicyClient sslPolicyClient =
+ *     SslPolicyClient.create(sslPolicySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SslPolicySettings sslPolicySettings =
+ *     SslPolicySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SslPolicyClient sslPolicyClient =
+ *     SslPolicyClient.create(sslPolicySettings);
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SslPolicyClient implements BackgroundResource { + private final SslPolicySettings settings; + private final SslPolicyStub stub; + + /** Constructs an instance of SslPolicyClient with default settings. */ + public static final SslPolicyClient create() throws IOException { + return create(SslPolicySettings.newBuilder().build()); + } + + /** + * Constructs an instance of SslPolicyClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SslPolicyClient create(SslPolicySettings settings) throws IOException { + return new SslPolicyClient(settings); + } + + /** + * Constructs an instance of SslPolicyClient, using the given stub for making calls. This is for + * advanced usage - prefer to use SslPolicySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SslPolicyClient create(SslPolicyStub stub) { + return new SslPolicyClient(stub); + } + + /** + * Constructs an instance of SslPolicyClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected SslPolicyClient(SslPolicySettings settings) throws IOException { + this.settings = settings; + this.stub = ((SslPolicyStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SslPolicyClient(SslPolicyStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SslPolicySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SslPolicyStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and + * comply with RFC1035. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSslPolicy(String requestId, ProjectGlobalSslPolicyName sslPolicy) { + + DeleteSslPolicyHttpRequest request = + DeleteSslPolicyHttpRequest.newBuilder() + .setRequestId(requestId) + .setSslPolicy(sslPolicy == null ? null : sslPolicy.toString()) + .build(); + return deleteSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy.toString());
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and + * comply with RFC1035. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSslPolicy(String requestId, String sslPolicy) { + + DeleteSslPolicyHttpRequest request = + DeleteSslPolicyHttpRequest.newBuilder() + .setRequestId(requestId) + .setSslPolicy(sslPolicy) + .build(); + return deleteSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   DeleteSslPolicyHttpRequest request = DeleteSslPolicyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSslPolicy(sslPolicy.toString())
+   *     .build();
+   *   Operation response = sslPolicyClient.deleteSslPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSslPolicy(DeleteSslPolicyHttpRequest request) { + return deleteSslPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   DeleteSslPolicyHttpRequest request = DeleteSslPolicyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSslPolicy(sslPolicy.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = sslPolicyClient.deleteSslPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteSslPolicyCallable() { + return stub.deleteSslPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all of the ordered rules present in a single specified policy. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   SslPolicy response = sslPolicyClient.getSslPolicy(sslPolicy);
+   * }
+   * 
+ * + * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and + * comply with RFC1035. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslPolicy getSslPolicy(ProjectGlobalSslPolicyName sslPolicy) { + + GetSslPolicyHttpRequest request = + GetSslPolicyHttpRequest.newBuilder() + .setSslPolicy(sslPolicy == null ? null : sslPolicy.toString()) + .build(); + return getSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all of the ordered rules present in a single specified policy. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   SslPolicy response = sslPolicyClient.getSslPolicy(sslPolicy.toString());
+   * }
+   * 
+ * + * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and + * comply with RFC1035. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslPolicy getSslPolicy(String sslPolicy) { + + GetSslPolicyHttpRequest request = + GetSslPolicyHttpRequest.newBuilder().setSslPolicy(sslPolicy).build(); + return getSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all of the ordered rules present in a single specified policy. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   GetSslPolicyHttpRequest request = GetSslPolicyHttpRequest.newBuilder()
+   *     .setSslPolicy(sslPolicy.toString())
+   *     .build();
+   *   SslPolicy response = sslPolicyClient.getSslPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslPolicy getSslPolicy(GetSslPolicyHttpRequest request) { + return getSslPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all of the ordered rules present in a single specified policy. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   GetSslPolicyHttpRequest request = GetSslPolicyHttpRequest.newBuilder()
+   *     .setSslPolicy(sslPolicy.toString())
+   *     .build();
+   *   ApiFuture<SslPolicy> future = sslPolicyClient.getSslPolicyCallable().futureCall(request);
+   *   // Do something
+   *   SslPolicy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getSslPolicyCallable() { + return stub.getSslPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * list() request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   Operation response = sslPolicyClient.insertSslPolicy(requestId, project, sslPolicyResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This + * can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between + * clients and the HTTPS or SSL proxy load balancer. They do not affect the connection between + * the load balancers and the backends. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSslPolicy( + String requestId, ProjectName project, SslPolicy sslPolicyResource) { + + InsertSslPolicyHttpRequest request = + InsertSslPolicyHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setSslPolicyResource(sslPolicyResource) + .build(); + return insertSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * list() request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   Operation response = sslPolicyClient.insertSslPolicy(requestId, project.toString(), sslPolicyResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param project Project ID for this request. + * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This + * can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between + * clients and the HTTPS or SSL proxy load balancer. They do not affect the connection between + * the load balancers and the backends. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSslPolicy( + String requestId, String project, SslPolicy sslPolicyResource) { + + InsertSslPolicyHttpRequest request = + InsertSslPolicyHttpRequest.newBuilder() + .setRequestId(requestId) + .setProject(project) + .setSslPolicyResource(sslPolicyResource) + .build(); + return insertSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * list() request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   InsertSslPolicyHttpRequest request = InsertSslPolicyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setSslPolicyResource(sslPolicyResource)
+   *     .build();
+   *   Operation response = sslPolicyClient.insertSslPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertSslPolicy(InsertSslPolicyHttpRequest request) { + return insertSslPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * list() request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   InsertSslPolicyHttpRequest request = InsertSslPolicyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setProject(project.toString())
+   *     .setSslPolicyResource(sslPolicyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = sslPolicyClient.insertSslPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertSslPolicyCallable() { + return stub.insertSslPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all the SSL policies that have been configured for the specified project. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (SslPolicy element : sslPolicyClient.listSslPolicies(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSslPoliciesPagedResponse listSslPolicies(ProjectName project) { + ListSslPoliciesHttpRequest request = + ListSslPoliciesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listSslPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all the SSL policies that have been configured for the specified project. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (SslPolicy element : sslPolicyClient.listSslPolicies(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSslPoliciesPagedResponse listSslPolicies(String project) { + ListSslPoliciesHttpRequest request = + ListSslPoliciesHttpRequest.newBuilder().setProject(project).build(); + return listSslPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all the SSL policies that have been configured for the specified project. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSslPoliciesHttpRequest request = ListSslPoliciesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (SslPolicy element : sslPolicyClient.listSslPolicies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListSslPoliciesPagedResponse listSslPolicies(ListSslPoliciesHttpRequest request) { + return listSslPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all the SSL policies that have been configured for the specified project. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSslPoliciesHttpRequest request = ListSslPoliciesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListSslPoliciesPagedResponse> future = sslPolicyClient.listSslPoliciesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (SslPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listSslPoliciesPagedCallable() { + return stub.listSslPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all the SSL policies that have been configured for the specified project. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListSslPoliciesHttpRequest request = ListSslPoliciesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     SslPoliciesList response = sslPolicyClient.listSslPoliciesCallable().call(request);
+   *     for (SslPolicy element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listSslPoliciesCallable() { + return stub.listSslPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslPoliciesListAvailableFeaturesResponse response = sslPolicyClient.listAvailableFeaturesSslPolicies(project);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslPoliciesListAvailableFeaturesResponse listAvailableFeaturesSslPolicies( + ProjectName project) { + + ListAvailableFeaturesSslPoliciesHttpRequest request = + ListAvailableFeaturesSslPoliciesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listAvailableFeaturesSslPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   SslPoliciesListAvailableFeaturesResponse response = sslPolicyClient.listAvailableFeaturesSslPolicies(project.toString());
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslPoliciesListAvailableFeaturesResponse listAvailableFeaturesSslPolicies( + String project) { + + ListAvailableFeaturesSslPoliciesHttpRequest request = + ListAvailableFeaturesSslPoliciesHttpRequest.newBuilder().setProject(project).build(); + return listAvailableFeaturesSslPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListAvailableFeaturesSslPoliciesHttpRequest request = ListAvailableFeaturesSslPoliciesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   SslPoliciesListAvailableFeaturesResponse response = sslPolicyClient.listAvailableFeaturesSslPolicies(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final SslPoliciesListAvailableFeaturesResponse listAvailableFeaturesSslPolicies( + ListAvailableFeaturesSslPoliciesHttpRequest request) { + return listAvailableFeaturesSslPoliciesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListAvailableFeaturesSslPoliciesHttpRequest request = ListAvailableFeaturesSslPoliciesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<SslPoliciesListAvailableFeaturesResponse> future = sslPolicyClient.listAvailableFeaturesSslPoliciesCallable().futureCall(request);
+   *   // Do something
+   *   SslPoliciesListAvailableFeaturesResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesCallable() { + return stub.listAvailableFeaturesSslPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified SSL policy with the data included in the request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   Operation response = sslPolicyClient.patchSslPolicy(requestId, sslPolicy, sslPolicyResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and + * comply with RFC1035. + * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This + * can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between + * clients and the HTTPS or SSL proxy load balancer. They do not affect the connection between + * the load balancers and the backends. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchSslPolicy( + String requestId, ProjectGlobalSslPolicyName sslPolicy, SslPolicy sslPolicyResource) { + + PatchSslPolicyHttpRequest request = + PatchSslPolicyHttpRequest.newBuilder() + .setRequestId(requestId) + .setSslPolicy(sslPolicy == null ? null : sslPolicy.toString()) + .setSslPolicyResource(sslPolicyResource) + .build(); + return patchSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified SSL policy with the data included in the request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   Operation response = sslPolicyClient.patchSslPolicy(requestId, sslPolicy.toString(), sslPolicyResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and + * comply with RFC1035. + * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This + * can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between + * clients and the HTTPS or SSL proxy load balancer. They do not affect the connection between + * the load balancers and the backends. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchSslPolicy( + String requestId, String sslPolicy, SslPolicy sslPolicyResource) { + + PatchSslPolicyHttpRequest request = + PatchSslPolicyHttpRequest.newBuilder() + .setRequestId(requestId) + .setSslPolicy(sslPolicy) + .setSslPolicyResource(sslPolicyResource) + .build(); + return patchSslPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified SSL policy with the data included in the request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   PatchSslPolicyHttpRequest request = PatchSslPolicyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSslPolicy(sslPolicy.toString())
+   *     .setSslPolicyResource(sslPolicyResource)
+   *     .build();
+   *   Operation response = sslPolicyClient.patchSslPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchSslPolicy(PatchSslPolicyHttpRequest request) { + return patchSslPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches the specified SSL policy with the data included in the request. + * + *

Sample code: + * + *


+   * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+   *   String requestId = "";
+   *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+   *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
+   *   PatchSslPolicyHttpRequest request = PatchSslPolicyHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSslPolicy(sslPolicy.toString())
+   *     .setSslPolicyResource(sslPolicyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = sslPolicyClient.patchSslPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable patchSslPolicyCallable() { + return stub.patchSslPolicyCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListSslPoliciesPagedResponse + extends AbstractPagedListResponse< + ListSslPoliciesHttpRequest, SslPoliciesList, SslPolicy, ListSslPoliciesPage, + ListSslPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSslPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSslPoliciesPagedResponse apply(ListSslPoliciesPage input) { + return new ListSslPoliciesPagedResponse(input); + } + }); + } + + private ListSslPoliciesPagedResponse(ListSslPoliciesPage page) { + super(page, ListSslPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSslPoliciesPage + extends AbstractPage< + ListSslPoliciesHttpRequest, SslPoliciesList, SslPolicy, ListSslPoliciesPage> { + + private ListSslPoliciesPage( + PageContext context, + SslPoliciesList response) { + super(context, response); + } + + private static ListSslPoliciesPage createEmptyPage() { + return new ListSslPoliciesPage(null, null); + } + + @Override + protected ListSslPoliciesPage createPage( + PageContext context, + SslPoliciesList response) { + return new ListSslPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSslPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSslPoliciesHttpRequest, SslPoliciesList, SslPolicy, ListSslPoliciesPage, + ListSslPoliciesFixedSizeCollection> { + + private ListSslPoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSslPoliciesFixedSizeCollection createEmptyCollection() { + return new ListSslPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListSslPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSslPoliciesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java new file mode 100644 index 000000000000..245dfab14d8b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java @@ -0,0 +1,149 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SslPolicyReference implements ApiMessage { + private final String sslPolicy; + + private SslPolicyReference() { + this.sslPolicy = null; + } + + private SslPolicyReference(String sslPolicy) { + this.sslPolicy = sslPolicy; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SslPolicyReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SslPolicyReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SslPolicyReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SslPolicyReference(); + } + + public static class Builder { + private String sslPolicy; + + Builder() {} + + public Builder mergeFrom(SslPolicyReference other) { + if (other == SslPolicyReference.getDefaultInstance()) return this; + if (other.getSslPolicy() != null) { + this.sslPolicy = other.sslPolicy; + } + return this; + } + + Builder(SslPolicyReference source) { + this.sslPolicy = source.sslPolicy; + } + + public String getSslPolicy() { + return sslPolicy; + } + + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + public SslPolicyReference build() { + return new SslPolicyReference(sslPolicy); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setSslPolicy(this.sslPolicy); + return newBuilder; + } + } + + @Override + public String toString() { + return "SslPolicyReference{" + "sslPolicy=" + sslPolicy + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SslPolicyReference) { + SslPolicyReference that = (SslPolicyReference) o; + return Objects.equals(this.sslPolicy, that.getSslPolicy()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(sslPolicy); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java new file mode 100644 index 000000000000..6bed39aa4642 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java @@ -0,0 +1,243 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.SslPolicyClient.ListSslPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.SslPolicyStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SslPolicyClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSslPolicy to 30 seconds: + * + *

+ * 
+ * SslPolicySettings.Builder sslPolicySettingsBuilder =
+ *     SslPolicySettings.newBuilder();
+ * sslPolicySettingsBuilder.deleteSslPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SslPolicySettings sslPolicySettings = sslPolicySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SslPolicySettings extends ClientSettings { + /** Returns the object with the settings used for calls to deleteSslPolicy. */ + public UnaryCallSettings deleteSslPolicySettings() { + return ((SslPolicyStubSettings) getStubSettings()).deleteSslPolicySettings(); + } + + /** Returns the object with the settings used for calls to getSslPolicy. */ + public UnaryCallSettings getSslPolicySettings() { + return ((SslPolicyStubSettings) getStubSettings()).getSslPolicySettings(); + } + + /** Returns the object with the settings used for calls to insertSslPolicy. */ + public UnaryCallSettings insertSslPolicySettings() { + return ((SslPolicyStubSettings) getStubSettings()).insertSslPolicySettings(); + } + + /** Returns the object with the settings used for calls to listSslPolicies. */ + public PagedCallSettings< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + listSslPoliciesSettings() { + return ((SslPolicyStubSettings) getStubSettings()).listSslPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to listAvailableFeaturesSslPolicies. */ + public UnaryCallSettings< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesSettings() { + return ((SslPolicyStubSettings) getStubSettings()).listAvailableFeaturesSslPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to patchSslPolicy. */ + public UnaryCallSettings patchSslPolicySettings() { + return ((SslPolicyStubSettings) getStubSettings()).patchSslPolicySettings(); + } + + public static final SslPolicySettings create(SslPolicyStubSettings stub) throws IOException { + return new SslPolicySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SslPolicyStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SslPolicyStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return SslPolicyStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SslPolicyStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SslPolicyStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SslPolicyStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SslPolicyStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SslPolicyStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SslPolicySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SslPolicySettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SslPolicyStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SslPolicyStubSettings.newBuilder()); + } + + protected Builder(SslPolicySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SslPolicyStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public SslPolicyStubSettings.Builder getStubSettingsBuilder() { + return ((SslPolicyStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to deleteSslPolicy. */ + public UnaryCallSettings.Builder + deleteSslPolicySettings() { + return getStubSettingsBuilder().deleteSslPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getSslPolicy. */ + public UnaryCallSettings.Builder getSslPolicySettings() { + return getStubSettingsBuilder().getSslPolicySettings(); + } + + /** Returns the builder for the settings used for calls to insertSslPolicy. */ + public UnaryCallSettings.Builder + insertSslPolicySettings() { + return getStubSettingsBuilder().insertSslPolicySettings(); + } + + /** Returns the builder for the settings used for calls to listSslPolicies. */ + public PagedCallSettings.Builder< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + listSslPoliciesSettings() { + return getStubSettingsBuilder().listSslPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to listAvailableFeaturesSslPolicies. */ + public UnaryCallSettings.Builder< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesSettings() { + return getStubSettingsBuilder().listAvailableFeaturesSslPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to patchSslPolicy. */ + public UnaryCallSettings.Builder + patchSslPolicySettings() { + return getStubSettingsBuilder().patchSslPolicySettings(); + } + + @Override + public SslPolicySettings build() throws IOException { + return new SslPolicySettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java index 6fcd514d1b54..7903c82a18c7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private StartInstanceHttpRequest() { this.userIp = null; } - private StartInstanceHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private StartInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(StartInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static StartInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final StartInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new StartInstanceHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public StartInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new StartInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "StartInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof StartInstanceHttpRequest) { StartInstanceHttpRequest that = (StartInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java index 314517246381..6f13286785a2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,7 +33,8 @@ public final class StartWithEncryptionKeyInstanceHttpRequest implements ApiMessa private final String callback; private final String fields; private final String instance; - private final InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource; + private final InstancesStartWithEncryptionKeyRequest + instancesStartWithEncryptionKeyRequestResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -56,7 +54,6 @@ private StartWithEncryptionKeyInstanceHttpRequest() { this.userIp = null; } - private StartWithEncryptionKeyInstanceHttpRequest( String access_token, String callback, @@ -67,13 +64,13 @@ private StartWithEncryptionKeyInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; this.instance = instance; - this.instancesStartWithEncryptionKeyRequestResource = instancesStartWithEncryptionKeyRequestResource; + this.instancesStartWithEncryptionKeyRequestResource = + instancesStartWithEncryptionKeyRequestResource; this.key = key; this.prettyPrint = prettyPrint; this.quotaUser = quotaUser; @@ -96,8 +93,12 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - if (fieldNames.contains("instancesStartWithEncryptionKeyRequestResource") && instancesStartWithEncryptionKeyRequestResource != null) { - fieldMap.put("instancesStartWithEncryptionKeyRequestResource", Collections.singletonList(String.valueOf(instancesStartWithEncryptionKeyRequestResource))); + if (fieldNames.contains("instancesStartWithEncryptionKeyRequestResource") + && instancesStartWithEncryptionKeyRequestResource != null) { + fieldMap.put( + "instancesStartWithEncryptionKeyRequestResource", + Collections.singletonList( + String.valueOf(instancesStartWithEncryptionKeyRequestResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -174,7 +175,8 @@ public String getInstance() { return instance; } - public InstancesStartWithEncryptionKeyRequest getInstancesStartWithEncryptionKeyRequestResource() { + public InstancesStartWithEncryptionKeyRequest + getInstancesStartWithEncryptionKeyRequestResource() { return instancesStartWithEncryptionKeyRequestResource; } @@ -198,22 +200,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(StartWithEncryptionKeyInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static StartWithEncryptionKeyInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final StartWithEncryptionKeyInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new StartWithEncryptionKeyInstanceHttpRequest(); } @@ -247,7 +251,8 @@ public Builder mergeFrom(StartWithEncryptionKeyInstanceHttpRequest other) { this.instance = other.instance; } if (other.getInstancesStartWithEncryptionKeyRequestResource() != null) { - this.instancesStartWithEncryptionKeyRequestResource = other.instancesStartWithEncryptionKeyRequestResource; + this.instancesStartWithEncryptionKeyRequestResource = + other.instancesStartWithEncryptionKeyRequestResource; } if (other.getKey() != null) { this.key = other.key; @@ -272,7 +277,8 @@ public Builder mergeFrom(StartWithEncryptionKeyInstanceHttpRequest other) { this.callback = source.callback; this.fields = source.fields; this.instance = source.instance; - this.instancesStartWithEncryptionKeyRequestResource = source.instancesStartWithEncryptionKeyRequestResource; + this.instancesStartWithEncryptionKeyRequestResource = + source.instancesStartWithEncryptionKeyRequestResource; this.key = source.key; this.prettyPrint = source.prettyPrint; this.quotaUser = source.quotaUser; @@ -316,12 +322,15 @@ public Builder setInstance(String instance) { return this; } - public InstancesStartWithEncryptionKeyRequest getInstancesStartWithEncryptionKeyRequestResource() { + public InstancesStartWithEncryptionKeyRequest + getInstancesStartWithEncryptionKeyRequestResource() { return instancesStartWithEncryptionKeyRequestResource; } - public Builder setInstancesStartWithEncryptionKeyRequestResource(InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { - this.instancesStartWithEncryptionKeyRequestResource = instancesStartWithEncryptionKeyRequestResource; + public Builder setInstancesStartWithEncryptionKeyRequestResource( + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { + this.instancesStartWithEncryptionKeyRequestResource = + instancesStartWithEncryptionKeyRequestResource; return this; } @@ -370,36 +379,27 @@ public Builder setUserIp(String userIp) { return this; } - public StartWithEncryptionKeyInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new StartWithEncryptionKeyInstanceHttpRequest( - access_token, - callback, - fields, - instance, - instancesStartWithEncryptionKeyRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesStartWithEncryptionKeyRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -408,7 +408,8 @@ public Builder clone() { newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); - newBuilder.setInstancesStartWithEncryptionKeyRequestResource(this.instancesStartWithEncryptionKeyRequestResource); + newBuilder.setInstancesStartWithEncryptionKeyRequestResource( + this.instancesStartWithEncryptionKeyRequestResource); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); newBuilder.setQuotaUser(this.quotaUser); @@ -421,16 +422,35 @@ public Builder clone() { @Override public String toString() { return "StartWithEncryptionKeyInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "instancesStartWithEncryptionKeyRequestResource=" + instancesStartWithEncryptionKeyRequestResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "instancesStartWithEncryptionKeyRequestResource=" + + instancesStartWithEncryptionKeyRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -440,19 +460,20 @@ public boolean equals(Object o) { return true; } if (o instanceof StartWithEncryptionKeyInstanceHttpRequest) { - StartWithEncryptionKeyInstanceHttpRequest that = (StartWithEncryptionKeyInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.instancesStartWithEncryptionKeyRequestResource, that.getInstancesStartWithEncryptionKeyRequestResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + StartWithEncryptionKeyInstanceHttpRequest that = + (StartWithEncryptionKeyInstanceHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals( + this.instancesStartWithEncryptionKeyRequestResource, + that.getInstancesStartWithEncryptionKeyRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +481,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - instancesStartWithEncryptionKeyRequestResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + instancesStartWithEncryptionKeyRequestResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java index a42f10345e4d..5aa9f03aee38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private StopInstanceHttpRequest() { this.userIp = null; } - private StopInstanceHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private StopInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(StopInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static StopInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final StopInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new StopInstanceHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public StopInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new StopInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "StopInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof StopInstanceHttpRequest) { StopInstanceHttpRequest that = (StopInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, instance, key, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java index eb16487c754e..b5616fa52c1a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -62,7 +61,6 @@ private Subnetwork() { this.selfLink = null; } - private Subnetwork( String creationTimestamp, String description, @@ -76,8 +74,7 @@ private Subnetwork( Boolean privateIpGoogleAccess, String region, List secondaryIpRanges, - String selfLink - ) { + String selfLink) { this.creationTimestamp = creationTimestamp; this.description = description; this.fingerprint = fingerprint; @@ -97,7 +94,8 @@ private Subnetwork( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -124,7 +122,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("network", Collections.singletonList(String.valueOf(network))); } if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { - fieldMap.put("privateIpGoogleAccess", Collections.singletonList(String.valueOf(privateIpGoogleAccess))); + fieldMap.put( + "privateIpGoogleAccess", + Collections.singletonList(String.valueOf(privateIpGoogleAccess))); } if (fieldNames.contains("region") && region != null) { fieldMap.put("region", Collections.singletonList(String.valueOf(region))); @@ -244,22 +244,24 @@ public String getSelfLink() { return selfLink; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Subnetwork prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Subnetwork getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Subnetwork DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Subnetwork(); } @@ -466,35 +468,22 @@ public Builder setSelfLink(String selfLink) { return this; } - public Subnetwork build() { - - - - - - - - - - - return new Subnetwork( - creationTimestamp, - description, - fingerprint, - gatewayAddress, - id, - ipCidrRange, - kind, - name, - network, - privateIpGoogleAccess, - region, - secondaryIpRanges, - selfLink - ); + creationTimestamp, + description, + fingerprint, + gatewayAddress, + id, + ipCidrRange, + kind, + name, + network, + privateIpGoogleAccess, + region, + secondaryIpRanges, + selfLink); } public Builder clone() { @@ -519,19 +508,44 @@ public Builder clone() { @Override public String toString() { return "Subnetwork{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "fingerprint=" + fingerprint + ", " - + "gatewayAddress=" + gatewayAddress + ", " - + "id=" + id + ", " - + "ipCidrRange=" + ipCidrRange + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "privateIpGoogleAccess=" + privateIpGoogleAccess + ", " - + "region=" + region + ", " - + "secondaryIpRanges=" + secondaryIpRanges + ", " - + "selfLink=" + selfLink + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "gatewayAddress=" + + gatewayAddress + + ", " + + "id=" + + id + + ", " + + "ipCidrRange=" + + ipCidrRange + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "privateIpGoogleAccess=" + + privateIpGoogleAccess + + ", " + + "region=" + + region + + ", " + + "secondaryIpRanges=" + + secondaryIpRanges + + ", " + + "selfLink=" + + selfLink + "}"; } @@ -542,21 +556,19 @@ public boolean equals(Object o) { } if (o instanceof Subnetwork) { Subnetwork that = (Subnetwork) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.gatewayAddress, that.getGatewayAddress()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.ipCidrRange, that.getIpCidrRange()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.privateIpGoogleAccess, that.getPrivateIpGoogleAccess()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.secondaryIpRanges, that.getSecondaryIpRangesList()) && - Objects.equals(this.selfLink, that.getSelfLink()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.gatewayAddress, that.getGatewayAddress()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.ipCidrRange, that.getIpCidrRange()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.privateIpGoogleAccess, that.getPrivateIpGoogleAccess()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.secondaryIpRanges, that.getSecondaryIpRangesList()) + && Objects.equals(this.selfLink, that.getSelfLink()); } return false; } @@ -564,19 +576,18 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - fingerprint, - gatewayAddress, - id, - ipCidrRange, - kind, - name, - network, - privateIpGoogleAccess, - region, - secondaryIpRanges, - selfLink - ); + creationTimestamp, + description, + fingerprint, + gatewayAddress, + id, + ipCidrRange, + kind, + name, + network, + privateIpGoogleAccess, + region, + secondaryIpRanges, + selfLink); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java index 4a6d2931192b..947025080ea9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private SubnetworkAggregatedList() { this.warning = null; } - private SubnetworkAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SubnetworkAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SubnetworkAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SubnetworkAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SubnetworkAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public SubnetworkAggregatedList build() { - - - - - return new SubnetworkAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new SubnetworkAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "SubnetworkAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof SubnetworkAggregatedList) { SubnetworkAggregatedList that = (SubnetworkAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java index 451b648e67f4..21e89fa0e673 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.SubnetworkStub; import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,33 @@ * *

* - *

Note: close() needs to be called on the subnetworkClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the subnetworkClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of SubnetworkSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class SubnetworkClient implements BackgroundResource {
   private final SubnetworkSettings settings;
   private final SubnetworkStub stub;
 
-
-
-  /**
-   * Constructs an instance of SubnetworkClient with default settings.
-   */
+  /** Constructs an instance of SubnetworkClient with default settings. */
   public static final SubnetworkClient create() throws IOException {
     return create(SubnetworkSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of SubnetworkClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of SubnetworkClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final SubnetworkClient create(SubnetworkSettings settings) throws IOException {
     return new SubnetworkClient(settings);
@@ -144,9 +128,8 @@ public static final SubnetworkClient create(SubnetworkStub stub) {
   }
 
   /**
-   * Constructs an instance of SubnetworkClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of SubnetworkClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected SubnetworkClient(SubnetworkSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +151,12 @@ public SubnetworkStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,11 +170,12 @@ public SubnetworkStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(ProjectName project) {
+  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
+      ProjectName project) {
     AggregatedListSubnetworksHttpRequest request =
         AggregatedListSubnetworksHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListSubnetworks(request);
   }
 
@@ -199,7 +183,8 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(Pr
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -215,9 +200,7 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(Pr
   @BetaApi
   public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(String project) {
     AggregatedListSubnetworksHttpRequest request =
-        AggregatedListSubnetworksHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListSubnetworksHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListSubnetworks(request);
   }
 
@@ -225,7 +208,8 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(St
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +226,17 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(AggregatedListSubnetworksHttpRequest request) {
-    return aggregatedListSubnetworksPagedCallable()
-        .call(request);
+  public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(
+      AggregatedListSubnetworksHttpRequest request) {
+    return aggregatedListSubnetworksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of subnetworks.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +252,9 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks(Ag
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListSubnetworksPagedCallable() { + public final UnaryCallable< + AggregatedListSubnetworksHttpRequest, AggregatedListSubnetworksPagedResponse> + aggregatedListSubnetworksPagedCallable() { return stub.aggregatedListSubnetworksPagedCallable(); } @@ -275,7 +262,8 @@ public final UnaryCallableSample code: + * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +286,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListSubnetworksCallable() { + public final UnaryCallable + aggregatedListSubnetworksCallable() { return stub.aggregatedListSubnetworksCallable(); } @@ -306,7 +295,8 @@ public final UnaryCallableSample code: + * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -315,22 +305,27 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork) { + public final Operation deleteSubnetwork( + String requestId, ProjectRegionSubnetworkName subnetwork) { DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .build(); return deleteSubnetwork(request); } @@ -338,7 +333,8 @@ public final Operation deleteSubnetwork(String requestId, ProjectRegionSubnetwor /** * Deletes the specified subnetwork. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -347,11 +343,15 @@ public final Operation deleteSubnetwork(String requestId, ProjectRegionSubnetwor
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -360,9 +360,9 @@ public final Operation deleteSubnetwork(String requestId, String subnetwork) { DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .build(); return deleteSubnetwork(request); } @@ -370,7 +370,8 @@ public final Operation deleteSubnetwork(String requestId, String subnetwork) { /** * Deletes the specified subnetwork. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -395,7 +396,8 @@ public final Operation deleteSubnetwork(DeleteSubnetworkHttpRequest request) {
   /**
    * Deletes the specified subnetwork.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -419,7 +421,8 @@ public final UnaryCallable deleteSubnetw
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -429,24 +432,32 @@ public final UnaryCallable deleteSubnetw
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to update. * @param subnetworksExpandIpCidrRangeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation expandIpCidrRangeSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + public final Operation expandIpCidrRangeSubnetwork( + String requestId, + ProjectRegionSubnetworkName subnetwork, + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) - .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworksExpandIpCidrRangeRequestResource( + subnetworksExpandIpCidrRangeRequestResource) + .build(); return expandIpCidrRangeSubnetwork(request); } @@ -454,7 +465,8 @@ public final Operation expandIpCidrRangeSubnetwork(String requestId, ProjectRegi /** * Expands the IP CIDR range of the subnetwork to a specified value. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -464,24 +476,32 @@ public final Operation expandIpCidrRangeSubnetwork(String requestId, ProjectRegi
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to update. * @param subnetworksExpandIpCidrRangeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation expandIpCidrRangeSubnetwork(String requestId, String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { + public final Operation expandIpCidrRangeSubnetwork( + String requestId, + String subnetwork, + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork) - .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .setSubnetworksExpandIpCidrRangeRequestResource( + subnetworksExpandIpCidrRangeRequestResource) + .build(); return expandIpCidrRangeSubnetwork(request); } @@ -489,7 +509,8 @@ public final Operation expandIpCidrRangeSubnetwork(String requestId, String subn /** * Expands the IP CIDR range of the subnetwork to a specified value. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -508,7 +529,8 @@ public final Operation expandIpCidrRangeSubnetwork(String requestId, String subn
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHttpRequest request) {
+  public final Operation expandIpCidrRangeSubnetwork(
+      ExpandIpCidrRangeSubnetworkHttpRequest request) {
     return expandIpCidrRangeSubnetworkCallable().call(request);
   }
 
@@ -516,7 +538,8 @@ public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHt
   /**
    * Expands the IP CIDR range of the subnetwork to a specified value.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -534,7 +557,8 @@ public final Operation expandIpCidrRangeSubnetwork(ExpandIpCidrRangeSubnetworkHt
    * 
*/ @BetaApi - public final UnaryCallable expandIpCidrRangeSubnetworkCallable() { + public final UnaryCallable + expandIpCidrRangeSubnetworkCallable() { return stub.expandIpCidrRangeSubnetworkCallable(); } @@ -542,7 +566,8 @@ public final UnaryCallable ex /** * Returns the specified subnetwork. Get a list of available subnetworks list() request. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -558,8 +583,8 @@ public final Subnetwork getSubnetwork(ProjectRegionSubnetworkName subnetwork) {
 
     GetSubnetworkHttpRequest request =
         GetSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
-        .build();
+            .setSubnetwork(subnetwork == null ? null : subnetwork.toString())
+            .build();
     return getSubnetwork(request);
   }
 
@@ -567,7 +592,8 @@ public final Subnetwork getSubnetwork(ProjectRegionSubnetworkName subnetwork) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -582,9 +608,7 @@ public final Subnetwork getSubnetwork(ProjectRegionSubnetworkName subnetwork) {
   public final Subnetwork getSubnetwork(String subnetwork) {
 
     GetSubnetworkHttpRequest request =
-        GetSubnetworkHttpRequest.newBuilder()
-        .setSubnetwork(subnetwork)
-        .build();
+        GetSubnetworkHttpRequest.newBuilder().setSubnetwork(subnetwork).build();
     return getSubnetwork(request);
   }
 
@@ -592,7 +616,8 @@ public final Subnetwork getSubnetwork(String subnetwork) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -615,7 +640,8 @@ public final Subnetwork getSubnetwork(GetSubnetworkHttpRequest request) {
   /**
    * Returns the specified subnetwork. Get a list of available subnetworks list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
@@ -637,7 +663,8 @@ public final UnaryCallable getSubnetworkCa
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -647,24 +674,30 @@ public final UnaryCallable getSubnetworkCa
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSubnetwork(String requestId, ProjectRegionName region, Subnetwork subnetworkResource) { + public final Operation insertSubnetwork( + String requestId, ProjectRegionName region, Subnetwork subnetworkResource) { InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setSubnetworkResource(subnetworkResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setSubnetworkResource(subnetworkResource) + .build(); return insertSubnetwork(request); } @@ -672,7 +705,8 @@ public final Operation insertSubnetwork(String requestId, ProjectRegionName regi /** * Creates a subnetwork in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -682,24 +716,30 @@ public final Operation insertSubnetwork(String requestId, ProjectRegionName regi
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSubnetwork(String requestId, String region, Subnetwork subnetworkResource) { + public final Operation insertSubnetwork( + String requestId, String region, Subnetwork subnetworkResource) { InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setSubnetworkResource(subnetworkResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setSubnetworkResource(subnetworkResource) + .build(); return insertSubnetwork(request); } @@ -707,7 +747,8 @@ public final Operation insertSubnetwork(String requestId, String region, Subnetw /** * Creates a subnetwork in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -734,7 +775,8 @@ public final Operation insertSubnetwork(InsertSubnetworkHttpRequest request) {
   /**
    * Creates a subnetwork in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -760,7 +802,8 @@ public final UnaryCallable insertSubnetw
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -777,8 +820,8 @@ public final UnaryCallable insertSubnetw
   public final ListSubnetworksPagedResponse listSubnetworks(ProjectRegionName region) {
     ListSubnetworksHttpRequest request =
         ListSubnetworksHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listSubnetworks(request);
   }
 
@@ -786,7 +829,8 @@ public final ListSubnetworksPagedResponse listSubnetworks(ProjectRegionName regi
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -802,9 +846,7 @@ public final ListSubnetworksPagedResponse listSubnetworks(ProjectRegionName regi
   @BetaApi
   public final ListSubnetworksPagedResponse listSubnetworks(String region) {
     ListSubnetworksHttpRequest request =
-        ListSubnetworksHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListSubnetworksHttpRequest.newBuilder().setRegion(region).build();
     return listSubnetworks(request);
   }
 
@@ -812,7 +854,8 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -830,15 +873,15 @@ public final ListSubnetworksPagedResponse listSubnetworks(String region) {
    */
   @BetaApi
   public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpRequest request) {
-    return listSubnetworksPagedCallable()
-        .call(request);
+    return listSubnetworksPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of subnetworks available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -854,7 +897,8 @@ public final ListSubnetworksPagedResponse listSubnetworks(ListSubnetworksHttpReq
    * 
*/ @BetaApi - public final UnaryCallable listSubnetworksPagedCallable() { + public final UnaryCallable + listSubnetworksPagedCallable() { return stub.listSubnetworksPagedCallable(); } @@ -862,7 +906,8 @@ public final UnaryCallableSample code: + * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -891,9 +936,13 @@ public final UnaryCallable listSubne
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.
+   * Patches the specified subnetwork with the data included in the request. Only the following
+   * fields within the subnetwork resource can be specified in the request: secondary_ip_range,
+   * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify the current
+   * fingeprint of the subnetwork resource being patched.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -903,32 +952,42 @@ public final UnaryCallable listSubne
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to patch. - * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork, Subnetwork subnetworkResource) { + public final Operation patchSubnetwork( + String requestId, ProjectRegionSubnetworkName subnetwork, Subnetwork subnetworkResource) { PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) - .setSubnetworkResource(subnetworkResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworkResource(subnetworkResource) + .build(); return patchSubnetwork(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched. + * Patches the specified subnetwork with the data included in the request. Only the following + * fields within the subnetwork resource can be specified in the request: secondary_ip_range, + * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify the current + * fingeprint of the subnetwork resource being patched. + * + *

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -938,32 +997,42 @@ public final Operation patchSubnetwork(String requestId, ProjectRegionSubnetwork
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to patch. - * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) + * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchSubnetwork(String requestId, String subnetwork, Subnetwork subnetworkResource) { + public final Operation patchSubnetwork( + String requestId, String subnetwork, Subnetwork subnetworkResource) { PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork) - .setSubnetworkResource(subnetworkResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .setSubnetworkResource(subnetworkResource) + .build(); return patchSubnetwork(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched. + * Patches the specified subnetwork with the data included in the request. Only the following + * fields within the subnetwork resource can be specified in the request: secondary_ip_range, + * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify the current + * fingeprint of the subnetwork resource being patched. + * + *

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -988,9 +1057,13 @@ public final Operation patchSubnetwork(PatchSubnetworkHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.
+   * Patches the specified subnetwork with the data included in the request. Only the following
+   * fields within the subnetwork resource can be specified in the request: secondary_ip_range,
+   * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify the current
+   * fingeprint of the subnetwork resource being patched.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -1014,9 +1087,11 @@ public final UnaryCallable patchSubnetwor
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.
+   * Set whether VMs in this subnet can access Google services without assigning external IP
+   * addresses through Private Google Access.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -1026,32 +1101,43 @@ public final UnaryCallable patchSubnetwor
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource. * @param subnetworksSetPrivateIpGoogleAccessRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, ProjectRegionSubnetworkName subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { + public final Operation setPrivateIpGoogleAccessSubnetwork( + String requestId, + ProjectRegionSubnetworkName subnetwork, + SubnetworksSetPrivateIpGoogleAccessRequest + subnetworksSetPrivateIpGoogleAccessRequestResource) { SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) - .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) + .setSubnetworksSetPrivateIpGoogleAccessRequestResource( + subnetworksSetPrivateIpGoogleAccessRequestResource) + .build(); return setPrivateIpGoogleAccessSubnetwork(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * Set whether VMs in this subnet can access Google services without assigning external IP + * addresses through Private Google Access. + * + *

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -1061,32 +1147,43 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, Proj
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource. * @param subnetworksSetPrivateIpGoogleAccessRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, String subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { + public final Operation setPrivateIpGoogleAccessSubnetwork( + String requestId, + String subnetwork, + SubnetworksSetPrivateIpGoogleAccessRequest + subnetworksSetPrivateIpGoogleAccessRequestResource) { SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork) - .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource) - .build(); + .setRequestId(requestId) + .setSubnetwork(subnetwork) + .setSubnetworksSetPrivateIpGoogleAccessRequestResource( + subnetworksSetPrivateIpGoogleAccessRequestResource) + .build(); return setPrivateIpGoogleAccessSubnetwork(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * Set whether VMs in this subnet can access Google services without assigning external IP + * addresses through Private Google Access. + * + *

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -1105,15 +1202,18 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(String requestId, Stri
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setPrivateIpGoogleAccessSubnetwork(SetPrivateIpGoogleAccessSubnetworkHttpRequest request) {
+  public final Operation setPrivateIpGoogleAccessSubnetwork(
+      SetPrivateIpGoogleAccessSubnetworkHttpRequest request) {
     return setPrivateIpGoogleAccessSubnetworkCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.
+   * Set whether VMs in this subnet can access Google services without assigning external IP
+   * addresses through Private Google Access.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
    *   String requestId = "";
@@ -1131,12 +1231,13 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(SetPrivateIpGoogleAcce
    * 
*/ @BetaApi - public final UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { + public final UnaryCallable + setPrivateIpGoogleAccessSubnetworkCallable() { return stub.setPrivateIpGoogleAccessSubnetworkCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1165,15 +1266,16 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListSubnetworksPagedResponse extends AbstractPagedListResponse< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList, - AggregatedListSubnetworksPage, - AggregatedListSubnetworksFixedSizeCollection> { + public static class AggregatedListSubnetworksPagedResponse + extends AbstractPagedListResponse< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, SubnetworksScopedList, + AggregatedListSubnetworksPage, AggregatedListSubnetworksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, + SubnetworksScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = AggregatedListSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1181,7 +1283,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public AggregatedListSubnetworksPagedResponse apply(AggregatedListSubnetworksPage input) { + public AggregatedListSubnetworksPagedResponse apply( + AggregatedListSubnetworksPage input) { return new AggregatedListSubnetworksPagedResponse(input); } }); @@ -1190,18 +1293,18 @@ public AggregatedListSubnetworksPagedResponse apply(AggregatedListSubnetworksPag private AggregatedListSubnetworksPagedResponse(AggregatedListSubnetworksPage page) { super(page, AggregatedListSubnetworksFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListSubnetworksPage extends AbstractPage< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList, - AggregatedListSubnetworksPage> { + public static class AggregatedListSubnetworksPage + extends AbstractPage< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, SubnetworksScopedList, + AggregatedListSubnetworksPage> { private AggregatedListSubnetworksPage( - PageContext context, + PageContext< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, + SubnetworksScopedList> + context, SubnetworkAggregatedList response) { super(context, response); } @@ -1212,31 +1315,32 @@ private static AggregatedListSubnetworksPage createEmptyPage() { @Override protected AggregatedListSubnetworksPage createPage( - PageContext context, + PageContext< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, + SubnetworksScopedList> + context, SubnetworkAggregatedList response) { return new AggregatedListSubnetworksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, + SubnetworksScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListSubnetworksHttpRequest, - SubnetworkAggregatedList, - SubnetworksScopedList, - AggregatedListSubnetworksPage, - AggregatedListSubnetworksFixedSizeCollection> { + public static class AggregatedListSubnetworksFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, SubnetworksScopedList, + AggregatedListSubnetworksPage, AggregatedListSubnetworksFixedSizeCollection> { - private AggregatedListSubnetworksFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListSubnetworksFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1249,15 +1353,12 @@ protected AggregatedListSubnetworksFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListSubnetworksFixedSizeCollection(pages, collectionSize); } - - } - public static class ListSubnetworksPagedResponse extends AbstractPagedListResponse< - ListSubnetworksHttpRequest, - SubnetworkList, - Subnetwork, - ListSubnetworksPage, - ListSubnetworksFixedSizeCollection> { + + public static class ListSubnetworksPagedResponse + extends AbstractPagedListResponse< + ListSubnetworksHttpRequest, SubnetworkList, Subnetwork, ListSubnetworksPage, + ListSubnetworksFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1277,15 +1378,11 @@ public ListSubnetworksPagedResponse apply(ListSubnetworksPage input) { private ListSubnetworksPagedResponse(ListSubnetworksPage page) { super(page, ListSubnetworksFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListSubnetworksPage extends AbstractPage< - ListSubnetworksHttpRequest, - SubnetworkList, - Subnetwork, - ListSubnetworksPage> { + public static class ListSubnetworksPage + extends AbstractPage< + ListSubnetworksHttpRequest, SubnetworkList, Subnetwork, ListSubnetworksPage> { private ListSubnetworksPage( PageContext context, @@ -1310,20 +1407,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListSubnetworksFixedSizeCollection extends AbstractFixedSizeCollection< - ListSubnetworksHttpRequest, - SubnetworkList, - Subnetwork, - ListSubnetworksPage, - ListSubnetworksFixedSizeCollection> { + public static class ListSubnetworksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSubnetworksHttpRequest, SubnetworkList, Subnetwork, ListSubnetworksPage, + ListSubnetworksFixedSizeCollection> { - private ListSubnetworksFixedSizeCollection(List pages, int collectionSize) { + private ListSubnetworksFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1336,7 +1428,5 @@ protected ListSubnetworksFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListSubnetworksFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java index 312f61f050b0..5c097934afd2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private SubnetworkList() { this.warning = null; } - private SubnetworkList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SubnetworkList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SubnetworkList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SubnetworkList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SubnetworkList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public SubnetworkList build() { - - - - - return new SubnetworkList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new SubnetworkList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "SubnetworkList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof SubnetworkList) { SubnetworkList that = (SubnetworkList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java deleted file mode 100644 index c033f453a625..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class SubnetworkName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String region; - private final String subnetwork; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/subnetworks/{subnetwork}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private SubnetworkName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - subnetwork = Preconditions.checkNotNull(builder.getSubnetwork()); - } - - public static SubnetworkName of( - String project, - String region, - String subnetwork - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setSubnetwork(subnetwork) - .build(); - } - - public static String format( - String project, - String region, - String subnetwork - ) { - return of( - project, - region, - subnetwork - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - public String getSubnetwork() { - return subnetwork; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldMapBuilder.put("subnetwork", subnetwork); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public SubnetworkName parse(String formattedString) {return SubnetworkName.parse(formattedString);} - }; - } - - public static SubnetworkName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "SubnetworkName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("subnetwork") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String region; - private String subnetwork; - - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - public String getSubnetwork() { - return subnetwork; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - public Builder setSubnetwork(String subnetwork) { - this.subnetwork = subnetwork; - return this; - } - - private Builder() {} - - public Builder (SubnetworkName subnetworkName) { - project = subnetworkName.project; - region = subnetworkName.region; - subnetwork = subnetworkName.subnetwork; - } - - public SubnetworkName build() { - return new SubnetworkName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "region", region, - "subnetwork", subnetwork - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof SubnetworkName) { - SubnetworkName that = (SubnetworkName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.subnetwork, that.getSubnetwork()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - region, - subnetwork - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java index d679ffab04f8..0c9326ec20bd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private SubnetworkSecondaryRange() { this.rangeName = null; } - - private SubnetworkSecondaryRange( - String ipCidrRange, - String rangeName - ) { + private SubnetworkSecondaryRange(String ipCidrRange, String rangeName) { this.ipCidrRange = ipCidrRange; this.rangeName = rangeName; } @@ -86,22 +79,24 @@ public String getRangeName() { return rangeName; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SubnetworkSecondaryRange prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SubnetworkSecondaryRange getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SubnetworkSecondaryRange DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SubnetworkSecondaryRange(); } @@ -146,13 +141,9 @@ public Builder setRangeName(String rangeName) { return this; } - public SubnetworkSecondaryRange build() { - return new SubnetworkSecondaryRange( - ipCidrRange, - rangeName - ); + return new SubnetworkSecondaryRange(ipCidrRange, rangeName); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "SubnetworkSecondaryRange{" - + "ipCidrRange=" + ipCidrRange + ", " - + "rangeName=" + rangeName + + "ipCidrRange=" + + ipCidrRange + + ", " + + "rangeName=" + + rangeName + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof SubnetworkSecondaryRange) { SubnetworkSecondaryRange that = (SubnetworkSecondaryRange) o; - return - Objects.equals(this.ipCidrRange, that.getIpCidrRange()) && - Objects.equals(this.rangeName, that.getRangeName()) - ; + return Objects.equals(this.ipCidrRange, that.getIpCidrRange()) + && Objects.equals(this.rangeName, that.getRangeName()); } return false; } @Override public int hashCode() { - return Objects.hash( - ipCidrRange, - rangeName - ); + return Objects.hash(ipCidrRange, rangeName); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java index 91f238533c27..635b5277e278 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; -import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSubnetwork to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSubnetwork to 30 seconds: * *

  * 
@@ -86,105 +64,84 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SubnetworkSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListSubnetworks.
-   */
-  public PagedCallSettings aggregatedListSubnetworksSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListSubnetworks. */
+  public PagedCallSettings<
+          AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+          AggregatedListSubnetworksPagedResponse>
+      aggregatedListSubnetworksSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).aggregatedListSubnetworksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to deleteSubnetwork. */
   public UnaryCallSettings deleteSubnetworkSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).deleteSubnetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to expandIpCidrRangeSubnetwork.
-   */
-  public UnaryCallSettings expandIpCidrRangeSubnetworkSettings() {
+  /** Returns the object with the settings used for calls to expandIpCidrRangeSubnetwork. */
+  public UnaryCallSettings
+      expandIpCidrRangeSubnetworkSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).expandIpCidrRangeSubnetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to getSubnetwork. */
   public UnaryCallSettings getSubnetworkSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).getSubnetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to insertSubnetwork. */
   public UnaryCallSettings insertSubnetworkSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).insertSubnetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSubnetworks.
-   */
-  public PagedCallSettings listSubnetworksSettings() {
+  /** Returns the object with the settings used for calls to listSubnetworks. */
+  public PagedCallSettings
+      listSubnetworksSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).listSubnetworksSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to patchSubnetwork. */
   public UnaryCallSettings patchSubnetworkSettings() {
     return ((SubnetworkStubSettings) getStubSettings()).patchSubnetworkSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork.
-   */
-  public UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings() {
-    return ((SubnetworkStubSettings) getStubSettings()).setPrivateIpGoogleAccessSubnetworkSettings();
+  /** Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */
+  public UnaryCallSettings
+      setPrivateIpGoogleAccessSubnetworkSettings() {
+    return ((SubnetworkStubSettings) getStubSettings())
+        .setPrivateIpGoogleAccessSubnetworkSettings();
   }
 
-
   public static final SubnetworkSettings create(SubnetworkStubSettings stub) throws IOException {
     return new SubnetworkSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return SubnetworkStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return SubnetworkStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return SubnetworkStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return SubnetworkStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return SubnetworkStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return SubnetworkStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return SubnetworkStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -197,23 +154,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return SubnetworkStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -222,9 +173,7 @@ protected SubnetworkSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for SubnetworkSettings.
-   */
+  /** Builder for SubnetworkSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -246,74 +195,72 @@ protected Builder(SubnetworkStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public SubnetworkStubSettings.Builder getStubSettingsBuilder() {
       return ((SubnetworkStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListSubnetworks. - */ - public PagedCallSettings.Builder aggregatedListSubnetworksSettings() { + /** Returns the builder for the settings used for calls to aggregatedListSubnetworks. */ + public PagedCallSettings.Builder< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, + AggregatedListSubnetworksPagedResponse> + aggregatedListSubnetworksSettings() { return getStubSettingsBuilder().aggregatedListSubnetworksSettings(); } - /** - * Returns the builder for the settings used for calls to deleteSubnetwork. - */ - public UnaryCallSettings.Builder deleteSubnetworkSettings() { + /** Returns the builder for the settings used for calls to deleteSubnetwork. */ + public UnaryCallSettings.Builder + deleteSubnetworkSettings() { return getStubSettingsBuilder().deleteSubnetworkSettings(); } - /** - * Returns the builder for the settings used for calls to expandIpCidrRangeSubnetwork. - */ - public UnaryCallSettings.Builder expandIpCidrRangeSubnetworkSettings() { + /** Returns the builder for the settings used for calls to expandIpCidrRangeSubnetwork. */ + public UnaryCallSettings.Builder + expandIpCidrRangeSubnetworkSettings() { return getStubSettingsBuilder().expandIpCidrRangeSubnetworkSettings(); } - /** - * Returns the builder for the settings used for calls to getSubnetwork. - */ + /** Returns the builder for the settings used for calls to getSubnetwork. */ public UnaryCallSettings.Builder getSubnetworkSettings() { return getStubSettingsBuilder().getSubnetworkSettings(); } - /** - * Returns the builder for the settings used for calls to insertSubnetwork. - */ - public UnaryCallSettings.Builder insertSubnetworkSettings() { + /** Returns the builder for the settings used for calls to insertSubnetwork. */ + public UnaryCallSettings.Builder + insertSubnetworkSettings() { return getStubSettingsBuilder().insertSubnetworkSettings(); } - /** - * Returns the builder for the settings used for calls to listSubnetworks. - */ - public PagedCallSettings.Builder listSubnetworksSettings() { + /** Returns the builder for the settings used for calls to listSubnetworks. */ + public PagedCallSettings.Builder< + ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse> + listSubnetworksSettings() { return getStubSettingsBuilder().listSubnetworksSettings(); } - /** - * Returns the builder for the settings used for calls to patchSubnetwork. - */ - public UnaryCallSettings.Builder patchSubnetworkSettings() { + /** Returns the builder for the settings used for calls to patchSubnetwork. */ + public UnaryCallSettings.Builder + patchSubnetworkSettings() { return getStubSettingsBuilder().patchSubnetworkSettings(); } /** * Returns the builder for the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */ - public UnaryCallSettings.Builder setPrivateIpGoogleAccessSubnetworkSettings() { + public UnaryCallSettings.Builder + setPrivateIpGoogleAccessSubnetworkSettings() { return getStubSettingsBuilder().setPrivateIpGoogleAccessSubnetworkSettings(); } @@ -322,4 +269,4 @@ public SubnetworkSettings build() throws IOException { return new SubnetworkSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java index abb53d5f7a38..87ded433931a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private SubnetworksExpandIpCidrRangeRequest() { this.ipCidrRange = null; } - - private SubnetworksExpandIpCidrRangeRequest( - String ipCidrRange - ) { + private SubnetworksExpandIpCidrRangeRequest(String ipCidrRange) { this.ipCidrRange = ipCidrRange; } @@ -72,22 +66,24 @@ public String getIpCidrRange() { return ipCidrRange; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SubnetworksExpandIpCidrRangeRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SubnetworksExpandIpCidrRangeRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SubnetworksExpandIpCidrRangeRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SubnetworksExpandIpCidrRangeRequest(); } @@ -118,11 +114,8 @@ public Builder setIpCidrRange(String ipCidrRange) { return this; } - public SubnetworksExpandIpCidrRangeRequest build() { - return new SubnetworksExpandIpCidrRangeRequest( - ipCidrRange - ); + return new SubnetworksExpandIpCidrRangeRequest(ipCidrRange); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "SubnetworksExpandIpCidrRangeRequest{" - + "ipCidrRange=" + ipCidrRange - + "}"; + return "SubnetworksExpandIpCidrRangeRequest{" + "ipCidrRange=" + ipCidrRange + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof SubnetworksExpandIpCidrRangeRequest) { SubnetworksExpandIpCidrRangeRequest that = (SubnetworksExpandIpCidrRangeRequest) o; - return - Objects.equals(this.ipCidrRange, that.getIpCidrRange()) - ; + return Objects.equals(this.ipCidrRange, that.getIpCidrRange()); } return false; } @Override public int hashCode() { - return Objects.hash( - ipCidrRange - ); + return Objects.hash(ipCidrRange); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java index 0ceb0a2bc2ef..4e95dd289f18 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private SubnetworksScopedList() { this.warning = null; } - - private SubnetworksScopedList( - List subnetworks, - Warning warning - ) { + private SubnetworksScopedList(List subnetworks, Warning warning) { this.subnetworks = subnetworks; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SubnetworksScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SubnetworksScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SubnetworksScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SubnetworksScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public SubnetworksScopedList build() { - return new SubnetworksScopedList( - subnetworks, - warning - ); + return new SubnetworksScopedList(subnetworks, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "SubnetworksScopedList{" - + "subnetworks=" + subnetworks + ", " - + "warning=" + warning + + "subnetworks=" + + subnetworks + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof SubnetworksScopedList) { SubnetworksScopedList that = (SubnetworksScopedList) o; - return - Objects.equals(this.subnetworks, that.getSubnetworksList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.subnetworks, that.getSubnetworksList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - subnetworks, - warning - ); + return Objects.hash(subnetworks, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java index eb9159a40633..3a1b9d3b878a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private SubnetworksSetPrivateIpGoogleAccessRequest() { this.privateIpGoogleAccess = null; } - - private SubnetworksSetPrivateIpGoogleAccessRequest( - Boolean privateIpGoogleAccess - ) { + private SubnetworksSetPrivateIpGoogleAccessRequest(Boolean privateIpGoogleAccess) { this.privateIpGoogleAccess = privateIpGoogleAccess; } @@ -49,7 +43,9 @@ private SubnetworksSetPrivateIpGoogleAccessRequest( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { - fieldMap.put("privateIpGoogleAccess", Collections.singletonList(String.valueOf(privateIpGoogleAccess))); + fieldMap.put( + "privateIpGoogleAccess", + Collections.singletonList(String.valueOf(privateIpGoogleAccess))); } return fieldMap; } @@ -72,22 +68,24 @@ public Boolean getPrivateIpGoogleAccess() { return privateIpGoogleAccess; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SubnetworksSetPrivateIpGoogleAccessRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SubnetworksSetPrivateIpGoogleAccessRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SubnetworksSetPrivateIpGoogleAccessRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SubnetworksSetPrivateIpGoogleAccessRequest(); } @@ -118,11 +116,8 @@ public Builder setPrivateIpGoogleAccess(Boolean privateIpGoogleAccess) { return this; } - public SubnetworksSetPrivateIpGoogleAccessRequest build() { - return new SubnetworksSetPrivateIpGoogleAccessRequest( - privateIpGoogleAccess - ); + return new SubnetworksSetPrivateIpGoogleAccessRequest(privateIpGoogleAccess); } public Builder clone() { @@ -135,7 +130,8 @@ public Builder clone() { @Override public String toString() { return "SubnetworksSetPrivateIpGoogleAccessRequest{" - + "privateIpGoogleAccess=" + privateIpGoogleAccess + + "privateIpGoogleAccess=" + + privateIpGoogleAccess + "}"; } @@ -145,18 +141,15 @@ public boolean equals(Object o) { return true; } if (o instanceof SubnetworksSetPrivateIpGoogleAccessRequest) { - SubnetworksSetPrivateIpGoogleAccessRequest that = (SubnetworksSetPrivateIpGoogleAccessRequest) o; - return - Objects.equals(this.privateIpGoogleAccess, that.getPrivateIpGoogleAccess()) - ; + SubnetworksSetPrivateIpGoogleAccessRequest that = + (SubnetworksSetPrivateIpGoogleAccessRequest) o; + return Objects.equals(this.privateIpGoogleAccess, that.getPrivateIpGoogleAccess()); } return false; } @Override public int hashCode() { - return Objects.hash( - privateIpGoogleAccess - ); + return Objects.hash(privateIpGoogleAccess); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java index 4e2d4d0a8c0b..9fa3349e9153 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private SwitchToCustomModeNetworkHttpRequest() { this.userIp = null; } - private SwitchToCustomModeNetworkHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private SwitchToCustomModeNetworkHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -184,22 +179,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(SwitchToCustomModeNetworkHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static SwitchToCustomModeNetworkHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final SwitchToCustomModeNetworkHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new SwitchToCustomModeNetworkHttpRequest(); } @@ -342,34 +339,18 @@ public Builder setUserIp(String userIp) { return this; } - public SwitchToCustomModeNetworkHttpRequest build() { String missing = ""; - - - if (network == null) { missing += " network"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new SwitchToCustomModeNetworkHttpRequest( - access_token, - callback, - fields, - key, - network, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, network, prettyPrint, quotaUser, requestId, userIp); } public Builder clone() { @@ -390,15 +371,32 @@ public Builder clone() { @Override public String toString() { return "SwitchToCustomModeNetworkHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "network=" + network + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "network=" + + network + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +407,15 @@ public boolean equals(Object o) { } if (o instanceof SwitchToCustomModeNetworkHttpRequest) { SwitchToCustomModeNetworkHttpRequest that = (SwitchToCustomModeNetworkHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +423,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - network, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, callback, fields, key, network, prettyPrint, quotaUser, requestId, userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java index 6774605f867c..888316c44aff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,14 +43,8 @@ private TCPHealthCheck() { this.response = null; } - private TCPHealthCheck( - Integer port, - String portName, - String proxyHeader, - String request, - String response - ) { + Integer port, String portName, String proxyHeader, String request, String response) { this.port = port; this.portName = portName; this.proxyHeader = proxyHeader; @@ -128,22 +119,24 @@ public String getResponse() { return response; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TCPHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TCPHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TCPHealthCheck DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TCPHealthCheck(); } @@ -230,19 +223,9 @@ public Builder setResponse(String response) { return this; } - public TCPHealthCheck build() { - - - - return new TCPHealthCheck( - port, - portName, - proxyHeader, - request, - response - ); + return new TCPHealthCheck(port, portName, proxyHeader, request, response); } public Builder clone() { @@ -259,11 +242,20 @@ public Builder clone() { @Override public String toString() { return "TCPHealthCheck{" - + "port=" + port + ", " - + "portName=" + portName + ", " - + "proxyHeader=" + proxyHeader + ", " - + "request=" + request + ", " - + "response=" + response + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "request=" + + request + + ", " + + "response=" + + response + "}"; } @@ -274,25 +266,17 @@ public boolean equals(Object o) { } if (o instanceof TCPHealthCheck) { TCPHealthCheck that = (TCPHealthCheck) o; - return - Objects.equals(this.port, that.getPort()) && - Objects.equals(this.portName, that.getPortName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.request, that.getRequest()) && - Objects.equals(this.response, that.getResponse()) - ; + return Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.request, that.getRequest()) + && Objects.equals(this.response, that.getResponse()); } return false; } @Override public int hashCode() { - return Objects.hash( - port, - portName, - proxyHeader, - request, - response - ); + return Objects.hash(port, portName, proxyHeader, request, response); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java index d8ffa316b625..ac201c3f237e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private Tags() { this.items = null; } - - private Tags( - String fingerprint, - List items - ) { + private Tags(String fingerprint, List items) { this.fingerprint = fingerprint; this.items = items; } @@ -90,22 +85,24 @@ public List getItemsList() { return items; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Tags prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Tags getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Tags DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Tags(); } @@ -158,13 +155,9 @@ public Builder addItems(String items) { return this; } - public Tags build() { - return new Tags( - fingerprint, - items - ); + return new Tags(fingerprint, items); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "Tags{" - + "fingerprint=" + fingerprint + ", " - + "items=" + items - + "}"; + return "Tags{" + "fingerprint=" + fingerprint + ", " + "items=" + items + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof Tags) { Tags that = (Tags) o; - return - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.items, that.getItemsList()) - ; + return Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.items, that.getItemsList()); } return false; } @Override public int hashCode() { - return Objects.hash( - fingerprint, - items - ); + return Objects.hash(fingerprint, items); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java index 1e97e3a11d1e..68c65cb2ee9c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -50,7 +47,6 @@ private TargetHttpProxy() { this.urlMap = null; } - private TargetHttpProxy( String creationTimestamp, String description, @@ -58,8 +54,7 @@ private TargetHttpProxy( String kind, String name, String selfLink, - String urlMap - ) { + String urlMap) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -73,7 +68,8 @@ private TargetHttpProxy( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -156,22 +152,24 @@ public String getUrlMap() { return urlMap; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpProxy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpProxy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpProxy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpProxy(); } @@ -286,23 +284,9 @@ public Builder setUrlMap(String urlMap) { return this; } - public TargetHttpProxy build() { - - - - - - return new TargetHttpProxy( - creationTimestamp, - description, - id, - kind, - name, - selfLink, - urlMap - ); + return new TargetHttpProxy(creationTimestamp, description, id, kind, name, selfLink, urlMap); } public Builder clone() { @@ -321,13 +305,26 @@ public Builder clone() { @Override public String toString() { return "TargetHttpProxy{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + ", " - + "urlMap=" + urlMap + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "urlMap=" + + urlMap + "}"; } @@ -338,29 +335,19 @@ public boolean equals(Object o) { } if (o instanceof TargetHttpProxy) { TargetHttpProxy that = (TargetHttpProxy) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.urlMap, that.getUrlMap()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - selfLink, - urlMap - ); + return Objects.hash(creationTimestamp, description, id, kind, name, selfLink, urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java index 5fba0efa73f3..cf2d7bedbfba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetHttpProxyStub; import com.google.cloud.compute.v1.stub.TargetHttpProxyStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,40 @@ * * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) { * String requestId = ""; - * ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + * ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); * Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy); * } * *

* - *

Note: close() needs to be called on the targetHttpProxyClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the targetHttpProxyClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetHttpProxySettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class TargetHttpProxyClient implements BackgroundResource {
   private final TargetHttpProxySettings settings;
   private final TargetHttpProxyStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetHttpProxyClient with default settings.
-   */
+  /** Constructs an instance of TargetHttpProxyClient with default settings. */
   public static final TargetHttpProxyClient create() throws IOException {
     return create(TargetHttpProxySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetHttpProxyClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetHttpProxyClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetHttpProxyClient create(TargetHttpProxySettings settings) throws IOException {
+  public static final TargetHttpProxyClient create(TargetHttpProxySettings settings)
+      throws IOException {
     return new TargetHttpProxyClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetHttpProxyClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetHttpProxySettings}.
+   * Constructs an instance of TargetHttpProxyClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use TargetHttpProxySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetHttpProxyClient create(TargetHttpProxyStub stub) {
@@ -144,9 +130,9 @@ public static final TargetHttpProxyClient create(TargetHttpProxyStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetHttpProxyClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetHttpProxyClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetHttpProxyClient(TargetHttpProxySettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +154,41 @@ public TargetHttpProxyStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified TargetHttpProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpProxy(String requestId, ProjectTargetHttpProxyName targetHttpProxy) { + public final Operation deleteTargetHttpProxy( + String requestId, ProjectGlobalTargetHttpProxyName targetHttpProxy) { DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) - .build(); + .setRequestId(requestId) + .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) + .build(); return deleteTargetHttpProxy(request); } @@ -205,20 +196,25 @@ public final Operation deleteTargetHttpProxy(String requestId, ProjectTargetHttp /** * Deletes the specified TargetHttpProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +223,9 @@ public final Operation deleteTargetHttpProxy(String requestId, String targetHttp DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetHttpProxy(targetHttpProxy) - .build(); + .setRequestId(requestId) + .setTargetHttpProxy(targetHttpProxy) + .build(); return deleteTargetHttpProxy(request); } @@ -237,11 +233,12 @@ public final Operation deleteTargetHttpProxy(String requestId, String targetHttp /** * Deletes the specified TargetHttpProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
@@ -262,11 +259,12 @@ public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest re
   /**
    * Deletes the specified TargetHttpProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
@@ -278,18 +276,21 @@ public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetHttpProxyCallable() { + public final UnaryCallable + deleteTargetHttpProxyCallable() { return stub.deleteTargetHttpProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(targetHttpProxy);
    * }
    * 
@@ -298,23 +299,26 @@ public final UnaryCallable deleteTa * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetHttpProxy getTargetHttpProxy(ProjectTargetHttpProxyName targetHttpProxy) { + public final TargetHttpProxy getTargetHttpProxy( + ProjectGlobalTargetHttpProxyName targetHttpProxy) { GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder() - .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) - .build(); + .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) + .build(); return getTargetHttpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   TargetHttpProxy response = targetHttpProxyClient.getTargetHttpProxy(targetHttpProxy.toString());
    * }
    * 
@@ -326,20 +330,20 @@ public final TargetHttpProxy getTargetHttpProxy(ProjectTargetHttpProxyName targe public final TargetHttpProxy getTargetHttpProxy(String targetHttpProxy) { GetTargetHttpProxyHttpRequest request = - GetTargetHttpProxyHttpRequest.newBuilder() - .setTargetHttpProxy(targetHttpProxy) - .build(); + GetTargetHttpProxyHttpRequest.newBuilder().setTargetHttpProxy(targetHttpProxy).build(); return getTargetHttpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder()
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
@@ -357,12 +361,14 @@ public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request.
+   * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+   *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest.newBuilder()
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
@@ -373,15 +379,18 @@ public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable getTargetHttpProxyCallable() { + public final UnaryCallable + getTargetHttpProxyCallable() { return stub.getTargetHttpProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * Creates a TargetHttpProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -391,32 +400,40 @@ public final UnaryCallable getTa
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) + * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. + * (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpProxy(String requestId, ProjectName project, TargetHttpProxy targetHttpProxyResource) { + public final Operation insertTargetHttpProxy( + String requestId, ProjectName project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setTargetHttpProxyResource(targetHttpProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setTargetHttpProxyResource(targetHttpProxyResource) + .build(); return insertTargetHttpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * Creates a TargetHttpProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -426,32 +443,40 @@ public final Operation insertTargetHttpProxy(String requestId, ProjectName proje
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) + * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. + * (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpProxy(String requestId, String project, TargetHttpProxy targetHttpProxyResource) { + public final Operation insertTargetHttpProxy( + String requestId, String project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setTargetHttpProxyResource(targetHttpProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setTargetHttpProxyResource(targetHttpProxyResource) + .build(); return insertTargetHttpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * Creates a TargetHttpProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -476,9 +501,11 @@ public final Operation insertTargetHttpProxy(InsertTargetHttpProxyHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a TargetHttpProxy resource in the specified project using the data included in the request.
+   * Creates a TargetHttpProxy resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -496,7 +523,8 @@ public final Operation insertTargetHttpProxy(InsertTargetHttpProxyHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable insertTargetHttpProxyCallable() { + public final UnaryCallable + insertTargetHttpProxyCallable() { return stub.insertTargetHttpProxyCallable(); } @@ -504,7 +532,8 @@ public final UnaryCallable insertTa /** * Retrieves the list of TargetHttpProxy resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +550,8 @@ public final UnaryCallable insertTa
   public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ProjectName project) {
     ListTargetHttpProxiesHttpRequest request =
         ListTargetHttpProxiesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listTargetHttpProxies(request);
   }
 
@@ -530,7 +559,8 @@ public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ProjectNam
   /**
    * Retrieves the list of TargetHttpProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +576,7 @@ public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ProjectNam
   @BetaApi
   public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(String project) {
     ListTargetHttpProxiesHttpRequest request =
-        ListTargetHttpProxiesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListTargetHttpProxiesHttpRequest.newBuilder().setProject(project).build();
     return listTargetHttpProxies(request);
   }
 
@@ -556,7 +584,8 @@ public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(String pro
   /**
    * Retrieves the list of TargetHttpProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +602,17 @@ public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(String pro
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ListTargetHttpProxiesHttpRequest request) {
-    return listTargetHttpProxiesPagedCallable()
-        .call(request);
+  public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(
+      ListTargetHttpProxiesHttpRequest request) {
+    return listTargetHttpProxiesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of TargetHttpProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +628,8 @@ public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(ListTarget
    * 
*/ @BetaApi - public final UnaryCallable listTargetHttpProxiesPagedCallable() { + public final UnaryCallable + listTargetHttpProxiesPagedCallable() { return stub.listTargetHttpProxiesPagedCallable(); } @@ -606,7 +637,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,7 +661,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetHttpProxiesCallable() { + public final UnaryCallable + listTargetHttpProxiesCallable() { return stub.listTargetHttpProxiesCallable(); } @@ -637,7 +670,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -647,24 +681,31 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpProxy(String requestId, ProjectTargetHttpProxyName targetHttpProxy, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpProxy( + String requestId, + ProjectTargetHttpProxyName targetHttpProxy, + UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) - .setUrlMapReferenceResource(urlMapReferenceResource) - .build(); + .setRequestId(requestId) + .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); return setUrlMapTargetHttpProxy(request); } @@ -672,7 +713,8 @@ public final Operation setUrlMapTargetHttpProxy(String requestId, ProjectTargetH /** * Changes the URL map for TargetHttpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -682,24 +724,29 @@ public final Operation setUrlMapTargetHttpProxy(String requestId, ProjectTargetH
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpProxy(String requestId, String targetHttpProxy, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpProxy( + String requestId, String targetHttpProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetHttpProxy(targetHttpProxy) - .setUrlMapReferenceResource(urlMapReferenceResource) - .build(); + .setRequestId(requestId) + .setTargetHttpProxy(targetHttpProxy) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); return setUrlMapTargetHttpProxy(request); } @@ -707,7 +754,8 @@ public final Operation setUrlMapTargetHttpProxy(String requestId, String targetH /** * Changes the URL map for TargetHttpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -734,7 +782,8 @@ public final Operation setUrlMapTargetHttpProxy(SetUrlMapTargetHttpProxyHttpRequ
   /**
    * Changes the URL map for TargetHttpProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
    *   String requestId = "";
@@ -752,12 +801,13 @@ public final Operation setUrlMapTargetHttpProxy(SetUrlMapTargetHttpProxyHttpRequ
    * 
*/ @BetaApi - public final UnaryCallable setUrlMapTargetHttpProxyCallable() { + public final UnaryCallable + setUrlMapTargetHttpProxyCallable() { return stub.setUrlMapTargetHttpProxyCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -786,12 +836,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListTargetHttpProxiesPagedResponse extends AbstractPagedListResponse< - ListTargetHttpProxiesHttpRequest, - TargetHttpProxyList, - TargetHttpProxy, - ListTargetHttpProxiesPage, - ListTargetHttpProxiesFixedSizeCollection> { + public static class ListTargetHttpProxiesPagedResponse + extends AbstractPagedListResponse< + ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, TargetHttpProxy, + ListTargetHttpProxiesPage, ListTargetHttpProxiesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -811,15 +859,12 @@ public ListTargetHttpProxiesPagedResponse apply(ListTargetHttpProxiesPage input) private ListTargetHttpProxiesPagedResponse(ListTargetHttpProxiesPage page) { super(page, ListTargetHttpProxiesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetHttpProxiesPage extends AbstractPage< - ListTargetHttpProxiesHttpRequest, - TargetHttpProxyList, - TargetHttpProxy, - ListTargetHttpProxiesPage> { + public static class ListTargetHttpProxiesPage + extends AbstractPage< + ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, TargetHttpProxy, + ListTargetHttpProxiesPage> { private ListTargetHttpProxiesPage( PageContext context, @@ -844,20 +889,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetHttpProxiesFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetHttpProxiesHttpRequest, - TargetHttpProxyList, - TargetHttpProxy, - ListTargetHttpProxiesPage, - ListTargetHttpProxiesFixedSizeCollection> { + public static class ListTargetHttpProxiesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, TargetHttpProxy, + ListTargetHttpProxiesPage, ListTargetHttpProxiesFixedSizeCollection> { - private ListTargetHttpProxiesFixedSizeCollection(List pages, int collectionSize) { + private ListTargetHttpProxiesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -870,7 +910,5 @@ protected ListTargetHttpProxiesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetHttpProxiesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java index ee5261de5b9b..9d7c1cd4ac3c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetHttpProxyList() { this.warning = null; } - private TargetHttpProxyList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpProxyList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpProxyList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpProxyList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpProxyList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetHttpProxyList build() { - - - - - return new TargetHttpProxyList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetHttpProxyList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetHttpProxyList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetHttpProxyList) { TargetHttpProxyList that = (TargetHttpProxyList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java index 60166ba94348..b833538d30c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; import com.google.cloud.compute.v1.stub.TargetHttpProxyStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetHttpProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetHttpProxy to 30 seconds: * *

  * 
@@ -85,84 +63,69 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetHttpProxySettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteTargetHttpProxy.
-   */
-  public UnaryCallSettings deleteTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to deleteTargetHttpProxy. */
+  public UnaryCallSettings
+      deleteTargetHttpProxySettings() {
     return ((TargetHttpProxyStubSettings) getStubSettings()).deleteTargetHttpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetHttpProxy.
-   */
-  public UnaryCallSettings getTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetHttpProxy. */
+  public UnaryCallSettings
+      getTargetHttpProxySettings() {
     return ((TargetHttpProxyStubSettings) getStubSettings()).getTargetHttpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetHttpProxy.
-   */
-  public UnaryCallSettings insertTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetHttpProxy. */
+  public UnaryCallSettings
+      insertTargetHttpProxySettings() {
     return ((TargetHttpProxyStubSettings) getStubSettings()).insertTargetHttpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetHttpProxies.
-   */
-  public PagedCallSettings listTargetHttpProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetHttpProxies. */
+  public PagedCallSettings<
+          ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, ListTargetHttpProxiesPagedResponse>
+      listTargetHttpProxiesSettings() {
     return ((TargetHttpProxyStubSettings) getStubSettings()).listTargetHttpProxiesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setUrlMapTargetHttpProxy.
-   */
-  public UnaryCallSettings setUrlMapTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to setUrlMapTargetHttpProxy. */
+  public UnaryCallSettings
+      setUrlMapTargetHttpProxySettings() {
     return ((TargetHttpProxyStubSettings) getStubSettings()).setUrlMapTargetHttpProxySettings();
   }
 
-
-  public static final TargetHttpProxySettings create(TargetHttpProxyStubSettings stub) throws IOException {
+  public static final TargetHttpProxySettings create(TargetHttpProxyStubSettings stub)
+      throws IOException {
     return new TargetHttpProxySettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetHttpProxyStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetHttpProxyStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetHttpProxyStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetHttpProxyStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetHttpProxyStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetHttpProxyStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetHttpProxyStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -175,23 +138,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetHttpProxyStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -200,9 +157,7 @@ protected TargetHttpProxySettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetHttpProxySettings.
-   */
+  /** Builder for TargetHttpProxySettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -224,53 +179,52 @@ protected Builder(TargetHttpProxyStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetHttpProxyStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetHttpProxyStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteTargetHttpProxy. - */ - public UnaryCallSettings.Builder deleteTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetHttpProxy. */ + public UnaryCallSettings.Builder + deleteTargetHttpProxySettings() { return getStubSettingsBuilder().deleteTargetHttpProxySettings(); } - /** - * Returns the builder for the settings used for calls to getTargetHttpProxy. - */ - public UnaryCallSettings.Builder getTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to getTargetHttpProxy. */ + public UnaryCallSettings.Builder + getTargetHttpProxySettings() { return getStubSettingsBuilder().getTargetHttpProxySettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetHttpProxy. - */ - public UnaryCallSettings.Builder insertTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetHttpProxy. */ + public UnaryCallSettings.Builder + insertTargetHttpProxySettings() { return getStubSettingsBuilder().insertTargetHttpProxySettings(); } - /** - * Returns the builder for the settings used for calls to listTargetHttpProxies. - */ - public PagedCallSettings.Builder listTargetHttpProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetHttpProxies. */ + public PagedCallSettings.Builder< + ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, + ListTargetHttpProxiesPagedResponse> + listTargetHttpProxiesSettings() { return getStubSettingsBuilder().listTargetHttpProxiesSettings(); } - /** - * Returns the builder for the settings used for calls to setUrlMapTargetHttpProxy. - */ - public UnaryCallSettings.Builder setUrlMapTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to setUrlMapTargetHttpProxy. */ + public UnaryCallSettings.Builder + setUrlMapTargetHttpProxySettings() { return getStubSettingsBuilder().setUrlMapTargetHttpProxySettings(); } @@ -279,4 +233,4 @@ public TargetHttpProxySettings build() throws IOException { return new TargetHttpProxySettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java index 0b05858e24c5..498d2a85d90c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetHttpsProxiesSetSslCertificatesRequest() { this.sslCertificates = null; } - - private TargetHttpsProxiesSetSslCertificatesRequest( - List sslCertificates - ) { + private TargetHttpsProxiesSetSslCertificatesRequest(List sslCertificates) { this.sslCertificates = sslCertificates; } @@ -76,22 +71,24 @@ public List getSslCertificatesList() { return sslCertificates; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpsProxiesSetSslCertificatesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpsProxiesSetSslCertificatesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpsProxiesSetSslCertificatesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpsProxiesSetSslCertificatesRequest(); } @@ -130,11 +127,8 @@ public Builder addSslCertificates(String sslCertificates) { return this; } - public TargetHttpsProxiesSetSslCertificatesRequest build() { - return new TargetHttpsProxiesSetSslCertificatesRequest( - sslCertificates - ); + return new TargetHttpsProxiesSetSslCertificatesRequest(sslCertificates); } public Builder clone() { @@ -147,7 +141,8 @@ public Builder clone() { @Override public String toString() { return "TargetHttpsProxiesSetSslCertificatesRequest{" - + "sslCertificates=" + sslCertificates + + "sslCertificates=" + + sslCertificates + "}"; } @@ -157,18 +152,15 @@ public boolean equals(Object o) { return true; } if (o instanceof TargetHttpsProxiesSetSslCertificatesRequest) { - TargetHttpsProxiesSetSslCertificatesRequest that = (TargetHttpsProxiesSetSslCertificatesRequest) o; - return - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) - ; + TargetHttpsProxiesSetSslCertificatesRequest that = + (TargetHttpsProxiesSetSslCertificatesRequest) o; + return Objects.equals(this.sslCertificates, that.getSslCertificatesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - sslCertificates - ); + return Objects.hash(sslCertificates); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java index 8a3cbb58a1f5..fb8271a9a200 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -39,6 +38,7 @@ public final class TargetHttpsProxy implements ApiMessage { private final String name; private final String selfLink; private final List sslCertificates; + private final String sslPolicy; private final String urlMap; private TargetHttpsProxy() { @@ -49,10 +49,10 @@ private TargetHttpsProxy() { this.name = null; this.selfLink = null; this.sslCertificates = null; + this.sslPolicy = null; this.urlMap = null; } - private TargetHttpsProxy( String creationTimestamp, String description, @@ -61,8 +61,8 @@ private TargetHttpsProxy( String name, String selfLink, List sslCertificates, - String urlMap - ) { + String sslPolicy, + String urlMap) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -70,6 +70,7 @@ private TargetHttpsProxy( this.name = name; this.selfLink = selfLink; this.sslCertificates = sslCertificates; + this.sslPolicy = sslPolicy; this.urlMap = urlMap; } @@ -77,7 +78,8 @@ private TargetHttpsProxy( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -101,6 +103,9 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("sslCertificates", stringList.build()); } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } if (fieldNames.contains("urlMap") && urlMap != null) { fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); } @@ -130,6 +135,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("sslCertificates")) { return String.valueOf(sslCertificates); } + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } if (fieldName.equals("urlMap")) { return String.valueOf(urlMap); } @@ -170,26 +178,32 @@ public List getSslCertificatesList() { return sslCertificates; } + public String getSslPolicy() { + return sslPolicy; + } + public String getUrlMap() { return urlMap; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpsProxy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpsProxy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpsProxy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpsProxy(); } @@ -202,6 +216,7 @@ public static class Builder { private String name; private String selfLink; private List sslCertificates; + private String sslPolicy; private String urlMap; Builder() {} @@ -229,6 +244,9 @@ public Builder mergeFrom(TargetHttpsProxy other) { if (other.getSslCertificatesList() != null) { this.sslCertificates = other.sslCertificates; } + if (other.getSslPolicy() != null) { + this.sslPolicy = other.sslPolicy; + } if (other.getUrlMap() != null) { this.urlMap = other.urlMap; } @@ -243,6 +261,7 @@ public Builder mergeFrom(TargetHttpsProxy other) { this.name = source.name; this.selfLink = source.selfLink; this.sslCertificates = source.sslCertificates; + this.sslPolicy = source.sslPolicy; this.urlMap = source.urlMap; } @@ -317,6 +336,15 @@ public Builder addSslCertificates(String sslCertificates) { return this; } + public String getSslPolicy() { + return sslPolicy; + } + + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + public String getUrlMap() { return urlMap; } @@ -326,25 +354,18 @@ public Builder setUrlMap(String urlMap) { return this; } - public TargetHttpsProxy build() { - - - - - - return new TargetHttpsProxy( - creationTimestamp, - description, - id, - kind, - name, - selfLink, - sslCertificates, - urlMap - ); + creationTimestamp, + description, + id, + kind, + name, + selfLink, + sslCertificates, + sslPolicy, + urlMap); } public Builder clone() { @@ -356,6 +377,7 @@ public Builder clone() { newBuilder.setName(this.name); newBuilder.setSelfLink(this.selfLink); newBuilder.addAllSslCertificates(this.sslCertificates); + newBuilder.setSslPolicy(this.sslPolicy); newBuilder.setUrlMap(this.urlMap); return newBuilder; } @@ -364,14 +386,32 @@ public Builder clone() { @Override public String toString() { return "TargetHttpsProxy{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "selfLink=" + selfLink + ", " - + "sslCertificates=" + sslCertificates + ", " - + "urlMap=" + urlMap + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "sslCertificates=" + + sslCertificates + + ", " + + "sslPolicy=" + + sslPolicy + + ", " + + "urlMap=" + + urlMap + "}"; } @@ -382,16 +422,15 @@ public boolean equals(Object o) { } if (o instanceof TargetHttpsProxy) { TargetHttpsProxy that = (TargetHttpsProxy) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) && - Objects.equals(this.urlMap, that.getUrlMap()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sslCertificates, that.getSslCertificatesList()) + && Objects.equals(this.sslPolicy, that.getSslPolicy()) + && Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @@ -399,14 +438,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - selfLink, - sslCertificates, - urlMap - ); + creationTimestamp, + description, + id, + kind, + name, + selfLink, + sslCertificates, + sslPolicy, + urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java index 295aeb957ada..ba82eb73abd5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetHttpsProxyStub; import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,41 @@ *

  * 
  * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
- *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+ *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
  *   String requestId = "";
  *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the targetHttpsProxyClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the targetHttpsProxyClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetHttpsProxySettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class TargetHttpsProxyClient implements BackgroundResource {
   private final TargetHttpsProxySettings settings;
   private final TargetHttpsProxyStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetHttpsProxyClient with default settings.
-   */
+  /** Constructs an instance of TargetHttpsProxyClient with default settings. */
   public static final TargetHttpsProxyClient create() throws IOException {
     return create(TargetHttpsProxySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetHttpsProxyClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetHttpsProxyClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetHttpsProxyClient create(TargetHttpsProxySettings settings) throws IOException {
+  public static final TargetHttpsProxyClient create(TargetHttpsProxySettings settings)
+      throws IOException {
     return new TargetHttpsProxyClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetHttpsProxyClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetHttpsProxySettings}.
+   * Constructs an instance of TargetHttpsProxyClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use TargetHttpsProxySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetHttpsProxyClient create(TargetHttpsProxyStub stub) {
@@ -144,9 +130,9 @@ public static final TargetHttpsProxyClient create(TargetHttpsProxyStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetHttpsProxyClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetHttpsProxyClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetHttpsProxyClient(TargetHttpsProxySettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +154,41 @@ public TargetHttpsProxyStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified TargetHttpsProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpsProxy(ProjectTargetHttpsProxyName targetHttpsProxy, String requestId) { + public final Operation deleteTargetHttpsProxy( + ProjectGlobalTargetHttpsProxyName targetHttpsProxy, String requestId) { DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) - .build(); + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) + .build(); return deleteTargetHttpsProxy(request); } @@ -205,21 +196,26 @@ public final Operation deleteTargetHttpsProxy(ProjectTargetHttpsProxyName target /** * Deletes the specified TargetHttpsProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString(), requestId);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +223,9 @@ public final Operation deleteTargetHttpsProxy(String targetHttpsProxy, String re DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) - .build(); + .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) + .build(); return deleteTargetHttpsProxy(request); } @@ -237,10 +233,11 @@ public final Operation deleteTargetHttpsProxy(String targetHttpsProxy, String re /** * Deletes the specified TargetHttpsProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
@@ -262,10 +259,11 @@ public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest
   /**
    * Deletes the specified TargetHttpsProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
@@ -278,18 +276,21 @@ public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetHttpsProxyCallable() { + public final UnaryCallable + deleteTargetHttpsProxyCallable() { return stub.deleteTargetHttpsProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(targetHttpsProxy);
    * }
    * 
@@ -298,23 +299,26 @@ public final UnaryCallable deleteT * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetHttpsProxy getTargetHttpsProxy(ProjectTargetHttpsProxyName targetHttpsProxy) { + public final TargetHttpsProxy getTargetHttpsProxy( + ProjectGlobalTargetHttpsProxyName targetHttpsProxy) { GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .build(); + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .build(); return getTargetHttpsProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   TargetHttpsProxy response = targetHttpsProxyClient.getTargetHttpsProxy(targetHttpsProxy.toString());
    * }
    * 
@@ -326,20 +330,20 @@ public final TargetHttpsProxy getTargetHttpsProxy(ProjectTargetHttpsProxyName ta public final TargetHttpsProxy getTargetHttpsProxy(String targetHttpsProxy) { GetTargetHttpsProxyHttpRequest request = - GetTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy) - .build(); + GetTargetHttpsProxyHttpRequest.newBuilder().setTargetHttpsProxy(targetHttpsProxy).build(); return getTargetHttpsProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * by making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
    *     .build();
@@ -357,12 +361,14 @@ public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request.
+   * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies
+   * by making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
    *   GetTargetHttpsProxyHttpRequest request = GetTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
    *     .build();
@@ -373,15 +379,18 @@ public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable getTargetHttpsProxyCallable() { + public final UnaryCallable + getTargetHttpsProxyCallable() { return stub.getTargetHttpsProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * Creates a TargetHttpsProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   String requestId = "";
@@ -391,32 +400,41 @@ public final UnaryCallable get
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==) + * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS + * proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies + * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpsProxy(String requestId, ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { + public final Operation insertTargetHttpsProxy( + String requestId, ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setTargetHttpsProxyResource(targetHttpsProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setTargetHttpsProxyResource(targetHttpsProxyResource) + .build(); return insertTargetHttpsProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * Creates a TargetHttpsProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   String requestId = "";
@@ -426,32 +444,41 @@ public final Operation insertTargetHttpsProxy(String requestId, ProjectName proj
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==) + * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS + * proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies + * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetHttpsProxy(String requestId, String project, TargetHttpsProxy targetHttpsProxyResource) { + public final Operation insertTargetHttpsProxy( + String requestId, String project, TargetHttpsProxy targetHttpsProxyResource) { InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setTargetHttpsProxyResource(targetHttpsProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setTargetHttpsProxyResource(targetHttpsProxyResource) + .build(); return insertTargetHttpsProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * Creates a TargetHttpsProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   String requestId = "";
@@ -476,9 +503,11 @@ public final Operation insertTargetHttpsProxy(InsertTargetHttpsProxyHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a TargetHttpsProxy resource in the specified project using the data included in the request.
+   * Creates a TargetHttpsProxy resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   String requestId = "";
@@ -496,7 +525,8 @@ public final Operation insertTargetHttpsProxy(InsertTargetHttpsProxyHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertTargetHttpsProxyCallable() { + public final UnaryCallable + insertTargetHttpsProxyCallable() { return stub.insertTargetHttpsProxyCallable(); } @@ -504,7 +534,8 @@ public final UnaryCallable insertT /** * Retrieves the list of TargetHttpsProxy resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +552,8 @@ public final UnaryCallable insertT
   public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ProjectName project) {
     ListTargetHttpsProxiesHttpRequest request =
         ListTargetHttpsProxiesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listTargetHttpsProxies(request);
   }
 
@@ -530,7 +561,8 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ProjectN
   /**
    * Retrieves the list of TargetHttpsProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +578,7 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ProjectN
   @BetaApi
   public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(String project) {
     ListTargetHttpsProxiesHttpRequest request =
-        ListTargetHttpsProxiesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListTargetHttpsProxiesHttpRequest.newBuilder().setProject(project).build();
     return listTargetHttpsProxies(request);
   }
 
@@ -556,7 +586,8 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(String p
   /**
    * Retrieves the list of TargetHttpsProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +604,17 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(String p
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ListTargetHttpsProxiesHttpRequest request) {
-    return listTargetHttpsProxiesPagedCallable()
-        .call(request);
+  public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(
+      ListTargetHttpsProxiesHttpRequest request) {
+    return listTargetHttpsProxiesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of TargetHttpsProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +630,8 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(ListTarg
    * 
*/ @BetaApi - public final UnaryCallable listTargetHttpsProxiesPagedCallable() { + public final UnaryCallable + listTargetHttpsProxiesPagedCallable() { return stub.listTargetHttpsProxiesPagedCallable(); } @@ -606,7 +639,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,7 +663,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetHttpsProxiesCallable() { + public final UnaryCallable + listTargetHttpsProxiesCallable() { return stub.listTargetHttpsProxiesCallable(); } @@ -637,7 +672,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -647,24 +683,34 @@ public final UnaryCallable
* - * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates + * resource for. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetHttpsProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetHttpsProxy(ProjectTargetHttpsProxyName targetHttpsProxy, String requestId, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetHttpsProxy( + ProjectTargetHttpsProxyName targetHttpsProxy, + String requestId, + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) - .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource) - .build(); + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) + .setTargetHttpsProxiesSetSslCertificatesRequestResource( + targetHttpsProxiesSetSslCertificatesRequestResource) + .build(); return setSslCertificatesTargetHttpsProxy(request); } @@ -672,7 +718,8 @@ public final Operation setSslCertificatesTargetHttpsProxy(ProjectTargetHttpsProx /** * Replaces SslCertificates for TargetHttpsProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -682,24 +729,34 @@ public final Operation setSslCertificatesTargetHttpsProxy(ProjectTargetHttpsProx
    * }
    * 
* - * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates + * resource for. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetHttpsProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProxy, String requestId, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetHttpsProxy( + String targetHttpsProxy, + String requestId, + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) - .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource) - .build(); + .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) + .setTargetHttpsProxiesSetSslCertificatesRequestResource( + targetHttpsProxiesSetSslCertificatesRequestResource) + .build(); return setSslCertificatesTargetHttpsProxy(request); } @@ -707,7 +764,8 @@ public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProx /** * Replaces SslCertificates for TargetHttpsProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -726,7 +784,8 @@ public final Operation setSslCertificatesTargetHttpsProxy(String targetHttpsProx
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setSslCertificatesTargetHttpsProxy(SetSslCertificatesTargetHttpsProxyHttpRequest request) {
+  public final Operation setSslCertificatesTargetHttpsProxy(
+      SetSslCertificatesTargetHttpsProxyHttpRequest request) {
     return setSslCertificatesTargetHttpsProxyCallable().call(request);
   }
 
@@ -734,7 +793,8 @@ public final Operation setSslCertificatesTargetHttpsProxy(SetSslCertificatesTarg
   /**
    * Replaces SslCertificates for TargetHttpsProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -752,15 +812,168 @@ public final Operation setSslCertificatesTargetHttpsProxy(SetSslCertificatesTarg
    * 
*/ @BetaApi - public final UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { + public final UnaryCallable + setSslCertificatesTargetHttpsProxyCallable() { return stub.setSslCertificatesTargetHttpsProxyCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(targetHttpsProxy, requestId, sslPolicyReferenceResource);
+   * }
+   * 
+ * + * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicyReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslPolicyTargetHttpsProxy( + ProjectGlobalTargetHttpsProxyName targetHttpsProxy, + String requestId, + SslPolicyReference sslPolicyReferenceResource) { + + SetSslPolicyTargetHttpsProxyHttpRequest request = + SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) + .setSslPolicyReferenceResource(sslPolicyReferenceResource) + .build(); + return setSslPolicyTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(targetHttpsProxy.toString(), requestId, sslPolicyReferenceResource);
+   * }
+   * 
+ * + * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicyReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslPolicyTargetHttpsProxy( + String targetHttpsProxy, String requestId, SslPolicyReference sslPolicyReferenceResource) { + + SetSslPolicyTargetHttpsProxyHttpRequest request = + SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) + .setSslPolicyReferenceResource(sslPolicyReferenceResource) + .build(); + return setSslPolicyTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   SetSslPolicyTargetHttpsProxyHttpRequest request = SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
+   *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
+   *     .build();
+   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslPolicyTargetHttpsProxy( + SetSslPolicyTargetHttpsProxyHttpRequest request) { + return setSslPolicyTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   SetSslPolicyTargetHttpsProxyHttpRequest request = SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setRequestId(requestId)
+   *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpsProxyClient.setSslPolicyTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setSslPolicyTargetHttpsProxyCallable() { + return stub.setSslPolicyTargetHttpsProxyCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Changes the URL map for TargetHttpsProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -771,23 +984,30 @@ public final UnaryCallable
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpsProxy(ProjectTargetHttpsProxyName targetHttpsProxy, String requestId, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpsProxy( + ProjectTargetHttpsProxyName targetHttpsProxy, + String requestId, + UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) - .setUrlMapReferenceResource(urlMapReferenceResource) - .build(); + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setRequestId(requestId) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); return setUrlMapTargetHttpsProxy(request); } @@ -795,7 +1015,8 @@ public final Operation setUrlMapTargetHttpsProxy(ProjectTargetHttpsProxyName tar /** * Changes the URL map for TargetHttpsProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -806,23 +1027,28 @@ public final Operation setUrlMapTargetHttpsProxy(ProjectTargetHttpsProxyName tar
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, String requestId, UrlMapReference urlMapReferenceResource) { + public final Operation setUrlMapTargetHttpsProxy( + String targetHttpsProxy, String requestId, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() - .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) - .setUrlMapReferenceResource(urlMapReferenceResource) - .build(); + .setTargetHttpsProxy(targetHttpsProxy) + .setRequestId(requestId) + .setUrlMapReferenceResource(urlMapReferenceResource) + .build(); return setUrlMapTargetHttpsProxy(request); } @@ -830,7 +1056,8 @@ public final Operation setUrlMapTargetHttpsProxy(String targetHttpsProxy, String /** * Changes the URL map for TargetHttpsProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -857,7 +1084,8 @@ public final Operation setUrlMapTargetHttpsProxy(SetUrlMapTargetHttpsProxyHttpRe
   /**
    * Changes the URL map for TargetHttpsProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
@@ -875,12 +1103,13 @@ public final Operation setUrlMapTargetHttpsProxy(SetUrlMapTargetHttpsProxyHttpRe
    * 
*/ @BetaApi - public final UnaryCallable setUrlMapTargetHttpsProxyCallable() { + public final UnaryCallable + setUrlMapTargetHttpsProxyCallable() { return stub.setUrlMapTargetHttpsProxyCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -909,15 +1138,14 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListTargetHttpsProxiesPagedResponse extends AbstractPagedListResponse< - ListTargetHttpsProxiesHttpRequest, - TargetHttpsProxyList, - TargetHttpsProxy, - ListTargetHttpsProxiesPage, - ListTargetHttpsProxiesFixedSizeCollection> { + public static class ListTargetHttpsProxiesPagedResponse + extends AbstractPagedListResponse< + ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, TargetHttpsProxy, + ListTargetHttpsProxiesPage, ListTargetHttpsProxiesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListTargetHttpsProxiesPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -934,18 +1162,16 @@ public ListTargetHttpsProxiesPagedResponse apply(ListTargetHttpsProxiesPage inpu private ListTargetHttpsProxiesPagedResponse(ListTargetHttpsProxiesPage page) { super(page, ListTargetHttpsProxiesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetHttpsProxiesPage extends AbstractPage< - ListTargetHttpsProxiesHttpRequest, - TargetHttpsProxyList, - TargetHttpsProxy, - ListTargetHttpsProxiesPage> { + public static class ListTargetHttpsProxiesPage + extends AbstractPage< + ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, TargetHttpsProxy, + ListTargetHttpsProxiesPage> { private ListTargetHttpsProxiesPage( - PageContext context, + PageContext + context, TargetHttpsProxyList response) { super(context, response); } @@ -956,31 +1182,28 @@ private static ListTargetHttpsProxiesPage createEmptyPage() { @Override protected ListTargetHttpsProxiesPage createPage( - PageContext context, + PageContext + context, TargetHttpsProxyList response) { return new ListTargetHttpsProxiesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetHttpsProxiesFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetHttpsProxiesHttpRequest, - TargetHttpsProxyList, - TargetHttpsProxy, - ListTargetHttpsProxiesPage, - ListTargetHttpsProxiesFixedSizeCollection> { + public static class ListTargetHttpsProxiesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, TargetHttpsProxy, + ListTargetHttpsProxiesPage, ListTargetHttpsProxiesFixedSizeCollection> { - private ListTargetHttpsProxiesFixedSizeCollection(List pages, int collectionSize) { + private ListTargetHttpsProxiesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -993,7 +1216,5 @@ protected ListTargetHttpsProxiesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetHttpsProxiesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java index 55a860d89018..634c86cfb5fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetHttpsProxyList() { this.warning = null; } - private TargetHttpsProxyList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetHttpsProxyList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetHttpsProxyList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetHttpsProxyList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetHttpsProxyList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetHttpsProxyList build() { - - - - - return new TargetHttpsProxyList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetHttpsProxyList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetHttpsProxyList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetHttpsProxyList) { TargetHttpsProxyList that = (TargetHttpsProxyList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java index 5ec56a20d47e..60c674602372 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetHttpsProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetHttpsProxy to 30 seconds: * *

  * 
@@ -85,91 +63,84 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetHttpsProxySettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteTargetHttpsProxy.
-   */
-  public UnaryCallSettings deleteTargetHttpsProxySettings() {
+  /** Returns the object with the settings used for calls to deleteTargetHttpsProxy. */
+  public UnaryCallSettings
+      deleteTargetHttpsProxySettings() {
     return ((TargetHttpsProxyStubSettings) getStubSettings()).deleteTargetHttpsProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetHttpsProxy.
-   */
-  public UnaryCallSettings getTargetHttpsProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetHttpsProxy. */
+  public UnaryCallSettings
+      getTargetHttpsProxySettings() {
     return ((TargetHttpsProxyStubSettings) getStubSettings()).getTargetHttpsProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetHttpsProxy.
-   */
-  public UnaryCallSettings insertTargetHttpsProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetHttpsProxy. */
+  public UnaryCallSettings
+      insertTargetHttpsProxySettings() {
     return ((TargetHttpsProxyStubSettings) getStubSettings()).insertTargetHttpsProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetHttpsProxies.
-   */
-  public PagedCallSettings listTargetHttpsProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetHttpsProxies. */
+  public PagedCallSettings<
+          ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList,
+          ListTargetHttpsProxiesPagedResponse>
+      listTargetHttpsProxiesSettings() {
     return ((TargetHttpsProxyStubSettings) getStubSettings()).listTargetHttpsProxiesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy.
-   */
-  public UnaryCallSettings setSslCertificatesTargetHttpsProxySettings() {
-    return ((TargetHttpsProxyStubSettings) getStubSettings()).setSslCertificatesTargetHttpsProxySettings();
+  /** Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy. */
+  public UnaryCallSettings
+      setSslCertificatesTargetHttpsProxySettings() {
+    return ((TargetHttpsProxyStubSettings) getStubSettings())
+        .setSslCertificatesTargetHttpsProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setUrlMapTargetHttpsProxy.
-   */
-  public UnaryCallSettings setUrlMapTargetHttpsProxySettings() {
-    return ((TargetHttpsProxyStubSettings) getStubSettings()).setUrlMapTargetHttpsProxySettings();
+  /** Returns the object with the settings used for calls to setSslPolicyTargetHttpsProxy. */
+  public UnaryCallSettings
+      setSslPolicyTargetHttpsProxySettings() {
+    return ((TargetHttpsProxyStubSettings) getStubSettings())
+        .setSslPolicyTargetHttpsProxySettings();
   }
 
+  /** Returns the object with the settings used for calls to setUrlMapTargetHttpsProxy. */
+  public UnaryCallSettings
+      setUrlMapTargetHttpsProxySettings() {
+    return ((TargetHttpsProxyStubSettings) getStubSettings()).setUrlMapTargetHttpsProxySettings();
+  }
 
-  public static final TargetHttpsProxySettings create(TargetHttpsProxyStubSettings stub) throws IOException {
+  public static final TargetHttpsProxySettings create(TargetHttpsProxyStubSettings stub)
+      throws IOException {
     return new TargetHttpsProxySettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetHttpsProxyStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetHttpsProxyStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetHttpsProxyStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetHttpsProxyStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetHttpsProxyStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetHttpsProxyStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetHttpsProxyStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +153,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetHttpsProxyStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +172,7 @@ protected TargetHttpsProxySettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetHttpsProxySettings.
-   */
+  /** Builder for TargetHttpsProxySettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +194,66 @@ protected Builder(TargetHttpsProxyStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetHttpsProxyStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetHttpsProxyStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteTargetHttpsProxy. - */ - public UnaryCallSettings.Builder deleteTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetHttpsProxy. */ + public UnaryCallSettings.Builder + deleteTargetHttpsProxySettings() { return getStubSettingsBuilder().deleteTargetHttpsProxySettings(); } - /** - * Returns the builder for the settings used for calls to getTargetHttpsProxy. - */ - public UnaryCallSettings.Builder getTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to getTargetHttpsProxy. */ + public UnaryCallSettings.Builder + getTargetHttpsProxySettings() { return getStubSettingsBuilder().getTargetHttpsProxySettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetHttpsProxy. - */ - public UnaryCallSettings.Builder insertTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetHttpsProxy. */ + public UnaryCallSettings.Builder + insertTargetHttpsProxySettings() { return getStubSettingsBuilder().insertTargetHttpsProxySettings(); } - /** - * Returns the builder for the settings used for calls to listTargetHttpsProxies. - */ - public PagedCallSettings.Builder listTargetHttpsProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetHttpsProxies. */ + public PagedCallSettings.Builder< + ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, + ListTargetHttpsProxiesPagedResponse> + listTargetHttpsProxiesSettings() { return getStubSettingsBuilder().listTargetHttpsProxiesSettings(); } /** * Returns the builder for the settings used for calls to setSslCertificatesTargetHttpsProxy. */ - public UnaryCallSettings.Builder setSslCertificatesTargetHttpsProxySettings() { + public UnaryCallSettings.Builder + setSslCertificatesTargetHttpsProxySettings() { return getStubSettingsBuilder().setSslCertificatesTargetHttpsProxySettings(); } - /** - * Returns the builder for the settings used for calls to setUrlMapTargetHttpsProxy. - */ - public UnaryCallSettings.Builder setUrlMapTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to setSslPolicyTargetHttpsProxy. */ + public UnaryCallSettings.Builder + setSslPolicyTargetHttpsProxySettings() { + return getStubSettingsBuilder().setSslPolicyTargetHttpsProxySettings(); + } + + /** Returns the builder for the settings used for calls to setUrlMapTargetHttpsProxy. */ + public UnaryCallSettings.Builder + setUrlMapTargetHttpsProxySettings() { return getStubSettingsBuilder().setUrlMapTargetHttpsProxySettings(); } @@ -293,4 +262,4 @@ public TargetHttpsProxySettings build() throws IOException { return new TargetHttpsProxySettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java index 04afb03c2800..2a90d043466a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private TargetInstance() { this.zone = null; } - private TargetInstance( String creationTimestamp, String description, @@ -64,8 +60,7 @@ private TargetInstance( String name, String natPolicy, String selfLink, - String zone - ) { + String zone) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -81,7 +76,8 @@ private TargetInstance( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -184,22 +180,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetInstance prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetInstance getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetInstance DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetInstance(); } @@ -342,27 +340,10 @@ public Builder setZone(String zone) { return this; } - public TargetInstance build() { - - - - - - - return new TargetInstance( - creationTimestamp, - description, - id, - instance, - kind, - name, - natPolicy, - selfLink, - zone - ); + creationTimestamp, description, id, instance, kind, name, natPolicy, selfLink, zone); } public Builder clone() { @@ -383,15 +364,32 @@ public Builder clone() { @Override public String toString() { return "TargetInstance{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "instance=" + instance + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "natPolicy=" + natPolicy + ", " - + "selfLink=" + selfLink + ", " - + "zone=" + zone + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "instance=" + + instance + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "natPolicy=" + + natPolicy + + ", " + + "selfLink=" + + selfLink + + ", " + + "zone=" + + zone + "}"; } @@ -402,17 +400,15 @@ public boolean equals(Object o) { } if (o instanceof TargetInstance) { TargetInstance that = (TargetInstance) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.natPolicy, that.getNatPolicy()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.natPolicy, that.getNatPolicy()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -420,15 +416,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - id, - instance, - kind, - name, - natPolicy, - selfLink, - zone - ); + creationTimestamp, description, id, instance, kind, name, natPolicy, selfLink, zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java index 45c8e006014b..8a1ed62c3cbb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private TargetInstanceAggregatedList() { this.warning = null; } - private TargetInstanceAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetInstanceAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetInstanceAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetInstanceAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetInstanceAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetInstanceAggregatedList build() { - - - - - return new TargetInstanceAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetInstanceAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "TargetInstanceAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof TargetInstanceAggregatedList) { TargetInstanceAggregatedList that = (TargetInstanceAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java index 1443cb5cd549..fce65be815b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetInstanceStub; import com.google.cloud.compute.v1.stub.TargetInstanceStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,33 +50,32 @@ *

* *

Note: close() needs to be called on the targetInstanceClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetInstanceSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class TargetInstanceClient implements BackgroundResource {
   private final TargetInstanceSettings settings;
   private final TargetInstanceStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetInstanceClient with default settings.
-   */
+  /** Constructs an instance of TargetInstanceClient with default settings. */
   public static final TargetInstanceClient create() throws IOException {
     return create(TargetInstanceSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetInstanceClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetInstanceClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetInstanceClient create(TargetInstanceSettings settings) throws IOException {
+  public static final TargetInstanceClient create(TargetInstanceSettings settings)
+      throws IOException {
     return new TargetInstanceClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetInstanceClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetInstanceSettings}.
+   * Constructs an instance of TargetInstanceClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use TargetInstanceSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetInstanceClient create(TargetInstanceStub stub) {
@@ -144,9 +129,9 @@ public static final TargetInstanceClient create(TargetInstanceStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetInstanceClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetInstanceClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetInstanceClient(TargetInstanceSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +153,12 @@ public TargetInstanceStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,11 +172,12 @@ public TargetInstanceStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(ProjectName project) {
+  public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(
+      ProjectName project) {
     AggregatedListTargetInstancesHttpRequest request =
         AggregatedListTargetInstancesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListTargetInstances(request);
   }
 
@@ -199,7 +185,8 @@ public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInst
   /**
    * Retrieves an aggregated list of target instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -213,11 +200,10 @@ public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(String project) {
+  public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(
+      String project) {
     AggregatedListTargetInstancesHttpRequest request =
-        AggregatedListTargetInstancesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListTargetInstancesHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListTargetInstances(request);
   }
 
@@ -225,7 +211,8 @@ public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInst
   /**
    * Retrieves an aggregated list of target instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +229,17 @@ public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInst
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(AggregatedListTargetInstancesHttpRequest request) {
-    return aggregatedListTargetInstancesPagedCallable()
-        .call(request);
+  public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances(
+      AggregatedListTargetInstancesHttpRequest request) {
+    return aggregatedListTargetInstancesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target instances.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +255,9 @@ public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInst
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListTargetInstancesPagedCallable() { + public final UnaryCallable< + AggregatedListTargetInstancesHttpRequest, AggregatedListTargetInstancesPagedResponse> + aggregatedListTargetInstancesPagedCallable() { return stub.aggregatedListTargetInstancesPagedCallable(); } @@ -275,7 +265,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +289,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListTargetInstancesCallable() { + public final UnaryCallable + aggregatedListTargetInstancesCallable() { return stub.aggregatedListTargetInstancesCallable(); } @@ -306,7 +298,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
@@ -315,22 +308,27 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetInstance Name of the TargetInstance resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetInstance(String requestId, ProjectZoneTargetInstanceName targetInstance) { + public final Operation deleteTargetInstance( + String requestId, ProjectZoneTargetInstanceName targetInstance) { DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetInstance(targetInstance == null ? null : targetInstance.toString()) - .build(); + .setRequestId(requestId) + .setTargetInstance(targetInstance == null ? null : targetInstance.toString()) + .build(); return deleteTargetInstance(request); } @@ -338,7 +336,8 @@ public final Operation deleteTargetInstance(String requestId, ProjectZoneTargetI /** * Deletes the specified TargetInstance resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
@@ -347,11 +346,15 @@ public final Operation deleteTargetInstance(String requestId, ProjectZoneTargetI
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetInstance Name of the TargetInstance resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -360,9 +363,9 @@ public final Operation deleteTargetInstance(String requestId, String targetInsta DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetInstance(targetInstance) - .build(); + .setRequestId(requestId) + .setTargetInstance(targetInstance) + .build(); return deleteTargetInstance(request); } @@ -370,7 +373,8 @@ public final Operation deleteTargetInstance(String requestId, String targetInsta /** * Deletes the specified TargetInstance resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
@@ -395,7 +399,8 @@ public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest requ
   /**
    * Deletes the specified TargetInstance resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   String requestId = "";
@@ -411,15 +416,18 @@ public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetInstanceCallable() { + public final UnaryCallable + deleteTargetInstanceCallable() { return stub.deleteTargetInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. + * Returns the specified TargetInstance resource. Get a list of available target instances by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
@@ -435,16 +443,18 @@ public final TargetInstance getTargetInstance(ProjectZoneTargetInstanceName targ
 
     GetTargetInstanceHttpRequest request =
         GetTargetInstanceHttpRequest.newBuilder()
-        .setTargetInstance(targetInstance == null ? null : targetInstance.toString())
-        .build();
+            .setTargetInstance(targetInstance == null ? null : targetInstance.toString())
+            .build();
     return getTargetInstance(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request.
+   * Returns the specified TargetInstance resource. Get a list of available target instances by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
@@ -459,17 +469,17 @@ public final TargetInstance getTargetInstance(ProjectZoneTargetInstanceName targ
   public final TargetInstance getTargetInstance(String targetInstance) {
 
     GetTargetInstanceHttpRequest request =
-        GetTargetInstanceHttpRequest.newBuilder()
-        .setTargetInstance(targetInstance)
-        .build();
+        GetTargetInstanceHttpRequest.newBuilder().setTargetInstance(targetInstance).build();
     return getTargetInstance(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request.
+   * Returns the specified TargetInstance resource. Get a list of available target instances by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
@@ -490,9 +500,11 @@ public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request.
+   * Returns the specified TargetInstance resource. Get a list of available target instances by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
@@ -506,15 +518,18 @@ public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getTargetInstanceCallable() { + public final UnaryCallable + getTargetInstanceCallable() { return stub.getTargetInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * Creates a TargetInstance resource in the specified project and zone using the data included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -525,31 +540,40 @@ public final UnaryCallable getTarg
    * 
* * @param zone Name of the zone scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint + * instance that terminates traffic of certain protocols. (== resource_for + * beta.targetInstances ==) (== resource_for v1.targetInstances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetInstance(ProjectZoneName zone, String requestId, TargetInstance targetInstanceResource) { + public final Operation insertTargetInstance( + ProjectZoneName zone, String requestId, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() - .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setTargetInstanceResource(targetInstanceResource) - .build(); + .setZone(zone == null ? null : zone.toString()) + .setRequestId(requestId) + .setTargetInstanceResource(targetInstanceResource) + .build(); return insertTargetInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * Creates a TargetInstance resource in the specified project and zone using the data included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -560,31 +584,40 @@ public final Operation insertTargetInstance(ProjectZoneName zone, String request
    * 
* * @param zone Name of the zone scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==) + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint + * instance that terminates traffic of certain protocols. (== resource_for + * beta.targetInstances ==) (== resource_for v1.targetInstances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetInstance(String zone, String requestId, TargetInstance targetInstanceResource) { + public final Operation insertTargetInstance( + String zone, String requestId, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setTargetInstanceResource(targetInstanceResource) - .build(); + .setZone(zone) + .setRequestId(requestId) + .setTargetInstanceResource(targetInstanceResource) + .build(); return insertTargetInstance(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * Creates a TargetInstance resource in the specified project and zone using the data included in + * the request. + * + *

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -609,9 +642,11 @@ public final Operation insertTargetInstance(InsertTargetInstanceHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a TargetInstance resource in the specified project and zone using the data included in the request.
+   * Creates a TargetInstance resource in the specified project and zone using the data included in
+   * the request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -629,7 +664,8 @@ public final Operation insertTargetInstance(InsertTargetInstanceHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable insertTargetInstanceCallable() { + public final UnaryCallable + insertTargetInstanceCallable() { return stub.insertTargetInstanceCallable(); } @@ -637,7 +673,8 @@ public final UnaryCallable insertTar /** * Retrieves a list of TargetInstance resources available to the specified project and zone. * - * Sample code: + *

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -654,8 +691,8 @@ public final UnaryCallable insertTar
   public final ListTargetInstancesPagedResponse listTargetInstances(ProjectZoneName zone) {
     ListTargetInstancesHttpRequest request =
         ListTargetInstancesHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listTargetInstances(request);
   }
 
@@ -663,7 +700,8 @@ public final ListTargetInstancesPagedResponse listTargetInstances(ProjectZoneNam
   /**
    * Retrieves a list of TargetInstance resources available to the specified project and zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -679,9 +717,7 @@ public final ListTargetInstancesPagedResponse listTargetInstances(ProjectZoneNam
   @BetaApi
   public final ListTargetInstancesPagedResponse listTargetInstances(String zone) {
     ListTargetInstancesHttpRequest request =
-        ListTargetInstancesHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListTargetInstancesHttpRequest.newBuilder().setZone(zone).build();
     return listTargetInstances(request);
   }
 
@@ -689,7 +725,8 @@ public final ListTargetInstancesPagedResponse listTargetInstances(String zone) {
   /**
    * Retrieves a list of TargetInstance resources available to the specified project and zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -706,16 +743,17 @@ public final ListTargetInstancesPagedResponse listTargetInstances(String zone) {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetInstancesPagedResponse listTargetInstances(ListTargetInstancesHttpRequest request) {
-    return listTargetInstancesPagedCallable()
-        .call(request);
+  public final ListTargetInstancesPagedResponse listTargetInstances(
+      ListTargetInstancesHttpRequest request) {
+    return listTargetInstancesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of TargetInstance resources available to the specified project and zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -731,7 +769,8 @@ public final ListTargetInstancesPagedResponse listTargetInstances(ListTargetInst
    * 
*/ @BetaApi - public final UnaryCallable listTargetInstancesPagedCallable() { + public final UnaryCallable + listTargetInstancesPagedCallable() { return stub.listTargetInstancesPagedCallable(); } @@ -739,7 +778,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -762,12 +802,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetInstancesCallable() { + public final UnaryCallable + listTargetInstancesCallable() { return stub.listTargetInstancesCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -796,23 +837,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListTargetInstancesPagedResponse extends AbstractPagedListResponse< - AggregatedListTargetInstancesHttpRequest, - TargetInstanceAggregatedList, - TargetInstancesScopedList, - AggregatedListTargetInstancesPage, - AggregatedListTargetInstancesFixedSizeCollection> { + public static class AggregatedListTargetInstancesPagedResponse + extends AbstractPagedListResponse< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList, AggregatedListTargetInstancesPage, + AggregatedListTargetInstancesFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListTargetInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListTargetInstancesPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListTargetInstancesPage, AggregatedListTargetInstancesPagedResponse>() { @Override - public AggregatedListTargetInstancesPagedResponse apply(AggregatedListTargetInstancesPage input) { + public AggregatedListTargetInstancesPagedResponse apply( + AggregatedListTargetInstancesPage input) { return new AggregatedListTargetInstancesPagedResponse(input); } }); @@ -821,18 +867,18 @@ public AggregatedListTargetInstancesPagedResponse apply(AggregatedListTargetInst private AggregatedListTargetInstancesPagedResponse(AggregatedListTargetInstancesPage page) { super(page, AggregatedListTargetInstancesFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListTargetInstancesPage extends AbstractPage< - AggregatedListTargetInstancesHttpRequest, - TargetInstanceAggregatedList, - TargetInstancesScopedList, - AggregatedListTargetInstancesPage> { + public static class AggregatedListTargetInstancesPage + extends AbstractPage< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList, AggregatedListTargetInstancesPage> { private AggregatedListTargetInstancesPage( - PageContext context, + PageContext< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList> + context, TargetInstanceAggregatedList response) { super(context, response); } @@ -843,31 +889,33 @@ private static AggregatedListTargetInstancesPage createEmptyPage() { @Override protected AggregatedListTargetInstancesPage createPage( - PageContext context, + PageContext< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList> + context, TargetInstanceAggregatedList response) { return new AggregatedListTargetInstancesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListTargetInstancesFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListTargetInstancesHttpRequest, - TargetInstanceAggregatedList, - TargetInstancesScopedList, - AggregatedListTargetInstancesPage, - AggregatedListTargetInstancesFixedSizeCollection> { + public static class AggregatedListTargetInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + TargetInstancesScopedList, AggregatedListTargetInstancesPage, + AggregatedListTargetInstancesFixedSizeCollection> { - private AggregatedListTargetInstancesFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListTargetInstancesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -880,15 +928,12 @@ protected AggregatedListTargetInstancesFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListTargetInstancesFixedSizeCollection(pages, collectionSize); } - - } - public static class ListTargetInstancesPagedResponse extends AbstractPagedListResponse< - ListTargetInstancesHttpRequest, - TargetInstanceList, - TargetInstance, - ListTargetInstancesPage, - ListTargetInstancesFixedSizeCollection> { + + public static class ListTargetInstancesPagedResponse + extends AbstractPagedListResponse< + ListTargetInstancesHttpRequest, TargetInstanceList, TargetInstance, + ListTargetInstancesPage, ListTargetInstancesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -908,15 +953,12 @@ public ListTargetInstancesPagedResponse apply(ListTargetInstancesPage input) { private ListTargetInstancesPagedResponse(ListTargetInstancesPage page) { super(page, ListTargetInstancesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetInstancesPage extends AbstractPage< - ListTargetInstancesHttpRequest, - TargetInstanceList, - TargetInstance, - ListTargetInstancesPage> { + public static class ListTargetInstancesPage + extends AbstractPage< + ListTargetInstancesHttpRequest, TargetInstanceList, TargetInstance, + ListTargetInstancesPage> { private ListTargetInstancesPage( PageContext context, @@ -941,20 +983,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetInstancesFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetInstancesHttpRequest, - TargetInstanceList, - TargetInstance, - ListTargetInstancesPage, - ListTargetInstancesFixedSizeCollection> { + public static class ListTargetInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetInstancesHttpRequest, TargetInstanceList, TargetInstance, + ListTargetInstancesPage, ListTargetInstancesFixedSizeCollection> { - private ListTargetInstancesFixedSizeCollection(List pages, int collectionSize) { + private ListTargetInstancesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -967,7 +1004,5 @@ protected ListTargetInstancesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetInstancesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java index feacb6ef081e..62be4396490b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetInstanceList() { this.warning = null; } - private TargetInstanceList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetInstanceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetInstanceList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetInstanceList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetInstanceList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetInstanceList build() { - - - - - return new TargetInstanceList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetInstanceList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetInstanceList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetInstanceList) { TargetInstanceList that = (TargetInstanceList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java deleted file mode 100644 index 743d148acb6a..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class TargetInstanceName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String targetInstance; - private final String zone; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/targetInstances/{targetInstance}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private TargetInstanceName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - targetInstance = Preconditions.checkNotNull(builder.getTargetInstance()); - zone = Preconditions.checkNotNull(builder.getZone()); - } - - public static TargetInstanceName of( - String project, - String targetInstance, - String zone - ) { - return newBuilder() - .setProject(project) - .setTargetInstance(targetInstance) - .setZone(zone) - .build(); - } - - public static String format( - String project, - String targetInstance, - String zone - ) { - return of( - project, - targetInstance, - zone - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getTargetInstance() { - return targetInstance; - } - - public String getZone() { - return zone; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("targetInstance", targetInstance); - fieldMapBuilder.put("zone", zone); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetInstanceName parse(String formattedString) {return TargetInstanceName.parse(formattedString);} - }; - } - - public static TargetInstanceName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetInstanceName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("targetInstance"), - matchMap.get("zone") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String targetInstance; - private String zone; - - public String getProject() { - return project; - } - public String getTargetInstance() { - return targetInstance; - } - public String getZone() { - return zone; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setTargetInstance(String targetInstance) { - this.targetInstance = targetInstance; - return this; - } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - private Builder() {} - - public Builder (TargetInstanceName targetInstanceName) { - project = targetInstanceName.project; - targetInstance = targetInstanceName.targetInstance; - zone = targetInstanceName.zone; - } - - public TargetInstanceName build() { - return new TargetInstanceName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "targetInstance", targetInstance, - "zone", zone - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof TargetInstanceName) { - TargetInstanceName that = (TargetInstanceName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.targetInstance, that.getTargetInstance()) && - Objects.equals(this.zone, that.getZone()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - targetInstance, - zone - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java index 488422f16962..633344253e3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; import com.google.cloud.compute.v1.stub.TargetInstanceStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetInstance to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetInstance to 30 seconds: * *

  * 
@@ -86,84 +64,71 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetInstanceSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListTargetInstances.
-   */
-  public PagedCallSettings aggregatedListTargetInstancesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListTargetInstances. */
+  public PagedCallSettings<
+          AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+          AggregatedListTargetInstancesPagedResponse>
+      aggregatedListTargetInstancesSettings() {
     return ((TargetInstanceStubSettings) getStubSettings()).aggregatedListTargetInstancesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteTargetInstance.
-   */
-  public UnaryCallSettings deleteTargetInstanceSettings() {
+  /** Returns the object with the settings used for calls to deleteTargetInstance. */
+  public UnaryCallSettings
+      deleteTargetInstanceSettings() {
     return ((TargetInstanceStubSettings) getStubSettings()).deleteTargetInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetInstance.
-   */
-  public UnaryCallSettings getTargetInstanceSettings() {
+  /** Returns the object with the settings used for calls to getTargetInstance. */
+  public UnaryCallSettings
+      getTargetInstanceSettings() {
     return ((TargetInstanceStubSettings) getStubSettings()).getTargetInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetInstance.
-   */
-  public UnaryCallSettings insertTargetInstanceSettings() {
+  /** Returns the object with the settings used for calls to insertTargetInstance. */
+  public UnaryCallSettings
+      insertTargetInstanceSettings() {
     return ((TargetInstanceStubSettings) getStubSettings()).insertTargetInstanceSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetInstances.
-   */
-  public PagedCallSettings listTargetInstancesSettings() {
+  /** Returns the object with the settings used for calls to listTargetInstances. */
+  public PagedCallSettings<
+          ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse>
+      listTargetInstancesSettings() {
     return ((TargetInstanceStubSettings) getStubSettings()).listTargetInstancesSettings();
   }
 
-
-  public static final TargetInstanceSettings create(TargetInstanceStubSettings stub) throws IOException {
+  public static final TargetInstanceSettings create(TargetInstanceStubSettings stub)
+      throws IOException {
     return new TargetInstanceSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetInstanceStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetInstanceStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetInstanceStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetInstanceStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetInstanceStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetInstanceStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetInstanceStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -176,23 +141,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetInstanceStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -201,9 +160,7 @@ protected TargetInstanceSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetInstanceSettings.
-   */
+  /** Builder for TargetInstanceSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -225,53 +182,53 @@ protected Builder(TargetInstanceStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetInstanceStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetInstanceStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListTargetInstances. - */ - public PagedCallSettings.Builder aggregatedListTargetInstancesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListTargetInstances. */ + public PagedCallSettings.Builder< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + AggregatedListTargetInstancesPagedResponse> + aggregatedListTargetInstancesSettings() { return getStubSettingsBuilder().aggregatedListTargetInstancesSettings(); } - /** - * Returns the builder for the settings used for calls to deleteTargetInstance. - */ - public UnaryCallSettings.Builder deleteTargetInstanceSettings() { + /** Returns the builder for the settings used for calls to deleteTargetInstance. */ + public UnaryCallSettings.Builder + deleteTargetInstanceSettings() { return getStubSettingsBuilder().deleteTargetInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to getTargetInstance. - */ - public UnaryCallSettings.Builder getTargetInstanceSettings() { + /** Returns the builder for the settings used for calls to getTargetInstance. */ + public UnaryCallSettings.Builder + getTargetInstanceSettings() { return getStubSettingsBuilder().getTargetInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetInstance. - */ - public UnaryCallSettings.Builder insertTargetInstanceSettings() { + /** Returns the builder for the settings used for calls to insertTargetInstance. */ + public UnaryCallSettings.Builder + insertTargetInstanceSettings() { return getStubSettingsBuilder().insertTargetInstanceSettings(); } - /** - * Returns the builder for the settings used for calls to listTargetInstances. - */ - public PagedCallSettings.Builder listTargetInstancesSettings() { + /** Returns the builder for the settings used for calls to listTargetInstances. */ + public PagedCallSettings.Builder< + ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse> + listTargetInstancesSettings() { return getStubSettingsBuilder().listTargetInstancesSettings(); } @@ -280,4 +237,4 @@ public TargetInstanceSettings build() throws IOException { return new TargetInstanceSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java index d0558be85aee..6841771a144c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private TargetInstancesScopedList() { this.warning = null; } - - private TargetInstancesScopedList( - List targetInstances, - Warning warning - ) { + private TargetInstancesScopedList(List targetInstances, Warning warning) { this.targetInstances = targetInstances; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetInstancesScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetInstancesScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetInstancesScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetInstancesScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetInstancesScopedList build() { - return new TargetInstancesScopedList( - targetInstances, - warning - ); + return new TargetInstancesScopedList(targetInstances, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "TargetInstancesScopedList{" - + "targetInstances=" + targetInstances + ", " - + "warning=" + warning + + "targetInstances=" + + targetInstances + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof TargetInstancesScopedList) { TargetInstancesScopedList that = (TargetInstancesScopedList) o; - return - Objects.equals(this.targetInstances, that.getTargetInstancesList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.targetInstances, that.getTargetInstancesList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - targetInstances, - warning - ); + return Objects.hash(targetInstances, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java index 469b8815b44c..449ec391fcfc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -60,7 +59,6 @@ private TargetPool() { this.sessionAffinity = null; } - private TargetPool( String backupPool, String creationTimestamp, @@ -73,8 +71,7 @@ private TargetPool( String name, String region, String selfLink, - String sessionAffinity - ) { + String sessionAffinity) { this.backupPool = backupPool; this.creationTimestamp = creationTimestamp; this.description = description; @@ -96,7 +93,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backupPool", Collections.singletonList(String.valueOf(backupPool))); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -234,22 +232,24 @@ public String getSessionAffinity() { return sessionAffinity; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPool prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPool getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPool DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPool(); } @@ -450,33 +450,21 @@ public Builder setSessionAffinity(String sessionAffinity) { return this; } - public TargetPool build() { - - - - - - - - - - return new TargetPool( - backupPool, - creationTimestamp, - description, - failoverRatio, - healthChecks, - id, - instances, - kind, - name, - region, - selfLink, - sessionAffinity - ); + backupPool, + creationTimestamp, + description, + failoverRatio, + healthChecks, + id, + instances, + kind, + name, + region, + selfLink, + sessionAffinity); } public Builder clone() { @@ -500,18 +488,41 @@ public Builder clone() { @Override public String toString() { return "TargetPool{" - + "backupPool=" + backupPool + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "failoverRatio=" + failoverRatio + ", " - + "healthChecks=" + healthChecks + ", " - + "id=" + id + ", " - + "instances=" + instances + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "sessionAffinity=" + sessionAffinity + + "backupPool=" + + backupPool + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "failoverRatio=" + + failoverRatio + + ", " + + "healthChecks=" + + healthChecks + + ", " + + "id=" + + id + + ", " + + "instances=" + + instances + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "sessionAffinity=" + + sessionAffinity + "}"; } @@ -522,20 +533,18 @@ public boolean equals(Object o) { } if (o instanceof TargetPool) { TargetPool that = (TargetPool) o; - return - Objects.equals(this.backupPool, that.getBackupPool()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.failoverRatio, that.getFailoverRatio()) && - Objects.equals(this.healthChecks, that.getHealthChecksList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.instances, that.getInstancesList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sessionAffinity, that.getSessionAffinity()) - ; + return Objects.equals(this.backupPool, that.getBackupPool()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.failoverRatio, that.getFailoverRatio()) + && Objects.equals(this.healthChecks, that.getHealthChecksList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.instances, that.getInstancesList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sessionAffinity, that.getSessionAffinity()); } return false; } @@ -543,18 +552,17 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - backupPool, - creationTimestamp, - description, - failoverRatio, - healthChecks, - id, - instances, - kind, - name, - region, - selfLink, - sessionAffinity - ); + backupPool, + creationTimestamp, + description, + failoverRatio, + healthChecks, + id, + instances, + kind, + name, + region, + selfLink, + sessionAffinity); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java index 6a596ac9e736..534839707fa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private TargetPoolAggregatedList() { this.warning = null; } - private TargetPoolAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetPoolAggregatedList build() { - - - - - return new TargetPoolAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetPoolAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "TargetPoolAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolAggregatedList) { TargetPoolAggregatedList that = (TargetPoolAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java index ab623f8f3aa7..a022b0ebd26b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetPoolStub; import com.google.cloud.compute.v1.stub.TargetPoolStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,34 +50,33 @@ * *

* - *

Note: close() needs to be called on the targetPoolClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the targetPoolClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetPoolSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -117,19 +106,14 @@ public class TargetPoolClient implements BackgroundResource {
   private final TargetPoolSettings settings;
   private final TargetPoolStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetPoolClient with default settings.
-   */
+  /** Constructs an instance of TargetPoolClient with default settings. */
   public static final TargetPoolClient create() throws IOException {
     return create(TargetPoolSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetPoolClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetPoolClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final TargetPoolClient create(TargetPoolSettings settings) throws IOException {
     return new TargetPoolClient(settings);
@@ -145,9 +129,8 @@ public static final TargetPoolClient create(TargetPoolStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetPoolClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetPoolClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected TargetPoolClient(TargetPoolSettings settings) throws IOException {
     this.settings = settings;
@@ -169,12 +152,12 @@ public TargetPoolStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Adds health check URLs to a target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -185,23 +168,30 @@ public TargetPoolStub getStub() {
    * 
* * @param targetPool Name of the target pool to add a health check to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addHealthCheckTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + public final Operation addHealthCheckTargetPool( + ProjectRegionTargetPoolName targetPool, + String requestId, + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) - .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) - .build(); + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) + .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) + .build(); return addHealthCheckTargetPool(request); } @@ -209,7 +199,8 @@ public final Operation addHealthCheckTargetPool(ProjectRegionTargetPoolName targ /** * Adds health check URLs to a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -220,23 +211,30 @@ public final Operation addHealthCheckTargetPool(ProjectRegionTargetPoolName targ
    * 
* * @param targetPool Name of the target pool to add a health check to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addHealthCheckTargetPool(String targetPool, String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { + public final Operation addHealthCheckTargetPool( + String targetPool, + String requestId, + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) - .build(); + .setTargetPool(targetPool) + .setRequestId(requestId) + .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) + .build(); return addHealthCheckTargetPool(request); } @@ -244,7 +242,8 @@ public final Operation addHealthCheckTargetPool(String targetPool, String reques /** * Adds health check URLs to a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -271,7 +270,8 @@ public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequ
   /**
    * Adds health check URLs to a target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -289,7 +289,8 @@ public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequ
    * 
*/ @BetaApi - public final UnaryCallable addHealthCheckTargetPoolCallable() { + public final UnaryCallable + addHealthCheckTargetPoolCallable() { return stub.addHealthCheckTargetPoolCallable(); } @@ -297,7 +298,8 @@ public final UnaryCallable addHe /** * Adds an instance to a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -308,23 +310,30 @@ public final UnaryCallable addHe
    * 
* * @param targetPool Name of the TargetPool resource to add instances to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstanceTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + public final Operation addInstanceTargetPool( + ProjectRegionTargetPoolName targetPool, + String requestId, + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) - .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) - .build(); + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) + .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) + .build(); return addInstanceTargetPool(request); } @@ -332,7 +341,8 @@ public final Operation addInstanceTargetPool(ProjectRegionTargetPoolName targetP /** * Adds an instance to a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -343,23 +353,30 @@ public final Operation addInstanceTargetPool(ProjectRegionTargetPoolName targetP
    * 
* * @param targetPool Name of the TargetPool resource to add instances to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation addInstanceTargetPool(String targetPool, String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + public final Operation addInstanceTargetPool( + String targetPool, + String requestId, + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) - .build(); + .setTargetPool(targetPool) + .setRequestId(requestId) + .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) + .build(); return addInstanceTargetPool(request); } @@ -367,7 +384,8 @@ public final Operation addInstanceTargetPool(String targetPool, String requestId /** * Adds an instance to a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -394,7 +412,8 @@ public final Operation addInstanceTargetPool(AddInstanceTargetPoolHttpRequest re
   /**
    * Adds an instance to a target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -412,7 +431,8 @@ public final Operation addInstanceTargetPool(AddInstanceTargetPoolHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable addInstanceTargetPoolCallable() { + public final UnaryCallable + addInstanceTargetPoolCallable() { return stub.addInstanceTargetPoolCallable(); } @@ -420,7 +440,8 @@ public final UnaryCallable addInsta /** * Retrieves an aggregated list of target pools. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -434,11 +455,12 @@ public final UnaryCallable addInsta
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(ProjectName project) {
+  public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(
+      ProjectName project) {
     AggregatedListTargetPoolsHttpRequest request =
         AggregatedListTargetPoolsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListTargetPools(request);
   }
 
@@ -446,7 +468,8 @@ public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(Pr
   /**
    * Retrieves an aggregated list of target pools.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -462,9 +485,7 @@ public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(Pr
   @BetaApi
   public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(String project) {
     AggregatedListTargetPoolsHttpRequest request =
-        AggregatedListTargetPoolsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListTargetPoolsHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListTargetPools(request);
   }
 
@@ -472,7 +493,8 @@ public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(St
   /**
    * Retrieves an aggregated list of target pools.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -489,16 +511,17 @@ public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(AggregatedListTargetPoolsHttpRequest request) {
-    return aggregatedListTargetPoolsPagedCallable()
-        .call(request);
+  public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(
+      AggregatedListTargetPoolsHttpRequest request) {
+    return aggregatedListTargetPoolsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target pools.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -514,7 +537,9 @@ public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(Ag
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListTargetPoolsPagedCallable() { + public final UnaryCallable< + AggregatedListTargetPoolsHttpRequest, AggregatedListTargetPoolsPagedResponse> + aggregatedListTargetPoolsPagedCallable() { return stub.aggregatedListTargetPoolsPagedCallable(); } @@ -522,7 +547,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -545,7 +571,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListTargetPoolsCallable() { + public final UnaryCallable + aggregatedListTargetPoolsCallable() { return stub.aggregatedListTargetPoolsCallable(); } @@ -553,7 +580,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -563,21 +591,26 @@ public final UnaryCallable
* * @param targetPool Name of the TargetPool resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetPool(ProjectRegionTargetPoolName targetPool, String requestId) { + public final Operation deleteTargetPool( + ProjectRegionTargetPoolName targetPool, String requestId) { DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) - .build(); + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) + .build(); return deleteTargetPool(request); } @@ -585,7 +618,8 @@ public final Operation deleteTargetPool(ProjectRegionTargetPoolName targetPool, /** * Deletes the specified target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -595,11 +629,15 @@ public final Operation deleteTargetPool(ProjectRegionTargetPoolName targetPool,
    * 
* * @param targetPool Name of the TargetPool resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -607,9 +645,9 @@ public final Operation deleteTargetPool(String targetPool, String requestId) { DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .build(); + .setTargetPool(targetPool) + .setRequestId(requestId) + .build(); return deleteTargetPool(request); } @@ -617,7 +655,8 @@ public final Operation deleteTargetPool(String targetPool, String requestId) { /** * Deletes the specified target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -642,7 +681,8 @@ public final Operation deleteTargetPool(DeleteTargetPoolHttpRequest request) {
   /**
    * Deletes the specified target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -664,9 +704,11 @@ public final UnaryCallable deleteTargetP
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target pool. Get a list of available target pools by making a list() request.
+   * Returns the specified target pool. Get a list of available target pools by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -682,16 +724,18 @@ public final TargetPool getTargetPool(ProjectRegionTargetPoolName targetPool) {
 
     GetTargetPoolHttpRequest request =
         GetTargetPoolHttpRequest.newBuilder()
-        .setTargetPool(targetPool == null ? null : targetPool.toString())
-        .build();
+            .setTargetPool(targetPool == null ? null : targetPool.toString())
+            .build();
     return getTargetPool(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target pool. Get a list of available target pools by making a list() request.
+   * Returns the specified target pool. Get a list of available target pools by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -706,17 +750,17 @@ public final TargetPool getTargetPool(ProjectRegionTargetPoolName targetPool) {
   public final TargetPool getTargetPool(String targetPool) {
 
     GetTargetPoolHttpRequest request =
-        GetTargetPoolHttpRequest.newBuilder()
-        .setTargetPool(targetPool)
-        .build();
+        GetTargetPoolHttpRequest.newBuilder().setTargetPool(targetPool).build();
     return getTargetPool(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target pool. Get a list of available target pools by making a list() request.
+   * Returns the specified target pool. Get a list of available target pools by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -737,9 +781,11 @@ public final TargetPool getTargetPool(GetTargetPoolHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target pool. Get a list of available target pools by making a list() request.
+   * Returns the specified target pool. Get a list of available target pools by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -759,9 +805,11 @@ public final UnaryCallable getTargetPoolCa
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
+   * Gets the most recent health check results for each IP for the instance that is referenced by
+   * the given target pool.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -775,21 +823,24 @@ public final UnaryCallable getTargetPoolCa
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final TargetPoolInstanceHealth getHealthTargetPool(ProjectRegionTargetPoolName targetPool, InstanceReference instanceReferenceResource) {
+  public final TargetPoolInstanceHealth getHealthTargetPool(
+      ProjectRegionTargetPoolName targetPool, InstanceReference instanceReferenceResource) {
 
     GetHealthTargetPoolHttpRequest request =
         GetHealthTargetPoolHttpRequest.newBuilder()
-        .setTargetPool(targetPool == null ? null : targetPool.toString())
-        .setInstanceReferenceResource(instanceReferenceResource)
-        .build();
+            .setTargetPool(targetPool == null ? null : targetPool.toString())
+            .setInstanceReferenceResource(instanceReferenceResource)
+            .build();
     return getHealthTargetPool(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
+   * Gets the most recent health check results for each IP for the instance that is referenced by
+   * the given target pool.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -803,21 +854,24 @@ public final TargetPoolInstanceHealth getHealthTargetPool(ProjectRegionTargetPoo
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final TargetPoolInstanceHealth getHealthTargetPool(String targetPool, InstanceReference instanceReferenceResource) {
+  public final TargetPoolInstanceHealth getHealthTargetPool(
+      String targetPool, InstanceReference instanceReferenceResource) {
 
     GetHealthTargetPoolHttpRequest request =
         GetHealthTargetPoolHttpRequest.newBuilder()
-        .setTargetPool(targetPool)
-        .setInstanceReferenceResource(instanceReferenceResource)
-        .build();
+            .setTargetPool(targetPool)
+            .setInstanceReferenceResource(instanceReferenceResource)
+            .build();
     return getHealthTargetPool(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
+   * Gets the most recent health check results for each IP for the instance that is referenced by
+   * the given target pool.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -834,15 +888,18 @@ public final TargetPoolInstanceHealth getHealthTargetPool(String targetPool, Ins
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final TargetPoolInstanceHealth getHealthTargetPool(GetHealthTargetPoolHttpRequest request) {
+  public final TargetPoolInstanceHealth getHealthTargetPool(
+      GetHealthTargetPoolHttpRequest request) {
     return getHealthTargetPoolCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
+   * Gets the most recent health check results for each IP for the instance that is referenced by
+   * the given target pool.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -858,15 +915,18 @@ public final TargetPoolInstanceHealth getHealthTargetPool(GetHealthTargetPoolHtt
    * 
*/ @BetaApi - public final UnaryCallable getHealthTargetPoolCallable() { + public final UnaryCallable + getHealthTargetPoolCallable() { return stub.getHealthTargetPoolCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target pool in the specified project and region using the data included in the request. + * Creates a target pool in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
@@ -876,32 +936,41 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) + * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an + * associated HttpHealthCheck resource, and the fallback target pool. (== resource_for + * beta.targetPools ==) (== resource_for v1.targetPools ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetPool(String requestId, ProjectRegionName region, TargetPool targetPoolResource) { + public final Operation insertTargetPool( + String requestId, ProjectRegionName region, TargetPool targetPoolResource) { InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setTargetPoolResource(targetPoolResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setTargetPoolResource(targetPoolResource) + .build(); return insertTargetPool(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target pool in the specified project and region using the data included in the request. + * Creates a target pool in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
@@ -911,32 +980,41 @@ public final Operation insertTargetPool(String requestId, ProjectRegionName regi
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. - * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) + * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an + * associated HttpHealthCheck resource, and the fallback target pool. (== resource_for + * beta.targetPools ==) (== resource_for v1.targetPools ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetPool(String requestId, String region, TargetPool targetPoolResource) { + public final Operation insertTargetPool( + String requestId, String region, TargetPool targetPoolResource) { InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setTargetPoolResource(targetPoolResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setTargetPoolResource(targetPoolResource) + .build(); return insertTargetPool(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target pool in the specified project and region using the data included in the request. + * Creates a target pool in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
@@ -961,9 +1039,11 @@ public final Operation insertTargetPool(InsertTargetPoolHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a target pool in the specified project and region using the data included in the request.
+   * Creates a target pool in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   String requestId = "";
@@ -989,7 +1069,8 @@ public final UnaryCallable insertTargetP
   /**
    * Retrieves a list of target pools available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -1006,8 +1087,8 @@ public final UnaryCallable insertTargetP
   public final ListTargetPoolsPagedResponse listTargetPools(ProjectRegionName region) {
     ListTargetPoolsHttpRequest request =
         ListTargetPoolsHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listTargetPools(request);
   }
 
@@ -1015,7 +1096,8 @@ public final ListTargetPoolsPagedResponse listTargetPools(ProjectRegionName regi
   /**
    * Retrieves a list of target pools available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -1031,9 +1113,7 @@ public final ListTargetPoolsPagedResponse listTargetPools(ProjectRegionName regi
   @BetaApi
   public final ListTargetPoolsPagedResponse listTargetPools(String region) {
     ListTargetPoolsHttpRequest request =
-        ListTargetPoolsHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListTargetPoolsHttpRequest.newBuilder().setRegion(region).build();
     return listTargetPools(request);
   }
 
@@ -1041,7 +1121,8 @@ public final ListTargetPoolsPagedResponse listTargetPools(String region) {
   /**
    * Retrieves a list of target pools available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -1059,15 +1140,15 @@ public final ListTargetPoolsPagedResponse listTargetPools(String region) {
    */
   @BetaApi
   public final ListTargetPoolsPagedResponse listTargetPools(ListTargetPoolsHttpRequest request) {
-    return listTargetPoolsPagedCallable()
-        .call(request);
+    return listTargetPoolsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of target pools available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -1083,7 +1164,8 @@ public final ListTargetPoolsPagedResponse listTargetPools(ListTargetPoolsHttpReq
    * 
*/ @BetaApi - public final UnaryCallable listTargetPoolsPagedCallable() { + public final UnaryCallable + listTargetPoolsPagedCallable() { return stub.listTargetPoolsPagedCallable(); } @@ -1091,7 +1173,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -1122,7 +1205,8 @@ public final UnaryCallable listTarge
   /**
    * Removes health check URL from a target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1133,23 +1217,31 @@ public final UnaryCallable listTarge
    * 
* * @param targetPool Name of the target pool to remove health checks from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeHealthCheckTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + public final Operation removeHealthCheckTargetPool( + ProjectRegionTargetPoolName targetPool, + String requestId, + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) - .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource) - .build(); + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) + .setTargetPoolsRemoveHealthCheckRequestResource( + targetPoolsRemoveHealthCheckRequestResource) + .build(); return removeHealthCheckTargetPool(request); } @@ -1157,7 +1249,8 @@ public final Operation removeHealthCheckTargetPool(ProjectRegionTargetPoolName t /** * Removes health check URL from a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1168,23 +1261,31 @@ public final Operation removeHealthCheckTargetPool(ProjectRegionTargetPoolName t
    * 
* * @param targetPool Name of the target pool to remove health checks from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeHealthCheckTargetPool(String targetPool, String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { + public final Operation removeHealthCheckTargetPool( + String targetPool, + String requestId, + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource) - .build(); + .setTargetPool(targetPool) + .setRequestId(requestId) + .setTargetPoolsRemoveHealthCheckRequestResource( + targetPoolsRemoveHealthCheckRequestResource) + .build(); return removeHealthCheckTargetPool(request); } @@ -1192,7 +1293,8 @@ public final Operation removeHealthCheckTargetPool(String targetPool, String req /** * Removes health check URL from a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1211,7 +1313,8 @@ public final Operation removeHealthCheckTargetPool(String targetPool, String req
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation removeHealthCheckTargetPool(RemoveHealthCheckTargetPoolHttpRequest request) {
+  public final Operation removeHealthCheckTargetPool(
+      RemoveHealthCheckTargetPoolHttpRequest request) {
     return removeHealthCheckTargetPoolCallable().call(request);
   }
 
@@ -1219,7 +1322,8 @@ public final Operation removeHealthCheckTargetPool(RemoveHealthCheckTargetPoolHt
   /**
    * Removes health check URL from a target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1237,7 +1341,8 @@ public final Operation removeHealthCheckTargetPool(RemoveHealthCheckTargetPoolHt
    * 
*/ @BetaApi - public final UnaryCallable removeHealthCheckTargetPoolCallable() { + public final UnaryCallable + removeHealthCheckTargetPoolCallable() { return stub.removeHealthCheckTargetPoolCallable(); } @@ -1245,7 +1350,8 @@ public final UnaryCallable re /** * Removes instance URL from a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1256,23 +1362,30 @@ public final UnaryCallable re
    * 
* * @param targetPool Name of the TargetPool resource to remove instances from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstanceTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + public final Operation removeInstanceTargetPool( + ProjectRegionTargetPoolName targetPool, + String requestId, + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) - .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) - .build(); + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) + .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) + .build(); return removeInstanceTargetPool(request); } @@ -1280,7 +1393,8 @@ public final Operation removeInstanceTargetPool(ProjectRegionTargetPoolName targ /** * Removes instance URL from a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1291,23 +1405,30 @@ public final Operation removeInstanceTargetPool(ProjectRegionTargetPoolName targ
    * 
* * @param targetPool Name of the TargetPool resource to remove instances from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation removeInstanceTargetPool(String targetPool, String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { + public final Operation removeInstanceTargetPool( + String targetPool, + String requestId, + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) - .build(); + .setTargetPool(targetPool) + .setRequestId(requestId) + .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) + .build(); return removeInstanceTargetPool(request); } @@ -1315,7 +1436,8 @@ public final Operation removeInstanceTargetPool(String targetPool, String reques /** * Removes instance URL from a target pool. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1342,7 +1464,8 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ
   /**
    * Removes instance URL from a target pool.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1360,7 +1483,8 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ
    * 
*/ @BetaApi - public final UnaryCallable removeInstanceTargetPoolCallable() { + public final UnaryCallable + removeInstanceTargetPoolCallable() { return stub.removeInstanceTargetPoolCallable(); } @@ -1368,7 +1492,8 @@ public final UnaryCallable remov /** * Changes a backup target pool's configurations. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1380,25 +1505,33 @@ public final UnaryCallable remov
    * 
* * @param targetPool Name of the TargetPool resource to set a backup pool for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param failoverRatio New failoverRatio value for the target pool. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackupTargetPool(ProjectRegionTargetPoolName targetPool, String requestId, Float failoverRatio, TargetReference targetReferenceResource) { + public final Operation setBackupTargetPool( + ProjectRegionTargetPoolName targetPool, + String requestId, + Float failoverRatio, + TargetReference targetReferenceResource) { SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) - .setFailoverRatio(failoverRatio) - .setTargetReferenceResource(targetReferenceResource) - .build(); + .setTargetPool(targetPool == null ? null : targetPool.toString()) + .setRequestId(requestId) + .setFailoverRatio(failoverRatio) + .setTargetReferenceResource(targetReferenceResource) + .build(); return setBackupTargetPool(request); } @@ -1406,7 +1539,8 @@ public final Operation setBackupTargetPool(ProjectRegionTargetPoolName targetPoo /** * Changes a backup target pool's configurations. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1418,25 +1552,33 @@ public final Operation setBackupTargetPool(ProjectRegionTargetPoolName targetPoo
    * 
* * @param targetPool Name of the TargetPool resource to set a backup pool for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param failoverRatio New failoverRatio value for the target pool. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackupTargetPool(String targetPool, String requestId, Float failoverRatio, TargetReference targetReferenceResource) { + public final Operation setBackupTargetPool( + String targetPool, + String requestId, + Float failoverRatio, + TargetReference targetReferenceResource) { SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .setFailoverRatio(failoverRatio) - .setTargetReferenceResource(targetReferenceResource) - .build(); + .setTargetPool(targetPool) + .setRequestId(requestId) + .setFailoverRatio(failoverRatio) + .setTargetReferenceResource(targetReferenceResource) + .build(); return setBackupTargetPool(request); } @@ -1444,7 +1586,8 @@ public final Operation setBackupTargetPool(String targetPool, String requestId, /** * Changes a backup target pool's configurations. * - * Sample code: + *

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1473,7 +1616,8 @@ public final Operation setBackupTargetPool(SetBackupTargetPoolHttpRequest reques
   /**
    * Changes a backup target pool's configurations.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
@@ -1493,12 +1637,13 @@ public final Operation setBackupTargetPool(SetBackupTargetPoolHttpRequest reques
    * 
*/ @BetaApi - public final UnaryCallable setBackupTargetPoolCallable() { + public final UnaryCallable + setBackupTargetPoolCallable() { return stub.setBackupTargetPoolCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1527,15 +1672,16 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListTargetPoolsPagedResponse extends AbstractPagedListResponse< - AggregatedListTargetPoolsHttpRequest, - TargetPoolAggregatedList, - TargetPoolsScopedList, - AggregatedListTargetPoolsPage, - AggregatedListTargetPoolsFixedSizeCollection> { + public static class AggregatedListTargetPoolsPagedResponse + extends AbstractPagedListResponse< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, TargetPoolsScopedList, + AggregatedListTargetPoolsPage, AggregatedListTargetPoolsFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, + TargetPoolsScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = AggregatedListTargetPoolsPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1543,7 +1689,8 @@ public static ApiFuture createAsync( futurePage, new ApiFunction() { @Override - public AggregatedListTargetPoolsPagedResponse apply(AggregatedListTargetPoolsPage input) { + public AggregatedListTargetPoolsPagedResponse apply( + AggregatedListTargetPoolsPage input) { return new AggregatedListTargetPoolsPagedResponse(input); } }); @@ -1552,18 +1699,18 @@ public AggregatedListTargetPoolsPagedResponse apply(AggregatedListTargetPoolsPag private AggregatedListTargetPoolsPagedResponse(AggregatedListTargetPoolsPage page) { super(page, AggregatedListTargetPoolsFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListTargetPoolsPage extends AbstractPage< - AggregatedListTargetPoolsHttpRequest, - TargetPoolAggregatedList, - TargetPoolsScopedList, - AggregatedListTargetPoolsPage> { + public static class AggregatedListTargetPoolsPage + extends AbstractPage< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, TargetPoolsScopedList, + AggregatedListTargetPoolsPage> { private AggregatedListTargetPoolsPage( - PageContext context, + PageContext< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, + TargetPoolsScopedList> + context, TargetPoolAggregatedList response) { super(context, response); } @@ -1574,31 +1721,32 @@ private static AggregatedListTargetPoolsPage createEmptyPage() { @Override protected AggregatedListTargetPoolsPage createPage( - PageContext context, + PageContext< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, + TargetPoolsScopedList> + context, TargetPoolAggregatedList response) { return new AggregatedListTargetPoolsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, + TargetPoolsScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListTargetPoolsFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListTargetPoolsHttpRequest, - TargetPoolAggregatedList, - TargetPoolsScopedList, - AggregatedListTargetPoolsPage, - AggregatedListTargetPoolsFixedSizeCollection> { + public static class AggregatedListTargetPoolsFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, TargetPoolsScopedList, + AggregatedListTargetPoolsPage, AggregatedListTargetPoolsFixedSizeCollection> { - private AggregatedListTargetPoolsFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListTargetPoolsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1611,15 +1759,12 @@ protected AggregatedListTargetPoolsFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListTargetPoolsFixedSizeCollection(pages, collectionSize); } - - } - public static class ListTargetPoolsPagedResponse extends AbstractPagedListResponse< - ListTargetPoolsHttpRequest, - TargetPoolList, - TargetPool, - ListTargetPoolsPage, - ListTargetPoolsFixedSizeCollection> { + + public static class ListTargetPoolsPagedResponse + extends AbstractPagedListResponse< + ListTargetPoolsHttpRequest, TargetPoolList, TargetPool, ListTargetPoolsPage, + ListTargetPoolsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1639,15 +1784,11 @@ public ListTargetPoolsPagedResponse apply(ListTargetPoolsPage input) { private ListTargetPoolsPagedResponse(ListTargetPoolsPage page) { super(page, ListTargetPoolsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetPoolsPage extends AbstractPage< - ListTargetPoolsHttpRequest, - TargetPoolList, - TargetPool, - ListTargetPoolsPage> { + public static class ListTargetPoolsPage + extends AbstractPage< + ListTargetPoolsHttpRequest, TargetPoolList, TargetPool, ListTargetPoolsPage> { private ListTargetPoolsPage( PageContext context, @@ -1672,20 +1813,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetPoolsFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetPoolsHttpRequest, - TargetPoolList, - TargetPool, - ListTargetPoolsPage, - ListTargetPoolsFixedSizeCollection> { + public static class ListTargetPoolsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetPoolsHttpRequest, TargetPoolList, TargetPool, ListTargetPoolsPage, + ListTargetPoolsFixedSizeCollection> { - private ListTargetPoolsFixedSizeCollection(List pages, int collectionSize) { + private ListTargetPoolsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1698,7 +1834,5 @@ protected ListTargetPoolsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetPoolsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java index c2fc01490661..de34cf340414 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private TargetPoolInstanceHealth() { this.kind = null; } - - private TargetPoolInstanceHealth( - List healthStatus, - String kind - ) { + private TargetPoolInstanceHealth(List healthStatus, String kind) { this.healthStatus = healthStatus; this.kind = kind; } @@ -90,22 +85,24 @@ public String getKind() { return kind; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolInstanceHealth prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolInstanceHealth getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolInstanceHealth DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolInstanceHealth(); } @@ -158,13 +155,9 @@ public Builder setKind(String kind) { return this; } - public TargetPoolInstanceHealth build() { - return new TargetPoolInstanceHealth( - healthStatus, - kind - ); + return new TargetPoolInstanceHealth(healthStatus, kind); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "TargetPoolInstanceHealth{" - + "healthStatus=" + healthStatus + ", " - + "kind=" + kind + + "healthStatus=" + + healthStatus + + ", " + + "kind=" + + kind + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolInstanceHealth) { TargetPoolInstanceHealth that = (TargetPoolInstanceHealth) o; - return - Objects.equals(this.healthStatus, that.getHealthStatusList()) && - Objects.equals(this.kind, that.getKind()) - ; + return Objects.equals(this.healthStatus, that.getHealthStatusList()) + && Objects.equals(this.kind, that.getKind()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthStatus, - kind - ); + return Objects.hash(healthStatus, kind); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java index a2d37556b1da..a79ad4673848 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetPoolList() { this.warning = null; } - private TargetPoolList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetPoolList build() { - - - - - return new TargetPoolList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetPoolList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetPoolList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolList) { TargetPoolList that = (TargetPoolList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java deleted file mode 100644 index c421f0c889c5..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class TargetPoolName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String region; - private final String targetPool; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetPools/{targetPool}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private TargetPoolName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - targetPool = Preconditions.checkNotNull(builder.getTargetPool()); - } - - public static TargetPoolName of( - String project, - String region, - String targetPool - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setTargetPool(targetPool) - .build(); - } - - public static String format( - String project, - String region, - String targetPool - ) { - return of( - project, - region, - targetPool - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - public String getTargetPool() { - return targetPool; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldMapBuilder.put("targetPool", targetPool); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetPoolName parse(String formattedString) {return TargetPoolName.parse(formattedString);} - }; - } - - public static TargetPoolName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetPoolName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("targetPool") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String region; - private String targetPool; - - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - public String getTargetPool() { - return targetPool; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - public Builder setTargetPool(String targetPool) { - this.targetPool = targetPool; - return this; - } - - private Builder() {} - - public Builder (TargetPoolName targetPoolName) { - project = targetPoolName.project; - region = targetPoolName.region; - targetPool = targetPoolName.targetPool; - } - - public TargetPoolName build() { - return new TargetPoolName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "region", region, - "targetPool", targetPool - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof TargetPoolName) { - TargetPoolName that = (TargetPoolName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.targetPool, that.getTargetPool()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - region, - targetPool - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java index 68b94343164a..9559cdd8f5b1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; -import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; import com.google.cloud.compute.v1.stub.TargetPoolStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addHealthCheckTargetPool to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addHealthCheckTargetPool to 30 seconds: * *

  * 
@@ -86,126 +64,102 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetPoolSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to addHealthCheckTargetPool.
-   */
-  public UnaryCallSettings addHealthCheckTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to addHealthCheckTargetPool. */
+  public UnaryCallSettings
+      addHealthCheckTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).addHealthCheckTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to addInstanceTargetPool.
-   */
-  public UnaryCallSettings addInstanceTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to addInstanceTargetPool. */
+  public UnaryCallSettings
+      addInstanceTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).addInstanceTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListTargetPools.
-   */
-  public PagedCallSettings aggregatedListTargetPoolsSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListTargetPools. */
+  public PagedCallSettings<
+          AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+          AggregatedListTargetPoolsPagedResponse>
+      aggregatedListTargetPoolsSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).aggregatedListTargetPoolsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteTargetPool.
-   */
+  /** Returns the object with the settings used for calls to deleteTargetPool. */
   public UnaryCallSettings deleteTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).deleteTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetPool.
-   */
+  /** Returns the object with the settings used for calls to getTargetPool. */
   public UnaryCallSettings getTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).getTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthTargetPool.
-   */
-  public UnaryCallSettings getHealthTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to getHealthTargetPool. */
+  public UnaryCallSettings
+      getHealthTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).getHealthTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetPool.
-   */
+  /** Returns the object with the settings used for calls to insertTargetPool. */
   public UnaryCallSettings insertTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).insertTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetPools.
-   */
-  public PagedCallSettings listTargetPoolsSettings() {
+  /** Returns the object with the settings used for calls to listTargetPools. */
+  public PagedCallSettings
+      listTargetPoolsSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).listTargetPoolsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeHealthCheckTargetPool.
-   */
-  public UnaryCallSettings removeHealthCheckTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to removeHealthCheckTargetPool. */
+  public UnaryCallSettings
+      removeHealthCheckTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).removeHealthCheckTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeInstanceTargetPool.
-   */
-  public UnaryCallSettings removeInstanceTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to removeInstanceTargetPool. */
+  public UnaryCallSettings
+      removeInstanceTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).removeInstanceTargetPoolSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setBackupTargetPool.
-   */
-  public UnaryCallSettings setBackupTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to setBackupTargetPool. */
+  public UnaryCallSettings
+      setBackupTargetPoolSettings() {
     return ((TargetPoolStubSettings) getStubSettings()).setBackupTargetPoolSettings();
   }
 
-
   public static final TargetPoolSettings create(TargetPoolStubSettings stub) throws IOException {
     return new TargetPoolSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetPoolStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetPoolStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetPoolStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetPoolStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetPoolStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetPoolStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetPoolStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -218,23 +172,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetPoolStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -243,9 +191,7 @@ protected TargetPoolSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetPoolSettings.
-   */
+  /** Builder for TargetPoolSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -267,95 +213,88 @@ protected Builder(TargetPoolStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetPoolStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetPoolStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to addHealthCheckTargetPool. - */ - public UnaryCallSettings.Builder addHealthCheckTargetPoolSettings() { + /** Returns the builder for the settings used for calls to addHealthCheckTargetPool. */ + public UnaryCallSettings.Builder + addHealthCheckTargetPoolSettings() { return getStubSettingsBuilder().addHealthCheckTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to addInstanceTargetPool. - */ - public UnaryCallSettings.Builder addInstanceTargetPoolSettings() { + /** Returns the builder for the settings used for calls to addInstanceTargetPool. */ + public UnaryCallSettings.Builder + addInstanceTargetPoolSettings() { return getStubSettingsBuilder().addInstanceTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to aggregatedListTargetPools. - */ - public PagedCallSettings.Builder aggregatedListTargetPoolsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListTargetPools. */ + public PagedCallSettings.Builder< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, + AggregatedListTargetPoolsPagedResponse> + aggregatedListTargetPoolsSettings() { return getStubSettingsBuilder().aggregatedListTargetPoolsSettings(); } - /** - * Returns the builder for the settings used for calls to deleteTargetPool. - */ - public UnaryCallSettings.Builder deleteTargetPoolSettings() { + /** Returns the builder for the settings used for calls to deleteTargetPool. */ + public UnaryCallSettings.Builder + deleteTargetPoolSettings() { return getStubSettingsBuilder().deleteTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to getTargetPool. - */ + /** Returns the builder for the settings used for calls to getTargetPool. */ public UnaryCallSettings.Builder getTargetPoolSettings() { return getStubSettingsBuilder().getTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to getHealthTargetPool. - */ - public UnaryCallSettings.Builder getHealthTargetPoolSettings() { + /** Returns the builder for the settings used for calls to getHealthTargetPool. */ + public UnaryCallSettings.Builder + getHealthTargetPoolSettings() { return getStubSettingsBuilder().getHealthTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetPool. - */ - public UnaryCallSettings.Builder insertTargetPoolSettings() { + /** Returns the builder for the settings used for calls to insertTargetPool. */ + public UnaryCallSettings.Builder + insertTargetPoolSettings() { return getStubSettingsBuilder().insertTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to listTargetPools. - */ - public PagedCallSettings.Builder listTargetPoolsSettings() { + /** Returns the builder for the settings used for calls to listTargetPools. */ + public PagedCallSettings.Builder< + ListTargetPoolsHttpRequest, TargetPoolList, ListTargetPoolsPagedResponse> + listTargetPoolsSettings() { return getStubSettingsBuilder().listTargetPoolsSettings(); } - /** - * Returns the builder for the settings used for calls to removeHealthCheckTargetPool. - */ - public UnaryCallSettings.Builder removeHealthCheckTargetPoolSettings() { + /** Returns the builder for the settings used for calls to removeHealthCheckTargetPool. */ + public UnaryCallSettings.Builder + removeHealthCheckTargetPoolSettings() { return getStubSettingsBuilder().removeHealthCheckTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to removeInstanceTargetPool. - */ - public UnaryCallSettings.Builder removeInstanceTargetPoolSettings() { + /** Returns the builder for the settings used for calls to removeInstanceTargetPool. */ + public UnaryCallSettings.Builder + removeInstanceTargetPoolSettings() { return getStubSettingsBuilder().removeInstanceTargetPoolSettings(); } - /** - * Returns the builder for the settings used for calls to setBackupTargetPool. - */ - public UnaryCallSettings.Builder setBackupTargetPoolSettings() { + /** Returns the builder for the settings used for calls to setBackupTargetPool. */ + public UnaryCallSettings.Builder + setBackupTargetPoolSettings() { return getStubSettingsBuilder().setBackupTargetPoolSettings(); } @@ -364,4 +303,4 @@ public TargetPoolSettings build() throws IOException { return new TargetPoolSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java index 987f8b15cdc9..dc49f449a4b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetPoolsAddHealthCheckRequest() { this.healthChecks = null; } - - private TargetPoolsAddHealthCheckRequest( - List healthChecks - ) { + private TargetPoolsAddHealthCheckRequest(List healthChecks) { this.healthChecks = healthChecks; } @@ -76,22 +71,24 @@ public List getHealthChecksList() { return healthChecks; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolsAddHealthCheckRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolsAddHealthCheckRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolsAddHealthCheckRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolsAddHealthCheckRequest(); } @@ -130,11 +127,8 @@ public Builder addHealthChecks(HealthCheckReference healthChecks) { return this; } - public TargetPoolsAddHealthCheckRequest build() { - return new TargetPoolsAddHealthCheckRequest( - healthChecks - ); + return new TargetPoolsAddHealthCheckRequest(healthChecks); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "TargetPoolsAddHealthCheckRequest{" - + "healthChecks=" + healthChecks - + "}"; + return "TargetPoolsAddHealthCheckRequest{" + "healthChecks=" + healthChecks + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolsAddHealthCheckRequest) { TargetPoolsAddHealthCheckRequest that = (TargetPoolsAddHealthCheckRequest) o; - return - Objects.equals(this.healthChecks, that.getHealthChecksList()) - ; + return Objects.equals(this.healthChecks, that.getHealthChecksList()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthChecks - ); + return Objects.hash(healthChecks); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java index 0c6057132940..be52b4653521 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetPoolsAddInstanceRequest() { this.instances = null; } - - private TargetPoolsAddInstanceRequest( - List instances - ) { + private TargetPoolsAddInstanceRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolsAddInstanceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolsAddInstanceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolsAddInstanceRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolsAddInstanceRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(InstanceReference instances) { return this; } - public TargetPoolsAddInstanceRequest build() { - return new TargetPoolsAddInstanceRequest( - instances - ); + return new TargetPoolsAddInstanceRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "TargetPoolsAddInstanceRequest{" - + "instances=" + instances - + "}"; + return "TargetPoolsAddInstanceRequest{" + "instances=" + instances + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolsAddInstanceRequest) { TargetPoolsAddInstanceRequest that = (TargetPoolsAddInstanceRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java index 0e83d29b5eb5..400b6fcc3f6a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetPoolsRemoveHealthCheckRequest() { this.healthChecks = null; } - - private TargetPoolsRemoveHealthCheckRequest( - List healthChecks - ) { + private TargetPoolsRemoveHealthCheckRequest(List healthChecks) { this.healthChecks = healthChecks; } @@ -76,22 +71,24 @@ public List getHealthChecksList() { return healthChecks; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolsRemoveHealthCheckRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolsRemoveHealthCheckRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolsRemoveHealthCheckRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolsRemoveHealthCheckRequest(); } @@ -130,11 +127,8 @@ public Builder addHealthChecks(HealthCheckReference healthChecks) { return this; } - public TargetPoolsRemoveHealthCheckRequest build() { - return new TargetPoolsRemoveHealthCheckRequest( - healthChecks - ); + return new TargetPoolsRemoveHealthCheckRequest(healthChecks); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "TargetPoolsRemoveHealthCheckRequest{" - + "healthChecks=" + healthChecks - + "}"; + return "TargetPoolsRemoveHealthCheckRequest{" + "healthChecks=" + healthChecks + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolsRemoveHealthCheckRequest) { TargetPoolsRemoveHealthCheckRequest that = (TargetPoolsRemoveHealthCheckRequest) o; - return - Objects.equals(this.healthChecks, that.getHealthChecksList()) - ; + return Objects.equals(this.healthChecks, that.getHealthChecksList()); } return false; } @Override public int hashCode() { - return Objects.hash( - healthChecks - ); + return Objects.hash(healthChecks); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java index 3752671d0f9d..c03b31fd48cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetPoolsRemoveInstanceRequest() { this.instances = null; } - - private TargetPoolsRemoveInstanceRequest( - List instances - ) { + private TargetPoolsRemoveInstanceRequest(List instances) { this.instances = instances; } @@ -76,22 +71,24 @@ public List getInstancesList() { return instances; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolsRemoveInstanceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolsRemoveInstanceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolsRemoveInstanceRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolsRemoveInstanceRequest(); } @@ -130,11 +127,8 @@ public Builder addInstances(InstanceReference instances) { return this; } - public TargetPoolsRemoveInstanceRequest build() { - return new TargetPoolsRemoveInstanceRequest( - instances - ); + return new TargetPoolsRemoveInstanceRequest(instances); } public Builder clone() { @@ -146,9 +140,7 @@ public Builder clone() { @Override public String toString() { - return "TargetPoolsRemoveInstanceRequest{" - + "instances=" + instances - + "}"; + return "TargetPoolsRemoveInstanceRequest{" + "instances=" + instances + "}"; } @Override @@ -158,17 +150,13 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolsRemoveInstanceRequest) { TargetPoolsRemoveInstanceRequest that = (TargetPoolsRemoveInstanceRequest) o; - return - Objects.equals(this.instances, that.getInstancesList()) - ; + return Objects.equals(this.instances, that.getInstancesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - instances - ); + return Objects.hash(instances); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java index c207a7af2248..79bc8b5e8db6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private TargetPoolsScopedList() { this.warning = null; } - - private TargetPoolsScopedList( - List targetPools, - Warning warning - ) { + private TargetPoolsScopedList(List targetPools, Warning warning) { this.targetPools = targetPools; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetPoolsScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetPoolsScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetPoolsScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetPoolsScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetPoolsScopedList build() { - return new TargetPoolsScopedList( - targetPools, - warning - ); + return new TargetPoolsScopedList(targetPools, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "TargetPoolsScopedList{" - + "targetPools=" + targetPools + ", " - + "warning=" + warning + + "targetPools=" + + targetPools + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof TargetPoolsScopedList) { TargetPoolsScopedList that = (TargetPoolsScopedList) o; - return - Objects.equals(this.targetPools, that.getTargetPoolsList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.targetPools, that.getTargetPoolsList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - targetPools, - warning - ); + return Objects.hash(targetPools, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java index e3febccb9f3f..c9282e24fafa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private TargetReference() { this.target = null; } - - private TargetReference( - String target - ) { + private TargetReference(String target) { this.target = target; } @@ -72,22 +66,24 @@ public String getTarget() { return target; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetReference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetReference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetReference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetReference(); } @@ -118,11 +114,8 @@ public Builder setTarget(String target) { return this; } - public TargetReference build() { - return new TargetReference( - target - ); + return new TargetReference(target); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "TargetReference{" - + "target=" + target - + "}"; + return "TargetReference{" + "target=" + target + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof TargetReference) { TargetReference that = (TargetReference) o; - return - Objects.equals(this.target, that.getTarget()) - ; + return Objects.equals(this.target, that.getTarget()); } return false; } @Override public int hashCode() { - return Objects.hash( - target - ); + return Objects.hash(target); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java index aa67fe98bdca..5e811f2cc921 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private TargetSslProxiesSetBackendServiceRequest() { this.service = null; } - - private TargetSslProxiesSetBackendServiceRequest( - String service - ) { + private TargetSslProxiesSetBackendServiceRequest(String service) { this.service = service; } @@ -72,22 +66,24 @@ public String getService() { return service; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetSslProxiesSetBackendServiceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetSslProxiesSetBackendServiceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetSslProxiesSetBackendServiceRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetSslProxiesSetBackendServiceRequest(); } @@ -118,11 +114,8 @@ public Builder setService(String service) { return this; } - public TargetSslProxiesSetBackendServiceRequest build() { - return new TargetSslProxiesSetBackendServiceRequest( - service - ); + return new TargetSslProxiesSetBackendServiceRequest(service); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "TargetSslProxiesSetBackendServiceRequest{" - + "service=" + service - + "}"; + return "TargetSslProxiesSetBackendServiceRequest{" + "service=" + service + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof TargetSslProxiesSetBackendServiceRequest) { TargetSslProxiesSetBackendServiceRequest that = (TargetSslProxiesSetBackendServiceRequest) o; - return - Objects.equals(this.service, that.getService()) - ; + return Objects.equals(this.service, that.getService()); } return false; } @Override public int hashCode() { - return Objects.hash( - service - ); + return Objects.hash(service); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java index 63c68fef7ca5..5f1c1b9fc9b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private TargetSslProxiesSetProxyHeaderRequest() { this.proxyHeader = null; } - - private TargetSslProxiesSetProxyHeaderRequest( - String proxyHeader - ) { + private TargetSslProxiesSetProxyHeaderRequest(String proxyHeader) { this.proxyHeader = proxyHeader; } @@ -72,22 +66,24 @@ public String getProxyHeader() { return proxyHeader; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetSslProxiesSetProxyHeaderRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetSslProxiesSetProxyHeaderRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetSslProxiesSetProxyHeaderRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetSslProxiesSetProxyHeaderRequest(); } @@ -118,11 +114,8 @@ public Builder setProxyHeader(String proxyHeader) { return this; } - public TargetSslProxiesSetProxyHeaderRequest build() { - return new TargetSslProxiesSetProxyHeaderRequest( - proxyHeader - ); + return new TargetSslProxiesSetProxyHeaderRequest(proxyHeader); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "TargetSslProxiesSetProxyHeaderRequest{" - + "proxyHeader=" + proxyHeader - + "}"; + return "TargetSslProxiesSetProxyHeaderRequest{" + "proxyHeader=" + proxyHeader + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof TargetSslProxiesSetProxyHeaderRequest) { TargetSslProxiesSetProxyHeaderRequest that = (TargetSslProxiesSetProxyHeaderRequest) o; - return - Objects.equals(this.proxyHeader, that.getProxyHeader()) - ; + return Objects.equals(this.proxyHeader, that.getProxyHeader()); } return false; } @Override public int hashCode() { - return Objects.hash( - proxyHeader - ); + return Objects.hash(proxyHeader); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java index 46111fdc1262..9c9b7e8edafc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java @@ -18,9 +18,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,10 +36,7 @@ private TargetSslProxiesSetSslCertificatesRequest() { this.sslCertificates = null; } - - private TargetSslProxiesSetSslCertificatesRequest( - List sslCertificates - ) { + private TargetSslProxiesSetSslCertificatesRequest(List sslCertificates) { this.sslCertificates = sslCertificates; } @@ -76,22 +71,24 @@ public List getSslCertificatesList() { return sslCertificates; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetSslProxiesSetSslCertificatesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetSslProxiesSetSslCertificatesRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetSslProxiesSetSslCertificatesRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetSslProxiesSetSslCertificatesRequest(); } @@ -130,11 +127,8 @@ public Builder addSslCertificates(String sslCertificates) { return this; } - public TargetSslProxiesSetSslCertificatesRequest build() { - return new TargetSslProxiesSetSslCertificatesRequest( - sslCertificates - ); + return new TargetSslProxiesSetSslCertificatesRequest(sslCertificates); } public Builder clone() { @@ -147,7 +141,8 @@ public Builder clone() { @Override public String toString() { return "TargetSslProxiesSetSslCertificatesRequest{" - + "sslCertificates=" + sslCertificates + + "sslCertificates=" + + sslCertificates + "}"; } @@ -157,18 +152,15 @@ public boolean equals(Object o) { return true; } if (o instanceof TargetSslProxiesSetSslCertificatesRequest) { - TargetSslProxiesSetSslCertificatesRequest that = (TargetSslProxiesSetSslCertificatesRequest) o; - return - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) - ; + TargetSslProxiesSetSslCertificatesRequest that = + (TargetSslProxiesSetSslCertificatesRequest) o; + return Objects.equals(this.sslCertificates, that.getSslCertificatesList()); } return false; } @Override public int hashCode() { - return Objects.hash( - sslCertificates - ); + return Objects.hash(sslCertificates); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java index bc7b55987ca2..e0462ced07cf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -41,6 +40,7 @@ public final class TargetSslProxy implements ApiMessage { private final String selfLink; private final String service; private final List sslCertificates; + private final String sslPolicy; private TargetSslProxy() { this.creationTimestamp = null; @@ -52,9 +52,9 @@ private TargetSslProxy() { this.selfLink = null; this.service = null; this.sslCertificates = null; + this.sslPolicy = null; } - private TargetSslProxy( String creationTimestamp, String description, @@ -64,8 +64,8 @@ private TargetSslProxy( String proxyHeader, String selfLink, String service, - List sslCertificates - ) { + List sslCertificates, + String sslPolicy) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -75,13 +75,15 @@ private TargetSslProxy( this.selfLink = selfLink; this.service = service; this.sslCertificates = sslCertificates; + this.sslPolicy = sslPolicy; } @Override public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -111,6 +113,9 @@ public Map> populateFieldsInMap(Set fieldNames) { } fieldMap.put("sslCertificates", stringList.build()); } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } return fieldMap; } @@ -143,6 +148,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("sslCertificates")) { return String.valueOf(sslCertificates); } + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } return null; } @@ -188,22 +196,28 @@ public List getSslCertificatesList() { return sslCertificates; } + public String getSslPolicy() { + return sslPolicy; + } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetSslProxy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetSslProxy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetSslProxy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetSslProxy(); } @@ -218,6 +232,7 @@ public static class Builder { private String selfLink; private String service; private List sslCertificates; + private String sslPolicy; Builder() {} @@ -250,6 +265,9 @@ public Builder mergeFrom(TargetSslProxy other) { if (other.getSslCertificatesList() != null) { this.sslCertificates = other.sslCertificates; } + if (other.getSslPolicy() != null) { + this.sslPolicy = other.sslPolicy; + } return this; } @@ -263,6 +281,7 @@ public Builder mergeFrom(TargetSslProxy other) { this.selfLink = source.selfLink; this.service = source.service; this.sslCertificates = source.sslCertificates; + this.sslPolicy = source.sslPolicy; } public String getCreationTimestamp() { @@ -354,27 +373,28 @@ public Builder addSslCertificates(String sslCertificates) { return this; } + public String getSslPolicy() { + return sslPolicy; + } - public TargetSslProxy build() { - - - - - - + public Builder setSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + public TargetSslProxy build() { return new TargetSslProxy( - creationTimestamp, - description, - id, - kind, - name, - proxyHeader, - selfLink, - service, - sslCertificates - ); + creationTimestamp, + description, + id, + kind, + name, + proxyHeader, + selfLink, + service, + sslCertificates, + sslPolicy); } public Builder clone() { @@ -388,6 +408,7 @@ public Builder clone() { newBuilder.setSelfLink(this.selfLink); newBuilder.setService(this.service); newBuilder.addAllSslCertificates(this.sslCertificates); + newBuilder.setSslPolicy(this.sslPolicy); return newBuilder; } } @@ -395,15 +416,35 @@ public Builder clone() { @Override public String toString() { return "TargetSslProxy{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "proxyHeader=" + proxyHeader + ", " - + "selfLink=" + selfLink + ", " - + "service=" + service + ", " - + "sslCertificates=" + sslCertificates + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "selfLink=" + + selfLink + + ", " + + "service=" + + service + + ", " + + "sslCertificates=" + + sslCertificates + + ", " + + "sslPolicy=" + + sslPolicy + "}"; } @@ -414,17 +455,16 @@ public boolean equals(Object o) { } if (o instanceof TargetSslProxy) { TargetSslProxy that = (TargetSslProxy) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.service, that.getService()) && - Objects.equals(this.sslCertificates, that.getSslCertificatesList()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.service, that.getService()) + && Objects.equals(this.sslCertificates, that.getSslCertificatesList()) + && Objects.equals(this.sslPolicy, that.getSslPolicy()); } return false; } @@ -432,15 +472,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - proxyHeader, - selfLink, - service, - sslCertificates - ); + creationTimestamp, + description, + id, + kind, + name, + proxyHeader, + selfLink, + service, + sslCertificates, + sslPolicy); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java index 9bb29c35a1a1..24de01476c19 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetSslProxyStub; import com.google.cloud.compute.v1.stub.TargetSslProxyStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,7 +42,7 @@ *

  * 
  * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
- *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+ *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
  *   String requestId = "";
  *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
  * }
@@ -60,33 +50,32 @@
  * 
* *

Note: close() needs to be called on the targetSslProxyClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetSslProxySettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class TargetSslProxyClient implements BackgroundResource {
   private final TargetSslProxySettings settings;
   private final TargetSslProxyStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetSslProxyClient with default settings.
-   */
+  /** Constructs an instance of TargetSslProxyClient with default settings. */
   public static final TargetSslProxyClient create() throws IOException {
     return create(TargetSslProxySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetSslProxyClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetSslProxyClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetSslProxyClient create(TargetSslProxySettings settings) throws IOException {
+  public static final TargetSslProxyClient create(TargetSslProxySettings settings)
+      throws IOException {
     return new TargetSslProxyClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetSslProxyClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetSslProxySettings}.
+   * Constructs an instance of TargetSslProxyClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use TargetSslProxySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetSslProxyClient create(TargetSslProxyStub stub) {
@@ -144,9 +129,9 @@ public static final TargetSslProxyClient create(TargetSslProxyStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetSslProxyClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetSslProxyClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetSslProxyClient(TargetSslProxySettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +153,41 @@ public TargetSslProxyStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified TargetSslProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId) { + public final Operation deleteTargetSslProxy( + ProjectGlobalTargetSslProxyName targetSslProxy, String requestId) { DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) - .build(); + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) + .build(); return deleteTargetSslProxy(request); } @@ -205,21 +195,26 @@ public final Operation deleteTargetSslProxy(ProjectTargetSslProxyName targetSslP /** * Deletes the specified TargetSslProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString(), requestId);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -227,9 +222,9 @@ public final Operation deleteTargetSslProxy(String targetSslProxy, String reques DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) - .build(); + .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) + .build(); return deleteTargetSslProxy(request); } @@ -237,10 +232,11 @@ public final Operation deleteTargetSslProxy(String targetSslProxy, String reques /** * Deletes the specified TargetSslProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
@@ -262,10 +258,11 @@ public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest requ
   /**
    * Deletes the specified TargetSslProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
@@ -278,18 +275,21 @@ public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetSslProxyCallable() { + public final UnaryCallable + deleteTargetSslProxyCallable() { return stub.deleteTargetSslProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(targetSslProxy);
    * }
    * 
@@ -298,23 +298,25 @@ public final UnaryCallable deleteTar * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetSslProxy getTargetSslProxy(ProjectTargetSslProxyName targetSslProxy) { + public final TargetSslProxy getTargetSslProxy(ProjectGlobalTargetSslProxyName targetSslProxy) { GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .build(); + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .build(); return getTargetSslProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   TargetSslProxy response = targetSslProxyClient.getTargetSslProxy(targetSslProxy.toString());
    * }
    * 
@@ -326,20 +328,20 @@ public final TargetSslProxy getTargetSslProxy(ProjectTargetSslProxyName targetSs public final TargetSslProxy getTargetSslProxy(String targetSslProxy) { GetTargetSslProxyHttpRequest request = - GetTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy) - .build(); + GetTargetSslProxyHttpRequest.newBuilder().setTargetSslProxy(targetSslProxy).build(); return getTargetSslProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. + * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
    *     .build();
@@ -357,12 +359,14 @@ public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request.
+   * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   GetTargetSslProxyHttpRequest request = GetTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
    *     .build();
@@ -373,15 +377,18 @@ public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getTargetSslProxyCallable() { + public final UnaryCallable + getTargetSslProxyCallable() { return stub.getTargetSslProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * Creates a TargetSslProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   String requestId = "";
@@ -391,32 +398,40 @@ public final UnaryCallable getTarg
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) + * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. + * (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetSslProxy(String requestId, ProjectName project, TargetSslProxy targetSslProxyResource) { + public final Operation insertTargetSslProxy( + String requestId, ProjectName project, TargetSslProxy targetSslProxyResource) { InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setTargetSslProxyResource(targetSslProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setTargetSslProxyResource(targetSslProxyResource) + .build(); return insertTargetSslProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * Creates a TargetSslProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   String requestId = "";
@@ -426,32 +441,40 @@ public final Operation insertTargetSslProxy(String requestId, ProjectName projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) + * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. + * (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetSslProxy(String requestId, String project, TargetSslProxy targetSslProxyResource) { + public final Operation insertTargetSslProxy( + String requestId, String project, TargetSslProxy targetSslProxyResource) { InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setTargetSslProxyResource(targetSslProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setTargetSslProxyResource(targetSslProxyResource) + .build(); return insertTargetSslProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * Creates a TargetSslProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   String requestId = "";
@@ -476,9 +499,11 @@ public final Operation insertTargetSslProxy(InsertTargetSslProxyHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a TargetSslProxy resource in the specified project using the data included in the request.
+   * Creates a TargetSslProxy resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   String requestId = "";
@@ -496,7 +521,8 @@ public final Operation insertTargetSslProxy(InsertTargetSslProxyHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable insertTargetSslProxyCallable() { + public final UnaryCallable + insertTargetSslProxyCallable() { return stub.insertTargetSslProxyCallable(); } @@ -504,7 +530,8 @@ public final UnaryCallable insertTar /** * Retrieves the list of TargetSslProxy resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +548,8 @@ public final UnaryCallable insertTar
   public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ProjectName project) {
     ListTargetSslProxiesHttpRequest request =
         ListTargetSslProxiesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listTargetSslProxies(request);
   }
 
@@ -530,7 +557,8 @@ public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ProjectName
   /**
    * Retrieves the list of TargetSslProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +574,7 @@ public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ProjectName
   @BetaApi
   public final ListTargetSslProxiesPagedResponse listTargetSslProxies(String project) {
     ListTargetSslProxiesHttpRequest request =
-        ListTargetSslProxiesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListTargetSslProxiesHttpRequest.newBuilder().setProject(project).build();
     return listTargetSslProxies(request);
   }
 
@@ -556,7 +582,8 @@ public final ListTargetSslProxiesPagedResponse listTargetSslProxies(String proje
   /**
    * Retrieves the list of TargetSslProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +600,17 @@ public final ListTargetSslProxiesPagedResponse listTargetSslProxies(String proje
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ListTargetSslProxiesHttpRequest request) {
-    return listTargetSslProxiesPagedCallable()
-        .call(request);
+  public final ListTargetSslProxiesPagedResponse listTargetSslProxies(
+      ListTargetSslProxiesHttpRequest request) {
+    return listTargetSslProxiesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of TargetSslProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +626,8 @@ public final ListTargetSslProxiesPagedResponse listTargetSslProxies(ListTargetSs
    * 
*/ @BetaApi - public final UnaryCallable listTargetSslProxiesPagedCallable() { + public final UnaryCallable + listTargetSslProxiesPagedCallable() { return stub.listTargetSslProxiesPagedCallable(); } @@ -606,7 +635,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,7 +659,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetSslProxiesCallable() { + public final UnaryCallable + listTargetSslProxiesCallable() { return stub.listTargetSslProxiesCallable(); } @@ -637,34 +668,44 @@ public final UnaryCallable /** * Changes the BackendService for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource);
    * }
    * 
* - * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to + * be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackendServiceTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + public final Operation setBackendServiceTargetSslProxy( + ProjectGlobalTargetSslProxyName targetSslProxy, + String requestId, + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) - .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource) - .build(); + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) + .setTargetSslProxiesSetBackendServiceRequestResource( + targetSslProxiesSetBackendServiceRequestResource) + .build(); return setBackendServiceTargetSslProxy(request); } @@ -672,34 +713,44 @@ public final Operation setBackendServiceTargetSslProxy(ProjectTargetSslProxyName /** * Changes the BackendService for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetBackendServiceRequestResource);
    * }
    * 
* - * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to + * be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { + public final Operation setBackendServiceTargetSslProxy( + String targetSslProxy, + String requestId, + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) - .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource) - .build(); + .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) + .setTargetSslProxiesSetBackendServiceRequestResource( + targetSslProxiesSetBackendServiceRequestResource) + .build(); return setBackendServiceTargetSslProxy(request); } @@ -707,10 +758,11 @@ public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, St /** * Changes the BackendService for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
@@ -726,7 +778,8 @@ public final Operation setBackendServiceTargetSslProxy(String targetSslProxy, St
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setBackendServiceTargetSslProxy(SetBackendServiceTargetSslProxyHttpRequest request) {
+  public final Operation setBackendServiceTargetSslProxy(
+      SetBackendServiceTargetSslProxyHttpRequest request) {
     return setBackendServiceTargetSslProxyCallable().call(request);
   }
 
@@ -734,10 +787,11 @@ public final Operation setBackendServiceTargetSslProxy(SetBackendServiceTargetSs
   /**
    * Changes the BackendService for TargetSslProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
@@ -752,7 +806,8 @@ public final Operation setBackendServiceTargetSslProxy(SetBackendServiceTargetSs
    * 
*/ @BetaApi - public final UnaryCallable setBackendServiceTargetSslProxyCallable() { + public final UnaryCallable + setBackendServiceTargetSslProxyCallable() { return stub.setBackendServiceTargetSslProxyCallable(); } @@ -760,10 +815,11 @@ public final UnaryCallableSample code: + * *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource);
@@ -771,23 +827,31 @@ public final UnaryCallable
* * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setProxyHeaderTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + public final Operation setProxyHeaderTargetSslProxy( + ProjectGlobalTargetSslProxyName targetSslProxy, + String requestId, + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) - .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource) - .build(); + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) + .setTargetSslProxiesSetProxyHeaderRequestResource( + targetSslProxiesSetProxyHeaderRequestResource) + .build(); return setProxyHeaderTargetSslProxy(request); } @@ -795,10 +859,11 @@ public final Operation setProxyHeaderTargetSslProxy(ProjectTargetSslProxyName ta /** * Changes the ProxyHeaderType for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetProxyHeaderRequestResource);
@@ -806,23 +871,31 @@ public final Operation setProxyHeaderTargetSslProxy(ProjectTargetSslProxyName ta
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { + public final Operation setProxyHeaderTargetSslProxy( + String targetSslProxy, + String requestId, + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) - .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource) - .build(); + .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) + .setTargetSslProxiesSetProxyHeaderRequestResource( + targetSslProxiesSetProxyHeaderRequestResource) + .build(); return setProxyHeaderTargetSslProxy(request); } @@ -830,10 +903,11 @@ public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, Strin /** * Changes the ProxyHeaderType for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
@@ -849,7 +923,8 @@ public final Operation setProxyHeaderTargetSslProxy(String targetSslProxy, Strin
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setProxyHeaderTargetSslProxy(SetProxyHeaderTargetSslProxyHttpRequest request) {
+  public final Operation setProxyHeaderTargetSslProxy(
+      SetProxyHeaderTargetSslProxyHttpRequest request) {
     return setProxyHeaderTargetSslProxyCallable().call(request);
   }
 
@@ -857,10 +932,11 @@ public final Operation setProxyHeaderTargetSslProxy(SetProxyHeaderTargetSslProxy
   /**
    * Changes the ProxyHeaderType for TargetSslProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
@@ -875,7 +951,8 @@ public final Operation setProxyHeaderTargetSslProxy(SetProxyHeaderTargetSslProxy
    * 
*/ @BetaApi - public final UnaryCallable setProxyHeaderTargetSslProxyCallable() { + public final UnaryCallable + setProxyHeaderTargetSslProxyCallable() { return stub.setProxyHeaderTargetSslProxyCallable(); } @@ -883,34 +960,44 @@ public final UnaryCallable s /** * Changes SslCertificates for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource);
    * }
    * 
* - * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to + * be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetSslProxy(ProjectTargetSslProxyName targetSslProxy, String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetSslProxy( + ProjectGlobalTargetSslProxyName targetSslProxy, + String requestId, + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) - .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource) - .build(); + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) + .setTargetSslProxiesSetSslCertificatesRequestResource( + targetSslProxiesSetSslCertificatesRequestResource) + .build(); return setSslCertificatesTargetSslProxy(request); } @@ -918,34 +1005,44 @@ public final Operation setSslCertificatesTargetSslProxy(ProjectTargetSslProxyNam /** * Changes SslCertificates for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetSslCertificatesRequestResource);
    * }
    * 
* - * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to + * be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { + public final Operation setSslCertificatesTargetSslProxy( + String targetSslProxy, + String requestId, + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) - .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource) - .build(); + .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) + .setTargetSslProxiesSetSslCertificatesRequestResource( + targetSslProxiesSetSslCertificatesRequestResource) + .build(); return setSslCertificatesTargetSslProxy(request); } @@ -953,10 +1050,11 @@ public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, S /** * Changes SslCertificates for TargetSslProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
@@ -972,7 +1070,8 @@ public final Operation setSslCertificatesTargetSslProxy(String targetSslProxy, S
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setSslCertificatesTargetSslProxy(SetSslCertificatesTargetSslProxyHttpRequest request) {
+  public final Operation setSslCertificatesTargetSslProxy(
+      SetSslCertificatesTargetSslProxyHttpRequest request) {
     return setSslCertificatesTargetSslProxyCallable().call(request);
   }
 
@@ -980,10 +1079,11 @@ public final Operation setSslCertificatesTargetSslProxy(SetSslCertificatesTarget
   /**
    * Changes SslCertificates for TargetSslProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
    *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
@@ -998,12 +1098,163 @@ public final Operation setSslCertificatesTargetSslProxy(SetSslCertificatesTarget
    * 
*/ @BetaApi - public final UnaryCallable setSslCertificatesTargetSslProxyCallable() { + public final UnaryCallable + setSslCertificatesTargetSslProxyCallable() { return stub.setSslCertificatesTargetSslProxyCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for + * SSL features. This affects connections between clients and the SSL proxy load balancer. They do + * not affect the connection between the load balancer and the backends. + * + *

Sample code: + * + *


+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(targetSslProxy, requestId, sslPolicyReferenceResource);
+   * }
+   * 
+ * + * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicyReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslPolicyTargetSslProxy( + ProjectGlobalTargetSslProxyName targetSslProxy, + String requestId, + SslPolicyReference sslPolicyReferenceResource) { + + SetSslPolicyTargetSslProxyHttpRequest request = + SetSslPolicyTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) + .setRequestId(requestId) + .setSslPolicyReferenceResource(sslPolicyReferenceResource) + .build(); + return setSslPolicyTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for + * SSL features. This affects connections between clients and the SSL proxy load balancer. They do + * not affect the connection between the load balancer and the backends. + * + *

Sample code: + * + *


+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(targetSslProxy.toString(), requestId, sslPolicyReferenceResource);
+   * }
+   * 
+ * + * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sslPolicyReferenceResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslPolicyTargetSslProxy( + String targetSslProxy, String requestId, SslPolicyReference sslPolicyReferenceResource) { + + SetSslPolicyTargetSslProxyHttpRequest request = + SetSslPolicyTargetSslProxyHttpRequest.newBuilder() + .setTargetSslProxy(targetSslProxy) + .setRequestId(requestId) + .setSslPolicyReferenceResource(sslPolicyReferenceResource) + .build(); + return setSslPolicyTargetSslProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for + * SSL features. This affects connections between clients and the SSL proxy load balancer. They do + * not affect the connection between the load balancer and the backends. + * + *

Sample code: + * + *


+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
+   *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
+   *     .build();
+   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setSslPolicyTargetSslProxy(SetSslPolicyTargetSslProxyHttpRequest request) { + return setSslPolicyTargetSslProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for + * SSL features. This affects connections between clients and the SSL proxy load balancer. They do + * not affect the connection between the load balancer and the backends. + * + *

Sample code: + * + *


+   * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
+   *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+   *   String requestId = "";
+   *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
+   *   SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder()
+   *     .setTargetSslProxy(targetSslProxy.toString())
+   *     .setRequestId(requestId)
+   *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetSslProxyClient.setSslPolicyTargetSslProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setSslPolicyTargetSslProxyCallable() { + return stub.setSslPolicyTargetSslProxyCallable(); + } + @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1032,12 +1283,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListTargetSslProxiesPagedResponse extends AbstractPagedListResponse< - ListTargetSslProxiesHttpRequest, - TargetSslProxyList, - TargetSslProxy, - ListTargetSslProxiesPage, - ListTargetSslProxiesFixedSizeCollection> { + public static class ListTargetSslProxiesPagedResponse + extends AbstractPagedListResponse< + ListTargetSslProxiesHttpRequest, TargetSslProxyList, TargetSslProxy, + ListTargetSslProxiesPage, ListTargetSslProxiesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1057,15 +1306,12 @@ public ListTargetSslProxiesPagedResponse apply(ListTargetSslProxiesPage input) { private ListTargetSslProxiesPagedResponse(ListTargetSslProxiesPage page) { super(page, ListTargetSslProxiesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetSslProxiesPage extends AbstractPage< - ListTargetSslProxiesHttpRequest, - TargetSslProxyList, - TargetSslProxy, - ListTargetSslProxiesPage> { + public static class ListTargetSslProxiesPage + extends AbstractPage< + ListTargetSslProxiesHttpRequest, TargetSslProxyList, TargetSslProxy, + ListTargetSslProxiesPage> { private ListTargetSslProxiesPage( PageContext context, @@ -1090,20 +1336,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetSslProxiesFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetSslProxiesHttpRequest, - TargetSslProxyList, - TargetSslProxy, - ListTargetSslProxiesPage, - ListTargetSslProxiesFixedSizeCollection> { + public static class ListTargetSslProxiesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetSslProxiesHttpRequest, TargetSslProxyList, TargetSslProxy, + ListTargetSslProxiesPage, ListTargetSslProxiesFixedSizeCollection> { - private ListTargetSslProxiesFixedSizeCollection(List pages, int collectionSize) { + private ListTargetSslProxiesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -1116,7 +1357,5 @@ protected ListTargetSslProxiesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetSslProxiesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java index bbf25f4bb122..e5c08024a116 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetSslProxyList() { this.warning = null; } - private TargetSslProxyList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetSslProxyList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetSslProxyList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetSslProxyList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetSslProxyList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetSslProxyList build() { - - - - - return new TargetSslProxyList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetSslProxyList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetSslProxyList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetSslProxyList) { TargetSslProxyList that = (TargetSslProxyList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java index 1c1d9d9dac1b..1f5b2afc9b4c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; import com.google.cloud.compute.v1.stub.TargetSslProxyStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetSslProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetSslProxy to 30 seconds: * *

  * 
@@ -85,98 +63,89 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetSslProxySettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteTargetSslProxy.
-   */
-  public UnaryCallSettings deleteTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to deleteTargetSslProxy. */
+  public UnaryCallSettings
+      deleteTargetSslProxySettings() {
     return ((TargetSslProxyStubSettings) getStubSettings()).deleteTargetSslProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetSslProxy.
-   */
-  public UnaryCallSettings getTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetSslProxy. */
+  public UnaryCallSettings
+      getTargetSslProxySettings() {
     return ((TargetSslProxyStubSettings) getStubSettings()).getTargetSslProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetSslProxy.
-   */
-  public UnaryCallSettings insertTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetSslProxy. */
+  public UnaryCallSettings
+      insertTargetSslProxySettings() {
     return ((TargetSslProxyStubSettings) getStubSettings()).insertTargetSslProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetSslProxies.
-   */
-  public PagedCallSettings listTargetSslProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetSslProxies. */
+  public PagedCallSettings<
+          ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse>
+      listTargetSslProxiesSettings() {
     return ((TargetSslProxyStubSettings) getStubSettings()).listTargetSslProxiesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setBackendServiceTargetSslProxy.
-   */
-  public UnaryCallSettings setBackendServiceTargetSslProxySettings() {
-    return ((TargetSslProxyStubSettings) getStubSettings()).setBackendServiceTargetSslProxySettings();
+  /** Returns the object with the settings used for calls to setBackendServiceTargetSslProxy. */
+  public UnaryCallSettings
+      setBackendServiceTargetSslProxySettings() {
+    return ((TargetSslProxyStubSettings) getStubSettings())
+        .setBackendServiceTargetSslProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setProxyHeaderTargetSslProxy.
-   */
-  public UnaryCallSettings setProxyHeaderTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to setProxyHeaderTargetSslProxy. */
+  public UnaryCallSettings
+      setProxyHeaderTargetSslProxySettings() {
     return ((TargetSslProxyStubSettings) getStubSettings()).setProxyHeaderTargetSslProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setSslCertificatesTargetSslProxy.
-   */
-  public UnaryCallSettings setSslCertificatesTargetSslProxySettings() {
-    return ((TargetSslProxyStubSettings) getStubSettings()).setSslCertificatesTargetSslProxySettings();
+  /** Returns the object with the settings used for calls to setSslCertificatesTargetSslProxy. */
+  public UnaryCallSettings
+      setSslCertificatesTargetSslProxySettings() {
+    return ((TargetSslProxyStubSettings) getStubSettings())
+        .setSslCertificatesTargetSslProxySettings();
   }
 
+  /** Returns the object with the settings used for calls to setSslPolicyTargetSslProxy. */
+  public UnaryCallSettings
+      setSslPolicyTargetSslProxySettings() {
+    return ((TargetSslProxyStubSettings) getStubSettings()).setSslPolicyTargetSslProxySettings();
+  }
 
-  public static final TargetSslProxySettings create(TargetSslProxyStubSettings stub) throws IOException {
+  public static final TargetSslProxySettings create(TargetSslProxyStubSettings stub)
+      throws IOException {
     return new TargetSslProxySettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetSslProxyStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetSslProxyStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetSslProxyStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetSslProxyStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetSslProxyStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetSslProxyStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetSslProxyStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -189,23 +158,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetSslProxyStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -214,9 +177,7 @@ protected TargetSslProxySettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetSslProxySettings.
-   */
+  /** Builder for TargetSslProxySettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -238,73 +199,75 @@ protected Builder(TargetSslProxyStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetSslProxyStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetSslProxyStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteTargetSslProxy. - */ - public UnaryCallSettings.Builder deleteTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetSslProxy. */ + public UnaryCallSettings.Builder + deleteTargetSslProxySettings() { return getStubSettingsBuilder().deleteTargetSslProxySettings(); } - /** - * Returns the builder for the settings used for calls to getTargetSslProxy. - */ - public UnaryCallSettings.Builder getTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to getTargetSslProxy. */ + public UnaryCallSettings.Builder + getTargetSslProxySettings() { return getStubSettingsBuilder().getTargetSslProxySettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetSslProxy. - */ - public UnaryCallSettings.Builder insertTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetSslProxy. */ + public UnaryCallSettings.Builder + insertTargetSslProxySettings() { return getStubSettingsBuilder().insertTargetSslProxySettings(); } - /** - * Returns the builder for the settings used for calls to listTargetSslProxies. - */ - public PagedCallSettings.Builder listTargetSslProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetSslProxies. */ + public PagedCallSettings.Builder< + ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse> + listTargetSslProxiesSettings() { return getStubSettingsBuilder().listTargetSslProxiesSettings(); } - /** - * Returns the builder for the settings used for calls to setBackendServiceTargetSslProxy. - */ - public UnaryCallSettings.Builder setBackendServiceTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to setBackendServiceTargetSslProxy. */ + public UnaryCallSettings.Builder + setBackendServiceTargetSslProxySettings() { return getStubSettingsBuilder().setBackendServiceTargetSslProxySettings(); } - /** - * Returns the builder for the settings used for calls to setProxyHeaderTargetSslProxy. - */ - public UnaryCallSettings.Builder setProxyHeaderTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to setProxyHeaderTargetSslProxy. */ + public UnaryCallSettings.Builder + setProxyHeaderTargetSslProxySettings() { return getStubSettingsBuilder().setProxyHeaderTargetSslProxySettings(); } - /** - * Returns the builder for the settings used for calls to setSslCertificatesTargetSslProxy. - */ - public UnaryCallSettings.Builder setSslCertificatesTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to setSslCertificatesTargetSslProxy. */ + public UnaryCallSettings.Builder + setSslCertificatesTargetSslProxySettings() { return getStubSettingsBuilder().setSslCertificatesTargetSslProxySettings(); } + /** Returns the builder for the settings used for calls to setSslPolicyTargetSslProxy. */ + public UnaryCallSettings.Builder + setSslPolicyTargetSslProxySettings() { + return getStubSettingsBuilder().setSslPolicyTargetSslProxySettings(); + } + @Override public TargetSslProxySettings build() throws IOException { return new TargetSslProxySettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java index 82c45bf2dd29..d0b6a82b0895 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private TargetTcpProxiesSetBackendServiceRequest() { this.service = null; } - - private TargetTcpProxiesSetBackendServiceRequest( - String service - ) { + private TargetTcpProxiesSetBackendServiceRequest(String service) { this.service = service; } @@ -72,22 +66,24 @@ public String getService() { return service; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetTcpProxiesSetBackendServiceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetTcpProxiesSetBackendServiceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetTcpProxiesSetBackendServiceRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetTcpProxiesSetBackendServiceRequest(); } @@ -118,11 +114,8 @@ public Builder setService(String service) { return this; } - public TargetTcpProxiesSetBackendServiceRequest build() { - return new TargetTcpProxiesSetBackendServiceRequest( - service - ); + return new TargetTcpProxiesSetBackendServiceRequest(service); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "TargetTcpProxiesSetBackendServiceRequest{" - + "service=" + service - + "}"; + return "TargetTcpProxiesSetBackendServiceRequest{" + "service=" + service + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof TargetTcpProxiesSetBackendServiceRequest) { TargetTcpProxiesSetBackendServiceRequest that = (TargetTcpProxiesSetBackendServiceRequest) o; - return - Objects.equals(this.service, that.getService()) - ; + return Objects.equals(this.service, that.getService()); } return false; } @Override public int hashCode() { - return Objects.hash( - service - ); + return Objects.hash(service); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java index 6935393b8511..d7a1e88c441e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private TargetTcpProxiesSetProxyHeaderRequest() { this.proxyHeader = null; } - - private TargetTcpProxiesSetProxyHeaderRequest( - String proxyHeader - ) { + private TargetTcpProxiesSetProxyHeaderRequest(String proxyHeader) { this.proxyHeader = proxyHeader; } @@ -72,22 +66,24 @@ public String getProxyHeader() { return proxyHeader; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetTcpProxiesSetProxyHeaderRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetTcpProxiesSetProxyHeaderRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetTcpProxiesSetProxyHeaderRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetTcpProxiesSetProxyHeaderRequest(); } @@ -118,11 +114,8 @@ public Builder setProxyHeader(String proxyHeader) { return this; } - public TargetTcpProxiesSetProxyHeaderRequest build() { - return new TargetTcpProxiesSetProxyHeaderRequest( - proxyHeader - ); + return new TargetTcpProxiesSetProxyHeaderRequest(proxyHeader); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "TargetTcpProxiesSetProxyHeaderRequest{" - + "proxyHeader=" + proxyHeader - + "}"; + return "TargetTcpProxiesSetProxyHeaderRequest{" + "proxyHeader=" + proxyHeader + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof TargetTcpProxiesSetProxyHeaderRequest) { TargetTcpProxiesSetProxyHeaderRequest that = (TargetTcpProxiesSetProxyHeaderRequest) o; - return - Objects.equals(this.proxyHeader, that.getProxyHeader()) - ; + return Objects.equals(this.proxyHeader, that.getProxyHeader()); } return false; } @Override public int hashCode() { - return Objects.hash( - proxyHeader - ); + return Objects.hash(proxyHeader); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java index 958c78a249bd..a694a28320e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +49,6 @@ private TargetTcpProxy() { this.service = null; } - private TargetTcpProxy( String creationTimestamp, String description, @@ -61,8 +57,7 @@ private TargetTcpProxy( String name, String proxyHeader, String selfLink, - String service - ) { + String service) { this.creationTimestamp = creationTimestamp; this.description = description; this.id = id; @@ -77,7 +72,8 @@ private TargetTcpProxy( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -170,22 +166,24 @@ public String getService() { return service; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetTcpProxy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetTcpProxy getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetTcpProxy DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetTcpProxy(); } @@ -314,25 +312,10 @@ public Builder setService(String service) { return this; } - public TargetTcpProxy build() { - - - - - - return new TargetTcpProxy( - creationTimestamp, - description, - id, - kind, - name, - proxyHeader, - selfLink, - service - ); + creationTimestamp, description, id, kind, name, proxyHeader, selfLink, service); } public Builder clone() { @@ -352,14 +335,29 @@ public Builder clone() { @Override public String toString() { return "TargetTcpProxy{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "proxyHeader=" + proxyHeader + ", " - + "selfLink=" + selfLink + ", " - + "service=" + service + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "selfLink=" + + selfLink + + ", " + + "service=" + + service + "}"; } @@ -370,16 +368,14 @@ public boolean equals(Object o) { } if (o instanceof TargetTcpProxy) { TargetTcpProxy that = (TargetTcpProxy) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.proxyHeader, that.getProxyHeader()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.service, that.getService()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.service, that.getService()); } return false; } @@ -387,14 +383,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - id, - kind, - name, - proxyHeader, - selfLink, - service - ); + creationTimestamp, description, id, kind, name, proxyHeader, selfLink, service); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java index 6670424f55cc..a3bbbb1e2add 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetTcpProxyStub; import com.google.cloud.compute.v1.stub.TargetTcpProxyStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -53,40 +43,39 @@ * * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) { * String requestId = ""; - * ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + * ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); * Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy); * } * *

* *

Note: close() needs to be called on the targetTcpProxyClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetTcpProxySettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +105,23 @@ public class TargetTcpProxyClient implements BackgroundResource {
   private final TargetTcpProxySettings settings;
   private final TargetTcpProxyStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetTcpProxyClient with default settings.
-   */
+  /** Constructs an instance of TargetTcpProxyClient with default settings. */
   public static final TargetTcpProxyClient create() throws IOException {
     return create(TargetTcpProxySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetTcpProxyClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetTcpProxyClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetTcpProxyClient create(TargetTcpProxySettings settings) throws IOException {
+  public static final TargetTcpProxyClient create(TargetTcpProxySettings settings)
+      throws IOException {
     return new TargetTcpProxyClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetTcpProxyClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetTcpProxySettings}.
+   * Constructs an instance of TargetTcpProxyClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use TargetTcpProxySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetTcpProxyClient create(TargetTcpProxyStub stub) {
@@ -144,9 +129,9 @@ public static final TargetTcpProxyClient create(TargetTcpProxyStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetTcpProxyClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetTcpProxyClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetTcpProxyClient(TargetTcpProxySettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +153,41 @@ public TargetTcpProxyStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified TargetTcpProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetTcpProxy(String requestId, ProjectTargetTcpProxyName targetTcpProxy) { + public final Operation deleteTargetTcpProxy( + String requestId, ProjectGlobalTargetTcpProxyName targetTcpProxy) { DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) - .build(); + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .build(); return deleteTargetTcpProxy(request); } @@ -205,20 +195,25 @@ public final Operation deleteTargetTcpProxy(String requestId, ProjectTargetTcpPr /** * Deletes the specified TargetTcpProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,9 +222,9 @@ public final Operation deleteTargetTcpProxy(String requestId, String targetTcpPr DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy) - .build(); + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy) + .build(); return deleteTargetTcpProxy(request); } @@ -237,11 +232,12 @@ public final Operation deleteTargetTcpProxy(String requestId, String targetTcpPr /** * Deletes the specified TargetTcpProxy resource. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
@@ -262,11 +258,12 @@ public final Operation deleteTargetTcpProxy(DeleteTargetTcpProxyHttpRequest requ
   /**
    * Deletes the specified TargetTcpProxy resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
@@ -278,18 +275,21 @@ public final Operation deleteTargetTcpProxy(DeleteTargetTcpProxyHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetTcpProxyCallable() { + public final UnaryCallable + deleteTargetTcpProxyCallable() { return stub.deleteTargetTcpProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(targetTcpProxy);
    * }
    * 
@@ -298,23 +298,25 @@ public final UnaryCallable deleteTar * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final TargetTcpProxy getTargetTcpProxy(ProjectTargetTcpProxyName targetTcpProxy) { + public final TargetTcpProxy getTargetTcpProxy(ProjectGlobalTargetTcpProxyName targetTcpProxy) { GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder() - .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) - .build(); + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .build(); return getTargetTcpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxy response = targetTcpProxyClient.getTargetTcpProxy(targetTcpProxy.toString());
    * }
    * 
@@ -326,20 +328,20 @@ public final TargetTcpProxy getTargetTcpProxy(ProjectTargetTcpProxyName targetTc public final TargetTcpProxy getTargetTcpProxy(String targetTcpProxy) { GetTargetTcpProxyHttpRequest request = - GetTargetTcpProxyHttpRequest.newBuilder() - .setTargetTcpProxy(targetTcpProxy) - .build(); + GetTargetTcpProxyHttpRequest.newBuilder().setTargetTcpProxy(targetTcpProxy).build(); return getTargetTcpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. + * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * making a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder()
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .build();
@@ -357,12 +359,14 @@ public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest reque
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request.
+   * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by
+   * making a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder()
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .build();
@@ -373,15 +377,18 @@ public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest reque
    * 
*/ @BetaApi - public final UnaryCallable getTargetTcpProxyCallable() { + public final UnaryCallable + getTargetTcpProxyCallable() { return stub.getTargetTcpProxyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * Creates a TargetTcpProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
@@ -391,32 +398,40 @@ public final UnaryCallable getTarg
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) + * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== + * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetTcpProxy(String requestId, ProjectName project, TargetTcpProxy targetTcpProxyResource) { + public final Operation insertTargetTcpProxy( + String requestId, ProjectName project, TargetTcpProxy targetTcpProxyResource) { InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setTargetTcpProxyResource(targetTcpProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setTargetTcpProxyResource(targetTcpProxyResource) + .build(); return insertTargetTcpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * Creates a TargetTcpProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
@@ -426,32 +441,40 @@ public final Operation insertTargetTcpProxy(String requestId, ProjectName projec
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) + * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== + * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetTcpProxy(String requestId, String project, TargetTcpProxy targetTcpProxyResource) { + public final Operation insertTargetTcpProxy( + String requestId, String project, TargetTcpProxy targetTcpProxyResource) { InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setTargetTcpProxyResource(targetTcpProxyResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setTargetTcpProxyResource(targetTcpProxyResource) + .build(); return insertTargetTcpProxy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * Creates a TargetTcpProxy resource in the specified project using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
@@ -476,9 +499,11 @@ public final Operation insertTargetTcpProxy(InsertTargetTcpProxyHttpRequest requ
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a TargetTcpProxy resource in the specified project using the data included in the request.
+   * Creates a TargetTcpProxy resource in the specified project using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
@@ -496,7 +521,8 @@ public final Operation insertTargetTcpProxy(InsertTargetTcpProxyHttpRequest requ
    * 
*/ @BetaApi - public final UnaryCallable insertTargetTcpProxyCallable() { + public final UnaryCallable + insertTargetTcpProxyCallable() { return stub.insertTargetTcpProxyCallable(); } @@ -504,7 +530,8 @@ public final UnaryCallable insertTar /** * Retrieves the list of TargetTcpProxy resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -521,8 +548,8 @@ public final UnaryCallable insertTar
   public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ProjectName project) {
     ListTargetTcpProxiesHttpRequest request =
         ListTargetTcpProxiesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listTargetTcpProxies(request);
   }
 
@@ -530,7 +557,8 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ProjectName
   /**
    * Retrieves the list of TargetTcpProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -546,9 +574,7 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ProjectName
   @BetaApi
   public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(String project) {
     ListTargetTcpProxiesHttpRequest request =
-        ListTargetTcpProxiesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListTargetTcpProxiesHttpRequest.newBuilder().setProject(project).build();
     return listTargetTcpProxies(request);
   }
 
@@ -556,7 +582,8 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(String proje
   /**
    * Retrieves the list of TargetTcpProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -573,16 +600,17 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(String proje
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ListTargetTcpProxiesHttpRequest request) {
-    return listTargetTcpProxiesPagedCallable()
-        .call(request);
+  public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(
+      ListTargetTcpProxiesHttpRequest request) {
+    return listTargetTcpProxiesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of TargetTcpProxy resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -598,7 +626,8 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(ListTargetTc
    * 
*/ @BetaApi - public final UnaryCallable listTargetTcpProxiesPagedCallable() { + public final UnaryCallable + listTargetTcpProxiesPagedCallable() { return stub.listTargetTcpProxiesPagedCallable(); } @@ -606,7 +635,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -629,7 +659,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetTcpProxiesCallable() { + public final UnaryCallable + listTargetTcpProxiesCallable() { return stub.listTargetTcpProxiesCallable(); } @@ -637,34 +668,44 @@ public final UnaryCallable /** * Changes the BackendService for TargetTcpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to + * be set. * @param targetTcpProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackendServiceTargetTcpProxy(String requestId, ProjectTargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { + public final Operation setBackendServiceTargetTcpProxy( + String requestId, + ProjectGlobalTargetTcpProxyName targetTcpProxy, + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) - .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource) - .build(); + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .setTargetTcpProxiesSetBackendServiceRequestResource( + targetTcpProxiesSetBackendServiceRequestResource) + .build(); return setBackendServiceTargetTcpProxy(request); } @@ -672,34 +713,44 @@ public final Operation setBackendServiceTargetTcpProxy(String requestId, Project /** * Changes the BackendService for TargetTcpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetBackendServiceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to + * be set. * @param targetTcpProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setBackendServiceTargetTcpProxy(String requestId, String targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { + public final Operation setBackendServiceTargetTcpProxy( + String requestId, + String targetTcpProxy, + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy) - .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource) - .build(); + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy) + .setTargetTcpProxiesSetBackendServiceRequestResource( + targetTcpProxiesSetBackendServiceRequestResource) + .build(); return setBackendServiceTargetTcpProxy(request); } @@ -707,11 +758,12 @@ public final Operation setBackendServiceTargetTcpProxy(String requestId, String /** * Changes the BackendService for TargetTcpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -726,7 +778,8 @@ public final Operation setBackendServiceTargetTcpProxy(String requestId, String
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setBackendServiceTargetTcpProxy(SetBackendServiceTargetTcpProxyHttpRequest request) {
+  public final Operation setBackendServiceTargetTcpProxy(
+      SetBackendServiceTargetTcpProxyHttpRequest request) {
     return setBackendServiceTargetTcpProxyCallable().call(request);
   }
 
@@ -734,11 +787,12 @@ public final Operation setBackendServiceTargetTcpProxy(SetBackendServiceTargetTc
   /**
    * Changes the BackendService for TargetTcpProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -752,7 +806,8 @@ public final Operation setBackendServiceTargetTcpProxy(SetBackendServiceTargetTc
    * 
*/ @BetaApi - public final UnaryCallable setBackendServiceTargetTcpProxyCallable() { + public final UnaryCallable + setBackendServiceTargetTcpProxyCallable() { return stub.setBackendServiceTargetTcpProxyCallable(); } @@ -760,34 +815,43 @@ public final UnaryCallableSample code: + * *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. * @param targetTcpProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setProxyHeaderTargetTcpProxy(String requestId, ProjectTargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { + public final Operation setProxyHeaderTargetTcpProxy( + String requestId, + ProjectGlobalTargetTcpProxyName targetTcpProxy, + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) - .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource) - .build(); + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) + .setTargetTcpProxiesSetProxyHeaderRequestResource( + targetTcpProxiesSetProxyHeaderRequestResource) + .build(); return setProxyHeaderTargetTcpProxy(request); } @@ -795,34 +859,43 @@ public final Operation setProxyHeaderTargetTcpProxy(String requestId, ProjectTar /** * Changes the ProxyHeaderType for TargetTcpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetProxyHeaderRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. * @param targetTcpProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setProxyHeaderTargetTcpProxy(String requestId, String targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { + public final Operation setProxyHeaderTargetTcpProxy( + String requestId, + String targetTcpProxy, + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy) - .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource) - .build(); + .setRequestId(requestId) + .setTargetTcpProxy(targetTcpProxy) + .setTargetTcpProxiesSetProxyHeaderRequestResource( + targetTcpProxiesSetProxyHeaderRequestResource) + .build(); return setProxyHeaderTargetTcpProxy(request); } @@ -830,11 +903,12 @@ public final Operation setProxyHeaderTargetTcpProxy(String requestId, String tar /** * Changes the ProxyHeaderType for TargetTcpProxy. * - * Sample code: + *

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -849,7 +923,8 @@ public final Operation setProxyHeaderTargetTcpProxy(String requestId, String tar
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final Operation setProxyHeaderTargetTcpProxy(SetProxyHeaderTargetTcpProxyHttpRequest request) {
+  public final Operation setProxyHeaderTargetTcpProxy(
+      SetProxyHeaderTargetTcpProxyHttpRequest request) {
     return setProxyHeaderTargetTcpProxyCallable().call(request);
   }
 
@@ -857,11 +932,12 @@ public final Operation setProxyHeaderTargetTcpProxy(SetProxyHeaderTargetTcpProxy
   /**
    * Changes the ProxyHeaderType for TargetTcpProxy.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
    *   String requestId = "";
-   *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+   *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
    *     .setRequestId(requestId)
@@ -875,12 +951,13 @@ public final Operation setProxyHeaderTargetTcpProxy(SetProxyHeaderTargetTcpProxy
    * 
*/ @BetaApi - public final UnaryCallable setProxyHeaderTargetTcpProxyCallable() { + public final UnaryCallable + setProxyHeaderTargetTcpProxyCallable() { return stub.setProxyHeaderTargetTcpProxyCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -909,12 +986,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListTargetTcpProxiesPagedResponse extends AbstractPagedListResponse< - ListTargetTcpProxiesHttpRequest, - TargetTcpProxyList, - TargetTcpProxy, - ListTargetTcpProxiesPage, - ListTargetTcpProxiesFixedSizeCollection> { + public static class ListTargetTcpProxiesPagedResponse + extends AbstractPagedListResponse< + ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, TargetTcpProxy, + ListTargetTcpProxiesPage, ListTargetTcpProxiesFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -934,15 +1009,12 @@ public ListTargetTcpProxiesPagedResponse apply(ListTargetTcpProxiesPage input) { private ListTargetTcpProxiesPagedResponse(ListTargetTcpProxiesPage page) { super(page, ListTargetTcpProxiesFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetTcpProxiesPage extends AbstractPage< - ListTargetTcpProxiesHttpRequest, - TargetTcpProxyList, - TargetTcpProxy, - ListTargetTcpProxiesPage> { + public static class ListTargetTcpProxiesPage + extends AbstractPage< + ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, TargetTcpProxy, + ListTargetTcpProxiesPage> { private ListTargetTcpProxiesPage( PageContext context, @@ -967,20 +1039,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetTcpProxiesFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetTcpProxiesHttpRequest, - TargetTcpProxyList, - TargetTcpProxy, - ListTargetTcpProxiesPage, - ListTargetTcpProxiesFixedSizeCollection> { + public static class ListTargetTcpProxiesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, TargetTcpProxy, + ListTargetTcpProxiesPage, ListTargetTcpProxiesFixedSizeCollection> { - private ListTargetTcpProxiesFixedSizeCollection(List pages, int collectionSize) { + private ListTargetTcpProxiesFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -993,7 +1060,5 @@ protected ListTargetTcpProxiesFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetTcpProxiesFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java index 6560f4910bf3..77340a74321c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetTcpProxyList() { this.warning = null; } - private TargetTcpProxyList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetTcpProxyList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetTcpProxyList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetTcpProxyList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetTcpProxyList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetTcpProxyList build() { - - - - - return new TargetTcpProxyList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetTcpProxyList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetTcpProxyList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetTcpProxyList) { TargetTcpProxyList that = (TargetTcpProxyList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java index c2026bbef507..34de8a4cf7f9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; import com.google.cloud.compute.v1.stub.TargetTcpProxyStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetTcpProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetTcpProxy to 30 seconds: * *

  * 
@@ -85,91 +63,76 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetTcpProxySettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteTargetTcpProxy.
-   */
-  public UnaryCallSettings deleteTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to deleteTargetTcpProxy. */
+  public UnaryCallSettings
+      deleteTargetTcpProxySettings() {
     return ((TargetTcpProxyStubSettings) getStubSettings()).deleteTargetTcpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetTcpProxy.
-   */
-  public UnaryCallSettings getTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetTcpProxy. */
+  public UnaryCallSettings
+      getTargetTcpProxySettings() {
     return ((TargetTcpProxyStubSettings) getStubSettings()).getTargetTcpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetTcpProxy.
-   */
-  public UnaryCallSettings insertTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetTcpProxy. */
+  public UnaryCallSettings
+      insertTargetTcpProxySettings() {
     return ((TargetTcpProxyStubSettings) getStubSettings()).insertTargetTcpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetTcpProxies.
-   */
-  public PagedCallSettings listTargetTcpProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetTcpProxies. */
+  public PagedCallSettings<
+          ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse>
+      listTargetTcpProxiesSettings() {
     return ((TargetTcpProxyStubSettings) getStubSettings()).listTargetTcpProxiesSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setBackendServiceTargetTcpProxy.
-   */
-  public UnaryCallSettings setBackendServiceTargetTcpProxySettings() {
-    return ((TargetTcpProxyStubSettings) getStubSettings()).setBackendServiceTargetTcpProxySettings();
+  /** Returns the object with the settings used for calls to setBackendServiceTargetTcpProxy. */
+  public UnaryCallSettings
+      setBackendServiceTargetTcpProxySettings() {
+    return ((TargetTcpProxyStubSettings) getStubSettings())
+        .setBackendServiceTargetTcpProxySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to setProxyHeaderTargetTcpProxy.
-   */
-  public UnaryCallSettings setProxyHeaderTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to setProxyHeaderTargetTcpProxy. */
+  public UnaryCallSettings
+      setProxyHeaderTargetTcpProxySettings() {
     return ((TargetTcpProxyStubSettings) getStubSettings()).setProxyHeaderTargetTcpProxySettings();
   }
 
-
-  public static final TargetTcpProxySettings create(TargetTcpProxyStubSettings stub) throws IOException {
+  public static final TargetTcpProxySettings create(TargetTcpProxyStubSettings stub)
+      throws IOException {
     return new TargetTcpProxySettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetTcpProxyStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetTcpProxyStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetTcpProxyStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetTcpProxyStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetTcpProxyStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetTcpProxyStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetTcpProxyStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -182,23 +145,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetTcpProxyStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -207,9 +164,7 @@ protected TargetTcpProxySettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetTcpProxySettings.
-   */
+  /** Builder for TargetTcpProxySettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -231,60 +186,57 @@ protected Builder(TargetTcpProxyStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetTcpProxyStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetTcpProxyStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteTargetTcpProxy. - */ - public UnaryCallSettings.Builder deleteTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetTcpProxy. */ + public UnaryCallSettings.Builder + deleteTargetTcpProxySettings() { return getStubSettingsBuilder().deleteTargetTcpProxySettings(); } - /** - * Returns the builder for the settings used for calls to getTargetTcpProxy. - */ - public UnaryCallSettings.Builder getTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to getTargetTcpProxy. */ + public UnaryCallSettings.Builder + getTargetTcpProxySettings() { return getStubSettingsBuilder().getTargetTcpProxySettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetTcpProxy. - */ - public UnaryCallSettings.Builder insertTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetTcpProxy. */ + public UnaryCallSettings.Builder + insertTargetTcpProxySettings() { return getStubSettingsBuilder().insertTargetTcpProxySettings(); } - /** - * Returns the builder for the settings used for calls to listTargetTcpProxies. - */ - public PagedCallSettings.Builder listTargetTcpProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetTcpProxies. */ + public PagedCallSettings.Builder< + ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse> + listTargetTcpProxiesSettings() { return getStubSettingsBuilder().listTargetTcpProxiesSettings(); } - /** - * Returns the builder for the settings used for calls to setBackendServiceTargetTcpProxy. - */ - public UnaryCallSettings.Builder setBackendServiceTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to setBackendServiceTargetTcpProxy. */ + public UnaryCallSettings.Builder + setBackendServiceTargetTcpProxySettings() { return getStubSettingsBuilder().setBackendServiceTargetTcpProxySettings(); } - /** - * Returns the builder for the settings used for calls to setProxyHeaderTargetTcpProxy. - */ - public UnaryCallSettings.Builder setProxyHeaderTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to setProxyHeaderTargetTcpProxy. */ + public UnaryCallSettings.Builder + setProxyHeaderTargetTcpProxySettings() { return getStubSettingsBuilder().setProxyHeaderTargetTcpProxySettings(); } @@ -293,4 +245,4 @@ public TargetTcpProxySettings build() throws IOException { return new TargetTcpProxySettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java index 7b182e775054..43e0beaa5b26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -58,7 +57,6 @@ private TargetVpnGateway() { this.tunnels = null; } - private TargetVpnGateway( String creationTimestamp, String description, @@ -70,8 +68,7 @@ private TargetVpnGateway( String region, String selfLink, String status, - List tunnels - ) { + List tunnels) { this.creationTimestamp = creationTimestamp; this.description = description; this.forwardingRules = forwardingRules; @@ -89,7 +86,8 @@ private TargetVpnGateway( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -220,22 +218,24 @@ public List getTunnelsList() { return tunnels; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetVpnGateway prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetVpnGateway getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetVpnGateway DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetVpnGateway(); } @@ -422,31 +422,20 @@ public Builder addTunnels(String tunnels) { return this; } - public TargetVpnGateway build() { - - - - - - - - - return new TargetVpnGateway( - creationTimestamp, - description, - forwardingRules, - id, - kind, - name, - network, - region, - selfLink, - status, - tunnels - ); + creationTimestamp, + description, + forwardingRules, + id, + kind, + name, + network, + region, + selfLink, + status, + tunnels); } public Builder clone() { @@ -469,17 +458,38 @@ public Builder clone() { @Override public String toString() { return "TargetVpnGateway{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "forwardingRules=" + forwardingRules + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "network=" + network + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "status=" + status + ", " - + "tunnels=" + tunnels + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "forwardingRules=" + + forwardingRules + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "network=" + + network + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "status=" + + status + + ", " + + "tunnels=" + + tunnels + "}"; } @@ -490,19 +500,17 @@ public boolean equals(Object o) { } if (o instanceof TargetVpnGateway) { TargetVpnGateway that = (TargetVpnGateway) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.forwardingRules, that.getForwardingRulesList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.network, that.getNetwork()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.tunnels, that.getTunnelsList()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.forwardingRules, that.getForwardingRulesList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.tunnels, that.getTunnelsList()); } return false; } @@ -510,17 +518,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - forwardingRules, - id, - kind, - name, - network, - region, - selfLink, - status, - tunnels - ); + creationTimestamp, + description, + forwardingRules, + id, + kind, + name, + network, + region, + selfLink, + status, + tunnels); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java index 1d334e0e5b7a..36337ef7da0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private TargetVpnGatewayAggregatedList() { this.warning = null; } - private TargetVpnGatewayAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetVpnGatewayAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetVpnGatewayAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetVpnGatewayAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetVpnGatewayAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetVpnGatewayAggregatedList build() { - - - - - return new TargetVpnGatewayAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetVpnGatewayAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "TargetVpnGatewayAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof TargetVpnGatewayAggregatedList) { TargetVpnGatewayAggregatedList that = (TargetVpnGatewayAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java index 49e8554842be..8cd32a68fb45 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStub; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,34 @@ * *

* - *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + *

Note: close() needs to be called on the targetVpnGatewayClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of TargetVpnGatewaySettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,27 +106,23 @@ public class TargetVpnGatewayClient implements BackgroundResource {
   private final TargetVpnGatewaySettings settings;
   private final TargetVpnGatewayStub stub;
 
-
-
-  /**
-   * Constructs an instance of TargetVpnGatewayClient with default settings.
-   */
+  /** Constructs an instance of TargetVpnGatewayClient with default settings. */
   public static final TargetVpnGatewayClient create() throws IOException {
     return create(TargetVpnGatewaySettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of TargetVpnGatewayClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings) throws IOException {
+  public static final TargetVpnGatewayClient create(TargetVpnGatewaySettings settings)
+      throws IOException {
     return new TargetVpnGatewayClient(settings);
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use TargetVpnGatewaySettings}.
+   * Constructs an instance of TargetVpnGatewayClient, using the given stub for making calls. This
+   * is for advanced usage - prefer to use TargetVpnGatewaySettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) {
@@ -144,9 +130,9 @@ public static final TargetVpnGatewayClient create(TargetVpnGatewayStub stub) {
   }
 
   /**
-   * Constructs an instance of TargetVpnGatewayClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of TargetVpnGatewayClient, using the given settings. This is protected
+   * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected TargetVpnGatewayClient(TargetVpnGatewaySettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +154,12 @@ public TargetVpnGatewayStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -187,11 +173,12 @@ public TargetVpnGatewayStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(ProjectName project) {
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
+      ProjectName project) {
     AggregatedListTargetVpnGatewaysHttpRequest request =
         AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListTargetVpnGateways(request);
   }
 
@@ -199,7 +186,8 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -213,11 +201,10 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(String project) {
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
+      String project) {
     AggregatedListTargetVpnGatewaysHttpRequest request =
-        AggregatedListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListTargetVpnGatewaysHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListTargetVpnGateways(request);
   }
 
@@ -225,7 +212,8 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +230,17 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(AggregatedListTargetVpnGatewaysHttpRequest request) {
-    return aggregatedListTargetVpnGatewaysPagedCallable()
-        .call(request);
+  public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVpnGateways(
+      AggregatedListTargetVpnGatewaysHttpRequest request) {
+    return aggregatedListTargetVpnGatewaysPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of target VPN gateways.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +256,9 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { + public final UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysPagedCallable() { return stub.aggregatedListTargetVpnGatewaysPagedCallable(); } @@ -275,7 +266,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +290,9 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListTargetVpnGatewaysCallable() { + public final UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList> + aggregatedListTargetVpnGatewaysCallable() { return stub.aggregatedListTargetVpnGatewaysCallable(); } @@ -306,7 +300,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -315,22 +310,27 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetVpnGateway Name of the target VPN gateway to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetVpnGateway(String requestId, ProjectRegionTargetVpnGatewayName targetVpnGateway) { + public final Operation deleteTargetVpnGateway( + String requestId, ProjectRegionTargetVpnGatewayName targetVpnGateway) { DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) - .build(); + .setRequestId(requestId) + .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) + .build(); return deleteTargetVpnGateway(request); } @@ -338,7 +338,8 @@ public final Operation deleteTargetVpnGateway(String requestId, ProjectRegionTar /** * Deletes the specified target VPN gateway. * - * Sample code: + *

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -347,11 +348,15 @@ public final Operation deleteTargetVpnGateway(String requestId, ProjectRegionTar
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param targetVpnGateway Name of the target VPN gateway to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -360,9 +365,9 @@ public final Operation deleteTargetVpnGateway(String requestId, String targetVpn DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetVpnGateway(targetVpnGateway) - .build(); + .setRequestId(requestId) + .setTargetVpnGateway(targetVpnGateway) + .build(); return deleteTargetVpnGateway(request); } @@ -370,7 +375,8 @@ public final Operation deleteTargetVpnGateway(String requestId, String targetVpn /** * Deletes the specified target VPN gateway. * - * Sample code: + *

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -395,7 +401,8 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
   /**
    * Deletes the specified target VPN gateway.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -411,15 +418,18 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable deleteTargetVpnGatewayCallable() { + public final UnaryCallable + deleteTargetVpnGatewayCallable() { return stub.deleteTargetVpnGatewayCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. + * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making + * a list() request. + * + *

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -431,20 +441,23 @@ public final UnaryCallable deleteT
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final TargetVpnGateway getTargetVpnGateway(ProjectRegionTargetVpnGatewayName targetVpnGateway) {
+  public final TargetVpnGateway getTargetVpnGateway(
+      ProjectRegionTargetVpnGatewayName targetVpnGateway) {
 
     GetTargetVpnGatewayHttpRequest request =
         GetTargetVpnGatewayHttpRequest.newBuilder()
-        .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
-        .build();
+            .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString())
+            .build();
     return getTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
+   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -459,17 +472,17 @@ public final TargetVpnGateway getTargetVpnGateway(ProjectRegionTargetVpnGatewayN
   public final TargetVpnGateway getTargetVpnGateway(String targetVpnGateway) {
 
     GetTargetVpnGatewayHttpRequest request =
-        GetTargetVpnGatewayHttpRequest.newBuilder()
-        .setTargetVpnGateway(targetVpnGateway)
-        .build();
+        GetTargetVpnGatewayHttpRequest.newBuilder().setTargetVpnGateway(targetVpnGateway).build();
     return getTargetVpnGateway(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
+   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -490,9 +503,11 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.
+   * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making
+   * a list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
@@ -506,15 +521,18 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable getTargetVpnGatewayCallable() { + public final UnaryCallable + getTargetVpnGatewayCallable() { return stub.getTargetVpnGatewayCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the request. + * Creates a target VPN gateway in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -524,32 +542,40 @@ public final UnaryCallable get
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) + * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for + * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetVpnGateway(String requestId, ProjectRegionName region, TargetVpnGateway targetVpnGatewayResource) { + public final Operation insertTargetVpnGateway( + String requestId, ProjectRegionName region, TargetVpnGateway targetVpnGatewayResource) { InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setTargetVpnGatewayResource(targetVpnGatewayResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setTargetVpnGatewayResource(targetVpnGatewayResource) + .build(); return insertTargetVpnGateway(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the request. + * Creates a target VPN gateway in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -559,32 +585,40 @@ public final Operation insertTargetVpnGateway(String requestId, ProjectRegionNam
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) + * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for + * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetVpnGateway(String requestId, String region, TargetVpnGateway targetVpnGatewayResource) { + public final Operation insertTargetVpnGateway( + String requestId, String region, TargetVpnGateway targetVpnGatewayResource) { InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setTargetVpnGatewayResource(targetVpnGatewayResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setTargetVpnGatewayResource(targetVpnGatewayResource) + .build(); return insertTargetVpnGateway(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a target VPN gateway in the specified project and region using the data included in the request. + * Creates a target VPN gateway in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -609,9 +643,11 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a target VPN gateway in the specified project and region using the data included in the request.
+   * Creates a target VPN gateway in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   String requestId = "";
@@ -629,7 +665,8 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
    * 
*/ @BetaApi - public final UnaryCallable insertTargetVpnGatewayCallable() { + public final UnaryCallable + insertTargetVpnGatewayCallable() { return stub.insertTargetVpnGatewayCallable(); } @@ -637,7 +674,8 @@ public final UnaryCallable insertT /** * Retrieves a list of target VPN gateways available to the specified project and region. * - * Sample code: + *

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -654,8 +692,8 @@ public final UnaryCallable insertT
   public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ProjectRegionName region) {
     ListTargetVpnGatewaysHttpRequest request =
         ListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listTargetVpnGateways(request);
   }
 
@@ -663,7 +701,8 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ProjectReg
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -679,9 +718,7 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ProjectReg
   @BetaApi
   public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String region) {
     ListTargetVpnGatewaysHttpRequest request =
-        ListTargetVpnGatewaysHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListTargetVpnGatewaysHttpRequest.newBuilder().setRegion(region).build();
     return listTargetVpnGateways(request);
   }
 
@@ -689,7 +726,8 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -706,16 +744,17 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(String reg
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTargetVpnGatewaysHttpRequest request) {
-    return listTargetVpnGatewaysPagedCallable()
-        .call(request);
+  public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(
+      ListTargetVpnGatewaysHttpRequest request) {
+    return listTargetVpnGatewaysPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of target VPN gateways available to the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -731,7 +770,8 @@ public final ListTargetVpnGatewaysPagedResponse listTargetVpnGateways(ListTarget
    * 
*/ @BetaApi - public final UnaryCallable listTargetVpnGatewaysPagedCallable() { + public final UnaryCallable + listTargetVpnGatewaysPagedCallable() { return stub.listTargetVpnGatewaysPagedCallable(); } @@ -739,7 +779,8 @@ public final UnaryCallableSample code: + * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -762,12 +803,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listTargetVpnGatewaysCallable() { + public final UnaryCallable + listTargetVpnGatewaysCallable() { return stub.listTargetVpnGatewaysCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -796,23 +838,28 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class AggregatedListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage, - AggregatedListTargetVpnGatewaysFixedSizeCollection> { + public static class AggregatedListTargetVpnGatewaysPagedResponse + extends AbstractPagedListResponse< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, ApiFuture futureResponse) { ApiFuture futurePage = - AggregatedListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); + AggregatedListTargetVpnGatewaysPage.createEmptyPage() + .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { + new ApiFunction< + AggregatedListTargetVpnGatewaysPage, AggregatedListTargetVpnGatewaysPagedResponse>() { @Override - public AggregatedListTargetVpnGatewaysPagedResponse apply(AggregatedListTargetVpnGatewaysPage input) { + public AggregatedListTargetVpnGatewaysPagedResponse apply( + AggregatedListTargetVpnGatewaysPage input) { return new AggregatedListTargetVpnGatewaysPagedResponse(input); } }); @@ -821,18 +868,18 @@ public AggregatedListTargetVpnGatewaysPagedResponse apply(AggregatedListTargetVp private AggregatedListTargetVpnGatewaysPagedResponse(AggregatedListTargetVpnGatewaysPage page) { super(page, AggregatedListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); } - - } - public static class AggregatedListTargetVpnGatewaysPage extends AbstractPage< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage> { + public static class AggregatedListTargetVpnGatewaysPage + extends AbstractPage< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, AggregatedListTargetVpnGatewaysPage> { private AggregatedListTargetVpnGatewaysPage( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, TargetVpnGatewayAggregatedList response) { super(context, response); } @@ -843,31 +890,33 @@ private static AggregatedListTargetVpnGatewaysPage createEmptyPage() { @Override protected AggregatedListTargetVpnGatewaysPage createPage( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, TargetVpnGatewayAggregatedList response) { return new AggregatedListTargetVpnGatewaysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class AggregatedListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< - AggregatedListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayAggregatedList, - TargetVpnGatewaysScopedList, - AggregatedListTargetVpnGatewaysPage, - AggregatedListTargetVpnGatewaysFixedSizeCollection> { + public static class AggregatedListTargetVpnGatewaysFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + TargetVpnGatewaysScopedList, AggregatedListTargetVpnGatewaysPage, + AggregatedListTargetVpnGatewaysFixedSizeCollection> { - private AggregatedListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListTargetVpnGatewaysFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -880,18 +929,16 @@ protected AggregatedListTargetVpnGatewaysFixedSizeCollection createCollection( List pages, int collectionSize) { return new AggregatedListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); } - - } - public static class ListTargetVpnGatewaysPagedResponse extends AbstractPagedListResponse< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage, - ListTargetVpnGatewaysFixedSizeCollection> { + + public static class ListTargetVpnGatewaysPagedResponse + extends AbstractPagedListResponse< + ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, TargetVpnGateway, + ListTargetVpnGatewaysPage, ListTargetVpnGatewaysFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { ApiFuture futurePage = ListTargetVpnGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -908,18 +955,16 @@ public ListTargetVpnGatewaysPagedResponse apply(ListTargetVpnGatewaysPage input) private ListTargetVpnGatewaysPagedResponse(ListTargetVpnGatewaysPage page) { super(page, ListTargetVpnGatewaysFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListTargetVpnGatewaysPage extends AbstractPage< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage> { + public static class ListTargetVpnGatewaysPage + extends AbstractPage< + ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, TargetVpnGateway, + ListTargetVpnGatewaysPage> { private ListTargetVpnGatewaysPage( - PageContext context, + PageContext + context, TargetVpnGatewayList response) { super(context, response); } @@ -930,31 +975,28 @@ private static ListTargetVpnGatewaysPage createEmptyPage() { @Override protected ListTargetVpnGatewaysPage createPage( - PageContext context, + PageContext + context, TargetVpnGatewayList response) { return new ListTargetVpnGatewaysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListTargetVpnGatewaysFixedSizeCollection extends AbstractFixedSizeCollection< - ListTargetVpnGatewaysHttpRequest, - TargetVpnGatewayList, - TargetVpnGateway, - ListTargetVpnGatewaysPage, - ListTargetVpnGatewaysFixedSizeCollection> { + public static class ListTargetVpnGatewaysFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, TargetVpnGateway, + ListTargetVpnGatewaysPage, ListTargetVpnGatewaysFixedSizeCollection> { - private ListTargetVpnGatewaysFixedSizeCollection(List pages, int collectionSize) { + private ListTargetVpnGatewaysFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -967,7 +1009,5 @@ protected ListTargetVpnGatewaysFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListTargetVpnGatewaysFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java index 96555bee7946..1748b6d159f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private TargetVpnGatewayList() { this.warning = null; } - private TargetVpnGatewayList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetVpnGatewayList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetVpnGatewayList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetVpnGatewayList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetVpnGatewayList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetVpnGatewayList build() { - - - - - return new TargetVpnGatewayList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new TargetVpnGatewayList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "TargetVpnGatewayList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof TargetVpnGatewayList) { TargetVpnGatewayList that = (TargetVpnGatewayList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java deleted file mode 100644 index 2ac2a7859cb2..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceNameFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; - -@Generated("by GAPIC") -@BetaApi -public final class TargetVpnGatewayName implements com.google.api.resourcenames.ResourceName { - private final String project; - private final String region; - private final String targetVpnGateway; - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"); - - private volatile Map fieldValuesMap; - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private TargetVpnGatewayName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - targetVpnGateway = Preconditions.checkNotNull(builder.getTargetVpnGateway()); - } - - public static TargetVpnGatewayName of( - String project, - String region, - String targetVpnGateway - ) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setTargetVpnGateway(targetVpnGateway) - .build(); - } - - public static String format( - String project, - String region, - String targetVpnGateway - ) { - return of( - project, - region, - targetVpnGateway - ) - .toString(); - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - public String getTargetVpnGateway() { - return targetVpnGateway; - } - - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("region", region); - fieldMapBuilder.put("targetVpnGateway", targetVpnGateway); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - - public static ResourceNameFactory newFactory() { - return new ResourceNameFactory() { - public TargetVpnGatewayName parse(String formattedString) {return TargetVpnGatewayName.parse(formattedString);} - }; - } - - public static TargetVpnGatewayName parse(String formattedString) { - Map matchMap = - PATH_TEMPLATE.validatedMatch(formattedString, "TargetVpnGatewayName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("region"), - matchMap.get("targetVpnGateway") - ); - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public static class Builder { - private String project; - private String region; - private String targetVpnGateway; - - public String getProject() { - return project; - } - public String getRegion() { - return region; - } - public String getTargetVpnGateway() { - return targetVpnGateway; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - public Builder setRegion(String region) { - this.region = region; - return this; - } - public Builder setTargetVpnGateway(String targetVpnGateway) { - this.targetVpnGateway = targetVpnGateway; - return this; - } - - private Builder() {} - - public Builder (TargetVpnGatewayName targetVpnGatewayName) { - project = targetVpnGatewayName.project; - region = targetVpnGatewayName.region; - targetVpnGateway = targetVpnGatewayName.targetVpnGateway; - } - - public TargetVpnGatewayName build() { - return new TargetVpnGatewayName(this); - } - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, - "region", region, - "targetVpnGateway", targetVpnGateway - ); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof TargetVpnGatewayName) { - TargetVpnGatewayName that = (TargetVpnGatewayName) o; - return - Objects.equals(this.project, that.getProject()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) - ; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - project, - region, - targetVpnGateway - ); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java index db93426cdc41..0cff3f8d7670 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java @@ -15,46 +15,24 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -63,15 +41,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetVpnGateway to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetVpnGateway to 30 seconds: * *

  * 
@@ -86,84 +64,73 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetVpnGatewaySettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListTargetVpnGateways.
-   */
-  public PagedCallSettings aggregatedListTargetVpnGatewaysSettings() {
-    return ((TargetVpnGatewayStubSettings) getStubSettings()).aggregatedListTargetVpnGatewaysSettings();
-  }
-
-  /**
-   * Returns the object with the settings used for calls to deleteTargetVpnGateway.
-   */
-  public UnaryCallSettings deleteTargetVpnGatewaySettings() {
+  /** Returns the object with the settings used for calls to aggregatedListTargetVpnGateways. */
+  public PagedCallSettings<
+          AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+          AggregatedListTargetVpnGatewaysPagedResponse>
+      aggregatedListTargetVpnGatewaysSettings() {
+    return ((TargetVpnGatewayStubSettings) getStubSettings())
+        .aggregatedListTargetVpnGatewaysSettings();
+  }
+
+  /** Returns the object with the settings used for calls to deleteTargetVpnGateway. */
+  public UnaryCallSettings
+      deleteTargetVpnGatewaySettings() {
     return ((TargetVpnGatewayStubSettings) getStubSettings()).deleteTargetVpnGatewaySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetVpnGateway.
-   */
-  public UnaryCallSettings getTargetVpnGatewaySettings() {
+  /** Returns the object with the settings used for calls to getTargetVpnGateway. */
+  public UnaryCallSettings
+      getTargetVpnGatewaySettings() {
     return ((TargetVpnGatewayStubSettings) getStubSettings()).getTargetVpnGatewaySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetVpnGateway.
-   */
-  public UnaryCallSettings insertTargetVpnGatewaySettings() {
+  /** Returns the object with the settings used for calls to insertTargetVpnGateway. */
+  public UnaryCallSettings
+      insertTargetVpnGatewaySettings() {
     return ((TargetVpnGatewayStubSettings) getStubSettings()).insertTargetVpnGatewaySettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetVpnGateways.
-   */
-  public PagedCallSettings listTargetVpnGatewaysSettings() {
+  /** Returns the object with the settings used for calls to listTargetVpnGateways. */
+  public PagedCallSettings<
+          ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList,
+          ListTargetVpnGatewaysPagedResponse>
+      listTargetVpnGatewaysSettings() {
     return ((TargetVpnGatewayStubSettings) getStubSettings()).listTargetVpnGatewaysSettings();
   }
 
-
-  public static final TargetVpnGatewaySettings create(TargetVpnGatewayStubSettings stub) throws IOException {
+  public static final TargetVpnGatewaySettings create(TargetVpnGatewayStubSettings stub)
+      throws IOException {
     return new TargetVpnGatewaySettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return TargetVpnGatewayStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return TargetVpnGatewayStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return TargetVpnGatewayStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return TargetVpnGatewayStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return TargetVpnGatewayStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return TargetVpnGatewayStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return TargetVpnGatewayStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -176,23 +143,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return TargetVpnGatewayStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -201,9 +162,7 @@ protected TargetVpnGatewaySettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for TargetVpnGatewaySettings.
-   */
+  /** Builder for TargetVpnGatewaySettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -225,53 +184,54 @@ protected Builder(TargetVpnGatewayStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public TargetVpnGatewayStubSettings.Builder getStubSettingsBuilder() {
       return ((TargetVpnGatewayStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListTargetVpnGateways. - */ - public PagedCallSettings.Builder aggregatedListTargetVpnGatewaysSettings() { + /** Returns the builder for the settings used for calls to aggregatedListTargetVpnGateways. */ + public PagedCallSettings.Builder< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysSettings() { return getStubSettingsBuilder().aggregatedListTargetVpnGatewaysSettings(); } - /** - * Returns the builder for the settings used for calls to deleteTargetVpnGateway. - */ - public UnaryCallSettings.Builder deleteTargetVpnGatewaySettings() { + /** Returns the builder for the settings used for calls to deleteTargetVpnGateway. */ + public UnaryCallSettings.Builder + deleteTargetVpnGatewaySettings() { return getStubSettingsBuilder().deleteTargetVpnGatewaySettings(); } - /** - * Returns the builder for the settings used for calls to getTargetVpnGateway. - */ - public UnaryCallSettings.Builder getTargetVpnGatewaySettings() { + /** Returns the builder for the settings used for calls to getTargetVpnGateway. */ + public UnaryCallSettings.Builder + getTargetVpnGatewaySettings() { return getStubSettingsBuilder().getTargetVpnGatewaySettings(); } - /** - * Returns the builder for the settings used for calls to insertTargetVpnGateway. - */ - public UnaryCallSettings.Builder insertTargetVpnGatewaySettings() { + /** Returns the builder for the settings used for calls to insertTargetVpnGateway. */ + public UnaryCallSettings.Builder + insertTargetVpnGatewaySettings() { return getStubSettingsBuilder().insertTargetVpnGatewaySettings(); } - /** - * Returns the builder for the settings used for calls to listTargetVpnGateways. - */ - public PagedCallSettings.Builder listTargetVpnGatewaysSettings() { + /** Returns the builder for the settings used for calls to listTargetVpnGateways. */ + public PagedCallSettings.Builder< + ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, + ListTargetVpnGatewaysPagedResponse> + listTargetVpnGatewaysSettings() { return getStubSettingsBuilder().listTargetVpnGatewaysSettings(); } @@ -280,4 +240,4 @@ public TargetVpnGatewaySettings build() throws IOException { return new TargetVpnGatewaySettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java index 48ed9f78bf64..81f4c5bbe9ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private TargetVpnGatewaysScopedList() { this.warning = null; } - - private TargetVpnGatewaysScopedList( - List targetVpnGateways, - Warning warning - ) { + private TargetVpnGatewaysScopedList(List targetVpnGateways, Warning warning) { this.targetVpnGateways = targetVpnGateways; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TargetVpnGatewaysScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TargetVpnGatewaysScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TargetVpnGatewaysScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TargetVpnGatewaysScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public TargetVpnGatewaysScopedList build() { - return new TargetVpnGatewaysScopedList( - targetVpnGateways, - warning - ); + return new TargetVpnGatewaysScopedList(targetVpnGateways, warning); } public Builder clone() { @@ -178,8 +171,11 @@ public Builder clone() { @Override public String toString() { return "TargetVpnGatewaysScopedList{" - + "targetVpnGateways=" + targetVpnGateways + ", " - + "warning=" + warning + + "targetVpnGateways=" + + targetVpnGateways + + ", " + + "warning=" + + warning + "}"; } @@ -190,19 +186,14 @@ public boolean equals(Object o) { } if (o instanceof TargetVpnGatewaysScopedList) { TargetVpnGatewaysScopedList that = (TargetVpnGatewaysScopedList) o; - return - Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.targetVpnGateways, that.getTargetVpnGatewaysList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - targetVpnGateways, - warning - ); + return Objects.hash(targetVpnGateways, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java index 81730c434638..1604e2e56205 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,13 +41,7 @@ private TestFailure() { this.path = null; } - - private TestFailure( - String actualService, - String expectedService, - String host, - String path - ) { + private TestFailure(String actualService, String expectedService, String host, String path) { this.actualService = actualService; this.expectedService = expectedService; this.host = host; @@ -114,22 +105,24 @@ public String getPath() { return path; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(TestFailure prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static TestFailure getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final TestFailure DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new TestFailure(); } @@ -202,17 +195,9 @@ public Builder setPath(String path) { return this; } - public TestFailure build() { - - - return new TestFailure( - actualService, - expectedService, - host, - path - ); + return new TestFailure(actualService, expectedService, host, path); } public Builder clone() { @@ -228,10 +213,17 @@ public Builder clone() { @Override public String toString() { return "TestFailure{" - + "actualService=" + actualService + ", " - + "expectedService=" + expectedService + ", " - + "host=" + host + ", " - + "path=" + path + + "actualService=" + + actualService + + ", " + + "expectedService=" + + expectedService + + ", " + + "host=" + + host + + ", " + + "path=" + + path + "}"; } @@ -242,23 +234,16 @@ public boolean equals(Object o) { } if (o instanceof TestFailure) { TestFailure that = (TestFailure) o; - return - Objects.equals(this.actualService, that.getActualService()) && - Objects.equals(this.expectedService, that.getExpectedService()) && - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.path, that.getPath()) - ; + return Objects.equals(this.actualService, that.getActualService()) + && Objects.equals(this.expectedService, that.getExpectedService()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.path, that.getPath()); } return false; } @Override public int hashCode() { - return Objects.hash( - actualService, - expectedService, - host, - path - ); + return Objects.hash(actualService, expectedService, host, path); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java new file mode 100644 index 000000000000..6efe2d8d36a8 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java @@ -0,0 +1,449 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TestIamPermissionsLicenseCodeHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsLicenseCodeHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsLicenseCodeHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("testPermissionsRequestResource") + && testPermissionsRequestResource != null) { + fieldMap.put( + "testPermissionsRequestResource", + Collections.singletonList(String.valueOf(testPermissionsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } + if (fieldName.equals("testPermissionsRequestResource")) { + return String.valueOf(testPermissionsRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsLicenseCodeHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsLicenseCodeHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsLicenseCodeHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsLicenseCodeHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsLicenseCodeHttpRequest other) { + if (other == TestIamPermissionsLicenseCodeHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsLicenseCodeHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsLicenseCodeHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsLicenseCodeHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsLicenseCodeHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsLicenseCodeHttpRequest) { + TestIamPermissionsLicenseCodeHttpRequest that = (TestIamPermissionsLicenseCodeHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java new file mode 100644 index 000000000000..5406f9caf1bf --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java @@ -0,0 +1,449 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TestIamPermissionsLicenseHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsLicenseHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsLicenseHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("testPermissionsRequestResource") + && testPermissionsRequestResource != null) { + fieldMap.put( + "testPermissionsRequestResource", + Collections.singletonList(String.valueOf(testPermissionsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } + if (fieldName.equals("testPermissionsRequestResource")) { + return String.valueOf(testPermissionsRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsLicenseHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsLicenseHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsLicenseHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsLicenseHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsLicenseHttpRequest other) { + if (other == TestIamPermissionsLicenseHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsLicenseHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsLicenseHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsLicenseHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsLicenseHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsLicenseHttpRequest) { + TestIamPermissionsLicenseHttpRequest that = (TestIamPermissionsLicenseHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java new file mode 100644 index 000000000000..8dba23a1ec59 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TestPermissionsRequest implements ApiMessage { + private final List permissions; + + private TestPermissionsRequest() { + this.permissions = null; + } + + private TestPermissionsRequest(List permissions) { + this.permissions = permissions; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("permissions") && permissions != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : permissions) { + stringList.add(item.toString()); + } + fieldMap.put("permissions", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("permissions")) { + return String.valueOf(permissions); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getPermissionsList() { + return permissions; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestPermissionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestPermissionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestPermissionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestPermissionsRequest(); + } + + public static class Builder { + private List permissions; + + Builder() {} + + public Builder mergeFrom(TestPermissionsRequest other) { + if (other == TestPermissionsRequest.getDefaultInstance()) return this; + if (other.getPermissionsList() != null) { + this.permissions = other.permissions; + } + return this; + } + + Builder(TestPermissionsRequest source) { + this.permissions = source.permissions; + } + + public List getPermissionsList() { + return permissions; + } + + public Builder addAllPermissions(List permissions) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(permissions.size()); + } + this.permissions.addAll(permissions); + return this; + } + + public Builder addPermissions(String permissions) { + this.permissions.add(permissions); + return this; + } + + public TestPermissionsRequest build() { + return new TestPermissionsRequest(permissions); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllPermissions(this.permissions); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestPermissionsRequest{" + "permissions=" + permissions + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestPermissionsRequest) { + TestPermissionsRequest that = (TestPermissionsRequest) o; + return Objects.equals(this.permissions, that.getPermissionsList()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(permissions); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java new file mode 100644 index 000000000000..13f16f8653e7 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TestPermissionsResponse implements ApiMessage { + private final List permissions; + + private TestPermissionsResponse() { + this.permissions = null; + } + + private TestPermissionsResponse(List permissions) { + this.permissions = permissions; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("permissions") && permissions != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : permissions) { + stringList.add(item.toString()); + } + fieldMap.put("permissions", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("permissions")) { + return String.valueOf(permissions); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public List getPermissionsList() { + return permissions; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestPermissionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestPermissionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestPermissionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestPermissionsResponse(); + } + + public static class Builder { + private List permissions; + + Builder() {} + + public Builder mergeFrom(TestPermissionsResponse other) { + if (other == TestPermissionsResponse.getDefaultInstance()) return this; + if (other.getPermissionsList() != null) { + this.permissions = other.permissions; + } + return this; + } + + Builder(TestPermissionsResponse source) { + this.permissions = source.permissions; + } + + public List getPermissionsList() { + return permissions; + } + + public Builder addAllPermissions(List permissions) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(permissions.size()); + } + this.permissions.addAll(permissions); + return this; + } + + public Builder addPermissions(String permissions) { + this.permissions.add(permissions); + return this; + } + + public TestPermissionsResponse build() { + return new TestPermissionsResponse(permissions); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllPermissions(this.permissions); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestPermissionsResponse{" + "permissions=" + permissions + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestPermissionsResponse) { + TestPermissionsResponse that = (TestPermissionsResponse) o; + return Objects.equals(this.permissions, that.getPermissionsList()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(permissions); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java index bdd8382816fb..e3e75cba5335 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private UpdateAccessConfigInstanceHttpRequest() { this.userIp = null; } - private UpdateAccessConfigInstanceHttpRequest( AccessConfig accessConfigResource, String access_token, @@ -70,8 +66,7 @@ private UpdateAccessConfigInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.accessConfigResource = accessConfigResource; this.access_token = access_token; this.callback = callback; @@ -89,7 +84,8 @@ private UpdateAccessConfigInstanceHttpRequest( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { - fieldMap.put("accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); + fieldMap.put( + "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); } if (fieldNames.contains("access_token") && access_token != null) { fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); @@ -212,22 +208,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateAccessConfigInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateAccessConfigInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateAccessConfigInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateAccessConfigInstanceHttpRequest(); } @@ -398,13 +396,9 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateAccessConfigInstanceHttpRequest build() { String missing = ""; - - - if (instance == null) { missing += " instance"; } @@ -413,25 +407,21 @@ public UpdateAccessConfigInstanceHttpRequest build() { missing += " networkInterface"; } - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateAccessConfigInstanceHttpRequest( - accessConfigResource, - access_token, - callback, - fields, - instance, - key, - networkInterface, - prettyPrint, - quotaUser, - requestId, - userIp - ); + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -454,17 +444,38 @@ public Builder clone() { @Override public String toString() { return "UpdateAccessConfigInstanceHttpRequest{" - + "accessConfigResource=" + accessConfigResource + ", " - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "networkInterface=" + networkInterface + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "accessConfigResource=" + + accessConfigResource + + ", " + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "networkInterface=" + + networkInterface + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -475,19 +486,17 @@ public boolean equals(Object o) { } if (o instanceof UpdateAccessConfigInstanceHttpRequest) { UpdateAccessConfigInstanceHttpRequest that = (UpdateAccessConfigInstanceHttpRequest) o; - return - Objects.equals(this.accessConfigResource, that.getAccessConfigResource()) && - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.networkInterface, that.getNetworkInterface()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.accessConfigResource, that.getAccessConfigResource()) + && Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.networkInterface, that.getNetworkInterface()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -495,17 +504,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - accessConfigResource, - access_token, - callback, - fields, - instance, - key, - networkInterface, - prettyPrint, - quotaUser, - requestId, - userIp - ); + accessConfigResource, + access_token, + callback, + fields, + instance, + key, + networkInterface, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index 644fe00e8599..b8a2a198ba0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private UpdateAutoscalerHttpRequest() { this.zone = null; } - private UpdateAutoscalerHttpRequest( String access_token, String autoscaler, @@ -70,8 +66,7 @@ private UpdateAutoscalerHttpRequest( String quotaUser, String requestId, String userIp, - String zone - ) { + String zone) { this.access_token = access_token; this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; @@ -95,7 +90,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -212,22 +208,24 @@ public String getZone() { return zone; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateAutoscalerHttpRequest(); } @@ -398,19 +396,9 @@ public Builder setZone(String zone) { return this; } - public UpdateAutoscalerHttpRequest build() { String missing = ""; - - - - - - - - - if (zone == null) { missing += " zone"; } @@ -418,18 +406,17 @@ public UpdateAutoscalerHttpRequest build() { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateAutoscalerHttpRequest( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } public Builder clone() { @@ -452,17 +439,38 @@ public Builder clone() { @Override public String toString() { return "UpdateAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + ", " - + "zone=" + zone + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + "}"; } @@ -473,19 +481,17 @@ public boolean equals(Object o) { } if (o instanceof UpdateAutoscalerHttpRequest) { UpdateAutoscalerHttpRequest that = (UpdateAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) && - Objects.equals(this.zone, that.getZone()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); } return false; } @@ -493,17 +499,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp, - zone - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp, + zone); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java index 68ff06ee267e..ac9b68154816 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateBackendBucketHttpRequest() { this.userIp = null; } - private UpdateBackendBucketHttpRequest( String access_token, String backendBucket, @@ -67,8 +63,7 @@ private UpdateBackendBucketHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendBucket = backendBucket; this.backendBucketResource = backendBucketResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); } if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { - fieldMap.put("backendBucketResource", Collections.singletonList(String.valueOf(backendBucketResource))); + fieldMap.put( + "backendBucketResource", + Collections.singletonList(String.valueOf(backendBucketResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateBackendBucketHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateBackendBucketHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateBackendBucketHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateBackendBucketHttpRequest(); } @@ -370,7 +369,6 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateBackendBucketHttpRequest build() { String missing = ""; @@ -378,28 +376,20 @@ public UpdateBackendBucketHttpRequest build() { missing += " backendBucket"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateBackendBucketHttpRequest( - access_token, - backendBucket, - backendBucketResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "UpdateBackendBucketHttpRequest{" - + "access_token=" + access_token + ", " - + "backendBucket=" + backendBucket + ", " - + "backendBucketResource=" + backendBucketResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendBucket=" + + backendBucket + + ", " + + "backendBucketResource=" + + backendBucketResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateBackendBucketHttpRequest) { UpdateBackendBucketHttpRequest that = (UpdateBackendBucketHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendBucket, that.getBackendBucket()) && - Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendBucket, that.getBackendBucket()) + && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendBucket, - backendBucketResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendBucket, + backendBucketResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index 9510f42023ac..e403c03d0963 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateBackendServiceHttpRequest() { this.userIp = null; } - private UpdateBackendServiceHttpRequest( String access_token, String backendService, @@ -67,8 +63,7 @@ private UpdateBackendServiceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.backendServiceResource = backendServiceResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); } if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateBackendServiceHttpRequest(); } @@ -370,7 +369,6 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateBackendServiceHttpRequest build() { String missing = ""; @@ -378,28 +376,20 @@ public UpdateBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateBackendServiceHttpRequest( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "UpdateBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "backendServiceResource=" + backendServiceResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "backendServiceResource=" + + backendServiceResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateBackendServiceHttpRequest) { UpdateBackendServiceHttpRequest that = (UpdateBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index 5d5fcf173d24..1859339a9a09 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateFirewallHttpRequest() { this.userIp = null; } - private UpdateFirewallHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private UpdateFirewallHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateFirewallHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateFirewallHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateFirewallHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateFirewallHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateFirewallHttpRequest build() { String missing = ""; - - if (firewall == null) { missing += " firewall"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateFirewallHttpRequest( - access_token, - callback, - fields, - firewall, - firewallResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "UpdateFirewallHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "firewall=" + firewall + ", " - + "firewallResource=" + firewallResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "firewall=" + + firewall + + ", " + + "firewallResource=" + + firewallResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateFirewallHttpRequest) { UpdateFirewallHttpRequest that = (UpdateFirewallHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.firewall, that.getFirewall()) && - Objects.equals(this.firewallResource, that.getFirewallResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.firewall, that.getFirewall()) + && Objects.equals(this.firewallResource, that.getFirewallResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - firewall, - firewallResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + firewall, + firewallResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index 15f6fd851a06..023f73d37af1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateHealthCheckHttpRequest() { this.userIp = null; } - private UpdateHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private UpdateHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); } if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { - fieldMap.put("healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + fieldMap.put( + "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +194,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateHealthCheckHttpRequest(); } @@ -370,36 +368,27 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateHealthCheckHttpRequest build() { String missing = ""; - - if (healthCheck == null) { missing += " healthCheck"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateHealthCheckHttpRequest( - access_token, - callback, - fields, - healthCheck, - healthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +410,35 @@ public Builder clone() { @Override public String toString() { return "UpdateHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "healthCheck=" + healthCheck + ", " - + "healthCheckResource=" + healthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "healthCheck=" + + healthCheck + + ", " + + "healthCheckResource=" + + healthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +449,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateHealthCheckHttpRequest) { UpdateHealthCheckHttpRequest that = (UpdateHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.healthCheck, that.getHealthCheck()) && - Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.healthCheck, that.getHealthCheck()) + && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +466,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - healthCheck, - healthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + healthCheck, + healthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index 5931fe675408..01db2ddc00e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateHttpHealthCheckHttpRequest() { this.userIp = null; } - private UpdateHttpHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private UpdateHttpHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); } if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { - fieldMap.put("httpHealthCheckResource", Collections.singletonList(String.valueOf(httpHealthCheckResource))); + fieldMap.put( + "httpHealthCheckResource", + Collections.singletonList(String.valueOf(httpHealthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateHttpHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateHttpHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateHttpHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateHttpHealthCheckHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateHttpHealthCheckHttpRequest build() { String missing = ""; - - if (httpHealthCheck == null) { missing += " httpHealthCheck"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateHttpHealthCheckHttpRequest( - access_token, - callback, - fields, - httpHealthCheck, - httpHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "UpdateHttpHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpHealthCheck=" + httpHealthCheck + ", " - + "httpHealthCheckResource=" + httpHealthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpHealthCheck=" + + httpHealthCheck + + ", " + + "httpHealthCheckResource=" + + httpHealthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateHttpHealthCheckHttpRequest) { UpdateHttpHealthCheckHttpRequest that = (UpdateHttpHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && - Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) + && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpHealthCheck, - httpHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpHealthCheck, + httpHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index 3bb05902a0f4..59c3de37c5fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateHttpsHealthCheckHttpRequest() { this.userIp = null; } - private UpdateHttpsHealthCheckHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private UpdateHttpsHealthCheckHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -97,7 +92,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); } if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { - fieldMap.put("httpsHealthCheckResource", Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + fieldMap.put( + "httpsHealthCheckResource", + Collections.singletonList(String.valueOf(httpsHealthCheckResource))); } if (fieldNames.contains("key") && key != null) { fieldMap.put("key", Collections.singletonList(String.valueOf(key))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateHttpsHealthCheckHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateHttpsHealthCheckHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateHttpsHealthCheckHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateHttpsHealthCheckHttpRequest(); } @@ -370,36 +369,27 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateHttpsHealthCheckHttpRequest build() { String missing = ""; - - if (httpsHealthCheck == null) { missing += " httpsHealthCheck"; } - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateHttpsHealthCheckHttpRequest( - access_token, - callback, - fields, - httpsHealthCheck, - httpsHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "UpdateHttpsHealthCheckHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "httpsHealthCheck=" + httpsHealthCheck + ", " - + "httpsHealthCheckResource=" + httpsHealthCheckResource + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "httpsHealthCheck=" + + httpsHealthCheck + + ", " + + "httpsHealthCheckResource=" + + httpsHealthCheckResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateHttpsHealthCheckHttpRequest) { UpdateHttpsHealthCheckHttpRequest that = (UpdateHttpsHealthCheckHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && - Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) + && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - httpsHealthCheck, - httpsHealthCheckResource, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + httpsHealthCheck, + httpsHealthCheckResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java index 104613a5413a..d059bd42e620 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private UpdateNetworkInterfaceInstanceHttpRequest() { this.userIp = null; } - private UpdateNetworkInterfaceInstanceHttpRequest( String access_token, String callback, @@ -70,8 +66,7 @@ private UpdateNetworkInterfaceInstanceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -107,7 +102,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); } if (fieldNames.contains("networkInterfaceResource") && networkInterfaceResource != null) { - fieldMap.put("networkInterfaceResource", Collections.singletonList(String.valueOf(networkInterfaceResource))); + fieldMap.put( + "networkInterfaceResource", + Collections.singletonList(String.valueOf(networkInterfaceResource))); } if (fieldNames.contains("prettyPrint") && prettyPrint != null) { fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); @@ -212,22 +209,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateNetworkInterfaceInstanceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateNetworkInterfaceInstanceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateNetworkInterfaceInstanceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateNetworkInterfaceInstanceHttpRequest(); } @@ -398,12 +397,9 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateNetworkInterfaceInstanceHttpRequest build() { String missing = ""; - - if (instance == null) { missing += " instance"; } @@ -412,26 +408,21 @@ public UpdateNetworkInterfaceInstanceHttpRequest build() { missing += " networkInterface"; } - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateNetworkInterfaceInstanceHttpRequest( - access_token, - callback, - fields, - instance, - key, - networkInterface, - networkInterfaceResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + key, + networkInterface, + networkInterfaceResource, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -454,17 +445,38 @@ public Builder clone() { @Override public String toString() { return "UpdateNetworkInterfaceInstanceHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "instance=" + instance + ", " - + "key=" + key + ", " - + "networkInterface=" + networkInterface + ", " - + "networkInterfaceResource=" + networkInterfaceResource + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "instance=" + + instance + + ", " + + "key=" + + key + + ", " + + "networkInterface=" + + networkInterface + + ", " + + "networkInterfaceResource=" + + networkInterfaceResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -474,20 +486,19 @@ public boolean equals(Object o) { return true; } if (o instanceof UpdateNetworkInterfaceInstanceHttpRequest) { - UpdateNetworkInterfaceInstanceHttpRequest that = (UpdateNetworkInterfaceInstanceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.instance, that.getInstance()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.networkInterface, that.getNetworkInterface()) && - Objects.equals(this.networkInterfaceResource, that.getNetworkInterfaceResource()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + UpdateNetworkInterfaceInstanceHttpRequest that = + (UpdateNetworkInterfaceInstanceHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.instance, that.getInstance()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.networkInterface, that.getNetworkInterface()) + && Objects.equals(this.networkInterfaceResource, that.getNetworkInterfaceResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -495,17 +506,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - instance, - key, - networkInterface, - networkInterfaceResource, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + callback, + fields, + instance, + key, + networkInterface, + networkInterfaceResource, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index f23958df894b..26014c33180f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -58,7 +55,6 @@ private UpdateRegionAutoscalerHttpRequest() { this.userIp = null; } - private UpdateRegionAutoscalerHttpRequest( String access_token, String autoscaler, @@ -70,8 +66,7 @@ private UpdateRegionAutoscalerHttpRequest( String quotaUser, String region, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; @@ -95,7 +90,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); } if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put("autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -212,22 +208,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateRegionAutoscalerHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRegionAutoscalerHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateRegionAutoscalerHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateRegionAutoscalerHttpRequest(); } @@ -398,38 +396,28 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateRegionAutoscalerHttpRequest build() { String missing = ""; - - - - - - - if (region == null) { missing += " region"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRegionAutoscalerHttpRequest( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } public Builder clone() { @@ -452,17 +440,38 @@ public Builder clone() { @Override public String toString() { return "UpdateRegionAutoscalerHttpRequest{" - + "access_token=" + access_token + ", " - + "autoscaler=" + autoscaler + ", " - + "autoscalerResource=" + autoscalerResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "region=" + region + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "autoscaler=" + + autoscaler + + ", " + + "autoscalerResource=" + + autoscalerResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -473,19 +482,17 @@ public boolean equals(Object o) { } if (o instanceof UpdateRegionAutoscalerHttpRequest) { UpdateRegionAutoscalerHttpRequest that = (UpdateRegionAutoscalerHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.autoscaler, that.getAutoscaler()) && - Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.autoscaler, that.getAutoscaler()) + && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -493,17 +500,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - autoscaler, - autoscalerResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - region, - requestId, - userIp - ); + access_token, + autoscaler, + autoscalerResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index 821bffbdb0a2..e6a829c34afe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateRegionBackendServiceHttpRequest() { this.userIp = null; } - private UpdateRegionBackendServiceHttpRequest( String access_token, String backendService, @@ -67,8 +63,7 @@ private UpdateRegionBackendServiceHttpRequest( String prettyPrint, String quotaUser, String requestId, - String userIp - ) { + String userIp) { this.access_token = access_token; this.backendService = backendService; this.backendServiceResource = backendServiceResource; @@ -91,7 +86,9 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); } if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put("backendServiceResource", Collections.singletonList(String.valueOf(backendServiceResource))); + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); } if (fieldNames.contains("callback") && callback != null) { fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); @@ -198,22 +195,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateRegionBackendServiceHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRegionBackendServiceHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateRegionBackendServiceHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateRegionBackendServiceHttpRequest(); } @@ -370,7 +369,6 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateRegionBackendServiceHttpRequest build() { String missing = ""; @@ -378,28 +376,20 @@ public UpdateRegionBackendServiceHttpRequest build() { missing += " backendService"; } - - - - - - - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRegionBackendServiceHttpRequest( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } public Builder clone() { @@ -421,16 +411,35 @@ public Builder clone() { @Override public String toString() { return "UpdateRegionBackendServiceHttpRequest{" - + "access_token=" + access_token + ", " - + "backendService=" + backendService + ", " - + "backendServiceResource=" + backendServiceResource + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "backendService=" + + backendService + + ", " + + "backendServiceResource=" + + backendServiceResource + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +450,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateRegionBackendServiceHttpRequest) { UpdateRegionBackendServiceHttpRequest that = (UpdateRegionBackendServiceHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.backendService, that.getBackendService()) && - Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.backendService, that.getBackendService()) + && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +467,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - backendService, - backendServiceResource, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - userIp - ); + access_token, + backendService, + backendServiceResource, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index 0d7fc9b87893..e5e3b508f1ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateRouterHttpRequest() { this.userIp = null; } - private UpdateRouterHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private UpdateRouterHttpRequest( String requestId, String router, Router routerResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateRouterHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateRouterHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateRouterHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateRouterHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateRouterHttpRequest build() { String missing = ""; - - - - - - if (router == null) { missing += " router"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateRouterHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + router, + routerResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "UpdateRouterHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "router=" + router + ", " - + "routerResource=" + routerResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "router=" + + router + + ", " + + "routerResource=" + + routerResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateRouterHttpRequest) { UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.routerResource, that.getRouterResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.routerResource, that.getRouterResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - router, - routerResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + router, + routerResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index 52fae79df46c..553a99a61431 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -56,7 +53,6 @@ private UpdateUrlMapHttpRequest() { this.userIp = null; } - private UpdateUrlMapHttpRequest( String access_token, String callback, @@ -67,8 +63,7 @@ private UpdateUrlMapHttpRequest( String requestId, String urlMap, UrlMap urlMapResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -198,22 +193,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UpdateUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UpdateUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UpdateUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UpdateUrlMapHttpRequest(); } @@ -370,36 +367,27 @@ public Builder setUserIp(String userIp) { return this; } - public UpdateUrlMapHttpRequest build() { String missing = ""; - - - - - - if (urlMap == null) { missing += " urlMap"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new UpdateUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + urlMap, + urlMapResource, + userIp); } public Builder clone() { @@ -421,16 +409,35 @@ public Builder clone() { @Override public String toString() { return "UpdateUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "requestId=" + requestId + ", " - + "urlMap=" + urlMap + ", " - + "urlMapResource=" + urlMapResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "urlMap=" + + urlMap + + ", " + + "urlMapResource=" + + urlMapResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -441,18 +448,16 @@ public boolean equals(Object o) { } if (o instanceof UpdateUrlMapHttpRequest) { UpdateUrlMapHttpRequest that = (UpdateUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.requestId, that.getRequestId()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.urlMapResource, that.getUrlMapResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals(this.urlMapResource, that.getUrlMapResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -460,16 +465,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - requestId, - urlMap, - urlMapResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + urlMap, + urlMapResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java index 7f562f1fad98..8d3e1ce15fb2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -58,7 +57,6 @@ private UrlMap() { this.tests = null; } - private UrlMap( String creationTimestamp, String defaultService, @@ -70,8 +68,7 @@ private UrlMap( String name, List pathMatchers, String selfLink, - List tests - ) { + List tests) { this.creationTimestamp = creationTimestamp; this.defaultService = defaultService; this.description = description; @@ -89,7 +86,8 @@ private UrlMap( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("defaultService") && defaultService != null) { fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); @@ -224,22 +222,24 @@ public List getTestsList() { return tests; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMap prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMap getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMap DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMap(); } @@ -434,31 +434,20 @@ public Builder addTests(UrlMapTest tests) { return this; } - public UrlMap build() { - - - - - - - - - return new UrlMap( - creationTimestamp, - defaultService, - description, - fingerprint, - hostRules, - id, - kind, - name, - pathMatchers, - selfLink, - tests - ); + creationTimestamp, + defaultService, + description, + fingerprint, + hostRules, + id, + kind, + name, + pathMatchers, + selfLink, + tests); } public Builder clone() { @@ -481,17 +470,38 @@ public Builder clone() { @Override public String toString() { return "UrlMap{" - + "creationTimestamp=" + creationTimestamp + ", " - + "defaultService=" + defaultService + ", " - + "description=" + description + ", " - + "fingerprint=" + fingerprint + ", " - + "hostRules=" + hostRules + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "pathMatchers=" + pathMatchers + ", " - + "selfLink=" + selfLink + ", " - + "tests=" + tests + + "creationTimestamp=" + + creationTimestamp + + ", " + + "defaultService=" + + defaultService + + ", " + + "description=" + + description + + ", " + + "fingerprint=" + + fingerprint + + ", " + + "hostRules=" + + hostRules + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "pathMatchers=" + + pathMatchers + + ", " + + "selfLink=" + + selfLink + + ", " + + "tests=" + + tests + "}"; } @@ -502,19 +512,17 @@ public boolean equals(Object o) { } if (o instanceof UrlMap) { UrlMap that = (UrlMap) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.defaultService, that.getDefaultService()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.fingerprint, that.getFingerprint()) && - Objects.equals(this.hostRules, that.getHostRulesList()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.pathMatchers, that.getPathMatchersList()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.tests, that.getTestsList()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.defaultService, that.getDefaultService()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.fingerprint, that.getFingerprint()) + && Objects.equals(this.hostRules, that.getHostRulesList()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.pathMatchers, that.getPathMatchersList()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.tests, that.getTestsList()); } return false; } @@ -522,17 +530,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - defaultService, - description, - fingerprint, - hostRules, - id, - kind, - name, - pathMatchers, - selfLink, - tests - ); + creationTimestamp, + defaultService, + description, + fingerprint, + hostRules, + id, + kind, + name, + pathMatchers, + selfLink, + tests); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java index 76ff129104de..14b1925e5502 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.UrlMapStub; import com.google.cloud.compute.v1.stub.UrlMapStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,41 +42,40 @@ *

  * 
  * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
- *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+ *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
  *   String requestId = "";
  *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the urlMapClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the urlMapClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of UrlMapSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of UrlMapSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class UrlMapClient implements BackgroundResource {
   private final UrlMapSettings settings;
   private final UrlMapStub stub;
 
-
-
-  /**
-   * Constructs an instance of UrlMapClient with default settings.
-   */
+  /** Constructs an instance of UrlMapClient with default settings. */
   public static final UrlMapClient create() throws IOException {
     return create(UrlMapSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of UrlMapClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of UrlMapClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final UrlMapClient create(UrlMapSettings settings) throws IOException {
     return new UrlMapClient(settings);
@@ -144,9 +128,8 @@ public static final UrlMapClient create(UrlMapStub stub) {
   }
 
   /**
-   * Constructs an instance of UrlMapClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of UrlMapClient, using the given settings. This is protected so that it
+   * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected UrlMapClient(UrlMapSettings settings) throws IOException {
     this.settings = settings;
@@ -168,36 +151,40 @@ public UrlMapStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified UrlMap resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteUrlMap(ProjectUrlMapName urlMap, String requestId) { + public final Operation deleteUrlMap(ProjectGlobalUrlMapName urlMap, String requestId) { DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) - .build(); + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) + .build(); return deleteUrlMap(request); } @@ -205,31 +192,33 @@ public final Operation deleteUrlMap(ProjectUrlMapName urlMap, String requestId) /** * Deletes the specified UrlMap resource. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString(), requestId);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteUrlMap(String urlMap, String requestId) { DeleteUrlMapHttpRequest request = - DeleteUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap) - .setRequestId(requestId) - .build(); + DeleteUrlMapHttpRequest.newBuilder().setUrlMap(urlMap).setRequestId(requestId).build(); return deleteUrlMap(request); } @@ -237,10 +226,11 @@ public final Operation deleteUrlMap(String urlMap, String requestId) { /** * Deletes the specified UrlMap resource. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -262,10 +252,11 @@ public final Operation deleteUrlMap(DeleteUrlMapHttpRequest request) {
   /**
    * Deletes the specified UrlMap resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -284,12 +275,14 @@ public final UnaryCallable deleteUrlMapCalla
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request.
+   * Returns the specified UrlMap resource. Get a list of available URL maps by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMap response = urlMapClient.getUrlMap(urlMap);
    * }
    * 
@@ -298,23 +291,25 @@ public final UnaryCallable deleteUrlMapCalla * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final UrlMap getUrlMap(ProjectUrlMapName urlMap) { + public final UrlMap getUrlMap(ProjectGlobalUrlMapName urlMap) { GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap == null ? null : urlMap.toString()) - .build(); + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .build(); return getUrlMap(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. + * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMap response = urlMapClient.getUrlMap(urlMap.toString());
    * }
    * 
@@ -325,21 +320,20 @@ public final UrlMap getUrlMap(ProjectUrlMapName urlMap) { @BetaApi public final UrlMap getUrlMap(String urlMap) { - GetUrlMapHttpRequest request = - GetUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap) - .build(); + GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder().setUrlMap(urlMap).build(); return getUrlMap(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. + * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() + * request. + * + *

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
    *     .build();
@@ -357,12 +351,14 @@ public final UrlMap getUrlMap(GetUrlMapHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request.
+   * Returns the specified UrlMap resource. Get a list of available URL maps by making a list()
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   GetUrlMapHttpRequest request = GetUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
    *     .build();
@@ -381,7 +377,8 @@ public final UnaryCallable getUrlMapCallable() {
   /**
    * Creates a UrlMap resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   String requestId = "";
@@ -391,24 +388,30 @@ public final UnaryCallable getUrlMapCallable() {
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertUrlMap(String requestId, ProjectName project, UrlMap urlMapResource) { + public final Operation insertUrlMap( + String requestId, ProjectName project, UrlMap urlMapResource) { InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project == null ? null : project.toString()) - .setUrlMapResource(urlMapResource) - .build(); + .setRequestId(requestId) + .setProject(project == null ? null : project.toString()) + .setUrlMapResource(urlMapResource) + .build(); return insertUrlMap(request); } @@ -416,7 +419,8 @@ public final Operation insertUrlMap(String requestId, ProjectName project, UrlMa /** * Creates a UrlMap resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   String requestId = "";
@@ -426,13 +430,18 @@ public final Operation insertUrlMap(String requestId, ProjectName project, UrlMa
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. - * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -440,10 +449,10 @@ public final Operation insertUrlMap(String requestId, String project, UrlMap url InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .setUrlMapResource(urlMapResource) - .build(); + .setRequestId(requestId) + .setProject(project) + .setUrlMapResource(urlMapResource) + .build(); return insertUrlMap(request); } @@ -451,7 +460,8 @@ public final Operation insertUrlMap(String requestId, String project, UrlMap url /** * Creates a UrlMap resource in the specified project using the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   String requestId = "";
@@ -478,7 +488,8 @@ public final Operation insertUrlMap(InsertUrlMapHttpRequest request) {
   /**
    * Creates a UrlMap resource in the specified project using the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   String requestId = "";
@@ -502,12 +513,14 @@ public final UnaryCallable insertUrlMapCalla
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
+   * Initiates a cache invalidation operation, invalidating the specified path, scoped to the
+   * specified UrlMap.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource);
@@ -515,34 +528,43 @@ public final UnaryCallable insertUrlMapCalla
    * 
* * @param urlMap Name of the UrlMap scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param cacheInvalidationRuleResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation invalidateCacheUrlMap(ProjectUrlMapName urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) { + public final Operation invalidateCacheUrlMap( + ProjectGlobalUrlMapName urlMap, + String requestId, + CacheInvalidationRule cacheInvalidationRuleResource) { InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) - .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) - .build(); + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) + .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) + .build(); return invalidateCacheUrlMap(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the + * specified UrlMap. + * + *

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), requestId, cacheInvalidationRuleResource);
@@ -550,34 +572,41 @@ public final Operation invalidateCacheUrlMap(ProjectUrlMapName urlMap, String re
    * 
* * @param urlMap Name of the UrlMap scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param cacheInvalidationRuleResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation invalidateCacheUrlMap(String urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) { + public final Operation invalidateCacheUrlMap( + String urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) { InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap) - .setRequestId(requestId) - .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) - .build(); + .setUrlMap(urlMap) + .setRequestId(requestId) + .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) + .build(); return invalidateCacheUrlMap(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the + * specified UrlMap. + * + *

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
@@ -599,12 +628,14 @@ public final Operation invalidateCacheUrlMap(InvalidateCacheUrlMapHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
+   * Initiates a cache invalidation operation, invalidating the specified path, scoped to the
+   * specified UrlMap.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
@@ -619,7 +650,8 @@ public final Operation invalidateCacheUrlMap(InvalidateCacheUrlMapHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable invalidateCacheUrlMapCallable() { + public final UnaryCallable + invalidateCacheUrlMapCallable() { return stub.invalidateCacheUrlMapCallable(); } @@ -627,7 +659,8 @@ public final UnaryCallable invalida /** * Retrieves the list of UrlMap resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -644,8 +677,8 @@ public final UnaryCallable invalida
   public final ListUrlMapsPagedResponse listUrlMaps(ProjectName project) {
     ListUrlMapsHttpRequest request =
         ListUrlMapsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listUrlMaps(request);
   }
 
@@ -653,7 +686,8 @@ public final ListUrlMapsPagedResponse listUrlMaps(ProjectName project) {
   /**
    * Retrieves the list of UrlMap resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -669,9 +703,7 @@ public final ListUrlMapsPagedResponse listUrlMaps(ProjectName project) {
   @BetaApi
   public final ListUrlMapsPagedResponse listUrlMaps(String project) {
     ListUrlMapsHttpRequest request =
-        ListUrlMapsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        ListUrlMapsHttpRequest.newBuilder().setProject(project).build();
     return listUrlMaps(request);
   }
 
@@ -679,7 +711,8 @@ public final ListUrlMapsPagedResponse listUrlMaps(String project) {
   /**
    * Retrieves the list of UrlMap resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -697,15 +730,15 @@ public final ListUrlMapsPagedResponse listUrlMaps(String project) {
    */
   @BetaApi
   public final ListUrlMapsPagedResponse listUrlMaps(ListUrlMapsHttpRequest request) {
-    return listUrlMapsPagedCallable()
-        .call(request);
+    return listUrlMapsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of UrlMap resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -721,7 +754,8 @@ public final ListUrlMapsPagedResponse listUrlMaps(ListUrlMapsHttpRequest request
    * 
*/ @BetaApi - public final UnaryCallable listUrlMapsPagedCallable() { + public final UnaryCallable + listUrlMapsPagedCallable() { return stub.listUrlMapsPagedCallable(); } @@ -729,7 +763,8 @@ public final UnaryCallable lis /** * Retrieves the list of UrlMap resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -758,12 +793,14 @@ public final UnaryCallable listUrlMapsCallab
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.patchUrlMap(urlMap, requestId, urlMapResource);
@@ -771,34 +808,42 @@ public final UnaryCallable listUrlMapsCallab
    * 
* * @param urlMap Name of the UrlMap resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchUrlMap(ProjectUrlMapName urlMap, String requestId, UrlMap urlMapResource) { + public final Operation patchUrlMap( + ProjectGlobalUrlMapName urlMap, String requestId, UrlMap urlMapResource) { PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) - .setUrlMapResource(urlMapResource) - .build(); + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) + .setUrlMapResource(urlMapResource) + .build(); return patchUrlMap(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), requestId, urlMapResource);
@@ -806,12 +851,17 @@ public final Operation patchUrlMap(ProjectUrlMapName urlMap, String requestId, U
    * 
* * @param urlMap Name of the UrlMap resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -819,21 +869,23 @@ public final Operation patchUrlMap(String urlMap, String requestId, UrlMap urlMa PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap) - .setRequestId(requestId) - .setUrlMapResource(urlMapResource) - .build(); + .setUrlMap(urlMap) + .setRequestId(requestId) + .setUrlMapResource(urlMapResource) + .build(); return patchUrlMap(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * 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. + * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
@@ -855,12 +907,14 @@ public final Operation patchUrlMap(PatchUrlMapHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
@@ -883,10 +937,11 @@ public final UnaryCallable patchUrlMapCallabl
   /**
    * Updates the specified UrlMap resource with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.updateUrlMap(urlMap, requestId, urlMapResource);
@@ -894,23 +949,29 @@ public final UnaryCallable patchUrlMapCallabl
    * 
* * @param urlMap Name of the UrlMap resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateUrlMap(ProjectUrlMapName urlMap, String requestId, UrlMap urlMapResource) { + public final Operation updateUrlMap( + ProjectGlobalUrlMapName urlMap, String requestId, UrlMap urlMapResource) { UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) - .setUrlMapResource(urlMapResource) - .build(); + .setUrlMap(urlMap == null ? null : urlMap.toString()) + .setRequestId(requestId) + .setUrlMapResource(urlMapResource) + .build(); return updateUrlMap(request); } @@ -918,10 +979,11 @@ public final Operation updateUrlMap(ProjectUrlMapName urlMap, String requestId, /** * Updates the specified UrlMap resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), requestId, urlMapResource);
@@ -929,12 +991,17 @@ public final Operation updateUrlMap(ProjectUrlMapName urlMap, String requestId,
    * 
* * @param urlMap Name of the UrlMap resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi @@ -942,10 +1009,10 @@ public final Operation updateUrlMap(String urlMap, String requestId, UrlMap urlM UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder() - .setUrlMap(urlMap) - .setRequestId(requestId) - .setUrlMapResource(urlMapResource) - .build(); + .setUrlMap(urlMap) + .setRequestId(requestId) + .setUrlMapResource(urlMapResource) + .build(); return updateUrlMap(request); } @@ -953,10 +1020,11 @@ public final Operation updateUrlMap(String urlMap, String requestId, UrlMap urlM /** * Updates the specified UrlMap resource with the data included in the request. * - * Sample code: + *

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
@@ -980,10 +1048,11 @@ public final Operation updateUrlMap(UpdateUrlMapHttpRequest request) {
   /**
    * Updates the specified UrlMap resource with the data included in the request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
@@ -1004,12 +1073,14 @@ public final UnaryCallable updateUrlMapCalla
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(urlMap, urlMapsValidateRequestResource);
    * }
@@ -1020,24 +1091,27 @@ public final UnaryCallable updateUrlMapCalla
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final UrlMapsValidateResponse validateUrlMap(ProjectUrlMapName urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) {
+  public final UrlMapsValidateResponse validateUrlMap(
+      ProjectGlobalUrlMapName urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) {
 
     ValidateUrlMapHttpRequest request =
         ValidateUrlMapHttpRequest.newBuilder()
-        .setUrlMap(urlMap == null ? null : urlMap.toString())
-        .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource)
-        .build();
+            .setUrlMap(urlMap == null ? null : urlMap.toString())
+            .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource)
+            .build();
     return validateUrlMap(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   UrlMapsValidateResponse response = urlMapClient.validateUrlMap(urlMap.toString(), urlMapsValidateRequestResource);
    * }
@@ -1048,24 +1122,27 @@ public final UrlMapsValidateResponse validateUrlMap(ProjectUrlMapName urlMap, Ur
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final UrlMapsValidateResponse validateUrlMap(String urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) {
+  public final UrlMapsValidateResponse validateUrlMap(
+      String urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource) {
 
     ValidateUrlMapHttpRequest request =
         ValidateUrlMapHttpRequest.newBuilder()
-        .setUrlMap(urlMap)
-        .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource)
-        .build();
+            .setUrlMap(urlMap)
+            .setUrlMapsValidateRequestResource(urlMapsValidateRequestResource)
+            .build();
     return validateUrlMap(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   ValidateUrlMapHttpRequest request = ValidateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -1085,12 +1162,14 @@ public final UrlMapsValidateResponse validateUrlMap(ValidateUrlMapHttpRequest re
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * 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.
+   * 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: * - * Sample code: *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+   *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
    *   UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build();
    *   ValidateUrlMapHttpRequest request = ValidateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
@@ -1103,12 +1182,13 @@ public final UrlMapsValidateResponse validateUrlMap(ValidateUrlMapHttpRequest re
    * 
*/ @BetaApi - public final UnaryCallable validateUrlMapCallable() { + public final UnaryCallable + validateUrlMapCallable() { return stub.validateUrlMapCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -1137,12 +1217,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListUrlMapsPagedResponse extends AbstractPagedListResponse< - ListUrlMapsHttpRequest, - UrlMapList, - UrlMap, - ListUrlMapsPage, - ListUrlMapsFixedSizeCollection> { + public static class ListUrlMapsPagedResponse + extends AbstractPagedListResponse< + ListUrlMapsHttpRequest, UrlMapList, UrlMap, ListUrlMapsPage, + ListUrlMapsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -1162,19 +1240,13 @@ public ListUrlMapsPagedResponse apply(ListUrlMapsPage input) { private ListUrlMapsPagedResponse(ListUrlMapsPage page) { super(page, ListUrlMapsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListUrlMapsPage extends AbstractPage< - ListUrlMapsHttpRequest, - UrlMapList, - UrlMap, - ListUrlMapsPage> { + public static class ListUrlMapsPage + extends AbstractPage { private ListUrlMapsPage( - PageContext context, - UrlMapList response) { + PageContext context, UrlMapList response) { super(context, response); } @@ -1184,8 +1256,7 @@ private static ListUrlMapsPage createEmptyPage() { @Override protected ListUrlMapsPage createPage( - PageContext context, - UrlMapList response) { + PageContext context, UrlMapList response) { return new ListUrlMapsPage(context, response); } @@ -1195,18 +1266,12 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListUrlMapsFixedSizeCollection extends AbstractFixedSizeCollection< - ListUrlMapsHttpRequest, - UrlMapList, - UrlMap, - ListUrlMapsPage, - ListUrlMapsFixedSizeCollection> { + public static class ListUrlMapsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUrlMapsHttpRequest, UrlMapList, UrlMap, ListUrlMapsPage, + ListUrlMapsFixedSizeCollection> { private ListUrlMapsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); @@ -1221,7 +1286,5 @@ protected ListUrlMapsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListUrlMapsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java index 004d963c3369..073f4c2050b3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private UrlMapList() { this.warning = null; } - private UrlMapList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public UrlMapList build() { - - - - - return new UrlMapList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new UrlMapList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "UrlMapList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof UrlMapList) { UrlMapList that = (UrlMapList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java index 2af65b332d4f..54eac934b2bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private UrlMapReference() { this.urlMap = null; } - - private UrlMapReference( - String urlMap - ) { + private UrlMapReference(String urlMap) { this.urlMap = urlMap; } @@ -72,22 +66,24 @@ public String getUrlMap() { return urlMap; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapReference prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapReference getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapReference DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapReference(); } @@ -118,11 +114,8 @@ public Builder setUrlMap(String urlMap) { return this; } - public UrlMapReference build() { - return new UrlMapReference( - urlMap - ); + return new UrlMapReference(urlMap); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "UrlMapReference{" - + "urlMap=" + urlMap - + "}"; + return "UrlMapReference{" + "urlMap=" + urlMap + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof UrlMapReference) { UrlMapReference that = (UrlMapReference) o; - return - Objects.equals(this.urlMap, that.getUrlMap()) - ; + return Objects.equals(this.urlMap, that.getUrlMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - urlMap - ); + return Objects.hash(urlMap); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java index ba1df33f9b84..b55dea93a0a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; import com.google.cloud.compute.v1.stub.UrlMapStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteUrlMap to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteUrlMap to 30 seconds: * *

  * 
@@ -85,105 +63,80 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class UrlMapSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteUrlMap.
-   */
+  /** Returns the object with the settings used for calls to deleteUrlMap. */
   public UnaryCallSettings deleteUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).deleteUrlMapSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getUrlMap.
-   */
+  /** Returns the object with the settings used for calls to getUrlMap. */
   public UnaryCallSettings getUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).getUrlMapSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertUrlMap.
-   */
+  /** Returns the object with the settings used for calls to insertUrlMap. */
   public UnaryCallSettings insertUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).insertUrlMapSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to invalidateCacheUrlMap.
-   */
-  public UnaryCallSettings invalidateCacheUrlMapSettings() {
+  /** Returns the object with the settings used for calls to invalidateCacheUrlMap. */
+  public UnaryCallSettings
+      invalidateCacheUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).invalidateCacheUrlMapSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listUrlMaps.
-   */
-  public PagedCallSettings listUrlMapsSettings() {
+  /** Returns the object with the settings used for calls to listUrlMaps. */
+  public PagedCallSettings
+      listUrlMapsSettings() {
     return ((UrlMapStubSettings) getStubSettings()).listUrlMapsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchUrlMap.
-   */
+  /** Returns the object with the settings used for calls to patchUrlMap. */
   public UnaryCallSettings patchUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).patchUrlMapSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateUrlMap.
-   */
+  /** Returns the object with the settings used for calls to updateUrlMap. */
   public UnaryCallSettings updateUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).updateUrlMapSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to validateUrlMap.
-   */
-  public UnaryCallSettings validateUrlMapSettings() {
+  /** Returns the object with the settings used for calls to validateUrlMap. */
+  public UnaryCallSettings
+      validateUrlMapSettings() {
     return ((UrlMapStubSettings) getStubSettings()).validateUrlMapSettings();
   }
 
-
   public static final UrlMapSettings create(UrlMapStubSettings stub) throws IOException {
     return new UrlMapSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return UrlMapStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return UrlMapStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return UrlMapStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return UrlMapStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return UrlMapStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return UrlMapStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return UrlMapStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -196,23 +149,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return UrlMapStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -221,9 +168,7 @@ protected UrlMapSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for UrlMapSettings.
-   */
+  /** Builder for UrlMapSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -245,74 +190,63 @@ protected Builder(UrlMapStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public UrlMapStubSettings.Builder getStubSettingsBuilder() {
       return ((UrlMapStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteUrlMap. - */ + /** Returns the builder for the settings used for calls to deleteUrlMap. */ public UnaryCallSettings.Builder deleteUrlMapSettings() { return getStubSettingsBuilder().deleteUrlMapSettings(); } - /** - * Returns the builder for the settings used for calls to getUrlMap. - */ + /** Returns the builder for the settings used for calls to getUrlMap. */ public UnaryCallSettings.Builder getUrlMapSettings() { return getStubSettingsBuilder().getUrlMapSettings(); } - /** - * Returns the builder for the settings used for calls to insertUrlMap. - */ + /** Returns the builder for the settings used for calls to insertUrlMap. */ public UnaryCallSettings.Builder insertUrlMapSettings() { return getStubSettingsBuilder().insertUrlMapSettings(); } - /** - * Returns the builder for the settings used for calls to invalidateCacheUrlMap. - */ - public UnaryCallSettings.Builder invalidateCacheUrlMapSettings() { + /** Returns the builder for the settings used for calls to invalidateCacheUrlMap. */ + public UnaryCallSettings.Builder + invalidateCacheUrlMapSettings() { return getStubSettingsBuilder().invalidateCacheUrlMapSettings(); } - /** - * Returns the builder for the settings used for calls to listUrlMaps. - */ - public PagedCallSettings.Builder listUrlMapsSettings() { + /** Returns the builder for the settings used for calls to listUrlMaps. */ + public PagedCallSettings.Builder + listUrlMapsSettings() { return getStubSettingsBuilder().listUrlMapsSettings(); } - /** - * Returns the builder for the settings used for calls to patchUrlMap. - */ + /** Returns the builder for the settings used for calls to patchUrlMap. */ public UnaryCallSettings.Builder patchUrlMapSettings() { return getStubSettingsBuilder().patchUrlMapSettings(); } - /** - * Returns the builder for the settings used for calls to updateUrlMap. - */ + /** Returns the builder for the settings used for calls to updateUrlMap. */ public UnaryCallSettings.Builder updateUrlMapSettings() { return getStubSettingsBuilder().updateUrlMapSettings(); } - /** - * Returns the builder for the settings used for calls to validateUrlMap. - */ - public UnaryCallSettings.Builder validateUrlMapSettings() { + /** Returns the builder for the settings used for calls to validateUrlMap. */ + public UnaryCallSettings.Builder + validateUrlMapSettings() { return getStubSettingsBuilder().validateUrlMapSettings(); } @@ -321,4 +255,4 @@ public UrlMapSettings build() throws IOException { return new UrlMapSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java index e434b2bf9a68..6c9cee06b282 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,13 +41,7 @@ private UrlMapTest() { this.service = null; } - - private UrlMapTest( - String description, - String host, - String path, - String service - ) { + private UrlMapTest(String description, String host, String path, String service) { this.description = description; this.host = host; this.path = path; @@ -114,22 +105,24 @@ public String getService() { return service; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapTest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapTest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapTest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapTest(); } @@ -202,17 +195,9 @@ public Builder setService(String service) { return this; } - public UrlMapTest build() { - - - return new UrlMapTest( - description, - host, - path, - service - ); + return new UrlMapTest(description, host, path, service); } public Builder clone() { @@ -228,10 +213,17 @@ public Builder clone() { @Override public String toString() { return "UrlMapTest{" - + "description=" + description + ", " - + "host=" + host + ", " - + "path=" + path + ", " - + "service=" + service + + "description=" + + description + + ", " + + "host=" + + host + + ", " + + "path=" + + path + + ", " + + "service=" + + service + "}"; } @@ -242,23 +234,16 @@ public boolean equals(Object o) { } if (o instanceof UrlMapTest) { UrlMapTest that = (UrlMapTest) o; - return - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.host, that.getHost()) && - Objects.equals(this.path, that.getPath()) && - Objects.equals(this.service, that.getService()) - ; + return Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.path, that.getPath()) + && Objects.equals(this.service, that.getService()); } return false; } @Override public int hashCode() { - return Objects.hash( - description, - host, - path, - service - ); + return Objects.hash(description, host, path, service); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java index e2e6f51b2f65..1d006f36b0da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -44,13 +43,11 @@ private UrlMapValidationResult() { this.testPassed = null; } - private UrlMapValidationResult( List loadErrors, Boolean loadSucceeded, List testFailures, - Boolean testPassed - ) { + Boolean testPassed) { this.loadErrors = loadErrors; this.loadSucceeded = loadSucceeded; this.testFailures = testFailures; @@ -122,22 +119,24 @@ public Boolean getTestPassed() { return testPassed; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapValidationResult prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapValidationResult getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapValidationResult DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapValidationResult(); } @@ -226,17 +225,9 @@ public Builder setTestPassed(Boolean testPassed) { return this; } - public UrlMapValidationResult build() { - - - return new UrlMapValidationResult( - loadErrors, - loadSucceeded, - testFailures, - testPassed - ); + return new UrlMapValidationResult(loadErrors, loadSucceeded, testFailures, testPassed); } public Builder clone() { @@ -252,10 +243,17 @@ public Builder clone() { @Override public String toString() { return "UrlMapValidationResult{" - + "loadErrors=" + loadErrors + ", " - + "loadSucceeded=" + loadSucceeded + ", " - + "testFailures=" + testFailures + ", " - + "testPassed=" + testPassed + + "loadErrors=" + + loadErrors + + ", " + + "loadSucceeded=" + + loadSucceeded + + ", " + + "testFailures=" + + testFailures + + ", " + + "testPassed=" + + testPassed + "}"; } @@ -266,23 +264,16 @@ public boolean equals(Object o) { } if (o instanceof UrlMapValidationResult) { UrlMapValidationResult that = (UrlMapValidationResult) o; - return - Objects.equals(this.loadErrors, that.getLoadErrorsList()) && - Objects.equals(this.loadSucceeded, that.getLoadSucceeded()) && - Objects.equals(this.testFailures, that.getTestFailuresList()) && - Objects.equals(this.testPassed, that.getTestPassed()) - ; + return Objects.equals(this.loadErrors, that.getLoadErrorsList()) + && Objects.equals(this.loadSucceeded, that.getLoadSucceeded()) + && Objects.equals(this.testFailures, that.getTestFailuresList()) + && Objects.equals(this.testPassed, that.getTestPassed()); } return false; } @Override public int hashCode() { - return Objects.hash( - loadErrors, - loadSucceeded, - testFailures, - testPassed - ); + return Objects.hash(loadErrors, loadSucceeded, testFailures, testPassed); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java index df935111559c..67ad5ece8a64 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private UrlMapsValidateRequest() { this.resource = null; } - - private UrlMapsValidateRequest( - UrlMap resource - ) { + private UrlMapsValidateRequest(UrlMap resource) { this.resource = resource; } @@ -72,22 +66,24 @@ public UrlMap getResource() { return resource; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapsValidateRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapsValidateRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapsValidateRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapsValidateRequest(); } @@ -118,11 +114,8 @@ public Builder setResource(UrlMap resource) { return this; } - public UrlMapsValidateRequest build() { - return new UrlMapsValidateRequest( - resource - ); + return new UrlMapsValidateRequest(resource); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "UrlMapsValidateRequest{" - + "resource=" + resource - + "}"; + return "UrlMapsValidateRequest{" + "resource=" + resource + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof UrlMapsValidateRequest) { UrlMapsValidateRequest that = (UrlMapsValidateRequest) o; - return - Objects.equals(this.resource, that.getResource()) - ; + return Objects.equals(this.resource, that.getResource()); } return false; } @Override public int hashCode() { - return Objects.hash( - resource - ); + return Objects.hash(resource); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java index 58f5a4c0ef33..aada951cc3e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -38,10 +35,7 @@ private UrlMapsValidateResponse() { this.result = null; } - - private UrlMapsValidateResponse( - UrlMapValidationResult result - ) { + private UrlMapsValidateResponse(UrlMapValidationResult result) { this.result = result; } @@ -72,22 +66,24 @@ public UrlMapValidationResult getResult() { return result; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UrlMapsValidateResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UrlMapsValidateResponse getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UrlMapsValidateResponse DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UrlMapsValidateResponse(); } @@ -118,11 +114,8 @@ public Builder setResult(UrlMapValidationResult result) { return this; } - public UrlMapsValidateResponse build() { - return new UrlMapsValidateResponse( - result - ); + return new UrlMapsValidateResponse(result); } public Builder clone() { @@ -134,9 +127,7 @@ public Builder clone() { @Override public String toString() { - return "UrlMapsValidateResponse{" - + "result=" + result - + "}"; + return "UrlMapsValidateResponse{" + "result=" + result + "}"; } @Override @@ -146,17 +137,13 @@ public boolean equals(Object o) { } if (o instanceof UrlMapsValidateResponse) { UrlMapsValidateResponse that = (UrlMapsValidateResponse) o; - return - Objects.equals(this.result, that.getResult()) - ; + return Objects.equals(this.result, that.getResult()); } return false; } @Override public int hashCode() { - return Objects.hash( - result - ); + return Objects.hash(result); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java index 84a01d9006d1..0e8d805e19f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private UsageExportLocation() { this.reportNamePrefix = null; } - - private UsageExportLocation( - String bucketName, - String reportNamePrefix - ) { + private UsageExportLocation(String bucketName, String reportNamePrefix) { this.bucketName = bucketName; this.reportNamePrefix = reportNamePrefix; } @@ -86,22 +79,24 @@ public String getReportNamePrefix() { return reportNamePrefix; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(UsageExportLocation prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static UsageExportLocation getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final UsageExportLocation DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new UsageExportLocation(); } @@ -146,13 +141,9 @@ public Builder setReportNamePrefix(String reportNamePrefix) { return this; } - public UsageExportLocation build() { - return new UsageExportLocation( - bucketName, - reportNamePrefix - ); + return new UsageExportLocation(bucketName, reportNamePrefix); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "UsageExportLocation{" - + "bucketName=" + bucketName + ", " - + "reportNamePrefix=" + reportNamePrefix + + "bucketName=" + + bucketName + + ", " + + "reportNamePrefix=" + + reportNamePrefix + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof UsageExportLocation) { UsageExportLocation that = (UsageExportLocation) o; - return - Objects.equals(this.bucketName, that.getBucketName()) && - Objects.equals(this.reportNamePrefix, that.getReportNamePrefix()) - ; + return Objects.equals(this.bucketName, that.getBucketName()) + && Objects.equals(this.reportNamePrefix, that.getReportNamePrefix()); } return false; } @Override public int hashCode() { - return Objects.hash( - bucketName, - reportNamePrefix - ); + return Objects.hash(bucketName, reportNamePrefix); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java index a111ab1fa621..50a4ff2a3d32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +51,6 @@ private ValidateUrlMapHttpRequest() { this.userIp = null; } - private ValidateUrlMapHttpRequest( String access_token, String callback, @@ -64,8 +60,7 @@ private ValidateUrlMapHttpRequest( String quotaUser, String urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource, - String userIp - ) { + String userIp) { this.access_token = access_token; this.callback = callback; this.fields = fields; @@ -101,8 +96,11 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("urlMap") && urlMap != null) { fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); } - if (fieldNames.contains("urlMapsValidateRequestResource") && urlMapsValidateRequestResource != null) { - fieldMap.put("urlMapsValidateRequestResource", Collections.singletonList(String.valueOf(urlMapsValidateRequestResource))); + if (fieldNames.contains("urlMapsValidateRequestResource") + && urlMapsValidateRequestResource != null) { + fieldMap.put( + "urlMapsValidateRequestResource", + Collections.singletonList(String.valueOf(urlMapsValidateRequestResource))); } if (fieldNames.contains("userIp") && userIp != null) { fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); @@ -184,22 +182,24 @@ public String getUserIp() { return userIp; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ValidateUrlMapHttpRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ValidateUrlMapHttpRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ValidateUrlMapHttpRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ValidateUrlMapHttpRequest(); } @@ -328,7 +328,8 @@ public UrlMapsValidateRequest getUrlMapsValidateRequestResource() { return urlMapsValidateRequestResource; } - public Builder setUrlMapsValidateRequestResource(UrlMapsValidateRequest urlMapsValidateRequestResource) { + public Builder setUrlMapsValidateRequestResource( + UrlMapsValidateRequest urlMapsValidateRequestResource) { this.urlMapsValidateRequestResource = urlMapsValidateRequestResource; return this; } @@ -342,34 +343,26 @@ public Builder setUserIp(String userIp) { return this; } - public ValidateUrlMapHttpRequest build() { String missing = ""; - - - - - if (urlMap == null) { missing += " urlMap"; } - if (!missing.isEmpty()) { throw new IllegalStateException("Missing required properties:" + missing); } return new ValidateUrlMapHttpRequest( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - urlMap, - urlMapsValidateRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapsValidateRequestResource, + userIp); } public Builder clone() { @@ -390,15 +383,32 @@ public Builder clone() { @Override public String toString() { return "ValidateUrlMapHttpRequest{" - + "access_token=" + access_token + ", " - + "callback=" + callback + ", " - + "fields=" + fields + ", " - + "key=" + key + ", " - + "prettyPrint=" + prettyPrint + ", " - + "quotaUser=" + quotaUser + ", " - + "urlMap=" + urlMap + ", " - + "urlMapsValidateRequestResource=" + urlMapsValidateRequestResource + ", " - + "userIp=" + userIp + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "urlMap=" + + urlMap + + ", " + + "urlMapsValidateRequestResource=" + + urlMapsValidateRequestResource + + ", " + + "userIp=" + + userIp + "}"; } @@ -409,17 +419,16 @@ public boolean equals(Object o) { } if (o instanceof ValidateUrlMapHttpRequest) { ValidateUrlMapHttpRequest that = (ValidateUrlMapHttpRequest) o; - return - Objects.equals(this.access_token, that.getAccessToken()) && - Objects.equals(this.callback, that.getCallback()) && - Objects.equals(this.fields, that.getFields()) && - Objects.equals(this.key, that.getKey()) && - Objects.equals(this.prettyPrint, that.getPrettyPrint()) && - Objects.equals(this.quotaUser, that.getQuotaUser()) && - Objects.equals(this.urlMap, that.getUrlMap()) && - Objects.equals(this.urlMapsValidateRequestResource, that.getUrlMapsValidateRequestResource()) && - Objects.equals(this.userIp, that.getUserIp()) - ; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.urlMap, that.getUrlMap()) + && Objects.equals( + this.urlMapsValidateRequestResource, that.getUrlMapsValidateRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); } return false; } @@ -427,15 +436,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - access_token, - callback, - fields, - key, - prettyPrint, - quotaUser, - urlMap, - urlMapsValidateRequestResource, - userIp - ); + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + urlMap, + urlMapsValidateRequestResource, + userIp); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java index bb5c17c94e93..d00ea6107360 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -70,7 +69,6 @@ private VpnTunnel() { this.targetVpnGateway = null; } - private VpnTunnel( String creationTimestamp, String description, @@ -88,8 +86,7 @@ private VpnTunnel( String sharedSecret, String sharedSecretHash, String status, - String targetVpnGateway - ) { + String targetVpnGateway) { this.creationTimestamp = creationTimestamp; this.description = description; this.detailedStatus = detailedStatus; @@ -113,7 +110,8 @@ private VpnTunnel( public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); @@ -304,22 +302,24 @@ public String getTargetVpnGateway() { return targetVpnGateway; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(VpnTunnel prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static VpnTunnel getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final VpnTunnel DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new VpnTunnel(); } @@ -590,43 +590,26 @@ public Builder setTargetVpnGateway(String targetVpnGateway) { return this; } - public VpnTunnel build() { - - - - - - - - - - - - - - - return new VpnTunnel( - creationTimestamp, - description, - detailedStatus, - id, - ikeVersion, - kind, - localTrafficSelector, - name, - peerIp, - region, - remoteTrafficSelector, - router, - selfLink, - sharedSecret, - sharedSecretHash, - status, - targetVpnGateway - ); + creationTimestamp, + description, + detailedStatus, + id, + ikeVersion, + kind, + localTrafficSelector, + name, + peerIp, + region, + remoteTrafficSelector, + router, + selfLink, + sharedSecret, + sharedSecretHash, + status, + targetVpnGateway); } public Builder clone() { @@ -655,23 +638,56 @@ public Builder clone() { @Override public String toString() { return "VpnTunnel{" - + "creationTimestamp=" + creationTimestamp + ", " - + "description=" + description + ", " - + "detailedStatus=" + detailedStatus + ", " - + "id=" + id + ", " - + "ikeVersion=" + ikeVersion + ", " - + "kind=" + kind + ", " - + "localTrafficSelector=" + localTrafficSelector + ", " - + "name=" + name + ", " - + "peerIp=" + peerIp + ", " - + "region=" + region + ", " - + "remoteTrafficSelector=" + remoteTrafficSelector + ", " - + "router=" + router + ", " - + "selfLink=" + selfLink + ", " - + "sharedSecret=" + sharedSecret + ", " - + "sharedSecretHash=" + sharedSecretHash + ", " - + "status=" + status + ", " - + "targetVpnGateway=" + targetVpnGateway + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "detailedStatus=" + + detailedStatus + + ", " + + "id=" + + id + + ", " + + "ikeVersion=" + + ikeVersion + + ", " + + "kind=" + + kind + + ", " + + "localTrafficSelector=" + + localTrafficSelector + + ", " + + "name=" + + name + + ", " + + "peerIp=" + + peerIp + + ", " + + "region=" + + region + + ", " + + "remoteTrafficSelector=" + + remoteTrafficSelector + + ", " + + "router=" + + router + + ", " + + "selfLink=" + + selfLink + + ", " + + "sharedSecret=" + + sharedSecret + + ", " + + "sharedSecretHash=" + + sharedSecretHash + + ", " + + "status=" + + status + + ", " + + "targetVpnGateway=" + + targetVpnGateway + "}"; } @@ -682,25 +698,23 @@ public boolean equals(Object o) { } if (o instanceof VpnTunnel) { VpnTunnel that = (VpnTunnel) o; - return - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.detailedStatus, that.getDetailedStatus()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.ikeVersion, that.getIkeVersion()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.localTrafficSelector, that.getLocalTrafficSelectorList()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.peerIp, that.getPeerIp()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.remoteTrafficSelector, that.getRemoteTrafficSelectorList()) && - Objects.equals(this.router, that.getRouter()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.sharedSecret, that.getSharedSecret()) && - Objects.equals(this.sharedSecretHash, that.getSharedSecretHash()) && - Objects.equals(this.status, that.getStatus()) && - Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()) - ; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.detailedStatus, that.getDetailedStatus()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.ikeVersion, that.getIkeVersion()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.localTrafficSelector, that.getLocalTrafficSelectorList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.peerIp, that.getPeerIp()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.remoteTrafficSelector, that.getRemoteTrafficSelectorList()) + && Objects.equals(this.router, that.getRouter()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.sharedSecret, that.getSharedSecret()) + && Objects.equals(this.sharedSecretHash, that.getSharedSecretHash()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.targetVpnGateway, that.getTargetVpnGateway()); } return false; } @@ -708,23 +722,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - creationTimestamp, - description, - detailedStatus, - id, - ikeVersion, - kind, - localTrafficSelector, - name, - peerIp, - region, - remoteTrafficSelector, - router, - selfLink, - sharedSecret, - sharedSecretHash, - status, - targetVpnGateway - ); + creationTimestamp, + description, + detailedStatus, + id, + ikeVersion, + kind, + localTrafficSelector, + name, + peerIp, + region, + remoteTrafficSelector, + router, + selfLink, + sharedSecret, + sharedSecretHash, + status, + targetVpnGateway); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java index 688d7773fda0..9dc39b6f3bdc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -48,15 +45,13 @@ private VpnTunnelAggregatedList() { this.warning = null; } - private VpnTunnelAggregatedList( String id, Map items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -142,22 +137,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(VpnTunnelAggregatedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static VpnTunnelAggregatedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final VpnTunnelAggregatedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new VpnTunnelAggregatedList(); } @@ -258,21 +255,9 @@ public Builder setWarning(Warning warning) { return this; } - public VpnTunnelAggregatedList build() { - - - - - return new VpnTunnelAggregatedList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new VpnTunnelAggregatedList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -290,12 +275,23 @@ public Builder clone() { @Override public String toString() { return "VpnTunnelAggregatedList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -306,27 +302,18 @@ public boolean equals(Object o) { } if (o instanceof VpnTunnelAggregatedList) { VpnTunnelAggregatedList that = (VpnTunnelAggregatedList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsMap()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java index d0a5a45e6f46..c43c91f88c8e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.VpnTunnelStub; import com.google.cloud.compute.v1.stub.VpnTunnelStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,34 +49,33 @@ * *

* - *

Note: close() needs to be called on the vpnTunnelClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the vpnTunnelClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of VpnTunnelSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of VpnTunnelSettings to create(). + * For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -116,19 +105,14 @@ public class VpnTunnelClient implements BackgroundResource {
   private final VpnTunnelSettings settings;
   private final VpnTunnelStub stub;
 
-
-
-  /**
-   * Constructs an instance of VpnTunnelClient with default settings.
-   */
+  /** Constructs an instance of VpnTunnelClient with default settings. */
   public static final VpnTunnelClient create() throws IOException {
     return create(VpnTunnelSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of VpnTunnelClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of VpnTunnelClient, using the given settings. The channels are created
+   * based on the settings passed in, or defaults for any settings that are not set.
    */
   public static final VpnTunnelClient create(VpnTunnelSettings settings) throws IOException {
     return new VpnTunnelClient(settings);
@@ -144,9 +128,8 @@ public static final VpnTunnelClient create(VpnTunnelStub stub) {
   }
 
   /**
-   * Constructs an instance of VpnTunnelClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of VpnTunnelClient, using the given settings. This is protected so that
+   * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected VpnTunnelClient(VpnTunnelSettings settings) throws IOException {
     this.settings = settings;
@@ -168,12 +151,12 @@ public VpnTunnelStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of VPN tunnels.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -190,8 +173,8 @@ public VpnTunnelStub getStub() {
   public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(ProjectName project) {
     AggregatedListVpnTunnelsHttpRequest request =
         AggregatedListVpnTunnelsHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return aggregatedListVpnTunnels(request);
   }
 
@@ -199,7 +182,8 @@ public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(Proj
   /**
    * Retrieves an aggregated list of VPN tunnels.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -215,9 +199,7 @@ public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(Proj
   @BetaApi
   public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(String project) {
     AggregatedListVpnTunnelsHttpRequest request =
-        AggregatedListVpnTunnelsHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+        AggregatedListVpnTunnelsHttpRequest.newBuilder().setProject(project).build();
     return aggregatedListVpnTunnels(request);
   }
 
@@ -225,7 +207,8 @@ public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(Stri
   /**
    * Retrieves an aggregated list of VPN tunnels.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -242,16 +225,17 @@ public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(Stri
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(AggregatedListVpnTunnelsHttpRequest request) {
-    return aggregatedListVpnTunnelsPagedCallable()
-        .call(request);
+  public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(
+      AggregatedListVpnTunnelsHttpRequest request) {
+    return aggregatedListVpnTunnelsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves an aggregated list of VPN tunnels.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -267,7 +251,9 @@ public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels(Aggr
    * 
*/ @BetaApi - public final UnaryCallable aggregatedListVpnTunnelsPagedCallable() { + public final UnaryCallable< + AggregatedListVpnTunnelsHttpRequest, AggregatedListVpnTunnelsPagedResponse> + aggregatedListVpnTunnelsPagedCallable() { return stub.aggregatedListVpnTunnelsPagedCallable(); } @@ -275,7 +261,8 @@ public final UnaryCallableSample code: + * *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -298,7 +285,8 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable aggregatedListVpnTunnelsCallable() { + public final UnaryCallable + aggregatedListVpnTunnelsCallable() { return stub.aggregatedListVpnTunnelsCallable(); } @@ -306,7 +294,8 @@ public final UnaryCallableSample code: + * *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -315,11 +304,15 @@ public final UnaryCallable
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param vpnTunnel Name of the VpnTunnel resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -328,9 +321,9 @@ public final Operation deleteVpnTunnel(String requestId, ProjectRegionVpnTunnelN DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) - .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString()) - .build(); + .setRequestId(requestId) + .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString()) + .build(); return deleteVpnTunnel(request); } @@ -338,7 +331,8 @@ public final Operation deleteVpnTunnel(String requestId, ProjectRegionVpnTunnelN /** * Deletes the specified VpnTunnel resource. * - * Sample code: + *

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -347,11 +341,15 @@ public final Operation deleteVpnTunnel(String requestId, ProjectRegionVpnTunnelN
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param vpnTunnel Name of the VpnTunnel resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -360,9 +358,9 @@ public final Operation deleteVpnTunnel(String requestId, String vpnTunnel) { DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) - .setVpnTunnel(vpnTunnel) - .build(); + .setRequestId(requestId) + .setVpnTunnel(vpnTunnel) + .build(); return deleteVpnTunnel(request); } @@ -370,7 +368,8 @@ public final Operation deleteVpnTunnel(String requestId, String vpnTunnel) { /** * Deletes the specified VpnTunnel resource. * - * Sample code: + *

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -395,7 +394,8 @@ public final Operation deleteVpnTunnel(DeleteVpnTunnelHttpRequest request) {
   /**
    * Deletes the specified VpnTunnel resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -417,9 +417,11 @@ public final UnaryCallable deleteVpnTunne
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request.
+   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
@@ -435,16 +437,18 @@ public final VpnTunnel getVpnTunnel(ProjectRegionVpnTunnelName vpnTunnel) {
 
     GetVpnTunnelHttpRequest request =
         GetVpnTunnelHttpRequest.newBuilder()
-        .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString())
-        .build();
+            .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString())
+            .build();
     return getVpnTunnel(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request.
+   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
@@ -459,17 +463,17 @@ public final VpnTunnel getVpnTunnel(ProjectRegionVpnTunnelName vpnTunnel) {
   public final VpnTunnel getVpnTunnel(String vpnTunnel) {
 
     GetVpnTunnelHttpRequest request =
-        GetVpnTunnelHttpRequest.newBuilder()
-        .setVpnTunnel(vpnTunnel)
-        .build();
+        GetVpnTunnelHttpRequest.newBuilder().setVpnTunnel(vpnTunnel).build();
     return getVpnTunnel(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request.
+   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
@@ -490,9 +494,11 @@ public final VpnTunnel getVpnTunnel(GetVpnTunnelHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request.
+   * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a
+   * list() request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
@@ -512,9 +518,11 @@ public final UnaryCallable getVpnTunnelCalla
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a VpnTunnel resource in the specified project and region using the data included in the request.
+   * Creates a VpnTunnel resource in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -524,32 +532,40 @@ public final UnaryCallable getVpnTunnelCalla
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==) + * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== + * resource_for v1.vpnTunnels ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertVpnTunnel(String requestId, ProjectRegionName region, VpnTunnel vpnTunnelResource) { + public final Operation insertVpnTunnel( + String requestId, ProjectRegionName region, VpnTunnel vpnTunnelResource) { InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region == null ? null : region.toString()) - .setVpnTunnelResource(vpnTunnelResource) - .build(); + .setRequestId(requestId) + .setRegion(region == null ? null : region.toString()) + .setVpnTunnelResource(vpnTunnelResource) + .build(); return insertVpnTunnel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * Creates a VpnTunnel resource in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -559,32 +575,40 @@ public final Operation insertVpnTunnel(String requestId, ProjectRegionName regio
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - * - * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. - * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==) + * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== + * resource_for v1.vpnTunnels ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertVpnTunnel(String requestId, String region, VpnTunnel vpnTunnelResource) { + public final Operation insertVpnTunnel( + String requestId, String region, VpnTunnel vpnTunnelResource) { InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) - .setRegion(region) - .setVpnTunnelResource(vpnTunnelResource) - .build(); + .setRequestId(requestId) + .setRegion(region) + .setVpnTunnelResource(vpnTunnelResource) + .build(); return insertVpnTunnel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * Creates a VpnTunnel resource in the specified project and region using the data included in the + * request. + * + *

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -609,9 +633,11 @@ public final Operation insertVpnTunnel(InsertVpnTunnelHttpRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates a VpnTunnel resource in the specified project and region using the data included in the request.
+   * Creates a VpnTunnel resource in the specified project and region using the data included in the
+   * request.
+   *
+   * 

Sample code: * - * Sample code: *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   String requestId = "";
@@ -637,7 +663,8 @@ public final UnaryCallable insertVpnTunne
   /**
    * Retrieves a list of VpnTunnel resources contained in the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -654,8 +681,8 @@ public final UnaryCallable insertVpnTunne
   public final ListVpnTunnelsPagedResponse listVpnTunnels(ProjectRegionName region) {
     ListVpnTunnelsHttpRequest request =
         ListVpnTunnelsHttpRequest.newBuilder()
-        .setRegion(region == null ? null : region.toString())
-        .build();
+            .setRegion(region == null ? null : region.toString())
+            .build();
     return listVpnTunnels(request);
   }
 
@@ -663,7 +690,8 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(ProjectRegionName region
   /**
    * Retrieves a list of VpnTunnel resources contained in the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -679,9 +707,7 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(ProjectRegionName region
   @BetaApi
   public final ListVpnTunnelsPagedResponse listVpnTunnels(String region) {
     ListVpnTunnelsHttpRequest request =
-        ListVpnTunnelsHttpRequest.newBuilder()
-        .setRegion(region)
-        .build();
+        ListVpnTunnelsHttpRequest.newBuilder().setRegion(region).build();
     return listVpnTunnels(request);
   }
 
@@ -689,7 +715,8 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(String region) {
   /**
    * Retrieves a list of VpnTunnel resources contained in the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -707,15 +734,15 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(String region) {
    */
   @BetaApi
   public final ListVpnTunnelsPagedResponse listVpnTunnels(ListVpnTunnelsHttpRequest request) {
-    return listVpnTunnelsPagedCallable()
-        .call(request);
+    return listVpnTunnelsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of VpnTunnel resources contained in the specified project and region.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -731,7 +758,8 @@ public final ListVpnTunnelsPagedResponse listVpnTunnels(ListVpnTunnelsHttpReques
    * 
*/ @BetaApi - public final UnaryCallable listVpnTunnelsPagedCallable() { + public final UnaryCallable + listVpnTunnelsPagedCallable() { return stub.listVpnTunnelsPagedCallable(); } @@ -739,7 +767,8 @@ public final UnaryCallableSample code: + * *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
@@ -767,7 +796,7 @@ public final UnaryCallable listVpnTunn
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -796,15 +825,15 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class AggregatedListVpnTunnelsPagedResponse extends AbstractPagedListResponse<
-      AggregatedListVpnTunnelsHttpRequest,
-      VpnTunnelAggregatedList,
-      VpnTunnelsScopedList,
-      AggregatedListVpnTunnelsPage,
-      AggregatedListVpnTunnelsFixedSizeCollection> {
+  public static class AggregatedListVpnTunnelsPagedResponse
+      extends AbstractPagedListResponse<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList,
+          AggregatedListVpnTunnelsPage, AggregatedListVpnTunnelsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
-        PageContext context,
+        PageContext<
+                AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList>
+            context,
         ApiFuture futureResponse) {
       ApiFuture futurePage =
           AggregatedListVpnTunnelsPage.createEmptyPage().createPageAsync(context, futureResponse);
@@ -821,18 +850,17 @@ public AggregatedListVpnTunnelsPagedResponse apply(AggregatedListVpnTunnelsPage
     private AggregatedListVpnTunnelsPagedResponse(AggregatedListVpnTunnelsPage page) {
       super(page, AggregatedListVpnTunnelsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class AggregatedListVpnTunnelsPage extends AbstractPage<
-      AggregatedListVpnTunnelsHttpRequest,
-      VpnTunnelAggregatedList,
-      VpnTunnelsScopedList,
-      AggregatedListVpnTunnelsPage> {
+  public static class AggregatedListVpnTunnelsPage
+      extends AbstractPage<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList,
+          AggregatedListVpnTunnelsPage> {
 
     private AggregatedListVpnTunnelsPage(
-        PageContext context,
+        PageContext<
+                AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList>
+            context,
         VpnTunnelAggregatedList response) {
       super(context, response);
     }
@@ -843,31 +871,30 @@ private static AggregatedListVpnTunnelsPage createEmptyPage() {
 
     @Override
     protected AggregatedListVpnTunnelsPage createPage(
-        PageContext context,
+        PageContext<
+                AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList>
+            context,
         VpnTunnelAggregatedList response) {
       return new AggregatedListVpnTunnelsPage(context, response);
     }
 
     @Override
     public ApiFuture createPageAsync(
-        PageContext context,
+        PageContext<
+                AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList>
+            context,
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class AggregatedListVpnTunnelsFixedSizeCollection extends AbstractFixedSizeCollection<
-      AggregatedListVpnTunnelsHttpRequest,
-      VpnTunnelAggregatedList,
-      VpnTunnelsScopedList,
-      AggregatedListVpnTunnelsPage,
-      AggregatedListVpnTunnelsFixedSizeCollection> {
+  public static class AggregatedListVpnTunnelsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList,
+          AggregatedListVpnTunnelsPage, AggregatedListVpnTunnelsFixedSizeCollection> {
 
-    private AggregatedListVpnTunnelsFixedSizeCollection(List pages, int collectionSize) {
+    private AggregatedListVpnTunnelsFixedSizeCollection(
+        List pages, int collectionSize) {
       super(pages, collectionSize);
     }
 
@@ -880,15 +907,12 @@ protected AggregatedListVpnTunnelsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new AggregatedListVpnTunnelsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-  public static class ListVpnTunnelsPagedResponse extends AbstractPagedListResponse<
-      ListVpnTunnelsHttpRequest,
-      VpnTunnelList,
-      VpnTunnel,
-      ListVpnTunnelsPage,
-      ListVpnTunnelsFixedSizeCollection> {
+
+  public static class ListVpnTunnelsPagedResponse
+      extends AbstractPagedListResponse<
+          ListVpnTunnelsHttpRequest, VpnTunnelList, VpnTunnel, ListVpnTunnelsPage,
+          ListVpnTunnelsFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -908,15 +932,11 @@ public ListVpnTunnelsPagedResponse apply(ListVpnTunnelsPage input) {
     private ListVpnTunnelsPagedResponse(ListVpnTunnelsPage page) {
       super(page, ListVpnTunnelsFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListVpnTunnelsPage extends AbstractPage<
-      ListVpnTunnelsHttpRequest,
-      VpnTunnelList,
-      VpnTunnel,
-      ListVpnTunnelsPage> {
+  public static class ListVpnTunnelsPage
+      extends AbstractPage<
+          ListVpnTunnelsHttpRequest, VpnTunnelList, VpnTunnel, ListVpnTunnelsPage> {
 
     private ListVpnTunnelsPage(
         PageContext context,
@@ -941,18 +961,12 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListVpnTunnelsFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListVpnTunnelsHttpRequest,
-      VpnTunnelList,
-      VpnTunnel,
-      ListVpnTunnelsPage,
-      ListVpnTunnelsFixedSizeCollection> {
+  public static class ListVpnTunnelsFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListVpnTunnelsHttpRequest, VpnTunnelList, VpnTunnel, ListVpnTunnelsPage,
+          ListVpnTunnelsFixedSizeCollection> {
 
     private ListVpnTunnelsFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -967,7 +981,5 @@ protected ListVpnTunnelsFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListVpnTunnelsFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
index b3192f22bee3..3b6b900db1fd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private VpnTunnelList() {
     this.warning = null;
   }
 
-
   private VpnTunnelList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(VpnTunnelList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static VpnTunnelList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final VpnTunnelList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new VpnTunnelList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public VpnTunnelList build() {
 
-
-
-
-
-      return new VpnTunnelList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new VpnTunnelList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "VpnTunnelList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof VpnTunnelList) {
       VpnTunnelList that = (VpnTunnelList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java
deleted file mode 100644
index 391ce9fef848..000000000000
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelName.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 2018 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.compute.v1;
-
-import com.google.api.core.BetaApi;
-import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceNameFactory;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Generated;
-
-@Generated("by GAPIC")
-@BetaApi
-public final class VpnTunnelName implements com.google.api.resourcenames.ResourceName {
-  private final String project;
-  private final String region;
-  private final String vpnTunnel;
-  private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}");
-
-  private volatile Map fieldValuesMap;
-
-  public static Builder newBuilder() {
-    return new Builder();
-  }
-
-  public Builder toBuilder() {
-    return new Builder(this);
-  }
-
-  private VpnTunnelName(Builder builder) {
-    project = Preconditions.checkNotNull(builder.getProject());
-    region = Preconditions.checkNotNull(builder.getRegion());
-    vpnTunnel = Preconditions.checkNotNull(builder.getVpnTunnel());
-  }
-
-  public static VpnTunnelName of(
-      String project,
-      String region,
-      String vpnTunnel
-      ) {
-    return newBuilder()
-    .setProject(project)
-    .setRegion(region)
-    .setVpnTunnel(vpnTunnel)
-      .build();
-  }
-
-  public static String format(
-      String project,
-      String region,
-      String vpnTunnel
-      ) {
-    return of(
-        project,
-        region,
-        vpnTunnel
-        )
-        .toString();
-  }
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getRegion() {
-    return region;
-  }
-
-  public String getVpnTunnel() {
-    return vpnTunnel;
-  }
-
-
-  @Override
-  public Map getFieldValuesMap() {
-    if (fieldValuesMap == null) {
-      synchronized (this) {
-        if (fieldValuesMap == null) {
-          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
-          fieldMapBuilder.put("project", project);
-          fieldMapBuilder.put("region", region);
-          fieldMapBuilder.put("vpnTunnel", vpnTunnel);
-          fieldValuesMap = fieldMapBuilder.build();
-        }
-      }
-    }
-    return fieldValuesMap;
-  }
-
-  public String getFieldValue(String fieldName) {
-    return getFieldValuesMap().get(fieldName);
-  }
-
-
-  public static ResourceNameFactory newFactory() {
-    return new ResourceNameFactory() {
-      public VpnTunnelName parse(String formattedString) {return VpnTunnelName.parse(formattedString);}
-    };
-  }
-
-  public static VpnTunnelName parse(String formattedString) {
-    Map matchMap =
-        PATH_TEMPLATE.validatedMatch(formattedString, "VpnTunnelName.parse: formattedString not in valid format");
-    return of(
-      matchMap.get("project"),
-      matchMap.get("region"),
-      matchMap.get("vpnTunnel")
-    );
-  }
-
-  public static boolean isParsableFrom(String formattedString) {
-    return PATH_TEMPLATE.matches(formattedString);
-  }
-
-  public static class Builder {
-    private String project;
-    private String region;
-    private String vpnTunnel;
-
-    public String getProject() {
-      return project;
-    }
-    public String getRegion() {
-      return region;
-    }
-    public String getVpnTunnel() {
-      return vpnTunnel;
-    }
-
-    public Builder setProject(String project) {
-      this.project = project;
-      return this;
-    }
-    public Builder setRegion(String region) {
-      this.region = region;
-      return this;
-    }
-    public Builder setVpnTunnel(String vpnTunnel) {
-      this.vpnTunnel = vpnTunnel;
-      return this;
-    }
-
-    private Builder() {}
-
-    public Builder (VpnTunnelName vpnTunnelName) {
-      project = vpnTunnelName.project;
-      region = vpnTunnelName.region;
-      vpnTunnel = vpnTunnelName.vpnTunnel;
-    }
-
-    public VpnTunnelName build() {
-      return new VpnTunnelName(this);
-    }
-  }
-
-  @Override
-  public String toString() {
-    return PATH_TEMPLATE.instantiate(
-        "project", project,
-        "region", region,
-        "vpnTunnel", vpnTunnel
-        );
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o instanceof VpnTunnelName) {
-      VpnTunnelName that = (VpnTunnelName) o;
-      return
-          Objects.equals(this.project, that.getProject()) &&
-          Objects.equals(this.region, that.getRegion()) &&
-          Objects.equals(this.vpnTunnel, that.getVpnTunnel())
-          ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(
-      project,
-      region,
-      vpnTunnel
-    );
-  }
-}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java
index 823260a567da..87126c61a856 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java
@@ -15,46 +15,24 @@
  */
 package com.google.cloud.compute.v1;
 
+import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse;
+import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse;
+
 import com.google.api.core.ApiFunction;
-import com.google.api.core.ApiFuture;
 import com.google.api.core.BetaApi;
-import com.google.api.gax.core.CredentialsProvider;
-import com.google.api.gax.core.ExecutorProvider;
-import com.google.api.gax.core.GaxProperties;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
-import com.google.api.gax.httpjson.GaxHttpJsonProperties;
-import com.google.api.gax.httpjson.HttpJsonTransportChannel;
 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
-import com.google.api.gax.retrying.RetrySettings;
-import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
-import com.google.api.gax.rpc.HeaderProvider;
-import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.PagedCallSettings;
-import com.google.api.gax.rpc.PagedListDescriptor;
-import com.google.api.gax.rpc.PagedListResponseFactory;
-import com.google.api.gax.rpc.StatusCode;
-import com.google.api.gax.rpc.StubSettings;
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.auth.Credentials;
-import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse;
-import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse;
 import com.google.cloud.compute.v1.stub.VpnTunnelStubSettings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.io.IOException;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import javax.annotation.Generated;
-import org.threeten.bp.Duration;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
@@ -63,15 +41,15 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteVpnTunnel to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteVpnTunnel to 30 seconds: * *

  * 
@@ -86,84 +64,66 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class VpnTunnelSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to aggregatedListVpnTunnels.
-   */
-  public PagedCallSettings aggregatedListVpnTunnelsSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListVpnTunnels. */
+  public PagedCallSettings<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+          AggregatedListVpnTunnelsPagedResponse>
+      aggregatedListVpnTunnelsSettings() {
     return ((VpnTunnelStubSettings) getStubSettings()).aggregatedListVpnTunnelsSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteVpnTunnel.
-   */
+  /** Returns the object with the settings used for calls to deleteVpnTunnel. */
   public UnaryCallSettings deleteVpnTunnelSettings() {
     return ((VpnTunnelStubSettings) getStubSettings()).deleteVpnTunnelSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getVpnTunnel.
-   */
+  /** Returns the object with the settings used for calls to getVpnTunnel. */
   public UnaryCallSettings getVpnTunnelSettings() {
     return ((VpnTunnelStubSettings) getStubSettings()).getVpnTunnelSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertVpnTunnel.
-   */
+  /** Returns the object with the settings used for calls to insertVpnTunnel. */
   public UnaryCallSettings insertVpnTunnelSettings() {
     return ((VpnTunnelStubSettings) getStubSettings()).insertVpnTunnelSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listVpnTunnels.
-   */
-  public PagedCallSettings listVpnTunnelsSettings() {
+  /** Returns the object with the settings used for calls to listVpnTunnels. */
+  public PagedCallSettings
+      listVpnTunnelsSettings() {
     return ((VpnTunnelStubSettings) getStubSettings()).listVpnTunnelsSettings();
   }
 
-
   public static final VpnTunnelSettings create(VpnTunnelStubSettings stub) throws IOException {
     return new VpnTunnelSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return VpnTunnelStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return VpnTunnelStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return VpnTunnelStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return VpnTunnelStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return VpnTunnelStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return VpnTunnelStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return VpnTunnelStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -176,23 +136,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return VpnTunnelStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -201,9 +155,7 @@ protected VpnTunnelSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for VpnTunnelSettings.
-   */
+  /** Builder for VpnTunnelSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -225,53 +177,52 @@ protected Builder(VpnTunnelStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public VpnTunnelStubSettings.Builder getStubSettingsBuilder() {
       return ((VpnTunnelStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to aggregatedListVpnTunnels. - */ - public PagedCallSettings.Builder aggregatedListVpnTunnelsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListVpnTunnels. */ + public PagedCallSettings.Builder< + AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, + AggregatedListVpnTunnelsPagedResponse> + aggregatedListVpnTunnelsSettings() { return getStubSettingsBuilder().aggregatedListVpnTunnelsSettings(); } - /** - * Returns the builder for the settings used for calls to deleteVpnTunnel. - */ - public UnaryCallSettings.Builder deleteVpnTunnelSettings() { + /** Returns the builder for the settings used for calls to deleteVpnTunnel. */ + public UnaryCallSettings.Builder + deleteVpnTunnelSettings() { return getStubSettingsBuilder().deleteVpnTunnelSettings(); } - /** - * Returns the builder for the settings used for calls to getVpnTunnel. - */ + /** Returns the builder for the settings used for calls to getVpnTunnel. */ public UnaryCallSettings.Builder getVpnTunnelSettings() { return getStubSettingsBuilder().getVpnTunnelSettings(); } - /** - * Returns the builder for the settings used for calls to insertVpnTunnel. - */ - public UnaryCallSettings.Builder insertVpnTunnelSettings() { + /** Returns the builder for the settings used for calls to insertVpnTunnel. */ + public UnaryCallSettings.Builder + insertVpnTunnelSettings() { return getStubSettingsBuilder().insertVpnTunnelSettings(); } - /** - * Returns the builder for the settings used for calls to listVpnTunnels. - */ - public PagedCallSettings.Builder listVpnTunnelsSettings() { + /** Returns the builder for the settings used for calls to listVpnTunnels. */ + public PagedCallSettings.Builder< + ListVpnTunnelsHttpRequest, VpnTunnelList, ListVpnTunnelsPagedResponse> + listVpnTunnelsSettings() { return getStubSettingsBuilder().listVpnTunnelsSettings(); } @@ -280,4 +231,4 @@ public VpnTunnelSettings build() throws IOException { return new VpnTunnelSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java index f9b10da57343..8c08a390bf52 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -40,11 +39,7 @@ private VpnTunnelsScopedList() { this.warning = null; } - - private VpnTunnelsScopedList( - List vpnTunnels, - Warning warning - ) { + private VpnTunnelsScopedList(List vpnTunnels, Warning warning) { this.vpnTunnels = vpnTunnels; this.warning = warning; } @@ -90,22 +85,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(VpnTunnelsScopedList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static VpnTunnelsScopedList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final VpnTunnelsScopedList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new VpnTunnelsScopedList(); } @@ -158,13 +155,9 @@ public Builder setWarning(Warning warning) { return this; } - public VpnTunnelsScopedList build() { - return new VpnTunnelsScopedList( - vpnTunnels, - warning - ); + return new VpnTunnelsScopedList(vpnTunnels, warning); } public Builder clone() { @@ -177,10 +170,7 @@ public Builder clone() { @Override public String toString() { - return "VpnTunnelsScopedList{" - + "vpnTunnels=" + vpnTunnels + ", " - + "warning=" + warning - + "}"; + return "VpnTunnelsScopedList{" + "vpnTunnels=" + vpnTunnels + ", " + "warning=" + warning + "}"; } @Override @@ -190,19 +180,14 @@ public boolean equals(Object o) { } if (o instanceof VpnTunnelsScopedList) { VpnTunnelsScopedList that = (VpnTunnelsScopedList) o; - return - Objects.equals(this.vpnTunnels, that.getVpnTunnelsList()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.vpnTunnels, that.getVpnTunnelsList()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - vpnTunnels, - warning - ); + return Objects.hash(vpnTunnels, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java index 735ff1d81097..8728216ff0df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,12 +41,7 @@ private Warning() { this.message = null; } - - private Warning( - String code, - List data, - String message - ) { + private Warning(String code, List data, String message) { this.code = code; this.data = data; this.message = message; @@ -104,22 +98,24 @@ public String getMessage() { return message; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Warning prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Warning getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Warning DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Warning(); } @@ -186,15 +182,9 @@ public Builder setMessage(String message) { return this; } - public Warning build() { - - return new Warning( - code, - data, - message - ); + return new Warning(code, data, message); } public Builder clone() { @@ -208,11 +198,7 @@ public Builder clone() { @Override public String toString() { - return "Warning{" - + "code=" + code + ", " - + "data=" + data + ", " - + "message=" + message - + "}"; + return "Warning{" + "code=" + code + ", " + "data=" + data + ", " + "message=" + message + "}"; } @Override @@ -222,21 +208,15 @@ public boolean equals(Object o) { } if (o instanceof Warning) { Warning that = (Warning) o; - return - Objects.equals(this.code, that.getCode()) && - Objects.equals(this.data, that.getDataList()) && - Objects.equals(this.message, that.getMessage()) - ; + return Objects.equals(this.code, that.getCode()) + && Objects.equals(this.data, that.getDataList()) + && Objects.equals(this.message, that.getMessage()); } return false; } @Override public int hashCode() { - return Objects.hash( - code, - data, - message - ); + return Objects.hash(code, data, message); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java index ab20f171ccdf..4620e964b2d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -42,12 +41,7 @@ private Warnings() { this.message = null; } - - private Warnings( - String code, - List data, - String message - ) { + private Warnings(String code, List data, String message) { this.code = code; this.data = data; this.message = message; @@ -104,22 +98,24 @@ public String getMessage() { return message; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Warnings prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Warnings getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Warnings DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Warnings(); } @@ -186,15 +182,9 @@ public Builder setMessage(String message) { return this; } - public Warnings build() { - - return new Warnings( - code, - data, - message - ); + return new Warnings(code, data, message); } public Builder clone() { @@ -208,11 +198,7 @@ public Builder clone() { @Override public String toString() { - return "Warnings{" - + "code=" + code + ", " - + "data=" + data + ", " - + "message=" + message - + "}"; + return "Warnings{" + "code=" + code + ", " + "data=" + data + ", " + "message=" + message + "}"; } @Override @@ -222,21 +208,15 @@ public boolean equals(Object o) { } if (o instanceof Warnings) { Warnings that = (Warnings) o; - return - Objects.equals(this.code, that.getCode()) && - Objects.equals(this.data, that.getDataList()) && - Objects.equals(this.message, that.getMessage()) - ; + return Objects.equals(this.code, that.getCode()) + && Objects.equals(this.data, that.getDataList()) + && Objects.equals(this.message, that.getMessage()); } return false; } @Override public int hashCode() { - return Objects.hash( - code, - data, - message - ); + return Objects.hash(code, data, message); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java index 44f3ea53d736..43273af679dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -48,15 +47,13 @@ private XpnHostList() { this.warning = null; } - private XpnHostList( String id, List items, String kind, String nextPageToken, String selfLink, - Warning warning - ) { + Warning warning) { this.id = id; this.items = items; this.kind = kind; @@ -146,22 +143,24 @@ public Warning getWarning() { return warning; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(XpnHostList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static XpnHostList getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final XpnHostList DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new XpnHostList(); } @@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) { return this; } - public XpnHostList build() { - - - - - return new XpnHostList( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return new XpnHostList(id, items, kind, nextPageToken, selfLink, warning); } public Builder clone() { @@ -302,12 +289,23 @@ public Builder clone() { @Override public String toString() { return "XpnHostList{" - + "id=" + id + ", " - + "items=" + items + ", " - + "kind=" + kind + ", " - + "nextPageToken=" + nextPageToken + ", " - + "selfLink=" + selfLink + ", " - + "warning=" + warning + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + "}"; } @@ -318,27 +316,18 @@ public boolean equals(Object o) { } if (o instanceof XpnHostList) { XpnHostList that = (XpnHostList) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.items, that.getItemsList()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.nextPageToken, that.getNextPageToken()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.warning, that.getWarning()) - ; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - items, - kind, - nextPageToken, - selfLink, - warning - ); + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java index a13f729fc341..130421428275 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private XpnResourceId() { this.type = null; } - - private XpnResourceId( - String id, - String type - ) { + private XpnResourceId(String id, String type) { this.id = id; this.type = type; } @@ -86,22 +79,24 @@ public String getType() { return type; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(XpnResourceId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static XpnResourceId getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final XpnResourceId DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new XpnResourceId(); } @@ -146,13 +141,9 @@ public Builder setType(String type) { return this; } - public XpnResourceId build() { - return new XpnResourceId( - id, - type - ); + return new XpnResourceId(id, type); } public Builder clone() { @@ -165,10 +156,7 @@ public Builder clone() { @Override public String toString() { - return "XpnResourceId{" - + "id=" + id + ", " - + "type=" + type - + "}"; + return "XpnResourceId{" + "id=" + id + ", " + "type=" + type + "}"; } @Override @@ -178,19 +166,13 @@ public boolean equals(Object o) { } if (o instanceof XpnResourceId) { XpnResourceId that = (XpnResourceId) o; - return - Objects.equals(this.id, that.getId()) && - Objects.equals(this.type, that.getType()) - ; + return Objects.equals(this.id, that.getId()) && Objects.equals(this.type, that.getType()); } return false; } @Override public int hashCode() { - return Objects.hash( - id, - type - ); + return Objects.hash(id, type); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java index d81eb6ae32b1..e1e7afeb2e8d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java @@ -18,7 +18,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -56,7 +55,6 @@ private Zone() { this.status = null; } - private Zone( List availableCpuPlatforms, String creationTimestamp, @@ -67,8 +65,7 @@ private Zone( String name, String region, String selfLink, - String status - ) { + String status) { this.availableCpuPlatforms = availableCpuPlatforms; this.creationTimestamp = creationTimestamp; this.deprecated = deprecated; @@ -92,7 +89,8 @@ public Map> populateFieldsInMap(Set fieldNames) { fieldMap.put("availableCpuPlatforms", stringList.build()); } if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put("creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); } if (fieldNames.contains("deprecated") && deprecated != null) { fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); @@ -202,22 +200,24 @@ public String getStatus() { return status; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(Zone prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static Zone getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final Zone DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new Zone(); } @@ -382,29 +382,19 @@ public Builder setStatus(String status) { return this; } - public Zone build() { - - - - - - - - return new Zone( - availableCpuPlatforms, - creationTimestamp, - deprecated, - description, - id, - kind, - name, - region, - selfLink, - status - ); + availableCpuPlatforms, + creationTimestamp, + deprecated, + description, + id, + kind, + name, + region, + selfLink, + status); } public Builder clone() { @@ -426,16 +416,35 @@ public Builder clone() { @Override public String toString() { return "Zone{" - + "availableCpuPlatforms=" + availableCpuPlatforms + ", " - + "creationTimestamp=" + creationTimestamp + ", " - + "deprecated=" + deprecated + ", " - + "description=" + description + ", " - + "id=" + id + ", " - + "kind=" + kind + ", " - + "name=" + name + ", " - + "region=" + region + ", " - + "selfLink=" + selfLink + ", " - + "status=" + status + + "availableCpuPlatforms=" + + availableCpuPlatforms + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "deprecated=" + + deprecated + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "status=" + + status + "}"; } @@ -446,18 +455,16 @@ public boolean equals(Object o) { } if (o instanceof Zone) { Zone that = (Zone) o; - return - Objects.equals(this.availableCpuPlatforms, that.getAvailableCpuPlatformsList()) && - Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && - Objects.equals(this.deprecated, that.getDeprecated()) && - Objects.equals(this.description, that.getDescription()) && - Objects.equals(this.id, that.getId()) && - Objects.equals(this.kind, that.getKind()) && - Objects.equals(this.name, that.getName()) && - Objects.equals(this.region, that.getRegion()) && - Objects.equals(this.selfLink, that.getSelfLink()) && - Objects.equals(this.status, that.getStatus()) - ; + return Objects.equals(this.availableCpuPlatforms, that.getAvailableCpuPlatformsList()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()); } return false; } @@ -465,16 +472,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - availableCpuPlatforms, - creationTimestamp, - deprecated, - description, - id, - kind, - name, - region, - selfLink, - status - ); + availableCpuPlatforms, + creationTimestamp, + deprecated, + description, + id, + kind, + name, + region, + selfLink, + status); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java index 5e45b10244ac..4ca7d6542715 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java @@ -23,22 +23,12 @@ import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.stub.ZoneStub; import com.google.cloud.compute.v1.stub.ZoneStubSettings; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import java.io.Closeable; import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,34 +48,33 @@ * *

* - *

Note: close() needs to be called on the zoneClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the zoneClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - *

This class can be customized by passing in a custom instance of ZoneSettings to - * create(). For example: + *

This class can be customized by passing in a custom instance of ZoneSettings to create(). For + * example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,19 +104,14 @@ public class ZoneClient implements BackgroundResource {
   private final ZoneSettings settings;
   private final ZoneStub stub;
 
-
-
-  /**
-   * Constructs an instance of ZoneClient with default settings.
-   */
+  /** Constructs an instance of ZoneClient with default settings. */
   public static final ZoneClient create() throws IOException {
     return create(ZoneSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of ZoneClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of ZoneClient, using the given settings. The channels are created based
+   * on the settings passed in, or defaults for any settings that are not set.
    */
   public static final ZoneClient create(ZoneSettings settings) throws IOException {
     return new ZoneClient(settings);
@@ -143,9 +127,8 @@ public static final ZoneClient create(ZoneStub stub) {
   }
 
   /**
-   * Constructs an instance of ZoneClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of ZoneClient, using the given settings. This is protected so that it is
+   * easy to make a subclass, but otherwise, the static factory methods should be preferred.
    */
   protected ZoneClient(ZoneSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +150,12 @@ public ZoneStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Returns the specified Zone resource. Get a list of available zones by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -187,9 +170,7 @@ public ZoneStub getStub() {
   public final Zone getZone(ProjectZoneName zone) {
 
     GetZoneHttpRequest request =
-        GetZoneHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+        GetZoneHttpRequest.newBuilder().setZone(zone == null ? null : zone.toString()).build();
     return getZone(request);
   }
 
@@ -197,7 +178,8 @@ public final Zone getZone(ProjectZoneName zone) {
   /**
    * Returns the specified Zone resource. Get a list of available zones by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -211,10 +193,7 @@ public final Zone getZone(ProjectZoneName zone) {
   @BetaApi
   public final Zone getZone(String zone) {
 
-    GetZoneHttpRequest request =
-        GetZoneHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+    GetZoneHttpRequest request = GetZoneHttpRequest.newBuilder().setZone(zone).build();
     return getZone(request);
   }
 
@@ -222,7 +201,8 @@ public final Zone getZone(String zone) {
   /**
    * Returns the specified Zone resource. Get a list of available zones by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -245,7 +225,8 @@ public final Zone getZone(GetZoneHttpRequest request) {
   /**
    * Returns the specified Zone resource. Get a list of available zones by making a list() request.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -267,7 +248,8 @@ public final UnaryCallable getZoneCallable() {
   /**
    * Retrieves the list of Zone resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -284,8 +266,8 @@ public final UnaryCallable getZoneCallable() {
   public final ListZonesPagedResponse listZones(ProjectName project) {
     ListZonesHttpRequest request =
         ListZonesHttpRequest.newBuilder()
-        .setProject(project == null ? null : project.toString())
-        .build();
+            .setProject(project == null ? null : project.toString())
+            .build();
     return listZones(request);
   }
 
@@ -293,7 +275,8 @@ public final ListZonesPagedResponse listZones(ProjectName project) {
   /**
    * Retrieves the list of Zone resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -308,10 +291,7 @@ public final ListZonesPagedResponse listZones(ProjectName project) {
    */
   @BetaApi
   public final ListZonesPagedResponse listZones(String project) {
-    ListZonesHttpRequest request =
-        ListZonesHttpRequest.newBuilder()
-        .setProject(project)
-        .build();
+    ListZonesHttpRequest request = ListZonesHttpRequest.newBuilder().setProject(project).build();
     return listZones(request);
   }
 
@@ -319,7 +299,8 @@ public final ListZonesPagedResponse listZones(String project) {
   /**
    * Retrieves the list of Zone resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -337,15 +318,15 @@ public final ListZonesPagedResponse listZones(String project) {
    */
   @BetaApi
   public final ListZonesPagedResponse listZones(ListZonesHttpRequest request) {
-    return listZonesPagedCallable()
-        .call(request);
+    return listZonesPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves the list of Zone resources available to the specified project.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -361,7 +342,8 @@ public final ListZonesPagedResponse listZones(ListZonesHttpRequest request) {
    * 
*/ @BetaApi - public final UnaryCallable listZonesPagedCallable() { + public final UnaryCallable + listZonesPagedCallable() { return stub.listZonesPagedCallable(); } @@ -369,7 +351,8 @@ public final UnaryCallable listZon /** * Retrieves the list of Zone resources available to the specified project. * - * Sample code: + *

Sample code: + * *


    * try (ZoneClient zoneClient = ZoneClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
@@ -397,7 +380,7 @@ public final UnaryCallable listZonesCallable() {
   }
 
   @Override
-  public final void close() throws Exception {
+  public final void close() {
     stub.close();
   }
 
@@ -426,12 +409,9 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
     return stub.awaitTermination(duration, unit);
   }
 
-  public static class ListZonesPagedResponse extends AbstractPagedListResponse<
-      ListZonesHttpRequest,
-      ZoneList,
-      Zone,
-      ListZonesPage,
-      ListZonesFixedSizeCollection> {
+  public static class ListZonesPagedResponse
+      extends AbstractPagedListResponse<
+          ListZonesHttpRequest, ZoneList, Zone, ListZonesPage, ListZonesFixedSizeCollection> {
 
     public static ApiFuture createAsync(
         PageContext context,
@@ -451,19 +431,13 @@ public ListZonesPagedResponse apply(ListZonesPage input) {
     private ListZonesPagedResponse(ListZonesPage page) {
       super(page, ListZonesFixedSizeCollection.createEmptyCollection());
     }
-
-
   }
 
-  public static class ListZonesPage extends AbstractPage<
-      ListZonesHttpRequest,
-      ZoneList,
-      Zone,
-      ListZonesPage> {
+  public static class ListZonesPage
+      extends AbstractPage {
 
     private ListZonesPage(
-        PageContext context,
-        ZoneList response) {
+        PageContext context, ZoneList response) {
       super(context, response);
     }
 
@@ -473,8 +447,7 @@ private static ListZonesPage createEmptyPage() {
 
     @Override
     protected ListZonesPage createPage(
-        PageContext context,
-        ZoneList response) {
+        PageContext context, ZoneList response) {
       return new ListZonesPage(context, response);
     }
 
@@ -484,18 +457,11 @@ public ApiFuture createPageAsync(
         ApiFuture futureResponse) {
       return super.createPageAsync(context, futureResponse);
     }
-
-
-
-
   }
 
-  public static class ListZonesFixedSizeCollection extends AbstractFixedSizeCollection<
-      ListZonesHttpRequest,
-      ZoneList,
-      Zone,
-      ListZonesPage,
-      ListZonesFixedSizeCollection> {
+  public static class ListZonesFixedSizeCollection
+      extends AbstractFixedSizeCollection<
+          ListZonesHttpRequest, ZoneList, Zone, ListZonesPage, ListZonesFixedSizeCollection> {
 
     private ListZonesFixedSizeCollection(List pages, int collectionSize) {
       super(pages, collectionSize);
@@ -510,7 +476,5 @@ protected ListZonesFixedSizeCollection createCollection(
         List pages, int collectionSize) {
       return new ListZonesFixedSizeCollection(pages, collectionSize);
     }
-
-
   }
-}
\ No newline at end of file
+}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
index a2adfe34bdd0..c73bc4b7f84a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
@@ -18,7 +18,6 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,15 +47,13 @@ private ZoneList() {
     this.warning = null;
   }
 
-
   private ZoneList(
       String id,
       List items,
       String kind,
       String nextPageToken,
       String selfLink,
-      Warning warning
-      ) {
+      Warning warning) {
     this.id = id;
     this.items = items;
     this.kind = kind;
@@ -146,22 +143,24 @@ public Warning getWarning() {
     return warning;
   }
 
-
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
+
   public static Builder newBuilder(ZoneList prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
+
   public Builder toBuilder() {
-    return this == DEFAULT_INSTANCE
-        ? new Builder() : new Builder().mergeFrom(this);
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
   }
 
   public static ZoneList getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
+
   private static final ZoneList DEFAULT_INSTANCE;
+
   static {
     DEFAULT_INSTANCE = new ZoneList();
   }
@@ -270,21 +269,9 @@ public Builder setWarning(Warning warning) {
       return this;
     }
 
-
     public ZoneList build() {
 
-
-
-
-
-      return new ZoneList(
-        id,
-        items,
-        kind,
-        nextPageToken,
-        selfLink,
-        warning
-      );
+      return new ZoneList(id, items, kind, nextPageToken, selfLink, warning);
     }
 
     public Builder clone() {
@@ -302,12 +289,23 @@ public Builder clone() {
   @Override
   public String toString() {
     return "ZoneList{"
-        + "id=" + id + ", "
-        + "items=" + items + ", "
-        + "kind=" + kind + ", "
-        + "nextPageToken=" + nextPageToken + ", "
-        + "selfLink=" + selfLink + ", "
-        + "warning=" + warning
+        + "id="
+        + id
+        + ", "
+        + "items="
+        + items
+        + ", "
+        + "kind="
+        + kind
+        + ", "
+        + "nextPageToken="
+        + nextPageToken
+        + ", "
+        + "selfLink="
+        + selfLink
+        + ", "
+        + "warning="
+        + warning
         + "}";
   }
 
@@ -318,27 +316,18 @@ public boolean equals(Object o) {
     }
     if (o instanceof ZoneList) {
       ZoneList that = (ZoneList) o;
-      return
-          Objects.equals(this.id, that.getId()) &&
-          Objects.equals(this.items, that.getItemsList()) &&
-          Objects.equals(this.kind, that.getKind()) &&
-          Objects.equals(this.nextPageToken, that.getNextPageToken()) &&
-          Objects.equals(this.selfLink, that.getSelfLink()) &&
-          Objects.equals(this.warning, that.getWarning())
-          ;
+      return Objects.equals(this.id, that.getId())
+          && Objects.equals(this.items, that.getItemsList())
+          && Objects.equals(this.kind, that.getKind())
+          && Objects.equals(this.nextPageToken, that.getNextPageToken())
+          && Objects.equals(this.selfLink, that.getSelfLink())
+          && Objects.equals(this.warning, that.getWarning());
     }
     return false;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(
-      id,
-      items,
-      kind,
-      nextPageToken,
-      selfLink,
-      warning
-    );
+    return Objects.hash(id, items, kind, nextPageToken, selfLink, warning);
   }
 }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java
deleted file mode 100644
index 618e5b90426e..000000000000
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneName.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2018 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.compute.v1;
-
-import com.google.api.core.BetaApi;
-import com.google.api.pathtemplate.PathTemplate;
-import com.google.api.resourcenames.ResourceNameFactory;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Generated;
-
-@Generated("by GAPIC")
-@BetaApi
-public final class ZoneName implements com.google.api.resourcenames.ResourceName {
-  private final String project;
-  private final String zone;
-  private static final PathTemplate PATH_TEMPLATE =
-        PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}");
-
-  private volatile Map fieldValuesMap;
-
-  public static Builder newBuilder() {
-    return new Builder();
-  }
-
-  public Builder toBuilder() {
-    return new Builder(this);
-  }
-
-  private ZoneName(Builder builder) {
-    project = Preconditions.checkNotNull(builder.getProject());
-    zone = Preconditions.checkNotNull(builder.getZone());
-  }
-
-  public static ZoneName of(
-      String project,
-      String zone
-      ) {
-    return newBuilder()
-    .setProject(project)
-    .setZone(zone)
-      .build();
-  }
-
-  public static String format(
-      String project,
-      String zone
-      ) {
-    return of(
-        project,
-        zone
-        )
-        .toString();
-  }
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getZone() {
-    return zone;
-  }
-
-
-  @Override
-  public Map getFieldValuesMap() {
-    if (fieldValuesMap == null) {
-      synchronized (this) {
-        if (fieldValuesMap == null) {
-          ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
-          fieldMapBuilder.put("project", project);
-          fieldMapBuilder.put("zone", zone);
-          fieldValuesMap = fieldMapBuilder.build();
-        }
-      }
-    }
-    return fieldValuesMap;
-  }
-
-  public String getFieldValue(String fieldName) {
-    return getFieldValuesMap().get(fieldName);
-  }
-
-
-  public static ResourceNameFactory newFactory() {
-    return new ResourceNameFactory() {
-      public ZoneName parse(String formattedString) {return ZoneName.parse(formattedString);}
-    };
-  }
-
-  public static ZoneName parse(String formattedString) {
-    Map matchMap =
-        PATH_TEMPLATE.validatedMatch(formattedString, "ZoneName.parse: formattedString not in valid format");
-    return of(
-      matchMap.get("project"),
-      matchMap.get("zone")
-    );
-  }
-
-  public static boolean isParsableFrom(String formattedString) {
-    return PATH_TEMPLATE.matches(formattedString);
-  }
-
-  public static class Builder {
-    private String project;
-    private String zone;
-
-    public String getProject() {
-      return project;
-    }
-    public String getZone() {
-      return zone;
-    }
-
-    public Builder setProject(String project) {
-      this.project = project;
-      return this;
-    }
-    public Builder setZone(String zone) {
-      this.zone = zone;
-      return this;
-    }
-
-    private Builder() {}
-
-    public Builder (ZoneName zoneName) {
-      project = zoneName.project;
-      zone = zoneName.zone;
-    }
-
-    public ZoneName build() {
-      return new ZoneName(this);
-    }
-  }
-
-  @Override
-  public String toString() {
-    return PATH_TEMPLATE.instantiate(
-        "project", project,
-        "zone", zone
-        );
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o instanceof ZoneName) {
-      ZoneName that = (ZoneName) o;
-      return
-          Objects.equals(this.project, that.getProject()) &&
-          Objects.equals(this.zone, that.getZone())
-          ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(
-      project,
-      zone
-    );
-  }
-}
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java
index f64d65e68bc5..8044d41a12e7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java
@@ -23,22 +23,12 @@
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
 import com.google.api.gax.paging.AbstractPagedListResponse;
-import com.google.api.gax.paging.FixedSizeCollection;
-import com.google.api.gax.paging.Page;
-import com.google.api.gax.rpc.ApiExceptions;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.compute.v1.stub.ZoneOperationStub;
 import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import java.io.Closeable;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Generated;
 
@@ -59,33 +49,32 @@
  * 
* *

Note: close() needs to be called on the zoneOperationClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's methods: + *

The surface of this class includes several types of Java methods for each of the API's + * methods: * *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. + *
  4. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  5. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  6. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. *
* *

See the individual methods for example code. * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * *

This class can be customized by passing in a custom instance of ZoneOperationSettings to * create(). For example: * - * To customize credentials: + *

To customize credentials: * *

  * 
@@ -115,27 +104,23 @@ public class ZoneOperationClient implements BackgroundResource {
   private final ZoneOperationSettings settings;
   private final ZoneOperationStub stub;
 
-
-
-  /**
-   * Constructs an instance of ZoneOperationClient with default settings.
-   */
+  /** Constructs an instance of ZoneOperationClient with default settings. */
   public static final ZoneOperationClient create() throws IOException {
     return create(ZoneOperationSettings.newBuilder().build());
   }
 
   /**
-   * Constructs an instance of ZoneOperationClient, using the given settings.
-   * The channels are created based on the settings passed in, or defaults for any
-   * settings that are not set.
+   * Constructs an instance of ZoneOperationClient, using the given settings. The channels are
+   * created based on the settings passed in, or defaults for any settings that are not set.
    */
-  public static final ZoneOperationClient create(ZoneOperationSettings settings) throws IOException {
+  public static final ZoneOperationClient create(ZoneOperationSettings settings)
+      throws IOException {
     return new ZoneOperationClient(settings);
   }
 
   /**
-   * Constructs an instance of ZoneOperationClient, using the given stub for making calls. This is for
-   * advanced usage - prefer to use ZoneOperationSettings}.
+   * Constructs an instance of ZoneOperationClient, using the given stub for making calls. This is
+   * for advanced usage - prefer to use ZoneOperationSettings}.
    */
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public static final ZoneOperationClient create(ZoneOperationStub stub) {
@@ -143,9 +128,9 @@ public static final ZoneOperationClient create(ZoneOperationStub stub) {
   }
 
   /**
-   * Constructs an instance of ZoneOperationClient, using the given settings.
-   * This is protected so that it is easy to make a subclass, but otherwise, the static
-   * factory methods should be preferred.
+   * Constructs an instance of ZoneOperationClient, using the given settings. This is protected so
+   * that it is easy to make a subclass, but otherwise, the static factory methods should be
+   * preferred.
    */
   protected ZoneOperationClient(ZoneOperationSettings settings) throws IOException {
     this.settings = settings;
@@ -167,12 +152,12 @@ public ZoneOperationStub getStub() {
     return stub;
   }
 
-
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Deletes the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -188,8 +173,8 @@ public final void deleteZoneOperation(ProjectZoneOperationName operation) {
 
     DeleteZoneOperationHttpRequest request =
         DeleteZoneOperationHttpRequest.newBuilder()
-        .setOperation(operation == null ? null : operation.toString())
-        .build();
+            .setOperation(operation == null ? null : operation.toString())
+            .build();
     deleteZoneOperation(request);
   }
 
@@ -197,7 +182,8 @@ public final void deleteZoneOperation(ProjectZoneOperationName operation) {
   /**
    * Deletes the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -212,9 +198,7 @@ public final void deleteZoneOperation(ProjectZoneOperationName operation) {
   public final void deleteZoneOperation(String operation) {
 
     DeleteZoneOperationHttpRequest request =
-        DeleteZoneOperationHttpRequest.newBuilder()
-        .setOperation(operation)
-        .build();
+        DeleteZoneOperationHttpRequest.newBuilder().setOperation(operation).build();
     deleteZoneOperation(request);
   }
 
@@ -222,7 +206,8 @@ public final void deleteZoneOperation(String operation) {
   /**
    * Deletes the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -245,7 +230,8 @@ public final void deleteZoneOperation(DeleteZoneOperationHttpRequest request) {
   /**
    * Deletes the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -267,7 +253,8 @@ public final UnaryCallable deleteZoneOpera
   /**
    * Retrieves the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -283,8 +270,8 @@ public final Operation getZoneOperation(ProjectZoneOperationName operation) {
 
     GetZoneOperationHttpRequest request =
         GetZoneOperationHttpRequest.newBuilder()
-        .setOperation(operation == null ? null : operation.toString())
-        .build();
+            .setOperation(operation == null ? null : operation.toString())
+            .build();
     return getZoneOperation(request);
   }
 
@@ -292,7 +279,8 @@ public final Operation getZoneOperation(ProjectZoneOperationName operation) {
   /**
    * Retrieves the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -307,9 +295,7 @@ public final Operation getZoneOperation(ProjectZoneOperationName operation) {
   public final Operation getZoneOperation(String operation) {
 
     GetZoneOperationHttpRequest request =
-        GetZoneOperationHttpRequest.newBuilder()
-        .setOperation(operation)
-        .build();
+        GetZoneOperationHttpRequest.newBuilder().setOperation(operation).build();
     return getZoneOperation(request);
   }
 
@@ -317,7 +303,8 @@ public final Operation getZoneOperation(String operation) {
   /**
    * Retrieves the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -340,7 +327,8 @@ public final Operation getZoneOperation(GetZoneOperationHttpRequest request) {
   /**
    * Retrieves the specified zone-specific Operations resource.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]");
@@ -362,7 +350,8 @@ public final UnaryCallable getZoneOperat
   /**
    * Retrieves a list of Operation resources contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -379,8 +368,8 @@ public final UnaryCallable getZoneOperat
   public final ListZoneOperationsPagedResponse listZoneOperations(ProjectZoneName zone) {
     ListZoneOperationsHttpRequest request =
         ListZoneOperationsHttpRequest.newBuilder()
-        .setZone(zone == null ? null : zone.toString())
-        .build();
+            .setZone(zone == null ? null : zone.toString())
+            .build();
     return listZoneOperations(request);
   }
 
@@ -388,7 +377,8 @@ public final ListZoneOperationsPagedResponse listZoneOperations(ProjectZoneName
   /**
    * Retrieves a list of Operation resources contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -404,9 +394,7 @@ public final ListZoneOperationsPagedResponse listZoneOperations(ProjectZoneName
   @BetaApi
   public final ListZoneOperationsPagedResponse listZoneOperations(String zone) {
     ListZoneOperationsHttpRequest request =
-        ListZoneOperationsHttpRequest.newBuilder()
-        .setZone(zone)
-        .build();
+        ListZoneOperationsHttpRequest.newBuilder().setZone(zone).build();
     return listZoneOperations(request);
   }
 
@@ -414,7 +402,8 @@ public final ListZoneOperationsPagedResponse listZoneOperations(String zone) {
   /**
    * Retrieves a list of Operation resources contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -431,16 +420,17 @@ public final ListZoneOperationsPagedResponse listZoneOperations(String zone) {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   @BetaApi
-  public final ListZoneOperationsPagedResponse listZoneOperations(ListZoneOperationsHttpRequest request) {
-    return listZoneOperationsPagedCallable()
-        .call(request);
+  public final ListZoneOperationsPagedResponse listZoneOperations(
+      ListZoneOperationsHttpRequest request) {
+    return listZoneOperationsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
    * Retrieves a list of Operation resources contained within the specified zone.
    *
-   * Sample code:
+   * 

Sample code: + * *


    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -456,7 +446,8 @@ public final ListZoneOperationsPagedResponse listZoneOperations(ListZoneOperatio
    * 
*/ @BetaApi - public final UnaryCallable listZoneOperationsPagedCallable() { + public final UnaryCallable + listZoneOperationsPagedCallable() { return stub.listZoneOperationsPagedCallable(); } @@ -464,7 +455,8 @@ public final UnaryCallableSample code: + * *

    * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
@@ -487,12 +479,13 @@ public final UnaryCallable
*/ @BetaApi - public final UnaryCallable listZoneOperationsCallable() { + public final UnaryCallable + listZoneOperationsCallable() { return stub.listZoneOperationsCallable(); } @Override - public final void close() throws Exception { + public final void close() { stub.close(); } @@ -521,12 +514,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListZoneOperationsPagedResponse extends AbstractPagedListResponse< - ListZoneOperationsHttpRequest, - OperationList, - Operation, - ListZoneOperationsPage, - ListZoneOperationsFixedSizeCollection> { + public static class ListZoneOperationsPagedResponse + extends AbstractPagedListResponse< + ListZoneOperationsHttpRequest, OperationList, Operation, ListZoneOperationsPage, + ListZoneOperationsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, @@ -546,15 +537,11 @@ public ListZoneOperationsPagedResponse apply(ListZoneOperationsPage input) { private ListZoneOperationsPagedResponse(ListZoneOperationsPage page) { super(page, ListZoneOperationsFixedSizeCollection.createEmptyCollection()); } - - } - public static class ListZoneOperationsPage extends AbstractPage< - ListZoneOperationsHttpRequest, - OperationList, - Operation, - ListZoneOperationsPage> { + public static class ListZoneOperationsPage + extends AbstractPage< + ListZoneOperationsHttpRequest, OperationList, Operation, ListZoneOperationsPage> { private ListZoneOperationsPage( PageContext context, @@ -579,20 +566,15 @@ public ApiFuture createPageAsync( ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - - - - } - public static class ListZoneOperationsFixedSizeCollection extends AbstractFixedSizeCollection< - ListZoneOperationsHttpRequest, - OperationList, - Operation, - ListZoneOperationsPage, - ListZoneOperationsFixedSizeCollection> { + public static class ListZoneOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListZoneOperationsHttpRequest, OperationList, Operation, ListZoneOperationsPage, + ListZoneOperationsFixedSizeCollection> { - private ListZoneOperationsFixedSizeCollection(List pages, int collectionSize) { + private ListZoneOperationsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } @@ -605,7 +587,5 @@ protected ListZoneOperationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListZoneOperationsFixedSizeCollection(pages, collectionSize); } - - } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java index 3f791014e24d..7b1ddfa64a68 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteZoneOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteZoneOperation to 30 seconds: * *

  * 
@@ -85,70 +63,55 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ZoneOperationSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to deleteZoneOperation.
-   */
+  /** Returns the object with the settings used for calls to deleteZoneOperation. */
   public UnaryCallSettings deleteZoneOperationSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).deleteZoneOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getZoneOperation.
-   */
+  /** Returns the object with the settings used for calls to getZoneOperation. */
   public UnaryCallSettings getZoneOperationSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).getZoneOperationSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listZoneOperations.
-   */
-  public PagedCallSettings listZoneOperationsSettings() {
+  /** Returns the object with the settings used for calls to listZoneOperations. */
+  public PagedCallSettings<
+          ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
+      listZoneOperationsSettings() {
     return ((ZoneOperationStubSettings) getStubSettings()).listZoneOperationsSettings();
   }
 
-
-  public static final ZoneOperationSettings create(ZoneOperationStubSettings stub) throws IOException {
+  public static final ZoneOperationSettings create(ZoneOperationStubSettings stub)
+      throws IOException {
     return new ZoneOperationSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ZoneOperationStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return ZoneOperationStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return ZoneOperationStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return ZoneOperationStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return ZoneOperationStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ZoneOperationStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return ZoneOperationStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -161,23 +124,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ZoneOperationStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -186,9 +143,7 @@ protected ZoneOperationSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for ZoneOperationSettings.
-   */
+  /** Builder for ZoneOperationSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -210,39 +165,39 @@ protected Builder(ZoneOperationStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public ZoneOperationStubSettings.Builder getStubSettingsBuilder() {
       return ((ZoneOperationStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to deleteZoneOperation. - */ - public UnaryCallSettings.Builder deleteZoneOperationSettings() { + /** Returns the builder for the settings used for calls to deleteZoneOperation. */ + public UnaryCallSettings.Builder + deleteZoneOperationSettings() { return getStubSettingsBuilder().deleteZoneOperationSettings(); } - /** - * Returns the builder for the settings used for calls to getZoneOperation. - */ - public UnaryCallSettings.Builder getZoneOperationSettings() { + /** Returns the builder for the settings used for calls to getZoneOperation. */ + public UnaryCallSettings.Builder + getZoneOperationSettings() { return getStubSettingsBuilder().getZoneOperationSettings(); } - /** - * Returns the builder for the settings used for calls to listZoneOperations. - */ - public PagedCallSettings.Builder listZoneOperationsSettings() { + /** Returns the builder for the settings used for calls to listZoneOperations. */ + public PagedCallSettings.Builder< + ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse> + listZoneOperationsSettings() { return getStubSettingsBuilder().listZoneOperationsSettings(); } @@ -251,4 +206,4 @@ public ZoneOperationSettings build() throws IOException { return new ZoneOperationSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java index 7844be031583..af3946d967c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java @@ -17,9 +17,6 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -40,11 +37,7 @@ private ZoneSetLabelsRequest() { this.labels = null; } - - private ZoneSetLabelsRequest( - String labelFingerprint, - Map labels - ) { + private ZoneSetLabelsRequest(String labelFingerprint, Map labels) { this.labelFingerprint = labelFingerprint; this.labels = labels; } @@ -86,22 +79,24 @@ public Map getLabelsMap() { return labels; } - public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } + public static Builder newBuilder(ZoneSetLabelsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } public static ZoneSetLabelsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } + private static final ZoneSetLabelsRequest DEFAULT_INSTANCE; + static { DEFAULT_INSTANCE = new ZoneSetLabelsRequest(); } @@ -146,13 +141,9 @@ public Builder putAllLabels(Map labels) { return this; } - public ZoneSetLabelsRequest build() { - return new ZoneSetLabelsRequest( - labelFingerprint, - labels - ); + return new ZoneSetLabelsRequest(labelFingerprint, labels); } public Builder clone() { @@ -166,8 +157,11 @@ public Builder clone() { @Override public String toString() { return "ZoneSetLabelsRequest{" - + "labelFingerprint=" + labelFingerprint + ", " - + "labels=" + labels + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + "}"; } @@ -178,19 +172,14 @@ public boolean equals(Object o) { } if (o instanceof ZoneSetLabelsRequest) { ZoneSetLabelsRequest that = (ZoneSetLabelsRequest) o; - return - Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) && - Objects.equals(this.labels, that.getLabelsMap()) - ; + return Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()); } return false; } @Override public int hashCode() { - return Objects.hash( - labelFingerprint, - labels - ); + return Objects.hash(labelFingerprint, labels); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java index 63d8e7fbeacf..2171dd596503 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java @@ -15,45 +15,23 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; + import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; import com.google.cloud.compute.v1.stub.ZoneStubSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** @@ -62,15 +40,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getZone to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getZone to 30 seconds: * *

  * 
@@ -85,63 +63,48 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ZoneSettings extends ClientSettings {
-  /**
-   * Returns the object with the settings used for calls to getZone.
-   */
+  /** Returns the object with the settings used for calls to getZone. */
   public UnaryCallSettings getZoneSettings() {
     return ((ZoneStubSettings) getStubSettings()).getZoneSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to listZones.
-   */
-  public PagedCallSettings listZonesSettings() {
+  /** Returns the object with the settings used for calls to listZones. */
+  public PagedCallSettings
+      listZonesSettings() {
     return ((ZoneStubSettings) getStubSettings()).listZonesSettings();
   }
 
-
   public static final ZoneSettings create(ZoneStubSettings stub) throws IOException {
     return new ZoneSettings.Builder(stub.toBuilder()).build();
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return ZoneStubSettings.defaultExecutorProviderBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
-   public static String getDefaultEndpoint() {
-     return ZoneStubSettings.getDefaultEndpoint();
-   }
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service endpoint. */
+  public static String getDefaultEndpoint() {
+    return ZoneStubSettings.getDefaultEndpoint();
+  }
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return ZoneStubSettings.getDefaultServicePort();
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return ZoneStubSettings.getDefaultServiceScopes();
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
     return ZoneStubSettings.defaultCredentialsProviderBuilder();
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return ZoneStubSettings.defaultHttpJsonTransportProviderBuilder();
   }
 
@@ -154,23 +117,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ZoneStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -179,9 +136,7 @@ protected ZoneSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
   }
 
-  /**
-   * Builder for ZoneSettings.
-   */
+  /** Builder for ZoneSettings. */
   public static class Builder extends ClientSettings.Builder {
     protected Builder() throws IOException {
       this((ClientContext) null);
@@ -203,32 +158,31 @@ protected Builder(ZoneStubSettings.Builder stubSettings) {
       super(stubSettings);
     }
 
-
     public ZoneStubSettings.Builder getStubSettingsBuilder() {
       return ((ZoneStubSettings.Builder) getStubSettings());
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } - /** - * Returns the builder for the settings used for calls to getZone. - */ + /** Returns the builder for the settings used for calls to getZone. */ public UnaryCallSettings.Builder getZoneSettings() { return getStubSettingsBuilder().getZoneSettings(); } - /** - * Returns the builder for the settings used for calls to listZones. - */ - public PagedCallSettings.Builder listZonesSettings() { + /** Returns the builder for the settings used for calls to listZones. */ + public PagedCallSettings.Builder + listZonesSettings() { return getStubSettingsBuilder().listZonesSettings(); } @@ -237,4 +191,4 @@ public ZoneSettings build() throws IOException { return new ZoneSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java index 8857e13ed332..6bbcbe59587c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java @@ -17,15 +17,14 @@ /** * A client to Compute Engine API. * - * The interfaces provided are listed below, along with usage samples. + *

The interfaces provided are listed below, along with usage samples. * - * ===================== - * AcceleratorTypeClient - * ===================== + *

===================== AcceleratorTypeClient ===================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for AcceleratorTypeClient: * - * Sample for AcceleratorTypeClient: *

  * 
  * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
@@ -35,13 +34,12 @@
  * 
  * 
* - * ============= - * AddressClient - * ============= + * ============= AddressClient ============= + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for AddressClient: * - * Sample for AddressClient: *

  * 
  * try (AddressClient addressClient = AddressClient.create()) {
@@ -52,13 +50,12 @@
  * 
  * 
* - * ================ - * AutoscalerClient - * ================ + * ================ AutoscalerClient ================ + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for AutoscalerClient: * - * Sample for AutoscalerClient: *

  * 
  * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
@@ -69,47 +66,44 @@
  * 
  * 
* - * =================== - * BackendBucketClient - * =================== + * =================== BackendBucketClient =================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for BackendBucketClient: * - * Sample for BackendBucketClient: *

  * 
  * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
- *   ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+ *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
  *   String requestId = "";
  *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
  * }
  * 
  * 
* - * ==================== - * BackendServiceClient - * ==================== + * ==================== BackendServiceClient ==================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for BackendServiceClient: * - * Sample for BackendServiceClient: *

  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
  *   String requestId = "";
- *   ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+ *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
  *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
  * }
  * 
  * 
* - * ============== - * DiskTypeClient - * ============== + * ============== DiskTypeClient ============== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for DiskTypeClient: * - * Sample for DiskTypeClient: *

  * 
  * try (DiskTypeClient diskTypeClient = DiskTypeClient.create()) {
@@ -119,13 +113,12 @@
  * 
  * 
* - * ========== - * DiskClient - * ========== + * ========== DiskClient ========== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for DiskClient: * - * Sample for DiskClient: *

  * 
  * try (DiskClient diskClient = DiskClient.create()) {
@@ -138,30 +131,28 @@
  * 
  * 
* - * ============== - * FirewallClient - * ============== + * ============== FirewallClient ============== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for FirewallClient: * - * Sample for FirewallClient: *

  * 
  * try (FirewallClient firewallClient = FirewallClient.create()) {
- *   ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]");
+ *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
  *   String requestId = "";
  *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
  * }
  * 
  * 
* - * ==================== - * ForwardingRuleClient - * ==================== + * ==================== ForwardingRuleClient ==================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for ForwardingRuleClient: * - * Sample for ForwardingRuleClient: *

  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
@@ -172,131 +163,123 @@
  * 
  * 
* - * =================== - * GlobalAddressClient - * =================== + * =================== GlobalAddressClient =================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for GlobalAddressClient: * - * Sample for GlobalAddressClient: *

  * 
  * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
- *   ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]");
+ *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
  *   String requestId = "";
  *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
  * }
  * 
  * 
* - * ========================== - * GlobalForwardingRuleClient - * ========================== + * ========================== GlobalForwardingRuleClient ========================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for GlobalForwardingRuleClient: * - * Sample for GlobalForwardingRuleClient: *

  * 
  * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
  *   String requestId = "";
- *   ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
+ *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
  *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
  * }
  * 
  * 
* - * ===================== - * GlobalOperationClient - * ===================== + * ===================== GlobalOperationClient ===================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for GlobalOperationClient: * - * Sample for GlobalOperationClient: *

  * 
  * try (GlobalOperationClient globalOperationClient = GlobalOperationClient.create()) {
- *   ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]");
+ *   ProjectGlobalOperationName operation = ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]");
  *   globalOperationClient.deleteGlobalOperation(operation);
  * }
  * 
  * 
* - * ================= - * HealthCheckClient - * ================= + * ================= HealthCheckClient ================= + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for HealthCheckClient: * - * Sample for HealthCheckClient: *

  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
  *   String requestId = "";
- *   ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
+ *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
  *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
  * }
  * 
  * 
* - * ===================== - * HttpHealthCheckClient - * ===================== + * ===================== HttpHealthCheckClient ===================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for HttpHealthCheckClient: * - * Sample for HttpHealthCheckClient: *

  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
  *   String requestId = "";
- *   ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
+ *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
  *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
  * }
  * 
  * 
* - * ====================== - * HttpsHealthCheckClient - * ====================== + * ====================== HttpsHealthCheckClient ====================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for HttpsHealthCheckClient: * - * Sample for HttpsHealthCheckClient: *

  * 
  * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
- *   ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
+ *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
  *   String requestId = "";
  *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
  * }
  * 
  * 
* - * =========== - * ImageClient - * =========== + * =========== ImageClient =========== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for ImageClient: * - * Sample for ImageClient: *

  * 
  * try (ImageClient imageClient = ImageClient.create()) {
- *   ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]");
+ *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
  *   String requestId = "";
  *   Operation response = imageClient.deleteImage(image, requestId);
  * }
  * 
  * 
* - * ========================== - * InstanceGroupManagerClient - * ========================== + * ========================== InstanceGroupManagerClient ========================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for InstanceGroupManagerClient: * - * Sample for InstanceGroupManagerClient: *

  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
@@ -308,13 +291,12 @@
  * 
  * 
* - * =================== - * InstanceGroupClient - * =================== + * =================== InstanceGroupClient =================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for InstanceGroupClient: * - * Sample for InstanceGroupClient: *

  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
@@ -326,30 +308,28 @@
  * 
  * 
* - * ====================== - * InstanceTemplateClient - * ====================== + * ====================== InstanceTemplateClient ====================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for InstanceTemplateClient: * - * Sample for InstanceTemplateClient: *

  * 
  * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
- *   ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
+ *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
  *   String requestId = "";
  *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
  * }
  * 
  * 
* - * ============== - * InstanceClient - * ============== + * ============== InstanceClient ============== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for InstanceClient: * - * Sample for InstanceClient: *

  * 
  * try (InstanceClient instanceClient = InstanceClient.create()) {
@@ -362,13 +342,12 @@
  * 
  * 
* - * ============================ - * InterconnectAttachmentClient - * ============================ + * ============================ InterconnectAttachmentClient ============================ + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for InterconnectAttachmentClient: * - * Sample for InterconnectAttachmentClient: *

  * 
  * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
@@ -379,62 +358,74 @@
  * 
  * 
* - * ========================== - * InterconnectLocationClient - * ========================== + * ========================== InterconnectLocationClient ========================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for InterconnectLocationClient: * - * Sample for InterconnectLocationClient: *

  * 
  * try (InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient.create()) {
- *   ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
+ *   ProjectGlobalInterconnectLocationName interconnectLocation = ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]");
  *   InterconnectLocation response = interconnectLocationClient.getInterconnectLocation(interconnectLocation);
  * }
  * 
  * 
* - * ================== - * InterconnectClient - * ================== + * ================== InterconnectClient ================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for InterconnectClient: * - * Sample for InterconnectClient: *

  * 
  * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
  *   String requestId = "";
- *   ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+ *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
  *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
  * }
  * 
  * 
* - * ============= - * LicenseClient - * ============= + * ================= LicenseCodeClient ================= + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for LicenseCodeClient: + * + *

+ * 
+ * try (LicenseCodeClient licenseCodeClient = LicenseCodeClient.create()) {
+ *   ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]");
+ *   LicenseCode response = licenseCodeClient.getLicenseCode(licenseCode);
+ * }
+ * 
+ * 
+ * + * ============= LicenseClient ============= + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for LicenseClient: * - * Sample for LicenseClient: *

  * 
  * try (LicenseClient licenseClient = LicenseClient.create()) {
- *   ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]");
- *   License response = licenseClient.getLicense(license);
+ *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
+ *   String requestId = "";
+ *   Operation response = licenseClient.deleteLicense(license, requestId);
  * }
  * 
  * 
* - * ================= - * MachineTypeClient - * ================= + * ================= MachineTypeClient ================= + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for MachineTypeClient: * - * Sample for MachineTypeClient: *

  * 
  * try (MachineTypeClient machineTypeClient = MachineTypeClient.create()) {
@@ -444,31 +435,29 @@
  * 
  * 
* - * ============= - * NetworkClient - * ============= + * ============= NetworkClient ============= * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for NetworkClient: * - * Sample for NetworkClient: *

  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
  *   String requestId = "";
- *   ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]");
+ *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
  *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
  *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
  * }
  * 
  * 
* - * ============= - * ProjectClient - * ============= + * ============= ProjectClient ============= + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for ProjectClient: * - * Sample for ProjectClient: *

  * 
  * try (ProjectClient projectClient = ProjectClient.create()) {
@@ -479,13 +468,12 @@
  * 
  * 
* - * ====================== - * RegionAutoscalerClient - * ====================== + * ====================== RegionAutoscalerClient ====================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RegionAutoscalerClient: * - * Sample for RegionAutoscalerClient: *

  * 
  * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
@@ -496,13 +484,12 @@
  * 
  * 
* - * ========================== - * RegionBackendServiceClient - * ========================== + * ========================== RegionBackendServiceClient ========================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for RegionBackendServiceClient: * - * Sample for RegionBackendServiceClient: *

  * 
  * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
@@ -513,13 +500,12 @@
  * 
  * 
* - * ====================== - * RegionCommitmentClient - * ====================== + * ====================== RegionCommitmentClient ====================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for RegionCommitmentClient: * - * Sample for RegionCommitmentClient: *

  * 
  * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
@@ -529,13 +515,13 @@
  * 
  * 
* + * ================================ RegionInstanceGroupManagerClient * ================================ - * RegionInstanceGroupManagerClient - * ================================ * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RegionInstanceGroupManagerClient: * - * Sample for RegionInstanceGroupManagerClient: *

  * 
  * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
@@ -547,13 +533,12 @@
  * 
  * 
* - * ========================= - * RegionInstanceGroupClient - * ========================= + * ========================= RegionInstanceGroupClient ========================= * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RegionInstanceGroupClient: * - * Sample for RegionInstanceGroupClient: *

  * 
  * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
@@ -563,13 +548,12 @@
  * 
  * 
* - * ===================== - * RegionOperationClient - * ===================== + * ===================== RegionOperationClient ===================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for RegionOperationClient: * - * Sample for RegionOperationClient: *

  * 
  * try (RegionOperationClient regionOperationClient = RegionOperationClient.create()) {
@@ -579,13 +563,12 @@
  * 
  * 
* - * ============ - * RegionClient - * ============ + * ============ RegionClient ============ * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RegionClient: * - * Sample for RegionClient: *

  * 
  * try (RegionClient regionClient = RegionClient.create()) {
@@ -595,13 +578,12 @@
  * 
  * 
* - * ============ - * RouterClient - * ============ + * ============ RouterClient ============ + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for RouterClient: * - * Sample for RouterClient: *

  * 
  * try (RouterClient routerClient = RouterClient.create()) {
@@ -612,64 +594,76 @@
  * 
  * 
* - * =========== - * RouteClient - * =========== + * =========== RouteClient =========== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RouteClient: * - * Sample for RouteClient: *

  * 
  * try (RouteClient routeClient = RouteClient.create()) {
- *   ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]");
+ *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
  *   String requestId = "";
  *   Operation response = routeClient.deleteRoute(route, requestId);
  * }
  * 
  * 
* - * ============== - * SnapshotClient - * ============== + * ============== SnapshotClient ============== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for SnapshotClient: * - * Sample for SnapshotClient: *

  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
  *   String requestId = "";
- *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
  *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
  * }
  * 
  * 
* - * ==================== - * SslCertificateClient - * ==================== + * ==================== SslCertificateClient ==================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for SslCertificateClient: * - * Sample for SslCertificateClient: *

  * 
  * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
- *   ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
+ *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
  *   String requestId = "";
  *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
  * }
  * 
  * 
* - * ================ - * SubnetworkClient - * ================ + * =============== SslPolicyClient =============== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for SslPolicyClient: + * + *

+ * 
+ * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
+ *   String requestId = "";
+ *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
+ *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy);
+ * }
+ * 
+ * 
+ * + * ================ SubnetworkClient ================ + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for SubnetworkClient: * - * Sample for SubnetworkClient: *

  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
@@ -680,47 +674,44 @@
  * 
  * 
* - * ===================== - * TargetHttpProxyClient - * ===================== + * ===================== TargetHttpProxyClient ===================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for TargetHttpProxyClient: * - * Sample for TargetHttpProxyClient: *

  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
  *   String requestId = "";
- *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
+ *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
  *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
  * }
  * 
  * 
* - * ====================== - * TargetHttpsProxyClient - * ====================== + * ====================== TargetHttpsProxyClient ====================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for TargetHttpsProxyClient: * - * Sample for TargetHttpsProxyClient: *

  * 
  * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
- *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+ *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
  *   String requestId = "";
  *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
  * }
  * 
  * 
* - * ==================== - * TargetInstanceClient - * ==================== + * ==================== TargetInstanceClient ==================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for TargetInstanceClient: * - * Sample for TargetInstanceClient: *

  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
@@ -731,13 +722,12 @@
  * 
  * 
* - * ================ - * TargetPoolClient - * ================ + * ================ TargetPoolClient ================ + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for TargetPoolClient: * - * Sample for TargetPoolClient: *

  * 
  * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
@@ -749,47 +739,44 @@
  * 
  * 
* - * ==================== - * TargetSslProxyClient - * ==================== + * ==================== TargetSslProxyClient ==================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for TargetSslProxyClient: * - * Sample for TargetSslProxyClient: *

  * 
  * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
- *   ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
+ *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
  *   String requestId = "";
  *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
  * }
  * 
  * 
* - * ==================== - * TargetTcpProxyClient - * ==================== + * ==================== TargetTcpProxyClient ==================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for TargetTcpProxyClient: * - * Sample for TargetTcpProxyClient: *

  * 
  * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
  *   String requestId = "";
- *   ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
+ *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
  *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
  * }
  * 
  * 
* - * ====================== - * TargetVpnGatewayClient - * ====================== + * ====================== TargetVpnGatewayClient ====================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for TargetVpnGatewayClient: * - * Sample for TargetVpnGatewayClient: *

  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
@@ -800,30 +787,28 @@
  * 
  * 
* - * ============ - * UrlMapClient - * ============ + * ============ UrlMapClient ============ * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for UrlMapClient: * - * Sample for UrlMapClient: *

  * 
  * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
- *   ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]");
+ *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
  *   String requestId = "";
  *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
  * }
  * 
  * 
* - * =============== - * VpnTunnelClient - * =============== + * =============== VpnTunnelClient =============== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for VpnTunnelClient: * - * Sample for VpnTunnelClient: *

  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
@@ -834,13 +819,12 @@
  * 
  * 
* - * =================== - * ZoneOperationClient - * =================== + * =================== ZoneOperationClient =================== * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for ZoneOperationClient: * - * Sample for ZoneOperationClient: *

  * 
  * try (ZoneOperationClient zoneOperationClient = ZoneOperationClient.create()) {
@@ -850,13 +834,12 @@
  * 
  * 
* - * ========== - * ZoneClient - * ========== + * ========== ZoneClient ========== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. * - * Service Description: Creates and runs virtual machines on Google Cloud Platform. + *

Sample for ZoneClient: * - * Sample for ZoneClient: *

  * 
  * try (ZoneClient zoneClient = ZoneClient.create()) {
@@ -865,7 +848,5 @@
  * }
  * 
  * 
- * */ - -package com.google.cloud.compute.v1; \ No newline at end of file +package com.google.cloud.compute.v1; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java index 69644ab415b9..b23e0db2dea3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java @@ -15,21 +15,18 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AcceleratorType; import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; import com.google.cloud.compute.v1.AcceleratorTypeList; -import com.google.cloud.compute.v1.AcceleratorTypesScopedList; import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneAcceleratorTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -42,30 +39,39 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AcceleratorTypeStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListAcceleratorTypesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListAcceleratorTypesPagedCallable()"); + public UnaryCallable< + AggregatedListAcceleratorTypesHttpRequest, AggregatedListAcceleratorTypesPagedResponse> + aggregatedListAcceleratorTypesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListAcceleratorTypesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListAcceleratorTypesCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListAcceleratorTypesCallable()"); + public UnaryCallable + aggregatedListAcceleratorTypesCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListAcceleratorTypesCallable()"); } @BetaApi - public UnaryCallable getAcceleratorTypeCallable() { + public UnaryCallable + getAcceleratorTypeCallable() { throw new UnsupportedOperationException("Not implemented: getAcceleratorTypeCallable()"); } @BetaApi - public UnaryCallable listAcceleratorTypesPagedCallable() { + public UnaryCallable + listAcceleratorTypesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesPagedCallable()"); } @BetaApi - public UnaryCallable listAcceleratorTypesCallable() { + public UnaryCallable + listAcceleratorTypesCallable() { throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java index 9c88b86bc9cc..6ac6b077663e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,11 +40,8 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AcceleratorType; import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; import com.google.cloud.compute.v1.AcceleratorTypeList; import com.google.cloud.compute.v1.AcceleratorTypesScopedList; import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; @@ -55,10 +51,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -69,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getAcceleratorType to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getAcceleratorType to 30 seconds: * *

  * 
@@ -92,44 +86,48 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class AcceleratorTypeStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListAcceleratorTypesSettings;
-  private final UnaryCallSettings getAcceleratorTypeSettings;
-  private final PagedCallSettings listAcceleratorTypesSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListAcceleratorTypes.
-   */
-  public PagedCallSettings aggregatedListAcceleratorTypesSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+          AggregatedListAcceleratorTypesPagedResponse>
+      aggregatedListAcceleratorTypesSettings;
+  private final UnaryCallSettings
+      getAcceleratorTypeSettings;
+  private final PagedCallSettings<
+          ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse>
+      listAcceleratorTypesSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListAcceleratorTypes. */
+  public PagedCallSettings<
+          AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+          AggregatedListAcceleratorTypesPagedResponse>
+      aggregatedListAcceleratorTypesSettings() {
     return aggregatedListAcceleratorTypesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getAcceleratorType.
-   */
-  public UnaryCallSettings getAcceleratorTypeSettings() {
+  /** Returns the object with the settings used for calls to getAcceleratorType. */
+  public UnaryCallSettings
+      getAcceleratorTypeSettings() {
     return getAcceleratorTypeSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listAcceleratorTypes.
-   */
-  public PagedCallSettings listAcceleratorTypesSettings() {
+  /** Returns the object with the settings used for calls to listAcceleratorTypes. */
+  public PagedCallSettings<
+          ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse>
+      listAcceleratorTypesSettings() {
     return listAcceleratorTypesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public AcceleratorTypeStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -142,47 +140,34 @@ public AcceleratorTypeStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -193,27 +178,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AcceleratorTypeStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(AcceleratorTypeStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -221,128 +203,174 @@ public Builder toBuilder() {
   protected AcceleratorTypeStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListAcceleratorTypesSettings = settingsBuilder.aggregatedListAcceleratorTypesSettings().build();
+    aggregatedListAcceleratorTypesSettings =
+        settingsBuilder.aggregatedListAcceleratorTypesSettings().build();
     getAcceleratorTypeSettings = settingsBuilder.getAcceleratorTypeSettings().build();
     listAcceleratorTypesSettings = settingsBuilder.listAcceleratorTypesSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListAcceleratorTypesHttpRequest injectToken(AggregatedListAcceleratorTypesHttpRequest payload, String token) {
-          return AggregatedListAcceleratorTypesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListAcceleratorTypesHttpRequest injectPageSize(AggregatedListAcceleratorTypesHttpRequest payload, int pageSize) {
-          return AggregatedListAcceleratorTypesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListAcceleratorTypesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AcceleratorTypeAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(AcceleratorTypeAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_ACCELERATOR_TYPES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListAcceleratorTypesHttpRequest injectToken(ListAcceleratorTypesHttpRequest payload, String token) {
-          return ListAcceleratorTypesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListAcceleratorTypesHttpRequest injectPageSize(ListAcceleratorTypesHttpRequest payload, int pageSize) {
-          return ListAcceleratorTypesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListAcceleratorTypesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AcceleratorTypeList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(AcceleratorTypeList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListAcceleratorTypesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context);
-          return AggregatedListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_ACCELERATOR_TYPES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListAcceleratorTypesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context);
-          return ListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for AcceleratorTypeStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+          AcceleratorTypesScopedList>
+      AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+              AcceleratorTypesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListAcceleratorTypesHttpRequest injectToken(
+                AggregatedListAcceleratorTypesHttpRequest payload, String token) {
+              return AggregatedListAcceleratorTypesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListAcceleratorTypesHttpRequest injectPageSize(
+                AggregatedListAcceleratorTypesHttpRequest payload, int pageSize) {
+              return AggregatedListAcceleratorTypesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListAcceleratorTypesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(AcceleratorTypeAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                AcceleratorTypeAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListAcceleratorTypesHttpRequest, AcceleratorTypeList, AcceleratorType>
+      LIST_ACCELERATOR_TYPES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListAcceleratorTypesHttpRequest, AcceleratorTypeList, AcceleratorType>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListAcceleratorTypesHttpRequest injectToken(
+                ListAcceleratorTypesHttpRequest payload, String token) {
+              return ListAcceleratorTypesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListAcceleratorTypesHttpRequest injectPageSize(
+                ListAcceleratorTypesHttpRequest payload, int pageSize) {
+              return ListAcceleratorTypesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListAcceleratorTypesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(AcceleratorTypeList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(AcceleratorTypeList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+          AggregatedListAcceleratorTypesPagedResponse>
+      AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+              AggregatedListAcceleratorTypesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList>
+                    callable,
+                AggregatedListAcceleratorTypesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+                      AcceleratorTypesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListAcceleratorTypesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse>
+      LIST_ACCELERATOR_TYPES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListAcceleratorTypesHttpRequest, AcceleratorTypeList,
+              ListAcceleratorTypesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListAcceleratorTypesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context);
+              return ListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for AcceleratorTypeStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListAcceleratorTypesSettings;
-    private final UnaryCallSettings.Builder getAcceleratorTypeSettings;
-    private final PagedCallSettings.Builder listAcceleratorTypesSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList,
+            AggregatedListAcceleratorTypesPagedResponse>
+        aggregatedListAcceleratorTypesSettings;
+    private final UnaryCallSettings.Builder
+        getAcceleratorTypeSettings;
+    private final PagedCallSettings.Builder<
+            ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse>
+        listAcceleratorTypesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -351,15 +379,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -371,19 +400,19 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListAcceleratorTypesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_FACT);
+      aggregatedListAcceleratorTypesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_ACCELERATOR_TYPES_PAGE_STR_FACT);
 
       getAcceleratorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listAcceleratorTypesSettings = PagedCallSettings.newBuilder(
-          LIST_ACCELERATOR_TYPES_PAGE_STR_FACT);
+      listAcceleratorTypesSettings =
+          PagedCallSettings.newBuilder(LIST_ACCELERATOR_TYPES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListAcceleratorTypesSettings,
-          getAcceleratorTypeSettings,
-          listAcceleratorTypesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListAcceleratorTypesSettings,
+              getAcceleratorTypeSettings,
+              listAcceleratorTypesSettings);
 
       initDefaults(this);
     }
@@ -399,15 +428,18 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListAcceleratorTypesSettings()
+      builder
+          .aggregatedListAcceleratorTypesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getAcceleratorTypeSettings()
+      builder
+          .getAcceleratorTypeSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listAcceleratorTypesSettings()
+      builder
+          .listAcceleratorTypesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -417,23 +449,26 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(AcceleratorTypeStubSettings settings) {
       super(settings);
 
-      aggregatedListAcceleratorTypesSettings = settings.aggregatedListAcceleratorTypesSettings.toBuilder();
+      aggregatedListAcceleratorTypesSettings =
+          settings.aggregatedListAcceleratorTypesSettings.toBuilder();
       getAcceleratorTypeSettings = settings.getAcceleratorTypeSettings.toBuilder();
       listAcceleratorTypesSettings = settings.listAcceleratorTypesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListAcceleratorTypesSettings,
-          getAcceleratorTypeSettings,
-          listAcceleratorTypesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListAcceleratorTypesSettings,
+              getAcceleratorTypeSettings,
+              listAcceleratorTypesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -442,24 +477,24 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListAcceleratorTypesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListAcceleratorTypes. */ + public PagedCallSettings.Builder< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList, + AggregatedListAcceleratorTypesPagedResponse> + aggregatedListAcceleratorTypesSettings() { return aggregatedListAcceleratorTypesSettings; } - /** - * Returns the builder for the settings used for calls to getAcceleratorType. - */ - public UnaryCallSettings.Builder getAcceleratorTypeSettings() { + /** Returns the builder for the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings.Builder + getAcceleratorTypeSettings() { return getAcceleratorTypeSettings; } - /** - * Returns the builder for the settings used for calls to listAcceleratorTypes. - */ - public PagedCallSettings.Builder listAcceleratorTypesSettings() { + /** Returns the builder for the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings.Builder< + ListAcceleratorTypesHttpRequest, AcceleratorTypeList, ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { return listAcceleratorTypesSettings; } @@ -468,4 +503,4 @@ public AcceleratorTypeStubSettings build() throws IOException { return new AcceleratorTypeStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java index bdeae3e9c852..2d2e04f11154 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java @@ -15,24 +15,21 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.Address; import com.google.cloud.compute.v1.AddressAggregatedList; -import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; -import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; import com.google.cloud.compute.v1.AddressList; -import com.google.cloud.compute.v1.AddressesScopedList; import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; import com.google.cloud.compute.v1.DeleteAddressHttpRequest; import com.google.cloud.compute.v1.GetAddressHttpRequest; import com.google.cloud.compute.v1.InsertAddressHttpRequest; import com.google.cloud.compute.v1.ListAddressesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionAddressName; -import com.google.cloud.compute.v1.ProjectRegionName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -45,14 +42,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AddressStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListAddressesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListAddressesPagedCallable()"); + public UnaryCallable + aggregatedListAddressesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListAddressesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListAddressesCallable() { + public UnaryCallable + aggregatedListAddressesCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListAddressesCallable()"); } @@ -72,7 +71,8 @@ public UnaryCallable insertAddressCallable( } @BetaApi - public UnaryCallable listAddressesPagedCallable() { + public UnaryCallable + listAddressesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listAddressesPagedCallable()"); } @@ -81,4 +81,6 @@ public UnaryCallable listAddressesCallabl throw new UnsupportedOperationException("Not implemented: listAddressesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java index 329451652249..7ce964a5a581 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,11 +40,8 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.Address; import com.google.cloud.compute.v1.AddressAggregatedList; -import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; -import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; import com.google.cloud.compute.v1.AddressList; import com.google.cloud.compute.v1.AddressesScopedList; import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; @@ -58,10 +54,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteAddress to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteAddress to 30 seconds: * *

  * 
@@ -95,60 +89,56 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class AddressStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListAddressesSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListAddressesHttpRequest, AddressAggregatedList,
+          AggregatedListAddressesPagedResponse>
+      aggregatedListAddressesSettings;
   private final UnaryCallSettings deleteAddressSettings;
   private final UnaryCallSettings getAddressSettings;
   private final UnaryCallSettings insertAddressSettings;
-  private final PagedCallSettings listAddressesSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListAddresses.
-   */
-  public PagedCallSettings aggregatedListAddressesSettings() {
+  private final PagedCallSettings
+      listAddressesSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListAddresses. */
+  public PagedCallSettings<
+          AggregatedListAddressesHttpRequest, AddressAggregatedList,
+          AggregatedListAddressesPagedResponse>
+      aggregatedListAddressesSettings() {
     return aggregatedListAddressesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteAddress.
-   */
+  /** Returns the object with the settings used for calls to deleteAddress. */
   public UnaryCallSettings deleteAddressSettings() {
     return deleteAddressSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getAddress.
-   */
+  /** Returns the object with the settings used for calls to getAddress. */
   public UnaryCallSettings getAddressSettings() {
     return getAddressSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertAddress.
-   */
+  /** Returns the object with the settings used for calls to insertAddress. */
   public UnaryCallSettings insertAddressSettings() {
     return insertAddressSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listAddresses.
-   */
-  public PagedCallSettings listAddressesSettings() {
+  /** Returns the object with the settings used for calls to listAddresses. */
+  public PagedCallSettings
+      listAddressesSettings() {
     return listAddressesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public AddressStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -161,47 +151,34 @@ public AddressStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -213,26 +190,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AddressStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -247,125 +220,153 @@ protected AddressStubSettings(Builder settingsBuilder) throws IOException {
     listAddressesSettings = settingsBuilder.listAddressesSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_ADDRESSES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListAddressesHttpRequest injectToken(AggregatedListAddressesHttpRequest payload, String token) {
-          return AggregatedListAddressesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListAddressesHttpRequest injectPageSize(AggregatedListAddressesHttpRequest payload, int pageSize) {
-          return AggregatedListAddressesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListAddressesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AddressAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(AddressAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_ADDRESSES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListAddressesHttpRequest injectToken(ListAddressesHttpRequest payload, String token) {
-          return ListAddressesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListAddressesHttpRequest injectPageSize(ListAddressesHttpRequest payload, int pageSize) {
-          return ListAddressesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListAddressesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AddressList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable
extractResources(AddressList payload) { - return payload.getItemsList(); - } - }; - - private static final PagedListResponseFactory AGGREGATED_LIST_ADDRESSES_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - AggregatedListAddressesHttpRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, AGGREGATED_LIST_ADDRESSES_PAGE_STR_DESC, request, context); - return AggregatedListAddressesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory LIST_ADDRESSES_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListAddressesHttpRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ADDRESSES_PAGE_STR_DESC, request, context); - return ListAddressesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - - /** - * Builder for AddressStubSettings. - */ + private static final PagedListDescriptor< + AggregatedListAddressesHttpRequest, AddressAggregatedList, AddressesScopedList> + AGGREGATED_LIST_ADDRESSES_PAGE_STR_DESC = + new PagedListDescriptor< + AggregatedListAddressesHttpRequest, AddressAggregatedList, AddressesScopedList>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public AggregatedListAddressesHttpRequest injectToken( + AggregatedListAddressesHttpRequest payload, String token) { + return AggregatedListAddressesHttpRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public AggregatedListAddressesHttpRequest injectPageSize( + AggregatedListAddressesHttpRequest payload, int pageSize) { + return AggregatedListAddressesHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(AggregatedListAddressesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(AddressAggregatedList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(AddressAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor + LIST_ADDRESSES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAddressesHttpRequest injectToken( + ListAddressesHttpRequest payload, String token) { + return ListAddressesHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAddressesHttpRequest injectPageSize( + ListAddressesHttpRequest payload, int pageSize) { + return ListAddressesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAddressesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(AddressList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable
extractResources(AddressList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + AggregatedListAddressesHttpRequest, AddressAggregatedList, + AggregatedListAddressesPagedResponse> + AGGREGATED_LIST_ADDRESSES_PAGE_STR_FACT = + new PagedListResponseFactory< + AggregatedListAddressesHttpRequest, AddressAggregatedList, + AggregatedListAddressesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListAddressesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + AggregatedListAddressesHttpRequest, AddressAggregatedList, + AddressesScopedList> + pageContext = + PageContext.create( + callable, AGGREGATED_LIST_ADDRESSES_PAGE_STR_DESC, request, context); + return AggregatedListAddressesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAddressesHttpRequest, AddressList, ListAddressesPagedResponse> + LIST_ADDRESSES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAddressesHttpRequest, AddressList, ListAddressesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAddressesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ADDRESSES_PAGE_STR_DESC, request, context); + return ListAddressesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AddressStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder aggregatedListAddressesSettings; - private final UnaryCallSettings.Builder deleteAddressSettings; + private final PagedCallSettings.Builder< + AggregatedListAddressesHttpRequest, AddressAggregatedList, + AggregatedListAddressesPagedResponse> + aggregatedListAddressesSettings; + private final UnaryCallSettings.Builder + deleteAddressSettings; private final UnaryCallSettings.Builder getAddressSettings; - private final UnaryCallSettings.Builder insertAddressSettings; - private final PagedCallSettings.Builder listAddressesSettings; + private final UnaryCallSettings.Builder + insertAddressSettings; + private final PagedCallSettings.Builder< + ListAddressesHttpRequest, AddressList, ListAddressesPagedResponse> + listAddressesSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); definitions.put( "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -374,15 +375,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); definitions.put("default", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -394,8 +396,8 @@ protected Builder() { protected Builder(ClientContext clientContext) { super(clientContext); - aggregatedListAddressesSettings = PagedCallSettings.newBuilder( - AGGREGATED_LIST_ADDRESSES_PAGE_STR_FACT); + aggregatedListAddressesSettings = + PagedCallSettings.newBuilder(AGGREGATED_LIST_ADDRESSES_PAGE_STR_FACT); deleteAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -403,16 +405,15 @@ protected Builder(ClientContext clientContext) { insertAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listAddressesSettings = PagedCallSettings.newBuilder( - LIST_ADDRESSES_PAGE_STR_FACT); + listAddressesSettings = PagedCallSettings.newBuilder(LIST_ADDRESSES_PAGE_STR_FACT); - unaryMethodSettingsBuilders = ImmutableList.>of( - aggregatedListAddressesSettings, - deleteAddressSettings, - getAddressSettings, - insertAddressSettings, - listAddressesSettings - ); + unaryMethodSettingsBuilders = + ImmutableList.>of( + aggregatedListAddressesSettings, + deleteAddressSettings, + getAddressSettings, + insertAddressSettings, + listAddressesSettings); initDefaults(this); } @@ -428,23 +429,28 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { - builder.aggregatedListAddressesSettings() + builder + .aggregatedListAddressesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.deleteAddressSettings() + builder + .deleteAddressSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.getAddressSettings() + builder + .getAddressSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.insertAddressSettings() + builder + .insertAddressSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.listAddressesSettings() + builder + .listAddressesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); @@ -460,21 +466,23 @@ protected Builder(AddressStubSettings settings) { insertAddressSettings = settings.insertAddressSettings.toBuilder(); listAddressesSettings = settings.listAddressesSettings.toBuilder(); - unaryMethodSettingsBuilders = ImmutableList.>of( - aggregatedListAddressesSettings, - deleteAddressSettings, - getAddressSettings, - insertAddressSettings, - listAddressesSettings - ); + unaryMethodSettingsBuilders = + ImmutableList.>of( + aggregatedListAddressesSettings, + deleteAddressSettings, + getAddressSettings, + insertAddressSettings, + listAddressesSettings); } + // NEXT_MAJOR_VER: remove 'throws Exception' /** * Applies the given settings updater function to all of the unary API methods in this service. * - * Note: This method does not support applying settings to streaming methods. + *

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -483,38 +491,33 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListAddressesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListAddresses. */ + public PagedCallSettings.Builder< + AggregatedListAddressesHttpRequest, AddressAggregatedList, + AggregatedListAddressesPagedResponse> + aggregatedListAddressesSettings() { return aggregatedListAddressesSettings; } - /** - * Returns the builder for the settings used for calls to deleteAddress. - */ + /** Returns the builder for the settings used for calls to deleteAddress. */ public UnaryCallSettings.Builder deleteAddressSettings() { return deleteAddressSettings; } - /** - * Returns the builder for the settings used for calls to getAddress. - */ + /** Returns the builder for the settings used for calls to getAddress. */ public UnaryCallSettings.Builder getAddressSettings() { return getAddressSettings; } - /** - * Returns the builder for the settings used for calls to insertAddress. - */ + /** Returns the builder for the settings used for calls to insertAddress. */ public UnaryCallSettings.Builder insertAddressSettings() { return insertAddressSettings; } - /** - * Returns the builder for the settings used for calls to listAddresses. - */ - public PagedCallSettings.Builder listAddressesSettings() { + /** Returns the builder for the settings used for calls to listAddresses. */ + public PagedCallSettings.Builder< + ListAddressesHttpRequest, AddressList, ListAddressesPagedResponse> + listAddressesSettings() { return listAddressesSettings; } @@ -523,4 +526,4 @@ public AddressStubSettings build() throws IOException { return new AddressStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java index 1bd9453ddfae..d70758b15989 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java @@ -15,25 +15,22 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; import com.google.cloud.compute.v1.Autoscaler; import com.google.cloud.compute.v1.AutoscalerAggregatedList; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; import com.google.cloud.compute.v1.AutoscalerList; -import com.google.cloud.compute.v1.AutoscalersScopedList; import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; import com.google.cloud.compute.v1.ListAutoscalersHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneAutoscalerName; -import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; import javax.annotation.Generated; @@ -47,14 +44,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AutoscalerStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListAutoscalersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListAutoscalersPagedCallable()"); + public UnaryCallable + aggregatedListAutoscalersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListAutoscalersPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListAutoscalersCallable() { + public UnaryCallable + aggregatedListAutoscalersCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListAutoscalersCallable()"); } @@ -74,7 +73,8 @@ public UnaryCallable insertAutoscalerCal } @BetaApi - public UnaryCallable listAutoscalersPagedCallable() { + public UnaryCallable + listAutoscalersPagedCallable() { throw new UnsupportedOperationException("Not implemented: listAutoscalersPagedCallable()"); } @@ -93,4 +93,6 @@ public UnaryCallable updateAutoscalerCal throw new UnsupportedOperationException("Not implemented: updateAutoscalerCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java index ef15518d7e1c..a739b14739ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +40,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; import com.google.cloud.compute.v1.Autoscaler; import com.google.cloud.compute.v1.AutoscalerAggregatedList; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; import com.google.cloud.compute.v1.AutoscalerList; import com.google.cloud.compute.v1.AutoscalersScopedList; import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; @@ -60,10 +56,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -74,15 +68,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteAutoscaler to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteAutoscaler to 30 seconds: * *

  * 
@@ -97,76 +91,69 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class AutoscalerStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListAutoscalersSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+          AggregatedListAutoscalersPagedResponse>
+      aggregatedListAutoscalersSettings;
   private final UnaryCallSettings deleteAutoscalerSettings;
   private final UnaryCallSettings getAutoscalerSettings;
   private final UnaryCallSettings insertAutoscalerSettings;
-  private final PagedCallSettings listAutoscalersSettings;
+  private final PagedCallSettings<
+          ListAutoscalersHttpRequest, AutoscalerList, ListAutoscalersPagedResponse>
+      listAutoscalersSettings;
   private final UnaryCallSettings patchAutoscalerSettings;
   private final UnaryCallSettings updateAutoscalerSettings;
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListAutoscalers.
-   */
-  public PagedCallSettings aggregatedListAutoscalersSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListAutoscalers. */
+  public PagedCallSettings<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+          AggregatedListAutoscalersPagedResponse>
+      aggregatedListAutoscalersSettings() {
     return aggregatedListAutoscalersSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to deleteAutoscaler. */
   public UnaryCallSettings deleteAutoscalerSettings() {
     return deleteAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to getAutoscaler. */
   public UnaryCallSettings getAutoscalerSettings() {
     return getAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to insertAutoscaler. */
   public UnaryCallSettings insertAutoscalerSettings() {
     return insertAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listAutoscalers.
-   */
-  public PagedCallSettings listAutoscalersSettings() {
+  /** Returns the object with the settings used for calls to listAutoscalers. */
+  public PagedCallSettings
+      listAutoscalersSettings() {
     return listAutoscalersSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to patchAutoscaler. */
   public UnaryCallSettings patchAutoscalerSettings() {
     return patchAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateAutoscaler.
-   */
+  /** Returns the object with the settings used for calls to updateAutoscaler. */
   public UnaryCallSettings updateAutoscalerSettings() {
     return updateAutoscalerSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public AutoscalerStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -179,47 +166,34 @@ public AutoscalerStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -230,27 +204,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AutoscalerStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(AutoscalerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -267,127 +238,162 @@ protected AutoscalerStubSettings(Builder settingsBuilder) throws IOException {
     updateAutoscalerSettings = settingsBuilder.updateAutoscalerSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListAutoscalersHttpRequest injectToken(AggregatedListAutoscalersHttpRequest payload, String token) {
-          return AggregatedListAutoscalersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListAutoscalersHttpRequest injectPageSize(AggregatedListAutoscalersHttpRequest payload, int pageSize) {
-          return AggregatedListAutoscalersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListAutoscalersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AutoscalerAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(AutoscalerAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_AUTOSCALERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListAutoscalersHttpRequest injectToken(ListAutoscalersHttpRequest payload, String token) {
-          return ListAutoscalersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListAutoscalersHttpRequest injectPageSize(ListAutoscalersHttpRequest payload, int pageSize) {
-          return ListAutoscalersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListAutoscalersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AutoscalerList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(AutoscalerList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListAutoscalersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_DESC, request, context);
-          return AggregatedListAutoscalersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_AUTOSCALERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListAutoscalersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_AUTOSCALERS_PAGE_STR_DESC, request, context);
-          return ListAutoscalersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for AutoscalerStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList, AutoscalersScopedList>
+      AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+              AutoscalersScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListAutoscalersHttpRequest injectToken(
+                AggregatedListAutoscalersHttpRequest payload, String token) {
+              return AggregatedListAutoscalersHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListAutoscalersHttpRequest injectPageSize(
+                AggregatedListAutoscalersHttpRequest payload, int pageSize) {
+              return AggregatedListAutoscalersHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListAutoscalersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(AutoscalerAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                AutoscalerAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_AUTOSCALERS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListAutoscalersHttpRequest injectToken(
+                ListAutoscalersHttpRequest payload, String token) {
+              return ListAutoscalersHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListAutoscalersHttpRequest injectPageSize(
+                ListAutoscalersHttpRequest payload, int pageSize) {
+              return ListAutoscalersHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListAutoscalersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(AutoscalerList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(AutoscalerList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+          AggregatedListAutoscalersPagedResponse>
+      AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+              AggregatedListAutoscalersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListAutoscalersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+                      AutoscalersScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_DESC, request, context);
+              return AggregatedListAutoscalersPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListAutoscalersHttpRequest, AutoscalerList, ListAutoscalersPagedResponse>
+      LIST_AUTOSCALERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListAutoscalersHttpRequest, AutoscalerList, ListAutoscalersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListAutoscalersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_AUTOSCALERS_PAGE_STR_DESC, request, context);
+              return ListAutoscalersPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for AutoscalerStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListAutoscalersSettings;
-    private final UnaryCallSettings.Builder deleteAutoscalerSettings;
-    private final UnaryCallSettings.Builder getAutoscalerSettings;
-    private final UnaryCallSettings.Builder insertAutoscalerSettings;
-    private final PagedCallSettings.Builder listAutoscalersSettings;
-    private final UnaryCallSettings.Builder patchAutoscalerSettings;
-    private final UnaryCallSettings.Builder updateAutoscalerSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList,
+            AggregatedListAutoscalersPagedResponse>
+        aggregatedListAutoscalersSettings;
+    private final UnaryCallSettings.Builder
+        deleteAutoscalerSettings;
+    private final UnaryCallSettings.Builder
+        getAutoscalerSettings;
+    private final UnaryCallSettings.Builder
+        insertAutoscalerSettings;
+    private final PagedCallSettings.Builder<
+            ListAutoscalersHttpRequest, AutoscalerList, ListAutoscalersPagedResponse>
+        listAutoscalersSettings;
+    private final UnaryCallSettings.Builder
+        patchAutoscalerSettings;
+    private final UnaryCallSettings.Builder
+        updateAutoscalerSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -396,15 +402,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -416,8 +423,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListAutoscalersSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_FACT);
+      aggregatedListAutoscalersSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_AUTOSCALERS_PAGE_STR_FACT);
 
       deleteAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -425,22 +432,21 @@ protected Builder(ClientContext clientContext) {
 
       insertAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listAutoscalersSettings = PagedCallSettings.newBuilder(
-          LIST_AUTOSCALERS_PAGE_STR_FACT);
+      listAutoscalersSettings = PagedCallSettings.newBuilder(LIST_AUTOSCALERS_PAGE_STR_FACT);
 
       patchAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListAutoscalersSettings,
-          deleteAutoscalerSettings,
-          getAutoscalerSettings,
-          insertAutoscalerSettings,
-          listAutoscalersSettings,
-          patchAutoscalerSettings,
-          updateAutoscalerSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListAutoscalersSettings,
+              deleteAutoscalerSettings,
+              getAutoscalerSettings,
+              insertAutoscalerSettings,
+              listAutoscalersSettings,
+              patchAutoscalerSettings,
+              updateAutoscalerSettings);
 
       initDefaults(this);
     }
@@ -456,31 +462,38 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListAutoscalersSettings()
+      builder
+          .aggregatedListAutoscalersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteAutoscalerSettings()
+      builder
+          .deleteAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getAutoscalerSettings()
+      builder
+          .getAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertAutoscalerSettings()
+      builder
+          .insertAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listAutoscalersSettings()
+      builder
+          .listAutoscalersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchAutoscalerSettings()
+      builder
+          .patchAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateAutoscalerSettings()
+      builder
+          .updateAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -498,23 +511,25 @@ protected Builder(AutoscalerStubSettings settings) {
       patchAutoscalerSettings = settings.patchAutoscalerSettings.toBuilder();
       updateAutoscalerSettings = settings.updateAutoscalerSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListAutoscalersSettings,
-          deleteAutoscalerSettings,
-          getAutoscalerSettings,
-          insertAutoscalerSettings,
-          listAutoscalersSettings,
-          patchAutoscalerSettings,
-          updateAutoscalerSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListAutoscalersSettings,
+              deleteAutoscalerSettings,
+              getAutoscalerSettings,
+              insertAutoscalerSettings,
+              listAutoscalersSettings,
+              patchAutoscalerSettings,
+              updateAutoscalerSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -523,52 +538,47 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListAutoscalersSettings() { + /** Returns the builder for the settings used for calls to aggregatedListAutoscalers. */ + public PagedCallSettings.Builder< + AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList, + AggregatedListAutoscalersPagedResponse> + aggregatedListAutoscalersSettings() { return aggregatedListAutoscalersSettings; } - /** - * Returns the builder for the settings used for calls to deleteAutoscaler. - */ - public UnaryCallSettings.Builder deleteAutoscalerSettings() { + /** Returns the builder for the settings used for calls to deleteAutoscaler. */ + public UnaryCallSettings.Builder + deleteAutoscalerSettings() { return deleteAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to getAutoscaler. - */ + /** Returns the builder for the settings used for calls to getAutoscaler. */ public UnaryCallSettings.Builder getAutoscalerSettings() { return getAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to insertAutoscaler. - */ - public UnaryCallSettings.Builder insertAutoscalerSettings() { + /** Returns the builder for the settings used for calls to insertAutoscaler. */ + public UnaryCallSettings.Builder + insertAutoscalerSettings() { return insertAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to listAutoscalers. - */ - public PagedCallSettings.Builder listAutoscalersSettings() { + /** Returns the builder for the settings used for calls to listAutoscalers. */ + public PagedCallSettings.Builder< + ListAutoscalersHttpRequest, AutoscalerList, ListAutoscalersPagedResponse> + listAutoscalersSettings() { return listAutoscalersSettings; } - /** - * Returns the builder for the settings used for calls to patchAutoscaler. - */ - public UnaryCallSettings.Builder patchAutoscalerSettings() { + /** Returns the builder for the settings used for calls to patchAutoscaler. */ + public UnaryCallSettings.Builder + patchAutoscalerSettings() { return patchAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to updateAutoscaler. - */ - public UnaryCallSettings.Builder updateAutoscalerSettings() { + /** Returns the builder for the settings used for calls to updateAutoscaler. */ + public UnaryCallSettings.Builder + updateAutoscalerSettings() { return updateAutoscalerSettings; } @@ -577,4 +587,4 @@ public AutoscalerStubSettings build() throws IOException { return new AutoscalerStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java index deac39409204..c2dbaa6c2bf1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.BackendBucket; -import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; import com.google.cloud.compute.v1.BackendBucketList; import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; @@ -27,8 +28,6 @@ import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; -import com.google.cloud.compute.v1.ProjectBackendBucketName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; import javax.annotation.Generated; @@ -42,7 +41,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class BackendBucketStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteBackendBucketCallable() { throw new UnsupportedOperationException("Not implemented: deleteBackendBucketCallable()"); @@ -59,12 +57,14 @@ public UnaryCallable insertBackendBuc } @BetaApi - public UnaryCallable listBackendBucketsPagedCallable() { + public UnaryCallable + listBackendBucketsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listBackendBucketsPagedCallable()"); } @BetaApi - public UnaryCallable listBackendBucketsCallable() { + public UnaryCallable + listBackendBucketsCallable() { throw new UnsupportedOperationException("Not implemented: listBackendBucketsCallable()"); } @@ -78,4 +78,6 @@ public UnaryCallable updateBackendBuc throw new UnsupportedOperationException("Not implemented: updateBackendBucketCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java index c79bc83e6bb2..744d7d65bc2e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,9 +39,7 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.BackendBucket; -import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; import com.google.cloud.compute.v1.BackendBucketList; import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteBackendBucket to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteBackendBucket to 30 seconds: * *

  * 
@@ -93,68 +87,66 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class BackendBucketStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteBackendBucketSettings;
-  private final UnaryCallSettings getBackendBucketSettings;
-  private final UnaryCallSettings insertBackendBucketSettings;
-  private final PagedCallSettings listBackendBucketsSettings;
-  private final UnaryCallSettings patchBackendBucketSettings;
-  private final UnaryCallSettings updateBackendBucketSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteBackendBucket.
-   */
-  public UnaryCallSettings deleteBackendBucketSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteBackendBucketSettings;
+  private final UnaryCallSettings
+      getBackendBucketSettings;
+  private final UnaryCallSettings
+      insertBackendBucketSettings;
+  private final PagedCallSettings<
+          ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse>
+      listBackendBucketsSettings;
+  private final UnaryCallSettings
+      patchBackendBucketSettings;
+  private final UnaryCallSettings
+      updateBackendBucketSettings;
+
+  /** Returns the object with the settings used for calls to deleteBackendBucket. */
+  public UnaryCallSettings
+      deleteBackendBucketSettings() {
     return deleteBackendBucketSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getBackendBucket.
-   */
+  /** Returns the object with the settings used for calls to getBackendBucket. */
   public UnaryCallSettings getBackendBucketSettings() {
     return getBackendBucketSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertBackendBucket.
-   */
-  public UnaryCallSettings insertBackendBucketSettings() {
+  /** Returns the object with the settings used for calls to insertBackendBucket. */
+  public UnaryCallSettings
+      insertBackendBucketSettings() {
     return insertBackendBucketSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listBackendBuckets.
-   */
-  public PagedCallSettings listBackendBucketsSettings() {
+  /** Returns the object with the settings used for calls to listBackendBuckets. */
+  public PagedCallSettings<
+          ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse>
+      listBackendBucketsSettings() {
     return listBackendBucketsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchBackendBucket.
-   */
+  /** Returns the object with the settings used for calls to patchBackendBucket. */
   public UnaryCallSettings patchBackendBucketSettings() {
     return patchBackendBucketSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateBackendBucket.
-   */
-  public UnaryCallSettings updateBackendBucketSettings() {
+  /** Returns the object with the settings used for calls to updateBackendBucket. */
+  public UnaryCallSettings
+      updateBackendBucketSettings() {
     return updateBackendBucketSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public BackendBucketStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +159,34 @@ public BackendBucketStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +197,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BackendBucketStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(BackendBucketStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +230,95 @@ protected BackendBucketStubSettings(Builder settingsBuilder) throws IOException
     updateBackendBucketSettings = settingsBuilder.updateBackendBucketSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_BACKEND_BUCKETS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListBackendBucketsHttpRequest injectToken(ListBackendBucketsHttpRequest payload, String token) {
-          return ListBackendBucketsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListBackendBucketsHttpRequest injectPageSize(ListBackendBucketsHttpRequest payload, int pageSize) {
-          return ListBackendBucketsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListBackendBucketsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(BackendBucketList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(BackendBucketList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_BACKEND_BUCKETS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListBackendBucketsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_BACKEND_BUCKETS_PAGE_STR_DESC, request, context);
-          return ListBackendBucketsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for BackendBucketStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListBackendBucketsHttpRequest, BackendBucketList, BackendBucket>
+      LIST_BACKEND_BUCKETS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListBackendBucketsHttpRequest, BackendBucketList, BackendBucket>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListBackendBucketsHttpRequest injectToken(
+                ListBackendBucketsHttpRequest payload, String token) {
+              return ListBackendBucketsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListBackendBucketsHttpRequest injectPageSize(
+                ListBackendBucketsHttpRequest payload, int pageSize) {
+              return ListBackendBucketsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListBackendBucketsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(BackendBucketList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(BackendBucketList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse>
+      LIST_BACKEND_BUCKETS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListBackendBucketsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_BACKEND_BUCKETS_PAGE_STR_DESC, request, context);
+              return ListBackendBucketsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for BackendBucketStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteBackendBucketSettings;
-    private final UnaryCallSettings.Builder getBackendBucketSettings;
-    private final UnaryCallSettings.Builder insertBackendBucketSettings;
-    private final PagedCallSettings.Builder listBackendBucketsSettings;
-    private final UnaryCallSettings.Builder patchBackendBucketSettings;
-    private final UnaryCallSettings.Builder updateBackendBucketSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteBackendBucketSettings;
+    private final UnaryCallSettings.Builder
+        getBackendBucketSettings;
+    private final UnaryCallSettings.Builder
+        insertBackendBucketSettings;
+    private final PagedCallSettings.Builder<
+            ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse>
+        listBackendBucketsSettings;
+    private final UnaryCallSettings.Builder
+        patchBackendBucketSettings;
+    private final UnaryCallSettings.Builder
+        updateBackendBucketSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +327,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +354,20 @@ protected Builder(ClientContext clientContext) {
 
       insertBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listBackendBucketsSettings = PagedCallSettings.newBuilder(
-          LIST_BACKEND_BUCKETS_PAGE_STR_FACT);
+      listBackendBucketsSettings = PagedCallSettings.newBuilder(LIST_BACKEND_BUCKETS_PAGE_STR_FACT);
 
       patchBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteBackendBucketSettings,
-          getBackendBucketSettings,
-          insertBackendBucketSettings,
-          listBackendBucketsSettings,
-          patchBackendBucketSettings,
-          updateBackendBucketSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteBackendBucketSettings,
+              getBackendBucketSettings,
+              insertBackendBucketSettings,
+              listBackendBucketsSettings,
+              patchBackendBucketSettings,
+              updateBackendBucketSettings);
 
       initDefaults(this);
     }
@@ -390,27 +383,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteBackendBucketSettings()
+      builder
+          .deleteBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getBackendBucketSettings()
+      builder
+          .getBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertBackendBucketSettings()
+      builder
+          .insertBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listBackendBucketsSettings()
+      builder
+          .listBackendBucketsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchBackendBucketSettings()
+      builder
+          .patchBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateBackendBucketSettings()
+      builder
+          .updateBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +426,24 @@ protected Builder(BackendBucketStubSettings settings) {
       patchBackendBucketSettings = settings.patchBackendBucketSettings.toBuilder();
       updateBackendBucketSettings = settings.updateBackendBucketSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteBackendBucketSettings,
-          getBackendBucketSettings,
-          insertBackendBucketSettings,
-          listBackendBucketsSettings,
-          patchBackendBucketSettings,
-          updateBackendBucketSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteBackendBucketSettings,
+              getBackendBucketSettings,
+              insertBackendBucketSettings,
+              listBackendBucketsSettings,
+              patchBackendBucketSettings,
+              updateBackendBucketSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +452,40 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteBackendBucketSettings() { + /** Returns the builder for the settings used for calls to deleteBackendBucket. */ + public UnaryCallSettings.Builder + deleteBackendBucketSettings() { return deleteBackendBucketSettings; } - /** - * Returns the builder for the settings used for calls to getBackendBucket. - */ - public UnaryCallSettings.Builder getBackendBucketSettings() { + /** Returns the builder for the settings used for calls to getBackendBucket. */ + public UnaryCallSettings.Builder + getBackendBucketSettings() { return getBackendBucketSettings; } - /** - * Returns the builder for the settings used for calls to insertBackendBucket. - */ - public UnaryCallSettings.Builder insertBackendBucketSettings() { + /** Returns the builder for the settings used for calls to insertBackendBucket. */ + public UnaryCallSettings.Builder + insertBackendBucketSettings() { return insertBackendBucketSettings; } - /** - * Returns the builder for the settings used for calls to listBackendBuckets. - */ - public PagedCallSettings.Builder listBackendBucketsSettings() { + /** Returns the builder for the settings used for calls to listBackendBuckets. */ + public PagedCallSettings.Builder< + ListBackendBucketsHttpRequest, BackendBucketList, ListBackendBucketsPagedResponse> + listBackendBucketsSettings() { return listBackendBucketsSettings; } - /** - * Returns the builder for the settings used for calls to patchBackendBucket. - */ - public UnaryCallSettings.Builder patchBackendBucketSettings() { + /** Returns the builder for the settings used for calls to patchBackendBucket. */ + public UnaryCallSettings.Builder + patchBackendBucketSettings() { return patchBackendBucketSettings; } - /** - * Returns the builder for the settings used for calls to updateBackendBucket. - */ - public UnaryCallSettings.Builder updateBackendBucketSettings() { + /** Returns the builder for the settings used for calls to updateBackendBucket. */ + public UnaryCallSettings.Builder + updateBackendBucketSettings() { return updateBackendBucketSettings; } @@ -498,4 +494,4 @@ public BackendBucketStubSettings build() throws IOException { return new BackendBucketStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java index 7adf47d79eef..1bce2e1bb7e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java @@ -15,17 +15,17 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; import com.google.cloud.compute.v1.BackendService; import com.google.cloud.compute.v1.BackendServiceAggregatedList; -import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; import com.google.cloud.compute.v1.BackendServiceGroupHealth; import com.google.cloud.compute.v1.BackendServiceList; -import com.google.cloud.compute.v1.BackendServicesScopedList; import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; @@ -33,9 +33,6 @@ import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ProjectBackendServiceName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ResourceGroupReference; import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; import javax.annotation.Generated; @@ -49,15 +46,19 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class BackendServiceStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListBackendServicesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListBackendServicesPagedCallable()"); + public UnaryCallable< + AggregatedListBackendServicesHttpRequest, AggregatedListBackendServicesPagedResponse> + aggregatedListBackendServicesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListBackendServicesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListBackendServicesCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListBackendServicesCallable()"); + public UnaryCallable + aggregatedListBackendServicesCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListBackendServicesCallable()"); } @BetaApi @@ -71,7 +72,8 @@ public UnaryCallable getBackendSer } @BetaApi - public UnaryCallable getHealthBackendServiceCallable() { + public UnaryCallable + getHealthBackendServiceCallable() { throw new UnsupportedOperationException("Not implemented: getHealthBackendServiceCallable()"); } @@ -81,12 +83,14 @@ public UnaryCallable insertBackendSe } @BetaApi - public UnaryCallable listBackendServicesPagedCallable() { + public UnaryCallable + listBackendServicesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listBackendServicesPagedCallable()"); } @BetaApi - public UnaryCallable listBackendServicesCallable() { + public UnaryCallable + listBackendServicesCallable() { throw new UnsupportedOperationException("Not implemented: listBackendServicesCallable()"); } @@ -100,4 +104,6 @@ public UnaryCallable updateBackendSe throw new UnsupportedOperationException("Not implemented: updateBackendServiceCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java index 76b04d455620..ee5c04cfdea1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +40,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; import com.google.cloud.compute.v1.BackendService; import com.google.cloud.compute.v1.BackendServiceAggregatedList; -import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; import com.google.cloud.compute.v1.BackendServiceGroupHealth; import com.google.cloud.compute.v1.BackendServiceList; import com.google.cloud.compute.v1.BackendServicesScopedList; @@ -62,10 +58,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -76,15 +70,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteBackendService to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteBackendService to 30 seconds: * *

  * 
@@ -99,84 +93,88 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class BackendServiceStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListBackendServicesSettings;
-  private final UnaryCallSettings deleteBackendServiceSettings;
-  private final UnaryCallSettings getBackendServiceSettings;
-  private final UnaryCallSettings getHealthBackendServiceSettings;
-  private final UnaryCallSettings insertBackendServiceSettings;
-  private final PagedCallSettings listBackendServicesSettings;
-  private final UnaryCallSettings patchBackendServiceSettings;
-  private final UnaryCallSettings updateBackendServiceSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListBackendServices.
-   */
-  public PagedCallSettings aggregatedListBackendServicesSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+          AggregatedListBackendServicesPagedResponse>
+      aggregatedListBackendServicesSettings;
+  private final UnaryCallSettings
+      deleteBackendServiceSettings;
+  private final UnaryCallSettings
+      getBackendServiceSettings;
+  private final UnaryCallSettings
+      getHealthBackendServiceSettings;
+  private final UnaryCallSettings
+      insertBackendServiceSettings;
+  private final PagedCallSettings<
+          ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse>
+      listBackendServicesSettings;
+  private final UnaryCallSettings
+      patchBackendServiceSettings;
+  private final UnaryCallSettings
+      updateBackendServiceSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListBackendServices. */
+  public PagedCallSettings<
+          AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+          AggregatedListBackendServicesPagedResponse>
+      aggregatedListBackendServicesSettings() {
     return aggregatedListBackendServicesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteBackendService.
-   */
-  public UnaryCallSettings deleteBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to deleteBackendService. */
+  public UnaryCallSettings
+      deleteBackendServiceSettings() {
     return deleteBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getBackendService.
-   */
-  public UnaryCallSettings getBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getBackendService. */
+  public UnaryCallSettings
+      getBackendServiceSettings() {
     return getBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthBackendService.
-   */
-  public UnaryCallSettings getHealthBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getHealthBackendService. */
+  public UnaryCallSettings
+      getHealthBackendServiceSettings() {
     return getHealthBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertBackendService.
-   */
-  public UnaryCallSettings insertBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to insertBackendService. */
+  public UnaryCallSettings
+      insertBackendServiceSettings() {
     return insertBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listBackendServices.
-   */
-  public PagedCallSettings listBackendServicesSettings() {
+  /** Returns the object with the settings used for calls to listBackendServices. */
+  public PagedCallSettings<
+          ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse>
+      listBackendServicesSettings() {
     return listBackendServicesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchBackendService.
-   */
-  public UnaryCallSettings patchBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to patchBackendService. */
+  public UnaryCallSettings
+      patchBackendServiceSettings() {
     return patchBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateBackendService.
-   */
-  public UnaryCallSettings updateBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to updateBackendService. */
+  public UnaryCallSettings
+      updateBackendServiceSettings() {
     return updateBackendServiceSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public BackendServiceStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -189,47 +187,34 @@ public BackendServiceStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -240,27 +225,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BackendServiceStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(BackendServiceStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -268,7 +250,8 @@ public Builder toBuilder() {
   protected BackendServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListBackendServicesSettings = settingsBuilder.aggregatedListBackendServicesSettings().build();
+    aggregatedListBackendServicesSettings =
+        settingsBuilder.aggregatedListBackendServicesSettings().build();
     deleteBackendServiceSettings = settingsBuilder.deleteBackendServiceSettings().build();
     getBackendServiceSettings = settingsBuilder.getBackendServiceSettings().build();
     getHealthBackendServiceSettings = settingsBuilder.getHealthBackendServiceSettings().build();
@@ -278,128 +261,177 @@ protected BackendServiceStubSettings(Builder settingsBuilder) throws IOException
     updateBackendServiceSettings = settingsBuilder.updateBackendServiceSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListBackendServicesHttpRequest injectToken(AggregatedListBackendServicesHttpRequest payload, String token) {
-          return AggregatedListBackendServicesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListBackendServicesHttpRequest injectPageSize(AggregatedListBackendServicesHttpRequest payload, int pageSize) {
-          return AggregatedListBackendServicesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListBackendServicesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(BackendServiceAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(BackendServiceAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_BACKEND_SERVICES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListBackendServicesHttpRequest injectToken(ListBackendServicesHttpRequest payload, String token) {
-          return ListBackendServicesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListBackendServicesHttpRequest injectPageSize(ListBackendServicesHttpRequest payload, int pageSize) {
-          return ListBackendServicesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListBackendServicesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(BackendServiceList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(BackendServiceList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListBackendServicesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_DESC, request, context);
-          return AggregatedListBackendServicesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_BACKEND_SERVICES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListBackendServicesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_BACKEND_SERVICES_PAGE_STR_DESC, request, context);
-          return ListBackendServicesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for BackendServiceStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+          BackendServicesScopedList>
+      AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+              BackendServicesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListBackendServicesHttpRequest injectToken(
+                AggregatedListBackendServicesHttpRequest payload, String token) {
+              return AggregatedListBackendServicesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListBackendServicesHttpRequest injectPageSize(
+                AggregatedListBackendServicesHttpRequest payload, int pageSize) {
+              return AggregatedListBackendServicesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListBackendServicesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(BackendServiceAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                BackendServiceAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListBackendServicesHttpRequest, BackendServiceList, BackendService>
+      LIST_BACKEND_SERVICES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListBackendServicesHttpRequest, BackendServiceList, BackendService>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListBackendServicesHttpRequest injectToken(
+                ListBackendServicesHttpRequest payload, String token) {
+              return ListBackendServicesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListBackendServicesHttpRequest injectPageSize(
+                ListBackendServicesHttpRequest payload, int pageSize) {
+              return ListBackendServicesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListBackendServicesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(BackendServiceList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(BackendServiceList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+          AggregatedListBackendServicesPagedResponse>
+      AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+              AggregatedListBackendServicesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList>
+                    callable,
+                AggregatedListBackendServicesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+                      BackendServicesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListBackendServicesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse>
+      LIST_BACKEND_SERVICES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListBackendServicesHttpRequest, BackendServiceList,
+              ListBackendServicesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListBackendServicesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_BACKEND_SERVICES_PAGE_STR_DESC, request, context);
+              return ListBackendServicesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for BackendServiceStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListBackendServicesSettings;
-    private final UnaryCallSettings.Builder deleteBackendServiceSettings;
-    private final UnaryCallSettings.Builder getBackendServiceSettings;
-    private final UnaryCallSettings.Builder getHealthBackendServiceSettings;
-    private final UnaryCallSettings.Builder insertBackendServiceSettings;
-    private final PagedCallSettings.Builder listBackendServicesSettings;
-    private final UnaryCallSettings.Builder patchBackendServiceSettings;
-    private final UnaryCallSettings.Builder updateBackendServiceSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
+            AggregatedListBackendServicesPagedResponse>
+        aggregatedListBackendServicesSettings;
+    private final UnaryCallSettings.Builder
+        deleteBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        getBackendServiceSettings;
+    private final UnaryCallSettings.Builder<
+            GetHealthBackendServiceHttpRequest, BackendServiceGroupHealth>
+        getHealthBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        insertBackendServiceSettings;
+    private final PagedCallSettings.Builder<
+            ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse>
+        listBackendServicesSettings;
+    private final UnaryCallSettings.Builder
+        patchBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        updateBackendServiceSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -408,15 +440,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -428,8 +461,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListBackendServicesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT);
+      aggregatedListBackendServicesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT);
 
       deleteBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -439,23 +472,23 @@ protected Builder(ClientContext clientContext) {
 
       insertBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listBackendServicesSettings = PagedCallSettings.newBuilder(
-          LIST_BACKEND_SERVICES_PAGE_STR_FACT);
+      listBackendServicesSettings =
+          PagedCallSettings.newBuilder(LIST_BACKEND_SERVICES_PAGE_STR_FACT);
 
       patchBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListBackendServicesSettings,
-          deleteBackendServiceSettings,
-          getBackendServiceSettings,
-          getHealthBackendServiceSettings,
-          insertBackendServiceSettings,
-          listBackendServicesSettings,
-          patchBackendServiceSettings,
-          updateBackendServiceSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListBackendServicesSettings,
+              deleteBackendServiceSettings,
+              getBackendServiceSettings,
+              getHealthBackendServiceSettings,
+              insertBackendServiceSettings,
+              listBackendServicesSettings,
+              patchBackendServiceSettings,
+              updateBackendServiceSettings);
 
       initDefaults(this);
     }
@@ -471,35 +504,43 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListBackendServicesSettings()
+      builder
+          .aggregatedListBackendServicesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteBackendServiceSettings()
+      builder
+          .deleteBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getBackendServiceSettings()
+      builder
+          .getBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getHealthBackendServiceSettings()
+      builder
+          .getHealthBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertBackendServiceSettings()
+      builder
+          .insertBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listBackendServicesSettings()
+      builder
+          .listBackendServicesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchBackendServiceSettings()
+      builder
+          .patchBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateBackendServiceSettings()
+      builder
+          .updateBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -509,7 +550,8 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(BackendServiceStubSettings settings) {
       super(settings);
 
-      aggregatedListBackendServicesSettings = settings.aggregatedListBackendServicesSettings.toBuilder();
+      aggregatedListBackendServicesSettings =
+          settings.aggregatedListBackendServicesSettings.toBuilder();
       deleteBackendServiceSettings = settings.deleteBackendServiceSettings.toBuilder();
       getBackendServiceSettings = settings.getBackendServiceSettings.toBuilder();
       getHealthBackendServiceSettings = settings.getHealthBackendServiceSettings.toBuilder();
@@ -518,24 +560,26 @@ protected Builder(BackendServiceStubSettings settings) {
       patchBackendServiceSettings = settings.patchBackendServiceSettings.toBuilder();
       updateBackendServiceSettings = settings.updateBackendServiceSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListBackendServicesSettings,
-          deleteBackendServiceSettings,
-          getBackendServiceSettings,
-          getHealthBackendServiceSettings,
-          insertBackendServiceSettings,
-          listBackendServicesSettings,
-          patchBackendServiceSettings,
-          updateBackendServiceSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListBackendServicesSettings,
+              deleteBackendServiceSettings,
+              getBackendServiceSettings,
+              getHealthBackendServiceSettings,
+              insertBackendServiceSettings,
+              listBackendServicesSettings,
+              patchBackendServiceSettings,
+              updateBackendServiceSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -544,59 +588,54 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListBackendServicesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListBackendServices. */ + public PagedCallSettings.Builder< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList, + AggregatedListBackendServicesPagedResponse> + aggregatedListBackendServicesSettings() { return aggregatedListBackendServicesSettings; } - /** - * Returns the builder for the settings used for calls to deleteBackendService. - */ - public UnaryCallSettings.Builder deleteBackendServiceSettings() { + /** Returns the builder for the settings used for calls to deleteBackendService. */ + public UnaryCallSettings.Builder + deleteBackendServiceSettings() { return deleteBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to getBackendService. - */ - public UnaryCallSettings.Builder getBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getBackendService. */ + public UnaryCallSettings.Builder + getBackendServiceSettings() { return getBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to getHealthBackendService. - */ - public UnaryCallSettings.Builder getHealthBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getHealthBackendService. */ + public UnaryCallSettings.Builder + getHealthBackendServiceSettings() { return getHealthBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to insertBackendService. - */ - public UnaryCallSettings.Builder insertBackendServiceSettings() { + /** Returns the builder for the settings used for calls to insertBackendService. */ + public UnaryCallSettings.Builder + insertBackendServiceSettings() { return insertBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to listBackendServices. - */ - public PagedCallSettings.Builder listBackendServicesSettings() { + /** Returns the builder for the settings used for calls to listBackendServices. */ + public PagedCallSettings.Builder< + ListBackendServicesHttpRequest, BackendServiceList, ListBackendServicesPagedResponse> + listBackendServicesSettings() { return listBackendServicesSettings; } - /** - * Returns the builder for the settings used for calls to patchBackendService. - */ - public UnaryCallSettings.Builder patchBackendServiceSettings() { + /** Returns the builder for the settings used for calls to patchBackendService. */ + public UnaryCallSettings.Builder + patchBackendServiceSettings() { return patchBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to updateBackendService. - */ - public UnaryCallSettings.Builder updateBackendServiceSettings() { + /** Returns the builder for the settings used for calls to updateBackendService. */ + public UnaryCallSettings.Builder + updateBackendServiceSettings() { return updateBackendServiceSettings; } @@ -605,4 +644,4 @@ public BackendServiceStubSettings build() throws IOException { return new BackendServiceStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java index d5804b2d6c5d..447d36c47379 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,22 +26,13 @@ import com.google.cloud.compute.v1.DeleteDiskHttpRequest; import com.google.cloud.compute.v1.Disk; import com.google.cloud.compute.v1.DiskAggregatedList; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.DiskList; -import com.google.cloud.compute.v1.DisksResizeRequest; -import com.google.cloud.compute.v1.DisksScopedList; import com.google.cloud.compute.v1.GetDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneDiskName; -import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; -import com.google.cloud.compute.v1.Snapshot; -import com.google.cloud.compute.v1.ZoneSetLabelsRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -51,14 +45,15 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class DiskStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListDisksPagedCallable() { + public UnaryCallable + aggregatedListDisksPagedCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListDisksPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListDisksCallable() { + public UnaryCallable + aggregatedListDisksCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListDisksCallable()"); } @@ -102,4 +97,6 @@ public UnaryCallable setLabelsDiskCallable( throw new UnsupportedOperationException("Not implemented: setLabelsDiskCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java index 274924d92803..628ff7ace0c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,14 +40,11 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; import com.google.cloud.compute.v1.CreateSnapshotDiskHttpRequest; import com.google.cloud.compute.v1.DeleteDiskHttpRequest; import com.google.cloud.compute.v1.Disk; import com.google.cloud.compute.v1.DiskAggregatedList; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.DiskList; import com.google.cloud.compute.v1.DisksScopedList; import com.google.cloud.compute.v1.GetDiskHttpRequest; @@ -61,10 +57,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -75,15 +69,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of createSnapshotDisk to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSnapshotDisk to 30 seconds: * *

  * 
@@ -98,84 +92,73 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class DiskStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListDisksSettings;
-  private final UnaryCallSettings createSnapshotDiskSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
+      aggregatedListDisksSettings;
+  private final UnaryCallSettings
+      createSnapshotDiskSettings;
   private final UnaryCallSettings deleteDiskSettings;
   private final UnaryCallSettings getDiskSettings;
   private final UnaryCallSettings insertDiskSettings;
-  private final PagedCallSettings listDisksSettings;
+  private final PagedCallSettings
+      listDisksSettings;
   private final UnaryCallSettings resizeDiskSettings;
   private final UnaryCallSettings setLabelsDiskSettings;
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListDisks.
-   */
-  public PagedCallSettings aggregatedListDisksSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListDisks. */
+  public PagedCallSettings<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
+      aggregatedListDisksSettings() {
     return aggregatedListDisksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to createSnapshotDisk.
-   */
+  /** Returns the object with the settings used for calls to createSnapshotDisk. */
   public UnaryCallSettings createSnapshotDiskSettings() {
     return createSnapshotDiskSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteDisk.
-   */
+  /** Returns the object with the settings used for calls to deleteDisk. */
   public UnaryCallSettings deleteDiskSettings() {
     return deleteDiskSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getDisk.
-   */
+  /** Returns the object with the settings used for calls to getDisk. */
   public UnaryCallSettings getDiskSettings() {
     return getDiskSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertDisk.
-   */
+  /** Returns the object with the settings used for calls to insertDisk. */
   public UnaryCallSettings insertDiskSettings() {
     return insertDiskSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listDisks.
-   */
-  public PagedCallSettings listDisksSettings() {
+  /** Returns the object with the settings used for calls to listDisks. */
+  public PagedCallSettings
+      listDisksSettings() {
     return listDisksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeDisk.
-   */
+  /** Returns the object with the settings used for calls to resizeDisk. */
   public UnaryCallSettings resizeDiskSettings() {
     return resizeDiskSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsDisk.
-   */
+  /** Returns the object with the settings used for calls to setLabelsDisk. */
   public UnaryCallSettings setLabelsDiskSettings() {
     return setLabelsDiskSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public DiskStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -188,47 +171,34 @@ public DiskStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -240,26 +210,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DiskStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -277,128 +243,146 @@ protected DiskStubSettings(Builder settingsBuilder) throws IOException {
     setLabelsDiskSettings = settingsBuilder.setLabelsDiskSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_DISKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListDisksHttpRequest injectToken(AggregatedListDisksHttpRequest payload, String token) {
-          return AggregatedListDisksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListDisksHttpRequest injectPageSize(AggregatedListDisksHttpRequest payload, int pageSize) {
-          return AggregatedListDisksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListDisksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(DiskAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(DiskAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_DISKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListDisksHttpRequest injectToken(ListDisksHttpRequest payload, String token) {
-          return ListDisksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListDisksHttpRequest injectPageSize(ListDisksHttpRequest payload, int pageSize) {
-          return ListDisksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListDisksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(DiskList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(DiskList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_DISKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListDisksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_DISKS_PAGE_STR_DESC, request, context);
-          return AggregatedListDisksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_DISKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListDisksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_DISKS_PAGE_STR_DESC, request, context);
-          return ListDisksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for DiskStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, DisksScopedList>
+      AGGREGATED_LIST_DISKS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListDisksHttpRequest, DiskAggregatedList, DisksScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListDisksHttpRequest injectToken(
+                AggregatedListDisksHttpRequest payload, String token) {
+              return AggregatedListDisksHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public AggregatedListDisksHttpRequest injectPageSize(
+                AggregatedListDisksHttpRequest payload, int pageSize) {
+              return AggregatedListDisksHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListDisksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(DiskAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(DiskAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_DISKS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListDisksHttpRequest injectToken(ListDisksHttpRequest payload, String token) {
+              return ListDisksHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListDisksHttpRequest injectPageSize(ListDisksHttpRequest payload, int pageSize) {
+              return ListDisksHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListDisksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(DiskList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(DiskList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
+      AGGREGATED_LIST_DISKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListDisksHttpRequest, DiskAggregatedList,
+              AggregatedListDisksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                AggregatedListDisksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_DISKS_PAGE_STR_DESC, request, context);
+              return AggregatedListDisksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListDisksHttpRequest, DiskList, ListDisksPagedResponse>
+      LIST_DISKS_PAGE_STR_FACT =
+          new PagedListResponseFactory() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListDisksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_DISKS_PAGE_STR_DESC, request, context);
+              return ListDisksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for DiskStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListDisksSettings;
-    private final UnaryCallSettings.Builder createSnapshotDiskSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse>
+        aggregatedListDisksSettings;
+    private final UnaryCallSettings.Builder
+        createSnapshotDiskSettings;
     private final UnaryCallSettings.Builder deleteDiskSettings;
     private final UnaryCallSettings.Builder getDiskSettings;
     private final UnaryCallSettings.Builder insertDiskSettings;
-    private final PagedCallSettings.Builder listDisksSettings;
+    private final PagedCallSettings.Builder
+        listDisksSettings;
     private final UnaryCallSettings.Builder resizeDiskSettings;
-    private final UnaryCallSettings.Builder setLabelsDiskSettings;
+    private final UnaryCallSettings.Builder
+        setLabelsDiskSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -407,15 +391,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -427,8 +412,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListDisksSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_DISKS_PAGE_STR_FACT);
+      aggregatedListDisksSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_DISKS_PAGE_STR_FACT);
 
       createSnapshotDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -438,23 +423,22 @@ protected Builder(ClientContext clientContext) {
 
       insertDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listDisksSettings = PagedCallSettings.newBuilder(
-          LIST_DISKS_PAGE_STR_FACT);
+      listDisksSettings = PagedCallSettings.newBuilder(LIST_DISKS_PAGE_STR_FACT);
 
       resizeDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       setLabelsDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListDisksSettings,
-          createSnapshotDiskSettings,
-          deleteDiskSettings,
-          getDiskSettings,
-          insertDiskSettings,
-          listDisksSettings,
-          resizeDiskSettings,
-          setLabelsDiskSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListDisksSettings,
+              createSnapshotDiskSettings,
+              deleteDiskSettings,
+              getDiskSettings,
+              insertDiskSettings,
+              listDisksSettings,
+              resizeDiskSettings,
+              setLabelsDiskSettings);
 
       initDefaults(this);
     }
@@ -470,35 +454,43 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListDisksSettings()
+      builder
+          .aggregatedListDisksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.createSnapshotDiskSettings()
+      builder
+          .createSnapshotDiskSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteDiskSettings()
+      builder
+          .deleteDiskSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getDiskSettings()
+      builder
+          .getDiskSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertDiskSettings()
+      builder
+          .insertDiskSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listDisksSettings()
+      builder
+          .listDisksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.resizeDiskSettings()
+      builder
+          .resizeDiskSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setLabelsDiskSettings()
+      builder
+          .setLabelsDiskSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -517,24 +509,26 @@ protected Builder(DiskStubSettings settings) {
       resizeDiskSettings = settings.resizeDiskSettings.toBuilder();
       setLabelsDiskSettings = settings.setLabelsDiskSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListDisksSettings,
-          createSnapshotDiskSettings,
-          deleteDiskSettings,
-          getDiskSettings,
-          insertDiskSettings,
-          listDisksSettings,
-          resizeDiskSettings,
-          setLabelsDiskSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListDisksSettings,
+              createSnapshotDiskSettings,
+              deleteDiskSettings,
+              getDiskSettings,
+              insertDiskSettings,
+              listDisksSettings,
+              resizeDiskSettings,
+              setLabelsDiskSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -543,58 +537,46 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListDisksSettings() { + /** Returns the builder for the settings used for calls to aggregatedListDisks. */ + public PagedCallSettings.Builder< + AggregatedListDisksHttpRequest, DiskAggregatedList, AggregatedListDisksPagedResponse> + aggregatedListDisksSettings() { return aggregatedListDisksSettings; } - /** - * Returns the builder for the settings used for calls to createSnapshotDisk. - */ - public UnaryCallSettings.Builder createSnapshotDiskSettings() { + /** Returns the builder for the settings used for calls to createSnapshotDisk. */ + public UnaryCallSettings.Builder + createSnapshotDiskSettings() { return createSnapshotDiskSettings; } - /** - * Returns the builder for the settings used for calls to deleteDisk. - */ + /** Returns the builder for the settings used for calls to deleteDisk. */ public UnaryCallSettings.Builder deleteDiskSettings() { return deleteDiskSettings; } - /** - * Returns the builder for the settings used for calls to getDisk. - */ + /** Returns the builder for the settings used for calls to getDisk. */ public UnaryCallSettings.Builder getDiskSettings() { return getDiskSettings; } - /** - * Returns the builder for the settings used for calls to insertDisk. - */ + /** Returns the builder for the settings used for calls to insertDisk. */ public UnaryCallSettings.Builder insertDiskSettings() { return insertDiskSettings; } - /** - * Returns the builder for the settings used for calls to listDisks. - */ - public PagedCallSettings.Builder listDisksSettings() { + /** Returns the builder for the settings used for calls to listDisks. */ + public PagedCallSettings.Builder + listDisksSettings() { return listDisksSettings; } - /** - * Returns the builder for the settings used for calls to resizeDisk. - */ + /** Returns the builder for the settings used for calls to resizeDisk. */ public UnaryCallSettings.Builder resizeDiskSettings() { return resizeDiskSettings; } - /** - * Returns the builder for the settings used for calls to setLabelsDisk. - */ + /** Returns the builder for the settings used for calls to setLabelsDisk. */ public UnaryCallSettings.Builder setLabelsDiskSettings() { return setLabelsDiskSettings; } @@ -604,4 +586,4 @@ public DiskStubSettings build() throws IOException { return new DiskStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java index ddb575442ea8..c51e1cd0d7e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java @@ -15,21 +15,18 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; import com.google.cloud.compute.v1.DiskType; import com.google.cloud.compute.v1.DiskTypeAggregatedList; -import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; -import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; import com.google.cloud.compute.v1.DiskTypeList; -import com.google.cloud.compute.v1.DiskTypesScopedList; import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneDiskTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -42,14 +39,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class DiskTypeStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListDiskTypesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListDiskTypesPagedCallable()"); + public UnaryCallable + aggregatedListDiskTypesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListDiskTypesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListDiskTypesCallable() { + public UnaryCallable + aggregatedListDiskTypesCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListDiskTypesCallable()"); } @@ -59,7 +58,8 @@ public UnaryCallable getDiskTypeCallable() { } @BetaApi - public UnaryCallable listDiskTypesPagedCallable() { + public UnaryCallable + listDiskTypesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listDiskTypesPagedCallable()"); } @@ -68,4 +68,6 @@ public UnaryCallable listDiskTypesCallab throw new UnsupportedOperationException("Not implemented: listDiskTypesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java index f7bcc0aff7a5..89da1e00bdb1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +40,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; import com.google.cloud.compute.v1.DiskType; import com.google.cloud.compute.v1.DiskTypeAggregatedList; -import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; -import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; import com.google.cloud.compute.v1.DiskTypeList; import com.google.cloud.compute.v1.DiskTypesScopedList; import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; @@ -55,10 +51,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -69,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getDiskType to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getDiskType to 30 seconds: * *

  * 
@@ -92,44 +86,45 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class DiskTypeStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListDiskTypesSettings;
-  private final UnaryCallSettings getDiskTypeSettings;
-  private final PagedCallSettings listDiskTypesSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListDiskTypes.
-   */
-  public PagedCallSettings aggregatedListDiskTypesSettings() {
+  private final PagedCallSettings<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+          AggregatedListDiskTypesPagedResponse>
+      aggregatedListDiskTypesSettings;
+  private final UnaryCallSettings getDiskTypeSettings;
+  private final PagedCallSettings<
+          ListDiskTypesHttpRequest, DiskTypeList, ListDiskTypesPagedResponse>
+      listDiskTypesSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListDiskTypes. */
+  public PagedCallSettings<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+          AggregatedListDiskTypesPagedResponse>
+      aggregatedListDiskTypesSettings() {
     return aggregatedListDiskTypesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getDiskType.
-   */
+  /** Returns the object with the settings used for calls to getDiskType. */
   public UnaryCallSettings getDiskTypeSettings() {
     return getDiskTypeSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listDiskTypes.
-   */
-  public PagedCallSettings listDiskTypesSettings() {
+  /** Returns the object with the settings used for calls to listDiskTypes. */
+  public PagedCallSettings
+      listDiskTypesSettings() {
     return listDiskTypesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public DiskTypeStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -142,47 +137,34 @@ public DiskTypeStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -194,26 +176,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DiskTypeStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -226,123 +204,149 @@ protected DiskTypeStubSettings(Builder settingsBuilder) throws IOException {
     listDiskTypesSettings = settingsBuilder.listDiskTypesSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_DISK_TYPES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListDiskTypesHttpRequest injectToken(AggregatedListDiskTypesHttpRequest payload, String token) {
-          return AggregatedListDiskTypesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListDiskTypesHttpRequest injectPageSize(AggregatedListDiskTypesHttpRequest payload, int pageSize) {
-          return AggregatedListDiskTypesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListDiskTypesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(DiskTypeAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(DiskTypeAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_DISK_TYPES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListDiskTypesHttpRequest injectToken(ListDiskTypesHttpRequest payload, String token) {
-          return ListDiskTypesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListDiskTypesHttpRequest injectPageSize(ListDiskTypesHttpRequest payload, int pageSize) {
-          return ListDiskTypesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListDiskTypesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(DiskTypeList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(DiskTypeList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_DISK_TYPES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListDiskTypesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_DISK_TYPES_PAGE_STR_DESC, request, context);
-          return AggregatedListDiskTypesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_DISK_TYPES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListDiskTypesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_DISK_TYPES_PAGE_STR_DESC, request, context);
-          return ListDiskTypesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for DiskTypeStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, DiskTypesScopedList>
+      AGGREGATED_LIST_DISK_TYPES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, DiskTypesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListDiskTypesHttpRequest injectToken(
+                AggregatedListDiskTypesHttpRequest payload, String token) {
+              return AggregatedListDiskTypesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListDiskTypesHttpRequest injectPageSize(
+                AggregatedListDiskTypesHttpRequest payload, int pageSize) {
+              return AggregatedListDiskTypesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListDiskTypesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(DiskTypeAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(DiskTypeAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_DISK_TYPES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListDiskTypesHttpRequest injectToken(
+                ListDiskTypesHttpRequest payload, String token) {
+              return ListDiskTypesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListDiskTypesHttpRequest injectPageSize(
+                ListDiskTypesHttpRequest payload, int pageSize) {
+              return ListDiskTypesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListDiskTypesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(DiskTypeList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(DiskTypeList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+          AggregatedListDiskTypesPagedResponse>
+      AGGREGATED_LIST_DISK_TYPES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+              AggregatedListDiskTypesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                AggregatedListDiskTypesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+                      DiskTypesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_DISK_TYPES_PAGE_STR_DESC, request, context);
+              return AggregatedListDiskTypesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListDiskTypesHttpRequest, DiskTypeList, ListDiskTypesPagedResponse>
+      LIST_DISK_TYPES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListDiskTypesHttpRequest, DiskTypeList, ListDiskTypesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListDiskTypesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_DISK_TYPES_PAGE_STR_DESC, request, context);
+              return ListDiskTypesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for DiskTypeStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListDiskTypesSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList,
+            AggregatedListDiskTypesPagedResponse>
+        aggregatedListDiskTypesSettings;
     private final UnaryCallSettings.Builder getDiskTypeSettings;
-    private final PagedCallSettings.Builder listDiskTypesSettings;
+    private final PagedCallSettings.Builder<
+            ListDiskTypesHttpRequest, DiskTypeList, ListDiskTypesPagedResponse>
+        listDiskTypesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -351,15 +355,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -371,19 +376,16 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListDiskTypesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_DISK_TYPES_PAGE_STR_FACT);
+      aggregatedListDiskTypesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_DISK_TYPES_PAGE_STR_FACT);
 
       getDiskTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listDiskTypesSettings = PagedCallSettings.newBuilder(
-          LIST_DISK_TYPES_PAGE_STR_FACT);
+      listDiskTypesSettings = PagedCallSettings.newBuilder(LIST_DISK_TYPES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListDiskTypesSettings,
-          getDiskTypeSettings,
-          listDiskTypesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListDiskTypesSettings, getDiskTypeSettings, listDiskTypesSettings);
 
       initDefaults(this);
     }
@@ -399,15 +401,18 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListDiskTypesSettings()
+      builder
+          .aggregatedListDiskTypesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getDiskTypeSettings()
+      builder
+          .getDiskTypeSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listDiskTypesSettings()
+      builder
+          .listDiskTypesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -421,19 +426,19 @@ protected Builder(DiskTypeStubSettings settings) {
       getDiskTypeSettings = settings.getDiskTypeSettings.toBuilder();
       listDiskTypesSettings = settings.listDiskTypesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListDiskTypesSettings,
-          getDiskTypeSettings,
-          listDiskTypesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListDiskTypesSettings, getDiskTypeSettings, listDiskTypesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -442,24 +447,23 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListDiskTypesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListDiskTypes. */ + public PagedCallSettings.Builder< + AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList, + AggregatedListDiskTypesPagedResponse> + aggregatedListDiskTypesSettings() { return aggregatedListDiskTypesSettings; } - /** - * Returns the builder for the settings used for calls to getDiskType. - */ + /** Returns the builder for the settings used for calls to getDiskType. */ public UnaryCallSettings.Builder getDiskTypeSettings() { return getDiskTypeSettings; } - /** - * Returns the builder for the settings used for calls to listDiskTypes. - */ - public PagedCallSettings.Builder listDiskTypesSettings() { + /** Returns the builder for the settings used for calls to listDiskTypes. */ + public PagedCallSettings.Builder< + ListDiskTypesHttpRequest, DiskTypeList, ListDiskTypesPagedResponse> + listDiskTypesSettings() { return listDiskTypesSettings; } @@ -468,4 +472,4 @@ public DiskTypeStubSettings build() throws IOException { return new DiskTypeStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java index 6e70d3075b07..52a995d0c602 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java @@ -15,20 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; import com.google.cloud.compute.v1.Firewall; -import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; import com.google.cloud.compute.v1.FirewallList; import com.google.cloud.compute.v1.GetFirewallHttpRequest; import com.google.cloud.compute.v1.InsertFirewallHttpRequest; import com.google.cloud.compute.v1.ListFirewallsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchFirewallHttpRequest; -import com.google.cloud.compute.v1.ProjectFirewallName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; import javax.annotation.Generated; @@ -42,7 +41,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class FirewallStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteFirewallCallable() { throw new UnsupportedOperationException("Not implemented: deleteFirewallCallable()"); @@ -59,7 +57,8 @@ public UnaryCallable insertFirewallCallabl } @BetaApi - public UnaryCallable listFirewallsPagedCallable() { + public UnaryCallable + listFirewallsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listFirewallsPagedCallable()"); } @@ -78,4 +77,6 @@ public UnaryCallable updateFirewallCallabl throw new UnsupportedOperationException("Not implemented: updateFirewallCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java index f7aa50abd27e..7c44f4f465f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,10 +39,8 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; import com.google.cloud.compute.v1.Firewall; -import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; import com.google.cloud.compute.v1.FirewallList; import com.google.cloud.compute.v1.GetFirewallHttpRequest; import com.google.cloud.compute.v1.InsertFirewallHttpRequest; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteFirewall to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteFirewall to 30 seconds: * *

  * 
@@ -93,68 +87,57 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class FirewallStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteFirewallSettings;
   private final UnaryCallSettings getFirewallSettings;
   private final UnaryCallSettings insertFirewallSettings;
-  private final PagedCallSettings listFirewallsSettings;
+  private final PagedCallSettings<
+          ListFirewallsHttpRequest, FirewallList, ListFirewallsPagedResponse>
+      listFirewallsSettings;
   private final UnaryCallSettings patchFirewallSettings;
   private final UnaryCallSettings updateFirewallSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteFirewall.
-   */
+  /** Returns the object with the settings used for calls to deleteFirewall. */
   public UnaryCallSettings deleteFirewallSettings() {
     return deleteFirewallSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getFirewall.
-   */
+  /** Returns the object with the settings used for calls to getFirewall. */
   public UnaryCallSettings getFirewallSettings() {
     return getFirewallSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertFirewall.
-   */
+  /** Returns the object with the settings used for calls to insertFirewall. */
   public UnaryCallSettings insertFirewallSettings() {
     return insertFirewallSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listFirewalls.
-   */
-  public PagedCallSettings listFirewallsSettings() {
+  /** Returns the object with the settings used for calls to listFirewalls. */
+  public PagedCallSettings
+      listFirewallsSettings() {
     return listFirewallsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchFirewall.
-   */
+  /** Returns the object with the settings used for calls to patchFirewall. */
   public UnaryCallSettings patchFirewallSettings() {
     return patchFirewallSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateFirewall.
-   */
+  /** Returns the object with the settings used for calls to updateFirewall. */
   public UnaryCallSettings updateFirewallSettings() {
     return updateFirewallSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public FirewallStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +150,34 @@ public FirewallStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -219,26 +189,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(FirewallStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +220,88 @@ protected FirewallStubSettings(Builder settingsBuilder) throws IOException {
     updateFirewallSettings = settingsBuilder.updateFirewallSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_FIREWALLS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListFirewallsHttpRequest injectToken(ListFirewallsHttpRequest payload, String token) {
-          return ListFirewallsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListFirewallsHttpRequest injectPageSize(ListFirewallsHttpRequest payload, int pageSize) {
-          return ListFirewallsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListFirewallsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(FirewallList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(FirewallList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_FIREWALLS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListFirewallsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_FIREWALLS_PAGE_STR_DESC, request, context);
-          return ListFirewallsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for FirewallStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_FIREWALLS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListFirewallsHttpRequest injectToken(
+                ListFirewallsHttpRequest payload, String token) {
+              return ListFirewallsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListFirewallsHttpRequest injectPageSize(
+                ListFirewallsHttpRequest payload, int pageSize) {
+              return ListFirewallsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListFirewallsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(FirewallList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(FirewallList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListFirewallsHttpRequest, FirewallList, ListFirewallsPagedResponse>
+      LIST_FIREWALLS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListFirewallsHttpRequest, FirewallList, ListFirewallsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListFirewallsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_FIREWALLS_PAGE_STR_DESC, request, context);
+              return ListFirewallsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for FirewallStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteFirewallSettings;
+    private final UnaryCallSettings.Builder
+        deleteFirewallSettings;
     private final UnaryCallSettings.Builder getFirewallSettings;
-    private final UnaryCallSettings.Builder insertFirewallSettings;
-    private final PagedCallSettings.Builder listFirewallsSettings;
-    private final UnaryCallSettings.Builder patchFirewallSettings;
-    private final UnaryCallSettings.Builder updateFirewallSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        insertFirewallSettings;
+    private final PagedCallSettings.Builder<
+            ListFirewallsHttpRequest, FirewallList, ListFirewallsPagedResponse>
+        listFirewallsSettings;
+    private final UnaryCallSettings.Builder
+        patchFirewallSettings;
+    private final UnaryCallSettings.Builder
+        updateFirewallSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +310,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +337,20 @@ protected Builder(ClientContext clientContext) {
 
       insertFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listFirewallsSettings = PagedCallSettings.newBuilder(
-          LIST_FIREWALLS_PAGE_STR_FACT);
+      listFirewallsSettings = PagedCallSettings.newBuilder(LIST_FIREWALLS_PAGE_STR_FACT);
 
       patchFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateFirewallSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteFirewallSettings,
-          getFirewallSettings,
-          insertFirewallSettings,
-          listFirewallsSettings,
-          patchFirewallSettings,
-          updateFirewallSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteFirewallSettings,
+              getFirewallSettings,
+              insertFirewallSettings,
+              listFirewallsSettings,
+              patchFirewallSettings,
+              updateFirewallSettings);
 
       initDefaults(this);
     }
@@ -390,27 +366,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteFirewallSettings()
+      builder
+          .deleteFirewallSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getFirewallSettings()
+      builder
+          .getFirewallSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertFirewallSettings()
+      builder
+          .insertFirewallSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listFirewallsSettings()
+      builder
+          .listFirewallsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchFirewallSettings()
+      builder
+          .patchFirewallSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateFirewallSettings()
+      builder
+          .updateFirewallSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +409,24 @@ protected Builder(FirewallStubSettings settings) {
       patchFirewallSettings = settings.patchFirewallSettings.toBuilder();
       updateFirewallSettings = settings.updateFirewallSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteFirewallSettings,
-          getFirewallSettings,
-          insertFirewallSettings,
-          listFirewallsSettings,
-          patchFirewallSettings,
-          updateFirewallSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteFirewallSettings,
+              getFirewallSettings,
+              insertFirewallSettings,
+              listFirewallsSettings,
+              patchFirewallSettings,
+              updateFirewallSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +435,38 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteFirewallSettings() { + /** Returns the builder for the settings used for calls to deleteFirewall. */ + public UnaryCallSettings.Builder + deleteFirewallSettings() { return deleteFirewallSettings; } - /** - * Returns the builder for the settings used for calls to getFirewall. - */ + /** Returns the builder for the settings used for calls to getFirewall. */ public UnaryCallSettings.Builder getFirewallSettings() { return getFirewallSettings; } - /** - * Returns the builder for the settings used for calls to insertFirewall. - */ - public UnaryCallSettings.Builder insertFirewallSettings() { + /** Returns the builder for the settings used for calls to insertFirewall. */ + public UnaryCallSettings.Builder + insertFirewallSettings() { return insertFirewallSettings; } - /** - * Returns the builder for the settings used for calls to listFirewalls. - */ - public PagedCallSettings.Builder listFirewallsSettings() { + /** Returns the builder for the settings used for calls to listFirewalls. */ + public PagedCallSettings.Builder< + ListFirewallsHttpRequest, FirewallList, ListFirewallsPagedResponse> + listFirewallsSettings() { return listFirewallsSettings; } - /** - * Returns the builder for the settings used for calls to patchFirewall. - */ + /** Returns the builder for the settings used for calls to patchFirewall. */ public UnaryCallSettings.Builder patchFirewallSettings() { return patchFirewallSettings; } - /** - * Returns the builder for the settings used for calls to updateFirewall. - */ - public UnaryCallSettings.Builder updateFirewallSettings() { + /** Returns the builder for the settings used for calls to updateFirewall. */ + public UnaryCallSettings.Builder + updateFirewallSettings() { return updateFirewallSettings; } @@ -498,4 +475,4 @@ public FirewallStubSettings build() throws IOException { return new FirewallStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java index 95d7480a96e6..1a93cc398a96 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,19 +25,12 @@ import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ForwardingRule; import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; -import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; -import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; import com.google.cloud.compute.v1.ForwardingRuleList; -import com.google.cloud.compute.v1.ForwardingRulesScopedList; import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionForwardingRuleName; -import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.TargetReference; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -47,15 +43,19 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ForwardingRuleStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListForwardingRulesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListForwardingRulesPagedCallable()"); + public UnaryCallable< + AggregatedListForwardingRulesHttpRequest, AggregatedListForwardingRulesPagedResponse> + aggregatedListForwardingRulesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListForwardingRulesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListForwardingRulesCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListForwardingRulesCallable()"); + public UnaryCallable + aggregatedListForwardingRulesCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListForwardingRulesCallable()"); } @BetaApi @@ -74,18 +74,23 @@ public UnaryCallable insertForwardin } @BetaApi - public UnaryCallable listForwardingRulesPagedCallable() { + public UnaryCallable + listForwardingRulesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listForwardingRulesPagedCallable()"); } @BetaApi - public UnaryCallable listForwardingRulesCallable() { + public UnaryCallable + listForwardingRulesCallable() { throw new UnsupportedOperationException("Not implemented: listForwardingRulesCallable()"); } @BetaApi - public UnaryCallable setTargetForwardingRuleCallable() { + public UnaryCallable + setTargetForwardingRuleCallable() { throw new UnsupportedOperationException("Not implemented: setTargetForwardingRuleCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java index 8e10d1b1d1ff..fbe705195ffd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,13 +40,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ForwardingRule; import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; -import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; -import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; import com.google.cloud.compute.v1.ForwardingRuleList; import com.google.cloud.compute.v1.ForwardingRulesScopedList; import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; @@ -59,10 +55,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -73,15 +67,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteForwardingRule to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteForwardingRule to 30 seconds: * *

  * 
@@ -96,68 +90,72 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ForwardingRuleStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListForwardingRulesSettings;
-  private final UnaryCallSettings deleteForwardingRuleSettings;
-  private final UnaryCallSettings getForwardingRuleSettings;
-  private final UnaryCallSettings insertForwardingRuleSettings;
-  private final PagedCallSettings listForwardingRulesSettings;
-  private final UnaryCallSettings setTargetForwardingRuleSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListForwardingRules.
-   */
-  public PagedCallSettings aggregatedListForwardingRulesSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+          AggregatedListForwardingRulesPagedResponse>
+      aggregatedListForwardingRulesSettings;
+  private final UnaryCallSettings
+      deleteForwardingRuleSettings;
+  private final UnaryCallSettings
+      getForwardingRuleSettings;
+  private final UnaryCallSettings
+      insertForwardingRuleSettings;
+  private final PagedCallSettings<
+          ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse>
+      listForwardingRulesSettings;
+  private final UnaryCallSettings
+      setTargetForwardingRuleSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListForwardingRules. */
+  public PagedCallSettings<
+          AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+          AggregatedListForwardingRulesPagedResponse>
+      aggregatedListForwardingRulesSettings() {
     return aggregatedListForwardingRulesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteForwardingRule.
-   */
-  public UnaryCallSettings deleteForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to deleteForwardingRule. */
+  public UnaryCallSettings
+      deleteForwardingRuleSettings() {
     return deleteForwardingRuleSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getForwardingRule.
-   */
-  public UnaryCallSettings getForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to getForwardingRule. */
+  public UnaryCallSettings
+      getForwardingRuleSettings() {
     return getForwardingRuleSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertForwardingRule.
-   */
-  public UnaryCallSettings insertForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to insertForwardingRule. */
+  public UnaryCallSettings
+      insertForwardingRuleSettings() {
     return insertForwardingRuleSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listForwardingRules.
-   */
-  public PagedCallSettings listForwardingRulesSettings() {
+  /** Returns the object with the settings used for calls to listForwardingRules. */
+  public PagedCallSettings<
+          ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse>
+      listForwardingRulesSettings() {
     return listForwardingRulesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTargetForwardingRule.
-   */
-  public UnaryCallSettings setTargetForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to setTargetForwardingRule. */
+  public UnaryCallSettings
+      setTargetForwardingRuleSettings() {
     return setTargetForwardingRuleSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ForwardingRuleStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -170,47 +168,34 @@ public ForwardingRuleStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -221,27 +206,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ForwardingRuleStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(ForwardingRuleStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -249,7 +231,8 @@ public Builder toBuilder() {
   protected ForwardingRuleStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListForwardingRulesSettings = settingsBuilder.aggregatedListForwardingRulesSettings().build();
+    aggregatedListForwardingRulesSettings =
+        settingsBuilder.aggregatedListForwardingRulesSettings().build();
     deleteForwardingRuleSettings = settingsBuilder.deleteForwardingRuleSettings().build();
     getForwardingRuleSettings = settingsBuilder.getForwardingRuleSettings().build();
     insertForwardingRuleSettings = settingsBuilder.insertForwardingRuleSettings().build();
@@ -257,126 +240,172 @@ protected ForwardingRuleStubSettings(Builder settingsBuilder) throws IOException
     setTargetForwardingRuleSettings = settingsBuilder.setTargetForwardingRuleSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListForwardingRulesHttpRequest injectToken(AggregatedListForwardingRulesHttpRequest payload, String token) {
-          return AggregatedListForwardingRulesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListForwardingRulesHttpRequest injectPageSize(AggregatedListForwardingRulesHttpRequest payload, int pageSize) {
-          return AggregatedListForwardingRulesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListForwardingRulesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ForwardingRuleAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ForwardingRuleAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_FORWARDING_RULES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListForwardingRulesHttpRequest injectToken(ListForwardingRulesHttpRequest payload, String token) {
-          return ListForwardingRulesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListForwardingRulesHttpRequest injectPageSize(ListForwardingRulesHttpRequest payload, int pageSize) {
-          return ListForwardingRulesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListForwardingRulesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ForwardingRuleList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ForwardingRuleList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListForwardingRulesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_DESC, request, context);
-          return AggregatedListForwardingRulesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_FORWARDING_RULES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListForwardingRulesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_FORWARDING_RULES_PAGE_STR_DESC, request, context);
-          return ListForwardingRulesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for ForwardingRuleStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+          ForwardingRulesScopedList>
+      AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+              ForwardingRulesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListForwardingRulesHttpRequest injectToken(
+                AggregatedListForwardingRulesHttpRequest payload, String token) {
+              return AggregatedListForwardingRulesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListForwardingRulesHttpRequest injectPageSize(
+                AggregatedListForwardingRulesHttpRequest payload, int pageSize) {
+              return AggregatedListForwardingRulesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListForwardingRulesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ForwardingRuleAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                ForwardingRuleAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule>
+      LIST_FORWARDING_RULES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListForwardingRulesHttpRequest injectToken(
+                ListForwardingRulesHttpRequest payload, String token) {
+              return ListForwardingRulesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListForwardingRulesHttpRequest injectPageSize(
+                ListForwardingRulesHttpRequest payload, int pageSize) {
+              return ListForwardingRulesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListForwardingRulesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ForwardingRuleList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(ForwardingRuleList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+          AggregatedListForwardingRulesPagedResponse>
+      AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+              AggregatedListForwardingRulesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList>
+                    callable,
+                AggregatedListForwardingRulesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+                      ForwardingRulesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListForwardingRulesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse>
+      LIST_FORWARDING_RULES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListForwardingRulesHttpRequest, ForwardingRuleList,
+              ListForwardingRulesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListForwardingRulesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_FORWARDING_RULES_PAGE_STR_DESC, request, context);
+              return ListForwardingRulesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for ForwardingRuleStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListForwardingRulesSettings;
-    private final UnaryCallSettings.Builder deleteForwardingRuleSettings;
-    private final UnaryCallSettings.Builder getForwardingRuleSettings;
-    private final UnaryCallSettings.Builder insertForwardingRuleSettings;
-    private final PagedCallSettings.Builder listForwardingRulesSettings;
-    private final UnaryCallSettings.Builder setTargetForwardingRuleSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList,
+            AggregatedListForwardingRulesPagedResponse>
+        aggregatedListForwardingRulesSettings;
+    private final UnaryCallSettings.Builder
+        deleteForwardingRuleSettings;
+    private final UnaryCallSettings.Builder
+        getForwardingRuleSettings;
+    private final UnaryCallSettings.Builder
+        insertForwardingRuleSettings;
+    private final PagedCallSettings.Builder<
+            ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse>
+        listForwardingRulesSettings;
+    private final UnaryCallSettings.Builder
+        setTargetForwardingRuleSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -385,15 +414,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -405,8 +435,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListForwardingRulesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_FACT);
+      aggregatedListForwardingRulesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_FORWARDING_RULES_PAGE_STR_FACT);
 
       deleteForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -414,19 +444,19 @@ protected Builder(ClientContext clientContext) {
 
       insertForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listForwardingRulesSettings = PagedCallSettings.newBuilder(
-          LIST_FORWARDING_RULES_PAGE_STR_FACT);
+      listForwardingRulesSettings =
+          PagedCallSettings.newBuilder(LIST_FORWARDING_RULES_PAGE_STR_FACT);
 
       setTargetForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListForwardingRulesSettings,
-          deleteForwardingRuleSettings,
-          getForwardingRuleSettings,
-          insertForwardingRuleSettings,
-          listForwardingRulesSettings,
-          setTargetForwardingRuleSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListForwardingRulesSettings,
+              deleteForwardingRuleSettings,
+              getForwardingRuleSettings,
+              insertForwardingRuleSettings,
+              listForwardingRulesSettings,
+              setTargetForwardingRuleSettings);
 
       initDefaults(this);
     }
@@ -442,27 +472,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListForwardingRulesSettings()
+      builder
+          .aggregatedListForwardingRulesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteForwardingRuleSettings()
+      builder
+          .deleteForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getForwardingRuleSettings()
+      builder
+          .getForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertForwardingRuleSettings()
+      builder
+          .insertForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listForwardingRulesSettings()
+      builder
+          .listForwardingRulesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setTargetForwardingRuleSettings()
+      builder
+          .setTargetForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -472,29 +508,32 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ForwardingRuleStubSettings settings) {
       super(settings);
 
-      aggregatedListForwardingRulesSettings = settings.aggregatedListForwardingRulesSettings.toBuilder();
+      aggregatedListForwardingRulesSettings =
+          settings.aggregatedListForwardingRulesSettings.toBuilder();
       deleteForwardingRuleSettings = settings.deleteForwardingRuleSettings.toBuilder();
       getForwardingRuleSettings = settings.getForwardingRuleSettings.toBuilder();
       insertForwardingRuleSettings = settings.insertForwardingRuleSettings.toBuilder();
       listForwardingRulesSettings = settings.listForwardingRulesSettings.toBuilder();
       setTargetForwardingRuleSettings = settings.setTargetForwardingRuleSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListForwardingRulesSettings,
-          deleteForwardingRuleSettings,
-          getForwardingRuleSettings,
-          insertForwardingRuleSettings,
-          listForwardingRulesSettings,
-          setTargetForwardingRuleSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListForwardingRulesSettings,
+              deleteForwardingRuleSettings,
+              getForwardingRuleSettings,
+              insertForwardingRuleSettings,
+              listForwardingRulesSettings,
+              setTargetForwardingRuleSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -503,45 +542,42 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListForwardingRulesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListForwardingRules. */ + public PagedCallSettings.Builder< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList, + AggregatedListForwardingRulesPagedResponse> + aggregatedListForwardingRulesSettings() { return aggregatedListForwardingRulesSettings; } - /** - * Returns the builder for the settings used for calls to deleteForwardingRule. - */ - public UnaryCallSettings.Builder deleteForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to deleteForwardingRule. */ + public UnaryCallSettings.Builder + deleteForwardingRuleSettings() { return deleteForwardingRuleSettings; } - /** - * Returns the builder for the settings used for calls to getForwardingRule. - */ - public UnaryCallSettings.Builder getForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to getForwardingRule. */ + public UnaryCallSettings.Builder + getForwardingRuleSettings() { return getForwardingRuleSettings; } - /** - * Returns the builder for the settings used for calls to insertForwardingRule. - */ - public UnaryCallSettings.Builder insertForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to insertForwardingRule. */ + public UnaryCallSettings.Builder + insertForwardingRuleSettings() { return insertForwardingRuleSettings; } - /** - * Returns the builder for the settings used for calls to listForwardingRules. - */ - public PagedCallSettings.Builder listForwardingRulesSettings() { + /** Returns the builder for the settings used for calls to listForwardingRules. */ + public PagedCallSettings.Builder< + ListForwardingRulesHttpRequest, ForwardingRuleList, ListForwardingRulesPagedResponse> + listForwardingRulesSettings() { return listForwardingRulesSettings; } - /** - * Returns the builder for the settings used for calls to setTargetForwardingRule. - */ - public UnaryCallSettings.Builder setTargetForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to setTargetForwardingRule. */ + public UnaryCallSettings.Builder + setTargetForwardingRuleSettings() { return setTargetForwardingRuleSettings; } @@ -550,4 +586,4 @@ public ForwardingRuleStubSettings build() throws IOException { return new ForwardingRuleStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java index efee9618f647..2bc536a881be 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,12 +24,9 @@ import com.google.cloud.compute.v1.AddressList; import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectAddressName; -import com.google.cloud.compute.v1.ProjectName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,7 +39,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalAddressStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteGlobalAddressCallable() { throw new UnsupportedOperationException("Not implemented: deleteGlobalAddressCallable()"); @@ -57,7 +55,8 @@ public UnaryCallable insertGlobalAddr } @BetaApi - public UnaryCallable listGlobalAddressesPagedCallable() { + public UnaryCallable + listGlobalAddressesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalAddressesPagedCallable()"); } @@ -66,4 +65,6 @@ public UnaryCallable listGlobalAddr throw new UnsupportedOperationException("Not implemented: listGlobalAddressesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java index 2740988426f4..c61b3d756632 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +39,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.Address; import com.google.cloud.compute.v1.AddressList; import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; import com.google.cloud.compute.v1.Operation; @@ -54,10 +50,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -68,15 +62,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteGlobalAddress to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteGlobalAddress to 30 seconds: * *

  * 
@@ -91,52 +85,50 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class GlobalAddressStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteGlobalAddressSettings;
-  private final UnaryCallSettings getGlobalAddressSettings;
-  private final UnaryCallSettings insertGlobalAddressSettings;
-  private final PagedCallSettings listGlobalAddressesSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
-  /**
-   * Returns the object with the settings used for calls to deleteGlobalAddress.
-   */
-  public UnaryCallSettings deleteGlobalAddressSettings() {
+  private final UnaryCallSettings
+      deleteGlobalAddressSettings;
+  private final UnaryCallSettings getGlobalAddressSettings;
+  private final UnaryCallSettings
+      insertGlobalAddressSettings;
+  private final PagedCallSettings<
+          ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse>
+      listGlobalAddressesSettings;
+
+  /** Returns the object with the settings used for calls to deleteGlobalAddress. */
+  public UnaryCallSettings
+      deleteGlobalAddressSettings() {
     return deleteGlobalAddressSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getGlobalAddress.
-   */
+  /** Returns the object with the settings used for calls to getGlobalAddress. */
   public UnaryCallSettings getGlobalAddressSettings() {
     return getGlobalAddressSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertGlobalAddress.
-   */
-  public UnaryCallSettings insertGlobalAddressSettings() {
+  /** Returns the object with the settings used for calls to insertGlobalAddress. */
+  public UnaryCallSettings
+      insertGlobalAddressSettings() {
     return insertGlobalAddressSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listGlobalAddresses.
-   */
-  public PagedCallSettings listGlobalAddressesSettings() {
+  /** Returns the object with the settings used for calls to listGlobalAddresses. */
+  public PagedCallSettings<
+          ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse>
+      listGlobalAddressesSettings() {
     return listGlobalAddressesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public GlobalAddressStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -149,47 +141,34 @@ public GlobalAddressStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -200,27 +179,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GlobalAddressStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(GlobalAddressStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -234,76 +210,88 @@ protected GlobalAddressStubSettings(Builder settingsBuilder) throws IOException
     listGlobalAddressesSettings = settingsBuilder.listGlobalAddressesSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_GLOBAL_ADDRESSES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListGlobalAddressesHttpRequest injectToken(ListGlobalAddressesHttpRequest payload, String token) {
-          return ListGlobalAddressesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListGlobalAddressesHttpRequest injectPageSize(ListGlobalAddressesHttpRequest payload, int pageSize) {
-          return ListGlobalAddressesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListGlobalAddressesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(AddressList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable
extractResources(AddressList payload) { - return payload.getItemsList(); - } - }; - - private static final PagedListResponseFactory LIST_GLOBAL_ADDRESSES_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListGlobalAddressesHttpRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_GLOBAL_ADDRESSES_PAGE_STR_DESC, request, context); - return ListGlobalAddressesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - - /** - * Builder for GlobalAddressStubSettings. - */ + private static final PagedListDescriptor + LIST_GLOBAL_ADDRESSES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListGlobalAddressesHttpRequest injectToken( + ListGlobalAddressesHttpRequest payload, String token) { + return ListGlobalAddressesHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListGlobalAddressesHttpRequest injectPageSize( + ListGlobalAddressesHttpRequest payload, int pageSize) { + return ListGlobalAddressesHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListGlobalAddressesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(AddressList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable
extractResources(AddressList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse> + LIST_GLOBAL_ADDRESSES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListGlobalAddressesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create( + callable, LIST_GLOBAL_ADDRESSES_PAGE_STR_DESC, request, context); + return ListGlobalAddressesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for GlobalAddressStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder deleteGlobalAddressSettings; - private final UnaryCallSettings.Builder getGlobalAddressSettings; - private final UnaryCallSettings.Builder insertGlobalAddressSettings; - private final PagedCallSettings.Builder listGlobalAddressesSettings; + private final UnaryCallSettings.Builder + deleteGlobalAddressSettings; + private final UnaryCallSettings.Builder + getGlobalAddressSettings; + private final UnaryCallSettings.Builder + insertGlobalAddressSettings; + private final PagedCallSettings.Builder< + ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse> + listGlobalAddressesSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); definitions.put( "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -312,15 +300,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); definitions.put("default", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -338,15 +327,15 @@ protected Builder(ClientContext clientContext) { insertGlobalAddressSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listGlobalAddressesSettings = PagedCallSettings.newBuilder( - LIST_GLOBAL_ADDRESSES_PAGE_STR_FACT); + listGlobalAddressesSettings = + PagedCallSettings.newBuilder(LIST_GLOBAL_ADDRESSES_PAGE_STR_FACT); - unaryMethodSettingsBuilders = ImmutableList.>of( - deleteGlobalAddressSettings, - getGlobalAddressSettings, - insertGlobalAddressSettings, - listGlobalAddressesSettings - ); + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteGlobalAddressSettings, + getGlobalAddressSettings, + insertGlobalAddressSettings, + listGlobalAddressesSettings); initDefaults(this); } @@ -362,19 +351,23 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { - builder.deleteGlobalAddressSettings() + builder + .deleteGlobalAddressSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.getGlobalAddressSettings() + builder + .getGlobalAddressSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.insertGlobalAddressSettings() + builder + .insertGlobalAddressSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder.listGlobalAddressesSettings() + builder + .listGlobalAddressesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); @@ -389,20 +382,22 @@ protected Builder(GlobalAddressStubSettings settings) { insertGlobalAddressSettings = settings.insertGlobalAddressSettings.toBuilder(); listGlobalAddressesSettings = settings.listGlobalAddressesSettings.toBuilder(); - unaryMethodSettingsBuilders = ImmutableList.>of( - deleteGlobalAddressSettings, - getGlobalAddressSettings, - insertGlobalAddressSettings, - listGlobalAddressesSettings - ); + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteGlobalAddressSettings, + getGlobalAddressSettings, + insertGlobalAddressSettings, + listGlobalAddressesSettings); } + // NEXT_MAJOR_VER: remove 'throws Exception' /** * Applies the given settings updater function to all of the unary API methods in this service. * - * Note: This method does not support applying settings to streaming methods. + *

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -411,31 +406,28 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteGlobalAddressSettings() { + /** Returns the builder for the settings used for calls to deleteGlobalAddress. */ + public UnaryCallSettings.Builder + deleteGlobalAddressSettings() { return deleteGlobalAddressSettings; } - /** - * Returns the builder for the settings used for calls to getGlobalAddress. - */ - public UnaryCallSettings.Builder getGlobalAddressSettings() { + /** Returns the builder for the settings used for calls to getGlobalAddress. */ + public UnaryCallSettings.Builder + getGlobalAddressSettings() { return getGlobalAddressSettings; } - /** - * Returns the builder for the settings used for calls to insertGlobalAddress. - */ - public UnaryCallSettings.Builder insertGlobalAddressSettings() { + /** Returns the builder for the settings used for calls to insertGlobalAddress. */ + public UnaryCallSettings.Builder + insertGlobalAddressSettings() { return insertGlobalAddressSettings; } - /** - * Returns the builder for the settings used for calls to listGlobalAddresses. - */ - public PagedCallSettings.Builder listGlobalAddressesSettings() { + /** Returns the builder for the settings used for calls to listGlobalAddresses. */ + public PagedCallSettings.Builder< + ListGlobalAddressesHttpRequest, AddressList, ListGlobalAddressesPagedResponse> + listGlobalAddressesSettings() { return listGlobalAddressesSettings; } @@ -444,4 +436,4 @@ public GlobalAddressStubSettings build() throws IOException { return new GlobalAddressStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java index c82528e75be7..33137dc281e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,14 +24,10 @@ import com.google.cloud.compute.v1.ForwardingRule; import com.google.cloud.compute.v1.ForwardingRuleList; import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; -import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectForwardingRuleName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.TargetReference; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -42,35 +40,46 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalForwardingRuleStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteGlobalForwardingRuleCallable() { - throw new UnsupportedOperationException("Not implemented: deleteGlobalForwardingRuleCallable()"); + public UnaryCallable + deleteGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteGlobalForwardingRuleCallable()"); } @BetaApi - public UnaryCallable getGlobalForwardingRuleCallable() { + public UnaryCallable + getGlobalForwardingRuleCallable() { throw new UnsupportedOperationException("Not implemented: getGlobalForwardingRuleCallable()"); } @BetaApi - public UnaryCallable insertGlobalForwardingRuleCallable() { - throw new UnsupportedOperationException("Not implemented: insertGlobalForwardingRuleCallable()"); + public UnaryCallable + insertGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException( + "Not implemented: insertGlobalForwardingRuleCallable()"); } @BetaApi - public UnaryCallable listGlobalForwardingRulesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listGlobalForwardingRulesPagedCallable()"); + public UnaryCallable + listGlobalForwardingRulesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listGlobalForwardingRulesPagedCallable()"); } @BetaApi - public UnaryCallable listGlobalForwardingRulesCallable() { + public UnaryCallable + listGlobalForwardingRulesCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalForwardingRulesCallable()"); } @BetaApi - public UnaryCallable setTargetGlobalForwardingRuleCallable() { - throw new UnsupportedOperationException("Not implemented: setTargetGlobalForwardingRuleCallable()"); + public UnaryCallable + setTargetGlobalForwardingRuleCallable() { + throw new UnsupportedOperationException( + "Not implemented: setTargetGlobalForwardingRuleCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java index 403f4786e56a..a5eae1104610 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +39,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ForwardingRule; import com.google.cloud.compute.v1.ForwardingRuleList; import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; -import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; import com.google.cloud.compute.v1.Operation; @@ -55,10 +51,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -69,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteGlobalForwardingRule to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteGlobalForwardingRule to 30 seconds: * *

  * 
@@ -91,61 +85,64 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class GlobalForwardingRuleStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteGlobalForwardingRuleSettings;
-  private final UnaryCallSettings getGlobalForwardingRuleSettings;
-  private final UnaryCallSettings insertGlobalForwardingRuleSettings;
-  private final PagedCallSettings listGlobalForwardingRulesSettings;
-  private final UnaryCallSettings setTargetGlobalForwardingRuleSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteGlobalForwardingRule.
-   */
-  public UnaryCallSettings deleteGlobalForwardingRuleSettings() {
+public class GlobalForwardingRuleStubSettings
+    extends StubSettings {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteGlobalForwardingRuleSettings;
+  private final UnaryCallSettings
+      getGlobalForwardingRuleSettings;
+  private final UnaryCallSettings
+      insertGlobalForwardingRuleSettings;
+  private final PagedCallSettings<
+          ListGlobalForwardingRulesHttpRequest, ForwardingRuleList,
+          ListGlobalForwardingRulesPagedResponse>
+      listGlobalForwardingRulesSettings;
+  private final UnaryCallSettings
+      setTargetGlobalForwardingRuleSettings;
+
+  /** Returns the object with the settings used for calls to deleteGlobalForwardingRule. */
+  public UnaryCallSettings
+      deleteGlobalForwardingRuleSettings() {
     return deleteGlobalForwardingRuleSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getGlobalForwardingRule.
-   */
-  public UnaryCallSettings getGlobalForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to getGlobalForwardingRule. */
+  public UnaryCallSettings
+      getGlobalForwardingRuleSettings() {
     return getGlobalForwardingRuleSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertGlobalForwardingRule.
-   */
-  public UnaryCallSettings insertGlobalForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to insertGlobalForwardingRule. */
+  public UnaryCallSettings
+      insertGlobalForwardingRuleSettings() {
     return insertGlobalForwardingRuleSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listGlobalForwardingRules.
-   */
-  public PagedCallSettings listGlobalForwardingRulesSettings() {
+  /** Returns the object with the settings used for calls to listGlobalForwardingRules. */
+  public PagedCallSettings<
+          ListGlobalForwardingRulesHttpRequest, ForwardingRuleList,
+          ListGlobalForwardingRulesPagedResponse>
+      listGlobalForwardingRulesSettings() {
     return listGlobalForwardingRulesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTargetGlobalForwardingRule.
-   */
-  public UnaryCallSettings setTargetGlobalForwardingRuleSettings() {
+  /** Returns the object with the settings used for calls to setTargetGlobalForwardingRule. */
+  public UnaryCallSettings
+      setTargetGlobalForwardingRuleSettings() {
     return setTargetGlobalForwardingRuleSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public GlobalForwardingRuleStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -158,47 +155,34 @@ public GlobalForwardingRuleStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -209,27 +193,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GlobalForwardingRuleStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(GlobalForwardingRuleStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -237,84 +218,110 @@ public Builder toBuilder() {
   protected GlobalForwardingRuleStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    deleteGlobalForwardingRuleSettings = settingsBuilder.deleteGlobalForwardingRuleSettings().build();
+    deleteGlobalForwardingRuleSettings =
+        settingsBuilder.deleteGlobalForwardingRuleSettings().build();
     getGlobalForwardingRuleSettings = settingsBuilder.getGlobalForwardingRuleSettings().build();
-    insertGlobalForwardingRuleSettings = settingsBuilder.insertGlobalForwardingRuleSettings().build();
+    insertGlobalForwardingRuleSettings =
+        settingsBuilder.insertGlobalForwardingRuleSettings().build();
     listGlobalForwardingRulesSettings = settingsBuilder.listGlobalForwardingRulesSettings().build();
-    setTargetGlobalForwardingRuleSettings = settingsBuilder.setTargetGlobalForwardingRuleSettings().build();
+    setTargetGlobalForwardingRuleSettings =
+        settingsBuilder.setTargetGlobalForwardingRuleSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListGlobalForwardingRulesHttpRequest injectToken(ListGlobalForwardingRulesHttpRequest payload, String token) {
-          return ListGlobalForwardingRulesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListGlobalForwardingRulesHttpRequest injectPageSize(ListGlobalForwardingRulesHttpRequest payload, int pageSize) {
-          return ListGlobalForwardingRulesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListGlobalForwardingRulesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ForwardingRuleList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ForwardingRuleList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListGlobalForwardingRulesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_DESC, request, context);
-          return ListGlobalForwardingRulesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for GlobalForwardingRuleStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule>
+      LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, ForwardingRule>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListGlobalForwardingRulesHttpRequest injectToken(
+                ListGlobalForwardingRulesHttpRequest payload, String token) {
+              return ListGlobalForwardingRulesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListGlobalForwardingRulesHttpRequest injectPageSize(
+                ListGlobalForwardingRulesHttpRequest payload, int pageSize) {
+              return ListGlobalForwardingRulesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListGlobalForwardingRulesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ForwardingRuleList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(ForwardingRuleList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListGlobalForwardingRulesHttpRequest, ForwardingRuleList,
+          ListGlobalForwardingRulesPagedResponse>
+      LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListGlobalForwardingRulesHttpRequest, ForwardingRuleList,
+              ListGlobalForwardingRulesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListGlobalForwardingRulesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_DESC, request, context);
+              return ListGlobalForwardingRulesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for GlobalForwardingRuleStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteGlobalForwardingRuleSettings;
-    private final UnaryCallSettings.Builder getGlobalForwardingRuleSettings;
-    private final UnaryCallSettings.Builder insertGlobalForwardingRuleSettings;
-    private final PagedCallSettings.Builder listGlobalForwardingRulesSettings;
-    private final UnaryCallSettings.Builder setTargetGlobalForwardingRuleSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteGlobalForwardingRuleSettings;
+    private final UnaryCallSettings.Builder
+        getGlobalForwardingRuleSettings;
+    private final UnaryCallSettings.Builder
+        insertGlobalForwardingRuleSettings;
+    private final PagedCallSettings.Builder<
+            ListGlobalForwardingRulesHttpRequest, ForwardingRuleList,
+            ListGlobalForwardingRulesPagedResponse>
+        listGlobalForwardingRulesSettings;
+    private final UnaryCallSettings.Builder
+        setTargetGlobalForwardingRuleSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -323,15 +330,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -349,18 +357,18 @@ protected Builder(ClientContext clientContext) {
 
       insertGlobalForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listGlobalForwardingRulesSettings = PagedCallSettings.newBuilder(
-          LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_FACT);
+      listGlobalForwardingRulesSettings =
+          PagedCallSettings.newBuilder(LIST_GLOBAL_FORWARDING_RULES_PAGE_STR_FACT);
 
       setTargetGlobalForwardingRuleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteGlobalForwardingRuleSettings,
-          getGlobalForwardingRuleSettings,
-          insertGlobalForwardingRuleSettings,
-          listGlobalForwardingRulesSettings,
-          setTargetGlobalForwardingRuleSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteGlobalForwardingRuleSettings,
+              getGlobalForwardingRuleSettings,
+              insertGlobalForwardingRuleSettings,
+              listGlobalForwardingRulesSettings,
+              setTargetGlobalForwardingRuleSettings);
 
       initDefaults(this);
     }
@@ -376,23 +384,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteGlobalForwardingRuleSettings()
+      builder
+          .deleteGlobalForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getGlobalForwardingRuleSettings()
+      builder
+          .getGlobalForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertGlobalForwardingRuleSettings()
+      builder
+          .insertGlobalForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listGlobalForwardingRulesSettings()
+      builder
+          .listGlobalForwardingRulesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setTargetGlobalForwardingRuleSettings()
+      builder
+          .setTargetGlobalForwardingRuleSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -406,23 +419,26 @@ protected Builder(GlobalForwardingRuleStubSettings settings) {
       getGlobalForwardingRuleSettings = settings.getGlobalForwardingRuleSettings.toBuilder();
       insertGlobalForwardingRuleSettings = settings.insertGlobalForwardingRuleSettings.toBuilder();
       listGlobalForwardingRulesSettings = settings.listGlobalForwardingRulesSettings.toBuilder();
-      setTargetGlobalForwardingRuleSettings = settings.setTargetGlobalForwardingRuleSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteGlobalForwardingRuleSettings,
-          getGlobalForwardingRuleSettings,
-          insertGlobalForwardingRuleSettings,
-          listGlobalForwardingRulesSettings,
-          setTargetGlobalForwardingRuleSettings
-      );
+      setTargetGlobalForwardingRuleSettings =
+          settings.setTargetGlobalForwardingRuleSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteGlobalForwardingRuleSettings,
+              getGlobalForwardingRuleSettings,
+              insertGlobalForwardingRuleSettings,
+              listGlobalForwardingRulesSettings,
+              setTargetGlobalForwardingRuleSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -431,38 +447,35 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to deleteGlobalForwardingRule. */ + public UnaryCallSettings.Builder + deleteGlobalForwardingRuleSettings() { return deleteGlobalForwardingRuleSettings; } - /** - * Returns the builder for the settings used for calls to getGlobalForwardingRule. - */ - public UnaryCallSettings.Builder getGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to getGlobalForwardingRule. */ + public UnaryCallSettings.Builder + getGlobalForwardingRuleSettings() { return getGlobalForwardingRuleSettings; } - /** - * Returns the builder for the settings used for calls to insertGlobalForwardingRule. - */ - public UnaryCallSettings.Builder insertGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to insertGlobalForwardingRule. */ + public UnaryCallSettings.Builder + insertGlobalForwardingRuleSettings() { return insertGlobalForwardingRuleSettings; } - /** - * Returns the builder for the settings used for calls to listGlobalForwardingRules. - */ - public PagedCallSettings.Builder listGlobalForwardingRulesSettings() { + /** Returns the builder for the settings used for calls to listGlobalForwardingRules. */ + public PagedCallSettings.Builder< + ListGlobalForwardingRulesHttpRequest, ForwardingRuleList, + ListGlobalForwardingRulesPagedResponse> + listGlobalForwardingRulesSettings() { return listGlobalForwardingRulesSettings; } - /** - * Returns the builder for the settings used for calls to setTargetGlobalForwardingRule. - */ - public UnaryCallSettings.Builder setTargetGlobalForwardingRuleSettings() { + /** Returns the builder for the settings used for calls to setTargetGlobalForwardingRule. */ + public UnaryCallSettings.Builder + setTargetGlobalForwardingRuleSettings() { return setTargetGlobalForwardingRuleSettings; } @@ -471,4 +484,4 @@ public GlobalForwardingRuleStubSettings build() throws IOException { return new GlobalForwardingRuleStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java index fa2e65636ded..960cea4fd932 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java @@ -15,21 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; -import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; -import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationAggregatedList; import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.OperationsScopedList; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectOperationName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -42,15 +40,19 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalOperationStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListGlobalOperationsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListGlobalOperationsPagedCallable()"); + public UnaryCallable< + AggregatedListGlobalOperationsHttpRequest, AggregatedListGlobalOperationsPagedResponse> + aggregatedListGlobalOperationsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListGlobalOperationsPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListGlobalOperationsCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListGlobalOperationsCallable()"); + public UnaryCallable + aggregatedListGlobalOperationsCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListGlobalOperationsCallable()"); } @BetaApi @@ -64,13 +66,17 @@ public UnaryCallable getGlobalOperatio } @BetaApi - public UnaryCallable listGlobalOperationsPagedCallable() { + public UnaryCallable + listGlobalOperationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalOperationsPagedCallable()"); } @BetaApi - public UnaryCallable listGlobalOperationsCallable() { + public UnaryCallable + listGlobalOperationsCallable() { throw new UnsupportedOperationException("Not implemented: listGlobalOperationsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java index 7dbfc3f4629f..14da8f82bd91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +40,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; -import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; -import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationAggregatedList; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteGlobalOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteGlobalOperation to 30 seconds: * *

  * 
@@ -93,52 +87,54 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class GlobalOperationStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListGlobalOperationsSettings;
-  private final UnaryCallSettings deleteGlobalOperationSettings;
-  private final UnaryCallSettings getGlobalOperationSettings;
-  private final PagedCallSettings listGlobalOperationsSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListGlobalOperations.
-   */
-  public PagedCallSettings aggregatedListGlobalOperationsSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+          AggregatedListGlobalOperationsPagedResponse>
+      aggregatedListGlobalOperationsSettings;
+  private final UnaryCallSettings
+      deleteGlobalOperationSettings;
+  private final UnaryCallSettings
+      getGlobalOperationSettings;
+  private final PagedCallSettings<
+          ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse>
+      listGlobalOperationsSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListGlobalOperations. */
+  public PagedCallSettings<
+          AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+          AggregatedListGlobalOperationsPagedResponse>
+      aggregatedListGlobalOperationsSettings() {
     return aggregatedListGlobalOperationsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteGlobalOperation.
-   */
+  /** Returns the object with the settings used for calls to deleteGlobalOperation. */
   public UnaryCallSettings deleteGlobalOperationSettings() {
     return deleteGlobalOperationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getGlobalOperation.
-   */
+  /** Returns the object with the settings used for calls to getGlobalOperation. */
   public UnaryCallSettings getGlobalOperationSettings() {
     return getGlobalOperationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listGlobalOperations.
-   */
-  public PagedCallSettings listGlobalOperationsSettings() {
+  /** Returns the object with the settings used for calls to listGlobalOperations. */
+  public PagedCallSettings<
+          ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse>
+      listGlobalOperationsSettings() {
     return listGlobalOperationsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public GlobalOperationStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -151,47 +147,34 @@ public GlobalOperationStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -202,27 +185,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GlobalOperationStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(GlobalOperationStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -230,130 +210,172 @@ public Builder toBuilder() {
   protected GlobalOperationStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListGlobalOperationsSettings = settingsBuilder.aggregatedListGlobalOperationsSettings().build();
+    aggregatedListGlobalOperationsSettings =
+        settingsBuilder.aggregatedListGlobalOperationsSettings().build();
     deleteGlobalOperationSettings = settingsBuilder.deleteGlobalOperationSettings().build();
     getGlobalOperationSettings = settingsBuilder.getGlobalOperationSettings().build();
     listGlobalOperationsSettings = settingsBuilder.listGlobalOperationsSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListGlobalOperationsHttpRequest injectToken(AggregatedListGlobalOperationsHttpRequest payload, String token) {
-          return AggregatedListGlobalOperationsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListGlobalOperationsHttpRequest injectPageSize(AggregatedListGlobalOperationsHttpRequest payload, int pageSize) {
-          return AggregatedListGlobalOperationsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListGlobalOperationsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(OperationAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(OperationAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListGlobalOperationsHttpRequest injectToken(ListGlobalOperationsHttpRequest payload, String token) {
-          return ListGlobalOperationsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListGlobalOperationsHttpRequest injectPageSize(ListGlobalOperationsHttpRequest payload, int pageSize) {
-          return ListGlobalOperationsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListGlobalOperationsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(OperationList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(OperationList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListGlobalOperationsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC, request, context);
-          return AggregatedListGlobalOperationsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListGlobalOperationsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC, request, context);
-          return ListGlobalOperationsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for GlobalOperationStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, OperationsScopedList>
+      AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+              OperationsScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListGlobalOperationsHttpRequest injectToken(
+                AggregatedListGlobalOperationsHttpRequest payload, String token) {
+              return AggregatedListGlobalOperationsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListGlobalOperationsHttpRequest injectPageSize(
+                AggregatedListGlobalOperationsHttpRequest payload, int pageSize) {
+              return AggregatedListGlobalOperationsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListGlobalOperationsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(OperationAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                OperationAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListGlobalOperationsHttpRequest, OperationList, Operation>
+      LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListGlobalOperationsHttpRequest injectToken(
+                ListGlobalOperationsHttpRequest payload, String token) {
+              return ListGlobalOperationsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListGlobalOperationsHttpRequest injectPageSize(
+                ListGlobalOperationsHttpRequest payload, int pageSize) {
+              return ListGlobalOperationsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListGlobalOperationsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(OperationList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(OperationList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+          AggregatedListGlobalOperationsPagedResponse>
+      AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+              AggregatedListGlobalOperationsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListGlobalOperationsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+                      OperationsScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListGlobalOperationsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse>
+      LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListGlobalOperationsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(
+                      callable, LIST_GLOBAL_OPERATIONS_PAGE_STR_DESC, request, context);
+              return ListGlobalOperationsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for GlobalOperationStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListGlobalOperationsSettings;
-    private final UnaryCallSettings.Builder deleteGlobalOperationSettings;
-    private final UnaryCallSettings.Builder getGlobalOperationSettings;
-    private final PagedCallSettings.Builder listGlobalOperationsSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList,
+            AggregatedListGlobalOperationsPagedResponse>
+        aggregatedListGlobalOperationsSettings;
+    private final UnaryCallSettings.Builder
+        deleteGlobalOperationSettings;
+    private final UnaryCallSettings.Builder
+        getGlobalOperationSettings;
+    private final PagedCallSettings.Builder<
+            ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse>
+        listGlobalOperationsSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -362,15 +384,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -382,22 +405,22 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListGlobalOperationsSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT);
+      aggregatedListGlobalOperationsSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT);
 
       deleteGlobalOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getGlobalOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listGlobalOperationsSettings = PagedCallSettings.newBuilder(
-          LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT);
+      listGlobalOperationsSettings =
+          PagedCallSettings.newBuilder(LIST_GLOBAL_OPERATIONS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListGlobalOperationsSettings,
-          deleteGlobalOperationSettings,
-          getGlobalOperationSettings,
-          listGlobalOperationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListGlobalOperationsSettings,
+              deleteGlobalOperationSettings,
+              getGlobalOperationSettings,
+              listGlobalOperationsSettings);
 
       initDefaults(this);
     }
@@ -413,19 +436,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListGlobalOperationsSettings()
+      builder
+          .aggregatedListGlobalOperationsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteGlobalOperationSettings()
+      builder
+          .deleteGlobalOperationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getGlobalOperationSettings()
+      builder
+          .getGlobalOperationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listGlobalOperationsSettings()
+      builder
+          .listGlobalOperationsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -435,25 +462,28 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(GlobalOperationStubSettings settings) {
       super(settings);
 
-      aggregatedListGlobalOperationsSettings = settings.aggregatedListGlobalOperationsSettings.toBuilder();
+      aggregatedListGlobalOperationsSettings =
+          settings.aggregatedListGlobalOperationsSettings.toBuilder();
       deleteGlobalOperationSettings = settings.deleteGlobalOperationSettings.toBuilder();
       getGlobalOperationSettings = settings.getGlobalOperationSettings.toBuilder();
       listGlobalOperationsSettings = settings.listGlobalOperationsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListGlobalOperationsSettings,
-          deleteGlobalOperationSettings,
-          getGlobalOperationSettings,
-          listGlobalOperationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListGlobalOperationsSettings,
+              deleteGlobalOperationSettings,
+              getGlobalOperationSettings,
+              listGlobalOperationsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -462,31 +492,30 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListGlobalOperationsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListGlobalOperations. */ + public PagedCallSettings.Builder< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList, + AggregatedListGlobalOperationsPagedResponse> + aggregatedListGlobalOperationsSettings() { return aggregatedListGlobalOperationsSettings; } - /** - * Returns the builder for the settings used for calls to deleteGlobalOperation. - */ - public UnaryCallSettings.Builder deleteGlobalOperationSettings() { + /** Returns the builder for the settings used for calls to deleteGlobalOperation. */ + public UnaryCallSettings.Builder + deleteGlobalOperationSettings() { return deleteGlobalOperationSettings; } - /** - * Returns the builder for the settings used for calls to getGlobalOperation. - */ - public UnaryCallSettings.Builder getGlobalOperationSettings() { + /** Returns the builder for the settings used for calls to getGlobalOperation. */ + public UnaryCallSettings.Builder + getGlobalOperationSettings() { return getGlobalOperationSettings; } - /** - * Returns the builder for the settings used for calls to listGlobalOperations. - */ - public PagedCallSettings.Builder listGlobalOperationsSettings() { + /** Returns the builder for the settings used for calls to listGlobalOperations. */ + public PagedCallSettings.Builder< + ListGlobalOperationsHttpRequest, OperationList, ListGlobalOperationsPagedResponse> + listGlobalOperationsSettings() { return listGlobalOperationsSettings; } @@ -495,4 +524,4 @@ public GlobalOperationStubSettings build() throws IOException { return new GlobalOperationStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java index 9b223b55ab74..89da3e1c0dfa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java @@ -15,20 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; import com.google.cloud.compute.v1.HealthCheck; -import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; import com.google.cloud.compute.v1.HealthCheckList; import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHealthCheckName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; import javax.annotation.Generated; @@ -42,7 +41,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HealthCheckStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: deleteHealthCheckCallable()"); @@ -59,7 +57,8 @@ public UnaryCallable insertHealthCheckC } @BetaApi - public UnaryCallable listHealthChecksPagedCallable() { + public UnaryCallable + listHealthChecksPagedCallable() { throw new UnsupportedOperationException("Not implemented: listHealthChecksPagedCallable()"); } @@ -78,4 +77,6 @@ public UnaryCallable updateHealthCheckC throw new UnsupportedOperationException("Not implemented: updateHealthCheckCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java index b48d80f4ffd0..5bb0370845e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,11 +39,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; import com.google.cloud.compute.v1.HealthCheck; -import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; import com.google.cloud.compute.v1.HealthCheckList; import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteHealthCheck to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteHealthCheck to 30 seconds: * *

  * 
@@ -93,68 +87,61 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class HealthCheckStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteHealthCheckSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteHealthCheckSettings;
   private final UnaryCallSettings getHealthCheckSettings;
-  private final UnaryCallSettings insertHealthCheckSettings;
-  private final PagedCallSettings listHealthChecksSettings;
+  private final UnaryCallSettings
+      insertHealthCheckSettings;
+  private final PagedCallSettings<
+          ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse>
+      listHealthChecksSettings;
   private final UnaryCallSettings patchHealthCheckSettings;
-  private final UnaryCallSettings updateHealthCheckSettings;
+  private final UnaryCallSettings
+      updateHealthCheckSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to deleteHealthCheck. */
   public UnaryCallSettings deleteHealthCheckSettings() {
     return deleteHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to getHealthCheck. */
   public UnaryCallSettings getHealthCheckSettings() {
     return getHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to insertHealthCheck. */
   public UnaryCallSettings insertHealthCheckSettings() {
     return insertHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listHealthChecks.
-   */
-  public PagedCallSettings listHealthChecksSettings() {
+  /** Returns the object with the settings used for calls to listHealthChecks. */
+  public PagedCallSettings<
+          ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse>
+      listHealthChecksSettings() {
     return listHealthChecksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to patchHealthCheck. */
   public UnaryCallSettings patchHealthCheckSettings() {
     return patchHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateHealthCheck.
-   */
+  /** Returns the object with the settings used for calls to updateHealthCheck. */
   public UnaryCallSettings updateHealthCheckSettings() {
     return updateHealthCheckSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public HealthCheckStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +154,34 @@ public HealthCheckStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +192,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(HealthCheckStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(HealthCheckStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +225,92 @@ protected HealthCheckStubSettings(Builder settingsBuilder) throws IOException {
     updateHealthCheckSettings = settingsBuilder.updateHealthCheckSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_HEALTH_CHECKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListHealthChecksHttpRequest injectToken(ListHealthChecksHttpRequest payload, String token) {
-          return ListHealthChecksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListHealthChecksHttpRequest injectPageSize(ListHealthChecksHttpRequest payload, int pageSize) {
-          return ListHealthChecksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListHealthChecksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(HealthCheckList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(HealthCheckList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_HEALTH_CHECKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListHealthChecksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_HEALTH_CHECKS_PAGE_STR_DESC, request, context);
-          return ListHealthChecksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for HealthCheckStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListHealthChecksHttpRequest, HealthCheckList, HealthCheck>
+      LIST_HEALTH_CHECKS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListHealthChecksHttpRequest injectToken(
+                ListHealthChecksHttpRequest payload, String token) {
+              return ListHealthChecksHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListHealthChecksHttpRequest injectPageSize(
+                ListHealthChecksHttpRequest payload, int pageSize) {
+              return ListHealthChecksHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListHealthChecksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(HealthCheckList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(HealthCheckList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse>
+      LIST_HEALTH_CHECKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListHealthChecksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_HEALTH_CHECKS_PAGE_STR_DESC, request, context);
+              return ListHealthChecksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for HealthCheckStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteHealthCheckSettings;
-    private final UnaryCallSettings.Builder getHealthCheckSettings;
-    private final UnaryCallSettings.Builder insertHealthCheckSettings;
-    private final PagedCallSettings.Builder listHealthChecksSettings;
-    private final UnaryCallSettings.Builder patchHealthCheckSettings;
-    private final UnaryCallSettings.Builder updateHealthCheckSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        getHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        insertHealthCheckSettings;
+    private final PagedCallSettings.Builder<
+            ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse>
+        listHealthChecksSettings;
+    private final UnaryCallSettings.Builder
+        patchHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        updateHealthCheckSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +319,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +346,20 @@ protected Builder(ClientContext clientContext) {
 
       insertHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listHealthChecksSettings = PagedCallSettings.newBuilder(
-          LIST_HEALTH_CHECKS_PAGE_STR_FACT);
+      listHealthChecksSettings = PagedCallSettings.newBuilder(LIST_HEALTH_CHECKS_PAGE_STR_FACT);
 
       patchHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteHealthCheckSettings,
-          getHealthCheckSettings,
-          insertHealthCheckSettings,
-          listHealthChecksSettings,
-          patchHealthCheckSettings,
-          updateHealthCheckSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteHealthCheckSettings,
+              getHealthCheckSettings,
+              insertHealthCheckSettings,
+              listHealthChecksSettings,
+              patchHealthCheckSettings,
+              updateHealthCheckSettings);
 
       initDefaults(this);
     }
@@ -390,27 +375,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteHealthCheckSettings()
+      builder
+          .deleteHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getHealthCheckSettings()
+      builder
+          .getHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertHealthCheckSettings()
+      builder
+          .insertHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listHealthChecksSettings()
+      builder
+          .listHealthChecksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchHealthCheckSettings()
+      builder
+          .patchHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateHealthCheckSettings()
+      builder
+          .updateHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +418,24 @@ protected Builder(HealthCheckStubSettings settings) {
       patchHealthCheckSettings = settings.patchHealthCheckSettings.toBuilder();
       updateHealthCheckSettings = settings.updateHealthCheckSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteHealthCheckSettings,
-          getHealthCheckSettings,
-          insertHealthCheckSettings,
-          listHealthChecksSettings,
-          patchHealthCheckSettings,
-          updateHealthCheckSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteHealthCheckSettings,
+              getHealthCheckSettings,
+              insertHealthCheckSettings,
+              listHealthChecksSettings,
+              patchHealthCheckSettings,
+              updateHealthCheckSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +444,40 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteHealthCheckSettings() { + /** Returns the builder for the settings used for calls to deleteHealthCheck. */ + public UnaryCallSettings.Builder + deleteHealthCheckSettings() { return deleteHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to getHealthCheck. - */ - public UnaryCallSettings.Builder getHealthCheckSettings() { + /** Returns the builder for the settings used for calls to getHealthCheck. */ + public UnaryCallSettings.Builder + getHealthCheckSettings() { return getHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to insertHealthCheck. - */ - public UnaryCallSettings.Builder insertHealthCheckSettings() { + /** Returns the builder for the settings used for calls to insertHealthCheck. */ + public UnaryCallSettings.Builder + insertHealthCheckSettings() { return insertHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to listHealthChecks. - */ - public PagedCallSettings.Builder listHealthChecksSettings() { + /** Returns the builder for the settings used for calls to listHealthChecks. */ + public PagedCallSettings.Builder< + ListHealthChecksHttpRequest, HealthCheckList, ListHealthChecksPagedResponse> + listHealthChecksSettings() { return listHealthChecksSettings; } - /** - * Returns the builder for the settings used for calls to patchHealthCheck. - */ - public UnaryCallSettings.Builder patchHealthCheckSettings() { + /** Returns the builder for the settings used for calls to patchHealthCheck. */ + public UnaryCallSettings.Builder + patchHealthCheckSettings() { return patchHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to updateHealthCheck. - */ - public UnaryCallSettings.Builder updateHealthCheckSettings() { + /** Returns the builder for the settings used for calls to updateHealthCheck. */ + public UnaryCallSettings.Builder + updateHealthCheckSettings() { return updateHealthCheckSettings; } @@ -498,4 +486,4 @@ public HealthCheckStubSettings build() throws IOException { return new HealthCheckStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java index 6654c52ee485..cb558664719b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java @@ -15,20 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpHealthCheck; -import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHttpHealthCheckName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; import javax.annotation.Generated; @@ -42,29 +41,33 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HttpHealthCheckStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteHttpHealthCheckCallable() { + public UnaryCallable + deleteHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: deleteHttpHealthCheckCallable()"); } @BetaApi - public UnaryCallable getHttpHealthCheckCallable() { + public UnaryCallable + getHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpHealthCheckCallable()"); } @BetaApi - public UnaryCallable insertHttpHealthCheckCallable() { + public UnaryCallable + insertHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: insertHttpHealthCheckCallable()"); } @BetaApi - public UnaryCallable listHttpHealthChecksPagedCallable() { + public UnaryCallable + listHttpHealthChecksPagedCallable() { throw new UnsupportedOperationException("Not implemented: listHttpHealthChecksPagedCallable()"); } @BetaApi - public UnaryCallable listHttpHealthChecksCallable() { + public UnaryCallable + listHttpHealthChecksCallable() { throw new UnsupportedOperationException("Not implemented: listHttpHealthChecksCallable()"); } @@ -74,8 +77,11 @@ public UnaryCallable patchHttpHealth } @BetaApi - public UnaryCallable updateHttpHealthCheckCallable() { + public UnaryCallable + updateHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: updateHttpHealthCheckCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java index 8a3145f503f5..2b87e564af72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,11 +39,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpHealthCheck; -import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteHttpHealthCheck to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteHttpHealthCheck to 30 seconds: * *

  * 
@@ -93,68 +87,68 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class HttpHealthCheckStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteHttpHealthCheckSettings;
-  private final UnaryCallSettings getHttpHealthCheckSettings;
-  private final UnaryCallSettings insertHttpHealthCheckSettings;
-  private final PagedCallSettings listHttpHealthChecksSettings;
-  private final UnaryCallSettings patchHttpHealthCheckSettings;
-  private final UnaryCallSettings updateHttpHealthCheckSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteHttpHealthCheck.
-   */
-  public UnaryCallSettings deleteHttpHealthCheckSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteHttpHealthCheckSettings;
+  private final UnaryCallSettings
+      getHttpHealthCheckSettings;
+  private final UnaryCallSettings
+      insertHttpHealthCheckSettings;
+  private final PagedCallSettings<
+          ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse>
+      listHttpHealthChecksSettings;
+  private final UnaryCallSettings
+      patchHttpHealthCheckSettings;
+  private final UnaryCallSettings
+      updateHttpHealthCheckSettings;
+
+  /** Returns the object with the settings used for calls to deleteHttpHealthCheck. */
+  public UnaryCallSettings
+      deleteHttpHealthCheckSettings() {
     return deleteHttpHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHttpHealthCheck.
-   */
-  public UnaryCallSettings getHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to getHttpHealthCheck. */
+  public UnaryCallSettings
+      getHttpHealthCheckSettings() {
     return getHttpHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertHttpHealthCheck.
-   */
-  public UnaryCallSettings insertHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to insertHttpHealthCheck. */
+  public UnaryCallSettings
+      insertHttpHealthCheckSettings() {
     return insertHttpHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listHttpHealthChecks.
-   */
-  public PagedCallSettings listHttpHealthChecksSettings() {
+  /** Returns the object with the settings used for calls to listHttpHealthChecks. */
+  public PagedCallSettings<
+          ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse>
+      listHttpHealthChecksSettings() {
     return listHttpHealthChecksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchHttpHealthCheck.
-   */
-  public UnaryCallSettings patchHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to patchHttpHealthCheck. */
+  public UnaryCallSettings
+      patchHttpHealthCheckSettings() {
     return patchHttpHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateHttpHealthCheck.
-   */
-  public UnaryCallSettings updateHttpHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to updateHttpHealthCheck. */
+  public UnaryCallSettings
+      updateHttpHealthCheckSettings() {
     return updateHttpHealthCheckSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public HttpHealthCheckStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +161,34 @@ public HttpHealthCheckStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +199,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(HttpHealthCheckStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(HttpHealthCheckStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +232,98 @@ protected HttpHealthCheckStubSettings(Builder settingsBuilder) throws IOExceptio
     updateHttpHealthCheckSettings = settingsBuilder.updateHttpHealthCheckSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListHttpHealthChecksHttpRequest injectToken(ListHttpHealthChecksHttpRequest payload, String token) {
-          return ListHttpHealthChecksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListHttpHealthChecksHttpRequest injectPageSize(ListHttpHealthChecksHttpRequest payload, int pageSize) {
-          return ListHttpHealthChecksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListHttpHealthChecksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(HttpHealthCheckList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(HttpHealthCheckList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_HTTP_HEALTH_CHECKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListHttpHealthChecksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC, request, context);
-          return ListHttpHealthChecksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for HttpHealthCheckStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck>
+      LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListHttpHealthChecksHttpRequest injectToken(
+                ListHttpHealthChecksHttpRequest payload, String token) {
+              return ListHttpHealthChecksHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListHttpHealthChecksHttpRequest injectPageSize(
+                ListHttpHealthChecksHttpRequest payload, int pageSize) {
+              return ListHttpHealthChecksHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListHttpHealthChecksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(HttpHealthCheckList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(HttpHealthCheckList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse>
+      LIST_HTTP_HEALTH_CHECKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListHttpHealthChecksHttpRequest, HttpHealthCheckList,
+              ListHttpHealthChecksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListHttpHealthChecksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC, request, context);
+              return ListHttpHealthChecksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for HttpHealthCheckStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteHttpHealthCheckSettings;
-    private final UnaryCallSettings.Builder getHttpHealthCheckSettings;
-    private final UnaryCallSettings.Builder insertHttpHealthCheckSettings;
-    private final PagedCallSettings.Builder listHttpHealthChecksSettings;
-    private final UnaryCallSettings.Builder patchHttpHealthCheckSettings;
-    private final UnaryCallSettings.Builder updateHttpHealthCheckSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteHttpHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        getHttpHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        insertHttpHealthCheckSettings;
+    private final PagedCallSettings.Builder<
+            ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse>
+        listHttpHealthChecksSettings;
+    private final UnaryCallSettings.Builder
+        patchHttpHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        updateHttpHealthCheckSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +332,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +359,21 @@ protected Builder(ClientContext clientContext) {
 
       insertHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listHttpHealthChecksSettings = PagedCallSettings.newBuilder(
-          LIST_HTTP_HEALTH_CHECKS_PAGE_STR_FACT);
+      listHttpHealthChecksSettings =
+          PagedCallSettings.newBuilder(LIST_HTTP_HEALTH_CHECKS_PAGE_STR_FACT);
 
       patchHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateHttpHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteHttpHealthCheckSettings,
-          getHttpHealthCheckSettings,
-          insertHttpHealthCheckSettings,
-          listHttpHealthChecksSettings,
-          patchHttpHealthCheckSettings,
-          updateHttpHealthCheckSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteHttpHealthCheckSettings,
+              getHttpHealthCheckSettings,
+              insertHttpHealthCheckSettings,
+              listHttpHealthChecksSettings,
+              patchHttpHealthCheckSettings,
+              updateHttpHealthCheckSettings);
 
       initDefaults(this);
     }
@@ -390,27 +389,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteHttpHealthCheckSettings()
+      builder
+          .deleteHttpHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getHttpHealthCheckSettings()
+      builder
+          .getHttpHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertHttpHealthCheckSettings()
+      builder
+          .insertHttpHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listHttpHealthChecksSettings()
+      builder
+          .listHttpHealthChecksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchHttpHealthCheckSettings()
+      builder
+          .patchHttpHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateHttpHealthCheckSettings()
+      builder
+          .updateHttpHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +432,24 @@ protected Builder(HttpHealthCheckStubSettings settings) {
       patchHttpHealthCheckSettings = settings.patchHttpHealthCheckSettings.toBuilder();
       updateHttpHealthCheckSettings = settings.updateHttpHealthCheckSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteHttpHealthCheckSettings,
-          getHttpHealthCheckSettings,
-          insertHttpHealthCheckSettings,
-          listHttpHealthChecksSettings,
-          patchHttpHealthCheckSettings,
-          updateHttpHealthCheckSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteHttpHealthCheckSettings,
+              getHttpHealthCheckSettings,
+              insertHttpHealthCheckSettings,
+              listHttpHealthChecksSettings,
+              patchHttpHealthCheckSettings,
+              updateHttpHealthCheckSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +458,40 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to deleteHttpHealthCheck. */ + public UnaryCallSettings.Builder + deleteHttpHealthCheckSettings() { return deleteHttpHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to getHttpHealthCheck. - */ - public UnaryCallSettings.Builder getHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ + public UnaryCallSettings.Builder + getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to insertHttpHealthCheck. - */ - public UnaryCallSettings.Builder insertHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to insertHttpHealthCheck. */ + public UnaryCallSettings.Builder + insertHttpHealthCheckSettings() { return insertHttpHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to listHttpHealthChecks. - */ - public PagedCallSettings.Builder listHttpHealthChecksSettings() { + /** Returns the builder for the settings used for calls to listHttpHealthChecks. */ + public PagedCallSettings.Builder< + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, ListHttpHealthChecksPagedResponse> + listHttpHealthChecksSettings() { return listHttpHealthChecksSettings; } - /** - * Returns the builder for the settings used for calls to patchHttpHealthCheck. - */ - public UnaryCallSettings.Builder patchHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to patchHttpHealthCheck. */ + public UnaryCallSettings.Builder + patchHttpHealthCheckSettings() { return patchHttpHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to updateHttpHealthCheck. - */ - public UnaryCallSettings.Builder updateHttpHealthCheckSettings() { + /** Returns the builder for the settings used for calls to updateHttpHealthCheck. */ + public UnaryCallSettings.Builder + updateHttpHealthCheckSettings() { return updateHttpHealthCheckSettings; } @@ -498,4 +500,4 @@ public HttpHealthCheckStubSettings build() throws IOException { return new HttpHealthCheckStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java index 4d95989d072b..2dc7c11069a5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java @@ -15,52 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AcceleratorType; -import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; -import com.google.cloud.compute.v1.AcceleratorTypeList; -import com.google.cloud.compute.v1.AcceleratorTypeSettings; -import com.google.cloud.compute.v1.AcceleratorTypesScopedList; -import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; -import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; -import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneAcceleratorTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -77,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -94,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java index ae19f526e877..7ee7000a895c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +29,19 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AcceleratorType; import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; import com.google.cloud.compute.v1.AcceleratorTypeList; -import com.google.cloud.compute.v1.AcceleratorTypeSettings; -import com.google.cloud.compute.v1.AcceleratorTypesScopedList; import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesHttpRequest; import com.google.cloud.compute.v1.GetAcceleratorTypeHttpRequest; import com.google.cloud.compute.v1.ListAcceleratorTypesHttpRequest; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneAcceleratorTypeName; import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,151 +55,211 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListAcceleratorTypesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.acceleratorTypes.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/acceleratorTypes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AcceleratorTypeAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList> + aggregatedListAcceleratorTypesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.acceleratorTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/acceleratorTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AcceleratorTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getAcceleratorTypeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.acceleratorTypes.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAcceleratorTypeHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneAcceleratorTypeName.newFactory()) - .setResourceNameField("acceleratorType") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AcceleratorType.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getAcceleratorTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.acceleratorTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAcceleratorTypeHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneAcceleratorTypeName.newFactory()) + .setResourceNameField("acceleratorType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AcceleratorType.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listAcceleratorTypesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.acceleratorTypes.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAcceleratorTypesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/acceleratorTypes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AcceleratorTypeList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listAcceleratorTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.acceleratorTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAcceleratorTypesHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/acceleratorTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AcceleratorTypeList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListAcceleratorTypesCallable; - private final UnaryCallable aggregatedListAcceleratorTypesPagedCallable; - private final UnaryCallable getAcceleratorTypeCallable; - private final UnaryCallable listAcceleratorTypesCallable; - private final UnaryCallable listAcceleratorTypesPagedCallable; + private final UnaryCallable< + AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList> + aggregatedListAcceleratorTypesCallable; + private final UnaryCallable< + AggregatedListAcceleratorTypesHttpRequest, AggregatedListAcceleratorTypesPagedResponse> + aggregatedListAcceleratorTypesPagedCallable; + private final UnaryCallable + getAcceleratorTypeCallable; + private final UnaryCallable + listAcceleratorTypesCallable; + private final UnaryCallable + listAcceleratorTypesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonAcceleratorTypeStub create(AcceleratorTypeStubSettings settings) throws IOException { + + public static final HttpJsonAcceleratorTypeStub create(AcceleratorTypeStubSettings settings) + throws IOException { return new HttpJsonAcceleratorTypeStub(settings, ClientContext.create(settings)); } - public static final HttpJsonAcceleratorTypeStub create(ClientContext clientContext) throws IOException { - return new HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonAcceleratorTypeStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAcceleratorTypeStub( + AcceleratorTypeStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonAcceleratorTypeStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonAcceleratorTypeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAcceleratorTypeStub( + AcceleratorTypeStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonAcceleratorTypeStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonAcceleratorTypeStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonAcceleratorTypeStub( + AcceleratorTypeStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonAcceleratorTypeCallableFactory()); } /** - * Constructs an instance of HttpJsonAcceleratorTypeStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonAcceleratorTypeStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonAcceleratorTypeStub(AcceleratorTypeStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonAcceleratorTypeStub( + AcceleratorTypeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListAcceleratorTypesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListAcceleratorTypesMethodDescriptor) - .build(); - HttpJsonCallSettings getAcceleratorTypeTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getAcceleratorTypeMethodDescriptor) - .build(); - HttpJsonCallSettings listAcceleratorTypesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listAcceleratorTypesMethodDescriptor) - .build(); - - this.aggregatedListAcceleratorTypesCallable = callableFactory.createUnaryCallable(aggregatedListAcceleratorTypesTransportSettings,settings.aggregatedListAcceleratorTypesSettings(), clientContext); - this.aggregatedListAcceleratorTypesPagedCallable = callableFactory.createPagedCallable(aggregatedListAcceleratorTypesTransportSettings,settings.aggregatedListAcceleratorTypesSettings(), clientContext); - this.getAcceleratorTypeCallable = callableFactory.createUnaryCallable(getAcceleratorTypeTransportSettings,settings.getAcceleratorTypeSettings(), clientContext); - this.listAcceleratorTypesCallable = callableFactory.createUnaryCallable(listAcceleratorTypesTransportSettings,settings.listAcceleratorTypesSettings(), clientContext); - this.listAcceleratorTypesPagedCallable = callableFactory.createPagedCallable(listAcceleratorTypesTransportSettings,settings.listAcceleratorTypesSettings(), clientContext); + HttpJsonCallSettings + aggregatedListAcceleratorTypesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListAcceleratorTypesMethodDescriptor) + .build(); + HttpJsonCallSettings + getAcceleratorTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAcceleratorTypeMethodDescriptor) + .build(); + HttpJsonCallSettings + listAcceleratorTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAcceleratorTypesMethodDescriptor) + .build(); + + this.aggregatedListAcceleratorTypesCallable = + callableFactory.createUnaryCallable( + aggregatedListAcceleratorTypesTransportSettings, + settings.aggregatedListAcceleratorTypesSettings(), + clientContext); + this.aggregatedListAcceleratorTypesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListAcceleratorTypesTransportSettings, + settings.aggregatedListAcceleratorTypesSettings(), + clientContext); + this.getAcceleratorTypeCallable = + callableFactory.createUnaryCallable( + getAcceleratorTypeTransportSettings, + settings.getAcceleratorTypeSettings(), + clientContext); + this.listAcceleratorTypesCallable = + callableFactory.createUnaryCallable( + listAcceleratorTypesTransportSettings, + settings.listAcceleratorTypesSettings(), + clientContext); + this.listAcceleratorTypesPagedCallable = + callableFactory.createPagedCallable( + listAcceleratorTypesTransportSettings, + settings.listAcceleratorTypesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListAcceleratorTypesPagedCallable() { + public UnaryCallable< + AggregatedListAcceleratorTypesHttpRequest, AggregatedListAcceleratorTypesPagedResponse> + aggregatedListAcceleratorTypesPagedCallable() { return aggregatedListAcceleratorTypesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListAcceleratorTypesCallable() { + public UnaryCallable + aggregatedListAcceleratorTypesCallable() { return aggregatedListAcceleratorTypesCallable; } @BetaApi - public UnaryCallable getAcceleratorTypeCallable() { + public UnaryCallable + getAcceleratorTypeCallable() { return getAcceleratorTypeCallable; } @BetaApi - public UnaryCallable listAcceleratorTypesPagedCallable() { + public UnaryCallable + listAcceleratorTypesPagedCallable() { return listAcceleratorTypesPagedCallable; } @BetaApi - public UnaryCallable listAcceleratorTypesCallable() { + public UnaryCallable + listAcceleratorTypesCallable() { return listAcceleratorTypesCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -233,5 +287,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java index 9af87f4a03f3..aa9f8db412cf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.Address; -import com.google.cloud.compute.v1.AddressAggregatedList; -import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; -import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; -import com.google.cloud.compute.v1.AddressList; -import com.google.cloud.compute.v1.AddressSettings; -import com.google.cloud.compute.v1.AddressesScopedList; -import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; -import com.google.cloud.compute.v1.DeleteAddressHttpRequest; -import com.google.cloud.compute.v1.GetAddressHttpRequest; -import com.google.cloud.compute.v1.InsertAddressHttpRequest; -import com.google.cloud.compute.v1.ListAddressesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionAddressName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java index 6794575e870c..d22b7746cecc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,16 +29,11 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.Address; import com.google.cloud.compute.v1.AddressAggregatedList; -import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; -import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; import com.google.cloud.compute.v1.AddressList; -import com.google.cloud.compute.v1.AddressSettings; -import com.google.cloud.compute.v1.AddressesScopedList; import com.google.cloud.compute.v1.AggregatedListAddressesHttpRequest; import com.google.cloud.compute.v1.DeleteAddressHttpRequest; import com.google.cloud.compute.v1.GetAddressHttpRequest; @@ -45,12 +43,8 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectRegionAddressName; import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,115 +58,126 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonAddressStub extends AddressStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListAddressesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.addresses.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAddressesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/addresses")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AddressAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + aggregatedListAddressesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.addresses.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAddressesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/addresses")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AddressAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteAddressMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.addresses.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses/{address}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionAddressName.newFactory()) - .setResourceNameField("address") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/addresses/{address}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionAddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getAddressMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.addresses.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAddressHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses/{address}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionAddressName.newFactory()) - .setResourceNameField("address") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.

newBuilder() - .setResponseInstance(Address.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAddressHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/addresses/{address}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionAddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.
newBuilder() + .setResponseInstance(Address.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertAddressMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.addresses.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listAddressesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.addresses.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAddressesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AddressList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listAddressesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.addresses.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAddressesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AddressList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListAddressesCallable; - private final UnaryCallable aggregatedListAddressesPagedCallable; + private final UnaryCallable + aggregatedListAddressesCallable; + private final UnaryCallable< + AggregatedListAddressesHttpRequest, AggregatedListAddressesPagedResponse> + aggregatedListAddressesPagedCallable; private final UnaryCallable deleteAddressCallable; private final UnaryCallable getAddressCallable; private final UnaryCallable insertAddressCallable; private final UnaryCallable listAddressesCallable; - private final UnaryCallable listAddressesPagedCallable; + private final UnaryCallable + listAddressesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonAddressStub create(AddressStubSettings settings) throws IOException { return new HttpJsonAddressStub(settings, ClientContext.create(settings)); } @@ -181,31 +186,40 @@ public static final HttpJsonAddressStub create(ClientContext clientContext) thro return new HttpJsonAddressStub(AddressStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonAddressStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonAddressStub(AddressStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonAddressStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAddressStub( + AddressStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonAddressStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonAddressStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonAddressStub(AddressStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonAddressStub(AddressStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonAddressCallableFactory()); } /** - * Constructs an instance of HttpJsonAddressStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonAddressStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonAddressStub(AddressStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonAddressStub( + AddressStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListAddressesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListAddressesMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListAddressesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListAddressesMethodDescriptor) + .build(); HttpJsonCallSettings deleteAddressTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteAddressMethodDescriptor) @@ -223,24 +237,44 @@ protected HttpJsonAddressStub(AddressStubSettings settings, ClientContext client .setMethodDescriptor(listAddressesMethodDescriptor) .build(); - this.aggregatedListAddressesCallable = callableFactory.createUnaryCallable(aggregatedListAddressesTransportSettings,settings.aggregatedListAddressesSettings(), clientContext); - this.aggregatedListAddressesPagedCallable = callableFactory.createPagedCallable(aggregatedListAddressesTransportSettings,settings.aggregatedListAddressesSettings(), clientContext); - this.deleteAddressCallable = callableFactory.createUnaryCallable(deleteAddressTransportSettings,settings.deleteAddressSettings(), clientContext); - this.getAddressCallable = callableFactory.createUnaryCallable(getAddressTransportSettings,settings.getAddressSettings(), clientContext); - this.insertAddressCallable = callableFactory.createUnaryCallable(insertAddressTransportSettings,settings.insertAddressSettings(), clientContext); - this.listAddressesCallable = callableFactory.createUnaryCallable(listAddressesTransportSettings,settings.listAddressesSettings(), clientContext); - this.listAddressesPagedCallable = callableFactory.createPagedCallable(listAddressesTransportSettings,settings.listAddressesSettings(), clientContext); + this.aggregatedListAddressesCallable = + callableFactory.createUnaryCallable( + aggregatedListAddressesTransportSettings, + settings.aggregatedListAddressesSettings(), + clientContext); + this.aggregatedListAddressesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListAddressesTransportSettings, + settings.aggregatedListAddressesSettings(), + clientContext); + this.deleteAddressCallable = + callableFactory.createUnaryCallable( + deleteAddressTransportSettings, settings.deleteAddressSettings(), clientContext); + this.getAddressCallable = + callableFactory.createUnaryCallable( + getAddressTransportSettings, settings.getAddressSettings(), clientContext); + this.insertAddressCallable = + callableFactory.createUnaryCallable( + insertAddressTransportSettings, settings.insertAddressSettings(), clientContext); + this.listAddressesCallable = + callableFactory.createUnaryCallable( + listAddressesTransportSettings, settings.listAddressesSettings(), clientContext); + this.listAddressesPagedCallable = + callableFactory.createPagedCallable( + listAddressesTransportSettings, settings.listAddressesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListAddressesPagedCallable() { + public UnaryCallable + aggregatedListAddressesPagedCallable() { return aggregatedListAddressesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListAddressesCallable() { + public UnaryCallable + aggregatedListAddressesCallable() { return aggregatedListAddressesCallable; } @@ -260,7 +294,8 @@ public UnaryCallable insertAddressCallable( } @BetaApi - public UnaryCallable listAddressesPagedCallable() { + public UnaryCallable + listAddressesPagedCallable() { return listAddressesPagedCallable; } @@ -270,7 +305,7 @@ public UnaryCallable listAddressesCallabl } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -298,5 +333,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java index 6acda02bd88a..c718fce34b67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java @@ -15,56 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; -import com.google.cloud.compute.v1.Autoscaler; -import com.google.cloud.compute.v1.AutoscalerAggregatedList; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; -import com.google.cloud.compute.v1.AutoscalerList; -import com.google.cloud.compute.v1.AutoscalerSettings; -import com.google.cloud.compute.v1.AutoscalersScopedList; -import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; -import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; -import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; -import com.google.cloud.compute.v1.ListAutoscalersHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchAutoscalerHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneAutoscalerName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -81,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -98,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java index af8d39ec32a9..2de882f98e2a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,17 +29,12 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListAutoscalersHttpRequest; import com.google.cloud.compute.v1.Autoscaler; import com.google.cloud.compute.v1.AutoscalerAggregatedList; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; import com.google.cloud.compute.v1.AutoscalerList; -import com.google.cloud.compute.v1.AutoscalerSettings; -import com.google.cloud.compute.v1.AutoscalersScopedList; import com.google.cloud.compute.v1.DeleteAutoscalerHttpRequest; import com.google.cloud.compute.v1.GetAutoscalerHttpRequest; import com.google.cloud.compute.v1.InsertAutoscalerHttpRequest; @@ -47,12 +45,8 @@ import com.google.cloud.compute.v1.ProjectZoneAutoscalerName; import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.UpdateAutoscalerHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -66,190 +60,213 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonAutoscalerStub extends AutoscalerStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListAutoscalersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAutoscalersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/autoscalers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AutoscalerAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListAutoscalersHttpRequest, AutoscalerAggregatedList> + aggregatedListAutoscalersMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.autoscalers.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAutoscalersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/autoscalers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AutoscalerAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneAutoscalerName.newFactory()) - .setResourceNameField("autoscaler") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneAutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneAutoscalerName.newFactory()) - .setResourceNameField("autoscaler") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Autoscaler.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneAutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Autoscaler.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listAutoscalersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAutoscalersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AutoscalerList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listAutoscalersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAutoscalersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AutoscalerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "autoscaler", "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.autoscalers.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "autoscaler", "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.autoscalers.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) + .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListAutoscalersCallable; - private final UnaryCallable aggregatedListAutoscalersPagedCallable; + private final UnaryCallable + aggregatedListAutoscalersCallable; + private final UnaryCallable< + AggregatedListAutoscalersHttpRequest, AggregatedListAutoscalersPagedResponse> + aggregatedListAutoscalersPagedCallable; private final UnaryCallable deleteAutoscalerCallable; private final UnaryCallable getAutoscalerCallable; private final UnaryCallable insertAutoscalerCallable; private final UnaryCallable listAutoscalersCallable; - private final UnaryCallable listAutoscalersPagedCallable; + private final UnaryCallable + listAutoscalersPagedCallable; private final UnaryCallable patchAutoscalerCallable; private final UnaryCallable updateAutoscalerCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonAutoscalerStub create(AutoscalerStubSettings settings) throws IOException { + + public static final HttpJsonAutoscalerStub create(AutoscalerStubSettings settings) + throws IOException { return new HttpJsonAutoscalerStub(settings, ClientContext.create(settings)); } - public static final HttpJsonAutoscalerStub create(ClientContext clientContext) throws IOException { + public static final HttpJsonAutoscalerStub create(ClientContext clientContext) + throws IOException { return new HttpJsonAutoscalerStub(AutoscalerStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonAutoscalerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonAutoscalerStub(AutoscalerStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonAutoscalerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAutoscalerStub( + AutoscalerStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonAutoscalerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonAutoscalerStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonAutoscalerCallableFactory()); } /** - * Constructs an instance of HttpJsonAutoscalerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonAutoscalerStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonAutoscalerStub( + AutoscalerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListAutoscalersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListAutoscalersMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListAutoscalersTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListAutoscalersMethodDescriptor) + .build(); HttpJsonCallSettings deleteAutoscalerTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteAutoscalerMethodDescriptor) @@ -262,10 +279,11 @@ protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertAutoscalerMethodDescriptor) .build(); - HttpJsonCallSettings listAutoscalersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listAutoscalersMethodDescriptor) - .build(); + HttpJsonCallSettings + listAutoscalersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAutoscalersMethodDescriptor) + .build(); HttpJsonCallSettings patchAutoscalerTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchAutoscalerMethodDescriptor) @@ -275,26 +293,50 @@ protected HttpJsonAutoscalerStub(AutoscalerStubSettings settings, ClientContext .setMethodDescriptor(updateAutoscalerMethodDescriptor) .build(); - this.aggregatedListAutoscalersCallable = callableFactory.createUnaryCallable(aggregatedListAutoscalersTransportSettings,settings.aggregatedListAutoscalersSettings(), clientContext); - this.aggregatedListAutoscalersPagedCallable = callableFactory.createPagedCallable(aggregatedListAutoscalersTransportSettings,settings.aggregatedListAutoscalersSettings(), clientContext); - this.deleteAutoscalerCallable = callableFactory.createUnaryCallable(deleteAutoscalerTransportSettings,settings.deleteAutoscalerSettings(), clientContext); - this.getAutoscalerCallable = callableFactory.createUnaryCallable(getAutoscalerTransportSettings,settings.getAutoscalerSettings(), clientContext); - this.insertAutoscalerCallable = callableFactory.createUnaryCallable(insertAutoscalerTransportSettings,settings.insertAutoscalerSettings(), clientContext); - this.listAutoscalersCallable = callableFactory.createUnaryCallable(listAutoscalersTransportSettings,settings.listAutoscalersSettings(), clientContext); - this.listAutoscalersPagedCallable = callableFactory.createPagedCallable(listAutoscalersTransportSettings,settings.listAutoscalersSettings(), clientContext); - this.patchAutoscalerCallable = callableFactory.createUnaryCallable(patchAutoscalerTransportSettings,settings.patchAutoscalerSettings(), clientContext); - this.updateAutoscalerCallable = callableFactory.createUnaryCallable(updateAutoscalerTransportSettings,settings.updateAutoscalerSettings(), clientContext); + this.aggregatedListAutoscalersCallable = + callableFactory.createUnaryCallable( + aggregatedListAutoscalersTransportSettings, + settings.aggregatedListAutoscalersSettings(), + clientContext); + this.aggregatedListAutoscalersPagedCallable = + callableFactory.createPagedCallable( + aggregatedListAutoscalersTransportSettings, + settings.aggregatedListAutoscalersSettings(), + clientContext); + this.deleteAutoscalerCallable = + callableFactory.createUnaryCallable( + deleteAutoscalerTransportSettings, settings.deleteAutoscalerSettings(), clientContext); + this.getAutoscalerCallable = + callableFactory.createUnaryCallable( + getAutoscalerTransportSettings, settings.getAutoscalerSettings(), clientContext); + this.insertAutoscalerCallable = + callableFactory.createUnaryCallable( + insertAutoscalerTransportSettings, settings.insertAutoscalerSettings(), clientContext); + this.listAutoscalersCallable = + callableFactory.createUnaryCallable( + listAutoscalersTransportSettings, settings.listAutoscalersSettings(), clientContext); + this.listAutoscalersPagedCallable = + callableFactory.createPagedCallable( + listAutoscalersTransportSettings, settings.listAutoscalersSettings(), clientContext); + this.patchAutoscalerCallable = + callableFactory.createUnaryCallable( + patchAutoscalerTransportSettings, settings.patchAutoscalerSettings(), clientContext); + this.updateAutoscalerCallable = + callableFactory.createUnaryCallable( + updateAutoscalerTransportSettings, settings.updateAutoscalerSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListAutoscalersPagedCallable() { + public UnaryCallable + aggregatedListAutoscalersPagedCallable() { return aggregatedListAutoscalersPagedCallable; } @BetaApi - public UnaryCallable aggregatedListAutoscalersCallable() { + public UnaryCallable + aggregatedListAutoscalersCallable() { return aggregatedListAutoscalersCallable; } @@ -314,7 +356,8 @@ public UnaryCallable insertAutoscalerCal } @BetaApi - public UnaryCallable listAutoscalersPagedCallable() { + public UnaryCallable + listAutoscalersPagedCallable() { return listAutoscalersPagedCallable; } @@ -334,7 +377,7 @@ public UnaryCallable updateAutoscalerCal } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -362,5 +405,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java index 79f360b9b155..1b15b1414936 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.BackendBucket; -import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; -import com.google.cloud.compute.v1.BackendBucketList; -import com.google.cloud.compute.v1.BackendBucketSettings; -import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; -import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; -import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; -import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; -import com.google.cloud.compute.v1.ProjectBackendBucketName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java index d02a6973e276..407be63fe6d5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +28,21 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.BackendBucket; -import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; import com.google.cloud.compute.v1.BackendBucketList; -import com.google.cloud.compute.v1.BackendBucketSettings; import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchBackendBucketHttpRequest; -import com.google.cloud.compute.v1.ProjectBackendBucketName; +import com.google.cloud.compute.v1.ProjectGlobalBackendBucketName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateBackendBucketHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,196 +56,250 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonBackendBucketStub extends BackendBucketStub { @InternalApi - public static final ApiMethodDescriptor deleteBackendBucketMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendBuckets.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteBackendBucketHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectBackendBucketName.newFactory()) - .setResourceNameField("backendBucket") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalBackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getBackendBucketMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendBuckets.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetBackendBucketHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectBackendBucketName.newFactory()) - .setResourceNameField("backendBucket") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendBucket.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalBackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendBucket.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertBackendBucketMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendBuckets.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertBackendBucketHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listBackendBucketsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendBuckets.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListBackendBucketsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendBucketList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listBackendBucketsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListBackendBucketsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendBucketList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchBackendBucketMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendBuckets.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchBackendBucketHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectBackendBucketName.newFactory()) - .setResourceNameField("backendBucket") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalBackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateBackendBucketMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendBuckets.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateBackendBucketHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectBackendBucketName.newFactory()) - .setResourceNameField("backendBucket") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateBackendBucketMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendBuckets.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateBackendBucketHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalBackendBucketName.newFactory()) + .setResourceNameField("backendBucket") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteBackendBucketCallable; + private final UnaryCallable + deleteBackendBucketCallable; private final UnaryCallable getBackendBucketCallable; - private final UnaryCallable insertBackendBucketCallable; - private final UnaryCallable listBackendBucketsCallable; - private final UnaryCallable listBackendBucketsPagedCallable; + private final UnaryCallable + insertBackendBucketCallable; + private final UnaryCallable + listBackendBucketsCallable; + private final UnaryCallable + listBackendBucketsPagedCallable; private final UnaryCallable patchBackendBucketCallable; - private final UnaryCallable updateBackendBucketCallable; + private final UnaryCallable + updateBackendBucketCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonBackendBucketStub create(BackendBucketStubSettings settings) throws IOException { + + public static final HttpJsonBackendBucketStub create(BackendBucketStubSettings settings) + throws IOException { return new HttpJsonBackendBucketStub(settings, ClientContext.create(settings)); } - public static final HttpJsonBackendBucketStub create(ClientContext clientContext) throws IOException { - return new HttpJsonBackendBucketStub(BackendBucketStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonBackendBucketStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonBackendBucketStub( + BackendBucketStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonBackendBucketStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonBackendBucketStub(BackendBucketStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonBackendBucketStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonBackendBucketStub( + BackendBucketStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonBackendBucketStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonBackendBucketStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonBackendBucketStub(BackendBucketStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonBackendBucketStub( + BackendBucketStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonBackendBucketCallableFactory()); } /** - * Constructs an instance of HttpJsonBackendBucketStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonBackendBucketStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonBackendBucketStub(BackendBucketStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonBackendBucketStub( + BackendBucketStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteBackendBucketTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteBackendBucketMethodDescriptor) - .build(); - HttpJsonCallSettings getBackendBucketTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getBackendBucketMethodDescriptor) - .build(); - HttpJsonCallSettings insertBackendBucketTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertBackendBucketMethodDescriptor) - .build(); - HttpJsonCallSettings listBackendBucketsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listBackendBucketsMethodDescriptor) - .build(); - HttpJsonCallSettings patchBackendBucketTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchBackendBucketMethodDescriptor) - .build(); - HttpJsonCallSettings updateBackendBucketTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateBackendBucketMethodDescriptor) - .build(); - - this.deleteBackendBucketCallable = callableFactory.createUnaryCallable(deleteBackendBucketTransportSettings,settings.deleteBackendBucketSettings(), clientContext); - this.getBackendBucketCallable = callableFactory.createUnaryCallable(getBackendBucketTransportSettings,settings.getBackendBucketSettings(), clientContext); - this.insertBackendBucketCallable = callableFactory.createUnaryCallable(insertBackendBucketTransportSettings,settings.insertBackendBucketSettings(), clientContext); - this.listBackendBucketsCallable = callableFactory.createUnaryCallable(listBackendBucketsTransportSettings,settings.listBackendBucketsSettings(), clientContext); - this.listBackendBucketsPagedCallable = callableFactory.createPagedCallable(listBackendBucketsTransportSettings,settings.listBackendBucketsSettings(), clientContext); - this.patchBackendBucketCallable = callableFactory.createUnaryCallable(patchBackendBucketTransportSettings,settings.patchBackendBucketSettings(), clientContext); - this.updateBackendBucketCallable = callableFactory.createUnaryCallable(updateBackendBucketTransportSettings,settings.updateBackendBucketSettings(), clientContext); + HttpJsonCallSettings + deleteBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings + getBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings + insertBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings + listBackendBucketsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackendBucketsMethodDescriptor) + .build(); + HttpJsonCallSettings + patchBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchBackendBucketMethodDescriptor) + .build(); + HttpJsonCallSettings + updateBackendBucketTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackendBucketMethodDescriptor) + .build(); + + this.deleteBackendBucketCallable = + callableFactory.createUnaryCallable( + deleteBackendBucketTransportSettings, + settings.deleteBackendBucketSettings(), + clientContext); + this.getBackendBucketCallable = + callableFactory.createUnaryCallable( + getBackendBucketTransportSettings, settings.getBackendBucketSettings(), clientContext); + this.insertBackendBucketCallable = + callableFactory.createUnaryCallable( + insertBackendBucketTransportSettings, + settings.insertBackendBucketSettings(), + clientContext); + this.listBackendBucketsCallable = + callableFactory.createUnaryCallable( + listBackendBucketsTransportSettings, + settings.listBackendBucketsSettings(), + clientContext); + this.listBackendBucketsPagedCallable = + callableFactory.createPagedCallable( + listBackendBucketsTransportSettings, + settings.listBackendBucketsSettings(), + clientContext); + this.patchBackendBucketCallable = + callableFactory.createUnaryCallable( + patchBackendBucketTransportSettings, + settings.patchBackendBucketSettings(), + clientContext); + this.updateBackendBucketCallable = + callableFactory.createUnaryCallable( + updateBackendBucketTransportSettings, + settings.updateBackendBucketSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -271,12 +320,14 @@ public UnaryCallable insertBackendBuc } @BetaApi - public UnaryCallable listBackendBucketsPagedCallable() { + public UnaryCallable + listBackendBucketsPagedCallable() { return listBackendBucketsPagedCallable; } @BetaApi - public UnaryCallable listBackendBucketsCallable() { + public UnaryCallable + listBackendBucketsCallable() { return listBackendBucketsCallable; } @@ -291,7 +342,7 @@ public UnaryCallable updateBackendBuc } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -319,5 +370,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java index 27de4cc1ce43..d46874595c37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java @@ -15,58 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; -import com.google.cloud.compute.v1.BackendService; -import com.google.cloud.compute.v1.BackendServiceAggregatedList; -import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; -import com.google.cloud.compute.v1.BackendServiceGroupHealth; -import com.google.cloud.compute.v1.BackendServiceList; -import com.google.cloud.compute.v1.BackendServiceSettings; -import com.google.cloud.compute.v1.BackendServicesScopedList; -import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; -import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; -import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; -import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ProjectBackendServiceName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ResourceGroupReference; -import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -83,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -100,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java index 64847bc8deb7..a8e1c4acc1c4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,18 +29,13 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest; import com.google.cloud.compute.v1.BackendService; import com.google.cloud.compute.v1.BackendServiceAggregatedList; -import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; import com.google.cloud.compute.v1.BackendServiceGroupHealth; import com.google.cloud.compute.v1.BackendServiceList; -import com.google.cloud.compute.v1.BackendServiceSettings; -import com.google.cloud.compute.v1.BackendServicesScopedList; import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest; import com.google.cloud.compute.v1.GetBackendServiceHttpRequest; import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest; @@ -45,16 +43,11 @@ import com.google.cloud.compute.v1.ListBackendServicesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ProjectBackendServiceName; +import com.google.cloud.compute.v1.ProjectGlobalBackendServiceName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ResourceGroupReference; import com.google.cloud.compute.v1.UpdateBackendServiceHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -68,260 +61,353 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonBackendServiceStub extends BackendServiceStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListBackendServicesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListBackendServicesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/backendServices")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendServiceAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList> + aggregatedListBackendServicesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.backendServices.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListBackendServicesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/backendServices")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendService.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendService.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getHealthBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.getHealth") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}/getHealth")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendServiceGroupHealth.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + GetHealthBackendServiceHttpRequest, BackendServiceGroupHealth> + getHealthBackendServiceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.backendServices.getHealth") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/backendServices/{backendService}/getHealth")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceGroupHealth.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listBackendServicesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListBackendServicesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendServiceList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listBackendServicesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListBackendServicesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.backendServices.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.backendServices.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListBackendServicesCallable; - private final UnaryCallable aggregatedListBackendServicesPagedCallable; - private final UnaryCallable deleteBackendServiceCallable; - private final UnaryCallable getBackendServiceCallable; - private final UnaryCallable getHealthBackendServiceCallable; - private final UnaryCallable insertBackendServiceCallable; - private final UnaryCallable listBackendServicesCallable; - private final UnaryCallable listBackendServicesPagedCallable; - private final UnaryCallable patchBackendServiceCallable; - private final UnaryCallable updateBackendServiceCallable; + private final UnaryCallable< + AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList> + aggregatedListBackendServicesCallable; + private final UnaryCallable< + AggregatedListBackendServicesHttpRequest, AggregatedListBackendServicesPagedResponse> + aggregatedListBackendServicesPagedCallable; + private final UnaryCallable + deleteBackendServiceCallable; + private final UnaryCallable + getBackendServiceCallable; + private final UnaryCallable + getHealthBackendServiceCallable; + private final UnaryCallable + insertBackendServiceCallable; + private final UnaryCallable + listBackendServicesCallable; + private final UnaryCallable + listBackendServicesPagedCallable; + private final UnaryCallable + patchBackendServiceCallable; + private final UnaryCallable + updateBackendServiceCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonBackendServiceStub create(BackendServiceStubSettings settings) throws IOException { + + public static final HttpJsonBackendServiceStub create(BackendServiceStubSettings settings) + throws IOException { return new HttpJsonBackendServiceStub(settings, ClientContext.create(settings)); } - public static final HttpJsonBackendServiceStub create(ClientContext clientContext) throws IOException { - return new HttpJsonBackendServiceStub(BackendServiceStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonBackendServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonBackendServiceStub( + BackendServiceStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonBackendServiceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonBackendServiceStub(BackendServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonBackendServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonBackendServiceStub( + BackendServiceStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonBackendServiceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonBackendServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonBackendServiceStub(BackendServiceStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonBackendServiceStub( + BackendServiceStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonBackendServiceCallableFactory()); } /** - * Constructs an instance of HttpJsonBackendServiceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonBackendServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonBackendServiceStub(BackendServiceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonBackendServiceStub( + BackendServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListBackendServicesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListBackendServicesMethodDescriptor) - .build(); - HttpJsonCallSettings deleteBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings getBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings getHealthBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getHealthBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings insertBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings listBackendServicesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listBackendServicesMethodDescriptor) - .build(); - HttpJsonCallSettings patchBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings updateBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateBackendServiceMethodDescriptor) - .build(); - - this.aggregatedListBackendServicesCallable = callableFactory.createUnaryCallable(aggregatedListBackendServicesTransportSettings,settings.aggregatedListBackendServicesSettings(), clientContext); - this.aggregatedListBackendServicesPagedCallable = callableFactory.createPagedCallable(aggregatedListBackendServicesTransportSettings,settings.aggregatedListBackendServicesSettings(), clientContext); - this.deleteBackendServiceCallable = callableFactory.createUnaryCallable(deleteBackendServiceTransportSettings,settings.deleteBackendServiceSettings(), clientContext); - this.getBackendServiceCallable = callableFactory.createUnaryCallable(getBackendServiceTransportSettings,settings.getBackendServiceSettings(), clientContext); - this.getHealthBackendServiceCallable = callableFactory.createUnaryCallable(getHealthBackendServiceTransportSettings,settings.getHealthBackendServiceSettings(), clientContext); - this.insertBackendServiceCallable = callableFactory.createUnaryCallable(insertBackendServiceTransportSettings,settings.insertBackendServiceSettings(), clientContext); - this.listBackendServicesCallable = callableFactory.createUnaryCallable(listBackendServicesTransportSettings,settings.listBackendServicesSettings(), clientContext); - this.listBackendServicesPagedCallable = callableFactory.createPagedCallable(listBackendServicesTransportSettings,settings.listBackendServicesSettings(), clientContext); - this.patchBackendServiceCallable = callableFactory.createUnaryCallable(patchBackendServiceTransportSettings,settings.patchBackendServiceSettings(), clientContext); - this.updateBackendServiceCallable = callableFactory.createUnaryCallable(updateBackendServiceTransportSettings,settings.updateBackendServiceSettings(), clientContext); + HttpJsonCallSettings + aggregatedListBackendServicesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListBackendServicesMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + getBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + getHealthBackendServiceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getHealthBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + insertBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + listBackendServicesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackendServicesMethodDescriptor) + .build(); + HttpJsonCallSettings + patchBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + updateBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackendServiceMethodDescriptor) + .build(); + + this.aggregatedListBackendServicesCallable = + callableFactory.createUnaryCallable( + aggregatedListBackendServicesTransportSettings, + settings.aggregatedListBackendServicesSettings(), + clientContext); + this.aggregatedListBackendServicesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListBackendServicesTransportSettings, + settings.aggregatedListBackendServicesSettings(), + clientContext); + this.deleteBackendServiceCallable = + callableFactory.createUnaryCallable( + deleteBackendServiceTransportSettings, + settings.deleteBackendServiceSettings(), + clientContext); + this.getBackendServiceCallable = + callableFactory.createUnaryCallable( + getBackendServiceTransportSettings, + settings.getBackendServiceSettings(), + clientContext); + this.getHealthBackendServiceCallable = + callableFactory.createUnaryCallable( + getHealthBackendServiceTransportSettings, + settings.getHealthBackendServiceSettings(), + clientContext); + this.insertBackendServiceCallable = + callableFactory.createUnaryCallable( + insertBackendServiceTransportSettings, + settings.insertBackendServiceSettings(), + clientContext); + this.listBackendServicesCallable = + callableFactory.createUnaryCallable( + listBackendServicesTransportSettings, + settings.listBackendServicesSettings(), + clientContext); + this.listBackendServicesPagedCallable = + callableFactory.createPagedCallable( + listBackendServicesTransportSettings, + settings.listBackendServicesSettings(), + clientContext); + this.patchBackendServiceCallable = + callableFactory.createUnaryCallable( + patchBackendServiceTransportSettings, + settings.patchBackendServiceSettings(), + clientContext); + this.updateBackendServiceCallable = + callableFactory.createUnaryCallable( + updateBackendServiceTransportSettings, + settings.updateBackendServiceSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListBackendServicesPagedCallable() { + public UnaryCallable< + AggregatedListBackendServicesHttpRequest, AggregatedListBackendServicesPagedResponse> + aggregatedListBackendServicesPagedCallable() { return aggregatedListBackendServicesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListBackendServicesCallable() { + public UnaryCallable + aggregatedListBackendServicesCallable() { return aggregatedListBackendServicesCallable; } @@ -336,7 +422,8 @@ public UnaryCallable getBackendSer } @BetaApi - public UnaryCallable getHealthBackendServiceCallable() { + public UnaryCallable + getHealthBackendServiceCallable() { return getHealthBackendServiceCallable; } @@ -346,12 +433,14 @@ public UnaryCallable insertBackendSe } @BetaApi - public UnaryCallable listBackendServicesPagedCallable() { + public UnaryCallable + listBackendServicesPagedCallable() { return listBackendServicesPagedCallable; } @BetaApi - public UnaryCallable listBackendServicesCallable() { + public UnaryCallable + listBackendServicesCallable() { return listBackendServicesCallable; } @@ -366,7 +455,7 @@ public UnaryCallable updateBackendSe } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -394,5 +483,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java index 3f5829c5f038..de3a3552ebfa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java @@ -15,60 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; -import com.google.cloud.compute.v1.CreateSnapshotDiskHttpRequest; -import com.google.cloud.compute.v1.DeleteDiskHttpRequest; -import com.google.cloud.compute.v1.Disk; -import com.google.cloud.compute.v1.DiskAggregatedList; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; -import com.google.cloud.compute.v1.DiskList; -import com.google.cloud.compute.v1.DiskSettings; -import com.google.cloud.compute.v1.DisksResizeRequest; -import com.google.cloud.compute.v1.DisksScopedList; -import com.google.cloud.compute.v1.GetDiskHttpRequest; -import com.google.cloud.compute.v1.InsertDiskHttpRequest; -import com.google.cloud.compute.v1.ListDisksHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneDiskName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.ResizeDiskHttpRequest; -import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; -import com.google.cloud.compute.v1.Snapshot; -import com.google.cloud.compute.v1.ZoneSetLabelsRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -85,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -102,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index 480546c60e47..a27e5e9b7a8e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListDisksHttpRequest; @@ -34,29 +36,19 @@ import com.google.cloud.compute.v1.DeleteDiskHttpRequest; import com.google.cloud.compute.v1.Disk; import com.google.cloud.compute.v1.DiskAggregatedList; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.DiskList; -import com.google.cloud.compute.v1.DiskSettings; -import com.google.cloud.compute.v1.DisksResizeRequest; -import com.google.cloud.compute.v1.DisksScopedList; import com.google.cloud.compute.v1.GetDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneDiskName; +import com.google.cloud.compute.v1.ProjectZoneDiskResourceName; import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; -import com.google.cloud.compute.v1.Snapshot; -import com.google.cloud.compute.v1.ZoneSetLabelsRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -70,65 +62,67 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonDiskStub extends DiskStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListDisksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + aggregatedListDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor createSnapshotDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.createSnapshot") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) - .setQueryParams(Sets.newHashSet( - "guestFlush", "requestId" - )) - .setResourceNameFactory(ProjectZoneDiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + createSnapshotDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.createSnapshot") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) + .setQueryParams(Sets.newHashSet("guestFlush", "requestId")) + .setResourceNameFactory(ProjectZoneDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneDiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getDiskMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -138,8 +132,7 @@ public class HttpJsonDiskStub extends DiskStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) - .setQueryParams(Sets.newHashSet( - )) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) .setResourceNameField("disk") .build()) @@ -148,90 +141,96 @@ public class HttpJsonDiskStub extends DiskStub { .setResponseInstance(Disk.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor insertDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) - .setQueryParams(Sets.newHashSet( - "requestId", "sourceImage" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams(Sets.newHashSet("requestId", "sourceImage")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listDisksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor resizeDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.resize") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneDiskName.newFactory()) - .setResourceNameField("disk") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + resizeDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setLabelsDiskMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.disks.setLabels") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsDiskHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{resource}/setLabels")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneDiskName.newFactory()) - .setResourceNameField("resource") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setLabelsDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/disks/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneDiskResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListDisksCallable; - private final UnaryCallable aggregatedListDisksPagedCallable; + private final UnaryCallable + aggregatedListDisksCallable; + private final UnaryCallable + aggregatedListDisksPagedCallable; private final UnaryCallable createSnapshotDiskCallable; private final UnaryCallable deleteDiskCallable; private final UnaryCallable getDiskCallable; @@ -242,6 +241,7 @@ public class HttpJsonDiskStub extends DiskStub { private final UnaryCallable setLabelsDiskCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonDiskStub create(DiskStubSettings settings) throws IOException { return new HttpJsonDiskStub(settings, ClientContext.create(settings)); } @@ -250,35 +250,42 @@ public static final HttpJsonDiskStub create(ClientContext clientContext) throws return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonDiskStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonDiskStub(DiskStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonDiskStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDiskStub( + DiskStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonDiskStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonDiskStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. */ - protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonDiskCallableFactory()); } /** - * Constructs an instance of HttpJsonDiskStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonDiskStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. */ - protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonDiskStub( + DiskStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListDisksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListDisksMethodDescriptor) - .build(); - HttpJsonCallSettings createSnapshotDiskTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSnapshotDiskMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListDisksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(aggregatedListDisksMethodDescriptor) + .build(); + HttpJsonCallSettings + createSnapshotDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotDiskMethodDescriptor) + .build(); HttpJsonCallSettings deleteDiskTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteDiskMethodDescriptor) @@ -304,27 +311,55 @@ protected HttpJsonDiskStub(DiskStubSettings settings, ClientContext clientContex .setMethodDescriptor(setLabelsDiskMethodDescriptor) .build(); - this.aggregatedListDisksCallable = callableFactory.createUnaryCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); - this.aggregatedListDisksPagedCallable = callableFactory.createPagedCallable(aggregatedListDisksTransportSettings,settings.aggregatedListDisksSettings(), clientContext); - this.createSnapshotDiskCallable = callableFactory.createUnaryCallable(createSnapshotDiskTransportSettings,settings.createSnapshotDiskSettings(), clientContext); - this.deleteDiskCallable = callableFactory.createUnaryCallable(deleteDiskTransportSettings,settings.deleteDiskSettings(), clientContext); - this.getDiskCallable = callableFactory.createUnaryCallable(getDiskTransportSettings,settings.getDiskSettings(), clientContext); - this.insertDiskCallable = callableFactory.createUnaryCallable(insertDiskTransportSettings,settings.insertDiskSettings(), clientContext); - this.listDisksCallable = callableFactory.createUnaryCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); - this.listDisksPagedCallable = callableFactory.createPagedCallable(listDisksTransportSettings,settings.listDisksSettings(), clientContext); - this.resizeDiskCallable = callableFactory.createUnaryCallable(resizeDiskTransportSettings,settings.resizeDiskSettings(), clientContext); - this.setLabelsDiskCallable = callableFactory.createUnaryCallable(setLabelsDiskTransportSettings,settings.setLabelsDiskSettings(), clientContext); + this.aggregatedListDisksCallable = + callableFactory.createUnaryCallable( + aggregatedListDisksTransportSettings, + settings.aggregatedListDisksSettings(), + clientContext); + this.aggregatedListDisksPagedCallable = + callableFactory.createPagedCallable( + aggregatedListDisksTransportSettings, + settings.aggregatedListDisksSettings(), + clientContext); + this.createSnapshotDiskCallable = + callableFactory.createUnaryCallable( + createSnapshotDiskTransportSettings, + settings.createSnapshotDiskSettings(), + clientContext); + this.deleteDiskCallable = + callableFactory.createUnaryCallable( + deleteDiskTransportSettings, settings.deleteDiskSettings(), clientContext); + this.getDiskCallable = + callableFactory.createUnaryCallable( + getDiskTransportSettings, settings.getDiskSettings(), clientContext); + this.insertDiskCallable = + callableFactory.createUnaryCallable( + insertDiskTransportSettings, settings.insertDiskSettings(), clientContext); + this.listDisksCallable = + callableFactory.createUnaryCallable( + listDisksTransportSettings, settings.listDisksSettings(), clientContext); + this.listDisksPagedCallable = + callableFactory.createPagedCallable( + listDisksTransportSettings, settings.listDisksSettings(), clientContext); + this.resizeDiskCallable = + callableFactory.createUnaryCallable( + resizeDiskTransportSettings, settings.resizeDiskSettings(), clientContext); + this.setLabelsDiskCallable = + callableFactory.createUnaryCallable( + setLabelsDiskTransportSettings, settings.setLabelsDiskSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListDisksPagedCallable() { + public UnaryCallable + aggregatedListDisksPagedCallable() { return aggregatedListDisksPagedCallable; } @BetaApi - public UnaryCallable aggregatedListDisksCallable() { + public UnaryCallable + aggregatedListDisksCallable() { return aggregatedListDisksCallable; } @@ -369,7 +404,7 @@ public UnaryCallable setLabelsDiskCallable( } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -397,5 +432,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java index 446bc4f96c23..d6fdb78f82e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java @@ -15,52 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; -import com.google.cloud.compute.v1.DiskType; -import com.google.cloud.compute.v1.DiskTypeAggregatedList; -import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; -import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; -import com.google.cloud.compute.v1.DiskTypeList; -import com.google.cloud.compute.v1.DiskTypeSettings; -import com.google.cloud.compute.v1.DiskTypesScopedList; -import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; -import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneDiskTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -77,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -94,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java index 53a053aac2cd..833975a181fd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +29,19 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListDiskTypesHttpRequest; import com.google.cloud.compute.v1.DiskType; import com.google.cloud.compute.v1.DiskTypeAggregatedList; -import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; -import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; import com.google.cloud.compute.v1.DiskTypeList; -import com.google.cloud.compute.v1.DiskTypeSettings; -import com.google.cloud.compute.v1.DiskTypesScopedList; import com.google.cloud.compute.v1.GetDiskTypeHttpRequest; import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneDiskTypeName; import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,74 +55,86 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonDiskTypeStub extends DiskTypeStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListDiskTypesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.diskTypes.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDiskTypesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/diskTypes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskTypeAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListDiskTypesHttpRequest, DiskTypeAggregatedList> + aggregatedListDiskTypesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.diskTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDiskTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/diskTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getDiskTypeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.diskTypes.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetDiskTypeHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneDiskTypeName.newFactory()) - .setResourceNameField("diskType") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskType.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getDiskTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.diskTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetDiskTypeHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneDiskTypeName.newFactory()) + .setResourceNameField("diskType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskType.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listDiskTypesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.diskTypes.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDiskTypesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(DiskTypeList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listDiskTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.diskTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDiskTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskTypeList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListDiskTypesCallable; - private final UnaryCallable aggregatedListDiskTypesPagedCallable; + private final UnaryCallable + aggregatedListDiskTypesCallable; + private final UnaryCallable< + AggregatedListDiskTypesHttpRequest, AggregatedListDiskTypesPagedResponse> + aggregatedListDiskTypesPagedCallable; private final UnaryCallable getDiskTypeCallable; private final UnaryCallable listDiskTypesCallable; - private final UnaryCallable listDiskTypesPagedCallable; + private final UnaryCallable + listDiskTypesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonDiskTypeStub create(DiskTypeStubSettings settings) throws IOException { + + public static final HttpJsonDiskTypeStub create(DiskTypeStubSettings settings) + throws IOException { return new HttpJsonDiskTypeStub(settings, ClientContext.create(settings)); } @@ -136,31 +142,40 @@ public static final HttpJsonDiskTypeStub create(ClientContext clientContext) thr return new HttpJsonDiskTypeStub(DiskTypeStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonDiskTypeStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonDiskTypeStub(DiskTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonDiskTypeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDiskTypeStub( + DiskTypeStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonDiskTypeStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonDiskTypeStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonDiskTypeStub(DiskTypeStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonDiskTypeStub(DiskTypeStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonDiskTypeCallableFactory()); } /** - * Constructs an instance of HttpJsonDiskTypeStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonDiskTypeStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonDiskTypeStub(DiskTypeStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonDiskTypeStub( + DiskTypeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListDiskTypesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListDiskTypesMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListDiskTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListDiskTypesMethodDescriptor) + .build(); HttpJsonCallSettings getDiskTypeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getDiskTypeMethodDescriptor) @@ -170,22 +185,38 @@ protected HttpJsonDiskTypeStub(DiskTypeStubSettings settings, ClientContext clie .setMethodDescriptor(listDiskTypesMethodDescriptor) .build(); - this.aggregatedListDiskTypesCallable = callableFactory.createUnaryCallable(aggregatedListDiskTypesTransportSettings,settings.aggregatedListDiskTypesSettings(), clientContext); - this.aggregatedListDiskTypesPagedCallable = callableFactory.createPagedCallable(aggregatedListDiskTypesTransportSettings,settings.aggregatedListDiskTypesSettings(), clientContext); - this.getDiskTypeCallable = callableFactory.createUnaryCallable(getDiskTypeTransportSettings,settings.getDiskTypeSettings(), clientContext); - this.listDiskTypesCallable = callableFactory.createUnaryCallable(listDiskTypesTransportSettings,settings.listDiskTypesSettings(), clientContext); - this.listDiskTypesPagedCallable = callableFactory.createPagedCallable(listDiskTypesTransportSettings,settings.listDiskTypesSettings(), clientContext); + this.aggregatedListDiskTypesCallable = + callableFactory.createUnaryCallable( + aggregatedListDiskTypesTransportSettings, + settings.aggregatedListDiskTypesSettings(), + clientContext); + this.aggregatedListDiskTypesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListDiskTypesTransportSettings, + settings.aggregatedListDiskTypesSettings(), + clientContext); + this.getDiskTypeCallable = + callableFactory.createUnaryCallable( + getDiskTypeTransportSettings, settings.getDiskTypeSettings(), clientContext); + this.listDiskTypesCallable = + callableFactory.createUnaryCallable( + listDiskTypesTransportSettings, settings.listDiskTypesSettings(), clientContext); + this.listDiskTypesPagedCallable = + callableFactory.createPagedCallable( + listDiskTypesTransportSettings, settings.listDiskTypesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListDiskTypesPagedCallable() { + public UnaryCallable + aggregatedListDiskTypesPagedCallable() { return aggregatedListDiskTypesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListDiskTypesCallable() { + public UnaryCallable + aggregatedListDiskTypesCallable() { return aggregatedListDiskTypesCallable; } @@ -195,7 +226,8 @@ public UnaryCallable getDiskTypeCallable() { } @BetaApi - public UnaryCallable listDiskTypesPagedCallable() { + public UnaryCallable + listDiskTypesPagedCallable() { return listDiskTypesPagedCallable; } @@ -205,7 +237,7 @@ public UnaryCallable listDiskTypesCallab } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -233,5 +265,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java index 6181d176c090..208b5db905df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; -import com.google.cloud.compute.v1.Firewall; -import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; -import com.google.cloud.compute.v1.FirewallList; -import com.google.cloud.compute.v1.FirewallSettings; -import com.google.cloud.compute.v1.GetFirewallHttpRequest; -import com.google.cloud.compute.v1.InsertFirewallHttpRequest; -import com.google.cloud.compute.v1.ListFirewallsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchFirewallHttpRequest; -import com.google.cloud.compute.v1.ProjectFirewallName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java index 4118655f0375..982e4732f7ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +28,21 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteFirewallHttpRequest; import com.google.cloud.compute.v1.Firewall; -import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; import com.google.cloud.compute.v1.FirewallList; -import com.google.cloud.compute.v1.FirewallSettings; import com.google.cloud.compute.v1.GetFirewallHttpRequest; import com.google.cloud.compute.v1.InsertFirewallHttpRequest; import com.google.cloud.compute.v1.ListFirewallsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchFirewallHttpRequest; -import com.google.cloud.compute.v1.ProjectFirewallName; +import com.google.cloud.compute.v1.ProjectGlobalFirewallName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateFirewallHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,136 +56,141 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonFirewallStub extends FirewallStub { @InternalApi - public static final ApiMethodDescriptor deleteFirewallMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.firewalls.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectFirewallName.newFactory()) - .setResourceNameField("firewall") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getFirewallMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.firewalls.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetFirewallHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectFirewallName.newFactory()) - .setResourceNameField("firewall") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Firewall.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Firewall.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertFirewallMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.firewalls.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listFirewallsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.firewalls.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListFirewallsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(FirewallList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listFirewallsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListFirewallsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(FirewallList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchFirewallMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.firewalls.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectFirewallName.newFactory()) - .setResourceNameField("firewall") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateFirewallMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.firewalls.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectFirewallName.newFactory()) - .setResourceNameField("firewall") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateFirewallMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.firewalls.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) + .setResourceNameField("firewall") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteFirewallCallable; private final UnaryCallable getFirewallCallable; private final UnaryCallable insertFirewallCallable; private final UnaryCallable listFirewallsCallable; - private final UnaryCallable listFirewallsPagedCallable; + private final UnaryCallable + listFirewallsPagedCallable; private final UnaryCallable patchFirewallCallable; private final UnaryCallable updateFirewallCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonFirewallStub create(FirewallStubSettings settings) throws IOException { + + public static final HttpJsonFirewallStub create(FirewallStubSettings settings) + throws IOException { return new HttpJsonFirewallStub(settings, ClientContext.create(settings)); } @@ -198,25 +198,32 @@ public static final HttpJsonFirewallStub create(ClientContext clientContext) thr return new HttpJsonFirewallStub(FirewallStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonFirewallStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonFirewallStub(FirewallStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonFirewallStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonFirewallStub( + FirewallStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonFirewallStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonFirewallStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonFirewallStub(FirewallStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonFirewallStub(FirewallStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonFirewallCallableFactory()); } /** - * Constructs an instance of HttpJsonFirewallStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonFirewallStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonFirewallStub(FirewallStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonFirewallStub( + FirewallStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteFirewallTransportSettings = @@ -244,13 +251,27 @@ protected HttpJsonFirewallStub(FirewallStubSettings settings, ClientContext clie .setMethodDescriptor(updateFirewallMethodDescriptor) .build(); - this.deleteFirewallCallable = callableFactory.createUnaryCallable(deleteFirewallTransportSettings,settings.deleteFirewallSettings(), clientContext); - this.getFirewallCallable = callableFactory.createUnaryCallable(getFirewallTransportSettings,settings.getFirewallSettings(), clientContext); - this.insertFirewallCallable = callableFactory.createUnaryCallable(insertFirewallTransportSettings,settings.insertFirewallSettings(), clientContext); - this.listFirewallsCallable = callableFactory.createUnaryCallable(listFirewallsTransportSettings,settings.listFirewallsSettings(), clientContext); - this.listFirewallsPagedCallable = callableFactory.createPagedCallable(listFirewallsTransportSettings,settings.listFirewallsSettings(), clientContext); - this.patchFirewallCallable = callableFactory.createUnaryCallable(patchFirewallTransportSettings,settings.patchFirewallSettings(), clientContext); - this.updateFirewallCallable = callableFactory.createUnaryCallable(updateFirewallTransportSettings,settings.updateFirewallSettings(), clientContext); + this.deleteFirewallCallable = + callableFactory.createUnaryCallable( + deleteFirewallTransportSettings, settings.deleteFirewallSettings(), clientContext); + this.getFirewallCallable = + callableFactory.createUnaryCallable( + getFirewallTransportSettings, settings.getFirewallSettings(), clientContext); + this.insertFirewallCallable = + callableFactory.createUnaryCallable( + insertFirewallTransportSettings, settings.insertFirewallSettings(), clientContext); + this.listFirewallsCallable = + callableFactory.createUnaryCallable( + listFirewallsTransportSettings, settings.listFirewallsSettings(), clientContext); + this.listFirewallsPagedCallable = + callableFactory.createPagedCallable( + listFirewallsTransportSettings, settings.listFirewallsSettings(), clientContext); + this.patchFirewallCallable = + callableFactory.createUnaryCallable( + patchFirewallTransportSettings, settings.patchFirewallSettings(), clientContext); + this.updateFirewallCallable = + callableFactory.createUnaryCallable( + updateFirewallTransportSettings, settings.updateFirewallSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -271,7 +292,8 @@ public UnaryCallable insertFirewallCallabl } @BetaApi - public UnaryCallable listFirewallsPagedCallable() { + public UnaryCallable + listFirewallsPagedCallable() { return listFirewallsPagedCallable; } @@ -291,7 +313,7 @@ public UnaryCallable updateFirewallCallabl } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -319,5 +341,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java index efd553e9e420..e8a741ada0a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java @@ -15,56 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; -import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.ForwardingRule; -import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; -import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; -import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; -import com.google.cloud.compute.v1.ForwardingRuleList; -import com.google.cloud.compute.v1.ForwardingRuleSettings; -import com.google.cloud.compute.v1.ForwardingRulesScopedList; -import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionForwardingRuleName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.TargetReference; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -81,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -98,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java index a6a3b1d84617..43792480e26d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,18 +29,13 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListForwardingRulesHttpRequest; import com.google.cloud.compute.v1.DeleteForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ForwardingRule; import com.google.cloud.compute.v1.ForwardingRuleAggregatedList; -import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; -import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; import com.google.cloud.compute.v1.ForwardingRuleList; -import com.google.cloud.compute.v1.ForwardingRuleSettings; -import com.google.cloud.compute.v1.ForwardingRulesScopedList; import com.google.cloud.compute.v1.GetForwardingRuleHttpRequest; import com.google.cloud.compute.v1.InsertForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ListForwardingRulesHttpRequest; @@ -46,13 +44,8 @@ import com.google.cloud.compute.v1.ProjectRegionForwardingRuleName; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.SetTargetForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.TargetReference; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -66,209 +59,288 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListForwardingRulesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.forwardingRules.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/forwardingRules")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ForwardingRuleAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList> + aggregatedListForwardingRulesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.forwardingRules.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/forwardingRules")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRuleAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.forwardingRules.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory()) - .setResourceNameField("forwardingRule") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.forwardingRules.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory()) - .setResourceNameField("forwardingRule") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ForwardingRule.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRule.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.forwardingRules.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/forwardingRules")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listForwardingRulesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.forwardingRules.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListForwardingRulesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ForwardingRuleList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listForwardingRulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListForwardingRulesHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/forwardingRules")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRuleList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setTargetForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.forwardingRules.setTarget") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory()) - .setResourceNameField("forwardingRule") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setTargetForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.forwardingRules.setTarget") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListForwardingRulesCallable; - private final UnaryCallable aggregatedListForwardingRulesPagedCallable; - private final UnaryCallable deleteForwardingRuleCallable; - private final UnaryCallable getForwardingRuleCallable; - private final UnaryCallable insertForwardingRuleCallable; - private final UnaryCallable listForwardingRulesCallable; - private final UnaryCallable listForwardingRulesPagedCallable; - private final UnaryCallable setTargetForwardingRuleCallable; + private final UnaryCallable< + AggregatedListForwardingRulesHttpRequest, ForwardingRuleAggregatedList> + aggregatedListForwardingRulesCallable; + private final UnaryCallable< + AggregatedListForwardingRulesHttpRequest, AggregatedListForwardingRulesPagedResponse> + aggregatedListForwardingRulesPagedCallable; + private final UnaryCallable + deleteForwardingRuleCallable; + private final UnaryCallable + getForwardingRuleCallable; + private final UnaryCallable + insertForwardingRuleCallable; + private final UnaryCallable + listForwardingRulesCallable; + private final UnaryCallable + listForwardingRulesPagedCallable; + private final UnaryCallable + setTargetForwardingRuleCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonForwardingRuleStub create(ForwardingRuleStubSettings settings) throws IOException { + + public static final HttpJsonForwardingRuleStub create(ForwardingRuleStubSettings settings) + throws IOException { return new HttpJsonForwardingRuleStub(settings, ClientContext.create(settings)); } - public static final HttpJsonForwardingRuleStub create(ClientContext clientContext) throws IOException { - return new HttpJsonForwardingRuleStub(ForwardingRuleStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonForwardingRuleStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonForwardingRuleStub( + ForwardingRuleStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonForwardingRuleStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonForwardingRuleStub(ForwardingRuleStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonForwardingRuleStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonForwardingRuleStub( + ForwardingRuleStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonForwardingRuleStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonForwardingRuleStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonForwardingRuleStub(ForwardingRuleStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonForwardingRuleStub( + ForwardingRuleStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonForwardingRuleCallableFactory()); } /** - * Constructs an instance of HttpJsonForwardingRuleStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonForwardingRuleStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonForwardingRuleStub(ForwardingRuleStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonForwardingRuleStub( + ForwardingRuleStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListForwardingRulesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListForwardingRulesMethodDescriptor) - .build(); - HttpJsonCallSettings deleteForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteForwardingRuleMethodDescriptor) - .build(); - HttpJsonCallSettings getForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getForwardingRuleMethodDescriptor) - .build(); - HttpJsonCallSettings insertForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertForwardingRuleMethodDescriptor) - .build(); - HttpJsonCallSettings listForwardingRulesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listForwardingRulesMethodDescriptor) - .build(); - HttpJsonCallSettings setTargetForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setTargetForwardingRuleMethodDescriptor) - .build(); - - this.aggregatedListForwardingRulesCallable = callableFactory.createUnaryCallable(aggregatedListForwardingRulesTransportSettings,settings.aggregatedListForwardingRulesSettings(), clientContext); - this.aggregatedListForwardingRulesPagedCallable = callableFactory.createPagedCallable(aggregatedListForwardingRulesTransportSettings,settings.aggregatedListForwardingRulesSettings(), clientContext); - this.deleteForwardingRuleCallable = callableFactory.createUnaryCallable(deleteForwardingRuleTransportSettings,settings.deleteForwardingRuleSettings(), clientContext); - this.getForwardingRuleCallable = callableFactory.createUnaryCallable(getForwardingRuleTransportSettings,settings.getForwardingRuleSettings(), clientContext); - this.insertForwardingRuleCallable = callableFactory.createUnaryCallable(insertForwardingRuleTransportSettings,settings.insertForwardingRuleSettings(), clientContext); - this.listForwardingRulesCallable = callableFactory.createUnaryCallable(listForwardingRulesTransportSettings,settings.listForwardingRulesSettings(), clientContext); - this.listForwardingRulesPagedCallable = callableFactory.createPagedCallable(listForwardingRulesTransportSettings,settings.listForwardingRulesSettings(), clientContext); - this.setTargetForwardingRuleCallable = callableFactory.createUnaryCallable(setTargetForwardingRuleTransportSettings,settings.setTargetForwardingRuleSettings(), clientContext); + HttpJsonCallSettings + aggregatedListForwardingRulesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListForwardingRulesMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings + getForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings + insertForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings + listForwardingRulesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listForwardingRulesMethodDescriptor) + .build(); + HttpJsonCallSettings + setTargetForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTargetForwardingRuleMethodDescriptor) + .build(); + + this.aggregatedListForwardingRulesCallable = + callableFactory.createUnaryCallable( + aggregatedListForwardingRulesTransportSettings, + settings.aggregatedListForwardingRulesSettings(), + clientContext); + this.aggregatedListForwardingRulesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListForwardingRulesTransportSettings, + settings.aggregatedListForwardingRulesSettings(), + clientContext); + this.deleteForwardingRuleCallable = + callableFactory.createUnaryCallable( + deleteForwardingRuleTransportSettings, + settings.deleteForwardingRuleSettings(), + clientContext); + this.getForwardingRuleCallable = + callableFactory.createUnaryCallable( + getForwardingRuleTransportSettings, + settings.getForwardingRuleSettings(), + clientContext); + this.insertForwardingRuleCallable = + callableFactory.createUnaryCallable( + insertForwardingRuleTransportSettings, + settings.insertForwardingRuleSettings(), + clientContext); + this.listForwardingRulesCallable = + callableFactory.createUnaryCallable( + listForwardingRulesTransportSettings, + settings.listForwardingRulesSettings(), + clientContext); + this.listForwardingRulesPagedCallable = + callableFactory.createPagedCallable( + listForwardingRulesTransportSettings, + settings.listForwardingRulesSettings(), + clientContext); + this.setTargetForwardingRuleCallable = + callableFactory.createUnaryCallable( + setTargetForwardingRuleTransportSettings, + settings.setTargetForwardingRuleSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListForwardingRulesPagedCallable() { + public UnaryCallable< + AggregatedListForwardingRulesHttpRequest, AggregatedListForwardingRulesPagedResponse> + aggregatedListForwardingRulesPagedCallable() { return aggregatedListForwardingRulesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListForwardingRulesCallable() { + public UnaryCallable + aggregatedListForwardingRulesCallable() { return aggregatedListForwardingRulesCallable; } @@ -288,22 +360,25 @@ public UnaryCallable insertForwardin } @BetaApi - public UnaryCallable listForwardingRulesPagedCallable() { + public UnaryCallable + listForwardingRulesPagedCallable() { return listForwardingRulesPagedCallable; } @BetaApi - public UnaryCallable listForwardingRulesCallable() { + public UnaryCallable + listForwardingRulesCallable() { return listForwardingRulesCallable; } @BetaApi - public UnaryCallable setTargetForwardingRuleCallable() { + public UnaryCallable + setTargetForwardingRuleCallable() { return setTargetForwardingRuleCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -331,5 +406,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java index 9e3e06becd85..e6722a09b55a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java @@ -15,49 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.Address; -import com.google.cloud.compute.v1.AddressList; -import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; -import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; -import com.google.cloud.compute.v1.GlobalAddressSettings; -import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; -import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectAddressName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -74,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -91,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java index ba45af41eea7..6eb29eaa5d11 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,26 +28,19 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.Address; import com.google.cloud.compute.v1.AddressList; import com.google.cloud.compute.v1.DeleteGlobalAddressHttpRequest; import com.google.cloud.compute.v1.GetGlobalAddressHttpRequest; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; -import com.google.cloud.compute.v1.GlobalAddressSettings; import com.google.cloud.compute.v1.InsertGlobalAddressHttpRequest; import com.google.cloud.compute.v1.ListGlobalAddressesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectAddressName; +import com.google.cloud.compute.v1.ProjectGlobalAddressName; import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,144 +54,182 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonGlobalAddressStub extends GlobalAddressStub { @InternalApi - public static final ApiMethodDescriptor deleteGlobalAddressMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalAddresses.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectAddressName.newFactory()) - .setResourceNameField("address") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteGlobalAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getGlobalAddressMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalAddresses.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalAddressHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectAddressName.newFactory()) - .setResourceNameField("address") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.
newBuilder() - .setResponseInstance(Address.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getGlobalAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) + .setResourceNameField("address") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.
newBuilder() + .setResponseInstance(Address.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertGlobalAddressMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalAddresses.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/addresses")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertGlobalAddressMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listGlobalAddressesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalAddresses.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalAddressesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/addresses")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(AddressList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listGlobalAddressesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalAddresses.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalAddressesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/addresses")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(AddressList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteGlobalAddressCallable; + private final UnaryCallable + deleteGlobalAddressCallable; private final UnaryCallable getGlobalAddressCallable; - private final UnaryCallable insertGlobalAddressCallable; - private final UnaryCallable listGlobalAddressesCallable; - private final UnaryCallable listGlobalAddressesPagedCallable; + private final UnaryCallable + insertGlobalAddressCallable; + private final UnaryCallable + listGlobalAddressesCallable; + private final UnaryCallable + listGlobalAddressesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonGlobalAddressStub create(GlobalAddressStubSettings settings) throws IOException { + + public static final HttpJsonGlobalAddressStub create(GlobalAddressStubSettings settings) + throws IOException { return new HttpJsonGlobalAddressStub(settings, ClientContext.create(settings)); } - public static final HttpJsonGlobalAddressStub create(ClientContext clientContext) throws IOException { - return new HttpJsonGlobalAddressStub(GlobalAddressStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonGlobalAddressStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonGlobalAddressStub( + GlobalAddressStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonGlobalAddressStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonGlobalAddressStub(GlobalAddressStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonGlobalAddressStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGlobalAddressStub( + GlobalAddressStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonGlobalAddressStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonGlobalAddressStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonGlobalAddressStub(GlobalAddressStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonGlobalAddressStub( + GlobalAddressStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonGlobalAddressCallableFactory()); } /** - * Constructs an instance of HttpJsonGlobalAddressStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonGlobalAddressStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonGlobalAddressStub(GlobalAddressStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonGlobalAddressStub( + GlobalAddressStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteGlobalAddressTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteGlobalAddressMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteGlobalAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteGlobalAddressMethodDescriptor) + .build(); HttpJsonCallSettings getGlobalAddressTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getGlobalAddressMethodDescriptor) .build(); - HttpJsonCallSettings insertGlobalAddressTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertGlobalAddressMethodDescriptor) - .build(); - HttpJsonCallSettings listGlobalAddressesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listGlobalAddressesMethodDescriptor) - .build(); + HttpJsonCallSettings + insertGlobalAddressTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertGlobalAddressMethodDescriptor) + .build(); + HttpJsonCallSettings + listGlobalAddressesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listGlobalAddressesMethodDescriptor) + .build(); - this.deleteGlobalAddressCallable = callableFactory.createUnaryCallable(deleteGlobalAddressTransportSettings,settings.deleteGlobalAddressSettings(), clientContext); - this.getGlobalAddressCallable = callableFactory.createUnaryCallable(getGlobalAddressTransportSettings,settings.getGlobalAddressSettings(), clientContext); - this.insertGlobalAddressCallable = callableFactory.createUnaryCallable(insertGlobalAddressTransportSettings,settings.insertGlobalAddressSettings(), clientContext); - this.listGlobalAddressesCallable = callableFactory.createUnaryCallable(listGlobalAddressesTransportSettings,settings.listGlobalAddressesSettings(), clientContext); - this.listGlobalAddressesPagedCallable = callableFactory.createPagedCallable(listGlobalAddressesTransportSettings,settings.listGlobalAddressesSettings(), clientContext); + this.deleteGlobalAddressCallable = + callableFactory.createUnaryCallable( + deleteGlobalAddressTransportSettings, + settings.deleteGlobalAddressSettings(), + clientContext); + this.getGlobalAddressCallable = + callableFactory.createUnaryCallable( + getGlobalAddressTransportSettings, settings.getGlobalAddressSettings(), clientContext); + this.insertGlobalAddressCallable = + callableFactory.createUnaryCallable( + insertGlobalAddressTransportSettings, + settings.insertGlobalAddressSettings(), + clientContext); + this.listGlobalAddressesCallable = + callableFactory.createUnaryCallable( + listGlobalAddressesTransportSettings, + settings.listGlobalAddressesSettings(), + clientContext); + this.listGlobalAddressesPagedCallable = + callableFactory.createPagedCallable( + listGlobalAddressesTransportSettings, + settings.listGlobalAddressesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -217,7 +250,8 @@ public UnaryCallable insertGlobalAddr } @BetaApi - public UnaryCallable listGlobalAddressesPagedCallable() { + public UnaryCallable + listGlobalAddressesPagedCallable() { return listGlobalAddressesPagedCallable; } @@ -227,7 +261,7 @@ public UnaryCallable listGlobalAddr } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -255,5 +289,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java index 2bb40db148ca..71a6c2b9007c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.ForwardingRule; -import com.google.cloud.compute.v1.ForwardingRuleList; -import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; -import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; -import com.google.cloud.compute.v1.GlobalForwardingRuleSettings; -import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectForwardingRuleName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.TargetReference; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java index 7b8c4918e8c6..fea55b36483a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +28,20 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteGlobalForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ForwardingRule; import com.google.cloud.compute.v1.ForwardingRuleList; import com.google.cloud.compute.v1.GetGlobalForwardingRuleHttpRequest; -import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; -import com.google.cloud.compute.v1.GlobalForwardingRuleSettings; import com.google.cloud.compute.v1.InsertGlobalForwardingRuleHttpRequest; import com.google.cloud.compute.v1.ListGlobalForwardingRulesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectForwardingRuleName; +import com.google.cloud.compute.v1.ProjectGlobalForwardingRuleName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.SetTargetGlobalForwardingRuleHttpRequest; -import com.google.cloud.compute.v1.TargetReference; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,206 +55,270 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { @InternalApi - public static final ApiMethodDescriptor deleteGlobalForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalForwardingRules.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) - .setResourceNameField("forwardingRule") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getGlobalForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalForwardingRules.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) - .setResourceNameField("forwardingRule") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ForwardingRule.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRule.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertGlobalForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalForwardingRules.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listGlobalForwardingRulesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalForwardingRules.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ForwardingRuleList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listGlobalForwardingRulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ForwardingRuleList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setTargetGlobalForwardingRuleMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalForwardingRules.setTarget") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}/setTarget")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectForwardingRuleName.newFactory()) - .setResourceNameField("forwardingRule") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setTargetGlobalForwardingRuleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalForwardingRules.setTarget") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/forwardingRules/{forwardingRule}/setTarget")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalForwardingRuleName.newFactory()) + .setResourceNameField("forwardingRule") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteGlobalForwardingRuleCallable; - private final UnaryCallable getGlobalForwardingRuleCallable; - private final UnaryCallable insertGlobalForwardingRuleCallable; - private final UnaryCallable listGlobalForwardingRulesCallable; - private final UnaryCallable listGlobalForwardingRulesPagedCallable; - private final UnaryCallable setTargetGlobalForwardingRuleCallable; + private final UnaryCallable + deleteGlobalForwardingRuleCallable; + private final UnaryCallable + getGlobalForwardingRuleCallable; + private final UnaryCallable + insertGlobalForwardingRuleCallable; + private final UnaryCallable + listGlobalForwardingRulesCallable; + private final UnaryCallable< + ListGlobalForwardingRulesHttpRequest, ListGlobalForwardingRulesPagedResponse> + listGlobalForwardingRulesPagedCallable; + private final UnaryCallable + setTargetGlobalForwardingRuleCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonGlobalForwardingRuleStub create(GlobalForwardingRuleStubSettings settings) throws IOException { + + public static final HttpJsonGlobalForwardingRuleStub create( + GlobalForwardingRuleStubSettings settings) throws IOException { return new HttpJsonGlobalForwardingRuleStub(settings, ClientContext.create(settings)); } - public static final HttpJsonGlobalForwardingRuleStub create(ClientContext clientContext) throws IOException { - return new HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonGlobalForwardingRuleStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonGlobalForwardingRuleStub( + GlobalForwardingRuleStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonGlobalForwardingRuleStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonGlobalForwardingRuleStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGlobalForwardingRuleStub( + GlobalForwardingRuleStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonGlobalForwardingRuleStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonGlobalForwardingRuleStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonGlobalForwardingRuleStub( + GlobalForwardingRuleStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonGlobalForwardingRuleCallableFactory()); } /** - * Constructs an instance of HttpJsonGlobalForwardingRuleStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonGlobalForwardingRuleStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonGlobalForwardingRuleStub(GlobalForwardingRuleStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonGlobalForwardingRuleStub( + GlobalForwardingRuleStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteGlobalForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteGlobalForwardingRuleMethodDescriptor) - .build(); - HttpJsonCallSettings getGlobalForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getGlobalForwardingRuleMethodDescriptor) - .build(); - HttpJsonCallSettings insertGlobalForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertGlobalForwardingRuleMethodDescriptor) - .build(); - HttpJsonCallSettings listGlobalForwardingRulesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listGlobalForwardingRulesMethodDescriptor) - .build(); - HttpJsonCallSettings setTargetGlobalForwardingRuleTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setTargetGlobalForwardingRuleMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteGlobalForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings + getGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGlobalForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings + insertGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertGlobalForwardingRuleMethodDescriptor) + .build(); + HttpJsonCallSettings + listGlobalForwardingRulesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listGlobalForwardingRulesMethodDescriptor) + .build(); + HttpJsonCallSettings + setTargetGlobalForwardingRuleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setTargetGlobalForwardingRuleMethodDescriptor) + .build(); - this.deleteGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(deleteGlobalForwardingRuleTransportSettings,settings.deleteGlobalForwardingRuleSettings(), clientContext); - this.getGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(getGlobalForwardingRuleTransportSettings,settings.getGlobalForwardingRuleSettings(), clientContext); - this.insertGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(insertGlobalForwardingRuleTransportSettings,settings.insertGlobalForwardingRuleSettings(), clientContext); - this.listGlobalForwardingRulesCallable = callableFactory.createUnaryCallable(listGlobalForwardingRulesTransportSettings,settings.listGlobalForwardingRulesSettings(), clientContext); - this.listGlobalForwardingRulesPagedCallable = callableFactory.createPagedCallable(listGlobalForwardingRulesTransportSettings,settings.listGlobalForwardingRulesSettings(), clientContext); - this.setTargetGlobalForwardingRuleCallable = callableFactory.createUnaryCallable(setTargetGlobalForwardingRuleTransportSettings,settings.setTargetGlobalForwardingRuleSettings(), clientContext); + this.deleteGlobalForwardingRuleCallable = + callableFactory.createUnaryCallable( + deleteGlobalForwardingRuleTransportSettings, + settings.deleteGlobalForwardingRuleSettings(), + clientContext); + this.getGlobalForwardingRuleCallable = + callableFactory.createUnaryCallable( + getGlobalForwardingRuleTransportSettings, + settings.getGlobalForwardingRuleSettings(), + clientContext); + this.insertGlobalForwardingRuleCallable = + callableFactory.createUnaryCallable( + insertGlobalForwardingRuleTransportSettings, + settings.insertGlobalForwardingRuleSettings(), + clientContext); + this.listGlobalForwardingRulesCallable = + callableFactory.createUnaryCallable( + listGlobalForwardingRulesTransportSettings, + settings.listGlobalForwardingRulesSettings(), + clientContext); + this.listGlobalForwardingRulesPagedCallable = + callableFactory.createPagedCallable( + listGlobalForwardingRulesTransportSettings, + settings.listGlobalForwardingRulesSettings(), + clientContext); + this.setTargetGlobalForwardingRuleCallable = + callableFactory.createUnaryCallable( + setTargetGlobalForwardingRuleTransportSettings, + settings.setTargetGlobalForwardingRuleSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteGlobalForwardingRuleCallable() { + public UnaryCallable + deleteGlobalForwardingRuleCallable() { return deleteGlobalForwardingRuleCallable; } @BetaApi - public UnaryCallable getGlobalForwardingRuleCallable() { + public UnaryCallable + getGlobalForwardingRuleCallable() { return getGlobalForwardingRuleCallable; } @BetaApi - public UnaryCallable insertGlobalForwardingRuleCallable() { + public UnaryCallable + insertGlobalForwardingRuleCallable() { return insertGlobalForwardingRuleCallable; } @BetaApi - public UnaryCallable listGlobalForwardingRulesPagedCallable() { + public UnaryCallable + listGlobalForwardingRulesPagedCallable() { return listGlobalForwardingRulesPagedCallable; } @BetaApi - public UnaryCallable listGlobalForwardingRulesCallable() { + public UnaryCallable + listGlobalForwardingRulesCallable() { return listGlobalForwardingRulesCallable; } @BetaApi - public UnaryCallable setTargetGlobalForwardingRuleCallable() { + public UnaryCallable + setTargetGlobalForwardingRuleCallable() { return setTargetGlobalForwardingRuleCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -288,5 +346,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java index db7887a5b509..aaf739f3e299 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; -import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; -import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; -import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; -import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; -import com.google.cloud.compute.v1.GlobalOperationSettings; -import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.OperationAggregatedList; -import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.OperationsScopedList; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectOperationName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java index 50385267bb65..5eff8aca6859 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +29,19 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListGlobalOperationsHttpRequest; import com.google.cloud.compute.v1.DeleteGlobalOperationHttpRequest; import com.google.cloud.compute.v1.GetGlobalOperationHttpRequest; -import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; -import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; -import com.google.cloud.compute.v1.GlobalOperationSettings; import com.google.cloud.compute.v1.ListGlobalOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationAggregatedList; import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.OperationsScopedList; +import com.google.cloud.compute.v1.ProjectGlobalOperationName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectOperationName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,152 +55,210 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonGlobalOperationStub extends GlobalOperationStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListGlobalOperationsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalOperations.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/operations")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(OperationAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListGlobalOperationsHttpRequest, OperationAggregatedList> + aggregatedListGlobalOperationsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.globalOperations.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/operations")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteGlobalOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalOperations.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalOperationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/operations/{operation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectOperationName.newFactory()) - .setResourceNameField("operation") - .build()) - .build(); + public static final ApiMethodDescriptor + deleteGlobalOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalOperationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/operations/{operation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getGlobalOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalOperations.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalOperationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/operations/{operation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectOperationName.newFactory()) - .setResourceNameField("operation") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getGlobalOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalOperationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/operations/{operation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listGlobalOperationsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.globalOperations.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalOperationsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/operations")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(OperationList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listGlobalOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.globalOperations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/operations")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListGlobalOperationsCallable; - private final UnaryCallable aggregatedListGlobalOperationsPagedCallable; + private final UnaryCallable + aggregatedListGlobalOperationsCallable; + private final UnaryCallable< + AggregatedListGlobalOperationsHttpRequest, AggregatedListGlobalOperationsPagedResponse> + aggregatedListGlobalOperationsPagedCallable; private final UnaryCallable deleteGlobalOperationCallable; private final UnaryCallable getGlobalOperationCallable; - private final UnaryCallable listGlobalOperationsCallable; - private final UnaryCallable listGlobalOperationsPagedCallable; + private final UnaryCallable + listGlobalOperationsCallable; + private final UnaryCallable + listGlobalOperationsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonGlobalOperationStub create(GlobalOperationStubSettings settings) throws IOException { + + public static final HttpJsonGlobalOperationStub create(GlobalOperationStubSettings settings) + throws IOException { return new HttpJsonGlobalOperationStub(settings, ClientContext.create(settings)); } - public static final HttpJsonGlobalOperationStub create(ClientContext clientContext) throws IOException { - return new HttpJsonGlobalOperationStub(GlobalOperationStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonGlobalOperationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonGlobalOperationStub( + GlobalOperationStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonGlobalOperationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonGlobalOperationStub(GlobalOperationStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonGlobalOperationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGlobalOperationStub( + GlobalOperationStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonGlobalOperationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonGlobalOperationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonGlobalOperationStub(GlobalOperationStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonGlobalOperationStub( + GlobalOperationStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonGlobalOperationCallableFactory()); } /** - * Constructs an instance of HttpJsonGlobalOperationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonGlobalOperationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonGlobalOperationStub(GlobalOperationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonGlobalOperationStub( + GlobalOperationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListGlobalOperationsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListGlobalOperationsMethodDescriptor) - .build(); - HttpJsonCallSettings deleteGlobalOperationTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteGlobalOperationMethodDescriptor) - .build(); - HttpJsonCallSettings getGlobalOperationTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getGlobalOperationMethodDescriptor) - .build(); - HttpJsonCallSettings listGlobalOperationsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listGlobalOperationsMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListGlobalOperationsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListGlobalOperationsMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteGlobalOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteGlobalOperationMethodDescriptor) + .build(); + HttpJsonCallSettings + getGlobalOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGlobalOperationMethodDescriptor) + .build(); + HttpJsonCallSettings + listGlobalOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listGlobalOperationsMethodDescriptor) + .build(); - this.aggregatedListGlobalOperationsCallable = callableFactory.createUnaryCallable(aggregatedListGlobalOperationsTransportSettings,settings.aggregatedListGlobalOperationsSettings(), clientContext); - this.aggregatedListGlobalOperationsPagedCallable = callableFactory.createPagedCallable(aggregatedListGlobalOperationsTransportSettings,settings.aggregatedListGlobalOperationsSettings(), clientContext); - this.deleteGlobalOperationCallable = callableFactory.createUnaryCallable(deleteGlobalOperationTransportSettings,settings.deleteGlobalOperationSettings(), clientContext); - this.getGlobalOperationCallable = callableFactory.createUnaryCallable(getGlobalOperationTransportSettings,settings.getGlobalOperationSettings(), clientContext); - this.listGlobalOperationsCallable = callableFactory.createUnaryCallable(listGlobalOperationsTransportSettings,settings.listGlobalOperationsSettings(), clientContext); - this.listGlobalOperationsPagedCallable = callableFactory.createPagedCallable(listGlobalOperationsTransportSettings,settings.listGlobalOperationsSettings(), clientContext); + this.aggregatedListGlobalOperationsCallable = + callableFactory.createUnaryCallable( + aggregatedListGlobalOperationsTransportSettings, + settings.aggregatedListGlobalOperationsSettings(), + clientContext); + this.aggregatedListGlobalOperationsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListGlobalOperationsTransportSettings, + settings.aggregatedListGlobalOperationsSettings(), + clientContext); + this.deleteGlobalOperationCallable = + callableFactory.createUnaryCallable( + deleteGlobalOperationTransportSettings, + settings.deleteGlobalOperationSettings(), + clientContext); + this.getGlobalOperationCallable = + callableFactory.createUnaryCallable( + getGlobalOperationTransportSettings, + settings.getGlobalOperationSettings(), + clientContext); + this.listGlobalOperationsCallable = + callableFactory.createUnaryCallable( + listGlobalOperationsTransportSettings, + settings.listGlobalOperationsSettings(), + clientContext); + this.listGlobalOperationsPagedCallable = + callableFactory.createPagedCallable( + listGlobalOperationsTransportSettings, + settings.listGlobalOperationsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListGlobalOperationsPagedCallable() { + public UnaryCallable< + AggregatedListGlobalOperationsHttpRequest, AggregatedListGlobalOperationsPagedResponse> + aggregatedListGlobalOperationsPagedCallable() { return aggregatedListGlobalOperationsPagedCallable; } @BetaApi - public UnaryCallable aggregatedListGlobalOperationsCallable() { + public UnaryCallable + aggregatedListGlobalOperationsCallable() { return aggregatedListGlobalOperationsCallable; } @@ -221,17 +273,19 @@ public UnaryCallable getGlobalOperatio } @BetaApi - public UnaryCallable listGlobalOperationsPagedCallable() { + public UnaryCallable + listGlobalOperationsPagedCallable() { return listGlobalOperationsPagedCallable; } @BetaApi - public UnaryCallable listGlobalOperationsCallable() { + public UnaryCallable + listGlobalOperationsCallable() { return listGlobalOperationsCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -259,5 +313,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java index 8560e6f605f1..383894bc546e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; -import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HealthCheck; -import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; -import com.google.cloud.compute.v1.HealthCheckList; -import com.google.cloud.compute.v1.HealthCheckSettings; -import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHealthCheckName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java index 69bd40f3f417..72c57e921cef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +28,21 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHealthCheckHttpRequest; import com.google.cloud.compute.v1.HealthCheck; -import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; import com.google.cloud.compute.v1.HealthCheckList; -import com.google.cloud.compute.v1.HealthCheckSettings; import com.google.cloud.compute.v1.InsertHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHealthCheckName; +import com.google.cloud.compute.v1.ProjectGlobalHealthCheckName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHealthCheckHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,196 +56,238 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonHealthCheckStub extends HealthCheckStub { @InternalApi - public static final ApiMethodDescriptor deleteHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.healthChecks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHealthCheckName.newFactory()) - .setResourceNameField("healthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.healthChecks.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectHealthCheckName.newFactory()) - .setResourceNameField("healthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HealthCheck.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalHealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HealthCheck.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.healthChecks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listHealthChecksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.healthChecks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHealthChecksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HealthCheckList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listHealthChecksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHealthChecksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HealthCheckList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.healthChecks.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHealthCheckName.newFactory()) - .setResourceNameField("healthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.healthChecks.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHealthCheckName.newFactory()) - .setResourceNameField("healthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.healthChecks.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHealthCheckName.newFactory()) + .setResourceNameField("healthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteHealthCheckCallable; private final UnaryCallable getHealthCheckCallable; private final UnaryCallable insertHealthCheckCallable; - private final UnaryCallable listHealthChecksCallable; - private final UnaryCallable listHealthChecksPagedCallable; + private final UnaryCallable + listHealthChecksCallable; + private final UnaryCallable + listHealthChecksPagedCallable; private final UnaryCallable patchHealthCheckCallable; private final UnaryCallable updateHealthCheckCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonHealthCheckStub create(HealthCheckStubSettings settings) throws IOException { + + public static final HttpJsonHealthCheckStub create(HealthCheckStubSettings settings) + throws IOException { return new HttpJsonHealthCheckStub(settings, ClientContext.create(settings)); } - public static final HttpJsonHealthCheckStub create(ClientContext clientContext) throws IOException { + public static final HttpJsonHealthCheckStub create(ClientContext clientContext) + throws IOException { return new HttpJsonHealthCheckStub(HealthCheckStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonHealthCheckStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonHealthCheckStub(HealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonHealthCheckStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHealthCheckStub( + HealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonHealthCheckStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonHealthCheckStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonHealthCheckStub(HealthCheckStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonHealthCheckStub(HealthCheckStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonHealthCheckCallableFactory()); } /** - * Constructs an instance of HttpJsonHealthCheckStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonHealthCheckStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonHealthCheckStub(HealthCheckStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonHealthCheckStub( + HealthCheckStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteHealthCheckMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteHealthCheckMethodDescriptor) + .build(); HttpJsonCallSettings getHealthCheckTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings insertHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings listHealthChecksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listHealthChecksMethodDescriptor) - .build(); + HttpJsonCallSettings + insertHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + listHealthChecksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listHealthChecksMethodDescriptor) + .build(); HttpJsonCallSettings patchHealthCheckTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings updateHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateHealthCheckMethodDescriptor) - .build(); + HttpJsonCallSettings + updateHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateHealthCheckMethodDescriptor) + .build(); - this.deleteHealthCheckCallable = callableFactory.createUnaryCallable(deleteHealthCheckTransportSettings,settings.deleteHealthCheckSettings(), clientContext); - this.getHealthCheckCallable = callableFactory.createUnaryCallable(getHealthCheckTransportSettings,settings.getHealthCheckSettings(), clientContext); - this.insertHealthCheckCallable = callableFactory.createUnaryCallable(insertHealthCheckTransportSettings,settings.insertHealthCheckSettings(), clientContext); - this.listHealthChecksCallable = callableFactory.createUnaryCallable(listHealthChecksTransportSettings,settings.listHealthChecksSettings(), clientContext); - this.listHealthChecksPagedCallable = callableFactory.createPagedCallable(listHealthChecksTransportSettings,settings.listHealthChecksSettings(), clientContext); - this.patchHealthCheckCallable = callableFactory.createUnaryCallable(patchHealthCheckTransportSettings,settings.patchHealthCheckSettings(), clientContext); - this.updateHealthCheckCallable = callableFactory.createUnaryCallable(updateHealthCheckTransportSettings,settings.updateHealthCheckSettings(), clientContext); + this.deleteHealthCheckCallable = + callableFactory.createUnaryCallable( + deleteHealthCheckTransportSettings, + settings.deleteHealthCheckSettings(), + clientContext); + this.getHealthCheckCallable = + callableFactory.createUnaryCallable( + getHealthCheckTransportSettings, settings.getHealthCheckSettings(), clientContext); + this.insertHealthCheckCallable = + callableFactory.createUnaryCallable( + insertHealthCheckTransportSettings, + settings.insertHealthCheckSettings(), + clientContext); + this.listHealthChecksCallable = + callableFactory.createUnaryCallable( + listHealthChecksTransportSettings, settings.listHealthChecksSettings(), clientContext); + this.listHealthChecksPagedCallable = + callableFactory.createPagedCallable( + listHealthChecksTransportSettings, settings.listHealthChecksSettings(), clientContext); + this.patchHealthCheckCallable = + callableFactory.createUnaryCallable( + patchHealthCheckTransportSettings, settings.patchHealthCheckSettings(), clientContext); + this.updateHealthCheckCallable = + callableFactory.createUnaryCallable( + updateHealthCheckTransportSettings, + settings.updateHealthCheckSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -271,7 +308,8 @@ public UnaryCallable insertHealthCheckC } @BetaApi - public UnaryCallable listHealthChecksPagedCallable() { + public UnaryCallable + listHealthChecksPagedCallable() { return listHealthChecksPagedCallable; } @@ -291,7 +329,7 @@ public UnaryCallable updateHealthCheckC } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -319,5 +357,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java index 2f3fe05ccaae..807f5a1abafb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; -import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; -import com.google.cloud.compute.v1.HttpHealthCheckList; -import com.google.cloud.compute.v1.HttpHealthCheckSettings; -import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHttpHealthCheckName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index a32e49795f3c..705a707b8b9a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +28,21 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpHealthCheck; -import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpHealthCheckList; -import com.google.cloud.compute.v1.HttpHealthCheckSettings; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHttpHealthCheckName; +import com.google.cloud.compute.v1.ProjectGlobalHttpHealthCheckName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHttpHealthCheckHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,222 +56,289 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { @InternalApi - public static final ApiMethodDescriptor deleteHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpHealthChecks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory()) - .setResourceNameField("httpHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpHealthChecks.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHttpHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory()) - .setResourceNameField("httpHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpHealthCheck.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalHttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheck.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpHealthChecks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listHttpHealthChecksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpHealthChecks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHttpHealthChecksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpHealthCheckList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listHttpHealthChecksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHttpHealthChecksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheckList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpHealthChecks.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory()) - .setResourceNameField("httpHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpHealthChecks.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks/{httpHealthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHttpHealthCheckName.newFactory()) - .setResourceNameField("httpHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateHttpHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpHealthChecks.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpHealthChecks/{httpHealthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHttpHealthCheckName.newFactory()) + .setResourceNameField("httpHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteHttpHealthCheckCallable; - private final UnaryCallable getHttpHealthCheckCallable; - private final UnaryCallable insertHttpHealthCheckCallable; - private final UnaryCallable listHttpHealthChecksCallable; - private final UnaryCallable listHttpHealthChecksPagedCallable; - private final UnaryCallable patchHttpHealthCheckCallable; - private final UnaryCallable updateHttpHealthCheckCallable; + private final UnaryCallable + deleteHttpHealthCheckCallable; + private final UnaryCallable + getHttpHealthCheckCallable; + private final UnaryCallable + insertHttpHealthCheckCallable; + private final UnaryCallable + listHttpHealthChecksCallable; + private final UnaryCallable + listHttpHealthChecksPagedCallable; + private final UnaryCallable + patchHttpHealthCheckCallable; + private final UnaryCallable + updateHttpHealthCheckCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonHttpHealthCheckStub create(HttpHealthCheckStubSettings settings) throws IOException { + + public static final HttpJsonHttpHealthCheckStub create(HttpHealthCheckStubSettings settings) + throws IOException { return new HttpJsonHttpHealthCheckStub(settings, ClientContext.create(settings)); } - public static final HttpJsonHttpHealthCheckStub create(ClientContext clientContext) throws IOException { - return new HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonHttpHealthCheckStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonHttpHealthCheckStub( + HttpHealthCheckStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonHttpHealthCheckStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonHttpHealthCheckStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHttpHealthCheckStub( + HttpHealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonHttpHealthCheckStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonHttpHealthCheckStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonHttpHealthCheckStub( + HttpHealthCheckStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonHttpHealthCheckCallableFactory()); } /** - * Constructs an instance of HttpJsonHttpHealthCheckStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonHttpHealthCheckStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonHttpHealthCheckStub(HttpHealthCheckStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonHttpHealthCheckStub( + HttpHealthCheckStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteHttpHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings getHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getHttpHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings insertHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertHttpHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings listHttpHealthChecksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listHttpHealthChecksMethodDescriptor) - .build(); - HttpJsonCallSettings patchHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchHttpHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings updateHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateHttpHealthCheckMethodDescriptor) - .build(); - - this.deleteHttpHealthCheckCallable = callableFactory.createUnaryCallable(deleteHttpHealthCheckTransportSettings,settings.deleteHttpHealthCheckSettings(), clientContext); - this.getHttpHealthCheckCallable = callableFactory.createUnaryCallable(getHttpHealthCheckTransportSettings,settings.getHttpHealthCheckSettings(), clientContext); - this.insertHttpHealthCheckCallable = callableFactory.createUnaryCallable(insertHttpHealthCheckTransportSettings,settings.insertHttpHealthCheckSettings(), clientContext); - this.listHttpHealthChecksCallable = callableFactory.createUnaryCallable(listHttpHealthChecksTransportSettings,settings.listHttpHealthChecksSettings(), clientContext); - this.listHttpHealthChecksPagedCallable = callableFactory.createPagedCallable(listHttpHealthChecksTransportSettings,settings.listHttpHealthChecksSettings(), clientContext); - this.patchHttpHealthCheckCallable = callableFactory.createUnaryCallable(patchHttpHealthCheckTransportSettings,settings.patchHttpHealthCheckSettings(), clientContext); - this.updateHttpHealthCheckCallable = callableFactory.createUnaryCallable(updateHttpHealthCheckTransportSettings,settings.updateHttpHealthCheckSettings(), clientContext); + HttpJsonCallSettings + deleteHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + getHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + insertHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + listHttpHealthChecksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listHttpHealthChecksMethodDescriptor) + .build(); + HttpJsonCallSettings + patchHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchHttpHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + updateHttpHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateHttpHealthCheckMethodDescriptor) + .build(); + + this.deleteHttpHealthCheckCallable = + callableFactory.createUnaryCallable( + deleteHttpHealthCheckTransportSettings, + settings.deleteHttpHealthCheckSettings(), + clientContext); + this.getHttpHealthCheckCallable = + callableFactory.createUnaryCallable( + getHttpHealthCheckTransportSettings, + settings.getHttpHealthCheckSettings(), + clientContext); + this.insertHttpHealthCheckCallable = + callableFactory.createUnaryCallable( + insertHttpHealthCheckTransportSettings, + settings.insertHttpHealthCheckSettings(), + clientContext); + this.listHttpHealthChecksCallable = + callableFactory.createUnaryCallable( + listHttpHealthChecksTransportSettings, + settings.listHttpHealthChecksSettings(), + clientContext); + this.listHttpHealthChecksPagedCallable = + callableFactory.createPagedCallable( + listHttpHealthChecksTransportSettings, + settings.listHttpHealthChecksSettings(), + clientContext); + this.patchHttpHealthCheckCallable = + callableFactory.createUnaryCallable( + patchHttpHealthCheckTransportSettings, + settings.patchHttpHealthCheckSettings(), + clientContext); + this.updateHttpHealthCheckCallable = + callableFactory.createUnaryCallable( + updateHttpHealthCheckTransportSettings, + settings.updateHttpHealthCheckSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteHttpHealthCheckCallable() { + public UnaryCallable + deleteHttpHealthCheckCallable() { return deleteHttpHealthCheckCallable; } @BetaApi - public UnaryCallable getHttpHealthCheckCallable() { + public UnaryCallable + getHttpHealthCheckCallable() { return getHttpHealthCheckCallable; } @BetaApi - public UnaryCallable insertHttpHealthCheckCallable() { + public UnaryCallable + insertHttpHealthCheckCallable() { return insertHttpHealthCheckCallable; } @BetaApi - public UnaryCallable listHttpHealthChecksPagedCallable() { + public UnaryCallable + listHttpHealthChecksPagedCallable() { return listHttpHealthChecksPagedCallable; } @BetaApi - public UnaryCallable listHttpHealthChecksCallable() { + public UnaryCallable + listHttpHealthChecksCallable() { return listHttpHealthChecksCallable; } @@ -286,12 +348,13 @@ public UnaryCallable patchHttpHealth } @BetaApi - public UnaryCallable updateHttpHealthCheckCallable() { + public UnaryCallable + updateHttpHealthCheckCallable() { return updateHttpHealthCheckCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -319,5 +382,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java index 081645642280..3eae33c80bd3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; -import com.google.cloud.compute.v1.HttpsHealthCheckList; -import com.google.cloud.compute.v1.HttpsHealthCheckSettings; -import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHttpsHealthCheckName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 9089d18dcd0a..03bb840ed555 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,28 +28,21 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpsHealthCheck; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpsHealthCheckList; -import com.google.cloud.compute.v1.HttpsHealthCheckSettings; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHttpsHealthCheckName; +import com.google.cloud.compute.v1.ProjectGlobalHttpsHealthCheckName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,237 +56,307 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { @InternalApi - public static final ApiMethodDescriptor deleteHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpsHealthChecks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory()) - .setResourceNameField("httpsHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpsHealthChecks.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHttpsHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory()) - .setResourceNameField("httpsHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpsHealthCheck.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalHttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheck.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpsHealthChecks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listHttpsHealthChecksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpsHealthChecks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHttpsHealthChecksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpsHealthCheckList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listHttpsHealthChecksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHttpsHealthChecksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheckList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpsHealthChecks.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory()) - .setResourceNameField("httpsHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.httpsHealthChecks.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks/{httpsHealthCheck}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectHttpsHealthCheckName.newFactory()) - .setResourceNameField("httpsHealthCheck") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateHttpsHealthCheckMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.httpsHealthChecks.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalHttpsHealthCheckName.newFactory()) + .setResourceNameField("httpsHealthCheck") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteHttpsHealthCheckCallable; - private final UnaryCallable getHttpsHealthCheckCallable; - private final UnaryCallable insertHttpsHealthCheckCallable; - private final UnaryCallable listHttpsHealthChecksCallable; - private final UnaryCallable listHttpsHealthChecksPagedCallable; - private final UnaryCallable patchHttpsHealthCheckCallable; - private final UnaryCallable updateHttpsHealthCheckCallable; + private final UnaryCallable + deleteHttpsHealthCheckCallable; + private final UnaryCallable + getHttpsHealthCheckCallable; + private final UnaryCallable + insertHttpsHealthCheckCallable; + private final UnaryCallable + listHttpsHealthChecksCallable; + private final UnaryCallable + listHttpsHealthChecksPagedCallable; + private final UnaryCallable + patchHttpsHealthCheckCallable; + private final UnaryCallable + updateHttpsHealthCheckCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonHttpsHealthCheckStub create(HttpsHealthCheckStubSettings settings) throws IOException { + + public static final HttpJsonHttpsHealthCheckStub create(HttpsHealthCheckStubSettings settings) + throws IOException { return new HttpJsonHttpsHealthCheckStub(settings, ClientContext.create(settings)); } - public static final HttpJsonHttpsHealthCheckStub create(ClientContext clientContext) throws IOException { - return new HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonHttpsHealthCheckStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonHttpsHealthCheckStub( + HttpsHealthCheckStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonHttpsHealthCheckStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonHttpsHealthCheckStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonHttpsHealthCheckStub( + HttpsHealthCheckStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonHttpsHealthCheckStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonHttpsHealthCheckStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonHttpsHealthCheckStub( + HttpsHealthCheckStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonHttpsHealthCheckCallableFactory()); } /** - * Constructs an instance of HttpJsonHttpsHealthCheckStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonHttpsHealthCheckStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonHttpsHealthCheckStub(HttpsHealthCheckStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonHttpsHealthCheckStub( + HttpsHealthCheckStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteHttpsHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings getHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getHttpsHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings insertHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertHttpsHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings listHttpsHealthChecksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listHttpsHealthChecksMethodDescriptor) - .build(); - HttpJsonCallSettings patchHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchHttpsHealthCheckMethodDescriptor) - .build(); - HttpJsonCallSettings updateHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateHttpsHealthCheckMethodDescriptor) - .build(); - - this.deleteHttpsHealthCheckCallable = callableFactory.createUnaryCallable(deleteHttpsHealthCheckTransportSettings,settings.deleteHttpsHealthCheckSettings(), clientContext); - this.getHttpsHealthCheckCallable = callableFactory.createUnaryCallable(getHttpsHealthCheckTransportSettings,settings.getHttpsHealthCheckSettings(), clientContext); - this.insertHttpsHealthCheckCallable = callableFactory.createUnaryCallable(insertHttpsHealthCheckTransportSettings,settings.insertHttpsHealthCheckSettings(), clientContext); - this.listHttpsHealthChecksCallable = callableFactory.createUnaryCallable(listHttpsHealthChecksTransportSettings,settings.listHttpsHealthChecksSettings(), clientContext); - this.listHttpsHealthChecksPagedCallable = callableFactory.createPagedCallable(listHttpsHealthChecksTransportSettings,settings.listHttpsHealthChecksSettings(), clientContext); - this.patchHttpsHealthCheckCallable = callableFactory.createUnaryCallable(patchHttpsHealthCheckTransportSettings,settings.patchHttpsHealthCheckSettings(), clientContext); - this.updateHttpsHealthCheckCallable = callableFactory.createUnaryCallable(updateHttpsHealthCheckTransportSettings,settings.updateHttpsHealthCheckSettings(), clientContext); + HttpJsonCallSettings + deleteHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + getHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + insertHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + listHttpsHealthChecksTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listHttpsHealthChecksMethodDescriptor) + .build(); + HttpJsonCallSettings + patchHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchHttpsHealthCheckMethodDescriptor) + .build(); + HttpJsonCallSettings + updateHttpsHealthCheckTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateHttpsHealthCheckMethodDescriptor) + .build(); + + this.deleteHttpsHealthCheckCallable = + callableFactory.createUnaryCallable( + deleteHttpsHealthCheckTransportSettings, + settings.deleteHttpsHealthCheckSettings(), + clientContext); + this.getHttpsHealthCheckCallable = + callableFactory.createUnaryCallable( + getHttpsHealthCheckTransportSettings, + settings.getHttpsHealthCheckSettings(), + clientContext); + this.insertHttpsHealthCheckCallable = + callableFactory.createUnaryCallable( + insertHttpsHealthCheckTransportSettings, + settings.insertHttpsHealthCheckSettings(), + clientContext); + this.listHttpsHealthChecksCallable = + callableFactory.createUnaryCallable( + listHttpsHealthChecksTransportSettings, + settings.listHttpsHealthChecksSettings(), + clientContext); + this.listHttpsHealthChecksPagedCallable = + callableFactory.createPagedCallable( + listHttpsHealthChecksTransportSettings, + settings.listHttpsHealthChecksSettings(), + clientContext); + this.patchHttpsHealthCheckCallable = + callableFactory.createUnaryCallable( + patchHttpsHealthCheckTransportSettings, + settings.patchHttpsHealthCheckSettings(), + clientContext); + this.updateHttpsHealthCheckCallable = + callableFactory.createUnaryCallable( + updateHttpsHealthCheckTransportSettings, + settings.updateHttpsHealthCheckSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteHttpsHealthCheckCallable() { + public UnaryCallable + deleteHttpsHealthCheckCallable() { return deleteHttpsHealthCheckCallable; } @BetaApi - public UnaryCallable getHttpsHealthCheckCallable() { + public UnaryCallable + getHttpsHealthCheckCallable() { return getHttpsHealthCheckCallable; } @BetaApi - public UnaryCallable insertHttpsHealthCheckCallable() { + public UnaryCallable + insertHttpsHealthCheckCallable() { return insertHttpsHealthCheckCallable; } @BetaApi - public UnaryCallable listHttpsHealthChecksPagedCallable() { + public UnaryCallable + listHttpsHealthChecksPagedCallable() { return listHttpsHealthChecksPagedCallable; } @BetaApi - public UnaryCallable listHttpsHealthChecksCallable() { + public UnaryCallable + listHttpsHealthChecksCallable() { return listHttpsHealthChecksCallable; } @BetaApi - public UnaryCallable patchHttpsHealthCheckCallable() { + public UnaryCallable + patchHttpsHealthCheckCallable() { return patchHttpsHealthCheckCallable; } @BetaApi - public UnaryCallable updateHttpsHealthCheckCallable() { + public UnaryCallable + updateHttpsHealthCheckCallable() { return updateHttpsHealthCheckCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -319,5 +384,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java index 648daabc08b4..434f11b4109e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java @@ -15,55 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteImageHttpRequest; -import com.google.cloud.compute.v1.DeprecateImageHttpRequest; -import com.google.cloud.compute.v1.DeprecationStatus; -import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; -import com.google.cloud.compute.v1.GetImageHttpRequest; -import com.google.cloud.compute.v1.GlobalSetLabelsRequest; -import com.google.cloud.compute.v1.Image; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; -import com.google.cloud.compute.v1.ImageList; -import com.google.cloud.compute.v1.ImageSettings; -import com.google.cloud.compute.v1.InsertImageHttpRequest; -import com.google.cloud.compute.v1.ListImagesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectFamilyName; -import com.google.cloud.compute.v1.ProjectImageName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -80,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -97,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index 8048a460dd88..71192983e3b1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,32 +28,24 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; -import com.google.cloud.compute.v1.DeprecationStatus; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; -import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.Image; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; -import com.google.cloud.compute.v1.ImageSettings; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectFamilyName; -import com.google.cloud.compute.v1.ProjectImageName; +import com.google.cloud.compute.v1.ProjectGlobalImageFamilyName; +import com.google.cloud.compute.v1.ProjectGlobalImageName; +import com.google.cloud.compute.v1.ProjectGlobalImageResourceName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -65,45 +59,46 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonImageStub extends ImageStub { @InternalApi - public static final ApiMethodDescriptor deleteImageMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.images.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectImageName.newFactory()) - .setResourceNameField("image") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalImageName.newFactory()) + .setResourceNameField("image") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deprecateImageMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.images.deprecate") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/images/{image}/deprecate")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectImageName.newFactory()) - .setResourceNameField("image") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deprecateImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.deprecate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/images/{image}/deprecate")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalImageName.newFactory()) + .setResourceNameField("image") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getImageMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -113,9 +108,8 @@ public class HttpJsonImageStub extends ImageStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectImageName.newFactory()) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalImageName.newFactory()) .setResourceNameField("image") .build()) .setResponseParser( @@ -123,84 +117,90 @@ public class HttpJsonImageStub extends ImageStub { .setResponseInstance(Image.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor getFromFamilyImageMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.images.getFromFamily") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetFromFamilyImageHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/images/family/{family}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectFamilyName.newFactory()) - .setResourceNameField("family") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Image.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getFromFamilyImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.getFromFamily") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetFromFamilyImageHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/images/family/{family}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalImageFamilyName.newFactory()) + .setResourceNameField("family") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Image.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertImageMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.images.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/images")) - .setQueryParams(Sets.newHashSet( - "forceCreate", "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images")) + .setQueryParams(Sets.newHashSet("forceCreate", "requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listImagesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.images.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListImagesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/images")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ImageList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listImagesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListImagesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/images")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ImageList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setLabelsImageMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.images.setLabels") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsImageHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/images/{resource}/setLabels")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectImageName.newFactory()) - .setResourceNameField("resource") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setLabelsImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsImageHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/images/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalImageResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteImageCallable; @@ -209,10 +209,12 @@ public class HttpJsonImageStub extends ImageStub { private final UnaryCallable getFromFamilyImageCallable; private final UnaryCallable insertImageCallable; private final UnaryCallable listImagesCallable; - private final UnaryCallable listImagesPagedCallable; + private final UnaryCallable + listImagesPagedCallable; private final UnaryCallable setLabelsImageCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonImageStub create(ImageStubSettings settings) throws IOException { return new HttpJsonImageStub(settings, ClientContext.create(settings)); } @@ -221,25 +223,32 @@ public static final HttpJsonImageStub create(ClientContext clientContext) throws return new HttpJsonImageStub(ImageStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonImageStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonImageStub(ImageStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonImageStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonImageStub( + ImageStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonImageStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonImageStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonImageCallableFactory()); } /** - * Constructs an instance of HttpJsonImageStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonImageStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonImageStub( + ImageStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteImageTransportSettings = @@ -271,14 +280,32 @@ protected HttpJsonImageStub(ImageStubSettings settings, ClientContext clientCont .setMethodDescriptor(setLabelsImageMethodDescriptor) .build(); - this.deleteImageCallable = callableFactory.createUnaryCallable(deleteImageTransportSettings,settings.deleteImageSettings(), clientContext); - this.deprecateImageCallable = callableFactory.createUnaryCallable(deprecateImageTransportSettings,settings.deprecateImageSettings(), clientContext); - this.getImageCallable = callableFactory.createUnaryCallable(getImageTransportSettings,settings.getImageSettings(), clientContext); - this.getFromFamilyImageCallable = callableFactory.createUnaryCallable(getFromFamilyImageTransportSettings,settings.getFromFamilyImageSettings(), clientContext); - this.insertImageCallable = callableFactory.createUnaryCallable(insertImageTransportSettings,settings.insertImageSettings(), clientContext); - this.listImagesCallable = callableFactory.createUnaryCallable(listImagesTransportSettings,settings.listImagesSettings(), clientContext); - this.listImagesPagedCallable = callableFactory.createPagedCallable(listImagesTransportSettings,settings.listImagesSettings(), clientContext); - this.setLabelsImageCallable = callableFactory.createUnaryCallable(setLabelsImageTransportSettings,settings.setLabelsImageSettings(), clientContext); + this.deleteImageCallable = + callableFactory.createUnaryCallable( + deleteImageTransportSettings, settings.deleteImageSettings(), clientContext); + this.deprecateImageCallable = + callableFactory.createUnaryCallable( + deprecateImageTransportSettings, settings.deprecateImageSettings(), clientContext); + this.getImageCallable = + callableFactory.createUnaryCallable( + getImageTransportSettings, settings.getImageSettings(), clientContext); + this.getFromFamilyImageCallable = + callableFactory.createUnaryCallable( + getFromFamilyImageTransportSettings, + settings.getFromFamilyImageSettings(), + clientContext); + this.insertImageCallable = + callableFactory.createUnaryCallable( + insertImageTransportSettings, settings.insertImageSettings(), clientContext); + this.listImagesCallable = + callableFactory.createUnaryCallable( + listImagesTransportSettings, settings.listImagesSettings(), clientContext); + this.listImagesPagedCallable = + callableFactory.createPagedCallable( + listImagesTransportSettings, settings.listImagesSettings(), clientContext); + this.setLabelsImageCallable = + callableFactory.createUnaryCallable( + setLabelsImageTransportSettings, settings.setLabelsImageSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -324,7 +351,7 @@ public UnaryCallable setLabelsImageCallabl } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -352,5 +379,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java index 0314f1d8a628..4ed7f958caaa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java @@ -15,92 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AccessConfig; -import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; -import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; -import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; -import com.google.cloud.compute.v1.AttachedDisk; -import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; -import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; -import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; -import com.google.cloud.compute.v1.GetInstanceHttpRequest; -import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; -import com.google.cloud.compute.v1.InsertInstanceHttpRequest; -import com.google.cloud.compute.v1.Instance; -import com.google.cloud.compute.v1.InstanceAggregatedList; -import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; -import com.google.cloud.compute.v1.InstanceList; -import com.google.cloud.compute.v1.InstanceListReferrers; -import com.google.cloud.compute.v1.InstanceSettings; -import com.google.cloud.compute.v1.InstancesScopedList; -import com.google.cloud.compute.v1.InstancesSetLabelsRequest; -import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest; -import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; -import com.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; -import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; -import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; -import com.google.cloud.compute.v1.ListInstancesHttpRequest; -import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; -import com.google.cloud.compute.v1.Metadata; -import com.google.cloud.compute.v1.NetworkInterface; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneInstanceName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.Reference; -import com.google.cloud.compute.v1.ResetInstanceHttpRequest; -import com.google.cloud.compute.v1.Scheduling; -import com.google.cloud.compute.v1.SerialPortOutput; -import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; -import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; -import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; -import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; -import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; -import com.google.cloud.compute.v1.SetMetadataInstanceHttpRequest; -import com.google.cloud.compute.v1.SetMinCpuPlatformInstanceHttpRequest; -import com.google.cloud.compute.v1.SetSchedulingInstanceHttpRequest; -import com.google.cloud.compute.v1.SetServiceAccountInstanceHttpRequest; -import com.google.cloud.compute.v1.SetTagsInstanceHttpRequest; -import com.google.cloud.compute.v1.StartInstanceHttpRequest; -import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; -import com.google.cloud.compute.v1.StopInstanceHttpRequest; -import com.google.cloud.compute.v1.Tags; -import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; -import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -117,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -134,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java index c4611e17b7ea..fb7fc9cc14b3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java @@ -15,65 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; -import com.google.cloud.compute.v1.AggregatedListInstanceGroupsHttpRequest; -import com.google.cloud.compute.v1.DeleteInstanceGroupHttpRequest; -import com.google.cloud.compute.v1.GetInstanceGroupHttpRequest; -import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; -import com.google.cloud.compute.v1.InstanceGroup; -import com.google.cloud.compute.v1.InstanceGroupAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; -import com.google.cloud.compute.v1.InstanceGroupList; -import com.google.cloud.compute.v1.InstanceGroupSettings; -import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsListInstances; -import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsScopedList; -import com.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; -import com.google.cloud.compute.v1.InstanceWithNamedPorts; -import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; -import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneInstanceGroupName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; -import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -90,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -107,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java index 73141d6b8759..2956ba2f1598 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java @@ -15,67 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.AggregatedListInstanceGroupManagersHttpRequest; -import com.google.cloud.compute.v1.DeleteInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.GetInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.InstanceGroupManager; -import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; -import com.google.cloud.compute.v1.InstanceGroupManagerList; -import com.google.cloud.compute.v1.InstanceGroupManagerSettings; -import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; -import com.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; -import com.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; -import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; -import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneInstanceGroupManagerName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -92,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -109,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index 8a7182984827..d2a729a072a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; @@ -37,17 +39,8 @@ import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.InstanceGroupManager; import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.InstanceGroupManagerList; -import com.google.cloud.compute.v1.InstanceGroupManagerSettings; -import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; -import com.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; -import com.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; @@ -58,12 +51,8 @@ import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -77,430 +66,625 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { @InternalApi - public static final ApiMethodDescriptor abandonInstancesInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.abandonInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AbandonInstancesInstanceGroupManagerHttpRequest, Operation> + abandonInstancesInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroupManagers.abandonInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor aggregatedListInstanceGroupManagersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroupManagers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupManagerAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.instanceGroupManagers.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/aggregated/instanceGroupManagers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManagerAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteInstancesInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.deleteInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInstancesInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroupManagers.deleteInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupManager.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManager.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInstanceGroupManagersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceGroupManagersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupManagerList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList> + listInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroupManagers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManagerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listManagedInstancesInstanceGroupManagersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.listManagedInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "order_by", "pageToken" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupManagersListManagedInstancesResponse.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.instanceGroupManagers.listManagedInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser + .newBuilder() + .setResponseInstance( + InstanceGroupManagersListManagedInstancesResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor recreateInstancesInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.recreateInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + RecreateInstancesInstanceGroupManagerHttpRequest, Operation> + recreateInstancesInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroupManagers.recreateInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor resizeInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.resize") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) - .setQueryParams(Sets.newHashSet( - "requestId", "size" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + resizeInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) + .setQueryParams(Sets.newHashSet("requestId", "size")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setInstanceTemplateInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.setInstanceTemplate") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + SetInstanceTemplateInstanceGroupManagerHttpRequest, Operation> + setInstanceTemplateInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroupManagers.setInstanceTemplate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setTargetPoolsInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroupManagers.setTargetPools") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setTargetPoolsInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.setTargetPools") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable abandonInstancesInstanceGroupManagerCallable; - private final UnaryCallable aggregatedListInstanceGroupManagersCallable; - private final UnaryCallable aggregatedListInstanceGroupManagersPagedCallable; - private final UnaryCallable deleteInstanceGroupManagerCallable; - private final UnaryCallable deleteInstancesInstanceGroupManagerCallable; - private final UnaryCallable getInstanceGroupManagerCallable; - private final UnaryCallable insertInstanceGroupManagerCallable; - private final UnaryCallable listInstanceGroupManagersCallable; - private final UnaryCallable listInstanceGroupManagersPagedCallable; - private final UnaryCallable listManagedInstancesInstanceGroupManagersCallable; - private final UnaryCallable recreateInstancesInstanceGroupManagerCallable; - private final UnaryCallable resizeInstanceGroupManagerCallable; - private final UnaryCallable setInstanceTemplateInstanceGroupManagerCallable; - private final UnaryCallable setTargetPoolsInstanceGroupManagerCallable; + private final UnaryCallable + abandonInstancesInstanceGroupManagerCallable; + private final UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersCallable; + private final UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersPagedCallable; + private final UnaryCallable + deleteInstanceGroupManagerCallable; + private final UnaryCallable + deleteInstancesInstanceGroupManagerCallable; + private final UnaryCallable + getInstanceGroupManagerCallable; + private final UnaryCallable + insertInstanceGroupManagerCallable; + private final UnaryCallable + listInstanceGroupManagersCallable; + private final UnaryCallable< + ListInstanceGroupManagersHttpRequest, ListInstanceGroupManagersPagedResponse> + listInstanceGroupManagersPagedCallable; + private final UnaryCallable< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersCallable; + private final UnaryCallable + recreateInstancesInstanceGroupManagerCallable; + private final UnaryCallable + resizeInstanceGroupManagerCallable; + private final UnaryCallable + setInstanceTemplateInstanceGroupManagerCallable; + private final UnaryCallable + setTargetPoolsInstanceGroupManagerCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInstanceGroupManagerStub create(InstanceGroupManagerStubSettings settings) throws IOException { + + public static final HttpJsonInstanceGroupManagerStub create( + InstanceGroupManagerStubSettings settings) throws IOException { return new HttpJsonInstanceGroupManagerStub(settings, ClientContext.create(settings)); } - public static final HttpJsonInstanceGroupManagerStub create(ClientContext clientContext) throws IOException { - return new HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonInstanceGroupManagerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonInstanceGroupManagerStub( + InstanceGroupManagerStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInstanceGroupManagerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInstanceGroupManagerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceGroupManagerStub( + InstanceGroupManagerStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInstanceGroupManagerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceGroupManagerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInstanceGroupManagerStub( + InstanceGroupManagerStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonInstanceGroupManagerCallableFactory()); } /** - * Constructs an instance of HttpJsonInstanceGroupManagerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceGroupManagerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInstanceGroupManagerStub(InstanceGroupManagerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInstanceGroupManagerStub( + InstanceGroupManagerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings abandonInstancesInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(abandonInstancesInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings aggregatedListInstanceGroupManagersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListInstanceGroupManagersMethodDescriptor) - .build(); - HttpJsonCallSettings deleteInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings deleteInstancesInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInstancesInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings getInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings insertInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings listInstanceGroupManagersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInstanceGroupManagersMethodDescriptor) - .build(); - HttpJsonCallSettings listManagedInstancesInstanceGroupManagersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listManagedInstancesInstanceGroupManagersMethodDescriptor) - .build(); - HttpJsonCallSettings recreateInstancesInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(recreateInstancesInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings resizeInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(resizeInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings setInstanceTemplateInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setInstanceTemplateInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings setTargetPoolsInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setTargetPoolsInstanceGroupManagerMethodDescriptor) - .build(); - - this.abandonInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable(abandonInstancesInstanceGroupManagerTransportSettings,settings.abandonInstancesInstanceGroupManagerSettings(), clientContext); - this.aggregatedListInstanceGroupManagersCallable = callableFactory.createUnaryCallable(aggregatedListInstanceGroupManagersTransportSettings,settings.aggregatedListInstanceGroupManagersSettings(), clientContext); - this.aggregatedListInstanceGroupManagersPagedCallable = callableFactory.createPagedCallable(aggregatedListInstanceGroupManagersTransportSettings,settings.aggregatedListInstanceGroupManagersSettings(), clientContext); - this.deleteInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteInstanceGroupManagerTransportSettings,settings.deleteInstanceGroupManagerSettings(), clientContext); - this.deleteInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteInstancesInstanceGroupManagerTransportSettings,settings.deleteInstancesInstanceGroupManagerSettings(), clientContext); - this.getInstanceGroupManagerCallable = callableFactory.createUnaryCallable(getInstanceGroupManagerTransportSettings,settings.getInstanceGroupManagerSettings(), clientContext); - this.insertInstanceGroupManagerCallable = callableFactory.createUnaryCallable(insertInstanceGroupManagerTransportSettings,settings.insertInstanceGroupManagerSettings(), clientContext); - this.listInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listInstanceGroupManagersTransportSettings,settings.listInstanceGroupManagersSettings(), clientContext); - this.listInstanceGroupManagersPagedCallable = callableFactory.createPagedCallable(listInstanceGroupManagersTransportSettings,settings.listInstanceGroupManagersSettings(), clientContext); - this.listManagedInstancesInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listManagedInstancesInstanceGroupManagersTransportSettings,settings.listManagedInstancesInstanceGroupManagersSettings(), clientContext); - this.recreateInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable(recreateInstancesInstanceGroupManagerTransportSettings,settings.recreateInstancesInstanceGroupManagerSettings(), clientContext); - this.resizeInstanceGroupManagerCallable = callableFactory.createUnaryCallable(resizeInstanceGroupManagerTransportSettings,settings.resizeInstanceGroupManagerSettings(), clientContext); - this.setInstanceTemplateInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setInstanceTemplateInstanceGroupManagerTransportSettings,settings.setInstanceTemplateInstanceGroupManagerSettings(), clientContext); - this.setTargetPoolsInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setTargetPoolsInstanceGroupManagerTransportSettings,settings.setTargetPoolsInstanceGroupManagerSettings(), clientContext); + HttpJsonCallSettings + abandonInstancesInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(abandonInstancesInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteInstancesInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(deleteInstancesInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + getInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + insertInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + listInstanceGroupManagersTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listManagedInstancesInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings + recreateInstancesInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(recreateInstancesInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + resizeInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resizeInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + setInstanceTemplateInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setInstanceTemplateInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + setTargetPoolsInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setTargetPoolsInstanceGroupManagerMethodDescriptor) + .build(); + + this.abandonInstancesInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + abandonInstancesInstanceGroupManagerTransportSettings, + settings.abandonInstancesInstanceGroupManagerSettings(), + clientContext); + this.aggregatedListInstanceGroupManagersCallable = + callableFactory.createUnaryCallable( + aggregatedListInstanceGroupManagersTransportSettings, + settings.aggregatedListInstanceGroupManagersSettings(), + clientContext); + this.aggregatedListInstanceGroupManagersPagedCallable = + callableFactory.createPagedCallable( + aggregatedListInstanceGroupManagersTransportSettings, + settings.aggregatedListInstanceGroupManagersSettings(), + clientContext); + this.deleteInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + deleteInstanceGroupManagerTransportSettings, + settings.deleteInstanceGroupManagerSettings(), + clientContext); + this.deleteInstancesInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + deleteInstancesInstanceGroupManagerTransportSettings, + settings.deleteInstancesInstanceGroupManagerSettings(), + clientContext); + this.getInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + getInstanceGroupManagerTransportSettings, + settings.getInstanceGroupManagerSettings(), + clientContext); + this.insertInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + insertInstanceGroupManagerTransportSettings, + settings.insertInstanceGroupManagerSettings(), + clientContext); + this.listInstanceGroupManagersCallable = + callableFactory.createUnaryCallable( + listInstanceGroupManagersTransportSettings, + settings.listInstanceGroupManagersSettings(), + clientContext); + this.listInstanceGroupManagersPagedCallable = + callableFactory.createPagedCallable( + listInstanceGroupManagersTransportSettings, + settings.listInstanceGroupManagersSettings(), + clientContext); + this.listManagedInstancesInstanceGroupManagersCallable = + callableFactory.createUnaryCallable( + listManagedInstancesInstanceGroupManagersTransportSettings, + settings.listManagedInstancesInstanceGroupManagersSettings(), + clientContext); + this.recreateInstancesInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + recreateInstancesInstanceGroupManagerTransportSettings, + settings.recreateInstancesInstanceGroupManagerSettings(), + clientContext); + this.resizeInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + resizeInstanceGroupManagerTransportSettings, + settings.resizeInstanceGroupManagerSettings(), + clientContext); + this.setInstanceTemplateInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + setInstanceTemplateInstanceGroupManagerTransportSettings, + settings.setInstanceTemplateInstanceGroupManagerSettings(), + clientContext); + this.setTargetPoolsInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + setTargetPoolsInstanceGroupManagerTransportSettings, + settings.setTargetPoolsInstanceGroupManagerSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable abandonInstancesInstanceGroupManagerCallable() { + public UnaryCallable + abandonInstancesInstanceGroupManagerCallable() { return abandonInstancesInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { + public UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersPagedCallable() { return aggregatedListInstanceGroupManagersPagedCallable; } @BetaApi - public UnaryCallable aggregatedListInstanceGroupManagersCallable() { + public UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersCallable() { return aggregatedListInstanceGroupManagersCallable; } @BetaApi - public UnaryCallable deleteInstanceGroupManagerCallable() { + public UnaryCallable + deleteInstanceGroupManagerCallable() { return deleteInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable deleteInstancesInstanceGroupManagerCallable() { + public UnaryCallable + deleteInstancesInstanceGroupManagerCallable() { return deleteInstancesInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable getInstanceGroupManagerCallable() { + public UnaryCallable + getInstanceGroupManagerCallable() { return getInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable insertInstanceGroupManagerCallable() { + public UnaryCallable + insertInstanceGroupManagerCallable() { return insertInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable listInstanceGroupManagersPagedCallable() { + public UnaryCallable + listInstanceGroupManagersPagedCallable() { return listInstanceGroupManagersPagedCallable; } @BetaApi - public UnaryCallable listInstanceGroupManagersCallable() { + public UnaryCallable + listInstanceGroupManagersCallable() { return listInstanceGroupManagersCallable; } @BetaApi - public UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { + public UnaryCallable< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersCallable() { return listManagedInstancesInstanceGroupManagersCallable; } @BetaApi - public UnaryCallable recreateInstancesInstanceGroupManagerCallable() { + public UnaryCallable + recreateInstancesInstanceGroupManagerCallable() { return recreateInstancesInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable resizeInstanceGroupManagerCallable() { + public UnaryCallable + resizeInstanceGroupManagerCallable() { return resizeInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { + public UnaryCallable + setInstanceTemplateInstanceGroupManagerCallable() { return setInstanceTemplateInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { + public UnaryCallable + setTargetPoolsInstanceGroupManagerCallable() { return setTargetPoolsInstanceGroupManagerCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -528,5 +712,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java index 8c617fb4f532..f7b56558affd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -15,6 +15,10 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +30,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; @@ -36,18 +39,8 @@ import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; import com.google.cloud.compute.v1.InstanceGroup; import com.google.cloud.compute.v1.InstanceGroupAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.InstanceGroupList; -import com.google.cloud.compute.v1.InstanceGroupSettings; -import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; import com.google.cloud.compute.v1.InstanceGroupsListInstances; -import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsScopedList; -import com.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; -import com.google.cloud.compute.v1.InstanceWithNamedPorts; import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.Operation; @@ -56,12 +49,8 @@ import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -75,294 +64,406 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceGroupStub extends InstanceGroupStub { @InternalApi - public static final ApiMethodDescriptor addInstancesInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.addInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + addInstancesInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.addInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor aggregatedListInstanceGroupsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroups")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList> + aggregatedListInstanceGroupsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroups.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroups")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroup.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroup.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInstanceGroupsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceGroupsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listInstanceGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInstancesInstanceGroupsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.listInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupsListInstances.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances> + listInstancesInstanceGroupsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceGroups.listInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupsListInstances.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor removeInstancesInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.removeInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + removeInstancesInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.removeInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setNamedPortsInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceGroups.setNamedPorts") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setNamedPortsInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroups.setNamedPorts") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable addInstancesInstanceGroupCallable; - private final UnaryCallable aggregatedListInstanceGroupsCallable; - private final UnaryCallable aggregatedListInstanceGroupsPagedCallable; - private final UnaryCallable deleteInstanceGroupCallable; + private final UnaryCallable + addInstancesInstanceGroupCallable; + private final UnaryCallable + aggregatedListInstanceGroupsCallable; + private final UnaryCallable< + AggregatedListInstanceGroupsHttpRequest, AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsPagedCallable; + private final UnaryCallable + deleteInstanceGroupCallable; private final UnaryCallable getInstanceGroupCallable; - private final UnaryCallable insertInstanceGroupCallable; - private final UnaryCallable listInstanceGroupsCallable; - private final UnaryCallable listInstanceGroupsPagedCallable; - private final UnaryCallable listInstancesInstanceGroupsCallable; - private final UnaryCallable listInstancesInstanceGroupsPagedCallable; - private final UnaryCallable removeInstancesInstanceGroupCallable; - private final UnaryCallable setNamedPortsInstanceGroupCallable; + private final UnaryCallable + insertInstanceGroupCallable; + private final UnaryCallable + listInstanceGroupsCallable; + private final UnaryCallable + listInstanceGroupsPagedCallable; + private final UnaryCallable + listInstancesInstanceGroupsCallable; + private final UnaryCallable< + ListInstancesInstanceGroupsHttpRequest, ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsPagedCallable; + private final UnaryCallable + removeInstancesInstanceGroupCallable; + private final UnaryCallable + setNamedPortsInstanceGroupCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInstanceGroupStub create(InstanceGroupStubSettings settings) throws IOException { + + public static final HttpJsonInstanceGroupStub create(InstanceGroupStubSettings settings) + throws IOException { return new HttpJsonInstanceGroupStub(settings, ClientContext.create(settings)); } - public static final HttpJsonInstanceGroupStub create(ClientContext clientContext) throws IOException { - return new HttpJsonInstanceGroupStub(InstanceGroupStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonInstanceGroupStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonInstanceGroupStub( + InstanceGroupStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInstanceGroupStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInstanceGroupStub(InstanceGroupStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInstanceGroupStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceGroupStub( + InstanceGroupStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInstanceGroupStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceGroupStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInstanceGroupStub(InstanceGroupStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInstanceGroupStub( + InstanceGroupStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonInstanceGroupCallableFactory()); } /** - * Constructs an instance of HttpJsonInstanceGroupStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceGroupStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInstanceGroupStub(InstanceGroupStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInstanceGroupStub( + InstanceGroupStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings addInstancesInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(addInstancesInstanceGroupMethodDescriptor) - .build(); - HttpJsonCallSettings aggregatedListInstanceGroupsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListInstanceGroupsMethodDescriptor) - .build(); - HttpJsonCallSettings deleteInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInstanceGroupMethodDescriptor) - .build(); - HttpJsonCallSettings getInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getInstanceGroupMethodDescriptor) - .build(); - HttpJsonCallSettings insertInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertInstanceGroupMethodDescriptor) - .build(); - HttpJsonCallSettings listInstanceGroupsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInstanceGroupsMethodDescriptor) - .build(); - HttpJsonCallSettings listInstancesInstanceGroupsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInstancesInstanceGroupsMethodDescriptor) - .build(); - HttpJsonCallSettings removeInstancesInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(removeInstancesInstanceGroupMethodDescriptor) - .build(); - HttpJsonCallSettings setNamedPortsInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setNamedPortsInstanceGroupMethodDescriptor) - .build(); - - this.addInstancesInstanceGroupCallable = callableFactory.createUnaryCallable(addInstancesInstanceGroupTransportSettings,settings.addInstancesInstanceGroupSettings(), clientContext); - this.aggregatedListInstanceGroupsCallable = callableFactory.createUnaryCallable(aggregatedListInstanceGroupsTransportSettings,settings.aggregatedListInstanceGroupsSettings(), clientContext); - this.aggregatedListInstanceGroupsPagedCallable = callableFactory.createPagedCallable(aggregatedListInstanceGroupsTransportSettings,settings.aggregatedListInstanceGroupsSettings(), clientContext); - this.deleteInstanceGroupCallable = callableFactory.createUnaryCallable(deleteInstanceGroupTransportSettings,settings.deleteInstanceGroupSettings(), clientContext); - this.getInstanceGroupCallable = callableFactory.createUnaryCallable(getInstanceGroupTransportSettings,settings.getInstanceGroupSettings(), clientContext); - this.insertInstanceGroupCallable = callableFactory.createUnaryCallable(insertInstanceGroupTransportSettings,settings.insertInstanceGroupSettings(), clientContext); - this.listInstanceGroupsCallable = callableFactory.createUnaryCallable(listInstanceGroupsTransportSettings,settings.listInstanceGroupsSettings(), clientContext); - this.listInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listInstanceGroupsTransportSettings,settings.listInstanceGroupsSettings(), clientContext); - this.listInstancesInstanceGroupsCallable = callableFactory.createUnaryCallable(listInstancesInstanceGroupsTransportSettings,settings.listInstancesInstanceGroupsSettings(), clientContext); - this.listInstancesInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listInstancesInstanceGroupsTransportSettings,settings.listInstancesInstanceGroupsSettings(), clientContext); - this.removeInstancesInstanceGroupCallable = callableFactory.createUnaryCallable(removeInstancesInstanceGroupTransportSettings,settings.removeInstancesInstanceGroupSettings(), clientContext); - this.setNamedPortsInstanceGroupCallable = callableFactory.createUnaryCallable(setNamedPortsInstanceGroupTransportSettings,settings.setNamedPortsInstanceGroupSettings(), clientContext); + HttpJsonCallSettings + addInstancesInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addInstancesInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + aggregatedListInstanceGroupsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + getInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + insertInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + listInstanceGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings + listInstancesInstanceGroupsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listInstancesInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings + removeInstancesInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removeInstancesInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + setNamedPortsInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setNamedPortsInstanceGroupMethodDescriptor) + .build(); + + this.addInstancesInstanceGroupCallable = + callableFactory.createUnaryCallable( + addInstancesInstanceGroupTransportSettings, + settings.addInstancesInstanceGroupSettings(), + clientContext); + this.aggregatedListInstanceGroupsCallable = + callableFactory.createUnaryCallable( + aggregatedListInstanceGroupsTransportSettings, + settings.aggregatedListInstanceGroupsSettings(), + clientContext); + this.aggregatedListInstanceGroupsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListInstanceGroupsTransportSettings, + settings.aggregatedListInstanceGroupsSettings(), + clientContext); + this.deleteInstanceGroupCallable = + callableFactory.createUnaryCallable( + deleteInstanceGroupTransportSettings, + settings.deleteInstanceGroupSettings(), + clientContext); + this.getInstanceGroupCallable = + callableFactory.createUnaryCallable( + getInstanceGroupTransportSettings, settings.getInstanceGroupSettings(), clientContext); + this.insertInstanceGroupCallable = + callableFactory.createUnaryCallable( + insertInstanceGroupTransportSettings, + settings.insertInstanceGroupSettings(), + clientContext); + this.listInstanceGroupsCallable = + callableFactory.createUnaryCallable( + listInstanceGroupsTransportSettings, + settings.listInstanceGroupsSettings(), + clientContext); + this.listInstanceGroupsPagedCallable = + callableFactory.createPagedCallable( + listInstanceGroupsTransportSettings, + settings.listInstanceGroupsSettings(), + clientContext); + this.listInstancesInstanceGroupsCallable = + callableFactory.createUnaryCallable( + listInstancesInstanceGroupsTransportSettings, + settings.listInstancesInstanceGroupsSettings(), + clientContext); + this.listInstancesInstanceGroupsPagedCallable = + callableFactory.createPagedCallable( + listInstancesInstanceGroupsTransportSettings, + settings.listInstancesInstanceGroupsSettings(), + clientContext); + this.removeInstancesInstanceGroupCallable = + callableFactory.createUnaryCallable( + removeInstancesInstanceGroupTransportSettings, + settings.removeInstancesInstanceGroupSettings(), + clientContext); + this.setNamedPortsInstanceGroupCallable = + callableFactory.createUnaryCallable( + setNamedPortsInstanceGroupTransportSettings, + settings.setNamedPortsInstanceGroupSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable addInstancesInstanceGroupCallable() { + public UnaryCallable + addInstancesInstanceGroupCallable() { return addInstancesInstanceGroupCallable; } @BetaApi - public UnaryCallable aggregatedListInstanceGroupsPagedCallable() { + public UnaryCallable< + AggregatedListInstanceGroupsHttpRequest, AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsPagedCallable() { return aggregatedListInstanceGroupsPagedCallable; } @BetaApi - public UnaryCallable aggregatedListInstanceGroupsCallable() { + public UnaryCallable + aggregatedListInstanceGroupsCallable() { return aggregatedListInstanceGroupsCallable; } @@ -382,37 +483,44 @@ public UnaryCallable insertInstanceGr } @BetaApi - public UnaryCallable listInstanceGroupsPagedCallable() { + public UnaryCallable + listInstanceGroupsPagedCallable() { return listInstanceGroupsPagedCallable; } @BetaApi - public UnaryCallable listInstanceGroupsCallable() { + public UnaryCallable + listInstanceGroupsCallable() { return listInstanceGroupsCallable; } @BetaApi - public UnaryCallable listInstancesInstanceGroupsPagedCallable() { + public UnaryCallable< + ListInstancesInstanceGroupsHttpRequest, ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsPagedCallable() { return listInstancesInstanceGroupsPagedCallable; } @BetaApi - public UnaryCallable listInstancesInstanceGroupsCallable() { + public UnaryCallable + listInstancesInstanceGroupsCallable() { return listInstancesInstanceGroupsCallable; } @BetaApi - public UnaryCallable removeInstancesInstanceGroupCallable() { + public UnaryCallable + removeInstancesInstanceGroupCallable() { return removeInstancesInstanceGroupCallable; } @BetaApi - public UnaryCallable setNamedPortsInstanceGroupCallable() { + public UnaryCallable + setNamedPortsInstanceGroupCallable() { return setNamedPortsInstanceGroupCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -440,5 +548,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index c804819cccc5..01bdcb6ee545 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -15,6 +15,10 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,14 +30,11 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AccessConfig; import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; -import com.google.cloud.compute.v1.AttachedDisk; import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; @@ -42,30 +43,16 @@ import com.google.cloud.compute.v1.InsertInstanceHttpRequest; import com.google.cloud.compute.v1.Instance; import com.google.cloud.compute.v1.InstanceAggregatedList; -import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.InstanceList; import com.google.cloud.compute.v1.InstanceListReferrers; -import com.google.cloud.compute.v1.InstanceSettings; -import com.google.cloud.compute.v1.InstancesScopedList; -import com.google.cloud.compute.v1.InstancesSetLabelsRequest; -import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest; -import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; -import com.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; -import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; -import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; import com.google.cloud.compute.v1.ListInstancesHttpRequest; import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; -import com.google.cloud.compute.v1.Metadata; -import com.google.cloud.compute.v1.NetworkInterface; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneInstanceName; +import com.google.cloud.compute.v1.ProjectZoneInstanceResourceName; import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.Reference; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; -import com.google.cloud.compute.v1.Scheduling; import com.google.cloud.compute.v1.SerialPortOutput; import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; @@ -80,15 +67,10 @@ import com.google.cloud.compute.v1.StartInstanceHttpRequest; import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; -import com.google.cloud.compute.v1.Tags; import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -102,579 +84,666 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceStub extends InstanceStub { @InternalApi - public static final ApiMethodDescriptor addAccessConfigInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.addAccessConfig") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/addAccessConfig")) - .setQueryParams(Sets.newHashSet( - "networkInterface", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + addAccessConfigInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.addAccessConfig") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/addAccessConfig")) + .setQueryParams(Sets.newHashSet("networkInterface", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor aggregatedListInstancesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListInstancesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/instances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListInstancesHttpRequest, InstanceAggregatedList> + aggregatedListInstancesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instances.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/instances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor attachDiskInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.attachDisk") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/attachDisk")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + attachDiskInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.attachDisk") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/attachDisk")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteAccessConfigInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.deleteAccessConfig") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) - .setQueryParams(Sets.newHashSet( - "accessConfig", "networkInterface", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteAccessConfigInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.deleteAccessConfig") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) + .setQueryParams( + Sets.newHashSet("accessConfig", "networkInterface", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor detachDiskInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.detachDisk") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/detachDisk")) - .setQueryParams(Sets.newHashSet( - "deviceName", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + detachDiskInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.detachDisk") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/detachDisk")) + .setQueryParams(Sets.newHashSet("deviceName", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Instance.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Instance.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getSerialPortOutputInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.getSerialPortOutput") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/serialPort")) - .setQueryParams(Sets.newHashSet( - "port", "start" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(SerialPortOutput.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getSerialPortOutputInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.getSerialPortOutput") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/serialPort")) + .setQueryParams(Sets.newHashSet("port", "start")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SerialPortOutput.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) + .setQueryParams( + Sets.newHashSet("requestId", "sourceInstanceTemplate")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInstancesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstancesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listReferrersInstancesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.listReferrers") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListReferrersInstancesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/referrers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceListReferrers.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listReferrersInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.listReferrers") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListReferrersInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/referrers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceListReferrers.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor resetInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.reset") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + resetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.reset") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setDeletionProtectionInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setDeletionProtection") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{resource}/setDeletionProtection")) - .setQueryParams(Sets.newHashSet( - "deletionProtection", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("resource") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setDeletionProtectionInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setDeletionProtection") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")) + .setQueryParams(Sets.newHashSet("deletionProtection", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setDiskAutoDeleteInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setDiskAutoDelete") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) - .setQueryParams(Sets.newHashSet( - "autoDelete", "deviceName", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setDiskAutoDeleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setDiskAutoDelete") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) + .setQueryParams( + Sets.newHashSet("autoDelete", "deviceName", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setLabelsInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setLabels") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setLabels")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setLabelsInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setLabels")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setMachineResourcesInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setMachineResources") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMachineResources")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setMachineResourcesInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMachineResources") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setMachineResources")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setMachineTypeInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setMachineType") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMachineType")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setMachineTypeInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMachineType") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setMachineType")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setMetadataInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setMetadata") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMetadata")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setMetadataInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMetadata") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setMetadata")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setMinCpuPlatformInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setMinCpuPlatform") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setMinCpuPlatformInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setMinCpuPlatform") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setSchedulingInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setScheduling") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setScheduling")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setSchedulingInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setScheduling") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setScheduling")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setServiceAccountInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setServiceAccount") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setServiceAccount")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setServiceAccountInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setServiceAccount") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setServiceAccount")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setTagsInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.setTags") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/setTags")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setTagsInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setTags") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/setTags")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor startInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.start") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + startInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.start") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor startWithEncryptionKeyInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.startWithEncryptionKey") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + startWithEncryptionKeyInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.startWithEncryptionKey") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor stopInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.stop") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + stopInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.stop") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateAccessConfigInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.updateAccessConfig") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/updateAccessConfig")) - .setQueryParams(Sets.newHashSet( - "networkInterface", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateAccessConfigInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.updateAccessConfig") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")) + .setQueryParams(Sets.newHashSet("networkInterface", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateNetworkInterfaceInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instances.updateNetworkInterface") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")) - .setQueryParams(Sets.newHashSet( - "networkInterface", "requestId" - )) - .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) - .setResourceNameField("instance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateNetworkInterfaceInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.updateNetworkInterface") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")) + .setQueryParams(Sets.newHashSet("networkInterface", "requestId")) + .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) + .setResourceNameField("instance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable addAccessConfigInstanceCallable; - private final UnaryCallable aggregatedListInstancesCallable; - private final UnaryCallable aggregatedListInstancesPagedCallable; + private final UnaryCallable + addAccessConfigInstanceCallable; + private final UnaryCallable + aggregatedListInstancesCallable; + private final UnaryCallable< + AggregatedListInstancesHttpRequest, AggregatedListInstancesPagedResponse> + aggregatedListInstancesPagedCallable; private final UnaryCallable attachDiskInstanceCallable; private final UnaryCallable deleteInstanceCallable; - private final UnaryCallable deleteAccessConfigInstanceCallable; + private final UnaryCallable + deleteAccessConfigInstanceCallable; private final UnaryCallable detachDiskInstanceCallable; private final UnaryCallable getInstanceCallable; - private final UnaryCallable getSerialPortOutputInstanceCallable; + private final UnaryCallable + getSerialPortOutputInstanceCallable; private final UnaryCallable insertInstanceCallable; private final UnaryCallable listInstancesCallable; - private final UnaryCallable listInstancesPagedCallable; - private final UnaryCallable listReferrersInstancesCallable; - private final UnaryCallable listReferrersInstancesPagedCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable + listReferrersInstancesCallable; + private final UnaryCallable< + ListReferrersInstancesHttpRequest, ListReferrersInstancesPagedResponse> + listReferrersInstancesPagedCallable; private final UnaryCallable resetInstanceCallable; - private final UnaryCallable setDeletionProtectionInstanceCallable; - private final UnaryCallable setDiskAutoDeleteInstanceCallable; + private final UnaryCallable + setDeletionProtectionInstanceCallable; + private final UnaryCallable + setDiskAutoDeleteInstanceCallable; private final UnaryCallable setLabelsInstanceCallable; - private final UnaryCallable setMachineResourcesInstanceCallable; - private final UnaryCallable setMachineTypeInstanceCallable; - private final UnaryCallable setMetadataInstanceCallable; - private final UnaryCallable setMinCpuPlatformInstanceCallable; - private final UnaryCallable setSchedulingInstanceCallable; - private final UnaryCallable setServiceAccountInstanceCallable; + private final UnaryCallable + setMachineResourcesInstanceCallable; + private final UnaryCallable + setMachineTypeInstanceCallable; + private final UnaryCallable + setMetadataInstanceCallable; + private final UnaryCallable + setMinCpuPlatformInstanceCallable; + private final UnaryCallable + setSchedulingInstanceCallable; + private final UnaryCallable + setServiceAccountInstanceCallable; private final UnaryCallable setTagsInstanceCallable; private final UnaryCallable startInstanceCallable; - private final UnaryCallable startWithEncryptionKeyInstanceCallable; + private final UnaryCallable + startWithEncryptionKeyInstanceCallable; private final UnaryCallable stopInstanceCallable; - private final UnaryCallable updateAccessConfigInstanceCallable; - private final UnaryCallable updateNetworkInterfaceInstanceCallable; + private final UnaryCallable + updateAccessConfigInstanceCallable; + private final UnaryCallable + updateNetworkInterfaceInstanceCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInstanceStub create(InstanceStubSettings settings) throws IOException { + + public static final HttpJsonInstanceStub create(InstanceStubSettings settings) + throws IOException { return new HttpJsonInstanceStub(settings, ClientContext.create(settings)); } @@ -682,59 +751,74 @@ public static final HttpJsonInstanceStub create(ClientContext clientContext) thr return new HttpJsonInstanceStub(InstanceStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInstanceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInstanceStub(InstanceStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInstanceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceStub( + InstanceStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInstanceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonInstanceCallableFactory()); } /** - * Constructs an instance of HttpJsonInstanceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInstanceStub( + InstanceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings addAccessConfigInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(addAccessConfigInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings aggregatedListInstancesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListInstancesMethodDescriptor) - .build(); - HttpJsonCallSettings attachDiskInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(attachDiskInstanceMethodDescriptor) - .build(); + HttpJsonCallSettings + addAccessConfigInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addAccessConfigInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + aggregatedListInstancesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListInstancesMethodDescriptor) + .build(); + HttpJsonCallSettings + attachDiskInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attachDiskInstanceMethodDescriptor) + .build(); HttpJsonCallSettings deleteInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteInstanceMethodDescriptor) .build(); - HttpJsonCallSettings deleteAccessConfigInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteAccessConfigInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings detachDiskInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(detachDiskInstanceMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteAccessConfigInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAccessConfigInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + detachDiskInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(detachDiskInstanceMethodDescriptor) + .build(); HttpJsonCallSettings getInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getInstanceMethodDescriptor) .build(); - HttpJsonCallSettings getSerialPortOutputInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSerialPortOutputInstanceMethodDescriptor) - .build(); + HttpJsonCallSettings + getSerialPortOutputInstanceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getSerialPortOutputInstanceMethodDescriptor) + .build(); HttpJsonCallSettings insertInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertInstanceMethodDescriptor) @@ -743,50 +827,61 @@ protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listInstancesMethodDescriptor) .build(); - HttpJsonCallSettings listReferrersInstancesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listReferrersInstancesMethodDescriptor) - .build(); + HttpJsonCallSettings + listReferrersInstancesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listReferrersInstancesMethodDescriptor) + .build(); HttpJsonCallSettings resetInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(resetInstanceMethodDescriptor) .build(); - HttpJsonCallSettings setDeletionProtectionInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setDeletionProtectionInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setDiskAutoDeleteInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setDiskAutoDeleteInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setLabelsInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setLabelsInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setMachineResourcesInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setMachineResourcesInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setMachineTypeInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setMachineTypeInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setMetadataInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setMetadataInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setMinCpuPlatformInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setMinCpuPlatformInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setSchedulingInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setSchedulingInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings setServiceAccountInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setServiceAccountInstanceMethodDescriptor) - .build(); + HttpJsonCallSettings + setDeletionProtectionInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDeletionProtectionInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setDiskAutoDeleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDiskAutoDeleteInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setLabelsInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setMachineResourcesInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMachineResourcesInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setMachineTypeInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMachineTypeInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setMetadataInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMetadataInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setMinCpuPlatformInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setMinCpuPlatformInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setSchedulingInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSchedulingInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + setServiceAccountInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setServiceAccountInstanceMethodDescriptor) + .build(); HttpJsonCallSettings setTagsInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setTagsInstanceMethodDescriptor) @@ -795,69 +890,177 @@ protected HttpJsonInstanceStub(InstanceStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(startInstanceMethodDescriptor) .build(); - HttpJsonCallSettings startWithEncryptionKeyInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(startWithEncryptionKeyInstanceMethodDescriptor) - .build(); + HttpJsonCallSettings + startWithEncryptionKeyInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startWithEncryptionKeyInstanceMethodDescriptor) + .build(); HttpJsonCallSettings stopInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(stopInstanceMethodDescriptor) .build(); - HttpJsonCallSettings updateAccessConfigInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateAccessConfigInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings updateNetworkInterfaceInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateNetworkInterfaceInstanceMethodDescriptor) - .build(); + HttpJsonCallSettings + updateAccessConfigInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAccessConfigInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + updateNetworkInterfaceInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateNetworkInterfaceInstanceMethodDescriptor) + .build(); - this.addAccessConfigInstanceCallable = callableFactory.createUnaryCallable(addAccessConfigInstanceTransportSettings,settings.addAccessConfigInstanceSettings(), clientContext); - this.aggregatedListInstancesCallable = callableFactory.createUnaryCallable(aggregatedListInstancesTransportSettings,settings.aggregatedListInstancesSettings(), clientContext); - this.aggregatedListInstancesPagedCallable = callableFactory.createPagedCallable(aggregatedListInstancesTransportSettings,settings.aggregatedListInstancesSettings(), clientContext); - this.attachDiskInstanceCallable = callableFactory.createUnaryCallable(attachDiskInstanceTransportSettings,settings.attachDiskInstanceSettings(), clientContext); - this.deleteInstanceCallable = callableFactory.createUnaryCallable(deleteInstanceTransportSettings,settings.deleteInstanceSettings(), clientContext); - this.deleteAccessConfigInstanceCallable = callableFactory.createUnaryCallable(deleteAccessConfigInstanceTransportSettings,settings.deleteAccessConfigInstanceSettings(), clientContext); - this.detachDiskInstanceCallable = callableFactory.createUnaryCallable(detachDiskInstanceTransportSettings,settings.detachDiskInstanceSettings(), clientContext); - this.getInstanceCallable = callableFactory.createUnaryCallable(getInstanceTransportSettings,settings.getInstanceSettings(), clientContext); - this.getSerialPortOutputInstanceCallable = callableFactory.createUnaryCallable(getSerialPortOutputInstanceTransportSettings,settings.getSerialPortOutputInstanceSettings(), clientContext); - this.insertInstanceCallable = callableFactory.createUnaryCallable(insertInstanceTransportSettings,settings.insertInstanceSettings(), clientContext); - this.listInstancesCallable = callableFactory.createUnaryCallable(listInstancesTransportSettings,settings.listInstancesSettings(), clientContext); - this.listInstancesPagedCallable = callableFactory.createPagedCallable(listInstancesTransportSettings,settings.listInstancesSettings(), clientContext); - this.listReferrersInstancesCallable = callableFactory.createUnaryCallable(listReferrersInstancesTransportSettings,settings.listReferrersInstancesSettings(), clientContext); - this.listReferrersInstancesPagedCallable = callableFactory.createPagedCallable(listReferrersInstancesTransportSettings,settings.listReferrersInstancesSettings(), clientContext); - this.resetInstanceCallable = callableFactory.createUnaryCallable(resetInstanceTransportSettings,settings.resetInstanceSettings(), clientContext); - this.setDeletionProtectionInstanceCallable = callableFactory.createUnaryCallable(setDeletionProtectionInstanceTransportSettings,settings.setDeletionProtectionInstanceSettings(), clientContext); - this.setDiskAutoDeleteInstanceCallable = callableFactory.createUnaryCallable(setDiskAutoDeleteInstanceTransportSettings,settings.setDiskAutoDeleteInstanceSettings(), clientContext); - this.setLabelsInstanceCallable = callableFactory.createUnaryCallable(setLabelsInstanceTransportSettings,settings.setLabelsInstanceSettings(), clientContext); - this.setMachineResourcesInstanceCallable = callableFactory.createUnaryCallable(setMachineResourcesInstanceTransportSettings,settings.setMachineResourcesInstanceSettings(), clientContext); - this.setMachineTypeInstanceCallable = callableFactory.createUnaryCallable(setMachineTypeInstanceTransportSettings,settings.setMachineTypeInstanceSettings(), clientContext); - this.setMetadataInstanceCallable = callableFactory.createUnaryCallable(setMetadataInstanceTransportSettings,settings.setMetadataInstanceSettings(), clientContext); - this.setMinCpuPlatformInstanceCallable = callableFactory.createUnaryCallable(setMinCpuPlatformInstanceTransportSettings,settings.setMinCpuPlatformInstanceSettings(), clientContext); - this.setSchedulingInstanceCallable = callableFactory.createUnaryCallable(setSchedulingInstanceTransportSettings,settings.setSchedulingInstanceSettings(), clientContext); - this.setServiceAccountInstanceCallable = callableFactory.createUnaryCallable(setServiceAccountInstanceTransportSettings,settings.setServiceAccountInstanceSettings(), clientContext); - this.setTagsInstanceCallable = callableFactory.createUnaryCallable(setTagsInstanceTransportSettings,settings.setTagsInstanceSettings(), clientContext); - this.startInstanceCallable = callableFactory.createUnaryCallable(startInstanceTransportSettings,settings.startInstanceSettings(), clientContext); - this.startWithEncryptionKeyInstanceCallable = callableFactory.createUnaryCallable(startWithEncryptionKeyInstanceTransportSettings,settings.startWithEncryptionKeyInstanceSettings(), clientContext); - this.stopInstanceCallable = callableFactory.createUnaryCallable(stopInstanceTransportSettings,settings.stopInstanceSettings(), clientContext); - this.updateAccessConfigInstanceCallable = callableFactory.createUnaryCallable(updateAccessConfigInstanceTransportSettings,settings.updateAccessConfigInstanceSettings(), clientContext); - this.updateNetworkInterfaceInstanceCallable = callableFactory.createUnaryCallable(updateNetworkInterfaceInstanceTransportSettings,settings.updateNetworkInterfaceInstanceSettings(), clientContext); + this.addAccessConfigInstanceCallable = + callableFactory.createUnaryCallable( + addAccessConfigInstanceTransportSettings, + settings.addAccessConfigInstanceSettings(), + clientContext); + this.aggregatedListInstancesCallable = + callableFactory.createUnaryCallable( + aggregatedListInstancesTransportSettings, + settings.aggregatedListInstancesSettings(), + clientContext); + this.aggregatedListInstancesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListInstancesTransportSettings, + settings.aggregatedListInstancesSettings(), + clientContext); + this.attachDiskInstanceCallable = + callableFactory.createUnaryCallable( + attachDiskInstanceTransportSettings, + settings.attachDiskInstanceSettings(), + clientContext); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteAccessConfigInstanceCallable = + callableFactory.createUnaryCallable( + deleteAccessConfigInstanceTransportSettings, + settings.deleteAccessConfigInstanceSettings(), + clientContext); + this.detachDiskInstanceCallable = + callableFactory.createUnaryCallable( + detachDiskInstanceTransportSettings, + settings.detachDiskInstanceSettings(), + clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.getSerialPortOutputInstanceCallable = + callableFactory.createUnaryCallable( + getSerialPortOutputInstanceTransportSettings, + settings.getSerialPortOutputInstanceSettings(), + clientContext); + this.insertInstanceCallable = + callableFactory.createUnaryCallable( + insertInstanceTransportSettings, settings.insertInstanceSettings(), clientContext); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listReferrersInstancesCallable = + callableFactory.createUnaryCallable( + listReferrersInstancesTransportSettings, + settings.listReferrersInstancesSettings(), + clientContext); + this.listReferrersInstancesPagedCallable = + callableFactory.createPagedCallable( + listReferrersInstancesTransportSettings, + settings.listReferrersInstancesSettings(), + clientContext); + this.resetInstanceCallable = + callableFactory.createUnaryCallable( + resetInstanceTransportSettings, settings.resetInstanceSettings(), clientContext); + this.setDeletionProtectionInstanceCallable = + callableFactory.createUnaryCallable( + setDeletionProtectionInstanceTransportSettings, + settings.setDeletionProtectionInstanceSettings(), + clientContext); + this.setDiskAutoDeleteInstanceCallable = + callableFactory.createUnaryCallable( + setDiskAutoDeleteInstanceTransportSettings, + settings.setDiskAutoDeleteInstanceSettings(), + clientContext); + this.setLabelsInstanceCallable = + callableFactory.createUnaryCallable( + setLabelsInstanceTransportSettings, + settings.setLabelsInstanceSettings(), + clientContext); + this.setMachineResourcesInstanceCallable = + callableFactory.createUnaryCallable( + setMachineResourcesInstanceTransportSettings, + settings.setMachineResourcesInstanceSettings(), + clientContext); + this.setMachineTypeInstanceCallable = + callableFactory.createUnaryCallable( + setMachineTypeInstanceTransportSettings, + settings.setMachineTypeInstanceSettings(), + clientContext); + this.setMetadataInstanceCallable = + callableFactory.createUnaryCallable( + setMetadataInstanceTransportSettings, + settings.setMetadataInstanceSettings(), + clientContext); + this.setMinCpuPlatformInstanceCallable = + callableFactory.createUnaryCallable( + setMinCpuPlatformInstanceTransportSettings, + settings.setMinCpuPlatformInstanceSettings(), + clientContext); + this.setSchedulingInstanceCallable = + callableFactory.createUnaryCallable( + setSchedulingInstanceTransportSettings, + settings.setSchedulingInstanceSettings(), + clientContext); + this.setServiceAccountInstanceCallable = + callableFactory.createUnaryCallable( + setServiceAccountInstanceTransportSettings, + settings.setServiceAccountInstanceSettings(), + clientContext); + this.setTagsInstanceCallable = + callableFactory.createUnaryCallable( + setTagsInstanceTransportSettings, settings.setTagsInstanceSettings(), clientContext); + this.startInstanceCallable = + callableFactory.createUnaryCallable( + startInstanceTransportSettings, settings.startInstanceSettings(), clientContext); + this.startWithEncryptionKeyInstanceCallable = + callableFactory.createUnaryCallable( + startWithEncryptionKeyInstanceTransportSettings, + settings.startWithEncryptionKeyInstanceSettings(), + clientContext); + this.stopInstanceCallable = + callableFactory.createUnaryCallable( + stopInstanceTransportSettings, settings.stopInstanceSettings(), clientContext); + this.updateAccessConfigInstanceCallable = + callableFactory.createUnaryCallable( + updateAccessConfigInstanceTransportSettings, + settings.updateAccessConfigInstanceSettings(), + clientContext); + this.updateNetworkInterfaceInstanceCallable = + callableFactory.createUnaryCallable( + updateNetworkInterfaceInstanceTransportSettings, + settings.updateNetworkInterfaceInstanceSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable addAccessConfigInstanceCallable() { + public UnaryCallable + addAccessConfigInstanceCallable() { return addAccessConfigInstanceCallable; } @BetaApi - public UnaryCallable aggregatedListInstancesPagedCallable() { + public UnaryCallable + aggregatedListInstancesPagedCallable() { return aggregatedListInstancesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListInstancesCallable() { + public UnaryCallable + aggregatedListInstancesCallable() { return aggregatedListInstancesCallable; } @@ -872,7 +1075,8 @@ public UnaryCallable deleteInstanceCallabl } @BetaApi - public UnaryCallable deleteAccessConfigInstanceCallable() { + public UnaryCallable + deleteAccessConfigInstanceCallable() { return deleteAccessConfigInstanceCallable; } @@ -887,7 +1091,8 @@ public UnaryCallable getInstanceCallable() { } @BetaApi - public UnaryCallable getSerialPortOutputInstanceCallable() { + public UnaryCallable + getSerialPortOutputInstanceCallable() { return getSerialPortOutputInstanceCallable; } @@ -897,7 +1102,8 @@ public UnaryCallable insertInstanceCallabl } @BetaApi - public UnaryCallable listInstancesPagedCallable() { + public UnaryCallable + listInstancesPagedCallable() { return listInstancesPagedCallable; } @@ -907,12 +1113,14 @@ public UnaryCallable listInstancesCallab } @BetaApi - public UnaryCallable listReferrersInstancesPagedCallable() { + public UnaryCallable + listReferrersInstancesPagedCallable() { return listReferrersInstancesPagedCallable; } @BetaApi - public UnaryCallable listReferrersInstancesCallable() { + public UnaryCallable + listReferrersInstancesCallable() { return listReferrersInstancesCallable; } @@ -922,12 +1130,14 @@ public UnaryCallable resetInstanceCallable( } @BetaApi - public UnaryCallable setDeletionProtectionInstanceCallable() { + public UnaryCallable + setDeletionProtectionInstanceCallable() { return setDeletionProtectionInstanceCallable; } @BetaApi - public UnaryCallable setDiskAutoDeleteInstanceCallable() { + public UnaryCallable + setDiskAutoDeleteInstanceCallable() { return setDiskAutoDeleteInstanceCallable; } @@ -937,12 +1147,14 @@ public UnaryCallable setLabelsInstanceC } @BetaApi - public UnaryCallable setMachineResourcesInstanceCallable() { + public UnaryCallable + setMachineResourcesInstanceCallable() { return setMachineResourcesInstanceCallable; } @BetaApi - public UnaryCallable setMachineTypeInstanceCallable() { + public UnaryCallable + setMachineTypeInstanceCallable() { return setMachineTypeInstanceCallable; } @@ -952,17 +1164,20 @@ public UnaryCallable setMetadataInsta } @BetaApi - public UnaryCallable setMinCpuPlatformInstanceCallable() { + public UnaryCallable + setMinCpuPlatformInstanceCallable() { return setMinCpuPlatformInstanceCallable; } @BetaApi - public UnaryCallable setSchedulingInstanceCallable() { + public UnaryCallable + setSchedulingInstanceCallable() { return setSchedulingInstanceCallable; } @BetaApi - public UnaryCallable setServiceAccountInstanceCallable() { + public UnaryCallable + setServiceAccountInstanceCallable() { return setServiceAccountInstanceCallable; } @@ -977,7 +1192,8 @@ public UnaryCallable startInstanceCallable( } @BetaApi - public UnaryCallable startWithEncryptionKeyInstanceCallable() { + public UnaryCallable + startWithEncryptionKeyInstanceCallable() { return startWithEncryptionKeyInstanceCallable; } @@ -987,17 +1203,19 @@ public UnaryCallable stopInstanceCallable() } @BetaApi - public UnaryCallable updateAccessConfigInstanceCallable() { + public UnaryCallable + updateAccessConfigInstanceCallable() { return updateAccessConfigInstanceCallable; } @BetaApi - public UnaryCallable updateNetworkInterfaceInstanceCallable() { + public UnaryCallable + updateNetworkInterfaceInstanceCallable() { return updateNetworkInterfaceInstanceCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -1025,5 +1243,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java index 82089a05d878..62cebc4d2d75 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java @@ -15,49 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; -import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; -import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; -import com.google.cloud.compute.v1.InstanceTemplate; -import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; -import com.google.cloud.compute.v1.InstanceTemplateList; -import com.google.cloud.compute.v1.InstanceTemplateSettings; -import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectInstanceTemplateName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -74,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -91,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index 53ee6b2ff05c..5e7315088f31 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,26 +28,19 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InstanceTemplate; -import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; import com.google.cloud.compute.v1.InstanceTemplateList; -import com.google.cloud.compute.v1.InstanceTemplateSettings; import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectInstanceTemplateName; +import com.google.cloud.compute.v1.ProjectGlobalInstanceTemplateName; import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,175 +54,227 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { @InternalApi - public static final ApiMethodDescriptor deleteInstanceTemplateMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceTemplates.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates/{instanceTemplate}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectInstanceTemplateName.newFactory()) - .setResourceNameField("instanceTemplate") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/instanceTemplates/{instanceTemplate}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalInstanceTemplateName.newFactory()) + .setResourceNameField("instanceTemplate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getInstanceTemplateMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceTemplates.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceTemplateHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates/{instanceTemplate}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectInstanceTemplateName.newFactory()) - .setResourceNameField("instanceTemplate") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceTemplate.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceTemplateHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/instanceTemplates/{instanceTemplate}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalInstanceTemplateName.newFactory()) + .setResourceNameField("instanceTemplate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceTemplate.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertInstanceTemplateMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceTemplates.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInstanceTemplatesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.instanceTemplates.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceTemplatesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceTemplateList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listInstanceTemplatesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceTemplatesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceTemplateList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteInstanceTemplateCallable; - private final UnaryCallable getInstanceTemplateCallable; - private final UnaryCallable insertInstanceTemplateCallable; - private final UnaryCallable listInstanceTemplatesCallable; - private final UnaryCallable listInstanceTemplatesPagedCallable; + private final UnaryCallable + deleteInstanceTemplateCallable; + private final UnaryCallable + getInstanceTemplateCallable; + private final UnaryCallable + insertInstanceTemplateCallable; + private final UnaryCallable + listInstanceTemplatesCallable; + private final UnaryCallable + listInstanceTemplatesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInstanceTemplateStub create(InstanceTemplateStubSettings settings) throws IOException { + + public static final HttpJsonInstanceTemplateStub create(InstanceTemplateStubSettings settings) + throws IOException { return new HttpJsonInstanceTemplateStub(settings, ClientContext.create(settings)); } - public static final HttpJsonInstanceTemplateStub create(ClientContext clientContext) throws IOException { - return new HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonInstanceTemplateStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonInstanceTemplateStub( + InstanceTemplateStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInstanceTemplateStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInstanceTemplateStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInstanceTemplateStub( + InstanceTemplateStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInstanceTemplateStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceTemplateStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInstanceTemplateStub( + InstanceTemplateStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonInstanceTemplateCallableFactory()); } /** - * Constructs an instance of HttpJsonInstanceTemplateStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInstanceTemplateStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInstanceTemplateStub(InstanceTemplateStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInstanceTemplateStub( + InstanceTemplateStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteInstanceTemplateTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInstanceTemplateMethodDescriptor) - .build(); - HttpJsonCallSettings getInstanceTemplateTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getInstanceTemplateMethodDescriptor) - .build(); - HttpJsonCallSettings insertInstanceTemplateTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertInstanceTemplateMethodDescriptor) - .build(); - HttpJsonCallSettings listInstanceTemplatesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInstanceTemplatesMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + getInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + insertInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + listInstanceTemplatesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listInstanceTemplatesMethodDescriptor) + .build(); - this.deleteInstanceTemplateCallable = callableFactory.createUnaryCallable(deleteInstanceTemplateTransportSettings,settings.deleteInstanceTemplateSettings(), clientContext); - this.getInstanceTemplateCallable = callableFactory.createUnaryCallable(getInstanceTemplateTransportSettings,settings.getInstanceTemplateSettings(), clientContext); - this.insertInstanceTemplateCallable = callableFactory.createUnaryCallable(insertInstanceTemplateTransportSettings,settings.insertInstanceTemplateSettings(), clientContext); - this.listInstanceTemplatesCallable = callableFactory.createUnaryCallable(listInstanceTemplatesTransportSettings,settings.listInstanceTemplatesSettings(), clientContext); - this.listInstanceTemplatesPagedCallable = callableFactory.createPagedCallable(listInstanceTemplatesTransportSettings,settings.listInstanceTemplatesSettings(), clientContext); + this.deleteInstanceTemplateCallable = + callableFactory.createUnaryCallable( + deleteInstanceTemplateTransportSettings, + settings.deleteInstanceTemplateSettings(), + clientContext); + this.getInstanceTemplateCallable = + callableFactory.createUnaryCallable( + getInstanceTemplateTransportSettings, + settings.getInstanceTemplateSettings(), + clientContext); + this.insertInstanceTemplateCallable = + callableFactory.createUnaryCallable( + insertInstanceTemplateTransportSettings, + settings.insertInstanceTemplateSettings(), + clientContext); + this.listInstanceTemplatesCallable = + callableFactory.createUnaryCallable( + listInstanceTemplatesTransportSettings, + settings.listInstanceTemplatesSettings(), + clientContext); + this.listInstanceTemplatesPagedCallable = + callableFactory.createPagedCallable( + listInstanceTemplatesTransportSettings, + settings.listInstanceTemplatesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteInstanceTemplateCallable() { + public UnaryCallable + deleteInstanceTemplateCallable() { return deleteInstanceTemplateCallable; } @BetaApi - public UnaryCallable getInstanceTemplateCallable() { + public UnaryCallable + getInstanceTemplateCallable() { return getInstanceTemplateCallable; } @BetaApi - public UnaryCallable insertInstanceTemplateCallable() { + public UnaryCallable + insertInstanceTemplateCallable() { return insertInstanceTemplateCallable; } @BetaApi - public UnaryCallable listInstanceTemplatesPagedCallable() { + public UnaryCallable + listInstanceTemplatesPagedCallable() { return listInstanceTemplatesPagedCallable; } @BetaApi - public UnaryCallable listInstanceTemplatesCallable() { + public UnaryCallable + listInstanceTemplatesCallable() { return listInstanceTemplatesCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -255,5 +302,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java index efe3ec02bded..8b0ef4504cc6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; -import com.google.cloud.compute.v1.DeleteInterconnectAttachmentHttpRequest; -import com.google.cloud.compute.v1.GetInterconnectAttachmentHttpRequest; -import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; -import com.google.cloud.compute.v1.InterconnectAttachment; -import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; -import com.google.cloud.compute.v1.InterconnectAttachmentList; -import com.google.cloud.compute.v1.InterconnectAttachmentSettings; -import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; -import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java index 3b236f40f7c1..4c947a717aa2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; @@ -35,22 +37,14 @@ import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; import com.google.cloud.compute.v1.InterconnectAttachment; import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; import com.google.cloud.compute.v1.InterconnectAttachmentList; -import com.google.cloud.compute.v1.InterconnectAttachmentSettings; -import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName; import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,213 +58,312 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListInterconnectAttachmentsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectAttachments.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/interconnectAttachments")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InterconnectAttachmentAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList> + aggregatedListInterconnectAttachmentsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.interconnectAttachments.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/aggregated/interconnectAttachments")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance( + InterconnectAttachmentAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteInterconnectAttachmentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectAttachments.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory()) - .setResourceNameField("interconnectAttachment") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInterconnectAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory()) + .setResourceNameField("interconnectAttachment") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getInterconnectAttachmentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectAttachments.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectAttachmentHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory()) - .setResourceNameField("interconnectAttachment") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InterconnectAttachment.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + GetInterconnectAttachmentHttpRequest, InterconnectAttachment> + getInterconnectAttachmentMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.interconnectAttachments.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectAttachmentHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory()) + .setResourceNameField("interconnectAttachment") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectAttachment.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertInterconnectAttachmentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectAttachments.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertInterconnectAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectAttachments.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInterconnectAttachmentsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectAttachments.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InterconnectAttachmentList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList> + listInterconnectAttachmentsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.interconnectAttachments.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectAttachmentList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListInterconnectAttachmentsCallable; - private final UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable; - private final UnaryCallable deleteInterconnectAttachmentCallable; - private final UnaryCallable getInterconnectAttachmentCallable; - private final UnaryCallable insertInterconnectAttachmentCallable; - private final UnaryCallable listInterconnectAttachmentsCallable; - private final UnaryCallable listInterconnectAttachmentsPagedCallable; + private final UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList> + aggregatedListInterconnectAttachmentsCallable; + private final UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, + AggregatedListInterconnectAttachmentsPagedResponse> + aggregatedListInterconnectAttachmentsPagedCallable; + private final UnaryCallable + deleteInterconnectAttachmentCallable; + private final UnaryCallable + getInterconnectAttachmentCallable; + private final UnaryCallable + insertInterconnectAttachmentCallable; + private final UnaryCallable + listInterconnectAttachmentsCallable; + private final UnaryCallable< + ListInterconnectAttachmentsHttpRequest, ListInterconnectAttachmentsPagedResponse> + listInterconnectAttachmentsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInterconnectAttachmentStub create(InterconnectAttachmentStubSettings settings) throws IOException { + + public static final HttpJsonInterconnectAttachmentStub create( + InterconnectAttachmentStubSettings settings) throws IOException { return new HttpJsonInterconnectAttachmentStub(settings, ClientContext.create(settings)); } - public static final HttpJsonInterconnectAttachmentStub create(ClientContext clientContext) throws IOException { - return new HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonInterconnectAttachmentStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonInterconnectAttachmentStub( + InterconnectAttachmentStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInterconnectAttachmentStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInterconnectAttachmentStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInterconnectAttachmentStub( + InterconnectAttachmentStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInterconnectAttachmentStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInterconnectAttachmentStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInterconnectAttachmentStub( + InterconnectAttachmentStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonInterconnectAttachmentCallableFactory()); } /** - * Constructs an instance of HttpJsonInterconnectAttachmentStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInterconnectAttachmentStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInterconnectAttachmentStub(InterconnectAttachmentStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInterconnectAttachmentStub( + InterconnectAttachmentStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListInterconnectAttachmentsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListInterconnectAttachmentsMethodDescriptor) - .build(); - HttpJsonCallSettings deleteInterconnectAttachmentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInterconnectAttachmentMethodDescriptor) - .build(); - HttpJsonCallSettings getInterconnectAttachmentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getInterconnectAttachmentMethodDescriptor) - .build(); - HttpJsonCallSettings insertInterconnectAttachmentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertInterconnectAttachmentMethodDescriptor) - .build(); - HttpJsonCallSettings listInterconnectAttachmentsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInterconnectAttachmentsMethodDescriptor) - .build(); + HttpJsonCallSettings< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList> + aggregatedListInterconnectAttachmentsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListInterconnectAttachmentsMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteInterconnectAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInterconnectAttachmentMethodDescriptor) + .build(); + HttpJsonCallSettings + getInterconnectAttachmentTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getInterconnectAttachmentMethodDescriptor) + .build(); + HttpJsonCallSettings + insertInterconnectAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInterconnectAttachmentMethodDescriptor) + .build(); + HttpJsonCallSettings + listInterconnectAttachmentsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listInterconnectAttachmentsMethodDescriptor) + .build(); - this.aggregatedListInterconnectAttachmentsCallable = callableFactory.createUnaryCallable(aggregatedListInterconnectAttachmentsTransportSettings,settings.aggregatedListInterconnectAttachmentsSettings(), clientContext); - this.aggregatedListInterconnectAttachmentsPagedCallable = callableFactory.createPagedCallable(aggregatedListInterconnectAttachmentsTransportSettings,settings.aggregatedListInterconnectAttachmentsSettings(), clientContext); - this.deleteInterconnectAttachmentCallable = callableFactory.createUnaryCallable(deleteInterconnectAttachmentTransportSettings,settings.deleteInterconnectAttachmentSettings(), clientContext); - this.getInterconnectAttachmentCallable = callableFactory.createUnaryCallable(getInterconnectAttachmentTransportSettings,settings.getInterconnectAttachmentSettings(), clientContext); - this.insertInterconnectAttachmentCallable = callableFactory.createUnaryCallable(insertInterconnectAttachmentTransportSettings,settings.insertInterconnectAttachmentSettings(), clientContext); - this.listInterconnectAttachmentsCallable = callableFactory.createUnaryCallable(listInterconnectAttachmentsTransportSettings,settings.listInterconnectAttachmentsSettings(), clientContext); - this.listInterconnectAttachmentsPagedCallable = callableFactory.createPagedCallable(listInterconnectAttachmentsTransportSettings,settings.listInterconnectAttachmentsSettings(), clientContext); + this.aggregatedListInterconnectAttachmentsCallable = + callableFactory.createUnaryCallable( + aggregatedListInterconnectAttachmentsTransportSettings, + settings.aggregatedListInterconnectAttachmentsSettings(), + clientContext); + this.aggregatedListInterconnectAttachmentsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListInterconnectAttachmentsTransportSettings, + settings.aggregatedListInterconnectAttachmentsSettings(), + clientContext); + this.deleteInterconnectAttachmentCallable = + callableFactory.createUnaryCallable( + deleteInterconnectAttachmentTransportSettings, + settings.deleteInterconnectAttachmentSettings(), + clientContext); + this.getInterconnectAttachmentCallable = + callableFactory.createUnaryCallable( + getInterconnectAttachmentTransportSettings, + settings.getInterconnectAttachmentSettings(), + clientContext); + this.insertInterconnectAttachmentCallable = + callableFactory.createUnaryCallable( + insertInterconnectAttachmentTransportSettings, + settings.insertInterconnectAttachmentSettings(), + clientContext); + this.listInterconnectAttachmentsCallable = + callableFactory.createUnaryCallable( + listInterconnectAttachmentsTransportSettings, + settings.listInterconnectAttachmentsSettings(), + clientContext); + this.listInterconnectAttachmentsPagedCallable = + callableFactory.createPagedCallable( + listInterconnectAttachmentsTransportSettings, + settings.listInterconnectAttachmentsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable() { + public UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, + AggregatedListInterconnectAttachmentsPagedResponse> + aggregatedListInterconnectAttachmentsPagedCallable() { return aggregatedListInterconnectAttachmentsPagedCallable; } @BetaApi - public UnaryCallable aggregatedListInterconnectAttachmentsCallable() { + public UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList> + aggregatedListInterconnectAttachmentsCallable() { return aggregatedListInterconnectAttachmentsCallable; } @BetaApi - public UnaryCallable deleteInterconnectAttachmentCallable() { + public UnaryCallable + deleteInterconnectAttachmentCallable() { return deleteInterconnectAttachmentCallable; } @BetaApi - public UnaryCallable getInterconnectAttachmentCallable() { + public UnaryCallable + getInterconnectAttachmentCallable() { return getInterconnectAttachmentCallable; } @BetaApi - public UnaryCallable insertInterconnectAttachmentCallable() { + public UnaryCallable + insertInterconnectAttachmentCallable() { return insertInterconnectAttachmentCallable; } @BetaApi - public UnaryCallable listInterconnectAttachmentsPagedCallable() { + public UnaryCallable< + ListInterconnectAttachmentsHttpRequest, ListInterconnectAttachmentsPagedResponse> + listInterconnectAttachmentsPagedCallable() { return listInterconnectAttachmentsPagedCallable; } @BetaApi - public UnaryCallable listInterconnectAttachmentsCallable() { + public UnaryCallable + listInterconnectAttachmentsCallable() { return listInterconnectAttachmentsCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -298,5 +391,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java index 32c50938db04..93581be58f36 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java @@ -15,50 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; -import com.google.cloud.compute.v1.GetInterconnectHttpRequest; -import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; -import com.google.cloud.compute.v1.Interconnect; -import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; -import com.google.cloud.compute.v1.InterconnectList; -import com.google.cloud.compute.v1.InterconnectSettings; -import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; -import com.google.cloud.compute.v1.ProjectInterconnectName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -75,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -92,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java index 9db9396cbaef..0912f6d18440 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java @@ -15,47 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; -import com.google.cloud.compute.v1.InterconnectLocation; -import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; -import com.google.cloud.compute.v1.InterconnectLocationList; -import com.google.cloud.compute.v1.InterconnectLocationSettings; -import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; -import com.google.cloud.compute.v1.ProjectInterconnectLocationName; -import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -89,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java index e6aac8e57c50..a181379a2550 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,23 +28,16 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; import com.google.cloud.compute.v1.InterconnectLocation; -import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; import com.google.cloud.compute.v1.InterconnectLocationList; -import com.google.cloud.compute.v1.InterconnectLocationSettings; import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; -import com.google.cloud.compute.v1.ProjectInterconnectLocationName; +import com.google.cloud.compute.v1.ProjectGlobalInterconnectLocationName; import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -56,113 +51,154 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { @InternalApi - public static final ApiMethodDescriptor getInterconnectLocationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectLocations.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectLocationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnectLocations/{interconnectLocation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectInterconnectLocationName.newFactory()) - .setResourceNameField("interconnectLocation") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InterconnectLocation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getInterconnectLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnectLocations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectLocationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/interconnectLocations/{interconnectLocation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalInterconnectLocationName.newFactory()) + .setResourceNameField("interconnectLocation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectLocation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInterconnectLocationsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnectLocations.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectLocationsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnectLocations")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InterconnectLocationList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListInterconnectLocationsHttpRequest, InterconnectLocationList> + listInterconnectLocationsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.interconnectLocations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectLocationsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/interconnectLocations")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectLocationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable getInterconnectLocationCallable; - private final UnaryCallable listInterconnectLocationsCallable; - private final UnaryCallable listInterconnectLocationsPagedCallable; + private final UnaryCallable + getInterconnectLocationCallable; + private final UnaryCallable + listInterconnectLocationsCallable; + private final UnaryCallable< + ListInterconnectLocationsHttpRequest, ListInterconnectLocationsPagedResponse> + listInterconnectLocationsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInterconnectLocationStub create(InterconnectLocationStubSettings settings) throws IOException { + + public static final HttpJsonInterconnectLocationStub create( + InterconnectLocationStubSettings settings) throws IOException { return new HttpJsonInterconnectLocationStub(settings, ClientContext.create(settings)); } - public static final HttpJsonInterconnectLocationStub create(ClientContext clientContext) throws IOException { - return new HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonInterconnectLocationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonInterconnectLocationStub( + InterconnectLocationStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInterconnectLocationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInterconnectLocationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInterconnectLocationStub( + InterconnectLocationStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInterconnectLocationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInterconnectLocationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInterconnectLocationStub( + InterconnectLocationStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonInterconnectLocationCallableFactory()); } /** - * Constructs an instance of HttpJsonInterconnectLocationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInterconnectLocationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonInterconnectLocationStub(InterconnectLocationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInterconnectLocationStub( + InterconnectLocationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings getInterconnectLocationTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getInterconnectLocationMethodDescriptor) - .build(); - HttpJsonCallSettings listInterconnectLocationsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInterconnectLocationsMethodDescriptor) - .build(); - - this.getInterconnectLocationCallable = callableFactory.createUnaryCallable(getInterconnectLocationTransportSettings,settings.getInterconnectLocationSettings(), clientContext); - this.listInterconnectLocationsCallable = callableFactory.createUnaryCallable(listInterconnectLocationsTransportSettings,settings.listInterconnectLocationsSettings(), clientContext); - this.listInterconnectLocationsPagedCallable = callableFactory.createPagedCallable(listInterconnectLocationsTransportSettings,settings.listInterconnectLocationsSettings(), clientContext); + HttpJsonCallSettings + getInterconnectLocationTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getInterconnectLocationMethodDescriptor) + .build(); + HttpJsonCallSettings + listInterconnectLocationsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listInterconnectLocationsMethodDescriptor) + .build(); + + this.getInterconnectLocationCallable = + callableFactory.createUnaryCallable( + getInterconnectLocationTransportSettings, + settings.getInterconnectLocationSettings(), + clientContext); + this.listInterconnectLocationsCallable = + callableFactory.createUnaryCallable( + listInterconnectLocationsTransportSettings, + settings.listInterconnectLocationsSettings(), + clientContext); + this.listInterconnectLocationsPagedCallable = + callableFactory.createPagedCallable( + listInterconnectLocationsTransportSettings, + settings.listInterconnectLocationsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable getInterconnectLocationCallable() { + public UnaryCallable + getInterconnectLocationCallable() { return getInterconnectLocationCallable; } @BetaApi - public UnaryCallable listInterconnectLocationsPagedCallable() { + public UnaryCallable + listInterconnectLocationsPagedCallable() { return listInterconnectLocationsPagedCallable; } @BetaApi - public UnaryCallable listInterconnectLocationsCallable() { + public UnaryCallable + listInterconnectLocationsCallable() { return listInterconnectLocationsCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -190,5 +226,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java index f31810570295..082000108800 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,27 +28,20 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; import com.google.cloud.compute.v1.GetInterconnectHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; import com.google.cloud.compute.v1.Interconnect; -import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; import com.google.cloud.compute.v1.InterconnectList; -import com.google.cloud.compute.v1.InterconnectSettings; import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; -import com.google.cloud.compute.v1.ProjectInterconnectName; +import com.google.cloud.compute.v1.ProjectGlobalInterconnectName; import com.google.cloud.compute.v1.ProjectName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,170 +55,215 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInterconnectStub extends InterconnectStub { @InternalApi - public static final ApiMethodDescriptor deleteInterconnectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnects.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInterconnectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectInterconnectName.newFactory()) - .setResourceNameField("interconnect") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/interconnects/{interconnect}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalInterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getInterconnectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnects.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectInterconnectName.newFactory()) - .setResourceNameField("interconnect") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Interconnect.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/interconnects/{interconnect}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalInterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Interconnect.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertInterconnectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnects.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInterconnectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInterconnectsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnects.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InterconnectList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listInterconnectsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchInterconnectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.interconnects.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchInterconnectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/interconnects/{interconnect}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectInterconnectName.newFactory()) - .setResourceNameField("interconnect") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchInterconnectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.interconnects.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchInterconnectHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/interconnects/{interconnect}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalInterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteInterconnectCallable; private final UnaryCallable getInterconnectCallable; private final UnaryCallable insertInterconnectCallable; - private final UnaryCallable listInterconnectsCallable; - private final UnaryCallable listInterconnectsPagedCallable; + private final UnaryCallable + listInterconnectsCallable; + private final UnaryCallable + listInterconnectsPagedCallable; private final UnaryCallable patchInterconnectCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonInterconnectStub create(InterconnectStubSettings settings) throws IOException { + + public static final HttpJsonInterconnectStub create(InterconnectStubSettings settings) + throws IOException { return new HttpJsonInterconnectStub(settings, ClientContext.create(settings)); } - public static final HttpJsonInterconnectStub create(ClientContext clientContext) throws IOException { - return new HttpJsonInterconnectStub(InterconnectStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonInterconnectStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonInterconnectStub( + InterconnectStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonInterconnectStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonInterconnectStub(InterconnectStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonInterconnectStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonInterconnectStub( + InterconnectStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonInterconnectStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInterconnectStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonInterconnectStub(InterconnectStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonInterconnectStub(InterconnectStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonInterconnectCallableFactory()); } /** - * Constructs an instance of HttpJsonInterconnectStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonInterconnectStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonInterconnectStub(InterconnectStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonInterconnectStub( + InterconnectStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteInterconnectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInterconnectMethodDescriptor) - .build(); - HttpJsonCallSettings getInterconnectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getInterconnectMethodDescriptor) - .build(); - HttpJsonCallSettings insertInterconnectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertInterconnectMethodDescriptor) - .build(); - HttpJsonCallSettings listInterconnectsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInterconnectsMethodDescriptor) - .build(); - HttpJsonCallSettings patchInterconnectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchInterconnectMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInterconnectMethodDescriptor) + .build(); + HttpJsonCallSettings + getInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInterconnectMethodDescriptor) + .build(); + HttpJsonCallSettings + insertInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertInterconnectMethodDescriptor) + .build(); + HttpJsonCallSettings + listInterconnectsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInterconnectsMethodDescriptor) + .build(); + HttpJsonCallSettings + patchInterconnectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchInterconnectMethodDescriptor) + .build(); - this.deleteInterconnectCallable = callableFactory.createUnaryCallable(deleteInterconnectTransportSettings,settings.deleteInterconnectSettings(), clientContext); - this.getInterconnectCallable = callableFactory.createUnaryCallable(getInterconnectTransportSettings,settings.getInterconnectSettings(), clientContext); - this.insertInterconnectCallable = callableFactory.createUnaryCallable(insertInterconnectTransportSettings,settings.insertInterconnectSettings(), clientContext); - this.listInterconnectsCallable = callableFactory.createUnaryCallable(listInterconnectsTransportSettings,settings.listInterconnectsSettings(), clientContext); - this.listInterconnectsPagedCallable = callableFactory.createPagedCallable(listInterconnectsTransportSettings,settings.listInterconnectsSettings(), clientContext); - this.patchInterconnectCallable = callableFactory.createUnaryCallable(patchInterconnectTransportSettings,settings.patchInterconnectSettings(), clientContext); + this.deleteInterconnectCallable = + callableFactory.createUnaryCallable( + deleteInterconnectTransportSettings, + settings.deleteInterconnectSettings(), + clientContext); + this.getInterconnectCallable = + callableFactory.createUnaryCallable( + getInterconnectTransportSettings, settings.getInterconnectSettings(), clientContext); + this.insertInterconnectCallable = + callableFactory.createUnaryCallable( + insertInterconnectTransportSettings, + settings.insertInterconnectSettings(), + clientContext); + this.listInterconnectsCallable = + callableFactory.createUnaryCallable( + listInterconnectsTransportSettings, + settings.listInterconnectsSettings(), + clientContext); + this.listInterconnectsPagedCallable = + callableFactory.createPagedCallable( + listInterconnectsTransportSettings, + settings.listInterconnectsSettings(), + clientContext); + this.patchInterconnectCallable = + callableFactory.createUnaryCallable( + patchInterconnectTransportSettings, + settings.patchInterconnectSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -244,7 +284,8 @@ public UnaryCallable insertInterconnec } @BetaApi - public UnaryCallable listInterconnectsPagedCallable() { + public UnaryCallable + listInterconnectsPagedCallable() { return listInterconnectsPagedCallable; } @@ -259,7 +300,7 @@ public UnaryCallable patchInterconnectC } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -287,5 +328,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java deleted file mode 100644 index 2d645076e23e..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensStub.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1.stub; - -import com.google.api.client.http.HttpMethods; -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetLicensHttpRequest; -import com.google.cloud.compute.v1.LicensSettings; -import com.google.cloud.compute.v1.License; -import com.google.cloud.compute.v1.LicenseName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * HTTP stub implementation for compute. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by GAPIC v0.0.5") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public class HttpJsonLicensStub extends LicensStub { - @InternalApi - public static final ApiMethodDescriptor getLicensMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.licenses.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetLicensHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(LicenseName.newFactory()) - .setResourceNameField("license") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(License.getDefaultInstance()) - .build()) - .build(); - private final BackgroundResource backgroundResources; - - private final UnaryCallable getLicensCallable; - - private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonLicensStub create(LicensStubSettings settings) throws IOException { - return new HttpJsonLicensStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonLicensStub create(ClientContext clientContext) throws IOException { - return new HttpJsonLicensStub(LicensStubSettings.newBuilder().build(), clientContext); - } - - public static final HttpJsonLicensStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonLicensStub(LicensStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonLicensStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected HttpJsonLicensStub(LicensStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new HttpJsonLicensCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonLicensStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected HttpJsonLicensStub(LicensStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings getLicensTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getLicensMethodDescriptor) - .build(); - - this.getLicensCallable = callableFactory.createUnaryCallable(getLicensTransportSettings,settings.getLicensSettings(), clientContext); - - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @BetaApi - public UnaryCallable getLicensCallable() { - return getLicensCallable; - } - - @Override - public final void close() throws Exception { - shutdown(); - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } - -} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java index 7969daf63b82..2d0f399c98b3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java @@ -15,43 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetLicenseHttpRequest; -import com.google.cloud.compute.v1.License; -import com.google.cloud.compute.v1.LicenseSettings; -import com.google.cloud.compute.v1.ProjectLicenseName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -68,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -85,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java similarity index 51% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java index 17d059d168a9..87166acfb077 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicensCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java @@ -15,43 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetLicensHttpRequest; -import com.google.cloud.compute.v1.LicensSettings; -import com.google.cloud.compute.v1.License; -import com.google.cloud.compute.v1.LicenseName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -62,22 +34,24 @@ */ @Generated("by GAPIC v0.0.5") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class HttpJsonLicensCallableFactory implements HttpJsonStubCallableFactory { +public class HttpJsonLicenseCodeCallableFactory implements HttpJsonStubCallableFactory { @Override public UnaryCallable createUnaryCallable( HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -85,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java new file mode 100644 index 000000000000..eec8ef581f53 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java @@ -0,0 +1,207 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.GetLicenseCodeHttpRequest; +import com.google.cloud.compute.v1.LicenseCode; +import com.google.cloud.compute.v1.ProjectGlobalLicenseCodeName; +import com.google.cloud.compute.v1.ProjectGlobalLicenseCodeResourceName; +import com.google.cloud.compute.v1.TestIamPermissionsLicenseCodeHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonLicenseCodeStub extends LicenseCodeStub { + @InternalApi + public static final ApiMethodDescriptor + getLicenseCodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenseCodes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetLicenseCodeHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/licenseCodes/{licenseCode}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalLicenseCodeName.newFactory()) + .setResourceNameField("licenseCode") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(LicenseCode.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsLicenseCodeHttpRequest, TestPermissionsResponse> + testIamPermissionsLicenseCodeMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.licenseCodes.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + TestIamPermissionsLicenseCodeHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/licenseCodes/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalLicenseCodeResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable getLicenseCodeCallable; + private final UnaryCallable + testIamPermissionsLicenseCodeCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonLicenseCodeStub create(LicenseCodeStubSettings settings) + throws IOException { + return new HttpJsonLicenseCodeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonLicenseCodeStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonLicenseCodeStub(LicenseCodeStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonLicenseCodeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLicenseCodeStub( + LicenseCodeStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonLicenseCodeStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonLicenseCodeStub(LicenseCodeStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonLicenseCodeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonLicenseCodeStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonLicenseCodeStub( + LicenseCodeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getLicenseCodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLicenseCodeMethodDescriptor) + .build(); + HttpJsonCallSettings + testIamPermissionsLicenseCodeTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsLicenseCodeMethodDescriptor) + .build(); + + this.getLicenseCodeCallable = + callableFactory.createUnaryCallable( + getLicenseCodeTransportSettings, settings.getLicenseCodeSettings(), clientContext); + this.testIamPermissionsLicenseCodeCallable = + callableFactory.createUnaryCallable( + testIamPermissionsLicenseCodeTransportSettings, + settings.testIamPermissionsLicenseCodeSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getLicenseCodeCallable() { + return getLicenseCodeCallable; + } + + @BetaApi + public UnaryCallable + testIamPermissionsLicenseCodeCallable() { + return testIamPermissionsLicenseCodeCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java index a179bc818719..a2c5ac2294da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.LicenseClient.ListLicensesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,19 +28,22 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteLicenseHttpRequest; import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.InsertLicenseHttpRequest; import com.google.cloud.compute.v1.License; -import com.google.cloud.compute.v1.LicenseSettings; -import com.google.cloud.compute.v1.ProjectLicenseName; -import com.google.common.collect.ImmutableMap; +import com.google.cloud.compute.v1.LicensesListResponse; +import com.google.cloud.compute.v1.ListLicensesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalLicenseName; +import com.google.cloud.compute.v1.ProjectGlobalLicenseResourceName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.TestIamPermissionsLicenseHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -52,29 +57,123 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonLicenseStub extends LicenseStub { @InternalApi - public static final ApiMethodDescriptor getLicenseMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.licenses.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetLicenseHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectLicenseName.newFactory()) - .setResourceNameField("license") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(License.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteLicenseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteLicenseHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) + .setResourceNameField("license") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + getLicenseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetLicenseHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) + .setResourceNameField("license") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(License.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + insertLicenseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertLicenseHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/licenses")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listLicensesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListLicensesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/licenses")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(LicensesListResponse.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsLicenseHttpRequest, TestPermissionsResponse> + testIamPermissionsLicenseMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.licenses.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(TestIamPermissionsLicenseHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/licenses/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalLicenseResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; + private final UnaryCallable deleteLicenseCallable; private final UnaryCallable getLicenseCallable; + private final UnaryCallable insertLicenseCallable; + private final UnaryCallable listLicensesCallable; + private final UnaryCallable + listLicensesPagedCallable; + private final UnaryCallable + testIamPermissionsLicenseCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonLicenseStub create(LicenseStubSettings settings) throws IOException { return new HttpJsonLicenseStub(settings, ClientContext.create(settings)); } @@ -83,44 +182,116 @@ public static final HttpJsonLicenseStub create(ClientContext clientContext) thro return new HttpJsonLicenseStub(LicenseStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonLicenseStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonLicenseStub(LicenseStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonLicenseStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLicenseStub( + LicenseStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonLicenseStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonLicenseStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonLicenseStub(LicenseStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonLicenseStub(LicenseStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonLicenseCallableFactory()); } /** - * Constructs an instance of HttpJsonLicenseStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonLicenseStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonLicenseStub(LicenseStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonLicenseStub( + LicenseStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; + HttpJsonCallSettings deleteLicenseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteLicenseMethodDescriptor) + .build(); HttpJsonCallSettings getLicenseTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getLicenseMethodDescriptor) .build(); + HttpJsonCallSettings insertLicenseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertLicenseMethodDescriptor) + .build(); + HttpJsonCallSettings + listLicensesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLicensesMethodDescriptor) + .build(); + HttpJsonCallSettings + testIamPermissionsLicenseTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsLicenseMethodDescriptor) + .build(); - this.getLicenseCallable = callableFactory.createUnaryCallable(getLicenseTransportSettings,settings.getLicenseSettings(), clientContext); + this.deleteLicenseCallable = + callableFactory.createUnaryCallable( + deleteLicenseTransportSettings, settings.deleteLicenseSettings(), clientContext); + this.getLicenseCallable = + callableFactory.createUnaryCallable( + getLicenseTransportSettings, settings.getLicenseSettings(), clientContext); + this.insertLicenseCallable = + callableFactory.createUnaryCallable( + insertLicenseTransportSettings, settings.insertLicenseSettings(), clientContext); + this.listLicensesCallable = + callableFactory.createUnaryCallable( + listLicensesTransportSettings, settings.listLicensesSettings(), clientContext); + this.listLicensesPagedCallable = + callableFactory.createPagedCallable( + listLicensesTransportSettings, settings.listLicensesSettings(), clientContext); + this.testIamPermissionsLicenseCallable = + callableFactory.createUnaryCallable( + testIamPermissionsLicenseTransportSettings, + settings.testIamPermissionsLicenseSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } + @BetaApi + public UnaryCallable deleteLicenseCallable() { + return deleteLicenseCallable; + } + @BetaApi public UnaryCallable getLicenseCallable() { return getLicenseCallable; } + @BetaApi + public UnaryCallable insertLicenseCallable() { + return insertLicenseCallable; + } + + @BetaApi + public UnaryCallable + listLicensesPagedCallable() { + return listLicensesPagedCallable; + } + + @BetaApi + public UnaryCallable listLicensesCallable() { + return listLicensesCallable; + } + + @BetaApi + public UnaryCallable + testIamPermissionsLicenseCallable() { + return testIamPermissionsLicenseCallable; + } + @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -148,5 +319,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java index 601bccb80c19..50d90e4da591 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java @@ -15,52 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; -import com.google.cloud.compute.v1.GetMachineTypeHttpRequest; -import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; -import com.google.cloud.compute.v1.MachineType; -import com.google.cloud.compute.v1.MachineTypeAggregatedList; -import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; -import com.google.cloud.compute.v1.MachineTypeList; -import com.google.cloud.compute.v1.MachineTypeSettings; -import com.google.cloud.compute.v1.MachineTypesScopedList; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneMachineTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -77,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -94,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java index 3100c8d3a90a..a7be3bef8466 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; @@ -34,20 +36,12 @@ import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; import com.google.cloud.compute.v1.MachineType; import com.google.cloud.compute.v1.MachineTypeAggregatedList; -import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; import com.google.cloud.compute.v1.MachineTypeList; -import com.google.cloud.compute.v1.MachineTypeSettings; -import com.google.cloud.compute.v1.MachineTypesScopedList; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneMachineTypeName; import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,131 +55,173 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonMachineTypeStub extends MachineTypeStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListMachineTypesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.machineTypes.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListMachineTypesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/machineTypes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(MachineTypeAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList> + aggregatedListMachineTypesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.machineTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + AggregatedListMachineTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/machineTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(MachineTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getMachineTypeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.machineTypes.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetMachineTypeHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneMachineTypeName.newFactory()) - .setResourceNameField("machineType") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(MachineType.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getMachineTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.machineTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetMachineTypeHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneMachineTypeName.newFactory()) + .setResourceNameField("machineType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(MachineType.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listMachineTypesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.machineTypes.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListMachineTypesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(MachineTypeList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listMachineTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.machineTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListMachineTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(MachineTypeList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListMachineTypesCallable; - private final UnaryCallable aggregatedListMachineTypesPagedCallable; + private final UnaryCallable + aggregatedListMachineTypesCallable; + private final UnaryCallable< + AggregatedListMachineTypesHttpRequest, AggregatedListMachineTypesPagedResponse> + aggregatedListMachineTypesPagedCallable; private final UnaryCallable getMachineTypeCallable; - private final UnaryCallable listMachineTypesCallable; - private final UnaryCallable listMachineTypesPagedCallable; + private final UnaryCallable + listMachineTypesCallable; + private final UnaryCallable + listMachineTypesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonMachineTypeStub create(MachineTypeStubSettings settings) throws IOException { + + public static final HttpJsonMachineTypeStub create(MachineTypeStubSettings settings) + throws IOException { return new HttpJsonMachineTypeStub(settings, ClientContext.create(settings)); } - public static final HttpJsonMachineTypeStub create(ClientContext clientContext) throws IOException { + public static final HttpJsonMachineTypeStub create(ClientContext clientContext) + throws IOException { return new HttpJsonMachineTypeStub(MachineTypeStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonMachineTypeStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonMachineTypeStub(MachineTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonMachineTypeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMachineTypeStub( + MachineTypeStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonMachineTypeStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonMachineTypeStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonMachineTypeStub(MachineTypeStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonMachineTypeStub(MachineTypeStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonMachineTypeCallableFactory()); } /** - * Constructs an instance of HttpJsonMachineTypeStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonMachineTypeStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonMachineTypeStub(MachineTypeStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonMachineTypeStub( + MachineTypeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListMachineTypesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListMachineTypesMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListMachineTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListMachineTypesMethodDescriptor) + .build(); HttpJsonCallSettings getMachineTypeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getMachineTypeMethodDescriptor) .build(); - HttpJsonCallSettings listMachineTypesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listMachineTypesMethodDescriptor) - .build(); + HttpJsonCallSettings + listMachineTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMachineTypesMethodDescriptor) + .build(); - this.aggregatedListMachineTypesCallable = callableFactory.createUnaryCallable(aggregatedListMachineTypesTransportSettings,settings.aggregatedListMachineTypesSettings(), clientContext); - this.aggregatedListMachineTypesPagedCallable = callableFactory.createPagedCallable(aggregatedListMachineTypesTransportSettings,settings.aggregatedListMachineTypesSettings(), clientContext); - this.getMachineTypeCallable = callableFactory.createUnaryCallable(getMachineTypeTransportSettings,settings.getMachineTypeSettings(), clientContext); - this.listMachineTypesCallable = callableFactory.createUnaryCallable(listMachineTypesTransportSettings,settings.listMachineTypesSettings(), clientContext); - this.listMachineTypesPagedCallable = callableFactory.createPagedCallable(listMachineTypesTransportSettings,settings.listMachineTypesSettings(), clientContext); + this.aggregatedListMachineTypesCallable = + callableFactory.createUnaryCallable( + aggregatedListMachineTypesTransportSettings, + settings.aggregatedListMachineTypesSettings(), + clientContext); + this.aggregatedListMachineTypesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListMachineTypesTransportSettings, + settings.aggregatedListMachineTypesSettings(), + clientContext); + this.getMachineTypeCallable = + callableFactory.createUnaryCallable( + getMachineTypeTransportSettings, settings.getMachineTypeSettings(), clientContext); + this.listMachineTypesCallable = + callableFactory.createUnaryCallable( + listMachineTypesTransportSettings, settings.listMachineTypesSettings(), clientContext); + this.listMachineTypesPagedCallable = + callableFactory.createPagedCallable( + listMachineTypesTransportSettings, settings.listMachineTypesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListMachineTypesPagedCallable() { + public UnaryCallable< + AggregatedListMachineTypesHttpRequest, AggregatedListMachineTypesPagedResponse> + aggregatedListMachineTypesPagedCallable() { return aggregatedListMachineTypesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListMachineTypesCallable() { + public UnaryCallable + aggregatedListMachineTypesCallable() { return aggregatedListMachineTypesCallable; } @@ -195,7 +231,8 @@ public UnaryCallable getMachineTypeCalla } @BetaApi - public UnaryCallable listMachineTypesPagedCallable() { + public UnaryCallable + listMachineTypesPagedCallable() { return listMachineTypesPagedCallable; } @@ -205,7 +242,7 @@ public UnaryCallable listMachineTy } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -233,5 +270,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java index d02dfb08384b..97d7b03767b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java @@ -15,55 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; -import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; -import com.google.cloud.compute.v1.GetNetworkHttpRequest; -import com.google.cloud.compute.v1.InsertNetworkHttpRequest; -import com.google.cloud.compute.v1.ListNetworksHttpRequest; -import com.google.cloud.compute.v1.Network; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; -import com.google.cloud.compute.v1.NetworkList; -import com.google.cloud.compute.v1.NetworkSettings; -import com.google.cloud.compute.v1.NetworksAddPeeringRequest; -import com.google.cloud.compute.v1.NetworksRemovePeeringRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchNetworkHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectNetworkName; -import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; -import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -80,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -97,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java index 12159d6494a1..db8dabf469ae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; @@ -35,23 +36,15 @@ import com.google.cloud.compute.v1.InsertNetworkHttpRequest; import com.google.cloud.compute.v1.ListNetworksHttpRequest; import com.google.cloud.compute.v1.Network; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.NetworkList; -import com.google.cloud.compute.v1.NetworkSettings; -import com.google.cloud.compute.v1.NetworksAddPeeringRequest; -import com.google.cloud.compute.v1.NetworksRemovePeeringRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchNetworkHttpRequest; +import com.google.cloud.compute.v1.ProjectGlobalNetworkName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectNetworkName; import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -65,164 +58,170 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonNetworkStub extends NetworkStub { @InternalApi - public static final ApiMethodDescriptor addPeeringNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.addPeering") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddPeeringNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/addPeering")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectNetworkName.newFactory()) - .setResourceNameField("network") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + addPeeringNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.addPeering") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddPeeringNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/networks/{network}/addPeering")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectNetworkName.newFactory()) - .setResourceNameField("network") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectNetworkName.newFactory()) - .setResourceNameField("network") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Network.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Network.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listNetworksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListNetworksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(NetworkList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listNetworksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListNetworksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NetworkList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectNetworkName.newFactory()) - .setResourceNameField("network") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor removePeeringNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.removePeering") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemovePeeringNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/removePeering")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectNetworkName.newFactory()) - .setResourceNameField("network") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + removePeeringNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.removePeering") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemovePeeringNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/networks/{network}/removePeering")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor switchToCustomModeNetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.networks.switchToCustomMode") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}/switchToCustomMode")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectNetworkName.newFactory()) - .setResourceNameField("network") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + switchToCustomModeNetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.networks.switchToCustomMode") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/networks/{network}/switchToCustomMode")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) + .setResourceNameField("network") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable addPeeringNetworkCallable; @@ -230,12 +229,16 @@ public class HttpJsonNetworkStub extends NetworkStub { private final UnaryCallable getNetworkCallable; private final UnaryCallable insertNetworkCallable; private final UnaryCallable listNetworksCallable; - private final UnaryCallable listNetworksPagedCallable; + private final UnaryCallable + listNetworksPagedCallable; private final UnaryCallable patchNetworkCallable; - private final UnaryCallable removePeeringNetworkCallable; - private final UnaryCallable switchToCustomModeNetworkCallable; + private final UnaryCallable + removePeeringNetworkCallable; + private final UnaryCallable + switchToCustomModeNetworkCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonNetworkStub create(NetworkStubSettings settings) throws IOException { return new HttpJsonNetworkStub(settings, ClientContext.create(settings)); } @@ -244,31 +247,39 @@ public static final HttpJsonNetworkStub create(ClientContext clientContext) thro return new HttpJsonNetworkStub(NetworkStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonNetworkStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonNetworkStub(NetworkStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonNetworkStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNetworkStub( + NetworkStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonNetworkStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonNetworkStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonNetworkCallableFactory()); } /** - * Constructs an instance of HttpJsonNetworkStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonNetworkStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonNetworkStub( + NetworkStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings addPeeringNetworkTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(addPeeringNetworkMethodDescriptor) - .build(); + HttpJsonCallSettings + addPeeringNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addPeeringNetworkMethodDescriptor) + .build(); HttpJsonCallSettings deleteNetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteNetworkMethodDescriptor) @@ -289,24 +300,50 @@ protected HttpJsonNetworkStub(NetworkStubSettings settings, ClientContext client HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchNetworkMethodDescriptor) .build(); - HttpJsonCallSettings removePeeringNetworkTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(removePeeringNetworkMethodDescriptor) - .build(); - HttpJsonCallSettings switchToCustomModeNetworkTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(switchToCustomModeNetworkMethodDescriptor) - .build(); + HttpJsonCallSettings + removePeeringNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removePeeringNetworkMethodDescriptor) + .build(); + HttpJsonCallSettings + switchToCustomModeNetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(switchToCustomModeNetworkMethodDescriptor) + .build(); - this.addPeeringNetworkCallable = callableFactory.createUnaryCallable(addPeeringNetworkTransportSettings,settings.addPeeringNetworkSettings(), clientContext); - this.deleteNetworkCallable = callableFactory.createUnaryCallable(deleteNetworkTransportSettings,settings.deleteNetworkSettings(), clientContext); - this.getNetworkCallable = callableFactory.createUnaryCallable(getNetworkTransportSettings,settings.getNetworkSettings(), clientContext); - this.insertNetworkCallable = callableFactory.createUnaryCallable(insertNetworkTransportSettings,settings.insertNetworkSettings(), clientContext); - this.listNetworksCallable = callableFactory.createUnaryCallable(listNetworksTransportSettings,settings.listNetworksSettings(), clientContext); - this.listNetworksPagedCallable = callableFactory.createPagedCallable(listNetworksTransportSettings,settings.listNetworksSettings(), clientContext); - this.patchNetworkCallable = callableFactory.createUnaryCallable(patchNetworkTransportSettings,settings.patchNetworkSettings(), clientContext); - this.removePeeringNetworkCallable = callableFactory.createUnaryCallable(removePeeringNetworkTransportSettings,settings.removePeeringNetworkSettings(), clientContext); - this.switchToCustomModeNetworkCallable = callableFactory.createUnaryCallable(switchToCustomModeNetworkTransportSettings,settings.switchToCustomModeNetworkSettings(), clientContext); + this.addPeeringNetworkCallable = + callableFactory.createUnaryCallable( + addPeeringNetworkTransportSettings, + settings.addPeeringNetworkSettings(), + clientContext); + this.deleteNetworkCallable = + callableFactory.createUnaryCallable( + deleteNetworkTransportSettings, settings.deleteNetworkSettings(), clientContext); + this.getNetworkCallable = + callableFactory.createUnaryCallable( + getNetworkTransportSettings, settings.getNetworkSettings(), clientContext); + this.insertNetworkCallable = + callableFactory.createUnaryCallable( + insertNetworkTransportSettings, settings.insertNetworkSettings(), clientContext); + this.listNetworksCallable = + callableFactory.createUnaryCallable( + listNetworksTransportSettings, settings.listNetworksSettings(), clientContext); + this.listNetworksPagedCallable = + callableFactory.createPagedCallable( + listNetworksTransportSettings, settings.listNetworksSettings(), clientContext); + this.patchNetworkCallable = + callableFactory.createUnaryCallable( + patchNetworkTransportSettings, settings.patchNetworkSettings(), clientContext); + this.removePeeringNetworkCallable = + callableFactory.createUnaryCallable( + removePeeringNetworkTransportSettings, + settings.removePeeringNetworkSettings(), + clientContext); + this.switchToCustomModeNetworkCallable = + callableFactory.createUnaryCallable( + switchToCustomModeNetworkTransportSettings, + settings.switchToCustomModeNetworkSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -332,7 +369,8 @@ public UnaryCallable insertNetworkCallable( } @BetaApi - public UnaryCallable listNetworksPagedCallable() { + public UnaryCallable + listNetworksPagedCallable() { return listNetworksPagedCallable; } @@ -352,12 +390,13 @@ public UnaryCallable removePeeringNe } @BetaApi - public UnaryCallable switchToCustomModeNetworkCallable() { + public UnaryCallable + switchToCustomModeNetworkCallable() { return switchToCustomModeNetworkCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -385,5 +424,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java index acfa4b145233..844039bcbf87 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java @@ -15,66 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest; -import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest; -import com.google.cloud.compute.v1.DiskMoveRequest; -import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest; -import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest; -import com.google.cloud.compute.v1.GetProjectHttpRequest; -import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest; -import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest; -import com.google.cloud.compute.v1.InstanceMoveRequest; -import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest; -import com.google.cloud.compute.v1.Metadata; -import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; -import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.Project; -import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; -import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSettings; -import com.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; -import com.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; -import com.google.cloud.compute.v1.ProjectsGetXpnResources; -import com.google.cloud.compute.v1.ProjectsListXpnHostsRequest; -import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; -import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; -import com.google.cloud.compute.v1.UsageExportLocation; -import com.google.cloud.compute.v1.XpnHostList; -import com.google.cloud.compute.v1.XpnResourceId; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -91,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -108,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index a48b87db9f08..899074c8edbf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,43 +29,27 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest; -import com.google.cloud.compute.v1.DiskMoveRequest; import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.GetProjectHttpRequest; import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest; -import com.google.cloud.compute.v1.InstanceMoveRequest; import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest; -import com.google.cloud.compute.v1.Metadata; import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Project; -import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; -import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSettings; -import com.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; -import com.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; import com.google.cloud.compute.v1.ProjectsGetXpnResources; -import com.google.cloud.compute.v1.ProjectsListXpnHostsRequest; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; -import com.google.cloud.compute.v1.UsageExportLocation; import com.google.cloud.compute.v1.XpnHostList; -import com.google.cloud.compute.v1.XpnResourceId; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -76,261 +63,284 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonProjectStub extends ProjectStub { @InternalApi - public static final ApiMethodDescriptor disableXpnHostProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.disableXpnHost") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DisableXpnHostProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/disableXpnHost")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + disableXpnHostProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.disableXpnHost") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DisableXpnHostProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/disableXpnHost")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor disableXpnResourceProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.disableXpnResource") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DisableXpnResourceProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/disableXpnResource")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + disableXpnResourceProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.disableXpnResource") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DisableXpnResourceProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/disableXpnResource")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor enableXpnHostProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.enableXpnHost") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(EnableXpnHostProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/enableXpnHost")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + enableXpnHostProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.enableXpnHost") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(EnableXpnHostProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/enableXpnHost")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor enableXpnResourceProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.enableXpnResource") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(EnableXpnResourceProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/enableXpnResource")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + enableXpnResourceProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.enableXpnResource") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(EnableXpnResourceProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/enableXpnResource")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Project.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Project.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getXpnHostProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.getXpnHost") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetXpnHostProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/getXpnHost")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Project.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getXpnHostProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.getXpnHost") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetXpnHostProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/getXpnHost")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Project.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getXpnResourcesProjectsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.getXpnResources") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/getXpnResources")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "order_by", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ProjectsGetXpnResources.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources> + getXpnResourcesProjectsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.projects.getXpnResources") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/getXpnResources")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ProjectsGetXpnResources.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listXpnHostsProjectsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.listXpnHosts") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListXpnHostsProjectsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/listXpnHosts")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "order_by", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(XpnHostList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listXpnHostsProjectsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.listXpnHosts") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListXpnHostsProjectsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/listXpnHosts")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(XpnHostList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor moveDiskProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.moveDisk") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/moveDisk")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + moveDiskProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.moveDisk") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/moveDisk")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor moveInstanceProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.moveInstance") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/moveInstance")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + moveInstanceProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.moveInstance") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/moveInstance")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setCommonInstanceMetadataProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.setCommonInstanceMetadata") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setCommonInstanceMetadataProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.setCommonInstanceMetadata") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setUsageExportBucketProjectMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.projects.setUsageExportBucket") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setUsageExportBucketProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.setUsageExportBucket") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable disableXpnHostProjectCallable; - private final UnaryCallable disableXpnResourceProjectCallable; - private final UnaryCallable enableXpnHostProjectCallable; - private final UnaryCallable enableXpnResourceProjectCallable; + private final UnaryCallable + disableXpnHostProjectCallable; + private final UnaryCallable + disableXpnResourceProjectCallable; + private final UnaryCallable + enableXpnHostProjectCallable; + private final UnaryCallable + enableXpnResourceProjectCallable; private final UnaryCallable getProjectCallable; private final UnaryCallable getXpnHostProjectCallable; - private final UnaryCallable getXpnResourcesProjectsCallable; - private final UnaryCallable getXpnResourcesProjectsPagedCallable; - private final UnaryCallable listXpnHostsProjectsCallable; - private final UnaryCallable listXpnHostsProjectsPagedCallable; + private final UnaryCallable + getXpnResourcesProjectsCallable; + private final UnaryCallable< + GetXpnResourcesProjectsHttpRequest, GetXpnResourcesProjectsPagedResponse> + getXpnResourcesProjectsPagedCallable; + private final UnaryCallable + listXpnHostsProjectsCallable; + private final UnaryCallable + listXpnHostsProjectsPagedCallable; private final UnaryCallable moveDiskProjectCallable; - private final UnaryCallable moveInstanceProjectCallable; - private final UnaryCallable setCommonInstanceMetadataProjectCallable; - private final UnaryCallable setUsageExportBucketProjectCallable; + private final UnaryCallable + moveInstanceProjectCallable; + private final UnaryCallable + setCommonInstanceMetadataProjectCallable; + private final UnaryCallable + setUsageExportBucketProjectCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonProjectStub create(ProjectStubSettings settings) throws IOException { return new HttpJsonProjectStub(settings, ClientContext.create(settings)); } @@ -339,43 +349,54 @@ public static final HttpJsonProjectStub create(ClientContext clientContext) thro return new HttpJsonProjectStub(ProjectStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonProjectStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonProjectStub(ProjectStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonProjectStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonProjectStub( + ProjectStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonProjectStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonProjectStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonProjectCallableFactory()); } /** - * Constructs an instance of HttpJsonProjectStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonProjectStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonProjectStub( + ProjectStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings disableXpnHostProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(disableXpnHostProjectMethodDescriptor) - .build(); - HttpJsonCallSettings disableXpnResourceProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(disableXpnResourceProjectMethodDescriptor) - .build(); - HttpJsonCallSettings enableXpnHostProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(enableXpnHostProjectMethodDescriptor) - .build(); - HttpJsonCallSettings enableXpnResourceProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(enableXpnResourceProjectMethodDescriptor) - .build(); + HttpJsonCallSettings + disableXpnHostProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableXpnHostProjectMethodDescriptor) + .build(); + HttpJsonCallSettings + disableXpnResourceProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(disableXpnResourceProjectMethodDescriptor) + .build(); + HttpJsonCallSettings + enableXpnHostProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableXpnHostProjectMethodDescriptor) + .build(); + HttpJsonCallSettings + enableXpnResourceProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(enableXpnResourceProjectMethodDescriptor) + .build(); HttpJsonCallSettings getProjectTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getProjectMethodDescriptor) @@ -384,56 +405,117 @@ protected HttpJsonProjectStub(ProjectStubSettings settings, ClientContext client HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getXpnHostProjectMethodDescriptor) .build(); - HttpJsonCallSettings getXpnResourcesProjectsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getXpnResourcesProjectsMethodDescriptor) - .build(); - HttpJsonCallSettings listXpnHostsProjectsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listXpnHostsProjectsMethodDescriptor) - .build(); + HttpJsonCallSettings + getXpnResourcesProjectsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getXpnResourcesProjectsMethodDescriptor) + .build(); + HttpJsonCallSettings + listXpnHostsProjectsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listXpnHostsProjectsMethodDescriptor) + .build(); HttpJsonCallSettings moveDiskProjectTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(moveDiskProjectMethodDescriptor) .build(); - HttpJsonCallSettings moveInstanceProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(moveInstanceProjectMethodDescriptor) - .build(); - HttpJsonCallSettings setCommonInstanceMetadataProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setCommonInstanceMetadataProjectMethodDescriptor) - .build(); - HttpJsonCallSettings setUsageExportBucketProjectTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setUsageExportBucketProjectMethodDescriptor) - .build(); - - this.disableXpnHostProjectCallable = callableFactory.createUnaryCallable(disableXpnHostProjectTransportSettings,settings.disableXpnHostProjectSettings(), clientContext); - this.disableXpnResourceProjectCallable = callableFactory.createUnaryCallable(disableXpnResourceProjectTransportSettings,settings.disableXpnResourceProjectSettings(), clientContext); - this.enableXpnHostProjectCallable = callableFactory.createUnaryCallable(enableXpnHostProjectTransportSettings,settings.enableXpnHostProjectSettings(), clientContext); - this.enableXpnResourceProjectCallable = callableFactory.createUnaryCallable(enableXpnResourceProjectTransportSettings,settings.enableXpnResourceProjectSettings(), clientContext); - this.getProjectCallable = callableFactory.createUnaryCallable(getProjectTransportSettings,settings.getProjectSettings(), clientContext); - this.getXpnHostProjectCallable = callableFactory.createUnaryCallable(getXpnHostProjectTransportSettings,settings.getXpnHostProjectSettings(), clientContext); - this.getXpnResourcesProjectsCallable = callableFactory.createUnaryCallable(getXpnResourcesProjectsTransportSettings,settings.getXpnResourcesProjectsSettings(), clientContext); - this.getXpnResourcesProjectsPagedCallable = callableFactory.createPagedCallable(getXpnResourcesProjectsTransportSettings,settings.getXpnResourcesProjectsSettings(), clientContext); - this.listXpnHostsProjectsCallable = callableFactory.createUnaryCallable(listXpnHostsProjectsTransportSettings,settings.listXpnHostsProjectsSettings(), clientContext); - this.listXpnHostsProjectsPagedCallable = callableFactory.createPagedCallable(listXpnHostsProjectsTransportSettings,settings.listXpnHostsProjectsSettings(), clientContext); - this.moveDiskProjectCallable = callableFactory.createUnaryCallable(moveDiskProjectTransportSettings,settings.moveDiskProjectSettings(), clientContext); - this.moveInstanceProjectCallable = callableFactory.createUnaryCallable(moveInstanceProjectTransportSettings,settings.moveInstanceProjectSettings(), clientContext); - this.setCommonInstanceMetadataProjectCallable = callableFactory.createUnaryCallable(setCommonInstanceMetadataProjectTransportSettings,settings.setCommonInstanceMetadataProjectSettings(), clientContext); - this.setUsageExportBucketProjectCallable = callableFactory.createUnaryCallable(setUsageExportBucketProjectTransportSettings,settings.setUsageExportBucketProjectSettings(), clientContext); + HttpJsonCallSettings + moveInstanceProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(moveInstanceProjectMethodDescriptor) + .build(); + HttpJsonCallSettings + setCommonInstanceMetadataProjectTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setCommonInstanceMetadataProjectMethodDescriptor) + .build(); + HttpJsonCallSettings + setUsageExportBucketProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUsageExportBucketProjectMethodDescriptor) + .build(); + + this.disableXpnHostProjectCallable = + callableFactory.createUnaryCallable( + disableXpnHostProjectTransportSettings, + settings.disableXpnHostProjectSettings(), + clientContext); + this.disableXpnResourceProjectCallable = + callableFactory.createUnaryCallable( + disableXpnResourceProjectTransportSettings, + settings.disableXpnResourceProjectSettings(), + clientContext); + this.enableXpnHostProjectCallable = + callableFactory.createUnaryCallable( + enableXpnHostProjectTransportSettings, + settings.enableXpnHostProjectSettings(), + clientContext); + this.enableXpnResourceProjectCallable = + callableFactory.createUnaryCallable( + enableXpnResourceProjectTransportSettings, + settings.enableXpnResourceProjectSettings(), + clientContext); + this.getProjectCallable = + callableFactory.createUnaryCallable( + getProjectTransportSettings, settings.getProjectSettings(), clientContext); + this.getXpnHostProjectCallable = + callableFactory.createUnaryCallable( + getXpnHostProjectTransportSettings, + settings.getXpnHostProjectSettings(), + clientContext); + this.getXpnResourcesProjectsCallable = + callableFactory.createUnaryCallable( + getXpnResourcesProjectsTransportSettings, + settings.getXpnResourcesProjectsSettings(), + clientContext); + this.getXpnResourcesProjectsPagedCallable = + callableFactory.createPagedCallable( + getXpnResourcesProjectsTransportSettings, + settings.getXpnResourcesProjectsSettings(), + clientContext); + this.listXpnHostsProjectsCallable = + callableFactory.createUnaryCallable( + listXpnHostsProjectsTransportSettings, + settings.listXpnHostsProjectsSettings(), + clientContext); + this.listXpnHostsProjectsPagedCallable = + callableFactory.createPagedCallable( + listXpnHostsProjectsTransportSettings, + settings.listXpnHostsProjectsSettings(), + clientContext); + this.moveDiskProjectCallable = + callableFactory.createUnaryCallable( + moveDiskProjectTransportSettings, settings.moveDiskProjectSettings(), clientContext); + this.moveInstanceProjectCallable = + callableFactory.createUnaryCallable( + moveInstanceProjectTransportSettings, + settings.moveInstanceProjectSettings(), + clientContext); + this.setCommonInstanceMetadataProjectCallable = + callableFactory.createUnaryCallable( + setCommonInstanceMetadataProjectTransportSettings, + settings.setCommonInstanceMetadataProjectSettings(), + clientContext); + this.setUsageExportBucketProjectCallable = + callableFactory.createUnaryCallable( + setUsageExportBucketProjectTransportSettings, + settings.setUsageExportBucketProjectSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable disableXpnHostProjectCallable() { + public UnaryCallable + disableXpnHostProjectCallable() { return disableXpnHostProjectCallable; } @BetaApi - public UnaryCallable disableXpnResourceProjectCallable() { + public UnaryCallable + disableXpnResourceProjectCallable() { return disableXpnResourceProjectCallable; } @@ -443,7 +525,8 @@ public UnaryCallable enableXpnHostPr } @BetaApi - public UnaryCallable enableXpnResourceProjectCallable() { + public UnaryCallable + enableXpnResourceProjectCallable() { return enableXpnResourceProjectCallable; } @@ -458,22 +541,26 @@ public UnaryCallable getXpnHostProjectCal } @BetaApi - public UnaryCallable getXpnResourcesProjectsPagedCallable() { + public UnaryCallable + getXpnResourcesProjectsPagedCallable() { return getXpnResourcesProjectsPagedCallable; } @BetaApi - public UnaryCallable getXpnResourcesProjectsCallable() { + public UnaryCallable + getXpnResourcesProjectsCallable() { return getXpnResourcesProjectsCallable; } @BetaApi - public UnaryCallable listXpnHostsProjectsPagedCallable() { + public UnaryCallable + listXpnHostsProjectsPagedCallable() { return listXpnHostsProjectsPagedCallable; } @BetaApi - public UnaryCallable listXpnHostsProjectsCallable() { + public UnaryCallable + listXpnHostsProjectsCallable() { return listXpnHostsProjectsCallable; } @@ -488,17 +575,19 @@ public UnaryCallable moveInstanceProj } @BetaApi - public UnaryCallable setCommonInstanceMetadataProjectCallable() { + public UnaryCallable + setCommonInstanceMetadataProjectCallable() { return setCommonInstanceMetadataProjectCallable; } @BetaApi - public UnaryCallable setUsageExportBucketProjectCallable() { + public UnaryCallable + setUsageExportBucketProjectCallable() { return setUsageExportBucketProjectCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -526,5 +615,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java index 990388814afd..20dea91a32d1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.Autoscaler; -import com.google.cloud.compute.v1.DeleteRegionAutoscalerHttpRequest; -import com.google.cloud.compute.v1.GetRegionAutoscalerHttpRequest; -import com.google.cloud.compute.v1.InsertRegionAutoscalerHttpRequest; -import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; -import com.google.cloud.compute.v1.ProjectRegionAutoscalerName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; -import com.google.cloud.compute.v1.RegionAutoscalerList; -import com.google.cloud.compute.v1.RegionAutoscalerSettings; -import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java index 43c9a8548f8c..41a649bda416 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.Autoscaler; @@ -38,16 +39,10 @@ import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; import com.google.cloud.compute.v1.ProjectRegionAutoscalerName; import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; import com.google.cloud.compute.v1.RegionAutoscalerList; -import com.google.cloud.compute.v1.RegionAutoscalerSettings; import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,202 +56,266 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { @InternalApi - public static final ApiMethodDescriptor deleteRegionAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionAutoscalers.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers/{autoscaler}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) - .setResourceNameField("autoscaler") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getRegionAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionAutoscalers.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers/{autoscaler}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) - .setResourceNameField("autoscaler") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Autoscaler.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/autoscalers/{autoscaler}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionAutoscalerName.newFactory()) + .setResourceNameField("autoscaler") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Autoscaler.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertRegionAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionAutoscalers.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionAutoscalersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionAutoscalers.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionAutoscalersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RegionAutoscalerList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRegionAutoscalersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionAutoscalersHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionAutoscalerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchRegionAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionAutoscalers.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "autoscaler", "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateRegionAutoscalerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionAutoscalers.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/autoscalers")) - .setQueryParams(Sets.newHashSet( - "autoscaler", "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateRegionAutoscalerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionAutoscalers.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/autoscalers")) + .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteRegionAutoscalerCallable; - private final UnaryCallable getRegionAutoscalerCallable; - private final UnaryCallable insertRegionAutoscalerCallable; - private final UnaryCallable listRegionAutoscalersCallable; - private final UnaryCallable listRegionAutoscalersPagedCallable; - private final UnaryCallable patchRegionAutoscalerCallable; - private final UnaryCallable updateRegionAutoscalerCallable; + private final UnaryCallable + deleteRegionAutoscalerCallable; + private final UnaryCallable + getRegionAutoscalerCallable; + private final UnaryCallable + insertRegionAutoscalerCallable; + private final UnaryCallable + listRegionAutoscalersCallable; + private final UnaryCallable + listRegionAutoscalersPagedCallable; + private final UnaryCallable + patchRegionAutoscalerCallable; + private final UnaryCallable + updateRegionAutoscalerCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRegionAutoscalerStub create(RegionAutoscalerStubSettings settings) throws IOException { + + public static final HttpJsonRegionAutoscalerStub create(RegionAutoscalerStubSettings settings) + throws IOException { return new HttpJsonRegionAutoscalerStub(settings, ClientContext.create(settings)); } - public static final HttpJsonRegionAutoscalerStub create(ClientContext clientContext) throws IOException { - return new HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonRegionAutoscalerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionAutoscalerStub( + RegionAutoscalerStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionAutoscalerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionAutoscalerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionAutoscalerStub( + RegionAutoscalerStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRegionAutoscalerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionAutoscalerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionAutoscalerStub( + RegionAutoscalerStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonRegionAutoscalerCallableFactory()); } /** - * Constructs an instance of HttpJsonRegionAutoscalerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionAutoscalerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionAutoscalerStub(RegionAutoscalerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionAutoscalerStub( + RegionAutoscalerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteRegionAutoscalerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteRegionAutoscalerMethodDescriptor) - .build(); - HttpJsonCallSettings getRegionAutoscalerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRegionAutoscalerMethodDescriptor) - .build(); - HttpJsonCallSettings insertRegionAutoscalerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertRegionAutoscalerMethodDescriptor) - .build(); - HttpJsonCallSettings listRegionAutoscalersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRegionAutoscalersMethodDescriptor) - .build(); - HttpJsonCallSettings patchRegionAutoscalerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchRegionAutoscalerMethodDescriptor) - .build(); - HttpJsonCallSettings updateRegionAutoscalerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateRegionAutoscalerMethodDescriptor) - .build(); - - this.deleteRegionAutoscalerCallable = callableFactory.createUnaryCallable(deleteRegionAutoscalerTransportSettings,settings.deleteRegionAutoscalerSettings(), clientContext); - this.getRegionAutoscalerCallable = callableFactory.createUnaryCallable(getRegionAutoscalerTransportSettings,settings.getRegionAutoscalerSettings(), clientContext); - this.insertRegionAutoscalerCallable = callableFactory.createUnaryCallable(insertRegionAutoscalerTransportSettings,settings.insertRegionAutoscalerSettings(), clientContext); - this.listRegionAutoscalersCallable = callableFactory.createUnaryCallable(listRegionAutoscalersTransportSettings,settings.listRegionAutoscalersSettings(), clientContext); - this.listRegionAutoscalersPagedCallable = callableFactory.createPagedCallable(listRegionAutoscalersTransportSettings,settings.listRegionAutoscalersSettings(), clientContext); - this.patchRegionAutoscalerCallable = callableFactory.createUnaryCallable(patchRegionAutoscalerTransportSettings,settings.patchRegionAutoscalerSettings(), clientContext); - this.updateRegionAutoscalerCallable = callableFactory.createUnaryCallable(updateRegionAutoscalerTransportSettings,settings.updateRegionAutoscalerSettings(), clientContext); + HttpJsonCallSettings + deleteRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings + getRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings + insertRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionAutoscalersTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listRegionAutoscalersMethodDescriptor) + .build(); + HttpJsonCallSettings + patchRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchRegionAutoscalerMethodDescriptor) + .build(); + HttpJsonCallSettings + updateRegionAutoscalerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRegionAutoscalerMethodDescriptor) + .build(); + + this.deleteRegionAutoscalerCallable = + callableFactory.createUnaryCallable( + deleteRegionAutoscalerTransportSettings, + settings.deleteRegionAutoscalerSettings(), + clientContext); + this.getRegionAutoscalerCallable = + callableFactory.createUnaryCallable( + getRegionAutoscalerTransportSettings, + settings.getRegionAutoscalerSettings(), + clientContext); + this.insertRegionAutoscalerCallable = + callableFactory.createUnaryCallable( + insertRegionAutoscalerTransportSettings, + settings.insertRegionAutoscalerSettings(), + clientContext); + this.listRegionAutoscalersCallable = + callableFactory.createUnaryCallable( + listRegionAutoscalersTransportSettings, + settings.listRegionAutoscalersSettings(), + clientContext); + this.listRegionAutoscalersPagedCallable = + callableFactory.createPagedCallable( + listRegionAutoscalersTransportSettings, + settings.listRegionAutoscalersSettings(), + clientContext); + this.patchRegionAutoscalerCallable = + callableFactory.createUnaryCallable( + patchRegionAutoscalerTransportSettings, + settings.patchRegionAutoscalerSettings(), + clientContext); + this.updateRegionAutoscalerCallable = + callableFactory.createUnaryCallable( + updateRegionAutoscalerTransportSettings, + settings.updateRegionAutoscalerSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteRegionAutoscalerCallable() { + public UnaryCallable + deleteRegionAutoscalerCallable() { return deleteRegionAutoscalerCallable; } @@ -266,32 +325,37 @@ public UnaryCallable getRegionAutosc } @BetaApi - public UnaryCallable insertRegionAutoscalerCallable() { + public UnaryCallable + insertRegionAutoscalerCallable() { return insertRegionAutoscalerCallable; } @BetaApi - public UnaryCallable listRegionAutoscalersPagedCallable() { + public UnaryCallable + listRegionAutoscalersPagedCallable() { return listRegionAutoscalersPagedCallable; } @BetaApi - public UnaryCallable listRegionAutoscalersCallable() { + public UnaryCallable + listRegionAutoscalersCallable() { return listRegionAutoscalersCallable; } @BetaApi - public UnaryCallable patchRegionAutoscalerCallable() { + public UnaryCallable + patchRegionAutoscalerCallable() { return patchRegionAutoscalerCallable; } @BetaApi - public UnaryCallable updateRegionAutoscalerCallable() { + public UnaryCallable + updateRegionAutoscalerCallable() { return updateRegionAutoscalerCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -319,5 +383,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java index b2c006b2957a..237db578a029 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.BackendService; -import com.google.cloud.compute.v1.BackendServiceGroupHealth; -import com.google.cloud.compute.v1.BackendServiceList; -import com.google.cloud.compute.v1.DeleteRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.GetHealthRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.GetRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.InsertRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; -import com.google.cloud.compute.v1.RegionBackendServiceSettings; -import com.google.cloud.compute.v1.ResourceGroupReference; -import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java index 924ba902d627..e5fdc6ddbb93 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.BackendService; @@ -41,16 +42,9 @@ import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; -import com.google.cloud.compute.v1.RegionBackendServiceSettings; -import com.google.cloud.compute.v1.ResourceGroupReference; import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,267 +58,358 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { @InternalApi - public static final ApiMethodDescriptor deleteRegionBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getRegionBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendService.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendService.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getHealthRegionBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.getHealth") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}/getHealth")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendServiceGroupHealth.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + GetHealthRegionBackendServiceHttpRequest, BackendServiceGroupHealth> + getHealthRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionBackendServices.getHealth") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/backendServices/{backendService}/getHealth")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceGroupHealth.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertRegionBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + InsertRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/backendServices")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionBackendServicesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionBackendServicesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(BackendServiceList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRegionBackendServicesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionBackendServicesHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/backendServices")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(BackendServiceList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchRegionBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateRegionBackendServiceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionBackendServices.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/backendServices/{backendService}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) - .setResourceNameField("backendService") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateRegionBackendServiceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionBackendServices.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/backendServices/{backendService}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionBackendServiceName.newFactory()) + .setResourceNameField("backendService") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteRegionBackendServiceCallable; - private final UnaryCallable getRegionBackendServiceCallable; - private final UnaryCallable getHealthRegionBackendServiceCallable; - private final UnaryCallable insertRegionBackendServiceCallable; - private final UnaryCallable listRegionBackendServicesCallable; - private final UnaryCallable listRegionBackendServicesPagedCallable; - private final UnaryCallable patchRegionBackendServiceCallable; - private final UnaryCallable updateRegionBackendServiceCallable; + private final UnaryCallable + deleteRegionBackendServiceCallable; + private final UnaryCallable + getRegionBackendServiceCallable; + private final UnaryCallable + getHealthRegionBackendServiceCallable; + private final UnaryCallable + insertRegionBackendServiceCallable; + private final UnaryCallable + listRegionBackendServicesCallable; + private final UnaryCallable< + ListRegionBackendServicesHttpRequest, ListRegionBackendServicesPagedResponse> + listRegionBackendServicesPagedCallable; + private final UnaryCallable + patchRegionBackendServiceCallable; + private final UnaryCallable + updateRegionBackendServiceCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRegionBackendServiceStub create(RegionBackendServiceStubSettings settings) throws IOException { + + public static final HttpJsonRegionBackendServiceStub create( + RegionBackendServiceStubSettings settings) throws IOException { return new HttpJsonRegionBackendServiceStub(settings, ClientContext.create(settings)); } - public static final HttpJsonRegionBackendServiceStub create(ClientContext clientContext) throws IOException { - return new HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonRegionBackendServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionBackendServiceStub( + RegionBackendServiceStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionBackendServiceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionBackendServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionBackendServiceStub( + RegionBackendServiceStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRegionBackendServiceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionBackendServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionBackendServiceStub( + RegionBackendServiceStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonRegionBackendServiceCallableFactory()); } /** - * Constructs an instance of HttpJsonRegionBackendServiceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionBackendServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionBackendServiceStub(RegionBackendServiceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionBackendServiceStub( + RegionBackendServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteRegionBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteRegionBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings getRegionBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRegionBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings getHealthRegionBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getHealthRegionBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings insertRegionBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertRegionBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings listRegionBackendServicesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRegionBackendServicesMethodDescriptor) - .build(); - HttpJsonCallSettings patchRegionBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(patchRegionBackendServiceMethodDescriptor) - .build(); - HttpJsonCallSettings updateRegionBackendServiceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateRegionBackendServiceMethodDescriptor) - .build(); - - this.deleteRegionBackendServiceCallable = callableFactory.createUnaryCallable(deleteRegionBackendServiceTransportSettings,settings.deleteRegionBackendServiceSettings(), clientContext); - this.getRegionBackendServiceCallable = callableFactory.createUnaryCallable(getRegionBackendServiceTransportSettings,settings.getRegionBackendServiceSettings(), clientContext); - this.getHealthRegionBackendServiceCallable = callableFactory.createUnaryCallable(getHealthRegionBackendServiceTransportSettings,settings.getHealthRegionBackendServiceSettings(), clientContext); - this.insertRegionBackendServiceCallable = callableFactory.createUnaryCallable(insertRegionBackendServiceTransportSettings,settings.insertRegionBackendServiceSettings(), clientContext); - this.listRegionBackendServicesCallable = callableFactory.createUnaryCallable(listRegionBackendServicesTransportSettings,settings.listRegionBackendServicesSettings(), clientContext); - this.listRegionBackendServicesPagedCallable = callableFactory.createPagedCallable(listRegionBackendServicesTransportSettings,settings.listRegionBackendServicesSettings(), clientContext); - this.patchRegionBackendServiceCallable = callableFactory.createUnaryCallable(patchRegionBackendServiceTransportSettings,settings.patchRegionBackendServiceSettings(), clientContext); - this.updateRegionBackendServiceCallable = callableFactory.createUnaryCallable(updateRegionBackendServiceTransportSettings,settings.updateRegionBackendServiceSettings(), clientContext); + HttpJsonCallSettings + deleteRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + getRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + getHealthRegionBackendServiceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getHealthRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + insertRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionBackendServicesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listRegionBackendServicesMethodDescriptor) + .build(); + HttpJsonCallSettings + patchRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchRegionBackendServiceMethodDescriptor) + .build(); + HttpJsonCallSettings + updateRegionBackendServiceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRegionBackendServiceMethodDescriptor) + .build(); + + this.deleteRegionBackendServiceCallable = + callableFactory.createUnaryCallable( + deleteRegionBackendServiceTransportSettings, + settings.deleteRegionBackendServiceSettings(), + clientContext); + this.getRegionBackendServiceCallable = + callableFactory.createUnaryCallable( + getRegionBackendServiceTransportSettings, + settings.getRegionBackendServiceSettings(), + clientContext); + this.getHealthRegionBackendServiceCallable = + callableFactory.createUnaryCallable( + getHealthRegionBackendServiceTransportSettings, + settings.getHealthRegionBackendServiceSettings(), + clientContext); + this.insertRegionBackendServiceCallable = + callableFactory.createUnaryCallable( + insertRegionBackendServiceTransportSettings, + settings.insertRegionBackendServiceSettings(), + clientContext); + this.listRegionBackendServicesCallable = + callableFactory.createUnaryCallable( + listRegionBackendServicesTransportSettings, + settings.listRegionBackendServicesSettings(), + clientContext); + this.listRegionBackendServicesPagedCallable = + callableFactory.createPagedCallable( + listRegionBackendServicesTransportSettings, + settings.listRegionBackendServicesSettings(), + clientContext); + this.patchRegionBackendServiceCallable = + callableFactory.createUnaryCallable( + patchRegionBackendServiceTransportSettings, + settings.patchRegionBackendServiceSettings(), + clientContext); + this.updateRegionBackendServiceCallable = + callableFactory.createUnaryCallable( + updateRegionBackendServiceTransportSettings, + settings.updateRegionBackendServiceSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteRegionBackendServiceCallable() { + public UnaryCallable + deleteRegionBackendServiceCallable() { return deleteRegionBackendServiceCallable; } @BetaApi - public UnaryCallable getRegionBackendServiceCallable() { + public UnaryCallable + getRegionBackendServiceCallable() { return getRegionBackendServiceCallable; } @BetaApi - public UnaryCallable getHealthRegionBackendServiceCallable() { + public UnaryCallable + getHealthRegionBackendServiceCallable() { return getHealthRegionBackendServiceCallable; } @BetaApi - public UnaryCallable insertRegionBackendServiceCallable() { + public UnaryCallable + insertRegionBackendServiceCallable() { return insertRegionBackendServiceCallable; } @BetaApi - public UnaryCallable listRegionBackendServicesPagedCallable() { + public UnaryCallable + listRegionBackendServicesPagedCallable() { return listRegionBackendServicesPagedCallable; } @BetaApi - public UnaryCallable listRegionBackendServicesCallable() { + public UnaryCallable + listRegionBackendServicesCallable() { return listRegionBackendServicesCallable; } @BetaApi - public UnaryCallable patchRegionBackendServiceCallable() { + public UnaryCallable + patchRegionBackendServiceCallable() { return patchRegionBackendServiceCallable; } @BetaApi - public UnaryCallable updateRegionBackendServiceCallable() { + public UnaryCallable + updateRegionBackendServiceCallable() { return updateRegionBackendServiceCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -352,5 +437,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java index 232307c4a396..3c7b493c70f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java @@ -15,47 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetRegionHttpRequest; -import com.google.cloud.compute.v1.ListRegionsHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.Region; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; -import com.google.cloud.compute.v1.RegionList; -import com.google.cloud.compute.v1.RegionSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -89,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java index 7c9b830fd6ab..ca4ec775a46f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java @@ -15,53 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest; -import com.google.cloud.compute.v1.Commitment; -import com.google.cloud.compute.v1.CommitmentAggregatedList; -import com.google.cloud.compute.v1.CommitmentList; -import com.google.cloud.compute.v1.CommitmentsScopedList; -import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest; -import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; -import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionCommitmentName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; -import com.google.cloud.compute.v1.RegionCommitmentSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -78,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -95,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java index 2db31d476c79..cabe19ae24ab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,14 +29,12 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest; import com.google.cloud.compute.v1.Commitment; import com.google.cloud.compute.v1.CommitmentAggregatedList; import com.google.cloud.compute.v1.CommitmentList; -import com.google.cloud.compute.v1.CommitmentsScopedList; import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest; import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; @@ -41,15 +42,8 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectRegionCommitmentName; import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; -import com.google.cloud.compute.v1.RegionCommitmentSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -63,157 +57,218 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListRegionCommitmentsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionCommitments.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/commitments")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(CommitmentAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList> + aggregatedListRegionCommitmentsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionCommitments.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/commitments")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(CommitmentAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getRegionCommitmentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionCommitments.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionCommitmentHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments/{commitment}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionCommitmentName.newFactory()) - .setResourceNameField("commitment") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Commitment.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getRegionCommitmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionCommitmentHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/commitments/{commitment}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionCommitmentName.newFactory()) + .setResourceNameField("commitment") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Commitment.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertRegionCommitmentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionCommitments.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionCommitmentHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRegionCommitmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionCommitmentHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/commitments")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionCommitmentsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionCommitments.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionCommitmentsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/commitments")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(CommitmentList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRegionCommitmentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionCommitments.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionCommitmentsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/commitments")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(CommitmentList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListRegionCommitmentsCallable; - private final UnaryCallable aggregatedListRegionCommitmentsPagedCallable; - private final UnaryCallable getRegionCommitmentCallable; - private final UnaryCallable insertRegionCommitmentCallable; - private final UnaryCallable listRegionCommitmentsCallable; - private final UnaryCallable listRegionCommitmentsPagedCallable; + private final UnaryCallable + aggregatedListRegionCommitmentsCallable; + private final UnaryCallable< + AggregatedListRegionCommitmentsHttpRequest, AggregatedListRegionCommitmentsPagedResponse> + aggregatedListRegionCommitmentsPagedCallable; + private final UnaryCallable + getRegionCommitmentCallable; + private final UnaryCallable + insertRegionCommitmentCallable; + private final UnaryCallable + listRegionCommitmentsCallable; + private final UnaryCallable + listRegionCommitmentsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRegionCommitmentStub create(RegionCommitmentStubSettings settings) throws IOException { + + public static final HttpJsonRegionCommitmentStub create(RegionCommitmentStubSettings settings) + throws IOException { return new HttpJsonRegionCommitmentStub(settings, ClientContext.create(settings)); } - public static final HttpJsonRegionCommitmentStub create(ClientContext clientContext) throws IOException { - return new HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonRegionCommitmentStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionCommitmentStub( + RegionCommitmentStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionCommitmentStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionCommitmentStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionCommitmentStub( + RegionCommitmentStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRegionCommitmentStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionCommitmentStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionCommitmentStub( + RegionCommitmentStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonRegionCommitmentCallableFactory()); } /** - * Constructs an instance of HttpJsonRegionCommitmentStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionCommitmentStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionCommitmentStub(RegionCommitmentStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionCommitmentStub( + RegionCommitmentStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListRegionCommitmentsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListRegionCommitmentsMethodDescriptor) - .build(); - HttpJsonCallSettings getRegionCommitmentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRegionCommitmentMethodDescriptor) - .build(); - HttpJsonCallSettings insertRegionCommitmentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertRegionCommitmentMethodDescriptor) - .build(); - HttpJsonCallSettings listRegionCommitmentsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRegionCommitmentsMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListRegionCommitmentsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListRegionCommitmentsMethodDescriptor) + .build(); + HttpJsonCallSettings + getRegionCommitmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionCommitmentMethodDescriptor) + .build(); + HttpJsonCallSettings + insertRegionCommitmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionCommitmentMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionCommitmentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionCommitmentsMethodDescriptor) + .build(); - this.aggregatedListRegionCommitmentsCallable = callableFactory.createUnaryCallable(aggregatedListRegionCommitmentsTransportSettings,settings.aggregatedListRegionCommitmentsSettings(), clientContext); - this.aggregatedListRegionCommitmentsPagedCallable = callableFactory.createPagedCallable(aggregatedListRegionCommitmentsTransportSettings,settings.aggregatedListRegionCommitmentsSettings(), clientContext); - this.getRegionCommitmentCallable = callableFactory.createUnaryCallable(getRegionCommitmentTransportSettings,settings.getRegionCommitmentSettings(), clientContext); - this.insertRegionCommitmentCallable = callableFactory.createUnaryCallable(insertRegionCommitmentTransportSettings,settings.insertRegionCommitmentSettings(), clientContext); - this.listRegionCommitmentsCallable = callableFactory.createUnaryCallable(listRegionCommitmentsTransportSettings,settings.listRegionCommitmentsSettings(), clientContext); - this.listRegionCommitmentsPagedCallable = callableFactory.createPagedCallable(listRegionCommitmentsTransportSettings,settings.listRegionCommitmentsSettings(), clientContext); + this.aggregatedListRegionCommitmentsCallable = + callableFactory.createUnaryCallable( + aggregatedListRegionCommitmentsTransportSettings, + settings.aggregatedListRegionCommitmentsSettings(), + clientContext); + this.aggregatedListRegionCommitmentsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListRegionCommitmentsTransportSettings, + settings.aggregatedListRegionCommitmentsSettings(), + clientContext); + this.getRegionCommitmentCallable = + callableFactory.createUnaryCallable( + getRegionCommitmentTransportSettings, + settings.getRegionCommitmentSettings(), + clientContext); + this.insertRegionCommitmentCallable = + callableFactory.createUnaryCallable( + insertRegionCommitmentTransportSettings, + settings.insertRegionCommitmentSettings(), + clientContext); + this.listRegionCommitmentsCallable = + callableFactory.createUnaryCallable( + listRegionCommitmentsTransportSettings, + settings.listRegionCommitmentsSettings(), + clientContext); + this.listRegionCommitmentsPagedCallable = + callableFactory.createPagedCallable( + listRegionCommitmentsTransportSettings, + settings.listRegionCommitmentsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListRegionCommitmentsPagedCallable() { + public UnaryCallable< + AggregatedListRegionCommitmentsHttpRequest, AggregatedListRegionCommitmentsPagedResponse> + aggregatedListRegionCommitmentsPagedCallable() { return aggregatedListRegionCommitmentsPagedCallable; } @BetaApi - public UnaryCallable aggregatedListRegionCommitmentsCallable() { + public UnaryCallable + aggregatedListRegionCommitmentsCallable() { return aggregatedListRegionCommitmentsCallable; } @@ -223,22 +278,25 @@ public UnaryCallable getRegionCommit } @BetaApi - public UnaryCallable insertRegionCommitmentCallable() { + public UnaryCallable + insertRegionCommitmentCallable() { return insertRegionCommitmentCallable; } @BetaApi - public UnaryCallable listRegionCommitmentsPagedCallable() { + public UnaryCallable + listRegionCommitmentsPagedCallable() { return listRegionCommitmentsPagedCallable; } @BetaApi - public UnaryCallable listRegionCommitmentsCallable() { + public UnaryCallable + listRegionCommitmentsCallable() { return listRegionCommitmentsCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -266,5 +324,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java index af939575c892..39bcc1c8907a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; -import com.google.cloud.compute.v1.InstanceGroup; -import com.google.cloud.compute.v1.InstanceWithNamedPorts; -import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; -import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; -import com.google.cloud.compute.v1.RegionInstanceGroupList; -import com.google.cloud.compute.v1.RegionInstanceGroupSettings; -import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; -import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; -import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java index 746fed18200f..4e822058c3af 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java @@ -15,62 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.GetRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.InsertRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.InstanceGroupManager; -import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; -import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; -import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; -import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; -import com.google.cloud.compute.v1.RegionInstanceGroupManagerSettings; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; -import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; -import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -81,22 +34,25 @@ */ @Generated("by GAPIC v0.0.5") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class HttpJsonRegionInstanceGroupManagerCallableFactory implements HttpJsonStubCallableFactory { +public class HttpJsonRegionInstanceGroupManagerCallableFactory + implements HttpJsonStubCallableFactory { @Override public UnaryCallable createUnaryCallable( HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -104,6 +60,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index b6b19cbb1837..685154932372 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; @@ -41,24 +42,13 @@ import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; -import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; -import com.google.cloud.compute.v1.RegionInstanceGroupManagerSettings; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -72,392 +62,584 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupManagerStub { @InternalApi - public static final ApiMethodDescriptor abandonInstancesRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.abandonInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AbandonInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AbandonInstancesRegionInstanceGroupManagerHttpRequest, Operation> + abandonInstancesRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.abandonInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AbandonInstancesRegionInstanceGroupManagerHttpRequest + .getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteInstancesRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.deleteInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + DeleteInstancesRegionInstanceGroupManagerHttpRequest, Operation> + deleteInstancesRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.deleteInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroupManager.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + GetRegionInstanceGroupManagerHttpRequest, InstanceGroupManager> + getRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroupManager.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionInstanceGroupManagersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RegionInstanceGroupManagerList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList> + listRegionInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupManagerList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listManagedInstancesRegionInstanceGroupManagersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.listManagedInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListManagedInstancesRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "order_by", "pageToken" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RegionInstanceGroupManagersListInstancesResponse.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.listManagedInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListManagedInstancesRegionInstanceGroupManagersHttpRequest + .getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser + .newBuilder() + .setResponseInstance( + RegionInstanceGroupManagersListInstancesResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor recreateInstancesRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.recreateInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RecreateInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + RecreateInstancesRegionInstanceGroupManagerHttpRequest, Operation> + recreateInstancesRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.recreateInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + RecreateInstancesRegionInstanceGroupManagerHttpRequest + .getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor resizeRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.resize") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) - .setQueryParams(Sets.newHashSet( - "requestId", "size" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + resizeRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) + .setQueryParams(Sets.newHashSet("requestId", "size")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.setInstanceTemplate") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest, Operation> + setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.setInstanceTemplate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest + .getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setTargetPoolsRegionInstanceGroupManagerMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroupManagers.setTargetPools") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) - .setResourceNameField("instanceGroupManager") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + SetTargetPoolsRegionInstanceGroupManagerHttpRequest, Operation> + setTargetPoolsRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.setTargetPools") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable; - private final UnaryCallable deleteRegionInstanceGroupManagerCallable; - private final UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable; - private final UnaryCallable getRegionInstanceGroupManagerCallable; - private final UnaryCallable insertRegionInstanceGroupManagerCallable; - private final UnaryCallable listRegionInstanceGroupManagersCallable; - private final UnaryCallable listRegionInstanceGroupManagersPagedCallable; - private final UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable; - private final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable; - private final UnaryCallable resizeRegionInstanceGroupManagerCallable; - private final UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable; - private final UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable; + private final UnaryCallable + abandonInstancesRegionInstanceGroupManagerCallable; + private final UnaryCallable + deleteRegionInstanceGroupManagerCallable; + private final UnaryCallable + deleteInstancesRegionInstanceGroupManagerCallable; + private final UnaryCallable + getRegionInstanceGroupManagerCallable; + private final UnaryCallable + insertRegionInstanceGroupManagerCallable; + private final UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList> + listRegionInstanceGroupManagersCallable; + private final UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersPagedCallable; + private final UnaryCallable< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersCallable; + private final UnaryCallable + recreateInstancesRegionInstanceGroupManagerCallable; + private final UnaryCallable + resizeRegionInstanceGroupManagerCallable; + private final UnaryCallable + setInstanceTemplateRegionInstanceGroupManagerCallable; + private final UnaryCallable + setTargetPoolsRegionInstanceGroupManagerCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRegionInstanceGroupManagerStub create(RegionInstanceGroupManagerStubSettings settings) throws IOException { + + public static final HttpJsonRegionInstanceGroupManagerStub create( + RegionInstanceGroupManagerStubSettings settings) throws IOException { return new HttpJsonRegionInstanceGroupManagerStub(settings, ClientContext.create(settings)); } - public static final HttpJsonRegionInstanceGroupManagerStub create(ClientContext clientContext) throws IOException { - return new HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonRegionInstanceGroupManagerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionInstanceGroupManagerStub( + RegionInstanceGroupManagerStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionInstanceGroupManagerStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionInstanceGroupManagerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionInstanceGroupManagerStub( + RegionInstanceGroupManagerStubSettings.newBuilder().build(), + clientContext, + callableFactory); } /** * Constructs an instance of HttpJsonRegionInstanceGroupManagerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * This is protected so that it is easy to make a subclass, but otherwise, the static factory + * methods should be preferred. */ - protected HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionInstanceGroupManagerStub( + RegionInstanceGroupManagerStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonRegionInstanceGroupManagerCallableFactory()); } /** * Constructs an instance of HttpJsonRegionInstanceGroupManagerStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * This is protected so that it is easy to make a subclass, but otherwise, the static factory + * methods should be preferred. */ - protected HttpJsonRegionInstanceGroupManagerStub(RegionInstanceGroupManagerStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionInstanceGroupManagerStub( + RegionInstanceGroupManagerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings abandonInstancesRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(abandonInstancesRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings deleteRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings deleteInstancesRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteInstancesRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings getRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings insertRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings listRegionInstanceGroupManagersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRegionInstanceGroupManagersMethodDescriptor) - .build(); - HttpJsonCallSettings listManagedInstancesRegionInstanceGroupManagersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listManagedInstancesRegionInstanceGroupManagersMethodDescriptor) - .build(); - HttpJsonCallSettings recreateInstancesRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(recreateInstancesRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings resizeRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(resizeRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings setInstanceTemplateRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor) - .build(); - HttpJsonCallSettings setTargetPoolsRegionInstanceGroupManagerTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setTargetPoolsRegionInstanceGroupManagerMethodDescriptor) - .build(); - - this.abandonInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(abandonInstancesRegionInstanceGroupManagerTransportSettings,settings.abandonInstancesRegionInstanceGroupManagerSettings(), clientContext); - this.deleteRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteRegionInstanceGroupManagerTransportSettings,settings.deleteRegionInstanceGroupManagerSettings(), clientContext); - this.deleteInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(deleteInstancesRegionInstanceGroupManagerTransportSettings,settings.deleteInstancesRegionInstanceGroupManagerSettings(), clientContext); - this.getRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(getRegionInstanceGroupManagerTransportSettings,settings.getRegionInstanceGroupManagerSettings(), clientContext); - this.insertRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(insertRegionInstanceGroupManagerTransportSettings,settings.insertRegionInstanceGroupManagerSettings(), clientContext); - this.listRegionInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listRegionInstanceGroupManagersTransportSettings,settings.listRegionInstanceGroupManagersSettings(), clientContext); - this.listRegionInstanceGroupManagersPagedCallable = callableFactory.createPagedCallable(listRegionInstanceGroupManagersTransportSettings,settings.listRegionInstanceGroupManagersSettings(), clientContext); - this.listManagedInstancesRegionInstanceGroupManagersCallable = callableFactory.createUnaryCallable(listManagedInstancesRegionInstanceGroupManagersTransportSettings,settings.listManagedInstancesRegionInstanceGroupManagersSettings(), clientContext); - this.recreateInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(recreateInstancesRegionInstanceGroupManagerTransportSettings,settings.recreateInstancesRegionInstanceGroupManagerSettings(), clientContext); - this.resizeRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(resizeRegionInstanceGroupManagerTransportSettings,settings.resizeRegionInstanceGroupManagerSettings(), clientContext); - this.setInstanceTemplateRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setInstanceTemplateRegionInstanceGroupManagerTransportSettings,settings.setInstanceTemplateRegionInstanceGroupManagerSettings(), clientContext); - this.setTargetPoolsRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable(setTargetPoolsRegionInstanceGroupManagerTransportSettings,settings.setTargetPoolsRegionInstanceGroupManagerSettings(), clientContext); + HttpJsonCallSettings + abandonInstancesRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(abandonInstancesRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(deleteRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteInstancesRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(deleteInstancesRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + getRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + insertRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(insertRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionInstanceGroupManagersTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listRegionInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor( + listManagedInstancesRegionInstanceGroupManagersMethodDescriptor) + .build(); + HttpJsonCallSettings + recreateInstancesRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(recreateInstancesRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + resizeRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(resizeRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + setInstanceTemplateRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor) + .build(); + HttpJsonCallSettings + setTargetPoolsRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setTargetPoolsRegionInstanceGroupManagerMethodDescriptor) + .build(); + + this.abandonInstancesRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + abandonInstancesRegionInstanceGroupManagerTransportSettings, + settings.abandonInstancesRegionInstanceGroupManagerSettings(), + clientContext); + this.deleteRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + deleteRegionInstanceGroupManagerTransportSettings, + settings.deleteRegionInstanceGroupManagerSettings(), + clientContext); + this.deleteInstancesRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + deleteInstancesRegionInstanceGroupManagerTransportSettings, + settings.deleteInstancesRegionInstanceGroupManagerSettings(), + clientContext); + this.getRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + getRegionInstanceGroupManagerTransportSettings, + settings.getRegionInstanceGroupManagerSettings(), + clientContext); + this.insertRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + insertRegionInstanceGroupManagerTransportSettings, + settings.insertRegionInstanceGroupManagerSettings(), + clientContext); + this.listRegionInstanceGroupManagersCallable = + callableFactory.createUnaryCallable( + listRegionInstanceGroupManagersTransportSettings, + settings.listRegionInstanceGroupManagersSettings(), + clientContext); + this.listRegionInstanceGroupManagersPagedCallable = + callableFactory.createPagedCallable( + listRegionInstanceGroupManagersTransportSettings, + settings.listRegionInstanceGroupManagersSettings(), + clientContext); + this.listManagedInstancesRegionInstanceGroupManagersCallable = + callableFactory.createUnaryCallable( + listManagedInstancesRegionInstanceGroupManagersTransportSettings, + settings.listManagedInstancesRegionInstanceGroupManagersSettings(), + clientContext); + this.recreateInstancesRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + recreateInstancesRegionInstanceGroupManagerTransportSettings, + settings.recreateInstancesRegionInstanceGroupManagerSettings(), + clientContext); + this.resizeRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + resizeRegionInstanceGroupManagerTransportSettings, + settings.resizeRegionInstanceGroupManagerSettings(), + clientContext); + this.setInstanceTemplateRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + setInstanceTemplateRegionInstanceGroupManagerTransportSettings, + settings.setInstanceTemplateRegionInstanceGroupManagerSettings(), + clientContext); + this.setTargetPoolsRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + setTargetPoolsRegionInstanceGroupManagerTransportSettings, + settings.setTargetPoolsRegionInstanceGroupManagerSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { + public UnaryCallable + abandonInstancesRegionInstanceGroupManagerCallable() { return abandonInstancesRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable deleteRegionInstanceGroupManagerCallable() { + public UnaryCallable + deleteRegionInstanceGroupManagerCallable() { return deleteRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { + public UnaryCallable + deleteInstancesRegionInstanceGroupManagerCallable() { return deleteInstancesRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable getRegionInstanceGroupManagerCallable() { + public UnaryCallable + getRegionInstanceGroupManagerCallable() { return getRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable insertRegionInstanceGroupManagerCallable() { + public UnaryCallable + insertRegionInstanceGroupManagerCallable() { return insertRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable listRegionInstanceGroupManagersPagedCallable() { + public UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersPagedCallable() { return listRegionInstanceGroupManagersPagedCallable; } @BetaApi - public UnaryCallable listRegionInstanceGroupManagersCallable() { + public UnaryCallable + listRegionInstanceGroupManagersCallable() { return listRegionInstanceGroupManagersCallable; } @BetaApi - public UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { + public UnaryCallable< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersCallable() { return listManagedInstancesRegionInstanceGroupManagersCallable; } @BetaApi - public UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { + public UnaryCallable + recreateInstancesRegionInstanceGroupManagerCallable() { return recreateInstancesRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable resizeRegionInstanceGroupManagerCallable() { + public UnaryCallable + resizeRegionInstanceGroupManagerCallable() { return resizeRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { + public UnaryCallable + setInstanceTemplateRegionInstanceGroupManagerCallable() { return setInstanceTemplateRegionInstanceGroupManagerCallable; } @BetaApi - public UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { + public UnaryCallable + setTargetPoolsRegionInstanceGroupManagerCallable() { return setTargetPoolsRegionInstanceGroupManagerCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -485,5 +667,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java index fc42530d8f6d..71caaa749ae1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,31 +29,20 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; import com.google.cloud.compute.v1.InstanceGroup; -import com.google.cloud.compute.v1.InstanceWithNamedPorts; import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName; import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.RegionInstanceGroupList; -import com.google.cloud.compute.v1.RegionInstanceGroupSettings; import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; -import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,182 +56,264 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { @InternalApi - public static final ApiMethodDescriptor getRegionInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroups.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(InstanceGroup.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getRegionInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroups.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroups/{instanceGroup}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InstanceGroup.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionInstanceGroupsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroups.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RegionInstanceGroupList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList> + listRegionInstanceGroupsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionInstanceGroups.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/instanceGroups")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listInstancesRegionInstanceGroupsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroups.listInstances") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RegionInstanceGroupsListInstances.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances> + listInstancesRegionInstanceGroupsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.regionInstanceGroups.listInstances") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionInstanceGroupsListInstances.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setNamedPortsRegionInstanceGroupMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionInstanceGroups.setNamedPorts") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) - .setResourceNameField("instanceGroup") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setNamedPortsRegionInstanceGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroups.setNamedPorts") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupName.newFactory()) + .setResourceNameField("instanceGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable getRegionInstanceGroupCallable; - private final UnaryCallable listRegionInstanceGroupsCallable; - private final UnaryCallable listRegionInstanceGroupsPagedCallable; - private final UnaryCallable listInstancesRegionInstanceGroupsCallable; - private final UnaryCallable listInstancesRegionInstanceGroupsPagedCallable; - private final UnaryCallable setNamedPortsRegionInstanceGroupCallable; + private final UnaryCallable + getRegionInstanceGroupCallable; + private final UnaryCallable + listRegionInstanceGroupsCallable; + private final UnaryCallable< + ListRegionInstanceGroupsHttpRequest, ListRegionInstanceGroupsPagedResponse> + listRegionInstanceGroupsPagedCallable; + private final UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances> + listInstancesRegionInstanceGroupsCallable; + private final UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, + ListInstancesRegionInstanceGroupsPagedResponse> + listInstancesRegionInstanceGroupsPagedCallable; + private final UnaryCallable + setNamedPortsRegionInstanceGroupCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRegionInstanceGroupStub create(RegionInstanceGroupStubSettings settings) throws IOException { + + public static final HttpJsonRegionInstanceGroupStub create( + RegionInstanceGroupStubSettings settings) throws IOException { return new HttpJsonRegionInstanceGroupStub(settings, ClientContext.create(settings)); } - public static final HttpJsonRegionInstanceGroupStub create(ClientContext clientContext) throws IOException { - return new HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonRegionInstanceGroupStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionInstanceGroupStub( + RegionInstanceGroupStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionInstanceGroupStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionInstanceGroupStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionInstanceGroupStub( + RegionInstanceGroupStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRegionInstanceGroupStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionInstanceGroupStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionInstanceGroupStub( + RegionInstanceGroupStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonRegionInstanceGroupCallableFactory()); } /** - * Constructs an instance of HttpJsonRegionInstanceGroupStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionInstanceGroupStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionInstanceGroupStub(RegionInstanceGroupStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionInstanceGroupStub( + RegionInstanceGroupStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings getRegionInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRegionInstanceGroupMethodDescriptor) - .build(); - HttpJsonCallSettings listRegionInstanceGroupsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRegionInstanceGroupsMethodDescriptor) - .build(); - HttpJsonCallSettings listInstancesRegionInstanceGroupsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listInstancesRegionInstanceGroupsMethodDescriptor) - .build(); - HttpJsonCallSettings setNamedPortsRegionInstanceGroupTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setNamedPortsRegionInstanceGroupMethodDescriptor) - .build(); + HttpJsonCallSettings + getRegionInstanceGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionInstanceGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionInstanceGroupsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listRegionInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances> + listInstancesRegionInstanceGroupsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listInstancesRegionInstanceGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings + setNamedPortsRegionInstanceGroupTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setNamedPortsRegionInstanceGroupMethodDescriptor) + .build(); - this.getRegionInstanceGroupCallable = callableFactory.createUnaryCallable(getRegionInstanceGroupTransportSettings,settings.getRegionInstanceGroupSettings(), clientContext); - this.listRegionInstanceGroupsCallable = callableFactory.createUnaryCallable(listRegionInstanceGroupsTransportSettings,settings.listRegionInstanceGroupsSettings(), clientContext); - this.listRegionInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listRegionInstanceGroupsTransportSettings,settings.listRegionInstanceGroupsSettings(), clientContext); - this.listInstancesRegionInstanceGroupsCallable = callableFactory.createUnaryCallable(listInstancesRegionInstanceGroupsTransportSettings,settings.listInstancesRegionInstanceGroupsSettings(), clientContext); - this.listInstancesRegionInstanceGroupsPagedCallable = callableFactory.createPagedCallable(listInstancesRegionInstanceGroupsTransportSettings,settings.listInstancesRegionInstanceGroupsSettings(), clientContext); - this.setNamedPortsRegionInstanceGroupCallable = callableFactory.createUnaryCallable(setNamedPortsRegionInstanceGroupTransportSettings,settings.setNamedPortsRegionInstanceGroupSettings(), clientContext); + this.getRegionInstanceGroupCallable = + callableFactory.createUnaryCallable( + getRegionInstanceGroupTransportSettings, + settings.getRegionInstanceGroupSettings(), + clientContext); + this.listRegionInstanceGroupsCallable = + callableFactory.createUnaryCallable( + listRegionInstanceGroupsTransportSettings, + settings.listRegionInstanceGroupsSettings(), + clientContext); + this.listRegionInstanceGroupsPagedCallable = + callableFactory.createPagedCallable( + listRegionInstanceGroupsTransportSettings, + settings.listRegionInstanceGroupsSettings(), + clientContext); + this.listInstancesRegionInstanceGroupsCallable = + callableFactory.createUnaryCallable( + listInstancesRegionInstanceGroupsTransportSettings, + settings.listInstancesRegionInstanceGroupsSettings(), + clientContext); + this.listInstancesRegionInstanceGroupsPagedCallable = + callableFactory.createPagedCallable( + listInstancesRegionInstanceGroupsTransportSettings, + settings.listInstancesRegionInstanceGroupsSettings(), + clientContext); + this.setNamedPortsRegionInstanceGroupCallable = + callableFactory.createUnaryCallable( + setNamedPortsRegionInstanceGroupTransportSettings, + settings.setNamedPortsRegionInstanceGroupSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable getRegionInstanceGroupCallable() { + public UnaryCallable + getRegionInstanceGroupCallable() { return getRegionInstanceGroupCallable; } @BetaApi - public UnaryCallable listRegionInstanceGroupsPagedCallable() { + public UnaryCallable + listRegionInstanceGroupsPagedCallable() { return listRegionInstanceGroupsPagedCallable; } @BetaApi - public UnaryCallable listRegionInstanceGroupsCallable() { + public UnaryCallable + listRegionInstanceGroupsCallable() { return listRegionInstanceGroupsCallable; } @BetaApi - public UnaryCallable listInstancesRegionInstanceGroupsPagedCallable() { + public UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, + ListInstancesRegionInstanceGroupsPagedResponse> + listInstancesRegionInstanceGroupsPagedCallable() { return listInstancesRegionInstanceGroupsPagedCallable; } @BetaApi - public UnaryCallable listInstancesRegionInstanceGroupsCallable() { + public UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances> + listInstancesRegionInstanceGroupsCallable() { return listInstancesRegionInstanceGroupsCallable; } @BetaApi - public UnaryCallable setNamedPortsRegionInstanceGroupCallable() { + public UnaryCallable + setNamedPortsRegionInstanceGroupCallable() { return setNamedPortsRegionInstanceGroupCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -267,5 +341,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java index a18d1af2fa12..9dbaa871f45c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java @@ -15,47 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; -import com.google.cloud.compute.v1.GetRegionOperationHttpRequest; -import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionOperationName; -import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; -import com.google.cloud.compute.v1.RegionOperationSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -89,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java index 5c9e69a114f2..e57b7c5d9c3d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; @@ -36,14 +37,8 @@ import com.google.cloud.compute.v1.OperationList; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.ProjectRegionOperationName; -import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; -import com.google.cloud.compute.v1.RegionOperationSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -57,113 +52,150 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionOperationStub extends RegionOperationStub { @InternalApi - public static final ApiMethodDescriptor deleteRegionOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionOperations.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionOperationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations/{operation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionOperationName.newFactory()) - .setResourceNameField("operation") - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRegionOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionOperations.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionOperationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/operations/{operation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getRegionOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionOperations.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionOperationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations/{operation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionOperationName.newFactory()) - .setResourceNameField("operation") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getRegionOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionOperations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionOperationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/operations/{operation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionOperationsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regionOperations.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionOperationsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(OperationList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRegionOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionOperations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteRegionOperationCallable; private final UnaryCallable getRegionOperationCallable; - private final UnaryCallable listRegionOperationsCallable; - private final UnaryCallable listRegionOperationsPagedCallable; + private final UnaryCallable + listRegionOperationsCallable; + private final UnaryCallable + listRegionOperationsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonRegionOperationStub create(RegionOperationStubSettings settings) throws IOException { + + public static final HttpJsonRegionOperationStub create(RegionOperationStubSettings settings) + throws IOException { return new HttpJsonRegionOperationStub(settings, ClientContext.create(settings)); } - public static final HttpJsonRegionOperationStub create(ClientContext clientContext) throws IOException { - return new HttpJsonRegionOperationStub(RegionOperationStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonRegionOperationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionOperationStub( + RegionOperationStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionOperationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionOperationStub(RegionOperationStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionOperationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionOperationStub( + RegionOperationStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRegionOperationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionOperationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionOperationStub(RegionOperationStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionOperationStub( + RegionOperationStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonRegionOperationCallableFactory()); } /** - * Constructs an instance of HttpJsonRegionOperationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionOperationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonRegionOperationStub(RegionOperationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionOperationStub( + RegionOperationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteRegionOperationTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteRegionOperationMethodDescriptor) - .build(); - HttpJsonCallSettings getRegionOperationTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRegionOperationMethodDescriptor) - .build(); - HttpJsonCallSettings listRegionOperationsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRegionOperationsMethodDescriptor) - .build(); - - this.deleteRegionOperationCallable = callableFactory.createUnaryCallable(deleteRegionOperationTransportSettings,settings.deleteRegionOperationSettings(), clientContext); - this.getRegionOperationCallable = callableFactory.createUnaryCallable(getRegionOperationTransportSettings,settings.getRegionOperationSettings(), clientContext); - this.listRegionOperationsCallable = callableFactory.createUnaryCallable(listRegionOperationsTransportSettings,settings.listRegionOperationsSettings(), clientContext); - this.listRegionOperationsPagedCallable = callableFactory.createPagedCallable(listRegionOperationsTransportSettings,settings.listRegionOperationsSettings(), clientContext); + HttpJsonCallSettings + deleteRegionOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionOperationMethodDescriptor) + .build(); + HttpJsonCallSettings + getRegionOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionOperationMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionOperationsMethodDescriptor) + .build(); + + this.deleteRegionOperationCallable = + callableFactory.createUnaryCallable( + deleteRegionOperationTransportSettings, + settings.deleteRegionOperationSettings(), + clientContext); + this.getRegionOperationCallable = + callableFactory.createUnaryCallable( + getRegionOperationTransportSettings, + settings.getRegionOperationSettings(), + clientContext); + this.listRegionOperationsCallable = + callableFactory.createUnaryCallable( + listRegionOperationsTransportSettings, + settings.listRegionOperationsSettings(), + clientContext); + this.listRegionOperationsPagedCallable = + callableFactory.createPagedCallable( + listRegionOperationsTransportSettings, + settings.listRegionOperationsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -179,17 +211,19 @@ public UnaryCallable getRegionOperatio } @BetaApi - public UnaryCallable listRegionOperationsPagedCallable() { + public UnaryCallable + listRegionOperationsPagedCallable() { return listRegionOperationsPagedCallable; } @BetaApi - public UnaryCallable listRegionOperationsCallable() { + public UnaryCallable + listRegionOperationsCallable() { return listRegionOperationsCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -217,5 +251,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java index 791ac0368856..1537848a7a53 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.GetRegionHttpRequest; @@ -34,15 +35,9 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.Region; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; import com.google.cloud.compute.v1.RegionList; -import com.google.cloud.compute.v1.RegionSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,8 +59,7 @@ public class HttpJsonRegionStub extends RegionStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetRegionHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}")) - .setQueryParams(Sets.newHashSet( - )) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectRegionName.newFactory()) .setResourceNameField("region") .build()) @@ -74,33 +68,37 @@ public class HttpJsonRegionStub extends RegionStub { .setResponseInstance(Region.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor listRegionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.regions.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RegionList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRegionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regions.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable getRegionCallable; private final UnaryCallable listRegionsCallable; - private final UnaryCallable listRegionsPagedCallable; + private final UnaryCallable + listRegionsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRegionStub create(RegionStubSettings settings) throws IOException { return new HttpJsonRegionStub(settings, ClientContext.create(settings)); } @@ -109,25 +107,32 @@ public static final HttpJsonRegionStub create(ClientContext clientContext) throw return new HttpJsonRegionStub(RegionStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRegionStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRegionStub(RegionStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRegionStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionStub( + RegionStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRegionStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRegionStub(RegionStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRegionStub(RegionStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonRegionCallableFactory()); } /** - * Constructs an instance of HttpJsonRegionStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRegionStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRegionStub(RegionStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRegionStub( + RegionStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings getRegionTransportSettings = @@ -139,9 +144,15 @@ protected HttpJsonRegionStub(RegionStubSettings settings, ClientContext clientCo .setMethodDescriptor(listRegionsMethodDescriptor) .build(); - this.getRegionCallable = callableFactory.createUnaryCallable(getRegionTransportSettings,settings.getRegionSettings(), clientContext); - this.listRegionsCallable = callableFactory.createUnaryCallable(listRegionsTransportSettings,settings.listRegionsSettings(), clientContext); - this.listRegionsPagedCallable = callableFactory.createPagedCallable(listRegionsTransportSettings,settings.listRegionsSettings(), clientContext); + this.getRegionCallable = + callableFactory.createUnaryCallable( + getRegionTransportSettings, settings.getRegionSettings(), clientContext); + this.listRegionsCallable = + callableFactory.createUnaryCallable( + listRegionsTransportSettings, settings.listRegionsSettings(), clientContext); + this.listRegionsPagedCallable = + callableFactory.createPagedCallable( + listRegionsTransportSettings, settings.listRegionsSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -152,7 +163,8 @@ public UnaryCallable getRegionCallable() { } @BetaApi - public UnaryCallable listRegionsPagedCallable() { + public UnaryCallable + listRegionsPagedCallable() { return listRegionsPagedCallable; } @@ -162,7 +174,7 @@ public UnaryCallable listRegionsCallable() { } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -190,5 +202,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java index 01d1d5cbf69e..94668490f0fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java @@ -15,49 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteRouteHttpRequest; -import com.google.cloud.compute.v1.GetRouteHttpRequest; -import com.google.cloud.compute.v1.InsertRouteHttpRequest; -import com.google.cloud.compute.v1.ListRoutesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRouteName; -import com.google.cloud.compute.v1.Route; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; -import com.google.cloud.compute.v1.RouteList; -import com.google.cloud.compute.v1.RouteSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -74,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -91,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index 5dd1c0701fbd..14c3acb13d5e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteRouteHttpRequest; @@ -34,18 +35,12 @@ import com.google.cloud.compute.v1.InsertRouteHttpRequest; import com.google.cloud.compute.v1.ListRoutesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalRouteName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRouteName; import com.google.cloud.compute.v1.Route; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; import com.google.cloud.compute.v1.RouteList; -import com.google.cloud.compute.v1.RouteSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,25 +54,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRouteStub extends RouteStub { @InternalApi - public static final ApiMethodDescriptor deleteRouteMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRouteName.newFactory()) - .setResourceNameField("route") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) + .setResourceNameField("route") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getRouteMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -87,9 +82,8 @@ public class HttpJsonRouteStub extends RouteStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRouteName.newFactory()) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) .setResourceNameField("route") .build()) .setResponseParser( @@ -97,55 +91,59 @@ public class HttpJsonRouteStub extends RouteStub { .setResponseInstance(Route.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor insertRouteMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRouteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRoutesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routes.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/routes")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RouteList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRoutesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/routes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouteList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteRouteCallable; private final UnaryCallable getRouteCallable; private final UnaryCallable insertRouteCallable; private final UnaryCallable listRoutesCallable; - private final UnaryCallable listRoutesPagedCallable; + private final UnaryCallable + listRoutesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRouteStub create(RouteStubSettings settings) throws IOException { return new HttpJsonRouteStub(settings, ClientContext.create(settings)); } @@ -154,25 +152,32 @@ public static final HttpJsonRouteStub create(ClientContext clientContext) throws return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRouteStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRouteStub(RouteStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRouteStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouteStub( + RouteStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRouteStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRouteStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonRouteCallableFactory()); } /** - * Constructs an instance of HttpJsonRouteStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRouteStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRouteStub( + RouteStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteRouteTransportSettings = @@ -192,11 +197,21 @@ protected HttpJsonRouteStub(RouteStubSettings settings, ClientContext clientCont .setMethodDescriptor(listRoutesMethodDescriptor) .build(); - this.deleteRouteCallable = callableFactory.createUnaryCallable(deleteRouteTransportSettings,settings.deleteRouteSettings(), clientContext); - this.getRouteCallable = callableFactory.createUnaryCallable(getRouteTransportSettings,settings.getRouteSettings(), clientContext); - this.insertRouteCallable = callableFactory.createUnaryCallable(insertRouteTransportSettings,settings.insertRouteSettings(), clientContext); - this.listRoutesCallable = callableFactory.createUnaryCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); - this.listRoutesPagedCallable = callableFactory.createPagedCallable(listRoutesTransportSettings,settings.listRoutesSettings(), clientContext); + this.deleteRouteCallable = + callableFactory.createUnaryCallable( + deleteRouteTransportSettings, settings.deleteRouteSettings(), clientContext); + this.getRouteCallable = + callableFactory.createUnaryCallable( + getRouteTransportSettings, settings.getRouteSettings(), clientContext); + this.insertRouteCallable = + callableFactory.createUnaryCallable( + insertRouteTransportSettings, settings.insertRouteSettings(), clientContext); + this.listRoutesCallable = + callableFactory.createUnaryCallable( + listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); + this.listRoutesPagedCallable = + callableFactory.createPagedCallable( + listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -227,7 +242,7 @@ public UnaryCallable listRoutesCallable() { } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -255,5 +270,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java index b18b7cf98d4e..cbf9dd469b9c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java @@ -15,60 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; -import com.google.cloud.compute.v1.DeleteRouterHttpRequest; -import com.google.cloud.compute.v1.GetRouterHttpRequest; -import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; -import com.google.cloud.compute.v1.InsertRouterHttpRequest; -import com.google.cloud.compute.v1.ListRoutersHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchRouterHttpRequest; -import com.google.cloud.compute.v1.PreviewRouterHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionRouterName; -import com.google.cloud.compute.v1.Router; -import com.google.cloud.compute.v1.RouterAggregatedList; -import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; -import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; -import com.google.cloud.compute.v1.RouterList; -import com.google.cloud.compute.v1.RouterSettings; -import com.google.cloud.compute.v1.RouterStatusResponse; -import com.google.cloud.compute.v1.RoutersPreviewResponse; -import com.google.cloud.compute.v1.RoutersScopedList; -import com.google.cloud.compute.v1.UpdateRouterHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -85,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -102,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index 79c7ec9c3454..5f9a83655949 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; @@ -43,20 +45,12 @@ import com.google.cloud.compute.v1.ProjectRegionRouterName; import com.google.cloud.compute.v1.Router; import com.google.cloud.compute.v1.RouterAggregatedList; -import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; -import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.cloud.compute.v1.RouterList; -import com.google.cloud.compute.v1.RouterSettings; import com.google.cloud.compute.v1.RouterStatusResponse; import com.google.cloud.compute.v1.RoutersPreviewResponse; -import com.google.cloud.compute.v1.RoutersScopedList; import com.google.cloud.compute.v1.UpdateRouterHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -70,45 +64,47 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRouterStub extends RouterStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListRoutersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListRoutersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/routers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RouterAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + aggregatedListRoutersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListRoutersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/routers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouterAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteRouterMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionRouterName.newFactory()) - .setResourceNameField("router") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionRouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getRouterMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -117,9 +113,9 @@ public class HttpJsonRouterStub extends RouterStub { .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) - .setQueryParams(Sets.newHashSet( - )) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectRegionRouterName.newFactory()) .setResourceNameField("router") .build()) @@ -128,139 +124,155 @@ public class HttpJsonRouterStub extends RouterStub { .setResponseInstance(Router.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor getRouterStatusRouterMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.getRouterStatus") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouterStatusRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}/getRouterStatus")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionRouterName.newFactory()) - .setResourceNameField("router") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RouterStatusResponse.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getRouterStatusRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.getRouterStatus") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouterStatusRouterHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/routers/{router}/getRouterStatus")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionRouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouterStatusResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertRouterMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listRoutersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutersHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RouterList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listRoutersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutersHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RouterList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchRouterMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionRouterName.newFactory()) - .setResourceNameField("router") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionRouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor previewRouterMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.preview") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PreviewRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}/preview")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionRouterName.newFactory()) - .setResourceNameField("router") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(RoutersPreviewResponse.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + previewRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.preview") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PreviewRouterHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/routers/{router}/preview")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionRouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RoutersPreviewResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateRouterMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.routers.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers/{router}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionRouterName.newFactory()) - .setResourceNameField("router") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateRouterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.routers.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/routers/{router}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionRouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListRoutersCallable; - private final UnaryCallable aggregatedListRoutersPagedCallable; + private final UnaryCallable + aggregatedListRoutersCallable; + private final UnaryCallable + aggregatedListRoutersPagedCallable; private final UnaryCallable deleteRouterCallable; private final UnaryCallable getRouterCallable; - private final UnaryCallable getRouterStatusRouterCallable; + private final UnaryCallable + getRouterStatusRouterCallable; private final UnaryCallable insertRouterCallable; private final UnaryCallable listRoutersCallable; - private final UnaryCallable listRoutersPagedCallable; + private final UnaryCallable + listRoutersPagedCallable; private final UnaryCallable patchRouterCallable; - private final UnaryCallable previewRouterCallable; + private final UnaryCallable + previewRouterCallable; private final UnaryCallable updateRouterCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonRouterStub create(RouterStubSettings settings) throws IOException { return new HttpJsonRouterStub(settings, ClientContext.create(settings)); } @@ -269,31 +281,40 @@ public static final HttpJsonRouterStub create(ClientContext clientContext) throw return new HttpJsonRouterStub(RouterStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonRouterStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonRouterStub(RouterStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonRouterStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouterStub( + RouterStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonRouterStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRouterStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonRouterCallableFactory()); } /** - * Constructs an instance of HttpJsonRouterStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonRouterStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonRouterStub( + RouterStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListRoutersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListRoutersMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListRoutersTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListRoutersMethodDescriptor) + .build(); HttpJsonCallSettings deleteRouterTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteRouterMethodDescriptor) @@ -302,10 +323,12 @@ protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientCo HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getRouterMethodDescriptor) .build(); - HttpJsonCallSettings getRouterStatusRouterTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRouterStatusRouterMethodDescriptor) - .build(); + HttpJsonCallSettings + getRouterStatusRouterTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getRouterStatusRouterMethodDescriptor) + .build(); HttpJsonCallSettings insertRouterTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertRouterMethodDescriptor) @@ -318,37 +341,68 @@ protected HttpJsonRouterStub(RouterStubSettings settings, ClientContext clientCo HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchRouterMethodDescriptor) .build(); - HttpJsonCallSettings previewRouterTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(previewRouterMethodDescriptor) - .build(); + HttpJsonCallSettings + previewRouterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(previewRouterMethodDescriptor) + .build(); HttpJsonCallSettings updateRouterTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateRouterMethodDescriptor) .build(); - this.aggregatedListRoutersCallable = callableFactory.createUnaryCallable(aggregatedListRoutersTransportSettings,settings.aggregatedListRoutersSettings(), clientContext); - this.aggregatedListRoutersPagedCallable = callableFactory.createPagedCallable(aggregatedListRoutersTransportSettings,settings.aggregatedListRoutersSettings(), clientContext); - this.deleteRouterCallable = callableFactory.createUnaryCallable(deleteRouterTransportSettings,settings.deleteRouterSettings(), clientContext); - this.getRouterCallable = callableFactory.createUnaryCallable(getRouterTransportSettings,settings.getRouterSettings(), clientContext); - this.getRouterStatusRouterCallable = callableFactory.createUnaryCallable(getRouterStatusRouterTransportSettings,settings.getRouterStatusRouterSettings(), clientContext); - this.insertRouterCallable = callableFactory.createUnaryCallable(insertRouterTransportSettings,settings.insertRouterSettings(), clientContext); - this.listRoutersCallable = callableFactory.createUnaryCallable(listRoutersTransportSettings,settings.listRoutersSettings(), clientContext); - this.listRoutersPagedCallable = callableFactory.createPagedCallable(listRoutersTransportSettings,settings.listRoutersSettings(), clientContext); - this.patchRouterCallable = callableFactory.createUnaryCallable(patchRouterTransportSettings,settings.patchRouterSettings(), clientContext); - this.previewRouterCallable = callableFactory.createUnaryCallable(previewRouterTransportSettings,settings.previewRouterSettings(), clientContext); - this.updateRouterCallable = callableFactory.createUnaryCallable(updateRouterTransportSettings,settings.updateRouterSettings(), clientContext); + this.aggregatedListRoutersCallable = + callableFactory.createUnaryCallable( + aggregatedListRoutersTransportSettings, + settings.aggregatedListRoutersSettings(), + clientContext); + this.aggregatedListRoutersPagedCallable = + callableFactory.createPagedCallable( + aggregatedListRoutersTransportSettings, + settings.aggregatedListRoutersSettings(), + clientContext); + this.deleteRouterCallable = + callableFactory.createUnaryCallable( + deleteRouterTransportSettings, settings.deleteRouterSettings(), clientContext); + this.getRouterCallable = + callableFactory.createUnaryCallable( + getRouterTransportSettings, settings.getRouterSettings(), clientContext); + this.getRouterStatusRouterCallable = + callableFactory.createUnaryCallable( + getRouterStatusRouterTransportSettings, + settings.getRouterStatusRouterSettings(), + clientContext); + this.insertRouterCallable = + callableFactory.createUnaryCallable( + insertRouterTransportSettings, settings.insertRouterSettings(), clientContext); + this.listRoutersCallable = + callableFactory.createUnaryCallable( + listRoutersTransportSettings, settings.listRoutersSettings(), clientContext); + this.listRoutersPagedCallable = + callableFactory.createPagedCallable( + listRoutersTransportSettings, settings.listRoutersSettings(), clientContext); + this.patchRouterCallable = + callableFactory.createUnaryCallable( + patchRouterTransportSettings, settings.patchRouterSettings(), clientContext); + this.previewRouterCallable = + callableFactory.createUnaryCallable( + previewRouterTransportSettings, settings.previewRouterSettings(), clientContext); + this.updateRouterCallable = + callableFactory.createUnaryCallable( + updateRouterTransportSettings, settings.updateRouterSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListRoutersPagedCallable() { + public UnaryCallable + aggregatedListRoutersPagedCallable() { return aggregatedListRoutersPagedCallable; } @BetaApi - public UnaryCallable aggregatedListRoutersCallable() { + public UnaryCallable + aggregatedListRoutersCallable() { return aggregatedListRoutersCallable; } @@ -363,7 +417,8 @@ public UnaryCallable getRouterCallable() { } @BetaApi - public UnaryCallable getRouterStatusRouterCallable() { + public UnaryCallable + getRouterStatusRouterCallable() { return getRouterStatusRouterCallable; } @@ -373,7 +428,8 @@ public UnaryCallable insertRouterCallable() } @BetaApi - public UnaryCallable listRoutersPagedCallable() { + public UnaryCallable + listRoutersPagedCallable() { return listRoutersPagedCallable; } @@ -398,7 +454,7 @@ public UnaryCallable updateRouterCallable() } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -426,5 +482,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java index c982c2ffe9b1..599733850786 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java @@ -15,50 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; -import com.google.cloud.compute.v1.GetSnapshotHttpRequest; -import com.google.cloud.compute.v1.GlobalSetLabelsRequest; -import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSnapshotName; -import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; -import com.google.cloud.compute.v1.Snapshot; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; -import com.google.cloud.compute.v1.SnapshotList; -import com.google.cloud.compute.v1.SnapshotSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -75,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -92,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 78172a7893d7..4710f0842713 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,27 +28,20 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; -import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalSnapshotName; +import com.google.cloud.compute.v1.ProjectGlobalSnapshotResourceName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSnapshotName; import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; -import com.google.cloud.compute.v1.SnapshotSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -60,93 +55,100 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSnapshotStub extends SnapshotStub { @InternalApi - public static final ApiMethodDescriptor deleteSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.snapshots.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectSnapshotName.newFactory()) - .setResourceNameField("snapshot") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) + .setResourceNameField("snapshot") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.snapshots.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSnapshotHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectSnapshotName.newFactory()) - .setResourceNameField("snapshot") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Snapshot.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSnapshotHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) + .setResourceNameField("snapshot") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Snapshot.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listSnapshotsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.snapshots.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSnapshotsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/snapshots")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(SnapshotList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listSnapshotsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSnapshotsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/snapshots")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SnapshotList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setLabelsSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.snapshots.setLabels") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsSnapshotHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{resource}/setLabels")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectSnapshotName.newFactory()) - .setResourceNameField("resource") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setLabelsSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsSnapshotHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/snapshots/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSnapshotResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteSnapshotCallable; private final UnaryCallable getSnapshotCallable; private final UnaryCallable listSnapshotsCallable; - private final UnaryCallable listSnapshotsPagedCallable; + private final UnaryCallable + listSnapshotsPagedCallable; private final UnaryCallable setLabelsSnapshotCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonSnapshotStub create(SnapshotStubSettings settings) throws IOException { + + public static final HttpJsonSnapshotStub create(SnapshotStubSettings settings) + throws IOException { return new HttpJsonSnapshotStub(settings, ClientContext.create(settings)); } @@ -154,25 +156,32 @@ public static final HttpJsonSnapshotStub create(ClientContext clientContext) thr return new HttpJsonSnapshotStub(SnapshotStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonSnapshotStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSnapshotStub(SnapshotStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonSnapshotStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSnapshotStub( + SnapshotStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonSnapshotStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonSnapshotStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonSnapshotCallableFactory()); } /** - * Constructs an instance of HttpJsonSnapshotStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonSnapshotStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonSnapshotStub( + SnapshotStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteSnapshotTransportSettings = @@ -187,16 +196,29 @@ protected HttpJsonSnapshotStub(SnapshotStubSettings settings, ClientContext clie HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) .build(); - HttpJsonCallSettings setLabelsSnapshotTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setLabelsSnapshotMethodDescriptor) - .build(); + HttpJsonCallSettings + setLabelsSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsSnapshotMethodDescriptor) + .build(); - this.deleteSnapshotCallable = callableFactory.createUnaryCallable(deleteSnapshotTransportSettings,settings.deleteSnapshotSettings(), clientContext); - this.getSnapshotCallable = callableFactory.createUnaryCallable(getSnapshotTransportSettings,settings.getSnapshotSettings(), clientContext); - this.listSnapshotsCallable = callableFactory.createUnaryCallable(listSnapshotsTransportSettings,settings.listSnapshotsSettings(), clientContext); - this.listSnapshotsPagedCallable = callableFactory.createPagedCallable(listSnapshotsTransportSettings,settings.listSnapshotsSettings(), clientContext); - this.setLabelsSnapshotCallable = callableFactory.createUnaryCallable(setLabelsSnapshotTransportSettings,settings.setLabelsSnapshotSettings(), clientContext); + this.deleteSnapshotCallable = + callableFactory.createUnaryCallable( + deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); + this.getSnapshotCallable = + callableFactory.createUnaryCallable( + getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); + this.listSnapshotsCallable = + callableFactory.createUnaryCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.listSnapshotsPagedCallable = + callableFactory.createPagedCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.setLabelsSnapshotCallable = + callableFactory.createUnaryCallable( + setLabelsSnapshotTransportSettings, + settings.setLabelsSnapshotSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -212,7 +234,8 @@ public UnaryCallable getSnapshotCallable() { } @BetaApi - public UnaryCallable listSnapshotsPagedCallable() { + public UnaryCallable + listSnapshotsPagedCallable() { return listSnapshotsPagedCallable; } @@ -227,7 +250,7 @@ public UnaryCallable setLabelsSnapshotC } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -255,5 +278,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java index 4179672ce850..bfb27ab41f21 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java @@ -15,49 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; -import com.google.cloud.compute.v1.GetSslCertificateHttpRequest; -import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; -import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSslCertificateName; -import com.google.cloud.compute.v1.SslCertificate; -import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; -import com.google.cloud.compute.v1.SslCertificateList; -import com.google.cloud.compute.v1.SslCertificateSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -74,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -91,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java index 04d16fc1d370..66b74ae3f879 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; @@ -34,18 +35,12 @@ import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalSslCertificateName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSslCertificateName; import com.google.cloud.compute.v1.SslCertificate; -import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; import com.google.cloud.compute.v1.SslCertificateList; -import com.google.cloud.compute.v1.SslCertificateSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -59,144 +54,188 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSslCertificateStub extends SslCertificateStub { @InternalApi - public static final ApiMethodDescriptor deleteSslCertificateMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.sslCertificates.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectSslCertificateName.newFactory()) - .setResourceNameField("sslCertificate") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteSslCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalSslCertificateName.newFactory()) + .setResourceNameField("sslCertificate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getSslCertificateMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.sslCertificates.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSslCertificateHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectSslCertificateName.newFactory()) - .setResourceNameField("sslCertificate") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(SslCertificate.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getSslCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSslCertificateHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSslCertificateName.newFactory()) + .setResourceNameField("sslCertificate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SslCertificate.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertSslCertificateMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.sslCertificates.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertSslCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listSslCertificatesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.sslCertificates.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSslCertificatesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(SslCertificateList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listSslCertificatesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslCertificates.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSslCertificatesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SslCertificateList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteSslCertificateCallable; - private final UnaryCallable getSslCertificateCallable; - private final UnaryCallable insertSslCertificateCallable; - private final UnaryCallable listSslCertificatesCallable; - private final UnaryCallable listSslCertificatesPagedCallable; + private final UnaryCallable + deleteSslCertificateCallable; + private final UnaryCallable + getSslCertificateCallable; + private final UnaryCallable + insertSslCertificateCallable; + private final UnaryCallable + listSslCertificatesCallable; + private final UnaryCallable + listSslCertificatesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonSslCertificateStub create(SslCertificateStubSettings settings) throws IOException { + + public static final HttpJsonSslCertificateStub create(SslCertificateStubSettings settings) + throws IOException { return new HttpJsonSslCertificateStub(settings, ClientContext.create(settings)); } - public static final HttpJsonSslCertificateStub create(ClientContext clientContext) throws IOException { - return new HttpJsonSslCertificateStub(SslCertificateStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonSslCertificateStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSslCertificateStub( + SslCertificateStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonSslCertificateStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSslCertificateStub(SslCertificateStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonSslCertificateStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSslCertificateStub( + SslCertificateStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonSslCertificateStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonSslCertificateStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonSslCertificateStub(SslCertificateStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonSslCertificateStub( + SslCertificateStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonSslCertificateCallableFactory()); } /** - * Constructs an instance of HttpJsonSslCertificateStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonSslCertificateStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonSslCertificateStub(SslCertificateStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonSslCertificateStub( + SslCertificateStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteSslCertificateTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSslCertificateMethodDescriptor) - .build(); - HttpJsonCallSettings getSslCertificateTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSslCertificateMethodDescriptor) - .build(); - HttpJsonCallSettings insertSslCertificateTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertSslCertificateMethodDescriptor) - .build(); - HttpJsonCallSettings listSslCertificatesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSslCertificatesMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteSslCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSslCertificateMethodDescriptor) + .build(); + HttpJsonCallSettings + getSslCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSslCertificateMethodDescriptor) + .build(); + HttpJsonCallSettings + insertSslCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertSslCertificateMethodDescriptor) + .build(); + HttpJsonCallSettings + listSslCertificatesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSslCertificatesMethodDescriptor) + .build(); - this.deleteSslCertificateCallable = callableFactory.createUnaryCallable(deleteSslCertificateTransportSettings,settings.deleteSslCertificateSettings(), clientContext); - this.getSslCertificateCallable = callableFactory.createUnaryCallable(getSslCertificateTransportSettings,settings.getSslCertificateSettings(), clientContext); - this.insertSslCertificateCallable = callableFactory.createUnaryCallable(insertSslCertificateTransportSettings,settings.insertSslCertificateSettings(), clientContext); - this.listSslCertificatesCallable = callableFactory.createUnaryCallable(listSslCertificatesTransportSettings,settings.listSslCertificatesSettings(), clientContext); - this.listSslCertificatesPagedCallable = callableFactory.createPagedCallable(listSslCertificatesTransportSettings,settings.listSslCertificatesSettings(), clientContext); + this.deleteSslCertificateCallable = + callableFactory.createUnaryCallable( + deleteSslCertificateTransportSettings, + settings.deleteSslCertificateSettings(), + clientContext); + this.getSslCertificateCallable = + callableFactory.createUnaryCallable( + getSslCertificateTransportSettings, + settings.getSslCertificateSettings(), + clientContext); + this.insertSslCertificateCallable = + callableFactory.createUnaryCallable( + insertSslCertificateTransportSettings, + settings.insertSslCertificateSettings(), + clientContext); + this.listSslCertificatesCallable = + callableFactory.createUnaryCallable( + listSslCertificatesTransportSettings, + settings.listSslCertificatesSettings(), + clientContext); + this.listSslCertificatesPagedCallable = + callableFactory.createPagedCallable( + listSslCertificatesTransportSettings, + settings.listSslCertificatesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -217,17 +256,19 @@ public UnaryCallable insertSslCertif } @BetaApi - public UnaryCallable listSslCertificatesPagedCallable() { + public UnaryCallable + listSslCertificatesPagedCallable() { return listSslCertificatesPagedCallable; } @BetaApi - public UnaryCallable listSslCertificatesCallable() { + public UnaryCallable + listSslCertificatesCallable() { return listSslCertificatesCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -255,5 +296,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java new file mode 100644 index 000000000000..063476eb4041 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java @@ -0,0 +1,65 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonSslPolicyCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java new file mode 100644 index 000000000000..6572c724528d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java @@ -0,0 +1,370 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.SslPolicyClient.ListSslPoliciesPagedResponse; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DeleteSslPolicyHttpRequest; +import com.google.cloud.compute.v1.GetSslPolicyHttpRequest; +import com.google.cloud.compute.v1.InsertSslPolicyHttpRequest; +import com.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesHttpRequest; +import com.google.cloud.compute.v1.ListSslPoliciesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSslPolicyHttpRequest; +import com.google.cloud.compute.v1.ProjectGlobalSslPolicyName; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SslPoliciesList; +import com.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; +import com.google.cloud.compute.v1.SslPolicy; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonSslPolicyStub extends SslPolicyStub { + @InternalApi + public static final ApiMethodDescriptor + deleteSslPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslPolicies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSslPolicyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalSslPolicyName.newFactory()) + .setResourceNameField("sslPolicy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + getSslPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslPolicies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSslPolicyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSslPolicyName.newFactory()) + .setResourceNameField("sslPolicy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SslPolicy.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + insertSslPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslPolicies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSslPolicyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listSslPoliciesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslPolicies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSslPoliciesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SslPoliciesList.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.sslPolicies.listAvailableFeatures") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ListAvailableFeaturesSslPoliciesHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/sslPolicies/listAvailableFeatures")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser + .newBuilder() + .setResponseInstance( + SslPoliciesListAvailableFeaturesResponse.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + patchSslPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.sslPolicies.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchSslPolicyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalSslPolicyName.newFactory()) + .setResourceNameField("sslPolicy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteSslPolicyCallable; + private final UnaryCallable getSslPolicyCallable; + private final UnaryCallable insertSslPolicyCallable; + private final UnaryCallable listSslPoliciesCallable; + private final UnaryCallable + listSslPoliciesPagedCallable; + private final UnaryCallable< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesCallable; + private final UnaryCallable patchSslPolicyCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSslPolicyStub create(SslPolicyStubSettings settings) + throws IOException { + return new HttpJsonSslPolicyStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSslPolicyStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSslPolicyStub(SslPolicyStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonSslPolicyStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSslPolicyStub( + SslPolicyStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSslPolicyStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonSslPolicyStub(SslPolicyStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonSslPolicyCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSslPolicyStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonSslPolicyStub( + SslPolicyStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteSslPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSslPolicyMethodDescriptor) + .build(); + HttpJsonCallSettings getSslPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSslPolicyMethodDescriptor) + .build(); + HttpJsonCallSettings insertSslPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertSslPolicyMethodDescriptor) + .build(); + HttpJsonCallSettings + listSslPoliciesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSslPoliciesMethodDescriptor) + .build(); + HttpJsonCallSettings< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listAvailableFeaturesSslPoliciesMethodDescriptor) + .build(); + HttpJsonCallSettings patchSslPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchSslPolicyMethodDescriptor) + .build(); + + this.deleteSslPolicyCallable = + callableFactory.createUnaryCallable( + deleteSslPolicyTransportSettings, settings.deleteSslPolicySettings(), clientContext); + this.getSslPolicyCallable = + callableFactory.createUnaryCallable( + getSslPolicyTransportSettings, settings.getSslPolicySettings(), clientContext); + this.insertSslPolicyCallable = + callableFactory.createUnaryCallable( + insertSslPolicyTransportSettings, settings.insertSslPolicySettings(), clientContext); + this.listSslPoliciesCallable = + callableFactory.createUnaryCallable( + listSslPoliciesTransportSettings, settings.listSslPoliciesSettings(), clientContext); + this.listSslPoliciesPagedCallable = + callableFactory.createPagedCallable( + listSslPoliciesTransportSettings, settings.listSslPoliciesSettings(), clientContext); + this.listAvailableFeaturesSslPoliciesCallable = + callableFactory.createUnaryCallable( + listAvailableFeaturesSslPoliciesTransportSettings, + settings.listAvailableFeaturesSslPoliciesSettings(), + clientContext); + this.patchSslPolicyCallable = + callableFactory.createUnaryCallable( + patchSslPolicyTransportSettings, settings.patchSslPolicySettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable deleteSslPolicyCallable() { + return deleteSslPolicyCallable; + } + + @BetaApi + public UnaryCallable getSslPolicyCallable() { + return getSslPolicyCallable; + } + + @BetaApi + public UnaryCallable insertSslPolicyCallable() { + return insertSslPolicyCallable; + } + + @BetaApi + public UnaryCallable + listSslPoliciesPagedCallable() { + return listSslPoliciesPagedCallable; + } + + @BetaApi + public UnaryCallable listSslPoliciesCallable() { + return listSslPoliciesCallable; + } + + @BetaApi + public UnaryCallable< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesCallable() { + return listAvailableFeaturesSslPoliciesCallable; + } + + @BetaApi + public UnaryCallable patchSslPolicyCallable() { + return patchSslPolicyCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java index bc4579f92d2c..40a484f46174 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java @@ -15,59 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; -import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; -import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; -import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; -import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; -import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionSubnetworkName; -import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; -import com.google.cloud.compute.v1.Subnetwork; -import com.google.cloud.compute.v1.SubnetworkAggregatedList; -import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; -import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; -import com.google.cloud.compute.v1.SubnetworkList; -import com.google.cloud.compute.v1.SubnetworkSettings; -import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; -import com.google.cloud.compute.v1.SubnetworksScopedList; -import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -84,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -101,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index 32ec4d01710e..30262a71437d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; @@ -43,19 +45,9 @@ import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; -import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; -import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; import com.google.cloud.compute.v1.SubnetworkList; -import com.google.cloud.compute.v1.SubnetworkSettings; -import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; -import com.google.cloud.compute.v1.SubnetworksScopedList; -import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -69,219 +61,259 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSubnetworkStub extends SubnetworkStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListSubnetworksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListSubnetworksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/subnetworks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(SubnetworkAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList> + aggregatedListSubnetworksMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.subnetworks.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListSubnetworksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/subnetworks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SubnetworkAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteSubnetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) - .setResourceNameField("subnetwork") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{subnetwork}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor expandIpCidrRangeSubnetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.expandIpCidrRange") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) - .setResourceNameField("subnetwork") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + expandIpCidrRangeSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.expandIpCidrRange") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getSubnetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSubnetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) - .setResourceNameField("subnetwork") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Subnetwork.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{subnetwork}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Subnetwork.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertSubnetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/subnetworks")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listSubnetworksMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSubnetworksHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(SubnetworkList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listSubnetworksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSubnetworksHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/subnetworks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(SubnetworkList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchSubnetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchSubnetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) - .setResourceNameField("subnetwork") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{subnetwork}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setPrivateIpGoogleAccessSubnetworkMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.subnetworks.setPrivateIpGoogleAccess") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) - .setResourceNameField("subnetwork") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setPrivateIpGoogleAccessSubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.setPrivateIpGoogleAccess") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionSubnetworkName.newFactory()) + .setResourceNameField("subnetwork") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListSubnetworksCallable; - private final UnaryCallable aggregatedListSubnetworksPagedCallable; + private final UnaryCallable + aggregatedListSubnetworksCallable; + private final UnaryCallable< + AggregatedListSubnetworksHttpRequest, AggregatedListSubnetworksPagedResponse> + aggregatedListSubnetworksPagedCallable; private final UnaryCallable deleteSubnetworkCallable; - private final UnaryCallable expandIpCidrRangeSubnetworkCallable; + private final UnaryCallable + expandIpCidrRangeSubnetworkCallable; private final UnaryCallable getSubnetworkCallable; private final UnaryCallable insertSubnetworkCallable; private final UnaryCallable listSubnetworksCallable; - private final UnaryCallable listSubnetworksPagedCallable; + private final UnaryCallable + listSubnetworksPagedCallable; private final UnaryCallable patchSubnetworkCallable; - private final UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable; + private final UnaryCallable + setPrivateIpGoogleAccessSubnetworkCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonSubnetworkStub create(SubnetworkStubSettings settings) throws IOException { + + public static final HttpJsonSubnetworkStub create(SubnetworkStubSettings settings) + throws IOException { return new HttpJsonSubnetworkStub(settings, ClientContext.create(settings)); } - public static final HttpJsonSubnetworkStub create(ClientContext clientContext) throws IOException { + public static final HttpJsonSubnetworkStub create(ClientContext clientContext) + throws IOException { return new HttpJsonSubnetworkStub(SubnetworkStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonSubnetworkStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSubnetworkStub(SubnetworkStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonSubnetworkStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSubnetworkStub( + SubnetworkStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonSubnetworkStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonSubnetworkStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonSubnetworkCallableFactory()); } /** - * Constructs an instance of HttpJsonSubnetworkStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonSubnetworkStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonSubnetworkStub( + SubnetworkStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListSubnetworksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListSubnetworksMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListSubnetworksTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListSubnetworksMethodDescriptor) + .build(); HttpJsonCallSettings deleteSubnetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteSubnetworkMethodDescriptor) .build(); - HttpJsonCallSettings expandIpCidrRangeSubnetworkTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(expandIpCidrRangeSubnetworkMethodDescriptor) - .build(); + HttpJsonCallSettings + expandIpCidrRangeSubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandIpCidrRangeSubnetworkMethodDescriptor) + .build(); HttpJsonCallSettings getSubnetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getSubnetworkMethodDescriptor) @@ -290,40 +322,73 @@ protected HttpJsonSubnetworkStub(SubnetworkStubSettings settings, ClientContext HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertSubnetworkMethodDescriptor) .build(); - HttpJsonCallSettings listSubnetworksTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSubnetworksMethodDescriptor) - .build(); + HttpJsonCallSettings + listSubnetworksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSubnetworksMethodDescriptor) + .build(); HttpJsonCallSettings patchSubnetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchSubnetworkMethodDescriptor) .build(); - HttpJsonCallSettings setPrivateIpGoogleAccessSubnetworkTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setPrivateIpGoogleAccessSubnetworkMethodDescriptor) - .build(); + HttpJsonCallSettings + setPrivateIpGoogleAccessSubnetworkTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setPrivateIpGoogleAccessSubnetworkMethodDescriptor) + .build(); - this.aggregatedListSubnetworksCallable = callableFactory.createUnaryCallable(aggregatedListSubnetworksTransportSettings,settings.aggregatedListSubnetworksSettings(), clientContext); - this.aggregatedListSubnetworksPagedCallable = callableFactory.createPagedCallable(aggregatedListSubnetworksTransportSettings,settings.aggregatedListSubnetworksSettings(), clientContext); - this.deleteSubnetworkCallable = callableFactory.createUnaryCallable(deleteSubnetworkTransportSettings,settings.deleteSubnetworkSettings(), clientContext); - this.expandIpCidrRangeSubnetworkCallable = callableFactory.createUnaryCallable(expandIpCidrRangeSubnetworkTransportSettings,settings.expandIpCidrRangeSubnetworkSettings(), clientContext); - this.getSubnetworkCallable = callableFactory.createUnaryCallable(getSubnetworkTransportSettings,settings.getSubnetworkSettings(), clientContext); - this.insertSubnetworkCallable = callableFactory.createUnaryCallable(insertSubnetworkTransportSettings,settings.insertSubnetworkSettings(), clientContext); - this.listSubnetworksCallable = callableFactory.createUnaryCallable(listSubnetworksTransportSettings,settings.listSubnetworksSettings(), clientContext); - this.listSubnetworksPagedCallable = callableFactory.createPagedCallable(listSubnetworksTransportSettings,settings.listSubnetworksSettings(), clientContext); - this.patchSubnetworkCallable = callableFactory.createUnaryCallable(patchSubnetworkTransportSettings,settings.patchSubnetworkSettings(), clientContext); - this.setPrivateIpGoogleAccessSubnetworkCallable = callableFactory.createUnaryCallable(setPrivateIpGoogleAccessSubnetworkTransportSettings,settings.setPrivateIpGoogleAccessSubnetworkSettings(), clientContext); + this.aggregatedListSubnetworksCallable = + callableFactory.createUnaryCallable( + aggregatedListSubnetworksTransportSettings, + settings.aggregatedListSubnetworksSettings(), + clientContext); + this.aggregatedListSubnetworksPagedCallable = + callableFactory.createPagedCallable( + aggregatedListSubnetworksTransportSettings, + settings.aggregatedListSubnetworksSettings(), + clientContext); + this.deleteSubnetworkCallable = + callableFactory.createUnaryCallable( + deleteSubnetworkTransportSettings, settings.deleteSubnetworkSettings(), clientContext); + this.expandIpCidrRangeSubnetworkCallable = + callableFactory.createUnaryCallable( + expandIpCidrRangeSubnetworkTransportSettings, + settings.expandIpCidrRangeSubnetworkSettings(), + clientContext); + this.getSubnetworkCallable = + callableFactory.createUnaryCallable( + getSubnetworkTransportSettings, settings.getSubnetworkSettings(), clientContext); + this.insertSubnetworkCallable = + callableFactory.createUnaryCallable( + insertSubnetworkTransportSettings, settings.insertSubnetworkSettings(), clientContext); + this.listSubnetworksCallable = + callableFactory.createUnaryCallable( + listSubnetworksTransportSettings, settings.listSubnetworksSettings(), clientContext); + this.listSubnetworksPagedCallable = + callableFactory.createPagedCallable( + listSubnetworksTransportSettings, settings.listSubnetworksSettings(), clientContext); + this.patchSubnetworkCallable = + callableFactory.createUnaryCallable( + patchSubnetworkTransportSettings, settings.patchSubnetworkSettings(), clientContext); + this.setPrivateIpGoogleAccessSubnetworkCallable = + callableFactory.createUnaryCallable( + setPrivateIpGoogleAccessSubnetworkTransportSettings, + settings.setPrivateIpGoogleAccessSubnetworkSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListSubnetworksPagedCallable() { + public UnaryCallable + aggregatedListSubnetworksPagedCallable() { return aggregatedListSubnetworksPagedCallable; } @BetaApi - public UnaryCallable aggregatedListSubnetworksCallable() { + public UnaryCallable + aggregatedListSubnetworksCallable() { return aggregatedListSubnetworksCallable; } @@ -333,7 +398,8 @@ public UnaryCallable deleteSubnetworkCal } @BetaApi - public UnaryCallable expandIpCidrRangeSubnetworkCallable() { + public UnaryCallable + expandIpCidrRangeSubnetworkCallable() { return expandIpCidrRangeSubnetworkCallable; } @@ -348,7 +414,8 @@ public UnaryCallable insertSubnetworkCal } @BetaApi - public UnaryCallable listSubnetworksPagedCallable() { + public UnaryCallable + listSubnetworksPagedCallable() { return listSubnetworksPagedCallable; } @@ -363,12 +430,13 @@ public UnaryCallable patchSubnetworkCalla } @BetaApi - public UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { + public UnaryCallable + setPrivateIpGoogleAccessSubnetworkCallable() { return setPrivateIpGoogleAccessSubnetworkCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -396,5 +464,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java index 5914152fbb5a..c6b45356542b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java @@ -15,51 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; -import com.google.cloud.compute.v1.GetTargetHttpProxyHttpRequest; -import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; -import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetHttpProxyName; -import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; -import com.google.cloud.compute.v1.TargetHttpProxy; -import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; -import com.google.cloud.compute.v1.TargetHttpProxyList; -import com.google.cloud.compute.v1.TargetHttpProxySettings; -import com.google.cloud.compute.v1.UrlMapReference; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -76,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -93,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java index 7134ad75e01d..00ee8eb60eae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; @@ -34,20 +35,14 @@ import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalTargetHttpProxyName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectTargetHttpProxyName; import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.TargetHttpProxy; -import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; import com.google.cloud.compute.v1.TargetHttpProxyList; -import com.google.cloud.compute.v1.TargetHttpProxySettings; -import com.google.cloud.compute.v1.UrlMapReference; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -61,206 +56,266 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { @InternalApi - public static final ApiMethodDescriptor deleteTargetHttpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpProxies.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies/{targetHttpProxy}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory()) - .setResourceNameField("targetHttpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetHttpProxies/{targetHttpProxy}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetHttpProxyName.newFactory()) + .setResourceNameField("targetHttpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetHttpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpProxies.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetHttpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies/{targetHttpProxy}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory()) - .setResourceNameField("targetHttpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetHttpProxy.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetHttpProxies/{targetHttpProxy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalTargetHttpProxyName.newFactory()) + .setResourceNameField("targetHttpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetHttpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpProxies.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetHttpProxiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpProxies.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetHttpProxiesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetHttpProxyList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetHttpProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetHttpProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setUrlMapTargetHttpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpProxies.setUrlMap") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory()) - .setResourceNameField("targetHttpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setUrlMapTargetHttpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpProxies.setUrlMap") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectTargetHttpProxyName.newFactory()) + .setResourceNameField("targetHttpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteTargetHttpProxyCallable; - private final UnaryCallable getTargetHttpProxyCallable; - private final UnaryCallable insertTargetHttpProxyCallable; - private final UnaryCallable listTargetHttpProxiesCallable; - private final UnaryCallable listTargetHttpProxiesPagedCallable; - private final UnaryCallable setUrlMapTargetHttpProxyCallable; + private final UnaryCallable + deleteTargetHttpProxyCallable; + private final UnaryCallable + getTargetHttpProxyCallable; + private final UnaryCallable + insertTargetHttpProxyCallable; + private final UnaryCallable + listTargetHttpProxiesCallable; + private final UnaryCallable + listTargetHttpProxiesPagedCallable; + private final UnaryCallable + setUrlMapTargetHttpProxyCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetHttpProxyStub create(TargetHttpProxyStubSettings settings) throws IOException { + + public static final HttpJsonTargetHttpProxyStub create(TargetHttpProxyStubSettings settings) + throws IOException { return new HttpJsonTargetHttpProxyStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetHttpProxyStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetHttpProxyStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetHttpProxyStub( + TargetHttpProxyStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetHttpProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetHttpProxyStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetHttpProxyStub( + TargetHttpProxyStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetHttpProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetHttpProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetHttpProxyStub( + TargetHttpProxyStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetHttpProxyCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetHttpProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetHttpProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetHttpProxyStub(TargetHttpProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetHttpProxyStub( + TargetHttpProxyStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteTargetHttpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetHttpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetHttpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetHttpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetHttpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetHttpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetHttpProxiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetHttpProxiesMethodDescriptor) - .build(); - HttpJsonCallSettings setUrlMapTargetHttpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setUrlMapTargetHttpProxyMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetHttpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetHttpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetHttpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetHttpProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetHttpProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings + setUrlMapTargetHttpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUrlMapTargetHttpProxyMethodDescriptor) + .build(); - this.deleteTargetHttpProxyCallable = callableFactory.createUnaryCallable(deleteTargetHttpProxyTransportSettings,settings.deleteTargetHttpProxySettings(), clientContext); - this.getTargetHttpProxyCallable = callableFactory.createUnaryCallable(getTargetHttpProxyTransportSettings,settings.getTargetHttpProxySettings(), clientContext); - this.insertTargetHttpProxyCallable = callableFactory.createUnaryCallable(insertTargetHttpProxyTransportSettings,settings.insertTargetHttpProxySettings(), clientContext); - this.listTargetHttpProxiesCallable = callableFactory.createUnaryCallable(listTargetHttpProxiesTransportSettings,settings.listTargetHttpProxiesSettings(), clientContext); - this.listTargetHttpProxiesPagedCallable = callableFactory.createPagedCallable(listTargetHttpProxiesTransportSettings,settings.listTargetHttpProxiesSettings(), clientContext); - this.setUrlMapTargetHttpProxyCallable = callableFactory.createUnaryCallable(setUrlMapTargetHttpProxyTransportSettings,settings.setUrlMapTargetHttpProxySettings(), clientContext); + this.deleteTargetHttpProxyCallable = + callableFactory.createUnaryCallable( + deleteTargetHttpProxyTransportSettings, + settings.deleteTargetHttpProxySettings(), + clientContext); + this.getTargetHttpProxyCallable = + callableFactory.createUnaryCallable( + getTargetHttpProxyTransportSettings, + settings.getTargetHttpProxySettings(), + clientContext); + this.insertTargetHttpProxyCallable = + callableFactory.createUnaryCallable( + insertTargetHttpProxyTransportSettings, + settings.insertTargetHttpProxySettings(), + clientContext); + this.listTargetHttpProxiesCallable = + callableFactory.createUnaryCallable( + listTargetHttpProxiesTransportSettings, + settings.listTargetHttpProxiesSettings(), + clientContext); + this.listTargetHttpProxiesPagedCallable = + callableFactory.createPagedCallable( + listTargetHttpProxiesTransportSettings, + settings.listTargetHttpProxiesSettings(), + clientContext); + this.setUrlMapTargetHttpProxyCallable = + callableFactory.createUnaryCallable( + setUrlMapTargetHttpProxyTransportSettings, + settings.setUrlMapTargetHttpProxySettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteTargetHttpProxyCallable() { + public UnaryCallable + deleteTargetHttpProxyCallable() { return deleteTargetHttpProxyCallable; } @BetaApi - public UnaryCallable getTargetHttpProxyCallable() { + public UnaryCallable + getTargetHttpProxyCallable() { return getTargetHttpProxyCallable; } @BetaApi - public UnaryCallable insertTargetHttpProxyCallable() { + public UnaryCallable + insertTargetHttpProxyCallable() { return insertTargetHttpProxyCallable; } @BetaApi - public UnaryCallable listTargetHttpProxiesPagedCallable() { + public UnaryCallable + listTargetHttpProxiesPagedCallable() { return listTargetHttpProxiesPagedCallable; } @BetaApi - public UnaryCallable listTargetHttpProxiesCallable() { + public UnaryCallable + listTargetHttpProxiesCallable() { return listTargetHttpProxiesCallable; } @BetaApi - public UnaryCallable setUrlMapTargetHttpProxyCallable() { + public UnaryCallable + setUrlMapTargetHttpProxyCallable() { return setUrlMapTargetHttpProxyCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -288,5 +343,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java index e3f538e6d3b9..7a16b8de939d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java @@ -15,53 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.GetTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName; -import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; -import com.google.cloud.compute.v1.TargetHttpsProxy; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; -import com.google.cloud.compute.v1.TargetHttpsProxyList; -import com.google.cloud.compute.v1.TargetHttpsProxySettings; -import com.google.cloud.compute.v1.UrlMapReference; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -78,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -95,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index 257ed3feb370..1a52d1443d6f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; @@ -34,22 +35,16 @@ import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalTargetHttpsProxyName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName; import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; import com.google.cloud.compute.v1.TargetHttpsProxy; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; import com.google.cloud.compute.v1.TargetHttpsProxyList; -import com.google.cloud.compute.v1.TargetHttpsProxySettings; -import com.google.cloud.compute.v1.UrlMapReference; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -63,237 +58,353 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { @InternalApi - public static final ApiMethodDescriptor deleteTargetHttpsProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpsProxies.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies/{targetHttpsProxy}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory()) - .setResourceNameField("targetHttpsProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetHttpsProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpsProxies.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetHttpsProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies/{targetHttpsProxy}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory()) - .setResourceNameField("targetHttpsProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetHttpsProxy.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalTargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpsProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetHttpsProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpsProxies.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetHttpsProxiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpsProxies.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetHttpsProxyList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetHttpsProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetHttpsProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setSslCertificatesTargetHttpsProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpsProxies.setSslCertificates") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory()) - .setResourceNameField("targetHttpsProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setSslCertificatesTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.setSslCertificates") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setUrlMapTargetHttpsProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetHttpsProxies.setUrlMap") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory()) - .setResourceNameField("targetHttpsProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setSslPolicyTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.setSslPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetSslPolicyTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + setUrlMapTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.setUrlMap") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectTargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteTargetHttpsProxyCallable; - private final UnaryCallable getTargetHttpsProxyCallable; - private final UnaryCallable insertTargetHttpsProxyCallable; - private final UnaryCallable listTargetHttpsProxiesCallable; - private final UnaryCallable listTargetHttpsProxiesPagedCallable; - private final UnaryCallable setSslCertificatesTargetHttpsProxyCallable; - private final UnaryCallable setUrlMapTargetHttpsProxyCallable; + private final UnaryCallable + deleteTargetHttpsProxyCallable; + private final UnaryCallable + getTargetHttpsProxyCallable; + private final UnaryCallable + insertTargetHttpsProxyCallable; + private final UnaryCallable + listTargetHttpsProxiesCallable; + private final UnaryCallable< + ListTargetHttpsProxiesHttpRequest, ListTargetHttpsProxiesPagedResponse> + listTargetHttpsProxiesPagedCallable; + private final UnaryCallable + setSslCertificatesTargetHttpsProxyCallable; + private final UnaryCallable + setSslPolicyTargetHttpsProxyCallable; + private final UnaryCallable + setUrlMapTargetHttpsProxyCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetHttpsProxyStub create(TargetHttpsProxyStubSettings settings) throws IOException { + + public static final HttpJsonTargetHttpsProxyStub create(TargetHttpsProxyStubSettings settings) + throws IOException { return new HttpJsonTargetHttpsProxyStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetHttpsProxyStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetHttpsProxyStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetHttpsProxyStub( + TargetHttpsProxyStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetHttpsProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetHttpsProxyStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetHttpsProxyStub( + TargetHttpsProxyStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetHttpsProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetHttpsProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetHttpsProxyStub( + TargetHttpsProxyStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetHttpsProxyCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetHttpsProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetHttpsProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetHttpsProxyStub(TargetHttpsProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetHttpsProxyStub( + TargetHttpsProxyStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteTargetHttpsProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetHttpsProxyMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetHttpsProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetHttpsProxyMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetHttpsProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetHttpsProxyMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetHttpsProxiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetHttpsProxiesMethodDescriptor) - .build(); - HttpJsonCallSettings setSslCertificatesTargetHttpsProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setSslCertificatesTargetHttpsProxyMethodDescriptor) - .build(); - HttpJsonCallSettings setUrlMapTargetHttpsProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setUrlMapTargetHttpsProxyMethodDescriptor) - .build(); - - this.deleteTargetHttpsProxyCallable = callableFactory.createUnaryCallable(deleteTargetHttpsProxyTransportSettings,settings.deleteTargetHttpsProxySettings(), clientContext); - this.getTargetHttpsProxyCallable = callableFactory.createUnaryCallable(getTargetHttpsProxyTransportSettings,settings.getTargetHttpsProxySettings(), clientContext); - this.insertTargetHttpsProxyCallable = callableFactory.createUnaryCallable(insertTargetHttpsProxyTransportSettings,settings.insertTargetHttpsProxySettings(), clientContext); - this.listTargetHttpsProxiesCallable = callableFactory.createUnaryCallable(listTargetHttpsProxiesTransportSettings,settings.listTargetHttpsProxiesSettings(), clientContext); - this.listTargetHttpsProxiesPagedCallable = callableFactory.createPagedCallable(listTargetHttpsProxiesTransportSettings,settings.listTargetHttpsProxiesSettings(), clientContext); - this.setSslCertificatesTargetHttpsProxyCallable = callableFactory.createUnaryCallable(setSslCertificatesTargetHttpsProxyTransportSettings,settings.setSslCertificatesTargetHttpsProxySettings(), clientContext); - this.setUrlMapTargetHttpsProxyCallable = callableFactory.createUnaryCallable(setUrlMapTargetHttpsProxyTransportSettings,settings.setUrlMapTargetHttpsProxySettings(), clientContext); + HttpJsonCallSettings + deleteTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetHttpsProxiesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listTargetHttpsProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings + setSslCertificatesTargetHttpsProxyTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setSslCertificatesTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setSslPolicyTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSslPolicyTargetHttpsProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setUrlMapTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUrlMapTargetHttpsProxyMethodDescriptor) + .build(); + + this.deleteTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + deleteTargetHttpsProxyTransportSettings, + settings.deleteTargetHttpsProxySettings(), + clientContext); + this.getTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + getTargetHttpsProxyTransportSettings, + settings.getTargetHttpsProxySettings(), + clientContext); + this.insertTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + insertTargetHttpsProxyTransportSettings, + settings.insertTargetHttpsProxySettings(), + clientContext); + this.listTargetHttpsProxiesCallable = + callableFactory.createUnaryCallable( + listTargetHttpsProxiesTransportSettings, + settings.listTargetHttpsProxiesSettings(), + clientContext); + this.listTargetHttpsProxiesPagedCallable = + callableFactory.createPagedCallable( + listTargetHttpsProxiesTransportSettings, + settings.listTargetHttpsProxiesSettings(), + clientContext); + this.setSslCertificatesTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + setSslCertificatesTargetHttpsProxyTransportSettings, + settings.setSslCertificatesTargetHttpsProxySettings(), + clientContext); + this.setSslPolicyTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + setSslPolicyTargetHttpsProxyTransportSettings, + settings.setSslPolicyTargetHttpsProxySettings(), + clientContext); + this.setUrlMapTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + setUrlMapTargetHttpsProxyTransportSettings, + settings.setUrlMapTargetHttpsProxySettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable deleteTargetHttpsProxyCallable() { + public UnaryCallable + deleteTargetHttpsProxyCallable() { return deleteTargetHttpsProxyCallable; } @BetaApi - public UnaryCallable getTargetHttpsProxyCallable() { + public UnaryCallable + getTargetHttpsProxyCallable() { return getTargetHttpsProxyCallable; } @BetaApi - public UnaryCallable insertTargetHttpsProxyCallable() { + public UnaryCallable + insertTargetHttpsProxyCallable() { return insertTargetHttpsProxyCallable; } @BetaApi - public UnaryCallable listTargetHttpsProxiesPagedCallable() { + public UnaryCallable + listTargetHttpsProxiesPagedCallable() { return listTargetHttpsProxiesPagedCallable; } @BetaApi - public UnaryCallable listTargetHttpsProxiesCallable() { + public UnaryCallable + listTargetHttpsProxiesCallable() { return listTargetHttpsProxiesCallable; } @BetaApi - public UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { + public UnaryCallable + setSslCertificatesTargetHttpsProxyCallable() { return setSslCertificatesTargetHttpsProxyCallable; } @BetaApi - public UnaryCallable setUrlMapTargetHttpsProxyCallable() { + public UnaryCallable + setSslPolicyTargetHttpsProxyCallable() { + return setSslPolicyTargetHttpsProxyCallable; + } + + @BetaApi + public UnaryCallable + setUrlMapTargetHttpsProxyCallable() { return setUrlMapTargetHttpsProxyCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -321,5 +432,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java index 33f289c7d9b4..2f3983ed49e9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; -import com.google.cloud.compute.v1.DeleteTargetInstanceHttpRequest; -import com.google.cloud.compute.v1.GetTargetInstanceHttpRequest; -import com.google.cloud.compute.v1.InsertTargetInstanceHttpRequest; -import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.ProjectZoneTargetInstanceName; -import com.google.cloud.compute.v1.TargetInstance; -import com.google.cloud.compute.v1.TargetInstanceAggregatedList; -import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; -import com.google.cloud.compute.v1.TargetInstanceList; -import com.google.cloud.compute.v1.TargetInstanceSettings; -import com.google.cloud.compute.v1.TargetInstancesScopedList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java index 2e3016aa13f2..54fe6d567e35 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; @@ -40,17 +42,9 @@ import com.google.cloud.compute.v1.ProjectZoneTargetInstanceName; import com.google.cloud.compute.v1.TargetInstance; import com.google.cloud.compute.v1.TargetInstanceAggregatedList; -import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; import com.google.cloud.compute.v1.TargetInstanceList; -import com.google.cloud.compute.v1.TargetInstanceSettings; -import com.google.cloud.compute.v1.TargetInstancesScopedList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,183 +58,254 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetInstanceStub extends TargetInstanceStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListTargetInstancesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetInstances.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/targetInstances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetInstanceAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList> + aggregatedListTargetInstancesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.targetInstances.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/targetInstances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetInstanceAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteTargetInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetInstances.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances/{targetInstance}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneTargetInstanceName.newFactory()) - .setResourceNameField("targetInstance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/targetInstances/{targetInstance}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneTargetInstanceName.newFactory()) + .setResourceNameField("targetInstance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetInstances.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances/{targetInstance}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneTargetInstanceName.newFactory()) - .setResourceNameField("targetInstance") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetInstance.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/targetInstances/{targetInstance}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneTargetInstanceName.newFactory()) + .setResourceNameField("targetInstance") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetInstance.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetInstanceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetInstances.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/targetInstances")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetInstancesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetInstances.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetInstancesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/targetInstances")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetInstanceList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetInstances.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetInstancesHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/targetInstances")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetInstanceList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListTargetInstancesCallable; - private final UnaryCallable aggregatedListTargetInstancesPagedCallable; - private final UnaryCallable deleteTargetInstanceCallable; - private final UnaryCallable getTargetInstanceCallable; - private final UnaryCallable insertTargetInstanceCallable; - private final UnaryCallable listTargetInstancesCallable; - private final UnaryCallable listTargetInstancesPagedCallable; + private final UnaryCallable< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList> + aggregatedListTargetInstancesCallable; + private final UnaryCallable< + AggregatedListTargetInstancesHttpRequest, AggregatedListTargetInstancesPagedResponse> + aggregatedListTargetInstancesPagedCallable; + private final UnaryCallable + deleteTargetInstanceCallable; + private final UnaryCallable + getTargetInstanceCallable; + private final UnaryCallable + insertTargetInstanceCallable; + private final UnaryCallable + listTargetInstancesCallable; + private final UnaryCallable + listTargetInstancesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetInstanceStub create(TargetInstanceStubSettings settings) throws IOException { + + public static final HttpJsonTargetInstanceStub create(TargetInstanceStubSettings settings) + throws IOException { return new HttpJsonTargetInstanceStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetInstanceStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetInstanceStub(TargetInstanceStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetInstanceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetInstanceStub( + TargetInstanceStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetInstanceStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetInstanceStub(TargetInstanceStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetInstanceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetInstanceStub( + TargetInstanceStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetInstanceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetInstanceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetInstanceStub(TargetInstanceStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetInstanceStub( + TargetInstanceStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetInstanceCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetInstanceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetInstanceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetInstanceStub(TargetInstanceStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetInstanceStub( + TargetInstanceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListTargetInstancesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListTargetInstancesMethodDescriptor) - .build(); - HttpJsonCallSettings deleteTargetInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetInstanceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetInstanceMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetInstancesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetInstancesMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListTargetInstancesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListTargetInstancesMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteTargetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetInstanceMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetInstancesMethodDescriptor) + .build(); - this.aggregatedListTargetInstancesCallable = callableFactory.createUnaryCallable(aggregatedListTargetInstancesTransportSettings,settings.aggregatedListTargetInstancesSettings(), clientContext); - this.aggregatedListTargetInstancesPagedCallable = callableFactory.createPagedCallable(aggregatedListTargetInstancesTransportSettings,settings.aggregatedListTargetInstancesSettings(), clientContext); - this.deleteTargetInstanceCallable = callableFactory.createUnaryCallable(deleteTargetInstanceTransportSettings,settings.deleteTargetInstanceSettings(), clientContext); - this.getTargetInstanceCallable = callableFactory.createUnaryCallable(getTargetInstanceTransportSettings,settings.getTargetInstanceSettings(), clientContext); - this.insertTargetInstanceCallable = callableFactory.createUnaryCallable(insertTargetInstanceTransportSettings,settings.insertTargetInstanceSettings(), clientContext); - this.listTargetInstancesCallable = callableFactory.createUnaryCallable(listTargetInstancesTransportSettings,settings.listTargetInstancesSettings(), clientContext); - this.listTargetInstancesPagedCallable = callableFactory.createPagedCallable(listTargetInstancesTransportSettings,settings.listTargetInstancesSettings(), clientContext); + this.aggregatedListTargetInstancesCallable = + callableFactory.createUnaryCallable( + aggregatedListTargetInstancesTransportSettings, + settings.aggregatedListTargetInstancesSettings(), + clientContext); + this.aggregatedListTargetInstancesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListTargetInstancesTransportSettings, + settings.aggregatedListTargetInstancesSettings(), + clientContext); + this.deleteTargetInstanceCallable = + callableFactory.createUnaryCallable( + deleteTargetInstanceTransportSettings, + settings.deleteTargetInstanceSettings(), + clientContext); + this.getTargetInstanceCallable = + callableFactory.createUnaryCallable( + getTargetInstanceTransportSettings, + settings.getTargetInstanceSettings(), + clientContext); + this.insertTargetInstanceCallable = + callableFactory.createUnaryCallable( + insertTargetInstanceTransportSettings, + settings.insertTargetInstanceSettings(), + clientContext); + this.listTargetInstancesCallable = + callableFactory.createUnaryCallable( + listTargetInstancesTransportSettings, + settings.listTargetInstancesSettings(), + clientContext); + this.listTargetInstancesPagedCallable = + callableFactory.createPagedCallable( + listTargetInstancesTransportSettings, + settings.listTargetInstancesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListTargetInstancesPagedCallable() { + public UnaryCallable< + AggregatedListTargetInstancesHttpRequest, AggregatedListTargetInstancesPagedResponse> + aggregatedListTargetInstancesPagedCallable() { return aggregatedListTargetInstancesPagedCallable; } @BetaApi - public UnaryCallable aggregatedListTargetInstancesCallable() { + public UnaryCallable + aggregatedListTargetInstancesCallable() { return aggregatedListTargetInstancesCallable; } @@ -260,17 +325,19 @@ public UnaryCallable insertTargetIns } @BetaApi - public UnaryCallable listTargetInstancesPagedCallable() { + public UnaryCallable + listTargetInstancesPagedCallable() { return listTargetInstancesPagedCallable; } @BetaApi - public UnaryCallable listTargetInstancesCallable() { + public UnaryCallable + listTargetInstancesCallable() { return listTargetInstancesCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -298,5 +365,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java index 22502615bf51..e8d58f1221c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java @@ -15,67 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; -import com.google.cloud.compute.v1.AddInstanceTargetPoolHttpRequest; -import com.google.cloud.compute.v1.AggregatedListTargetPoolsHttpRequest; -import com.google.cloud.compute.v1.DeleteTargetPoolHttpRequest; -import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; -import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; -import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; -import com.google.cloud.compute.v1.InstanceReference; -import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionTargetPoolName; -import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest; -import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest; -import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; -import com.google.cloud.compute.v1.TargetPool; -import com.google.cloud.compute.v1.TargetPoolAggregatedList; -import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; -import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; -import com.google.cloud.compute.v1.TargetPoolInstanceHealth; -import com.google.cloud.compute.v1.TargetPoolList; -import com.google.cloud.compute.v1.TargetPoolSettings; -import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; -import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest; -import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; -import com.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; -import com.google.cloud.compute.v1.TargetPoolsScopedList; -import com.google.cloud.compute.v1.TargetReference; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -92,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -109,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java index 6b8de1db055a..8fb07ca4b9c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; @@ -36,7 +38,6 @@ import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; -import com.google.cloud.compute.v1.InstanceReference; import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.ProjectName; @@ -47,23 +48,10 @@ import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; import com.google.cloud.compute.v1.TargetPool; import com.google.cloud.compute.v1.TargetPoolAggregatedList; -import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; -import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; import com.google.cloud.compute.v1.TargetPoolInstanceHealth; import com.google.cloud.compute.v1.TargetPoolList; -import com.google.cloud.compute.v1.TargetPoolSettings; -import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; -import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest; -import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; -import com.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; -import com.google.cloud.compute.v1.TargetPoolsScopedList; -import com.google.cloud.compute.v1.TargetReference; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -77,281 +65,331 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetPoolStub extends TargetPoolStub { @InternalApi - public static final ApiMethodDescriptor addHealthCheckTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.addHealthCheck") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + addHealthCheckTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.addHealthCheck") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor addInstanceTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.addInstance") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/addInstance")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + addInstanceTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.addInstance") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}/addInstance")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor aggregatedListTargetPoolsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/targetPools")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetPoolAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList> + aggregatedListTargetPoolsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.targetPools.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/targetPools")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPoolAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetPool.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPool.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getHealthTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.getHealth") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/getHealth")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetPoolInstanceHealth.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getHealthTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.getHealth") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}/getHealth")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPoolInstanceHealth.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/targetPools")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetPoolsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetPoolsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetPoolList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetPoolsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetPoolsHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/targetPools")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetPoolList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor removeHealthCheckTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.removeHealthCheck") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + removeHealthCheckTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.removeHealthCheck") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor removeInstanceTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.removeInstance") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + removeInstanceTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.removeInstance") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setBackupTargetPoolMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetPools.setBackup") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetPools/{targetPool}/setBackup")) - .setQueryParams(Sets.newHashSet( - "failoverRatio", "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) - .setResourceNameField("targetPool") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setBackupTargetPoolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetPools.setBackup") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetPools/{targetPool}/setBackup")) + .setQueryParams(Sets.newHashSet("failoverRatio", "requestId")) + .setResourceNameFactory(ProjectRegionTargetPoolName.newFactory()) + .setResourceNameField("targetPool") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable addHealthCheckTargetPoolCallable; - private final UnaryCallable addInstanceTargetPoolCallable; - private final UnaryCallable aggregatedListTargetPoolsCallable; - private final UnaryCallable aggregatedListTargetPoolsPagedCallable; + private final UnaryCallable + addHealthCheckTargetPoolCallable; + private final UnaryCallable + addInstanceTargetPoolCallable; + private final UnaryCallable + aggregatedListTargetPoolsCallable; + private final UnaryCallable< + AggregatedListTargetPoolsHttpRequest, AggregatedListTargetPoolsPagedResponse> + aggregatedListTargetPoolsPagedCallable; private final UnaryCallable deleteTargetPoolCallable; private final UnaryCallable getTargetPoolCallable; - private final UnaryCallable getHealthTargetPoolCallable; + private final UnaryCallable + getHealthTargetPoolCallable; private final UnaryCallable insertTargetPoolCallable; private final UnaryCallable listTargetPoolsCallable; - private final UnaryCallable listTargetPoolsPagedCallable; - private final UnaryCallable removeHealthCheckTargetPoolCallable; - private final UnaryCallable removeInstanceTargetPoolCallable; - private final UnaryCallable setBackupTargetPoolCallable; + private final UnaryCallable + listTargetPoolsPagedCallable; + private final UnaryCallable + removeHealthCheckTargetPoolCallable; + private final UnaryCallable + removeInstanceTargetPoolCallable; + private final UnaryCallable + setBackupTargetPoolCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetPoolStub create(TargetPoolStubSettings settings) throws IOException { + + public static final HttpJsonTargetPoolStub create(TargetPoolStubSettings settings) + throws IOException { return new HttpJsonTargetPoolStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetPoolStub create(ClientContext clientContext) throws IOException { + public static final HttpJsonTargetPoolStub create(ClientContext clientContext) + throws IOException { return new HttpJsonTargetPoolStub(TargetPoolStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetPoolStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetPoolStub(TargetPoolStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetPoolStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetPoolStub( + TargetPoolStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetPoolStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetPoolStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonTargetPoolStub(TargetPoolStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetPoolStub(TargetPoolStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonTargetPoolCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetPoolStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetPoolStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonTargetPoolStub(TargetPoolStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetPoolStub( + TargetPoolStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings addHealthCheckTargetPoolTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(addHealthCheckTargetPoolMethodDescriptor) - .build(); - HttpJsonCallSettings addInstanceTargetPoolTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(addInstanceTargetPoolMethodDescriptor) - .build(); - HttpJsonCallSettings aggregatedListTargetPoolsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListTargetPoolsMethodDescriptor) - .build(); + HttpJsonCallSettings + addHealthCheckTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addHealthCheckTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings + addInstanceTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addInstanceTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings + aggregatedListTargetPoolsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListTargetPoolsMethodDescriptor) + .build(); HttpJsonCallSettings deleteTargetPoolTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteTargetPoolMethodDescriptor) @@ -360,65 +398,117 @@ protected HttpJsonTargetPoolStub(TargetPoolStubSettings settings, ClientContext HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getTargetPoolMethodDescriptor) .build(); - HttpJsonCallSettings getHealthTargetPoolTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getHealthTargetPoolMethodDescriptor) - .build(); + HttpJsonCallSettings + getHealthTargetPoolTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getHealthTargetPoolMethodDescriptor) + .build(); HttpJsonCallSettings insertTargetPoolTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertTargetPoolMethodDescriptor) .build(); - HttpJsonCallSettings listTargetPoolsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetPoolsMethodDescriptor) - .build(); - HttpJsonCallSettings removeHealthCheckTargetPoolTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(removeHealthCheckTargetPoolMethodDescriptor) - .build(); - HttpJsonCallSettings removeInstanceTargetPoolTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(removeInstanceTargetPoolMethodDescriptor) - .build(); - HttpJsonCallSettings setBackupTargetPoolTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setBackupTargetPoolMethodDescriptor) - .build(); + HttpJsonCallSettings + listTargetPoolsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetPoolsMethodDescriptor) + .build(); + HttpJsonCallSettings + removeHealthCheckTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removeHealthCheckTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings + removeInstanceTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(removeInstanceTargetPoolMethodDescriptor) + .build(); + HttpJsonCallSettings + setBackupTargetPoolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackupTargetPoolMethodDescriptor) + .build(); - this.addHealthCheckTargetPoolCallable = callableFactory.createUnaryCallable(addHealthCheckTargetPoolTransportSettings,settings.addHealthCheckTargetPoolSettings(), clientContext); - this.addInstanceTargetPoolCallable = callableFactory.createUnaryCallable(addInstanceTargetPoolTransportSettings,settings.addInstanceTargetPoolSettings(), clientContext); - this.aggregatedListTargetPoolsCallable = callableFactory.createUnaryCallable(aggregatedListTargetPoolsTransportSettings,settings.aggregatedListTargetPoolsSettings(), clientContext); - this.aggregatedListTargetPoolsPagedCallable = callableFactory.createPagedCallable(aggregatedListTargetPoolsTransportSettings,settings.aggregatedListTargetPoolsSettings(), clientContext); - this.deleteTargetPoolCallable = callableFactory.createUnaryCallable(deleteTargetPoolTransportSettings,settings.deleteTargetPoolSettings(), clientContext); - this.getTargetPoolCallable = callableFactory.createUnaryCallable(getTargetPoolTransportSettings,settings.getTargetPoolSettings(), clientContext); - this.getHealthTargetPoolCallable = callableFactory.createUnaryCallable(getHealthTargetPoolTransportSettings,settings.getHealthTargetPoolSettings(), clientContext); - this.insertTargetPoolCallable = callableFactory.createUnaryCallable(insertTargetPoolTransportSettings,settings.insertTargetPoolSettings(), clientContext); - this.listTargetPoolsCallable = callableFactory.createUnaryCallable(listTargetPoolsTransportSettings,settings.listTargetPoolsSettings(), clientContext); - this.listTargetPoolsPagedCallable = callableFactory.createPagedCallable(listTargetPoolsTransportSettings,settings.listTargetPoolsSettings(), clientContext); - this.removeHealthCheckTargetPoolCallable = callableFactory.createUnaryCallable(removeHealthCheckTargetPoolTransportSettings,settings.removeHealthCheckTargetPoolSettings(), clientContext); - this.removeInstanceTargetPoolCallable = callableFactory.createUnaryCallable(removeInstanceTargetPoolTransportSettings,settings.removeInstanceTargetPoolSettings(), clientContext); - this.setBackupTargetPoolCallable = callableFactory.createUnaryCallable(setBackupTargetPoolTransportSettings,settings.setBackupTargetPoolSettings(), clientContext); + this.addHealthCheckTargetPoolCallable = + callableFactory.createUnaryCallable( + addHealthCheckTargetPoolTransportSettings, + settings.addHealthCheckTargetPoolSettings(), + clientContext); + this.addInstanceTargetPoolCallable = + callableFactory.createUnaryCallable( + addInstanceTargetPoolTransportSettings, + settings.addInstanceTargetPoolSettings(), + clientContext); + this.aggregatedListTargetPoolsCallable = + callableFactory.createUnaryCallable( + aggregatedListTargetPoolsTransportSettings, + settings.aggregatedListTargetPoolsSettings(), + clientContext); + this.aggregatedListTargetPoolsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListTargetPoolsTransportSettings, + settings.aggregatedListTargetPoolsSettings(), + clientContext); + this.deleteTargetPoolCallable = + callableFactory.createUnaryCallable( + deleteTargetPoolTransportSettings, settings.deleteTargetPoolSettings(), clientContext); + this.getTargetPoolCallable = + callableFactory.createUnaryCallable( + getTargetPoolTransportSettings, settings.getTargetPoolSettings(), clientContext); + this.getHealthTargetPoolCallable = + callableFactory.createUnaryCallable( + getHealthTargetPoolTransportSettings, + settings.getHealthTargetPoolSettings(), + clientContext); + this.insertTargetPoolCallable = + callableFactory.createUnaryCallable( + insertTargetPoolTransportSettings, settings.insertTargetPoolSettings(), clientContext); + this.listTargetPoolsCallable = + callableFactory.createUnaryCallable( + listTargetPoolsTransportSettings, settings.listTargetPoolsSettings(), clientContext); + this.listTargetPoolsPagedCallable = + callableFactory.createPagedCallable( + listTargetPoolsTransportSettings, settings.listTargetPoolsSettings(), clientContext); + this.removeHealthCheckTargetPoolCallable = + callableFactory.createUnaryCallable( + removeHealthCheckTargetPoolTransportSettings, + settings.removeHealthCheckTargetPoolSettings(), + clientContext); + this.removeInstanceTargetPoolCallable = + callableFactory.createUnaryCallable( + removeInstanceTargetPoolTransportSettings, + settings.removeInstanceTargetPoolSettings(), + clientContext); + this.setBackupTargetPoolCallable = + callableFactory.createUnaryCallable( + setBackupTargetPoolTransportSettings, + settings.setBackupTargetPoolSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable addHealthCheckTargetPoolCallable() { + public UnaryCallable + addHealthCheckTargetPoolCallable() { return addHealthCheckTargetPoolCallable; } @BetaApi - public UnaryCallable addInstanceTargetPoolCallable() { + public UnaryCallable + addInstanceTargetPoolCallable() { return addInstanceTargetPoolCallable; } @BetaApi - public UnaryCallable aggregatedListTargetPoolsPagedCallable() { + public UnaryCallable + aggregatedListTargetPoolsPagedCallable() { return aggregatedListTargetPoolsPagedCallable; } @BetaApi - public UnaryCallable aggregatedListTargetPoolsCallable() { + public UnaryCallable + aggregatedListTargetPoolsCallable() { return aggregatedListTargetPoolsCallable; } @@ -433,7 +523,8 @@ public UnaryCallable getTargetPoolCallable } @BetaApi - public UnaryCallable getHealthTargetPoolCallable() { + public UnaryCallable + getHealthTargetPoolCallable() { return getHealthTargetPoolCallable; } @@ -443,7 +534,8 @@ public UnaryCallable insertTargetPoolCal } @BetaApi - public UnaryCallable listTargetPoolsPagedCallable() { + public UnaryCallable + listTargetPoolsPagedCallable() { return listTargetPoolsPagedCallable; } @@ -453,12 +545,14 @@ public UnaryCallable listTargetPools } @BetaApi - public UnaryCallable removeHealthCheckTargetPoolCallable() { + public UnaryCallable + removeHealthCheckTargetPoolCallable() { return removeHealthCheckTargetPoolCallable; } @BetaApi - public UnaryCallable removeInstanceTargetPoolCallable() { + public UnaryCallable + removeInstanceTargetPoolCallable() { return removeInstanceTargetPoolCallable; } @@ -468,7 +562,7 @@ public UnaryCallable setBackupTargetP } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -496,5 +590,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java index e4a54b709aca..5f6715ff6cb4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java @@ -15,55 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.GetTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetSslProxyName; -import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; -import com.google.cloud.compute.v1.TargetSslProxy; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; -import com.google.cloud.compute.v1.TargetSslProxyList; -import com.google.cloud.compute.v1.TargetSslProxySettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -80,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -97,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index 8c8a6df99098..d1d36b237e2a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; @@ -34,24 +35,16 @@ import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalTargetSslProxyName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetSslProxyName; import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.SetSslPolicyTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.TargetSslProxy; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; import com.google.cloud.compute.v1.TargetSslProxyList; -import com.google.cloud.compute.v1.TargetSslProxySettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -65,222 +58,332 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { @InternalApi - public static final ApiMethodDescriptor deleteTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectTargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetSslProxy.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalTargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listTargetSslProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetSslProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetSslProxiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetSslProxyList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setBackendServiceTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setBackendService") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setBackendServiceTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setBackendService") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setProxyHeaderTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setProxyHeader") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setProxyHeaderTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setProxyHeader") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setSslCertificatesTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setSslCertificates") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setSslCertificatesTargetSslProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetSslProxies.setSslCertificates") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetSslProxyName.newFactory()) - .setResourceNameField("targetSslProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setSslPolicyTargetSslProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetSslProxies.setSslPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + SetSslPolicyTargetSslProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetSslProxyName.newFactory()) + .setResourceNameField("targetSslProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteTargetSslProxyCallable; - private final UnaryCallable getTargetSslProxyCallable; - private final UnaryCallable insertTargetSslProxyCallable; - private final UnaryCallable listTargetSslProxiesCallable; - private final UnaryCallable listTargetSslProxiesPagedCallable; - private final UnaryCallable setBackendServiceTargetSslProxyCallable; - private final UnaryCallable setProxyHeaderTargetSslProxyCallable; - private final UnaryCallable setSslCertificatesTargetSslProxyCallable; + private final UnaryCallable + deleteTargetSslProxyCallable; + private final UnaryCallable + getTargetSslProxyCallable; + private final UnaryCallable + insertTargetSslProxyCallable; + private final UnaryCallable + listTargetSslProxiesCallable; + private final UnaryCallable + listTargetSslProxiesPagedCallable; + private final UnaryCallable + setBackendServiceTargetSslProxyCallable; + private final UnaryCallable + setProxyHeaderTargetSslProxyCallable; + private final UnaryCallable + setSslCertificatesTargetSslProxyCallable; + private final UnaryCallable + setSslPolicyTargetSslProxyCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) throws IOException { + + public static final HttpJsonTargetSslProxyStub create(TargetSslProxyStubSettings settings) + throws IOException { return new HttpJsonTargetSslProxyStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetSslProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetSslProxyStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetSslProxyCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetSslProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetSslProxyStub(TargetSslProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetSslProxyStub( + TargetSslProxyStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetSslProxiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) - .build(); - HttpJsonCallSettings setBackendServiceTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings setProxyHeaderTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) - .build(); - HttpJsonCallSettings setSslCertificatesTargetSslProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) - .build(); - - this.deleteTargetSslProxyCallable = callableFactory.createUnaryCallable(deleteTargetSslProxyTransportSettings,settings.deleteTargetSslProxySettings(), clientContext); - this.getTargetSslProxyCallable = callableFactory.createUnaryCallable(getTargetSslProxyTransportSettings,settings.getTargetSslProxySettings(), clientContext); - this.insertTargetSslProxyCallable = callableFactory.createUnaryCallable(insertTargetSslProxyTransportSettings,settings.insertTargetSslProxySettings(), clientContext); - this.listTargetSslProxiesCallable = callableFactory.createUnaryCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); - this.listTargetSslProxiesPagedCallable = callableFactory.createPagedCallable(listTargetSslProxiesTransportSettings,settings.listTargetSslProxiesSettings(), clientContext); - this.setBackendServiceTargetSslProxyCallable = callableFactory.createUnaryCallable(setBackendServiceTargetSslProxyTransportSettings,settings.setBackendServiceTargetSslProxySettings(), clientContext); - this.setProxyHeaderTargetSslProxyCallable = callableFactory.createUnaryCallable(setProxyHeaderTargetSslProxyTransportSettings,settings.setProxyHeaderTargetSslProxySettings(), clientContext); - this.setSslCertificatesTargetSslProxyCallable = callableFactory.createUnaryCallable(setSslCertificatesTargetSslProxyTransportSettings,settings.setSslCertificatesTargetSslProxySettings(), clientContext); + HttpJsonCallSettings + deleteTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetSslProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetSslProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings + setBackendServiceTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackendServiceTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setProxyHeaderTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setProxyHeaderTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setSslCertificatesTargetSslProxyTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setSslCertificatesTargetSslProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setSslPolicyTargetSslProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setSslPolicyTargetSslProxyMethodDescriptor) + .build(); + + this.deleteTargetSslProxyCallable = + callableFactory.createUnaryCallable( + deleteTargetSslProxyTransportSettings, + settings.deleteTargetSslProxySettings(), + clientContext); + this.getTargetSslProxyCallable = + callableFactory.createUnaryCallable( + getTargetSslProxyTransportSettings, + settings.getTargetSslProxySettings(), + clientContext); + this.insertTargetSslProxyCallable = + callableFactory.createUnaryCallable( + insertTargetSslProxyTransportSettings, + settings.insertTargetSslProxySettings(), + clientContext); + this.listTargetSslProxiesCallable = + callableFactory.createUnaryCallable( + listTargetSslProxiesTransportSettings, + settings.listTargetSslProxiesSettings(), + clientContext); + this.listTargetSslProxiesPagedCallable = + callableFactory.createPagedCallable( + listTargetSslProxiesTransportSettings, + settings.listTargetSslProxiesSettings(), + clientContext); + this.setBackendServiceTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setBackendServiceTargetSslProxyTransportSettings, + settings.setBackendServiceTargetSslProxySettings(), + clientContext); + this.setProxyHeaderTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setProxyHeaderTargetSslProxyTransportSettings, + settings.setProxyHeaderTargetSslProxySettings(), + clientContext); + this.setSslCertificatesTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setSslCertificatesTargetSslProxyTransportSettings, + settings.setSslCertificatesTargetSslProxySettings(), + clientContext); + this.setSslPolicyTargetSslProxyCallable = + callableFactory.createUnaryCallable( + setSslPolicyTargetSslProxyTransportSettings, + settings.setSslPolicyTargetSslProxySettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -301,32 +404,43 @@ public UnaryCallable insertTargetSsl } @BetaApi - public UnaryCallable listTargetSslProxiesPagedCallable() { + public UnaryCallable + listTargetSslProxiesPagedCallable() { return listTargetSslProxiesPagedCallable; } @BetaApi - public UnaryCallable listTargetSslProxiesCallable() { + public UnaryCallable + listTargetSslProxiesCallable() { return listTargetSslProxiesCallable; } @BetaApi - public UnaryCallable setBackendServiceTargetSslProxyCallable() { + public UnaryCallable + setBackendServiceTargetSslProxyCallable() { return setBackendServiceTargetSslProxyCallable; } @BetaApi - public UnaryCallable setProxyHeaderTargetSslProxyCallable() { + public UnaryCallable + setProxyHeaderTargetSslProxyCallable() { return setProxyHeaderTargetSslProxyCallable; } @BetaApi - public UnaryCallable setSslCertificatesTargetSslProxyCallable() { + public UnaryCallable + setSslCertificatesTargetSslProxyCallable() { return setSslCertificatesTargetSslProxyCallable; } + @BetaApi + public UnaryCallable + setSslPolicyTargetSslProxyCallable() { + return setSslPolicyTargetSslProxyCallable; + } + @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -354,5 +468,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java index fae5145d52db..271f30019263 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java @@ -15,53 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.GetTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetTcpProxyName; -import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; -import com.google.cloud.compute.v1.TargetTcpProxy; -import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; -import com.google.cloud.compute.v1.TargetTcpProxyList; -import com.google.cloud.compute.v1.TargetTcpProxySettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -78,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -95,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java index ccbf35f8ce07..466726ac8052 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; @@ -34,22 +35,14 @@ import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectGlobalTargetTcpProxyName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetTcpProxyName; import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; import com.google.cloud.compute.v1.TargetTcpProxy; -import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; import com.google.cloud.compute.v1.TargetTcpProxyList; -import com.google.cloud.compute.v1.TargetTcpProxySettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -63,196 +56,260 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { @InternalApi - public static final ApiMethodDescriptor deleteTargetTcpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetTcpProxies.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory()) - .setResourceNameField("targetTcpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetTcpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetTcpProxies.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetTcpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory()) - .setResourceNameField("targetTcpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetTcpProxy.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalTargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetTcpProxy.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetTcpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetTcpProxies.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetTcpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetTcpProxiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetTcpProxies.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetTcpProxiesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetTcpProxyList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetTcpProxiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetTcpProxiesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetTcpProxyList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setBackendServiceTargetTcpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetTcpProxies.setBackendService") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory()) - .setResourceNameField("targetTcpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setBackendServiceTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.setBackendService") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor setProxyHeaderTargetTcpProxyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetTcpProxies.setProxyHeader") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectTargetTcpProxyName.newFactory()) - .setResourceNameField("targetTcpProxy") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + setProxyHeaderTargetTcpProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetTcpProxies.setProxyHeader") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetTcpProxyName.newFactory()) + .setResourceNameField("targetTcpProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable deleteTargetTcpProxyCallable; - private final UnaryCallable getTargetTcpProxyCallable; - private final UnaryCallable insertTargetTcpProxyCallable; - private final UnaryCallable listTargetTcpProxiesCallable; - private final UnaryCallable listTargetTcpProxiesPagedCallable; - private final UnaryCallable setBackendServiceTargetTcpProxyCallable; - private final UnaryCallable setProxyHeaderTargetTcpProxyCallable; + private final UnaryCallable + deleteTargetTcpProxyCallable; + private final UnaryCallable + getTargetTcpProxyCallable; + private final UnaryCallable + insertTargetTcpProxyCallable; + private final UnaryCallable + listTargetTcpProxiesCallable; + private final UnaryCallable + listTargetTcpProxiesPagedCallable; + private final UnaryCallable + setBackendServiceTargetTcpProxyCallable; + private final UnaryCallable + setProxyHeaderTargetTcpProxyCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetTcpProxyStub create(TargetTcpProxyStubSettings settings) throws IOException { + + public static final HttpJsonTargetTcpProxyStub create(TargetTcpProxyStubSettings settings) + throws IOException { return new HttpJsonTargetTcpProxyStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetTcpProxyStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetTcpProxyStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetTcpProxyStub( + TargetTcpProxyStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetTcpProxyStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetTcpProxyStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetTcpProxyStub( + TargetTcpProxyStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetTcpProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetTcpProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetTcpProxyStub( + TargetTcpProxyStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetTcpProxyCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetTcpProxyStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetTcpProxyStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetTcpProxyStub(TargetTcpProxyStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetTcpProxyStub( + TargetTcpProxyStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteTargetTcpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetTcpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetTcpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetTcpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetTcpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetTcpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetTcpProxiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetTcpProxiesMethodDescriptor) - .build(); - HttpJsonCallSettings setBackendServiceTargetTcpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setBackendServiceTargetTcpProxyMethodDescriptor) - .build(); - HttpJsonCallSettings setProxyHeaderTargetTcpProxyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setProxyHeaderTargetTcpProxyMethodDescriptor) - .build(); - - this.deleteTargetTcpProxyCallable = callableFactory.createUnaryCallable(deleteTargetTcpProxyTransportSettings,settings.deleteTargetTcpProxySettings(), clientContext); - this.getTargetTcpProxyCallable = callableFactory.createUnaryCallable(getTargetTcpProxyTransportSettings,settings.getTargetTcpProxySettings(), clientContext); - this.insertTargetTcpProxyCallable = callableFactory.createUnaryCallable(insertTargetTcpProxyTransportSettings,settings.insertTargetTcpProxySettings(), clientContext); - this.listTargetTcpProxiesCallable = callableFactory.createUnaryCallable(listTargetTcpProxiesTransportSettings,settings.listTargetTcpProxiesSettings(), clientContext); - this.listTargetTcpProxiesPagedCallable = callableFactory.createPagedCallable(listTargetTcpProxiesTransportSettings,settings.listTargetTcpProxiesSettings(), clientContext); - this.setBackendServiceTargetTcpProxyCallable = callableFactory.createUnaryCallable(setBackendServiceTargetTcpProxyTransportSettings,settings.setBackendServiceTargetTcpProxySettings(), clientContext); - this.setProxyHeaderTargetTcpProxyCallable = callableFactory.createUnaryCallable(setProxyHeaderTargetTcpProxyTransportSettings,settings.setProxyHeaderTargetTcpProxySettings(), clientContext); + HttpJsonCallSettings + deleteTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetTcpProxiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTargetTcpProxiesMethodDescriptor) + .build(); + HttpJsonCallSettings + setBackendServiceTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setBackendServiceTargetTcpProxyMethodDescriptor) + .build(); + HttpJsonCallSettings + setProxyHeaderTargetTcpProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setProxyHeaderTargetTcpProxyMethodDescriptor) + .build(); + + this.deleteTargetTcpProxyCallable = + callableFactory.createUnaryCallable( + deleteTargetTcpProxyTransportSettings, + settings.deleteTargetTcpProxySettings(), + clientContext); + this.getTargetTcpProxyCallable = + callableFactory.createUnaryCallable( + getTargetTcpProxyTransportSettings, + settings.getTargetTcpProxySettings(), + clientContext); + this.insertTargetTcpProxyCallable = + callableFactory.createUnaryCallable( + insertTargetTcpProxyTransportSettings, + settings.insertTargetTcpProxySettings(), + clientContext); + this.listTargetTcpProxiesCallable = + callableFactory.createUnaryCallable( + listTargetTcpProxiesTransportSettings, + settings.listTargetTcpProxiesSettings(), + clientContext); + this.listTargetTcpProxiesPagedCallable = + callableFactory.createPagedCallable( + listTargetTcpProxiesTransportSettings, + settings.listTargetTcpProxiesSettings(), + clientContext); + this.setBackendServiceTargetTcpProxyCallable = + callableFactory.createUnaryCallable( + setBackendServiceTargetTcpProxyTransportSettings, + settings.setBackendServiceTargetTcpProxySettings(), + clientContext); + this.setProxyHeaderTargetTcpProxyCallable = + callableFactory.createUnaryCallable( + setProxyHeaderTargetTcpProxyTransportSettings, + settings.setProxyHeaderTargetTcpProxySettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -273,27 +330,31 @@ public UnaryCallable insertTargetTcp } @BetaApi - public UnaryCallable listTargetTcpProxiesPagedCallable() { + public UnaryCallable + listTargetTcpProxiesPagedCallable() { return listTargetTcpProxiesPagedCallable; } @BetaApi - public UnaryCallable listTargetTcpProxiesCallable() { + public UnaryCallable + listTargetTcpProxiesCallable() { return listTargetTcpProxiesCallable; } @BetaApi - public UnaryCallable setBackendServiceTargetTcpProxyCallable() { + public UnaryCallable + setBackendServiceTargetTcpProxyCallable() { return setBackendServiceTargetTcpProxyCallable; } @BetaApi - public UnaryCallable setProxyHeaderTargetTcpProxyCallable() { + public UnaryCallable + setProxyHeaderTargetTcpProxyCallable() { return setProxyHeaderTargetTcpProxyCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -321,5 +382,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java index 63220ce29ad0..f250498def74 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; -import com.google.cloud.compute.v1.DeleteTargetVpnGatewayHttpRequest; -import com.google.cloud.compute.v1.GetTargetVpnGatewayHttpRequest; -import com.google.cloud.compute.v1.InsertTargetVpnGatewayHttpRequest; -import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionTargetVpnGatewayName; -import com.google.cloud.compute.v1.TargetVpnGateway; -import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; -import com.google.cloud.compute.v1.TargetVpnGatewayList; -import com.google.cloud.compute.v1.TargetVpnGatewaySettings; -import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java index f12af34d92a1..f22376447c10 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; @@ -40,17 +42,9 @@ import com.google.cloud.compute.v1.ProjectRegionTargetVpnGatewayName; import com.google.cloud.compute.v1.TargetVpnGateway; import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; import com.google.cloud.compute.v1.TargetVpnGatewayList; -import com.google.cloud.compute.v1.TargetVpnGatewaySettings; -import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,213 +58,292 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListTargetVpnGatewaysMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetVpnGateways.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/targetVpnGateways")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetVpnGatewayAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList> + aggregatedListTargetVpnGatewaysMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.targetVpnGateways.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/aggregated/targetVpnGateways")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetVpnGatewayAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteTargetVpnGatewayMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetVpnGateways.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionTargetVpnGatewayName.newFactory()) - .setResourceNameField("targetVpnGateway") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteTargetVpnGatewayMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionTargetVpnGatewayName.newFactory()) + .setResourceNameField("targetVpnGateway") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getTargetVpnGatewayMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetVpnGateways.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetVpnGatewayHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionTargetVpnGatewayName.newFactory()) - .setResourceNameField("targetVpnGateway") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetVpnGateway.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getTargetVpnGatewayMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetVpnGatewayHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionTargetVpnGatewayName.newFactory()) + .setResourceNameField("targetVpnGateway") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetVpnGateway.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertTargetVpnGatewayMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetVpnGateways.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertTargetVpnGatewayMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listTargetVpnGatewaysMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.targetVpnGateways.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(TargetVpnGatewayList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listTargetVpnGatewaysMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetVpnGateways.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TargetVpnGatewayList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListTargetVpnGatewaysCallable; - private final UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable; - private final UnaryCallable deleteTargetVpnGatewayCallable; - private final UnaryCallable getTargetVpnGatewayCallable; - private final UnaryCallable insertTargetVpnGatewayCallable; - private final UnaryCallable listTargetVpnGatewaysCallable; - private final UnaryCallable listTargetVpnGatewaysPagedCallable; + private final UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList> + aggregatedListTargetVpnGatewaysCallable; + private final UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysPagedCallable; + private final UnaryCallable + deleteTargetVpnGatewayCallable; + private final UnaryCallable + getTargetVpnGatewayCallable; + private final UnaryCallable + insertTargetVpnGatewayCallable; + private final UnaryCallable + listTargetVpnGatewaysCallable; + private final UnaryCallable + listTargetVpnGatewaysPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonTargetVpnGatewayStub create(TargetVpnGatewayStubSettings settings) throws IOException { + + public static final HttpJsonTargetVpnGatewayStub create(TargetVpnGatewayStubSettings settings) + throws IOException { return new HttpJsonTargetVpnGatewayStub(settings, ClientContext.create(settings)); } - public static final HttpJsonTargetVpnGatewayStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonTargetVpnGatewayStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonTargetVpnGatewayStub( + TargetVpnGatewayStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonTargetVpnGatewayStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonTargetVpnGatewayStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTargetVpnGatewayStub( + TargetVpnGatewayStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonTargetVpnGatewayStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetVpnGatewayStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonTargetVpnGatewayStub( + TargetVpnGatewayStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonTargetVpnGatewayCallableFactory()); } /** - * Constructs an instance of HttpJsonTargetVpnGatewayStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonTargetVpnGatewayStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonTargetVpnGatewayStub(TargetVpnGatewayStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonTargetVpnGatewayStub( + TargetVpnGatewayStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListTargetVpnGatewaysTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListTargetVpnGatewaysMethodDescriptor) - .build(); - HttpJsonCallSettings deleteTargetVpnGatewayTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTargetVpnGatewayMethodDescriptor) - .build(); - HttpJsonCallSettings getTargetVpnGatewayTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTargetVpnGatewayMethodDescriptor) - .build(); - HttpJsonCallSettings insertTargetVpnGatewayTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(insertTargetVpnGatewayMethodDescriptor) - .build(); - HttpJsonCallSettings listTargetVpnGatewaysTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTargetVpnGatewaysMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListTargetVpnGatewaysTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(aggregatedListTargetVpnGatewaysMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteTargetVpnGatewayTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTargetVpnGatewayMethodDescriptor) + .build(); + HttpJsonCallSettings + getTargetVpnGatewayTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTargetVpnGatewayMethodDescriptor) + .build(); + HttpJsonCallSettings + insertTargetVpnGatewayTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertTargetVpnGatewayMethodDescriptor) + .build(); + HttpJsonCallSettings + listTargetVpnGatewaysTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listTargetVpnGatewaysMethodDescriptor) + .build(); - this.aggregatedListTargetVpnGatewaysCallable = callableFactory.createUnaryCallable(aggregatedListTargetVpnGatewaysTransportSettings,settings.aggregatedListTargetVpnGatewaysSettings(), clientContext); - this.aggregatedListTargetVpnGatewaysPagedCallable = callableFactory.createPagedCallable(aggregatedListTargetVpnGatewaysTransportSettings,settings.aggregatedListTargetVpnGatewaysSettings(), clientContext); - this.deleteTargetVpnGatewayCallable = callableFactory.createUnaryCallable(deleteTargetVpnGatewayTransportSettings,settings.deleteTargetVpnGatewaySettings(), clientContext); - this.getTargetVpnGatewayCallable = callableFactory.createUnaryCallable(getTargetVpnGatewayTransportSettings,settings.getTargetVpnGatewaySettings(), clientContext); - this.insertTargetVpnGatewayCallable = callableFactory.createUnaryCallable(insertTargetVpnGatewayTransportSettings,settings.insertTargetVpnGatewaySettings(), clientContext); - this.listTargetVpnGatewaysCallable = callableFactory.createUnaryCallable(listTargetVpnGatewaysTransportSettings,settings.listTargetVpnGatewaysSettings(), clientContext); - this.listTargetVpnGatewaysPagedCallable = callableFactory.createPagedCallable(listTargetVpnGatewaysTransportSettings,settings.listTargetVpnGatewaysSettings(), clientContext); + this.aggregatedListTargetVpnGatewaysCallable = + callableFactory.createUnaryCallable( + aggregatedListTargetVpnGatewaysTransportSettings, + settings.aggregatedListTargetVpnGatewaysSettings(), + clientContext); + this.aggregatedListTargetVpnGatewaysPagedCallable = + callableFactory.createPagedCallable( + aggregatedListTargetVpnGatewaysTransportSettings, + settings.aggregatedListTargetVpnGatewaysSettings(), + clientContext); + this.deleteTargetVpnGatewayCallable = + callableFactory.createUnaryCallable( + deleteTargetVpnGatewayTransportSettings, + settings.deleteTargetVpnGatewaySettings(), + clientContext); + this.getTargetVpnGatewayCallable = + callableFactory.createUnaryCallable( + getTargetVpnGatewayTransportSettings, + settings.getTargetVpnGatewaySettings(), + clientContext); + this.insertTargetVpnGatewayCallable = + callableFactory.createUnaryCallable( + insertTargetVpnGatewayTransportSettings, + settings.insertTargetVpnGatewaySettings(), + clientContext); + this.listTargetVpnGatewaysCallable = + callableFactory.createUnaryCallable( + listTargetVpnGatewaysTransportSettings, + settings.listTargetVpnGatewaysSettings(), + clientContext); + this.listTargetVpnGatewaysPagedCallable = + callableFactory.createPagedCallable( + listTargetVpnGatewaysTransportSettings, + settings.listTargetVpnGatewaysSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { + public UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysPagedCallable() { return aggregatedListTargetVpnGatewaysPagedCallable; } @BetaApi - public UnaryCallable aggregatedListTargetVpnGatewaysCallable() { + public UnaryCallable + aggregatedListTargetVpnGatewaysCallable() { return aggregatedListTargetVpnGatewaysCallable; } @BetaApi - public UnaryCallable deleteTargetVpnGatewayCallable() { + public UnaryCallable + deleteTargetVpnGatewayCallable() { return deleteTargetVpnGatewayCallable; } @BetaApi - public UnaryCallable getTargetVpnGatewayCallable() { + public UnaryCallable + getTargetVpnGatewayCallable() { return getTargetVpnGatewayCallable; } @BetaApi - public UnaryCallable insertTargetVpnGatewayCallable() { + public UnaryCallable + insertTargetVpnGatewayCallable() { return insertTargetVpnGatewayCallable; } @BetaApi - public UnaryCallable listTargetVpnGatewaysPagedCallable() { + public UnaryCallable + listTargetVpnGatewaysPagedCallable() { return listTargetVpnGatewaysPagedCallable; } @BetaApi - public UnaryCallable listTargetVpnGatewaysCallable() { + public UnaryCallable + listTargetVpnGatewaysCallable() { return listTargetVpnGatewaysCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -298,5 +371,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java index 4d472fe1133a..5b17559dcf32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java @@ -15,56 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.CacheInvalidationRule; -import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; -import com.google.cloud.compute.v1.GetUrlMapHttpRequest; -import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; -import com.google.cloud.compute.v1.InvalidateCacheUrlMapHttpRequest; -import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectUrlMapName; -import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; -import com.google.cloud.compute.v1.UrlMap; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; -import com.google.cloud.compute.v1.UrlMapList; -import com.google.cloud.compute.v1.UrlMapSettings; -import com.google.cloud.compute.v1.UrlMapsValidateRequest; -import com.google.cloud.compute.v1.UrlMapsValidateResponse; -import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -81,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -98,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index ed4d8dddb18a..36eedec7493f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,10 +28,8 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.CacheInvalidationRule; import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; import com.google.cloud.compute.v1.GetUrlMapHttpRequest; import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; @@ -37,22 +37,15 @@ import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; +import com.google.cloud.compute.v1.ProjectGlobalUrlMapName; import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectUrlMapName; import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; import com.google.cloud.compute.v1.UrlMap; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; import com.google.cloud.compute.v1.UrlMapList; -import com.google.cloud.compute.v1.UrlMapSettings; -import com.google.cloud.compute.v1.UrlMapsValidateRequest; import com.google.cloud.compute.v1.UrlMapsValidateResponse; import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -66,25 +59,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonUrlMapStub extends UrlMapStub { @InternalApi - public static final ApiMethodDescriptor deleteUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectUrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getUrlMapMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -94,9 +87,8 @@ public class HttpJsonUrlMapStub extends UrlMapStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectUrlMapName.newFactory()) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) .setResourceNameField("urlMap") .build()) .setResponseParser( @@ -104,138 +96,147 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setResponseInstance(UrlMap.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor insertUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor invalidateCacheUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.invalidateCache") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectUrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + invalidateCacheUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.invalidateCache") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listUrlMapsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(UrlMapList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listUrlMapsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor patchUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.patch") - .setHttpMethod(HttpMethods.PATCH) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectUrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + patchUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor updateUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.update") - .setHttpMethod(HttpMethods.PUT) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectUrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + updateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.update") + .setHttpMethod(HttpMethods.PUT) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor validateUrlMapMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.urlMaps.validate") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectUrlMapName.newFactory()) - .setResourceNameField("urlMap") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + validateUrlMapMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.urlMaps.validate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) + .setResourceNameField("urlMap") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UrlMapsValidateResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteUrlMapCallable; private final UnaryCallable getUrlMapCallable; private final UnaryCallable insertUrlMapCallable; - private final UnaryCallable invalidateCacheUrlMapCallable; + private final UnaryCallable + invalidateCacheUrlMapCallable; private final UnaryCallable listUrlMapsCallable; - private final UnaryCallable listUrlMapsPagedCallable; + private final UnaryCallable + listUrlMapsPagedCallable; private final UnaryCallable patchUrlMapCallable; private final UnaryCallable updateUrlMapCallable; - private final UnaryCallable validateUrlMapCallable; + private final UnaryCallable + validateUrlMapCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonUrlMapStub create(UrlMapStubSettings settings) throws IOException { return new HttpJsonUrlMapStub(settings, ClientContext.create(settings)); } @@ -244,25 +245,32 @@ public static final HttpJsonUrlMapStub create(ClientContext clientContext) throw return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonUrlMapStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonUrlMapStub(UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonUrlMapStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonUrlMapStub( + UrlMapStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonUrlMapStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonUrlMapCallableFactory()); } /** - * Constructs an instance of HttpJsonUrlMapStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonUrlMapStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonUrlMapStub( + UrlMapStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings deleteUrlMapTransportSettings = @@ -277,10 +285,11 @@ protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientCo HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertUrlMapMethodDescriptor) .build(); - HttpJsonCallSettings invalidateCacheUrlMapTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) - .build(); + HttpJsonCallSettings + invalidateCacheUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(invalidateCacheUrlMapMethodDescriptor) + .build(); HttpJsonCallSettings listUrlMapsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listUrlMapsMethodDescriptor) @@ -293,20 +302,41 @@ protected HttpJsonUrlMapStub(UrlMapStubSettings settings, ClientContext clientCo HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateUrlMapMethodDescriptor) .build(); - HttpJsonCallSettings validateUrlMapTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(validateUrlMapMethodDescriptor) - .build(); + HttpJsonCallSettings + validateUrlMapTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(validateUrlMapMethodDescriptor) + .build(); - this.deleteUrlMapCallable = callableFactory.createUnaryCallable(deleteUrlMapTransportSettings,settings.deleteUrlMapSettings(), clientContext); - this.getUrlMapCallable = callableFactory.createUnaryCallable(getUrlMapTransportSettings,settings.getUrlMapSettings(), clientContext); - this.insertUrlMapCallable = callableFactory.createUnaryCallable(insertUrlMapTransportSettings,settings.insertUrlMapSettings(), clientContext); - this.invalidateCacheUrlMapCallable = callableFactory.createUnaryCallable(invalidateCacheUrlMapTransportSettings,settings.invalidateCacheUrlMapSettings(), clientContext); - this.listUrlMapsCallable = callableFactory.createUnaryCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); - this.listUrlMapsPagedCallable = callableFactory.createPagedCallable(listUrlMapsTransportSettings,settings.listUrlMapsSettings(), clientContext); - this.patchUrlMapCallable = callableFactory.createUnaryCallable(patchUrlMapTransportSettings,settings.patchUrlMapSettings(), clientContext); - this.updateUrlMapCallable = callableFactory.createUnaryCallable(updateUrlMapTransportSettings,settings.updateUrlMapSettings(), clientContext); - this.validateUrlMapCallable = callableFactory.createUnaryCallable(validateUrlMapTransportSettings,settings.validateUrlMapSettings(), clientContext); + this.deleteUrlMapCallable = + callableFactory.createUnaryCallable( + deleteUrlMapTransportSettings, settings.deleteUrlMapSettings(), clientContext); + this.getUrlMapCallable = + callableFactory.createUnaryCallable( + getUrlMapTransportSettings, settings.getUrlMapSettings(), clientContext); + this.insertUrlMapCallable = + callableFactory.createUnaryCallable( + insertUrlMapTransportSettings, settings.insertUrlMapSettings(), clientContext); + this.invalidateCacheUrlMapCallable = + callableFactory.createUnaryCallable( + invalidateCacheUrlMapTransportSettings, + settings.invalidateCacheUrlMapSettings(), + clientContext); + this.listUrlMapsCallable = + callableFactory.createUnaryCallable( + listUrlMapsTransportSettings, settings.listUrlMapsSettings(), clientContext); + this.listUrlMapsPagedCallable = + callableFactory.createPagedCallable( + listUrlMapsTransportSettings, settings.listUrlMapsSettings(), clientContext); + this.patchUrlMapCallable = + callableFactory.createUnaryCallable( + patchUrlMapTransportSettings, settings.patchUrlMapSettings(), clientContext); + this.updateUrlMapCallable = + callableFactory.createUnaryCallable( + updateUrlMapTransportSettings, settings.updateUrlMapSettings(), clientContext); + this.validateUrlMapCallable = + callableFactory.createUnaryCallable( + validateUrlMapTransportSettings, settings.validateUrlMapSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -327,12 +357,14 @@ public UnaryCallable insertUrlMapCallable() } @BetaApi - public UnaryCallable invalidateCacheUrlMapCallable() { + public UnaryCallable + invalidateCacheUrlMapCallable() { return invalidateCacheUrlMapCallable; } @BetaApi - public UnaryCallable listUrlMapsPagedCallable() { + public UnaryCallable + listUrlMapsPagedCallable() { return listUrlMapsPagedCallable; } @@ -352,12 +384,13 @@ public UnaryCallable updateUrlMapCallable() } @BetaApi - public UnaryCallable validateUrlMapCallable() { + public UnaryCallable + validateUrlMapCallable() { return validateUrlMapCallable; } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -385,5 +418,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java index cb0e4b0ae0cd..46c5165997bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java @@ -15,54 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; -import com.google.cloud.compute.v1.DeleteVpnTunnelHttpRequest; -import com.google.cloud.compute.v1.GetVpnTunnelHttpRequest; -import com.google.cloud.compute.v1.InsertVpnTunnelHttpRequest; -import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionVpnTunnelName; -import com.google.cloud.compute.v1.VpnTunnel; -import com.google.cloud.compute.v1.VpnTunnelAggregatedList; -import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; -import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; -import com.google.cloud.compute.v1.VpnTunnelList; -import com.google.cloud.compute.v1.VpnTunnelSettings; -import com.google.cloud.compute.v1.VpnTunnelsScopedList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -79,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -96,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java index af64a086aafa..76f5f0b07f8c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +29,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; @@ -40,17 +42,9 @@ import com.google.cloud.compute.v1.ProjectRegionVpnTunnelName; import com.google.cloud.compute.v1.VpnTunnel; import com.google.cloud.compute.v1.VpnTunnelAggregatedList; -import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; -import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; import com.google.cloud.compute.v1.VpnTunnelList; -import com.google.cloud.compute.v1.VpnTunnelSettings; -import com.google.cloud.compute.v1.VpnTunnelsScopedList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,116 +58,129 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonVpnTunnelStub extends VpnTunnelStub { @InternalApi - public static final ApiMethodDescriptor aggregatedListVpnTunnelsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.vpnTunnels.aggregatedList") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/aggregated/vpnTunnels")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(VpnTunnelAggregatedList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor< + AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList> + aggregatedListVpnTunnelsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.vpnTunnels.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/aggregated/vpnTunnels")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VpnTunnelAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor deleteVpnTunnelMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.vpnTunnels.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionVpnTunnelName.newFactory()) - .setResourceNameField("vpnTunnel") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + deleteVpnTunnelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionVpnTunnelName.newFactory()) + .setResourceNameField("vpnTunnel") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getVpnTunnelMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.vpnTunnels.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetVpnTunnelHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectRegionVpnTunnelName.newFactory()) - .setResourceNameField("vpnTunnel") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(VpnTunnel.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getVpnTunnelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetVpnTunnelHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionVpnTunnelName.newFactory()) + .setResourceNameField("vpnTunnel") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VpnTunnel.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor insertVpnTunnelMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.vpnTunnels.insert") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) - .setQueryParams(Sets.newHashSet( - "requestId" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + insertVpnTunnelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listVpnTunnelsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.vpnTunnels.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListVpnTunnelsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectRegionName.newFactory()) - .setResourceNameField("region") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(VpnTunnelList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listVpnTunnelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.vpnTunnels.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListVpnTunnelsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VpnTunnelList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; - private final UnaryCallable aggregatedListVpnTunnelsCallable; - private final UnaryCallable aggregatedListVpnTunnelsPagedCallable; + private final UnaryCallable + aggregatedListVpnTunnelsCallable; + private final UnaryCallable< + AggregatedListVpnTunnelsHttpRequest, AggregatedListVpnTunnelsPagedResponse> + aggregatedListVpnTunnelsPagedCallable; private final UnaryCallable deleteVpnTunnelCallable; private final UnaryCallable getVpnTunnelCallable; private final UnaryCallable insertVpnTunnelCallable; private final UnaryCallable listVpnTunnelsCallable; - private final UnaryCallable listVpnTunnelsPagedCallable; + private final UnaryCallable + listVpnTunnelsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonVpnTunnelStub create(VpnTunnelStubSettings settings) throws IOException { + + public static final HttpJsonVpnTunnelStub create(VpnTunnelStubSettings settings) + throws IOException { return new HttpJsonVpnTunnelStub(settings, ClientContext.create(settings)); } @@ -181,31 +188,40 @@ public static final HttpJsonVpnTunnelStub create(ClientContext clientContext) th return new HttpJsonVpnTunnelStub(VpnTunnelStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonVpnTunnelStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonVpnTunnelStub(VpnTunnelStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonVpnTunnelStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonVpnTunnelStub( + VpnTunnelStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonVpnTunnelStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonVpnTunnelStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonVpnTunnelStub(VpnTunnelStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonVpnTunnelStub(VpnTunnelStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonVpnTunnelCallableFactory()); } /** - * Constructs an instance of HttpJsonVpnTunnelStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonVpnTunnelStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ - protected HttpJsonVpnTunnelStub(VpnTunnelStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonVpnTunnelStub( + VpnTunnelStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings aggregatedListVpnTunnelsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(aggregatedListVpnTunnelsMethodDescriptor) - .build(); + HttpJsonCallSettings + aggregatedListVpnTunnelsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListVpnTunnelsMethodDescriptor) + .build(); HttpJsonCallSettings deleteVpnTunnelTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteVpnTunnelMethodDescriptor) @@ -223,24 +239,44 @@ protected HttpJsonVpnTunnelStub(VpnTunnelStubSettings settings, ClientContext cl .setMethodDescriptor(listVpnTunnelsMethodDescriptor) .build(); - this.aggregatedListVpnTunnelsCallable = callableFactory.createUnaryCallable(aggregatedListVpnTunnelsTransportSettings,settings.aggregatedListVpnTunnelsSettings(), clientContext); - this.aggregatedListVpnTunnelsPagedCallable = callableFactory.createPagedCallable(aggregatedListVpnTunnelsTransportSettings,settings.aggregatedListVpnTunnelsSettings(), clientContext); - this.deleteVpnTunnelCallable = callableFactory.createUnaryCallable(deleteVpnTunnelTransportSettings,settings.deleteVpnTunnelSettings(), clientContext); - this.getVpnTunnelCallable = callableFactory.createUnaryCallable(getVpnTunnelTransportSettings,settings.getVpnTunnelSettings(), clientContext); - this.insertVpnTunnelCallable = callableFactory.createUnaryCallable(insertVpnTunnelTransportSettings,settings.insertVpnTunnelSettings(), clientContext); - this.listVpnTunnelsCallable = callableFactory.createUnaryCallable(listVpnTunnelsTransportSettings,settings.listVpnTunnelsSettings(), clientContext); - this.listVpnTunnelsPagedCallable = callableFactory.createPagedCallable(listVpnTunnelsTransportSettings,settings.listVpnTunnelsSettings(), clientContext); + this.aggregatedListVpnTunnelsCallable = + callableFactory.createUnaryCallable( + aggregatedListVpnTunnelsTransportSettings, + settings.aggregatedListVpnTunnelsSettings(), + clientContext); + this.aggregatedListVpnTunnelsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListVpnTunnelsTransportSettings, + settings.aggregatedListVpnTunnelsSettings(), + clientContext); + this.deleteVpnTunnelCallable = + callableFactory.createUnaryCallable( + deleteVpnTunnelTransportSettings, settings.deleteVpnTunnelSettings(), clientContext); + this.getVpnTunnelCallable = + callableFactory.createUnaryCallable( + getVpnTunnelTransportSettings, settings.getVpnTunnelSettings(), clientContext); + this.insertVpnTunnelCallable = + callableFactory.createUnaryCallable( + insertVpnTunnelTransportSettings, settings.insertVpnTunnelSettings(), clientContext); + this.listVpnTunnelsCallable = + callableFactory.createUnaryCallable( + listVpnTunnelsTransportSettings, settings.listVpnTunnelsSettings(), clientContext); + this.listVpnTunnelsPagedCallable = + callableFactory.createPagedCallable( + listVpnTunnelsTransportSettings, settings.listVpnTunnelsSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @BetaApi - public UnaryCallable aggregatedListVpnTunnelsPagedCallable() { + public UnaryCallable + aggregatedListVpnTunnelsPagedCallable() { return aggregatedListVpnTunnelsPagedCallable; } @BetaApi - public UnaryCallable aggregatedListVpnTunnelsCallable() { + public UnaryCallable + aggregatedListVpnTunnelsCallable() { return aggregatedListVpnTunnelsCallable; } @@ -260,7 +296,8 @@ public UnaryCallable insertVpnTunnelCalla } @BetaApi - public UnaryCallable listVpnTunnelsPagedCallable() { + public UnaryCallable + listVpnTunnelsPagedCallable() { return listVpnTunnelsPagedCallable; } @@ -270,7 +307,7 @@ public UnaryCallable listVpnTunnelsCal } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -298,5 +335,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java index 2290fa468058..65c675b0f18c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java @@ -15,47 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.GetZoneHttpRequest; -import com.google.cloud.compute.v1.ListZonesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.Zone; -import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; -import com.google.cloud.compute.v1.ZoneList; -import com.google.cloud.compute.v1.ZoneSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -89,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java index 4faff1a7a862..cc7359ab0bce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java @@ -15,47 +15,15 @@ */ package com.google.cloud.compute.v1.stub; -import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; -import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; -import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; -import com.google.cloud.compute.v1.GetZoneOperationHttpRequest; -import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; -import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.ProjectZoneOperationName; -import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; -import com.google.cloud.compute.v1.ZoneOperationSettings; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,16 +40,18 @@ public UnaryCallable createUnaryCalla HttpJsonCallSettings httpJsonCallSettings, UnaryCallSettings callSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable(httpJsonCallSettings, callSettings, clientContext); + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); } @Override public UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable(httpJsonCallSettings, pagedCallSettings, clientContext); + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); } @Override @@ -89,6 +59,7 @@ public UnaryCallable createBatchingCa HttpJsonCallSettings httpJsonCallSettings, BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable(httpJsonCallSettings, batchingCallSettings, clientContext); + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java index 3bb63d2625c2..d80b6293be85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; @@ -36,14 +37,8 @@ import com.google.cloud.compute.v1.OperationList; import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.ProjectZoneOperationName; -import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; -import com.google.cloud.compute.v1.ZoneOperationSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -57,113 +52,147 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonZoneOperationStub extends ZoneOperationStub { @InternalApi - public static final ApiMethodDescriptor deleteZoneOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.zoneOperations.delete") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteZoneOperationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneOperationName.newFactory()) - .setResourceNameField("operation") - .build()) - .build(); + public static final ApiMethodDescriptor + deleteZoneOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zoneOperations.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteZoneOperationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor getZoneOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.zoneOperations.get") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetZoneOperationHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) - .setQueryParams(Sets.newHashSet( - )) - .setResourceNameFactory(ProjectZoneOperationName.newFactory()) - .setResourceNameField("operation") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(Operation.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + getZoneOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zoneOperations.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetZoneOperationHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneOperationName.newFactory()) + .setResourceNameField("operation") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi - public static final ApiMethodDescriptor listZoneOperationsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.zoneOperations.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListZoneOperationsHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectZoneName.newFactory()) - .setResourceNameField("zone") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(OperationList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listZoneOperationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zoneOperations.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListZoneOperationsHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(OperationList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteZoneOperationCallable; private final UnaryCallable getZoneOperationCallable; - private final UnaryCallable listZoneOperationsCallable; - private final UnaryCallable listZoneOperationsPagedCallable; + private final UnaryCallable + listZoneOperationsCallable; + private final UnaryCallable + listZoneOperationsPagedCallable; private final HttpJsonStubCallableFactory callableFactory; - public static final HttpJsonZoneOperationStub create(ZoneOperationStubSettings settings) throws IOException { + + public static final HttpJsonZoneOperationStub create(ZoneOperationStubSettings settings) + throws IOException { return new HttpJsonZoneOperationStub(settings, ClientContext.create(settings)); } - public static final HttpJsonZoneOperationStub create(ClientContext clientContext) throws IOException { - return new HttpJsonZoneOperationStub(ZoneOperationStubSettings.newBuilder().build(), clientContext); + public static final HttpJsonZoneOperationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonZoneOperationStub( + ZoneOperationStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonZoneOperationStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonZoneOperationStub(ZoneOperationStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonZoneOperationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonZoneOperationStub( + ZoneOperationStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonZoneOperationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonZoneOperationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonZoneOperationStub(ZoneOperationStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonZoneOperationStub( + ZoneOperationStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonZoneOperationCallableFactory()); } /** - * Constructs an instance of HttpJsonZoneOperationStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonZoneOperationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. */ - protected HttpJsonZoneOperationStub(ZoneOperationStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonZoneOperationStub( + ZoneOperationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; - HttpJsonCallSettings deleteZoneOperationTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteZoneOperationMethodDescriptor) - .build(); + HttpJsonCallSettings + deleteZoneOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteZoneOperationMethodDescriptor) + .build(); HttpJsonCallSettings getZoneOperationTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getZoneOperationMethodDescriptor) .build(); - HttpJsonCallSettings listZoneOperationsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listZoneOperationsMethodDescriptor) - .build(); - - this.deleteZoneOperationCallable = callableFactory.createUnaryCallable(deleteZoneOperationTransportSettings,settings.deleteZoneOperationSettings(), clientContext); - this.getZoneOperationCallable = callableFactory.createUnaryCallable(getZoneOperationTransportSettings,settings.getZoneOperationSettings(), clientContext); - this.listZoneOperationsCallable = callableFactory.createUnaryCallable(listZoneOperationsTransportSettings,settings.listZoneOperationsSettings(), clientContext); - this.listZoneOperationsPagedCallable = callableFactory.createPagedCallable(listZoneOperationsTransportSettings,settings.listZoneOperationsSettings(), clientContext); + HttpJsonCallSettings + listZoneOperationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listZoneOperationsMethodDescriptor) + .build(); + + this.deleteZoneOperationCallable = + callableFactory.createUnaryCallable( + deleteZoneOperationTransportSettings, + settings.deleteZoneOperationSettings(), + clientContext); + this.getZoneOperationCallable = + callableFactory.createUnaryCallable( + getZoneOperationTransportSettings, settings.getZoneOperationSettings(), clientContext); + this.listZoneOperationsCallable = + callableFactory.createUnaryCallable( + listZoneOperationsTransportSettings, + settings.listZoneOperationsSettings(), + clientContext); + this.listZoneOperationsPagedCallable = + callableFactory.createPagedCallable( + listZoneOperationsTransportSettings, + settings.listZoneOperationsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -179,7 +208,8 @@ public UnaryCallable getZoneOperationCal } @BetaApi - public UnaryCallable listZoneOperationsPagedCallable() { + public UnaryCallable + listZoneOperationsPagedCallable() { return listZoneOperationsPagedCallable; } @@ -189,7 +219,7 @@ public UnaryCallable listZoneOpera } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -217,5 +247,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java index 66e5deb10657..cc4daa6826ef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; + import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -26,7 +28,6 @@ import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.GetZoneHttpRequest; @@ -34,15 +35,9 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.Zone; -import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; import com.google.cloud.compute.v1.ZoneList; -import com.google.cloud.compute.v1.ZoneSettings; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -64,8 +59,7 @@ public class HttpJsonZoneStub extends ZoneStub { ApiMessageHttpRequestFormatter.newBuilder() .setRequestInstance(GetZoneHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}")) - .setQueryParams(Sets.newHashSet( - )) + .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneName.newFactory()) .setResourceNameField("zone") .build()) @@ -74,26 +68,28 @@ public class HttpJsonZoneStub extends ZoneStub { .setResponseInstance(Zone.getDefaultInstance()) .build()) .build(); + @InternalApi - public static final ApiMethodDescriptor listZonesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("compute.zones.list") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListZonesHttpRequest.getDefaultInstance()) - .setPathTemplate(PathTemplate.create("{project}/zones")) - .setQueryParams(Sets.newHashSet( - "filter", "maxResults", "orderBy", "pageToken" - )) - .setResourceNameFactory(ProjectName.newFactory()) - .setResourceNameField("project") - .build()) - .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(ZoneList.getDefaultInstance()) - .build()) - .build(); + public static final ApiMethodDescriptor + listZonesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.zones.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListZonesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/zones")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(ZoneList.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable getZoneCallable; @@ -101,6 +97,7 @@ public class HttpJsonZoneStub extends ZoneStub { private final UnaryCallable listZonesPagedCallable; private final HttpJsonStubCallableFactory callableFactory; + public static final HttpJsonZoneStub create(ZoneStubSettings settings) throws IOException { return new HttpJsonZoneStub(settings, ClientContext.create(settings)); } @@ -109,25 +106,30 @@ public static final HttpJsonZoneStub create(ClientContext clientContext) throws return new HttpJsonZoneStub(ZoneStubSettings.newBuilder().build(), clientContext); } - public static final HttpJsonZoneStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonZoneStub(ZoneStubSettings.newBuilder().build(), clientContext, callableFactory); + public static final HttpJsonZoneStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonZoneStub( + ZoneStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Constructs an instance of HttpJsonZoneStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonZoneStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. */ - protected HttpJsonZoneStub(ZoneStubSettings settings, ClientContext clientContext) throws IOException { + protected HttpJsonZoneStub(ZoneStubSettings settings, ClientContext clientContext) + throws IOException { this(settings, clientContext, new HttpJsonZoneCallableFactory()); } /** - * Constructs an instance of HttpJsonZoneStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of HttpJsonZoneStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. */ - protected HttpJsonZoneStub(ZoneStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + protected HttpJsonZoneStub( + ZoneStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings getZoneTransportSettings = @@ -139,9 +141,15 @@ protected HttpJsonZoneStub(ZoneStubSettings settings, ClientContext clientContex .setMethodDescriptor(listZonesMethodDescriptor) .build(); - this.getZoneCallable = callableFactory.createUnaryCallable(getZoneTransportSettings,settings.getZoneSettings(), clientContext); - this.listZonesCallable = callableFactory.createUnaryCallable(listZonesTransportSettings,settings.listZonesSettings(), clientContext); - this.listZonesPagedCallable = callableFactory.createPagedCallable(listZonesTransportSettings,settings.listZonesSettings(), clientContext); + this.getZoneCallable = + callableFactory.createUnaryCallable( + getZoneTransportSettings, settings.getZoneSettings(), clientContext); + this.listZonesCallable = + callableFactory.createUnaryCallable( + listZonesTransportSettings, settings.listZonesSettings(), clientContext); + this.listZonesPagedCallable = + callableFactory.createPagedCallable( + listZonesTransportSettings, settings.listZonesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -162,7 +170,7 @@ public UnaryCallable listZonesCallable() { } @Override - public final void close() throws Exception { + public final void close() { shutdown(); } @@ -190,5 +198,4 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index 2ab2bf21bb75..f6582569ef6a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -15,20 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpsHealthCheck; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.ProjectHttpsHealthCheckName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.UpdateHttpsHealthCheckHttpRequest; import javax.annotation.Generated; @@ -42,40 +41,49 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HttpsHealthCheckStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteHttpsHealthCheckCallable() { + public UnaryCallable + deleteHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: deleteHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable getHttpsHealthCheckCallable() { + public UnaryCallable + getHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable insertHttpsHealthCheckCallable() { + public UnaryCallable + insertHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: insertHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable listHttpsHealthChecksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksPagedCallable()"); + public UnaryCallable + listHttpsHealthChecksPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listHttpsHealthChecksPagedCallable()"); } @BetaApi - public UnaryCallable listHttpsHealthChecksCallable() { + public UnaryCallable + listHttpsHealthChecksCallable() { throw new UnsupportedOperationException("Not implemented: listHttpsHealthChecksCallable()"); } @BetaApi - public UnaryCallable patchHttpsHealthCheckCallable() { + public UnaryCallable + patchHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: patchHttpsHealthCheckCallable()"); } @BetaApi - public UnaryCallable updateHttpsHealthCheckCallable() { + public UnaryCallable + updateHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: updateHttpsHealthCheckCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java index 3ab0953a77e8..48faa8d142a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,11 +39,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.HttpsHealthCheck; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -56,10 +52,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteHttpsHealthCheck to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteHttpsHealthCheck to 30 seconds: * *

  * 
@@ -93,68 +87,70 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class HttpsHealthCheckStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteHttpsHealthCheckSettings;
-  private final UnaryCallSettings getHttpsHealthCheckSettings;
-  private final UnaryCallSettings insertHttpsHealthCheckSettings;
-  private final PagedCallSettings listHttpsHealthChecksSettings;
-  private final UnaryCallSettings patchHttpsHealthCheckSettings;
-  private final UnaryCallSettings updateHttpsHealthCheckSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteHttpsHealthCheck.
-   */
-  public UnaryCallSettings deleteHttpsHealthCheckSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteHttpsHealthCheckSettings;
+  private final UnaryCallSettings
+      getHttpsHealthCheckSettings;
+  private final UnaryCallSettings
+      insertHttpsHealthCheckSettings;
+  private final PagedCallSettings<
+          ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList,
+          ListHttpsHealthChecksPagedResponse>
+      listHttpsHealthChecksSettings;
+  private final UnaryCallSettings
+      patchHttpsHealthCheckSettings;
+  private final UnaryCallSettings
+      updateHttpsHealthCheckSettings;
+
+  /** Returns the object with the settings used for calls to deleteHttpsHealthCheck. */
+  public UnaryCallSettings
+      deleteHttpsHealthCheckSettings() {
     return deleteHttpsHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHttpsHealthCheck.
-   */
-  public UnaryCallSettings getHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to getHttpsHealthCheck. */
+  public UnaryCallSettings
+      getHttpsHealthCheckSettings() {
     return getHttpsHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertHttpsHealthCheck.
-   */
-  public UnaryCallSettings insertHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to insertHttpsHealthCheck. */
+  public UnaryCallSettings
+      insertHttpsHealthCheckSettings() {
     return insertHttpsHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listHttpsHealthChecks.
-   */
-  public PagedCallSettings listHttpsHealthChecksSettings() {
+  /** Returns the object with the settings used for calls to listHttpsHealthChecks. */
+  public PagedCallSettings<
+          ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList,
+          ListHttpsHealthChecksPagedResponse>
+      listHttpsHealthChecksSettings() {
     return listHttpsHealthChecksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchHttpsHealthCheck.
-   */
-  public UnaryCallSettings patchHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to patchHttpsHealthCheck. */
+  public UnaryCallSettings
+      patchHttpsHealthCheckSettings() {
     return patchHttpsHealthCheckSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateHttpsHealthCheck.
-   */
-  public UnaryCallSettings updateHttpsHealthCheckSettings() {
+  /** Returns the object with the settings used for calls to updateHttpsHealthCheck. */
+  public UnaryCallSettings
+      updateHttpsHealthCheckSettings() {
     return updateHttpsHealthCheckSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public HttpsHealthCheckStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +163,34 @@ public HttpsHealthCheckStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +201,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(HttpsHealthCheckStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(HttpsHealthCheckStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +234,100 @@ protected HttpsHealthCheckStubSettings(Builder settingsBuilder) throws IOExcepti
     updateHttpsHealthCheckSettings = settingsBuilder.updateHttpsHealthCheckSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListHttpsHealthChecksHttpRequest injectToken(ListHttpsHealthChecksHttpRequest payload, String token) {
-          return ListHttpsHealthChecksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListHttpsHealthChecksHttpRequest injectPageSize(ListHttpsHealthChecksHttpRequest payload, int pageSize) {
-          return ListHttpsHealthChecksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListHttpsHealthChecksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(HttpsHealthCheckList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(HttpsHealthCheckList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListHttpsHealthChecksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC, request, context);
-          return ListHttpsHealthChecksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for HttpsHealthCheckStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck>
+      LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListHttpsHealthChecksHttpRequest injectToken(
+                ListHttpsHealthChecksHttpRequest payload, String token) {
+              return ListHttpsHealthChecksHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListHttpsHealthChecksHttpRequest injectPageSize(
+                ListHttpsHealthChecksHttpRequest payload, int pageSize) {
+              return ListHttpsHealthChecksHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListHttpsHealthChecksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(HttpsHealthCheckList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(HttpsHealthCheckList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList,
+          ListHttpsHealthChecksPagedResponse>
+      LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList,
+              ListHttpsHealthChecksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListHttpsHealthChecksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC, request, context);
+              return ListHttpsHealthChecksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for HttpsHealthCheckStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteHttpsHealthCheckSettings;
-    private final UnaryCallSettings.Builder getHttpsHealthCheckSettings;
-    private final UnaryCallSettings.Builder insertHttpsHealthCheckSettings;
-    private final PagedCallSettings.Builder listHttpsHealthChecksSettings;
-    private final UnaryCallSettings.Builder patchHttpsHealthCheckSettings;
-    private final UnaryCallSettings.Builder updateHttpsHealthCheckSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteHttpsHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        getHttpsHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        insertHttpsHealthCheckSettings;
+    private final PagedCallSettings.Builder<
+            ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList,
+            ListHttpsHealthChecksPagedResponse>
+        listHttpsHealthChecksSettings;
+    private final UnaryCallSettings.Builder
+        patchHttpsHealthCheckSettings;
+    private final UnaryCallSettings.Builder
+        updateHttpsHealthCheckSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +336,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +363,21 @@ protected Builder(ClientContext clientContext) {
 
       insertHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listHttpsHealthChecksSettings = PagedCallSettings.newBuilder(
-          LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_FACT);
+      listHttpsHealthChecksSettings =
+          PagedCallSettings.newBuilder(LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_FACT);
 
       patchHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateHttpsHealthCheckSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteHttpsHealthCheckSettings,
-          getHttpsHealthCheckSettings,
-          insertHttpsHealthCheckSettings,
-          listHttpsHealthChecksSettings,
-          patchHttpsHealthCheckSettings,
-          updateHttpsHealthCheckSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteHttpsHealthCheckSettings,
+              getHttpsHealthCheckSettings,
+              insertHttpsHealthCheckSettings,
+              listHttpsHealthChecksSettings,
+              patchHttpsHealthCheckSettings,
+              updateHttpsHealthCheckSettings);
 
       initDefaults(this);
     }
@@ -390,27 +393,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteHttpsHealthCheckSettings()
+      builder
+          .deleteHttpsHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getHttpsHealthCheckSettings()
+      builder
+          .getHttpsHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertHttpsHealthCheckSettings()
+      builder
+          .insertHttpsHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listHttpsHealthChecksSettings()
+      builder
+          .listHttpsHealthChecksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchHttpsHealthCheckSettings()
+      builder
+          .patchHttpsHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateHttpsHealthCheckSettings()
+      builder
+          .updateHttpsHealthCheckSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +436,24 @@ protected Builder(HttpsHealthCheckStubSettings settings) {
       patchHttpsHealthCheckSettings = settings.patchHttpsHealthCheckSettings.toBuilder();
       updateHttpsHealthCheckSettings = settings.updateHttpsHealthCheckSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteHttpsHealthCheckSettings,
-          getHttpsHealthCheckSettings,
-          insertHttpsHealthCheckSettings,
-          listHttpsHealthChecksSettings,
-          patchHttpsHealthCheckSettings,
-          updateHttpsHealthCheckSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteHttpsHealthCheckSettings,
+              getHttpsHealthCheckSettings,
+              insertHttpsHealthCheckSettings,
+              listHttpsHealthChecksSettings,
+              patchHttpsHealthCheckSettings,
+              updateHttpsHealthCheckSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +462,41 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to deleteHttpsHealthCheck. */ + public UnaryCallSettings.Builder + deleteHttpsHealthCheckSettings() { return deleteHttpsHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to getHttpsHealthCheck. - */ - public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ + public UnaryCallSettings.Builder + getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to insertHttpsHealthCheck. - */ - public UnaryCallSettings.Builder insertHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to insertHttpsHealthCheck. */ + public UnaryCallSettings.Builder + insertHttpsHealthCheckSettings() { return insertHttpsHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to listHttpsHealthChecks. - */ - public PagedCallSettings.Builder listHttpsHealthChecksSettings() { + /** Returns the builder for the settings used for calls to listHttpsHealthChecks. */ + public PagedCallSettings.Builder< + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, + ListHttpsHealthChecksPagedResponse> + listHttpsHealthChecksSettings() { return listHttpsHealthChecksSettings; } - /** - * Returns the builder for the settings used for calls to patchHttpsHealthCheck. - */ - public UnaryCallSettings.Builder patchHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to patchHttpsHealthCheck. */ + public UnaryCallSettings.Builder + patchHttpsHealthCheckSettings() { return patchHttpsHealthCheckSettings; } - /** - * Returns the builder for the settings used for calls to updateHttpsHealthCheck. - */ - public UnaryCallSettings.Builder updateHttpsHealthCheckSettings() { + /** Returns the builder for the settings used for calls to updateHttpsHealthCheck. */ + public UnaryCallSettings.Builder + updateHttpsHealthCheckSettings() { return updateHttpsHealthCheckSettings; } @@ -498,4 +505,4 @@ public HttpsHealthCheckStubSettings build() throws IOException { return new HttpsHealthCheckStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java index 83fa80866769..15202cf60248 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java @@ -15,24 +15,20 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; -import com.google.cloud.compute.v1.DeprecationStatus; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; -import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.Image; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectFamilyName; -import com.google.cloud.compute.v1.ProjectImageName; -import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; import javax.annotation.Generated; @@ -46,7 +42,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ImageStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteImageCallable() { throw new UnsupportedOperationException("Not implemented: deleteImageCallable()"); @@ -87,4 +82,6 @@ public UnaryCallable setLabelsImageCallabl throw new UnsupportedOperationException("Not implemented: setLabelsImageCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java index 3889901a96e0..65e2bebc7464 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,13 +39,11 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; import com.google.cloud.compute.v1.Image; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; @@ -57,10 +53,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -71,15 +65,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteImage to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteImage to 30 seconds: * *

  * 
@@ -94,76 +88,62 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ImageStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteImageSettings;
   private final UnaryCallSettings deprecateImageSettings;
   private final UnaryCallSettings getImageSettings;
   private final UnaryCallSettings getFromFamilyImageSettings;
   private final UnaryCallSettings insertImageSettings;
-  private final PagedCallSettings listImagesSettings;
+  private final PagedCallSettings
+      listImagesSettings;
   private final UnaryCallSettings setLabelsImageSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteImage.
-   */
+  /** Returns the object with the settings used for calls to deleteImage. */
   public UnaryCallSettings deleteImageSettings() {
     return deleteImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deprecateImage.
-   */
+  /** Returns the object with the settings used for calls to deprecateImage. */
   public UnaryCallSettings deprecateImageSettings() {
     return deprecateImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getImage.
-   */
+  /** Returns the object with the settings used for calls to getImage. */
   public UnaryCallSettings getImageSettings() {
     return getImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getFromFamilyImage.
-   */
+  /** Returns the object with the settings used for calls to getFromFamilyImage. */
   public UnaryCallSettings getFromFamilyImageSettings() {
     return getFromFamilyImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertImage.
-   */
+  /** Returns the object with the settings used for calls to insertImage. */
   public UnaryCallSettings insertImageSettings() {
     return insertImageSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listImages.
-   */
-  public PagedCallSettings listImagesSettings() {
+  /** Returns the object with the settings used for calls to listImages. */
+  public PagedCallSettings
+      listImagesSettings() {
     return listImagesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsImage.
-   */
+  /** Returns the object with the settings used for calls to setLabelsImage. */
   public UnaryCallSettings setLabelsImageSettings() {
     return setLabelsImageSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ImageStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -176,47 +156,34 @@ public ImageStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -228,26 +195,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ImageStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -264,79 +227,87 @@ protected ImageStubSettings(Builder settingsBuilder) throws IOException {
     setLabelsImageSettings = settingsBuilder.setLabelsImageSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_IMAGES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) {
-          return ListImagesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListImagesHttpRequest injectPageSize(ListImagesHttpRequest payload, int pageSize) {
-          return ListImagesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListImagesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ImageList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ImageList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_IMAGES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListImagesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context);
-          return ListImagesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for ImageStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_IMAGES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListImagesHttpRequest injectToken(ListImagesHttpRequest payload, String token) {
+              return ListImagesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListImagesHttpRequest injectPageSize(
+                ListImagesHttpRequest payload, int pageSize) {
+              return ListImagesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListImagesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ImageList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(ImageList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListImagesHttpRequest, ImageList, ListImagesPagedResponse>
+      LIST_IMAGES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListImagesHttpRequest, ImageList, ListImagesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListImagesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_IMAGES_PAGE_STR_DESC, request, context);
+              return ListImagesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for ImageStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder deleteImageSettings;
-    private final UnaryCallSettings.Builder deprecateImageSettings;
+    private final UnaryCallSettings.Builder
+        deprecateImageSettings;
     private final UnaryCallSettings.Builder getImageSettings;
-    private final UnaryCallSettings.Builder getFromFamilyImageSettings;
+    private final UnaryCallSettings.Builder
+        getFromFamilyImageSettings;
     private final UnaryCallSettings.Builder insertImageSettings;
-    private final PagedCallSettings.Builder listImagesSettings;
-    private final UnaryCallSettings.Builder setLabelsImageSettings;
+    private final PagedCallSettings.Builder<
+            ListImagesHttpRequest, ImageList, ListImagesPagedResponse>
+        listImagesSettings;
+    private final UnaryCallSettings.Builder
+        setLabelsImageSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -345,15 +316,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -375,20 +347,19 @@ protected Builder(ClientContext clientContext) {
 
       insertImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listImagesSettings = PagedCallSettings.newBuilder(
-          LIST_IMAGES_PAGE_STR_FACT);
+      listImagesSettings = PagedCallSettings.newBuilder(LIST_IMAGES_PAGE_STR_FACT);
 
       setLabelsImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteImageSettings,
-          deprecateImageSettings,
-          getImageSettings,
-          getFromFamilyImageSettings,
-          insertImageSettings,
-          listImagesSettings,
-          setLabelsImageSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteImageSettings,
+              deprecateImageSettings,
+              getImageSettings,
+              getFromFamilyImageSettings,
+              insertImageSettings,
+              listImagesSettings,
+              setLabelsImageSettings);
 
       initDefaults(this);
     }
@@ -404,31 +375,38 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteImageSettings()
+      builder
+          .deleteImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deprecateImageSettings()
+      builder
+          .deprecateImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getImageSettings()
+      builder
+          .getImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getFromFamilyImageSettings()
+      builder
+          .getFromFamilyImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertImageSettings()
+      builder
+          .insertImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listImagesSettings()
+      builder
+          .listImagesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setLabelsImageSettings()
+      builder
+          .setLabelsImageSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -446,23 +424,25 @@ protected Builder(ImageStubSettings settings) {
       listImagesSettings = settings.listImagesSettings.toBuilder();
       setLabelsImageSettings = settings.setLabelsImageSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteImageSettings,
-          deprecateImageSettings,
-          getImageSettings,
-          getFromFamilyImageSettings,
-          insertImageSettings,
-          listImagesSettings,
-          setLabelsImageSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteImageSettings,
+              deprecateImageSettings,
+              getImageSettings,
+              getFromFamilyImageSettings,
+              insertImageSettings,
+              listImagesSettings,
+              setLabelsImageSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -471,52 +451,42 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteImageSettings() { return deleteImageSettings; } - /** - * Returns the builder for the settings used for calls to deprecateImage. - */ - public UnaryCallSettings.Builder deprecateImageSettings() { + /** Returns the builder for the settings used for calls to deprecateImage. */ + public UnaryCallSettings.Builder + deprecateImageSettings() { return deprecateImageSettings; } - /** - * Returns the builder for the settings used for calls to getImage. - */ + /** Returns the builder for the settings used for calls to getImage. */ public UnaryCallSettings.Builder getImageSettings() { return getImageSettings; } - /** - * Returns the builder for the settings used for calls to getFromFamilyImage. - */ - public UnaryCallSettings.Builder getFromFamilyImageSettings() { + /** Returns the builder for the settings used for calls to getFromFamilyImage. */ + public UnaryCallSettings.Builder + getFromFamilyImageSettings() { return getFromFamilyImageSettings; } - /** - * Returns the builder for the settings used for calls to insertImage. - */ + /** Returns the builder for the settings used for calls to insertImage. */ public UnaryCallSettings.Builder insertImageSettings() { return insertImageSettings; } - /** - * Returns the builder for the settings used for calls to listImages. - */ - public PagedCallSettings.Builder listImagesSettings() { + /** Returns the builder for the settings used for calls to listImages. */ + public PagedCallSettings.Builder + listImagesSettings() { return listImagesSettings; } - /** - * Returns the builder for the settings used for calls to setLabelsImage. - */ - public UnaryCallSettings.Builder setLabelsImageSettings() { + /** Returns the builder for the settings used for calls to setLabelsImage. */ + public UnaryCallSettings.Builder + setLabelsImageSettings() { return setLabelsImageSettings; } @@ -525,4 +495,4 @@ public ImageStubSettings build() throws IOException { return new ImageStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java index a6cf4123ee89..e76060e16f24 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -26,22 +29,11 @@ import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.InstanceGroupManager; import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.InstanceGroupManagerList; -import com.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; -import com.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; -import com.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; -import com.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneInstanceGroupManagerName; -import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; @@ -58,75 +50,107 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceGroupManagerStub implements BackgroundResource { - @BetaApi - public UnaryCallable abandonInstancesInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: abandonInstancesInstanceGroupManagerCallable()"); + public UnaryCallable + abandonInstancesInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: abandonInstancesInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable aggregatedListInstanceGroupManagersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupManagersPagedCallable()"); + public UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInstanceGroupManagersPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListInstanceGroupManagersCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupManagersCallable()"); + public UnaryCallable< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList> + aggregatedListInstanceGroupManagersCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInstanceGroupManagersCallable()"); } @BetaApi - public UnaryCallable deleteInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: deleteInstanceGroupManagerCallable()"); + public UnaryCallable + deleteInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable deleteInstancesInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: deleteInstancesInstanceGroupManagerCallable()"); + public UnaryCallable + deleteInstancesInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteInstancesInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable getInstanceGroupManagerCallable() { + public UnaryCallable + getInstanceGroupManagerCallable() { throw new UnsupportedOperationException("Not implemented: getInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable insertInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: insertInstanceGroupManagerCallable()"); + public UnaryCallable + insertInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: insertInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable listInstanceGroupManagersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listInstanceGroupManagersPagedCallable()"); + public UnaryCallable + listInstanceGroupManagersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInstanceGroupManagersPagedCallable()"); } @BetaApi - public UnaryCallable listInstanceGroupManagersCallable() { + public UnaryCallable + listInstanceGroupManagersCallable() { throw new UnsupportedOperationException("Not implemented: listInstanceGroupManagersCallable()"); } @BetaApi - public UnaryCallable listManagedInstancesInstanceGroupManagersCallable() { - throw new UnsupportedOperationException("Not implemented: listManagedInstancesInstanceGroupManagersCallable()"); + public UnaryCallable< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersCallable() { + throw new UnsupportedOperationException( + "Not implemented: listManagedInstancesInstanceGroupManagersCallable()"); } @BetaApi - public UnaryCallable recreateInstancesInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: recreateInstancesInstanceGroupManagerCallable()"); + public UnaryCallable + recreateInstancesInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: recreateInstancesInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable resizeInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: resizeInstanceGroupManagerCallable()"); + public UnaryCallable + resizeInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: resizeInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable setInstanceTemplateInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: setInstanceTemplateInstanceGroupManagerCallable()"); + public UnaryCallable + setInstanceTemplateInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: setInstanceTemplateInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable setTargetPoolsInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: setTargetPoolsInstanceGroupManagerCallable()"); + public UnaryCallable + setTargetPoolsInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: setTargetPoolsInstanceGroupManagerCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java index 2810f512f51e..53f44e79f13a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.AggregatedListInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceGroupManagerHttpRequest; @@ -50,8 +48,6 @@ import com.google.cloud.compute.v1.InsertInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.InstanceGroupManager; import com.google.cloud.compute.v1.InstanceGroupManagerAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.InstanceGroupManagerList; import com.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; import com.google.cloud.compute.v1.InstanceGroupManagersScopedList; @@ -66,10 +62,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -80,15 +74,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of abandonInstancesInstanceGroupManager to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of abandonInstancesInstanceGroupManager to 30 seconds: * *

  * 
@@ -102,117 +96,137 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class InstanceGroupManagerStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings abandonInstancesInstanceGroupManagerSettings;
-  private final PagedCallSettings aggregatedListInstanceGroupManagersSettings;
-  private final UnaryCallSettings deleteInstanceGroupManagerSettings;
-  private final UnaryCallSettings deleteInstancesInstanceGroupManagerSettings;
-  private final UnaryCallSettings getInstanceGroupManagerSettings;
-  private final UnaryCallSettings insertInstanceGroupManagerSettings;
-  private final PagedCallSettings listInstanceGroupManagersSettings;
-  private final UnaryCallSettings listManagedInstancesInstanceGroupManagersSettings;
-  private final UnaryCallSettings recreateInstancesInstanceGroupManagerSettings;
-  private final UnaryCallSettings resizeInstanceGroupManagerSettings;
-  private final UnaryCallSettings setInstanceTemplateInstanceGroupManagerSettings;
-  private final UnaryCallSettings setTargetPoolsInstanceGroupManagerSettings;
+public class InstanceGroupManagerStubSettings
+    extends StubSettings {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      abandonInstancesInstanceGroupManagerSettings;
+  private final PagedCallSettings<
+          AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+          AggregatedListInstanceGroupManagersPagedResponse>
+      aggregatedListInstanceGroupManagersSettings;
+  private final UnaryCallSettings
+      deleteInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      deleteInstancesInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      getInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      insertInstanceGroupManagerSettings;
+  private final PagedCallSettings<
+          ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+          ListInstanceGroupManagersPagedResponse>
+      listInstanceGroupManagersSettings;
+  private final UnaryCallSettings<
+          ListManagedInstancesInstanceGroupManagersHttpRequest,
+          InstanceGroupManagersListManagedInstancesResponse>
+      listManagedInstancesInstanceGroupManagersSettings;
+  private final UnaryCallSettings
+      recreateInstancesInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      resizeInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      setInstanceTemplateInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      setTargetPoolsInstanceGroupManagerSettings;
 
   /**
    * Returns the object with the settings used for calls to abandonInstancesInstanceGroupManager.
    */
-  public UnaryCallSettings abandonInstancesInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      abandonInstancesInstanceGroupManagerSettings() {
     return abandonInstancesInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstanceGroupManagers.
-   */
-  public PagedCallSettings aggregatedListInstanceGroupManagersSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListInstanceGroupManagers. */
+  public PagedCallSettings<
+          AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+          AggregatedListInstanceGroupManagersPagedResponse>
+      aggregatedListInstanceGroupManagersSettings() {
     return aggregatedListInstanceGroupManagersSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceGroupManager.
-   */
-  public UnaryCallSettings deleteInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to deleteInstanceGroupManager. */
+  public UnaryCallSettings
+      deleteInstanceGroupManagerSettings() {
     return deleteInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstancesInstanceGroupManager.
-   */
-  public UnaryCallSettings deleteInstancesInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to deleteInstancesInstanceGroupManager. */
+  public UnaryCallSettings
+      deleteInstancesInstanceGroupManagerSettings() {
     return deleteInstancesInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceGroupManager.
-   */
-  public UnaryCallSettings getInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to getInstanceGroupManager. */
+  public UnaryCallSettings
+      getInstanceGroupManagerSettings() {
     return getInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceGroupManager.
-   */
-  public UnaryCallSettings insertInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to insertInstanceGroupManager. */
+  public UnaryCallSettings
+      insertInstanceGroupManagerSettings() {
     return insertInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceGroupManagers.
-   */
-  public PagedCallSettings listInstanceGroupManagersSettings() {
+  /** Returns the object with the settings used for calls to listInstanceGroupManagers. */
+  public PagedCallSettings<
+          ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+          ListInstanceGroupManagersPagedResponse>
+      listInstanceGroupManagersSettings() {
     return listInstanceGroupManagersSettings;
   }
 
   /**
-   * Returns the object with the settings used for calls to listManagedInstancesInstanceGroupManagers.
+   * Returns the object with the settings used for calls to
+   * listManagedInstancesInstanceGroupManagers.
    */
-  public UnaryCallSettings listManagedInstancesInstanceGroupManagersSettings() {
+  public UnaryCallSettings<
+          ListManagedInstancesInstanceGroupManagersHttpRequest,
+          InstanceGroupManagersListManagedInstancesResponse>
+      listManagedInstancesInstanceGroupManagersSettings() {
     return listManagedInstancesInstanceGroupManagersSettings;
   }
 
   /**
    * Returns the object with the settings used for calls to recreateInstancesInstanceGroupManager.
    */
-  public UnaryCallSettings recreateInstancesInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      recreateInstancesInstanceGroupManagerSettings() {
     return recreateInstancesInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeInstanceGroupManager.
-   */
-  public UnaryCallSettings resizeInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to resizeInstanceGroupManager. */
+  public UnaryCallSettings
+      resizeInstanceGroupManagerSettings() {
     return resizeInstanceGroupManagerSettings;
   }
 
   /**
    * Returns the object with the settings used for calls to setInstanceTemplateInstanceGroupManager.
    */
-  public UnaryCallSettings setInstanceTemplateInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      setInstanceTemplateInstanceGroupManagerSettings() {
     return setInstanceTemplateInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTargetPoolsInstanceGroupManager.
-   */
-  public UnaryCallSettings setTargetPoolsInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to setTargetPoolsInstanceGroupManager. */
+  public UnaryCallSettings
+      setTargetPoolsInstanceGroupManagerSettings() {
     return setTargetPoolsInstanceGroupManagerSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InstanceGroupManagerStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -225,47 +239,34 @@ public InstanceGroupManagerStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -276,27 +277,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceGroupManagerStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(InstanceGroupManagerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -304,146 +302,229 @@ public Builder toBuilder() {
   protected InstanceGroupManagerStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    abandonInstancesInstanceGroupManagerSettings = settingsBuilder.abandonInstancesInstanceGroupManagerSettings().build();
-    aggregatedListInstanceGroupManagersSettings = settingsBuilder.aggregatedListInstanceGroupManagersSettings().build();
-    deleteInstanceGroupManagerSettings = settingsBuilder.deleteInstanceGroupManagerSettings().build();
-    deleteInstancesInstanceGroupManagerSettings = settingsBuilder.deleteInstancesInstanceGroupManagerSettings().build();
+    abandonInstancesInstanceGroupManagerSettings =
+        settingsBuilder.abandonInstancesInstanceGroupManagerSettings().build();
+    aggregatedListInstanceGroupManagersSettings =
+        settingsBuilder.aggregatedListInstanceGroupManagersSettings().build();
+    deleteInstanceGroupManagerSettings =
+        settingsBuilder.deleteInstanceGroupManagerSettings().build();
+    deleteInstancesInstanceGroupManagerSettings =
+        settingsBuilder.deleteInstancesInstanceGroupManagerSettings().build();
     getInstanceGroupManagerSettings = settingsBuilder.getInstanceGroupManagerSettings().build();
-    insertInstanceGroupManagerSettings = settingsBuilder.insertInstanceGroupManagerSettings().build();
+    insertInstanceGroupManagerSettings =
+        settingsBuilder.insertInstanceGroupManagerSettings().build();
     listInstanceGroupManagersSettings = settingsBuilder.listInstanceGroupManagersSettings().build();
-    listManagedInstancesInstanceGroupManagersSettings = settingsBuilder.listManagedInstancesInstanceGroupManagersSettings().build();
-    recreateInstancesInstanceGroupManagerSettings = settingsBuilder.recreateInstancesInstanceGroupManagerSettings().build();
-    resizeInstanceGroupManagerSettings = settingsBuilder.resizeInstanceGroupManagerSettings().build();
-    setInstanceTemplateInstanceGroupManagerSettings = settingsBuilder.setInstanceTemplateInstanceGroupManagerSettings().build();
-    setTargetPoolsInstanceGroupManagerSettings = settingsBuilder.setTargetPoolsInstanceGroupManagerSettings().build();
+    listManagedInstancesInstanceGroupManagersSettings =
+        settingsBuilder.listManagedInstancesInstanceGroupManagersSettings().build();
+    recreateInstancesInstanceGroupManagerSettings =
+        settingsBuilder.recreateInstancesInstanceGroupManagerSettings().build();
+    resizeInstanceGroupManagerSettings =
+        settingsBuilder.resizeInstanceGroupManagerSettings().build();
+    setInstanceTemplateInstanceGroupManagerSettings =
+        settingsBuilder.setInstanceTemplateInstanceGroupManagerSettings().build();
+    setTargetPoolsInstanceGroupManagerSettings =
+        settingsBuilder.setTargetPoolsInstanceGroupManagerSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListInstanceGroupManagersHttpRequest injectToken(AggregatedListInstanceGroupManagersHttpRequest payload, String token) {
-          return AggregatedListInstanceGroupManagersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListInstanceGroupManagersHttpRequest injectPageSize(AggregatedListInstanceGroupManagersHttpRequest payload, int pageSize) {
-          return AggregatedListInstanceGroupManagersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListInstanceGroupManagersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceGroupManagerAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceGroupManagerAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInstanceGroupManagersHttpRequest injectToken(ListInstanceGroupManagersHttpRequest payload, String token) {
-          return ListInstanceGroupManagersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInstanceGroupManagersHttpRequest injectPageSize(ListInstanceGroupManagersHttpRequest payload, int pageSize) {
-          return ListInstanceGroupManagersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInstanceGroupManagersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceGroupManagerList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceGroupManagerList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListInstanceGroupManagersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context);
-          return AggregatedListInstanceGroupManagersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInstanceGroupManagersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context);
-          return ListInstanceGroupManagersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InstanceGroupManagerStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+          InstanceGroupManagersScopedList>
+      AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+              InstanceGroupManagersScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListInstanceGroupManagersHttpRequest injectToken(
+                AggregatedListInstanceGroupManagersHttpRequest payload, String token) {
+              return AggregatedListInstanceGroupManagersHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListInstanceGroupManagersHttpRequest injectPageSize(
+                AggregatedListInstanceGroupManagersHttpRequest payload, int pageSize) {
+              return AggregatedListInstanceGroupManagersHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListInstanceGroupManagersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceGroupManagerAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InstanceGroupManagerAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, InstanceGroupManager>
+      LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+              InstanceGroupManager>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInstanceGroupManagersHttpRequest injectToken(
+                ListInstanceGroupManagersHttpRequest payload, String token) {
+              return ListInstanceGroupManagersHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListInstanceGroupManagersHttpRequest injectPageSize(
+                ListInstanceGroupManagersHttpRequest payload, int pageSize) {
+              return ListInstanceGroupManagersHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInstanceGroupManagersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceGroupManagerList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InstanceGroupManagerList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+          AggregatedListInstanceGroupManagersPagedResponse>
+      AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+              AggregatedListInstanceGroupManagersPagedResponse>() {
+            @Override
+            public ApiFuture
+                getFuturePagedResponse(
+                    UnaryCallable<
+                            AggregatedListInstanceGroupManagersHttpRequest,
+                            InstanceGroupManagerAggregatedList>
+                        callable,
+                    AggregatedListInstanceGroupManagersHttpRequest request,
+                    ApiCallContext context,
+                    ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListInstanceGroupManagersHttpRequest,
+                      InstanceGroupManagerAggregatedList, InstanceGroupManagersScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListInstanceGroupManagersPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+          ListInstanceGroupManagersPagedResponse>
+      LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+              ListInstanceGroupManagersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                ListInstanceGroupManagersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+                      InstanceGroupManager>
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context);
+              return ListInstanceGroupManagersPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InstanceGroupManagerStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder abandonInstancesInstanceGroupManagerSettings;
-    private final PagedCallSettings.Builder aggregatedListInstanceGroupManagersSettings;
-    private final UnaryCallSettings.Builder deleteInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder deleteInstancesInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder getInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder insertInstanceGroupManagerSettings;
-    private final PagedCallSettings.Builder listInstanceGroupManagersSettings;
-    private final UnaryCallSettings.Builder listManagedInstancesInstanceGroupManagersSettings;
-    private final UnaryCallSettings.Builder recreateInstancesInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder resizeInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder setInstanceTemplateInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder setTargetPoolsInstanceGroupManagerSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder<
+            AbandonInstancesInstanceGroupManagerHttpRequest, Operation>
+        abandonInstancesInstanceGroupManagerSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList,
+            AggregatedListInstanceGroupManagersPagedResponse>
+        aggregatedListInstanceGroupManagersSettings;
+    private final UnaryCallSettings.Builder
+        deleteInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            DeleteInstancesInstanceGroupManagerHttpRequest, Operation>
+        deleteInstancesInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            GetInstanceGroupManagerHttpRequest, InstanceGroupManager>
+        getInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder
+        insertInstanceGroupManagerSettings;
+    private final PagedCallSettings.Builder<
+            ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList,
+            ListInstanceGroupManagersPagedResponse>
+        listInstanceGroupManagersSettings;
+    private final UnaryCallSettings.Builder<
+            ListManagedInstancesInstanceGroupManagersHttpRequest,
+            InstanceGroupManagersListManagedInstancesResponse>
+        listManagedInstancesInstanceGroupManagersSettings;
+    private final UnaryCallSettings.Builder<
+            RecreateInstancesInstanceGroupManagerHttpRequest, Operation>
+        recreateInstancesInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder
+        resizeInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            SetInstanceTemplateInstanceGroupManagerHttpRequest, Operation>
+        setInstanceTemplateInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            SetTargetPoolsInstanceGroupManagerHttpRequest, Operation>
+        setTargetPoolsInstanceGroupManagerSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -452,15 +533,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -472,10 +554,11 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      abandonInstancesInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      abandonInstancesInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      aggregatedListInstanceGroupManagersSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT);
+      aggregatedListInstanceGroupManagersSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT);
 
       deleteInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -485,33 +568,36 @@ protected Builder(ClientContext clientContext) {
 
       insertInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInstanceGroupManagersSettings = PagedCallSettings.newBuilder(
-          LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT);
+      listInstanceGroupManagersSettings =
+          PagedCallSettings.newBuilder(LIST_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT);
 
-      listManagedInstancesInstanceGroupManagersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      listManagedInstancesInstanceGroupManagersSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      recreateInstancesInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      recreateInstancesInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       resizeInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      setInstanceTemplateInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      setInstanceTemplateInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       setTargetPoolsInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          abandonInstancesInstanceGroupManagerSettings,
-          aggregatedListInstanceGroupManagersSettings,
-          deleteInstanceGroupManagerSettings,
-          deleteInstancesInstanceGroupManagerSettings,
-          getInstanceGroupManagerSettings,
-          insertInstanceGroupManagerSettings,
-          listInstanceGroupManagersSettings,
-          listManagedInstancesInstanceGroupManagersSettings,
-          recreateInstancesInstanceGroupManagerSettings,
-          resizeInstanceGroupManagerSettings,
-          setInstanceTemplateInstanceGroupManagerSettings,
-          setTargetPoolsInstanceGroupManagerSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              abandonInstancesInstanceGroupManagerSettings,
+              aggregatedListInstanceGroupManagersSettings,
+              deleteInstanceGroupManagerSettings,
+              deleteInstancesInstanceGroupManagerSettings,
+              getInstanceGroupManagerSettings,
+              insertInstanceGroupManagerSettings,
+              listInstanceGroupManagersSettings,
+              listManagedInstancesInstanceGroupManagersSettings,
+              recreateInstancesInstanceGroupManagerSettings,
+              resizeInstanceGroupManagerSettings,
+              setInstanceTemplateInstanceGroupManagerSettings,
+              setTargetPoolsInstanceGroupManagerSettings);
 
       initDefaults(this);
     }
@@ -527,51 +613,63 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.abandonInstancesInstanceGroupManagerSettings()
+      builder
+          .abandonInstancesInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.aggregatedListInstanceGroupManagersSettings()
+      builder
+          .aggregatedListInstanceGroupManagersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteInstanceGroupManagerSettings()
+      builder
+          .deleteInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteInstancesInstanceGroupManagerSettings()
+      builder
+          .deleteInstancesInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getInstanceGroupManagerSettings()
+      builder
+          .getInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertInstanceGroupManagerSettings()
+      builder
+          .insertInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInstanceGroupManagersSettings()
+      builder
+          .listInstanceGroupManagersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listManagedInstancesInstanceGroupManagersSettings()
+      builder
+          .listManagedInstancesInstanceGroupManagersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.recreateInstancesInstanceGroupManagerSettings()
+      builder
+          .recreateInstancesInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.resizeInstanceGroupManagerSettings()
+      builder
+          .resizeInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setInstanceTemplateInstanceGroupManagerSettings()
+      builder
+          .setInstanceTemplateInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setTargetPoolsInstanceGroupManagerSettings()
+      builder
+          .setTargetPoolsInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -581,41 +679,50 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(InstanceGroupManagerStubSettings settings) {
       super(settings);
 
-      abandonInstancesInstanceGroupManagerSettings = settings.abandonInstancesInstanceGroupManagerSettings.toBuilder();
-      aggregatedListInstanceGroupManagersSettings = settings.aggregatedListInstanceGroupManagersSettings.toBuilder();
+      abandonInstancesInstanceGroupManagerSettings =
+          settings.abandonInstancesInstanceGroupManagerSettings.toBuilder();
+      aggregatedListInstanceGroupManagersSettings =
+          settings.aggregatedListInstanceGroupManagersSettings.toBuilder();
       deleteInstanceGroupManagerSettings = settings.deleteInstanceGroupManagerSettings.toBuilder();
-      deleteInstancesInstanceGroupManagerSettings = settings.deleteInstancesInstanceGroupManagerSettings.toBuilder();
+      deleteInstancesInstanceGroupManagerSettings =
+          settings.deleteInstancesInstanceGroupManagerSettings.toBuilder();
       getInstanceGroupManagerSettings = settings.getInstanceGroupManagerSettings.toBuilder();
       insertInstanceGroupManagerSettings = settings.insertInstanceGroupManagerSettings.toBuilder();
       listInstanceGroupManagersSettings = settings.listInstanceGroupManagersSettings.toBuilder();
-      listManagedInstancesInstanceGroupManagersSettings = settings.listManagedInstancesInstanceGroupManagersSettings.toBuilder();
-      recreateInstancesInstanceGroupManagerSettings = settings.recreateInstancesInstanceGroupManagerSettings.toBuilder();
+      listManagedInstancesInstanceGroupManagersSettings =
+          settings.listManagedInstancesInstanceGroupManagersSettings.toBuilder();
+      recreateInstancesInstanceGroupManagerSettings =
+          settings.recreateInstancesInstanceGroupManagerSettings.toBuilder();
       resizeInstanceGroupManagerSettings = settings.resizeInstanceGroupManagerSettings.toBuilder();
-      setInstanceTemplateInstanceGroupManagerSettings = settings.setInstanceTemplateInstanceGroupManagerSettings.toBuilder();
-      setTargetPoolsInstanceGroupManagerSettings = settings.setTargetPoolsInstanceGroupManagerSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          abandonInstancesInstanceGroupManagerSettings,
-          aggregatedListInstanceGroupManagersSettings,
-          deleteInstanceGroupManagerSettings,
-          deleteInstancesInstanceGroupManagerSettings,
-          getInstanceGroupManagerSettings,
-          insertInstanceGroupManagerSettings,
-          listInstanceGroupManagersSettings,
-          listManagedInstancesInstanceGroupManagersSettings,
-          recreateInstancesInstanceGroupManagerSettings,
-          resizeInstanceGroupManagerSettings,
-          setInstanceTemplateInstanceGroupManagerSettings,
-          setTargetPoolsInstanceGroupManagerSettings
-      );
+      setInstanceTemplateInstanceGroupManagerSettings =
+          settings.setInstanceTemplateInstanceGroupManagerSettings.toBuilder();
+      setTargetPoolsInstanceGroupManagerSettings =
+          settings.setTargetPoolsInstanceGroupManagerSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              abandonInstancesInstanceGroupManagerSettings,
+              aggregatedListInstanceGroupManagersSettings,
+              deleteInstanceGroupManagerSettings,
+              deleteInstancesInstanceGroupManagerSettings,
+              getInstanceGroupManagerSettings,
+              insertInstanceGroupManagerSettings,
+              listInstanceGroupManagersSettings,
+              listManagedInstancesInstanceGroupManagersSettings,
+              recreateInstancesInstanceGroupManagerSettings,
+              resizeInstanceGroupManagerSettings,
+              setInstanceTemplateInstanceGroupManagerSettings,
+              setTargetPoolsInstanceGroupManagerSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -627,84 +734,94 @@ public Builder applyToAllUnaryMethods(ApiFunction abandonInstancesInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + abandonInstancesInstanceGroupManagerSettings() { return abandonInstancesInstanceGroupManagerSettings; } /** * Returns the builder for the settings used for calls to aggregatedListInstanceGroupManagers. */ - public PagedCallSettings.Builder aggregatedListInstanceGroupManagersSettings() { + public PagedCallSettings.Builder< + AggregatedListInstanceGroupManagersHttpRequest, InstanceGroupManagerAggregatedList, + AggregatedListInstanceGroupManagersPagedResponse> + aggregatedListInstanceGroupManagersSettings() { return aggregatedListInstanceGroupManagersSettings; } - /** - * Returns the builder for the settings used for calls to deleteInstanceGroupManager. - */ - public UnaryCallSettings.Builder deleteInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceGroupManager. */ + public UnaryCallSettings.Builder + deleteInstanceGroupManagerSettings() { return deleteInstanceGroupManagerSettings; } /** * Returns the builder for the settings used for calls to deleteInstancesInstanceGroupManager. */ - public UnaryCallSettings.Builder deleteInstancesInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + deleteInstancesInstanceGroupManagerSettings() { return deleteInstancesInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to getInstanceGroupManager. - */ - public UnaryCallSettings.Builder getInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to getInstanceGroupManager. */ + public UnaryCallSettings.Builder + getInstanceGroupManagerSettings() { return getInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to insertInstanceGroupManager. - */ - public UnaryCallSettings.Builder insertInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to insertInstanceGroupManager. */ + public UnaryCallSettings.Builder + insertInstanceGroupManagerSettings() { return insertInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to listInstanceGroupManagers. - */ - public PagedCallSettings.Builder listInstanceGroupManagersSettings() { + /** Returns the builder for the settings used for calls to listInstanceGroupManagers. */ + public PagedCallSettings.Builder< + ListInstanceGroupManagersHttpRequest, InstanceGroupManagerList, + ListInstanceGroupManagersPagedResponse> + listInstanceGroupManagersSettings() { return listInstanceGroupManagersSettings; } /** - * Returns the builder for the settings used for calls to listManagedInstancesInstanceGroupManagers. + * Returns the builder for the settings used for calls to + * listManagedInstancesInstanceGroupManagers. */ - public UnaryCallSettings.Builder listManagedInstancesInstanceGroupManagersSettings() { + public UnaryCallSettings.Builder< + ListManagedInstancesInstanceGroupManagersHttpRequest, + InstanceGroupManagersListManagedInstancesResponse> + listManagedInstancesInstanceGroupManagersSettings() { return listManagedInstancesInstanceGroupManagersSettings; } /** * Returns the builder for the settings used for calls to recreateInstancesInstanceGroupManager. */ - public UnaryCallSettings.Builder recreateInstancesInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + recreateInstancesInstanceGroupManagerSettings() { return recreateInstancesInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to resizeInstanceGroupManager. - */ - public UnaryCallSettings.Builder resizeInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to resizeInstanceGroupManager. */ + public UnaryCallSettings.Builder + resizeInstanceGroupManagerSettings() { return resizeInstanceGroupManagerSettings; } /** - * Returns the builder for the settings used for calls to setInstanceTemplateInstanceGroupManager. + * Returns the builder for the settings used for calls to + * setInstanceTemplateInstanceGroupManager. */ - public UnaryCallSettings.Builder setInstanceTemplateInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + setInstanceTemplateInstanceGroupManagerSettings() { return setInstanceTemplateInstanceGroupManagerSettings; } /** * Returns the builder for the settings used for calls to setTargetPoolsInstanceGroupManager. */ - public UnaryCallSettings.Builder setTargetPoolsInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + setTargetPoolsInstanceGroupManagerSettings() { return setTargetPoolsInstanceGroupManagerSettings; } @@ -713,4 +830,4 @@ public InstanceGroupManagerStubSettings build() throws IOException { return new InstanceGroupManagerStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java index 0efb1ba1aecf..baf88b0c489d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java @@ -15,6 +15,10 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -25,23 +29,11 @@ import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; import com.google.cloud.compute.v1.InstanceGroup; import com.google.cloud.compute.v1.InstanceGroupAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.InstanceGroupList; -import com.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; import com.google.cloud.compute.v1.InstanceGroupsListInstances; -import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; -import com.google.cloud.compute.v1.InstanceGroupsScopedList; -import com.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; -import com.google.cloud.compute.v1.InstanceWithNamedPorts; import com.google.cloud.compute.v1.ListInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.ListInstancesInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneInstanceGroupName; -import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.RemoveInstancesInstanceGroupHttpRequest; import com.google.cloud.compute.v1.SetNamedPortsInstanceGroupHttpRequest; import javax.annotation.Generated; @@ -56,20 +48,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceGroupStub implements BackgroundResource { - @BetaApi - public UnaryCallable addInstancesInstanceGroupCallable() { + public UnaryCallable + addInstancesInstanceGroupCallable() { throw new UnsupportedOperationException("Not implemented: addInstancesInstanceGroupCallable()"); } @BetaApi - public UnaryCallable aggregatedListInstanceGroupsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupsPagedCallable()"); + public UnaryCallable< + AggregatedListInstanceGroupsHttpRequest, AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInstanceGroupsPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListInstanceGroupsCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInstanceGroupsCallable()"); + public UnaryCallable + aggregatedListInstanceGroupsCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInstanceGroupsCallable()"); } @BetaApi @@ -88,33 +85,46 @@ public UnaryCallable insertInstanceGr } @BetaApi - public UnaryCallable listInstanceGroupsPagedCallable() { + public UnaryCallable + listInstanceGroupsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listInstanceGroupsPagedCallable()"); } @BetaApi - public UnaryCallable listInstanceGroupsCallable() { + public UnaryCallable + listInstanceGroupsCallable() { throw new UnsupportedOperationException("Not implemented: listInstanceGroupsCallable()"); } @BetaApi - public UnaryCallable listInstancesInstanceGroupsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listInstancesInstanceGroupsPagedCallable()"); + public UnaryCallable< + ListInstancesInstanceGroupsHttpRequest, ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInstancesInstanceGroupsPagedCallable()"); } @BetaApi - public UnaryCallable listInstancesInstanceGroupsCallable() { - throw new UnsupportedOperationException("Not implemented: listInstancesInstanceGroupsCallable()"); + public UnaryCallable + listInstancesInstanceGroupsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInstancesInstanceGroupsCallable()"); } @BetaApi - public UnaryCallable removeInstancesInstanceGroupCallable() { - throw new UnsupportedOperationException("Not implemented: removeInstancesInstanceGroupCallable()"); + public UnaryCallable + removeInstancesInstanceGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeInstancesInstanceGroupCallable()"); } @BetaApi - public UnaryCallable setNamedPortsInstanceGroupCallable() { - throw new UnsupportedOperationException("Not implemented: setNamedPortsInstanceGroupCallable()"); + public UnaryCallable + setNamedPortsInstanceGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: setNamedPortsInstanceGroupCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java index 1ecd2a34590a..97d8df0c964e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java @@ -15,11 +15,13 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +32,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +41,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AddInstancesInstanceGroupHttpRequest; import com.google.cloud.compute.v1.AggregatedListInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceGroupHttpRequest; @@ -49,9 +48,6 @@ import com.google.cloud.compute.v1.InsertInstanceGroupHttpRequest; import com.google.cloud.compute.v1.InstanceGroup; import com.google.cloud.compute.v1.InstanceGroupAggregatedList; -import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.InstanceGroupList; import com.google.cloud.compute.v1.InstanceGroupsListInstances; import com.google.cloud.compute.v1.InstanceGroupsScopedList; @@ -65,10 +61,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -79,15 +73,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addInstancesInstanceGroup to 30 seconds: * *

  * 
@@ -102,92 +96,99 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceGroupStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings addInstancesInstanceGroupSettings;
-  private final PagedCallSettings aggregatedListInstanceGroupsSettings;
-  private final UnaryCallSettings deleteInstanceGroupSettings;
-  private final UnaryCallSettings getInstanceGroupSettings;
-  private final UnaryCallSettings insertInstanceGroupSettings;
-  private final PagedCallSettings listInstanceGroupsSettings;
-  private final PagedCallSettings listInstancesInstanceGroupsSettings;
-  private final UnaryCallSettings removeInstancesInstanceGroupSettings;
-  private final UnaryCallSettings setNamedPortsInstanceGroupSettings;
-
-  /**
-   * Returns the object with the settings used for calls to addInstancesInstanceGroup.
-   */
-  public UnaryCallSettings addInstancesInstanceGroupSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      addInstancesInstanceGroupSettings;
+  private final PagedCallSettings<
+          AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+          AggregatedListInstanceGroupsPagedResponse>
+      aggregatedListInstanceGroupsSettings;
+  private final UnaryCallSettings
+      deleteInstanceGroupSettings;
+  private final UnaryCallSettings
+      getInstanceGroupSettings;
+  private final UnaryCallSettings
+      insertInstanceGroupSettings;
+  private final PagedCallSettings<
+          ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
+      listInstanceGroupsSettings;
+  private final PagedCallSettings<
+          ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+          ListInstancesInstanceGroupsPagedResponse>
+      listInstancesInstanceGroupsSettings;
+  private final UnaryCallSettings
+      removeInstancesInstanceGroupSettings;
+  private final UnaryCallSettings
+      setNamedPortsInstanceGroupSettings;
+
+  /** Returns the object with the settings used for calls to addInstancesInstanceGroup. */
+  public UnaryCallSettings
+      addInstancesInstanceGroupSettings() {
     return addInstancesInstanceGroupSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstanceGroups.
-   */
-  public PagedCallSettings aggregatedListInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListInstanceGroups. */
+  public PagedCallSettings<
+          AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+          AggregatedListInstanceGroupsPagedResponse>
+      aggregatedListInstanceGroupsSettings() {
     return aggregatedListInstanceGroupsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceGroup.
-   */
-  public UnaryCallSettings deleteInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to deleteInstanceGroup. */
+  public UnaryCallSettings
+      deleteInstanceGroupSettings() {
     return deleteInstanceGroupSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceGroup.
-   */
+  /** Returns the object with the settings used for calls to getInstanceGroup. */
   public UnaryCallSettings getInstanceGroupSettings() {
     return getInstanceGroupSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceGroup.
-   */
-  public UnaryCallSettings insertInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to insertInstanceGroup. */
+  public UnaryCallSettings
+      insertInstanceGroupSettings() {
     return insertInstanceGroupSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceGroups.
-   */
-  public PagedCallSettings listInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstanceGroups. */
+  public PagedCallSettings<
+          ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
+      listInstanceGroupsSettings() {
     return listInstanceGroupsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstancesInstanceGroups.
-   */
-  public PagedCallSettings listInstancesInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstancesInstanceGroups. */
+  public PagedCallSettings<
+          ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+          ListInstancesInstanceGroupsPagedResponse>
+      listInstancesInstanceGroupsSettings() {
     return listInstancesInstanceGroupsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeInstancesInstanceGroup.
-   */
-  public UnaryCallSettings removeInstancesInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to removeInstancesInstanceGroup. */
+  public UnaryCallSettings
+      removeInstancesInstanceGroupSettings() {
     return removeInstancesInstanceGroupSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setNamedPortsInstanceGroup.
-   */
-  public UnaryCallSettings setNamedPortsInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to setNamedPortsInstanceGroup. */
+  public UnaryCallSettings
+      setNamedPortsInstanceGroupSettings() {
     return setNamedPortsInstanceGroupSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InstanceGroupStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -200,47 +201,34 @@ public InstanceGroupStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -251,27 +239,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceGroupStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(InstanceGroupStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -280,187 +265,262 @@ protected InstanceGroupStubSettings(Builder settingsBuilder) throws IOException
     super(settingsBuilder);
 
     addInstancesInstanceGroupSettings = settingsBuilder.addInstancesInstanceGroupSettings().build();
-    aggregatedListInstanceGroupsSettings = settingsBuilder.aggregatedListInstanceGroupsSettings().build();
+    aggregatedListInstanceGroupsSettings =
+        settingsBuilder.aggregatedListInstanceGroupsSettings().build();
     deleteInstanceGroupSettings = settingsBuilder.deleteInstanceGroupSettings().build();
     getInstanceGroupSettings = settingsBuilder.getInstanceGroupSettings().build();
     insertInstanceGroupSettings = settingsBuilder.insertInstanceGroupSettings().build();
     listInstanceGroupsSettings = settingsBuilder.listInstanceGroupsSettings().build();
-    listInstancesInstanceGroupsSettings = settingsBuilder.listInstancesInstanceGroupsSettings().build();
-    removeInstancesInstanceGroupSettings = settingsBuilder.removeInstancesInstanceGroupSettings().build();
-    setNamedPortsInstanceGroupSettings = settingsBuilder.setNamedPortsInstanceGroupSettings().build();
+    listInstancesInstanceGroupsSettings =
+        settingsBuilder.listInstancesInstanceGroupsSettings().build();
+    removeInstancesInstanceGroupSettings =
+        settingsBuilder.removeInstancesInstanceGroupSettings().build();
+    setNamedPortsInstanceGroupSettings =
+        settingsBuilder.setNamedPortsInstanceGroupSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListInstanceGroupsHttpRequest injectToken(AggregatedListInstanceGroupsHttpRequest payload, String token) {
-          return AggregatedListInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListInstanceGroupsHttpRequest injectPageSize(AggregatedListInstanceGroupsHttpRequest payload, int pageSize) {
-          return AggregatedListInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListInstanceGroupsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceGroupAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceGroupAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_INSTANCE_GROUPS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInstanceGroupsHttpRequest injectToken(ListInstanceGroupsHttpRequest payload, String token) {
-          return ListInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInstanceGroupsHttpRequest injectPageSize(ListInstanceGroupsHttpRequest payload, int pageSize) {
-          return ListInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInstanceGroupsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceGroupList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceGroupList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInstancesInstanceGroupsHttpRequest injectToken(ListInstancesInstanceGroupsHttpRequest payload, String token) {
-          return ListInstancesInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInstancesInstanceGroupsHttpRequest injectPageSize(ListInstancesInstanceGroupsHttpRequest payload, int pageSize) {
-          return ListInstancesInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInstancesInstanceGroupsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceGroupsListInstances payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceGroupsListInstances payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListInstanceGroupsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
-          return AggregatedListInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INSTANCE_GROUPS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInstanceGroupsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
-          return ListInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInstancesInstanceGroupsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
-          return ListInstancesInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InstanceGroupStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+          InstanceGroupsScopedList>
+      AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+              InstanceGroupsScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListInstanceGroupsHttpRequest injectToken(
+                AggregatedListInstanceGroupsHttpRequest payload, String token) {
+              return AggregatedListInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListInstanceGroupsHttpRequest injectPageSize(
+                AggregatedListInstanceGroupsHttpRequest payload, int pageSize) {
+              return AggregatedListInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListInstanceGroupsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceGroupAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InstanceGroupAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListInstanceGroupsHttpRequest, InstanceGroupList, InstanceGroup>
+      LIST_INSTANCE_GROUPS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInstanceGroupsHttpRequest, InstanceGroupList, InstanceGroup>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInstanceGroupsHttpRequest injectToken(
+                ListInstanceGroupsHttpRequest payload, String token) {
+              return ListInstanceGroupsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListInstanceGroupsHttpRequest injectPageSize(
+                ListInstanceGroupsHttpRequest payload, int pageSize) {
+              return ListInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInstanceGroupsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceGroupList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(InstanceGroupList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+          InstanceWithNamedPorts>
+      LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+              InstanceWithNamedPorts>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInstancesInstanceGroupsHttpRequest injectToken(
+                ListInstancesInstanceGroupsHttpRequest payload, String token) {
+              return ListInstancesInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListInstancesInstanceGroupsHttpRequest injectPageSize(
+                ListInstancesInstanceGroupsHttpRequest payload, int pageSize) {
+              return ListInstancesInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInstancesInstanceGroupsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceGroupsListInstances payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InstanceGroupsListInstances payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+          AggregatedListInstanceGroupsPagedResponse>
+      AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+              AggregatedListInstanceGroupsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListInstanceGroupsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+                      InstanceGroupsScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListInstanceGroupsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
+      LIST_INSTANCE_GROUPS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListInstanceGroupsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
+              return ListInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+          ListInstancesInstanceGroupsPagedResponse>
+      LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+              ListInstancesInstanceGroupsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                ListInstancesInstanceGroupsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+                      InstanceWithNamedPorts>
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
+              return ListInstancesInstanceGroupsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InstanceGroupStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder addInstancesInstanceGroupSettings;
-    private final PagedCallSettings.Builder aggregatedListInstanceGroupsSettings;
-    private final UnaryCallSettings.Builder deleteInstanceGroupSettings;
-    private final UnaryCallSettings.Builder getInstanceGroupSettings;
-    private final UnaryCallSettings.Builder insertInstanceGroupSettings;
-    private final PagedCallSettings.Builder listInstanceGroupsSettings;
-    private final PagedCallSettings.Builder listInstancesInstanceGroupsSettings;
-    private final UnaryCallSettings.Builder removeInstancesInstanceGroupSettings;
-    private final UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        addInstancesInstanceGroupSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList,
+            AggregatedListInstanceGroupsPagedResponse>
+        aggregatedListInstanceGroupsSettings;
+    private final UnaryCallSettings.Builder
+        deleteInstanceGroupSettings;
+    private final UnaryCallSettings.Builder
+        getInstanceGroupSettings;
+    private final UnaryCallSettings.Builder
+        insertInstanceGroupSettings;
+    private final PagedCallSettings.Builder<
+            ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse>
+        listInstanceGroupsSettings;
+    private final PagedCallSettings.Builder<
+            ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances,
+            ListInstancesInstanceGroupsPagedResponse>
+        listInstancesInstanceGroupsSettings;
+    private final UnaryCallSettings.Builder
+        removeInstancesInstanceGroupSettings;
+    private final UnaryCallSettings.Builder
+        setNamedPortsInstanceGroupSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -469,15 +529,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -491,8 +552,8 @@ protected Builder(ClientContext clientContext) {
 
       addInstancesInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      aggregatedListInstanceGroupsSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_FACT);
+      aggregatedListInstanceGroupsSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_INSTANCE_GROUPS_PAGE_STR_FACT);
 
       deleteInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -500,27 +561,26 @@ protected Builder(ClientContext clientContext) {
 
       insertInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInstanceGroupsSettings = PagedCallSettings.newBuilder(
-          LIST_INSTANCE_GROUPS_PAGE_STR_FACT);
+      listInstanceGroupsSettings = PagedCallSettings.newBuilder(LIST_INSTANCE_GROUPS_PAGE_STR_FACT);
 
-      listInstancesInstanceGroupsSettings = PagedCallSettings.newBuilder(
-          LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_FACT);
+      listInstancesInstanceGroupsSettings =
+          PagedCallSettings.newBuilder(LIST_INSTANCES_INSTANCE_GROUPS_PAGE_STR_FACT);
 
       removeInstancesInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       setNamedPortsInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addInstancesInstanceGroupSettings,
-          aggregatedListInstanceGroupsSettings,
-          deleteInstanceGroupSettings,
-          getInstanceGroupSettings,
-          insertInstanceGroupSettings,
-          listInstanceGroupsSettings,
-          listInstancesInstanceGroupsSettings,
-          removeInstancesInstanceGroupSettings,
-          setNamedPortsInstanceGroupSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addInstancesInstanceGroupSettings,
+              aggregatedListInstanceGroupsSettings,
+              deleteInstanceGroupSettings,
+              getInstanceGroupSettings,
+              insertInstanceGroupSettings,
+              listInstanceGroupsSettings,
+              listInstancesInstanceGroupsSettings,
+              removeInstancesInstanceGroupSettings,
+              setNamedPortsInstanceGroupSettings);
 
       initDefaults(this);
     }
@@ -536,39 +596,48 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.addInstancesInstanceGroupSettings()
+      builder
+          .addInstancesInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.aggregatedListInstanceGroupsSettings()
+      builder
+          .aggregatedListInstanceGroupsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteInstanceGroupSettings()
+      builder
+          .deleteInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getInstanceGroupSettings()
+      builder
+          .getInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertInstanceGroupSettings()
+      builder
+          .insertInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInstanceGroupsSettings()
+      builder
+          .listInstanceGroupsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInstancesInstanceGroupsSettings()
+      builder
+          .listInstancesInstanceGroupsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.removeInstancesInstanceGroupSettings()
+      builder
+          .removeInstancesInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setNamedPortsInstanceGroupSettings()
+      builder
+          .setNamedPortsInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -579,34 +648,39 @@ protected Builder(InstanceGroupStubSettings settings) {
       super(settings);
 
       addInstancesInstanceGroupSettings = settings.addInstancesInstanceGroupSettings.toBuilder();
-      aggregatedListInstanceGroupsSettings = settings.aggregatedListInstanceGroupsSettings.toBuilder();
+      aggregatedListInstanceGroupsSettings =
+          settings.aggregatedListInstanceGroupsSettings.toBuilder();
       deleteInstanceGroupSettings = settings.deleteInstanceGroupSettings.toBuilder();
       getInstanceGroupSettings = settings.getInstanceGroupSettings.toBuilder();
       insertInstanceGroupSettings = settings.insertInstanceGroupSettings.toBuilder();
       listInstanceGroupsSettings = settings.listInstanceGroupsSettings.toBuilder();
-      listInstancesInstanceGroupsSettings = settings.listInstancesInstanceGroupsSettings.toBuilder();
-      removeInstancesInstanceGroupSettings = settings.removeInstancesInstanceGroupSettings.toBuilder();
+      listInstancesInstanceGroupsSettings =
+          settings.listInstancesInstanceGroupsSettings.toBuilder();
+      removeInstancesInstanceGroupSettings =
+          settings.removeInstancesInstanceGroupSettings.toBuilder();
       setNamedPortsInstanceGroupSettings = settings.setNamedPortsInstanceGroupSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addInstancesInstanceGroupSettings,
-          aggregatedListInstanceGroupsSettings,
-          deleteInstanceGroupSettings,
-          getInstanceGroupSettings,
-          insertInstanceGroupSettings,
-          listInstanceGroupsSettings,
-          listInstancesInstanceGroupsSettings,
-          removeInstancesInstanceGroupSettings,
-          setNamedPortsInstanceGroupSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addInstancesInstanceGroupSettings,
+              aggregatedListInstanceGroupsSettings,
+              deleteInstanceGroupSettings,
+              getInstanceGroupSettings,
+              insertInstanceGroupSettings,
+              listInstanceGroupsSettings,
+              listInstancesInstanceGroupsSettings,
+              removeInstancesInstanceGroupSettings,
+              setNamedPortsInstanceGroupSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -615,66 +689,62 @@ public Builder applyToAllUnaryMethods(ApiFunction addInstancesInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to addInstancesInstanceGroup. */ + public UnaryCallSettings.Builder + addInstancesInstanceGroupSettings() { return addInstancesInstanceGroupSettings; } - /** - * Returns the builder for the settings used for calls to aggregatedListInstanceGroups. - */ - public PagedCallSettings.Builder aggregatedListInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListInstanceGroups. */ + public PagedCallSettings.Builder< + AggregatedListInstanceGroupsHttpRequest, InstanceGroupAggregatedList, + AggregatedListInstanceGroupsPagedResponse> + aggregatedListInstanceGroupsSettings() { return aggregatedListInstanceGroupsSettings; } - /** - * Returns the builder for the settings used for calls to deleteInstanceGroup. - */ - public UnaryCallSettings.Builder deleteInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceGroup. */ + public UnaryCallSettings.Builder + deleteInstanceGroupSettings() { return deleteInstanceGroupSettings; } - /** - * Returns the builder for the settings used for calls to getInstanceGroup. - */ - public UnaryCallSettings.Builder getInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to getInstanceGroup. */ + public UnaryCallSettings.Builder + getInstanceGroupSettings() { return getInstanceGroupSettings; } - /** - * Returns the builder for the settings used for calls to insertInstanceGroup. - */ - public UnaryCallSettings.Builder insertInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to insertInstanceGroup. */ + public UnaryCallSettings.Builder + insertInstanceGroupSettings() { return insertInstanceGroupSettings; } - /** - * Returns the builder for the settings used for calls to listInstanceGroups. - */ - public PagedCallSettings.Builder listInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstanceGroupsHttpRequest, InstanceGroupList, ListInstanceGroupsPagedResponse> + listInstanceGroupsSettings() { return listInstanceGroupsSettings; } - /** - * Returns the builder for the settings used for calls to listInstancesInstanceGroups. - */ - public PagedCallSettings.Builder listInstancesInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstancesInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstancesInstanceGroupsHttpRequest, InstanceGroupsListInstances, + ListInstancesInstanceGroupsPagedResponse> + listInstancesInstanceGroupsSettings() { return listInstancesInstanceGroupsSettings; } - /** - * Returns the builder for the settings used for calls to removeInstancesInstanceGroup. - */ - public UnaryCallSettings.Builder removeInstancesInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to removeInstancesInstanceGroup. */ + public UnaryCallSettings.Builder + removeInstancesInstanceGroupSettings() { return removeInstancesInstanceGroupSettings; } - /** - * Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. - */ - public UnaryCallSettings.Builder setNamedPortsInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to setNamedPortsInstanceGroup. */ + public UnaryCallSettings.Builder + setNamedPortsInstanceGroupSettings() { return setNamedPortsInstanceGroupSettings; } @@ -683,4 +753,4 @@ public InstanceGroupStubSettings build() throws IOException { return new InstanceGroupStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java index b57e62973011..383073cdbac5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java @@ -15,14 +15,16 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.compute.v1.AccessConfig; import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; -import com.google.cloud.compute.v1.AttachedDisk; import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; @@ -31,29 +33,12 @@ import com.google.cloud.compute.v1.InsertInstanceHttpRequest; import com.google.cloud.compute.v1.Instance; import com.google.cloud.compute.v1.InstanceAggregatedList; -import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.InstanceList; import com.google.cloud.compute.v1.InstanceListReferrers; -import com.google.cloud.compute.v1.InstancesScopedList; -import com.google.cloud.compute.v1.InstancesSetLabelsRequest; -import com.google.cloud.compute.v1.InstancesSetMachineResourcesRequest; -import com.google.cloud.compute.v1.InstancesSetMachineTypeRequest; -import com.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; -import com.google.cloud.compute.v1.InstancesSetServiceAccountRequest; -import com.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; import com.google.cloud.compute.v1.ListInstancesHttpRequest; import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; -import com.google.cloud.compute.v1.Metadata; -import com.google.cloud.compute.v1.NetworkInterface; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneInstanceName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.Reference; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; -import com.google.cloud.compute.v1.Scheduling; import com.google.cloud.compute.v1.SerialPortOutput; import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; @@ -68,7 +53,6 @@ import com.google.cloud.compute.v1.StartInstanceHttpRequest; import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; -import com.google.cloud.compute.v1.Tags; import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import javax.annotation.Generated; @@ -83,19 +67,22 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceStub implements BackgroundResource { - @BetaApi - public UnaryCallable addAccessConfigInstanceCallable() { + public UnaryCallable + addAccessConfigInstanceCallable() { throw new UnsupportedOperationException("Not implemented: addAccessConfigInstanceCallable()"); } @BetaApi - public UnaryCallable aggregatedListInstancesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInstancesPagedCallable()"); + public UnaryCallable + aggregatedListInstancesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInstancesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListInstancesCallable() { + public UnaryCallable + aggregatedListInstancesCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListInstancesCallable()"); } @@ -110,8 +97,10 @@ public UnaryCallable deleteInstanceCallabl } @BetaApi - public UnaryCallable deleteAccessConfigInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: deleteAccessConfigInstanceCallable()"); + public UnaryCallable + deleteAccessConfigInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteAccessConfigInstanceCallable()"); } @BetaApi @@ -125,8 +114,10 @@ public UnaryCallable getInstanceCallable() { } @BetaApi - public UnaryCallable getSerialPortOutputInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: getSerialPortOutputInstanceCallable()"); + public UnaryCallable + getSerialPortOutputInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: getSerialPortOutputInstanceCallable()"); } @BetaApi @@ -135,7 +126,8 @@ public UnaryCallable insertInstanceCallabl } @BetaApi - public UnaryCallable listInstancesPagedCallable() { + public UnaryCallable + listInstancesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); } @@ -145,12 +137,15 @@ public UnaryCallable listInstancesCallab } @BetaApi - public UnaryCallable listReferrersInstancesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listReferrersInstancesPagedCallable()"); + public UnaryCallable + listReferrersInstancesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listReferrersInstancesPagedCallable()"); } @BetaApi - public UnaryCallable listReferrersInstancesCallable() { + public UnaryCallable + listReferrersInstancesCallable() { throw new UnsupportedOperationException("Not implemented: listReferrersInstancesCallable()"); } @@ -160,12 +155,15 @@ public UnaryCallable resetInstanceCallable( } @BetaApi - public UnaryCallable setDeletionProtectionInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: setDeletionProtectionInstanceCallable()"); + public UnaryCallable + setDeletionProtectionInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: setDeletionProtectionInstanceCallable()"); } @BetaApi - public UnaryCallable setDiskAutoDeleteInstanceCallable() { + public UnaryCallable + setDiskAutoDeleteInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setDiskAutoDeleteInstanceCallable()"); } @@ -175,12 +173,15 @@ public UnaryCallable setLabelsInstanceC } @BetaApi - public UnaryCallable setMachineResourcesInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: setMachineResourcesInstanceCallable()"); + public UnaryCallable + setMachineResourcesInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: setMachineResourcesInstanceCallable()"); } @BetaApi - public UnaryCallable setMachineTypeInstanceCallable() { + public UnaryCallable + setMachineTypeInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setMachineTypeInstanceCallable()"); } @@ -190,17 +191,20 @@ public UnaryCallable setMetadataInsta } @BetaApi - public UnaryCallable setMinCpuPlatformInstanceCallable() { + public UnaryCallable + setMinCpuPlatformInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setMinCpuPlatformInstanceCallable()"); } @BetaApi - public UnaryCallable setSchedulingInstanceCallable() { + public UnaryCallable + setSchedulingInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setSchedulingInstanceCallable()"); } @BetaApi - public UnaryCallable setServiceAccountInstanceCallable() { + public UnaryCallable + setServiceAccountInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setServiceAccountInstanceCallable()"); } @@ -215,8 +219,10 @@ public UnaryCallable startInstanceCallable( } @BetaApi - public UnaryCallable startWithEncryptionKeyInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: startWithEncryptionKeyInstanceCallable()"); + public UnaryCallable + startWithEncryptionKeyInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: startWithEncryptionKeyInstanceCallable()"); } @BetaApi @@ -225,13 +231,19 @@ public UnaryCallable stopInstanceCallable() } @BetaApi - public UnaryCallable updateAccessConfigInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: updateAccessConfigInstanceCallable()"); + public UnaryCallable + updateAccessConfigInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateAccessConfigInstanceCallable()"); } @BetaApi - public UnaryCallable updateNetworkInterfaceInstanceCallable() { - throw new UnsupportedOperationException("Not implemented: updateNetworkInterfaceInstanceCallable()"); + public UnaryCallable + updateNetworkInterfaceInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateNetworkInterfaceInstanceCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java index 0e29349bc88c..ccc5069ecbad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java @@ -15,11 +15,13 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; +import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +32,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +41,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AddAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.AggregatedListInstancesHttpRequest; import com.google.cloud.compute.v1.AttachDiskInstanceHttpRequest; @@ -53,9 +52,6 @@ import com.google.cloud.compute.v1.InsertInstanceHttpRequest; import com.google.cloud.compute.v1.Instance; import com.google.cloud.compute.v1.InstanceAggregatedList; -import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; -import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; import com.google.cloud.compute.v1.InstanceList; import com.google.cloud.compute.v1.InstanceListReferrers; import com.google.cloud.compute.v1.InstancesScopedList; @@ -84,10 +80,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -98,15 +92,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addAccessConfigInstance to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addAccessConfigInstance to 30 seconds: * *

  * 
@@ -121,236 +115,226 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings addAccessConfigInstanceSettings;
-  private final PagedCallSettings aggregatedListInstancesSettings;
-  private final UnaryCallSettings attachDiskInstanceSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      addAccessConfigInstanceSettings;
+  private final PagedCallSettings<
+          AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+          AggregatedListInstancesPagedResponse>
+      aggregatedListInstancesSettings;
+  private final UnaryCallSettings
+      attachDiskInstanceSettings;
   private final UnaryCallSettings deleteInstanceSettings;
-  private final UnaryCallSettings deleteAccessConfigInstanceSettings;
-  private final UnaryCallSettings detachDiskInstanceSettings;
+  private final UnaryCallSettings
+      deleteAccessConfigInstanceSettings;
+  private final UnaryCallSettings
+      detachDiskInstanceSettings;
   private final UnaryCallSettings getInstanceSettings;
-  private final UnaryCallSettings getSerialPortOutputInstanceSettings;
+  private final UnaryCallSettings
+      getSerialPortOutputInstanceSettings;
   private final UnaryCallSettings insertInstanceSettings;
-  private final PagedCallSettings listInstancesSettings;
-  private final PagedCallSettings listReferrersInstancesSettings;
+  private final PagedCallSettings<
+          ListInstancesHttpRequest, InstanceList, ListInstancesPagedResponse>
+      listInstancesSettings;
+  private final PagedCallSettings<
+          ListReferrersInstancesHttpRequest, InstanceListReferrers,
+          ListReferrersInstancesPagedResponse>
+      listReferrersInstancesSettings;
   private final UnaryCallSettings resetInstanceSettings;
-  private final UnaryCallSettings setDeletionProtectionInstanceSettings;
-  private final UnaryCallSettings setDiskAutoDeleteInstanceSettings;
-  private final UnaryCallSettings setLabelsInstanceSettings;
-  private final UnaryCallSettings setMachineResourcesInstanceSettings;
-  private final UnaryCallSettings setMachineTypeInstanceSettings;
-  private final UnaryCallSettings setMetadataInstanceSettings;
-  private final UnaryCallSettings setMinCpuPlatformInstanceSettings;
-  private final UnaryCallSettings setSchedulingInstanceSettings;
-  private final UnaryCallSettings setServiceAccountInstanceSettings;
+  private final UnaryCallSettings
+      setDeletionProtectionInstanceSettings;
+  private final UnaryCallSettings
+      setDiskAutoDeleteInstanceSettings;
+  private final UnaryCallSettings
+      setLabelsInstanceSettings;
+  private final UnaryCallSettings
+      setMachineResourcesInstanceSettings;
+  private final UnaryCallSettings
+      setMachineTypeInstanceSettings;
+  private final UnaryCallSettings
+      setMetadataInstanceSettings;
+  private final UnaryCallSettings
+      setMinCpuPlatformInstanceSettings;
+  private final UnaryCallSettings
+      setSchedulingInstanceSettings;
+  private final UnaryCallSettings
+      setServiceAccountInstanceSettings;
   private final UnaryCallSettings setTagsInstanceSettings;
   private final UnaryCallSettings startInstanceSettings;
-  private final UnaryCallSettings startWithEncryptionKeyInstanceSettings;
+  private final UnaryCallSettings
+      startWithEncryptionKeyInstanceSettings;
   private final UnaryCallSettings stopInstanceSettings;
-  private final UnaryCallSettings updateAccessConfigInstanceSettings;
-  private final UnaryCallSettings updateNetworkInterfaceInstanceSettings;
-
-  /**
-   * Returns the object with the settings used for calls to addAccessConfigInstance.
-   */
-  public UnaryCallSettings addAccessConfigInstanceSettings() {
+  private final UnaryCallSettings
+      updateAccessConfigInstanceSettings;
+  private final UnaryCallSettings
+      updateNetworkInterfaceInstanceSettings;
+
+  /** Returns the object with the settings used for calls to addAccessConfigInstance. */
+  public UnaryCallSettings
+      addAccessConfigInstanceSettings() {
     return addAccessConfigInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListInstances.
-   */
-  public PagedCallSettings aggregatedListInstancesSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListInstances. */
+  public PagedCallSettings<
+          AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+          AggregatedListInstancesPagedResponse>
+      aggregatedListInstancesSettings() {
     return aggregatedListInstancesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to attachDiskInstance.
-   */
+  /** Returns the object with the settings used for calls to attachDiskInstance. */
   public UnaryCallSettings attachDiskInstanceSettings() {
     return attachDiskInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInstance.
-   */
+  /** Returns the object with the settings used for calls to deleteInstance. */
   public UnaryCallSettings deleteInstanceSettings() {
     return deleteInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteAccessConfigInstance.
-   */
-  public UnaryCallSettings deleteAccessConfigInstanceSettings() {
+  /** Returns the object with the settings used for calls to deleteAccessConfigInstance. */
+  public UnaryCallSettings
+      deleteAccessConfigInstanceSettings() {
     return deleteAccessConfigInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to detachDiskInstance.
-   */
+  /** Returns the object with the settings used for calls to detachDiskInstance. */
   public UnaryCallSettings detachDiskInstanceSettings() {
     return detachDiskInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstance.
-   */
+  /** Returns the object with the settings used for calls to getInstance. */
   public UnaryCallSettings getInstanceSettings() {
     return getInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSerialPortOutputInstance.
-   */
-  public UnaryCallSettings getSerialPortOutputInstanceSettings() {
+  /** Returns the object with the settings used for calls to getSerialPortOutputInstance. */
+  public UnaryCallSettings
+      getSerialPortOutputInstanceSettings() {
     return getSerialPortOutputInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstance.
-   */
+  /** Returns the object with the settings used for calls to insertInstance. */
   public UnaryCallSettings insertInstanceSettings() {
     return insertInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstances.
-   */
-  public PagedCallSettings listInstancesSettings() {
+  /** Returns the object with the settings used for calls to listInstances. */
+  public PagedCallSettings
+      listInstancesSettings() {
     return listInstancesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listReferrersInstances.
-   */
-  public PagedCallSettings listReferrersInstancesSettings() {
+  /** Returns the object with the settings used for calls to listReferrersInstances. */
+  public PagedCallSettings<
+          ListReferrersInstancesHttpRequest, InstanceListReferrers,
+          ListReferrersInstancesPagedResponse>
+      listReferrersInstancesSettings() {
     return listReferrersInstancesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to resetInstance.
-   */
+  /** Returns the object with the settings used for calls to resetInstance. */
   public UnaryCallSettings resetInstanceSettings() {
     return resetInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setDeletionProtectionInstance.
-   */
-  public UnaryCallSettings setDeletionProtectionInstanceSettings() {
+  /** Returns the object with the settings used for calls to setDeletionProtectionInstance. */
+  public UnaryCallSettings
+      setDeletionProtectionInstanceSettings() {
     return setDeletionProtectionInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setDiskAutoDeleteInstance.
-   */
-  public UnaryCallSettings setDiskAutoDeleteInstanceSettings() {
+  /** Returns the object with the settings used for calls to setDiskAutoDeleteInstance. */
+  public UnaryCallSettings
+      setDiskAutoDeleteInstanceSettings() {
     return setDiskAutoDeleteInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsInstance.
-   */
+  /** Returns the object with the settings used for calls to setLabelsInstance. */
   public UnaryCallSettings setLabelsInstanceSettings() {
     return setLabelsInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMachineResourcesInstance.
-   */
-  public UnaryCallSettings setMachineResourcesInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMachineResourcesInstance. */
+  public UnaryCallSettings
+      setMachineResourcesInstanceSettings() {
     return setMachineResourcesInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMachineTypeInstance.
-   */
-  public UnaryCallSettings setMachineTypeInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMachineTypeInstance. */
+  public UnaryCallSettings
+      setMachineTypeInstanceSettings() {
     return setMachineTypeInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMetadataInstance.
-   */
-  public UnaryCallSettings setMetadataInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMetadataInstance. */
+  public UnaryCallSettings
+      setMetadataInstanceSettings() {
     return setMetadataInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setMinCpuPlatformInstance.
-   */
-  public UnaryCallSettings setMinCpuPlatformInstanceSettings() {
+  /** Returns the object with the settings used for calls to setMinCpuPlatformInstance. */
+  public UnaryCallSettings
+      setMinCpuPlatformInstanceSettings() {
     return setMinCpuPlatformInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setSchedulingInstance.
-   */
-  public UnaryCallSettings setSchedulingInstanceSettings() {
+  /** Returns the object with the settings used for calls to setSchedulingInstance. */
+  public UnaryCallSettings
+      setSchedulingInstanceSettings() {
     return setSchedulingInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setServiceAccountInstance.
-   */
-  public UnaryCallSettings setServiceAccountInstanceSettings() {
+  /** Returns the object with the settings used for calls to setServiceAccountInstance. */
+  public UnaryCallSettings
+      setServiceAccountInstanceSettings() {
     return setServiceAccountInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setTagsInstance.
-   */
+  /** Returns the object with the settings used for calls to setTagsInstance. */
   public UnaryCallSettings setTagsInstanceSettings() {
     return setTagsInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to startInstance.
-   */
+  /** Returns the object with the settings used for calls to startInstance. */
   public UnaryCallSettings startInstanceSettings() {
     return startInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to startWithEncryptionKeyInstance.
-   */
-  public UnaryCallSettings startWithEncryptionKeyInstanceSettings() {
+  /** Returns the object with the settings used for calls to startWithEncryptionKeyInstance. */
+  public UnaryCallSettings
+      startWithEncryptionKeyInstanceSettings() {
     return startWithEncryptionKeyInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to stopInstance.
-   */
+  /** Returns the object with the settings used for calls to stopInstance. */
   public UnaryCallSettings stopInstanceSettings() {
     return stopInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateAccessConfigInstance.
-   */
-  public UnaryCallSettings updateAccessConfigInstanceSettings() {
+  /** Returns the object with the settings used for calls to updateAccessConfigInstance. */
+  public UnaryCallSettings
+      updateAccessConfigInstanceSettings() {
     return updateAccessConfigInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateNetworkInterfaceInstance.
-   */
-  public UnaryCallSettings updateNetworkInterfaceInstanceSettings() {
+  /** Returns the object with the settings used for calls to updateNetworkInterfaceInstance. */
+  public UnaryCallSettings
+      updateNetworkInterfaceInstanceSettings() {
     return updateNetworkInterfaceInstanceSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InstanceStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -363,47 +347,34 @@ public InstanceStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -415,26 +386,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -446,18 +413,22 @@ protected InstanceStubSettings(Builder settingsBuilder) throws IOException {
     aggregatedListInstancesSettings = settingsBuilder.aggregatedListInstancesSettings().build();
     attachDiskInstanceSettings = settingsBuilder.attachDiskInstanceSettings().build();
     deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build();
-    deleteAccessConfigInstanceSettings = settingsBuilder.deleteAccessConfigInstanceSettings().build();
+    deleteAccessConfigInstanceSettings =
+        settingsBuilder.deleteAccessConfigInstanceSettings().build();
     detachDiskInstanceSettings = settingsBuilder.detachDiskInstanceSettings().build();
     getInstanceSettings = settingsBuilder.getInstanceSettings().build();
-    getSerialPortOutputInstanceSettings = settingsBuilder.getSerialPortOutputInstanceSettings().build();
+    getSerialPortOutputInstanceSettings =
+        settingsBuilder.getSerialPortOutputInstanceSettings().build();
     insertInstanceSettings = settingsBuilder.insertInstanceSettings().build();
     listInstancesSettings = settingsBuilder.listInstancesSettings().build();
     listReferrersInstancesSettings = settingsBuilder.listReferrersInstancesSettings().build();
     resetInstanceSettings = settingsBuilder.resetInstanceSettings().build();
-    setDeletionProtectionInstanceSettings = settingsBuilder.setDeletionProtectionInstanceSettings().build();
+    setDeletionProtectionInstanceSettings =
+        settingsBuilder.setDeletionProtectionInstanceSettings().build();
     setDiskAutoDeleteInstanceSettings = settingsBuilder.setDiskAutoDeleteInstanceSettings().build();
     setLabelsInstanceSettings = settingsBuilder.setLabelsInstanceSettings().build();
-    setMachineResourcesInstanceSettings = settingsBuilder.setMachineResourcesInstanceSettings().build();
+    setMachineResourcesInstanceSettings =
+        settingsBuilder.setMachineResourcesInstanceSettings().build();
     setMachineTypeInstanceSettings = settingsBuilder.setMachineTypeInstanceSettings().build();
     setMetadataInstanceSettings = settingsBuilder.setMetadataInstanceSettings().build();
     setMinCpuPlatformInstanceSettings = settingsBuilder.setMinCpuPlatformInstanceSettings().build();
@@ -465,201 +436,272 @@ protected InstanceStubSettings(Builder settingsBuilder) throws IOException {
     setServiceAccountInstanceSettings = settingsBuilder.setServiceAccountInstanceSettings().build();
     setTagsInstanceSettings = settingsBuilder.setTagsInstanceSettings().build();
     startInstanceSettings = settingsBuilder.startInstanceSettings().build();
-    startWithEncryptionKeyInstanceSettings = settingsBuilder.startWithEncryptionKeyInstanceSettings().build();
+    startWithEncryptionKeyInstanceSettings =
+        settingsBuilder.startWithEncryptionKeyInstanceSettings().build();
     stopInstanceSettings = settingsBuilder.stopInstanceSettings().build();
-    updateAccessConfigInstanceSettings = settingsBuilder.updateAccessConfigInstanceSettings().build();
-    updateNetworkInterfaceInstanceSettings = settingsBuilder.updateNetworkInterfaceInstanceSettings().build();
+    updateAccessConfigInstanceSettings =
+        settingsBuilder.updateAccessConfigInstanceSettings().build();
+    updateNetworkInterfaceInstanceSettings =
+        settingsBuilder.updateNetworkInterfaceInstanceSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListInstancesHttpRequest injectToken(AggregatedListInstancesHttpRequest payload, String token) {
-          return AggregatedListInstancesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListInstancesHttpRequest injectPageSize(AggregatedListInstancesHttpRequest payload, int pageSize) {
-          return AggregatedListInstancesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListInstancesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_INSTANCES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInstancesHttpRequest injectToken(ListInstancesHttpRequest payload, String token) {
-          return ListInstancesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInstancesHttpRequest injectPageSize(ListInstancesHttpRequest payload, int pageSize) {
-          return ListInstancesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInstancesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_REFERRERS_INSTANCES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListReferrersInstancesHttpRequest injectToken(ListReferrersInstancesHttpRequest payload, String token) {
-          return ListReferrersInstancesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListReferrersInstancesHttpRequest injectPageSize(ListReferrersInstancesHttpRequest payload, int pageSize) {
-          return ListReferrersInstancesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListReferrersInstancesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceListReferrers payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceListReferrers payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListInstancesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC, request, context);
-          return AggregatedListInstancesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INSTANCES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInstancesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context);
-          return ListInstancesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REFERRERS_INSTANCES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListReferrersInstancesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REFERRERS_INSTANCES_PAGE_STR_DESC, request, context);
-          return ListReferrersInstancesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InstanceStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListInstancesHttpRequest, InstanceAggregatedList, InstancesScopedList>
+      AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListInstancesHttpRequest, InstanceAggregatedList, InstancesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListInstancesHttpRequest injectToken(
+                AggregatedListInstancesHttpRequest payload, String token) {
+              return AggregatedListInstancesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListInstancesHttpRequest injectPageSize(
+                AggregatedListInstancesHttpRequest payload, int pageSize) {
+              return AggregatedListInstancesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListInstancesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(InstanceAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_INSTANCES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInstancesHttpRequest injectToken(
+                ListInstancesHttpRequest payload, String token) {
+              return ListInstancesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListInstancesHttpRequest injectPageSize(
+                ListInstancesHttpRequest payload, int pageSize) {
+              return ListInstancesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInstancesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(InstanceList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListReferrersInstancesHttpRequest, InstanceListReferrers, Reference>
+      LIST_REFERRERS_INSTANCES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListReferrersInstancesHttpRequest, InstanceListReferrers, Reference>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListReferrersInstancesHttpRequest injectToken(
+                ListReferrersInstancesHttpRequest payload, String token) {
+              return ListReferrersInstancesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListReferrersInstancesHttpRequest injectPageSize(
+                ListReferrersInstancesHttpRequest payload, int pageSize) {
+              return ListReferrersInstancesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListReferrersInstancesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceListReferrers payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(InstanceListReferrers payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+          AggregatedListInstancesPagedResponse>
+      AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+              AggregatedListInstancesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                AggregatedListInstancesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+                      InstancesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_INSTANCES_PAGE_STR_DESC, request, context);
+              return AggregatedListInstancesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInstancesHttpRequest, InstanceList, ListInstancesPagedResponse>
+      LIST_INSTANCES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInstancesHttpRequest, InstanceList, ListInstancesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListInstancesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context);
+              return ListInstancesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListReferrersInstancesHttpRequest, InstanceListReferrers,
+          ListReferrersInstancesPagedResponse>
+      LIST_REFERRERS_INSTANCES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListReferrersInstancesHttpRequest, InstanceListReferrers,
+              ListReferrersInstancesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListReferrersInstancesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_REFERRERS_INSTANCES_PAGE_STR_DESC, request, context);
+              return ListReferrersInstancesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InstanceStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder addAccessConfigInstanceSettings;
-    private final PagedCallSettings.Builder aggregatedListInstancesSettings;
-    private final UnaryCallSettings.Builder attachDiskInstanceSettings;
-    private final UnaryCallSettings.Builder deleteInstanceSettings;
-    private final UnaryCallSettings.Builder deleteAccessConfigInstanceSettings;
-    private final UnaryCallSettings.Builder detachDiskInstanceSettings;
+    private final UnaryCallSettings.Builder
+        addAccessConfigInstanceSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListInstancesHttpRequest, InstanceAggregatedList,
+            AggregatedListInstancesPagedResponse>
+        aggregatedListInstancesSettings;
+    private final UnaryCallSettings.Builder
+        attachDiskInstanceSettings;
+    private final UnaryCallSettings.Builder
+        deleteInstanceSettings;
+    private final UnaryCallSettings.Builder
+        deleteAccessConfigInstanceSettings;
+    private final UnaryCallSettings.Builder
+        detachDiskInstanceSettings;
     private final UnaryCallSettings.Builder getInstanceSettings;
-    private final UnaryCallSettings.Builder getSerialPortOutputInstanceSettings;
-    private final UnaryCallSettings.Builder insertInstanceSettings;
-    private final PagedCallSettings.Builder listInstancesSettings;
-    private final PagedCallSettings.Builder listReferrersInstancesSettings;
-    private final UnaryCallSettings.Builder resetInstanceSettings;
-    private final UnaryCallSettings.Builder setDeletionProtectionInstanceSettings;
-    private final UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings;
-    private final UnaryCallSettings.Builder setLabelsInstanceSettings;
-    private final UnaryCallSettings.Builder setMachineResourcesInstanceSettings;
-    private final UnaryCallSettings.Builder setMachineTypeInstanceSettings;
-    private final UnaryCallSettings.Builder setMetadataInstanceSettings;
-    private final UnaryCallSettings.Builder setMinCpuPlatformInstanceSettings;
-    private final UnaryCallSettings.Builder setSchedulingInstanceSettings;
-    private final UnaryCallSettings.Builder setServiceAccountInstanceSettings;
-    private final UnaryCallSettings.Builder setTagsInstanceSettings;
-    private final UnaryCallSettings.Builder startInstanceSettings;
-    private final UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings;
-    private final UnaryCallSettings.Builder stopInstanceSettings;
-    private final UnaryCallSettings.Builder updateAccessConfigInstanceSettings;
-    private final UnaryCallSettings.Builder updateNetworkInterfaceInstanceSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder<
+            GetSerialPortOutputInstanceHttpRequest, SerialPortOutput>
+        getSerialPortOutputInstanceSettings;
+    private final UnaryCallSettings.Builder
+        insertInstanceSettings;
+    private final PagedCallSettings.Builder<
+            ListInstancesHttpRequest, InstanceList, ListInstancesPagedResponse>
+        listInstancesSettings;
+    private final PagedCallSettings.Builder<
+            ListReferrersInstancesHttpRequest, InstanceListReferrers,
+            ListReferrersInstancesPagedResponse>
+        listReferrersInstancesSettings;
+    private final UnaryCallSettings.Builder
+        resetInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setDeletionProtectionInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setDiskAutoDeleteInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setLabelsInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setMachineResourcesInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setMachineTypeInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setMetadataInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setMinCpuPlatformInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setSchedulingInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setServiceAccountInstanceSettings;
+    private final UnaryCallSettings.Builder
+        setTagsInstanceSettings;
+    private final UnaryCallSettings.Builder
+        startInstanceSettings;
+    private final UnaryCallSettings.Builder
+        startWithEncryptionKeyInstanceSettings;
+    private final UnaryCallSettings.Builder
+        stopInstanceSettings;
+    private final UnaryCallSettings.Builder
+        updateAccessConfigInstanceSettings;
+    private final UnaryCallSettings.Builder
+        updateNetworkInterfaceInstanceSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -668,15 +710,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -690,8 +733,8 @@ protected Builder(ClientContext clientContext) {
 
       addAccessConfigInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      aggregatedListInstancesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT);
+      aggregatedListInstancesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_INSTANCES_PAGE_STR_FACT);
 
       attachDiskInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -707,11 +750,10 @@ protected Builder(ClientContext clientContext) {
 
       insertInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInstancesSettings = PagedCallSettings.newBuilder(
-          LIST_INSTANCES_PAGE_STR_FACT);
+      listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT);
 
-      listReferrersInstancesSettings = PagedCallSettings.newBuilder(
-          LIST_REFERRERS_INSTANCES_PAGE_STR_FACT);
+      listReferrersInstancesSettings =
+          PagedCallSettings.newBuilder(LIST_REFERRERS_INSTANCES_PAGE_STR_FACT);
 
       resetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -745,35 +787,35 @@ protected Builder(ClientContext clientContext) {
 
       updateNetworkInterfaceInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addAccessConfigInstanceSettings,
-          aggregatedListInstancesSettings,
-          attachDiskInstanceSettings,
-          deleteInstanceSettings,
-          deleteAccessConfigInstanceSettings,
-          detachDiskInstanceSettings,
-          getInstanceSettings,
-          getSerialPortOutputInstanceSettings,
-          insertInstanceSettings,
-          listInstancesSettings,
-          listReferrersInstancesSettings,
-          resetInstanceSettings,
-          setDeletionProtectionInstanceSettings,
-          setDiskAutoDeleteInstanceSettings,
-          setLabelsInstanceSettings,
-          setMachineResourcesInstanceSettings,
-          setMachineTypeInstanceSettings,
-          setMetadataInstanceSettings,
-          setMinCpuPlatformInstanceSettings,
-          setSchedulingInstanceSettings,
-          setServiceAccountInstanceSettings,
-          setTagsInstanceSettings,
-          startInstanceSettings,
-          startWithEncryptionKeyInstanceSettings,
-          stopInstanceSettings,
-          updateAccessConfigInstanceSettings,
-          updateNetworkInterfaceInstanceSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addAccessConfigInstanceSettings,
+              aggregatedListInstancesSettings,
+              attachDiskInstanceSettings,
+              deleteInstanceSettings,
+              deleteAccessConfigInstanceSettings,
+              detachDiskInstanceSettings,
+              getInstanceSettings,
+              getSerialPortOutputInstanceSettings,
+              insertInstanceSettings,
+              listInstancesSettings,
+              listReferrersInstancesSettings,
+              resetInstanceSettings,
+              setDeletionProtectionInstanceSettings,
+              setDiskAutoDeleteInstanceSettings,
+              setLabelsInstanceSettings,
+              setMachineResourcesInstanceSettings,
+              setMachineTypeInstanceSettings,
+              setMetadataInstanceSettings,
+              setMinCpuPlatformInstanceSettings,
+              setSchedulingInstanceSettings,
+              setServiceAccountInstanceSettings,
+              setTagsInstanceSettings,
+              startInstanceSettings,
+              startWithEncryptionKeyInstanceSettings,
+              stopInstanceSettings,
+              updateAccessConfigInstanceSettings,
+              updateNetworkInterfaceInstanceSettings);
 
       initDefaults(this);
     }
@@ -789,111 +831,138 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.addAccessConfigInstanceSettings()
+      builder
+          .addAccessConfigInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.aggregatedListInstancesSettings()
+      builder
+          .aggregatedListInstancesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.attachDiskInstanceSettings()
+      builder
+          .attachDiskInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteInstanceSettings()
+      builder
+          .deleteInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteAccessConfigInstanceSettings()
+      builder
+          .deleteAccessConfigInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.detachDiskInstanceSettings()
+      builder
+          .detachDiskInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getInstanceSettings()
+      builder
+          .getInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getSerialPortOutputInstanceSettings()
+      builder
+          .getSerialPortOutputInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertInstanceSettings()
+      builder
+          .insertInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInstancesSettings()
+      builder
+          .listInstancesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listReferrersInstancesSettings()
+      builder
+          .listReferrersInstancesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.resetInstanceSettings()
+      builder
+          .resetInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setDeletionProtectionInstanceSettings()
+      builder
+          .setDeletionProtectionInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setDiskAutoDeleteInstanceSettings()
+      builder
+          .setDiskAutoDeleteInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setLabelsInstanceSettings()
+      builder
+          .setLabelsInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setMachineResourcesInstanceSettings()
+      builder
+          .setMachineResourcesInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setMachineTypeInstanceSettings()
+      builder
+          .setMachineTypeInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setMetadataInstanceSettings()
+      builder
+          .setMetadataInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setMinCpuPlatformInstanceSettings()
+      builder
+          .setMinCpuPlatformInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setSchedulingInstanceSettings()
+      builder
+          .setSchedulingInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setServiceAccountInstanceSettings()
+      builder
+          .setServiceAccountInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setTagsInstanceSettings()
+      builder
+          .setTagsInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.startInstanceSettings()
+      builder
+          .startInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.startWithEncryptionKeyInstanceSettings()
+      builder
+          .startWithEncryptionKeyInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.stopInstanceSettings()
+      builder
+          .stopInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateAccessConfigInstanceSettings()
+      builder
+          .updateAccessConfigInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateNetworkInterfaceInstanceSettings()
+      builder
+          .updateNetworkInterfaceInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -910,15 +979,18 @@ protected Builder(InstanceStubSettings settings) {
       deleteAccessConfigInstanceSettings = settings.deleteAccessConfigInstanceSettings.toBuilder();
       detachDiskInstanceSettings = settings.detachDiskInstanceSettings.toBuilder();
       getInstanceSettings = settings.getInstanceSettings.toBuilder();
-      getSerialPortOutputInstanceSettings = settings.getSerialPortOutputInstanceSettings.toBuilder();
+      getSerialPortOutputInstanceSettings =
+          settings.getSerialPortOutputInstanceSettings.toBuilder();
       insertInstanceSettings = settings.insertInstanceSettings.toBuilder();
       listInstancesSettings = settings.listInstancesSettings.toBuilder();
       listReferrersInstancesSettings = settings.listReferrersInstancesSettings.toBuilder();
       resetInstanceSettings = settings.resetInstanceSettings.toBuilder();
-      setDeletionProtectionInstanceSettings = settings.setDeletionProtectionInstanceSettings.toBuilder();
+      setDeletionProtectionInstanceSettings =
+          settings.setDeletionProtectionInstanceSettings.toBuilder();
       setDiskAutoDeleteInstanceSettings = settings.setDiskAutoDeleteInstanceSettings.toBuilder();
       setLabelsInstanceSettings = settings.setLabelsInstanceSettings.toBuilder();
-      setMachineResourcesInstanceSettings = settings.setMachineResourcesInstanceSettings.toBuilder();
+      setMachineResourcesInstanceSettings =
+          settings.setMachineResourcesInstanceSettings.toBuilder();
       setMachineTypeInstanceSettings = settings.setMachineTypeInstanceSettings.toBuilder();
       setMetadataInstanceSettings = settings.setMetadataInstanceSettings.toBuilder();
       setMinCpuPlatformInstanceSettings = settings.setMinCpuPlatformInstanceSettings.toBuilder();
@@ -926,48 +998,52 @@ protected Builder(InstanceStubSettings settings) {
       setServiceAccountInstanceSettings = settings.setServiceAccountInstanceSettings.toBuilder();
       setTagsInstanceSettings = settings.setTagsInstanceSettings.toBuilder();
       startInstanceSettings = settings.startInstanceSettings.toBuilder();
-      startWithEncryptionKeyInstanceSettings = settings.startWithEncryptionKeyInstanceSettings.toBuilder();
+      startWithEncryptionKeyInstanceSettings =
+          settings.startWithEncryptionKeyInstanceSettings.toBuilder();
       stopInstanceSettings = settings.stopInstanceSettings.toBuilder();
       updateAccessConfigInstanceSettings = settings.updateAccessConfigInstanceSettings.toBuilder();
-      updateNetworkInterfaceInstanceSettings = settings.updateNetworkInterfaceInstanceSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addAccessConfigInstanceSettings,
-          aggregatedListInstancesSettings,
-          attachDiskInstanceSettings,
-          deleteInstanceSettings,
-          deleteAccessConfigInstanceSettings,
-          detachDiskInstanceSettings,
-          getInstanceSettings,
-          getSerialPortOutputInstanceSettings,
-          insertInstanceSettings,
-          listInstancesSettings,
-          listReferrersInstancesSettings,
-          resetInstanceSettings,
-          setDeletionProtectionInstanceSettings,
-          setDiskAutoDeleteInstanceSettings,
-          setLabelsInstanceSettings,
-          setMachineResourcesInstanceSettings,
-          setMachineTypeInstanceSettings,
-          setMetadataInstanceSettings,
-          setMinCpuPlatformInstanceSettings,
-          setSchedulingInstanceSettings,
-          setServiceAccountInstanceSettings,
-          setTagsInstanceSettings,
-          startInstanceSettings,
-          startWithEncryptionKeyInstanceSettings,
-          stopInstanceSettings,
-          updateAccessConfigInstanceSettings,
-          updateNetworkInterfaceInstanceSettings
-      );
+      updateNetworkInterfaceInstanceSettings =
+          settings.updateNetworkInterfaceInstanceSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addAccessConfigInstanceSettings,
+              aggregatedListInstancesSettings,
+              attachDiskInstanceSettings,
+              deleteInstanceSettings,
+              deleteAccessConfigInstanceSettings,
+              detachDiskInstanceSettings,
+              getInstanceSettings,
+              getSerialPortOutputInstanceSettings,
+              insertInstanceSettings,
+              listInstancesSettings,
+              listReferrersInstancesSettings,
+              resetInstanceSettings,
+              setDeletionProtectionInstanceSettings,
+              setDiskAutoDeleteInstanceSettings,
+              setLabelsInstanceSettings,
+              setMachineResourcesInstanceSettings,
+              setMachineTypeInstanceSettings,
+              setMetadataInstanceSettings,
+              setMinCpuPlatformInstanceSettings,
+              setSchedulingInstanceSettings,
+              setServiceAccountInstanceSettings,
+              setTagsInstanceSettings,
+              startInstanceSettings,
+              startWithEncryptionKeyInstanceSettings,
+              stopInstanceSettings,
+              updateAccessConfigInstanceSettings,
+              updateNetworkInterfaceInstanceSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -976,192 +1052,166 @@ public Builder applyToAllUnaryMethods(ApiFunction addAccessConfigInstanceSettings() { + /** Returns the builder for the settings used for calls to addAccessConfigInstance. */ + public UnaryCallSettings.Builder + addAccessConfigInstanceSettings() { return addAccessConfigInstanceSettings; } - /** - * Returns the builder for the settings used for calls to aggregatedListInstances. - */ - public PagedCallSettings.Builder aggregatedListInstancesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListInstances. */ + public PagedCallSettings.Builder< + AggregatedListInstancesHttpRequest, InstanceAggregatedList, + AggregatedListInstancesPagedResponse> + aggregatedListInstancesSettings() { return aggregatedListInstancesSettings; } - /** - * Returns the builder for the settings used for calls to attachDiskInstance. - */ - public UnaryCallSettings.Builder attachDiskInstanceSettings() { + /** Returns the builder for the settings used for calls to attachDiskInstance. */ + public UnaryCallSettings.Builder + attachDiskInstanceSettings() { return attachDiskInstanceSettings; } - /** - * Returns the builder for the settings used for calls to deleteInstance. - */ - public UnaryCallSettings.Builder deleteInstanceSettings() { + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder + deleteInstanceSettings() { return deleteInstanceSettings; } - /** - * Returns the builder for the settings used for calls to deleteAccessConfigInstance. - */ - public UnaryCallSettings.Builder deleteAccessConfigInstanceSettings() { + /** Returns the builder for the settings used for calls to deleteAccessConfigInstance. */ + public UnaryCallSettings.Builder + deleteAccessConfigInstanceSettings() { return deleteAccessConfigInstanceSettings; } - /** - * Returns the builder for the settings used for calls to detachDiskInstance. - */ - public UnaryCallSettings.Builder detachDiskInstanceSettings() { + /** Returns the builder for the settings used for calls to detachDiskInstance. */ + public UnaryCallSettings.Builder + detachDiskInstanceSettings() { return detachDiskInstanceSettings; } - /** - * Returns the builder for the settings used for calls to getInstance. - */ + /** Returns the builder for the settings used for calls to getInstance. */ public UnaryCallSettings.Builder getInstanceSettings() { return getInstanceSettings; } - /** - * Returns the builder for the settings used for calls to getSerialPortOutputInstance. - */ - public UnaryCallSettings.Builder getSerialPortOutputInstanceSettings() { + /** Returns the builder for the settings used for calls to getSerialPortOutputInstance. */ + public UnaryCallSettings.Builder + getSerialPortOutputInstanceSettings() { return getSerialPortOutputInstanceSettings; } - /** - * Returns the builder for the settings used for calls to insertInstance. - */ - public UnaryCallSettings.Builder insertInstanceSettings() { + /** Returns the builder for the settings used for calls to insertInstance. */ + public UnaryCallSettings.Builder + insertInstanceSettings() { return insertInstanceSettings; } - /** - * Returns the builder for the settings used for calls to listInstances. - */ - public PagedCallSettings.Builder listInstancesSettings() { + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesHttpRequest, InstanceList, ListInstancesPagedResponse> + listInstancesSettings() { return listInstancesSettings; } - /** - * Returns the builder for the settings used for calls to listReferrersInstances. - */ - public PagedCallSettings.Builder listReferrersInstancesSettings() { + /** Returns the builder for the settings used for calls to listReferrersInstances. */ + public PagedCallSettings.Builder< + ListReferrersInstancesHttpRequest, InstanceListReferrers, + ListReferrersInstancesPagedResponse> + listReferrersInstancesSettings() { return listReferrersInstancesSettings; } - /** - * Returns the builder for the settings used for calls to resetInstance. - */ + /** Returns the builder for the settings used for calls to resetInstance. */ public UnaryCallSettings.Builder resetInstanceSettings() { return resetInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setDeletionProtectionInstance. - */ - public UnaryCallSettings.Builder setDeletionProtectionInstanceSettings() { + /** Returns the builder for the settings used for calls to setDeletionProtectionInstance. */ + public UnaryCallSettings.Builder + setDeletionProtectionInstanceSettings() { return setDeletionProtectionInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. - */ - public UnaryCallSettings.Builder setDiskAutoDeleteInstanceSettings() { + /** Returns the builder for the settings used for calls to setDiskAutoDeleteInstance. */ + public UnaryCallSettings.Builder + setDiskAutoDeleteInstanceSettings() { return setDiskAutoDeleteInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setLabelsInstance. - */ - public UnaryCallSettings.Builder setLabelsInstanceSettings() { + /** Returns the builder for the settings used for calls to setLabelsInstance. */ + public UnaryCallSettings.Builder + setLabelsInstanceSettings() { return setLabelsInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setMachineResourcesInstance. - */ - public UnaryCallSettings.Builder setMachineResourcesInstanceSettings() { + /** Returns the builder for the settings used for calls to setMachineResourcesInstance. */ + public UnaryCallSettings.Builder + setMachineResourcesInstanceSettings() { return setMachineResourcesInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setMachineTypeInstance. - */ - public UnaryCallSettings.Builder setMachineTypeInstanceSettings() { + /** Returns the builder for the settings used for calls to setMachineTypeInstance. */ + public UnaryCallSettings.Builder + setMachineTypeInstanceSettings() { return setMachineTypeInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setMetadataInstance. - */ - public UnaryCallSettings.Builder setMetadataInstanceSettings() { + /** Returns the builder for the settings used for calls to setMetadataInstance. */ + public UnaryCallSettings.Builder + setMetadataInstanceSettings() { return setMetadataInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setMinCpuPlatformInstance. - */ - public UnaryCallSettings.Builder setMinCpuPlatformInstanceSettings() { + /** Returns the builder for the settings used for calls to setMinCpuPlatformInstance. */ + public UnaryCallSettings.Builder + setMinCpuPlatformInstanceSettings() { return setMinCpuPlatformInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setSchedulingInstance. - */ - public UnaryCallSettings.Builder setSchedulingInstanceSettings() { + /** Returns the builder for the settings used for calls to setSchedulingInstance. */ + public UnaryCallSettings.Builder + setSchedulingInstanceSettings() { return setSchedulingInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setServiceAccountInstance. - */ - public UnaryCallSettings.Builder setServiceAccountInstanceSettings() { + /** Returns the builder for the settings used for calls to setServiceAccountInstance. */ + public UnaryCallSettings.Builder + setServiceAccountInstanceSettings() { return setServiceAccountInstanceSettings; } - /** - * Returns the builder for the settings used for calls to setTagsInstance. - */ - public UnaryCallSettings.Builder setTagsInstanceSettings() { + /** Returns the builder for the settings used for calls to setTagsInstance. */ + public UnaryCallSettings.Builder + setTagsInstanceSettings() { return setTagsInstanceSettings; } - /** - * Returns the builder for the settings used for calls to startInstance. - */ + /** Returns the builder for the settings used for calls to startInstance. */ public UnaryCallSettings.Builder startInstanceSettings() { return startInstanceSettings; } - /** - * Returns the builder for the settings used for calls to startWithEncryptionKeyInstance. - */ - public UnaryCallSettings.Builder startWithEncryptionKeyInstanceSettings() { + /** Returns the builder for the settings used for calls to startWithEncryptionKeyInstance. */ + public UnaryCallSettings.Builder + startWithEncryptionKeyInstanceSettings() { return startWithEncryptionKeyInstanceSettings; } - /** - * Returns the builder for the settings used for calls to stopInstance. - */ + /** Returns the builder for the settings used for calls to stopInstance. */ public UnaryCallSettings.Builder stopInstanceSettings() { return stopInstanceSettings; } - /** - * Returns the builder for the settings used for calls to updateAccessConfigInstance. - */ - public UnaryCallSettings.Builder updateAccessConfigInstanceSettings() { + /** Returns the builder for the settings used for calls to updateAccessConfigInstance. */ + public UnaryCallSettings.Builder + updateAccessConfigInstanceSettings() { return updateAccessConfigInstanceSettings; } - /** - * Returns the builder for the settings used for calls to updateNetworkInterfaceInstance. - */ - public UnaryCallSettings.Builder updateNetworkInterfaceInstanceSettings() { + /** Returns the builder for the settings used for calls to updateNetworkInterfaceInstance. */ + public UnaryCallSettings.Builder + updateNetworkInterfaceInstanceSettings() { return updateNetworkInterfaceInstanceSettings; } @@ -1170,4 +1220,4 @@ public InstanceStubSettings build() throws IOException { return new InstanceStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java index 2975c6978c93..9d4642e83664 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,12 +24,9 @@ import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InstanceTemplate; -import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; import com.google.cloud.compute.v1.InstanceTemplateList; import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectInstanceTemplateName; -import com.google.cloud.compute.v1.ProjectName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -40,30 +39,37 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceTemplateStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteInstanceTemplateCallable() { + public UnaryCallable + deleteInstanceTemplateCallable() { throw new UnsupportedOperationException("Not implemented: deleteInstanceTemplateCallable()"); } @BetaApi - public UnaryCallable getInstanceTemplateCallable() { + public UnaryCallable + getInstanceTemplateCallable() { throw new UnsupportedOperationException("Not implemented: getInstanceTemplateCallable()"); } @BetaApi - public UnaryCallable insertInstanceTemplateCallable() { + public UnaryCallable + insertInstanceTemplateCallable() { throw new UnsupportedOperationException("Not implemented: insertInstanceTemplateCallable()"); } @BetaApi - public UnaryCallable listInstanceTemplatesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listInstanceTemplatesPagedCallable()"); + public UnaryCallable + listInstanceTemplatesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInstanceTemplatesPagedCallable()"); } @BetaApi - public UnaryCallable listInstanceTemplatesCallable() { + public UnaryCallable + listInstanceTemplatesCallable() { throw new UnsupportedOperationException("Not implemented: listInstanceTemplatesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java index aa06425baeb5..6c9ffc1e0d1c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +39,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InstanceTemplate; -import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; import com.google.cloud.compute.v1.InstanceTemplateList; import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; import com.google.cloud.compute.v1.Operation; @@ -54,10 +50,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -68,15 +62,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteInstanceTemplate to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteInstanceTemplate to 30 seconds: * *

  * 
@@ -91,52 +85,54 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InstanceTemplateStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteInstanceTemplateSettings;
-  private final UnaryCallSettings getInstanceTemplateSettings;
-  private final UnaryCallSettings insertInstanceTemplateSettings;
-  private final PagedCallSettings listInstanceTemplatesSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteInstanceTemplate.
-   */
-  public UnaryCallSettings deleteInstanceTemplateSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteInstanceTemplateSettings;
+  private final UnaryCallSettings
+      getInstanceTemplateSettings;
+  private final UnaryCallSettings
+      insertInstanceTemplateSettings;
+  private final PagedCallSettings<
+          ListInstanceTemplatesHttpRequest, InstanceTemplateList,
+          ListInstanceTemplatesPagedResponse>
+      listInstanceTemplatesSettings;
+
+  /** Returns the object with the settings used for calls to deleteInstanceTemplate. */
+  public UnaryCallSettings
+      deleteInstanceTemplateSettings() {
     return deleteInstanceTemplateSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInstanceTemplate.
-   */
-  public UnaryCallSettings getInstanceTemplateSettings() {
+  /** Returns the object with the settings used for calls to getInstanceTemplate. */
+  public UnaryCallSettings
+      getInstanceTemplateSettings() {
     return getInstanceTemplateSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInstanceTemplate.
-   */
-  public UnaryCallSettings insertInstanceTemplateSettings() {
+  /** Returns the object with the settings used for calls to insertInstanceTemplate. */
+  public UnaryCallSettings
+      insertInstanceTemplateSettings() {
     return insertInstanceTemplateSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstanceTemplates.
-   */
-  public PagedCallSettings listInstanceTemplatesSettings() {
+  /** Returns the object with the settings used for calls to listInstanceTemplates. */
+  public PagedCallSettings<
+          ListInstanceTemplatesHttpRequest, InstanceTemplateList,
+          ListInstanceTemplatesPagedResponse>
+      listInstanceTemplatesSettings() {
     return listInstanceTemplatesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InstanceTemplateStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -149,47 +145,34 @@ public InstanceTemplateStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -200,27 +183,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InstanceTemplateStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(InstanceTemplateStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -234,76 +214,96 @@ protected InstanceTemplateStubSettings(Builder settingsBuilder) throws IOExcepti
     listInstanceTemplatesSettings = settingsBuilder.listInstanceTemplatesSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_INSTANCE_TEMPLATES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInstanceTemplatesHttpRequest injectToken(ListInstanceTemplatesHttpRequest payload, String token) {
-          return ListInstanceTemplatesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInstanceTemplatesHttpRequest injectPageSize(ListInstanceTemplatesHttpRequest payload, int pageSize) {
-          return ListInstanceTemplatesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInstanceTemplatesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InstanceTemplateList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InstanceTemplateList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInstanceTemplatesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INSTANCE_TEMPLATES_PAGE_STR_DESC, request, context);
-          return ListInstanceTemplatesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InstanceTemplateStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListInstanceTemplatesHttpRequest, InstanceTemplateList, InstanceTemplate>
+      LIST_INSTANCE_TEMPLATES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInstanceTemplatesHttpRequest, InstanceTemplateList, InstanceTemplate>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInstanceTemplatesHttpRequest injectToken(
+                ListInstanceTemplatesHttpRequest payload, String token) {
+              return ListInstanceTemplatesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListInstanceTemplatesHttpRequest injectPageSize(
+                ListInstanceTemplatesHttpRequest payload, int pageSize) {
+              return ListInstanceTemplatesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInstanceTemplatesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InstanceTemplateList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(InstanceTemplateList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInstanceTemplatesHttpRequest, InstanceTemplateList,
+          ListInstanceTemplatesPagedResponse>
+      LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInstanceTemplatesHttpRequest, InstanceTemplateList,
+              ListInstanceTemplatesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListInstanceTemplatesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INSTANCE_TEMPLATES_PAGE_STR_DESC, request, context);
+              return ListInstanceTemplatesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InstanceTemplateStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteInstanceTemplateSettings;
-    private final UnaryCallSettings.Builder getInstanceTemplateSettings;
-    private final UnaryCallSettings.Builder insertInstanceTemplateSettings;
-    private final PagedCallSettings.Builder listInstanceTemplatesSettings;
+    private final UnaryCallSettings.Builder
+        deleteInstanceTemplateSettings;
+    private final UnaryCallSettings.Builder
+        getInstanceTemplateSettings;
+    private final UnaryCallSettings.Builder
+        insertInstanceTemplateSettings;
+    private final PagedCallSettings.Builder<
+            ListInstanceTemplatesHttpRequest, InstanceTemplateList,
+            ListInstanceTemplatesPagedResponse>
+        listInstanceTemplatesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -312,15 +312,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -338,15 +339,15 @@ protected Builder(ClientContext clientContext) {
 
       insertInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInstanceTemplatesSettings = PagedCallSettings.newBuilder(
-          LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT);
+      listInstanceTemplatesSettings =
+          PagedCallSettings.newBuilder(LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteInstanceTemplateSettings,
-          getInstanceTemplateSettings,
-          insertInstanceTemplateSettings,
-          listInstanceTemplatesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteInstanceTemplateSettings,
+              getInstanceTemplateSettings,
+              insertInstanceTemplateSettings,
+              listInstanceTemplatesSettings);
 
       initDefaults(this);
     }
@@ -362,19 +363,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteInstanceTemplateSettings()
+      builder
+          .deleteInstanceTemplateSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getInstanceTemplateSettings()
+      builder
+          .getInstanceTemplateSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertInstanceTemplateSettings()
+      builder
+          .insertInstanceTemplateSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInstanceTemplatesSettings()
+      builder
+          .listInstanceTemplatesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -389,20 +394,22 @@ protected Builder(InstanceTemplateStubSettings settings) {
       insertInstanceTemplateSettings = settings.insertInstanceTemplateSettings.toBuilder();
       listInstanceTemplatesSettings = settings.listInstanceTemplatesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteInstanceTemplateSettings,
-          getInstanceTemplateSettings,
-          insertInstanceTemplateSettings,
-          listInstanceTemplatesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteInstanceTemplateSettings,
+              getInstanceTemplateSettings,
+              insertInstanceTemplateSettings,
+              listInstanceTemplatesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -411,31 +418,29 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteInstanceTemplateSettings() { + /** Returns the builder for the settings used for calls to deleteInstanceTemplate. */ + public UnaryCallSettings.Builder + deleteInstanceTemplateSettings() { return deleteInstanceTemplateSettings; } - /** - * Returns the builder for the settings used for calls to getInstanceTemplate. - */ - public UnaryCallSettings.Builder getInstanceTemplateSettings() { + /** Returns the builder for the settings used for calls to getInstanceTemplate. */ + public UnaryCallSettings.Builder + getInstanceTemplateSettings() { return getInstanceTemplateSettings; } - /** - * Returns the builder for the settings used for calls to insertInstanceTemplate. - */ - public UnaryCallSettings.Builder insertInstanceTemplateSettings() { + /** Returns the builder for the settings used for calls to insertInstanceTemplate. */ + public UnaryCallSettings.Builder + insertInstanceTemplateSettings() { return insertInstanceTemplateSettings; } - /** - * Returns the builder for the settings used for calls to listInstanceTemplates. - */ - public PagedCallSettings.Builder listInstanceTemplatesSettings() { + /** Returns the builder for the settings used for calls to listInstanceTemplates. */ + public PagedCallSettings.Builder< + ListInstanceTemplatesHttpRequest, InstanceTemplateList, + ListInstanceTemplatesPagedResponse> + listInstanceTemplatesSettings() { return listInstanceTemplatesSettings; } @@ -444,4 +449,4 @@ public InstanceTemplateStubSettings build() throws IOException { return new InstanceTemplateStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java index 1a737f7e4b5f..1eebccc45141 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -24,15 +27,9 @@ import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; import com.google.cloud.compute.v1.InterconnectAttachment; import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; import com.google.cloud.compute.v1.InterconnectAttachmentList; -import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName; -import com.google.cloud.compute.v1.ProjectRegionName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -45,40 +42,58 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InterconnectAttachmentStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListInterconnectAttachmentsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInterconnectAttachmentsPagedCallable()"); + public UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, + AggregatedListInterconnectAttachmentsPagedResponse> + aggregatedListInterconnectAttachmentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInterconnectAttachmentsPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListInterconnectAttachmentsCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListInterconnectAttachmentsCallable()"); + public UnaryCallable< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList> + aggregatedListInterconnectAttachmentsCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListInterconnectAttachmentsCallable()"); } @BetaApi - public UnaryCallable deleteInterconnectAttachmentCallable() { - throw new UnsupportedOperationException("Not implemented: deleteInterconnectAttachmentCallable()"); + public UnaryCallable + deleteInterconnectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteInterconnectAttachmentCallable()"); } @BetaApi - public UnaryCallable getInterconnectAttachmentCallable() { + public UnaryCallable + getInterconnectAttachmentCallable() { throw new UnsupportedOperationException("Not implemented: getInterconnectAttachmentCallable()"); } @BetaApi - public UnaryCallable insertInterconnectAttachmentCallable() { - throw new UnsupportedOperationException("Not implemented: insertInterconnectAttachmentCallable()"); + public UnaryCallable + insertInterconnectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: insertInterconnectAttachmentCallable()"); } @BetaApi - public UnaryCallable listInterconnectAttachmentsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listInterconnectAttachmentsPagedCallable()"); + public UnaryCallable< + ListInterconnectAttachmentsHttpRequest, ListInterconnectAttachmentsPagedResponse> + listInterconnectAttachmentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInterconnectAttachmentsPagedCallable()"); } @BetaApi - public UnaryCallable listInterconnectAttachmentsCallable() { - throw new UnsupportedOperationException("Not implemented: listInterconnectAttachmentsCallable()"); + public UnaryCallable + listInterconnectAttachmentsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInterconnectAttachmentsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java index 9d04aaeb181d..0690ce168534 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,15 +40,12 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsHttpRequest; import com.google.cloud.compute.v1.DeleteInterconnectAttachmentHttpRequest; import com.google.cloud.compute.v1.GetInterconnectAttachmentHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectAttachmentHttpRequest; import com.google.cloud.compute.v1.InterconnectAttachment; import com.google.cloud.compute.v1.InterconnectAttachmentAggregatedList; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; import com.google.cloud.compute.v1.InterconnectAttachmentList; import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; @@ -58,10 +54,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteInterconnectAttachment to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteInterconnectAttachment to 30 seconds: * *

  * 
@@ -94,61 +88,70 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class InterconnectAttachmentStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListInterconnectAttachmentsSettings;
-  private final UnaryCallSettings deleteInterconnectAttachmentSettings;
-  private final UnaryCallSettings getInterconnectAttachmentSettings;
-  private final UnaryCallSettings insertInterconnectAttachmentSettings;
-  private final PagedCallSettings listInterconnectAttachmentsSettings;
+public class InterconnectAttachmentStubSettings
+    extends StubSettings {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList,
+          AggregatedListInterconnectAttachmentsPagedResponse>
+      aggregatedListInterconnectAttachmentsSettings;
+  private final UnaryCallSettings
+      deleteInterconnectAttachmentSettings;
+  private final UnaryCallSettings
+      getInterconnectAttachmentSettings;
+  private final UnaryCallSettings
+      insertInterconnectAttachmentSettings;
+  private final PagedCallSettings<
+          ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+          ListInterconnectAttachmentsPagedResponse>
+      listInterconnectAttachmentsSettings;
 
   /**
    * Returns the object with the settings used for calls to aggregatedListInterconnectAttachments.
    */
-  public PagedCallSettings aggregatedListInterconnectAttachmentsSettings() {
+  public PagedCallSettings<
+          AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList,
+          AggregatedListInterconnectAttachmentsPagedResponse>
+      aggregatedListInterconnectAttachmentsSettings() {
     return aggregatedListInterconnectAttachmentsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteInterconnectAttachment.
-   */
-  public UnaryCallSettings deleteInterconnectAttachmentSettings() {
+  /** Returns the object with the settings used for calls to deleteInterconnectAttachment. */
+  public UnaryCallSettings
+      deleteInterconnectAttachmentSettings() {
     return deleteInterconnectAttachmentSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInterconnectAttachment.
-   */
-  public UnaryCallSettings getInterconnectAttachmentSettings() {
+  /** Returns the object with the settings used for calls to getInterconnectAttachment. */
+  public UnaryCallSettings
+      getInterconnectAttachmentSettings() {
     return getInterconnectAttachmentSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInterconnectAttachment.
-   */
-  public UnaryCallSettings insertInterconnectAttachmentSettings() {
+  /** Returns the object with the settings used for calls to insertInterconnectAttachment. */
+  public UnaryCallSettings
+      insertInterconnectAttachmentSettings() {
     return insertInterconnectAttachmentSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInterconnectAttachments.
-   */
-  public PagedCallSettings listInterconnectAttachmentsSettings() {
+  /** Returns the object with the settings used for calls to listInterconnectAttachments. */
+  public PagedCallSettings<
+          ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+          ListInterconnectAttachmentsPagedResponse>
+      listInterconnectAttachmentsSettings() {
     return listInterconnectAttachmentsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InterconnectAttachmentStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -161,47 +164,34 @@ public InterconnectAttachmentStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -212,27 +202,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InterconnectAttachmentStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(InterconnectAttachmentStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -240,132 +227,198 @@ public Builder toBuilder() {
   protected InterconnectAttachmentStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListInterconnectAttachmentsSettings = settingsBuilder.aggregatedListInterconnectAttachmentsSettings().build();
-    deleteInterconnectAttachmentSettings = settingsBuilder.deleteInterconnectAttachmentSettings().build();
+    aggregatedListInterconnectAttachmentsSettings =
+        settingsBuilder.aggregatedListInterconnectAttachmentsSettings().build();
+    deleteInterconnectAttachmentSettings =
+        settingsBuilder.deleteInterconnectAttachmentSettings().build();
     getInterconnectAttachmentSettings = settingsBuilder.getInterconnectAttachmentSettings().build();
-    insertInterconnectAttachmentSettings = settingsBuilder.insertInterconnectAttachmentSettings().build();
-    listInterconnectAttachmentsSettings = settingsBuilder.listInterconnectAttachmentsSettings().build();
+    insertInterconnectAttachmentSettings =
+        settingsBuilder.insertInterconnectAttachmentSettings().build();
+    listInterconnectAttachmentsSettings =
+        settingsBuilder.listInterconnectAttachmentsSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListInterconnectAttachmentsHttpRequest injectToken(AggregatedListInterconnectAttachmentsHttpRequest payload, String token) {
-          return AggregatedListInterconnectAttachmentsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListInterconnectAttachmentsHttpRequest injectPageSize(AggregatedListInterconnectAttachmentsHttpRequest payload, int pageSize) {
-          return AggregatedListInterconnectAttachmentsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListInterconnectAttachmentsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InterconnectAttachmentAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InterconnectAttachmentAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInterconnectAttachmentsHttpRequest injectToken(ListInterconnectAttachmentsHttpRequest payload, String token) {
-          return ListInterconnectAttachmentsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInterconnectAttachmentsHttpRequest injectPageSize(ListInterconnectAttachmentsHttpRequest payload, int pageSize) {
-          return ListInterconnectAttachmentsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInterconnectAttachmentsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InterconnectAttachmentList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InterconnectAttachmentList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListInterconnectAttachmentsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC, request, context);
-          return AggregatedListInterconnectAttachmentsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInterconnectAttachmentsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC, request, context);
-          return ListInterconnectAttachmentsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InterconnectAttachmentStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList,
+          InterconnectAttachmentsScopedList>
+      AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListInterconnectAttachmentsHttpRequest,
+              InterconnectAttachmentAggregatedList, InterconnectAttachmentsScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListInterconnectAttachmentsHttpRequest injectToken(
+                AggregatedListInterconnectAttachmentsHttpRequest payload, String token) {
+              return AggregatedListInterconnectAttachmentsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListInterconnectAttachmentsHttpRequest injectPageSize(
+                AggregatedListInterconnectAttachmentsHttpRequest payload, int pageSize) {
+              return AggregatedListInterconnectAttachmentsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(
+                AggregatedListInterconnectAttachmentsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InterconnectAttachmentAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InterconnectAttachmentAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+          InterconnectAttachment>
+      LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+              InterconnectAttachment>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInterconnectAttachmentsHttpRequest injectToken(
+                ListInterconnectAttachmentsHttpRequest payload, String token) {
+              return ListInterconnectAttachmentsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListInterconnectAttachmentsHttpRequest injectPageSize(
+                ListInterconnectAttachmentsHttpRequest payload, int pageSize) {
+              return ListInterconnectAttachmentsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInterconnectAttachmentsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InterconnectAttachmentList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InterconnectAttachmentList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList,
+          AggregatedListInterconnectAttachmentsPagedResponse>
+      AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListInterconnectAttachmentsHttpRequest,
+              InterconnectAttachmentAggregatedList,
+              AggregatedListInterconnectAttachmentsPagedResponse>() {
+            @Override
+            public ApiFuture
+                getFuturePagedResponse(
+                    UnaryCallable<
+                            AggregatedListInterconnectAttachmentsHttpRequest,
+                            InterconnectAttachmentAggregatedList>
+                        callable,
+                    AggregatedListInterconnectAttachmentsHttpRequest request,
+                    ApiCallContext context,
+                    ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListInterconnectAttachmentsHttpRequest,
+                      InterconnectAttachmentAggregatedList, InterconnectAttachmentsScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListInterconnectAttachmentsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+          ListInterconnectAttachmentsPagedResponse>
+      LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+              ListInterconnectAttachmentsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                ListInterconnectAttachmentsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+                      InterconnectAttachment>
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_DESC, request, context);
+              return ListInterconnectAttachmentsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InterconnectAttachmentStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListInterconnectAttachmentsSettings;
-    private final UnaryCallSettings.Builder deleteInterconnectAttachmentSettings;
-    private final UnaryCallSettings.Builder getInterconnectAttachmentSettings;
-    private final UnaryCallSettings.Builder insertInterconnectAttachmentSettings;
-    private final PagedCallSettings.Builder listInterconnectAttachmentsSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList,
+            AggregatedListInterconnectAttachmentsPagedResponse>
+        aggregatedListInterconnectAttachmentsSettings;
+    private final UnaryCallSettings.Builder
+        deleteInterconnectAttachmentSettings;
+    private final UnaryCallSettings.Builder<
+            GetInterconnectAttachmentHttpRequest, InterconnectAttachment>
+        getInterconnectAttachmentSettings;
+    private final UnaryCallSettings.Builder
+        insertInterconnectAttachmentSettings;
+    private final PagedCallSettings.Builder<
+            ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList,
+            ListInterconnectAttachmentsPagedResponse>
+        listInterconnectAttachmentsSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -374,15 +427,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -394,8 +448,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListInterconnectAttachmentsSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT);
+      aggregatedListInterconnectAttachmentsSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT);
 
       deleteInterconnectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -403,16 +457,16 @@ protected Builder(ClientContext clientContext) {
 
       insertInterconnectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInterconnectAttachmentsSettings = PagedCallSettings.newBuilder(
-          LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT);
+      listInterconnectAttachmentsSettings =
+          PagedCallSettings.newBuilder(LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListInterconnectAttachmentsSettings,
-          deleteInterconnectAttachmentSettings,
-          getInterconnectAttachmentSettings,
-          insertInterconnectAttachmentSettings,
-          listInterconnectAttachmentsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListInterconnectAttachmentsSettings,
+              deleteInterconnectAttachmentSettings,
+              getInterconnectAttachmentSettings,
+              insertInterconnectAttachmentSettings,
+              listInterconnectAttachmentsSettings);
 
       initDefaults(this);
     }
@@ -428,23 +482,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListInterconnectAttachmentsSettings()
+      builder
+          .aggregatedListInterconnectAttachmentsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteInterconnectAttachmentSettings()
+      builder
+          .deleteInterconnectAttachmentSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getInterconnectAttachmentSettings()
+      builder
+          .getInterconnectAttachmentSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertInterconnectAttachmentSettings()
+      builder
+          .insertInterconnectAttachmentSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInterconnectAttachmentsSettings()
+      builder
+          .listInterconnectAttachmentsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -454,27 +513,33 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(InterconnectAttachmentStubSettings settings) {
       super(settings);
 
-      aggregatedListInterconnectAttachmentsSettings = settings.aggregatedListInterconnectAttachmentsSettings.toBuilder();
-      deleteInterconnectAttachmentSettings = settings.deleteInterconnectAttachmentSettings.toBuilder();
+      aggregatedListInterconnectAttachmentsSettings =
+          settings.aggregatedListInterconnectAttachmentsSettings.toBuilder();
+      deleteInterconnectAttachmentSettings =
+          settings.deleteInterconnectAttachmentSettings.toBuilder();
       getInterconnectAttachmentSettings = settings.getInterconnectAttachmentSettings.toBuilder();
-      insertInterconnectAttachmentSettings = settings.insertInterconnectAttachmentSettings.toBuilder();
-      listInterconnectAttachmentsSettings = settings.listInterconnectAttachmentsSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListInterconnectAttachmentsSettings,
-          deleteInterconnectAttachmentSettings,
-          getInterconnectAttachmentSettings,
-          insertInterconnectAttachmentSettings,
-          listInterconnectAttachmentsSettings
-      );
+      insertInterconnectAttachmentSettings =
+          settings.insertInterconnectAttachmentSettings.toBuilder();
+      listInterconnectAttachmentsSettings =
+          settings.listInterconnectAttachmentsSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListInterconnectAttachmentsSettings,
+              deleteInterconnectAttachmentSettings,
+              getInterconnectAttachmentSettings,
+              insertInterconnectAttachmentSettings,
+              listInterconnectAttachmentsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -486,35 +551,36 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListInterconnectAttachmentsSettings() { + public PagedCallSettings.Builder< + AggregatedListInterconnectAttachmentsHttpRequest, InterconnectAttachmentAggregatedList, + AggregatedListInterconnectAttachmentsPagedResponse> + aggregatedListInterconnectAttachmentsSettings() { return aggregatedListInterconnectAttachmentsSettings; } - /** - * Returns the builder for the settings used for calls to deleteInterconnectAttachment. - */ - public UnaryCallSettings.Builder deleteInterconnectAttachmentSettings() { + /** Returns the builder for the settings used for calls to deleteInterconnectAttachment. */ + public UnaryCallSettings.Builder + deleteInterconnectAttachmentSettings() { return deleteInterconnectAttachmentSettings; } - /** - * Returns the builder for the settings used for calls to getInterconnectAttachment. - */ - public UnaryCallSettings.Builder getInterconnectAttachmentSettings() { + /** Returns the builder for the settings used for calls to getInterconnectAttachment. */ + public UnaryCallSettings.Builder + getInterconnectAttachmentSettings() { return getInterconnectAttachmentSettings; } - /** - * Returns the builder for the settings used for calls to insertInterconnectAttachment. - */ - public UnaryCallSettings.Builder insertInterconnectAttachmentSettings() { + /** Returns the builder for the settings used for calls to insertInterconnectAttachment. */ + public UnaryCallSettings.Builder + insertInterconnectAttachmentSettings() { return insertInterconnectAttachmentSettings; } - /** - * Returns the builder for the settings used for calls to listInterconnectAttachments. - */ - public PagedCallSettings.Builder listInterconnectAttachmentsSettings() { + /** Returns the builder for the settings used for calls to listInterconnectAttachments. */ + public PagedCallSettings.Builder< + ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, + ListInterconnectAttachmentsPagedResponse> + listInterconnectAttachmentsSettings() { return listInterconnectAttachmentsSettings; } @@ -523,4 +589,4 @@ public InterconnectAttachmentStubSettings build() throws IOException { return new InterconnectAttachmentStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java index d9f13458b918..185918a9eaa5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java @@ -15,16 +15,15 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; import com.google.cloud.compute.v1.InterconnectLocation; -import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; import com.google.cloud.compute.v1.InterconnectLocationList; import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; -import com.google.cloud.compute.v1.ProjectInterconnectLocationName; -import com.google.cloud.compute.v1.ProjectName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -37,20 +36,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InterconnectLocationStub implements BackgroundResource { - @BetaApi - public UnaryCallable getInterconnectLocationCallable() { + public UnaryCallable + getInterconnectLocationCallable() { throw new UnsupportedOperationException("Not implemented: getInterconnectLocationCallable()"); } @BetaApi - public UnaryCallable listInterconnectLocationsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listInterconnectLocationsPagedCallable()"); + public UnaryCallable + listInterconnectLocationsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInterconnectLocationsPagedCallable()"); } @BetaApi - public UnaryCallable listInterconnectLocationsCallable() { + public UnaryCallable + listInterconnectLocationsCallable() { throw new UnsupportedOperationException("Not implemented: listInterconnectLocationsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java index 383a047572e0..ee57abbe4bfd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,20 +39,16 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.GetInterconnectLocationHttpRequest; import com.google.cloud.compute.v1.InterconnectLocation; -import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; import com.google.cloud.compute.v1.InterconnectLocationList; import com.google.cloud.compute.v1.ListInterconnectLocationsHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -65,15 +59,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getInterconnectLocation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getInterconnectLocation to 30 seconds: * *

  * 
@@ -87,37 +81,40 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class InterconnectLocationStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings getInterconnectLocationSettings;
-  private final PagedCallSettings listInterconnectLocationsSettings;
-
-  /**
-   * Returns the object with the settings used for calls to getInterconnectLocation.
-   */
-  public UnaryCallSettings getInterconnectLocationSettings() {
+public class InterconnectLocationStubSettings
+    extends StubSettings {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      getInterconnectLocationSettings;
+  private final PagedCallSettings<
+          ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+          ListInterconnectLocationsPagedResponse>
+      listInterconnectLocationsSettings;
+
+  /** Returns the object with the settings used for calls to getInterconnectLocation. */
+  public UnaryCallSettings
+      getInterconnectLocationSettings() {
     return getInterconnectLocationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInterconnectLocations.
-   */
-  public PagedCallSettings listInterconnectLocationsSettings() {
+  /** Returns the object with the settings used for calls to listInterconnectLocations. */
+  public PagedCallSettings<
+          ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+          ListInterconnectLocationsPagedResponse>
+      listInterconnectLocationsSettings() {
     return listInterconnectLocationsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InterconnectLocationStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -130,47 +127,34 @@ public InterconnectLocationStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -181,27 +165,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InterconnectLocationStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(InterconnectLocationStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -213,74 +194,100 @@ protected InterconnectLocationStubSettings(Builder settingsBuilder) throws IOExc
     listInterconnectLocationsSettings = settingsBuilder.listInterconnectLocationsSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_INTERCONNECT_LOCATIONS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInterconnectLocationsHttpRequest injectToken(ListInterconnectLocationsHttpRequest payload, String token) {
-          return ListInterconnectLocationsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInterconnectLocationsHttpRequest injectPageSize(ListInterconnectLocationsHttpRequest payload, int pageSize) {
-          return ListInterconnectLocationsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInterconnectLocationsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InterconnectLocationList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InterconnectLocationList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INTERCONNECT_LOCATIONS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInterconnectLocationsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INTERCONNECT_LOCATIONS_PAGE_STR_DESC, request, context);
-          return ListInterconnectLocationsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InterconnectLocationStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          ListInterconnectLocationsHttpRequest, InterconnectLocationList, InterconnectLocation>
+      LIST_INTERCONNECT_LOCATIONS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+              InterconnectLocation>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInterconnectLocationsHttpRequest injectToken(
+                ListInterconnectLocationsHttpRequest payload, String token) {
+              return ListInterconnectLocationsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListInterconnectLocationsHttpRequest injectPageSize(
+                ListInterconnectLocationsHttpRequest payload, int pageSize) {
+              return ListInterconnectLocationsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInterconnectLocationsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InterconnectLocationList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                InterconnectLocationList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+          ListInterconnectLocationsPagedResponse>
+      LIST_INTERCONNECT_LOCATIONS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+              ListInterconnectLocationsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                ListInterconnectLocationsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+                      InterconnectLocation>
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INTERCONNECT_LOCATIONS_PAGE_STR_DESC, request, context);
+              return ListInterconnectLocationsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InterconnectLocationStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder getInterconnectLocationSettings;
-    private final PagedCallSettings.Builder listInterconnectLocationsSettings;
+    private final UnaryCallSettings.Builder<
+            GetInterconnectLocationHttpRequest, InterconnectLocation>
+        getInterconnectLocationSettings;
+    private final PagedCallSettings.Builder<
+            ListInterconnectLocationsHttpRequest, InterconnectLocationList,
+            ListInterconnectLocationsPagedResponse>
+        listInterconnectLocationsSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -289,15 +296,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -311,13 +319,12 @@ protected Builder(ClientContext clientContext) {
 
       getInterconnectLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInterconnectLocationsSettings = PagedCallSettings.newBuilder(
-          LIST_INTERCONNECT_LOCATIONS_PAGE_STR_FACT);
+      listInterconnectLocationsSettings =
+          PagedCallSettings.newBuilder(LIST_INTERCONNECT_LOCATIONS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getInterconnectLocationSettings,
-          listInterconnectLocationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              getInterconnectLocationSettings, listInterconnectLocationsSettings);
 
       initDefaults(this);
     }
@@ -333,11 +340,13 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.getInterconnectLocationSettings()
+      builder
+          .getInterconnectLocationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInterconnectLocationsSettings()
+      builder
+          .listInterconnectLocationsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -350,18 +359,19 @@ protected Builder(InterconnectLocationStubSettings settings) {
       getInterconnectLocationSettings = settings.getInterconnectLocationSettings.toBuilder();
       listInterconnectLocationsSettings = settings.listInterconnectLocationsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getInterconnectLocationSettings,
-          listInterconnectLocationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              getInterconnectLocationSettings, listInterconnectLocationsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -370,17 +380,17 @@ public Builder applyToAllUnaryMethods(ApiFunction getInterconnectLocationSettings() { + /** Returns the builder for the settings used for calls to getInterconnectLocation. */ + public UnaryCallSettings.Builder + getInterconnectLocationSettings() { return getInterconnectLocationSettings; } - /** - * Returns the builder for the settings used for calls to listInterconnectLocations. - */ - public PagedCallSettings.Builder listInterconnectLocationsSettings() { + /** Returns the builder for the settings used for calls to listInterconnectLocations. */ + public PagedCallSettings.Builder< + ListInterconnectLocationsHttpRequest, InterconnectLocationList, + ListInterconnectLocationsPagedResponse> + listInterconnectLocationsSettings() { return listInterconnectLocationsSettings; } @@ -389,4 +399,4 @@ public InterconnectLocationStubSettings build() throws IOException { return new InterconnectLocationStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java index c2309e90613a..1778606954b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,13 +24,10 @@ import com.google.cloud.compute.v1.GetInterconnectHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; import com.google.cloud.compute.v1.Interconnect; -import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; import com.google.cloud.compute.v1.InterconnectList; import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; -import com.google.cloud.compute.v1.ProjectInterconnectName; -import com.google.cloud.compute.v1.ProjectName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -41,7 +40,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InterconnectStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteInterconnectCallable() { throw new UnsupportedOperationException("Not implemented: deleteInterconnectCallable()"); @@ -58,7 +56,8 @@ public UnaryCallable insertInterconnec } @BetaApi - public UnaryCallable listInterconnectsPagedCallable() { + public UnaryCallable + listInterconnectsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listInterconnectsPagedCallable()"); } @@ -72,4 +71,6 @@ public UnaryCallable patchInterconnectC throw new UnsupportedOperationException("Not implemented: patchInterconnectCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java index 4e0d9e7849fe..d1de5c870d2e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,12 +39,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; import com.google.cloud.compute.v1.GetInterconnectHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; import com.google.cloud.compute.v1.Interconnect; -import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; import com.google.cloud.compute.v1.InterconnectList; import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; import com.google.cloud.compute.v1.Operation; @@ -55,10 +51,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -69,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteInterconnect to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteInterconnect to 30 seconds: * *

  * 
@@ -92,60 +86,55 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class InterconnectStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteInterconnectSettings;
-  private final UnaryCallSettings getInterconnectSettings;
-  private final UnaryCallSettings insertInterconnectSettings;
-  private final PagedCallSettings listInterconnectsSettings;
-  private final UnaryCallSettings patchInterconnectSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
-  /**
-   * Returns the object with the settings used for calls to deleteInterconnect.
-   */
+  private final UnaryCallSettings
+      deleteInterconnectSettings;
+  private final UnaryCallSettings getInterconnectSettings;
+  private final UnaryCallSettings
+      insertInterconnectSettings;
+  private final PagedCallSettings<
+          ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse>
+      listInterconnectsSettings;
+  private final UnaryCallSettings
+      patchInterconnectSettings;
+
+  /** Returns the object with the settings used for calls to deleteInterconnect. */
   public UnaryCallSettings deleteInterconnectSettings() {
     return deleteInterconnectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getInterconnect.
-   */
+  /** Returns the object with the settings used for calls to getInterconnect. */
   public UnaryCallSettings getInterconnectSettings() {
     return getInterconnectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertInterconnect.
-   */
+  /** Returns the object with the settings used for calls to insertInterconnect. */
   public UnaryCallSettings insertInterconnectSettings() {
     return insertInterconnectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInterconnects.
-   */
-  public PagedCallSettings listInterconnectsSettings() {
+  /** Returns the object with the settings used for calls to listInterconnects. */
+  public PagedCallSettings<
+          ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse>
+      listInterconnectsSettings() {
     return listInterconnectsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchInterconnect.
-   */
+  /** Returns the object with the settings used for calls to patchInterconnect. */
   public UnaryCallSettings patchInterconnectSettings() {
     return patchInterconnectSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public InterconnectStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -158,47 +147,34 @@ public InterconnectStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -209,27 +185,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(InterconnectStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(InterconnectStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -244,77 +217,92 @@ protected InterconnectStubSettings(Builder settingsBuilder) throws IOException {
     patchInterconnectSettings = settingsBuilder.patchInterconnectSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_INTERCONNECTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInterconnectsHttpRequest injectToken(ListInterconnectsHttpRequest payload, String token) {
-          return ListInterconnectsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInterconnectsHttpRequest injectPageSize(ListInterconnectsHttpRequest payload, int pageSize) {
-          return ListInterconnectsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInterconnectsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(InterconnectList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(InterconnectList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INTERCONNECTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInterconnectsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INTERCONNECTS_PAGE_STR_DESC, request, context);
-          return ListInterconnectsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for InterconnectStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListInterconnectsHttpRequest, InterconnectList, Interconnect>
+      LIST_INTERCONNECTS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInterconnectsHttpRequest injectToken(
+                ListInterconnectsHttpRequest payload, String token) {
+              return ListInterconnectsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListInterconnectsHttpRequest injectPageSize(
+                ListInterconnectsHttpRequest payload, int pageSize) {
+              return ListInterconnectsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInterconnectsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(InterconnectList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(InterconnectList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse>
+      LIST_INTERCONNECTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListInterconnectsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_INTERCONNECTS_PAGE_STR_DESC, request, context);
+              return ListInterconnectsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for InterconnectStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteInterconnectSettings;
-    private final UnaryCallSettings.Builder getInterconnectSettings;
-    private final UnaryCallSettings.Builder insertInterconnectSettings;
-    private final PagedCallSettings.Builder listInterconnectsSettings;
-    private final UnaryCallSettings.Builder patchInterconnectSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteInterconnectSettings;
+    private final UnaryCallSettings.Builder
+        getInterconnectSettings;
+    private final UnaryCallSettings.Builder
+        insertInterconnectSettings;
+    private final PagedCallSettings.Builder<
+            ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse>
+        listInterconnectsSettings;
+    private final UnaryCallSettings.Builder
+        patchInterconnectSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -323,15 +311,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -349,18 +338,17 @@ protected Builder(ClientContext clientContext) {
 
       insertInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listInterconnectsSettings = PagedCallSettings.newBuilder(
-          LIST_INTERCONNECTS_PAGE_STR_FACT);
+      listInterconnectsSettings = PagedCallSettings.newBuilder(LIST_INTERCONNECTS_PAGE_STR_FACT);
 
       patchInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteInterconnectSettings,
-          getInterconnectSettings,
-          insertInterconnectSettings,
-          listInterconnectsSettings,
-          patchInterconnectSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteInterconnectSettings,
+              getInterconnectSettings,
+              insertInterconnectSettings,
+              listInterconnectsSettings,
+              patchInterconnectSettings);
 
       initDefaults(this);
     }
@@ -376,23 +364,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteInterconnectSettings()
+      builder
+          .deleteInterconnectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getInterconnectSettings()
+      builder
+          .getInterconnectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertInterconnectSettings()
+      builder
+          .insertInterconnectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInterconnectsSettings()
+      builder
+          .listInterconnectsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchInterconnectSettings()
+      builder
+          .patchInterconnectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -408,21 +401,23 @@ protected Builder(InterconnectStubSettings settings) {
       listInterconnectsSettings = settings.listInterconnectsSettings.toBuilder();
       patchInterconnectSettings = settings.patchInterconnectSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteInterconnectSettings,
-          getInterconnectSettings,
-          insertInterconnectSettings,
-          listInterconnectsSettings,
-          patchInterconnectSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteInterconnectSettings,
+              getInterconnectSettings,
+              insertInterconnectSettings,
+              listInterconnectsSettings,
+              patchInterconnectSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -431,38 +426,34 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteInterconnectSettings() { + /** Returns the builder for the settings used for calls to deleteInterconnect. */ + public UnaryCallSettings.Builder + deleteInterconnectSettings() { return deleteInterconnectSettings; } - /** - * Returns the builder for the settings used for calls to getInterconnect. - */ - public UnaryCallSettings.Builder getInterconnectSettings() { + /** Returns the builder for the settings used for calls to getInterconnect. */ + public UnaryCallSettings.Builder + getInterconnectSettings() { return getInterconnectSettings; } - /** - * Returns the builder for the settings used for calls to insertInterconnect. - */ - public UnaryCallSettings.Builder insertInterconnectSettings() { + /** Returns the builder for the settings used for calls to insertInterconnect. */ + public UnaryCallSettings.Builder + insertInterconnectSettings() { return insertInterconnectSettings; } - /** - * Returns the builder for the settings used for calls to listInterconnects. - */ - public PagedCallSettings.Builder listInterconnectsSettings() { + /** Returns the builder for the settings used for calls to listInterconnects. */ + public PagedCallSettings.Builder< + ListInterconnectsHttpRequest, InterconnectList, ListInterconnectsPagedResponse> + listInterconnectsSettings() { return listInterconnectsSettings; } - /** - * Returns the builder for the settings used for calls to patchInterconnect. - */ - public UnaryCallSettings.Builder patchInterconnectSettings() { + /** Returns the builder for the settings used for calls to patchInterconnect. */ + public UnaryCallSettings.Builder + patchInterconnectSettings() { return patchInterconnectSettings; } @@ -471,4 +462,4 @@ public InterconnectStubSettings build() throws IOException { return new InterconnectStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java deleted file mode 100644 index c14d7f1bf921..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStubSettings.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; -import com.google.cloud.compute.v1.GetLicensHttpRequest; -import com.google.cloud.compute.v1.License; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link LicensStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getLicens to 30 seconds: - * - *

- * 
- * LicensStubSettings.Builder licensSettingsBuilder =
- *     LicensStubSettings.newBuilder();
- * licensSettingsBuilder.getLicensSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * LicensStubSettings licensSettings = licensSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by GAPIC v0.0.5") -@BetaApi -public class LicensStubSettings extends StubSettings { - /** - * The default scopes of the service. - */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-platform") - .add("https://www.googleapis.com/auth/compute") - .add("https://www.googleapis.com/auth/compute.readonly") - .add("https://www.googleapis.com/auth/devstorage.full_control") - .add("https://www.googleapis.com/auth/devstorage.read_only") - .add("https://www.googleapis.com/auth/devstorage.read_write") - .build(); - - private final UnaryCallSettings getLicensSettings; - - /** - * Returns the object with the settings used for calls to getLicens. - */ - public UnaryCallSettings getLicensSettings() { - return getLicensSettings; - } - - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public LicensStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonLicensStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } - } - - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return "https://www.googleapis.com/compute/v1/projects/"; - } - - /** - * Returns the default service port. - */ - public static int getDefaultServicePort() { - return 443; - } - - - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - ; - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultHttpJsonTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LicensStubSettings.class)) - .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** - * Returns a builder containing all the values of this settings class. - */ - public Builder toBuilder() { - return new Builder(this); - } - - protected LicensStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - getLicensSettings = settingsBuilder.getLicensSettings().build(); - } - - - - - /** - * Builder for LicensStubSettings. - */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - - private final UnaryCallSettings.Builder getLicensSettings; - - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put( - "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("default", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - getLicensSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = ImmutableList.>of( - getLicensSettings - ); - - initDefaults(this); - } - - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - - builder.getLicensSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - return builder; - } - - protected Builder(LicensStubSettings settings) { - super(settings); - - getLicensSettings = settings.getLicensSettings.toBuilder(); - - unaryMethodSettingsBuilders = ImmutableList.>of( - getLicensSettings - ); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** - * Returns the builder for the settings used for calls to getLicens. - */ - public UnaryCallSettings.Builder getLicensSettings() { - return getLicensSettings; - } - - @Override - public LicensStubSettings build() throws IOException { - return new LicensStubSettings(this); - } - } -} \ No newline at end of file diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java similarity index 61% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java index fd2e8befec1f..f3098eaaabf7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicensStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java @@ -18,9 +18,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.compute.v1.GetLicensHttpRequest; -import com.google.cloud.compute.v1.License; -import com.google.cloud.compute.v1.LicenseName; +import com.google.cloud.compute.v1.GetLicenseCodeHttpRequest; +import com.google.cloud.compute.v1.LicenseCode; +import com.google.cloud.compute.v1.TestIamPermissionsLicenseCodeHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -31,12 +32,20 @@ */ @Generated("by GAPIC v0.0.5") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class LicensStub implements BackgroundResource { +public abstract class LicenseCodeStub implements BackgroundResource { + @BetaApi + public UnaryCallable getLicenseCodeCallable() { + throw new UnsupportedOperationException("Not implemented: getLicenseCodeCallable()"); + } @BetaApi - public UnaryCallable getLicensCallable() { - throw new UnsupportedOperationException("Not implemented: getLicensCallable()"); + public UnaryCallable + testIamPermissionsLicenseCodeCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsLicenseCodeCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java new file mode 100644 index 000000000000..2dcefb038e37 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java @@ -0,0 +1,314 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.GetLicenseCodeHttpRequest; +import com.google.cloud.compute.v1.LicenseCode; +import com.google.cloud.compute.v1.TestIamPermissionsLicenseCodeHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LicenseCodeStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getLicenseCode to 30 seconds: + * + *

+ * 
+ * LicenseCodeStubSettings.Builder licenseCodeSettingsBuilder =
+ *     LicenseCodeStubSettings.newBuilder();
+ * licenseCodeSettingsBuilder.getLicenseCodeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LicenseCodeStubSettings licenseCodeSettings = licenseCodeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class LicenseCodeStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getLicenseCodeSettings; + private final UnaryCallSettings + testIamPermissionsLicenseCodeSettings; + + /** Returns the object with the settings used for calls to getLicenseCode. */ + public UnaryCallSettings getLicenseCodeSettings() { + return getLicenseCodeSettings; + } + + /** Returns the object with the settings used for calls to testIamPermissionsLicenseCode. */ + public UnaryCallSettings + testIamPermissionsLicenseCodeSettings() { + return testIamPermissionsLicenseCodeSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LicenseCodeStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonLicenseCodeStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LicenseCodeStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LicenseCodeStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getLicenseCodeSettings = settingsBuilder.getLicenseCodeSettings().build(); + testIamPermissionsLicenseCodeSettings = + settingsBuilder.testIamPermissionsLicenseCodeSettings().build(); + } + + /** Builder for LicenseCodeStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + getLicenseCodeSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsLicenseCodeHttpRequest, TestPermissionsResponse> + testIamPermissionsLicenseCodeSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getLicenseCodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsLicenseCodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getLicenseCodeSettings, testIamPermissionsLicenseCodeSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .getLicenseCodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsLicenseCodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(LicenseCodeStubSettings settings) { + super(settings); + + getLicenseCodeSettings = settings.getLicenseCodeSettings.toBuilder(); + testIamPermissionsLicenseCodeSettings = + settings.testIamPermissionsLicenseCodeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getLicenseCodeSettings, testIamPermissionsLicenseCodeSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getLicenseCode. */ + public UnaryCallSettings.Builder + getLicenseCodeSettings() { + return getLicenseCodeSettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissionsLicenseCode. */ + public UnaryCallSettings.Builder< + TestIamPermissionsLicenseCodeHttpRequest, TestPermissionsResponse> + testIamPermissionsLicenseCodeSettings() { + return testIamPermissionsLicenseCodeSettings; + } + + @Override + public LicenseCodeStubSettings build() throws IOException { + return new LicenseCodeStubSettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java index 217cfac7d791..d514ea4296b0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java @@ -15,12 +15,20 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.LicenseClient.ListLicensesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteLicenseHttpRequest; import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.InsertLicenseHttpRequest; import com.google.cloud.compute.v1.License; -import com.google.cloud.compute.v1.ProjectLicenseName; +import com.google.cloud.compute.v1.LicensesListResponse; +import com.google.cloud.compute.v1.ListLicensesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.TestIamPermissionsLicenseHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -33,10 +41,38 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class LicenseStub implements BackgroundResource { + @BetaApi + public UnaryCallable deleteLicenseCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLicenseCallable()"); + } @BetaApi public UnaryCallable getLicenseCallable() { throw new UnsupportedOperationException("Not implemented: getLicenseCallable()"); } -} \ No newline at end of file + @BetaApi + public UnaryCallable insertLicenseCallable() { + throw new UnsupportedOperationException("Not implemented: insertLicenseCallable()"); + } + + @BetaApi + public UnaryCallable + listLicensesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLicensesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listLicensesCallable() { + throw new UnsupportedOperationException("Not implemented: listLicensesCallable()"); + } + + @BetaApi + public UnaryCallable + testIamPermissionsLicenseCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsLicenseCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java index 51b2375cc135..08e0d6996d8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java @@ -15,10 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.LicenseClient.ListLicensesPagedResponse; + import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -26,25 +27,33 @@ import com.google.api.gax.httpjson.HttpJsonTransportChannel; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteLicenseHttpRequest; import com.google.cloud.compute.v1.GetLicenseHttpRequest; +import com.google.cloud.compute.v1.InsertLicenseHttpRequest; import com.google.cloud.compute.v1.License; +import com.google.cloud.compute.v1.LicensesListResponse; +import com.google.cloud.compute.v1.ListLicensesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.TestIamPermissionsLicenseHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -55,21 +64,21 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getLicense to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteLicense to 30 seconds: * *

  * 
  * LicenseStubSettings.Builder licenseSettingsBuilder =
  *     LicenseStubSettings.newBuilder();
- * licenseSettingsBuilder.getLicenseSettings().getRetrySettings().toBuilder()
+ * licenseSettingsBuilder.deleteLicenseSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * LicenseStubSettings licenseSettings = licenseSettingsBuilder.build();
  * 
@@ -78,27 +87,52 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class LicenseStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
+  private final UnaryCallSettings deleteLicenseSettings;
   private final UnaryCallSettings getLicenseSettings;
+  private final UnaryCallSettings insertLicenseSettings;
+  private final PagedCallSettings<
+          ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse>
+      listLicensesSettings;
+  private final UnaryCallSettings
+      testIamPermissionsLicenseSettings;
+
+  /** Returns the object with the settings used for calls to deleteLicense. */
+  public UnaryCallSettings deleteLicenseSettings() {
+    return deleteLicenseSettings;
+  }
 
-  /**
-   * Returns the object with the settings used for calls to getLicense.
-   */
+  /** Returns the object with the settings used for calls to getLicense. */
   public UnaryCallSettings getLicenseSettings() {
     return getLicenseSettings;
   }
 
+  /** Returns the object with the settings used for calls to insertLicense. */
+  public UnaryCallSettings insertLicenseSettings() {
+    return insertLicenseSettings;
+  }
+
+  /** Returns the object with the settings used for calls to listLicenses. */
+  public PagedCallSettings
+      listLicensesSettings() {
+    return listLicensesSettings;
+  }
+
+  /** Returns the object with the settings used for calls to testIamPermissionsLicense. */
+  public UnaryCallSettings
+      testIamPermissionsLicenseSettings() {
+    return testIamPermissionsLicenseSettings;
+  }
 
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public LicenseStub createStub() throws IOException {
@@ -112,47 +146,34 @@ public LicenseStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -164,26 +185,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LicenseStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -191,30 +208,94 @@ public Builder toBuilder() {
   protected LicenseStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    deleteLicenseSettings = settingsBuilder.deleteLicenseSettings().build();
     getLicenseSettings = settingsBuilder.getLicenseSettings().build();
+    insertLicenseSettings = settingsBuilder.insertLicenseSettings().build();
+    listLicensesSettings = settingsBuilder.listLicensesSettings().build();
+    testIamPermissionsLicenseSettings = settingsBuilder.testIamPermissionsLicenseSettings().build();
   }
 
-
-
-
-  /**
-   * Builder for LicenseStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_LICENSES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListLicensesHttpRequest injectToken(
+                ListLicensesHttpRequest payload, String token) {
+              return ListLicensesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListLicensesHttpRequest injectPageSize(
+                ListLicensesHttpRequest payload, int pageSize) {
+              return ListLicensesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListLicensesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(LicensesListResponse payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(LicensesListResponse payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse>
+      LIST_LICENSES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListLicensesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_LICENSES_PAGE_STR_DESC, request, context);
+              return ListLicensesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for LicenseStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        deleteLicenseSettings;
     private final UnaryCallSettings.Builder getLicenseSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        insertLicenseSettings;
+    private final PagedCallSettings.Builder<
+            ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse>
+        listLicensesSettings;
+    private final UnaryCallSettings.Builder<
+            TestIamPermissionsLicenseHttpRequest, TestPermissionsResponse>
+        testIamPermissionsLicenseSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -223,15 +304,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -243,11 +325,23 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      deleteLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       getLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getLicenseSettings
-      );
+      insertLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      listLicensesSettings = PagedCallSettings.newBuilder(LIST_LICENSES_PAGE_STR_FACT);
+
+      testIamPermissionsLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteLicenseSettings,
+              getLicenseSettings,
+              insertLicenseSettings,
+              listLicensesSettings,
+              testIamPermissionsLicenseSettings);
 
       initDefaults(this);
     }
@@ -263,29 +357,60 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.getLicenseSettings()
+      builder
+          .deleteLicenseSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder
+          .getLicenseSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder
+          .insertLicenseSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder
+          .listLicensesSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder
+          .testIamPermissionsLicenseSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       return builder;
     }
 
     protected Builder(LicenseStubSettings settings) {
       super(settings);
 
+      deleteLicenseSettings = settings.deleteLicenseSettings.toBuilder();
       getLicenseSettings = settings.getLicenseSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getLicenseSettings
-      );
+      insertLicenseSettings = settings.insertLicenseSettings.toBuilder();
+      listLicensesSettings = settings.listLicensesSettings.toBuilder();
+      testIamPermissionsLicenseSettings = settings.testIamPermissionsLicenseSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteLicenseSettings,
+              getLicenseSettings,
+              insertLicenseSettings,
+              listLicensesSettings,
+              testIamPermissionsLicenseSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -294,16 +419,37 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteLicenseSettings() { + return deleteLicenseSettings; + } + + /** Returns the builder for the settings used for calls to getLicense. */ public UnaryCallSettings.Builder getLicenseSettings() { return getLicenseSettings; } + /** Returns the builder for the settings used for calls to insertLicense. */ + public UnaryCallSettings.Builder insertLicenseSettings() { + return insertLicenseSettings; + } + + /** Returns the builder for the settings used for calls to listLicenses. */ + public PagedCallSettings.Builder< + ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse> + listLicensesSettings() { + return listLicensesSettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissionsLicense. */ + public UnaryCallSettings.Builder + testIamPermissionsLicenseSettings() { + return testIamPermissionsLicenseSettings; + } + @Override public LicenseStubSettings build() throws IOException { return new LicenseStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java index 725b4d26e3e3..012813d37034 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,13 +26,7 @@ import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; import com.google.cloud.compute.v1.MachineType; import com.google.cloud.compute.v1.MachineTypeAggregatedList; -import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; import com.google.cloud.compute.v1.MachineTypeList; -import com.google.cloud.compute.v1.MachineTypesScopedList; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneMachineTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -42,15 +39,19 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class MachineTypeStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListMachineTypesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListMachineTypesPagedCallable()"); + public UnaryCallable< + AggregatedListMachineTypesHttpRequest, AggregatedListMachineTypesPagedResponse> + aggregatedListMachineTypesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListMachineTypesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListMachineTypesCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListMachineTypesCallable()"); + public UnaryCallable + aggregatedListMachineTypesCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListMachineTypesCallable()"); } @BetaApi @@ -59,7 +60,8 @@ public UnaryCallable getMachineTypeCalla } @BetaApi - public UnaryCallable listMachineTypesPagedCallable() { + public UnaryCallable + listMachineTypesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listMachineTypesPagedCallable()"); } @@ -68,4 +70,6 @@ public UnaryCallable listMachineTy throw new UnsupportedOperationException("Not implemented: listMachineTypesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java index 25a27e59ce31..63aa12751896 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,24 +40,19 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListMachineTypesHttpRequest; import com.google.cloud.compute.v1.GetMachineTypeHttpRequest; import com.google.cloud.compute.v1.ListMachineTypesHttpRequest; import com.google.cloud.compute.v1.MachineType; import com.google.cloud.compute.v1.MachineTypeAggregatedList; -import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; import com.google.cloud.compute.v1.MachineTypeList; import com.google.cloud.compute.v1.MachineTypesScopedList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -69,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getMachineType to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getMachineType to 30 seconds: * *

  * 
@@ -92,44 +86,46 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class MachineTypeStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListMachineTypesSettings;
-  private final UnaryCallSettings getMachineTypeSettings;
-  private final PagedCallSettings listMachineTypesSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListMachineTypes.
-   */
-  public PagedCallSettings aggregatedListMachineTypesSettings() {
+  private final PagedCallSettings<
+          AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+          AggregatedListMachineTypesPagedResponse>
+      aggregatedListMachineTypesSettings;
+  private final UnaryCallSettings getMachineTypeSettings;
+  private final PagedCallSettings<
+          ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse>
+      listMachineTypesSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListMachineTypes. */
+  public PagedCallSettings<
+          AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+          AggregatedListMachineTypesPagedResponse>
+      aggregatedListMachineTypesSettings() {
     return aggregatedListMachineTypesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getMachineType.
-   */
+  /** Returns the object with the settings used for calls to getMachineType. */
   public UnaryCallSettings getMachineTypeSettings() {
     return getMachineTypeSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listMachineTypes.
-   */
-  public PagedCallSettings listMachineTypesSettings() {
+  /** Returns the object with the settings used for calls to listMachineTypes. */
+  public PagedCallSettings<
+          ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse>
+      listMachineTypesSettings() {
     return listMachineTypesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public MachineTypeStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -142,47 +138,34 @@ public MachineTypeStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -193,27 +176,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MachineTypeStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(MachineTypeStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -221,128 +201,163 @@ public Builder toBuilder() {
   protected MachineTypeStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListMachineTypesSettings = settingsBuilder.aggregatedListMachineTypesSettings().build();
+    aggregatedListMachineTypesSettings =
+        settingsBuilder.aggregatedListMachineTypesSettings().build();
     getMachineTypeSettings = settingsBuilder.getMachineTypeSettings().build();
     listMachineTypesSettings = settingsBuilder.listMachineTypesSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListMachineTypesHttpRequest injectToken(AggregatedListMachineTypesHttpRequest payload, String token) {
-          return AggregatedListMachineTypesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListMachineTypesHttpRequest injectPageSize(AggregatedListMachineTypesHttpRequest payload, int pageSize) {
-          return AggregatedListMachineTypesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListMachineTypesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(MachineTypeAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(MachineTypeAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_MACHINE_TYPES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListMachineTypesHttpRequest injectToken(ListMachineTypesHttpRequest payload, String token) {
-          return ListMachineTypesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListMachineTypesHttpRequest injectPageSize(ListMachineTypesHttpRequest payload, int pageSize) {
-          return ListMachineTypesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListMachineTypesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(MachineTypeList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(MachineTypeList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListMachineTypesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_DESC, request, context);
-          return AggregatedListMachineTypesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_MACHINE_TYPES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListMachineTypesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_MACHINE_TYPES_PAGE_STR_DESC, request, context);
-          return ListMachineTypesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for MachineTypeStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, MachineTypesScopedList>
+      AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+              MachineTypesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListMachineTypesHttpRequest injectToken(
+                AggregatedListMachineTypesHttpRequest payload, String token) {
+              return AggregatedListMachineTypesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListMachineTypesHttpRequest injectPageSize(
+                AggregatedListMachineTypesHttpRequest payload, int pageSize) {
+              return AggregatedListMachineTypesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListMachineTypesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(MachineTypeAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                MachineTypeAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListMachineTypesHttpRequest, MachineTypeList, MachineType>
+      LIST_MACHINE_TYPES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListMachineTypesHttpRequest injectToken(
+                ListMachineTypesHttpRequest payload, String token) {
+              return ListMachineTypesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListMachineTypesHttpRequest injectPageSize(
+                ListMachineTypesHttpRequest payload, int pageSize) {
+              return ListMachineTypesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListMachineTypesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(MachineTypeList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(MachineTypeList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+          AggregatedListMachineTypesPagedResponse>
+      AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+              AggregatedListMachineTypesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListMachineTypesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+                      MachineTypesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_DESC, request, context);
+              return AggregatedListMachineTypesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse>
+      LIST_MACHINE_TYPES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListMachineTypesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_MACHINE_TYPES_PAGE_STR_DESC, request, context);
+              return ListMachineTypesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for MachineTypeStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListMachineTypesSettings;
-    private final UnaryCallSettings.Builder getMachineTypeSettings;
-    private final PagedCallSettings.Builder listMachineTypesSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList,
+            AggregatedListMachineTypesPagedResponse>
+        aggregatedListMachineTypesSettings;
+    private final UnaryCallSettings.Builder
+        getMachineTypeSettings;
+    private final PagedCallSettings.Builder<
+            ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse>
+        listMachineTypesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -351,15 +366,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -371,19 +387,16 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListMachineTypesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_FACT);
+      aggregatedListMachineTypesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_MACHINE_TYPES_PAGE_STR_FACT);
 
       getMachineTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listMachineTypesSettings = PagedCallSettings.newBuilder(
-          LIST_MACHINE_TYPES_PAGE_STR_FACT);
+      listMachineTypesSettings = PagedCallSettings.newBuilder(LIST_MACHINE_TYPES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListMachineTypesSettings,
-          getMachineTypeSettings,
-          listMachineTypesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListMachineTypesSettings, getMachineTypeSettings, listMachineTypesSettings);
 
       initDefaults(this);
     }
@@ -399,15 +412,18 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListMachineTypesSettings()
+      builder
+          .aggregatedListMachineTypesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getMachineTypeSettings()
+      builder
+          .getMachineTypeSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listMachineTypesSettings()
+      builder
+          .listMachineTypesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -421,19 +437,19 @@ protected Builder(MachineTypeStubSettings settings) {
       getMachineTypeSettings = settings.getMachineTypeSettings.toBuilder();
       listMachineTypesSettings = settings.listMachineTypesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListMachineTypesSettings,
-          getMachineTypeSettings,
-          listMachineTypesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListMachineTypesSettings, getMachineTypeSettings, listMachineTypesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -442,24 +458,24 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListMachineTypesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListMachineTypes. */ + public PagedCallSettings.Builder< + AggregatedListMachineTypesHttpRequest, MachineTypeAggregatedList, + AggregatedListMachineTypesPagedResponse> + aggregatedListMachineTypesSettings() { return aggregatedListMachineTypesSettings; } - /** - * Returns the builder for the settings used for calls to getMachineType. - */ - public UnaryCallSettings.Builder getMachineTypeSettings() { + /** Returns the builder for the settings used for calls to getMachineType. */ + public UnaryCallSettings.Builder + getMachineTypeSettings() { return getMachineTypeSettings; } - /** - * Returns the builder for the settings used for calls to listMachineTypes. - */ - public PagedCallSettings.Builder listMachineTypesSettings() { + /** Returns the builder for the settings used for calls to listMachineTypes. */ + public PagedCallSettings.Builder< + ListMachineTypesHttpRequest, MachineTypeList, ListMachineTypesPagedResponse> + listMachineTypesSettings() { return listMachineTypesSettings; } @@ -468,4 +484,4 @@ public MachineTypeStubSettings build() throws IOException { return new MachineTypeStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java index 9f7c65488ef4..13622a584871 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -24,14 +26,9 @@ import com.google.cloud.compute.v1.InsertNetworkHttpRequest; import com.google.cloud.compute.v1.ListNetworksHttpRequest; import com.google.cloud.compute.v1.Network; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.NetworkList; -import com.google.cloud.compute.v1.NetworksAddPeeringRequest; -import com.google.cloud.compute.v1.NetworksRemovePeeringRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchNetworkHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectNetworkName; import com.google.cloud.compute.v1.RemovePeeringNetworkHttpRequest; import com.google.cloud.compute.v1.SwitchToCustomModeNetworkHttpRequest; import javax.annotation.Generated; @@ -46,7 +43,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class NetworkStub implements BackgroundResource { - @BetaApi public UnaryCallable addPeeringNetworkCallable() { throw new UnsupportedOperationException("Not implemented: addPeeringNetworkCallable()"); @@ -68,7 +64,8 @@ public UnaryCallable insertNetworkCallable( } @BetaApi - public UnaryCallable listNetworksPagedCallable() { + public UnaryCallable + listNetworksPagedCallable() { throw new UnsupportedOperationException("Not implemented: listNetworksPagedCallable()"); } @@ -88,8 +85,11 @@ public UnaryCallable removePeeringNe } @BetaApi - public UnaryCallable switchToCustomModeNetworkCallable() { + public UnaryCallable + switchToCustomModeNetworkCallable() { throw new UnsupportedOperationException("Not implemented: switchToCustomModeNetworkCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java index bfb4184e902f..675ba18c88a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,14 +39,12 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AddPeeringNetworkHttpRequest; import com.google.cloud.compute.v1.DeleteNetworkHttpRequest; import com.google.cloud.compute.v1.GetNetworkHttpRequest; import com.google.cloud.compute.v1.InsertNetworkHttpRequest; import com.google.cloud.compute.v1.ListNetworksHttpRequest; import com.google.cloud.compute.v1.Network; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; import com.google.cloud.compute.v1.NetworkList; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchNetworkHttpRequest; @@ -58,10 +54,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addPeeringNetwork to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addPeeringNetwork to 30 seconds: * *

  * 
@@ -95,84 +89,73 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class NetworkStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings addPeeringNetworkSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      addPeeringNetworkSettings;
   private final UnaryCallSettings deleteNetworkSettings;
   private final UnaryCallSettings getNetworkSettings;
   private final UnaryCallSettings insertNetworkSettings;
-  private final PagedCallSettings listNetworksSettings;
+  private final PagedCallSettings
+      listNetworksSettings;
   private final UnaryCallSettings patchNetworkSettings;
-  private final UnaryCallSettings removePeeringNetworkSettings;
-  private final UnaryCallSettings switchToCustomModeNetworkSettings;
+  private final UnaryCallSettings
+      removePeeringNetworkSettings;
+  private final UnaryCallSettings
+      switchToCustomModeNetworkSettings;
 
-  /**
-   * Returns the object with the settings used for calls to addPeeringNetwork.
-   */
+  /** Returns the object with the settings used for calls to addPeeringNetwork. */
   public UnaryCallSettings addPeeringNetworkSettings() {
     return addPeeringNetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteNetwork.
-   */
+  /** Returns the object with the settings used for calls to deleteNetwork. */
   public UnaryCallSettings deleteNetworkSettings() {
     return deleteNetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getNetwork.
-   */
+  /** Returns the object with the settings used for calls to getNetwork. */
   public UnaryCallSettings getNetworkSettings() {
     return getNetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertNetwork.
-   */
+  /** Returns the object with the settings used for calls to insertNetwork. */
   public UnaryCallSettings insertNetworkSettings() {
     return insertNetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listNetworks.
-   */
-  public PagedCallSettings listNetworksSettings() {
+  /** Returns the object with the settings used for calls to listNetworks. */
+  public PagedCallSettings
+      listNetworksSettings() {
     return listNetworksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchNetwork.
-   */
+  /** Returns the object with the settings used for calls to patchNetwork. */
   public UnaryCallSettings patchNetworkSettings() {
     return patchNetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to removePeeringNetwork.
-   */
-  public UnaryCallSettings removePeeringNetworkSettings() {
+  /** Returns the object with the settings used for calls to removePeeringNetwork. */
+  public UnaryCallSettings
+      removePeeringNetworkSettings() {
     return removePeeringNetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to switchToCustomModeNetwork.
-   */
-  public UnaryCallSettings switchToCustomModeNetworkSettings() {
+  /** Returns the object with the settings used for calls to switchToCustomModeNetwork. */
+  public UnaryCallSettings
+      switchToCustomModeNetworkSettings() {
     return switchToCustomModeNetworkSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public NetworkStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -185,47 +168,34 @@ public NetworkStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -237,26 +207,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(NetworkStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -274,80 +240,92 @@ protected NetworkStubSettings(Builder settingsBuilder) throws IOException {
     switchToCustomModeNetworkSettings = settingsBuilder.switchToCustomModeNetworkSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_NETWORKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListNetworksHttpRequest injectToken(ListNetworksHttpRequest payload, String token) {
-          return ListNetworksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListNetworksHttpRequest injectPageSize(ListNetworksHttpRequest payload, int pageSize) {
-          return ListNetworksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListNetworksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(NetworkList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(NetworkList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_NETWORKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListNetworksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_NETWORKS_PAGE_STR_DESC, request, context);
-          return ListNetworksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for NetworkStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_NETWORKS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListNetworksHttpRequest injectToken(
+                ListNetworksHttpRequest payload, String token) {
+              return ListNetworksHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListNetworksHttpRequest injectPageSize(
+                ListNetworksHttpRequest payload, int pageSize) {
+              return ListNetworksHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListNetworksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(NetworkList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(NetworkList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse>
+      LIST_NETWORKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListNetworksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_NETWORKS_PAGE_STR_DESC, request, context);
+              return ListNetworksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for NetworkStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder addPeeringNetworkSettings;
-    private final UnaryCallSettings.Builder deleteNetworkSettings;
+    private final UnaryCallSettings.Builder
+        addPeeringNetworkSettings;
+    private final UnaryCallSettings.Builder
+        deleteNetworkSettings;
     private final UnaryCallSettings.Builder getNetworkSettings;
-    private final UnaryCallSettings.Builder insertNetworkSettings;
-    private final PagedCallSettings.Builder listNetworksSettings;
-    private final UnaryCallSettings.Builder patchNetworkSettings;
-    private final UnaryCallSettings.Builder removePeeringNetworkSettings;
-    private final UnaryCallSettings.Builder switchToCustomModeNetworkSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        insertNetworkSettings;
+    private final PagedCallSettings.Builder<
+            ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse>
+        listNetworksSettings;
+    private final UnaryCallSettings.Builder
+        patchNetworkSettings;
+    private final UnaryCallSettings.Builder
+        removePeeringNetworkSettings;
+    private final UnaryCallSettings.Builder
+        switchToCustomModeNetworkSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -356,15 +334,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -384,8 +363,7 @@ protected Builder(ClientContext clientContext) {
 
       insertNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listNetworksSettings = PagedCallSettings.newBuilder(
-          LIST_NETWORKS_PAGE_STR_FACT);
+      listNetworksSettings = PagedCallSettings.newBuilder(LIST_NETWORKS_PAGE_STR_FACT);
 
       patchNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -393,16 +371,16 @@ protected Builder(ClientContext clientContext) {
 
       switchToCustomModeNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addPeeringNetworkSettings,
-          deleteNetworkSettings,
-          getNetworkSettings,
-          insertNetworkSettings,
-          listNetworksSettings,
-          patchNetworkSettings,
-          removePeeringNetworkSettings,
-          switchToCustomModeNetworkSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addPeeringNetworkSettings,
+              deleteNetworkSettings,
+              getNetworkSettings,
+              insertNetworkSettings,
+              listNetworksSettings,
+              patchNetworkSettings,
+              removePeeringNetworkSettings,
+              switchToCustomModeNetworkSettings);
 
       initDefaults(this);
     }
@@ -418,35 +396,43 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.addPeeringNetworkSettings()
+      builder
+          .addPeeringNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteNetworkSettings()
+      builder
+          .deleteNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getNetworkSettings()
+      builder
+          .getNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertNetworkSettings()
+      builder
+          .insertNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listNetworksSettings()
+      builder
+          .listNetworksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchNetworkSettings()
+      builder
+          .patchNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.removePeeringNetworkSettings()
+      builder
+          .removePeeringNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.switchToCustomModeNetworkSettings()
+      builder
+          .switchToCustomModeNetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -465,24 +451,26 @@ protected Builder(NetworkStubSettings settings) {
       removePeeringNetworkSettings = settings.removePeeringNetworkSettings.toBuilder();
       switchToCustomModeNetworkSettings = settings.switchToCustomModeNetworkSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addPeeringNetworkSettings,
-          deleteNetworkSettings,
-          getNetworkSettings,
-          insertNetworkSettings,
-          listNetworksSettings,
-          patchNetworkSettings,
-          removePeeringNetworkSettings,
-          switchToCustomModeNetworkSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addPeeringNetworkSettings,
+              deleteNetworkSettings,
+              getNetworkSettings,
+              insertNetworkSettings,
+              listNetworksSettings,
+              patchNetworkSettings,
+              removePeeringNetworkSettings,
+              switchToCustomModeNetworkSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -491,59 +479,48 @@ public Builder applyToAllUnaryMethods(ApiFunction addPeeringNetworkSettings() { + /** Returns the builder for the settings used for calls to addPeeringNetwork. */ + public UnaryCallSettings.Builder + addPeeringNetworkSettings() { return addPeeringNetworkSettings; } - /** - * Returns the builder for the settings used for calls to deleteNetwork. - */ + /** Returns the builder for the settings used for calls to deleteNetwork. */ public UnaryCallSettings.Builder deleteNetworkSettings() { return deleteNetworkSettings; } - /** - * Returns the builder for the settings used for calls to getNetwork. - */ + /** Returns the builder for the settings used for calls to getNetwork. */ public UnaryCallSettings.Builder getNetworkSettings() { return getNetworkSettings; } - /** - * Returns the builder for the settings used for calls to insertNetwork. - */ + /** Returns the builder for the settings used for calls to insertNetwork. */ public UnaryCallSettings.Builder insertNetworkSettings() { return insertNetworkSettings; } - /** - * Returns the builder for the settings used for calls to listNetworks. - */ - public PagedCallSettings.Builder listNetworksSettings() { + /** Returns the builder for the settings used for calls to listNetworks. */ + public PagedCallSettings.Builder< + ListNetworksHttpRequest, NetworkList, ListNetworksPagedResponse> + listNetworksSettings() { return listNetworksSettings; } - /** - * Returns the builder for the settings used for calls to patchNetwork. - */ + /** Returns the builder for the settings used for calls to patchNetwork. */ public UnaryCallSettings.Builder patchNetworkSettings() { return patchNetworkSettings; } - /** - * Returns the builder for the settings used for calls to removePeeringNetwork. - */ - public UnaryCallSettings.Builder removePeeringNetworkSettings() { + /** Returns the builder for the settings used for calls to removePeeringNetwork. */ + public UnaryCallSettings.Builder + removePeeringNetworkSettings() { return removePeeringNetworkSettings; } - /** - * Returns the builder for the settings used for calls to switchToCustomModeNetwork. - */ - public UnaryCallSettings.Builder switchToCustomModeNetworkSettings() { + /** Returns the builder for the settings used for calls to switchToCustomModeNetwork. */ + public UnaryCallSettings.Builder + switchToCustomModeNetworkSettings() { return switchToCustomModeNetworkSettings; } @@ -552,4 +529,4 @@ public NetworkStubSettings build() throws IOException { return new NetworkStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java index e9e356d111a3..5b387632c1f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java @@ -15,36 +15,28 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest; -import com.google.cloud.compute.v1.DiskMoveRequest; import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.EnableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.GetProjectHttpRequest; import com.google.cloud.compute.v1.GetXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.GetXpnResourcesProjectsHttpRequest; -import com.google.cloud.compute.v1.InstanceMoveRequest; import com.google.cloud.compute.v1.ListXpnHostsProjectsHttpRequest; -import com.google.cloud.compute.v1.Metadata; import com.google.cloud.compute.v1.MoveDiskProjectHttpRequest; import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Project; -import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; -import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; -import com.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; import com.google.cloud.compute.v1.ProjectsGetXpnResources; -import com.google.cloud.compute.v1.ProjectsListXpnHostsRequest; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; -import com.google.cloud.compute.v1.UsageExportLocation; import com.google.cloud.compute.v1.XpnHostList; -import com.google.cloud.compute.v1.XpnResourceId; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -57,14 +49,15 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ProjectStub implements BackgroundResource { - @BetaApi - public UnaryCallable disableXpnHostProjectCallable() { + public UnaryCallable + disableXpnHostProjectCallable() { throw new UnsupportedOperationException("Not implemented: disableXpnHostProjectCallable()"); } @BetaApi - public UnaryCallable disableXpnResourceProjectCallable() { + public UnaryCallable + disableXpnResourceProjectCallable() { throw new UnsupportedOperationException("Not implemented: disableXpnResourceProjectCallable()"); } @@ -74,7 +67,8 @@ public UnaryCallable enableXpnHostPr } @BetaApi - public UnaryCallable enableXpnResourceProjectCallable() { + public UnaryCallable + enableXpnResourceProjectCallable() { throw new UnsupportedOperationException("Not implemented: enableXpnResourceProjectCallable()"); } @@ -89,22 +83,27 @@ public UnaryCallable getXpnHostProjectCal } @BetaApi - public UnaryCallable getXpnResourcesProjectsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: getXpnResourcesProjectsPagedCallable()"); + public UnaryCallable + getXpnResourcesProjectsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: getXpnResourcesProjectsPagedCallable()"); } @BetaApi - public UnaryCallable getXpnResourcesProjectsCallable() { + public UnaryCallable + getXpnResourcesProjectsCallable() { throw new UnsupportedOperationException("Not implemented: getXpnResourcesProjectsCallable()"); } @BetaApi - public UnaryCallable listXpnHostsProjectsPagedCallable() { + public UnaryCallable + listXpnHostsProjectsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listXpnHostsProjectsPagedCallable()"); } @BetaApi - public UnaryCallable listXpnHostsProjectsCallable() { + public UnaryCallable + listXpnHostsProjectsCallable() { throw new UnsupportedOperationException("Not implemented: listXpnHostsProjectsCallable()"); } @@ -119,13 +118,19 @@ public UnaryCallable moveInstanceProj } @BetaApi - public UnaryCallable setCommonInstanceMetadataProjectCallable() { - throw new UnsupportedOperationException("Not implemented: setCommonInstanceMetadataProjectCallable()"); + public UnaryCallable + setCommonInstanceMetadataProjectCallable() { + throw new UnsupportedOperationException( + "Not implemented: setCommonInstanceMetadataProjectCallable()"); } @BetaApi - public UnaryCallable setUsageExportBucketProjectCallable() { - throw new UnsupportedOperationException("Not implemented: setUsageExportBucketProjectCallable()"); + public UnaryCallable + setUsageExportBucketProjectCallable() { + throw new UnsupportedOperationException( + "Not implemented: setUsageExportBucketProjectCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java index 03e716f2ca9d..f14b1130e392 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; +import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DisableXpnHostProjectHttpRequest; import com.google.cloud.compute.v1.DisableXpnResourceProjectHttpRequest; import com.google.cloud.compute.v1.EnableXpnHostProjectHttpRequest; @@ -54,8 +52,6 @@ import com.google.cloud.compute.v1.MoveInstanceProjectHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Project; -import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; -import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; import com.google.cloud.compute.v1.ProjectsGetXpnResources; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; @@ -65,10 +61,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -79,15 +73,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of disableXpnHostProject to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of disableXpnHostProject to 30 seconds: * *

  * 
@@ -102,116 +96,114 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ProjectStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings disableXpnHostProjectSettings;
-  private final UnaryCallSettings disableXpnResourceProjectSettings;
-  private final UnaryCallSettings enableXpnHostProjectSettings;
-  private final UnaryCallSettings enableXpnResourceProjectSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      disableXpnHostProjectSettings;
+  private final UnaryCallSettings
+      disableXpnResourceProjectSettings;
+  private final UnaryCallSettings
+      enableXpnHostProjectSettings;
+  private final UnaryCallSettings
+      enableXpnResourceProjectSettings;
   private final UnaryCallSettings getProjectSettings;
   private final UnaryCallSettings getXpnHostProjectSettings;
-  private final PagedCallSettings getXpnResourcesProjectsSettings;
-  private final PagedCallSettings listXpnHostsProjectsSettings;
+  private final PagedCallSettings<
+          GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources,
+          GetXpnResourcesProjectsPagedResponse>
+      getXpnResourcesProjectsSettings;
+  private final PagedCallSettings<
+          ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse>
+      listXpnHostsProjectsSettings;
   private final UnaryCallSettings moveDiskProjectSettings;
-  private final UnaryCallSettings moveInstanceProjectSettings;
-  private final UnaryCallSettings setCommonInstanceMetadataProjectSettings;
-  private final UnaryCallSettings setUsageExportBucketProjectSettings;
-
-  /**
-   * Returns the object with the settings used for calls to disableXpnHostProject.
-   */
-  public UnaryCallSettings disableXpnHostProjectSettings() {
+  private final UnaryCallSettings
+      moveInstanceProjectSettings;
+  private final UnaryCallSettings
+      setCommonInstanceMetadataProjectSettings;
+  private final UnaryCallSettings
+      setUsageExportBucketProjectSettings;
+
+  /** Returns the object with the settings used for calls to disableXpnHostProject. */
+  public UnaryCallSettings
+      disableXpnHostProjectSettings() {
     return disableXpnHostProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to disableXpnResourceProject.
-   */
-  public UnaryCallSettings disableXpnResourceProjectSettings() {
+  /** Returns the object with the settings used for calls to disableXpnResourceProject. */
+  public UnaryCallSettings
+      disableXpnResourceProjectSettings() {
     return disableXpnResourceProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to enableXpnHostProject.
-   */
-  public UnaryCallSettings enableXpnHostProjectSettings() {
+  /** Returns the object with the settings used for calls to enableXpnHostProject. */
+  public UnaryCallSettings
+      enableXpnHostProjectSettings() {
     return enableXpnHostProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to enableXpnResourceProject.
-   */
-  public UnaryCallSettings enableXpnResourceProjectSettings() {
+  /** Returns the object with the settings used for calls to enableXpnResourceProject. */
+  public UnaryCallSettings
+      enableXpnResourceProjectSettings() {
     return enableXpnResourceProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getProject.
-   */
+  /** Returns the object with the settings used for calls to getProject. */
   public UnaryCallSettings getProjectSettings() {
     return getProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getXpnHostProject.
-   */
+  /** Returns the object with the settings used for calls to getXpnHostProject. */
   public UnaryCallSettings getXpnHostProjectSettings() {
     return getXpnHostProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getXpnResourcesProjects.
-   */
-  public PagedCallSettings getXpnResourcesProjectsSettings() {
+  /** Returns the object with the settings used for calls to getXpnResourcesProjects. */
+  public PagedCallSettings<
+          GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources,
+          GetXpnResourcesProjectsPagedResponse>
+      getXpnResourcesProjectsSettings() {
     return getXpnResourcesProjectsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listXpnHostsProjects.
-   */
-  public PagedCallSettings listXpnHostsProjectsSettings() {
+  /** Returns the object with the settings used for calls to listXpnHostsProjects. */
+  public PagedCallSettings<
+          ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse>
+      listXpnHostsProjectsSettings() {
     return listXpnHostsProjectsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to moveDiskProject.
-   */
+  /** Returns the object with the settings used for calls to moveDiskProject. */
   public UnaryCallSettings moveDiskProjectSettings() {
     return moveDiskProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to moveInstanceProject.
-   */
-  public UnaryCallSettings moveInstanceProjectSettings() {
+  /** Returns the object with the settings used for calls to moveInstanceProject. */
+  public UnaryCallSettings
+      moveInstanceProjectSettings() {
     return moveInstanceProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setCommonInstanceMetadataProject.
-   */
-  public UnaryCallSettings setCommonInstanceMetadataProjectSettings() {
+  /** Returns the object with the settings used for calls to setCommonInstanceMetadataProject. */
+  public UnaryCallSettings
+      setCommonInstanceMetadataProjectSettings() {
     return setCommonInstanceMetadataProjectSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setUsageExportBucketProject.
-   */
-  public UnaryCallSettings setUsageExportBucketProjectSettings() {
+  /** Returns the object with the settings used for calls to setUsageExportBucketProject. */
+  public UnaryCallSettings
+      setUsageExportBucketProjectSettings() {
     return setUsageExportBucketProjectSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ProjectStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -224,47 +216,34 @@ public ProjectStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -276,26 +255,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ProjectStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -313,136 +288,177 @@ protected ProjectStubSettings(Builder settingsBuilder) throws IOException {
     listXpnHostsProjectsSettings = settingsBuilder.listXpnHostsProjectsSettings().build();
     moveDiskProjectSettings = settingsBuilder.moveDiskProjectSettings().build();
     moveInstanceProjectSettings = settingsBuilder.moveInstanceProjectSettings().build();
-    setCommonInstanceMetadataProjectSettings = settingsBuilder.setCommonInstanceMetadataProjectSettings().build();
-    setUsageExportBucketProjectSettings = settingsBuilder.setUsageExportBucketProjectSettings().build();
+    setCommonInstanceMetadataProjectSettings =
+        settingsBuilder.setCommonInstanceMetadataProjectSettings().build();
+    setUsageExportBucketProjectSettings =
+        settingsBuilder.setUsageExportBucketProjectSettings().build();
   }
 
-  private static final PagedListDescriptor GET_XPN_RESOURCES_PROJECTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public GetXpnResourcesProjectsHttpRequest injectToken(GetXpnResourcesProjectsHttpRequest payload, String token) {
-          return GetXpnResourcesProjectsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public GetXpnResourcesProjectsHttpRequest injectPageSize(GetXpnResourcesProjectsHttpRequest payload, int pageSize) {
-          return GetXpnResourcesProjectsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(GetXpnResourcesProjectsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ProjectsGetXpnResources payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ProjectsGetXpnResources payload) {
-          return payload.getResourcesList();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_XPN_HOSTS_PROJECTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListXpnHostsProjectsHttpRequest injectToken(ListXpnHostsProjectsHttpRequest payload, String token) {
-          return ListXpnHostsProjectsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListXpnHostsProjectsHttpRequest injectPageSize(ListXpnHostsProjectsHttpRequest payload, int pageSize) {
-          return ListXpnHostsProjectsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListXpnHostsProjectsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(XpnHostList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(XpnHostList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory GET_XPN_RESOURCES_PROJECTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            GetXpnResourcesProjectsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, GET_XPN_RESOURCES_PROJECTS_PAGE_STR_DESC, request, context);
-          return GetXpnResourcesProjectsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_XPN_HOSTS_PROJECTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListXpnHostsProjectsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_XPN_HOSTS_PROJECTS_PAGE_STR_DESC, request, context);
-          return ListXpnHostsProjectsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for ProjectStubSettings.
-   */
+  private static final PagedListDescriptor<
+          GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, XpnResourceId>
+      GET_XPN_RESOURCES_PROJECTS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, XpnResourceId>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public GetXpnResourcesProjectsHttpRequest injectToken(
+                GetXpnResourcesProjectsHttpRequest payload, String token) {
+              return GetXpnResourcesProjectsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public GetXpnResourcesProjectsHttpRequest injectPageSize(
+                GetXpnResourcesProjectsHttpRequest payload, int pageSize) {
+              return GetXpnResourcesProjectsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(GetXpnResourcesProjectsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ProjectsGetXpnResources payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(ProjectsGetXpnResources payload) {
+              return payload.getResourcesList();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_XPN_HOSTS_PROJECTS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListXpnHostsProjectsHttpRequest injectToken(
+                ListXpnHostsProjectsHttpRequest payload, String token) {
+              return ListXpnHostsProjectsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListXpnHostsProjectsHttpRequest injectPageSize(
+                ListXpnHostsProjectsHttpRequest payload, int pageSize) {
+              return ListXpnHostsProjectsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListXpnHostsProjectsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(XpnHostList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(XpnHostList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources,
+          GetXpnResourcesProjectsPagedResponse>
+      GET_XPN_RESOURCES_PROJECTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources,
+              GetXpnResourcesProjectsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                GetXpnResourcesProjectsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, XpnResourceId>
+                  pageContext =
+                      PageContext.create(
+                          callable, GET_XPN_RESOURCES_PROJECTS_PAGE_STR_DESC, request, context);
+              return GetXpnResourcesProjectsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse>
+      LIST_XPN_HOSTS_PROJECTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListXpnHostsProjectsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(
+                      callable, LIST_XPN_HOSTS_PROJECTS_PAGE_STR_DESC, request, context);
+              return ListXpnHostsProjectsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for ProjectStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder disableXpnHostProjectSettings;
-    private final UnaryCallSettings.Builder disableXpnResourceProjectSettings;
-    private final UnaryCallSettings.Builder enableXpnHostProjectSettings;
-    private final UnaryCallSettings.Builder enableXpnResourceProjectSettings;
+    private final UnaryCallSettings.Builder
+        disableXpnHostProjectSettings;
+    private final UnaryCallSettings.Builder
+        disableXpnResourceProjectSettings;
+    private final UnaryCallSettings.Builder
+        enableXpnHostProjectSettings;
+    private final UnaryCallSettings.Builder
+        enableXpnResourceProjectSettings;
     private final UnaryCallSettings.Builder getProjectSettings;
-    private final UnaryCallSettings.Builder getXpnHostProjectSettings;
-    private final PagedCallSettings.Builder getXpnResourcesProjectsSettings;
-    private final PagedCallSettings.Builder listXpnHostsProjectsSettings;
-    private final UnaryCallSettings.Builder moveDiskProjectSettings;
-    private final UnaryCallSettings.Builder moveInstanceProjectSettings;
-    private final UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings;
-    private final UnaryCallSettings.Builder setUsageExportBucketProjectSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        getXpnHostProjectSettings;
+    private final PagedCallSettings.Builder<
+            GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources,
+            GetXpnResourcesProjectsPagedResponse>
+        getXpnResourcesProjectsSettings;
+    private final PagedCallSettings.Builder<
+            ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse>
+        listXpnHostsProjectsSettings;
+    private final UnaryCallSettings.Builder
+        moveDiskProjectSettings;
+    private final UnaryCallSettings.Builder
+        moveInstanceProjectSettings;
+    private final UnaryCallSettings.Builder
+        setCommonInstanceMetadataProjectSettings;
+    private final UnaryCallSettings.Builder
+        setUsageExportBucketProjectSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -451,15 +467,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -483,11 +500,11 @@ protected Builder(ClientContext clientContext) {
 
       getXpnHostProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      getXpnResourcesProjectsSettings = PagedCallSettings.newBuilder(
-          GET_XPN_RESOURCES_PROJECTS_PAGE_STR_FACT);
+      getXpnResourcesProjectsSettings =
+          PagedCallSettings.newBuilder(GET_XPN_RESOURCES_PROJECTS_PAGE_STR_FACT);
 
-      listXpnHostsProjectsSettings = PagedCallSettings.newBuilder(
-          LIST_XPN_HOSTS_PROJECTS_PAGE_STR_FACT);
+      listXpnHostsProjectsSettings =
+          PagedCallSettings.newBuilder(LIST_XPN_HOSTS_PROJECTS_PAGE_STR_FACT);
 
       moveDiskProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -497,20 +514,20 @@ protected Builder(ClientContext clientContext) {
 
       setUsageExportBucketProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          disableXpnHostProjectSettings,
-          disableXpnResourceProjectSettings,
-          enableXpnHostProjectSettings,
-          enableXpnResourceProjectSettings,
-          getProjectSettings,
-          getXpnHostProjectSettings,
-          getXpnResourcesProjectsSettings,
-          listXpnHostsProjectsSettings,
-          moveDiskProjectSettings,
-          moveInstanceProjectSettings,
-          setCommonInstanceMetadataProjectSettings,
-          setUsageExportBucketProjectSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              disableXpnHostProjectSettings,
+              disableXpnResourceProjectSettings,
+              enableXpnHostProjectSettings,
+              enableXpnResourceProjectSettings,
+              getProjectSettings,
+              getXpnHostProjectSettings,
+              getXpnResourcesProjectsSettings,
+              listXpnHostsProjectsSettings,
+              moveDiskProjectSettings,
+              moveInstanceProjectSettings,
+              setCommonInstanceMetadataProjectSettings,
+              setUsageExportBucketProjectSettings);
 
       initDefaults(this);
     }
@@ -526,51 +543,63 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.disableXpnHostProjectSettings()
+      builder
+          .disableXpnHostProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.disableXpnResourceProjectSettings()
+      builder
+          .disableXpnResourceProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.enableXpnHostProjectSettings()
+      builder
+          .enableXpnHostProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.enableXpnResourceProjectSettings()
+      builder
+          .enableXpnResourceProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getProjectSettings()
+      builder
+          .getProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getXpnHostProjectSettings()
+      builder
+          .getXpnHostProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getXpnResourcesProjectsSettings()
+      builder
+          .getXpnResourcesProjectsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listXpnHostsProjectsSettings()
+      builder
+          .listXpnHostsProjectsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.moveDiskProjectSettings()
+      builder
+          .moveDiskProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.moveInstanceProjectSettings()
+      builder
+          .moveInstanceProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setCommonInstanceMetadataProjectSettings()
+      builder
+          .setCommonInstanceMetadataProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setUsageExportBucketProjectSettings()
+      builder
+          .setUsageExportBucketProjectSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -590,31 +619,35 @@ protected Builder(ProjectStubSettings settings) {
       listXpnHostsProjectsSettings = settings.listXpnHostsProjectsSettings.toBuilder();
       moveDiskProjectSettings = settings.moveDiskProjectSettings.toBuilder();
       moveInstanceProjectSettings = settings.moveInstanceProjectSettings.toBuilder();
-      setCommonInstanceMetadataProjectSettings = settings.setCommonInstanceMetadataProjectSettings.toBuilder();
-      setUsageExportBucketProjectSettings = settings.setUsageExportBucketProjectSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          disableXpnHostProjectSettings,
-          disableXpnResourceProjectSettings,
-          enableXpnHostProjectSettings,
-          enableXpnResourceProjectSettings,
-          getProjectSettings,
-          getXpnHostProjectSettings,
-          getXpnResourcesProjectsSettings,
-          listXpnHostsProjectsSettings,
-          moveDiskProjectSettings,
-          moveInstanceProjectSettings,
-          setCommonInstanceMetadataProjectSettings,
-          setUsageExportBucketProjectSettings
-      );
+      setCommonInstanceMetadataProjectSettings =
+          settings.setCommonInstanceMetadataProjectSettings.toBuilder();
+      setUsageExportBucketProjectSettings =
+          settings.setUsageExportBucketProjectSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              disableXpnHostProjectSettings,
+              disableXpnResourceProjectSettings,
+              enableXpnHostProjectSettings,
+              enableXpnResourceProjectSettings,
+              getProjectSettings,
+              getXpnHostProjectSettings,
+              getXpnResourcesProjectsSettings,
+              listXpnHostsProjectsSettings,
+              moveDiskProjectSettings,
+              moveInstanceProjectSettings,
+              setCommonInstanceMetadataProjectSettings,
+              setUsageExportBucketProjectSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -623,87 +656,77 @@ public Builder applyToAllUnaryMethods(ApiFunction disableXpnHostProjectSettings() { + /** Returns the builder for the settings used for calls to disableXpnHostProject. */ + public UnaryCallSettings.Builder + disableXpnHostProjectSettings() { return disableXpnHostProjectSettings; } - /** - * Returns the builder for the settings used for calls to disableXpnResourceProject. - */ - public UnaryCallSettings.Builder disableXpnResourceProjectSettings() { + /** Returns the builder for the settings used for calls to disableXpnResourceProject. */ + public UnaryCallSettings.Builder + disableXpnResourceProjectSettings() { return disableXpnResourceProjectSettings; } - /** - * Returns the builder for the settings used for calls to enableXpnHostProject. - */ - public UnaryCallSettings.Builder enableXpnHostProjectSettings() { + /** Returns the builder for the settings used for calls to enableXpnHostProject. */ + public UnaryCallSettings.Builder + enableXpnHostProjectSettings() { return enableXpnHostProjectSettings; } - /** - * Returns the builder for the settings used for calls to enableXpnResourceProject. - */ - public UnaryCallSettings.Builder enableXpnResourceProjectSettings() { + /** Returns the builder for the settings used for calls to enableXpnResourceProject. */ + public UnaryCallSettings.Builder + enableXpnResourceProjectSettings() { return enableXpnResourceProjectSettings; } - /** - * Returns the builder for the settings used for calls to getProject. - */ + /** Returns the builder for the settings used for calls to getProject. */ public UnaryCallSettings.Builder getProjectSettings() { return getProjectSettings; } - /** - * Returns the builder for the settings used for calls to getXpnHostProject. - */ - public UnaryCallSettings.Builder getXpnHostProjectSettings() { + /** Returns the builder for the settings used for calls to getXpnHostProject. */ + public UnaryCallSettings.Builder + getXpnHostProjectSettings() { return getXpnHostProjectSettings; } - /** - * Returns the builder for the settings used for calls to getXpnResourcesProjects. - */ - public PagedCallSettings.Builder getXpnResourcesProjectsSettings() { + /** Returns the builder for the settings used for calls to getXpnResourcesProjects. */ + public PagedCallSettings.Builder< + GetXpnResourcesProjectsHttpRequest, ProjectsGetXpnResources, + GetXpnResourcesProjectsPagedResponse> + getXpnResourcesProjectsSettings() { return getXpnResourcesProjectsSettings; } - /** - * Returns the builder for the settings used for calls to listXpnHostsProjects. - */ - public PagedCallSettings.Builder listXpnHostsProjectsSettings() { + /** Returns the builder for the settings used for calls to listXpnHostsProjects. */ + public PagedCallSettings.Builder< + ListXpnHostsProjectsHttpRequest, XpnHostList, ListXpnHostsProjectsPagedResponse> + listXpnHostsProjectsSettings() { return listXpnHostsProjectsSettings; } - /** - * Returns the builder for the settings used for calls to moveDiskProject. - */ - public UnaryCallSettings.Builder moveDiskProjectSettings() { + /** Returns the builder for the settings used for calls to moveDiskProject. */ + public UnaryCallSettings.Builder + moveDiskProjectSettings() { return moveDiskProjectSettings; } - /** - * Returns the builder for the settings used for calls to moveInstanceProject. - */ - public UnaryCallSettings.Builder moveInstanceProjectSettings() { + /** Returns the builder for the settings used for calls to moveInstanceProject. */ + public UnaryCallSettings.Builder + moveInstanceProjectSettings() { return moveInstanceProjectSettings; } - /** - * Returns the builder for the settings used for calls to setCommonInstanceMetadataProject. - */ - public UnaryCallSettings.Builder setCommonInstanceMetadataProjectSettings() { + /** Returns the builder for the settings used for calls to setCommonInstanceMetadataProject. */ + public UnaryCallSettings.Builder + setCommonInstanceMetadataProjectSettings() { return setCommonInstanceMetadataProjectSettings; } - /** - * Returns the builder for the settings used for calls to setUsageExportBucketProject. - */ - public UnaryCallSettings.Builder setUsageExportBucketProjectSettings() { + /** Returns the builder for the settings used for calls to setUsageExportBucketProject. */ + public UnaryCallSettings.Builder + setUsageExportBucketProjectSettings() { return setUsageExportBucketProjectSettings; } @@ -712,4 +735,4 @@ public ProjectStubSettings build() throws IOException { return new ProjectStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java index f441c54d7115..0550bccc2013 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -25,9 +27,6 @@ import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; -import com.google.cloud.compute.v1.ProjectRegionAutoscalerName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; import com.google.cloud.compute.v1.RegionAutoscalerList; import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; import javax.annotation.Generated; @@ -42,9 +41,9 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionAutoscalerStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteRegionAutoscalerCallable() { + public UnaryCallable + deleteRegionAutoscalerCallable() { throw new UnsupportedOperationException("Not implemented: deleteRegionAutoscalerCallable()"); } @@ -54,28 +53,36 @@ public UnaryCallable getRegionAutosc } @BetaApi - public UnaryCallable insertRegionAutoscalerCallable() { + public UnaryCallable + insertRegionAutoscalerCallable() { throw new UnsupportedOperationException("Not implemented: insertRegionAutoscalerCallable()"); } @BetaApi - public UnaryCallable listRegionAutoscalersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRegionAutoscalersPagedCallable()"); + public UnaryCallable + listRegionAutoscalersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionAutoscalersPagedCallable()"); } @BetaApi - public UnaryCallable listRegionAutoscalersCallable() { + public UnaryCallable + listRegionAutoscalersCallable() { throw new UnsupportedOperationException("Not implemented: listRegionAutoscalersCallable()"); } @BetaApi - public UnaryCallable patchRegionAutoscalerCallable() { + public UnaryCallable + patchRegionAutoscalerCallable() { throw new UnsupportedOperationException("Not implemented: patchRegionAutoscalerCallable()"); } @BetaApi - public UnaryCallable updateRegionAutoscalerCallable() { + public UnaryCallable + updateRegionAutoscalerCallable() { throw new UnsupportedOperationException("Not implemented: updateRegionAutoscalerCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java index 64d30f536338..30450a52fd83 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.Autoscaler; import com.google.cloud.compute.v1.DeleteRegionAutoscalerHttpRequest; import com.google.cloud.compute.v1.GetRegionAutoscalerHttpRequest; @@ -49,17 +46,14 @@ import com.google.cloud.compute.v1.ListRegionAutoscalersHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchRegionAutoscalerHttpRequest; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; import com.google.cloud.compute.v1.RegionAutoscalerList; import com.google.cloud.compute.v1.UpdateRegionAutoscalerHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRegionAutoscaler to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRegionAutoscaler to 30 seconds: * *

  * 
@@ -93,68 +87,70 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionAutoscalerStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteRegionAutoscalerSettings;
-  private final UnaryCallSettings getRegionAutoscalerSettings;
-  private final UnaryCallSettings insertRegionAutoscalerSettings;
-  private final PagedCallSettings listRegionAutoscalersSettings;
-  private final UnaryCallSettings patchRegionAutoscalerSettings;
-  private final UnaryCallSettings updateRegionAutoscalerSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteRegionAutoscaler.
-   */
-  public UnaryCallSettings deleteRegionAutoscalerSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteRegionAutoscalerSettings;
+  private final UnaryCallSettings
+      getRegionAutoscalerSettings;
+  private final UnaryCallSettings
+      insertRegionAutoscalerSettings;
+  private final PagedCallSettings<
+          ListRegionAutoscalersHttpRequest, RegionAutoscalerList,
+          ListRegionAutoscalersPagedResponse>
+      listRegionAutoscalersSettings;
+  private final UnaryCallSettings
+      patchRegionAutoscalerSettings;
+  private final UnaryCallSettings
+      updateRegionAutoscalerSettings;
+
+  /** Returns the object with the settings used for calls to deleteRegionAutoscaler. */
+  public UnaryCallSettings
+      deleteRegionAutoscalerSettings() {
     return deleteRegionAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionAutoscaler.
-   */
-  public UnaryCallSettings getRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to getRegionAutoscaler. */
+  public UnaryCallSettings
+      getRegionAutoscalerSettings() {
     return getRegionAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionAutoscaler.
-   */
-  public UnaryCallSettings insertRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to insertRegionAutoscaler. */
+  public UnaryCallSettings
+      insertRegionAutoscalerSettings() {
     return insertRegionAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionAutoscalers.
-   */
-  public PagedCallSettings listRegionAutoscalersSettings() {
+  /** Returns the object with the settings used for calls to listRegionAutoscalers. */
+  public PagedCallSettings<
+          ListRegionAutoscalersHttpRequest, RegionAutoscalerList,
+          ListRegionAutoscalersPagedResponse>
+      listRegionAutoscalersSettings() {
     return listRegionAutoscalersSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchRegionAutoscaler.
-   */
-  public UnaryCallSettings patchRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to patchRegionAutoscaler. */
+  public UnaryCallSettings
+      patchRegionAutoscalerSettings() {
     return patchRegionAutoscalerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateRegionAutoscaler.
-   */
-  public UnaryCallSettings updateRegionAutoscalerSettings() {
+  /** Returns the object with the settings used for calls to updateRegionAutoscaler. */
+  public UnaryCallSettings
+      updateRegionAutoscalerSettings() {
     return updateRegionAutoscalerSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionAutoscalerStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +163,34 @@ public RegionAutoscalerStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +201,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionAutoscalerStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(RegionAutoscalerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -254,78 +234,100 @@ protected RegionAutoscalerStubSettings(Builder settingsBuilder) throws IOExcepti
     updateRegionAutoscalerSettings = settingsBuilder.updateRegionAutoscalerSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_REGION_AUTOSCALERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionAutoscalersHttpRequest injectToken(ListRegionAutoscalersHttpRequest payload, String token) {
-          return ListRegionAutoscalersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionAutoscalersHttpRequest injectPageSize(ListRegionAutoscalersHttpRequest payload, int pageSize) {
-          return ListRegionAutoscalersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionAutoscalersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RegionAutoscalerList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RegionAutoscalerList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGION_AUTOSCALERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionAutoscalersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGION_AUTOSCALERS_PAGE_STR_DESC, request, context);
-          return ListRegionAutoscalersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionAutoscalerStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListRegionAutoscalersHttpRequest, RegionAutoscalerList, Autoscaler>
+      LIST_REGION_AUTOSCALERS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListRegionAutoscalersHttpRequest, RegionAutoscalerList, Autoscaler>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionAutoscalersHttpRequest injectToken(
+                ListRegionAutoscalersHttpRequest payload, String token) {
+              return ListRegionAutoscalersHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListRegionAutoscalersHttpRequest injectPageSize(
+                ListRegionAutoscalersHttpRequest payload, int pageSize) {
+              return ListRegionAutoscalersHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionAutoscalersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RegionAutoscalerList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(RegionAutoscalerList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionAutoscalersHttpRequest, RegionAutoscalerList,
+          ListRegionAutoscalersPagedResponse>
+      LIST_REGION_AUTOSCALERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionAutoscalersHttpRequest, RegionAutoscalerList,
+              ListRegionAutoscalersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRegionAutoscalersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_REGION_AUTOSCALERS_PAGE_STR_DESC, request, context);
+              return ListRegionAutoscalersPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionAutoscalerStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteRegionAutoscalerSettings;
-    private final UnaryCallSettings.Builder getRegionAutoscalerSettings;
-    private final UnaryCallSettings.Builder insertRegionAutoscalerSettings;
-    private final PagedCallSettings.Builder listRegionAutoscalersSettings;
-    private final UnaryCallSettings.Builder patchRegionAutoscalerSettings;
-    private final UnaryCallSettings.Builder updateRegionAutoscalerSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteRegionAutoscalerSettings;
+    private final UnaryCallSettings.Builder
+        getRegionAutoscalerSettings;
+    private final UnaryCallSettings.Builder
+        insertRegionAutoscalerSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionAutoscalersHttpRequest, RegionAutoscalerList,
+            ListRegionAutoscalersPagedResponse>
+        listRegionAutoscalersSettings;
+    private final UnaryCallSettings.Builder
+        patchRegionAutoscalerSettings;
+    private final UnaryCallSettings.Builder
+        updateRegionAutoscalerSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +336,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +363,21 @@ protected Builder(ClientContext clientContext) {
 
       insertRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionAutoscalersSettings = PagedCallSettings.newBuilder(
-          LIST_REGION_AUTOSCALERS_PAGE_STR_FACT);
+      listRegionAutoscalersSettings =
+          PagedCallSettings.newBuilder(LIST_REGION_AUTOSCALERS_PAGE_STR_FACT);
 
       patchRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateRegionAutoscalerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRegionAutoscalerSettings,
-          getRegionAutoscalerSettings,
-          insertRegionAutoscalerSettings,
-          listRegionAutoscalersSettings,
-          patchRegionAutoscalerSettings,
-          updateRegionAutoscalerSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRegionAutoscalerSettings,
+              getRegionAutoscalerSettings,
+              insertRegionAutoscalerSettings,
+              listRegionAutoscalersSettings,
+              patchRegionAutoscalerSettings,
+              updateRegionAutoscalerSettings);
 
       initDefaults(this);
     }
@@ -390,27 +393,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteRegionAutoscalerSettings()
+      builder
+          .deleteRegionAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRegionAutoscalerSettings()
+      builder
+          .getRegionAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertRegionAutoscalerSettings()
+      builder
+          .insertRegionAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionAutoscalersSettings()
+      builder
+          .listRegionAutoscalersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchRegionAutoscalerSettings()
+      builder
+          .patchRegionAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateRegionAutoscalerSettings()
+      builder
+          .updateRegionAutoscalerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -427,22 +436,24 @@ protected Builder(RegionAutoscalerStubSettings settings) {
       patchRegionAutoscalerSettings = settings.patchRegionAutoscalerSettings.toBuilder();
       updateRegionAutoscalerSettings = settings.updateRegionAutoscalerSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRegionAutoscalerSettings,
-          getRegionAutoscalerSettings,
-          insertRegionAutoscalerSettings,
-          listRegionAutoscalersSettings,
-          patchRegionAutoscalerSettings,
-          updateRegionAutoscalerSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRegionAutoscalerSettings,
+              getRegionAutoscalerSettings,
+              insertRegionAutoscalerSettings,
+              listRegionAutoscalersSettings,
+              patchRegionAutoscalerSettings,
+              updateRegionAutoscalerSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +462,41 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to deleteRegionAutoscaler. */ + public UnaryCallSettings.Builder + deleteRegionAutoscalerSettings() { return deleteRegionAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to getRegionAutoscaler. - */ - public UnaryCallSettings.Builder getRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to getRegionAutoscaler. */ + public UnaryCallSettings.Builder + getRegionAutoscalerSettings() { return getRegionAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to insertRegionAutoscaler. - */ - public UnaryCallSettings.Builder insertRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to insertRegionAutoscaler. */ + public UnaryCallSettings.Builder + insertRegionAutoscalerSettings() { return insertRegionAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to listRegionAutoscalers. - */ - public PagedCallSettings.Builder listRegionAutoscalersSettings() { + /** Returns the builder for the settings used for calls to listRegionAutoscalers. */ + public PagedCallSettings.Builder< + ListRegionAutoscalersHttpRequest, RegionAutoscalerList, + ListRegionAutoscalersPagedResponse> + listRegionAutoscalersSettings() { return listRegionAutoscalersSettings; } - /** - * Returns the builder for the settings used for calls to patchRegionAutoscaler. - */ - public UnaryCallSettings.Builder patchRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to patchRegionAutoscaler. */ + public UnaryCallSettings.Builder + patchRegionAutoscalerSettings() { return patchRegionAutoscalerSettings; } - /** - * Returns the builder for the settings used for calls to updateRegionAutoscaler. - */ - public UnaryCallSettings.Builder updateRegionAutoscalerSettings() { + /** Returns the builder for the settings used for calls to updateRegionAutoscaler. */ + public UnaryCallSettings.Builder + updateRegionAutoscalerSettings() { return updateRegionAutoscalerSettings; } @@ -498,4 +505,4 @@ public RegionAutoscalerStubSettings build() throws IOException { return new RegionAutoscalerStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java index eeab923373c1..b822751e9a71 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -28,10 +30,6 @@ import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; -import com.google.cloud.compute.v1.ProjectRegionBackendServiceName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; -import com.google.cloud.compute.v1.ResourceGroupReference; import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; import javax.annotation.Generated; @@ -45,45 +43,59 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionBackendServiceStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteRegionBackendServiceCallable() { - throw new UnsupportedOperationException("Not implemented: deleteRegionBackendServiceCallable()"); + public UnaryCallable + deleteRegionBackendServiceCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteRegionBackendServiceCallable()"); } @BetaApi - public UnaryCallable getRegionBackendServiceCallable() { + public UnaryCallable + getRegionBackendServiceCallable() { throw new UnsupportedOperationException("Not implemented: getRegionBackendServiceCallable()"); } @BetaApi - public UnaryCallable getHealthRegionBackendServiceCallable() { - throw new UnsupportedOperationException("Not implemented: getHealthRegionBackendServiceCallable()"); + public UnaryCallable + getHealthRegionBackendServiceCallable() { + throw new UnsupportedOperationException( + "Not implemented: getHealthRegionBackendServiceCallable()"); } @BetaApi - public UnaryCallable insertRegionBackendServiceCallable() { - throw new UnsupportedOperationException("Not implemented: insertRegionBackendServiceCallable()"); + public UnaryCallable + insertRegionBackendServiceCallable() { + throw new UnsupportedOperationException( + "Not implemented: insertRegionBackendServiceCallable()"); } @BetaApi - public UnaryCallable listRegionBackendServicesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRegionBackendServicesPagedCallable()"); + public UnaryCallable + listRegionBackendServicesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionBackendServicesPagedCallable()"); } @BetaApi - public UnaryCallable listRegionBackendServicesCallable() { + public UnaryCallable + listRegionBackendServicesCallable() { throw new UnsupportedOperationException("Not implemented: listRegionBackendServicesCallable()"); } @BetaApi - public UnaryCallable patchRegionBackendServiceCallable() { + public UnaryCallable + patchRegionBackendServiceCallable() { throw new UnsupportedOperationException("Not implemented: patchRegionBackendServiceCallable()"); } @BetaApi - public UnaryCallable updateRegionBackendServiceCallable() { - throw new UnsupportedOperationException("Not implemented: updateRegionBackendServiceCallable()"); + public UnaryCallable + updateRegionBackendServiceCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateRegionBackendServiceCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java index 8955b0c0e072..58710886511f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.BackendService; import com.google.cloud.compute.v1.BackendServiceGroupHealth; import com.google.cloud.compute.v1.BackendServiceList; @@ -52,16 +49,13 @@ import com.google.cloud.compute.v1.ListRegionBackendServicesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchRegionBackendServiceHttpRequest; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; import com.google.cloud.compute.v1.UpdateRegionBackendServiceHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRegionBackendService to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRegionBackendService to 30 seconds: * *

  * 
@@ -94,77 +88,81 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class RegionBackendServiceStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteRegionBackendServiceSettings;
-  private final UnaryCallSettings getRegionBackendServiceSettings;
-  private final UnaryCallSettings getHealthRegionBackendServiceSettings;
-  private final UnaryCallSettings insertRegionBackendServiceSettings;
-  private final PagedCallSettings listRegionBackendServicesSettings;
-  private final UnaryCallSettings patchRegionBackendServiceSettings;
-  private final UnaryCallSettings updateRegionBackendServiceSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteRegionBackendService.
-   */
-  public UnaryCallSettings deleteRegionBackendServiceSettings() {
+public class RegionBackendServiceStubSettings
+    extends StubSettings {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteRegionBackendServiceSettings;
+  private final UnaryCallSettings
+      getRegionBackendServiceSettings;
+  private final UnaryCallSettings<
+          GetHealthRegionBackendServiceHttpRequest, BackendServiceGroupHealth>
+      getHealthRegionBackendServiceSettings;
+  private final UnaryCallSettings
+      insertRegionBackendServiceSettings;
+  private final PagedCallSettings<
+          ListRegionBackendServicesHttpRequest, BackendServiceList,
+          ListRegionBackendServicesPagedResponse>
+      listRegionBackendServicesSettings;
+  private final UnaryCallSettings
+      patchRegionBackendServiceSettings;
+  private final UnaryCallSettings
+      updateRegionBackendServiceSettings;
+
+  /** Returns the object with the settings used for calls to deleteRegionBackendService. */
+  public UnaryCallSettings
+      deleteRegionBackendServiceSettings() {
     return deleteRegionBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionBackendService.
-   */
-  public UnaryCallSettings getRegionBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getRegionBackendService. */
+  public UnaryCallSettings
+      getRegionBackendServiceSettings() {
     return getRegionBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthRegionBackendService.
-   */
-  public UnaryCallSettings getHealthRegionBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to getHealthRegionBackendService. */
+  public UnaryCallSettings
+      getHealthRegionBackendServiceSettings() {
     return getHealthRegionBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionBackendService.
-   */
-  public UnaryCallSettings insertRegionBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to insertRegionBackendService. */
+  public UnaryCallSettings
+      insertRegionBackendServiceSettings() {
     return insertRegionBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionBackendServices.
-   */
-  public PagedCallSettings listRegionBackendServicesSettings() {
+  /** Returns the object with the settings used for calls to listRegionBackendServices. */
+  public PagedCallSettings<
+          ListRegionBackendServicesHttpRequest, BackendServiceList,
+          ListRegionBackendServicesPagedResponse>
+      listRegionBackendServicesSettings() {
     return listRegionBackendServicesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchRegionBackendService.
-   */
-  public UnaryCallSettings patchRegionBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to patchRegionBackendService. */
+  public UnaryCallSettings
+      patchRegionBackendServiceSettings() {
     return patchRegionBackendServiceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateRegionBackendService.
-   */
-  public UnaryCallSettings updateRegionBackendServiceSettings() {
+  /** Returns the object with the settings used for calls to updateRegionBackendService. */
+  public UnaryCallSettings
+      updateRegionBackendServiceSettings() {
     return updateRegionBackendServiceSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionBackendServiceStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -177,47 +175,34 @@ public RegionBackendServiceStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -228,27 +213,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionBackendServiceStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(RegionBackendServiceStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -256,88 +238,118 @@ public Builder toBuilder() {
   protected RegionBackendServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    deleteRegionBackendServiceSettings = settingsBuilder.deleteRegionBackendServiceSettings().build();
+    deleteRegionBackendServiceSettings =
+        settingsBuilder.deleteRegionBackendServiceSettings().build();
     getRegionBackendServiceSettings = settingsBuilder.getRegionBackendServiceSettings().build();
-    getHealthRegionBackendServiceSettings = settingsBuilder.getHealthRegionBackendServiceSettings().build();
-    insertRegionBackendServiceSettings = settingsBuilder.insertRegionBackendServiceSettings().build();
+    getHealthRegionBackendServiceSettings =
+        settingsBuilder.getHealthRegionBackendServiceSettings().build();
+    insertRegionBackendServiceSettings =
+        settingsBuilder.insertRegionBackendServiceSettings().build();
     listRegionBackendServicesSettings = settingsBuilder.listRegionBackendServicesSettings().build();
     patchRegionBackendServiceSettings = settingsBuilder.patchRegionBackendServiceSettings().build();
-    updateRegionBackendServiceSettings = settingsBuilder.updateRegionBackendServiceSettings().build();
+    updateRegionBackendServiceSettings =
+        settingsBuilder.updateRegionBackendServiceSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_REGION_BACKEND_SERVICES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionBackendServicesHttpRequest injectToken(ListRegionBackendServicesHttpRequest payload, String token) {
-          return ListRegionBackendServicesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionBackendServicesHttpRequest injectPageSize(ListRegionBackendServicesHttpRequest payload, int pageSize) {
-          return ListRegionBackendServicesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionBackendServicesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(BackendServiceList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(BackendServiceList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGION_BACKEND_SERVICES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionBackendServicesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGION_BACKEND_SERVICES_PAGE_STR_DESC, request, context);
-          return ListRegionBackendServicesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionBackendServiceStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          ListRegionBackendServicesHttpRequest, BackendServiceList, BackendService>
+      LIST_REGION_BACKEND_SERVICES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListRegionBackendServicesHttpRequest, BackendServiceList, BackendService>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionBackendServicesHttpRequest injectToken(
+                ListRegionBackendServicesHttpRequest payload, String token) {
+              return ListRegionBackendServicesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListRegionBackendServicesHttpRequest injectPageSize(
+                ListRegionBackendServicesHttpRequest payload, int pageSize) {
+              return ListRegionBackendServicesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionBackendServicesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(BackendServiceList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(BackendServiceList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionBackendServicesHttpRequest, BackendServiceList,
+          ListRegionBackendServicesPagedResponse>
+      LIST_REGION_BACKEND_SERVICES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionBackendServicesHttpRequest, BackendServiceList,
+              ListRegionBackendServicesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRegionBackendServicesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_REGION_BACKEND_SERVICES_PAGE_STR_DESC, request, context);
+              return ListRegionBackendServicesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionBackendServiceStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteRegionBackendServiceSettings;
-    private final UnaryCallSettings.Builder getRegionBackendServiceSettings;
-    private final UnaryCallSettings.Builder getHealthRegionBackendServiceSettings;
-    private final UnaryCallSettings.Builder insertRegionBackendServiceSettings;
-    private final PagedCallSettings.Builder listRegionBackendServicesSettings;
-    private final UnaryCallSettings.Builder patchRegionBackendServiceSettings;
-    private final UnaryCallSettings.Builder updateRegionBackendServiceSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteRegionBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        getRegionBackendServiceSettings;
+    private final UnaryCallSettings.Builder<
+            GetHealthRegionBackendServiceHttpRequest, BackendServiceGroupHealth>
+        getHealthRegionBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        insertRegionBackendServiceSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionBackendServicesHttpRequest, BackendServiceList,
+            ListRegionBackendServicesPagedResponse>
+        listRegionBackendServicesSettings;
+    private final UnaryCallSettings.Builder
+        patchRegionBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        updateRegionBackendServiceSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -346,15 +358,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -374,22 +387,22 @@ protected Builder(ClientContext clientContext) {
 
       insertRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionBackendServicesSettings = PagedCallSettings.newBuilder(
-          LIST_REGION_BACKEND_SERVICES_PAGE_STR_FACT);
+      listRegionBackendServicesSettings =
+          PagedCallSettings.newBuilder(LIST_REGION_BACKEND_SERVICES_PAGE_STR_FACT);
 
       patchRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       updateRegionBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRegionBackendServiceSettings,
-          getRegionBackendServiceSettings,
-          getHealthRegionBackendServiceSettings,
-          insertRegionBackendServiceSettings,
-          listRegionBackendServicesSettings,
-          patchRegionBackendServiceSettings,
-          updateRegionBackendServiceSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRegionBackendServiceSettings,
+              getRegionBackendServiceSettings,
+              getHealthRegionBackendServiceSettings,
+              insertRegionBackendServiceSettings,
+              listRegionBackendServicesSettings,
+              patchRegionBackendServiceSettings,
+              updateRegionBackendServiceSettings);
 
       initDefaults(this);
     }
@@ -405,31 +418,38 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteRegionBackendServiceSettings()
+      builder
+          .deleteRegionBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRegionBackendServiceSettings()
+      builder
+          .getRegionBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getHealthRegionBackendServiceSettings()
+      builder
+          .getHealthRegionBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertRegionBackendServiceSettings()
+      builder
+          .insertRegionBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionBackendServicesSettings()
+      builder
+          .listRegionBackendServicesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchRegionBackendServiceSettings()
+      builder
+          .patchRegionBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateRegionBackendServiceSettings()
+      builder
+          .updateRegionBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -441,29 +461,32 @@ protected Builder(RegionBackendServiceStubSettings settings) {
 
       deleteRegionBackendServiceSettings = settings.deleteRegionBackendServiceSettings.toBuilder();
       getRegionBackendServiceSettings = settings.getRegionBackendServiceSettings.toBuilder();
-      getHealthRegionBackendServiceSettings = settings.getHealthRegionBackendServiceSettings.toBuilder();
+      getHealthRegionBackendServiceSettings =
+          settings.getHealthRegionBackendServiceSettings.toBuilder();
       insertRegionBackendServiceSettings = settings.insertRegionBackendServiceSettings.toBuilder();
       listRegionBackendServicesSettings = settings.listRegionBackendServicesSettings.toBuilder();
       patchRegionBackendServiceSettings = settings.patchRegionBackendServiceSettings.toBuilder();
       updateRegionBackendServiceSettings = settings.updateRegionBackendServiceSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRegionBackendServiceSettings,
-          getRegionBackendServiceSettings,
-          getHealthRegionBackendServiceSettings,
-          insertRegionBackendServiceSettings,
-          listRegionBackendServicesSettings,
-          patchRegionBackendServiceSettings,
-          updateRegionBackendServiceSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRegionBackendServiceSettings,
+              getRegionBackendServiceSettings,
+              getHealthRegionBackendServiceSettings,
+              insertRegionBackendServiceSettings,
+              listRegionBackendServicesSettings,
+              patchRegionBackendServiceSettings,
+              updateRegionBackendServiceSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -472,52 +495,48 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to deleteRegionBackendService. */ + public UnaryCallSettings.Builder + deleteRegionBackendServiceSettings() { return deleteRegionBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to getRegionBackendService. - */ - public UnaryCallSettings.Builder getRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getRegionBackendService. */ + public UnaryCallSettings.Builder + getRegionBackendServiceSettings() { return getRegionBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to getHealthRegionBackendService. - */ - public UnaryCallSettings.Builder getHealthRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to getHealthRegionBackendService. */ + public UnaryCallSettings.Builder< + GetHealthRegionBackendServiceHttpRequest, BackendServiceGroupHealth> + getHealthRegionBackendServiceSettings() { return getHealthRegionBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to insertRegionBackendService. - */ - public UnaryCallSettings.Builder insertRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to insertRegionBackendService. */ + public UnaryCallSettings.Builder + insertRegionBackendServiceSettings() { return insertRegionBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to listRegionBackendServices. - */ - public PagedCallSettings.Builder listRegionBackendServicesSettings() { + /** Returns the builder for the settings used for calls to listRegionBackendServices. */ + public PagedCallSettings.Builder< + ListRegionBackendServicesHttpRequest, BackendServiceList, + ListRegionBackendServicesPagedResponse> + listRegionBackendServicesSettings() { return listRegionBackendServicesSettings; } - /** - * Returns the builder for the settings used for calls to patchRegionBackendService. - */ - public UnaryCallSettings.Builder patchRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to patchRegionBackendService. */ + public UnaryCallSettings.Builder + patchRegionBackendServiceSettings() { return patchRegionBackendServiceSettings; } - /** - * Returns the builder for the settings used for calls to updateRegionBackendService. - */ - public UnaryCallSettings.Builder updateRegionBackendServiceSettings() { + /** Returns the builder for the settings used for calls to updateRegionBackendService. */ + public UnaryCallSettings.Builder + updateRegionBackendServiceSettings() { return updateRegionBackendServiceSettings; } @@ -526,4 +545,4 @@ public RegionBackendServiceStubSettings build() throws IOException { return new RegionBackendServiceStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java index f698f7cab48f..1b110ca49307 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -22,16 +25,10 @@ import com.google.cloud.compute.v1.Commitment; import com.google.cloud.compute.v1.CommitmentAggregatedList; import com.google.cloud.compute.v1.CommitmentList; -import com.google.cloud.compute.v1.CommitmentsScopedList; import com.google.cloud.compute.v1.GetRegionCommitmentHttpRequest; import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionCommitmentName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -44,15 +41,19 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionCommitmentStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListRegionCommitmentsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListRegionCommitmentsPagedCallable()"); + public UnaryCallable< + AggregatedListRegionCommitmentsHttpRequest, AggregatedListRegionCommitmentsPagedResponse> + aggregatedListRegionCommitmentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListRegionCommitmentsPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListRegionCommitmentsCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListRegionCommitmentsCallable()"); + public UnaryCallable + aggregatedListRegionCommitmentsCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListRegionCommitmentsCallable()"); } @BetaApi @@ -61,18 +62,24 @@ public UnaryCallable getRegionCommit } @BetaApi - public UnaryCallable insertRegionCommitmentCallable() { + public UnaryCallable + insertRegionCommitmentCallable() { throw new UnsupportedOperationException("Not implemented: insertRegionCommitmentCallable()"); } @BetaApi - public UnaryCallable listRegionCommitmentsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRegionCommitmentsPagedCallable()"); + public UnaryCallable + listRegionCommitmentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionCommitmentsPagedCallable()"); } @BetaApi - public UnaryCallable listRegionCommitmentsCallable() { + public UnaryCallable + listRegionCommitmentsCallable() { throw new UnsupportedOperationException("Not implemented: listRegionCommitmentsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java index 24c5909ba899..964205015e3d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListRegionCommitmentsHttpRequest; import com.google.cloud.compute.v1.Commitment; import com.google.cloud.compute.v1.CommitmentAggregatedList; @@ -51,16 +49,12 @@ import com.google.cloud.compute.v1.InsertRegionCommitmentHttpRequest; import com.google.cloud.compute.v1.ListRegionCommitmentsHttpRequest; import com.google.cloud.compute.v1.Operation; -import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -71,15 +65,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getRegionCommitment to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegionCommitment to 30 seconds: * *

  * 
@@ -94,52 +88,56 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionCommitmentStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListRegionCommitmentsSettings;
-  private final UnaryCallSettings getRegionCommitmentSettings;
-  private final UnaryCallSettings insertRegionCommitmentSettings;
-  private final PagedCallSettings listRegionCommitmentsSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListRegionCommitments.
-   */
-  public PagedCallSettings aggregatedListRegionCommitmentsSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+          AggregatedListRegionCommitmentsPagedResponse>
+      aggregatedListRegionCommitmentsSettings;
+  private final UnaryCallSettings
+      getRegionCommitmentSettings;
+  private final UnaryCallSettings
+      insertRegionCommitmentSettings;
+  private final PagedCallSettings<
+          ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse>
+      listRegionCommitmentsSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListRegionCommitments. */
+  public PagedCallSettings<
+          AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+          AggregatedListRegionCommitmentsPagedResponse>
+      aggregatedListRegionCommitmentsSettings() {
     return aggregatedListRegionCommitmentsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionCommitment.
-   */
-  public UnaryCallSettings getRegionCommitmentSettings() {
+  /** Returns the object with the settings used for calls to getRegionCommitment. */
+  public UnaryCallSettings
+      getRegionCommitmentSettings() {
     return getRegionCommitmentSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionCommitment.
-   */
-  public UnaryCallSettings insertRegionCommitmentSettings() {
+  /** Returns the object with the settings used for calls to insertRegionCommitment. */
+  public UnaryCallSettings
+      insertRegionCommitmentSettings() {
     return insertRegionCommitmentSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionCommitments.
-   */
-  public PagedCallSettings listRegionCommitmentsSettings() {
+  /** Returns the object with the settings used for calls to listRegionCommitments. */
+  public PagedCallSettings<
+          ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse>
+      listRegionCommitmentsSettings() {
     return listRegionCommitmentsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionCommitmentStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -152,47 +150,34 @@ public RegionCommitmentStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -203,27 +188,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionCommitmentStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(RegionCommitmentStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -231,130 +213,175 @@ public Builder toBuilder() {
   protected RegionCommitmentStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListRegionCommitmentsSettings = settingsBuilder.aggregatedListRegionCommitmentsSettings().build();
+    aggregatedListRegionCommitmentsSettings =
+        settingsBuilder.aggregatedListRegionCommitmentsSettings().build();
     getRegionCommitmentSettings = settingsBuilder.getRegionCommitmentSettings().build();
     insertRegionCommitmentSettings = settingsBuilder.insertRegionCommitmentSettings().build();
     listRegionCommitmentsSettings = settingsBuilder.listRegionCommitmentsSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListRegionCommitmentsHttpRequest injectToken(AggregatedListRegionCommitmentsHttpRequest payload, String token) {
-          return AggregatedListRegionCommitmentsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListRegionCommitmentsHttpRequest injectPageSize(AggregatedListRegionCommitmentsHttpRequest payload, int pageSize) {
-          return AggregatedListRegionCommitmentsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListRegionCommitmentsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(CommitmentAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(CommitmentAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_REGION_COMMITMENTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionCommitmentsHttpRequest injectToken(ListRegionCommitmentsHttpRequest payload, String token) {
-          return ListRegionCommitmentsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionCommitmentsHttpRequest injectPageSize(ListRegionCommitmentsHttpRequest payload, int pageSize) {
-          return ListRegionCommitmentsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionCommitmentsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(CommitmentList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(CommitmentList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListRegionCommitmentsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_DESC, request, context);
-          return AggregatedListRegionCommitmentsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGION_COMMITMENTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionCommitmentsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGION_COMMITMENTS_PAGE_STR_DESC, request, context);
-          return ListRegionCommitmentsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionCommitmentStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+          CommitmentsScopedList>
+      AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+              CommitmentsScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListRegionCommitmentsHttpRequest injectToken(
+                AggregatedListRegionCommitmentsHttpRequest payload, String token) {
+              return AggregatedListRegionCommitmentsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListRegionCommitmentsHttpRequest injectPageSize(
+                AggregatedListRegionCommitmentsHttpRequest payload, int pageSize) {
+              return AggregatedListRegionCommitmentsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListRegionCommitmentsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(CommitmentAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                CommitmentAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListRegionCommitmentsHttpRequest, CommitmentList, Commitment>
+      LIST_REGION_COMMITMENTS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionCommitmentsHttpRequest injectToken(
+                ListRegionCommitmentsHttpRequest payload, String token) {
+              return ListRegionCommitmentsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListRegionCommitmentsHttpRequest injectPageSize(
+                ListRegionCommitmentsHttpRequest payload, int pageSize) {
+              return ListRegionCommitmentsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionCommitmentsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(CommitmentList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(CommitmentList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+          AggregatedListRegionCommitmentsPagedResponse>
+      AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+              AggregatedListRegionCommitmentsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListRegionCommitmentsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+                      CommitmentsScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListRegionCommitmentsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse>
+      LIST_REGION_COMMITMENTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionCommitmentsHttpRequest, CommitmentList,
+              ListRegionCommitmentsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRegionCommitmentsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_REGION_COMMITMENTS_PAGE_STR_DESC, request, context);
+              return ListRegionCommitmentsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionCommitmentStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListRegionCommitmentsSettings;
-    private final UnaryCallSettings.Builder getRegionCommitmentSettings;
-    private final UnaryCallSettings.Builder insertRegionCommitmentSettings;
-    private final PagedCallSettings.Builder listRegionCommitmentsSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList,
+            AggregatedListRegionCommitmentsPagedResponse>
+        aggregatedListRegionCommitmentsSettings;
+    private final UnaryCallSettings.Builder
+        getRegionCommitmentSettings;
+    private final UnaryCallSettings.Builder
+        insertRegionCommitmentSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse>
+        listRegionCommitmentsSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -363,15 +390,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -383,22 +411,22 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListRegionCommitmentsSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_FACT);
+      aggregatedListRegionCommitmentsSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_REGION_COMMITMENTS_PAGE_STR_FACT);
 
       getRegionCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       insertRegionCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionCommitmentsSettings = PagedCallSettings.newBuilder(
-          LIST_REGION_COMMITMENTS_PAGE_STR_FACT);
+      listRegionCommitmentsSettings =
+          PagedCallSettings.newBuilder(LIST_REGION_COMMITMENTS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListRegionCommitmentsSettings,
-          getRegionCommitmentSettings,
-          insertRegionCommitmentSettings,
-          listRegionCommitmentsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListRegionCommitmentsSettings,
+              getRegionCommitmentSettings,
+              insertRegionCommitmentSettings,
+              listRegionCommitmentsSettings);
 
       initDefaults(this);
     }
@@ -414,19 +442,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListRegionCommitmentsSettings()
+      builder
+          .aggregatedListRegionCommitmentsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRegionCommitmentSettings()
+      builder
+          .getRegionCommitmentSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertRegionCommitmentSettings()
+      builder
+          .insertRegionCommitmentSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionCommitmentsSettings()
+      builder
+          .listRegionCommitmentsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -436,25 +468,28 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(RegionCommitmentStubSettings settings) {
       super(settings);
 
-      aggregatedListRegionCommitmentsSettings = settings.aggregatedListRegionCommitmentsSettings.toBuilder();
+      aggregatedListRegionCommitmentsSettings =
+          settings.aggregatedListRegionCommitmentsSettings.toBuilder();
       getRegionCommitmentSettings = settings.getRegionCommitmentSettings.toBuilder();
       insertRegionCommitmentSettings = settings.insertRegionCommitmentSettings.toBuilder();
       listRegionCommitmentsSettings = settings.listRegionCommitmentsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListRegionCommitmentsSettings,
-          getRegionCommitmentSettings,
-          insertRegionCommitmentSettings,
-          listRegionCommitmentsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListRegionCommitmentsSettings,
+              getRegionCommitmentSettings,
+              insertRegionCommitmentSettings,
+              listRegionCommitmentsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -463,31 +498,30 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListRegionCommitmentsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListRegionCommitments. */ + public PagedCallSettings.Builder< + AggregatedListRegionCommitmentsHttpRequest, CommitmentAggregatedList, + AggregatedListRegionCommitmentsPagedResponse> + aggregatedListRegionCommitmentsSettings() { return aggregatedListRegionCommitmentsSettings; } - /** - * Returns the builder for the settings used for calls to getRegionCommitment. - */ - public UnaryCallSettings.Builder getRegionCommitmentSettings() { + /** Returns the builder for the settings used for calls to getRegionCommitment. */ + public UnaryCallSettings.Builder + getRegionCommitmentSettings() { return getRegionCommitmentSettings; } - /** - * Returns the builder for the settings used for calls to insertRegionCommitment. - */ - public UnaryCallSettings.Builder insertRegionCommitmentSettings() { + /** Returns the builder for the settings used for calls to insertRegionCommitment. */ + public UnaryCallSettings.Builder + insertRegionCommitmentSettings() { return insertRegionCommitmentSettings; } - /** - * Returns the builder for the settings used for calls to listRegionCommitments. - */ - public PagedCallSettings.Builder listRegionCommitmentsSettings() { + /** Returns the builder for the settings used for calls to listRegionCommitments. */ + public PagedCallSettings.Builder< + ListRegionCommitmentsHttpRequest, CommitmentList, ListRegionCommitmentsPagedResponse> + listRegionCommitmentsSettings() { return listRegionCommitmentsSettings; } @@ -496,4 +530,4 @@ public RegionCommitmentStubSettings build() throws IOException { return new RegionCommitmentStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java index d9aa69869567..21147e0d464b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -27,17 +29,9 @@ import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; -import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; -import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerHttpRequest; @@ -53,65 +47,93 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionInstanceGroupManagerStub implements BackgroundResource { - @BetaApi - public UnaryCallable abandonInstancesRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: abandonInstancesRegionInstanceGroupManagerCallable()"); + public UnaryCallable + abandonInstancesRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: abandonInstancesRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable deleteRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: deleteRegionInstanceGroupManagerCallable()"); + public UnaryCallable + deleteRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable deleteInstancesRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: deleteInstancesRegionInstanceGroupManagerCallable()"); + public UnaryCallable + deleteInstancesRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteInstancesRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable getRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: getRegionInstanceGroupManagerCallable()"); + public UnaryCallable + getRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: getRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable insertRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: insertRegionInstanceGroupManagerCallable()"); + public UnaryCallable + insertRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: insertRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable listRegionInstanceGroupManagersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupManagersPagedCallable()"); + public UnaryCallable< + ListRegionInstanceGroupManagersHttpRequest, ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionInstanceGroupManagersPagedCallable()"); } @BetaApi - public UnaryCallable listRegionInstanceGroupManagersCallable() { - throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupManagersCallable()"); + public UnaryCallable + listRegionInstanceGroupManagersCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionInstanceGroupManagersCallable()"); } @BetaApi - public UnaryCallable listManagedInstancesRegionInstanceGroupManagersCallable() { - throw new UnsupportedOperationException("Not implemented: listManagedInstancesRegionInstanceGroupManagersCallable()"); + public UnaryCallable< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersCallable() { + throw new UnsupportedOperationException( + "Not implemented: listManagedInstancesRegionInstanceGroupManagersCallable()"); } @BetaApi - public UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: recreateInstancesRegionInstanceGroupManagerCallable()"); + public UnaryCallable + recreateInstancesRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: recreateInstancesRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable resizeRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: resizeRegionInstanceGroupManagerCallable()"); + public UnaryCallable + resizeRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: resizeRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable setInstanceTemplateRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: setInstanceTemplateRegionInstanceGroupManagerCallable()"); + public UnaryCallable + setInstanceTemplateRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: setInstanceTemplateRegionInstanceGroupManagerCallable()"); } @BetaApi - public UnaryCallable setTargetPoolsRegionInstanceGroupManagerCallable() { - throw new UnsupportedOperationException("Not implemented: setTargetPoolsRegionInstanceGroupManagerCallable()"); + public UnaryCallable + setTargetPoolsRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: setTargetPoolsRegionInstanceGroupManagerCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java index acfde157e4ec..d796075b303c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerHttpRequest; @@ -52,7 +49,6 @@ import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; -import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; import com.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerHttpRequest; @@ -62,10 +58,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -76,15 +70,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of abandonInstancesRegionInstanceGroupManager to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of abandonInstancesRegionInstanceGroupManager to 30 seconds: * *

  * 
@@ -98,109 +92,135 @@
  */
 @Generated("by GAPIC v0.0.5")
 @BetaApi
-public class RegionInstanceGroupManagerStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings abandonInstancesRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings deleteRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings deleteInstancesRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings getRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings insertRegionInstanceGroupManagerSettings;
-  private final PagedCallSettings listRegionInstanceGroupManagersSettings;
-  private final UnaryCallSettings listManagedInstancesRegionInstanceGroupManagersSettings;
-  private final UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings resizeRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings setInstanceTemplateRegionInstanceGroupManagerSettings;
-  private final UnaryCallSettings setTargetPoolsRegionInstanceGroupManagerSettings;
+public class RegionInstanceGroupManagerStubSettings
+    extends StubSettings {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      abandonInstancesRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      deleteRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      deleteInstancesRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      getRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      insertRegionInstanceGroupManagerSettings;
+  private final PagedCallSettings<
+          ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+          ListRegionInstanceGroupManagersPagedResponse>
+      listRegionInstanceGroupManagersSettings;
+  private final UnaryCallSettings<
+          ListManagedInstancesRegionInstanceGroupManagersHttpRequest,
+          RegionInstanceGroupManagersListInstancesResponse>
+      listManagedInstancesRegionInstanceGroupManagersSettings;
+  private final UnaryCallSettings
+      recreateInstancesRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      resizeRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings<
+          SetInstanceTemplateRegionInstanceGroupManagerHttpRequest, Operation>
+      setInstanceTemplateRegionInstanceGroupManagerSettings;
+  private final UnaryCallSettings
+      setTargetPoolsRegionInstanceGroupManagerSettings;
 
   /**
-   * Returns the object with the settings used for calls to abandonInstancesRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * abandonInstancesRegionInstanceGroupManager.
    */
-  public UnaryCallSettings abandonInstancesRegionInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      abandonInstancesRegionInstanceGroupManagerSettings() {
     return abandonInstancesRegionInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings deleteRegionInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to deleteRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      deleteRegionInstanceGroupManagerSettings() {
     return deleteRegionInstanceGroupManagerSettings;
   }
 
   /**
-   * Returns the object with the settings used for calls to deleteInstancesRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * deleteInstancesRegionInstanceGroupManager.
    */
-  public UnaryCallSettings deleteInstancesRegionInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      deleteInstancesRegionInstanceGroupManagerSettings() {
     return deleteInstancesRegionInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings getRegionInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to getRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      getRegionInstanceGroupManagerSettings() {
     return getRegionInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings insertRegionInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to insertRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      insertRegionInstanceGroupManagerSettings() {
     return insertRegionInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionInstanceGroupManagers.
-   */
-  public PagedCallSettings listRegionInstanceGroupManagersSettings() {
+  /** Returns the object with the settings used for calls to listRegionInstanceGroupManagers. */
+  public PagedCallSettings<
+          ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+          ListRegionInstanceGroupManagersPagedResponse>
+      listRegionInstanceGroupManagersSettings() {
     return listRegionInstanceGroupManagersSettings;
   }
 
   /**
-   * Returns the object with the settings used for calls to listManagedInstancesRegionInstanceGroupManagers.
+   * Returns the object with the settings used for calls to
+   * listManagedInstancesRegionInstanceGroupManagers.
    */
-  public UnaryCallSettings listManagedInstancesRegionInstanceGroupManagersSettings() {
+  public UnaryCallSettings<
+          ListManagedInstancesRegionInstanceGroupManagersHttpRequest,
+          RegionInstanceGroupManagersListInstancesResponse>
+      listManagedInstancesRegionInstanceGroupManagersSettings() {
     return listManagedInstancesRegionInstanceGroupManagersSettings;
   }
 
   /**
-   * Returns the object with the settings used for calls to recreateInstancesRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * recreateInstancesRegionInstanceGroupManager.
    */
-  public UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      recreateInstancesRegionInstanceGroupManagerSettings() {
     return recreateInstancesRegionInstanceGroupManagerSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to resizeRegionInstanceGroupManager.
-   */
-  public UnaryCallSettings resizeRegionInstanceGroupManagerSettings() {
+  /** Returns the object with the settings used for calls to resizeRegionInstanceGroupManager. */
+  public UnaryCallSettings
+      resizeRegionInstanceGroupManagerSettings() {
     return resizeRegionInstanceGroupManagerSettings;
   }
 
   /**
-   * Returns the object with the settings used for calls to setInstanceTemplateRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * setInstanceTemplateRegionInstanceGroupManager.
    */
-  public UnaryCallSettings setInstanceTemplateRegionInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      setInstanceTemplateRegionInstanceGroupManagerSettings() {
     return setInstanceTemplateRegionInstanceGroupManagerSettings;
   }
 
   /**
-   * Returns the object with the settings used for calls to setTargetPoolsRegionInstanceGroupManager.
+   * Returns the object with the settings used for calls to
+   * setTargetPoolsRegionInstanceGroupManager.
    */
-  public UnaryCallSettings setTargetPoolsRegionInstanceGroupManagerSettings() {
+  public UnaryCallSettings
+      setTargetPoolsRegionInstanceGroupManagerSettings() {
     return setTargetPoolsRegionInstanceGroupManagerSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionInstanceGroupManagerStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -213,47 +233,34 @@ public RegionInstanceGroupManagerStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -264,27 +271,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionInstanceGroupManagerStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(RegionInstanceGroupManagerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -292,96 +296,154 @@ public Builder toBuilder() {
   protected RegionInstanceGroupManagerStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    abandonInstancesRegionInstanceGroupManagerSettings = settingsBuilder.abandonInstancesRegionInstanceGroupManagerSettings().build();
-    deleteRegionInstanceGroupManagerSettings = settingsBuilder.deleteRegionInstanceGroupManagerSettings().build();
-    deleteInstancesRegionInstanceGroupManagerSettings = settingsBuilder.deleteInstancesRegionInstanceGroupManagerSettings().build();
-    getRegionInstanceGroupManagerSettings = settingsBuilder.getRegionInstanceGroupManagerSettings().build();
-    insertRegionInstanceGroupManagerSettings = settingsBuilder.insertRegionInstanceGroupManagerSettings().build();
-    listRegionInstanceGroupManagersSettings = settingsBuilder.listRegionInstanceGroupManagersSettings().build();
-    listManagedInstancesRegionInstanceGroupManagersSettings = settingsBuilder.listManagedInstancesRegionInstanceGroupManagersSettings().build();
-    recreateInstancesRegionInstanceGroupManagerSettings = settingsBuilder.recreateInstancesRegionInstanceGroupManagerSettings().build();
-    resizeRegionInstanceGroupManagerSettings = settingsBuilder.resizeRegionInstanceGroupManagerSettings().build();
-    setInstanceTemplateRegionInstanceGroupManagerSettings = settingsBuilder.setInstanceTemplateRegionInstanceGroupManagerSettings().build();
-    setTargetPoolsRegionInstanceGroupManagerSettings = settingsBuilder.setTargetPoolsRegionInstanceGroupManagerSettings().build();
+    abandonInstancesRegionInstanceGroupManagerSettings =
+        settingsBuilder.abandonInstancesRegionInstanceGroupManagerSettings().build();
+    deleteRegionInstanceGroupManagerSettings =
+        settingsBuilder.deleteRegionInstanceGroupManagerSettings().build();
+    deleteInstancesRegionInstanceGroupManagerSettings =
+        settingsBuilder.deleteInstancesRegionInstanceGroupManagerSettings().build();
+    getRegionInstanceGroupManagerSettings =
+        settingsBuilder.getRegionInstanceGroupManagerSettings().build();
+    insertRegionInstanceGroupManagerSettings =
+        settingsBuilder.insertRegionInstanceGroupManagerSettings().build();
+    listRegionInstanceGroupManagersSettings =
+        settingsBuilder.listRegionInstanceGroupManagersSettings().build();
+    listManagedInstancesRegionInstanceGroupManagersSettings =
+        settingsBuilder.listManagedInstancesRegionInstanceGroupManagersSettings().build();
+    recreateInstancesRegionInstanceGroupManagerSettings =
+        settingsBuilder.recreateInstancesRegionInstanceGroupManagerSettings().build();
+    resizeRegionInstanceGroupManagerSettings =
+        settingsBuilder.resizeRegionInstanceGroupManagerSettings().build();
+    setInstanceTemplateRegionInstanceGroupManagerSettings =
+        settingsBuilder.setInstanceTemplateRegionInstanceGroupManagerSettings().build();
+    setTargetPoolsRegionInstanceGroupManagerSettings =
+        settingsBuilder.setTargetPoolsRegionInstanceGroupManagerSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionInstanceGroupManagersHttpRequest injectToken(ListRegionInstanceGroupManagersHttpRequest payload, String token) {
-          return ListRegionInstanceGroupManagersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionInstanceGroupManagersHttpRequest injectPageSize(ListRegionInstanceGroupManagersHttpRequest payload, int pageSize) {
-          return ListRegionInstanceGroupManagersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionInstanceGroupManagersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RegionInstanceGroupManagerList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RegionInstanceGroupManagerList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionInstanceGroupManagersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC, request, context);
-          return ListRegionInstanceGroupManagersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionInstanceGroupManagerStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+          InstanceGroupManager>
+      LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+              InstanceGroupManager>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionInstanceGroupManagersHttpRequest injectToken(
+                ListRegionInstanceGroupManagersHttpRequest payload, String token) {
+              return ListRegionInstanceGroupManagersHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListRegionInstanceGroupManagersHttpRequest injectPageSize(
+                ListRegionInstanceGroupManagersHttpRequest payload, int pageSize) {
+              return ListRegionInstanceGroupManagersHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionInstanceGroupManagersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RegionInstanceGroupManagerList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                RegionInstanceGroupManagerList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+          ListRegionInstanceGroupManagersPagedResponse>
+      LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+              ListRegionInstanceGroupManagersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList>
+                    callable,
+                ListRegionInstanceGroupManagersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+                      InstanceGroupManager>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return ListRegionInstanceGroupManagersPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionInstanceGroupManagerStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder abandonInstancesRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder deleteRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder deleteInstancesRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder getRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder insertRegionInstanceGroupManagerSettings;
-    private final PagedCallSettings.Builder listRegionInstanceGroupManagersSettings;
-    private final UnaryCallSettings.Builder listManagedInstancesRegionInstanceGroupManagersSettings;
-    private final UnaryCallSettings.Builder recreateInstancesRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder resizeRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder setInstanceTemplateRegionInstanceGroupManagerSettings;
-    private final UnaryCallSettings.Builder setTargetPoolsRegionInstanceGroupManagerSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder<
+            AbandonInstancesRegionInstanceGroupManagerHttpRequest, Operation>
+        abandonInstancesRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder
+        deleteRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            DeleteInstancesRegionInstanceGroupManagerHttpRequest, Operation>
+        deleteInstancesRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            GetRegionInstanceGroupManagerHttpRequest, InstanceGroupManager>
+        getRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder
+        insertRegionInstanceGroupManagerSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList,
+            ListRegionInstanceGroupManagersPagedResponse>
+        listRegionInstanceGroupManagersSettings;
+    private final UnaryCallSettings.Builder<
+            ListManagedInstancesRegionInstanceGroupManagersHttpRequest,
+            RegionInstanceGroupManagersListInstancesResponse>
+        listManagedInstancesRegionInstanceGroupManagersSettings;
+    private final UnaryCallSettings.Builder<
+            RecreateInstancesRegionInstanceGroupManagerHttpRequest, Operation>
+        recreateInstancesRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder
+        resizeRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            SetInstanceTemplateRegionInstanceGroupManagerHttpRequest, Operation>
+        setInstanceTemplateRegionInstanceGroupManagerSettings;
+    private final UnaryCallSettings.Builder<
+            SetTargetPoolsRegionInstanceGroupManagerHttpRequest, Operation>
+        setTargetPoolsRegionInstanceGroupManagerSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -390,15 +452,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -410,42 +473,48 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      abandonInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      abandonInstancesRegionInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       deleteRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      deleteInstancesRegionInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       insertRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionInstanceGroupManagersSettings = PagedCallSettings.newBuilder(
-          LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT);
+      listRegionInstanceGroupManagersSettings =
+          PagedCallSettings.newBuilder(LIST_REGION_INSTANCE_GROUP_MANAGERS_PAGE_STR_FACT);
 
-      listManagedInstancesRegionInstanceGroupManagersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      listManagedInstancesRegionInstanceGroupManagersSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      recreateInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+      recreateInstancesRegionInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       resizeRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      setInstanceTemplateRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
-      setTargetPoolsRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          abandonInstancesRegionInstanceGroupManagerSettings,
-          deleteRegionInstanceGroupManagerSettings,
-          deleteInstancesRegionInstanceGroupManagerSettings,
-          getRegionInstanceGroupManagerSettings,
-          insertRegionInstanceGroupManagerSettings,
-          listRegionInstanceGroupManagersSettings,
-          listManagedInstancesRegionInstanceGroupManagersSettings,
-          recreateInstancesRegionInstanceGroupManagerSettings,
-          resizeRegionInstanceGroupManagerSettings,
-          setInstanceTemplateRegionInstanceGroupManagerSettings,
-          setTargetPoolsRegionInstanceGroupManagerSettings
-      );
+      setInstanceTemplateRegionInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      setTargetPoolsRegionInstanceGroupManagerSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              abandonInstancesRegionInstanceGroupManagerSettings,
+              deleteRegionInstanceGroupManagerSettings,
+              deleteInstancesRegionInstanceGroupManagerSettings,
+              getRegionInstanceGroupManagerSettings,
+              insertRegionInstanceGroupManagerSettings,
+              listRegionInstanceGroupManagersSettings,
+              listManagedInstancesRegionInstanceGroupManagersSettings,
+              recreateInstancesRegionInstanceGroupManagerSettings,
+              resizeRegionInstanceGroupManagerSettings,
+              setInstanceTemplateRegionInstanceGroupManagerSettings,
+              setTargetPoolsRegionInstanceGroupManagerSettings);
 
       initDefaults(this);
     }
@@ -461,47 +530,58 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.abandonInstancesRegionInstanceGroupManagerSettings()
+      builder
+          .abandonInstancesRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteRegionInstanceGroupManagerSettings()
+      builder
+          .deleteRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteInstancesRegionInstanceGroupManagerSettings()
+      builder
+          .deleteInstancesRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRegionInstanceGroupManagerSettings()
+      builder
+          .getRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertRegionInstanceGroupManagerSettings()
+      builder
+          .insertRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionInstanceGroupManagersSettings()
+      builder
+          .listRegionInstanceGroupManagersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listManagedInstancesRegionInstanceGroupManagersSettings()
+      builder
+          .listManagedInstancesRegionInstanceGroupManagersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.recreateInstancesRegionInstanceGroupManagerSettings()
+      builder
+          .recreateInstancesRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.resizeRegionInstanceGroupManagerSettings()
+      builder
+          .resizeRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setInstanceTemplateRegionInstanceGroupManagerSettings()
+      builder
+          .setInstanceTemplateRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setTargetPoolsRegionInstanceGroupManagerSettings()
+      builder
+          .setTargetPoolsRegionInstanceGroupManagerSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -511,39 +591,52 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(RegionInstanceGroupManagerStubSettings settings) {
       super(settings);
 
-      abandonInstancesRegionInstanceGroupManagerSettings = settings.abandonInstancesRegionInstanceGroupManagerSettings.toBuilder();
-      deleteRegionInstanceGroupManagerSettings = settings.deleteRegionInstanceGroupManagerSettings.toBuilder();
-      deleteInstancesRegionInstanceGroupManagerSettings = settings.deleteInstancesRegionInstanceGroupManagerSettings.toBuilder();
-      getRegionInstanceGroupManagerSettings = settings.getRegionInstanceGroupManagerSettings.toBuilder();
-      insertRegionInstanceGroupManagerSettings = settings.insertRegionInstanceGroupManagerSettings.toBuilder();
-      listRegionInstanceGroupManagersSettings = settings.listRegionInstanceGroupManagersSettings.toBuilder();
-      listManagedInstancesRegionInstanceGroupManagersSettings = settings.listManagedInstancesRegionInstanceGroupManagersSettings.toBuilder();
-      recreateInstancesRegionInstanceGroupManagerSettings = settings.recreateInstancesRegionInstanceGroupManagerSettings.toBuilder();
-      resizeRegionInstanceGroupManagerSettings = settings.resizeRegionInstanceGroupManagerSettings.toBuilder();
-      setInstanceTemplateRegionInstanceGroupManagerSettings = settings.setInstanceTemplateRegionInstanceGroupManagerSettings.toBuilder();
-      setTargetPoolsRegionInstanceGroupManagerSettings = settings.setTargetPoolsRegionInstanceGroupManagerSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          abandonInstancesRegionInstanceGroupManagerSettings,
-          deleteRegionInstanceGroupManagerSettings,
-          deleteInstancesRegionInstanceGroupManagerSettings,
-          getRegionInstanceGroupManagerSettings,
-          insertRegionInstanceGroupManagerSettings,
-          listRegionInstanceGroupManagersSettings,
-          listManagedInstancesRegionInstanceGroupManagersSettings,
-          recreateInstancesRegionInstanceGroupManagerSettings,
-          resizeRegionInstanceGroupManagerSettings,
-          setInstanceTemplateRegionInstanceGroupManagerSettings,
-          setTargetPoolsRegionInstanceGroupManagerSettings
-      );
+      abandonInstancesRegionInstanceGroupManagerSettings =
+          settings.abandonInstancesRegionInstanceGroupManagerSettings.toBuilder();
+      deleteRegionInstanceGroupManagerSettings =
+          settings.deleteRegionInstanceGroupManagerSettings.toBuilder();
+      deleteInstancesRegionInstanceGroupManagerSettings =
+          settings.deleteInstancesRegionInstanceGroupManagerSettings.toBuilder();
+      getRegionInstanceGroupManagerSettings =
+          settings.getRegionInstanceGroupManagerSettings.toBuilder();
+      insertRegionInstanceGroupManagerSettings =
+          settings.insertRegionInstanceGroupManagerSettings.toBuilder();
+      listRegionInstanceGroupManagersSettings =
+          settings.listRegionInstanceGroupManagersSettings.toBuilder();
+      listManagedInstancesRegionInstanceGroupManagersSettings =
+          settings.listManagedInstancesRegionInstanceGroupManagersSettings.toBuilder();
+      recreateInstancesRegionInstanceGroupManagerSettings =
+          settings.recreateInstancesRegionInstanceGroupManagerSettings.toBuilder();
+      resizeRegionInstanceGroupManagerSettings =
+          settings.resizeRegionInstanceGroupManagerSettings.toBuilder();
+      setInstanceTemplateRegionInstanceGroupManagerSettings =
+          settings.setInstanceTemplateRegionInstanceGroupManagerSettings.toBuilder();
+      setTargetPoolsRegionInstanceGroupManagerSettings =
+          settings.setTargetPoolsRegionInstanceGroupManagerSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              abandonInstancesRegionInstanceGroupManagerSettings,
+              deleteRegionInstanceGroupManagerSettings,
+              deleteInstancesRegionInstanceGroupManagerSettings,
+              getRegionInstanceGroupManagerSettings,
+              insertRegionInstanceGroupManagerSettings,
+              listRegionInstanceGroupManagersSettings,
+              listManagedInstancesRegionInstanceGroupManagersSettings,
+              recreateInstancesRegionInstanceGroupManagerSettings,
+              resizeRegionInstanceGroupManagerSettings,
+              setInstanceTemplateRegionInstanceGroupManagerSettings,
+              setTargetPoolsRegionInstanceGroupManagerSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -553,79 +646,94 @@ public Builder applyToAllUnaryMethods(ApiFunction abandonInstancesRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + AbandonInstancesRegionInstanceGroupManagerHttpRequest, Operation> + abandonInstancesRegionInstanceGroupManagerSettings() { return abandonInstancesRegionInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to deleteRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder deleteRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to deleteRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + deleteRegionInstanceGroupManagerSettings() { return deleteRegionInstanceGroupManagerSettings; } /** - * Returns the builder for the settings used for calls to deleteInstancesRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * deleteInstancesRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder deleteInstancesRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + DeleteInstancesRegionInstanceGroupManagerHttpRequest, Operation> + deleteInstancesRegionInstanceGroupManagerSettings() { return deleteInstancesRegionInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to getRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder getRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to getRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + getRegionInstanceGroupManagerSettings() { return getRegionInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to insertRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder insertRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to insertRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + insertRegionInstanceGroupManagerSettings() { return insertRegionInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to listRegionInstanceGroupManagers. - */ - public PagedCallSettings.Builder listRegionInstanceGroupManagersSettings() { + /** Returns the builder for the settings used for calls to listRegionInstanceGroupManagers. */ + public PagedCallSettings.Builder< + ListRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagerList, + ListRegionInstanceGroupManagersPagedResponse> + listRegionInstanceGroupManagersSettings() { return listRegionInstanceGroupManagersSettings; } /** - * Returns the builder for the settings used for calls to listManagedInstancesRegionInstanceGroupManagers. + * Returns the builder for the settings used for calls to + * listManagedInstancesRegionInstanceGroupManagers. */ - public UnaryCallSettings.Builder listManagedInstancesRegionInstanceGroupManagersSettings() { + public UnaryCallSettings.Builder< + ListManagedInstancesRegionInstanceGroupManagersHttpRequest, + RegionInstanceGroupManagersListInstancesResponse> + listManagedInstancesRegionInstanceGroupManagersSettings() { return listManagedInstancesRegionInstanceGroupManagersSettings; } /** - * Returns the builder for the settings used for calls to recreateInstancesRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * recreateInstancesRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder recreateInstancesRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + RecreateInstancesRegionInstanceGroupManagerHttpRequest, Operation> + recreateInstancesRegionInstanceGroupManagerSettings() { return recreateInstancesRegionInstanceGroupManagerSettings; } - /** - * Returns the builder for the settings used for calls to resizeRegionInstanceGroupManager. - */ - public UnaryCallSettings.Builder resizeRegionInstanceGroupManagerSettings() { + /** Returns the builder for the settings used for calls to resizeRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + resizeRegionInstanceGroupManagerSettings() { return resizeRegionInstanceGroupManagerSettings; } /** - * Returns the builder for the settings used for calls to setInstanceTemplateRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * setInstanceTemplateRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder setInstanceTemplateRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder< + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest, Operation> + setInstanceTemplateRegionInstanceGroupManagerSettings() { return setInstanceTemplateRegionInstanceGroupManagerSettings; } /** - * Returns the builder for the settings used for calls to setTargetPoolsRegionInstanceGroupManager. + * Returns the builder for the settings used for calls to + * setTargetPoolsRegionInstanceGroupManager. */ - public UnaryCallSettings.Builder setTargetPoolsRegionInstanceGroupManagerSettings() { + public UnaryCallSettings.Builder + setTargetPoolsRegionInstanceGroupManagerSettings() { return setTargetPoolsRegionInstanceGroupManagerSettings; } @@ -634,4 +742,4 @@ public RegionInstanceGroupManagerStubSettings build() throws IOException { return new RegionInstanceGroupManagerStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java index e822307d133b..50d66bbaa836 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java @@ -15,23 +15,19 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; import com.google.cloud.compute.v1.InstanceGroup; -import com.google.cloud.compute.v1.InstanceWithNamedPorts; import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectRegionInstanceGroupName; -import com.google.cloud.compute.v1.ProjectRegionName; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.RegionInstanceGroupList; import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; -import com.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; -import com.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; import javax.annotation.Generated; @@ -45,35 +41,49 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionInstanceGroupStub implements BackgroundResource { - @BetaApi - public UnaryCallable getRegionInstanceGroupCallable() { + public UnaryCallable + getRegionInstanceGroupCallable() { throw new UnsupportedOperationException("Not implemented: getRegionInstanceGroupCallable()"); } @BetaApi - public UnaryCallable listRegionInstanceGroupsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupsPagedCallable()"); + public UnaryCallable + listRegionInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionInstanceGroupsPagedCallable()"); } @BetaApi - public UnaryCallable listRegionInstanceGroupsCallable() { + public UnaryCallable + listRegionInstanceGroupsCallable() { throw new UnsupportedOperationException("Not implemented: listRegionInstanceGroupsCallable()"); } @BetaApi - public UnaryCallable listInstancesRegionInstanceGroupsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listInstancesRegionInstanceGroupsPagedCallable()"); + public UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, + ListInstancesRegionInstanceGroupsPagedResponse> + listInstancesRegionInstanceGroupsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInstancesRegionInstanceGroupsPagedCallable()"); } @BetaApi - public UnaryCallable listInstancesRegionInstanceGroupsCallable() { - throw new UnsupportedOperationException("Not implemented: listInstancesRegionInstanceGroupsCallable()"); + public UnaryCallable< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances> + listInstancesRegionInstanceGroupsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listInstancesRegionInstanceGroupsCallable()"); } @BetaApi - public UnaryCallable setNamedPortsRegionInstanceGroupCallable() { - throw new UnsupportedOperationException("Not implemented: setNamedPortsRegionInstanceGroupCallable()"); + public UnaryCallable + setNamedPortsRegionInstanceGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: setNamedPortsRegionInstanceGroupCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java index fb0dc73288a5..a38a8d1ebf51 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,15 +40,12 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.GetRegionInstanceGroupHttpRequest; import com.google.cloud.compute.v1.InstanceGroup; import com.google.cloud.compute.v1.InstanceWithNamedPorts; import com.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupsHttpRequest; import com.google.cloud.compute.v1.Operation; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; import com.google.cloud.compute.v1.RegionInstanceGroupList; import com.google.cloud.compute.v1.RegionInstanceGroupsListInstances; import com.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupHttpRequest; @@ -57,10 +53,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -71,15 +65,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getRegionInstanceGroup to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegionInstanceGroup to 30 seconds: * *

  * 
@@ -94,52 +88,58 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionInstanceGroupStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings getRegionInstanceGroupSettings;
-  private final PagedCallSettings listRegionInstanceGroupsSettings;
-  private final PagedCallSettings listInstancesRegionInstanceGroupsSettings;
-  private final UnaryCallSettings setNamedPortsRegionInstanceGroupSettings;
-
-  /**
-   * Returns the object with the settings used for calls to getRegionInstanceGroup.
-   */
-  public UnaryCallSettings getRegionInstanceGroupSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      getRegionInstanceGroupSettings;
+  private final PagedCallSettings<
+          ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList,
+          ListRegionInstanceGroupsPagedResponse>
+      listRegionInstanceGroupsSettings;
+  private final PagedCallSettings<
+          ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+          ListInstancesRegionInstanceGroupsPagedResponse>
+      listInstancesRegionInstanceGroupsSettings;
+  private final UnaryCallSettings
+      setNamedPortsRegionInstanceGroupSettings;
+
+  /** Returns the object with the settings used for calls to getRegionInstanceGroup. */
+  public UnaryCallSettings
+      getRegionInstanceGroupSettings() {
     return getRegionInstanceGroupSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionInstanceGroups.
-   */
-  public PagedCallSettings listRegionInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listRegionInstanceGroups. */
+  public PagedCallSettings<
+          ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList,
+          ListRegionInstanceGroupsPagedResponse>
+      listRegionInstanceGroupsSettings() {
     return listRegionInstanceGroupsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listInstancesRegionInstanceGroups.
-   */
-  public PagedCallSettings listInstancesRegionInstanceGroupsSettings() {
+  /** Returns the object with the settings used for calls to listInstancesRegionInstanceGroups. */
+  public PagedCallSettings<
+          ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+          ListInstancesRegionInstanceGroupsPagedResponse>
+      listInstancesRegionInstanceGroupsSettings() {
     return listInstancesRegionInstanceGroupsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setNamedPortsRegionInstanceGroup.
-   */
-  public UnaryCallSettings setNamedPortsRegionInstanceGroupSettings() {
+  /** Returns the object with the settings used for calls to setNamedPortsRegionInstanceGroup. */
+  public UnaryCallSettings
+      setNamedPortsRegionInstanceGroupSettings() {
     return setNamedPortsRegionInstanceGroupSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionInstanceGroupStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -152,47 +152,34 @@ public RegionInstanceGroupStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -203,27 +190,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionInstanceGroupStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(RegionInstanceGroupStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -233,128 +217,182 @@ protected RegionInstanceGroupStubSettings(Builder settingsBuilder) throws IOExce
 
     getRegionInstanceGroupSettings = settingsBuilder.getRegionInstanceGroupSettings().build();
     listRegionInstanceGroupsSettings = settingsBuilder.listRegionInstanceGroupsSettings().build();
-    listInstancesRegionInstanceGroupsSettings = settingsBuilder.listInstancesRegionInstanceGroupsSettings().build();
-    setNamedPortsRegionInstanceGroupSettings = settingsBuilder.setNamedPortsRegionInstanceGroupSettings().build();
+    listInstancesRegionInstanceGroupsSettings =
+        settingsBuilder.listInstancesRegionInstanceGroupsSettings().build();
+    setNamedPortsRegionInstanceGroupSettings =
+        settingsBuilder.setNamedPortsRegionInstanceGroupSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_REGION_INSTANCE_GROUPS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionInstanceGroupsHttpRequest injectToken(ListRegionInstanceGroupsHttpRequest payload, String token) {
-          return ListRegionInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionInstanceGroupsHttpRequest injectPageSize(ListRegionInstanceGroupsHttpRequest payload, int pageSize) {
-          return ListRegionInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionInstanceGroupsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RegionInstanceGroupList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RegionInstanceGroupList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListInstancesRegionInstanceGroupsHttpRequest injectToken(ListInstancesRegionInstanceGroupsHttpRequest payload, String token) {
-          return ListInstancesRegionInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListInstancesRegionInstanceGroupsHttpRequest injectPageSize(ListInstancesRegionInstanceGroupsHttpRequest payload, int pageSize) {
-          return ListInstancesRegionInstanceGroupsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListInstancesRegionInstanceGroupsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RegionInstanceGroupsListInstances payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RegionInstanceGroupsListInstances payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGION_INSTANCE_GROUPS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionInstanceGroupsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGION_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
-          return ListRegionInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListInstancesRegionInstanceGroupsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
-          return ListInstancesRegionInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionInstanceGroupStubSettings.
-   */
-  public static class Builder extends StubSettings.Builder {
+  private static final PagedListDescriptor<
+          ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, InstanceGroup>
+      LIST_REGION_INSTANCE_GROUPS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, InstanceGroup>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionInstanceGroupsHttpRequest injectToken(
+                ListRegionInstanceGroupsHttpRequest payload, String token) {
+              return ListRegionInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListRegionInstanceGroupsHttpRequest injectPageSize(
+                ListRegionInstanceGroupsHttpRequest payload, int pageSize) {
+              return ListRegionInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionInstanceGroupsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RegionInstanceGroupList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(RegionInstanceGroupList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+          InstanceWithNamedPorts>
+      LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+              InstanceWithNamedPorts>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListInstancesRegionInstanceGroupsHttpRequest injectToken(
+                ListInstancesRegionInstanceGroupsHttpRequest payload, String token) {
+              return ListInstancesRegionInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListInstancesRegionInstanceGroupsHttpRequest injectPageSize(
+                ListInstancesRegionInstanceGroupsHttpRequest payload, int pageSize) {
+              return ListInstancesRegionInstanceGroupsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListInstancesRegionInstanceGroupsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RegionInstanceGroupsListInstances payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                RegionInstanceGroupsListInstances payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList,
+          ListRegionInstanceGroupsPagedResponse>
+      LIST_REGION_INSTANCE_GROUPS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList,
+              ListRegionInstanceGroupsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                ListRegionInstanceGroupsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, InstanceGroup>
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_REGION_INSTANCE_GROUPS_PAGE_STR_DESC, request, context);
+              return ListRegionInstanceGroupsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+          ListInstancesRegionInstanceGroupsPagedResponse>
+      LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+              ListInstancesRegionInstanceGroupsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        ListInstancesRegionInstanceGroupsHttpRequest,
+                        RegionInstanceGroupsListInstances>
+                    callable,
+                ListInstancesRegionInstanceGroupsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      ListInstancesRegionInstanceGroupsHttpRequest,
+                      RegionInstanceGroupsListInstances, InstanceWithNamedPorts>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return ListInstancesRegionInstanceGroupsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionInstanceGroupStubSettings. */
+  public static class Builder
+      extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder getRegionInstanceGroupSettings;
-    private final PagedCallSettings.Builder listRegionInstanceGroupsSettings;
-    private final PagedCallSettings.Builder listInstancesRegionInstanceGroupsSettings;
-    private final UnaryCallSettings.Builder setNamedPortsRegionInstanceGroupSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        getRegionInstanceGroupSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList,
+            ListRegionInstanceGroupsPagedResponse>
+        listRegionInstanceGroupsSettings;
+    private final PagedCallSettings.Builder<
+            ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances,
+            ListInstancesRegionInstanceGroupsPagedResponse>
+        listInstancesRegionInstanceGroupsSettings;
+    private final UnaryCallSettings.Builder
+        setNamedPortsRegionInstanceGroupSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -363,15 +401,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -385,20 +424,20 @@ protected Builder(ClientContext clientContext) {
 
       getRegionInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionInstanceGroupsSettings = PagedCallSettings.newBuilder(
-          LIST_REGION_INSTANCE_GROUPS_PAGE_STR_FACT);
+      listRegionInstanceGroupsSettings =
+          PagedCallSettings.newBuilder(LIST_REGION_INSTANCE_GROUPS_PAGE_STR_FACT);
 
-      listInstancesRegionInstanceGroupsSettings = PagedCallSettings.newBuilder(
-          LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_FACT);
+      listInstancesRegionInstanceGroupsSettings =
+          PagedCallSettings.newBuilder(LIST_INSTANCES_REGION_INSTANCE_GROUPS_PAGE_STR_FACT);
 
       setNamedPortsRegionInstanceGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getRegionInstanceGroupSettings,
-          listRegionInstanceGroupsSettings,
-          listInstancesRegionInstanceGroupsSettings,
-          setNamedPortsRegionInstanceGroupSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              getRegionInstanceGroupSettings,
+              listRegionInstanceGroupsSettings,
+              listInstancesRegionInstanceGroupsSettings,
+              setNamedPortsRegionInstanceGroupSettings);
 
       initDefaults(this);
     }
@@ -414,19 +453,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.getRegionInstanceGroupSettings()
+      builder
+          .getRegionInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionInstanceGroupsSettings()
+      builder
+          .listRegionInstanceGroupsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listInstancesRegionInstanceGroupsSettings()
+      builder
+          .listInstancesRegionInstanceGroupsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setNamedPortsRegionInstanceGroupSettings()
+      builder
+          .setNamedPortsRegionInstanceGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -438,23 +481,27 @@ protected Builder(RegionInstanceGroupStubSettings settings) {
 
       getRegionInstanceGroupSettings = settings.getRegionInstanceGroupSettings.toBuilder();
       listRegionInstanceGroupsSettings = settings.listRegionInstanceGroupsSettings.toBuilder();
-      listInstancesRegionInstanceGroupsSettings = settings.listInstancesRegionInstanceGroupsSettings.toBuilder();
-      setNamedPortsRegionInstanceGroupSettings = settings.setNamedPortsRegionInstanceGroupSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getRegionInstanceGroupSettings,
-          listRegionInstanceGroupsSettings,
-          listInstancesRegionInstanceGroupsSettings,
-          setNamedPortsRegionInstanceGroupSettings
-      );
+      listInstancesRegionInstanceGroupsSettings =
+          settings.listInstancesRegionInstanceGroupsSettings.toBuilder();
+      setNamedPortsRegionInstanceGroupSettings =
+          settings.setNamedPortsRegionInstanceGroupSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              getRegionInstanceGroupSettings,
+              listRegionInstanceGroupsSettings,
+              listInstancesRegionInstanceGroupsSettings,
+              setNamedPortsRegionInstanceGroupSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -463,31 +510,31 @@ public Builder applyToAllUnaryMethods(ApiFunction getRegionInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to getRegionInstanceGroup. */ + public UnaryCallSettings.Builder + getRegionInstanceGroupSettings() { return getRegionInstanceGroupSettings; } - /** - * Returns the builder for the settings used for calls to listRegionInstanceGroups. - */ - public PagedCallSettings.Builder listRegionInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listRegionInstanceGroups. */ + public PagedCallSettings.Builder< + ListRegionInstanceGroupsHttpRequest, RegionInstanceGroupList, + ListRegionInstanceGroupsPagedResponse> + listRegionInstanceGroupsSettings() { return listRegionInstanceGroupsSettings; } - /** - * Returns the builder for the settings used for calls to listInstancesRegionInstanceGroups. - */ - public PagedCallSettings.Builder listInstancesRegionInstanceGroupsSettings() { + /** Returns the builder for the settings used for calls to listInstancesRegionInstanceGroups. */ + public PagedCallSettings.Builder< + ListInstancesRegionInstanceGroupsHttpRequest, RegionInstanceGroupsListInstances, + ListInstancesRegionInstanceGroupsPagedResponse> + listInstancesRegionInstanceGroupsSettings() { return listInstancesRegionInstanceGroupsSettings; } - /** - * Returns the builder for the settings used for calls to setNamedPortsRegionInstanceGroup. - */ - public UnaryCallSettings.Builder setNamedPortsRegionInstanceGroupSettings() { + /** Returns the builder for the settings used for calls to setNamedPortsRegionInstanceGroup. */ + public UnaryCallSettings.Builder + setNamedPortsRegionInstanceGroupSettings() { return setNamedPortsRegionInstanceGroupSettings; } @@ -496,4 +543,4 @@ public RegionInstanceGroupStubSettings build() throws IOException { return new RegionInstanceGroupStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java index 43a8d3c20ca3..0197caf06225 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,9 +25,6 @@ import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionOperationName; -import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -38,7 +37,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionOperationStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteRegionOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteRegionOperationCallable()"); @@ -50,13 +48,17 @@ public UnaryCallable getRegionOperatio } @BetaApi - public UnaryCallable listRegionOperationsPagedCallable() { + public UnaryCallable + listRegionOperationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listRegionOperationsPagedCallable()"); } @BetaApi - public UnaryCallable listRegionOperationsCallable() { + public UnaryCallable + listRegionOperationsCallable() { throw new UnsupportedOperationException("Not implemented: listRegionOperationsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java index 653ccaf19e07..e710a6dcbf47 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,21 +39,17 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteRegionOperationHttpRequest; import com.google.cloud.compute.v1.GetRegionOperationHttpRequest; import com.google.cloud.compute.v1.ListRegionOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationList; -import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -66,15 +60,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRegionOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRegionOperation to 30 seconds: * *

  * 
@@ -89,44 +83,42 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionOperationStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteRegionOperationSettings;
-  private final UnaryCallSettings getRegionOperationSettings;
-  private final PagedCallSettings listRegionOperationsSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteRegionOperation.
-   */
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteRegionOperationSettings;
+  private final UnaryCallSettings
+      getRegionOperationSettings;
+  private final PagedCallSettings<
+          ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse>
+      listRegionOperationsSettings;
+
+  /** Returns the object with the settings used for calls to deleteRegionOperation. */
   public UnaryCallSettings deleteRegionOperationSettings() {
     return deleteRegionOperationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRegionOperation.
-   */
+  /** Returns the object with the settings used for calls to getRegionOperation. */
   public UnaryCallSettings getRegionOperationSettings() {
     return getRegionOperationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegionOperations.
-   */
-  public PagedCallSettings listRegionOperationsSettings() {
+  /** Returns the object with the settings used for calls to listRegionOperations. */
+  public PagedCallSettings<
+          ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse>
+      listRegionOperationsSettings() {
     return listRegionOperationsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionOperationStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -139,47 +131,34 @@ public RegionOperationStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -190,27 +169,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionOperationStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(RegionOperationStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -223,75 +199,89 @@ protected RegionOperationStubSettings(Builder settingsBuilder) throws IOExceptio
     listRegionOperationsSettings = settingsBuilder.listRegionOperationsSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_REGION_OPERATIONS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionOperationsHttpRequest injectToken(ListRegionOperationsHttpRequest payload, String token) {
-          return ListRegionOperationsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionOperationsHttpRequest injectPageSize(ListRegionOperationsHttpRequest payload, int pageSize) {
-          return ListRegionOperationsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionOperationsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(OperationList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(OperationList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGION_OPERATIONS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionOperationsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGION_OPERATIONS_PAGE_STR_DESC, request, context);
-          return ListRegionOperationsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionOperationStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListRegionOperationsHttpRequest, OperationList, Operation>
+      LIST_REGION_OPERATIONS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionOperationsHttpRequest injectToken(
+                ListRegionOperationsHttpRequest payload, String token) {
+              return ListRegionOperationsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListRegionOperationsHttpRequest injectPageSize(
+                ListRegionOperationsHttpRequest payload, int pageSize) {
+              return ListRegionOperationsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionOperationsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(OperationList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(OperationList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse>
+      LIST_REGION_OPERATIONS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRegionOperationsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(
+                      callable, LIST_REGION_OPERATIONS_PAGE_STR_DESC, request, context);
+              return ListRegionOperationsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionOperationStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteRegionOperationSettings;
-    private final UnaryCallSettings.Builder getRegionOperationSettings;
-    private final PagedCallSettings.Builder listRegionOperationsSettings;
+    private final UnaryCallSettings.Builder
+        deleteRegionOperationSettings;
+    private final UnaryCallSettings.Builder
+        getRegionOperationSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse>
+        listRegionOperationsSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -300,15 +290,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -324,14 +315,14 @@ protected Builder(ClientContext clientContext) {
 
       getRegionOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionOperationsSettings = PagedCallSettings.newBuilder(
-          LIST_REGION_OPERATIONS_PAGE_STR_FACT);
+      listRegionOperationsSettings =
+          PagedCallSettings.newBuilder(LIST_REGION_OPERATIONS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRegionOperationSettings,
-          getRegionOperationSettings,
-          listRegionOperationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRegionOperationSettings,
+              getRegionOperationSettings,
+              listRegionOperationsSettings);
 
       initDefaults(this);
     }
@@ -347,15 +338,18 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteRegionOperationSettings()
+      builder
+          .deleteRegionOperationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRegionOperationSettings()
+      builder
+          .getRegionOperationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionOperationsSettings()
+      builder
+          .listRegionOperationsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -369,19 +363,21 @@ protected Builder(RegionOperationStubSettings settings) {
       getRegionOperationSettings = settings.getRegionOperationSettings.toBuilder();
       listRegionOperationsSettings = settings.listRegionOperationsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRegionOperationSettings,
-          getRegionOperationSettings,
-          listRegionOperationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRegionOperationSettings,
+              getRegionOperationSettings,
+              listRegionOperationsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -390,24 +386,22 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteRegionOperationSettings() { + /** Returns the builder for the settings used for calls to deleteRegionOperation. */ + public UnaryCallSettings.Builder + deleteRegionOperationSettings() { return deleteRegionOperationSettings; } - /** - * Returns the builder for the settings used for calls to getRegionOperation. - */ - public UnaryCallSettings.Builder getRegionOperationSettings() { + /** Returns the builder for the settings used for calls to getRegionOperation. */ + public UnaryCallSettings.Builder + getRegionOperationSettings() { return getRegionOperationSettings; } - /** - * Returns the builder for the settings used for calls to listRegionOperations. - */ - public PagedCallSettings.Builder listRegionOperationsSettings() { + /** Returns the builder for the settings used for calls to listRegionOperations. */ + public PagedCallSettings.Builder< + ListRegionOperationsHttpRequest, OperationList, ListRegionOperationsPagedResponse> + listRegionOperationsSettings() { return listRegionOperationsSettings; } @@ -416,4 +410,4 @@ public RegionOperationStubSettings build() throws IOException { return new RegionOperationStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java index bceb24c0281d..433199113b67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java @@ -15,15 +15,14 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.GetRegionHttpRequest; import com.google.cloud.compute.v1.ListRegionsHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.Region; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; import com.google.cloud.compute.v1.RegionList; import javax.annotation.Generated; @@ -37,14 +36,14 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionStub implements BackgroundResource { - @BetaApi public UnaryCallable getRegionCallable() { throw new UnsupportedOperationException("Not implemented: getRegionCallable()"); } @BetaApi - public UnaryCallable listRegionsPagedCallable() { + public UnaryCallable + listRegionsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listRegionsPagedCallable()"); } @@ -53,4 +52,6 @@ public UnaryCallable listRegionsCallable() { throw new UnsupportedOperationException("Not implemented: listRegionsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java index dd550bbf2e0b..216d446a37f2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,20 +39,16 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.GetRegionHttpRequest; import com.google.cloud.compute.v1.ListRegionsHttpRequest; import com.google.cloud.compute.v1.Region; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; import com.google.cloud.compute.v1.RegionList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -65,15 +59,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getRegion to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegion to 30 seconds: * *

  * 
@@ -88,36 +82,32 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RegionStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings getRegionSettings;
-  private final PagedCallSettings listRegionsSettings;
+  private final PagedCallSettings
+      listRegionsSettings;
 
-  /**
-   * Returns the object with the settings used for calls to getRegion.
-   */
+  /** Returns the object with the settings used for calls to getRegion. */
   public UnaryCallSettings getRegionSettings() {
     return getRegionSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRegions.
-   */
-  public PagedCallSettings listRegionsSettings() {
+  /** Returns the object with the settings used for calls to listRegions. */
+  public PagedCallSettings
+      listRegionsSettings() {
     return listRegionsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RegionStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -130,47 +120,34 @@ public RegionStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -182,26 +159,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RegionStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -213,74 +186,80 @@ protected RegionStubSettings(Builder settingsBuilder) throws IOException {
     listRegionsSettings = settingsBuilder.listRegionsSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_REGIONS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRegionsHttpRequest injectToken(ListRegionsHttpRequest payload, String token) {
-          return ListRegionsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRegionsHttpRequest injectPageSize(ListRegionsHttpRequest payload, int pageSize) {
-          return ListRegionsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRegionsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RegionList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RegionList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_REGIONS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRegionsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_REGIONS_PAGE_STR_DESC, request, context);
-          return ListRegionsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RegionStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_REGIONS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRegionsHttpRequest injectToken(
+                ListRegionsHttpRequest payload, String token) {
+              return ListRegionsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListRegionsHttpRequest injectPageSize(
+                ListRegionsHttpRequest payload, int pageSize) {
+              return ListRegionsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRegionsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RegionList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(RegionList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRegionsHttpRequest, RegionList, ListRegionsPagedResponse>
+      LIST_REGIONS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRegionsHttpRequest, RegionList, ListRegionsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRegionsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_REGIONS_PAGE_STR_DESC, request, context);
+              return ListRegionsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RegionStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder getRegionSettings;
-    private final PagedCallSettings.Builder listRegionsSettings;
+    private final PagedCallSettings.Builder<
+            ListRegionsHttpRequest, RegionList, ListRegionsPagedResponse>
+        listRegionsSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -289,15 +268,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -311,13 +291,10 @@ protected Builder(ClientContext clientContext) {
 
       getRegionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRegionsSettings = PagedCallSettings.newBuilder(
-          LIST_REGIONS_PAGE_STR_FACT);
+      listRegionsSettings = PagedCallSettings.newBuilder(LIST_REGIONS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getRegionSettings,
-          listRegionsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(getRegionSettings, listRegionsSettings);
 
       initDefaults(this);
     }
@@ -333,11 +310,13 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.getRegionSettings()
+      builder
+          .getRegionSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRegionsSettings()
+      builder
+          .listRegionsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -350,18 +329,18 @@ protected Builder(RegionStubSettings settings) {
       getRegionSettings = settings.getRegionSettings.toBuilder();
       listRegionsSettings = settings.listRegionsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getRegionSettings,
-          listRegionsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(getRegionSettings, listRegionsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -370,17 +349,14 @@ public Builder applyToAllUnaryMethods(ApiFunction getRegionSettings() { return getRegionSettings; } - /** - * Returns the builder for the settings used for calls to listRegions. - */ - public PagedCallSettings.Builder listRegionsSettings() { + /** Returns the builder for the settings used for calls to listRegions. */ + public PagedCallSettings.Builder + listRegionsSettings() { return listRegionsSettings; } @@ -389,4 +365,4 @@ public RegionStubSettings build() throws IOException { return new RegionStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java index 7eb6dac869fc..0b5f5f250958 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,10 +25,7 @@ import com.google.cloud.compute.v1.InsertRouteHttpRequest; import com.google.cloud.compute.v1.ListRoutesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRouteName; import com.google.cloud.compute.v1.Route; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; import com.google.cloud.compute.v1.RouteList; import javax.annotation.Generated; @@ -40,7 +39,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RouteStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteRouteCallable() { throw new UnsupportedOperationException("Not implemented: deleteRouteCallable()"); @@ -66,4 +64,6 @@ public UnaryCallable listRoutesCallable() { throw new UnsupportedOperationException("Not implemented: listRoutesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java index b084a16c2379..ef6833d46560 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,23 +39,19 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteRouteHttpRequest; import com.google.cloud.compute.v1.GetRouteHttpRequest; import com.google.cloud.compute.v1.InsertRouteHttpRequest; import com.google.cloud.compute.v1.ListRoutesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.Route; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; import com.google.cloud.compute.v1.RouteList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -68,15 +62,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRoute to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRoute to 30 seconds: * *

  * 
@@ -91,52 +85,44 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RouteStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteRouteSettings;
   private final UnaryCallSettings getRouteSettings;
   private final UnaryCallSettings insertRouteSettings;
-  private final PagedCallSettings listRoutesSettings;
+  private final PagedCallSettings
+      listRoutesSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteRoute.
-   */
+  /** Returns the object with the settings used for calls to deleteRoute. */
   public UnaryCallSettings deleteRouteSettings() {
     return deleteRouteSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRoute.
-   */
+  /** Returns the object with the settings used for calls to getRoute. */
   public UnaryCallSettings getRouteSettings() {
     return getRouteSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRoute.
-   */
+  /** Returns the object with the settings used for calls to insertRoute. */
   public UnaryCallSettings insertRouteSettings() {
     return insertRouteSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRoutes.
-   */
-  public PagedCallSettings listRoutesSettings() {
+  /** Returns the object with the settings used for calls to listRoutes. */
+  public PagedCallSettings
+      listRoutesSettings() {
     return listRoutesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RouteStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -149,47 +135,34 @@ public RouteStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -201,26 +174,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RouteStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -234,76 +203,81 @@ protected RouteStubSettings(Builder settingsBuilder) throws IOException {
     listRoutesSettings = settingsBuilder.listRoutesSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_ROUTES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRoutesHttpRequest injectToken(ListRoutesHttpRequest payload, String token) {
-          return ListRoutesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRoutesHttpRequest injectPageSize(ListRoutesHttpRequest payload, int pageSize) {
-          return ListRoutesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRoutesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RouteList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RouteList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_ROUTES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRoutesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_ROUTES_PAGE_STR_DESC, request, context);
-          return ListRoutesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RouteStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_ROUTES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRoutesHttpRequest injectToken(ListRoutesHttpRequest payload, String token) {
+              return ListRoutesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListRoutesHttpRequest injectPageSize(
+                ListRoutesHttpRequest payload, int pageSize) {
+              return ListRoutesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRoutesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RouteList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(RouteList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRoutesHttpRequest, RouteList, ListRoutesPagedResponse>
+      LIST_ROUTES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRoutesHttpRequest, RouteList, ListRoutesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRoutesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_ROUTES_PAGE_STR_DESC, request, context);
+              return ListRoutesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RouteStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder deleteRouteSettings;
     private final UnaryCallSettings.Builder getRouteSettings;
     private final UnaryCallSettings.Builder insertRouteSettings;
-    private final PagedCallSettings.Builder listRoutesSettings;
+    private final PagedCallSettings.Builder<
+            ListRoutesHttpRequest, RouteList, ListRoutesPagedResponse>
+        listRoutesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -312,15 +286,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -338,15 +313,11 @@ protected Builder(ClientContext clientContext) {
 
       insertRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRoutesSettings = PagedCallSettings.newBuilder(
-          LIST_ROUTES_PAGE_STR_FACT);
+      listRoutesSettings = PagedCallSettings.newBuilder(LIST_ROUTES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRouteSettings,
-          getRouteSettings,
-          insertRouteSettings,
-          listRoutesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRouteSettings, getRouteSettings, insertRouteSettings, listRoutesSettings);
 
       initDefaults(this);
     }
@@ -362,19 +333,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteRouteSettings()
+      builder
+          .deleteRouteSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRouteSettings()
+      builder
+          .getRouteSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertRouteSettings()
+      builder
+          .insertRouteSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRoutesSettings()
+      builder
+          .listRoutesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -389,20 +364,19 @@ protected Builder(RouteStubSettings settings) {
       insertRouteSettings = settings.insertRouteSettings.toBuilder();
       listRoutesSettings = settings.listRoutesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteRouteSettings,
-          getRouteSettings,
-          insertRouteSettings,
-          listRoutesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteRouteSettings, getRouteSettings, insertRouteSettings, listRoutesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -411,31 +385,24 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteRouteSettings() { return deleteRouteSettings; } - /** - * Returns the builder for the settings used for calls to getRoute. - */ + /** Returns the builder for the settings used for calls to getRoute. */ public UnaryCallSettings.Builder getRouteSettings() { return getRouteSettings; } - /** - * Returns the builder for the settings used for calls to insertRoute. - */ + /** Returns the builder for the settings used for calls to insertRoute. */ public UnaryCallSettings.Builder insertRouteSettings() { return insertRouteSettings; } - /** - * Returns the builder for the settings used for calls to listRoutes. - */ - public PagedCallSettings.Builder listRoutesSettings() { + /** Returns the builder for the settings used for calls to listRoutes. */ + public PagedCallSettings.Builder + listRoutesSettings() { return listRoutesSettings; } @@ -444,4 +411,4 @@ public RouteStubSettings build() throws IOException { return new RouteStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java index b70ce7006cfe..c3f3d67a7401 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -27,17 +30,11 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchRouterHttpRequest; import com.google.cloud.compute.v1.PreviewRouterHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionRouterName; import com.google.cloud.compute.v1.Router; import com.google.cloud.compute.v1.RouterAggregatedList; -import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; -import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.cloud.compute.v1.RouterList; import com.google.cloud.compute.v1.RouterStatusResponse; import com.google.cloud.compute.v1.RoutersPreviewResponse; -import com.google.cloud.compute.v1.RoutersScopedList; import com.google.cloud.compute.v1.UpdateRouterHttpRequest; import javax.annotation.Generated; @@ -51,14 +48,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RouterStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListRoutersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListRoutersPagedCallable()"); + public UnaryCallable + aggregatedListRoutersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListRoutersPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListRoutersCallable() { + public UnaryCallable + aggregatedListRoutersCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListRoutersCallable()"); } @@ -73,7 +72,8 @@ public UnaryCallable getRouterCallable() { } @BetaApi - public UnaryCallable getRouterStatusRouterCallable() { + public UnaryCallable + getRouterStatusRouterCallable() { throw new UnsupportedOperationException("Not implemented: getRouterStatusRouterCallable()"); } @@ -83,7 +83,8 @@ public UnaryCallable insertRouterCallable() } @BetaApi - public UnaryCallable listRoutersPagedCallable() { + public UnaryCallable + listRoutersPagedCallable() { throw new UnsupportedOperationException("Not implemented: listRoutersPagedCallable()"); } @@ -107,4 +108,6 @@ public UnaryCallable updateRouterCallable() throw new UnsupportedOperationException("Not implemented: updateRouterCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java index 44df81a455d9..e1fa5228a0b6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; import com.google.cloud.compute.v1.DeleteRouterHttpRequest; import com.google.cloud.compute.v1.GetRouterHttpRequest; @@ -53,8 +51,6 @@ import com.google.cloud.compute.v1.PreviewRouterHttpRequest; import com.google.cloud.compute.v1.Router; import com.google.cloud.compute.v1.RouterAggregatedList; -import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; -import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.cloud.compute.v1.RouterList; import com.google.cloud.compute.v1.RouterStatusResponse; import com.google.cloud.compute.v1.RoutersPreviewResponse; @@ -64,10 +60,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -78,15 +72,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteRouter to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteRouter to 30 seconds: * *

  * 
@@ -101,92 +95,84 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class RouterStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListRoutersSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList,
+          AggregatedListRoutersPagedResponse>
+      aggregatedListRoutersSettings;
   private final UnaryCallSettings deleteRouterSettings;
   private final UnaryCallSettings getRouterSettings;
-  private final UnaryCallSettings getRouterStatusRouterSettings;
+  private final UnaryCallSettings
+      getRouterStatusRouterSettings;
   private final UnaryCallSettings insertRouterSettings;
-  private final PagedCallSettings listRoutersSettings;
+  private final PagedCallSettings
+      listRoutersSettings;
   private final UnaryCallSettings patchRouterSettings;
-  private final UnaryCallSettings previewRouterSettings;
+  private final UnaryCallSettings
+      previewRouterSettings;
   private final UnaryCallSettings updateRouterSettings;
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListRouters.
-   */
-  public PagedCallSettings aggregatedListRoutersSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListRouters. */
+  public PagedCallSettings<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList,
+          AggregatedListRoutersPagedResponse>
+      aggregatedListRoutersSettings() {
     return aggregatedListRoutersSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteRouter.
-   */
+  /** Returns the object with the settings used for calls to deleteRouter. */
   public UnaryCallSettings deleteRouterSettings() {
     return deleteRouterSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRouter.
-   */
+  /** Returns the object with the settings used for calls to getRouter. */
   public UnaryCallSettings getRouterSettings() {
     return getRouterSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getRouterStatusRouter.
-   */
-  public UnaryCallSettings getRouterStatusRouterSettings() {
+  /** Returns the object with the settings used for calls to getRouterStatusRouter. */
+  public UnaryCallSettings
+      getRouterStatusRouterSettings() {
     return getRouterStatusRouterSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertRouter.
-   */
+  /** Returns the object with the settings used for calls to insertRouter. */
   public UnaryCallSettings insertRouterSettings() {
     return insertRouterSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listRouters.
-   */
-  public PagedCallSettings listRoutersSettings() {
+  /** Returns the object with the settings used for calls to listRouters. */
+  public PagedCallSettings
+      listRoutersSettings() {
     return listRoutersSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchRouter.
-   */
+  /** Returns the object with the settings used for calls to patchRouter. */
   public UnaryCallSettings patchRouterSettings() {
     return patchRouterSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to previewRouter.
-   */
-  public UnaryCallSettings previewRouterSettings() {
+  /** Returns the object with the settings used for calls to previewRouter. */
+  public UnaryCallSettings
+      previewRouterSettings() {
     return previewRouterSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateRouter.
-   */
+  /** Returns the object with the settings used for calls to updateRouter. */
   public UnaryCallSettings updateRouterSettings() {
     return updateRouterSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public RouterStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -199,47 +185,34 @@ public RouterStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -251,26 +224,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RouterStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -289,129 +258,158 @@ protected RouterStubSettings(Builder settingsBuilder) throws IOException {
     updateRouterSettings = settingsBuilder.updateRouterSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_ROUTERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListRoutersHttpRequest injectToken(AggregatedListRoutersHttpRequest payload, String token) {
-          return AggregatedListRoutersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListRoutersHttpRequest injectPageSize(AggregatedListRoutersHttpRequest payload, int pageSize) {
-          return AggregatedListRoutersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListRoutersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RouterAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RouterAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_ROUTERS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListRoutersHttpRequest injectToken(ListRoutersHttpRequest payload, String token) {
-          return ListRoutersHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListRoutersHttpRequest injectPageSize(ListRoutersHttpRequest payload, int pageSize) {
-          return ListRoutersHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListRoutersHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(RouterList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(RouterList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_ROUTERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListRoutersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_ROUTERS_PAGE_STR_DESC, request, context);
-          return AggregatedListRoutersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_ROUTERS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListRoutersHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_ROUTERS_PAGE_STR_DESC, request, context);
-          return ListRoutersPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for RouterStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList, RoutersScopedList>
+      AGGREGATED_LIST_ROUTERS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListRoutersHttpRequest, RouterAggregatedList, RoutersScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListRoutersHttpRequest injectToken(
+                AggregatedListRoutersHttpRequest payload, String token) {
+              return AggregatedListRoutersHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListRoutersHttpRequest injectPageSize(
+                AggregatedListRoutersHttpRequest payload, int pageSize) {
+              return AggregatedListRoutersHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListRoutersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RouterAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(RouterAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_ROUTERS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListRoutersHttpRequest injectToken(
+                ListRoutersHttpRequest payload, String token) {
+              return ListRoutersHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListRoutersHttpRequest injectPageSize(
+                ListRoutersHttpRequest payload, int pageSize) {
+              return ListRoutersHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListRoutersHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(RouterList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(RouterList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListRoutersHttpRequest, RouterAggregatedList,
+          AggregatedListRoutersPagedResponse>
+      AGGREGATED_LIST_ROUTERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListRoutersHttpRequest, RouterAggregatedList,
+              AggregatedListRoutersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                AggregatedListRoutersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_ROUTERS_PAGE_STR_DESC, request, context);
+              return AggregatedListRoutersPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListRoutersHttpRequest, RouterList, ListRoutersPagedResponse>
+      LIST_ROUTERS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListRoutersHttpRequest, RouterList, ListRoutersPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListRoutersHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_ROUTERS_PAGE_STR_DESC, request, context);
+              return ListRoutersPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for RouterStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListRoutersSettings;
-    private final UnaryCallSettings.Builder deleteRouterSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListRoutersHttpRequest, RouterAggregatedList,
+            AggregatedListRoutersPagedResponse>
+        aggregatedListRoutersSettings;
+    private final UnaryCallSettings.Builder
+        deleteRouterSettings;
     private final UnaryCallSettings.Builder getRouterSettings;
-    private final UnaryCallSettings.Builder getRouterStatusRouterSettings;
-    private final UnaryCallSettings.Builder insertRouterSettings;
-    private final PagedCallSettings.Builder listRoutersSettings;
+    private final UnaryCallSettings.Builder
+        getRouterStatusRouterSettings;
+    private final UnaryCallSettings.Builder
+        insertRouterSettings;
+    private final PagedCallSettings.Builder<
+            ListRoutersHttpRequest, RouterList, ListRoutersPagedResponse>
+        listRoutersSettings;
     private final UnaryCallSettings.Builder patchRouterSettings;
-    private final UnaryCallSettings.Builder previewRouterSettings;
-    private final UnaryCallSettings.Builder updateRouterSettings;
+    private final UnaryCallSettings.Builder
+        previewRouterSettings;
+    private final UnaryCallSettings.Builder
+        updateRouterSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -420,15 +418,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -440,8 +439,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListRoutersSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_ROUTERS_PAGE_STR_FACT);
+      aggregatedListRoutersSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_ROUTERS_PAGE_STR_FACT);
 
       deleteRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -451,8 +450,7 @@ protected Builder(ClientContext clientContext) {
 
       insertRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listRoutersSettings = PagedCallSettings.newBuilder(
-          LIST_ROUTERS_PAGE_STR_FACT);
+      listRoutersSettings = PagedCallSettings.newBuilder(LIST_ROUTERS_PAGE_STR_FACT);
 
       patchRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -460,17 +458,17 @@ protected Builder(ClientContext clientContext) {
 
       updateRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListRoutersSettings,
-          deleteRouterSettings,
-          getRouterSettings,
-          getRouterStatusRouterSettings,
-          insertRouterSettings,
-          listRoutersSettings,
-          patchRouterSettings,
-          previewRouterSettings,
-          updateRouterSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListRoutersSettings,
+              deleteRouterSettings,
+              getRouterSettings,
+              getRouterStatusRouterSettings,
+              insertRouterSettings,
+              listRoutersSettings,
+              patchRouterSettings,
+              previewRouterSettings,
+              updateRouterSettings);
 
       initDefaults(this);
     }
@@ -486,39 +484,48 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListRoutersSettings()
+      builder
+          .aggregatedListRoutersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteRouterSettings()
+      builder
+          .deleteRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRouterSettings()
+      builder
+          .getRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getRouterStatusRouterSettings()
+      builder
+          .getRouterStatusRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertRouterSettings()
+      builder
+          .insertRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listRoutersSettings()
+      builder
+          .listRoutersSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchRouterSettings()
+      builder
+          .patchRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.previewRouterSettings()
+      builder
+          .previewRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateRouterSettings()
+      builder
+          .updateRouterSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -538,25 +545,27 @@ protected Builder(RouterStubSettings settings) {
       previewRouterSettings = settings.previewRouterSettings.toBuilder();
       updateRouterSettings = settings.updateRouterSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListRoutersSettings,
-          deleteRouterSettings,
-          getRouterSettings,
-          getRouterStatusRouterSettings,
-          insertRouterSettings,
-          listRoutersSettings,
-          patchRouterSettings,
-          previewRouterSettings,
-          updateRouterSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListRoutersSettings,
+              deleteRouterSettings,
+              getRouterSettings,
+              getRouterStatusRouterSettings,
+              insertRouterSettings,
+              listRoutersSettings,
+              patchRouterSettings,
+              previewRouterSettings,
+              updateRouterSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -565,65 +574,53 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListRoutersSettings() { + /** Returns the builder for the settings used for calls to aggregatedListRouters. */ + public PagedCallSettings.Builder< + AggregatedListRoutersHttpRequest, RouterAggregatedList, + AggregatedListRoutersPagedResponse> + aggregatedListRoutersSettings() { return aggregatedListRoutersSettings; } - /** - * Returns the builder for the settings used for calls to deleteRouter. - */ + /** Returns the builder for the settings used for calls to deleteRouter. */ public UnaryCallSettings.Builder deleteRouterSettings() { return deleteRouterSettings; } - /** - * Returns the builder for the settings used for calls to getRouter. - */ + /** Returns the builder for the settings used for calls to getRouter. */ public UnaryCallSettings.Builder getRouterSettings() { return getRouterSettings; } - /** - * Returns the builder for the settings used for calls to getRouterStatusRouter. - */ - public UnaryCallSettings.Builder getRouterStatusRouterSettings() { + /** Returns the builder for the settings used for calls to getRouterStatusRouter. */ + public UnaryCallSettings.Builder + getRouterStatusRouterSettings() { return getRouterStatusRouterSettings; } - /** - * Returns the builder for the settings used for calls to insertRouter. - */ + /** Returns the builder for the settings used for calls to insertRouter. */ public UnaryCallSettings.Builder insertRouterSettings() { return insertRouterSettings; } - /** - * Returns the builder for the settings used for calls to listRouters. - */ - public PagedCallSettings.Builder listRoutersSettings() { + /** Returns the builder for the settings used for calls to listRouters. */ + public PagedCallSettings.Builder + listRoutersSettings() { return listRoutersSettings; } - /** - * Returns the builder for the settings used for calls to patchRouter. - */ + /** Returns the builder for the settings used for calls to patchRouter. */ public UnaryCallSettings.Builder patchRouterSettings() { return patchRouterSettings; } - /** - * Returns the builder for the settings used for calls to previewRouter. - */ - public UnaryCallSettings.Builder previewRouterSettings() { + /** Returns the builder for the settings used for calls to previewRouter. */ + public UnaryCallSettings.Builder + previewRouterSettings() { return previewRouterSettings; } - /** - * Returns the builder for the settings used for calls to updateRouter. - */ + /** Returns the builder for the settings used for calls to updateRouter. */ public UnaryCallSettings.Builder updateRouterSettings() { return updateRouterSettings; } @@ -633,4 +630,4 @@ public RouterStubSettings build() throws IOException { return new RouterStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java index 3d2b0c65080a..ebb727988391 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java @@ -15,19 +15,17 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; -import com.google.cloud.compute.v1.GlobalSetLabelsRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSnapshotName; import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; import javax.annotation.Generated; @@ -41,7 +39,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SnapshotStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteSnapshotCallable() { throw new UnsupportedOperationException("Not implemented: deleteSnapshotCallable()"); @@ -53,7 +50,8 @@ public UnaryCallable getSnapshotCallable() { } @BetaApi - public UnaryCallable listSnapshotsPagedCallable() { + public UnaryCallable + listSnapshotsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listSnapshotsPagedCallable()"); } @@ -67,4 +65,6 @@ public UnaryCallable setLabelsSnapshotC throw new UnsupportedOperationException("Not implemented: setLabelsSnapshotCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java index 3fe0a5cfc5c0..b7d5fa8bd65e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,23 +39,19 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import com.google.cloud.compute.v1.SnapshotList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -68,15 +62,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSnapshot to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSnapshot to 30 seconds: * *

  * 
@@ -91,52 +85,46 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SnapshotStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteSnapshotSettings;
   private final UnaryCallSettings getSnapshotSettings;
-  private final PagedCallSettings listSnapshotsSettings;
-  private final UnaryCallSettings setLabelsSnapshotSettings;
+  private final PagedCallSettings<
+          ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
+      listSnapshotsSettings;
+  private final UnaryCallSettings
+      setLabelsSnapshotSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteSnapshot.
-   */
+  /** Returns the object with the settings used for calls to deleteSnapshot. */
   public UnaryCallSettings deleteSnapshotSettings() {
     return deleteSnapshotSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSnapshot.
-   */
+  /** Returns the object with the settings used for calls to getSnapshot. */
   public UnaryCallSettings getSnapshotSettings() {
     return getSnapshotSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSnapshots.
-   */
-  public PagedCallSettings listSnapshotsSettings() {
+  /** Returns the object with the settings used for calls to listSnapshots. */
+  public PagedCallSettings
+      listSnapshotsSettings() {
     return listSnapshotsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setLabelsSnapshot.
-   */
+  /** Returns the object with the settings used for calls to setLabelsSnapshot. */
   public UnaryCallSettings setLabelsSnapshotSettings() {
     return setLabelsSnapshotSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public SnapshotStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -149,47 +137,34 @@ public SnapshotStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -201,26 +176,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SnapshotStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -234,76 +205,84 @@ protected SnapshotStubSettings(Builder settingsBuilder) throws IOException {
     setLabelsSnapshotSettings = settingsBuilder.setLabelsSnapshotSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_SNAPSHOTS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListSnapshotsHttpRequest injectToken(ListSnapshotsHttpRequest payload, String token) {
-          return ListSnapshotsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListSnapshotsHttpRequest injectPageSize(ListSnapshotsHttpRequest payload, int pageSize) {
-          return ListSnapshotsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListSnapshotsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(SnapshotList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(SnapshotList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_SNAPSHOTS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListSnapshotsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context);
-          return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for SnapshotStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_SNAPSHOTS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListSnapshotsHttpRequest injectToken(
+                ListSnapshotsHttpRequest payload, String token) {
+              return ListSnapshotsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListSnapshotsHttpRequest injectPageSize(
+                ListSnapshotsHttpRequest payload, int pageSize) {
+              return ListSnapshotsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListSnapshotsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(SnapshotList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(SnapshotList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
+      LIST_SNAPSHOTS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListSnapshotsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context);
+              return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for SnapshotStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteSnapshotSettings;
+    private final UnaryCallSettings.Builder
+        deleteSnapshotSettings;
     private final UnaryCallSettings.Builder getSnapshotSettings;
-    private final PagedCallSettings.Builder listSnapshotsSettings;
-    private final UnaryCallSettings.Builder setLabelsSnapshotSettings;
+    private final PagedCallSettings.Builder<
+            ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse>
+        listSnapshotsSettings;
+    private final UnaryCallSettings.Builder
+        setLabelsSnapshotSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -312,15 +291,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -336,17 +316,16 @@ protected Builder(ClientContext clientContext) {
 
       getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listSnapshotsSettings = PagedCallSettings.newBuilder(
-          LIST_SNAPSHOTS_PAGE_STR_FACT);
+      listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT);
 
       setLabelsSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteSnapshotSettings,
-          getSnapshotSettings,
-          listSnapshotsSettings,
-          setLabelsSnapshotSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteSnapshotSettings,
+              getSnapshotSettings,
+              listSnapshotsSettings,
+              setLabelsSnapshotSettings);
 
       initDefaults(this);
     }
@@ -362,19 +341,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteSnapshotSettings()
+      builder
+          .deleteSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getSnapshotSettings()
+      builder
+          .getSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listSnapshotsSettings()
+      builder
+          .listSnapshotsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setLabelsSnapshotSettings()
+      builder
+          .setLabelsSnapshotSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -389,20 +372,22 @@ protected Builder(SnapshotStubSettings settings) {
       listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder();
       setLabelsSnapshotSettings = settings.setLabelsSnapshotSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteSnapshotSettings,
-          getSnapshotSettings,
-          listSnapshotsSettings,
-          setLabelsSnapshotSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteSnapshotSettings,
+              getSnapshotSettings,
+              listSnapshotsSettings,
+              setLabelsSnapshotSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -411,31 +396,27 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteSnapshotSettings() { + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder + deleteSnapshotSettings() { return deleteSnapshotSettings; } - /** - * Returns the builder for the settings used for calls to getSnapshot. - */ + /** Returns the builder for the settings used for calls to getSnapshot. */ public UnaryCallSettings.Builder getSnapshotSettings() { return getSnapshotSettings; } - /** - * Returns the builder for the settings used for calls to listSnapshots. - */ - public PagedCallSettings.Builder listSnapshotsSettings() { + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> + listSnapshotsSettings() { return listSnapshotsSettings; } - /** - * Returns the builder for the settings used for calls to setLabelsSnapshot. - */ - public UnaryCallSettings.Builder setLabelsSnapshotSettings() { + /** Returns the builder for the settings used for calls to setLabelsSnapshot. */ + public UnaryCallSettings.Builder + setLabelsSnapshotSettings() { return setLabelsSnapshotSettings; } @@ -444,4 +425,4 @@ public SnapshotStubSettings build() throws IOException { return new SnapshotStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java index dd92d3a2b6f6..e455da45c9d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,10 +25,7 @@ import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectSslCertificateName; import com.google.cloud.compute.v1.SslCertificate; -import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; import com.google.cloud.compute.v1.SslCertificateList; import javax.annotation.Generated; @@ -40,7 +39,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SslCertificateStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteSslCertificateCallable() { throw new UnsupportedOperationException("Not implemented: deleteSslCertificateCallable()"); @@ -57,13 +55,17 @@ public UnaryCallable insertSslCertif } @BetaApi - public UnaryCallable listSslCertificatesPagedCallable() { + public UnaryCallable + listSslCertificatesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listSslCertificatesPagedCallable()"); } @BetaApi - public UnaryCallable listSslCertificatesCallable() { + public UnaryCallable + listSslCertificatesCallable() { throw new UnsupportedOperationException("Not implemented: listSslCertificatesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java index a8e89c98f652..f22a9755cb46 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,23 +39,19 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteSslCertificateHttpRequest; import com.google.cloud.compute.v1.GetSslCertificateHttpRequest; import com.google.cloud.compute.v1.InsertSslCertificateHttpRequest; import com.google.cloud.compute.v1.ListSslCertificatesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.SslCertificate; -import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; import com.google.cloud.compute.v1.SslCertificateList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -68,15 +62,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSslCertificate to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSslCertificate to 30 seconds: * *

  * 
@@ -91,52 +85,52 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SslCertificateStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteSslCertificateSettings;
-  private final UnaryCallSettings getSslCertificateSettings;
-  private final UnaryCallSettings insertSslCertificateSettings;
-  private final PagedCallSettings listSslCertificatesSettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteSslCertificate.
-   */
-  public UnaryCallSettings deleteSslCertificateSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteSslCertificateSettings;
+  private final UnaryCallSettings
+      getSslCertificateSettings;
+  private final UnaryCallSettings
+      insertSslCertificateSettings;
+  private final PagedCallSettings<
+          ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse>
+      listSslCertificatesSettings;
+
+  /** Returns the object with the settings used for calls to deleteSslCertificate. */
+  public UnaryCallSettings
+      deleteSslCertificateSettings() {
     return deleteSslCertificateSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSslCertificate.
-   */
-  public UnaryCallSettings getSslCertificateSettings() {
+  /** Returns the object with the settings used for calls to getSslCertificate. */
+  public UnaryCallSettings
+      getSslCertificateSettings() {
     return getSslCertificateSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertSslCertificate.
-   */
-  public UnaryCallSettings insertSslCertificateSettings() {
+  /** Returns the object with the settings used for calls to insertSslCertificate. */
+  public UnaryCallSettings
+      insertSslCertificateSettings() {
     return insertSslCertificateSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSslCertificates.
-   */
-  public PagedCallSettings listSslCertificatesSettings() {
+  /** Returns the object with the settings used for calls to listSslCertificates. */
+  public PagedCallSettings<
+          ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse>
+      listSslCertificatesSettings() {
     return listSslCertificatesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public SslCertificateStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -149,47 +143,34 @@ public SslCertificateStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -200,27 +181,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SslCertificateStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(SslCertificateStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -234,76 +212,92 @@ protected SslCertificateStubSettings(Builder settingsBuilder) throws IOException
     listSslCertificatesSettings = settingsBuilder.listSslCertificatesSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_SSL_CERTIFICATES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListSslCertificatesHttpRequest injectToken(ListSslCertificatesHttpRequest payload, String token) {
-          return ListSslCertificatesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListSslCertificatesHttpRequest injectPageSize(ListSslCertificatesHttpRequest payload, int pageSize) {
-          return ListSslCertificatesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListSslCertificatesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(SslCertificateList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(SslCertificateList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_SSL_CERTIFICATES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListSslCertificatesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_SSL_CERTIFICATES_PAGE_STR_DESC, request, context);
-          return ListSslCertificatesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for SslCertificateStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListSslCertificatesHttpRequest, SslCertificateList, SslCertificate>
+      LIST_SSL_CERTIFICATES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListSslCertificatesHttpRequest, SslCertificateList, SslCertificate>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListSslCertificatesHttpRequest injectToken(
+                ListSslCertificatesHttpRequest payload, String token) {
+              return ListSslCertificatesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListSslCertificatesHttpRequest injectPageSize(
+                ListSslCertificatesHttpRequest payload, int pageSize) {
+              return ListSslCertificatesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListSslCertificatesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(SslCertificateList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(SslCertificateList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse>
+      LIST_SSL_CERTIFICATES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListSslCertificatesHttpRequest, SslCertificateList,
+              ListSslCertificatesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListSslCertificatesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_SSL_CERTIFICATES_PAGE_STR_DESC, request, context);
+              return ListSslCertificatesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for SslCertificateStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteSslCertificateSettings;
-    private final UnaryCallSettings.Builder getSslCertificateSettings;
-    private final UnaryCallSettings.Builder insertSslCertificateSettings;
-    private final PagedCallSettings.Builder listSslCertificatesSettings;
+    private final UnaryCallSettings.Builder
+        deleteSslCertificateSettings;
+    private final UnaryCallSettings.Builder
+        getSslCertificateSettings;
+    private final UnaryCallSettings.Builder
+        insertSslCertificateSettings;
+    private final PagedCallSettings.Builder<
+            ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse>
+        listSslCertificatesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -312,15 +306,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -338,15 +333,15 @@ protected Builder(ClientContext clientContext) {
 
       insertSslCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listSslCertificatesSettings = PagedCallSettings.newBuilder(
-          LIST_SSL_CERTIFICATES_PAGE_STR_FACT);
+      listSslCertificatesSettings =
+          PagedCallSettings.newBuilder(LIST_SSL_CERTIFICATES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteSslCertificateSettings,
-          getSslCertificateSettings,
-          insertSslCertificateSettings,
-          listSslCertificatesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteSslCertificateSettings,
+              getSslCertificateSettings,
+              insertSslCertificateSettings,
+              listSslCertificatesSettings);
 
       initDefaults(this);
     }
@@ -362,19 +357,23 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteSslCertificateSettings()
+      builder
+          .deleteSslCertificateSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getSslCertificateSettings()
+      builder
+          .getSslCertificateSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertSslCertificateSettings()
+      builder
+          .insertSslCertificateSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listSslCertificatesSettings()
+      builder
+          .listSslCertificatesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -389,20 +388,22 @@ protected Builder(SslCertificateStubSettings settings) {
       insertSslCertificateSettings = settings.insertSslCertificateSettings.toBuilder();
       listSslCertificatesSettings = settings.listSslCertificatesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteSslCertificateSettings,
-          getSslCertificateSettings,
-          insertSslCertificateSettings,
-          listSslCertificatesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteSslCertificateSettings,
+              getSslCertificateSettings,
+              insertSslCertificateSettings,
+              listSslCertificatesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -411,31 +412,28 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteSslCertificateSettings() { + /** Returns the builder for the settings used for calls to deleteSslCertificate. */ + public UnaryCallSettings.Builder + deleteSslCertificateSettings() { return deleteSslCertificateSettings; } - /** - * Returns the builder for the settings used for calls to getSslCertificate. - */ - public UnaryCallSettings.Builder getSslCertificateSettings() { + /** Returns the builder for the settings used for calls to getSslCertificate. */ + public UnaryCallSettings.Builder + getSslCertificateSettings() { return getSslCertificateSettings; } - /** - * Returns the builder for the settings used for calls to insertSslCertificate. - */ - public UnaryCallSettings.Builder insertSslCertificateSettings() { + /** Returns the builder for the settings used for calls to insertSslCertificate. */ + public UnaryCallSettings.Builder + insertSslCertificateSettings() { return insertSslCertificateSettings; } - /** - * Returns the builder for the settings used for calls to listSslCertificates. - */ - public PagedCallSettings.Builder listSslCertificatesSettings() { + /** Returns the builder for the settings used for calls to listSslCertificates. */ + public PagedCallSettings.Builder< + ListSslCertificatesHttpRequest, SslCertificateList, ListSslCertificatesPagedResponse> + listSslCertificatesSettings() { return listSslCertificatesSettings; } @@ -444,4 +442,4 @@ public SslCertificateStubSettings build() throws IOException { return new SslCertificateStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java new file mode 100644 index 000000000000..b3d1ccec085a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java @@ -0,0 +1,86 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.SslPolicyClient.ListSslPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteSslPolicyHttpRequest; +import com.google.cloud.compute.v1.GetSslPolicyHttpRequest; +import com.google.cloud.compute.v1.InsertSslPolicyHttpRequest; +import com.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesHttpRequest; +import com.google.cloud.compute.v1.ListSslPoliciesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSslPolicyHttpRequest; +import com.google.cloud.compute.v1.SslPoliciesList; +import com.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; +import com.google.cloud.compute.v1.SslPolicy; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by GAPIC v0.0.5") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SslPolicyStub implements BackgroundResource { + + @BetaApi + public UnaryCallable deleteSslPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSslPolicyCallable()"); + } + + @BetaApi + public UnaryCallable getSslPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getSslPolicyCallable()"); + } + + @BetaApi + public UnaryCallable insertSslPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: insertSslPolicyCallable()"); + } + + @BetaApi + public UnaryCallable + listSslPoliciesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSslPoliciesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listSslPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listSslPoliciesCallable()"); + } + + @BetaApi + public UnaryCallable< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAvailableFeaturesSslPoliciesCallable()"); + } + + @BetaApi + public UnaryCallable patchSslPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: patchSslPolicyCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java new file mode 100644 index 000000000000..abd0391c242b --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java @@ -0,0 +1,490 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.SslPolicyClient.ListSslPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DeleteSslPolicyHttpRequest; +import com.google.cloud.compute.v1.GetSslPolicyHttpRequest; +import com.google.cloud.compute.v1.InsertSslPolicyHttpRequest; +import com.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesHttpRequest; +import com.google.cloud.compute.v1.ListSslPoliciesHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchSslPolicyHttpRequest; +import com.google.cloud.compute.v1.SslPoliciesList; +import com.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; +import com.google.cloud.compute.v1.SslPolicy; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SslPolicyStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSslPolicy to 30 seconds: + * + *

+ * 
+ * SslPolicyStubSettings.Builder sslPolicySettingsBuilder =
+ *     SslPolicyStubSettings.newBuilder();
+ * sslPolicySettingsBuilder.deleteSslPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SslPolicyStubSettings sslPolicySettings = sslPolicySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by GAPIC v0.0.5") +@BetaApi +public class SslPolicyStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteSslPolicySettings; + private final UnaryCallSettings getSslPolicySettings; + private final UnaryCallSettings insertSslPolicySettings; + private final PagedCallSettings< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + listSslPoliciesSettings; + private final UnaryCallSettings< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesSettings; + private final UnaryCallSettings patchSslPolicySettings; + + /** Returns the object with the settings used for calls to deleteSslPolicy. */ + public UnaryCallSettings deleteSslPolicySettings() { + return deleteSslPolicySettings; + } + + /** Returns the object with the settings used for calls to getSslPolicy. */ + public UnaryCallSettings getSslPolicySettings() { + return getSslPolicySettings; + } + + /** Returns the object with the settings used for calls to insertSslPolicy. */ + public UnaryCallSettings insertSslPolicySettings() { + return insertSslPolicySettings; + } + + /** Returns the object with the settings used for calls to listSslPolicies. */ + public PagedCallSettings< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + listSslPoliciesSettings() { + return listSslPoliciesSettings; + } + + /** Returns the object with the settings used for calls to listAvailableFeaturesSslPolicies. */ + public UnaryCallSettings< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesSettings() { + return listAvailableFeaturesSslPoliciesSettings; + } + + /** Returns the object with the settings used for calls to patchSslPolicy. */ + public UnaryCallSettings patchSslPolicySettings() { + return patchSslPolicySettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SslPolicyStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSslPolicyStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SslPolicyStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SslPolicyStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSslPolicySettings = settingsBuilder.deleteSslPolicySettings().build(); + getSslPolicySettings = settingsBuilder.getSslPolicySettings().build(); + insertSslPolicySettings = settingsBuilder.insertSslPolicySettings().build(); + listSslPoliciesSettings = settingsBuilder.listSslPoliciesSettings().build(); + listAvailableFeaturesSslPoliciesSettings = + settingsBuilder.listAvailableFeaturesSslPoliciesSettings().build(); + patchSslPolicySettings = settingsBuilder.patchSslPolicySettings().build(); + } + + private static final PagedListDescriptor + LIST_SSL_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSslPoliciesHttpRequest injectToken( + ListSslPoliciesHttpRequest payload, String token) { + return ListSslPoliciesHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSslPoliciesHttpRequest injectPageSize( + ListSslPoliciesHttpRequest payload, int pageSize) { + return ListSslPoliciesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSslPoliciesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(SslPoliciesList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SslPoliciesList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + LIST_SSL_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSslPoliciesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SSL_POLICIES_PAGE_STR_DESC, request, context); + return ListSslPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for SslPolicyStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + deleteSslPolicySettings; + private final UnaryCallSettings.Builder + getSslPolicySettings; + private final UnaryCallSettings.Builder + insertSslPolicySettings; + private final PagedCallSettings.Builder< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + listSslPoliciesSettings; + private final UnaryCallSettings.Builder< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesSettings; + private final UnaryCallSettings.Builder + patchSslPolicySettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteSslPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSslPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertSslPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listSslPoliciesSettings = PagedCallSettings.newBuilder(LIST_SSL_POLICIES_PAGE_STR_FACT); + + listAvailableFeaturesSslPoliciesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + patchSslPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSslPolicySettings, + getSslPolicySettings, + insertSslPolicySettings, + listSslPoliciesSettings, + listAvailableFeaturesSslPoliciesSettings, + patchSslPolicySettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .deleteSslPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getSslPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .insertSslPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listSslPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listAvailableFeaturesSslPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .patchSslPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(SslPolicyStubSettings settings) { + super(settings); + + deleteSslPolicySettings = settings.deleteSslPolicySettings.toBuilder(); + getSslPolicySettings = settings.getSslPolicySettings.toBuilder(); + insertSslPolicySettings = settings.insertSslPolicySettings.toBuilder(); + listSslPoliciesSettings = settings.listSslPoliciesSettings.toBuilder(); + listAvailableFeaturesSslPoliciesSettings = + settings.listAvailableFeaturesSslPoliciesSettings.toBuilder(); + patchSslPolicySettings = settings.patchSslPolicySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSslPolicySettings, + getSslPolicySettings, + insertSslPolicySettings, + listSslPoliciesSettings, + listAvailableFeaturesSslPoliciesSettings, + patchSslPolicySettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to deleteSslPolicy. */ + public UnaryCallSettings.Builder + deleteSslPolicySettings() { + return deleteSslPolicySettings; + } + + /** Returns the builder for the settings used for calls to getSslPolicy. */ + public UnaryCallSettings.Builder getSslPolicySettings() { + return getSslPolicySettings; + } + + /** Returns the builder for the settings used for calls to insertSslPolicy. */ + public UnaryCallSettings.Builder + insertSslPolicySettings() { + return insertSslPolicySettings; + } + + /** Returns the builder for the settings used for calls to listSslPolicies. */ + public PagedCallSettings.Builder< + ListSslPoliciesHttpRequest, SslPoliciesList, ListSslPoliciesPagedResponse> + listSslPoliciesSettings() { + return listSslPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to listAvailableFeaturesSslPolicies. */ + public UnaryCallSettings.Builder< + ListAvailableFeaturesSslPoliciesHttpRequest, SslPoliciesListAvailableFeaturesResponse> + listAvailableFeaturesSslPoliciesSettings() { + return listAvailableFeaturesSslPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to patchSslPolicy. */ + public UnaryCallSettings.Builder + patchSslPolicySettings() { + return patchSslPolicySettings; + } + + @Override + public SslPolicyStubSettings build() throws IOException { + return new SslPolicyStubSettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java index 26805ce3e39f..5a35d0b38f07 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -26,18 +29,10 @@ import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionSubnetworkName; import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; -import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; -import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; import com.google.cloud.compute.v1.SubnetworkList; -import com.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; -import com.google.cloud.compute.v1.SubnetworksScopedList; -import com.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -50,14 +45,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SubnetworkStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListSubnetworksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListSubnetworksPagedCallable()"); + public UnaryCallable + aggregatedListSubnetworksPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListSubnetworksPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListSubnetworksCallable() { + public UnaryCallable + aggregatedListSubnetworksCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListSubnetworksCallable()"); } @@ -67,8 +64,10 @@ public UnaryCallable deleteSubnetworkCal } @BetaApi - public UnaryCallable expandIpCidrRangeSubnetworkCallable() { - throw new UnsupportedOperationException("Not implemented: expandIpCidrRangeSubnetworkCallable()"); + public UnaryCallable + expandIpCidrRangeSubnetworkCallable() { + throw new UnsupportedOperationException( + "Not implemented: expandIpCidrRangeSubnetworkCallable()"); } @BetaApi @@ -82,7 +81,8 @@ public UnaryCallable insertSubnetworkCal } @BetaApi - public UnaryCallable listSubnetworksPagedCallable() { + public UnaryCallable + listSubnetworksPagedCallable() { throw new UnsupportedOperationException("Not implemented: listSubnetworksPagedCallable()"); } @@ -97,8 +97,12 @@ public UnaryCallable patchSubnetworkCalla } @BetaApi - public UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { - throw new UnsupportedOperationException("Not implemented: setPrivateIpGoogleAccessSubnetworkCallable()"); + public UnaryCallable + setPrivateIpGoogleAccessSubnetworkCallable() { + throw new UnsupportedOperationException( + "Not implemented: setPrivateIpGoogleAccessSubnetworkCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java index edd379bbb78c..82fd082057db 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; @@ -53,18 +51,14 @@ import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; -import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; -import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; import com.google.cloud.compute.v1.SubnetworkList; import com.google.cloud.compute.v1.SubnetworksScopedList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -75,15 +69,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteSubnetwork to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteSubnetwork to 30 seconds: * *

  * 
@@ -98,84 +92,79 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class SubnetworkStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListSubnetworksSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+          AggregatedListSubnetworksPagedResponse>
+      aggregatedListSubnetworksSettings;
   private final UnaryCallSettings deleteSubnetworkSettings;
-  private final UnaryCallSettings expandIpCidrRangeSubnetworkSettings;
+  private final UnaryCallSettings
+      expandIpCidrRangeSubnetworkSettings;
   private final UnaryCallSettings getSubnetworkSettings;
   private final UnaryCallSettings insertSubnetworkSettings;
-  private final PagedCallSettings listSubnetworksSettings;
+  private final PagedCallSettings<
+          ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse>
+      listSubnetworksSettings;
   private final UnaryCallSettings patchSubnetworkSettings;
-  private final UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListSubnetworks.
-   */
-  public PagedCallSettings aggregatedListSubnetworksSettings() {
+  private final UnaryCallSettings
+      setPrivateIpGoogleAccessSubnetworkSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListSubnetworks. */
+  public PagedCallSettings<
+          AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+          AggregatedListSubnetworksPagedResponse>
+      aggregatedListSubnetworksSettings() {
     return aggregatedListSubnetworksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to deleteSubnetwork. */
   public UnaryCallSettings deleteSubnetworkSettings() {
     return deleteSubnetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to expandIpCidrRangeSubnetwork.
-   */
-  public UnaryCallSettings expandIpCidrRangeSubnetworkSettings() {
+  /** Returns the object with the settings used for calls to expandIpCidrRangeSubnetwork. */
+  public UnaryCallSettings
+      expandIpCidrRangeSubnetworkSettings() {
     return expandIpCidrRangeSubnetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to getSubnetwork. */
   public UnaryCallSettings getSubnetworkSettings() {
     return getSubnetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to insertSubnetwork. */
   public UnaryCallSettings insertSubnetworkSettings() {
     return insertSubnetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listSubnetworks.
-   */
-  public PagedCallSettings listSubnetworksSettings() {
+  /** Returns the object with the settings used for calls to listSubnetworks. */
+  public PagedCallSettings
+      listSubnetworksSettings() {
     return listSubnetworksSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchSubnetwork.
-   */
+  /** Returns the object with the settings used for calls to patchSubnetwork. */
   public UnaryCallSettings patchSubnetworkSettings() {
     return patchSubnetworkSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork.
-   */
-  public UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings() {
+  /** Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */
+  public UnaryCallSettings
+      setPrivateIpGoogleAccessSubnetworkSettings() {
     return setPrivateIpGoogleAccessSubnetworkSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public SubnetworkStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -188,47 +177,34 @@ public SubnetworkStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -239,27 +215,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SubnetworkStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(SubnetworkStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -269,136 +242,175 @@ protected SubnetworkStubSettings(Builder settingsBuilder) throws IOException {
 
     aggregatedListSubnetworksSettings = settingsBuilder.aggregatedListSubnetworksSettings().build();
     deleteSubnetworkSettings = settingsBuilder.deleteSubnetworkSettings().build();
-    expandIpCidrRangeSubnetworkSettings = settingsBuilder.expandIpCidrRangeSubnetworkSettings().build();
+    expandIpCidrRangeSubnetworkSettings =
+        settingsBuilder.expandIpCidrRangeSubnetworkSettings().build();
     getSubnetworkSettings = settingsBuilder.getSubnetworkSettings().build();
     insertSubnetworkSettings = settingsBuilder.insertSubnetworkSettings().build();
     listSubnetworksSettings = settingsBuilder.listSubnetworksSettings().build();
     patchSubnetworkSettings = settingsBuilder.patchSubnetworkSettings().build();
-    setPrivateIpGoogleAccessSubnetworkSettings = settingsBuilder.setPrivateIpGoogleAccessSubnetworkSettings().build();
+    setPrivateIpGoogleAccessSubnetworkSettings =
+        settingsBuilder.setPrivateIpGoogleAccessSubnetworkSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListSubnetworksHttpRequest injectToken(AggregatedListSubnetworksHttpRequest payload, String token) {
-          return AggregatedListSubnetworksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListSubnetworksHttpRequest injectPageSize(AggregatedListSubnetworksHttpRequest payload, int pageSize) {
-          return AggregatedListSubnetworksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListSubnetworksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(SubnetworkAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(SubnetworkAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_SUBNETWORKS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListSubnetworksHttpRequest injectToken(ListSubnetworksHttpRequest payload, String token) {
-          return ListSubnetworksHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListSubnetworksHttpRequest injectPageSize(ListSubnetworksHttpRequest payload, int pageSize) {
-          return ListSubnetworksHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListSubnetworksHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(SubnetworkList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(SubnetworkList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListSubnetworksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC, request, context);
-          return AggregatedListSubnetworksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_SUBNETWORKS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListSubnetworksHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_SUBNETWORKS_PAGE_STR_DESC, request, context);
-          return ListSubnetworksPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for SubnetworkStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, SubnetworksScopedList>
+      AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+              SubnetworksScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListSubnetworksHttpRequest injectToken(
+                AggregatedListSubnetworksHttpRequest payload, String token) {
+              return AggregatedListSubnetworksHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListSubnetworksHttpRequest injectPageSize(
+                AggregatedListSubnetworksHttpRequest payload, int pageSize) {
+              return AggregatedListSubnetworksHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListSubnetworksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(SubnetworkAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                SubnetworkAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_SUBNETWORKS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListSubnetworksHttpRequest injectToken(
+                ListSubnetworksHttpRequest payload, String token) {
+              return ListSubnetworksHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListSubnetworksHttpRequest injectPageSize(
+                ListSubnetworksHttpRequest payload, int pageSize) {
+              return ListSubnetworksHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListSubnetworksHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(SubnetworkList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(SubnetworkList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+          AggregatedListSubnetworksPagedResponse>
+      AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+              AggregatedListSubnetworksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListSubnetworksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+                      SubnetworksScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_DESC, request, context);
+              return AggregatedListSubnetworksPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse>
+      LIST_SUBNETWORKS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListSubnetworksHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_SUBNETWORKS_PAGE_STR_DESC, request, context);
+              return ListSubnetworksPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for SubnetworkStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListSubnetworksSettings;
-    private final UnaryCallSettings.Builder deleteSubnetworkSettings;
-    private final UnaryCallSettings.Builder expandIpCidrRangeSubnetworkSettings;
-    private final UnaryCallSettings.Builder getSubnetworkSettings;
-    private final UnaryCallSettings.Builder insertSubnetworkSettings;
-    private final PagedCallSettings.Builder listSubnetworksSettings;
-    private final UnaryCallSettings.Builder patchSubnetworkSettings;
-    private final UnaryCallSettings.Builder setPrivateIpGoogleAccessSubnetworkSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList,
+            AggregatedListSubnetworksPagedResponse>
+        aggregatedListSubnetworksSettings;
+    private final UnaryCallSettings.Builder
+        deleteSubnetworkSettings;
+    private final UnaryCallSettings.Builder
+        expandIpCidrRangeSubnetworkSettings;
+    private final UnaryCallSettings.Builder
+        getSubnetworkSettings;
+    private final UnaryCallSettings.Builder
+        insertSubnetworkSettings;
+    private final PagedCallSettings.Builder<
+            ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse>
+        listSubnetworksSettings;
+    private final UnaryCallSettings.Builder
+        patchSubnetworkSettings;
+    private final UnaryCallSettings.Builder<
+            SetPrivateIpGoogleAccessSubnetworkHttpRequest, Operation>
+        setPrivateIpGoogleAccessSubnetworkSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -407,15 +419,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -427,8 +440,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListSubnetworksSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_FACT);
+      aggregatedListSubnetworksSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_SUBNETWORKS_PAGE_STR_FACT);
 
       deleteSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -438,23 +451,22 @@ protected Builder(ClientContext clientContext) {
 
       insertSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listSubnetworksSettings = PagedCallSettings.newBuilder(
-          LIST_SUBNETWORKS_PAGE_STR_FACT);
+      listSubnetworksSettings = PagedCallSettings.newBuilder(LIST_SUBNETWORKS_PAGE_STR_FACT);
 
       patchSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       setPrivateIpGoogleAccessSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListSubnetworksSettings,
-          deleteSubnetworkSettings,
-          expandIpCidrRangeSubnetworkSettings,
-          getSubnetworkSettings,
-          insertSubnetworkSettings,
-          listSubnetworksSettings,
-          patchSubnetworkSettings,
-          setPrivateIpGoogleAccessSubnetworkSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListSubnetworksSettings,
+              deleteSubnetworkSettings,
+              expandIpCidrRangeSubnetworkSettings,
+              getSubnetworkSettings,
+              insertSubnetworkSettings,
+              listSubnetworksSettings,
+              patchSubnetworkSettings,
+              setPrivateIpGoogleAccessSubnetworkSettings);
 
       initDefaults(this);
     }
@@ -470,35 +482,43 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListSubnetworksSettings()
+      builder
+          .aggregatedListSubnetworksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteSubnetworkSettings()
+      builder
+          .deleteSubnetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.expandIpCidrRangeSubnetworkSettings()
+      builder
+          .expandIpCidrRangeSubnetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getSubnetworkSettings()
+      builder
+          .getSubnetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertSubnetworkSettings()
+      builder
+          .insertSubnetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listSubnetworksSettings()
+      builder
+          .listSubnetworksSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchSubnetworkSettings()
+      builder
+          .patchSubnetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setPrivateIpGoogleAccessSubnetworkSettings()
+      builder
+          .setPrivateIpGoogleAccessSubnetworkSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -510,31 +530,35 @@ protected Builder(SubnetworkStubSettings settings) {
 
       aggregatedListSubnetworksSettings = settings.aggregatedListSubnetworksSettings.toBuilder();
       deleteSubnetworkSettings = settings.deleteSubnetworkSettings.toBuilder();
-      expandIpCidrRangeSubnetworkSettings = settings.expandIpCidrRangeSubnetworkSettings.toBuilder();
+      expandIpCidrRangeSubnetworkSettings =
+          settings.expandIpCidrRangeSubnetworkSettings.toBuilder();
       getSubnetworkSettings = settings.getSubnetworkSettings.toBuilder();
       insertSubnetworkSettings = settings.insertSubnetworkSettings.toBuilder();
       listSubnetworksSettings = settings.listSubnetworksSettings.toBuilder();
       patchSubnetworkSettings = settings.patchSubnetworkSettings.toBuilder();
-      setPrivateIpGoogleAccessSubnetworkSettings = settings.setPrivateIpGoogleAccessSubnetworkSettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListSubnetworksSettings,
-          deleteSubnetworkSettings,
-          expandIpCidrRangeSubnetworkSettings,
-          getSubnetworkSettings,
-          insertSubnetworkSettings,
-          listSubnetworksSettings,
-          patchSubnetworkSettings,
-          setPrivateIpGoogleAccessSubnetworkSettings
-      );
+      setPrivateIpGoogleAccessSubnetworkSettings =
+          settings.setPrivateIpGoogleAccessSubnetworkSettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListSubnetworksSettings,
+              deleteSubnetworkSettings,
+              expandIpCidrRangeSubnetworkSettings,
+              getSubnetworkSettings,
+              insertSubnetworkSettings,
+              listSubnetworksSettings,
+              patchSubnetworkSettings,
+              setPrivateIpGoogleAccessSubnetworkSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -543,59 +567,55 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListSubnetworksSettings() { + /** Returns the builder for the settings used for calls to aggregatedListSubnetworks. */ + public PagedCallSettings.Builder< + AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, + AggregatedListSubnetworksPagedResponse> + aggregatedListSubnetworksSettings() { return aggregatedListSubnetworksSettings; } - /** - * Returns the builder for the settings used for calls to deleteSubnetwork. - */ - public UnaryCallSettings.Builder deleteSubnetworkSettings() { + /** Returns the builder for the settings used for calls to deleteSubnetwork. */ + public UnaryCallSettings.Builder + deleteSubnetworkSettings() { return deleteSubnetworkSettings; } - /** - * Returns the builder for the settings used for calls to expandIpCidrRangeSubnetwork. - */ - public UnaryCallSettings.Builder expandIpCidrRangeSubnetworkSettings() { + /** Returns the builder for the settings used for calls to expandIpCidrRangeSubnetwork. */ + public UnaryCallSettings.Builder + expandIpCidrRangeSubnetworkSettings() { return expandIpCidrRangeSubnetworkSettings; } - /** - * Returns the builder for the settings used for calls to getSubnetwork. - */ + /** Returns the builder for the settings used for calls to getSubnetwork. */ public UnaryCallSettings.Builder getSubnetworkSettings() { return getSubnetworkSettings; } - /** - * Returns the builder for the settings used for calls to insertSubnetwork. - */ - public UnaryCallSettings.Builder insertSubnetworkSettings() { + /** Returns the builder for the settings used for calls to insertSubnetwork. */ + public UnaryCallSettings.Builder + insertSubnetworkSettings() { return insertSubnetworkSettings; } - /** - * Returns the builder for the settings used for calls to listSubnetworks. - */ - public PagedCallSettings.Builder listSubnetworksSettings() { + /** Returns the builder for the settings used for calls to listSubnetworks. */ + public PagedCallSettings.Builder< + ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse> + listSubnetworksSettings() { return listSubnetworksSettings; } - /** - * Returns the builder for the settings used for calls to patchSubnetwork. - */ - public UnaryCallSettings.Builder patchSubnetworkSettings() { + /** Returns the builder for the settings used for calls to patchSubnetwork. */ + public UnaryCallSettings.Builder + patchSubnetworkSettings() { return patchSubnetworkSettings; } /** * Returns the builder for the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */ - public UnaryCallSettings.Builder setPrivateIpGoogleAccessSubnetworkSettings() { + public UnaryCallSettings.Builder + setPrivateIpGoogleAccessSubnetworkSettings() { return setPrivateIpGoogleAccessSubnetworkSettings; } @@ -604,4 +624,4 @@ public SubnetworkStubSettings build() throws IOException { return new SubnetworkStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java index d2145f238e9a..66808c28e87e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,13 +25,9 @@ import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetHttpProxyName; import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.TargetHttpProxy; -import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; import com.google.cloud.compute.v1.TargetHttpProxyList; -import com.google.cloud.compute.v1.UrlMapReference; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -42,35 +40,43 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetHttpProxyStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteTargetHttpProxyCallable() { + public UnaryCallable + deleteTargetHttpProxyCallable() { throw new UnsupportedOperationException("Not implemented: deleteTargetHttpProxyCallable()"); } @BetaApi - public UnaryCallable getTargetHttpProxyCallable() { + public UnaryCallable + getTargetHttpProxyCallable() { throw new UnsupportedOperationException("Not implemented: getTargetHttpProxyCallable()"); } @BetaApi - public UnaryCallable insertTargetHttpProxyCallable() { + public UnaryCallable + insertTargetHttpProxyCallable() { throw new UnsupportedOperationException("Not implemented: insertTargetHttpProxyCallable()"); } @BetaApi - public UnaryCallable listTargetHttpProxiesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTargetHttpProxiesPagedCallable()"); + public UnaryCallable + listTargetHttpProxiesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listTargetHttpProxiesPagedCallable()"); } @BetaApi - public UnaryCallable listTargetHttpProxiesCallable() { + public UnaryCallable + listTargetHttpProxiesCallable() { throw new UnsupportedOperationException("Not implemented: listTargetHttpProxiesCallable()"); } @BetaApi - public UnaryCallable setUrlMapTargetHttpProxyCallable() { + public UnaryCallable + setUrlMapTargetHttpProxyCallable() { throw new UnsupportedOperationException("Not implemented: setUrlMapTargetHttpProxyCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java index 8aea8461d8e8..74b4817dcaa2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.GetTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.InsertTargetHttpProxyHttpRequest; @@ -49,16 +46,13 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.SetUrlMapTargetHttpProxyHttpRequest; import com.google.cloud.compute.v1.TargetHttpProxy; -import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; import com.google.cloud.compute.v1.TargetHttpProxyList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -69,15 +63,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetHttpProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetHttpProxy to 30 seconds: * *

  * 
@@ -92,60 +86,60 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetHttpProxyStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteTargetHttpProxySettings;
-  private final UnaryCallSettings getTargetHttpProxySettings;
-  private final UnaryCallSettings insertTargetHttpProxySettings;
-  private final PagedCallSettings listTargetHttpProxiesSettings;
-  private final UnaryCallSettings setUrlMapTargetHttpProxySettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteTargetHttpProxy.
-   */
-  public UnaryCallSettings deleteTargetHttpProxySettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteTargetHttpProxySettings;
+  private final UnaryCallSettings
+      getTargetHttpProxySettings;
+  private final UnaryCallSettings
+      insertTargetHttpProxySettings;
+  private final PagedCallSettings<
+          ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, ListTargetHttpProxiesPagedResponse>
+      listTargetHttpProxiesSettings;
+  private final UnaryCallSettings
+      setUrlMapTargetHttpProxySettings;
+
+  /** Returns the object with the settings used for calls to deleteTargetHttpProxy. */
+  public UnaryCallSettings
+      deleteTargetHttpProxySettings() {
     return deleteTargetHttpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetHttpProxy.
-   */
-  public UnaryCallSettings getTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetHttpProxy. */
+  public UnaryCallSettings
+      getTargetHttpProxySettings() {
     return getTargetHttpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetHttpProxy.
-   */
-  public UnaryCallSettings insertTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetHttpProxy. */
+  public UnaryCallSettings
+      insertTargetHttpProxySettings() {
     return insertTargetHttpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetHttpProxies.
-   */
-  public PagedCallSettings listTargetHttpProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetHttpProxies. */
+  public PagedCallSettings<
+          ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, ListTargetHttpProxiesPagedResponse>
+      listTargetHttpProxiesSettings() {
     return listTargetHttpProxiesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setUrlMapTargetHttpProxy.
-   */
-  public UnaryCallSettings setUrlMapTargetHttpProxySettings() {
+  /** Returns the object with the settings used for calls to setUrlMapTargetHttpProxy. */
+  public UnaryCallSettings
+      setUrlMapTargetHttpProxySettings() {
     return setUrlMapTargetHttpProxySettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetHttpProxyStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -158,47 +152,34 @@ public TargetHttpProxyStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -209,27 +190,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetHttpProxyStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetHttpProxyStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -244,77 +222,97 @@ protected TargetHttpProxyStubSettings(Builder settingsBuilder) throws IOExceptio
     setUrlMapTargetHttpProxySettings = settingsBuilder.setUrlMapTargetHttpProxySettings().build();
   }
 
-  private static final PagedListDescriptor LIST_TARGET_HTTP_PROXIES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetHttpProxiesHttpRequest injectToken(ListTargetHttpProxiesHttpRequest payload, String token) {
-          return ListTargetHttpProxiesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetHttpProxiesHttpRequest injectPageSize(ListTargetHttpProxiesHttpRequest payload, int pageSize) {
-          return ListTargetHttpProxiesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetHttpProxiesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetHttpProxyList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetHttpProxyList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_HTTP_PROXIES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetHttpProxiesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_HTTP_PROXIES_PAGE_STR_DESC, request, context);
-          return ListTargetHttpProxiesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetHttpProxyStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, TargetHttpProxy>
+      LIST_TARGET_HTTP_PROXIES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, TargetHttpProxy>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetHttpProxiesHttpRequest injectToken(
+                ListTargetHttpProxiesHttpRequest payload, String token) {
+              return ListTargetHttpProxiesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListTargetHttpProxiesHttpRequest injectPageSize(
+                ListTargetHttpProxiesHttpRequest payload, int pageSize) {
+              return ListTargetHttpProxiesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetHttpProxiesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetHttpProxyList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetHttpProxyList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, ListTargetHttpProxiesPagedResponse>
+      LIST_TARGET_HTTP_PROXIES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetHttpProxiesHttpRequest, TargetHttpProxyList,
+              ListTargetHttpProxiesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetHttpProxiesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_TARGET_HTTP_PROXIES_PAGE_STR_DESC, request, context);
+              return ListTargetHttpProxiesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetHttpProxyStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteTargetHttpProxySettings;
-    private final UnaryCallSettings.Builder getTargetHttpProxySettings;
-    private final UnaryCallSettings.Builder insertTargetHttpProxySettings;
-    private final PagedCallSettings.Builder listTargetHttpProxiesSettings;
-    private final UnaryCallSettings.Builder setUrlMapTargetHttpProxySettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteTargetHttpProxySettings;
+    private final UnaryCallSettings.Builder
+        getTargetHttpProxySettings;
+    private final UnaryCallSettings.Builder
+        insertTargetHttpProxySettings;
+    private final PagedCallSettings.Builder<
+            ListTargetHttpProxiesHttpRequest, TargetHttpProxyList,
+            ListTargetHttpProxiesPagedResponse>
+        listTargetHttpProxiesSettings;
+    private final UnaryCallSettings.Builder
+        setUrlMapTargetHttpProxySettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -323,15 +321,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -349,18 +348,18 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetHttpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetHttpProxiesSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_HTTP_PROXIES_PAGE_STR_FACT);
+      listTargetHttpProxiesSettings =
+          PagedCallSettings.newBuilder(LIST_TARGET_HTTP_PROXIES_PAGE_STR_FACT);
 
       setUrlMapTargetHttpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetHttpProxySettings,
-          getTargetHttpProxySettings,
-          insertTargetHttpProxySettings,
-          listTargetHttpProxiesSettings,
-          setUrlMapTargetHttpProxySettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetHttpProxySettings,
+              getTargetHttpProxySettings,
+              insertTargetHttpProxySettings,
+              listTargetHttpProxiesSettings,
+              setUrlMapTargetHttpProxySettings);
 
       initDefaults(this);
     }
@@ -376,23 +375,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteTargetHttpProxySettings()
+      builder
+          .deleteTargetHttpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetHttpProxySettings()
+      builder
+          .getTargetHttpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetHttpProxySettings()
+      builder
+          .insertTargetHttpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetHttpProxiesSettings()
+      builder
+          .listTargetHttpProxiesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setUrlMapTargetHttpProxySettings()
+      builder
+          .setUrlMapTargetHttpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -408,21 +412,23 @@ protected Builder(TargetHttpProxyStubSettings settings) {
       listTargetHttpProxiesSettings = settings.listTargetHttpProxiesSettings.toBuilder();
       setUrlMapTargetHttpProxySettings = settings.setUrlMapTargetHttpProxySettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetHttpProxySettings,
-          getTargetHttpProxySettings,
-          insertTargetHttpProxySettings,
-          listTargetHttpProxiesSettings,
-          setUrlMapTargetHttpProxySettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetHttpProxySettings,
+              getTargetHttpProxySettings,
+              insertTargetHttpProxySettings,
+              listTargetHttpProxiesSettings,
+              setUrlMapTargetHttpProxySettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -431,38 +437,35 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetHttpProxy. */ + public UnaryCallSettings.Builder + deleteTargetHttpProxySettings() { return deleteTargetHttpProxySettings; } - /** - * Returns the builder for the settings used for calls to getTargetHttpProxy. - */ - public UnaryCallSettings.Builder getTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to getTargetHttpProxy. */ + public UnaryCallSettings.Builder + getTargetHttpProxySettings() { return getTargetHttpProxySettings; } - /** - * Returns the builder for the settings used for calls to insertTargetHttpProxy. - */ - public UnaryCallSettings.Builder insertTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetHttpProxy. */ + public UnaryCallSettings.Builder + insertTargetHttpProxySettings() { return insertTargetHttpProxySettings; } - /** - * Returns the builder for the settings used for calls to listTargetHttpProxies. - */ - public PagedCallSettings.Builder listTargetHttpProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetHttpProxies. */ + public PagedCallSettings.Builder< + ListTargetHttpProxiesHttpRequest, TargetHttpProxyList, + ListTargetHttpProxiesPagedResponse> + listTargetHttpProxiesSettings() { return listTargetHttpProxiesSettings; } - /** - * Returns the builder for the settings used for calls to setUrlMapTargetHttpProxy. - */ - public UnaryCallSettings.Builder setUrlMapTargetHttpProxySettings() { + /** Returns the builder for the settings used for calls to setUrlMapTargetHttpProxy. */ + public UnaryCallSettings.Builder + setUrlMapTargetHttpProxySettings() { return setUrlMapTargetHttpProxySettings; } @@ -471,4 +474,4 @@ public TargetHttpProxyStubSettings build() throws IOException { return new TargetHttpProxyStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java index 9eef249a5b2c..4a0824b24224 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,15 +25,11 @@ import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName; import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; -import com.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; import com.google.cloud.compute.v1.TargetHttpsProxy; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; import com.google.cloud.compute.v1.TargetHttpsProxyList; -import com.google.cloud.compute.v1.UrlMapReference; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -44,40 +42,57 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetHttpsProxyStub implements BackgroundResource { - @BetaApi - public UnaryCallable deleteTargetHttpsProxyCallable() { + public UnaryCallable + deleteTargetHttpsProxyCallable() { throw new UnsupportedOperationException("Not implemented: deleteTargetHttpsProxyCallable()"); } @BetaApi - public UnaryCallable getTargetHttpsProxyCallable() { + public UnaryCallable + getTargetHttpsProxyCallable() { throw new UnsupportedOperationException("Not implemented: getTargetHttpsProxyCallable()"); } @BetaApi - public UnaryCallable insertTargetHttpsProxyCallable() { + public UnaryCallable + insertTargetHttpsProxyCallable() { throw new UnsupportedOperationException("Not implemented: insertTargetHttpsProxyCallable()"); } @BetaApi - public UnaryCallable listTargetHttpsProxiesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTargetHttpsProxiesPagedCallable()"); + public UnaryCallable + listTargetHttpsProxiesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listTargetHttpsProxiesPagedCallable()"); } @BetaApi - public UnaryCallable listTargetHttpsProxiesCallable() { + public UnaryCallable + listTargetHttpsProxiesCallable() { throw new UnsupportedOperationException("Not implemented: listTargetHttpsProxiesCallable()"); } @BetaApi - public UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { - throw new UnsupportedOperationException("Not implemented: setSslCertificatesTargetHttpsProxyCallable()"); + public UnaryCallable + setSslCertificatesTargetHttpsProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setSslCertificatesTargetHttpsProxyCallable()"); + } + + @BetaApi + public UnaryCallable + setSslPolicyTargetHttpsProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setSslPolicyTargetHttpsProxyCallable()"); } @BetaApi - public UnaryCallable setUrlMapTargetHttpsProxyCallable() { + public UnaryCallable + setUrlMapTargetHttpsProxyCallable() { throw new UnsupportedOperationException("Not implemented: setUrlMapTargetHttpsProxyCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java index f140fb65e35d..8c12776092c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,25 +39,22 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.GetTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.TargetHttpsProxy; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; import com.google.cloud.compute.v1.TargetHttpsProxyList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +65,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetHttpsProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetHttpsProxy to 30 seconds: * *

  * 
@@ -93,67 +88,77 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetHttpsProxyStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteTargetHttpsProxySettings;
-  private final UnaryCallSettings getTargetHttpsProxySettings;
-  private final UnaryCallSettings insertTargetHttpsProxySettings;
-  private final PagedCallSettings listTargetHttpsProxiesSettings;
-  private final UnaryCallSettings setSslCertificatesTargetHttpsProxySettings;
-  private final UnaryCallSettings setUrlMapTargetHttpsProxySettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteTargetHttpsProxy.
-   */
-  public UnaryCallSettings deleteTargetHttpsProxySettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteTargetHttpsProxySettings;
+  private final UnaryCallSettings
+      getTargetHttpsProxySettings;
+  private final UnaryCallSettings
+      insertTargetHttpsProxySettings;
+  private final PagedCallSettings<
+          ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList,
+          ListTargetHttpsProxiesPagedResponse>
+      listTargetHttpsProxiesSettings;
+  private final UnaryCallSettings
+      setSslCertificatesTargetHttpsProxySettings;
+  private final UnaryCallSettings
+      setSslPolicyTargetHttpsProxySettings;
+  private final UnaryCallSettings
+      setUrlMapTargetHttpsProxySettings;
+
+  /** Returns the object with the settings used for calls to deleteTargetHttpsProxy. */
+  public UnaryCallSettings
+      deleteTargetHttpsProxySettings() {
     return deleteTargetHttpsProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetHttpsProxy.
-   */
-  public UnaryCallSettings getTargetHttpsProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetHttpsProxy. */
+  public UnaryCallSettings
+      getTargetHttpsProxySettings() {
     return getTargetHttpsProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetHttpsProxy.
-   */
-  public UnaryCallSettings insertTargetHttpsProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetHttpsProxy. */
+  public UnaryCallSettings
+      insertTargetHttpsProxySettings() {
     return insertTargetHttpsProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetHttpsProxies.
-   */
-  public PagedCallSettings listTargetHttpsProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetHttpsProxies. */
+  public PagedCallSettings<
+          ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList,
+          ListTargetHttpsProxiesPagedResponse>
+      listTargetHttpsProxiesSettings() {
     return listTargetHttpsProxiesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy.
-   */
-  public UnaryCallSettings setSslCertificatesTargetHttpsProxySettings() {
+  /** Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy. */
+  public UnaryCallSettings
+      setSslCertificatesTargetHttpsProxySettings() {
     return setSslCertificatesTargetHttpsProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setUrlMapTargetHttpsProxy.
-   */
-  public UnaryCallSettings setUrlMapTargetHttpsProxySettings() {
-    return setUrlMapTargetHttpsProxySettings;
+  /** Returns the object with the settings used for calls to setSslPolicyTargetHttpsProxy. */
+  public UnaryCallSettings
+      setSslPolicyTargetHttpsProxySettings() {
+    return setSslPolicyTargetHttpsProxySettings;
   }
 
+  /** Returns the object with the settings used for calls to setUrlMapTargetHttpsProxy. */
+  public UnaryCallSettings
+      setUrlMapTargetHttpsProxySettings() {
+    return setUrlMapTargetHttpsProxySettings;
+  }
 
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetHttpsProxyStub createStub() throws IOException {
@@ -167,47 +172,34 @@ public TargetHttpsProxyStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +210,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetHttpsProxyStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetHttpsProxyStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -250,82 +239,110 @@ protected TargetHttpsProxyStubSettings(Builder settingsBuilder) throws IOExcepti
     getTargetHttpsProxySettings = settingsBuilder.getTargetHttpsProxySettings().build();
     insertTargetHttpsProxySettings = settingsBuilder.insertTargetHttpsProxySettings().build();
     listTargetHttpsProxiesSettings = settingsBuilder.listTargetHttpsProxiesSettings().build();
-    setSslCertificatesTargetHttpsProxySettings = settingsBuilder.setSslCertificatesTargetHttpsProxySettings().build();
+    setSslCertificatesTargetHttpsProxySettings =
+        settingsBuilder.setSslCertificatesTargetHttpsProxySettings().build();
+    setSslPolicyTargetHttpsProxySettings =
+        settingsBuilder.setSslPolicyTargetHttpsProxySettings().build();
     setUrlMapTargetHttpsProxySettings = settingsBuilder.setUrlMapTargetHttpsProxySettings().build();
   }
 
-  private static final PagedListDescriptor LIST_TARGET_HTTPS_PROXIES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetHttpsProxiesHttpRequest injectToken(ListTargetHttpsProxiesHttpRequest payload, String token) {
-          return ListTargetHttpsProxiesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetHttpsProxiesHttpRequest injectPageSize(ListTargetHttpsProxiesHttpRequest payload, int pageSize) {
-          return ListTargetHttpsProxiesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetHttpsProxiesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetHttpsProxyList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetHttpsProxyList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetHttpsProxiesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_HTTPS_PROXIES_PAGE_STR_DESC, request, context);
-          return ListTargetHttpsProxiesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetHttpsProxyStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, TargetHttpsProxy>
+      LIST_TARGET_HTTPS_PROXIES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, TargetHttpsProxy>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetHttpsProxiesHttpRequest injectToken(
+                ListTargetHttpsProxiesHttpRequest payload, String token) {
+              return ListTargetHttpsProxiesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListTargetHttpsProxiesHttpRequest injectPageSize(
+                ListTargetHttpsProxiesHttpRequest payload, int pageSize) {
+              return ListTargetHttpsProxiesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetHttpsProxiesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetHttpsProxyList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetHttpsProxyList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList,
+          ListTargetHttpsProxiesPagedResponse>
+      LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList,
+              ListTargetHttpsProxiesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetHttpsProxiesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_TARGET_HTTPS_PROXIES_PAGE_STR_DESC, request, context);
+              return ListTargetHttpsProxiesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetHttpsProxyStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteTargetHttpsProxySettings;
-    private final UnaryCallSettings.Builder getTargetHttpsProxySettings;
-    private final UnaryCallSettings.Builder insertTargetHttpsProxySettings;
-    private final PagedCallSettings.Builder listTargetHttpsProxiesSettings;
-    private final UnaryCallSettings.Builder setSslCertificatesTargetHttpsProxySettings;
-    private final UnaryCallSettings.Builder setUrlMapTargetHttpsProxySettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteTargetHttpsProxySettings;
+    private final UnaryCallSettings.Builder
+        getTargetHttpsProxySettings;
+    private final UnaryCallSettings.Builder
+        insertTargetHttpsProxySettings;
+    private final PagedCallSettings.Builder<
+            ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList,
+            ListTargetHttpsProxiesPagedResponse>
+        listTargetHttpsProxiesSettings;
+    private final UnaryCallSettings.Builder<
+            SetSslCertificatesTargetHttpsProxyHttpRequest, Operation>
+        setSslCertificatesTargetHttpsProxySettings;
+    private final UnaryCallSettings.Builder
+        setSslPolicyTargetHttpsProxySettings;
+    private final UnaryCallSettings.Builder
+        setUrlMapTargetHttpsProxySettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +351,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +378,24 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetHttpsProxiesSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT);
+      listTargetHttpsProxiesSettings =
+          PagedCallSettings.newBuilder(LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT);
 
       setSslCertificatesTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
+      setSslPolicyTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       setUrlMapTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetHttpsProxySettings,
-          getTargetHttpsProxySettings,
-          insertTargetHttpsProxySettings,
-          listTargetHttpsProxiesSettings,
-          setSslCertificatesTargetHttpsProxySettings,
-          setUrlMapTargetHttpsProxySettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetHttpsProxySettings,
+              getTargetHttpsProxySettings,
+              insertTargetHttpsProxySettings,
+              listTargetHttpsProxiesSettings,
+              setSslCertificatesTargetHttpsProxySettings,
+              setSslPolicyTargetHttpsProxySettings,
+              setUrlMapTargetHttpsProxySettings);
 
       initDefaults(this);
     }
@@ -390,27 +411,38 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteTargetHttpsProxySettings()
+      builder
+          .deleteTargetHttpsProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetHttpsProxySettings()
+      builder
+          .getTargetHttpsProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetHttpsProxySettings()
+      builder
+          .insertTargetHttpsProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetHttpsProxiesSettings()
+      builder
+          .listTargetHttpsProxiesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setSslCertificatesTargetHttpsProxySettings()
+      builder
+          .setSslCertificatesTargetHttpsProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setUrlMapTargetHttpsProxySettings()
+      builder
+          .setSslPolicyTargetHttpsProxySettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder
+          .setUrlMapTargetHttpsProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -424,25 +456,31 @@ protected Builder(TargetHttpsProxyStubSettings settings) {
       getTargetHttpsProxySettings = settings.getTargetHttpsProxySettings.toBuilder();
       insertTargetHttpsProxySettings = settings.insertTargetHttpsProxySettings.toBuilder();
       listTargetHttpsProxiesSettings = settings.listTargetHttpsProxiesSettings.toBuilder();
-      setSslCertificatesTargetHttpsProxySettings = settings.setSslCertificatesTargetHttpsProxySettings.toBuilder();
+      setSslCertificatesTargetHttpsProxySettings =
+          settings.setSslCertificatesTargetHttpsProxySettings.toBuilder();
+      setSslPolicyTargetHttpsProxySettings =
+          settings.setSslPolicyTargetHttpsProxySettings.toBuilder();
       setUrlMapTargetHttpsProxySettings = settings.setUrlMapTargetHttpsProxySettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetHttpsProxySettings,
-          getTargetHttpsProxySettings,
-          insertTargetHttpsProxySettings,
-          listTargetHttpsProxiesSettings,
-          setSslCertificatesTargetHttpsProxySettings,
-          setUrlMapTargetHttpsProxySettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetHttpsProxySettings,
+              getTargetHttpsProxySettings,
+              insertTargetHttpsProxySettings,
+              listTargetHttpsProxiesSettings,
+              setSslCertificatesTargetHttpsProxySettings,
+              setSslPolicyTargetHttpsProxySettings,
+              setUrlMapTargetHttpsProxySettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +489,49 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetHttpsProxy. */ + public UnaryCallSettings.Builder + deleteTargetHttpsProxySettings() { return deleteTargetHttpsProxySettings; } - /** - * Returns the builder for the settings used for calls to getTargetHttpsProxy. - */ - public UnaryCallSettings.Builder getTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to getTargetHttpsProxy. */ + public UnaryCallSettings.Builder + getTargetHttpsProxySettings() { return getTargetHttpsProxySettings; } - /** - * Returns the builder for the settings used for calls to insertTargetHttpsProxy. - */ - public UnaryCallSettings.Builder insertTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetHttpsProxy. */ + public UnaryCallSettings.Builder + insertTargetHttpsProxySettings() { return insertTargetHttpsProxySettings; } - /** - * Returns the builder for the settings used for calls to listTargetHttpsProxies. - */ - public PagedCallSettings.Builder listTargetHttpsProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetHttpsProxies. */ + public PagedCallSettings.Builder< + ListTargetHttpsProxiesHttpRequest, TargetHttpsProxyList, + ListTargetHttpsProxiesPagedResponse> + listTargetHttpsProxiesSettings() { return listTargetHttpsProxiesSettings; } /** * Returns the builder for the settings used for calls to setSslCertificatesTargetHttpsProxy. */ - public UnaryCallSettings.Builder setSslCertificatesTargetHttpsProxySettings() { + public UnaryCallSettings.Builder + setSslCertificatesTargetHttpsProxySettings() { return setSslCertificatesTargetHttpsProxySettings; } - /** - * Returns the builder for the settings used for calls to setUrlMapTargetHttpsProxy. - */ - public UnaryCallSettings.Builder setUrlMapTargetHttpsProxySettings() { + /** Returns the builder for the settings used for calls to setSslPolicyTargetHttpsProxy. */ + public UnaryCallSettings.Builder + setSslPolicyTargetHttpsProxySettings() { + return setSslPolicyTargetHttpsProxySettings; + } + + /** Returns the builder for the settings used for calls to setUrlMapTargetHttpsProxy. */ + public UnaryCallSettings.Builder + setUrlMapTargetHttpsProxySettings() { return setUrlMapTargetHttpsProxySettings; } @@ -498,4 +540,4 @@ public TargetHttpsProxyStubSettings build() throws IOException { return new TargetHttpsProxyStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java index 49696fda137a..cedcd948022b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -24,15 +27,9 @@ import com.google.cloud.compute.v1.InsertTargetInstanceHttpRequest; import com.google.cloud.compute.v1.ListTargetInstancesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.ProjectZoneTargetInstanceName; import com.google.cloud.compute.v1.TargetInstance; import com.google.cloud.compute.v1.TargetInstanceAggregatedList; -import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; import com.google.cloud.compute.v1.TargetInstanceList; -import com.google.cloud.compute.v1.TargetInstancesScopedList; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -45,15 +42,19 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetInstanceStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListTargetInstancesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListTargetInstancesPagedCallable()"); + public UnaryCallable< + AggregatedListTargetInstancesHttpRequest, AggregatedListTargetInstancesPagedResponse> + aggregatedListTargetInstancesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListTargetInstancesPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListTargetInstancesCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListTargetInstancesCallable()"); + public UnaryCallable + aggregatedListTargetInstancesCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListTargetInstancesCallable()"); } @BetaApi @@ -72,13 +73,17 @@ public UnaryCallable insertTargetIns } @BetaApi - public UnaryCallable listTargetInstancesPagedCallable() { + public UnaryCallable + listTargetInstancesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listTargetInstancesPagedCallable()"); } @BetaApi - public UnaryCallable listTargetInstancesCallable() { + public UnaryCallable + listTargetInstancesCallable() { throw new UnsupportedOperationException("Not implemented: listTargetInstancesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java index 590d0ba7a209..0846bfc5d45b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListTargetInstancesHttpRequest; import com.google.cloud.compute.v1.DeleteTargetInstanceHttpRequest; import com.google.cloud.compute.v1.GetTargetInstanceHttpRequest; @@ -50,18 +48,14 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.TargetInstance; import com.google.cloud.compute.v1.TargetInstanceAggregatedList; -import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; import com.google.cloud.compute.v1.TargetInstanceList; import com.google.cloud.compute.v1.TargetInstancesScopedList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetInstance to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetInstance to 30 seconds: * *

  * 
@@ -95,60 +89,64 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetInstanceStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListTargetInstancesSettings;
-  private final UnaryCallSettings deleteTargetInstanceSettings;
-  private final UnaryCallSettings getTargetInstanceSettings;
-  private final UnaryCallSettings insertTargetInstanceSettings;
-  private final PagedCallSettings listTargetInstancesSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListTargetInstances.
-   */
-  public PagedCallSettings aggregatedListTargetInstancesSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+          AggregatedListTargetInstancesPagedResponse>
+      aggregatedListTargetInstancesSettings;
+  private final UnaryCallSettings
+      deleteTargetInstanceSettings;
+  private final UnaryCallSettings
+      getTargetInstanceSettings;
+  private final UnaryCallSettings
+      insertTargetInstanceSettings;
+  private final PagedCallSettings<
+          ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse>
+      listTargetInstancesSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListTargetInstances. */
+  public PagedCallSettings<
+          AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+          AggregatedListTargetInstancesPagedResponse>
+      aggregatedListTargetInstancesSettings() {
     return aggregatedListTargetInstancesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteTargetInstance.
-   */
-  public UnaryCallSettings deleteTargetInstanceSettings() {
+  /** Returns the object with the settings used for calls to deleteTargetInstance. */
+  public UnaryCallSettings
+      deleteTargetInstanceSettings() {
     return deleteTargetInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetInstance.
-   */
-  public UnaryCallSettings getTargetInstanceSettings() {
+  /** Returns the object with the settings used for calls to getTargetInstance. */
+  public UnaryCallSettings
+      getTargetInstanceSettings() {
     return getTargetInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetInstance.
-   */
-  public UnaryCallSettings insertTargetInstanceSettings() {
+  /** Returns the object with the settings used for calls to insertTargetInstance. */
+  public UnaryCallSettings
+      insertTargetInstanceSettings() {
     return insertTargetInstanceSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetInstances.
-   */
-  public PagedCallSettings listTargetInstancesSettings() {
+  /** Returns the object with the settings used for calls to listTargetInstances. */
+  public PagedCallSettings<
+          ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse>
+      listTargetInstancesSettings() {
     return listTargetInstancesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetInstanceStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -161,47 +159,34 @@ public TargetInstanceStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -212,27 +197,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetInstanceStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetInstanceStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -240,132 +222,178 @@ public Builder toBuilder() {
   protected TargetInstanceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListTargetInstancesSettings = settingsBuilder.aggregatedListTargetInstancesSettings().build();
+    aggregatedListTargetInstancesSettings =
+        settingsBuilder.aggregatedListTargetInstancesSettings().build();
     deleteTargetInstanceSettings = settingsBuilder.deleteTargetInstanceSettings().build();
     getTargetInstanceSettings = settingsBuilder.getTargetInstanceSettings().build();
     insertTargetInstanceSettings = settingsBuilder.insertTargetInstanceSettings().build();
     listTargetInstancesSettings = settingsBuilder.listTargetInstancesSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListTargetInstancesHttpRequest injectToken(AggregatedListTargetInstancesHttpRequest payload, String token) {
-          return AggregatedListTargetInstancesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListTargetInstancesHttpRequest injectPageSize(AggregatedListTargetInstancesHttpRequest payload, int pageSize) {
-          return AggregatedListTargetInstancesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListTargetInstancesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetInstanceAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetInstanceAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_TARGET_INSTANCES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetInstancesHttpRequest injectToken(ListTargetInstancesHttpRequest payload, String token) {
-          return ListTargetInstancesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetInstancesHttpRequest injectPageSize(ListTargetInstancesHttpRequest payload, int pageSize) {
-          return ListTargetInstancesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetInstancesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetInstanceList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetInstanceList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListTargetInstancesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_DESC, request, context);
-          return AggregatedListTargetInstancesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_INSTANCES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetInstancesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_INSTANCES_PAGE_STR_DESC, request, context);
-          return ListTargetInstancesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetInstanceStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+          TargetInstancesScopedList>
+      AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+              TargetInstancesScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListTargetInstancesHttpRequest injectToken(
+                AggregatedListTargetInstancesHttpRequest payload, String token) {
+              return AggregatedListTargetInstancesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListTargetInstancesHttpRequest injectPageSize(
+                AggregatedListTargetInstancesHttpRequest payload, int pageSize) {
+              return AggregatedListTargetInstancesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListTargetInstancesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetInstanceAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                TargetInstanceAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListTargetInstancesHttpRequest, TargetInstanceList, TargetInstance>
+      LIST_TARGET_INSTANCES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListTargetInstancesHttpRequest, TargetInstanceList, TargetInstance>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetInstancesHttpRequest injectToken(
+                ListTargetInstancesHttpRequest payload, String token) {
+              return ListTargetInstancesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListTargetInstancesHttpRequest injectPageSize(
+                ListTargetInstancesHttpRequest payload, int pageSize) {
+              return ListTargetInstancesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetInstancesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetInstanceList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetInstanceList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+          AggregatedListTargetInstancesPagedResponse>
+      AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+              AggregatedListTargetInstancesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList>
+                    callable,
+                AggregatedListTargetInstancesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+                      TargetInstancesScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListTargetInstancesPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse>
+      LIST_TARGET_INSTANCES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetInstancesHttpRequest, TargetInstanceList,
+              ListTargetInstancesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetInstancesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_TARGET_INSTANCES_PAGE_STR_DESC, request, context);
+              return ListTargetInstancesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetInstanceStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListTargetInstancesSettings;
-    private final UnaryCallSettings.Builder deleteTargetInstanceSettings;
-    private final UnaryCallSettings.Builder getTargetInstanceSettings;
-    private final UnaryCallSettings.Builder insertTargetInstanceSettings;
-    private final PagedCallSettings.Builder listTargetInstancesSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList,
+            AggregatedListTargetInstancesPagedResponse>
+        aggregatedListTargetInstancesSettings;
+    private final UnaryCallSettings.Builder
+        deleteTargetInstanceSettings;
+    private final UnaryCallSettings.Builder
+        getTargetInstanceSettings;
+    private final UnaryCallSettings.Builder
+        insertTargetInstanceSettings;
+    private final PagedCallSettings.Builder<
+            ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse>
+        listTargetInstancesSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -374,15 +402,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -394,8 +423,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListTargetInstancesSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_FACT);
+      aggregatedListTargetInstancesSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_TARGET_INSTANCES_PAGE_STR_FACT);
 
       deleteTargetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -403,16 +432,16 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetInstancesSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_INSTANCES_PAGE_STR_FACT);
+      listTargetInstancesSettings =
+          PagedCallSettings.newBuilder(LIST_TARGET_INSTANCES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListTargetInstancesSettings,
-          deleteTargetInstanceSettings,
-          getTargetInstanceSettings,
-          insertTargetInstanceSettings,
-          listTargetInstancesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListTargetInstancesSettings,
+              deleteTargetInstanceSettings,
+              getTargetInstanceSettings,
+              insertTargetInstanceSettings,
+              listTargetInstancesSettings);
 
       initDefaults(this);
     }
@@ -428,23 +457,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListTargetInstancesSettings()
+      builder
+          .aggregatedListTargetInstancesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteTargetInstanceSettings()
+      builder
+          .deleteTargetInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetInstanceSettings()
+      builder
+          .getTargetInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetInstanceSettings()
+      builder
+          .insertTargetInstanceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetInstancesSettings()
+      builder
+          .listTargetInstancesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -454,27 +488,30 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(TargetInstanceStubSettings settings) {
       super(settings);
 
-      aggregatedListTargetInstancesSettings = settings.aggregatedListTargetInstancesSettings.toBuilder();
+      aggregatedListTargetInstancesSettings =
+          settings.aggregatedListTargetInstancesSettings.toBuilder();
       deleteTargetInstanceSettings = settings.deleteTargetInstanceSettings.toBuilder();
       getTargetInstanceSettings = settings.getTargetInstanceSettings.toBuilder();
       insertTargetInstanceSettings = settings.insertTargetInstanceSettings.toBuilder();
       listTargetInstancesSettings = settings.listTargetInstancesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListTargetInstancesSettings,
-          deleteTargetInstanceSettings,
-          getTargetInstanceSettings,
-          insertTargetInstanceSettings,
-          listTargetInstancesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListTargetInstancesSettings,
+              deleteTargetInstanceSettings,
+              getTargetInstanceSettings,
+              insertTargetInstanceSettings,
+              listTargetInstancesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -483,38 +520,36 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListTargetInstancesSettings() { + /** Returns the builder for the settings used for calls to aggregatedListTargetInstances. */ + public PagedCallSettings.Builder< + AggregatedListTargetInstancesHttpRequest, TargetInstanceAggregatedList, + AggregatedListTargetInstancesPagedResponse> + aggregatedListTargetInstancesSettings() { return aggregatedListTargetInstancesSettings; } - /** - * Returns the builder for the settings used for calls to deleteTargetInstance. - */ - public UnaryCallSettings.Builder deleteTargetInstanceSettings() { + /** Returns the builder for the settings used for calls to deleteTargetInstance. */ + public UnaryCallSettings.Builder + deleteTargetInstanceSettings() { return deleteTargetInstanceSettings; } - /** - * Returns the builder for the settings used for calls to getTargetInstance. - */ - public UnaryCallSettings.Builder getTargetInstanceSettings() { + /** Returns the builder for the settings used for calls to getTargetInstance. */ + public UnaryCallSettings.Builder + getTargetInstanceSettings() { return getTargetInstanceSettings; } - /** - * Returns the builder for the settings used for calls to insertTargetInstance. - */ - public UnaryCallSettings.Builder insertTargetInstanceSettings() { + /** Returns the builder for the settings used for calls to insertTargetInstance. */ + public UnaryCallSettings.Builder + insertTargetInstanceSettings() { return insertTargetInstanceSettings; } - /** - * Returns the builder for the settings used for calls to listTargetInstances. - */ - public PagedCallSettings.Builder listTargetInstancesSettings() { + /** Returns the builder for the settings used for calls to listTargetInstances. */ + public PagedCallSettings.Builder< + ListTargetInstancesHttpRequest, TargetInstanceList, ListTargetInstancesPagedResponse> + listTargetInstancesSettings() { return listTargetInstancesSettings; } @@ -523,4 +558,4 @@ public TargetInstanceStubSettings build() throws IOException { return new TargetInstanceStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java index 0e89154c78e1..9dc5fb536d7a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -25,27 +28,15 @@ import com.google.cloud.compute.v1.GetHealthTargetPoolHttpRequest; import com.google.cloud.compute.v1.GetTargetPoolHttpRequest; import com.google.cloud.compute.v1.InsertTargetPoolHttpRequest; -import com.google.cloud.compute.v1.InstanceReference; import com.google.cloud.compute.v1.ListTargetPoolsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionTargetPoolName; import com.google.cloud.compute.v1.RemoveHealthCheckTargetPoolHttpRequest; import com.google.cloud.compute.v1.RemoveInstanceTargetPoolHttpRequest; import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; import com.google.cloud.compute.v1.TargetPool; import com.google.cloud.compute.v1.TargetPoolAggregatedList; -import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; -import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; import com.google.cloud.compute.v1.TargetPoolInstanceHealth; import com.google.cloud.compute.v1.TargetPoolList; -import com.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; -import com.google.cloud.compute.v1.TargetPoolsAddInstanceRequest; -import com.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; -import com.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; -import com.google.cloud.compute.v1.TargetPoolsScopedList; -import com.google.cloud.compute.v1.TargetReference; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -58,24 +49,28 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetPoolStub implements BackgroundResource { - @BetaApi - public UnaryCallable addHealthCheckTargetPoolCallable() { + public UnaryCallable + addHealthCheckTargetPoolCallable() { throw new UnsupportedOperationException("Not implemented: addHealthCheckTargetPoolCallable()"); } @BetaApi - public UnaryCallable addInstanceTargetPoolCallable() { + public UnaryCallable + addInstanceTargetPoolCallable() { throw new UnsupportedOperationException("Not implemented: addInstanceTargetPoolCallable()"); } @BetaApi - public UnaryCallable aggregatedListTargetPoolsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListTargetPoolsPagedCallable()"); + public UnaryCallable + aggregatedListTargetPoolsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListTargetPoolsPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListTargetPoolsCallable() { + public UnaryCallable + aggregatedListTargetPoolsCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListTargetPoolsCallable()"); } @@ -90,7 +85,8 @@ public UnaryCallable getTargetPoolCallable } @BetaApi - public UnaryCallable getHealthTargetPoolCallable() { + public UnaryCallable + getHealthTargetPoolCallable() { throw new UnsupportedOperationException("Not implemented: getHealthTargetPoolCallable()"); } @@ -100,7 +96,8 @@ public UnaryCallable insertTargetPoolCal } @BetaApi - public UnaryCallable listTargetPoolsPagedCallable() { + public UnaryCallable + listTargetPoolsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listTargetPoolsPagedCallable()"); } @@ -110,12 +107,15 @@ public UnaryCallable listTargetPools } @BetaApi - public UnaryCallable removeHealthCheckTargetPoolCallable() { - throw new UnsupportedOperationException("Not implemented: removeHealthCheckTargetPoolCallable()"); + public UnaryCallable + removeHealthCheckTargetPoolCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeHealthCheckTargetPoolCallable()"); } @BetaApi - public UnaryCallable removeInstanceTargetPoolCallable() { + public UnaryCallable + removeInstanceTargetPoolCallable() { throw new UnsupportedOperationException("Not implemented: removeInstanceTargetPoolCallable()"); } @@ -124,4 +124,6 @@ public UnaryCallable setBackupTargetP throw new UnsupportedOperationException("Not implemented: setBackupTargetPoolCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java index 1bfd1bd045c6..7663114fbe7a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; +import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AddHealthCheckTargetPoolHttpRequest; import com.google.cloud.compute.v1.AddInstanceTargetPoolHttpRequest; import com.google.cloud.compute.v1.AggregatedListTargetPoolsHttpRequest; @@ -56,8 +54,6 @@ import com.google.cloud.compute.v1.SetBackupTargetPoolHttpRequest; import com.google.cloud.compute.v1.TargetPool; import com.google.cloud.compute.v1.TargetPoolAggregatedList; -import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; -import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; import com.google.cloud.compute.v1.TargetPoolInstanceHealth; import com.google.cloud.compute.v1.TargetPoolList; import com.google.cloud.compute.v1.TargetPoolsScopedList; @@ -65,10 +61,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -79,15 +73,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of addHealthCheckTargetPool to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addHealthCheckTargetPool to 30 seconds: * *

  * 
@@ -102,108 +96,105 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetPoolStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings addHealthCheckTargetPoolSettings;
-  private final UnaryCallSettings addInstanceTargetPoolSettings;
-  private final PagedCallSettings aggregatedListTargetPoolsSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      addHealthCheckTargetPoolSettings;
+  private final UnaryCallSettings
+      addInstanceTargetPoolSettings;
+  private final PagedCallSettings<
+          AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+          AggregatedListTargetPoolsPagedResponse>
+      aggregatedListTargetPoolsSettings;
   private final UnaryCallSettings deleteTargetPoolSettings;
   private final UnaryCallSettings getTargetPoolSettings;
-  private final UnaryCallSettings getHealthTargetPoolSettings;
+  private final UnaryCallSettings
+      getHealthTargetPoolSettings;
   private final UnaryCallSettings insertTargetPoolSettings;
-  private final PagedCallSettings listTargetPoolsSettings;
-  private final UnaryCallSettings removeHealthCheckTargetPoolSettings;
-  private final UnaryCallSettings removeInstanceTargetPoolSettings;
-  private final UnaryCallSettings setBackupTargetPoolSettings;
-
-  /**
-   * Returns the object with the settings used for calls to addHealthCheckTargetPool.
-   */
-  public UnaryCallSettings addHealthCheckTargetPoolSettings() {
+  private final PagedCallSettings<
+          ListTargetPoolsHttpRequest, TargetPoolList, ListTargetPoolsPagedResponse>
+      listTargetPoolsSettings;
+  private final UnaryCallSettings
+      removeHealthCheckTargetPoolSettings;
+  private final UnaryCallSettings
+      removeInstanceTargetPoolSettings;
+  private final UnaryCallSettings
+      setBackupTargetPoolSettings;
+
+  /** Returns the object with the settings used for calls to addHealthCheckTargetPool. */
+  public UnaryCallSettings
+      addHealthCheckTargetPoolSettings() {
     return addHealthCheckTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to addInstanceTargetPool.
-   */
-  public UnaryCallSettings addInstanceTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to addInstanceTargetPool. */
+  public UnaryCallSettings
+      addInstanceTargetPoolSettings() {
     return addInstanceTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to aggregatedListTargetPools.
-   */
-  public PagedCallSettings aggregatedListTargetPoolsSettings() {
+  /** Returns the object with the settings used for calls to aggregatedListTargetPools. */
+  public PagedCallSettings<
+          AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+          AggregatedListTargetPoolsPagedResponse>
+      aggregatedListTargetPoolsSettings() {
     return aggregatedListTargetPoolsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteTargetPool.
-   */
+  /** Returns the object with the settings used for calls to deleteTargetPool. */
   public UnaryCallSettings deleteTargetPoolSettings() {
     return deleteTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetPool.
-   */
+  /** Returns the object with the settings used for calls to getTargetPool. */
   public UnaryCallSettings getTargetPoolSettings() {
     return getTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getHealthTargetPool.
-   */
-  public UnaryCallSettings getHealthTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to getHealthTargetPool. */
+  public UnaryCallSettings
+      getHealthTargetPoolSettings() {
     return getHealthTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetPool.
-   */
+  /** Returns the object with the settings used for calls to insertTargetPool. */
   public UnaryCallSettings insertTargetPoolSettings() {
     return insertTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetPools.
-   */
-  public PagedCallSettings listTargetPoolsSettings() {
+  /** Returns the object with the settings used for calls to listTargetPools. */
+  public PagedCallSettings
+      listTargetPoolsSettings() {
     return listTargetPoolsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeHealthCheckTargetPool.
-   */
-  public UnaryCallSettings removeHealthCheckTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to removeHealthCheckTargetPool. */
+  public UnaryCallSettings
+      removeHealthCheckTargetPoolSettings() {
     return removeHealthCheckTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to removeInstanceTargetPool.
-   */
-  public UnaryCallSettings removeInstanceTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to removeInstanceTargetPool. */
+  public UnaryCallSettings
+      removeInstanceTargetPoolSettings() {
     return removeInstanceTargetPoolSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setBackupTargetPool.
-   */
-  public UnaryCallSettings setBackupTargetPoolSettings() {
+  /** Returns the object with the settings used for calls to setBackupTargetPool. */
+  public UnaryCallSettings
+      setBackupTargetPoolSettings() {
     return setBackupTargetPoolSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetPoolStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -216,47 +207,34 @@ public TargetPoolStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -267,27 +245,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetPoolStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetPoolStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -303,136 +278,177 @@ protected TargetPoolStubSettings(Builder settingsBuilder) throws IOException {
     getHealthTargetPoolSettings = settingsBuilder.getHealthTargetPoolSettings().build();
     insertTargetPoolSettings = settingsBuilder.insertTargetPoolSettings().build();
     listTargetPoolsSettings = settingsBuilder.listTargetPoolsSettings().build();
-    removeHealthCheckTargetPoolSettings = settingsBuilder.removeHealthCheckTargetPoolSettings().build();
+    removeHealthCheckTargetPoolSettings =
+        settingsBuilder.removeHealthCheckTargetPoolSettings().build();
     removeInstanceTargetPoolSettings = settingsBuilder.removeInstanceTargetPoolSettings().build();
     setBackupTargetPoolSettings = settingsBuilder.setBackupTargetPoolSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListTargetPoolsHttpRequest injectToken(AggregatedListTargetPoolsHttpRequest payload, String token) {
-          return AggregatedListTargetPoolsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListTargetPoolsHttpRequest injectPageSize(AggregatedListTargetPoolsHttpRequest payload, int pageSize) {
-          return AggregatedListTargetPoolsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListTargetPoolsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetPoolAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetPoolAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_TARGET_POOLS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetPoolsHttpRequest injectToken(ListTargetPoolsHttpRequest payload, String token) {
-          return ListTargetPoolsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetPoolsHttpRequest injectPageSize(ListTargetPoolsHttpRequest payload, int pageSize) {
-          return ListTargetPoolsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetPoolsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetPoolList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetPoolList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListTargetPoolsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_DESC, request, context);
-          return AggregatedListTargetPoolsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_POOLS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetPoolsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_POOLS_PAGE_STR_DESC, request, context);
-          return ListTargetPoolsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetPoolStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, TargetPoolsScopedList>
+      AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+              TargetPoolsScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListTargetPoolsHttpRequest injectToken(
+                AggregatedListTargetPoolsHttpRequest payload, String token) {
+              return AggregatedListTargetPoolsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListTargetPoolsHttpRequest injectPageSize(
+                AggregatedListTargetPoolsHttpRequest payload, int pageSize) {
+              return AggregatedListTargetPoolsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListTargetPoolsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetPoolAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                TargetPoolAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_TARGET_POOLS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetPoolsHttpRequest injectToken(
+                ListTargetPoolsHttpRequest payload, String token) {
+              return ListTargetPoolsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListTargetPoolsHttpRequest injectPageSize(
+                ListTargetPoolsHttpRequest payload, int pageSize) {
+              return ListTargetPoolsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetPoolsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetPoolList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetPoolList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+          AggregatedListTargetPoolsPagedResponse>
+      AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+              AggregatedListTargetPoolsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListTargetPoolsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+                      TargetPoolsScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_DESC, request, context);
+              return AggregatedListTargetPoolsPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetPoolsHttpRequest, TargetPoolList, ListTargetPoolsPagedResponse>
+      LIST_TARGET_POOLS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetPoolsHttpRequest, TargetPoolList, ListTargetPoolsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetPoolsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_TARGET_POOLS_PAGE_STR_DESC, request, context);
+              return ListTargetPoolsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetPoolStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder addHealthCheckTargetPoolSettings;
-    private final UnaryCallSettings.Builder addInstanceTargetPoolSettings;
-    private final PagedCallSettings.Builder aggregatedListTargetPoolsSettings;
-    private final UnaryCallSettings.Builder deleteTargetPoolSettings;
-    private final UnaryCallSettings.Builder getTargetPoolSettings;
-    private final UnaryCallSettings.Builder getHealthTargetPoolSettings;
-    private final UnaryCallSettings.Builder insertTargetPoolSettings;
-    private final PagedCallSettings.Builder listTargetPoolsSettings;
-    private final UnaryCallSettings.Builder removeHealthCheckTargetPoolSettings;
-    private final UnaryCallSettings.Builder removeInstanceTargetPoolSettings;
-    private final UnaryCallSettings.Builder setBackupTargetPoolSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        addHealthCheckTargetPoolSettings;
+    private final UnaryCallSettings.Builder
+        addInstanceTargetPoolSettings;
+    private final PagedCallSettings.Builder<
+            AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList,
+            AggregatedListTargetPoolsPagedResponse>
+        aggregatedListTargetPoolsSettings;
+    private final UnaryCallSettings.Builder
+        deleteTargetPoolSettings;
+    private final UnaryCallSettings.Builder
+        getTargetPoolSettings;
+    private final UnaryCallSettings.Builder<
+            GetHealthTargetPoolHttpRequest, TargetPoolInstanceHealth>
+        getHealthTargetPoolSettings;
+    private final UnaryCallSettings.Builder
+        insertTargetPoolSettings;
+    private final PagedCallSettings.Builder<
+            ListTargetPoolsHttpRequest, TargetPoolList, ListTargetPoolsPagedResponse>
+        listTargetPoolsSettings;
+    private final UnaryCallSettings.Builder
+        removeHealthCheckTargetPoolSettings;
+    private final UnaryCallSettings.Builder
+        removeInstanceTargetPoolSettings;
+    private final UnaryCallSettings.Builder
+        setBackupTargetPoolSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -441,15 +457,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -465,8 +482,8 @@ protected Builder(ClientContext clientContext) {
 
       addInstanceTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      aggregatedListTargetPoolsSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_FACT);
+      aggregatedListTargetPoolsSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_TARGET_POOLS_PAGE_STR_FACT);
 
       deleteTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -476,8 +493,7 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetPoolsSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_POOLS_PAGE_STR_FACT);
+      listTargetPoolsSettings = PagedCallSettings.newBuilder(LIST_TARGET_POOLS_PAGE_STR_FACT);
 
       removeHealthCheckTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -485,19 +501,19 @@ protected Builder(ClientContext clientContext) {
 
       setBackupTargetPoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addHealthCheckTargetPoolSettings,
-          addInstanceTargetPoolSettings,
-          aggregatedListTargetPoolsSettings,
-          deleteTargetPoolSettings,
-          getTargetPoolSettings,
-          getHealthTargetPoolSettings,
-          insertTargetPoolSettings,
-          listTargetPoolsSettings,
-          removeHealthCheckTargetPoolSettings,
-          removeInstanceTargetPoolSettings,
-          setBackupTargetPoolSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addHealthCheckTargetPoolSettings,
+              addInstanceTargetPoolSettings,
+              aggregatedListTargetPoolsSettings,
+              deleteTargetPoolSettings,
+              getTargetPoolSettings,
+              getHealthTargetPoolSettings,
+              insertTargetPoolSettings,
+              listTargetPoolsSettings,
+              removeHealthCheckTargetPoolSettings,
+              removeInstanceTargetPoolSettings,
+              setBackupTargetPoolSettings);
 
       initDefaults(this);
     }
@@ -513,47 +529,58 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.addHealthCheckTargetPoolSettings()
+      builder
+          .addHealthCheckTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.addInstanceTargetPoolSettings()
+      builder
+          .addInstanceTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.aggregatedListTargetPoolsSettings()
+      builder
+          .aggregatedListTargetPoolsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteTargetPoolSettings()
+      builder
+          .deleteTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetPoolSettings()
+      builder
+          .getTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getHealthTargetPoolSettings()
+      builder
+          .getHealthTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetPoolSettings()
+      builder
+          .insertTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetPoolsSettings()
+      builder
+          .listTargetPoolsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.removeHealthCheckTargetPoolSettings()
+      builder
+          .removeHealthCheckTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.removeInstanceTargetPoolSettings()
+      builder
+          .removeInstanceTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setBackupTargetPoolSettings()
+      builder
+          .setBackupTargetPoolSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -571,31 +598,34 @@ protected Builder(TargetPoolStubSettings settings) {
       getHealthTargetPoolSettings = settings.getHealthTargetPoolSettings.toBuilder();
       insertTargetPoolSettings = settings.insertTargetPoolSettings.toBuilder();
       listTargetPoolsSettings = settings.listTargetPoolsSettings.toBuilder();
-      removeHealthCheckTargetPoolSettings = settings.removeHealthCheckTargetPoolSettings.toBuilder();
+      removeHealthCheckTargetPoolSettings =
+          settings.removeHealthCheckTargetPoolSettings.toBuilder();
       removeInstanceTargetPoolSettings = settings.removeInstanceTargetPoolSettings.toBuilder();
       setBackupTargetPoolSettings = settings.setBackupTargetPoolSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          addHealthCheckTargetPoolSettings,
-          addInstanceTargetPoolSettings,
-          aggregatedListTargetPoolsSettings,
-          deleteTargetPoolSettings,
-          getTargetPoolSettings,
-          getHealthTargetPoolSettings,
-          insertTargetPoolSettings,
-          listTargetPoolsSettings,
-          removeHealthCheckTargetPoolSettings,
-          removeInstanceTargetPoolSettings,
-          setBackupTargetPoolSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              addHealthCheckTargetPoolSettings,
+              addInstanceTargetPoolSettings,
+              aggregatedListTargetPoolsSettings,
+              deleteTargetPoolSettings,
+              getTargetPoolSettings,
+              getHealthTargetPoolSettings,
+              insertTargetPoolSettings,
+              listTargetPoolsSettings,
+              removeHealthCheckTargetPoolSettings,
+              removeInstanceTargetPoolSettings,
+              setBackupTargetPoolSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -604,80 +634,71 @@ public Builder applyToAllUnaryMethods(ApiFunction addHealthCheckTargetPoolSettings() { + /** Returns the builder for the settings used for calls to addHealthCheckTargetPool. */ + public UnaryCallSettings.Builder + addHealthCheckTargetPoolSettings() { return addHealthCheckTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to addInstanceTargetPool. - */ - public UnaryCallSettings.Builder addInstanceTargetPoolSettings() { + /** Returns the builder for the settings used for calls to addInstanceTargetPool. */ + public UnaryCallSettings.Builder + addInstanceTargetPoolSettings() { return addInstanceTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to aggregatedListTargetPools. - */ - public PagedCallSettings.Builder aggregatedListTargetPoolsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListTargetPools. */ + public PagedCallSettings.Builder< + AggregatedListTargetPoolsHttpRequest, TargetPoolAggregatedList, + AggregatedListTargetPoolsPagedResponse> + aggregatedListTargetPoolsSettings() { return aggregatedListTargetPoolsSettings; } - /** - * Returns the builder for the settings used for calls to deleteTargetPool. - */ - public UnaryCallSettings.Builder deleteTargetPoolSettings() { + /** Returns the builder for the settings used for calls to deleteTargetPool. */ + public UnaryCallSettings.Builder + deleteTargetPoolSettings() { return deleteTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to getTargetPool. - */ + /** Returns the builder for the settings used for calls to getTargetPool. */ public UnaryCallSettings.Builder getTargetPoolSettings() { return getTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to getHealthTargetPool. - */ - public UnaryCallSettings.Builder getHealthTargetPoolSettings() { + /** Returns the builder for the settings used for calls to getHealthTargetPool. */ + public UnaryCallSettings.Builder + getHealthTargetPoolSettings() { return getHealthTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to insertTargetPool. - */ - public UnaryCallSettings.Builder insertTargetPoolSettings() { + /** Returns the builder for the settings used for calls to insertTargetPool. */ + public UnaryCallSettings.Builder + insertTargetPoolSettings() { return insertTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to listTargetPools. - */ - public PagedCallSettings.Builder listTargetPoolsSettings() { + /** Returns the builder for the settings used for calls to listTargetPools. */ + public PagedCallSettings.Builder< + ListTargetPoolsHttpRequest, TargetPoolList, ListTargetPoolsPagedResponse> + listTargetPoolsSettings() { return listTargetPoolsSettings; } - /** - * Returns the builder for the settings used for calls to removeHealthCheckTargetPool. - */ - public UnaryCallSettings.Builder removeHealthCheckTargetPoolSettings() { + /** Returns the builder for the settings used for calls to removeHealthCheckTargetPool. */ + public UnaryCallSettings.Builder + removeHealthCheckTargetPoolSettings() { return removeHealthCheckTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to removeInstanceTargetPool. - */ - public UnaryCallSettings.Builder removeInstanceTargetPoolSettings() { + /** Returns the builder for the settings used for calls to removeInstanceTargetPool. */ + public UnaryCallSettings.Builder + removeInstanceTargetPoolSettings() { return removeInstanceTargetPoolSettings; } - /** - * Returns the builder for the settings used for calls to setBackupTargetPool. - */ - public UnaryCallSettings.Builder setBackupTargetPoolSettings() { + /** Returns the builder for the settings used for calls to setBackupTargetPool. */ + public UnaryCallSettings.Builder + setBackupTargetPoolSettings() { return setBackupTargetPoolSettings; } @@ -686,4 +707,4 @@ public TargetPoolStubSettings build() throws IOException { return new TargetPoolStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java index 2d36a127ea4b..3d637427df62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,16 +25,11 @@ import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetSslProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetSslProxyName; import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; -import com.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; +import com.google.cloud.compute.v1.SetSslPolicyTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.TargetSslProxy; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; import com.google.cloud.compute.v1.TargetSslProxyList; import javax.annotation.Generated; @@ -46,7 +43,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetSslProxyStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteTargetSslProxyCallable() { throw new UnsupportedOperationException("Not implemented: deleteTargetSslProxyCallable()"); @@ -63,28 +59,45 @@ public UnaryCallable insertTargetSsl } @BetaApi - public UnaryCallable listTargetSslProxiesPagedCallable() { + public UnaryCallable + listTargetSslProxiesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listTargetSslProxiesPagedCallable()"); } @BetaApi - public UnaryCallable listTargetSslProxiesCallable() { + public UnaryCallable + listTargetSslProxiesCallable() { throw new UnsupportedOperationException("Not implemented: listTargetSslProxiesCallable()"); } @BetaApi - public UnaryCallable setBackendServiceTargetSslProxyCallable() { - throw new UnsupportedOperationException("Not implemented: setBackendServiceTargetSslProxyCallable()"); + public UnaryCallable + setBackendServiceTargetSslProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setBackendServiceTargetSslProxyCallable()"); + } + + @BetaApi + public UnaryCallable + setProxyHeaderTargetSslProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setProxyHeaderTargetSslProxyCallable()"); } @BetaApi - public UnaryCallable setProxyHeaderTargetSslProxyCallable() { - throw new UnsupportedOperationException("Not implemented: setProxyHeaderTargetSslProxyCallable()"); + public UnaryCallable + setSslCertificatesTargetSslProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setSslCertificatesTargetSslProxyCallable()"); } @BetaApi - public UnaryCallable setSslCertificatesTargetSslProxyCallable() { - throw new UnsupportedOperationException("Not implemented: setSslCertificatesTargetSslProxyCallable()"); + public UnaryCallable + setSslPolicyTargetSslProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setSslPolicyTargetSslProxyCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java index 0b5b14153262..e60c858531b1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.GetTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.InsertTargetSslProxyHttpRequest; @@ -50,17 +47,15 @@ import com.google.cloud.compute.v1.SetBackendServiceTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyHttpRequest; +import com.google.cloud.compute.v1.SetSslPolicyTargetSslProxyHttpRequest; import com.google.cloud.compute.v1.TargetSslProxy; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; import com.google.cloud.compute.v1.TargetSslProxyList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -71,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetSslProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetSslProxy to 30 seconds: * *

  * 
@@ -94,75 +89,83 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetSslProxyStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteTargetSslProxySettings;
-  private final UnaryCallSettings getTargetSslProxySettings;
-  private final UnaryCallSettings insertTargetSslProxySettings;
-  private final PagedCallSettings listTargetSslProxiesSettings;
-  private final UnaryCallSettings setBackendServiceTargetSslProxySettings;
-  private final UnaryCallSettings setProxyHeaderTargetSslProxySettings;
-  private final UnaryCallSettings setSslCertificatesTargetSslProxySettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteTargetSslProxy.
-   */
-  public UnaryCallSettings deleteTargetSslProxySettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteTargetSslProxySettings;
+  private final UnaryCallSettings
+      getTargetSslProxySettings;
+  private final UnaryCallSettings
+      insertTargetSslProxySettings;
+  private final PagedCallSettings<
+          ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse>
+      listTargetSslProxiesSettings;
+  private final UnaryCallSettings
+      setBackendServiceTargetSslProxySettings;
+  private final UnaryCallSettings
+      setProxyHeaderTargetSslProxySettings;
+  private final UnaryCallSettings
+      setSslCertificatesTargetSslProxySettings;
+  private final UnaryCallSettings
+      setSslPolicyTargetSslProxySettings;
+
+  /** Returns the object with the settings used for calls to deleteTargetSslProxy. */
+  public UnaryCallSettings
+      deleteTargetSslProxySettings() {
     return deleteTargetSslProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetSslProxy.
-   */
-  public UnaryCallSettings getTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetSslProxy. */
+  public UnaryCallSettings
+      getTargetSslProxySettings() {
     return getTargetSslProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetSslProxy.
-   */
-  public UnaryCallSettings insertTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetSslProxy. */
+  public UnaryCallSettings
+      insertTargetSslProxySettings() {
     return insertTargetSslProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetSslProxies.
-   */
-  public PagedCallSettings listTargetSslProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetSslProxies. */
+  public PagedCallSettings<
+          ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse>
+      listTargetSslProxiesSettings() {
     return listTargetSslProxiesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setBackendServiceTargetSslProxy.
-   */
-  public UnaryCallSettings setBackendServiceTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to setBackendServiceTargetSslProxy. */
+  public UnaryCallSettings
+      setBackendServiceTargetSslProxySettings() {
     return setBackendServiceTargetSslProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setProxyHeaderTargetSslProxy.
-   */
-  public UnaryCallSettings setProxyHeaderTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to setProxyHeaderTargetSslProxy. */
+  public UnaryCallSettings
+      setProxyHeaderTargetSslProxySettings() {
     return setProxyHeaderTargetSslProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setSslCertificatesTargetSslProxy.
-   */
-  public UnaryCallSettings setSslCertificatesTargetSslProxySettings() {
+  /** Returns the object with the settings used for calls to setSslCertificatesTargetSslProxy. */
+  public UnaryCallSettings
+      setSslCertificatesTargetSslProxySettings() {
     return setSslCertificatesTargetSslProxySettings;
   }
 
+  /** Returns the object with the settings used for calls to setSslPolicyTargetSslProxy. */
+  public UnaryCallSettings
+      setSslPolicyTargetSslProxySettings() {
+    return setSslPolicyTargetSslProxySettings;
+  }
 
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetSslProxyStub createStub() throws IOException {
@@ -176,47 +179,34 @@ public TargetSslProxyStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -227,27 +217,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetSslProxyStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetSslProxyStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -259,84 +246,112 @@ protected TargetSslProxyStubSettings(Builder settingsBuilder) throws IOException
     getTargetSslProxySettings = settingsBuilder.getTargetSslProxySettings().build();
     insertTargetSslProxySettings = settingsBuilder.insertTargetSslProxySettings().build();
     listTargetSslProxiesSettings = settingsBuilder.listTargetSslProxiesSettings().build();
-    setBackendServiceTargetSslProxySettings = settingsBuilder.setBackendServiceTargetSslProxySettings().build();
-    setProxyHeaderTargetSslProxySettings = settingsBuilder.setProxyHeaderTargetSslProxySettings().build();
-    setSslCertificatesTargetSslProxySettings = settingsBuilder.setSslCertificatesTargetSslProxySettings().build();
+    setBackendServiceTargetSslProxySettings =
+        settingsBuilder.setBackendServiceTargetSslProxySettings().build();
+    setProxyHeaderTargetSslProxySettings =
+        settingsBuilder.setProxyHeaderTargetSslProxySettings().build();
+    setSslCertificatesTargetSslProxySettings =
+        settingsBuilder.setSslCertificatesTargetSslProxySettings().build();
+    setSslPolicyTargetSslProxySettings =
+        settingsBuilder.setSslPolicyTargetSslProxySettings().build();
   }
 
-  private static final PagedListDescriptor LIST_TARGET_SSL_PROXIES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetSslProxiesHttpRequest injectToken(ListTargetSslProxiesHttpRequest payload, String token) {
-          return ListTargetSslProxiesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetSslProxiesHttpRequest injectPageSize(ListTargetSslProxiesHttpRequest payload, int pageSize) {
-          return ListTargetSslProxiesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetSslProxiesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetSslProxyList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetSslProxyList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_SSL_PROXIES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetSslProxiesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_SSL_PROXIES_PAGE_STR_DESC, request, context);
-          return ListTargetSslProxiesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetSslProxyStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListTargetSslProxiesHttpRequest, TargetSslProxyList, TargetSslProxy>
+      LIST_TARGET_SSL_PROXIES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListTargetSslProxiesHttpRequest, TargetSslProxyList, TargetSslProxy>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetSslProxiesHttpRequest injectToken(
+                ListTargetSslProxiesHttpRequest payload, String token) {
+              return ListTargetSslProxiesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListTargetSslProxiesHttpRequest injectPageSize(
+                ListTargetSslProxiesHttpRequest payload, int pageSize) {
+              return ListTargetSslProxiesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetSslProxiesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetSslProxyList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetSslProxyList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse>
+      LIST_TARGET_SSL_PROXIES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetSslProxiesHttpRequest, TargetSslProxyList,
+              ListTargetSslProxiesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetSslProxiesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_TARGET_SSL_PROXIES_PAGE_STR_DESC, request, context);
+              return ListTargetSslProxiesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetSslProxyStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteTargetSslProxySettings;
-    private final UnaryCallSettings.Builder getTargetSslProxySettings;
-    private final UnaryCallSettings.Builder insertTargetSslProxySettings;
-    private final PagedCallSettings.Builder listTargetSslProxiesSettings;
-    private final UnaryCallSettings.Builder setBackendServiceTargetSslProxySettings;
-    private final UnaryCallSettings.Builder setProxyHeaderTargetSslProxySettings;
-    private final UnaryCallSettings.Builder setSslCertificatesTargetSslProxySettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteTargetSslProxySettings;
+    private final UnaryCallSettings.Builder
+        getTargetSslProxySettings;
+    private final UnaryCallSettings.Builder
+        insertTargetSslProxySettings;
+    private final PagedCallSettings.Builder<
+            ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse>
+        listTargetSslProxiesSettings;
+    private final UnaryCallSettings.Builder
+        setBackendServiceTargetSslProxySettings;
+    private final UnaryCallSettings.Builder
+        setProxyHeaderTargetSslProxySettings;
+    private final UnaryCallSettings.Builder
+        setSslCertificatesTargetSslProxySettings;
+    private final UnaryCallSettings.Builder
+        setSslPolicyTargetSslProxySettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -345,15 +360,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -371,8 +387,8 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetSslProxiesSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_SSL_PROXIES_PAGE_STR_FACT);
+      listTargetSslProxiesSettings =
+          PagedCallSettings.newBuilder(LIST_TARGET_SSL_PROXIES_PAGE_STR_FACT);
 
       setBackendServiceTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -380,15 +396,18 @@ protected Builder(ClientContext clientContext) {
 
       setSslCertificatesTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetSslProxySettings,
-          getTargetSslProxySettings,
-          insertTargetSslProxySettings,
-          listTargetSslProxiesSettings,
-          setBackendServiceTargetSslProxySettings,
-          setProxyHeaderTargetSslProxySettings,
-          setSslCertificatesTargetSslProxySettings
-      );
+      setSslPolicyTargetSslProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetSslProxySettings,
+              getTargetSslProxySettings,
+              insertTargetSslProxySettings,
+              listTargetSslProxiesSettings,
+              setBackendServiceTargetSslProxySettings,
+              setProxyHeaderTargetSslProxySettings,
+              setSslCertificatesTargetSslProxySettings,
+              setSslPolicyTargetSslProxySettings);
 
       initDefaults(this);
     }
@@ -404,31 +423,43 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteTargetSslProxySettings()
+      builder
+          .deleteTargetSslProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetSslProxySettings()
+      builder
+          .getTargetSslProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetSslProxySettings()
+      builder
+          .insertTargetSslProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetSslProxiesSettings()
+      builder
+          .listTargetSslProxiesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setBackendServiceTargetSslProxySettings()
+      builder
+          .setBackendServiceTargetSslProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setProxyHeaderTargetSslProxySettings()
+      builder
+          .setProxyHeaderTargetSslProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setSslCertificatesTargetSslProxySettings()
+      builder
+          .setSslCertificatesTargetSslProxySettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder
+          .setSslPolicyTargetSslProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -442,27 +473,34 @@ protected Builder(TargetSslProxyStubSettings settings) {
       getTargetSslProxySettings = settings.getTargetSslProxySettings.toBuilder();
       insertTargetSslProxySettings = settings.insertTargetSslProxySettings.toBuilder();
       listTargetSslProxiesSettings = settings.listTargetSslProxiesSettings.toBuilder();
-      setBackendServiceTargetSslProxySettings = settings.setBackendServiceTargetSslProxySettings.toBuilder();
-      setProxyHeaderTargetSslProxySettings = settings.setProxyHeaderTargetSslProxySettings.toBuilder();
-      setSslCertificatesTargetSslProxySettings = settings.setSslCertificatesTargetSslProxySettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetSslProxySettings,
-          getTargetSslProxySettings,
-          insertTargetSslProxySettings,
-          listTargetSslProxiesSettings,
-          setBackendServiceTargetSslProxySettings,
-          setProxyHeaderTargetSslProxySettings,
-          setSslCertificatesTargetSslProxySettings
-      );
+      setBackendServiceTargetSslProxySettings =
+          settings.setBackendServiceTargetSslProxySettings.toBuilder();
+      setProxyHeaderTargetSslProxySettings =
+          settings.setProxyHeaderTargetSslProxySettings.toBuilder();
+      setSslCertificatesTargetSslProxySettings =
+          settings.setSslCertificatesTargetSslProxySettings.toBuilder();
+      setSslPolicyTargetSslProxySettings = settings.setSslPolicyTargetSslProxySettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetSslProxySettings,
+              getTargetSslProxySettings,
+              insertTargetSslProxySettings,
+              listTargetSslProxiesSettings,
+              setBackendServiceTargetSslProxySettings,
+              setProxyHeaderTargetSslProxySettings,
+              setSslCertificatesTargetSslProxySettings,
+              setSslPolicyTargetSslProxySettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -471,58 +509,58 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetSslProxy. */ + public UnaryCallSettings.Builder + deleteTargetSslProxySettings() { return deleteTargetSslProxySettings; } - /** - * Returns the builder for the settings used for calls to getTargetSslProxy. - */ - public UnaryCallSettings.Builder getTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to getTargetSslProxy. */ + public UnaryCallSettings.Builder + getTargetSslProxySettings() { return getTargetSslProxySettings; } - /** - * Returns the builder for the settings used for calls to insertTargetSslProxy. - */ - public UnaryCallSettings.Builder insertTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetSslProxy. */ + public UnaryCallSettings.Builder + insertTargetSslProxySettings() { return insertTargetSslProxySettings; } - /** - * Returns the builder for the settings used for calls to listTargetSslProxies. - */ - public PagedCallSettings.Builder listTargetSslProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetSslProxies. */ + public PagedCallSettings.Builder< + ListTargetSslProxiesHttpRequest, TargetSslProxyList, ListTargetSslProxiesPagedResponse> + listTargetSslProxiesSettings() { return listTargetSslProxiesSettings; } - /** - * Returns the builder for the settings used for calls to setBackendServiceTargetSslProxy. - */ - public UnaryCallSettings.Builder setBackendServiceTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to setBackendServiceTargetSslProxy. */ + public UnaryCallSettings.Builder + setBackendServiceTargetSslProxySettings() { return setBackendServiceTargetSslProxySettings; } - /** - * Returns the builder for the settings used for calls to setProxyHeaderTargetSslProxy. - */ - public UnaryCallSettings.Builder setProxyHeaderTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to setProxyHeaderTargetSslProxy. */ + public UnaryCallSettings.Builder + setProxyHeaderTargetSslProxySettings() { return setProxyHeaderTargetSslProxySettings; } - /** - * Returns the builder for the settings used for calls to setSslCertificatesTargetSslProxy. - */ - public UnaryCallSettings.Builder setSslCertificatesTargetSslProxySettings() { + /** Returns the builder for the settings used for calls to setSslCertificatesTargetSslProxy. */ + public UnaryCallSettings.Builder + setSslCertificatesTargetSslProxySettings() { return setSslCertificatesTargetSslProxySettings; } + /** Returns the builder for the settings used for calls to setSslPolicyTargetSslProxy. */ + public UnaryCallSettings.Builder + setSslPolicyTargetSslProxySettings() { + return setSslPolicyTargetSslProxySettings; + } + @Override public TargetSslProxyStubSettings build() throws IOException { return new TargetSslProxyStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java index 99e6a24bb1bd..12b024437bc1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,14 +25,9 @@ import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetTcpProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectTargetTcpProxyName; import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; -import com.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; -import com.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; import com.google.cloud.compute.v1.TargetTcpProxy; -import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; import com.google.cloud.compute.v1.TargetTcpProxyList; import javax.annotation.Generated; @@ -44,7 +41,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetTcpProxyStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteTargetTcpProxyCallable() { throw new UnsupportedOperationException("Not implemented: deleteTargetTcpProxyCallable()"); @@ -61,23 +57,31 @@ public UnaryCallable insertTargetTcp } @BetaApi - public UnaryCallable listTargetTcpProxiesPagedCallable() { + public UnaryCallable + listTargetTcpProxiesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listTargetTcpProxiesPagedCallable()"); } @BetaApi - public UnaryCallable listTargetTcpProxiesCallable() { + public UnaryCallable + listTargetTcpProxiesCallable() { throw new UnsupportedOperationException("Not implemented: listTargetTcpProxiesCallable()"); } @BetaApi - public UnaryCallable setBackendServiceTargetTcpProxyCallable() { - throw new UnsupportedOperationException("Not implemented: setBackendServiceTargetTcpProxyCallable()"); + public UnaryCallable + setBackendServiceTargetTcpProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setBackendServiceTargetTcpProxyCallable()"); } @BetaApi - public UnaryCallable setProxyHeaderTargetTcpProxyCallable() { - throw new UnsupportedOperationException("Not implemented: setProxyHeaderTargetTcpProxyCallable()"); + public UnaryCallable + setProxyHeaderTargetTcpProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setProxyHeaderTargetTcpProxyCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java index 97ef3380a24f..4694ee986881 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.GetTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.InsertTargetTcpProxyHttpRequest; @@ -50,16 +47,13 @@ import com.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyHttpRequest; import com.google.cloud.compute.v1.TargetTcpProxy; -import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; import com.google.cloud.compute.v1.TargetTcpProxyList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -70,15 +64,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetTcpProxy to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetTcpProxy to 30 seconds: * *

  * 
@@ -93,68 +87,68 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetTcpProxyStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final UnaryCallSettings deleteTargetTcpProxySettings;
-  private final UnaryCallSettings getTargetTcpProxySettings;
-  private final UnaryCallSettings insertTargetTcpProxySettings;
-  private final PagedCallSettings listTargetTcpProxiesSettings;
-  private final UnaryCallSettings setBackendServiceTargetTcpProxySettings;
-  private final UnaryCallSettings setProxyHeaderTargetTcpProxySettings;
-
-  /**
-   * Returns the object with the settings used for calls to deleteTargetTcpProxy.
-   */
-  public UnaryCallSettings deleteTargetTcpProxySettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final UnaryCallSettings
+      deleteTargetTcpProxySettings;
+  private final UnaryCallSettings
+      getTargetTcpProxySettings;
+  private final UnaryCallSettings
+      insertTargetTcpProxySettings;
+  private final PagedCallSettings<
+          ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse>
+      listTargetTcpProxiesSettings;
+  private final UnaryCallSettings
+      setBackendServiceTargetTcpProxySettings;
+  private final UnaryCallSettings
+      setProxyHeaderTargetTcpProxySettings;
+
+  /** Returns the object with the settings used for calls to deleteTargetTcpProxy. */
+  public UnaryCallSettings
+      deleteTargetTcpProxySettings() {
     return deleteTargetTcpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetTcpProxy.
-   */
-  public UnaryCallSettings getTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to getTargetTcpProxy. */
+  public UnaryCallSettings
+      getTargetTcpProxySettings() {
     return getTargetTcpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetTcpProxy.
-   */
-  public UnaryCallSettings insertTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to insertTargetTcpProxy. */
+  public UnaryCallSettings
+      insertTargetTcpProxySettings() {
     return insertTargetTcpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetTcpProxies.
-   */
-  public PagedCallSettings listTargetTcpProxiesSettings() {
+  /** Returns the object with the settings used for calls to listTargetTcpProxies. */
+  public PagedCallSettings<
+          ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse>
+      listTargetTcpProxiesSettings() {
     return listTargetTcpProxiesSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setBackendServiceTargetTcpProxy.
-   */
-  public UnaryCallSettings setBackendServiceTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to setBackendServiceTargetTcpProxy. */
+  public UnaryCallSettings
+      setBackendServiceTargetTcpProxySettings() {
     return setBackendServiceTargetTcpProxySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to setProxyHeaderTargetTcpProxy.
-   */
-  public UnaryCallSettings setProxyHeaderTargetTcpProxySettings() {
+  /** Returns the object with the settings used for calls to setProxyHeaderTargetTcpProxy. */
+  public UnaryCallSettings
+      setProxyHeaderTargetTcpProxySettings() {
     return setProxyHeaderTargetTcpProxySettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetTcpProxyStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -167,47 +161,34 @@ public TargetTcpProxyStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -218,27 +199,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetTcpProxyStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetTcpProxyStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -250,82 +228,104 @@ protected TargetTcpProxyStubSettings(Builder settingsBuilder) throws IOException
     getTargetTcpProxySettings = settingsBuilder.getTargetTcpProxySettings().build();
     insertTargetTcpProxySettings = settingsBuilder.insertTargetTcpProxySettings().build();
     listTargetTcpProxiesSettings = settingsBuilder.listTargetTcpProxiesSettings().build();
-    setBackendServiceTargetTcpProxySettings = settingsBuilder.setBackendServiceTargetTcpProxySettings().build();
-    setProxyHeaderTargetTcpProxySettings = settingsBuilder.setProxyHeaderTargetTcpProxySettings().build();
+    setBackendServiceTargetTcpProxySettings =
+        settingsBuilder.setBackendServiceTargetTcpProxySettings().build();
+    setProxyHeaderTargetTcpProxySettings =
+        settingsBuilder.setProxyHeaderTargetTcpProxySettings().build();
   }
 
-  private static final PagedListDescriptor LIST_TARGET_TCP_PROXIES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetTcpProxiesHttpRequest injectToken(ListTargetTcpProxiesHttpRequest payload, String token) {
-          return ListTargetTcpProxiesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetTcpProxiesHttpRequest injectPageSize(ListTargetTcpProxiesHttpRequest payload, int pageSize) {
-          return ListTargetTcpProxiesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetTcpProxiesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetTcpProxyList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetTcpProxyList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_TCP_PROXIES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetTcpProxiesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_TCP_PROXIES_PAGE_STR_DESC, request, context);
-          return ListTargetTcpProxiesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetTcpProxyStubSettings.
-   */
+  private static final PagedListDescriptor<
+          ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, TargetTcpProxy>
+      LIST_TARGET_TCP_PROXIES_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, TargetTcpProxy>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetTcpProxiesHttpRequest injectToken(
+                ListTargetTcpProxiesHttpRequest payload, String token) {
+              return ListTargetTcpProxiesHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListTargetTcpProxiesHttpRequest injectPageSize(
+                ListTargetTcpProxiesHttpRequest payload, int pageSize) {
+              return ListTargetTcpProxiesHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetTcpProxiesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetTcpProxyList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetTcpProxyList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse>
+      LIST_TARGET_TCP_PROXIES_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetTcpProxiesHttpRequest, TargetTcpProxyList,
+              ListTargetTcpProxiesPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetTcpProxiesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_TARGET_TCP_PROXIES_PAGE_STR_DESC, request, context);
+              return ListTargetTcpProxiesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetTcpProxyStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteTargetTcpProxySettings;
-    private final UnaryCallSettings.Builder getTargetTcpProxySettings;
-    private final UnaryCallSettings.Builder insertTargetTcpProxySettings;
-    private final PagedCallSettings.Builder listTargetTcpProxiesSettings;
-    private final UnaryCallSettings.Builder setBackendServiceTargetTcpProxySettings;
-    private final UnaryCallSettings.Builder setProxyHeaderTargetTcpProxySettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final UnaryCallSettings.Builder
+        deleteTargetTcpProxySettings;
+    private final UnaryCallSettings.Builder
+        getTargetTcpProxySettings;
+    private final UnaryCallSettings.Builder
+        insertTargetTcpProxySettings;
+    private final PagedCallSettings.Builder<
+            ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse>
+        listTargetTcpProxiesSettings;
+    private final UnaryCallSettings.Builder
+        setBackendServiceTargetTcpProxySettings;
+    private final UnaryCallSettings.Builder
+        setProxyHeaderTargetTcpProxySettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,15 +334,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -360,21 +361,21 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetTcpProxiesSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_TCP_PROXIES_PAGE_STR_FACT);
+      listTargetTcpProxiesSettings =
+          PagedCallSettings.newBuilder(LIST_TARGET_TCP_PROXIES_PAGE_STR_FACT);
 
       setBackendServiceTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       setProxyHeaderTargetTcpProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetTcpProxySettings,
-          getTargetTcpProxySettings,
-          insertTargetTcpProxySettings,
-          listTargetTcpProxiesSettings,
-          setBackendServiceTargetTcpProxySettings,
-          setProxyHeaderTargetTcpProxySettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetTcpProxySettings,
+              getTargetTcpProxySettings,
+              insertTargetTcpProxySettings,
+              listTargetTcpProxiesSettings,
+              setBackendServiceTargetTcpProxySettings,
+              setProxyHeaderTargetTcpProxySettings);
 
       initDefaults(this);
     }
@@ -390,27 +391,33 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteTargetTcpProxySettings()
+      builder
+          .deleteTargetTcpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetTcpProxySettings()
+      builder
+          .getTargetTcpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetTcpProxySettings()
+      builder
+          .insertTargetTcpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetTcpProxiesSettings()
+      builder
+          .listTargetTcpProxiesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setBackendServiceTargetTcpProxySettings()
+      builder
+          .setBackendServiceTargetTcpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.setProxyHeaderTargetTcpProxySettings()
+      builder
+          .setProxyHeaderTargetTcpProxySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -424,25 +431,29 @@ protected Builder(TargetTcpProxyStubSettings settings) {
       getTargetTcpProxySettings = settings.getTargetTcpProxySettings.toBuilder();
       insertTargetTcpProxySettings = settings.insertTargetTcpProxySettings.toBuilder();
       listTargetTcpProxiesSettings = settings.listTargetTcpProxiesSettings.toBuilder();
-      setBackendServiceTargetTcpProxySettings = settings.setBackendServiceTargetTcpProxySettings.toBuilder();
-      setProxyHeaderTargetTcpProxySettings = settings.setProxyHeaderTargetTcpProxySettings.toBuilder();
-
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteTargetTcpProxySettings,
-          getTargetTcpProxySettings,
-          insertTargetTcpProxySettings,
-          listTargetTcpProxiesSettings,
-          setBackendServiceTargetTcpProxySettings,
-          setProxyHeaderTargetTcpProxySettings
-      );
+      setBackendServiceTargetTcpProxySettings =
+          settings.setBackendServiceTargetTcpProxySettings.toBuilder();
+      setProxyHeaderTargetTcpProxySettings =
+          settings.setProxyHeaderTargetTcpProxySettings.toBuilder();
+
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteTargetTcpProxySettings,
+              getTargetTcpProxySettings,
+              insertTargetTcpProxySettings,
+              listTargetTcpProxiesSettings,
+              setBackendServiceTargetTcpProxySettings,
+              setProxyHeaderTargetTcpProxySettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -451,45 +462,40 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to deleteTargetTcpProxy. */ + public UnaryCallSettings.Builder + deleteTargetTcpProxySettings() { return deleteTargetTcpProxySettings; } - /** - * Returns the builder for the settings used for calls to getTargetTcpProxy. - */ - public UnaryCallSettings.Builder getTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to getTargetTcpProxy. */ + public UnaryCallSettings.Builder + getTargetTcpProxySettings() { return getTargetTcpProxySettings; } - /** - * Returns the builder for the settings used for calls to insertTargetTcpProxy. - */ - public UnaryCallSettings.Builder insertTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to insertTargetTcpProxy. */ + public UnaryCallSettings.Builder + insertTargetTcpProxySettings() { return insertTargetTcpProxySettings; } - /** - * Returns the builder for the settings used for calls to listTargetTcpProxies. - */ - public PagedCallSettings.Builder listTargetTcpProxiesSettings() { + /** Returns the builder for the settings used for calls to listTargetTcpProxies. */ + public PagedCallSettings.Builder< + ListTargetTcpProxiesHttpRequest, TargetTcpProxyList, ListTargetTcpProxiesPagedResponse> + listTargetTcpProxiesSettings() { return listTargetTcpProxiesSettings; } - /** - * Returns the builder for the settings used for calls to setBackendServiceTargetTcpProxy. - */ - public UnaryCallSettings.Builder setBackendServiceTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to setBackendServiceTargetTcpProxy. */ + public UnaryCallSettings.Builder + setBackendServiceTargetTcpProxySettings() { return setBackendServiceTargetTcpProxySettings; } - /** - * Returns the builder for the settings used for calls to setProxyHeaderTargetTcpProxy. - */ - public UnaryCallSettings.Builder setProxyHeaderTargetTcpProxySettings() { + /** Returns the builder for the settings used for calls to setProxyHeaderTargetTcpProxy. */ + public UnaryCallSettings.Builder + setProxyHeaderTargetTcpProxySettings() { return setProxyHeaderTargetTcpProxySettings; } @@ -498,4 +504,4 @@ public TargetTcpProxyStubSettings build() throws IOException { return new TargetTcpProxyStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java index 660da543e491..5750bae9d53c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -24,15 +27,9 @@ import com.google.cloud.compute.v1.InsertTargetVpnGatewayHttpRequest; import com.google.cloud.compute.v1.ListTargetVpnGatewaysHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionTargetVpnGatewayName; import com.google.cloud.compute.v1.TargetVpnGateway; import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; import com.google.cloud.compute.v1.TargetVpnGatewayList; -import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -45,40 +42,52 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetVpnGatewayStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListTargetVpnGatewaysPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListTargetVpnGatewaysPagedCallable()"); + public UnaryCallable< + AggregatedListTargetVpnGatewaysHttpRequest, AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListTargetVpnGatewaysPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListTargetVpnGatewaysCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListTargetVpnGatewaysCallable()"); + public UnaryCallable + aggregatedListTargetVpnGatewaysCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListTargetVpnGatewaysCallable()"); } @BetaApi - public UnaryCallable deleteTargetVpnGatewayCallable() { + public UnaryCallable + deleteTargetVpnGatewayCallable() { throw new UnsupportedOperationException("Not implemented: deleteTargetVpnGatewayCallable()"); } @BetaApi - public UnaryCallable getTargetVpnGatewayCallable() { + public UnaryCallable + getTargetVpnGatewayCallable() { throw new UnsupportedOperationException("Not implemented: getTargetVpnGatewayCallable()"); } @BetaApi - public UnaryCallable insertTargetVpnGatewayCallable() { + public UnaryCallable + insertTargetVpnGatewayCallable() { throw new UnsupportedOperationException("Not implemented: insertTargetVpnGatewayCallable()"); } @BetaApi - public UnaryCallable listTargetVpnGatewaysPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTargetVpnGatewaysPagedCallable()"); + public UnaryCallable + listTargetVpnGatewaysPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listTargetVpnGatewaysPagedCallable()"); } @BetaApi - public UnaryCallable listTargetVpnGatewaysCallable() { + public UnaryCallable + listTargetVpnGatewaysCallable() { throw new UnsupportedOperationException("Not implemented: listTargetVpnGatewaysCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java index 939fbd47a303..8050fc10b8a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysHttpRequest; import com.google.cloud.compute.v1.DeleteTargetVpnGatewayHttpRequest; import com.google.cloud.compute.v1.GetTargetVpnGatewayHttpRequest; @@ -50,18 +48,14 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.TargetVpnGateway; import com.google.cloud.compute.v1.TargetVpnGatewayAggregatedList; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; import com.google.cloud.compute.v1.TargetVpnGatewayList; import com.google.cloud.compute.v1.TargetVpnGatewaysScopedList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteTargetVpnGateway to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteTargetVpnGateway to 30 seconds: * *

  * 
@@ -95,60 +89,66 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class TargetVpnGatewayStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListTargetVpnGatewaysSettings;
-  private final UnaryCallSettings deleteTargetVpnGatewaySettings;
-  private final UnaryCallSettings getTargetVpnGatewaySettings;
-  private final UnaryCallSettings insertTargetVpnGatewaySettings;
-  private final PagedCallSettings listTargetVpnGatewaysSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListTargetVpnGateways.
-   */
-  public PagedCallSettings aggregatedListTargetVpnGatewaysSettings() {
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+          AggregatedListTargetVpnGatewaysPagedResponse>
+      aggregatedListTargetVpnGatewaysSettings;
+  private final UnaryCallSettings
+      deleteTargetVpnGatewaySettings;
+  private final UnaryCallSettings
+      getTargetVpnGatewaySettings;
+  private final UnaryCallSettings
+      insertTargetVpnGatewaySettings;
+  private final PagedCallSettings<
+          ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList,
+          ListTargetVpnGatewaysPagedResponse>
+      listTargetVpnGatewaysSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListTargetVpnGateways. */
+  public PagedCallSettings<
+          AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+          AggregatedListTargetVpnGatewaysPagedResponse>
+      aggregatedListTargetVpnGatewaysSettings() {
     return aggregatedListTargetVpnGatewaysSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteTargetVpnGateway.
-   */
-  public UnaryCallSettings deleteTargetVpnGatewaySettings() {
+  /** Returns the object with the settings used for calls to deleteTargetVpnGateway. */
+  public UnaryCallSettings
+      deleteTargetVpnGatewaySettings() {
     return deleteTargetVpnGatewaySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getTargetVpnGateway.
-   */
-  public UnaryCallSettings getTargetVpnGatewaySettings() {
+  /** Returns the object with the settings used for calls to getTargetVpnGateway. */
+  public UnaryCallSettings
+      getTargetVpnGatewaySettings() {
     return getTargetVpnGatewaySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertTargetVpnGateway.
-   */
-  public UnaryCallSettings insertTargetVpnGatewaySettings() {
+  /** Returns the object with the settings used for calls to insertTargetVpnGateway. */
+  public UnaryCallSettings
+      insertTargetVpnGatewaySettings() {
     return insertTargetVpnGatewaySettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listTargetVpnGateways.
-   */
-  public PagedCallSettings listTargetVpnGatewaysSettings() {
+  /** Returns the object with the settings used for calls to listTargetVpnGateways. */
+  public PagedCallSettings<
+          ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList,
+          ListTargetVpnGatewaysPagedResponse>
+      listTargetVpnGatewaysSettings() {
     return listTargetVpnGatewaysSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public TargetVpnGatewayStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -161,47 +161,34 @@ public TargetVpnGatewayStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -212,27 +199,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TargetVpnGatewayStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(TargetVpnGatewayStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -240,132 +224,182 @@ public Builder toBuilder() {
   protected TargetVpnGatewayStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    aggregatedListTargetVpnGatewaysSettings = settingsBuilder.aggregatedListTargetVpnGatewaysSettings().build();
+    aggregatedListTargetVpnGatewaysSettings =
+        settingsBuilder.aggregatedListTargetVpnGatewaysSettings().build();
     deleteTargetVpnGatewaySettings = settingsBuilder.deleteTargetVpnGatewaySettings().build();
     getTargetVpnGatewaySettings = settingsBuilder.getTargetVpnGatewaySettings().build();
     insertTargetVpnGatewaySettings = settingsBuilder.insertTargetVpnGatewaySettings().build();
     listTargetVpnGatewaysSettings = settingsBuilder.listTargetVpnGatewaysSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListTargetVpnGatewaysHttpRequest injectToken(AggregatedListTargetVpnGatewaysHttpRequest payload, String token) {
-          return AggregatedListTargetVpnGatewaysHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListTargetVpnGatewaysHttpRequest injectPageSize(AggregatedListTargetVpnGatewaysHttpRequest payload, int pageSize) {
-          return AggregatedListTargetVpnGatewaysHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListTargetVpnGatewaysHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetVpnGatewayAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetVpnGatewayAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListTargetVpnGatewaysHttpRequest injectToken(ListTargetVpnGatewaysHttpRequest payload, String token) {
-          return ListTargetVpnGatewaysHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListTargetVpnGatewaysHttpRequest injectPageSize(ListTargetVpnGatewaysHttpRequest payload, int pageSize) {
-          return ListTargetVpnGatewaysHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListTargetVpnGatewaysHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(TargetVpnGatewayList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(TargetVpnGatewayList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListTargetVpnGatewaysHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC, request, context);
-          return AggregatedListTargetVpnGatewaysPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListTargetVpnGatewaysHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC, request, context);
-          return ListTargetVpnGatewaysPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for TargetVpnGatewayStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+          TargetVpnGatewaysScopedList>
+      AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+              TargetVpnGatewaysScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListTargetVpnGatewaysHttpRequest injectToken(
+                AggregatedListTargetVpnGatewaysHttpRequest payload, String token) {
+              return AggregatedListTargetVpnGatewaysHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListTargetVpnGatewaysHttpRequest injectPageSize(
+                AggregatedListTargetVpnGatewaysHttpRequest payload, int pageSize) {
+              return AggregatedListTargetVpnGatewaysHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListTargetVpnGatewaysHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetVpnGatewayAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                TargetVpnGatewayAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor<
+          ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, TargetVpnGateway>
+      LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, TargetVpnGateway>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListTargetVpnGatewaysHttpRequest injectToken(
+                ListTargetVpnGatewaysHttpRequest payload, String token) {
+              return ListTargetVpnGatewaysHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public ListTargetVpnGatewaysHttpRequest injectPageSize(
+                ListTargetVpnGatewaysHttpRequest payload, int pageSize) {
+              return ListTargetVpnGatewaysHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListTargetVpnGatewaysHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(TargetVpnGatewayList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(TargetVpnGatewayList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+          AggregatedListTargetVpnGatewaysPagedResponse>
+      AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+              AggregatedListTargetVpnGatewaysPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable<
+                        AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList>
+                    callable,
+                AggregatedListTargetVpnGatewaysHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+                      TargetVpnGatewaysScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable,
+                          AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC,
+                          request,
+                          context);
+              return AggregatedListTargetVpnGatewaysPagedResponse.createAsync(
+                  pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList,
+          ListTargetVpnGatewaysPagedResponse>
+      LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList,
+              ListTargetVpnGatewaysPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListTargetVpnGatewaysHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext
+                  pageContext =
+                      PageContext.create(
+                          callable, LIST_TARGET_VPN_GATEWAYS_PAGE_STR_DESC, request, context);
+              return ListTargetVpnGatewaysPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for TargetVpnGatewayStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListTargetVpnGatewaysSettings;
-    private final UnaryCallSettings.Builder deleteTargetVpnGatewaySettings;
-    private final UnaryCallSettings.Builder getTargetVpnGatewaySettings;
-    private final UnaryCallSettings.Builder insertTargetVpnGatewaySettings;
-    private final PagedCallSettings.Builder listTargetVpnGatewaysSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList,
+            AggregatedListTargetVpnGatewaysPagedResponse>
+        aggregatedListTargetVpnGatewaysSettings;
+    private final UnaryCallSettings.Builder
+        deleteTargetVpnGatewaySettings;
+    private final UnaryCallSettings.Builder
+        getTargetVpnGatewaySettings;
+    private final UnaryCallSettings.Builder
+        insertTargetVpnGatewaySettings;
+    private final PagedCallSettings.Builder<
+            ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList,
+            ListTargetVpnGatewaysPagedResponse>
+        listTargetVpnGatewaysSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -374,15 +408,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -394,8 +429,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListTargetVpnGatewaysSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT);
+      aggregatedListTargetVpnGatewaysSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT);
 
       deleteTargetVpnGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -403,16 +438,16 @@ protected Builder(ClientContext clientContext) {
 
       insertTargetVpnGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listTargetVpnGatewaysSettings = PagedCallSettings.newBuilder(
-          LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT);
+      listTargetVpnGatewaysSettings =
+          PagedCallSettings.newBuilder(LIST_TARGET_VPN_GATEWAYS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListTargetVpnGatewaysSettings,
-          deleteTargetVpnGatewaySettings,
-          getTargetVpnGatewaySettings,
-          insertTargetVpnGatewaySettings,
-          listTargetVpnGatewaysSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListTargetVpnGatewaysSettings,
+              deleteTargetVpnGatewaySettings,
+              getTargetVpnGatewaySettings,
+              insertTargetVpnGatewaySettings,
+              listTargetVpnGatewaysSettings);
 
       initDefaults(this);
     }
@@ -428,23 +463,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListTargetVpnGatewaysSettings()
+      builder
+          .aggregatedListTargetVpnGatewaysSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteTargetVpnGatewaySettings()
+      builder
+          .deleteTargetVpnGatewaySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getTargetVpnGatewaySettings()
+      builder
+          .getTargetVpnGatewaySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertTargetVpnGatewaySettings()
+      builder
+          .insertTargetVpnGatewaySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listTargetVpnGatewaysSettings()
+      builder
+          .listTargetVpnGatewaysSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -454,27 +494,30 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(TargetVpnGatewayStubSettings settings) {
       super(settings);
 
-      aggregatedListTargetVpnGatewaysSettings = settings.aggregatedListTargetVpnGatewaysSettings.toBuilder();
+      aggregatedListTargetVpnGatewaysSettings =
+          settings.aggregatedListTargetVpnGatewaysSettings.toBuilder();
       deleteTargetVpnGatewaySettings = settings.deleteTargetVpnGatewaySettings.toBuilder();
       getTargetVpnGatewaySettings = settings.getTargetVpnGatewaySettings.toBuilder();
       insertTargetVpnGatewaySettings = settings.insertTargetVpnGatewaySettings.toBuilder();
       listTargetVpnGatewaysSettings = settings.listTargetVpnGatewaysSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListTargetVpnGatewaysSettings,
-          deleteTargetVpnGatewaySettings,
-          getTargetVpnGatewaySettings,
-          insertTargetVpnGatewaySettings,
-          listTargetVpnGatewaysSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListTargetVpnGatewaysSettings,
+              deleteTargetVpnGatewaySettings,
+              getTargetVpnGatewaySettings,
+              insertTargetVpnGatewaySettings,
+              listTargetVpnGatewaysSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -483,38 +526,37 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListTargetVpnGatewaysSettings() { + /** Returns the builder for the settings used for calls to aggregatedListTargetVpnGateways. */ + public PagedCallSettings.Builder< + AggregatedListTargetVpnGatewaysHttpRequest, TargetVpnGatewayAggregatedList, + AggregatedListTargetVpnGatewaysPagedResponse> + aggregatedListTargetVpnGatewaysSettings() { return aggregatedListTargetVpnGatewaysSettings; } - /** - * Returns the builder for the settings used for calls to deleteTargetVpnGateway. - */ - public UnaryCallSettings.Builder deleteTargetVpnGatewaySettings() { + /** Returns the builder for the settings used for calls to deleteTargetVpnGateway. */ + public UnaryCallSettings.Builder + deleteTargetVpnGatewaySettings() { return deleteTargetVpnGatewaySettings; } - /** - * Returns the builder for the settings used for calls to getTargetVpnGateway. - */ - public UnaryCallSettings.Builder getTargetVpnGatewaySettings() { + /** Returns the builder for the settings used for calls to getTargetVpnGateway. */ + public UnaryCallSettings.Builder + getTargetVpnGatewaySettings() { return getTargetVpnGatewaySettings; } - /** - * Returns the builder for the settings used for calls to insertTargetVpnGateway. - */ - public UnaryCallSettings.Builder insertTargetVpnGatewaySettings() { + /** Returns the builder for the settings used for calls to insertTargetVpnGateway. */ + public UnaryCallSettings.Builder + insertTargetVpnGatewaySettings() { return insertTargetVpnGatewaySettings; } - /** - * Returns the builder for the settings used for calls to listTargetVpnGateways. - */ - public PagedCallSettings.Builder listTargetVpnGatewaysSettings() { + /** Returns the builder for the settings used for calls to listTargetVpnGateways. */ + public PagedCallSettings.Builder< + ListTargetVpnGatewaysHttpRequest, TargetVpnGatewayList, + ListTargetVpnGatewaysPagedResponse> + listTargetVpnGatewaysSettings() { return listTargetVpnGatewaysSettings; } @@ -523,4 +565,4 @@ public TargetVpnGatewayStubSettings build() throws IOException { return new TargetVpnGatewayStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java index 5c2f0def888d..09058cda3a28 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java @@ -15,10 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.compute.v1.CacheInvalidationRule; import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; import com.google.cloud.compute.v1.GetUrlMapHttpRequest; import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; @@ -26,13 +27,9 @@ import com.google.cloud.compute.v1.ListUrlMapsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectUrlMapName; import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; import com.google.cloud.compute.v1.UrlMap; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; import com.google.cloud.compute.v1.UrlMapList; -import com.google.cloud.compute.v1.UrlMapsValidateRequest; import com.google.cloud.compute.v1.UrlMapsValidateResponse; import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; import javax.annotation.Generated; @@ -47,7 +44,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class UrlMapStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteUrlMapCallable() { throw new UnsupportedOperationException("Not implemented: deleteUrlMapCallable()"); @@ -64,12 +60,14 @@ public UnaryCallable insertUrlMapCallable() } @BetaApi - public UnaryCallable invalidateCacheUrlMapCallable() { + public UnaryCallable + invalidateCacheUrlMapCallable() { throw new UnsupportedOperationException("Not implemented: invalidateCacheUrlMapCallable()"); } @BetaApi - public UnaryCallable listUrlMapsPagedCallable() { + public UnaryCallable + listUrlMapsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listUrlMapsPagedCallable()"); } @@ -89,8 +87,11 @@ public UnaryCallable updateUrlMapCallable() } @BetaApi - public UnaryCallable validateUrlMapCallable() { + public UnaryCallable + validateUrlMapCallable() { throw new UnsupportedOperationException("Not implemented: validateUrlMapCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java index 994975b187db..c088f23f6e83 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +39,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteUrlMapHttpRequest; import com.google.cloud.compute.v1.GetUrlMapHttpRequest; import com.google.cloud.compute.v1.InsertUrlMapHttpRequest; @@ -51,7 +48,6 @@ import com.google.cloud.compute.v1.PatchUrlMapHttpRequest; import com.google.cloud.compute.v1.UpdateUrlMapHttpRequest; import com.google.cloud.compute.v1.UrlMap; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; import com.google.cloud.compute.v1.UrlMapList; import com.google.cloud.compute.v1.UrlMapsValidateResponse; import com.google.cloud.compute.v1.ValidateUrlMapHttpRequest; @@ -59,10 +55,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -73,15 +67,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteUrlMap to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteUrlMap to 30 seconds: * *

  * 
@@ -96,84 +90,72 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class UrlMapStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteUrlMapSettings;
   private final UnaryCallSettings getUrlMapSettings;
   private final UnaryCallSettings insertUrlMapSettings;
-  private final UnaryCallSettings invalidateCacheUrlMapSettings;
-  private final PagedCallSettings listUrlMapsSettings;
+  private final UnaryCallSettings
+      invalidateCacheUrlMapSettings;
+  private final PagedCallSettings
+      listUrlMapsSettings;
   private final UnaryCallSettings patchUrlMapSettings;
   private final UnaryCallSettings updateUrlMapSettings;
-  private final UnaryCallSettings validateUrlMapSettings;
+  private final UnaryCallSettings
+      validateUrlMapSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteUrlMap.
-   */
+  /** Returns the object with the settings used for calls to deleteUrlMap. */
   public UnaryCallSettings deleteUrlMapSettings() {
     return deleteUrlMapSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getUrlMap.
-   */
+  /** Returns the object with the settings used for calls to getUrlMap. */
   public UnaryCallSettings getUrlMapSettings() {
     return getUrlMapSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertUrlMap.
-   */
+  /** Returns the object with the settings used for calls to insertUrlMap. */
   public UnaryCallSettings insertUrlMapSettings() {
     return insertUrlMapSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to invalidateCacheUrlMap.
-   */
-  public UnaryCallSettings invalidateCacheUrlMapSettings() {
+  /** Returns the object with the settings used for calls to invalidateCacheUrlMap. */
+  public UnaryCallSettings
+      invalidateCacheUrlMapSettings() {
     return invalidateCacheUrlMapSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listUrlMaps.
-   */
-  public PagedCallSettings listUrlMapsSettings() {
+  /** Returns the object with the settings used for calls to listUrlMaps. */
+  public PagedCallSettings
+      listUrlMapsSettings() {
     return listUrlMapsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to patchUrlMap.
-   */
+  /** Returns the object with the settings used for calls to patchUrlMap. */
   public UnaryCallSettings patchUrlMapSettings() {
     return patchUrlMapSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to updateUrlMap.
-   */
+  /** Returns the object with the settings used for calls to updateUrlMap. */
   public UnaryCallSettings updateUrlMapSettings() {
     return updateUrlMapSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to validateUrlMap.
-   */
-  public UnaryCallSettings validateUrlMapSettings() {
+  /** Returns the object with the settings used for calls to validateUrlMap. */
+  public UnaryCallSettings
+      validateUrlMapSettings() {
     return validateUrlMapSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public UrlMapStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -186,47 +168,34 @@ public UrlMapStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -238,26 +207,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(UrlMapStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -275,80 +240,91 @@ protected UrlMapStubSettings(Builder settingsBuilder) throws IOException {
     validateUrlMapSettings = settingsBuilder.validateUrlMapSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_URL_MAPS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListUrlMapsHttpRequest injectToken(ListUrlMapsHttpRequest payload, String token) {
-          return ListUrlMapsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListUrlMapsHttpRequest injectPageSize(ListUrlMapsHttpRequest payload, int pageSize) {
-          return ListUrlMapsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListUrlMapsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(UrlMapList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(UrlMapList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_URL_MAPS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListUrlMapsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_URL_MAPS_PAGE_STR_DESC, request, context);
-          return ListUrlMapsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for UrlMapStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_URL_MAPS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListUrlMapsHttpRequest injectToken(
+                ListUrlMapsHttpRequest payload, String token) {
+              return ListUrlMapsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListUrlMapsHttpRequest injectPageSize(
+                ListUrlMapsHttpRequest payload, int pageSize) {
+              return ListUrlMapsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListUrlMapsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(UrlMapList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(UrlMapList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListUrlMapsHttpRequest, UrlMapList, ListUrlMapsPagedResponse>
+      LIST_URL_MAPS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListUrlMapsHttpRequest, UrlMapList, ListUrlMapsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListUrlMapsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_URL_MAPS_PAGE_STR_DESC, request, context);
+              return ListUrlMapsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for UrlMapStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteUrlMapSettings;
+    private final UnaryCallSettings.Builder
+        deleteUrlMapSettings;
     private final UnaryCallSettings.Builder getUrlMapSettings;
-    private final UnaryCallSettings.Builder insertUrlMapSettings;
-    private final UnaryCallSettings.Builder invalidateCacheUrlMapSettings;
-    private final PagedCallSettings.Builder listUrlMapsSettings;
+    private final UnaryCallSettings.Builder
+        insertUrlMapSettings;
+    private final UnaryCallSettings.Builder
+        invalidateCacheUrlMapSettings;
+    private final PagedCallSettings.Builder<
+            ListUrlMapsHttpRequest, UrlMapList, ListUrlMapsPagedResponse>
+        listUrlMapsSettings;
     private final UnaryCallSettings.Builder patchUrlMapSettings;
-    private final UnaryCallSettings.Builder updateUrlMapSettings;
-    private final UnaryCallSettings.Builder validateUrlMapSettings;
+    private final UnaryCallSettings.Builder
+        updateUrlMapSettings;
+    private final UnaryCallSettings.Builder
+        validateUrlMapSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -357,15 +333,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -385,8 +362,7 @@ protected Builder(ClientContext clientContext) {
 
       invalidateCacheUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listUrlMapsSettings = PagedCallSettings.newBuilder(
-          LIST_URL_MAPS_PAGE_STR_FACT);
+      listUrlMapsSettings = PagedCallSettings.newBuilder(LIST_URL_MAPS_PAGE_STR_FACT);
 
       patchUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -394,16 +370,16 @@ protected Builder(ClientContext clientContext) {
 
       validateUrlMapSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteUrlMapSettings,
-          getUrlMapSettings,
-          insertUrlMapSettings,
-          invalidateCacheUrlMapSettings,
-          listUrlMapsSettings,
-          patchUrlMapSettings,
-          updateUrlMapSettings,
-          validateUrlMapSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteUrlMapSettings,
+              getUrlMapSettings,
+              insertUrlMapSettings,
+              invalidateCacheUrlMapSettings,
+              listUrlMapsSettings,
+              patchUrlMapSettings,
+              updateUrlMapSettings,
+              validateUrlMapSettings);
 
       initDefaults(this);
     }
@@ -419,35 +395,43 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteUrlMapSettings()
+      builder
+          .deleteUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getUrlMapSettings()
+      builder
+          .getUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertUrlMapSettings()
+      builder
+          .insertUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.invalidateCacheUrlMapSettings()
+      builder
+          .invalidateCacheUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listUrlMapsSettings()
+      builder
+          .listUrlMapsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.patchUrlMapSettings()
+      builder
+          .patchUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.updateUrlMapSettings()
+      builder
+          .updateUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.validateUrlMapSettings()
+      builder
+          .validateUrlMapSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -466,24 +450,26 @@ protected Builder(UrlMapStubSettings settings) {
       updateUrlMapSettings = settings.updateUrlMapSettings.toBuilder();
       validateUrlMapSettings = settings.validateUrlMapSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteUrlMapSettings,
-          getUrlMapSettings,
-          insertUrlMapSettings,
-          invalidateCacheUrlMapSettings,
-          listUrlMapsSettings,
-          patchUrlMapSettings,
-          updateUrlMapSettings,
-          validateUrlMapSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteUrlMapSettings,
+              getUrlMapSettings,
+              insertUrlMapSettings,
+              invalidateCacheUrlMapSettings,
+              listUrlMapsSettings,
+              patchUrlMapSettings,
+              updateUrlMapSettings,
+              validateUrlMapSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -492,59 +478,46 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteUrlMapSettings() { return deleteUrlMapSettings; } - /** - * Returns the builder for the settings used for calls to getUrlMap. - */ + /** Returns the builder for the settings used for calls to getUrlMap. */ public UnaryCallSettings.Builder getUrlMapSettings() { return getUrlMapSettings; } - /** - * Returns the builder for the settings used for calls to insertUrlMap. - */ + /** Returns the builder for the settings used for calls to insertUrlMap. */ public UnaryCallSettings.Builder insertUrlMapSettings() { return insertUrlMapSettings; } - /** - * Returns the builder for the settings used for calls to invalidateCacheUrlMap. - */ - public UnaryCallSettings.Builder invalidateCacheUrlMapSettings() { + /** Returns the builder for the settings used for calls to invalidateCacheUrlMap. */ + public UnaryCallSettings.Builder + invalidateCacheUrlMapSettings() { return invalidateCacheUrlMapSettings; } - /** - * Returns the builder for the settings used for calls to listUrlMaps. - */ - public PagedCallSettings.Builder listUrlMapsSettings() { + /** Returns the builder for the settings used for calls to listUrlMaps. */ + public PagedCallSettings.Builder + listUrlMapsSettings() { return listUrlMapsSettings; } - /** - * Returns the builder for the settings used for calls to patchUrlMap. - */ + /** Returns the builder for the settings used for calls to patchUrlMap. */ public UnaryCallSettings.Builder patchUrlMapSettings() { return patchUrlMapSettings; } - /** - * Returns the builder for the settings used for calls to updateUrlMap. - */ + /** Returns the builder for the settings used for calls to updateUrlMap. */ public UnaryCallSettings.Builder updateUrlMapSettings() { return updateUrlMapSettings; } - /** - * Returns the builder for the settings used for calls to validateUrlMap. - */ - public UnaryCallSettings.Builder validateUrlMapSettings() { + /** Returns the builder for the settings used for calls to validateUrlMap. */ + public UnaryCallSettings.Builder + validateUrlMapSettings() { return validateUrlMapSettings; } @@ -553,4 +526,4 @@ public UrlMapStubSettings build() throws IOException { return new UrlMapStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java index 7a7ea8818a7d..282b456d91b4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -24,15 +27,9 @@ import com.google.cloud.compute.v1.InsertVpnTunnelHttpRequest; import com.google.cloud.compute.v1.ListVpnTunnelsHttpRequest; import com.google.cloud.compute.v1.Operation; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectRegionName; -import com.google.cloud.compute.v1.ProjectRegionVpnTunnelName; import com.google.cloud.compute.v1.VpnTunnel; import com.google.cloud.compute.v1.VpnTunnelAggregatedList; -import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; -import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; import com.google.cloud.compute.v1.VpnTunnelList; -import com.google.cloud.compute.v1.VpnTunnelsScopedList; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -45,14 +42,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class VpnTunnelStub implements BackgroundResource { - @BetaApi - public UnaryCallable aggregatedListVpnTunnelsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: aggregatedListVpnTunnelsPagedCallable()"); + public UnaryCallable + aggregatedListVpnTunnelsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListVpnTunnelsPagedCallable()"); } @BetaApi - public UnaryCallable aggregatedListVpnTunnelsCallable() { + public UnaryCallable + aggregatedListVpnTunnelsCallable() { throw new UnsupportedOperationException("Not implemented: aggregatedListVpnTunnelsCallable()"); } @@ -72,7 +71,8 @@ public UnaryCallable insertVpnTunnelCalla } @BetaApi - public UnaryCallable listVpnTunnelsPagedCallable() { + public UnaryCallable + listVpnTunnelsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listVpnTunnelsPagedCallable()"); } @@ -81,4 +81,6 @@ public UnaryCallable listVpnTunnelsCal throw new UnsupportedOperationException("Not implemented: listVpnTunnelsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java index 285f23db5fed..e7ed844e5a5c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java @@ -15,11 +15,12 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +31,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,7 +40,6 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.AggregatedListVpnTunnelsHttpRequest; import com.google.cloud.compute.v1.DeleteVpnTunnelHttpRequest; import com.google.cloud.compute.v1.GetVpnTunnelHttpRequest; @@ -50,18 +48,14 @@ import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.VpnTunnel; import com.google.cloud.compute.v1.VpnTunnelAggregatedList; -import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; -import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; import com.google.cloud.compute.v1.VpnTunnelList; import com.google.cloud.compute.v1.VpnTunnelsScopedList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -72,15 +66,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteVpnTunnel to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteVpnTunnel to 30 seconds: * *

  * 
@@ -95,60 +89,57 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class VpnTunnelStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
-
-  private final PagedCallSettings aggregatedListVpnTunnelsSettings;
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
+
+  private final PagedCallSettings<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+          AggregatedListVpnTunnelsPagedResponse>
+      aggregatedListVpnTunnelsSettings;
   private final UnaryCallSettings deleteVpnTunnelSettings;
   private final UnaryCallSettings getVpnTunnelSettings;
   private final UnaryCallSettings insertVpnTunnelSettings;
-  private final PagedCallSettings listVpnTunnelsSettings;
-
-  /**
-   * Returns the object with the settings used for calls to aggregatedListVpnTunnels.
-   */
-  public PagedCallSettings aggregatedListVpnTunnelsSettings() {
+  private final PagedCallSettings<
+          ListVpnTunnelsHttpRequest, VpnTunnelList, ListVpnTunnelsPagedResponse>
+      listVpnTunnelsSettings;
+
+  /** Returns the object with the settings used for calls to aggregatedListVpnTunnels. */
+  public PagedCallSettings<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+          AggregatedListVpnTunnelsPagedResponse>
+      aggregatedListVpnTunnelsSettings() {
     return aggregatedListVpnTunnelsSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to deleteVpnTunnel.
-   */
+  /** Returns the object with the settings used for calls to deleteVpnTunnel. */
   public UnaryCallSettings deleteVpnTunnelSettings() {
     return deleteVpnTunnelSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getVpnTunnel.
-   */
+  /** Returns the object with the settings used for calls to getVpnTunnel. */
   public UnaryCallSettings getVpnTunnelSettings() {
     return getVpnTunnelSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to insertVpnTunnel.
-   */
+  /** Returns the object with the settings used for calls to insertVpnTunnel. */
   public UnaryCallSettings insertVpnTunnelSettings() {
     return insertVpnTunnelSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listVpnTunnels.
-   */
-  public PagedCallSettings listVpnTunnelsSettings() {
+  /** Returns the object with the settings used for calls to listVpnTunnels. */
+  public PagedCallSettings
+      listVpnTunnelsSettings() {
     return listVpnTunnelsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public VpnTunnelStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -161,47 +152,34 @@ public VpnTunnelStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -213,26 +191,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(VpnTunnelStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -247,125 +221,157 @@ protected VpnTunnelStubSettings(Builder settingsBuilder) throws IOException {
     listVpnTunnelsSettings = settingsBuilder.listVpnTunnelsSettings().build();
   }
 
-  private static final PagedListDescriptor AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public AggregatedListVpnTunnelsHttpRequest injectToken(AggregatedListVpnTunnelsHttpRequest payload, String token) {
-          return AggregatedListVpnTunnelsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public AggregatedListVpnTunnelsHttpRequest injectPageSize(AggregatedListVpnTunnelsHttpRequest payload, int pageSize) {
-          return AggregatedListVpnTunnelsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(AggregatedListVpnTunnelsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(VpnTunnelAggregatedList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(VpnTunnelAggregatedList payload) {
-          return payload.getItemsMap().values();
-        }
-      };
-
-  private static final PagedListDescriptor LIST_VPN_TUNNELS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListVpnTunnelsHttpRequest injectToken(ListVpnTunnelsHttpRequest payload, String token) {
-          return ListVpnTunnelsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListVpnTunnelsHttpRequest injectPageSize(ListVpnTunnelsHttpRequest payload, int pageSize) {
-          return ListVpnTunnelsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListVpnTunnelsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(VpnTunnelList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(VpnTunnelList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            AggregatedListVpnTunnelsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_DESC, request, context);
-          return AggregatedListVpnTunnelsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_VPN_TUNNELS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListVpnTunnelsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_VPN_TUNNELS_PAGE_STR_DESC, request, context);
-          return ListVpnTunnelsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for VpnTunnelStubSettings.
-   */
+  private static final PagedListDescriptor<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, VpnTunnelsScopedList>
+      AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_DESC =
+          new PagedListDescriptor<
+              AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+              VpnTunnelsScopedList>() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public AggregatedListVpnTunnelsHttpRequest injectToken(
+                AggregatedListVpnTunnelsHttpRequest payload, String token) {
+              return AggregatedListVpnTunnelsHttpRequest.newBuilder(payload)
+                  .setPageToken(token)
+                  .build();
+            }
+
+            @Override
+            public AggregatedListVpnTunnelsHttpRequest injectPageSize(
+                AggregatedListVpnTunnelsHttpRequest payload, int pageSize) {
+              return AggregatedListVpnTunnelsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(AggregatedListVpnTunnelsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(VpnTunnelAggregatedList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(
+                VpnTunnelAggregatedList payload) {
+              return payload.getItemsMap().values();
+            }
+          };
+
+  private static final PagedListDescriptor
+      LIST_VPN_TUNNELS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListVpnTunnelsHttpRequest injectToken(
+                ListVpnTunnelsHttpRequest payload, String token) {
+              return ListVpnTunnelsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListVpnTunnelsHttpRequest injectPageSize(
+                ListVpnTunnelsHttpRequest payload, int pageSize) {
+              return ListVpnTunnelsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListVpnTunnelsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(VpnTunnelList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(VpnTunnelList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+          AggregatedListVpnTunnelsPagedResponse>
+      AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+              AggregatedListVpnTunnelsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable
+                    callable,
+                AggregatedListVpnTunnelsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext<
+                      AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+                      VpnTunnelsScopedList>
+                  pageContext =
+                      PageContext.create(
+                          callable, AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_DESC, request, context);
+              return AggregatedListVpnTunnelsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListVpnTunnelsHttpRequest, VpnTunnelList, ListVpnTunnelsPagedResponse>
+      LIST_VPN_TUNNELS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListVpnTunnelsHttpRequest, VpnTunnelList, ListVpnTunnelsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListVpnTunnelsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_VPN_TUNNELS_PAGE_STR_DESC, request, context);
+              return ListVpnTunnelsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for VpnTunnelStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final PagedCallSettings.Builder aggregatedListVpnTunnelsSettings;
-    private final UnaryCallSettings.Builder deleteVpnTunnelSettings;
-    private final UnaryCallSettings.Builder getVpnTunnelSettings;
-    private final UnaryCallSettings.Builder insertVpnTunnelSettings;
-    private final PagedCallSettings.Builder listVpnTunnelsSettings;
-
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private final PagedCallSettings.Builder<
+            AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList,
+            AggregatedListVpnTunnelsPagedResponse>
+        aggregatedListVpnTunnelsSettings;
+    private final UnaryCallSettings.Builder
+        deleteVpnTunnelSettings;
+    private final UnaryCallSettings.Builder
+        getVpnTunnelSettings;
+    private final UnaryCallSettings.Builder
+        insertVpnTunnelSettings;
+    private final PagedCallSettings.Builder<
+            ListVpnTunnelsHttpRequest, VpnTunnelList, ListVpnTunnelsPagedResponse>
+        listVpnTunnelsSettings;
+
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -374,15 +380,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -394,8 +401,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      aggregatedListVpnTunnelsSettings = PagedCallSettings.newBuilder(
-          AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_FACT);
+      aggregatedListVpnTunnelsSettings =
+          PagedCallSettings.newBuilder(AGGREGATED_LIST_VPN_TUNNELS_PAGE_STR_FACT);
 
       deleteVpnTunnelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
@@ -403,16 +410,15 @@ protected Builder(ClientContext clientContext) {
 
       insertVpnTunnelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listVpnTunnelsSettings = PagedCallSettings.newBuilder(
-          LIST_VPN_TUNNELS_PAGE_STR_FACT);
+      listVpnTunnelsSettings = PagedCallSettings.newBuilder(LIST_VPN_TUNNELS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListVpnTunnelsSettings,
-          deleteVpnTunnelSettings,
-          getVpnTunnelSettings,
-          insertVpnTunnelSettings,
-          listVpnTunnelsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListVpnTunnelsSettings,
+              deleteVpnTunnelSettings,
+              getVpnTunnelSettings,
+              insertVpnTunnelSettings,
+              listVpnTunnelsSettings);
 
       initDefaults(this);
     }
@@ -428,23 +434,28 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.aggregatedListVpnTunnelsSettings()
+      builder
+          .aggregatedListVpnTunnelsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.deleteVpnTunnelSettings()
+      builder
+          .deleteVpnTunnelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getVpnTunnelSettings()
+      builder
+          .getVpnTunnelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.insertVpnTunnelSettings()
+      builder
+          .insertVpnTunnelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listVpnTunnelsSettings()
+      builder
+          .listVpnTunnelsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -460,21 +471,23 @@ protected Builder(VpnTunnelStubSettings settings) {
       insertVpnTunnelSettings = settings.insertVpnTunnelSettings.toBuilder();
       listVpnTunnelsSettings = settings.listVpnTunnelsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          aggregatedListVpnTunnelsSettings,
-          deleteVpnTunnelSettings,
-          getVpnTunnelSettings,
-          insertVpnTunnelSettings,
-          listVpnTunnelsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              aggregatedListVpnTunnelsSettings,
+              deleteVpnTunnelSettings,
+              getVpnTunnelSettings,
+              insertVpnTunnelSettings,
+              listVpnTunnelsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -483,38 +496,35 @@ public Builder applyToAllUnaryMethods(ApiFunction aggregatedListVpnTunnelsSettings() { + /** Returns the builder for the settings used for calls to aggregatedListVpnTunnels. */ + public PagedCallSettings.Builder< + AggregatedListVpnTunnelsHttpRequest, VpnTunnelAggregatedList, + AggregatedListVpnTunnelsPagedResponse> + aggregatedListVpnTunnelsSettings() { return aggregatedListVpnTunnelsSettings; } - /** - * Returns the builder for the settings used for calls to deleteVpnTunnel. - */ - public UnaryCallSettings.Builder deleteVpnTunnelSettings() { + /** Returns the builder for the settings used for calls to deleteVpnTunnel. */ + public UnaryCallSettings.Builder + deleteVpnTunnelSettings() { return deleteVpnTunnelSettings; } - /** - * Returns the builder for the settings used for calls to getVpnTunnel. - */ + /** Returns the builder for the settings used for calls to getVpnTunnel. */ public UnaryCallSettings.Builder getVpnTunnelSettings() { return getVpnTunnelSettings; } - /** - * Returns the builder for the settings used for calls to insertVpnTunnel. - */ - public UnaryCallSettings.Builder insertVpnTunnelSettings() { + /** Returns the builder for the settings used for calls to insertVpnTunnel. */ + public UnaryCallSettings.Builder + insertVpnTunnelSettings() { return insertVpnTunnelSettings; } - /** - * Returns the builder for the settings used for calls to listVpnTunnels. - */ - public PagedCallSettings.Builder listVpnTunnelsSettings() { + /** Returns the builder for the settings used for calls to listVpnTunnels. */ + public PagedCallSettings.Builder< + ListVpnTunnelsHttpRequest, VpnTunnelList, ListVpnTunnelsPagedResponse> + listVpnTunnelsSettings() { return listVpnTunnelsSettings; } @@ -523,4 +533,4 @@ public VpnTunnelStubSettings build() throws IOException { return new VpnTunnelStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java index b67b253c3fb1..a65df85a2632 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -23,9 +25,6 @@ import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationList; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.ProjectZoneOperationName; -import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -38,7 +37,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ZoneOperationStub implements BackgroundResource { - @BetaApi public UnaryCallable deleteZoneOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteZoneOperationCallable()"); @@ -50,7 +48,8 @@ public UnaryCallable getZoneOperationCal } @BetaApi - public UnaryCallable listZoneOperationsPagedCallable() { + public UnaryCallable + listZoneOperationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listZoneOperationsPagedCallable()"); } @@ -59,4 +58,6 @@ public UnaryCallable listZoneOpera throw new UnsupportedOperationException("Not implemented: listZoneOperationsCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java index 184339a514f4..b8c953f4e79e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,21 +39,17 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.DeleteZoneOperationHttpRequest; import com.google.cloud.compute.v1.GetZoneOperationHttpRequest; import com.google.cloud.compute.v1.ListZoneOperationsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.OperationList; -import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -66,15 +60,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteZoneOperation to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteZoneOperation to 30 seconds: * *

  * 
@@ -89,44 +83,40 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ZoneOperationStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings deleteZoneOperationSettings;
   private final UnaryCallSettings getZoneOperationSettings;
-  private final PagedCallSettings listZoneOperationsSettings;
+  private final PagedCallSettings<
+          ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
+      listZoneOperationsSettings;
 
-  /**
-   * Returns the object with the settings used for calls to deleteZoneOperation.
-   */
+  /** Returns the object with the settings used for calls to deleteZoneOperation. */
   public UnaryCallSettings deleteZoneOperationSettings() {
     return deleteZoneOperationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getZoneOperation.
-   */
+  /** Returns the object with the settings used for calls to getZoneOperation. */
   public UnaryCallSettings getZoneOperationSettings() {
     return getZoneOperationSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listZoneOperations.
-   */
-  public PagedCallSettings listZoneOperationsSettings() {
+  /** Returns the object with the settings used for calls to listZoneOperations. */
+  public PagedCallSettings<
+          ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
+      listZoneOperationsSettings() {
     return listZoneOperationsSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ZoneOperationStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -139,47 +129,34 @@ public ZoneOperationStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -190,27 +167,24 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
-        .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ZoneOperationStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(ZoneOperationStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -223,75 +197,86 @@ protected ZoneOperationStubSettings(Builder settingsBuilder) throws IOException
     listZoneOperationsSettings = settingsBuilder.listZoneOperationsSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_ZONE_OPERATIONS_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListZoneOperationsHttpRequest injectToken(ListZoneOperationsHttpRequest payload, String token) {
-          return ListZoneOperationsHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListZoneOperationsHttpRequest injectPageSize(ListZoneOperationsHttpRequest payload, int pageSize) {
-          return ListZoneOperationsHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListZoneOperationsHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(OperationList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(OperationList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_ZONE_OPERATIONS_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListZoneOperationsHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_ZONE_OPERATIONS_PAGE_STR_DESC, request, context);
-          return ListZoneOperationsPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for ZoneOperationStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_ZONE_OPERATIONS_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListZoneOperationsHttpRequest injectToken(
+                ListZoneOperationsHttpRequest payload, String token) {
+              return ListZoneOperationsHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListZoneOperationsHttpRequest injectPageSize(
+                ListZoneOperationsHttpRequest payload, int pageSize) {
+              return ListZoneOperationsHttpRequest.newBuilder(payload)
+                  .setMaxResults(pageSize)
+                  .build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListZoneOperationsHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(OperationList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(OperationList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
+      LIST_ZONE_OPERATIONS_PAGE_STR_FACT =
+          new PagedListResponseFactory<
+              ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListZoneOperationsHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(
+                      callable, LIST_ZONE_OPERATIONS_PAGE_STR_DESC, request, context);
+              return ListZoneOperationsPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for ZoneOperationStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder deleteZoneOperationSettings;
-    private final UnaryCallSettings.Builder getZoneOperationSettings;
-    private final PagedCallSettings.Builder listZoneOperationsSettings;
+    private final UnaryCallSettings.Builder
+        deleteZoneOperationSettings;
+    private final UnaryCallSettings.Builder
+        getZoneOperationSettings;
+    private final PagedCallSettings.Builder<
+            ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse>
+        listZoneOperationsSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -300,15 +285,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -324,14 +310,11 @@ protected Builder(ClientContext clientContext) {
 
       getZoneOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listZoneOperationsSettings = PagedCallSettings.newBuilder(
-          LIST_ZONE_OPERATIONS_PAGE_STR_FACT);
+      listZoneOperationsSettings = PagedCallSettings.newBuilder(LIST_ZONE_OPERATIONS_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteZoneOperationSettings,
-          getZoneOperationSettings,
-          listZoneOperationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteZoneOperationSettings, getZoneOperationSettings, listZoneOperationsSettings);
 
       initDefaults(this);
     }
@@ -347,15 +330,18 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.deleteZoneOperationSettings()
+      builder
+          .deleteZoneOperationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.getZoneOperationSettings()
+      builder
+          .getZoneOperationSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listZoneOperationsSettings()
+      builder
+          .listZoneOperationsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -369,19 +355,19 @@ protected Builder(ZoneOperationStubSettings settings) {
       getZoneOperationSettings = settings.getZoneOperationSettings.toBuilder();
       listZoneOperationsSettings = settings.listZoneOperationsSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          deleteZoneOperationSettings,
-          getZoneOperationSettings,
-          listZoneOperationsSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(
+              deleteZoneOperationSettings, getZoneOperationSettings, listZoneOperationsSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -390,24 +376,22 @@ public Builder applyToAllUnaryMethods(ApiFunction deleteZoneOperationSettings() { + /** Returns the builder for the settings used for calls to deleteZoneOperation. */ + public UnaryCallSettings.Builder + deleteZoneOperationSettings() { return deleteZoneOperationSettings; } - /** - * Returns the builder for the settings used for calls to getZoneOperation. - */ - public UnaryCallSettings.Builder getZoneOperationSettings() { + /** Returns the builder for the settings used for calls to getZoneOperation. */ + public UnaryCallSettings.Builder + getZoneOperationSettings() { return getZoneOperationSettings; } - /** - * Returns the builder for the settings used for calls to listZoneOperations. - */ - public PagedCallSettings.Builder listZoneOperationsSettings() { + /** Returns the builder for the settings used for calls to listZoneOperations. */ + public PagedCallSettings.Builder< + ListZoneOperationsHttpRequest, OperationList, ListZoneOperationsPagedResponse> + listZoneOperationsSettings() { return listZoneOperationsSettings; } @@ -416,4 +400,4 @@ public ZoneOperationStubSettings build() throws IOException { return new ZoneOperationStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java index 5cc8ce61da48..46023fda334b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java @@ -15,15 +15,14 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.GetZoneHttpRequest; import com.google.cloud.compute.v1.ListZonesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.Zone; -import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; import com.google.cloud.compute.v1.ZoneList; import javax.annotation.Generated; @@ -37,7 +36,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ZoneStub implements BackgroundResource { - @BetaApi public UnaryCallable getZoneCallable() { throw new UnsupportedOperationException("Not implemented: getZoneCallable()"); @@ -53,4 +51,6 @@ public UnaryCallable listZonesCallable() { throw new UnsupportedOperationException("Not implemented: listZonesCallable()"); } -} \ No newline at end of file + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java index 8926a9a39cab..3cb80fb6ca48 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java @@ -15,11 +15,11 @@ */ package com.google.cloud.compute.v1.stub; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -30,8 +30,6 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -41,20 +39,16 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; import com.google.cloud.compute.v1.GetZoneHttpRequest; import com.google.cloud.compute.v1.ListZonesHttpRequest; import com.google.cloud.compute.v1.Zone; -import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; import com.google.cloud.compute.v1.ZoneList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import java.io.IOException; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -65,15 +59,15 @@ *

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default port (443) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getZone to 30 seconds: + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getZone to 30 seconds: * *

  * 
@@ -88,36 +82,32 @@
 @Generated("by GAPIC v0.0.5")
 @BetaApi
 public class ZoneStubSettings extends StubSettings {
-  /**
-   * The default scopes of the service.
-   */
-  private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder()
-      .add("https://www.googleapis.com/auth/cloud-platform")
-      .add("https://www.googleapis.com/auth/compute")
-      .add("https://www.googleapis.com/auth/compute.readonly")
-      .add("https://www.googleapis.com/auth/devstorage.full_control")
-      .add("https://www.googleapis.com/auth/devstorage.read_only")
-      .add("https://www.googleapis.com/auth/devstorage.read_write")
-      .build();
+  /** The default scopes of the service. */
+  private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+      ImmutableList.builder()
+          .add("https://www.googleapis.com/auth/cloud-platform")
+          .add("https://www.googleapis.com/auth/compute")
+          .add("https://www.googleapis.com/auth/compute.readonly")
+          .add("https://www.googleapis.com/auth/devstorage.full_control")
+          .add("https://www.googleapis.com/auth/devstorage.read_only")
+          .add("https://www.googleapis.com/auth/devstorage.read_write")
+          .build();
 
   private final UnaryCallSettings getZoneSettings;
-  private final PagedCallSettings listZonesSettings;
+  private final PagedCallSettings
+      listZonesSettings;
 
-  /**
-   * Returns the object with the settings used for calls to getZone.
-   */
+  /** Returns the object with the settings used for calls to getZone. */
   public UnaryCallSettings getZoneSettings() {
     return getZoneSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to listZones.
-   */
-  public PagedCallSettings listZonesSettings() {
+  /** Returns the object with the settings used for calls to listZones. */
+  public PagedCallSettings
+      listZonesSettings() {
     return listZonesSettings;
   }
 
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ZoneStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -130,47 +120,34 @@ public ZoneStub createStub() throws IOException {
     }
   }
 
-  /**
-   * Returns a builder for the default ExecutorProvider for this service.
-   */
+  /** Returns a builder for the default ExecutorProvider for this service. */
   public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
     return InstantiatingExecutorProvider.newBuilder();
   }
 
-  /**
-   * Returns the default service endpoint.
-   */
+  /** Returns the default service endpoint. */
   public static String getDefaultEndpoint() {
     return "https://www.googleapis.com/compute/v1/projects/";
   }
 
-  /**
-   * Returns the default service port.
-   */
+  /** Returns the default service port. */
   public static int getDefaultServicePort() {
     return 443;
   }
 
-
-  /**
-   * Returns the default service scopes.
-   */
+  /** Returns the default service scopes. */
   public static List getDefaultServiceScopes() {
     return DEFAULT_SERVICE_SCOPES;
   }
 
-
-  /**
-   * Returns a builder for the default credentials for this service.
-   */
+  /** Returns a builder for the default credentials for this service. */
   public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
-    return GoogleCredentialsProvider.newBuilder()
-        .setScopesToApply(DEFAULT_SERVICE_SCOPES)
-        ;
+    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
   }
 
   /** Returns a builder for the default ChannelProvider for this service. */
-  public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() {
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
     return InstantiatingHttpJsonChannelProvider.newBuilder();
   }
 
@@ -182,26 +159,22 @@ public static TransportChannelProvider defaultTransportChannelProvider() {
   public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ZoneStubSettings.class))
-        .setTransportToken(GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion());
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
-  /**
-   * Returns a new builder for this class.
-   */
+  /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
   }
 
-  /**
-   * Returns a builder containing all the values of this settings class.
-   */
+  /** Returns a builder containing all the values of this settings class. */
   public Builder toBuilder() {
     return new Builder(this);
   }
@@ -213,74 +186,76 @@ protected ZoneStubSettings(Builder settingsBuilder) throws IOException {
     listZonesSettings = settingsBuilder.listZonesSettings().build();
   }
 
-  private static final PagedListDescriptor LIST_ZONES_PAGE_STR_DESC =
-      new PagedListDescriptor() {
-        @Override
-        public String emptyToken() {
-          return "";
-        }
-        @Override
-        public ListZonesHttpRequest injectToken(ListZonesHttpRequest payload, String token) {
-          return ListZonesHttpRequest
-            .newBuilder(payload)
-            .setPageToken(token)
-            .build();
-        }
-        @Override
-        public ListZonesHttpRequest injectPageSize(ListZonesHttpRequest payload, int pageSize) {
-          return ListZonesHttpRequest
-            .newBuilder(payload)
-            .setMaxResults(pageSize)
-            .build();
-        }
-        @Override
-        public Integer extractPageSize(ListZonesHttpRequest payload) {
-          return payload.getMaxResults();
-        }
-        @Override
-        public String extractNextToken(ZoneList payload) {
-          return payload.getNextPageToken();
-        }
-        @Override
-        public Iterable extractResources(ZoneList payload) {
-          return payload.getItemsList();
-        }
-      };
-
-  private static final PagedListResponseFactory LIST_ZONES_PAGE_STR_FACT =
-      new PagedListResponseFactory() {
-        @Override
-        public ApiFuture getFuturePagedResponse(
-            UnaryCallable callable,
-            ListZonesHttpRequest request,
-            ApiCallContext context,
-            ApiFuture futureResponse) {
-          PageContext pageContext =
-              PageContext.create(callable, LIST_ZONES_PAGE_STR_DESC, request, context);
-          return ListZonesPagedResponse.createAsync(pageContext, futureResponse);
-        }
-      };
-
-
-  /**
-   * Builder for ZoneStubSettings.
-   */
+  private static final PagedListDescriptor
+      LIST_ZONES_PAGE_STR_DESC =
+          new PagedListDescriptor() {
+            @Override
+            public String emptyToken() {
+              return "";
+            }
+
+            @Override
+            public ListZonesHttpRequest injectToken(ListZonesHttpRequest payload, String token) {
+              return ListZonesHttpRequest.newBuilder(payload).setPageToken(token).build();
+            }
+
+            @Override
+            public ListZonesHttpRequest injectPageSize(ListZonesHttpRequest payload, int pageSize) {
+              return ListZonesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build();
+            }
+
+            @Override
+            public Integer extractPageSize(ListZonesHttpRequest payload) {
+              return payload.getMaxResults();
+            }
+
+            @Override
+            public String extractNextToken(ZoneList payload) {
+              return payload.getNextPageToken();
+            }
+
+            @Override
+            public Iterable extractResources(ZoneList payload) {
+              return payload.getItemsList();
+            }
+          };
+
+  private static final PagedListResponseFactory<
+          ListZonesHttpRequest, ZoneList, ListZonesPagedResponse>
+      LIST_ZONES_PAGE_STR_FACT =
+          new PagedListResponseFactory() {
+            @Override
+            public ApiFuture getFuturePagedResponse(
+                UnaryCallable callable,
+                ListZonesHttpRequest request,
+                ApiCallContext context,
+                ApiFuture futureResponse) {
+              PageContext pageContext =
+                  PageContext.create(callable, LIST_ZONES_PAGE_STR_DESC, request, context);
+              return ListZonesPagedResponse.createAsync(pageContext, futureResponse);
+            }
+          };
+
+  /** Builder for ZoneStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder getZoneSettings;
-    private final PagedCallSettings.Builder listZonesSettings;
+    private final PagedCallSettings.Builder
+        listZonesSettings;
 
-    private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+    private static final ImmutableMap>
+        RETRYABLE_CODE_DEFINITIONS;
 
     static {
-      ImmutableMap.Builder> definitions = ImmutableMap.builder();
+      ImmutableMap.Builder> definitions =
+          ImmutableMap.builder();
       definitions.put(
           "idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put(
-          "non_idempotent",
-          ImmutableSet.copyOf(Lists.newArrayList()));
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -289,15 +264,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder();
       RetrySettings settings = null;
-      settings = RetrySettings.newBuilder()
-          .setInitialRetryDelay(Duration.ofMillis(100L))
-          .setRetryDelayMultiplier(1.3)
-          .setMaxRetryDelay(Duration.ofMillis(60000L))
-          .setInitialRpcTimeout(Duration.ofMillis(20000L))
-          .setRpcTimeoutMultiplier(1.0)
-          .setMaxRpcTimeout(Duration.ofMillis(20000L))
-          .setTotalTimeout(Duration.ofMillis(600000L))
-          .build();
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
       definitions.put("default", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
@@ -311,13 +287,10 @@ protected Builder(ClientContext clientContext) {
 
       getZoneSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      listZonesSettings = PagedCallSettings.newBuilder(
-          LIST_ZONES_PAGE_STR_FACT);
+      listZonesSettings = PagedCallSettings.newBuilder(LIST_ZONES_PAGE_STR_FACT);
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getZoneSettings,
-          listZonesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(getZoneSettings, listZonesSettings);
 
       initDefaults(this);
     }
@@ -333,11 +306,13 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder.getZoneSettings()
+      builder
+          .getZoneSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder.listZonesSettings()
+      builder
+          .listZonesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -350,18 +325,18 @@ protected Builder(ZoneStubSettings settings) {
       getZoneSettings = settings.getZoneSettings.toBuilder();
       listZonesSettings = settings.listZonesSettings.toBuilder();
 
-      unaryMethodSettingsBuilders = ImmutableList.>of(
-          getZoneSettings,
-          listZonesSettings
-      );
+      unaryMethodSettingsBuilders =
+          ImmutableList.>of(getZoneSettings, listZonesSettings);
     }
 
+    // NEXT_MAJOR_VER: remove 'throws Exception'
     /**
      * Applies the given settings updater function to all of the unary API methods in this service.
      *
-     * Note: This method does not support applying settings to streaming methods.
+     * 

Note: This method does not support applying settings to streaming methods. */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -370,17 +345,14 @@ public Builder applyToAllUnaryMethods(ApiFunction getZoneSettings() { return getZoneSettings; } - /** - * Returns the builder for the settings used for calls to listZones. - */ - public PagedCallSettings.Builder listZonesSettings() { + /** Returns the builder for the settings used for calls to listZones. */ + public PagedCallSettings.Builder + listZonesSettings() { return listZonesSettings; } @@ -389,4 +361,4 @@ public ZoneStubSettings build() throws IOException { return new ZoneStubSettings(this); } } -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java index ea6c2e54826d..9dd592c3f42b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.aggregatedListAcceleratorTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.getAcceleratorTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.listAcceleratorTypesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,12 +31,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.AggregatedListAcceleratorTypesPagedResponse; -import static com.google.cloud.compute.v1.AcceleratorTypeClient.ListAcceleratorTypesPagedResponse; import com.google.cloud.compute.v1.stub.AcceleratorTypeStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.aggregatedListAcceleratorTypesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.getAcceleratorTypeMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAcceleratorTypeStub.listAcceleratorTypesMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -47,14 +48,14 @@ @javax.annotation.Generated("by GAPIC") public class AcceleratorTypeClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListAcceleratorTypesMethodDescriptor, - getAcceleratorTypeMethodDescriptor, - listAcceleratorTypesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, AcceleratorTypeStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAcceleratorTypesMethodDescriptor, + getAcceleratorTypeMethodDescriptor, + listAcceleratorTypesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, AcceleratorTypeStubSettings.getDefaultEndpoint()); private static AcceleratorTypeClient client; private static AcceleratorTypeSettings clientSettings; @@ -63,13 +64,13 @@ public class AcceleratorTypeClientTest { public static void setUp() throws IOException { clientSettings = AcceleratorTypeSettings.newBuilder() - .setTransportChannelProvider( - AcceleratorTypeSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - AcceleratorTypeClient.create(clientSettings); + .setTransportChannelProvider( + AcceleratorTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AcceleratorTypeClient.create(clientSettings); } @After @@ -92,37 +93,47 @@ public void aggregatedListAcceleratorTypesTest() { AcceleratorTypesScopedList itemsItem = AcceleratorTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - AcceleratorTypeAggregatedList expectedResponse = AcceleratorTypeAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + AcceleratorTypeAggregatedList expectedResponse = + AcceleratorTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListAcceleratorTypesPagedResponse pagedListResponse = client.aggregatedListAcceleratorTypes(project); + AggregatedListAcceleratorTypesPagedResponse pagedListResponse = + client.aggregatedListAcceleratorTypes(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListAcceleratorTypesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -146,41 +157,51 @@ public void getAcceleratorTypeTest() { Integer maximumCardsPerInstance = 1883669166; String id = "id3355"; String selfLink = "selfLink-1691268851"; - AcceleratorType expectedResponse = AcceleratorType.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setMaximumCardsPerInstance(maximumCardsPerInstance) - .setId(id) - .setSelfLink(selfLink) - .build(); + AcceleratorType expectedResponse = + AcceleratorType.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setMaximumCardsPerInstance(maximumCardsPerInstance) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); + ProjectZoneAcceleratorTypeName acceleratorType = + ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); - AcceleratorType actualResponse = - client.getAcceleratorType(acceleratorType); + AcceleratorType actualResponse = client.getAcceleratorType(acceleratorType); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getAcceleratorTypeExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); + ProjectZoneAcceleratorTypeName acceleratorType = + ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]"); client.getAcceleratorType(acceleratorType); Assert.fail("No exception raised"); @@ -198,13 +219,14 @@ public void listAcceleratorTypesTest() { String selfLink = "selfLink-1691268851"; AcceleratorType itemsElement = AcceleratorType.newBuilder().build(); List items = Arrays.asList(itemsElement); - AcceleratorTypeList expectedResponse = AcceleratorTypeList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + AcceleratorTypeList expectedResponse = + AcceleratorTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -213,22 +235,29 @@ public void listAcceleratorTypesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listAcceleratorTypesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -240,5 +269,4 @@ public void listAcceleratorTypesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index aedde8a54728..5e93ed070f5c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; +import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.aggregatedListAddressesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.deleteAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.getAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.insertAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.listAddressesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,14 +33,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.AddressClient.AggregatedListAddressesPagedResponse; -import static com.google.cloud.compute.v1.AddressClient.ListAddressesPagedResponse; import com.google.cloud.compute.v1.stub.AddressStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.aggregatedListAddressesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.deleteAddressMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.getAddressMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.insertAddressMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAddressStub.listAddressesMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -49,16 +50,16 @@ @javax.annotation.Generated("by GAPIC") public class AddressClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListAddressesMethodDescriptor, - deleteAddressMethodDescriptor, - getAddressMethodDescriptor, - insertAddressMethodDescriptor, - listAddressesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, AddressStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAddressesMethodDescriptor, + deleteAddressMethodDescriptor, + getAddressMethodDescriptor, + insertAddressMethodDescriptor, + listAddressesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, AddressStubSettings.getDefaultEndpoint()); private static AddressClient client; private static AddressSettings clientSettings; @@ -67,13 +68,13 @@ public class AddressClientTest { public static void setUp() throws IOException { clientSettings = AddressSettings.newBuilder() - .setTransportChannelProvider( - AddressSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - AddressClient.create(clientSettings); + .setTransportChannelProvider( + AddressSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AddressClient.create(clientSettings); } @After @@ -96,37 +97,47 @@ public void aggregatedListAddressesTest() { AddressesScopedList itemsItem = AddressesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - AddressAggregatedList expectedResponse = AddressAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + AddressAggregatedList expectedResponse = + AddressAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListAddressesPagedResponse pagedListResponse = client.aggregatedListAddresses(project); + AggregatedListAddressesPagedResponse pagedListResponse = + client.aggregatedListAddresses(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListAddressesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -163,55 +174,65 @@ public void deleteAddressTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + ProjectRegionAddressName address = + ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteAddress(address, requestId); + Operation actualResponse = client.deleteAddress(address, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteAddressExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + ProjectRegionAddressName address = + ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); String requestId = "requestId37109963"; client.deleteAddress(address, requestId); @@ -224,57 +245,68 @@ public void deleteAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getAddressTest() { - ProjectAddressName address2 = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String addressType = "addressType264307877"; String kind = "kind3292052"; String description = "description-1724546052"; String selfLink = "selfLink-1691268851"; String ipVersion = "ipVersion-1315653184"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String status = "status-892481550"; - Address expectedResponse = Address.newBuilder() - .setAddress(address2.toString()) - .setAddressType(addressType) - .setKind(kind) - .setDescription(description) - .setSelfLink(selfLink) - .setIpVersion(ipVersion) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .setStatus(status) - .build(); + Address expectedResponse = + Address.newBuilder() + .setAddress(address2.toString()) + .setAddressType(addressType) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + ProjectRegionAddressName address = + ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - Address actualResponse = - client.getAddress(address); + Address actualResponse = client.getAddress(address); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getAddressExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); + ProjectRegionAddressName address = + ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); client.getAddress(address); Assert.fail("No exception raised"); @@ -307,52 +339,60 @@ public void insertAddressTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Address addressResource = Address.newBuilder().build(); - Operation actualResponse = - client.insertAddress(requestId, region, addressResource); + Operation actualResponse = client.insertAddress(requestId, region, addressResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertAddressExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -376,13 +416,14 @@ public void listAddressesTest() { String selfLink = "selfLink-1691268851"; Address itemsElement = Address.newBuilder().build(); List

items = Arrays.asList(itemsElement); - AddressList expectedResponse = AddressList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + AddressList expectedResponse = + AddressList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -391,22 +432,29 @@ public void listAddressesTest() { List
resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listAddressesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -418,5 +466,4 @@ public void listAddressesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index 8fb3febd187a..d7980716d32a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -15,6 +15,16 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,16 +35,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.AutoscalerClient.AggregatedListAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.AutoscalerClient.ListAutoscalersPagedResponse; import com.google.cloud.compute.v1.stub.AutoscalerStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.aggregatedListAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.deleteAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.getAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.insertAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.listAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.patchAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonAutoscalerStub.updateAutoscalerMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -51,18 +52,18 @@ @javax.annotation.Generated("by GAPIC") public class AutoscalerClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListAutoscalersMethodDescriptor, - deleteAutoscalerMethodDescriptor, - getAutoscalerMethodDescriptor, - insertAutoscalerMethodDescriptor, - listAutoscalersMethodDescriptor, - patchAutoscalerMethodDescriptor, - updateAutoscalerMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListAutoscalersMethodDescriptor, + deleteAutoscalerMethodDescriptor, + getAutoscalerMethodDescriptor, + insertAutoscalerMethodDescriptor, + listAutoscalersMethodDescriptor, + patchAutoscalerMethodDescriptor, + updateAutoscalerMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, AutoscalerStubSettings.getDefaultEndpoint()); private static AutoscalerClient client; private static AutoscalerSettings clientSettings; @@ -71,13 +72,13 @@ public class AutoscalerClientTest { public static void setUp() throws IOException { clientSettings = AutoscalerSettings.newBuilder() - .setTransportChannelProvider( - AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - AutoscalerClient.create(clientSettings); + .setTransportChannelProvider( + AutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AutoscalerClient.create(clientSettings); } @After @@ -100,37 +101,47 @@ public void aggregatedListAutoscalersTest() { AutoscalersScopedList itemsItem = AutoscalersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - AutoscalerAggregatedList expectedResponse = AutoscalerAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + AutoscalerAggregatedList expectedResponse = + AutoscalerAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListAutoscalersPagedResponse pagedListResponse = client.aggregatedListAutoscalers(project); + AggregatedListAutoscalersPagedResponse pagedListResponse = + client.aggregatedListAutoscalers(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListAutoscalersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -167,55 +178,65 @@ public void deleteAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + ProjectZoneAutoscalerName autoscaler = + ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteAutoscaler(autoscaler, requestId); + Operation actualResponse = client.deleteAutoscaler(autoscaler, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + ProjectZoneAutoscalerName autoscaler = + ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); String requestId = "requestId37109963"; client.deleteAutoscaler(autoscaler, requestId); @@ -238,43 +259,53 @@ public void getAutoscalerTest() { String selfLink = "selfLink-1691268851"; String status = "status-892481550"; String target = "target-880905839"; - Autoscaler expectedResponse = Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setStatus(status) - .setTarget(target) - .build(); + Autoscaler expectedResponse = + Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .setTarget(target) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + ProjectZoneAutoscalerName autoscaler = + ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - Autoscaler actualResponse = - client.getAutoscaler(autoscaler); + Autoscaler actualResponse = client.getAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); + ProjectZoneAutoscalerName autoscaler = + ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); client.getAutoscaler(autoscaler); Assert.fail("No exception raised"); @@ -307,52 +338,60 @@ public void insertAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.insertAutoscaler(zone, requestId, autoscalerResource); + Operation actualResponse = client.insertAutoscaler(zone, requestId, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -376,13 +415,14 @@ public void listAutoscalersTest() { String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); - AutoscalerList expectedResponse = AutoscalerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + AutoscalerList expectedResponse = + AutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -391,22 +431,29 @@ public void listAutoscalersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listAutoscalersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -443,29 +490,30 @@ public void patchAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; @@ -480,16 +528,24 @@ public void patchAutoscalerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -529,29 +585,30 @@ public void updateAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; @@ -566,16 +623,24 @@ public void updateAutoscalerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -590,5 +655,4 @@ public void updateAutoscalerExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java index 5b02008c8c87..f20900a4e2b2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.deleteBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.getBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.insertBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.listBackendBucketsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.patchBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.updateBackendBucketMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; import com.google.cloud.compute.v1.stub.BackendBucketStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.deleteBackendBucketMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.getBackendBucketMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.insertBackendBucketMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.listBackendBucketsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.patchBackendBucketMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.updateBackendBucketMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class BackendBucketClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteBackendBucketMethodDescriptor, - getBackendBucketMethodDescriptor, - insertBackendBucketMethodDescriptor, - listBackendBucketsMethodDescriptor, - patchBackendBucketMethodDescriptor, - updateBackendBucketMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, BackendBucketStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteBackendBucketMethodDescriptor, + getBackendBucketMethodDescriptor, + insertBackendBucketMethodDescriptor, + listBackendBucketsMethodDescriptor, + patchBackendBucketMethodDescriptor, + updateBackendBucketMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, BackendBucketStubSettings.getDefaultEndpoint()); private static BackendBucketClient client; private static BackendBucketSettings clientSettings; @@ -68,13 +67,13 @@ public class BackendBucketClientTest { public static void setUp() throws IOException { clientSettings = BackendBucketSettings.newBuilder() - .setTransportChannelProvider( - BackendBucketSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - BackendBucketClient.create(clientSettings); + .setTransportChannelProvider( + BackendBucketSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BackendBucketClient.create(clientSettings); } @After @@ -111,55 +110,65 @@ public void deleteBackendBucketTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteBackendBucket(backendBucket, requestId); + Operation actualResponse = client.deleteBackendBucket(backendBucket, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteBackendBucketExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); String requestId = "requestId37109963"; client.deleteBackendBucket(backendBucket, requestId); @@ -180,41 +189,51 @@ public void getBackendBucketTest() { String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - BackendBucket expectedResponse = BackendBucket.newBuilder() - .setBucketName(bucketName) - .setEnableCdn(enableCdn) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + BackendBucket expectedResponse = + BackendBucket.newBuilder() + .setBucketName(bucketName) + .setEnableCdn(enableCdn) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - BackendBucket actualResponse = - client.getBackendBucket(backendBucket); + BackendBucket actualResponse = client.getBackendBucket(backendBucket); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getBackendBucketExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); client.getBackendBucket(backendBucket); Assert.fail("No exception raised"); @@ -247,29 +266,30 @@ public void insertBackendBucketTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -283,16 +303,24 @@ public void insertBackendBucketTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertBackendBucketExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -316,13 +344,14 @@ public void listBackendBucketsTest() { String selfLink = "selfLink-1691268851"; BackendBucket itemsElement = BackendBucket.newBuilder().build(); List items = Arrays.asList(itemsElement); - BackendBucketList expectedResponse = BackendBucketList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + BackendBucketList expectedResponse = + BackendBucketList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -331,22 +360,29 @@ public void listBackendBucketsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listBackendBucketsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -383,32 +419,34 @@ public void patchBackendBucketTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); @@ -419,20 +457,29 @@ public void patchBackendBucketTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchBackendBucketExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); @@ -467,32 +514,34 @@ public void updateBackendBucketTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); @@ -503,20 +552,29 @@ public void updateBackendBucketTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateBackendBucketExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectBackendBucketName backendBucket = ProjectBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); @@ -526,5 +584,4 @@ public void updateBackendBucketExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index d889a6c2eaf1..95e69a22696b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -15,6 +15,17 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.aggregatedListBackendServicesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.deleteBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getHealthBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.insertBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.listBackendServicesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.patchBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.updateBackendServiceMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,17 +36,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; import com.google.cloud.compute.v1.stub.BackendServiceStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.aggregatedListBackendServicesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.deleteBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getHealthBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.insertBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.listBackendServicesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.patchBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.updateBackendServiceMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -52,19 +53,19 @@ @javax.annotation.Generated("by GAPIC") public class BackendServiceClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListBackendServicesMethodDescriptor, - deleteBackendServiceMethodDescriptor, - getBackendServiceMethodDescriptor, - getHealthBackendServiceMethodDescriptor, - insertBackendServiceMethodDescriptor, - listBackendServicesMethodDescriptor, - patchBackendServiceMethodDescriptor, - updateBackendServiceMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, BackendServiceStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListBackendServicesMethodDescriptor, + deleteBackendServiceMethodDescriptor, + getBackendServiceMethodDescriptor, + getHealthBackendServiceMethodDescriptor, + insertBackendServiceMethodDescriptor, + listBackendServicesMethodDescriptor, + patchBackendServiceMethodDescriptor, + updateBackendServiceMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, BackendServiceStubSettings.getDefaultEndpoint()); private static BackendServiceClient client; private static BackendServiceSettings clientSettings; @@ -73,13 +74,13 @@ public class BackendServiceClientTest { public static void setUp() throws IOException { clientSettings = BackendServiceSettings.newBuilder() - .setTransportChannelProvider( - BackendServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - BackendServiceClient.create(clientSettings); + .setTransportChannelProvider( + BackendServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BackendServiceClient.create(clientSettings); } @After @@ -102,37 +103,47 @@ public void aggregatedListBackendServicesTest() { BackendServicesScopedList itemsItem = BackendServicesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - BackendServiceAggregatedList expectedResponse = BackendServiceAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + BackendServiceAggregatedList expectedResponse = + BackendServiceAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListBackendServicesPagedResponse pagedListResponse = client.aggregatedListBackendServices(project); + AggregatedListBackendServicesPagedResponse pagedListResponse = + client.aggregatedListBackendServices(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListBackendServicesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -169,56 +180,66 @@ public void deleteBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - Operation actualResponse = - client.deleteBackendService(requestId, backendService); + Operation actualResponse = client.deleteBackendService(requestId, backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); client.deleteBackendService(requestId, backendService); Assert.fail("No exception raised"); @@ -246,49 +267,59 @@ public void getBackendServiceTest() { String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - BackendService expectedResponse = BackendService.newBuilder() - .setAffinityCookieTtlSec(affinityCookieTtlSec) - .setKind(kind) - .setSessionAffinity(sessionAffinity) - .setDescription(description) - .setLoadBalancingScheme(loadBalancingScheme) - .setPortName(portName) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setProtocol(protocol) - .setEnableCDN(enableCDN) - .setPort(port) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + BackendService expectedResponse = + BackendService.newBuilder() + .setAffinityCookieTtlSec(affinityCookieTtlSec) + .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setPortName(portName) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setProtocol(protocol) + .setEnableCDN(enableCDN) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - BackendService actualResponse = - client.getBackendService(backendService); + BackendService actualResponse = client.getBackendService(backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); client.getBackendService(backendService); Assert.fail("No exception raised"); @@ -301,13 +332,14 @@ public void getBackendServiceExceptionTest() throws Exception { @SuppressWarnings("all") public void getHealthBackendServiceTest() { String kind = "kind3292052"; - BackendServiceGroupHealth expectedResponse = BackendServiceGroupHealth.newBuilder() - .setKind(kind) - .build(); + BackendServiceGroupHealth expectedResponse = + BackendServiceGroupHealth.newBuilder().setKind(kind).build(); mockService.addResponse(expectedResponse); - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = + ResourceGroupReference.newBuilder().build(); BackendServiceGroupHealth actualResponse = client.getHealthBackendService(backendService, resourceGroupReferenceResource); @@ -316,21 +348,31 @@ public void getHealthBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getHealthBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = + ResourceGroupReference.newBuilder().build(); client.getHealthBackendService(backendService, resourceGroupReferenceResource); Assert.fail("No exception raised"); @@ -363,29 +405,30 @@ public void insertBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -399,16 +442,24 @@ public void insertBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -432,13 +483,14 @@ public void listBackendServicesTest() { String selfLink = "selfLink-1691268851"; BackendService itemsElement = BackendService.newBuilder().build(); List items = Arrays.asList(itemsElement); - BackendServiceList expectedResponse = BackendServiceList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + BackendServiceList expectedResponse = + BackendServiceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -447,22 +499,29 @@ public void listBackendServicesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listBackendServicesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -499,33 +558,35 @@ public void patchBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = @@ -535,21 +596,30 @@ public void patchBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); client.patchBackendService(requestId, backendService, backendServiceResource); @@ -583,33 +653,35 @@ public void updateBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = @@ -619,21 +691,30 @@ public void updateBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); client.updateBackendService(requestId, backendService, backendServiceResource); @@ -642,5 +723,4 @@ public void updateBackendServiceExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 294a8846e368..5a69e0cf4f9a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -15,6 +15,17 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; +import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.aggregatedListDisksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.createSnapshotDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.deleteDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.getDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.insertDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.listDisksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.resizeDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.setLabelsDiskMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,17 +36,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.DiskClient.AggregatedListDisksPagedResponse; -import static com.google.cloud.compute.v1.DiskClient.ListDisksPagedResponse; import com.google.cloud.compute.v1.stub.DiskStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.aggregatedListDisksMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.createSnapshotDiskMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.deleteDiskMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.getDiskMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.insertDiskMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.listDisksMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.resizeDiskMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.setLabelsDiskMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -52,19 +53,19 @@ @javax.annotation.Generated("by GAPIC") public class DiskClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListDisksMethodDescriptor, - createSnapshotDiskMethodDescriptor, - deleteDiskMethodDescriptor, - getDiskMethodDescriptor, - insertDiskMethodDescriptor, - listDisksMethodDescriptor, - resizeDiskMethodDescriptor, - setLabelsDiskMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, DiskStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListDisksMethodDescriptor, + createSnapshotDiskMethodDescriptor, + deleteDiskMethodDescriptor, + getDiskMethodDescriptor, + insertDiskMethodDescriptor, + listDisksMethodDescriptor, + resizeDiskMethodDescriptor, + setLabelsDiskMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, DiskStubSettings.getDefaultEndpoint()); private static DiskClient client; private static DiskSettings clientSettings; @@ -73,13 +74,13 @@ public class DiskClientTest { public static void setUp() throws IOException { clientSettings = DiskSettings.newBuilder() - .setTransportChannelProvider( - DiskSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - DiskClient.create(clientSettings); + .setTransportChannelProvider( + DiskSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DiskClient.create(clientSettings); } @After @@ -102,13 +103,14 @@ public void aggregatedListDisksTest() { DisksScopedList itemsItem = DisksScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - DiskAggregatedList expectedResponse = DiskAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + DiskAggregatedList expectedResponse = + DiskAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -117,22 +119,30 @@ public void aggregatedListDisksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListDisksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -169,29 +179,30 @@ public void createSnapshotDiskTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); @@ -206,16 +217,24 @@ public void createSnapshotDiskTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void createSnapshotDiskExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -255,51 +274,59 @@ public void deleteDiskTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteDisk(disk, requestId); + Operation actualResponse = client.deleteDisk(disk, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteDiskExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -334,47 +361,55 @@ public void getDiskTest() { String name = "name3373707"; String sourceImage = "sourceImage1661056055"; String status = "status-892481550"; - Disk expectedResponse = Disk.newBuilder() - .setSizeGb(sizeGb) - .setSourceSnapshotId(sourceSnapshotId) - .setLastDetachTimestamp(lastDetachTimestamp) - .setDescription(description) - .setSourceSnapshot(sourceSnapshot) - .setType(type) - .setLabelFingerprint(labelFingerprint) - .setZone(zone.toString()) - .setCreationTimestamp(creationTimestamp) - .setOptions(options) - .setId(id) - .setSourceImageId(sourceImageId) - .setKind(kind) - .setLastAttachTimestamp(lastAttachTimestamp) - .setSelfLink(selfLink) - .setName(name) - .setSourceImage(sourceImage) - .setStatus(status) - .build(); + Disk expectedResponse = + Disk.newBuilder() + .setSizeGb(sizeGb) + .setSourceSnapshotId(sourceSnapshotId) + .setLastDetachTimestamp(lastDetachTimestamp) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setType(type) + .setLabelFingerprint(labelFingerprint) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setOptions(options) + .setId(id) + .setSourceImageId(sourceImageId) + .setKind(kind) + .setLastAttachTimestamp(lastAttachTimestamp) + .setSelfLink(selfLink) + .setName(name) + .setSourceImage(sourceImage) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - Disk actualResponse = - client.getDisk(disk); + Disk actualResponse = client.getDisk(disk); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getDiskExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -411,29 +446,30 @@ public void insertDiskTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -441,23 +477,30 @@ public void insertDiskTest() { String sourceImage = "sourceImage1661056055"; Disk diskResource = Disk.newBuilder().build(); - Operation actualResponse = - client.insertDisk(zone, requestId, sourceImage, diskResource); + Operation actualResponse = client.insertDisk(zone, requestId, sourceImage, diskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertDiskExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -482,13 +525,14 @@ public void listDisksTest() { String selfLink = "selfLink-1691268851"; Disk itemsElement = Disk.newBuilder().build(); List items = Arrays.asList(itemsElement); - DiskList expectedResponse = DiskList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + DiskList expectedResponse = + DiskList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -497,22 +541,29 @@ public void listDisksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listDisksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -549,52 +600,60 @@ public void resizeDiskTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); String requestId = "requestId37109963"; DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); - Operation actualResponse = - client.resizeDisk(disk, requestId, disksResizeRequestResource); + Operation actualResponse = client.resizeDisk(disk, requestId, disksResizeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void resizeDiskExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -633,32 +692,34 @@ public void setLabelsDiskTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); String requestId = "requestId37109963"; ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build(); @@ -669,20 +730,29 @@ public void setLabelsDiskTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setLabelsDiskExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneDiskName resource = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); String requestId = "requestId37109963"; ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build(); @@ -692,5 +762,4 @@ public void setLabelsDiskExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java index c9567bc794ba..7459f7997e95 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.aggregatedListDiskTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.getDiskTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.listDiskTypesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,12 +31,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; -import static com.google.cloud.compute.v1.DiskTypeClient.ListDiskTypesPagedResponse; import com.google.cloud.compute.v1.stub.DiskTypeStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.aggregatedListDiskTypesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.getDiskTypeMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonDiskTypeStub.listDiskTypesMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -47,14 +48,14 @@ @javax.annotation.Generated("by GAPIC") public class DiskTypeClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListDiskTypesMethodDescriptor, - getDiskTypeMethodDescriptor, - listDiskTypesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, DiskTypeStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListDiskTypesMethodDescriptor, + getDiskTypeMethodDescriptor, + listDiskTypesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, DiskTypeStubSettings.getDefaultEndpoint()); private static DiskTypeClient client; private static DiskTypeSettings clientSettings; @@ -63,13 +64,13 @@ public class DiskTypeClientTest { public static void setUp() throws IOException { clientSettings = DiskTypeSettings.newBuilder() - .setTransportChannelProvider( - DiskTypeSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - DiskTypeClient.create(clientSettings); + .setTransportChannelProvider( + DiskTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DiskTypeClient.create(clientSettings); } @After @@ -92,37 +93,47 @@ public void aggregatedListDiskTypesTest() { DiskTypesScopedList itemsItem = DiskTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - DiskTypeAggregatedList expectedResponse = DiskTypeAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + DiskTypeAggregatedList expectedResponse = + DiskTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListDiskTypesPagedResponse pagedListResponse = client.aggregatedListDiskTypes(project); + AggregatedListDiskTypesPagedResponse pagedListResponse = + client.aggregatedListDiskTypes(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListDiskTypesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -147,42 +158,52 @@ public void getDiskTypeTest() { String id = "id3355"; String validDiskSize = "validDiskSize-1653521184"; String selfLink = "selfLink-1691268851"; - DiskType expectedResponse = DiskType.newBuilder() - .setDefaultDiskSizeGb(defaultDiskSizeGb) - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setValidDiskSize(validDiskSize) - .setSelfLink(selfLink) - .build(); + DiskType expectedResponse = + DiskType.newBuilder() + .setDefaultDiskSizeGb(defaultDiskSizeGb) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setValidDiskSize(validDiskSize) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); + ProjectZoneDiskTypeName diskType = + ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); - DiskType actualResponse = - client.getDiskType(diskType); + DiskType actualResponse = client.getDiskType(diskType); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getDiskTypeExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneDiskTypeName diskType = ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); + ProjectZoneDiskTypeName diskType = + ProjectZoneDiskTypeName.of("[PROJECT]", "[ZONE]", "[DISK_TYPE]"); client.getDiskType(diskType); Assert.fail("No exception raised"); @@ -200,13 +221,14 @@ public void listDiskTypesTest() { String selfLink = "selfLink-1691268851"; DiskType itemsElement = DiskType.newBuilder().build(); List items = Arrays.asList(itemsElement); - DiskTypeList expectedResponse = DiskTypeList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + DiskTypeList expectedResponse = + DiskTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -215,22 +237,29 @@ public void listDiskTypesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listDiskTypesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -242,5 +271,4 @@ public void listDiskTypesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java index b0359dc8d469..9532b1fe0654 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.deleteFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.getFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.insertFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.listFirewallsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.patchFirewallMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.updateFirewallMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.FirewallClient.ListFirewallsPagedResponse; import com.google.cloud.compute.v1.stub.FirewallStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.deleteFirewallMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.getFirewallMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.insertFirewallMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.listFirewallsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.patchFirewallMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonFirewallStub.updateFirewallMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class FirewallClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteFirewallMethodDescriptor, - getFirewallMethodDescriptor, - insertFirewallMethodDescriptor, - listFirewallsMethodDescriptor, - patchFirewallMethodDescriptor, - updateFirewallMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, FirewallStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteFirewallMethodDescriptor, + getFirewallMethodDescriptor, + insertFirewallMethodDescriptor, + listFirewallsMethodDescriptor, + patchFirewallMethodDescriptor, + updateFirewallMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, FirewallStubSettings.getDefaultEndpoint()); private static FirewallClient client; private static FirewallSettings clientSettings; @@ -68,13 +67,13 @@ public class FirewallClientTest { public static void setUp() throws IOException { clientSettings = FirewallSettings.newBuilder() - .setTransportChannelProvider( - FirewallSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - FirewallClient.create(clientSettings); + .setTransportChannelProvider( + FirewallSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FirewallClient.create(clientSettings); } @After @@ -111,55 +110,63 @@ public void deleteFirewallTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteFirewall(firewall, requestId); + Operation actualResponse = client.deleteFirewall(firewall, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteFirewallExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); String requestId = "requestId37109963"; client.deleteFirewall(firewall, requestId); @@ -175,48 +182,56 @@ public void getFirewallTest() { String kind = "kind3292052"; String description = "description-1724546052"; Integer priority = 1165461084; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; String direction = "direction-962590849"; - Firewall expectedResponse = Firewall.newBuilder() - .setKind(kind) - .setDescription(description) - .setPriority(priority) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setDirection(direction) - .build(); + Firewall expectedResponse = + Firewall.newBuilder() + .setKind(kind) + .setDescription(description) + .setPriority(priority) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setDirection(direction) + .build(); mockService.addResponse(expectedResponse); - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - Firewall actualResponse = - client.getFirewall(firewall); + Firewall actualResponse = client.getFirewall(firewall); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getFirewallExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); client.getFirewall(firewall); Assert.fail("No exception raised"); @@ -249,52 +264,60 @@ public void insertFirewallTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Firewall firewallResource = Firewall.newBuilder().build(); - Operation actualResponse = - client.insertFirewall(requestId, project, firewallResource); + Operation actualResponse = client.insertFirewall(requestId, project, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertFirewallExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -318,13 +341,14 @@ public void listFirewallsTest() { String selfLink = "selfLink-1691268851"; Firewall itemsElement = Firewall.newBuilder().build(); List items = Arrays.asList(itemsElement); - FirewallList expectedResponse = FirewallList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + FirewallList expectedResponse = + FirewallList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -333,22 +357,29 @@ public void listFirewallsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listFirewallsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -385,56 +416,64 @@ public void patchFirewallTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - Operation actualResponse = - client.patchFirewall(firewall, requestId, firewallResource); + Operation actualResponse = client.patchFirewall(firewall, requestId, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchFirewallExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); @@ -469,56 +508,64 @@ public void updateFirewallTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - Operation actualResponse = - client.updateFirewall(firewall, requestId, firewallResource); + Operation actualResponse = client.updateFirewall(firewall, requestId, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateFirewallExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectFirewallName firewall = ProjectFirewallName.of("[PROJECT]", "[FIREWALL]"); + ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); @@ -528,5 +575,4 @@ public void updateFirewallExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 4b8f109fde66..276fe84f04fc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -15,6 +15,15 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.aggregatedListForwardingRulesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.deleteForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.getForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.insertForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.listForwardingRulesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.setTargetForwardingRuleMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,15 +34,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.ForwardingRuleClient.AggregatedListForwardingRulesPagedResponse; -import static com.google.cloud.compute.v1.ForwardingRuleClient.ListForwardingRulesPagedResponse; import com.google.cloud.compute.v1.stub.ForwardingRuleStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.aggregatedListForwardingRulesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.deleteForwardingRuleMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.getForwardingRuleMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.insertForwardingRuleMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.listForwardingRulesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonForwardingRuleStub.setTargetForwardingRuleMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -50,17 +51,17 @@ @javax.annotation.Generated("by GAPIC") public class ForwardingRuleClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListForwardingRulesMethodDescriptor, - deleteForwardingRuleMethodDescriptor, - getForwardingRuleMethodDescriptor, - insertForwardingRuleMethodDescriptor, - listForwardingRulesMethodDescriptor, - setTargetForwardingRuleMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, ForwardingRuleStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListForwardingRulesMethodDescriptor, + deleteForwardingRuleMethodDescriptor, + getForwardingRuleMethodDescriptor, + insertForwardingRuleMethodDescriptor, + listForwardingRulesMethodDescriptor, + setTargetForwardingRuleMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, ForwardingRuleStubSettings.getDefaultEndpoint()); private static ForwardingRuleClient client; private static ForwardingRuleSettings clientSettings; @@ -69,13 +70,13 @@ public class ForwardingRuleClientTest { public static void setUp() throws IOException { clientSettings = ForwardingRuleSettings.newBuilder() - .setTransportChannelProvider( - ForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - ForwardingRuleClient.create(clientSettings); + .setTransportChannelProvider( + ForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ForwardingRuleClient.create(clientSettings); } @After @@ -98,37 +99,47 @@ public void aggregatedListForwardingRulesTest() { ForwardingRulesScopedList itemsItem = ForwardingRulesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - ForwardingRuleAggregatedList expectedResponse = ForwardingRuleAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + ForwardingRuleAggregatedList expectedResponse = + ForwardingRuleAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListForwardingRulesPagedResponse pagedListResponse = client.aggregatedListForwardingRules(project); + AggregatedListForwardingRulesPagedResponse pagedListResponse = + client.aggregatedListForwardingRules(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListForwardingRulesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -165,56 +176,66 @@ public void deleteForwardingRuleTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + ProjectRegionForwardingRuleName forwardingRule = + ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); - Operation actualResponse = - client.deleteForwardingRule(requestId, forwardingRule); + Operation actualResponse = client.deleteForwardingRule(requestId, forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + ProjectRegionForwardingRuleName forwardingRule = + ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); client.deleteForwardingRule(requestId, forwardingRule); Assert.fail("No exception raised"); @@ -229,62 +250,74 @@ public void getForwardingRuleTest() { String portRange = "portRange217518079"; String kind = "kind3292052"; String iPProtocol = "iPProtocol323774237"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); String description = "description-1724546052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String target = "target-880905839"; String ipVersion = "ipVersion-1315653184"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; String iPAddress = "iPAddress-551149873"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ForwardingRule expectedResponse = ForwardingRule.newBuilder() - .setPortRange(portRange) - .setKind(kind) - .setIPProtocol(iPProtocol) - .setBackendService(backendService.toString()) - .setDescription(description) - .setLoadBalancingScheme(loadBalancingScheme) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setTarget(target) - .setIpVersion(ipVersion) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setIPAddress(iPAddress) - .setRegion(region.toString()) - .build(); + ForwardingRule expectedResponse = + ForwardingRule.newBuilder() + .setPortRange(portRange) + .setKind(kind) + .setIPProtocol(iPProtocol) + .setBackendService(backendService.toString()) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setIPAddress(iPAddress) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + ProjectRegionForwardingRuleName forwardingRule = + ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); - ForwardingRule actualResponse = - client.getForwardingRule(forwardingRule); + ForwardingRule actualResponse = client.getForwardingRule(forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + ProjectRegionForwardingRuleName forwardingRule = + ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); client.getForwardingRule(forwardingRule); Assert.fail("No exception raised"); @@ -317,29 +350,30 @@ public void insertForwardingRuleTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -353,16 +387,24 @@ public void insertForwardingRuleTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -386,13 +428,14 @@ public void listForwardingRulesTest() { String selfLink = "selfLink-1691268851"; ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); List items = Arrays.asList(itemsElement); - ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + ForwardingRuleList expectedResponse = + ForwardingRuleList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -401,22 +444,29 @@ public void listForwardingRulesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listForwardingRulesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -453,33 +503,35 @@ public void setTargetForwardingRuleTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + ProjectRegionForwardingRuleName forwardingRule = + ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = @@ -489,21 +541,30 @@ public void setTargetForwardingRuleTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setTargetForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); + ProjectRegionForwardingRuleName forwardingRule = + ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); client.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource); @@ -512,5 +573,4 @@ public void setTargetForwardingRuleExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index da132639161a..b421f542bb85 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.deleteGlobalAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.getGlobalAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.insertGlobalAddressMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.listGlobalAddressesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,19 +31,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.GlobalAddressClient.ListGlobalAddressesPagedResponse; import com.google.cloud.compute.v1.stub.GlobalAddressStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.deleteGlobalAddressMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.getGlobalAddressMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.insertGlobalAddressMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalAddressStub.listGlobalAddressesMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,15 +46,15 @@ @javax.annotation.Generated("by GAPIC") public class GlobalAddressClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteGlobalAddressMethodDescriptor, - getGlobalAddressMethodDescriptor, - insertGlobalAddressMethodDescriptor, - listGlobalAddressesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, GlobalAddressStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteGlobalAddressMethodDescriptor, + getGlobalAddressMethodDescriptor, + insertGlobalAddressMethodDescriptor, + listGlobalAddressesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, GlobalAddressStubSettings.getDefaultEndpoint()); private static GlobalAddressClient client; private static GlobalAddressSettings clientSettings; @@ -64,13 +63,13 @@ public class GlobalAddressClientTest { public static void setUp() throws IOException { clientSettings = GlobalAddressSettings.newBuilder() - .setTransportChannelProvider( - GlobalAddressSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - GlobalAddressClient.create(clientSettings); + .setTransportChannelProvider( + GlobalAddressSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GlobalAddressClient.create(clientSettings); } @After @@ -107,55 +106,63 @@ public void deleteGlobalAddressTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteGlobalAddress(address, requestId); + Operation actualResponse = client.deleteGlobalAddress(address, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteGlobalAddressExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String requestId = "requestId37109963"; client.deleteGlobalAddress(address, requestId); @@ -168,57 +175,66 @@ public void deleteGlobalAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getGlobalAddressTest() { - ProjectAddressName address2 = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String addressType = "addressType264307877"; String kind = "kind3292052"; String description = "description-1724546052"; String selfLink = "selfLink-1691268851"; String ipVersion = "ipVersion-1315653184"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String status = "status-892481550"; - Address expectedResponse = Address.newBuilder() - .setAddress(address2.toString()) - .setAddressType(addressType) - .setKind(kind) - .setDescription(description) - .setSelfLink(selfLink) - .setIpVersion(ipVersion) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .setStatus(status) - .build(); + Address expectedResponse = + Address.newBuilder() + .setAddress(address2.toString()) + .setAddressType(addressType) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); - Address actualResponse = - client.getGlobalAddress(address); + Address actualResponse = client.getGlobalAddress(address); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getGlobalAddressExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); client.getGlobalAddress(address); Assert.fail("No exception raised"); @@ -251,52 +267,60 @@ public void insertGlobalAddressTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Address addressResource = Address.newBuilder().build(); - Operation actualResponse = - client.insertGlobalAddress(requestId, project, addressResource); + Operation actualResponse = client.insertGlobalAddress(requestId, project, addressResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertGlobalAddressExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -320,13 +344,14 @@ public void listGlobalAddressesTest() { String selfLink = "selfLink-1691268851"; Address itemsElement = Address.newBuilder().build(); List
items = Arrays.asList(itemsElement); - AddressList expectedResponse = AddressList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + AddressList expectedResponse = + AddressList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -335,22 +360,29 @@ public void listGlobalAddressesTest() { List
resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listGlobalAddressesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -362,5 +394,4 @@ public void listGlobalAddressesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index def10b699f90..3304df1a2989 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.deleteGlobalForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.getGlobalForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.insertGlobalForwardingRuleMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.listGlobalForwardingRulesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.setTargetGlobalForwardingRuleMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,20 +32,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.GlobalForwardingRuleClient.ListGlobalForwardingRulesPagedResponse; import com.google.cloud.compute.v1.stub.GlobalForwardingRuleStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.deleteGlobalForwardingRuleMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.getGlobalForwardingRuleMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.insertGlobalForwardingRuleMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.listGlobalForwardingRulesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalForwardingRuleStub.setTargetGlobalForwardingRuleMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -48,16 +47,17 @@ @javax.annotation.Generated("by GAPIC") public class GlobalForwardingRuleClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteGlobalForwardingRuleMethodDescriptor, - getGlobalForwardingRuleMethodDescriptor, - insertGlobalForwardingRuleMethodDescriptor, - listGlobalForwardingRulesMethodDescriptor, - setTargetGlobalForwardingRuleMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, GlobalForwardingRuleStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteGlobalForwardingRuleMethodDescriptor, + getGlobalForwardingRuleMethodDescriptor, + insertGlobalForwardingRuleMethodDescriptor, + listGlobalForwardingRulesMethodDescriptor, + setTargetGlobalForwardingRuleMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService( + METHOD_DESCRIPTORS, GlobalForwardingRuleStubSettings.getDefaultEndpoint()); private static GlobalForwardingRuleClient client; private static GlobalForwardingRuleSettings clientSettings; @@ -66,13 +66,13 @@ public class GlobalForwardingRuleClientTest { public static void setUp() throws IOException { clientSettings = GlobalForwardingRuleSettings.newBuilder() - .setTransportChannelProvider( - GlobalForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - GlobalForwardingRuleClient.create(clientSettings); + .setTransportChannelProvider( + GlobalForwardingRuleSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GlobalForwardingRuleClient.create(clientSettings); } @After @@ -109,56 +109,66 @@ public void deleteGlobalForwardingRuleTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + ProjectGlobalForwardingRuleName forwardingRule = + ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); - Operation actualResponse = - client.deleteGlobalForwardingRule(requestId, forwardingRule); + Operation actualResponse = client.deleteGlobalForwardingRule(requestId, forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteGlobalForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + ProjectGlobalForwardingRuleName forwardingRule = + ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); client.deleteGlobalForwardingRule(requestId, forwardingRule); Assert.fail("No exception raised"); @@ -173,62 +183,74 @@ public void getGlobalForwardingRuleTest() { String portRange = "portRange217518079"; String kind = "kind3292052"; String iPProtocol = "iPProtocol323774237"; - ProjectBackendServiceName backendService = ProjectBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); String description = "description-1724546052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String target = "target-880905839"; String ipVersion = "ipVersion-1315653184"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; String iPAddress = "iPAddress-551149873"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ForwardingRule expectedResponse = ForwardingRule.newBuilder() - .setPortRange(portRange) - .setKind(kind) - .setIPProtocol(iPProtocol) - .setBackendService(backendService.toString()) - .setDescription(description) - .setLoadBalancingScheme(loadBalancingScheme) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setTarget(target) - .setIpVersion(ipVersion) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setIPAddress(iPAddress) - .setRegion(region.toString()) - .build(); + ForwardingRule expectedResponse = + ForwardingRule.newBuilder() + .setPortRange(portRange) + .setKind(kind) + .setIPProtocol(iPProtocol) + .setBackendService(backendService.toString()) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setTarget(target) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setIPAddress(iPAddress) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + ProjectGlobalForwardingRuleName forwardingRule = + ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); - ForwardingRule actualResponse = - client.getGlobalForwardingRule(forwardingRule); + ForwardingRule actualResponse = client.getGlobalForwardingRule(forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getGlobalForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + ProjectGlobalForwardingRuleName forwardingRule = + ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); client.getGlobalForwardingRule(forwardingRule); Assert.fail("No exception raised"); @@ -261,29 +283,30 @@ public void insertGlobalForwardingRuleTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -297,16 +320,24 @@ public void insertGlobalForwardingRuleTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertGlobalForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -330,37 +361,46 @@ public void listGlobalForwardingRulesTest() { String selfLink = "selfLink-1691268851"; ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); List items = Arrays.asList(itemsElement); - ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + ForwardingRuleList expectedResponse = + ForwardingRuleList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - ListGlobalForwardingRulesPagedResponse pagedListResponse = client.listGlobalForwardingRules(project); + ListGlobalForwardingRulesPagedResponse pagedListResponse = + client.listGlobalForwardingRules(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listGlobalForwardingRulesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -397,33 +437,35 @@ public void setTargetGlobalForwardingRuleTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + ProjectGlobalForwardingRuleName forwardingRule = + ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = @@ -433,21 +475,30 @@ public void setTargetGlobalForwardingRuleTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setTargetGlobalForwardingRuleExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectForwardingRuleName forwardingRule = ProjectForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); + ProjectGlobalForwardingRuleName forwardingRule = + ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); client.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource); @@ -456,5 +507,4 @@ public void setTargetGlobalForwardingRuleExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java index 21a2d2be2501..fa158abe61d9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.aggregatedListGlobalOperationsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.deleteGlobalOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.getGlobalOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.listGlobalOperationsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,13 +32,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.GlobalOperationClient.AggregatedListGlobalOperationsPagedResponse; -import static com.google.cloud.compute.v1.GlobalOperationClient.ListGlobalOperationsPagedResponse; import com.google.cloud.compute.v1.stub.GlobalOperationStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.aggregatedListGlobalOperationsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.deleteGlobalOperationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.getGlobalOperationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonGlobalOperationStub.listGlobalOperationsMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; @@ -48,15 +49,15 @@ @javax.annotation.Generated("by GAPIC") public class GlobalOperationClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListGlobalOperationsMethodDescriptor, - deleteGlobalOperationMethodDescriptor, - getGlobalOperationMethodDescriptor, - listGlobalOperationsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, GlobalOperationStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListGlobalOperationsMethodDescriptor, + deleteGlobalOperationMethodDescriptor, + getGlobalOperationMethodDescriptor, + listGlobalOperationsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, GlobalOperationStubSettings.getDefaultEndpoint()); private static GlobalOperationClient client; private static GlobalOperationSettings clientSettings; @@ -65,13 +66,13 @@ public class GlobalOperationClientTest { public static void setUp() throws IOException { clientSettings = GlobalOperationSettings.newBuilder() - .setTransportChannelProvider( - GlobalOperationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - GlobalOperationClient.create(clientSettings); + .setTransportChannelProvider( + GlobalOperationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GlobalOperationClient.create(clientSettings); } @After @@ -94,37 +95,47 @@ public void aggregatedListGlobalOperationsTest() { OperationsScopedList itemsItem = OperationsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - OperationAggregatedList expectedResponse = OperationAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + OperationAggregatedList expectedResponse = + OperationAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListGlobalOperationsPagedResponse pagedListResponse = client.aggregatedListGlobalOperations(project); + AggregatedListGlobalOperationsPagedResponse pagedListResponse = + client.aggregatedListGlobalOperations(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListGlobalOperationsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -142,27 +153,37 @@ public void aggregatedListGlobalOperationsExceptionTest() throws Exception { public void deleteGlobalOperationTest() { mockService.addNullResponse(); - ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]"); + ProjectGlobalOperationName operation = + ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]"); client.deleteGlobalOperation(operation); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteGlobalOperationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]"); + ProjectGlobalOperationName operation = + ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]"); client.deleteGlobalOperation(operation); Assert.fail("No exception raised"); @@ -195,54 +216,64 @@ public void getGlobalOperationTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]"); + ProjectGlobalOperationName operation = + ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]"); - Operation actualResponse = - client.getGlobalOperation(operation); + Operation actualResponse = client.getGlobalOperation(operation); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getGlobalOperationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectOperationName operation = ProjectOperationName.of("[PROJECT]", "[OPERATION]"); + ProjectGlobalOperationName operation = + ProjectGlobalOperationName.of("[PROJECT]", "[OPERATION]"); client.getGlobalOperation(operation); Assert.fail("No exception raised"); @@ -260,13 +291,14 @@ public void listGlobalOperationsTest() { String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); - OperationList expectedResponse = OperationList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + OperationList expectedResponse = + OperationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -275,22 +307,29 @@ public void listGlobalOperationsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listGlobalOperationsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -302,5 +341,4 @@ public void listGlobalOperationsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java index b8c21347b397..7a83cf68696e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.deleteHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.getHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.insertHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.listHealthChecksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.patchHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.updateHealthCheckMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.HealthCheckClient.ListHealthChecksPagedResponse; import com.google.cloud.compute.v1.stub.HealthCheckStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.deleteHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.getHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.insertHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.listHealthChecksMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.patchHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHealthCheckStub.updateHealthCheckMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class HealthCheckClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteHealthCheckMethodDescriptor, - getHealthCheckMethodDescriptor, - insertHealthCheckMethodDescriptor, - listHealthChecksMethodDescriptor, - patchHealthCheckMethodDescriptor, - updateHealthCheckMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, HealthCheckStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteHealthCheckMethodDescriptor, + getHealthCheckMethodDescriptor, + insertHealthCheckMethodDescriptor, + listHealthChecksMethodDescriptor, + patchHealthCheckMethodDescriptor, + updateHealthCheckMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, HealthCheckStubSettings.getDefaultEndpoint()); private static HealthCheckClient client; private static HealthCheckSettings clientSettings; @@ -68,13 +67,13 @@ public class HealthCheckClientTest { public static void setUp() throws IOException { clientSettings = HealthCheckSettings.newBuilder() - .setTransportChannelProvider( - HealthCheckSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - HealthCheckClient.create(clientSettings); + .setTransportChannelProvider( + HealthCheckSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HealthCheckClient.create(clientSettings); } @After @@ -111,56 +110,66 @@ public void deleteHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); - Operation actualResponse = - client.deleteHealthCheck(requestId, healthCheck); + Operation actualResponse = client.deleteHealthCheck(requestId, healthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); client.deleteHealthCheck(requestId, healthCheck); Assert.fail("No exception raised"); @@ -183,44 +192,54 @@ public void getHealthCheckTest() { Integer unhealthyThreshold = 1838571216; Integer healthyThreshold = 133658551; String id = "id3355"; - HealthCheck expectedResponse = HealthCheck.newBuilder() - .setCheckIntervalSec(checkIntervalSec) - .setKind(kind) - .setDescription(description) - .setType(type) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setUnhealthyThreshold(unhealthyThreshold) - .setHealthyThreshold(healthyThreshold) - .setId(id) - .build(); + HealthCheck expectedResponse = + HealthCheck.newBuilder() + .setCheckIntervalSec(checkIntervalSec) + .setKind(kind) + .setDescription(description) + .setType(type) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .build(); mockService.addResponse(expectedResponse); - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); - HealthCheck actualResponse = - client.getHealthCheck(healthCheck); + HealthCheck actualResponse = client.getHealthCheck(healthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); client.getHealthCheck(healthCheck); Assert.fail("No exception raised"); @@ -253,52 +272,60 @@ public void insertHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - Operation actualResponse = - client.insertHealthCheck(requestId, project, healthCheckResource); + Operation actualResponse = client.insertHealthCheck(requestId, project, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -322,13 +349,14 @@ public void listHealthChecksTest() { String selfLink = "selfLink-1691268851"; HealthCheck itemsElement = HealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); - HealthCheckList expectedResponse = HealthCheckList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + HealthCheckList expectedResponse = + HealthCheckList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -337,22 +365,29 @@ public void listHealthChecksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listHealthChecksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -389,57 +424,67 @@ public void patchHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - Operation actualResponse = - client.patchHealthCheck(requestId, healthCheck, healthCheckResource); + Operation actualResponse = client.patchHealthCheck(requestId, healthCheck, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); client.patchHealthCheck(requestId, healthCheck, healthCheckResource); @@ -473,33 +518,35 @@ public void updateHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); Operation actualResponse = @@ -509,21 +556,30 @@ public void updateHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectHealthCheckName healthCheck = ProjectHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); + ProjectGlobalHealthCheckName healthCheck = + ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); client.updateHealthCheck(requestId, healthCheck, healthCheckResource); @@ -532,5 +588,4 @@ public void updateHealthCheckExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index 6d22aeba32e5..77f3d4937785 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.deleteHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.getHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.insertHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.listHttpHealthChecksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.patchHttpHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.updateHttpHealthCheckMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.HttpHealthCheckClient.ListHttpHealthChecksPagedResponse; import com.google.cloud.compute.v1.stub.HttpHealthCheckStubSettings; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.deleteHttpHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.getHttpHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.insertHttpHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.listHttpHealthChecksMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.patchHttpHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpHealthCheckStub.updateHttpHealthCheckMethodDescriptor; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class HttpHealthCheckClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteHttpHealthCheckMethodDescriptor, - getHttpHealthCheckMethodDescriptor, - insertHttpHealthCheckMethodDescriptor, - listHttpHealthChecksMethodDescriptor, - patchHttpHealthCheckMethodDescriptor, - updateHttpHealthCheckMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, HttpHealthCheckStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteHttpHealthCheckMethodDescriptor, + getHttpHealthCheckMethodDescriptor, + insertHttpHealthCheckMethodDescriptor, + listHttpHealthChecksMethodDescriptor, + patchHttpHealthCheckMethodDescriptor, + updateHttpHealthCheckMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, HttpHealthCheckStubSettings.getDefaultEndpoint()); private static HttpHealthCheckClient client; private static HttpHealthCheckSettings clientSettings; @@ -68,13 +67,13 @@ public class HttpHealthCheckClientTest { public static void setUp() throws IOException { clientSettings = HttpHealthCheckSettings.newBuilder() - .setTransportChannelProvider( - HttpHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - HttpHealthCheckClient.create(clientSettings); + .setTransportChannelProvider( + HttpHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HttpHealthCheckClient.create(clientSettings); } @After @@ -111,56 +110,66 @@ public void deleteHttpHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - Operation actualResponse = - client.deleteHttpHealthCheck(requestId, httpHealthCheck); + Operation actualResponse = client.deleteHttpHealthCheck(requestId, httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteHttpHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); client.deleteHttpHealthCheck(requestId, httpHealthCheck); Assert.fail("No exception raised"); @@ -185,46 +194,56 @@ public void getHttpHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpHealthCheck expectedResponse = HttpHealthCheck.newBuilder() - .setCheckIntervalSec(checkIntervalSec) - .setKind(kind) - .setDescription(description) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setPort(port) - .setCreationTimestamp(creationTimestamp) - .setHost(host) - .setName(name) - .setUnhealthyThreshold(unhealthyThreshold) - .setHealthyThreshold(healthyThreshold) - .setId(id) - .setRequestPath(requestPath) - .build(); + HttpHealthCheck expectedResponse = + HttpHealthCheck.newBuilder() + .setCheckIntervalSec(checkIntervalSec) + .setKind(kind) + .setDescription(description) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setHost(host) + .setName(name) + .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .setRequestPath(requestPath) + .build(); mockService.addResponse(expectedResponse); - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck actualResponse = - client.getHttpHealthCheck(httpHealthCheck); + HttpHealthCheck actualResponse = client.getHttpHealthCheck(httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getHttpHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); client.getHttpHealthCheck(httpHealthCheck); Assert.fail("No exception raised"); @@ -257,29 +276,30 @@ public void insertHttpHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -293,16 +313,24 @@ public void insertHttpHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertHttpHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -326,13 +354,14 @@ public void listHttpHealthChecksTest() { String selfLink = "selfLink-1691268851"; HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); - HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + HttpHealthCheckList expectedResponse = + HttpHealthCheckList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -341,22 +370,29 @@ public void listHttpHealthChecksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listHttpHealthChecksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -393,33 +429,35 @@ public void patchHttpHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = @@ -429,21 +467,30 @@ public void patchHttpHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchHttpHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -477,33 +524,35 @@ public void updateHttpHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = @@ -513,21 +562,30 @@ public void updateHttpHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateHttpHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectHttpHealthCheckName httpHealthCheck = ProjectHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); + ProjectGlobalHttpHealthCheckName httpHealthCheck = + ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -536,5 +594,4 @@ public void updateHttpHealthCheckExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index 4d623c4acfb6..d4eb7be0cc59 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.deleteHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.getHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.insertHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.listHttpsHealthChecksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.patchHttpsHealthCheckMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.updateHttpsHealthCheckMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.deleteHttpsHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.getHttpsHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.insertHttpsHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.listHttpsHealthChecksMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.patchHttpsHealthCheckMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonHttpsHealthCheckStub.updateHttpsHealthCheckMethodDescriptor; import com.google.cloud.compute.v1.stub.HttpsHealthCheckStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class HttpsHealthCheckClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteHttpsHealthCheckMethodDescriptor, - getHttpsHealthCheckMethodDescriptor, - insertHttpsHealthCheckMethodDescriptor, - listHttpsHealthChecksMethodDescriptor, - patchHttpsHealthCheckMethodDescriptor, - updateHttpsHealthCheckMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, HttpsHealthCheckStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteHttpsHealthCheckMethodDescriptor, + getHttpsHealthCheckMethodDescriptor, + insertHttpsHealthCheckMethodDescriptor, + listHttpsHealthChecksMethodDescriptor, + patchHttpsHealthCheckMethodDescriptor, + updateHttpsHealthCheckMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, HttpsHealthCheckStubSettings.getDefaultEndpoint()); private static HttpsHealthCheckClient client; private static HttpsHealthCheckSettings clientSettings; @@ -68,13 +67,13 @@ public class HttpsHealthCheckClientTest { public static void setUp() throws IOException { clientSettings = HttpsHealthCheckSettings.newBuilder() - .setTransportChannelProvider( - HttpsHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - HttpsHealthCheckClient.create(clientSettings); + .setTransportChannelProvider( + HttpsHealthCheckSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HttpsHealthCheckClient.create(clientSettings); } @After @@ -111,55 +110,65 @@ public void deleteHttpsHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); + Operation actualResponse = client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteHttpsHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); @@ -185,46 +194,56 @@ public void getHttpsHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpsHealthCheck expectedResponse = HttpsHealthCheck.newBuilder() - .setCheckIntervalSec(checkIntervalSec) - .setKind(kind) - .setDescription(description) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setPort(port) - .setCreationTimestamp(creationTimestamp) - .setHost(host) - .setName(name) - .setUnhealthyThreshold(unhealthyThreshold) - .setHealthyThreshold(healthyThreshold) - .setId(id) - .setRequestPath(requestPath) - .build(); + HttpsHealthCheck expectedResponse = + HttpsHealthCheck.newBuilder() + .setCheckIntervalSec(checkIntervalSec) + .setKind(kind) + .setDescription(description) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setHost(host) + .setName(name) + .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .setRequestPath(requestPath) + .build(); mockService.addResponse(expectedResponse); - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - HttpsHealthCheck actualResponse = - client.getHttpsHealthCheck(httpsHealthCheck); + HttpsHealthCheck actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getHttpsHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); client.getHttpsHealthCheck(httpsHealthCheck); Assert.fail("No exception raised"); @@ -257,29 +276,30 @@ public void insertHttpsHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -293,16 +313,24 @@ public void insertHttpsHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertHttpsHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -326,13 +354,14 @@ public void listHttpsHealthChecksTest() { String selfLink = "selfLink-1691268851"; HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); - HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + HttpsHealthCheckList expectedResponse = + HttpsHealthCheckList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -341,22 +370,29 @@ public void listHttpsHealthChecksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listHttpsHealthChecksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -393,32 +429,34 @@ public void patchHttpsHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); @@ -429,20 +467,29 @@ public void patchHttpsHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchHttpsHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); @@ -477,32 +524,34 @@ public void updateHttpsHealthCheckTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); @@ -513,20 +562,29 @@ public void updateHttpsHealthCheckTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateHttpsHealthCheckExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectHttpsHealthCheckName httpsHealthCheck = ProjectHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); + ProjectGlobalHttpsHealthCheckName httpsHealthCheck = + ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); @@ -536,5 +594,4 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index e67ffba028f7..16fe02854a71 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -15,6 +15,15 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deleteImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deprecateImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getFromFamilyImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.insertImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.listImagesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.setLabelsImageMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,22 +34,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.ImageClient.ListImagesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deleteImageMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deprecateImageMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getFromFamilyImageMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getImageMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.insertImageMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.listImagesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.setLabelsImageMethodDescriptor; import com.google.cloud.compute.v1.stub.ImageStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -50,18 +49,18 @@ @javax.annotation.Generated("by GAPIC") public class ImageClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteImageMethodDescriptor, - deprecateImageMethodDescriptor, - getImageMethodDescriptor, - getFromFamilyImageMethodDescriptor, - insertImageMethodDescriptor, - listImagesMethodDescriptor, - setLabelsImageMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, ImageStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteImageMethodDescriptor, + deprecateImageMethodDescriptor, + getImageMethodDescriptor, + getFromFamilyImageMethodDescriptor, + insertImageMethodDescriptor, + listImagesMethodDescriptor, + setLabelsImageMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, ImageStubSettings.getDefaultEndpoint()); private static ImageClient client; private static ImageSettings clientSettings; @@ -70,13 +69,13 @@ public class ImageClientTest { public static void setUp() throws IOException { clientSettings = ImageSettings.newBuilder() - .setTransportChannelProvider( - ImageSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - ImageClient.create(clientSettings); + .setTransportChannelProvider( + ImageSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ImageClient.create(clientSettings); } @After @@ -113,55 +112,63 @@ public void deleteImageTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]"); + ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteImage(image, requestId); + Operation actualResponse = client.deleteImage(image, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteImageExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]"); + ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); String requestId = "requestId37109963"; client.deleteImage(image, requestId); @@ -195,56 +202,64 @@ public void deprecateImageTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]"); + ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); String requestId = "requestId37109963"; DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); - Operation actualResponse = - client.deprecateImage(image, requestId, deprecationStatusResource); + Operation actualResponse = client.deprecateImage(image, requestId, deprecationStatusResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deprecateImageExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]"); + ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); String requestId = "requestId37109963"; DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); @@ -273,54 +288,62 @@ public void getImageTest() { String name = "name3373707"; String archiveSizeBytes = "archiveSizeBytes-1766390198"; String sourceImage = "sourceImage1661056055"; - ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]"); + ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; - Image expectedResponse = Image.newBuilder() - .setSourceSnapshotId(sourceSnapshotId) - .setDescription(description) - .setSourceSnapshot(sourceSnapshot) - .setLabelFingerprint(labelFingerprint) - .setCreationTimestamp(creationTimestamp) - .setId(id) - .setSourceDisk(sourceDisk) - .setSourceDiskId(sourceDiskId) - .setSourceImageId(sourceImageId) - .setKind(kind) - .setSelfLink(selfLink) - .setSourceType(sourceType) - .setName(name) - .setArchiveSizeBytes(archiveSizeBytes) - .setSourceImage(sourceImage) - .setFamily(family.toString()) - .setDiskSizeGb(diskSizeGb) - .setStatus(status) - .build(); + Image expectedResponse = + Image.newBuilder() + .setSourceSnapshotId(sourceSnapshotId) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setLabelFingerprint(labelFingerprint) + .setCreationTimestamp(creationTimestamp) + .setId(id) + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) + .setSourceImageId(sourceImageId) + .setKind(kind) + .setSelfLink(selfLink) + .setSourceType(sourceType) + .setName(name) + .setArchiveSizeBytes(archiveSizeBytes) + .setSourceImage(sourceImage) + .setFamily(family.toString()) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]"); + ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); - Image actualResponse = - client.getImage(image); + Image actualResponse = client.getImage(image); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getImageExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectImageName image = ProjectImageName.of("[PROJECT]", "[IMAGE]"); + ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); client.getImage(image); Assert.fail("No exception raised"); @@ -347,54 +370,63 @@ public void getFromFamilyImageTest() { String name = "name3373707"; String archiveSizeBytes = "archiveSizeBytes-1766390198"; String sourceImage = "sourceImage1661056055"; - ProjectFamilyName family2 = ProjectFamilyName.of("[PROJECT]", "[FAMILY]"); + ProjectGlobalImageFamilyName family2 = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; - Image expectedResponse = Image.newBuilder() - .setSourceSnapshotId(sourceSnapshotId) - .setDescription(description) - .setSourceSnapshot(sourceSnapshot) - .setLabelFingerprint(labelFingerprint) - .setCreationTimestamp(creationTimestamp) - .setId(id) - .setSourceDisk(sourceDisk) - .setSourceDiskId(sourceDiskId) - .setSourceImageId(sourceImageId) - .setKind(kind) - .setSelfLink(selfLink) - .setSourceType(sourceType) - .setName(name) - .setArchiveSizeBytes(archiveSizeBytes) - .setSourceImage(sourceImage) - .setFamily(family2.toString()) - .setDiskSizeGb(diskSizeGb) - .setStatus(status) - .build(); + Image expectedResponse = + Image.newBuilder() + .setSourceSnapshotId(sourceSnapshotId) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setLabelFingerprint(labelFingerprint) + .setCreationTimestamp(creationTimestamp) + .setId(id) + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) + .setSourceImageId(sourceImageId) + .setKind(kind) + .setSelfLink(selfLink) + .setSourceType(sourceType) + .setName(name) + .setArchiveSizeBytes(archiveSizeBytes) + .setSourceImage(sourceImage) + .setFamily(family2.toString()) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]"); + ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); - Image actualResponse = - client.getFromFamilyImage(family); + Image actualResponse = client.getFromFamilyImage(family); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getFromFamilyImageExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectFamilyName family = ProjectFamilyName.of("[PROJECT]", "[FAMILY]"); + ProjectGlobalImageFamilyName family = + ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); client.getFromFamilyImage(family); Assert.fail("No exception raised"); @@ -427,29 +459,30 @@ public void insertImageTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); Boolean forceCreate = true; @@ -457,23 +490,30 @@ public void insertImageTest() { ProjectName project = ProjectName.of("[PROJECT]"); Image imageResource = Image.newBuilder().build(); - Operation actualResponse = - client.insertImage(forceCreate, requestId, project, imageResource); + Operation actualResponse = client.insertImage(forceCreate, requestId, project, imageResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertImageExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -498,13 +538,14 @@ public void listImagesTest() { String selfLink = "selfLink-1691268851"; Image itemsElement = Image.newBuilder().build(); List items = Arrays.asList(itemsElement); - ImageList expectedResponse = ImageList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + ImageList expectedResponse = + ImageList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -513,22 +554,29 @@ public void listImagesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listImagesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -565,56 +613,68 @@ public void setLabelsImageTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]"); - GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = + GlobalSetLabelsRequest.newBuilder().build(); - Operation actualResponse = - client.setLabelsImage(resource, globalSetLabelsRequestResource); + Operation actualResponse = client.setLabelsImage(resource, globalSetLabelsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setLabelsImageExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectImageName resource = ProjectImageName.of("[PROJECT]", "[IMAGE]"); - GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = + GlobalSetLabelsRequest.newBuilder().build(); client.setLabelsImage(resource, globalSetLabelsRequestResource); Assert.fail("No exception raised"); @@ -622,5 +682,4 @@ public void setLabelsImageExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index b42b6f0f59cc..ccc9b8b8c3ef 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.InstanceClient.AggregatedListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListInstancesPagedResponse; import static com.google.cloud.compute.v1.InstanceClient.ListReferrersInstancesPagedResponse; @@ -55,6 +45,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.stopInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.updateAccessConfigInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.updateNetworkInterfaceInstanceMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.InstanceStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -72,38 +73,38 @@ @javax.annotation.Generated("by GAPIC") public class InstanceClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - addAccessConfigInstanceMethodDescriptor, - aggregatedListInstancesMethodDescriptor, - attachDiskInstanceMethodDescriptor, - deleteInstanceMethodDescriptor, - deleteAccessConfigInstanceMethodDescriptor, - detachDiskInstanceMethodDescriptor, - getInstanceMethodDescriptor, - getSerialPortOutputInstanceMethodDescriptor, - insertInstanceMethodDescriptor, - listInstancesMethodDescriptor, - listReferrersInstancesMethodDescriptor, - resetInstanceMethodDescriptor, - setDeletionProtectionInstanceMethodDescriptor, - setDiskAutoDeleteInstanceMethodDescriptor, - setLabelsInstanceMethodDescriptor, - setMachineResourcesInstanceMethodDescriptor, - setMachineTypeInstanceMethodDescriptor, - setMetadataInstanceMethodDescriptor, - setMinCpuPlatformInstanceMethodDescriptor, - setSchedulingInstanceMethodDescriptor, - setServiceAccountInstanceMethodDescriptor, - setTagsInstanceMethodDescriptor, - startInstanceMethodDescriptor, - startWithEncryptionKeyInstanceMethodDescriptor, - stopInstanceMethodDescriptor, - updateAccessConfigInstanceMethodDescriptor, - updateNetworkInterfaceInstanceMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InstanceStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + addAccessConfigInstanceMethodDescriptor, + aggregatedListInstancesMethodDescriptor, + attachDiskInstanceMethodDescriptor, + deleteInstanceMethodDescriptor, + deleteAccessConfigInstanceMethodDescriptor, + detachDiskInstanceMethodDescriptor, + getInstanceMethodDescriptor, + getSerialPortOutputInstanceMethodDescriptor, + insertInstanceMethodDescriptor, + listInstancesMethodDescriptor, + listReferrersInstancesMethodDescriptor, + resetInstanceMethodDescriptor, + setDeletionProtectionInstanceMethodDescriptor, + setDiskAutoDeleteInstanceMethodDescriptor, + setLabelsInstanceMethodDescriptor, + setMachineResourcesInstanceMethodDescriptor, + setMachineTypeInstanceMethodDescriptor, + setMetadataInstanceMethodDescriptor, + setMinCpuPlatformInstanceMethodDescriptor, + setSchedulingInstanceMethodDescriptor, + setServiceAccountInstanceMethodDescriptor, + setTagsInstanceMethodDescriptor, + startInstanceMethodDescriptor, + startWithEncryptionKeyInstanceMethodDescriptor, + stopInstanceMethodDescriptor, + updateAccessConfigInstanceMethodDescriptor, + updateNetworkInterfaceInstanceMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, InstanceStubSettings.getDefaultEndpoint()); private static InstanceClient client; private static InstanceSettings clientSettings; @@ -112,13 +113,13 @@ public class InstanceClientTest { public static void setUp() throws IOException { clientSettings = InstanceSettings.newBuilder() - .setTransportChannelProvider( - InstanceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InstanceClient.create(clientSettings); + .setTransportChannelProvider( + InstanceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InstanceClient.create(clientSettings); } @After @@ -155,32 +156,34 @@ public void addAccessConfigInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); @@ -192,20 +195,29 @@ public void addAccessConfigInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void addAccessConfigInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); @@ -227,37 +239,47 @@ public void aggregatedListInstancesTest() { InstancesScopedList itemsItem = InstancesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - InstanceAggregatedList expectedResponse = InstanceAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + InstanceAggregatedList expectedResponse = + InstanceAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListInstancesPagedResponse pagedListResponse = client.aggregatedListInstances(project); + AggregatedListInstancesPagedResponse pagedListResponse = + client.aggregatedListInstances(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListInstancesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -294,56 +316,66 @@ public void attachDiskInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - Operation actualResponse = - client.attachDiskInstance(instance, requestId, attachedDiskResource); + Operation actualResponse = client.attachDiskInstance(instance, requestId, attachedDiskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void attachDiskInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); @@ -378,55 +410,65 @@ public void deleteInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteInstance(instance, requestId); + Operation actualResponse = client.deleteInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; client.deleteInstance(instance, requestId); @@ -460,32 +502,34 @@ public void deleteAccessConfigInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; String accessConfig = "accessConfig-464014723"; @@ -497,20 +541,29 @@ public void deleteAccessConfigInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteAccessConfigInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; String accessConfig = "accessConfig-464014723"; @@ -546,56 +599,66 @@ public void detachDiskInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; String deviceName = "deviceName-1543071020"; - Operation actualResponse = - client.detachDiskInstance(instance, requestId, deviceName); + Operation actualResponse = client.detachDiskInstance(instance, requestId, deviceName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void detachDiskInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; String deviceName = "deviceName-1543071020"; @@ -623,51 +686,62 @@ public void getInstanceTest() { String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; - ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + ProjectZoneMachineTypeName machineType = + ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); String status = "status-892481550"; - Instance expectedResponse = Instance.newBuilder() - .setCanIpForward(canIpForward) - .setKind(kind) - .setDescription(description) - .setCpuPlatform(cpuPlatform) - .setStartRestricted(startRestricted) - .setLabelFingerprint(labelFingerprint) - .setStatusMessage(statusMessage) - .setDeletionProtection(deletionProtection) - .setSelfLink(selfLink) - .setMinCpuPlatform(minCpuPlatform) - .setZone(zone.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setMachineType(machineType.toString()) - .setStatus(status) - .build(); + Instance expectedResponse = + Instance.newBuilder() + .setCanIpForward(canIpForward) + .setKind(kind) + .setDescription(description) + .setCpuPlatform(cpuPlatform) + .setStartRestricted(startRestricted) + .setLabelFingerprint(labelFingerprint) + .setStatusMessage(statusMessage) + .setDeletionProtection(deletionProtection) + .setSelfLink(selfLink) + .setMinCpuPlatform(minCpuPlatform) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setMachineType(machineType.toString()) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - Instance actualResponse = - client.getInstance(instance); + Instance actualResponse = client.getInstance(instance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); client.getInstance(instance); Assert.fail("No exception raised"); @@ -684,40 +758,50 @@ public void getSerialPortOutputInstanceTest() { String kind = "kind3292052"; String start2 = "start2-1897185387"; String selfLink = "selfLink-1691268851"; - SerialPortOutput expectedResponse = SerialPortOutput.newBuilder() - .setNext(next) - .setContents(contents) - .setKind(kind) - .setStart(start2) - .setSelfLink(selfLink) - .build(); + SerialPortOutput expectedResponse = + SerialPortOutput.newBuilder() + .setNext(next) + .setContents(contents) + .setKind(kind) + .setStart(start2) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); Integer port = 3446913; String start = "start109757538"; - SerialPortOutput actualResponse = - client.getSerialPortOutputInstance(instance, port, start); + SerialPortOutput actualResponse = client.getSerialPortOutputInstance(instance, port, start); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getSerialPortOutputInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); Integer port = 3446913; String start = "start109757538"; @@ -752,60 +836,71 @@ public void insertInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); + String sourceInstanceTemplate = "sourceInstanceTemplate869294528"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String requestId = "requestId37109963"; Instance instanceResource = Instance.newBuilder().build(); Operation actualResponse = - client.insertInstance(zone, requestId, instanceResource); + client.insertInstance(sourceInstanceTemplate, zone, requestId, instanceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + String sourceInstanceTemplate = "sourceInstanceTemplate869294528"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String requestId = "requestId37109963"; Instance instanceResource = Instance.newBuilder().build(); - client.insertInstance(zone, requestId, instanceResource); + client.insertInstance(sourceInstanceTemplate, zone, requestId, instanceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -821,13 +916,14 @@ public void listInstancesTest() { String selfLink = "selfLink-1691268851"; Instance itemsElement = Instance.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceList expectedResponse = InstanceList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceList expectedResponse = + InstanceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -836,22 +932,29 @@ public void listInstancesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstancesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -873,41 +976,51 @@ public void listReferrersInstancesTest() { String selfLink = "selfLink-1691268851"; Reference itemsElement = Reference.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceListReferrers expectedResponse = InstanceListReferrers.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceListReferrers expectedResponse = + InstanceListReferrers.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); ListReferrersInstancesPagedResponse pagedListResponse = client.listReferrersInstances(instance); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listReferrersInstancesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); client.listReferrersInstances(instance); Assert.fail("No exception raised"); @@ -940,55 +1053,65 @@ public void resetInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.resetInstance(instance, requestId); + Operation actualResponse = client.resetInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void resetInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; client.resetInstance(instance, requestId); @@ -1022,32 +1145,34 @@ public void setDeletionProtectionInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); String requestId = "requestId37109963"; Boolean deletionProtection = true; @@ -1058,20 +1183,29 @@ public void setDeletionProtectionInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setDeletionProtectionInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName resource = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); String requestId = "requestId37109963"; Boolean deletionProtection = true; @@ -1106,32 +1240,34 @@ public void setDiskAutoDeleteInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Boolean autoDelete = false; String deviceName = "deviceName-1543071020"; @@ -1143,20 +1279,29 @@ public void setDiskAutoDeleteInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Boolean autoDelete = false; String deviceName = "deviceName-1543071020"; @@ -1192,34 +1337,37 @@ public void setLabelsInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build(); + InstancesSetLabelsRequest instancesSetLabelsRequestResource = + InstancesSetLabelsRequest.newBuilder().build(); Operation actualResponse = client.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource); @@ -1228,22 +1376,32 @@ public void setLabelsInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setLabelsInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build(); + InstancesSetLabelsRequest instancesSetLabelsRequestResource = + InstancesSetLabelsRequest.newBuilder().build(); client.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource); Assert.fail("No exception raised"); @@ -1276,60 +1434,75 @@ public void setMachineResourcesInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build(); + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = + InstancesSetMachineResourcesRequest.newBuilder().build(); Operation actualResponse = - client.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource); + client.setMachineResourcesInstance( + instance, requestId, instancesSetMachineResourcesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setMachineResourcesInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build(); + InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = + InstancesSetMachineResourcesRequest.newBuilder().build(); - client.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource); + client.setMachineResourcesInstance( + instance, requestId, instancesSetMachineResourcesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1360,34 +1533,37 @@ public void setMachineTypeInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = + InstancesSetMachineTypeRequest.newBuilder().build(); Operation actualResponse = client.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource); @@ -1396,22 +1572,32 @@ public void setMachineTypeInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setMachineTypeInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); + InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = + InstancesSetMachineTypeRequest.newBuilder().build(); client.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource); Assert.fail("No exception raised"); @@ -1444,56 +1630,66 @@ public void setMetadataInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Metadata metadataResource = Metadata.newBuilder().build(); - Operation actualResponse = - client.setMetadataInstance(instance, requestId, metadataResource); + Operation actualResponse = client.setMetadataInstance(instance, requestId, metadataResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setMetadataInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Metadata metadataResource = Metadata.newBuilder().build(); @@ -1528,60 +1724,75 @@ public void setMinCpuPlatformInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build(); + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = + InstancesSetMinCpuPlatformRequest.newBuilder().build(); Operation actualResponse = - client.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource); + client.setMinCpuPlatformInstance( + instance, requestId, instancesSetMinCpuPlatformRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setMinCpuPlatformInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build(); + InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = + InstancesSetMinCpuPlatformRequest.newBuilder().build(); - client.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource); + client.setMinCpuPlatformInstance( + instance, requestId, instancesSetMinCpuPlatformRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1612,32 +1823,34 @@ public void setSchedulingInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Scheduling schedulingResource = Scheduling.newBuilder().build(); @@ -1648,20 +1861,29 @@ public void setSchedulingInstanceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setSchedulingInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Scheduling schedulingResource = Scheduling.newBuilder().build(); @@ -1696,60 +1918,75 @@ public void setServiceAccountInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = + InstancesSetServiceAccountRequest.newBuilder().build(); Operation actualResponse = - client.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource); + client.setServiceAccountInstance( + instance, requestId, instancesSetServiceAccountRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setServiceAccountInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); + InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = + InstancesSetServiceAccountRequest.newBuilder().build(); - client.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource); + client.setServiceAccountInstance( + instance, requestId, instancesSetServiceAccountRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1780,56 +2017,66 @@ public void setTagsInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Tags tagsResource = Tags.newBuilder().build(); - Operation actualResponse = - client.setTagsInstance(instance, requestId, tagsResource); + Operation actualResponse = client.setTagsInstance(instance, requestId, tagsResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setTagsInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; Tags tagsResource = Tags.newBuilder().build(); @@ -1864,55 +2111,65 @@ public void startInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.startInstance(instance, requestId); + Operation actualResponse = client.startInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void startInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; client.startInstance(instance, requestId); @@ -1946,60 +2203,75 @@ public void startWithEncryptionKeyInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = + InstancesStartWithEncryptionKeyRequest.newBuilder().build(); Operation actualResponse = - client.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource); + client.startWithEncryptionKeyInstance( + instance, requestId, instancesStartWithEncryptionKeyRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void startWithEncryptionKeyInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); + InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = + InstancesStartWithEncryptionKeyRequest.newBuilder().build(); - client.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource); + client.startWithEncryptionKeyInstance( + instance, requestId, instancesStartWithEncryptionKeyRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2030,55 +2302,65 @@ public void stopInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.stopInstance(instance, requestId); + Operation actualResponse = client.stopInstance(instance, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void stopInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; client.stopInstance(instance, requestId); @@ -2112,62 +2394,75 @@ public void updateAccessConfigInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); Operation actualResponse = - client.updateAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + client.updateAccessConfigInstance( + instance, networkInterface, requestId, accessConfigResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateAccessConfigInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - client.updateAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + client.updateAccessConfigInstance( + instance, networkInterface, requestId, accessConfigResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2198,66 +2493,78 @@ public void updateNetworkInterfaceInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); Operation actualResponse = - client.updateNetworkInterfaceInstance(instance, networkInterface, requestId, networkInterfaceResource); + client.updateNetworkInterfaceInstance( + instance, networkInterface, requestId, networkInterfaceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateNetworkInterfaceInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; String requestId = "requestId37109963"; NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); - client.updateNetworkInterfaceInstance(instance, networkInterface, requestId, networkInterfaceResource); + client.updateNetworkInterfaceInstance( + instance, networkInterface, requestId, networkInterfaceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index ff9620b7d354..42f45526f10e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.InstanceGroupClient.AggregatedListInstanceGroupsPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstanceGroupsPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupClient.ListInstancesInstanceGroupsPagedResponse; @@ -37,6 +27,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.listInstancesInstanceGroupsMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.removeInstancesInstanceGroupMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupStub.setNamedPortsInstanceGroupMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.InstanceGroupStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -54,20 +55,20 @@ @javax.annotation.Generated("by GAPIC") public class InstanceGroupClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - addInstancesInstanceGroupMethodDescriptor, - aggregatedListInstanceGroupsMethodDescriptor, - deleteInstanceGroupMethodDescriptor, - getInstanceGroupMethodDescriptor, - insertInstanceGroupMethodDescriptor, - listInstanceGroupsMethodDescriptor, - listInstancesInstanceGroupsMethodDescriptor, - removeInstancesInstanceGroupMethodDescriptor, - setNamedPortsInstanceGroupMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + addInstancesInstanceGroupMethodDescriptor, + aggregatedListInstanceGroupsMethodDescriptor, + deleteInstanceGroupMethodDescriptor, + getInstanceGroupMethodDescriptor, + insertInstanceGroupMethodDescriptor, + listInstanceGroupsMethodDescriptor, + listInstancesInstanceGroupsMethodDescriptor, + removeInstancesInstanceGroupMethodDescriptor, + setNamedPortsInstanceGroupMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupStubSettings.getDefaultEndpoint()); private static InstanceGroupClient client; private static InstanceGroupSettings clientSettings; @@ -76,13 +77,13 @@ public class InstanceGroupClientTest { public static void setUp() throws IOException { clientSettings = InstanceGroupSettings.newBuilder() - .setTransportChannelProvider( - InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InstanceGroupClient.create(clientSettings); + .setTransportChannelProvider( + InstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InstanceGroupClient.create(clientSettings); } @After @@ -119,60 +120,75 @@ public void addInstancesInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = + InstanceGroupsAddInstancesRequest.newBuilder().build(); Operation actualResponse = - client.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); + client.addInstancesInstanceGroup( + requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void addInstancesInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = + InstanceGroupsAddInstancesRequest.newBuilder().build(); - client.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); + client.addInstancesInstanceGroup( + requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -189,37 +205,47 @@ public void aggregatedListInstanceGroupsTest() { InstanceGroupsScopedList itemsItem = InstanceGroupsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - InstanceGroupAggregatedList expectedResponse = InstanceGroupAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + InstanceGroupAggregatedList expectedResponse = + InstanceGroupAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListInstanceGroupsPagedResponse pagedListResponse = client.aggregatedListInstanceGroups(project); + AggregatedListInstanceGroupsPagedResponse pagedListResponse = + client.aggregatedListInstanceGroups(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -256,56 +282,66 @@ public void deleteInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - Operation actualResponse = - client.deleteInstanceGroup(requestId, instanceGroup); + Operation actualResponse = client.deleteInstanceGroup(requestId, instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); client.deleteInstanceGroup(requestId, instanceGroup); Assert.fail("No exception raised"); @@ -319,55 +355,66 @@ public void deleteInstanceGroupExceptionTest() throws Exception { public void getInstanceGroupTest() { String kind = "kind3292052"; String description = "description-1724546052"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; Integer size = 3530753; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setKind(kind) - .setDescription(description) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setSize(size) - .setZone(zone.toString()) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InstanceGroup expectedResponse = + InstanceGroup.newBuilder() + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setSize(size) + .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroup actualResponse = - client.getInstanceGroup(instanceGroup); + InstanceGroup actualResponse = client.getInstanceGroup(instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); client.getInstanceGroup(instanceGroup); Assert.fail("No exception raised"); @@ -400,52 +447,60 @@ public void insertInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String requestId = "requestId37109963"; InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); - Operation actualResponse = - client.insertInstanceGroup(zone, requestId, instanceGroupResource); + Operation actualResponse = client.insertInstanceGroup(zone, requestId, instanceGroupResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -469,13 +524,14 @@ public void listInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupList expectedResponse = InstanceGroupList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupList expectedResponse = + InstanceGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -484,22 +540,29 @@ public void listInstanceGroupsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -521,43 +584,57 @@ public void listInstancesInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupsListInstances expectedResponse = InstanceGroupsListInstances.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupsListInstances expectedResponse = + InstanceGroupsListInstances.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = + InstanceGroupsListInstancesRequest.newBuilder().build(); - ListInstancesInstanceGroupsPagedResponse pagedListResponse = client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); + ListInstancesInstanceGroupsPagedResponse pagedListResponse = + client.listInstancesInstanceGroups( + instanceGroup, instanceGroupsListInstancesRequestResource); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstancesInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = InstanceGroupsListInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsListInstancesRequest instanceGroupsListInstancesRequestResource = + InstanceGroupsListInstancesRequest.newBuilder().build(); client.listInstancesInstanceGroups(instanceGroup, instanceGroupsListInstancesRequestResource); Assert.fail("No exception raised"); @@ -590,60 +667,75 @@ public void removeInstancesInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = + InstanceGroupsRemoveInstancesRequest.newBuilder().build(); Operation actualResponse = - client.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + client.removeInstancesInstanceGroup( + requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void removeInstancesInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = + InstanceGroupsRemoveInstancesRequest.newBuilder().build(); - client.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + client.removeInstancesInstanceGroup( + requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -674,64 +766,78 @@ public void setNamedPortsInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = + InstanceGroupsSetNamedPortsRequest.newBuilder().build(); Operation actualResponse = - client.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsInstanceGroup( + requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setNamedPortsInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = + InstanceGroupsSetNamedPortsRequest.newBuilder().build(); - client.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsInstanceGroup( + requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index 564f0f909fc6..beefb93d91ef 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.InstanceGroupManagerClient.AggregatedListInstanceGroupManagersPagedResponse; import static com.google.cloud.compute.v1.InstanceGroupManagerClient.ListInstanceGroupManagersPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.abandonInstancesInstanceGroupManagerMethodDescriptor; @@ -39,6 +29,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.resizeInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.setInstanceTemplateInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.setTargetPoolsInstanceGroupManagerMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.InstanceGroupManagerStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -56,23 +57,24 @@ @javax.annotation.Generated("by GAPIC") public class InstanceGroupManagerClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - abandonInstancesInstanceGroupManagerMethodDescriptor, - aggregatedListInstanceGroupManagersMethodDescriptor, - deleteInstanceGroupManagerMethodDescriptor, - deleteInstancesInstanceGroupManagerMethodDescriptor, - getInstanceGroupManagerMethodDescriptor, - insertInstanceGroupManagerMethodDescriptor, - listInstanceGroupManagersMethodDescriptor, - listManagedInstancesInstanceGroupManagersMethodDescriptor, - recreateInstancesInstanceGroupManagerMethodDescriptor, - resizeInstanceGroupManagerMethodDescriptor, - setInstanceTemplateInstanceGroupManagerMethodDescriptor, - setTargetPoolsInstanceGroupManagerMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InstanceGroupManagerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + abandonInstancesInstanceGroupManagerMethodDescriptor, + aggregatedListInstanceGroupManagersMethodDescriptor, + deleteInstanceGroupManagerMethodDescriptor, + deleteInstancesInstanceGroupManagerMethodDescriptor, + getInstanceGroupManagerMethodDescriptor, + insertInstanceGroupManagerMethodDescriptor, + listInstanceGroupManagersMethodDescriptor, + listManagedInstancesInstanceGroupManagersMethodDescriptor, + recreateInstancesInstanceGroupManagerMethodDescriptor, + resizeInstanceGroupManagerMethodDescriptor, + setInstanceTemplateInstanceGroupManagerMethodDescriptor, + setTargetPoolsInstanceGroupManagerMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService( + METHOD_DESCRIPTORS, InstanceGroupManagerStubSettings.getDefaultEndpoint()); private static InstanceGroupManagerClient client; private static InstanceGroupManagerSettings clientSettings; @@ -81,13 +83,13 @@ public class InstanceGroupManagerClientTest { public static void setUp() throws IOException { clientSettings = InstanceGroupManagerSettings.newBuilder() - .setTransportChannelProvider( - InstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InstanceGroupManagerClient.create(clientSettings); + .setTransportChannelProvider( + InstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InstanceGroupManagerClient.create(clientSettings); } @After @@ -124,60 +126,77 @@ public void abandonInstancesInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersAbandonInstancesRequest + instanceGroupManagersAbandonInstancesRequestResource = + InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); Operation actualResponse = - client.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + client.abandonInstancesInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); - - client.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersAbandonInstancesRequest + instanceGroupManagersAbandonInstancesRequestResource = + InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + + client.abandonInstancesInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -191,40 +210,52 @@ public void aggregatedListInstanceGroupManagersTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - InstanceGroupManagersScopedList itemsItem = InstanceGroupManagersScopedList.newBuilder().build(); + InstanceGroupManagersScopedList itemsItem = + InstanceGroupManagersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - InstanceGroupManagerAggregatedList expectedResponse = InstanceGroupManagerAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + InstanceGroupManagerAggregatedList expectedResponse = + InstanceGroupManagerAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListInstanceGroupManagersPagedResponse pagedListResponse = client.aggregatedListInstanceGroupManagers(project); + AggregatedListInstanceGroupManagersPagedResponse pagedListResponse = + client.aggregatedListInstanceGroupManagers(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupManagersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -261,56 +292,66 @@ public void deleteInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - Operation actualResponse = - client.deleteInstanceGroupManager(requestId, instanceGroupManager); + Operation actualResponse = client.deleteInstanceGroupManager(requestId, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); client.deleteInstanceGroupManager(requestId, instanceGroupManager); Assert.fail("No exception raised"); @@ -343,60 +384,77 @@ public void deleteInstancesInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource = + InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); Operation actualResponse = - client.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + client.deleteInstancesInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); - - client.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersDeleteInstancesRequest + instanceGroupManagersDeleteInstancesRequestResource = + InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + + client.deleteInstancesInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -406,11 +464,13 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception @Test @SuppressWarnings("all") public void getInstanceGroupManagerTest() { - ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); String kind = "kind3292052"; String description = "description-1724546052"; String baseInstanceName = "baseInstanceName389106439"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); String selfLink = "selfLink-1691268851"; Integer targetSize = 2084603409; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -419,46 +479,56 @@ public void getInstanceGroupManagerTest() { String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() - .setInstanceTemplate(instanceTemplate.toString()) - .setKind(kind) - .setDescription(description) - .setBaseInstanceName(baseInstanceName) - .setInstanceGroup(instanceGroup.toString()) - .setSelfLink(selfLink) - .setTargetSize(targetSize) - .setZone(zone.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InstanceGroupManager expectedResponse = + InstanceGroupManager.newBuilder() + .setInstanceTemplate(instanceTemplate.toString()) + .setKind(kind) + .setDescription(description) + .setBaseInstanceName(baseInstanceName) + .setInstanceGroup(instanceGroup.toString()) + .setSelfLink(selfLink) + .setTargetSize(targetSize) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManager actualResponse = - client.getInstanceGroupManager(instanceGroupManager); + InstanceGroupManager actualResponse = client.getInstanceGroupManager(instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); client.getInstanceGroupManager(instanceGroupManager); Assert.fail("No exception raised"); @@ -491,29 +561,30 @@ public void insertInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -527,16 +598,24 @@ public void insertInstanceGroupManagerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -560,37 +639,46 @@ public void listInstanceGroupManagersTest() { String selfLink = "selfLink-1691268851"; InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceGroupManagerList expectedResponse = InstanceGroupManagerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceGroupManagerList expectedResponse = + InstanceGroupManagerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - ListInstanceGroupManagersPagedResponse pagedListResponse = client.listInstanceGroupManagers(zone); + ListInstanceGroupManagersPagedResponse pagedListResponse = + client.listInstanceGroupManagers(zone); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstanceGroupManagersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -606,10 +694,12 @@ public void listInstanceGroupManagersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listManagedInstancesInstanceGroupManagersTest() { - InstanceGroupManagersListManagedInstancesResponse expectedResponse = InstanceGroupManagersListManagedInstancesResponse.newBuilder().build(); + InstanceGroupManagersListManagedInstancesResponse expectedResponse = + InstanceGroupManagersListManagedInstancesResponse.newBuilder().build(); mockService.addResponse(expectedResponse); - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersListManagedInstancesResponse actualResponse = client.listManagedInstancesInstanceGroupManagers(instanceGroupManager); @@ -618,20 +708,29 @@ public void listManagedInstancesInstanceGroupManagersTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listManagedInstancesInstanceGroupManagersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); client.listManagedInstancesInstanceGroupManagers(instanceGroupManager); Assert.fail("No exception raised"); @@ -664,60 +763,77 @@ public void recreateInstancesInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource = + InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); Operation actualResponse = - client.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + client.recreateInstancesInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); - - client.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersRecreateInstancesRequest + instanceGroupManagersRecreateInstancesRequestResource = + InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); + + client.recreateInstancesInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -748,34 +864,36 @@ public void resizeInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); Integer size = 3530753; String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = client.resizeInstanceGroupManager(size, requestId, instanceGroupManager); @@ -784,22 +902,31 @@ public void resizeInstanceGroupManagerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void resizeInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { Integer size = 3530753; String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); client.resizeInstanceGroupManager(size, requestId, instanceGroupManager); Assert.fail("No exception raised"); @@ -832,60 +959,79 @@ public void setInstanceTemplateInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource = + InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); Operation actualResponse = - client.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + client.setInstanceTemplateInstanceGroupManager( + requestId, + instanceGroupManager, + instanceGroupManagersSetInstanceTemplateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); - - client.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetInstanceTemplateRequest + instanceGroupManagersSetInstanceTemplateRequestResource = + InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); + + client.setInstanceTemplateInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -916,64 +1062,79 @@ public void setTargetPoolsInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = + InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); Operation actualResponse = - client.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + client.setTargetPoolsInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setTargetPoolsInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); - - client.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManagersSetTargetPoolsRequest + instanceGroupManagersSetTargetPoolsRequestResource = + InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + + client.setTargetPoolsInstanceGroupManager( + requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index e908d3c9472e..cdd2a199e6d5 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.deleteInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.getInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.insertInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.listInstanceTemplatesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,19 +31,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.deleteInstanceTemplateMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.getInstanceTemplateMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.insertInstanceTemplateMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.listInstanceTemplatesMethodDescriptor; import com.google.cloud.compute.v1.stub.InstanceTemplateStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,15 +46,15 @@ @javax.annotation.Generated("by GAPIC") public class InstanceTemplateClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteInstanceTemplateMethodDescriptor, - getInstanceTemplateMethodDescriptor, - insertInstanceTemplateMethodDescriptor, - listInstanceTemplatesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InstanceTemplateStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteInstanceTemplateMethodDescriptor, + getInstanceTemplateMethodDescriptor, + insertInstanceTemplateMethodDescriptor, + listInstanceTemplatesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, InstanceTemplateStubSettings.getDefaultEndpoint()); private static InstanceTemplateClient client; private static InstanceTemplateSettings clientSettings; @@ -64,13 +63,13 @@ public class InstanceTemplateClientTest { public static void setUp() throws IOException { clientSettings = InstanceTemplateSettings.newBuilder() - .setTransportChannelProvider( - InstanceTemplateSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InstanceTemplateClient.create(clientSettings); + .setTransportChannelProvider( + InstanceTemplateSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InstanceTemplateClient.create(clientSettings); } @After @@ -107,55 +106,65 @@ public void deleteInstanceTemplateTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteInstanceTemplate(instanceTemplate, requestId); + Operation actualResponse = client.deleteInstanceTemplate(instanceTemplate, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstanceTemplateExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); String requestId = "requestId37109963"; client.deleteInstanceTemplate(instanceTemplate, requestId); @@ -174,39 +183,49 @@ public void getInstanceTemplateTest() { String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - InstanceTemplate expectedResponse = InstanceTemplate.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + InstanceTemplate expectedResponse = + InstanceTemplate.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - InstanceTemplate actualResponse = - client.getInstanceTemplate(instanceTemplate); + InstanceTemplate actualResponse = client.getInstanceTemplate(instanceTemplate); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInstanceTemplateExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); client.getInstanceTemplate(instanceTemplate); Assert.fail("No exception raised"); @@ -239,29 +258,30 @@ public void insertInstanceTemplateTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -275,16 +295,24 @@ public void insertInstanceTemplateTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInstanceTemplateExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -308,13 +336,14 @@ public void listInstanceTemplatesTest() { String selfLink = "selfLink-1691268851"; InstanceTemplate itemsElement = InstanceTemplate.newBuilder().build(); List items = Arrays.asList(itemsElement); - InstanceTemplateList expectedResponse = InstanceTemplateList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InstanceTemplateList expectedResponse = + InstanceTemplateList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -323,22 +352,29 @@ public void listInstanceTemplatesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstanceTemplatesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -350,5 +386,4 @@ public void listInstanceTemplatesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java index f624ff289c67..23dab449c76a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.aggregatedListInterconnectAttachmentsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.deleteInterconnectAttachmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.getInterconnectAttachmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.insertInterconnectAttachmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.listInterconnectAttachmentsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,13 +33,6 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.aggregatedListInterconnectAttachmentsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.deleteInterconnectAttachmentMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.getInterconnectAttachmentMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.insertInterconnectAttachmentMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.listInterconnectAttachmentsMethodDescriptor; import com.google.cloud.compute.v1.stub.InterconnectAttachmentStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -49,16 +50,17 @@ @javax.annotation.Generated("by GAPIC") public class InterconnectAttachmentClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListInterconnectAttachmentsMethodDescriptor, - deleteInterconnectAttachmentMethodDescriptor, - getInterconnectAttachmentMethodDescriptor, - insertInterconnectAttachmentMethodDescriptor, - listInterconnectAttachmentsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InterconnectAttachmentStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListInterconnectAttachmentsMethodDescriptor, + deleteInterconnectAttachmentMethodDescriptor, + getInterconnectAttachmentMethodDescriptor, + insertInterconnectAttachmentMethodDescriptor, + listInterconnectAttachmentsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService( + METHOD_DESCRIPTORS, InterconnectAttachmentStubSettings.getDefaultEndpoint()); private static InterconnectAttachmentClient client; private static InterconnectAttachmentSettings clientSettings; @@ -67,13 +69,13 @@ public class InterconnectAttachmentClientTest { public static void setUp() throws IOException { clientSettings = InterconnectAttachmentSettings.newBuilder() - .setTransportChannelProvider( - InterconnectAttachmentSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InterconnectAttachmentClient.create(clientSettings); + .setTransportChannelProvider( + InterconnectAttachmentSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InterconnectAttachmentClient.create(clientSettings); } @After @@ -93,40 +95,52 @@ public void aggregatedListInterconnectAttachmentsTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - InterconnectAttachmentsScopedList itemsItem = InterconnectAttachmentsScopedList.newBuilder().build(); + InterconnectAttachmentsScopedList itemsItem = + InterconnectAttachmentsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - InterconnectAttachmentAggregatedList expectedResponse = InterconnectAttachmentAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + InterconnectAttachmentAggregatedList expectedResponse = + InterconnectAttachmentAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListInterconnectAttachmentsPagedResponse pagedListResponse = client.aggregatedListInterconnectAttachments(project); + AggregatedListInterconnectAttachmentsPagedResponse pagedListResponse = + client.aggregatedListInterconnectAttachments(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListInterconnectAttachmentsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -163,33 +177,36 @@ public void deleteInterconnectAttachmentTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + ProjectRegionInterconnectAttachmentName interconnectAttachment = + ProjectRegionInterconnectAttachmentName.of( + "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); Operation actualResponse = client.deleteInterconnectAttachment(requestId, interconnectAttachment); @@ -198,21 +215,31 @@ public void deleteInterconnectAttachmentTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInterconnectAttachmentExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + ProjectRegionInterconnectAttachmentName interconnectAttachment = + ProjectRegionInterconnectAttachmentName.of( + "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); client.deleteInterconnectAttachment(requestId, interconnectAttachment); Assert.fail("No exception raised"); @@ -229,32 +256,37 @@ public void getInterconnectAttachmentTest() { String kind = "kind3292052"; String googleReferenceId = "googleReferenceId534944469"; String description = "description-1724546052"; - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); String customerRouterIpAddress = "customerRouterIpAddress-741266063"; String selfLink = "selfLink-1691268851"; - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InterconnectAttachment expectedResponse = InterconnectAttachment.newBuilder() - .setCloudRouterIpAddress(cloudRouterIpAddress) - .setOperationalStatus(operationalStatus) - .setKind(kind) - .setGoogleReferenceId(googleReferenceId) - .setDescription(description) - .setInterconnect(interconnect.toString()) - .setCustomerRouterIpAddress(customerRouterIpAddress) - .setSelfLink(selfLink) - .setRouter(router.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InterconnectAttachment expectedResponse = + InterconnectAttachment.newBuilder() + .setCloudRouterIpAddress(cloudRouterIpAddress) + .setOperationalStatus(operationalStatus) + .setKind(kind) + .setGoogleReferenceId(googleReferenceId) + .setDescription(description) + .setInterconnect(interconnect.toString()) + .setCustomerRouterIpAddress(customerRouterIpAddress) + .setSelfLink(selfLink) + .setRouter(router.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + ProjectRegionInterconnectAttachmentName interconnectAttachment = + ProjectRegionInterconnectAttachmentName.of( + "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); InterconnectAttachment actualResponse = client.getInterconnectAttachment(interconnectAttachment); @@ -263,20 +295,30 @@ public void getInterconnectAttachmentTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInterconnectAttachmentExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + ProjectRegionInterconnectAttachmentName interconnectAttachment = + ProjectRegionInterconnectAttachmentName.of( + "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); client.getInterconnectAttachment(interconnectAttachment); Assert.fail("No exception raised"); @@ -309,34 +351,36 @@ public void insertInterconnectAttachmentTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build(); + InterconnectAttachment interconnectAttachmentResource = + InterconnectAttachment.newBuilder().build(); Operation actualResponse = client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource); @@ -345,22 +389,31 @@ public void insertInterconnectAttachmentTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInterconnectAttachmentExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build(); + InterconnectAttachment interconnectAttachmentResource = + InterconnectAttachment.newBuilder().build(); client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource); Assert.fail("No exception raised"); @@ -378,37 +431,46 @@ public void listInterconnectAttachmentsTest() { String selfLink = "selfLink-1691268851"; InterconnectAttachment itemsElement = InterconnectAttachment.newBuilder().build(); List items = Arrays.asList(itemsElement); - InterconnectAttachmentList expectedResponse = InterconnectAttachmentList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InterconnectAttachmentList expectedResponse = + InterconnectAttachmentList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ListInterconnectAttachmentsPagedResponse pagedListResponse = client.listInterconnectAttachments(region); + ListInterconnectAttachmentsPagedResponse pagedListResponse = + client.listInterconnectAttachments(region); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInterconnectAttachmentsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -420,5 +482,4 @@ public void listInterconnectAttachmentsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java index b13216d97431..730a1e91e71a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.deleteInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.getInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.insertInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.listInterconnectsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.patchInterconnectMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,20 +32,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.deleteInterconnectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.getInterconnectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.insertInterconnectMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.listInterconnectsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.patchInterconnectMethodDescriptor; import com.google.cloud.compute.v1.stub.InterconnectStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -48,16 +47,16 @@ @javax.annotation.Generated("by GAPIC") public class InterconnectClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteInterconnectMethodDescriptor, - getInterconnectMethodDescriptor, - insertInterconnectMethodDescriptor, - listInterconnectsMethodDescriptor, - patchInterconnectMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InterconnectStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteInterconnectMethodDescriptor, + getInterconnectMethodDescriptor, + insertInterconnectMethodDescriptor, + listInterconnectsMethodDescriptor, + patchInterconnectMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, InterconnectStubSettings.getDefaultEndpoint()); private static InterconnectClient client; private static InterconnectSettings clientSettings; @@ -66,13 +65,13 @@ public class InterconnectClientTest { public static void setUp() throws IOException { clientSettings = InterconnectSettings.newBuilder() - .setTransportChannelProvider( - InterconnectSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InterconnectClient.create(clientSettings); + .setTransportChannelProvider( + InterconnectSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InterconnectClient.create(clientSettings); } @After @@ -109,56 +108,66 @@ public void deleteInterconnectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); - Operation actualResponse = - client.deleteInterconnect(requestId, interconnect); + Operation actualResponse = client.deleteInterconnect(requestId, interconnect); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInterconnectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); client.deleteInterconnect(requestId, interconnect); Assert.fail("No exception raised"); @@ -188,51 +197,61 @@ public void getInterconnectTest() { String id = "id3355"; String googleIpAddress = "googleIpAddress1516847778"; String nocContactEmail = "nocContactEmail1087814656"; - Interconnect expectedResponse = Interconnect.newBuilder() - .setOperationalStatus(operationalStatus) - .setInterconnectType(interconnectType) - .setPeerIpAddress(peerIpAddress) - .setKind(kind) - .setRequestedLinkCount(requestedLinkCount) - .setGoogleReferenceId(googleReferenceId) - .setDescription(description) - .setCustomerName(customerName) - .setSelfLink(selfLink) - .setAdminEnabled(adminEnabled) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setLinkType(linkType) - .setLocation(location) - .setProvisionedLinkCount(provisionedLinkCount) - .setId(id) - .setGoogleIpAddress(googleIpAddress) - .setNocContactEmail(nocContactEmail) - .build(); + Interconnect expectedResponse = + Interconnect.newBuilder() + .setOperationalStatus(operationalStatus) + .setInterconnectType(interconnectType) + .setPeerIpAddress(peerIpAddress) + .setKind(kind) + .setRequestedLinkCount(requestedLinkCount) + .setGoogleReferenceId(googleReferenceId) + .setDescription(description) + .setCustomerName(customerName) + .setSelfLink(selfLink) + .setAdminEnabled(adminEnabled) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setLinkType(linkType) + .setLocation(location) + .setProvisionedLinkCount(provisionedLinkCount) + .setId(id) + .setGoogleIpAddress(googleIpAddress) + .setNocContactEmail(nocContactEmail) + .build(); mockService.addResponse(expectedResponse); - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); - Interconnect actualResponse = - client.getInterconnect(interconnect); + Interconnect actualResponse = client.getInterconnect(interconnect); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInterconnectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); client.getInterconnect(interconnect); Assert.fail("No exception raised"); @@ -265,52 +284,60 @@ public void insertInterconnectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); - Operation actualResponse = - client.insertInterconnect(requestId, project, interconnectResource); + Operation actualResponse = client.insertInterconnect(requestId, project, interconnectResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertInterconnectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -334,13 +361,14 @@ public void listInterconnectsTest() { String selfLink = "selfLink-1691268851"; Interconnect itemsElement = Interconnect.newBuilder().build(); List items = Arrays.asList(itemsElement); - InterconnectList expectedResponse = InterconnectList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InterconnectList expectedResponse = + InterconnectList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -349,22 +377,29 @@ public void listInterconnectsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInterconnectsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -401,33 +436,35 @@ public void patchInterconnectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); Operation actualResponse = @@ -437,21 +474,30 @@ public void patchInterconnectTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchInterconnectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectInterconnectName interconnect = ProjectInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); client.patchInterconnect(requestId, interconnect, interconnectResource); @@ -460,5 +506,4 @@ public void patchInterconnectExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java index c8066cdbd6c9..47440e971a95 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java @@ -15,6 +15,10 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectLocationStub.getInterconnectLocationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectLocationStub.listInterconnectLocationsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,17 +29,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.InterconnectLocationClient.ListInterconnectLocationsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectLocationStub.getInterconnectLocationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectLocationStub.listInterconnectLocationsMethodDescriptor; import com.google.cloud.compute.v1.stub.InterconnectLocationStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,13 +44,13 @@ @javax.annotation.Generated("by GAPIC") public class InterconnectLocationClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - getInterconnectLocationMethodDescriptor, - listInterconnectLocationsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, InterconnectLocationStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getInterconnectLocationMethodDescriptor, listInterconnectLocationsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService( + METHOD_DESCRIPTORS, InterconnectLocationStubSettings.getDefaultEndpoint()); private static InterconnectLocationClient client; private static InterconnectLocationSettings clientSettings; @@ -60,13 +59,13 @@ public class InterconnectLocationClientTest { public static void setUp() throws IOException { clientSettings = InterconnectLocationSettings.newBuilder() - .setTransportChannelProvider( - InterconnectLocationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - InterconnectLocationClient.create(clientSettings); + .setTransportChannelProvider( + InterconnectLocationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = InterconnectLocationClient.create(clientSettings); } @After @@ -83,7 +82,7 @@ public static void tearDown() throws Exception { @SuppressWarnings("all") public void getInterconnectLocationTest() { String continent = "continent-403427916"; - ProjectAddressName address = ProjectAddressName.of("[PROJECT]", "[ADDRESS]"); + ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String city = "city3053931"; String kind = "kind3292052"; String description = "description-1724546052"; @@ -95,46 +94,56 @@ public void getInterconnectLocationTest() { String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String id = "id3355"; - InterconnectLocation expectedResponse = InterconnectLocation.newBuilder() - .setContinent(continent) - .setAddress(address.toString()) - .setCity(city) - .setKind(kind) - .setDescription(description) - .setPeeringdbFacilityId(peeringdbFacilityId) - .setAvailabilityZone(availabilityZone) - .setFacilityProviderFacilityId(facilityProviderFacilityId) - .setSelfLink(selfLink) - .setFacilityProvider(facilityProvider) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .build(); + InterconnectLocation expectedResponse = + InterconnectLocation.newBuilder() + .setContinent(continent) + .setAddress(address.toString()) + .setCity(city) + .setKind(kind) + .setDescription(description) + .setPeeringdbFacilityId(peeringdbFacilityId) + .setAvailabilityZone(availabilityZone) + .setFacilityProviderFacilityId(facilityProviderFacilityId) + .setSelfLink(selfLink) + .setFacilityProvider(facilityProvider) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .build(); mockService.addResponse(expectedResponse); - ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]"); + ProjectGlobalInterconnectLocationName interconnectLocation = + ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]"); - InterconnectLocation actualResponse = - client.getInterconnectLocation(interconnectLocation); + InterconnectLocation actualResponse = client.getInterconnectLocation(interconnectLocation); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getInterconnectLocationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectInterconnectLocationName interconnectLocation = ProjectInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]"); + ProjectGlobalInterconnectLocationName interconnectLocation = + ProjectGlobalInterconnectLocationName.of("[PROJECT]", "[INTERCONNECT_LOCATION]"); client.getInterconnectLocation(interconnectLocation); Assert.fail("No exception raised"); @@ -152,37 +161,46 @@ public void listInterconnectLocationsTest() { String selfLink = "selfLink-1691268851"; InterconnectLocation itemsElement = InterconnectLocation.newBuilder().build(); List items = Arrays.asList(itemsElement); - InterconnectLocationList expectedResponse = InterconnectLocationList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + InterconnectLocationList expectedResponse = + InterconnectLocationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - ListInterconnectLocationsPagedResponse pagedListResponse = client.listInterconnectLocations(project); + ListInterconnectLocationsPagedResponse pagedListResponse = + client.listInterconnectLocations(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInterconnectLocationsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -194,5 +212,4 @@ public void listInterconnectLocationsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java index 21a49fedbc97..ae4e7d5e7d36 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.LicenseClient.ListLicensesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.deleteLicenseMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.getLicenseMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.insertLicenseMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.listLicensesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.testIamPermissionsLicenseMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,15 +32,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.getLicenseMethodDescriptor; import com.google.cloud.compute.v1.stub.LicenseStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -43,12 +47,16 @@ @javax.annotation.Generated("by GAPIC") public class LicenseClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - getLicenseMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, LicenseStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteLicenseMethodDescriptor, + getLicenseMethodDescriptor, + insertLicenseMethodDescriptor, + listLicensesMethodDescriptor, + testIamPermissionsLicenseMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, LicenseStubSettings.getDefaultEndpoint()); private static LicenseClient client; private static LicenseSettings clientSettings; @@ -57,13 +65,13 @@ public class LicenseClientTest { public static void setUp() throws IOException { clientSettings = LicenseSettings.newBuilder() - .setTransportChannelProvider( - LicenseSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - LicenseClient.create(clientSettings); + .setTransportChannelProvider( + LicenseSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LicenseClient.create(clientSettings); } @After @@ -76,44 +84,153 @@ public static void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void deleteLicenseTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); + String requestId = "requestId37109963"; + + Operation actualResponse = client.deleteLicense(license, requestId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteLicenseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); + String requestId = "requestId37109963"; + + client.deleteLicense(license, requestId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void getLicenseTest() { Boolean chargesUseFee = true; String kind = "kind3292052"; + Boolean transferable = false; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + ProjectGlobalLicenseCodeName licenseCode = + ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]"); String selfLink = "selfLink-1691268851"; - License expectedResponse = License.newBuilder() - .setChargesUseFee(chargesUseFee) - .setKind(kind) - .setName(name) - .setSelfLink(selfLink) - .build(); + License expectedResponse = + License.newBuilder() + .setChargesUseFee(chargesUseFee) + .setKind(kind) + .setTransferable(transferable) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setLicenseCode(licenseCode.toString()) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]"); + ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); - License actualResponse = - client.getLicense(license); + License actualResponse = client.getLicense(license); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getLicenseExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectLicenseName license = ProjectLicenseName.of("[PROJECT]", "[LICENSE]"); + ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); client.getLicense(license); Assert.fail("No exception raised"); @@ -122,4 +239,204 @@ public void getLicenseExceptionTest() throws Exception { } } -} \ No newline at end of file + @Test + @SuppressWarnings("all") + public void insertLicenseTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + License licenseResource = License.newBuilder().build(); + + Operation actualResponse = client.insertLicense(requestId, project, licenseResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void insertLicenseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + License licenseResource = License.newBuilder().build(); + + client.insertLicense(requestId, project, licenseResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listLicensesTest() { + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + License itemsElement = License.newBuilder().build(); + List items = Arrays.asList(itemsElement); + LicensesListResponse expectedResponse = + LicensesListResponse.newBuilder() + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListLicensesPagedResponse pagedListResponse = client.listLicenses(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listLicensesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listLicenses(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsLicenseTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalLicenseResourceName resource = + ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsLicense(resource, testPermissionsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsLicenseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalLicenseResourceName resource = + ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsLicense(resource, testPermissionsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java new file mode 100644 index 000000000000..a6faec2c6fa8 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java @@ -0,0 +1,192 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseCodeStub.getLicenseCodeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseCodeStub.testIamPermissionsLicenseCodeMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.LicenseCodeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class LicenseCodeClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getLicenseCodeMethodDescriptor, testIamPermissionsLicenseCodeMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, LicenseCodeStubSettings.getDefaultEndpoint()); + + private static LicenseCodeClient client; + private static LicenseCodeSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + LicenseCodeSettings.newBuilder() + .setTransportChannelProvider( + LicenseCodeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LicenseCodeClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getLicenseCodeTest() { + String kind = "kind3292052"; + Boolean transferable = false; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String state = "state109757585"; + String selfLink = "selfLink-1691268851"; + LicenseCode expectedResponse = + LicenseCode.newBuilder() + .setKind(kind) + .setTransferable(transferable) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setState(state) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalLicenseCodeName licenseCode = + ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]"); + + LicenseCode actualResponse = client.getLicenseCode(licenseCode); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getLicenseCodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalLicenseCodeName licenseCode = + ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]"); + + client.getLicenseCode(licenseCode); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsLicenseCodeTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalLicenseCodeResourceName resource = + ProjectGlobalLicenseCodeResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsLicenseCode(resource, testPermissionsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsLicenseCodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalLicenseCodeResourceName resource = + ProjectGlobalLicenseCodeResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsLicenseCode(resource, testPermissionsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java index d4e6e37bd1b2..22d06700e10c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.aggregatedListMachineTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.getMachineTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.listMachineTypesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,11 +31,6 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.MachineTypeClient.AggregatedListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.MachineTypeClient.ListMachineTypesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.aggregatedListMachineTypesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.getMachineTypeMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonMachineTypeStub.listMachineTypesMethodDescriptor; import com.google.cloud.compute.v1.stub.MachineTypeStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -47,14 +48,14 @@ @javax.annotation.Generated("by GAPIC") public class MachineTypeClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListMachineTypesMethodDescriptor, - getMachineTypeMethodDescriptor, - listMachineTypesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, MachineTypeStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListMachineTypesMethodDescriptor, + getMachineTypeMethodDescriptor, + listMachineTypesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, MachineTypeStubSettings.getDefaultEndpoint()); private static MachineTypeClient client; private static MachineTypeSettings clientSettings; @@ -63,13 +64,13 @@ public class MachineTypeClientTest { public static void setUp() throws IOException { clientSettings = MachineTypeSettings.newBuilder() - .setTransportChannelProvider( - MachineTypeSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - MachineTypeClient.create(clientSettings); + .setTransportChannelProvider( + MachineTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MachineTypeClient.create(clientSettings); } @After @@ -92,37 +93,47 @@ public void aggregatedListMachineTypesTest() { MachineTypesScopedList itemsItem = MachineTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - MachineTypeAggregatedList expectedResponse = MachineTypeAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + MachineTypeAggregatedList expectedResponse = + MachineTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListMachineTypesPagedResponse pagedListResponse = client.aggregatedListMachineTypes(project); + AggregatedListMachineTypesPagedResponse pagedListResponse = + client.aggregatedListMachineTypes(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListMachineTypesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -151,46 +162,56 @@ public void getMachineTypeTest() { String name = "name3373707"; String id = "id3355"; Integer imageSpaceGb = 461539048; - MachineType expectedResponse = MachineType.newBuilder() - .setIsSharedCpu(isSharedCpu) - .setGuestCpus(guestCpus) - .setKind(kind) - .setDescription(description) - .setSelfLink(selfLink) - .setMemoryMb(memoryMb) - .setMaximumPersistentDisks(maximumPersistentDisks) - .setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb) - .setZone(zone.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setImageSpaceGb(imageSpaceGb) - .build(); + MachineType expectedResponse = + MachineType.newBuilder() + .setIsSharedCpu(isSharedCpu) + .setGuestCpus(guestCpus) + .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setMemoryMb(memoryMb) + .setMaximumPersistentDisks(maximumPersistentDisks) + .setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setImageSpaceGb(imageSpaceGb) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + ProjectZoneMachineTypeName machineType = + ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); - MachineType actualResponse = - client.getMachineType(machineType); + MachineType actualResponse = client.getMachineType(machineType); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getMachineTypeExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + ProjectZoneMachineTypeName machineType = + ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); client.getMachineType(machineType); Assert.fail("No exception raised"); @@ -208,13 +229,14 @@ public void listMachineTypesTest() { String selfLink = "selfLink-1691268851"; MachineType itemsElement = MachineType.newBuilder().build(); List items = Arrays.asList(itemsElement); - MachineTypeList expectedResponse = MachineTypeList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + MachineTypeList expectedResponse = + MachineTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -223,22 +245,29 @@ public void listMachineTypesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listMachineTypesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -250,5 +279,4 @@ public void listMachineTypesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java index 8fe3da6e38c0..c7fa343db950 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -15,6 +15,16 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.addPeeringNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.deleteNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.getNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.insertNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.listNetworksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.patchNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.removePeeringNetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.switchToCustomModeNetworkMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,23 +35,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.NetworkClient.ListNetworksPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.addPeeringNetworkMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.deleteNetworkMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.getNetworkMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.insertNetworkMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.listNetworksMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.patchNetworkMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.removePeeringNetworkMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonNetworkStub.switchToCustomModeNetworkMethodDescriptor; import com.google.cloud.compute.v1.stub.NetworkStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -51,19 +50,19 @@ @javax.annotation.Generated("by GAPIC") public class NetworkClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - addPeeringNetworkMethodDescriptor, - deleteNetworkMethodDescriptor, - getNetworkMethodDescriptor, - insertNetworkMethodDescriptor, - listNetworksMethodDescriptor, - patchNetworkMethodDescriptor, - removePeeringNetworkMethodDescriptor, - switchToCustomModeNetworkMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, NetworkStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + addPeeringNetworkMethodDescriptor, + deleteNetworkMethodDescriptor, + getNetworkMethodDescriptor, + insertNetworkMethodDescriptor, + listNetworksMethodDescriptor, + patchNetworkMethodDescriptor, + removePeeringNetworkMethodDescriptor, + switchToCustomModeNetworkMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, NetworkStubSettings.getDefaultEndpoint()); private static NetworkClient client; private static NetworkSettings clientSettings; @@ -72,13 +71,13 @@ public class NetworkClientTest { public static void setUp() throws IOException { clientSettings = NetworkSettings.newBuilder() - .setTransportChannelProvider( - NetworkSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - NetworkClient.create(clientSettings); + .setTransportChannelProvider( + NetworkSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NetworkClient.create(clientSettings); } @After @@ -115,34 +114,36 @@ public void addPeeringNetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); - NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksAddPeeringRequest networksAddPeeringRequestResource = + NetworksAddPeeringRequest.newBuilder().build(); Operation actualResponse = client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); @@ -151,22 +152,31 @@ public void addPeeringNetworkTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void addPeeringNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); - NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksAddPeeringRequest networksAddPeeringRequestResource = + NetworksAddPeeringRequest.newBuilder().build(); client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); Assert.fail("No exception raised"); @@ -199,56 +209,64 @@ public void deleteNetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - Operation actualResponse = - client.deleteNetwork(requestId, network); + Operation actualResponse = client.deleteNetwork(requestId, network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); client.deleteNetwork(requestId, network); Assert.fail("No exception raised"); @@ -269,42 +287,50 @@ public void getNetworkTest() { String id = "id3355"; String gatewayIPv4 = "gatewayIPv4-1431933859"; String selfLink = "selfLink-1691268851"; - Network expectedResponse = Network.newBuilder() - .setIPv4Range(iPv4Range) - .setKind(kind) - .setAutoCreateSubnetworks(autoCreateSubnetworks) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setGatewayIPv4(gatewayIPv4) - .setSelfLink(selfLink) - .build(); + Network expectedResponse = + Network.newBuilder() + .setIPv4Range(iPv4Range) + .setKind(kind) + .setAutoCreateSubnetworks(autoCreateSubnetworks) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setGatewayIPv4(gatewayIPv4) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - Network actualResponse = - client.getNetwork(network); + Network actualResponse = client.getNetwork(network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); client.getNetwork(network); Assert.fail("No exception raised"); @@ -337,52 +363,60 @@ public void insertNetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Network networkResource = Network.newBuilder().build(); - Operation actualResponse = - client.insertNetwork(requestId, project, networkResource); + Operation actualResponse = client.insertNetwork(requestId, project, networkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -406,13 +440,14 @@ public void listNetworksTest() { String selfLink = "selfLink-1691268851"; Network itemsElement = Network.newBuilder().build(); List items = Arrays.asList(itemsElement); - NetworkList expectedResponse = NetworkList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + NetworkList expectedResponse = + NetworkList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -421,22 +456,29 @@ public void listNetworksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listNetworksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -473,57 +515,65 @@ public void patchNetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); Network networkResource = Network.newBuilder().build(); - Operation actualResponse = - client.patchNetwork(requestId, network, networkResource); + Operation actualResponse = client.patchNetwork(requestId, network, networkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); Network networkResource = Network.newBuilder().build(); client.patchNetwork(requestId, network, networkResource); @@ -557,34 +607,36 @@ public void removePeeringNetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); - NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build(); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksRemovePeeringRequest networksRemovePeeringRequestResource = + NetworksRemovePeeringRequest.newBuilder().build(); Operation actualResponse = client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource); @@ -593,22 +645,31 @@ public void removePeeringNetworkTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void removePeeringNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); - NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build(); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + NetworksRemovePeeringRequest networksRemovePeeringRequestResource = + NetworksRemovePeeringRequest.newBuilder().build(); client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource); Assert.fail("No exception raised"); @@ -641,56 +702,64 @@ public void switchToCustomModeNetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - Operation actualResponse = - client.switchToCustomModeNetwork(requestId, network); + Operation actualResponse = client.switchToCustomModeNetwork(requestId, network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void switchToCustomModeNetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); client.switchToCustomModeNetwork(requestId, network); Assert.fail("No exception raised"); @@ -698,5 +767,4 @@ public void switchToCustomModeNetworkExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index d05268977586..76277b4bc483 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.ProjectClient.GetXpnResourcesProjectsPagedResponse; import static com.google.cloud.compute.v1.ProjectClient.ListXpnHostsProjectsPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.disableXpnHostProjectMethodDescriptor; @@ -39,14 +29,23 @@ import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.ProjectStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -56,23 +55,23 @@ @javax.annotation.Generated("by GAPIC") public class ProjectClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - disableXpnHostProjectMethodDescriptor, - disableXpnResourceProjectMethodDescriptor, - enableXpnHostProjectMethodDescriptor, - enableXpnResourceProjectMethodDescriptor, - getProjectMethodDescriptor, - getXpnHostProjectMethodDescriptor, - getXpnResourcesProjectsMethodDescriptor, - listXpnHostsProjectsMethodDescriptor, - moveDiskProjectMethodDescriptor, - moveInstanceProjectMethodDescriptor, - setCommonInstanceMetadataProjectMethodDescriptor, - setUsageExportBucketProjectMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + disableXpnHostProjectMethodDescriptor, + disableXpnResourceProjectMethodDescriptor, + enableXpnHostProjectMethodDescriptor, + enableXpnResourceProjectMethodDescriptor, + getProjectMethodDescriptor, + getXpnHostProjectMethodDescriptor, + getXpnResourcesProjectsMethodDescriptor, + listXpnHostsProjectsMethodDescriptor, + moveDiskProjectMethodDescriptor, + moveInstanceProjectMethodDescriptor, + setCommonInstanceMetadataProjectMethodDescriptor, + setUsageExportBucketProjectMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); private static ProjectClient client; private static ProjectSettings clientSettings; @@ -81,13 +80,13 @@ public class ProjectClientTest { public static void setUp() throws IOException { clientSettings = ProjectSettings.newBuilder() - .setTransportChannelProvider( - ProjectSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - ProjectClient.create(clientSettings); + .setTransportChannelProvider( + ProjectSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProjectClient.create(clientSettings); } @After @@ -124,51 +123,59 @@ public void disableXpnHostProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - Operation actualResponse = - client.disableXpnHostProject(requestId, project); + Operation actualResponse = client.disableXpnHostProject(requestId, project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void disableXpnHostProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -206,60 +213,73 @@ public void disableXpnResourceProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build(); + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = + ProjectsDisableXpnResourceRequest.newBuilder().build(); Operation actualResponse = - client.disableXpnResourceProject(requestId, project, projectsDisableXpnResourceRequestResource); + client.disableXpnResourceProject( + requestId, project, projectsDisableXpnResourceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void disableXpnResourceProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build(); + ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = + ProjectsDisableXpnResourceRequest.newBuilder().build(); - client.disableXpnResourceProject(requestId, project, projectsDisableXpnResourceRequestResource); + client.disableXpnResourceProject( + requestId, project, projectsDisableXpnResourceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -290,51 +310,59 @@ public void enableXpnHostProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - Operation actualResponse = - client.enableXpnHostProject(requestId, project); + Operation actualResponse = client.enableXpnHostProject(requestId, project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void enableXpnHostProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -372,58 +400,70 @@ public void enableXpnResourceProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build(); + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = + ProjectsEnableXpnResourceRequest.newBuilder().build(); Operation actualResponse = - client.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource); + client.enableXpnResourceProject( + requestId, project, projectsEnableXpnResourceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void enableXpnResourceProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build(); + ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = + ProjectsEnableXpnResourceRequest.newBuilder().build(); client.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource); Assert.fail("No exception raised"); @@ -443,37 +483,45 @@ public void getProjectTest() { String id = "id3355"; String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; - Project expectedResponse = Project.newBuilder() - .setXpnProjectStatus(xpnProjectStatus) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setDefaultServiceAccount(defaultServiceAccount) - .setSelfLink(selfLink) - .build(); + Project expectedResponse = + Project.newBuilder() + .setXpnProjectStatus(xpnProjectStatus) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultServiceAccount(defaultServiceAccount) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - Project actualResponse = - client.getProject(project); + Project actualResponse = client.getProject(project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -497,37 +545,45 @@ public void getXpnHostProjectTest() { String id = "id3355"; String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; - Project expectedResponse = Project.newBuilder() - .setXpnProjectStatus(xpnProjectStatus) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setDefaultServiceAccount(defaultServiceAccount) - .setSelfLink(selfLink) - .build(); + Project expectedResponse = + Project.newBuilder() + .setXpnProjectStatus(xpnProjectStatus) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultServiceAccount(defaultServiceAccount) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - Project actualResponse = - client.getXpnHostProject(project); + Project actualResponse = client.getXpnHostProject(project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getXpnHostProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -546,36 +602,45 @@ public void getXpnResourcesProjectsTest() { String kind = "kind3292052"; String nextPageToken = ""; XpnResourceId resourcesElement = XpnResourceId.newBuilder().build(); - List resources = Arrays.asList(resourcesElement); - ProjectsGetXpnResources expectedResponse = ProjectsGetXpnResources.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .addAllResources(resources) - .build(); + List resources2 = Arrays.asList(resourcesElement); + ProjectsGetXpnResources expectedResponse = + ProjectsGetXpnResources.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .addAllResources(resources2) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - GetXpnResourcesProjectsPagedResponse pagedListResponse = client.getXpnResourcesProjects(project); + GetXpnResourcesProjectsPagedResponse pagedListResponse = + client.getXpnResourcesProjects(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getResourcesList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getXpnResourcesProjectsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -597,43 +662,54 @@ public void listXpnHostsProjectsTest() { String selfLink = "selfLink-1691268851"; Project itemsElement = Project.newBuilder().build(); List items = Arrays.asList(itemsElement); - XpnHostList expectedResponse = XpnHostList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + XpnHostList expectedResponse = + XpnHostList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build(); + ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = + ProjectsListXpnHostsRequest.newBuilder().build(); - ListXpnHostsProjectsPagedResponse pagedListResponse = client.listXpnHostsProjects(project, projectsListXpnHostsRequestResource); + ListXpnHostsProjectsPagedResponse pagedListResponse = + client.listXpnHostsProjects(project, projectsListXpnHostsRequestResource); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listXpnHostsProjectsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { ProjectName project = ProjectName.of("[PROJECT]"); - ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = ProjectsListXpnHostsRequest.newBuilder().build(); + ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource = + ProjectsListXpnHostsRequest.newBuilder().build(); client.listXpnHostsProjects(project, projectsListXpnHostsRequestResource); Assert.fail("No exception raised"); @@ -666,52 +742,60 @@ public void moveDiskProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); - Operation actualResponse = - client.moveDiskProject(requestId, project, diskMoveRequestResource); + Operation actualResponse = client.moveDiskProject(requestId, project, diskMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void moveDiskProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -750,29 +834,30 @@ public void moveInstanceProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -786,16 +871,24 @@ public void moveInstanceProjectTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void moveInstanceProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -834,29 +927,30 @@ public void setCommonInstanceMetadataProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -870,16 +964,24 @@ public void setCommonInstanceMetadataProjectTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -918,29 +1020,30 @@ public void setUsageExportBucketProjectTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -954,16 +1057,24 @@ public void setUsageExportBucketProjectTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setUsageExportBucketProjectExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -977,5 +1088,4 @@ public void setUsageExportBucketProjectExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index 9b67424aedbf..209d3bf3d330 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionAutoscalerClient.ListRegionAutoscalersPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.deleteRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.getRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.insertRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.listRegionAutoscalersMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.patchRegionAutoscalerMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionAutoscalerStub.updateRegionAutoscalerMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionAutoscalerStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class RegionAutoscalerClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteRegionAutoscalerMethodDescriptor, - getRegionAutoscalerMethodDescriptor, - insertRegionAutoscalerMethodDescriptor, - listRegionAutoscalersMethodDescriptor, - patchRegionAutoscalerMethodDescriptor, - updateRegionAutoscalerMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionAutoscalerMethodDescriptor, + getRegionAutoscalerMethodDescriptor, + insertRegionAutoscalerMethodDescriptor, + listRegionAutoscalersMethodDescriptor, + patchRegionAutoscalerMethodDescriptor, + updateRegionAutoscalerMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionAutoscalerStubSettings.getDefaultEndpoint()); private static RegionAutoscalerClient client; private static RegionAutoscalerSettings clientSettings; @@ -68,13 +67,13 @@ public class RegionAutoscalerClientTest { public static void setUp() throws IOException { clientSettings = RegionAutoscalerSettings.newBuilder() - .setTransportChannelProvider( - RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionAutoscalerClient.create(clientSettings); + .setTransportChannelProvider( + RegionAutoscalerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionAutoscalerClient.create(clientSettings); } @After @@ -111,55 +110,65 @@ public void deleteRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteRegionAutoscaler(autoscaler, requestId); + Operation actualResponse = client.deleteRegionAutoscaler(autoscaler, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); String requestId = "requestId37109963"; client.deleteRegionAutoscaler(autoscaler, requestId); @@ -182,43 +191,53 @@ public void getRegionAutoscalerTest() { String selfLink = "selfLink-1691268851"; String status = "status-892481550"; String target = "target-880905839"; - Autoscaler expectedResponse = Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setStatus(status) - .setTarget(target) - .build(); + Autoscaler expectedResponse = + Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .setTarget(target) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - Autoscaler actualResponse = - client.getRegionAutoscaler(autoscaler); + Autoscaler actualResponse = client.getRegionAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); + ProjectRegionAutoscalerName autoscaler = + ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); client.getRegionAutoscaler(autoscaler); Assert.fail("No exception raised"); @@ -251,52 +270,60 @@ public void insertRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.insertRegionAutoscaler(requestId, region, autoscalerResource); + Operation actualResponse = client.insertRegionAutoscaler(requestId, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -320,13 +347,14 @@ public void listRegionAutoscalersTest() { String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionAutoscalerList expectedResponse = RegionAutoscalerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionAutoscalerList expectedResponse = + RegionAutoscalerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -335,22 +363,29 @@ public void listRegionAutoscalersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionAutoscalersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -387,29 +422,30 @@ public void patchRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; @@ -424,16 +460,24 @@ public void patchRegionAutoscalerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -473,29 +517,30 @@ public void updateRegionAutoscalerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; @@ -510,16 +555,24 @@ public void updateRegionAutoscalerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateRegionAutoscalerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -534,5 +587,4 @@ public void updateRegionAutoscalerExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java index 9a3b35af7b93..7b62d5d73271 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -15,6 +15,15 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.deleteRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.getHealthRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.getRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.insertRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.listRegionBackendServicesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.patchRegionBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.updateRegionBackendServiceMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,22 +34,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionBackendServiceClient.ListRegionBackendServicesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.deleteRegionBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.getHealthRegionBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.getRegionBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.insertRegionBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.listRegionBackendServicesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.patchRegionBackendServiceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionBackendServiceStub.updateRegionBackendServiceMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionBackendServiceStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -50,18 +49,19 @@ @javax.annotation.Generated("by GAPIC") public class RegionBackendServiceClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteRegionBackendServiceMethodDescriptor, - getRegionBackendServiceMethodDescriptor, - getHealthRegionBackendServiceMethodDescriptor, - insertRegionBackendServiceMethodDescriptor, - listRegionBackendServicesMethodDescriptor, - patchRegionBackendServiceMethodDescriptor, - updateRegionBackendServiceMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionBackendServiceStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionBackendServiceMethodDescriptor, + getRegionBackendServiceMethodDescriptor, + getHealthRegionBackendServiceMethodDescriptor, + insertRegionBackendServiceMethodDescriptor, + listRegionBackendServicesMethodDescriptor, + patchRegionBackendServiceMethodDescriptor, + updateRegionBackendServiceMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService( + METHOD_DESCRIPTORS, RegionBackendServiceStubSettings.getDefaultEndpoint()); private static RegionBackendServiceClient client; private static RegionBackendServiceSettings clientSettings; @@ -70,13 +70,13 @@ public class RegionBackendServiceClientTest { public static void setUp() throws IOException { clientSettings = RegionBackendServiceSettings.newBuilder() - .setTransportChannelProvider( - RegionBackendServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionBackendServiceClient.create(clientSettings); + .setTransportChannelProvider( + RegionBackendServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionBackendServiceClient.create(clientSettings); } @After @@ -113,56 +113,66 @@ public void deleteRegionBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - Operation actualResponse = - client.deleteRegionBackendService(requestId, backendService); + Operation actualResponse = client.deleteRegionBackendService(requestId, backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRegionBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); client.deleteRegionBackendService(requestId, backendService); Assert.fail("No exception raised"); @@ -190,49 +200,59 @@ public void getRegionBackendServiceTest() { String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - BackendService expectedResponse = BackendService.newBuilder() - .setAffinityCookieTtlSec(affinityCookieTtlSec) - .setKind(kind) - .setSessionAffinity(sessionAffinity) - .setDescription(description) - .setLoadBalancingScheme(loadBalancingScheme) - .setPortName(portName) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setProtocol(protocol) - .setEnableCDN(enableCDN) - .setPort(port) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + BackendService expectedResponse = + BackendService.newBuilder() + .setAffinityCookieTtlSec(affinityCookieTtlSec) + .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setDescription(description) + .setLoadBalancingScheme(loadBalancingScheme) + .setPortName(portName) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setProtocol(protocol) + .setEnableCDN(enableCDN) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - BackendService actualResponse = - client.getRegionBackendService(backendService); + BackendService actualResponse = client.getRegionBackendService(backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); client.getRegionBackendService(backendService); Assert.fail("No exception raised"); @@ -245,13 +265,14 @@ public void getRegionBackendServiceExceptionTest() throws Exception { @SuppressWarnings("all") public void getHealthRegionBackendServiceTest() { String kind = "kind3292052"; - BackendServiceGroupHealth expectedResponse = BackendServiceGroupHealth.newBuilder() - .setKind(kind) - .build(); + BackendServiceGroupHealth expectedResponse = + BackendServiceGroupHealth.newBuilder().setKind(kind).build(); mockService.addResponse(expectedResponse); - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = + ResourceGroupReference.newBuilder().build(); BackendServiceGroupHealth actualResponse = client.getHealthRegionBackendService(backendService, resourceGroupReferenceResource); @@ -260,21 +281,31 @@ public void getHealthRegionBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getHealthRegionBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ResourceGroupReference resourceGroupReferenceResource = + ResourceGroupReference.newBuilder().build(); client.getHealthRegionBackendService(backendService, resourceGroupReferenceResource); Assert.fail("No exception raised"); @@ -307,29 +338,30 @@ public void insertRegionBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -343,16 +375,24 @@ public void insertRegionBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRegionBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -376,37 +416,46 @@ public void listRegionBackendServicesTest() { String selfLink = "selfLink-1691268851"; BackendService itemsElement = BackendService.newBuilder().build(); List items = Arrays.asList(itemsElement); - BackendServiceList expectedResponse = BackendServiceList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + BackendServiceList expectedResponse = + BackendServiceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ListRegionBackendServicesPagedResponse pagedListResponse = client.listRegionBackendServices(region); + ListRegionBackendServicesPagedResponse pagedListResponse = + client.listRegionBackendServices(region); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionBackendServicesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -443,33 +492,35 @@ public void patchRegionBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = @@ -479,21 +530,30 @@ public void patchRegionBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchRegionBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); client.patchRegionBackendService(requestId, backendService, backendServiceResource); @@ -527,33 +587,35 @@ public void updateRegionBackendServiceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = @@ -563,21 +625,30 @@ public void updateRegionBackendServiceTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateRegionBackendServiceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); + ProjectRegionBackendServiceName backendService = + ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); client.updateRegionBackendService(requestId, backendService, backendServiceResource); @@ -586,5 +657,4 @@ public void updateRegionBackendServiceExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java index 4acef13bb1a4..d5c49d2e43d9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java @@ -15,6 +15,10 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionStub.getRegionMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionStub.listRegionsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,17 +29,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionClient.ListRegionsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionStub.getRegionMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionStub.listRegionsMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,13 +44,12 @@ @javax.annotation.Generated("by GAPIC") public class RegionClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - getRegionMethodDescriptor, - listRegionsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getRegionMethodDescriptor, listRegionsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionStubSettings.getDefaultEndpoint()); private static RegionClient client; private static RegionSettings clientSettings; @@ -60,13 +58,13 @@ public class RegionClientTest { public static void setUp() throws IOException { clientSettings = RegionSettings.newBuilder() - .setTransportChannelProvider( - RegionSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionClient.create(clientSettings); + .setTransportChannelProvider( + RegionSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionClient.create(clientSettings); } @After @@ -89,36 +87,44 @@ public void getRegionTest() { String id = "id3355"; String selfLink = "selfLink-1691268851"; String status = "status-892481550"; - Region expectedResponse = Region.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .setStatus(status) - .build(); + Region expectedResponse = + Region.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - Region actualResponse = - client.getRegion(region); + Region actualResponse = client.getRegion(region); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -140,13 +146,14 @@ public void listRegionsTest() { String selfLink = "selfLink-1691268851"; Region itemsElement = Region.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionList expectedResponse = RegionList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionList expectedResponse = + RegionList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -155,22 +162,29 @@ public void listRegionsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -182,5 +196,4 @@ public void listRegionsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java index a98fdab5c25f..60e5592301dc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.aggregatedListRegionCommitmentsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.getRegionCommitmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.insertRegionCommitmentMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.listRegionCommitmentsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,12 +32,6 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionCommitmentClient.AggregatedListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.RegionCommitmentClient.ListRegionCommitmentsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.aggregatedListRegionCommitmentsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.getRegionCommitmentMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.insertRegionCommitmentMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionCommitmentStub.listRegionCommitmentsMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionCommitmentStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -48,15 +49,15 @@ @javax.annotation.Generated("by GAPIC") public class RegionCommitmentClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListRegionCommitmentsMethodDescriptor, - getRegionCommitmentMethodDescriptor, - insertRegionCommitmentMethodDescriptor, - listRegionCommitmentsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionCommitmentStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListRegionCommitmentsMethodDescriptor, + getRegionCommitmentMethodDescriptor, + insertRegionCommitmentMethodDescriptor, + listRegionCommitmentsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionCommitmentStubSettings.getDefaultEndpoint()); private static RegionCommitmentClient client; private static RegionCommitmentSettings clientSettings; @@ -65,13 +66,13 @@ public class RegionCommitmentClientTest { public static void setUp() throws IOException { clientSettings = RegionCommitmentSettings.newBuilder() - .setTransportChannelProvider( - RegionCommitmentSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionCommitmentClient.create(clientSettings); + .setTransportChannelProvider( + RegionCommitmentSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionCommitmentClient.create(clientSettings); } @After @@ -94,37 +95,47 @@ public void aggregatedListRegionCommitmentsTest() { CommitmentsScopedList itemsItem = CommitmentsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - CommitmentAggregatedList expectedResponse = CommitmentAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + CommitmentAggregatedList expectedResponse = + CommitmentAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListRegionCommitmentsPagedResponse pagedListResponse = client.aggregatedListRegionCommitments(project); + AggregatedListRegionCommitmentsPagedResponse pagedListResponse = + client.aggregatedListRegionCommitments(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListRegionCommitmentsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -152,45 +163,55 @@ public void getRegionCommitmentTest() { String plan = "plan3443497"; String startTimestamp = "startTimestamp-1526966919"; String status = "status-892481550"; - Commitment expectedResponse = Commitment.newBuilder() - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .setEndTimestamp(endTimestamp) - .setPlan(plan) - .setStartTimestamp(startTimestamp) - .setStatus(status) - .build(); + Commitment expectedResponse = + Commitment.newBuilder() + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .setEndTimestamp(endTimestamp) + .setPlan(plan) + .setStartTimestamp(startTimestamp) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); + ProjectRegionCommitmentName commitment = + ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); - Commitment actualResponse = - client.getRegionCommitment(commitment); + Commitment actualResponse = client.getRegionCommitment(commitment); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionCommitmentExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionCommitmentName commitment = ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); + ProjectRegionCommitmentName commitment = + ProjectRegionCommitmentName.of("[PROJECT]", "[REGION]", "[COMMITMENT]"); client.getRegionCommitment(commitment); Assert.fail("No exception raised"); @@ -223,52 +244,60 @@ public void insertRegionCommitmentTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Commitment commitmentResource = Commitment.newBuilder().build(); - Operation actualResponse = - client.insertRegionCommitment(requestId, region, commitmentResource); + Operation actualResponse = client.insertRegionCommitment(requestId, region, commitmentResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRegionCommitmentExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -292,13 +321,14 @@ public void listRegionCommitmentsTest() { String selfLink = "selfLink-1691268851"; Commitment itemsElement = Commitment.newBuilder().build(); List items = Arrays.asList(itemsElement); - CommitmentList expectedResponse = CommitmentList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + CommitmentList expectedResponse = + CommitmentList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -307,22 +337,29 @@ public void listRegionCommitmentsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionCommitmentsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -334,5 +371,4 @@ public void listRegionCommitmentsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java index 2672ab4e7b4d..6de861a732a7 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.getRegionInstanceGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.listInstancesRegionInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.listRegionInstanceGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.setNamedPortsRegionInstanceGroupMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,20 +32,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.getRegionInstanceGroupMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.listInstancesRegionInstanceGroupsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.listRegionInstanceGroupsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupStub.setNamedPortsRegionInstanceGroupMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionInstanceGroupStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -48,15 +47,15 @@ @javax.annotation.Generated("by GAPIC") public class RegionInstanceGroupClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - getRegionInstanceGroupMethodDescriptor, - listRegionInstanceGroupsMethodDescriptor, - listInstancesRegionInstanceGroupsMethodDescriptor, - setNamedPortsRegionInstanceGroupMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionInstanceGroupStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getRegionInstanceGroupMethodDescriptor, + listRegionInstanceGroupsMethodDescriptor, + listInstancesRegionInstanceGroupsMethodDescriptor, + setNamedPortsRegionInstanceGroupMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionInstanceGroupStubSettings.getDefaultEndpoint()); private static RegionInstanceGroupClient client; private static RegionInstanceGroupSettings clientSettings; @@ -65,13 +64,13 @@ public class RegionInstanceGroupClientTest { public static void setUp() throws IOException { clientSettings = RegionInstanceGroupSettings.newBuilder() - .setTransportChannelProvider( - RegionInstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionInstanceGroupClient.create(clientSettings); + .setTransportChannelProvider( + RegionInstanceGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionInstanceGroupClient.create(clientSettings); } @After @@ -89,55 +88,66 @@ public static void tearDown() throws Exception { public void getRegionInstanceGroupTest() { String kind = "kind3292052"; String description = "description-1724546052"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; Integer size = 3530753; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setKind(kind) - .setDescription(description) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setSize(size) - .setZone(zone.toString()) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InstanceGroup expectedResponse = + InstanceGroup.newBuilder() + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setSize(size) + .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + ProjectRegionInstanceGroupName instanceGroup = + ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); - InstanceGroup actualResponse = - client.getRegionInstanceGroup(instanceGroup); + InstanceGroup actualResponse = client.getRegionInstanceGroup(instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + ProjectRegionInstanceGroupName instanceGroup = + ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); client.getRegionInstanceGroup(instanceGroup); Assert.fail("No exception raised"); @@ -155,37 +165,46 @@ public void listRegionInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionInstanceGroupList expectedResponse = RegionInstanceGroupList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionInstanceGroupList expectedResponse = + RegionInstanceGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ListRegionInstanceGroupsPagedResponse pagedListResponse = client.listRegionInstanceGroups(region); + ListRegionInstanceGroupsPagedResponse pagedListResponse = + client.listRegionInstanceGroups(region); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -207,45 +226,60 @@ public void listInstancesRegionInstanceGroupsTest() { String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionInstanceGroupsListInstances expectedResponse = RegionInstanceGroupsListInstances.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionInstanceGroupsListInstances expectedResponse = + RegionInstanceGroupsListInstances.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); - RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build(); + ProjectRegionInstanceGroupName instanceGroup = + ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = + RegionInstanceGroupsListInstancesRequest.newBuilder().build(); - ListInstancesRegionInstanceGroupsPagedResponse pagedListResponse = client.listInstancesRegionInstanceGroups(instanceGroup, regionInstanceGroupsListInstancesRequestResource); + ListInstancesRegionInstanceGroupsPagedResponse pagedListResponse = + client.listInstancesRegionInstanceGroups( + instanceGroup, regionInstanceGroupsListInstancesRequestResource); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listInstancesRegionInstanceGroupsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); - RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build(); + ProjectRegionInstanceGroupName instanceGroup = + ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = + RegionInstanceGroupsListInstancesRequest.newBuilder().build(); - client.listInstancesRegionInstanceGroups(instanceGroup, regionInstanceGroupsListInstancesRequestResource); + client.listInstancesRegionInstanceGroups( + instanceGroup, regionInstanceGroupsListInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -276,64 +310,78 @@ public void setNamedPortsRegionInstanceGroupTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); - RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); + ProjectRegionInstanceGroupName instanceGroup = + ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = + RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); Operation actualResponse = - client.setNamedPortsRegionInstanceGroup(requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsRegionInstanceGroup( + requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setNamedPortsRegionInstanceGroupExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); - RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); + ProjectRegionInstanceGroupName instanceGroup = + ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); + RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = + RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); - client.setNamedPortsRegionInstanceGroup(requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsRegionInstanceGroup( + requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index eae2e6958105..42b7a3c9d025 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.abandonInstancesRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.deleteInstancesRegionInstanceGroupManagerMethodDescriptor; @@ -37,14 +27,23 @@ import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.resizeRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.setTargetPoolsRegionInstanceGroupManagerMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.RegionInstanceGroupManagerStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -54,22 +53,23 @@ @javax.annotation.Generated("by GAPIC") public class RegionInstanceGroupManagerClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - abandonInstancesRegionInstanceGroupManagerMethodDescriptor, - deleteRegionInstanceGroupManagerMethodDescriptor, - deleteInstancesRegionInstanceGroupManagerMethodDescriptor, - getRegionInstanceGroupManagerMethodDescriptor, - insertRegionInstanceGroupManagerMethodDescriptor, - listRegionInstanceGroupManagersMethodDescriptor, - listManagedInstancesRegionInstanceGroupManagersMethodDescriptor, - recreateInstancesRegionInstanceGroupManagerMethodDescriptor, - resizeRegionInstanceGroupManagerMethodDescriptor, - setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor, - setTargetPoolsRegionInstanceGroupManagerMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionInstanceGroupManagerStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + abandonInstancesRegionInstanceGroupManagerMethodDescriptor, + deleteRegionInstanceGroupManagerMethodDescriptor, + deleteInstancesRegionInstanceGroupManagerMethodDescriptor, + getRegionInstanceGroupManagerMethodDescriptor, + insertRegionInstanceGroupManagerMethodDescriptor, + listRegionInstanceGroupManagersMethodDescriptor, + listManagedInstancesRegionInstanceGroupManagersMethodDescriptor, + recreateInstancesRegionInstanceGroupManagerMethodDescriptor, + resizeRegionInstanceGroupManagerMethodDescriptor, + setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor, + setTargetPoolsRegionInstanceGroupManagerMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService( + METHOD_DESCRIPTORS, RegionInstanceGroupManagerStubSettings.getDefaultEndpoint()); private static RegionInstanceGroupManagerClient client; private static RegionInstanceGroupManagerSettings clientSettings; @@ -78,13 +78,13 @@ public class RegionInstanceGroupManagerClientTest { public static void setUp() throws IOException { clientSettings = RegionInstanceGroupManagerSettings.newBuilder() - .setTransportChannelProvider( - RegionInstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionInstanceGroupManagerClient.create(clientSettings); + .setTransportChannelProvider( + RegionInstanceGroupManagerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionInstanceGroupManagerClient.create(clientSettings); } @After @@ -121,60 +121,83 @@ public void abandonInstancesRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersAbandonInstancesRequest + regionInstanceGroupManagersAbandonInstancesRequestResource = + RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); Operation actualResponse = - client.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + client.abandonInstancesRegionInstanceGroupManager( + requestId, + instanceGroupManager, + regionInstanceGroupManagersAbandonInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); - - client.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersAbandonInstancesRequest + regionInstanceGroupManagersAbandonInstancesRequestResource = + RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); + + client.abandonInstancesRegionInstanceGroupManager( + requestId, + instanceGroupManager, + regionInstanceGroupManagersAbandonInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -205,33 +228,36 @@ public void deleteRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = client.deleteRegionInstanceGroupManager(requestId, instanceGroupManager); @@ -240,21 +266,31 @@ public void deleteRegionInstanceGroupManagerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); client.deleteRegionInstanceGroupManager(requestId, instanceGroupManager); Assert.fail("No exception raised"); @@ -287,60 +323,83 @@ public void deleteInstancesRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource = + RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); Operation actualResponse = - client.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + client.deleteInstancesRegionInstanceGroupManager( + requestId, + instanceGroupManager, + regionInstanceGroupManagersDeleteInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); - - client.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersDeleteInstancesRequest + regionInstanceGroupManagersDeleteInstancesRequestResource = + RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); + + client.deleteInstancesRegionInstanceGroupManager( + requestId, + instanceGroupManager, + regionInstanceGroupManagersDeleteInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -350,11 +409,13 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce @Test @SuppressWarnings("all") public void getRegionInstanceGroupManagerTest() { - ProjectInstanceTemplateName instanceTemplate = ProjectInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); String kind = "kind3292052"; String description = "description-1724546052"; String baseInstanceName = "baseInstanceName389106439"; - ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); String selfLink = "selfLink-1691268851"; Integer targetSize = 2084603409; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -363,24 +424,27 @@ public void getRegionInstanceGroupManagerTest() { String name = "name3373707"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() - .setInstanceTemplate(instanceTemplate.toString()) - .setKind(kind) - .setDescription(description) - .setBaseInstanceName(baseInstanceName) - .setInstanceGroup(instanceGroup.toString()) - .setSelfLink(selfLink) - .setTargetSize(targetSize) - .setZone(zone.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .build(); + InstanceGroupManager expectedResponse = + InstanceGroupManager.newBuilder() + .setInstanceTemplate(instanceTemplate.toString()) + .setKind(kind) + .setDescription(description) + .setBaseInstanceName(baseInstanceName) + .setInstanceGroup(instanceGroup.toString()) + .setSelfLink(selfLink) + .setTargetSize(targetSize) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManager actualResponse = client.getRegionInstanceGroupManager(instanceGroupManager); @@ -389,20 +453,30 @@ public void getRegionInstanceGroupManagerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); client.getRegionInstanceGroupManager(instanceGroupManager); Assert.fail("No exception raised"); @@ -435,29 +509,30 @@ public void insertRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -471,16 +546,24 @@ public void insertRegionInstanceGroupManagerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -504,37 +587,46 @@ public void listRegionInstanceGroupManagersTest() { String selfLink = "selfLink-1691268851"; InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); List items = Arrays.asList(itemsElement); - RegionInstanceGroupManagerList expectedResponse = RegionInstanceGroupManagerList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RegionInstanceGroupManagerList expectedResponse = + RegionInstanceGroupManagerList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ListRegionInstanceGroupManagersPagedResponse pagedListResponse = client.listRegionInstanceGroupManagers(region); + ListRegionInstanceGroupManagersPagedResponse pagedListResponse = + client.listRegionInstanceGroupManagers(region); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionInstanceGroupManagersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -550,10 +642,13 @@ public void listRegionInstanceGroupManagersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listManagedInstancesRegionInstanceGroupManagersTest() { - RegionInstanceGroupManagersListInstancesResponse expectedResponse = RegionInstanceGroupManagersListInstancesResponse.newBuilder().build(); + RegionInstanceGroupManagersListInstancesResponse expectedResponse = + RegionInstanceGroupManagersListInstancesResponse.newBuilder().build(); mockService.addResponse(expectedResponse); - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); RegionInstanceGroupManagersListInstancesResponse actualResponse = client.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager); @@ -562,20 +657,30 @@ public void listManagedInstancesRegionInstanceGroupManagersTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listManagedInstancesRegionInstanceGroupManagersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); client.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager); Assert.fail("No exception raised"); @@ -608,60 +713,78 @@ public void recreateInstancesRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = + RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); Operation actualResponse = - client.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + client.recreateInstancesRegionInstanceGroupManager( + requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); - - client.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersRecreateRequest + regionInstanceGroupManagersRecreateRequestResource = + RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); + + client.recreateInstancesRegionInstanceGroupManager( + requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -692,34 +815,37 @@ public void resizeRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); Integer size = 3530753; String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); Operation actualResponse = client.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager); @@ -728,22 +854,32 @@ public void resizeRegionInstanceGroupManagerTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void resizeRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { Integer size = 3530753; String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); client.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager); Assert.fail("No exception raised"); @@ -776,60 +912,79 @@ public void setInstanceTemplateRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource = + RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); Operation actualResponse = - client.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + client.setInstanceTemplateRegionInstanceGroupManager( + requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); - - client.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTemplateRequest + regionInstanceGroupManagersSetTemplateRequestResource = + RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); + + client.setInstanceTemplateRegionInstanceGroupManager( + requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -860,64 +1015,86 @@ public void setTargetPoolsRegionInstanceGroupManagerTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource = + RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); Operation actualResponse = - client.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + client.setTargetPoolsRegionInstanceGroupManager( + requestId, + instanceGroupManager, + regionInstanceGroupManagersSetTargetPoolsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setTargetPoolsRegionInstanceGroupManagerExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); - - client.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + RegionInstanceGroupManagersSetTargetPoolsRequest + regionInstanceGroupManagersSetTargetPoolsRequestResource = + RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); + + client.setTargetPoolsRegionInstanceGroupManager( + requestId, + instanceGroupManager, + regionInstanceGroupManagersSetTargetPoolsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java index d4081cce35ba..bc4b8f497e72 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java @@ -15,6 +15,11 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.deleteRegionOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.getRegionOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.listRegionOperationsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,18 +30,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RegionOperationClient.ListRegionOperationsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.deleteRegionOperationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.getRegionOperationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRegionOperationStub.listRegionOperationsMethodDescriptor; import com.google.cloud.compute.v1.stub.RegionOperationStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -46,14 +45,14 @@ @javax.annotation.Generated("by GAPIC") public class RegionOperationClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteRegionOperationMethodDescriptor, - getRegionOperationMethodDescriptor, - listRegionOperationsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RegionOperationStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteRegionOperationMethodDescriptor, + getRegionOperationMethodDescriptor, + listRegionOperationsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionOperationStubSettings.getDefaultEndpoint()); private static RegionOperationClient client; private static RegionOperationSettings clientSettings; @@ -62,13 +61,13 @@ public class RegionOperationClientTest { public static void setUp() throws IOException { clientSettings = RegionOperationSettings.newBuilder() - .setTransportChannelProvider( - RegionOperationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RegionOperationClient.create(clientSettings); + .setTransportChannelProvider( + RegionOperationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionOperationClient.create(clientSettings); } @After @@ -86,27 +85,37 @@ public static void tearDown() throws Exception { public void deleteRegionOperationTest() { mockService.addNullResponse(); - ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + ProjectRegionOperationName operation = + ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); client.deleteRegionOperation(operation); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRegionOperationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + ProjectRegionOperationName operation = + ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); client.deleteRegionOperation(operation); Assert.fail("No exception raised"); @@ -139,54 +148,64 @@ public void getRegionOperationTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + ProjectRegionOperationName operation = + ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); - Operation actualResponse = - client.getRegionOperation(operation); + Operation actualResponse = client.getRegionOperation(operation); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRegionOperationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionOperationName operation = ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); + ProjectRegionOperationName operation = + ProjectRegionOperationName.of("[PROJECT]", "[REGION]", "[OPERATION]"); client.getRegionOperation(operation); Assert.fail("No exception raised"); @@ -204,13 +223,14 @@ public void listRegionOperationsTest() { String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); - OperationList expectedResponse = OperationList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + OperationList expectedResponse = + OperationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -219,22 +239,29 @@ public void listRegionOperationsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRegionOperationsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -246,5 +273,4 @@ public void listRegionOperationsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java index ac7634c65948..4b777ece8835 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.deleteRouteMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.getRouteMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.insertRouteMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.listRoutesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,19 +31,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.RouteClient.ListRoutesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.deleteRouteMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.getRouteMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.insertRouteMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonRouteStub.listRoutesMethodDescriptor; import com.google.cloud.compute.v1.stub.RouteStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,15 +46,15 @@ @javax.annotation.Generated("by GAPIC") public class RouteClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteRouteMethodDescriptor, - getRouteMethodDescriptor, - insertRouteMethodDescriptor, - listRoutesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RouteStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteRouteMethodDescriptor, + getRouteMethodDescriptor, + insertRouteMethodDescriptor, + listRoutesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RouteStubSettings.getDefaultEndpoint()); private static RouteClient client; private static RouteSettings clientSettings; @@ -64,13 +63,13 @@ public class RouteClientTest { public static void setUp() throws IOException { clientSettings = RouteSettings.newBuilder() - .setTransportChannelProvider( - RouteSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RouteClient.create(clientSettings); + .setTransportChannelProvider( + RouteSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RouteClient.create(clientSettings); } @After @@ -107,55 +106,63 @@ public void deleteRouteTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]"); + ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteRoute(route, requestId); + Operation actualResponse = client.deleteRoute(route, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRouteExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]"); + ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); String requestId = "requestId37109963"; client.deleteRoute(route, requestId); @@ -174,7 +181,7 @@ public void getRouteTest() { String description = "description-1724546052"; Integer priority = 1165461084; String nextHopNetwork = "nextHopNetwork1872908524"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String nextHopInstance = "nextHopInstance1467250071"; String creationTimestamp = "creationTimestamp567396278"; @@ -183,48 +190,56 @@ public void getRouteTest() { String nextHopVpnTunnel = "nextHopVpnTunnel-1627639147"; String nextHopIp = "nextHopIp1184061353"; String id = "id3355"; - Route expectedResponse = Route.newBuilder() - .setNextHopGateway(nextHopGateway) - .setKind(kind) - .setNextHopPeering(nextHopPeering) - .setDescription(description) - .setPriority(priority) - .setNextHopNetwork(nextHopNetwork) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setNextHopInstance(nextHopInstance) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDestRange(destRange) - .setNextHopVpnTunnel(nextHopVpnTunnel) - .setNextHopIp(nextHopIp) - .setId(id) - .build(); + Route expectedResponse = + Route.newBuilder() + .setNextHopGateway(nextHopGateway) + .setKind(kind) + .setNextHopPeering(nextHopPeering) + .setDescription(description) + .setPriority(priority) + .setNextHopNetwork(nextHopNetwork) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setNextHopInstance(nextHopInstance) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDestRange(destRange) + .setNextHopVpnTunnel(nextHopVpnTunnel) + .setNextHopIp(nextHopIp) + .setId(id) + .build(); mockService.addResponse(expectedResponse); - ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]"); + ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); - Route actualResponse = - client.getRoute(route); + Route actualResponse = client.getRoute(route); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRouteExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRouteName route = ProjectRouteName.of("[PROJECT]", "[ROUTE]"); + ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); client.getRoute(route); Assert.fail("No exception raised"); @@ -257,52 +272,60 @@ public void insertRouteTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Route routeResource = Route.newBuilder().build(); - Operation actualResponse = - client.insertRoute(requestId, project, routeResource); + Operation actualResponse = client.insertRoute(requestId, project, routeResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRouteExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -326,13 +349,14 @@ public void listRoutesTest() { String selfLink = "selfLink-1691268851"; Route itemsElement = Route.newBuilder().build(); List items = Arrays.asList(itemsElement); - RouteList expectedResponse = RouteList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RouteList expectedResponse = + RouteList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -341,22 +365,29 @@ public void listRoutesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRoutesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -368,5 +399,4 @@ public void listRoutesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 1f795b5f6e40..38308a2d5f96 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.aggregatedListRoutersMethodDescriptor; @@ -36,6 +26,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.patchRouterMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.previewRouterMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.updateRouterMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.RouterStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -53,20 +54,20 @@ @javax.annotation.Generated("by GAPIC") public class RouterClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListRoutersMethodDescriptor, - deleteRouterMethodDescriptor, - getRouterMethodDescriptor, - getRouterStatusRouterMethodDescriptor, - insertRouterMethodDescriptor, - listRoutersMethodDescriptor, - patchRouterMethodDescriptor, - previewRouterMethodDescriptor, - updateRouterMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, RouterStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListRoutersMethodDescriptor, + deleteRouterMethodDescriptor, + getRouterMethodDescriptor, + getRouterStatusRouterMethodDescriptor, + insertRouterMethodDescriptor, + listRoutersMethodDescriptor, + patchRouterMethodDescriptor, + previewRouterMethodDescriptor, + updateRouterMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RouterStubSettings.getDefaultEndpoint()); private static RouterClient client; private static RouterSettings clientSettings; @@ -75,13 +76,13 @@ public class RouterClientTest { public static void setUp() throws IOException { clientSettings = RouterSettings.newBuilder() - .setTransportChannelProvider( - RouterSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - RouterClient.create(clientSettings); + .setTransportChannelProvider( + RouterSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RouterClient.create(clientSettings); } @After @@ -104,13 +105,14 @@ public void aggregatedListRoutersTest() { RoutersScopedList itemsItem = RoutersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - RouterAggregatedList expectedResponse = RouterAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + RouterAggregatedList expectedResponse = + RouterAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -119,22 +121,30 @@ public void aggregatedListRoutersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListRoutersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -171,55 +181,65 @@ public void deleteRouterTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteRouter(router, requestId); + Operation actualResponse = client.deleteRouter(router, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String requestId = "requestId37109963"; client.deleteRouter(router, requestId); @@ -238,43 +258,53 @@ public void getRouterTest() { String description = "description-1724546052"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; - Router expectedResponse = Router.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .build(); + Router expectedResponse = + Router.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - Router actualResponse = - client.getRouter(router); + Router actualResponse = client.getRouter(router); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); client.getRouter(router); Assert.fail("No exception raised"); @@ -287,34 +317,41 @@ public void getRouterExceptionTest() throws Exception { @SuppressWarnings("all") public void getRouterStatusRouterTest() { String kind = "kind3292052"; - RouterStatusResponse expectedResponse = RouterStatusResponse.newBuilder() - .setKind(kind) - .build(); + RouterStatusResponse expectedResponse = RouterStatusResponse.newBuilder().setKind(kind).build(); mockService.addResponse(expectedResponse); - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - RouterStatusResponse actualResponse = - client.getRouterStatusRouter(router); + RouterStatusResponse actualResponse = client.getRouterStatusRouter(router); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getRouterStatusRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); client.getRouterStatusRouter(router); Assert.fail("No exception raised"); @@ -347,52 +384,60 @@ public void insertRouterTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Router routerResource = Router.newBuilder().build(); - Operation actualResponse = - client.insertRouter(requestId, region, routerResource); + Operation actualResponse = client.insertRouter(requestId, region, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -416,13 +461,14 @@ public void listRoutersTest() { String selfLink = "selfLink-1691268851"; Router itemsElement = Router.newBuilder().build(); List items = Arrays.asList(itemsElement); - RouterList expectedResponse = RouterList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + RouterList expectedResponse = + RouterList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -431,22 +477,29 @@ public void listRoutersTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listRoutersExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -483,56 +536,66 @@ public void patchRouterTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - Operation actualResponse = - client.patchRouter(router, requestId, routerResource); + Operation actualResponse = client.patchRouter(router, requestId, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); @@ -549,30 +612,39 @@ public void previewRouterTest() { RoutersPreviewResponse expectedResponse = RoutersPreviewResponse.newBuilder().build(); mockService.addResponse(expectedResponse); - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); Router routerResource = Router.newBuilder().build(); - RoutersPreviewResponse actualResponse = - client.previewRouter(router, routerResource); + RoutersPreviewResponse actualResponse = client.previewRouter(router, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void previewRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); Router routerResource = Router.newBuilder().build(); client.previewRouter(router, routerResource); @@ -606,56 +678,66 @@ public void updateRouterTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - Operation actualResponse = - client.updateRouter(router, requestId, routerResource); + Operation actualResponse = client.updateRouter(router, requestId, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateRouterExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); @@ -665,5 +747,4 @@ public void updateRouterExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index 9b9b31a87180..3130b8a9bfdc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.deleteSnapshotMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.getSnapshotMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.listSnapshotsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.setLabelsSnapshotMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,19 +31,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.deleteSnapshotMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.getSnapshotMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.listSnapshotsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.setLabelsSnapshotMethodDescriptor; import com.google.cloud.compute.v1.stub.SnapshotStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,15 +46,15 @@ @javax.annotation.Generated("by GAPIC") public class SnapshotClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteSnapshotMethodDescriptor, - getSnapshotMethodDescriptor, - listSnapshotsMethodDescriptor, - setLabelsSnapshotMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, SnapshotStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteSnapshotMethodDescriptor, + getSnapshotMethodDescriptor, + listSnapshotsMethodDescriptor, + setLabelsSnapshotMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, SnapshotStubSettings.getDefaultEndpoint()); private static SnapshotClient client; private static SnapshotSettings clientSettings; @@ -64,13 +63,13 @@ public class SnapshotClientTest { public static void setUp() throws IOException { clientSettings = SnapshotSettings.newBuilder() - .setTransportChannelProvider( - SnapshotSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - SnapshotClient.create(clientSettings); + .setTransportChannelProvider( + SnapshotSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SnapshotClient.create(clientSettings); } @After @@ -107,56 +106,64 @@ public void deleteSnapshotTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - Operation actualResponse = - client.deleteSnapshot(requestId, snapshot); + Operation actualResponse = client.deleteSnapshot(requestId, snapshot); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteSnapshotExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); client.deleteSnapshot(requestId, snapshot); Assert.fail("No exception raised"); @@ -181,46 +188,54 @@ public void getSnapshotTest() { String id = "id3355"; String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; - Snapshot expectedResponse = Snapshot.newBuilder() - .setSourceDisk(sourceDisk) - .setSourceDiskId(sourceDiskId) - .setKind(kind) - .setDescription(description) - .setLabelFingerprint(labelFingerprint) - .setSelfLink(selfLink) - .setStorageBytesStatus(storageBytesStatus) - .setStorageBytes(storageBytes) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setDiskSizeGb(diskSizeGb) - .setStatus(status) - .build(); + Snapshot expectedResponse = + Snapshot.newBuilder() + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) + .setKind(kind) + .setDescription(description) + .setLabelFingerprint(labelFingerprint) + .setSelfLink(selfLink) + .setStorageBytesStatus(storageBytesStatus) + .setStorageBytes(storageBytes) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - Snapshot actualResponse = - client.getSnapshot(snapshot); + Snapshot actualResponse = client.getSnapshot(snapshot); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getSnapshotExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); client.getSnapshot(snapshot); Assert.fail("No exception raised"); @@ -238,13 +253,14 @@ public void listSnapshotsTest() { String selfLink = "selfLink-1691268851"; Snapshot itemsElement = Snapshot.newBuilder().build(); List items = Arrays.asList(itemsElement); - SnapshotList expectedResponse = SnapshotList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + SnapshotList expectedResponse = + SnapshotList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -253,22 +269,29 @@ public void listSnapshotsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listSnapshotsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -305,56 +328,68 @@ public void setLabelsSnapshotTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = + GlobalSetLabelsRequest.newBuilder().build(); - Operation actualResponse = - client.setLabelsSnapshot(resource, globalSetLabelsRequestResource); + Operation actualResponse = client.setLabelsSnapshot(resource, globalSetLabelsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setLabelsSnapshotExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectSnapshotName resource = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build(); + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetLabelsRequest globalSetLabelsRequestResource = + GlobalSetLabelsRequest.newBuilder().build(); client.setLabelsSnapshot(resource, globalSetLabelsRequestResource); Assert.fail("No exception raised"); @@ -362,5 +397,4 @@ public void setLabelsSnapshotExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java index 444754680e86..ae37831e11ac 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -15,6 +15,12 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.deleteSslCertificateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.getSslCertificateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.insertSslCertificateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.listSslCertificatesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,19 +31,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.SslCertificateClient.ListSslCertificatesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.deleteSslCertificateMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.getSslCertificateMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.insertSslCertificateMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonSslCertificateStub.listSslCertificatesMethodDescriptor; import com.google.cloud.compute.v1.stub.SslCertificateStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,15 +46,15 @@ @javax.annotation.Generated("by GAPIC") public class SslCertificateClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteSslCertificateMethodDescriptor, - getSslCertificateMethodDescriptor, - insertSslCertificateMethodDescriptor, - listSslCertificatesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, SslCertificateStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteSslCertificateMethodDescriptor, + getSslCertificateMethodDescriptor, + insertSslCertificateMethodDescriptor, + listSslCertificatesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, SslCertificateStubSettings.getDefaultEndpoint()); private static SslCertificateClient client; private static SslCertificateSettings clientSettings; @@ -64,13 +63,13 @@ public class SslCertificateClientTest { public static void setUp() throws IOException { clientSettings = SslCertificateSettings.newBuilder() - .setTransportChannelProvider( - SslCertificateSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - SslCertificateClient.create(clientSettings); + .setTransportChannelProvider( + SslCertificateSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SslCertificateClient.create(clientSettings); } @After @@ -107,55 +106,65 @@ public void deleteSslCertificateTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + ProjectGlobalSslCertificateName sslCertificate = + ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteSslCertificate(sslCertificate, requestId); + Operation actualResponse = client.deleteSslCertificate(sslCertificate, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteSslCertificateExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + ProjectGlobalSslCertificateName sslCertificate = + ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); String requestId = "requestId37109963"; client.deleteSslCertificate(sslCertificate, requestId); @@ -176,41 +185,51 @@ public void getSslCertificateTest() { String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - SslCertificate expectedResponse = SslCertificate.newBuilder() - .setPrivateKey(privateKey) - .setKind(kind) - .setCertificate(certificate) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + SslCertificate expectedResponse = + SslCertificate.newBuilder() + .setPrivateKey(privateKey) + .setKind(kind) + .setCertificate(certificate) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + ProjectGlobalSslCertificateName sslCertificate = + ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); - SslCertificate actualResponse = - client.getSslCertificate(sslCertificate); + SslCertificate actualResponse = client.getSslCertificate(sslCertificate); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getSslCertificateExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectSslCertificateName sslCertificate = ProjectSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); + ProjectGlobalSslCertificateName sslCertificate = + ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); client.getSslCertificate(sslCertificate); Assert.fail("No exception raised"); @@ -243,29 +262,30 @@ public void insertSslCertificateTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -279,16 +299,24 @@ public void insertSslCertificateTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertSslCertificateExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -312,13 +340,14 @@ public void listSslCertificatesTest() { String selfLink = "selfLink-1691268851"; SslCertificate itemsElement = SslCertificate.newBuilder().build(); List items = Arrays.asList(itemsElement); - SslCertificateList expectedResponse = SslCertificateList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + SslCertificateList expectedResponse = + SslCertificateList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -327,22 +356,29 @@ public void listSslCertificatesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listSslCertificatesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -354,5 +390,4 @@ public void listSslCertificatesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java new file mode 100644 index 000000000000..6735368b23c3 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java @@ -0,0 +1,538 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.SslPolicyClient.ListSslPoliciesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonSslPolicyStub.deleteSslPolicyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslPolicyStub.getSslPolicyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslPolicyStub.insertSslPolicyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslPolicyStub.listAvailableFeaturesSslPoliciesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslPolicyStub.listSslPoliciesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSslPolicyStub.patchSslPolicyMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.SslPolicyStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SslPolicyClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteSslPolicyMethodDescriptor, + getSslPolicyMethodDescriptor, + insertSslPolicyMethodDescriptor, + listSslPoliciesMethodDescriptor, + listAvailableFeaturesSslPoliciesMethodDescriptor, + patchSslPolicyMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, SslPolicyStubSettings.getDefaultEndpoint()); + + private static SslPolicyClient client; + private static SslPolicySettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + SslPolicySettings.newBuilder() + .setTransportChannelProvider( + SslPolicySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SslPolicyClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteSslPolicyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + + Operation actualResponse = client.deleteSslPolicy(requestId, sslPolicy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteSslPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + + client.deleteSslPolicy(requestId, sslPolicy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSslPolicyTest() { + String kind = "kind3292052"; + String minTlsVersion = "minTlsVersion8155943"; + String profile = "profile-309425751"; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + SslPolicy expectedResponse = + SslPolicy.newBuilder() + .setKind(kind) + .setMinTlsVersion(minTlsVersion) + .setProfile(profile) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + + SslPolicy actualResponse = client.getSslPolicy(sslPolicy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getSslPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + + client.getSslPolicy(sslPolicy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertSslPolicyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); + + Operation actualResponse = client.insertSslPolicy(requestId, project, sslPolicyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void insertSslPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectName project = ProjectName.of("[PROJECT]"); + SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); + + client.insertSslPolicy(requestId, project, sslPolicyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSslPoliciesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + SslPolicy itemsElement = SslPolicy.newBuilder().build(); + List items = Arrays.asList(itemsElement); + SslPoliciesList expectedResponse = + SslPoliciesList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListSslPoliciesPagedResponse pagedListResponse = client.listSslPolicies(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listSslPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listSslPolicies(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listAvailableFeaturesSslPoliciesTest() { + SslPoliciesListAvailableFeaturesResponse expectedResponse = + SslPoliciesListAvailableFeaturesResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + SslPoliciesListAvailableFeaturesResponse actualResponse = + client.listAvailableFeaturesSslPolicies(project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listAvailableFeaturesSslPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listAvailableFeaturesSslPolicies(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void patchSslPolicyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); + + Operation actualResponse = client.patchSslPolicy(requestId, sslPolicy, sslPolicyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void patchSslPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); + + client.patchSslPolicy(requestId, sslPolicy, sslPolicyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 655216d0dcc9..0c3bb48581df 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.aggregatedListSubnetworksMethodDescriptor; @@ -35,6 +25,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.listSubnetworksMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.patchSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.setPrivateIpGoogleAccessSubnetworkMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.SubnetworkStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -52,19 +53,19 @@ @javax.annotation.Generated("by GAPIC") public class SubnetworkClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListSubnetworksMethodDescriptor, - deleteSubnetworkMethodDescriptor, - expandIpCidrRangeSubnetworkMethodDescriptor, - getSubnetworkMethodDescriptor, - insertSubnetworkMethodDescriptor, - listSubnetworksMethodDescriptor, - patchSubnetworkMethodDescriptor, - setPrivateIpGoogleAccessSubnetworkMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, SubnetworkStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListSubnetworksMethodDescriptor, + deleteSubnetworkMethodDescriptor, + expandIpCidrRangeSubnetworkMethodDescriptor, + getSubnetworkMethodDescriptor, + insertSubnetworkMethodDescriptor, + listSubnetworksMethodDescriptor, + patchSubnetworkMethodDescriptor, + setPrivateIpGoogleAccessSubnetworkMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, SubnetworkStubSettings.getDefaultEndpoint()); private static SubnetworkClient client; private static SubnetworkSettings clientSettings; @@ -73,13 +74,13 @@ public class SubnetworkClientTest { public static void setUp() throws IOException { clientSettings = SubnetworkSettings.newBuilder() - .setTransportChannelProvider( - SubnetworkSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - SubnetworkClient.create(clientSettings); + .setTransportChannelProvider( + SubnetworkSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SubnetworkClient.create(clientSettings); } @After @@ -102,37 +103,47 @@ public void aggregatedListSubnetworksTest() { SubnetworksScopedList itemsItem = SubnetworksScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - SubnetworkAggregatedList expectedResponse = SubnetworkAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + SubnetworkAggregatedList expectedResponse = + SubnetworkAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListSubnetworksPagedResponse pagedListResponse = client.aggregatedListSubnetworks(project); + AggregatedListSubnetworksPagedResponse pagedListResponse = + client.aggregatedListSubnetworks(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListSubnetworksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -169,56 +180,66 @@ public void deleteSubnetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - Operation actualResponse = - client.deleteSubnetwork(requestId, subnetwork); + Operation actualResponse = client.deleteSubnetwork(requestId, subnetwork); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteSubnetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); client.deleteSubnetwork(requestId, subnetwork); Assert.fail("No exception raised"); @@ -251,60 +272,75 @@ public void expandIpCidrRangeSubnetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = + SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); Operation actualResponse = - client.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + client.expandIpCidrRangeSubnetwork( + requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = + SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); - client.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + client.expandIpCidrRangeSubnetwork( + requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -317,7 +353,7 @@ public void getSubnetworkTest() { Boolean privateIpGoogleAccess = true; String kind = "kind3292052"; String description = "description-1724546052"; - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; @@ -326,45 +362,55 @@ public void getSubnetworkTest() { String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String ipCidrRange = "ipCidrRange-2049366326"; - Subnetwork expectedResponse = Subnetwork.newBuilder() - .setPrivateIpGoogleAccess(privateIpGoogleAccess) - .setKind(kind) - .setDescription(description) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setGatewayAddress(gatewayAddress) - .setId(id) - .setRegion(region.toString()) - .setIpCidrRange(ipCidrRange) - .build(); + Subnetwork expectedResponse = + Subnetwork.newBuilder() + .setPrivateIpGoogleAccess(privateIpGoogleAccess) + .setKind(kind) + .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setGatewayAddress(gatewayAddress) + .setId(id) + .setRegion(region.toString()) + .setIpCidrRange(ipCidrRange) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - Subnetwork actualResponse = - client.getSubnetwork(subnetwork); + Subnetwork actualResponse = client.getSubnetwork(subnetwork); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getSubnetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); client.getSubnetwork(subnetwork); Assert.fail("No exception raised"); @@ -397,52 +443,60 @@ public void insertSubnetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - Operation actualResponse = - client.insertSubnetwork(requestId, region, subnetworkResource); + Operation actualResponse = client.insertSubnetwork(requestId, region, subnetworkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertSubnetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -466,13 +520,14 @@ public void listSubnetworksTest() { String selfLink = "selfLink-1691268851"; Subnetwork itemsElement = Subnetwork.newBuilder().build(); List items = Arrays.asList(itemsElement); - SubnetworkList expectedResponse = SubnetworkList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + SubnetworkList expectedResponse = + SubnetworkList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -481,22 +536,29 @@ public void listSubnetworksTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listSubnetworksExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -533,57 +595,67 @@ public void patchSubnetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - Operation actualResponse = - client.patchSubnetwork(requestId, subnetwork, subnetworkResource); + Operation actualResponse = client.patchSubnetwork(requestId, subnetwork, subnetworkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchSubnetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); client.patchSubnetwork(requestId, subnetwork, subnetworkResource); @@ -617,64 +689,79 @@ public void setPrivateIpGoogleAccessSubnetworkTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = + SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); Operation actualResponse = - client.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + client.setPrivateIpGoogleAccessSubnetwork( + requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setPrivateIpGoogleAccessSubnetworkExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); - - client.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + SubnetworksSetPrivateIpGoogleAccessRequest + subnetworksSetPrivateIpGoogleAccessRequestResource = + SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); + + client.setPrivateIpGoogleAccessSubnetwork( + requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java index a0885637aa53..73a118e5bf9d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -15,6 +15,13 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.deleteTargetHttpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.getTargetHttpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.insertTargetHttpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.listTargetHttpProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.setUrlMapTargetHttpProxyMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,20 +32,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetHttpProxyClient.ListTargetHttpProxiesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.deleteTargetHttpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.getTargetHttpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.insertTargetHttpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.listTargetHttpProxiesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpProxyStub.setUrlMapTargetHttpProxyMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetHttpProxyStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -48,16 +47,16 @@ @javax.annotation.Generated("by GAPIC") public class TargetHttpProxyClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteTargetHttpProxyMethodDescriptor, - getTargetHttpProxyMethodDescriptor, - insertTargetHttpProxyMethodDescriptor, - listTargetHttpProxiesMethodDescriptor, - setUrlMapTargetHttpProxyMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetHttpProxyStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetHttpProxyMethodDescriptor, + getTargetHttpProxyMethodDescriptor, + insertTargetHttpProxyMethodDescriptor, + listTargetHttpProxiesMethodDescriptor, + setUrlMapTargetHttpProxyMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetHttpProxyStubSettings.getDefaultEndpoint()); private static TargetHttpProxyClient client; private static TargetHttpProxySettings clientSettings; @@ -66,13 +65,13 @@ public class TargetHttpProxyClientTest { public static void setUp() throws IOException { clientSettings = TargetHttpProxySettings.newBuilder() - .setTransportChannelProvider( - TargetHttpProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetHttpProxyClient.create(clientSettings); + .setTransportChannelProvider( + TargetHttpProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetHttpProxyClient.create(clientSettings); } @After @@ -109,56 +108,66 @@ public void deleteTargetHttpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + ProjectGlobalTargetHttpProxyName targetHttpProxy = + ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); - Operation actualResponse = - client.deleteTargetHttpProxy(requestId, targetHttpProxy); + Operation actualResponse = client.deleteTargetHttpProxy(requestId, targetHttpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetHttpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + ProjectGlobalTargetHttpProxyName targetHttpProxy = + ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); client.deleteTargetHttpProxy(requestId, targetHttpProxy); Assert.fail("No exception raised"); @@ -170,47 +179,57 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetHttpProxyTest() { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - TargetHttpProxy expectedResponse = TargetHttpProxy.newBuilder() - .setUrlMap(urlMap.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + TargetHttpProxy expectedResponse = + TargetHttpProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + ProjectGlobalTargetHttpProxyName targetHttpProxy = + ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); - TargetHttpProxy actualResponse = - client.getTargetHttpProxy(targetHttpProxy); + TargetHttpProxy actualResponse = client.getTargetHttpProxy(targetHttpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetHttpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + ProjectGlobalTargetHttpProxyName targetHttpProxy = + ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); client.getTargetHttpProxy(targetHttpProxy); Assert.fail("No exception raised"); @@ -243,29 +262,30 @@ public void insertTargetHttpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -279,16 +299,24 @@ public void insertTargetHttpProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetHttpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -312,13 +340,14 @@ public void listTargetHttpProxiesTest() { String selfLink = "selfLink-1691268851"; TargetHttpProxy itemsElement = TargetHttpProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetHttpProxyList expectedResponse = TargetHttpProxyList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetHttpProxyList expectedResponse = + TargetHttpProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -327,22 +356,29 @@ public void listTargetHttpProxiesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetHttpProxiesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -379,33 +415,35 @@ public void setUrlMapTargetHttpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + ProjectTargetHttpProxyName targetHttpProxy = + ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); Operation actualResponse = @@ -415,21 +453,30 @@ public void setUrlMapTargetHttpProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setUrlMapTargetHttpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); + ProjectTargetHttpProxyName targetHttpProxy = + ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); client.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource); @@ -438,5 +485,4 @@ public void setUrlMapTargetHttpProxyExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 0cb05694e412..1068db766bd1 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -15,6 +15,15 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslPolicyTargetHttpsProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +34,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetHttpsProxyClient.ListTargetHttpsProxiesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.deleteTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetHttpsProxyStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +49,18 @@ @javax.annotation.Generated("by GAPIC") public class TargetHttpsProxyClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteTargetHttpsProxyMethodDescriptor, - getTargetHttpsProxyMethodDescriptor, - insertTargetHttpsProxyMethodDescriptor, - listTargetHttpsProxiesMethodDescriptor, - setSslCertificatesTargetHttpsProxyMethodDescriptor, - setUrlMapTargetHttpsProxyMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetHttpsProxyMethodDescriptor, + getTargetHttpsProxyMethodDescriptor, + insertTargetHttpsProxyMethodDescriptor, + listTargetHttpsProxiesMethodDescriptor, + setSslCertificatesTargetHttpsProxyMethodDescriptor, + setSslPolicyTargetHttpsProxyMethodDescriptor, + setUrlMapTargetHttpsProxyMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetHttpsProxyStubSettings.getDefaultEndpoint()); private static TargetHttpsProxyClient client; private static TargetHttpsProxySettings clientSettings; @@ -68,13 +69,13 @@ public class TargetHttpsProxyClientTest { public static void setUp() throws IOException { clientSettings = TargetHttpsProxySettings.newBuilder() - .setTransportChannelProvider( - TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetHttpsProxyClient.create(clientSettings); + .setTransportChannelProvider( + TargetHttpsProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetHttpsProxyClient.create(clientSettings); } @After @@ -111,55 +112,65 @@ public void deleteTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); + Operation actualResponse = client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); String requestId = "requestId37109963"; client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); @@ -172,47 +183,60 @@ public void deleteTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetHttpsProxyTest() { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String kind = "kind3292052"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; String selfLink = "selfLink-1691268851"; - TargetHttpsProxy expectedResponse = TargetHttpsProxy.newBuilder() - .setUrlMap(urlMap.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setSelfLink(selfLink) - .build(); + TargetHttpsProxy expectedResponse = + TargetHttpsProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setSslPolicy(sslPolicy.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - TargetHttpsProxy actualResponse = - client.getTargetHttpsProxy(targetHttpsProxy); + TargetHttpsProxy actualResponse = client.getTargetHttpsProxy(targetHttpsProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); client.getTargetHttpsProxy(targetHttpsProxy); Assert.fail("No exception raised"); @@ -245,29 +269,30 @@ public void insertTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -281,16 +306,24 @@ public void insertTargetHttpsProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -314,13 +347,14 @@ public void listTargetHttpsProxiesTest() { String selfLink = "selfLink-1691268851"; TargetHttpsProxy itemsElement = TargetHttpsProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetHttpsProxyList expectedResponse = TargetHttpsProxyList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetHttpsProxyList expectedResponse = + TargetHttpsProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -329,22 +363,29 @@ public void listTargetHttpsProxiesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetHttpsProxiesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -381,60 +422,173 @@ public void setSslCertificatesTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectTargetHttpsProxyName targetHttpsProxy = + ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); String requestId = "requestId37109963"; - TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource = + TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = - client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetHttpsProxy( + targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectTargetHttpsProxyName targetHttpsProxy = + ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); String requestId = "requestId37109963"; - TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); + TargetHttpsProxiesSetSslCertificatesRequest + targetHttpsProxiesSetSslCertificatesRequestResource = + TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); - client.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetHttpsProxy( + targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setSslPolicyTargetHttpsProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; + SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); + + Operation actualResponse = + client.setSslPolicyTargetHttpsProxy( + targetHttpsProxy, requestId, sslPolicyReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void setSslPolicyTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + String requestId = "requestId37109963"; + SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); + + client.setSslPolicyTargetHttpsProxy(targetHttpsProxy, requestId, sslPolicyReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -465,32 +619,34 @@ public void setUrlMapTargetHttpsProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectTargetHttpsProxyName targetHttpsProxy = + ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); String requestId = "requestId37109963"; UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); @@ -501,20 +657,29 @@ public void setUrlMapTargetHttpsProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + ProjectTargetHttpsProxyName targetHttpsProxy = + ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); String requestId = "requestId37109963"; UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); @@ -524,5 +689,4 @@ public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java index 3c87d662b70d..62d4ca7ef7ab 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.aggregatedListTargetInstancesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.deleteTargetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.getTargetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.insertTargetInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.listTargetInstancesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,13 +33,6 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetInstanceClient.AggregatedListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.TargetInstanceClient.ListTargetInstancesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.aggregatedListTargetInstancesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.deleteTargetInstanceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.getTargetInstanceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.insertTargetInstanceMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetInstanceStub.listTargetInstancesMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetInstanceStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -49,16 +50,16 @@ @javax.annotation.Generated("by GAPIC") public class TargetInstanceClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListTargetInstancesMethodDescriptor, - deleteTargetInstanceMethodDescriptor, - getTargetInstanceMethodDescriptor, - insertTargetInstanceMethodDescriptor, - listTargetInstancesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetInstanceStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListTargetInstancesMethodDescriptor, + deleteTargetInstanceMethodDescriptor, + getTargetInstanceMethodDescriptor, + insertTargetInstanceMethodDescriptor, + listTargetInstancesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetInstanceStubSettings.getDefaultEndpoint()); private static TargetInstanceClient client; private static TargetInstanceSettings clientSettings; @@ -67,13 +68,13 @@ public class TargetInstanceClientTest { public static void setUp() throws IOException { clientSettings = TargetInstanceSettings.newBuilder() - .setTransportChannelProvider( - TargetInstanceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetInstanceClient.create(clientSettings); + .setTransportChannelProvider( + TargetInstanceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetInstanceClient.create(clientSettings); } @After @@ -96,37 +97,47 @@ public void aggregatedListTargetInstancesTest() { TargetInstancesScopedList itemsItem = TargetInstancesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - TargetInstanceAggregatedList expectedResponse = TargetInstanceAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + TargetInstanceAggregatedList expectedResponse = + TargetInstanceAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListTargetInstancesPagedResponse pagedListResponse = client.aggregatedListTargetInstances(project); + AggregatedListTargetInstancesPagedResponse pagedListResponse = + client.aggregatedListTargetInstances(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListTargetInstancesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -163,56 +174,66 @@ public void deleteTargetInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + ProjectZoneTargetInstanceName targetInstance = + ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); - Operation actualResponse = - client.deleteTargetInstance(requestId, targetInstance); + Operation actualResponse = client.deleteTargetInstance(requestId, targetInstance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + ProjectZoneTargetInstanceName targetInstance = + ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); client.deleteTargetInstance(requestId, targetInstance); Assert.fail("No exception raised"); @@ -224,7 +245,8 @@ public void deleteTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetInstanceTest() { - ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneInstanceName instance = + ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; @@ -233,42 +255,52 @@ public void getTargetInstanceTest() { String id = "id3355"; String natPolicy = "natPolicy-1637703152"; String selfLink = "selfLink-1691268851"; - TargetInstance expectedResponse = TargetInstance.newBuilder() - .setInstance(instance.toString()) - .setZone(zone.toString()) - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setNatPolicy(natPolicy) - .setSelfLink(selfLink) - .build(); + TargetInstance expectedResponse = + TargetInstance.newBuilder() + .setInstance(instance.toString()) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setNatPolicy(natPolicy) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + ProjectZoneTargetInstanceName targetInstance = + ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); - TargetInstance actualResponse = - client.getTargetInstance(targetInstance); + TargetInstance actualResponse = client.getTargetInstance(targetInstance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); + ProjectZoneTargetInstanceName targetInstance = + ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); client.getTargetInstance(targetInstance); Assert.fail("No exception raised"); @@ -301,52 +333,60 @@ public void insertTargetInstanceTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String requestId = "requestId37109963"; TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); - Operation actualResponse = - client.insertTargetInstance(zone, requestId, targetInstanceResource); + Operation actualResponse = client.insertTargetInstance(zone, requestId, targetInstanceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetInstanceExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -370,13 +410,14 @@ public void listTargetInstancesTest() { String selfLink = "selfLink-1691268851"; TargetInstance itemsElement = TargetInstance.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetInstanceList expectedResponse = TargetInstanceList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetInstanceList expectedResponse = + TargetInstanceList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -385,22 +426,29 @@ public void listTargetInstancesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetInstancesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -412,5 +460,4 @@ public void listTargetInstancesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java index 879f47d46905..55c69ddf141d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -15,16 +15,6 @@ */ package com.google.cloud.compute.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode.Code; -import com.google.api.gax.rpc.testing.FakeStatusCode; import static com.google.cloud.compute.v1.TargetPoolClient.AggregatedListTargetPoolsPagedResponse; import static com.google.cloud.compute.v1.TargetPoolClient.ListTargetPoolsPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.addHealthCheckTargetPoolMethodDescriptor; @@ -38,6 +28,17 @@ import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.removeHealthCheckTargetPoolMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.removeInstanceTargetPoolMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetPoolStub.setBackupTargetPoolMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.compute.v1.stub.TargetPoolStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -55,22 +56,22 @@ @javax.annotation.Generated("by GAPIC") public class TargetPoolClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - addHealthCheckTargetPoolMethodDescriptor, - addInstanceTargetPoolMethodDescriptor, - aggregatedListTargetPoolsMethodDescriptor, - deleteTargetPoolMethodDescriptor, - getTargetPoolMethodDescriptor, - getHealthTargetPoolMethodDescriptor, - insertTargetPoolMethodDescriptor, - listTargetPoolsMethodDescriptor, - removeHealthCheckTargetPoolMethodDescriptor, - removeInstanceTargetPoolMethodDescriptor, - setBackupTargetPoolMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetPoolStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + addHealthCheckTargetPoolMethodDescriptor, + addInstanceTargetPoolMethodDescriptor, + aggregatedListTargetPoolsMethodDescriptor, + deleteTargetPoolMethodDescriptor, + getTargetPoolMethodDescriptor, + getHealthTargetPoolMethodDescriptor, + insertTargetPoolMethodDescriptor, + listTargetPoolsMethodDescriptor, + removeHealthCheckTargetPoolMethodDescriptor, + removeInstanceTargetPoolMethodDescriptor, + setBackupTargetPoolMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetPoolStubSettings.getDefaultEndpoint()); private static TargetPoolClient client; private static TargetPoolSettings clientSettings; @@ -79,13 +80,13 @@ public class TargetPoolClientTest { public static void setUp() throws IOException { clientSettings = TargetPoolSettings.newBuilder() - .setTransportChannelProvider( - TargetPoolSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetPoolClient.create(clientSettings); + .setTransportChannelProvider( + TargetPoolSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetPoolClient.create(clientSettings); } @After @@ -122,60 +123,75 @@ public void addHealthCheckTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = + TargetPoolsAddHealthCheckRequest.newBuilder().build(); Operation actualResponse = - client.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource); + client.addHealthCheckTargetPool( + targetPool, requestId, targetPoolsAddHealthCheckRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void addHealthCheckTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); + TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = + TargetPoolsAddHealthCheckRequest.newBuilder().build(); - client.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource); + client.addHealthCheckTargetPool( + targetPool, requestId, targetPoolsAddHealthCheckRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -206,34 +222,37 @@ public void addInstanceTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = + TargetPoolsAddInstanceRequest.newBuilder().build(); Operation actualResponse = client.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource); @@ -242,22 +261,32 @@ public void addInstanceTargetPoolTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void addInstanceTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); + TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = + TargetPoolsAddInstanceRequest.newBuilder().build(); client.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource); Assert.fail("No exception raised"); @@ -276,37 +305,47 @@ public void aggregatedListTargetPoolsTest() { TargetPoolsScopedList itemsItem = TargetPoolsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - TargetPoolAggregatedList expectedResponse = TargetPoolAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + TargetPoolAggregatedList expectedResponse = + TargetPoolAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListTargetPoolsPagedResponse pagedListResponse = client.aggregatedListTargetPools(project); + AggregatedListTargetPoolsPagedResponse pagedListResponse = + client.aggregatedListTargetPools(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListTargetPoolsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -343,55 +382,65 @@ public void deleteTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteTargetPool(targetPool, requestId); + Operation actualResponse = client.deleteTargetPool(targetPool, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; client.deleteTargetPool(targetPool, requestId); @@ -414,43 +463,53 @@ public void getTargetPoolTest() { ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String backupPool = "backupPool1119626361"; String selfLink = "selfLink-1691268851"; - TargetPool expectedResponse = TargetPool.newBuilder() - .setKind(kind) - .setSessionAffinity(sessionAffinity) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setFailoverRatio(failoverRatio) - .setId(id) - .setRegion(region.toString()) - .setBackupPool(backupPool) - .setSelfLink(selfLink) - .build(); + TargetPool expectedResponse = + TargetPool.newBuilder() + .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setFailoverRatio(failoverRatio) + .setId(id) + .setRegion(region.toString()) + .setBackupPool(backupPool) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - TargetPool actualResponse = - client.getTargetPool(targetPool); + TargetPool actualResponse = client.getTargetPool(targetPool); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); client.getTargetPool(targetPool); Assert.fail("No exception raised"); @@ -463,12 +522,12 @@ public void getTargetPoolExceptionTest() throws Exception { @SuppressWarnings("all") public void getHealthTargetPoolTest() { String kind = "kind3292052"; - TargetPoolInstanceHealth expectedResponse = TargetPoolInstanceHealth.newBuilder() - .setKind(kind) - .build(); + TargetPoolInstanceHealth expectedResponse = + TargetPoolInstanceHealth.newBuilder().setKind(kind).build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build(); TargetPoolInstanceHealth actualResponse = @@ -478,20 +537,29 @@ public void getHealthTargetPoolTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getHealthTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build(); client.getHealthTargetPool(targetPool, instanceReferenceResource); @@ -525,52 +593,60 @@ public void insertTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); TargetPool targetPoolResource = TargetPool.newBuilder().build(); - Operation actualResponse = - client.insertTargetPool(requestId, region, targetPoolResource); + Operation actualResponse = client.insertTargetPool(requestId, region, targetPoolResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -594,13 +670,14 @@ public void listTargetPoolsTest() { String selfLink = "selfLink-1691268851"; TargetPool itemsElement = TargetPool.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetPoolList expectedResponse = TargetPoolList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetPoolList expectedResponse = + TargetPoolList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -609,22 +686,29 @@ public void listTargetPoolsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetPoolsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -661,60 +745,75 @@ public void removeHealthCheckTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = + TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); Operation actualResponse = - client.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); + client.removeHealthCheckTargetPool( + targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void removeHealthCheckTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); + TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = + TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); - client.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); + client.removeHealthCheckTargetPool( + targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -745,60 +844,75 @@ public void removeInstanceTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = + TargetPoolsRemoveInstanceRequest.newBuilder().build(); Operation actualResponse = - client.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource); + client.removeInstanceTargetPool( + targetPool, requestId, targetPoolsRemoveInstanceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void removeInstanceTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; - TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); + TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = + TargetPoolsRemoveInstanceRequest.newBuilder().build(); - client.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource); + client.removeInstanceTargetPool( + targetPool, requestId, targetPoolsRemoveInstanceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -829,32 +943,34 @@ public void setBackupTargetPoolTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; Float failoverRatio = -8.6107481E7F; TargetReference targetReferenceResource = TargetReference.newBuilder().build(); @@ -866,20 +982,29 @@ public void setBackupTargetPoolTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setBackupTargetPoolExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); + ProjectRegionTargetPoolName targetPool = + ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); String requestId = "requestId37109963"; Float failoverRatio = -8.6107481E7F; TargetReference targetReferenceResource = TargetReference.newBuilder().build(); @@ -890,5 +1015,4 @@ public void setBackupTargetPoolExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java index 14158337d4a5..d53c2359b802 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -15,6 +15,16 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.deleteTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.getTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.insertTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.listTargetSslProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setBackendServiceTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setProxyHeaderTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setSslCertificatesTargetSslProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setSslPolicyTargetSslProxyMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,22 +35,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetSslProxyClient.ListTargetSslProxiesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.deleteTargetSslProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.getTargetSslProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.insertTargetSslProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.listTargetSslProxiesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setBackendServiceTargetSslProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setProxyHeaderTargetSslProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetSslProxyStub.setSslCertificatesTargetSslProxyMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetSslProxyStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -50,18 +50,19 @@ @javax.annotation.Generated("by GAPIC") public class TargetSslProxyClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteTargetSslProxyMethodDescriptor, - getTargetSslProxyMethodDescriptor, - insertTargetSslProxyMethodDescriptor, - listTargetSslProxiesMethodDescriptor, - setBackendServiceTargetSslProxyMethodDescriptor, - setProxyHeaderTargetSslProxyMethodDescriptor, - setSslCertificatesTargetSslProxyMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetSslProxyStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetSslProxyMethodDescriptor, + getTargetSslProxyMethodDescriptor, + insertTargetSslProxyMethodDescriptor, + listTargetSslProxiesMethodDescriptor, + setBackendServiceTargetSslProxyMethodDescriptor, + setProxyHeaderTargetSslProxyMethodDescriptor, + setSslCertificatesTargetSslProxyMethodDescriptor, + setSslPolicyTargetSslProxyMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetSslProxyStubSettings.getDefaultEndpoint()); private static TargetSslProxyClient client; private static TargetSslProxySettings clientSettings; @@ -70,13 +71,13 @@ public class TargetSslProxyClientTest { public static void setUp() throws IOException { clientSettings = TargetSslProxySettings.newBuilder() - .setTransportChannelProvider( - TargetSslProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetSslProxyClient.create(clientSettings); + .setTransportChannelProvider( + TargetSslProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetSslProxyClient.create(clientSettings); } @After @@ -113,55 +114,65 @@ public void deleteTargetSslProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteTargetSslProxy(targetSslProxy, requestId); + Operation actualResponse = client.deleteTargetSslProxy(targetSslProxy, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetSslProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; client.deleteTargetSslProxy(targetSslProxy, requestId); @@ -176,47 +187,60 @@ public void deleteTargetSslProxyExceptionTest() throws Exception { public void getTargetSslProxyTest() { String kind = "kind3292052"; String service = "service1984153269"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; String proxyHeader = "proxyHeader-1987109506"; String selfLink = "selfLink-1691268851"; - TargetSslProxy expectedResponse = TargetSslProxy.newBuilder() - .setKind(kind) - .setService(service) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setProxyHeader(proxyHeader) - .setSelfLink(selfLink) - .build(); + TargetSslProxy expectedResponse = + TargetSslProxy.newBuilder() + .setKind(kind) + .setService(service) + .setSslPolicy(sslPolicy.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setProxyHeader(proxyHeader) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - TargetSslProxy actualResponse = - client.getTargetSslProxy(targetSslProxy); + TargetSslProxy actualResponse = client.getTargetSslProxy(targetSslProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetSslProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); client.getTargetSslProxy(targetSslProxy); Assert.fail("No exception raised"); @@ -249,29 +273,30 @@ public void insertTargetSslProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -285,16 +310,24 @@ public void insertTargetSslProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetSslProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -318,13 +351,14 @@ public void listTargetSslProxiesTest() { String selfLink = "selfLink-1691268851"; TargetSslProxy itemsElement = TargetSslProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetSslProxyList expectedResponse = TargetSslProxyList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetSslProxyList expectedResponse = + TargetSslProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -333,22 +367,29 @@ public void listTargetSslProxiesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetSslProxiesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -385,60 +426,75 @@ public void setBackendServiceTargetSslProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = + TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); Operation actualResponse = - client.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); + client.setBackendServiceTargetSslProxy( + targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setBackendServiceTargetSslProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); + TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = + TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); - client.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); + client.setBackendServiceTargetSslProxy( + targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -469,60 +525,75 @@ public void setProxyHeaderTargetSslProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = + TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); Operation actualResponse = - client.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); + client.setProxyHeaderTargetSslProxy( + targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); + TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = + TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); - client.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); + client.setProxyHeaderTargetSslProxy( + targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -553,64 +624,173 @@ public void setSslCertificatesTargetSslProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = + TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = - client.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetSslProxy( + targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetSslProxyName targetSslProxy = ProjectTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); String requestId = "requestId37109963"; - TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); + TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = + TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); - client.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); + client.setSslCertificatesTargetSslProxy( + targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } -} \ No newline at end of file + @Test + @SuppressWarnings("all") + public void setSslPolicyTargetSslProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; + SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); + + Operation actualResponse = + client.setSslPolicyTargetSslProxy(targetSslProxy, requestId, sslPolicyReferenceResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void setSslPolicyTargetSslProxyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalTargetSslProxyName targetSslProxy = + ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); + String requestId = "requestId37109963"; + SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); + + client.setSslPolicyTargetSslProxy(targetSslProxy, requestId, sslPolicyReferenceResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java index 1fbc16cbe0ec..067f5a281022 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.deleteTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.getTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.insertTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.listTargetTcpProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.setBackendServiceTargetTcpProxyMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.setProxyHeaderTargetTcpProxyMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,21 +33,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetTcpProxyClient.ListTargetTcpProxiesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.deleteTargetTcpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.getTargetTcpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.insertTargetTcpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.listTargetTcpProxiesMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.setBackendServiceTargetTcpProxyMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetTcpProxyStub.setProxyHeaderTargetTcpProxyMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetTcpProxyStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -49,17 +48,17 @@ @javax.annotation.Generated("by GAPIC") public class TargetTcpProxyClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteTargetTcpProxyMethodDescriptor, - getTargetTcpProxyMethodDescriptor, - insertTargetTcpProxyMethodDescriptor, - listTargetTcpProxiesMethodDescriptor, - setBackendServiceTargetTcpProxyMethodDescriptor, - setProxyHeaderTargetTcpProxyMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetTcpProxyStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteTargetTcpProxyMethodDescriptor, + getTargetTcpProxyMethodDescriptor, + insertTargetTcpProxyMethodDescriptor, + listTargetTcpProxiesMethodDescriptor, + setBackendServiceTargetTcpProxyMethodDescriptor, + setProxyHeaderTargetTcpProxyMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetTcpProxyStubSettings.getDefaultEndpoint()); private static TargetTcpProxyClient client; private static TargetTcpProxySettings clientSettings; @@ -68,13 +67,13 @@ public class TargetTcpProxyClientTest { public static void setUp() throws IOException { clientSettings = TargetTcpProxySettings.newBuilder() - .setTransportChannelProvider( - TargetTcpProxySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetTcpProxyClient.create(clientSettings); + .setTransportChannelProvider( + TargetTcpProxySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetTcpProxyClient.create(clientSettings); } @After @@ -111,56 +110,66 @@ public void deleteTargetTcpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - Operation actualResponse = - client.deleteTargetTcpProxy(requestId, targetTcpProxy); + Operation actualResponse = client.deleteTargetTcpProxy(requestId, targetTcpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetTcpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); client.deleteTargetTcpProxy(requestId, targetTcpProxy); Assert.fail("No exception raised"); @@ -180,41 +189,51 @@ public void getTargetTcpProxyTest() { String id = "id3355"; String proxyHeader = "proxyHeader-1987109506"; String selfLink = "selfLink-1691268851"; - TargetTcpProxy expectedResponse = TargetTcpProxy.newBuilder() - .setKind(kind) - .setService(service) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setProxyHeader(proxyHeader) - .setSelfLink(selfLink) - .build(); + TargetTcpProxy expectedResponse = + TargetTcpProxy.newBuilder() + .setKind(kind) + .setService(service) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setProxyHeader(proxyHeader) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - TargetTcpProxy actualResponse = - client.getTargetTcpProxy(targetTcpProxy); + TargetTcpProxy actualResponse = client.getTargetTcpProxy(targetTcpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetTcpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); client.getTargetTcpProxy(targetTcpProxy); Assert.fail("No exception raised"); @@ -247,29 +266,30 @@ public void insertTargetTcpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -283,16 +303,24 @@ public void insertTargetTcpProxyTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetTcpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -316,13 +344,14 @@ public void listTargetTcpProxiesTest() { String selfLink = "selfLink-1691268851"; TargetTcpProxy itemsElement = TargetTcpProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetTcpProxyList expectedResponse = TargetTcpProxyList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetTcpProxyList expectedResponse = + TargetTcpProxyList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -331,22 +360,29 @@ public void listTargetTcpProxiesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetTcpProxiesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -383,60 +419,75 @@ public void setBackendServiceTargetTcpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = + TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); Operation actualResponse = - client.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + client.setBackendServiceTargetTcpProxy( + requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setBackendServiceTargetTcpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = + TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); - client.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + client.setBackendServiceTargetTcpProxy( + requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -467,64 +518,78 @@ public void setProxyHeaderTargetTcpProxyTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = + TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); Operation actualResponse = - client.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + client.setProxyHeaderTargetTcpProxy( + requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void setProxyHeaderTargetTcpProxyExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectTargetTcpProxyName targetTcpProxy = ProjectTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); + ProjectGlobalTargetTcpProxyName targetTcpProxy = + ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); + TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = + TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); - client.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + client.setProxyHeaderTargetTcpProxy( + requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java index 092270a7ece7..e79add735159 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.aggregatedListTargetVpnGatewaysMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.deleteTargetVpnGatewayMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.getTargetVpnGatewayMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.insertTargetVpnGatewayMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.listTargetVpnGatewaysMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,13 +33,6 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.AggregatedListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.TargetVpnGatewayClient.ListTargetVpnGatewaysPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.aggregatedListTargetVpnGatewaysMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.deleteTargetVpnGatewayMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.getTargetVpnGatewayMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.insertTargetVpnGatewayMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonTargetVpnGatewayStub.listTargetVpnGatewaysMethodDescriptor; import com.google.cloud.compute.v1.stub.TargetVpnGatewayStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -49,16 +50,16 @@ @javax.annotation.Generated("by GAPIC") public class TargetVpnGatewayClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListTargetVpnGatewaysMethodDescriptor, - deleteTargetVpnGatewayMethodDescriptor, - getTargetVpnGatewayMethodDescriptor, - insertTargetVpnGatewayMethodDescriptor, - listTargetVpnGatewaysMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, TargetVpnGatewayStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListTargetVpnGatewaysMethodDescriptor, + deleteTargetVpnGatewayMethodDescriptor, + getTargetVpnGatewayMethodDescriptor, + insertTargetVpnGatewayMethodDescriptor, + listTargetVpnGatewaysMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, TargetVpnGatewayStubSettings.getDefaultEndpoint()); private static TargetVpnGatewayClient client; private static TargetVpnGatewaySettings clientSettings; @@ -67,13 +68,13 @@ public class TargetVpnGatewayClientTest { public static void setUp() throws IOException { clientSettings = TargetVpnGatewaySettings.newBuilder() - .setTransportChannelProvider( - TargetVpnGatewaySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - TargetVpnGatewayClient.create(clientSettings); + .setTransportChannelProvider( + TargetVpnGatewaySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TargetVpnGatewayClient.create(clientSettings); } @After @@ -96,37 +97,48 @@ public void aggregatedListTargetVpnGatewaysTest() { TargetVpnGatewaysScopedList itemsItem = TargetVpnGatewaysScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - TargetVpnGatewayAggregatedList expectedResponse = TargetVpnGatewayAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + TargetVpnGatewayAggregatedList expectedResponse = + TargetVpnGatewayAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListTargetVpnGatewaysPagedResponse pagedListResponse = client.aggregatedListTargetVpnGateways(project); + AggregatedListTargetVpnGatewaysPagedResponse pagedListResponse = + client.aggregatedListTargetVpnGateways(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListTargetVpnGatewaysExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -163,56 +175,66 @@ public void deleteTargetVpnGatewayTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + ProjectRegionTargetVpnGatewayName targetVpnGateway = + ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); - Operation actualResponse = - client.deleteTargetVpnGateway(requestId, targetVpnGateway); + Operation actualResponse = client.deleteTargetVpnGateway(requestId, targetVpnGateway); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteTargetVpnGatewayExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + ProjectRegionTargetVpnGatewayName targetVpnGateway = + ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); client.deleteTargetVpnGateway(requestId, targetVpnGateway); Assert.fail("No exception raised"); @@ -230,45 +252,55 @@ public void getTargetVpnGatewayTest() { String description = "description-1724546052"; String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - ProjectNetworkName network = ProjectNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; - TargetVpnGateway expectedResponse = TargetVpnGateway.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setNetwork(network.toString()) - .setSelfLink(selfLink) - .setStatus(status) - .build(); + TargetVpnGateway expectedResponse = + TargetVpnGateway.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + ProjectRegionTargetVpnGatewayName targetVpnGateway = + ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); - TargetVpnGateway actualResponse = - client.getTargetVpnGateway(targetVpnGateway); + TargetVpnGateway actualResponse = client.getTargetVpnGateway(targetVpnGateway); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getTargetVpnGatewayExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + ProjectRegionTargetVpnGatewayName targetVpnGateway = + ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); client.getTargetVpnGateway(targetVpnGateway); Assert.fail("No exception raised"); @@ -301,29 +333,30 @@ public void insertTargetVpnGatewayTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; @@ -337,16 +370,24 @@ public void insertTargetVpnGatewayTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertTargetVpnGatewayExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -370,13 +411,14 @@ public void listTargetVpnGatewaysTest() { String selfLink = "selfLink-1691268851"; TargetVpnGateway itemsElement = TargetVpnGateway.newBuilder().build(); List items = Arrays.asList(itemsElement); - TargetVpnGatewayList expectedResponse = TargetVpnGatewayList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + TargetVpnGatewayList expectedResponse = + TargetVpnGatewayList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -385,22 +427,29 @@ public void listTargetVpnGatewaysTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listTargetVpnGatewaysExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -412,5 +461,4 @@ public void listTargetVpnGatewaysExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java index c6da9d875235..ddd8b2fd8ee3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -15,6 +15,16 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.deleteUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.getUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.insertUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.invalidateCacheUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.listUrlMapsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.patchUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.updateUrlMapMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.validateUrlMapMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,23 +35,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.UrlMapClient.ListUrlMapsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.deleteUrlMapMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.getUrlMapMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.insertUrlMapMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.invalidateCacheUrlMapMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.listUrlMapsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.patchUrlMapMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.updateUrlMapMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonUrlMapStub.validateUrlMapMethodDescriptor; import com.google.cloud.compute.v1.stub.UrlMapStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -51,19 +50,19 @@ @javax.annotation.Generated("by GAPIC") public class UrlMapClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteUrlMapMethodDescriptor, - getUrlMapMethodDescriptor, - insertUrlMapMethodDescriptor, - invalidateCacheUrlMapMethodDescriptor, - listUrlMapsMethodDescriptor, - patchUrlMapMethodDescriptor, - updateUrlMapMethodDescriptor, - validateUrlMapMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, UrlMapStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteUrlMapMethodDescriptor, + getUrlMapMethodDescriptor, + insertUrlMapMethodDescriptor, + invalidateCacheUrlMapMethodDescriptor, + listUrlMapsMethodDescriptor, + patchUrlMapMethodDescriptor, + updateUrlMapMethodDescriptor, + validateUrlMapMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, UrlMapStubSettings.getDefaultEndpoint()); private static UrlMapClient client; private static UrlMapSettings clientSettings; @@ -72,13 +71,13 @@ public class UrlMapClientTest { public static void setUp() throws IOException { clientSettings = UrlMapSettings.newBuilder() - .setTransportChannelProvider( - UrlMapSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - UrlMapClient.create(clientSettings); + .setTransportChannelProvider( + UrlMapSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = UrlMapClient.create(clientSettings); } @After @@ -115,55 +114,63 @@ public void deleteUrlMapTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; - Operation actualResponse = - client.deleteUrlMap(urlMap, requestId); + Operation actualResponse = client.deleteUrlMap(urlMap, requestId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; client.deleteUrlMap(urlMap, requestId); @@ -184,41 +191,49 @@ public void getUrlMapTest() { String id = "id3355"; String defaultService = "defaultService1980854967"; String selfLink = "selfLink-1691268851"; - UrlMap expectedResponse = UrlMap.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setDescription(description) - .setId(id) - .setDefaultService(defaultService) - .setSelfLink(selfLink) - .build(); + UrlMap expectedResponse = + UrlMap.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setDescription(description) + .setId(id) + .setDefaultService(defaultService) + .setSelfLink(selfLink) + .build(); mockService.addResponse(expectedResponse); - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - UrlMap actualResponse = - client.getUrlMap(urlMap); + UrlMap actualResponse = client.getUrlMap(urlMap); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); client.getUrlMap(urlMap); Assert.fail("No exception raised"); @@ -251,52 +266,60 @@ public void insertUrlMapTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UrlMap urlMapResource = UrlMap.newBuilder().build(); - Operation actualResponse = - client.insertUrlMap(requestId, project, urlMapResource); + Operation actualResponse = client.insertUrlMap(requestId, project, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -335,34 +358,36 @@ public void invalidateCacheUrlMapTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; - CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); + CacheInvalidationRule cacheInvalidationRuleResource = + CacheInvalidationRule.newBuilder().build(); Operation actualResponse = client.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource); @@ -371,22 +396,31 @@ public void invalidateCacheUrlMapTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void invalidateCacheUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; - CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); + CacheInvalidationRule cacheInvalidationRuleResource = + CacheInvalidationRule.newBuilder().build(); client.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource); Assert.fail("No exception raised"); @@ -404,13 +438,14 @@ public void listUrlMapsTest() { String selfLink = "selfLink-1691268851"; UrlMap itemsElement = UrlMap.newBuilder().build(); List items = Arrays.asList(itemsElement); - UrlMapList expectedResponse = UrlMapList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + UrlMapList expectedResponse = + UrlMapList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -419,22 +454,29 @@ public void listUrlMapsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listUrlMapsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -471,56 +513,64 @@ public void patchUrlMapTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - Operation actualResponse = - client.patchUrlMap(urlMap, requestId, urlMapResource); + Operation actualResponse = client.patchUrlMap(urlMap, requestId, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void patchUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); @@ -555,56 +605,64 @@ public void updateUrlMapTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - Operation actualResponse = - client.updateUrlMap(urlMap, requestId, urlMapResource); + Operation actualResponse = client.updateUrlMap(urlMap, requestId, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void updateUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); @@ -621,8 +679,9 @@ public void validateUrlMapTest() { UrlMapsValidateResponse expectedResponse = UrlMapsValidateResponse.newBuilder().build(); mockService.addResponse(expectedResponse); - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); - UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build(); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMapsValidateRequest urlMapsValidateRequestResource = + UrlMapsValidateRequest.newBuilder().build(); UrlMapsValidateResponse actualResponse = client.validateUrlMap(urlMap, urlMapsValidateRequestResource); @@ -631,21 +690,30 @@ public void validateUrlMapTest() { List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void validateUrlMapExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectUrlMapName urlMap = ProjectUrlMapName.of("[PROJECT]", "[URL_MAP]"); - UrlMapsValidateRequest urlMapsValidateRequestResource = UrlMapsValidateRequest.newBuilder().build(); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); + UrlMapsValidateRequest urlMapsValidateRequestResource = + UrlMapsValidateRequest.newBuilder().build(); client.validateUrlMap(urlMap, urlMapsValidateRequestResource); Assert.fail("No exception raised"); @@ -653,5 +721,4 @@ public void validateUrlMapExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java index e5c095c56b37..ec71f3dd9208 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -15,6 +15,14 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.aggregatedListVpnTunnelsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.deleteVpnTunnelMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.getVpnTunnelMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.insertVpnTunnelMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.listVpnTunnelsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,13 +33,6 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.VpnTunnelClient.AggregatedListVpnTunnelsPagedResponse; -import static com.google.cloud.compute.v1.VpnTunnelClient.ListVpnTunnelsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.aggregatedListVpnTunnelsMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.deleteVpnTunnelMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.getVpnTunnelMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.insertVpnTunnelMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonVpnTunnelStub.listVpnTunnelsMethodDescriptor; import com.google.cloud.compute.v1.stub.VpnTunnelStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -49,16 +50,16 @@ @javax.annotation.Generated("by GAPIC") public class VpnTunnelClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - aggregatedListVpnTunnelsMethodDescriptor, - deleteVpnTunnelMethodDescriptor, - getVpnTunnelMethodDescriptor, - insertVpnTunnelMethodDescriptor, - listVpnTunnelsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, VpnTunnelStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListVpnTunnelsMethodDescriptor, + deleteVpnTunnelMethodDescriptor, + getVpnTunnelMethodDescriptor, + insertVpnTunnelMethodDescriptor, + listVpnTunnelsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, VpnTunnelStubSettings.getDefaultEndpoint()); private static VpnTunnelClient client; private static VpnTunnelSettings clientSettings; @@ -67,13 +68,13 @@ public class VpnTunnelClientTest { public static void setUp() throws IOException { clientSettings = VpnTunnelSettings.newBuilder() - .setTransportChannelProvider( - VpnTunnelSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - VpnTunnelClient.create(clientSettings); + .setTransportChannelProvider( + VpnTunnelSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = VpnTunnelClient.create(clientSettings); } @After @@ -96,37 +97,47 @@ public void aggregatedListVpnTunnelsTest() { VpnTunnelsScopedList itemsItem = VpnTunnelsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); - VpnTunnelAggregatedList expectedResponse = VpnTunnelAggregatedList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .putAllItems(items) - .build(); + VpnTunnelAggregatedList expectedResponse = + VpnTunnelAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); - AggregatedListVpnTunnelsPagedResponse pagedListResponse = client.aggregatedListVpnTunnels(project); + AggregatedListVpnTunnelsPagedResponse pagedListResponse = + client.aggregatedListVpnTunnels(project); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsMap().values().iterator().next(), - resources.get(0)); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void aggregatedListVpnTunnelsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -163,56 +174,66 @@ public void deleteVpnTunnelTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; - ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + ProjectRegionVpnTunnelName vpnTunnel = + ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); - Operation actualResponse = - client.deleteVpnTunnel(requestId, vpnTunnel); + Operation actualResponse = client.deleteVpnTunnel(requestId, vpnTunnel); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteVpnTunnelExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { String requestId = "requestId37109963"; - ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + ProjectRegionVpnTunnelName vpnTunnel = + ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); client.deleteVpnTunnel(requestId, vpnTunnel); Assert.fail("No exception raised"); @@ -229,7 +250,8 @@ public void getVpnTunnelTest() { String description = "description-1724546052"; Integer ikeVersion = 1292118044; String selfLink = "selfLink-1691268851"; - ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String detailedStatus = "detailedStatus-740240799"; String peerIp = "peerIp-690492124"; String creationTimestamp = "creationTimestamp567396278"; @@ -237,50 +259,61 @@ public void getVpnTunnelTest() { String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String sharedSecret = "sharedSecret-154938422"; - ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + ProjectRegionTargetVpnGatewayName targetVpnGateway = + ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); String status = "status-892481550"; - VpnTunnel expectedResponse = VpnTunnel.newBuilder() - .setSharedSecretHash(sharedSecretHash) - .setKind(kind) - .setDescription(description) - .setIkeVersion(ikeVersion) - .setSelfLink(selfLink) - .setRouter(router.toString()) - .setDetailedStatus(detailedStatus) - .setPeerIp(peerIp) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setRegion(region.toString()) - .setSharedSecret(sharedSecret) - .setTargetVpnGateway(targetVpnGateway.toString()) - .setStatus(status) - .build(); + VpnTunnel expectedResponse = + VpnTunnel.newBuilder() + .setSharedSecretHash(sharedSecretHash) + .setKind(kind) + .setDescription(description) + .setIkeVersion(ikeVersion) + .setSelfLink(selfLink) + .setRouter(router.toString()) + .setDetailedStatus(detailedStatus) + .setPeerIp(peerIp) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setRegion(region.toString()) + .setSharedSecret(sharedSecret) + .setTargetVpnGateway(targetVpnGateway.toString()) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + ProjectRegionVpnTunnelName vpnTunnel = + ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); - VpnTunnel actualResponse = - client.getVpnTunnel(vpnTunnel); + VpnTunnel actualResponse = client.getVpnTunnel(vpnTunnel); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getVpnTunnelExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); + ProjectRegionVpnTunnelName vpnTunnel = + ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); client.getVpnTunnel(vpnTunnel); Assert.fail("No exception raised"); @@ -313,52 +346,60 @@ public void insertVpnTunnelTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); - Operation actualResponse = - client.insertVpnTunnel(requestId, region, vpnTunnelResource); + Operation actualResponse = client.insertVpnTunnel(requestId, region, vpnTunnelResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void insertVpnTunnelExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -382,13 +423,14 @@ public void listVpnTunnelsTest() { String selfLink = "selfLink-1691268851"; VpnTunnel itemsElement = VpnTunnel.newBuilder().build(); List items = Arrays.asList(itemsElement); - VpnTunnelList expectedResponse = VpnTunnelList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + VpnTunnelList expectedResponse = + VpnTunnelList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); @@ -397,22 +439,29 @@ public void listVpnTunnelsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listVpnTunnelsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -424,5 +473,4 @@ public void listVpnTunnelsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java index cef554719f45..a2bcabedf199 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java @@ -15,6 +15,10 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneStub.getZoneMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneStub.listZonesMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,17 +29,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.ZoneClient.ListZonesPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonZoneStub.getZoneMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonZoneStub.listZonesMethodDescriptor; import com.google.cloud.compute.v1.stub.ZoneStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,13 +44,12 @@ @javax.annotation.Generated("by GAPIC") public class ZoneClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - getZoneMethodDescriptor, - listZonesMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, ZoneStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getZoneMethodDescriptor, listZonesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, ZoneStubSettings.getDefaultEndpoint()); private static ZoneClient client; private static ZoneSettings clientSettings; @@ -60,13 +58,13 @@ public class ZoneClientTest { public static void setUp() throws IOException { clientSettings = ZoneSettings.newBuilder() - .setTransportChannelProvider( - ZoneSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - ZoneClient.create(clientSettings); + .setTransportChannelProvider( + ZoneSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ZoneClient.create(clientSettings); } @After @@ -90,37 +88,45 @@ public void getZoneTest() { ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; - Zone expectedResponse = Zone.newBuilder() - .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDescription(description) - .setId(id) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setStatus(status) - .build(); + Zone expectedResponse = + Zone.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - Zone actualResponse = - client.getZone(zone); + Zone actualResponse = client.getZone(zone); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getZoneExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -142,13 +148,14 @@ public void listZonesTest() { String selfLink = "selfLink-1691268851"; Zone itemsElement = Zone.newBuilder().build(); List items = Arrays.asList(itemsElement); - ZoneList expectedResponse = ZoneList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + ZoneList expectedResponse = + ZoneList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); @@ -157,22 +164,29 @@ public void listZonesTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listZonesExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -184,5 +198,4 @@ public void listZonesExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java index 22ac205e602f..6b534af7519b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java @@ -15,6 +15,11 @@ */ package com.google.cloud.compute.v1; +import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.deleteZoneOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.getZoneOperationMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.listZoneOperationsMethodDescriptor; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -25,18 +30,12 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; -import static com.google.cloud.compute.v1.ZoneOperationClient.ListZoneOperationsPagedResponse; -import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.deleteZoneOperationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.getZoneOperationMethodDescriptor; -import static com.google.cloud.compute.v1.stub.HttpJsonZoneOperationStub.listZoneOperationsMethodDescriptor; import com.google.cloud.compute.v1.stub.ZoneOperationStubSettings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -46,14 +45,14 @@ @javax.annotation.Generated("by GAPIC") public class ZoneOperationClientTest { - private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( - Lists.newArrayList( - deleteZoneOperationMethodDescriptor, - getZoneOperationMethodDescriptor, - listZoneOperationsMethodDescriptor - )); - private static final MockHttpService mockService - = new MockHttpService(METHOD_DESCRIPTORS, ZoneOperationStubSettings.getDefaultEndpoint()); + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + deleteZoneOperationMethodDescriptor, + getZoneOperationMethodDescriptor, + listZoneOperationsMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, ZoneOperationStubSettings.getDefaultEndpoint()); private static ZoneOperationClient client; private static ZoneOperationSettings clientSettings; @@ -62,13 +61,13 @@ public class ZoneOperationClientTest { public static void setUp() throws IOException { clientSettings = ZoneOperationSettings.newBuilder() - .setTransportChannelProvider( - ZoneOperationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService).build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = - ZoneOperationClient.create(clientSettings); + .setTransportChannelProvider( + ZoneOperationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ZoneOperationClient.create(clientSettings); } @After @@ -86,27 +85,37 @@ public static void tearDown() throws Exception { public void deleteZoneOperationTest() { mockService.addNullResponse(); - ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + ProjectZoneOperationName operation = + ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); client.deleteZoneOperation(operation); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void deleteZoneOperationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + ProjectZoneOperationName operation = + ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); client.deleteZoneOperation(operation); Assert.fail("No exception raised"); @@ -139,54 +148,64 @@ public void getZoneOperationTest() { String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; String status = "status-892481550"; - Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) - .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) - .setStatus(status) - .build(); + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); mockService.addResponse(expectedResponse); - ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + ProjectZoneOperationName operation = + ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); - Operation actualResponse = - client.getZoneOperation(operation); + Operation actualResponse = client.getZoneOperation(operation); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void getZoneOperationExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - ProjectZoneOperationName operation = ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); + ProjectZoneOperationName operation = + ProjectZoneOperationName.of("[PROJECT]", "[ZONE]", "[OPERATION]"); client.getZoneOperation(operation); Assert.fail("No exception raised"); @@ -204,13 +223,14 @@ public void listZoneOperationsTest() { String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); - OperationList expectedResponse = OperationList.newBuilder() - .setKind(kind) - .setNextPageToken(nextPageToken) - .setId(id) - .setSelfLink(selfLink) - .addAllItems(items) - .build(); + OperationList expectedResponse = + OperationList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); @@ -219,22 +239,29 @@ public void listZoneOperationsTest() { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getItemsList().get(0), - resources.get(0)); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); - String apiClientHeaderKey = mockService.getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()).iterator().next(); - Assert.assertTrue(GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey).matches()); + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); } @Test @SuppressWarnings("all") public void listZoneOperationsExceptionTest() throws Exception { - ApiException exception = ApiExceptionFactory.createException(new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { @@ -246,5 +273,4 @@ public void listZoneOperationsExceptionTest() throws Exception { // Expected exception } } - -} \ No newline at end of file +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java deleted file mode 100644 index 4662f685621f..000000000000 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/it/ITComputeTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.v1.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.api.gax.paging.Page; -import com.google.auth.Credentials; -import com.google.auth.oauth2.GoogleCredentials; -import com.google.cloud.ServiceOptions; -import com.google.cloud.compute.v1.DiskType; -import com.google.cloud.compute.v1.DiskTypeClient; -import com.google.cloud.compute.v1.DiskTypeClient.AggregatedListDiskTypesPagedResponse; -import com.google.cloud.compute.v1.DiskTypeName; -import com.google.cloud.compute.v1.DiskTypeSettings; -import com.google.cloud.compute.v1.DiskTypesScopedList; -import com.google.cloud.compute.v1.ListDiskTypesHttpRequest; -import com.google.cloud.compute.v1.ProjectName; -import com.google.cloud.compute.v1.ProjectZoneDiskTypeName; -import com.google.cloud.compute.v1.ProjectZoneName; -import com.google.cloud.compute.v1.ZoneName; -import com.google.common.collect.Lists; -import java.io.IOException; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; - -public class ITComputeTest { - - private static final String ZONE = "us-central1-a"; - private static final String DISK_TYPE = "local-ssd"; - private static final String DEFAULT_PROJECT = ServiceOptions.getDefaultProjectId(); - - private static DiskTypeClient diskTypeClient; - private static DiskTypeSettings diskTypeSettings; - - - @Rule - public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() throws IOException{ - Credentials credentials = GoogleCredentials.getApplicationDefault(); - - diskTypeSettings = - DiskTypeSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credentials)).build(); - diskTypeClient = - DiskTypeClient.create(diskTypeSettings); - } - - @AfterClass - public static void tearDown() throws Exception { - diskTypeClient.close(); - } - - @Test - public void testGetDiskType() { - DiskType diskType = diskTypeClient.getDiskType( - ProjectZoneDiskTypeName.of(DISK_TYPE, DEFAULT_PROJECT, ZONE)); - DiskTypeName returnDiskName = DiskTypeName.parse(trimUrl(diskType.getSelfLink())); - assertEquals(ZONE, returnDiskName.getZone()); - assertEquals(DISK_TYPE, returnDiskName.getDiskType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testListDiskTypes() { - Page diskPage = diskTypeClient.listDiskTypes(ProjectZoneName.of(DEFAULT_PROJECT, ZONE)).getPage(); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - assertNotNull(diskType.getSelfLink()); - DiskTypeName returnDiskName = DiskTypeName.parse(trimUrl(diskType.getSelfLink())); - assertEquals(ZONE, returnDiskName.getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithFilter() { - ListDiskTypesHttpRequest request = ListDiskTypesHttpRequest.newBuilder() - .setZone(ZoneName.of(DEFAULT_PROJECT, ZONE).toString()) - .setFilter("(defaultDiskSizeGb = 375)") - .build(); - Page diskPage = diskTypeClient.listDiskTypes(request).getPage(); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - assertNotNull(diskType.getZone()); - ZoneName zoneName = ZoneName.parse(trimUrl(diskType.getZone())); - assertEquals(ZONE, zoneName.getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypes() { - AggregatedListDiskTypesPagedResponse pagedListResponse = diskTypeClient.aggregatedListDiskTypes(ProjectName.of(DEFAULT_PROJECT)); - List diskTypeScopedListIterator = Lists.newArrayList(pagedListResponse.iterateAll()); - List diskTypeIterator = new LinkedList<>(); - for (DiskTypesScopedList scopedList : diskTypeScopedListIterator) { - diskTypeIterator.addAll(scopedList.getDiskTypesList()); - } - assertTrue(diskTypeIterator.size() > 0); - for (DiskType diskType : diskTypeIterator) { - assertNotNull(diskType.getZone()); - DiskTypeName zoneName = DiskTypeName.parse(trimUrl(diskType.getSelfLink())); - assertNotNull(zoneName.getDiskType()); - assertNotNull(zoneName.getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - /** For a given resource's URI, trim the path until it contains only the PathTemplate string. */ - private String trimUrl(String url) { - return url.replaceFirst("^https://www.googleapis.com/compute/v1/", ""); - } -} From 1822b65b229c45f3dd9b8b2aa13ff016f2552a7e Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 23 Apr 2018 11:08:12 -0700 Subject: [PATCH 14/42] increase maven memory to 1024m in appveyor --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index f397db649714..d612f4764976 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,7 @@ skip_tags: true environment: matrix: - JAVA_HOME: C:\Program Files\Java\jdk1.7.0 + - MAVEN_OPTS: -Xmx1024m GOOGLE_CLOUD_PROJECT: secure: hbX+cAXrU588+iTMKyzGOQ== CREDENTIALS_SECRET: From 7666be55cb3926b28ea28853c2734a8a71177a36 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 23 Apr 2018 11:28:43 -0700 Subject: [PATCH 15/42] move MAVEN_OPTS to install task in appveyor.yml --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d612f4764976..5f1d60ec2bfe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,6 @@ skip_tags: true environment: matrix: - JAVA_HOME: C:\Program Files\Java\jdk1.7.0 - - MAVEN_OPTS: -Xmx1024m GOOGLE_CLOUD_PROJECT: secure: hbX+cAXrU588+iTMKyzGOQ== CREDENTIALS_SECRET: @@ -36,6 +35,9 @@ install: - cmd: IF DEFINED API_KEY_SECRET (secure-file\tools\secure-file -decrypt appveyor\api_key.enc -secret %API_KEY_SECRET% -out appveyor\api_key) - cmd: IF DEFINED API_KEY_SECRET (SET /P GOOGLE_API_KEY=<%APPVEYOR_BUILD_FOLDER%\appveyor\api_key) - cmd: ECHO GOOGLE_API_KEY defined + - cmd: SET MAVEN_OPTS=-Xmx1024m + - cmd: ECHO MAVEN_OPTS + - ps: "ls \"C:/projects/google-cloud-java-v0gf7/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/\"" # build and install artifacts build_script: From d18c46b44559cc4a4a506eba6837437fcc5cea6a Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 23 Apr 2018 11:47:18 -0700 Subject: [PATCH 16/42] revert changes to appveyor.yml --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5f1d60ec2bfe..f397db649714 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,9 +35,6 @@ install: - cmd: IF DEFINED API_KEY_SECRET (secure-file\tools\secure-file -decrypt appveyor\api_key.enc -secret %API_KEY_SECRET% -out appveyor\api_key) - cmd: IF DEFINED API_KEY_SECRET (SET /P GOOGLE_API_KEY=<%APPVEYOR_BUILD_FOLDER%\appveyor\api_key) - cmd: ECHO GOOGLE_API_KEY defined - - cmd: SET MAVEN_OPTS=-Xmx1024m - - cmd: ECHO MAVEN_OPTS - - ps: "ls \"C:/projects/google-cloud-java-v0gf7/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/\"" # build and install artifacts build_script: From 5d82d8b294e68966a136340b99caf50f21787b78 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 25 Apr 2018 18:19:59 -0700 Subject: [PATCH 17/42] regen from latest compute.v1.json --- .../v1/InstanceGroupManagerClient.java | 8 +++--- .../compute/v1/InstanceTemplateClient.java | 16 +++++------ .../cloud/compute/v1/MachineTypeClient.java | 8 +++--- .../cloud/compute/v1/ProjectClient.java | 28 +++++++++---------- .../cloud/compute/v1/SslPolicyClient.java | 18 ++++++------ 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java index 91a2f4b2b7a8..0700ab99244d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java @@ -824,7 +824,7 @@ public final Operation deleteInstancesInstanceGroupManager( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available + * Returns all of the details about the specified managed instance group. Gets a list of available * managed instance groups by making a list() request. * *

Sample code: @@ -853,7 +853,7 @@ public final InstanceGroupManager getInstanceGroupManager( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available + * Returns all of the details about the specified managed instance group. Gets a list of available * managed instance groups by making a list() request. * *

Sample code: @@ -880,7 +880,7 @@ public final InstanceGroupManager getInstanceGroupManager(String instanceGroupMa // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available + * Returns all of the details about the specified managed instance group. Gets a list of available * managed instance groups by making a list() request. * *

Sample code: @@ -906,7 +906,7 @@ public final InstanceGroupManager getInstanceGroupManager( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns all of the details about the specified managed instance group. Get a list of available + * Returns all of the details about the specified managed instance group. Gets a list of available * managed instance groups by making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java index b3251d0afab2..11dc610c8d2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java @@ -287,8 +287,8 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a - * list() request. + * Returns the specified instance template. Gets a list of available instance templates by making + * a list() request. * *

Sample code: * @@ -315,8 +315,8 @@ public final InstanceTemplate getInstanceTemplate( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a - * list() request. + * Returns the specified instance template. Gets a list of available instance templates by making + * a list() request. * *

Sample code: * @@ -340,8 +340,8 @@ public final InstanceTemplate getInstanceTemplate(String instanceTemplate) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a - * list() request. + * Returns the specified instance template. Gets a list of available instance templates by making + * a list() request. * *

Sample code: * @@ -365,8 +365,8 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance template. Get a list of available instance templates by making a - * list() request. + * Returns the specified instance template. Gets a list of available instance templates by making + * a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java index 2d8209cba1aa..2ecca84724e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java @@ -293,7 +293,7 @@ public final AggregatedListMachineTypesPagedResponse aggregatedListMachineTypes( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified machine type. Get a list of available machine types by making a list() + * Returns the specified machine type. Gets a list of available machine types by making a list() * request. * *

Sample code: @@ -320,7 +320,7 @@ public final MachineType getMachineType(ProjectZoneMachineTypeName machineType) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified machine type. Get a list of available machine types by making a list() + * Returns the specified machine type. Gets a list of available machine types by making a list() * request. * *

Sample code: @@ -345,7 +345,7 @@ public final MachineType getMachineType(String machineType) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified machine type. Get a list of available machine types by making a list() + * Returns the specified machine type. Gets a list of available machine types by making a list() * request. * *

Sample code: @@ -370,7 +370,7 @@ public final MachineType getMachineType(GetMachineTypeHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified machine type. Get a list of available machine types by making a list() + * Returns the specified machine type. Gets a list of available machine types by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java index 3c684c877a17..a78100687b99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java @@ -789,7 +789,7 @@ public final UnaryCallable getProjectCallable() // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get the shared VPC host project that this project links to. May be empty if no link exists. + * Gets the shared VPC host project that this project links to. May be empty if no link exists. * *

Sample code: * @@ -815,7 +815,7 @@ public final Project getXpnHostProject(ProjectName project) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get the shared VPC host project that this project links to. May be empty if no link exists. + * Gets the shared VPC host project that this project links to. May be empty if no link exists. * *

Sample code: * @@ -839,7 +839,7 @@ public final Project getXpnHostProject(String project) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get the shared VPC host project that this project links to. May be empty if no link exists. + * Gets the shared VPC host project that this project links to. May be empty if no link exists. * *

Sample code: * @@ -863,7 +863,7 @@ private final Project getXpnHostProject(GetXpnHostProjectHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get the shared VPC host project that this project links to. May be empty if no link exists. + * Gets the shared VPC host project that this project links to. May be empty if no link exists. * *

Sample code: * @@ -886,7 +886,7 @@ public final UnaryCallable getXpnHostProj // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get service resources (a.k.a service project) associated with this host project. + * Gets service resources (a.k.a service project) associated with this host project. * *

Sample code: * @@ -913,7 +913,7 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(Projec // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get service resources (a.k.a service project) associated with this host project. + * Gets service resources (a.k.a service project) associated with this host project. * *

Sample code: * @@ -938,7 +938,7 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects(String // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get service resources (a.k.a service project) associated with this host project. + * Gets service resources (a.k.a service project) associated with this host project. * *

Sample code: * @@ -965,7 +965,7 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get service resources (a.k.a service project) associated with this host project. + * Gets service resources (a.k.a service project) associated with this host project. * *

Sample code: * @@ -992,7 +992,7 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Get service resources (a.k.a service project) associated with this host project. + * Gets service resources (a.k.a service project) associated with this host project. * *

Sample code: * @@ -1025,7 +1025,7 @@ public final GetXpnResourcesProjectsPagedResponse getXpnResourcesProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all shared VPC host projects visible to the user in an organization. + * Lists all shared VPC host projects visible to the user in an organization. * *

Sample code: * @@ -1056,7 +1056,7 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all shared VPC host projects visible to the user in an organization. + * Lists all shared VPC host projects visible to the user in an organization. * *

Sample code: * @@ -1087,7 +1087,7 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all shared VPC host projects visible to the user in an organization. + * Lists all shared VPC host projects visible to the user in an organization. * *

Sample code: * @@ -1116,7 +1116,7 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all shared VPC host projects visible to the user in an organization. + * Lists all shared VPC host projects visible to the user in an organization. * *

Sample code: * @@ -1144,7 +1144,7 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all shared VPC host projects visible to the user in an organization. + * Lists all shared VPC host projects visible to the user in an organization. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java index e421111351dd..965e7131becc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java @@ -284,7 +284,7 @@ public final UnaryCallable deleteSslPolic // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all of the ordered rules present in a single specified policy. + * Lists all of the ordered rules present in a single specified policy. * *

Sample code: * @@ -311,7 +311,7 @@ public final SslPolicy getSslPolicy(ProjectGlobalSslPolicyName sslPolicy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all of the ordered rules present in a single specified policy. + * Lists all of the ordered rules present in a single specified policy. * *

Sample code: * @@ -336,7 +336,7 @@ public final SslPolicy getSslPolicy(String sslPolicy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all of the ordered rules present in a single specified policy. + * Lists all of the ordered rules present in a single specified policy. * *

Sample code: * @@ -360,7 +360,7 @@ public final SslPolicy getSslPolicy(GetSslPolicyHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all of the ordered rules present in a single specified policy. + * Lists all of the ordered rules present in a single specified policy. * *

Sample code: * @@ -530,7 +530,7 @@ public final UnaryCallable insertSslPolic // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all the SSL policies that have been configured for the specified project. + * Lists all the SSL policies that have been configured for the specified project. * *

Sample code: * @@ -557,7 +557,7 @@ public final ListSslPoliciesPagedResponse listSslPolicies(ProjectName project) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all the SSL policies that have been configured for the specified project. + * Lists all the SSL policies that have been configured for the specified project. * *

Sample code: * @@ -582,7 +582,7 @@ public final ListSslPoliciesPagedResponse listSslPolicies(String project) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all the SSL policies that have been configured for the specified project. + * Lists all the SSL policies that have been configured for the specified project. * *

Sample code: * @@ -608,7 +608,7 @@ public final ListSslPoliciesPagedResponse listSslPolicies(ListSslPoliciesHttpReq // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all the SSL policies that have been configured for the specified project. + * Lists all the SSL policies that have been configured for the specified project. * *

Sample code: * @@ -634,7 +634,7 @@ public final ListSslPoliciesPagedResponse listSslPolicies(ListSslPoliciesHttpReq // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * List all the SSL policies that have been configured for the specified project. + * Lists all the SSL policies that have been configured for the specified project. * *

Sample code: * From 2ed819c2893c9803cd2111699f743c9994bcbaf1 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 26 Apr 2018 12:07:08 -0700 Subject: [PATCH 18/42] order fields in tests --- .../compute/v1/AcceleratorTypeClientTest.java | 24 +- .../cloud/compute/v1/AddressClientTest.java | 150 +- .../compute/v1/AutoscalerClientTest.java | 260 ++-- .../compute/v1/BackendBucketClientTest.java | 256 +-- .../compute/v1/BackendServiceClientTest.java | 288 ++-- .../cloud/compute/v1/DiskClientTest.java | 352 ++--- .../cloud/compute/v1/DiskTypeClientTest.java | 28 +- .../cloud/compute/v1/FirewallClientTest.java | 268 ++-- .../compute/v1/ForwardingRuleClientTest.java | 224 +-- .../compute/v1/GlobalAddressClientTest.java | 146 +- .../v1/GlobalForwardingRuleClientTest.java | 220 +-- .../compute/v1/GlobalOperationClientTest.java | 68 +- .../compute/v1/HealthCheckClientTest.java | 272 ++-- .../compute/v1/HttpHealthCheckClientTest.java | 276 ++-- .../v1/HttpsHealthCheckClientTest.java | 276 ++-- .../cloud/compute/v1/ImageClientTest.java | 332 ++-- .../cloud/compute/v1/InstanceClientTest.java | 1380 ++++++++--------- .../compute/v1/InstanceGroupClientTest.java | 340 ++-- .../v1/InstanceGroupManagerClientTest.java | 524 +++---- .../v1/InstanceTemplateClientTest.java | 132 +- .../v1/InterconnectAttachmentClientTest.java | 162 +- .../compute/v1/InterconnectClientTest.java | 236 +-- .../v1/InterconnectLocationClientTest.java | 36 +- .../cloud/compute/v1/LicenseClientTest.java | 136 +- .../compute/v1/LicenseCodeClientTest.java | 16 +- .../compute/v1/MachineTypeClientTest.java | 40 +- .../cloud/compute/v1/NetworkClientTest.java | 376 ++--- .../cloud/compute/v1/ProjectClientTest.java | 516 +++--- .../v1/RegionAutoscalerClientTest.java | 256 +-- .../v1/RegionBackendServiceClientTest.java | 284 ++-- .../cloud/compute/v1/RegionClientTest.java | 12 +- .../v1/RegionCommitmentClientTest.java | 96 +- .../v1/RegionInstanceGroupClientTest.java | 96 +- .../RegionInstanceGroupManagerClientTest.java | 520 +++---- .../compute/v1/RegionOperationClientTest.java | 64 +- .../cloud/compute/v1/RouteClientTest.java | 168 +- .../cloud/compute/v1/RouterClientTest.java | 260 ++-- .../cloud/compute/v1/SnapshotClientTest.java | 160 +- .../compute/v1/SslCertificateClientTest.java | 136 +- .../cloud/compute/v1/SslPolicyClientTest.java | 204 +-- .../compute/v1/SubnetworkClientTest.java | 336 ++-- .../compute/v1/TargetHttpProxyClientTest.java | 196 +-- .../v1/TargetHttpsProxyClientTest.java | 322 ++-- .../compute/v1/TargetInstanceClientTest.java | 144 +- .../compute/v1/TargetPoolClientTest.java | 444 +++--- .../compute/v1/TargetSslProxyClientTest.java | 382 ++--- .../compute/v1/TargetTcpProxyClientTest.java | 256 +-- .../v1/TargetVpnGatewayClientTest.java | 140 +- .../cloud/compute/v1/UrlMapClientTest.java | 320 ++-- .../cloud/compute/v1/VpnTunnelClientTest.java | 166 +- .../cloud/compute/v1/ZoneClientTest.java | 12 +- .../compute/v1/ZoneOperationClientTest.java | 64 +- 52 files changed, 6186 insertions(+), 6186 deletions(-) diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java index 9dd592c3f42b..848698f72f2a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java @@ -86,18 +86,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListAcceleratorTypesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; AcceleratorTypesScopedList itemsItem = AcceleratorTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); AcceleratorTypeAggregatedList expectedResponse = AcceleratorTypeAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -149,24 +149,24 @@ public void aggregatedListAcceleratorTypesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getAcceleratorTypeTest() { - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; - Integer maximumCardsPerInstance = 1883669166; String id = "id3355"; + String kind = "kind3292052"; + Integer maximumCardsPerInstance = 1883669166; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); AcceleratorType expectedResponse = AcceleratorType.newBuilder() - .setZone(zone.toString()) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) - .setMaximumCardsPerInstance(maximumCardsPerInstance) .setId(id) + .setKind(kind) + .setMaximumCardsPerInstance(maximumCardsPerInstance) + .setName(name) .setSelfLink(selfLink) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -213,17 +213,17 @@ public void getAcceleratorTypeExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listAcceleratorTypesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; AcceleratorType itemsElement = AcceleratorType.newBuilder().build(); List items = Arrays.asList(itemsElement); AcceleratorTypeList expectedResponse = AcceleratorTypeList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index 5e93ed070f5c..5e5953c1b481 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListAddressesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; AddressesScopedList itemsItem = AddressesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); AddressAggregatedList expectedResponse = AddressAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -153,50 +153,50 @@ public void aggregatedListAddressesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteAddressTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -247,31 +247,31 @@ public void deleteAddressExceptionTest() throws Exception { public void getAddressTest() { ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String addressType = "addressType264307877"; - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String selfLink = "selfLink-1691268851"; + String id = "id3355"; String ipVersion = "ipVersion-1315653184"; - ProjectRegionSubnetworkName subnetwork = - ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String name = "name3373707"; - String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; String status = "status-892481550"; + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) .setAddressType(addressType) - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setSelfLink(selfLink) + .setId(id) .setIpVersion(ipVersion) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setName(name) - .setId(id) .setRegion(region.toString()) + .setSelfLink(selfLink) .setStatus(status) + .setSubnetwork(subnetwork.toString()) .build(); mockService.addResponse(expectedResponse); @@ -318,50 +318,50 @@ public void getAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertAddressTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -410,17 +410,17 @@ public void insertAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listAddressesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Address itemsElement = Address.newBuilder().build(); List

items = Arrays.asList(itemsElement); AddressList expectedResponse = AddressList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index d7980716d32a..e41c11923d1d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -94,18 +94,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListAutoscalersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; AutoscalersScopedList itemsItem = AutoscalersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); AutoscalerAggregatedList expectedResponse = AutoscalerAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -157,50 +157,50 @@ public void aggregatedListAutoscalersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -249,28 +249,28 @@ public void deleteAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getAutoscalerTest() { - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; String target = "target-880905839"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler expectedResponse = Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) .setTarget(target) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -317,50 +317,50 @@ public void getAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -409,17 +409,17 @@ public void insertAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listAutoscalersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); AutoscalerList expectedResponse = AutoscalerList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -469,50 +469,50 @@ public void listAutoscalersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -564,50 +564,50 @@ public void patchAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java index f20900a4e2b2..7bf88dc7603c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteBackendBucketTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -182,22 +182,22 @@ public void deleteBackendBucketExceptionTest() throws Exception { @SuppressWarnings("all") public void getBackendBucketTest() { String bucketName = "bucketName283610048"; - Boolean enableCdn = false; - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; + Boolean enableCdn = false; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; BackendBucket expectedResponse = BackendBucket.newBuilder() .setBucketName(bucketName) - .setEnableCdn(enableCdn) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) + .setEnableCdn(enableCdn) .setId(id) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -245,50 +245,50 @@ public void getBackendBucketExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertBackendBucketTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -338,17 +338,17 @@ public void insertBackendBucketExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listBackendBucketsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendBucket itemsElement = BackendBucket.newBuilder().build(); List items = Arrays.asList(itemsElement); BackendBucketList expectedResponse = BackendBucketList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -398,50 +398,50 @@ public void listBackendBucketsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchBackendBucketTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -493,50 +493,50 @@ public void patchBackendBucketExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateBackendBucketTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index 95e69a22696b..08a4fb83ec4c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -96,18 +96,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListBackendServicesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendServicesScopedList itemsItem = BackendServicesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); BackendServiceAggregatedList expectedResponse = BackendServiceAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -159,50 +159,50 @@ public void aggregatedListBackendServicesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -252,39 +252,39 @@ public void deleteBackendServiceExceptionTest() throws Exception { @SuppressWarnings("all") public void getBackendServiceTest() { Integer affinityCookieTtlSec = 1777486694; - String kind = "kind3292052"; - String sessionAffinity = "sessionAffinity1000759473"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String loadBalancingScheme = "loadBalancingScheme1974502980"; - String portName = "portName1115276169"; - Integer timeoutSec = 2067488653; - String selfLink = "selfLink-1691268851"; - String protocol = "protocol-989163880"; Boolean enableCDN = false; - Integer port = 3446913; - String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; String id = "id3355"; + String kind = "kind3292052"; + String loadBalancingScheme = "loadBalancingScheme1974502980"; + String name = "name3373707"; + Integer port = 3446913; + String portName = "portName1115276169"; + String protocol = "protocol-989163880"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String sessionAffinity = "sessionAffinity1000759473"; + Integer timeoutSec = 2067488653; BackendService expectedResponse = BackendService.newBuilder() .setAffinityCookieTtlSec(affinityCookieTtlSec) - .setKind(kind) - .setSessionAffinity(sessionAffinity) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setLoadBalancingScheme(loadBalancingScheme) - .setPortName(portName) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setProtocol(protocol) .setEnableCDN(enableCDN) - .setPort(port) - .setCreationTimestamp(creationTimestamp) .setFingerprint(fingerprint) - .setName(name) .setId(id) + .setKind(kind) + .setLoadBalancingScheme(loadBalancingScheme) + .setName(name) + .setPort(port) + .setPortName(portName) + .setProtocol(protocol) .setRegion(region.toString()) + .setSelfLink(selfLink) + .setSessionAffinity(sessionAffinity) + .setTimeoutSec(timeoutSec) .build(); mockService.addResponse(expectedResponse); @@ -384,50 +384,50 @@ public void getHealthBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -477,17 +477,17 @@ public void insertBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listBackendServicesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendService itemsElement = BackendService.newBuilder().build(); List items = Arrays.asList(itemsElement); BackendServiceList expectedResponse = BackendServiceList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -537,50 +537,50 @@ public void listBackendServicesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -632,50 +632,50 @@ public void patchBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 5a69e0cf4f9a..c71464e2913b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -96,18 +96,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListDisksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; DisksScopedList itemsItem = DisksScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); DiskAggregatedList expectedResponse = DiskAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -158,50 +158,50 @@ public void aggregatedListDisksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void createSnapshotDiskTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -253,50 +253,50 @@ public void createSnapshotDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteDiskTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -343,44 +343,44 @@ public void deleteDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getDiskTest() { - String sizeGb = "sizeGb2105542105"; - String sourceSnapshotId = "sourceSnapshotId-1511650478"; - String lastDetachTimestamp = "lastDetachTimestamp-480399885"; - String description = "description-1724546052"; - String sourceSnapshot = "sourceSnapshot-947679896"; - String type = "type3575610"; - String labelFingerprint = "labelFingerprint714995737"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String creationTimestamp = "creationTimestamp567396278"; - String options = "options-1249474914"; + String description = "description-1724546052"; String id = "id3355"; - String sourceImageId = "sourceImageId-2092155357"; String kind = "kind3292052"; + String labelFingerprint = "labelFingerprint714995737"; String lastAttachTimestamp = "lastAttachTimestamp-2105323995"; - String selfLink = "selfLink-1691268851"; + String lastDetachTimestamp = "lastDetachTimestamp-480399885"; String name = "name3373707"; + String options = "options-1249474914"; + String selfLink = "selfLink-1691268851"; + String sizeGb = "sizeGb2105542105"; String sourceImage = "sourceImage1661056055"; + String sourceImageId = "sourceImageId-2092155357"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; String status = "status-892481550"; + String type = "type3575610"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Disk expectedResponse = Disk.newBuilder() - .setSizeGb(sizeGb) - .setSourceSnapshotId(sourceSnapshotId) - .setLastDetachTimestamp(lastDetachTimestamp) - .setDescription(description) - .setSourceSnapshot(sourceSnapshot) - .setType(type) - .setLabelFingerprint(labelFingerprint) - .setZone(zone.toString()) .setCreationTimestamp(creationTimestamp) - .setOptions(options) + .setDescription(description) .setId(id) - .setSourceImageId(sourceImageId) .setKind(kind) + .setLabelFingerprint(labelFingerprint) .setLastAttachTimestamp(lastAttachTimestamp) - .setSelfLink(selfLink) + .setLastDetachTimestamp(lastDetachTimestamp) .setName(name) + .setOptions(options) + .setSelfLink(selfLink) + .setSizeGb(sizeGb) .setSourceImage(sourceImage) + .setSourceImageId(sourceImageId) + .setSourceSnapshot(sourceSnapshot) + .setSourceSnapshotId(sourceSnapshotId) .setStatus(status) + .setType(type) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -425,50 +425,50 @@ public void getDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertDiskTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -519,17 +519,17 @@ public void insertDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listDisksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Disk itemsElement = Disk.newBuilder().build(); List items = Arrays.asList(itemsElement); DiskList expectedResponse = DiskList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -579,50 +579,50 @@ public void listDisksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void resizeDiskTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -671,50 +671,50 @@ public void resizeDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsDiskTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java index 7459f7997e95..8d7d402c9932 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java @@ -86,18 +86,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListDiskTypesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; DiskTypesScopedList itemsItem = DiskTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); DiskTypeAggregatedList expectedResponse = DiskTypeAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -149,26 +149,26 @@ public void aggregatedListDiskTypesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getDiskTypeTest() { - String defaultDiskSizeGb = "defaultDiskSizeGb807490165"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; + String defaultDiskSizeGb = "defaultDiskSizeGb807490165"; String description = "description-1724546052"; String id = "id3355"; - String validDiskSize = "validDiskSize-1653521184"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + String validDiskSize = "validDiskSize-1653521184"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); DiskType expectedResponse = DiskType.newBuilder() - .setDefaultDiskSizeGb(defaultDiskSizeGb) - .setZone(zone.toString()) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) + .setDefaultDiskSizeGb(defaultDiskSizeGb) .setDescription(description) .setId(id) - .setValidDiskSize(validDiskSize) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) + .setValidDiskSize(validDiskSize) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -215,17 +215,17 @@ public void getDiskTypeExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listDiskTypesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; DiskType itemsElement = DiskType.newBuilder().build(); List items = Arrays.asList(itemsElement); DiskTypeList expectedResponse = DiskTypeList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java index 9532b1fe0654..7b42faae9039 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteFirewallTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -179,26 +179,26 @@ public void deleteFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getFirewallTest() { - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - Integer priority = 1165461084; + String direction = "direction-962590849"; + String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + Integer priority = 1165461084; String selfLink = "selfLink-1691268851"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; - String id = "id3355"; - String direction = "direction-962590849"; Firewall expectedResponse = Firewall.newBuilder() - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setPriority(priority) + .setDirection(direction) + .setId(id) + .setKind(kind) + .setName(name) .setNetwork(network.toString()) + .setPriority(priority) .setSelfLink(selfLink) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setDirection(direction) .build(); mockService.addResponse(expectedResponse); @@ -243,50 +243,50 @@ public void getFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertFirewallTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -335,17 +335,17 @@ public void insertFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listFirewallsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Firewall itemsElement = Firewall.newBuilder().build(); List items = Arrays.asList(itemsElement); FirewallList expectedResponse = FirewallList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -395,50 +395,50 @@ public void listFirewallsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchFirewallTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -487,50 +487,50 @@ public void patchFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateFirewallTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 276fe84f04fc..10be81e2f910 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -92,18 +92,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListForwardingRulesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; ForwardingRulesScopedList itemsItem = ForwardingRulesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); ForwardingRuleAggregatedList expectedResponse = ForwardingRuleAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -155,50 +155,50 @@ public void aggregatedListForwardingRulesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteForwardingRuleTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -247,42 +247,42 @@ public void deleteForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getForwardingRuleTest() { - String portRange = "portRange217518079"; - String kind = "kind3292052"; + String iPAddress = "iPAddress-551149873"; String iPProtocol = "iPProtocol323774237"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; + String id = "id3355"; + String ipVersion = "ipVersion-1315653184"; + String kind = "kind3292052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + String portRange = "portRange217518079"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; - String target = "target-880905839"; - String ipVersion = "ipVersion-1315653184"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; - String id = "id3355"; - String iPAddress = "iPAddress-551149873"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String target = "target-880905839"; ForwardingRule expectedResponse = ForwardingRule.newBuilder() - .setPortRange(portRange) - .setKind(kind) + .setIPAddress(iPAddress) .setIPProtocol(iPProtocol) .setBackendService(backendService.toString()) + .setCreationTimestamp(creationTimestamp) .setDescription(description) + .setId(id) + .setIpVersion(ipVersion) + .setKind(kind) .setLoadBalancingScheme(loadBalancingScheme) + .setName(name) .setNetwork(network.toString()) + .setPortRange(portRange) + .setRegion(region.toString()) .setSelfLink(selfLink) - .setTarget(target) - .setIpVersion(ipVersion) .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setIPAddress(iPAddress) - .setRegion(region.toString()) + .setTarget(target) .build(); mockService.addResponse(expectedResponse); @@ -329,50 +329,50 @@ public void getForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertForwardingRuleTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -422,17 +422,17 @@ public void insertForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listForwardingRulesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); List items = Arrays.asList(itemsElement); ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -482,50 +482,50 @@ public void listForwardingRulesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setTargetForwardingRuleTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index b421f542bb85..828da82fe12c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteGlobalAddressTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -177,31 +177,31 @@ public void deleteGlobalAddressExceptionTest() throws Exception { public void getGlobalAddressTest() { ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String addressType = "addressType264307877"; - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String selfLink = "selfLink-1691268851"; + String id = "id3355"; String ipVersion = "ipVersion-1315653184"; - ProjectRegionSubnetworkName subnetwork = - ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String name = "name3373707"; - String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; String status = "status-892481550"; + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) .setAddressType(addressType) - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setSelfLink(selfLink) + .setId(id) .setIpVersion(ipVersion) - .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setName(name) - .setId(id) .setRegion(region.toString()) + .setSelfLink(selfLink) .setStatus(status) + .setSubnetwork(subnetwork.toString()) .build(); mockService.addResponse(expectedResponse); @@ -246,50 +246,50 @@ public void getGlobalAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertGlobalAddressTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -338,17 +338,17 @@ public void insertGlobalAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listGlobalAddressesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Address itemsElement = Address.newBuilder().build(); List
items = Arrays.asList(itemsElement); AddressList expectedResponse = AddressList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index 3304df1a2989..4799cd2f6d19 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -88,50 +88,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteGlobalForwardingRuleTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -180,42 +180,42 @@ public void deleteGlobalForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getGlobalForwardingRuleTest() { - String portRange = "portRange217518079"; - String kind = "kind3292052"; + String iPAddress = "iPAddress-551149873"; String iPProtocol = "iPProtocol323774237"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; + String id = "id3355"; + String ipVersion = "ipVersion-1315653184"; + String kind = "kind3292052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + String portRange = "portRange217518079"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; - String target = "target-880905839"; - String ipVersion = "ipVersion-1315653184"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; - String id = "id3355"; - String iPAddress = "iPAddress-551149873"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String target = "target-880905839"; ForwardingRule expectedResponse = ForwardingRule.newBuilder() - .setPortRange(portRange) - .setKind(kind) + .setIPAddress(iPAddress) .setIPProtocol(iPProtocol) .setBackendService(backendService.toString()) + .setCreationTimestamp(creationTimestamp) .setDescription(description) + .setId(id) + .setIpVersion(ipVersion) + .setKind(kind) .setLoadBalancingScheme(loadBalancingScheme) + .setName(name) .setNetwork(network.toString()) + .setPortRange(portRange) + .setRegion(region.toString()) .setSelfLink(selfLink) - .setTarget(target) - .setIpVersion(ipVersion) .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setIPAddress(iPAddress) - .setRegion(region.toString()) + .setTarget(target) .build(); mockService.addResponse(expectedResponse); @@ -262,50 +262,50 @@ public void getGlobalForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertGlobalForwardingRuleTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -355,17 +355,17 @@ public void insertGlobalForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listGlobalForwardingRulesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); List items = Arrays.asList(itemsElement); ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -416,50 +416,50 @@ public void listGlobalForwardingRulesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setTargetGlobalForwardingRuleTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java index fa158abe61d9..0bda5aacd61d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java @@ -88,18 +88,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListGlobalOperationsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; OperationsScopedList itemsItem = OperationsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); OperationAggregatedList expectedResponse = OperationAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -195,50 +195,50 @@ public void deleteGlobalOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getGlobalOperationTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -285,17 +285,17 @@ public void getGlobalOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listGlobalOperationsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); OperationList expectedResponse = OperationList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java index 7a83cf68696e..fea2cf4132eb 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -182,29 +182,29 @@ public void deleteHealthCheckExceptionTest() throws Exception { @SuppressWarnings("all") public void getHealthCheckTest() { Integer checkIntervalSec = 345561006; - String kind = "kind3292052"; - String description = "description-1724546052"; - String type = "type3575610"; - Integer timeoutSec = 2067488653; - String selfLink = "selfLink-1691268851"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; - Integer unhealthyThreshold = 1838571216; + String description = "description-1724546052"; Integer healthyThreshold = 133658551; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; + String selfLink = "selfLink-1691268851"; + Integer timeoutSec = 2067488653; + String type = "type3575610"; + Integer unhealthyThreshold = 1838571216; HealthCheck expectedResponse = HealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) - .setKind(kind) - .setDescription(description) - .setType(type) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) .setCreationTimestamp(creationTimestamp) - .setName(name) - .setUnhealthyThreshold(unhealthyThreshold) + .setDescription(description) .setHealthyThreshold(healthyThreshold) .setId(id) + .setKind(kind) + .setName(name) + .setSelfLink(selfLink) + .setTimeoutSec(timeoutSec) + .setType(type) + .setUnhealthyThreshold(unhealthyThreshold) .build(); mockService.addResponse(expectedResponse); @@ -251,50 +251,50 @@ public void getHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -343,17 +343,17 @@ public void insertHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listHealthChecksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; HealthCheck itemsElement = HealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); HealthCheckList expectedResponse = HealthCheckList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -403,50 +403,50 @@ public void listHealthChecksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -497,50 +497,50 @@ public void patchHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index 77f3d4937785..2f031b4c27be 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteHttpHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -182,33 +182,33 @@ public void deleteHttpHealthCheckExceptionTest() throws Exception { @SuppressWarnings("all") public void getHttpHealthCheckTest() { Integer checkIntervalSec = 345561006; - String kind = "kind3292052"; - String description = "description-1724546052"; - Integer timeoutSec = 2067488653; - String selfLink = "selfLink-1691268851"; - Integer port = 3446913; String creationTimestamp = "creationTimestamp567396278"; - String host = "host3208616"; - String name = "name3373707"; - Integer unhealthyThreshold = 1838571216; + String description = "description-1724546052"; Integer healthyThreshold = 133658551; + String host = "host3208616"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; + Integer port = 3446913; String requestPath = "requestPath1303145429"; + String selfLink = "selfLink-1691268851"; + Integer timeoutSec = 2067488653; + Integer unhealthyThreshold = 1838571216; HttpHealthCheck expectedResponse = HttpHealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) - .setKind(kind) - .setDescription(description) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setPort(port) .setCreationTimestamp(creationTimestamp) - .setHost(host) - .setName(name) - .setUnhealthyThreshold(unhealthyThreshold) + .setDescription(description) .setHealthyThreshold(healthyThreshold) + .setHost(host) .setId(id) + .setKind(kind) + .setName(name) + .setPort(port) .setRequestPath(requestPath) + .setSelfLink(selfLink) + .setTimeoutSec(timeoutSec) + .setUnhealthyThreshold(unhealthyThreshold) .build(); mockService.addResponse(expectedResponse); @@ -255,50 +255,50 @@ public void getHttpHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertHttpHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -348,17 +348,17 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listHttpHealthChecksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -408,50 +408,50 @@ public void listHttpHealthChecksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchHttpHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -503,50 +503,50 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateHttpHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index d4eb7be0cc59..1962d150cf47 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteHttpsHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -182,33 +182,33 @@ public void deleteHttpsHealthCheckExceptionTest() throws Exception { @SuppressWarnings("all") public void getHttpsHealthCheckTest() { Integer checkIntervalSec = 345561006; - String kind = "kind3292052"; - String description = "description-1724546052"; - Integer timeoutSec = 2067488653; - String selfLink = "selfLink-1691268851"; - Integer port = 3446913; String creationTimestamp = "creationTimestamp567396278"; - String host = "host3208616"; - String name = "name3373707"; - Integer unhealthyThreshold = 1838571216; + String description = "description-1724546052"; Integer healthyThreshold = 133658551; + String host = "host3208616"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; + Integer port = 3446913; String requestPath = "requestPath1303145429"; + String selfLink = "selfLink-1691268851"; + Integer timeoutSec = 2067488653; + Integer unhealthyThreshold = 1838571216; HttpsHealthCheck expectedResponse = HttpsHealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) - .setKind(kind) - .setDescription(description) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setPort(port) .setCreationTimestamp(creationTimestamp) - .setHost(host) - .setName(name) - .setUnhealthyThreshold(unhealthyThreshold) + .setDescription(description) .setHealthyThreshold(healthyThreshold) + .setHost(host) .setId(id) + .setKind(kind) + .setName(name) + .setPort(port) .setRequestPath(requestPath) + .setSelfLink(selfLink) + .setTimeoutSec(timeoutSec) + .setUnhealthyThreshold(unhealthyThreshold) .build(); mockService.addResponse(expectedResponse); @@ -255,50 +255,50 @@ public void getHttpsHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertHttpsHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -348,17 +348,17 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listHttpsHealthChecksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -408,50 +408,50 @@ public void listHttpsHealthChecksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchHttpsHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -503,50 +503,50 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateHttpsHealthCheckTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index 16fe02854a71..e7209818cf9a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -91,50 +91,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteImageTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -181,50 +181,50 @@ public void deleteImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deprecateImageTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -273,43 +273,43 @@ public void deprecateImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getImageTest() { - String sourceSnapshotId = "sourceSnapshotId-1511650478"; - String description = "description-1724546052"; - String sourceSnapshot = "sourceSnapshot-947679896"; - String labelFingerprint = "labelFingerprint714995737"; + String archiveSizeBytes = "archiveSizeBytes-1766390198"; String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; + String diskSizeGb = "diskSizeGb-757478089"; + ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); String id = "id3355"; + String kind = "kind3292052"; + String labelFingerprint = "labelFingerprint714995737"; + String name = "name3373707"; + String selfLink = "selfLink-1691268851"; String sourceDisk = "sourceDisk-85117119"; String sourceDiskId = "sourceDiskId-1693292839"; + String sourceImage = "sourceImage1661056055"; String sourceImageId = "sourceImageId-2092155357"; - String kind = "kind3292052"; - String selfLink = "selfLink-1691268851"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; String sourceType = "sourceType-84625186"; - String name = "name3373707"; - String archiveSizeBytes = "archiveSizeBytes-1766390198"; - String sourceImage = "sourceImage1661056055"; - ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); - String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; Image expectedResponse = Image.newBuilder() - .setSourceSnapshotId(sourceSnapshotId) - .setDescription(description) - .setSourceSnapshot(sourceSnapshot) - .setLabelFingerprint(labelFingerprint) + .setArchiveSizeBytes(archiveSizeBytes) .setCreationTimestamp(creationTimestamp) + .setDescription(description) + .setDiskSizeGb(diskSizeGb) + .setFamily(family.toString()) .setId(id) + .setKind(kind) + .setLabelFingerprint(labelFingerprint) + .setName(name) + .setSelfLink(selfLink) .setSourceDisk(sourceDisk) .setSourceDiskId(sourceDiskId) + .setSourceImage(sourceImage) .setSourceImageId(sourceImageId) - .setKind(kind) - .setSelfLink(selfLink) + .setSourceSnapshot(sourceSnapshot) + .setSourceSnapshotId(sourceSnapshotId) .setSourceType(sourceType) - .setName(name) - .setArchiveSizeBytes(archiveSizeBytes) - .setSourceImage(sourceImage) - .setFamily(family.toString()) - .setDiskSizeGb(diskSizeGb) .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -355,43 +355,43 @@ public void getImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getFromFamilyImageTest() { - String sourceSnapshotId = "sourceSnapshotId-1511650478"; - String description = "description-1724546052"; - String sourceSnapshot = "sourceSnapshot-947679896"; - String labelFingerprint = "labelFingerprint714995737"; + String archiveSizeBytes = "archiveSizeBytes-1766390198"; String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; + String diskSizeGb = "diskSizeGb-757478089"; + ProjectGlobalImageFamilyName family2 = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); String id = "id3355"; + String kind = "kind3292052"; + String labelFingerprint = "labelFingerprint714995737"; + String name = "name3373707"; + String selfLink = "selfLink-1691268851"; String sourceDisk = "sourceDisk-85117119"; String sourceDiskId = "sourceDiskId-1693292839"; + String sourceImage = "sourceImage1661056055"; String sourceImageId = "sourceImageId-2092155357"; - String kind = "kind3292052"; - String selfLink = "selfLink-1691268851"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; String sourceType = "sourceType-84625186"; - String name = "name3373707"; - String archiveSizeBytes = "archiveSizeBytes-1766390198"; - String sourceImage = "sourceImage1661056055"; - ProjectGlobalImageFamilyName family2 = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); - String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; Image expectedResponse = Image.newBuilder() - .setSourceSnapshotId(sourceSnapshotId) - .setDescription(description) - .setSourceSnapshot(sourceSnapshot) - .setLabelFingerprint(labelFingerprint) + .setArchiveSizeBytes(archiveSizeBytes) .setCreationTimestamp(creationTimestamp) + .setDescription(description) + .setDiskSizeGb(diskSizeGb) + .setFamily(family2.toString()) .setId(id) + .setKind(kind) + .setLabelFingerprint(labelFingerprint) + .setName(name) + .setSelfLink(selfLink) .setSourceDisk(sourceDisk) .setSourceDiskId(sourceDiskId) + .setSourceImage(sourceImage) .setSourceImageId(sourceImageId) - .setKind(kind) - .setSelfLink(selfLink) + .setSourceSnapshot(sourceSnapshot) + .setSourceSnapshotId(sourceSnapshotId) .setSourceType(sourceType) - .setName(name) - .setArchiveSizeBytes(archiveSizeBytes) - .setSourceImage(sourceImage) - .setFamily(family2.toString()) - .setDiskSizeGb(diskSizeGb) .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -438,50 +438,50 @@ public void getFromFamilyImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertImageTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -532,17 +532,17 @@ public void insertImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listImagesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Image itemsElement = Image.newBuilder().build(); List items = Arrays.asList(itemsElement); ImageList expectedResponse = ImageList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -592,50 +592,50 @@ public void listImagesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsImageTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index ccc9b8b8c3ef..92d969d8822b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -135,50 +135,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addAccessConfigInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -232,18 +232,18 @@ public void addAccessConfigInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListInstancesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstancesScopedList itemsItem = InstancesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); InstanceAggregatedList expectedResponse = InstanceAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -295,50 +295,50 @@ public void aggregatedListInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void attachDiskInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -389,50 +389,50 @@ public void attachDiskInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -481,50 +481,50 @@ public void deleteInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteAccessConfigInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -578,50 +578,50 @@ public void deleteAccessConfigInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void detachDiskInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -673,40 +673,40 @@ public void detachDiskInstanceExceptionTest() throws Exception { @SuppressWarnings("all") public void getInstanceTest() { Boolean canIpForward = true; - String kind = "kind3292052"; - String description = "description-1724546052"; String cpuPlatform = "cpuPlatform947156266"; - Boolean startRestricted = true; - String labelFingerprint = "labelFingerprint714995737"; - String statusMessage = "statusMessage-239442758"; - Boolean deletionProtection = true; - String selfLink = "selfLink-1691268851"; - String minCpuPlatform = "minCpuPlatform-1367699977"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; + Boolean deletionProtection = true; + String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String labelFingerprint = "labelFingerprint714995737"; ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); + String minCpuPlatform = "minCpuPlatform-1367699977"; + String name = "name3373707"; + String selfLink = "selfLink-1691268851"; + Boolean startRestricted = true; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Instance expectedResponse = Instance.newBuilder() .setCanIpForward(canIpForward) - .setKind(kind) - .setDescription(description) .setCpuPlatform(cpuPlatform) - .setStartRestricted(startRestricted) - .setLabelFingerprint(labelFingerprint) - .setStatusMessage(statusMessage) - .setDeletionProtection(deletionProtection) - .setSelfLink(selfLink) - .setMinCpuPlatform(minCpuPlatform) - .setZone(zone.toString()) .setCreationTimestamp(creationTimestamp) - .setName(name) + .setDeletionProtection(deletionProtection) + .setDescription(description) .setId(id) + .setKind(kind) + .setLabelFingerprint(labelFingerprint) .setMachineType(machineType.toString()) + .setMinCpuPlatform(minCpuPlatform) + .setName(name) + .setSelfLink(selfLink) + .setStartRestricted(startRestricted) .setStatus(status) + .setStatusMessage(statusMessage) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -753,18 +753,18 @@ public void getInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSerialPortOutputInstanceTest() { - String next = "next3377907"; String contents = "contents-567321830"; String kind = "kind3292052"; - String start2 = "start2-1897185387"; + String next = "next3377907"; String selfLink = "selfLink-1691268851"; + String start2 = "start2-1897185387"; SerialPortOutput expectedResponse = SerialPortOutput.newBuilder() - .setNext(next) .setContents(contents) .setKind(kind) - .setStart(start2) + .setNext(next) .setSelfLink(selfLink) + .setStart(start2) .build(); mockService.addResponse(expectedResponse); @@ -815,50 +815,50 @@ public void getSerialPortOutputInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -910,17 +910,17 @@ public void insertInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstancesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Instance itemsElement = Instance.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceList expectedResponse = InstanceList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -970,17 +970,17 @@ public void listInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listReferrersInstancesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Reference itemsElement = Reference.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceListReferrers expectedResponse = InstanceListReferrers.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -1032,50 +1032,50 @@ public void listReferrersInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void resetInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1124,50 +1124,50 @@ public void resetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setDeletionProtectionInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1219,50 +1219,50 @@ public void setDeletionProtectionInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setDiskAutoDeleteInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1316,50 +1316,50 @@ public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1413,50 +1413,50 @@ public void setLabelsInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMachineResourcesInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1512,50 +1512,50 @@ public void setMachineResourcesInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMachineTypeInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1609,50 +1609,50 @@ public void setMachineTypeInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMetadataInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1703,50 +1703,50 @@ public void setMetadataInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMinCpuPlatformInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1802,50 +1802,50 @@ public void setMinCpuPlatformInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSchedulingInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1897,50 +1897,50 @@ public void setSchedulingInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setServiceAccountInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1996,50 +1996,50 @@ public void setServiceAccountInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setTagsInstanceTest() { + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; + String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; - String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -2090,50 +2090,50 @@ public void setTagsInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void startInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -2182,50 +2182,50 @@ public void startInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void startWithEncryptionKeyInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -2281,50 +2281,50 @@ public void startWithEncryptionKeyInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void stopInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -2373,50 +2373,50 @@ public void stopInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateAccessConfigInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -2472,50 +2472,50 @@ public void updateAccessConfigInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateNetworkInterfaceInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index 42f45526f10e..e14ffe7f673b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -99,50 +99,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addInstancesInstanceGroupTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -198,18 +198,18 @@ public void addInstancesInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupsScopedList itemsItem = InstanceGroupsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); InstanceGroupAggregatedList expectedResponse = InstanceGroupAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -261,50 +261,50 @@ public void aggregatedListInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstanceGroupTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -353,33 +353,33 @@ public void deleteInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getInstanceGroupTest() { - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; + String fingerprint = "fingerprint-1375934236"; + String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Integer size = 3530753; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String creationTimestamp = "creationTimestamp567396278"; - String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; - String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) + .setFingerprint(fingerprint) + .setId(id) + .setKind(kind) + .setName(name) .setNetwork(network.toString()) + .setRegion(region.toString()) .setSelfLink(selfLink) .setSize(size) - .setZone(zone.toString()) .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -426,50 +426,50 @@ public void getInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceGroupTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -518,17 +518,17 @@ public void insertInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstanceGroupsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceGroupList expectedResponse = InstanceGroupList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -578,17 +578,17 @@ public void listInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstancesInstanceGroupsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceGroupsListInstances expectedResponse = InstanceGroupsListInstances.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -646,50 +646,50 @@ public void listInstancesInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removeInstancesInstanceGroupTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -745,50 +745,50 @@ public void removeInstancesInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setNamedPortsInstanceGroupTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index beefb93d91ef..03d06be68ec5 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -105,50 +105,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void abandonInstancesInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -206,9 +206,9 @@ public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupManagersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupManagersScopedList itemsItem = InstanceGroupManagersScopedList.newBuilder().build(); @@ -216,9 +216,9 @@ public void aggregatedListInstanceGroupManagersTest() { items.put("items", itemsItem); InstanceGroupManagerAggregatedList expectedResponse = InstanceGroupManagerAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -271,50 +271,50 @@ public void aggregatedListInstanceGroupManagersExceptionTest() throws Exception @Test @SuppressWarnings("all") public void deleteInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -363,50 +363,50 @@ public void deleteInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstancesInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -464,36 +464,36 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception @Test @SuppressWarnings("all") public void getInstanceGroupManagerTest() { - ProjectGlobalInstanceTemplateName instanceTemplate = - ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - String kind = "kind3292052"; - String description = "description-1724546052"; String baseInstanceName = "baseInstanceName389106439"; + String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; + String fingerprint = "fingerprint-1375934236"; + String id = "id3355"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + String kind = "kind3292052"; + String name = "name3373707"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Integer targetSize = 2084603409; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String creationTimestamp = "creationTimestamp567396278"; - String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; - String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() - .setInstanceTemplate(instanceTemplate.toString()) - .setKind(kind) - .setDescription(description) .setBaseInstanceName(baseInstanceName) - .setInstanceGroup(instanceGroup.toString()) - .setSelfLink(selfLink) - .setTargetSize(targetSize) - .setZone(zone.toString()) .setCreationTimestamp(creationTimestamp) + .setDescription(description) .setFingerprint(fingerprint) - .setName(name) .setId(id) + .setInstanceGroup(instanceGroup.toString()) + .setInstanceTemplate(instanceTemplate.toString()) + .setKind(kind) + .setName(name) .setRegion(region.toString()) + .setSelfLink(selfLink) + .setTargetSize(targetSize) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -540,50 +540,50 @@ public void getInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) + .setClientOperationId(clientOperationId) .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) + .setDescription(description) .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) + .setHttpErrorStatusCode(httpErrorStatusCode) .setId(id) + .setInsertTime(insertTime) + .setKind(kind) + .setName(name) + .setOperationType(operationType) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -633,17 +633,17 @@ public void insertInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstanceGroupManagersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceGroupManagerList expectedResponse = InstanceGroupManagerList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -742,50 +742,50 @@ public void listManagedInstancesInstanceGroupManagersExceptionTest() throws Exce @Test @SuppressWarnings("all") public void recreateInstancesInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -843,50 +843,50 @@ public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exceptio @Test @SuppressWarnings("all") public void resizeInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -938,50 +938,50 @@ public void resizeInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setInstanceTemplateInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -1041,50 +1041,50 @@ public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Except @Test @SuppressWarnings("all") public void setTargetPoolsInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index cdd2a199e6d5..5ea4515fa442 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteInstanceTemplateTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -177,19 +177,19 @@ public void deleteInstanceTemplateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getInstanceTemplateTest() { - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; InstanceTemplate expectedResponse = InstanceTemplate.newBuilder() - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -237,50 +237,50 @@ public void getInstanceTemplateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceTemplateTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -330,17 +330,17 @@ public void insertInstanceTemplateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstanceTemplatesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceTemplate itemsElement = InstanceTemplate.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceTemplateList expectedResponse = InstanceTemplateList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java index 23dab449c76a..bcc3820cc148 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java @@ -91,9 +91,9 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListInterconnectAttachmentsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InterconnectAttachmentsScopedList itemsItem = InterconnectAttachmentsScopedList.newBuilder().build(); @@ -101,9 +101,9 @@ public void aggregatedListInterconnectAttachmentsTest() { items.put("items", itemsItem); InterconnectAttachmentAggregatedList expectedResponse = InterconnectAttachmentAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -156,50 +156,50 @@ public void aggregatedListInterconnectAttachmentsExceptionTest() throws Exceptio @Test @SuppressWarnings("all") public void deleteInterconnectAttachmentTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -252,35 +252,35 @@ public void deleteInterconnectAttachmentExceptionTest() throws Exception { @SuppressWarnings("all") public void getInterconnectAttachmentTest() { String cloudRouterIpAddress = "cloudRouterIpAddress1361134600"; - String operationalStatus = "operationalStatus1274812671"; - String kind = "kind3292052"; - String googleReferenceId = "googleReferenceId534944469"; + String creationTimestamp = "creationTimestamp567396278"; + String customerRouterIpAddress = "customerRouterIpAddress-741266063"; String description = "description-1724546052"; + String googleReferenceId = "googleReferenceId534944469"; + String id = "id3355"; ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); - String customerRouterIpAddress = "customerRouterIpAddress-741266063"; - String selfLink = "selfLink-1691268851"; - ProjectRegionRouterName router = - ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String name = "name3373707"; - String id = "id3355"; + String operationalStatus = "operationalStatus1274812671"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String selfLink = "selfLink-1691268851"; InterconnectAttachment expectedResponse = InterconnectAttachment.newBuilder() .setCloudRouterIpAddress(cloudRouterIpAddress) - .setOperationalStatus(operationalStatus) - .setKind(kind) - .setGoogleReferenceId(googleReferenceId) + .setCreationTimestamp(creationTimestamp) + .setCustomerRouterIpAddress(customerRouterIpAddress) .setDescription(description) + .setGoogleReferenceId(googleReferenceId) + .setId(id) .setInterconnect(interconnect.toString()) - .setCustomerRouterIpAddress(customerRouterIpAddress) - .setSelfLink(selfLink) - .setRouter(router.toString()) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setName(name) - .setId(id) + .setOperationalStatus(operationalStatus) .setRegion(region.toString()) + .setRouter(router.toString()) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -330,50 +330,50 @@ public void getInterconnectAttachmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInterconnectAttachmentTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -425,17 +425,17 @@ public void insertInterconnectAttachmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInterconnectAttachmentsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InterconnectAttachment itemsElement = InterconnectAttachment.newBuilder().build(); List items = Arrays.asList(itemsElement); InterconnectAttachmentList expectedResponse = InterconnectAttachmentList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java index 730a1e91e71a..75568631a30f 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java @@ -87,50 +87,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteInterconnectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -179,44 +179,44 @@ public void deleteInterconnectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getInterconnectTest() { - String operationalStatus = "operationalStatus1274812671"; - String interconnectType = "interconnectType2125777995"; - String peerIpAddress = "peerIpAddress-1939747879"; - String kind = "kind3292052"; - Integer requestedLinkCount = 1118793211; - String googleReferenceId = "googleReferenceId534944469"; - String description = "description-1724546052"; - String customerName = "customerName-2143818164"; - String selfLink = "selfLink-1691268851"; Boolean adminEnabled = false; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; + String customerName = "customerName-2143818164"; + String description = "description-1724546052"; + String googleIpAddress = "googleIpAddress1516847778"; + String googleReferenceId = "googleReferenceId534944469"; + String id = "id3355"; + String interconnectType = "interconnectType2125777995"; + String kind = "kind3292052"; String linkType = "linkType-1624275873"; String location = "location1901043637"; - Integer provisionedLinkCount = 1199724171; - String id = "id3355"; - String googleIpAddress = "googleIpAddress1516847778"; + String name = "name3373707"; String nocContactEmail = "nocContactEmail1087814656"; + String operationalStatus = "operationalStatus1274812671"; + String peerIpAddress = "peerIpAddress-1939747879"; + Integer provisionedLinkCount = 1199724171; + Integer requestedLinkCount = 1118793211; + String selfLink = "selfLink-1691268851"; Interconnect expectedResponse = Interconnect.newBuilder() - .setOperationalStatus(operationalStatus) - .setInterconnectType(interconnectType) - .setPeerIpAddress(peerIpAddress) - .setKind(kind) - .setRequestedLinkCount(requestedLinkCount) - .setGoogleReferenceId(googleReferenceId) - .setDescription(description) - .setCustomerName(customerName) - .setSelfLink(selfLink) .setAdminEnabled(adminEnabled) .setCreationTimestamp(creationTimestamp) - .setName(name) + .setCustomerName(customerName) + .setDescription(description) + .setGoogleIpAddress(googleIpAddress) + .setGoogleReferenceId(googleReferenceId) + .setId(id) + .setInterconnectType(interconnectType) + .setKind(kind) .setLinkType(linkType) .setLocation(location) - .setProvisionedLinkCount(provisionedLinkCount) - .setId(id) - .setGoogleIpAddress(googleIpAddress) + .setName(name) .setNocContactEmail(nocContactEmail) + .setOperationalStatus(operationalStatus) + .setPeerIpAddress(peerIpAddress) + .setProvisionedLinkCount(provisionedLinkCount) + .setRequestedLinkCount(requestedLinkCount) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -263,50 +263,50 @@ public void getInterconnectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInterconnectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -355,17 +355,17 @@ public void insertInterconnectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInterconnectsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Interconnect itemsElement = Interconnect.newBuilder().build(); List items = Arrays.asList(itemsElement); InterconnectList expectedResponse = InterconnectList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -415,50 +415,50 @@ public void listInterconnectsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchInterconnectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java index 47440e971a95..356a3a0f83c4 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java @@ -81,34 +81,34 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getInterconnectLocationTest() { - String continent = "continent-403427916"; ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); + String availabilityZone = "availabilityZone-378410992"; String city = "city3053931"; - String kind = "kind3292052"; + String continent = "continent-403427916"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String peeringdbFacilityId = "peeringdbFacilityId-303818"; - String availabilityZone = "availabilityZone-378410992"; - String facilityProviderFacilityId = "facilityProviderFacilityId-1523343611"; - String selfLink = "selfLink-1691268851"; String facilityProvider = "facilityProvider2143916045"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; + String facilityProviderFacilityId = "facilityProviderFacilityId-1523343611"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; + String peeringdbFacilityId = "peeringdbFacilityId-303818"; + String selfLink = "selfLink-1691268851"; InterconnectLocation expectedResponse = InterconnectLocation.newBuilder() - .setContinent(continent) .setAddress(address.toString()) + .setAvailabilityZone(availabilityZone) .setCity(city) - .setKind(kind) + .setContinent(continent) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setPeeringdbFacilityId(peeringdbFacilityId) - .setAvailabilityZone(availabilityZone) - .setFacilityProviderFacilityId(facilityProviderFacilityId) - .setSelfLink(selfLink) .setFacilityProvider(facilityProvider) - .setCreationTimestamp(creationTimestamp) - .setName(name) + .setFacilityProviderFacilityId(facilityProviderFacilityId) .setId(id) + .setKind(kind) + .setName(name) + .setPeeringdbFacilityId(peeringdbFacilityId) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -155,17 +155,17 @@ public void getInterconnectLocationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInterconnectLocationsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InterconnectLocation itemsElement = InterconnectLocation.newBuilder().build(); List items = Arrays.asList(itemsElement); InterconnectLocationList expectedResponse = InterconnectLocationList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java index ae4e7d5e7d36..60efb32d70c2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java @@ -87,50 +87,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteLicenseTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -178,26 +178,26 @@ public void deleteLicenseExceptionTest() throws Exception { @SuppressWarnings("all") public void getLicenseTest() { Boolean chargesUseFee = true; - String kind = "kind3292052"; - Boolean transferable = false; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]"); + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + Boolean transferable = false; License expectedResponse = License.newBuilder() .setChargesUseFee(chargesUseFee) - .setKind(kind) - .setTransferable(transferable) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) .setLicenseCode(licenseCode.toString()) + .setName(name) .setSelfLink(selfLink) + .setTransferable(transferable) .build(); mockService.addResponse(expectedResponse); @@ -242,50 +242,50 @@ public void getLicenseExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertLicenseTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -334,15 +334,15 @@ public void insertLicenseExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listLicensesTest() { - String nextPageToken = ""; String id = "id3355"; + String nextPageToken = ""; String selfLink = "selfLink-1691268851"; License itemsElement = License.newBuilder().build(); List items = Arrays.asList(itemsElement); LicensesListResponse expectedResponse = LicensesListResponse.newBuilder() - .setNextPageToken(nextPageToken) .setId(id) + .setNextPageToken(nextPageToken) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java index a6faec2c6fa8..23764baf9d25 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java @@ -78,24 +78,24 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getLicenseCodeTest() { - String kind = "kind3292052"; - Boolean transferable = false; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String state = "state109757585"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + String state = "state109757585"; + Boolean transferable = false; LicenseCode expectedResponse = LicenseCode.newBuilder() - .setKind(kind) - .setTransferable(transferable) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) - .setState(state) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) + .setState(state) + .setTransferable(transferable) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java index 22d06700e10c..de27b3841cd7 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java @@ -86,18 +86,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListMachineTypesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; MachineTypesScopedList itemsItem = MachineTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); MachineTypeAggregatedList expectedResponse = MachineTypeAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -149,34 +149,34 @@ public void aggregatedListMachineTypesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getMachineTypeTest() { - Boolean isSharedCpu = false; + String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; Integer guestCpus = 1754126894; + String id = "id3355"; + Integer imageSpaceGb = 461539048; + Boolean isSharedCpu = false; String kind = "kind3292052"; - String description = "description-1724546052"; - String selfLink = "selfLink-1691268851"; - Integer memoryMb = 1726613907; Integer maximumPersistentDisks = 1033091853; String maximumPersistentDisksSizeGb = "maximumPersistentDisksSizeGb-1993209177"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String creationTimestamp = "creationTimestamp567396278"; + Integer memoryMb = 1726613907; String name = "name3373707"; - String id = "id3355"; - Integer imageSpaceGb = 461539048; + String selfLink = "selfLink-1691268851"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); MachineType expectedResponse = MachineType.newBuilder() - .setIsSharedCpu(isSharedCpu) + .setCreationTimestamp(creationTimestamp) + .setDescription(description) .setGuestCpus(guestCpus) + .setId(id) + .setImageSpaceGb(imageSpaceGb) + .setIsSharedCpu(isSharedCpu) .setKind(kind) - .setDescription(description) - .setSelfLink(selfLink) - .setMemoryMb(memoryMb) .setMaximumPersistentDisks(maximumPersistentDisks) .setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb) - .setZone(zone.toString()) - .setCreationTimestamp(creationTimestamp) + .setMemoryMb(memoryMb) .setName(name) - .setId(id) - .setImageSpaceGb(imageSpaceGb) + .setSelfLink(selfLink) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -223,17 +223,17 @@ public void getMachineTypeExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listMachineTypesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; MachineType itemsElement = MachineType.newBuilder().build(); List items = Arrays.asList(itemsElement); MachineTypeList expectedResponse = MachineTypeList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java index c7fa343db950..f777e87ede64 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -93,50 +93,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addPeeringNetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -188,50 +188,50 @@ public void addPeeringNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteNetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -279,24 +279,24 @@ public void deleteNetworkExceptionTest() throws Exception { @SuppressWarnings("all") public void getNetworkTest() { String iPv4Range = "iPv4Range-534892458"; - String kind = "kind3292052"; Boolean autoCreateSubnetworks = true; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; - String id = "id3355"; String gatewayIPv4 = "gatewayIPv4-1431933859"; + String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; Network expectedResponse = Network.newBuilder() .setIPv4Range(iPv4Range) - .setKind(kind) .setAutoCreateSubnetworks(autoCreateSubnetworks) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) - .setId(id) .setGatewayIPv4(gatewayIPv4) + .setId(id) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -342,50 +342,50 @@ public void getNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertNetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -434,17 +434,17 @@ public void insertNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listNetworksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Network itemsElement = Network.newBuilder().build(); List items = Arrays.asList(itemsElement); NetworkList expectedResponse = NetworkList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -494,50 +494,50 @@ public void listNetworksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchNetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -586,50 +586,50 @@ public void patchNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removePeeringNetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -681,50 +681,50 @@ public void removePeeringNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void switchToCustomModeNetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index 76277b4bc483..8599ab4bf8ca 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -102,50 +102,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void disableXpnHostProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -192,50 +192,50 @@ public void disableXpnHostProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void disableXpnResourceProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -289,50 +289,50 @@ public void disableXpnResourceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void enableXpnHostProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -379,50 +379,50 @@ public void enableXpnHostProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void enableXpnResourceProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -475,24 +475,24 @@ public void enableXpnResourceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getProjectTest() { - String xpnProjectStatus = "xpnProjectStatus-308451647"; - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; + String defaultServiceAccount = "defaultServiceAccount-1848771419"; String description = "description-1724546052"; String id = "id3355"; - String defaultServiceAccount = "defaultServiceAccount-1848771419"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + String xpnProjectStatus = "xpnProjectStatus-308451647"; Project expectedResponse = Project.newBuilder() - .setXpnProjectStatus(xpnProjectStatus) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) + .setDefaultServiceAccount(defaultServiceAccount) .setDescription(description) .setId(id) - .setDefaultServiceAccount(defaultServiceAccount) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) + .setXpnProjectStatus(xpnProjectStatus) .build(); mockService.addResponse(expectedResponse); @@ -537,24 +537,24 @@ public void getProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getXpnHostProjectTest() { - String xpnProjectStatus = "xpnProjectStatus-308451647"; - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; + String defaultServiceAccount = "defaultServiceAccount-1848771419"; String description = "description-1724546052"; String id = "id3355"; - String defaultServiceAccount = "defaultServiceAccount-1848771419"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + String xpnProjectStatus = "xpnProjectStatus-308451647"; Project expectedResponse = Project.newBuilder() - .setXpnProjectStatus(xpnProjectStatus) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) + .setDefaultServiceAccount(defaultServiceAccount) .setDescription(description) .setId(id) - .setDefaultServiceAccount(defaultServiceAccount) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) + .setXpnProjectStatus(xpnProjectStatus) .build(); mockService.addResponse(expectedResponse); @@ -656,17 +656,17 @@ public void getXpnResourcesProjectsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listXpnHostsProjectsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Project itemsElement = Project.newBuilder().build(); List items = Arrays.asList(itemsElement); XpnHostList expectedResponse = XpnHostList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -721,50 +721,50 @@ public void listXpnHostsProjectsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void moveDiskProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -813,50 +813,50 @@ public void moveDiskProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void moveInstanceProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -906,50 +906,50 @@ public void moveInstanceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setCommonInstanceMetadataProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -999,50 +999,50 @@ public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setUsageExportBucketProjectTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index 209d3bf3d330..d1a55e6e4488 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteRegionAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -181,28 +181,28 @@ public void deleteRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRegionAutoscalerTest() { - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; String target = "target-880905839"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler expectedResponse = Autoscaler.newBuilder() - .setZone(zone.toString()) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) .setTarget(target) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -249,50 +249,50 @@ public void getRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -341,17 +341,17 @@ public void insertRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionAutoscalersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionAutoscalerList expectedResponse = RegionAutoscalerList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -401,50 +401,50 @@ public void listRegionAutoscalersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchRegionAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -496,50 +496,50 @@ public void patchRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateRegionAutoscalerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java index 7b62d5d73271..35416267bee0 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -92,50 +92,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteRegionBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -185,39 +185,39 @@ public void deleteRegionBackendServiceExceptionTest() throws Exception { @SuppressWarnings("all") public void getRegionBackendServiceTest() { Integer affinityCookieTtlSec = 1777486694; - String kind = "kind3292052"; - String sessionAffinity = "sessionAffinity1000759473"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String loadBalancingScheme = "loadBalancingScheme1974502980"; - String portName = "portName1115276169"; - Integer timeoutSec = 2067488653; - String selfLink = "selfLink-1691268851"; - String protocol = "protocol-989163880"; Boolean enableCDN = false; - Integer port = 3446913; - String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; String id = "id3355"; + String kind = "kind3292052"; + String loadBalancingScheme = "loadBalancingScheme1974502980"; + String name = "name3373707"; + Integer port = 3446913; + String portName = "portName1115276169"; + String protocol = "protocol-989163880"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + String sessionAffinity = "sessionAffinity1000759473"; + Integer timeoutSec = 2067488653; BackendService expectedResponse = BackendService.newBuilder() .setAffinityCookieTtlSec(affinityCookieTtlSec) - .setKind(kind) - .setSessionAffinity(sessionAffinity) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setLoadBalancingScheme(loadBalancingScheme) - .setPortName(portName) - .setTimeoutSec(timeoutSec) - .setSelfLink(selfLink) - .setProtocol(protocol) .setEnableCDN(enableCDN) - .setPort(port) - .setCreationTimestamp(creationTimestamp) .setFingerprint(fingerprint) - .setName(name) .setId(id) + .setKind(kind) + .setLoadBalancingScheme(loadBalancingScheme) + .setName(name) + .setPort(port) + .setPortName(portName) + .setProtocol(protocol) .setRegion(region.toString()) + .setSelfLink(selfLink) + .setSessionAffinity(sessionAffinity) + .setTimeoutSec(timeoutSec) .build(); mockService.addResponse(expectedResponse); @@ -317,50 +317,50 @@ public void getHealthRegionBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -410,17 +410,17 @@ public void insertRegionBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionBackendServicesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendService itemsElement = BackendService.newBuilder().build(); List items = Arrays.asList(itemsElement); BackendServiceList expectedResponse = BackendServiceList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -471,50 +471,50 @@ public void listRegionBackendServicesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchRegionBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -566,50 +566,50 @@ public void patchRegionBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateRegionBackendServiceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java index d5c49d2e43d9..898958f3a4a5 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java @@ -80,20 +80,20 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getRegionTest() { - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; String status = "status-892481550"; Region expectedResponse = Region.newBuilder() - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) .setStatus(status) .build(); @@ -140,17 +140,17 @@ public void getRegionExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Region itemsElement = Region.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionList expectedResponse = RegionList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java index 60e5592301dc..52bd87283eaa 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java @@ -88,18 +88,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListRegionCommitmentsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; CommitmentsScopedList itemsItem = CommitmentsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); CommitmentAggregatedList expectedResponse = CommitmentAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -151,32 +151,32 @@ public void aggregatedListRegionCommitmentsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRegionCommitmentTest() { - String kind = "kind3292052"; - String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; - String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String description = "description-1724546052"; String endTimestamp = "endTimestamp1004967602"; + String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String plan = "plan3443497"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; String startTimestamp = "startTimestamp-1526966919"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; Commitment expectedResponse = Commitment.newBuilder() - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) .setCreationTimestamp(creationTimestamp) - .setName(name) - .setId(id) - .setRegion(region.toString()) + .setDescription(description) .setEndTimestamp(endTimestamp) + .setId(id) + .setKind(kind) + .setName(name) .setPlan(plan) + .setRegion(region.toString()) + .setSelfLink(selfLink) .setStartTimestamp(startTimestamp) .setStatus(status) + .setStatusMessage(statusMessage) .build(); mockService.addResponse(expectedResponse); @@ -223,50 +223,50 @@ public void getRegionCommitmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionCommitmentTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -315,17 +315,17 @@ public void insertRegionCommitmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionCommitmentsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Commitment itemsElement = Commitment.newBuilder().build(); List items = Arrays.asList(itemsElement); CommitmentList expectedResponse = CommitmentList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java index 6de861a732a7..73d07898de6a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -86,33 +86,33 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getRegionInstanceGroupTest() { - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; + String fingerprint = "fingerprint-1375934236"; + String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Integer size = 3530753; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String creationTimestamp = "creationTimestamp567396278"; - String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; - String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) + .setFingerprint(fingerprint) + .setId(id) + .setKind(kind) + .setName(name) .setNetwork(network.toString()) + .setRegion(region.toString()) .setSelfLink(selfLink) .setSize(size) - .setZone(zone.toString()) .setSubnetwork(subnetwork.toString()) - .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) - .setId(id) - .setRegion(region.toString()) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -159,17 +159,17 @@ public void getRegionInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionInstanceGroupsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionInstanceGroupList expectedResponse = RegionInstanceGroupList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -220,17 +220,17 @@ public void listRegionInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstancesRegionInstanceGroupsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionInstanceGroupsListInstances expectedResponse = RegionInstanceGroupsListInstances.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -289,50 +289,50 @@ public void listInstancesRegionInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setNamedPortsRegionInstanceGroupTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index 42b7a3c9d025..7a4ebc32a39a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -100,50 +100,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void abandonInstancesRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -207,50 +207,50 @@ public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exc @Test @SuppressWarnings("all") public void deleteRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -302,50 +302,50 @@ public void deleteRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstancesRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -409,36 +409,36 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce @Test @SuppressWarnings("all") public void getRegionInstanceGroupManagerTest() { - ProjectGlobalInstanceTemplateName instanceTemplate = - ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - String kind = "kind3292052"; - String description = "description-1724546052"; String baseInstanceName = "baseInstanceName389106439"; + String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; + String fingerprint = "fingerprint-1375934236"; + String id = "id3355"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); + ProjectGlobalInstanceTemplateName instanceTemplate = + ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); + String kind = "kind3292052"; + String name = "name3373707"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Integer targetSize = 2084603409; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String creationTimestamp = "creationTimestamp567396278"; - String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; - String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() - .setInstanceTemplate(instanceTemplate.toString()) - .setKind(kind) - .setDescription(description) .setBaseInstanceName(baseInstanceName) - .setInstanceGroup(instanceGroup.toString()) - .setSelfLink(selfLink) - .setTargetSize(targetSize) - .setZone(zone.toString()) .setCreationTimestamp(creationTimestamp) + .setDescription(description) .setFingerprint(fingerprint) - .setName(name) .setId(id) + .setInstanceGroup(instanceGroup.toString()) + .setInstanceTemplate(instanceTemplate.toString()) + .setKind(kind) + .setName(name) .setRegion(region.toString()) + .setSelfLink(selfLink) + .setTargetSize(targetSize) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -488,50 +488,50 @@ public void getRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) - .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) + .setClientOperationId(clientOperationId) .setCreationTimestamp(creationTimestamp) - .setName(name) - .setProgress(progress) - .setOperationType(operationType) - .setStartTime(startTime) + .setDescription(description) .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) + .setHttpErrorStatusCode(httpErrorStatusCode) .setId(id) + .setInsertTime(insertTime) + .setKind(kind) + .setName(name) + .setOperationType(operationType) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -581,17 +581,17 @@ public void insertRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionInstanceGroupManagersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionInstanceGroupManagerList expectedResponse = RegionInstanceGroupManagerList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -692,50 +692,50 @@ public void listManagedInstancesRegionInstanceGroupManagersExceptionTest() throw @Test @SuppressWarnings("all") public void recreateInstancesRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -794,50 +794,50 @@ public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Ex @Test @SuppressWarnings("all") public void resizeRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -891,50 +891,50 @@ public void resizeRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setInstanceTemplateRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -994,50 +994,50 @@ public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws @Test @SuppressWarnings("all") public void setTargetPoolsRegionInstanceGroupManagerTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java index bc4b8f497e72..5662ccc3fc6f 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java @@ -127,50 +127,50 @@ public void deleteRegionOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRegionOperationTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -217,17 +217,17 @@ public void getRegionOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionOperationsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); OperationList expectedResponse = OperationList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java index 4b777ece8835..f6b209e3914b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteRouteTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -175,38 +175,38 @@ public void deleteRouteExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRouteTest() { - String nextHopGateway = "nextHopGateway-159695614"; - String kind = "kind3292052"; - String nextHopPeering = "nextHopPeering-661059074"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - Integer priority = 1165461084; - String nextHopNetwork = "nextHopNetwork1872908524"; + String destRange = "destRange918198624"; + String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - String selfLink = "selfLink-1691268851"; + String nextHopGateway = "nextHopGateway-159695614"; String nextHopInstance = "nextHopInstance1467250071"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; - String destRange = "destRange918198624"; - String nextHopVpnTunnel = "nextHopVpnTunnel-1627639147"; String nextHopIp = "nextHopIp1184061353"; - String id = "id3355"; + String nextHopNetwork = "nextHopNetwork1872908524"; + String nextHopPeering = "nextHopPeering-661059074"; + String nextHopVpnTunnel = "nextHopVpnTunnel-1627639147"; + Integer priority = 1165461084; + String selfLink = "selfLink-1691268851"; Route expectedResponse = Route.newBuilder() - .setNextHopGateway(nextHopGateway) - .setKind(kind) - .setNextHopPeering(nextHopPeering) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setPriority(priority) - .setNextHopNetwork(nextHopNetwork) + .setDestRange(destRange) + .setId(id) + .setKind(kind) + .setName(name) .setNetwork(network.toString()) - .setSelfLink(selfLink) + .setNextHopGateway(nextHopGateway) .setNextHopInstance(nextHopInstance) - .setCreationTimestamp(creationTimestamp) - .setName(name) - .setDestRange(destRange) - .setNextHopVpnTunnel(nextHopVpnTunnel) .setNextHopIp(nextHopIp) - .setId(id) + .setNextHopNetwork(nextHopNetwork) + .setNextHopPeering(nextHopPeering) + .setNextHopVpnTunnel(nextHopVpnTunnel) + .setPriority(priority) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -251,50 +251,50 @@ public void getRouteExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRouteTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -343,17 +343,17 @@ public void insertRouteExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRoutesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Route itemsElement = Route.newBuilder().build(); List items = Arrays.asList(itemsElement); RouteList expectedResponse = RouteList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 38308a2d5f96..974dc5aeeaf1 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -98,18 +98,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListRoutersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; RoutersScopedList itemsItem = RoutersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); RouterAggregatedList expectedResponse = RouterAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -160,50 +160,50 @@ public void aggregatedListRoutersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteRouterTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -252,23 +252,23 @@ public void deleteRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRouterTest() { - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String kind = "kind3292052"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Router expectedResponse = Router.newBuilder() - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) - .setRegion(region.toString()) + .setKind(kind) + .setName(name) .setNetwork(network.toString()) + .setRegion(region.toString()) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -363,50 +363,50 @@ public void getRouterStatusRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRouterTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -455,17 +455,17 @@ public void insertRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRoutersTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Router itemsElement = Router.newBuilder().build(); List items = Arrays.asList(itemsElement); RouterList expectedResponse = RouterList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -515,50 +515,50 @@ public void listRoutersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchRouterTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -657,50 +657,50 @@ public void previewRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateRouterTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index 3130b8a9bfdc..b7ab3ec49141 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteSnapshotTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -175,34 +175,34 @@ public void deleteSnapshotExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSnapshotTest() { - String sourceDisk = "sourceDisk-85117119"; - String sourceDiskId = "sourceDiskId-1693292839"; - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; + String diskSizeGb = "diskSizeGb-757478089"; + String id = "id3355"; + String kind = "kind3292052"; String labelFingerprint = "labelFingerprint714995737"; - String selfLink = "selfLink-1691268851"; - String storageBytesStatus = "storageBytesStatus1027609994"; - String storageBytes = "storageBytes2035244455"; - String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String id = "id3355"; - String diskSizeGb = "diskSizeGb-757478089"; + String selfLink = "selfLink-1691268851"; + String sourceDisk = "sourceDisk-85117119"; + String sourceDiskId = "sourceDiskId-1693292839"; String status = "status-892481550"; + String storageBytes = "storageBytes2035244455"; + String storageBytesStatus = "storageBytesStatus1027609994"; Snapshot expectedResponse = Snapshot.newBuilder() - .setSourceDisk(sourceDisk) - .setSourceDiskId(sourceDiskId) - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) + .setDiskSizeGb(diskSizeGb) + .setId(id) + .setKind(kind) .setLabelFingerprint(labelFingerprint) - .setSelfLink(selfLink) - .setStorageBytesStatus(storageBytesStatus) - .setStorageBytes(storageBytes) - .setCreationTimestamp(creationTimestamp) .setName(name) - .setId(id) - .setDiskSizeGb(diskSizeGb) + .setSelfLink(selfLink) + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) .setStatus(status) + .setStorageBytes(storageBytes) + .setStorageBytesStatus(storageBytesStatus) .build(); mockService.addResponse(expectedResponse); @@ -247,17 +247,17 @@ public void getSnapshotExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSnapshotsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Snapshot itemsElement = Snapshot.newBuilder().build(); List items = Arrays.asList(itemsElement); SnapshotList expectedResponse = SnapshotList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -307,50 +307,50 @@ public void listSnapshotsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsSnapshotTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java index ae37831e11ac..5e0d060e1f03 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteSslCertificateTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -177,23 +177,23 @@ public void deleteSslCertificateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSslCertificateTest() { - String privateKey = "privateKey1971943843"; - String kind = "kind3292052"; String certificate = "certificate1952399767"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; + String privateKey = "privateKey1971943843"; String selfLink = "selfLink-1691268851"; SslCertificate expectedResponse = SslCertificate.newBuilder() - .setPrivateKey(privateKey) - .setKind(kind) .setCertificate(certificate) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) + .setPrivateKey(privateKey) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -241,50 +241,50 @@ public void getSslCertificateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertSslCertificateTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -334,17 +334,17 @@ public void insertSslCertificateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSslCertificatesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; SslCertificate itemsElement = SslCertificate.newBuilder().build(); List items = Arrays.asList(itemsElement); SslCertificateList expectedResponse = SslCertificateList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java index 6735368b23c3..8cc03e18e52a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteSslPolicyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -181,25 +181,25 @@ public void deleteSslPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSslPolicyTest() { - String kind = "kind3292052"; - String minTlsVersion = "minTlsVersion8155943"; - String profile = "profile-309425751"; String creationTimestamp = "creationTimestamp567396278"; - String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; String description = "description-1724546052"; + String fingerprint = "fingerprint-1375934236"; String id = "id3355"; + String kind = "kind3292052"; + String minTlsVersion = "minTlsVersion8155943"; + String name = "name3373707"; + String profile = "profile-309425751"; String selfLink = "selfLink-1691268851"; SslPolicy expectedResponse = SslPolicy.newBuilder() - .setKind(kind) - .setMinTlsVersion(minTlsVersion) - .setProfile(profile) .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) .setDescription(description) + .setFingerprint(fingerprint) .setId(id) + .setKind(kind) + .setMinTlsVersion(minTlsVersion) + .setName(name) + .setProfile(profile) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -247,50 +247,50 @@ public void getSslPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertSslPolicyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -339,17 +339,17 @@ public void insertSslPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSslPoliciesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; SslPolicy itemsElement = SslPolicy.newBuilder().build(); List items = Arrays.asList(itemsElement); SslPoliciesList expectedResponse = SslPoliciesList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -445,50 +445,50 @@ public void listAvailableFeaturesSslPoliciesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchSslPolicyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 0c3bb48581df..610d20e45b67 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -96,18 +96,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListSubnetworksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; SubnetworksScopedList itemsItem = SubnetworksScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); SubnetworkAggregatedList expectedResponse = SubnetworkAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -159,50 +159,50 @@ public void aggregatedListSubnetworksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteSubnetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -251,50 +251,50 @@ public void deleteSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void expandIpCidrRangeSubnetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -350,32 +350,32 @@ public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSubnetworkTest() { - Boolean privateIpGoogleAccess = true; - String kind = "kind3292052"; - String description = "description-1724546052"; - ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - String selfLink = "selfLink-1691268851"; String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; String gatewayAddress = "gatewayAddress-77003527"; String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String ipCidrRange = "ipCidrRange-2049366326"; + String kind = "kind3292052"; + String name = "name3373707"; + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + Boolean privateIpGoogleAccess = true; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; Subnetwork expectedResponse = Subnetwork.newBuilder() - .setPrivateIpGoogleAccess(privateIpGoogleAccess) - .setKind(kind) - .setDescription(description) - .setNetwork(network.toString()) - .setSelfLink(selfLink) .setCreationTimestamp(creationTimestamp) + .setDescription(description) .setFingerprint(fingerprint) - .setName(name) .setGatewayAddress(gatewayAddress) .setId(id) - .setRegion(region.toString()) .setIpCidrRange(ipCidrRange) + .setKind(kind) + .setName(name) + .setNetwork(network.toString()) + .setPrivateIpGoogleAccess(privateIpGoogleAccess) + .setRegion(region.toString()) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -422,50 +422,50 @@ public void getSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertSubnetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -514,17 +514,17 @@ public void insertSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSubnetworksTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Subnetwork itemsElement = Subnetwork.newBuilder().build(); List items = Arrays.asList(itemsElement); SubnetworkList expectedResponse = SubnetworkList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -574,50 +574,50 @@ public void listSubnetworksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchSubnetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -668,50 +668,50 @@ public void patchSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setPrivateIpGoogleAccessSubnetworkTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java index 73a118e5bf9d..6a117e54749a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -87,50 +87,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetHttpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -179,22 +179,22 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetHttpProxyTest() { - ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); TargetHttpProxy expectedResponse = TargetHttpProxy.newBuilder() - .setUrlMap(urlMap.toString()) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) + .setUrlMap(urlMap.toString()) .build(); mockService.addResponse(expectedResponse); @@ -241,50 +241,50 @@ public void getTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetHttpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -334,17 +334,17 @@ public void insertTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetHttpProxiesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetHttpProxy itemsElement = TargetHttpProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetHttpProxyList expectedResponse = TargetHttpProxyList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -394,50 +394,50 @@ public void listTargetHttpProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setUrlMapTargetHttpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 1068db766bd1..af6e465c55a9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -91,50 +91,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetHttpsProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -183,25 +183,25 @@ public void deleteTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetHttpsProxyTest() { - ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String kind = "kind3292052"; - ProjectGlobalSslPolicyName sslPolicy = - ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); TargetHttpsProxy expectedResponse = TargetHttpsProxy.newBuilder() - .setUrlMap(urlMap.toString()) - .setKind(kind) - .setSslPolicy(sslPolicy.toString()) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) + .setSslPolicy(sslPolicy.toString()) + .setUrlMap(urlMap.toString()) .build(); mockService.addResponse(expectedResponse); @@ -248,50 +248,50 @@ public void getTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetHttpsProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -341,17 +341,17 @@ public void insertTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetHttpsProxiesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetHttpsProxy itemsElement = TargetHttpsProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetHttpsProxyList expectedResponse = TargetHttpsProxyList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -401,50 +401,50 @@ public void listTargetHttpsProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslCertificatesTargetHttpsProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -502,50 +502,50 @@ public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslPolicyTargetHttpsProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -598,50 +598,50 @@ public void setSslPolicyTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setUrlMapTargetHttpsProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java index 62d4ca7ef7ab..86af3fc154a9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListTargetInstancesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetInstancesScopedList itemsItem = TargetInstancesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); TargetInstanceAggregatedList expectedResponse = TargetInstanceAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -153,50 +153,50 @@ public void aggregatedListTargetInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -245,27 +245,27 @@ public void deleteTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetInstanceTest() { + String creationTimestamp = "creationTimestamp567396278"; + String description = "description-1724546052"; + String id = "id3355"; ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String kind = "kind3292052"; - String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String description = "description-1724546052"; - String id = "id3355"; String natPolicy = "natPolicy-1637703152"; String selfLink = "selfLink-1691268851"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); TargetInstance expectedResponse = TargetInstance.newBuilder() - .setInstance(instance.toString()) - .setZone(zone.toString()) - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setInstance(instance.toString()) + .setKind(kind) + .setName(name) .setNatPolicy(natPolicy) .setSelfLink(selfLink) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -312,50 +312,50 @@ public void getTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetInstanceTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone2.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone2.toString()) .build(); mockService.addResponse(expectedResponse); @@ -404,17 +404,17 @@ public void insertTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetInstancesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetInstance itemsElement = TargetInstance.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetInstanceList expectedResponse = TargetInstanceList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java index 55c69ddf141d..877bc5315be4 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -102,50 +102,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addHealthCheckTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -201,50 +201,50 @@ public void addHealthCheckTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void addInstanceTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -298,18 +298,18 @@ public void addInstanceTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListTargetPoolsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetPoolsScopedList itemsItem = TargetPoolsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); TargetPoolAggregatedList expectedResponse = TargetPoolAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -361,50 +361,50 @@ public void aggregatedListTargetPoolsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -453,28 +453,28 @@ public void deleteTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetPoolTest() { - String kind = "kind3292052"; - String sessionAffinity = "sessionAffinity1000759473"; + String backupPool = "backupPool1119626361"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; Float failoverRatio = -8.6107481E7F; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String backupPool = "backupPool1119626361"; String selfLink = "selfLink-1691268851"; + String sessionAffinity = "sessionAffinity1000759473"; TargetPool expectedResponse = TargetPool.newBuilder() - .setKind(kind) - .setSessionAffinity(sessionAffinity) + .setBackupPool(backupPool) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setFailoverRatio(failoverRatio) .setId(id) + .setKind(kind) + .setName(name) .setRegion(region.toString()) - .setBackupPool(backupPool) .setSelfLink(selfLink) + .setSessionAffinity(sessionAffinity) .build(); mockService.addResponse(expectedResponse); @@ -572,50 +572,50 @@ public void getHealthTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -664,17 +664,17 @@ public void insertTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetPoolsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetPool itemsElement = TargetPool.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetPoolList expectedResponse = TargetPoolList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -724,50 +724,50 @@ public void listTargetPoolsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removeHealthCheckTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -823,50 +823,50 @@ public void removeHealthCheckTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removeInstanceTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -922,50 +922,50 @@ public void removeInstanceTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setBackupTargetPoolTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java index d53c2359b802..9576f7597c57 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -93,50 +93,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetSslProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -185,27 +185,27 @@ public void deleteTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetSslProxyTest() { - String kind = "kind3292052"; - String service = "service1984153269"; - ProjectGlobalSslPolicyName sslPolicy = - ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String proxyHeader = "proxyHeader-1987109506"; String selfLink = "selfLink-1691268851"; + String service = "service1984153269"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); TargetSslProxy expectedResponse = TargetSslProxy.newBuilder() - .setKind(kind) - .setService(service) - .setSslPolicy(sslPolicy.toString()) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setProxyHeader(proxyHeader) .setSelfLink(selfLink) + .setService(service) + .setSslPolicy(sslPolicy.toString()) .build(); mockService.addResponse(expectedResponse); @@ -252,50 +252,50 @@ public void getTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetSslProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -345,17 +345,17 @@ public void insertTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetSslProxiesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetSslProxy itemsElement = TargetSslProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetSslProxyList expectedResponse = TargetSslProxyList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -405,50 +405,50 @@ public void listTargetSslProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setBackendServiceTargetSslProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -504,50 +504,50 @@ public void setBackendServiceTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setProxyHeaderTargetSslProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -603,50 +603,50 @@ public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslCertificatesTargetSslProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -702,50 +702,50 @@ public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslPolicyTargetSslProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java index 067f5a281022..080fb907a3e2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetTcpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -181,24 +181,24 @@ public void deleteTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetTcpProxyTest() { - String kind = "kind3292052"; - String service = "service1984153269"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; String proxyHeader = "proxyHeader-1987109506"; String selfLink = "selfLink-1691268851"; + String service = "service1984153269"; TargetTcpProxy expectedResponse = TargetTcpProxy.newBuilder() - .setKind(kind) - .setService(service) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setProxyHeader(proxyHeader) .setSelfLink(selfLink) + .setService(service) .build(); mockService.addResponse(expectedResponse); @@ -245,50 +245,50 @@ public void getTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetTcpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -338,17 +338,17 @@ public void insertTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetTcpProxiesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetTcpProxy itemsElement = TargetTcpProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetTcpProxyList expectedResponse = TargetTcpProxyList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -398,50 +398,50 @@ public void listTargetTcpProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setBackendServiceTargetTcpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -497,50 +497,50 @@ public void setBackendServiceTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setProxyHeaderTargetTcpProxyTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java index e79add735159..936164adc002 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListTargetVpnGatewaysTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetVpnGatewaysScopedList itemsItem = TargetVpnGatewaysScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); TargetVpnGatewayAggregatedList expectedResponse = TargetVpnGatewayAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -154,50 +154,50 @@ public void aggregatedListTargetVpnGatewaysExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetVpnGatewayTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -246,24 +246,24 @@ public void deleteTargetVpnGatewayExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetVpnGatewayTest() { - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String kind = "kind3292052"; + String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; TargetVpnGateway expectedResponse = TargetVpnGateway.newBuilder() - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) - .setRegion(region.toString()) + .setKind(kind) + .setName(name) .setNetwork(network.toString()) + .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) .build(); @@ -312,50 +312,50 @@ public void getTargetVpnGatewayExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetVpnGatewayTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -405,17 +405,17 @@ public void insertTargetVpnGatewayExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetVpnGatewaysTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetVpnGateway itemsElement = TargetVpnGateway.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetVpnGatewayList expectedResponse = TargetVpnGatewayList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java index ddd8b2fd8ee3..7add1594e548 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -93,50 +93,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteUrlMapTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -183,23 +183,23 @@ public void deleteUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getUrlMapTest() { - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String fingerprint = "fingerprint-1375934236"; - String name = "name3373707"; + String defaultService = "defaultService1980854967"; String description = "description-1724546052"; + String fingerprint = "fingerprint-1375934236"; String id = "id3355"; - String defaultService = "defaultService1980854967"; + String kind = "kind3292052"; + String name = "name3373707"; String selfLink = "selfLink-1691268851"; UrlMap expectedResponse = UrlMap.newBuilder() - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setFingerprint(fingerprint) - .setName(name) + .setDefaultService(defaultService) .setDescription(description) + .setFingerprint(fingerprint) .setId(id) - .setDefaultService(defaultService) + .setKind(kind) + .setName(name) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -245,50 +245,50 @@ public void getUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertUrlMapTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -337,50 +337,50 @@ public void insertUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void invalidateCacheUrlMapTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -432,17 +432,17 @@ public void invalidateCacheUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listUrlMapsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; UrlMap itemsElement = UrlMap.newBuilder().build(); List items = Arrays.asList(itemsElement); UrlMapList expectedResponse = UrlMapList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -492,50 +492,50 @@ public void listUrlMapsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchUrlMapTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -584,50 +584,50 @@ public void patchUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateUrlMapTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java index ec71f3dd9208..550eeb56a2a4 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListVpnTunnelsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; VpnTunnelsScopedList itemsItem = VpnTunnelsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); VpnTunnelAggregatedList expectedResponse = VpnTunnelAggregatedList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -153,50 +153,50 @@ public void aggregatedListVpnTunnelsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteVpnTunnelTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -245,40 +245,40 @@ public void deleteVpnTunnelExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getVpnTunnelTest() { - String sharedSecretHash = "sharedSecretHash935752803"; - String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - Integer ikeVersion = 1292118044; - String selfLink = "selfLink-1691268851"; - ProjectRegionRouterName router = - ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); String detailedStatus = "detailedStatus-740240799"; - String peerIp = "peerIp-690492124"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String id = "id3355"; + Integer ikeVersion = 1292118044; + String kind = "kind3292052"; + String name = "name3373707"; + String peerIp = "peerIp-690492124"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + String selfLink = "selfLink-1691268851"; String sharedSecret = "sharedSecret-154938422"; + String sharedSecretHash = "sharedSecretHash935752803"; + String status = "status-892481550"; ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); - String status = "status-892481550"; VpnTunnel expectedResponse = VpnTunnel.newBuilder() - .setSharedSecretHash(sharedSecretHash) - .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setIkeVersion(ikeVersion) - .setSelfLink(selfLink) - .setRouter(router.toString()) .setDetailedStatus(detailedStatus) - .setPeerIp(peerIp) - .setCreationTimestamp(creationTimestamp) - .setName(name) .setId(id) + .setIkeVersion(ikeVersion) + .setKind(kind) + .setName(name) + .setPeerIp(peerIp) .setRegion(region.toString()) + .setRouter(router.toString()) + .setSelfLink(selfLink) .setSharedSecret(sharedSecret) - .setTargetVpnGateway(targetVpnGateway.toString()) + .setSharedSecretHash(sharedSecretHash) .setStatus(status) + .setTargetVpnGateway(targetVpnGateway.toString()) .build(); mockService.addResponse(expectedResponse); @@ -325,50 +325,50 @@ public void getVpnTunnelExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertVpnTunnelTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region2.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -417,17 +417,17 @@ public void insertVpnTunnelExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listVpnTunnelsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; VpnTunnel itemsElement = VpnTunnel.newBuilder().build(); List items = Arrays.asList(itemsElement); VpnTunnelList expectedResponse = VpnTunnelList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java index a2bcabedf199..e4831b42ec6e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java @@ -80,21 +80,21 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getZoneTest() { - String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; + String kind = "kind3292052"; + String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; Zone expectedResponse = Zone.newBuilder() - .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) .setId(id) + .setKind(kind) + .setName(name) .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) @@ -142,17 +142,17 @@ public void getZoneExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listZonesTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Zone itemsElement = Zone.newBuilder().build(); List items = Arrays.asList(itemsElement); ZoneList expectedResponse = ZoneList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java index 6b534af7519b..1a189d2b9e30 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java @@ -127,50 +127,50 @@ public void deleteZoneOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getZoneOperationTest() { - String httpErrorMessage = "httpErrorMessage1276263769"; - String targetId = "targetId-815576439"; - String kind = "kind3292052"; + String clientOperationId = "clientOperationId-239630617"; + String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String statusMessage = "statusMessage-239442758"; - String selfLink = "selfLink-1691268851"; - String insertTime = "insertTime-103148397"; + String endTime = "endTime1725551537"; + String httpErrorMessage = "httpErrorMessage1276263769"; Integer httpErrorStatusCode = 1386087020; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String targetLink = "targetLink-2084812312"; - String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; + String insertTime = "insertTime-103148397"; + String kind = "kind3292052"; String name = "name3373707"; - Integer progress = 1001078227; String operationType = "operationType-1432962286"; - String startTime = "startTime-1573145462"; - String endTime = "endTime1725551537"; - String id = "id3355"; + Integer progress = 1001078227; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String clientOperationId = "clientOperationId-239630617"; - String user = "user3599307"; + String selfLink = "selfLink-1691268851"; + String startTime = "startTime-1573145462"; String status = "status-892481550"; + String statusMessage = "statusMessage-239442758"; + String targetId = "targetId-815576439"; + String targetLink = "targetLink-2084812312"; + String user = "user3599307"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Operation expectedResponse = Operation.newBuilder() - .setHttpErrorMessage(httpErrorMessage) - .setTargetId(targetId) - .setKind(kind) + .setClientOperationId(clientOperationId) + .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setStatusMessage(statusMessage) - .setSelfLink(selfLink) - .setInsertTime(insertTime) + .setEndTime(endTime) + .setHttpErrorMessage(httpErrorMessage) .setHttpErrorStatusCode(httpErrorStatusCode) - .setZone(zone.toString()) - .setTargetLink(targetLink) - .setCreationTimestamp(creationTimestamp) + .setId(id) + .setInsertTime(insertTime) + .setKind(kind) .setName(name) - .setProgress(progress) .setOperationType(operationType) - .setStartTime(startTime) - .setEndTime(endTime) - .setId(id) + .setProgress(progress) .setRegion(region.toString()) - .setClientOperationId(clientOperationId) - .setUser(user) + .setSelfLink(selfLink) + .setStartTime(startTime) .setStatus(status) + .setStatusMessage(statusMessage) + .setTargetId(targetId) + .setTargetLink(targetLink) + .setUser(user) + .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -217,17 +217,17 @@ public void getZoneOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listZoneOperationsTest() { + String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; - String id = "id3355"; String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); OperationList expectedResponse = OperationList.newBuilder() + .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) - .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); From 34153083cbe24487aafe39eecc3eabcde43c2647 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 11:54:38 -0700 Subject: [PATCH 19/42] add in test changes --- .../com/google/cloud/compute/v1/Errors2.java | 217 +++ .../cloud/compute/v1/HTTPSHealthCheck2.java | 282 ++++ .../cloud/compute/v1/HttpHealthCheck2.java | 578 +++++++ .../compute/v1/AcceleratorTypeClientTest.java | 24 +- .../cloud/compute/v1/AddressClientTest.java | 150 +- .../compute/v1/AutoscalerClientTest.java | 260 ++-- .../compute/v1/BackendBucketClientTest.java | 256 +-- .../compute/v1/BackendServiceClientTest.java | 288 ++-- .../cloud/compute/v1/DiskClientTest.java | 352 ++--- .../cloud/compute/v1/DiskTypeClientTest.java | 28 +- .../cloud/compute/v1/FirewallClientTest.java | 268 ++-- .../compute/v1/ForwardingRuleClientTest.java | 224 +-- .../compute/v1/GlobalAddressClientTest.java | 146 +- .../v1/GlobalForwardingRuleClientTest.java | 220 +-- .../compute/v1/GlobalOperationClientTest.java | 68 +- .../compute/v1/HealthCheckClientTest.java | 272 ++-- .../compute/v1/HttpHealthCheckClientTest.java | 276 ++-- .../v1/HttpsHealthCheckClientTest.java | 276 ++-- .../cloud/compute/v1/ImageClientTest.java | 332 ++-- .../cloud/compute/v1/InstanceClientTest.java | 1384 ++++++++--------- .../compute/v1/InstanceGroupClientTest.java | 340 ++-- .../v1/InstanceGroupManagerClientTest.java | 524 +++---- .../v1/InstanceTemplateClientTest.java | 132 +- .../v1/InterconnectAttachmentClientTest.java | 162 +- .../compute/v1/InterconnectClientTest.java | 236 +-- .../v1/InterconnectLocationClientTest.java | 36 +- .../cloud/compute/v1/LicenseClientTest.java | 136 +- .../compute/v1/LicenseCodeClientTest.java | 16 +- .../compute/v1/MachineTypeClientTest.java | 40 +- .../cloud/compute/v1/NetworkClientTest.java | 376 ++--- .../cloud/compute/v1/ProjectClientTest.java | 516 +++--- .../v1/RegionAutoscalerClientTest.java | 256 +-- .../v1/RegionBackendServiceClientTest.java | 284 ++-- .../cloud/compute/v1/RegionClientTest.java | 12 +- .../v1/RegionCommitmentClientTest.java | 96 +- .../v1/RegionInstanceGroupClientTest.java | 96 +- .../RegionInstanceGroupManagerClientTest.java | 520 +++---- .../compute/v1/RegionOperationClientTest.java | 64 +- .../cloud/compute/v1/RouteClientTest.java | 168 +- .../cloud/compute/v1/RouterClientTest.java | 260 ++-- .../cloud/compute/v1/SnapshotClientTest.java | 160 +- .../compute/v1/SslCertificateClientTest.java | 136 +- .../cloud/compute/v1/SslPolicyClientTest.java | 204 +-- .../compute/v1/SubnetworkClientTest.java | 336 ++-- .../compute/v1/TargetHttpProxyClientTest.java | 196 +-- .../v1/TargetHttpsProxyClientTest.java | 322 ++-- .../compute/v1/TargetInstanceClientTest.java | 144 +- .../compute/v1/TargetPoolClientTest.java | 444 +++--- .../compute/v1/TargetSslProxyClientTest.java | 382 ++--- .../compute/v1/TargetTcpProxyClientTest.java | 256 +-- .../v1/TargetVpnGatewayClientTest.java | 140 +- .../cloud/compute/v1/UrlMapClientTest.java | 320 ++-- .../cloud/compute/v1/VpnTunnelClientTest.java | 166 +- .../cloud/compute/v1/ZoneClientTest.java | 12 +- .../compute/v1/ZoneOperationClientTest.java | 64 +- 55 files changed, 7265 insertions(+), 6188 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java new file mode 100644 index 000000000000..aa52e3b03d40 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java @@ -0,0 +1,217 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class Errors2 implements ApiMessage { + private final String code; + private final String location; + private final String message; + + private Errors2() { + this.code = null; + this.location = null; + this.message = null; + } + + private Errors2(String code, String location, String message) { + this.code = code; + this.location = location; + this.message = message; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("location") && location != null) { + fieldMap.put("location", Collections.singletonList(String.valueOf(location))); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("code")) { + return String.valueOf(code); + } + if (fieldName.equals("location")) { + return String.valueOf(location); + } + if (fieldName.equals("message")) { + return String.valueOf(message); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getCode() { + return code; + } + + public String getLocation() { + return location; + } + + public String getMessage() { + return message; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Errors2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static Errors2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final Errors2 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Errors2(); + } + + public static class Builder { + private String code; + private String location; + private String message; + + Builder() {} + + public Builder mergeFrom(Errors2 other) { + if (other == Errors2.getDefaultInstance()) return this; + if (other.getCode() != null) { + this.code = other.code; + } + if (other.getLocation() != null) { + this.location = other.location; + } + if (other.getMessage() != null) { + this.message = other.message; + } + return this; + } + + Builder(Errors2 source) { + this.code = source.code; + this.location = source.location; + this.message = source.message; + } + + public String getCode() { + return code; + } + + public Builder setCode(String code) { + this.code = code; + return this; + } + + public String getLocation() { + return location; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public String getMessage() { + return message; + } + + public Builder setMessage(String message) { + this.message = message; + return this; + } + + public Errors2 build() { + + return new Errors2(code, location, message); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCode(this.code); + newBuilder.setLocation(this.location); + newBuilder.setMessage(this.message); + return newBuilder; + } + } + + @Override + public String toString() { + return "Errors2{" + + "code=" + + code + + ", " + + "location=" + + location + + ", " + + "message=" + + message + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof Errors2) { + Errors2 that = (Errors2) o; + return Objects.equals(this.code, that.getCode()) + && Objects.equals(this.location, that.getLocation()) + && Objects.equals(this.message, that.getMessage()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(code, location, message); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java new file mode 100644 index 000000000000..2c30fb852790 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java @@ -0,0 +1,282 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HTTPSHealthCheck2 implements ApiMessage { + private final String host; + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String requestPath; + + private HTTPSHealthCheck2() { + this.host = null; + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.requestPath = null; + } + + private HTTPSHealthCheck2( + String host, Integer port, String portName, String proxyHeader, String requestPath) { + this.host = host; + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.requestPath = requestPath; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHost() { + return host; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequestPath() { + return requestPath; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HTTPSHealthCheck2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static HTTPSHealthCheck2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final HTTPSHealthCheck2 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new HTTPSHealthCheck2(); + } + + public static class Builder { + private String host; + private Integer port; + private String portName; + private String proxyHeader; + private String requestPath; + + Builder() {} + + public Builder mergeFrom(HTTPSHealthCheck2 other) { + if (other == HTTPSHealthCheck2.getDefaultInstance()) return this; + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + return this; + } + + Builder(HTTPSHealthCheck2 source) { + this.host = source.host; + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.requestPath = source.requestPath; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public HTTPSHealthCheck2 build() { + + return new HTTPSHealthCheck2(host, port, portName, proxyHeader, requestPath); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHost(this.host); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequestPath(this.requestPath); + return newBuilder; + } + } + + @Override + public String toString() { + return "HTTPSHealthCheck2{" + + "host=" + + host + + ", " + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "requestPath=" + + requestPath + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HTTPSHealthCheck2) { + HTTPSHealthCheck2 that = (HTTPSHealthCheck2) o; + return Objects.equals(this.host, that.getHost()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.requestPath, that.getRequestPath()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(host, port, portName, proxyHeader, requestPath); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java new file mode 100644 index 000000000000..21ef5d6e7db1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java @@ -0,0 +1,578 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpHealthCheck2 implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; + private final String host; + private final String id; + private final String kind; + private final String name; + private final Integer port; + private final String requestPath; + private final String selfLink; + private final Integer timeoutSec; + private final Integer unhealthyThreshold; + + private HttpHealthCheck2() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; + this.host = null; + this.id = null; + this.kind = null; + this.name = null; + this.port = null; + this.requestPath = null; + this.selfLink = null; + this.timeoutSec = null; + this.unhealthyThreshold = null; + } + + private HttpHealthCheck2( + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + String host, + String id, + String kind, + String name, + Integer port, + String requestPath, + String selfLink, + Integer timeoutSec, + Integer unhealthyThreshold) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; + this.host = host; + this.id = id; + this.kind = kind; + this.name = name; + this.port = port; + this.requestPath = requestPath; + this.selfLink = selfLink; + this.timeoutSec = timeoutSec; + this.unhealthyThreshold = unhealthyThreshold; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return String.valueOf(checkIntervalSec); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("healthyThreshold")) { + return String.valueOf(healthyThreshold); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + if (fieldName.equals("unhealthyThreshold")) { + return String.valueOf(unhealthyThreshold); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public String getHost() { + return host; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + public String getRequestPath() { + return requestPath; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HttpHealthCheck2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpHealthCheck2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final HttpHealthCheck2 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new HttpHealthCheck2(); + } + + public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; + private String host; + private String id; + private String kind; + private String name; + private Integer port; + private String requestPath; + private String selfLink; + private Integer timeoutSec; + private Integer unhealthyThreshold; + + Builder() {} + + public Builder mergeFrom(HttpHealthCheck2 other) { + if (other == HttpHealthCheck2.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } + return this; + } + + Builder(HttpHealthCheck2 source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; + this.host = source.host; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.port = source.port; + this.requestPath = source.requestPath; + this.selfLink = source.selfLink; + this.timeoutSec = source.timeoutSec; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + public HttpHealthCheck2 build() { + + return new HttpHealthCheck2( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); + newBuilder.setHost(this.host); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + newBuilder.setRequestPath(this.requestPath); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpHealthCheck2{" + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + + "host=" + + host + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "port=" + + port + + ", " + + "requestPath=" + + requestPath + + ", " + + "selfLink=" + + selfLink + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpHealthCheck2) { + HttpHealthCheck2 that = (HttpHealthCheck2) o; + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.requestPath, that.getRequestPath()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java index 848698f72f2a..9dd592c3f42b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java @@ -86,18 +86,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListAcceleratorTypesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; AcceleratorTypesScopedList itemsItem = AcceleratorTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); AcceleratorTypeAggregatedList expectedResponse = AcceleratorTypeAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -149,24 +149,24 @@ public void aggregatedListAcceleratorTypesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getAcceleratorTypeTest() { + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; - String id = "id3355"; - String kind = "kind3292052"; Integer maximumCardsPerInstance = 1883669166; - String name = "name3373707"; + String id = "id3355"; String selfLink = "selfLink-1691268851"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); AcceleratorType expectedResponse = AcceleratorType.newBuilder() + .setZone(zone.toString()) + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) - .setId(id) - .setKind(kind) .setMaximumCardsPerInstance(maximumCardsPerInstance) - .setName(name) + .setId(id) .setSelfLink(selfLink) - .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -213,17 +213,17 @@ public void getAcceleratorTypeExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listAcceleratorTypesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; AcceleratorType itemsElement = AcceleratorType.newBuilder().build(); List items = Arrays.asList(itemsElement); AcceleratorTypeList expectedResponse = AcceleratorTypeList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index 5e5953c1b481..5e93ed070f5c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListAddressesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; AddressesScopedList itemsItem = AddressesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); AddressAggregatedList expectedResponse = AddressAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -153,50 +153,50 @@ public void aggregatedListAddressesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteAddressTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -247,31 +247,31 @@ public void deleteAddressExceptionTest() throws Exception { public void getAddressTest() { ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String addressType = "addressType264307877"; - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String description = "description-1724546052"; - String id = "id3355"; + String selfLink = "selfLink-1691268851"; String ipVersion = "ipVersion-1315653184"; - String kind = "kind3292052"; + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; + String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; String status = "status-892481550"; - ProjectRegionSubnetworkName subnetwork = - ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) .setAddressType(addressType) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setDescription(description) - .setId(id) + .setSelfLink(selfLink) .setIpVersion(ipVersion) - .setKind(kind) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) .setName(name) + .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) .setStatus(status) - .setSubnetwork(subnetwork.toString()) .build(); mockService.addResponse(expectedResponse); @@ -318,50 +318,50 @@ public void getAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertAddressTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -410,17 +410,17 @@ public void insertAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listAddressesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Address itemsElement = Address.newBuilder().build(); List
items = Arrays.asList(itemsElement); AddressList expectedResponse = AddressList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index e41c11923d1d..d7980716d32a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -94,18 +94,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListAutoscalersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; AutoscalersScopedList itemsItem = AutoscalersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); AutoscalerAggregatedList expectedResponse = AutoscalerAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -157,50 +157,50 @@ public void aggregatedListAutoscalersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -249,28 +249,28 @@ public void deleteAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getAutoscalerTest() { + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; String target = "target-880905839"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler expectedResponse = Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) .setTarget(target) - .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -317,50 +317,50 @@ public void getAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -409,17 +409,17 @@ public void insertAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listAutoscalersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); AutoscalerList expectedResponse = AutoscalerList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -469,50 +469,50 @@ public void listAutoscalersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -564,50 +564,50 @@ public void patchAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java index 7bf88dc7603c..f20900a4e2b2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteBackendBucketTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -182,22 +182,22 @@ public void deleteBackendBucketExceptionTest() throws Exception { @SuppressWarnings("all") public void getBackendBucketTest() { String bucketName = "bucketName283610048"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; Boolean enableCdn = false; - String id = "id3355"; String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendBucket expectedResponse = BackendBucket.newBuilder() .setBucketName(bucketName) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) .setEnableCdn(enableCdn) - .setId(id) .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setName(name) + .setDescription(description) + .setId(id) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -245,50 +245,50 @@ public void getBackendBucketExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertBackendBucketTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -338,17 +338,17 @@ public void insertBackendBucketExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listBackendBucketsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendBucket itemsElement = BackendBucket.newBuilder().build(); List items = Arrays.asList(itemsElement); BackendBucketList expectedResponse = BackendBucketList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -398,50 +398,50 @@ public void listBackendBucketsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchBackendBucketTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -493,50 +493,50 @@ public void patchBackendBucketExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateBackendBucketTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index 08a4fb83ec4c..95e69a22696b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -96,18 +96,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListBackendServicesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendServicesScopedList itemsItem = BackendServicesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); BackendServiceAggregatedList expectedResponse = BackendServiceAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -159,50 +159,50 @@ public void aggregatedListBackendServicesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -252,39 +252,39 @@ public void deleteBackendServiceExceptionTest() throws Exception { @SuppressWarnings("all") public void getBackendServiceTest() { Integer affinityCookieTtlSec = 1777486694; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - Boolean enableCDN = false; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; String kind = "kind3292052"; + String sessionAffinity = "sessionAffinity1000759473"; + String description = "description-1724546052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; - String name = "name3373707"; - Integer port = 3446913; String portName = "portName1115276169"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; String protocol = "protocol-989163880"; + Boolean enableCDN = false; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; - String sessionAffinity = "sessionAffinity1000759473"; - Integer timeoutSec = 2067488653; BackendService expectedResponse = BackendService.newBuilder() .setAffinityCookieTtlSec(affinityCookieTtlSec) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEnableCDN(enableCDN) - .setFingerprint(fingerprint) - .setId(id) .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setDescription(description) .setLoadBalancingScheme(loadBalancingScheme) - .setName(name) - .setPort(port) .setPortName(portName) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) .setProtocol(protocol) + .setEnableCDN(enableCDN) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) - .setSessionAffinity(sessionAffinity) - .setTimeoutSec(timeoutSec) .build(); mockService.addResponse(expectedResponse); @@ -384,50 +384,50 @@ public void getHealthBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -477,17 +477,17 @@ public void insertBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listBackendServicesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendService itemsElement = BackendService.newBuilder().build(); List items = Arrays.asList(itemsElement); BackendServiceList expectedResponse = BackendServiceList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -537,50 +537,50 @@ public void listBackendServicesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -632,50 +632,50 @@ public void patchBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index c71464e2913b..5a69e0cf4f9a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -96,18 +96,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListDisksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; DisksScopedList itemsItem = DisksScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); DiskAggregatedList expectedResponse = DiskAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -158,50 +158,50 @@ public void aggregatedListDisksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void createSnapshotDiskTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -253,50 +253,50 @@ public void createSnapshotDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteDiskTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -343,44 +343,44 @@ public void deleteDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getDiskTest() { - String creationTimestamp = "creationTimestamp567396278"; + String sizeGb = "sizeGb2105542105"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String lastDetachTimestamp = "lastDetachTimestamp-480399885"; String description = "description-1724546052"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String type = "type3575610"; + String labelFingerprint = "labelFingerprint714995737"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String options = "options-1249474914"; String id = "id3355"; + String sourceImageId = "sourceImageId-2092155357"; String kind = "kind3292052"; - String labelFingerprint = "labelFingerprint714995737"; String lastAttachTimestamp = "lastAttachTimestamp-2105323995"; - String lastDetachTimestamp = "lastDetachTimestamp-480399885"; - String name = "name3373707"; - String options = "options-1249474914"; String selfLink = "selfLink-1691268851"; - String sizeGb = "sizeGb2105542105"; + String name = "name3373707"; String sourceImage = "sourceImage1661056055"; - String sourceImageId = "sourceImageId-2092155357"; - String sourceSnapshot = "sourceSnapshot-947679896"; - String sourceSnapshotId = "sourceSnapshotId-1511650478"; String status = "status-892481550"; - String type = "type3575610"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Disk expectedResponse = Disk.newBuilder() - .setCreationTimestamp(creationTimestamp) + .setSizeGb(sizeGb) + .setSourceSnapshotId(sourceSnapshotId) + .setLastDetachTimestamp(lastDetachTimestamp) .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setType(type) + .setLabelFingerprint(labelFingerprint) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setOptions(options) .setId(id) + .setSourceImageId(sourceImageId) .setKind(kind) - .setLabelFingerprint(labelFingerprint) .setLastAttachTimestamp(lastAttachTimestamp) - .setLastDetachTimestamp(lastDetachTimestamp) - .setName(name) - .setOptions(options) .setSelfLink(selfLink) - .setSizeGb(sizeGb) + .setName(name) .setSourceImage(sourceImage) - .setSourceImageId(sourceImageId) - .setSourceSnapshot(sourceSnapshot) - .setSourceSnapshotId(sourceSnapshotId) .setStatus(status) - .setType(type) - .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -425,50 +425,50 @@ public void getDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertDiskTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -519,17 +519,17 @@ public void insertDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listDisksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Disk itemsElement = Disk.newBuilder().build(); List items = Arrays.asList(itemsElement); DiskList expectedResponse = DiskList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -579,50 +579,50 @@ public void listDisksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void resizeDiskTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -671,50 +671,50 @@ public void resizeDiskExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsDiskTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java index 8d7d402c9932..7459f7997e95 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java @@ -86,18 +86,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListDiskTypesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; DiskTypesScopedList itemsItem = DiskTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); DiskTypeAggregatedList expectedResponse = DiskTypeAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -149,26 +149,26 @@ public void aggregatedListDiskTypesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getDiskTypeTest() { - String creationTimestamp = "creationTimestamp567396278"; String defaultDiskSizeGb = "defaultDiskSizeGb807490165"; - String description = "description-1724546052"; - String id = "id3355"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String selfLink = "selfLink-1691268851"; + String description = "description-1724546052"; + String id = "id3355"; String validDiskSize = "validDiskSize-1653521184"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String selfLink = "selfLink-1691268851"; DiskType expectedResponse = DiskType.newBuilder() - .setCreationTimestamp(creationTimestamp) .setDefaultDiskSizeGb(defaultDiskSizeGb) - .setDescription(description) - .setId(id) + .setZone(zone.toString()) .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setSelfLink(selfLink) + .setDescription(description) + .setId(id) .setValidDiskSize(validDiskSize) - .setZone(zone.toString()) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -215,17 +215,17 @@ public void getDiskTypeExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listDiskTypesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; DiskType itemsElement = DiskType.newBuilder().build(); List items = Arrays.asList(itemsElement); DiskTypeList expectedResponse = DiskTypeList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java index 7b42faae9039..9532b1fe0654 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteFirewallTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -179,26 +179,26 @@ public void deleteFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getFirewallTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String direction = "direction-962590849"; - String id = "id3355"; String kind = "kind3292052"; - String name = "name3373707"; - ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + String description = "description-1724546052"; Integer priority = 1165461084; + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String direction = "direction-962590849"; Firewall expectedResponse = Firewall.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setDirection(direction) - .setId(id) .setKind(kind) - .setName(name) - .setNetwork(network.toString()) + .setDescription(description) .setPriority(priority) + .setNetwork(network.toString()) .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setDirection(direction) .build(); mockService.addResponse(expectedResponse); @@ -243,50 +243,50 @@ public void getFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertFirewallTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -335,17 +335,17 @@ public void insertFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listFirewallsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Firewall itemsElement = Firewall.newBuilder().build(); List items = Arrays.asList(itemsElement); FirewallList expectedResponse = FirewallList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -395,50 +395,50 @@ public void listFirewallsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchFirewallTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -487,50 +487,50 @@ public void patchFirewallExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateFirewallTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 10be81e2f910..276fe84f04fc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -92,18 +92,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListForwardingRulesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; ForwardingRulesScopedList itemsItem = ForwardingRulesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); ForwardingRuleAggregatedList expectedResponse = ForwardingRuleAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -155,50 +155,50 @@ public void aggregatedListForwardingRulesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteForwardingRuleTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -247,42 +247,42 @@ public void deleteForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getForwardingRuleTest() { - String iPAddress = "iPAddress-551149873"; + String portRange = "portRange217518079"; + String kind = "kind3292052"; String iPProtocol = "iPProtocol323774237"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String id = "id3355"; - String ipVersion = "ipVersion-1315653184"; - String kind = "kind3292052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; - String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - String portRange = "portRange217518079"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; + String target = "target-880905839"; + String ipVersion = "ipVersion-1315653184"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String target = "target-880905839"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String iPAddress = "iPAddress-551149873"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); ForwardingRule expectedResponse = ForwardingRule.newBuilder() - .setIPAddress(iPAddress) + .setPortRange(portRange) + .setKind(kind) .setIPProtocol(iPProtocol) .setBackendService(backendService.toString()) - .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setId(id) - .setIpVersion(ipVersion) - .setKind(kind) .setLoadBalancingScheme(loadBalancingScheme) - .setName(name) .setNetwork(network.toString()) - .setPortRange(portRange) - .setRegion(region.toString()) .setSelfLink(selfLink) - .setSubnetwork(subnetwork.toString()) .setTarget(target) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setIPAddress(iPAddress) + .setRegion(region.toString()) .build(); mockService.addResponse(expectedResponse); @@ -329,50 +329,50 @@ public void getForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertForwardingRuleTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -422,17 +422,17 @@ public void insertForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listForwardingRulesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); List items = Arrays.asList(itemsElement); ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -482,50 +482,50 @@ public void listForwardingRulesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setTargetForwardingRuleTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index 828da82fe12c..b421f542bb85 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteGlobalAddressTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -177,31 +177,31 @@ public void deleteGlobalAddressExceptionTest() throws Exception { public void getGlobalAddressTest() { ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); String addressType = "addressType264307877"; - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String description = "description-1724546052"; - String id = "id3355"; + String selfLink = "selfLink-1691268851"; String ipVersion = "ipVersion-1315653184"; - String kind = "kind3292052"; + ProjectRegionSubnetworkName subnetwork = + ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; + String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; String status = "status-892481550"; - ProjectRegionSubnetworkName subnetwork = - ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) .setAddressType(addressType) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setDescription(description) - .setId(id) + .setSelfLink(selfLink) .setIpVersion(ipVersion) - .setKind(kind) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) .setName(name) + .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) .setStatus(status) - .setSubnetwork(subnetwork.toString()) .build(); mockService.addResponse(expectedResponse); @@ -246,50 +246,50 @@ public void getGlobalAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertGlobalAddressTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -338,17 +338,17 @@ public void insertGlobalAddressExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listGlobalAddressesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Address itemsElement = Address.newBuilder().build(); List
items = Arrays.asList(itemsElement); AddressList expectedResponse = AddressList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index 4799cd2f6d19..3304df1a2989 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -88,50 +88,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteGlobalForwardingRuleTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -180,42 +180,42 @@ public void deleteGlobalForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getGlobalForwardingRuleTest() { - String iPAddress = "iPAddress-551149873"; + String portRange = "portRange217518079"; + String kind = "kind3292052"; String iPProtocol = "iPProtocol323774237"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - String creationTimestamp = "creationTimestamp567396278"; String description = "description-1724546052"; - String id = "id3355"; - String ipVersion = "ipVersion-1315653184"; - String kind = "kind3292052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; - String name = "name3373707"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - String portRange = "portRange217518079"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; + String target = "target-880905839"; + String ipVersion = "ipVersion-1315653184"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - String target = "target-880905839"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String iPAddress = "iPAddress-551149873"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); ForwardingRule expectedResponse = ForwardingRule.newBuilder() - .setIPAddress(iPAddress) + .setPortRange(portRange) + .setKind(kind) .setIPProtocol(iPProtocol) .setBackendService(backendService.toString()) - .setCreationTimestamp(creationTimestamp) .setDescription(description) - .setId(id) - .setIpVersion(ipVersion) - .setKind(kind) .setLoadBalancingScheme(loadBalancingScheme) - .setName(name) .setNetwork(network.toString()) - .setPortRange(portRange) - .setRegion(region.toString()) .setSelfLink(selfLink) - .setSubnetwork(subnetwork.toString()) .setTarget(target) + .setIpVersion(ipVersion) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setIPAddress(iPAddress) + .setRegion(region.toString()) .build(); mockService.addResponse(expectedResponse); @@ -262,50 +262,50 @@ public void getGlobalForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertGlobalForwardingRuleTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -355,17 +355,17 @@ public void insertGlobalForwardingRuleExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listGlobalForwardingRulesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; ForwardingRule itemsElement = ForwardingRule.newBuilder().build(); List items = Arrays.asList(itemsElement); ForwardingRuleList expectedResponse = ForwardingRuleList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -416,50 +416,50 @@ public void listGlobalForwardingRulesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setTargetGlobalForwardingRuleTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java index 0bda5aacd61d..fa158abe61d9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java @@ -88,18 +88,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListGlobalOperationsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; OperationsScopedList itemsItem = OperationsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); OperationAggregatedList expectedResponse = OperationAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -195,50 +195,50 @@ public void deleteGlobalOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getGlobalOperationTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -285,17 +285,17 @@ public void getGlobalOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listGlobalOperationsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); OperationList expectedResponse = OperationList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java index fea2cf4132eb..7a83cf68696e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -182,29 +182,29 @@ public void deleteHealthCheckExceptionTest() throws Exception { @SuppressWarnings("all") public void getHealthCheckTest() { Integer checkIntervalSec = 345561006; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - Integer healthyThreshold = 133658551; - String id = "id3355"; String kind = "kind3292052"; - String name = "name3373707"; - String selfLink = "selfLink-1691268851"; - Integer timeoutSec = 2067488653; + String description = "description-1724546052"; String type = "type3575610"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; Integer unhealthyThreshold = 1838571216; + Integer healthyThreshold = 133658551; + String id = "id3355"; HealthCheck expectedResponse = HealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setHealthyThreshold(healthyThreshold) - .setId(id) .setKind(kind) - .setName(name) - .setSelfLink(selfLink) - .setTimeoutSec(timeoutSec) + .setDescription(description) .setType(type) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) .build(); mockService.addResponse(expectedResponse); @@ -251,50 +251,50 @@ public void getHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -343,17 +343,17 @@ public void insertHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listHealthChecksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; HealthCheck itemsElement = HealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); HealthCheckList expectedResponse = HealthCheckList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -403,50 +403,50 @@ public void listHealthChecksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -497,50 +497,50 @@ public void patchHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index 2f031b4c27be..77f3d4937785 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteHttpHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -182,33 +182,33 @@ public void deleteHttpHealthCheckExceptionTest() throws Exception { @SuppressWarnings("all") public void getHttpHealthCheckTest() { Integer checkIntervalSec = 345561006; - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String description = "description-1724546052"; - Integer healthyThreshold = 133658551; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; String host = "host3208616"; - String id = "id3355"; - String kind = "kind3292052"; String name = "name3373707"; - Integer port = 3446913; - String requestPath = "requestPath1303145429"; - String selfLink = "selfLink-1691268851"; - Integer timeoutSec = 2067488653; Integer unhealthyThreshold = 1838571216; + Integer healthyThreshold = 133658551; + String id = "id3355"; + String requestPath = "requestPath1303145429"; HttpHealthCheck expectedResponse = HttpHealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setDescription(description) - .setHealthyThreshold(healthyThreshold) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setPort(port) + .setCreationTimestamp(creationTimestamp) .setHost(host) - .setId(id) - .setKind(kind) .setName(name) - .setPort(port) - .setRequestPath(requestPath) - .setSelfLink(selfLink) - .setTimeoutSec(timeoutSec) .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .setRequestPath(requestPath) .build(); mockService.addResponse(expectedResponse); @@ -255,50 +255,50 @@ public void getHttpHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertHttpHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -348,17 +348,17 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listHttpHealthChecksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -408,50 +408,50 @@ public void listHttpHealthChecksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchHttpHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -503,50 +503,50 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateHttpHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index 1962d150cf47..d4eb7be0cc59 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteHttpsHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -182,33 +182,33 @@ public void deleteHttpsHealthCheckExceptionTest() throws Exception { @SuppressWarnings("all") public void getHttpsHealthCheckTest() { Integer checkIntervalSec = 345561006; - String creationTimestamp = "creationTimestamp567396278"; + String kind = "kind3292052"; String description = "description-1724546052"; - Integer healthyThreshold = 133658551; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; String host = "host3208616"; - String id = "id3355"; - String kind = "kind3292052"; String name = "name3373707"; - Integer port = 3446913; - String requestPath = "requestPath1303145429"; - String selfLink = "selfLink-1691268851"; - Integer timeoutSec = 2067488653; Integer unhealthyThreshold = 1838571216; + Integer healthyThreshold = 133658551; + String id = "id3355"; + String requestPath = "requestPath1303145429"; HttpsHealthCheck expectedResponse = HttpsHealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) - .setCreationTimestamp(creationTimestamp) + .setKind(kind) .setDescription(description) - .setHealthyThreshold(healthyThreshold) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) + .setPort(port) + .setCreationTimestamp(creationTimestamp) .setHost(host) - .setId(id) - .setKind(kind) .setName(name) - .setPort(port) - .setRequestPath(requestPath) - .setSelfLink(selfLink) - .setTimeoutSec(timeoutSec) .setUnhealthyThreshold(unhealthyThreshold) + .setHealthyThreshold(healthyThreshold) + .setId(id) + .setRequestPath(requestPath) .build(); mockService.addResponse(expectedResponse); @@ -255,50 +255,50 @@ public void getHttpsHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertHttpsHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -348,17 +348,17 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listHttpsHealthChecksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); List items = Arrays.asList(itemsElement); HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -408,50 +408,50 @@ public void listHttpsHealthChecksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchHttpsHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -503,50 +503,50 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateHttpsHealthCheckTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index e7209818cf9a..16fe02854a71 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -91,50 +91,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteImageTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -181,50 +181,50 @@ public void deleteImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deprecateImageTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -273,43 +273,43 @@ public void deprecateImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getImageTest() { - String archiveSizeBytes = "archiveSizeBytes-1766390198"; - String creationTimestamp = "creationTimestamp567396278"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; String description = "description-1724546052"; - String diskSizeGb = "diskSizeGb-757478089"; - ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); - String id = "id3355"; - String kind = "kind3292052"; + String sourceSnapshot = "sourceSnapshot-947679896"; String labelFingerprint = "labelFingerprint714995737"; - String name = "name3373707"; - String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; String sourceDisk = "sourceDisk-85117119"; String sourceDiskId = "sourceDiskId-1693292839"; - String sourceImage = "sourceImage1661056055"; String sourceImageId = "sourceImageId-2092155357"; - String sourceSnapshot = "sourceSnapshot-947679896"; - String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String kind = "kind3292052"; + String selfLink = "selfLink-1691268851"; String sourceType = "sourceType-84625186"; + String name = "name3373707"; + String archiveSizeBytes = "archiveSizeBytes-1766390198"; + String sourceImage = "sourceImage1661056055"; + ProjectGlobalImageFamilyName family = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); + String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; Image expectedResponse = Image.newBuilder() - .setArchiveSizeBytes(archiveSizeBytes) - .setCreationTimestamp(creationTimestamp) + .setSourceSnapshotId(sourceSnapshotId) .setDescription(description) - .setDiskSizeGb(diskSizeGb) - .setFamily(family.toString()) - .setId(id) - .setKind(kind) + .setSourceSnapshot(sourceSnapshot) .setLabelFingerprint(labelFingerprint) - .setName(name) - .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setId(id) .setSourceDisk(sourceDisk) .setSourceDiskId(sourceDiskId) - .setSourceImage(sourceImage) .setSourceImageId(sourceImageId) - .setSourceSnapshot(sourceSnapshot) - .setSourceSnapshotId(sourceSnapshotId) + .setKind(kind) + .setSelfLink(selfLink) .setSourceType(sourceType) + .setName(name) + .setArchiveSizeBytes(archiveSizeBytes) + .setSourceImage(sourceImage) + .setFamily(family.toString()) + .setDiskSizeGb(diskSizeGb) .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -355,43 +355,43 @@ public void getImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getFromFamilyImageTest() { - String archiveSizeBytes = "archiveSizeBytes-1766390198"; - String creationTimestamp = "creationTimestamp567396278"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; String description = "description-1724546052"; - String diskSizeGb = "diskSizeGb-757478089"; - ProjectGlobalImageFamilyName family2 = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); - String id = "id3355"; - String kind = "kind3292052"; + String sourceSnapshot = "sourceSnapshot-947679896"; String labelFingerprint = "labelFingerprint714995737"; - String name = "name3373707"; - String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String id = "id3355"; String sourceDisk = "sourceDisk-85117119"; String sourceDiskId = "sourceDiskId-1693292839"; - String sourceImage = "sourceImage1661056055"; String sourceImageId = "sourceImageId-2092155357"; - String sourceSnapshot = "sourceSnapshot-947679896"; - String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String kind = "kind3292052"; + String selfLink = "selfLink-1691268851"; String sourceType = "sourceType-84625186"; + String name = "name3373707"; + String archiveSizeBytes = "archiveSizeBytes-1766390198"; + String sourceImage = "sourceImage1661056055"; + ProjectGlobalImageFamilyName family2 = ProjectGlobalImageFamilyName.of("[PROJECT]", "[FAMILY]"); + String diskSizeGb = "diskSizeGb-757478089"; String status = "status-892481550"; Image expectedResponse = Image.newBuilder() - .setArchiveSizeBytes(archiveSizeBytes) - .setCreationTimestamp(creationTimestamp) + .setSourceSnapshotId(sourceSnapshotId) .setDescription(description) - .setDiskSizeGb(diskSizeGb) - .setFamily(family2.toString()) - .setId(id) - .setKind(kind) + .setSourceSnapshot(sourceSnapshot) .setLabelFingerprint(labelFingerprint) - .setName(name) - .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) + .setId(id) .setSourceDisk(sourceDisk) .setSourceDiskId(sourceDiskId) - .setSourceImage(sourceImage) .setSourceImageId(sourceImageId) - .setSourceSnapshot(sourceSnapshot) - .setSourceSnapshotId(sourceSnapshotId) + .setKind(kind) + .setSelfLink(selfLink) .setSourceType(sourceType) + .setName(name) + .setArchiveSizeBytes(archiveSizeBytes) + .setSourceImage(sourceImage) + .setFamily(family2.toString()) + .setDiskSizeGb(diskSizeGb) .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -438,50 +438,50 @@ public void getFromFamilyImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertImageTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -532,17 +532,17 @@ public void insertImageExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listImagesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Image itemsElement = Image.newBuilder().build(); List items = Arrays.asList(itemsElement); ImageList expectedResponse = ImageList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -592,50 +592,50 @@ public void listImagesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsImageTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index 92d969d8822b..ccc9b8b8c3ef 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -135,50 +135,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addAccessConfigInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -232,18 +232,18 @@ public void addAccessConfigInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListInstancesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstancesScopedList itemsItem = InstancesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); InstanceAggregatedList expectedResponse = InstanceAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -295,50 +295,50 @@ public void aggregatedListInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void attachDiskInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -389,50 +389,50 @@ public void attachDiskInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -481,50 +481,50 @@ public void deleteInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteAccessConfigInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -578,50 +578,50 @@ public void deleteAccessConfigInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void detachDiskInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; - String name = "name3373707"; - String operationType = "operationType-1432962286"; - Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; - String startTime = "startTime-1573145462"; - String status = "status-892481550"; + String description = "description-1724546052"; String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -673,40 +673,40 @@ public void detachDiskInstanceExceptionTest() throws Exception { @SuppressWarnings("all") public void getInstanceTest() { Boolean canIpForward = true; + String kind = "kind3292052"; + String description = "description-1724546052"; String cpuPlatform = "cpuPlatform947156266"; - String creationTimestamp = "creationTimestamp567396278"; + Boolean startRestricted = true; + String labelFingerprint = "labelFingerprint714995737"; + String statusMessage = "statusMessage-239442758"; Boolean deletionProtection = true; - String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + String minCpuPlatform = "minCpuPlatform-1367699977"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String id = "id3355"; - String kind = "kind3292052"; - String labelFingerprint = "labelFingerprint714995737"; ProjectZoneMachineTypeName machineType = ProjectZoneMachineTypeName.of("[PROJECT]", "[ZONE]", "[MACHINE_TYPE]"); - String minCpuPlatform = "minCpuPlatform-1367699977"; - String name = "name3373707"; - String selfLink = "selfLink-1691268851"; - Boolean startRestricted = true; String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Instance expectedResponse = Instance.newBuilder() .setCanIpForward(canIpForward) - .setCpuPlatform(cpuPlatform) - .setCreationTimestamp(creationTimestamp) - .setDeletionProtection(deletionProtection) - .setDescription(description) - .setId(id) .setKind(kind) + .setDescription(description) + .setCpuPlatform(cpuPlatform) + .setStartRestricted(startRestricted) .setLabelFingerprint(labelFingerprint) - .setMachineType(machineType.toString()) + .setStatusMessage(statusMessage) + .setDeletionProtection(deletionProtection) + .setSelfLink(selfLink) .setMinCpuPlatform(minCpuPlatform) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setSelfLink(selfLink) - .setStartRestricted(startRestricted) + .setId(id) + .setMachineType(machineType.toString()) .setStatus(status) - .setStatusMessage(statusMessage) - .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -753,18 +753,18 @@ public void getInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSerialPortOutputInstanceTest() { + String next = "next3377907"; String contents = "contents-567321830"; String kind = "kind3292052"; - String next = "next3377907"; - String selfLink = "selfLink-1691268851"; String start2 = "start2-1897185387"; + String selfLink = "selfLink-1691268851"; SerialPortOutput expectedResponse = SerialPortOutput.newBuilder() + .setNext(next) .setContents(contents) .setKind(kind) - .setNext(next) - .setSelfLink(selfLink) .setStart(start2) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -815,50 +815,50 @@ public void getSerialPortOutputInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -910,17 +910,17 @@ public void insertInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstancesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Instance itemsElement = Instance.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceList expectedResponse = InstanceList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -970,17 +970,17 @@ public void listInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listReferrersInstancesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Reference itemsElement = Reference.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceListReferrers expectedResponse = InstanceListReferrers.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -1032,50 +1032,50 @@ public void listReferrersInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void resetInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1124,50 +1124,50 @@ public void resetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setDeletionProtectionInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1219,50 +1219,50 @@ public void setDeletionProtectionInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setDiskAutoDeleteInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1316,50 +1316,50 @@ public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1413,50 +1413,50 @@ public void setLabelsInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMachineResourcesInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1512,50 +1512,50 @@ public void setMachineResourcesInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMachineTypeInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) - .setName(name) - .setOperationType(operationType) - .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setStartTime(startTime) - .setStatus(status) + .setDescription(description) .setStatusMessage(statusMessage) - .setTargetId(targetId) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1609,50 +1609,50 @@ public void setMachineTypeInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMetadataInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1703,50 +1703,50 @@ public void setMetadataInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setMinCpuPlatformInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1802,50 +1802,50 @@ public void setMinCpuPlatformInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSchedulingInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1897,50 +1897,50 @@ public void setSchedulingInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setServiceAccountInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1996,50 +1996,50 @@ public void setServiceAccountInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setTagsInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -2090,50 +2090,50 @@ public void setTagsInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void startInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -2182,50 +2182,50 @@ public void startInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void startWithEncryptionKeyInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -2281,50 +2281,50 @@ public void startWithEncryptionKeyInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void stopInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -2373,50 +2373,50 @@ public void stopInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateAccessConfigInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -2472,50 +2472,50 @@ public void updateAccessConfigInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateNetworkInterfaceInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index e14ffe7f673b..42f45526f10e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -99,50 +99,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addInstancesInstanceGroupTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -198,18 +198,18 @@ public void addInstancesInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupsScopedList itemsItem = InstanceGroupsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); InstanceGroupAggregatedList expectedResponse = InstanceGroupAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -261,50 +261,50 @@ public void aggregatedListInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstanceGroupTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -353,33 +353,33 @@ public void deleteInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getInstanceGroupTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; String kind = "kind3292052"; - String name = "name3373707"; + String description = "description-1724546052"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Integer size = 3530753; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setFingerprint(fingerprint) - .setId(id) .setKind(kind) - .setName(name) + .setDescription(description) .setNetwork(network.toString()) - .setRegion(region.toString()) .setSelfLink(selfLink) .setSize(size) - .setSubnetwork(subnetwork.toString()) .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) .build(); mockService.addResponse(expectedResponse); @@ -426,50 +426,50 @@ public void getInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceGroupTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -518,17 +518,17 @@ public void insertInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstanceGroupsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceGroupList expectedResponse = InstanceGroupList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -578,17 +578,17 @@ public void listInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstancesInstanceGroupsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceGroupsListInstances expectedResponse = InstanceGroupsListInstances.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -646,50 +646,50 @@ public void listInstancesInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removeInstancesInstanceGroupTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -745,50 +745,50 @@ public void removeInstancesInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setNamedPortsInstanceGroupTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index 03d06be68ec5..beefb93d91ef 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -105,50 +105,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void abandonInstancesInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -206,9 +206,9 @@ public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception @Test @SuppressWarnings("all") public void aggregatedListInstanceGroupManagersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupManagersScopedList itemsItem = InstanceGroupManagersScopedList.newBuilder().build(); @@ -216,9 +216,9 @@ public void aggregatedListInstanceGroupManagersTest() { items.put("items", itemsItem); InstanceGroupManagerAggregatedList expectedResponse = InstanceGroupManagerAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -271,50 +271,50 @@ public void aggregatedListInstanceGroupManagersExceptionTest() throws Exception @Test @SuppressWarnings("all") public void deleteInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -363,50 +363,50 @@ public void deleteInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstancesInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -464,36 +464,36 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception @Test @SuppressWarnings("all") public void getInstanceGroupManagerTest() { - String baseInstanceName = "baseInstanceName389106439"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; - ProjectZoneInstanceGroupName instanceGroup = - ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); String kind = "kind3292052"; - String name = "name3373707"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String description = "description-1724546052"; + String baseInstanceName = "baseInstanceName389106439"; + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); String selfLink = "selfLink-1691268851"; Integer targetSize = 2084603409; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() - .setBaseInstanceName(baseInstanceName) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setFingerprint(fingerprint) - .setId(id) - .setInstanceGroup(instanceGroup.toString()) .setInstanceTemplate(instanceTemplate.toString()) .setKind(kind) - .setName(name) - .setRegion(region.toString()) + .setDescription(description) + .setBaseInstanceName(baseInstanceName) + .setInstanceGroup(instanceGroup.toString()) .setSelfLink(selfLink) .setTargetSize(targetSize) .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) .build(); mockService.addResponse(expectedResponse); @@ -540,50 +540,50 @@ public void getInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) - .setName(name) - .setOperationType(operationType) - .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) - .setStartTime(startTime) - .setStatus(status) + .setDescription(description) .setStatusMessage(statusMessage) - .setTargetId(targetId) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -633,17 +633,17 @@ public void insertInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstanceGroupManagersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceGroupManagerList expectedResponse = InstanceGroupManagerList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -742,50 +742,50 @@ public void listManagedInstancesInstanceGroupManagersExceptionTest() throws Exce @Test @SuppressWarnings("all") public void recreateInstancesInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -843,50 +843,50 @@ public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exceptio @Test @SuppressWarnings("all") public void resizeInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -938,50 +938,50 @@ public void resizeInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setInstanceTemplateInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -1041,50 +1041,50 @@ public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Except @Test @SuppressWarnings("all") public void setTargetPoolsInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index 5ea4515fa442..cdd2a199e6d5 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteInstanceTemplateTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -177,19 +177,19 @@ public void deleteInstanceTemplateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getInstanceTemplateTest() { + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; String selfLink = "selfLink-1691268851"; InstanceTemplate expectedResponse = InstanceTemplate.newBuilder() + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -237,50 +237,50 @@ public void getInstanceTemplateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInstanceTemplateTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -330,17 +330,17 @@ public void insertInstanceTemplateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstanceTemplatesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceTemplate itemsElement = InstanceTemplate.newBuilder().build(); List items = Arrays.asList(itemsElement); InstanceTemplateList expectedResponse = InstanceTemplateList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java index bcc3820cc148..23dab449c76a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java @@ -91,9 +91,9 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListInterconnectAttachmentsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InterconnectAttachmentsScopedList itemsItem = InterconnectAttachmentsScopedList.newBuilder().build(); @@ -101,9 +101,9 @@ public void aggregatedListInterconnectAttachmentsTest() { items.put("items", itemsItem); InterconnectAttachmentAggregatedList expectedResponse = InterconnectAttachmentAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -156,50 +156,50 @@ public void aggregatedListInterconnectAttachmentsExceptionTest() throws Exceptio @Test @SuppressWarnings("all") public void deleteInterconnectAttachmentTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -252,35 +252,35 @@ public void deleteInterconnectAttachmentExceptionTest() throws Exception { @SuppressWarnings("all") public void getInterconnectAttachmentTest() { String cloudRouterIpAddress = "cloudRouterIpAddress1361134600"; - String creationTimestamp = "creationTimestamp567396278"; - String customerRouterIpAddress = "customerRouterIpAddress-741266063"; - String description = "description-1724546052"; + String operationalStatus = "operationalStatus1274812671"; + String kind = "kind3292052"; String googleReferenceId = "googleReferenceId534944469"; - String id = "id3355"; + String description = "description-1724546052"; ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); - String kind = "kind3292052"; - String name = "name3373707"; - String operationalStatus = "operationalStatus1274812671"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String customerRouterIpAddress = "customerRouterIpAddress-741266063"; + String selfLink = "selfLink-1691268851"; ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InterconnectAttachment expectedResponse = InterconnectAttachment.newBuilder() .setCloudRouterIpAddress(cloudRouterIpAddress) - .setCreationTimestamp(creationTimestamp) - .setCustomerRouterIpAddress(customerRouterIpAddress) - .setDescription(description) + .setOperationalStatus(operationalStatus) + .setKind(kind) .setGoogleReferenceId(googleReferenceId) - .setId(id) + .setDescription(description) .setInterconnect(interconnect.toString()) - .setKind(kind) + .setCustomerRouterIpAddress(customerRouterIpAddress) + .setSelfLink(selfLink) + .setRouter(router.toString()) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationalStatus(operationalStatus) + .setId(id) .setRegion(region.toString()) - .setRouter(router.toString()) - .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -330,50 +330,50 @@ public void getInterconnectAttachmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInterconnectAttachmentTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -425,17 +425,17 @@ public void insertInterconnectAttachmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInterconnectAttachmentsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InterconnectAttachment itemsElement = InterconnectAttachment.newBuilder().build(); List items = Arrays.asList(itemsElement); InterconnectAttachmentList expectedResponse = InterconnectAttachmentList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java index 75568631a30f..730a1e91e71a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java @@ -87,50 +87,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteInterconnectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -179,44 +179,44 @@ public void deleteInterconnectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getInterconnectTest() { - Boolean adminEnabled = false; - String creationTimestamp = "creationTimestamp567396278"; - String customerName = "customerName-2143818164"; - String description = "description-1724546052"; - String googleIpAddress = "googleIpAddress1516847778"; - String googleReferenceId = "googleReferenceId534944469"; - String id = "id3355"; + String operationalStatus = "operationalStatus1274812671"; String interconnectType = "interconnectType2125777995"; + String peerIpAddress = "peerIpAddress-1939747879"; String kind = "kind3292052"; + Integer requestedLinkCount = 1118793211; + String googleReferenceId = "googleReferenceId534944469"; + String description = "description-1724546052"; + String customerName = "customerName-2143818164"; + String selfLink = "selfLink-1691268851"; + Boolean adminEnabled = false; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String linkType = "linkType-1624275873"; String location = "location1901043637"; - String name = "name3373707"; - String nocContactEmail = "nocContactEmail1087814656"; - String operationalStatus = "operationalStatus1274812671"; - String peerIpAddress = "peerIpAddress-1939747879"; Integer provisionedLinkCount = 1199724171; - Integer requestedLinkCount = 1118793211; - String selfLink = "selfLink-1691268851"; + String id = "id3355"; + String googleIpAddress = "googleIpAddress1516847778"; + String nocContactEmail = "nocContactEmail1087814656"; Interconnect expectedResponse = Interconnect.newBuilder() - .setAdminEnabled(adminEnabled) - .setCreationTimestamp(creationTimestamp) - .setCustomerName(customerName) - .setDescription(description) - .setGoogleIpAddress(googleIpAddress) - .setGoogleReferenceId(googleReferenceId) - .setId(id) + .setOperationalStatus(operationalStatus) .setInterconnectType(interconnectType) + .setPeerIpAddress(peerIpAddress) .setKind(kind) + .setRequestedLinkCount(requestedLinkCount) + .setGoogleReferenceId(googleReferenceId) + .setDescription(description) + .setCustomerName(customerName) + .setSelfLink(selfLink) + .setAdminEnabled(adminEnabled) + .setCreationTimestamp(creationTimestamp) + .setName(name) .setLinkType(linkType) .setLocation(location) - .setName(name) - .setNocContactEmail(nocContactEmail) - .setOperationalStatus(operationalStatus) - .setPeerIpAddress(peerIpAddress) .setProvisionedLinkCount(provisionedLinkCount) - .setRequestedLinkCount(requestedLinkCount) - .setSelfLink(selfLink) + .setId(id) + .setGoogleIpAddress(googleIpAddress) + .setNocContactEmail(nocContactEmail) .build(); mockService.addResponse(expectedResponse); @@ -263,50 +263,50 @@ public void getInterconnectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertInterconnectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -355,17 +355,17 @@ public void insertInterconnectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInterconnectsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Interconnect itemsElement = Interconnect.newBuilder().build(); List items = Arrays.asList(itemsElement); InterconnectList expectedResponse = InterconnectList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -415,50 +415,50 @@ public void listInterconnectsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchInterconnectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java index 356a3a0f83c4..47440e971a95 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java @@ -81,34 +81,34 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getInterconnectLocationTest() { + String continent = "continent-403427916"; ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); - String availabilityZone = "availabilityZone-378410992"; String city = "city3053931"; - String continent = "continent-403427916"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String facilityProvider = "facilityProvider2143916045"; - String facilityProviderFacilityId = "facilityProviderFacilityId-1523343611"; - String id = "id3355"; String kind = "kind3292052"; - String name = "name3373707"; + String description = "description-1724546052"; String peeringdbFacilityId = "peeringdbFacilityId-303818"; + String availabilityZone = "availabilityZone-378410992"; + String facilityProviderFacilityId = "facilityProviderFacilityId-1523343611"; String selfLink = "selfLink-1691268851"; + String facilityProvider = "facilityProvider2143916045"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; InterconnectLocation expectedResponse = InterconnectLocation.newBuilder() + .setContinent(continent) .setAddress(address.toString()) - .setAvailabilityZone(availabilityZone) .setCity(city) - .setContinent(continent) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setFacilityProvider(facilityProvider) - .setFacilityProviderFacilityId(facilityProviderFacilityId) - .setId(id) .setKind(kind) - .setName(name) + .setDescription(description) .setPeeringdbFacilityId(peeringdbFacilityId) + .setAvailabilityZone(availabilityZone) + .setFacilityProviderFacilityId(facilityProviderFacilityId) .setSelfLink(selfLink) + .setFacilityProvider(facilityProvider) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) .build(); mockService.addResponse(expectedResponse); @@ -155,17 +155,17 @@ public void getInterconnectLocationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInterconnectLocationsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InterconnectLocation itemsElement = InterconnectLocation.newBuilder().build(); List items = Arrays.asList(itemsElement); InterconnectLocationList expectedResponse = InterconnectLocationList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java index 60efb32d70c2..ae4e7d5e7d36 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java @@ -87,50 +87,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteLicenseTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -178,26 +178,26 @@ public void deleteLicenseExceptionTest() throws Exception { @SuppressWarnings("all") public void getLicenseTest() { Boolean chargesUseFee = true; + String kind = "kind3292052"; + Boolean transferable = false; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; ProjectGlobalLicenseCodeName licenseCode = ProjectGlobalLicenseCodeName.of("[PROJECT]", "[LICENSE_CODE]"); - String name = "name3373707"; String selfLink = "selfLink-1691268851"; - Boolean transferable = false; License expectedResponse = License.newBuilder() .setChargesUseFee(chargesUseFee) + .setKind(kind) + .setTransferable(transferable) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) .setLicenseCode(licenseCode.toString()) - .setName(name) .setSelfLink(selfLink) - .setTransferable(transferable) .build(); mockService.addResponse(expectedResponse); @@ -242,50 +242,50 @@ public void getLicenseExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertLicenseTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -334,15 +334,15 @@ public void insertLicenseExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listLicensesTest() { - String id = "id3355"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; License itemsElement = License.newBuilder().build(); List items = Arrays.asList(itemsElement); LicensesListResponse expectedResponse = LicensesListResponse.newBuilder() - .setId(id) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java index 23764baf9d25..a6faec2c6fa8 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java @@ -78,24 +78,24 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getLicenseCodeTest() { + String kind = "kind3292052"; + Boolean transferable = false; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; - String selfLink = "selfLink-1691268851"; String state = "state109757585"; - Boolean transferable = false; + String selfLink = "selfLink-1691268851"; LicenseCode expectedResponse = LicenseCode.newBuilder() + .setKind(kind) + .setTransferable(transferable) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) - .setSelfLink(selfLink) .setState(state) - .setTransferable(transferable) + .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java index de27b3841cd7..22d06700e10c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java @@ -86,18 +86,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListMachineTypesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; MachineTypesScopedList itemsItem = MachineTypesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); MachineTypeAggregatedList expectedResponse = MachineTypeAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -149,34 +149,34 @@ public void aggregatedListMachineTypesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getMachineTypeTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - Integer guestCpus = 1754126894; - String id = "id3355"; - Integer imageSpaceGb = 461539048; Boolean isSharedCpu = false; + Integer guestCpus = 1754126894; String kind = "kind3292052"; + String description = "description-1724546052"; + String selfLink = "selfLink-1691268851"; + Integer memoryMb = 1726613907; Integer maximumPersistentDisks = 1033091853; String maximumPersistentDisksSizeGb = "maximumPersistentDisksSizeGb-1993209177"; - Integer memoryMb = 1726613907; - String name = "name3373707"; - String selfLink = "selfLink-1691268851"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + Integer imageSpaceGb = 461539048; MachineType expectedResponse = MachineType.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setGuestCpus(guestCpus) - .setId(id) - .setImageSpaceGb(imageSpaceGb) .setIsSharedCpu(isSharedCpu) + .setGuestCpus(guestCpus) .setKind(kind) + .setDescription(description) + .setSelfLink(selfLink) + .setMemoryMb(memoryMb) .setMaximumPersistentDisks(maximumPersistentDisks) .setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb) - .setMemoryMb(memoryMb) - .setName(name) - .setSelfLink(selfLink) .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setImageSpaceGb(imageSpaceGb) .build(); mockService.addResponse(expectedResponse); @@ -223,17 +223,17 @@ public void getMachineTypeExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listMachineTypesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; MachineType itemsElement = MachineType.newBuilder().build(); List items = Arrays.asList(itemsElement); MachineTypeList expectedResponse = MachineTypeList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java index f777e87ede64..c7fa343db950 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -93,50 +93,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addPeeringNetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -188,50 +188,50 @@ public void addPeeringNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteNetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -279,24 +279,24 @@ public void deleteNetworkExceptionTest() throws Exception { @SuppressWarnings("all") public void getNetworkTest() { String iPv4Range = "iPv4Range-534892458"; + String kind = "kind3292052"; Boolean autoCreateSubnetworks = true; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; - String gatewayIPv4 = "gatewayIPv4-1431933859"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; + String gatewayIPv4 = "gatewayIPv4-1431933859"; String selfLink = "selfLink-1691268851"; Network expectedResponse = Network.newBuilder() .setIPv4Range(iPv4Range) + .setKind(kind) .setAutoCreateSubnetworks(autoCreateSubnetworks) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) - .setGatewayIPv4(gatewayIPv4) .setId(id) - .setKind(kind) - .setName(name) + .setGatewayIPv4(gatewayIPv4) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -342,50 +342,50 @@ public void getNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertNetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -434,17 +434,17 @@ public void insertNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listNetworksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Network itemsElement = Network.newBuilder().build(); List items = Arrays.asList(itemsElement); NetworkList expectedResponse = NetworkList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -494,50 +494,50 @@ public void listNetworksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchNetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -586,50 +586,50 @@ public void patchNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removePeeringNetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -681,50 +681,50 @@ public void removePeeringNetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void switchToCustomModeNetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index 8599ab4bf8ca..76277b4bc483 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -102,50 +102,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void disableXpnHostProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -192,50 +192,50 @@ public void disableXpnHostProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void disableXpnResourceProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -289,50 +289,50 @@ public void disableXpnResourceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void enableXpnHostProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -379,50 +379,50 @@ public void enableXpnHostProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void enableXpnResourceProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -475,24 +475,24 @@ public void enableXpnResourceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getProjectTest() { + String xpnProjectStatus = "xpnProjectStatus-308451647"; + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String defaultServiceAccount = "defaultServiceAccount-1848771419"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; + String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; - String xpnProjectStatus = "xpnProjectStatus-308451647"; Project expectedResponse = Project.newBuilder() + .setXpnProjectStatus(xpnProjectStatus) + .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setDefaultServiceAccount(defaultServiceAccount) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) + .setDefaultServiceAccount(defaultServiceAccount) .setSelfLink(selfLink) - .setXpnProjectStatus(xpnProjectStatus) .build(); mockService.addResponse(expectedResponse); @@ -537,24 +537,24 @@ public void getProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getXpnHostProjectTest() { + String xpnProjectStatus = "xpnProjectStatus-308451647"; + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String defaultServiceAccount = "defaultServiceAccount-1848771419"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; + String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; - String xpnProjectStatus = "xpnProjectStatus-308451647"; Project expectedResponse = Project.newBuilder() + .setXpnProjectStatus(xpnProjectStatus) + .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setDefaultServiceAccount(defaultServiceAccount) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) + .setDefaultServiceAccount(defaultServiceAccount) .setSelfLink(selfLink) - .setXpnProjectStatus(xpnProjectStatus) .build(); mockService.addResponse(expectedResponse); @@ -656,17 +656,17 @@ public void getXpnResourcesProjectsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listXpnHostsProjectsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Project itemsElement = Project.newBuilder().build(); List items = Arrays.asList(itemsElement); XpnHostList expectedResponse = XpnHostList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -721,50 +721,50 @@ public void listXpnHostsProjectsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void moveDiskProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -813,50 +813,50 @@ public void moveDiskProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void moveInstanceProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -906,50 +906,50 @@ public void moveInstanceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setCommonInstanceMetadataProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -999,50 +999,50 @@ public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setUsageExportBucketProjectTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index d1a55e6e4488..209d3bf3d330 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteRegionAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -181,28 +181,28 @@ public void deleteRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRegionAutoscalerTest() { + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; String target = "target-880905839"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); Autoscaler expectedResponse = Autoscaler.newBuilder() + .setZone(zone.toString()) + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) .setTarget(target) - .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -249,50 +249,50 @@ public void getRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -341,17 +341,17 @@ public void insertRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionAutoscalersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Autoscaler itemsElement = Autoscaler.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionAutoscalerList expectedResponse = RegionAutoscalerList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -401,50 +401,50 @@ public void listRegionAutoscalersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchRegionAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -496,50 +496,50 @@ public void patchRegionAutoscalerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateRegionAutoscalerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java index 35416267bee0..7b62d5d73271 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -92,50 +92,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteRegionBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -185,39 +185,39 @@ public void deleteRegionBackendServiceExceptionTest() throws Exception { @SuppressWarnings("all") public void getRegionBackendServiceTest() { Integer affinityCookieTtlSec = 1777486694; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - Boolean enableCDN = false; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; String kind = "kind3292052"; + String sessionAffinity = "sessionAffinity1000759473"; + String description = "description-1724546052"; String loadBalancingScheme = "loadBalancingScheme1974502980"; - String name = "name3373707"; - Integer port = 3446913; String portName = "portName1115276169"; + Integer timeoutSec = 2067488653; + String selfLink = "selfLink-1691268851"; String protocol = "protocol-989163880"; + Boolean enableCDN = false; + Integer port = 3446913; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; - String sessionAffinity = "sessionAffinity1000759473"; - Integer timeoutSec = 2067488653; BackendService expectedResponse = BackendService.newBuilder() .setAffinityCookieTtlSec(affinityCookieTtlSec) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEnableCDN(enableCDN) - .setFingerprint(fingerprint) - .setId(id) .setKind(kind) + .setSessionAffinity(sessionAffinity) + .setDescription(description) .setLoadBalancingScheme(loadBalancingScheme) - .setName(name) - .setPort(port) .setPortName(portName) + .setTimeoutSec(timeoutSec) + .setSelfLink(selfLink) .setProtocol(protocol) + .setEnableCDN(enableCDN) + .setPort(port) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) - .setSessionAffinity(sessionAffinity) - .setTimeoutSec(timeoutSec) .build(); mockService.addResponse(expectedResponse); @@ -317,50 +317,50 @@ public void getHealthRegionBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -410,17 +410,17 @@ public void insertRegionBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionBackendServicesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; BackendService itemsElement = BackendService.newBuilder().build(); List items = Arrays.asList(itemsElement); BackendServiceList expectedResponse = BackendServiceList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -471,50 +471,50 @@ public void listRegionBackendServicesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchRegionBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -566,50 +566,50 @@ public void patchRegionBackendServiceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateRegionBackendServiceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java index 898958f3a4a5..d5c49d2e43d9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java @@ -80,20 +80,20 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getRegionTest() { + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; String selfLink = "selfLink-1691268851"; String status = "status-892481550"; Region expectedResponse = Region.newBuilder() + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setSelfLink(selfLink) .setStatus(status) .build(); @@ -140,17 +140,17 @@ public void getRegionExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Region itemsElement = Region.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionList expectedResponse = RegionList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java index 52bd87283eaa..60e5592301dc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java @@ -88,18 +88,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListRegionCommitmentsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; CommitmentsScopedList itemsItem = CommitmentsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); CommitmentAggregatedList expectedResponse = CommitmentAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -151,32 +151,32 @@ public void aggregatedListRegionCommitmentsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRegionCommitmentTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTimestamp = "endTimestamp1004967602"; - String id = "id3355"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String plan = "plan3443497"; + String id = "id3355"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String endTimestamp = "endTimestamp1004967602"; + String plan = "plan3443497"; String startTimestamp = "startTimestamp-1526966919"; String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; Commitment expectedResponse = Commitment.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTimestamp(endTimestamp) - .setId(id) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setPlan(plan) + .setId(id) .setRegion(region.toString()) - .setSelfLink(selfLink) + .setEndTimestamp(endTimestamp) + .setPlan(plan) .setStartTimestamp(startTimestamp) .setStatus(status) - .setStatusMessage(statusMessage) .build(); mockService.addResponse(expectedResponse); @@ -223,50 +223,50 @@ public void getRegionCommitmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionCommitmentTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -315,17 +315,17 @@ public void insertRegionCommitmentExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionCommitmentsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Commitment itemsElement = Commitment.newBuilder().build(); List items = Arrays.asList(itemsElement); CommitmentList expectedResponse = CommitmentList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java index 73d07898de6a..6de861a732a7 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -86,33 +86,33 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getRegionInstanceGroupTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; String kind = "kind3292052"; - String name = "name3373707"; + String description = "description-1724546052"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; Integer size = 3530753; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroup expectedResponse = InstanceGroup.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setFingerprint(fingerprint) - .setId(id) .setKind(kind) - .setName(name) + .setDescription(description) .setNetwork(network.toString()) - .setRegion(region.toString()) .setSelfLink(selfLink) .setSize(size) - .setSubnetwork(subnetwork.toString()) .setZone(zone.toString()) + .setSubnetwork(subnetwork.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) .build(); mockService.addResponse(expectedResponse); @@ -159,17 +159,17 @@ public void getRegionInstanceGroupExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionInstanceGroupsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroup itemsElement = InstanceGroup.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionInstanceGroupList expectedResponse = RegionInstanceGroupList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -220,17 +220,17 @@ public void listRegionInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listInstancesRegionInstanceGroupsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceWithNamedPorts itemsElement = InstanceWithNamedPorts.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionInstanceGroupsListInstances expectedResponse = RegionInstanceGroupsListInstances.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -289,50 +289,50 @@ public void listInstancesRegionInstanceGroupsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setNamedPortsRegionInstanceGroupTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index 7a4ebc32a39a..42b7a3c9d025 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -100,50 +100,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void abandonInstancesRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -207,50 +207,50 @@ public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exc @Test @SuppressWarnings("all") public void deleteRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -302,50 +302,50 @@ public void deleteRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteInstancesRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -409,36 +409,36 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce @Test @SuppressWarnings("all") public void getRegionInstanceGroupManagerTest() { - String baseInstanceName = "baseInstanceName389106439"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; - ProjectZoneInstanceGroupName instanceGroup = - ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); String kind = "kind3292052"; - String name = "name3373707"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String description = "description-1724546052"; + String baseInstanceName = "baseInstanceName389106439"; + ProjectZoneInstanceGroupName instanceGroup = + ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); String selfLink = "selfLink-1691268851"; Integer targetSize = 2084603409; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager expectedResponse = InstanceGroupManager.newBuilder() - .setBaseInstanceName(baseInstanceName) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setFingerprint(fingerprint) - .setId(id) - .setInstanceGroup(instanceGroup.toString()) .setInstanceTemplate(instanceTemplate.toString()) .setKind(kind) - .setName(name) - .setRegion(region.toString()) + .setDescription(description) + .setBaseInstanceName(baseInstanceName) + .setInstanceGroup(instanceGroup.toString()) .setSelfLink(selfLink) .setTargetSize(targetSize) .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setId(id) + .setRegion(region.toString()) .build(); mockService.addResponse(expectedResponse); @@ -488,50 +488,50 @@ public void getRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) - .setName(name) - .setOperationType(operationType) - .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) - .setStartTime(startTime) - .setStatus(status) + .setDescription(description) .setStatusMessage(statusMessage) - .setTargetId(targetId) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -581,17 +581,17 @@ public void insertRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionInstanceGroupManagersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; InstanceGroupManager itemsElement = InstanceGroupManager.newBuilder().build(); List items = Arrays.asList(itemsElement); RegionInstanceGroupManagerList expectedResponse = RegionInstanceGroupManagerList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -692,50 +692,50 @@ public void listManagedInstancesRegionInstanceGroupManagersExceptionTest() throw @Test @SuppressWarnings("all") public void recreateInstancesRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -794,50 +794,50 @@ public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Ex @Test @SuppressWarnings("all") public void resizeRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -891,50 +891,50 @@ public void resizeRegionInstanceGroupManagerExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setInstanceTemplateRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -994,50 +994,50 @@ public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws @Test @SuppressWarnings("all") public void setTargetPoolsRegionInstanceGroupManagerTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java index 5662ccc3fc6f..bc4b8f497e72 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java @@ -127,50 +127,50 @@ public void deleteRegionOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRegionOperationTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -217,17 +217,17 @@ public void getRegionOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRegionOperationsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); OperationList expectedResponse = OperationList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java index f6b209e3914b..4b777ece8835 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteRouteTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -175,38 +175,38 @@ public void deleteRouteExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRouteTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String destRange = "destRange918198624"; - String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; - ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String nextHopGateway = "nextHopGateway-159695614"; - String nextHopInstance = "nextHopInstance1467250071"; - String nextHopIp = "nextHopIp1184061353"; - String nextHopNetwork = "nextHopNetwork1872908524"; + String kind = "kind3292052"; String nextHopPeering = "nextHopPeering-661059074"; - String nextHopVpnTunnel = "nextHopVpnTunnel-1627639147"; + String description = "description-1724546052"; Integer priority = 1165461084; + String nextHopNetwork = "nextHopNetwork1872908524"; + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; + String nextHopInstance = "nextHopInstance1467250071"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String destRange = "destRange918198624"; + String nextHopVpnTunnel = "nextHopVpnTunnel-1627639147"; + String nextHopIp = "nextHopIp1184061353"; + String id = "id3355"; Route expectedResponse = Route.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setDestRange(destRange) - .setId(id) - .setKind(kind) - .setName(name) - .setNetwork(network.toString()) .setNextHopGateway(nextHopGateway) - .setNextHopInstance(nextHopInstance) - .setNextHopIp(nextHopIp) - .setNextHopNetwork(nextHopNetwork) + .setKind(kind) .setNextHopPeering(nextHopPeering) - .setNextHopVpnTunnel(nextHopVpnTunnel) + .setDescription(description) .setPriority(priority) + .setNextHopNetwork(nextHopNetwork) + .setNetwork(network.toString()) .setSelfLink(selfLink) + .setNextHopInstance(nextHopInstance) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDestRange(destRange) + .setNextHopVpnTunnel(nextHopVpnTunnel) + .setNextHopIp(nextHopIp) + .setId(id) .build(); mockService.addResponse(expectedResponse); @@ -251,50 +251,50 @@ public void getRouteExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRouteTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -343,17 +343,17 @@ public void insertRouteExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRoutesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Route itemsElement = Route.newBuilder().build(); List items = Arrays.asList(itemsElement); RouteList expectedResponse = RouteList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 974dc5aeeaf1..38308a2d5f96 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -98,18 +98,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListRoutersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; RoutersScopedList itemsItem = RoutersScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); RouterAggregatedList expectedResponse = RouterAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -160,50 +160,50 @@ public void aggregatedListRoutersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteRouterTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -252,23 +252,23 @@ public void deleteRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getRouterTest() { + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; - ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; Router expectedResponse = Router.newBuilder() + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) - .setNetwork(network.toString()) .setRegion(region.toString()) + .setNetwork(network.toString()) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -363,50 +363,50 @@ public void getRouterStatusRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertRouterTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -455,17 +455,17 @@ public void insertRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listRoutersTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Router itemsElement = Router.newBuilder().build(); List items = Arrays.asList(itemsElement); RouterList expectedResponse = RouterList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -515,50 +515,50 @@ public void listRoutersExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchRouterTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -657,50 +657,50 @@ public void previewRouterExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateRouterTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index b7ab3ec49141..3130b8a9bfdc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteSnapshotTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -175,34 +175,34 @@ public void deleteSnapshotExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSnapshotTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String diskSizeGb = "diskSizeGb-757478089"; - String id = "id3355"; + String sourceDisk = "sourceDisk-85117119"; + String sourceDiskId = "sourceDiskId-1693292839"; String kind = "kind3292052"; + String description = "description-1724546052"; String labelFingerprint = "labelFingerprint714995737"; - String name = "name3373707"; String selfLink = "selfLink-1691268851"; - String sourceDisk = "sourceDisk-85117119"; - String sourceDiskId = "sourceDiskId-1693292839"; - String status = "status-892481550"; - String storageBytes = "storageBytes2035244455"; String storageBytesStatus = "storageBytesStatus1027609994"; + String storageBytes = "storageBytes2035244455"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + String diskSizeGb = "diskSizeGb-757478089"; + String status = "status-892481550"; Snapshot expectedResponse = Snapshot.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setDiskSizeGb(diskSizeGb) - .setId(id) + .setSourceDisk(sourceDisk) + .setSourceDiskId(sourceDiskId) .setKind(kind) + .setDescription(description) .setLabelFingerprint(labelFingerprint) - .setName(name) .setSelfLink(selfLink) - .setSourceDisk(sourceDisk) - .setSourceDiskId(sourceDiskId) - .setStatus(status) - .setStorageBytes(storageBytes) .setStorageBytesStatus(storageBytesStatus) + .setStorageBytes(storageBytes) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) + .setDiskSizeGb(diskSizeGb) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -247,17 +247,17 @@ public void getSnapshotExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSnapshotsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Snapshot itemsElement = Snapshot.newBuilder().build(); List items = Arrays.asList(itemsElement); SnapshotList expectedResponse = SnapshotList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -307,50 +307,50 @@ public void listSnapshotsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setLabelsSnapshotTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java index 5e0d060e1f03..ae37831e11ac 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -85,50 +85,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteSslCertificateTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -177,23 +177,23 @@ public void deleteSslCertificateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSslCertificateTest() { + String privateKey = "privateKey1971943843"; + String kind = "kind3292052"; String certificate = "certificate1952399767"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; - String privateKey = "privateKey1971943843"; String selfLink = "selfLink-1691268851"; SslCertificate expectedResponse = SslCertificate.newBuilder() + .setPrivateKey(privateKey) + .setKind(kind) .setCertificate(certificate) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) - .setPrivateKey(privateKey) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -241,50 +241,50 @@ public void getSslCertificateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertSslCertificateTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -334,17 +334,17 @@ public void insertSslCertificateExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSslCertificatesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; SslCertificate itemsElement = SslCertificate.newBuilder().build(); List items = Arrays.asList(itemsElement); SslCertificateList expectedResponse = SslCertificateList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java index 8cc03e18e52a..6735368b23c3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteSslPolicyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -181,25 +181,25 @@ public void deleteSslPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSslPolicyTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; String kind = "kind3292052"; String minTlsVersion = "minTlsVersion8155943"; - String name = "name3373707"; String profile = "profile-309425751"; + String creationTimestamp = "creationTimestamp567396278"; + String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; String selfLink = "selfLink-1691268851"; SslPolicy expectedResponse = SslPolicy.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setFingerprint(fingerprint) - .setId(id) .setKind(kind) .setMinTlsVersion(minTlsVersion) - .setName(name) .setProfile(profile) + .setCreationTimestamp(creationTimestamp) + .setFingerprint(fingerprint) + .setName(name) + .setDescription(description) + .setId(id) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -247,50 +247,50 @@ public void getSslPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertSslPolicyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -339,17 +339,17 @@ public void insertSslPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSslPoliciesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; SslPolicy itemsElement = SslPolicy.newBuilder().build(); List items = Arrays.asList(itemsElement); SslPoliciesList expectedResponse = SslPoliciesList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -445,50 +445,50 @@ public void listAvailableFeaturesSslPoliciesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchSslPolicyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 610d20e45b67..0c3bb48581df 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -96,18 +96,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListSubnetworksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; SubnetworksScopedList itemsItem = SubnetworksScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); SubnetworkAggregatedList expectedResponse = SubnetworkAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -159,50 +159,50 @@ public void aggregatedListSubnetworksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteSubnetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -251,50 +251,50 @@ public void deleteSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void expandIpCidrRangeSubnetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -350,32 +350,32 @@ public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getSubnetworkTest() { - String creationTimestamp = "creationTimestamp567396278"; + Boolean privateIpGoogleAccess = true; + String kind = "kind3292052"; String description = "description-1724546052"; + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); + String selfLink = "selfLink-1691268851"; + String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; + String name = "name3373707"; String gatewayAddress = "gatewayAddress-77003527"; String id = "id3355"; - String ipCidrRange = "ipCidrRange-2049366326"; - String kind = "kind3292052"; - String name = "name3373707"; - ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - Boolean privateIpGoogleAccess = true; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String ipCidrRange = "ipCidrRange-2049366326"; Subnetwork expectedResponse = Subnetwork.newBuilder() - .setCreationTimestamp(creationTimestamp) + .setPrivateIpGoogleAccess(privateIpGoogleAccess) + .setKind(kind) .setDescription(description) + .setNetwork(network.toString()) + .setSelfLink(selfLink) + .setCreationTimestamp(creationTimestamp) .setFingerprint(fingerprint) + .setName(name) .setGatewayAddress(gatewayAddress) .setId(id) - .setIpCidrRange(ipCidrRange) - .setKind(kind) - .setName(name) - .setNetwork(network.toString()) - .setPrivateIpGoogleAccess(privateIpGoogleAccess) .setRegion(region.toString()) - .setSelfLink(selfLink) + .setIpCidrRange(ipCidrRange) .build(); mockService.addResponse(expectedResponse); @@ -422,50 +422,50 @@ public void getSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertSubnetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -514,17 +514,17 @@ public void insertSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listSubnetworksTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Subnetwork itemsElement = Subnetwork.newBuilder().build(); List items = Arrays.asList(itemsElement); SubnetworkList expectedResponse = SubnetworkList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -574,50 +574,50 @@ public void listSubnetworksExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchSubnetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -668,50 +668,50 @@ public void patchSubnetworkExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setPrivateIpGoogleAccessSubnetworkTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java index 6a117e54749a..73a118e5bf9d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -87,50 +87,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetHttpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -179,22 +179,22 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetHttpProxyTest() { + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; String selfLink = "selfLink-1691268851"; - ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); TargetHttpProxy expectedResponse = TargetHttpProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setSelfLink(selfLink) - .setUrlMap(urlMap.toString()) .build(); mockService.addResponse(expectedResponse); @@ -241,50 +241,50 @@ public void getTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetHttpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -334,17 +334,17 @@ public void insertTargetHttpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetHttpProxiesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetHttpProxy itemsElement = TargetHttpProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetHttpProxyList expectedResponse = TargetHttpProxyList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -394,50 +394,50 @@ public void listTargetHttpProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setUrlMapTargetHttpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index af6e465c55a9..1068db766bd1 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -91,50 +91,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetHttpsProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -183,25 +183,25 @@ public void deleteTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetHttpsProxyTest() { + ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); + String kind = "kind3292052"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; String selfLink = "selfLink-1691268851"; - ProjectGlobalSslPolicyName sslPolicy = - ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); - ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); TargetHttpsProxy expectedResponse = TargetHttpsProxy.newBuilder() + .setUrlMap(urlMap.toString()) + .setKind(kind) + .setSslPolicy(sslPolicy.toString()) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setSelfLink(selfLink) - .setSslPolicy(sslPolicy.toString()) - .setUrlMap(urlMap.toString()) .build(); mockService.addResponse(expectedResponse); @@ -248,50 +248,50 @@ public void getTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetHttpsProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -341,17 +341,17 @@ public void insertTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetHttpsProxiesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetHttpsProxy itemsElement = TargetHttpsProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetHttpsProxyList expectedResponse = TargetHttpsProxyList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -401,50 +401,50 @@ public void listTargetHttpsProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslCertificatesTargetHttpsProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -502,50 +502,50 @@ public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslPolicyTargetHttpsProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -598,50 +598,50 @@ public void setSslPolicyTargetHttpsProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setUrlMapTargetHttpsProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java index 86af3fc154a9..62d4ca7ef7ab 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListTargetInstancesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetInstancesScopedList itemsItem = TargetInstancesScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); TargetInstanceAggregatedList expectedResponse = TargetInstanceAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -153,50 +153,50 @@ public void aggregatedListTargetInstancesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -245,27 +245,27 @@ public void deleteTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetInstanceTest() { - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String id = "id3355"; ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; String natPolicy = "natPolicy-1637703152"; String selfLink = "selfLink-1691268851"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); TargetInstance expectedResponse = TargetInstance.newBuilder() - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setId(id) .setInstance(instance.toString()) + .setZone(zone.toString()) .setKind(kind) + .setCreationTimestamp(creationTimestamp) .setName(name) + .setDescription(description) + .setId(id) .setNatPolicy(natPolicy) .setSelfLink(selfLink) - .setZone(zone.toString()) .build(); mockService.addResponse(expectedResponse); @@ -312,50 +312,50 @@ public void getTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetInstanceTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone2.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -404,17 +404,17 @@ public void insertTargetInstanceExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetInstancesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetInstance itemsElement = TargetInstance.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetInstanceList expectedResponse = TargetInstanceList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java index 877bc5315be4..55c69ddf141d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -102,50 +102,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void addHealthCheckTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -201,50 +201,50 @@ public void addHealthCheckTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void addInstanceTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -298,18 +298,18 @@ public void addInstanceTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListTargetPoolsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetPoolsScopedList itemsItem = TargetPoolsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); TargetPoolAggregatedList expectedResponse = TargetPoolAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -361,50 +361,50 @@ public void aggregatedListTargetPoolsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -453,28 +453,28 @@ public void deleteTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetPoolTest() { - String backupPool = "backupPool1119626361"; + String kind = "kind3292052"; + String sessionAffinity = "sessionAffinity1000759473"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; Float failoverRatio = -8.6107481E7F; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String backupPool = "backupPool1119626361"; String selfLink = "selfLink-1691268851"; - String sessionAffinity = "sessionAffinity1000759473"; TargetPool expectedResponse = TargetPool.newBuilder() - .setBackupPool(backupPool) + .setKind(kind) + .setSessionAffinity(sessionAffinity) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setFailoverRatio(failoverRatio) .setId(id) - .setKind(kind) - .setName(name) .setRegion(region.toString()) + .setBackupPool(backupPool) .setSelfLink(selfLink) - .setSessionAffinity(sessionAffinity) .build(); mockService.addResponse(expectedResponse); @@ -572,50 +572,50 @@ public void getHealthTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -664,17 +664,17 @@ public void insertTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetPoolsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetPool itemsElement = TargetPool.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetPoolList expectedResponse = TargetPoolList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -724,50 +724,50 @@ public void listTargetPoolsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removeHealthCheckTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -823,50 +823,50 @@ public void removeHealthCheckTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void removeInstanceTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -922,50 +922,50 @@ public void removeInstanceTargetPoolExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setBackupTargetPoolTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java index 9576f7597c57..d53c2359b802 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -93,50 +93,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetSslProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -185,27 +185,27 @@ public void deleteTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetSslProxyTest() { + String kind = "kind3292052"; + String service = "service1984153269"; + ProjectGlobalSslPolicyName sslPolicy = + ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; String proxyHeader = "proxyHeader-1987109506"; String selfLink = "selfLink-1691268851"; - String service = "service1984153269"; - ProjectGlobalSslPolicyName sslPolicy = - ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); TargetSslProxy expectedResponse = TargetSslProxy.newBuilder() + .setKind(kind) + .setService(service) + .setSslPolicy(sslPolicy.toString()) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setProxyHeader(proxyHeader) .setSelfLink(selfLink) - .setService(service) - .setSslPolicy(sslPolicy.toString()) .build(); mockService.addResponse(expectedResponse); @@ -252,50 +252,50 @@ public void getTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetSslProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -345,17 +345,17 @@ public void insertTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetSslProxiesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetSslProxy itemsElement = TargetSslProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetSslProxyList expectedResponse = TargetSslProxyList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -405,50 +405,50 @@ public void listTargetSslProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setBackendServiceTargetSslProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -504,50 +504,50 @@ public void setBackendServiceTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setProxyHeaderTargetSslProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -603,50 +603,50 @@ public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslCertificatesTargetSslProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -702,50 +702,50 @@ public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setSslPolicyTargetSslProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java index 080fb907a3e2..067f5a281022 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java @@ -89,50 +89,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetTcpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -181,24 +181,24 @@ public void deleteTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetTcpProxyTest() { + String kind = "kind3292052"; + String service = "service1984153269"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; String proxyHeader = "proxyHeader-1987109506"; String selfLink = "selfLink-1691268851"; - String service = "service1984153269"; TargetTcpProxy expectedResponse = TargetTcpProxy.newBuilder() + .setKind(kind) + .setService(service) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setProxyHeader(proxyHeader) .setSelfLink(selfLink) - .setService(service) .build(); mockService.addResponse(expectedResponse); @@ -245,50 +245,50 @@ public void getTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetTcpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -338,17 +338,17 @@ public void insertTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetTcpProxiesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetTcpProxy itemsElement = TargetTcpProxy.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetTcpProxyList expectedResponse = TargetTcpProxyList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -398,50 +398,50 @@ public void listTargetTcpProxiesExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setBackendServiceTargetTcpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -497,50 +497,50 @@ public void setBackendServiceTargetTcpProxyExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void setProxyHeaderTargetTcpProxyTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java index 936164adc002..e79add735159 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListTargetVpnGatewaysTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetVpnGatewaysScopedList itemsItem = TargetVpnGatewaysScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); TargetVpnGatewayAggregatedList expectedResponse = TargetVpnGatewayAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -154,50 +154,50 @@ public void aggregatedListTargetVpnGatewaysExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteTargetVpnGatewayTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -246,24 +246,24 @@ public void deleteTargetVpnGatewayExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getTargetVpnGatewayTest() { + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; - ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; TargetVpnGateway expectedResponse = TargetVpnGateway.newBuilder() + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) - .setNetwork(network.toString()) .setRegion(region.toString()) + .setNetwork(network.toString()) .setSelfLink(selfLink) .setStatus(status) .build(); @@ -312,50 +312,50 @@ public void getTargetVpnGatewayExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertTargetVpnGatewayTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -405,17 +405,17 @@ public void insertTargetVpnGatewayExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listTargetVpnGatewaysTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; TargetVpnGateway itemsElement = TargetVpnGateway.newBuilder().build(); List items = Arrays.asList(itemsElement); TargetVpnGatewayList expectedResponse = TargetVpnGatewayList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java index 7add1594e548..ddd8b2fd8ee3 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -93,50 +93,50 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void deleteUrlMapTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -183,23 +183,23 @@ public void deleteUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getUrlMapTest() { + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; - String defaultService = "defaultService1980854967"; - String description = "description-1724546052"; String fingerprint = "fingerprint-1375934236"; - String id = "id3355"; - String kind = "kind3292052"; String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String defaultService = "defaultService1980854967"; String selfLink = "selfLink-1691268851"; UrlMap expectedResponse = UrlMap.newBuilder() + .setKind(kind) .setCreationTimestamp(creationTimestamp) - .setDefaultService(defaultService) - .setDescription(description) .setFingerprint(fingerprint) - .setId(id) - .setKind(kind) .setName(name) + .setDescription(description) + .setId(id) + .setDefaultService(defaultService) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); @@ -245,50 +245,50 @@ public void getUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertUrlMapTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -337,50 +337,50 @@ public void insertUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void invalidateCacheUrlMapTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -432,17 +432,17 @@ public void invalidateCacheUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listUrlMapsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; UrlMap itemsElement = UrlMap.newBuilder().build(); List items = Arrays.asList(itemsElement); UrlMapList expectedResponse = UrlMapList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); @@ -492,50 +492,50 @@ public void listUrlMapsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void patchUrlMapTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -584,50 +584,50 @@ public void patchUrlMapExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void updateUrlMapTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java index 550eeb56a2a4..ec71f3dd9208 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -90,18 +90,18 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void aggregatedListVpnTunnelsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; VpnTunnelsScopedList itemsItem = VpnTunnelsScopedList.newBuilder().build(); Map items = new HashMap<>(); items.put("items", itemsItem); VpnTunnelAggregatedList expectedResponse = VpnTunnelAggregatedList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .putAllItems(items) .build(); @@ -153,50 +153,50 @@ public void aggregatedListVpnTunnelsExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void deleteVpnTunnelTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -245,40 +245,40 @@ public void deleteVpnTunnelExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getVpnTunnelTest() { - String creationTimestamp = "creationTimestamp567396278"; + String sharedSecretHash = "sharedSecretHash935752803"; + String kind = "kind3292052"; String description = "description-1724546052"; - String detailedStatus = "detailedStatus-740240799"; - String id = "id3355"; Integer ikeVersion = 1292118044; - String kind = "kind3292052"; - String name = "name3373707"; - String peerIp = "peerIp-690492124"; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String selfLink = "selfLink-1691268851"; + String detailedStatus = "detailedStatus-740240799"; + String peerIp = "peerIp-690492124"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String sharedSecret = "sharedSecret-154938422"; - String sharedSecretHash = "sharedSecretHash935752803"; - String status = "status-892481550"; ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); + String status = "status-892481550"; VpnTunnel expectedResponse = VpnTunnel.newBuilder() - .setCreationTimestamp(creationTimestamp) + .setSharedSecretHash(sharedSecretHash) + .setKind(kind) .setDescription(description) - .setDetailedStatus(detailedStatus) - .setId(id) .setIkeVersion(ikeVersion) - .setKind(kind) - .setName(name) + .setSelfLink(selfLink) + .setRouter(router.toString()) + .setDetailedStatus(detailedStatus) .setPeerIp(peerIp) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) .setRegion(region.toString()) - .setRouter(router.toString()) - .setSelfLink(selfLink) .setSharedSecret(sharedSecret) - .setSharedSecretHash(sharedSecretHash) - .setStatus(status) .setTargetVpnGateway(targetVpnGateway.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -325,50 +325,50 @@ public void getVpnTunnelExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void insertVpnTunnelTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region2.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -417,17 +417,17 @@ public void insertVpnTunnelExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listVpnTunnelsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; VpnTunnel itemsElement = VpnTunnel.newBuilder().build(); List items = Arrays.asList(itemsElement); VpnTunnelList expectedResponse = VpnTunnelList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java index e4831b42ec6e..a2bcabedf199 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java @@ -80,21 +80,21 @@ public static void tearDown() throws Exception { @Test @SuppressWarnings("all") public void getZoneTest() { + String kind = "kind3292052"; String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; String description = "description-1724546052"; String id = "id3355"; - String kind = "kind3292052"; - String name = "name3373707"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; String status = "status-892481550"; Zone expectedResponse = Zone.newBuilder() + .setKind(kind) .setCreationTimestamp(creationTimestamp) + .setName(name) .setDescription(description) .setId(id) - .setKind(kind) - .setName(name) .setRegion(region.toString()) .setSelfLink(selfLink) .setStatus(status) @@ -142,17 +142,17 @@ public void getZoneExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listZonesTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Zone itemsElement = Zone.newBuilder().build(); List items = Arrays.asList(itemsElement); ZoneList expectedResponse = ZoneList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java index 1a189d2b9e30..6b534af7519b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java @@ -127,50 +127,50 @@ public void deleteZoneOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getZoneOperationTest() { - String clientOperationId = "clientOperationId-239630617"; - String creationTimestamp = "creationTimestamp567396278"; - String description = "description-1724546052"; - String endTime = "endTime1725551537"; String httpErrorMessage = "httpErrorMessage1276263769"; - Integer httpErrorStatusCode = 1386087020; - String id = "id3355"; - String insertTime = "insertTime-103148397"; + String targetId = "targetId-815576439"; String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; String name = "name3373707"; - String operationType = "operationType-1432962286"; Integer progress = 1001078227; - ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); - String selfLink = "selfLink-1691268851"; + String operationType = "operationType-1432962286"; String startTime = "startTime-1573145462"; - String status = "status-892481550"; - String statusMessage = "statusMessage-239442758"; - String targetId = "targetId-815576439"; - String targetLink = "targetLink-2084812312"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; String user = "user3599307"; - ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String status = "status-892481550"; Operation expectedResponse = Operation.newBuilder() - .setClientOperationId(clientOperationId) - .setCreationTimestamp(creationTimestamp) - .setDescription(description) - .setEndTime(endTime) .setHttpErrorMessage(httpErrorMessage) - .setHttpErrorStatusCode(httpErrorStatusCode) - .setId(id) - .setInsertTime(insertTime) + .setTargetId(targetId) .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) .setName(name) - .setOperationType(operationType) .setProgress(progress) - .setRegion(region.toString()) - .setSelfLink(selfLink) + .setOperationType(operationType) .setStartTime(startTime) - .setStatus(status) - .setStatusMessage(statusMessage) - .setTargetId(targetId) - .setTargetLink(targetLink) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) .setUser(user) - .setZone(zone.toString()) + .setStatus(status) .build(); mockService.addResponse(expectedResponse); @@ -217,17 +217,17 @@ public void getZoneOperationExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void listZoneOperationsTest() { - String id = "id3355"; String kind = "kind3292052"; String nextPageToken = ""; + String id = "id3355"; String selfLink = "selfLink-1691268851"; Operation itemsElement = Operation.newBuilder().build(); List items = Arrays.asList(itemsElement); OperationList expectedResponse = OperationList.newBuilder() - .setId(id) .setKind(kind) .setNextPageToken(nextPageToken) + .setId(id) .setSelfLink(selfLink) .addAllItems(items) .build(); From f772f496e6bea62aab314ac325be892189e351f6 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 13:35:54 -0700 Subject: [PATCH 20/42] regen again --- .../com/google/cloud/compute/v1/Errors.java | 123 ++-- .../com/google/cloud/compute/v1/Errors2.java | 217 ------- .../cloud/compute/v1/HTTPSHealthCheck.java | 282 --------- .../cloud/compute/v1/HttpHealthCheck.java | 578 ------------------ 4 files changed, 34 insertions(+), 1166 deletions(-) delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index 4a8dc4f78995..8b67be368745 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,7 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,47 +30,33 @@ @Generated("by GAPIC") @BetaApi public final class Errors implements ApiMessage { - private final String code; - private final String location; - private final String message; + private final List errors; private Errors() { - this.code = null; - this.location = null; - this.message = null; + this.errors = null; } - private Errors(String code, String location, String message) { - this.code = code; - this.location = location; - this.message = message; + private Errors(List errors) { + this.errors = errors; } @Override public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("code") && code != null) { - fieldMap.put("code", Collections.singletonList(String.valueOf(code))); - } - if (fieldNames.contains("location") && location != null) { - fieldMap.put("location", Collections.singletonList(String.valueOf(location))); - } - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + if (fieldNames.contains("errors") && errors != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Errors item : errors) { + stringList.add(item.toString()); + } + fieldMap.put("errors", stringList.build()); } return fieldMap; } @Override public String getFieldStringValue(String fieldName) { - if (fieldName.equals("code")) { - return String.valueOf(code); - } - if (fieldName.equals("location")) { - return String.valueOf(location); - } - if (fieldName.equals("message")) { - return String.valueOf(message); + if (fieldName.equals("errors")) { + return String.valueOf(errors); } return null; } @@ -80,16 +67,8 @@ public ApiMessage getApiMessageRequestBody() { return null; } - public String getCode() { - return code; - } - - public String getLocation() { - return location; - } - - public String getMessage() { - return message; + public List getErrorsList() { + return errors; } public static Builder newBuilder() { @@ -115,85 +94,53 @@ public static Errors getDefaultInstance() { } public static class Builder { - private String code; - private String location; - private String message; + private List errors; Builder() {} public Builder mergeFrom(Errors other) { if (other == Errors.getDefaultInstance()) return this; - if (other.getCode() != null) { - this.code = other.code; - } - if (other.getLocation() != null) { - this.location = other.location; - } - if (other.getMessage() != null) { - this.message = other.message; + if (other.getErrorsList() != null) { + this.errors = other.errors; } return this; } Builder(Errors source) { - this.code = source.code; - this.location = source.location; - this.message = source.message; - } - - public String getCode() { - return code; - } - - public Builder setCode(String code) { - this.code = code; - return this; + this.errors = source.errors; } - public String getLocation() { - return location; + public List getErrorsList() { + return errors; } - public Builder setLocation(String location) { - this.location = location; + public Builder addAllErrors(List errors) { + if (this.errors == null) { + this.errors = new ArrayList<>(errors.size()); + } + this.errors.addAll(errors); return this; } - public String getMessage() { - return message; - } - - public Builder setMessage(String message) { - this.message = message; + public Builder addErrors(Errors errors) { + this.errors.add(errors); return this; } public Errors build() { - - return new Errors(code, location, message); + return new Errors(errors); } public Builder clone() { Builder newBuilder = new Builder(); - newBuilder.setCode(this.code); - newBuilder.setLocation(this.location); - newBuilder.setMessage(this.message); + newBuilder.addAllErrors(this.errors); return newBuilder; } } @Override public String toString() { - return "Errors{" - + "code=" - + code - + ", " - + "location=" - + location - + ", " - + "message=" - + message - + "}"; + return "Errors{" + "errors=" + errors + "}"; } @Override @@ -203,15 +150,13 @@ public boolean equals(Object o) { } if (o instanceof Errors) { Errors that = (Errors) o; - return Objects.equals(this.code, that.getCode()) - && Objects.equals(this.location, that.getLocation()) - && Objects.equals(this.message, that.getMessage()); + return Objects.equals(this.errors, that.getErrorsList()); } return false; } @Override public int hashCode() { - return Objects.hash(code, location, message); + return Objects.hash(errors); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java deleted file mode 100644 index aa52e3b03d40..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors2.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class Errors2 implements ApiMessage { - private final String code; - private final String location; - private final String message; - - private Errors2() { - this.code = null; - this.location = null; - this.message = null; - } - - private Errors2(String code, String location, String message) { - this.code = code; - this.location = location; - this.message = message; - } - - @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("code") && code != null) { - fieldMap.put("code", Collections.singletonList(String.valueOf(code))); - } - if (fieldNames.contains("location") && location != null) { - fieldMap.put("location", Collections.singletonList(String.valueOf(location))); - } - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("code")) { - return String.valueOf(code); - } - if (fieldName.equals("location")) { - return String.valueOf(location); - } - if (fieldName.equals("message")) { - return String.valueOf(message); - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - public String getCode() { - return code; - } - - public String getLocation() { - return location; - } - - public String getMessage() { - return message; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(Errors2 prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static Errors2 getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final Errors2 DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new Errors2(); - } - - public static class Builder { - private String code; - private String location; - private String message; - - Builder() {} - - public Builder mergeFrom(Errors2 other) { - if (other == Errors2.getDefaultInstance()) return this; - if (other.getCode() != null) { - this.code = other.code; - } - if (other.getLocation() != null) { - this.location = other.location; - } - if (other.getMessage() != null) { - this.message = other.message; - } - return this; - } - - Builder(Errors2 source) { - this.code = source.code; - this.location = source.location; - this.message = source.message; - } - - public String getCode() { - return code; - } - - public Builder setCode(String code) { - this.code = code; - return this; - } - - public String getLocation() { - return location; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public String getMessage() { - return message; - } - - public Builder setMessage(String message) { - this.message = message; - return this; - } - - public Errors2 build() { - - return new Errors2(code, location, message); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setCode(this.code); - newBuilder.setLocation(this.location); - newBuilder.setMessage(this.message); - return newBuilder; - } - } - - @Override - public String toString() { - return "Errors2{" - + "code=" - + code - + ", " - + "location=" - + location - + ", " - + "message=" - + message - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof Errors2) { - Errors2 that = (Errors2) o; - return Objects.equals(this.code, that.getCode()) - && Objects.equals(this.location, that.getLocation()) - && Objects.equals(this.message, that.getMessage()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash(code, location, message); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java deleted file mode 100644 index f680875f6a13..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class HTTPSHealthCheck implements ApiMessage { - private final String host; - private final Integer port; - private final String portName; - private final String proxyHeader; - private final String requestPath; - - private HTTPSHealthCheck() { - this.host = null; - this.port = null; - this.portName = null; - this.proxyHeader = null; - this.requestPath = null; - } - - private HTTPSHealthCheck( - String host, Integer port, String portName, String proxyHeader, String requestPath) { - this.host = host; - this.port = port; - this.portName = portName; - this.proxyHeader = proxyHeader; - this.requestPath = requestPath; - } - - @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); - } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); - } - if (fieldNames.contains("requestPath") && requestPath != null) { - fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("host")) { - return String.valueOf(host); - } - if (fieldName.equals("port")) { - return String.valueOf(port); - } - if (fieldName.equals("portName")) { - return String.valueOf(portName); - } - if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); - } - if (fieldName.equals("requestPath")) { - return String.valueOf(requestPath); - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - public String getHost() { - return host; - } - - public Integer getPort() { - return port; - } - - public String getPortName() { - return portName; - } - - public String getProxyHeader() { - return proxyHeader; - } - - public String getRequestPath() { - return requestPath; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(HTTPSHealthCheck prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static HTTPSHealthCheck getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final HTTPSHealthCheck DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new HTTPSHealthCheck(); - } - - public static class Builder { - private String host; - private Integer port; - private String portName; - private String proxyHeader; - private String requestPath; - - Builder() {} - - public Builder mergeFrom(HTTPSHealthCheck other) { - if (other == HTTPSHealthCheck.getDefaultInstance()) return this; - if (other.getHost() != null) { - this.host = other.host; - } - if (other.getPort() != null) { - this.port = other.port; - } - if (other.getPortName() != null) { - this.portName = other.portName; - } - if (other.getProxyHeader() != null) { - this.proxyHeader = other.proxyHeader; - } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - return this; - } - - Builder(HTTPSHealthCheck source) { - this.host = source.host; - this.port = source.port; - this.portName = source.portName; - this.proxyHeader = source.proxyHeader; - this.requestPath = source.requestPath; - } - - public String getHost() { - return host; - } - - public Builder setHost(String host) { - this.host = host; - return this; - } - - public Integer getPort() { - return port; - } - - public Builder setPort(Integer port) { - this.port = port; - return this; - } - - public String getPortName() { - return portName; - } - - public Builder setPortName(String portName) { - this.portName = portName; - return this; - } - - public String getProxyHeader() { - return proxyHeader; - } - - public Builder setProxyHeader(String proxyHeader) { - this.proxyHeader = proxyHeader; - return this; - } - - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public HTTPSHealthCheck build() { - - return new HTTPSHealthCheck(host, port, portName, proxyHeader, requestPath); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setHost(this.host); - newBuilder.setPort(this.port); - newBuilder.setPortName(this.portName); - newBuilder.setProxyHeader(this.proxyHeader); - newBuilder.setRequestPath(this.requestPath); - return newBuilder; - } - } - - @Override - public String toString() { - return "HTTPSHealthCheck{" - + "host=" - + host - + ", " - + "port=" - + port - + ", " - + "portName=" - + portName - + ", " - + "proxyHeader=" - + proxyHeader - + ", " - + "requestPath=" - + requestPath - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof HTTPSHealthCheck) { - HTTPSHealthCheck that = (HTTPSHealthCheck) o; - return Objects.equals(this.host, that.getHost()) - && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.portName, that.getPortName()) - && Objects.equals(this.proxyHeader, that.getProxyHeader()) - && Objects.equals(this.requestPath, that.getRequestPath()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash(host, port, portName, proxyHeader, requestPath); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java deleted file mode 100644 index 7f9c75dd4fa0..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class HttpHealthCheck implements ApiMessage { - private final Integer checkIntervalSec; - private final String creationTimestamp; - private final String description; - private final Integer healthyThreshold; - private final String host; - private final String id; - private final String kind; - private final String name; - private final Integer port; - private final String requestPath; - private final String selfLink; - private final Integer timeoutSec; - private final Integer unhealthyThreshold; - - private HttpHealthCheck() { - this.checkIntervalSec = null; - this.creationTimestamp = null; - this.description = null; - this.healthyThreshold = null; - this.host = null; - this.id = null; - this.kind = null; - this.name = null; - this.port = null; - this.requestPath = null; - this.selfLink = null; - this.timeoutSec = null; - this.unhealthyThreshold = null; - } - - private HttpHealthCheck( - Integer checkIntervalSec, - String creationTimestamp, - String description, - Integer healthyThreshold, - String host, - String id, - String kind, - String name, - Integer port, - String requestPath, - String selfLink, - Integer timeoutSec, - Integer unhealthyThreshold) { - this.checkIntervalSec = checkIntervalSec; - this.creationTimestamp = creationTimestamp; - this.description = description; - this.healthyThreshold = healthyThreshold; - this.host = host; - this.id = id; - this.kind = kind; - this.name = name; - this.port = port; - this.requestPath = requestPath; - this.selfLink = selfLink; - this.timeoutSec = timeoutSec; - this.unhealthyThreshold = unhealthyThreshold; - } - - @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { - fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { - fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); - } - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("requestPath") && requestPath != null) { - fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("timeoutSec") && timeoutSec != null) { - fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); - } - if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put( - "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("checkIntervalSec")) { - return String.valueOf(checkIntervalSec); - } - if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); - } - if (fieldName.equals("description")) { - return String.valueOf(description); - } - if (fieldName.equals("healthyThreshold")) { - return String.valueOf(healthyThreshold); - } - if (fieldName.equals("host")) { - return String.valueOf(host); - } - if (fieldName.equals("id")) { - return String.valueOf(id); - } - if (fieldName.equals("kind")) { - return String.valueOf(kind); - } - if (fieldName.equals("name")) { - return String.valueOf(name); - } - if (fieldName.equals("port")) { - return String.valueOf(port); - } - if (fieldName.equals("requestPath")) { - return String.valueOf(requestPath); - } - if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); - } - if (fieldName.equals("timeoutSec")) { - return String.valueOf(timeoutSec); - } - if (fieldName.equals("unhealthyThreshold")) { - return String.valueOf(unhealthyThreshold); - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public String getDescription() { - return description; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public String getHost() { - return host; - } - - public String getId() { - return id; - } - - public String getKind() { - return kind; - } - - public String getName() { - return name; - } - - public Integer getPort() { - return port; - } - - public String getRequestPath() { - return requestPath; - } - - public String getSelfLink() { - return selfLink; - } - - public Integer getTimeoutSec() { - return timeoutSec; - } - - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(HttpHealthCheck prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static HttpHealthCheck getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final HttpHealthCheck DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new HttpHealthCheck(); - } - - public static class Builder { - private Integer checkIntervalSec; - private String creationTimestamp; - private String description; - private Integer healthyThreshold; - private String host; - private String id; - private String kind; - private String name; - private Integer port; - private String requestPath; - private String selfLink; - private Integer timeoutSec; - private Integer unhealthyThreshold; - - Builder() {} - - public Builder mergeFrom(HttpHealthCheck other) { - if (other == HttpHealthCheck.getDefaultInstance()) return this; - if (other.getCheckIntervalSec() != null) { - this.checkIntervalSec = other.checkIntervalSec; - } - if (other.getCreationTimestamp() != null) { - this.creationTimestamp = other.creationTimestamp; - } - if (other.getDescription() != null) { - this.description = other.description; - } - if (other.getHealthyThreshold() != null) { - this.healthyThreshold = other.healthyThreshold; - } - if (other.getHost() != null) { - this.host = other.host; - } - if (other.getId() != null) { - this.id = other.id; - } - if (other.getKind() != null) { - this.kind = other.kind; - } - if (other.getName() != null) { - this.name = other.name; - } - if (other.getPort() != null) { - this.port = other.port; - } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - if (other.getSelfLink() != null) { - this.selfLink = other.selfLink; - } - if (other.getTimeoutSec() != null) { - this.timeoutSec = other.timeoutSec; - } - if (other.getUnhealthyThreshold() != null) { - this.unhealthyThreshold = other.unhealthyThreshold; - } - return this; - } - - Builder(HttpHealthCheck source) { - this.checkIntervalSec = source.checkIntervalSec; - this.creationTimestamp = source.creationTimestamp; - this.description = source.description; - this.healthyThreshold = source.healthyThreshold; - this.host = source.host; - this.id = source.id; - this.kind = source.kind; - this.name = source.name; - this.port = source.port; - this.requestPath = source.requestPath; - this.selfLink = source.selfLink; - this.timeoutSec = source.timeoutSec; - this.unhealthyThreshold = source.unhealthyThreshold; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public Builder setCheckIntervalSec(Integer checkIntervalSec) { - this.checkIntervalSec = checkIntervalSec; - return this; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public Builder setCreationTimestamp(String creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - public String getDescription() { - return description; - } - - public Builder setDescription(String description) { - this.description = description; - return this; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public Builder setHealthyThreshold(Integer healthyThreshold) { - this.healthyThreshold = healthyThreshold; - return this; - } - - public String getHost() { - return host; - } - - public Builder setHost(String host) { - this.host = host; - return this; - } - - public String getId() { - return id; - } - - public Builder setId(String id) { - this.id = id; - return this; - } - - public String getKind() { - return kind; - } - - public Builder setKind(String kind) { - this.kind = kind; - return this; - } - - public String getName() { - return name; - } - - public Builder setName(String name) { - this.name = name; - return this; - } - - public Integer getPort() { - return port; - } - - public Builder setPort(Integer port) { - this.port = port; - return this; - } - - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public String getSelfLink() { - return selfLink; - } - - public Builder setSelfLink(String selfLink) { - this.selfLink = selfLink; - return this; - } - - public Integer getTimeoutSec() { - return timeoutSec; - } - - public Builder setTimeoutSec(Integer timeoutSec) { - this.timeoutSec = timeoutSec; - return this; - } - - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; - } - - public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { - this.unhealthyThreshold = unhealthyThreshold; - return this; - } - - public HttpHealthCheck build() { - - return new HttpHealthCheck( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setCheckIntervalSec(this.checkIntervalSec); - newBuilder.setCreationTimestamp(this.creationTimestamp); - newBuilder.setDescription(this.description); - newBuilder.setHealthyThreshold(this.healthyThreshold); - newBuilder.setHost(this.host); - newBuilder.setId(this.id); - newBuilder.setKind(this.kind); - newBuilder.setName(this.name); - newBuilder.setPort(this.port); - newBuilder.setRequestPath(this.requestPath); - newBuilder.setSelfLink(this.selfLink); - newBuilder.setTimeoutSec(this.timeoutSec); - newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); - return newBuilder; - } - } - - @Override - public String toString() { - return "HttpHealthCheck{" - + "checkIntervalSec=" - + checkIntervalSec - + ", " - + "creationTimestamp=" - + creationTimestamp - + ", " - + "description=" - + description - + ", " - + "healthyThreshold=" - + healthyThreshold - + ", " - + "host=" - + host - + ", " - + "id=" - + id - + ", " - + "kind=" - + kind - + ", " - + "name=" - + name - + ", " - + "port=" - + port - + ", " - + "requestPath=" - + requestPath - + ", " - + "selfLink=" - + selfLink - + ", " - + "timeoutSec=" - + timeoutSec - + ", " - + "unhealthyThreshold=" - + unhealthyThreshold - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof HttpHealthCheck) { - HttpHealthCheck that = (HttpHealthCheck) o; - return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) - && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) - && Objects.equals(this.description, that.getDescription()) - && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) - && Objects.equals(this.host, that.getHost()) - && Objects.equals(this.id, that.getId()) - && Objects.equals(this.kind, that.getKind()) - && Objects.equals(this.name, that.getName()) - && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.requestPath, that.getRequestPath()) - && Objects.equals(this.selfLink, that.getSelfLink()) - && Objects.equals(this.timeoutSec, that.getTimeoutSec()) - && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); - } -} From 7e3403668d6c8fb84ddf7dbbe553b41622eaccb6 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 14:42:56 -0700 Subject: [PATCH 21/42] regen --- .../com/google/cloud/compute/v1/Errors.java | 123 +++++++++++++----- ...PHealthCheck.java => HttpHealthCheck.java} | 30 ++--- ...althCheck2.java => HttpSHealthCheck2.java} | 30 ++--- 3 files changed, 119 insertions(+), 64 deletions(-) rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HTTPHealthCheck.java => HttpHealthCheck.java} (90%) rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HTTPSHealthCheck2.java => HttpSHealthCheck2.java} (89%) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index 8b67be368745..4a8dc4f78995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,8 +17,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; -import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,33 +29,47 @@ @Generated("by GAPIC") @BetaApi public final class Errors implements ApiMessage { - private final List errors; + private final String code; + private final String location; + private final String message; private Errors() { - this.errors = null; + this.code = null; + this.location = null; + this.message = null; } - private Errors(List errors) { - this.errors = errors; + private Errors(String code, String location, String message) { + this.code = code; + this.location = location; + this.message = message; } @Override public Map> populateFieldsInMap(Set fieldNames) { Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("errors") && errors != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Errors item : errors) { - stringList.add(item.toString()); - } - fieldMap.put("errors", stringList.build()); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("location") && location != null) { + fieldMap.put("location", Collections.singletonList(String.valueOf(location))); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); } return fieldMap; } @Override public String getFieldStringValue(String fieldName) { - if (fieldName.equals("errors")) { - return String.valueOf(errors); + if (fieldName.equals("code")) { + return String.valueOf(code); + } + if (fieldName.equals("location")) { + return String.valueOf(location); + } + if (fieldName.equals("message")) { + return String.valueOf(message); } return null; } @@ -67,8 +80,16 @@ public ApiMessage getApiMessageRequestBody() { return null; } - public List getErrorsList() { - return errors; + public String getCode() { + return code; + } + + public String getLocation() { + return location; + } + + public String getMessage() { + return message; } public static Builder newBuilder() { @@ -94,53 +115,85 @@ public static Errors getDefaultInstance() { } public static class Builder { - private List errors; + private String code; + private String location; + private String message; Builder() {} public Builder mergeFrom(Errors other) { if (other == Errors.getDefaultInstance()) return this; - if (other.getErrorsList() != null) { - this.errors = other.errors; + if (other.getCode() != null) { + this.code = other.code; + } + if (other.getLocation() != null) { + this.location = other.location; + } + if (other.getMessage() != null) { + this.message = other.message; } return this; } Builder(Errors source) { - this.errors = source.errors; + this.code = source.code; + this.location = source.location; + this.message = source.message; } - public List getErrorsList() { - return errors; + public String getCode() { + return code; } - public Builder addAllErrors(List errors) { - if (this.errors == null) { - this.errors = new ArrayList<>(errors.size()); - } - this.errors.addAll(errors); + public Builder setCode(String code) { + this.code = code; + return this; + } + + public String getLocation() { + return location; + } + + public Builder setLocation(String location) { + this.location = location; return this; } - public Builder addErrors(Errors errors) { - this.errors.add(errors); + public String getMessage() { + return message; + } + + public Builder setMessage(String message) { + this.message = message; return this; } public Errors build() { - return new Errors(errors); + + return new Errors(code, location, message); } public Builder clone() { Builder newBuilder = new Builder(); - newBuilder.addAllErrors(this.errors); + newBuilder.setCode(this.code); + newBuilder.setLocation(this.location); + newBuilder.setMessage(this.message); return newBuilder; } } @Override public String toString() { - return "Errors{" + "errors=" + errors + "}"; + return "Errors{" + + "code=" + + code + + ", " + + "location=" + + location + + ", " + + "message=" + + message + + "}"; } @Override @@ -150,13 +203,15 @@ public boolean equals(Object o) { } if (o instanceof Errors) { Errors that = (Errors) o; - return Objects.equals(this.errors, that.getErrorsList()); + return Objects.equals(this.code, that.getCode()) + && Objects.equals(this.location, that.getLocation()) + && Objects.equals(this.message, that.getMessage()); } return false; } @Override public int hashCode() { - return Objects.hash(errors); + return Objects.hash(code, location, message); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java similarity index 90% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java index 6d08ac66fdcd..cc37dbe6a9a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java @@ -28,14 +28,14 @@ @Generated("by GAPIC") @BetaApi -public final class HTTPHealthCheck implements ApiMessage { +public final class HttpHealthCheck implements ApiMessage { private final String host; private final Integer port; private final String portName; private final String proxyHeader; private final String requestPath; - private HTTPHealthCheck() { + private HttpHealthCheck() { this.host = null; this.port = null; this.portName = null; @@ -43,7 +43,7 @@ private HTTPHealthCheck() { this.requestPath = null; } - private HTTPHealthCheck( + private HttpHealthCheck( String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; this.port = port; @@ -123,7 +123,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(HTTPHealthCheck prototype) { + public static Builder newBuilder(HttpHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -131,14 +131,14 @@ public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static HTTPHealthCheck getDefaultInstance() { + public static HttpHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final HTTPHealthCheck DEFAULT_INSTANCE; + private static final HttpHealthCheck DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new HTTPHealthCheck(); + DEFAULT_INSTANCE = new HttpHealthCheck(); } public static class Builder { @@ -150,8 +150,8 @@ public static class Builder { Builder() {} - public Builder mergeFrom(HTTPHealthCheck other) { - if (other == HTTPHealthCheck.getDefaultInstance()) return this; + public Builder mergeFrom(HttpHealthCheck other) { + if (other == HttpHealthCheck.getDefaultInstance()) return this; if (other.getHost() != null) { this.host = other.host; } @@ -170,7 +170,7 @@ public Builder mergeFrom(HTTPHealthCheck other) { return this; } - Builder(HTTPHealthCheck source) { + Builder(HttpHealthCheck source) { this.host = source.host; this.port = source.port; this.portName = source.portName; @@ -223,9 +223,9 @@ public Builder setRequestPath(String requestPath) { return this; } - public HTTPHealthCheck build() { + public HttpHealthCheck build() { - return new HTTPHealthCheck(host, port, portName, proxyHeader, requestPath); + return new HttpHealthCheck(host, port, portName, proxyHeader, requestPath); } public Builder clone() { @@ -241,7 +241,7 @@ public Builder clone() { @Override public String toString() { - return "HTTPHealthCheck{" + return "HttpHealthCheck{" + "host=" + host + ", " @@ -264,8 +264,8 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HTTPHealthCheck) { - HTTPHealthCheck that = (HTTPHealthCheck) o; + if (o instanceof HttpHealthCheck) { + HttpHealthCheck that = (HttpHealthCheck) o; return Objects.equals(this.host, that.getHost()) && Objects.equals(this.port, that.getPort()) && Objects.equals(this.portName, that.getPortName()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck2.java similarity index 89% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck2.java index 2c30fb852790..cfbbc4cb5a0c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck2.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck2.java @@ -28,14 +28,14 @@ @Generated("by GAPIC") @BetaApi -public final class HTTPSHealthCheck2 implements ApiMessage { +public final class HttpSHealthCheck2 implements ApiMessage { private final String host; private final Integer port; private final String portName; private final String proxyHeader; private final String requestPath; - private HTTPSHealthCheck2() { + private HttpSHealthCheck2() { this.host = null; this.port = null; this.portName = null; @@ -43,7 +43,7 @@ private HTTPSHealthCheck2() { this.requestPath = null; } - private HTTPSHealthCheck2( + private HttpSHealthCheck2( String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; this.port = port; @@ -123,7 +123,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(HTTPSHealthCheck2 prototype) { + public static Builder newBuilder(HttpSHealthCheck2 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -131,14 +131,14 @@ public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static HTTPSHealthCheck2 getDefaultInstance() { + public static HttpSHealthCheck2 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final HTTPSHealthCheck2 DEFAULT_INSTANCE; + private static final HttpSHealthCheck2 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new HTTPSHealthCheck2(); + DEFAULT_INSTANCE = new HttpSHealthCheck2(); } public static class Builder { @@ -150,8 +150,8 @@ public static class Builder { Builder() {} - public Builder mergeFrom(HTTPSHealthCheck2 other) { - if (other == HTTPSHealthCheck2.getDefaultInstance()) return this; + public Builder mergeFrom(HttpSHealthCheck2 other) { + if (other == HttpSHealthCheck2.getDefaultInstance()) return this; if (other.getHost() != null) { this.host = other.host; } @@ -170,7 +170,7 @@ public Builder mergeFrom(HTTPSHealthCheck2 other) { return this; } - Builder(HTTPSHealthCheck2 source) { + Builder(HttpSHealthCheck2 source) { this.host = source.host; this.port = source.port; this.portName = source.portName; @@ -223,9 +223,9 @@ public Builder setRequestPath(String requestPath) { return this; } - public HTTPSHealthCheck2 build() { + public HttpSHealthCheck2 build() { - return new HTTPSHealthCheck2(host, port, portName, proxyHeader, requestPath); + return new HttpSHealthCheck2(host, port, portName, proxyHeader, requestPath); } public Builder clone() { @@ -241,7 +241,7 @@ public Builder clone() { @Override public String toString() { - return "HTTPSHealthCheck2{" + return "HttpSHealthCheck2{" + "host=" + host + ", " @@ -264,8 +264,8 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HTTPSHealthCheck2) { - HTTPSHealthCheck2 that = (HTTPSHealthCheck2) o; + if (o instanceof HttpSHealthCheck2) { + HttpSHealthCheck2 that = (HttpSHealthCheck2) o; return Objects.equals(this.host, that.getHost()) && Objects.equals(this.port, that.getPort()) && Objects.equals(this.portName, that.getPortName()) From 7a2a5d11ca651d5ba807c351bd5fe05fd79f93de Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 15:52:24 -0700 Subject: [PATCH 22/42] renamed files? --- ...ealthCheck2.java => HttpSHealthCheck.java} | 30 +++++++++---------- ...ealthCheck.java => HttpsHealthCheck2.java} | 30 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HttpSHealthCheck2.java => HttpSHealthCheck.java} (89%) rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HttpsHealthCheck.java => HttpsHealthCheck2.java} (95%) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java similarity index 89% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck2.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java index cfbbc4cb5a0c..d50cb331244c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck2.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java @@ -28,14 +28,14 @@ @Generated("by GAPIC") @BetaApi -public final class HttpSHealthCheck2 implements ApiMessage { +public final class HttpSHealthCheck implements ApiMessage { private final String host; private final Integer port; private final String portName; private final String proxyHeader; private final String requestPath; - private HttpSHealthCheck2() { + private HttpSHealthCheck() { this.host = null; this.port = null; this.portName = null; @@ -43,7 +43,7 @@ private HttpSHealthCheck2() { this.requestPath = null; } - private HttpSHealthCheck2( + private HttpSHealthCheck( String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; this.port = port; @@ -123,7 +123,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(HttpSHealthCheck2 prototype) { + public static Builder newBuilder(HttpSHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -131,14 +131,14 @@ public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static HttpSHealthCheck2 getDefaultInstance() { + public static HttpSHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final HttpSHealthCheck2 DEFAULT_INSTANCE; + private static final HttpSHealthCheck DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new HttpSHealthCheck2(); + DEFAULT_INSTANCE = new HttpSHealthCheck(); } public static class Builder { @@ -150,8 +150,8 @@ public static class Builder { Builder() {} - public Builder mergeFrom(HttpSHealthCheck2 other) { - if (other == HttpSHealthCheck2.getDefaultInstance()) return this; + public Builder mergeFrom(HttpSHealthCheck other) { + if (other == HttpSHealthCheck.getDefaultInstance()) return this; if (other.getHost() != null) { this.host = other.host; } @@ -170,7 +170,7 @@ public Builder mergeFrom(HttpSHealthCheck2 other) { return this; } - Builder(HttpSHealthCheck2 source) { + Builder(HttpSHealthCheck source) { this.host = source.host; this.port = source.port; this.portName = source.portName; @@ -223,9 +223,9 @@ public Builder setRequestPath(String requestPath) { return this; } - public HttpSHealthCheck2 build() { + public HttpSHealthCheck build() { - return new HttpSHealthCheck2(host, port, portName, proxyHeader, requestPath); + return new HttpSHealthCheck(host, port, portName, proxyHeader, requestPath); } public Builder clone() { @@ -241,7 +241,7 @@ public Builder clone() { @Override public String toString() { - return "HttpSHealthCheck2{" + return "HttpSHealthCheck{" + "host=" + host + ", " @@ -264,8 +264,8 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HttpSHealthCheck2) { - HttpSHealthCheck2 that = (HttpSHealthCheck2) o; + if (o instanceof HttpSHealthCheck) { + HttpSHealthCheck that = (HttpSHealthCheck) o; return Objects.equals(this.host, that.getHost()) && Objects.equals(this.port, that.getPort()) && Objects.equals(this.portName, that.getPortName()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java similarity index 95% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java index 013459ba0fab..4523dfd5f2db 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java @@ -28,7 +28,7 @@ @Generated("by GAPIC") @BetaApi -public final class HttpsHealthCheck implements ApiMessage { +public final class HttpsHealthCheck2 implements ApiMessage { private final Integer checkIntervalSec; private final String creationTimestamp; private final String description; @@ -43,7 +43,7 @@ public final class HttpsHealthCheck implements ApiMessage { private final Integer timeoutSec; private final Integer unhealthyThreshold; - private HttpsHealthCheck() { + private HttpsHealthCheck2() { this.checkIntervalSec = null; this.creationTimestamp = null; this.description = null; @@ -59,7 +59,7 @@ private HttpsHealthCheck() { this.unhealthyThreshold = null; } - private HttpsHealthCheck( + private HttpsHealthCheck2( Integer checkIntervalSec, String creationTimestamp, String description, @@ -241,7 +241,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(HttpsHealthCheck prototype) { + public static Builder newBuilder(HttpsHealthCheck2 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -249,14 +249,14 @@ public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static HttpsHealthCheck getDefaultInstance() { + public static HttpsHealthCheck2 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final HttpsHealthCheck DEFAULT_INSTANCE; + private static final HttpsHealthCheck2 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new HttpsHealthCheck(); + DEFAULT_INSTANCE = new HttpsHealthCheck2(); } public static class Builder { @@ -276,8 +276,8 @@ public static class Builder { Builder() {} - public Builder mergeFrom(HttpsHealthCheck other) { - if (other == HttpsHealthCheck.getDefaultInstance()) return this; + public Builder mergeFrom(HttpsHealthCheck2 other) { + if (other == HttpsHealthCheck2.getDefaultInstance()) return this; if (other.getCheckIntervalSec() != null) { this.checkIntervalSec = other.checkIntervalSec; } @@ -320,7 +320,7 @@ public Builder mergeFrom(HttpsHealthCheck other) { return this; } - Builder(HttpsHealthCheck source) { + Builder(HttpsHealthCheck2 source) { this.checkIntervalSec = source.checkIntervalSec; this.creationTimestamp = source.creationTimestamp; this.description = source.description; @@ -453,9 +453,9 @@ public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { return this; } - public HttpsHealthCheck build() { + public HttpsHealthCheck2 build() { - return new HttpsHealthCheck( + return new HttpsHealthCheck2( checkIntervalSec, creationTimestamp, description, @@ -492,7 +492,7 @@ public Builder clone() { @Override public String toString() { - return "HttpsHealthCheck{" + return "HttpsHealthCheck2{" + "checkIntervalSec=" + checkIntervalSec + ", " @@ -539,8 +539,8 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HttpsHealthCheck) { - HttpsHealthCheck that = (HttpsHealthCheck) o; + if (o instanceof HttpsHealthCheck2) { + HttpsHealthCheck2 that = (HttpsHealthCheck2) o; return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && Objects.equals(this.description, that.getDescription()) From 18dc0db6504d6bd37276fae1ecda49b2696ac1b0 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 17:27:56 -0700 Subject: [PATCH 23/42] escape files --- .../google/cloud/compute/v1/HealthCheck.java | 24 +++--- .../compute/v1/HttpHealthCheckClient.java | 78 +++++++++---------- .../cloud/compute/v1/HttpHealthCheckList.java | 16 ++-- .../compute/v1/HttpHealthCheckSettings.java | 4 +- .../compute/v1/HttpsHealthCheckClient.java | 78 +++++++++---------- .../compute/v1/HttpsHealthCheckList.java | 16 ++-- .../compute/v1/HttpsHealthCheckSettings.java | 4 +- .../v1/InsertHttpHealthCheckHttpRequest.java | 14 ++-- .../v1/InsertHttpsHealthCheckHttpRequest.java | 14 ++-- .../v1/PatchHttpHealthCheckHttpRequest.java | 14 ++-- .../v1/PatchHttpsHealthCheckHttpRequest.java | 14 ++-- .../v1/UpdateHttpHealthCheckHttpRequest.java | 14 ++-- .../v1/UpdateHttpsHealthCheckHttpRequest.java | 14 ++-- .../compute/v1/stub/HttpHealthCheckStub.java | 4 +- .../v1/stub/HttpHealthCheckStubSettings.java | 18 ++--- .../v1/stub/HttpJsonHttpHealthCheckStub.java | 18 ++--- .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 18 ++--- .../compute/v1/stub/HttpsHealthCheckStub.java | 4 +- .../v1/stub/HttpsHealthCheckStubSettings.java | 18 ++--- .../compute/v1/HttpHealthCheckClientTest.java | 24 +++--- .../v1/HttpsHealthCheckClientTest.java | 24 +++--- 21 files changed, 216 insertions(+), 216 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java index d7078351de88..5ed8c553fd67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java @@ -33,8 +33,8 @@ public final class HealthCheck implements ApiMessage { private final String creationTimestamp; private final String description; private final Integer healthyThreshold; - private final HTTPHealthCheck httpHealthCheck; - private final HTTPSHealthCheck httpsHealthCheck; + private final HttpHealthCheck httpHealthCheck; + private final HttpSHealthCheck httpsHealthCheck; private final String id; private final String kind; private final String name; @@ -68,8 +68,8 @@ private HealthCheck( String creationTimestamp, String description, Integer healthyThreshold, - HTTPHealthCheck httpHealthCheck, - HTTPSHealthCheck httpsHealthCheck, + HttpHealthCheck httpHealthCheck, + HttpSHealthCheck httpsHealthCheck, String id, String kind, String name, @@ -221,11 +221,11 @@ public Integer getHealthyThreshold() { return healthyThreshold; } - public HTTPHealthCheck getHttpHealthCheck() { + public HttpHealthCheck getHttpHealthCheck() { return httpHealthCheck; } - public HTTPSHealthCheck getHttpsHealthCheck() { + public HttpSHealthCheck getHttpsHealthCheck() { return httpsHealthCheck; } @@ -292,8 +292,8 @@ public static class Builder { private String creationTimestamp; private String description; private Integer healthyThreshold; - private HTTPHealthCheck httpHealthCheck; - private HTTPSHealthCheck httpsHealthCheck; + private HttpHealthCheck httpHealthCheck; + private HttpSHealthCheck httpsHealthCheck; private String id; private String kind; private String name; @@ -410,20 +410,20 @@ public Builder setHealthyThreshold(Integer healthyThreshold) { return this; } - public HTTPHealthCheck getHttpHealthCheck() { + public HttpHealthCheck getHttpHealthCheck() { return httpHealthCheck; } - public Builder setHttpHealthCheck(HTTPHealthCheck httpHealthCheck) { + public Builder setHttpHealthCheck(HttpHealthCheck httpHealthCheck) { this.httpHealthCheck = httpHealthCheck; return this; } - public HTTPSHealthCheck getHttpsHealthCheck() { + public HttpSHealthCheck getHttpsHealthCheck() { return httpsHealthCheck; } - public Builder setHttpsHealthCheck(HTTPSHealthCheck httpsHealthCheck) { + public Builder setHttpsHealthCheck(HttpSHealthCheck httpsHealthCheck) { this.httpsHealthCheck = httpsHealthCheck; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java index b9a350c6b32b..c5712e750ebf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -291,7 +291,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
+   *   HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
    * }
    * 
* @@ -299,7 +299,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck( + public final HttpHealthCheck2 getHttpHealthCheck( ProjectGlobalHttpHealthCheckName httpHealthCheck) { GetHttpHealthCheckHttpRequest request = @@ -319,7 +319,7 @@ public final HttpHealthCheck getHttpHealthCheck( *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
+   *   HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
    * }
    * 
* @@ -327,7 +327,7 @@ public final HttpHealthCheck getHttpHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { + public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) { GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder().setHttpHealthCheck(httpHealthCheck).build(); @@ -347,7 +347,7 @@ public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { * GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() * .setHttpHealthCheck(httpHealthCheck.toString()) * .build(); - * HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(request); + * HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(request); * } *
* @@ -355,7 +355,7 @@ public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { + public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { return getHttpHealthCheckCallable().call(request); } @@ -372,14 +372,14 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re * GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() * .setHttpHealthCheck(httpHealthCheck.toString()) * .build(); - * ApiFuture<HttpHealthCheck> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request); + * ApiFuture<HttpHealthCheck2> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request); * // Do something - * HttpHealthCheck response = future.get(); + * HttpHealthCheck2 response = future.get(); * } *
*/ @BetaApi - public final UnaryCallable + public final UnaryCallable getHttpHealthCheckCallable() { return stub.getHttpHealthCheckCallable(); } @@ -395,7 +395,7 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); * } *
@@ -416,7 +416,7 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, ProjectName project, HttpHealthCheck httpHealthCheckResource) { + String requestId, ProjectName project, HttpHealthCheck2 httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Operation insertHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project.toString(), httpHealthCheckResource); * } *
@@ -459,7 +459,7 @@ public final Operation insertHttpHealthCheck( */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, String project, HttpHealthCheck httpHealthCheckResource) { + String requestId, String project, HttpHealthCheck2 httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() @@ -481,7 +481,7 @@ public final Operation insertHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -510,7 +510,7 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -537,7 +537,7 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
+   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -564,7 +564,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
+   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -592,7 +592,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String proje
    *   ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
+   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -621,7 +621,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *     .build();
    *   ApiFuture<ListHttpHealthChecksPagedResponse> future = httpHealthCheckClient.listHttpHealthChecksPagedCallable().futureCall(request);
    *   // Do something
-   *   for (HttpHealthCheck element : future.get().iterateAll()) {
+   *   for (HttpHealthCheck2 element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -647,7 +647,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *     .build();
    *   while (true) {
    *     HttpHealthCheckList response = httpHealthCheckClient.listHttpHealthChecksCallable().call(request);
-   *     for (HttpHealthCheck element : response.getItemsList()) {
+   *     for (HttpHealthCheck2 element : response.getItemsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -678,7 +678,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
@@ -701,7 +701,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks( public final Operation patchHttpHealthCheck( String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck httpHealthCheckResource) { + HttpHealthCheck2 httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() @@ -724,7 +724,7 @@ public final Operation patchHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource); * } *
@@ -745,7 +745,7 @@ public final Operation patchHttpHealthCheck( */ @BetaApi public final Operation patchHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() @@ -768,7 +768,7 @@ public final Operation patchHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -798,7 +798,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -827,7 +827,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); * } *
@@ -850,7 +850,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ public final Operation updateHttpHealthCheck( String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck httpHealthCheckResource) { + HttpHealthCheck2 httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() @@ -872,7 +872,7 @@ public final Operation updateHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource); * } *
@@ -893,7 +893,7 @@ public final Operation updateHttpHealthCheck( */ @BetaApi public final Operation updateHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() @@ -915,7 +915,7 @@ public final Operation updateHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -944,7 +944,7 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -994,11 +994,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListHttpHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListHttpHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1019,11 +1019,11 @@ private ListHttpHealthChecksPagedResponse(ListHttpHealthChecksPage page) { public static class ListHttpHealthChecksPage extends AbstractPage< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, ListHttpHealthChecksPage> { private ListHttpHealthChecksPage( - PageContext context, + PageContext context, HttpHealthCheckList response) { super(context, response); } @@ -1034,14 +1034,14 @@ private static ListHttpHealthChecksPage createEmptyPage() { @Override protected ListHttpHealthChecksPage createPage( - PageContext context, + PageContext context, HttpHealthCheckList response) { return new ListHttpHealthChecksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1049,7 +1049,7 @@ public ApiFuture createPageAsync( public static class ListHttpHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { private ListHttpHealthChecksFixedSizeCollection( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java index ea58f3cb633c..41c505c42162 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java @@ -32,7 +32,7 @@ @BetaApi public final class HttpHealthCheckList implements ApiMessage { private final String id; - private final List items; + private final List items; private final String kind; private final String nextPageToken; private final String selfLink; @@ -49,7 +49,7 @@ private HttpHealthCheckList() { private HttpHealthCheckList( String id, - List items, + List items, String kind, String nextPageToken, String selfLink, @@ -70,7 +70,7 @@ public Map> populateFieldsInMap(Set fieldNames) { } if (fieldNames.contains("items") && items != null) { ImmutableList.Builder stringList = ImmutableList.builder(); - for (HttpHealthCheck item : items) { + for (HttpHealthCheck2 item : items) { stringList.add(item.toString()); } fieldMap.put("items", stringList.build()); @@ -123,7 +123,7 @@ public String getId() { return id; } - public List getItemsList() { + public List getItemsList() { return items; } @@ -167,7 +167,7 @@ public static HttpHealthCheckList getDefaultInstance() { public static class Builder { private String id; - private List items; + private List items; private String kind; private String nextPageToken; private String selfLink; @@ -216,11 +216,11 @@ public Builder setId(String id) { return this; } - public List getItemsList() { + public List getItemsList() { return items; } - public Builder addAllItems(List items) { + public Builder addAllItems(List items) { if (this.items == null) { this.items = new ArrayList<>(items.size()); } @@ -228,7 +228,7 @@ public Builder addAllItems(List items) { return this; } - public Builder addItems(HttpHealthCheck items) { + public Builder addItems(HttpHealthCheck2 items) { this.items.add(items); return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java index 15442370928d..401569738944 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java @@ -70,7 +70,7 @@ public class HttpHealthCheckSettings extends ClientSettings + public UnaryCallSettings getHttpHealthCheckSettings() { return ((HttpHealthCheckStubSettings) getStubSettings()).getHttpHealthCheckSettings(); } @@ -209,7 +209,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { return getStubSettingsBuilder().getHttpHealthCheckSettings(); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java index 0566c71391df..7e28e051f882 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -291,7 +291,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
+   *   HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
    * }
    * 
* @@ -299,7 +299,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck( + public final HttpsHealthCheck2 getHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = @@ -319,7 +319,7 @@ public final HttpsHealthCheck getHttpsHealthCheck( *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
+   *   HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
    * }
    * 
* @@ -327,7 +327,7 @@ public final HttpsHealthCheck getHttpsHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { + public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder().setHttpsHealthCheck(httpsHealthCheck).build(); @@ -347,7 +347,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { * GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .build(); - * HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(request); + * HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(request); * } *
* @@ -355,7 +355,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { + public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { return getHttpsHealthCheckCallable().call(request); } @@ -372,14 +372,14 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest * GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .build(); - * ApiFuture<HttpsHealthCheck> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request); + * ApiFuture<HttpsHealthCheck2> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request); * // Do something - * HttpsHealthCheck response = future.get(); + * HttpsHealthCheck2 response = future.get(); * } *
*/ @BetaApi - public final UnaryCallable + public final UnaryCallable getHttpsHealthCheckCallable() { return stub.getHttpsHealthCheckCallable(); } @@ -395,7 +395,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); * } *
@@ -416,7 +416,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { + String requestId, ProjectName project, HttpsHealthCheck2 httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Operation insertHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project.toString(), httpsHealthCheckResource); * } *
@@ -459,7 +459,7 @@ public final Operation insertHttpsHealthCheck( */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, String project, HttpsHealthCheck httpsHealthCheckResource) { + String requestId, String project, HttpsHealthCheck2 httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() @@ -481,7 +481,7 @@ public final Operation insertHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -510,7 +510,7 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -537,7 +537,7 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
+   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -564,7 +564,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectNam
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
+   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -592,7 +592,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String pro
    *   ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
+   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -621,7 +621,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    *     .build();
    *   ApiFuture<ListHttpsHealthChecksPagedResponse> future = httpsHealthCheckClient.listHttpsHealthChecksPagedCallable().futureCall(request);
    *   // Do something
-   *   for (HttpsHealthCheck element : future.get().iterateAll()) {
+   *   for (HttpsHealthCheck2 element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -647,7 +647,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    *     .build();
    *   while (true) {
    *     HttpsHealthCheckList response = httpsHealthCheckClient.listHttpsHealthChecksCallable().call(request);
-   *     for (HttpsHealthCheck element : response.getItemsList()) {
+   *     for (HttpsHealthCheck2 element : response.getItemsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -678,7 +678,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
-   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
    * }
    * 
@@ -701,7 +701,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks( public final Operation patchHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId, - HttpsHealthCheck httpsHealthCheckResource) { + HttpsHealthCheck2 httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() @@ -724,7 +724,7 @@ public final Operation patchHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource); * } *
@@ -745,7 +745,7 @@ public final Operation patchHttpsHealthCheck( */ @BetaApi public final Operation patchHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() @@ -768,7 +768,7 @@ public final Operation patchHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -798,7 +798,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -827,7 +827,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); * } *
@@ -850,7 +850,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re public final Operation updateHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId, - HttpsHealthCheck httpsHealthCheckResource) { + HttpsHealthCheck2 httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() @@ -872,7 +872,7 @@ public final Operation updateHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource); * } *
@@ -893,7 +893,7 @@ public final Operation updateHttpsHealthCheck( */ @BetaApi public final Operation updateHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() @@ -915,7 +915,7 @@ public final Operation updateHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -944,7 +944,7 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -994,11 +994,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListHttpsHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = @@ -1020,11 +1020,11 @@ private ListHttpsHealthChecksPagedResponse(ListHttpsHealthChecksPage page) { public static class ListHttpsHealthChecksPage extends AbstractPage< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, ListHttpsHealthChecksPage> { private ListHttpsHealthChecksPage( - PageContext + PageContext context, HttpsHealthCheckList response) { super(context, response); @@ -1036,7 +1036,7 @@ private static ListHttpsHealthChecksPage createEmptyPage() { @Override protected ListHttpsHealthChecksPage createPage( - PageContext + PageContext context, HttpsHealthCheckList response) { return new ListHttpsHealthChecksPage(context, response); @@ -1044,7 +1044,7 @@ protected ListHttpsHealthChecksPage createPage( @Override public ApiFuture createPageAsync( - PageContext + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); @@ -1053,7 +1053,7 @@ public ApiFuture createPageAsync( public static class ListHttpsHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { private ListHttpsHealthChecksFixedSizeCollection( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java index 5f06beffbed9..f238d2e334c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java @@ -32,7 +32,7 @@ @BetaApi public final class HttpsHealthCheckList implements ApiMessage { private final String id; - private final List items; + private final List items; private final String kind; private final String nextPageToken; private final String selfLink; @@ -49,7 +49,7 @@ private HttpsHealthCheckList() { private HttpsHealthCheckList( String id, - List items, + List items, String kind, String nextPageToken, String selfLink, @@ -70,7 +70,7 @@ public Map> populateFieldsInMap(Set fieldNames) { } if (fieldNames.contains("items") && items != null) { ImmutableList.Builder stringList = ImmutableList.builder(); - for (HttpsHealthCheck item : items) { + for (HttpsHealthCheck2 item : items) { stringList.add(item.toString()); } fieldMap.put("items", stringList.build()); @@ -123,7 +123,7 @@ public String getId() { return id; } - public List getItemsList() { + public List getItemsList() { return items; } @@ -167,7 +167,7 @@ public static HttpsHealthCheckList getDefaultInstance() { public static class Builder { private String id; - private List items; + private List items; private String kind; private String nextPageToken; private String selfLink; @@ -216,11 +216,11 @@ public Builder setId(String id) { return this; } - public List getItemsList() { + public List getItemsList() { return items; } - public Builder addAllItems(List items) { + public Builder addAllItems(List items) { if (this.items == null) { this.items = new ArrayList<>(items.size()); } @@ -228,7 +228,7 @@ public Builder addAllItems(List items) { return this; } - public Builder addItems(HttpsHealthCheck items) { + public Builder addItems(HttpsHealthCheck2 items) { this.items.add(items); return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java index 3d8aaecdd7f4..9fb384b220c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java @@ -70,7 +70,7 @@ public class HttpsHealthCheckSettings extends ClientSettings + public UnaryCallSettings getHttpsHealthCheckSettings() { return ((HttpsHealthCheckStubSettings) getStubSettings()).getHttpsHealthCheckSettings(); } @@ -210,7 +210,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { return getStubSettingsBuilder().getHttpsHealthCheckSettings(); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java index 57622c55347b..2d8878494a2e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java @@ -32,7 +32,7 @@ public final class InsertHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; - private final HttpHealthCheck httpHealthCheckResource; + private final HttpHealthCheck2 httpHealthCheckResource; private final String key; private final String prettyPrint; private final String project; @@ -57,7 +57,7 @@ private InsertHttpHealthCheckHttpRequest( String access_token, String callback, String fields, - HttpHealthCheck httpHealthCheckResource, + HttpHealthCheck2 httpHealthCheckResource, String key, String prettyPrint, String project, @@ -151,7 +151,7 @@ public String getFieldStringValue(String fieldName) { @Nullable @Override - public HttpHealthCheck getApiMessageRequestBody() { + public HttpHealthCheck2 getApiMessageRequestBody() { return httpHealthCheckResource; } @@ -167,7 +167,7 @@ public String getFields() { return fields; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -221,7 +221,7 @@ public static class Builder { private String access_token; private String callback; private String fields; - private HttpHealthCheck httpHealthCheckResource; + private HttpHealthCheck2 httpHealthCheckResource; private String key; private String prettyPrint; private String project; @@ -306,11 +306,11 @@ public Builder setFields(String fields) { return this; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java index 3ea591eb9fe7..5be147a7e9ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java @@ -32,7 +32,7 @@ public final class InsertHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; - private final HttpsHealthCheck httpsHealthCheckResource; + private final HttpsHealthCheck2 httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String project; @@ -57,7 +57,7 @@ private InsertHttpsHealthCheckHttpRequest( String access_token, String callback, String fields, - HttpsHealthCheck httpsHealthCheckResource, + HttpsHealthCheck2 httpsHealthCheckResource, String key, String prettyPrint, String project, @@ -151,7 +151,7 @@ public String getFieldStringValue(String fieldName) { @Nullable @Override - public HttpsHealthCheck getApiMessageRequestBody() { + public HttpsHealthCheck2 getApiMessageRequestBody() { return httpsHealthCheckResource; } @@ -167,7 +167,7 @@ public String getFields() { return fields; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -221,7 +221,7 @@ public static class Builder { private String access_token; private String callback; private String fields; - private HttpsHealthCheck httpsHealthCheckResource; + private HttpsHealthCheck2 httpsHealthCheckResource; private String key; private String prettyPrint; private String project; @@ -306,11 +306,11 @@ public Builder setFields(String fields) { return this; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index 7c19dba609e6..5d21363c4307 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -33,7 +33,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpHealthCheck; - private final HttpHealthCheck httpHealthCheckResource; + private final HttpHealthCheck2 httpHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +58,7 @@ private PatchHttpHealthCheckHttpRequest( String callback, String fields, String httpHealthCheck, - HttpHealthCheck httpHealthCheckResource, + HttpHealthCheck2 httpHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -151,7 +151,7 @@ public String getFieldStringValue(String fieldName) { @Nullable @Override - public HttpHealthCheck getApiMessageRequestBody() { + public HttpHealthCheck2 getApiMessageRequestBody() { return httpHealthCheckResource; } @@ -171,7 +171,7 @@ public String getHttpHealthCheck() { return httpHealthCheck; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -222,7 +222,7 @@ public static class Builder { private String callback; private String fields; private String httpHealthCheck; - private HttpHealthCheck httpHealthCheckResource; + private HttpHealthCheck2 httpHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +315,11 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { return this; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index 2a35068d4ccc..fe2a163ad132 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -33,7 +33,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpsHealthCheck; - private final HttpsHealthCheck httpsHealthCheckResource; + private final HttpsHealthCheck2 httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +58,7 @@ private PatchHttpsHealthCheckHttpRequest( String callback, String fields, String httpsHealthCheck, - HttpsHealthCheck httpsHealthCheckResource, + HttpsHealthCheck2 httpsHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -151,7 +151,7 @@ public String getFieldStringValue(String fieldName) { @Nullable @Override - public HttpsHealthCheck getApiMessageRequestBody() { + public HttpsHealthCheck2 getApiMessageRequestBody() { return httpsHealthCheckResource; } @@ -171,7 +171,7 @@ public String getHttpsHealthCheck() { return httpsHealthCheck; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -222,7 +222,7 @@ public static class Builder { private String callback; private String fields; private String httpsHealthCheck; - private HttpsHealthCheck httpsHealthCheckResource; + private HttpsHealthCheck2 httpsHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +315,11 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { return this; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index 01db2ddc00e5..69dcd7676c08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -33,7 +33,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpHealthCheck; - private final HttpHealthCheck httpHealthCheckResource; + private final HttpHealthCheck2 httpHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +58,7 @@ private UpdateHttpHealthCheckHttpRequest( String callback, String fields, String httpHealthCheck, - HttpHealthCheck httpHealthCheckResource, + HttpHealthCheck2 httpHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -151,7 +151,7 @@ public String getFieldStringValue(String fieldName) { @Nullable @Override - public HttpHealthCheck getApiMessageRequestBody() { + public HttpHealthCheck2 getApiMessageRequestBody() { return httpHealthCheckResource; } @@ -171,7 +171,7 @@ public String getHttpHealthCheck() { return httpHealthCheck; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -222,7 +222,7 @@ public static class Builder { private String callback; private String fields; private String httpHealthCheck; - private HttpHealthCheck httpHealthCheckResource; + private HttpHealthCheck2 httpHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +315,11 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { return this; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index 59c3de37c5fc..311f25262dde 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -33,7 +33,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpsHealthCheck; - private final HttpsHealthCheck httpsHealthCheckResource; + private final HttpsHealthCheck2 httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +58,7 @@ private UpdateHttpsHealthCheckHttpRequest( String callback, String fields, String httpsHealthCheck, - HttpsHealthCheck httpsHealthCheckResource, + HttpsHealthCheck2 httpsHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -151,7 +151,7 @@ public String getFieldStringValue(String fieldName) { @Nullable @Override - public HttpsHealthCheck getApiMessageRequestBody() { + public HttpsHealthCheck2 getApiMessageRequestBody() { return httpsHealthCheckResource; } @@ -171,7 +171,7 @@ public String getHttpsHealthCheck() { return httpsHealthCheck; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -222,7 +222,7 @@ public static class Builder { private String callback; private String fields; private String httpsHealthCheck; - private HttpsHealthCheck httpsHealthCheckResource; + private HttpsHealthCheck2 httpsHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +315,11 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { return this; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java index cb558664719b..e6082da7b418 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java @@ -22,7 +22,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; +import com.google.cloud.compute.v1.HttpHealthCheck2; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -48,7 +48,7 @@ public abstract class HttpHealthCheckStub implements BackgroundResource { } @BetaApi - public UnaryCallable + public UnaryCallable getHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpHealthCheckCallable()"); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java index 2b87e564af72..de9b9729bf7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java @@ -41,7 +41,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; +import com.google.cloud.compute.v1.HttpHealthCheck2; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -100,7 +100,7 @@ public class HttpHealthCheckStubSettings extends StubSettings deleteHttpHealthCheckSettings; - private final UnaryCallSettings + private final UnaryCallSettings getHttpHealthCheckSettings; private final UnaryCallSettings insertHttpHealthCheckSettings; @@ -119,7 +119,7 @@ public class HttpHealthCheckStubSettings extends StubSettings + public UnaryCallSettings getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } @@ -233,10 +233,10 @@ protected HttpHealthCheckStubSettings(Builder settingsBuilder) throws IOExceptio } private static final PagedListDescriptor< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck> + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2> LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC = new PagedListDescriptor< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck>() { + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2>() { @Override public String emptyToken() { return ""; @@ -269,7 +269,7 @@ public String extractNextToken(HttpHealthCheckList payload) { } @Override - public Iterable extractResources(HttpHealthCheckList payload) { + public Iterable extractResources(HttpHealthCheckList payload) { return payload.getItemsList(); } }; @@ -286,7 +286,7 @@ public ApiFuture getFuturePagedResponse( ListHttpHealthChecksHttpRequest request, ApiCallContext context, ApiFuture futureResponse) { - PageContext + PageContext pageContext = PageContext.create( callable, LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC, request, context); @@ -300,7 +300,7 @@ public static class Builder extends StubSettings.Builder deleteHttpHealthCheckSettings; - private final UnaryCallSettings.Builder + private final UnaryCallSettings.Builder getHttpHealthCheckSettings; private final UnaryCallSettings.Builder insertHttpHealthCheckSettings; @@ -465,7 +465,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index 705a707b8b9a..81608d82162f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -32,7 +32,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; +import com.google.cloud.compute.v1.HttpHealthCheck2; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -78,9 +78,9 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .build(); @InternalApi - public static final ApiMethodDescriptor + public static final ApiMethodDescriptor getHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() + ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.httpHealthChecks.get") .setHttpMethod(HttpMethods.GET) .setRequestFormatter( @@ -94,8 +94,8 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setResourceNameField("httpHealthCheck") .build()) .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpHealthCheck.getDefaultInstance()) + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheck2.getDefaultInstance()) .build()) .build(); @@ -188,7 +188,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { private final UnaryCallable deleteHttpHealthCheckCallable; - private final UnaryCallable + private final UnaryCallable getHttpHealthCheckCallable; private final UnaryCallable insertHttpHealthCheckCallable; @@ -247,9 +247,9 @@ protected HttpJsonHttpHealthCheckStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteHttpHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings + HttpJsonCallSettings getHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() + HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHttpHealthCheckMethodDescriptor) .build(); HttpJsonCallSettings @@ -319,7 +319,7 @@ protected HttpJsonHttpHealthCheckStub( } @BetaApi - public UnaryCallable + public UnaryCallable getHttpHealthCheckCallable() { return getHttpHealthCheckCallable; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 03bb840ed555..78de998d5342 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -32,7 +32,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; +import com.google.cloud.compute.v1.HttpsHealthCheck2; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -78,9 +78,9 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .build(); @InternalApi - public static final ApiMethodDescriptor + public static final ApiMethodDescriptor getHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() + ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.httpsHealthChecks.get") .setHttpMethod(HttpMethods.GET) .setRequestFormatter( @@ -94,8 +94,8 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setResourceNameField("httpsHealthCheck") .build()) .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpsHealthCheck.getDefaultInstance()) + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheck2.getDefaultInstance()) .build()) .build(); @@ -188,7 +188,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { private final UnaryCallable deleteHttpsHealthCheckCallable; - private final UnaryCallable + private final UnaryCallable getHttpsHealthCheckCallable; private final UnaryCallable insertHttpsHealthCheckCallable; @@ -247,9 +247,9 @@ protected HttpJsonHttpsHealthCheckStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteHttpsHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings + HttpJsonCallSettings getHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() + HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHttpsHealthCheckMethodDescriptor) .build(); HttpJsonCallSettings @@ -320,7 +320,7 @@ protected HttpJsonHttpsHealthCheckStub( } @BetaApi - public UnaryCallable + public UnaryCallable getHttpsHealthCheckCallable() { return getHttpsHealthCheckCallable; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index f6582569ef6a..d6aaec5a5746 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -22,7 +22,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; +import com.google.cloud.compute.v1.HttpsHealthCheck2; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -48,7 +48,7 @@ public abstract class HttpsHealthCheckStub implements BackgroundResource { } @BetaApi - public UnaryCallable + public UnaryCallable getHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java index 48faa8d142a0..472f3abbd654 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java @@ -41,7 +41,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; +import com.google.cloud.compute.v1.HttpsHealthCheck2; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -100,7 +100,7 @@ public class HttpsHealthCheckStubSettings extends StubSettings deleteHttpsHealthCheckSettings; - private final UnaryCallSettings + private final UnaryCallSettings getHttpsHealthCheckSettings; private final UnaryCallSettings insertHttpsHealthCheckSettings; @@ -120,7 +120,7 @@ public class HttpsHealthCheckStubSettings extends StubSettings + public UnaryCallSettings getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } @@ -235,10 +235,10 @@ protected HttpsHealthCheckStubSettings(Builder settingsBuilder) throws IOExcepti } private static final PagedListDescriptor< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck> + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2> LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC = new PagedListDescriptor< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck>() { + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2>() { @Override public String emptyToken() { return ""; @@ -271,7 +271,7 @@ public String extractNextToken(HttpsHealthCheckList payload) { } @Override - public Iterable extractResources(HttpsHealthCheckList payload) { + public Iterable extractResources(HttpsHealthCheckList payload) { return payload.getItemsList(); } }; @@ -289,7 +289,7 @@ public ApiFuture getFuturePagedResponse( ListHttpsHealthChecksHttpRequest request, ApiCallContext context, ApiFuture futureResponse) { - PageContext + PageContext pageContext = PageContext.create( callable, LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC, request, context); @@ -303,7 +303,7 @@ public static class Builder extends StubSettings.Builder deleteHttpsHealthCheckSettings; - private final UnaryCallSettings.Builder + private final UnaryCallSettings.Builder getHttpsHealthCheckSettings; private final UnaryCallSettings.Builder insertHttpsHealthCheckSettings; @@ -469,7 +469,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index 77f3d4937785..e0af34e68892 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -194,8 +194,8 @@ public void getHttpHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpHealthCheck expectedResponse = - HttpHealthCheck.newBuilder() + HttpHealthCheck2 expectedResponse = + HttpHealthCheck2.newBuilder() .setCheckIntervalSec(checkIntervalSec) .setKind(kind) .setDescription(description) @@ -215,7 +215,7 @@ public void getHttpHealthCheckTest() { ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck actualResponse = client.getHttpHealthCheck(httpHealthCheck); + HttpHealthCheck2 actualResponse = client.getHttpHealthCheck(httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -304,7 +304,7 @@ public void insertHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); @@ -336,7 +336,7 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); Assert.fail("No exception raised"); @@ -352,8 +352,8 @@ public void listHttpHealthChecksTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); - List items = Arrays.asList(itemsElement); + HttpHealthCheck2 itemsElement = HttpHealthCheck2.newBuilder().build(); + List items = Arrays.asList(itemsElement); HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() .setKind(kind) @@ -368,7 +368,7 @@ public void listHttpHealthChecksTest() { ListHttpHealthChecksPagedResponse pagedListResponse = client.listHttpHealthChecks(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); @@ -458,7 +458,7 @@ public void patchHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -491,7 +491,7 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); @@ -553,7 +553,7 @@ public void updateHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -586,7 +586,7 @@ public void updateHttpHealthCheckExceptionTest() throws Exception { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index d4eb7be0cc59..efe3e12c9789 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -194,8 +194,8 @@ public void getHttpsHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpsHealthCheck expectedResponse = - HttpsHealthCheck.newBuilder() + HttpsHealthCheck2 expectedResponse = + HttpsHealthCheck2.newBuilder() .setCheckIntervalSec(checkIntervalSec) .setKind(kind) .setDescription(description) @@ -215,7 +215,7 @@ public void getHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - HttpsHealthCheck actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); + HttpsHealthCheck2 actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -304,7 +304,7 @@ public void insertHttpsHealthCheckTest() { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); @@ -336,7 +336,7 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); Assert.fail("No exception raised"); @@ -352,8 +352,8 @@ public void listHttpsHealthChecksTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); - List items = Arrays.asList(itemsElement); + HttpsHealthCheck2 itemsElement = HttpsHealthCheck2.newBuilder().build(); + List items = Arrays.asList(itemsElement); HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() .setKind(kind) @@ -368,7 +368,7 @@ public void listHttpsHealthChecksTest() { ListHttpsHealthChecksPagedResponse pagedListResponse = client.listHttpsHealthChecks(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); @@ -458,7 +458,7 @@ public void patchHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); @@ -491,7 +491,7 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); @@ -553,7 +553,7 @@ public void updateHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); @@ -586,7 +586,7 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); From f169950b276638396cd406671c8dbcc86e921e8a Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 18:54:25 -0700 Subject: [PATCH 24/42] using master's google-cloud-compute/pom.xml --- .../google-cloud-compute/pom.xml | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index 648866f59c5a..854684f2568c 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -43,27 +43,6 @@ test-jar test - - - com.google.api - gax-httpjson - - - com.google.api - gax-httpjson - testlib - test - - - com.google.api - gax - - - com.google.api - gax - testlib - - junit junit From 15d77686250a64de51587efe7192ddc9a933b782 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 27 Apr 2018 18:58:33 -0700 Subject: [PATCH 25/42] readd gax-httpjson to google-cloud-compute/pom.xml --- google-cloud-clients/google-cloud-compute/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index 854684f2568c..d47dcac37219 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -43,6 +43,16 @@ test-jar test + + com.google.api + gax-httpjson + + + com.google.api + gax-httpjson + testlib + test + junit junit From c841e64df97638f64c542055b25c8fb94b169107 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 30 Apr 2018 10:36:49 -0700 Subject: [PATCH 26/42] regen with newest annotations --- .../java/com/google/cloud/compute/v1/AcceleratorTypeClient.java | 2 +- .../com/google/cloud/compute/v1/AcceleratorTypeSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/AddressClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/AddressSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/AutoscalerClient.java | 2 +- .../java/com/google/cloud/compute/v1/AutoscalerSettings.java | 2 +- .../java/com/google/cloud/compute/v1/BackendBucketClient.java | 2 +- .../java/com/google/cloud/compute/v1/BackendBucketSettings.java | 2 +- .../java/com/google/cloud/compute/v1/BackendServiceClient.java | 2 +- .../com/google/cloud/compute/v1/BackendServiceSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/DiskClient.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/DiskSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/DiskTypeClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/DiskTypeSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/FirewallClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/FirewallSettings.java | 2 +- .../java/com/google/cloud/compute/v1/ForwardingRuleClient.java | 2 +- .../com/google/cloud/compute/v1/ForwardingRuleSettings.java | 2 +- .../java/com/google/cloud/compute/v1/GlobalAddressClient.java | 2 +- .../java/com/google/cloud/compute/v1/GlobalAddressSettings.java | 2 +- .../com/google/cloud/compute/v1/GlobalForwardingRuleClient.java | 2 +- .../google/cloud/compute/v1/GlobalForwardingRuleSettings.java | 2 +- .../java/com/google/cloud/compute/v1/GlobalOperationClient.java | 2 +- .../com/google/cloud/compute/v1/GlobalOperationSettings.java | 2 +- .../java/com/google/cloud/compute/v1/HealthCheckClient.java | 2 +- .../java/com/google/cloud/compute/v1/HealthCheckSettings.java | 2 +- .../java/com/google/cloud/compute/v1/HttpHealthCheckClient.java | 2 +- .../com/google/cloud/compute/v1/HttpHealthCheckSettings.java | 2 +- .../com/google/cloud/compute/v1/HttpsHealthCheckClient.java | 2 +- .../com/google/cloud/compute/v1/HttpsHealthCheckSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/ImageClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/ImageSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/InstanceClient.java | 2 +- .../java/com/google/cloud/compute/v1/InstanceGroupClient.java | 2 +- .../com/google/cloud/compute/v1/InstanceGroupManagerClient.java | 2 +- .../google/cloud/compute/v1/InstanceGroupManagerSettings.java | 2 +- .../java/com/google/cloud/compute/v1/InstanceGroupSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/InstanceSettings.java | 2 +- .../com/google/cloud/compute/v1/InstanceTemplateClient.java | 2 +- .../com/google/cloud/compute/v1/InstanceTemplateSettings.java | 2 +- .../google/cloud/compute/v1/InterconnectAttachmentClient.java | 2 +- .../google/cloud/compute/v1/InterconnectAttachmentSettings.java | 2 +- .../java/com/google/cloud/compute/v1/InterconnectClient.java | 2 +- .../com/google/cloud/compute/v1/InterconnectLocationClient.java | 2 +- .../google/cloud/compute/v1/InterconnectLocationSettings.java | 2 +- .../java/com/google/cloud/compute/v1/InterconnectSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/LicenseClient.java | 2 +- .../java/com/google/cloud/compute/v1/LicenseCodeClient.java | 2 +- .../java/com/google/cloud/compute/v1/LicenseCodeSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/LicenseSettings.java | 2 +- .../java/com/google/cloud/compute/v1/MachineTypeClient.java | 2 +- .../java/com/google/cloud/compute/v1/MachineTypeSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/NetworkClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/NetworkSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/ProjectClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/ProjectSettings.java | 2 +- .../com/google/cloud/compute/v1/RegionAutoscalerClient.java | 2 +- .../com/google/cloud/compute/v1/RegionAutoscalerSettings.java | 2 +- .../com/google/cloud/compute/v1/RegionBackendServiceClient.java | 2 +- .../google/cloud/compute/v1/RegionBackendServiceSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/RegionClient.java | 2 +- .../com/google/cloud/compute/v1/RegionCommitmentClient.java | 2 +- .../com/google/cloud/compute/v1/RegionCommitmentSettings.java | 2 +- .../com/google/cloud/compute/v1/RegionInstanceGroupClient.java | 2 +- .../cloud/compute/v1/RegionInstanceGroupManagerClient.java | 2 +- .../cloud/compute/v1/RegionInstanceGroupManagerSettings.java | 2 +- .../google/cloud/compute/v1/RegionInstanceGroupSettings.java | 2 +- .../java/com/google/cloud/compute/v1/RegionOperationClient.java | 2 +- .../com/google/cloud/compute/v1/RegionOperationSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/RegionSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/RouteClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/RouteSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/RouterClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/RouterSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/SnapshotClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/SnapshotSettings.java | 2 +- .../java/com/google/cloud/compute/v1/SslCertificateClient.java | 2 +- .../com/google/cloud/compute/v1/SslCertificateSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/SslPolicyClient.java | 2 +- .../java/com/google/cloud/compute/v1/SslPolicySettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/SubnetworkClient.java | 2 +- .../java/com/google/cloud/compute/v1/SubnetworkSettings.java | 2 +- .../java/com/google/cloud/compute/v1/TargetHttpProxyClient.java | 2 +- .../com/google/cloud/compute/v1/TargetHttpProxySettings.java | 2 +- .../com/google/cloud/compute/v1/TargetHttpsProxyClient.java | 2 +- .../com/google/cloud/compute/v1/TargetHttpsProxySettings.java | 2 +- .../java/com/google/cloud/compute/v1/TargetInstanceClient.java | 2 +- .../com/google/cloud/compute/v1/TargetInstanceSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/TargetPoolClient.java | 2 +- .../java/com/google/cloud/compute/v1/TargetPoolSettings.java | 2 +- .../java/com/google/cloud/compute/v1/TargetSslProxyClient.java | 2 +- .../com/google/cloud/compute/v1/TargetSslProxySettings.java | 2 +- .../java/com/google/cloud/compute/v1/TargetTcpProxyClient.java | 2 +- .../com/google/cloud/compute/v1/TargetTcpProxySettings.java | 2 +- .../com/google/cloud/compute/v1/TargetVpnGatewayClient.java | 2 +- .../com/google/cloud/compute/v1/TargetVpnGatewaySettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/UrlMapClient.java | 2 +- .../main/java/com/google/cloud/compute/v1/UrlMapSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/VpnTunnelClient.java | 2 +- .../java/com/google/cloud/compute/v1/VpnTunnelSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/ZoneClient.java | 2 +- .../java/com/google/cloud/compute/v1/ZoneOperationClient.java | 2 +- .../java/com/google/cloud/compute/v1/ZoneOperationSettings.java | 2 +- .../src/main/java/com/google/cloud/compute/v1/ZoneSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java | 2 +- .../cloud/compute/v1/stub/AcceleratorTypeStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/AddressStub.java | 2 +- .../com/google/cloud/compute/v1/stub/AddressStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/AutoscalerStub.java | 2 +- .../google/cloud/compute/v1/stub/AutoscalerStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/BackendBucketStub.java | 2 +- .../google/cloud/compute/v1/stub/BackendBucketStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/BackendServiceStub.java | 2 +- .../cloud/compute/v1/stub/BackendServiceStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/DiskStub.java | 2 +- .../java/com/google/cloud/compute/v1/stub/DiskStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/DiskTypeStub.java | 2 +- .../com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/FirewallStub.java | 2 +- .../com/google/cloud/compute/v1/stub/FirewallStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/ForwardingRuleStub.java | 2 +- .../cloud/compute/v1/stub/ForwardingRuleStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/GlobalAddressStub.java | 2 +- .../google/cloud/compute/v1/stub/GlobalAddressStubSettings.java | 2 +- .../google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java | 2 +- .../cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/GlobalOperationStub.java | 2 +- .../cloud/compute/v1/stub/GlobalOperationStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/HealthCheckStub.java | 2 +- .../google/cloud/compute/v1/stub/HealthCheckStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java | 2 +- .../cloud/compute/v1/stub/HttpHealthCheckStubSettings.java | 2 +- .../compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java | 2 +- .../compute/v1/stub/HttpJsonAutoscalerCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java | 2 +- .../compute/v1/stub/HttpJsonBackendBucketCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java | 2 +- .../compute/v1/stub/HttpJsonBackendServiceCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonBackendServiceStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java | 2 +- .../java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java | 2 +- .../compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java | 2 +- .../compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java | 2 +- .../v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java | 2 +- .../compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java | 2 +- .../compute/v1/stub/HttpJsonHealthCheckCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java | 2 +- .../compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java | 2 +- .../v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonImageCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonImageStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java | 2 +- .../v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java | 2 +- .../v1/stub/HttpJsonInstanceTemplateCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java | 2 +- .../v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonInterconnectAttachmentStub.java | 2 +- .../compute/v1/stub/HttpJsonInterconnectCallableFactory.java | 2 +- .../v1/stub/HttpJsonInterconnectLocationCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java | 2 +- .../compute/v1/stub/HttpJsonMachineTypeCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java | 2 +- .../v1/stub/HttpJsonRegionAutoscalerCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java | 2 +- .../v1/stub/HttpJsonRegionBackendServiceCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java | 2 +- .../v1/stub/HttpJsonRegionCommitmentCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java | 2 +- .../v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java | 2 +- .../stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java | 2 +- .../compute/v1/stub/HttpJsonRegionOperationCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRegionOperationStub.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java | 2 +- .../compute/v1/stub/HttpJsonSslCertificateCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonSslCertificateStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java | 2 +- .../compute/v1/stub/HttpJsonSubnetworkCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java | 2 +- .../compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java | 2 +- .../v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java | 2 +- .../compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java | 2 +- .../compute/v1/stub/HttpJsonTargetPoolCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java | 2 +- .../compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java | 2 +- .../compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java | 2 +- .../v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java | 2 +- .../cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java | 2 +- .../cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java | 2 +- .../compute/v1/stub/HttpJsonZoneOperationCallableFactory.java | 2 +- .../google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java | 2 +- .../java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java | 2 +- .../com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java | 2 +- .../cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/ImageStub.java | 2 +- .../com/google/cloud/compute/v1/stub/ImageStubSettings.java | 2 +- .../google/cloud/compute/v1/stub/InstanceGroupManagerStub.java | 2 +- .../cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/InstanceGroupStub.java | 2 +- .../google/cloud/compute/v1/stub/InstanceGroupStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/InstanceStub.java | 2 +- .../com/google/cloud/compute/v1/stub/InstanceStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/InstanceTemplateStub.java | 2 +- .../cloud/compute/v1/stub/InstanceTemplateStubSettings.java | 2 +- .../cloud/compute/v1/stub/InterconnectAttachmentStub.java | 2 +- .../compute/v1/stub/InterconnectAttachmentStubSettings.java | 2 +- .../google/cloud/compute/v1/stub/InterconnectLocationStub.java | 2 +- .../cloud/compute/v1/stub/InterconnectLocationStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/InterconnectStub.java | 2 +- .../google/cloud/compute/v1/stub/InterconnectStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java | 2 +- .../google/cloud/compute/v1/stub/LicenseCodeStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/LicenseStub.java | 2 +- .../com/google/cloud/compute/v1/stub/LicenseStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/MachineTypeStub.java | 2 +- .../google/cloud/compute/v1/stub/MachineTypeStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/NetworkStub.java | 2 +- .../com/google/cloud/compute/v1/stub/NetworkStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/ProjectStub.java | 2 +- .../com/google/cloud/compute/v1/stub/ProjectStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java | 2 +- .../cloud/compute/v1/stub/RegionAutoscalerStubSettings.java | 2 +- .../google/cloud/compute/v1/stub/RegionBackendServiceStub.java | 2 +- .../cloud/compute/v1/stub/RegionBackendServiceStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/RegionCommitmentStub.java | 2 +- .../cloud/compute/v1/stub/RegionCommitmentStubSettings.java | 2 +- .../cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java | 2 +- .../compute/v1/stub/RegionInstanceGroupManagerStubSettings.java | 2 +- .../google/cloud/compute/v1/stub/RegionInstanceGroupStub.java | 2 +- .../cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/RegionOperationStub.java | 2 +- .../cloud/compute/v1/stub/RegionOperationStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/RegionStub.java | 2 +- .../com/google/cloud/compute/v1/stub/RegionStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/RouteStub.java | 2 +- .../com/google/cloud/compute/v1/stub/RouteStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/RouterStub.java | 2 +- .../com/google/cloud/compute/v1/stub/RouterStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/SnapshotStub.java | 2 +- .../com/google/cloud/compute/v1/stub/SnapshotStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/SslCertificateStub.java | 2 +- .../cloud/compute/v1/stub/SslCertificateStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/SslPolicyStub.java | 2 +- .../com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/SubnetworkStub.java | 2 +- .../google/cloud/compute/v1/stub/SubnetworkStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java | 2 +- .../cloud/compute/v1/stub/TargetHttpProxyStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java | 2 +- .../cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/TargetInstanceStub.java | 2 +- .../cloud/compute/v1/stub/TargetInstanceStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/TargetPoolStub.java | 2 +- .../google/cloud/compute/v1/stub/TargetPoolStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/TargetSslProxyStub.java | 2 +- .../cloud/compute/v1/stub/TargetSslProxyStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java | 2 +- .../cloud/compute/v1/stub/TargetTcpProxyStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java | 2 +- .../cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java | 2 +- .../com/google/cloud/compute/v1/stub/UrlMapStubSettings.java | 2 +- .../java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java | 2 +- .../com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java | 2 +- .../com/google/cloud/compute/v1/stub/ZoneOperationStub.java | 2 +- .../google/cloud/compute/v1/stub/ZoneOperationStubSettings.java | 2 +- .../main/java/com/google/cloud/compute/v1/stub/ZoneStub.java | 2 +- .../java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java | 2 +- 312 files changed, 312 insertions(+), 312 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java index 06e1cc88e56e..ac96c39f9f43 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AcceleratorTypeClient implements BackgroundResource { private final AcceleratorTypeSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java index e69d012333a7..8164d4985e80 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AcceleratorTypeSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListAcceleratorTypes. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java index 804540bf73d6..e00dea659899 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AddressClient implements BackgroundResource { private final AddressSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java index c9725c831762..b5a5b4ef2359 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AddressSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListAddresses. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java index c60b22c30843..157d4c237f4b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AutoscalerClient implements BackgroundResource { private final AutoscalerSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java index 9b935d48a5d6..8ece391a0c68 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AutoscalerSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListAutoscalers. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java index c50d1ce9c7d5..691fd602ce2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class BackendBucketClient implements BackgroundResource { private final BackendBucketSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java index 2fdb143cb2c6..1e47fbf5864d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class BackendBucketSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteBackendBucket. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java index 7bdfe9a4fe00..d21fc584e633 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class BackendServiceClient implements BackgroundResource { private final BackendServiceSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java index 23e8c5e4fd55..1f0e872b9cc1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class BackendServiceSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListBackendServices. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java index ea95fbe574dd..f3f445a980d4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java @@ -101,7 +101,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class DiskClient implements BackgroundResource { private final DiskSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java index e4c3d5e4d196..a01a30f18678 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class DiskSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListDisks. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java index 31482c88ecc8..4f4bafc78849 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java @@ -98,7 +98,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class DiskTypeClient implements BackgroundResource { private final DiskTypeSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java index 53299aac8849..64dfe1d625a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class DiskTypeSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListDiskTypes. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java index 511a875dc96d..0a6e628f0687 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class FirewallClient implements BackgroundResource { private final FirewallSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java index 2a72ff8e6082..2a0f327e0953 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class FirewallSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteFirewall. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java index a08aca630c5a..9c464a8c0086 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ForwardingRuleClient implements BackgroundResource { private final ForwardingRuleSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java index 74fb77d239ce..2d5623d91b6a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ForwardingRuleSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListForwardingRules. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java index 8f41a300a955..1b313c326e0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalAddressClient implements BackgroundResource { private final GlobalAddressSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java index bd52222065dd..07dc9b12dd06 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalAddressSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteGlobalAddress. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java index e856065ff0e1..c8fca7505624 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalForwardingRuleClient implements BackgroundResource { private final GlobalForwardingRuleSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java index 6316339fd069..c7d6c750f1cc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalForwardingRuleSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteGlobalForwardingRule. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java index 4abce4f4900c..e72a280829be 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalOperationClient implements BackgroundResource { private final GlobalOperationSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java index 428017102ace..91d078b40ba0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalOperationSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListGlobalOperations. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java index e3e81526af85..81ae6ea43254 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HealthCheckClient implements BackgroundResource { private final HealthCheckSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java index 0f824fe1e44c..26d932ce81f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HealthCheckSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteHealthCheck. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java index c5712e750ebf..17068313afb3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HttpHealthCheckClient implements BackgroundResource { private final HttpHealthCheckSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java index 401569738944..889c5a7a07db 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HttpHealthCheckSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteHttpHealthCheck. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java index 7e28e051f882..c8e4e440b1cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HttpsHealthCheckClient implements BackgroundResource { private final HttpsHealthCheckSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java index 9fb384b220c9..485682fea0f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HttpsHealthCheckSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteHttpsHealthCheck. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java index f07ce33cdf42..684894a2c9c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ImageClient implements BackgroundResource { private final ImageSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java index 3bcbb10f1c6d..559d3f1cdfc3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ImageSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteImage. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java index a341e110a9ae..6ef5edc33f92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -101,7 +101,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceClient implements BackgroundResource { private final InstanceSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java index 65f8ebd06cf8..461140c97d35 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceGroupClient implements BackgroundResource { private final InstanceGroupSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java index 0700ab99244d..5f9d80ea5e9d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java @@ -101,7 +101,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceGroupManagerClient implements BackgroundResource { private final InstanceGroupManagerSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java index 4cb377e2ba58..e50865548ae6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceGroupManagerSettings extends ClientSettings { /** diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java index c0d40b559eba..6817b237372b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java @@ -62,7 +62,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceGroupSettings extends ClientSettings { /** Returns the object with the settings used for calls to addInstancesInstanceGroup. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java index 73793a15bbbc..eb0dc4b8c8c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java @@ -62,7 +62,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceSettings extends ClientSettings { /** Returns the object with the settings used for calls to addAccessConfigInstance. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java index 11dc610c8d2c..62e918f5f4e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceTemplateClient implements BackgroundResource { private final InstanceTemplateSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java index 2b625d92365d..610405c1f47e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceTemplateSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteInstanceTemplate. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java index b9307b67ed40..ef14ae1d9441 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectAttachmentClient implements BackgroundResource { private final InterconnectAttachmentSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java index b9ceb362f0d1..e0df5fb63acb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java @@ -61,7 +61,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectAttachmentSettings extends ClientSettings { /** diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java index 9cae049b25d9..c706d6a3946f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectClient implements BackgroundResource { private final InterconnectSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java index 95fcb5e8a62f..ab16533b0ad7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectLocationClient implements BackgroundResource { private final InterconnectLocationSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java index 1790f9052aac..788b2695a236 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectLocationSettings extends ClientSettings { /** Returns the object with the settings used for calls to getInterconnectLocation. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java index 78e2d446cd47..b7c6e6ed7291 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteInterconnect. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java index 36b653193073..3e833606cae4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class LicenseClient implements BackgroundResource { private final LicenseSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java index 993d5c422efd..902a70b047ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java @@ -90,7 +90,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class LicenseCodeClient implements BackgroundResource { private final LicenseCodeSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java index 70a10592d8e9..7ab4870940d9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java @@ -57,7 +57,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class LicenseCodeSettings extends ClientSettings { /** Returns the object with the settings used for calls to getLicenseCode. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java index 8f9d1b11e474..532b4a4e2024 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class LicenseSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteLicense. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java index 2ecca84724e7..7e9e700554a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java @@ -98,7 +98,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class MachineTypeClient implements BackgroundResource { private final MachineTypeSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java index 2334b16208f6..2d056103b652 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java @@ -61,7 +61,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class MachineTypeSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListMachineTypes. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java index e6664d05a169..1516f000651e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class NetworkClient implements BackgroundResource { private final NetworkSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java index ef1e6d4fdddb..68dce009848f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class NetworkSettings extends ClientSettings { /** Returns the object with the settings used for calls to addPeeringNetwork. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java index a78100687b99..cab562f3330a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ProjectClient implements BackgroundResource { private final ProjectSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java index a692a99dd7d2..6a4ef22a9f2e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ProjectSettings extends ClientSettings { /** Returns the object with the settings used for calls to disableXpnHostProject. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java index 39c506f898e3..10981a4c21f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionAutoscalerClient implements BackgroundResource { private final RegionAutoscalerSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java index a4673a6d2a45..3963b95b92aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionAutoscalerSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteRegionAutoscaler. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java index 34ca5c12aa85..c55d190fd8f9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionBackendServiceClient implements BackgroundResource { private final RegionBackendServiceSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java index c8efa2a10f56..42dfc4b91654 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionBackendServiceSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteRegionBackendService. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java index 0c72aba0a6b6..052fb6e09ec1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java @@ -98,7 +98,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionClient implements BackgroundResource { private final RegionSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java index 3070c42d1ba3..9510741b271d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionCommitmentClient implements BackgroundResource { private final RegionCommitmentSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java index 4130d0ae75b8..0fc6cca0078b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java @@ -61,7 +61,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionCommitmentSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListRegionCommitments. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java index c2a70a5cf5cb..eb1b6df13847 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionInstanceGroupClient implements BackgroundResource { private final RegionInstanceGroupSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java index 6afd89cbc3b4..77e7949453cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java @@ -101,7 +101,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionInstanceGroupManagerClient implements BackgroundResource { private final RegionInstanceGroupManagerSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java index 3618185ab583..3644f801038d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionInstanceGroupManagerSettings extends ClientSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java index 8f931e750ed2..19585b0215a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionInstanceGroupSettings extends ClientSettings { /** Returns the object with the settings used for calls to getRegionInstanceGroup. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java index 7abb889439e3..104d8fe56914 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionOperationClient implements BackgroundResource { private final RegionOperationSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java index 23390fc28eba..671a0f927720 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionOperationSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteRegionOperation. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java index 487b6052945d..051ae55f6d1f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionSettings extends ClientSettings { /** Returns the object with the settings used for calls to getRegion. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java index 568a86d39bbe..4389062e766e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RouteClient implements BackgroundResource { private final RouteSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java index 44c3aea7c9d7..a439d3cfe474 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RouteSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteRoute. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java index 1730ac2b76d1..4941d1313c03 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RouterClient implements BackgroundResource { private final RouterSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java index c95d9229354f..a388c432ddf0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java @@ -61,7 +61,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RouterSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListRouters. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java index 29b3506b2a6c..66e6f7295e54 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SnapshotClient implements BackgroundResource { private final SnapshotSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java index 0859dae4568c..a34412a40b85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SnapshotSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteSnapshot. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java index 0b7752be6927..0e1d06b3f14b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SslCertificateClient implements BackgroundResource { private final SslCertificateSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java index f2f11ac490f0..0943dad381ca 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SslCertificateSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteSslCertificate. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java index 965e7131becc..3258234f1d9a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SslPolicyClient implements BackgroundResource { private final SslPolicySettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java index 6bed39aa4642..98e32a6f559e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SslPolicySettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteSslPolicy. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java index 21e89fa0e673..45a10514dfb0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SubnetworkClient implements BackgroundResource { private final SubnetworkSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java index 635b5277e278..f3de6c182ebe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SubnetworkSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListSubnetworks. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java index cf2d7bedbfba..7067f4cf03ab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetHttpProxyClient implements BackgroundResource { private final TargetHttpProxySettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java index b833538d30c6..23a7cc18d85e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetHttpProxySettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteTargetHttpProxy. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java index ba82eb73abd5..8047dc217341 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetHttpsProxyClient implements BackgroundResource { private final TargetHttpsProxySettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java index 60c674602372..c5a8f57c291d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetHttpsProxySettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteTargetHttpsProxy. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java index fce65be815b9..3bee7beb81cf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetInstanceClient implements BackgroundResource { private final TargetInstanceSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java index 633344253e3a..e6f3e4f1a376 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetInstanceSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListTargetInstances. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java index a022b0ebd26b..ac47eb70d085 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetPoolClient implements BackgroundResource { private final TargetPoolSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java index 9559cdd8f5b1..e4030326f0eb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java @@ -61,7 +61,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetPoolSettings extends ClientSettings { /** Returns the object with the settings used for calls to addHealthCheckTargetPool. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java index 24de01476c19..085abe9a5391 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetSslProxyClient implements BackgroundResource { private final TargetSslProxySettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java index 1f5b2afc9b4c..467bb379d507 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetSslProxySettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteTargetSslProxy. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java index a3bbbb1e2add..0df6ab3966c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetTcpProxyClient implements BackgroundResource { private final TargetTcpProxySettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java index 34de8a4cf7f9..505adac4f15c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetTcpProxySettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteTargetTcpProxy. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java index 8cd32a68fb45..e32554addb0a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java @@ -100,7 +100,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetVpnGatewayClient implements BackgroundResource { private final TargetVpnGatewaySettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java index 0cff3f8d7670..87f837af53f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetVpnGatewaySettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListTargetVpnGateways. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java index 14b1925e5502..f511264fd0c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class UrlMapClient implements BackgroundResource { private final UrlMapSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java index b55dea93a0a8..3c89299d6d9d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java @@ -60,7 +60,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class UrlMapSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteUrlMap. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java index c43c91f88c8e..20c4f5e196cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java @@ -99,7 +99,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class VpnTunnelClient implements BackgroundResource { private final VpnTunnelSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java index 87126c61a856..57b0f267774a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java @@ -61,7 +61,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class VpnTunnelSettings extends ClientSettings { /** Returns the object with the settings used for calls to aggregatedListVpnTunnels. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java index 4ca7d6542715..2630bf1ffd8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java @@ -98,7 +98,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ZoneClient implements BackgroundResource { private final ZoneSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java index 8044d41a12e7..91ccbcf69ff0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java @@ -98,7 +98,7 @@ *
*
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ZoneOperationClient implements BackgroundResource { private final ZoneOperationSettings settings; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java index 7b1ddfa64a68..51a063156462 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ZoneOperationSettings extends ClientSettings { /** Returns the object with the settings used for calls to deleteZoneOperation. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java index 2171dd596503..6cf62c470e32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java @@ -60,7 +60,7 @@ * *
*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ZoneSettings extends ClientSettings { /** Returns the object with the settings used for calls to getZone. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java index b23e0db2dea3..3fec3f9376cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AcceleratorTypeStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java index 6ac6b077663e..d29f00a0a695 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java @@ -83,7 +83,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AcceleratorTypeStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java index 2d2e04f11154..3142103f7467 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AddressStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java index 7ce964a5a581..e733e46cbb4f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AddressStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java index d70758b15989..7b2c3317a099 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java @@ -40,7 +40,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AutoscalerStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java index a739b14739ff..4b0798f46bb4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java @@ -88,7 +88,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class AutoscalerStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java index c2dbaa6c2bf1..589bc03b6725 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class BackendBucketStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java index 744d7d65bc2e..7933614ffc9c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class BackendBucketStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java index 1bce2e1bb7e3..fd60cc3a4a8d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java @@ -42,7 +42,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class BackendServiceStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java index ee5c04cfdea1..e479c4723140 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java @@ -90,7 +90,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class BackendServiceStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java index 447d36c47379..77912923a901 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class DiskStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java index 628ff7ace0c2..fb9537e6e517 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java @@ -89,7 +89,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class DiskStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java index c51e1cd0d7e7..fa2cee066b32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class DiskTypeStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java index 89da1e00bdb1..8cd7818f1c6e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java @@ -83,7 +83,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class DiskTypeStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java index 52a995d0c602..2341273aea62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class FirewallStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java index 7c44f4f465f8..9e7af23a14f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class FirewallStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java index 1a93cc398a96..d1d56ff4fc38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java @@ -39,7 +39,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ForwardingRuleStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java index fbe705195ffd..81707a48cd42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java @@ -87,7 +87,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ForwardingRuleStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java index 2bc536a881be..4e6fe7008536 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalAddressStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java index c61b3d756632..409943639634 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java @@ -82,7 +82,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalAddressStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java index 33137dc281e3..226fdbdf0d63 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java @@ -36,7 +36,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalForwardingRuleStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java index a5eae1104610..019b57dfeb79 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java @@ -83,7 +83,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalForwardingRuleStubSettings extends StubSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java index 960cea4fd932..e3951231c74f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java @@ -36,7 +36,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class GlobalOperationStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java index 14da8f82bd91..8dfeea1ad6b0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class GlobalOperationStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java index 89da3e1c0dfa..3e7064534dc1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HealthCheckStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java index 5bb0370845e4..11cdb64541fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HealthCheckStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java index e6082da7b418..84676af100df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HttpHealthCheckStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java index de9b9729bf7c..6ce448ba8aed 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HttpHealthCheckStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java index 2dc7c11069a5..12849d1a252e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonAcceleratorTypeCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java index 7ee7000a895c..71269115b288 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java index aa9f8db412cf..43522b0186e6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonAddressCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java index d22b7746cecc..bc79b274fd0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonAddressStub extends AddressStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java index c718fce34b67..72e927a72753 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonAutoscalerCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java index 2de882f98e2a..50d28633fe62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -56,7 +56,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonAutoscalerStub extends AutoscalerStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java index 1b15b1414936..d5c304703394 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonBackendBucketCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java index 407be63fe6d5..dc2e4c87bd40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonBackendBucketStub extends BackendBucketStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java index d46874595c37..2e6d68cd1908 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonBackendServiceCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java index a8e1c4acc1c4..d4b898387ef5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -57,7 +57,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonBackendServiceStub extends BackendServiceStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java index de3a3552ebfa..6b35ba6b38f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonDiskCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index a27e5e9b7a8e..d05faf374ce8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -58,7 +58,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonDiskStub extends DiskStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java index d6fdb78f82e7..6408a26b6d3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonDiskTypeCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java index 833975a181fd..5763aab2b33e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonDiskTypeStub extends DiskTypeStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java index 208b5db905df..ad34a00a93a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonFirewallCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java index 982e4732f7ce..47a4e3218911 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonFirewallStub extends FirewallStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java index e8a741ada0a4..d951fb6373f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonForwardingRuleCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java index 43792480e26d..be620cb1bdd9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -55,7 +55,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java index e6722a09b55a..7bfc99b5d0a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonGlobalAddressCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java index 6eb29eaa5d11..b0016d2ce018 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -50,7 +50,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonGlobalAddressStub extends GlobalAddressStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java index 71a6c2b9007c..8d8918a8af20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonGlobalForwardingRuleCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java index fea55b36483a..9cbabb7f7df5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java index aaf739f3e299..0b7c72fcd525 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonGlobalOperationCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java index 5eff8aca6859..eb5098744995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonGlobalOperationStub extends GlobalOperationStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java index 383894bc546e..8c75c78c8871 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonHealthCheckCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java index 72c57e921cef..6314d09d3cd2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonHealthCheckStub extends HealthCheckStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java index 807f5a1abafb..38561aff0603 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonHttpHealthCheckCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index 81608d82162f..694e165658c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java index 3eae33c80bd3..c290e0fc58a7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonHttpsHealthCheckCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 78de998d5342..5715b291ee87 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java index 434f11b4109e..2ab8f66e8e7b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonImageCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index 71192983e3b1..ed43ce6d9584 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -55,7 +55,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonImageStub extends ImageStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java index 4ed7f958caaa..4866cc448499 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInstanceCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java index fb7fc9cc14b3..248810e6f9cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInstanceGroupCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java index 2956ba2f1598..1472a24b1411 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInstanceGroupManagerCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index d2a729a072a1..987c4b18e78e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -62,7 +62,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java index f7b56558affd..1de6f6a0ac03 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -60,7 +60,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceGroupStub extends InstanceGroupStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index 01bdcb6ee545..2cb7152ca8ba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -80,7 +80,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceStub extends InstanceStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java index 62cebc4d2d75..fa0f1dca2b34 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInstanceTemplateCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index 5e7315088f31..1a4abca55ce5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -50,7 +50,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java index 8b0ef4504cc6..719bc7630711 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInterconnectAttachmentCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java index 4c947a717aa2..44952dab3864 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java index 93581be58f36..900ee9f7070b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInterconnectCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java index 0912f6d18440..163d3fc8f470 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonInterconnectLocationCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java index a181379a2550..7c323e58ba1c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java @@ -47,7 +47,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java index 082000108800..7c53ea5eaac0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonInterconnectStub extends InterconnectStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java index 2d0f399c98b3..9209664298a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonLicenseCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java index 87166acfb077..214b28ee2a1a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonLicenseCodeCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java index eec8ef581f53..56199ba78943 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java @@ -45,7 +45,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonLicenseCodeStub extends LicenseCodeStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java index a2c5ac2294da..2cff99d85cfd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -53,7 +53,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonLicenseStub extends LicenseStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java index 50d90e4da591..c7bf6f0a3188 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonMachineTypeCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java index a7be3bef8466..61b731aec0ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonMachineTypeStub extends MachineTypeStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java index 97d7b03767b5..f693074eb19a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonNetworkCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java index db8dabf469ae..74017edbc6fb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonNetworkStub extends NetworkStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java index 844039bcbf87..d89c6781bf52 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonProjectCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index 899074c8edbf..d1567f5830c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -59,7 +59,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonProjectStub extends ProjectStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java index 20dea91a32d1..d91f04332155 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionAutoscalerCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java index 41a649bda416..a334a165b06e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java index 237db578a029..48330cb23652 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionBackendServiceCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java index e5fdc6ddbb93..29fb7291a39f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java index 3c7b493c70f1..6c2a461e2d6e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java index ca4ec775a46f..5654591bd723 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionCommitmentCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java index cabe19ae24ab..c029a17b62dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java @@ -53,7 +53,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java index 39bcc1c8907a..6bc9048c077d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionInstanceGroupCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java index 4e822058c3af..adec8f036bd9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionInstanceGroupManagerCallableFactory implements HttpJsonStubCallableFactory { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index 685154932372..9ea79f7beef7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -58,7 +58,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupManagerStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java index 71caaa749ae1..5ec45e732bab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java index 9dbaa871f45c..4d229d0d4f04 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRegionOperationCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java index e57b7c5d9c3d..da8b445f7610 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java @@ -48,7 +48,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionOperationStub extends RegionOperationStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java index 1537848a7a53..f4ada3539b17 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java @@ -47,7 +47,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRegionStub extends RegionStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java index 94668490f0fc..5f56c2801b66 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRouteCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index 14c3acb13d5e..454da75c6930 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -50,7 +50,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRouteStub extends RouteStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java index cbf9dd469b9c..003c575887c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonRouterCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index 5f9a83655949..6840b113e982 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -60,7 +60,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonRouterStub extends RouterStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java index 599733850786..c1390a782351 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonSnapshotCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 4710f0842713..5fdf58c8c7a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -51,7 +51,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSnapshotStub extends SnapshotStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java index bfb27ab41f21..de7ede7ad904 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonSslCertificateCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java index 66b74ae3f879..8d534e6e71e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -50,7 +50,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSslCertificateStub extends SslCertificateStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java index 063476eb4041..e3c7f47d3b12 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonSslPolicyCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java index 6572c724528d..d3d8945ccdd7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java @@ -53,7 +53,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSslPolicyStub extends SslPolicyStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java index 40a484f46174..061b00e19d90 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonSubnetworkCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index 30262a71437d..368173fdb653 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -57,7 +57,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonSubnetworkStub extends SubnetworkStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java index c6b45356542b..06dccd590665 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetHttpProxyCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java index 00ee8eb60eae..b8b409dc14d5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java index 7a16b8de939d..8648d3de3d4d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetHttpsProxyCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index 1a52d1443d6f..ecdb1d01ac5c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java index 2f3983ed49e9..59045c2cfc38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetInstanceCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java index 54fe6d567e35..75f70874fa4f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetInstanceStub extends TargetInstanceStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java index e8d58f1221c6..cd90fcb13ba4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetPoolCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java index 8fb07ca4b9c3..833ffc5c5ea0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -61,7 +61,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetPoolStub extends TargetPoolStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java index 5f6715ff6cb4..f21ed3ad7be5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetSslProxyCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index d1d36b237e2a..1261642c4672 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java index 271f30019263..02ba0c5f433d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetTcpProxyCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java index 466726ac8052..4773e569571a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java @@ -52,7 +52,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java index f250498def74..17d1d515a875 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonTargetVpnGatewayCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java index f22376447c10..f76dc9f7befe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java index 5b17559dcf32..9567bd5ddb95 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonUrlMapCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index 36eedec7493f..056c98ad0fdc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -55,7 +55,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonUrlMapStub extends UrlMapStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java index 46c5165997bc..2d0cdcfdb55c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonVpnTunnelCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java index 76f5f0b07f8c..adf45ca0d010 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -54,7 +54,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonVpnTunnelStub extends VpnTunnelStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java index 65c675b0f18c..03605bbea89c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonZoneCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java index cc7359ab0bce..ecd6e00616c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class HttpJsonZoneOperationCallableFactory implements HttpJsonStubCallableFactory { @Override diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java index d80b6293be85..f89a38af5a8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java @@ -48,7 +48,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonZoneOperationStub extends ZoneOperationStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java index cc4daa6826ef..fcf298ddb2df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java @@ -47,7 +47,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class HttpJsonZoneStub extends ZoneStub { @InternalApi diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index d6aaec5a5746..fd8c36e81bdb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class HttpsHealthCheckStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java index 472f3abbd654..e32cc939ca47 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class HttpsHealthCheckStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java index 15202cf60248..658201c561cc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ImageStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java index 65e2bebc7464..79e43f7cad0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java @@ -85,7 +85,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ImageStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java index e76060e16f24..335298698f64 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java @@ -46,7 +46,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceGroupManagerStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java index 53f44e79f13a..44a165ecc5c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java @@ -94,7 +94,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceGroupManagerStubSettings extends StubSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java index baf88b0c489d..077ebf34ec5c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java @@ -44,7 +44,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceGroupStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java index 97d8df0c964e..320cad8331f7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java @@ -93,7 +93,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceGroupStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java index 383073cdbac5..4e10ec10ee86 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java @@ -63,7 +63,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java index ccc5069ecbad..a43e52f1ddf4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java @@ -112,7 +112,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java index 9d4642e83664..df2944463d78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InstanceTemplateStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java index 6c9ffc1e0d1c..819de6dde783 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java @@ -82,7 +82,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InstanceTemplateStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java index 1eebccc45141..0fb2191c1496 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InterconnectAttachmentStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java index 0690ce168534..0a8846d6c5e6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectAttachmentStubSettings extends StubSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java index 185918a9eaa5..f10640d33bb3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InterconnectLocationStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java index ee57abbe4bfd..2d8929b980de 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java @@ -79,7 +79,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectLocationStubSettings extends StubSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java index 1778606954b2..6dff773ec683 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java @@ -36,7 +36,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class InterconnectStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java index d1de5c870d2e..7f7d7d43ee8a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java @@ -83,7 +83,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class InterconnectStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java index f3098eaaabf7..e2f43b1fa349 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java @@ -30,7 +30,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class LicenseCodeStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java index 2dcefb038e37..70ffc2ff4679 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java @@ -70,7 +70,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class LicenseCodeStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java index d514ea4296b0..e0210ccedad2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class LicenseStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java index 08e0d6996d8f..1fc3748ed609 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class LicenseStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java index 012813d37034..3890bfb9c6c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class MachineTypeStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java index 63aa12751896..fdd22baca8b8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java @@ -83,7 +83,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class MachineTypeStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java index 13622a584871..e46a6238a8aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java @@ -39,7 +39,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class NetworkStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java index 675ba18c88a4..e025cedc2c13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class NetworkStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java index 5b387632c1f1..9b4c006575de 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java @@ -45,7 +45,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ProjectStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java index f14b1130e392..a73d61425054 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java @@ -93,7 +93,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ProjectStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java index 0550bccc2013..c83d400d32ae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionAutoscalerStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java index 30450a52fd83..4e81bac5cdc1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionAutoscalerStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java index b822751e9a71..b10c28c713fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java @@ -39,7 +39,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionBackendServiceStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java index 58710886511f..46aca507d5a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionBackendServiceStubSettings extends StubSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java index 1b110ca49307..f7af537a7fb7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionCommitmentStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java index 964205015e3d..4f93e74feedc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java @@ -85,7 +85,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionCommitmentStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java index 21147e0d464b..930048b9b6ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java @@ -43,7 +43,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionInstanceGroupManagerStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java index d796075b303c..601d37d866fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java @@ -90,7 +90,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionInstanceGroupManagerStubSettings extends StubSettings { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java index 50d66bbaa836..a885aef44fac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionInstanceGroupStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java index a38a8d1ebf51..17d4c0d42d97 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java @@ -85,7 +85,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionInstanceGroupStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java index 0197caf06225..de3eb337a809 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java @@ -33,7 +33,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionOperationStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java index e710a6dcbf47..270ec87bf321 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java @@ -80,7 +80,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionOperationStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java index 433199113b67..6bcf9a4e29fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RegionStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java index 216d446a37f2..45044fc42d3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java @@ -79,7 +79,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RegionStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java index 0b5f5f250958..a39b9b670eeb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RouteStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java index ef6833d46560..f37082e4f972 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java @@ -82,7 +82,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RouteStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java index c3f3d67a7401..7abe4c7450e2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java @@ -44,7 +44,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class RouterStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java index e1fa5228a0b6..1c379f2dc19a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java @@ -92,7 +92,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class RouterStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java index ebb727988391..fe21a5908d56 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SnapshotStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java index b7d5fa8bd65e..a7646118c60d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java @@ -82,7 +82,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SnapshotStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java index e455da45c9d3..5faa091d4e6c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java @@ -35,7 +35,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SslCertificateStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java index f22a9755cb46..fe0cf6eafb07 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java @@ -82,7 +82,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SslCertificateStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java index b3d1ccec085a..dbf578db3371 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SslPolicyStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java index abd0391c242b..48096607a206 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java @@ -85,7 +85,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SslPolicyStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java index 5a35d0b38f07..2f42ed4f54e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SubnetworkStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java index 82fd082057db..fc76af86aa9c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java @@ -89,7 +89,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class SubnetworkStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java index 66808c28e87e..60b9a7405540 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java @@ -36,7 +36,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetHttpProxyStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java index 74b4817dcaa2..adf9b921b5dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java @@ -83,7 +83,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetHttpProxyStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java index 4a0824b24224..343f601b5e60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetHttpsProxyStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java index 8c12776092c0..fc3650a47ac5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java @@ -85,7 +85,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetHttpsProxyStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java index cedcd948022b..733993de1451 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetInstanceStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java index 0846bfc5d45b..4ada09b98847 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetInstanceStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java index 9dc5fb536d7a..1124cae057b4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java @@ -45,7 +45,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetPoolStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java index 7663114fbe7a..239def189ab1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java @@ -93,7 +93,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetPoolStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java index 3d637427df62..4197e356e044 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java @@ -39,7 +39,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetSslProxyStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java index e60c858531b1..1b9d9d804bce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetSslProxyStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java index 12b024437bc1..4c6a492564a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java @@ -37,7 +37,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetTcpProxyStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java index 4694ee986881..211cb213e68e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java @@ -84,7 +84,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetTcpProxyStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java index 5750bae9d53c..aa8b3f9d2150 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TargetVpnGatewayStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java index 8050fc10b8a3..c25b3c56abdf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class TargetVpnGatewayStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java index 09058cda3a28..2e5980d94ee1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java @@ -40,7 +40,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class UrlMapStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java index c088f23f6e83..9be5fe064fb2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java @@ -87,7 +87,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class UrlMapStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java index 282b456d91b4..0d606eb8e489 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java @@ -38,7 +38,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class VpnTunnelStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java index e7ed844e5a5c..e62fa9c01226 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java @@ -86,7 +86,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class VpnTunnelStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java index a65df85a2632..b7c536fee7c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java @@ -33,7 +33,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ZoneOperationStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java index b8c953f4e79e..dc9421bdf3c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java @@ -80,7 +80,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ZoneOperationStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java index 46023fda334b..75f8b4c3032d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java @@ -32,7 +32,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ZoneStub implements BackgroundResource { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java index 3cb80fb6ca48..cf5ac03aa4e0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java @@ -79,7 +79,7 @@ * *

*/ -@Generated("by GAPIC v0.0.5") +@Generated("by gapic-generator") @BetaApi public class ZoneStubSettings extends StubSettings { /** The default scopes of the service. */ From 4113c3f9ff02200bde0e19f92cab7bd23f502854 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 30 Apr 2018 11:43:06 -0700 Subject: [PATCH 27/42] readd gax:testlib to google-cloud-compute/pom.xml --- google-cloud-clients/google-cloud-compute/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index d47dcac37219..be906c84e5d0 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -43,6 +43,15 @@ test-jar test + + com.google.api + gax + + + com.google.api + gax + testlib + com.google.api gax-httpjson From b2a98e29e5c6f41698e6b3df17691bc036cf521c Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 30 Apr 2018 12:02:45 -0700 Subject: [PATCH 28/42] add test scope --- google-cloud-clients/google-cloud-compute/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index be906c84e5d0..52f237e6485a 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -51,6 +51,7 @@ com.google.api gax testlib + test com.google.api From d7bb27b1a5d267be2b87258ba5d55ff59d9212bd Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 3 May 2018 14:19:29 -0700 Subject: [PATCH 29/42] add in all google-cloud-compute gen --- ...tancesInstanceGroupManagerHttpRequest.java | 73 +-- ...RegionInstanceGroupManagerHttpRequest.java | 73 +-- .../cloud/compute/v1/AcceleratorConfig.java | 28 +- .../cloud/compute/v1/AcceleratorType.java | 66 +- .../v1/AcceleratorTypeAggregatedList.java | 47 +- .../cloud/compute/v1/AcceleratorTypeList.java | 53 +- .../v1/AcceleratorTypesScopedList.java | 33 +- .../google/cloud/compute/v1/AccessConfig.java | 49 +- .../AddAccessConfigInstanceHttpRequest.java | 74 +-- .../AddHealthCheckTargetPoolHttpRequest.java | 71 +-- .../v1/AddInstanceTargetPoolHttpRequest.java | 71 +-- .../AddInstancesInstanceGroupHttpRequest.java | 71 +-- .../v1/AddPeeringNetworkHttpRequest.java | 71 +-- .../com/google/cloud/compute/v1/Address.java | 89 +-- .../compute/v1/AddressAggregatedList.java | 47 +- .../google/cloud/compute/v1/AddressList.java | 53 +- .../cloud/compute/v1/AddressesScopedList.java | 33 +- ...egatedListAcceleratorTypesHttpRequest.java | 78 +-- .../AggregatedListAddressesHttpRequest.java | 78 +-- .../AggregatedListAutoscalersHttpRequest.java | 78 +-- ...regatedListBackendServicesHttpRequest.java | 78 +-- .../AggregatedListDiskTypesHttpRequest.java | 78 +-- .../v1/AggregatedListDisksHttpRequest.java | 78 +-- ...regatedListForwardingRulesHttpRequest.java | 78 +-- ...egatedListGlobalOperationsHttpRequest.java | 78 +-- ...dListInstanceGroupManagersHttpRequest.java | 78 +-- ...gregatedListInstanceGroupsHttpRequest.java | 78 +-- .../AggregatedListInstancesHttpRequest.java | 78 +-- ...istInterconnectAttachmentsHttpRequest.java | 78 +-- ...AggregatedListMachineTypesHttpRequest.java | 78 +-- ...gatedListRegionCommitmentsHttpRequest.java | 78 +-- .../v1/AggregatedListRoutersHttpRequest.java | 78 +-- .../AggregatedListSubnetworksHttpRequest.java | 78 +-- ...regatedListTargetInstancesHttpRequest.java | 78 +-- .../AggregatedListTargetPoolsHttpRequest.java | 78 +-- ...gatedListTargetVpnGatewaysHttpRequest.java | 78 +-- .../AggregatedListVpnTunnelsHttpRequest.java | 78 +-- .../google/cloud/compute/v1/AliasIpRange.java | 29 +- .../com/google/cloud/compute/v1/Allowed.java | 33 +- .../v1/AttachDiskInstanceHttpRequest.java | 69 +-- .../google/cloud/compute/v1/AttachedDisk.java | 93 +-- .../v1/AttachedDiskInitializeParams.java | 49 +- .../google/cloud/compute/v1/Autoscaler.java | 85 +-- .../compute/v1/AutoscalerAggregatedList.java | 47 +- .../cloud/compute/v1/AutoscalerList.java | 53 +- .../compute/v1/AutoscalerStatusDetails.java | 28 +- .../compute/v1/AutoscalersScopedList.java | 33 +- .../cloud/compute/v1/AutoscalingPolicy.java | 56 +- .../v1/AutoscalingPolicyCpuUtilization.java | 22 +- ...oscalingPolicyCustomMetricUtilization.java | 36 +- ...scalingPolicyLoadBalancingUtilization.java | 22 +- .../com/google/cloud/compute/v1/Backend.java | 66 +- .../cloud/compute/v1/BackendBucket.java | 59 +- .../cloud/compute/v1/BackendBucketList.java | 53 +- .../cloud/compute/v1/BackendService.java | 136 +---- .../v1/BackendServiceAggregatedList.java | 47 +- .../compute/v1/BackendServiceCdnPolicy.java | 21 +- .../compute/v1/BackendServiceGroupHealth.java | 33 +- .../cloud/compute/v1/BackendServiceIAP.java | 41 +- .../cloud/compute/v1/BackendServiceList.java | 53 +- .../compute/v1/BackendServicesScopedList.java | 33 +- .../compute/v1/CacheInvalidationRule.java | 28 +- .../cloud/compute/v1/CacheKeyPolicy.java | 53 +- .../google/cloud/compute/v1/Commitment.java | 89 +-- .../compute/v1/CommitmentAggregatedList.java | 47 +- .../cloud/compute/v1/CommitmentList.java | 53 +- .../compute/v1/CommitmentsScopedList.java | 33 +- .../cloud/compute/v1/ConnectionDraining.java | 22 +- .../v1/CreateSnapshotDiskHttpRequest.java | 73 +-- .../compute/v1/CustomerEncryptionKey.java | 28 +- .../CustomerEncryptionKeyProtectedDisk.java | 29 +- .../com/google/cloud/compute/v1/Data.java | 28 +- ...DeleteAccessConfigInstanceHttpRequest.java | 73 +-- .../compute/v1/DeleteAddressHttpRequest.java | 63 +- .../v1/DeleteAutoscalerHttpRequest.java | 63 +- .../v1/DeleteBackendBucketHttpRequest.java | 63 +- .../v1/DeleteBackendServiceHttpRequest.java | 63 +- .../compute/v1/DeleteDiskHttpRequest.java | 63 +- .../compute/v1/DeleteFirewallHttpRequest.java | 63 +- .../v1/DeleteForwardingRuleHttpRequest.java | 63 +- .../v1/DeleteGlobalAddressHttpRequest.java | 63 +- ...DeleteGlobalForwardingRuleHttpRequest.java | 63 +- .../v1/DeleteGlobalOperationHttpRequest.java | 58 +- .../v1/DeleteHealthCheckHttpRequest.java | 63 +- .../v1/DeleteHttpHealthCheckHttpRequest.java | 63 +- .../v1/DeleteHttpsHealthCheckHttpRequest.java | 63 +- .../compute/v1/DeleteImageHttpRequest.java | 63 +- .../v1/DeleteInstanceGroupHttpRequest.java | 63 +- ...DeleteInstanceGroupManagerHttpRequest.java | 64 +- .../compute/v1/DeleteInstanceHttpRequest.java | 63 +- .../v1/DeleteInstanceTemplateHttpRequest.java | 63 +- ...tancesInstanceGroupManagerHttpRequest.java | 73 +-- ...RegionInstanceGroupManagerHttpRequest.java | 73 +-- ...leteInterconnectAttachmentHttpRequest.java | 65 +- .../v1/DeleteInterconnectHttpRequest.java | 63 +- .../compute/v1/DeleteLicenseHttpRequest.java | 63 +- .../compute/v1/DeleteNetworkHttpRequest.java | 63 +- .../v1/DeleteRegionAutoscalerHttpRequest.java | 63 +- ...DeleteRegionBackendServiceHttpRequest.java | 63 +- ...RegionInstanceGroupManagerHttpRequest.java | 64 +- .../v1/DeleteRegionOperationHttpRequest.java | 58 +- .../compute/v1/DeleteRouteHttpRequest.java | 63 +- .../compute/v1/DeleteRouterHttpRequest.java | 63 +- .../compute/v1/DeleteSnapshotHttpRequest.java | 63 +- .../v1/DeleteSslCertificateHttpRequest.java | 63 +- .../v1/DeleteSslPolicyHttpRequest.java | 63 +- .../v1/DeleteSubnetworkHttpRequest.java | 63 +- .../v1/DeleteTargetHttpProxyHttpRequest.java | 63 +- .../v1/DeleteTargetHttpsProxyHttpRequest.java | 63 +- .../v1/DeleteTargetInstanceHttpRequest.java | 63 +- .../v1/DeleteTargetPoolHttpRequest.java | 63 +- .../v1/DeleteTargetSslProxyHttpRequest.java | 63 +- .../v1/DeleteTargetTcpProxyHttpRequest.java | 63 +- .../v1/DeleteTargetVpnGatewayHttpRequest.java | 63 +- .../compute/v1/DeleteUrlMapHttpRequest.java | 63 +- .../v1/DeleteVpnTunnelHttpRequest.java | 63 +- .../v1/DeleteZoneOperationHttpRequest.java | 58 +- .../com/google/cloud/compute/v1/Denied.java | 33 +- .../compute/v1/DeprecateImageHttpRequest.java | 70 +-- .../cloud/compute/v1/DeprecationStatus.java | 43 +- .../v1/DetachDiskInstanceHttpRequest.java | 68 +-- .../v1/DisableXpnHostProjectHttpRequest.java | 63 +- .../DisableXpnResourceProjectHttpRequest.java | 71 +-- .../com/google/cloud/compute/v1/Disk.java | 172 +----- .../cloud/compute/v1/DiskAggregatedList.java | 47 +- .../com/google/cloud/compute/v1/DiskList.java | 53 +- .../cloud/compute/v1/DiskMoveRequest.java | 28 +- .../com/google/cloud/compute/v1/DiskType.java | 70 +-- .../compute/v1/DiskTypeAggregatedList.java | 47 +- .../google/cloud/compute/v1/DiskTypeList.java | 53 +- .../cloud/compute/v1/DiskTypesScopedList.java | 33 +- .../cloud/compute/v1/DisksResizeRequest.java | 21 +- .../cloud/compute/v1/DisksScopedList.java | 33 +- .../v1/EnableXpnHostProjectHttpRequest.java | 63 +- .../EnableXpnResourceProjectHttpRequest.java | 71 +-- .../com/google/cloud/compute/v1/Error.java | 25 +- .../com/google/cloud/compute/v1/Errors.java | 33 +- ...xpandIpCidrRangeSubnetworkHttpRequest.java | 71 +-- .../com/google/cloud/compute/v1/Firewall.java | 137 +---- .../google/cloud/compute/v1/FirewallList.java | 53 +- .../cloud/compute/v1/ForwardingRule.java | 110 +--- .../v1/ForwardingRuleAggregatedList.java | 47 +- .../cloud/compute/v1/ForwardingRuleList.java | 53 +- .../compute/v1/ForwardingRulesScopedList.java | 33 +- .../v1/GetAcceleratorTypeHttpRequest.java | 58 +- .../compute/v1/GetAddressHttpRequest.java | 58 +- .../compute/v1/GetAutoscalerHttpRequest.java | 58 +- .../v1/GetBackendBucketHttpRequest.java | 58 +- .../v1/GetBackendServiceHttpRequest.java | 58 +- .../cloud/compute/v1/GetDiskHttpRequest.java | 58 +- .../compute/v1/GetDiskTypeHttpRequest.java | 58 +- .../compute/v1/GetFirewallHttpRequest.java | 58 +- .../v1/GetForwardingRuleHttpRequest.java | 58 +- .../v1/GetFromFamilyImageHttpRequest.java | 58 +- .../v1/GetGlobalAddressHttpRequest.java | 58 +- .../GetGlobalForwardingRuleHttpRequest.java | 58 +- .../v1/GetGlobalOperationHttpRequest.java | 58 +- .../GetHealthBackendServiceHttpRequest.java | 66 +- .../compute/v1/GetHealthCheckHttpRequest.java | 58 +- ...HealthRegionBackendServiceHttpRequest.java | 66 +- .../v1/GetHealthTargetPoolHttpRequest.java | 65 +- .../v1/GetHttpHealthCheckHttpRequest.java | 58 +- .../v1/GetHttpsHealthCheckHttpRequest.java | 58 +- .../cloud/compute/v1/GetImageHttpRequest.java | 58 +- .../v1/GetInstanceGroupHttpRequest.java | 58 +- .../GetInstanceGroupManagerHttpRequest.java | 59 +- .../compute/v1/GetInstanceHttpRequest.java | 58 +- .../v1/GetInstanceTemplateHttpRequest.java | 58 +- .../GetInterconnectAttachmentHttpRequest.java | 60 +- .../v1/GetInterconnectHttpRequest.java | 58 +- .../GetInterconnectLocationHttpRequest.java | 59 +- .../compute/v1/GetLicenseCodeHttpRequest.java | 58 +- .../compute/v1/GetLicenseHttpRequest.java | 58 +- .../compute/v1/GetMachineTypeHttpRequest.java | 58 +- .../compute/v1/GetNetworkHttpRequest.java | 58 +- .../compute/v1/GetProjectHttpRequest.java | 58 +- .../v1/GetRegionAutoscalerHttpRequest.java | 58 +- .../GetRegionBackendServiceHttpRequest.java | 58 +- .../v1/GetRegionCommitmentHttpRequest.java | 58 +- .../compute/v1/GetRegionHttpRequest.java | 58 +- .../v1/GetRegionInstanceGroupHttpRequest.java | 58 +- ...RegionInstanceGroupManagerHttpRequest.java | 59 +- .../v1/GetRegionOperationHttpRequest.java | 58 +- .../cloud/compute/v1/GetRouteHttpRequest.java | 58 +- .../compute/v1/GetRouterHttpRequest.java | 58 +- .../v1/GetRouterStatusRouterHttpRequest.java | 58 +- ...etSerialPortOutputInstanceHttpRequest.java | 68 +-- .../compute/v1/GetSnapshotHttpRequest.java | 58 +- .../v1/GetSslCertificateHttpRequest.java | 58 +- .../compute/v1/GetSslPolicyHttpRequest.java | 58 +- .../compute/v1/GetSubnetworkHttpRequest.java | 58 +- .../v1/GetTargetHttpProxyHttpRequest.java | 58 +- .../v1/GetTargetHttpsProxyHttpRequest.java | 58 +- .../v1/GetTargetInstanceHttpRequest.java | 58 +- .../compute/v1/GetTargetPoolHttpRequest.java | 58 +- .../v1/GetTargetSslProxyHttpRequest.java | 58 +- .../v1/GetTargetTcpProxyHttpRequest.java | 58 +- .../v1/GetTargetVpnGatewayHttpRequest.java | 58 +- .../compute/v1/GetUrlMapHttpRequest.java | 58 +- .../compute/v1/GetVpnTunnelHttpRequest.java | 58 +- .../v1/GetXpnHostProjectHttpRequest.java | 58 +- .../GetXpnResourcesProjectsHttpRequest.java | 78 +-- .../cloud/compute/v1/GetZoneHttpRequest.java | 58 +- .../v1/GetZoneOperationHttpRequest.java | 58 +- .../compute/v1/GlobalSetLabelsRequest.java | 27 +- .../cloud/compute/v1/GuestOsFeature.java | 21 +- .../cloud/compute/v1/HTTPHealthCheck.java | 263 ++++++++ ...HealthCheck.java => HTTPSHealthCheck.java} | 73 +-- .../google/cloud/compute/v1/HealthCheck.java | 119 ++-- .../cloud/compute/v1/HealthCheckList.java | 53 +- .../compute/v1/HealthCheckReference.java | 21 +- .../google/cloud/compute/v1/HealthStatus.java | 38 +- .../com/google/cloud/compute/v1/HostRule.java | 38 +- .../cloud/compute/v1/HttpHealthCheck.java | 409 ++++++++++--- .../compute/v1/HttpHealthCheckClient.java | 78 +-- .../cloud/compute/v1/HttpHealthCheckList.java | 67 +- .../compute/v1/HttpHealthCheckSettings.java | 4 +- ...ealthCheck2.java => HttpsHealthCheck.java} | 115 ++-- .../cloud/compute/v1/HttpsHealthCheck2.java | 578 ------------------ .../compute/v1/HttpsHealthCheckClient.java | 78 +-- .../compute/v1/HttpsHealthCheckList.java | 67 +- .../compute/v1/HttpsHealthCheckSettings.java | 4 +- .../com/google/cloud/compute/v1/Image.java | 178 ++---- .../google/cloud/compute/v1/ImageList.java | 53 +- .../compute/v1/InsertAddressHttpRequest.java | 68 +-- .../v1/InsertAutoscalerHttpRequest.java | 69 +-- .../v1/InsertBackendBucketHttpRequest.java | 70 +-- .../v1/InsertBackendServiceHttpRequest.java | 70 +-- .../compute/v1/InsertDiskHttpRequest.java | 73 +-- .../compute/v1/InsertFirewallHttpRequest.java | 68 +-- .../v1/InsertForwardingRuleHttpRequest.java | 70 +-- .../v1/InsertGlobalAddressHttpRequest.java | 68 +-- ...InsertGlobalForwardingRuleHttpRequest.java | 70 +-- .../v1/InsertHealthCheckHttpRequest.java | 69 +-- .../v1/InsertHttpHealthCheckHttpRequest.java | 84 +-- .../v1/InsertHttpsHealthCheckHttpRequest.java | 84 +-- .../compute/v1/InsertImageHttpRequest.java | 73 +-- .../v1/InsertInstanceGroupHttpRequest.java | 70 +-- ...InsertInstanceGroupManagerHttpRequest.java | 71 +-- .../compute/v1/InsertInstanceHttpRequest.java | 75 +-- .../v1/InsertInstanceTemplateHttpRequest.java | 70 +-- ...sertInterconnectAttachmentHttpRequest.java | 71 +-- .../v1/InsertInterconnectHttpRequest.java | 69 +-- .../compute/v1/InsertLicenseHttpRequest.java | 68 +-- .../compute/v1/InsertNetworkHttpRequest.java | 68 +-- .../v1/InsertRegionAutoscalerHttpRequest.java | 69 +-- ...InsertRegionBackendServiceHttpRequest.java | 70 +-- .../v1/InsertRegionCommitmentHttpRequest.java | 69 +-- ...RegionInstanceGroupManagerHttpRequest.java | 71 +-- .../compute/v1/InsertRouteHttpRequest.java | 68 +-- .../compute/v1/InsertRouterHttpRequest.java | 68 +-- .../v1/InsertSslCertificateHttpRequest.java | 70 +-- .../v1/InsertSslPolicyHttpRequest.java | 69 +-- .../v1/InsertSubnetworkHttpRequest.java | 69 +-- .../v1/InsertTargetHttpProxyHttpRequest.java | 70 +-- .../v1/InsertTargetHttpsProxyHttpRequest.java | 70 +-- .../v1/InsertTargetInstanceHttpRequest.java | 70 +-- .../v1/InsertTargetPoolHttpRequest.java | 69 +-- .../v1/InsertTargetSslProxyHttpRequest.java | 70 +-- .../v1/InsertTargetTcpProxyHttpRequest.java | 70 +-- .../v1/InsertTargetVpnGatewayHttpRequest.java | 70 +-- .../compute/v1/InsertUrlMapHttpRequest.java | 68 +-- .../v1/InsertVpnTunnelHttpRequest.java | 69 +-- .../com/google/cloud/compute/v1/Instance.java | 156 +---- .../compute/v1/InstanceAggregatedList.java | 47 +- .../cloud/compute/v1/InstanceGroup.java | 89 +-- .../v1/InstanceGroupAggregatedList.java | 47 +- .../cloud/compute/v1/InstanceGroupList.java | 53 +- .../compute/v1/InstanceGroupManager.java | 108 +--- .../InstanceGroupManagerActionsSummary.java | 60 +- .../InstanceGroupManagerAggregatedList.java | 47 +- .../compute/v1/InstanceGroupManagerList.java | 53 +- ...eGroupManagersAbandonInstancesRequest.java | 25 +- ...ceGroupManagersDeleteInstancesRequest.java | 25 +- ...pManagersListManagedInstancesResponse.java | 25 +- ...GroupManagersRecreateInstancesRequest.java | 25 +- .../v1/InstanceGroupManagersScopedList.java | 33 +- ...oupManagersSetInstanceTemplateRequest.java | 21 +- ...nceGroupManagersSetTargetPoolsRequest.java | 33 +- .../v1/InstanceGroupsAddInstancesRequest.java | 25 +- .../v1/InstanceGroupsListInstances.java | 53 +- .../InstanceGroupsListInstancesRequest.java | 21 +- .../InstanceGroupsRemoveInstancesRequest.java | 25 +- .../compute/v1/InstanceGroupsScopedList.java | 33 +- .../InstanceGroupsSetNamedPortsRequest.java | 33 +- .../google/cloud/compute/v1/InstanceList.java | 53 +- .../compute/v1/InstanceListReferrers.java | 53 +- .../cloud/compute/v1/InstanceMoveRequest.java | 28 +- .../cloud/compute/v1/InstanceProperties.java | 94 +-- .../cloud/compute/v1/InstanceReference.java | 21 +- .../cloud/compute/v1/InstanceTemplate.java | 54 +- .../compute/v1/InstanceTemplateList.java | 53 +- .../compute/v1/InstanceWithNamedPorts.java | 38 +- .../cloud/compute/v1/InstancesScopedList.java | 33 +- .../compute/v1/InstancesSetLabelsRequest.java | 27 +- .../InstancesSetMachineResourcesRequest.java | 25 +- .../v1/InstancesSetMachineTypeRequest.java | 21 +- .../v1/InstancesSetMinCpuPlatformRequest.java | 21 +- .../v1/InstancesSetServiceAccountRequest.java | 33 +- ...nstancesStartWithEncryptionKeyRequest.java | 25 +- .../google/cloud/compute/v1/Interconnect.java | 141 +---- .../compute/v1/InterconnectAttachment.java | 96 +-- .../InterconnectAttachmentAggregatedList.java | 47 +- .../v1/InterconnectAttachmentList.java | 53 +- .../v1/InterconnectAttachmentPrivateInfo.java | 21 +- .../v1/InterconnectAttachmentsScopedList.java | 33 +- .../compute/v1/InterconnectCircuitInfo.java | 33 +- .../cloud/compute/v1/InterconnectList.java | 53 +- .../compute/v1/InterconnectLocation.java | 97 +-- .../compute/v1/InterconnectLocationList.java | 53 +- .../v1/InterconnectLocationRegionInfo.java | 33 +- .../v1/InterconnectOutageNotification.java | 63 +- .../v1/InvalidateCacheUrlMapHttpRequest.java | 71 +-- .../com/google/cloud/compute/v1/Items.java | 28 +- .../com/google/cloud/compute/v1/License.java | 70 +-- .../google/cloud/compute/v1/LicenseCode.java | 69 +-- .../compute/v1/LicenseCodeLicenseAlias.java | 28 +- .../v1/LicenseResourceRequirements.java | 28 +- .../compute/v1/LicensesListResponse.java | 48 +- .../v1/ListAcceleratorTypesHttpRequest.java | 78 +-- .../compute/v1/ListAddressesHttpRequest.java | 78 +-- .../v1/ListAutoscalersHttpRequest.java | 78 +-- ...ailableFeaturesSslPoliciesHttpRequest.java | 78 +-- .../v1/ListBackendBucketsHttpRequest.java | 78 +-- .../v1/ListBackendServicesHttpRequest.java | 78 +-- .../compute/v1/ListDiskTypesHttpRequest.java | 78 +-- .../compute/v1/ListDisksHttpRequest.java | 78 +-- .../compute/v1/ListFirewallsHttpRequest.java | 78 +-- .../v1/ListForwardingRulesHttpRequest.java | 78 +-- .../v1/ListGlobalAddressesHttpRequest.java | 78 +-- .../ListGlobalForwardingRulesHttpRequest.java | 78 +-- .../v1/ListGlobalOperationsHttpRequest.java | 78 +-- .../v1/ListHealthChecksHttpRequest.java | 78 +-- .../v1/ListHttpHealthChecksHttpRequest.java | 78 +-- .../v1/ListHttpsHealthChecksHttpRequest.java | 78 +-- .../compute/v1/ListImagesHttpRequest.java | 78 +-- .../ListInstanceGroupManagersHttpRequest.java | 78 +-- .../v1/ListInstanceGroupsHttpRequest.java | 78 +-- .../v1/ListInstanceTemplatesHttpRequest.java | 78 +-- .../compute/v1/ListInstancesHttpRequest.java | 78 +-- ...istInstancesInstanceGroupsHttpRequest.java | 86 +-- ...tancesRegionInstanceGroupsHttpRequest.java | 87 +-- ...istInterconnectAttachmentsHttpRequest.java | 78 +-- .../ListInterconnectLocationsHttpRequest.java | 78 +-- .../v1/ListInterconnectsHttpRequest.java | 78 +-- .../compute/v1/ListLicensesHttpRequest.java | 78 +-- .../v1/ListMachineTypesHttpRequest.java | 78 +-- ...ancesInstanceGroupManagersHttpRequest.java | 79 +-- ...egionInstanceGroupManagersHttpRequest.java | 79 +-- .../compute/v1/ListNetworksHttpRequest.java | 78 +-- .../v1/ListReferrersInstancesHttpRequest.java | 78 +-- .../v1/ListRegionAutoscalersHttpRequest.java | 78 +-- .../ListRegionBackendServicesHttpRequest.java | 78 +-- .../v1/ListRegionCommitmentsHttpRequest.java | 78 +-- ...egionInstanceGroupManagersHttpRequest.java | 78 +-- .../ListRegionInstanceGroupsHttpRequest.java | 78 +-- .../v1/ListRegionOperationsHttpRequest.java | 78 +-- .../compute/v1/ListRegionsHttpRequest.java | 78 +-- .../compute/v1/ListRoutersHttpRequest.java | 78 +-- .../compute/v1/ListRoutesHttpRequest.java | 78 +-- .../compute/v1/ListSnapshotsHttpRequest.java | 78 +-- .../v1/ListSslCertificatesHttpRequest.java | 78 +-- .../v1/ListSslPoliciesHttpRequest.java | 78 +-- .../v1/ListSubnetworksHttpRequest.java | 78 +-- .../v1/ListTargetHttpProxiesHttpRequest.java | 78 +-- .../v1/ListTargetHttpsProxiesHttpRequest.java | 78 +-- .../v1/ListTargetInstancesHttpRequest.java | 78 +-- .../v1/ListTargetPoolsHttpRequest.java | 78 +-- .../v1/ListTargetSslProxiesHttpRequest.java | 78 +-- .../v1/ListTargetTcpProxiesHttpRequest.java | 78 +-- .../v1/ListTargetVpnGatewaysHttpRequest.java | 78 +-- .../compute/v1/ListUrlMapsHttpRequest.java | 78 +-- .../compute/v1/ListVpnTunnelsHttpRequest.java | 78 +-- .../v1/ListXpnHostsProjectsHttpRequest.java | 86 +-- .../v1/ListZoneOperationsHttpRequest.java | 78 +-- .../compute/v1/ListZonesHttpRequest.java | 78 +-- .../google/cloud/compute/v1/MachineType.java | 104 +--- .../compute/v1/MachineTypeAggregatedList.java | 47 +- .../cloud/compute/v1/MachineTypeList.java | 53 +- .../compute/v1/MachineTypesScopedList.java | 33 +- .../cloud/compute/v1/ManagedInstance.java | 43 +- .../v1/ManagedInstanceLastAttempt.java | 21 +- .../com/google/cloud/compute/v1/Metadata.java | 38 +- .../v1/MoveDiskProjectHttpRequest.java | 70 +-- .../v1/MoveInstanceProjectHttpRequest.java | 70 +-- .../google/cloud/compute/v1/NamedPort.java | 28 +- .../com/google/cloud/compute/v1/Network.java | 90 +-- .../cloud/compute/v1/NetworkInterface.java | 67 +- .../google/cloud/compute/v1/NetworkList.java | 53 +- .../cloud/compute/v1/NetworkPeering.java | 43 +- .../compute/v1/NetworkRoutingConfig.java | 21 +- .../compute/v1/NetworksAddPeeringRequest.java | 33 +- .../v1/NetworksRemovePeeringRequest.java | 21 +- .../google/cloud/compute/v1/Operation.java | 141 +---- .../compute/v1/OperationAggregatedList.java | 47 +- .../cloud/compute/v1/OperationList.java | 53 +- .../compute/v1/OperationsScopedList.java | 33 +- .../v1/PatchAutoscalerHttpRequest.java | 74 +-- .../v1/PatchBackendBucketHttpRequest.java | 70 +-- .../v1/PatchBackendServiceHttpRequest.java | 70 +-- .../compute/v1/PatchFirewallHttpRequest.java | 68 +-- .../v1/PatchHealthCheckHttpRequest.java | 69 +-- .../v1/PatchHttpHealthCheckHttpRequest.java | 84 +-- .../v1/PatchHttpsHealthCheckHttpRequest.java | 84 +-- .../v1/PatchInterconnectHttpRequest.java | 69 +-- .../compute/v1/PatchNetworkHttpRequest.java | 68 +-- .../v1/PatchRegionAutoscalerHttpRequest.java | 74 +-- .../PatchRegionBackendServiceHttpRequest.java | 70 +-- .../compute/v1/PatchRouterHttpRequest.java | 68 +-- .../compute/v1/PatchSslPolicyHttpRequest.java | 69 +-- .../v1/PatchSubnetworkHttpRequest.java | 69 +-- .../compute/v1/PatchUrlMapHttpRequest.java | 68 +-- .../google/cloud/compute/v1/PathMatcher.java | 43 +- .../com/google/cloud/compute/v1/PathRule.java | 33 +- .../compute/v1/PreviewRouterHttpRequest.java | 63 +- .../com/google/cloud/compute/v1/Project.java | 93 +-- .../v1/ProjectsDisableXpnResourceRequest.java | 21 +- .../v1/ProjectsEnableXpnResourceRequest.java | 21 +- .../compute/v1/ProjectsGetXpnResources.java | 38 +- .../v1/ProjectsListXpnHostsRequest.java | 21 +- .../com/google/cloud/compute/v1/Quota.java | 33 +- .../com/google/cloud/compute/v1/RawDisk.java | 33 +- ...tancesInstanceGroupManagerHttpRequest.java | 73 +-- ...RegionInstanceGroupManagerHttpRequest.java | 73 +-- .../google/cloud/compute/v1/Reference.java | 38 +- .../com/google/cloud/compute/v1/Region.java | 78 +-- .../compute/v1/RegionAutoscalerList.java | 53 +- .../compute/v1/RegionInstanceGroupList.java | 53 +- .../v1/RegionInstanceGroupManagerList.java | 53 +- ...eGroupManagersAbandonInstancesRequest.java | 25 +- ...ceGroupManagersDeleteInstancesRequest.java | 25 +- ...nceGroupManagersListInstancesResponse.java | 25 +- ...nInstanceGroupManagersRecreateRequest.java | 25 +- ...nceGroupManagersSetTargetPoolsRequest.java | 33 +- ...stanceGroupManagersSetTemplateRequest.java | 21 +- .../v1/RegionInstanceGroupsListInstances.java | 53 +- ...ionInstanceGroupsListInstancesRequest.java | 28 +- ...ionInstanceGroupsSetNamedPortsRequest.java | 33 +- .../google/cloud/compute/v1/RegionList.java | 53 +- ...emoveHealthCheckTargetPoolHttpRequest.java | 71 +-- .../RemoveInstanceTargetPoolHttpRequest.java | 71 +-- ...moveInstancesInstanceGroupHttpRequest.java | 71 +-- .../v1/RemovePeeringNetworkHttpRequest.java | 71 +-- .../compute/v1/ResetInstanceHttpRequest.java | 63 +- .../compute/v1/ResizeDiskHttpRequest.java | 70 +-- ...ResizeInstanceGroupManagerHttpRequest.java | 69 +-- ...RegionInstanceGroupManagerHttpRequest.java | 69 +-- .../cloud/compute/v1/ResourceCommitment.java | 28 +- .../compute/v1/ResourceGroupReference.java | 21 +- .../com/google/cloud/compute/v1/Route.java | 113 +--- .../google/cloud/compute/v1/RouteList.java | 53 +- .../com/google/cloud/compute/v1/Router.java | 83 +-- .../compute/v1/RouterAdvertisedIpRange.java | 28 +- .../compute/v1/RouterAggregatedList.java | 47 +- .../google/cloud/compute/v1/RouterBgp.java | 47 +- .../cloud/compute/v1/RouterBgpPeer.java | 74 +-- .../cloud/compute/v1/RouterInterface.java | 41 +- .../google/cloud/compute/v1/RouterList.java | 53 +- .../google/cloud/compute/v1/RouterStatus.java | 51 +- .../compute/v1/RouterStatusBgpPeerStatus.java | 73 +-- .../compute/v1/RouterStatusResponse.java | 28 +- .../compute/v1/RoutersPreviewResponse.java | 21 +- .../cloud/compute/v1/RoutersScopedList.java | 33 +- .../cloud/compute/v1/SSLHealthCheck.java | 43 +- .../google/cloud/compute/v1/Scheduling.java | 34 +- .../google/cloud/compute/v1/ScratchDisks.java | 21 +- .../cloud/compute/v1/SerialPortOutput.java | 43 +- .../cloud/compute/v1/ServiceAccount.java | 33 +- ...ckendServiceTargetSslProxyHttpRequest.java | 72 +-- ...ckendServiceTargetTcpProxyHttpRequest.java | 72 +-- .../v1/SetBackupTargetPoolHttpRequest.java | 75 +-- ...monInstanceMetadataProjectHttpRequest.java | 68 +-- ...DeletionProtectionInstanceHttpRequest.java | 69 +-- .../SetDiskAutoDeleteInstanceHttpRequest.java | 73 +-- ...mplateInstanceGroupManagerHttpRequest.java | 73 +-- ...RegionInstanceGroupManagerHttpRequest.java | 73 +-- .../compute/v1/SetLabelsDiskHttpRequest.java | 71 +-- .../compute/v1/SetLabelsImageHttpRequest.java | 66 +- .../v1/SetLabelsInstanceHttpRequest.java | 71 +-- .../v1/SetLabelsSnapshotHttpRequest.java | 66 +- ...etMachineResourcesInstanceHttpRequest.java | 71 +-- .../v1/SetMachineTypeInstanceHttpRequest.java | 71 +-- .../v1/SetMetadataInstanceHttpRequest.java | 68 +-- .../SetMinCpuPlatformInstanceHttpRequest.java | 71 +-- ...SetNamedPortsInstanceGroupHttpRequest.java | 71 +-- ...edPortsRegionInstanceGroupHttpRequest.java | 72 +-- ...teIpGoogleAccessSubnetworkHttpRequest.java | 72 +-- ...tProxyHeaderTargetSslProxyHttpRequest.java | 71 +-- ...tProxyHeaderTargetTcpProxyHttpRequest.java | 71 +-- .../v1/SetSchedulingInstanceHttpRequest.java | 69 +-- .../SetServiceAccountInstanceHttpRequest.java | 71 +-- ...rtificatesTargetHttpsProxyHttpRequest.java | 72 +-- ...CertificatesTargetSslProxyHttpRequest.java | 72 +-- ...tSslPolicyTargetHttpsProxyHttpRequest.java | 70 +-- ...SetSslPolicyTargetSslProxyHttpRequest.java | 70 +-- .../v1/SetTagsInstanceHttpRequest.java | 68 +-- .../SetTargetForwardingRuleHttpRequest.java | 70 +-- ...TargetGlobalForwardingRuleHttpRequest.java | 70 +-- ...tPoolsInstanceGroupManagerHttpRequest.java | 73 +-- ...RegionInstanceGroupManagerHttpRequest.java | 73 +-- .../SetUrlMapTargetHttpProxyHttpRequest.java | 70 +-- .../SetUrlMapTargetHttpsProxyHttpRequest.java | 70 +-- ...etUsageExportBucketProjectHttpRequest.java | 70 +-- .../com/google/cloud/compute/v1/Snapshot.java | 122 +--- .../google/cloud/compute/v1/SnapshotList.java | 53 +- .../cloud/compute/v1/SslCertificate.java | 59 +- .../cloud/compute/v1/SslCertificateList.java | 53 +- .../cloud/compute/v1/SslPoliciesList.java | 53 +- ...PoliciesListAvailableFeaturesResponse.java | 25 +- .../google/cloud/compute/v1/SslPolicy.java | 92 +-- .../cloud/compute/v1/SslPolicyReference.java | 21 +- .../compute/v1/StartInstanceHttpRequest.java | 63 +- ...tWithEncryptionKeyInstanceHttpRequest.java | 72 +-- .../compute/v1/StopInstanceHttpRequest.java | 63 +- .../google/cloud/compute/v1/Subnetwork.java | 91 +-- .../compute/v1/SubnetworkAggregatedList.java | 47 +- .../cloud/compute/v1/SubnetworkList.java | 53 +- .../compute/v1/SubnetworkSecondaryRange.java | 28 +- .../SubnetworksExpandIpCidrRangeRequest.java | 21 +- .../compute/v1/SubnetworksScopedList.java | 33 +- ...tworksSetPrivateIpGoogleAccessRequest.java | 23 +- .../SwitchToCustomModeNetworkHttpRequest.java | 63 +- .../cloud/compute/v1/TCPHealthCheck.java | 43 +- .../com/google/cloud/compute/v1/Tags.java | 33 +- .../cloud/compute/v1/TargetHttpProxy.java | 54 +- .../cloud/compute/v1/TargetHttpProxyList.java | 53 +- ...HttpsProxiesSetSslCertificatesRequest.java | 25 +- .../cloud/compute/v1/TargetHttpsProxy.java | 69 +-- .../compute/v1/TargetHttpsProxyList.java | 53 +- .../cloud/compute/v1/TargetInstance.java | 64 +- .../v1/TargetInstanceAggregatedList.java | 47 +- .../cloud/compute/v1/TargetInstanceList.java | 53 +- .../compute/v1/TargetInstancesScopedList.java | 33 +- .../google/cloud/compute/v1/TargetPool.java | 88 +-- .../compute/v1/TargetPoolAggregatedList.java | 47 +- .../compute/v1/TargetPoolInstanceHealth.java | 33 +- .../cloud/compute/v1/TargetPoolList.java | 53 +- .../v1/TargetPoolsAddHealthCheckRequest.java | 25 +- .../v1/TargetPoolsAddInstanceRequest.java | 25 +- .../TargetPoolsRemoveHealthCheckRequest.java | 25 +- .../v1/TargetPoolsRemoveInstanceRequest.java | 25 +- .../compute/v1/TargetPoolsScopedList.java | 33 +- .../cloud/compute/v1/TargetReference.java | 21 +- ...getSslProxiesSetBackendServiceRequest.java | 21 +- ...TargetSslProxiesSetProxyHeaderRequest.java | 21 +- ...etSslProxiesSetSslCertificatesRequest.java | 25 +- .../cloud/compute/v1/TargetSslProxy.java | 74 +-- .../cloud/compute/v1/TargetSslProxyList.java | 53 +- ...getTcpProxiesSetBackendServiceRequest.java | 21 +- ...TargetTcpProxiesSetProxyHeaderRequest.java | 21 +- .../cloud/compute/v1/TargetTcpProxy.java | 59 +- .../cloud/compute/v1/TargetTcpProxyList.java | 53 +- .../cloud/compute/v1/TargetVpnGateway.java | 83 +-- .../v1/TargetVpnGatewayAggregatedList.java | 47 +- .../compute/v1/TargetVpnGatewayList.java | 53 +- .../v1/TargetVpnGatewaysScopedList.java | 33 +- .../google/cloud/compute/v1/TestFailure.java | 38 +- ...tIamPermissionsLicenseCodeHttpRequest.java | 66 +- .../TestIamPermissionsLicenseHttpRequest.java | 66 +- .../compute/v1/TestPermissionsRequest.java | 25 +- .../compute/v1/TestPermissionsResponse.java | 25 +- ...UpdateAccessConfigInstanceHttpRequest.java | 74 +-- .../v1/UpdateAutoscalerHttpRequest.java | 74 +-- .../v1/UpdateBackendBucketHttpRequest.java | 70 +-- .../v1/UpdateBackendServiceHttpRequest.java | 70 +-- .../compute/v1/UpdateFirewallHttpRequest.java | 68 +-- .../v1/UpdateHealthCheckHttpRequest.java | 69 +-- .../v1/UpdateHttpHealthCheckHttpRequest.java | 84 +-- .../v1/UpdateHttpsHealthCheckHttpRequest.java | 84 +-- ...teNetworkInterfaceInstanceHttpRequest.java | 75 +-- .../v1/UpdateRegionAutoscalerHttpRequest.java | 74 +-- ...UpdateRegionBackendServiceHttpRequest.java | 70 +-- .../compute/v1/UpdateRouterHttpRequest.java | 68 +-- .../compute/v1/UpdateUrlMapHttpRequest.java | 68 +-- .../com/google/cloud/compute/v1/UrlMap.java | 87 +-- .../google/cloud/compute/v1/UrlMapList.java | 53 +- .../cloud/compute/v1/UrlMapReference.java | 21 +- .../google/cloud/compute/v1/UrlMapTest.java | 38 +- .../compute/v1/UrlMapValidationResult.java | 47 +- .../compute/v1/UrlMapsValidateRequest.java | 21 +- .../compute/v1/UrlMapsValidateResponse.java | 21 +- .../cloud/compute/v1/UsageExportLocation.java | 28 +- .../compute/v1/ValidateUrlMapHttpRequest.java | 66 +- .../google/cloud/compute/v1/VpnTunnel.java | 113 +--- .../compute/v1/VpnTunnelAggregatedList.java | 47 +- .../cloud/compute/v1/VpnTunnelList.java | 53 +- .../compute/v1/VpnTunnelsScopedList.java | 33 +- .../com/google/cloud/compute/v1/Warning.java | 38 +- .../com/google/cloud/compute/v1/Warnings.java | 38 +- .../google/cloud/compute/v1/XpnHostList.java | 53 +- .../cloud/compute/v1/XpnResourceId.java | 28 +- .../com/google/cloud/compute/v1/Zone.java | 74 +-- .../com/google/cloud/compute/v1/ZoneList.java | 53 +- .../compute/v1/ZoneSetLabelsRequest.java | 27 +- .../compute/v1/stub/HttpHealthCheckStub.java | 4 +- .../v1/stub/HttpHealthCheckStubSettings.java | 18 +- .../v1/stub/HttpJsonHttpHealthCheckStub.java | 18 +- .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 18 +- .../compute/v1/stub/HttpsHealthCheckStub.java | 4 +- .../v1/stub/HttpsHealthCheckStubSettings.java | 18 +- .../compute/v1/HttpHealthCheckClientTest.java | 24 +- .../v1/HttpsHealthCheckClientTest.java | 24 +- .../discocompute/JsonComputeExample.java | 144 +++++ 603 files changed, 9628 insertions(+), 26994 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HttpSHealthCheck.java => HTTPSHealthCheck.java} (72%) rename google-cloud-compute/src/main/java/com/google/cloud/compute/v1/{HttpHealthCheck2.java => HttpsHealthCheck.java} (76%) delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java create mode 100644 google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java index b9a26621f369..5b3df3ee8132 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private AbandonInstancesInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("instanceGroupManagersAbandonInstancesRequestResource") - && instanceGroupManagersAbandonInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupManagersAbandonInstancesRequestResource", - Collections.singletonList( - String.valueOf(instanceGroupManagersAbandonInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("instanceGroupManagersAbandonInstancesRequestResource")) { - return String.valueOf(instanceGroupManagersAbandonInstancesRequestResource); + return instanceGroupManagersAbandonInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public InstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBody() { return instanceGroupManagersAbandonInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java index 1ccb72d73dc8..8a1b6a30beb0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource") - && regionInstanceGroupManagersAbandonInstancesRequestResource != null) { - fieldMap.put( - "regionInstanceGroupManagersAbandonInstancesRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupManagersAbandonInstancesRequestResource")) { - return String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource); + return regionInstanceGroupManagersAbandonInstancesRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public RegionInstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBo return regionInstanceGroupManagersAbandonInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java index 78206f41eb00..f23011e953c4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private AcceleratorConfig(Integer acceleratorCount, String acceleratorType) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("acceleratorCount") && acceleratorCount != null) { - fieldMap.put("acceleratorCount", Collections.singletonList(String.valueOf(acceleratorCount))); - } - if (fieldNames.contains("acceleratorType") && acceleratorType != null) { - fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("acceleratorCount")) { - return String.valueOf(acceleratorCount); + return acceleratorCount; } if (fieldName.equals("acceleratorType")) { - return String.valueOf(acceleratorType); + return acceleratorType; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getAcceleratorCount() { return acceleratorCount; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java index 77d140001d40..fb87ef23f2f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private AcceleratorType( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("maximumCardsPerInstance") && maximumCardsPerInstance != null) { - fieldMap.put( - "maximumCardsPerInstance", - Collections.singletonList(String.valueOf(maximumCardsPerInstance))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("maximumCardsPerInstance")) { - return String.valueOf(maximumCardsPerInstance); + return maximumCardsPerInstance; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -146,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java index 07b2d2dfd939..3ef933c0ed8e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private AcceleratorTypeAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java index d978fdcbf654..6445ea9d8386 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private AcceleratorTypeList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorType item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java index ae1279524908..91d5ebd7ae01 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private AcceleratorTypesScopedList(List acceleratorTypes, Warni } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("acceleratorTypes") && acceleratorTypes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorType item : acceleratorTypes) { - stringList.add(item.toString()); - } - fieldMap.put("acceleratorTypes", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("acceleratorTypes")) { - return String.valueOf(acceleratorTypes); + return acceleratorTypes; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAcceleratorTypesList() { return acceleratorTypes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java index 6f2d287a7072..700c7be5d262 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,49 +57,24 @@ private AccessConfig( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("natIP") && natIP != null) { - fieldMap.put("natIP", Collections.singletonList(String.valueOf(natIP))); - } - if (fieldNames.contains("publicPtrDomainName") && publicPtrDomainName != null) { - fieldMap.put( - "publicPtrDomainName", Collections.singletonList(String.valueOf(publicPtrDomainName))); - } - if (fieldNames.contains("setPublicPtr") && setPublicPtr != null) { - fieldMap.put("setPublicPtr", Collections.singletonList(String.valueOf(setPublicPtr))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("natIP")) { - return String.valueOf(natIP); + return natIP; } if (fieldName.equals("publicPtrDomainName")) { - return String.valueOf(publicPtrDomainName); + return publicPtrDomainName; } if (fieldName.equals("setPublicPtr")) { - return String.valueOf(setPublicPtr); + return setPublicPtr; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -114,6 +85,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java index 62f3e600b067..355d5d314cfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private AddAccessConfigInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { - fieldMap.put( - "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); - } - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("networkInterface") && networkInterface != null) { - fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("accessConfigResource")) { - return String.valueOf(accessConfigResource); + return accessConfigResource; } if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("networkInterface")) { - return String.valueOf(networkInterface); + return networkInterface; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -164,6 +120,12 @@ public AccessConfig getApiMessageRequestBody() { return accessConfigResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public AccessConfig getAccessConfigResource() { return accessConfigResource; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java index b1faf9156468..9262d462efe4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddHealthCheckTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetPoolsAddHealthCheckRequestResource") - && targetPoolsAddHealthCheckRequestResource != null) { - fieldMap.put( - "targetPoolsAddHealthCheckRequestResource", - Collections.singletonList(String.valueOf(targetPoolsAddHealthCheckRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetPoolsAddHealthCheckRequestResource")) { - return String.valueOf(targetPoolsAddHealthCheckRequestResource); + return targetPoolsAddHealthCheckRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public TargetPoolsAddHealthCheckRequest getApiMessageRequestBody() { return targetPoolsAddHealthCheckRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java index 7a944fcdd6b2..29504b899fbf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddInstanceTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetPoolsAddInstanceRequestResource") - && targetPoolsAddInstanceRequestResource != null) { - fieldMap.put( - "targetPoolsAddInstanceRequestResource", - Collections.singletonList(String.valueOf(targetPoolsAddInstanceRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetPoolsAddInstanceRequestResource")) { - return String.valueOf(targetPoolsAddInstanceRequestResource); + return targetPoolsAddInstanceRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public TargetPoolsAddInstanceRequest getApiMessageRequestBody() { return targetPoolsAddInstanceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java index 2585c5368b99..d728e67f4649 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddInstancesInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("instanceGroupsAddInstancesRequestResource") - && instanceGroupsAddInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupsAddInstancesRequestResource", - Collections.singletonList(String.valueOf(instanceGroupsAddInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("instanceGroupsAddInstancesRequestResource")) { - return String.valueOf(instanceGroupsAddInstancesRequestResource); + return instanceGroupsAddInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstanceGroupsAddInstancesRequest getApiMessageRequestBody() { return instanceGroupsAddInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java index 01f04c528b36..2ee03b079e03 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddPeeringNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("networksAddPeeringRequestResource") - && networksAddPeeringRequestResource != null) { - fieldMap.put( - "networksAddPeeringRequestResource", - Collections.singletonList(String.valueOf(networksAddPeeringRequestResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("networksAddPeeringRequestResource")) { - return String.valueOf(networksAddPeeringRequestResource); + return networksAddPeeringRequestResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public NetworksAddPeeringRequest getApiMessageRequestBody() { return networksAddPeeringRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java index bf5fb8f70e1c..3d04956026b1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,95 +86,45 @@ private Address( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("addressType") && addressType != null) { - fieldMap.put("addressType", Collections.singletonList(String.valueOf(addressType))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("ipVersion") && ipVersion != null) { - fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("users") && users != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : users) { - stringList.add(item.toString()); - } - fieldMap.put("users", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("addressType")) { - return String.valueOf(addressType); + return addressType; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("ipVersion")) { - return String.valueOf(ipVersion); + return ipVersion; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("users")) { - return String.valueOf(users); + return users; } return null; } @@ -190,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAddress() { return address; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java index 089c2a50cbab..4fb93c707ae0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private AddressAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java index 936e44245a21..dfad4309cbbe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private AddressList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Address item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java index e98751340740..b8aa0161070a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private AddressesScopedList(List
addresses, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("addresses") && addresses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Address item : addresses) { - stringList.add(item.toString()); - } - fieldMap.put("addresses", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("addresses")) { - return String.valueOf(addresses); + return addresses; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List
getAddressesList() { return addresses; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java index 12b9d6c85154..e2478c51f2dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListAcceleratorTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java index 83487619deab..88436c282b6b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListAddressesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java index 9abfaa836482..71a24f28b3a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListAutoscalersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java index eb79e6cb84f6..69a8227af819 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListBackendServicesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java index a75b2af098ee..89e876b8abb4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListDiskTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java index 233312cc74e5..c9f8029f34e8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListDisksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java index b660e858c440..72cea01f104d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListForwardingRulesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java index bf09eaf8d2ed..fb2284b7dbee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListGlobalOperationsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java index 856200d39650..076e196cfb8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInstanceGroupManagersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java index 646396f2bb92..211639cfbe7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInstanceGroupsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java index 423c1ce14128..e281da33a595 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java index 76e22de8c8ad..286d3e0d2f94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInterconnectAttachmentsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java index 048534c3d74a..9c22653c070e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListMachineTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java index bf7348b89619..f6e9e5484105 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListRegionCommitmentsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java index 8cf47d8bf4c2..619e7fe65aaa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListRoutersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java index a99349acb6ee..8a5bda15a8ef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListSubnetworksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java index 6e2c49c6b09f..91c43d6c5927 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListTargetInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java index be52b0d6b37d..3c548928adeb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListTargetPoolsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java index 67e1c0a94a9f..164b5b92c225 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListTargetVpnGatewaysHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java index f3706a16d0ea..2cac8c858695 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListVpnTunnelsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java index cc3041ce98f3..c4d1d59b1043 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,25 +39,12 @@ private AliasIpRange(String ipCidrRange, String subnetworkRangeName) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { - fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); - } - if (fieldNames.contains("subnetworkRangeName") && subnetworkRangeName != null) { - fieldMap.put( - "subnetworkRangeName", Collections.singletonList(String.valueOf(subnetworkRangeName))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("ipCidrRange")) { - return String.valueOf(ipCidrRange); + return ipCidrRange; } if (fieldName.equals("subnetworkRangeName")) { - return String.valueOf(subnetworkRangeName); + return subnetworkRangeName; } return null; } @@ -72,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIpCidrRange() { return ipCidrRange; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java index b51dc3456385..ed17969066a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private Allowed(String iPProtocol, List ports) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("iPProtocol") && iPProtocol != null) { - fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); - } - if (fieldNames.contains("ports") && ports != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : ports) { - stringList.add(item.toString()); - } - fieldMap.put("ports", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("iPProtocol")) { - return String.valueOf(iPProtocol); + return iPProtocol; } if (fieldName.equals("ports")) { - return String.valueOf(ports); + return ports; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIPProtocol() { return iPProtocol; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index 395dd15f0ad0..9460daf220cc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private AttachDiskInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("attachedDiskResource") && attachedDiskResource != null) { - fieldMap.put( - "attachedDiskResource", Collections.singletonList(String.valueOf(attachedDiskResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("attachedDiskResource")) { - return String.valueOf(attachedDiskResource); + return attachedDiskResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public AttachedDisk getApiMessageRequestBody() { return attachedDiskResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java index 9039024f2ef4..13bc11b8ef17 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,99 +86,45 @@ private AttachedDisk( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoDelete") && autoDelete != null) { - fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); - } - if (fieldNames.contains("boot") && boot != null) { - fieldMap.put("boot", Collections.singletonList(String.valueOf(boot))); - } - if (fieldNames.contains("deviceName") && deviceName != null) { - fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); - } - if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put( - "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); - } - if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (GuestOsFeature item : guestOsFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("guestOsFeatures", stringList.build()); - } - if (fieldNames.contains("index") && index != null) { - fieldMap.put("index", Collections.singletonList(String.valueOf(index))); - } - if (fieldNames.contains("initializeParams") && initializeParams != null) { - fieldMap.put("initializeParams", Collections.singletonList(String.valueOf(initializeParams))); - } - if (fieldNames.contains("interface2") && interface2 != null) { - fieldMap.put("interface2", Collections.singletonList(String.valueOf(interface2))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("licenses") && licenses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenses) { - stringList.add(item.toString()); - } - fieldMap.put("licenses", stringList.build()); - } - if (fieldNames.contains("mode") && mode != null) { - fieldMap.put("mode", Collections.singletonList(String.valueOf(mode))); - } - if (fieldNames.contains("source") && source != null) { - fieldMap.put("source", Collections.singletonList(String.valueOf(source))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoDelete")) { - return String.valueOf(autoDelete); + return autoDelete; } if (fieldName.equals("boot")) { - return String.valueOf(boot); + return boot; } if (fieldName.equals("deviceName")) { - return String.valueOf(deviceName); + return deviceName; } if (fieldName.equals("diskEncryptionKey")) { - return String.valueOf(diskEncryptionKey); + return diskEncryptionKey; } if (fieldName.equals("guestOsFeatures")) { - return String.valueOf(guestOsFeatures); + return guestOsFeatures; } if (fieldName.equals("index")) { - return String.valueOf(index); + return index; } if (fieldName.equals("initializeParams")) { - return String.valueOf(initializeParams); + return initializeParams; } if (fieldName.equals("interface2")) { - return String.valueOf(interface2); + return interface2; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("licenses")) { - return String.valueOf(licenses); + return licenses; } if (fieldName.equals("mode")) { - return String.valueOf(mode); + return mode; } if (fieldName.equals("source")) { - return String.valueOf(source); + return source; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -194,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAutoDelete() { return autoDelete; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java index ebc8f214e56b..ca7015f26d13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,50 +58,24 @@ private AttachedDiskInitializeParams( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("diskName") && diskName != null) { - fieldMap.put("diskName", Collections.singletonList(String.valueOf(diskName))); - } - if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { - fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); - } - if (fieldNames.contains("diskType") && diskType != null) { - fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("sourceImage") && sourceImage != null) { - fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); - } - if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put( - "sourceImageEncryptionKey", - Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("diskName")) { - return String.valueOf(diskName); + return diskName; } if (fieldName.equals("diskSizeGb")) { - return String.valueOf(diskSizeGb); + return diskSizeGb; } if (fieldName.equals("diskType")) { - return String.valueOf(diskType); + return diskType; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("sourceImage")) { - return String.valueOf(sourceImage); + return sourceImage; } if (fieldName.equals("sourceImageEncryptionKey")) { - return String.valueOf(sourceImageEncryptionKey); + return sourceImageEncryptionKey; } return null; } @@ -115,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDiskName() { return diskName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java index 0c6b2d8ed12e..4b73600d6412 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,90 +82,42 @@ private Autoscaler( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoscalingPolicy") && autoscalingPolicy != null) { - fieldMap.put( - "autoscalingPolicy", Collections.singletonList(String.valueOf(autoscalingPolicy))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("statusDetails") && statusDetails != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AutoscalerStatusDetails item : statusDetails) { - stringList.add(item.toString()); - } - fieldMap.put("statusDetails", stringList.build()); - } - if (fieldNames.contains("target") && target != null) { - fieldMap.put("target", Collections.singletonList(String.valueOf(target))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoscalingPolicy")) { - return String.valueOf(autoscalingPolicy); + return autoscalingPolicy; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("statusDetails")) { - return String.valueOf(statusDetails); + return statusDetails; } if (fieldName.equals("target")) { - return String.valueOf(target); + return target; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -181,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public AutoscalingPolicy getAutoscalingPolicy() { return autoscalingPolicy; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java index af7e74834ac5..3e0ac9f3b606 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private AutoscalerAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java index c2f9aafcc324..ebf938b369cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private AutoscalerList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Autoscaler item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java index 846838c8c2a1..23faa574e2d4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private AutoscalerStatusDetails(String message, String type) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("message")) { - return String.valueOf(message); + return message; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getMessage() { return message; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java index 33fd70094e0c..c8a2cc70631a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private AutoscalersScopedList(List autoscalers, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoscalers") && autoscalers != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Autoscaler item : autoscalers) { - stringList.add(item.toString()); - } - fieldMap.put("autoscalers", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoscalers")) { - return String.valueOf(autoscalers); + return autoscalers; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAutoscalersList() { return autoscalers; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java index e229455b299f..9a8c18371125 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,55 +58,24 @@ private AutoscalingPolicy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("coolDownPeriodSec") && coolDownPeriodSec != null) { - fieldMap.put( - "coolDownPeriodSec", Collections.singletonList(String.valueOf(coolDownPeriodSec))); - } - if (fieldNames.contains("cpuUtilization") && cpuUtilization != null) { - fieldMap.put("cpuUtilization", Collections.singletonList(String.valueOf(cpuUtilization))); - } - if (fieldNames.contains("customMetricUtilizations") && customMetricUtilizations != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AutoscalingPolicyCustomMetricUtilization item : customMetricUtilizations) { - stringList.add(item.toString()); - } - fieldMap.put("customMetricUtilizations", stringList.build()); - } - if (fieldNames.contains("loadBalancingUtilization") && loadBalancingUtilization != null) { - fieldMap.put( - "loadBalancingUtilization", - Collections.singletonList(String.valueOf(loadBalancingUtilization))); - } - if (fieldNames.contains("maxNumReplicas") && maxNumReplicas != null) { - fieldMap.put("maxNumReplicas", Collections.singletonList(String.valueOf(maxNumReplicas))); - } - if (fieldNames.contains("minNumReplicas") && minNumReplicas != null) { - fieldMap.put("minNumReplicas", Collections.singletonList(String.valueOf(minNumReplicas))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("coolDownPeriodSec")) { - return String.valueOf(coolDownPeriodSec); + return coolDownPeriodSec; } if (fieldName.equals("cpuUtilization")) { - return String.valueOf(cpuUtilization); + return cpuUtilization; } if (fieldName.equals("customMetricUtilizations")) { - return String.valueOf(customMetricUtilizations); + return customMetricUtilizations; } if (fieldName.equals("loadBalancingUtilization")) { - return String.valueOf(loadBalancingUtilization); + return loadBalancingUtilization; } if (fieldName.equals("maxNumReplicas")) { - return String.valueOf(maxNumReplicas); + return maxNumReplicas; } if (fieldName.equals("minNumReplicas")) { - return String.valueOf(minNumReplicas); + return minNumReplicas; } return null; } @@ -122,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getCoolDownPeriodSec() { return coolDownPeriodSec; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java index 4ff32c3a8ad6..5d195b49d90e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,26 +36,22 @@ private AutoscalingPolicyCpuUtilization(Double utilizationTarget) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put( - "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return utilizationTarget; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("utilizationTarget")) { - return String.valueOf(utilizationTarget); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java index c72326ca0f8c..2098a3495b66 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -47,33 +43,15 @@ private AutoscalingPolicyCustomMetricUtilization( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("metric") && metric != null) { - fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); - } - if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put( - "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); - } - if (fieldNames.contains("utilizationTargetType") && utilizationTargetType != null) { - fieldMap.put( - "utilizationTargetType", - Collections.singletonList(String.valueOf(utilizationTargetType))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("metric")) { - return String.valueOf(metric); + return metric; } if (fieldName.equals("utilizationTarget")) { - return String.valueOf(utilizationTarget); + return utilizationTarget; } if (fieldName.equals("utilizationTargetType")) { - return String.valueOf(utilizationTargetType); + return utilizationTargetType; } return null; } @@ -84,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getMetric() { return metric; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java index ecdd43a850a3..e7b3fa592d42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,26 +36,22 @@ private AutoscalingPolicyLoadBalancingUtilization(Double utilizationTarget) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put( - "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return utilizationTarget; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("utilizationTarget")) { - return String.valueOf(utilizationTarget); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java index 47c88237a96f..07e1da2dc268 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private Backend( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("balancingMode") && balancingMode != null) { - fieldMap.put("balancingMode", Collections.singletonList(String.valueOf(balancingMode))); - } - if (fieldNames.contains("capacityScaler") && capacityScaler != null) { - fieldMap.put("capacityScaler", Collections.singletonList(String.valueOf(capacityScaler))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("group") && group != null) { - fieldMap.put("group", Collections.singletonList(String.valueOf(group))); - } - if (fieldNames.contains("maxConnections") && maxConnections != null) { - fieldMap.put("maxConnections", Collections.singletonList(String.valueOf(maxConnections))); - } - if (fieldNames.contains("maxConnectionsPerInstance") && maxConnectionsPerInstance != null) { - fieldMap.put( - "maxConnectionsPerInstance", - Collections.singletonList(String.valueOf(maxConnectionsPerInstance))); - } - if (fieldNames.contains("maxRate") && maxRate != null) { - fieldMap.put("maxRate", Collections.singletonList(String.valueOf(maxRate))); - } - if (fieldNames.contains("maxRatePerInstance") && maxRatePerInstance != null) { - fieldMap.put( - "maxRatePerInstance", Collections.singletonList(String.valueOf(maxRatePerInstance))); - } - if (fieldNames.contains("maxUtilization") && maxUtilization != null) { - fieldMap.put("maxUtilization", Collections.singletonList(String.valueOf(maxUtilization))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("balancingMode")) { - return String.valueOf(balancingMode); + return balancingMode; } if (fieldName.equals("capacityScaler")) { - return String.valueOf(capacityScaler); + return capacityScaler; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("group")) { - return String.valueOf(group); + return group; } if (fieldName.equals("maxConnections")) { - return String.valueOf(maxConnections); + return maxConnections; } if (fieldName.equals("maxConnectionsPerInstance")) { - return String.valueOf(maxConnectionsPerInstance); + return maxConnectionsPerInstance; } if (fieldName.equals("maxRate")) { - return String.valueOf(maxRate); + return maxRate; } if (fieldName.equals("maxRatePerInstance")) { - return String.valueOf(maxRatePerInstance); + return maxRatePerInstance; } if (fieldName.equals("maxUtilization")) { - return String.valueOf(maxUtilization); + return maxUtilization; } return null; } @@ -146,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBalancingMode() { return balancingMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java index 96bf4e7e748e..31d2b09925c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private BackendBucket( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("bucketName") && bucketName != null) { - fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("enableCdn") && enableCdn != null) { - fieldMap.put("enableCdn", Collections.singletonList(String.valueOf(enableCdn))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("bucketName")) { - return String.valueOf(bucketName); + return bucketName; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("enableCdn")) { - return String.valueOf(enableCdn); + return enableCdn; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBucketName() { return bucketName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java index 603ca247d2ec..c291cf9ca2cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private BackendBucketList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (BackendBucket item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java index 20ad95f049f4..7b0d8a5b5971 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -123,150 +118,69 @@ private BackendService( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("affinityCookieTtlSec") && affinityCookieTtlSec != null) { - fieldMap.put( - "affinityCookieTtlSec", Collections.singletonList(String.valueOf(affinityCookieTtlSec))); - } - if (fieldNames.contains("backends") && backends != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Backend item : backends) { - stringList.add(item.toString()); - } - fieldMap.put("backends", stringList.build()); - } - if (fieldNames.contains("cdnPolicy") && cdnPolicy != null) { - fieldMap.put("cdnPolicy", Collections.singletonList(String.valueOf(cdnPolicy))); - } - if (fieldNames.contains("connectionDraining") && connectionDraining != null) { - fieldMap.put( - "connectionDraining", Collections.singletonList(String.valueOf(connectionDraining))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("enableCDN") && enableCDN != null) { - fieldMap.put("enableCDN", Collections.singletonList(String.valueOf(enableCDN))); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("healthChecks") && healthChecks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : healthChecks) { - stringList.add(item.toString()); - } - fieldMap.put("healthChecks", stringList.build()); - } - if (fieldNames.contains("iap") && iap != null) { - fieldMap.put("iap", Collections.singletonList(String.valueOf(iap))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { - fieldMap.put( - "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); - } - if (fieldNames.contains("protocol") && protocol != null) { - fieldMap.put("protocol", Collections.singletonList(String.valueOf(protocol))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) { - fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity))); - } - if (fieldNames.contains("timeoutSec") && timeoutSec != null) { - fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("affinityCookieTtlSec")) { - return String.valueOf(affinityCookieTtlSec); + return affinityCookieTtlSec; } if (fieldName.equals("backends")) { - return String.valueOf(backends); + return backends; } if (fieldName.equals("cdnPolicy")) { - return String.valueOf(cdnPolicy); + return cdnPolicy; } if (fieldName.equals("connectionDraining")) { - return String.valueOf(connectionDraining); + return connectionDraining; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("enableCDN")) { - return String.valueOf(enableCDN); + return enableCDN; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("healthChecks")) { - return String.valueOf(healthChecks); + return healthChecks; } if (fieldName.equals("iap")) { - return String.valueOf(iap); + return iap; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("loadBalancingScheme")) { - return String.valueOf(loadBalancingScheme); + return loadBalancingScheme; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } if (fieldName.equals("portName")) { - return String.valueOf(portName); + return portName; } if (fieldName.equals("protocol")) { - return String.valueOf(protocol); + return protocol; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sessionAffinity")) { - return String.valueOf(sessionAffinity); + return sessionAffinity; } if (fieldName.equals("timeoutSec")) { - return String.valueOf(timeoutSec); + return timeoutSec; } return null; } @@ -277,6 +191,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getAffinityCookieTtlSec() { return affinityCookieTtlSec; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java index 213fd39884fc..85b75e24ef98 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private BackendServiceAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java index e00f03c76397..b9892872ad1d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private BackendServiceCdnPolicy(CacheKeyPolicy cacheKeyPolicy) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("cacheKeyPolicy") && cacheKeyPolicy != null) { - fieldMap.put("cacheKeyPolicy", Collections.singletonList(String.valueOf(cacheKeyPolicy))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("cacheKeyPolicy")) { + return cacheKeyPolicy; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("cacheKeyPolicy")) { - return String.valueOf(cacheKeyPolicy); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java index 28ff6b520dff..ef90349b4949 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private BackendServiceGroupHealth(List healthStatus, String kind) } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("healthStatus") && healthStatus != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HealthStatus item : healthStatus) { - stringList.add(item.toString()); - } - fieldMap.put("healthStatus", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("healthStatus")) { - return String.valueOf(healthStatus); + return healthStatus; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getHealthStatusList() { return healthStatus; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java index 5dc77ed986f0..7bf7ea7e950b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,39 +49,18 @@ private BackendServiceIAP( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("enabled") && enabled != null) { - fieldMap.put("enabled", Collections.singletonList(String.valueOf(enabled))); - } - if (fieldNames.contains("oauth2ClientId") && oauth2ClientId != null) { - fieldMap.put("oauth2ClientId", Collections.singletonList(String.valueOf(oauth2ClientId))); - } - if (fieldNames.contains("oauth2ClientSecret") && oauth2ClientSecret != null) { - fieldMap.put( - "oauth2ClientSecret", Collections.singletonList(String.valueOf(oauth2ClientSecret))); - } - if (fieldNames.contains("oauth2ClientSecretSha256") && oauth2ClientSecretSha256 != null) { - fieldMap.put( - "oauth2ClientSecretSha256", - Collections.singletonList(String.valueOf(oauth2ClientSecretSha256))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("enabled")) { - return String.valueOf(enabled); + return enabled; } if (fieldName.equals("oauth2ClientId")) { - return String.valueOf(oauth2ClientId); + return oauth2ClientId; } if (fieldName.equals("oauth2ClientSecret")) { - return String.valueOf(oauth2ClientSecret); + return oauth2ClientSecret; } if (fieldName.equals("oauth2ClientSecretSha256")) { - return String.valueOf(oauth2ClientSecretSha256); + return oauth2ClientSecretSha256; } return null; } @@ -96,6 +71,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getEnabled() { return enabled; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java index 3f6c7a98681c..e89fdd5087ca 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private BackendServiceList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (BackendService item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java index 0d964ea5d92d..2314286e6873 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private BackendServicesScopedList(List backendServices, Warning } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("backendServices") && backendServices != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (BackendService item : backendServices) { - stringList.add(item.toString()); - } - fieldMap.put("backendServices", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("backendServices")) { - return String.valueOf(backendServices); + return backendServices; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getBackendServicesList() { return backendServices; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java index 0a8d49d8c913..34d363da9d00 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private CacheInvalidationRule(String host, String path) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("path") && path != null) { - fieldMap.put("path", Collections.singletonList(String.valueOf(path))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("host")) { - return String.valueOf(host); + return host; } if (fieldName.equals("path")) { - return String.valueOf(path); + return path; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getHost() { return host; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java index 521b6a093360..ebfa5f81c911 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -59,51 +54,21 @@ private CacheKeyPolicy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("includeHost") && includeHost != null) { - fieldMap.put("includeHost", Collections.singletonList(String.valueOf(includeHost))); - } - if (fieldNames.contains("includeProtocol") && includeProtocol != null) { - fieldMap.put("includeProtocol", Collections.singletonList(String.valueOf(includeProtocol))); - } - if (fieldNames.contains("includeQueryString") && includeQueryString != null) { - fieldMap.put( - "includeQueryString", Collections.singletonList(String.valueOf(includeQueryString))); - } - if (fieldNames.contains("queryStringBlacklist") && queryStringBlacklist != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : queryStringBlacklist) { - stringList.add(item.toString()); - } - fieldMap.put("queryStringBlacklist", stringList.build()); - } - if (fieldNames.contains("queryStringWhitelist") && queryStringWhitelist != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : queryStringWhitelist) { - stringList.add(item.toString()); - } - fieldMap.put("queryStringWhitelist", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("includeHost")) { - return String.valueOf(includeHost); + return includeHost; } if (fieldName.equals("includeProtocol")) { - return String.valueOf(includeProtocol); + return includeProtocol; } if (fieldName.equals("includeQueryString")) { - return String.valueOf(includeQueryString); + return includeQueryString; } if (fieldName.equals("queryStringBlacklist")) { - return String.valueOf(queryStringBlacklist); + return queryStringBlacklist; } if (fieldName.equals("queryStringWhitelist")) { - return String.valueOf(queryStringWhitelist); + return queryStringWhitelist; } return null; } @@ -114,6 +79,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getIncludeHost() { return includeHost; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java index 5bd07d7e5efd..dc34e8a93323 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,95 +86,45 @@ private Commitment( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("endTimestamp") && endTimestamp != null) { - fieldMap.put("endTimestamp", Collections.singletonList(String.valueOf(endTimestamp))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("plan") && plan != null) { - fieldMap.put("plan", Collections.singletonList(String.valueOf(plan))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("resources") && resources != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ResourceCommitment item : resources) { - stringList.add(item.toString()); - } - fieldMap.put("resources", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("startTimestamp") && startTimestamp != null) { - fieldMap.put("startTimestamp", Collections.singletonList(String.valueOf(startTimestamp))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("statusMessage") && statusMessage != null) { - fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("endTimestamp")) { - return String.valueOf(endTimestamp); + return endTimestamp; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("plan")) { - return String.valueOf(plan); + return plan; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("resources")) { - return String.valueOf(resources); + return resources; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("startTimestamp")) { - return String.valueOf(startTimestamp); + return startTimestamp; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("statusMessage")) { - return String.valueOf(statusMessage); + return statusMessage; } return null; } @@ -190,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java index 0a9cf4e5b86b..755176db0c56 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private CommitmentAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java index c67292729f6c..8d6a8931d91b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private CommitmentList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Commitment item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java index ae7cb02bbbfc..7abc8f23eb5a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private CommitmentsScopedList(List commitments, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("commitments") && commitments != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Commitment item : commitments) { - stringList.add(item.toString()); - } - fieldMap.put("commitments", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("commitments")) { - return String.valueOf(commitments); + return commitments; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getCommitmentsList() { return commitments; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java index 1f6c0b898838..cbcf3e4a0732 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,26 +36,22 @@ private ConnectionDraining(Integer drainingTimeoutSec) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("drainingTimeoutSec") && drainingTimeoutSec != null) { - fieldMap.put( - "drainingTimeoutSec", Collections.singletonList(String.valueOf(drainingTimeoutSec))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("drainingTimeoutSec")) { + return drainingTimeoutSec; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("drainingTimeoutSec")) { - return String.valueOf(drainingTimeoutSec); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java index 22e34f75bc37..61bb82da6835 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,78 +77,39 @@ private CreateSnapshotDiskHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("disk") && disk != null) { - fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("guestFlush") && guestFlush != null) { - fieldMap.put("guestFlush", Collections.singletonList(String.valueOf(guestFlush))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("snapshotResource") && snapshotResource != null) { - fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("disk")) { - return String.valueOf(disk); + return disk; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("guestFlush")) { - return String.valueOf(guestFlush); + return guestFlush; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("snapshotResource")) { - return String.valueOf(snapshotResource); + return snapshotResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -163,6 +120,12 @@ public Snapshot getApiMessageRequestBody() { return snapshotResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java index 9535453d1ed2..5c1acb5c85e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private CustomerEncryptionKey(String rawKey, String sha256) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("rawKey") && rawKey != null) { - fieldMap.put("rawKey", Collections.singletonList(String.valueOf(rawKey))); - } - if (fieldNames.contains("sha256") && sha256 != null) { - fieldMap.put("sha256", Collections.singletonList(String.valueOf(sha256))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("rawKey")) { - return String.valueOf(rawKey); + return rawKey; } if (fieldName.equals("sha256")) { - return String.valueOf(sha256); + return sha256; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getRawKey() { return rawKey; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java index a7e25e4ff78d..31796df11626 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -44,25 +40,12 @@ private CustomerEncryptionKeyProtectedDisk( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put( - "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); - } - if (fieldNames.contains("source") && source != null) { - fieldMap.put("source", Collections.singletonList(String.valueOf(source))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("diskEncryptionKey")) { - return String.valueOf(diskEncryptionKey); + return diskEncryptionKey; } if (fieldName.equals("source")) { - return String.valueOf(source); + return source; } return null; } @@ -73,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public CustomerEncryptionKey getDiskEncryptionKey() { return diskEncryptionKey; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java index 1984f5b20e4c..d74b9ed54b52 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private Data(String key, String value) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("value") && value != null) { - fieldMap.put("value", Collections.singletonList(String.valueOf(value))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("value")) { - return String.valueOf(value); + return value; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKey() { return key; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java index fb7423784f94..0d0497c6c3a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,78 +77,39 @@ private DeleteAccessConfigInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("accessConfig") && accessConfig != null) { - fieldMap.put("accessConfig", Collections.singletonList(String.valueOf(accessConfig))); - } - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("networkInterface") && networkInterface != null) { - fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("accessConfig")) { - return String.valueOf(accessConfig); + return accessConfig; } if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("networkInterface")) { - return String.valueOf(networkInterface); + return networkInterface; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -163,6 +120,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessConfig() { return accessConfig; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java index 3aed29febb4b..693eafccbf44 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteAddressHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java index 501172a2ea9d..0d0e58fd556a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java index 41386c1527a9..bdefaf6a5a18 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteBackendBucketHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendBucket") && backendBucket != null) { - fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendBucket")) { - return String.valueOf(backendBucket); + return backendBucket; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java index fc9ec286591d..36c2f268f09b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java index 4f400cea4939..6f71d205d1ed 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteDiskHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("disk") && disk != null) { - fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("disk")) { - return String.valueOf(disk); + return disk; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java index 0a95cdb91268..170556e99284 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteFirewallHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("firewall") && firewall != null) { - fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("firewall")) { - return String.valueOf(firewall); + return firewall; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java index ba1826a2c7a3..42e54201f856 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRule") && forwardingRule != null) { - fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRule")) { - return String.valueOf(forwardingRule); + return forwardingRule; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java index a19eb85ef20c..b1106d5bb80e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteGlobalAddressHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java index ccc7cd90e76b..9035cee23212 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteGlobalForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRule") && forwardingRule != null) { - fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRule")) { - return String.valueOf(forwardingRule); + return forwardingRule; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java index dffbfeba8a65..6e092ff9013d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private DeleteGlobalOperationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("operation") && operation != null) { - fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("operation")) { - return String.valueOf(operation); + return operation; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java index d597ed87bc26..8d3a336d5895 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("healthCheck") && healthCheck != null) { - fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("healthCheck")) { - return String.valueOf(healthCheck); + return healthCheck; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java index d98cdc2eaff1..d349a48aa402 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteHttpHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { - fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpHealthCheck")) { - return String.valueOf(httpHealthCheck); + return httpHealthCheck; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java index ea083fec6dd1..8152f210254e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteHttpsHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { - fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpsHealthCheck")) { - return String.valueOf(httpsHealthCheck); + return httpsHealthCheck; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java index f192fa56ff6d..c7553ecc3d21 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteImageHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("image") && image != null) { - fieldMap.put("image", Collections.singletonList(String.valueOf(image))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("image")) { - return String.valueOf(image); + return image; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java index f1049a23f64d..7493d25b35fb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java index 3716bb27c6fe..45f5f6490909 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,67 +69,33 @@ private DeleteInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -144,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java index 673d763e1b3b..6f9a6197141f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java index 91e9b81e9b8d..e1220a364c62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteInstanceTemplateHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { - fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceTemplate")) { - return String.valueOf(instanceTemplate); + return instanceTemplate; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java index d02f3aa75879..3f87e1272557 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private DeleteInstancesInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("instanceGroupManagersDeleteInstancesRequestResource") - && instanceGroupManagersDeleteInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupManagersDeleteInstancesRequestResource", - Collections.singletonList( - String.valueOf(instanceGroupManagersDeleteInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("instanceGroupManagersDeleteInstancesRequestResource")) { - return String.valueOf(instanceGroupManagersDeleteInstancesRequestResource); + return instanceGroupManagersDeleteInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public InstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBody() { return instanceGroupManagersDeleteInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java index 8b1b4978b59f..45a0bd96edd6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource") - && regionInstanceGroupManagersDeleteInstancesRequestResource != null) { - fieldMap.put( - "regionInstanceGroupManagersDeleteInstancesRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupManagersDeleteInstancesRequestResource")) { - return String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource); + return regionInstanceGroupManagersDeleteInstancesRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public RegionInstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBod return regionInstanceGroupManagersDeleteInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java index a954333c2313..21d38965684f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,68 +69,33 @@ private DeleteInterconnectAttachmentHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) { - fieldMap.put( - "interconnectAttachment", - Collections.singletonList(String.valueOf(interconnectAttachment))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnectAttachment")) { - return String.valueOf(interconnectAttachment); + return interconnectAttachment; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -145,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java index 6b47502e9489..f500dceac067 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteInterconnectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnect") && interconnect != null) { - fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnect")) { - return String.valueOf(interconnect); + return interconnect; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java index 6746f152dc4d..1b72506cf12b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteLicenseHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("license") && license != null) { - fieldMap.put("license", Collections.singletonList(String.valueOf(license))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("license")) { - return String.valueOf(license); + return license; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java index c0091faaf314..7541e806787a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java index e2f86b272efa..08cc13a54a85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteRegionAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java index 8ba0bf3ce1fc..008d140f7a38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteRegionBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java index 9d007d07395c..e11f8b34363a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,67 +69,33 @@ private DeleteRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -144,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java index 0aa04d0347fa..6055704b364e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private DeleteRegionOperationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("operation") && operation != null) { - fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("operation")) { - return String.valueOf(operation); + return operation; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java index 169f670aaefb..386c7b765e77 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteRouteHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("route") && route != null) { - fieldMap.put("route", Collections.singletonList(String.valueOf(route))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("route")) { - return String.valueOf(route); + return route; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java index 2b2c5dffd844..5bd48ef27f22 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java index bc41b7100059..bd2cc210d568 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteSnapshotHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("snapshot") && snapshot != null) { - fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("snapshot")) { - return String.valueOf(snapshot); + return snapshot; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java index 45c38ccbdb4b..d73bc6c2785a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteSslCertificateHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslCertificate") && sslCertificate != null) { - fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslCertificate")) { - return String.valueOf(sslCertificate); + return sslCertificate; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java index dabf1a10aadc..270a2dd6834e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteSslPolicyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslPolicy") && sslPolicy != null) { - fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslPolicy")) { - return String.valueOf(sslPolicy); + return sslPolicy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java index 92553629d430..4270d7f84e8c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteSubnetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java index 1ec62978cef3..6b2928c2b241 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetHttpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { - fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpProxy")) { - return String.valueOf(targetHttpProxy); + return targetHttpProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java index 1adb6c8e9987..27f496359c10 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetHttpsProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { - fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpsProxy")) { - return String.valueOf(targetHttpsProxy); + return targetHttpsProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java index 4ae64c4505e0..7c0999908eec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetInstance") && targetInstance != null) { - fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetInstance")) { - return String.valueOf(targetInstance); + return targetInstance; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java index c520c4629eee..aca94b513e81 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java index 58c4c718a276..645f7b594a81 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { - fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetSslProxy")) { - return String.valueOf(targetSslProxy); + return targetSslProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java index 20e042141905..76e48333d234 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetTcpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { - fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetTcpProxy")) { - return String.valueOf(targetTcpProxy); + return targetTcpProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java index f9dc3744a64d..bba660371155 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteTargetVpnGatewayHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { - fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetVpnGateway")) { - return String.valueOf(targetVpnGateway); + return targetVpnGateway; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java index ce830ad22a39..e4be6526e378 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java index 04c41adf8d23..f886123d795a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DeleteVpnTunnelHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) { - fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("vpnTunnel")) { - return String.valueOf(vpnTunnel); + return vpnTunnel; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java index ddb4f4ffd11b..40ddc56cdec5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private DeleteZoneOperationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("operation") && operation != null) { - fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("operation")) { - return String.valueOf(operation); + return operation; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java index 8d93d2ea8590..e841066a4447 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private Denied(String iPProtocol, List ports) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("iPProtocol") && iPProtocol != null) { - fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); - } - if (fieldNames.contains("ports") && ports != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : ports) { - stringList.add(item.toString()); - } - fieldMap.put("ports", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("iPProtocol")) { - return String.valueOf(iPProtocol); + return iPProtocol; } if (fieldName.equals("ports")) { - return String.valueOf(ports); + return ports; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIPProtocol() { return iPProtocol; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java index 663b4d0f8606..fd9fbc338322 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private DeprecateImageHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("deprecationStatusResource") && deprecationStatusResource != null) { - fieldMap.put( - "deprecationStatusResource", - Collections.singletonList(String.valueOf(deprecationStatusResource))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("image") && image != null) { - fieldMap.put("image", Collections.singletonList(String.valueOf(image))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("deprecationStatusResource")) { - return String.valueOf(deprecationStatusResource); + return deprecationStatusResource; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("image")) { - return String.valueOf(image); + return image; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public DeprecationStatus getApiMessageRequestBody() { return deprecationStatusResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java index 6a5068384d9b..c0022caa6ff8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,42 +49,21 @@ private DeprecationStatus( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("deleted") && deleted != null) { - fieldMap.put("deleted", Collections.singletonList(String.valueOf(deleted))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("obsolete") && obsolete != null) { - fieldMap.put("obsolete", Collections.singletonList(String.valueOf(obsolete))); - } - if (fieldNames.contains("replacement") && replacement != null) { - fieldMap.put("replacement", Collections.singletonList(String.valueOf(replacement))); - } - if (fieldNames.contains("state") && state != null) { - fieldMap.put("state", Collections.singletonList(String.valueOf(state))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("deleted")) { - return String.valueOf(deleted); + return deleted; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("obsolete")) { - return String.valueOf(obsolete); + return obsolete; } if (fieldName.equals("replacement")) { - return String.valueOf(replacement); + return replacement; } if (fieldName.equals("state")) { - return String.valueOf(state); + return state; } return null; } @@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDeleted() { return deleted; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java index abaf1ce24c20..e93c3ac9809f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private DetachDiskInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("deviceName") && deviceName != null) { - fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("deviceName")) { - return String.valueOf(deviceName); + return deviceName; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java index 60345cd24532..e99584fb3776 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private DisableXpnHostProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java index 3add0970478b..8338ca7c7a40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private DisableXpnResourceProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("projectsDisableXpnResourceRequestResource") - && projectsDisableXpnResourceRequestResource != null) { - fieldMap.put( - "projectsDisableXpnResourceRequestResource", - Collections.singletonList(String.valueOf(projectsDisableXpnResourceRequestResource))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("projectsDisableXpnResourceRequestResource")) { - return String.valueOf(projectsDisableXpnResourceRequestResource); + return projectsDisableXpnResourceRequestResource; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public ProjectsDisableXpnResourceRequest getApiMessageRequestBody() { return projectsDisableXpnResourceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java index 4a32a093e2ec..bf75a574cd56 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java @@ -17,14 +17,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -143,192 +139,84 @@ private Disk( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put( - "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); - } - if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (GuestOsFeature item : guestOsFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("guestOsFeatures", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) { - fieldMap.put( - "lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); - } - if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) { - fieldMap.put( - "lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); - } - if (fieldNames.contains("licenseCodes") && licenseCodes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenseCodes) { - stringList.add(item.toString()); - } - fieldMap.put("licenseCodes", stringList.build()); - } - if (fieldNames.contains("licenses") && licenses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenses) { - stringList.add(item.toString()); - } - fieldMap.put("licenses", stringList.build()); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("options") && options != null) { - fieldMap.put("options", Collections.singletonList(String.valueOf(options))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sizeGb") && sizeGb != null) { - fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); - } - if (fieldNames.contains("sourceImage") && sourceImage != null) { - fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); - } - if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put( - "sourceImageEncryptionKey", - Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); - } - if (fieldNames.contains("sourceImageId") && sourceImageId != null) { - fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); - } - if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) { - fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); - } - if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { - fieldMap.put( - "sourceSnapshotEncryptionKey", - Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); - } - if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { - fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - if (fieldNames.contains("users") && users != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : users) { - stringList.add(item.toString()); - } - fieldMap.put("users", stringList.build()); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("diskEncryptionKey")) { - return String.valueOf(diskEncryptionKey); + return diskEncryptionKey; } if (fieldName.equals("guestOsFeatures")) { - return String.valueOf(guestOsFeatures); + return guestOsFeatures; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("lastAttachTimestamp")) { - return String.valueOf(lastAttachTimestamp); + return lastAttachTimestamp; } if (fieldName.equals("lastDetachTimestamp")) { - return String.valueOf(lastDetachTimestamp); + return lastDetachTimestamp; } if (fieldName.equals("licenseCodes")) { - return String.valueOf(licenseCodes); + return licenseCodes; } if (fieldName.equals("licenses")) { - return String.valueOf(licenses); + return licenses; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("options")) { - return String.valueOf(options); + return options; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sizeGb")) { - return String.valueOf(sizeGb); + return sizeGb; } if (fieldName.equals("sourceImage")) { - return String.valueOf(sourceImage); + return sourceImage; } if (fieldName.equals("sourceImageEncryptionKey")) { - return String.valueOf(sourceImageEncryptionKey); + return sourceImageEncryptionKey; } if (fieldName.equals("sourceImageId")) { - return String.valueOf(sourceImageId); + return sourceImageId; } if (fieldName.equals("sourceSnapshot")) { - return String.valueOf(sourceSnapshot); + return sourceSnapshot; } if (fieldName.equals("sourceSnapshotEncryptionKey")) { - return String.valueOf(sourceSnapshotEncryptionKey); + return sourceSnapshotEncryptionKey; } if (fieldName.equals("sourceSnapshotId")) { - return String.valueOf(sourceSnapshotId); + return sourceSnapshotId; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } if (fieldName.equals("users")) { - return String.valueOf(users); + return users; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -339,6 +227,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java index e9267403e344..e3254b1b0e23 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private DiskAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java index 9aa240ff1239..41c6fe8ff920 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private DiskList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Disk item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java index 28420b92da74..a2883c8c4c96 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private DiskMoveRequest(String destinationZone, String targetDisk) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("destinationZone") && destinationZone != null) { - fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone))); - } - if (fieldNames.contains("targetDisk") && targetDisk != null) { - fieldMap.put("targetDisk", Collections.singletonList(String.valueOf(targetDisk))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("destinationZone")) { - return String.valueOf(destinationZone); + return destinationZone; } if (fieldName.equals("targetDisk")) { - return String.valueOf(targetDisk); + return targetDisk; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDestinationZone() { return destinationZone; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java index a3283274dd37..f5ca8f0720da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private DiskType( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("defaultDiskSizeGb") && defaultDiskSizeGb != null) { - fieldMap.put( - "defaultDiskSizeGb", Collections.singletonList(String.valueOf(defaultDiskSizeGb))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("validDiskSize") && validDiskSize != null) { - fieldMap.put("validDiskSize", Collections.singletonList(String.valueOf(validDiskSize))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("defaultDiskSizeGb")) { - return String.valueOf(defaultDiskSizeGb); + return defaultDiskSizeGb; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("validDiskSize")) { - return String.valueOf(validDiskSize); + return validDiskSize; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -155,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java index b41efcfa2bfb..74b9171c6866 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private DiskTypeAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java index ebd739b3d4ff..c22ef5722ef9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private DiskTypeList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (DiskType item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java index 03ace04edf50..130e23217f19 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private DiskTypesScopedList(List diskTypes, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("diskTypes") && diskTypes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (DiskType item : diskTypes) { - stringList.add(item.toString()); - } - fieldMap.put("diskTypes", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("diskTypes")) { - return String.valueOf(diskTypes); + return diskTypes; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getDiskTypesList() { return diskTypes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java index 6f833e5e86d3..24b6df9cdd91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private DisksResizeRequest(String sizeGb) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("sizeGb") && sizeGb != null) { - fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("sizeGb")) { + return sizeGb; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("sizeGb")) { - return String.valueOf(sizeGb); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java index 25d5992e60fd..8efc36590961 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private DisksScopedList(List disks, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("disks") && disks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Disk item : disks) { - stringList.add(item.toString()); - } - fieldMap.put("disks", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("disks")) { - return String.valueOf(disks); + return disks; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getDisksList() { return disks; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java index 80bee960b45c..439065cdbae3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private EnableXpnHostProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java index b8318817bae1..47b515ca4b1f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private EnableXpnResourceProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("projectsEnableXpnResourceRequestResource") - && projectsEnableXpnResourceRequestResource != null) { - fieldMap.put( - "projectsEnableXpnResourceRequestResource", - Collections.singletonList(String.valueOf(projectsEnableXpnResourceRequestResource))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("projectsEnableXpnResourceRequestResource")) { - return String.valueOf(projectsEnableXpnResourceRequestResource); + return projectsEnableXpnResourceRequestResource; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public ProjectsEnableXpnResourceRequest getApiMessageRequestBody() { return projectsEnableXpnResourceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java index b75652abd576..d725f174c601 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private Error(List errors) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("errors") && errors != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Errors item : errors) { - stringList.add(item.toString()); - } - fieldMap.put("errors", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("errors")) { + return errors; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("errors")) { - return String.valueOf(errors); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index 4a8dc4f78995..2c492e0b4846 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,30 +42,15 @@ private Errors(String code, String location, String message) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("code") && code != null) { - fieldMap.put("code", Collections.singletonList(String.valueOf(code))); - } - if (fieldNames.contains("location") && location != null) { - fieldMap.put("location", Collections.singletonList(String.valueOf(location))); - } - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("code")) { - return String.valueOf(code); + return code; } if (fieldName.equals("location")) { - return String.valueOf(location); + return location; } if (fieldName.equals("message")) { - return String.valueOf(message); + return message; } return null; } @@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCode() { return code; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java index 5ce3c75029fe..e0d913f58a59 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private ExpandIpCidrRangeSubnetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("subnetworksExpandIpCidrRangeRequestResource") - && subnetworksExpandIpCidrRangeRequestResource != null) { - fieldMap.put( - "subnetworksExpandIpCidrRangeRequestResource", - Collections.singletonList(String.valueOf(subnetworksExpandIpCidrRangeRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("subnetworksExpandIpCidrRangeRequestResource")) { - return String.valueOf(subnetworksExpandIpCidrRangeRequestResource); + return subnetworksExpandIpCidrRangeRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public SubnetworksExpandIpCidrRangeRequest getApiMessageRequestBody() { return subnetworksExpandIpCidrRangeRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java index 016bb754a7a9..752346813ce1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -107,147 +102,57 @@ private Firewall( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("allowed") && allowed != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Allowed item : allowed) { - stringList.add(item.toString()); - } - fieldMap.put("allowed", stringList.build()); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("denied") && denied != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Denied item : denied) { - stringList.add(item.toString()); - } - fieldMap.put("denied", stringList.build()); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("destinationRanges") && destinationRanges != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : destinationRanges) { - stringList.add(item.toString()); - } - fieldMap.put("destinationRanges", stringList.build()); - } - if (fieldNames.contains("direction") && direction != null) { - fieldMap.put("direction", Collections.singletonList(String.valueOf(direction))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("priority") && priority != null) { - fieldMap.put("priority", Collections.singletonList(String.valueOf(priority))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sourceRanges") && sourceRanges != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sourceRanges) { - stringList.add(item.toString()); - } - fieldMap.put("sourceRanges", stringList.build()); - } - if (fieldNames.contains("sourceServiceAccounts") && sourceServiceAccounts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sourceServiceAccounts) { - stringList.add(item.toString()); - } - fieldMap.put("sourceServiceAccounts", stringList.build()); - } - if (fieldNames.contains("sourceTags") && sourceTags != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sourceTags) { - stringList.add(item.toString()); - } - fieldMap.put("sourceTags", stringList.build()); - } - if (fieldNames.contains("targetServiceAccounts") && targetServiceAccounts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : targetServiceAccounts) { - stringList.add(item.toString()); - } - fieldMap.put("targetServiceAccounts", stringList.build()); - } - if (fieldNames.contains("targetTags") && targetTags != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : targetTags) { - stringList.add(item.toString()); - } - fieldMap.put("targetTags", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("allowed")) { - return String.valueOf(allowed); + return allowed; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("denied")) { - return String.valueOf(denied); + return denied; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("destinationRanges")) { - return String.valueOf(destinationRanges); + return destinationRanges; } if (fieldName.equals("direction")) { - return String.valueOf(direction); + return direction; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("priority")) { - return String.valueOf(priority); + return priority; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sourceRanges")) { - return String.valueOf(sourceRanges); + return sourceRanges; } if (fieldName.equals("sourceServiceAccounts")) { - return String.valueOf(sourceServiceAccounts); + return sourceServiceAccounts; } if (fieldName.equals("sourceTags")) { - return String.valueOf(sourceTags); + return sourceTags; } if (fieldName.equals("targetServiceAccounts")) { - return String.valueOf(targetServiceAccounts); + return targetServiceAccounts; } if (fieldName.equals("targetTags")) { - return String.valueOf(targetTags); + return targetTags; } return null; } @@ -258,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAllowedList() { return allowed; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java index e89c70bc0bad..f21ec79e0701 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private FirewallList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Firewall item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java index 1acc4698d122..e098464b0dde 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -107,120 +102,57 @@ private ForwardingRule( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("iPAddress") && iPAddress != null) { - fieldMap.put("iPAddress", Collections.singletonList(String.valueOf(iPAddress))); - } - if (fieldNames.contains("iPProtocol") && iPProtocol != null) { - fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("ipVersion") && ipVersion != null) { - fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { - fieldMap.put( - "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("portRange") && portRange != null) { - fieldMap.put("portRange", Collections.singletonList(String.valueOf(portRange))); - } - if (fieldNames.contains("ports") && ports != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : ports) { - stringList.add(item.toString()); - } - fieldMap.put("ports", stringList.build()); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("target") && target != null) { - fieldMap.put("target", Collections.singletonList(String.valueOf(target))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("iPAddress")) { - return String.valueOf(iPAddress); + return iPAddress; } if (fieldName.equals("iPProtocol")) { - return String.valueOf(iPProtocol); + return iPProtocol; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("ipVersion")) { - return String.valueOf(ipVersion); + return ipVersion; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("loadBalancingScheme")) { - return String.valueOf(loadBalancingScheme); + return loadBalancingScheme; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("portRange")) { - return String.valueOf(portRange); + return portRange; } if (fieldName.equals("ports")) { - return String.valueOf(ports); + return ports; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("target")) { - return String.valueOf(target); + return target; } return null; } @@ -231,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBackendService() { return backendService; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java index 55a82726164a..1f25d325df24 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private ForwardingRuleAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java index f33b52c9b425..a7d25a79118b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private ForwardingRuleList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ForwardingRule item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java index 4202d67f4da6..66aa34626498 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private ForwardingRulesScopedList(List forwardingRules, Warning } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("forwardingRules") && forwardingRules != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ForwardingRule item : forwardingRules) { - stringList.add(item.toString()); - } - fieldMap.put("forwardingRules", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("forwardingRules")) { - return String.valueOf(forwardingRules); + return forwardingRules; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getForwardingRulesList() { return forwardingRules; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java index 7ab02b6274bf..861c64ea1405 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetAcceleratorTypeHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("acceleratorType") && acceleratorType != null) { - fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType))); - } - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("acceleratorType")) { - return String.valueOf(acceleratorType); + return acceleratorType; } if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAcceleratorType() { return acceleratorType; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java index ca2a1a1e5e4e..73e1b8de267c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetAddressHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java index c2f3d68b5372..6dce224ca63f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java index 34d156febed3..cf2e28002930 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetBackendBucketHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendBucket") && backendBucket != null) { - fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendBucket")) { - return String.valueOf(backendBucket); + return backendBucket; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java index 9341bbee372b..8d8ca9cbe9b4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java index 6ad9763c7b67..3ed0f637b373 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetDiskHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("disk") && disk != null) { - fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("disk")) { - return String.valueOf(disk); + return disk; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java index ae90dd62b439..dc59d19540bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetDiskTypeHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("diskType") && diskType != null) { - fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("diskType")) { - return String.valueOf(diskType); + return diskType; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java index 7c2ef0032da2..f7941097b523 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetFirewallHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("firewall") && firewall != null) { - fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("firewall")) { - return String.valueOf(firewall); + return firewall; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java index 56699ab4db3a..72a30fbc8dda 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRule") && forwardingRule != null) { - fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRule")) { - return String.valueOf(forwardingRule); + return forwardingRule; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java index 77c615dbaa89..cd3168370454 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetFromFamilyImageHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("family") && family != null) { - fieldMap.put("family", Collections.singletonList(String.valueOf(family))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("family")) { - return String.valueOf(family); + return family; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java index aca1109f15d3..9939700d0fdf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetGlobalAddressHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java index 3859ea6d568b..499754896dc9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetGlobalForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRule") && forwardingRule != null) { - fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRule")) { - return String.valueOf(forwardingRule); + return forwardingRule; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java index 671ec05feb62..d324b7e0b662 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetGlobalOperationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("operation") && operation != null) { - fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("operation")) { - return String.valueOf(operation); + return operation; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java index fbebc8ba2fbb..de74c613666a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private GetHealthBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("resourceGroupReferenceResource") - && resourceGroupReferenceResource != null) { - fieldMap.put( - "resourceGroupReferenceResource", - Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("resourceGroupReferenceResource")) { - return String.valueOf(resourceGroupReferenceResource); + return resourceGroupReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public ResourceGroupReference getApiMessageRequestBody() { return resourceGroupReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java index cc1198822080..f03de6e68a7a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("healthCheck") && healthCheck != null) { - fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("healthCheck")) { - return String.valueOf(healthCheck); + return healthCheck; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java index 7a65116d9166..d2411b7e6995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private GetHealthRegionBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("resourceGroupReferenceResource") - && resourceGroupReferenceResource != null) { - fieldMap.put( - "resourceGroupReferenceResource", - Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("resourceGroupReferenceResource")) { - return String.valueOf(resourceGroupReferenceResource); + return resourceGroupReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public ResourceGroupReference getApiMessageRequestBody() { return resourceGroupReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java index 37fc9330ce5e..80adbde9767e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,68 +69,33 @@ private GetHealthTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceReferenceResource") && instanceReferenceResource != null) { - fieldMap.put( - "instanceReferenceResource", - Collections.singletonList(String.valueOf(instanceReferenceResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceReferenceResource")) { - return String.valueOf(instanceReferenceResource); + return instanceReferenceResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -145,6 +106,12 @@ public InstanceReference getApiMessageRequestBody() { return instanceReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java index 56e4c1dfdf72..f15e79e68f9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetHttpHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { - fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpHealthCheck")) { - return String.valueOf(httpHealthCheck); + return httpHealthCheck; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java index 2c552dcad757..0df43e72848f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetHttpsHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { - fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpsHealthCheck")) { - return String.valueOf(httpsHealthCheck); + return httpsHealthCheck; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java index 3d3bde96e1be..159c4c597af0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetImageHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("image") && image != null) { - fieldMap.put("image", Collections.singletonList(String.valueOf(image))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("image")) { - return String.valueOf(image); + return image; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java index 4c13c2749ca6..a3ea3a0b3819 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java index 5b8e5d2a6c08..1ec4366a7463 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private GetInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java index be3a9305efae..40609939618e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java index f6fac3c4c386..6a605d45dd6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetInstanceTemplateHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { - fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceTemplate")) { - return String.valueOf(instanceTemplate); + return instanceTemplate; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java index 18b251663554..6b32b78e607c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,62 +65,30 @@ private GetInterconnectAttachmentHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) { - fieldMap.put( - "interconnectAttachment", - Collections.singletonList(String.valueOf(interconnectAttachment))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnectAttachment")) { - return String.valueOf(interconnectAttachment); + return interconnectAttachment; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -135,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java index 40467ffc4fa1..2c8ec025066d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetInterconnectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnect") && interconnect != null) { - fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnect")) { - return String.valueOf(interconnect); + return interconnect; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java index d60b56dc3d3b..5c4f2c3d6990 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private GetInterconnectLocationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnectLocation") && interconnectLocation != null) { - fieldMap.put( - "interconnectLocation", Collections.singletonList(String.valueOf(interconnectLocation))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnectLocation")) { - return String.valueOf(interconnectLocation); + return interconnectLocation; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java index 5cb7a6f14f2e..34e074261a60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetLicenseCodeHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("licenseCode") && licenseCode != null) { - fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("licenseCode")) { - return String.valueOf(licenseCode); + return licenseCode; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java index af7142f32723..cb6cddb8ab7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetLicenseHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("license") && license != null) { - fieldMap.put("license", Collections.singletonList(String.valueOf(license))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("license")) { - return String.valueOf(license); + return license; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java index 751b2506dead..5af4426b2ed9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetMachineTypeHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("machineType") && machineType != null) { - fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("machineType")) { - return String.valueOf(machineType); + return machineType; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java index 4aa9fe8fd792..6dbe5865035a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java index f7aff07b6c3b..ea0958bef2a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java index 2a9ea9bae395..a7a2a7ab473c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRegionAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java index 69e9f7e76887..32dc24e1172b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRegionBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java index 0a9f807f127f..4e5eb300c90d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRegionCommitmentHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("commitment") && commitment != null) { - fieldMap.put("commitment", Collections.singletonList(String.valueOf(commitment))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("commitment")) { - return String.valueOf(commitment); + return commitment; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java index 88050280800a..e6a53479cce3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRegionHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java index 7ff9e320f782..bd32752142b1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRegionInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java index 212d7e16382d..d53a58c42f46 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private GetRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java index e5bbdf3b129b..9354e73dc6c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRegionOperationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("operation") && operation != null) { - fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("operation")) { - return String.valueOf(operation); + return operation; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java index 52f9b6cb4342..91f70cc51d78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRouteHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("route") && route != null) { - fieldMap.put("route", Collections.singletonList(String.valueOf(route))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("route")) { - return String.valueOf(route); + return route; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java index 0ce4cd7991a0..2da040ec96e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java index 161f201fe023..b359cd4020be 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetRouterStatusRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java index 887cf3504e42..9ee831ed202b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private GetSerialPortOutputInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("start") && start != null) { - fieldMap.put("start", Collections.singletonList(String.valueOf(start))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("start")) { - return String.valueOf(start); + return start; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java index 712e57a23357..5b0822171072 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetSnapshotHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("snapshot") && snapshot != null) { - fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("snapshot")) { - return String.valueOf(snapshot); + return snapshot; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java index 6a891e246f99..f5e8b0c99aa7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetSslCertificateHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("sslCertificate") && sslCertificate != null) { - fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("sslCertificate")) { - return String.valueOf(sslCertificate); + return sslCertificate; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java index d08405a2fbce..6e7dd8c3f033 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetSslPolicyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("sslPolicy") && sslPolicy != null) { - fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("sslPolicy")) { - return String.valueOf(sslPolicy); + return sslPolicy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java index 6ef53c597515..32037a6780d0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetSubnetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java index 1bbe06ba5a44..e62b679f239b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetHttpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { - fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetHttpProxy")) { - return String.valueOf(targetHttpProxy); + return targetHttpProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java index 44582e4c58e9..501ec52d64b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetHttpsProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { - fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetHttpsProxy")) { - return String.valueOf(targetHttpsProxy); + return targetHttpsProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java index 89e81f5d6846..9ef98bb1b6d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetInstance") && targetInstance != null) { - fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetInstance")) { - return String.valueOf(targetInstance); + return targetInstance; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java index 7f75ff18a016..1b37944d89f9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java index 5f5b29916400..547104a99a25 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { - fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetSslProxy")) { - return String.valueOf(targetSslProxy); + return targetSslProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java index 3f83752b1fd6..add3781e55d5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetTcpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { - fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetTcpProxy")) { - return String.valueOf(targetTcpProxy); + return targetTcpProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java index a198980dc3cd..b37f4baf5e50 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetTargetVpnGatewayHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { - fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("targetVpnGateway")) { - return String.valueOf(targetVpnGateway); + return targetVpnGateway; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java index a81d5bea67ca..af52761d6aa8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java index cd1792e0e4b5..ed991eda312e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetVpnTunnelHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) { - fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("vpnTunnel")) { - return String.valueOf(vpnTunnel); + return vpnTunnel; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java index c36a0d8a2d34..f163158b66f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetXpnHostProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java index 049f445bd406..b053e307ed0c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private GetXpnResourcesProjectsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java index 602b07ab97e2..3232d136a0d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetZoneHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java index d2f32e90abf6..bd5fd02a5146 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,60 +65,30 @@ private GetZoneOperationHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("operation") && operation != null) { - fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("operation")) { - return String.valueOf(operation); + return operation; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java index dc6bf9e24a7c..3c1184f61e5f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +40,12 @@ private GlobalSetLabelsRequest(String labelFingerprint, Map labe } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } return null; } @@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getLabelFingerprint() { return labelFingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java index 081a717689cd..22ec52f78ce5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private GuestOsFeature(String type) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("type")) { + return type; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("type")) { - return String.valueOf(type); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java new file mode 100644 index 000000000000..a58c93c3ea87 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java @@ -0,0 +1,263 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HTTPHealthCheck implements ApiMessage { + private final String host; + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String requestPath; + + private HTTPHealthCheck() { + this.host = null; + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.requestPath = null; + } + + private HTTPHealthCheck( + String host, Integer port, String portName, String proxyHeader, String requestPath) { + this.host = host; + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.requestPath = requestPath; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("host")) { + return host; + } + if (fieldName.equals("port")) { + return port; + } + if (fieldName.equals("portName")) { + return portName; + } + if (fieldName.equals("proxyHeader")) { + return proxyHeader; + } + if (fieldName.equals("requestPath")) { + return requestPath; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getHost() { + return host; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequestPath() { + return requestPath; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HTTPHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static HTTPHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final HTTPHealthCheck DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new HTTPHealthCheck(); + } + + public static class Builder { + private String host; + private Integer port; + private String portName; + private String proxyHeader; + private String requestPath; + + Builder() {} + + public Builder mergeFrom(HTTPHealthCheck other) { + if (other == HTTPHealthCheck.getDefaultInstance()) return this; + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + return this; + } + + Builder(HTTPHealthCheck source) { + this.host = source.host; + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.requestPath = source.requestPath; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public HTTPHealthCheck build() { + + return new HTTPHealthCheck(host, port, portName, proxyHeader, requestPath); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHost(this.host); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequestPath(this.requestPath); + return newBuilder; + } + } + + @Override + public String toString() { + return "HTTPHealthCheck{" + + "host=" + + host + + ", " + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "requestPath=" + + requestPath + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HTTPHealthCheck) { + HTTPHealthCheck that = (HTTPHealthCheck) o; + return Objects.equals(this.host, that.getHost()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.requestPath, that.getRequestPath()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(host, port, portName, proxyHeader, requestPath); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java similarity index 72% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java index d50cb331244c..1d227cce318c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java @@ -17,25 +17,21 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @Generated("by GAPIC") @BetaApi -public final class HttpSHealthCheck implements ApiMessage { +public final class HTTPSHealthCheck implements ApiMessage { private final String host; private final Integer port; private final String portName; private final String proxyHeader; private final String requestPath; - private HttpSHealthCheck() { + private HTTPSHealthCheck() { this.host = null; this.port = null; this.portName = null; @@ -43,7 +39,7 @@ private HttpSHealthCheck() { this.requestPath = null; } - private HttpSHealthCheck( + private HTTPSHealthCheck( String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; this.port = port; @@ -53,42 +49,21 @@ private HttpSHealthCheck( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); - } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); - } - if (fieldNames.contains("requestPath") && requestPath != null) { - fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("host")) { - return String.valueOf(host); + return host; } if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } if (fieldName.equals("portName")) { - return String.valueOf(portName); + return portName; } if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); + return proxyHeader; } if (fieldName.equals("requestPath")) { - return String.valueOf(requestPath); + return requestPath; } return null; } @@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getHost() { return host; } @@ -123,7 +104,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(HttpSHealthCheck prototype) { + public static Builder newBuilder(HTTPSHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -131,14 +112,14 @@ public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static HttpSHealthCheck getDefaultInstance() { + public static HTTPSHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final HttpSHealthCheck DEFAULT_INSTANCE; + private static final HTTPSHealthCheck DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new HttpSHealthCheck(); + DEFAULT_INSTANCE = new HTTPSHealthCheck(); } public static class Builder { @@ -150,8 +131,8 @@ public static class Builder { Builder() {} - public Builder mergeFrom(HttpSHealthCheck other) { - if (other == HttpSHealthCheck.getDefaultInstance()) return this; + public Builder mergeFrom(HTTPSHealthCheck other) { + if (other == HTTPSHealthCheck.getDefaultInstance()) return this; if (other.getHost() != null) { this.host = other.host; } @@ -170,7 +151,7 @@ public Builder mergeFrom(HttpSHealthCheck other) { return this; } - Builder(HttpSHealthCheck source) { + Builder(HTTPSHealthCheck source) { this.host = source.host; this.port = source.port; this.portName = source.portName; @@ -223,9 +204,9 @@ public Builder setRequestPath(String requestPath) { return this; } - public HttpSHealthCheck build() { + public HTTPSHealthCheck build() { - return new HttpSHealthCheck(host, port, portName, proxyHeader, requestPath); + return new HTTPSHealthCheck(host, port, portName, proxyHeader, requestPath); } public Builder clone() { @@ -241,7 +222,7 @@ public Builder clone() { @Override public String toString() { - return "HttpSHealthCheck{" + return "HTTPSHealthCheck{" + "host=" + host + ", " @@ -264,8 +245,8 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HttpSHealthCheck) { - HttpSHealthCheck that = (HttpSHealthCheck) o; + if (o instanceof HTTPSHealthCheck) { + HTTPSHealthCheck that = (HTTPSHealthCheck) o; return Objects.equals(this.host, that.getHost()) && Objects.equals(this.port, that.getPort()) && Objects.equals(this.portName, that.getPortName()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java index 5ed8c553fd67..e148ed0d123c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -33,8 +29,8 @@ public final class HealthCheck implements ApiMessage { private final String creationTimestamp; private final String description; private final Integer healthyThreshold; - private final HttpHealthCheck httpHealthCheck; - private final HttpSHealthCheck httpsHealthCheck; + private final HTTPHealthCheck httpHealthCheck; + private final HTTPSHealthCheck httpsHealthCheck; private final String id; private final String kind; private final String name; @@ -68,8 +64,8 @@ private HealthCheck( String creationTimestamp, String description, Integer healthyThreshold, - HttpHealthCheck httpHealthCheck, - HttpSHealthCheck httpsHealthCheck, + HTTPHealthCheck httpHealthCheck, + HTTPSHealthCheck httpsHealthCheck, String id, String kind, String name, @@ -97,104 +93,51 @@ private HealthCheck( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { - fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { - fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); - } - if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { - fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); - } - if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { - fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sslHealthCheck") && sslHealthCheck != null) { - fieldMap.put("sslHealthCheck", Collections.singletonList(String.valueOf(sslHealthCheck))); - } - if (fieldNames.contains("tcpHealthCheck") && tcpHealthCheck != null) { - fieldMap.put("tcpHealthCheck", Collections.singletonList(String.valueOf(tcpHealthCheck))); - } - if (fieldNames.contains("timeoutSec") && timeoutSec != null) { - fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put( - "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("checkIntervalSec")) { - return String.valueOf(checkIntervalSec); + return checkIntervalSec; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("healthyThreshold")) { - return String.valueOf(healthyThreshold); + return healthyThreshold; } if (fieldName.equals("httpHealthCheck")) { - return String.valueOf(httpHealthCheck); + return httpHealthCheck; } if (fieldName.equals("httpsHealthCheck")) { - return String.valueOf(httpsHealthCheck); + return httpsHealthCheck; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sslHealthCheck")) { - return String.valueOf(sslHealthCheck); + return sslHealthCheck; } if (fieldName.equals("tcpHealthCheck")) { - return String.valueOf(tcpHealthCheck); + return tcpHealthCheck; } if (fieldName.equals("timeoutSec")) { - return String.valueOf(timeoutSec); + return timeoutSec; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } if (fieldName.equals("unhealthyThreshold")) { - return String.valueOf(unhealthyThreshold); + return unhealthyThreshold; } return null; } @@ -205,6 +148,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getCheckIntervalSec() { return checkIntervalSec; } @@ -221,11 +170,11 @@ public Integer getHealthyThreshold() { return healthyThreshold; } - public HttpHealthCheck getHttpHealthCheck() { + public HTTPHealthCheck getHttpHealthCheck() { return httpHealthCheck; } - public HttpSHealthCheck getHttpsHealthCheck() { + public HTTPSHealthCheck getHttpsHealthCheck() { return httpsHealthCheck; } @@ -292,8 +241,8 @@ public static class Builder { private String creationTimestamp; private String description; private Integer healthyThreshold; - private HttpHealthCheck httpHealthCheck; - private HttpSHealthCheck httpsHealthCheck; + private HTTPHealthCheck httpHealthCheck; + private HTTPSHealthCheck httpsHealthCheck; private String id; private String kind; private String name; @@ -410,20 +359,20 @@ public Builder setHealthyThreshold(Integer healthyThreshold) { return this; } - public HttpHealthCheck getHttpHealthCheck() { + public HTTPHealthCheck getHttpHealthCheck() { return httpHealthCheck; } - public Builder setHttpHealthCheck(HttpHealthCheck httpHealthCheck) { + public Builder setHttpHealthCheck(HTTPHealthCheck httpHealthCheck) { this.httpHealthCheck = httpHealthCheck; return this; } - public HttpSHealthCheck getHttpsHealthCheck() { + public HTTPSHealthCheck getHttpsHealthCheck() { return httpsHealthCheck; } - public Builder setHttpsHealthCheck(HttpSHealthCheck httpsHealthCheck) { + public Builder setHttpsHealthCheck(HTTPSHealthCheck httpsHealthCheck) { this.httpsHealthCheck = httpsHealthCheck; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java index c65a4b4bde8a..aaab7be4b2a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private HealthCheckList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HealthCheck item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java index fb7cd5b85d53..a32982dbe395 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private HealthCheckReference(String healthCheck) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("healthCheck") && healthCheck != null) { - fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("healthCheck")) { + return healthCheck; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("healthCheck")) { - return String.valueOf(healthCheck); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java index b31d9a53e69a..b70aabb2e31e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,36 +45,18 @@ private HealthStatus(String healthState, String instance, String ipAddress, Inte } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("healthState") && healthState != null) { - fieldMap.put("healthState", Collections.singletonList(String.valueOf(healthState))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("ipAddress") && ipAddress != null) { - fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("healthState")) { - return String.valueOf(healthState); + return healthState; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("ipAddress")) { - return String.valueOf(ipAddress); + return ipAddress; } if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } return null; } @@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getHealthState() { return healthState; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java index 7e814efe1324..42e8e9b62bb0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -48,34 +43,15 @@ private HostRule(String description, List hosts, String pathMatcher) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("hosts") && hosts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : hosts) { - stringList.add(item.toString()); - } - fieldMap.put("hosts", stringList.build()); - } - if (fieldNames.contains("pathMatcher") && pathMatcher != null) { - fieldMap.put("pathMatcher", Collections.singletonList(String.valueOf(pathMatcher))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("hosts")) { - return String.valueOf(hosts); + return hosts; } if (fieldName.equals("pathMatcher")) { - return String.valueOf(pathMatcher); + return pathMatcher; } return null; } @@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDescription() { return description; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java index cc37dbe6a9a9..e6a729b134d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java @@ -17,78 +17,113 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @Generated("by GAPIC") @BetaApi public final class HttpHealthCheck implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; private final String host; + private final String id; + private final String kind; + private final String name; private final Integer port; - private final String portName; - private final String proxyHeader; private final String requestPath; + private final String selfLink; + private final Integer timeoutSec; + private final Integer unhealthyThreshold; private HttpHealthCheck() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; this.host = null; + this.id = null; + this.kind = null; + this.name = null; this.port = null; - this.portName = null; - this.proxyHeader = null; this.requestPath = null; + this.selfLink = null; + this.timeoutSec = null; + this.unhealthyThreshold = null; } private HttpHealthCheck( - String host, Integer port, String portName, String proxyHeader, String requestPath) { + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + String host, + String id, + String kind, + String name, + Integer port, + String requestPath, + String selfLink, + Integer timeoutSec, + Integer unhealthyThreshold) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; this.host = host; + this.id = id; + this.kind = kind; + this.name = name; this.port = port; - this.portName = portName; - this.proxyHeader = proxyHeader; this.requestPath = requestPath; + this.selfLink = selfLink; + this.timeoutSec = timeoutSec; + this.unhealthyThreshold = unhealthyThreshold; } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return checkIntervalSec; } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + if (fieldName.equals("creationTimestamp")) { + return creationTimestamp; } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + if (fieldName.equals("description")) { + return description; } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + if (fieldName.equals("healthyThreshold")) { + return healthyThreshold; } - if (fieldNames.contains("requestPath") && requestPath != null) { - fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { if (fieldName.equals("host")) { - return String.valueOf(host); + return host; } - if (fieldName.equals("port")) { - return String.valueOf(port); + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("kind")) { + return kind; } - if (fieldName.equals("portName")) { - return String.valueOf(portName); + if (fieldName.equals("name")) { + return name; } - if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); + if (fieldName.equals("port")) { + return port; } if (fieldName.equals("requestPath")) { - return String.valueOf(requestPath); + return requestPath; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("timeoutSec")) { + return timeoutSec; + } + if (fieldName.equals("unhealthyThreshold")) { + return unhealthyThreshold; } return null; } @@ -99,26 +134,64 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + public String getHost() { return host; } - public Integer getPort() { - return port; + public String getId() { + return id; } - public String getPortName() { - return portName; + public String getKind() { + return kind; } - public String getProxyHeader() { - return proxyHeader; + public String getName() { + return name; + } + + public Integer getPort() { + return port; } public String getRequestPath() { return requestPath; } + public String getSelfLink() { + return selfLink; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } @@ -142,40 +215,116 @@ public static HttpHealthCheck getDefaultInstance() { } public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; private String host; + private String id; + private String kind; + private String name; private Integer port; - private String portName; - private String proxyHeader; private String requestPath; + private String selfLink; + private Integer timeoutSec; + private Integer unhealthyThreshold; Builder() {} public Builder mergeFrom(HttpHealthCheck other) { if (other == HttpHealthCheck.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } if (other.getHost() != null) { this.host = other.host; } - if (other.getPort() != null) { - this.port = other.port; + if (other.getId() != null) { + this.id = other.id; } - if (other.getPortName() != null) { - this.portName = other.portName; + if (other.getKind() != null) { + this.kind = other.kind; } - if (other.getProxyHeader() != null) { - this.proxyHeader = other.proxyHeader; + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; } if (other.getRequestPath() != null) { this.requestPath = other.requestPath; } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } return this; } Builder(HttpHealthCheck source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; this.host = source.host; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; this.port = source.port; - this.portName = source.portName; - this.proxyHeader = source.proxyHeader; this.requestPath = source.requestPath; + this.selfLink = source.selfLink; + this.timeoutSec = source.timeoutSec; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; } public String getHost() { @@ -187,30 +336,39 @@ public Builder setHost(String host) { return this; } - public Integer getPort() { - return port; + public String getId() { + return id; } - public Builder setPort(Integer port) { - this.port = port; + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; return this; } - public String getPortName() { - return portName; + public String getName() { + return name; } - public Builder setPortName(String portName) { - this.portName = portName; + public Builder setName(String name) { + this.name = name; return this; } - public String getProxyHeader() { - return proxyHeader; + public Integer getPort() { + return port; } - public Builder setProxyHeader(String proxyHeader) { - this.proxyHeader = proxyHeader; + public Builder setPort(Integer port) { + this.port = port; return this; } @@ -223,18 +381,66 @@ public Builder setRequestPath(String requestPath) { return this; } + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + public HttpHealthCheck build() { - return new HttpHealthCheck(host, port, portName, proxyHeader, requestPath); + return new HttpHealthCheck( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); } public Builder clone() { Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); newBuilder.setHost(this.host); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); newBuilder.setPort(this.port); - newBuilder.setPortName(this.portName); - newBuilder.setProxyHeader(this.proxyHeader); newBuilder.setRequestPath(this.requestPath); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); return newBuilder; } } @@ -242,20 +448,44 @@ public Builder clone() { @Override public String toString() { return "HttpHealthCheck{" + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + "host=" + host + ", " - + "port=" - + port + + "id=" + + id + ", " - + "portName=" - + portName + + "kind=" + + kind + ", " - + "proxyHeader=" - + proxyHeader + + "name=" + + name + + ", " + + "port=" + + port + ", " + "requestPath=" + requestPath + + ", " + + "selfLink=" + + selfLink + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + "}"; } @@ -266,17 +496,38 @@ public boolean equals(Object o) { } if (o instanceof HttpHealthCheck) { HttpHealthCheck that = (HttpHealthCheck) o; - return Objects.equals(this.host, that.getHost()) + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.portName, that.getPortName()) - && Objects.equals(this.proxyHeader, that.getProxyHeader()) - && Objects.equals(this.requestPath, that.getRequestPath()); + && Objects.equals(this.requestPath, that.getRequestPath()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); } return false; } @Override public int hashCode() { - return Objects.hash(host, port, portName, proxyHeader, requestPath); + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java index 17068313afb3..ce01ba82022e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -291,7 +291,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
+   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
    * }
    * 
* @@ -299,7 +299,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck2 getHttpHealthCheck( + public final HttpHealthCheck getHttpHealthCheck( ProjectGlobalHttpHealthCheckName httpHealthCheck) { GetHttpHealthCheckHttpRequest request = @@ -319,7 +319,7 @@ public final HttpHealthCheck2 getHttpHealthCheck( *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
+   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
    * }
    * 
* @@ -327,7 +327,7 @@ public final HttpHealthCheck2 getHttpHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) { + public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder().setHttpHealthCheck(httpHealthCheck).build(); @@ -347,7 +347,7 @@ public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) { * GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() * .setHttpHealthCheck(httpHealthCheck.toString()) * .build(); - * HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(request); + * HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(request); * } *
* @@ -355,7 +355,7 @@ public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { + public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { return getHttpHealthCheckCallable().call(request); } @@ -372,14 +372,14 @@ public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest r * GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() * .setHttpHealthCheck(httpHealthCheck.toString()) * .build(); - * ApiFuture<HttpHealthCheck2> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request); + * ApiFuture<HttpHealthCheck> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request); * // Do something - * HttpHealthCheck2 response = future.get(); + * HttpHealthCheck response = future.get(); * } *
*/ @BetaApi - public final UnaryCallable + public final UnaryCallable getHttpHealthCheckCallable() { return stub.getHttpHealthCheckCallable(); } @@ -395,7 +395,7 @@ public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest r * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); * } *
@@ -416,7 +416,7 @@ public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest r */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, ProjectName project, HttpHealthCheck2 httpHealthCheckResource) { + String requestId, ProjectName project, HttpHealthCheck httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Operation insertHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project.toString(), httpHealthCheckResource); * } *
@@ -459,7 +459,7 @@ public final Operation insertHttpHealthCheck( */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, String project, HttpHealthCheck2 httpHealthCheckResource) { + String requestId, String project, HttpHealthCheck httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() @@ -481,7 +481,7 @@ public final Operation insertHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -510,7 +510,7 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -537,7 +537,7 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
+   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -564,7 +564,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
+   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -592,7 +592,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String proje
    *   ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
+   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -621,7 +621,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *     .build();
    *   ApiFuture<ListHttpHealthChecksPagedResponse> future = httpHealthCheckClient.listHttpHealthChecksPagedCallable().futureCall(request);
    *   // Do something
-   *   for (HttpHealthCheck2 element : future.get().iterateAll()) {
+   *   for (HttpHealthCheck element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -647,7 +647,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *     .build();
    *   while (true) {
    *     HttpHealthCheckList response = httpHealthCheckClient.listHttpHealthChecksCallable().call(request);
-   *     for (HttpHealthCheck2 element : response.getItemsList()) {
+   *     for (HttpHealthCheck element : response.getItemsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -678,7 +678,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
+   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
@@ -701,7 +701,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks( public final Operation patchHttpHealthCheck( String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck2 httpHealthCheckResource) { + HttpHealthCheck httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() @@ -724,7 +724,7 @@ public final Operation patchHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource); * } *
@@ -745,7 +745,7 @@ public final Operation patchHttpHealthCheck( */ @BetaApi public final Operation patchHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { + String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() @@ -768,7 +768,7 @@ public final Operation patchHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -798,7 +798,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -827,7 +827,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); * } *
@@ -850,7 +850,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ public final Operation updateHttpHealthCheck( String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck2 httpHealthCheckResource) { + HttpHealthCheck httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() @@ -872,7 +872,7 @@ public final Operation updateHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource); * } *
@@ -893,7 +893,7 @@ public final Operation updateHttpHealthCheck( */ @BetaApi public final Operation updateHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { + String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() @@ -915,7 +915,7 @@ public final Operation updateHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -944,7 +944,7 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); * UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -994,11 +994,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListHttpHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListHttpHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1019,11 +1019,11 @@ private ListHttpHealthChecksPagedResponse(ListHttpHealthChecksPage page) { public static class ListHttpHealthChecksPage extends AbstractPage< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, ListHttpHealthChecksPage> { private ListHttpHealthChecksPage( - PageContext context, + PageContext context, HttpHealthCheckList response) { super(context, response); } @@ -1034,14 +1034,14 @@ private static ListHttpHealthChecksPage createEmptyPage() { @Override protected ListHttpHealthChecksPage createPage( - PageContext context, + PageContext context, HttpHealthCheckList response) { return new ListHttpHealthChecksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1049,7 +1049,7 @@ public ApiFuture createPageAsync( public static class ListHttpHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { private ListHttpHealthChecksFixedSizeCollection( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java index 41c505c42162..a0b57481a409 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -32,7 +27,7 @@ @BetaApi public final class HttpHealthCheckList implements ApiMessage { private final String id; - private final List items; + private final List items; private final String kind; private final String nextPageToken; private final String selfLink; @@ -49,7 +44,7 @@ private HttpHealthCheckList() { private HttpHealthCheckList( String id, - List items, + List items, String kind, String nextPageToken, String selfLink, @@ -63,52 +58,24 @@ private HttpHealthCheckList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HttpHealthCheck2 item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,11 +86,17 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } - public List getItemsList() { + public List getItemsList() { return items; } @@ -167,7 +140,7 @@ public static HttpHealthCheckList getDefaultInstance() { public static class Builder { private String id; - private List items; + private List items; private String kind; private String nextPageToken; private String selfLink; @@ -216,11 +189,11 @@ public Builder setId(String id) { return this; } - public List getItemsList() { + public List getItemsList() { return items; } - public Builder addAllItems(List items) { + public Builder addAllItems(List items) { if (this.items == null) { this.items = new ArrayList<>(items.size()); } @@ -228,7 +201,7 @@ public Builder addAllItems(List items) { return this; } - public Builder addItems(HttpHealthCheck2 items) { + public Builder addItems(HttpHealthCheck items) { this.items.add(items); return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java index 889c5a7a07db..404c07cf503f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java @@ -70,7 +70,7 @@ public class HttpHealthCheckSettings extends ClientSettings + public UnaryCallSettings getHttpHealthCheckSettings() { return ((HttpHealthCheckStubSettings) getStubSettings()).getHttpHealthCheckSettings(); } @@ -209,7 +209,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { return getStubSettingsBuilder().getHttpHealthCheckSettings(); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java similarity index 76% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java rename to google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java index 21ef5d6e7db1..b5357d980d6e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java @@ -17,18 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @Generated("by GAPIC") @BetaApi -public final class HttpHealthCheck2 implements ApiMessage { +public final class HttpsHealthCheck implements ApiMessage { private final Integer checkIntervalSec; private final String creationTimestamp; private final String description; @@ -43,7 +39,7 @@ public final class HttpHealthCheck2 implements ApiMessage { private final Integer timeoutSec; private final Integer unhealthyThreshold; - private HttpHealthCheck2() { + private HttpsHealthCheck() { this.checkIntervalSec = null; this.creationTimestamp = null; this.description = null; @@ -59,7 +55,7 @@ private HttpHealthCheck2() { this.unhealthyThreshold = null; } - private HttpHealthCheck2( + private HttpsHealthCheck( Integer checkIntervalSec, String creationTimestamp, String description, @@ -89,92 +85,45 @@ private HttpHealthCheck2( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { - fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { - fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); - } - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("requestPath") && requestPath != null) { - fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("timeoutSec") && timeoutSec != null) { - fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); - } - if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put( - "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("checkIntervalSec")) { - return String.valueOf(checkIntervalSec); + return checkIntervalSec; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("healthyThreshold")) { - return String.valueOf(healthyThreshold); + return healthyThreshold; } if (fieldName.equals("host")) { - return String.valueOf(host); + return host; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } if (fieldName.equals("requestPath")) { - return String.valueOf(requestPath); + return requestPath; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("timeoutSec")) { - return String.valueOf(timeoutSec); + return timeoutSec; } if (fieldName.equals("unhealthyThreshold")) { - return String.valueOf(unhealthyThreshold); + return unhealthyThreshold; } return null; } @@ -185,6 +134,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getCheckIntervalSec() { return checkIntervalSec; } @@ -241,7 +196,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(HttpHealthCheck2 prototype) { + public static Builder newBuilder(HttpsHealthCheck prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -249,14 +204,14 @@ public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - public static HttpHealthCheck2 getDefaultInstance() { + public static HttpsHealthCheck getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final HttpHealthCheck2 DEFAULT_INSTANCE; + private static final HttpsHealthCheck DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new HttpHealthCheck2(); + DEFAULT_INSTANCE = new HttpsHealthCheck(); } public static class Builder { @@ -276,8 +231,8 @@ public static class Builder { Builder() {} - public Builder mergeFrom(HttpHealthCheck2 other) { - if (other == HttpHealthCheck2.getDefaultInstance()) return this; + public Builder mergeFrom(HttpsHealthCheck other) { + if (other == HttpsHealthCheck.getDefaultInstance()) return this; if (other.getCheckIntervalSec() != null) { this.checkIntervalSec = other.checkIntervalSec; } @@ -320,7 +275,7 @@ public Builder mergeFrom(HttpHealthCheck2 other) { return this; } - Builder(HttpHealthCheck2 source) { + Builder(HttpsHealthCheck source) { this.checkIntervalSec = source.checkIntervalSec; this.creationTimestamp = source.creationTimestamp; this.description = source.description; @@ -453,9 +408,9 @@ public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { return this; } - public HttpHealthCheck2 build() { + public HttpsHealthCheck build() { - return new HttpHealthCheck2( + return new HttpsHealthCheck( checkIntervalSec, creationTimestamp, description, @@ -492,7 +447,7 @@ public Builder clone() { @Override public String toString() { - return "HttpHealthCheck2{" + return "HttpsHealthCheck{" + "checkIntervalSec=" + checkIntervalSec + ", " @@ -539,8 +494,8 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof HttpHealthCheck2) { - HttpHealthCheck2 that = (HttpHealthCheck2) o; + if (o instanceof HttpsHealthCheck) { + HttpsHealthCheck that = (HttpsHealthCheck) o; return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && Objects.equals(this.description, that.getDescription()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java deleted file mode 100644 index 4523dfd5f2db..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class HttpsHealthCheck2 implements ApiMessage { - private final Integer checkIntervalSec; - private final String creationTimestamp; - private final String description; - private final Integer healthyThreshold; - private final String host; - private final String id; - private final String kind; - private final String name; - private final Integer port; - private final String requestPath; - private final String selfLink; - private final Integer timeoutSec; - private final Integer unhealthyThreshold; - - private HttpsHealthCheck2() { - this.checkIntervalSec = null; - this.creationTimestamp = null; - this.description = null; - this.healthyThreshold = null; - this.host = null; - this.id = null; - this.kind = null; - this.name = null; - this.port = null; - this.requestPath = null; - this.selfLink = null; - this.timeoutSec = null; - this.unhealthyThreshold = null; - } - - private HttpsHealthCheck2( - Integer checkIntervalSec, - String creationTimestamp, - String description, - Integer healthyThreshold, - String host, - String id, - String kind, - String name, - Integer port, - String requestPath, - String selfLink, - Integer timeoutSec, - Integer unhealthyThreshold) { - this.checkIntervalSec = checkIntervalSec; - this.creationTimestamp = creationTimestamp; - this.description = description; - this.healthyThreshold = healthyThreshold; - this.host = host; - this.id = id; - this.kind = kind; - this.name = name; - this.port = port; - this.requestPath = requestPath; - this.selfLink = selfLink; - this.timeoutSec = timeoutSec; - this.unhealthyThreshold = unhealthyThreshold; - } - - @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { - fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { - fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); - } - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("requestPath") && requestPath != null) { - fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("timeoutSec") && timeoutSec != null) { - fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); - } - if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { - fieldMap.put( - "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("checkIntervalSec")) { - return String.valueOf(checkIntervalSec); - } - if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); - } - if (fieldName.equals("description")) { - return String.valueOf(description); - } - if (fieldName.equals("healthyThreshold")) { - return String.valueOf(healthyThreshold); - } - if (fieldName.equals("host")) { - return String.valueOf(host); - } - if (fieldName.equals("id")) { - return String.valueOf(id); - } - if (fieldName.equals("kind")) { - return String.valueOf(kind); - } - if (fieldName.equals("name")) { - return String.valueOf(name); - } - if (fieldName.equals("port")) { - return String.valueOf(port); - } - if (fieldName.equals("requestPath")) { - return String.valueOf(requestPath); - } - if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); - } - if (fieldName.equals("timeoutSec")) { - return String.valueOf(timeoutSec); - } - if (fieldName.equals("unhealthyThreshold")) { - return String.valueOf(unhealthyThreshold); - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public String getDescription() { - return description; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public String getHost() { - return host; - } - - public String getId() { - return id; - } - - public String getKind() { - return kind; - } - - public String getName() { - return name; - } - - public Integer getPort() { - return port; - } - - public String getRequestPath() { - return requestPath; - } - - public String getSelfLink() { - return selfLink; - } - - public Integer getTimeoutSec() { - return timeoutSec; - } - - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(HttpsHealthCheck2 prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static HttpsHealthCheck2 getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final HttpsHealthCheck2 DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new HttpsHealthCheck2(); - } - - public static class Builder { - private Integer checkIntervalSec; - private String creationTimestamp; - private String description; - private Integer healthyThreshold; - private String host; - private String id; - private String kind; - private String name; - private Integer port; - private String requestPath; - private String selfLink; - private Integer timeoutSec; - private Integer unhealthyThreshold; - - Builder() {} - - public Builder mergeFrom(HttpsHealthCheck2 other) { - if (other == HttpsHealthCheck2.getDefaultInstance()) return this; - if (other.getCheckIntervalSec() != null) { - this.checkIntervalSec = other.checkIntervalSec; - } - if (other.getCreationTimestamp() != null) { - this.creationTimestamp = other.creationTimestamp; - } - if (other.getDescription() != null) { - this.description = other.description; - } - if (other.getHealthyThreshold() != null) { - this.healthyThreshold = other.healthyThreshold; - } - if (other.getHost() != null) { - this.host = other.host; - } - if (other.getId() != null) { - this.id = other.id; - } - if (other.getKind() != null) { - this.kind = other.kind; - } - if (other.getName() != null) { - this.name = other.name; - } - if (other.getPort() != null) { - this.port = other.port; - } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - if (other.getSelfLink() != null) { - this.selfLink = other.selfLink; - } - if (other.getTimeoutSec() != null) { - this.timeoutSec = other.timeoutSec; - } - if (other.getUnhealthyThreshold() != null) { - this.unhealthyThreshold = other.unhealthyThreshold; - } - return this; - } - - Builder(HttpsHealthCheck2 source) { - this.checkIntervalSec = source.checkIntervalSec; - this.creationTimestamp = source.creationTimestamp; - this.description = source.description; - this.healthyThreshold = source.healthyThreshold; - this.host = source.host; - this.id = source.id; - this.kind = source.kind; - this.name = source.name; - this.port = source.port; - this.requestPath = source.requestPath; - this.selfLink = source.selfLink; - this.timeoutSec = source.timeoutSec; - this.unhealthyThreshold = source.unhealthyThreshold; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public Builder setCheckIntervalSec(Integer checkIntervalSec) { - this.checkIntervalSec = checkIntervalSec; - return this; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public Builder setCreationTimestamp(String creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - public String getDescription() { - return description; - } - - public Builder setDescription(String description) { - this.description = description; - return this; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public Builder setHealthyThreshold(Integer healthyThreshold) { - this.healthyThreshold = healthyThreshold; - return this; - } - - public String getHost() { - return host; - } - - public Builder setHost(String host) { - this.host = host; - return this; - } - - public String getId() { - return id; - } - - public Builder setId(String id) { - this.id = id; - return this; - } - - public String getKind() { - return kind; - } - - public Builder setKind(String kind) { - this.kind = kind; - return this; - } - - public String getName() { - return name; - } - - public Builder setName(String name) { - this.name = name; - return this; - } - - public Integer getPort() { - return port; - } - - public Builder setPort(Integer port) { - this.port = port; - return this; - } - - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public String getSelfLink() { - return selfLink; - } - - public Builder setSelfLink(String selfLink) { - this.selfLink = selfLink; - return this; - } - - public Integer getTimeoutSec() { - return timeoutSec; - } - - public Builder setTimeoutSec(Integer timeoutSec) { - this.timeoutSec = timeoutSec; - return this; - } - - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; - } - - public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { - this.unhealthyThreshold = unhealthyThreshold; - return this; - } - - public HttpsHealthCheck2 build() { - - return new HttpsHealthCheck2( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setCheckIntervalSec(this.checkIntervalSec); - newBuilder.setCreationTimestamp(this.creationTimestamp); - newBuilder.setDescription(this.description); - newBuilder.setHealthyThreshold(this.healthyThreshold); - newBuilder.setHost(this.host); - newBuilder.setId(this.id); - newBuilder.setKind(this.kind); - newBuilder.setName(this.name); - newBuilder.setPort(this.port); - newBuilder.setRequestPath(this.requestPath); - newBuilder.setSelfLink(this.selfLink); - newBuilder.setTimeoutSec(this.timeoutSec); - newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); - return newBuilder; - } - } - - @Override - public String toString() { - return "HttpsHealthCheck2{" - + "checkIntervalSec=" - + checkIntervalSec - + ", " - + "creationTimestamp=" - + creationTimestamp - + ", " - + "description=" - + description - + ", " - + "healthyThreshold=" - + healthyThreshold - + ", " - + "host=" - + host - + ", " - + "id=" - + id - + ", " - + "kind=" - + kind - + ", " - + "name=" - + name - + ", " - + "port=" - + port - + ", " - + "requestPath=" - + requestPath - + ", " - + "selfLink=" - + selfLink - + ", " - + "timeoutSec=" - + timeoutSec - + ", " - + "unhealthyThreshold=" - + unhealthyThreshold - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof HttpsHealthCheck2) { - HttpsHealthCheck2 that = (HttpsHealthCheck2) o; - return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) - && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) - && Objects.equals(this.description, that.getDescription()) - && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) - && Objects.equals(this.host, that.getHost()) - && Objects.equals(this.id, that.getId()) - && Objects.equals(this.kind, that.getKind()) - && Objects.equals(this.name, that.getName()) - && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.requestPath, that.getRequestPath()) - && Objects.equals(this.selfLink, that.getSelfLink()) - && Objects.equals(this.timeoutSec, that.getTimeoutSec()) - && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java index c8e4e440b1cb..d5e5a485c9e2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -291,7 +291,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
+   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
    * }
    * 
* @@ -299,7 +299,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck2 getHttpsHealthCheck( + public final HttpsHealthCheck getHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = @@ -319,7 +319,7 @@ public final HttpsHealthCheck2 getHttpsHealthCheck( *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
+   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
    * }
    * 
* @@ -327,7 +327,7 @@ public final HttpsHealthCheck2 getHttpsHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) { + public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder().setHttpsHealthCheck(httpsHealthCheck).build(); @@ -347,7 +347,7 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) { * GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .build(); - * HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(request); + * HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(request); * } *
* @@ -355,7 +355,7 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { + public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { return getHttpsHealthCheckCallable().call(request); } @@ -372,14 +372,14 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpReques * GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .build(); - * ApiFuture<HttpsHealthCheck2> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request); + * ApiFuture<HttpsHealthCheck> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request); * // Do something - * HttpsHealthCheck2 response = future.get(); + * HttpsHealthCheck response = future.get(); * } *
*/ @BetaApi - public final UnaryCallable + public final UnaryCallable getHttpsHealthCheckCallable() { return stub.getHttpsHealthCheckCallable(); } @@ -395,7 +395,7 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpReques * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); * } *
@@ -416,7 +416,7 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpReques */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, ProjectName project, HttpsHealthCheck2 httpsHealthCheckResource) { + String requestId, ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Operation insertHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project.toString(), httpsHealthCheckResource); * } *
@@ -459,7 +459,7 @@ public final Operation insertHttpsHealthCheck( */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, String project, HttpsHealthCheck2 httpsHealthCheckResource) { + String requestId, String project, HttpsHealthCheck httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() @@ -481,7 +481,7 @@ public final Operation insertHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -510,7 +510,7 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -537,7 +537,7 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
+   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -564,7 +564,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectNam
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
+   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -592,7 +592,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String pro
    *   ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
+   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -621,7 +621,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    *     .build();
    *   ApiFuture<ListHttpsHealthChecksPagedResponse> future = httpsHealthCheckClient.listHttpsHealthChecksPagedCallable().futureCall(request);
    *   // Do something
-   *   for (HttpsHealthCheck2 element : future.get().iterateAll()) {
+   *   for (HttpsHealthCheck element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -647,7 +647,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    *     .build();
    *   while (true) {
    *     HttpsHealthCheckList response = httpsHealthCheckClient.listHttpsHealthChecksCallable().call(request);
-   *     for (HttpsHealthCheck2 element : response.getItemsList()) {
+   *     for (HttpsHealthCheck element : response.getItemsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -678,7 +678,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
-   *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
+   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
    * }
    * 
@@ -701,7 +701,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks( public final Operation patchHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId, - HttpsHealthCheck2 httpsHealthCheckResource) { + HttpsHealthCheck httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() @@ -724,7 +724,7 @@ public final Operation patchHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource); * } *
@@ -745,7 +745,7 @@ public final Operation patchHttpsHealthCheck( */ @BetaApi public final Operation patchHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { + String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() @@ -768,7 +768,7 @@ public final Operation patchHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -798,7 +798,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -827,7 +827,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); * } *
@@ -850,7 +850,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re public final Operation updateHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId, - HttpsHealthCheck2 httpsHealthCheckResource) { + HttpsHealthCheck httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() @@ -872,7 +872,7 @@ public final Operation updateHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource); * } *
@@ -893,7 +893,7 @@ public final Operation updateHttpsHealthCheck( */ @BetaApi public final Operation updateHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { + String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() @@ -915,7 +915,7 @@ public final Operation updateHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -944,7 +944,7 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); * UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -994,11 +994,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListHttpsHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = @@ -1020,11 +1020,11 @@ private ListHttpsHealthChecksPagedResponse(ListHttpsHealthChecksPage page) { public static class ListHttpsHealthChecksPage extends AbstractPage< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, ListHttpsHealthChecksPage> { private ListHttpsHealthChecksPage( - PageContext + PageContext context, HttpsHealthCheckList response) { super(context, response); @@ -1036,7 +1036,7 @@ private static ListHttpsHealthChecksPage createEmptyPage() { @Override protected ListHttpsHealthChecksPage createPage( - PageContext + PageContext context, HttpsHealthCheckList response) { return new ListHttpsHealthChecksPage(context, response); @@ -1044,7 +1044,7 @@ protected ListHttpsHealthChecksPage createPage( @Override public ApiFuture createPageAsync( - PageContext + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); @@ -1053,7 +1053,7 @@ public ApiFuture createPageAsync( public static class ListHttpsHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { private ListHttpsHealthChecksFixedSizeCollection( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java index f238d2e334c3..c81b3173ec5e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -32,7 +27,7 @@ @BetaApi public final class HttpsHealthCheckList implements ApiMessage { private final String id; - private final List items; + private final List items; private final String kind; private final String nextPageToken; private final String selfLink; @@ -49,7 +44,7 @@ private HttpsHealthCheckList() { private HttpsHealthCheckList( String id, - List items, + List items, String kind, String nextPageToken, String selfLink, @@ -63,52 +58,24 @@ private HttpsHealthCheckList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HttpsHealthCheck2 item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,11 +86,17 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } - public List getItemsList() { + public List getItemsList() { return items; } @@ -167,7 +140,7 @@ public static HttpsHealthCheckList getDefaultInstance() { public static class Builder { private String id; - private List items; + private List items; private String kind; private String nextPageToken; private String selfLink; @@ -216,11 +189,11 @@ public Builder setId(String id) { return this; } - public List getItemsList() { + public List getItemsList() { return items; } - public Builder addAllItems(List items) { + public Builder addAllItems(List items) { if (this.items == null) { this.items = new ArrayList<>(items.size()); } @@ -228,7 +201,7 @@ public Builder addAllItems(List items) { return this; } - public Builder addItems(HttpsHealthCheck2 items) { + public Builder addItems(HttpsHealthCheck items) { this.items.add(items); return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java index 485682fea0f3..072f37085c38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java @@ -70,7 +70,7 @@ public class HttpsHealthCheckSettings extends ClientSettings + public UnaryCallSettings getHttpsHealthCheckSettings() { return ((HttpsHealthCheckStubSettings) getStubSettings()).getHttpsHealthCheckSettings(); } @@ -210,7 +210,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { return getStubSettingsBuilder().getHttpsHealthCheckSettings(); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java index 12d4d8d3e135..293e38cf15ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java @@ -17,14 +17,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -151,200 +147,90 @@ private Image( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("archiveSizeBytes") && archiveSizeBytes != null) { - fieldMap.put("archiveSizeBytes", Collections.singletonList(String.valueOf(archiveSizeBytes))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { - fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); - } - if (fieldNames.contains("family") && family != null) { - fieldMap.put("family", Collections.singletonList(String.valueOf(family))); - } - if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (GuestOsFeature item : guestOsFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("guestOsFeatures", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("imageEncryptionKey") && imageEncryptionKey != null) { - fieldMap.put( - "imageEncryptionKey", Collections.singletonList(String.valueOf(imageEncryptionKey))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("licenseCodes") && licenseCodes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenseCodes) { - stringList.add(item.toString()); - } - fieldMap.put("licenseCodes", stringList.build()); - } - if (fieldNames.contains("licenses") && licenses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenses) { - stringList.add(item.toString()); - } - fieldMap.put("licenses", stringList.build()); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("rawDisk") && rawDisk != null) { - fieldMap.put("rawDisk", Collections.singletonList(String.valueOf(rawDisk))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sourceDisk") && sourceDisk != null) { - fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); - } - if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { - fieldMap.put( - "sourceDiskEncryptionKey", - Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); - } - if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { - fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); - } - if (fieldNames.contains("sourceImage") && sourceImage != null) { - fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); - } - if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put( - "sourceImageEncryptionKey", - Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); - } - if (fieldNames.contains("sourceImageId") && sourceImageId != null) { - fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); - } - if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) { - fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); - } - if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { - fieldMap.put( - "sourceSnapshotEncryptionKey", - Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); - } - if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { - fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); - } - if (fieldNames.contains("sourceType") && sourceType != null) { - fieldMap.put("sourceType", Collections.singletonList(String.valueOf(sourceType))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("archiveSizeBytes")) { - return String.valueOf(archiveSizeBytes); + return archiveSizeBytes; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("diskSizeGb")) { - return String.valueOf(diskSizeGb); + return diskSizeGb; } if (fieldName.equals("family")) { - return String.valueOf(family); + return family; } if (fieldName.equals("guestOsFeatures")) { - return String.valueOf(guestOsFeatures); + return guestOsFeatures; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("imageEncryptionKey")) { - return String.valueOf(imageEncryptionKey); + return imageEncryptionKey; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("licenseCodes")) { - return String.valueOf(licenseCodes); + return licenseCodes; } if (fieldName.equals("licenses")) { - return String.valueOf(licenses); + return licenses; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("rawDisk")) { - return String.valueOf(rawDisk); + return rawDisk; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sourceDisk")) { - return String.valueOf(sourceDisk); + return sourceDisk; } if (fieldName.equals("sourceDiskEncryptionKey")) { - return String.valueOf(sourceDiskEncryptionKey); + return sourceDiskEncryptionKey; } if (fieldName.equals("sourceDiskId")) { - return String.valueOf(sourceDiskId); + return sourceDiskId; } if (fieldName.equals("sourceImage")) { - return String.valueOf(sourceImage); + return sourceImage; } if (fieldName.equals("sourceImageEncryptionKey")) { - return String.valueOf(sourceImageEncryptionKey); + return sourceImageEncryptionKey; } if (fieldName.equals("sourceImageId")) { - return String.valueOf(sourceImageId); + return sourceImageId; } if (fieldName.equals("sourceSnapshot")) { - return String.valueOf(sourceSnapshot); + return sourceSnapshot; } if (fieldName.equals("sourceSnapshotEncryptionKey")) { - return String.valueOf(sourceSnapshotEncryptionKey); + return sourceSnapshotEncryptionKey; } if (fieldName.equals("sourceSnapshotId")) { - return String.valueOf(sourceSnapshotId); + return sourceSnapshotId; } if (fieldName.equals("sourceType")) { - return String.valueOf(sourceType); + return sourceType; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } return null; } @@ -355,6 +241,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getArchiveSizeBytes() { return archiveSizeBytes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java index 8fa51eaa64e3..db11170a78d4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private ImageList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Image item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java index ea752693f8d2..44854ff6fb49 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertAddressHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("addressResource") && addressResource != null) { - fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("addressResource")) { - return String.valueOf(addressResource); + return addressResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Address getApiMessageRequestBody() { return addressResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java index 6a96da87124d..3d82ab72a020 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscalerResource")) { - return String.valueOf(autoscalerResource); + return autoscalerResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -154,6 +113,12 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java index 42c4e361e50b..f2416257483e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertBackendBucketHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { - fieldMap.put( - "backendBucketResource", - Collections.singletonList(String.valueOf(backendBucketResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendBucketResource")) { - return String.valueOf(backendBucketResource); + return backendBucketResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendBucket getApiMessageRequestBody() { return backendBucketResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java index 42fcd7be40a2..7bdaa1185c4f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put( - "backendServiceResource", - Collections.singletonList(String.valueOf(backendServiceResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendServiceResource")) { - return String.valueOf(backendServiceResource); + return backendServiceResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java index 3b1b60e75f6d..aa60ae6b958c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,78 +77,39 @@ private InsertDiskHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("diskResource") && diskResource != null) { - fieldMap.put("diskResource", Collections.singletonList(String.valueOf(diskResource))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sourceImage") && sourceImage != null) { - fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("diskResource")) { - return String.valueOf(diskResource); + return diskResource; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sourceImage")) { - return String.valueOf(sourceImage); + return sourceImage; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -163,6 +120,12 @@ public Disk getApiMessageRequestBody() { return diskResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java index 83dc075807f0..b3894dc14e7d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertFirewallHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("firewallResource") && firewallResource != null) { - fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("firewallResource")) { - return String.valueOf(firewallResource); + return firewallResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Firewall getApiMessageRequestBody() { return firewallResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java index b19b538ab343..5ac102ea2b9d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { - fieldMap.put( - "forwardingRuleResource", - Collections.singletonList(String.valueOf(forwardingRuleResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRuleResource")) { - return String.valueOf(forwardingRuleResource); + return forwardingRuleResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public ForwardingRule getApiMessageRequestBody() { return forwardingRuleResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java index eabad11cacd9..8494ba87d2b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertGlobalAddressHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("addressResource") && addressResource != null) { - fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("addressResource")) { - return String.valueOf(addressResource); + return addressResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Address getApiMessageRequestBody() { return addressResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java index 88c75c705ec6..ffc889f6a054 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertGlobalForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { - fieldMap.put( - "forwardingRuleResource", - Collections.singletonList(String.valueOf(forwardingRuleResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRuleResource")) { - return String.valueOf(forwardingRuleResource); + return forwardingRuleResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public ForwardingRule getApiMessageRequestBody() { return forwardingRuleResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java index 54634df42917..e49d8f2d47b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { - fieldMap.put( - "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("healthCheckResource")) { - return String.valueOf(healthCheckResource); + return healthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public HealthCheck getApiMessageRequestBody() { return healthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java index 2d8878494a2e..7b58d9e476a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -32,7 +28,7 @@ public final class InsertHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; - private final HttpHealthCheck2 httpHealthCheckResource; + private final HttpHealthCheck httpHealthCheckResource; private final String key; private final String prettyPrint; private final String project; @@ -57,7 +53,7 @@ private InsertHttpHealthCheckHttpRequest( String access_token, String callback, String fields, - HttpHealthCheck2 httpHealthCheckResource, + HttpHealthCheck httpHealthCheckResource, String key, String prettyPrint, String project, @@ -77,84 +73,52 @@ private InsertHttpHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { - fieldMap.put( - "httpHealthCheckResource", - Collections.singletonList(String.valueOf(httpHealthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpHealthCheckResource")) { - return String.valueOf(httpHealthCheckResource); + return httpHealthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @Nullable @Override - public HttpHealthCheck2 getApiMessageRequestBody() { + public HttpHealthCheck getApiMessageRequestBody() { return httpHealthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } @@ -167,7 +131,7 @@ public String getFields() { return fields; } - public HttpHealthCheck2 getHttpHealthCheckResource() { + public HttpHealthCheck getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -221,7 +185,7 @@ public static class Builder { private String access_token; private String callback; private String fields; - private HttpHealthCheck2 httpHealthCheckResource; + private HttpHealthCheck httpHealthCheckResource; private String key; private String prettyPrint; private String project; @@ -306,11 +270,11 @@ public Builder setFields(String fields) { return this; } - public HttpHealthCheck2 getHttpHealthCheckResource() { + public HttpHealthCheck getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java index 5be147a7e9ea..bee0afdfa890 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -32,7 +28,7 @@ public final class InsertHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; - private final HttpsHealthCheck2 httpsHealthCheckResource; + private final HttpsHealthCheck httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String project; @@ -57,7 +53,7 @@ private InsertHttpsHealthCheckHttpRequest( String access_token, String callback, String fields, - HttpsHealthCheck2 httpsHealthCheckResource, + HttpsHealthCheck httpsHealthCheckResource, String key, String prettyPrint, String project, @@ -77,84 +73,52 @@ private InsertHttpsHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { - fieldMap.put( - "httpsHealthCheckResource", - Collections.singletonList(String.valueOf(httpsHealthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpsHealthCheckResource")) { - return String.valueOf(httpsHealthCheckResource); + return httpsHealthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @Nullable @Override - public HttpsHealthCheck2 getApiMessageRequestBody() { + public HttpsHealthCheck getApiMessageRequestBody() { return httpsHealthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } @@ -167,7 +131,7 @@ public String getFields() { return fields; } - public HttpsHealthCheck2 getHttpsHealthCheckResource() { + public HttpsHealthCheck getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -221,7 +185,7 @@ public static class Builder { private String access_token; private String callback; private String fields; - private HttpsHealthCheck2 httpsHealthCheckResource; + private HttpsHealthCheck httpsHealthCheckResource; private String key; private String prettyPrint; private String project; @@ -306,11 +270,11 @@ public Builder setFields(String fields) { return this; } - public HttpsHealthCheck2 getHttpsHealthCheckResource() { + public HttpsHealthCheck getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java index 85e548a840ff..fc5fe51b948b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,78 +77,39 @@ private InsertImageHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forceCreate") && forceCreate != null) { - fieldMap.put("forceCreate", Collections.singletonList(String.valueOf(forceCreate))); - } - if (fieldNames.contains("imageResource") && imageResource != null) { - fieldMap.put("imageResource", Collections.singletonList(String.valueOf(imageResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forceCreate")) { - return String.valueOf(forceCreate); + return forceCreate; } if (fieldName.equals("imageResource")) { - return String.valueOf(imageResource); + return imageResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -163,6 +120,12 @@ public Image getApiMessageRequestBody() { return imageResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java index e164d6cae1b2..31d5d8febca0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupResource") && instanceGroupResource != null) { - fieldMap.put( - "instanceGroupResource", - Collections.singletonList(String.valueOf(instanceGroupResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupResource")) { - return String.valueOf(instanceGroupResource); + return instanceGroupResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -155,6 +113,12 @@ public InstanceGroup getApiMessageRequestBody() { return instanceGroupResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java index 57a03d1b5920..869aeaa40d7d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private InsertInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManagerResource") - && instanceGroupManagerResource != null) { - fieldMap.put( - "instanceGroupManagerResource", - Collections.singletonList(String.valueOf(instanceGroupManagerResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManagerResource")) { - return String.valueOf(instanceGroupManagerResource); + return instanceGroupManagerResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -156,6 +113,12 @@ public InstanceGroupManager getApiMessageRequestBody() { return instanceGroupManagerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java index fcff5ddf431b..0a110a065c7e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,80 +77,39 @@ private InsertInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceResource") && instanceResource != null) { - fieldMap.put("instanceResource", Collections.singletonList(String.valueOf(instanceResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sourceInstanceTemplate") && sourceInstanceTemplate != null) { - fieldMap.put( - "sourceInstanceTemplate", - Collections.singletonList(String.valueOf(sourceInstanceTemplate))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceResource")) { - return String.valueOf(instanceResource); + return instanceResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sourceInstanceTemplate")) { - return String.valueOf(sourceInstanceTemplate); + return sourceInstanceTemplate; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -165,6 +120,12 @@ public Instance getApiMessageRequestBody() { return instanceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java index f63f92b4f8ad..950f30b9ee45 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertInstanceTemplateHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceTemplateResource") && instanceTemplateResource != null) { - fieldMap.put( - "instanceTemplateResource", - Collections.singletonList(String.valueOf(instanceTemplateResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceTemplateResource")) { - return String.valueOf(instanceTemplateResource); + return instanceTemplateResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public InstanceTemplate getApiMessageRequestBody() { return instanceTemplateResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java index a8ac39739e70..8a3e6df68c91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private InsertInterconnectAttachmentHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnectAttachmentResource") - && interconnectAttachmentResource != null) { - fieldMap.put( - "interconnectAttachmentResource", - Collections.singletonList(String.valueOf(interconnectAttachmentResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnectAttachmentResource")) { - return String.valueOf(interconnectAttachmentResource); + return interconnectAttachmentResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InterconnectAttachment getApiMessageRequestBody() { return interconnectAttachmentResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java index 9ddb8551c356..9402cf686fc4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertInterconnectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnectResource") && interconnectResource != null) { - fieldMap.put( - "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnectResource")) { - return String.valueOf(interconnectResource); + return interconnectResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Interconnect getApiMessageRequestBody() { return interconnectResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java index fe43d76ababc..577888b8f703 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertLicenseHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("licenseResource") && licenseResource != null) { - fieldMap.put("licenseResource", Collections.singletonList(String.valueOf(licenseResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("licenseResource")) { - return String.valueOf(licenseResource); + return licenseResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public License getApiMessageRequestBody() { return licenseResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java index c3f9aa063165..1c765b0db7a5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("networkResource") && networkResource != null) { - fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("networkResource")) { - return String.valueOf(networkResource); + return networkResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Network getApiMessageRequestBody() { return networkResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java index 596244b18249..6f68a3783cb2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertRegionAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscalerResource")) { - return String.valueOf(autoscalerResource); + return autoscalerResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java index 99e8a70e4722..f85f6024141f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertRegionBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put( - "backendServiceResource", - Collections.singletonList(String.valueOf(backendServiceResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendServiceResource")) { - return String.valueOf(backendServiceResource); + return backendServiceResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java index b20ba9542536..b2ac2c51f6a6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertRegionCommitmentHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("commitmentResource") && commitmentResource != null) { - fieldMap.put( - "commitmentResource", Collections.singletonList(String.valueOf(commitmentResource))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("commitmentResource")) { - return String.valueOf(commitmentResource); + return commitmentResource; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Commitment getApiMessageRequestBody() { return commitmentResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java index 7f446083c85b..7e4b4df953c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private InsertRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManagerResource") - && instanceGroupManagerResource != null) { - fieldMap.put( - "instanceGroupManagerResource", - Collections.singletonList(String.valueOf(instanceGroupManagerResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManagerResource")) { - return String.valueOf(instanceGroupManagerResource); + return instanceGroupManagerResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstanceGroupManager getApiMessageRequestBody() { return instanceGroupManagerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java index 15c2d58f3f02..ef13fefe5651 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertRouteHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("routeResource") && routeResource != null) { - fieldMap.put("routeResource", Collections.singletonList(String.valueOf(routeResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("routeResource")) { - return String.valueOf(routeResource); + return routeResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Route getApiMessageRequestBody() { return routeResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java index 9224aaeac65e..73648b655089 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("routerResource") && routerResource != null) { - fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("routerResource")) { - return String.valueOf(routerResource); + return routerResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Router getApiMessageRequestBody() { return routerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java index d24619b7bdc8..6eaf2ac78ddb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertSslCertificateHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslCertificateResource") && sslCertificateResource != null) { - fieldMap.put( - "sslCertificateResource", - Collections.singletonList(String.valueOf(sslCertificateResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslCertificateResource")) { - return String.valueOf(sslCertificateResource); + return sslCertificateResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public SslCertificate getApiMessageRequestBody() { return sslCertificateResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java index dedc433cbc2c..1bb69f83736c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertSslPolicyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) { - fieldMap.put( - "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslPolicyResource")) { - return String.valueOf(sslPolicyResource); + return sslPolicyResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public SslPolicy getApiMessageRequestBody() { return sslPolicyResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java index 98bec8e85e85..2db72649e1a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertSubnetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { - fieldMap.put( - "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("subnetworkResource")) { - return String.valueOf(subnetworkResource); + return subnetworkResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Subnetwork getApiMessageRequestBody() { return subnetworkResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java index f001e2403a26..0954f10a7667 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertTargetHttpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpProxyResource") && targetHttpProxyResource != null) { - fieldMap.put( - "targetHttpProxyResource", - Collections.singletonList(String.valueOf(targetHttpProxyResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpProxyResource")) { - return String.valueOf(targetHttpProxyResource); + return targetHttpProxyResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetHttpProxy getApiMessageRequestBody() { return targetHttpProxyResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java index 2e357705b953..af8b42abc271 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertTargetHttpsProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpsProxyResource") && targetHttpsProxyResource != null) { - fieldMap.put( - "targetHttpsProxyResource", - Collections.singletonList(String.valueOf(targetHttpsProxyResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpsProxyResource")) { - return String.valueOf(targetHttpsProxyResource); + return targetHttpsProxyResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetHttpsProxy getApiMessageRequestBody() { return targetHttpsProxyResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java index bfaa6abf741b..c6b44391a95e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertTargetInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetInstanceResource") && targetInstanceResource != null) { - fieldMap.put( - "targetInstanceResource", - Collections.singletonList(String.valueOf(targetInstanceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetInstanceResource")) { - return String.valueOf(targetInstanceResource); + return targetInstanceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -155,6 +113,12 @@ public TargetInstance getApiMessageRequestBody() { return targetInstanceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java index c42a2c6d5718..42353932d5b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPoolResource") && targetPoolResource != null) { - fieldMap.put( - "targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPoolResource")) { - return String.valueOf(targetPoolResource); + return targetPoolResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public TargetPool getApiMessageRequestBody() { return targetPoolResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java index 7ca1cfa1fd4d..8edac35f2e7d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetSslProxyResource") && targetSslProxyResource != null) { - fieldMap.put( - "targetSslProxyResource", - Collections.singletonList(String.valueOf(targetSslProxyResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetSslProxyResource")) { - return String.valueOf(targetSslProxyResource); + return targetSslProxyResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetSslProxy getApiMessageRequestBody() { return targetSslProxyResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java index bebf9bf2660e..c77a843b7fa4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertTargetTcpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetTcpProxyResource") && targetTcpProxyResource != null) { - fieldMap.put( - "targetTcpProxyResource", - Collections.singletonList(String.valueOf(targetTcpProxyResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetTcpProxyResource")) { - return String.valueOf(targetTcpProxyResource); + return targetTcpProxyResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetTcpProxy getApiMessageRequestBody() { return targetTcpProxyResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java index 33eea30cd206..9ebec84e2861 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private InsertTargetVpnGatewayHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetVpnGatewayResource") && targetVpnGatewayResource != null) { - fieldMap.put( - "targetVpnGatewayResource", - Collections.singletonList(String.valueOf(targetVpnGatewayResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetVpnGatewayResource")) { - return String.valueOf(targetVpnGatewayResource); + return targetVpnGatewayResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetVpnGateway getApiMessageRequestBody() { return targetVpnGatewayResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java index f6a4a3a1ac2c..0a4fd9b8895f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private InsertUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("urlMapResource") && urlMapResource != null) { - fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("urlMapResource")) { - return String.valueOf(urlMapResource); + return urlMapResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public UrlMap getApiMessageRequestBody() { return urlMapResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java index fb7470850b13..d99f43f1896e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private InsertVpnTunnelHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) { - fieldMap.put( - "vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("vpnTunnelResource")) { - return String.valueOf(vpnTunnelResource); + return vpnTunnelResource; } return null; } @@ -154,6 +113,12 @@ public VpnTunnel getApiMessageRequestBody() { return vpnTunnelResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java index 3dae75547c94..31f30d76b42c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java @@ -17,14 +17,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -135,174 +131,78 @@ private Instance( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("canIpForward") && canIpForward != null) { - fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward))); - } - if (fieldNames.contains("cpuPlatform") && cpuPlatform != null) { - fieldMap.put("cpuPlatform", Collections.singletonList(String.valueOf(cpuPlatform))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deletionProtection") && deletionProtection != null) { - fieldMap.put( - "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("disks") && disks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AttachedDisk item : disks) { - stringList.add(item.toString()); - } - fieldMap.put("disks", stringList.build()); - } - if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorConfig item : guestAccelerators) { - stringList.add(item.toString()); - } - fieldMap.put("guestAccelerators", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("machineType") && machineType != null) { - fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); - } - if (fieldNames.contains("metadata") && metadata != null) { - fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); - } - if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { - fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NetworkInterface item : networkInterfaces) { - stringList.add(item.toString()); - } - fieldMap.put("networkInterfaces", stringList.build()); - } - if (fieldNames.contains("scheduling") && scheduling != null) { - fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ServiceAccount item : serviceAccounts) { - stringList.add(item.toString()); - } - fieldMap.put("serviceAccounts", stringList.build()); - } - if (fieldNames.contains("startRestricted") && startRestricted != null) { - fieldMap.put("startRestricted", Collections.singletonList(String.valueOf(startRestricted))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("statusMessage") && statusMessage != null) { - fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); - } - if (fieldNames.contains("tags") && tags != null) { - fieldMap.put("tags", Collections.singletonList(String.valueOf(tags))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("canIpForward")) { - return String.valueOf(canIpForward); + return canIpForward; } if (fieldName.equals("cpuPlatform")) { - return String.valueOf(cpuPlatform); + return cpuPlatform; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deletionProtection")) { - return String.valueOf(deletionProtection); + return deletionProtection; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("disks")) { - return String.valueOf(disks); + return disks; } if (fieldName.equals("guestAccelerators")) { - return String.valueOf(guestAccelerators); + return guestAccelerators; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("machineType")) { - return String.valueOf(machineType); + return machineType; } if (fieldName.equals("metadata")) { - return String.valueOf(metadata); + return metadata; } if (fieldName.equals("minCpuPlatform")) { - return String.valueOf(minCpuPlatform); + return minCpuPlatform; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("networkInterfaces")) { - return String.valueOf(networkInterfaces); + return networkInterfaces; } if (fieldName.equals("scheduling")) { - return String.valueOf(scheduling); + return scheduling; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("serviceAccounts")) { - return String.valueOf(serviceAccounts); + return serviceAccounts; } if (fieldName.equals("startRestricted")) { - return String.valueOf(startRestricted); + return startRestricted; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("statusMessage")) { - return String.valueOf(statusMessage); + return statusMessage; } if (fieldName.equals("tags")) { - return String.valueOf(tags); + return tags; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -313,6 +213,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getCanIpForward() { return canIpForward; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java index 876eb432086d..520c4fd90d89 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private InstanceAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java index 83954bf65eae..e8d1b23bc558 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,95 +86,45 @@ private InstanceGroup( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("namedPorts") && namedPorts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NamedPort item : namedPorts) { - stringList.add(item.toString()); - } - fieldMap.put("namedPorts", stringList.build()); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("size") && size != null) { - fieldMap.put("size", Collections.singletonList(String.valueOf(size))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("namedPorts")) { - return String.valueOf(namedPorts); + return namedPorts; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("size")) { - return String.valueOf(size); + return size; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -190,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java index e26acc7fa38c..ccf256b918a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private InstanceGroupAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java index 61e7a98c78bc..5d45ba71b0dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InstanceGroupList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceGroup item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java index 2a5b1234ee97..c517a08d25fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -103,117 +98,54 @@ private InstanceGroupManager( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("baseInstanceName") && baseInstanceName != null) { - fieldMap.put("baseInstanceName", Collections.singletonList(String.valueOf(baseInstanceName))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("currentActions") && currentActions != null) { - fieldMap.put("currentActions", Collections.singletonList(String.valueOf(currentActions))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { - fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("namedPorts") && namedPorts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NamedPort item : namedPorts) { - stringList.add(item.toString()); - } - fieldMap.put("namedPorts", stringList.build()); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("targetPools") && targetPools != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : targetPools) { - stringList.add(item.toString()); - } - fieldMap.put("targetPools", stringList.build()); - } - if (fieldNames.contains("targetSize") && targetSize != null) { - fieldMap.put("targetSize", Collections.singletonList(String.valueOf(targetSize))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("baseInstanceName")) { - return String.valueOf(baseInstanceName); + return baseInstanceName; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("currentActions")) { - return String.valueOf(currentActions); + return currentActions; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("instanceTemplate")) { - return String.valueOf(instanceTemplate); + return instanceTemplate; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("namedPorts")) { - return String.valueOf(namedPorts); + return namedPorts; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("targetPools")) { - return String.valueOf(targetPools); + return targetPools; } if (fieldName.equals("targetSize")) { - return String.valueOf(targetSize); + return targetSize; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -224,6 +156,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBaseInstanceName() { return baseInstanceName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java index 4ffb882381ce..e7dee1d39935 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,62 +65,30 @@ private InstanceGroupManagerActionsSummary( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("abandoning") && abandoning != null) { - fieldMap.put("abandoning", Collections.singletonList(String.valueOf(abandoning))); - } - if (fieldNames.contains("creating") && creating != null) { - fieldMap.put("creating", Collections.singletonList(String.valueOf(creating))); - } - if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) { - fieldMap.put( - "creatingWithoutRetries", - Collections.singletonList(String.valueOf(creatingWithoutRetries))); - } - if (fieldNames.contains("deleting") && deleting != null) { - fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting))); - } - if (fieldNames.contains("none") && none != null) { - fieldMap.put("none", Collections.singletonList(String.valueOf(none))); - } - if (fieldNames.contains("recreating") && recreating != null) { - fieldMap.put("recreating", Collections.singletonList(String.valueOf(recreating))); - } - if (fieldNames.contains("refreshing") && refreshing != null) { - fieldMap.put("refreshing", Collections.singletonList(String.valueOf(refreshing))); - } - if (fieldNames.contains("restarting") && restarting != null) { - fieldMap.put("restarting", Collections.singletonList(String.valueOf(restarting))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("abandoning")) { - return String.valueOf(abandoning); + return abandoning; } if (fieldName.equals("creating")) { - return String.valueOf(creating); + return creating; } if (fieldName.equals("creatingWithoutRetries")) { - return String.valueOf(creatingWithoutRetries); + return creatingWithoutRetries; } if (fieldName.equals("deleting")) { - return String.valueOf(deleting); + return deleting; } if (fieldName.equals("none")) { - return String.valueOf(none); + return none; } if (fieldName.equals("recreating")) { - return String.valueOf(recreating); + return recreating; } if (fieldName.equals("refreshing")) { - return String.valueOf(refreshing); + return refreshing; } if (fieldName.equals("restarting")) { - return String.valueOf(restarting); + return restarting; } return null; } @@ -135,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getAbandoning() { return abandoning; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java index f6d9303baa32..3f69694136f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private InstanceGroupManagerAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java index d2b342712b58..cf3f5523287f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InstanceGroupManagerList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceGroupManager item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java index b38c1b293980..b4b0f1a82ce7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstanceGroupManagersAbandonInstancesRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java index c96ff91fdfbc..8b7e1fde5548 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstanceGroupManagersDeleteInstancesRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java index 6b0747ba2282..56adcdd6f18f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -42,29 +38,22 @@ private InstanceGroupManagersListManagedInstancesResponse( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("managedInstances") && managedInstances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ManagedInstance item : managedInstances) { - stringList.add(item.toString()); - } - fieldMap.put("managedInstances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("managedInstances")) { + return managedInstances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("managedInstances")) { - return String.valueOf(managedInstances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java index d672f3af897c..26b38255944f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstanceGroupManagersRecreateInstancesRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java index 7a09476e60bc..2423d1f5b481 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,28 +41,12 @@ private InstanceGroupManagersScopedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instanceGroupManagers") && instanceGroupManagers != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceGroupManager item : instanceGroupManagers) { - stringList.add(item.toString()); - } - fieldMap.put("instanceGroupManagers", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("instanceGroupManagers")) { - return String.valueOf(instanceGroupManagers); + return instanceGroupManagers; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -78,6 +57,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getInstanceGroupManagersList() { return instanceGroupManagers; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java index 6b8d4fdc5c1e..a5a25c5e287b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private InstanceGroupManagersSetInstanceTemplateRequest(String instanceTemplate) } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { - fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instanceTemplate")) { + return instanceTemplate; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instanceTemplate")) { - return String.valueOf(instanceTemplate); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java index 03c59c8515e7..b725f6531a08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private InstanceGroupManagersSetTargetPoolsRequest(String fingerprint, List> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("targetPools") && targetPools != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : targetPools) { - stringList.add(item.toString()); - } - fieldMap.put("targetPools", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("targetPools")) { - return String.valueOf(targetPools); + return targetPools; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java index ba597e29026d..019168d28d14 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstanceGroupsAddInstancesRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceReference item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java index 95d0d999162f..f981f564e892 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InstanceGroupsListInstances( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceWithNamedPorts item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java index 25fe971e58c5..84f5a6944f18 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private InstanceGroupsListInstancesRequest(String instanceState) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instanceState") && instanceState != null) { - fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instanceState")) { + return instanceState; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instanceState")) { - return String.valueOf(instanceState); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java index e08eb75e9557..3e5bf339f895 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstanceGroupsRemoveInstancesRequest(List instances) } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceReference item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java index ad9dbc96e281..88f22ad13a7d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private InstanceGroupsScopedList(List instanceGroups, Warning war } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instanceGroups") && instanceGroups != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceGroup item : instanceGroups) { - stringList.add(item.toString()); - } - fieldMap.put("instanceGroups", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("instanceGroups")) { - return String.valueOf(instanceGroups); + return instanceGroups; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getInstanceGroupsList() { return instanceGroups; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java index 7dabe633d62a..d5a0eea248dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private InstanceGroupsSetNamedPortsRequest(String fingerprint, List n } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("namedPorts") && namedPorts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NamedPort item : namedPorts) { - stringList.add(item.toString()); - } - fieldMap.put("namedPorts", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("namedPorts")) { - return String.valueOf(namedPorts); + return namedPorts; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java index d941f757c9d3..ce2e48dc6a78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InstanceList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Instance item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java index 5b68399cdcfb..28412fdaae8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InstanceListReferrers( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Reference item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java index 9bcd0e989942..88ff621565a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private InstanceMoveRequest(String destinationZone, String targetInstance) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("destinationZone") && destinationZone != null) { - fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone))); - } - if (fieldNames.contains("targetInstance") && targetInstance != null) { - fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("destinationZone")) { - return String.valueOf(destinationZone); + return destinationZone; } if (fieldName.equals("targetInstance")) { - return String.valueOf(targetInstance); + return targetInstance; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDestinationZone() { return destinationZone; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java index 31bacf16a954..d03e13b7b481 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java @@ -17,14 +17,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,100 +83,42 @@ private InstanceProperties( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("canIpForward") && canIpForward != null) { - fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("disks") && disks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AttachedDisk item : disks) { - stringList.add(item.toString()); - } - fieldMap.put("disks", stringList.build()); - } - if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorConfig item : guestAccelerators) { - stringList.add(item.toString()); - } - fieldMap.put("guestAccelerators", stringList.build()); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("machineType") && machineType != null) { - fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); - } - if (fieldNames.contains("metadata") && metadata != null) { - fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); - } - if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { - fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); - } - if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NetworkInterface item : networkInterfaces) { - stringList.add(item.toString()); - } - fieldMap.put("networkInterfaces", stringList.build()); - } - if (fieldNames.contains("scheduling") && scheduling != null) { - fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling))); - } - if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ServiceAccount item : serviceAccounts) { - stringList.add(item.toString()); - } - fieldMap.put("serviceAccounts", stringList.build()); - } - if (fieldNames.contains("tags") && tags != null) { - fieldMap.put("tags", Collections.singletonList(String.valueOf(tags))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("canIpForward")) { - return String.valueOf(canIpForward); + return canIpForward; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("disks")) { - return String.valueOf(disks); + return disks; } if (fieldName.equals("guestAccelerators")) { - return String.valueOf(guestAccelerators); + return guestAccelerators; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("machineType")) { - return String.valueOf(machineType); + return machineType; } if (fieldName.equals("metadata")) { - return String.valueOf(metadata); + return metadata; } if (fieldName.equals("minCpuPlatform")) { - return String.valueOf(minCpuPlatform); + return minCpuPlatform; } if (fieldName.equals("networkInterfaces")) { - return String.valueOf(networkInterfaces); + return networkInterfaces; } if (fieldName.equals("scheduling")) { - return String.valueOf(scheduling); + return scheduling; } if (fieldName.equals("serviceAccounts")) { - return String.valueOf(serviceAccounts); + return serviceAccounts; } if (fieldName.equals("tags")) { - return String.valueOf(tags); + return tags; } return null; } @@ -191,6 +129,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getCanIpForward() { return canIpForward; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java index a2688b582701..c535675b686e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private InstanceReference(String instance) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instance")) { + return instance; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instance")) { - return String.valueOf(instance); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java index 0aab1348c662..acc02653fe16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,55 +61,27 @@ private InstanceTemplate( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("properties") && properties != null) { - fieldMap.put("properties", Collections.singletonList(String.valueOf(properties))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("properties")) { - return String.valueOf(properties); + return properties; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -124,6 +92,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java index 978a2165ef68..161856e0997d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InstanceTemplateList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceTemplate item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java index d5a2289c923f..76f81f42a5dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -48,34 +43,15 @@ private InstanceWithNamedPorts(String instance, List namedPorts, Stri } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("namedPorts") && namedPorts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NamedPort item : namedPorts) { - stringList.add(item.toString()); - } - fieldMap.put("namedPorts", stringList.build()); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("namedPorts")) { - return String.valueOf(namedPorts); + return namedPorts; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } return null; } @@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getInstance() { return instance; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java index a90d6ddd0e7f..44cf666578cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private InstancesScopedList(List instances, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Instance item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("instances")) { - return String.valueOf(instances); + return instances; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getInstancesList() { return instances; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java index 8f5854007be7..2cc3bef69f5e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +40,12 @@ private InstancesSetLabelsRequest(String labelFingerprint, Map l } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } return null; } @@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getLabelFingerprint() { return labelFingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java index edc382e08ae0..c6310a43d417 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstancesSetMachineResourcesRequest(List guestAcceler } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorConfig item : guestAccelerators) { - stringList.add(item.toString()); - } - fieldMap.put("guestAccelerators", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("guestAccelerators")) { + return guestAccelerators; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("guestAccelerators")) { - return String.valueOf(guestAccelerators); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java index 0fafbb310071..a62184708523 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private InstancesSetMachineTypeRequest(String machineType) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("machineType") && machineType != null) { - fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("machineType")) { + return machineType; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("machineType")) { - return String.valueOf(machineType); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java index b8a75edb1d66..dc4dc20ceb8e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private InstancesSetMinCpuPlatformRequest(String minCpuPlatform) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { - fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("minCpuPlatform")) { + return minCpuPlatform; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("minCpuPlatform")) { - return String.valueOf(minCpuPlatform); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java index 756984e0496c..0df845b9967e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private InstancesSetServiceAccountRequest(String email, List scopes) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("email") && email != null) { - fieldMap.put("email", Collections.singletonList(String.valueOf(email))); - } - if (fieldNames.contains("scopes") && scopes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : scopes) { - stringList.add(item.toString()); - } - fieldMap.put("scopes", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("email")) { - return String.valueOf(email); + return email; } if (fieldName.equals("scopes")) { - return String.valueOf(scopes); + return scopes; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getEmail() { return email; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java index 7622b603c226..c11e404ccae7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private InstancesStartWithEncryptionKeyRequest(List> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("disks") && disks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (CustomerEncryptionKeyProtectedDisk item : disks) { - stringList.add(item.toString()); - } - fieldMap.put("disks", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("disks")) { + return disks; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("disks")) { - return String.valueOf(disks); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java index 066e1fb0cea4..089b0939531e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -123,155 +118,69 @@ private Interconnect( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("adminEnabled") && adminEnabled != null) { - fieldMap.put("adminEnabled", Collections.singletonList(String.valueOf(adminEnabled))); - } - if (fieldNames.contains("circuitInfos") && circuitInfos != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InterconnectCircuitInfo item : circuitInfos) { - stringList.add(item.toString()); - } - fieldMap.put("circuitInfos", stringList.build()); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("customerName") && customerName != null) { - fieldMap.put("customerName", Collections.singletonList(String.valueOf(customerName))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("expectedOutages") && expectedOutages != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InterconnectOutageNotification item : expectedOutages) { - stringList.add(item.toString()); - } - fieldMap.put("expectedOutages", stringList.build()); - } - if (fieldNames.contains("googleIpAddress") && googleIpAddress != null) { - fieldMap.put("googleIpAddress", Collections.singletonList(String.valueOf(googleIpAddress))); - } - if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { - fieldMap.put( - "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : interconnectAttachments) { - stringList.add(item.toString()); - } - fieldMap.put("interconnectAttachments", stringList.build()); - } - if (fieldNames.contains("interconnectType") && interconnectType != null) { - fieldMap.put("interconnectType", Collections.singletonList(String.valueOf(interconnectType))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("linkType") && linkType != null) { - fieldMap.put("linkType", Collections.singletonList(String.valueOf(linkType))); - } - if (fieldNames.contains("location") && location != null) { - fieldMap.put("location", Collections.singletonList(String.valueOf(location))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("nocContactEmail") && nocContactEmail != null) { - fieldMap.put("nocContactEmail", Collections.singletonList(String.valueOf(nocContactEmail))); - } - if (fieldNames.contains("operationalStatus") && operationalStatus != null) { - fieldMap.put( - "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); - } - if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { - fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); - } - if (fieldNames.contains("provisionedLinkCount") && provisionedLinkCount != null) { - fieldMap.put( - "provisionedLinkCount", Collections.singletonList(String.valueOf(provisionedLinkCount))); - } - if (fieldNames.contains("requestedLinkCount") && requestedLinkCount != null) { - fieldMap.put( - "requestedLinkCount", Collections.singletonList(String.valueOf(requestedLinkCount))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("adminEnabled")) { - return String.valueOf(adminEnabled); + return adminEnabled; } if (fieldName.equals("circuitInfos")) { - return String.valueOf(circuitInfos); + return circuitInfos; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("customerName")) { - return String.valueOf(customerName); + return customerName; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("expectedOutages")) { - return String.valueOf(expectedOutages); + return expectedOutages; } if (fieldName.equals("googleIpAddress")) { - return String.valueOf(googleIpAddress); + return googleIpAddress; } if (fieldName.equals("googleReferenceId")) { - return String.valueOf(googleReferenceId); + return googleReferenceId; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("interconnectAttachments")) { - return String.valueOf(interconnectAttachments); + return interconnectAttachments; } if (fieldName.equals("interconnectType")) { - return String.valueOf(interconnectType); + return interconnectType; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("linkType")) { - return String.valueOf(linkType); + return linkType; } if (fieldName.equals("location")) { - return String.valueOf(location); + return location; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("nocContactEmail")) { - return String.valueOf(nocContactEmail); + return nocContactEmail; } if (fieldName.equals("operationalStatus")) { - return String.valueOf(operationalStatus); + return operationalStatus; } if (fieldName.equals("peerIpAddress")) { - return String.valueOf(peerIpAddress); + return peerIpAddress; } if (fieldName.equals("provisionedLinkCount")) { - return String.valueOf(provisionedLinkCount); + return provisionedLinkCount; } if (fieldName.equals("requestedLinkCount")) { - return String.valueOf(requestedLinkCount); + return requestedLinkCount; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -282,6 +191,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAdminEnabled() { return adminEnabled; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java index 25ad248755c8..ad6378241434 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -93,104 +89,48 @@ private InterconnectAttachment( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("cloudRouterIpAddress") && cloudRouterIpAddress != null) { - fieldMap.put( - "cloudRouterIpAddress", Collections.singletonList(String.valueOf(cloudRouterIpAddress))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("customerRouterIpAddress") && customerRouterIpAddress != null) { - fieldMap.put( - "customerRouterIpAddress", - Collections.singletonList(String.valueOf(customerRouterIpAddress))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { - fieldMap.put( - "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("interconnect") && interconnect != null) { - fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("operationalStatus") && operationalStatus != null) { - fieldMap.put( - "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); - } - if (fieldNames.contains("privateInterconnectInfo") && privateInterconnectInfo != null) { - fieldMap.put( - "privateInterconnectInfo", - Collections.singletonList(String.valueOf(privateInterconnectInfo))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("cloudRouterIpAddress")) { - return String.valueOf(cloudRouterIpAddress); + return cloudRouterIpAddress; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("customerRouterIpAddress")) { - return String.valueOf(customerRouterIpAddress); + return customerRouterIpAddress; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("googleReferenceId")) { - return String.valueOf(googleReferenceId); + return googleReferenceId; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("interconnect")) { - return String.valueOf(interconnect); + return interconnect; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("operationalStatus")) { - return String.valueOf(operationalStatus); + return operationalStatus; } if (fieldName.equals("privateInterconnectInfo")) { - return String.valueOf(privateInterconnectInfo); + return privateInterconnectInfo; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -201,6 +141,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCloudRouterIpAddress() { return cloudRouterIpAddress; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java index ef8b07654665..3bcad79216bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private InterconnectAttachmentAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java index 886515f693f0..1191157b728f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InterconnectAttachmentList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InterconnectAttachment item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java index ee63f13390c0..25728173b18d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private InterconnectAttachmentPrivateInfo(Integer tag8021q) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("tag8021q") && tag8021q != null) { - fieldMap.put("tag8021q", Collections.singletonList(String.valueOf(tag8021q))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("tag8021q")) { + return tag8021q; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("tag8021q")) { - return String.valueOf(tag8021q); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java index 82d0e16c6d6f..61be55216bf4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,28 +41,12 @@ private InterconnectAttachmentsScopedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InterconnectAttachment item : interconnectAttachments) { - stringList.add(item.toString()); - } - fieldMap.put("interconnectAttachments", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("interconnectAttachments")) { - return String.valueOf(interconnectAttachments); + return interconnectAttachments; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -78,6 +57,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getInterconnectAttachmentsList() { return interconnectAttachments; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java index 5d48c4f7d3d2..6f97b0aaf04b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -47,30 +43,15 @@ private InterconnectCircuitInfo( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("customerDemarcId") && customerDemarcId != null) { - fieldMap.put("customerDemarcId", Collections.singletonList(String.valueOf(customerDemarcId))); - } - if (fieldNames.contains("googleCircuitId") && googleCircuitId != null) { - fieldMap.put("googleCircuitId", Collections.singletonList(String.valueOf(googleCircuitId))); - } - if (fieldNames.contains("googleDemarcId") && googleDemarcId != null) { - fieldMap.put("googleDemarcId", Collections.singletonList(String.valueOf(googleDemarcId))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("customerDemarcId")) { - return String.valueOf(customerDemarcId); + return customerDemarcId; } if (fieldName.equals("googleCircuitId")) { - return String.valueOf(googleCircuitId); + return googleCircuitId; } if (fieldName.equals("googleDemarcId")) { - return String.valueOf(googleDemarcId); + return googleDemarcId; } return null; } @@ -81,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCustomerDemarcId() { return customerDemarcId; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java index a08d3dc5b512..5c472c3a5863 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InterconnectList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Interconnect item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java index 821c975a5d3e..3a5257017b1e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -95,104 +90,48 @@ private InterconnectLocation( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("availabilityZone") && availabilityZone != null) { - fieldMap.put("availabilityZone", Collections.singletonList(String.valueOf(availabilityZone))); - } - if (fieldNames.contains("city") && city != null) { - fieldMap.put("city", Collections.singletonList(String.valueOf(city))); - } - if (fieldNames.contains("continent") && continent != null) { - fieldMap.put("continent", Collections.singletonList(String.valueOf(continent))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("facilityProvider") && facilityProvider != null) { - fieldMap.put("facilityProvider", Collections.singletonList(String.valueOf(facilityProvider))); - } - if (fieldNames.contains("facilityProviderFacilityId") && facilityProviderFacilityId != null) { - fieldMap.put( - "facilityProviderFacilityId", - Collections.singletonList(String.valueOf(facilityProviderFacilityId))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("peeringdbFacilityId") && peeringdbFacilityId != null) { - fieldMap.put( - "peeringdbFacilityId", Collections.singletonList(String.valueOf(peeringdbFacilityId))); - } - if (fieldNames.contains("regionInfos") && regionInfos != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InterconnectLocationRegionInfo item : regionInfos) { - stringList.add(item.toString()); - } - fieldMap.put("regionInfos", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("availabilityZone")) { - return String.valueOf(availabilityZone); + return availabilityZone; } if (fieldName.equals("city")) { - return String.valueOf(city); + return city; } if (fieldName.equals("continent")) { - return String.valueOf(continent); + return continent; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("facilityProvider")) { - return String.valueOf(facilityProvider); + return facilityProvider; } if (fieldName.equals("facilityProviderFacilityId")) { - return String.valueOf(facilityProviderFacilityId); + return facilityProviderFacilityId; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("peeringdbFacilityId")) { - return String.valueOf(peeringdbFacilityId); + return peeringdbFacilityId; } if (fieldName.equals("regionInfos")) { - return String.valueOf(regionInfos); + return regionInfos; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -203,6 +142,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAddress() { return address; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java index 21efdc1eaa2b..bc9871314b16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private InterconnectLocationList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InterconnectLocation item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java index 2046dd98aef0..42a3f98eee06 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -47,30 +43,15 @@ private InterconnectLocationRegionInfo( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("expectedRttMs") && expectedRttMs != null) { - fieldMap.put("expectedRttMs", Collections.singletonList(String.valueOf(expectedRttMs))); - } - if (fieldNames.contains("locationPresence") && locationPresence != null) { - fieldMap.put("locationPresence", Collections.singletonList(String.valueOf(locationPresence))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("expectedRttMs")) { - return String.valueOf(expectedRttMs); + return expectedRttMs; } if (fieldName.equals("locationPresence")) { - return String.valueOf(locationPresence); + return locationPresence; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } return null; } @@ -81,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getExpectedRttMs() { return expectedRttMs; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java index ba87f2fb6546..8be3ef264b6a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -71,64 +66,30 @@ private InterconnectOutageNotification( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("affectedCircuits") && affectedCircuits != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : affectedCircuits) { - stringList.add(item.toString()); - } - fieldMap.put("affectedCircuits", stringList.build()); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("endTime") && endTime != null) { - fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime))); - } - if (fieldNames.contains("issueType") && issueType != null) { - fieldMap.put("issueType", Collections.singletonList(String.valueOf(issueType))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("source") && source != null) { - fieldMap.put("source", Collections.singletonList(String.valueOf(source))); - } - if (fieldNames.contains("startTime") && startTime != null) { - fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime))); - } - if (fieldNames.contains("state") && state != null) { - fieldMap.put("state", Collections.singletonList(String.valueOf(state))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("affectedCircuits")) { - return String.valueOf(affectedCircuits); + return affectedCircuits; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("endTime")) { - return String.valueOf(endTime); + return endTime; } if (fieldName.equals("issueType")) { - return String.valueOf(issueType); + return issueType; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("source")) { - return String.valueOf(source); + return source; } if (fieldName.equals("startTime")) { - return String.valueOf(startTime); + return startTime; } if (fieldName.equals("state")) { - return String.valueOf(state); + return state; } return null; } @@ -139,6 +100,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAffectedCircuitsList() { return affectedCircuits; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java index 264ee694bb6f..28e219f33b54 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private InvalidateCacheUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("cacheInvalidationRuleResource") - && cacheInvalidationRuleResource != null) { - fieldMap.put( - "cacheInvalidationRuleResource", - Collections.singletonList(String.valueOf(cacheInvalidationRuleResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("cacheInvalidationRuleResource")) { - return String.valueOf(cacheInvalidationRuleResource); + return cacheInvalidationRuleResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public CacheInvalidationRule getApiMessageRequestBody() { return cacheInvalidationRuleResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java index d405d453faa1..17ebac93eda3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private Items(String key, String value) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("value") && value != null) { - fieldMap.put("value", Collections.singletonList(String.valueOf(value))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("value")) { - return String.valueOf(value); + return value; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKey() { return key; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java index 4e0c9b885395..e25f2f6337ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private License( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("chargesUseFee") && chargesUseFee != null) { - fieldMap.put("chargesUseFee", Collections.singletonList(String.valueOf(chargesUseFee))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("licenseCode") && licenseCode != null) { - fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("resourceRequirements") && resourceRequirements != null) { - fieldMap.put( - "resourceRequirements", Collections.singletonList(String.valueOf(resourceRequirements))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("transferable") && transferable != null) { - fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("chargesUseFee")) { - return String.valueOf(chargesUseFee); + return chargesUseFee; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("licenseCode")) { - return String.valueOf(licenseCode); + return licenseCode; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("resourceRequirements")) { - return String.valueOf(resourceRequirements); + return resourceRequirements; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("transferable")) { - return String.valueOf(transferable); + return transferable; } return null; } @@ -155,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getChargesUseFee() { return chargesUseFee; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java index 5752223ce642..6829da3cd60a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,71 +70,33 @@ private LicenseCode( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("licenseAlias") && licenseAlias != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (LicenseCodeLicenseAlias item : licenseAlias) { - stringList.add(item.toString()); - } - fieldMap.put("licenseAlias", stringList.build()); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("state") && state != null) { - fieldMap.put("state", Collections.singletonList(String.valueOf(state))); - } - if (fieldNames.contains("transferable") && transferable != null) { - fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("licenseAlias")) { - return String.valueOf(licenseAlias); + return licenseAlias; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("state")) { - return String.valueOf(state); + return state; } if (fieldName.equals("transferable")) { - return String.valueOf(transferable); + return transferable; } return null; } @@ -150,6 +107,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java index 0a6acb8c0f41..96b3ef8ec210 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private LicenseCodeLicenseAlias(String description, String selfLink) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDescription() { return description; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java index 40228b44df36..a71e1505a4fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private LicenseResourceRequirements(Integer minGuestCpuCount, Integer minMemoryM } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("minGuestCpuCount") && minGuestCpuCount != null) { - fieldMap.put("minGuestCpuCount", Collections.singletonList(String.valueOf(minGuestCpuCount))); - } - if (fieldNames.contains("minMemoryMb") && minMemoryMb != null) { - fieldMap.put("minMemoryMb", Collections.singletonList(String.valueOf(minMemoryMb))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("minGuestCpuCount")) { - return String.valueOf(minGuestCpuCount); + return minGuestCpuCount; } if (fieldName.equals("minMemoryMb")) { - return String.valueOf(minMemoryMb); + return minMemoryMb; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getMinGuestCpuCount() { return minGuestCpuCount; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java index c26fff8ac1bd..5af927bb3672 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -55,46 +50,21 @@ private LicensesListResponse( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (License item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -105,6 +75,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java index 5059c1664405..24f88896d771 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListAcceleratorTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java index f49ce42acd49..5198a60931af 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListAddressesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java index 754c7ec43bc7..05568ecd5361 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListAutoscalersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java index 370573626da8..fc751f1a6f53 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListAvailableFeaturesSslPoliciesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java index 2831420c3b72..b84e53222541 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListBackendBucketsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java index 4468629a8f8b..7e49314be6fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListBackendServicesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java index 463aaa944660..bb16c2b40bd0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListDiskTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java index d1c92e50b928..b19f5c74f988 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListDisksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java index 8d901b420a57..b3ba0d38e97a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListFirewallsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java index a37aeed865f1..52b8e7afc873 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListForwardingRulesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java index bd891abd7674..777d19f94c6a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListGlobalAddressesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java index 5ff5a403047b..77462c526914 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListGlobalForwardingRulesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java index b05ed6fcb18a..07c6f18f4f6f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListGlobalOperationsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java index c089be938173..42de29469cc8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListHealthChecksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java index b46175cf9aea..34a50eb3eb7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListHttpHealthChecksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java index 7e37b6d7686d..f56ff8f78216 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListHttpsHealthChecksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java index 2871c11599ab..faf12f63e32b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListImagesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java index 4a3a8e3174c2..bed894d85107 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInstanceGroupManagersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java index 065f8f3f7726..30d061945370 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInstanceGroupsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java index 3dff877bf30d..66421b27a04e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInstanceTemplatesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java index 35744f497336..1067060d2659 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java index 3b4ef6048d60..b9c536de1722 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -89,93 +85,45 @@ private ListInstancesInstanceGroupsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("instanceGroupsListInstancesRequestResource") - && instanceGroupsListInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupsListInstancesRequestResource", - Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("instanceGroupsListInstancesRequestResource")) { - return String.valueOf(instanceGroupsListInstancesRequestResource); + return instanceGroupsListInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -186,6 +134,12 @@ public InstanceGroupsListInstancesRequest getApiMessageRequestBody() { return instanceGroupsListInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java index 78bfd32bbd0a..b349cdf74f05 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,94 +87,45 @@ private ListInstancesRegionInstanceGroupsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupsListInstancesRequestResource") - && regionInstanceGroupsListInstancesRequestResource != null) { - fieldMap.put( - "regionInstanceGroupsListInstancesRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupsListInstancesRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupsListInstancesRequestResource")) { - return String.valueOf(regionInstanceGroupsListInstancesRequestResource); + return regionInstanceGroupsListInstancesRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -189,6 +136,12 @@ public RegionInstanceGroupsListInstancesRequest getApiMessageRequestBody() { return regionInstanceGroupsListInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java index 4314af4017c7..ea3f0319af05 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInterconnectAttachmentsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java index 35b25d7679e5..6765ca3f254b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInterconnectLocationsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java index a8099c0b40ec..cef9d8e5fd1d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListInterconnectsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java index 965e04fc88f5..5a8550d8c53e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListLicensesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java index 1c468d4aab5f..b93f7892d350 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListMachineTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java index fd91b32e5133..4a6b155aa537 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,85 +81,42 @@ private ListManagedInstancesInstanceGroupManagersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -174,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java index 38a4ca194dff..c54915618126 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -86,85 +82,42 @@ private ListManagedInstancesRegionInstanceGroupManagersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -175,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java index 3833c085e618..db9d798b5793 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListNetworksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java index fecf7b8aac5b..0864085f101e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListReferrersInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java index fa2545c4b03d..9acb39fccbaf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionAutoscalersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java index 584dc381f80e..39c3159dbb73 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionBackendServicesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java index 4a991b0cb9c2..af22bce70777 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionCommitmentsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java index ce71d45770a6..49dec8728e7e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionInstanceGroupManagersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java index 22da113346da..273834703ead 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionInstanceGroupsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java index 371fc05e0284..1ec0e417def9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionOperationsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java index 4f87e0ad4103..1854141ffced 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRegionsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java index 2a4e4adb9262..01ef08ef554a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRoutersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java index 766e05a72202..bd78370554b0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListRoutesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java index c6fb14db309c..e9c265a28f91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListSnapshotsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java index 7df078c07b2f..b099c7588532 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListSslCertificatesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java index 4e8674f51aa7..ff1727df14a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListSslPoliciesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java index 30ba879d6c92..ee1517a229e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListSubnetworksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java index 103aaf931bfb..fe7bf148cdba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetHttpProxiesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java index 530a1db7d30f..7911a4a7f758 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetHttpsProxiesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java index d0573cfc9162..643f3ab4322f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java index 758a7b8191a6..5effff1cc334 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetPoolsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java index 468717b78089..eb79d63ca80d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetSslProxiesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java index 2ac3f7bd32c6..1f80fe35142d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetTcpProxiesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java index db242544a50d..0e017f6edd2b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListTargetVpnGatewaysHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java index 553367d73cd3..4173d3714524 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListUrlMapsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java index d269ea2a36aa..6d1142436e0a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListVpnTunnelsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java index 0419581ecf6d..c25ffe2c79dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -89,93 +85,45 @@ private ListXpnHostsProjectsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("projectsListXpnHostsRequestResource") - && projectsListXpnHostsRequestResource != null) { - fieldMap.put( - "projectsListXpnHostsRequestResource", - Collections.singletonList(String.valueOf(projectsListXpnHostsRequestResource))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("projectsListXpnHostsRequestResource")) { - return String.valueOf(projectsListXpnHostsRequestResource); + return projectsListXpnHostsRequestResource; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -186,6 +134,12 @@ public ProjectsListXpnHostsRequest getApiMessageRequestBody() { return projectsListXpnHostsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java index 9ecdd6e33fd3..7c6f29c1f4e0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListZoneOperationsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java index 7054df81e8f0..1c49589566a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private ListZonesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java index c85c7f8f01bf..1cfb5c318521 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -99,112 +94,51 @@ private MachineType( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("guestCpus") && guestCpus != null) { - fieldMap.put("guestCpus", Collections.singletonList(String.valueOf(guestCpus))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("imageSpaceGb") && imageSpaceGb != null) { - fieldMap.put("imageSpaceGb", Collections.singletonList(String.valueOf(imageSpaceGb))); - } - if (fieldNames.contains("isSharedCpu") && isSharedCpu != null) { - fieldMap.put("isSharedCpu", Collections.singletonList(String.valueOf(isSharedCpu))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("maximumPersistentDisks") && maximumPersistentDisks != null) { - fieldMap.put( - "maximumPersistentDisks", - Collections.singletonList(String.valueOf(maximumPersistentDisks))); - } - if (fieldNames.contains("maximumPersistentDisksSizeGb") - && maximumPersistentDisksSizeGb != null) { - fieldMap.put( - "maximumPersistentDisksSizeGb", - Collections.singletonList(String.valueOf(maximumPersistentDisksSizeGb))); - } - if (fieldNames.contains("memoryMb") && memoryMb != null) { - fieldMap.put("memoryMb", Collections.singletonList(String.valueOf(memoryMb))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("scratchDisks") && scratchDisks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ScratchDisks item : scratchDisks) { - stringList.add(item.toString()); - } - fieldMap.put("scratchDisks", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("guestCpus")) { - return String.valueOf(guestCpus); + return guestCpus; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("imageSpaceGb")) { - return String.valueOf(imageSpaceGb); + return imageSpaceGb; } if (fieldName.equals("isSharedCpu")) { - return String.valueOf(isSharedCpu); + return isSharedCpu; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("maximumPersistentDisks")) { - return String.valueOf(maximumPersistentDisks); + return maximumPersistentDisks; } if (fieldName.equals("maximumPersistentDisksSizeGb")) { - return String.valueOf(maximumPersistentDisksSizeGb); + return maximumPersistentDisksSizeGb; } if (fieldName.equals("memoryMb")) { - return String.valueOf(memoryMb); + return memoryMb; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("scratchDisks")) { - return String.valueOf(scratchDisks); + return scratchDisks; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -215,6 +149,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java index 9f950f37c44a..2aea9edf43de 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private MachineTypeAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java index 89d1b36936cb..e0fe295eb4bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private MachineTypeList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (MachineType item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java index 2f41edbc6d61..e9508a1838d6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private MachineTypesScopedList(List machineTypes, Warning warning) } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("machineTypes") && machineTypes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (MachineType item : machineTypes) { - stringList.add(item.toString()); - } - fieldMap.put("machineTypes", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("machineTypes")) { - return String.valueOf(machineTypes); + return machineTypes; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getMachineTypesList() { return machineTypes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java index f496bf31d2c4..29e6d18ac983 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -57,42 +53,21 @@ private ManagedInstance( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("currentAction") && currentAction != null) { - fieldMap.put("currentAction", Collections.singletonList(String.valueOf(currentAction))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instanceStatus") && instanceStatus != null) { - fieldMap.put("instanceStatus", Collections.singletonList(String.valueOf(instanceStatus))); - } - if (fieldNames.contains("lastAttempt") && lastAttempt != null) { - fieldMap.put("lastAttempt", Collections.singletonList(String.valueOf(lastAttempt))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("currentAction")) { - return String.valueOf(currentAction); + return currentAction; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instanceStatus")) { - return String.valueOf(instanceStatus); + return instanceStatus; } if (fieldName.equals("lastAttempt")) { - return String.valueOf(lastAttempt); + return lastAttempt; } return null; } @@ -103,6 +78,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCurrentAction() { return currentAction; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java index 0398c6007add..a6c4ddf12359 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private ManagedInstanceLastAttempt(Errors errors) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("errors") && errors != null) { - fieldMap.put("errors", Collections.singletonList(String.valueOf(errors))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("errors")) { + return errors; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("errors")) { - return String.valueOf(errors); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java index 95c758ea3f70..df0f5847fa27 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -48,34 +43,15 @@ private Metadata(String fingerprint, List items, String kind) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Items item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } return null; } @@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java index 5605995652de..c95d807b2326 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private MoveDiskProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("diskMoveRequestResource") && diskMoveRequestResource != null) { - fieldMap.put( - "diskMoveRequestResource", - Collections.singletonList(String.valueOf(diskMoveRequestResource))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("diskMoveRequestResource")) { - return String.valueOf(diskMoveRequestResource); + return diskMoveRequestResource; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public DiskMoveRequest getApiMessageRequestBody() { return diskMoveRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java index f370b4161b53..63cd98cdf273 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private MoveInstanceProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceMoveRequestResource") && instanceMoveRequestResource != null) { - fieldMap.put( - "instanceMoveRequestResource", - Collections.singletonList(String.valueOf(instanceMoveRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceMoveRequestResource")) { - return String.valueOf(instanceMoveRequestResource); + return instanceMoveRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public InstanceMoveRequest getApiMessageRequestBody() { return instanceMoveRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java index 2d5d450c6dd7..00a11aaee175 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private NamedPort(String name, Integer port) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getName() { return name; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java index 48da3336168b..4ce606f5aa81 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,95 +82,42 @@ private Network( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoCreateSubnetworks") && autoCreateSubnetworks != null) { - fieldMap.put( - "autoCreateSubnetworks", - Collections.singletonList(String.valueOf(autoCreateSubnetworks))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("gatewayIPv4") && gatewayIPv4 != null) { - fieldMap.put("gatewayIPv4", Collections.singletonList(String.valueOf(gatewayIPv4))); - } - if (fieldNames.contains("iPv4Range") && iPv4Range != null) { - fieldMap.put("iPv4Range", Collections.singletonList(String.valueOf(iPv4Range))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("peerings") && peerings != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NetworkPeering item : peerings) { - stringList.add(item.toString()); - } - fieldMap.put("peerings", stringList.build()); - } - if (fieldNames.contains("routingConfig") && routingConfig != null) { - fieldMap.put("routingConfig", Collections.singletonList(String.valueOf(routingConfig))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("subnetworks") && subnetworks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : subnetworks) { - stringList.add(item.toString()); - } - fieldMap.put("subnetworks", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoCreateSubnetworks")) { - return String.valueOf(autoCreateSubnetworks); + return autoCreateSubnetworks; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("gatewayIPv4")) { - return String.valueOf(gatewayIPv4); + return gatewayIPv4; } if (fieldName.equals("iPv4Range")) { - return String.valueOf(iPv4Range); + return iPv4Range; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("peerings")) { - return String.valueOf(peerings); + return peerings; } if (fieldName.equals("routingConfig")) { - return String.valueOf(routingConfig); + return routingConfig; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("subnetworks")) { - return String.valueOf(subnetworks); + return subnetworks; } return null; } @@ -186,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAutoCreateSubnetworks() { return autoCreateSubnetworks; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java index cf8da9d0ed2f..52c668ae9840 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -71,68 +66,30 @@ private NetworkInterface( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("accessConfigs") && accessConfigs != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AccessConfig item : accessConfigs) { - stringList.add(item.toString()); - } - fieldMap.put("accessConfigs", stringList.build()); - } - if (fieldNames.contains("aliasIpRanges") && aliasIpRanges != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AliasIpRange item : aliasIpRanges) { - stringList.add(item.toString()); - } - fieldMap.put("aliasIpRanges", stringList.build()); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("networkIP") && networkIP != null) { - fieldMap.put("networkIP", Collections.singletonList(String.valueOf(networkIP))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("accessConfigs")) { - return String.valueOf(accessConfigs); + return accessConfigs; } if (fieldName.equals("aliasIpRanges")) { - return String.valueOf(aliasIpRanges); + return aliasIpRanges; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("networkIP")) { - return String.valueOf(networkIP); + return networkIP; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } return null; } @@ -143,6 +100,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAccessConfigsList() { return accessConfigs; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java index b2cf2cdf80e1..7173c819e1c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private NetworkList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Network item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java index 0d6bdca5b111..358916af8b13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,42 +49,21 @@ private NetworkPeering( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) { - fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("state") && state != null) { - fieldMap.put("state", Collections.singletonList(String.valueOf(state))); - } - if (fieldNames.contains("stateDetails") && stateDetails != null) { - fieldMap.put("stateDetails", Collections.singletonList(String.valueOf(stateDetails))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoCreateRoutes")) { - return String.valueOf(autoCreateRoutes); + return autoCreateRoutes; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("state")) { - return String.valueOf(state); + return state; } if (fieldName.equals("stateDetails")) { - return String.valueOf(stateDetails); + return stateDetails; } return null; } @@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java index ee9f3c89ec24..fee7e20c4536 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private NetworkRoutingConfig(String routingMode) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("routingMode") && routingMode != null) { - fieldMap.put("routingMode", Collections.singletonList(String.valueOf(routingMode))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("routingMode")) { + return routingMode; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("routingMode")) { - return String.valueOf(routingMode); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java index a964e5b5c782..c70d12129013 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,30 +42,15 @@ private NetworksAddPeeringRequest(Boolean autoCreateRoutes, String name, String } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) { - fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("peerNetwork") && peerNetwork != null) { - fieldMap.put("peerNetwork", Collections.singletonList(String.valueOf(peerNetwork))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoCreateRoutes")) { - return String.valueOf(autoCreateRoutes); + return autoCreateRoutes; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("peerNetwork")) { - return String.valueOf(peerNetwork); + return peerNetwork; } return null; } @@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java index cf35ffa8be25..397a37cef130 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private NetworksRemovePeeringRequest(String name) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("name")) { + return name; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("name")) { - return String.valueOf(name); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java index 1c4bfddfdd70..1ce06a104dea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -131,157 +126,75 @@ private Operation( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("clientOperationId") && clientOperationId != null) { - fieldMap.put( - "clientOperationId", Collections.singletonList(String.valueOf(clientOperationId))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("endTime") && endTime != null) { - fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime))); - } - if (fieldNames.contains("error") && error != null) { - fieldMap.put("error", Collections.singletonList(String.valueOf(error))); - } - if (fieldNames.contains("httpErrorMessage") && httpErrorMessage != null) { - fieldMap.put("httpErrorMessage", Collections.singletonList(String.valueOf(httpErrorMessage))); - } - if (fieldNames.contains("httpErrorStatusCode") && httpErrorStatusCode != null) { - fieldMap.put( - "httpErrorStatusCode", Collections.singletonList(String.valueOf(httpErrorStatusCode))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("insertTime") && insertTime != null) { - fieldMap.put("insertTime", Collections.singletonList(String.valueOf(insertTime))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("operationType") && operationType != null) { - fieldMap.put("operationType", Collections.singletonList(String.valueOf(operationType))); - } - if (fieldNames.contains("progress") && progress != null) { - fieldMap.put("progress", Collections.singletonList(String.valueOf(progress))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("startTime") && startTime != null) { - fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("statusMessage") && statusMessage != null) { - fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); - } - if (fieldNames.contains("targetId") && targetId != null) { - fieldMap.put("targetId", Collections.singletonList(String.valueOf(targetId))); - } - if (fieldNames.contains("targetLink") && targetLink != null) { - fieldMap.put("targetLink", Collections.singletonList(String.valueOf(targetLink))); - } - if (fieldNames.contains("user") && user != null) { - fieldMap.put("user", Collections.singletonList(String.valueOf(user))); - } - if (fieldNames.contains("warnings") && warnings != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Warnings item : warnings) { - stringList.add(item.toString()); - } - fieldMap.put("warnings", stringList.build()); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("clientOperationId")) { - return String.valueOf(clientOperationId); + return clientOperationId; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("endTime")) { - return String.valueOf(endTime); + return endTime; } if (fieldName.equals("error")) { - return String.valueOf(error); + return error; } if (fieldName.equals("httpErrorMessage")) { - return String.valueOf(httpErrorMessage); + return httpErrorMessage; } if (fieldName.equals("httpErrorStatusCode")) { - return String.valueOf(httpErrorStatusCode); + return httpErrorStatusCode; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("insertTime")) { - return String.valueOf(insertTime); + return insertTime; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("operationType")) { - return String.valueOf(operationType); + return operationType; } if (fieldName.equals("progress")) { - return String.valueOf(progress); + return progress; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("startTime")) { - return String.valueOf(startTime); + return startTime; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("statusMessage")) { - return String.valueOf(statusMessage); + return statusMessage; } if (fieldName.equals("targetId")) { - return String.valueOf(targetId); + return targetId; } if (fieldName.equals("targetLink")) { - return String.valueOf(targetLink); + return targetLink; } if (fieldName.equals("user")) { - return String.valueOf(user); + return user; } if (fieldName.equals("warnings")) { - return String.valueOf(warnings); + return warnings; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -292,6 +205,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getClientOperationId() { return clientOperationId; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java index 5c7fa68a5c07..29bdd2229966 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private OperationAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java index d48e70e4f295..f02a5fb2cd7d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private OperationList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Operation item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java index 9fff272b34bb..b6ce075a7325 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private OperationsScopedList(List operations, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("operations") && operations != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Operation item : operations) { - stringList.add(item.toString()); - } - fieldMap.put("operations", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("operations")) { - return String.valueOf(operations); + return operations; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getOperationsList() { return operations; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index e1b438e32537..2e31d4cd8932 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private PatchAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("autoscalerResource")) { - return String.valueOf(autoscalerResource); + return autoscalerResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -164,6 +120,12 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java index 89a83330fd88..f343b79942ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private PatchBackendBucketHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendBucket") && backendBucket != null) { - fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); - } - if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { - fieldMap.put( - "backendBucketResource", - Collections.singletonList(String.valueOf(backendBucketResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendBucket")) { - return String.valueOf(backendBucket); + return backendBucket; } if (fieldName.equals("backendBucketResource")) { - return String.valueOf(backendBucketResource); + return backendBucketResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendBucket getApiMessageRequestBody() { return backendBucketResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index 63c92c498405..c1a687e81c9e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private PatchBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put( - "backendServiceResource", - Collections.singletonList(String.valueOf(backendServiceResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("backendServiceResource")) { - return String.valueOf(backendServiceResource); + return backendServiceResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index 4a7c2fae0014..a8f1482c4973 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private PatchFirewallHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("firewall") && firewall != null) { - fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); - } - if (fieldNames.contains("firewallResource") && firewallResource != null) { - fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("firewall")) { - return String.valueOf(firewall); + return firewall; } if (fieldName.equals("firewallResource")) { - return String.valueOf(firewallResource); + return firewallResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Firewall getApiMessageRequestBody() { return firewallResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index 069a5579dae6..eb9564db903a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private PatchHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("healthCheck") && healthCheck != null) { - fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); - } - if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { - fieldMap.put( - "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("healthCheck")) { - return String.valueOf(healthCheck); + return healthCheck; } if (fieldName.equals("healthCheckResource")) { - return String.valueOf(healthCheckResource); + return healthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public HealthCheck getApiMessageRequestBody() { return healthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index 5d21363c4307..03fdfe2d1eab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -33,7 +29,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpHealthCheck; - private final HttpHealthCheck2 httpHealthCheckResource; + private final HttpHealthCheck httpHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +54,7 @@ private PatchHttpHealthCheckHttpRequest( String callback, String fields, String httpHealthCheck, - HttpHealthCheck2 httpHealthCheckResource, + HttpHealthCheck httpHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -77,84 +73,52 @@ private PatchHttpHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { - fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); - } - if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { - fieldMap.put( - "httpHealthCheckResource", - Collections.singletonList(String.valueOf(httpHealthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpHealthCheck")) { - return String.valueOf(httpHealthCheck); + return httpHealthCheck; } if (fieldName.equals("httpHealthCheckResource")) { - return String.valueOf(httpHealthCheckResource); + return httpHealthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @Nullable @Override - public HttpHealthCheck2 getApiMessageRequestBody() { + public HttpHealthCheck getApiMessageRequestBody() { return httpHealthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } @@ -171,7 +135,7 @@ public String getHttpHealthCheck() { return httpHealthCheck; } - public HttpHealthCheck2 getHttpHealthCheckResource() { + public HttpHealthCheck getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -222,7 +186,7 @@ public static class Builder { private String callback; private String fields; private String httpHealthCheck; - private HttpHealthCheck2 httpHealthCheckResource; + private HttpHealthCheck httpHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +279,11 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { return this; } - public HttpHealthCheck2 getHttpHealthCheckResource() { + public HttpHealthCheck getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index fe2a163ad132..360d9a9499e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -33,7 +29,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpsHealthCheck; - private final HttpsHealthCheck2 httpsHealthCheckResource; + private final HttpsHealthCheck httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +54,7 @@ private PatchHttpsHealthCheckHttpRequest( String callback, String fields, String httpsHealthCheck, - HttpsHealthCheck2 httpsHealthCheckResource, + HttpsHealthCheck httpsHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -77,84 +73,52 @@ private PatchHttpsHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { - fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); - } - if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { - fieldMap.put( - "httpsHealthCheckResource", - Collections.singletonList(String.valueOf(httpsHealthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpsHealthCheck")) { - return String.valueOf(httpsHealthCheck); + return httpsHealthCheck; } if (fieldName.equals("httpsHealthCheckResource")) { - return String.valueOf(httpsHealthCheckResource); + return httpsHealthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @Nullable @Override - public HttpsHealthCheck2 getApiMessageRequestBody() { + public HttpsHealthCheck getApiMessageRequestBody() { return httpsHealthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } @@ -171,7 +135,7 @@ public String getHttpsHealthCheck() { return httpsHealthCheck; } - public HttpsHealthCheck2 getHttpsHealthCheckResource() { + public HttpsHealthCheck getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -222,7 +186,7 @@ public static class Builder { private String callback; private String fields; private String httpsHealthCheck; - private HttpsHealthCheck2 httpsHealthCheckResource; + private HttpsHealthCheck httpsHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +279,11 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { return this; } - public HttpsHealthCheck2 getHttpsHealthCheckResource() { + public HttpsHealthCheck getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java index 74192f22a4b8..8cc931e6dde9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private PatchInterconnectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("interconnect") && interconnect != null) { - fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); - } - if (fieldNames.contains("interconnectResource") && interconnectResource != null) { - fieldMap.put( - "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("interconnect")) { - return String.valueOf(interconnect); + return interconnect; } if (fieldName.equals("interconnectResource")) { - return String.valueOf(interconnectResource); + return interconnectResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Interconnect getApiMessageRequestBody() { return interconnectResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java index 2d9202c8cc87..0a47cb60cb11 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private PatchNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("networkResource") && networkResource != null) { - fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("networkResource")) { - return String.valueOf(networkResource); + return networkResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Network getApiMessageRequestBody() { return networkResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index dd3d15c4d300..d42c3b0f6551 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private PatchRegionAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("autoscalerResource")) { - return String.valueOf(autoscalerResource); + return autoscalerResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -164,6 +120,12 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index 62ac1effe9c8..c6750c744f4a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private PatchRegionBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put( - "backendServiceResource", - Collections.singletonList(String.valueOf(backendServiceResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("backendServiceResource")) { - return String.valueOf(backendServiceResource); + return backendServiceResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index 5162364dd1b7..99021e9ae0f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private PatchRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("routerResource") && routerResource != null) { - fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("routerResource")) { - return String.valueOf(routerResource); + return routerResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Router getApiMessageRequestBody() { return routerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java index a026878f2905..cee67ac3c292 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private PatchSslPolicyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslPolicy") && sslPolicy != null) { - fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); - } - if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) { - fieldMap.put( - "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslPolicy")) { - return String.valueOf(sslPolicy); + return sslPolicy; } if (fieldName.equals("sslPolicyResource")) { - return String.valueOf(sslPolicyResource); + return sslPolicyResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public SslPolicy getApiMessageRequestBody() { return sslPolicyResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java index a95f50f20073..da4a7c4a818b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private PatchSubnetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { - fieldMap.put( - "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("subnetworkResource")) { - return String.valueOf(subnetworkResource); + return subnetworkResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Subnetwork getApiMessageRequestBody() { return subnetworkResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index 4a4afacb909a..ea5c54ae43f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private PatchUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - if (fieldNames.contains("urlMapResource") && urlMapResource != null) { - fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } if (fieldName.equals("urlMapResource")) { - return String.valueOf(urlMapResource); + return urlMapResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public UrlMap getApiMessageRequestBody() { return urlMapResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java index 07f69275395b..2afb86aaf9a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -52,40 +47,18 @@ private PathMatcher( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("defaultService") && defaultService != null) { - fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("pathRules") && pathRules != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (PathRule item : pathRules) { - stringList.add(item.toString()); - } - fieldMap.put("pathRules", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("defaultService")) { - return String.valueOf(defaultService); + return defaultService; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("pathRules")) { - return String.valueOf(pathRules); + return pathRules; } return null; } @@ -96,6 +69,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDefaultService() { return defaultService; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java index 968ee3b56b68..88bbf46bf25a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private PathRule(List paths, String service) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("paths") && paths != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : paths) { - stringList.add(item.toString()); - } - fieldMap.put("paths", stringList.build()); - } - if (fieldNames.contains("service") && service != null) { - fieldMap.put("service", Collections.singletonList(String.valueOf(service))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("paths")) { - return String.valueOf(paths); + return paths; } if (fieldName.equals("service")) { - return String.valueOf(service); + return service; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getPathsList() { return paths; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java index abbed54809b7..c27d00c0cf1b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private PreviewRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("routerResource") && routerResource != null) { - fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("routerResource")) { - return String.valueOf(routerResource); + return routerResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public Router getApiMessageRequestBody() { return routerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java index c39ee68b0057..e3522dc027f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,98 +82,42 @@ private Project( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("commonInstanceMetadata") && commonInstanceMetadata != null) { - fieldMap.put( - "commonInstanceMetadata", - Collections.singletonList(String.valueOf(commonInstanceMetadata))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("defaultServiceAccount") && defaultServiceAccount != null) { - fieldMap.put( - "defaultServiceAccount", - Collections.singletonList(String.valueOf(defaultServiceAccount))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : enabledFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("enabledFeatures", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("quotas") && quotas != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Quota item : quotas) { - stringList.add(item.toString()); - } - fieldMap.put("quotas", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("usageExportLocation") && usageExportLocation != null) { - fieldMap.put( - "usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation))); - } - if (fieldNames.contains("xpnProjectStatus") && xpnProjectStatus != null) { - fieldMap.put("xpnProjectStatus", Collections.singletonList(String.valueOf(xpnProjectStatus))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("commonInstanceMetadata")) { - return String.valueOf(commonInstanceMetadata); + return commonInstanceMetadata; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("defaultServiceAccount")) { - return String.valueOf(defaultServiceAccount); + return defaultServiceAccount; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("enabledFeatures")) { - return String.valueOf(enabledFeatures); + return enabledFeatures; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("quotas")) { - return String.valueOf(quotas); + return quotas; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("usageExportLocation")) { - return String.valueOf(usageExportLocation); + return usageExportLocation; } if (fieldName.equals("xpnProjectStatus")) { - return String.valueOf(xpnProjectStatus); + return xpnProjectStatus; } return null; } @@ -189,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Metadata getCommonInstanceMetadata() { return commonInstanceMetadata; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java index 2d2681b02469..cfdf2021f2d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private ProjectsDisableXpnResourceRequest(XpnResourceId xpnResource) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("xpnResource") && xpnResource != null) { - fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("xpnResource")) { + return xpnResource; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("xpnResource")) { - return String.valueOf(xpnResource); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java index 93d202170c86..6711dcfed506 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private ProjectsEnableXpnResourceRequest(XpnResourceId xpnResource) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("xpnResource") && xpnResource != null) { - fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("xpnResource")) { + return xpnResource; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("xpnResource")) { - return String.valueOf(xpnResource); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java index 03735a00d02e..3a9c24aaf12d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,34 +44,15 @@ private ProjectsGetXpnResources( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("resources") && resources != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (XpnResourceId item : resources) { - stringList.add(item.toString()); - } - fieldMap.put("resources", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("resources")) { - return String.valueOf(resources); + return resources; } return null; } @@ -87,6 +63,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java index 15a07bb7ad48..9f5602b43fc6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private ProjectsListXpnHostsRequest(String organization) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("organization") && organization != null) { - fieldMap.put("organization", Collections.singletonList(String.valueOf(organization))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("organization")) { + return organization; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("organization")) { - return String.valueOf(organization); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java index bec535da0955..0001cdcba466 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,30 +42,15 @@ private Quota(Double limit, String metric, Double usage) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("limit") && limit != null) { - fieldMap.put("limit", Collections.singletonList(String.valueOf(limit))); - } - if (fieldNames.contains("metric") && metric != null) { - fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); - } - if (fieldNames.contains("usage") && usage != null) { - fieldMap.put("usage", Collections.singletonList(String.valueOf(usage))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("limit")) { - return String.valueOf(limit); + return limit; } if (fieldName.equals("metric")) { - return String.valueOf(metric); + return metric; } if (fieldName.equals("usage")) { - return String.valueOf(usage); + return usage; } return null; } @@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Double getLimit() { return limit; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java index f40843794cd0..e32d17996fb1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,30 +42,15 @@ private RawDisk(String containerType, String sha1Checksum, String source) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("containerType") && containerType != null) { - fieldMap.put("containerType", Collections.singletonList(String.valueOf(containerType))); - } - if (fieldNames.contains("sha1Checksum") && sha1Checksum != null) { - fieldMap.put("sha1Checksum", Collections.singletonList(String.valueOf(sha1Checksum))); - } - if (fieldNames.contains("source") && source != null) { - fieldMap.put("source", Collections.singletonList(String.valueOf(source))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("containerType")) { - return String.valueOf(containerType); + return containerType; } if (fieldName.equals("sha1Checksum")) { - return String.valueOf(sha1Checksum); + return sha1Checksum; } if (fieldName.equals("source")) { - return String.valueOf(source); + return source; } return null; } @@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getContainerType() { return containerType; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java index fa3fa9b56115..938f45cd1449 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private RecreateInstancesInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") - && instanceGroupManagersRecreateInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupManagersRecreateInstancesRequestResource", - Collections.singletonList( - String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("instanceGroupManagersRecreateInstancesRequestResource")) { - return String.valueOf(instanceGroupManagersRecreateInstancesRequestResource); + return instanceGroupManagersRecreateInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public InstanceGroupManagersRecreateInstancesRequest getApiMessageRequestBody() return instanceGroupManagersRecreateInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java index 0448b906a2da..5d8fc03ea2c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,77 +75,36 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") - && regionInstanceGroupManagersRecreateRequestResource != null) { - fieldMap.put( - "regionInstanceGroupManagersRecreateRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupManagersRecreateRequestResource")) { - return String.valueOf(regionInstanceGroupManagersRecreateRequestResource); + return regionInstanceGroupManagersRecreateRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -160,6 +115,12 @@ public RegionInstanceGroupManagersRecreateRequest getApiMessageRequestBody() { return regionInstanceGroupManagersRecreateRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java index c445cf9c6833..3628a6bda60c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,36 +45,18 @@ private Reference(String kind, String referenceType, String referrer, String tar } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("referenceType") && referenceType != null) { - fieldMap.put("referenceType", Collections.singletonList(String.valueOf(referenceType))); - } - if (fieldNames.contains("referrer") && referrer != null) { - fieldMap.put("referrer", Collections.singletonList(String.valueOf(referrer))); - } - if (fieldNames.contains("target") && target != null) { - fieldMap.put("target", Collections.singletonList(String.valueOf(target))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("referenceType")) { - return String.valueOf(referenceType); + return referenceType; } if (fieldName.equals("referrer")) { - return String.valueOf(referrer); + return referrer; } if (fieldName.equals("target")) { - return String.valueOf(target); + return target; } return null; } @@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java index dfbe4ed281ff..0d3c8cba1ae1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,81 +74,36 @@ private Region( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("quotas") && quotas != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Quota item : quotas) { - stringList.add(item.toString()); - } - fieldMap.put("quotas", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("zones") && zones != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : zones) { - stringList.add(item.toString()); - } - fieldMap.put("zones", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("quotas")) { - return String.valueOf(quotas); + return quotas; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("zones")) { - return String.valueOf(zones); + return zones; } return null; } @@ -164,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java index 5ad459a5be6e..09562b3cbb11 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RegionAutoscalerList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Autoscaler item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java index c32961fffa4e..b86404389c2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RegionInstanceGroupList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceGroup item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java index f1f09b5f5466..861020ed21e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RegionInstanceGroupManagerList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceGroupManager item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java index 3327c7ebb786..87956be472c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private RegionInstanceGroupManagersAbandonInstancesRequest(List instance } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java index 9474e8998620..a4b32543c022 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private RegionInstanceGroupManagersDeleteInstancesRequest(List instances } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java index e02308bfa2fe..4ae23bf6b182 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private RegionInstanceGroupManagersListInstancesResponse(List m } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("managedInstances") && managedInstances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (ManagedInstance item : managedInstances) { - stringList.add(item.toString()); - } - fieldMap.put("managedInstances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("managedInstances")) { + return managedInstances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("managedInstances")) { - return String.valueOf(managedInstances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java index 36663c265597..ba1241f5c9ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private RegionInstanceGroupManagersRecreateRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java index 937044c58ce1..e855cb402ec3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,28 +41,12 @@ private RegionInstanceGroupManagersSetTargetPoolsRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("targetPools") && targetPools != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : targetPools) { - stringList.add(item.toString()); - } - fieldMap.put("targetPools", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("targetPools")) { - return String.valueOf(targetPools); + return targetPools; } return null; } @@ -78,6 +57,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java index c4e23696134a..5529a711192c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private RegionInstanceGroupManagersSetTemplateRequest(String instanceTemplate) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { - fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instanceTemplate")) { + return instanceTemplate; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instanceTemplate")) { - return String.valueOf(instanceTemplate); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java index 59f1430cc6c7..e97ad0a481a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RegionInstanceGroupsListInstances( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceWithNamedPorts item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java index d6bfddceb997..fa62768f170b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private RegionInstanceGroupsListInstancesRequest(String instanceState, String po } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instanceState") && instanceState != null) { - fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState))); - } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("instanceState")) { - return String.valueOf(instanceState); + return instanceState; } if (fieldName.equals("portName")) { - return String.valueOf(portName); + return portName; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getInstanceState() { return instanceState; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java index 5f66c8f0a730..8e609e19ef37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private RegionInstanceGroupsSetNamedPortsRequest(String fingerprint, List> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("namedPorts") && namedPorts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NamedPort item : namedPorts) { - stringList.add(item.toString()); - } - fieldMap.put("namedPorts", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("namedPorts")) { - return String.valueOf(namedPorts); + return namedPorts; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java index a29b6a2d91c1..083b4ad7f70b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RegionList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Region item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java index e95afb751c71..9e372429acbd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private RemoveHealthCheckTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetPoolsRemoveHealthCheckRequestResource") - && targetPoolsRemoveHealthCheckRequestResource != null) { - fieldMap.put( - "targetPoolsRemoveHealthCheckRequestResource", - Collections.singletonList(String.valueOf(targetPoolsRemoveHealthCheckRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetPoolsRemoveHealthCheckRequestResource")) { - return String.valueOf(targetPoolsRemoveHealthCheckRequestResource); + return targetPoolsRemoveHealthCheckRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public TargetPoolsRemoveHealthCheckRequest getApiMessageRequestBody() { return targetPoolsRemoveHealthCheckRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java index c9c60f1d8c0b..6459033db189 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private RemoveInstanceTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetPoolsRemoveInstanceRequestResource") - && targetPoolsRemoveInstanceRequestResource != null) { - fieldMap.put( - "targetPoolsRemoveInstanceRequestResource", - Collections.singletonList(String.valueOf(targetPoolsRemoveInstanceRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetPoolsRemoveInstanceRequestResource")) { - return String.valueOf(targetPoolsRemoveInstanceRequestResource); + return targetPoolsRemoveInstanceRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public TargetPoolsRemoveInstanceRequest getApiMessageRequestBody() { return targetPoolsRemoveInstanceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java index 3381247f4eea..a997c78245e8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -78,75 +74,36 @@ private RemoveInstancesInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("instanceGroupsRemoveInstancesRequestResource") - && instanceGroupsRemoveInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupsRemoveInstancesRequestResource", - Collections.singletonList(String.valueOf(instanceGroupsRemoveInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("instanceGroupsRemoveInstancesRequestResource")) { - return String.valueOf(instanceGroupsRemoveInstancesRequestResource); + return instanceGroupsRemoveInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -157,6 +114,12 @@ public InstanceGroupsRemoveInstancesRequest getApiMessageRequestBody() { return instanceGroupsRemoveInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java index 0416828b172e..8bd762d6c23d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private RemovePeeringNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("networksRemovePeeringRequestResource") - && networksRemovePeeringRequestResource != null) { - fieldMap.put( - "networksRemovePeeringRequestResource", - Collections.singletonList(String.valueOf(networksRemovePeeringRequestResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("networksRemovePeeringRequestResource")) { - return String.valueOf(networksRemovePeeringRequestResource); + return networksRemovePeeringRequestResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public NetworksRemovePeeringRequest getApiMessageRequestBody() { return networksRemovePeeringRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java index f18510819b7f..426b99a4e8ae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private ResetInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java index 46fe780a669e..7231c0b99131 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private ResizeDiskHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("disk") && disk != null) { - fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); - } - if (fieldNames.contains("disksResizeRequestResource") && disksResizeRequestResource != null) { - fieldMap.put( - "disksResizeRequestResource", - Collections.singletonList(String.valueOf(disksResizeRequestResource))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("disk")) { - return String.valueOf(disk); + return disk; } if (fieldName.equals("disksResizeRequestResource")) { - return String.valueOf(disksResizeRequestResource); + return disksResizeRequestResource; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public DisksResizeRequest getApiMessageRequestBody() { return disksResizeRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java index 96e9ecdbcdf8..9fd2f0fbdd49 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private ResizeInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("size") && size != null) { - fieldMap.put("size", Collections.singletonList(String.valueOf(size))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("size")) { - return String.valueOf(size); + return size; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java index 867324d35a91..9ad8bcb64ff6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private ResizeRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("size") && size != null) { - fieldMap.put("size", Collections.singletonList(String.valueOf(size))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("size")) { - return String.valueOf(size); + return size; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java index 32d6d8680d97..c48fcbb28ff5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private ResourceCommitment(String amount, String type) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("amount") && amount != null) { - fieldMap.put("amount", Collections.singletonList(String.valueOf(amount))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("amount")) { - return String.valueOf(amount); + return amount; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAmount() { return amount; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java index c0af2934011c..5b6876d4274b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private ResourceGroupReference(String group) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("group") && group != null) { - fieldMap.put("group", Collections.singletonList(String.valueOf(group))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("group")) { + return group; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("group")) { - return String.valueOf(group); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java index c98eb0299c8a..5787127134b3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -107,123 +102,57 @@ private Route( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("destRange") && destRange != null) { - fieldMap.put("destRange", Collections.singletonList(String.valueOf(destRange))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("nextHopGateway") && nextHopGateway != null) { - fieldMap.put("nextHopGateway", Collections.singletonList(String.valueOf(nextHopGateway))); - } - if (fieldNames.contains("nextHopInstance") && nextHopInstance != null) { - fieldMap.put("nextHopInstance", Collections.singletonList(String.valueOf(nextHopInstance))); - } - if (fieldNames.contains("nextHopIp") && nextHopIp != null) { - fieldMap.put("nextHopIp", Collections.singletonList(String.valueOf(nextHopIp))); - } - if (fieldNames.contains("nextHopNetwork") && nextHopNetwork != null) { - fieldMap.put("nextHopNetwork", Collections.singletonList(String.valueOf(nextHopNetwork))); - } - if (fieldNames.contains("nextHopPeering") && nextHopPeering != null) { - fieldMap.put("nextHopPeering", Collections.singletonList(String.valueOf(nextHopPeering))); - } - if (fieldNames.contains("nextHopVpnTunnel") && nextHopVpnTunnel != null) { - fieldMap.put("nextHopVpnTunnel", Collections.singletonList(String.valueOf(nextHopVpnTunnel))); - } - if (fieldNames.contains("priority") && priority != null) { - fieldMap.put("priority", Collections.singletonList(String.valueOf(priority))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("tags") && tags != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : tags) { - stringList.add(item.toString()); - } - fieldMap.put("tags", stringList.build()); - } - if (fieldNames.contains("warnings") && warnings != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Warnings item : warnings) { - stringList.add(item.toString()); - } - fieldMap.put("warnings", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("destRange")) { - return String.valueOf(destRange); + return destRange; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("nextHopGateway")) { - return String.valueOf(nextHopGateway); + return nextHopGateway; } if (fieldName.equals("nextHopInstance")) { - return String.valueOf(nextHopInstance); + return nextHopInstance; } if (fieldName.equals("nextHopIp")) { - return String.valueOf(nextHopIp); + return nextHopIp; } if (fieldName.equals("nextHopNetwork")) { - return String.valueOf(nextHopNetwork); + return nextHopNetwork; } if (fieldName.equals("nextHopPeering")) { - return String.valueOf(nextHopPeering); + return nextHopPeering; } if (fieldName.equals("nextHopVpnTunnel")) { - return String.valueOf(nextHopVpnTunnel); + return nextHopVpnTunnel; } if (fieldName.equals("priority")) { - return String.valueOf(priority); + return priority; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("tags")) { - return String.valueOf(tags); + return tags; } if (fieldName.equals("warnings")) { - return String.valueOf(warnings); + return warnings; } return null; } @@ -234,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java index 82cdccf0d624..49dadda25cc1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RouteList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Route item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java index e97c03183b29..a4f548b9a72a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -83,87 +78,39 @@ private Router( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("bgp") && bgp != null) { - fieldMap.put("bgp", Collections.singletonList(String.valueOf(bgp))); - } - if (fieldNames.contains("bgpPeers") && bgpPeers != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (RouterBgpPeer item : bgpPeers) { - stringList.add(item.toString()); - } - fieldMap.put("bgpPeers", stringList.build()); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("interfaces") && interfaces != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (RouterInterface item : interfaces) { - stringList.add(item.toString()); - } - fieldMap.put("interfaces", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("bgp")) { - return String.valueOf(bgp); + return bgp; } if (fieldName.equals("bgpPeers")) { - return String.valueOf(bgpPeers); + return bgpPeers; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("interfaces")) { - return String.valueOf(interfaces); + return interfaces; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -174,6 +121,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public RouterBgp getBgp() { return bgp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java index d740b89abec4..993cfe8968f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private RouterAdvertisedIpRange(String description, String range) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("range") && range != null) { - fieldMap.put("range", Collections.singletonList(String.valueOf(range))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("range")) { - return String.valueOf(range); + return range; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDescription() { return description; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java index cff265feafde..dc85b2cc9a5c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private RouterAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java index 0aebfe3071b5..bedca25c58d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -55,44 +50,18 @@ private RouterBgp( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("advertiseMode") && advertiseMode != null) { - fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode))); - } - if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : advertisedGroups) { - stringList.add(item.toString()); - } - fieldMap.put("advertisedGroups", stringList.build()); - } - if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (RouterAdvertisedIpRange item : advertisedIpRanges) { - stringList.add(item.toString()); - } - fieldMap.put("advertisedIpRanges", stringList.build()); - } - if (fieldNames.contains("asn") && asn != null) { - fieldMap.put("asn", Collections.singletonList(String.valueOf(asn))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("advertiseMode")) { - return String.valueOf(advertiseMode); + return advertiseMode; } if (fieldName.equals("advertisedGroups")) { - return String.valueOf(advertisedGroups); + return advertisedGroups; } if (fieldName.equals("advertisedIpRanges")) { - return String.valueOf(advertisedIpRanges); + return advertisedIpRanges; } if (fieldName.equals("asn")) { - return String.valueOf(asn); + return asn; } return null; } @@ -103,6 +72,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAdvertiseMode() { return advertiseMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java index 2520f0b75206..1667284e364c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,76 +70,33 @@ private RouterBgpPeer( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("advertiseMode") && advertiseMode != null) { - fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode))); - } - if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : advertisedGroups) { - stringList.add(item.toString()); - } - fieldMap.put("advertisedGroups", stringList.build()); - } - if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (RouterAdvertisedIpRange item : advertisedIpRanges) { - stringList.add(item.toString()); - } - fieldMap.put("advertisedIpRanges", stringList.build()); - } - if (fieldNames.contains("advertisedRoutePriority") && advertisedRoutePriority != null) { - fieldMap.put( - "advertisedRoutePriority", - Collections.singletonList(String.valueOf(advertisedRoutePriority))); - } - if (fieldNames.contains("interfaceName") && interfaceName != null) { - fieldMap.put("interfaceName", Collections.singletonList(String.valueOf(interfaceName))); - } - if (fieldNames.contains("ipAddress") && ipAddress != null) { - fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("peerAsn") && peerAsn != null) { - fieldMap.put("peerAsn", Collections.singletonList(String.valueOf(peerAsn))); - } - if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { - fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("advertiseMode")) { - return String.valueOf(advertiseMode); + return advertiseMode; } if (fieldName.equals("advertisedGroups")) { - return String.valueOf(advertisedGroups); + return advertisedGroups; } if (fieldName.equals("advertisedIpRanges")) { - return String.valueOf(advertisedIpRanges); + return advertisedIpRanges; } if (fieldName.equals("advertisedRoutePriority")) { - return String.valueOf(advertisedRoutePriority); + return advertisedRoutePriority; } if (fieldName.equals("interfaceName")) { - return String.valueOf(interfaceName); + return interfaceName; } if (fieldName.equals("ipAddress")) { - return String.valueOf(ipAddress); + return ipAddress; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("peerAsn")) { - return String.valueOf(peerAsn); + return peerAsn; } if (fieldName.equals("peerIpAddress")) { - return String.valueOf(peerIpAddress); + return peerIpAddress; } return null; } @@ -155,6 +107,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAdvertiseMode() { return advertiseMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java index 2685c57f2a0a..90b406d53037 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -50,39 +46,18 @@ private RouterInterface( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("ipRange") && ipRange != null) { - fieldMap.put("ipRange", Collections.singletonList(String.valueOf(ipRange))); - } - if (fieldNames.contains("linkedInterconnectAttachment") - && linkedInterconnectAttachment != null) { - fieldMap.put( - "linkedInterconnectAttachment", - Collections.singletonList(String.valueOf(linkedInterconnectAttachment))); - } - if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) { - fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("ipRange")) { - return String.valueOf(ipRange); + return ipRange; } if (fieldName.equals("linkedInterconnectAttachment")) { - return String.valueOf(linkedInterconnectAttachment); + return linkedInterconnectAttachment; } if (fieldName.equals("linkedVpnTunnel")) { - return String.valueOf(linkedVpnTunnel); + return linkedVpnTunnel; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } return null; } @@ -93,6 +68,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIpRange() { return ipRange; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java index 6a1c16d705b5..cc8bd25b138d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private RouterList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Router item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java index 87cb1f3d6c20..ed6892ffe4aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -55,48 +50,18 @@ private RouterStatus( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("bestRoutes") && bestRoutes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Route item : bestRoutes) { - stringList.add(item.toString()); - } - fieldMap.put("bestRoutes", stringList.build()); - } - if (fieldNames.contains("bestRoutesForRouter") && bestRoutesForRouter != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Route item : bestRoutesForRouter) { - stringList.add(item.toString()); - } - fieldMap.put("bestRoutesForRouter", stringList.build()); - } - if (fieldNames.contains("bgpPeerStatus") && bgpPeerStatus != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (RouterStatusBgpPeerStatus item : bgpPeerStatus) { - stringList.add(item.toString()); - } - fieldMap.put("bgpPeerStatus", stringList.build()); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("bestRoutes")) { - return String.valueOf(bestRoutes); + return bestRoutes; } if (fieldName.equals("bestRoutesForRouter")) { - return String.valueOf(bestRoutesForRouter); + return bestRoutesForRouter; } if (fieldName.equals("bgpPeerStatus")) { - return String.valueOf(bgpPeerStatus); + return bgpPeerStatus; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } return null; } @@ -107,6 +72,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getBestRoutesList() { return bestRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java index abf4198ec76f..19e08605fdb3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +74,36 @@ private RouterStatusBgpPeerStatus( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("advertisedRoutes") && advertisedRoutes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Route item : advertisedRoutes) { - stringList.add(item.toString()); - } - fieldMap.put("advertisedRoutes", stringList.build()); - } - if (fieldNames.contains("ipAddress") && ipAddress != null) { - fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); - } - if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) { - fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("numLearnedRoutes") && numLearnedRoutes != null) { - fieldMap.put("numLearnedRoutes", Collections.singletonList(String.valueOf(numLearnedRoutes))); - } - if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { - fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); - } - if (fieldNames.contains("state") && state != null) { - fieldMap.put("state", Collections.singletonList(String.valueOf(state))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("uptime") && uptime != null) { - fieldMap.put("uptime", Collections.singletonList(String.valueOf(uptime))); - } - if (fieldNames.contains("uptimeSeconds") && uptimeSeconds != null) { - fieldMap.put("uptimeSeconds", Collections.singletonList(String.valueOf(uptimeSeconds))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("advertisedRoutes")) { - return String.valueOf(advertisedRoutes); + return advertisedRoutes; } if (fieldName.equals("ipAddress")) { - return String.valueOf(ipAddress); + return ipAddress; } if (fieldName.equals("linkedVpnTunnel")) { - return String.valueOf(linkedVpnTunnel); + return linkedVpnTunnel; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("numLearnedRoutes")) { - return String.valueOf(numLearnedRoutes); + return numLearnedRoutes; } if (fieldName.equals("peerIpAddress")) { - return String.valueOf(peerIpAddress); + return peerIpAddress; } if (fieldName.equals("state")) { - return String.valueOf(state); + return state; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("uptime")) { - return String.valueOf(uptime); + return uptime; } if (fieldName.equals("uptimeSeconds")) { - return String.valueOf(uptimeSeconds); + return uptimeSeconds; } return null; } @@ -159,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAdvertisedRoutesList() { return advertisedRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java index b00558dd3b1f..270f2fe8ff9d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private RouterStatusResponse(String kind, RouterStatus result) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("result") && result != null) { - fieldMap.put("result", Collections.singletonList(String.valueOf(result))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("result")) { - return String.valueOf(result); + return result; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java index c1311f4462c0..cfe2dec432e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private RoutersPreviewResponse(Router resource) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("resource")) { + return resource; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("resource")) { - return String.valueOf(resource); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java index 77858274e19e..2b101ef397ac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private RoutersScopedList(List routers, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("routers") && routers != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Router item : routers) { - stringList.add(item.toString()); - } - fieldMap.put("routers", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("routers")) { - return String.valueOf(routers); + return routers; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getRoutersList() { return routers; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java index cf70e23f88da..608db5cc07ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,42 +49,21 @@ private SSLHealthCheck( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); - } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); - } - if (fieldNames.contains("request") && request != null) { - fieldMap.put("request", Collections.singletonList(String.valueOf(request))); - } - if (fieldNames.contains("response") && response != null) { - fieldMap.put("response", Collections.singletonList(String.valueOf(response))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } if (fieldName.equals("portName")) { - return String.valueOf(portName); + return portName; } if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); + return proxyHeader; } if (fieldName.equals("request")) { - return String.valueOf(request); + return request; } if (fieldName.equals("response")) { - return String.valueOf(response); + return response; } return null; } @@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getPort() { return port; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java index b6dede48f68e..9b44ee823a01 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,31 +42,15 @@ private Scheduling(Boolean automaticRestart, String onHostMaintenance, Boolean p } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("automaticRestart") && automaticRestart != null) { - fieldMap.put("automaticRestart", Collections.singletonList(String.valueOf(automaticRestart))); - } - if (fieldNames.contains("onHostMaintenance") && onHostMaintenance != null) { - fieldMap.put( - "onHostMaintenance", Collections.singletonList(String.valueOf(onHostMaintenance))); - } - if (fieldNames.contains("preemptible") && preemptible != null) { - fieldMap.put("preemptible", Collections.singletonList(String.valueOf(preemptible))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("automaticRestart")) { - return String.valueOf(automaticRestart); + return automaticRestart; } if (fieldName.equals("onHostMaintenance")) { - return String.valueOf(onHostMaintenance); + return onHostMaintenance; } if (fieldName.equals("preemptible")) { - return String.valueOf(preemptible); + return preemptible; } return null; } @@ -81,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAutomaticRestart() { return automaticRestart; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java index 5001ccf5668c..e806a83522e6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private ScratchDisks(Integer diskGb) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("diskGb") && diskGb != null) { - fieldMap.put("diskGb", Collections.singletonList(String.valueOf(diskGb))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("diskGb")) { + return diskGb; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("diskGb")) { - return String.valueOf(diskGb); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java index 4753665af903..176456887caf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,42 +49,21 @@ private SerialPortOutput( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("contents") && contents != null) { - fieldMap.put("contents", Collections.singletonList(String.valueOf(contents))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("next") && next != null) { - fieldMap.put("next", Collections.singletonList(String.valueOf(next))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("start") && start != null) { - fieldMap.put("start", Collections.singletonList(String.valueOf(start))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("contents")) { - return String.valueOf(contents); + return contents; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("next")) { - return String.valueOf(next); + return next; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("start")) { - return String.valueOf(start); + return start; } return null; } @@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getContents() { return contents; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java index 2bc312927530..b21d731cf495 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private ServiceAccount(String email, List scopes) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("email") && email != null) { - fieldMap.put("email", Collections.singletonList(String.valueOf(email))); - } - if (fieldNames.contains("scopes") && scopes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : scopes) { - stringList.add(item.toString()); - } - fieldMap.put("scopes", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("email")) { - return String.valueOf(email); + return email; } if (fieldName.equals("scopes")) { - return String.valueOf(scopes); + return scopes; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getEmail() { return email; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java index ec0cedce49c0..94915ed07aa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +75,36 @@ private SetBackendServiceTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource") - && targetSslProxiesSetBackendServiceRequestResource != null) { - fieldMap.put( - "targetSslProxiesSetBackendServiceRequestResource", - Collections.singletonList( - String.valueOf(targetSslProxiesSetBackendServiceRequestResource))); - } - if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { - fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetSslProxiesSetBackendServiceRequestResource")) { - return String.valueOf(targetSslProxiesSetBackendServiceRequestResource); + return targetSslProxiesSetBackendServiceRequestResource; } if (fieldName.equals("targetSslProxy")) { - return String.valueOf(targetSslProxy); + return targetSslProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -159,6 +115,12 @@ public TargetSslProxiesSetBackendServiceRequest getApiMessageRequestBody() { return targetSslProxiesSetBackendServiceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java index 42a0014c88d9..5a79262f2ebc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +75,36 @@ private SetBackendServiceTargetTcpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetTcpProxiesSetBackendServiceRequestResource") - && targetTcpProxiesSetBackendServiceRequestResource != null) { - fieldMap.put( - "targetTcpProxiesSetBackendServiceRequestResource", - Collections.singletonList( - String.valueOf(targetTcpProxiesSetBackendServiceRequestResource))); - } - if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { - fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetTcpProxiesSetBackendServiceRequestResource")) { - return String.valueOf(targetTcpProxiesSetBackendServiceRequestResource); + return targetTcpProxiesSetBackendServiceRequestResource; } if (fieldName.equals("targetTcpProxy")) { - return String.valueOf(targetTcpProxy); + return targetTcpProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -159,6 +115,12 @@ public TargetTcpProxiesSetBackendServiceRequest getApiMessageRequestBody() { return targetTcpProxiesSetBackendServiceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java index 64316ee60f46..a8ff1c84b873 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,80 +77,39 @@ private SetBackupTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("failoverRatio") && failoverRatio != null) { - fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put( - "targetReferenceResource", - Collections.singletonList(String.valueOf(targetReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("failoverRatio")) { - return String.valueOf(failoverRatio); + return failoverRatio; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetReferenceResource")) { - return String.valueOf(targetReferenceResource); + return targetReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -165,6 +120,12 @@ public TargetReference getApiMessageRequestBody() { return targetReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java index e1067dfacdec..7ef2f549c852 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private SetCommonInstanceMetadataProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("metadataResource") && metadataResource != null) { - fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("metadataResource")) { - return String.valueOf(metadataResource); + return metadataResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Metadata getApiMessageRequestBody() { return metadataResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java index 74dc10f99e02..25ddb9bee5c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private SetDeletionProtectionInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("deletionProtection") && deletionProtection != null) { - fieldMap.put( - "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("deletionProtection")) { - return String.valueOf(deletionProtection); + return deletionProtection; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("resource")) { - return String.valueOf(resource); + return resource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java index c71d726e3203..1d68a7549b97 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,78 +77,39 @@ private SetDiskAutoDeleteInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoDelete") && autoDelete != null) { - fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("deviceName") && deviceName != null) { - fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoDelete")) { - return String.valueOf(autoDelete); + return autoDelete; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("deviceName")) { - return String.valueOf(deviceName); + return deviceName; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -163,6 +120,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java index 42d118e74ec8..4b2b5108df78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("instanceGroupManagersSetInstanceTemplateRequestResource") - && instanceGroupManagersSetInstanceTemplateRequestResource != null) { - fieldMap.put( - "instanceGroupManagersSetInstanceTemplateRequestResource", - Collections.singletonList( - String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("instanceGroupManagersSetInstanceTemplateRequestResource")) { - return String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource); + return instanceGroupManagersSetInstanceTemplateRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public InstanceGroupManagersSetInstanceTemplateRequest getApiMessageRequestBody( return instanceGroupManagersSetInstanceTemplateRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java index 04073eee5b98..6465fd01f274 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource") - && regionInstanceGroupManagersSetTemplateRequestResource != null) { - fieldMap.put( - "regionInstanceGroupManagersSetTemplateRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupManagersSetTemplateRequestResource")) { - return String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource); + return regionInstanceGroupManagersSetTemplateRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public RegionInstanceGroupManagersSetTemplateRequest getApiMessageRequestBody() return regionInstanceGroupManagersSetTemplateRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java index f3217f2bce48..5169b551ebaf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetLabelsDiskHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zoneSetLabelsRequestResource") - && zoneSetLabelsRequestResource != null) { - fieldMap.put( - "zoneSetLabelsRequestResource", - Collections.singletonList(String.valueOf(zoneSetLabelsRequestResource))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("resource")) { - return String.valueOf(resource); + return resource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zoneSetLabelsRequestResource")) { - return String.valueOf(zoneSetLabelsRequestResource); + return zoneSetLabelsRequestResource; } return null; } @@ -156,6 +113,12 @@ public ZoneSetLabelsRequest getApiMessageRequestBody() { return zoneSetLabelsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java index 20b77f6a94ac..71baf086694e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private SetLabelsImageHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("globalSetLabelsRequestResource") - && globalSetLabelsRequestResource != null) { - fieldMap.put( - "globalSetLabelsRequestResource", - Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("globalSetLabelsRequestResource")) { - return String.valueOf(globalSetLabelsRequestResource); + return globalSetLabelsRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("resource")) { - return String.valueOf(resource); + return resource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public GlobalSetLabelsRequest getApiMessageRequestBody() { return globalSetLabelsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java index be8e7c4200b6..057e08320ac4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetLabelsInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instancesSetLabelsRequestResource") - && instancesSetLabelsRequestResource != null) { - fieldMap.put( - "instancesSetLabelsRequestResource", - Collections.singletonList(String.valueOf(instancesSetLabelsRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instancesSetLabelsRequestResource")) { - return String.valueOf(instancesSetLabelsRequestResource); + return instancesSetLabelsRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstancesSetLabelsRequest getApiMessageRequestBody() { return instancesSetLabelsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java index 5b4d0d82e0f8..f61d9205e66d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private SetLabelsSnapshotHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("globalSetLabelsRequestResource") - && globalSetLabelsRequestResource != null) { - fieldMap.put( - "globalSetLabelsRequestResource", - Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("globalSetLabelsRequestResource")) { - return String.valueOf(globalSetLabelsRequestResource); + return globalSetLabelsRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("resource")) { - return String.valueOf(resource); + return resource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public GlobalSetLabelsRequest getApiMessageRequestBody() { return globalSetLabelsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java index ff4e738a7a9f..8f112ba95cea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetMachineResourcesInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instancesSetMachineResourcesRequestResource") - && instancesSetMachineResourcesRequestResource != null) { - fieldMap.put( - "instancesSetMachineResourcesRequestResource", - Collections.singletonList(String.valueOf(instancesSetMachineResourcesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instancesSetMachineResourcesRequestResource")) { - return String.valueOf(instancesSetMachineResourcesRequestResource); + return instancesSetMachineResourcesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstancesSetMachineResourcesRequest getApiMessageRequestBody() { return instancesSetMachineResourcesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java index 87e1801f599a..7badaf6cfdfe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetMachineTypeInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instancesSetMachineTypeRequestResource") - && instancesSetMachineTypeRequestResource != null) { - fieldMap.put( - "instancesSetMachineTypeRequestResource", - Collections.singletonList(String.valueOf(instancesSetMachineTypeRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instancesSetMachineTypeRequestResource")) { - return String.valueOf(instancesSetMachineTypeRequestResource); + return instancesSetMachineTypeRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstancesSetMachineTypeRequest getApiMessageRequestBody() { return instancesSetMachineTypeRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java index 2df6c66b6f3d..55cea5ad9886 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private SetMetadataInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("metadataResource") && metadataResource != null) { - fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("metadataResource")) { - return String.valueOf(metadataResource); + return metadataResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Metadata getApiMessageRequestBody() { return metadataResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java index 7f23570801a8..fdbef21a1e7f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetMinCpuPlatformInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instancesSetMinCpuPlatformRequestResource") - && instancesSetMinCpuPlatformRequestResource != null) { - fieldMap.put( - "instancesSetMinCpuPlatformRequestResource", - Collections.singletonList(String.valueOf(instancesSetMinCpuPlatformRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instancesSetMinCpuPlatformRequestResource")) { - return String.valueOf(instancesSetMinCpuPlatformRequestResource); + return instancesSetMinCpuPlatformRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstancesSetMinCpuPlatformRequest getApiMessageRequestBody() { return instancesSetMinCpuPlatformRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java index 62658c55ce77..deb3334abff7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetNamedPortsInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("instanceGroupsSetNamedPortsRequestResource") - && instanceGroupsSetNamedPortsRequestResource != null) { - fieldMap.put( - "instanceGroupsSetNamedPortsRequestResource", - Collections.singletonList(String.valueOf(instanceGroupsSetNamedPortsRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("instanceGroupsSetNamedPortsRequestResource")) { - return String.valueOf(instanceGroupsSetNamedPortsRequestResource); + return instanceGroupsSetNamedPortsRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() { return instanceGroupsSetNamedPortsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java index 9ac402efdc3d..8557570e6ce3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +75,36 @@ private SetNamedPortsRegionInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource") - && regionInstanceGroupsSetNamedPortsRequestResource != null) { - fieldMap.put( - "regionInstanceGroupsSetNamedPortsRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupsSetNamedPortsRequestResource")) { - return String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource); + return regionInstanceGroupsSetNamedPortsRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -159,6 +115,12 @@ public RegionInstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() { return regionInstanceGroupsSetNamedPortsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java index 773951397df8..f94b3e6f4f67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +75,36 @@ private SetPrivateIpGoogleAccessSubnetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("subnetworksSetPrivateIpGoogleAccessRequestResource") - && subnetworksSetPrivateIpGoogleAccessRequestResource != null) { - fieldMap.put( - "subnetworksSetPrivateIpGoogleAccessRequestResource", - Collections.singletonList( - String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("subnetworksSetPrivateIpGoogleAccessRequestResource")) { - return String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource); + return subnetworksSetPrivateIpGoogleAccessRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -159,6 +115,12 @@ public SubnetworksSetPrivateIpGoogleAccessRequest getApiMessageRequestBody() { return subnetworksSetPrivateIpGoogleAccessRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java index 13b0df6fae62..940b1957222d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -78,75 +74,36 @@ private SetProxyHeaderTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource") - && targetSslProxiesSetProxyHeaderRequestResource != null) { - fieldMap.put( - "targetSslProxiesSetProxyHeaderRequestResource", - Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource))); - } - if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { - fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetSslProxiesSetProxyHeaderRequestResource")) { - return String.valueOf(targetSslProxiesSetProxyHeaderRequestResource); + return targetSslProxiesSetProxyHeaderRequestResource; } if (fieldName.equals("targetSslProxy")) { - return String.valueOf(targetSslProxy); + return targetSslProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -157,6 +114,12 @@ public TargetSslProxiesSetProxyHeaderRequest getApiMessageRequestBody() { return targetSslProxiesSetProxyHeaderRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java index 4c2535a0ef40..97bcded5875d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -78,75 +74,36 @@ private SetProxyHeaderTargetTcpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetTcpProxiesSetProxyHeaderRequestResource") - && targetTcpProxiesSetProxyHeaderRequestResource != null) { - fieldMap.put( - "targetTcpProxiesSetProxyHeaderRequestResource", - Collections.singletonList(String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource))); - } - if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { - fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetTcpProxiesSetProxyHeaderRequestResource")) { - return String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource); + return targetTcpProxiesSetProxyHeaderRequestResource; } if (fieldName.equals("targetTcpProxy")) { - return String.valueOf(targetTcpProxy); + return targetTcpProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -157,6 +114,12 @@ public TargetTcpProxiesSetProxyHeaderRequest getApiMessageRequestBody() { return targetTcpProxiesSetProxyHeaderRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java index a31bdc208c62..ab2132538887 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private SetSchedulingInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("schedulingResource") && schedulingResource != null) { - fieldMap.put( - "schedulingResource", Collections.singletonList(String.valueOf(schedulingResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("schedulingResource")) { - return String.valueOf(schedulingResource); + return schedulingResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public Scheduling getApiMessageRequestBody() { return schedulingResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java index 346ad7ec664a..913fb653a488 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private SetServiceAccountInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instancesSetServiceAccountRequestResource") - && instancesSetServiceAccountRequestResource != null) { - fieldMap.put( - "instancesSetServiceAccountRequestResource", - Collections.singletonList(String.valueOf(instancesSetServiceAccountRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instancesSetServiceAccountRequestResource")) { - return String.valueOf(instancesSetServiceAccountRequestResource); + return instancesSetServiceAccountRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstancesSetServiceAccountRequest getApiMessageRequestBody() { return instancesSetServiceAccountRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java index 856b6f8dc764..b754e5a5f75a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,76 +76,36 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource") - && targetHttpsProxiesSetSslCertificatesRequestResource != null) { - fieldMap.put( - "targetHttpsProxiesSetSslCertificatesRequestResource", - Collections.singletonList( - String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource))); - } - if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { - fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpsProxiesSetSslCertificatesRequestResource")) { - return String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource); + return targetHttpsProxiesSetSslCertificatesRequestResource; } if (fieldName.equals("targetHttpsProxy")) { - return String.valueOf(targetHttpsProxy); + return targetHttpsProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -160,6 +116,12 @@ public TargetHttpsProxiesSetSslCertificatesRequest getApiMessageRequestBody() { return targetHttpsProxiesSetSslCertificatesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java index e569f57696c8..ce3278ac073e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +75,36 @@ private SetSslCertificatesTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource") - && targetSslProxiesSetSslCertificatesRequestResource != null) { - fieldMap.put( - "targetSslProxiesSetSslCertificatesRequestResource", - Collections.singletonList( - String.valueOf(targetSslProxiesSetSslCertificatesRequestResource))); - } - if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { - fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetSslProxiesSetSslCertificatesRequestResource")) { - return String.valueOf(targetSslProxiesSetSslCertificatesRequestResource); + return targetSslProxiesSetSslCertificatesRequestResource; } if (fieldName.equals("targetSslProxy")) { - return String.valueOf(targetSslProxy); + return targetSslProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -159,6 +115,12 @@ public TargetSslProxiesSetSslCertificatesRequest getApiMessageRequestBody() { return targetSslProxiesSetSslCertificatesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java index 57545bbf899e..2b355c09bdc8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetSslPolicyTargetHttpsProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) { - fieldMap.put( - "sslPolicyReferenceResource", - Collections.singletonList(String.valueOf(sslPolicyReferenceResource))); - } - if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { - fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslPolicyReferenceResource")) { - return String.valueOf(sslPolicyReferenceResource); + return sslPolicyReferenceResource; } if (fieldName.equals("targetHttpsProxy")) { - return String.valueOf(targetHttpsProxy); + return targetHttpsProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public SslPolicyReference getApiMessageRequestBody() { return sslPolicyReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java index b690cf4f02c0..187704c3d2dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetSslPolicyTargetSslProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) { - fieldMap.put( - "sslPolicyReferenceResource", - Collections.singletonList(String.valueOf(sslPolicyReferenceResource))); - } - if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { - fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("sslPolicyReferenceResource")) { - return String.valueOf(sslPolicyReferenceResource); + return sslPolicyReferenceResource; } if (fieldName.equals("targetSslProxy")) { - return String.valueOf(targetSslProxy); + return targetSslProxy; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public SslPolicyReference getApiMessageRequestBody() { return sslPolicyReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java index dcb381e82c3c..c04373e8a529 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private SetTagsInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("tagsResource") && tagsResource != null) { - fieldMap.put("tagsResource", Collections.singletonList(String.valueOf(tagsResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("tagsResource")) { - return String.valueOf(tagsResource); + return tagsResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Tags getApiMessageRequestBody() { return tagsResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java index 8d715bdd6461..0f4011f2ca43 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetTargetForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRule") && forwardingRule != null) { - fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put( - "targetReferenceResource", - Collections.singletonList(String.valueOf(targetReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRule")) { - return String.valueOf(forwardingRule); + return forwardingRule; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetReferenceResource")) { - return String.valueOf(targetReferenceResource); + return targetReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetReference getApiMessageRequestBody() { return targetReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java index 5d90c0309c54..591c84ce4079 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetTargetGlobalForwardingRuleHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forwardingRule") && forwardingRule != null) { - fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { - fieldMap.put( - "targetReferenceResource", - Collections.singletonList(String.valueOf(targetReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forwardingRule")) { - return String.valueOf(forwardingRule); + return forwardingRule; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetReferenceResource")) { - return String.valueOf(targetReferenceResource); + return targetReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public TargetReference getApiMessageRequestBody() { return targetReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java index b41902cfd6ea..de3e6724cc64 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,77 +75,36 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("instanceGroupManagersSetTargetPoolsRequestResource") - && instanceGroupManagersSetTargetPoolsRequestResource != null) { - fieldMap.put( - "instanceGroupManagersSetTargetPoolsRequestResource", - Collections.singletonList( - String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("instanceGroupManagersSetTargetPoolsRequestResource")) { - return String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource); + return instanceGroupManagersSetTargetPoolsRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -160,6 +115,12 @@ public InstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody() { return instanceGroupManagersSetTargetPoolsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java index d1f6bd78f19b..b99e289db6b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource") - && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) { - fieldMap.put( - "regionInstanceGroupManagersSetTargetPoolsRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupManagersSetTargetPoolsRequestResource")) { - return String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource); + return regionInstanceGroupManagersSetTargetPoolsRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public RegionInstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody return regionInstanceGroupManagersSetTargetPoolsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java index cb03dc8c68b9..fc43374f5e9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetUrlMapTargetHttpProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { - fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); - } - if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { - fieldMap.put( - "urlMapReferenceResource", - Collections.singletonList(String.valueOf(urlMapReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpProxy")) { - return String.valueOf(targetHttpProxy); + return targetHttpProxy; } if (fieldName.equals("urlMapReferenceResource")) { - return String.valueOf(urlMapReferenceResource); + return urlMapReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public UrlMapReference getApiMessageRequestBody() { return urlMapReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java index 00ee948a619b..c886f963980f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetUrlMapTargetHttpsProxyHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { - fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); - } - if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { - fieldMap.put( - "urlMapReferenceResource", - Collections.singletonList(String.valueOf(urlMapReferenceResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetHttpsProxy")) { - return String.valueOf(targetHttpsProxy); + return targetHttpsProxy; } if (fieldName.equals("urlMapReferenceResource")) { - return String.valueOf(urlMapReferenceResource); + return urlMapReferenceResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public UrlMapReference getApiMessageRequestBody() { return urlMapReferenceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java index 914272f15daa..4190be522ba5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private SetUsageExportBucketProjectHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("usageExportLocationResource") && usageExportLocationResource != null) { - fieldMap.put( - "usageExportLocationResource", - Collections.singletonList(String.valueOf(usageExportLocationResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("usageExportLocationResource")) { - return String.valueOf(usageExportLocationResource); + return usageExportLocationResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public UsageExportLocation getApiMessageRequestBody() { return usageExportLocationResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java index 67ac4ed48159..4be6f4617e06 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java @@ -17,14 +17,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -111,134 +107,60 @@ private Snapshot( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { - fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("licenseCodes") && licenseCodes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenseCodes) { - stringList.add(item.toString()); - } - fieldMap.put("licenseCodes", stringList.build()); - } - if (fieldNames.contains("licenses") && licenses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenses) { - stringList.add(item.toString()); - } - fieldMap.put("licenses", stringList.build()); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("snapshotEncryptionKey") && snapshotEncryptionKey != null) { - fieldMap.put( - "snapshotEncryptionKey", - Collections.singletonList(String.valueOf(snapshotEncryptionKey))); - } - if (fieldNames.contains("sourceDisk") && sourceDisk != null) { - fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); - } - if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { - fieldMap.put( - "sourceDiskEncryptionKey", - Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); - } - if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { - fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("storageBytes") && storageBytes != null) { - fieldMap.put("storageBytes", Collections.singletonList(String.valueOf(storageBytes))); - } - if (fieldNames.contains("storageBytesStatus") && storageBytesStatus != null) { - fieldMap.put( - "storageBytesStatus", Collections.singletonList(String.valueOf(storageBytesStatus))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("diskSizeGb")) { - return String.valueOf(diskSizeGb); + return diskSizeGb; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("licenseCodes")) { - return String.valueOf(licenseCodes); + return licenseCodes; } if (fieldName.equals("licenses")) { - return String.valueOf(licenses); + return licenses; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("snapshotEncryptionKey")) { - return String.valueOf(snapshotEncryptionKey); + return snapshotEncryptionKey; } if (fieldName.equals("sourceDisk")) { - return String.valueOf(sourceDisk); + return sourceDisk; } if (fieldName.equals("sourceDiskEncryptionKey")) { - return String.valueOf(sourceDiskEncryptionKey); + return sourceDiskEncryptionKey; } if (fieldName.equals("sourceDiskId")) { - return String.valueOf(sourceDiskId); + return sourceDiskId; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("storageBytes")) { - return String.valueOf(storageBytes); + return storageBytes; } if (fieldName.equals("storageBytesStatus")) { - return String.valueOf(storageBytesStatus); + return storageBytesStatus; } return null; } @@ -249,6 +171,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java index 198c12f23451..f1f7ce3efa18 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private SnapshotList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Snapshot item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java index ddd5a6eb3410..3894f3103963 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private SslCertificate( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("certificate") && certificate != null) { - fieldMap.put("certificate", Collections.singletonList(String.valueOf(certificate))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("privateKey") && privateKey != null) { - fieldMap.put("privateKey", Collections.singletonList(String.valueOf(privateKey))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("certificate")) { - return String.valueOf(certificate); + return certificate; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("privateKey")) { - return String.valueOf(privateKey); + return privateKey; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCertificate() { return certificate; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java index cbb9a020d13c..a787ee087c2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private SslCertificateList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (SslCertificate item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java index 1f42eb277e9b..01888013fbf9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private SslPoliciesList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (SslPolicy item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java index 58ef5f0038a9..83ff4bdd015d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private SslPoliciesListAvailableFeaturesResponse(List features) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("features") && features != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : features) { - stringList.add(item.toString()); - } - fieldMap.put("features", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("features")) { + return features; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("features")) { - return String.valueOf(features); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java index d002cc4c701f..ae708f653f4c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,97 +82,42 @@ private SslPolicy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("customFeatures") && customFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : customFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("customFeatures", stringList.build()); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : enabledFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("enabledFeatures", stringList.build()); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("minTlsVersion") && minTlsVersion != null) { - fieldMap.put("minTlsVersion", Collections.singletonList(String.valueOf(minTlsVersion))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("profile") && profile != null) { - fieldMap.put("profile", Collections.singletonList(String.valueOf(profile))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warnings") && warnings != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Warnings item : warnings) { - stringList.add(item.toString()); - } - fieldMap.put("warnings", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("customFeatures")) { - return String.valueOf(customFeatures); + return customFeatures; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("enabledFeatures")) { - return String.valueOf(enabledFeatures); + return enabledFeatures; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("minTlsVersion")) { - return String.valueOf(minTlsVersion); + return minTlsVersion; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("profile")) { - return String.valueOf(profile); + return profile; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warnings")) { - return String.valueOf(warnings); + return warnings; } return null; } @@ -188,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java index 245dfab14d8b..39637920f887 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private SslPolicyReference(String sslPolicy) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("sslPolicy") && sslPolicy != null) { - fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("sslPolicy")) { + return sslPolicy; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("sslPolicy")) { - return String.valueOf(sslPolicy); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java index 7903c82a18c7..4f3f05adc1a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private StartInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java index 6f13286785a2..b120c69e1c47 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,76 +75,36 @@ private StartWithEncryptionKeyInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("instancesStartWithEncryptionKeyRequestResource") - && instancesStartWithEncryptionKeyRequestResource != null) { - fieldMap.put( - "instancesStartWithEncryptionKeyRequestResource", - Collections.singletonList( - String.valueOf(instancesStartWithEncryptionKeyRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("instancesStartWithEncryptionKeyRequestResource")) { - return String.valueOf(instancesStartWithEncryptionKeyRequestResource); + return instancesStartWithEncryptionKeyRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -159,6 +115,12 @@ public InstancesStartWithEncryptionKeyRequest getApiMessageRequestBody() { return instancesStartWithEncryptionKeyRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java index 5aa9f03aee38..5d126ad32e95 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private StopInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java index b5616fa52c1a..ea18e7913c88 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,97 +86,45 @@ private Subnetwork( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("gatewayAddress") && gatewayAddress != null) { - fieldMap.put("gatewayAddress", Collections.singletonList(String.valueOf(gatewayAddress))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { - fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { - fieldMap.put( - "privateIpGoogleAccess", - Collections.singletonList(String.valueOf(privateIpGoogleAccess))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("secondaryIpRanges") && secondaryIpRanges != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (SubnetworkSecondaryRange item : secondaryIpRanges) { - stringList.add(item.toString()); - } - fieldMap.put("secondaryIpRanges", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("gatewayAddress")) { - return String.valueOf(gatewayAddress); + return gatewayAddress; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("ipCidrRange")) { - return String.valueOf(ipCidrRange); + return ipCidrRange; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("privateIpGoogleAccess")) { - return String.valueOf(privateIpGoogleAccess); + return privateIpGoogleAccess; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("secondaryIpRanges")) { - return String.valueOf(secondaryIpRanges); + return secondaryIpRanges; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -192,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java index 947025080ea9..99fd627600a5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private SubnetworkAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java index 5c097934afd2..9de9d5baf1f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private SubnetworkList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Subnetwork item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java index 0c9326ec20bd..eb0308bdfc60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private SubnetworkSecondaryRange(String ipCidrRange, String rangeName) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { - fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); - } - if (fieldNames.contains("rangeName") && rangeName != null) { - fieldMap.put("rangeName", Collections.singletonList(String.valueOf(rangeName))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("ipCidrRange")) { - return String.valueOf(ipCidrRange); + return ipCidrRange; } if (fieldName.equals("rangeName")) { - return String.valueOf(rangeName); + return rangeName; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIpCidrRange() { return ipCidrRange; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java index 87ded433931a..ae59ff1ad14a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private SubnetworksExpandIpCidrRangeRequest(String ipCidrRange) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { - fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return ipCidrRange; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("ipCidrRange")) { - return String.valueOf(ipCidrRange); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java index 4e95dd289f18..5bfb6e7c1222 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private SubnetworksScopedList(List subnetworks, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("subnetworks") && subnetworks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Subnetwork item : subnetworks) { - stringList.add(item.toString()); - } - fieldMap.put("subnetworks", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("subnetworks")) { - return String.valueOf(subnetworks); + return subnetworks; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getSubnetworksList() { return subnetworks; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java index 3a1b9d3b878a..e58dad72c307 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,27 +36,22 @@ private SubnetworksSetPrivateIpGoogleAccessRequest(Boolean privateIpGoogleAccess } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { - fieldMap.put( - "privateIpGoogleAccess", - Collections.singletonList(String.valueOf(privateIpGoogleAccess))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("privateIpGoogleAccess")) { + return privateIpGoogleAccess; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("privateIpGoogleAccess")) { - return String.valueOf(privateIpGoogleAccess); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java index 9fa3349e9153..3d4356db6fef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,66 +69,33 @@ private SwitchToCustomModeNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java index 888316c44aff..81500de7a425 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,42 +49,21 @@ private TCPHealthCheck( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("port") && port != null) { - fieldMap.put("port", Collections.singletonList(String.valueOf(port))); - } - if (fieldNames.contains("portName") && portName != null) { - fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); - } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); - } - if (fieldNames.contains("request") && request != null) { - fieldMap.put("request", Collections.singletonList(String.valueOf(request))); - } - if (fieldNames.contains("response") && response != null) { - fieldMap.put("response", Collections.singletonList(String.valueOf(response))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("port")) { - return String.valueOf(port); + return port; } if (fieldName.equals("portName")) { - return String.valueOf(portName); + return portName; } if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); + return proxyHeader; } if (fieldName.equals("request")) { - return String.valueOf(request); + return request; } if (fieldName.equals("response")) { - return String.valueOf(response); + return response; } return null; } @@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getPort() { return port; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java index ac201c3f237e..ef6f6e0a939b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private Tags(String fingerprint, List items) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java index 68c65cb2ee9c..8671056aade1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,55 +61,27 @@ private TargetHttpProxy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } return null; } @@ -124,6 +92,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java index 9d7c1cd4ac3c..550e9be4b4c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetHttpProxyList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetHttpProxy item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java index 498d2a85d90c..5b59aff31e11 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TargetHttpsProxiesSetSslCertificatesRequest(List sslCertificates } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("sslCertificates") && sslCertificates != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sslCertificates) { - stringList.add(item.toString()); - } - fieldMap.put("sslCertificates", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("sslCertificates")) { + return sslCertificates; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("sslCertificates")) { - return String.valueOf(sslCertificates); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java index fb8271a9a200..357612eca81f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,71 +70,33 @@ private TargetHttpsProxy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sslCertificates") && sslCertificates != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sslCertificates) { - stringList.add(item.toString()); - } - fieldMap.put("sslCertificates", stringList.build()); - } - if (fieldNames.contains("sslPolicy") && sslPolicy != null) { - fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sslCertificates")) { - return String.valueOf(sslCertificates); + return sslCertificates; } if (fieldName.equals("sslPolicy")) { - return String.valueOf(sslPolicy); + return sslPolicy; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } return null; } @@ -150,6 +107,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java index 634c86cfb5fa..e113c6e2b09d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetHttpsProxyList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetHttpsProxy item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java index 2a90d043466a..ae3f4b5cc9ae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,67 +69,33 @@ private TargetInstance( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("natPolicy") && natPolicy != null) { - fieldMap.put("natPolicy", Collections.singletonList(String.valueOf(natPolicy))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("natPolicy")) { - return String.valueOf(natPolicy); + return natPolicy; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -144,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java index 8a1ed62c3cbb..b53ae8011727 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private TargetInstanceAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java index 62be4396490b..991a0d378693 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetInstanceList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetInstance item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java index 6841771a144c..64398288fc9b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private TargetInstancesScopedList(List targetInstances, Warning } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("targetInstances") && targetInstances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetInstance item : targetInstances) { - stringList.add(item.toString()); - } - fieldMap.put("targetInstances", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("targetInstances")) { - return String.valueOf(targetInstances); + return targetInstances; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getTargetInstancesList() { return targetInstances; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java index 449ec391fcfc..eec752881690 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,93 +82,42 @@ private TargetPool( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("backupPool") && backupPool != null) { - fieldMap.put("backupPool", Collections.singletonList(String.valueOf(backupPool))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("failoverRatio") && failoverRatio != null) { - fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio))); - } - if (fieldNames.contains("healthChecks") && healthChecks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : healthChecks) { - stringList.add(item.toString()); - } - fieldMap.put("healthChecks", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) { - fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("backupPool")) { - return String.valueOf(backupPool); + return backupPool; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("failoverRatio")) { - return String.valueOf(failoverRatio); + return failoverRatio; } if (fieldName.equals("healthChecks")) { - return String.valueOf(healthChecks); + return healthChecks; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("instances")) { - return String.valueOf(instances); + return instances; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sessionAffinity")) { - return String.valueOf(sessionAffinity); + return sessionAffinity; } return null; } @@ -184,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBackupPool() { return backupPool; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java index 534839707fa1..52e333905b9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private TargetPoolAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java index de34cf340414..4cf8e8c1d042 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private TargetPoolInstanceHealth(List healthStatus, String kind) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("healthStatus") && healthStatus != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HealthStatus item : healthStatus) { - stringList.add(item.toString()); - } - fieldMap.put("healthStatus", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("healthStatus")) { - return String.valueOf(healthStatus); + return healthStatus; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getHealthStatusList() { return healthStatus; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java index a79ad4673848..60e4057ef6b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetPoolList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetPool item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java index dc49f449a4b9..d572f8a1be3f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TargetPoolsAddHealthCheckRequest(List healthChecks } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("healthChecks") && healthChecks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HealthCheckReference item : healthChecks) { - stringList.add(item.toString()); - } - fieldMap.put("healthChecks", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("healthChecks")) { + return healthChecks; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("healthChecks")) { - return String.valueOf(healthChecks); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java index be52b4653521..5899ad2cbe74 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TargetPoolsAddInstanceRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceReference item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java index 400b6fcc3f6a..dbeb40723bee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TargetPoolsRemoveHealthCheckRequest(List healthChe } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("healthChecks") && healthChecks != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HealthCheckReference item : healthChecks) { - stringList.add(item.toString()); - } - fieldMap.put("healthChecks", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("healthChecks")) { + return healthChecks; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("healthChecks")) { - return String.valueOf(healthChecks); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java index c03b31fd48cd..3d0c875689d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TargetPoolsRemoveInstanceRequest(List instances) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("instances") && instances != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (InstanceReference item : instances) { - stringList.add(item.toString()); - } - fieldMap.put("instances", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("instances")) { - return String.valueOf(instances); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java index 79bc8b5e8db6..8604dac74615 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private TargetPoolsScopedList(List targetPools, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("targetPools") && targetPools != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetPool item : targetPools) { - stringList.add(item.toString()); - } - fieldMap.put("targetPools", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("targetPools")) { - return String.valueOf(targetPools); + return targetPools; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getTargetPoolsList() { return targetPools; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java index c9282e24fafa..aafe660140e9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private TargetReference(String target) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("target") && target != null) { - fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("target")) { + return target; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("target")) { - return String.valueOf(target); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java index 5e811f2cc921..93585948f5dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private TargetSslProxiesSetBackendServiceRequest(String service) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("service") && service != null) { - fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("service")) { + return service; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("service")) { - return String.valueOf(service); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java index 5f1c1b9fc9b9..98dc4bf88056 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private TargetSslProxiesSetProxyHeaderRequest(String proxyHeader) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("proxyHeader")) { + return proxyHeader; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java index 9c9b7e8edafc..922cf0239499 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TargetSslProxiesSetSslCertificatesRequest(List sslCertificates) } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("sslCertificates") && sslCertificates != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sslCertificates) { - stringList.add(item.toString()); - } - fieldMap.put("sslCertificates", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("sslCertificates")) { + return sslCertificates; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("sslCertificates")) { - return String.valueOf(sslCertificates); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java index e0462ced07cf..d832bec89020 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,77 +74,36 @@ private TargetSslProxy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("service") && service != null) { - fieldMap.put("service", Collections.singletonList(String.valueOf(service))); - } - if (fieldNames.contains("sslCertificates") && sslCertificates != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : sslCertificates) { - stringList.add(item.toString()); - } - fieldMap.put("sslCertificates", stringList.build()); - } - if (fieldNames.contains("sslPolicy") && sslPolicy != null) { - fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); + return proxyHeader; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("service")) { - return String.valueOf(service); + return service; } if (fieldName.equals("sslCertificates")) { - return String.valueOf(sslCertificates); + return sslCertificates; } if (fieldName.equals("sslPolicy")) { - return String.valueOf(sslPolicy); + return sslPolicy; } return null; } @@ -160,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java index e5c08024a116..c99a0f47d210 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetSslProxyList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetSslProxy item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java index d0b6a82b0895..147e6d889373 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private TargetTcpProxiesSetBackendServiceRequest(String service) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("service") && service != null) { - fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("service")) { + return service; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("service")) { - return String.valueOf(service); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java index d7a1e88c441e..9e77f3319352 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private TargetTcpProxiesSetProxyHeaderRequest(String proxyHeader) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("proxyHeader")) { + return proxyHeader; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java index a694a28320e1..b6f7a888ce6c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private TargetTcpProxy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("proxyHeader") && proxyHeader != null) { - fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("service") && service != null) { - fieldMap.put("service", Collections.singletonList(String.valueOf(service))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("proxyHeader")) { - return String.valueOf(proxyHeader); + return proxyHeader; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("service")) { - return String.valueOf(service); + return service; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java index 77340a74321c..d7a118c6c3cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetTcpProxyList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetTcpProxy item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java index 43e0beaa5b26..70d886b3cb8e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -83,87 +78,39 @@ private TargetVpnGateway( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("forwardingRules") && forwardingRules != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : forwardingRules) { - stringList.add(item.toString()); - } - fieldMap.put("forwardingRules", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("tunnels") && tunnels != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : tunnels) { - stringList.add(item.toString()); - } - fieldMap.put("tunnels", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("forwardingRules")) { - return String.valueOf(forwardingRules); + return forwardingRules; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("tunnels")) { - return String.valueOf(tunnels); + return tunnels; } return null; } @@ -174,6 +121,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java index 36337ef7da0e..e461f3ffcfe8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private TargetVpnGatewayAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java index 1748b6d159f6..5c854db00c19 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private TargetVpnGatewayList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetVpnGateway item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java index 81f4c5bbe9ee..11cbdff73336 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private TargetVpnGatewaysScopedList(List targetVpnGateways, Wa } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("targetVpnGateways") && targetVpnGateways != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TargetVpnGateway item : targetVpnGateways) { - stringList.add(item.toString()); - } - fieldMap.put("targetVpnGateways", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("targetVpnGateways")) { - return String.valueOf(targetVpnGateways); + return targetVpnGateways; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getTargetVpnGatewaysList() { return targetVpnGateways; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java index 1604e2e56205..df706e89fc10 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,36 +45,18 @@ private TestFailure(String actualService, String expectedService, String host, S } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("actualService") && actualService != null) { - fieldMap.put("actualService", Collections.singletonList(String.valueOf(actualService))); - } - if (fieldNames.contains("expectedService") && expectedService != null) { - fieldMap.put("expectedService", Collections.singletonList(String.valueOf(expectedService))); - } - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("path") && path != null) { - fieldMap.put("path", Collections.singletonList(String.valueOf(path))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("actualService")) { - return String.valueOf(actualService); + return actualService; } if (fieldName.equals("expectedService")) { - return String.valueOf(expectedService); + return expectedService; } if (fieldName.equals("host")) { - return String.valueOf(host); + return host; } if (fieldName.equals("path")) { - return String.valueOf(path); + return path; } return null; } @@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getActualService() { return actualService; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java index 6efe2d8d36a8..f1ed4d30d813 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private TestIamPermissionsLicenseCodeHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); - } - if (fieldNames.contains("testPermissionsRequestResource") - && testPermissionsRequestResource != null) { - fieldMap.put( - "testPermissionsRequestResource", - Collections.singletonList(String.valueOf(testPermissionsRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("resource")) { - return String.valueOf(resource); + return resource; } if (fieldName.equals("testPermissionsRequestResource")) { - return String.valueOf(testPermissionsRequestResource); + return testPermissionsRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public TestPermissionsRequest getApiMessageRequestBody() { return testPermissionsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java index 5406f9caf1bf..3813b199cda8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private TestIamPermissionsLicenseHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); - } - if (fieldNames.contains("testPermissionsRequestResource") - && testPermissionsRequestResource != null) { - fieldMap.put( - "testPermissionsRequestResource", - Collections.singletonList(String.valueOf(testPermissionsRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("resource")) { - return String.valueOf(resource); + return resource; } if (fieldName.equals("testPermissionsRequestResource")) { - return String.valueOf(testPermissionsRequestResource); + return testPermissionsRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public TestPermissionsRequest getApiMessageRequestBody() { return testPermissionsRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java index 8dba23a1ec59..ff9b408e5c8b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TestPermissionsRequest(List permissions) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("permissions") && permissions != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : permissions) { - stringList.add(item.toString()); - } - fieldMap.put("permissions", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("permissions")) { + return permissions; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("permissions")) { - return String.valueOf(permissions); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java index 13f16f8653e7..8f29bbd7bce2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java @@ -17,13 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,29 +37,22 @@ private TestPermissionsResponse(List permissions) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("permissions") && permissions != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : permissions) { - stringList.add(item.toString()); - } - fieldMap.put("permissions", stringList.build()); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("permissions")) { + return permissions; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("permissions")) { - return String.valueOf(permissions); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java index e3e75cba5335..29f7d04ec065 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private UpdateAccessConfigInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { - fieldMap.put( - "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); - } - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("networkInterface") && networkInterface != null) { - fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("accessConfigResource")) { - return String.valueOf(accessConfigResource); + return accessConfigResource; } if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("networkInterface")) { - return String.valueOf(networkInterface); + return networkInterface; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -164,6 +120,12 @@ public AccessConfig getApiMessageRequestBody() { return accessConfigResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public AccessConfig getAccessConfigResource() { return accessConfigResource; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index b8a2a198ba0b..920298766bd9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private UpdateAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("autoscalerResource")) { - return String.valueOf(autoscalerResource); + return autoscalerResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -164,6 +120,12 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java index ac9b68154816..b65298c9dbd2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private UpdateBackendBucketHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendBucket") && backendBucket != null) { - fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); - } - if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { - fieldMap.put( - "backendBucketResource", - Collections.singletonList(String.valueOf(backendBucketResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendBucket")) { - return String.valueOf(backendBucket); + return backendBucket; } if (fieldName.equals("backendBucketResource")) { - return String.valueOf(backendBucketResource); + return backendBucketResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendBucket getApiMessageRequestBody() { return backendBucketResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index e403c03d0963..3a062cd41727 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private UpdateBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put( - "backendServiceResource", - Collections.singletonList(String.valueOf(backendServiceResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("backendServiceResource")) { - return String.valueOf(backendServiceResource); + return backendServiceResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index 1859339a9a09..842388fa957d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private UpdateFirewallHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("firewall") && firewall != null) { - fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); - } - if (fieldNames.contains("firewallResource") && firewallResource != null) { - fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("firewall")) { - return String.valueOf(firewall); + return firewall; } if (fieldName.equals("firewallResource")) { - return String.valueOf(firewallResource); + return firewallResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Firewall getApiMessageRequestBody() { return firewallResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index 023f73d37af1..124fdd56446a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,73 +73,36 @@ private UpdateHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("healthCheck") && healthCheck != null) { - fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); - } - if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { - fieldMap.put( - "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("healthCheck")) { - return String.valueOf(healthCheck); + return healthCheck; } if (fieldName.equals("healthCheckResource")) { - return String.valueOf(healthCheckResource); + return healthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -154,6 +113,12 @@ public HealthCheck getApiMessageRequestBody() { return healthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index 69dcd7676c08..0f5ebb9d1d7b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -33,7 +29,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpHealthCheck; - private final HttpHealthCheck2 httpHealthCheckResource; + private final HttpHealthCheck httpHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +54,7 @@ private UpdateHttpHealthCheckHttpRequest( String callback, String fields, String httpHealthCheck, - HttpHealthCheck2 httpHealthCheckResource, + HttpHealthCheck httpHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -77,84 +73,52 @@ private UpdateHttpHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { - fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); - } - if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { - fieldMap.put( - "httpHealthCheckResource", - Collections.singletonList(String.valueOf(httpHealthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpHealthCheck")) { - return String.valueOf(httpHealthCheck); + return httpHealthCheck; } if (fieldName.equals("httpHealthCheckResource")) { - return String.valueOf(httpHealthCheckResource); + return httpHealthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @Nullable @Override - public HttpHealthCheck2 getApiMessageRequestBody() { + public HttpHealthCheck getApiMessageRequestBody() { return httpHealthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } @@ -171,7 +135,7 @@ public String getHttpHealthCheck() { return httpHealthCheck; } - public HttpHealthCheck2 getHttpHealthCheckResource() { + public HttpHealthCheck getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -222,7 +186,7 @@ public static class Builder { private String callback; private String fields; private String httpHealthCheck; - private HttpHealthCheck2 httpHealthCheckResource; + private HttpHealthCheck httpHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +279,11 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { return this; } - public HttpHealthCheck2 getHttpHealthCheckResource() { + public HttpHealthCheck getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index 311f25262dde..e854e23981de 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -33,7 +29,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String callback; private final String fields; private final String httpsHealthCheck; - private final HttpsHealthCheck2 httpsHealthCheckResource; + private final HttpsHealthCheck httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -58,7 +54,7 @@ private UpdateHttpsHealthCheckHttpRequest( String callback, String fields, String httpsHealthCheck, - HttpsHealthCheck2 httpsHealthCheckResource, + HttpsHealthCheck httpsHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -77,84 +73,52 @@ private UpdateHttpsHealthCheckHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { - fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); - } - if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { - fieldMap.put( - "httpsHealthCheckResource", - Collections.singletonList(String.valueOf(httpsHealthCheckResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("httpsHealthCheck")) { - return String.valueOf(httpsHealthCheck); + return httpsHealthCheck; } if (fieldName.equals("httpsHealthCheckResource")) { - return String.valueOf(httpsHealthCheckResource); + return httpsHealthCheckResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @Nullable @Override - public HttpsHealthCheck2 getApiMessageRequestBody() { + public HttpsHealthCheck getApiMessageRequestBody() { return httpsHealthCheckResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } @@ -171,7 +135,7 @@ public String getHttpsHealthCheck() { return httpsHealthCheck; } - public HttpsHealthCheck2 getHttpsHealthCheckResource() { + public HttpsHealthCheck getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -222,7 +186,7 @@ public static class Builder { private String callback; private String fields; private String httpsHealthCheck; - private HttpsHealthCheck2 httpsHealthCheckResource; + private HttpsHealthCheck httpsHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -315,11 +279,11 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { return this; } - public HttpsHealthCheck2 getHttpsHealthCheckResource() { + public HttpsHealthCheck getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java index d059bd42e620..d3df8f05ee54 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,80 +77,39 @@ private UpdateNetworkInterfaceInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("networkInterface") && networkInterface != null) { - fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); - } - if (fieldNames.contains("networkInterfaceResource") && networkInterfaceResource != null) { - fieldMap.put( - "networkInterfaceResource", - Collections.singletonList(String.valueOf(networkInterfaceResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("networkInterface")) { - return String.valueOf(networkInterface); + return networkInterface; } if (fieldName.equals("networkInterfaceResource")) { - return String.valueOf(networkInterfaceResource); + return networkInterfaceResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -165,6 +120,12 @@ public NetworkInterface getApiMessageRequestBody() { return networkInterfaceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index 26014c33180f..465949ddbfb0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private UpdateRegionAutoscalerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("autoscaler") && autoscaler != null) { - fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); - } - if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { - fieldMap.put( - "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("autoscaler")) { - return String.valueOf(autoscaler); + return autoscaler; } if (fieldName.equals("autoscalerResource")) { - return String.valueOf(autoscalerResource); + return autoscalerResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -164,6 +120,12 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index e6a829c34afe..26e9d41705d0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,74 +73,36 @@ private UpdateRegionBackendServiceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("backendService") && backendService != null) { - fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); - } - if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { - fieldMap.put( - "backendServiceResource", - Collections.singletonList(String.valueOf(backendServiceResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("backendService")) { - return String.valueOf(backendService); + return backendService; } if (fieldName.equals("backendServiceResource")) { - return String.valueOf(backendServiceResource); + return backendServiceResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index e5e3b508f1ce..135bab99e8ef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private UpdateRouterHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("routerResource") && routerResource != null) { - fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("routerResource")) { - return String.valueOf(routerResource); + return routerResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public Router getApiMessageRequestBody() { return routerResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index 553a99a61431..e603cabbbdba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,72 +73,36 @@ private UpdateUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - if (fieldNames.contains("urlMapResource") && urlMapResource != null) { - fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } if (fieldName.equals("urlMapResource")) { - return String.valueOf(urlMapResource); + return urlMapResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -153,6 +113,12 @@ public UrlMap getApiMessageRequestBody() { return urlMapResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java index 8d3e1ce15fb2..8480218f299c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -83,91 +78,39 @@ private UrlMap( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("defaultService") && defaultService != null) { - fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("hostRules") && hostRules != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (HostRule item : hostRules) { - stringList.add(item.toString()); - } - fieldMap.put("hostRules", stringList.build()); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("pathMatchers") && pathMatchers != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (PathMatcher item : pathMatchers) { - stringList.add(item.toString()); - } - fieldMap.put("pathMatchers", stringList.build()); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("tests") && tests != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (UrlMapTest item : tests) { - stringList.add(item.toString()); - } - fieldMap.put("tests", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("defaultService")) { - return String.valueOf(defaultService); + return defaultService; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("hostRules")) { - return String.valueOf(hostRules); + return hostRules; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("pathMatchers")) { - return String.valueOf(pathMatchers); + return pathMatchers; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("tests")) { - return String.valueOf(tests); + return tests; } return null; } @@ -178,6 +121,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java index 073f4c2050b3..01de00a6b4b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private UrlMapList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (UrlMap item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java index 54eac934b2bb..eedff2c1705e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private UrlMapReference(String urlMap) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("urlMap")) { + return urlMap; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java index 6c9cee06b282..3807f0fcc592 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,36 +45,18 @@ private UrlMapTest(String description, String host, String path, String service) } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("host") && host != null) { - fieldMap.put("host", Collections.singletonList(String.valueOf(host))); - } - if (fieldNames.contains("path") && path != null) { - fieldMap.put("path", Collections.singletonList(String.valueOf(path))); - } - if (fieldNames.contains("service") && service != null) { - fieldMap.put("service", Collections.singletonList(String.valueOf(service))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("host")) { - return String.valueOf(host); + return host; } if (fieldName.equals("path")) { - return String.valueOf(path); + return path; } if (fieldName.equals("service")) { - return String.valueOf(service); + return service; } return null; } @@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDescription() { return description; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java index 1d006f36b0da..57a9eef7757b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -55,44 +50,18 @@ private UrlMapValidationResult( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("loadErrors") && loadErrors != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : loadErrors) { - stringList.add(item.toString()); - } - fieldMap.put("loadErrors", stringList.build()); - } - if (fieldNames.contains("loadSucceeded") && loadSucceeded != null) { - fieldMap.put("loadSucceeded", Collections.singletonList(String.valueOf(loadSucceeded))); - } - if (fieldNames.contains("testFailures") && testFailures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (TestFailure item : testFailures) { - stringList.add(item.toString()); - } - fieldMap.put("testFailures", stringList.build()); - } - if (fieldNames.contains("testPassed") && testPassed != null) { - fieldMap.put("testPassed", Collections.singletonList(String.valueOf(testPassed))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("loadErrors")) { - return String.valueOf(loadErrors); + return loadErrors; } if (fieldName.equals("loadSucceeded")) { - return String.valueOf(loadSucceeded); + return loadSucceeded; } if (fieldName.equals("testFailures")) { - return String.valueOf(testFailures); + return testFailures; } if (fieldName.equals("testPassed")) { - return String.valueOf(testPassed); + return testPassed; } return null; } @@ -103,6 +72,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getLoadErrorsList() { return loadErrors; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java index 67ad5ece8a64..b966c622365a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private UrlMapsValidateRequest(UrlMap resource) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("resource") && resource != null) { - fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("resource")) { + return resource; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("resource")) { - return String.valueOf(resource); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java index aada951cc3e3..5ea9b6d68757 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +36,22 @@ private UrlMapsValidateResponse(UrlMapValidationResult result) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("result") && result != null) { - fieldMap.put("result", Collections.singletonList(String.valueOf(result))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("result")) { + return result; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("result")) { - return String.valueOf(result); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java index 0e8d805e19f6..bc102b38b4a5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private UsageExportLocation(String bucketName, String reportNamePrefix) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("bucketName") && bucketName != null) { - fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); - } - if (fieldNames.contains("reportNamePrefix") && reportNamePrefix != null) { - fieldMap.put("reportNamePrefix", Collections.singletonList(String.valueOf(reportNamePrefix))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("bucketName")) { - return String.valueOf(bucketName); + return bucketName; } if (fieldName.equals("reportNamePrefix")) { - return String.valueOf(reportNamePrefix); + return reportNamePrefix; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBucketName() { return bucketName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java index 50a4ff2a3d32..1e5b6f4c84f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private ValidateUrlMapHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("urlMap") && urlMap != null) { - fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); - } - if (fieldNames.contains("urlMapsValidateRequestResource") - && urlMapsValidateRequestResource != null) { - fieldMap.put( - "urlMapsValidateRequestResource", - Collections.singletonList(String.valueOf(urlMapsValidateRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("urlMap")) { - return String.valueOf(urlMap); + return urlMap; } if (fieldName.equals("urlMapsValidateRequestResource")) { - return String.valueOf(urlMapsValidateRequestResource); + return urlMapsValidateRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -146,6 +106,12 @@ public UrlMapsValidateRequest getApiMessageRequestBody() { return urlMapsValidateRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java index d00ea6107360..b363aa3aa3d5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -107,123 +102,57 @@ private VpnTunnel( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("detailedStatus") && detailedStatus != null) { - fieldMap.put("detailedStatus", Collections.singletonList(String.valueOf(detailedStatus))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("ikeVersion") && ikeVersion != null) { - fieldMap.put("ikeVersion", Collections.singletonList(String.valueOf(ikeVersion))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("localTrafficSelector") && localTrafficSelector != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : localTrafficSelector) { - stringList.add(item.toString()); - } - fieldMap.put("localTrafficSelector", stringList.build()); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("peerIp") && peerIp != null) { - fieldMap.put("peerIp", Collections.singletonList(String.valueOf(peerIp))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("remoteTrafficSelector") && remoteTrafficSelector != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : remoteTrafficSelector) { - stringList.add(item.toString()); - } - fieldMap.put("remoteTrafficSelector", stringList.build()); - } - if (fieldNames.contains("router") && router != null) { - fieldMap.put("router", Collections.singletonList(String.valueOf(router))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("sharedSecret") && sharedSecret != null) { - fieldMap.put("sharedSecret", Collections.singletonList(String.valueOf(sharedSecret))); - } - if (fieldNames.contains("sharedSecretHash") && sharedSecretHash != null) { - fieldMap.put("sharedSecretHash", Collections.singletonList(String.valueOf(sharedSecretHash))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { - fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("detailedStatus")) { - return String.valueOf(detailedStatus); + return detailedStatus; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("ikeVersion")) { - return String.valueOf(ikeVersion); + return ikeVersion; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("localTrafficSelector")) { - return String.valueOf(localTrafficSelector); + return localTrafficSelector; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("peerIp")) { - return String.valueOf(peerIp); + return peerIp; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("remoteTrafficSelector")) { - return String.valueOf(remoteTrafficSelector); + return remoteTrafficSelector; } if (fieldName.equals("router")) { - return String.valueOf(router); + return router; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("sharedSecret")) { - return String.valueOf(sharedSecret); + return sharedSecret; } if (fieldName.equals("sharedSecretHash")) { - return String.valueOf(sharedSecretHash); + return sharedSecretHash; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("targetVpnGateway")) { - return String.valueOf(targetVpnGateway); + return targetVpnGateway; } return null; } @@ -234,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java index 9dc39b6f3bdc..0d492688936a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private VpnTunnelAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java index 3b6b900db1fd..7205aa4a8647 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private VpnTunnelList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (VpnTunnel item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java index 8c08a390bf52..ea1e23fb9162 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private VpnTunnelsScopedList(List vpnTunnels, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("vpnTunnels") && vpnTunnels != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (VpnTunnel item : vpnTunnels) { - stringList.add(item.toString()); - } - fieldMap.put("vpnTunnels", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("vpnTunnels")) { - return String.valueOf(vpnTunnels); + return vpnTunnels; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getVpnTunnelsList() { return vpnTunnels; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java index 8728216ff0df..b9b8ed6c959d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -48,34 +43,15 @@ private Warning(String code, List data, String message) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("code") && code != null) { - fieldMap.put("code", Collections.singletonList(String.valueOf(code))); - } - if (fieldNames.contains("data") && data != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Data item : data) { - stringList.add(item.toString()); - } - fieldMap.put("data", stringList.build()); - } - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("code")) { - return String.valueOf(code); + return code; } if (fieldName.equals("data")) { - return String.valueOf(data); + return data; } if (fieldName.equals("message")) { - return String.valueOf(message); + return message; } return null; } @@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCode() { return code; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java index 4620e964b2d7..ac9609a33607 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -48,34 +43,15 @@ private Warnings(String code, List data, String message) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("code") && code != null) { - fieldMap.put("code", Collections.singletonList(String.valueOf(code))); - } - if (fieldNames.contains("data") && data != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Data item : data) { - stringList.add(item.toString()); - } - fieldMap.put("data", stringList.build()); - } - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("code")) { - return String.valueOf(code); + return code; } if (fieldName.equals("data")) { - return String.valueOf(data); + return data; } if (fieldName.equals("message")) { - return String.valueOf(message); + return message; } return null; } @@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCode() { return code; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java index 43273af679dc..da89eeaf4e6b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private XpnHostList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Project item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java index 130421428275..810cc2aa1797 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private XpnResourceId(String id, String type) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java index e1e7afeb2e8d..8406d81a7481 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -79,77 +74,36 @@ private Zone( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("availableCpuPlatforms") && availableCpuPlatforms != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : availableCpuPlatforms) { - stringList.add(item.toString()); - } - fieldMap.put("availableCpuPlatforms", stringList.build()); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("availableCpuPlatforms")) { - return String.valueOf(availableCpuPlatforms); + return availableCpuPlatforms; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } return null; } @@ -160,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAvailableCpuPlatformsList() { return availableCpuPlatforms; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java index c73bc4b7f84a..a4085a18b4bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private ZoneList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Zone item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java index af3946d967c1..e2a6f547e87b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +40,12 @@ private ZoneSetLabelsRequest(String labelFingerprint, Map labels } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { - fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("labelFingerprint")) { - return String.valueOf(labelFingerprint); + return labelFingerprint; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } return null; } @@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getLabelFingerprint() { return labelFingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java index 84676af100df..99fb95da714d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java @@ -22,7 +22,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck2; +import com.google.cloud.compute.v1.HttpHealthCheck; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -48,7 +48,7 @@ public abstract class HttpHealthCheckStub implements BackgroundResource { } @BetaApi - public UnaryCallable + public UnaryCallable getHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpHealthCheckCallable()"); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java index 6ce448ba8aed..50dbb2708863 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java @@ -41,7 +41,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck2; +import com.google.cloud.compute.v1.HttpHealthCheck; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -100,7 +100,7 @@ public class HttpHealthCheckStubSettings extends StubSettings deleteHttpHealthCheckSettings; - private final UnaryCallSettings + private final UnaryCallSettings getHttpHealthCheckSettings; private final UnaryCallSettings insertHttpHealthCheckSettings; @@ -119,7 +119,7 @@ public class HttpHealthCheckStubSettings extends StubSettings + public UnaryCallSettings getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } @@ -233,10 +233,10 @@ protected HttpHealthCheckStubSettings(Builder settingsBuilder) throws IOExceptio } private static final PagedListDescriptor< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2> + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck> LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC = new PagedListDescriptor< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2>() { + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck>() { @Override public String emptyToken() { return ""; @@ -269,7 +269,7 @@ public String extractNextToken(HttpHealthCheckList payload) { } @Override - public Iterable extractResources(HttpHealthCheckList payload) { + public Iterable extractResources(HttpHealthCheckList payload) { return payload.getItemsList(); } }; @@ -286,7 +286,7 @@ public ApiFuture getFuturePagedResponse( ListHttpHealthChecksHttpRequest request, ApiCallContext context, ApiFuture futureResponse) { - PageContext + PageContext pageContext = PageContext.create( callable, LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC, request, context); @@ -300,7 +300,7 @@ public static class Builder extends StubSettings.Builder deleteHttpHealthCheckSettings; - private final UnaryCallSettings.Builder + private final UnaryCallSettings.Builder getHttpHealthCheckSettings; private final UnaryCallSettings.Builder insertHttpHealthCheckSettings; @@ -465,7 +465,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index 694e165658c9..8fd485ced4b0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -32,7 +32,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck2; +import com.google.cloud.compute.v1.HttpHealthCheck; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -78,9 +78,9 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .build(); @InternalApi - public static final ApiMethodDescriptor + public static final ApiMethodDescriptor getHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() + ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.httpHealthChecks.get") .setHttpMethod(HttpMethods.GET) .setRequestFormatter( @@ -94,8 +94,8 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setResourceNameField("httpHealthCheck") .build()) .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpHealthCheck2.getDefaultInstance()) + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheck.getDefaultInstance()) .build()) .build(); @@ -188,7 +188,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { private final UnaryCallable deleteHttpHealthCheckCallable; - private final UnaryCallable + private final UnaryCallable getHttpHealthCheckCallable; private final UnaryCallable insertHttpHealthCheckCallable; @@ -247,9 +247,9 @@ protected HttpJsonHttpHealthCheckStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteHttpHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings + HttpJsonCallSettings getHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() + HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHttpHealthCheckMethodDescriptor) .build(); HttpJsonCallSettings @@ -319,7 +319,7 @@ protected HttpJsonHttpHealthCheckStub( } @BetaApi - public UnaryCallable + public UnaryCallable getHttpHealthCheckCallable() { return getHttpHealthCheckCallable; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 5715b291ee87..b5084e0ac3d4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -32,7 +32,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck2; +import com.google.cloud.compute.v1.HttpsHealthCheck; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -78,9 +78,9 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .build(); @InternalApi - public static final ApiMethodDescriptor + public static final ApiMethodDescriptor getHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() + ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.httpsHealthChecks.get") .setHttpMethod(HttpMethods.GET) .setRequestFormatter( @@ -94,8 +94,8 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setResourceNameField("httpsHealthCheck") .build()) .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpsHealthCheck2.getDefaultInstance()) + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheck.getDefaultInstance()) .build()) .build(); @@ -188,7 +188,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { private final UnaryCallable deleteHttpsHealthCheckCallable; - private final UnaryCallable + private final UnaryCallable getHttpsHealthCheckCallable; private final UnaryCallable insertHttpsHealthCheckCallable; @@ -247,9 +247,9 @@ protected HttpJsonHttpsHealthCheckStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteHttpsHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings + HttpJsonCallSettings getHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() + HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHttpsHealthCheckMethodDescriptor) .build(); HttpJsonCallSettings @@ -320,7 +320,7 @@ protected HttpJsonHttpsHealthCheckStub( } @BetaApi - public UnaryCallable + public UnaryCallable getHttpsHealthCheckCallable() { return getHttpsHealthCheckCallable; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index fd8c36e81bdb..dbd16579a853 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -22,7 +22,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck2; +import com.google.cloud.compute.v1.HttpsHealthCheck; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -48,7 +48,7 @@ public abstract class HttpsHealthCheckStub implements BackgroundResource { } @BetaApi - public UnaryCallable + public UnaryCallable getHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java index e32cc939ca47..3698c670fda5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java @@ -41,7 +41,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck2; +import com.google.cloud.compute.v1.HttpsHealthCheck; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -100,7 +100,7 @@ public class HttpsHealthCheckStubSettings extends StubSettings deleteHttpsHealthCheckSettings; - private final UnaryCallSettings + private final UnaryCallSettings getHttpsHealthCheckSettings; private final UnaryCallSettings insertHttpsHealthCheckSettings; @@ -120,7 +120,7 @@ public class HttpsHealthCheckStubSettings extends StubSettings + public UnaryCallSettings getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } @@ -235,10 +235,10 @@ protected HttpsHealthCheckStubSettings(Builder settingsBuilder) throws IOExcepti } private static final PagedListDescriptor< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2> + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck> LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC = new PagedListDescriptor< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2>() { + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck>() { @Override public String emptyToken() { return ""; @@ -271,7 +271,7 @@ public String extractNextToken(HttpsHealthCheckList payload) { } @Override - public Iterable extractResources(HttpsHealthCheckList payload) { + public Iterable extractResources(HttpsHealthCheckList payload) { return payload.getItemsList(); } }; @@ -289,7 +289,7 @@ public ApiFuture getFuturePagedResponse( ListHttpsHealthChecksHttpRequest request, ApiCallContext context, ApiFuture futureResponse) { - PageContext + PageContext pageContext = PageContext.create( callable, LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC, request, context); @@ -303,7 +303,7 @@ public static class Builder extends StubSettings.Builder deleteHttpsHealthCheckSettings; - private final UnaryCallSettings.Builder + private final UnaryCallSettings.Builder getHttpsHealthCheckSettings; private final UnaryCallSettings.Builder insertHttpsHealthCheckSettings; @@ -469,7 +469,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index e0af34e68892..77f3d4937785 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -194,8 +194,8 @@ public void getHttpHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpHealthCheck2 expectedResponse = - HttpHealthCheck2.newBuilder() + HttpHealthCheck expectedResponse = + HttpHealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) .setKind(kind) .setDescription(description) @@ -215,7 +215,7 @@ public void getHttpHealthCheckTest() { ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck2 actualResponse = client.getHttpHealthCheck(httpHealthCheck); + HttpHealthCheck actualResponse = client.getHttpHealthCheck(httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -304,7 +304,7 @@ public void insertHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); @@ -336,7 +336,7 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); Assert.fail("No exception raised"); @@ -352,8 +352,8 @@ public void listHttpHealthChecksTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - HttpHealthCheck2 itemsElement = HttpHealthCheck2.newBuilder().build(); - List items = Arrays.asList(itemsElement); + HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); + List items = Arrays.asList(itemsElement); HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() .setKind(kind) @@ -368,7 +368,7 @@ public void listHttpHealthChecksTest() { ListHttpHealthChecksPagedResponse pagedListResponse = client.listHttpHealthChecks(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); @@ -458,7 +458,7 @@ public void patchHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -491,7 +491,7 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); @@ -553,7 +553,7 @@ public void updateHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); Operation actualResponse = client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -586,7 +586,7 @@ public void updateHttpHealthCheckExceptionTest() throws Exception { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); + HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index efe3e12c9789..d4eb7be0cc59 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -194,8 +194,8 @@ public void getHttpsHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpsHealthCheck2 expectedResponse = - HttpsHealthCheck2.newBuilder() + HttpsHealthCheck expectedResponse = + HttpsHealthCheck.newBuilder() .setCheckIntervalSec(checkIntervalSec) .setKind(kind) .setDescription(description) @@ -215,7 +215,7 @@ public void getHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - HttpsHealthCheck2 actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); + HttpsHealthCheck actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -304,7 +304,7 @@ public void insertHttpsHealthCheckTest() { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); Operation actualResponse = client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); @@ -336,7 +336,7 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); Assert.fail("No exception raised"); @@ -352,8 +352,8 @@ public void listHttpsHealthChecksTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - HttpsHealthCheck2 itemsElement = HttpsHealthCheck2.newBuilder().build(); - List items = Arrays.asList(itemsElement); + HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); + List items = Arrays.asList(itemsElement); HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() .setKind(kind) @@ -368,7 +368,7 @@ public void listHttpsHealthChecksTest() { ListHttpsHealthChecksPagedResponse pagedListResponse = client.listHttpsHealthChecks(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); @@ -458,7 +458,7 @@ public void patchHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); Operation actualResponse = client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); @@ -491,7 +491,7 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); @@ -553,7 +553,7 @@ public void updateHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); Operation actualResponse = client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); @@ -586,7 +586,7 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); + HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java new file mode 100644 index 000000000000..3fb3510ed0cc --- /dev/null +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java @@ -0,0 +1,144 @@ +package com.google.cloud.examples.discocompute; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.cloud.compute.v1.*; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + +/** + * Use gax-java and generated message type to List Addresses in a test GCP Compute project. + */ +public class JsonComputeExample { + private static String PROJECT_NAME = "gapic-test"; + private static String REGION = "us-central1"; + + public static void main(String[] args) throws Exception { + try { + AddressClient addressClient = createCredentialedClient(); + runExampleWithGapicGen(addressClient); + System.out.println("-------------------------------------------------------"); + runExampleWithGapicGenResourceName(addressClient); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static AddressClient createCredentialedClient() throws IOException { + Credentials myCredentials = GoogleCredentials.getApplicationDefault(); + String myEndpoint = AddressSettings.getDefaultEndpoint(); + + // Begin samplegen code. This combines the "customize credentials" and "customize the endpoint" samples. + AddressSettings addressSettings = + AddressSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .setTransportChannelProvider( + AddressSettings.defaultHttpJsonTransportProviderBuilder() + .setEndpoint(myEndpoint).build()).build(); + AddressClient addressClient = + AddressClient.create(addressSettings); + // End samplegen code. + + return addressClient; + } + + // A basic List Address example. + private static void runExampleWithGapicGen(AddressClient client) { + System.out.println("Running with Gapic Client."); + AddressClient.ListAddressesPagedResponse listResponse = listAddresses(client); + verifyListAddressWithGets(client, listResponse); + } + + // Insert an address, and then delete the address. Use ResourceNames in the request objects. + private static void runExampleWithGapicGenResourceName(AddressClient client) { + System.out.println("Running with Gapic Client and Resource Name."); + String newAddressName = "usseaparkview"; + System.out.println("Inserting address:"); + + insertNewAddressJustClient(client, newAddressName); + + listAddresses(client); + + System.out.println("Deleting address:"); + Operation deleteResponse = client.deleteAddress( + ProjectRegionAddressName.of(newAddressName, PROJECT_NAME, REGION), null); + System.out.format("Result of delete: %s\n", deleteResponse.toString()); + int sleepTimeInSeconds = 3; + System.out.format("Waiting %d seconds for server to update...\n", sleepTimeInSeconds); + // Wait for the delete operation to finish on the server. + try { + TimeUnit.SECONDS.sleep(sleepTimeInSeconds); + } catch (InterruptedException e) { + e.printStackTrace(); + } + listAddresses(client); + } + + private static void insertNewAddressJustClient(AddressClient client, String newAddressName) { + // Begin samplegen code for insertAddress(). + Address newAddress = Address.newBuilder().setName(newAddressName).build(); + ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION); + Operation response = client.insertAddress(null, region, newAddress); + // End samplegen code for insertAddress(). + System.out.format("Result of insert: %s\n", response.toString()); + } + + private static void insertNewAddressUsingRequest(AddressClient client, String newAddressName) + throws InterruptedException, ExecutionException { + // Begin samplegen code for insertAddress(). + ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION); + Address address = Address.newBuilder().build(); + InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() + .setRegion(region.toString()) + .setAddressResource(address) + .build(); + // Do something + Operation response = client.insertAddress(request); + + // End samplegen code for insertAddress(). + System.out.format("Result of insert: %s\n", response.toString()); + } + + private static void insertAddressUsingCallable(AddressClient client, String newAddressName) + throws InterruptedException, ExecutionException { + // Begin samplegen code for insertAddress(). + ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION); + Address address = Address.newBuilder().build(); + InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() + .setRegion(region.toString()) + .setAddressResource(address) + .build(); + ApiFuture future = client.insertAddressCallable().futureCall(request); + // Do something + Operation response = future.get(); + + // End samplegen code for insertAddress(). + System.out.format("Result of insert: %s\n", response.toString()); + } + + private static AddressClient.ListAddressesPagedResponse listAddresses(AddressClient client) { + System.out.println("Listing addresses:"); + ProjectRegionName regionName = ProjectRegionName.newBuilder().setRegion(REGION).setProject(PROJECT_NAME).build(); + ListAddressesHttpRequest listRequest = ListAddressesHttpRequest.newBuilder() + .setRegion(regionName.toString()) + .build(); + AddressClient.ListAddressesPagedResponse response = client.listAddresses(listRequest); + for (Address address : response.iterateAll()) { + System.out.println("\t - " + address.toString()); + } + return response; + } + + private static void verifyListAddressWithGets(AddressClient client, AddressClient.ListAddressesPagedResponse listResponse) { + for (Address address : listResponse.iterateAll()) { + System.out.format("Making get request for address \"%s\"...\n", address.getName()); + Address fetchedAddress = client.getAddress( + ProjectRegionAddressName.of(address.getName(), PROJECT_NAME, REGION)); + System.out.format("addresses.get returns \n\t%s\n\n", fetchedAddress.toString()); + } + } +} \ No newline at end of file From 6fbed2075c8013b7e06095f98daed59f62b3ccf7 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 3 May 2018 23:03:06 -0700 Subject: [PATCH 30/42] update from toolkit fork --- .../v1/PatchAutoscalerHttpRequest.java | 3 +- .../v1/PatchBackendBucketHttpRequest.java | 3 +- .../v1/PatchBackendServiceHttpRequest.java | 3 +- .../compute/v1/PatchFirewallHttpRequest.java | 3 +- .../v1/PatchHealthCheckHttpRequest.java | 3 +- .../v1/PatchHttpHealthCheckHttpRequest.java | 3 +- .../v1/PatchHttpsHealthCheckHttpRequest.java | 3 +- .../v1/PatchInterconnectHttpRequest.java | 3 +- .../compute/v1/PatchNetworkHttpRequest.java | 3 +- .../v1/PatchRegionAutoscalerHttpRequest.java | 3 +- .../PatchRegionBackendServiceHttpRequest.java | 3 +- .../compute/v1/PatchRouterHttpRequest.java | 3 +- .../compute/v1/PatchSslPolicyHttpRequest.java | 3 +- .../v1/PatchSubnetworkHttpRequest.java | 3 +- .../compute/v1/PatchUrlMapHttpRequest.java | 3 +- .../v1/UpdateAutoscalerHttpRequest.java | 3 +- .../v1/UpdateBackendBucketHttpRequest.java | 3 +- .../v1/UpdateBackendServiceHttpRequest.java | 3 +- .../compute/v1/UpdateFirewallHttpRequest.java | 3 +- .../v1/UpdateHealthCheckHttpRequest.java | 3 +- .../v1/UpdateHttpHealthCheckHttpRequest.java | 3 +- .../v1/UpdateHttpsHealthCheckHttpRequest.java | 3 +- ...teNetworkInterfaceInstanceHttpRequest.java | 3 +- .../v1/UpdateRegionAutoscalerHttpRequest.java | 3 +- ...UpdateRegionBackendServiceHttpRequest.java | 3 +- .../compute/v1/UpdateRouterHttpRequest.java | 3 +- .../compute/v1/UpdateUrlMapHttpRequest.java | 3 +- .../v1/stub/HttpJsonAcceleratorTypeStub.java | 4 --- .../compute/v1/stub/HttpJsonAddressStub.java | 5 --- .../v1/stub/HttpJsonAutoscalerStub.java | 7 ---- .../v1/stub/HttpJsonBackendBucketStub.java | 6 ---- .../v1/stub/HttpJsonBackendServiceStub.java | 9 ----- .../compute/v1/stub/HttpJsonDiskStub.java | 8 ----- .../compute/v1/stub/HttpJsonDiskTypeStub.java | 3 -- .../compute/v1/stub/HttpJsonFirewallStub.java | 6 ---- .../v1/stub/HttpJsonForwardingRuleStub.java | 7 ---- .../v1/stub/HttpJsonGlobalAddressStub.java | 4 --- .../HttpJsonGlobalForwardingRuleStub.java | 8 ----- .../v1/stub/HttpJsonGlobalOperationStub.java | 5 --- .../v1/stub/HttpJsonHealthCheckStub.java | 6 ---- .../v1/stub/HttpJsonHttpHealthCheckStub.java | 6 ---- .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 6 ---- .../compute/v1/stub/HttpJsonImageStub.java | 7 ---- .../HttpJsonInstanceGroupManagerStub.java | 22 ------------ .../v1/stub/HttpJsonInstanceGroupStub.java | 13 ------- .../compute/v1/stub/HttpJsonInstanceStub.java | 34 ------------------- .../v1/stub/HttpJsonInstanceTemplateStub.java | 4 --- .../HttpJsonInterconnectAttachmentStub.java | 9 ----- .../HttpJsonInterconnectLocationStub.java | 2 -- .../v1/stub/HttpJsonInterconnectStub.java | 5 --- .../v1/stub/HttpJsonLicenseCodeStub.java | 3 -- .../compute/v1/stub/HttpJsonLicenseStub.java | 5 --- .../v1/stub/HttpJsonMachineTypeStub.java | 4 --- .../compute/v1/stub/HttpJsonNetworkStub.java | 8 ----- .../compute/v1/stub/HttpJsonProjectStub.java | 14 -------- .../v1/stub/HttpJsonRegionAutoscalerStub.java | 6 ---- .../HttpJsonRegionBackendServiceStub.java | 11 ------ .../v1/stub/HttpJsonRegionCommitmentStub.java | 5 --- ...ttpJsonRegionInstanceGroupManagerStub.java | 26 -------------- .../stub/HttpJsonRegionInstanceGroupStub.java | 6 ---- .../v1/stub/HttpJsonRegionOperationStub.java | 3 -- .../compute/v1/stub/HttpJsonRegionStub.java | 2 -- .../compute/v1/stub/HttpJsonRouteStub.java | 4 --- .../compute/v1/stub/HttpJsonRouterStub.java | 9 ----- .../compute/v1/stub/HttpJsonSnapshotStub.java | 4 --- .../v1/stub/HttpJsonSslCertificateStub.java | 4 --- .../v1/stub/HttpJsonSslPolicyStub.java | 7 ---- .../v1/stub/HttpJsonSubnetworkStub.java | 10 ------ .../v1/stub/HttpJsonTargetHttpProxyStub.java | 5 --- .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 9 ----- .../v1/stub/HttpJsonTargetInstanceStub.java | 6 ---- .../v1/stub/HttpJsonTargetPoolStub.java | 12 ------- .../v1/stub/HttpJsonTargetSslProxyStub.java | 12 ------- .../v1/stub/HttpJsonTargetTcpProxyStub.java | 8 ----- .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 6 ---- .../compute/v1/stub/HttpJsonUrlMapStub.java | 8 ----- .../v1/stub/HttpJsonVpnTunnelStub.java | 5 --- .../v1/stub/HttpJsonZoneOperationStub.java | 3 -- .../compute/v1/stub/HttpJsonZoneStub.java | 2 -- 79 files changed, 54 insertions(+), 420 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index 2e31d4cd8932..63288150e7d0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -36,6 +36,7 @@ public final class PatchAutoscalerHttpRequest implements ApiMessage { private final String requestId; private final String userIp; private final String zone; + private final transient List fieldMask; private PatchAutoscalerHttpRequest() { this.access_token = null; @@ -123,7 +124,7 @@ public Autoscaler getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java index f343b79942ff..3e0944dd60da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchBackendBucketHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchBackendBucketHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public BackendBucket getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index c1a687e81c9e..360ffc4f1f9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchBackendServiceHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public BackendService getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index a8f1482c4973..a15399a57c6e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchFirewallHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Firewall getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index eb9564db903a..af7d29fed39f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchHealthCheckHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public HealthCheck getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index 03fdfe2d1eab..65ed4311a846 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchHttpHealthCheckHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public HttpHealthCheck getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index 360d9a9499e1..f3631ad5454a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchHttpsHealthCheckHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public HttpsHealthCheck getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java index 8cc931e6dde9..bcce6eb135a7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchInterconnectHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchInterconnectHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Interconnect getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java index 0a47cb60cb11..6200bdabc44a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchNetworkHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchNetworkHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Network getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index d42c3b0f6551..2128b872e6e2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -36,6 +36,7 @@ public final class PatchRegionAutoscalerHttpRequest implements ApiMessage { private final String region; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchRegionAutoscalerHttpRequest() { this.access_token = null; @@ -123,7 +124,7 @@ public Autoscaler getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index c6750c744f4a..51b4e7eb4db9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchRegionBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private PatchRegionBackendServiceHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public BackendService getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index 99021e9ae0f3..a8ded3939192 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchRouterHttpRequest implements ApiMessage { private final String router; private final Router routerResource; private final String userIp; + private final transient List fieldMask; private PatchRouterHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Router getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java index cee67ac3c292..2f7a40b178a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage { private final String sslPolicy; private final SslPolicy sslPolicyResource; private final String userIp; + private final transient List fieldMask; private PatchSslPolicyHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public SslPolicy getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java index da4a7c4a818b..f29d6c1f4cd8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage { private final String subnetwork; private final Subnetwork subnetworkResource; private final String userIp; + private final transient List fieldMask; private PatchSubnetworkHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Subnetwork getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index ea5c54ae43f1..068b6a91bcba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -35,6 +35,7 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private final String urlMap; private final UrlMap urlMapResource; private final String userIp; + private final transient List fieldMask; private PatchUrlMapHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public UrlMap getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index 920298766bd9..832b2318a239 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -36,6 +36,7 @@ public final class UpdateAutoscalerHttpRequest implements ApiMessage { private final String requestId; private final String userIp; private final String zone; + private final transient List fieldMask; private UpdateAutoscalerHttpRequest() { this.access_token = null; @@ -123,7 +124,7 @@ public Autoscaler getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java index b65298c9dbd2..c87ad53d51cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateBackendBucketHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateBackendBucketHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public BackendBucket getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index 3a062cd41727..a9eedc5c8b20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateBackendServiceHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public BackendService getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index 842388fa957d..e51e7ea7cf02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateFirewallHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Firewall getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index 124fdd56446a..059c4a0b0ff6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateHealthCheckHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public HealthCheck getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index 0f5ebb9d1d7b..a2a9523bccd0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateHttpHealthCheckHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public HttpHealthCheck getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index e854e23981de..c23a725c4ba1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateHttpsHealthCheckHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public HttpsHealthCheck getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java index d3df8f05ee54..f326fedb14f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -36,6 +36,7 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessa private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateNetworkInterfaceInstanceHttpRequest() { this.access_token = null; @@ -123,7 +124,7 @@ public NetworkInterface getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index 465949ddbfb0..48fd9ea41166 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -36,6 +36,7 @@ public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage { private final String region; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateRegionAutoscalerHttpRequest() { this.access_token = null; @@ -123,7 +124,7 @@ public Autoscaler getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index 26e9d41705d0..5b1ffc427bd6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; + private final transient List fieldMask; private UpdateRegionBackendServiceHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public BackendService getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index 135bab99e8ef..a28ac69907fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private final String router; private final Router routerResource; private final String userIp; + private final transient List fieldMask; private UpdateRouterHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public Router getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index e603cabbbdba..1683fcb7dd09 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -35,6 +35,7 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private final String urlMap; private final UrlMap urlMapResource; private final String userIp; + private final transient List fieldMask; private UpdateUrlMapHttpRequest() { this.access_token = null; @@ -116,7 +117,7 @@ public UrlMap getApiMessageRequestBody() { @Nullable @Override public List getFieldMask() { - return null; + return fieldMask; } public String getAccessToken() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java index 71269115b288..597842fdabe8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java @@ -66,8 +66,6 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/acceleratorTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -88,7 +86,6 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAcceleratorTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")) @@ -110,7 +107,6 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAcceleratorTypesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/acceleratorTypes")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java index bc79b274fd0e..7092da29b4c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -66,7 +66,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -87,7 +86,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -108,7 +106,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAddressHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet()) @@ -129,7 +126,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -149,7 +145,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java index 50d28633fe62..5247f8519acd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -69,7 +69,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/autoscalers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,7 +89,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -111,7 +109,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet()) @@ -132,7 +129,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -152,7 +148,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -173,7 +168,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -193,7 +187,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java index dc2e4c87bd40..e293e0781306 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java @@ -63,7 +63,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +83,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet()) @@ -105,7 +103,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListBackendBucketsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -146,7 +142,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -167,7 +162,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java index d4b898387ef5..707e2defa242 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -71,8 +71,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/backendServices")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -93,7 +91,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -114,7 +111,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet()) @@ -137,7 +133,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/backendServices/{backendService}/getHealth")) @@ -159,7 +154,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -179,7 +173,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -200,7 +193,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -221,7 +213,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index d05faf374ce8..601895c004fb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -69,7 +69,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,7 +89,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) .setQueryParams(Sets.newHashSet("guestFlush", "requestId")) @@ -111,7 +109,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) @@ -130,7 +127,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) @@ -150,7 +146,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) .setQueryParams(Sets.newHashSet("requestId", "sourceImage")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -170,7 +165,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -191,7 +185,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) .setQueryParams(Sets.newHashSet("requestId")) @@ -212,7 +205,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{resource}/setLabels")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java index 5763aab2b33e..8831d983a454 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java @@ -64,7 +64,6 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -85,7 +84,6 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetDiskTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}")) .setQueryParams(Sets.newHashSet()) @@ -106,7 +104,6 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java index 47a4e3218911..468a6224f60a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -63,7 +63,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -83,7 +82,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -103,7 +101,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -123,7 +120,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListFirewallsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -144,7 +140,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -164,7 +159,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java index be620cb1bdd9..f6adf2664a38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -69,8 +69,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/forwardingRules")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -91,7 +89,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}")) @@ -113,7 +110,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}")) @@ -135,7 +131,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams(Sets.newHashSet("requestId")) @@ -156,7 +151,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams( @@ -178,7 +172,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java index b0016d2ce018..2b904500960f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -61,7 +61,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) @@ -81,7 +80,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) @@ -101,7 +99,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -121,7 +118,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java index 9cbabb7f7df5..fa77e0ea9c16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -62,8 +62,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +82,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet()) @@ -105,8 +102,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -126,7 +121,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,8 +142,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/forwardingRules/{forwardingRule}/setTarget")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java index eb5098744995..ba198e28cb7e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java @@ -65,8 +65,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -87,7 +85,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -104,7 +101,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -125,7 +121,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java index 6314d09d3cd2..7a376c55eedd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -63,7 +63,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +83,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet()) @@ -105,7 +103,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -146,7 +142,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -167,7 +162,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index 8fd485ced4b0..96e564bf8110 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -63,7 +63,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -85,7 +84,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -107,7 +105,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHttpHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,7 +144,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -170,7 +165,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index b5084e0ac3d4..045464f689f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -63,7 +63,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -85,7 +84,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -107,7 +105,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHttpsHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,7 +144,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -170,7 +165,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index ed43ce6d9584..56beeda780b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -66,7 +66,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalImageName.newFactory()) @@ -86,7 +85,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/{image}/deprecate")) .setQueryParams(Sets.newHashSet("requestId")) @@ -106,7 +104,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalImageName.newFactory()) @@ -126,7 +123,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetFromFamilyImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/family/{family}")) .setQueryParams(Sets.newHashSet()) @@ -147,7 +143,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams(Sets.newHashSet("forceCreate", "requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -167,7 +162,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListImagesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -188,7 +182,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/{resource}/setLabels")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index 987c4b18e78e..392f69a3c76d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -76,8 +76,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) @@ -103,8 +101,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/instanceGroupManagers")) .setQueryParams( @@ -126,8 +122,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) @@ -151,8 +145,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) @@ -174,7 +166,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) @@ -196,8 +187,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -220,7 +209,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams( @@ -248,8 +236,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) @@ -277,8 +263,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) @@ -300,8 +284,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) @@ -326,8 +308,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) @@ -350,8 +330,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java index 1de6f6a0ac03..788a010acc13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -71,7 +71,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) @@ -96,8 +95,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroups")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -118,7 +115,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) @@ -140,7 +136,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) @@ -162,7 +157,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -182,7 +176,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -206,8 +199,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")) @@ -231,8 +222,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) @@ -254,8 +243,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index 2cb7152ca8ba..05769343420e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -91,7 +91,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/addAccessConfig")) @@ -115,7 +114,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/instances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -136,7 +134,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/attachDisk")) @@ -158,7 +155,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -179,8 +175,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) @@ -203,7 +197,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/detachDisk")) @@ -225,7 +218,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet()) @@ -247,8 +239,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/serialPort")) @@ -270,7 +260,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams( Sets.newHashSet("requestId", "sourceInstanceTemplate")) @@ -291,7 +280,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -312,7 +300,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListReferrersInstancesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/referrers")) @@ -335,7 +322,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) .setQueryParams(Sets.newHashSet("requestId")) @@ -357,8 +343,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")) @@ -380,7 +364,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) @@ -403,7 +386,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setLabels")) @@ -426,8 +408,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMachineResources")) @@ -449,7 +429,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMachineType")) @@ -471,7 +450,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMetadata")) @@ -493,7 +471,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")) @@ -515,7 +492,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setScheduling")) @@ -537,7 +513,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setServiceAccount")) @@ -559,7 +534,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setTags")) @@ -581,7 +555,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) .setQueryParams(Sets.newHashSet("requestId")) @@ -603,8 +576,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) @@ -626,7 +597,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) .setQueryParams(Sets.newHashSet("requestId")) @@ -647,8 +617,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")) @@ -671,8 +639,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index 1a4abca55ce5..bc01f1963a26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -61,7 +61,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/instanceTemplates/{instanceTemplate}")) @@ -83,7 +82,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/instanceTemplates/{instanceTemplate}")) @@ -105,7 +103,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceTemplatesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java index 44952dab3864..b6878ea5897b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java @@ -70,8 +70,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/interconnectAttachments")) .setQueryParams( @@ -95,8 +93,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) @@ -120,7 +116,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) @@ -143,8 +138,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) .setQueryParams(Sets.newHashSet("requestId")) @@ -168,8 +161,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java index 7c323e58ba1c..e8c631e04b58 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java @@ -58,7 +58,6 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectLocationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/interconnectLocations/{interconnectLocation}")) @@ -82,7 +81,6 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectLocationsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnectLocations")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java index 7c53ea5eaac0..b1b15eb95a92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -62,7 +62,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -83,7 +82,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet()) @@ -104,7 +102,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,7 +121,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -145,7 +141,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java index 56199ba78943..6d6cb808fb5d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java @@ -56,7 +56,6 @@ public class HttpJsonLicenseCodeStub extends LicenseCodeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetLicenseCodeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/licenseCodes/{licenseCode}")) .setQueryParams(Sets.newHashSet()) @@ -80,8 +79,6 @@ public class HttpJsonLicenseCodeStub extends LicenseCodeStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - TestIamPermissionsLicenseCodeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/licenseCodes/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java index 2cff99d85cfd..a3e2dbb86fb3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -64,7 +64,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) @@ -84,7 +83,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) @@ -104,7 +102,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,7 +121,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListLicensesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -147,7 +143,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(TestIamPermissionsLicenseHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/licenses/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java index 61b731aec0ce..3481d3b7a886 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java @@ -64,8 +64,6 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - AggregatedListMachineTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/machineTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -86,7 +84,6 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetMachineTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}")) .setQueryParams(Sets.newHashSet()) @@ -107,7 +104,6 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListMachineTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java index 74017edbc6fb..e6749f921a7b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -65,7 +65,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddPeeringNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/networks/{network}/addPeering")) .setQueryParams(Sets.newHashSet("requestId")) @@ -86,7 +85,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -106,7 +104,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -126,7 +123,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -146,7 +142,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListNetworksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -167,7 +162,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -187,7 +181,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemovePeeringNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/networks/{network}/removePeering")) .setQueryParams(Sets.newHashSet("requestId")) @@ -208,7 +201,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/networks/{network}/switchToCustomMode")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index d1567f5830c6..e85bff516d78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -70,7 +70,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DisableXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/disableXpnHost")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -90,7 +89,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DisableXpnResourceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/disableXpnResource")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -110,7 +108,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(EnableXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/enableXpnHost")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -130,7 +127,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(EnableXpnResourceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/enableXpnResource")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -150,7 +146,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectName.newFactory()) @@ -170,7 +165,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/getXpnHost")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectName.newFactory()) @@ -192,7 +186,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/getXpnResources")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) @@ -213,7 +206,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListXpnHostsProjectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/listXpnHosts")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) @@ -234,7 +226,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveDisk")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -254,7 +245,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveInstance")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -275,8 +265,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -297,8 +285,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java index a334a165b06e..14edae389a0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -63,7 +63,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/autoscalers/{autoscaler}")) @@ -85,7 +84,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/autoscalers/{autoscaler}")) @@ -107,7 +105,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -128,7 +125,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams( @@ -150,7 +146,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) @@ -171,7 +166,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java index 29fb7291a39f..dda6e4aa0ab3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -65,8 +65,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -88,7 +86,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -113,8 +110,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}/getHealth")) @@ -136,8 +131,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - InsertRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams(Sets.newHashSet("requestId")) @@ -158,7 +151,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams( @@ -180,7 +172,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -202,8 +193,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java index c029a17b62dc..5dfe80b2b250 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java @@ -67,8 +67,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/commitments")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -89,7 +87,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionCommitmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/commitments/{commitment}")) @@ -111,7 +108,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionCommitmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/commitments")) .setQueryParams(Sets.newHashSet("requestId")) @@ -132,7 +128,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionCommitmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/commitments")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index 9ea79f7beef7..cb4fbae5818d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -72,9 +72,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AbandonInstancesRegionInstanceGroupManagerHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) @@ -97,8 +94,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) @@ -123,8 +118,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) @@ -149,8 +142,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) @@ -173,8 +164,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -199,8 +188,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams( @@ -228,9 +215,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListManagedInstancesRegionInstanceGroupManagersHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) @@ -258,9 +242,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RecreateInstancesRegionInstanceGroupManagerHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) @@ -283,8 +264,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) @@ -309,9 +288,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetInstanceTemplateRegionInstanceGroupManagerHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) @@ -336,8 +312,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java index 5ec45e732bab..a3449b0d5f30 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -63,7 +63,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}")) @@ -87,7 +86,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroups")) .setQueryParams( @@ -113,8 +111,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")) @@ -138,8 +134,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java index da8b445f7610..b29c529b77b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java @@ -59,7 +59,6 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -76,7 +75,6 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -97,7 +95,6 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java index f4ada3539b17..873fb2367dac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java @@ -57,7 +57,6 @@ public class HttpJsonRegionStub extends RegionStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -77,7 +76,6 @@ public class HttpJsonRegionStub extends RegionStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index 454da75c6930..1e148d400c27 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -61,7 +61,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) @@ -80,7 +79,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) @@ -100,7 +98,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -120,7 +117,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index 6840b113e982..f47074367384 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -71,7 +71,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListRoutersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/routers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -92,7 +91,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -112,7 +110,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet()) @@ -133,7 +130,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouterStatusRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/routers/{router}/getRouterStatus")) @@ -155,7 +151,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -175,7 +170,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -196,7 +190,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -217,7 +210,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PreviewRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/routers/{router}/preview")) @@ -239,7 +231,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 5fdf58c8c7a1..5cc1d823aa4c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -62,7 +62,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) @@ -82,7 +81,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) @@ -102,7 +100,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSnapshotsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -123,7 +120,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/snapshots/{resource}/setLabels")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java index 8d534e6e71e1..e1745d8b7bc4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -61,7 +61,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -82,7 +81,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet()) @@ -103,7 +101,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -123,7 +120,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSslCertificatesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java index d3d8945ccdd7..7d2aa520fa59 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java @@ -64,7 +64,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -85,7 +84,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet()) @@ -106,7 +104,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -126,7 +123,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSslPoliciesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -152,8 +148,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListAvailableFeaturesSslPoliciesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/listAvailableFeatures")) .setQueryParams( @@ -177,7 +171,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index 368173fdb653..c49c72f72b9b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -70,7 +70,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListSubnetworksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/subnetworks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -91,7 +90,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -114,8 +112,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) @@ -137,7 +133,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -159,7 +154,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams(Sets.newHashSet("requestId")) @@ -180,7 +174,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSubnetworksHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams( @@ -202,7 +195,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -225,8 +217,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java index b8b409dc14d5..9b774747118b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -63,7 +63,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpProxies/{targetHttpProxy}")) @@ -85,7 +84,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpProxies/{targetHttpProxy}")) @@ -107,7 +105,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetHttpProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,7 +144,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index ecdb1d01ac5c..1e017d23839e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -65,7 +65,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) @@ -87,7 +86,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) @@ -109,7 +107,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -129,7 +126,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -151,8 +147,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) @@ -175,8 +169,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetSslPolicyTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")) @@ -198,7 +190,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java index 75f70874fa4f..6c72a4757756 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -68,8 +68,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/targetInstances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,7 +88,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/targetInstances/{targetInstance}")) @@ -112,7 +109,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/targetInstances/{targetInstance}")) @@ -134,7 +130,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams(Sets.newHashSet("requestId")) @@ -155,7 +150,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetInstancesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java index 833ffc5c5ea0..4f7711c7a176 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -72,7 +72,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) @@ -94,7 +93,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/addInstance")) @@ -118,7 +116,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/targetPools")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -139,7 +136,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}")) @@ -161,7 +157,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}")) @@ -183,7 +178,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/getHealth")) @@ -205,7 +199,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams(Sets.newHashSet("requestId")) @@ -226,7 +219,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetPoolsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams( @@ -249,8 +241,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) @@ -272,7 +262,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) @@ -294,7 +283,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/setBackup")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index 1261642c4672..ed85e9da385d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -65,7 +65,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -86,7 +85,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) .setQueryParams(Sets.newHashSet()) @@ -107,7 +105,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -149,8 +145,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) @@ -173,8 +167,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) @@ -197,8 +189,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) @@ -220,8 +210,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - SetSslPolicyTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java index 4773e569571a..f9730e9be9ad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java @@ -63,7 +63,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +83,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) .setQueryParams(Sets.newHashSet()) @@ -105,7 +103,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetTcpProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -147,8 +143,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")) @@ -171,8 +165,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java index f76dc9f7befe..fecf358a7ac4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -69,8 +69,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/targetVpnGateways")) .setQueryParams( @@ -92,7 +90,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) @@ -114,7 +111,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) @@ -136,7 +132,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams(Sets.newHashSet("requestId")) @@ -157,7 +152,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index 056c98ad0fdc..e50d38214193 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -66,7 +66,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -85,7 +84,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -105,7 +103,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) .setQueryParams(Sets.newHashSet("requestId")) @@ -146,7 +142,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -167,7 +162,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -187,7 +181,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -207,7 +200,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java index adf45ca0d010..f5c8756cc4a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -67,7 +67,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/vpnTunnels")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -88,7 +87,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -109,7 +107,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet()) @@ -130,7 +127,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -150,7 +146,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListVpnTunnelsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java index f89a38af5a8f..76ecb0954782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java @@ -59,7 +59,6 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteZoneOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -76,7 +75,6 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetZoneOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -97,7 +95,6 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListZoneOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java index fcf298ddb2df..2e5d57eedf72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java @@ -57,7 +57,6 @@ public class HttpJsonZoneStub extends ZoneStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetZoneHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -77,7 +76,6 @@ public class HttpJsonZoneStub extends ZoneStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListZonesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) From 7dbe11e6e8b06cda8545e51daa00614fc0b98f0a Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 3 May 2018 23:03:52 -0700 Subject: [PATCH 31/42] update with fieldMask as field with getter and setter in HttpRequest message types --- .../v1/PatchAutoscalerHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchBackendBucketHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchBackendServiceHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/PatchFirewallHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchHealthCheckHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchHttpHealthCheckHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchHttpsHealthCheckHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchInterconnectHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/PatchNetworkHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchRegionAutoscalerHttpRequest.java | 32 +++++++++++++++++++ .../PatchRegionBackendServiceHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/PatchRouterHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/PatchSslPolicyHttpRequest.java | 32 +++++++++++++++++++ .../v1/PatchSubnetworkHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/PatchUrlMapHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateAutoscalerHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateBackendBucketHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateBackendServiceHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/UpdateFirewallHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateHealthCheckHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateHttpHealthCheckHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateHttpsHealthCheckHttpRequest.java | 32 +++++++++++++++++++ ...teNetworkInterfaceInstanceHttpRequest.java | 32 +++++++++++++++++++ .../v1/UpdateRegionAutoscalerHttpRequest.java | 32 +++++++++++++++++++ ...UpdateRegionBackendServiceHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/UpdateRouterHttpRequest.java | 32 +++++++++++++++++++ .../compute/v1/UpdateUrlMapHttpRequest.java | 32 +++++++++++++++++++ 27 files changed, 864 insertions(+) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index 63288150e7d0..a23ff11722f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -29,6 +29,7 @@ public final class PatchAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,6 +44,7 @@ private PatchAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -57,6 +59,7 @@ private PatchAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -68,6 +71,7 @@ private PatchAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -91,6 +95,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -143,6 +150,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -198,6 +209,7 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -222,6 +234,9 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -251,6 +266,7 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -296,6 +312,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -373,6 +398,7 @@ public PatchAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, @@ -388,6 +414,7 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -414,6 +441,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -448,6 +478,7 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -466,6 +497,7 @@ public int hashCode() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java index 3e0944dd60da..24300a44ef73 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -29,6 +29,7 @@ public final class PatchBackendBucketHttpRequest implements ApiMessage { private final String backendBucket; private final BackendBucket backendBucketResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,6 +43,7 @@ private PatchBackendBucketHttpRequest() { this.backendBucket = null; this.backendBucketResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -55,6 +57,7 @@ private PatchBackendBucketHttpRequest( String backendBucket, BackendBucket backendBucketResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -65,6 +68,7 @@ private PatchBackendBucketHttpRequest( this.backendBucket = backendBucket; this.backendBucketResource = backendBucketResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -87,6 +91,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -136,6 +143,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -187,6 +198,7 @@ public static class Builder { private String backendBucket; private BackendBucket backendBucketResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -210,6 +222,9 @@ public Builder mergeFrom(PatchBackendBucketHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -236,6 +251,7 @@ public Builder mergeFrom(PatchBackendBucketHttpRequest other) { this.backendBucket = source.backendBucket; this.backendBucketResource = source.backendBucketResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -280,6 +296,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -349,6 +374,7 @@ public PatchBackendBucketHttpRequest build() { backendBucket, backendBucketResource, callback, + fieldMask, fields, key, prettyPrint, @@ -363,6 +389,7 @@ public Builder clone() { newBuilder.setBackendBucket(this.backendBucket); newBuilder.setBackendBucketResource(this.backendBucketResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -388,6 +415,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -419,6 +449,7 @@ public boolean equals(Object o) { && Objects.equals(this.backendBucket, that.getBackendBucket()) && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -436,6 +467,7 @@ public int hashCode() { backendBucket, backendBucketResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index 360ffc4f1f9f..8c62ef2de277 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -29,6 +29,7 @@ public final class PatchBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,6 +43,7 @@ private PatchBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -55,6 +57,7 @@ private PatchBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -65,6 +68,7 @@ private PatchBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -87,6 +91,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -136,6 +143,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -187,6 +198,7 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -210,6 +222,9 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -236,6 +251,7 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -280,6 +296,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -349,6 +374,7 @@ public PatchBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, @@ -363,6 +389,7 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -388,6 +415,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -419,6 +449,7 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -436,6 +467,7 @@ public int hashCode() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index a15399a57c6e..ee1fc58aaae8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String firewall; private final Firewall firewallResource; @@ -40,6 +41,7 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private PatchFirewallHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.firewall = null; this.firewallResource = null; @@ -53,6 +55,7 @@ private PatchFirewallHttpRequest() { private PatchFirewallHttpRequest( String access_token, String callback, + List fieldMask, String fields, String firewall, Firewall firewallResource, @@ -63,6 +66,7 @@ private PatchFirewallHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.firewall = firewall; this.firewallResource = firewallResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchFirewallHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String firewall; private Firewall firewallResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) { Builder(PatchFirewallHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.firewall = source.firewall; this.firewallResource = source.firewallResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchFirewallHttpRequest build() { return new PatchFirewallHttpRequest( access_token, callback, + fieldMask, fields, firewall, firewallResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setFirewall(this.firewall); newBuilder.setFirewallResource(this.firewallResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchFirewallHttpRequest that = (PatchFirewallHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.firewall, that.getFirewall()) && Objects.equals(this.firewallResource, that.getFirewallResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, firewall, firewallResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index af7d29fed39f..8ec729857f85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String healthCheck; private final HealthCheck healthCheckResource; @@ -40,6 +41,7 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private PatchHealthCheckHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.healthCheck = null; this.healthCheckResource = null; @@ -53,6 +55,7 @@ private PatchHealthCheckHttpRequest() { private PatchHealthCheckHttpRequest( String access_token, String callback, + List fieldMask, String fields, String healthCheck, HealthCheck healthCheckResource, @@ -63,6 +66,7 @@ private PatchHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.healthCheck = healthCheck; this.healthCheckResource = healthCheckResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String healthCheck; private HealthCheck healthCheckResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) { Builder(PatchHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.healthCheck = source.healthCheck; this.healthCheckResource = source.healthCheckResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchHealthCheckHttpRequest build() { return new PatchHealthCheckHttpRequest( access_token, callback, + fieldMask, fields, healthCheck, healthCheckResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHealthCheck(this.healthCheck); newBuilder.setHealthCheckResource(this.healthCheckResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchHealthCheckHttpRequest that = (PatchHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.healthCheck, that.getHealthCheck()) && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, healthCheck, healthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index 65ed4311a846..392b09139391 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String httpHealthCheck; private final HttpHealthCheck httpHealthCheckResource; @@ -40,6 +41,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private PatchHttpHealthCheckHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.httpHealthCheck = null; this.httpHealthCheckResource = null; @@ -53,6 +55,7 @@ private PatchHttpHealthCheckHttpRequest() { private PatchHttpHealthCheckHttpRequest( String access_token, String callback, + List fieldMask, String fields, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource, @@ -63,6 +66,7 @@ private PatchHttpHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.httpHealthCheck = httpHealthCheck; this.httpHealthCheckResource = httpHealthCheckResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchHttpHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String httpHealthCheck; private HttpHealthCheck httpHealthCheckResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { Builder(PatchHttpHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpHealthCheck = source.httpHealthCheck; this.httpHealthCheckResource = source.httpHealthCheckResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchHttpHealthCheckHttpRequest build() { return new PatchHttpHealthCheckHttpRequest( access_token, callback, + fieldMask, fields, httpHealthCheck, httpHealthCheckResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpHealthCheck(this.httpHealthCheck); newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchHttpHealthCheckHttpRequest that = (PatchHttpHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, httpHealthCheck, httpHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index f3631ad5454a..b53bc6ba5acf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String httpsHealthCheck; private final HttpsHealthCheck httpsHealthCheckResource; @@ -40,6 +41,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private PatchHttpsHealthCheckHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.httpsHealthCheck = null; this.httpsHealthCheckResource = null; @@ -53,6 +55,7 @@ private PatchHttpsHealthCheckHttpRequest() { private PatchHttpsHealthCheckHttpRequest( String access_token, String callback, + List fieldMask, String fields, String httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource, @@ -63,6 +66,7 @@ private PatchHttpsHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.httpsHealthCheck = httpsHealthCheck; this.httpsHealthCheckResource = httpsHealthCheckResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchHttpsHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String httpsHealthCheck; private HttpsHealthCheck httpsHealthCheckResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { Builder(PatchHttpsHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpsHealthCheck = source.httpsHealthCheck; this.httpsHealthCheckResource = source.httpsHealthCheckResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchHttpsHealthCheckHttpRequest build() { return new PatchHttpsHealthCheckHttpRequest( access_token, callback, + fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchHttpsHealthCheckHttpRequest that = (PatchHttpsHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java index bcce6eb135a7..bc4f8433418b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchInterconnectHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String interconnect; private final Interconnect interconnectResource; @@ -40,6 +41,7 @@ public final class PatchInterconnectHttpRequest implements ApiMessage { private PatchInterconnectHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.interconnect = null; this.interconnectResource = null; @@ -53,6 +55,7 @@ private PatchInterconnectHttpRequest() { private PatchInterconnectHttpRequest( String access_token, String callback, + List fieldMask, String fields, String interconnect, Interconnect interconnectResource, @@ -63,6 +66,7 @@ private PatchInterconnectHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.interconnect = interconnect; this.interconnectResource = interconnectResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchInterconnectHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String interconnect; private Interconnect interconnectResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchInterconnectHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchInterconnectHttpRequest other) { Builder(PatchInterconnectHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.interconnect = source.interconnect; this.interconnectResource = source.interconnectResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchInterconnectHttpRequest build() { return new PatchInterconnectHttpRequest( access_token, callback, + fieldMask, fields, interconnect, interconnectResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setInterconnect(this.interconnect); newBuilder.setInterconnectResource(this.interconnectResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchInterconnectHttpRequest that = (PatchInterconnectHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.interconnect, that.getInterconnect()) && Objects.equals(this.interconnectResource, that.getInterconnectResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, interconnect, interconnectResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java index 6200bdabc44a..76bc604faabb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchNetworkHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String network; @@ -40,6 +41,7 @@ public final class PatchNetworkHttpRequest implements ApiMessage { private PatchNetworkHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.network = null; @@ -53,6 +55,7 @@ private PatchNetworkHttpRequest() { private PatchNetworkHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String network, @@ -63,6 +66,7 @@ private PatchNetworkHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.network = network; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchNetworkHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String network; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchNetworkHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchNetworkHttpRequest other) { Builder(PatchNetworkHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.network = source.network; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchNetworkHttpRequest build() { return new PatchNetworkHttpRequest( access_token, callback, + fieldMask, fields, key, network, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setNetwork(this.network); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchNetworkHttpRequest that = (PatchNetworkHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.network, that.getNetwork()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, network, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index 2128b872e6e2..7da462629b12 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -29,6 +29,7 @@ public final class PatchRegionAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,6 +44,7 @@ private PatchRegionAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -57,6 +59,7 @@ private PatchRegionAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -68,6 +71,7 @@ private PatchRegionAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -91,6 +95,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -143,6 +150,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -198,6 +209,7 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -222,6 +234,9 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -251,6 +266,7 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -296,6 +312,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -374,6 +399,7 @@ public PatchRegionAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, @@ -389,6 +415,7 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -415,6 +442,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -449,6 +479,7 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -467,6 +498,7 @@ public int hashCode() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index 51b4e7eb4db9..6011d17eb8cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -29,6 +29,7 @@ public final class PatchRegionBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,6 +43,7 @@ private PatchRegionBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -55,6 +57,7 @@ private PatchRegionBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -65,6 +68,7 @@ private PatchRegionBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -87,6 +91,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -136,6 +143,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -187,6 +198,7 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -210,6 +222,9 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -236,6 +251,7 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -280,6 +296,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -349,6 +374,7 @@ public PatchRegionBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, @@ -363,6 +389,7 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -388,6 +415,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -419,6 +449,7 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -436,6 +467,7 @@ public int hashCode() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index a8ded3939192..3eb71b199963 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchRouterHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,6 +41,7 @@ public final class PatchRouterHttpRequest implements ApiMessage { private PatchRouterHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -53,6 +55,7 @@ private PatchRouterHttpRequest() { private PatchRouterHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -63,6 +66,7 @@ private PatchRouterHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchRouterHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchRouterHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchRouterHttpRequest other) { Builder(PatchRouterHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchRouterHttpRequest build() { return new PatchRouterHttpRequest( access_token, callback, + fieldMask, fields, key, prettyPrint, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchRouterHttpRequest that = (PatchRouterHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java index 2f7a40b178a1..99edc2813ad5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,6 +41,7 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage { private PatchSslPolicyHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -53,6 +55,7 @@ private PatchSslPolicyHttpRequest() { private PatchSslPolicyHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -63,6 +66,7 @@ private PatchSslPolicyHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchSslPolicyHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchSslPolicyHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchSslPolicyHttpRequest other) { Builder(PatchSslPolicyHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchSslPolicyHttpRequest build() { return new PatchSslPolicyHttpRequest( access_token, callback, + fieldMask, fields, key, prettyPrint, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchSslPolicyHttpRequest that = (PatchSslPolicyHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java index f29d6c1f4cd8..1b5f1f4cc0d1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,6 +41,7 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage { private PatchSubnetworkHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -53,6 +55,7 @@ private PatchSubnetworkHttpRequest() { private PatchSubnetworkHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -63,6 +66,7 @@ private PatchSubnetworkHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchSubnetworkHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchSubnetworkHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchSubnetworkHttpRequest other) { Builder(PatchSubnetworkHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchSubnetworkHttpRequest build() { return new PatchSubnetworkHttpRequest( access_token, callback, + fieldMask, fields, key, prettyPrint, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchSubnetworkHttpRequest that = (PatchSubnetworkHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index 068b6a91bcba..846ce71d24af 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -27,6 +27,7 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,6 +41,7 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private PatchUrlMapHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -53,6 +55,7 @@ private PatchUrlMapHttpRequest() { private PatchUrlMapHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -63,6 +66,7 @@ private PatchUrlMapHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static PatchUrlMapHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -204,6 +216,9 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) { Builder(PatchUrlMapHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public PatchUrlMapHttpRequest build() { return new PatchUrlMapHttpRequest( access_token, callback, + fieldMask, fields, key, prettyPrint, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { PatchUrlMapHttpRequest that = (PatchUrlMapHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index 832b2318a239..af628e05e23c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -29,6 +29,7 @@ public final class UpdateAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,6 +44,7 @@ private UpdateAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -57,6 +59,7 @@ private UpdateAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -68,6 +71,7 @@ private UpdateAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -91,6 +95,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -143,6 +150,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -198,6 +209,7 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -222,6 +234,9 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -251,6 +266,7 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -296,6 +312,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -373,6 +398,7 @@ public UpdateAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, @@ -388,6 +414,7 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -414,6 +441,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -448,6 +478,7 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -466,6 +497,7 @@ public int hashCode() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java index c87ad53d51cd..9283c3015d74 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -29,6 +29,7 @@ public final class UpdateBackendBucketHttpRequest implements ApiMessage { private final String backendBucket; private final BackendBucket backendBucketResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,6 +43,7 @@ private UpdateBackendBucketHttpRequest() { this.backendBucket = null; this.backendBucketResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -55,6 +57,7 @@ private UpdateBackendBucketHttpRequest( String backendBucket, BackendBucket backendBucketResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -65,6 +68,7 @@ private UpdateBackendBucketHttpRequest( this.backendBucket = backendBucket; this.backendBucketResource = backendBucketResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -87,6 +91,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -136,6 +143,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -187,6 +198,7 @@ public static class Builder { private String backendBucket; private BackendBucket backendBucketResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -210,6 +222,9 @@ public Builder mergeFrom(UpdateBackendBucketHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -236,6 +251,7 @@ public Builder mergeFrom(UpdateBackendBucketHttpRequest other) { this.backendBucket = source.backendBucket; this.backendBucketResource = source.backendBucketResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -280,6 +296,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -349,6 +374,7 @@ public UpdateBackendBucketHttpRequest build() { backendBucket, backendBucketResource, callback, + fieldMask, fields, key, prettyPrint, @@ -363,6 +389,7 @@ public Builder clone() { newBuilder.setBackendBucket(this.backendBucket); newBuilder.setBackendBucketResource(this.backendBucketResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -388,6 +415,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -419,6 +449,7 @@ public boolean equals(Object o) { && Objects.equals(this.backendBucket, that.getBackendBucket()) && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -436,6 +467,7 @@ public int hashCode() { backendBucket, backendBucketResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index a9eedc5c8b20..22bc9e96c3dd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -29,6 +29,7 @@ public final class UpdateBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,6 +43,7 @@ private UpdateBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -55,6 +57,7 @@ private UpdateBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -65,6 +68,7 @@ private UpdateBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -87,6 +91,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -136,6 +143,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -187,6 +198,7 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -210,6 +222,9 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -236,6 +251,7 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -280,6 +296,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -349,6 +374,7 @@ public UpdateBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, @@ -363,6 +389,7 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -388,6 +415,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -419,6 +449,7 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -436,6 +467,7 @@ public int hashCode() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index e51e7ea7cf02..211573b54843 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String firewall; private final Firewall firewallResource; @@ -40,6 +41,7 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private UpdateFirewallHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.firewall = null; this.firewallResource = null; @@ -53,6 +55,7 @@ private UpdateFirewallHttpRequest() { private UpdateFirewallHttpRequest( String access_token, String callback, + List fieldMask, String fields, String firewall, Firewall firewallResource, @@ -63,6 +66,7 @@ private UpdateFirewallHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.firewall = firewall; this.firewallResource = firewallResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static UpdateFirewallHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String firewall; private Firewall firewallResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) { Builder(UpdateFirewallHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.firewall = source.firewall; this.firewallResource = source.firewallResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public UpdateFirewallHttpRequest build() { return new UpdateFirewallHttpRequest( access_token, callback, + fieldMask, fields, firewall, firewallResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setFirewall(this.firewall); newBuilder.setFirewallResource(this.firewallResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { UpdateFirewallHttpRequest that = (UpdateFirewallHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.firewall, that.getFirewall()) && Objects.equals(this.firewallResource, that.getFirewallResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, firewall, firewallResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index 059c4a0b0ff6..d217ebc2aedd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String healthCheck; private final HealthCheck healthCheckResource; @@ -40,6 +41,7 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private UpdateHealthCheckHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.healthCheck = null; this.healthCheckResource = null; @@ -53,6 +55,7 @@ private UpdateHealthCheckHttpRequest() { private UpdateHealthCheckHttpRequest( String access_token, String callback, + List fieldMask, String fields, String healthCheck, HealthCheck healthCheckResource, @@ -63,6 +66,7 @@ private UpdateHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.healthCheck = healthCheck; this.healthCheckResource = healthCheckResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static UpdateHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String healthCheck; private HealthCheck healthCheckResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { Builder(UpdateHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.healthCheck = source.healthCheck; this.healthCheckResource = source.healthCheckResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public UpdateHealthCheckHttpRequest build() { return new UpdateHealthCheckHttpRequest( access_token, callback, + fieldMask, fields, healthCheck, healthCheckResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHealthCheck(this.healthCheck); newBuilder.setHealthCheckResource(this.healthCheckResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { UpdateHealthCheckHttpRequest that = (UpdateHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.healthCheck, that.getHealthCheck()) && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, healthCheck, healthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index a2a9523bccd0..f7c2f409cf2b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String httpHealthCheck; private final HttpHealthCheck httpHealthCheckResource; @@ -40,6 +41,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private UpdateHttpHealthCheckHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.httpHealthCheck = null; this.httpHealthCheckResource = null; @@ -53,6 +55,7 @@ private UpdateHttpHealthCheckHttpRequest() { private UpdateHttpHealthCheckHttpRequest( String access_token, String callback, + List fieldMask, String fields, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource, @@ -63,6 +66,7 @@ private UpdateHttpHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.httpHealthCheck = httpHealthCheck; this.httpHealthCheckResource = httpHealthCheckResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static UpdateHttpHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String httpHealthCheck; private HttpHealthCheck httpHealthCheckResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { Builder(UpdateHttpHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpHealthCheck = source.httpHealthCheck; this.httpHealthCheckResource = source.httpHealthCheckResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public UpdateHttpHealthCheckHttpRequest build() { return new UpdateHttpHealthCheckHttpRequest( access_token, callback, + fieldMask, fields, httpHealthCheck, httpHealthCheckResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpHealthCheck(this.httpHealthCheck); newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { UpdateHttpHealthCheckHttpRequest that = (UpdateHttpHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, httpHealthCheck, httpHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index c23a725c4ba1..a2c11fab28a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String httpsHealthCheck; private final HttpsHealthCheck httpsHealthCheckResource; @@ -40,6 +41,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private UpdateHttpsHealthCheckHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.httpsHealthCheck = null; this.httpsHealthCheckResource = null; @@ -53,6 +55,7 @@ private UpdateHttpsHealthCheckHttpRequest() { private UpdateHttpsHealthCheckHttpRequest( String access_token, String callback, + List fieldMask, String fields, String httpsHealthCheck, HttpsHealthCheck httpsHealthCheckResource, @@ -63,6 +66,7 @@ private UpdateHttpsHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.httpsHealthCheck = httpsHealthCheck; this.httpsHealthCheckResource = httpsHealthCheckResource; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static UpdateHttpsHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String httpsHealthCheck; private HttpsHealthCheck httpsHealthCheckResource; @@ -204,6 +216,9 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { Builder(UpdateHttpsHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpsHealthCheck = source.httpsHealthCheck; this.httpsHealthCheckResource = source.httpsHealthCheckResource; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public UpdateHttpsHealthCheckHttpRequest build() { return new UpdateHttpsHealthCheckHttpRequest( access_token, callback, + fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { UpdateHttpsHealthCheckHttpRequest that = (UpdateHttpsHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java index f326fedb14f1..84524d6370a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String instance; private final String key; @@ -41,6 +42,7 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessa private UpdateNetworkInterfaceInstanceHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.instance = null; this.key = null; @@ -55,6 +57,7 @@ private UpdateNetworkInterfaceInstanceHttpRequest() { private UpdateNetworkInterfaceInstanceHttpRequest( String access_token, String callback, + List fieldMask, String fields, String instance, String key, @@ -66,6 +69,7 @@ private UpdateNetworkInterfaceInstanceHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.instance = instance; this.key = key; @@ -85,6 +89,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -135,6 +142,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -196,6 +207,7 @@ public static UpdateNetworkInterfaceInstanceHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String instance; private String key; @@ -216,6 +228,9 @@ public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -249,6 +264,7 @@ public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) { Builder(UpdateNetworkInterfaceInstanceHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.instance = source.instance; this.key = source.key; @@ -278,6 +294,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -376,6 +401,7 @@ public UpdateNetworkInterfaceInstanceHttpRequest build() { return new UpdateNetworkInterfaceInstanceHttpRequest( access_token, callback, + fieldMask, fields, instance, key, @@ -391,6 +417,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); newBuilder.setKey(this.key); @@ -413,6 +440,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -452,6 +482,7 @@ public boolean equals(Object o) { (UpdateNetworkInterfaceInstanceHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.instance, that.getInstance()) && Objects.equals(this.key, that.getKey()) @@ -470,6 +501,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, instance, key, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index 48fd9ea41166..00f551cfd007 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -29,6 +29,7 @@ public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,6 +44,7 @@ private UpdateRegionAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -57,6 +59,7 @@ private UpdateRegionAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -68,6 +71,7 @@ private UpdateRegionAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -91,6 +95,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -143,6 +150,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -198,6 +209,7 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -222,6 +234,9 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -251,6 +266,7 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -296,6 +312,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -374,6 +399,7 @@ public UpdateRegionAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, @@ -389,6 +415,7 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -415,6 +442,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -449,6 +479,7 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -467,6 +498,7 @@ public int hashCode() { autoscaler, autoscalerResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index 5b1ffc427bd6..d561e0c20d90 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -29,6 +29,7 @@ public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,6 +43,7 @@ private UpdateRegionBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -55,6 +57,7 @@ private UpdateRegionBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -65,6 +68,7 @@ private UpdateRegionBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -87,6 +91,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -136,6 +143,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -187,6 +198,7 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -210,6 +222,9 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -236,6 +251,7 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -280,6 +296,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -349,6 +374,7 @@ public UpdateRegionBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, @@ -363,6 +389,7 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -388,6 +415,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -419,6 +449,7 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -436,6 +467,7 @@ public int hashCode() { backendService, backendServiceResource, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index a28ac69907fa..670bb7a612e4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,6 +41,7 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private UpdateRouterHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -53,6 +55,7 @@ private UpdateRouterHttpRequest() { private UpdateRouterHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -63,6 +66,7 @@ private UpdateRouterHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static UpdateRouterHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -204,6 +216,9 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) { Builder(UpdateRouterHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public UpdateRouterHttpRequest build() { return new UpdateRouterHttpRequest( access_token, callback, + fieldMask, fields, key, prettyPrint, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index 1683fcb7dd09..bd4d9741166c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -27,6 +27,7 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private final String access_token; private final String callback; + private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,6 +41,7 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private UpdateUrlMapHttpRequest() { this.access_token = null; this.callback = null; + this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -53,6 +55,7 @@ private UpdateUrlMapHttpRequest() { private UpdateUrlMapHttpRequest( String access_token, String callback, + List fieldMask, String fields, String key, String prettyPrint, @@ -63,6 +66,7 @@ private UpdateUrlMapHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; + this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,6 +85,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("callback")) { return callback; } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } if (fieldName.equals("fields")) { return fields; } @@ -128,6 +135,10 @@ public String getCallback() { return callback; } + public List getFieldMask() { + return fieldMask; + } + public String getFields() { return fields; } @@ -185,6 +196,7 @@ public static UpdateUrlMapHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; + private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -204,6 +216,9 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } if (other.getFields() != null) { this.fields = other.fields; } @@ -234,6 +249,7 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) { Builder(UpdateUrlMapHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; + this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -262,6 +278,15 @@ public Builder setCallback(String callback) { return this; } + public List getFieldMask() { + return fieldMask; + } + + public Builder setFieldMask(String fieldMask) { + this.fieldMask = fieldMask; + return this; + } + public String getFields() { return fields; } @@ -347,6 +372,7 @@ public UpdateUrlMapHttpRequest build() { return new UpdateUrlMapHttpRequest( access_token, callback, + fieldMask, fields, key, prettyPrint, @@ -361,6 +387,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); + newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -382,6 +409,9 @@ public String toString() { + "callback=" + callback + ", " + + "fieldMask=" + + fieldMask + + ", " + "fields=" + fields + ", " @@ -417,6 +447,7 @@ public boolean equals(Object o) { UpdateUrlMapHttpRequest that = (UpdateUrlMapHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -434,6 +465,7 @@ public int hashCode() { return Objects.hash( access_token, callback, + fieldMask, fields, key, prettyPrint, From e6a6b471e475c1c39628e3f2cea81e3484a88567 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Thu, 3 May 2018 23:28:47 -0700 Subject: [PATCH 32/42] working regen from toolkit --- .../cloud/compute/v1/PatchAutoscalerHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchBackendBucketHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchBackendServiceHttpRequest.java | 7 +------ .../google/cloud/compute/v1/PatchFirewallHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchHealthCheckHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchInterconnectHttpRequest.java | 7 +------ .../google/cloud/compute/v1/PatchNetworkHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java | 7 +------ .../compute/v1/PatchRegionBackendServiceHttpRequest.java | 7 +------ .../google/cloud/compute/v1/PatchRouterHttpRequest.java | 7 +------ .../google/cloud/compute/v1/PatchSslPolicyHttpRequest.java | 7 +------ .../cloud/compute/v1/PatchSubnetworkHttpRequest.java | 7 +------ .../google/cloud/compute/v1/PatchUrlMapHttpRequest.java | 7 +------ .../cloud/compute/v1/UpdateAutoscalerHttpRequest.java | 7 +------ .../cloud/compute/v1/UpdateBackendBucketHttpRequest.java | 7 +------ .../cloud/compute/v1/UpdateBackendServiceHttpRequest.java | 7 +------ .../google/cloud/compute/v1/UpdateFirewallHttpRequest.java | 7 +------ .../cloud/compute/v1/UpdateHealthCheckHttpRequest.java | 7 +------ .../cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java | 7 +------ .../compute/v1/UpdateHttpsHealthCheckHttpRequest.java | 7 +------ .../v1/UpdateNetworkInterfaceInstanceHttpRequest.java | 7 +------ .../compute/v1/UpdateRegionAutoscalerHttpRequest.java | 7 +------ .../compute/v1/UpdateRegionBackendServiceHttpRequest.java | 7 +------ .../google/cloud/compute/v1/UpdateRouterHttpRequest.java | 7 +------ .../google/cloud/compute/v1/UpdateUrlMapHttpRequest.java | 7 +------ 27 files changed, 27 insertions(+), 162 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index a23ff11722f0..2102af68384b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -37,7 +37,6 @@ public final class PatchAutoscalerHttpRequest implements ApiMessage { private final String requestId; private final String userIp; private final String zone; - private final transient List fieldMask; private PatchAutoscalerHttpRequest() { this.access_token = null; @@ -150,10 +149,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -316,7 +311,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java index 24300a44ef73..c2557817a243 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchBackendBucketHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchBackendBucketHttpRequest() { this.access_token = null; @@ -143,10 +142,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -300,7 +295,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index 8c62ef2de277..cbd151c53a69 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchBackendServiceHttpRequest() { this.access_token = null; @@ -143,10 +142,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -300,7 +295,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index ee1fc58aaae8..b9eeb0fcb088 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchFirewallHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index 8ec729857f85..4434ba523295 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchHealthCheckHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index 392b09139391..d3953e7a28c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchHttpHealthCheckHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index b53bc6ba5acf..d24557515f16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchHttpsHealthCheckHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java index bc4f8433418b..d6e8277ab9a5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchInterconnectHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchInterconnectHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java index 76bc604faabb..28d763a2bf0c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchNetworkHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchNetworkHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index 7da462629b12..c3c81698c71e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -37,7 +37,6 @@ public final class PatchRegionAutoscalerHttpRequest implements ApiMessage { private final String region; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchRegionAutoscalerHttpRequest() { this.access_token = null; @@ -150,10 +149,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -316,7 +311,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index 6011d17eb8cd..4f91c71c2486 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchRegionBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private PatchRegionBackendServiceHttpRequest() { this.access_token = null; @@ -143,10 +142,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -300,7 +295,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index 3eb71b199963..bf550127c4f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchRouterHttpRequest implements ApiMessage { private final String router; private final Router routerResource; private final String userIp; - private final transient List fieldMask; private PatchRouterHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java index 99edc2813ad5..41c751755cd8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage { private final String sslPolicy; private final SslPolicy sslPolicyResource; private final String userIp; - private final transient List fieldMask; private PatchSslPolicyHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java index 1b5f1f4cc0d1..0cb24e08eb02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage { private final String subnetwork; private final Subnetwork subnetworkResource; private final String userIp; - private final transient List fieldMask; private PatchSubnetworkHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index 846ce71d24af..ec3e86f9e168 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -36,7 +36,6 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private final String urlMap; private final UrlMap urlMapResource; private final String userIp; - private final transient List fieldMask; private PatchUrlMapHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index af628e05e23c..8f44596273da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -37,7 +37,6 @@ public final class UpdateAutoscalerHttpRequest implements ApiMessage { private final String requestId; private final String userIp; private final String zone; - private final transient List fieldMask; private UpdateAutoscalerHttpRequest() { this.access_token = null; @@ -150,10 +149,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -316,7 +311,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java index 9283c3015d74..4c40aef2a060 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateBackendBucketHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateBackendBucketHttpRequest() { this.access_token = null; @@ -143,10 +142,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -300,7 +295,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index 22bc9e96c3dd..c2db0a34accb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateBackendServiceHttpRequest() { this.access_token = null; @@ -143,10 +142,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -300,7 +295,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index 211573b54843..bc40d74b3fdc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateFirewallHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index d217ebc2aedd..dd475e3ce0f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateHealthCheckHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index f7c2f409cf2b..6a00c113c72d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateHttpHealthCheckHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index a2c11fab28a8..063e865d39a5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateHttpsHealthCheckHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java index 84524d6370a1..4d23d4d321e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -37,7 +37,6 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessa private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateNetworkInterfaceInstanceHttpRequest() { this.access_token = null; @@ -142,10 +141,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -298,7 +293,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index 00f551cfd007..fe33e4ccc64d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -37,7 +37,6 @@ public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage { private final String region; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateRegionAutoscalerHttpRequest() { this.access_token = null; @@ -150,10 +149,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -316,7 +311,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index d561e0c20d90..50ff784603bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage { private final String quotaUser; private final String requestId; private final String userIp; - private final transient List fieldMask; private UpdateRegionBackendServiceHttpRequest() { this.access_token = null; @@ -143,10 +142,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -300,7 +295,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index 670bb7a612e4..33353765119e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private final String router; private final Router routerResource; private final String userIp; - private final transient List fieldMask; private UpdateRouterHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index bd4d9741166c..d10954b5d792 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -36,7 +36,6 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private final String urlMap; private final UrlMap urlMapResource; private final String userIp; - private final transient List fieldMask; private UpdateUrlMapHttpRequest() { this.access_token = null; @@ -135,10 +134,6 @@ public String getCallback() { return callback; } - public List getFieldMask() { - return fieldMask; - } - public String getFields() { return fields; } @@ -282,7 +277,7 @@ public List getFieldMask() { return fieldMask; } - public Builder setFieldMask(String fieldMask) { + public Builder setFieldMask(List fieldMask) { this.fieldMask = fieldMask; return this; } From b643639207e99c34f1508540b04f30ccb303247a Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 4 May 2018 00:08:35 -0700 Subject: [PATCH 33/42] revert google-cloud-compute to working state --- ...tancesInstanceGroupManagerHttpRequest.java | 73 ++- ...RegionInstanceGroupManagerHttpRequest.java | 73 ++- .../cloud/compute/v1/AcceleratorConfig.java | 28 +- .../cloud/compute/v1/AcceleratorType.java | 66 +- .../v1/AcceleratorTypeAggregatedList.java | 47 +- .../cloud/compute/v1/AcceleratorTypeList.java | 53 +- .../v1/AcceleratorTypesScopedList.java | 33 +- .../google/cloud/compute/v1/AccessConfig.java | 49 +- .../AddAccessConfigInstanceHttpRequest.java | 74 ++- .../AddHealthCheckTargetPoolHttpRequest.java | 71 ++- .../v1/AddInstanceTargetPoolHttpRequest.java | 71 ++- .../AddInstancesInstanceGroupHttpRequest.java | 71 ++- .../v1/AddPeeringNetworkHttpRequest.java | 71 ++- .../com/google/cloud/compute/v1/Address.java | 89 ++- .../compute/v1/AddressAggregatedList.java | 47 +- .../google/cloud/compute/v1/AddressList.java | 53 +- .../cloud/compute/v1/AddressesScopedList.java | 33 +- ...egatedListAcceleratorTypesHttpRequest.java | 78 ++- .../AggregatedListAddressesHttpRequest.java | 78 ++- .../AggregatedListAutoscalersHttpRequest.java | 78 ++- ...regatedListBackendServicesHttpRequest.java | 78 ++- .../AggregatedListDiskTypesHttpRequest.java | 78 ++- .../v1/AggregatedListDisksHttpRequest.java | 78 ++- ...regatedListForwardingRulesHttpRequest.java | 78 ++- ...egatedListGlobalOperationsHttpRequest.java | 78 ++- ...dListInstanceGroupManagersHttpRequest.java | 78 ++- ...gregatedListInstanceGroupsHttpRequest.java | 78 ++- .../AggregatedListInstancesHttpRequest.java | 78 ++- ...istInterconnectAttachmentsHttpRequest.java | 78 ++- ...AggregatedListMachineTypesHttpRequest.java | 78 ++- ...gatedListRegionCommitmentsHttpRequest.java | 78 ++- .../v1/AggregatedListRoutersHttpRequest.java | 78 ++- .../AggregatedListSubnetworksHttpRequest.java | 78 ++- ...regatedListTargetInstancesHttpRequest.java | 78 ++- .../AggregatedListTargetPoolsHttpRequest.java | 78 ++- ...gatedListTargetVpnGatewaysHttpRequest.java | 78 ++- .../AggregatedListVpnTunnelsHttpRequest.java | 78 ++- .../google/cloud/compute/v1/AliasIpRange.java | 29 +- .../com/google/cloud/compute/v1/Allowed.java | 33 +- .../v1/AttachDiskInstanceHttpRequest.java | 69 ++- .../google/cloud/compute/v1/AttachedDisk.java | 93 ++- .../v1/AttachedDiskInitializeParams.java | 49 +- .../google/cloud/compute/v1/Autoscaler.java | 85 ++- .../compute/v1/AutoscalerAggregatedList.java | 47 +- .../cloud/compute/v1/AutoscalerList.java | 53 +- .../compute/v1/AutoscalerStatusDetails.java | 28 +- .../compute/v1/AutoscalersScopedList.java | 33 +- .../cloud/compute/v1/AutoscalingPolicy.java | 56 +- .../v1/AutoscalingPolicyCpuUtilization.java | 22 +- ...oscalingPolicyCustomMetricUtilization.java | 36 +- ...scalingPolicyLoadBalancingUtilization.java | 22 +- .../com/google/cloud/compute/v1/Backend.java | 66 +- .../cloud/compute/v1/BackendBucket.java | 59 +- .../cloud/compute/v1/BackendBucketList.java | 53 +- .../cloud/compute/v1/BackendService.java | 136 ++++- .../v1/BackendServiceAggregatedList.java | 47 +- .../compute/v1/BackendServiceCdnPolicy.java | 21 +- .../compute/v1/BackendServiceGroupHealth.java | 33 +- .../cloud/compute/v1/BackendServiceIAP.java | 41 +- .../cloud/compute/v1/BackendServiceList.java | 53 +- .../compute/v1/BackendServicesScopedList.java | 33 +- .../compute/v1/CacheInvalidationRule.java | 28 +- .../cloud/compute/v1/CacheKeyPolicy.java | 53 +- .../google/cloud/compute/v1/Commitment.java | 89 ++- .../compute/v1/CommitmentAggregatedList.java | 47 +- .../cloud/compute/v1/CommitmentList.java | 53 +- .../compute/v1/CommitmentsScopedList.java | 33 +- .../cloud/compute/v1/ConnectionDraining.java | 22 +- .../v1/CreateSnapshotDiskHttpRequest.java | 73 ++- .../compute/v1/CustomerEncryptionKey.java | 28 +- .../CustomerEncryptionKeyProtectedDisk.java | 29 +- .../com/google/cloud/compute/v1/Data.java | 28 +- ...DeleteAccessConfigInstanceHttpRequest.java | 73 ++- .../compute/v1/DeleteAddressHttpRequest.java | 63 +- .../v1/DeleteAutoscalerHttpRequest.java | 63 +- .../v1/DeleteBackendBucketHttpRequest.java | 63 +- .../v1/DeleteBackendServiceHttpRequest.java | 63 +- .../compute/v1/DeleteDiskHttpRequest.java | 63 +- .../compute/v1/DeleteFirewallHttpRequest.java | 63 +- .../v1/DeleteForwardingRuleHttpRequest.java | 63 +- .../v1/DeleteGlobalAddressHttpRequest.java | 63 +- ...DeleteGlobalForwardingRuleHttpRequest.java | 63 +- .../v1/DeleteGlobalOperationHttpRequest.java | 58 +- .../v1/DeleteHealthCheckHttpRequest.java | 63 +- .../v1/DeleteHttpHealthCheckHttpRequest.java | 63 +- .../v1/DeleteHttpsHealthCheckHttpRequest.java | 63 +- .../compute/v1/DeleteImageHttpRequest.java | 63 +- .../v1/DeleteInstanceGroupHttpRequest.java | 63 +- ...DeleteInstanceGroupManagerHttpRequest.java | 64 +- .../compute/v1/DeleteInstanceHttpRequest.java | 63 +- .../v1/DeleteInstanceTemplateHttpRequest.java | 63 +- ...tancesInstanceGroupManagerHttpRequest.java | 73 ++- ...RegionInstanceGroupManagerHttpRequest.java | 73 ++- ...leteInterconnectAttachmentHttpRequest.java | 65 +- .../v1/DeleteInterconnectHttpRequest.java | 63 +- .../compute/v1/DeleteLicenseHttpRequest.java | 63 +- .../compute/v1/DeleteNetworkHttpRequest.java | 63 +- .../v1/DeleteRegionAutoscalerHttpRequest.java | 63 +- ...DeleteRegionBackendServiceHttpRequest.java | 63 +- ...RegionInstanceGroupManagerHttpRequest.java | 64 +- .../v1/DeleteRegionOperationHttpRequest.java | 58 +- .../compute/v1/DeleteRouteHttpRequest.java | 63 +- .../compute/v1/DeleteRouterHttpRequest.java | 63 +- .../compute/v1/DeleteSnapshotHttpRequest.java | 63 +- .../v1/DeleteSslCertificateHttpRequest.java | 63 +- .../v1/DeleteSslPolicyHttpRequest.java | 63 +- .../v1/DeleteSubnetworkHttpRequest.java | 63 +- .../v1/DeleteTargetHttpProxyHttpRequest.java | 63 +- .../v1/DeleteTargetHttpsProxyHttpRequest.java | 63 +- .../v1/DeleteTargetInstanceHttpRequest.java | 63 +- .../v1/DeleteTargetPoolHttpRequest.java | 63 +- .../v1/DeleteTargetSslProxyHttpRequest.java | 63 +- .../v1/DeleteTargetTcpProxyHttpRequest.java | 63 +- .../v1/DeleteTargetVpnGatewayHttpRequest.java | 63 +- .../compute/v1/DeleteUrlMapHttpRequest.java | 63 +- .../v1/DeleteVpnTunnelHttpRequest.java | 63 +- .../v1/DeleteZoneOperationHttpRequest.java | 58 +- .../com/google/cloud/compute/v1/Denied.java | 33 +- .../compute/v1/DeprecateImageHttpRequest.java | 70 ++- .../cloud/compute/v1/DeprecationStatus.java | 43 +- .../v1/DetachDiskInstanceHttpRequest.java | 68 ++- .../v1/DisableXpnHostProjectHttpRequest.java | 63 +- .../DisableXpnResourceProjectHttpRequest.java | 71 ++- .../com/google/cloud/compute/v1/Disk.java | 172 +++++- .../cloud/compute/v1/DiskAggregatedList.java | 47 +- .../com/google/cloud/compute/v1/DiskList.java | 53 +- .../cloud/compute/v1/DiskMoveRequest.java | 28 +- .../com/google/cloud/compute/v1/DiskType.java | 70 ++- .../compute/v1/DiskTypeAggregatedList.java | 47 +- .../google/cloud/compute/v1/DiskTypeList.java | 53 +- .../cloud/compute/v1/DiskTypesScopedList.java | 33 +- .../cloud/compute/v1/DisksResizeRequest.java | 21 +- .../cloud/compute/v1/DisksScopedList.java | 33 +- .../v1/EnableXpnHostProjectHttpRequest.java | 63 +- .../EnableXpnResourceProjectHttpRequest.java | 71 ++- .../com/google/cloud/compute/v1/Error.java | 25 +- .../com/google/cloud/compute/v1/Errors.java | 33 +- ...xpandIpCidrRangeSubnetworkHttpRequest.java | 71 ++- .../com/google/cloud/compute/v1/Firewall.java | 137 ++++- .../google/cloud/compute/v1/FirewallList.java | 53 +- .../cloud/compute/v1/ForwardingRule.java | 110 +++- .../v1/ForwardingRuleAggregatedList.java | 47 +- .../cloud/compute/v1/ForwardingRuleList.java | 53 +- .../compute/v1/ForwardingRulesScopedList.java | 33 +- .../v1/GetAcceleratorTypeHttpRequest.java | 58 +- .../compute/v1/GetAddressHttpRequest.java | 58 +- .../compute/v1/GetAutoscalerHttpRequest.java | 58 +- .../v1/GetBackendBucketHttpRequest.java | 58 +- .../v1/GetBackendServiceHttpRequest.java | 58 +- .../cloud/compute/v1/GetDiskHttpRequest.java | 58 +- .../compute/v1/GetDiskTypeHttpRequest.java | 58 +- .../compute/v1/GetFirewallHttpRequest.java | 58 +- .../v1/GetForwardingRuleHttpRequest.java | 58 +- .../v1/GetFromFamilyImageHttpRequest.java | 58 +- .../v1/GetGlobalAddressHttpRequest.java | 58 +- .../GetGlobalForwardingRuleHttpRequest.java | 58 +- .../v1/GetGlobalOperationHttpRequest.java | 58 +- .../GetHealthBackendServiceHttpRequest.java | 66 +- .../compute/v1/GetHealthCheckHttpRequest.java | 58 +- ...HealthRegionBackendServiceHttpRequest.java | 66 +- .../v1/GetHealthTargetPoolHttpRequest.java | 65 +- .../v1/GetHttpHealthCheckHttpRequest.java | 58 +- .../v1/GetHttpsHealthCheckHttpRequest.java | 58 +- .../cloud/compute/v1/GetImageHttpRequest.java | 58 +- .../v1/GetInstanceGroupHttpRequest.java | 58 +- .../GetInstanceGroupManagerHttpRequest.java | 59 +- .../compute/v1/GetInstanceHttpRequest.java | 58 +- .../v1/GetInstanceTemplateHttpRequest.java | 58 +- .../GetInterconnectAttachmentHttpRequest.java | 60 +- .../v1/GetInterconnectHttpRequest.java | 58 +- .../GetInterconnectLocationHttpRequest.java | 59 +- .../compute/v1/GetLicenseCodeHttpRequest.java | 58 +- .../compute/v1/GetLicenseHttpRequest.java | 58 +- .../compute/v1/GetMachineTypeHttpRequest.java | 58 +- .../compute/v1/GetNetworkHttpRequest.java | 58 +- .../compute/v1/GetProjectHttpRequest.java | 58 +- .../v1/GetRegionAutoscalerHttpRequest.java | 58 +- .../GetRegionBackendServiceHttpRequest.java | 58 +- .../v1/GetRegionCommitmentHttpRequest.java | 58 +- .../compute/v1/GetRegionHttpRequest.java | 58 +- .../v1/GetRegionInstanceGroupHttpRequest.java | 58 +- ...RegionInstanceGroupManagerHttpRequest.java | 59 +- .../v1/GetRegionOperationHttpRequest.java | 58 +- .../cloud/compute/v1/GetRouteHttpRequest.java | 58 +- .../compute/v1/GetRouterHttpRequest.java | 58 +- .../v1/GetRouterStatusRouterHttpRequest.java | 58 +- ...etSerialPortOutputInstanceHttpRequest.java | 68 ++- .../compute/v1/GetSnapshotHttpRequest.java | 58 +- .../v1/GetSslCertificateHttpRequest.java | 58 +- .../compute/v1/GetSslPolicyHttpRequest.java | 58 +- .../compute/v1/GetSubnetworkHttpRequest.java | 58 +- .../v1/GetTargetHttpProxyHttpRequest.java | 58 +- .../v1/GetTargetHttpsProxyHttpRequest.java | 58 +- .../v1/GetTargetInstanceHttpRequest.java | 58 +- .../compute/v1/GetTargetPoolHttpRequest.java | 58 +- .../v1/GetTargetSslProxyHttpRequest.java | 58 +- .../v1/GetTargetTcpProxyHttpRequest.java | 58 +- .../v1/GetTargetVpnGatewayHttpRequest.java | 58 +- .../compute/v1/GetUrlMapHttpRequest.java | 58 +- .../compute/v1/GetVpnTunnelHttpRequest.java | 58 +- .../v1/GetXpnHostProjectHttpRequest.java | 58 +- .../GetXpnResourcesProjectsHttpRequest.java | 78 ++- .../cloud/compute/v1/GetZoneHttpRequest.java | 58 +- .../v1/GetZoneOperationHttpRequest.java | 58 +- .../compute/v1/GlobalSetLabelsRequest.java | 27 +- .../cloud/compute/v1/GuestOsFeature.java | 21 +- .../google/cloud/compute/v1/HealthCheck.java | 119 ++-- .../cloud/compute/v1/HealthCheckList.java | 53 +- .../compute/v1/HealthCheckReference.java | 21 +- .../google/cloud/compute/v1/HealthStatus.java | 38 +- .../com/google/cloud/compute/v1/HostRule.java | 38 +- .../cloud/compute/v1/HttpHealthCheck.java | 409 +++---------- .../cloud/compute/v1/HttpHealthCheck2.java | 578 ++++++++++++++++++ .../compute/v1/HttpHealthCheckClient.java | 78 +-- .../cloud/compute/v1/HttpHealthCheckList.java | 67 +- .../compute/v1/HttpHealthCheckSettings.java | 4 +- .../cloud/compute/v1/HttpSHealthCheck.java | 282 +++++++++ .../cloud/compute/v1/HttpsHealthCheck2.java | 578 ++++++++++++++++++ .../compute/v1/HttpsHealthCheckClient.java | 78 +-- .../compute/v1/HttpsHealthCheckList.java | 67 +- .../compute/v1/HttpsHealthCheckSettings.java | 4 +- .../com/google/cloud/compute/v1/Image.java | 178 ++++-- .../google/cloud/compute/v1/ImageList.java | 53 +- .../compute/v1/InsertAddressHttpRequest.java | 68 ++- .../v1/InsertAutoscalerHttpRequest.java | 69 ++- .../v1/InsertBackendBucketHttpRequest.java | 70 ++- .../v1/InsertBackendServiceHttpRequest.java | 70 ++- .../compute/v1/InsertDiskHttpRequest.java | 73 ++- .../compute/v1/InsertFirewallHttpRequest.java | 68 ++- .../v1/InsertForwardingRuleHttpRequest.java | 70 ++- .../v1/InsertGlobalAddressHttpRequest.java | 68 ++- ...InsertGlobalForwardingRuleHttpRequest.java | 70 ++- .../v1/InsertHealthCheckHttpRequest.java | 69 ++- .../v1/InsertHttpHealthCheckHttpRequest.java | 84 ++- .../v1/InsertHttpsHealthCheckHttpRequest.java | 84 ++- .../compute/v1/InsertImageHttpRequest.java | 73 ++- .../v1/InsertInstanceGroupHttpRequest.java | 70 ++- ...InsertInstanceGroupManagerHttpRequest.java | 71 ++- .../compute/v1/InsertInstanceHttpRequest.java | 75 ++- .../v1/InsertInstanceTemplateHttpRequest.java | 70 ++- ...sertInterconnectAttachmentHttpRequest.java | 71 ++- .../v1/InsertInterconnectHttpRequest.java | 69 ++- .../compute/v1/InsertLicenseHttpRequest.java | 68 ++- .../compute/v1/InsertNetworkHttpRequest.java | 68 ++- .../v1/InsertRegionAutoscalerHttpRequest.java | 69 ++- ...InsertRegionBackendServiceHttpRequest.java | 70 ++- .../v1/InsertRegionCommitmentHttpRequest.java | 69 ++- ...RegionInstanceGroupManagerHttpRequest.java | 71 ++- .../compute/v1/InsertRouteHttpRequest.java | 68 ++- .../compute/v1/InsertRouterHttpRequest.java | 68 ++- .../v1/InsertSslCertificateHttpRequest.java | 70 ++- .../v1/InsertSslPolicyHttpRequest.java | 69 ++- .../v1/InsertSubnetworkHttpRequest.java | 69 ++- .../v1/InsertTargetHttpProxyHttpRequest.java | 70 ++- .../v1/InsertTargetHttpsProxyHttpRequest.java | 70 ++- .../v1/InsertTargetInstanceHttpRequest.java | 70 ++- .../v1/InsertTargetPoolHttpRequest.java | 69 ++- .../v1/InsertTargetSslProxyHttpRequest.java | 70 ++- .../v1/InsertTargetTcpProxyHttpRequest.java | 70 ++- .../v1/InsertTargetVpnGatewayHttpRequest.java | 70 ++- .../compute/v1/InsertUrlMapHttpRequest.java | 68 ++- .../v1/InsertVpnTunnelHttpRequest.java | 69 ++- .../com/google/cloud/compute/v1/Instance.java | 156 ++++- .../compute/v1/InstanceAggregatedList.java | 47 +- .../cloud/compute/v1/InstanceGroup.java | 89 ++- .../v1/InstanceGroupAggregatedList.java | 47 +- .../cloud/compute/v1/InstanceGroupList.java | 53 +- .../compute/v1/InstanceGroupManager.java | 108 +++- .../InstanceGroupManagerActionsSummary.java | 60 +- .../InstanceGroupManagerAggregatedList.java | 47 +- .../compute/v1/InstanceGroupManagerList.java | 53 +- ...eGroupManagersAbandonInstancesRequest.java | 25 +- ...ceGroupManagersDeleteInstancesRequest.java | 25 +- ...pManagersListManagedInstancesResponse.java | 25 +- ...GroupManagersRecreateInstancesRequest.java | 25 +- .../v1/InstanceGroupManagersScopedList.java | 33 +- ...oupManagersSetInstanceTemplateRequest.java | 21 +- ...nceGroupManagersSetTargetPoolsRequest.java | 33 +- .../v1/InstanceGroupsAddInstancesRequest.java | 25 +- .../v1/InstanceGroupsListInstances.java | 53 +- .../InstanceGroupsListInstancesRequest.java | 21 +- .../InstanceGroupsRemoveInstancesRequest.java | 25 +- .../compute/v1/InstanceGroupsScopedList.java | 33 +- .../InstanceGroupsSetNamedPortsRequest.java | 33 +- .../google/cloud/compute/v1/InstanceList.java | 53 +- .../compute/v1/InstanceListReferrers.java | 53 +- .../cloud/compute/v1/InstanceMoveRequest.java | 28 +- .../cloud/compute/v1/InstanceProperties.java | 94 ++- .../cloud/compute/v1/InstanceReference.java | 21 +- .../cloud/compute/v1/InstanceTemplate.java | 54 +- .../compute/v1/InstanceTemplateList.java | 53 +- .../compute/v1/InstanceWithNamedPorts.java | 38 +- .../cloud/compute/v1/InstancesScopedList.java | 33 +- .../compute/v1/InstancesSetLabelsRequest.java | 27 +- .../InstancesSetMachineResourcesRequest.java | 25 +- .../v1/InstancesSetMachineTypeRequest.java | 21 +- .../v1/InstancesSetMinCpuPlatformRequest.java | 21 +- .../v1/InstancesSetServiceAccountRequest.java | 33 +- ...nstancesStartWithEncryptionKeyRequest.java | 25 +- .../google/cloud/compute/v1/Interconnect.java | 141 ++++- .../compute/v1/InterconnectAttachment.java | 96 ++- .../InterconnectAttachmentAggregatedList.java | 47 +- .../v1/InterconnectAttachmentList.java | 53 +- .../v1/InterconnectAttachmentPrivateInfo.java | 21 +- .../v1/InterconnectAttachmentsScopedList.java | 33 +- .../compute/v1/InterconnectCircuitInfo.java | 33 +- .../cloud/compute/v1/InterconnectList.java | 53 +- .../compute/v1/InterconnectLocation.java | 97 ++- .../compute/v1/InterconnectLocationList.java | 53 +- .../v1/InterconnectLocationRegionInfo.java | 33 +- .../v1/InterconnectOutageNotification.java | 63 +- .../v1/InvalidateCacheUrlMapHttpRequest.java | 71 ++- .../com/google/cloud/compute/v1/Items.java | 28 +- .../com/google/cloud/compute/v1/License.java | 70 ++- .../google/cloud/compute/v1/LicenseCode.java | 69 ++- .../compute/v1/LicenseCodeLicenseAlias.java | 28 +- .../v1/LicenseResourceRequirements.java | 28 +- .../compute/v1/LicensesListResponse.java | 48 +- .../v1/ListAcceleratorTypesHttpRequest.java | 78 ++- .../compute/v1/ListAddressesHttpRequest.java | 78 ++- .../v1/ListAutoscalersHttpRequest.java | 78 ++- ...ailableFeaturesSslPoliciesHttpRequest.java | 78 ++- .../v1/ListBackendBucketsHttpRequest.java | 78 ++- .../v1/ListBackendServicesHttpRequest.java | 78 ++- .../compute/v1/ListDiskTypesHttpRequest.java | 78 ++- .../compute/v1/ListDisksHttpRequest.java | 78 ++- .../compute/v1/ListFirewallsHttpRequest.java | 78 ++- .../v1/ListForwardingRulesHttpRequest.java | 78 ++- .../v1/ListGlobalAddressesHttpRequest.java | 78 ++- .../ListGlobalForwardingRulesHttpRequest.java | 78 ++- .../v1/ListGlobalOperationsHttpRequest.java | 78 ++- .../v1/ListHealthChecksHttpRequest.java | 78 ++- .../v1/ListHttpHealthChecksHttpRequest.java | 78 ++- .../v1/ListHttpsHealthChecksHttpRequest.java | 78 ++- .../compute/v1/ListImagesHttpRequest.java | 78 ++- .../ListInstanceGroupManagersHttpRequest.java | 78 ++- .../v1/ListInstanceGroupsHttpRequest.java | 78 ++- .../v1/ListInstanceTemplatesHttpRequest.java | 78 ++- .../compute/v1/ListInstancesHttpRequest.java | 78 ++- ...istInstancesInstanceGroupsHttpRequest.java | 86 ++- ...tancesRegionInstanceGroupsHttpRequest.java | 87 ++- ...istInterconnectAttachmentsHttpRequest.java | 78 ++- .../ListInterconnectLocationsHttpRequest.java | 78 ++- .../v1/ListInterconnectsHttpRequest.java | 78 ++- .../compute/v1/ListLicensesHttpRequest.java | 78 ++- .../v1/ListMachineTypesHttpRequest.java | 78 ++- ...ancesInstanceGroupManagersHttpRequest.java | 79 ++- ...egionInstanceGroupManagersHttpRequest.java | 79 ++- .../compute/v1/ListNetworksHttpRequest.java | 78 ++- .../v1/ListReferrersInstancesHttpRequest.java | 78 ++- .../v1/ListRegionAutoscalersHttpRequest.java | 78 ++- .../ListRegionBackendServicesHttpRequest.java | 78 ++- .../v1/ListRegionCommitmentsHttpRequest.java | 78 ++- ...egionInstanceGroupManagersHttpRequest.java | 78 ++- .../ListRegionInstanceGroupsHttpRequest.java | 78 ++- .../v1/ListRegionOperationsHttpRequest.java | 78 ++- .../compute/v1/ListRegionsHttpRequest.java | 78 ++- .../compute/v1/ListRoutersHttpRequest.java | 78 ++- .../compute/v1/ListRoutesHttpRequest.java | 78 ++- .../compute/v1/ListSnapshotsHttpRequest.java | 78 ++- .../v1/ListSslCertificatesHttpRequest.java | 78 ++- .../v1/ListSslPoliciesHttpRequest.java | 78 ++- .../v1/ListSubnetworksHttpRequest.java | 78 ++- .../v1/ListTargetHttpProxiesHttpRequest.java | 78 ++- .../v1/ListTargetHttpsProxiesHttpRequest.java | 78 ++- .../v1/ListTargetInstancesHttpRequest.java | 78 ++- .../v1/ListTargetPoolsHttpRequest.java | 78 ++- .../v1/ListTargetSslProxiesHttpRequest.java | 78 ++- .../v1/ListTargetTcpProxiesHttpRequest.java | 78 ++- .../v1/ListTargetVpnGatewaysHttpRequest.java | 78 ++- .../compute/v1/ListUrlMapsHttpRequest.java | 78 ++- .../compute/v1/ListVpnTunnelsHttpRequest.java | 78 ++- .../v1/ListXpnHostsProjectsHttpRequest.java | 86 ++- .../v1/ListZoneOperationsHttpRequest.java | 78 ++- .../compute/v1/ListZonesHttpRequest.java | 78 ++- .../google/cloud/compute/v1/MachineType.java | 104 +++- .../compute/v1/MachineTypeAggregatedList.java | 47 +- .../cloud/compute/v1/MachineTypeList.java | 53 +- .../compute/v1/MachineTypesScopedList.java | 33 +- .../cloud/compute/v1/ManagedInstance.java | 43 +- .../v1/ManagedInstanceLastAttempt.java | 21 +- .../com/google/cloud/compute/v1/Metadata.java | 38 +- .../v1/MoveDiskProjectHttpRequest.java | 70 ++- .../v1/MoveInstanceProjectHttpRequest.java | 70 ++- .../google/cloud/compute/v1/NamedPort.java | 28 +- .../com/google/cloud/compute/v1/Network.java | 90 ++- .../cloud/compute/v1/NetworkInterface.java | 67 +- .../google/cloud/compute/v1/NetworkList.java | 53 +- .../cloud/compute/v1/NetworkPeering.java | 43 +- .../compute/v1/NetworkRoutingConfig.java | 21 +- .../compute/v1/NetworksAddPeeringRequest.java | 33 +- .../v1/NetworksRemovePeeringRequest.java | 21 +- .../google/cloud/compute/v1/Operation.java | 141 ++++- .../compute/v1/OperationAggregatedList.java | 47 +- .../cloud/compute/v1/OperationList.java | 53 +- .../compute/v1/OperationsScopedList.java | 33 +- .../v1/PatchAutoscalerHttpRequest.java | 102 ++-- .../v1/PatchBackendBucketHttpRequest.java | 98 +-- .../v1/PatchBackendServiceHttpRequest.java | 98 +-- .../compute/v1/PatchFirewallHttpRequest.java | 96 +-- .../v1/PatchHealthCheckHttpRequest.java | 97 +-- .../v1/PatchHttpHealthCheckHttpRequest.java | 112 ++-- .../v1/PatchHttpsHealthCheckHttpRequest.java | 112 ++-- .../v1/PatchInterconnectHttpRequest.java | 97 +-- .../compute/v1/PatchNetworkHttpRequest.java | 96 +-- .../v1/PatchRegionAutoscalerHttpRequest.java | 102 ++-- .../PatchRegionBackendServiceHttpRequest.java | 98 +-- .../compute/v1/PatchRouterHttpRequest.java | 96 +-- .../compute/v1/PatchSslPolicyHttpRequest.java | 97 +-- .../v1/PatchSubnetworkHttpRequest.java | 97 +-- .../compute/v1/PatchUrlMapHttpRequest.java | 96 +-- .../google/cloud/compute/v1/PathMatcher.java | 43 +- .../com/google/cloud/compute/v1/PathRule.java | 33 +- .../compute/v1/PreviewRouterHttpRequest.java | 63 +- .../com/google/cloud/compute/v1/Project.java | 93 ++- .../v1/ProjectsDisableXpnResourceRequest.java | 21 +- .../v1/ProjectsEnableXpnResourceRequest.java | 21 +- .../compute/v1/ProjectsGetXpnResources.java | 38 +- .../v1/ProjectsListXpnHostsRequest.java | 21 +- .../com/google/cloud/compute/v1/Quota.java | 33 +- .../com/google/cloud/compute/v1/RawDisk.java | 33 +- ...tancesInstanceGroupManagerHttpRequest.java | 73 ++- ...RegionInstanceGroupManagerHttpRequest.java | 73 ++- .../google/cloud/compute/v1/Reference.java | 38 +- .../com/google/cloud/compute/v1/Region.java | 78 ++- .../compute/v1/RegionAutoscalerList.java | 53 +- .../compute/v1/RegionInstanceGroupList.java | 53 +- .../v1/RegionInstanceGroupManagerList.java | 53 +- ...eGroupManagersAbandonInstancesRequest.java | 25 +- ...ceGroupManagersDeleteInstancesRequest.java | 25 +- ...nceGroupManagersListInstancesResponse.java | 25 +- ...nInstanceGroupManagersRecreateRequest.java | 25 +- ...nceGroupManagersSetTargetPoolsRequest.java | 33 +- ...stanceGroupManagersSetTemplateRequest.java | 21 +- .../v1/RegionInstanceGroupsListInstances.java | 53 +- ...ionInstanceGroupsListInstancesRequest.java | 28 +- ...ionInstanceGroupsSetNamedPortsRequest.java | 33 +- .../google/cloud/compute/v1/RegionList.java | 53 +- ...emoveHealthCheckTargetPoolHttpRequest.java | 71 ++- .../RemoveInstanceTargetPoolHttpRequest.java | 71 ++- ...moveInstancesInstanceGroupHttpRequest.java | 71 ++- .../v1/RemovePeeringNetworkHttpRequest.java | 71 ++- .../compute/v1/ResetInstanceHttpRequest.java | 63 +- .../compute/v1/ResizeDiskHttpRequest.java | 70 ++- ...ResizeInstanceGroupManagerHttpRequest.java | 69 ++- ...RegionInstanceGroupManagerHttpRequest.java | 69 ++- .../cloud/compute/v1/ResourceCommitment.java | 28 +- .../compute/v1/ResourceGroupReference.java | 21 +- .../com/google/cloud/compute/v1/Route.java | 113 +++- .../google/cloud/compute/v1/RouteList.java | 53 +- .../com/google/cloud/compute/v1/Router.java | 83 ++- .../compute/v1/RouterAdvertisedIpRange.java | 28 +- .../compute/v1/RouterAggregatedList.java | 47 +- .../google/cloud/compute/v1/RouterBgp.java | 47 +- .../cloud/compute/v1/RouterBgpPeer.java | 74 ++- .../cloud/compute/v1/RouterInterface.java | 41 +- .../google/cloud/compute/v1/RouterList.java | 53 +- .../google/cloud/compute/v1/RouterStatus.java | 51 +- .../compute/v1/RouterStatusBgpPeerStatus.java | 73 ++- .../compute/v1/RouterStatusResponse.java | 28 +- .../compute/v1/RoutersPreviewResponse.java | 21 +- .../cloud/compute/v1/RoutersScopedList.java | 33 +- .../cloud/compute/v1/SSLHealthCheck.java | 43 +- .../google/cloud/compute/v1/Scheduling.java | 34 +- .../google/cloud/compute/v1/ScratchDisks.java | 21 +- .../cloud/compute/v1/SerialPortOutput.java | 43 +- .../cloud/compute/v1/ServiceAccount.java | 33 +- ...ckendServiceTargetSslProxyHttpRequest.java | 72 ++- ...ckendServiceTargetTcpProxyHttpRequest.java | 72 ++- .../v1/SetBackupTargetPoolHttpRequest.java | 75 ++- ...monInstanceMetadataProjectHttpRequest.java | 68 ++- ...DeletionProtectionInstanceHttpRequest.java | 69 ++- .../SetDiskAutoDeleteInstanceHttpRequest.java | 73 ++- ...mplateInstanceGroupManagerHttpRequest.java | 73 ++- ...RegionInstanceGroupManagerHttpRequest.java | 73 ++- .../compute/v1/SetLabelsDiskHttpRequest.java | 71 ++- .../compute/v1/SetLabelsImageHttpRequest.java | 66 +- .../v1/SetLabelsInstanceHttpRequest.java | 71 ++- .../v1/SetLabelsSnapshotHttpRequest.java | 66 +- ...etMachineResourcesInstanceHttpRequest.java | 71 ++- .../v1/SetMachineTypeInstanceHttpRequest.java | 71 ++- .../v1/SetMetadataInstanceHttpRequest.java | 68 ++- .../SetMinCpuPlatformInstanceHttpRequest.java | 71 ++- ...SetNamedPortsInstanceGroupHttpRequest.java | 71 ++- ...edPortsRegionInstanceGroupHttpRequest.java | 72 ++- ...teIpGoogleAccessSubnetworkHttpRequest.java | 72 ++- ...tProxyHeaderTargetSslProxyHttpRequest.java | 71 ++- ...tProxyHeaderTargetTcpProxyHttpRequest.java | 71 ++- .../v1/SetSchedulingInstanceHttpRequest.java | 69 ++- .../SetServiceAccountInstanceHttpRequest.java | 71 ++- ...rtificatesTargetHttpsProxyHttpRequest.java | 72 ++- ...CertificatesTargetSslProxyHttpRequest.java | 72 ++- ...tSslPolicyTargetHttpsProxyHttpRequest.java | 70 ++- ...SetSslPolicyTargetSslProxyHttpRequest.java | 70 ++- .../v1/SetTagsInstanceHttpRequest.java | 68 ++- .../SetTargetForwardingRuleHttpRequest.java | 70 ++- ...TargetGlobalForwardingRuleHttpRequest.java | 70 ++- ...tPoolsInstanceGroupManagerHttpRequest.java | 73 ++- ...RegionInstanceGroupManagerHttpRequest.java | 73 ++- .../SetUrlMapTargetHttpProxyHttpRequest.java | 70 ++- .../SetUrlMapTargetHttpsProxyHttpRequest.java | 70 ++- ...etUsageExportBucketProjectHttpRequest.java | 70 ++- .../com/google/cloud/compute/v1/Snapshot.java | 122 +++- .../google/cloud/compute/v1/SnapshotList.java | 53 +- .../cloud/compute/v1/SslCertificate.java | 59 +- .../cloud/compute/v1/SslCertificateList.java | 53 +- .../cloud/compute/v1/SslPoliciesList.java | 53 +- ...PoliciesListAvailableFeaturesResponse.java | 25 +- .../google/cloud/compute/v1/SslPolicy.java | 92 ++- .../cloud/compute/v1/SslPolicyReference.java | 21 +- .../compute/v1/StartInstanceHttpRequest.java | 63 +- ...tWithEncryptionKeyInstanceHttpRequest.java | 72 ++- .../compute/v1/StopInstanceHttpRequest.java | 63 +- .../google/cloud/compute/v1/Subnetwork.java | 91 ++- .../compute/v1/SubnetworkAggregatedList.java | 47 +- .../cloud/compute/v1/SubnetworkList.java | 53 +- .../compute/v1/SubnetworkSecondaryRange.java | 28 +- .../SubnetworksExpandIpCidrRangeRequest.java | 21 +- .../compute/v1/SubnetworksScopedList.java | 33 +- ...tworksSetPrivateIpGoogleAccessRequest.java | 23 +- .../SwitchToCustomModeNetworkHttpRequest.java | 63 +- .../cloud/compute/v1/TCPHealthCheck.java | 43 +- .../com/google/cloud/compute/v1/Tags.java | 33 +- .../cloud/compute/v1/TargetHttpProxy.java | 54 +- .../cloud/compute/v1/TargetHttpProxyList.java | 53 +- ...HttpsProxiesSetSslCertificatesRequest.java | 25 +- .../cloud/compute/v1/TargetHttpsProxy.java | 69 ++- .../compute/v1/TargetHttpsProxyList.java | 53 +- .../cloud/compute/v1/TargetInstance.java | 64 +- .../v1/TargetInstanceAggregatedList.java | 47 +- .../cloud/compute/v1/TargetInstanceList.java | 53 +- .../compute/v1/TargetInstancesScopedList.java | 33 +- .../google/cloud/compute/v1/TargetPool.java | 88 ++- .../compute/v1/TargetPoolAggregatedList.java | 47 +- .../compute/v1/TargetPoolInstanceHealth.java | 33 +- .../cloud/compute/v1/TargetPoolList.java | 53 +- .../v1/TargetPoolsAddHealthCheckRequest.java | 25 +- .../v1/TargetPoolsAddInstanceRequest.java | 25 +- .../TargetPoolsRemoveHealthCheckRequest.java | 25 +- .../v1/TargetPoolsRemoveInstanceRequest.java | 25 +- .../compute/v1/TargetPoolsScopedList.java | 33 +- .../cloud/compute/v1/TargetReference.java | 21 +- ...getSslProxiesSetBackendServiceRequest.java | 21 +- ...TargetSslProxiesSetProxyHeaderRequest.java | 21 +- ...etSslProxiesSetSslCertificatesRequest.java | 25 +- .../cloud/compute/v1/TargetSslProxy.java | 74 ++- .../cloud/compute/v1/TargetSslProxyList.java | 53 +- ...getTcpProxiesSetBackendServiceRequest.java | 21 +- ...TargetTcpProxiesSetProxyHeaderRequest.java | 21 +- .../cloud/compute/v1/TargetTcpProxy.java | 59 +- .../cloud/compute/v1/TargetTcpProxyList.java | 53 +- .../cloud/compute/v1/TargetVpnGateway.java | 83 ++- .../v1/TargetVpnGatewayAggregatedList.java | 47 +- .../compute/v1/TargetVpnGatewayList.java | 53 +- .../v1/TargetVpnGatewaysScopedList.java | 33 +- .../google/cloud/compute/v1/TestFailure.java | 38 +- ...tIamPermissionsLicenseCodeHttpRequest.java | 66 +- .../TestIamPermissionsLicenseHttpRequest.java | 66 +- .../compute/v1/TestPermissionsRequest.java | 25 +- .../compute/v1/TestPermissionsResponse.java | 25 +- ...UpdateAccessConfigInstanceHttpRequest.java | 74 ++- .../v1/UpdateAutoscalerHttpRequest.java | 102 ++-- .../v1/UpdateBackendBucketHttpRequest.java | 98 +-- .../v1/UpdateBackendServiceHttpRequest.java | 98 +-- .../compute/v1/UpdateFirewallHttpRequest.java | 96 +-- .../v1/UpdateHealthCheckHttpRequest.java | 97 +-- .../v1/UpdateHttpHealthCheckHttpRequest.java | 112 ++-- .../v1/UpdateHttpsHealthCheckHttpRequest.java | 112 ++-- ...teNetworkInterfaceInstanceHttpRequest.java | 103 ++-- .../v1/UpdateRegionAutoscalerHttpRequest.java | 102 ++-- ...UpdateRegionBackendServiceHttpRequest.java | 98 +-- .../compute/v1/UpdateRouterHttpRequest.java | 96 +-- .../compute/v1/UpdateUrlMapHttpRequest.java | 96 +-- .../com/google/cloud/compute/v1/UrlMap.java | 87 ++- .../google/cloud/compute/v1/UrlMapList.java | 53 +- .../cloud/compute/v1/UrlMapReference.java | 21 +- .../google/cloud/compute/v1/UrlMapTest.java | 38 +- .../compute/v1/UrlMapValidationResult.java | 47 +- .../compute/v1/UrlMapsValidateRequest.java | 21 +- .../compute/v1/UrlMapsValidateResponse.java | 21 +- .../cloud/compute/v1/UsageExportLocation.java | 28 +- .../compute/v1/ValidateUrlMapHttpRequest.java | 66 +- .../google/cloud/compute/v1/VpnTunnel.java | 113 +++- .../compute/v1/VpnTunnelAggregatedList.java | 47 +- .../cloud/compute/v1/VpnTunnelList.java | 53 +- .../compute/v1/VpnTunnelsScopedList.java | 33 +- .../com/google/cloud/compute/v1/Warning.java | 38 +- .../com/google/cloud/compute/v1/Warnings.java | 38 +- .../google/cloud/compute/v1/XpnHostList.java | 53 +- .../cloud/compute/v1/XpnResourceId.java | 28 +- .../com/google/cloud/compute/v1/Zone.java | 74 ++- .../com/google/cloud/compute/v1/ZoneList.java | 53 +- .../compute/v1/ZoneSetLabelsRequest.java | 27 +- .../compute/v1/stub/HttpHealthCheckStub.java | 4 +- .../v1/stub/HttpHealthCheckStubSettings.java | 18 +- .../v1/stub/HttpJsonAcceleratorTypeStub.java | 4 + .../compute/v1/stub/HttpJsonAddressStub.java | 5 + .../v1/stub/HttpJsonAutoscalerStub.java | 7 + .../v1/stub/HttpJsonBackendBucketStub.java | 6 + .../v1/stub/HttpJsonBackendServiceStub.java | 9 + .../compute/v1/stub/HttpJsonDiskStub.java | 8 + .../compute/v1/stub/HttpJsonDiskTypeStub.java | 3 + .../compute/v1/stub/HttpJsonFirewallStub.java | 6 + .../v1/stub/HttpJsonForwardingRuleStub.java | 7 + .../v1/stub/HttpJsonGlobalAddressStub.java | 4 + .../HttpJsonGlobalForwardingRuleStub.java | 8 + .../v1/stub/HttpJsonGlobalOperationStub.java | 5 + .../v1/stub/HttpJsonHealthCheckStub.java | 6 + .../v1/stub/HttpJsonHttpHealthCheckStub.java | 24 +- .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 24 +- .../compute/v1/stub/HttpJsonImageStub.java | 7 + .../HttpJsonInstanceGroupManagerStub.java | 22 + .../v1/stub/HttpJsonInstanceGroupStub.java | 13 + .../compute/v1/stub/HttpJsonInstanceStub.java | 34 ++ .../v1/stub/HttpJsonInstanceTemplateStub.java | 4 + .../HttpJsonInterconnectAttachmentStub.java | 9 + .../HttpJsonInterconnectLocationStub.java | 2 + .../v1/stub/HttpJsonInterconnectStub.java | 5 + .../v1/stub/HttpJsonLicenseCodeStub.java | 3 + .../compute/v1/stub/HttpJsonLicenseStub.java | 5 + .../v1/stub/HttpJsonMachineTypeStub.java | 4 + .../compute/v1/stub/HttpJsonNetworkStub.java | 8 + .../compute/v1/stub/HttpJsonProjectStub.java | 14 + .../v1/stub/HttpJsonRegionAutoscalerStub.java | 6 + .../HttpJsonRegionBackendServiceStub.java | 11 + .../v1/stub/HttpJsonRegionCommitmentStub.java | 5 + ...ttpJsonRegionInstanceGroupManagerStub.java | 26 + .../stub/HttpJsonRegionInstanceGroupStub.java | 6 + .../v1/stub/HttpJsonRegionOperationStub.java | 3 + .../compute/v1/stub/HttpJsonRegionStub.java | 2 + .../compute/v1/stub/HttpJsonRouteStub.java | 4 + .../compute/v1/stub/HttpJsonRouterStub.java | 9 + .../compute/v1/stub/HttpJsonSnapshotStub.java | 4 + .../v1/stub/HttpJsonSslCertificateStub.java | 4 + .../v1/stub/HttpJsonSslPolicyStub.java | 7 + .../v1/stub/HttpJsonSubnetworkStub.java | 10 + .../v1/stub/HttpJsonTargetHttpProxyStub.java | 5 + .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 9 + .../v1/stub/HttpJsonTargetInstanceStub.java | 6 + .../v1/stub/HttpJsonTargetPoolStub.java | 12 + .../v1/stub/HttpJsonTargetSslProxyStub.java | 12 + .../v1/stub/HttpJsonTargetTcpProxyStub.java | 8 + .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 6 + .../compute/v1/stub/HttpJsonUrlMapStub.java | 8 + .../v1/stub/HttpJsonVpnTunnelStub.java | 5 + .../v1/stub/HttpJsonZoneOperationStub.java | 3 + .../compute/v1/stub/HttpJsonZoneStub.java | 2 + .../compute/v1/stub/HttpsHealthCheckStub.java | 4 +- .../v1/stub/HttpsHealthCheckStubSettings.java | 18 +- .../compute/v1/HttpHealthCheckClientTest.java | 24 +- .../v1/HttpsHealthCheckClientTest.java | 24 +- 651 files changed, 28121 insertions(+), 9915 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java index 5b3df3ee8132..b9a26621f369 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private AbandonInstancesInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersAbandonInstancesRequestResource") + && instanceGroupManagersAbandonInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupManagersAbandonInstancesRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersAbandonInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("instanceGroupManagersAbandonInstancesRequestResource")) { - return instanceGroupManagersAbandonInstancesRequestResource; + return String.valueOf(instanceGroupManagersAbandonInstancesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public InstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBody() { return instanceGroupManagersAbandonInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java index 8a1b6a30beb0..1ccb72d73dc8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource") + && regionInstanceGroupManagersAbandonInstancesRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersAbandonInstancesRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupManagersAbandonInstancesRequestResource")) { - return regionInstanceGroupManagersAbandonInstancesRequestResource; + return String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public RegionInstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBo return regionInstanceGroupManagersAbandonInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java index f23011e953c4..78206f41eb00 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private AcceleratorConfig(Integer acceleratorCount, String acceleratorType) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("acceleratorCount")) { - return acceleratorCount; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("acceleratorCount") && acceleratorCount != null) { + fieldMap.put("acceleratorCount", Collections.singletonList(String.valueOf(acceleratorCount))); } - if (fieldName.equals("acceleratorType")) { - return acceleratorType; + if (fieldNames.contains("acceleratorType") && acceleratorType != null) { + fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("acceleratorCount")) { + return String.valueOf(acceleratorCount); + } + if (fieldName.equals("acceleratorType")) { + return String.valueOf(acceleratorType); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java index fb87ef23f2f4..77d140001d40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private AcceleratorType( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("maximumCardsPerInstance") && maximumCardsPerInstance != null) { + fieldMap.put( + "maximumCardsPerInstance", + Collections.singletonList(String.valueOf(maximumCardsPerInstance))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("maximumCardsPerInstance")) { - return maximumCardsPerInstance; + return String.valueOf(maximumCardsPerInstance); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -106,12 +146,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java index 3ef933c0ed8e..07b2d2dfd939 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private AcceleratorTypeAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java index 6445ea9d8386..d978fdcbf654 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private AcceleratorTypeList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java index 91d5ebd7ae01..ae1279524908 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private AcceleratorTypesScopedList(List acceleratorTypes, Warni } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("acceleratorTypes")) { - return acceleratorTypes; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("acceleratorTypes") && acceleratorTypes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorType item : acceleratorTypes) { + stringList.add(item.toString()); + } + fieldMap.put("acceleratorTypes", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("acceleratorTypes")) { + return String.valueOf(acceleratorTypes); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java index 700c7be5d262..6f2d287a7072 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -57,24 +61,49 @@ private AccessConfig( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("natIP") && natIP != null) { + fieldMap.put("natIP", Collections.singletonList(String.valueOf(natIP))); + } + if (fieldNames.contains("publicPtrDomainName") && publicPtrDomainName != null) { + fieldMap.put( + "publicPtrDomainName", Collections.singletonList(String.valueOf(publicPtrDomainName))); + } + if (fieldNames.contains("setPublicPtr") && setPublicPtr != null) { + fieldMap.put("setPublicPtr", Collections.singletonList(String.valueOf(setPublicPtr))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("natIP")) { - return natIP; + return String.valueOf(natIP); } if (fieldName.equals("publicPtrDomainName")) { - return publicPtrDomainName; + return String.valueOf(publicPtrDomainName); } if (fieldName.equals("setPublicPtr")) { - return setPublicPtr; + return String.valueOf(setPublicPtr); } if (fieldName.equals("type")) { - return type; + return String.valueOf(type); } return null; } @@ -85,12 +114,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java index 355d5d314cfb..62f3e600b067 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,79 @@ private AddAccessConfigInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { + fieldMap.put( + "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("accessConfigResource")) { - return accessConfigResource; + return String.valueOf(accessConfigResource); } if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("networkInterface")) { - return networkInterface; + return String.valueOf(networkInterface); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +164,6 @@ public AccessConfig getApiMessageRequestBody() { return accessConfigResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public AccessConfig getAccessConfigResource() { return accessConfigResource; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java index 9262d462efe4..b1faf9156468 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private AddHealthCheckTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsAddHealthCheckRequestResource") + && targetPoolsAddHealthCheckRequestResource != null) { + fieldMap.put( + "targetPoolsAddHealthCheckRequestResource", + Collections.singletonList(String.valueOf(targetPoolsAddHealthCheckRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("targetPoolsAddHealthCheckRequestResource")) { - return targetPoolsAddHealthCheckRequestResource; + return String.valueOf(targetPoolsAddHealthCheckRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public TargetPoolsAddHealthCheckRequest getApiMessageRequestBody() { return targetPoolsAddHealthCheckRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java index 29504b899fbf..7a944fcdd6b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private AddInstanceTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsAddInstanceRequestResource") + && targetPoolsAddInstanceRequestResource != null) { + fieldMap.put( + "targetPoolsAddInstanceRequestResource", + Collections.singletonList(String.valueOf(targetPoolsAddInstanceRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("targetPoolsAddInstanceRequestResource")) { - return targetPoolsAddInstanceRequestResource; + return String.valueOf(targetPoolsAddInstanceRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public TargetPoolsAddInstanceRequest getApiMessageRequestBody() { return targetPoolsAddInstanceRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java index d728e67f4649..2585c5368b99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private AddInstancesInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsAddInstancesRequestResource") + && instanceGroupsAddInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsAddInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsAddInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("instanceGroupsAddInstancesRequestResource")) { - return instanceGroupsAddInstancesRequestResource; + return String.valueOf(instanceGroupsAddInstancesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstanceGroupsAddInstancesRequest getApiMessageRequestBody() { return instanceGroupsAddInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java index 2ee03b079e03..01f04c528b36 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private AddPeeringNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networksAddPeeringRequestResource") + && networksAddPeeringRequestResource != null) { + fieldMap.put( + "networksAddPeeringRequestResource", + Collections.singletonList(String.valueOf(networksAddPeeringRequestResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("networksAddPeeringRequestResource")) { - return networksAddPeeringRequestResource; + return String.valueOf(networksAddPeeringRequestResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public NetworksAddPeeringRequest getApiMessageRequestBody() { return networksAddPeeringRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java index 3d04956026b1..bf5fb8f70e1c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -86,45 +91,95 @@ private Address( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("addressType") && addressType != null) { + fieldMap.put("addressType", Collections.singletonList(String.valueOf(addressType))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("ipVersion") && ipVersion != null) { + fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("users") && users != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : users) { + stringList.add(item.toString()); + } + fieldMap.put("users", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("address")) { - return address; + return String.valueOf(address); } if (fieldName.equals("addressType")) { - return addressType; + return String.valueOf(addressType); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("ipVersion")) { - return ipVersion; + return String.valueOf(ipVersion); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("users")) { - return users; + return String.valueOf(users); } return null; } @@ -135,12 +190,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAddress() { return address; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java index 4fb93c707ae0..089c2a50cbab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private AddressAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java index dfad4309cbbe..936e44245a21 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private AddressList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Address item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java index b8aa0161070a..e98751340740 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private AddressesScopedList(List
addresses, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("addresses")) { - return addresses; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("addresses") && addresses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Address item : addresses) { + stringList.add(item.toString()); + } + fieldMap.put("addresses", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("addresses")) { + return String.valueOf(addresses); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java index e2478c51f2dc..12b9d6c85154 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListAcceleratorTypesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java index 88436c282b6b..83487619deab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListAddressesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java index 71a24f28b3a4..9abfaa836482 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListAutoscalersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java index 69a8227af819..eb79e6cb84f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListBackendServicesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java index 89e876b8abb4..a75b2af098ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListDiskTypesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java index c9f8029f34e8..233312cc74e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListDisksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java index 72cea01f104d..b660e858c440 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListForwardingRulesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java index fb2284b7dbee..bf09eaf8d2ed 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListGlobalOperationsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java index 076e196cfb8f..856200d39650 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListInstanceGroupManagersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java index 211639cfbe7c..646396f2bb92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListInstanceGroupsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java index e281da33a595..423c1ce14128 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListInstancesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java index 286d3e0d2f94..76e22de8c8ad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListInterconnectAttachmentsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java index 9c22653c070e..048534c3d74a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListMachineTypesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java index f6e9e5484105..bf7348b89619 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListRegionCommitmentsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java index 619e7fe65aaa..8cf47d8bf4c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListRoutersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java index 8a5bda15a8ef..a99349acb6ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListSubnetworksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java index 91c43d6c5927..6e2c49c6b09f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListTargetInstancesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java index 3c548928adeb..be52b0d6b37d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListTargetPoolsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java index 164b5b92c225..67e1c0a94a9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListTargetVpnGatewaysHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java index 2cac8c858695..f3706a16d0ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private AggregatedListVpnTunnelsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java index c4d1d59b1043..cc3041ce98f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,32 @@ private AliasIpRange(String ipCidrRange, String subnetworkRangeName) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("ipCidrRange")) { - return ipCidrRange; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); } - if (fieldName.equals("subnetworkRangeName")) { - return subnetworkRangeName; + if (fieldNames.contains("subnetworkRangeName") && subnetworkRangeName != null) { + fieldMap.put( + "subnetworkRangeName", Collections.singletonList(String.valueOf(subnetworkRangeName))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } + if (fieldName.equals("subnetworkRangeName")) { + return String.valueOf(subnetworkRangeName); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java index ed17969066a8..b51dc3456385 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private Allowed(String iPProtocol, List ports) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("iPProtocol")) { - return iPProtocol; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("iPProtocol") && iPProtocol != null) { + fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); } - if (fieldName.equals("ports")) { - return ports; + if (fieldNames.contains("ports") && ports != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : ports) { + stringList.add(item.toString()); + } + fieldMap.put("ports", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("iPProtocol")) { + return String.valueOf(iPProtocol); + } + if (fieldName.equals("ports")) { + return String.valueOf(ports); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index 9460daf220cc..395dd15f0ad0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private AttachDiskInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("attachedDiskResource") && attachedDiskResource != null) { + fieldMap.put( + "attachedDiskResource", Collections.singletonList(String.valueOf(attachedDiskResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("attachedDiskResource")) { - return attachedDiskResource; + return String.valueOf(attachedDiskResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public AttachedDisk getApiMessageRequestBody() { return attachedDiskResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java index 13bc11b8ef17..9039024f2ef4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -86,45 +91,99 @@ private AttachedDisk( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoDelete") && autoDelete != null) { + fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); + } + if (fieldNames.contains("boot") && boot != null) { + fieldMap.put("boot", Collections.singletonList(String.valueOf(boot))); + } + if (fieldNames.contains("deviceName") && deviceName != null) { + fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); + } + if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + } + if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (GuestOsFeature item : guestOsFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("guestOsFeatures", stringList.build()); + } + if (fieldNames.contains("index") && index != null) { + fieldMap.put("index", Collections.singletonList(String.valueOf(index))); + } + if (fieldNames.contains("initializeParams") && initializeParams != null) { + fieldMap.put("initializeParams", Collections.singletonList(String.valueOf(initializeParams))); + } + if (fieldNames.contains("interface2") && interface2 != null) { + fieldMap.put("interface2", Collections.singletonList(String.valueOf(interface2))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("mode") && mode != null) { + fieldMap.put("mode", Collections.singletonList(String.valueOf(mode))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("autoDelete")) { - return autoDelete; + return String.valueOf(autoDelete); } if (fieldName.equals("boot")) { - return boot; + return String.valueOf(boot); } if (fieldName.equals("deviceName")) { - return deviceName; + return String.valueOf(deviceName); } if (fieldName.equals("diskEncryptionKey")) { - return diskEncryptionKey; + return String.valueOf(diskEncryptionKey); } if (fieldName.equals("guestOsFeatures")) { - return guestOsFeatures; + return String.valueOf(guestOsFeatures); } if (fieldName.equals("index")) { - return index; + return String.valueOf(index); } if (fieldName.equals("initializeParams")) { - return initializeParams; + return String.valueOf(initializeParams); } if (fieldName.equals("interface2")) { - return interface2; + return String.valueOf(interface2); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("licenses")) { - return licenses; + return String.valueOf(licenses); } if (fieldName.equals("mode")) { - return mode; + return String.valueOf(mode); } if (fieldName.equals("source")) { - return source; + return String.valueOf(source); } if (fieldName.equals("type")) { - return type; + return String.valueOf(type); } return null; } @@ -135,12 +194,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getAutoDelete() { return autoDelete; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java index ca7015f26d13..ebc8f214e56b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,50 @@ private AttachedDiskInitializeParams( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskName") && diskName != null) { + fieldMap.put("diskName", Collections.singletonList(String.valueOf(diskName))); + } + if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { + fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); + } + if (fieldNames.contains("diskType") && diskType != null) { + fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("diskName")) { - return diskName; + return String.valueOf(diskName); } if (fieldName.equals("diskSizeGb")) { - return diskSizeGb; + return String.valueOf(diskSizeGb); } if (fieldName.equals("diskType")) { - return diskType; + return String.valueOf(diskType); } if (fieldName.equals("labels")) { - return labels; + return String.valueOf(labels); } if (fieldName.equals("sourceImage")) { - return sourceImage; + return String.valueOf(sourceImage); } if (fieldName.equals("sourceImageEncryptionKey")) { - return sourceImageEncryptionKey; + return String.valueOf(sourceImageEncryptionKey); } return null; } @@ -86,12 +115,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getDiskName() { return diskName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java index 4b73600d6412..0c6b2d8ed12e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -82,42 +87,90 @@ private Autoscaler( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoscalingPolicy") && autoscalingPolicy != null) { + fieldMap.put( + "autoscalingPolicy", Collections.singletonList(String.valueOf(autoscalingPolicy))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusDetails") && statusDetails != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AutoscalerStatusDetails item : statusDetails) { + stringList.add(item.toString()); + } + fieldMap.put("statusDetails", stringList.build()); + } + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("autoscalingPolicy")) { - return autoscalingPolicy; + return String.valueOf(autoscalingPolicy); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("statusDetails")) { - return statusDetails; + return String.valueOf(statusDetails); } if (fieldName.equals("target")) { - return target; + return String.valueOf(target); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -128,12 +181,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public AutoscalingPolicy getAutoscalingPolicy() { return autoscalingPolicy; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java index 3e0ac9f3b606..af7e74834ac5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private AutoscalerAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java index ebf938b369cb..c2f9aafcc324 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private AutoscalerList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Autoscaler item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java index 23faa574e2d4..846838c8c2a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private AutoscalerStatusDetails(String message, String type) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("message")) { - return message; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); } - if (fieldName.equals("type")) { - return type; + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("message")) { + return String.valueOf(message); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java index c8a2cc70631a..33fd70094e0c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private AutoscalersScopedList(List autoscalers, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("autoscalers")) { - return autoscalers; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoscalers") && autoscalers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Autoscaler item : autoscalers) { + stringList.add(item.toString()); + } + fieldMap.put("autoscalers", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("autoscalers")) { + return String.valueOf(autoscalers); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java index 9a8c18371125..e229455b299f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,55 @@ private AutoscalingPolicy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("coolDownPeriodSec") && coolDownPeriodSec != null) { + fieldMap.put( + "coolDownPeriodSec", Collections.singletonList(String.valueOf(coolDownPeriodSec))); + } + if (fieldNames.contains("cpuUtilization") && cpuUtilization != null) { + fieldMap.put("cpuUtilization", Collections.singletonList(String.valueOf(cpuUtilization))); + } + if (fieldNames.contains("customMetricUtilizations") && customMetricUtilizations != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AutoscalingPolicyCustomMetricUtilization item : customMetricUtilizations) { + stringList.add(item.toString()); + } + fieldMap.put("customMetricUtilizations", stringList.build()); + } + if (fieldNames.contains("loadBalancingUtilization") && loadBalancingUtilization != null) { + fieldMap.put( + "loadBalancingUtilization", + Collections.singletonList(String.valueOf(loadBalancingUtilization))); + } + if (fieldNames.contains("maxNumReplicas") && maxNumReplicas != null) { + fieldMap.put("maxNumReplicas", Collections.singletonList(String.valueOf(maxNumReplicas))); + } + if (fieldNames.contains("minNumReplicas") && minNumReplicas != null) { + fieldMap.put("minNumReplicas", Collections.singletonList(String.valueOf(minNumReplicas))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("coolDownPeriodSec")) { - return coolDownPeriodSec; + return String.valueOf(coolDownPeriodSec); } if (fieldName.equals("cpuUtilization")) { - return cpuUtilization; + return String.valueOf(cpuUtilization); } if (fieldName.equals("customMetricUtilizations")) { - return customMetricUtilizations; + return String.valueOf(customMetricUtilizations); } if (fieldName.equals("loadBalancingUtilization")) { - return loadBalancingUtilization; + return String.valueOf(loadBalancingUtilization); } if (fieldName.equals("maxNumReplicas")) { - return maxNumReplicas; + return String.valueOf(maxNumReplicas); } if (fieldName.equals("minNumReplicas")) { - return minNumReplicas; + return String.valueOf(minNumReplicas); } return null; } @@ -86,12 +122,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Integer getCoolDownPeriodSec() { return coolDownPeriodSec; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java index 5d195b49d90e..4ff32c3a8ad6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,26 @@ private AutoscalingPolicyCpuUtilization(Double utilizationTarget) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("utilizationTarget")) { - return utilizationTarget; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { + fieldMap.put( + "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return String.valueOf(utilizationTarget); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java index 2098a3495b66..c72326ca0f8c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +47,33 @@ private AutoscalingPolicyCustomMetricUtilization( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("metric") && metric != null) { + fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); + } + if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { + fieldMap.put( + "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + } + if (fieldNames.contains("utilizationTargetType") && utilizationTargetType != null) { + fieldMap.put( + "utilizationTargetType", + Collections.singletonList(String.valueOf(utilizationTargetType))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("metric")) { - return metric; + return String.valueOf(metric); } if (fieldName.equals("utilizationTarget")) { - return utilizationTarget; + return String.valueOf(utilizationTarget); } if (fieldName.equals("utilizationTargetType")) { - return utilizationTargetType; + return String.valueOf(utilizationTargetType); } return null; } @@ -62,12 +84,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getMetric() { return metric; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java index e7b3fa592d42..ecdd43a850a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,26 @@ private AutoscalingPolicyLoadBalancingUtilization(Double utilizationTarget) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("utilizationTarget")) { - return utilizationTarget; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { + fieldMap.put( + "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return String.valueOf(utilizationTarget); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java index 07e1da2dc268..47c88237a96f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private Backend( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("balancingMode") && balancingMode != null) { + fieldMap.put("balancingMode", Collections.singletonList(String.valueOf(balancingMode))); + } + if (fieldNames.contains("capacityScaler") && capacityScaler != null) { + fieldMap.put("capacityScaler", Collections.singletonList(String.valueOf(capacityScaler))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("group") && group != null) { + fieldMap.put("group", Collections.singletonList(String.valueOf(group))); + } + if (fieldNames.contains("maxConnections") && maxConnections != null) { + fieldMap.put("maxConnections", Collections.singletonList(String.valueOf(maxConnections))); + } + if (fieldNames.contains("maxConnectionsPerInstance") && maxConnectionsPerInstance != null) { + fieldMap.put( + "maxConnectionsPerInstance", + Collections.singletonList(String.valueOf(maxConnectionsPerInstance))); + } + if (fieldNames.contains("maxRate") && maxRate != null) { + fieldMap.put("maxRate", Collections.singletonList(String.valueOf(maxRate))); + } + if (fieldNames.contains("maxRatePerInstance") && maxRatePerInstance != null) { + fieldMap.put( + "maxRatePerInstance", Collections.singletonList(String.valueOf(maxRatePerInstance))); + } + if (fieldNames.contains("maxUtilization") && maxUtilization != null) { + fieldMap.put("maxUtilization", Collections.singletonList(String.valueOf(maxUtilization))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("balancingMode")) { - return balancingMode; + return String.valueOf(balancingMode); } if (fieldName.equals("capacityScaler")) { - return capacityScaler; + return String.valueOf(capacityScaler); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("group")) { - return group; + return String.valueOf(group); } if (fieldName.equals("maxConnections")) { - return maxConnections; + return String.valueOf(maxConnections); } if (fieldName.equals("maxConnectionsPerInstance")) { - return maxConnectionsPerInstance; + return String.valueOf(maxConnectionsPerInstance); } if (fieldName.equals("maxRate")) { - return maxRate; + return String.valueOf(maxRate); } if (fieldName.equals("maxRatePerInstance")) { - return maxRatePerInstance; + return String.valueOf(maxRatePerInstance); } if (fieldName.equals("maxUtilization")) { - return maxUtilization; + return String.valueOf(maxUtilization); } return null; } @@ -106,12 +146,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getBalancingMode() { return balancingMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java index 31d2b09925c8..96bf4e7e748e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,61 @@ private BackendBucket( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bucketName") && bucketName != null) { + fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enableCdn") && enableCdn != null) { + fieldMap.put("enableCdn", Collections.singletonList(String.valueOf(enableCdn))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("bucketName")) { - return bucketName; + return String.valueOf(bucketName); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("enableCdn")) { - return enableCdn; + return String.valueOf(enableCdn); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -99,12 +134,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getBucketName() { return bucketName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java index c291cf9ca2cb..603ca247d2ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private BackendBucketList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (BackendBucket item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java index 7b0d8a5b5971..20ad95f049f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -118,69 +123,150 @@ private BackendService( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("affinityCookieTtlSec") && affinityCookieTtlSec != null) { + fieldMap.put( + "affinityCookieTtlSec", Collections.singletonList(String.valueOf(affinityCookieTtlSec))); + } + if (fieldNames.contains("backends") && backends != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Backend item : backends) { + stringList.add(item.toString()); + } + fieldMap.put("backends", stringList.build()); + } + if (fieldNames.contains("cdnPolicy") && cdnPolicy != null) { + fieldMap.put("cdnPolicy", Collections.singletonList(String.valueOf(cdnPolicy))); + } + if (fieldNames.contains("connectionDraining") && connectionDraining != null) { + fieldMap.put( + "connectionDraining", Collections.singletonList(String.valueOf(connectionDraining))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enableCDN") && enableCDN != null) { + fieldMap.put("enableCDN", Collections.singletonList(String.valueOf(enableCDN))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); + } + if (fieldNames.contains("iap") && iap != null) { + fieldMap.put("iap", Collections.singletonList(String.valueOf(iap))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { + fieldMap.put( + "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("protocol") && protocol != null) { + fieldMap.put("protocol", Collections.singletonList(String.valueOf(protocol))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) { + fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("affinityCookieTtlSec")) { - return affinityCookieTtlSec; + return String.valueOf(affinityCookieTtlSec); } if (fieldName.equals("backends")) { - return backends; + return String.valueOf(backends); } if (fieldName.equals("cdnPolicy")) { - return cdnPolicy; + return String.valueOf(cdnPolicy); } if (fieldName.equals("connectionDraining")) { - return connectionDraining; + return String.valueOf(connectionDraining); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("enableCDN")) { - return enableCDN; + return String.valueOf(enableCDN); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("healthChecks")) { - return healthChecks; + return String.valueOf(healthChecks); } if (fieldName.equals("iap")) { - return iap; + return String.valueOf(iap); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("loadBalancingScheme")) { - return loadBalancingScheme; + return String.valueOf(loadBalancingScheme); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("port")) { - return port; + return String.valueOf(port); } if (fieldName.equals("portName")) { - return portName; + return String.valueOf(portName); } if (fieldName.equals("protocol")) { - return protocol; + return String.valueOf(protocol); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sessionAffinity")) { - return sessionAffinity; + return String.valueOf(sessionAffinity); } if (fieldName.equals("timeoutSec")) { - return timeoutSec; + return String.valueOf(timeoutSec); } return null; } @@ -191,12 +277,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Integer getAffinityCookieTtlSec() { return affinityCookieTtlSec; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java index 85b75e24ef98..213fd39884fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private BackendServiceAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java index b9892872ad1d..e00f03c76397 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private BackendServiceCdnPolicy(CacheKeyPolicy cacheKeyPolicy) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("cacheKeyPolicy")) { - return cacheKeyPolicy; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("cacheKeyPolicy") && cacheKeyPolicy != null) { + fieldMap.put("cacheKeyPolicy", Collections.singletonList(String.valueOf(cacheKeyPolicy))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("cacheKeyPolicy")) { + return String.valueOf(cacheKeyPolicy); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java index ef90349b4949..28ff6b520dff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private BackendServiceGroupHealth(List healthStatus, String kind) } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("healthStatus")) { - return healthStatus; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthStatus") && healthStatus != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthStatus item : healthStatus) { + stringList.add(item.toString()); + } + fieldMap.put("healthStatus", stringList.build()); } - if (fieldName.equals("kind")) { - return kind; + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthStatus")) { + return String.valueOf(healthStatus); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java index 7bf7ea7e950b..5dc77ed986f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,18 +53,39 @@ private BackendServiceIAP( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("enabled") && enabled != null) { + fieldMap.put("enabled", Collections.singletonList(String.valueOf(enabled))); + } + if (fieldNames.contains("oauth2ClientId") && oauth2ClientId != null) { + fieldMap.put("oauth2ClientId", Collections.singletonList(String.valueOf(oauth2ClientId))); + } + if (fieldNames.contains("oauth2ClientSecret") && oauth2ClientSecret != null) { + fieldMap.put( + "oauth2ClientSecret", Collections.singletonList(String.valueOf(oauth2ClientSecret))); + } + if (fieldNames.contains("oauth2ClientSecretSha256") && oauth2ClientSecretSha256 != null) { + fieldMap.put( + "oauth2ClientSecretSha256", + Collections.singletonList(String.valueOf(oauth2ClientSecretSha256))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("enabled")) { - return enabled; + return String.valueOf(enabled); } if (fieldName.equals("oauth2ClientId")) { - return oauth2ClientId; + return String.valueOf(oauth2ClientId); } if (fieldName.equals("oauth2ClientSecret")) { - return oauth2ClientSecret; + return String.valueOf(oauth2ClientSecret); } if (fieldName.equals("oauth2ClientSecretSha256")) { - return oauth2ClientSecretSha256; + return String.valueOf(oauth2ClientSecretSha256); } return null; } @@ -71,12 +96,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getEnabled() { return enabled; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java index e89fdd5087ca..3f6c7a98681c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private BackendServiceList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (BackendService item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java index 2314286e6873..0d964ea5d92d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private BackendServicesScopedList(List backendServices, Warning } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("backendServices")) { - return backendServices; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("backendServices") && backendServices != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (BackendService item : backendServices) { + stringList.add(item.toString()); + } + fieldMap.put("backendServices", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("backendServices")) { + return String.valueOf(backendServices); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java index 34d363da9d00..0a8d49d8c913 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private CacheInvalidationRule(String host, String path) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("host")) { - return host; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); } - if (fieldName.equals("path")) { - return path; + if (fieldNames.contains("path") && path != null) { + fieldMap.put("path", Collections.singletonList(String.valueOf(path))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("path")) { + return String.valueOf(path); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java index ebfa5f81c911..521b6a093360 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -54,21 +59,51 @@ private CacheKeyPolicy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("includeHost") && includeHost != null) { + fieldMap.put("includeHost", Collections.singletonList(String.valueOf(includeHost))); + } + if (fieldNames.contains("includeProtocol") && includeProtocol != null) { + fieldMap.put("includeProtocol", Collections.singletonList(String.valueOf(includeProtocol))); + } + if (fieldNames.contains("includeQueryString") && includeQueryString != null) { + fieldMap.put( + "includeQueryString", Collections.singletonList(String.valueOf(includeQueryString))); + } + if (fieldNames.contains("queryStringBlacklist") && queryStringBlacklist != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : queryStringBlacklist) { + stringList.add(item.toString()); + } + fieldMap.put("queryStringBlacklist", stringList.build()); + } + if (fieldNames.contains("queryStringWhitelist") && queryStringWhitelist != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : queryStringWhitelist) { + stringList.add(item.toString()); + } + fieldMap.put("queryStringWhitelist", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("includeHost")) { - return includeHost; + return String.valueOf(includeHost); } if (fieldName.equals("includeProtocol")) { - return includeProtocol; + return String.valueOf(includeProtocol); } if (fieldName.equals("includeQueryString")) { - return includeQueryString; + return String.valueOf(includeQueryString); } if (fieldName.equals("queryStringBlacklist")) { - return queryStringBlacklist; + return String.valueOf(queryStringBlacklist); } if (fieldName.equals("queryStringWhitelist")) { - return queryStringWhitelist; + return String.valueOf(queryStringWhitelist); } return null; } @@ -79,12 +114,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getIncludeHost() { return includeHost; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java index dc34e8a93323..5bd07d7e5efd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -86,45 +91,95 @@ private Commitment( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("endTimestamp") && endTimestamp != null) { + fieldMap.put("endTimestamp", Collections.singletonList(String.valueOf(endTimestamp))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("plan") && plan != null) { + fieldMap.put("plan", Collections.singletonList(String.valueOf(plan))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("resources") && resources != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ResourceCommitment item : resources) { + stringList.add(item.toString()); + } + fieldMap.put("resources", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("startTimestamp") && startTimestamp != null) { + fieldMap.put("startTimestamp", Collections.singletonList(String.valueOf(startTimestamp))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusMessage") && statusMessage != null) { + fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("endTimestamp")) { - return endTimestamp; + return String.valueOf(endTimestamp); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("plan")) { - return plan; + return String.valueOf(plan); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("resources")) { - return resources; + return String.valueOf(resources); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("startTimestamp")) { - return startTimestamp; + return String.valueOf(startTimestamp); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("statusMessage")) { - return statusMessage; + return String.valueOf(statusMessage); } return null; } @@ -135,12 +190,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java index 755176db0c56..0a9cf4e5b86b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private CommitmentAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java index 8d6a8931d91b..c67292729f6c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private CommitmentList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Commitment item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java index 7abc8f23eb5a..ae7cb02bbbfc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private CommitmentsScopedList(List commitments, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("commitments")) { - return commitments; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("commitments") && commitments != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Commitment item : commitments) { + stringList.add(item.toString()); + } + fieldMap.put("commitments", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("commitments")) { + return String.valueOf(commitments); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java index cbcf3e4a0732..1f6c0b898838 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,26 @@ private ConnectionDraining(Integer drainingTimeoutSec) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("drainingTimeoutSec")) { - return drainingTimeoutSec; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("drainingTimeoutSec") && drainingTimeoutSec != null) { + fieldMap.put( + "drainingTimeoutSec", Collections.singletonList(String.valueOf(drainingTimeoutSec))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("drainingTimeoutSec")) { + return String.valueOf(drainingTimeoutSec); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java index 61bb82da6835..22e34f75bc37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,78 @@ private CreateSnapshotDiskHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("guestFlush") && guestFlush != null) { + fieldMap.put("guestFlush", Collections.singletonList(String.valueOf(guestFlush))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("snapshotResource") && snapshotResource != null) { + fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("disk")) { - return disk; + return String.valueOf(disk); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("guestFlush")) { - return guestFlush; + return String.valueOf(guestFlush); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("snapshotResource")) { - return snapshotResource; + return String.valueOf(snapshotResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +163,6 @@ public Snapshot getApiMessageRequestBody() { return snapshotResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java index 5c1acb5c85e4..9535453d1ed2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private CustomerEncryptionKey(String rawKey, String sha256) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("rawKey")) { - return rawKey; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("rawKey") && rawKey != null) { + fieldMap.put("rawKey", Collections.singletonList(String.valueOf(rawKey))); } - if (fieldName.equals("sha256")) { - return sha256; + if (fieldNames.contains("sha256") && sha256 != null) { + fieldMap.put("sha256", Collections.singletonList(String.valueOf(sha256))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("rawKey")) { + return String.valueOf(rawKey); + } + if (fieldName.equals("sha256")) { + return String.valueOf(sha256); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java index 31796df11626..a7e25e4ff78d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +44,32 @@ private CustomerEncryptionKeyProtectedDisk( } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("diskEncryptionKey")) { - return diskEncryptionKey; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); } - if (fieldName.equals("source")) { - return source; + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskEncryptionKey")) { + return String.valueOf(diskEncryptionKey); + } + if (fieldName.equals("source")) { + return String.valueOf(source); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java index d74b9ed54b52..1984f5b20e4c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private Data(String key, String value) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("key")) { - return key; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); } - if (fieldName.equals("value")) { - return value; + if (fieldNames.contains("value") && value != null) { + fieldMap.put("value", Collections.singletonList(String.valueOf(value))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("value")) { + return String.valueOf(value); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java index 0d0497c6c3a4..fb7423784f94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,78 @@ private DeleteAccessConfigInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfig") && accessConfig != null) { + fieldMap.put("accessConfig", Collections.singletonList(String.valueOf(accessConfig))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("accessConfig")) { - return accessConfig; + return String.valueOf(accessConfig); } if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("networkInterface")) { - return networkInterface; + return String.valueOf(networkInterface); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +163,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessConfig() { return accessConfig; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java index 693eafccbf44..3aed29febb4b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteAddressHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("address")) { - return address; + return String.valueOf(address); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java index 0d0e58fd556a..501172a2ea9d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java index bdefaf6a5a18..41386c1527a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteBackendBucketHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucket") && backendBucket != null) { + fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendBucket")) { - return backendBucket; + return String.valueOf(backendBucket); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java index 36c2f268f09b..fc9ec286591d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java index 6f71d205d1ed..4f400cea4939 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteDiskHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("disk")) { - return disk; + return String.valueOf(disk); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java index 170556e99284..0a95cdb91268 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteFirewallHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("firewall")) { - return firewall; + return String.valueOf(firewall); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java index 42e54201f856..ba1826a2c7a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRule")) { - return forwardingRule; + return String.valueOf(forwardingRule); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java index b1106d5bb80e..a19eb85ef20c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteGlobalAddressHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("address")) { - return address; + return String.valueOf(address); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java index 9035cee23212..ccc7cd90e76b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteGlobalForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRule")) { - return forwardingRule; + return String.valueOf(forwardingRule); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java index 6e092ff9013d..dffbfeba8a65 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private DeleteGlobalOperationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("operation")) { - return operation; + return String.valueOf(operation); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java index 8d3a336d5895..d597ed87bc26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("healthCheck")) { - return healthCheck; + return String.valueOf(healthCheck); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java index d349a48aa402..d98cdc2eaff1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteHttpHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpHealthCheck")) { - return httpHealthCheck; + return String.valueOf(httpHealthCheck); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java index 8152f210254e..ea083fec6dd1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteHttpsHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpsHealthCheck")) { - return httpsHealthCheck; + return String.valueOf(httpsHealthCheck); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java index c7553ecc3d21..f192fa56ff6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteImageHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("image") && image != null) { + fieldMap.put("image", Collections.singletonList(String.valueOf(image))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("image")) { - return image; + return String.valueOf(image); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java index 7493d25b35fb..f1049a23f64d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java index 45f5f6490909..3716bb27c6fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,67 @@ private DeleteInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +144,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java index 6f9a6197141f..673d763e1b3b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java index e1220a364c62..91e9b81e9b8d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteInstanceTemplateHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceTemplate")) { - return instanceTemplate; + return String.valueOf(instanceTemplate); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java index 3f87e1272557..d02f3aa75879 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private DeleteInstancesInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersDeleteInstancesRequestResource") + && instanceGroupManagersDeleteInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupManagersDeleteInstancesRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersDeleteInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("instanceGroupManagersDeleteInstancesRequestResource")) { - return instanceGroupManagersDeleteInstancesRequestResource; + return String.valueOf(instanceGroupManagersDeleteInstancesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public InstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBody() { return instanceGroupManagersDeleteInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java index 45a0bd96edd6..8b1b4978b59f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource") + && regionInstanceGroupManagersDeleteInstancesRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersDeleteInstancesRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupManagersDeleteInstancesRequestResource")) { - return regionInstanceGroupManagersDeleteInstancesRequestResource; + return String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public RegionInstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBod return regionInstanceGroupManagersDeleteInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java index 21d38965684f..a954333c2313 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,68 @@ private DeleteInterconnectAttachmentHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) { + fieldMap.put( + "interconnectAttachment", + Collections.singletonList(String.valueOf(interconnectAttachment))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnectAttachment")) { - return interconnectAttachment; + return String.valueOf(interconnectAttachment); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +145,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java index f500dceac067..6b47502e9489 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteInterconnectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnect") && interconnect != null) { + fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnect")) { - return interconnect; + return String.valueOf(interconnect); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java index 1b72506cf12b..6746f152dc4d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteLicenseHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("license") && license != null) { + fieldMap.put("license", Collections.singletonList(String.valueOf(license))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("license")) { - return license; + return String.valueOf(license); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java index 7541e806787a..c0091faaf314 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java index 08cc13a54a85..e2f86b272efa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteRegionAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java index 008d140f7a38..8ba0bf3ce1fc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteRegionBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java index e11f8b34363a..9d007d07395c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,67 @@ private DeleteRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +144,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java index 6055704b364e..0aa04d0347fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private DeleteRegionOperationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("operation")) { - return operation; + return String.valueOf(operation); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java index 386c7b765e77..169f670aaefb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteRouteHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("route") && route != null) { + fieldMap.put("route", Collections.singletonList(String.valueOf(route))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("route")) { - return route; + return String.valueOf(route); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java index 5bd48ef27f22..2b2c5dffd844 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java index bd2cc210d568..bc41b7100059 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteSnapshotHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("snapshot") && snapshot != null) { + fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("snapshot")) { - return snapshot; + return String.valueOf(snapshot); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java index d73bc6c2785a..45c38ccbdb4b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteSslCertificateHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslCertificate") && sslCertificate != null) { + fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslCertificate")) { - return sslCertificate; + return String.valueOf(sslCertificate); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java index 270a2dd6834e..dabf1a10aadc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteSslPolicyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslPolicy")) { - return sslPolicy; + return String.valueOf(sslPolicy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java index 4270d7f84e8c..92553629d430 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteSubnetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java index 6b2928c2b241..1ec62978cef3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetHttpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { + fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpProxy")) { - return targetHttpProxy; + return String.valueOf(targetHttpProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java index 27f496359c10..1adb6c8e9987 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetHttpsProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpsProxy")) { - return targetHttpsProxy; + return String.valueOf(targetHttpsProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java index 7c0999908eec..4ae64c4505e0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetInstance") && targetInstance != null) { + fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetInstance")) { - return targetInstance; + return String.valueOf(targetInstance); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java index aca94b513e81..c520c4629eee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java index 645f7b594a81..58c4c718a276 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetSslProxy")) { - return targetSslProxy; + return String.valueOf(targetSslProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java index 76e48333d234..20e042141905 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetTcpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { + fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetTcpProxy")) { - return targetTcpProxy; + return String.valueOf(targetTcpProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java index bba660371155..f9dc3744a64d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteTargetVpnGatewayHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { + fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetVpnGateway")) { - return targetVpnGateway; + return String.valueOf(targetVpnGateway); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java index e4be6526e378..ce830ad22a39 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java index f886123d795a..04c41adf8d23 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DeleteVpnTunnelHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) { + fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("vpnTunnel")) { - return vpnTunnel; + return String.valueOf(vpnTunnel); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java index 40ddc56cdec5..ddb4f4ffd11b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private DeleteZoneOperationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("operation")) { - return operation; + return String.valueOf(operation); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java index e841066a4447..8d93d2ea8590 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private Denied(String iPProtocol, List ports) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("iPProtocol")) { - return iPProtocol; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("iPProtocol") && iPProtocol != null) { + fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); } - if (fieldName.equals("ports")) { - return ports; + if (fieldNames.contains("ports") && ports != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : ports) { + stringList.add(item.toString()); + } + fieldMap.put("ports", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("iPProtocol")) { + return String.valueOf(iPProtocol); + } + if (fieldName.equals("ports")) { + return String.valueOf(ports); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java index fd9fbc338322..663b4d0f8606 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private DeprecateImageHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deprecationStatusResource") && deprecationStatusResource != null) { + fieldMap.put( + "deprecationStatusResource", + Collections.singletonList(String.valueOf(deprecationStatusResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("image") && image != null) { + fieldMap.put("image", Collections.singletonList(String.valueOf(image))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("deprecationStatusResource")) { - return deprecationStatusResource; + return String.valueOf(deprecationStatusResource); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("image")) { - return image; + return String.valueOf(image); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public DeprecationStatus getApiMessageRequestBody() { return deprecationStatusResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java index c0022caa6ff8..6a5068384d9b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,21 +53,42 @@ private DeprecationStatus( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("deleted") && deleted != null) { + fieldMap.put("deleted", Collections.singletonList(String.valueOf(deleted))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("obsolete") && obsolete != null) { + fieldMap.put("obsolete", Collections.singletonList(String.valueOf(obsolete))); + } + if (fieldNames.contains("replacement") && replacement != null) { + fieldMap.put("replacement", Collections.singletonList(String.valueOf(replacement))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("deleted")) { - return deleted; + return String.valueOf(deleted); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("obsolete")) { - return obsolete; + return String.valueOf(obsolete); } if (fieldName.equals("replacement")) { - return replacement; + return String.valueOf(replacement); } if (fieldName.equals("state")) { - return state; + return String.valueOf(state); } return null; } @@ -74,12 +99,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getDeleted() { return deleted; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java index e93c3ac9809f..abaf1ce24c20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private DetachDiskInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deviceName") && deviceName != null) { + fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("deviceName")) { - return deviceName; + return String.valueOf(deviceName); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java index e99584fb3776..60345cd24532 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private DisableXpnHostProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java index 8338ca7c7a40..3add0970478b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private DisableXpnResourceProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("projectsDisableXpnResourceRequestResource") + && projectsDisableXpnResourceRequestResource != null) { + fieldMap.put( + "projectsDisableXpnResourceRequestResource", + Collections.singletonList(String.valueOf(projectsDisableXpnResourceRequestResource))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("projectsDisableXpnResourceRequestResource")) { - return projectsDisableXpnResourceRequestResource; + return String.valueOf(projectsDisableXpnResourceRequestResource); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public ProjectsDisableXpnResourceRequest getApiMessageRequestBody() { return projectsDisableXpnResourceRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java index bf75a574cd56..4a32a093e2ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java @@ -17,10 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -139,84 +143,192 @@ private Disk( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { + fieldMap.put( + "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); + } + if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (GuestOsFeature item : guestOsFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("guestOsFeatures", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) { + fieldMap.put( + "lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp))); + } + if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) { + fieldMap.put( + "lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp))); + } + if (fieldNames.contains("licenseCodes") && licenseCodes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenseCodes) { + stringList.add(item.toString()); + } + fieldMap.put("licenseCodes", stringList.build()); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("options") && options != null) { + fieldMap.put("options", Collections.singletonList(String.valueOf(options))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sizeGb") && sizeGb != null) { + fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + } + if (fieldNames.contains("sourceImageId") && sourceImageId != null) { + fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); + } + if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) { + fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); + } + if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { + fieldMap.put( + "sourceSnapshotEncryptionKey", + Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); + } + if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { + fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + if (fieldNames.contains("users") && users != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : users) { + stringList.add(item.toString()); + } + fieldMap.put("users", stringList.build()); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("diskEncryptionKey")) { - return diskEncryptionKey; + return String.valueOf(diskEncryptionKey); } if (fieldName.equals("guestOsFeatures")) { - return guestOsFeatures; + return String.valueOf(guestOsFeatures); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + return String.valueOf(labelFingerprint); } if (fieldName.equals("labels")) { - return labels; + return String.valueOf(labels); } if (fieldName.equals("lastAttachTimestamp")) { - return lastAttachTimestamp; + return String.valueOf(lastAttachTimestamp); } if (fieldName.equals("lastDetachTimestamp")) { - return lastDetachTimestamp; + return String.valueOf(lastDetachTimestamp); } if (fieldName.equals("licenseCodes")) { - return licenseCodes; + return String.valueOf(licenseCodes); } if (fieldName.equals("licenses")) { - return licenses; + return String.valueOf(licenses); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("options")) { - return options; + return String.valueOf(options); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sizeGb")) { - return sizeGb; + return String.valueOf(sizeGb); } if (fieldName.equals("sourceImage")) { - return sourceImage; + return String.valueOf(sourceImage); } if (fieldName.equals("sourceImageEncryptionKey")) { - return sourceImageEncryptionKey; + return String.valueOf(sourceImageEncryptionKey); } if (fieldName.equals("sourceImageId")) { - return sourceImageId; + return String.valueOf(sourceImageId); } if (fieldName.equals("sourceSnapshot")) { - return sourceSnapshot; + return String.valueOf(sourceSnapshot); } if (fieldName.equals("sourceSnapshotEncryptionKey")) { - return sourceSnapshotEncryptionKey; + return String.valueOf(sourceSnapshotEncryptionKey); } if (fieldName.equals("sourceSnapshotId")) { - return sourceSnapshotId; + return String.valueOf(sourceSnapshotId); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("type")) { - return type; + return String.valueOf(type); } if (fieldName.equals("users")) { - return users; + return String.valueOf(users); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -227,12 +339,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java index e3254b1b0e23..e9267403e344 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private DiskAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java index 41c6fe8ff920..9aa240ff1239 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private DiskList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Disk item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java index a2883c8c4c96..28420b92da74 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private DiskMoveRequest(String destinationZone, String targetDisk) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("destinationZone")) { - return destinationZone; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("destinationZone") && destinationZone != null) { + fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone))); } - if (fieldName.equals("targetDisk")) { - return targetDisk; + if (fieldNames.contains("targetDisk") && targetDisk != null) { + fieldMap.put("targetDisk", Collections.singletonList(String.valueOf(targetDisk))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("destinationZone")) { + return String.valueOf(destinationZone); + } + if (fieldName.equals("targetDisk")) { + return String.valueOf(targetDisk); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java index f5ca8f0720da..a3283274dd37 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private DiskType( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("defaultDiskSizeGb") && defaultDiskSizeGb != null) { + fieldMap.put( + "defaultDiskSizeGb", Collections.singletonList(String.valueOf(defaultDiskSizeGb))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("validDiskSize") && validDiskSize != null) { + fieldMap.put("validDiskSize", Collections.singletonList(String.valueOf(validDiskSize))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("defaultDiskSizeGb")) { - return defaultDiskSizeGb; + return String.valueOf(defaultDiskSizeGb); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("validDiskSize")) { - return validDiskSize; + return String.valueOf(validDiskSize); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -113,12 +155,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java index 74b9171c6866..b41efcfa2bfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private DiskTypeAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java index c22ef5722ef9..ebd739b3d4ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private DiskTypeList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (DiskType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java index 130e23217f19..03ace04edf50 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private DiskTypesScopedList(List diskTypes, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("diskTypes")) { - return diskTypes; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskTypes") && diskTypes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (DiskType item : diskTypes) { + stringList.add(item.toString()); + } + fieldMap.put("diskTypes", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskTypes")) { + return String.valueOf(diskTypes); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java index 24b6df9cdd91..6f833e5e86d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private DisksResizeRequest(String sizeGb) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("sizeGb")) { - return sizeGb; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sizeGb") && sizeGb != null) { + fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sizeGb")) { + return String.valueOf(sizeGb); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java index 8efc36590961..25d5992e60fd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private DisksScopedList(List disks, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("disks")) { - return disks; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Disk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("disks")) { + return String.valueOf(disks); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java index 439065cdbae3..80bee960b45c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private EnableXpnHostProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java index 47b515ca4b1f..b8318817bae1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private EnableXpnResourceProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("projectsEnableXpnResourceRequestResource") + && projectsEnableXpnResourceRequestResource != null) { + fieldMap.put( + "projectsEnableXpnResourceRequestResource", + Collections.singletonList(String.valueOf(projectsEnableXpnResourceRequestResource))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("projectsEnableXpnResourceRequestResource")) { - return projectsEnableXpnResourceRequestResource; + return String.valueOf(projectsEnableXpnResourceRequestResource); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public ProjectsEnableXpnResourceRequest getApiMessageRequestBody() { return projectsEnableXpnResourceRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java index d725f174c601..b75652abd576 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private Error(List errors) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("errors")) { - return errors; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("errors") && errors != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Errors item : errors) { + stringList.add(item.toString()); + } + fieldMap.put("errors", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("errors")) { + return String.valueOf(errors); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java index 2c492e0b4846..4a8dc4f78995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -42,15 +46,30 @@ private Errors(String code, String location, String message) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("location") && location != null) { + fieldMap.put("location", Collections.singletonList(String.valueOf(location))); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("code")) { - return code; + return String.valueOf(code); } if (fieldName.equals("location")) { - return location; + return String.valueOf(location); } if (fieldName.equals("message")) { - return message; + return String.valueOf(message); } return null; } @@ -61,12 +80,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCode() { return code; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java index e0d913f58a59..5ce3c75029fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private ExpandIpCidrRangeSubnetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("subnetworksExpandIpCidrRangeRequestResource") + && subnetworksExpandIpCidrRangeRequestResource != null) { + fieldMap.put( + "subnetworksExpandIpCidrRangeRequestResource", + Collections.singletonList(String.valueOf(subnetworksExpandIpCidrRangeRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("subnetworksExpandIpCidrRangeRequestResource")) { - return subnetworksExpandIpCidrRangeRequestResource; + return String.valueOf(subnetworksExpandIpCidrRangeRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public SubnetworksExpandIpCidrRangeRequest getApiMessageRequestBody() { return subnetworksExpandIpCidrRangeRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java index 752346813ce1..016bb754a7a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -102,57 +107,147 @@ private Firewall( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("allowed") && allowed != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Allowed item : allowed) { + stringList.add(item.toString()); + } + fieldMap.put("allowed", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("denied") && denied != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Denied item : denied) { + stringList.add(item.toString()); + } + fieldMap.put("denied", stringList.build()); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("destinationRanges") && destinationRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : destinationRanges) { + stringList.add(item.toString()); + } + fieldMap.put("destinationRanges", stringList.build()); + } + if (fieldNames.contains("direction") && direction != null) { + fieldMap.put("direction", Collections.singletonList(String.valueOf(direction))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("priority") && priority != null) { + fieldMap.put("priority", Collections.singletonList(String.valueOf(priority))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sourceRanges") && sourceRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sourceRanges) { + stringList.add(item.toString()); + } + fieldMap.put("sourceRanges", stringList.build()); + } + if (fieldNames.contains("sourceServiceAccounts") && sourceServiceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sourceServiceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("sourceServiceAccounts", stringList.build()); + } + if (fieldNames.contains("sourceTags") && sourceTags != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sourceTags) { + stringList.add(item.toString()); + } + fieldMap.put("sourceTags", stringList.build()); + } + if (fieldNames.contains("targetServiceAccounts") && targetServiceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetServiceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("targetServiceAccounts", stringList.build()); + } + if (fieldNames.contains("targetTags") && targetTags != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetTags) { + stringList.add(item.toString()); + } + fieldMap.put("targetTags", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("allowed")) { - return allowed; + return String.valueOf(allowed); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("denied")) { - return denied; + return String.valueOf(denied); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("destinationRanges")) { - return destinationRanges; + return String.valueOf(destinationRanges); } if (fieldName.equals("direction")) { - return direction; + return String.valueOf(direction); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("priority")) { - return priority; + return String.valueOf(priority); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sourceRanges")) { - return sourceRanges; + return String.valueOf(sourceRanges); } if (fieldName.equals("sourceServiceAccounts")) { - return sourceServiceAccounts; + return String.valueOf(sourceServiceAccounts); } if (fieldName.equals("sourceTags")) { - return sourceTags; + return String.valueOf(sourceTags); } if (fieldName.equals("targetServiceAccounts")) { - return targetServiceAccounts; + return String.valueOf(targetServiceAccounts); } if (fieldName.equals("targetTags")) { - return targetTags; + return String.valueOf(targetTags); } return null; } @@ -163,12 +258,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getAllowedList() { return allowed; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java index f21ec79e0701..e89c70bc0bad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private FirewallList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Firewall item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java index e098464b0dde..1acc4698d122 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -102,57 +107,120 @@ private ForwardingRule( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("iPAddress") && iPAddress != null) { + fieldMap.put("iPAddress", Collections.singletonList(String.valueOf(iPAddress))); + } + if (fieldNames.contains("iPProtocol") && iPProtocol != null) { + fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("ipVersion") && ipVersion != null) { + fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) { + fieldMap.put( + "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("portRange") && portRange != null) { + fieldMap.put("portRange", Collections.singletonList(String.valueOf(portRange))); + } + if (fieldNames.contains("ports") && ports != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : ports) { + stringList.add(item.toString()); + } + fieldMap.put("ports", stringList.build()); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("iPAddress")) { - return iPAddress; + return String.valueOf(iPAddress); } if (fieldName.equals("iPProtocol")) { - return iPProtocol; + return String.valueOf(iPProtocol); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("ipVersion")) { - return ipVersion; + return String.valueOf(ipVersion); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("loadBalancingScheme")) { - return loadBalancingScheme; + return String.valueOf(loadBalancingScheme); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("portRange")) { - return portRange; + return String.valueOf(portRange); } if (fieldName.equals("ports")) { - return ports; + return String.valueOf(ports); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("target")) { - return target; + return String.valueOf(target); } return null; } @@ -163,12 +231,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getBackendService() { return backendService; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java index 1f25d325df24..55a82726164a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private ForwardingRuleAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java index a7d25a79118b..f33b52c9b425 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private ForwardingRuleList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ForwardingRule item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java index 66aa34626498..4202d67f4da6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private ForwardingRulesScopedList(List forwardingRules, Warning } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("forwardingRules")) { - return forwardingRules; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("forwardingRules") && forwardingRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ForwardingRule item : forwardingRules) { + stringList.add(item.toString()); + } + fieldMap.put("forwardingRules", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("forwardingRules")) { + return String.valueOf(forwardingRules); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java index 861c64ea1405..7ab02b6274bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetAcceleratorTypeHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("acceleratorType") && acceleratorType != null) { + fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("acceleratorType")) { - return acceleratorType; + return String.valueOf(acceleratorType); } if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAcceleratorType() { return acceleratorType; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java index 73e1b8de267c..ca2a1a1e5e4e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetAddressHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("address")) { - return address; + return String.valueOf(address); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java index 6dce224ca63f..c2f3d68b5372 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java index cf2e28002930..34d156febed3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetBackendBucketHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucket") && backendBucket != null) { + fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendBucket")) { - return backendBucket; + return String.valueOf(backendBucket); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java index 8d8ca9cbe9b4..9341bbee372b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java index 3ed0f637b373..6ad9763c7b67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetDiskHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("disk")) { - return disk; + return String.valueOf(disk); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java index dc59d19540bb..ae90dd62b439 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetDiskTypeHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskType") && diskType != null) { + fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("diskType")) { - return diskType; + return String.valueOf(diskType); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java index f7941097b523..7c2ef0032da2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetFirewallHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("firewall")) { - return firewall; + return String.valueOf(firewall); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java index 72a30fbc8dda..56699ab4db3a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRule")) { - return forwardingRule; + return String.valueOf(forwardingRule); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java index cd3168370454..77c615dbaa89 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetFromFamilyImageHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("family") && family != null) { + fieldMap.put("family", Collections.singletonList(String.valueOf(family))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("family")) { - return family; + return String.valueOf(family); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java index 9939700d0fdf..aca1109f15d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetGlobalAddressHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("address")) { - return address; + return String.valueOf(address); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java index 499754896dc9..3859ea6d568b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetGlobalForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRule")) { - return forwardingRule; + return String.valueOf(forwardingRule); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java index d324b7e0b662..671ec05feb62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetGlobalOperationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("operation")) { - return operation; + return String.valueOf(operation); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java index de74c613666a..fbebc8ba2fbb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private GetHealthBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resourceGroupReferenceResource") + && resourceGroupReferenceResource != null) { + fieldMap.put( + "resourceGroupReferenceResource", + Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("resourceGroupReferenceResource")) { - return resourceGroupReferenceResource; + return String.valueOf(resourceGroupReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public ResourceGroupReference getApiMessageRequestBody() { return resourceGroupReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java index f03de6e68a7a..cc1198822080 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("healthCheck")) { - return healthCheck; + return String.valueOf(healthCheck); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java index d2411b7e6995..7a65116d9166 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private GetHealthRegionBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resourceGroupReferenceResource") + && resourceGroupReferenceResource != null) { + fieldMap.put( + "resourceGroupReferenceResource", + Collections.singletonList(String.valueOf(resourceGroupReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("resourceGroupReferenceResource")) { - return resourceGroupReferenceResource; + return String.valueOf(resourceGroupReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public ResourceGroupReference getApiMessageRequestBody() { return resourceGroupReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java index 80adbde9767e..37fc9330ce5e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,68 @@ private GetHealthTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceReferenceResource") && instanceReferenceResource != null) { + fieldMap.put( + "instanceReferenceResource", + Collections.singletonList(String.valueOf(instanceReferenceResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceReferenceResource")) { - return instanceReferenceResource; + return String.valueOf(instanceReferenceResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +145,6 @@ public InstanceReference getApiMessageRequestBody() { return instanceReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java index f15e79e68f9f..56e4c1dfdf72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetHttpHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpHealthCheck")) { - return httpHealthCheck; + return String.valueOf(httpHealthCheck); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java index 0df43e72848f..2c552dcad757 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetHttpsHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpsHealthCheck")) { - return httpsHealthCheck; + return String.valueOf(httpsHealthCheck); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java index 159c4c597af0..3d3bde96e1be 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetImageHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("image") && image != null) { + fieldMap.put("image", Collections.singletonList(String.valueOf(image))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("image")) { - return image; + return String.valueOf(image); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java index a3ea3a0b3819..4c13c2749ca6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java index 1ec4366a7463..5b8e5d2a6c08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,61 @@ private GetInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +134,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java index 40609939618e..be3a9305efae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java index 6a605d45dd6d..f6fac3c4c386 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetInstanceTemplateHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceTemplate")) { - return instanceTemplate; + return String.valueOf(instanceTemplate); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java index 6b32b78e607c..18b251663554 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,62 @@ private GetInterconnectAttachmentHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) { + fieldMap.put( + "interconnectAttachment", + Collections.singletonList(String.valueOf(interconnectAttachment))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnectAttachment")) { - return interconnectAttachment; + return String.valueOf(interconnectAttachment); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +135,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java index 2c8ec025066d..40467ffc4fa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetInterconnectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnect") && interconnect != null) { + fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnect")) { - return interconnect; + return String.valueOf(interconnect); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java index 5c4f2c3d6990..d60b56dc3d3b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,61 @@ private GetInterconnectLocationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectLocation") && interconnectLocation != null) { + fieldMap.put( + "interconnectLocation", Collections.singletonList(String.valueOf(interconnectLocation))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnectLocation")) { - return interconnectLocation; + return String.valueOf(interconnectLocation); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +134,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java index 34e074261a60..5cb7a6f14f2e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetLicenseCodeHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("licenseCode") && licenseCode != null) { + fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("licenseCode")) { - return licenseCode; + return String.valueOf(licenseCode); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java index cb6cddb8ab7c..af7142f32723 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetLicenseHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("license") && license != null) { + fieldMap.put("license", Collections.singletonList(String.valueOf(license))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("license")) { - return license; + return String.valueOf(license); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java index 5af4426b2ed9..751b2506dead 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetMachineTypeHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("machineType")) { - return machineType; + return String.valueOf(machineType); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java index 6dbe5865035a..4aa9fe8fd792 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java index ea0958bef2a4..f7aff07b6c3b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java index a7a2a7ab473c..2a9ea9bae395 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRegionAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java index 32dc24e1172b..69e9f7e76887 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRegionBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java index 4e5eb300c90d..0a9f807f127f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRegionCommitmentHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("commitment") && commitment != null) { + fieldMap.put("commitment", Collections.singletonList(String.valueOf(commitment))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("commitment")) { - return commitment; + return String.valueOf(commitment); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java index e6a53479cce3..88050280800a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRegionHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java index bd32752142b1..7ff9e320f782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRegionInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java index d53a58c42f46..212d7e16382d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,61 @@ private GetRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +134,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java index 9354e73dc6c3..e5bbdf3b129b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRegionOperationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("operation")) { - return operation; + return String.valueOf(operation); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java index 91f70cc51d78..52f9b6cb4342 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRouteHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("route") && route != null) { + fieldMap.put("route", Collections.singletonList(String.valueOf(route))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("route")) { - return route; + return String.valueOf(route); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java index 2da040ec96e3..0ce4cd7991a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java index b359cd4020be..161f201fe023 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetRouterStatusRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java index 9ee831ed202b..887cf3504e42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private GetSerialPortOutputInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("start") && start != null) { + fieldMap.put("start", Collections.singletonList(String.valueOf(start))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("port")) { - return port; + return String.valueOf(port); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("start")) { - return start; + return String.valueOf(start); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java index 5b0822171072..712e57a23357 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetSnapshotHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("snapshot") && snapshot != null) { + fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("snapshot")) { - return snapshot; + return String.valueOf(snapshot); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java index f5e8b0c99aa7..6a891e246f99 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetSslCertificateHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sslCertificate") && sslCertificate != null) { + fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("sslCertificate")) { - return sslCertificate; + return String.valueOf(sslCertificate); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java index 6e7dd8c3f033..d08405a2fbce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetSslPolicyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("sslPolicy")) { - return sslPolicy; + return String.valueOf(sslPolicy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java index 32037a6780d0..6ef53c597515 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetSubnetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java index e62b679f239b..1bbe06ba5a44 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetHttpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { + fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetHttpProxy")) { - return targetHttpProxy; + return String.valueOf(targetHttpProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java index 501ec52d64b2..44582e4c58e9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetHttpsProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetHttpsProxy")) { - return targetHttpsProxy; + return String.valueOf(targetHttpsProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java index 9ef98bb1b6d3..89e81f5d6846 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetInstance") && targetInstance != null) { + fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetInstance")) { - return targetInstance; + return String.valueOf(targetInstance); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java index 1b37944d89f9..7f75ff18a016 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java index 547104a99a25..5f5b29916400 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetSslProxy")) { - return targetSslProxy; + return String.valueOf(targetSslProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java index add3781e55d5..3f83752b1fd6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetTcpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { + fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetTcpProxy")) { - return targetTcpProxy; + return String.valueOf(targetTcpProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java index b37f4baf5e50..a198980dc3cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetTargetVpnGatewayHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { + fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("targetVpnGateway")) { - return targetVpnGateway; + return String.valueOf(targetVpnGateway); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java index af52761d6aa8..a81d5bea67ca 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java index ed991eda312e..cd1792e0e4b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetVpnTunnelHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) { + fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("vpnTunnel")) { - return vpnTunnel; + return String.valueOf(vpnTunnel); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java index f163158b66f4..c36a0d8a2d34 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetXpnHostProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java index b053e307ed0c..049f445bd406 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private GetXpnResourcesProjectsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java index 3232d136a0d3..602b07ab97e2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetZoneHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java index bd5fd02a5146..d2f32e90abf6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,60 @@ private GetZoneOperationHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("operation") && operation != null) { + fieldMap.put("operation", Collections.singletonList(String.valueOf(operation))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("operation")) { - return operation; + return String.valueOf(operation); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -99,12 +133,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java index 3c1184f61e5f..dc6bf9e24a7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +43,31 @@ private GlobalSetLabelsRequest(String labelFingerprint, Map labe } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); } - if (fieldName.equals("labels")) { - return labels; + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java index 22ec52f78ce5..081a717689cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private GuestOsFeature(String type) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("type")) { - return type; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("type")) { + return String.valueOf(type); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java index e148ed0d123c..5ed8c553fd67 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,8 +33,8 @@ public final class HealthCheck implements ApiMessage { private final String creationTimestamp; private final String description; private final Integer healthyThreshold; - private final HTTPHealthCheck httpHealthCheck; - private final HTTPSHealthCheck httpsHealthCheck; + private final HttpHealthCheck httpHealthCheck; + private final HttpSHealthCheck httpsHealthCheck; private final String id; private final String kind; private final String name; @@ -64,8 +68,8 @@ private HealthCheck( String creationTimestamp, String description, Integer healthyThreshold, - HTTPHealthCheck httpHealthCheck, - HTTPSHealthCheck httpsHealthCheck, + HttpHealthCheck httpHealthCheck, + HttpSHealthCheck httpsHealthCheck, String id, String kind, String name, @@ -93,51 +97,104 @@ private HealthCheck( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sslHealthCheck") && sslHealthCheck != null) { + fieldMap.put("sslHealthCheck", Collections.singletonList(String.valueOf(sslHealthCheck))); + } + if (fieldNames.contains("tcpHealthCheck") && tcpHealthCheck != null) { + fieldMap.put("tcpHealthCheck", Collections.singletonList(String.valueOf(tcpHealthCheck))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("checkIntervalSec")) { - return checkIntervalSec; + return String.valueOf(checkIntervalSec); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("healthyThreshold")) { - return healthyThreshold; + return String.valueOf(healthyThreshold); } if (fieldName.equals("httpHealthCheck")) { - return httpHealthCheck; + return String.valueOf(httpHealthCheck); } if (fieldName.equals("httpsHealthCheck")) { - return httpsHealthCheck; + return String.valueOf(httpsHealthCheck); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sslHealthCheck")) { - return sslHealthCheck; + return String.valueOf(sslHealthCheck); } if (fieldName.equals("tcpHealthCheck")) { - return tcpHealthCheck; + return String.valueOf(tcpHealthCheck); } if (fieldName.equals("timeoutSec")) { - return timeoutSec; + return String.valueOf(timeoutSec); } if (fieldName.equals("type")) { - return type; + return String.valueOf(type); } if (fieldName.equals("unhealthyThreshold")) { - return unhealthyThreshold; + return String.valueOf(unhealthyThreshold); } return null; } @@ -148,12 +205,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Integer getCheckIntervalSec() { return checkIntervalSec; } @@ -170,11 +221,11 @@ public Integer getHealthyThreshold() { return healthyThreshold; } - public HTTPHealthCheck getHttpHealthCheck() { + public HttpHealthCheck getHttpHealthCheck() { return httpHealthCheck; } - public HTTPSHealthCheck getHttpsHealthCheck() { + public HttpSHealthCheck getHttpsHealthCheck() { return httpsHealthCheck; } @@ -241,8 +292,8 @@ public static class Builder { private String creationTimestamp; private String description; private Integer healthyThreshold; - private HTTPHealthCheck httpHealthCheck; - private HTTPSHealthCheck httpsHealthCheck; + private HttpHealthCheck httpHealthCheck; + private HttpSHealthCheck httpsHealthCheck; private String id; private String kind; private String name; @@ -359,20 +410,20 @@ public Builder setHealthyThreshold(Integer healthyThreshold) { return this; } - public HTTPHealthCheck getHttpHealthCheck() { + public HttpHealthCheck getHttpHealthCheck() { return httpHealthCheck; } - public Builder setHttpHealthCheck(HTTPHealthCheck httpHealthCheck) { + public Builder setHttpHealthCheck(HttpHealthCheck httpHealthCheck) { this.httpHealthCheck = httpHealthCheck; return this; } - public HTTPSHealthCheck getHttpsHealthCheck() { + public HttpSHealthCheck getHttpsHealthCheck() { return httpsHealthCheck; } - public Builder setHttpsHealthCheck(HTTPSHealthCheck httpsHealthCheck) { + public Builder setHttpsHealthCheck(HttpSHealthCheck httpsHealthCheck) { this.httpsHealthCheck = httpsHealthCheck; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java index aaab7be4b2a1..c65a4b4bde8a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private HealthCheckList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthCheck item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java index a32982dbe395..fb7cd5b85d53 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private HealthCheckReference(String healthCheck) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("healthCheck")) { - return healthCheck; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthCheck")) { + return String.valueOf(healthCheck); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java index b70aabb2e31e..b31d9a53e69a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,18 +49,36 @@ private HealthStatus(String healthState, String instance, String ipAddress, Inte } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthState") && healthState != null) { + fieldMap.put("healthState", Collections.singletonList(String.valueOf(healthState))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("ipAddress") && ipAddress != null) { + fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("healthState")) { - return healthState; + return String.valueOf(healthState); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("ipAddress")) { - return ipAddress; + return String.valueOf(ipAddress); } if (fieldName.equals("port")) { - return port; + return String.valueOf(port); } return null; } @@ -67,12 +89,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getHealthState() { return healthState; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java index 42e8e9b62bb0..7e814efe1324 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +48,34 @@ private HostRule(String description, List hosts, String pathMatcher) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("hosts") && hosts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : hosts) { + stringList.add(item.toString()); + } + fieldMap.put("hosts", stringList.build()); + } + if (fieldNames.contains("pathMatcher") && pathMatcher != null) { + fieldMap.put("pathMatcher", Collections.singletonList(String.valueOf(pathMatcher))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("hosts")) { - return hosts; + return String.valueOf(hosts); } if (fieldName.equals("pathMatcher")) { - return pathMatcher; + return String.valueOf(pathMatcher); } return null; } @@ -62,12 +86,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getDescription() { return description; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java index e6a729b134d7..cc37dbe6a9a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java @@ -17,113 +17,78 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @Generated("by GAPIC") @BetaApi public final class HttpHealthCheck implements ApiMessage { - private final Integer checkIntervalSec; - private final String creationTimestamp; - private final String description; - private final Integer healthyThreshold; private final String host; - private final String id; - private final String kind; - private final String name; private final Integer port; + private final String portName; + private final String proxyHeader; private final String requestPath; - private final String selfLink; - private final Integer timeoutSec; - private final Integer unhealthyThreshold; private HttpHealthCheck() { - this.checkIntervalSec = null; - this.creationTimestamp = null; - this.description = null; - this.healthyThreshold = null; this.host = null; - this.id = null; - this.kind = null; - this.name = null; this.port = null; + this.portName = null; + this.proxyHeader = null; this.requestPath = null; - this.selfLink = null; - this.timeoutSec = null; - this.unhealthyThreshold = null; } private HttpHealthCheck( - Integer checkIntervalSec, - String creationTimestamp, - String description, - Integer healthyThreshold, - String host, - String id, - String kind, - String name, - Integer port, - String requestPath, - String selfLink, - Integer timeoutSec, - Integer unhealthyThreshold) { - this.checkIntervalSec = checkIntervalSec; - this.creationTimestamp = creationTimestamp; - this.description = description; - this.healthyThreshold = healthyThreshold; + String host, Integer port, String portName, String proxyHeader, String requestPath) { this.host = host; - this.id = id; - this.kind = kind; - this.name = name; this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; this.requestPath = requestPath; - this.selfLink = selfLink; - this.timeoutSec = timeoutSec; - this.unhealthyThreshold = unhealthyThreshold; } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("checkIntervalSec")) { - return checkIntervalSec; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); } - if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); } - if (fieldName.equals("description")) { - return description; + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); } - if (fieldName.equals("healthyThreshold")) { - return healthyThreshold; + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); } - if (fieldName.equals("host")) { - return host; - } - if (fieldName.equals("id")) { - return id; - } - if (fieldName.equals("kind")) { - return kind; + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); } - if (fieldName.equals("name")) { - return name; + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); } if (fieldName.equals("port")) { - return port; + return String.valueOf(port); } - if (fieldName.equals("requestPath")) { - return requestPath; + if (fieldName.equals("portName")) { + return String.valueOf(portName); } - if (fieldName.equals("selfLink")) { - return selfLink; + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); } - if (fieldName.equals("timeoutSec")) { - return timeoutSec; - } - if (fieldName.equals("unhealthyThreshold")) { - return unhealthyThreshold; + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); } return null; } @@ -134,62 +99,24 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public String getDescription() { - return description; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - public String getHost() { return host; } - public String getId() { - return id; - } - - public String getKind() { - return kind; - } - - public String getName() { - return name; - } - public Integer getPort() { return port; } - public String getRequestPath() { - return requestPath; - } - - public String getSelfLink() { - return selfLink; + public String getPortName() { + return portName; } - public Integer getTimeoutSec() { - return timeoutSec; + public String getProxyHeader() { + return proxyHeader; } - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; + public String getRequestPath() { + return requestPath; } public static Builder newBuilder() { @@ -215,116 +142,40 @@ public static HttpHealthCheck getDefaultInstance() { } public static class Builder { - private Integer checkIntervalSec; - private String creationTimestamp; - private String description; - private Integer healthyThreshold; private String host; - private String id; - private String kind; - private String name; private Integer port; + private String portName; + private String proxyHeader; private String requestPath; - private String selfLink; - private Integer timeoutSec; - private Integer unhealthyThreshold; Builder() {} public Builder mergeFrom(HttpHealthCheck other) { if (other == HttpHealthCheck.getDefaultInstance()) return this; - if (other.getCheckIntervalSec() != null) { - this.checkIntervalSec = other.checkIntervalSec; - } - if (other.getCreationTimestamp() != null) { - this.creationTimestamp = other.creationTimestamp; - } - if (other.getDescription() != null) { - this.description = other.description; - } - if (other.getHealthyThreshold() != null) { - this.healthyThreshold = other.healthyThreshold; - } if (other.getHost() != null) { this.host = other.host; } - if (other.getId() != null) { - this.id = other.id; - } - if (other.getKind() != null) { - this.kind = other.kind; - } - if (other.getName() != null) { - this.name = other.name; - } if (other.getPort() != null) { this.port = other.port; } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - if (other.getSelfLink() != null) { - this.selfLink = other.selfLink; + if (other.getPortName() != null) { + this.portName = other.portName; } - if (other.getTimeoutSec() != null) { - this.timeoutSec = other.timeoutSec; + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; } - if (other.getUnhealthyThreshold() != null) { - this.unhealthyThreshold = other.unhealthyThreshold; + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; } return this; } Builder(HttpHealthCheck source) { - this.checkIntervalSec = source.checkIntervalSec; - this.creationTimestamp = source.creationTimestamp; - this.description = source.description; - this.healthyThreshold = source.healthyThreshold; this.host = source.host; - this.id = source.id; - this.kind = source.kind; - this.name = source.name; this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; this.requestPath = source.requestPath; - this.selfLink = source.selfLink; - this.timeoutSec = source.timeoutSec; - this.unhealthyThreshold = source.unhealthyThreshold; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public Builder setCheckIntervalSec(Integer checkIntervalSec) { - this.checkIntervalSec = checkIntervalSec; - return this; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public Builder setCreationTimestamp(String creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - public String getDescription() { - return description; - } - - public Builder setDescription(String description) { - this.description = description; - return this; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public Builder setHealthyThreshold(Integer healthyThreshold) { - this.healthyThreshold = healthyThreshold; - return this; } public String getHost() { @@ -336,33 +187,6 @@ public Builder setHost(String host) { return this; } - public String getId() { - return id; - } - - public Builder setId(String id) { - this.id = id; - return this; - } - - public String getKind() { - return kind; - } - - public Builder setKind(String kind) { - this.kind = kind; - return this; - } - - public String getName() { - return name; - } - - public Builder setName(String name) { - this.name = name; - return this; - } - public Integer getPort() { return port; } @@ -372,75 +196,45 @@ public Builder setPort(Integer port) { return this; } - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public String getSelfLink() { - return selfLink; + public String getPortName() { + return portName; } - public Builder setSelfLink(String selfLink) { - this.selfLink = selfLink; + public Builder setPortName(String portName) { + this.portName = portName; return this; } - public Integer getTimeoutSec() { - return timeoutSec; + public String getProxyHeader() { + return proxyHeader; } - public Builder setTimeoutSec(Integer timeoutSec) { - this.timeoutSec = timeoutSec; + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; return this; } - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; + public String getRequestPath() { + return requestPath; } - public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { - this.unhealthyThreshold = unhealthyThreshold; + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; return this; } public HttpHealthCheck build() { - return new HttpHealthCheck( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); + return new HttpHealthCheck(host, port, portName, proxyHeader, requestPath); } public Builder clone() { Builder newBuilder = new Builder(); - newBuilder.setCheckIntervalSec(this.checkIntervalSec); - newBuilder.setCreationTimestamp(this.creationTimestamp); - newBuilder.setDescription(this.description); - newBuilder.setHealthyThreshold(this.healthyThreshold); newBuilder.setHost(this.host); - newBuilder.setId(this.id); - newBuilder.setKind(this.kind); - newBuilder.setName(this.name); newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); newBuilder.setRequestPath(this.requestPath); - newBuilder.setSelfLink(this.selfLink); - newBuilder.setTimeoutSec(this.timeoutSec); - newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); return newBuilder; } } @@ -448,44 +242,20 @@ public Builder clone() { @Override public String toString() { return "HttpHealthCheck{" - + "checkIntervalSec=" - + checkIntervalSec - + ", " - + "creationTimestamp=" - + creationTimestamp - + ", " - + "description=" - + description - + ", " - + "healthyThreshold=" - + healthyThreshold - + ", " + "host=" + host + ", " - + "id=" - + id - + ", " - + "kind=" - + kind - + ", " - + "name=" - + name - + ", " + "port=" + port + ", " - + "requestPath=" - + requestPath - + ", " - + "selfLink=" - + selfLink + + "portName=" + + portName + ", " - + "timeoutSec=" - + timeoutSec + + "proxyHeader=" + + proxyHeader + ", " - + "unhealthyThreshold=" - + unhealthyThreshold + + "requestPath=" + + requestPath + "}"; } @@ -496,38 +266,17 @@ public boolean equals(Object o) { } if (o instanceof HttpHealthCheck) { HttpHealthCheck that = (HttpHealthCheck) o; - return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) - && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) - && Objects.equals(this.description, that.getDescription()) - && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) - && Objects.equals(this.host, that.getHost()) - && Objects.equals(this.id, that.getId()) - && Objects.equals(this.kind, that.getKind()) - && Objects.equals(this.name, that.getName()) + return Objects.equals(this.host, that.getHost()) && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.requestPath, that.getRequestPath()) - && Objects.equals(this.selfLink, that.getSelfLink()) - && Objects.equals(this.timeoutSec, that.getTimeoutSec()) - && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.requestPath, that.getRequestPath()); } return false; } @Override public int hashCode() { - return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); + return Objects.hash(host, port, portName, proxyHeader, requestPath); } } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java new file mode 100644 index 000000000000..21ef5d6e7db1 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java @@ -0,0 +1,578 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpHealthCheck2 implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; + private final String host; + private final String id; + private final String kind; + private final String name; + private final Integer port; + private final String requestPath; + private final String selfLink; + private final Integer timeoutSec; + private final Integer unhealthyThreshold; + + private HttpHealthCheck2() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; + this.host = null; + this.id = null; + this.kind = null; + this.name = null; + this.port = null; + this.requestPath = null; + this.selfLink = null; + this.timeoutSec = null; + this.unhealthyThreshold = null; + } + + private HttpHealthCheck2( + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + String host, + String id, + String kind, + String name, + Integer port, + String requestPath, + String selfLink, + Integer timeoutSec, + Integer unhealthyThreshold) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; + this.host = host; + this.id = id; + this.kind = kind; + this.name = name; + this.port = port; + this.requestPath = requestPath; + this.selfLink = selfLink; + this.timeoutSec = timeoutSec; + this.unhealthyThreshold = unhealthyThreshold; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return String.valueOf(checkIntervalSec); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("healthyThreshold")) { + return String.valueOf(healthyThreshold); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + if (fieldName.equals("unhealthyThreshold")) { + return String.valueOf(unhealthyThreshold); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public String getHost() { + return host; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + public String getRequestPath() { + return requestPath; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HttpHealthCheck2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpHealthCheck2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final HttpHealthCheck2 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new HttpHealthCheck2(); + } + + public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; + private String host; + private String id; + private String kind; + private String name; + private Integer port; + private String requestPath; + private String selfLink; + private Integer timeoutSec; + private Integer unhealthyThreshold; + + Builder() {} + + public Builder mergeFrom(HttpHealthCheck2 other) { + if (other == HttpHealthCheck2.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } + return this; + } + + Builder(HttpHealthCheck2 source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; + this.host = source.host; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.port = source.port; + this.requestPath = source.requestPath; + this.selfLink = source.selfLink; + this.timeoutSec = source.timeoutSec; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + public HttpHealthCheck2 build() { + + return new HttpHealthCheck2( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); + newBuilder.setHost(this.host); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + newBuilder.setRequestPath(this.requestPath); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpHealthCheck2{" + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + + "host=" + + host + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "port=" + + port + + ", " + + "requestPath=" + + requestPath + + ", " + + "selfLink=" + + selfLink + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpHealthCheck2) { + HttpHealthCheck2 that = (HttpHealthCheck2) o; + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.requestPath, that.getRequestPath()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java index ce01ba82022e..17068313afb3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -291,7 +291,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
+   *   HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
    * }
    * 
* @@ -299,7 +299,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck( + public final HttpHealthCheck2 getHttpHealthCheck( ProjectGlobalHttpHealthCheckName httpHealthCheck) { GetHttpHealthCheckHttpRequest request = @@ -319,7 +319,7 @@ public final HttpHealthCheck getHttpHealthCheck( *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
+   *   HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
    * }
    * 
* @@ -327,7 +327,7 @@ public final HttpHealthCheck getHttpHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { + public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) { GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder().setHttpHealthCheck(httpHealthCheck).build(); @@ -347,7 +347,7 @@ public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { * GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() * .setHttpHealthCheck(httpHealthCheck.toString()) * .build(); - * HttpHealthCheck response = httpHealthCheckClient.getHttpHealthCheck(request); + * HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(request); * } *
* @@ -355,7 +355,7 @@ public final HttpHealthCheck getHttpHealthCheck(String httpHealthCheck) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { + public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest request) { return getHttpHealthCheckCallable().call(request); } @@ -372,14 +372,14 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re * GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder() * .setHttpHealthCheck(httpHealthCheck.toString()) * .build(); - * ApiFuture<HttpHealthCheck> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request); + * ApiFuture<HttpHealthCheck2> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request); * // Do something - * HttpHealthCheck response = future.get(); + * HttpHealthCheck2 response = future.get(); * } *
*/ @BetaApi - public final UnaryCallable + public final UnaryCallable getHttpHealthCheckCallable() { return stub.getHttpHealthCheckCallable(); } @@ -395,7 +395,7 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); * } *
@@ -416,7 +416,7 @@ public final HttpHealthCheck getHttpHealthCheck(GetHttpHealthCheckHttpRequest re */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, ProjectName project, HttpHealthCheck httpHealthCheckResource) { + String requestId, ProjectName project, HttpHealthCheck2 httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Operation insertHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project.toString(), httpHealthCheckResource); * } *
@@ -459,7 +459,7 @@ public final Operation insertHttpHealthCheck( */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, String project, HttpHealthCheck httpHealthCheckResource) { + String requestId, String project, HttpHealthCheck2 httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() @@ -481,7 +481,7 @@ public final Operation insertHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -510,7 +510,7 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -537,7 +537,7 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
+   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -564,7 +564,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
+   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -592,7 +592,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(String proje
    *   ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   for (HttpHealthCheck element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
+   *   for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -621,7 +621,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *     .build();
    *   ApiFuture<ListHttpHealthChecksPagedResponse> future = httpHealthCheckClient.listHttpHealthChecksPagedCallable().futureCall(request);
    *   // Do something
-   *   for (HttpHealthCheck element : future.get().iterateAll()) {
+   *   for (HttpHealthCheck2 element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -647,7 +647,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *     .build();
    *   while (true) {
    *     HttpHealthCheckList response = httpHealthCheckClient.listHttpHealthChecksCallable().call(request);
-   *     for (HttpHealthCheck element : response.getItemsList()) {
+   *     for (HttpHealthCheck2 element : response.getItemsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -678,7 +678,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
    *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build();
+   *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
    * }
    * 
@@ -701,7 +701,7 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks( public final Operation patchHttpHealthCheck( String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck httpHealthCheckResource) { + HttpHealthCheck2 httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() @@ -724,7 +724,7 @@ public final Operation patchHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource); * } *
@@ -745,7 +745,7 @@ public final Operation patchHttpHealthCheck( */ @BetaApi public final Operation patchHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() @@ -768,7 +768,7 @@ public final Operation patchHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -798,7 +798,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -827,7 +827,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); * } *
@@ -850,7 +850,7 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ public final Operation updateHttpHealthCheck( String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck httpHealthCheckResource) { + HttpHealthCheck2 httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() @@ -872,7 +872,7 @@ public final Operation updateHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource); * } *
@@ -893,7 +893,7 @@ public final Operation updateHttpHealthCheck( */ @BetaApi public final Operation updateHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck httpHealthCheckResource) { + String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() @@ -915,7 +915,7 @@ public final Operation updateHttpHealthCheck( * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -944,7 +944,7 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) { * String requestId = ""; * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - * HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + * HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); * UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setHttpHealthCheck(httpHealthCheck.toString()) @@ -994,11 +994,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListHttpHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext context, + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListHttpHealthChecksPage.createEmptyPage().createPageAsync(context, futureResponse); @@ -1019,11 +1019,11 @@ private ListHttpHealthChecksPagedResponse(ListHttpHealthChecksPage page) { public static class ListHttpHealthChecksPage extends AbstractPage< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, ListHttpHealthChecksPage> { private ListHttpHealthChecksPage( - PageContext context, + PageContext context, HttpHealthCheckList response) { super(context, response); } @@ -1034,14 +1034,14 @@ private static ListHttpHealthChecksPage createEmptyPage() { @Override protected ListHttpHealthChecksPage createPage( - PageContext context, + PageContext context, HttpHealthCheckList response) { return new ListHttpHealthChecksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1049,7 +1049,7 @@ public ApiFuture createPageAsync( public static class ListHttpHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck, + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2, ListHttpHealthChecksPage, ListHttpHealthChecksFixedSizeCollection> { private ListHttpHealthChecksFixedSizeCollection( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java index a0b57481a409..41c505c42162 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +32,7 @@ @BetaApi public final class HttpHealthCheckList implements ApiMessage { private final String id; - private final List items; + private final List items; private final String kind; private final String nextPageToken; private final String selfLink; @@ -44,7 +49,7 @@ private HttpHealthCheckList() { private HttpHealthCheckList( String id, - List items, + List items, String kind, String nextPageToken, String selfLink, @@ -58,24 +63,52 @@ private HttpHealthCheckList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HttpHealthCheck2 item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,17 +119,11 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } - public List getItemsList() { + public List getItemsList() { return items; } @@ -140,7 +167,7 @@ public static HttpHealthCheckList getDefaultInstance() { public static class Builder { private String id; - private List items; + private List items; private String kind; private String nextPageToken; private String selfLink; @@ -189,11 +216,11 @@ public Builder setId(String id) { return this; } - public List getItemsList() { + public List getItemsList() { return items; } - public Builder addAllItems(List items) { + public Builder addAllItems(List items) { if (this.items == null) { this.items = new ArrayList<>(items.size()); } @@ -201,7 +228,7 @@ public Builder addAllItems(List items) { return this; } - public Builder addItems(HttpHealthCheck items) { + public Builder addItems(HttpHealthCheck2 items) { this.items.add(items); return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java index 404c07cf503f..889c5a7a07db 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java @@ -70,7 +70,7 @@ public class HttpHealthCheckSettings extends ClientSettings + public UnaryCallSettings getHttpHealthCheckSettings() { return ((HttpHealthCheckStubSettings) getStubSettings()).getHttpHealthCheckSettings(); } @@ -209,7 +209,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { return getStubSettingsBuilder().getHttpHealthCheckSettings(); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java new file mode 100644 index 000000000000..d50cb331244c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java @@ -0,0 +1,282 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpSHealthCheck implements ApiMessage { + private final String host; + private final Integer port; + private final String portName; + private final String proxyHeader; + private final String requestPath; + + private HttpSHealthCheck() { + this.host = null; + this.port = null; + this.portName = null; + this.proxyHeader = null; + this.requestPath = null; + } + + private HttpSHealthCheck( + String host, Integer port, String portName, String proxyHeader, String requestPath) { + this.host = host; + this.port = port; + this.portName = portName; + this.proxyHeader = proxyHeader; + this.requestPath = requestPath; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getHost() { + return host; + } + + public Integer getPort() { + return port; + } + + public String getPortName() { + return portName; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public String getRequestPath() { + return requestPath; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HttpSHealthCheck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpSHealthCheck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final HttpSHealthCheck DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new HttpSHealthCheck(); + } + + public static class Builder { + private String host; + private Integer port; + private String portName; + private String proxyHeader; + private String requestPath; + + Builder() {} + + public Builder mergeFrom(HttpSHealthCheck other) { + if (other == HttpSHealthCheck.getDefaultInstance()) return this; + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getPortName() != null) { + this.portName = other.portName; + } + if (other.getProxyHeader() != null) { + this.proxyHeader = other.proxyHeader; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + return this; + } + + Builder(HttpSHealthCheck source) { + this.host = source.host; + this.port = source.port; + this.portName = source.portName; + this.proxyHeader = source.proxyHeader; + this.requestPath = source.requestPath; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getPortName() { + return portName; + } + + public Builder setPortName(String portName) { + this.portName = portName; + return this; + } + + public String getProxyHeader() { + return proxyHeader; + } + + public Builder setProxyHeader(String proxyHeader) { + this.proxyHeader = proxyHeader; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public HttpSHealthCheck build() { + + return new HttpSHealthCheck(host, port, portName, proxyHeader, requestPath); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setHost(this.host); + newBuilder.setPort(this.port); + newBuilder.setPortName(this.portName); + newBuilder.setProxyHeader(this.proxyHeader); + newBuilder.setRequestPath(this.requestPath); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpSHealthCheck{" + + "host=" + + host + + ", " + + "port=" + + port + + ", " + + "portName=" + + portName + + ", " + + "proxyHeader=" + + proxyHeader + + ", " + + "requestPath=" + + requestPath + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpSHealthCheck) { + HttpSHealthCheck that = (HttpSHealthCheck) o; + return Objects.equals(this.host, that.getHost()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.portName, that.getPortName()) + && Objects.equals(this.proxyHeader, that.getProxyHeader()) + && Objects.equals(this.requestPath, that.getRequestPath()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(host, port, portName, proxyHeader, requestPath); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java new file mode 100644 index 000000000000..4523dfd5f2db --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java @@ -0,0 +1,578 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class HttpsHealthCheck2 implements ApiMessage { + private final Integer checkIntervalSec; + private final String creationTimestamp; + private final String description; + private final Integer healthyThreshold; + private final String host; + private final String id; + private final String kind; + private final String name; + private final Integer port; + private final String requestPath; + private final String selfLink; + private final Integer timeoutSec; + private final Integer unhealthyThreshold; + + private HttpsHealthCheck2() { + this.checkIntervalSec = null; + this.creationTimestamp = null; + this.description = null; + this.healthyThreshold = null; + this.host = null; + this.id = null; + this.kind = null; + this.name = null; + this.port = null; + this.requestPath = null; + this.selfLink = null; + this.timeoutSec = null; + this.unhealthyThreshold = null; + } + + private HttpsHealthCheck2( + Integer checkIntervalSec, + String creationTimestamp, + String description, + Integer healthyThreshold, + String host, + String id, + String kind, + String name, + Integer port, + String requestPath, + String selfLink, + Integer timeoutSec, + Integer unhealthyThreshold) { + this.checkIntervalSec = checkIntervalSec; + this.creationTimestamp = creationTimestamp; + this.description = description; + this.healthyThreshold = healthyThreshold; + this.host = host; + this.id = id; + this.kind = kind; + this.name = name; + this.port = port; + this.requestPath = requestPath; + this.selfLink = selfLink; + this.timeoutSec = timeoutSec; + this.unhealthyThreshold = unhealthyThreshold; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) { + fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) { + fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("requestPath") && requestPath != null) { + fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("timeoutSec") && timeoutSec != null) { + fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec))); + } + if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) { + fieldMap.put( + "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("checkIntervalSec")) { + return String.valueOf(checkIntervalSec); + } + if (fieldName.equals("creationTimestamp")) { + return String.valueOf(creationTimestamp); + } + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("healthyThreshold")) { + return String.valueOf(healthyThreshold); + } + if (fieldName.equals("host")) { + return String.valueOf(host); + } + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } + if (fieldName.equals("requestPath")) { + return String.valueOf(requestPath); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("timeoutSec")) { + return String.valueOf(timeoutSec); + } + if (fieldName.equals("unhealthyThreshold")) { + return String.valueOf(unhealthyThreshold); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public String getHost() { + return host; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public Integer getPort() { + return port; + } + + public String getRequestPath() { + return requestPath; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HttpsHealthCheck2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static HttpsHealthCheck2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final HttpsHealthCheck2 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new HttpsHealthCheck2(); + } + + public static class Builder { + private Integer checkIntervalSec; + private String creationTimestamp; + private String description; + private Integer healthyThreshold; + private String host; + private String id; + private String kind; + private String name; + private Integer port; + private String requestPath; + private String selfLink; + private Integer timeoutSec; + private Integer unhealthyThreshold; + + Builder() {} + + public Builder mergeFrom(HttpsHealthCheck2 other) { + if (other == HttpsHealthCheck2.getDefaultInstance()) return this; + if (other.getCheckIntervalSec() != null) { + this.checkIntervalSec = other.checkIntervalSec; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getHealthyThreshold() != null) { + this.healthyThreshold = other.healthyThreshold; + } + if (other.getHost() != null) { + this.host = other.host; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getPort() != null) { + this.port = other.port; + } + if (other.getRequestPath() != null) { + this.requestPath = other.requestPath; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getTimeoutSec() != null) { + this.timeoutSec = other.timeoutSec; + } + if (other.getUnhealthyThreshold() != null) { + this.unhealthyThreshold = other.unhealthyThreshold; + } + return this; + } + + Builder(HttpsHealthCheck2 source) { + this.checkIntervalSec = source.checkIntervalSec; + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.healthyThreshold = source.healthyThreshold; + this.host = source.host; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.port = source.port; + this.requestPath = source.requestPath; + this.selfLink = source.selfLink; + this.timeoutSec = source.timeoutSec; + this.unhealthyThreshold = source.unhealthyThreshold; + } + + public Integer getCheckIntervalSec() { + return checkIntervalSec; + } + + public Builder setCheckIntervalSec(Integer checkIntervalSec) { + this.checkIntervalSec = checkIntervalSec; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getHealthyThreshold() { + return healthyThreshold; + } + + public Builder setHealthyThreshold(Integer healthyThreshold) { + this.healthyThreshold = healthyThreshold; + return this; + } + + public String getHost() { + return host; + } + + public Builder setHost(String host) { + this.host = host; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Integer getPort() { + return port; + } + + public Builder setPort(Integer port) { + this.port = port; + return this; + } + + public String getRequestPath() { + return requestPath; + } + + public Builder setRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getTimeoutSec() { + return timeoutSec; + } + + public Builder setTimeoutSec(Integer timeoutSec) { + this.timeoutSec = timeoutSec; + return this; + } + + public Integer getUnhealthyThreshold() { + return unhealthyThreshold; + } + + public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + public HttpsHealthCheck2 build() { + + return new HttpsHealthCheck2( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCheckIntervalSec(this.checkIntervalSec); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setHealthyThreshold(this.healthyThreshold); + newBuilder.setHost(this.host); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setPort(this.port); + newBuilder.setRequestPath(this.requestPath); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setTimeoutSec(this.timeoutSec); + newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); + return newBuilder; + } + } + + @Override + public String toString() { + return "HttpsHealthCheck2{" + + "checkIntervalSec=" + + checkIntervalSec + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "healthyThreshold=" + + healthyThreshold + + ", " + + "host=" + + host + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "port=" + + port + + ", " + + "requestPath=" + + requestPath + + ", " + + "selfLink=" + + selfLink + + ", " + + "timeoutSec=" + + timeoutSec + + ", " + + "unhealthyThreshold=" + + unhealthyThreshold + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof HttpsHealthCheck2) { + HttpsHealthCheck2 that = (HttpsHealthCheck2) o; + return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) + && Objects.equals(this.host, that.getHost()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.port, that.getPort()) + && Objects.equals(this.requestPath, that.getRequestPath()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.timeoutSec, that.getTimeoutSec()) + && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + checkIntervalSec, + creationTimestamp, + description, + healthyThreshold, + host, + id, + kind, + name, + port, + requestPath, + selfLink, + timeoutSec, + unhealthyThreshold); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java index d5e5a485c9e2..c8e4e440b1cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -291,7 +291,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
+   *   HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
    * }
    * 
* @@ -299,7 +299,7 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck( + public final HttpsHealthCheck2 getHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = @@ -319,7 +319,7 @@ public final HttpsHealthCheck getHttpsHealthCheck( *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
+   *   HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
    * }
    * 
* @@ -327,7 +327,7 @@ public final HttpsHealthCheck getHttpsHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { + public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) { GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder().setHttpsHealthCheck(httpsHealthCheck).build(); @@ -347,7 +347,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { * GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .build(); - * HttpsHealthCheck response = httpsHealthCheckClient.getHttpsHealthCheck(request); + * HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(request); * } *
* @@ -355,7 +355,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(String httpsHealthCheck) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { + public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request) { return getHttpsHealthCheckCallable().call(request); } @@ -372,14 +372,14 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest * GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .build(); - * ApiFuture<HttpsHealthCheck> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request); + * ApiFuture<HttpsHealthCheck2> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request); * // Do something - * HttpsHealthCheck response = future.get(); + * HttpsHealthCheck2 response = future.get(); * } *
*/ @BetaApi - public final UnaryCallable + public final UnaryCallable getHttpsHealthCheckCallable() { return stub.getHttpsHealthCheckCallable(); } @@ -395,7 +395,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); * } *
@@ -416,7 +416,7 @@ public final HttpsHealthCheck getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, ProjectName project, HttpsHealthCheck httpsHealthCheckResource) { + String requestId, ProjectName project, HttpsHealthCheck2 httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() @@ -438,7 +438,7 @@ public final Operation insertHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project.toString(), httpsHealthCheckResource); * } *
@@ -459,7 +459,7 @@ public final Operation insertHttpsHealthCheck( */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, String project, HttpsHealthCheck httpsHealthCheckResource) { + String requestId, String project, HttpsHealthCheck2 httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() @@ -481,7 +481,7 @@ public final Operation insertHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -510,7 +510,7 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * String requestId = ""; * ProjectName project = ProjectName.of("[PROJECT]"); - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() * .setRequestId(requestId) * .setProject(project.toString()) @@ -537,7 +537,7 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
+   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -564,7 +564,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectNam
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
+   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -592,7 +592,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String pro
    *   ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
    *     .setProject(project.toString())
    *     .build();
-   *   for (HttpsHealthCheck element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
+   *   for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -621,7 +621,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    *     .build();
    *   ApiFuture<ListHttpsHealthChecksPagedResponse> future = httpsHealthCheckClient.listHttpsHealthChecksPagedCallable().futureCall(request);
    *   // Do something
-   *   for (HttpsHealthCheck element : future.get().iterateAll()) {
+   *   for (HttpsHealthCheck2 element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -647,7 +647,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    *     .build();
    *   while (true) {
    *     HttpsHealthCheckList response = httpsHealthCheckClient.listHttpsHealthChecksCallable().call(request);
-   *     for (HttpsHealthCheck element : response.getItemsList()) {
+   *     for (HttpsHealthCheck2 element : response.getItemsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -678,7 +678,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
    *   String requestId = "";
-   *   HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build();
+   *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
    * }
    * 
@@ -701,7 +701,7 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks( public final Operation patchHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId, - HttpsHealthCheck httpsHealthCheckResource) { + HttpsHealthCheck2 httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() @@ -724,7 +724,7 @@ public final Operation patchHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource); * } *
@@ -745,7 +745,7 @@ public final Operation patchHttpsHealthCheck( */ @BetaApi public final Operation patchHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() @@ -768,7 +768,7 @@ public final Operation patchHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -798,7 +798,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -827,7 +827,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); * } *
@@ -850,7 +850,7 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re public final Operation updateHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId, - HttpsHealthCheck httpsHealthCheckResource) { + HttpsHealthCheck2 httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() @@ -872,7 +872,7 @@ public final Operation updateHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource); * } *
@@ -893,7 +893,7 @@ public final Operation updateHttpsHealthCheck( */ @BetaApi public final Operation updateHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck httpsHealthCheckResource) { + String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() @@ -915,7 +915,7 @@ public final Operation updateHttpsHealthCheck( * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -944,7 +944,7 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); * String requestId = ""; - * HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + * HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); * UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() * .setHttpsHealthCheck(httpsHealthCheck.toString()) * .setRequestId(requestId) @@ -994,11 +994,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListHttpsHealthChecksPagedResponse extends AbstractPagedListResponse< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { public static ApiFuture createAsync( - PageContext + PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = @@ -1020,11 +1020,11 @@ private ListHttpsHealthChecksPagedResponse(ListHttpsHealthChecksPage page) { public static class ListHttpsHealthChecksPage extends AbstractPage< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, ListHttpsHealthChecksPage> { private ListHttpsHealthChecksPage( - PageContext + PageContext context, HttpsHealthCheckList response) { super(context, response); @@ -1036,7 +1036,7 @@ private static ListHttpsHealthChecksPage createEmptyPage() { @Override protected ListHttpsHealthChecksPage createPage( - PageContext + PageContext context, HttpsHealthCheckList response) { return new ListHttpsHealthChecksPage(context, response); @@ -1044,7 +1044,7 @@ protected ListHttpsHealthChecksPage createPage( @Override public ApiFuture createPageAsync( - PageContext + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); @@ -1053,7 +1053,7 @@ public ApiFuture createPageAsync( public static class ListHttpsHealthChecksFixedSizeCollection extends AbstractFixedSizeCollection< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck, + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2, ListHttpsHealthChecksPage, ListHttpsHealthChecksFixedSizeCollection> { private ListHttpsHealthChecksFixedSizeCollection( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java index c81b3173ec5e..f238d2e334c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +32,7 @@ @BetaApi public final class HttpsHealthCheckList implements ApiMessage { private final String id; - private final List items; + private final List items; private final String kind; private final String nextPageToken; private final String selfLink; @@ -44,7 +49,7 @@ private HttpsHealthCheckList() { private HttpsHealthCheckList( String id, - List items, + List items, String kind, String nextPageToken, String selfLink, @@ -58,24 +63,52 @@ private HttpsHealthCheckList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HttpsHealthCheck2 item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,17 +119,11 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } - public List getItemsList() { + public List getItemsList() { return items; } @@ -140,7 +167,7 @@ public static HttpsHealthCheckList getDefaultInstance() { public static class Builder { private String id; - private List items; + private List items; private String kind; private String nextPageToken; private String selfLink; @@ -189,11 +216,11 @@ public Builder setId(String id) { return this; } - public List getItemsList() { + public List getItemsList() { return items; } - public Builder addAllItems(List items) { + public Builder addAllItems(List items) { if (this.items == null) { this.items = new ArrayList<>(items.size()); } @@ -201,7 +228,7 @@ public Builder addAllItems(List items) { return this; } - public Builder addItems(HttpsHealthCheck items) { + public Builder addItems(HttpsHealthCheck2 items) { this.items.add(items); return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java index 072f37085c38..485682fea0f3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java @@ -70,7 +70,7 @@ public class HttpsHealthCheckSettings extends ClientSettings + public UnaryCallSettings getHttpsHealthCheckSettings() { return ((HttpsHealthCheckStubSettings) getStubSettings()).getHttpsHealthCheckSettings(); } @@ -210,7 +210,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { return getStubSettingsBuilder().getHttpsHealthCheckSettings(); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java index 293e38cf15ea..12d4d8d3e135 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java @@ -17,10 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -147,90 +151,200 @@ private Image( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("archiveSizeBytes") && archiveSizeBytes != null) { + fieldMap.put("archiveSizeBytes", Collections.singletonList(String.valueOf(archiveSizeBytes))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { + fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); + } + if (fieldNames.contains("family") && family != null) { + fieldMap.put("family", Collections.singletonList(String.valueOf(family))); + } + if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (GuestOsFeature item : guestOsFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("guestOsFeatures", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("imageEncryptionKey") && imageEncryptionKey != null) { + fieldMap.put( + "imageEncryptionKey", Collections.singletonList(String.valueOf(imageEncryptionKey))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + if (fieldNames.contains("licenseCodes") && licenseCodes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenseCodes) { + stringList.add(item.toString()); + } + fieldMap.put("licenseCodes", stringList.build()); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("rawDisk") && rawDisk != null) { + fieldMap.put("rawDisk", Collections.singletonList(String.valueOf(rawDisk))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sourceDisk") && sourceDisk != null) { + fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); + } + if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { + fieldMap.put( + "sourceDiskEncryptionKey", + Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); + } + if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { + fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { + fieldMap.put( + "sourceImageEncryptionKey", + Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); + } + if (fieldNames.contains("sourceImageId") && sourceImageId != null) { + fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId))); + } + if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) { + fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot))); + } + if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) { + fieldMap.put( + "sourceSnapshotEncryptionKey", + Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey))); + } + if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) { + fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId))); + } + if (fieldNames.contains("sourceType") && sourceType != null) { + fieldMap.put("sourceType", Collections.singletonList(String.valueOf(sourceType))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("archiveSizeBytes")) { - return archiveSizeBytes; + return String.valueOf(archiveSizeBytes); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("diskSizeGb")) { - return diskSizeGb; + return String.valueOf(diskSizeGb); } if (fieldName.equals("family")) { - return family; + return String.valueOf(family); } if (fieldName.equals("guestOsFeatures")) { - return guestOsFeatures; + return String.valueOf(guestOsFeatures); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("imageEncryptionKey")) { - return imageEncryptionKey; + return String.valueOf(imageEncryptionKey); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + return String.valueOf(labelFingerprint); } if (fieldName.equals("labels")) { - return labels; + return String.valueOf(labels); } if (fieldName.equals("licenseCodes")) { - return licenseCodes; + return String.valueOf(licenseCodes); } if (fieldName.equals("licenses")) { - return licenses; + return String.valueOf(licenses); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("rawDisk")) { - return rawDisk; + return String.valueOf(rawDisk); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sourceDisk")) { - return sourceDisk; + return String.valueOf(sourceDisk); } if (fieldName.equals("sourceDiskEncryptionKey")) { - return sourceDiskEncryptionKey; + return String.valueOf(sourceDiskEncryptionKey); } if (fieldName.equals("sourceDiskId")) { - return sourceDiskId; + return String.valueOf(sourceDiskId); } if (fieldName.equals("sourceImage")) { - return sourceImage; + return String.valueOf(sourceImage); } if (fieldName.equals("sourceImageEncryptionKey")) { - return sourceImageEncryptionKey; + return String.valueOf(sourceImageEncryptionKey); } if (fieldName.equals("sourceImageId")) { - return sourceImageId; + return String.valueOf(sourceImageId); } if (fieldName.equals("sourceSnapshot")) { - return sourceSnapshot; + return String.valueOf(sourceSnapshot); } if (fieldName.equals("sourceSnapshotEncryptionKey")) { - return sourceSnapshotEncryptionKey; + return String.valueOf(sourceSnapshotEncryptionKey); } if (fieldName.equals("sourceSnapshotId")) { - return sourceSnapshotId; + return String.valueOf(sourceSnapshotId); } if (fieldName.equals("sourceType")) { - return sourceType; + return String.valueOf(sourceType); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } return null; } @@ -241,12 +355,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getArchiveSizeBytes() { return archiveSizeBytes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java index db11170a78d4..8fa51eaa64e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private ImageList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Image item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java index 44854ff6fb49..ea752693f8d2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertAddressHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("addressResource") && addressResource != null) { + fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("addressResource")) { - return addressResource; + return String.valueOf(addressResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Address getApiMessageRequestBody() { return addressResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java index 3d82ab72a020..6a96da87124d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscalerResource")) { - return autoscalerResource; + return String.valueOf(autoscalerResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -113,12 +154,6 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java index f2416257483e..42c4e361e50b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertBackendBucketHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { + fieldMap.put( + "backendBucketResource", + Collections.singletonList(String.valueOf(backendBucketResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendBucketResource")) { - return backendBucketResource; + return String.valueOf(backendBucketResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public BackendBucket getApiMessageRequestBody() { return backendBucketResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java index 7bdaa1185c4f..42fcd7be40a2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendServiceResource")) { - return backendServiceResource; + return String.valueOf(backendServiceResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java index aa60ae6b958c..3b1b60e75f6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,78 @@ private InsertDiskHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskResource") && diskResource != null) { + fieldMap.put("diskResource", Collections.singletonList(String.valueOf(diskResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("diskResource")) { - return diskResource; + return String.valueOf(diskResource); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sourceImage")) { - return sourceImage; + return String.valueOf(sourceImage); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -120,12 +163,6 @@ public Disk getApiMessageRequestBody() { return diskResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java index b3894dc14e7d..83dc075807f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertFirewallHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewallResource") && firewallResource != null) { + fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("firewallResource")) { - return firewallResource; + return String.valueOf(firewallResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Firewall getApiMessageRequestBody() { return firewallResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java index 5ac102ea2b9d..b19b538ab343 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { + fieldMap.put( + "forwardingRuleResource", + Collections.singletonList(String.valueOf(forwardingRuleResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRuleResource")) { - return forwardingRuleResource; + return String.valueOf(forwardingRuleResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public ForwardingRule getApiMessageRequestBody() { return forwardingRuleResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java index 8494ba87d2b7..eabad11cacd9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertGlobalAddressHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("addressResource") && addressResource != null) { + fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("addressResource")) { - return addressResource; + return String.valueOf(addressResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Address getApiMessageRequestBody() { return addressResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java index ffc889f6a054..88c75c705ec6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertGlobalForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) { + fieldMap.put( + "forwardingRuleResource", + Collections.singletonList(String.valueOf(forwardingRuleResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRuleResource")) { - return forwardingRuleResource; + return String.valueOf(forwardingRuleResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public ForwardingRule getApiMessageRequestBody() { return forwardingRuleResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java index e49d8f2d47b7..54634df42917 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { + fieldMap.put( + "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("healthCheckResource")) { - return healthCheckResource; + return String.valueOf(healthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public HealthCheck getApiMessageRequestBody() { return healthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java index 7b58d9e476a4..2d8878494a2e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -28,7 +32,7 @@ public final class InsertHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; - private final HttpHealthCheck httpHealthCheckResource; + private final HttpHealthCheck2 httpHealthCheckResource; private final String key; private final String prettyPrint; private final String project; @@ -53,7 +57,7 @@ private InsertHttpHealthCheckHttpRequest( String access_token, String callback, String fields, - HttpHealthCheck httpHealthCheckResource, + HttpHealthCheck2 httpHealthCheckResource, String key, String prettyPrint, String project, @@ -73,52 +77,84 @@ private InsertHttpHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { + fieldMap.put( + "httpHealthCheckResource", + Collections.singletonList(String.valueOf(httpHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpHealthCheckResource")) { - return httpHealthCheckResource; + return String.valueOf(httpHealthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @Nullable @Override - public HttpHealthCheck getApiMessageRequestBody() { + public HttpHealthCheck2 getApiMessageRequestBody() { return httpHealthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } @@ -131,7 +167,7 @@ public String getFields() { return fields; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -185,7 +221,7 @@ public static class Builder { private String access_token; private String callback; private String fields; - private HttpHealthCheck httpHealthCheckResource; + private HttpHealthCheck2 httpHealthCheckResource; private String key; private String prettyPrint; private String project; @@ -270,11 +306,11 @@ public Builder setFields(String fields) { return this; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java index bee0afdfa890..5be147a7e9ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -28,7 +32,7 @@ public final class InsertHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; private final String fields; - private final HttpsHealthCheck httpsHealthCheckResource; + private final HttpsHealthCheck2 httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String project; @@ -53,7 +57,7 @@ private InsertHttpsHealthCheckHttpRequest( String access_token, String callback, String fields, - HttpsHealthCheck httpsHealthCheckResource, + HttpsHealthCheck2 httpsHealthCheckResource, String key, String prettyPrint, String project, @@ -73,52 +77,84 @@ private InsertHttpsHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { + fieldMap.put( + "httpsHealthCheckResource", + Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpsHealthCheckResource")) { - return httpsHealthCheckResource; + return String.valueOf(httpsHealthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @Nullable @Override - public HttpsHealthCheck getApiMessageRequestBody() { + public HttpsHealthCheck2 getApiMessageRequestBody() { return httpsHealthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } @@ -131,7 +167,7 @@ public String getFields() { return fields; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -185,7 +221,7 @@ public static class Builder { private String access_token; private String callback; private String fields; - private HttpsHealthCheck httpsHealthCheckResource; + private HttpsHealthCheck2 httpsHealthCheckResource; private String key; private String prettyPrint; private String project; @@ -270,11 +306,11 @@ public Builder setFields(String fields) { return this; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java index fc5fe51b948b..85e548a840ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,78 @@ private InsertImageHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forceCreate") && forceCreate != null) { + fieldMap.put("forceCreate", Collections.singletonList(String.valueOf(forceCreate))); + } + if (fieldNames.contains("imageResource") && imageResource != null) { + fieldMap.put("imageResource", Collections.singletonList(String.valueOf(imageResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forceCreate")) { - return forceCreate; + return String.valueOf(forceCreate); } if (fieldName.equals("imageResource")) { - return imageResource; + return String.valueOf(imageResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +163,6 @@ public Image getApiMessageRequestBody() { return imageResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java index 31d5d8febca0..e164d6cae1b2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupResource") && instanceGroupResource != null) { + fieldMap.put( + "instanceGroupResource", + Collections.singletonList(String.valueOf(instanceGroupResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupResource")) { - return instanceGroupResource; + return String.valueOf(instanceGroupResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -113,12 +155,6 @@ public InstanceGroup getApiMessageRequestBody() { return instanceGroupResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java index 869aeaa40d7d..57a03d1b5920 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private InsertInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManagerResource") + && instanceGroupManagerResource != null) { + fieldMap.put( + "instanceGroupManagerResource", + Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManagerResource")) { - return instanceGroupManagerResource; + return String.valueOf(instanceGroupManagerResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -113,12 +156,6 @@ public InstanceGroupManager getApiMessageRequestBody() { return instanceGroupManagerResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java index 0a110a065c7e..fcff5ddf431b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,80 @@ private InsertInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceResource") && instanceResource != null) { + fieldMap.put("instanceResource", Collections.singletonList(String.valueOf(instanceResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sourceInstanceTemplate") && sourceInstanceTemplate != null) { + fieldMap.put( + "sourceInstanceTemplate", + Collections.singletonList(String.valueOf(sourceInstanceTemplate))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceResource")) { - return instanceResource; + return String.valueOf(instanceResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sourceInstanceTemplate")) { - return sourceInstanceTemplate; + return String.valueOf(sourceInstanceTemplate); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -120,12 +165,6 @@ public Instance getApiMessageRequestBody() { return instanceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java index 950f30b9ee45..f63f92b4f8ad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertInstanceTemplateHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceTemplateResource") && instanceTemplateResource != null) { + fieldMap.put( + "instanceTemplateResource", + Collections.singletonList(String.valueOf(instanceTemplateResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceTemplateResource")) { - return instanceTemplateResource; + return String.valueOf(instanceTemplateResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public InstanceTemplate getApiMessageRequestBody() { return instanceTemplateResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java index 8a3e6df68c91..a8ac39739e70 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private InsertInterconnectAttachmentHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectAttachmentResource") + && interconnectAttachmentResource != null) { + fieldMap.put( + "interconnectAttachmentResource", + Collections.singletonList(String.valueOf(interconnectAttachmentResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnectAttachmentResource")) { - return interconnectAttachmentResource; + return String.valueOf(interconnectAttachmentResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InterconnectAttachment getApiMessageRequestBody() { return interconnectAttachmentResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java index 9402cf686fc4..9ddb8551c356 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertInterconnectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnectResource") && interconnectResource != null) { + fieldMap.put( + "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnectResource")) { - return interconnectResource; + return String.valueOf(interconnectResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public Interconnect getApiMessageRequestBody() { return interconnectResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java index 577888b8f703..fe43d76ababc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertLicenseHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("licenseResource") && licenseResource != null) { + fieldMap.put("licenseResource", Collections.singletonList(String.valueOf(licenseResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("licenseResource")) { - return licenseResource; + return String.valueOf(licenseResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public License getApiMessageRequestBody() { return licenseResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java index 1c765b0db7a5..c3f9aa063165 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkResource") && networkResource != null) { + fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("networkResource")) { - return networkResource; + return String.valueOf(networkResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Network getApiMessageRequestBody() { return networkResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java index 6f68a3783cb2..596244b18249 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertRegionAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscalerResource")) { - return autoscalerResource; + return String.valueOf(autoscalerResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java index f85f6024141f..99e8a70e4722 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertRegionBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendServiceResource")) { - return backendServiceResource; + return String.valueOf(backendServiceResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java index b2ac2c51f6a6..b20ba9542536 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertRegionCommitmentHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("commitmentResource") && commitmentResource != null) { + fieldMap.put( + "commitmentResource", Collections.singletonList(String.valueOf(commitmentResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("commitmentResource")) { - return commitmentResource; + return String.valueOf(commitmentResource); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public Commitment getApiMessageRequestBody() { return commitmentResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java index 7e4b4df953c9..7f446083c85b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private InsertRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManagerResource") + && instanceGroupManagerResource != null) { + fieldMap.put( + "instanceGroupManagerResource", + Collections.singletonList(String.valueOf(instanceGroupManagerResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManagerResource")) { - return instanceGroupManagerResource; + return String.valueOf(instanceGroupManagerResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstanceGroupManager getApiMessageRequestBody() { return instanceGroupManagerResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java index ef13fefe5651..15c2d58f3f02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertRouteHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("routeResource") && routeResource != null) { + fieldMap.put("routeResource", Collections.singletonList(String.valueOf(routeResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("routeResource")) { - return routeResource; + return String.valueOf(routeResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Route getApiMessageRequestBody() { return routeResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java index 73648b655089..9224aaeac65e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("routerResource")) { - return routerResource; + return String.valueOf(routerResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Router getApiMessageRequestBody() { return routerResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java index 6eaf2ac78ddb..d24619b7bdc8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertSslCertificateHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslCertificateResource") && sslCertificateResource != null) { + fieldMap.put( + "sslCertificateResource", + Collections.singletonList(String.valueOf(sslCertificateResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslCertificateResource")) { - return sslCertificateResource; + return String.valueOf(sslCertificateResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public SslCertificate getApiMessageRequestBody() { return sslCertificateResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java index 1bb69f83736c..dedc433cbc2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertSslPolicyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) { + fieldMap.put( + "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslPolicyResource")) { - return sslPolicyResource; + return String.valueOf(sslPolicyResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public SslPolicy getApiMessageRequestBody() { return sslPolicyResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java index 2db72649e1a8..98bec8e85e85 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertSubnetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { + fieldMap.put( + "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("subnetworkResource")) { - return subnetworkResource; + return String.valueOf(subnetworkResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public Subnetwork getApiMessageRequestBody() { return subnetworkResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java index 0954f10a7667..f001e2403a26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertTargetHttpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpProxyResource") && targetHttpProxyResource != null) { + fieldMap.put( + "targetHttpProxyResource", + Collections.singletonList(String.valueOf(targetHttpProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpProxyResource")) { - return targetHttpProxyResource; + return String.valueOf(targetHttpProxyResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetHttpProxy getApiMessageRequestBody() { return targetHttpProxyResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java index af8b42abc271..2e357705b953 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertTargetHttpsProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpsProxyResource") && targetHttpsProxyResource != null) { + fieldMap.put( + "targetHttpsProxyResource", + Collections.singletonList(String.valueOf(targetHttpsProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpsProxyResource")) { - return targetHttpsProxyResource; + return String.valueOf(targetHttpsProxyResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetHttpsProxy getApiMessageRequestBody() { return targetHttpsProxyResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java index c6b44391a95e..bfaa6abf741b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertTargetInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetInstanceResource") && targetInstanceResource != null) { + fieldMap.put( + "targetInstanceResource", + Collections.singletonList(String.valueOf(targetInstanceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetInstanceResource")) { - return targetInstanceResource; + return String.valueOf(targetInstanceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -113,12 +155,6 @@ public TargetInstance getApiMessageRequestBody() { return targetInstanceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java index 42353932d5b9..c42a2c6d5718 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPoolResource") && targetPoolResource != null) { + fieldMap.put( + "targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPoolResource")) { - return targetPoolResource; + return String.valueOf(targetPoolResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public TargetPool getApiMessageRequestBody() { return targetPoolResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java index 8edac35f2e7d..7ca1cfa1fd4d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetSslProxyResource") && targetSslProxyResource != null) { + fieldMap.put( + "targetSslProxyResource", + Collections.singletonList(String.valueOf(targetSslProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetSslProxyResource")) { - return targetSslProxyResource; + return String.valueOf(targetSslProxyResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetSslProxy getApiMessageRequestBody() { return targetSslProxyResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java index c77a843b7fa4..bebf9bf2660e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertTargetTcpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetTcpProxyResource") && targetTcpProxyResource != null) { + fieldMap.put( + "targetTcpProxyResource", + Collections.singletonList(String.valueOf(targetTcpProxyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetTcpProxyResource")) { - return targetTcpProxyResource; + return String.valueOf(targetTcpProxyResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetTcpProxy getApiMessageRequestBody() { return targetTcpProxyResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java index 9ebec84e2861..33eea30cd206 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private InsertTargetVpnGatewayHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetVpnGatewayResource") && targetVpnGatewayResource != null) { + fieldMap.put( + "targetVpnGatewayResource", + Collections.singletonList(String.valueOf(targetVpnGatewayResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetVpnGatewayResource")) { - return targetVpnGatewayResource; + return String.valueOf(targetVpnGatewayResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetVpnGateway getApiMessageRequestBody() { return targetVpnGatewayResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java index 0a4fd9b8895f..f6a4a3a1ac2c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private InsertUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("urlMapResource") && urlMapResource != null) { + fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("urlMapResource")) { - return urlMapResource; + return String.valueOf(urlMapResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public UrlMap getApiMessageRequestBody() { return urlMapResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java index d99f43f1896e..fb7470850b13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private InsertVpnTunnelHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) { + fieldMap.put( + "vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("vpnTunnelResource")) { - return vpnTunnelResource; + return String.valueOf(vpnTunnelResource); } return null; } @@ -113,12 +154,6 @@ public VpnTunnel getApiMessageRequestBody() { return vpnTunnelResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java index 31f30d76b42c..3dae75547c94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java @@ -17,10 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -131,78 +135,174 @@ private Instance( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("canIpForward") && canIpForward != null) { + fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward))); + } + if (fieldNames.contains("cpuPlatform") && cpuPlatform != null) { + fieldMap.put("cpuPlatform", Collections.singletonList(String.valueOf(cpuPlatform))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deletionProtection") && deletionProtection != null) { + fieldMap.put( + "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AttachedDisk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); + } + if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorConfig item : guestAccelerators) { + stringList.add(item.toString()); + } + fieldMap.put("guestAccelerators", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + if (fieldNames.contains("metadata") && metadata != null) { + fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); + } + if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { + fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NetworkInterface item : networkInterfaces) { + stringList.add(item.toString()); + } + fieldMap.put("networkInterfaces", stringList.build()); + } + if (fieldNames.contains("scheduling") && scheduling != null) { + fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ServiceAccount item : serviceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("serviceAccounts", stringList.build()); + } + if (fieldNames.contains("startRestricted") && startRestricted != null) { + fieldMap.put("startRestricted", Collections.singletonList(String.valueOf(startRestricted))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusMessage") && statusMessage != null) { + fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); + } + if (fieldNames.contains("tags") && tags != null) { + fieldMap.put("tags", Collections.singletonList(String.valueOf(tags))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("canIpForward")) { - return canIpForward; + return String.valueOf(canIpForward); } if (fieldName.equals("cpuPlatform")) { - return cpuPlatform; + return String.valueOf(cpuPlatform); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("deletionProtection")) { - return deletionProtection; + return String.valueOf(deletionProtection); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("disks")) { - return disks; + return String.valueOf(disks); } if (fieldName.equals("guestAccelerators")) { - return guestAccelerators; + return String.valueOf(guestAccelerators); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + return String.valueOf(labelFingerprint); } if (fieldName.equals("labels")) { - return labels; + return String.valueOf(labels); } if (fieldName.equals("machineType")) { - return machineType; + return String.valueOf(machineType); } if (fieldName.equals("metadata")) { - return metadata; + return String.valueOf(metadata); } if (fieldName.equals("minCpuPlatform")) { - return minCpuPlatform; + return String.valueOf(minCpuPlatform); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("networkInterfaces")) { - return networkInterfaces; + return String.valueOf(networkInterfaces); } if (fieldName.equals("scheduling")) { - return scheduling; + return String.valueOf(scheduling); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("serviceAccounts")) { - return serviceAccounts; + return String.valueOf(serviceAccounts); } if (fieldName.equals("startRestricted")) { - return startRestricted; + return String.valueOf(startRestricted); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("statusMessage")) { - return statusMessage; + return String.valueOf(statusMessage); } if (fieldName.equals("tags")) { - return tags; + return String.valueOf(tags); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -213,12 +313,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getCanIpForward() { return canIpForward; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java index 520c4fd90d89..876eb432086d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private InstanceAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java index e8d1b23bc558..83954bf65eae 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -86,45 +91,95 @@ private InstanceGroup( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("size") && size != null) { + fieldMap.put("size", Collections.singletonList(String.valueOf(size))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("namedPorts")) { - return namedPorts; + return String.valueOf(namedPorts); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("size")) { - return size; + return String.valueOf(size); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -135,12 +190,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java index ccf256b918a3..e26acc7fa38c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private InstanceGroupAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java index 5d45ba71b0dc..61e7a98c78bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InstanceGroupList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroup item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java index c517a08d25fa..2a5b1234ee97 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -98,54 +103,117 @@ private InstanceGroupManager( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("baseInstanceName") && baseInstanceName != null) { + fieldMap.put("baseInstanceName", Collections.singletonList(String.valueOf(baseInstanceName))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("currentActions") && currentActions != null) { + fieldMap.put("currentActions", Collections.singletonList(String.valueOf(currentActions))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); + } + if (fieldNames.contains("targetSize") && targetSize != null) { + fieldMap.put("targetSize", Collections.singletonList(String.valueOf(targetSize))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("baseInstanceName")) { - return baseInstanceName; + return String.valueOf(baseInstanceName); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("currentActions")) { - return currentActions; + return String.valueOf(currentActions); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("instanceTemplate")) { - return instanceTemplate; + return String.valueOf(instanceTemplate); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("namedPorts")) { - return namedPorts; + return String.valueOf(namedPorts); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("targetPools")) { - return targetPools; + return String.valueOf(targetPools); } if (fieldName.equals("targetSize")) { - return targetSize; + return String.valueOf(targetSize); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -156,12 +224,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getBaseInstanceName() { return baseInstanceName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java index e7dee1d39935..4ffb882381ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,62 @@ private InstanceGroupManagerActionsSummary( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("abandoning") && abandoning != null) { + fieldMap.put("abandoning", Collections.singletonList(String.valueOf(abandoning))); + } + if (fieldNames.contains("creating") && creating != null) { + fieldMap.put("creating", Collections.singletonList(String.valueOf(creating))); + } + if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) { + fieldMap.put( + "creatingWithoutRetries", + Collections.singletonList(String.valueOf(creatingWithoutRetries))); + } + if (fieldNames.contains("deleting") && deleting != null) { + fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting))); + } + if (fieldNames.contains("none") && none != null) { + fieldMap.put("none", Collections.singletonList(String.valueOf(none))); + } + if (fieldNames.contains("recreating") && recreating != null) { + fieldMap.put("recreating", Collections.singletonList(String.valueOf(recreating))); + } + if (fieldNames.contains("refreshing") && refreshing != null) { + fieldMap.put("refreshing", Collections.singletonList(String.valueOf(refreshing))); + } + if (fieldNames.contains("restarting") && restarting != null) { + fieldMap.put("restarting", Collections.singletonList(String.valueOf(restarting))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("abandoning")) { - return abandoning; + return String.valueOf(abandoning); } if (fieldName.equals("creating")) { - return creating; + return String.valueOf(creating); } if (fieldName.equals("creatingWithoutRetries")) { - return creatingWithoutRetries; + return String.valueOf(creatingWithoutRetries); } if (fieldName.equals("deleting")) { - return deleting; + return String.valueOf(deleting); } if (fieldName.equals("none")) { - return none; + return String.valueOf(none); } if (fieldName.equals("recreating")) { - return recreating; + return String.valueOf(recreating); } if (fieldName.equals("refreshing")) { - return refreshing; + return String.valueOf(refreshing); } if (fieldName.equals("restarting")) { - return restarting; + return String.valueOf(restarting); } return null; } @@ -99,12 +135,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Integer getAbandoning() { return abandoning; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java index 3f69694136f6..f6d9303baa32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private InstanceGroupManagerAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java index cf3f5523287f..d2b342712b58 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InstanceGroupManagerList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroupManager item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java index b4b0f1a82ce7..b38c1b293980 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstanceGroupManagersAbandonInstancesRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java index 8b7e1fde5548..c96ff91fdfbc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstanceGroupManagersDeleteInstancesRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java index 56adcdd6f18f..6b0747ba2282 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -38,22 +42,29 @@ private InstanceGroupManagersListManagedInstancesResponse( } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("managedInstances")) { - return managedInstances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("managedInstances") && managedInstances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ManagedInstance item : managedInstances) { + stringList.add(item.toString()); + } + fieldMap.put("managedInstances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("managedInstances")) { + return String.valueOf(managedInstances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java index 26b38255944f..d672f3af897c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstanceGroupManagersRecreateInstancesRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java index 2423d1f5b481..7a09476e60bc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,25 +46,35 @@ private InstanceGroupManagersScopedList( } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instanceGroupManagers")) { - return instanceGroupManagers; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceGroupManagers") && instanceGroupManagers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroupManager item : instanceGroupManagers) { + stringList.add(item.toString()); + } + fieldMap.put("instanceGroupManagers", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceGroupManagers")) { + return String.valueOf(instanceGroupManagers); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java index a5a25c5e287b..6b8d4fdc5c1e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private InstanceGroupManagersSetInstanceTemplateRequest(String instanceTemplate) } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instanceTemplate")) { - return instanceTemplate; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java index b725f6531a08..03c59c8515e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private InstanceGroupManagersSetTargetPoolsRequest(String fingerprint, List> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); } - if (fieldName.equals("targetPools")) { - return targetPools; + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java index 019168d28d14..ba597e29026d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstanceGroupsAddInstancesRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java index f981f564e892..95d0d999162f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InstanceGroupsListInstances( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceWithNamedPorts item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java index 84f5a6944f18..25fe971e58c5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private InstanceGroupsListInstancesRequest(String instanceState) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instanceState")) { - return instanceState; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceState") && instanceState != null) { + fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceState")) { + return String.valueOf(instanceState); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java index 3e5bf339f895..e08eb75e9557 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstanceGroupsRemoveInstancesRequest(List instances) } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java index 88f22ad13a7d..ad9dbc96e281 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private InstanceGroupsScopedList(List instanceGroups, Warning war } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instanceGroups")) { - return instanceGroups; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceGroups") && instanceGroups != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroup item : instanceGroups) { + stringList.add(item.toString()); + } + fieldMap.put("instanceGroups", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceGroups")) { + return String.valueOf(instanceGroups); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java index d5a0eea248dd..7dabe633d62a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private InstanceGroupsSetNamedPortsRequest(String fingerprint, List n } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("fingerprint")) { - return fingerprint; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); } - if (fieldName.equals("namedPorts")) { - return namedPorts; + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java index ce2e48dc6a78..d941f757c9d3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InstanceList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Instance item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java index 28412fdaae8f..5b68399cdcfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InstanceListReferrers( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Reference item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java index 88ff621565a8..9bcd0e989942 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private InstanceMoveRequest(String destinationZone, String targetInstance) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("destinationZone")) { - return destinationZone; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("destinationZone") && destinationZone != null) { + fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone))); } - if (fieldName.equals("targetInstance")) { - return targetInstance; + if (fieldNames.contains("targetInstance") && targetInstance != null) { + fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("destinationZone")) { + return String.valueOf(destinationZone); + } + if (fieldName.equals("targetInstance")) { + return String.valueOf(targetInstance); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java index d03e13b7b481..31bacf16a954 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java @@ -17,10 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -83,42 +87,100 @@ private InstanceProperties( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("canIpForward") && canIpForward != null) { + fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AttachedDisk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); + } + if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorConfig item : guestAccelerators) { + stringList.add(item.toString()); + } + fieldMap.put("guestAccelerators", stringList.build()); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); + } + if (fieldNames.contains("metadata") && metadata != null) { + fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata))); + } + if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { + fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); + } + if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NetworkInterface item : networkInterfaces) { + stringList.add(item.toString()); + } + fieldMap.put("networkInterfaces", stringList.build()); + } + if (fieldNames.contains("scheduling") && scheduling != null) { + fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling))); + } + if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ServiceAccount item : serviceAccounts) { + stringList.add(item.toString()); + } + fieldMap.put("serviceAccounts", stringList.build()); + } + if (fieldNames.contains("tags") && tags != null) { + fieldMap.put("tags", Collections.singletonList(String.valueOf(tags))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("canIpForward")) { - return canIpForward; + return String.valueOf(canIpForward); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("disks")) { - return disks; + return String.valueOf(disks); } if (fieldName.equals("guestAccelerators")) { - return guestAccelerators; + return String.valueOf(guestAccelerators); } if (fieldName.equals("labels")) { - return labels; + return String.valueOf(labels); } if (fieldName.equals("machineType")) { - return machineType; + return String.valueOf(machineType); } if (fieldName.equals("metadata")) { - return metadata; + return String.valueOf(metadata); } if (fieldName.equals("minCpuPlatform")) { - return minCpuPlatform; + return String.valueOf(minCpuPlatform); } if (fieldName.equals("networkInterfaces")) { - return networkInterfaces; + return String.valueOf(networkInterfaces); } if (fieldName.equals("scheduling")) { - return scheduling; + return String.valueOf(scheduling); } if (fieldName.equals("serviceAccounts")) { - return serviceAccounts; + return String.valueOf(serviceAccounts); } if (fieldName.equals("tags")) { - return tags; + return String.valueOf(tags); } return null; } @@ -129,12 +191,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getCanIpForward() { return canIpForward; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java index c535675b686e..a2688b582701 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private InstanceReference(String instance) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instance")) { - return instance; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instance")) { + return String.valueOf(instance); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java index acc02653fe16..0aab1348c662 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,27 +65,55 @@ private InstanceTemplate( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("properties") && properties != null) { + fieldMap.put("properties", Collections.singletonList(String.valueOf(properties))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("properties")) { - return properties; + return String.valueOf(properties); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -92,12 +124,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java index 161856e0997d..978a2165ef68 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InstanceTemplateList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceTemplate item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java index 76f81f42a5dd..d5a2289c923f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +48,34 @@ private InstanceWithNamedPorts(String instance, List namedPorts, Stri } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("namedPorts")) { - return namedPorts; + return String.valueOf(namedPorts); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } return null; } @@ -62,12 +86,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getInstance() { return instance; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java index 44cf666578cb..a90d6ddd0e7f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private InstancesScopedList(List instances, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Instance item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java index 2cc3bef69f5e..8f5854007be7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +43,31 @@ private InstancesSetLabelsRequest(String labelFingerprint, Map l } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); } - if (fieldName.equals("labels")) { - return labels; + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java index c6310a43d417..edc382e08ae0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstancesSetMachineResourcesRequest(List guestAcceler } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("guestAccelerators")) { - return guestAccelerators; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AcceleratorConfig item : guestAccelerators) { + stringList.add(item.toString()); + } + fieldMap.put("guestAccelerators", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("guestAccelerators")) { + return String.valueOf(guestAccelerators); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java index a62184708523..0fafbb310071 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private InstancesSetMachineTypeRequest(String machineType) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("machineType")) { - return machineType; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("machineType") && machineType != null) { + fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("machineType")) { + return String.valueOf(machineType); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java index dc4dc20ceb8e..b8a75edb1d66 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private InstancesSetMinCpuPlatformRequest(String minCpuPlatform) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("minCpuPlatform")) { - return minCpuPlatform; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) { + fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("minCpuPlatform")) { + return String.valueOf(minCpuPlatform); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java index 0df845b9967e..756984e0496c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private InstancesSetServiceAccountRequest(String email, List scopes) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("email")) { - return email; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("email") && email != null) { + fieldMap.put("email", Collections.singletonList(String.valueOf(email))); } - if (fieldName.equals("scopes")) { - return scopes; + if (fieldNames.contains("scopes") && scopes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : scopes) { + stringList.add(item.toString()); + } + fieldMap.put("scopes", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("email")) { + return String.valueOf(email); + } + if (fieldName.equals("scopes")) { + return String.valueOf(scopes); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java index c11e404ccae7..7622b603c226 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private InstancesStartWithEncryptionKeyRequest(List> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("disks") && disks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (CustomerEncryptionKeyProtectedDisk item : disks) { + stringList.add(item.toString()); + } + fieldMap.put("disks", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("disks")) { + return String.valueOf(disks); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java index 089b0939531e..066e1fb0cea4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -118,69 +123,155 @@ private Interconnect( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("adminEnabled") && adminEnabled != null) { + fieldMap.put("adminEnabled", Collections.singletonList(String.valueOf(adminEnabled))); + } + if (fieldNames.contains("circuitInfos") && circuitInfos != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectCircuitInfo item : circuitInfos) { + stringList.add(item.toString()); + } + fieldMap.put("circuitInfos", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("customerName") && customerName != null) { + fieldMap.put("customerName", Collections.singletonList(String.valueOf(customerName))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("expectedOutages") && expectedOutages != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectOutageNotification item : expectedOutages) { + stringList.add(item.toString()); + } + fieldMap.put("expectedOutages", stringList.build()); + } + if (fieldNames.contains("googleIpAddress") && googleIpAddress != null) { + fieldMap.put("googleIpAddress", Collections.singletonList(String.valueOf(googleIpAddress))); + } + if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { + fieldMap.put( + "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : interconnectAttachments) { + stringList.add(item.toString()); + } + fieldMap.put("interconnectAttachments", stringList.build()); + } + if (fieldNames.contains("interconnectType") && interconnectType != null) { + fieldMap.put("interconnectType", Collections.singletonList(String.valueOf(interconnectType))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("linkType") && linkType != null) { + fieldMap.put("linkType", Collections.singletonList(String.valueOf(linkType))); + } + if (fieldNames.contains("location") && location != null) { + fieldMap.put("location", Collections.singletonList(String.valueOf(location))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("nocContactEmail") && nocContactEmail != null) { + fieldMap.put("nocContactEmail", Collections.singletonList(String.valueOf(nocContactEmail))); + } + if (fieldNames.contains("operationalStatus") && operationalStatus != null) { + fieldMap.put( + "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); + } + if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { + fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); + } + if (fieldNames.contains("provisionedLinkCount") && provisionedLinkCount != null) { + fieldMap.put( + "provisionedLinkCount", Collections.singletonList(String.valueOf(provisionedLinkCount))); + } + if (fieldNames.contains("requestedLinkCount") && requestedLinkCount != null) { + fieldMap.put( + "requestedLinkCount", Collections.singletonList(String.valueOf(requestedLinkCount))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("adminEnabled")) { - return adminEnabled; + return String.valueOf(adminEnabled); } if (fieldName.equals("circuitInfos")) { - return circuitInfos; + return String.valueOf(circuitInfos); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("customerName")) { - return customerName; + return String.valueOf(customerName); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("expectedOutages")) { - return expectedOutages; + return String.valueOf(expectedOutages); } if (fieldName.equals("googleIpAddress")) { - return googleIpAddress; + return String.valueOf(googleIpAddress); } if (fieldName.equals("googleReferenceId")) { - return googleReferenceId; + return String.valueOf(googleReferenceId); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("interconnectAttachments")) { - return interconnectAttachments; + return String.valueOf(interconnectAttachments); } if (fieldName.equals("interconnectType")) { - return interconnectType; + return String.valueOf(interconnectType); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("linkType")) { - return linkType; + return String.valueOf(linkType); } if (fieldName.equals("location")) { - return location; + return String.valueOf(location); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("nocContactEmail")) { - return nocContactEmail; + return String.valueOf(nocContactEmail); } if (fieldName.equals("operationalStatus")) { - return operationalStatus; + return String.valueOf(operationalStatus); } if (fieldName.equals("peerIpAddress")) { - return peerIpAddress; + return String.valueOf(peerIpAddress); } if (fieldName.equals("provisionedLinkCount")) { - return provisionedLinkCount; + return String.valueOf(provisionedLinkCount); } if (fieldName.equals("requestedLinkCount")) { - return requestedLinkCount; + return String.valueOf(requestedLinkCount); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -191,12 +282,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getAdminEnabled() { return adminEnabled; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java index ad6378241434..25ad248755c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -89,48 +93,104 @@ private InterconnectAttachment( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("cloudRouterIpAddress") && cloudRouterIpAddress != null) { + fieldMap.put( + "cloudRouterIpAddress", Collections.singletonList(String.valueOf(cloudRouterIpAddress))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("customerRouterIpAddress") && customerRouterIpAddress != null) { + fieldMap.put( + "customerRouterIpAddress", + Collections.singletonList(String.valueOf(customerRouterIpAddress))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) { + fieldMap.put( + "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("interconnect") && interconnect != null) { + fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("operationalStatus") && operationalStatus != null) { + fieldMap.put( + "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus))); + } + if (fieldNames.contains("privateInterconnectInfo") && privateInterconnectInfo != null) { + fieldMap.put( + "privateInterconnectInfo", + Collections.singletonList(String.valueOf(privateInterconnectInfo))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("cloudRouterIpAddress")) { - return cloudRouterIpAddress; + return String.valueOf(cloudRouterIpAddress); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("customerRouterIpAddress")) { - return customerRouterIpAddress; + return String.valueOf(customerRouterIpAddress); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("googleReferenceId")) { - return googleReferenceId; + return String.valueOf(googleReferenceId); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("interconnect")) { - return interconnect; + return String.valueOf(interconnect); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("operationalStatus")) { - return operationalStatus; + return String.valueOf(operationalStatus); } if (fieldName.equals("privateInterconnectInfo")) { - return privateInterconnectInfo; + return String.valueOf(privateInterconnectInfo); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -141,12 +201,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCloudRouterIpAddress() { return cloudRouterIpAddress; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java index 3bcad79216bf..ef8b07654665 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private InterconnectAttachmentAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java index 1191157b728f..886515f693f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InterconnectAttachmentList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectAttachment item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java index 25728173b18d..ee63f13390c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private InterconnectAttachmentPrivateInfo(Integer tag8021q) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("tag8021q")) { - return tag8021q; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("tag8021q") && tag8021q != null) { + fieldMap.put("tag8021q", Collections.singletonList(String.valueOf(tag8021q))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("tag8021q")) { + return String.valueOf(tag8021q); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java index 61be55216bf4..82d0e16c6d6f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,25 +46,35 @@ private InterconnectAttachmentsScopedList( } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("interconnectAttachments")) { - return interconnectAttachments; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectAttachment item : interconnectAttachments) { + stringList.add(item.toString()); + } + fieldMap.put("interconnectAttachments", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("interconnectAttachments")) { + return String.valueOf(interconnectAttachments); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java index 6f97b0aaf04b..5d48c4f7d3d2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +47,30 @@ private InterconnectCircuitInfo( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("customerDemarcId") && customerDemarcId != null) { + fieldMap.put("customerDemarcId", Collections.singletonList(String.valueOf(customerDemarcId))); + } + if (fieldNames.contains("googleCircuitId") && googleCircuitId != null) { + fieldMap.put("googleCircuitId", Collections.singletonList(String.valueOf(googleCircuitId))); + } + if (fieldNames.contains("googleDemarcId") && googleDemarcId != null) { + fieldMap.put("googleDemarcId", Collections.singletonList(String.valueOf(googleDemarcId))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("customerDemarcId")) { - return customerDemarcId; + return String.valueOf(customerDemarcId); } if (fieldName.equals("googleCircuitId")) { - return googleCircuitId; + return String.valueOf(googleCircuitId); } if (fieldName.equals("googleDemarcId")) { - return googleDemarcId; + return String.valueOf(googleDemarcId); } return null; } @@ -62,12 +81,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCustomerDemarcId() { return customerDemarcId; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java index 5c472c3a5863..a08d3dc5b512 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InterconnectList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Interconnect item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java index 3a5257017b1e..821c975a5d3e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -90,48 +95,104 @@ private InterconnectLocation( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("address") && address != null) { + fieldMap.put("address", Collections.singletonList(String.valueOf(address))); + } + if (fieldNames.contains("availabilityZone") && availabilityZone != null) { + fieldMap.put("availabilityZone", Collections.singletonList(String.valueOf(availabilityZone))); + } + if (fieldNames.contains("city") && city != null) { + fieldMap.put("city", Collections.singletonList(String.valueOf(city))); + } + if (fieldNames.contains("continent") && continent != null) { + fieldMap.put("continent", Collections.singletonList(String.valueOf(continent))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("facilityProvider") && facilityProvider != null) { + fieldMap.put("facilityProvider", Collections.singletonList(String.valueOf(facilityProvider))); + } + if (fieldNames.contains("facilityProviderFacilityId") && facilityProviderFacilityId != null) { + fieldMap.put( + "facilityProviderFacilityId", + Collections.singletonList(String.valueOf(facilityProviderFacilityId))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peeringdbFacilityId") && peeringdbFacilityId != null) { + fieldMap.put( + "peeringdbFacilityId", Collections.singletonList(String.valueOf(peeringdbFacilityId))); + } + if (fieldNames.contains("regionInfos") && regionInfos != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectLocationRegionInfo item : regionInfos) { + stringList.add(item.toString()); + } + fieldMap.put("regionInfos", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("address")) { - return address; + return String.valueOf(address); } if (fieldName.equals("availabilityZone")) { - return availabilityZone; + return String.valueOf(availabilityZone); } if (fieldName.equals("city")) { - return city; + return String.valueOf(city); } if (fieldName.equals("continent")) { - return continent; + return String.valueOf(continent); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("facilityProvider")) { - return facilityProvider; + return String.valueOf(facilityProvider); } if (fieldName.equals("facilityProviderFacilityId")) { - return facilityProviderFacilityId; + return String.valueOf(facilityProviderFacilityId); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("peeringdbFacilityId")) { - return peeringdbFacilityId; + return String.valueOf(peeringdbFacilityId); } if (fieldName.equals("regionInfos")) { - return regionInfos; + return String.valueOf(regionInfos); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -142,12 +203,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAddress() { return address; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java index bc9871314b16..21efdc1eaa2b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private InterconnectLocationList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InterconnectLocation item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java index 42a3f98eee06..2046dd98aef0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +47,30 @@ private InterconnectLocationRegionInfo( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("expectedRttMs") && expectedRttMs != null) { + fieldMap.put("expectedRttMs", Collections.singletonList(String.valueOf(expectedRttMs))); + } + if (fieldNames.contains("locationPresence") && locationPresence != null) { + fieldMap.put("locationPresence", Collections.singletonList(String.valueOf(locationPresence))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("expectedRttMs")) { - return expectedRttMs; + return String.valueOf(expectedRttMs); } if (fieldName.equals("locationPresence")) { - return locationPresence; + return String.valueOf(locationPresence); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } return null; } @@ -62,12 +81,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getExpectedRttMs() { return expectedRttMs; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java index 8be3ef264b6a..ba87f2fb6546 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -66,30 +71,64 @@ private InterconnectOutageNotification( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("affectedCircuits") && affectedCircuits != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : affectedCircuits) { + stringList.add(item.toString()); + } + fieldMap.put("affectedCircuits", stringList.build()); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("endTime") && endTime != null) { + fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime))); + } + if (fieldNames.contains("issueType") && issueType != null) { + fieldMap.put("issueType", Collections.singletonList(String.valueOf(issueType))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + if (fieldNames.contains("startTime") && startTime != null) { + fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("affectedCircuits")) { - return affectedCircuits; + return String.valueOf(affectedCircuits); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("endTime")) { - return endTime; + return String.valueOf(endTime); } if (fieldName.equals("issueType")) { - return issueType; + return String.valueOf(issueType); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("source")) { - return source; + return String.valueOf(source); } if (fieldName.equals("startTime")) { - return startTime; + return String.valueOf(startTime); } if (fieldName.equals("state")) { - return state; + return String.valueOf(state); } return null; } @@ -100,12 +139,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getAffectedCircuitsList() { return affectedCircuits; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java index 28e219f33b54..264ee694bb6f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private InvalidateCacheUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("cacheInvalidationRuleResource") + && cacheInvalidationRuleResource != null) { + fieldMap.put( + "cacheInvalidationRuleResource", + Collections.singletonList(String.valueOf(cacheInvalidationRuleResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("cacheInvalidationRuleResource")) { - return cacheInvalidationRuleResource; + return String.valueOf(cacheInvalidationRuleResource); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public CacheInvalidationRule getApiMessageRequestBody() { return cacheInvalidationRuleResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java index 17ebac93eda3..d405d453faa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private Items(String key, String value) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("key")) { - return key; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); } - if (fieldName.equals("value")) { - return value; + if (fieldNames.contains("value") && value != null) { + fieldMap.put("value", Collections.singletonList(String.valueOf(value))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("value")) { + return String.valueOf(value); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java index e25f2f6337ee..4e0c9b885395 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private License( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("chargesUseFee") && chargesUseFee != null) { + fieldMap.put("chargesUseFee", Collections.singletonList(String.valueOf(chargesUseFee))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenseCode") && licenseCode != null) { + fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("resourceRequirements") && resourceRequirements != null) { + fieldMap.put( + "resourceRequirements", Collections.singletonList(String.valueOf(resourceRequirements))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("transferable") && transferable != null) { + fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("chargesUseFee")) { - return chargesUseFee; + return String.valueOf(chargesUseFee); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("licenseCode")) { - return licenseCode; + return String.valueOf(licenseCode); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("resourceRequirements")) { - return resourceRequirements; + return String.valueOf(resourceRequirements); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("transferable")) { - return transferable; + return String.valueOf(transferable); } return null; } @@ -113,12 +155,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getChargesUseFee() { return chargesUseFee; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java index 6829da3cd60a..5752223ce642 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -70,33 +75,71 @@ private LicenseCode( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("licenseAlias") && licenseAlias != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (LicenseCodeLicenseAlias item : licenseAlias) { + stringList.add(item.toString()); + } + fieldMap.put("licenseAlias", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + if (fieldNames.contains("transferable") && transferable != null) { + fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("licenseAlias")) { - return licenseAlias; + return String.valueOf(licenseAlias); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("state")) { - return state; + return String.valueOf(state); } if (fieldName.equals("transferable")) { - return transferable; + return String.valueOf(transferable); } return null; } @@ -107,12 +150,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java index 96b3ef8ec210..0a6acb8c0f41 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private LicenseCodeLicenseAlias(String description, String selfLink) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("description")) { - return description; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } - if (fieldName.equals("selfLink")) { - return selfLink; + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java index a71e1505a4fe..40228b44df36 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private LicenseResourceRequirements(Integer minGuestCpuCount, Integer minMemoryM } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("minGuestCpuCount")) { - return minGuestCpuCount; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("minGuestCpuCount") && minGuestCpuCount != null) { + fieldMap.put("minGuestCpuCount", Collections.singletonList(String.valueOf(minGuestCpuCount))); } - if (fieldName.equals("minMemoryMb")) { - return minMemoryMb; + if (fieldNames.contains("minMemoryMb") && minMemoryMb != null) { + fieldMap.put("minMemoryMb", Collections.singletonList(String.valueOf(minMemoryMb))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("minGuestCpuCount")) { + return String.valueOf(minGuestCpuCount); + } + if (fieldName.equals("minMemoryMb")) { + return String.valueOf(minMemoryMb); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java index 5af927bb3672..c26fff8ac1bd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -50,21 +55,46 @@ private LicensesListResponse( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (License item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -75,12 +105,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java index 24f88896d771..5059c1664405 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListAcceleratorTypesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java index 5198a60931af..f49ce42acd49 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListAddressesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java index 05568ecd5361..754c7ec43bc7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListAutoscalersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java index fc751f1a6f53..370573626da8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListAvailableFeaturesSslPoliciesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java index b84e53222541..2831420c3b72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListBackendBucketsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java index 7e49314be6fe..4468629a8f8b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListBackendServicesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java index bb16c2b40bd0..463aaa944660 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListDiskTypesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java index b19f5c74f988..d1c92e50b928 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListDisksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java index b3ba0d38e97a..8d901b420a57 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListFirewallsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java index 52b8e7afc873..a37aeed865f1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListForwardingRulesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java index 777d19f94c6a..bd891abd7674 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListGlobalAddressesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java index 77462c526914..5ff5a403047b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListGlobalForwardingRulesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java index 07c6f18f4f6f..b05ed6fcb18a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListGlobalOperationsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java index 42de29469cc8..c089be938173 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListHealthChecksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java index 34a50eb3eb7c..b46175cf9aea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListHttpHealthChecksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java index f56ff8f78216..7e37b6d7686d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListHttpsHealthChecksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java index faf12f63e32b..2871c11599ab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListImagesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java index bed894d85107..4a3a8e3174c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInstanceGroupManagersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java index 30d061945370..065f8f3f7726 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInstanceGroupsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java index 66421b27a04e..3dff877bf30d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInstanceTemplatesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java index 1067060d2659..35744f497336 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInstancesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java index b9c536de1722..3b4ef6048d60 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,45 +89,93 @@ private ListInstancesInstanceGroupsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsListInstancesRequestResource") + && instanceGroupsListInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsListInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("instanceGroupsListInstancesRequestResource")) { - return instanceGroupsListInstancesRequestResource; + return String.valueOf(instanceGroupsListInstancesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -134,12 +186,6 @@ public InstanceGroupsListInstancesRequest getApiMessageRequestBody() { return instanceGroupsListInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java index b349cdf74f05..78bfd32bbd0a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,45 +91,94 @@ private ListInstancesRegionInstanceGroupsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupsListInstancesRequestResource") + && regionInstanceGroupsListInstancesRequestResource != null) { + fieldMap.put( + "regionInstanceGroupsListInstancesRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupsListInstancesRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupsListInstancesRequestResource")) { - return regionInstanceGroupsListInstancesRequestResource; + return String.valueOf(regionInstanceGroupsListInstancesRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -136,12 +189,6 @@ public RegionInstanceGroupsListInstancesRequest getApiMessageRequestBody() { return regionInstanceGroupsListInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java index ea3f0319af05..4314af4017c7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInterconnectAttachmentsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java index 6765ca3f254b..35b25d7679e5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInterconnectLocationsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java index cef9d8e5fd1d..a8099c0b40ec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListInterconnectsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java index 5a8550d8c53e..965e04fc88f5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListLicensesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java index b93f7892d350..1c468d4aab5f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListMachineTypesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java index 4a6b155aa537..fd91b32e5133 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,85 @@ private ListManagedInstancesInstanceGroupManagersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +174,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java index c54915618126..38a4ca194dff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -82,42 +86,85 @@ private ListManagedInstancesRegionInstanceGroupManagersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -128,12 +175,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java index db9d798b5793..3833c085e618 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListNetworksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java index 0864085f101e..fecf7b8aac5b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListReferrersInstancesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java index 9acb39fccbaf..fa2545c4b03d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionAutoscalersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java index 39c3159dbb73..584dc381f80e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionBackendServicesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java index af22bce70777..4a991b0cb9c2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionCommitmentsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java index 49dec8728e7e..ce71d45770a6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionInstanceGroupManagersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java index 273834703ead..22da113346da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionInstanceGroupsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java index 1ec0e417def9..371fc05e0284 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionOperationsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java index 1854141ffced..4f87e0ad4103 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRegionsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java index 01ef08ef554a..2a4e4adb9262 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRoutersHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java index bd78370554b0..766e05a72202 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListRoutesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java index e9c265a28f91..c6fb14db309c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListSnapshotsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java index b099c7588532..7df078c07b2f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListSslCertificatesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java index ff1727df14a9..4e8674f51aa7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListSslPoliciesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java index ee1517a229e4..30ba879d6c92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListSubnetworksHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java index fe7bf148cdba..103aaf931bfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetHttpProxiesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java index 7911a4a7f758..530a1db7d30f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetHttpsProxiesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java index 643f3ab4322f..d0573cfc9162 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetInstancesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java index 5effff1cc334..758a7b8191a6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetPoolsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java index eb79d63ca80d..468717b78089 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetSslProxiesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java index 1f80fe35142d..2ac3f7bd32c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetTcpProxiesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java index 0e017f6edd2b..db242544a50d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListTargetVpnGatewaysHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java index 4173d3714524..553367d73cd3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListUrlMapsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java index 6d1142436e0a..d269ea2a36aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListVpnTunnelsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java index c25ffe2c79dd..0419581ecf6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,45 +89,93 @@ private ListXpnHostsProjectsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("projectsListXpnHostsRequestResource") + && projectsListXpnHostsRequestResource != null) { + fieldMap.put( + "projectsListXpnHostsRequestResource", + Collections.singletonList(String.valueOf(projectsListXpnHostsRequestResource))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("projectsListXpnHostsRequestResource")) { - return projectsListXpnHostsRequestResource; + return String.valueOf(projectsListXpnHostsRequestResource); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -134,12 +186,6 @@ public ProjectsListXpnHostsRequest getApiMessageRequestBody() { return projectsListXpnHostsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java index 7c6f29c1f4e0..9ecdd6e33fd3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListZoneOperationsHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java index 1c49589566a8..7054df81e8f0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,42 +85,84 @@ private ListZonesHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("filter")) { - return filter; + return String.valueOf(filter); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("maxResults")) { - return maxResults; + return String.valueOf(maxResults); } if (fieldName.equals("orderBy")) { - return orderBy; + return String.valueOf(orderBy); } if (fieldName.equals("pageToken")) { - return pageToken; + return String.valueOf(pageToken); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +173,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java index 1cfb5c318521..c85c7f8f01bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -94,51 +99,112 @@ private MachineType( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("guestCpus") && guestCpus != null) { + fieldMap.put("guestCpus", Collections.singletonList(String.valueOf(guestCpus))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("imageSpaceGb") && imageSpaceGb != null) { + fieldMap.put("imageSpaceGb", Collections.singletonList(String.valueOf(imageSpaceGb))); + } + if (fieldNames.contains("isSharedCpu") && isSharedCpu != null) { + fieldMap.put("isSharedCpu", Collections.singletonList(String.valueOf(isSharedCpu))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("maximumPersistentDisks") && maximumPersistentDisks != null) { + fieldMap.put( + "maximumPersistentDisks", + Collections.singletonList(String.valueOf(maximumPersistentDisks))); + } + if (fieldNames.contains("maximumPersistentDisksSizeGb") + && maximumPersistentDisksSizeGb != null) { + fieldMap.put( + "maximumPersistentDisksSizeGb", + Collections.singletonList(String.valueOf(maximumPersistentDisksSizeGb))); + } + if (fieldNames.contains("memoryMb") && memoryMb != null) { + fieldMap.put("memoryMb", Collections.singletonList(String.valueOf(memoryMb))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("scratchDisks") && scratchDisks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ScratchDisks item : scratchDisks) { + stringList.add(item.toString()); + } + fieldMap.put("scratchDisks", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("guestCpus")) { - return guestCpus; + return String.valueOf(guestCpus); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("imageSpaceGb")) { - return imageSpaceGb; + return String.valueOf(imageSpaceGb); } if (fieldName.equals("isSharedCpu")) { - return isSharedCpu; + return String.valueOf(isSharedCpu); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("maximumPersistentDisks")) { - return maximumPersistentDisks; + return String.valueOf(maximumPersistentDisks); } if (fieldName.equals("maximumPersistentDisksSizeGb")) { - return maximumPersistentDisksSizeGb; + return String.valueOf(maximumPersistentDisksSizeGb); } if (fieldName.equals("memoryMb")) { - return memoryMb; + return String.valueOf(memoryMb); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("scratchDisks")) { - return scratchDisks; + return String.valueOf(scratchDisks); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -149,12 +215,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java index 2aea9edf43de..9f950f37c44a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private MachineTypeAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java index e0fe295eb4bb..89d1b36936cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private MachineTypeList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (MachineType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java index e9508a1838d6..2f41edbc6d61 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private MachineTypesScopedList(List machineTypes, Warning warning) } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("machineTypes")) { - return machineTypes; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("machineTypes") && machineTypes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (MachineType item : machineTypes) { + stringList.add(item.toString()); + } + fieldMap.put("machineTypes", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("machineTypes")) { + return String.valueOf(machineTypes); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java index 29e6d18ac983..f496bf31d2c4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -53,21 +57,42 @@ private ManagedInstance( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("currentAction") && currentAction != null) { + fieldMap.put("currentAction", Collections.singletonList(String.valueOf(currentAction))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instanceStatus") && instanceStatus != null) { + fieldMap.put("instanceStatus", Collections.singletonList(String.valueOf(instanceStatus))); + } + if (fieldNames.contains("lastAttempt") && lastAttempt != null) { + fieldMap.put("lastAttempt", Collections.singletonList(String.valueOf(lastAttempt))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("currentAction")) { - return currentAction; + return String.valueOf(currentAction); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instanceStatus")) { - return instanceStatus; + return String.valueOf(instanceStatus); } if (fieldName.equals("lastAttempt")) { - return lastAttempt; + return String.valueOf(lastAttempt); } return null; } @@ -78,12 +103,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCurrentAction() { return currentAction; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java index a6c4ddf12359..0398c6007add 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private ManagedInstanceLastAttempt(Errors errors) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("errors")) { - return errors; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("errors") && errors != null) { + fieldMap.put("errors", Collections.singletonList(String.valueOf(errors))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("errors")) { + return String.valueOf(errors); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java index df0f5847fa27..95c758ea3f70 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +48,34 @@ private Metadata(String fingerprint, List items, String kind) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Items item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } return null; } @@ -62,12 +86,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getFingerprint() { return fingerprint; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java index c95d807b2326..5605995652de 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private MoveDiskProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskMoveRequestResource") && diskMoveRequestResource != null) { + fieldMap.put( + "diskMoveRequestResource", + Collections.singletonList(String.valueOf(diskMoveRequestResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("diskMoveRequestResource")) { - return diskMoveRequestResource; + return String.valueOf(diskMoveRequestResource); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public DiskMoveRequest getApiMessageRequestBody() { return diskMoveRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java index 63cd98cdf273..f370b4161b53 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private MoveInstanceProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceMoveRequestResource") && instanceMoveRequestResource != null) { + fieldMap.put( + "instanceMoveRequestResource", + Collections.singletonList(String.valueOf(instanceMoveRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceMoveRequestResource")) { - return instanceMoveRequestResource; + return String.valueOf(instanceMoveRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public InstanceMoveRequest getApiMessageRequestBody() { return instanceMoveRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java index 00a11aaee175..2d5d450c6dd7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private NamedPort(String name, Integer port) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("name")) { - return name; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } - if (fieldName.equals("port")) { - return port; + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("name")) { + return String.valueOf(name); + } + if (fieldName.equals("port")) { + return String.valueOf(port); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java index 4ce606f5aa81..48da3336168b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -82,42 +87,95 @@ private Network( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoCreateSubnetworks") && autoCreateSubnetworks != null) { + fieldMap.put( + "autoCreateSubnetworks", + Collections.singletonList(String.valueOf(autoCreateSubnetworks))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("gatewayIPv4") && gatewayIPv4 != null) { + fieldMap.put("gatewayIPv4", Collections.singletonList(String.valueOf(gatewayIPv4))); + } + if (fieldNames.contains("iPv4Range") && iPv4Range != null) { + fieldMap.put("iPv4Range", Collections.singletonList(String.valueOf(iPv4Range))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerings") && peerings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NetworkPeering item : peerings) { + stringList.add(item.toString()); + } + fieldMap.put("peerings", stringList.build()); + } + if (fieldNames.contains("routingConfig") && routingConfig != null) { + fieldMap.put("routingConfig", Collections.singletonList(String.valueOf(routingConfig))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("subnetworks") && subnetworks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : subnetworks) { + stringList.add(item.toString()); + } + fieldMap.put("subnetworks", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("autoCreateSubnetworks")) { - return autoCreateSubnetworks; + return String.valueOf(autoCreateSubnetworks); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("gatewayIPv4")) { - return gatewayIPv4; + return String.valueOf(gatewayIPv4); } if (fieldName.equals("iPv4Range")) { - return iPv4Range; + return String.valueOf(iPv4Range); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("peerings")) { - return peerings; + return String.valueOf(peerings); } if (fieldName.equals("routingConfig")) { - return routingConfig; + return String.valueOf(routingConfig); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("subnetworks")) { - return subnetworks; + return String.valueOf(subnetworks); } return null; } @@ -128,12 +186,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getAutoCreateSubnetworks() { return autoCreateSubnetworks; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java index 52c668ae9840..cf8da9d0ed2f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -66,30 +71,68 @@ private NetworkInterface( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfigs") && accessConfigs != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AccessConfig item : accessConfigs) { + stringList.add(item.toString()); + } + fieldMap.put("accessConfigs", stringList.build()); + } + if (fieldNames.contains("aliasIpRanges") && aliasIpRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (AliasIpRange item : aliasIpRanges) { + stringList.add(item.toString()); + } + fieldMap.put("aliasIpRanges", stringList.build()); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networkIP") && networkIP != null) { + fieldMap.put("networkIP", Collections.singletonList(String.valueOf(networkIP))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("accessConfigs")) { - return accessConfigs; + return String.valueOf(accessConfigs); } if (fieldName.equals("aliasIpRanges")) { - return aliasIpRanges; + return String.valueOf(aliasIpRanges); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("networkIP")) { - return networkIP; + return String.valueOf(networkIP); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } return null; } @@ -100,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getAccessConfigsList() { return accessConfigs; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java index 7173c819e1c2..b2cf2cdf80e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private NetworkList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Network item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java index 358916af8b13..0d6bdca5b111 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,21 +53,42 @@ private NetworkPeering( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) { + fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + if (fieldNames.contains("stateDetails") && stateDetails != null) { + fieldMap.put("stateDetails", Collections.singletonList(String.valueOf(stateDetails))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("autoCreateRoutes")) { - return autoCreateRoutes; + return String.valueOf(autoCreateRoutes); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("state")) { - return state; + return String.valueOf(state); } if (fieldName.equals("stateDetails")) { - return stateDetails; + return String.valueOf(stateDetails); } return null; } @@ -74,12 +99,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java index fee7e20c4536..ee9f3c89ec24 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private NetworkRoutingConfig(String routingMode) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("routingMode")) { - return routingMode; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("routingMode") && routingMode != null) { + fieldMap.put("routingMode", Collections.singletonList(String.valueOf(routingMode))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("routingMode")) { + return String.valueOf(routingMode); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java index c70d12129013..a964e5b5c782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -42,15 +46,30 @@ private NetworksAddPeeringRequest(Boolean autoCreateRoutes, String name, String } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) { + fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerNetwork") && peerNetwork != null) { + fieldMap.put("peerNetwork", Collections.singletonList(String.valueOf(peerNetwork))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("autoCreateRoutes")) { - return autoCreateRoutes; + return String.valueOf(autoCreateRoutes); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("peerNetwork")) { - return peerNetwork; + return String.valueOf(peerNetwork); } return null; } @@ -61,12 +80,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java index 397a37cef130..cf35ffa8be25 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private NetworksRemovePeeringRequest(String name) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("name")) { - return name; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("name")) { + return String.valueOf(name); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java index 1ce06a104dea..1c4bfddfdd70 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -126,75 +131,157 @@ private Operation( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("clientOperationId") && clientOperationId != null) { + fieldMap.put( + "clientOperationId", Collections.singletonList(String.valueOf(clientOperationId))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("endTime") && endTime != null) { + fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime))); + } + if (fieldNames.contains("error") && error != null) { + fieldMap.put("error", Collections.singletonList(String.valueOf(error))); + } + if (fieldNames.contains("httpErrorMessage") && httpErrorMessage != null) { + fieldMap.put("httpErrorMessage", Collections.singletonList(String.valueOf(httpErrorMessage))); + } + if (fieldNames.contains("httpErrorStatusCode") && httpErrorStatusCode != null) { + fieldMap.put( + "httpErrorStatusCode", Collections.singletonList(String.valueOf(httpErrorStatusCode))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("insertTime") && insertTime != null) { + fieldMap.put("insertTime", Collections.singletonList(String.valueOf(insertTime))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("operationType") && operationType != null) { + fieldMap.put("operationType", Collections.singletonList(String.valueOf(operationType))); + } + if (fieldNames.contains("progress") && progress != null) { + fieldMap.put("progress", Collections.singletonList(String.valueOf(progress))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("startTime") && startTime != null) { + fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("statusMessage") && statusMessage != null) { + fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage))); + } + if (fieldNames.contains("targetId") && targetId != null) { + fieldMap.put("targetId", Collections.singletonList(String.valueOf(targetId))); + } + if (fieldNames.contains("targetLink") && targetLink != null) { + fieldMap.put("targetLink", Collections.singletonList(String.valueOf(targetLink))); + } + if (fieldNames.contains("user") && user != null) { + fieldMap.put("user", Collections.singletonList(String.valueOf(user))); + } + if (fieldNames.contains("warnings") && warnings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Warnings item : warnings) { + stringList.add(item.toString()); + } + fieldMap.put("warnings", stringList.build()); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("clientOperationId")) { - return clientOperationId; + return String.valueOf(clientOperationId); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("endTime")) { - return endTime; + return String.valueOf(endTime); } if (fieldName.equals("error")) { - return error; + return String.valueOf(error); } if (fieldName.equals("httpErrorMessage")) { - return httpErrorMessage; + return String.valueOf(httpErrorMessage); } if (fieldName.equals("httpErrorStatusCode")) { - return httpErrorStatusCode; + return String.valueOf(httpErrorStatusCode); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("insertTime")) { - return insertTime; + return String.valueOf(insertTime); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("operationType")) { - return operationType; + return String.valueOf(operationType); } if (fieldName.equals("progress")) { - return progress; + return String.valueOf(progress); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("startTime")) { - return startTime; + return String.valueOf(startTime); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("statusMessage")) { - return statusMessage; + return String.valueOf(statusMessage); } if (fieldName.equals("targetId")) { - return targetId; + return String.valueOf(targetId); } if (fieldName.equals("targetLink")) { - return targetLink; + return String.valueOf(targetLink); } if (fieldName.equals("user")) { - return user; + return String.valueOf(user); } if (fieldName.equals("warnings")) { - return warnings; + return String.valueOf(warnings); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -205,12 +292,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getClientOperationId() { return clientOperationId; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java index 29bdd2229966..5c7fa68a5c07 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private OperationAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java index f02a5fb2cd7d..d48e70e4f295 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private OperationList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Operation item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java index b6ce075a7325..9fff272b34bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private OperationsScopedList(List operations, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("operations")) { - return operations; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("operations") && operations != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Operation item : operations) { + stringList.add(item.toString()); + } + fieldMap.put("operations", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("operations")) { + return String.valueOf(operations); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java index 2102af68384b..e1b438e32537 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class PatchAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,7 +46,6 @@ private PatchAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -58,7 +60,6 @@ private PatchAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -70,7 +71,6 @@ private PatchAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,42 +81,79 @@ private PatchAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("autoscalerResource")) { - return autoscalerResource; + return String.valueOf(autoscalerResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +164,6 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -204,7 +235,6 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -229,9 +259,6 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -261,7 +288,6 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -307,15 +333,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -393,7 +410,6 @@ public PatchAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, @@ -409,7 +425,6 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -436,9 +451,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -473,7 +485,6 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -492,7 +503,6 @@ public int hashCode() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java index c2557817a243..89a83330fd88 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class PatchBackendBucketHttpRequest implements ApiMessage { private final String backendBucket; private final BackendBucket backendBucketResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,7 +45,6 @@ private PatchBackendBucketHttpRequest() { this.backendBucket = null; this.backendBucketResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -56,7 +58,6 @@ private PatchBackendBucketHttpRequest( String backendBucket, BackendBucket backendBucketResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -67,7 +68,6 @@ private PatchBackendBucketHttpRequest( this.backendBucket = backendBucket; this.backendBucketResource = backendBucketResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,74 @@ private PatchBackendBucketHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucket") && backendBucket != null) { + fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); + } + if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { + fieldMap.put( + "backendBucketResource", + Collections.singletonList(String.valueOf(backendBucketResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendBucket")) { - return backendBucket; + return String.valueOf(backendBucket); } if (fieldName.equals("backendBucketResource")) { - return backendBucketResource; + return String.valueOf(backendBucketResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +155,6 @@ public BackendBucket getApiMessageRequestBody() { return backendBucketResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -193,7 +222,6 @@ public static class Builder { private String backendBucket; private BackendBucket backendBucketResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -217,9 +245,6 @@ public Builder mergeFrom(PatchBackendBucketHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -246,7 +271,6 @@ public Builder mergeFrom(PatchBackendBucketHttpRequest other) { this.backendBucket = source.backendBucket; this.backendBucketResource = source.backendBucketResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -291,15 +315,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -369,7 +384,6 @@ public PatchBackendBucketHttpRequest build() { backendBucket, backendBucketResource, callback, - fieldMask, fields, key, prettyPrint, @@ -384,7 +398,6 @@ public Builder clone() { newBuilder.setBackendBucket(this.backendBucket); newBuilder.setBackendBucketResource(this.backendBucketResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -410,9 +423,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -444,7 +454,6 @@ public boolean equals(Object o) { && Objects.equals(this.backendBucket, that.getBackendBucket()) && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -462,7 +471,6 @@ public int hashCode() { backendBucket, backendBucketResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java index cbd151c53a69..63c92c498405 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class PatchBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,7 +45,6 @@ private PatchBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -56,7 +58,6 @@ private PatchBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -67,7 +68,6 @@ private PatchBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,74 @@ private PatchBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("backendServiceResource")) { - return backendServiceResource; + return String.valueOf(backendServiceResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +155,6 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -193,7 +222,6 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -217,9 +245,6 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -246,7 +271,6 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -291,15 +315,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -369,7 +384,6 @@ public PatchBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, @@ -384,7 +398,6 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -410,9 +423,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -444,7 +454,6 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -462,7 +471,6 @@ public int hashCode() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java index b9eeb0fcb088..4a7c2fae0014 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String firewall; private final Firewall firewallResource; @@ -40,7 +43,6 @@ public final class PatchFirewallHttpRequest implements ApiMessage { private PatchFirewallHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.firewall = null; this.firewallResource = null; @@ -54,7 +56,6 @@ private PatchFirewallHttpRequest() { private PatchFirewallHttpRequest( String access_token, String callback, - List fieldMask, String fields, String firewall, Firewall firewallResource, @@ -65,7 +66,6 @@ private PatchFirewallHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.firewall = firewall; this.firewallResource = firewallResource; @@ -77,39 +77,72 @@ private PatchFirewallHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("firewallResource") && firewallResource != null) { + fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("firewall")) { - return firewall; + return String.valueOf(firewall); } if (fieldName.equals("firewallResource")) { - return firewallResource; + return String.valueOf(firewallResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public Firewall getApiMessageRequestBody() { return firewallResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static PatchFirewallHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String firewall; private Firewall firewallResource; @@ -211,9 +237,6 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) { Builder(PatchFirewallHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.firewall = source.firewall; this.firewallResource = source.firewallResource; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public PatchFirewallHttpRequest build() { return new PatchFirewallHttpRequest( access_token, callback, - fieldMask, fields, firewall, firewallResource, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setFirewall(this.firewall); newBuilder.setFirewallResource(this.firewallResource); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { PatchFirewallHttpRequest that = (PatchFirewallHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.firewall, that.getFirewall()) && Objects.equals(this.firewallResource, that.getFirewallResource()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, firewall, firewallResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java index 4434ba523295..069a5579dae6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String healthCheck; private final HealthCheck healthCheckResource; @@ -40,7 +43,6 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage { private PatchHealthCheckHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.healthCheck = null; this.healthCheckResource = null; @@ -54,7 +56,6 @@ private PatchHealthCheckHttpRequest() { private PatchHealthCheckHttpRequest( String access_token, String callback, - List fieldMask, String fields, String healthCheck, HealthCheck healthCheckResource, @@ -65,7 +66,6 @@ private PatchHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.healthCheck = healthCheck; this.healthCheckResource = healthCheckResource; @@ -77,39 +77,73 @@ private PatchHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { + fieldMap.put( + "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("healthCheck")) { - return healthCheck; + return String.valueOf(healthCheck); } if (fieldName.equals("healthCheckResource")) { - return healthCheckResource; + return String.valueOf(healthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +154,6 @@ public HealthCheck getApiMessageRequestBody() { return healthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +219,6 @@ public static PatchHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String healthCheck; private HealthCheck healthCheckResource; @@ -211,9 +238,6 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +268,6 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) { Builder(PatchHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.healthCheck = source.healthCheck; this.healthCheckResource = source.healthCheckResource; @@ -273,15 +296,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +381,6 @@ public PatchHealthCheckHttpRequest build() { return new PatchHealthCheckHttpRequest( access_token, callback, - fieldMask, fields, healthCheck, healthCheckResource, @@ -382,7 +395,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHealthCheck(this.healthCheck); newBuilder.setHealthCheckResource(this.healthCheckResource); @@ -404,9 +416,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +451,6 @@ public boolean equals(Object o) { PatchHealthCheckHttpRequest that = (PatchHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.healthCheck, that.getHealthCheck()) && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) @@ -460,7 +468,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, healthCheck, healthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java index d3953e7a28c0..5d21363c4307 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,10 +31,9 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String httpHealthCheck; - private final HttpHealthCheck httpHealthCheckResource; + private final HttpHealthCheck2 httpHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -40,7 +43,6 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage { private PatchHttpHealthCheckHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.httpHealthCheck = null; this.httpHealthCheckResource = null; @@ -54,10 +56,9 @@ private PatchHttpHealthCheckHttpRequest() { private PatchHttpHealthCheckHttpRequest( String access_token, String callback, - List fieldMask, String fields, String httpHealthCheck, - HttpHealthCheck httpHealthCheckResource, + HttpHealthCheck2 httpHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -65,7 +66,6 @@ private PatchHttpHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.httpHealthCheck = httpHealthCheck; this.httpHealthCheckResource = httpHealthCheckResource; @@ -77,55 +77,84 @@ private PatchHttpHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { + fieldMap.put( + "httpHealthCheckResource", + Collections.singletonList(String.valueOf(httpHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpHealthCheck")) { - return httpHealthCheck; + return String.valueOf(httpHealthCheck); } if (fieldName.equals("httpHealthCheckResource")) { - return httpHealthCheckResource; + return String.valueOf(httpHealthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @Nullable @Override - public HttpHealthCheck getApiMessageRequestBody() { + public HttpHealthCheck2 getApiMessageRequestBody() { return httpHealthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -142,7 +171,7 @@ public String getHttpHealthCheck() { return httpHealthCheck; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -191,10 +220,9 @@ public static PatchHttpHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String httpHealthCheck; - private HttpHealthCheck httpHealthCheckResource; + private HttpHealthCheck2 httpHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -211,9 +239,6 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +269,6 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) { Builder(PatchHttpHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpHealthCheck = source.httpHealthCheck; this.httpHealthCheckResource = source.httpHealthCheckResource; @@ -273,15 +297,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -300,11 +315,11 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { return this; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } @@ -367,7 +382,6 @@ public PatchHttpHealthCheckHttpRequest build() { return new PatchHttpHealthCheckHttpRequest( access_token, callback, - fieldMask, fields, httpHealthCheck, httpHealthCheckResource, @@ -382,7 +396,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpHealthCheck(this.httpHealthCheck); newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); @@ -404,9 +417,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +452,6 @@ public boolean equals(Object o) { PatchHttpHealthCheckHttpRequest that = (PatchHttpHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) @@ -460,7 +469,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, httpHealthCheck, httpHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java index d24557515f16..fe2a163ad132 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,10 +31,9 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String httpsHealthCheck; - private final HttpsHealthCheck httpsHealthCheckResource; + private final HttpsHealthCheck2 httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -40,7 +43,6 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage { private PatchHttpsHealthCheckHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.httpsHealthCheck = null; this.httpsHealthCheckResource = null; @@ -54,10 +56,9 @@ private PatchHttpsHealthCheckHttpRequest() { private PatchHttpsHealthCheckHttpRequest( String access_token, String callback, - List fieldMask, String fields, String httpsHealthCheck, - HttpsHealthCheck httpsHealthCheckResource, + HttpsHealthCheck2 httpsHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -65,7 +66,6 @@ private PatchHttpsHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.httpsHealthCheck = httpsHealthCheck; this.httpsHealthCheckResource = httpsHealthCheckResource; @@ -77,55 +77,84 @@ private PatchHttpsHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { + fieldMap.put( + "httpsHealthCheckResource", + Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpsHealthCheck")) { - return httpsHealthCheck; + return String.valueOf(httpsHealthCheck); } if (fieldName.equals("httpsHealthCheckResource")) { - return httpsHealthCheckResource; + return String.valueOf(httpsHealthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @Nullable @Override - public HttpsHealthCheck getApiMessageRequestBody() { + public HttpsHealthCheck2 getApiMessageRequestBody() { return httpsHealthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -142,7 +171,7 @@ public String getHttpsHealthCheck() { return httpsHealthCheck; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -191,10 +220,9 @@ public static PatchHttpsHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String httpsHealthCheck; - private HttpsHealthCheck httpsHealthCheckResource; + private HttpsHealthCheck2 httpsHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -211,9 +239,6 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +269,6 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) { Builder(PatchHttpsHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpsHealthCheck = source.httpsHealthCheck; this.httpsHealthCheckResource = source.httpsHealthCheckResource; @@ -273,15 +297,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -300,11 +315,11 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { return this; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } @@ -367,7 +382,6 @@ public PatchHttpsHealthCheckHttpRequest build() { return new PatchHttpsHealthCheckHttpRequest( access_token, callback, - fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, @@ -382,7 +396,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); @@ -404,9 +417,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +452,6 @@ public boolean equals(Object o) { PatchHttpsHealthCheckHttpRequest that = (PatchHttpsHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) @@ -460,7 +469,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java index d6e8277ab9a5..74192f22a4b8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchInterconnectHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String interconnect; private final Interconnect interconnectResource; @@ -40,7 +43,6 @@ public final class PatchInterconnectHttpRequest implements ApiMessage { private PatchInterconnectHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.interconnect = null; this.interconnectResource = null; @@ -54,7 +56,6 @@ private PatchInterconnectHttpRequest() { private PatchInterconnectHttpRequest( String access_token, String callback, - List fieldMask, String fields, String interconnect, Interconnect interconnectResource, @@ -65,7 +66,6 @@ private PatchInterconnectHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.interconnect = interconnect; this.interconnectResource = interconnectResource; @@ -77,39 +77,73 @@ private PatchInterconnectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("interconnect") && interconnect != null) { + fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect))); + } + if (fieldNames.contains("interconnectResource") && interconnectResource != null) { + fieldMap.put( + "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("interconnect")) { - return interconnect; + return String.valueOf(interconnect); } if (fieldName.equals("interconnectResource")) { - return interconnectResource; + return String.valueOf(interconnectResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +154,6 @@ public Interconnect getApiMessageRequestBody() { return interconnectResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +219,6 @@ public static PatchInterconnectHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String interconnect; private Interconnect interconnectResource; @@ -211,9 +238,6 @@ public Builder mergeFrom(PatchInterconnectHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +268,6 @@ public Builder mergeFrom(PatchInterconnectHttpRequest other) { Builder(PatchInterconnectHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.interconnect = source.interconnect; this.interconnectResource = source.interconnectResource; @@ -273,15 +296,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +381,6 @@ public PatchInterconnectHttpRequest build() { return new PatchInterconnectHttpRequest( access_token, callback, - fieldMask, fields, interconnect, interconnectResource, @@ -382,7 +395,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setInterconnect(this.interconnect); newBuilder.setInterconnectResource(this.interconnectResource); @@ -404,9 +416,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +451,6 @@ public boolean equals(Object o) { PatchInterconnectHttpRequest that = (PatchInterconnectHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.interconnect, that.getInterconnect()) && Objects.equals(this.interconnectResource, that.getInterconnectResource()) @@ -460,7 +468,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, interconnect, interconnectResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java index 28d763a2bf0c..2d9202c8cc87 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchNetworkHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String network; @@ -40,7 +43,6 @@ public final class PatchNetworkHttpRequest implements ApiMessage { private PatchNetworkHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.network = null; @@ -54,7 +56,6 @@ private PatchNetworkHttpRequest() { private PatchNetworkHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String network, @@ -65,7 +66,6 @@ private PatchNetworkHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.network = network; @@ -77,39 +77,72 @@ private PatchNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networkResource") && networkResource != null) { + fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("networkResource")) { - return networkResource; + return String.valueOf(networkResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public Network getApiMessageRequestBody() { return networkResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static PatchNetworkHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String network; @@ -211,9 +237,6 @@ public Builder mergeFrom(PatchNetworkHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(PatchNetworkHttpRequest other) { Builder(PatchNetworkHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.network = source.network; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public PatchNetworkHttpRequest build() { return new PatchNetworkHttpRequest( access_token, callback, - fieldMask, fields, key, network, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setNetwork(this.network); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { PatchNetworkHttpRequest that = (PatchNetworkHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.network, that.getNetwork()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, network, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java index c3c81698c71e..dd3d15c4d300 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class PatchRegionAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,7 +46,6 @@ private PatchRegionAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -58,7 +60,6 @@ private PatchRegionAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -70,7 +71,6 @@ private PatchRegionAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,42 +81,79 @@ private PatchRegionAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("autoscalerResource")) { - return autoscalerResource; + return String.valueOf(autoscalerResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +164,6 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -204,7 +235,6 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -229,9 +259,6 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -261,7 +288,6 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -307,15 +333,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -394,7 +411,6 @@ public PatchRegionAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, @@ -410,7 +426,6 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -437,9 +452,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -474,7 +486,6 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -493,7 +504,6 @@ public int hashCode() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java index 4f91c71c2486..62ac1effe9c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class PatchRegionBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,7 +45,6 @@ private PatchRegionBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -56,7 +58,6 @@ private PatchRegionBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -67,7 +68,6 @@ private PatchRegionBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,74 @@ private PatchRegionBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("backendServiceResource")) { - return backendServiceResource; + return String.valueOf(backendServiceResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +155,6 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -193,7 +222,6 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -217,9 +245,6 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -246,7 +271,6 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -291,15 +315,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -369,7 +384,6 @@ public PatchRegionBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, @@ -384,7 +398,6 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -410,9 +423,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -444,7 +454,6 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -462,7 +471,6 @@ public int hashCode() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java index bf550127c4f0..5162364dd1b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchRouterHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,7 +43,6 @@ public final class PatchRouterHttpRequest implements ApiMessage { private PatchRouterHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -54,7 +56,6 @@ private PatchRouterHttpRequest() { private PatchRouterHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -65,7 +66,6 @@ private PatchRouterHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,72 @@ private PatchRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("routerResource")) { - return routerResource; + return String.valueOf(routerResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public Router getApiMessageRequestBody() { return routerResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static PatchRouterHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -211,9 +237,6 @@ public Builder mergeFrom(PatchRouterHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(PatchRouterHttpRequest other) { Builder(PatchRouterHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public PatchRouterHttpRequest build() { return new PatchRouterHttpRequest( access_token, callback, - fieldMask, fields, key, prettyPrint, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { PatchRouterHttpRequest that = (PatchRouterHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java index 41c751755cd8..a026878f2905 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,7 +43,6 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage { private PatchSslPolicyHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -54,7 +56,6 @@ private PatchSslPolicyHttpRequest() { private PatchSslPolicyHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -65,7 +66,6 @@ private PatchSslPolicyHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,73 @@ private PatchSslPolicyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) { + fieldMap.put( + "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslPolicy")) { - return sslPolicy; + return String.valueOf(sslPolicy); } if (fieldName.equals("sslPolicyResource")) { - return sslPolicyResource; + return String.valueOf(sslPolicyResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +154,6 @@ public SslPolicy getApiMessageRequestBody() { return sslPolicyResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +219,6 @@ public static PatchSslPolicyHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -211,9 +238,6 @@ public Builder mergeFrom(PatchSslPolicyHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +268,6 @@ public Builder mergeFrom(PatchSslPolicyHttpRequest other) { Builder(PatchSslPolicyHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -273,15 +296,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +381,6 @@ public PatchSslPolicyHttpRequest build() { return new PatchSslPolicyHttpRequest( access_token, callback, - fieldMask, fields, key, prettyPrint, @@ -382,7 +395,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -404,9 +416,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +451,6 @@ public boolean equals(Object o) { PatchSslPolicyHttpRequest that = (PatchSslPolicyHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -460,7 +468,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java index 0cb24e08eb02..a95f50f20073 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,7 +43,6 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage { private PatchSubnetworkHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -54,7 +56,6 @@ private PatchSubnetworkHttpRequest() { private PatchSubnetworkHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -65,7 +66,6 @@ private PatchSubnetworkHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,73 @@ private PatchSubnetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) { + fieldMap.put( + "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("subnetworkResource")) { - return subnetworkResource; + return String.valueOf(subnetworkResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +154,6 @@ public Subnetwork getApiMessageRequestBody() { return subnetworkResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +219,6 @@ public static PatchSubnetworkHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -211,9 +238,6 @@ public Builder mergeFrom(PatchSubnetworkHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +268,6 @@ public Builder mergeFrom(PatchSubnetworkHttpRequest other) { Builder(PatchSubnetworkHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -273,15 +296,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +381,6 @@ public PatchSubnetworkHttpRequest build() { return new PatchSubnetworkHttpRequest( access_token, callback, - fieldMask, fields, key, prettyPrint, @@ -382,7 +395,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -404,9 +416,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +451,6 @@ public boolean equals(Object o) { PatchSubnetworkHttpRequest that = (PatchSubnetworkHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -460,7 +468,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java index ec3e86f9e168..4a4afacb909a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,7 +43,6 @@ public final class PatchUrlMapHttpRequest implements ApiMessage { private PatchUrlMapHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -54,7 +56,6 @@ private PatchUrlMapHttpRequest() { private PatchUrlMapHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -65,7 +66,6 @@ private PatchUrlMapHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,72 @@ private PatchUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("urlMapResource") && urlMapResource != null) { + fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } if (fieldName.equals("urlMapResource")) { - return urlMapResource; + return String.valueOf(urlMapResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public UrlMap getApiMessageRequestBody() { return urlMapResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static PatchUrlMapHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -211,9 +237,6 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) { Builder(PatchUrlMapHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public PatchUrlMapHttpRequest build() { return new PatchUrlMapHttpRequest( access_token, callback, - fieldMask, fields, key, prettyPrint, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { PatchUrlMapHttpRequest that = (PatchUrlMapHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java index 2afb86aaf9a3..07f69275395b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -47,18 +52,40 @@ private PathMatcher( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("defaultService") && defaultService != null) { + fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("pathRules") && pathRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (PathRule item : pathRules) { + stringList.add(item.toString()); + } + fieldMap.put("pathRules", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("defaultService")) { - return defaultService; + return String.valueOf(defaultService); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("pathRules")) { - return pathRules; + return String.valueOf(pathRules); } return null; } @@ -69,12 +96,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getDefaultService() { return defaultService; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java index 88bbf46bf25a..968ee3b56b68 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private PathRule(List paths, String service) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("paths")) { - return paths; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("paths") && paths != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : paths) { + stringList.add(item.toString()); + } + fieldMap.put("paths", stringList.build()); } - if (fieldName.equals("service")) { - return service; + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("paths")) { + return String.valueOf(paths); + } + if (fieldName.equals("service")) { + return String.valueOf(service); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java index c27d00c0cf1b..abbed54809b7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private PreviewRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("routerResource")) { - return routerResource; + return String.valueOf(routerResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public Router getApiMessageRequestBody() { return routerResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java index e3522dc027f1..c39ee68b0057 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -82,42 +87,98 @@ private Project( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("commonInstanceMetadata") && commonInstanceMetadata != null) { + fieldMap.put( + "commonInstanceMetadata", + Collections.singletonList(String.valueOf(commonInstanceMetadata))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("defaultServiceAccount") && defaultServiceAccount != null) { + fieldMap.put( + "defaultServiceAccount", + Collections.singletonList(String.valueOf(defaultServiceAccount))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : enabledFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("enabledFeatures", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("quotas") && quotas != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Quota item : quotas) { + stringList.add(item.toString()); + } + fieldMap.put("quotas", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("usageExportLocation") && usageExportLocation != null) { + fieldMap.put( + "usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation))); + } + if (fieldNames.contains("xpnProjectStatus") && xpnProjectStatus != null) { + fieldMap.put("xpnProjectStatus", Collections.singletonList(String.valueOf(xpnProjectStatus))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("commonInstanceMetadata")) { - return commonInstanceMetadata; + return String.valueOf(commonInstanceMetadata); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("defaultServiceAccount")) { - return defaultServiceAccount; + return String.valueOf(defaultServiceAccount); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("enabledFeatures")) { - return enabledFeatures; + return String.valueOf(enabledFeatures); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("quotas")) { - return quotas; + return String.valueOf(quotas); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("usageExportLocation")) { - return usageExportLocation; + return String.valueOf(usageExportLocation); } if (fieldName.equals("xpnProjectStatus")) { - return xpnProjectStatus; + return String.valueOf(xpnProjectStatus); } return null; } @@ -128,12 +189,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Metadata getCommonInstanceMetadata() { return commonInstanceMetadata; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java index cfdf2021f2d7..2d2681b02469 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private ProjectsDisableXpnResourceRequest(XpnResourceId xpnResource) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("xpnResource")) { - return xpnResource; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("xpnResource") && xpnResource != null) { + fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("xpnResource")) { + return String.valueOf(xpnResource); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java index 6711dcfed506..93d202170c86 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private ProjectsEnableXpnResourceRequest(XpnResourceId xpnResource) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("xpnResource")) { - return xpnResource; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("xpnResource") && xpnResource != null) { + fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("xpnResource")) { + return String.valueOf(xpnResource); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java index 3a9c24aaf12d..03735a00d02e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -44,15 +49,34 @@ private ProjectsGetXpnResources( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("resources") && resources != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (XpnResourceId item : resources) { + stringList.add(item.toString()); + } + fieldMap.put("resources", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("resources")) { - return resources; + return String.valueOf(resources); } return null; } @@ -63,12 +87,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java index 9f5602b43fc6..15a07bb7ad48 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private ProjectsListXpnHostsRequest(String organization) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("organization")) { - return organization; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("organization") && organization != null) { + fieldMap.put("organization", Collections.singletonList(String.valueOf(organization))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("organization")) { + return String.valueOf(organization); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java index 0001cdcba466..bec535da0955 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -42,15 +46,30 @@ private Quota(Double limit, String metric, Double usage) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("limit") && limit != null) { + fieldMap.put("limit", Collections.singletonList(String.valueOf(limit))); + } + if (fieldNames.contains("metric") && metric != null) { + fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); + } + if (fieldNames.contains("usage") && usage != null) { + fieldMap.put("usage", Collections.singletonList(String.valueOf(usage))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("limit")) { - return limit; + return String.valueOf(limit); } if (fieldName.equals("metric")) { - return metric; + return String.valueOf(metric); } if (fieldName.equals("usage")) { - return usage; + return String.valueOf(usage); } return null; } @@ -61,12 +80,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Double getLimit() { return limit; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java index e32d17996fb1..f40843794cd0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -42,15 +46,30 @@ private RawDisk(String containerType, String sha1Checksum, String source) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("containerType") && containerType != null) { + fieldMap.put("containerType", Collections.singletonList(String.valueOf(containerType))); + } + if (fieldNames.contains("sha1Checksum") && sha1Checksum != null) { + fieldMap.put("sha1Checksum", Collections.singletonList(String.valueOf(sha1Checksum))); + } + if (fieldNames.contains("source") && source != null) { + fieldMap.put("source", Collections.singletonList(String.valueOf(source))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("containerType")) { - return containerType; + return String.valueOf(containerType); } if (fieldName.equals("sha1Checksum")) { - return sha1Checksum; + return String.valueOf(sha1Checksum); } if (fieldName.equals("source")) { - return source; + return String.valueOf(source); } return null; } @@ -61,12 +80,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getContainerType() { return containerType; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java index 938f45cd1449..fa3fa9b56115 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private RecreateInstancesInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource") + && instanceGroupManagersRecreateInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupManagersRecreateInstancesRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersRecreateInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("instanceGroupManagersRecreateInstancesRequestResource")) { - return instanceGroupManagersRecreateInstancesRequestResource; + return String.valueOf(instanceGroupManagersRecreateInstancesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public InstanceGroupManagersRecreateInstancesRequest getApiMessageRequestBody() return instanceGroupManagersRecreateInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java index 5d8fc03ea2c8..0448b906a2da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,77 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource") + && regionInstanceGroupManagersRecreateRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersRecreateRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersRecreateRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupManagersRecreateRequestResource")) { - return regionInstanceGroupManagersRecreateRequestResource; + return String.valueOf(regionInstanceGroupManagersRecreateRequestResource); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +160,6 @@ public RegionInstanceGroupManagersRecreateRequest getApiMessageRequestBody() { return regionInstanceGroupManagersRecreateRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java index 3628a6bda60c..c445cf9c6833 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,18 +49,36 @@ private Reference(String kind, String referenceType, String referrer, String tar } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("referenceType") && referenceType != null) { + fieldMap.put("referenceType", Collections.singletonList(String.valueOf(referenceType))); + } + if (fieldNames.contains("referrer") && referrer != null) { + fieldMap.put("referrer", Collections.singletonList(String.valueOf(referrer))); + } + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("referenceType")) { - return referenceType; + return String.valueOf(referenceType); } if (fieldName.equals("referrer")) { - return referrer; + return String.valueOf(referrer); } if (fieldName.equals("target")) { - return target; + return String.valueOf(target); } return null; } @@ -67,12 +89,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java index 0d3c8cba1ae1..dfbe4ed281ff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +79,81 @@ private Region( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("quotas") && quotas != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Quota item : quotas) { + stringList.add(item.toString()); + } + fieldMap.put("quotas", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("zones") && zones != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : zones) { + stringList.add(item.toString()); + } + fieldMap.put("zones", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("quotas")) { - return quotas; + return String.valueOf(quotas); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("zones")) { - return zones; + return String.valueOf(zones); } return null; } @@ -114,12 +164,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java index 09562b3cbb11..5ad459a5be6e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RegionAutoscalerList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Autoscaler item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java index b86404389c2c..c32961fffa4e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RegionInstanceGroupList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroup item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java index 861020ed21e7..f1f09b5f5466 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RegionInstanceGroupManagerList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceGroupManager item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java index 87956be472c0..3327c7ebb786 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private RegionInstanceGroupManagersAbandonInstancesRequest(List instance } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java index a4b32543c022..9474e8998620 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private RegionInstanceGroupManagersDeleteInstancesRequest(List instances } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java index 4ae23bf6b182..e02308bfa2fe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private RegionInstanceGroupManagersListInstancesResponse(List m } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("managedInstances")) { - return managedInstances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("managedInstances") && managedInstances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (ManagedInstance item : managedInstances) { + stringList.add(item.toString()); + } + fieldMap.put("managedInstances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("managedInstances")) { + return String.valueOf(managedInstances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java index ba1241f5c9ea..36663c265597 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private RegionInstanceGroupManagersRecreateRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java index e855cb402ec3..937044c58ce1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -41,25 +46,35 @@ private RegionInstanceGroupManagersSetTargetPoolsRequest( } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("fingerprint")) { - return fingerprint; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); } - if (fieldName.equals("targetPools")) { - return targetPools; + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java index 5529a711192c..c4e23696134a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private RegionInstanceGroupManagersSetTemplateRequest(String instanceTemplate) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instanceTemplate")) { - return instanceTemplate; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) { + fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceTemplate")) { + return String.valueOf(instanceTemplate); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java index e97ad0a481a8..59f1430cc6c7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RegionInstanceGroupsListInstances( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceWithNamedPorts item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java index fa62768f170b..d6bfddceb997 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private RegionInstanceGroupsListInstancesRequest(String instanceState, String po } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instanceState")) { - return instanceState; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instanceState") && instanceState != null) { + fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState))); } - if (fieldName.equals("portName")) { - return portName; + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instanceState")) { + return String.valueOf(instanceState); + } + if (fieldName.equals("portName")) { + return String.valueOf(portName); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java index 8e609e19ef37..5f66c8f0a730 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private RegionInstanceGroupsSetNamedPortsRequest(String fingerprint, List> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); } - if (fieldName.equals("namedPorts")) { - return namedPorts; + if (fieldNames.contains("namedPorts") && namedPorts != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (NamedPort item : namedPorts) { + stringList.add(item.toString()); + } + fieldMap.put("namedPorts", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("namedPorts")) { + return String.valueOf(namedPorts); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java index 083b4ad7f70b..a29b6a2d91c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RegionList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Region item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java index 9e372429acbd..e95afb751c71 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private RemoveHealthCheckTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsRemoveHealthCheckRequestResource") + && targetPoolsRemoveHealthCheckRequestResource != null) { + fieldMap.put( + "targetPoolsRemoveHealthCheckRequestResource", + Collections.singletonList(String.valueOf(targetPoolsRemoveHealthCheckRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("targetPoolsRemoveHealthCheckRequestResource")) { - return targetPoolsRemoveHealthCheckRequestResource; + return String.valueOf(targetPoolsRemoveHealthCheckRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public TargetPoolsRemoveHealthCheckRequest getApiMessageRequestBody() { return targetPoolsRemoveHealthCheckRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java index 6459033db189..c9c60f1d8c0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private RemoveInstanceTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetPoolsRemoveInstanceRequestResource") + && targetPoolsRemoveInstanceRequestResource != null) { + fieldMap.put( + "targetPoolsRemoveInstanceRequestResource", + Collections.singletonList(String.valueOf(targetPoolsRemoveInstanceRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("targetPoolsRemoveInstanceRequestResource")) { - return targetPoolsRemoveInstanceRequestResource; + return String.valueOf(targetPoolsRemoveInstanceRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public TargetPoolsRemoveInstanceRequest getApiMessageRequestBody() { return targetPoolsRemoveInstanceRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java index a997c78245e8..3381247f4eea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +78,75 @@ private RemoveInstancesInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsRemoveInstancesRequestResource") + && instanceGroupsRemoveInstancesRequestResource != null) { + fieldMap.put( + "instanceGroupsRemoveInstancesRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsRemoveInstancesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("instanceGroupsRemoveInstancesRequestResource")) { - return instanceGroupsRemoveInstancesRequestResource; + return String.valueOf(instanceGroupsRemoveInstancesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -114,12 +157,6 @@ public InstanceGroupsRemoveInstancesRequest getApiMessageRequestBody() { return instanceGroupsRemoveInstancesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java index 8bd762d6c23d..0416828b172e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private RemovePeeringNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("networksRemovePeeringRequestResource") + && networksRemovePeeringRequestResource != null) { + fieldMap.put( + "networksRemovePeeringRequestResource", + Collections.singletonList(String.valueOf(networksRemovePeeringRequestResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("networksRemovePeeringRequestResource")) { - return networksRemovePeeringRequestResource; + return String.valueOf(networksRemovePeeringRequestResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public NetworksRemovePeeringRequest getApiMessageRequestBody() { return networksRemovePeeringRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java index 426b99a4e8ae..f18510819b7f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private ResetInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java index 7231c0b99131..46fe780a669e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private ResizeDiskHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("disksResizeRequestResource") && disksResizeRequestResource != null) { + fieldMap.put( + "disksResizeRequestResource", + Collections.singletonList(String.valueOf(disksResizeRequestResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("disk")) { - return disk; + return String.valueOf(disk); } if (fieldName.equals("disksResizeRequestResource")) { - return disksResizeRequestResource; + return String.valueOf(disksResizeRequestResource); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public DisksResizeRequest getApiMessageRequestBody() { return disksResizeRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java index 9fd2f0fbdd49..96e9ecdbcdf8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private ResizeInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("size") && size != null) { + fieldMap.put("size", Collections.singletonList(String.valueOf(size))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("size")) { - return size; + return String.valueOf(size); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java index 9ad8bcb64ff6..867324d35a91 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private ResizeRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("size") && size != null) { + fieldMap.put("size", Collections.singletonList(String.valueOf(size))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("size")) { - return size; + return String.valueOf(size); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java index c48fcbb28ff5..32d6d8680d97 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private ResourceCommitment(String amount, String type) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("amount")) { - return amount; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("amount") && amount != null) { + fieldMap.put("amount", Collections.singletonList(String.valueOf(amount))); } - if (fieldName.equals("type")) { - return type; + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("amount")) { + return String.valueOf(amount); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java index 5b6876d4274b..c0af2934011c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private ResourceGroupReference(String group) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("group")) { - return group; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("group") && group != null) { + fieldMap.put("group", Collections.singletonList(String.valueOf(group))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("group")) { + return String.valueOf(group); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java index 5787127134b3..c98eb0299c8a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -102,57 +107,123 @@ private Route( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("destRange") && destRange != null) { + fieldMap.put("destRange", Collections.singletonList(String.valueOf(destRange))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("nextHopGateway") && nextHopGateway != null) { + fieldMap.put("nextHopGateway", Collections.singletonList(String.valueOf(nextHopGateway))); + } + if (fieldNames.contains("nextHopInstance") && nextHopInstance != null) { + fieldMap.put("nextHopInstance", Collections.singletonList(String.valueOf(nextHopInstance))); + } + if (fieldNames.contains("nextHopIp") && nextHopIp != null) { + fieldMap.put("nextHopIp", Collections.singletonList(String.valueOf(nextHopIp))); + } + if (fieldNames.contains("nextHopNetwork") && nextHopNetwork != null) { + fieldMap.put("nextHopNetwork", Collections.singletonList(String.valueOf(nextHopNetwork))); + } + if (fieldNames.contains("nextHopPeering") && nextHopPeering != null) { + fieldMap.put("nextHopPeering", Collections.singletonList(String.valueOf(nextHopPeering))); + } + if (fieldNames.contains("nextHopVpnTunnel") && nextHopVpnTunnel != null) { + fieldMap.put("nextHopVpnTunnel", Collections.singletonList(String.valueOf(nextHopVpnTunnel))); + } + if (fieldNames.contains("priority") && priority != null) { + fieldMap.put("priority", Collections.singletonList(String.valueOf(priority))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("tags") && tags != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : tags) { + stringList.add(item.toString()); + } + fieldMap.put("tags", stringList.build()); + } + if (fieldNames.contains("warnings") && warnings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Warnings item : warnings) { + stringList.add(item.toString()); + } + fieldMap.put("warnings", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("destRange")) { - return destRange; + return String.valueOf(destRange); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("nextHopGateway")) { - return nextHopGateway; + return String.valueOf(nextHopGateway); } if (fieldName.equals("nextHopInstance")) { - return nextHopInstance; + return String.valueOf(nextHopInstance); } if (fieldName.equals("nextHopIp")) { - return nextHopIp; + return String.valueOf(nextHopIp); } if (fieldName.equals("nextHopNetwork")) { - return nextHopNetwork; + return String.valueOf(nextHopNetwork); } if (fieldName.equals("nextHopPeering")) { - return nextHopPeering; + return String.valueOf(nextHopPeering); } if (fieldName.equals("nextHopVpnTunnel")) { - return nextHopVpnTunnel; + return String.valueOf(nextHopVpnTunnel); } if (fieldName.equals("priority")) { - return priority; + return String.valueOf(priority); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("tags")) { - return tags; + return String.valueOf(tags); } if (fieldName.equals("warnings")) { - return warnings; + return String.valueOf(warnings); } return null; } @@ -163,12 +234,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java index 49dadda25cc1..82cdccf0d624 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RouteList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java index a4f548b9a72a..e97c03183b29 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -78,39 +83,87 @@ private Router( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bgp") && bgp != null) { + fieldMap.put("bgp", Collections.singletonList(String.valueOf(bgp))); + } + if (fieldNames.contains("bgpPeers") && bgpPeers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterBgpPeer item : bgpPeers) { + stringList.add(item.toString()); + } + fieldMap.put("bgpPeers", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("interfaces") && interfaces != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterInterface item : interfaces) { + stringList.add(item.toString()); + } + fieldMap.put("interfaces", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("bgp")) { - return bgp; + return String.valueOf(bgp); } if (fieldName.equals("bgpPeers")) { - return bgpPeers; + return String.valueOf(bgpPeers); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("interfaces")) { - return interfaces; + return String.valueOf(interfaces); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -121,12 +174,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public RouterBgp getBgp() { return bgp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java index 993cfe8968f3..d740b89abec4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private RouterAdvertisedIpRange(String description, String range) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("description")) { - return description; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } - if (fieldName.equals("range")) { - return range; + if (fieldNames.contains("range") && range != null) { + fieldMap.put("range", Collections.singletonList(String.valueOf(range))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("description")) { + return String.valueOf(description); + } + if (fieldName.equals("range")) { + return String.valueOf(range); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java index dc85b2cc9a5c..cff265feafde 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private RouterAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java index bedca25c58d3..0aebfe3071b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -50,18 +55,44 @@ private RouterBgp( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("advertiseMode") && advertiseMode != null) { + fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode))); + } + if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : advertisedGroups) { + stringList.add(item.toString()); + } + fieldMap.put("advertisedGroups", stringList.build()); + } + if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterAdvertisedIpRange item : advertisedIpRanges) { + stringList.add(item.toString()); + } + fieldMap.put("advertisedIpRanges", stringList.build()); + } + if (fieldNames.contains("asn") && asn != null) { + fieldMap.put("asn", Collections.singletonList(String.valueOf(asn))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("advertiseMode")) { - return advertiseMode; + return String.valueOf(advertiseMode); } if (fieldName.equals("advertisedGroups")) { - return advertisedGroups; + return String.valueOf(advertisedGroups); } if (fieldName.equals("advertisedIpRanges")) { - return advertisedIpRanges; + return String.valueOf(advertisedIpRanges); } if (fieldName.equals("asn")) { - return asn; + return String.valueOf(asn); } return null; } @@ -72,12 +103,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAdvertiseMode() { return advertiseMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java index 1667284e364c..2520f0b75206 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -70,33 +75,76 @@ private RouterBgpPeer( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("advertiseMode") && advertiseMode != null) { + fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode))); + } + if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : advertisedGroups) { + stringList.add(item.toString()); + } + fieldMap.put("advertisedGroups", stringList.build()); + } + if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterAdvertisedIpRange item : advertisedIpRanges) { + stringList.add(item.toString()); + } + fieldMap.put("advertisedIpRanges", stringList.build()); + } + if (fieldNames.contains("advertisedRoutePriority") && advertisedRoutePriority != null) { + fieldMap.put( + "advertisedRoutePriority", + Collections.singletonList(String.valueOf(advertisedRoutePriority))); + } + if (fieldNames.contains("interfaceName") && interfaceName != null) { + fieldMap.put("interfaceName", Collections.singletonList(String.valueOf(interfaceName))); + } + if (fieldNames.contains("ipAddress") && ipAddress != null) { + fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerAsn") && peerAsn != null) { + fieldMap.put("peerAsn", Collections.singletonList(String.valueOf(peerAsn))); + } + if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { + fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("advertiseMode")) { - return advertiseMode; + return String.valueOf(advertiseMode); } if (fieldName.equals("advertisedGroups")) { - return advertisedGroups; + return String.valueOf(advertisedGroups); } if (fieldName.equals("advertisedIpRanges")) { - return advertisedIpRanges; + return String.valueOf(advertisedIpRanges); } if (fieldName.equals("advertisedRoutePriority")) { - return advertisedRoutePriority; + return String.valueOf(advertisedRoutePriority); } if (fieldName.equals("interfaceName")) { - return interfaceName; + return String.valueOf(interfaceName); } if (fieldName.equals("ipAddress")) { - return ipAddress; + return String.valueOf(ipAddress); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("peerAsn")) { - return peerAsn; + return String.valueOf(peerAsn); } if (fieldName.equals("peerIpAddress")) { - return peerIpAddress; + return String.valueOf(peerIpAddress); } return null; } @@ -107,12 +155,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAdvertiseMode() { return advertiseMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java index 90b406d53037..2685c57f2a0a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -46,18 +50,39 @@ private RouterInterface( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipRange") && ipRange != null) { + fieldMap.put("ipRange", Collections.singletonList(String.valueOf(ipRange))); + } + if (fieldNames.contains("linkedInterconnectAttachment") + && linkedInterconnectAttachment != null) { + fieldMap.put( + "linkedInterconnectAttachment", + Collections.singletonList(String.valueOf(linkedInterconnectAttachment))); + } + if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) { + fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("ipRange")) { - return ipRange; + return String.valueOf(ipRange); } if (fieldName.equals("linkedInterconnectAttachment")) { - return linkedInterconnectAttachment; + return String.valueOf(linkedInterconnectAttachment); } if (fieldName.equals("linkedVpnTunnel")) { - return linkedVpnTunnel; + return String.valueOf(linkedVpnTunnel); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } return null; } @@ -68,12 +93,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getIpRange() { return ipRange; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java index cc8bd25b138d..6a1c16d705b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private RouterList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Router item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java index ed6892ffe4aa..87cb1f3d6c20 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -50,18 +55,48 @@ private RouterStatus( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bestRoutes") && bestRoutes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : bestRoutes) { + stringList.add(item.toString()); + } + fieldMap.put("bestRoutes", stringList.build()); + } + if (fieldNames.contains("bestRoutesForRouter") && bestRoutesForRouter != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : bestRoutesForRouter) { + stringList.add(item.toString()); + } + fieldMap.put("bestRoutesForRouter", stringList.build()); + } + if (fieldNames.contains("bgpPeerStatus") && bgpPeerStatus != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (RouterStatusBgpPeerStatus item : bgpPeerStatus) { + stringList.add(item.toString()); + } + fieldMap.put("bgpPeerStatus", stringList.build()); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("bestRoutes")) { - return bestRoutes; + return String.valueOf(bestRoutes); } if (fieldName.equals("bestRoutesForRouter")) { - return bestRoutesForRouter; + return String.valueOf(bestRoutesForRouter); } if (fieldName.equals("bgpPeerStatus")) { - return bgpPeerStatus; + return String.valueOf(bgpPeerStatus); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } return null; } @@ -72,12 +107,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getBestRoutesList() { return bestRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java index 19e08605fdb3..abf4198ec76f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +79,76 @@ private RouterStatusBgpPeerStatus( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("advertisedRoutes") && advertisedRoutes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Route item : advertisedRoutes) { + stringList.add(item.toString()); + } + fieldMap.put("advertisedRoutes", stringList.build()); + } + if (fieldNames.contains("ipAddress") && ipAddress != null) { + fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress))); + } + if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) { + fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("numLearnedRoutes") && numLearnedRoutes != null) { + fieldMap.put("numLearnedRoutes", Collections.singletonList(String.valueOf(numLearnedRoutes))); + } + if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) { + fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress))); + } + if (fieldNames.contains("state") && state != null) { + fieldMap.put("state", Collections.singletonList(String.valueOf(state))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("uptime") && uptime != null) { + fieldMap.put("uptime", Collections.singletonList(String.valueOf(uptime))); + } + if (fieldNames.contains("uptimeSeconds") && uptimeSeconds != null) { + fieldMap.put("uptimeSeconds", Collections.singletonList(String.valueOf(uptimeSeconds))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("advertisedRoutes")) { - return advertisedRoutes; + return String.valueOf(advertisedRoutes); } if (fieldName.equals("ipAddress")) { - return ipAddress; + return String.valueOf(ipAddress); } if (fieldName.equals("linkedVpnTunnel")) { - return linkedVpnTunnel; + return String.valueOf(linkedVpnTunnel); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("numLearnedRoutes")) { - return numLearnedRoutes; + return String.valueOf(numLearnedRoutes); } if (fieldName.equals("peerIpAddress")) { - return peerIpAddress; + return String.valueOf(peerIpAddress); } if (fieldName.equals("state")) { - return state; + return String.valueOf(state); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("uptime")) { - return uptime; + return String.valueOf(uptime); } if (fieldName.equals("uptimeSeconds")) { - return uptimeSeconds; + return String.valueOf(uptimeSeconds); } return null; } @@ -114,12 +159,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getAdvertisedRoutesList() { return advertisedRoutes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java index 270f2fe8ff9d..b00558dd3b1f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private RouterStatusResponse(String kind, RouterStatus result) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("kind")) { - return kind; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } - if (fieldName.equals("result")) { - return result; + if (fieldNames.contains("result") && result != null) { + fieldMap.put("result", Collections.singletonList(String.valueOf(result))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("result")) { + return String.valueOf(result); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java index cfe2dec432e7..c1311f4462c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private RoutersPreviewResponse(Router resource) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("resource")) { - return resource; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java index 2b101ef397ac..77858274e19e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private RoutersScopedList(List routers, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("routers")) { - return routers; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("routers") && routers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Router item : routers) { + stringList.add(item.toString()); + } + fieldMap.put("routers", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("routers")) { + return String.valueOf(routers); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java index 608db5cc07ce..cf70e23f88da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,21 +53,42 @@ private SSLHealthCheck( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("request") && request != null) { + fieldMap.put("request", Collections.singletonList(String.valueOf(request))); + } + if (fieldNames.contains("response") && response != null) { + fieldMap.put("response", Collections.singletonList(String.valueOf(response))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("port")) { - return port; + return String.valueOf(port); } if (fieldName.equals("portName")) { - return portName; + return String.valueOf(portName); } if (fieldName.equals("proxyHeader")) { - return proxyHeader; + return String.valueOf(proxyHeader); } if (fieldName.equals("request")) { - return request; + return String.valueOf(request); } if (fieldName.equals("response")) { - return response; + return String.valueOf(response); } return null; } @@ -74,12 +99,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Integer getPort() { return port; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java index 9b44ee823a01..b6dede48f68e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -42,15 +46,31 @@ private Scheduling(Boolean automaticRestart, String onHostMaintenance, Boolean p } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("automaticRestart") && automaticRestart != null) { + fieldMap.put("automaticRestart", Collections.singletonList(String.valueOf(automaticRestart))); + } + if (fieldNames.contains("onHostMaintenance") && onHostMaintenance != null) { + fieldMap.put( + "onHostMaintenance", Collections.singletonList(String.valueOf(onHostMaintenance))); + } + if (fieldNames.contains("preemptible") && preemptible != null) { + fieldMap.put("preemptible", Collections.singletonList(String.valueOf(preemptible))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("automaticRestart")) { - return automaticRestart; + return String.valueOf(automaticRestart); } if (fieldName.equals("onHostMaintenance")) { - return onHostMaintenance; + return String.valueOf(onHostMaintenance); } if (fieldName.equals("preemptible")) { - return preemptible; + return String.valueOf(preemptible); } return null; } @@ -61,12 +81,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Boolean getAutomaticRestart() { return automaticRestart; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java index e806a83522e6..5001ccf5668c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private ScratchDisks(Integer diskGb) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("diskGb")) { - return diskGb; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("diskGb") && diskGb != null) { + fieldMap.put("diskGb", Collections.singletonList(String.valueOf(diskGb))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("diskGb")) { + return String.valueOf(diskGb); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java index 176456887caf..4753665af903 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,21 +53,42 @@ private SerialPortOutput( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("contents") && contents != null) { + fieldMap.put("contents", Collections.singletonList(String.valueOf(contents))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("next") && next != null) { + fieldMap.put("next", Collections.singletonList(String.valueOf(next))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("start") && start != null) { + fieldMap.put("start", Collections.singletonList(String.valueOf(start))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("contents")) { - return contents; + return String.valueOf(contents); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("next")) { - return next; + return String.valueOf(next); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("start")) { - return start; + return String.valueOf(start); } return null; } @@ -74,12 +99,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getContents() { return contents; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java index b21d731cf495..2bc312927530 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private ServiceAccount(String email, List scopes) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("email")) { - return email; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("email") && email != null) { + fieldMap.put("email", Collections.singletonList(String.valueOf(email))); } - if (fieldName.equals("scopes")) { - return scopes; + if (fieldNames.contains("scopes") && scopes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : scopes) { + stringList.add(item.toString()); + } + fieldMap.put("scopes", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("email")) { + return String.valueOf(email); + } + if (fieldName.equals("scopes")) { + return String.valueOf(scopes); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java index 94915ed07aa1..ec0cedce49c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,76 @@ private SetBackendServiceTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource") + && targetSslProxiesSetBackendServiceRequestResource != null) { + fieldMap.put( + "targetSslProxiesSetBackendServiceRequestResource", + Collections.singletonList( + String.valueOf(targetSslProxiesSetBackendServiceRequestResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetSslProxiesSetBackendServiceRequestResource")) { - return targetSslProxiesSetBackendServiceRequestResource; + return String.valueOf(targetSslProxiesSetBackendServiceRequestResource); } if (fieldName.equals("targetSslProxy")) { - return targetSslProxy; + return String.valueOf(targetSslProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +159,6 @@ public TargetSslProxiesSetBackendServiceRequest getApiMessageRequestBody() { return targetSslProxiesSetBackendServiceRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java index 5a79262f2ebc..42a0014c88d9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,76 @@ private SetBackendServiceTargetTcpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetTcpProxiesSetBackendServiceRequestResource") + && targetTcpProxiesSetBackendServiceRequestResource != null) { + fieldMap.put( + "targetTcpProxiesSetBackendServiceRequestResource", + Collections.singletonList( + String.valueOf(targetTcpProxiesSetBackendServiceRequestResource))); + } + if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { + fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetTcpProxiesSetBackendServiceRequestResource")) { - return targetTcpProxiesSetBackendServiceRequestResource; + return String.valueOf(targetTcpProxiesSetBackendServiceRequestResource); } if (fieldName.equals("targetTcpProxy")) { - return targetTcpProxy; + return String.valueOf(targetTcpProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +159,6 @@ public TargetTcpProxiesSetBackendServiceRequest getApiMessageRequestBody() { return targetTcpProxiesSetBackendServiceRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java index a8ff1c84b873..64316ee60f46 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,80 @@ private SetBackupTargetPoolHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("failoverRatio") && failoverRatio != null) { + fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetPool") && targetPool != null) { + fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); + } + if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("failoverRatio")) { - return failoverRatio; + return String.valueOf(failoverRatio); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetPool")) { - return targetPool; + return String.valueOf(targetPool); } if (fieldName.equals("targetReferenceResource")) { - return targetReferenceResource; + return String.valueOf(targetReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +165,6 @@ public TargetReference getApiMessageRequestBody() { return targetReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java index 7ef2f549c852..e1067dfacdec 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private SetCommonInstanceMetadataProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("metadataResource") && metadataResource != null) { + fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("metadataResource")) { - return metadataResource; + return String.valueOf(metadataResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Metadata getApiMessageRequestBody() { return metadataResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java index 25ddb9bee5c3..74dc10f99e02 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private SetDeletionProtectionInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deletionProtection") && deletionProtection != null) { + fieldMap.put( + "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("deletionProtection")) { - return deletionProtection; + return String.valueOf(deletionProtection); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("resource")) { - return resource; + return String.valueOf(resource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java index 1d68a7549b97..c71d726e3203 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,78 @@ private SetDiskAutoDeleteInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoDelete") && autoDelete != null) { + fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("deviceName") && deviceName != null) { + fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoDelete")) { - return autoDelete; + return String.valueOf(autoDelete); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("deviceName")) { - return deviceName; + return String.valueOf(deviceName); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +163,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java index 4b2b5108df78..42d118e74ec8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersSetInstanceTemplateRequestResource") + && instanceGroupManagersSetInstanceTemplateRequestResource != null) { + fieldMap.put( + "instanceGroupManagersSetInstanceTemplateRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("instanceGroupManagersSetInstanceTemplateRequestResource")) { - return instanceGroupManagersSetInstanceTemplateRequestResource; + return String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public InstanceGroupManagersSetInstanceTemplateRequest getApiMessageRequestBody( return instanceGroupManagersSetInstanceTemplateRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java index 6465fd01f274..04073eee5b98 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource") + && regionInstanceGroupManagersSetTemplateRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersSetTemplateRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupManagersSetTemplateRequestResource")) { - return regionInstanceGroupManagersSetTemplateRequestResource; + return String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public RegionInstanceGroupManagersSetTemplateRequest getApiMessageRequestBody() return regionInstanceGroupManagersSetTemplateRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java index 5169b551ebaf..f3217f2bce48 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetLabelsDiskHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zoneSetLabelsRequestResource") + && zoneSetLabelsRequestResource != null) { + fieldMap.put( + "zoneSetLabelsRequestResource", + Collections.singletonList(String.valueOf(zoneSetLabelsRequestResource))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("resource")) { - return resource; + return String.valueOf(resource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zoneSetLabelsRequestResource")) { - return zoneSetLabelsRequestResource; + return String.valueOf(zoneSetLabelsRequestResource); } return null; } @@ -113,12 +156,6 @@ public ZoneSetLabelsRequest getApiMessageRequestBody() { return zoneSetLabelsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java index 71baf086694e..20b77f6a94ac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private SetLabelsImageHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("globalSetLabelsRequestResource") + && globalSetLabelsRequestResource != null) { + fieldMap.put( + "globalSetLabelsRequestResource", + Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("globalSetLabelsRequestResource")) { - return globalSetLabelsRequestResource; + return String.valueOf(globalSetLabelsRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("resource")) { - return resource; + return String.valueOf(resource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public GlobalSetLabelsRequest getApiMessageRequestBody() { return globalSetLabelsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java index 057e08320ac4..be8e7c4200b6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetLabelsInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetLabelsRequestResource") + && instancesSetLabelsRequestResource != null) { + fieldMap.put( + "instancesSetLabelsRequestResource", + Collections.singletonList(String.valueOf(instancesSetLabelsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instancesSetLabelsRequestResource")) { - return instancesSetLabelsRequestResource; + return String.valueOf(instancesSetLabelsRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstancesSetLabelsRequest getApiMessageRequestBody() { return instancesSetLabelsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java index f61d9205e66d..5b4d0d82e0f8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private SetLabelsSnapshotHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("globalSetLabelsRequestResource") + && globalSetLabelsRequestResource != null) { + fieldMap.put( + "globalSetLabelsRequestResource", + Collections.singletonList(String.valueOf(globalSetLabelsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("globalSetLabelsRequestResource")) { - return globalSetLabelsRequestResource; + return String.valueOf(globalSetLabelsRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("resource")) { - return resource; + return String.valueOf(resource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public GlobalSetLabelsRequest getApiMessageRequestBody() { return globalSetLabelsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java index 8f112ba95cea..ff4e738a7a9f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetMachineResourcesInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetMachineResourcesRequestResource") + && instancesSetMachineResourcesRequestResource != null) { + fieldMap.put( + "instancesSetMachineResourcesRequestResource", + Collections.singletonList(String.valueOf(instancesSetMachineResourcesRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instancesSetMachineResourcesRequestResource")) { - return instancesSetMachineResourcesRequestResource; + return String.valueOf(instancesSetMachineResourcesRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstancesSetMachineResourcesRequest getApiMessageRequestBody() { return instancesSetMachineResourcesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java index 7badaf6cfdfe..87e1801f599a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetMachineTypeInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetMachineTypeRequestResource") + && instancesSetMachineTypeRequestResource != null) { + fieldMap.put( + "instancesSetMachineTypeRequestResource", + Collections.singletonList(String.valueOf(instancesSetMachineTypeRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instancesSetMachineTypeRequestResource")) { - return instancesSetMachineTypeRequestResource; + return String.valueOf(instancesSetMachineTypeRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstancesSetMachineTypeRequest getApiMessageRequestBody() { return instancesSetMachineTypeRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java index 55cea5ad9886..2df6c66b6f3d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private SetMetadataInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("metadataResource") && metadataResource != null) { + fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("metadataResource")) { - return metadataResource; + return String.valueOf(metadataResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Metadata getApiMessageRequestBody() { return metadataResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java index fdbef21a1e7f..7f23570801a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetMinCpuPlatformInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetMinCpuPlatformRequestResource") + && instancesSetMinCpuPlatformRequestResource != null) { + fieldMap.put( + "instancesSetMinCpuPlatformRequestResource", + Collections.singletonList(String.valueOf(instancesSetMinCpuPlatformRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instancesSetMinCpuPlatformRequestResource")) { - return instancesSetMinCpuPlatformRequestResource; + return String.valueOf(instancesSetMinCpuPlatformRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstancesSetMinCpuPlatformRequest getApiMessageRequestBody() { return instancesSetMinCpuPlatformRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java index deb3334abff7..62658c55ce77 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetNamedPortsInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("instanceGroupsSetNamedPortsRequestResource") + && instanceGroupsSetNamedPortsRequestResource != null) { + fieldMap.put( + "instanceGroupsSetNamedPortsRequestResource", + Collections.singletonList(String.valueOf(instanceGroupsSetNamedPortsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("instanceGroupsSetNamedPortsRequestResource")) { - return instanceGroupsSetNamedPortsRequestResource; + return String.valueOf(instanceGroupsSetNamedPortsRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() { return instanceGroupsSetNamedPortsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java index 8557570e6ce3..9ac402efdc3d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,76 @@ private SetNamedPortsRegionInstanceGroupHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroup") && instanceGroup != null) { + fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource") + && regionInstanceGroupsSetNamedPortsRequestResource != null) { + fieldMap.put( + "regionInstanceGroupsSetNamedPortsRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroup")) { - return instanceGroup; + return String.valueOf(instanceGroup); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupsSetNamedPortsRequestResource")) { - return regionInstanceGroupsSetNamedPortsRequestResource; + return String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +159,6 @@ public RegionInstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() { return regionInstanceGroupsSetNamedPortsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java index f94b3e6f4f67..773951397df8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,76 @@ private SetPrivateIpGoogleAccessSubnetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("subnetwork") && subnetwork != null) { + fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); + } + if (fieldNames.contains("subnetworksSetPrivateIpGoogleAccessRequestResource") + && subnetworksSetPrivateIpGoogleAccessRequestResource != null) { + fieldMap.put( + "subnetworksSetPrivateIpGoogleAccessRequestResource", + Collections.singletonList( + String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("subnetwork")) { - return subnetwork; + return String.valueOf(subnetwork); } if (fieldName.equals("subnetworksSetPrivateIpGoogleAccessRequestResource")) { - return subnetworksSetPrivateIpGoogleAccessRequestResource; + return String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +159,6 @@ public SubnetworksSetPrivateIpGoogleAccessRequest getApiMessageRequestBody() { return subnetworksSetPrivateIpGoogleAccessRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java index 940b1957222d..13b0df6fae62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +78,75 @@ private SetProxyHeaderTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource") + && targetSslProxiesSetProxyHeaderRequestResource != null) { + fieldMap.put( + "targetSslProxiesSetProxyHeaderRequestResource", + Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetSslProxiesSetProxyHeaderRequestResource")) { - return targetSslProxiesSetProxyHeaderRequestResource; + return String.valueOf(targetSslProxiesSetProxyHeaderRequestResource); } if (fieldName.equals("targetSslProxy")) { - return targetSslProxy; + return String.valueOf(targetSslProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -114,12 +157,6 @@ public TargetSslProxiesSetProxyHeaderRequest getApiMessageRequestBody() { return targetSslProxiesSetProxyHeaderRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java index 97bcded5875d..4c2535a0ef40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +78,75 @@ private SetProxyHeaderTargetTcpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetTcpProxiesSetProxyHeaderRequestResource") + && targetTcpProxiesSetProxyHeaderRequestResource != null) { + fieldMap.put( + "targetTcpProxiesSetProxyHeaderRequestResource", + Collections.singletonList(String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource))); + } + if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) { + fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetTcpProxiesSetProxyHeaderRequestResource")) { - return targetTcpProxiesSetProxyHeaderRequestResource; + return String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource); } if (fieldName.equals("targetTcpProxy")) { - return targetTcpProxy; + return String.valueOf(targetTcpProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -114,12 +157,6 @@ public TargetTcpProxiesSetProxyHeaderRequest getApiMessageRequestBody() { return targetTcpProxiesSetProxyHeaderRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java index ab2132538887..a31bdc208c62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,73 @@ private SetSchedulingInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("schedulingResource") && schedulingResource != null) { + fieldMap.put( + "schedulingResource", Collections.singletonList(String.valueOf(schedulingResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("schedulingResource")) { - return schedulingResource; + return String.valueOf(schedulingResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +154,6 @@ public Scheduling getApiMessageRequestBody() { return schedulingResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java index 913fb653a488..346ad7ec664a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,75 @@ private SetServiceAccountInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesSetServiceAccountRequestResource") + && instancesSetServiceAccountRequestResource != null) { + fieldMap.put( + "instancesSetServiceAccountRequestResource", + Collections.singletonList(String.valueOf(instancesSetServiceAccountRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instancesSetServiceAccountRequestResource")) { - return instancesSetServiceAccountRequestResource; + return String.valueOf(instancesSetServiceAccountRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +156,6 @@ public InstancesSetServiceAccountRequest getApiMessageRequestBody() { return instancesSetServiceAccountRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java index b754e5a5f75a..856b6f8dc764 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,76 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource") + && targetHttpsProxiesSetSslCertificatesRequestResource != null) { + fieldMap.put( + "targetHttpsProxiesSetSslCertificatesRequestResource", + Collections.singletonList( + String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpsProxiesSetSslCertificatesRequestResource")) { - return targetHttpsProxiesSetSslCertificatesRequestResource; + return String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource); } if (fieldName.equals("targetHttpsProxy")) { - return targetHttpsProxy; + return String.valueOf(targetHttpsProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +160,6 @@ public TargetHttpsProxiesSetSslCertificatesRequest getApiMessageRequestBody() { return targetHttpsProxiesSetSslCertificatesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java index ce3278ac073e..e569f57696c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,76 @@ private SetSslCertificatesTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource") + && targetSslProxiesSetSslCertificatesRequestResource != null) { + fieldMap.put( + "targetSslProxiesSetSslCertificatesRequestResource", + Collections.singletonList( + String.valueOf(targetSslProxiesSetSslCertificatesRequestResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetSslProxiesSetSslCertificatesRequestResource")) { - return targetSslProxiesSetSslCertificatesRequestResource; + return String.valueOf(targetSslProxiesSetSslCertificatesRequestResource); } if (fieldName.equals("targetSslProxy")) { - return targetSslProxy; + return String.valueOf(targetSslProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +159,6 @@ public TargetSslProxiesSetSslCertificatesRequest getApiMessageRequestBody() { return targetSslProxiesSetSslCertificatesRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java index 2b355c09bdc8..57545bbf899e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetSslPolicyTargetHttpsProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) { + fieldMap.put( + "sslPolicyReferenceResource", + Collections.singletonList(String.valueOf(sslPolicyReferenceResource))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslPolicyReferenceResource")) { - return sslPolicyReferenceResource; + return String.valueOf(sslPolicyReferenceResource); } if (fieldName.equals("targetHttpsProxy")) { - return targetHttpsProxy; + return String.valueOf(targetHttpsProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public SslPolicyReference getApiMessageRequestBody() { return sslPolicyReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java index 187704c3d2dd..b690cf4f02c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetSslPolicyTargetSslProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) { + fieldMap.put( + "sslPolicyReferenceResource", + Collections.singletonList(String.valueOf(sslPolicyReferenceResource))); + } + if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) { + fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("sslPolicyReferenceResource")) { - return sslPolicyReferenceResource; + return String.valueOf(sslPolicyReferenceResource); } if (fieldName.equals("targetSslProxy")) { - return targetSslProxy; + return String.valueOf(targetSslProxy); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public SslPolicyReference getApiMessageRequestBody() { return sslPolicyReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java index c04373e8a529..dcb381e82c3c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,72 @@ private SetTagsInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("tagsResource") && tagsResource != null) { + fieldMap.put("tagsResource", Collections.singletonList(String.valueOf(tagsResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("tagsResource")) { - return tagsResource; + return String.valueOf(tagsResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +153,6 @@ public Tags getApiMessageRequestBody() { return tagsResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java index 0f4011f2ca43..8d715bdd6461 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetTargetForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRule")) { - return forwardingRule; + return String.valueOf(forwardingRule); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetReferenceResource")) { - return targetReferenceResource; + return String.valueOf(targetReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetReference getApiMessageRequestBody() { return targetReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java index 591c84ce4079..5d90c0309c54 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetTargetGlobalForwardingRuleHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("forwardingRule") && forwardingRule != null) { + fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) { + fieldMap.put( + "targetReferenceResource", + Collections.singletonList(String.valueOf(targetReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("forwardingRule")) { - return forwardingRule; + return String.valueOf(forwardingRule); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetReferenceResource")) { - return targetReferenceResource; + return String.valueOf(targetReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public TargetReference getApiMessageRequestBody() { return targetReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java index de3e6724cc64..b41902cfd6ea 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,77 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("instanceGroupManagersSetTargetPoolsRequestResource") + && instanceGroupManagersSetTargetPoolsRequestResource != null) { + fieldMap.put( + "instanceGroupManagersSetTargetPoolsRequestResource", + Collections.singletonList( + String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("instanceGroupManagersSetTargetPoolsRequestResource")) { - return instanceGroupManagersSetTargetPoolsRequestResource; + return String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +160,6 @@ public InstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody() { return instanceGroupManagersSetTargetPoolsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java index b99e289db6b9..d1f6bd78f19b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -76,36 +80,77 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { + fieldMap.put( + "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource") + && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) { + fieldMap.put( + "regionInstanceGroupManagersSetTargetPoolsRequestResource", + Collections.singletonList( + String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instanceGroupManager")) { - return instanceGroupManager; + return String.valueOf(instanceGroupManager); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("regionInstanceGroupManagersSetTargetPoolsRequestResource")) { - return regionInstanceGroupManagersSetTargetPoolsRequestResource; + return String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -116,12 +161,6 @@ public RegionInstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody return regionInstanceGroupManagersSetTargetPoolsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java index fc43374f5e9f..cb03dc8c68b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetUrlMapTargetHttpProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) { + fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy))); + } + if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { + fieldMap.put( + "urlMapReferenceResource", + Collections.singletonList(String.valueOf(urlMapReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpProxy")) { - return targetHttpProxy; + return String.valueOf(targetHttpProxy); } if (fieldName.equals("urlMapReferenceResource")) { - return urlMapReferenceResource; + return String.valueOf(urlMapReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public UrlMapReference getApiMessageRequestBody() { return urlMapReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java index c886f963980f..00ee948a619b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetUrlMapTargetHttpsProxyHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) { + fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy))); + } + if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) { + fieldMap.put( + "urlMapReferenceResource", + Collections.singletonList(String.valueOf(urlMapReferenceResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("targetHttpsProxy")) { - return targetHttpsProxy; + return String.valueOf(targetHttpsProxy); } if (fieldName.equals("urlMapReferenceResource")) { - return urlMapReferenceResource; + return String.valueOf(urlMapReferenceResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public UrlMapReference getApiMessageRequestBody() { return urlMapReferenceResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java index 4190be522ba5..914272f15daa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,36 +77,74 @@ private SetUsageExportBucketProjectHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("project") && project != null) { + fieldMap.put("project", Collections.singletonList(String.valueOf(project))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("usageExportLocationResource") && usageExportLocationResource != null) { + fieldMap.put( + "usageExportLocationResource", + Collections.singletonList(String.valueOf(usageExportLocationResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("project")) { - return project; + return String.valueOf(project); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("usageExportLocationResource")) { - return usageExportLocationResource; + return String.valueOf(usageExportLocationResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -113,12 +155,6 @@ public UsageExportLocation getApiMessageRequestBody() { return usageExportLocationResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java index 4be6f4617e06..67ac4ed48159 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java @@ -17,10 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -107,60 +111,134 @@ private Snapshot( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { + fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + if (fieldNames.contains("licenseCodes") && licenseCodes != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenseCodes) { + stringList.add(item.toString()); + } + fieldMap.put("licenseCodes", stringList.build()); + } + if (fieldNames.contains("licenses") && licenses != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : licenses) { + stringList.add(item.toString()); + } + fieldMap.put("licenses", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("snapshotEncryptionKey") && snapshotEncryptionKey != null) { + fieldMap.put( + "snapshotEncryptionKey", + Collections.singletonList(String.valueOf(snapshotEncryptionKey))); + } + if (fieldNames.contains("sourceDisk") && sourceDisk != null) { + fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk))); + } + if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) { + fieldMap.put( + "sourceDiskEncryptionKey", + Collections.singletonList(String.valueOf(sourceDiskEncryptionKey))); + } + if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) { + fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("storageBytes") && storageBytes != null) { + fieldMap.put("storageBytes", Collections.singletonList(String.valueOf(storageBytes))); + } + if (fieldNames.contains("storageBytesStatus") && storageBytesStatus != null) { + fieldMap.put( + "storageBytesStatus", Collections.singletonList(String.valueOf(storageBytesStatus))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("diskSizeGb")) { - return diskSizeGb; + return String.valueOf(diskSizeGb); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + return String.valueOf(labelFingerprint); } if (fieldName.equals("labels")) { - return labels; + return String.valueOf(labels); } if (fieldName.equals("licenseCodes")) { - return licenseCodes; + return String.valueOf(licenseCodes); } if (fieldName.equals("licenses")) { - return licenses; + return String.valueOf(licenses); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("snapshotEncryptionKey")) { - return snapshotEncryptionKey; + return String.valueOf(snapshotEncryptionKey); } if (fieldName.equals("sourceDisk")) { - return sourceDisk; + return String.valueOf(sourceDisk); } if (fieldName.equals("sourceDiskEncryptionKey")) { - return sourceDiskEncryptionKey; + return String.valueOf(sourceDiskEncryptionKey); } if (fieldName.equals("sourceDiskId")) { - return sourceDiskId; + return String.valueOf(sourceDiskId); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("storageBytes")) { - return storageBytes; + return String.valueOf(storageBytes); } if (fieldName.equals("storageBytesStatus")) { - return storageBytesStatus; + return String.valueOf(storageBytesStatus); } return null; } @@ -171,12 +249,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java index f1f7ce3efa18..198c12f23451 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private SnapshotList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Snapshot item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java index 3894f3103963..ddd5a6eb3410 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,61 @@ private SslCertificate( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("certificate") && certificate != null) { + fieldMap.put("certificate", Collections.singletonList(String.valueOf(certificate))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("privateKey") && privateKey != null) { + fieldMap.put("privateKey", Collections.singletonList(String.valueOf(privateKey))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("certificate")) { - return certificate; + return String.valueOf(certificate); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("privateKey")) { - return privateKey; + return String.valueOf(privateKey); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -99,12 +134,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCertificate() { return certificate; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java index a787ee087c2c..cbb9a020d13c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private SslCertificateList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (SslCertificate item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java index 01888013fbf9..1f42eb277e9b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private SslPoliciesList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (SslPolicy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java index 83ff4bdd015d..58ef5f0038a9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private SslPoliciesListAvailableFeaturesResponse(List features) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("features")) { - return features; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("features") && features != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : features) { + stringList.add(item.toString()); + } + fieldMap.put("features", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("features")) { + return String.valueOf(features); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java index ae708f653f4c..d002cc4c701f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -82,42 +87,97 @@ private SslPolicy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("customFeatures") && customFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : customFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("customFeatures", stringList.build()); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : enabledFeatures) { + stringList.add(item.toString()); + } + fieldMap.put("enabledFeatures", stringList.build()); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("minTlsVersion") && minTlsVersion != null) { + fieldMap.put("minTlsVersion", Collections.singletonList(String.valueOf(minTlsVersion))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("profile") && profile != null) { + fieldMap.put("profile", Collections.singletonList(String.valueOf(profile))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warnings") && warnings != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Warnings item : warnings) { + stringList.add(item.toString()); + } + fieldMap.put("warnings", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("customFeatures")) { - return customFeatures; + return String.valueOf(customFeatures); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("enabledFeatures")) { - return enabledFeatures; + return String.valueOf(enabledFeatures); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("minTlsVersion")) { - return minTlsVersion; + return String.valueOf(minTlsVersion); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("profile")) { - return profile; + return String.valueOf(profile); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warnings")) { - return warnings; + return String.valueOf(warnings); } return null; } @@ -128,12 +188,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java index 39637920f887..245dfab14d8b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private SslPolicyReference(String sslPolicy) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("sslPolicy")) { - return sslPolicy; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sslPolicy")) { + return String.valueOf(sslPolicy); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java index 4f3f05adc1a0..7903c82a18c7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private StartInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java index b120c69e1c47..6f13286785a2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -75,36 +79,76 @@ private StartWithEncryptionKeyInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("instancesStartWithEncryptionKeyRequestResource") + && instancesStartWithEncryptionKeyRequestResource != null) { + fieldMap.put( + "instancesStartWithEncryptionKeyRequestResource", + Collections.singletonList( + String.valueOf(instancesStartWithEncryptionKeyRequestResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("instancesStartWithEncryptionKeyRequestResource")) { - return instancesStartWithEncryptionKeyRequestResource; + return String.valueOf(instancesStartWithEncryptionKeyRequestResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -115,12 +159,6 @@ public InstancesStartWithEncryptionKeyRequest getApiMessageRequestBody() { return instancesStartWithEncryptionKeyRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java index 5d126ad32e95..5aa9f03aee38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private StopInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java index ea18e7913c88..b5616fa52c1a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -86,45 +91,97 @@ private Subnetwork( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("gatewayAddress") && gatewayAddress != null) { + fieldMap.put("gatewayAddress", Collections.singletonList(String.valueOf(gatewayAddress))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { + fieldMap.put( + "privateIpGoogleAccess", + Collections.singletonList(String.valueOf(privateIpGoogleAccess))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("secondaryIpRanges") && secondaryIpRanges != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (SubnetworkSecondaryRange item : secondaryIpRanges) { + stringList.add(item.toString()); + } + fieldMap.put("secondaryIpRanges", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("gatewayAddress")) { - return gatewayAddress; + return String.valueOf(gatewayAddress); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("ipCidrRange")) { - return ipCidrRange; + return String.valueOf(ipCidrRange); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("privateIpGoogleAccess")) { - return privateIpGoogleAccess; + return String.valueOf(privateIpGoogleAccess); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("secondaryIpRanges")) { - return secondaryIpRanges; + return String.valueOf(secondaryIpRanges); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } return null; } @@ -135,12 +192,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java index 99fd627600a5..947025080ea9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private SubnetworkAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java index 9de9d5baf1f1..5c097934afd2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private SubnetworkList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Subnetwork item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java index eb0308bdfc60..0c9326ec20bd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private SubnetworkSecondaryRange(String ipCidrRange, String rangeName) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("ipCidrRange")) { - return ipCidrRange; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); } - if (fieldName.equals("rangeName")) { - return rangeName; + if (fieldNames.contains("rangeName") && rangeName != null) { + fieldMap.put("rangeName", Collections.singletonList(String.valueOf(rangeName))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } + if (fieldName.equals("rangeName")) { + return String.valueOf(rangeName); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java index ae59ff1ad14a..87ded433931a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private SubnetworksExpandIpCidrRangeRequest(String ipCidrRange) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("ipCidrRange")) { - return ipCidrRange; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { + fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return String.valueOf(ipCidrRange); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java index 5bfb6e7c1222..4e95dd289f18 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private SubnetworksScopedList(List subnetworks, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("subnetworks")) { - return subnetworks; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("subnetworks") && subnetworks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Subnetwork item : subnetworks) { + stringList.add(item.toString()); + } + fieldMap.put("subnetworks", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("subnetworks")) { + return String.valueOf(subnetworks); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java index e58dad72c307..3a1b9d3b878a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,27 @@ private SubnetworksSetPrivateIpGoogleAccessRequest(Boolean privateIpGoogleAccess } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("privateIpGoogleAccess")) { - return privateIpGoogleAccess; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) { + fieldMap.put( + "privateIpGoogleAccess", + Collections.singletonList(String.valueOf(privateIpGoogleAccess))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("privateIpGoogleAccess")) { + return String.valueOf(privateIpGoogleAccess); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java index 3d4356db6fef..9fa3349e9153 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,66 @@ private SwitchToCustomModeNetworkHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +143,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java index 81500de7a425..888316c44aff 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -49,21 +53,42 @@ private TCPHealthCheck( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("port") && port != null) { + fieldMap.put("port", Collections.singletonList(String.valueOf(port))); + } + if (fieldNames.contains("portName") && portName != null) { + fieldMap.put("portName", Collections.singletonList(String.valueOf(portName))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("request") && request != null) { + fieldMap.put("request", Collections.singletonList(String.valueOf(request))); + } + if (fieldNames.contains("response") && response != null) { + fieldMap.put("response", Collections.singletonList(String.valueOf(response))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("port")) { - return port; + return String.valueOf(port); } if (fieldName.equals("portName")) { - return portName; + return String.valueOf(portName); } if (fieldName.equals("proxyHeader")) { - return proxyHeader; + return String.valueOf(proxyHeader); } if (fieldName.equals("request")) { - return request; + return String.valueOf(request); } if (fieldName.equals("response")) { - return response; + return String.valueOf(response); } return null; } @@ -74,12 +99,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public Integer getPort() { return port; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java index ef6f6e0a939b..ac201c3f237e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private Tags(String fingerprint, List items) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("fingerprint")) { - return fingerprint; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); } - if (fieldName.equals("items")) { - return items; + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("fingerprint")) { + return String.valueOf(fingerprint); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java index 8671056aade1..68c65cb2ee9c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,27 +65,55 @@ private TargetHttpProxy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } return null; } @@ -92,12 +124,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java index 550e9be4b4c6..9d7c1cd4ac3c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetHttpProxyList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetHttpProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java index 5b59aff31e11..498d2a85d90c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TargetHttpsProxiesSetSslCertificatesRequest(List sslCertificates } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("sslCertificates")) { - return sslCertificates; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sslCertificates")) { + return String.valueOf(sslCertificates); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java index 357612eca81f..fb8271a9a200 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -70,33 +75,71 @@ private TargetHttpsProxy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sslCertificates")) { - return sslCertificates; + return String.valueOf(sslCertificates); } if (fieldName.equals("sslPolicy")) { - return sslPolicy; + return String.valueOf(sslPolicy); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } return null; } @@ -107,12 +150,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java index e113c6e2b09d..634c86cfb5fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetHttpsProxyList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetHttpsProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java index ae3f4b5cc9ae..2a90d043466a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,67 @@ private TargetInstance( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("natPolicy") && natPolicy != null) { + fieldMap.put("natPolicy", Collections.singletonList(String.valueOf(natPolicy))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("natPolicy")) { - return natPolicy; + return String.valueOf(natPolicy); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -106,12 +144,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java index b53ae8011727..8a1ed62c3cbb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private TargetInstanceAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java index 991a0d378693..62be4396490b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetInstanceList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetInstance item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java index 64398288fc9b..6841771a144c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private TargetInstancesScopedList(List targetInstances, Warning } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("targetInstances")) { - return targetInstances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("targetInstances") && targetInstances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetInstance item : targetInstances) { + stringList.add(item.toString()); + } + fieldMap.put("targetInstances", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("targetInstances")) { + return String.valueOf(targetInstances); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java index eec752881690..449ec391fcfc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -82,42 +87,93 @@ private TargetPool( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("backupPool") && backupPool != null) { + fieldMap.put("backupPool", Collections.singletonList(String.valueOf(backupPool))); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("failoverRatio") && failoverRatio != null) { + fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio))); + } + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) { + fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("backupPool")) { - return backupPool; + return String.valueOf(backupPool); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("failoverRatio")) { - return failoverRatio; + return String.valueOf(failoverRatio); } if (fieldName.equals("healthChecks")) { - return healthChecks; + return String.valueOf(healthChecks); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("instances")) { - return instances; + return String.valueOf(instances); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sessionAffinity")) { - return sessionAffinity; + return String.valueOf(sessionAffinity); } return null; } @@ -128,12 +184,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getBackupPool() { return backupPool; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java index 52e333905b9f..534839707fa1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private TargetPoolAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java index 4cf8e8c1d042..de34cf340414 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private TargetPoolInstanceHealth(List healthStatus, String kind) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("healthStatus")) { - return healthStatus; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthStatus") && healthStatus != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthStatus item : healthStatus) { + stringList.add(item.toString()); + } + fieldMap.put("healthStatus", stringList.build()); } - if (fieldName.equals("kind")) { - return kind; + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthStatus")) { + return String.valueOf(healthStatus); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java index 60e4057ef6b9..a79ad4673848 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetPoolList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetPool item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java index d572f8a1be3f..dc49f449a4b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TargetPoolsAddHealthCheckRequest(List healthChecks } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("healthChecks")) { - return healthChecks; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthCheckReference item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthChecks")) { + return String.valueOf(healthChecks); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java index 5899ad2cbe74..be52b4653521 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TargetPoolsAddInstanceRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java index dbeb40723bee..400b6fcc3f6a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TargetPoolsRemoveHealthCheckRequest(List healthChe } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("healthChecks")) { - return healthChecks; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("healthChecks") && healthChecks != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HealthCheckReference item : healthChecks) { + stringList.add(item.toString()); + } + fieldMap.put("healthChecks", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("healthChecks")) { + return String.valueOf(healthChecks); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java index 3d0c875689d7..c03b31fd48cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TargetPoolsRemoveInstanceRequest(List instances) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("instances")) { - return instances; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("instances") && instances != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (InstanceReference item : instances) { + stringList.add(item.toString()); + } + fieldMap.put("instances", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("instances")) { + return String.valueOf(instances); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java index 8604dac74615..79bc8b5e8db6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private TargetPoolsScopedList(List targetPools, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("targetPools")) { - return targetPools; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("targetPools") && targetPools != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetPool item : targetPools) { + stringList.add(item.toString()); + } + fieldMap.put("targetPools", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("targetPools")) { + return String.valueOf(targetPools); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java index aafe660140e9..c9282e24fafa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private TargetReference(String target) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("target")) { - return target; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("target") && target != null) { + fieldMap.put("target", Collections.singletonList(String.valueOf(target))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("target")) { + return String.valueOf(target); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java index 93585948f5dc..5e811f2cc921 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private TargetSslProxiesSetBackendServiceRequest(String service) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("service")) { - return service; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("service")) { + return String.valueOf(service); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java index 98dc4bf88056..5f1c1b9fc9b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private TargetSslProxiesSetProxyHeaderRequest(String proxyHeader) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("proxyHeader")) { - return proxyHeader; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java index 922cf0239499..9c9b7e8edafc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TargetSslProxiesSetSslCertificatesRequest(List sslCertificates) } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("sslCertificates")) { - return sslCertificates; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sslCertificates")) { + return String.valueOf(sslCertificates); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java index d832bec89020..e0462ced07cf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +79,77 @@ private TargetSslProxy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + if (fieldNames.contains("sslCertificates") && sslCertificates != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : sslCertificates) { + stringList.add(item.toString()); + } + fieldMap.put("sslCertificates", stringList.build()); + } + if (fieldNames.contains("sslPolicy") && sslPolicy != null) { + fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("proxyHeader")) { - return proxyHeader; + return String.valueOf(proxyHeader); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("service")) { - return service; + return String.valueOf(service); } if (fieldName.equals("sslCertificates")) { - return sslCertificates; + return String.valueOf(sslCertificates); } if (fieldName.equals("sslPolicy")) { - return sslPolicy; + return String.valueOf(sslPolicy); } return null; } @@ -114,12 +160,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java index c99a0f47d210..e5c08024a116 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetSslProxyList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetSslProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java index 147e6d889373..d0b6a82b0895 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private TargetTcpProxiesSetBackendServiceRequest(String service) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("service")) { - return service; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("service")) { + return String.valueOf(service); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java index 9e77f3319352..d7a1e88c441e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private TargetTcpProxiesSetProxyHeaderRequest(String proxyHeader) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("proxyHeader")) { - return proxyHeader; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("proxyHeader")) { + return String.valueOf(proxyHeader); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java index b6f7a888ce6c..a694a28320e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -65,30 +69,61 @@ private TargetTcpProxy( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("proxyHeader") && proxyHeader != null) { + fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("proxyHeader")) { - return proxyHeader; + return String.valueOf(proxyHeader); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("service")) { - return service; + return String.valueOf(service); } return null; } @@ -99,12 +134,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java index d7a118c6c3cd..77340a74321c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetTcpProxyList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetTcpProxy item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java index 70d886b3cb8e..43e0beaa5b26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -78,39 +83,87 @@ private TargetVpnGateway( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("forwardingRules") && forwardingRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : forwardingRules) { + stringList.add(item.toString()); + } + fieldMap.put("forwardingRules", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("network") && network != null) { + fieldMap.put("network", Collections.singletonList(String.valueOf(network))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("tunnels") && tunnels != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : tunnels) { + stringList.add(item.toString()); + } + fieldMap.put("tunnels", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("forwardingRules")) { - return forwardingRules; + return String.valueOf(forwardingRules); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("network")) { - return network; + return String.valueOf(network); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("tunnels")) { - return tunnels; + return String.valueOf(tunnels); } return null; } @@ -121,12 +174,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java index e461f3ffcfe8..36337ef7da0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private TargetVpnGatewayAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java index 5c854db00c19..1748b6d159f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private TargetVpnGatewayList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetVpnGateway item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java index 11cbdff73336..81f4c5bbe9ee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private TargetVpnGatewaysScopedList(List targetVpnGateways, Wa } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("targetVpnGateways")) { - return targetVpnGateways; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("targetVpnGateways") && targetVpnGateways != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TargetVpnGateway item : targetVpnGateways) { + stringList.add(item.toString()); + } + fieldMap.put("targetVpnGateways", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("targetVpnGateways")) { + return String.valueOf(targetVpnGateways); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java index df706e89fc10..1604e2e56205 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,18 +49,36 @@ private TestFailure(String actualService, String expectedService, String host, S } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("actualService") && actualService != null) { + fieldMap.put("actualService", Collections.singletonList(String.valueOf(actualService))); + } + if (fieldNames.contains("expectedService") && expectedService != null) { + fieldMap.put("expectedService", Collections.singletonList(String.valueOf(expectedService))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("path") && path != null) { + fieldMap.put("path", Collections.singletonList(String.valueOf(path))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("actualService")) { - return actualService; + return String.valueOf(actualService); } if (fieldName.equals("expectedService")) { - return expectedService; + return String.valueOf(expectedService); } if (fieldName.equals("host")) { - return host; + return String.valueOf(host); } if (fieldName.equals("path")) { - return path; + return String.valueOf(path); } return null; } @@ -67,12 +89,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getActualService() { return actualService; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java index f1ed4d30d813..6efe2d8d36a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private TestIamPermissionsLicenseCodeHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("testPermissionsRequestResource") + && testPermissionsRequestResource != null) { + fieldMap.put( + "testPermissionsRequestResource", + Collections.singletonList(String.valueOf(testPermissionsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("resource")) { - return resource; + return String.valueOf(resource); } if (fieldName.equals("testPermissionsRequestResource")) { - return testPermissionsRequestResource; + return String.valueOf(testPermissionsRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public TestPermissionsRequest getApiMessageRequestBody() { return testPermissionsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java index 3813b199cda8..5406f9caf1bf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private TestIamPermissionsLicenseHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("testPermissionsRequestResource") + && testPermissionsRequestResource != null) { + fieldMap.put( + "testPermissionsRequestResource", + Collections.singletonList(String.valueOf(testPermissionsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("resource")) { - return resource; + return String.valueOf(resource); } if (fieldName.equals("testPermissionsRequestResource")) { - return testPermissionsRequestResource; + return String.valueOf(testPermissionsRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public TestPermissionsRequest getApiMessageRequestBody() { return testPermissionsRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java index ff9b408e5c8b..8dba23a1ec59 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TestPermissionsRequest(List permissions) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("permissions")) { - return permissions; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("permissions") && permissions != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : permissions) { + stringList.add(item.toString()); + } + fieldMap.put("permissions", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("permissions")) { + return String.valueOf(permissions); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java index 8f29bbd7bce2..13f16f8653e7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java @@ -17,9 +17,13 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -37,22 +41,29 @@ private TestPermissionsResponse(List permissions) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("permissions")) { - return permissions; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("permissions") && permissions != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : permissions) { + stringList.add(item.toString()); + } + fieldMap.put("permissions", stringList.build()); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("permissions")) { + return String.valueOf(permissions); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java index 29f7d04ec065..e3e75cba5335 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,39 +81,79 @@ private UpdateAccessConfigInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { + fieldMap.put( + "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); + } + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("accessConfigResource")) { - return accessConfigResource; + return String.valueOf(accessConfigResource); } if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("networkInterface")) { - return networkInterface; + return String.valueOf(networkInterface); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +164,6 @@ public AccessConfig getApiMessageRequestBody() { return accessConfigResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public AccessConfig getAccessConfigResource() { return accessConfigResource; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java index 8f44596273da..b8a2a198ba0b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class UpdateAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,7 +46,6 @@ private UpdateAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -58,7 +60,6 @@ private UpdateAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -70,7 +71,6 @@ private UpdateAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,42 +81,79 @@ private UpdateAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + if (fieldNames.contains("zone") && zone != null) { + fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("autoscalerResource")) { - return autoscalerResource; + return String.valueOf(autoscalerResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } if (fieldName.equals("zone")) { - return zone; + return String.valueOf(zone); } return null; } @@ -127,12 +164,6 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -204,7 +235,6 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -229,9 +259,6 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -261,7 +288,6 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -307,15 +333,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -393,7 +410,6 @@ public UpdateAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, @@ -409,7 +425,6 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -436,9 +451,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -473,7 +485,6 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -492,7 +503,6 @@ public int hashCode() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java index 4c40aef2a060..ac9b68154816 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class UpdateBackendBucketHttpRequest implements ApiMessage { private final String backendBucket; private final BackendBucket backendBucketResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,7 +45,6 @@ private UpdateBackendBucketHttpRequest() { this.backendBucket = null; this.backendBucketResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -56,7 +58,6 @@ private UpdateBackendBucketHttpRequest( String backendBucket, BackendBucket backendBucketResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -67,7 +68,6 @@ private UpdateBackendBucketHttpRequest( this.backendBucket = backendBucket; this.backendBucketResource = backendBucketResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,74 @@ private UpdateBackendBucketHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendBucket") && backendBucket != null) { + fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket))); + } + if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) { + fieldMap.put( + "backendBucketResource", + Collections.singletonList(String.valueOf(backendBucketResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendBucket")) { - return backendBucket; + return String.valueOf(backendBucket); } if (fieldName.equals("backendBucketResource")) { - return backendBucketResource; + return String.valueOf(backendBucketResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +155,6 @@ public BackendBucket getApiMessageRequestBody() { return backendBucketResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -193,7 +222,6 @@ public static class Builder { private String backendBucket; private BackendBucket backendBucketResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -217,9 +245,6 @@ public Builder mergeFrom(UpdateBackendBucketHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -246,7 +271,6 @@ public Builder mergeFrom(UpdateBackendBucketHttpRequest other) { this.backendBucket = source.backendBucket; this.backendBucketResource = source.backendBucketResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -291,15 +315,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -369,7 +384,6 @@ public UpdateBackendBucketHttpRequest build() { backendBucket, backendBucketResource, callback, - fieldMask, fields, key, prettyPrint, @@ -384,7 +398,6 @@ public Builder clone() { newBuilder.setBackendBucket(this.backendBucket); newBuilder.setBackendBucketResource(this.backendBucketResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -410,9 +423,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -444,7 +454,6 @@ public boolean equals(Object o) { && Objects.equals(this.backendBucket, that.getBackendBucket()) && Objects.equals(this.backendBucketResource, that.getBackendBucketResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -462,7 +471,6 @@ public int hashCode() { backendBucket, backendBucketResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java index c2db0a34accb..e403c03d0963 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class UpdateBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,7 +45,6 @@ private UpdateBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -56,7 +58,6 @@ private UpdateBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -67,7 +68,6 @@ private UpdateBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,74 @@ private UpdateBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("backendServiceResource")) { - return backendServiceResource; + return String.valueOf(backendServiceResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +155,6 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -193,7 +222,6 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -217,9 +245,6 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -246,7 +271,6 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -291,15 +315,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -369,7 +384,6 @@ public UpdateBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, @@ -384,7 +398,6 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -410,9 +423,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -444,7 +454,6 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -462,7 +471,6 @@ public int hashCode() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java index bc40d74b3fdc..1859339a9a09 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String firewall; private final Firewall firewallResource; @@ -40,7 +43,6 @@ public final class UpdateFirewallHttpRequest implements ApiMessage { private UpdateFirewallHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.firewall = null; this.firewallResource = null; @@ -54,7 +56,6 @@ private UpdateFirewallHttpRequest() { private UpdateFirewallHttpRequest( String access_token, String callback, - List fieldMask, String fields, String firewall, Firewall firewallResource, @@ -65,7 +66,6 @@ private UpdateFirewallHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.firewall = firewall; this.firewallResource = firewallResource; @@ -77,39 +77,72 @@ private UpdateFirewallHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("firewall") && firewall != null) { + fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall))); + } + if (fieldNames.contains("firewallResource") && firewallResource != null) { + fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("firewall")) { - return firewall; + return String.valueOf(firewall); } if (fieldName.equals("firewallResource")) { - return firewallResource; + return String.valueOf(firewallResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public Firewall getApiMessageRequestBody() { return firewallResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static UpdateFirewallHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String firewall; private Firewall firewallResource; @@ -211,9 +237,6 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) { Builder(UpdateFirewallHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.firewall = source.firewall; this.firewallResource = source.firewallResource; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public UpdateFirewallHttpRequest build() { return new UpdateFirewallHttpRequest( access_token, callback, - fieldMask, fields, firewall, firewallResource, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setFirewall(this.firewall); newBuilder.setFirewallResource(this.firewallResource); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { UpdateFirewallHttpRequest that = (UpdateFirewallHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.firewall, that.getFirewall()) && Objects.equals(this.firewallResource, that.getFirewallResource()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, firewall, firewallResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java index dd475e3ce0f8..023f73d37af1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String healthCheck; private final HealthCheck healthCheckResource; @@ -40,7 +43,6 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage { private UpdateHealthCheckHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.healthCheck = null; this.healthCheckResource = null; @@ -54,7 +56,6 @@ private UpdateHealthCheckHttpRequest() { private UpdateHealthCheckHttpRequest( String access_token, String callback, - List fieldMask, String fields, String healthCheck, HealthCheck healthCheckResource, @@ -65,7 +66,6 @@ private UpdateHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.healthCheck = healthCheck; this.healthCheckResource = healthCheckResource; @@ -77,39 +77,73 @@ private UpdateHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("healthCheck") && healthCheck != null) { + fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck))); + } + if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) { + fieldMap.put( + "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("healthCheck")) { - return healthCheck; + return String.valueOf(healthCheck); } if (fieldName.equals("healthCheckResource")) { - return healthCheckResource; + return String.valueOf(healthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +154,6 @@ public HealthCheck getApiMessageRequestBody() { return healthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +219,6 @@ public static UpdateHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String healthCheck; private HealthCheck healthCheckResource; @@ -211,9 +238,6 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +268,6 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) { Builder(UpdateHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.healthCheck = source.healthCheck; this.healthCheckResource = source.healthCheckResource; @@ -273,15 +296,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +381,6 @@ public UpdateHealthCheckHttpRequest build() { return new UpdateHealthCheckHttpRequest( access_token, callback, - fieldMask, fields, healthCheck, healthCheckResource, @@ -382,7 +395,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHealthCheck(this.healthCheck); newBuilder.setHealthCheckResource(this.healthCheckResource); @@ -404,9 +416,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +451,6 @@ public boolean equals(Object o) { UpdateHealthCheckHttpRequest that = (UpdateHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.healthCheck, that.getHealthCheck()) && Objects.equals(this.healthCheckResource, that.getHealthCheckResource()) @@ -460,7 +468,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, healthCheck, healthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java index 6a00c113c72d..69dcd7676c08 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,10 +31,9 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String httpHealthCheck; - private final HttpHealthCheck httpHealthCheckResource; + private final HttpHealthCheck2 httpHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -40,7 +43,6 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage { private UpdateHttpHealthCheckHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.httpHealthCheck = null; this.httpHealthCheckResource = null; @@ -54,10 +56,9 @@ private UpdateHttpHealthCheckHttpRequest() { private UpdateHttpHealthCheckHttpRequest( String access_token, String callback, - List fieldMask, String fields, String httpHealthCheck, - HttpHealthCheck httpHealthCheckResource, + HttpHealthCheck2 httpHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -65,7 +66,6 @@ private UpdateHttpHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.httpHealthCheck = httpHealthCheck; this.httpHealthCheckResource = httpHealthCheckResource; @@ -77,55 +77,84 @@ private UpdateHttpHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) { + fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck))); + } + if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) { + fieldMap.put( + "httpHealthCheckResource", + Collections.singletonList(String.valueOf(httpHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpHealthCheck")) { - return httpHealthCheck; + return String.valueOf(httpHealthCheck); } if (fieldName.equals("httpHealthCheckResource")) { - return httpHealthCheckResource; + return String.valueOf(httpHealthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @Nullable @Override - public HttpHealthCheck getApiMessageRequestBody() { + public HttpHealthCheck2 getApiMessageRequestBody() { return httpHealthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -142,7 +171,7 @@ public String getHttpHealthCheck() { return httpHealthCheck; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } @@ -191,10 +220,9 @@ public static UpdateHttpHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String httpHealthCheck; - private HttpHealthCheck httpHealthCheckResource; + private HttpHealthCheck2 httpHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -211,9 +239,6 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +269,6 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) { Builder(UpdateHttpHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpHealthCheck = source.httpHealthCheck; this.httpHealthCheckResource = source.httpHealthCheckResource; @@ -273,15 +297,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -300,11 +315,11 @@ public Builder setHttpHealthCheck(String httpHealthCheck) { return this; } - public HttpHealthCheck getHttpHealthCheckResource() { + public HttpHealthCheck2 getHttpHealthCheckResource() { return httpHealthCheckResource; } - public Builder setHttpHealthCheckResource(HttpHealthCheck httpHealthCheckResource) { + public Builder setHttpHealthCheckResource(HttpHealthCheck2 httpHealthCheckResource) { this.httpHealthCheckResource = httpHealthCheckResource; return this; } @@ -367,7 +382,6 @@ public UpdateHttpHealthCheckHttpRequest build() { return new UpdateHttpHealthCheckHttpRequest( access_token, callback, - fieldMask, fields, httpHealthCheck, httpHealthCheckResource, @@ -382,7 +396,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpHealthCheck(this.httpHealthCheck); newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource); @@ -404,9 +417,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +452,6 @@ public boolean equals(Object o) { UpdateHttpHealthCheckHttpRequest that = (UpdateHttpHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck()) && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource()) @@ -460,7 +469,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, httpHealthCheck, httpHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java index 063e865d39a5..311f25262dde 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,10 +31,9 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String httpsHealthCheck; - private final HttpsHealthCheck httpsHealthCheckResource; + private final HttpsHealthCheck2 httpsHealthCheckResource; private final String key; private final String prettyPrint; private final String quotaUser; @@ -40,7 +43,6 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage { private UpdateHttpsHealthCheckHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.httpsHealthCheck = null; this.httpsHealthCheckResource = null; @@ -54,10 +56,9 @@ private UpdateHttpsHealthCheckHttpRequest() { private UpdateHttpsHealthCheckHttpRequest( String access_token, String callback, - List fieldMask, String fields, String httpsHealthCheck, - HttpsHealthCheck httpsHealthCheckResource, + HttpsHealthCheck2 httpsHealthCheckResource, String key, String prettyPrint, String quotaUser, @@ -65,7 +66,6 @@ private UpdateHttpsHealthCheckHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.httpsHealthCheck = httpsHealthCheck; this.httpsHealthCheckResource = httpsHealthCheckResource; @@ -77,55 +77,84 @@ private UpdateHttpsHealthCheckHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) { + fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck))); + } + if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) { + fieldMap.put( + "httpsHealthCheckResource", + Collections.singletonList(String.valueOf(httpsHealthCheckResource))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("httpsHealthCheck")) { - return httpsHealthCheck; + return String.valueOf(httpsHealthCheck); } if (fieldName.equals("httpsHealthCheckResource")) { - return httpsHealthCheckResource; + return String.valueOf(httpsHealthCheckResource); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @Nullable @Override - public HttpsHealthCheck getApiMessageRequestBody() { + public HttpsHealthCheck2 getApiMessageRequestBody() { return httpsHealthCheckResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -142,7 +171,7 @@ public String getHttpsHealthCheck() { return httpsHealthCheck; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } @@ -191,10 +220,9 @@ public static UpdateHttpsHealthCheckHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String httpsHealthCheck; - private HttpsHealthCheck httpsHealthCheckResource; + private HttpsHealthCheck2 httpsHealthCheckResource; private String key; private String prettyPrint; private String quotaUser; @@ -211,9 +239,6 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +269,6 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) { Builder(UpdateHttpsHealthCheckHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.httpsHealthCheck = source.httpsHealthCheck; this.httpsHealthCheckResource = source.httpsHealthCheckResource; @@ -273,15 +297,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -300,11 +315,11 @@ public Builder setHttpsHealthCheck(String httpsHealthCheck) { return this; } - public HttpsHealthCheck getHttpsHealthCheckResource() { + public HttpsHealthCheck2 getHttpsHealthCheckResource() { return httpsHealthCheckResource; } - public Builder setHttpsHealthCheckResource(HttpsHealthCheck httpsHealthCheckResource) { + public Builder setHttpsHealthCheckResource(HttpsHealthCheck2 httpsHealthCheckResource) { this.httpsHealthCheckResource = httpsHealthCheckResource; return this; } @@ -367,7 +382,6 @@ public UpdateHttpsHealthCheckHttpRequest build() { return new UpdateHttpsHealthCheckHttpRequest( access_token, callback, - fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, @@ -382,7 +396,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setHttpsHealthCheck(this.httpsHealthCheck); newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource); @@ -404,9 +417,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +452,6 @@ public boolean equals(Object o) { UpdateHttpsHealthCheckHttpRequest that = (UpdateHttpsHealthCheckHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck()) && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource()) @@ -460,7 +469,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, httpsHealthCheck, httpsHealthCheckResource, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java index 4d23d4d321e7..d059bd42e620 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String instance; private final String key; @@ -41,7 +44,6 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessa private UpdateNetworkInterfaceInstanceHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.instance = null; this.key = null; @@ -56,7 +58,6 @@ private UpdateNetworkInterfaceInstanceHttpRequest() { private UpdateNetworkInterfaceInstanceHttpRequest( String access_token, String callback, - List fieldMask, String fields, String instance, String key, @@ -68,7 +69,6 @@ private UpdateNetworkInterfaceInstanceHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.instance = instance; this.key = key; @@ -81,42 +81,80 @@ private UpdateNetworkInterfaceInstanceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("instance") && instance != null) { + fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("networkInterface") && networkInterface != null) { + fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); + } + if (fieldNames.contains("networkInterfaceResource") && networkInterfaceResource != null) { + fieldMap.put( + "networkInterfaceResource", + Collections.singletonList(String.valueOf(networkInterfaceResource))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("instance")) { - return instance; + return String.valueOf(instance); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("networkInterface")) { - return networkInterface; + return String.valueOf(networkInterface); } if (fieldName.equals("networkInterfaceResource")) { - return networkInterfaceResource; + return String.valueOf(networkInterfaceResource); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +165,6 @@ public NetworkInterface getApiMessageRequestBody() { return networkInterfaceResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -202,7 +234,6 @@ public static UpdateNetworkInterfaceInstanceHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String instance; private String key; @@ -223,9 +254,6 @@ public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -259,7 +287,6 @@ public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) { Builder(UpdateNetworkInterfaceInstanceHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.instance = source.instance; this.key = source.key; @@ -289,15 +316,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -396,7 +414,6 @@ public UpdateNetworkInterfaceInstanceHttpRequest build() { return new UpdateNetworkInterfaceInstanceHttpRequest( access_token, callback, - fieldMask, fields, instance, key, @@ -412,7 +429,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setInstance(this.instance); newBuilder.setKey(this.key); @@ -435,9 +451,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -477,7 +490,6 @@ public boolean equals(Object o) { (UpdateNetworkInterfaceInstanceHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.instance, that.getInstance()) && Objects.equals(this.key, that.getKey()) @@ -496,7 +508,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, instance, key, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java index fe33e4ccc64d..26014c33180f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage { private final String autoscaler; private final Autoscaler autoscalerResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -43,7 +46,6 @@ private UpdateRegionAutoscalerHttpRequest() { this.autoscaler = null; this.autoscalerResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -58,7 +60,6 @@ private UpdateRegionAutoscalerHttpRequest( String autoscaler, Autoscaler autoscalerResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -70,7 +71,6 @@ private UpdateRegionAutoscalerHttpRequest( this.autoscaler = autoscaler; this.autoscalerResource = autoscalerResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -81,42 +81,79 @@ private UpdateRegionAutoscalerHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("autoscaler") && autoscaler != null) { + fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler))); + } + if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) { + fieldMap.put( + "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("autoscaler")) { - return autoscaler; + return String.valueOf(autoscaler); } if (fieldName.equals("autoscalerResource")) { - return autoscalerResource; + return String.valueOf(autoscalerResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -127,12 +164,6 @@ public Autoscaler getApiMessageRequestBody() { return autoscalerResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -204,7 +235,6 @@ public static class Builder { private String autoscaler; private Autoscaler autoscalerResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -229,9 +259,6 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -261,7 +288,6 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) { this.autoscaler = source.autoscaler; this.autoscalerResource = source.autoscalerResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -307,15 +333,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -394,7 +411,6 @@ public UpdateRegionAutoscalerHttpRequest build() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, @@ -410,7 +426,6 @@ public Builder clone() { newBuilder.setAutoscaler(this.autoscaler); newBuilder.setAutoscalerResource(this.autoscalerResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -437,9 +452,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -474,7 +486,6 @@ public boolean equals(Object o) { && Objects.equals(this.autoscaler, that.getAutoscaler()) && Objects.equals(this.autoscalerResource, that.getAutoscalerResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -493,7 +504,6 @@ public int hashCode() { autoscaler, autoscalerResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java index 50ff784603bb..e6a829c34afe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -29,7 +33,6 @@ public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage { private final String backendService; private final BackendService backendServiceResource; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -42,7 +45,6 @@ private UpdateRegionBackendServiceHttpRequest() { this.backendService = null; this.backendServiceResource = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -56,7 +58,6 @@ private UpdateRegionBackendServiceHttpRequest( String backendService, BackendService backendServiceResource, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -67,7 +68,6 @@ private UpdateRegionBackendServiceHttpRequest( this.backendService = backendService; this.backendServiceResource = backendServiceResource; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,74 @@ private UpdateRegionBackendServiceHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("backendService") && backendService != null) { + fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService))); + } + if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) { + fieldMap.put( + "backendServiceResource", + Collections.singletonList(String.valueOf(backendServiceResource))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("backendService")) { - return backendService; + return String.valueOf(backendService); } if (fieldName.equals("backendServiceResource")) { - return backendServiceResource; + return String.valueOf(backendServiceResource); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +155,6 @@ public BackendService getApiMessageRequestBody() { return backendServiceResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -193,7 +222,6 @@ public static class Builder { private String backendService; private BackendService backendServiceResource; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -217,9 +245,6 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -246,7 +271,6 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) { this.backendService = source.backendService; this.backendServiceResource = source.backendServiceResource; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -291,15 +315,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -369,7 +384,6 @@ public UpdateRegionBackendServiceHttpRequest build() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, @@ -384,7 +398,6 @@ public Builder clone() { newBuilder.setBackendService(this.backendService); newBuilder.setBackendServiceResource(this.backendServiceResource); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -410,9 +423,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -444,7 +454,6 @@ public boolean equals(Object o) { && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.backendServiceResource, that.getBackendServiceResource()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -462,7 +471,6 @@ public int hashCode() { backendService, backendServiceResource, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java index 33353765119e..e5e3b508f1ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,7 +43,6 @@ public final class UpdateRouterHttpRequest implements ApiMessage { private UpdateRouterHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -54,7 +56,6 @@ private UpdateRouterHttpRequest() { private UpdateRouterHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -65,7 +66,6 @@ private UpdateRouterHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,72 @@ private UpdateRouterHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("routerResource") && routerResource != null) { + fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("routerResource")) { - return routerResource; + return String.valueOf(routerResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public Router getApiMessageRequestBody() { return routerResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static UpdateRouterHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -211,9 +237,6 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) { Builder(UpdateRouterHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public UpdateRouterHttpRequest build() { return new UpdateRouterHttpRequest( access_token, callback, - fieldMask, fields, key, prettyPrint, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java index d10954b5d792..553a99a61431 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -27,7 +31,6 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private final String access_token; private final String callback; - private final List fieldMask; private final String fields; private final String key; private final String prettyPrint; @@ -40,7 +43,6 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage { private UpdateUrlMapHttpRequest() { this.access_token = null; this.callback = null; - this.fieldMask = null; this.fields = null; this.key = null; this.prettyPrint = null; @@ -54,7 +56,6 @@ private UpdateUrlMapHttpRequest() { private UpdateUrlMapHttpRequest( String access_token, String callback, - List fieldMask, String fields, String key, String prettyPrint, @@ -65,7 +66,6 @@ private UpdateUrlMapHttpRequest( String userIp) { this.access_token = access_token; this.callback = callback; - this.fieldMask = fieldMask; this.fields = fields; this.key = key; this.prettyPrint = prettyPrint; @@ -77,39 +77,72 @@ private UpdateUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("urlMapResource") && urlMapResource != null) { + fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; - } - if (fieldName.equals("fieldMask")) { - return fieldMask; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("requestId")) { - return requestId; + return String.valueOf(requestId); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } if (fieldName.equals("urlMapResource")) { - return urlMapResource; + return String.valueOf(urlMapResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -120,12 +153,6 @@ public UrlMap getApiMessageRequestBody() { return urlMapResource; } - @Nullable - @Override - public List getFieldMask() { - return fieldMask; - } - public String getAccessToken() { return access_token; } @@ -191,7 +218,6 @@ public static UpdateUrlMapHttpRequest getDefaultInstance() { public static class Builder { private String access_token; private String callback; - private List fieldMask; private String fields; private String key; private String prettyPrint; @@ -211,9 +237,6 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) { if (other.getCallback() != null) { this.callback = other.callback; } - if (other.getFieldMask() != null) { - this.fieldMask = other.fieldMask; - } if (other.getFields() != null) { this.fields = other.fields; } @@ -244,7 +267,6 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) { Builder(UpdateUrlMapHttpRequest source) { this.access_token = source.access_token; this.callback = source.callback; - this.fieldMask = source.fieldMask; this.fields = source.fields; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -273,15 +295,6 @@ public Builder setCallback(String callback) { return this; } - public List getFieldMask() { - return fieldMask; - } - - public Builder setFieldMask(List fieldMask) { - this.fieldMask = fieldMask; - return this; - } - public String getFields() { return fields; } @@ -367,7 +380,6 @@ public UpdateUrlMapHttpRequest build() { return new UpdateUrlMapHttpRequest( access_token, callback, - fieldMask, fields, key, prettyPrint, @@ -382,7 +394,6 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAccessToken(this.access_token); newBuilder.setCallback(this.callback); - newBuilder.setFieldMask(this.fieldMask); newBuilder.setFields(this.fields); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -404,9 +415,6 @@ public String toString() { + "callback=" + callback + ", " - + "fieldMask=" - + fieldMask - + ", " + "fields=" + fields + ", " @@ -442,7 +450,6 @@ public boolean equals(Object o) { UpdateUrlMapHttpRequest that = (UpdateUrlMapHttpRequest) o; return Objects.equals(this.access_token, that.getAccessToken()) && Objects.equals(this.callback, that.getCallback()) - && Objects.equals(this.fieldMask, that.getFieldMask()) && Objects.equals(this.fields, that.getFields()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -460,7 +467,6 @@ public int hashCode() { return Objects.hash( access_token, callback, - fieldMask, fields, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java index 8480218f299c..8d3e1ce15fb2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -78,39 +83,91 @@ private UrlMap( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("defaultService") && defaultService != null) { + fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("fingerprint") && fingerprint != null) { + fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); + } + if (fieldNames.contains("hostRules") && hostRules != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (HostRule item : hostRules) { + stringList.add(item.toString()); + } + fieldMap.put("hostRules", stringList.build()); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("pathMatchers") && pathMatchers != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (PathMatcher item : pathMatchers) { + stringList.add(item.toString()); + } + fieldMap.put("pathMatchers", stringList.build()); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("tests") && tests != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (UrlMapTest item : tests) { + stringList.add(item.toString()); + } + fieldMap.put("tests", stringList.build()); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("defaultService")) { - return defaultService; + return String.valueOf(defaultService); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("fingerprint")) { - return fingerprint; + return String.valueOf(fingerprint); } if (fieldName.equals("hostRules")) { - return hostRules; + return String.valueOf(hostRules); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("pathMatchers")) { - return pathMatchers; + return String.valueOf(pathMatchers); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("tests")) { - return tests; + return String.valueOf(tests); } return null; } @@ -121,12 +178,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java index 01de00a6b4b7..073f4c2050b3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private UrlMapList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (UrlMap item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java index eedff2c1705e..54eac934b2bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private UrlMapReference(String urlMap) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("urlMap")) { - return urlMap; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("urlMap")) { + return String.valueOf(urlMap); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java index 3807f0fcc592..6c9cee06b282 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,18 +49,36 @@ private UrlMapTest(String description, String host, String path, String service) } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("host") && host != null) { + fieldMap.put("host", Collections.singletonList(String.valueOf(host))); + } + if (fieldNames.contains("path") && path != null) { + fieldMap.put("path", Collections.singletonList(String.valueOf(path))); + } + if (fieldNames.contains("service") && service != null) { + fieldMap.put("service", Collections.singletonList(String.valueOf(service))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("host")) { - return host; + return String.valueOf(host); } if (fieldName.equals("path")) { - return path; + return String.valueOf(path); } if (fieldName.equals("service")) { - return service; + return String.valueOf(service); } return null; } @@ -67,12 +89,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getDescription() { return description; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java index 57a9eef7757b..1d006f36b0da 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -50,18 +55,44 @@ private UrlMapValidationResult( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("loadErrors") && loadErrors != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : loadErrors) { + stringList.add(item.toString()); + } + fieldMap.put("loadErrors", stringList.build()); + } + if (fieldNames.contains("loadSucceeded") && loadSucceeded != null) { + fieldMap.put("loadSucceeded", Collections.singletonList(String.valueOf(loadSucceeded))); + } + if (fieldNames.contains("testFailures") && testFailures != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (TestFailure item : testFailures) { + stringList.add(item.toString()); + } + fieldMap.put("testFailures", stringList.build()); + } + if (fieldNames.contains("testPassed") && testPassed != null) { + fieldMap.put("testPassed", Collections.singletonList(String.valueOf(testPassed))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("loadErrors")) { - return loadErrors; + return String.valueOf(loadErrors); } if (fieldName.equals("loadSucceeded")) { - return loadSucceeded; + return String.valueOf(loadSucceeded); } if (fieldName.equals("testFailures")) { - return testFailures; + return String.valueOf(testFailures); } if (fieldName.equals("testPassed")) { - return testPassed; + return String.valueOf(testPassed); } return null; } @@ -72,12 +103,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getLoadErrorsList() { return loadErrors; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java index b966c622365a..67ad5ece8a64 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private UrlMapsValidateRequest(UrlMap resource) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("resource")) { - return resource; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java index 5ea9b6d68757..aada951cc3e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -36,22 +40,25 @@ private UrlMapsValidateResponse(UrlMapValidationResult result) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("result")) { - return result; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("result") && result != null) { + fieldMap.put("result", Collections.singletonList(String.valueOf(result))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("result")) { + return String.valueOf(result); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java index bc102b38b4a5..0e8d805e19f6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private UsageExportLocation(String bucketName, String reportNamePrefix) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("bucketName")) { - return bucketName; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("bucketName") && bucketName != null) { + fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); } - if (fieldName.equals("reportNamePrefix")) { - return reportNamePrefix; + if (fieldNames.contains("reportNamePrefix") && reportNamePrefix != null) { + fieldMap.put("reportNamePrefix", Collections.singletonList(String.valueOf(reportNamePrefix))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("bucketName")) { + return String.valueOf(bucketName); + } + if (fieldName.equals("reportNamePrefix")) { + return String.valueOf(reportNamePrefix); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java index 1e5b6f4c84f4..50a4ff2a3d32 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,33 +73,69 @@ private ValidateUrlMapHttpRequest( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("urlMap") && urlMap != null) { + fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap))); + } + if (fieldNames.contains("urlMapsValidateRequestResource") + && urlMapsValidateRequestResource != null) { + fieldMap.put( + "urlMapsValidateRequestResource", + Collections.singletonList(String.valueOf(urlMapsValidateRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("access_token")) { - return access_token; + return String.valueOf(access_token); } if (fieldName.equals("callback")) { - return callback; + return String.valueOf(callback); } if (fieldName.equals("fields")) { - return fields; + return String.valueOf(fields); } if (fieldName.equals("key")) { - return key; + return String.valueOf(key); } if (fieldName.equals("prettyPrint")) { - return prettyPrint; + return String.valueOf(prettyPrint); } if (fieldName.equals("quotaUser")) { - return quotaUser; + return String.valueOf(quotaUser); } if (fieldName.equals("urlMap")) { - return urlMap; + return String.valueOf(urlMap); } if (fieldName.equals("urlMapsValidateRequestResource")) { - return urlMapsValidateRequestResource; + return String.valueOf(urlMapsValidateRequestResource); } if (fieldName.equals("userIp")) { - return userIp; + return String.valueOf(userIp); } return null; } @@ -106,12 +146,6 @@ public UrlMapsValidateRequest getApiMessageRequestBody() { return urlMapsValidateRequestResource; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java index b363aa3aa3d5..d00ea6107360 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -102,57 +107,123 @@ private VpnTunnel( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("detailedStatus") && detailedStatus != null) { + fieldMap.put("detailedStatus", Collections.singletonList(String.valueOf(detailedStatus))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("ikeVersion") && ikeVersion != null) { + fieldMap.put("ikeVersion", Collections.singletonList(String.valueOf(ikeVersion))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("localTrafficSelector") && localTrafficSelector != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : localTrafficSelector) { + stringList.add(item.toString()); + } + fieldMap.put("localTrafficSelector", stringList.build()); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("peerIp") && peerIp != null) { + fieldMap.put("peerIp", Collections.singletonList(String.valueOf(peerIp))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("remoteTrafficSelector") && remoteTrafficSelector != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : remoteTrafficSelector) { + stringList.add(item.toString()); + } + fieldMap.put("remoteTrafficSelector", stringList.build()); + } + if (fieldNames.contains("router") && router != null) { + fieldMap.put("router", Collections.singletonList(String.valueOf(router))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("sharedSecret") && sharedSecret != null) { + fieldMap.put("sharedSecret", Collections.singletonList(String.valueOf(sharedSecret))); + } + if (fieldNames.contains("sharedSecretHash") && sharedSecretHash != null) { + fieldMap.put("sharedSecretHash", Collections.singletonList(String.valueOf(sharedSecretHash))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) { + fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("detailedStatus")) { - return detailedStatus; + return String.valueOf(detailedStatus); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("ikeVersion")) { - return ikeVersion; + return String.valueOf(ikeVersion); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("localTrafficSelector")) { - return localTrafficSelector; + return String.valueOf(localTrafficSelector); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("peerIp")) { - return peerIp; + return String.valueOf(peerIp); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("remoteTrafficSelector")) { - return remoteTrafficSelector; + return String.valueOf(remoteTrafficSelector); } if (fieldName.equals("router")) { - return router; + return String.valueOf(router); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("sharedSecret")) { - return sharedSecret; + return String.valueOf(sharedSecret); } if (fieldName.equals("sharedSecretHash")) { - return sharedSecretHash; + return String.valueOf(sharedSecretHash); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } if (fieldName.equals("targetVpnGateway")) { - return targetVpnGateway; + return String.valueOf(targetVpnGateway); } return null; } @@ -163,12 +234,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java index 0d492688936a..9dc39b6f3bdc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +61,48 @@ private VpnTunnelAggregatedList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + fieldMap.put("items", Collections.singletonList(String.valueOf(items))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +113,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java index 7205aa4a8647..3b6b900db1fd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private VpnTunnelList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (VpnTunnel item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java index ea1e23fb9162..8c08a390bf52 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +45,35 @@ private VpnTunnelsScopedList(List vpnTunnels, Warning warning) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("vpnTunnels")) { - return vpnTunnels; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("vpnTunnels") && vpnTunnels != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (VpnTunnel item : vpnTunnels) { + stringList.add(item.toString()); + } + fieldMap.put("vpnTunnels", stringList.build()); } - if (fieldName.equals("warning")) { - return warning; + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("vpnTunnels")) { + return String.valueOf(vpnTunnels); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java index b9b8ed6c959d..8728216ff0df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +48,34 @@ private Warning(String code, List data, String message) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("data") && data != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Data item : data) { + stringList.add(item.toString()); + } + fieldMap.put("data", stringList.build()); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("code")) { - return code; + return String.valueOf(code); } if (fieldName.equals("data")) { - return data; + return String.valueOf(data); } if (fieldName.equals("message")) { - return message; + return String.valueOf(message); } return null; } @@ -62,12 +86,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCode() { return code; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java index ac9609a33607..4620e964b2d7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,15 +48,34 @@ private Warnings(String code, List data, String message) { } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("code") && code != null) { + fieldMap.put("code", Collections.singletonList(String.valueOf(code))); + } + if (fieldNames.contains("data") && data != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Data item : data) { + stringList.add(item.toString()); + } + fieldMap.put("data", stringList.build()); + } + if (fieldNames.contains("message") && message != null) { + fieldMap.put("message", Collections.singletonList(String.valueOf(message))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("code")) { - return code; + return String.valueOf(code); } if (fieldName.equals("data")) { - return data; + return String.valueOf(data); } if (fieldName.equals("message")) { - return message; + return String.valueOf(message); } return null; } @@ -62,12 +86,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getCode() { return code; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java index da89eeaf4e6b..43273af679dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private XpnHostList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Project item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java index 810cc2aa1797..130421428275 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java @@ -17,8 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -39,25 +43,31 @@ private XpnResourceId(String id, String type) { } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("id")) { - return id; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); } - if (fieldName.equals("type")) { - return type; + if (fieldNames.contains("type") && type != null) { + fieldMap.put("type", Collections.singletonList(String.valueOf(type))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("type")) { + return String.valueOf(type); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java index 8406d81a7481..e1e7afeb2e8d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -74,36 +79,77 @@ private Zone( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("availableCpuPlatforms") && availableCpuPlatforms != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : availableCpuPlatforms) { + stringList.add(item.toString()); + } + fieldMap.put("availableCpuPlatforms", stringList.build()); + } + if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { + fieldMap.put( + "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); + } + if (fieldNames.contains("deprecated") && deprecated != null) { + fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); + } + if (fieldNames.contains("description") && description != null) { + fieldMap.put("description", Collections.singletonList(String.valueOf(description))); + } + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("name") && name != null) { + fieldMap.put("name", Collections.singletonList(String.valueOf(name))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("status") && status != null) { + fieldMap.put("status", Collections.singletonList(String.valueOf(status))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("availableCpuPlatforms")) { - return availableCpuPlatforms; + return String.valueOf(availableCpuPlatforms); } if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; + return String.valueOf(creationTimestamp); } if (fieldName.equals("deprecated")) { - return deprecated; + return String.valueOf(deprecated); } if (fieldName.equals("description")) { - return description; + return String.valueOf(description); } if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("name")) { - return name; + return String.valueOf(name); } if (fieldName.equals("region")) { - return region; + return String.valueOf(region); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("status")) { - return status; + return String.valueOf(status); } return null; } @@ -114,12 +160,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public List getAvailableCpuPlatformsList() { return availableCpuPlatforms; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java index a4085a18b4bb..c73bc4b7f84a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java @@ -17,9 +17,14 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -58,24 +63,52 @@ private ZoneList( } @Override - public Object getFieldValue(String fieldName) { + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (Zone item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { if (fieldName.equals("id")) { - return id; + return String.valueOf(id); } if (fieldName.equals("items")) { - return items; + return String.valueOf(items); } if (fieldName.equals("kind")) { - return kind; + return String.valueOf(kind); } if (fieldName.equals("nextPageToken")) { - return nextPageToken; + return String.valueOf(nextPageToken); } if (fieldName.equals("selfLink")) { - return selfLink; + return String.valueOf(selfLink); } if (fieldName.equals("warning")) { - return warning; + return String.valueOf(warning); } return null; } @@ -86,12 +119,6 @@ public ApiMessage getApiMessageRequestBody() { return null; } - @Nullable - @Override - public List getFieldMask() { - return null; - } - public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java index e2a6f547e87b..af3946d967c1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java @@ -17,9 +17,12 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,25 +43,31 @@ private ZoneSetLabelsRequest(String labelFingerprint, Map labels } @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("labelFingerprint")) { - return labelFingerprint; + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); } - if (fieldName.equals("labels")) { - return labels; + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); } - return null; + return fieldMap; } - @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } return null; } @Nullable @Override - public List getFieldMask() { + public ApiMessage getApiMessageRequestBody() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java index 99fb95da714d..84676af100df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java @@ -22,7 +22,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; +import com.google.cloud.compute.v1.HttpHealthCheck2; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -48,7 +48,7 @@ public abstract class HttpHealthCheckStub implements BackgroundResource { } @BetaApi - public UnaryCallable + public UnaryCallable getHttpHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpHealthCheckCallable()"); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java index 50dbb2708863..6ce448ba8aed 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java @@ -41,7 +41,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; +import com.google.cloud.compute.v1.HttpHealthCheck2; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -100,7 +100,7 @@ public class HttpHealthCheckStubSettings extends StubSettings deleteHttpHealthCheckSettings; - private final UnaryCallSettings + private final UnaryCallSettings getHttpHealthCheckSettings; private final UnaryCallSettings insertHttpHealthCheckSettings; @@ -119,7 +119,7 @@ public class HttpHealthCheckStubSettings extends StubSettings + public UnaryCallSettings getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } @@ -233,10 +233,10 @@ protected HttpHealthCheckStubSettings(Builder settingsBuilder) throws IOExceptio } private static final PagedListDescriptor< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck> + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2> LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC = new PagedListDescriptor< - ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck>() { + ListHttpHealthChecksHttpRequest, HttpHealthCheckList, HttpHealthCheck2>() { @Override public String emptyToken() { return ""; @@ -269,7 +269,7 @@ public String extractNextToken(HttpHealthCheckList payload) { } @Override - public Iterable extractResources(HttpHealthCheckList payload) { + public Iterable extractResources(HttpHealthCheckList payload) { return payload.getItemsList(); } }; @@ -286,7 +286,7 @@ public ApiFuture getFuturePagedResponse( ListHttpHealthChecksHttpRequest request, ApiCallContext context, ApiFuture futureResponse) { - PageContext + PageContext pageContext = PageContext.create( callable, LIST_HTTP_HEALTH_CHECKS_PAGE_STR_DESC, request, context); @@ -300,7 +300,7 @@ public static class Builder extends StubSettings.Builder deleteHttpHealthCheckSettings; - private final UnaryCallSettings.Builder + private final UnaryCallSettings.Builder getHttpHealthCheckSettings; private final UnaryCallSettings.Builder insertHttpHealthCheckSettings; @@ -465,7 +465,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpHealthCheckSettings() { return getHttpHealthCheckSettings; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java index 597842fdabe8..71269115b288 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java @@ -66,6 +66,8 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/acceleratorTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -86,6 +88,7 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAcceleratorTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")) @@ -107,6 +110,7 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAcceleratorTypesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/acceleratorTypes")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java index 7092da29b4c0..bc79b274fd0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -66,6 +66,7 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -86,6 +87,7 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -106,6 +108,7 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAddressHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet()) @@ -126,6 +129,7 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -145,6 +149,7 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java index 5247f8519acd..50d28633fe62 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -69,6 +69,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/autoscalers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -89,6 +90,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -109,6 +111,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet()) @@ -129,6 +132,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -148,6 +152,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -168,6 +173,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -187,6 +193,7 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java index e293e0781306..dc2e4c87bd40 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java @@ -63,6 +63,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -83,6 +84,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet()) @@ -103,6 +105,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -122,6 +125,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListBackendBucketsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -142,6 +146,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -162,6 +167,7 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java index 707e2defa242..d4b898387ef5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -71,6 +71,8 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/backendServices")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -91,6 +93,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -111,6 +114,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet()) @@ -133,6 +137,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/backendServices/{backendService}/getHealth")) @@ -154,6 +159,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -173,6 +179,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -193,6 +200,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -213,6 +221,7 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index 601895c004fb..d05faf374ce8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -69,6 +69,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -89,6 +90,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) .setQueryParams(Sets.newHashSet("guestFlush", "requestId")) @@ -109,6 +111,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) @@ -127,6 +130,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) @@ -146,6 +150,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) .setQueryParams(Sets.newHashSet("requestId", "sourceImage")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -165,6 +170,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -185,6 +191,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) .setQueryParams(Sets.newHashSet("requestId")) @@ -205,6 +212,7 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{resource}/setLabels")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java index 8831d983a454..5763aab2b33e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java @@ -64,6 +64,7 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -84,6 +85,7 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetDiskTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}")) .setQueryParams(Sets.newHashSet()) @@ -104,6 +106,7 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java index 468a6224f60a..47a4e3218911 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -63,6 +63,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -82,6 +83,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -101,6 +103,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -120,6 +123,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListFirewallsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -140,6 +144,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -159,6 +164,7 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java index f6adf2664a38..be620cb1bdd9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -69,6 +69,8 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/forwardingRules")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -89,6 +91,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}")) @@ -110,6 +113,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}")) @@ -131,6 +135,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams(Sets.newHashSet("requestId")) @@ -151,6 +156,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams( @@ -172,6 +178,7 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java index 2b904500960f..b0016d2ce018 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -61,6 +61,7 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) @@ -80,6 +81,7 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) @@ -99,6 +101,7 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -118,6 +121,7 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java index fa77e0ea9c16..9cbabb7f7df5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -62,6 +62,8 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -82,6 +84,7 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet()) @@ -102,6 +105,8 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -121,6 +126,7 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -142,6 +148,8 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/forwardingRules/{forwardingRule}/setTarget")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java index ba198e28cb7e..eb5098744995 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java @@ -65,6 +65,8 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -85,6 +87,7 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteGlobalOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -101,6 +104,7 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetGlobalOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -121,6 +125,7 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListGlobalOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java index 7a376c55eedd..6314d09d3cd2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -63,6 +63,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -83,6 +84,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet()) @@ -103,6 +105,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -122,6 +125,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -142,6 +146,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -162,6 +167,7 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index 96e564bf8110..694e165658c9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -32,7 +32,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpHealthCheck; +import com.google.cloud.compute.v1.HttpHealthCheck2; import com.google.cloud.compute.v1.HttpHealthCheckList; import com.google.cloud.compute.v1.InsertHttpHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpHealthChecksHttpRequest; @@ -63,6 +63,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -77,13 +78,14 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .build(); @InternalApi - public static final ApiMethodDescriptor + public static final ApiMethodDescriptor getHttpHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() + ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.httpHealthChecks.get") .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -92,8 +94,8 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setResourceNameField("httpHealthCheck") .build()) .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpHealthCheck.getDefaultInstance()) + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpHealthCheck2.getDefaultInstance()) .build()) .build(); @@ -105,6 +107,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,6 +127,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHttpHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -144,6 +148,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -165,6 +170,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -182,7 +188,7 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { private final UnaryCallable deleteHttpHealthCheckCallable; - private final UnaryCallable + private final UnaryCallable getHttpHealthCheckCallable; private final UnaryCallable insertHttpHealthCheckCallable; @@ -241,9 +247,9 @@ protected HttpJsonHttpHealthCheckStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteHttpHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings + HttpJsonCallSettings getHttpHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() + HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHttpHealthCheckMethodDescriptor) .build(); HttpJsonCallSettings @@ -313,7 +319,7 @@ protected HttpJsonHttpHealthCheckStub( } @BetaApi - public UnaryCallable + public UnaryCallable getHttpHealthCheckCallable() { return getHttpHealthCheckCallable; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 045464f689f1..5715b291ee87 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -32,7 +32,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; +import com.google.cloud.compute.v1.HttpsHealthCheck2; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -63,6 +63,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -77,13 +78,14 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .build(); @InternalApi - public static final ApiMethodDescriptor + public static final ApiMethodDescriptor getHttpsHealthCheckMethodDescriptor = - ApiMethodDescriptor.newBuilder() + ApiMethodDescriptor.newBuilder() .setFullMethodName("compute.httpsHealthChecks.get") .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -92,8 +94,8 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setResourceNameField("httpsHealthCheck") .build()) .setResponseParser( - ApiMessageHttpResponseParser.newBuilder() - .setResponseInstance(HttpsHealthCheck.getDefaultInstance()) + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(HttpsHealthCheck2.getDefaultInstance()) .build()) .build(); @@ -105,6 +107,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,6 +127,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListHttpsHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -144,6 +148,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -165,6 +170,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -182,7 +188,7 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { private final UnaryCallable deleteHttpsHealthCheckCallable; - private final UnaryCallable + private final UnaryCallable getHttpsHealthCheckCallable; private final UnaryCallable insertHttpsHealthCheckCallable; @@ -241,9 +247,9 @@ protected HttpJsonHttpsHealthCheckStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteHttpsHealthCheckMethodDescriptor) .build(); - HttpJsonCallSettings + HttpJsonCallSettings getHttpsHealthCheckTransportSettings = - HttpJsonCallSettings.newBuilder() + HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getHttpsHealthCheckMethodDescriptor) .build(); HttpJsonCallSettings @@ -314,7 +320,7 @@ protected HttpJsonHttpsHealthCheckStub( } @BetaApi - public UnaryCallable + public UnaryCallable getHttpsHealthCheckCallable() { return getHttpsHealthCheckCallable; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index 56beeda780b9..ed43ce6d9584 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -66,6 +66,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalImageName.newFactory()) @@ -85,6 +86,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/{image}/deprecate")) .setQueryParams(Sets.newHashSet("requestId")) @@ -104,6 +106,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalImageName.newFactory()) @@ -123,6 +126,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetFromFamilyImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/family/{family}")) .setQueryParams(Sets.newHashSet()) @@ -143,6 +147,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams(Sets.newHashSet("forceCreate", "requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -162,6 +167,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListImagesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -182,6 +188,7 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/{resource}/setLabels")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index 392f69a3c76d..987c4b18e78e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -76,6 +76,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) @@ -101,6 +103,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/instanceGroupManagers")) .setQueryParams( @@ -122,6 +126,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) @@ -145,6 +151,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) @@ -166,6 +174,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) @@ -187,6 +196,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -209,6 +220,7 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams( @@ -236,6 +248,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) @@ -263,6 +277,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) @@ -284,6 +300,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) @@ -308,6 +326,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) @@ -330,6 +350,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java index 788a010acc13..1de6f6a0ac03 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -71,6 +71,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) @@ -95,6 +96,8 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroups")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -115,6 +118,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) @@ -136,6 +140,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) @@ -157,6 +162,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -176,6 +182,7 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -199,6 +206,8 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")) @@ -222,6 +231,8 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) @@ -243,6 +254,8 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index 05769343420e..2cb7152ca8ba 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -91,6 +91,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/addAccessConfig")) @@ -114,6 +115,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/instances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -134,6 +136,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/attachDisk")) @@ -155,6 +158,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -175,6 +179,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) @@ -197,6 +203,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/detachDisk")) @@ -218,6 +225,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet()) @@ -239,6 +247,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/serialPort")) @@ -260,6 +270,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams( Sets.newHashSet("requestId", "sourceInstanceTemplate")) @@ -280,6 +291,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -300,6 +312,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListReferrersInstancesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/referrers")) @@ -322,6 +335,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) .setQueryParams(Sets.newHashSet("requestId")) @@ -343,6 +357,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")) @@ -364,6 +380,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) @@ -386,6 +403,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setLabels")) @@ -408,6 +426,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMachineResources")) @@ -429,6 +449,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMachineType")) @@ -450,6 +471,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMetadata")) @@ -471,6 +493,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")) @@ -492,6 +515,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setScheduling")) @@ -513,6 +537,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setServiceAccount")) @@ -534,6 +559,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setTags")) @@ -555,6 +581,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) .setQueryParams(Sets.newHashSet("requestId")) @@ -576,6 +603,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) @@ -597,6 +626,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) .setQueryParams(Sets.newHashSet("requestId")) @@ -617,6 +647,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")) @@ -639,6 +671,8 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index bc01f1963a26..1a4abca55ce5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -61,6 +61,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/instanceTemplates/{instanceTemplate}")) @@ -82,6 +83,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/instanceTemplates/{instanceTemplate}")) @@ -103,6 +105,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -122,6 +125,7 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInstanceTemplatesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java index b6878ea5897b..44952dab3864 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java @@ -70,6 +70,8 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/interconnectAttachments")) .setQueryParams( @@ -93,6 +95,8 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) @@ -116,6 +120,7 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) @@ -138,6 +143,8 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) .setQueryParams(Sets.newHashSet("requestId")) @@ -161,6 +168,8 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java index e8c631e04b58..7c323e58ba1c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java @@ -58,6 +58,7 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectLocationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/interconnectLocations/{interconnectLocation}")) @@ -81,6 +82,7 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectLocationsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnectLocations")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java index b1b15eb95a92..7c53ea5eaac0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -62,6 +62,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -82,6 +83,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet()) @@ -102,6 +104,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -121,6 +124,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListInterconnectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -141,6 +145,7 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java index 6d6cb808fb5d..56199ba78943 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java @@ -56,6 +56,7 @@ public class HttpJsonLicenseCodeStub extends LicenseCodeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetLicenseCodeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/licenseCodes/{licenseCode}")) .setQueryParams(Sets.newHashSet()) @@ -79,6 +80,8 @@ public class HttpJsonLicenseCodeStub extends LicenseCodeStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + TestIamPermissionsLicenseCodeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/licenseCodes/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java index a3e2dbb86fb3..2cff99d85cfd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -64,6 +64,7 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) @@ -83,6 +84,7 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) @@ -102,6 +104,7 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -121,6 +124,7 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListLicensesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -143,6 +147,7 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(TestIamPermissionsLicenseHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/licenses/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java index 3481d3b7a886..61b731aec0ce 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java @@ -64,6 +64,8 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + AggregatedListMachineTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/machineTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -84,6 +86,7 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetMachineTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}")) .setQueryParams(Sets.newHashSet()) @@ -104,6 +107,7 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListMachineTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java index e6749f921a7b..74017edbc6fb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -65,6 +65,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddPeeringNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/networks/{network}/addPeering")) .setQueryParams(Sets.newHashSet("requestId")) @@ -85,6 +86,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -104,6 +106,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -123,6 +126,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -142,6 +146,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListNetworksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -162,6 +167,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -181,6 +187,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemovePeeringNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/networks/{network}/removePeering")) .setQueryParams(Sets.newHashSet("requestId")) @@ -201,6 +208,7 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/networks/{network}/switchToCustomMode")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index e85bff516d78..d1567f5830c6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -70,6 +70,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DisableXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/disableXpnHost")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -89,6 +90,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DisableXpnResourceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/disableXpnResource")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -108,6 +110,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(EnableXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/enableXpnHost")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,6 +130,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(EnableXpnResourceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/enableXpnResource")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -146,6 +150,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectName.newFactory()) @@ -165,6 +170,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/getXpnHost")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectName.newFactory()) @@ -186,6 +192,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/getXpnResources")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) @@ -206,6 +213,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListXpnHostsProjectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/listXpnHosts")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) @@ -226,6 +234,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveDisk")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -245,6 +254,7 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveInstance")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -265,6 +275,8 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -285,6 +297,8 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java index 14edae389a0e..a334a165b06e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -63,6 +63,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/autoscalers/{autoscaler}")) @@ -84,6 +85,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/autoscalers/{autoscaler}")) @@ -105,6 +107,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -125,6 +128,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams( @@ -146,6 +150,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) @@ -166,6 +171,7 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java index dda6e4aa0ab3..29fb7291a39f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -65,6 +65,8 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -86,6 +88,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -110,6 +113,8 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}/getHealth")) @@ -131,6 +136,8 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + InsertRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams(Sets.newHashSet("requestId")) @@ -151,6 +158,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams( @@ -172,6 +180,7 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -193,6 +202,8 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java index 5dfe80b2b250..c029a17b62dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java @@ -67,6 +67,8 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/commitments")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -87,6 +89,7 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionCommitmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/commitments/{commitment}")) @@ -108,6 +111,7 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionCommitmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/commitments")) .setQueryParams(Sets.newHashSet("requestId")) @@ -128,6 +132,7 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionCommitmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/commitments")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index cb4fbae5818d..9ea79f7beef7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -72,6 +72,9 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AbandonInstancesRegionInstanceGroupManagerHttpRequest + .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) @@ -94,6 +97,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) @@ -118,6 +123,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) @@ -142,6 +149,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) @@ -164,6 +173,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -188,6 +199,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams( @@ -215,6 +228,9 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListManagedInstancesRegionInstanceGroupManagersHttpRequest + .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) @@ -242,6 +258,9 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + RecreateInstancesRegionInstanceGroupManagerHttpRequest + .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) @@ -264,6 +283,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) @@ -288,6 +309,9 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetInstanceTemplateRegionInstanceGroupManagerHttpRequest + .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) @@ -312,6 +336,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java index a3449b0d5f30..5ec45e732bab 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -63,6 +63,7 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}")) @@ -86,6 +87,7 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroups")) .setQueryParams( @@ -111,6 +113,8 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")) @@ -134,6 +138,8 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java index b29c529b77b9..da8b445f7610 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java @@ -59,6 +59,7 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -75,6 +76,7 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -95,6 +97,7 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java index 873fb2367dac..f4ada3539b17 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java @@ -57,6 +57,7 @@ public class HttpJsonRegionStub extends RegionStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -76,6 +77,7 @@ public class HttpJsonRegionStub extends RegionStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index 1e148d400c27..454da75c6930 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -61,6 +61,7 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) @@ -79,6 +80,7 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) @@ -98,6 +100,7 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -117,6 +120,7 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index f47074367384..6840b113e982 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -71,6 +71,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListRoutersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/routers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -91,6 +92,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -110,6 +112,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet()) @@ -130,6 +133,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRouterStatusRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/routers/{router}/getRouterStatus")) @@ -151,6 +155,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -170,6 +175,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRoutersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -190,6 +196,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -210,6 +217,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PreviewRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/routers/{router}/preview")) @@ -231,6 +239,7 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 5cc1d823aa4c..5fdf58c8c7a1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -62,6 +62,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) @@ -81,6 +82,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) @@ -100,6 +102,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSnapshotsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -120,6 +123,7 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/snapshots/{resource}/setLabels")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java index e1745d8b7bc4..8d534e6e71e1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -61,6 +61,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -81,6 +82,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet()) @@ -101,6 +103,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -120,6 +123,7 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSslCertificatesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java index 7d2aa520fa59..d3d8945ccdd7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java @@ -64,6 +64,7 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,6 +85,7 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet()) @@ -104,6 +106,7 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -123,6 +126,7 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSslPoliciesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,6 +152,8 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ListAvailableFeaturesSslPoliciesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/listAvailableFeatures")) .setQueryParams( @@ -171,6 +177,7 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index c49c72f72b9b..368173fdb653 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -70,6 +70,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListSubnetworksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/subnetworks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,6 +91,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -112,6 +114,8 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) @@ -133,6 +137,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -154,6 +159,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams(Sets.newHashSet("requestId")) @@ -174,6 +180,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListSubnetworksHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams( @@ -195,6 +202,7 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -217,6 +225,8 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java index 9b774747118b..b8b409dc14d5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -63,6 +63,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpProxies/{targetHttpProxy}")) @@ -84,6 +85,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpProxies/{targetHttpProxy}")) @@ -105,6 +107,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,6 +127,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetHttpProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -144,6 +148,7 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index 1e017d23839e..ecdb1d01ac5c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -65,6 +65,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) @@ -86,6 +87,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) @@ -107,6 +109,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -126,6 +129,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -147,6 +151,8 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) @@ -169,6 +175,8 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetSslPolicyTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")) @@ -190,6 +198,7 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java index 6c72a4757756..75f70874fa4f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -68,6 +68,8 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/targetInstances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -88,6 +90,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/targetInstances/{targetInstance}")) @@ -109,6 +112,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/targetInstances/{targetInstance}")) @@ -130,6 +134,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams(Sets.newHashSet("requestId")) @@ -150,6 +155,7 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetInstancesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java index 4f7711c7a176..833ffc5c5ea0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -72,6 +72,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) @@ -93,6 +94,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/addInstance")) @@ -116,6 +118,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/targetPools")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -136,6 +139,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}")) @@ -157,6 +161,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}")) @@ -178,6 +183,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetHealthTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/getHealth")) @@ -199,6 +205,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams(Sets.newHashSet("requestId")) @@ -219,6 +226,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetPoolsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams( @@ -241,6 +249,8 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) @@ -262,6 +272,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) @@ -283,6 +294,7 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/setBackup")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index ed85e9da385d..1261642c4672 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -65,6 +65,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -85,6 +86,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) .setQueryParams(Sets.newHashSet()) @@ -105,6 +107,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,6 +127,7 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -145,6 +149,8 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) @@ -167,6 +173,8 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) @@ -189,6 +197,8 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) @@ -210,6 +220,8 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance( + SetSslPolicyTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java index f9730e9be9ad..4773e569571a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java @@ -63,6 +63,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -83,6 +84,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) .setQueryParams(Sets.newHashSet()) @@ -103,6 +105,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -122,6 +125,7 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetTcpProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -143,6 +147,8 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")) @@ -165,6 +171,8 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java index fecf358a7ac4..f76dc9f7befe 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -69,6 +69,8 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() + .setRequestInstance( + AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/targetVpnGateways")) .setQueryParams( @@ -90,6 +92,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) @@ -111,6 +114,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) @@ -132,6 +136,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams(Sets.newHashSet("requestId")) @@ -152,6 +157,7 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index e50d38214193..056c98ad0fdc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -66,6 +66,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -84,6 +85,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -103,6 +105,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -122,6 +125,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) .setQueryParams(Sets.newHashSet("requestId")) @@ -142,6 +146,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -162,6 +167,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -181,6 +187,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -200,6 +207,7 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java index f5c8756cc4a8..adf45ca0d010 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -67,6 +67,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/vpnTunnels")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -87,6 +88,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -107,6 +109,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet()) @@ -127,6 +130,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -146,6 +150,7 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListVpnTunnelsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java index 76ecb0954782..f89a38af5a8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java @@ -59,6 +59,7 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteZoneOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -75,6 +76,7 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetZoneOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -95,6 +97,7 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListZoneOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java index 2e5d57eedf72..fcf298ddb2df 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java @@ -57,6 +57,7 @@ public class HttpJsonZoneStub extends ZoneStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetZoneHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -76,6 +77,7 @@ public class HttpJsonZoneStub extends ZoneStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListZonesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java index dbd16579a853..fd8c36e81bdb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java @@ -22,7 +22,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; +import com.google.cloud.compute.v1.HttpsHealthCheck2; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -48,7 +48,7 @@ public abstract class HttpsHealthCheckStub implements BackgroundResource { } @BetaApi - public UnaryCallable + public UnaryCallable getHttpsHealthCheckCallable() { throw new UnsupportedOperationException("Not implemented: getHttpsHealthCheckCallable()"); } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java index 3698c670fda5..e32cc939ca47 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java @@ -41,7 +41,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.GetHttpsHealthCheckHttpRequest; -import com.google.cloud.compute.v1.HttpsHealthCheck; +import com.google.cloud.compute.v1.HttpsHealthCheck2; import com.google.cloud.compute.v1.HttpsHealthCheckList; import com.google.cloud.compute.v1.InsertHttpsHealthCheckHttpRequest; import com.google.cloud.compute.v1.ListHttpsHealthChecksHttpRequest; @@ -100,7 +100,7 @@ public class HttpsHealthCheckStubSettings extends StubSettings deleteHttpsHealthCheckSettings; - private final UnaryCallSettings + private final UnaryCallSettings getHttpsHealthCheckSettings; private final UnaryCallSettings insertHttpsHealthCheckSettings; @@ -120,7 +120,7 @@ public class HttpsHealthCheckStubSettings extends StubSettings + public UnaryCallSettings getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } @@ -235,10 +235,10 @@ protected HttpsHealthCheckStubSettings(Builder settingsBuilder) throws IOExcepti } private static final PagedListDescriptor< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck> + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2> LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC = new PagedListDescriptor< - ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck>() { + ListHttpsHealthChecksHttpRequest, HttpsHealthCheckList, HttpsHealthCheck2>() { @Override public String emptyToken() { return ""; @@ -271,7 +271,7 @@ public String extractNextToken(HttpsHealthCheckList payload) { } @Override - public Iterable extractResources(HttpsHealthCheckList payload) { + public Iterable extractResources(HttpsHealthCheckList payload) { return payload.getItemsList(); } }; @@ -289,7 +289,7 @@ public ApiFuture getFuturePagedResponse( ListHttpsHealthChecksHttpRequest request, ApiCallContext context, ApiFuture futureResponse) { - PageContext + PageContext pageContext = PageContext.create( callable, LIST_HTTPS_HEALTH_CHECKS_PAGE_STR_DESC, request, context); @@ -303,7 +303,7 @@ public static class Builder extends StubSettings.Builder deleteHttpsHealthCheckSettings; - private final UnaryCallSettings.Builder + private final UnaryCallSettings.Builder getHttpsHealthCheckSettings; private final UnaryCallSettings.Builder insertHttpsHealthCheckSettings; @@ -469,7 +469,7 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to getHttpsHealthCheck. */ - public UnaryCallSettings.Builder + public UnaryCallSettings.Builder getHttpsHealthCheckSettings() { return getHttpsHealthCheckSettings; } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index 77f3d4937785..e0af34e68892 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -194,8 +194,8 @@ public void getHttpHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpHealthCheck expectedResponse = - HttpHealthCheck.newBuilder() + HttpHealthCheck2 expectedResponse = + HttpHealthCheck2.newBuilder() .setCheckIntervalSec(checkIntervalSec) .setKind(kind) .setDescription(description) @@ -215,7 +215,7 @@ public void getHttpHealthCheckTest() { ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck actualResponse = client.getHttpHealthCheck(httpHealthCheck); + HttpHealthCheck2 actualResponse = client.getHttpHealthCheck(httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -304,7 +304,7 @@ public void insertHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); @@ -336,7 +336,7 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); Assert.fail("No exception raised"); @@ -352,8 +352,8 @@ public void listHttpHealthChecksTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - HttpHealthCheck itemsElement = HttpHealthCheck.newBuilder().build(); - List items = Arrays.asList(itemsElement); + HttpHealthCheck2 itemsElement = HttpHealthCheck2.newBuilder().build(); + List items = Arrays.asList(itemsElement); HttpHealthCheckList expectedResponse = HttpHealthCheckList.newBuilder() .setKind(kind) @@ -368,7 +368,7 @@ public void listHttpHealthChecksTest() { ListHttpHealthChecksPagedResponse pagedListResponse = client.listHttpHealthChecks(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); @@ -458,7 +458,7 @@ public void patchHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -491,7 +491,7 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); @@ -553,7 +553,7 @@ public void updateHttpHealthCheckTest() { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); @@ -586,7 +586,7 @@ public void updateHttpHealthCheckExceptionTest() throws Exception { String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - HttpHealthCheck httpHealthCheckResource = HttpHealthCheck.newBuilder().build(); + HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index d4eb7be0cc59..efe3e12c9789 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -194,8 +194,8 @@ public void getHttpsHealthCheckTest() { Integer healthyThreshold = 133658551; String id = "id3355"; String requestPath = "requestPath1303145429"; - HttpsHealthCheck expectedResponse = - HttpsHealthCheck.newBuilder() + HttpsHealthCheck2 expectedResponse = + HttpsHealthCheck2.newBuilder() .setCheckIntervalSec(checkIntervalSec) .setKind(kind) .setDescription(description) @@ -215,7 +215,7 @@ public void getHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - HttpsHealthCheck actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); + HttpsHealthCheck2 actualResponse = client.getHttpsHealthCheck(httpsHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -304,7 +304,7 @@ public void insertHttpsHealthCheckTest() { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); @@ -336,7 +336,7 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { try { String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); Assert.fail("No exception raised"); @@ -352,8 +352,8 @@ public void listHttpsHealthChecksTest() { String nextPageToken = ""; String id = "id3355"; String selfLink = "selfLink-1691268851"; - HttpsHealthCheck itemsElement = HttpsHealthCheck.newBuilder().build(); - List items = Arrays.asList(itemsElement); + HttpsHealthCheck2 itemsElement = HttpsHealthCheck2.newBuilder().build(); + List items = Arrays.asList(itemsElement); HttpsHealthCheckList expectedResponse = HttpsHealthCheckList.newBuilder() .setKind(kind) @@ -368,7 +368,7 @@ public void listHttpsHealthChecksTest() { ListHttpsHealthChecksPagedResponse pagedListResponse = client.listHttpsHealthChecks(project); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); @@ -458,7 +458,7 @@ public void patchHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); @@ -491,7 +491,7 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); @@ -553,7 +553,7 @@ public void updateHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); @@ -586,7 +586,7 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); String requestId = "requestId37109963"; - HttpsHealthCheck httpsHealthCheckResource = HttpsHealthCheck.newBuilder().build(); + HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); Assert.fail("No exception raised"); From 85f8fa6c6ef14f58d2cc91bb80f5877beb1011e7 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 4 May 2018 00:15:36 -0700 Subject: [PATCH 34/42] add gax testlib to bom --- google-cloud-bom/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 181af91705a7..30565e144543 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -152,6 +152,12 @@ gax 1.27.0 + + com.google.api + gax + 1.25.0 + testlib + com.google.api gax-grpc From e5ea47dcb5c519cbfb25c8a2b94bc00fc3167d54 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 4 May 2018 00:16:05 -0700 Subject: [PATCH 35/42] remove JsonComputeExample --- .../discocompute/JsonComputeExample.java | 144 ------------------ 1 file changed, 144 deletions(-) delete mode 100644 google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java deleted file mode 100644 index 3fb3510ed0cc..000000000000 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/discocompute/JsonComputeExample.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.google.cloud.examples.discocompute; - -import com.google.api.core.ApiFuture; -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.auth.Credentials; -import com.google.auth.oauth2.GoogleCredentials; -import com.google.cloud.compute.v1.*; - -import java.io.IOException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; - -/** - * Use gax-java and generated message type to List Addresses in a test GCP Compute project. - */ -public class JsonComputeExample { - private static String PROJECT_NAME = "gapic-test"; - private static String REGION = "us-central1"; - - public static void main(String[] args) throws Exception { - try { - AddressClient addressClient = createCredentialedClient(); - runExampleWithGapicGen(addressClient); - System.out.println("-------------------------------------------------------"); - runExampleWithGapicGenResourceName(addressClient); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private static AddressClient createCredentialedClient() throws IOException { - Credentials myCredentials = GoogleCredentials.getApplicationDefault(); - String myEndpoint = AddressSettings.getDefaultEndpoint(); - - // Begin samplegen code. This combines the "customize credentials" and "customize the endpoint" samples. - AddressSettings addressSettings = - AddressSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .setTransportChannelProvider( - AddressSettings.defaultHttpJsonTransportProviderBuilder() - .setEndpoint(myEndpoint).build()).build(); - AddressClient addressClient = - AddressClient.create(addressSettings); - // End samplegen code. - - return addressClient; - } - - // A basic List Address example. - private static void runExampleWithGapicGen(AddressClient client) { - System.out.println("Running with Gapic Client."); - AddressClient.ListAddressesPagedResponse listResponse = listAddresses(client); - verifyListAddressWithGets(client, listResponse); - } - - // Insert an address, and then delete the address. Use ResourceNames in the request objects. - private static void runExampleWithGapicGenResourceName(AddressClient client) { - System.out.println("Running with Gapic Client and Resource Name."); - String newAddressName = "usseaparkview"; - System.out.println("Inserting address:"); - - insertNewAddressJustClient(client, newAddressName); - - listAddresses(client); - - System.out.println("Deleting address:"); - Operation deleteResponse = client.deleteAddress( - ProjectRegionAddressName.of(newAddressName, PROJECT_NAME, REGION), null); - System.out.format("Result of delete: %s\n", deleteResponse.toString()); - int sleepTimeInSeconds = 3; - System.out.format("Waiting %d seconds for server to update...\n", sleepTimeInSeconds); - // Wait for the delete operation to finish on the server. - try { - TimeUnit.SECONDS.sleep(sleepTimeInSeconds); - } catch (InterruptedException e) { - e.printStackTrace(); - } - listAddresses(client); - } - - private static void insertNewAddressJustClient(AddressClient client, String newAddressName) { - // Begin samplegen code for insertAddress(). - Address newAddress = Address.newBuilder().setName(newAddressName).build(); - ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION); - Operation response = client.insertAddress(null, region, newAddress); - // End samplegen code for insertAddress(). - System.out.format("Result of insert: %s\n", response.toString()); - } - - private static void insertNewAddressUsingRequest(AddressClient client, String newAddressName) - throws InterruptedException, ExecutionException { - // Begin samplegen code for insertAddress(). - ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION); - Address address = Address.newBuilder().build(); - InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() - .setRegion(region.toString()) - .setAddressResource(address) - .build(); - // Do something - Operation response = client.insertAddress(request); - - // End samplegen code for insertAddress(). - System.out.format("Result of insert: %s\n", response.toString()); - } - - private static void insertAddressUsingCallable(AddressClient client, String newAddressName) - throws InterruptedException, ExecutionException { - // Begin samplegen code for insertAddress(). - ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION); - Address address = Address.newBuilder().build(); - InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() - .setRegion(region.toString()) - .setAddressResource(address) - .build(); - ApiFuture future = client.insertAddressCallable().futureCall(request); - // Do something - Operation response = future.get(); - - // End samplegen code for insertAddress(). - System.out.format("Result of insert: %s\n", response.toString()); - } - - private static AddressClient.ListAddressesPagedResponse listAddresses(AddressClient client) { - System.out.println("Listing addresses:"); - ProjectRegionName regionName = ProjectRegionName.newBuilder().setRegion(REGION).setProject(PROJECT_NAME).build(); - ListAddressesHttpRequest listRequest = ListAddressesHttpRequest.newBuilder() - .setRegion(regionName.toString()) - .build(); - AddressClient.ListAddressesPagedResponse response = client.listAddresses(listRequest); - for (Address address : response.iterateAll()) { - System.out.println("\t - " + address.toString()); - } - return response; - } - - private static void verifyListAddressWithGets(AddressClient client, AddressClient.ListAddressesPagedResponse listResponse) { - for (Address address : listResponse.iterateAll()) { - System.out.format("Making get request for address \"%s\"...\n", address.getName()); - Address fetchedAddress = client.getAddress( - ProjectRegionAddressName.of(address.getName(), PROJECT_NAME, REGION)); - System.out.format("addresses.get returns \n\t%s\n\n", fetchedAddress.toString()); - } - } -} \ No newline at end of file From 99fefb5af769e46de5381a0fe628a7880a46e00d Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 4 May 2018 00:21:12 -0700 Subject: [PATCH 36/42] delete repeated files --- .../cloud/compute/v1/HTTPHealthCheck.java | 263 --------- .../cloud/compute/v1/HTTPSHealthCheck.java | 263 --------- .../cloud/compute/v1/HttpsHealthCheck.java | 533 ------------------ 3 files changed, 1059 deletions(-) delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java delete mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java deleted file mode 100644 index a58c93c3ea87..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPHealthCheck.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.List; -import java.util.Objects; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class HTTPHealthCheck implements ApiMessage { - private final String host; - private final Integer port; - private final String portName; - private final String proxyHeader; - private final String requestPath; - - private HTTPHealthCheck() { - this.host = null; - this.port = null; - this.portName = null; - this.proxyHeader = null; - this.requestPath = null; - } - - private HTTPHealthCheck( - String host, Integer port, String portName, String proxyHeader, String requestPath) { - this.host = host; - this.port = port; - this.portName = portName; - this.proxyHeader = proxyHeader; - this.requestPath = requestPath; - } - - @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("host")) { - return host; - } - if (fieldName.equals("port")) { - return port; - } - if (fieldName.equals("portName")) { - return portName; - } - if (fieldName.equals("proxyHeader")) { - return proxyHeader; - } - if (fieldName.equals("requestPath")) { - return requestPath; - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - @Nullable - @Override - public List getFieldMask() { - return null; - } - - public String getHost() { - return host; - } - - public Integer getPort() { - return port; - } - - public String getPortName() { - return portName; - } - - public String getProxyHeader() { - return proxyHeader; - } - - public String getRequestPath() { - return requestPath; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(HTTPHealthCheck prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static HTTPHealthCheck getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final HTTPHealthCheck DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new HTTPHealthCheck(); - } - - public static class Builder { - private String host; - private Integer port; - private String portName; - private String proxyHeader; - private String requestPath; - - Builder() {} - - public Builder mergeFrom(HTTPHealthCheck other) { - if (other == HTTPHealthCheck.getDefaultInstance()) return this; - if (other.getHost() != null) { - this.host = other.host; - } - if (other.getPort() != null) { - this.port = other.port; - } - if (other.getPortName() != null) { - this.portName = other.portName; - } - if (other.getProxyHeader() != null) { - this.proxyHeader = other.proxyHeader; - } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - return this; - } - - Builder(HTTPHealthCheck source) { - this.host = source.host; - this.port = source.port; - this.portName = source.portName; - this.proxyHeader = source.proxyHeader; - this.requestPath = source.requestPath; - } - - public String getHost() { - return host; - } - - public Builder setHost(String host) { - this.host = host; - return this; - } - - public Integer getPort() { - return port; - } - - public Builder setPort(Integer port) { - this.port = port; - return this; - } - - public String getPortName() { - return portName; - } - - public Builder setPortName(String portName) { - this.portName = portName; - return this; - } - - public String getProxyHeader() { - return proxyHeader; - } - - public Builder setProxyHeader(String proxyHeader) { - this.proxyHeader = proxyHeader; - return this; - } - - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public HTTPHealthCheck build() { - - return new HTTPHealthCheck(host, port, portName, proxyHeader, requestPath); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setHost(this.host); - newBuilder.setPort(this.port); - newBuilder.setPortName(this.portName); - newBuilder.setProxyHeader(this.proxyHeader); - newBuilder.setRequestPath(this.requestPath); - return newBuilder; - } - } - - @Override - public String toString() { - return "HTTPHealthCheck{" - + "host=" - + host - + ", " - + "port=" - + port - + ", " - + "portName=" - + portName - + ", " - + "proxyHeader=" - + proxyHeader - + ", " - + "requestPath=" - + requestPath - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof HTTPHealthCheck) { - HTTPHealthCheck that = (HTTPHealthCheck) o; - return Objects.equals(this.host, that.getHost()) - && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.portName, that.getPortName()) - && Objects.equals(this.proxyHeader, that.getProxyHeader()) - && Objects.equals(this.requestPath, that.getRequestPath()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash(host, port, portName, proxyHeader, requestPath); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java deleted file mode 100644 index 1d227cce318c..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HTTPSHealthCheck.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.List; -import java.util.Objects; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class HTTPSHealthCheck implements ApiMessage { - private final String host; - private final Integer port; - private final String portName; - private final String proxyHeader; - private final String requestPath; - - private HTTPSHealthCheck() { - this.host = null; - this.port = null; - this.portName = null; - this.proxyHeader = null; - this.requestPath = null; - } - - private HTTPSHealthCheck( - String host, Integer port, String portName, String proxyHeader, String requestPath) { - this.host = host; - this.port = port; - this.portName = portName; - this.proxyHeader = proxyHeader; - this.requestPath = requestPath; - } - - @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("host")) { - return host; - } - if (fieldName.equals("port")) { - return port; - } - if (fieldName.equals("portName")) { - return portName; - } - if (fieldName.equals("proxyHeader")) { - return proxyHeader; - } - if (fieldName.equals("requestPath")) { - return requestPath; - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - @Nullable - @Override - public List getFieldMask() { - return null; - } - - public String getHost() { - return host; - } - - public Integer getPort() { - return port; - } - - public String getPortName() { - return portName; - } - - public String getProxyHeader() { - return proxyHeader; - } - - public String getRequestPath() { - return requestPath; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(HTTPSHealthCheck prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static HTTPSHealthCheck getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final HTTPSHealthCheck DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new HTTPSHealthCheck(); - } - - public static class Builder { - private String host; - private Integer port; - private String portName; - private String proxyHeader; - private String requestPath; - - Builder() {} - - public Builder mergeFrom(HTTPSHealthCheck other) { - if (other == HTTPSHealthCheck.getDefaultInstance()) return this; - if (other.getHost() != null) { - this.host = other.host; - } - if (other.getPort() != null) { - this.port = other.port; - } - if (other.getPortName() != null) { - this.portName = other.portName; - } - if (other.getProxyHeader() != null) { - this.proxyHeader = other.proxyHeader; - } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - return this; - } - - Builder(HTTPSHealthCheck source) { - this.host = source.host; - this.port = source.port; - this.portName = source.portName; - this.proxyHeader = source.proxyHeader; - this.requestPath = source.requestPath; - } - - public String getHost() { - return host; - } - - public Builder setHost(String host) { - this.host = host; - return this; - } - - public Integer getPort() { - return port; - } - - public Builder setPort(Integer port) { - this.port = port; - return this; - } - - public String getPortName() { - return portName; - } - - public Builder setPortName(String portName) { - this.portName = portName; - return this; - } - - public String getProxyHeader() { - return proxyHeader; - } - - public Builder setProxyHeader(String proxyHeader) { - this.proxyHeader = proxyHeader; - return this; - } - - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public HTTPSHealthCheck build() { - - return new HTTPSHealthCheck(host, port, portName, proxyHeader, requestPath); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setHost(this.host); - newBuilder.setPort(this.port); - newBuilder.setPortName(this.portName); - newBuilder.setProxyHeader(this.proxyHeader); - newBuilder.setRequestPath(this.requestPath); - return newBuilder; - } - } - - @Override - public String toString() { - return "HTTPSHealthCheck{" - + "host=" - + host - + ", " - + "port=" - + port - + ", " - + "portName=" - + portName - + ", " - + "proxyHeader=" - + proxyHeader - + ", " - + "requestPath=" - + requestPath - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof HTTPSHealthCheck) { - HTTPSHealthCheck that = (HTTPSHealthCheck) o; - return Objects.equals(this.host, that.getHost()) - && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.portName, that.getPortName()) - && Objects.equals(this.proxyHeader, that.getProxyHeader()) - && Objects.equals(this.requestPath, that.getRequestPath()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash(host, port, portName, proxyHeader, requestPath); - } -} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java deleted file mode 100644 index b5357d980d6e..000000000000 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck.java +++ /dev/null @@ -1,533 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.compute.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.ApiMessage; -import java.util.List; -import java.util.Objects; -import javax.annotation.Generated; -import javax.annotation.Nullable; - -@Generated("by GAPIC") -@BetaApi -public final class HttpsHealthCheck implements ApiMessage { - private final Integer checkIntervalSec; - private final String creationTimestamp; - private final String description; - private final Integer healthyThreshold; - private final String host; - private final String id; - private final String kind; - private final String name; - private final Integer port; - private final String requestPath; - private final String selfLink; - private final Integer timeoutSec; - private final Integer unhealthyThreshold; - - private HttpsHealthCheck() { - this.checkIntervalSec = null; - this.creationTimestamp = null; - this.description = null; - this.healthyThreshold = null; - this.host = null; - this.id = null; - this.kind = null; - this.name = null; - this.port = null; - this.requestPath = null; - this.selfLink = null; - this.timeoutSec = null; - this.unhealthyThreshold = null; - } - - private HttpsHealthCheck( - Integer checkIntervalSec, - String creationTimestamp, - String description, - Integer healthyThreshold, - String host, - String id, - String kind, - String name, - Integer port, - String requestPath, - String selfLink, - Integer timeoutSec, - Integer unhealthyThreshold) { - this.checkIntervalSec = checkIntervalSec; - this.creationTimestamp = creationTimestamp; - this.description = description; - this.healthyThreshold = healthyThreshold; - this.host = host; - this.id = id; - this.kind = kind; - this.name = name; - this.port = port; - this.requestPath = requestPath; - this.selfLink = selfLink; - this.timeoutSec = timeoutSec; - this.unhealthyThreshold = unhealthyThreshold; - } - - @Override - public Object getFieldValue(String fieldName) { - if (fieldName.equals("checkIntervalSec")) { - return checkIntervalSec; - } - if (fieldName.equals("creationTimestamp")) { - return creationTimestamp; - } - if (fieldName.equals("description")) { - return description; - } - if (fieldName.equals("healthyThreshold")) { - return healthyThreshold; - } - if (fieldName.equals("host")) { - return host; - } - if (fieldName.equals("id")) { - return id; - } - if (fieldName.equals("kind")) { - return kind; - } - if (fieldName.equals("name")) { - return name; - } - if (fieldName.equals("port")) { - return port; - } - if (fieldName.equals("requestPath")) { - return requestPath; - } - if (fieldName.equals("selfLink")) { - return selfLink; - } - if (fieldName.equals("timeoutSec")) { - return timeoutSec; - } - if (fieldName.equals("unhealthyThreshold")) { - return unhealthyThreshold; - } - return null; - } - - @Nullable - @Override - public ApiMessage getApiMessageRequestBody() { - return null; - } - - @Nullable - @Override - public List getFieldMask() { - return null; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public String getDescription() { - return description; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public String getHost() { - return host; - } - - public String getId() { - return id; - } - - public String getKind() { - return kind; - } - - public String getName() { - return name; - } - - public Integer getPort() { - return port; - } - - public String getRequestPath() { - return requestPath; - } - - public String getSelfLink() { - return selfLink; - } - - public Integer getTimeoutSec() { - return timeoutSec; - } - - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(HttpsHealthCheck prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - public static HttpsHealthCheck getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final HttpsHealthCheck DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new HttpsHealthCheck(); - } - - public static class Builder { - private Integer checkIntervalSec; - private String creationTimestamp; - private String description; - private Integer healthyThreshold; - private String host; - private String id; - private String kind; - private String name; - private Integer port; - private String requestPath; - private String selfLink; - private Integer timeoutSec; - private Integer unhealthyThreshold; - - Builder() {} - - public Builder mergeFrom(HttpsHealthCheck other) { - if (other == HttpsHealthCheck.getDefaultInstance()) return this; - if (other.getCheckIntervalSec() != null) { - this.checkIntervalSec = other.checkIntervalSec; - } - if (other.getCreationTimestamp() != null) { - this.creationTimestamp = other.creationTimestamp; - } - if (other.getDescription() != null) { - this.description = other.description; - } - if (other.getHealthyThreshold() != null) { - this.healthyThreshold = other.healthyThreshold; - } - if (other.getHost() != null) { - this.host = other.host; - } - if (other.getId() != null) { - this.id = other.id; - } - if (other.getKind() != null) { - this.kind = other.kind; - } - if (other.getName() != null) { - this.name = other.name; - } - if (other.getPort() != null) { - this.port = other.port; - } - if (other.getRequestPath() != null) { - this.requestPath = other.requestPath; - } - if (other.getSelfLink() != null) { - this.selfLink = other.selfLink; - } - if (other.getTimeoutSec() != null) { - this.timeoutSec = other.timeoutSec; - } - if (other.getUnhealthyThreshold() != null) { - this.unhealthyThreshold = other.unhealthyThreshold; - } - return this; - } - - Builder(HttpsHealthCheck source) { - this.checkIntervalSec = source.checkIntervalSec; - this.creationTimestamp = source.creationTimestamp; - this.description = source.description; - this.healthyThreshold = source.healthyThreshold; - this.host = source.host; - this.id = source.id; - this.kind = source.kind; - this.name = source.name; - this.port = source.port; - this.requestPath = source.requestPath; - this.selfLink = source.selfLink; - this.timeoutSec = source.timeoutSec; - this.unhealthyThreshold = source.unhealthyThreshold; - } - - public Integer getCheckIntervalSec() { - return checkIntervalSec; - } - - public Builder setCheckIntervalSec(Integer checkIntervalSec) { - this.checkIntervalSec = checkIntervalSec; - return this; - } - - public String getCreationTimestamp() { - return creationTimestamp; - } - - public Builder setCreationTimestamp(String creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - public String getDescription() { - return description; - } - - public Builder setDescription(String description) { - this.description = description; - return this; - } - - public Integer getHealthyThreshold() { - return healthyThreshold; - } - - public Builder setHealthyThreshold(Integer healthyThreshold) { - this.healthyThreshold = healthyThreshold; - return this; - } - - public String getHost() { - return host; - } - - public Builder setHost(String host) { - this.host = host; - return this; - } - - public String getId() { - return id; - } - - public Builder setId(String id) { - this.id = id; - return this; - } - - public String getKind() { - return kind; - } - - public Builder setKind(String kind) { - this.kind = kind; - return this; - } - - public String getName() { - return name; - } - - public Builder setName(String name) { - this.name = name; - return this; - } - - public Integer getPort() { - return port; - } - - public Builder setPort(Integer port) { - this.port = port; - return this; - } - - public String getRequestPath() { - return requestPath; - } - - public Builder setRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - public String getSelfLink() { - return selfLink; - } - - public Builder setSelfLink(String selfLink) { - this.selfLink = selfLink; - return this; - } - - public Integer getTimeoutSec() { - return timeoutSec; - } - - public Builder setTimeoutSec(Integer timeoutSec) { - this.timeoutSec = timeoutSec; - return this; - } - - public Integer getUnhealthyThreshold() { - return unhealthyThreshold; - } - - public Builder setUnhealthyThreshold(Integer unhealthyThreshold) { - this.unhealthyThreshold = unhealthyThreshold; - return this; - } - - public HttpsHealthCheck build() { - - return new HttpsHealthCheck( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); - } - - public Builder clone() { - Builder newBuilder = new Builder(); - newBuilder.setCheckIntervalSec(this.checkIntervalSec); - newBuilder.setCreationTimestamp(this.creationTimestamp); - newBuilder.setDescription(this.description); - newBuilder.setHealthyThreshold(this.healthyThreshold); - newBuilder.setHost(this.host); - newBuilder.setId(this.id); - newBuilder.setKind(this.kind); - newBuilder.setName(this.name); - newBuilder.setPort(this.port); - newBuilder.setRequestPath(this.requestPath); - newBuilder.setSelfLink(this.selfLink); - newBuilder.setTimeoutSec(this.timeoutSec); - newBuilder.setUnhealthyThreshold(this.unhealthyThreshold); - return newBuilder; - } - } - - @Override - public String toString() { - return "HttpsHealthCheck{" - + "checkIntervalSec=" - + checkIntervalSec - + ", " - + "creationTimestamp=" - + creationTimestamp - + ", " - + "description=" - + description - + ", " - + "healthyThreshold=" - + healthyThreshold - + ", " - + "host=" - + host - + ", " - + "id=" - + id - + ", " - + "kind=" - + kind - + ", " - + "name=" - + name - + ", " - + "port=" - + port - + ", " - + "requestPath=" - + requestPath - + ", " - + "selfLink=" - + selfLink - + ", " - + "timeoutSec=" - + timeoutSec - + ", " - + "unhealthyThreshold=" - + unhealthyThreshold - + "}"; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof HttpsHealthCheck) { - HttpsHealthCheck that = (HttpsHealthCheck) o; - return Objects.equals(this.checkIntervalSec, that.getCheckIntervalSec()) - && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) - && Objects.equals(this.description, that.getDescription()) - && Objects.equals(this.healthyThreshold, that.getHealthyThreshold()) - && Objects.equals(this.host, that.getHost()) - && Objects.equals(this.id, that.getId()) - && Objects.equals(this.kind, that.getKind()) - && Objects.equals(this.name, that.getName()) - && Objects.equals(this.port, that.getPort()) - && Objects.equals(this.requestPath, that.getRequestPath()) - && Objects.equals(this.selfLink, that.getSelfLink()) - && Objects.equals(this.timeoutSec, that.getTimeoutSec()) - && Objects.equals(this.unhealthyThreshold, that.getUnhealthyThreshold()); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash( - checkIntervalSec, - creationTimestamp, - description, - healthyThreshold, - host, - id, - kind, - name, - port, - requestPath, - selfLink, - timeoutSec, - unhealthyThreshold); - } -} From d21c30816a624f615e943a1d9a3a2b3ac658a256 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 16 May 2018 10:33:09 -0700 Subject: [PATCH 37/42] regen from latest discovery doc --- .../compute/v1/AcceleratorTypeClient.java | 12 +- .../v1/AttachDiskInstanceHttpRequest.java | 35 + .../cloud/compute/v1/AutoscalerClient.java | 8 +- .../cloud/compute/v1/BackendBucketClient.java | 16 +- .../compute/v1/BackendServiceClient.java | 8 +- .../CreateSnapshotRegionDiskHttpRequest.java | 479 ++++++ .../v1/DeleteRegionDiskHttpRequest.java | 428 ++++++ .../com/google/cloud/compute/v1/Disk.java | 82 ++ .../google/cloud/compute/v1/DiskClient.java | 8 +- .../com/google/cloud/compute/v1/DiskType.java | 35 + .../cloud/compute/v1/DiskTypeClient.java | 12 +- .../compute/v1/GetRegionDiskHttpRequest.java | 394 +++++ .../v1/GetRegionDiskTypeHttpRequest.java | 395 +++++ .../cloud/compute/v1/GlobalAddressClient.java | 8 +- .../v1/GlobalForwardingRuleClient.java | 8 +- .../compute/v1/GlobalOperationClient.java | 8 +- .../cloud/compute/v1/HealthCheckClient.java | 8 +- .../compute/v1/HttpHealthCheckClient.java | 8 +- .../compute/v1/HttpsHealthCheckClient.java | 16 +- .../google/cloud/compute/v1/ImageClient.java | 8 +- .../v1/InsertRegionDiskHttpRequest.java | 514 +++++++ .../cloud/compute/v1/InstanceClient.java | 63 +- .../cloud/compute/v1/InstanceGroupClient.java | 8 +- .../v1/InterconnectLocationClient.java | 8 +- .../cloud/compute/v1/LicenseClient.java | 10 +- .../v1/ListRegionDiskTypesHttpRequest.java | 549 +++++++ .../v1/ListRegionDisksHttpRequest.java | 549 +++++++ .../cloud/compute/v1/NetworkClient.java | 8 +- .../compute/v1/ProjectRegionDiskName.java | 183 +++ .../v1/ProjectRegionDiskResourceName.java | 184 +++ .../compute/v1/ProjectRegionDiskTypeName.java | 185 +++ .../google/cloud/compute/v1/RegionClient.java | 8 +- .../compute/v1/RegionCommitmentClient.java | 8 +- .../cloud/compute/v1/RegionDiskClient.java | 1304 +++++++++++++++++ .../cloud/compute/v1/RegionDiskSettings.java | 265 ++++ .../compute/v1/RegionDiskTypeClient.java | 498 +++++++ .../cloud/compute/v1/RegionDiskTypeList.java | 333 +++++ .../compute/v1/RegionDiskTypeSettings.java | 198 +++ .../compute/v1/RegionDisksResizeRequest.java | 149 ++ .../compute/v1/RegionSetLabelsRequest.java | 185 +++ .../v1/ResizeRegionDiskHttpRequest.java | 484 ++++++ .../google/cloud/compute/v1/RouteClient.java | 8 +- .../google/cloud/compute/v1/RouterClient.java | 8 +- .../v1/SetLabelsRegionDiskHttpRequest.java | 484 ++++++ .../cloud/compute/v1/SnapshotClient.java | 8 +- .../compute/v1/SslCertificateClient.java | 8 +- .../cloud/compute/v1/SslPolicyClient.java | 8 +- .../google/cloud/compute/v1/Subnetwork.java | 35 + .../cloud/compute/v1/SubnetworkClient.java | 8 +- .../compute/v1/TargetHttpProxyClient.java | 8 +- .../compute/v1/TargetHttpsProxyClient.java | 8 +- .../compute/v1/TargetInstanceClient.java | 8 +- .../cloud/compute/v1/TargetPoolClient.java | 8 +- .../compute/v1/TargetSslProxyClient.java | 8 +- .../compute/v1/TargetTcpProxyClient.java | 8 +- .../compute/v1/TargetVpnGatewayClient.java | 16 +- ...stIamPermissionsRegionDiskHttpRequest.java | 449 ++++++ .../google/cloud/compute/v1/UrlMapClient.java | 8 +- .../cloud/compute/v1/VpnTunnelClient.java | 8 +- .../google/cloud/compute/v1/ZoneClient.java | 8 +- .../google/cloud/compute/v1/package-info.java | 32 + .../compute/v1/stub/HttpJsonInstanceStub.java | 2 +- .../HttpJsonRegionDiskCallableFactory.java | 65 + .../v1/stub/HttpJsonRegionDiskStub.java | 443 ++++++ ...HttpJsonRegionDiskTypeCallableFactory.java | 65 + .../v1/stub/HttpJsonRegionDiskTypeStub.java | 220 +++ .../cloud/compute/v1/stub/RegionDiskStub.java | 98 ++ .../v1/stub/RegionDiskStubSettings.java | 543 +++++++ .../compute/v1/stub/RegionDiskTypeStub.java | 58 + .../v1/stub/RegionDiskTypeStubSettings.java | 383 +++++ .../cloud/compute/v1/DiskClientTest.java | 2 + .../cloud/compute/v1/DiskTypeClientTest.java | 2 + .../cloud/compute/v1/InstanceClientTest.java | 7 +- .../compute/v1/RegionDiskClientTest.java | 756 ++++++++++ .../compute/v1/RegionDiskTypeClientTest.java | 207 +++ .../compute/v1/SubnetworkClientTest.java | 2 + 76 files changed, 11474 insertions(+), 184 deletions(-) create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java create mode 100644 google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java create mode 100644 google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java index ac96c39f9f43..957ce264f3c5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java @@ -297,8 +297,7 @@ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAccelerat // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified accelerator type. Get a list of available accelerator types by making a - * list() request. + * Returns the specified accelerator type. * *

Sample code: * @@ -324,8 +323,7 @@ public final AcceleratorType getAcceleratorType(ProjectZoneAcceleratorTypeName a // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified accelerator type. Get a list of available accelerator types by making a - * list() request. + * Returns the specified accelerator type. * *

Sample code: * @@ -349,8 +347,7 @@ public final AcceleratorType getAcceleratorType(String acceleratorType) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified accelerator type. Get a list of available accelerator types by making a - * list() request. + * Returns the specified accelerator type. * *

Sample code: * @@ -374,8 +371,7 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeHttpRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified accelerator type. Get a list of available accelerator types by making a - * list() request. + * Returns the specified accelerator type. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index 395dd15f0ad0..7b626dce9f4b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -33,6 +33,7 @@ public final class AttachDiskInstanceHttpRequest implements ApiMessage { private final AttachedDisk attachedDiskResource; private final String callback; private final String fields; + private final Boolean forceAttach; private final String instance; private final String key; private final String prettyPrint; @@ -45,6 +46,7 @@ private AttachDiskInstanceHttpRequest() { this.attachedDiskResource = null; this.callback = null; this.fields = null; + this.forceAttach = null; this.instance = null; this.key = null; this.prettyPrint = null; @@ -58,6 +60,7 @@ private AttachDiskInstanceHttpRequest( AttachedDisk attachedDiskResource, String callback, String fields, + Boolean forceAttach, String instance, String key, String prettyPrint, @@ -68,6 +71,7 @@ private AttachDiskInstanceHttpRequest( this.attachedDiskResource = attachedDiskResource; this.callback = callback; this.fields = fields; + this.forceAttach = forceAttach; this.instance = instance; this.key = key; this.prettyPrint = prettyPrint; @@ -92,6 +96,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("fields") && fields != null) { fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); } + if (fieldNames.contains("forceAttach") && forceAttach != null) { + fieldMap.put("forceAttach", Collections.singletonList(String.valueOf(forceAttach))); + } if (fieldNames.contains("instance") && instance != null) { fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); } @@ -127,6 +134,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("fields")) { return String.valueOf(fields); } + if (fieldName.equals("forceAttach")) { + return String.valueOf(forceAttach); + } if (fieldName.equals("instance")) { return String.valueOf(instance); } @@ -170,6 +180,10 @@ public String getFields() { return fields; } + public Boolean getForceAttach() { + return forceAttach; + } + public String getInstance() { return instance; } @@ -221,6 +235,7 @@ public static class Builder { private AttachedDisk attachedDiskResource; private String callback; private String fields; + private Boolean forceAttach; private String instance; private String key; private String prettyPrint; @@ -244,6 +259,9 @@ public Builder mergeFrom(AttachDiskInstanceHttpRequest other) { if (other.getFields() != null) { this.fields = other.fields; } + if (other.getForceAttach() != null) { + this.forceAttach = other.forceAttach; + } if (other.getInstance() != null) { this.instance = other.instance; } @@ -270,6 +288,7 @@ public Builder mergeFrom(AttachDiskInstanceHttpRequest other) { this.attachedDiskResource = source.attachedDiskResource; this.callback = source.callback; this.fields = source.fields; + this.forceAttach = source.forceAttach; this.instance = source.instance; this.key = source.key; this.prettyPrint = source.prettyPrint; @@ -314,6 +333,15 @@ public Builder setFields(String fields) { return this; } + public Boolean getForceAttach() { + return forceAttach; + } + + public Builder setForceAttach(Boolean forceAttach) { + this.forceAttach = forceAttach; + return this; + } + public String getInstance() { return instance; } @@ -383,6 +411,7 @@ public AttachDiskInstanceHttpRequest build() { attachedDiskResource, callback, fields, + forceAttach, instance, key, prettyPrint, @@ -397,6 +426,7 @@ public Builder clone() { newBuilder.setAttachedDiskResource(this.attachedDiskResource); newBuilder.setCallback(this.callback); newBuilder.setFields(this.fields); + newBuilder.setForceAttach(this.forceAttach); newBuilder.setInstance(this.instance); newBuilder.setKey(this.key); newBuilder.setPrettyPrint(this.prettyPrint); @@ -422,6 +452,9 @@ public String toString() { + "fields=" + fields + ", " + + "forceAttach=" + + forceAttach + + ", " + "instance=" + instance + ", " @@ -453,6 +486,7 @@ public boolean equals(Object o) { && Objects.equals(this.attachedDiskResource, that.getAttachedDiskResource()) && Objects.equals(this.callback, that.getCallback()) && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.forceAttach, that.getForceAttach()) && Objects.equals(this.instance, that.getInstance()) && Objects.equals(this.key, that.getKey()) && Objects.equals(this.prettyPrint, that.getPrettyPrint()) @@ -470,6 +504,7 @@ public int hashCode() { attachedDiskResource, callback, fields, + forceAttach, instance, key, prettyPrint, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java index 157d4c237f4b..dfa52bbbff27 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java @@ -418,7 +418,7 @@ public final UnaryCallable deleteAutosca // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified autoscaler resource. Get a list of available autoscalers by making a + * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a * list() request. * *

Sample code: @@ -445,7 +445,7 @@ public final Autoscaler getAutoscaler(ProjectZoneAutoscalerName autoscaler) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified autoscaler resource. Get a list of available autoscalers by making a + * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a * list() request. * *

Sample code: @@ -470,7 +470,7 @@ public final Autoscaler getAutoscaler(String autoscaler) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified autoscaler resource. Get a list of available autoscalers by making a + * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a * list() request. * *

Sample code: @@ -495,7 +495,7 @@ public final Autoscaler getAutoscaler(GetAutoscalerHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified autoscaler resource. Get a list of available autoscalers by making a + * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java index 691fd602ce2c..70fe22010ccd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java @@ -282,8 +282,8 @@ public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest reques // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making - * a list() request. + * Returns the specified BackendBucket resource. Gets a list of available backend buckets by + * making a list() request. * *

Sample code: * @@ -309,8 +309,8 @@ public final BackendBucket getBackendBucket(ProjectGlobalBackendBucketName backe // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making - * a list() request. + * Returns the specified BackendBucket resource. Gets a list of available backend buckets by + * making a list() request. * *

Sample code: * @@ -334,8 +334,8 @@ public final BackendBucket getBackendBucket(String backendBucket) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making - * a list() request. + * Returns the specified BackendBucket resource. Gets a list of available backend buckets by + * making a list() request. * *

Sample code: * @@ -359,8 +359,8 @@ public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendBucket resource. Get a list of available backend buckets by making - * a list() request. + * Returns the specified BackendBucket resource. Gets a list of available backend buckets by + * making a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java index d21fc584e633..10d8cf8b1548 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java @@ -428,7 +428,7 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by + * Returns the specified BackendService resource. Gets a list of available backend services by * making a list() request. * *

Sample code: @@ -455,7 +455,7 @@ public final BackendService getBackendService(ProjectGlobalBackendServiceName ba // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by + * Returns the specified BackendService resource. Gets a list of available backend services by * making a list() request. * *

Sample code: @@ -480,7 +480,7 @@ public final BackendService getBackendService(String backendService) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by + * Returns the specified BackendService resource. Gets a list of available backend services by * making a list() request. * *

Sample code: @@ -505,7 +505,7 @@ public final BackendService getBackendService(GetBackendServiceHttpRequest reque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified BackendService resource. Get a list of available backend services by + * Returns the specified BackendService resource. Gets a list of available backend services by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java new file mode 100644 index 000000000000..26a7758fdc19 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java @@ -0,0 +1,479 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class CreateSnapshotRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final Snapshot snapshotResource; + private final String userIp; + + private CreateSnapshotRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.snapshotResource = null; + this.userIp = null; + } + + private CreateSnapshotRegionDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + Snapshot snapshotResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.snapshotResource = snapshotResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("snapshotResource") && snapshotResource != null) { + fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("snapshotResource")) { + return String.valueOf(snapshotResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Snapshot getApiMessageRequestBody() { + return snapshotResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public Snapshot getSnapshotResource() { + return snapshotResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(CreateSnapshotRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static CreateSnapshotRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final CreateSnapshotRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new CreateSnapshotRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private Snapshot snapshotResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(CreateSnapshotRegionDiskHttpRequest other) { + if (other == CreateSnapshotRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSnapshotResource() != null) { + this.snapshotResource = other.snapshotResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(CreateSnapshotRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.snapshotResource = source.snapshotResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public Snapshot getSnapshotResource() { + return snapshotResource; + } + + public Builder setSnapshotResource(Snapshot snapshotResource) { + this.snapshotResource = snapshotResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public CreateSnapshotRegionDiskHttpRequest build() { + String missing = ""; + + if (disk == null) { + missing += " disk"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new CreateSnapshotRegionDiskHttpRequest( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + requestId, + snapshotResource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setSnapshotResource(this.snapshotResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "CreateSnapshotRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "snapshotResource=" + + snapshotResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CreateSnapshotRegionDiskHttpRequest) { + CreateSnapshotRegionDiskHttpRequest that = (CreateSnapshotRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.snapshotResource, that.getSnapshotResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + requestId, + snapshotResource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java new file mode 100644 index 000000000000..5dfb0647e4dc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java @@ -0,0 +1,428 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class DeleteRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private DeleteRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private DeleteRegionDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(DeleteRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static DeleteRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final DeleteRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new DeleteRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(DeleteRegionDiskHttpRequest other) { + if (other == DeleteRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(DeleteRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public DeleteRegionDiskHttpRequest build() { + String missing = ""; + + if (disk == null) { + missing += " disk"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new DeleteRegionDiskHttpRequest( + access_token, callback, disk, fields, key, prettyPrint, quotaUser, requestId, userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "DeleteRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DeleteRegionDiskHttpRequest) { + DeleteRegionDiskHttpRequest that = (DeleteRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, disk, fields, key, prettyPrint, quotaUser, requestId, userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java index 4a32a093e2ec..c9be0f7c6beb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java @@ -45,6 +45,8 @@ public final class Disk implements ApiMessage { private final List licenses; private final String name; private final String options; + private final String region; + private final List replicaZones; private final String selfLink; private final String sizeGb; private final String sourceImage; @@ -73,6 +75,8 @@ private Disk() { this.licenses = null; this.name = null; this.options = null; + this.region = null; + this.replicaZones = null; this.selfLink = null; this.sizeGb = null; this.sourceImage = null; @@ -102,6 +106,8 @@ private Disk( List licenses, String name, String options, + String region, + List replicaZones, String selfLink, String sizeGb, String sourceImage, @@ -128,6 +134,8 @@ private Disk( this.licenses = licenses; this.name = name; this.options = options; + this.region = region; + this.replicaZones = replicaZones; this.selfLink = selfLink; this.sizeGb = sizeGb; this.sourceImage = sourceImage; @@ -203,6 +211,16 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("options") && options != null) { fieldMap.put("options", Collections.singletonList(String.valueOf(options))); } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("replicaZones") && replicaZones != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (String item : replicaZones) { + stringList.add(item.toString()); + } + fieldMap.put("replicaZones", stringList.build()); + } if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } @@ -294,6 +312,12 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("options")) { return String.valueOf(options); } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("replicaZones")) { + return String.valueOf(replicaZones); + } if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } @@ -395,6 +419,14 @@ public String getOptions() { return options; } + public String getRegion() { + return region; + } + + public List getReplicaZonesList() { + return replicaZones; + } + public String getSelfLink() { return selfLink; } @@ -480,6 +512,8 @@ public static class Builder { private List licenses; private String name; private String options; + private String region; + private List replicaZones; private String selfLink; private String sizeGb; private String sourceImage; @@ -539,6 +573,12 @@ public Builder mergeFrom(Disk other) { if (other.getOptions() != null) { this.options = other.options; } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getReplicaZonesList() != null) { + this.replicaZones = other.replicaZones; + } if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } @@ -593,6 +633,8 @@ public Builder mergeFrom(Disk other) { this.licenses = source.licenses; this.name = source.name; this.options = source.options; + this.region = source.region; + this.replicaZones = source.replicaZones; this.selfLink = source.selfLink; this.sizeGb = source.sizeGb; this.sourceImage = source.sourceImage; @@ -757,6 +799,32 @@ public Builder setOptions(String options) { return this; } + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public List getReplicaZonesList() { + return replicaZones; + } + + public Builder addAllReplicaZones(List replicaZones) { + if (this.replicaZones == null) { + this.replicaZones = new ArrayList<>(replicaZones.size()); + } + this.replicaZones.addAll(replicaZones); + return this; + } + + public Builder addReplicaZones(String replicaZones) { + this.replicaZones.add(replicaZones); + return this; + } + public String getSelfLink() { return selfLink; } @@ -891,6 +959,8 @@ public Disk build() { licenses, name, options, + region, + replicaZones, selfLink, sizeGb, sourceImage, @@ -921,6 +991,8 @@ public Builder clone() { newBuilder.addAllLicenses(this.licenses); newBuilder.setName(this.name); newBuilder.setOptions(this.options); + newBuilder.setRegion(this.region); + newBuilder.addAllReplicaZones(this.replicaZones); newBuilder.setSelfLink(this.selfLink); newBuilder.setSizeGb(this.sizeGb); newBuilder.setSourceImage(this.sourceImage); @@ -982,6 +1054,12 @@ public String toString() { + "options=" + options + ", " + + "region=" + + region + + ", " + + "replicaZones=" + + replicaZones + + ", " + "selfLink=" + selfLink + ", " @@ -1041,6 +1119,8 @@ public boolean equals(Object o) { && Objects.equals(this.licenses, that.getLicensesList()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.options, that.getOptions()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.replicaZones, that.getReplicaZonesList()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.sizeGb, that.getSizeGb()) && Objects.equals(this.sourceImage, that.getSourceImage()) @@ -1074,6 +1154,8 @@ public int hashCode() { licenses, name, options, + region, + replicaZones, selfLink, sizeGb, sourceImage, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java index f3f445a980d4..cb20e39337cd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java @@ -573,7 +573,7 @@ public final UnaryCallable deleteDiskCallable( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns a specified persistent disk. Get a list of available persistent disks by making a + * Returns a specified persistent disk. Gets a list of available persistent disks by making a * list() request. * *

Sample code: @@ -598,7 +598,7 @@ public final Disk getDisk(ProjectZoneDiskName disk) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns a specified persistent disk. Get a list of available persistent disks by making a + * Returns a specified persistent disk. Gets a list of available persistent disks by making a * list() request. * *

Sample code: @@ -622,7 +622,7 @@ public final Disk getDisk(String disk) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns a specified persistent disk. Get a list of available persistent disks by making a + * Returns a specified persistent disk. Gets a list of available persistent disks by making a * list() request. * *

Sample code: @@ -647,7 +647,7 @@ public final Disk getDisk(GetDiskHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns a specified persistent disk. Get a list of available persistent disks by making a + * Returns a specified persistent disk. Gets a list of available persistent disks by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java index a3283274dd37..628bca2d0c75 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java @@ -36,6 +36,7 @@ public final class DiskType implements ApiMessage { private final String id; private final String kind; private final String name; + private final String region; private final String selfLink; private final String validDiskSize; private final String zone; @@ -48,6 +49,7 @@ private DiskType() { this.id = null; this.kind = null; this.name = null; + this.region = null; this.selfLink = null; this.validDiskSize = null; this.zone = null; @@ -61,6 +63,7 @@ private DiskType( String id, String kind, String name, + String region, String selfLink, String validDiskSize, String zone) { @@ -71,6 +74,7 @@ private DiskType( this.id = id; this.kind = kind; this.name = name; + this.region = region; this.selfLink = selfLink; this.validDiskSize = validDiskSize; this.zone = zone; @@ -102,6 +106,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("name") && name != null) { fieldMap.put("name", Collections.singletonList(String.valueOf(name))); } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } if (fieldNames.contains("selfLink") && selfLink != null) { fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); } @@ -137,6 +144,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("name")) { return String.valueOf(name); } + if (fieldName.equals("region")) { + return String.valueOf(region); + } if (fieldName.equals("selfLink")) { return String.valueOf(selfLink); } @@ -183,6 +193,10 @@ public String getName() { return name; } + public String getRegion() { + return region; + } + public String getSelfLink() { return selfLink; } @@ -225,6 +239,7 @@ public static class Builder { private String id; private String kind; private String name; + private String region; private String selfLink; private String validDiskSize; private String zone; @@ -254,6 +269,9 @@ public Builder mergeFrom(DiskType other) { if (other.getName() != null) { this.name = other.name; } + if (other.getRegion() != null) { + this.region = other.region; + } if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } @@ -274,6 +292,7 @@ public Builder mergeFrom(DiskType other) { this.id = source.id; this.kind = source.kind; this.name = source.name; + this.region = source.region; this.selfLink = source.selfLink; this.validDiskSize = source.validDiskSize; this.zone = source.zone; @@ -342,6 +361,15 @@ public Builder setName(String name) { return this; } + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + public String getSelfLink() { return selfLink; } @@ -379,6 +407,7 @@ public DiskType build() { id, kind, name, + region, selfLink, validDiskSize, zone); @@ -393,6 +422,7 @@ public Builder clone() { newBuilder.setId(this.id); newBuilder.setKind(this.kind); newBuilder.setName(this.name); + newBuilder.setRegion(this.region); newBuilder.setSelfLink(this.selfLink); newBuilder.setValidDiskSize(this.validDiskSize); newBuilder.setZone(this.zone); @@ -424,6 +454,9 @@ public String toString() { + "name=" + name + ", " + + "region=" + + region + + ", " + "selfLink=" + selfLink + ", " @@ -449,6 +482,7 @@ public boolean equals(Object o) { && Objects.equals(this.id, that.getId()) && Objects.equals(this.kind, that.getKind()) && Objects.equals(this.name, that.getName()) + && Objects.equals(this.region, that.getRegion()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.validDiskSize, that.getValidDiskSize()) && Objects.equals(this.zone, that.getZone()); @@ -466,6 +500,7 @@ public int hashCode() { id, kind, name, + region, selfLink, validDiskSize, zone); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java index 4f4bafc78849..402d0852a396 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java @@ -291,7 +291,8 @@ public final AggregatedListDiskTypesPagedResponse aggregatedListDiskTypes( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified disk type. Get a list of available disk types by making a list() request. + * Returns the specified disk type. Gets a list of available disk types by making a list() + * request. * *

Sample code: * @@ -317,7 +318,8 @@ public final DiskType getDiskType(ProjectZoneDiskTypeName diskType) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified disk type. Get a list of available disk types by making a list() request. + * Returns the specified disk type. Gets a list of available disk types by making a list() + * request. * *

Sample code: * @@ -341,7 +343,8 @@ public final DiskType getDiskType(String diskType) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified disk type. Get a list of available disk types by making a list() request. + * Returns the specified disk type. Gets a list of available disk types by making a list() + * request. * *

Sample code: * @@ -365,7 +368,8 @@ public final DiskType getDiskType(GetDiskTypeHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified disk type. Get a list of available disk types by making a list() request. + * Returns the specified disk type. Gets a list of available disk types by making a list() + * request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java new file mode 100644 index 000000000000..e8e226455879 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java @@ -0,0 +1,394 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + private GetRegionDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionDiskHttpRequest other) { + if (other == GetRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetRegionDiskHttpRequest build() { + String missing = ""; + + if (disk == null) { + missing += " disk"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionDiskHttpRequest( + access_token, callback, disk, fields, key, prettyPrint, quotaUser, userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionDiskHttpRequest) { + GetRegionDiskHttpRequest that = (GetRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(access_token, callback, disk, fields, key, prettyPrint, quotaUser, userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java new file mode 100644 index 000000000000..3cc8efec0f9a --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java @@ -0,0 +1,395 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class GetRegionDiskTypeHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String diskType; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetRegionDiskTypeHttpRequest() { + this.access_token = null; + this.callback = null; + this.diskType = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + private GetRegionDiskTypeHttpRequest( + String access_token, + String callback, + String diskType, + String fields, + String key, + String prettyPrint, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.diskType = diskType; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskType") && diskType != null) { + fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("diskType")) { + return String.valueOf(diskType); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDiskType() { + return diskType; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetRegionDiskTypeHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetRegionDiskTypeHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetRegionDiskTypeHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetRegionDiskTypeHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String diskType; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetRegionDiskTypeHttpRequest other) { + if (other == GetRegionDiskTypeHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDiskType() != null) { + this.diskType = other.diskType; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetRegionDiskTypeHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.diskType = source.diskType; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDiskType() { + return diskType; + } + + public Builder setDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetRegionDiskTypeHttpRequest build() { + String missing = ""; + + if (diskType == null) { + missing += " diskType"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetRegionDiskTypeHttpRequest( + access_token, callback, diskType, fields, key, prettyPrint, quotaUser, userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDiskType(this.diskType); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetRegionDiskTypeHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "diskType=" + + diskType + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetRegionDiskTypeHttpRequest) { + GetRegionDiskTypeHttpRequest that = (GetRegionDiskTypeHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.diskType, that.getDiskType()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, diskType, fields, key, prettyPrint, quotaUser, userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java index 1b313c326e0b..931492de94d1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java @@ -281,7 +281,7 @@ public final Operation deleteGlobalAddress(DeleteGlobalAddressHttpRequest reques // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() + * Returns the specified address resource. Gets a list of available addresses by making a list() * request. * *

Sample code: @@ -308,7 +308,7 @@ public final Address getGlobalAddress(ProjectGlobalAddressName address) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() + * Returns the specified address resource. Gets a list of available addresses by making a list() * request. * *

Sample code: @@ -333,7 +333,7 @@ public final Address getGlobalAddress(String address) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() + * Returns the specified address resource. Gets a list of available addresses by making a list() * request. * *

Sample code: @@ -358,7 +358,7 @@ public final Address getGlobalAddress(GetGlobalAddressHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified address resource. Get a list of available addresses by making a list() + * Returns the specified address resource. Gets a list of available addresses by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java index c8fca7505624..b49565d4cae7 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java @@ -283,7 +283,7 @@ public final Operation deleteGlobalForwardingRule(DeleteGlobalForwardingRuleHttp // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules * by making a list() request. * *

Sample code: @@ -311,7 +311,7 @@ public final ForwardingRule getGlobalForwardingRule( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules * by making a list() request. * *

Sample code: @@ -336,7 +336,7 @@ public final ForwardingRule getGlobalForwardingRule(String forwardingRule) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules * by making a list() request. * *

Sample code: @@ -361,7 +361,7 @@ public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpR // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules + * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules * by making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java index e72a280829be..193a28352b8a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java @@ -394,7 +394,7 @@ public final void deleteGlobalOperation(DeleteGlobalOperationHttpRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() + * Retrieves the specified Operations resource. Gets a list of operations by making a list() * request. * *

Sample code: @@ -421,7 +421,7 @@ public final Operation getGlobalOperation(ProjectGlobalOperationName operation) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() + * Retrieves the specified Operations resource. Gets a list of operations by making a list() * request. * *

Sample code: @@ -446,7 +446,7 @@ public final Operation getGlobalOperation(String operation) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() + * Retrieves the specified Operations resource. Gets a list of operations by making a list() * request. * *

Sample code: @@ -471,7 +471,7 @@ public final Operation getGlobalOperation(GetGlobalOperationHttpRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the specified Operations resource. Get a list of operations by making a list() + * Retrieves the specified Operations resource. Gets a list of operations by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java index 81ae6ea43254..907f7ad4ef94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java @@ -280,7 +280,7 @@ public final UnaryCallable deleteHealth // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HealthCheck resource. Get a list of available health checks by making a + * Returns the specified HealthCheck resource. Gets a list of available health checks by making a * list() request. * *

Sample code: @@ -307,7 +307,7 @@ public final HealthCheck getHealthCheck(ProjectGlobalHealthCheckName healthCheck // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HealthCheck resource. Get a list of available health checks by making a + * Returns the specified HealthCheck resource. Gets a list of available health checks by making a * list() request. * *

Sample code: @@ -332,7 +332,7 @@ public final HealthCheck getHealthCheck(String healthCheck) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HealthCheck resource. Get a list of available health checks by making a + * Returns the specified HealthCheck resource. Gets a list of available health checks by making a * list() request. * *

Sample code: @@ -357,7 +357,7 @@ public final HealthCheck getHealthCheck(GetHealthCheckHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HealthCheck resource. Get a list of available health checks by making a + * Returns the specified HealthCheck resource. Gets a list of available health checks by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java index 17068313afb3..a46f3f547e6d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java @@ -283,7 +283,7 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by * making a list() request. * *

Sample code: @@ -311,7 +311,7 @@ public final HttpHealthCheck2 getHttpHealthCheck( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by * making a list() request. * *

Sample code: @@ -336,7 +336,7 @@ public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by * making a list() request. * *

Sample code: @@ -361,7 +361,7 @@ public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest r // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by + * Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java index c8e4e440b1cb..29569f3e5e58 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java @@ -283,8 +283,8 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by - * making a list() request. + * Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks + * by making a list() request. * *

Sample code: * @@ -311,8 +311,8 @@ public final HttpsHealthCheck2 getHttpsHealthCheck( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by - * making a list() request. + * Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks + * by making a list() request. * *

Sample code: * @@ -336,8 +336,8 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by - * making a list() request. + * Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks + * by making a list() request. * *

Sample code: * @@ -361,8 +361,8 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpReques // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by - * making a list() request. + * Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks + * by making a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java index 684894a2c9c2..a67b90090b25 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java @@ -420,7 +420,7 @@ public final UnaryCallable deprecateImageC // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified image. Get a list of available images by making a list() request. + * Returns the specified image. Gets a list of available images by making a list() request. * *

Sample code: * @@ -444,7 +444,7 @@ public final Image getImage(ProjectGlobalImageName image) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified image. Get a list of available images by making a list() request. + * Returns the specified image. Gets a list of available images by making a list() request. * *

Sample code: * @@ -467,7 +467,7 @@ public final Image getImage(String image) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified image. Get a list of available images by making a list() request. + * Returns the specified image. Gets a list of available images by making a list() request. * *

Sample code: * @@ -491,7 +491,7 @@ public final Image getImage(GetImageHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified image. Get a list of available images by making a list() request. + * Returns the specified image. Gets a list of available images by making a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java new file mode 100644 index 000000000000..8622ee682548 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java @@ -0,0 +1,514 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InsertRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final Disk diskResource; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String requestId; + private final String sourceImage; + private final String userIp; + + private InsertRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.diskResource = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.requestId = null; + this.sourceImage = null; + this.userIp = null; + } + + private InsertRegionDiskHttpRequest( + String access_token, + String callback, + Disk diskResource, + String fields, + String key, + String prettyPrint, + String quotaUser, + String region, + String requestId, + String sourceImage, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.diskResource = diskResource; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.requestId = requestId; + this.sourceImage = sourceImage; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("diskResource") && diskResource != null) { + fieldMap.put("diskResource", Collections.singletonList(String.valueOf(diskResource))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("sourceImage") && sourceImage != null) { + fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("diskResource")) { + return String.valueOf(diskResource); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("sourceImage")) { + return String.valueOf(sourceImage); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public Disk getApiMessageRequestBody() { + return diskResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public Disk getDiskResource() { + return diskResource; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getRequestId() { + return requestId; + } + + public String getSourceImage() { + return sourceImage; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(InsertRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static InsertRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final InsertRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new InsertRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private Disk diskResource; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String region; + private String requestId; + private String sourceImage; + private String userIp; + + Builder() {} + + public Builder mergeFrom(InsertRegionDiskHttpRequest other) { + if (other == InsertRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDiskResource() != null) { + this.diskResource = other.diskResource; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getSourceImage() != null) { + this.sourceImage = other.sourceImage; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(InsertRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.diskResource = source.diskResource; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.requestId = source.requestId; + this.sourceImage = source.sourceImage; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public Disk getDiskResource() { + return diskResource; + } + + public Builder setDiskResource(Disk diskResource) { + this.diskResource = diskResource; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getSourceImage() { + return sourceImage; + } + + public Builder setSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public InsertRegionDiskHttpRequest build() { + String missing = ""; + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new InsertRegionDiskHttpRequest( + access_token, + callback, + diskResource, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + sourceImage, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDiskResource(this.diskResource); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setRequestId(this.requestId); + newBuilder.setSourceImage(this.sourceImage); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "InsertRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "diskResource=" + + diskResource + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "requestId=" + + requestId + + ", " + + "sourceImage=" + + sourceImage + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InsertRegionDiskHttpRequest) { + InsertRegionDiskHttpRequest that = (InsertRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.diskResource, that.getDiskResource()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.sourceImage, that.getSourceImage()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + diskResource, + fields, + key, + prettyPrint, + quotaUser, + region, + requestId, + sourceImage, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java index 6ef5edc33f92..931ee7b7068c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -460,8 +460,9 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String requestId = ""; + * Boolean forceAttach = false; * AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - * Operation response = instanceClient.attachDiskInstance(instance, requestId, attachedDiskResource); + * Operation response = instanceClient.attachDiskInstance(instance, requestId, forceAttach, attachedDiskResource); * } *

* @@ -475,17 +476,23 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances( * request. This prevents clients from accidentally creating duplicate commitments. *

The request ID must be a valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). + * @param forceAttach Whether to force attach the disk even if it's currently attached to another + * instance. This is only available for regional disks. * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation attachDiskInstance( - ProjectZoneInstanceName instance, String requestId, AttachedDisk attachedDiskResource) { + ProjectZoneInstanceName instance, + String requestId, + Boolean forceAttach, + AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setRequestId(requestId) + .setForceAttach(forceAttach) .setAttachedDiskResource(attachedDiskResource) .build(); return attachDiskInstance(request); @@ -503,8 +510,9 @@ public final Operation attachDiskInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String requestId = ""; + * Boolean forceAttach = false; * AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - * Operation response = instanceClient.attachDiskInstance(instance.toString(), requestId, attachedDiskResource); + * Operation response = instanceClient.attachDiskInstance(instance.toString(), requestId, forceAttach, attachedDiskResource); * } *

* @@ -518,17 +526,20 @@ public final Operation attachDiskInstance( * request. This prevents clients from accidentally creating duplicate commitments. *

The request ID must be a valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). + * @param forceAttach Whether to force attach the disk even if it's currently attached to another + * instance. This is only available for regional disks. * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation attachDiskInstance( - String instance, String requestId, AttachedDisk attachedDiskResource) { + String instance, String requestId, Boolean forceAttach, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() .setInstance(instance) .setRequestId(requestId) + .setForceAttach(forceAttach) .setAttachedDiskResource(attachedDiskResource) .build(); return attachDiskInstance(request); @@ -546,10 +557,12 @@ public final Operation attachDiskInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String requestId = ""; + * Boolean forceAttach = false; * AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); * AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setRequestId(requestId) + * .setForceAttach(forceAttach) * .setAttachedDiskResource(attachedDiskResource) * .build(); * Operation response = instanceClient.attachDiskInstance(request); @@ -576,10 +589,12 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request) * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String requestId = ""; + * Boolean forceAttach = false; * AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); * AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setRequestId(requestId) + * .setForceAttach(forceAttach) * .setAttachedDiskResource(attachedDiskResource) * .build(); * ApiFuture<Operation> future = instanceClient.attachDiskInstanceCallable().futureCall(request); @@ -1013,7 +1028,7 @@ public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Instance resource. Get a list of available instances by making a list() + * Returns the specified Instance resource. Gets a list of available instances by making a list() * request. * *

Sample code: @@ -1040,7 +1055,7 @@ public final Instance getInstance(ProjectZoneInstanceName instance) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Instance resource. Get a list of available instances by making a list() + * Returns the specified Instance resource. Gets a list of available instances by making a list() * request. * *

Sample code: @@ -1065,7 +1080,7 @@ public final Instance getInstance(String instance) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Instance resource. Get a list of available instances by making a list() + * Returns the specified Instance resource. Gets a list of available instances by making a list() * request. * *

Sample code: @@ -1090,7 +1105,7 @@ public final Instance getInstance(GetInstanceHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Instance resource. Get a list of available instances by making a list() + * Returns the specified Instance resource. Gets a list of available instances by making a list() * request. * *

Sample code: @@ -3230,8 +3245,8 @@ public final UnaryCallable setTagsInstanc // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3268,8 +3283,8 @@ public final Operation startInstance(ProjectZoneInstanceName instance, String re // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3303,8 +3318,8 @@ public final Operation startInstance(String instance, String requestId) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3330,8 +3345,8 @@ public final Operation startInstance(StartInstanceHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3356,8 +3371,8 @@ public final UnaryCallable startInstanceCal // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3401,8 +3416,8 @@ public final Operation startWithEncryptionKeyInstance( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3446,8 +3461,8 @@ public final Operation startWithEncryptionKeyInstance( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * @@ -3476,8 +3491,8 @@ public final Operation startWithEncryptionKeyInstance( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Starts an instance that was stopped using the using the instances().stop method. For more - * information, see Restart an instance. + * Starts an instance that was stopped using the instances().stop method. For more information, + * see Restart an instance. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java index 461140c97d35..3db0b38062aa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java @@ -578,7 +578,7 @@ public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest reques // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance group. Get a list of available instance groups by making a + * Returns the specified instance group. Gets a list of available instance groups by making a * list() request. * *

Sample code: @@ -605,7 +605,7 @@ public final InstanceGroup getInstanceGroup(ProjectZoneInstanceGroupName instanc // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance group. Get a list of available instance groups by making a + * Returns the specified instance group. Gets a list of available instance groups by making a * list() request. * *

Sample code: @@ -630,7 +630,7 @@ public final InstanceGroup getInstanceGroup(String instanceGroup) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance group. Get a list of available instance groups by making a + * Returns the specified instance group. Gets a list of available instance groups by making a * list() request. * *

Sample code: @@ -655,7 +655,7 @@ public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified instance group. Get a list of available instance groups by making a + * Returns the specified instance group. Gets a list of available instance groups by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java index ab16533b0ad7..b4407f6ed1a0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java @@ -155,7 +155,7 @@ public InterconnectLocationStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the details for the specified interconnect location. Get a list of available + * Returns the details for the specified interconnect location. Gets a list of available * interconnect locations by making a list() request. * *

Sample code: @@ -184,7 +184,7 @@ public final InterconnectLocation getInterconnectLocation( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the details for the specified interconnect location. Get a list of available + * Returns the details for the specified interconnect location. Gets a list of available * interconnect locations by making a list() request. * *

Sample code: @@ -211,7 +211,7 @@ public final InterconnectLocation getInterconnectLocation(String interconnectLoc // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the details for the specified interconnect location. Get a list of available + * Returns the details for the specified interconnect location. Gets a list of available * interconnect locations by making a list() request. * *

Sample code: @@ -237,7 +237,7 @@ public final InterconnectLocation getInterconnectLocation( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the details for the specified interconnect location. Get a list of available + * Returns the details for the specified interconnect location. Gets a list of available * interconnect locations by making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java index 3e833606cae4..c6cd4686639f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java @@ -509,7 +509,7 @@ public final UnaryCallable insertLicenseCal /** * 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 8. If you want to get a list of publicly-available licenses, use this + * 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. * @@ -540,7 +540,7 @@ public final ListLicensesPagedResponse listLicenses(ProjectName project) { /** * 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 8. If you want to get a list of publicly-available licenses, use this + * 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. * @@ -569,7 +569,7 @@ public final ListLicensesPagedResponse listLicenses(String project) { /** * 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 8. If you want to get a list of publicly-available licenses, use this + * 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. * @@ -599,7 +599,7 @@ public final ListLicensesPagedResponse listLicenses(ListLicensesHttpRequest requ /** * 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 8. If you want to get a list of publicly-available licenses, use this + * 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. * @@ -629,7 +629,7 @@ public final ListLicensesPagedResponse listLicenses(ListLicensesHttpRequest requ /** * 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 8. If you want to get a list of publicly-available licenses, use this + * 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. * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java new file mode 100644 index 000000000000..1faa87ffc7ab --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java @@ -0,0 +1,549 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionDiskTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionDiskTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + private ListRegionDiskTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListRegionDiskTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionDiskTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListRegionDiskTypesHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListRegionDiskTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionDiskTypesHttpRequest other) { + if (other == ListRegionDiskTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionDiskTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListRegionDiskTypesHttpRequest build() { + String missing = ""; + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionDiskTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionDiskTypesHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionDiskTypesHttpRequest) { + ListRegionDiskTypesHttpRequest that = (ListRegionDiskTypesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java new file mode 100644 index 000000000000..c1df5c9af353 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java @@ -0,0 +1,549 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ListRegionDisksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListRegionDisksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + private ListRegionDisksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("filter") && filter != null) { + fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("maxResults") && maxResults != null) { + fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); + } + if (fieldNames.contains("orderBy") && orderBy != null) { + fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); + } + if (fieldNames.contains("pageToken") && pageToken != null) { + fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("region") && region != null) { + fieldMap.put("region", Collections.singletonList(String.valueOf(region))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("filter")) { + return String.valueOf(filter); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("maxResults")) { + return String.valueOf(maxResults); + } + if (fieldName.equals("orderBy")) { + return String.valueOf(orderBy); + } + if (fieldName.equals("pageToken")) { + return String.valueOf(pageToken); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("region")) { + return String.valueOf(region); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListRegionDisksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListRegionDisksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListRegionDisksHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListRegionDisksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListRegionDisksHttpRequest other) { + if (other == ListRegionDisksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListRegionDisksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListRegionDisksHttpRequest build() { + String missing = ""; + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListRegionDisksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListRegionDisksHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListRegionDisksHttpRequest) { + ListRegionDisksHttpRequest that = (ListRegionDisksHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java index 1516f000651e..b628f1efe77f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java @@ -417,7 +417,7 @@ public final UnaryCallable deleteNetworkCal // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified network. Get a list of available networks by making a list() request. + * Returns the specified network. Gets a list of available networks by making a list() request. * *

Sample code: * @@ -443,7 +443,7 @@ public final Network getNetwork(ProjectGlobalNetworkName network) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified network. Get a list of available networks by making a list() request. + * Returns the specified network. Gets a list of available networks by making a list() request. * *

Sample code: * @@ -466,7 +466,7 @@ public final Network getNetwork(String network) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified network. Get a list of available networks by making a list() request. + * Returns the specified network. Gets a list of available networks by making a list() request. * *

Sample code: * @@ -490,7 +490,7 @@ public final Network getNetwork(GetNetworkHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified network. Get a list of available networks by making a list() request. + * Returns the specified network. Gets a list of available networks by making a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java new file mode 100644 index 000000000000..5243a8298f7d --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java @@ -0,0 +1,183 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionDiskName implements ResourceName { + private final String disk; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/disks/{disk}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionDiskName(Builder builder) { + disk = Preconditions.checkNotNull(builder.getDisk()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionDiskName of(String disk, String project, String region) { + return newBuilder().setDisk(disk).setProject(project).setRegion(region).build(); + } + + public static String format(String disk, String project, String region) { + return of(disk, project, region).toString(); + } + + public String getDisk() { + return disk; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("disk", disk); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionDiskName parse(String formattedString) { + return ProjectRegionDiskName.parse(formattedString); + } + }; + } + + public static ProjectRegionDiskName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectRegionDiskName.parse: formattedString not in valid format"); + return of(matchMap.get("disk"), matchMap.get("project"), matchMap.get("region")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String disk; + private String project; + private String region; + + public String getDisk() { + return disk; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder(ProjectRegionDiskName projectRegionDiskName) { + disk = projectRegionDiskName.disk; + project = projectRegionDiskName.project; + region = projectRegionDiskName.region; + } + + public ProjectRegionDiskName build() { + return new ProjectRegionDiskName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "disk", disk, + "project", project, + "region", region); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionDiskName) { + ProjectRegionDiskName that = (ProjectRegionDiskName) o; + return Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(disk, project, region); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java new file mode 100644 index 000000000000..94e53ed3b681 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java @@ -0,0 +1,184 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionDiskResourceName implements ResourceName { + private final String project; + private final String region; + private final String resource; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/regions/{region}/disks/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionDiskResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public static ProjectRegionDiskResourceName of(String project, String region, String resource) { + return newBuilder().setProject(project).setRegion(region).setResource(resource).build(); + } + + public static String format(String project, String region, String resource) { + return of(project, region, resource).toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResource() { + return resource; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("resource", resource); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionDiskResourceName parse(String formattedString) { + return ProjectRegionDiskResourceName.parse(formattedString); + } + }; + } + + public static ProjectRegionDiskResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionDiskResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String resource; + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder() {} + + public Builder(ProjectRegionDiskResourceName projectRegionDiskResourceName) { + project = projectRegionDiskResourceName.project; + region = projectRegionDiskResourceName.region; + resource = projectRegionDiskResourceName.resource; + } + + public ProjectRegionDiskResourceName build() { + return new ProjectRegionDiskResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "resource", resource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionDiskResourceName) { + ProjectRegionDiskResourceName that = (ProjectRegionDiskResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.resource, that.getResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, region, resource); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java new file mode 100644 index 000000000000..31e5971b3914 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java @@ -0,0 +1,185 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionDiskTypeName implements ResourceName { + private final String diskType; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/diskTypes/{diskType}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionDiskTypeName(Builder builder) { + diskType = Preconditions.checkNotNull(builder.getDiskType()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionDiskTypeName of(String diskType, String project, String region) { + return newBuilder().setDiskType(diskType).setProject(project).setRegion(region).build(); + } + + public static String format(String diskType, String project, String region) { + return of(diskType, project, region).toString(); + } + + public String getDiskType() { + return diskType; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("diskType", diskType); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionDiskTypeName parse(String formattedString) { + return ProjectRegionDiskTypeName.parse(formattedString); + } + }; + } + + public static ProjectRegionDiskTypeName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionDiskTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("diskType"), matchMap.get("project"), matchMap.get("region")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String diskType; + private String project; + private String region; + + public String getDiskType() { + return diskType; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public Builder setDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder(ProjectRegionDiskTypeName projectRegionDiskTypeName) { + diskType = projectRegionDiskTypeName.diskType; + project = projectRegionDiskTypeName.project; + region = projectRegionDiskTypeName.region; + } + + public ProjectRegionDiskTypeName build() { + return new ProjectRegionDiskTypeName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "diskType", diskType, + "project", project, + "region", region); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionDiskTypeName) { + ProjectRegionDiskTypeName that = (ProjectRegionDiskTypeName) o; + return Objects.equals(this.diskType, that.getDiskType()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(diskType, project, region); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java index 052fb6e09ec1..47b9fbaa9b8d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java @@ -152,7 +152,7 @@ public RegionStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Region resource. Get a list of available regions by making a list() + * Returns the specified Region resource. Gets a list of available regions by making a list() * request. * *

Sample code: @@ -179,7 +179,7 @@ public final Region getRegion(ProjectRegionName region) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Region resource. Get a list of available regions by making a list() + * Returns the specified Region resource. Gets a list of available regions by making a list() * request. * *

Sample code: @@ -203,7 +203,7 @@ public final Region getRegion(String region) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Region resource. Get a list of available regions by making a list() + * Returns the specified Region resource. Gets a list of available regions by making a list() * request. * *

Sample code: @@ -228,7 +228,7 @@ public final Region getRegion(GetRegionHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Region resource. Get a list of available regions by making a list() + * Returns the specified Region resource. Gets a list of available regions by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java index 9510741b271d..27f821e6ff9a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java @@ -296,7 +296,7 @@ public final AggregatedListRegionCommitmentsPagedResponse aggregatedListRegionCo // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified commitment resource. Get a list of available commitments by making a + * Returns the specified commitment resource. Gets a list of available commitments by making a * list() request. * *

Sample code: @@ -323,7 +323,7 @@ public final Commitment getRegionCommitment(ProjectRegionCommitmentName commitme // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified commitment resource. Get a list of available commitments by making a + * Returns the specified commitment resource. Gets a list of available commitments by making a * list() request. * *

Sample code: @@ -348,7 +348,7 @@ public final Commitment getRegionCommitment(String commitment) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified commitment resource. Get a list of available commitments by making a + * Returns the specified commitment resource. Gets a list of available commitments by making a * list() request. * *

Sample code: @@ -373,7 +373,7 @@ public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest reque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified commitment resource. Get a list of available commitments by making a + * Returns the specified commitment resource. Gets a list of available commitments by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java new file mode 100644 index 000000000000..5df811c2be59 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java @@ -0,0 +1,1304 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.RegionDiskStub; +import com.google.cloud.compute.v1.stub.RegionDiskStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+ *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+ *   String requestId = "";
+ *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+ *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, requestId, snapshotResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionDiskClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of RegionDiskSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * RegionDiskSettings regionDiskSettings =
+ *     RegionDiskSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionDiskClient regionDiskClient =
+ *     RegionDiskClient.create(regionDiskSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionDiskSettings regionDiskSettings =
+ *     RegionDiskSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionDiskClient regionDiskClient =
+ *     RegionDiskClient.create(regionDiskSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegionDiskClient implements BackgroundResource { + private final RegionDiskSettings settings; + private final RegionDiskStub stub; + + /** Constructs an instance of RegionDiskClient with default settings. */ + public static final RegionDiskClient create() throws IOException { + return create(RegionDiskSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionDiskClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final RegionDiskClient create(RegionDiskSettings settings) throws IOException { + return new RegionDiskClient(settings); + } + + /** + * Constructs an instance of RegionDiskClient, using the given stub for making calls. This is for + * advanced usage - prefer to use RegionDiskSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionDiskClient create(RegionDiskStub stub) { + return new RegionDiskClient(stub); + } + + /** + * Constructs an instance of RegionDiskClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected RegionDiskClient(RegionDiskSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionDiskStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionDiskClient(RegionDiskStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionDiskSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionDiskStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of this regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, requestId, snapshotResource);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk to snapshot. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots + * ==) (== resource_for v1.snapshots ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation createSnapshotRegionDisk( + ProjectRegionDiskName disk, String requestId, Snapshot snapshotResource) { + + CreateSnapshotRegionDiskHttpRequest request = + CreateSnapshotRegionDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .setSnapshotResource(snapshotResource) + .build(); + return createSnapshotRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of this regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk.toString(), requestId, snapshotResource);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk to snapshot. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots + * ==) (== resource_for v1.snapshots ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation createSnapshotRegionDisk( + String disk, String requestId, Snapshot snapshotResource) { + + CreateSnapshotRegionDiskHttpRequest request = + CreateSnapshotRegionDiskHttpRequest.newBuilder() + .setDisk(disk) + .setRequestId(requestId) + .setSnapshotResource(snapshotResource) + .build(); + return createSnapshotRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of this regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .setSnapshotResource(snapshotResource)
+   *     .build();
+   *   Operation response = regionDiskClient.createSnapshotRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation createSnapshotRegionDisk(CreateSnapshotRegionDiskHttpRequest request) { + return createSnapshotRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a snapshot of this regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+   *   CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .setSnapshotResource(snapshotResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionDiskClient.createSnapshotRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + createSnapshotRegionDiskCallable() { + return stub.createSnapshotRegionDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   Operation response = regionDiskClient.deleteRegionDisk(disk, requestId);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionDisk(ProjectRegionDiskName disk, String requestId) { + + DeleteRegionDiskHttpRequest request = + DeleteRegionDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .build(); + return deleteRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   Operation response = regionDiskClient.deleteRegionDisk(disk.toString(), requestId);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk to delete. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionDisk(String disk, String requestId) { + + DeleteRegionDiskHttpRequest request = + DeleteRegionDiskHttpRequest.newBuilder().setDisk(disk).setRequestId(requestId).build(); + return deleteRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   DeleteRegionDiskHttpRequest request = DeleteRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .build();
+   *   Operation response = regionDiskClient.deleteRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteRegionDisk(DeleteRegionDiskHttpRequest request) { + return deleteRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   DeleteRegionDiskHttpRequest request = DeleteRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .build();
+   *   ApiFuture<Operation> future = regionDiskClient.deleteRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteRegionDiskCallable() { + return stub.deleteRegionDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   Disk response = regionDiskClient.getRegionDisk(disk);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Disk getRegionDisk(ProjectRegionDiskName disk) { + + GetRegionDiskHttpRequest request = + GetRegionDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .build(); + return getRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   Disk response = regionDiskClient.getRegionDisk(disk.toString());
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Disk getRegionDisk(String disk) { + + GetRegionDiskHttpRequest request = GetRegionDiskHttpRequest.newBuilder().setDisk(disk).build(); + return getRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   GetRegionDiskHttpRequest request = GetRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .build();
+   *   Disk response = regionDiskClient.getRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Disk getRegionDisk(GetRegionDiskHttpRequest request) { + return getRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   GetRegionDiskHttpRequest request = GetRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .build();
+   *   ApiFuture<Disk> future = regionDiskClient.getRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   Disk response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionDiskCallable() { + return stub.getRegionDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent regional disk in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   String requestId = "";
+   *   String sourceImage = "";
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   Operation response = regionDiskClient.insertRegionDisk(requestId, sourceImage, region, diskResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sourceImage Optional. Source image to restore onto a disk. + * @param region Name of the region for this request. + * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionDisk( + String requestId, String sourceImage, ProjectRegionName region, Disk diskResource) { + + InsertRegionDiskHttpRequest request = + InsertRegionDiskHttpRequest.newBuilder() + .setRequestId(requestId) + .setSourceImage(sourceImage) + .setRegion(region == null ? null : region.toString()) + .setDiskResource(diskResource) + .build(); + return insertRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent regional disk in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   String requestId = "";
+   *   String sourceImage = "";
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   Operation response = regionDiskClient.insertRegionDisk(requestId, sourceImage, region.toString(), diskResource);
+   * }
+   * 
+ * + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param sourceImage Optional. Source image to restore onto a disk. + * @param region Name of the region for this request. + * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionDisk( + String requestId, String sourceImage, String region, Disk diskResource) { + + InsertRegionDiskHttpRequest request = + InsertRegionDiskHttpRequest.newBuilder() + .setRequestId(requestId) + .setSourceImage(sourceImage) + .setRegion(region) + .setDiskResource(diskResource) + .build(); + return insertRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent regional disk in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   String requestId = "";
+   *   String sourceImage = "";
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSourceImage(sourceImage)
+   *     .setRegion(region.toString())
+   *     .setDiskResource(diskResource)
+   *     .build();
+   *   Operation response = regionDiskClient.insertRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertRegionDisk(InsertRegionDiskHttpRequest request) { + return insertRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a persistent regional disk in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   String requestId = "";
+   *   String sourceImage = "";
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   Disk diskResource = Disk.newBuilder().build();
+   *   InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder()
+   *     .setRequestId(requestId)
+   *     .setSourceImage(sourceImage)
+   *     .setRegion(region.toString())
+   *     .setDiskResource(diskResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionDiskClient.insertRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertRegionDiskCallable() { + return stub.insertRegionDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of persistent disks contained within the specified region. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   for (Disk element : regionDiskClient.listRegionDisks(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionDisksPagedResponse listRegionDisks(ProjectRegionName region) { + ListRegionDisksHttpRequest request = + ListRegionDisksHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionDisks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of persistent disks contained within the specified region. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   for (Disk element : regionDiskClient.listRegionDisks(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region Name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionDisksPagedResponse listRegionDisks(String region) { + ListRegionDisksHttpRequest request = + ListRegionDisksHttpRequest.newBuilder().setRegion(region).build(); + return listRegionDisks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of persistent disks contained within the specified region. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionDisksHttpRequest request = ListRegionDisksHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (Disk element : regionDiskClient.listRegionDisks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionDisksPagedResponse listRegionDisks(ListRegionDisksHttpRequest request) { + return listRegionDisksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of persistent disks contained within the specified region. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionDisksHttpRequest request = ListRegionDisksHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionDisksPagedResponse> future = regionDiskClient.listRegionDisksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Disk element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listRegionDisksPagedCallable() { + return stub.listRegionDisksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the list of persistent disks contained within the specified region. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionDisksHttpRequest request = ListRegionDisksHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     DiskList response = regionDiskClient.listRegionDisksCallable().call(request);
+   *     for (Disk element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listRegionDisksCallable() { + return stub.listRegionDisksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
+   *   Operation response = regionDiskClient.resizeRegionDisk(disk, requestId, regionDisksResizeRequestResource);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param regionDisksResizeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeRegionDisk( + ProjectRegionDiskName disk, + String requestId, + RegionDisksResizeRequest regionDisksResizeRequestResource) { + + ResizeRegionDiskHttpRequest request = + ResizeRegionDiskHttpRequest.newBuilder() + .setDisk(disk == null ? null : disk.toString()) + .setRequestId(requestId) + .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource) + .build(); + return resizeRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
+   *   Operation response = regionDiskClient.resizeRegionDisk(disk.toString(), requestId, regionDisksResizeRequestResource);
+   * }
+   * 
+ * + * @param disk Name of the regional persistent disk. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param regionDisksResizeRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeRegionDisk( + String disk, String requestId, RegionDisksResizeRequest regionDisksResizeRequestResource) { + + ResizeRegionDiskHttpRequest request = + ResizeRegionDiskHttpRequest.newBuilder() + .setDisk(disk) + .setRequestId(requestId) + .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource) + .build(); + return resizeRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
+   *   ResizeRegionDiskHttpRequest request = ResizeRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource)
+   *     .build();
+   *   Operation response = regionDiskClient.resizeRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation resizeRegionDisk(ResizeRegionDiskHttpRequest request) { + return resizeRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resizes the specified regional persistent disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+   *   String requestId = "";
+   *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
+   *   ResizeRegionDiskHttpRequest request = ResizeRegionDiskHttpRequest.newBuilder()
+   *     .setDisk(disk.toString())
+   *     .setRequestId(requestId)
+   *     .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionDiskClient.resizeRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable resizeRegionDiskCallable() { + return stub.resizeRegionDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on the target regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   String requestId = "";
+   *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
+   *   Operation response = regionDiskClient.setLabelsRegionDisk(resource, requestId, regionSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param regionSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsRegionDisk( + ProjectRegionDiskResourceName resource, + String requestId, + RegionSetLabelsRequest regionSetLabelsRequestResource) { + + SetLabelsRegionDiskHttpRequest request = + SetLabelsRegionDiskHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setRequestId(requestId) + .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource) + .build(); + return setLabelsRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on the target regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   String requestId = "";
+   *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
+   *   Operation response = regionDiskClient.setLabelsRegionDisk(resource.toString(), requestId, regionSetLabelsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param requestId An optional request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server will know to ignore the request if it has + * already been completed. + *

For example, consider a situation where you make an initial request and the request + * times out. If you make the request again with the same request ID, the server can check if + * original operation with the same request ID was received, and if so, will ignore the second + * request. This prevents clients from accidentally creating duplicate commitments. + *

The request ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + * @param regionSetLabelsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsRegionDisk( + String resource, String requestId, RegionSetLabelsRequest regionSetLabelsRequestResource) { + + SetLabelsRegionDiskHttpRequest request = + SetLabelsRegionDiskHttpRequest.newBuilder() + .setResource(resource) + .setRequestId(requestId) + .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource) + .build(); + return setLabelsRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on the target regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   String requestId = "";
+   *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
+   *   SetLabelsRegionDiskHttpRequest request = SetLabelsRegionDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRequestId(requestId)
+   *     .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource)
+   *     .build();
+   *   Operation response = regionDiskClient.setLabelsRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setLabelsRegionDisk(SetLabelsRegionDiskHttpRequest request) { + return setLabelsRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the labels on the target regional disk. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   String requestId = "";
+   *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
+   *   SetLabelsRegionDiskHttpRequest request = SetLabelsRegionDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRequestId(requestId)
+   *     .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = regionDiskClient.setLabelsRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setLabelsRegionDiskCallable() { + return stub.setLabelsRegionDiskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = regionDiskClient.testIamPermissionsRegionDisk(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsRegionDisk( + ProjectRegionDiskResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsRegionDiskHttpRequest request = + TestIamPermissionsRegionDiskHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = regionDiskClient.testIamPermissionsRegionDisk(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsRegionDisk( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsRegionDiskHttpRequest request = + TestIamPermissionsRegionDiskHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsRegionDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsRegionDiskHttpRequest request = TestIamPermissionsRegionDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = regionDiskClient.testIamPermissionsRegionDisk(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsRegionDisk( + TestIamPermissionsRegionDiskHttpRequest request) { + return testIamPermissionsRegionDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+   *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsRegionDiskHttpRequest request = TestIamPermissionsRegionDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = regionDiskClient.testIamPermissionsRegionDiskCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsRegionDiskCallable() { + return stub.testIamPermissionsRegionDiskCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionDisksPagedResponse + extends AbstractPagedListResponse< + ListRegionDisksHttpRequest, DiskList, Disk, ListRegionDisksPage, + ListRegionDisksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionDisksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionDisksPagedResponse apply(ListRegionDisksPage input) { + return new ListRegionDisksPagedResponse(input); + } + }); + } + + private ListRegionDisksPagedResponse(ListRegionDisksPage page) { + super(page, ListRegionDisksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRegionDisksPage + extends AbstractPage { + + private ListRegionDisksPage( + PageContext context, DiskList response) { + super(context, response); + } + + private static ListRegionDisksPage createEmptyPage() { + return new ListRegionDisksPage(null, null); + } + + @Override + protected ListRegionDisksPage createPage( + PageContext context, DiskList response) { + return new ListRegionDisksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRegionDisksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionDisksHttpRequest, DiskList, Disk, ListRegionDisksPage, + ListRegionDisksFixedSizeCollection> { + + private ListRegionDisksFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionDisksFixedSizeCollection createEmptyCollection() { + return new ListRegionDisksFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionDisksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionDisksFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java new file mode 100644 index 000000000000..fdb694f95881 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java @@ -0,0 +1,265 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.RegionDiskClient.ListRegionDisksPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.RegionDiskStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionDiskClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSnapshotRegionDisk to 30 seconds: + * + *

+ * 
+ * RegionDiskSettings.Builder regionDiskSettingsBuilder =
+ *     RegionDiskSettings.newBuilder();
+ * regionDiskSettingsBuilder.createSnapshotRegionDiskSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionDiskSettings regionDiskSettings = regionDiskSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegionDiskSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createSnapshotRegionDisk. */ + public UnaryCallSettings + createSnapshotRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).createSnapshotRegionDiskSettings(); + } + + /** Returns the object with the settings used for calls to deleteRegionDisk. */ + public UnaryCallSettings deleteRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).deleteRegionDiskSettings(); + } + + /** Returns the object with the settings used for calls to getRegionDisk. */ + public UnaryCallSettings getRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).getRegionDiskSettings(); + } + + /** Returns the object with the settings used for calls to insertRegionDisk. */ + public UnaryCallSettings insertRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).insertRegionDiskSettings(); + } + + /** Returns the object with the settings used for calls to listRegionDisks. */ + public PagedCallSettings + listRegionDisksSettings() { + return ((RegionDiskStubSettings) getStubSettings()).listRegionDisksSettings(); + } + + /** Returns the object with the settings used for calls to resizeRegionDisk. */ + public UnaryCallSettings resizeRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).resizeRegionDiskSettings(); + } + + /** Returns the object with the settings used for calls to setLabelsRegionDisk. */ + public UnaryCallSettings + setLabelsRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).setLabelsRegionDiskSettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissionsRegionDisk. */ + public UnaryCallSettings + testIamPermissionsRegionDiskSettings() { + return ((RegionDiskStubSettings) getStubSettings()).testIamPermissionsRegionDiskSettings(); + } + + public static final RegionDiskSettings create(RegionDiskStubSettings stub) throws IOException { + return new RegionDiskSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionDiskStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RegionDiskStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return RegionDiskStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RegionDiskStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionDiskStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RegionDiskStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionDiskStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionDiskStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionDiskSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RegionDiskSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionDiskStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionDiskStubSettings.newBuilder()); + } + + protected Builder(RegionDiskSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionDiskStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public RegionDiskStubSettings.Builder getStubSettingsBuilder() { + return ((RegionDiskStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSnapshotRegionDisk. */ + public UnaryCallSettings.Builder + createSnapshotRegionDiskSettings() { + return getStubSettingsBuilder().createSnapshotRegionDiskSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRegionDisk. */ + public UnaryCallSettings.Builder + deleteRegionDiskSettings() { + return getStubSettingsBuilder().deleteRegionDiskSettings(); + } + + /** Returns the builder for the settings used for calls to getRegionDisk. */ + public UnaryCallSettings.Builder getRegionDiskSettings() { + return getStubSettingsBuilder().getRegionDiskSettings(); + } + + /** Returns the builder for the settings used for calls to insertRegionDisk. */ + public UnaryCallSettings.Builder + insertRegionDiskSettings() { + return getStubSettingsBuilder().insertRegionDiskSettings(); + } + + /** Returns the builder for the settings used for calls to listRegionDisks. */ + public PagedCallSettings.Builder< + ListRegionDisksHttpRequest, DiskList, ListRegionDisksPagedResponse> + listRegionDisksSettings() { + return getStubSettingsBuilder().listRegionDisksSettings(); + } + + /** Returns the builder for the settings used for calls to resizeRegionDisk. */ + public UnaryCallSettings.Builder + resizeRegionDiskSettings() { + return getStubSettingsBuilder().resizeRegionDiskSettings(); + } + + /** Returns the builder for the settings used for calls to setLabelsRegionDisk. */ + public UnaryCallSettings.Builder + setLabelsRegionDiskSettings() { + return getStubSettingsBuilder().setLabelsRegionDiskSettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissionsRegionDisk. */ + public UnaryCallSettings.Builder< + TestIamPermissionsRegionDiskHttpRequest, TestPermissionsResponse> + testIamPermissionsRegionDiskSettings() { + return getStubSettingsBuilder().testIamPermissionsRegionDiskSettings(); + } + + @Override + public RegionDiskSettings build() throws IOException { + return new RegionDiskSettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java new file mode 100644 index 000000000000..d4215d2c0199 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java @@ -0,0 +1,498 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.RegionDiskTypeStub; +import com.google.cloud.compute.v1.stub.RegionDiskTypeStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+ *   ProjectRegionDiskTypeName diskType = ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]");
+ *   DiskType response = regionDiskTypeClient.getRegionDiskType(diskType);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the regionDiskTypeClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of RegionDiskTypeSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * RegionDiskTypeSettings regionDiskTypeSettings =
+ *     RegionDiskTypeSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionDiskTypeClient regionDiskTypeClient =
+ *     RegionDiskTypeClient.create(regionDiskTypeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegionDiskTypeSettings regionDiskTypeSettings =
+ *     RegionDiskTypeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionDiskTypeClient regionDiskTypeClient =
+ *     RegionDiskTypeClient.create(regionDiskTypeSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegionDiskTypeClient implements BackgroundResource { + private final RegionDiskTypeSettings settings; + private final RegionDiskTypeStub stub; + + /** Constructs an instance of RegionDiskTypeClient with default settings. */ + public static final RegionDiskTypeClient create() throws IOException { + return create(RegionDiskTypeSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionDiskTypeClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final RegionDiskTypeClient create(RegionDiskTypeSettings settings) + throws IOException { + return new RegionDiskTypeClient(settings); + } + + /** + * Constructs an instance of RegionDiskTypeClient, using the given stub for making calls. This is + * for advanced usage - prefer to use RegionDiskTypeSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegionDiskTypeClient create(RegionDiskTypeStub stub) { + return new RegionDiskTypeClient(stub); + } + + /** + * Constructs an instance of RegionDiskTypeClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected RegionDiskTypeClient(RegionDiskTypeSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegionDiskTypeStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegionDiskTypeClient(RegionDiskTypeStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionDiskTypeSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionDiskTypeStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional disk type. Gets a list of available disk types by making a + * list() request. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionDiskTypeName diskType = ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]");
+   *   DiskType response = regionDiskTypeClient.getRegionDiskType(diskType);
+   * }
+   * 
+ * + * @param diskType Name of the disk type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final DiskType getRegionDiskType(ProjectRegionDiskTypeName diskType) { + + GetRegionDiskTypeHttpRequest request = + GetRegionDiskTypeHttpRequest.newBuilder() + .setDiskType(diskType == null ? null : diskType.toString()) + .build(); + return getRegionDiskType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional disk type. Gets a list of available disk types by making a + * list() request. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionDiskTypeName diskType = ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]");
+   *   DiskType response = regionDiskTypeClient.getRegionDiskType(diskType.toString());
+   * }
+   * 
+ * + * @param diskType Name of the disk type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final DiskType getRegionDiskType(String diskType) { + + GetRegionDiskTypeHttpRequest request = + GetRegionDiskTypeHttpRequest.newBuilder().setDiskType(diskType).build(); + return getRegionDiskType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional disk type. Gets a list of available disk types by making a + * list() request. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionDiskTypeName diskType = ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]");
+   *   GetRegionDiskTypeHttpRequest request = GetRegionDiskTypeHttpRequest.newBuilder()
+   *     .setDiskType(diskType.toString())
+   *     .build();
+   *   DiskType response = regionDiskTypeClient.getRegionDiskType(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final DiskType getRegionDiskType(GetRegionDiskTypeHttpRequest request) { + return getRegionDiskTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified regional disk type. Gets a list of available disk types by making a + * list() request. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionDiskTypeName diskType = ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]");
+   *   GetRegionDiskTypeHttpRequest request = GetRegionDiskTypeHttpRequest.newBuilder()
+   *     .setDiskType(diskType.toString())
+   *     .build();
+   *   ApiFuture<DiskType> future = regionDiskTypeClient.getRegionDiskTypeCallable().futureCall(request);
+   *   // Do something
+   *   DiskType response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getRegionDiskTypeCallable() { + return stub.getRegionDiskTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of regional disk types available to the specified project. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   for (DiskType element : regionDiskTypeClient.listRegionDiskTypes(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region The name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionDiskTypesPagedResponse listRegionDiskTypes(ProjectRegionName region) { + ListRegionDiskTypesHttpRequest request = + ListRegionDiskTypesHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listRegionDiskTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of regional disk types available to the specified project. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   for (DiskType element : regionDiskTypeClient.listRegionDiskTypes(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region The name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionDiskTypesPagedResponse listRegionDiskTypes(String region) { + ListRegionDiskTypesHttpRequest request = + ListRegionDiskTypesHttpRequest.newBuilder().setRegion(region).build(); + return listRegionDiskTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of regional disk types available to the specified project. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionDiskTypesHttpRequest request = ListRegionDiskTypesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (DiskType element : regionDiskTypeClient.listRegionDiskTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListRegionDiskTypesPagedResponse listRegionDiskTypes( + ListRegionDiskTypesHttpRequest request) { + return listRegionDiskTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of regional disk types available to the specified project. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionDiskTypesHttpRequest request = ListRegionDiskTypesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListRegionDiskTypesPagedResponse> future = regionDiskTypeClient.listRegionDiskTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (DiskType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listRegionDiskTypesPagedCallable() { + return stub.listRegionDiskTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of regional disk types available to the specified project. + * + *

Sample code: + * + *


+   * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListRegionDiskTypesHttpRequest request = ListRegionDiskTypesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     RegionDiskTypeList response = regionDiskTypeClient.listRegionDiskTypesCallable().call(request);
+   *     for (DiskType element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listRegionDiskTypesCallable() { + return stub.listRegionDiskTypesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionDiskTypesPagedResponse + extends AbstractPagedListResponse< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, DiskType, ListRegionDiskTypesPage, + ListRegionDiskTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionDiskTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRegionDiskTypesPagedResponse apply(ListRegionDiskTypesPage input) { + return new ListRegionDiskTypesPagedResponse(input); + } + }); + } + + private ListRegionDiskTypesPagedResponse(ListRegionDiskTypesPage page) { + super(page, ListRegionDiskTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRegionDiskTypesPage + extends AbstractPage< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, DiskType, ListRegionDiskTypesPage> { + + private ListRegionDiskTypesPage( + PageContext context, + RegionDiskTypeList response) { + super(context, response); + } + + private static ListRegionDiskTypesPage createEmptyPage() { + return new ListRegionDiskTypesPage(null, null); + } + + @Override + protected ListRegionDiskTypesPage createPage( + PageContext context, + RegionDiskTypeList response) { + return new ListRegionDiskTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRegionDiskTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, DiskType, ListRegionDiskTypesPage, + ListRegionDiskTypesFixedSizeCollection> { + + private ListRegionDiskTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionDiskTypesFixedSizeCollection createEmptyCollection() { + return new ListRegionDiskTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionDiskTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionDiskTypesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java new file mode 100644 index 000000000000..dc0c1fd48225 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java @@ -0,0 +1,333 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionDiskTypeList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private RegionDiskTypeList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private RegionDiskTypeList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("id") && id != null) { + fieldMap.put("id", Collections.singletonList(String.valueOf(id))); + } + if (fieldNames.contains("items") && items != null) { + ImmutableList.Builder stringList = ImmutableList.builder(); + for (DiskType item : items) { + stringList.add(item.toString()); + } + fieldMap.put("items", stringList.build()); + } + if (fieldNames.contains("kind") && kind != null) { + fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); + } + if (fieldNames.contains("nextPageToken") && nextPageToken != null) { + fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); + } + if (fieldNames.contains("selfLink") && selfLink != null) { + fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); + } + if (fieldNames.contains("warning") && warning != null) { + fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("id")) { + return String.valueOf(id); + } + if (fieldName.equals("items")) { + return String.valueOf(items); + } + if (fieldName.equals("kind")) { + return String.valueOf(kind); + } + if (fieldName.equals("nextPageToken")) { + return String.valueOf(nextPageToken); + } + if (fieldName.equals("selfLink")) { + return String.valueOf(selfLink); + } + if (fieldName.equals("warning")) { + return String.valueOf(warning); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(RegionDiskTypeList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionDiskTypeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final RegionDiskTypeList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new RegionDiskTypeList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(RegionDiskTypeList other) { + if (other == RegionDiskTypeList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(RegionDiskTypeList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new ArrayList<>(items.size()); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(DiskType items) { + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public RegionDiskTypeList build() { + + return new RegionDiskTypeList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionDiskTypeList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionDiskTypeList) { + RegionDiskTypeList that = (RegionDiskTypeList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java new file mode 100644 index 000000000000..0a61ca74e741 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.RegionDiskTypeClient.ListRegionDiskTypesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.RegionDiskTypeStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionDiskTypeClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegionDiskType to 30 seconds: + * + *

+ * 
+ * RegionDiskTypeSettings.Builder regionDiskTypeSettingsBuilder =
+ *     RegionDiskTypeSettings.newBuilder();
+ * regionDiskTypeSettingsBuilder.getRegionDiskTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionDiskTypeSettings regionDiskTypeSettings = regionDiskTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegionDiskTypeSettings extends ClientSettings { + /** Returns the object with the settings used for calls to getRegionDiskType. */ + public UnaryCallSettings getRegionDiskTypeSettings() { + return ((RegionDiskTypeStubSettings) getStubSettings()).getRegionDiskTypeSettings(); + } + + /** Returns the object with the settings used for calls to listRegionDiskTypes. */ + public PagedCallSettings< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + listRegionDiskTypesSettings() { + return ((RegionDiskTypeStubSettings) getStubSettings()).listRegionDiskTypesSettings(); + } + + public static final RegionDiskTypeSettings create(RegionDiskTypeStubSettings stub) + throws IOException { + return new RegionDiskTypeSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionDiskTypeStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RegionDiskTypeStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return RegionDiskTypeStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RegionDiskTypeStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionDiskTypeStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RegionDiskTypeStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionDiskTypeStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionDiskTypeStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionDiskTypeSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RegionDiskTypeSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegionDiskTypeStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegionDiskTypeStubSettings.newBuilder()); + } + + protected Builder(RegionDiskTypeSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionDiskTypeStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public RegionDiskTypeStubSettings.Builder getStubSettingsBuilder() { + return ((RegionDiskTypeStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getRegionDiskType. */ + public UnaryCallSettings.Builder + getRegionDiskTypeSettings() { + return getStubSettingsBuilder().getRegionDiskTypeSettings(); + } + + /** Returns the builder for the settings used for calls to listRegionDiskTypes. */ + public PagedCallSettings.Builder< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + listRegionDiskTypesSettings() { + return getStubSettingsBuilder().listRegionDiskTypesSettings(); + } + + @Override + public RegionDiskTypeSettings build() throws IOException { + return new RegionDiskTypeSettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java new file mode 100644 index 000000000000..dc4137065890 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java @@ -0,0 +1,149 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionDisksResizeRequest implements ApiMessage { + private final String sizeGb; + + private RegionDisksResizeRequest() { + this.sizeGb = null; + } + + private RegionDisksResizeRequest(String sizeGb) { + this.sizeGb = sizeGb; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("sizeGb") && sizeGb != null) { + fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("sizeGb")) { + return String.valueOf(sizeGb); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getSizeGb() { + return sizeGb; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(RegionDisksResizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionDisksResizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final RegionDisksResizeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new RegionDisksResizeRequest(); + } + + public static class Builder { + private String sizeGb; + + Builder() {} + + public Builder mergeFrom(RegionDisksResizeRequest other) { + if (other == RegionDisksResizeRequest.getDefaultInstance()) return this; + if (other.getSizeGb() != null) { + this.sizeGb = other.sizeGb; + } + return this; + } + + Builder(RegionDisksResizeRequest source) { + this.sizeGb = source.sizeGb; + } + + public String getSizeGb() { + return sizeGb; + } + + public Builder setSizeGb(String sizeGb) { + this.sizeGb = sizeGb; + return this; + } + + public RegionDisksResizeRequest build() { + return new RegionDisksResizeRequest(sizeGb); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setSizeGb(this.sizeGb); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionDisksResizeRequest{" + "sizeGb=" + sizeGb + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionDisksResizeRequest) { + RegionDisksResizeRequest that = (RegionDisksResizeRequest) o; + return Objects.equals(this.sizeGb, that.getSizeGb()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(sizeGb); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java new file mode 100644 index 000000000000..565f1de73102 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java @@ -0,0 +1,185 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class RegionSetLabelsRequest implements ApiMessage { + private final String labelFingerprint; + private final Map labels; + + private RegionSetLabelsRequest() { + this.labelFingerprint = null; + this.labels = null; + } + + private RegionSetLabelsRequest(String labelFingerprint, Map labels) { + this.labelFingerprint = labelFingerprint; + this.labels = labels; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) { + fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint))); + } + if (fieldNames.contains("labels") && labels != null) { + fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("labelFingerprint")) { + return String.valueOf(labelFingerprint); + } + if (fieldName.equals("labels")) { + return String.valueOf(labels); + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Map getLabelsMap() { + return labels; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(RegionSetLabelsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static RegionSetLabelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final RegionSetLabelsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new RegionSetLabelsRequest(); + } + + public static class Builder { + private String labelFingerprint; + private Map labels; + + Builder() {} + + public Builder mergeFrom(RegionSetLabelsRequest other) { + if (other == RegionSetLabelsRequest.getDefaultInstance()) return this; + if (other.getLabelFingerprint() != null) { + this.labelFingerprint = other.labelFingerprint; + } + if (other.getLabelsMap() != null) { + this.labels = other.labels; + } + return this; + } + + Builder(RegionSetLabelsRequest source) { + this.labelFingerprint = source.labelFingerprint; + this.labels = source.labels; + } + + public String getLabelFingerprint() { + return labelFingerprint; + } + + public Builder setLabelFingerprint(String labelFingerprint) { + this.labelFingerprint = labelFingerprint; + return this; + } + + public Map getLabelsMap() { + return labels; + } + + public Builder putAllLabels(Map labels) { + this.labels = labels; + return this; + } + + public RegionSetLabelsRequest build() { + + return new RegionSetLabelsRequest(labelFingerprint, labels); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setLabelFingerprint(this.labelFingerprint); + newBuilder.putAllLabels(this.labels); + return newBuilder; + } + } + + @Override + public String toString() { + return "RegionSetLabelsRequest{" + + "labelFingerprint=" + + labelFingerprint + + ", " + + "labels=" + + labels + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RegionSetLabelsRequest) { + RegionSetLabelsRequest that = (RegionSetLabelsRequest) o; + return Objects.equals(this.labelFingerprint, that.getLabelFingerprint()) + && Objects.equals(this.labels, that.getLabelsMap()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(labelFingerprint, labels); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java new file mode 100644 index 000000000000..809e47384582 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java @@ -0,0 +1,484 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class ResizeRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String disk; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionDisksResizeRequest regionDisksResizeRequestResource; + private final String requestId; + private final String userIp; + + private ResizeRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.disk = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionDisksResizeRequestResource = null; + this.requestId = null; + this.userIp = null; + } + + private ResizeRegionDiskHttpRequest( + String access_token, + String callback, + String disk, + String fields, + String key, + String prettyPrint, + String quotaUser, + RegionDisksResizeRequest regionDisksResizeRequestResource, + String requestId, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.disk = disk; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionDisksResizeRequestResource = regionDisksResizeRequestResource; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("disk") && disk != null) { + fieldMap.put("disk", Collections.singletonList(String.valueOf(disk))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionDisksResizeRequestResource") + && regionDisksResizeRequestResource != null) { + fieldMap.put( + "regionDisksResizeRequestResource", + Collections.singletonList(String.valueOf(regionDisksResizeRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("disk")) { + return String.valueOf(disk); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionDisksResizeRequestResource")) { + return String.valueOf(regionDisksResizeRequestResource); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionDisksResizeRequest getApiMessageRequestBody() { + return regionDisksResizeRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getDisk() { + return disk; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionDisksResizeRequest getRegionDisksResizeRequestResource() { + return regionDisksResizeRequestResource; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ResizeRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ResizeRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ResizeRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ResizeRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String disk; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionDisksResizeRequest regionDisksResizeRequestResource; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ResizeRegionDiskHttpRequest other) { + if (other == ResizeRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getDisk() != null) { + this.disk = other.disk; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionDisksResizeRequestResource() != null) { + this.regionDisksResizeRequestResource = other.regionDisksResizeRequestResource; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ResizeRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.disk = source.disk; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionDisksResizeRequestResource = source.regionDisksResizeRequestResource; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getDisk() { + return disk; + } + + public Builder setDisk(String disk) { + this.disk = disk; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionDisksResizeRequest getRegionDisksResizeRequestResource() { + return regionDisksResizeRequestResource; + } + + public Builder setRegionDisksResizeRequestResource( + RegionDisksResizeRequest regionDisksResizeRequestResource) { + this.regionDisksResizeRequestResource = regionDisksResizeRequestResource; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ResizeRegionDiskHttpRequest build() { + String missing = ""; + + if (disk == null) { + missing += " disk"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ResizeRegionDiskHttpRequest( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + regionDisksResizeRequestResource, + requestId, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setDisk(this.disk); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionDisksResizeRequestResource(this.regionDisksResizeRequestResource); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ResizeRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "disk=" + + disk + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionDisksResizeRequestResource=" + + regionDisksResizeRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ResizeRegionDiskHttpRequest) { + ResizeRegionDiskHttpRequest that = (ResizeRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.disk, that.getDisk()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionDisksResizeRequestResource, that.getRegionDisksResizeRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + disk, + fields, + key, + prettyPrint, + quotaUser, + regionDisksResizeRequestResource, + requestId, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java index 4389062e766e..a9459f8879af 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java @@ -275,7 +275,7 @@ public final UnaryCallable deleteRouteCallabl // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Route resource. Get a list of available routes by making a list() + * Returns the specified Route resource. Gets a list of available routes by making a list() * request. * *

Sample code: @@ -300,7 +300,7 @@ public final Route getRoute(ProjectGlobalRouteName route) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Route resource. Get a list of available routes by making a list() + * Returns the specified Route resource. Gets a list of available routes by making a list() * request. * *

Sample code: @@ -324,7 +324,7 @@ public final Route getRoute(String route) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Route resource. Get a list of available routes by making a list() + * Returns the specified Route resource. Gets a list of available routes by making a list() * request. * *

Sample code: @@ -349,7 +349,7 @@ public final Route getRoute(GetRouteHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Route resource. Get a list of available routes by making a list() + * Returns the specified Route resource. Gets a list of available routes by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java index 4941d1313c03..8bab4d9e0202 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java @@ -413,7 +413,7 @@ public final UnaryCallable deleteRouterCalla // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Router resource. Get a list of available routers by making a list() + * Returns the specified Router resource. Gets a list of available routers by making a list() * request. * *

Sample code: @@ -440,7 +440,7 @@ public final Router getRouter(ProjectRegionRouterName router) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Router resource. Get a list of available routers by making a list() + * Returns the specified Router resource. Gets a list of available routers by making a list() * request. * *

Sample code: @@ -464,7 +464,7 @@ public final Router getRouter(String router) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Router resource. Get a list of available routers by making a list() + * Returns the specified Router resource. Gets a list of available routers by making a list() * request. * *

Sample code: @@ -489,7 +489,7 @@ public final Router getRouter(GetRouterHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Router resource. Get a list of available routers by making a list() + * Returns the specified Router resource. Gets a list of available routers by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java new file mode 100644 index 000000000000..5c97044f2cbc --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java @@ -0,0 +1,484 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SetLabelsRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final RegionSetLabelsRequest regionSetLabelsRequestResource; + private final String requestId; + private final String resource; + private final String userIp; + + private SetLabelsRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionSetLabelsRequestResource = null; + this.requestId = null; + this.resource = null; + this.userIp = null; + } + + private SetLabelsRegionDiskHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + RegionSetLabelsRequest regionSetLabelsRequestResource, + String requestId, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionSetLabelsRequestResource = regionSetLabelsRequestResource; + this.requestId = requestId; + this.resource = resource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("regionSetLabelsRequestResource") + && regionSetLabelsRequestResource != null) { + fieldMap.put( + "regionSetLabelsRequestResource", + Collections.singletonList(String.valueOf(regionSetLabelsRequestResource))); + } + if (fieldNames.contains("requestId") && requestId != null) { + fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("regionSetLabelsRequestResource")) { + return String.valueOf(regionSetLabelsRequestResource); + } + if (fieldName.equals("requestId")) { + return String.valueOf(requestId); + } + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public RegionSetLabelsRequest getApiMessageRequestBody() { + return regionSetLabelsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public RegionSetLabelsRequest getRegionSetLabelsRequestResource() { + return regionSetLabelsRequestResource; + } + + public String getRequestId() { + return requestId; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetLabelsRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetLabelsRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetLabelsRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetLabelsRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionSetLabelsRequest regionSetLabelsRequestResource; + private String requestId; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetLabelsRegionDiskHttpRequest other) { + if (other == SetLabelsRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegionSetLabelsRequestResource() != null) { + this.regionSetLabelsRequestResource = other.regionSetLabelsRequestResource; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetLabelsRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.regionSetLabelsRequestResource = source.regionSetLabelsRequestResource; + this.requestId = source.requestId; + this.resource = source.resource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public RegionSetLabelsRequest getRegionSetLabelsRequestResource() { + return regionSetLabelsRequestResource; + } + + public Builder setRegionSetLabelsRequestResource( + RegionSetLabelsRequest regionSetLabelsRequestResource) { + this.regionSetLabelsRequestResource = regionSetLabelsRequestResource; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetLabelsRegionDiskHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetLabelsRegionDiskHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + regionSetLabelsRequestResource, + requestId, + resource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegionSetLabelsRequestResource(this.regionSetLabelsRequestResource); + newBuilder.setRequestId(this.requestId); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetLabelsRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionSetLabelsRequestResource=" + + regionSetLabelsRequestResource + + ", " + + "requestId=" + + requestId + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetLabelsRegionDiskHttpRequest) { + SetLabelsRegionDiskHttpRequest that = (SetLabelsRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals( + this.regionSetLabelsRequestResource, that.getRegionSetLabelsRequestResource()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + regionSetLabelsRequestResource, + requestId, + resource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java index 66e6f7295e54..3b8509f39793 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java @@ -298,7 +298,7 @@ public final UnaryCallable deleteSnapshotC // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() + * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() * request. * *

Sample code: @@ -325,7 +325,7 @@ public final Snapshot getSnapshot(ProjectGlobalSnapshotName snapshot) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() + * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() * request. * *

Sample code: @@ -350,7 +350,7 @@ public final Snapshot getSnapshot(String snapshot) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() + * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() * request. * *

Sample code: @@ -375,7 +375,7 @@ public final Snapshot getSnapshot(GetSnapshotHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Snapshot resource. Get a list of available snapshots by making a list() + * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java index 0e1d06b3f14b..5f3650841791 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java @@ -282,7 +282,7 @@ public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by * making a list() request. * *

Sample code: @@ -309,7 +309,7 @@ public final SslCertificate getSslCertificate(ProjectGlobalSslCertificateName ss // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by * making a list() request. * *

Sample code: @@ -334,7 +334,7 @@ public final SslCertificate getSslCertificate(String sslCertificate) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by * making a list() request. * *

Sample code: @@ -359,7 +359,7 @@ public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest reque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SslCertificate resource. Get a list of available SSL certificates by + * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java index 3258234f1d9a..8d71c1fda14d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java @@ -383,7 +383,7 @@ public final UnaryCallable getSslPolicyCalla // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a * list() request. * *

Sample code: @@ -428,7 +428,7 @@ public final Operation insertSslPolicy( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a * list() request. * *

Sample code: @@ -473,7 +473,7 @@ public final Operation insertSslPolicy( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a * list() request. * *

Sample code: @@ -502,7 +502,7 @@ public final Operation insertSslPolicy(InsertSslPolicyHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified SSL policy resource. Get a list of available SSL policies by making a + * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java index b5616fa52c1a..a9cf424b146e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java @@ -33,6 +33,7 @@ public final class Subnetwork implements ApiMessage { private final String creationTimestamp; private final String description; + private final Boolean enableFlowLogs; private final String fingerprint; private final String gatewayAddress; private final String id; @@ -48,6 +49,7 @@ public final class Subnetwork implements ApiMessage { private Subnetwork() { this.creationTimestamp = null; this.description = null; + this.enableFlowLogs = null; this.fingerprint = null; this.gatewayAddress = null; this.id = null; @@ -64,6 +66,7 @@ private Subnetwork() { private Subnetwork( String creationTimestamp, String description, + Boolean enableFlowLogs, String fingerprint, String gatewayAddress, String id, @@ -77,6 +80,7 @@ private Subnetwork( String selfLink) { this.creationTimestamp = creationTimestamp; this.description = description; + this.enableFlowLogs = enableFlowLogs; this.fingerprint = fingerprint; this.gatewayAddress = gatewayAddress; this.id = id; @@ -100,6 +104,9 @@ public Map> populateFieldsInMap(Set fieldNames) { if (fieldNames.contains("description") && description != null) { fieldMap.put("description", Collections.singletonList(String.valueOf(description))); } + if (fieldNames.contains("enableFlowLogs") && enableFlowLogs != null) { + fieldMap.put("enableFlowLogs", Collections.singletonList(String.valueOf(enableFlowLogs))); + } if (fieldNames.contains("fingerprint") && fingerprint != null) { fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); } @@ -150,6 +157,9 @@ public String getFieldStringValue(String fieldName) { if (fieldName.equals("description")) { return String.valueOf(description); } + if (fieldName.equals("enableFlowLogs")) { + return String.valueOf(enableFlowLogs); + } if (fieldName.equals("fingerprint")) { return String.valueOf(fingerprint); } @@ -200,6 +210,10 @@ public String getDescription() { return description; } + public Boolean getEnableFlowLogs() { + return enableFlowLogs; + } + public String getFingerprint() { return fingerprint; } @@ -269,6 +283,7 @@ public static Subnetwork getDefaultInstance() { public static class Builder { private String creationTimestamp; private String description; + private Boolean enableFlowLogs; private String fingerprint; private String gatewayAddress; private String id; @@ -291,6 +306,9 @@ public Builder mergeFrom(Subnetwork other) { if (other.getDescription() != null) { this.description = other.description; } + if (other.getEnableFlowLogs() != null) { + this.enableFlowLogs = other.enableFlowLogs; + } if (other.getFingerprint() != null) { this.fingerprint = other.fingerprint; } @@ -330,6 +348,7 @@ public Builder mergeFrom(Subnetwork other) { Builder(Subnetwork source) { this.creationTimestamp = source.creationTimestamp; this.description = source.description; + this.enableFlowLogs = source.enableFlowLogs; this.fingerprint = source.fingerprint; this.gatewayAddress = source.gatewayAddress; this.id = source.id; @@ -361,6 +380,15 @@ public Builder setDescription(String description) { return this; } + public Boolean getEnableFlowLogs() { + return enableFlowLogs; + } + + public Builder setEnableFlowLogs(Boolean enableFlowLogs) { + this.enableFlowLogs = enableFlowLogs; + return this; + } + public String getFingerprint() { return fingerprint; } @@ -473,6 +501,7 @@ public Subnetwork build() { return new Subnetwork( creationTimestamp, description, + enableFlowLogs, fingerprint, gatewayAddress, id, @@ -490,6 +519,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setCreationTimestamp(this.creationTimestamp); newBuilder.setDescription(this.description); + newBuilder.setEnableFlowLogs(this.enableFlowLogs); newBuilder.setFingerprint(this.fingerprint); newBuilder.setGatewayAddress(this.gatewayAddress); newBuilder.setId(this.id); @@ -514,6 +544,9 @@ public String toString() { + "description=" + description + ", " + + "enableFlowLogs=" + + enableFlowLogs + + ", " + "fingerprint=" + fingerprint + ", " @@ -558,6 +591,7 @@ public boolean equals(Object o) { Subnetwork that = (Subnetwork) o; return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.enableFlowLogs, that.getEnableFlowLogs()) && Objects.equals(this.fingerprint, that.getFingerprint()) && Objects.equals(this.gatewayAddress, that.getGatewayAddress()) && Objects.equals(this.id, that.getId()) @@ -578,6 +612,7 @@ public int hashCode() { return Objects.hash( creationTimestamp, description, + enableFlowLogs, fingerprint, gatewayAddress, id, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java index 45a10514dfb0..83e35c22d08c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java @@ -564,7 +564,7 @@ public final Operation expandIpCidrRangeSubnetwork( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * Returns the specified subnetwork. Gets a list of available subnetworks list() request. * *

Sample code: * @@ -590,7 +590,7 @@ public final Subnetwork getSubnetwork(ProjectRegionSubnetworkName subnetwork) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * Returns the specified subnetwork. Gets a list of available subnetworks list() request. * *

Sample code: * @@ -614,7 +614,7 @@ public final Subnetwork getSubnetwork(String subnetwork) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * Returns the specified subnetwork. Gets a list of available subnetworks list() request. * *

Sample code: * @@ -638,7 +638,7 @@ public final Subnetwork getSubnetwork(GetSubnetworkHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified subnetwork. Get a list of available subnetworks list() request. + * Returns the specified subnetwork. Gets a list of available subnetworks list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java index 7067f4cf03ab..db1c6e870004 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java @@ -283,7 +283,7 @@ public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by * making a list() request. * *

Sample code: @@ -311,7 +311,7 @@ public final TargetHttpProxy getTargetHttpProxy( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by * making a list() request. * *

Sample code: @@ -336,7 +336,7 @@ public final TargetHttpProxy getTargetHttpProxy(String targetHttpProxy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by * making a list() request. * *

Sample code: @@ -361,7 +361,7 @@ public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by + * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java index 8047dc217341..761464a474a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java @@ -283,7 +283,7 @@ public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies * by making a list() request. * *

Sample code: @@ -311,7 +311,7 @@ public final TargetHttpsProxy getTargetHttpsProxy( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies * by making a list() request. * *

Sample code: @@ -336,7 +336,7 @@ public final TargetHttpsProxy getTargetHttpsProxy(String targetHttpsProxy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies * by making a list() request. * *

Sample code: @@ -361,7 +361,7 @@ public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies + * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies * by making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java index 3bee7beb81cf..822058e866a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java @@ -423,7 +423,7 @@ public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetInstance resource. Get a list of available target instances by + * Returns the specified TargetInstance resource. Gets a list of available target instances by * making a list() request. * *

Sample code: @@ -450,7 +450,7 @@ public final TargetInstance getTargetInstance(ProjectZoneTargetInstanceName targ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetInstance resource. Get a list of available target instances by + * Returns the specified TargetInstance resource. Gets a list of available target instances by * making a list() request. * *

Sample code: @@ -475,7 +475,7 @@ public final TargetInstance getTargetInstance(String targetInstance) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetInstance resource. Get a list of available target instances by + * Returns the specified TargetInstance resource. Gets a list of available target instances by * making a list() request. * *

Sample code: @@ -500,7 +500,7 @@ public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest reque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetInstance resource. Get a list of available target instances by + * Returns the specified TargetInstance resource. Gets a list of available target instances by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java index ac47eb70d085..022065be3154 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java @@ -704,7 +704,7 @@ public final UnaryCallable deleteTargetP // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target pool. Get a list of available target pools by making a list() + * Returns the specified target pool. Gets a list of available target pools by making a list() * request. * *

Sample code: @@ -731,7 +731,7 @@ public final TargetPool getTargetPool(ProjectRegionTargetPoolName targetPool) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target pool. Get a list of available target pools by making a list() + * Returns the specified target pool. Gets a list of available target pools by making a list() * request. * *

Sample code: @@ -756,7 +756,7 @@ public final TargetPool getTargetPool(String targetPool) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target pool. Get a list of available target pools by making a list() + * Returns the specified target pool. Gets a list of available target pools by making a list() * request. * *

Sample code: @@ -781,7 +781,7 @@ public final TargetPool getTargetPool(GetTargetPoolHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target pool. Get a list of available target pools by making a list() + * Returns the specified target pool. Gets a list of available target pools by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java index 085abe9a5391..a96e1ca34053 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java @@ -282,7 +282,7 @@ public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by * making a list() request. * *

Sample code: @@ -309,7 +309,7 @@ public final TargetSslProxy getTargetSslProxy(ProjectGlobalTargetSslProxyName ta // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by * making a list() request. * *

Sample code: @@ -334,7 +334,7 @@ public final TargetSslProxy getTargetSslProxy(String targetSslProxy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by * making a list() request. * *

Sample code: @@ -359,7 +359,7 @@ public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest reque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by + * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java index 0df6ab3966c2..4cc4e9a9c1b8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java @@ -282,7 +282,7 @@ public final Operation deleteTargetTcpProxy(DeleteTargetTcpProxyHttpRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by * making a list() request. * *

Sample code: @@ -309,7 +309,7 @@ public final TargetTcpProxy getTargetTcpProxy(ProjectGlobalTargetTcpProxyName ta // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by * making a list() request. * *

Sample code: @@ -334,7 +334,7 @@ public final TargetTcpProxy getTargetTcpProxy(String targetTcpProxy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by * making a list() request. * *

Sample code: @@ -359,7 +359,7 @@ public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest reque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by + * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by * making a list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java index e32554addb0a..823d778ff705 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java @@ -425,8 +425,8 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making - * a list() request. + * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by + * making a list() request. * *

Sample code: * @@ -453,8 +453,8 @@ public final TargetVpnGateway getTargetVpnGateway( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making - * a list() request. + * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by + * making a list() request. * *

Sample code: * @@ -478,8 +478,8 @@ public final TargetVpnGateway getTargetVpnGateway(String targetVpnGateway) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making - * a list() request. + * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by + * making a list() request. * *

Sample code: * @@ -503,8 +503,8 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified target VPN gateway. Get a list of available target VPN gateways by making - * a list() request. + * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by + * making a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java new file mode 100644 index 000000000000..7e2cabb70c72 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java @@ -0,0 +1,449 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class TestIamPermissionsRegionDiskHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsRegionDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsRegionDiskHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + this.userIp = userIp; + } + + @Override + public Map> populateFieldsInMap(Set fieldNames) { + Map> fieldMap = new HashMap<>(); + if (fieldNames.contains("access_token") && access_token != null) { + fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); + } + if (fieldNames.contains("callback") && callback != null) { + fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); + } + if (fieldNames.contains("fields") && fields != null) { + fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); + } + if (fieldNames.contains("key") && key != null) { + fieldMap.put("key", Collections.singletonList(String.valueOf(key))); + } + if (fieldNames.contains("prettyPrint") && prettyPrint != null) { + fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); + } + if (fieldNames.contains("quotaUser") && quotaUser != null) { + fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); + } + if (fieldNames.contains("resource") && resource != null) { + fieldMap.put("resource", Collections.singletonList(String.valueOf(resource))); + } + if (fieldNames.contains("testPermissionsRequestResource") + && testPermissionsRequestResource != null) { + fieldMap.put( + "testPermissionsRequestResource", + Collections.singletonList(String.valueOf(testPermissionsRequestResource))); + } + if (fieldNames.contains("userIp") && userIp != null) { + fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); + } + return fieldMap; + } + + @Override + public String getFieldStringValue(String fieldName) { + if (fieldName.equals("access_token")) { + return String.valueOf(access_token); + } + if (fieldName.equals("callback")) { + return String.valueOf(callback); + } + if (fieldName.equals("fields")) { + return String.valueOf(fields); + } + if (fieldName.equals("key")) { + return String.valueOf(key); + } + if (fieldName.equals("prettyPrint")) { + return String.valueOf(prettyPrint); + } + if (fieldName.equals("quotaUser")) { + return String.valueOf(quotaUser); + } + if (fieldName.equals("resource")) { + return String.valueOf(resource); + } + if (fieldName.equals("testPermissionsRequestResource")) { + return String.valueOf(testPermissionsRequestResource); + } + if (fieldName.equals("userIp")) { + return String.valueOf(userIp); + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsRegionDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsRegionDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsRegionDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsRegionDiskHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsRegionDiskHttpRequest other) { + if (other == TestIamPermissionsRegionDiskHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsRegionDiskHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsRegionDiskHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsRegionDiskHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsRegionDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsRegionDiskHttpRequest) { + TestIamPermissionsRegionDiskHttpRequest that = (TestIamPermissionsRegionDiskHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java index f511264fd0c8..c24260332ba2 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java @@ -275,7 +275,7 @@ public final UnaryCallable deleteUrlMapCalla // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() + * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() * request. * *

Sample code: @@ -302,7 +302,7 @@ public final UrlMap getUrlMap(ProjectGlobalUrlMapName urlMap) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() + * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() * request. * *

Sample code: @@ -326,7 +326,7 @@ public final UrlMap getUrlMap(String urlMap) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() + * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() * request. * *

Sample code: @@ -351,7 +351,7 @@ public final UrlMap getUrlMap(GetUrlMapHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified UrlMap resource. Get a list of available URL maps by making a list() + * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() * request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java index 20c4f5e196cb..b6a9eda661b5 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java @@ -417,7 +417,7 @@ public final UnaryCallable deleteVpnTunne // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a + * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a * list() request. * *

Sample code: @@ -444,7 +444,7 @@ public final VpnTunnel getVpnTunnel(ProjectRegionVpnTunnelName vpnTunnel) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a + * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a * list() request. * *

Sample code: @@ -469,7 +469,7 @@ public final VpnTunnel getVpnTunnel(String vpnTunnel) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a + * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a * list() request. * *

Sample code: @@ -494,7 +494,7 @@ public final VpnTunnel getVpnTunnel(GetVpnTunnelHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a + * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a * list() request. * *

Sample code: diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java index 2630bf1ffd8f..cb825ba099c3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java @@ -152,7 +152,7 @@ public ZoneStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * Returns the specified Zone resource. Gets a list of available zones by making a list() request. * *

Sample code: * @@ -176,7 +176,7 @@ public final Zone getZone(ProjectZoneName zone) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * Returns the specified Zone resource. Gets a list of available zones by making a list() request. * *

Sample code: * @@ -199,7 +199,7 @@ public final Zone getZone(String zone) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * Returns the specified Zone resource. Gets a list of available zones by making a list() request. * *

Sample code: * @@ -223,7 +223,7 @@ public final Zone getZone(GetZoneHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the specified Zone resource. Get a list of available zones by making a list() request. + * Returns the specified Zone resource. Gets a list of available zones by making a list() request. * *

Sample code: * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java index 6bbcbe59587c..2106936a44e3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java @@ -515,6 +515,38 @@ * *

* + * ==================== RegionDiskTypeClient ==================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RegionDiskTypeClient: + * + *

+ * 
+ * try (RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient.create()) {
+ *   ProjectRegionDiskTypeName diskType = ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]");
+ *   DiskType response = regionDiskTypeClient.getRegionDiskType(diskType);
+ * }
+ * 
+ * 
+ * + * ================ RegionDiskClient ================ + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for RegionDiskClient: + * + *

+ * 
+ * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
+ *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
+ *   String requestId = "";
+ *   Snapshot snapshotResource = Snapshot.newBuilder().build();
+ *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, requestId, snapshotResource);
+ * }
+ * 
+ * 
+ * * ================================ RegionInstanceGroupManagerClient * ================================ * diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index 2cb7152ca8ba..ecf4d2ff151a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -140,7 +140,7 @@ public class HttpJsonInstanceStub extends InstanceStub { .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/attachDisk")) - .setQueryParams(Sets.newHashSet("requestId")) + .setQueryParams(Sets.newHashSet("forceAttach", "requestId")) .setResourceNameFactory(ProjectZoneInstanceName.newFactory()) .setResourceNameField("instance") .build()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java new file mode 100644 index 000000000000..ee8812df9c2c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java @@ -0,0 +1,65 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionDiskCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java new file mode 100644 index 000000000000..84e973aa4f46 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java @@ -0,0 +1,443 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.RegionDiskClient.ListRegionDisksPagedResponse; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.CreateSnapshotRegionDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.GetRegionDiskHttpRequest; +import com.google.cloud.compute.v1.InsertRegionDiskHttpRequest; +import com.google.cloud.compute.v1.ListRegionDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectRegionDiskName; +import com.google.cloud.compute.v1.ProjectRegionDiskResourceName; +import com.google.cloud.compute.v1.ProjectRegionName; +import com.google.cloud.compute.v1.ResizeRegionDiskHttpRequest; +import com.google.cloud.compute.v1.SetLabelsRegionDiskHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsRegionDiskHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionDiskStub extends RegionDiskStub { + @InternalApi + public static final ApiMethodDescriptor + createSnapshotRegionDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.createSnapshot") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(CreateSnapshotRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/disks/{disk}/createSnapshot")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + deleteRegionDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(DeleteRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/disks/{disk}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + getRegionDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/disks/{disk}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Disk.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + insertRegionDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(InsertRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/disks")) + .setQueryParams(Sets.newHashSet("requestId", "sourceImage")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listRegionDisksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionDisksHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/disks")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskList.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + resizeRegionDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.resize") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ResizeRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/disks/{disk}/resize")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionDiskName.newFactory()) + .setResourceNameField("disk") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + setLabelsRegionDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDisks.setLabels") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(SetLabelsRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/disks/{resource}/setLabels")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionDiskResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsRegionDiskHttpRequest, TestPermissionsResponse> + testIamPermissionsRegionDiskMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.regionDisks.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setRequestInstance( + TestIamPermissionsRegionDiskHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/disks/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionDiskResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + createSnapshotRegionDiskCallable; + private final UnaryCallable deleteRegionDiskCallable; + private final UnaryCallable getRegionDiskCallable; + private final UnaryCallable insertRegionDiskCallable; + private final UnaryCallable listRegionDisksCallable; + private final UnaryCallable + listRegionDisksPagedCallable; + private final UnaryCallable resizeRegionDiskCallable; + private final UnaryCallable + setLabelsRegionDiskCallable; + private final UnaryCallable + testIamPermissionsRegionDiskCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRegionDiskStub create(RegionDiskStubSettings settings) + throws IOException { + return new HttpJsonRegionDiskStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionDiskStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionDiskStub(RegionDiskStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionDiskStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionDiskStub( + RegionDiskStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionDiskStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonRegionDiskStub(RegionDiskStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonRegionDiskCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionDiskStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonRegionDiskStub( + RegionDiskStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createSnapshotRegionDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotRegionDiskMethodDescriptor) + .build(); + HttpJsonCallSettings deleteRegionDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionDiskMethodDescriptor) + .build(); + HttpJsonCallSettings getRegionDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionDiskMethodDescriptor) + .build(); + HttpJsonCallSettings insertRegionDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionDiskMethodDescriptor) + .build(); + HttpJsonCallSettings listRegionDisksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionDisksMethodDescriptor) + .build(); + HttpJsonCallSettings resizeRegionDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resizeRegionDiskMethodDescriptor) + .build(); + HttpJsonCallSettings + setLabelsRegionDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setLabelsRegionDiskMethodDescriptor) + .build(); + HttpJsonCallSettings + testIamPermissionsRegionDiskTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsRegionDiskMethodDescriptor) + .build(); + + this.createSnapshotRegionDiskCallable = + callableFactory.createUnaryCallable( + createSnapshotRegionDiskTransportSettings, + settings.createSnapshotRegionDiskSettings(), + clientContext); + this.deleteRegionDiskCallable = + callableFactory.createUnaryCallable( + deleteRegionDiskTransportSettings, settings.deleteRegionDiskSettings(), clientContext); + this.getRegionDiskCallable = + callableFactory.createUnaryCallable( + getRegionDiskTransportSettings, settings.getRegionDiskSettings(), clientContext); + this.insertRegionDiskCallable = + callableFactory.createUnaryCallable( + insertRegionDiskTransportSettings, settings.insertRegionDiskSettings(), clientContext); + this.listRegionDisksCallable = + callableFactory.createUnaryCallable( + listRegionDisksTransportSettings, settings.listRegionDisksSettings(), clientContext); + this.listRegionDisksPagedCallable = + callableFactory.createPagedCallable( + listRegionDisksTransportSettings, settings.listRegionDisksSettings(), clientContext); + this.resizeRegionDiskCallable = + callableFactory.createUnaryCallable( + resizeRegionDiskTransportSettings, settings.resizeRegionDiskSettings(), clientContext); + this.setLabelsRegionDiskCallable = + callableFactory.createUnaryCallable( + setLabelsRegionDiskTransportSettings, + settings.setLabelsRegionDiskSettings(), + clientContext); + this.testIamPermissionsRegionDiskCallable = + callableFactory.createUnaryCallable( + testIamPermissionsRegionDiskTransportSettings, + settings.testIamPermissionsRegionDiskSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable + createSnapshotRegionDiskCallable() { + return createSnapshotRegionDiskCallable; + } + + @BetaApi + public UnaryCallable deleteRegionDiskCallable() { + return deleteRegionDiskCallable; + } + + @BetaApi + public UnaryCallable getRegionDiskCallable() { + return getRegionDiskCallable; + } + + @BetaApi + public UnaryCallable insertRegionDiskCallable() { + return insertRegionDiskCallable; + } + + @BetaApi + public UnaryCallable + listRegionDisksPagedCallable() { + return listRegionDisksPagedCallable; + } + + @BetaApi + public UnaryCallable listRegionDisksCallable() { + return listRegionDisksCallable; + } + + @BetaApi + public UnaryCallable resizeRegionDiskCallable() { + return resizeRegionDiskCallable; + } + + @BetaApi + public UnaryCallable setLabelsRegionDiskCallable() { + return setLabelsRegionDiskCallable; + } + + @BetaApi + public UnaryCallable + testIamPermissionsRegionDiskCallable() { + return testIamPermissionsRegionDiskCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java new file mode 100644 index 000000000000..c6e1622f287e --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java @@ -0,0 +1,65 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonRegionDiskTypeCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java new file mode 100644 index 000000000000..7026a3e42be2 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java @@ -0,0 +1,220 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.RegionDiskTypeClient.ListRegionDiskTypesPagedResponse; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.GetRegionDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListRegionDiskTypesHttpRequest; +import com.google.cloud.compute.v1.ProjectRegionDiskTypeName; +import com.google.cloud.compute.v1.ProjectRegionName; +import com.google.cloud.compute.v1.RegionDiskTypeList; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonRegionDiskTypeStub extends RegionDiskTypeStub { + @InternalApi + public static final ApiMethodDescriptor + getRegionDiskTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDiskTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(GetRegionDiskTypeHttpRequest.getDefaultInstance()) + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/diskTypes/{diskType}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionDiskTypeName.newFactory()) + .setResourceNameField("diskType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(DiskType.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listRegionDiskTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionDiskTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setRequestInstance(ListRegionDiskTypesHttpRequest.getDefaultInstance()) + .setPathTemplate(PathTemplate.create("{project}/regions/{region}/diskTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(RegionDiskTypeList.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable getRegionDiskTypeCallable; + private final UnaryCallable + listRegionDiskTypesCallable; + private final UnaryCallable + listRegionDiskTypesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRegionDiskTypeStub create(RegionDiskTypeStubSettings settings) + throws IOException { + return new HttpJsonRegionDiskTypeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionDiskTypeStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionDiskTypeStub( + RegionDiskTypeStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonRegionDiskTypeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionDiskTypeStub( + RegionDiskTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionDiskTypeStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonRegionDiskTypeStub( + RegionDiskTypeStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRegionDiskTypeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionDiskTypeStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonRegionDiskTypeStub( + RegionDiskTypeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + getRegionDiskTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRegionDiskTypeMethodDescriptor) + .build(); + HttpJsonCallSettings + listRegionDiskTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRegionDiskTypesMethodDescriptor) + .build(); + + this.getRegionDiskTypeCallable = + callableFactory.createUnaryCallable( + getRegionDiskTypeTransportSettings, + settings.getRegionDiskTypeSettings(), + clientContext); + this.listRegionDiskTypesCallable = + callableFactory.createUnaryCallable( + listRegionDiskTypesTransportSettings, + settings.listRegionDiskTypesSettings(), + clientContext); + this.listRegionDiskTypesPagedCallable = + callableFactory.createPagedCallable( + listRegionDiskTypesTransportSettings, + settings.listRegionDiskTypesSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable getRegionDiskTypeCallable() { + return getRegionDiskTypeCallable; + } + + @BetaApi + public UnaryCallable + listRegionDiskTypesPagedCallable() { + return listRegionDiskTypesPagedCallable; + } + + @BetaApi + public UnaryCallable + listRegionDiskTypesCallable() { + return listRegionDiskTypesCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java new file mode 100644 index 000000000000..50b83ed2fc9c --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.RegionDiskClient.ListRegionDisksPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.CreateSnapshotRegionDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.GetRegionDiskHttpRequest; +import com.google.cloud.compute.v1.InsertRegionDiskHttpRequest; +import com.google.cloud.compute.v1.ListRegionDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ResizeRegionDiskHttpRequest; +import com.google.cloud.compute.v1.SetLabelsRegionDiskHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsRegionDiskHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionDiskStub implements BackgroundResource { + + @BetaApi + public UnaryCallable + createSnapshotRegionDiskCallable() { + throw new UnsupportedOperationException("Not implemented: createSnapshotRegionDiskCallable()"); + } + + @BetaApi + public UnaryCallable deleteRegionDiskCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRegionDiskCallable()"); + } + + @BetaApi + public UnaryCallable getRegionDiskCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionDiskCallable()"); + } + + @BetaApi + public UnaryCallable insertRegionDiskCallable() { + throw new UnsupportedOperationException("Not implemented: insertRegionDiskCallable()"); + } + + @BetaApi + public UnaryCallable + listRegionDisksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionDisksPagedCallable()"); + } + + @BetaApi + public UnaryCallable listRegionDisksCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionDisksCallable()"); + } + + @BetaApi + public UnaryCallable resizeRegionDiskCallable() { + throw new UnsupportedOperationException("Not implemented: resizeRegionDiskCallable()"); + } + + @BetaApi + public UnaryCallable setLabelsRegionDiskCallable() { + throw new UnsupportedOperationException("Not implemented: setLabelsRegionDiskCallable()"); + } + + @BetaApi + public UnaryCallable + testIamPermissionsRegionDiskCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsRegionDiskCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java new file mode 100644 index 000000000000..b2f9119eff36 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java @@ -0,0 +1,543 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.RegionDiskClient.ListRegionDisksPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.CreateSnapshotRegionDiskHttpRequest; +import com.google.cloud.compute.v1.DeleteRegionDiskHttpRequest; +import com.google.cloud.compute.v1.Disk; +import com.google.cloud.compute.v1.DiskList; +import com.google.cloud.compute.v1.GetRegionDiskHttpRequest; +import com.google.cloud.compute.v1.InsertRegionDiskHttpRequest; +import com.google.cloud.compute.v1.ListRegionDisksHttpRequest; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ResizeRegionDiskHttpRequest; +import com.google.cloud.compute.v1.SetLabelsRegionDiskHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsRegionDiskHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionDiskStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSnapshotRegionDisk to 30 seconds: + * + *

+ * 
+ * RegionDiskStubSettings.Builder regionDiskSettingsBuilder =
+ *     RegionDiskStubSettings.newBuilder();
+ * regionDiskSettingsBuilder.createSnapshotRegionDiskSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionDiskStubSettings regionDiskSettings = regionDiskSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegionDiskStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings + createSnapshotRegionDiskSettings; + private final UnaryCallSettings deleteRegionDiskSettings; + private final UnaryCallSettings getRegionDiskSettings; + private final UnaryCallSettings insertRegionDiskSettings; + private final PagedCallSettings< + ListRegionDisksHttpRequest, DiskList, ListRegionDisksPagedResponse> + listRegionDisksSettings; + private final UnaryCallSettings resizeRegionDiskSettings; + private final UnaryCallSettings + setLabelsRegionDiskSettings; + private final UnaryCallSettings + testIamPermissionsRegionDiskSettings; + + /** Returns the object with the settings used for calls to createSnapshotRegionDisk. */ + public UnaryCallSettings + createSnapshotRegionDiskSettings() { + return createSnapshotRegionDiskSettings; + } + + /** Returns the object with the settings used for calls to deleteRegionDisk. */ + public UnaryCallSettings deleteRegionDiskSettings() { + return deleteRegionDiskSettings; + } + + /** Returns the object with the settings used for calls to getRegionDisk. */ + public UnaryCallSettings getRegionDiskSettings() { + return getRegionDiskSettings; + } + + /** Returns the object with the settings used for calls to insertRegionDisk. */ + public UnaryCallSettings insertRegionDiskSettings() { + return insertRegionDiskSettings; + } + + /** Returns the object with the settings used for calls to listRegionDisks. */ + public PagedCallSettings + listRegionDisksSettings() { + return listRegionDisksSettings; + } + + /** Returns the object with the settings used for calls to resizeRegionDisk. */ + public UnaryCallSettings resizeRegionDiskSettings() { + return resizeRegionDiskSettings; + } + + /** Returns the object with the settings used for calls to setLabelsRegionDisk. */ + public UnaryCallSettings + setLabelsRegionDiskSettings() { + return setLabelsRegionDiskSettings; + } + + /** Returns the object with the settings used for calls to testIamPermissionsRegionDisk. */ + public UnaryCallSettings + testIamPermissionsRegionDiskSettings() { + return testIamPermissionsRegionDiskSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionDiskStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionDiskStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RegionDiskStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionDiskStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSnapshotRegionDiskSettings = settingsBuilder.createSnapshotRegionDiskSettings().build(); + deleteRegionDiskSettings = settingsBuilder.deleteRegionDiskSettings().build(); + getRegionDiskSettings = settingsBuilder.getRegionDiskSettings().build(); + insertRegionDiskSettings = settingsBuilder.insertRegionDiskSettings().build(); + listRegionDisksSettings = settingsBuilder.listRegionDisksSettings().build(); + resizeRegionDiskSettings = settingsBuilder.resizeRegionDiskSettings().build(); + setLabelsRegionDiskSettings = settingsBuilder.setLabelsRegionDiskSettings().build(); + testIamPermissionsRegionDiskSettings = + settingsBuilder.testIamPermissionsRegionDiskSettings().build(); + } + + private static final PagedListDescriptor + LIST_REGION_DISKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRegionDisksHttpRequest injectToken( + ListRegionDisksHttpRequest payload, String token) { + return ListRegionDisksHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRegionDisksHttpRequest injectPageSize( + ListRegionDisksHttpRequest payload, int pageSize) { + return ListRegionDisksHttpRequest.newBuilder(payload).setMaxResults(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRegionDisksHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(DiskList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(DiskList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + ListRegionDisksHttpRequest, DiskList, ListRegionDisksPagedResponse> + LIST_REGION_DISKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRegionDisksHttpRequest, DiskList, ListRegionDisksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionDisksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REGION_DISKS_PAGE_STR_DESC, request, context); + return ListRegionDisksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for RegionDiskStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createSnapshotRegionDiskSettings; + private final UnaryCallSettings.Builder + deleteRegionDiskSettings; + private final UnaryCallSettings.Builder getRegionDiskSettings; + private final UnaryCallSettings.Builder + insertRegionDiskSettings; + private final PagedCallSettings.Builder< + ListRegionDisksHttpRequest, DiskList, ListRegionDisksPagedResponse> + listRegionDisksSettings; + private final UnaryCallSettings.Builder + resizeRegionDiskSettings; + private final UnaryCallSettings.Builder + setLabelsRegionDiskSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsRegionDiskHttpRequest, TestPermissionsResponse> + testIamPermissionsRegionDiskSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSnapshotRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionDisksSettings = PagedCallSettings.newBuilder(LIST_REGION_DISKS_PAGE_STR_FACT); + + resizeRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setLabelsRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsRegionDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSnapshotRegionDiskSettings, + deleteRegionDiskSettings, + getRegionDiskSettings, + insertRegionDiskSettings, + listRegionDisksSettings, + resizeRegionDiskSettings, + setLabelsRegionDiskSettings, + testIamPermissionsRegionDiskSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createSnapshotRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .insertRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listRegionDisksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .resizeRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setLabelsRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsRegionDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionDiskStubSettings settings) { + super(settings); + + createSnapshotRegionDiskSettings = settings.createSnapshotRegionDiskSettings.toBuilder(); + deleteRegionDiskSettings = settings.deleteRegionDiskSettings.toBuilder(); + getRegionDiskSettings = settings.getRegionDiskSettings.toBuilder(); + insertRegionDiskSettings = settings.insertRegionDiskSettings.toBuilder(); + listRegionDisksSettings = settings.listRegionDisksSettings.toBuilder(); + resizeRegionDiskSettings = settings.resizeRegionDiskSettings.toBuilder(); + setLabelsRegionDiskSettings = settings.setLabelsRegionDiskSettings.toBuilder(); + testIamPermissionsRegionDiskSettings = + settings.testIamPermissionsRegionDiskSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSnapshotRegionDiskSettings, + deleteRegionDiskSettings, + getRegionDiskSettings, + insertRegionDiskSettings, + listRegionDisksSettings, + resizeRegionDiskSettings, + setLabelsRegionDiskSettings, + testIamPermissionsRegionDiskSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSnapshotRegionDisk. */ + public UnaryCallSettings.Builder + createSnapshotRegionDiskSettings() { + return createSnapshotRegionDiskSettings; + } + + /** Returns the builder for the settings used for calls to deleteRegionDisk. */ + public UnaryCallSettings.Builder + deleteRegionDiskSettings() { + return deleteRegionDiskSettings; + } + + /** Returns the builder for the settings used for calls to getRegionDisk. */ + public UnaryCallSettings.Builder getRegionDiskSettings() { + return getRegionDiskSettings; + } + + /** Returns the builder for the settings used for calls to insertRegionDisk. */ + public UnaryCallSettings.Builder + insertRegionDiskSettings() { + return insertRegionDiskSettings; + } + + /** Returns the builder for the settings used for calls to listRegionDisks. */ + public PagedCallSettings.Builder< + ListRegionDisksHttpRequest, DiskList, ListRegionDisksPagedResponse> + listRegionDisksSettings() { + return listRegionDisksSettings; + } + + /** Returns the builder for the settings used for calls to resizeRegionDisk. */ + public UnaryCallSettings.Builder + resizeRegionDiskSettings() { + return resizeRegionDiskSettings; + } + + /** Returns the builder for the settings used for calls to setLabelsRegionDisk. */ + public UnaryCallSettings.Builder + setLabelsRegionDiskSettings() { + return setLabelsRegionDiskSettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissionsRegionDisk. */ + public UnaryCallSettings.Builder< + TestIamPermissionsRegionDiskHttpRequest, TestPermissionsResponse> + testIamPermissionsRegionDiskSettings() { + return testIamPermissionsRegionDiskSettings; + } + + @Override + public RegionDiskStubSettings build() throws IOException { + return new RegionDiskStubSettings(this); + } + } +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java new file mode 100644 index 000000000000..3ef40332f420 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java @@ -0,0 +1,58 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.RegionDiskTypeClient.ListRegionDiskTypesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.GetRegionDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListRegionDiskTypesHttpRequest; +import com.google.cloud.compute.v1.RegionDiskTypeList; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegionDiskTypeStub implements BackgroundResource { + + @BetaApi + public UnaryCallable getRegionDiskTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getRegionDiskTypeCallable()"); + } + + @BetaApi + public UnaryCallable + listRegionDiskTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionDiskTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable + listRegionDiskTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionDiskTypesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java new file mode 100644 index 000000000000..05f773d9ef49 --- /dev/null +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java @@ -0,0 +1,383 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1.stub; + +import static com.google.cloud.compute.v1.RegionDiskTypeClient.ListRegionDiskTypesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.DiskType; +import com.google.cloud.compute.v1.GetRegionDiskTypeHttpRequest; +import com.google.cloud.compute.v1.ListRegionDiskTypesHttpRequest; +import com.google.cloud.compute.v1.RegionDiskTypeList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegionDiskTypeStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRegionDiskType to 30 seconds: + * + *

+ * 
+ * RegionDiskTypeStubSettings.Builder regionDiskTypeSettingsBuilder =
+ *     RegionDiskTypeStubSettings.newBuilder();
+ * regionDiskTypeSettingsBuilder.getRegionDiskTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RegionDiskTypeStubSettings regionDiskTypeSettings = regionDiskTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegionDiskTypeStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings getRegionDiskTypeSettings; + private final PagedCallSettings< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + listRegionDiskTypesSettings; + + /** Returns the object with the settings used for calls to getRegionDiskType. */ + public UnaryCallSettings getRegionDiskTypeSettings() { + return getRegionDiskTypeSettings; + } + + /** Returns the object with the settings used for calls to listRegionDiskTypes. */ + public PagedCallSettings< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + listRegionDiskTypesSettings() { + return listRegionDiskTypesSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegionDiskTypeStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionDiskTypeStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RegionDiskTypeStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionDiskTypeStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getRegionDiskTypeSettings = settingsBuilder.getRegionDiskTypeSettings().build(); + listRegionDiskTypesSettings = settingsBuilder.listRegionDiskTypesSettings().build(); + } + + private static final PagedListDescriptor< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, DiskType> + LIST_REGION_DISK_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRegionDiskTypesHttpRequest injectToken( + ListRegionDiskTypesHttpRequest payload, String token) { + return ListRegionDiskTypesHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRegionDiskTypesHttpRequest injectPageSize( + ListRegionDiskTypesHttpRequest payload, int pageSize) { + return ListRegionDiskTypesHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListRegionDiskTypesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(RegionDiskTypeList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(RegionDiskTypeList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + LIST_REGION_DISK_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, + ListRegionDiskTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRegionDiskTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_REGION_DISK_TYPES_PAGE_STR_DESC, request, context); + return ListRegionDiskTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for RegionDiskTypeStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + getRegionDiskTypeSettings; + private final PagedCallSettings.Builder< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + listRegionDiskTypesSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getRegionDiskTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listRegionDiskTypesSettings = + PagedCallSettings.newBuilder(LIST_REGION_DISK_TYPES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getRegionDiskTypeSettings, listRegionDiskTypesSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .getRegionDiskTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listRegionDiskTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegionDiskTypeStubSettings settings) { + super(settings); + + getRegionDiskTypeSettings = settings.getRegionDiskTypeSettings.toBuilder(); + listRegionDiskTypesSettings = settings.listRegionDiskTypesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getRegionDiskTypeSettings, listRegionDiskTypesSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getRegionDiskType. */ + public UnaryCallSettings.Builder + getRegionDiskTypeSettings() { + return getRegionDiskTypeSettings; + } + + /** Returns the builder for the settings used for calls to listRegionDiskTypes. */ + public PagedCallSettings.Builder< + ListRegionDiskTypesHttpRequest, RegionDiskTypeList, ListRegionDiskTypesPagedResponse> + listRegionDiskTypesSettings() { + return listRegionDiskTypesSettings; + } + + @Override + public RegionDiskTypeStubSettings build() throws IOException { + return new RegionDiskTypeStubSettings(this); + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 5a69e0cf4f9a..60e6d5fb4771 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -360,6 +360,7 @@ public void getDiskTest() { String selfLink = "selfLink-1691268851"; String name = "name3373707"; String sourceImage = "sourceImage1661056055"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String status = "status-892481550"; Disk expectedResponse = Disk.newBuilder() @@ -380,6 +381,7 @@ public void getDiskTest() { .setSelfLink(selfLink) .setName(name) .setSourceImage(sourceImage) + .setRegion(region.toString()) .setStatus(status) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java index 7459f7997e95..be7b400f3a31 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java @@ -157,6 +157,7 @@ public void getDiskTypeTest() { String description = "description-1724546052"; String id = "id3355"; String validDiskSize = "validDiskSize-1653521184"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; DiskType expectedResponse = DiskType.newBuilder() @@ -168,6 +169,7 @@ public void getDiskTypeTest() { .setDescription(description) .setId(id) .setValidDiskSize(validDiskSize) + .setRegion(region.toString()) .setSelfLink(selfLink) .build(); mockService.addResponse(expectedResponse); diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index ccc9b8b8c3ef..9b6dad9db677 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -345,9 +345,11 @@ public void attachDiskInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; + Boolean forceAttach = false; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - Operation actualResponse = client.attachDiskInstance(instance, requestId, attachedDiskResource); + Operation actualResponse = + client.attachDiskInstance(instance, requestId, forceAttach, attachedDiskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -377,9 +379,10 @@ public void attachDiskInstanceExceptionTest() throws Exception { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String requestId = "requestId37109963"; + Boolean forceAttach = false; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - client.attachDiskInstance(instance, requestId, attachedDiskResource); + client.attachDiskInstance(instance, requestId, forceAttach, attachedDiskResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java new file mode 100644 index 000000000000..4a0d4d341655 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java @@ -0,0 +1,756 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.RegionDiskClient.ListRegionDisksPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.createSnapshotRegionDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.deleteRegionDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.getRegionDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.insertRegionDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.listRegionDisksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.resizeRegionDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.setLabelsRegionDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskStub.testIamPermissionsRegionDiskMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.RegionDiskStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionDiskClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + createSnapshotRegionDiskMethodDescriptor, + deleteRegionDiskMethodDescriptor, + getRegionDiskMethodDescriptor, + insertRegionDiskMethodDescriptor, + listRegionDisksMethodDescriptor, + resizeRegionDiskMethodDescriptor, + setLabelsRegionDiskMethodDescriptor, + testIamPermissionsRegionDiskMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionDiskStubSettings.getDefaultEndpoint()); + + private static RegionDiskClient client; + private static RegionDiskSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionDiskSettings.newBuilder() + .setTransportChannelProvider( + RegionDiskSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionDiskClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createSnapshotRegionDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + String requestId = "requestId37109963"; + Snapshot snapshotResource = Snapshot.newBuilder().build(); + + Operation actualResponse = client.createSnapshotRegionDisk(disk, requestId, snapshotResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void createSnapshotRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + String requestId = "requestId37109963"; + Snapshot snapshotResource = Snapshot.newBuilder().build(); + + client.createSnapshotRegionDisk(disk, requestId, snapshotResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteRegionDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + String requestId = "requestId37109963"; + + Operation actualResponse = client.deleteRegionDisk(disk, requestId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + String requestId = "requestId37109963"; + + client.deleteRegionDisk(disk, requestId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRegionDiskTest() { + String sizeGb = "sizeGb2105542105"; + String sourceSnapshotId = "sourceSnapshotId-1511650478"; + String lastDetachTimestamp = "lastDetachTimestamp-480399885"; + String description = "description-1724546052"; + String sourceSnapshot = "sourceSnapshot-947679896"; + String type = "type3575610"; + String labelFingerprint = "labelFingerprint714995737"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String creationTimestamp = "creationTimestamp567396278"; + String options = "options-1249474914"; + String id = "id3355"; + String sourceImageId = "sourceImageId-2092155357"; + String kind = "kind3292052"; + String lastAttachTimestamp = "lastAttachTimestamp-2105323995"; + String selfLink = "selfLink-1691268851"; + String name = "name3373707"; + String sourceImage = "sourceImage1661056055"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String status = "status-892481550"; + Disk expectedResponse = + Disk.newBuilder() + .setSizeGb(sizeGb) + .setSourceSnapshotId(sourceSnapshotId) + .setLastDetachTimestamp(lastDetachTimestamp) + .setDescription(description) + .setSourceSnapshot(sourceSnapshot) + .setType(type) + .setLabelFingerprint(labelFingerprint) + .setZone(zone.toString()) + .setCreationTimestamp(creationTimestamp) + .setOptions(options) + .setId(id) + .setSourceImageId(sourceImageId) + .setKind(kind) + .setLastAttachTimestamp(lastAttachTimestamp) + .setSelfLink(selfLink) + .setName(name) + .setSourceImage(sourceImage) + .setRegion(region.toString()) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + + Disk actualResponse = client.getRegionDisk(disk); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + + client.getRegionDisk(disk); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertRegionDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + String requestId = "requestId37109963"; + String sourceImage = "sourceImage1661056055"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + Disk diskResource = Disk.newBuilder().build(); + + Operation actualResponse = + client.insertRegionDisk(requestId, sourceImage, region, diskResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void insertRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String requestId = "requestId37109963"; + String sourceImage = "sourceImage1661056055"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + Disk diskResource = Disk.newBuilder().build(); + + client.insertRegionDisk(requestId, sourceImage, region, diskResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionDisksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + Disk itemsElement = Disk.newBuilder().build(); + List items = Arrays.asList(itemsElement); + DiskList expectedResponse = + DiskList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + + ListRegionDisksPagedResponse pagedListResponse = client.listRegionDisks(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionDisksExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionDisks(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void resizeRegionDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + String requestId = "requestId37109963"; + RegionDisksResizeRequest regionDisksResizeRequestResource = + RegionDisksResizeRequest.newBuilder().build(); + + Operation actualResponse = + client.resizeRegionDisk(disk, requestId, regionDisksResizeRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void resizeRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); + String requestId = "requestId37109963"; + RegionDisksResizeRequest regionDisksResizeRequestResource = + RegionDisksResizeRequest.newBuilder().build(); + + client.resizeRegionDisk(disk, requestId, regionDisksResizeRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setLabelsRegionDiskTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskResourceName resource = + ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + String requestId = "requestId37109963"; + RegionSetLabelsRequest regionSetLabelsRequestResource = + RegionSetLabelsRequest.newBuilder().build(); + + Operation actualResponse = + client.setLabelsRegionDisk(resource, requestId, regionSetLabelsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void setLabelsRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskResourceName resource = + ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + String requestId = "requestId37109963"; + RegionSetLabelsRequest regionSetLabelsRequestResource = + RegionSetLabelsRequest.newBuilder().build(); + + client.setLabelsRegionDisk(resource, requestId, regionSetLabelsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsRegionDiskTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskResourceName resource = + ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsRegionDisk(resource, testPermissionsRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsRegionDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskResourceName resource = + ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsRegionDisk(resource, testPermissionsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java new file mode 100644 index 000000000000..6ee2373e6d25 --- /dev/null +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java @@ -0,0 +1,207 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import static com.google.cloud.compute.v1.RegionDiskTypeClient.ListRegionDiskTypesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskTypeStub.getRegionDiskTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionDiskTypeStub.listRegionDiskTypesMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.RegionDiskTypeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegionDiskTypeClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + getRegionDiskTypeMethodDescriptor, listRegionDiskTypesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, RegionDiskTypeStubSettings.getDefaultEndpoint()); + + private static RegionDiskTypeClient client; + private static RegionDiskTypeSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + RegionDiskTypeSettings.newBuilder() + .setTransportChannelProvider( + RegionDiskTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionDiskTypeClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getRegionDiskTypeTest() { + String defaultDiskSizeGb = "defaultDiskSizeGb807490165"; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + String validDiskSize = "validDiskSize-1653521184"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String selfLink = "selfLink-1691268851"; + DiskType expectedResponse = + DiskType.newBuilder() + .setDefaultDiskSizeGb(defaultDiskSizeGb) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setValidDiskSize(validDiskSize) + .setRegion(region.toString()) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionDiskTypeName diskType = + ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]"); + + DiskType actualResponse = client.getRegionDiskType(diskType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getRegionDiskTypeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionDiskTypeName diskType = + ProjectRegionDiskTypeName.of("[PROJECT]", "[REGION]", "[DISK_TYPE]"); + + client.getRegionDiskType(diskType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listRegionDiskTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + DiskType itemsElement = DiskType.newBuilder().build(); + List items = Arrays.asList(itemsElement); + RegionDiskTypeList expectedResponse = + RegionDiskTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + + ListRegionDiskTypesPagedResponse pagedListResponse = client.listRegionDiskTypes(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listRegionDiskTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + + client.listRegionDiskTypes(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 0c3bb48581df..62c3de1e1ffd 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -355,6 +355,7 @@ public void getSubnetworkTest() { String description = "description-1724546052"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); String selfLink = "selfLink-1691268851"; + Boolean enableFlowLogs = true; String creationTimestamp = "creationTimestamp567396278"; String fingerprint = "fingerprint-1375934236"; String name = "name3373707"; @@ -369,6 +370,7 @@ public void getSubnetworkTest() { .setDescription(description) .setNetwork(network.toString()) .setSelfLink(selfLink) + .setEnableFlowLogs(enableFlowLogs) .setCreationTimestamp(creationTimestamp) .setFingerprint(fingerprint) .setName(name) From d31a454b780acb5aebd0e338320e26a0942fdd84 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 18 May 2018 10:57:11 -0700 Subject: [PATCH 38/42] Update from latest gapic-generator:master --- ...tancesInstanceGroupManagerHttpRequest.java | 73 +- ...RegionInstanceGroupManagerHttpRequest.java | 73 +- .../cloud/compute/v1/AcceleratorConfig.java | 28 +- .../cloud/compute/v1/AcceleratorType.java | 66 +- .../v1/AcceleratorTypeAggregatedList.java | 47 +- .../cloud/compute/v1/AcceleratorTypeList.java | 53 +- .../v1/AcceleratorTypesScopedList.java | 33 +- .../google/cloud/compute/v1/AccessConfig.java | 49 +- .../AddAccessConfigInstanceHttpRequest.java | 74 +- .../AddHealthCheckTargetPoolHttpRequest.java | 71 +- .../v1/AddInstanceTargetPoolHttpRequest.java | 71 +- .../AddInstancesInstanceGroupHttpRequest.java | 71 +- .../v1/AddPeeringNetworkHttpRequest.java | 71 +- .../com/google/cloud/compute/v1/Address.java | 89 +- .../compute/v1/AddressAggregatedList.java | 47 +- .../cloud/compute/v1/AddressClient.java | 73 +- .../google/cloud/compute/v1/AddressList.java | 53 +- .../cloud/compute/v1/AddressesScopedList.java | 33 +- ...egatedListAcceleratorTypesHttpRequest.java | 78 +- .../AggregatedListAddressesHttpRequest.java | 78 +- .../AggregatedListAutoscalersHttpRequest.java | 78 +- ...regatedListBackendServicesHttpRequest.java | 78 +- .../AggregatedListDiskTypesHttpRequest.java | 78 +- .../v1/AggregatedListDisksHttpRequest.java | 78 +- ...regatedListForwardingRulesHttpRequest.java | 78 +- ...egatedListGlobalOperationsHttpRequest.java | 78 +- ...dListInstanceGroupManagersHttpRequest.java | 78 +- ...gregatedListInstanceGroupsHttpRequest.java | 78 +- .../AggregatedListInstancesHttpRequest.java | 78 +- ...istInterconnectAttachmentsHttpRequest.java | 78 +- ...AggregatedListMachineTypesHttpRequest.java | 78 +- ...gatedListRegionCommitmentsHttpRequest.java | 78 +- .../v1/AggregatedListRoutersHttpRequest.java | 78 +- .../AggregatedListSubnetworksHttpRequest.java | 78 +- ...regatedListTargetInstancesHttpRequest.java | 78 +- .../AggregatedListTargetPoolsHttpRequest.java | 78 +- ...gatedListTargetVpnGatewaysHttpRequest.java | 78 +- .../AggregatedListVpnTunnelsHttpRequest.java | 78 +- .../google/cloud/compute/v1/AliasIpRange.java | 29 +- .../com/google/cloud/compute/v1/Allowed.java | 33 +- .../v1/AttachDiskInstanceHttpRequest.java | 74 +- .../google/cloud/compute/v1/AttachedDisk.java | 93 +- .../v1/AttachedDiskInitializeParams.java | 49 +- .../google/cloud/compute/v1/Autoscaler.java | 85 +- .../compute/v1/AutoscalerAggregatedList.java | 47 +- .../cloud/compute/v1/AutoscalerClient.java | 145 +--- .../cloud/compute/v1/AutoscalerList.java | 53 +- .../compute/v1/AutoscalerStatusDetails.java | 28 +- .../compute/v1/AutoscalersScopedList.java | 33 +- .../cloud/compute/v1/AutoscalingPolicy.java | 56 +- .../v1/AutoscalingPolicyCpuUtilization.java | 22 +- ...oscalingPolicyCustomMetricUtilization.java | 36 +- ...scalingPolicyLoadBalancingUtilization.java | 22 +- .../com/google/cloud/compute/v1/Backend.java | 66 +- .../cloud/compute/v1/BackendBucket.java | 59 +- .../cloud/compute/v1/BackendBucketClient.java | 149 +--- .../cloud/compute/v1/BackendBucketList.java | 53 +- .../cloud/compute/v1/BackendService.java | 136 +-- .../v1/BackendServiceAggregatedList.java | 47 +- .../compute/v1/BackendServiceCdnPolicy.java | 21 +- .../compute/v1/BackendServiceClient.java | 148 +--- .../compute/v1/BackendServiceGroupHealth.java | 33 +- .../cloud/compute/v1/BackendServiceIAP.java | 41 +- .../cloud/compute/v1/BackendServiceList.java | 53 +- .../compute/v1/BackendServicesScopedList.java | 33 +- .../compute/v1/CacheInvalidationRule.java | 28 +- .../cloud/compute/v1/CacheKeyPolicy.java | 53 +- .../google/cloud/compute/v1/Commitment.java | 89 +- .../compute/v1/CommitmentAggregatedList.java | 47 +- .../cloud/compute/v1/CommitmentList.java | 53 +- .../compute/v1/CommitmentsScopedList.java | 33 +- .../cloud/compute/v1/ConnectionDraining.java | 22 +- .../v1/CreateSnapshotDiskHttpRequest.java | 73 +- .../CreateSnapshotRegionDiskHttpRequest.java | 68 +- .../compute/v1/CustomerEncryptionKey.java | 28 +- .../CustomerEncryptionKeyProtectedDisk.java | 29 +- .../com/google/cloud/compute/v1/Data.java | 28 +- ...DeleteAccessConfigInstanceHttpRequest.java | 73 +- .../compute/v1/DeleteAddressHttpRequest.java | 63 +- .../v1/DeleteAutoscalerHttpRequest.java | 63 +- .../v1/DeleteBackendBucketHttpRequest.java | 63 +- .../v1/DeleteBackendServiceHttpRequest.java | 63 +- .../compute/v1/DeleteDiskHttpRequest.java | 63 +- .../compute/v1/DeleteFirewallHttpRequest.java | 63 +- .../v1/DeleteForwardingRuleHttpRequest.java | 63 +- .../v1/DeleteGlobalAddressHttpRequest.java | 63 +- ...DeleteGlobalForwardingRuleHttpRequest.java | 63 +- .../v1/DeleteGlobalOperationHttpRequest.java | 58 +- .../v1/DeleteHealthCheckHttpRequest.java | 63 +- .../v1/DeleteHttpHealthCheckHttpRequest.java | 63 +- .../v1/DeleteHttpsHealthCheckHttpRequest.java | 63 +- .../compute/v1/DeleteImageHttpRequest.java | 63 +- .../v1/DeleteInstanceGroupHttpRequest.java | 63 +- ...DeleteInstanceGroupManagerHttpRequest.java | 64 +- .../compute/v1/DeleteInstanceHttpRequest.java | 63 +- .../v1/DeleteInstanceTemplateHttpRequest.java | 63 +- ...tancesInstanceGroupManagerHttpRequest.java | 73 +- ...RegionInstanceGroupManagerHttpRequest.java | 73 +- ...leteInterconnectAttachmentHttpRequest.java | 65 +- .../v1/DeleteInterconnectHttpRequest.java | 63 +- .../compute/v1/DeleteLicenseHttpRequest.java | 63 +- .../compute/v1/DeleteNetworkHttpRequest.java | 63 +- .../v1/DeleteRegionAutoscalerHttpRequest.java | 63 +- ...DeleteRegionBackendServiceHttpRequest.java | 63 +- .../v1/DeleteRegionDiskHttpRequest.java | 63 +- ...RegionInstanceGroupManagerHttpRequest.java | 64 +- .../v1/DeleteRegionOperationHttpRequest.java | 58 +- .../compute/v1/DeleteRouteHttpRequest.java | 63 +- .../compute/v1/DeleteRouterHttpRequest.java | 63 +- .../compute/v1/DeleteSnapshotHttpRequest.java | 63 +- .../v1/DeleteSslCertificateHttpRequest.java | 63 +- .../v1/DeleteSslPolicyHttpRequest.java | 63 +- .../v1/DeleteSubnetworkHttpRequest.java | 63 +- .../v1/DeleteTargetHttpProxyHttpRequest.java | 63 +- .../v1/DeleteTargetHttpsProxyHttpRequest.java | 63 +- .../v1/DeleteTargetInstanceHttpRequest.java | 63 +- .../v1/DeleteTargetPoolHttpRequest.java | 63 +- .../v1/DeleteTargetSslProxyHttpRequest.java | 63 +- .../v1/DeleteTargetTcpProxyHttpRequest.java | 63 +- .../v1/DeleteTargetVpnGatewayHttpRequest.java | 63 +- .../compute/v1/DeleteUrlMapHttpRequest.java | 63 +- .../v1/DeleteVpnTunnelHttpRequest.java | 63 +- .../v1/DeleteZoneOperationHttpRequest.java | 58 +- .../com/google/cloud/compute/v1/Denied.java | 33 +- .../compute/v1/DeprecateImageHttpRequest.java | 70 +- .../cloud/compute/v1/DeprecationStatus.java | 43 +- .../v1/DetachDiskInstanceHttpRequest.java | 68 +- .../v1/DisableXpnHostProjectHttpRequest.java | 63 +- .../DisableXpnResourceProjectHttpRequest.java | 71 +- .../com/google/cloud/compute/v1/Disk.java | 186 +--- .../cloud/compute/v1/DiskAggregatedList.java | 47 +- .../google/cloud/compute/v1/DiskClient.java | 199 +---- .../com/google/cloud/compute/v1/DiskList.java | 53 +- .../cloud/compute/v1/DiskMoveRequest.java | 28 +- .../com/google/cloud/compute/v1/DiskType.java | 75 +- .../compute/v1/DiskTypeAggregatedList.java | 47 +- .../google/cloud/compute/v1/DiskTypeList.java | 53 +- .../cloud/compute/v1/DiskTypesScopedList.java | 33 +- .../cloud/compute/v1/DisksResizeRequest.java | 21 +- .../cloud/compute/v1/DisksScopedList.java | 33 +- .../v1/EnableXpnHostProjectHttpRequest.java | 63 +- .../EnableXpnResourceProjectHttpRequest.java | 71 +- .../com/google/cloud/compute/v1/Error.java | 25 +- .../com/google/cloud/compute/v1/Errors.java | 33 +- ...xpandIpCidrRangeSubnetworkHttpRequest.java | 71 +- .../com/google/cloud/compute/v1/Firewall.java | 137 +-- .../cloud/compute/v1/FirewallClient.java | 147 +--- .../google/cloud/compute/v1/FirewallList.java | 53 +- .../cloud/compute/v1/ForwardingRule.java | 110 +-- .../v1/ForwardingRuleAggregatedList.java | 47 +- .../compute/v1/ForwardingRuleClient.java | 112 +-- .../cloud/compute/v1/ForwardingRuleList.java | 53 +- .../compute/v1/ForwardingRulesScopedList.java | 33 +- .../v1/GetAcceleratorTypeHttpRequest.java | 58 +- .../compute/v1/GetAddressHttpRequest.java | 58 +- .../compute/v1/GetAutoscalerHttpRequest.java | 58 +- .../v1/GetBackendBucketHttpRequest.java | 58 +- .../v1/GetBackendServiceHttpRequest.java | 58 +- .../cloud/compute/v1/GetDiskHttpRequest.java | 58 +- .../compute/v1/GetDiskTypeHttpRequest.java | 58 +- .../compute/v1/GetFirewallHttpRequest.java | 58 +- .../v1/GetForwardingRuleHttpRequest.java | 58 +- .../v1/GetFromFamilyImageHttpRequest.java | 58 +- .../v1/GetGlobalAddressHttpRequest.java | 58 +- .../GetGlobalForwardingRuleHttpRequest.java | 58 +- .../v1/GetGlobalOperationHttpRequest.java | 58 +- .../GetHealthBackendServiceHttpRequest.java | 66 +- .../compute/v1/GetHealthCheckHttpRequest.java | 58 +- ...HealthRegionBackendServiceHttpRequest.java | 66 +- .../v1/GetHealthTargetPoolHttpRequest.java | 65 +- .../v1/GetHttpHealthCheckHttpRequest.java | 58 +- .../v1/GetHttpsHealthCheckHttpRequest.java | 58 +- .../cloud/compute/v1/GetImageHttpRequest.java | 58 +- .../v1/GetInstanceGroupHttpRequest.java | 58 +- .../GetInstanceGroupManagerHttpRequest.java | 59 +- .../compute/v1/GetInstanceHttpRequest.java | 58 +- .../v1/GetInstanceTemplateHttpRequest.java | 58 +- .../GetInterconnectAttachmentHttpRequest.java | 60 +- .../v1/GetInterconnectHttpRequest.java | 58 +- .../GetInterconnectLocationHttpRequest.java | 59 +- .../compute/v1/GetLicenseCodeHttpRequest.java | 58 +- .../compute/v1/GetLicenseHttpRequest.java | 58 +- .../compute/v1/GetMachineTypeHttpRequest.java | 58 +- .../compute/v1/GetNetworkHttpRequest.java | 58 +- .../compute/v1/GetProjectHttpRequest.java | 58 +- .../v1/GetRegionAutoscalerHttpRequest.java | 58 +- .../GetRegionBackendServiceHttpRequest.java | 58 +- .../v1/GetRegionCommitmentHttpRequest.java | 58 +- .../compute/v1/GetRegionDiskHttpRequest.java | 58 +- .../v1/GetRegionDiskTypeHttpRequest.java | 58 +- .../compute/v1/GetRegionHttpRequest.java | 58 +- .../v1/GetRegionInstanceGroupHttpRequest.java | 58 +- ...RegionInstanceGroupManagerHttpRequest.java | 59 +- .../v1/GetRegionOperationHttpRequest.java | 58 +- .../cloud/compute/v1/GetRouteHttpRequest.java | 58 +- .../compute/v1/GetRouterHttpRequest.java | 58 +- .../v1/GetRouterStatusRouterHttpRequest.java | 58 +- ...etSerialPortOutputInstanceHttpRequest.java | 68 +- .../compute/v1/GetSnapshotHttpRequest.java | 58 +- .../v1/GetSslCertificateHttpRequest.java | 58 +- .../compute/v1/GetSslPolicyHttpRequest.java | 58 +- .../compute/v1/GetSubnetworkHttpRequest.java | 58 +- .../v1/GetTargetHttpProxyHttpRequest.java | 58 +- .../v1/GetTargetHttpsProxyHttpRequest.java | 58 +- .../v1/GetTargetInstanceHttpRequest.java | 58 +- .../compute/v1/GetTargetPoolHttpRequest.java | 58 +- .../v1/GetTargetSslProxyHttpRequest.java | 58 +- .../v1/GetTargetTcpProxyHttpRequest.java | 58 +- .../v1/GetTargetVpnGatewayHttpRequest.java | 58 +- .../compute/v1/GetUrlMapHttpRequest.java | 58 +- .../compute/v1/GetVpnTunnelHttpRequest.java | 58 +- .../v1/GetXpnHostProjectHttpRequest.java | 58 +- .../GetXpnResourcesProjectsHttpRequest.java | 78 +- .../cloud/compute/v1/GetZoneHttpRequest.java | 58 +- .../v1/GetZoneOperationHttpRequest.java | 58 +- .../cloud/compute/v1/GlobalAddressClient.java | 77 +- .../v1/GlobalForwardingRuleClient.java | 107 +-- .../compute/v1/GlobalSetLabelsRequest.java | 27 +- .../cloud/compute/v1/GuestOsFeature.java | 21 +- .../google/cloud/compute/v1/HealthCheck.java | 95 +-- .../cloud/compute/v1/HealthCheckClient.java | 148 +--- .../cloud/compute/v1/HealthCheckList.java | 53 +- .../compute/v1/HealthCheckReference.java | 21 +- .../google/cloud/compute/v1/HealthStatus.java | 38 +- .../com/google/cloud/compute/v1/HostRule.java | 38 +- .../cloud/compute/v1/HttpHealthCheck.java | 43 +- .../cloud/compute/v1/HttpHealthCheck2.java | 85 +- .../compute/v1/HttpHealthCheckClient.java | 148 +--- .../cloud/compute/v1/HttpHealthCheckList.java | 53 +- .../cloud/compute/v1/HttpSHealthCheck.java | 43 +- .../cloud/compute/v1/HttpsHealthCheck2.java | 85 +- .../compute/v1/HttpsHealthCheckClient.java | 137 +-- .../compute/v1/HttpsHealthCheckList.java | 53 +- .../com/google/cloud/compute/v1/Image.java | 178 +--- .../google/cloud/compute/v1/ImageClient.java | 109 +-- .../google/cloud/compute/v1/ImageList.java | 53 +- .../compute/v1/InsertAddressHttpRequest.java | 68 +- .../v1/InsertAutoscalerHttpRequest.java | 69 +- .../v1/InsertBackendBucketHttpRequest.java | 70 +- .../v1/InsertBackendServiceHttpRequest.java | 70 +- .../compute/v1/InsertDiskHttpRequest.java | 73 +- .../compute/v1/InsertFirewallHttpRequest.java | 68 +- .../v1/InsertForwardingRuleHttpRequest.java | 70 +- .../v1/InsertGlobalAddressHttpRequest.java | 68 +- ...InsertGlobalForwardingRuleHttpRequest.java | 70 +- .../v1/InsertHealthCheckHttpRequest.java | 69 +- .../v1/InsertHttpHealthCheckHttpRequest.java | 70 +- .../v1/InsertHttpsHealthCheckHttpRequest.java | 70 +- .../compute/v1/InsertImageHttpRequest.java | 73 +- .../v1/InsertInstanceGroupHttpRequest.java | 70 +- ...InsertInstanceGroupManagerHttpRequest.java | 71 +- .../compute/v1/InsertInstanceHttpRequest.java | 75 +- .../v1/InsertInstanceTemplateHttpRequest.java | 70 +- ...sertInterconnectAttachmentHttpRequest.java | 71 +- .../v1/InsertInterconnectHttpRequest.java | 69 +- .../compute/v1/InsertLicenseHttpRequest.java | 68 +- .../compute/v1/InsertNetworkHttpRequest.java | 68 +- .../v1/InsertRegionAutoscalerHttpRequest.java | 69 +- ...InsertRegionBackendServiceHttpRequest.java | 70 +- .../v1/InsertRegionCommitmentHttpRequest.java | 69 +- .../v1/InsertRegionDiskHttpRequest.java | 73 +- ...RegionInstanceGroupManagerHttpRequest.java | 71 +- .../compute/v1/InsertRouteHttpRequest.java | 68 +- .../compute/v1/InsertRouterHttpRequest.java | 68 +- .../v1/InsertSslCertificateHttpRequest.java | 70 +- .../v1/InsertSslPolicyHttpRequest.java | 69 +- .../v1/InsertSubnetworkHttpRequest.java | 69 +- .../v1/InsertTargetHttpProxyHttpRequest.java | 70 +- .../v1/InsertTargetHttpsProxyHttpRequest.java | 70 +- .../v1/InsertTargetInstanceHttpRequest.java | 70 +- .../v1/InsertTargetPoolHttpRequest.java | 69 +- .../v1/InsertTargetSslProxyHttpRequest.java | 70 +- .../v1/InsertTargetTcpProxyHttpRequest.java | 70 +- .../v1/InsertTargetVpnGatewayHttpRequest.java | 70 +- .../compute/v1/InsertUrlMapHttpRequest.java | 68 +- .../v1/InsertVpnTunnelHttpRequest.java | 69 +- .../com/google/cloud/compute/v1/Instance.java | 156 +--- .../compute/v1/InstanceAggregatedList.java | 47 +- .../cloud/compute/v1/InstanceClient.java | 793 ++---------------- .../cloud/compute/v1/InstanceGroup.java | 89 +- .../v1/InstanceGroupAggregatedList.java | 47 +- .../cloud/compute/v1/InstanceGroupClient.java | 173 +--- .../cloud/compute/v1/InstanceGroupList.java | 53 +- .../compute/v1/InstanceGroupManager.java | 108 +-- .../InstanceGroupManagerActionsSummary.java | 60 +- .../InstanceGroupManagerAggregatedList.java | 47 +- .../v1/InstanceGroupManagerClient.java | 266 +----- .../compute/v1/InstanceGroupManagerList.java | 53 +- ...eGroupManagersAbandonInstancesRequest.java | 25 +- ...ceGroupManagersDeleteInstancesRequest.java | 25 +- ...pManagersListManagedInstancesResponse.java | 25 +- ...GroupManagersRecreateInstancesRequest.java | 25 +- .../v1/InstanceGroupManagersScopedList.java | 33 +- ...oupManagersSetInstanceTemplateRequest.java | 21 +- ...nceGroupManagersSetTargetPoolsRequest.java | 33 +- .../v1/InstanceGroupsAddInstancesRequest.java | 25 +- .../v1/InstanceGroupsListInstances.java | 53 +- .../InstanceGroupsListInstancesRequest.java | 21 +- .../InstanceGroupsRemoveInstancesRequest.java | 25 +- .../compute/v1/InstanceGroupsScopedList.java | 33 +- .../InstanceGroupsSetNamedPortsRequest.java | 33 +- .../google/cloud/compute/v1/InstanceList.java | 53 +- .../compute/v1/InstanceListReferrers.java | 53 +- .../cloud/compute/v1/InstanceMoveRequest.java | 28 +- .../cloud/compute/v1/InstanceProperties.java | 94 +-- .../cloud/compute/v1/InstanceReference.java | 21 +- .../cloud/compute/v1/InstanceTemplate.java | 54 +- .../compute/v1/InstanceTemplateClient.java | 71 +- .../compute/v1/InstanceTemplateList.java | 53 +- .../compute/v1/InstanceWithNamedPorts.java | 38 +- .../cloud/compute/v1/InstancesScopedList.java | 33 +- .../compute/v1/InstancesSetLabelsRequest.java | 27 +- .../InstancesSetMachineResourcesRequest.java | 25 +- .../v1/InstancesSetMachineTypeRequest.java | 21 +- .../v1/InstancesSetMinCpuPlatformRequest.java | 21 +- .../v1/InstancesSetServiceAccountRequest.java | 33 +- ...nstancesStartWithEncryptionKeyRequest.java | 25 +- .../google/cloud/compute/v1/Interconnect.java | 141 +--- .../compute/v1/InterconnectAttachment.java | 96 +-- .../InterconnectAttachmentAggregatedList.java | 47 +- .../v1/InterconnectAttachmentClient.java | 74 +- .../v1/InterconnectAttachmentList.java | 53 +- .../v1/InterconnectAttachmentPrivateInfo.java | 21 +- .../v1/InterconnectAttachmentsScopedList.java | 33 +- .../compute/v1/InterconnectCircuitInfo.java | 33 +- .../cloud/compute/v1/InterconnectClient.java | 114 +-- .../cloud/compute/v1/InterconnectList.java | 53 +- .../compute/v1/InterconnectLocation.java | 97 +-- .../compute/v1/InterconnectLocationList.java | 53 +- .../v1/InterconnectLocationRegionInfo.java | 33 +- .../v1/InterconnectOutageNotification.java | 63 +- .../v1/InvalidateCacheUrlMapHttpRequest.java | 71 +- .../com/google/cloud/compute/v1/Items.java | 28 +- .../com/google/cloud/compute/v1/License.java | 70 +- .../cloud/compute/v1/LicenseClient.java | 73 +- .../google/cloud/compute/v1/LicenseCode.java | 69 +- .../compute/v1/LicenseCodeLicenseAlias.java | 28 +- .../v1/LicenseResourceRequirements.java | 28 +- .../compute/v1/LicensesListResponse.java | 48 +- .../v1/ListAcceleratorTypesHttpRequest.java | 78 +- .../compute/v1/ListAddressesHttpRequest.java | 78 +- .../v1/ListAutoscalersHttpRequest.java | 78 +- ...ailableFeaturesSslPoliciesHttpRequest.java | 78 +- .../v1/ListBackendBucketsHttpRequest.java | 78 +- .../v1/ListBackendServicesHttpRequest.java | 78 +- .../compute/v1/ListDiskTypesHttpRequest.java | 78 +- .../compute/v1/ListDisksHttpRequest.java | 78 +- .../compute/v1/ListFirewallsHttpRequest.java | 78 +- .../v1/ListForwardingRulesHttpRequest.java | 78 +- .../v1/ListGlobalAddressesHttpRequest.java | 78 +- .../ListGlobalForwardingRulesHttpRequest.java | 78 +- .../v1/ListGlobalOperationsHttpRequest.java | 78 +- .../v1/ListHealthChecksHttpRequest.java | 78 +- .../v1/ListHttpHealthChecksHttpRequest.java | 78 +- .../v1/ListHttpsHealthChecksHttpRequest.java | 78 +- .../compute/v1/ListImagesHttpRequest.java | 78 +- .../ListInstanceGroupManagersHttpRequest.java | 78 +- .../v1/ListInstanceGroupsHttpRequest.java | 78 +- .../v1/ListInstanceTemplatesHttpRequest.java | 78 +- .../compute/v1/ListInstancesHttpRequest.java | 78 +- ...istInstancesInstanceGroupsHttpRequest.java | 86 +- ...tancesRegionInstanceGroupsHttpRequest.java | 87 +- ...istInterconnectAttachmentsHttpRequest.java | 78 +- .../ListInterconnectLocationsHttpRequest.java | 78 +- .../v1/ListInterconnectsHttpRequest.java | 78 +- .../compute/v1/ListLicensesHttpRequest.java | 78 +- .../v1/ListMachineTypesHttpRequest.java | 78 +- ...ancesInstanceGroupManagersHttpRequest.java | 79 +- ...egionInstanceGroupManagersHttpRequest.java | 79 +- .../compute/v1/ListNetworksHttpRequest.java | 78 +- .../v1/ListReferrersInstancesHttpRequest.java | 78 +- .../v1/ListRegionAutoscalersHttpRequest.java | 78 +- .../ListRegionBackendServicesHttpRequest.java | 78 +- .../v1/ListRegionCommitmentsHttpRequest.java | 78 +- .../v1/ListRegionDiskTypesHttpRequest.java | 78 +- .../v1/ListRegionDisksHttpRequest.java | 78 +- ...egionInstanceGroupManagersHttpRequest.java | 78 +- .../ListRegionInstanceGroupsHttpRequest.java | 78 +- .../v1/ListRegionOperationsHttpRequest.java | 78 +- .../compute/v1/ListRegionsHttpRequest.java | 78 +- .../compute/v1/ListRoutersHttpRequest.java | 78 +- .../compute/v1/ListRoutesHttpRequest.java | 78 +- .../compute/v1/ListSnapshotsHttpRequest.java | 78 +- .../v1/ListSslCertificatesHttpRequest.java | 78 +- .../v1/ListSslPoliciesHttpRequest.java | 78 +- .../v1/ListSubnetworksHttpRequest.java | 78 +- .../v1/ListTargetHttpProxiesHttpRequest.java | 78 +- .../v1/ListTargetHttpsProxiesHttpRequest.java | 78 +- .../v1/ListTargetInstancesHttpRequest.java | 78 +- .../v1/ListTargetPoolsHttpRequest.java | 78 +- .../v1/ListTargetSslProxiesHttpRequest.java | 78 +- .../v1/ListTargetTcpProxiesHttpRequest.java | 78 +- .../v1/ListTargetVpnGatewaysHttpRequest.java | 78 +- .../compute/v1/ListUrlMapsHttpRequest.java | 78 +- .../compute/v1/ListVpnTunnelsHttpRequest.java | 78 +- .../v1/ListXpnHostsProjectsHttpRequest.java | 86 +- .../v1/ListZoneOperationsHttpRequest.java | 78 +- .../compute/v1/ListZonesHttpRequest.java | 78 +- .../google/cloud/compute/v1/MachineType.java | 104 +-- .../compute/v1/MachineTypeAggregatedList.java | 47 +- .../cloud/compute/v1/MachineTypeList.java | 53 +- .../compute/v1/MachineTypesScopedList.java | 33 +- .../cloud/compute/v1/ManagedInstance.java | 43 +- .../v1/ManagedInstanceLastAttempt.java | 21 +- .../com/google/cloud/compute/v1/Metadata.java | 38 +- .../v1/MoveDiskProjectHttpRequest.java | 70 +- .../v1/MoveInstanceProjectHttpRequest.java | 70 +- .../google/cloud/compute/v1/NamedPort.java | 28 +- .../com/google/cloud/compute/v1/Network.java | 90 +- .../cloud/compute/v1/NetworkClient.java | 217 +---- .../cloud/compute/v1/NetworkInterface.java | 67 +- .../google/cloud/compute/v1/NetworkList.java | 53 +- .../cloud/compute/v1/NetworkPeering.java | 43 +- .../compute/v1/NetworkRoutingConfig.java | 21 +- .../compute/v1/NetworksAddPeeringRequest.java | 33 +- .../v1/NetworksRemovePeeringRequest.java | 21 +- .../google/cloud/compute/v1/Operation.java | 141 +--- .../compute/v1/OperationAggregatedList.java | 47 +- .../cloud/compute/v1/OperationList.java | 53 +- .../compute/v1/OperationsScopedList.java | 33 +- .../v1/PatchAutoscalerHttpRequest.java | 102 +-- .../v1/PatchBackendBucketHttpRequest.java | 98 +-- .../v1/PatchBackendServiceHttpRequest.java | 98 +-- .../compute/v1/PatchFirewallHttpRequest.java | 96 +-- .../v1/PatchHealthCheckHttpRequest.java | 97 +-- .../v1/PatchHttpHealthCheckHttpRequest.java | 98 +-- .../v1/PatchHttpsHealthCheckHttpRequest.java | 98 +-- .../v1/PatchInterconnectHttpRequest.java | 97 +-- .../compute/v1/PatchNetworkHttpRequest.java | 96 +-- .../v1/PatchRegionAutoscalerHttpRequest.java | 102 +-- .../PatchRegionBackendServiceHttpRequest.java | 98 +-- .../compute/v1/PatchRouterHttpRequest.java | 96 +-- .../compute/v1/PatchSslPolicyHttpRequest.java | 97 +-- .../v1/PatchSubnetworkHttpRequest.java | 97 +-- .../compute/v1/PatchUrlMapHttpRequest.java | 96 +-- .../google/cloud/compute/v1/PathMatcher.java | 43 +- .../com/google/cloud/compute/v1/PathRule.java | 33 +- .../compute/v1/PreviewRouterHttpRequest.java | 63 +- .../com/google/cloud/compute/v1/Project.java | 93 +- .../cloud/compute/v1/ProjectClient.java | 286 +------ .../v1/ProjectsDisableXpnResourceRequest.java | 21 +- .../v1/ProjectsEnableXpnResourceRequest.java | 21 +- .../compute/v1/ProjectsGetXpnResources.java | 38 +- .../v1/ProjectsListXpnHostsRequest.java | 21 +- .../com/google/cloud/compute/v1/Quota.java | 33 +- .../com/google/cloud/compute/v1/RawDisk.java | 33 +- ...tancesInstanceGroupManagerHttpRequest.java | 73 +- ...RegionInstanceGroupManagerHttpRequest.java | 73 +- .../google/cloud/compute/v1/Reference.java | 38 +- .../com/google/cloud/compute/v1/Region.java | 78 +- .../compute/v1/RegionAutoscalerClient.java | 151 +--- .../compute/v1/RegionAutoscalerList.java | 53 +- .../v1/RegionBackendServiceClient.java | 143 +--- .../compute/v1/RegionCommitmentClient.java | 35 +- .../cloud/compute/v1/RegionDiskClient.java | 188 +---- .../cloud/compute/v1/RegionDiskTypeList.java | 53 +- .../compute/v1/RegionDisksResizeRequest.java | 21 +- .../compute/v1/RegionInstanceGroupClient.java | 32 +- .../compute/v1/RegionInstanceGroupList.java | 53 +- .../v1/RegionInstanceGroupManagerClient.java | 268 +----- .../v1/RegionInstanceGroupManagerList.java | 53 +- ...eGroupManagersAbandonInstancesRequest.java | 25 +- ...ceGroupManagersDeleteInstancesRequest.java | 25 +- ...nceGroupManagersListInstancesResponse.java | 25 +- ...nInstanceGroupManagersRecreateRequest.java | 25 +- ...nceGroupManagersSetTargetPoolsRequest.java | 33 +- ...stanceGroupManagersSetTemplateRequest.java | 21 +- .../v1/RegionInstanceGroupsListInstances.java | 53 +- ...ionInstanceGroupsListInstancesRequest.java | 28 +- ...ionInstanceGroupsSetNamedPortsRequest.java | 33 +- .../google/cloud/compute/v1/RegionList.java | 53 +- .../compute/v1/RegionSetLabelsRequest.java | 27 +- ...emoveHealthCheckTargetPoolHttpRequest.java | 71 +- .../RemoveInstanceTargetPoolHttpRequest.java | 71 +- ...moveInstancesInstanceGroupHttpRequest.java | 71 +- .../v1/RemovePeeringNetworkHttpRequest.java | 71 +- .../compute/v1/ResetInstanceHttpRequest.java | 63 +- .../compute/v1/ResizeDiskHttpRequest.java | 70 +- ...ResizeInstanceGroupManagerHttpRequest.java | 69 +- .../v1/ResizeRegionDiskHttpRequest.java | 71 +- ...RegionInstanceGroupManagerHttpRequest.java | 69 +- .../cloud/compute/v1/ResourceCommitment.java | 28 +- .../compute/v1/ResourceGroupReference.java | 21 +- .../com/google/cloud/compute/v1/Route.java | 113 +-- .../google/cloud/compute/v1/RouteClient.java | 73 +- .../google/cloud/compute/v1/RouteList.java | 53 +- .../com/google/cloud/compute/v1/Router.java | 83 +- .../compute/v1/RouterAdvertisedIpRange.java | 28 +- .../compute/v1/RouterAggregatedList.java | 47 +- .../google/cloud/compute/v1/RouterBgp.java | 47 +- .../cloud/compute/v1/RouterBgpPeer.java | 74 +- .../google/cloud/compute/v1/RouterClient.java | 143 +--- .../cloud/compute/v1/RouterInterface.java | 41 +- .../google/cloud/compute/v1/RouterList.java | 53 +- .../google/cloud/compute/v1/RouterStatus.java | 51 +- .../compute/v1/RouterStatusBgpPeerStatus.java | 73 +- .../compute/v1/RouterStatusResponse.java | 28 +- .../compute/v1/RoutersPreviewResponse.java | 21 +- .../cloud/compute/v1/RoutersScopedList.java | 33 +- .../cloud/compute/v1/SSLHealthCheck.java | 43 +- .../google/cloud/compute/v1/Scheduling.java | 34 +- .../google/cloud/compute/v1/ScratchDisks.java | 21 +- .../cloud/compute/v1/SerialPortOutput.java | 43 +- .../cloud/compute/v1/ServiceAccount.java | 33 +- ...ckendServiceTargetSslProxyHttpRequest.java | 72 +- ...ckendServiceTargetTcpProxyHttpRequest.java | 72 +- .../v1/SetBackupTargetPoolHttpRequest.java | 75 +- ...monInstanceMetadataProjectHttpRequest.java | 68 +- ...DeletionProtectionInstanceHttpRequest.java | 69 +- .../SetDiskAutoDeleteInstanceHttpRequest.java | 73 +- ...mplateInstanceGroupManagerHttpRequest.java | 73 +- ...RegionInstanceGroupManagerHttpRequest.java | 73 +- .../compute/v1/SetLabelsDiskHttpRequest.java | 71 +- .../compute/v1/SetLabelsImageHttpRequest.java | 66 +- .../v1/SetLabelsInstanceHttpRequest.java | 71 +- .../v1/SetLabelsRegionDiskHttpRequest.java | 71 +- .../v1/SetLabelsSnapshotHttpRequest.java | 66 +- ...etMachineResourcesInstanceHttpRequest.java | 71 +- .../v1/SetMachineTypeInstanceHttpRequest.java | 71 +- .../v1/SetMetadataInstanceHttpRequest.java | 68 +- .../SetMinCpuPlatformInstanceHttpRequest.java | 71 +- ...SetNamedPortsInstanceGroupHttpRequest.java | 71 +- ...edPortsRegionInstanceGroupHttpRequest.java | 72 +- ...teIpGoogleAccessSubnetworkHttpRequest.java | 72 +- ...tProxyHeaderTargetSslProxyHttpRequest.java | 71 +- ...tProxyHeaderTargetTcpProxyHttpRequest.java | 71 +- .../v1/SetSchedulingInstanceHttpRequest.java | 69 +- .../SetServiceAccountInstanceHttpRequest.java | 71 +- ...rtificatesTargetHttpsProxyHttpRequest.java | 72 +- ...CertificatesTargetSslProxyHttpRequest.java | 72 +- ...tSslPolicyTargetHttpsProxyHttpRequest.java | 70 +- ...SetSslPolicyTargetSslProxyHttpRequest.java | 70 +- .../v1/SetTagsInstanceHttpRequest.java | 68 +- .../SetTargetForwardingRuleHttpRequest.java | 70 +- ...TargetGlobalForwardingRuleHttpRequest.java | 70 +- ...tPoolsInstanceGroupManagerHttpRequest.java | 73 +- ...RegionInstanceGroupManagerHttpRequest.java | 73 +- .../SetUrlMapTargetHttpProxyHttpRequest.java | 70 +- .../SetUrlMapTargetHttpsProxyHttpRequest.java | 70 +- ...etUsageExportBucketProjectHttpRequest.java | 70 +- .../com/google/cloud/compute/v1/Snapshot.java | 122 +-- .../cloud/compute/v1/SnapshotClient.java | 41 +- .../google/cloud/compute/v1/SnapshotList.java | 53 +- .../cloud/compute/v1/SslCertificate.java | 59 +- .../compute/v1/SslCertificateClient.java | 76 +- .../cloud/compute/v1/SslCertificateList.java | 53 +- .../cloud/compute/v1/SslPoliciesList.java | 53 +- ...PoliciesListAvailableFeaturesResponse.java | 25 +- .../google/cloud/compute/v1/SslPolicy.java | 92 +- .../cloud/compute/v1/SslPolicyClient.java | 112 +-- .../cloud/compute/v1/SslPolicyReference.java | 21 +- .../compute/v1/StartInstanceHttpRequest.java | 63 +- ...tWithEncryptionKeyInstanceHttpRequest.java | 72 +- .../compute/v1/StopInstanceHttpRequest.java | 63 +- .../google/cloud/compute/v1/Subnetwork.java | 96 +-- .../compute/v1/SubnetworkAggregatedList.java | 47 +- .../cloud/compute/v1/SubnetworkClient.java | 177 +--- .../cloud/compute/v1/SubnetworkList.java | 53 +- .../compute/v1/SubnetworkSecondaryRange.java | 28 +- .../SubnetworksExpandIpCidrRangeRequest.java | 21 +- .../compute/v1/SubnetworksScopedList.java | 33 +- ...tworksSetPrivateIpGoogleAccessRequest.java | 23 +- .../SwitchToCustomModeNetworkHttpRequest.java | 63 +- .../cloud/compute/v1/TCPHealthCheck.java | 43 +- .../com/google/cloud/compute/v1/Tags.java | 33 +- .../cloud/compute/v1/TargetHttpProxy.java | 54 +- .../compute/v1/TargetHttpProxyClient.java | 112 +-- .../cloud/compute/v1/TargetHttpProxyList.java | 53 +- ...HttpsProxiesSetSslCertificatesRequest.java | 25 +- .../cloud/compute/v1/TargetHttpsProxy.java | 69 +- .../compute/v1/TargetHttpsProxyClient.java | 172 +--- .../compute/v1/TargetHttpsProxyList.java | 53 +- .../cloud/compute/v1/TargetInstance.java | 64 +- .../v1/TargetInstanceAggregatedList.java | 47 +- .../compute/v1/TargetInstanceClient.java | 77 +- .../cloud/compute/v1/TargetInstanceList.java | 53 +- .../compute/v1/TargetInstancesScopedList.java | 33 +- .../google/cloud/compute/v1/TargetPool.java | 88 +- .../compute/v1/TargetPoolAggregatedList.java | 47 +- .../cloud/compute/v1/TargetPoolClient.java | 245 +----- .../compute/v1/TargetPoolInstanceHealth.java | 33 +- .../cloud/compute/v1/TargetPoolList.java | 53 +- .../v1/TargetPoolsAddHealthCheckRequest.java | 25 +- .../v1/TargetPoolsAddInstanceRequest.java | 25 +- .../TargetPoolsRemoveHealthCheckRequest.java | 25 +- .../v1/TargetPoolsRemoveInstanceRequest.java | 25 +- .../compute/v1/TargetPoolsScopedList.java | 33 +- .../cloud/compute/v1/TargetReference.java | 21 +- ...getSslProxiesSetBackendServiceRequest.java | 21 +- ...TargetSslProxiesSetProxyHeaderRequest.java | 21 +- ...etSslProxiesSetSslCertificatesRequest.java | 25 +- .../cloud/compute/v1/TargetSslProxy.java | 74 +- .../compute/v1/TargetSslProxyClient.java | 205 +---- .../cloud/compute/v1/TargetSslProxyList.java | 53 +- ...getTcpProxiesSetBackendServiceRequest.java | 21 +- ...TargetTcpProxiesSetProxyHeaderRequest.java | 21 +- .../cloud/compute/v1/TargetTcpProxy.java | 59 +- .../compute/v1/TargetTcpProxyClient.java | 140 +--- .../cloud/compute/v1/TargetTcpProxyList.java | 53 +- .../cloud/compute/v1/TargetVpnGateway.java | 83 +- .../v1/TargetVpnGatewayAggregatedList.java | 47 +- .../compute/v1/TargetVpnGatewayClient.java | 71 +- .../compute/v1/TargetVpnGatewayList.java | 53 +- .../v1/TargetVpnGatewaysScopedList.java | 33 +- .../google/cloud/compute/v1/TestFailure.java | 38 +- ...tIamPermissionsLicenseCodeHttpRequest.java | 66 +- .../TestIamPermissionsLicenseHttpRequest.java | 66 +- ...stIamPermissionsRegionDiskHttpRequest.java | 66 +- .../compute/v1/TestPermissionsRequest.java | 25 +- .../compute/v1/TestPermissionsResponse.java | 25 +- ...UpdateAccessConfigInstanceHttpRequest.java | 74 +- .../v1/UpdateAutoscalerHttpRequest.java | 102 +-- .../v1/UpdateBackendBucketHttpRequest.java | 98 +-- .../v1/UpdateBackendServiceHttpRequest.java | 98 +-- .../compute/v1/UpdateFirewallHttpRequest.java | 96 +-- .../v1/UpdateHealthCheckHttpRequest.java | 97 +-- .../v1/UpdateHttpHealthCheckHttpRequest.java | 98 +-- .../v1/UpdateHttpsHealthCheckHttpRequest.java | 98 +-- ...teNetworkInterfaceInstanceHttpRequest.java | 103 +-- .../v1/UpdateRegionAutoscalerHttpRequest.java | 102 +-- ...UpdateRegionBackendServiceHttpRequest.java | 98 +-- .../compute/v1/UpdateRouterHttpRequest.java | 96 +-- .../compute/v1/UpdateUrlMapHttpRequest.java | 96 +-- .../com/google/cloud/compute/v1/UrlMap.java | 87 +- .../google/cloud/compute/v1/UrlMapClient.java | 179 +--- .../google/cloud/compute/v1/UrlMapList.java | 53 +- .../cloud/compute/v1/UrlMapReference.java | 21 +- .../google/cloud/compute/v1/UrlMapTest.java | 38 +- .../compute/v1/UrlMapValidationResult.java | 47 +- .../compute/v1/UrlMapsValidateRequest.java | 21 +- .../compute/v1/UrlMapsValidateResponse.java | 21 +- .../cloud/compute/v1/UsageExportLocation.java | 28 +- .../compute/v1/ValidateUrlMapHttpRequest.java | 66 +- .../google/cloud/compute/v1/VpnTunnel.java | 113 +-- .../compute/v1/VpnTunnelAggregatedList.java | 47 +- .../cloud/compute/v1/VpnTunnelClient.java | 77 +- .../cloud/compute/v1/VpnTunnelList.java | 53 +- .../compute/v1/VpnTunnelsScopedList.java | 33 +- .../com/google/cloud/compute/v1/Warning.java | 38 +- .../com/google/cloud/compute/v1/Warnings.java | 38 +- .../google/cloud/compute/v1/XpnHostList.java | 53 +- .../cloud/compute/v1/XpnResourceId.java | 28 +- .../com/google/cloud/compute/v1/Zone.java | 74 +- .../com/google/cloud/compute/v1/ZoneList.java | 53 +- .../compute/v1/ZoneSetLabelsRequest.java | 27 +- .../google/cloud/compute/v1/package-info.java | 123 +-- .../v1/stub/HttpJsonAcceleratorTypeStub.java | 4 - .../compute/v1/stub/HttpJsonAddressStub.java | 5 - .../v1/stub/HttpJsonAutoscalerStub.java | 7 - .../v1/stub/HttpJsonBackendBucketStub.java | 6 - .../v1/stub/HttpJsonBackendServiceStub.java | 9 - .../compute/v1/stub/HttpJsonDiskStub.java | 8 - .../compute/v1/stub/HttpJsonDiskTypeStub.java | 3 - .../compute/v1/stub/HttpJsonFirewallStub.java | 6 - .../v1/stub/HttpJsonForwardingRuleStub.java | 7 - .../v1/stub/HttpJsonGlobalAddressStub.java | 4 - .../HttpJsonGlobalForwardingRuleStub.java | 8 - .../v1/stub/HttpJsonGlobalOperationStub.java | 5 - .../v1/stub/HttpJsonHealthCheckStub.java | 6 - .../v1/stub/HttpJsonHttpHealthCheckStub.java | 6 - .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 6 - .../compute/v1/stub/HttpJsonImageStub.java | 7 - .../HttpJsonInstanceGroupManagerStub.java | 22 - .../v1/stub/HttpJsonInstanceGroupStub.java | 13 - .../compute/v1/stub/HttpJsonInstanceStub.java | 34 - .../v1/stub/HttpJsonInstanceTemplateStub.java | 4 - .../HttpJsonInterconnectAttachmentStub.java | 9 - .../HttpJsonInterconnectLocationStub.java | 2 - .../v1/stub/HttpJsonInterconnectStub.java | 5 - .../v1/stub/HttpJsonLicenseCodeStub.java | 3 - .../compute/v1/stub/HttpJsonLicenseStub.java | 5 - .../v1/stub/HttpJsonMachineTypeStub.java | 4 - .../compute/v1/stub/HttpJsonNetworkStub.java | 8 - .../compute/v1/stub/HttpJsonProjectStub.java | 14 - .../v1/stub/HttpJsonRegionAutoscalerStub.java | 6 - .../HttpJsonRegionBackendServiceStub.java | 11 - .../v1/stub/HttpJsonRegionCommitmentStub.java | 5 - .../v1/stub/HttpJsonRegionDiskStub.java | 9 - .../v1/stub/HttpJsonRegionDiskTypeStub.java | 2 - ...ttpJsonRegionInstanceGroupManagerStub.java | 26 - .../stub/HttpJsonRegionInstanceGroupStub.java | 6 - .../v1/stub/HttpJsonRegionOperationStub.java | 3 - .../compute/v1/stub/HttpJsonRegionStub.java | 2 - .../compute/v1/stub/HttpJsonRouteStub.java | 4 - .../compute/v1/stub/HttpJsonRouterStub.java | 9 - .../compute/v1/stub/HttpJsonSnapshotStub.java | 4 - .../v1/stub/HttpJsonSslCertificateStub.java | 4 - .../v1/stub/HttpJsonSslPolicyStub.java | 7 - .../v1/stub/HttpJsonSubnetworkStub.java | 10 - .../v1/stub/HttpJsonTargetHttpProxyStub.java | 5 - .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 9 - .../v1/stub/HttpJsonTargetInstanceStub.java | 6 - .../v1/stub/HttpJsonTargetPoolStub.java | 12 - .../v1/stub/HttpJsonTargetSslProxyStub.java | 12 - .../v1/stub/HttpJsonTargetTcpProxyStub.java | 8 - .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 6 - .../compute/v1/stub/HttpJsonUrlMapStub.java | 8 - .../v1/stub/HttpJsonVpnTunnelStub.java | 5 - .../v1/stub/HttpJsonZoneOperationStub.java | 3 - .../compute/v1/stub/HttpJsonZoneStub.java | 2 - .../cloud/compute/v1/AddressClientTest.java | 12 +- .../compute/v1/AutoscalerClientTest.java | 26 +- .../compute/v1/BackendBucketClientTest.java | 27 +- .../compute/v1/BackendServiceClientTest.java | 27 +- .../cloud/compute/v1/DiskClientTest.java | 34 +- .../cloud/compute/v1/FirewallClientTest.java | 24 +- .../compute/v1/ForwardingRuleClientTest.java | 19 +- .../compute/v1/GlobalAddressClientTest.java | 12 +- .../v1/GlobalForwardingRuleClientTest.java | 19 +- .../compute/v1/HealthCheckClientTest.java | 25 +- .../compute/v1/HttpHealthCheckClientTest.java | 25 +- .../v1/HttpsHealthCheckClientTest.java | 25 +- .../cloud/compute/v1/ImageClientTest.java | 18 +- .../cloud/compute/v1/InstanceClientTest.java | 148 +--- .../compute/v1/InstanceGroupClientTest.java | 33 +- .../v1/InstanceGroupManagerClientTest.java | 51 +- .../v1/InstanceTemplateClientTest.java | 13 +- .../v1/InterconnectAttachmentClientTest.java | 13 +- .../compute/v1/InterconnectClientTest.java | 19 +- .../cloud/compute/v1/LicenseClientTest.java | 12 +- .../cloud/compute/v1/NetworkClientTest.java | 37 +- .../cloud/compute/v1/ProjectClientTest.java | 53 +- .../v1/RegionAutoscalerClientTest.java | 25 +- .../v1/RegionBackendServiceClientTest.java | 25 +- .../v1/RegionCommitmentClientTest.java | 6 +- .../compute/v1/RegionDiskClientTest.java | 35 +- .../v1/RegionInstanceGroupClientTest.java | 6 +- .../RegionInstanceGroupManagerClientTest.java | 62 +- .../cloud/compute/v1/RouteClientTest.java | 12 +- .../cloud/compute/v1/RouterClientTest.java | 24 +- .../cloud/compute/v1/SnapshotClientTest.java | 6 +- .../compute/v1/SslCertificateClientTest.java | 13 +- .../cloud/compute/v1/SslPolicyClientTest.java | 18 +- .../compute/v1/SubnetworkClientTest.java | 32 +- .../compute/v1/TargetHttpProxyClientTest.java | 19 +- .../v1/TargetHttpsProxyClientTest.java | 32 +- .../compute/v1/TargetInstanceClientTest.java | 12 +- .../compute/v1/TargetPoolClientTest.java | 48 +- .../compute/v1/TargetSslProxyClientTest.java | 37 +- .../compute/v1/TargetTcpProxyClientTest.java | 25 +- .../v1/TargetVpnGatewayClientTest.java | 13 +- .../cloud/compute/v1/UrlMapClientTest.java | 31 +- .../cloud/compute/v1/VpnTunnelClientTest.java | 12 +- 743 files changed, 10765 insertions(+), 33848 deletions(-) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java index b9a26621f369..5b3df3ee8132 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private AbandonInstancesInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("instanceGroupManagersAbandonInstancesRequestResource") - && instanceGroupManagersAbandonInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupManagersAbandonInstancesRequestResource", - Collections.singletonList( - String.valueOf(instanceGroupManagersAbandonInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("instanceGroupManagersAbandonInstancesRequestResource")) { - return String.valueOf(instanceGroupManagersAbandonInstancesRequestResource); + return instanceGroupManagersAbandonInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public InstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBody() { return instanceGroupManagersAbandonInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java index 1ccb72d73dc8..8a1b6a30beb0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -80,77 +76,36 @@ private AbandonInstancesRegionInstanceGroupManagerHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) { - fieldMap.put( - "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("regionInstanceGroupManagersAbandonInstancesRequestResource") - && regionInstanceGroupManagersAbandonInstancesRequestResource != null) { - fieldMap.put( - "regionInstanceGroupManagersAbandonInstancesRequestResource", - Collections.singletonList( - String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroupManager")) { - return String.valueOf(instanceGroupManager); + return instanceGroupManager; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("regionInstanceGroupManagersAbandonInstancesRequestResource")) { - return String.valueOf(regionInstanceGroupManagersAbandonInstancesRequestResource); + return regionInstanceGroupManagersAbandonInstancesRequestResource; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -161,6 +116,12 @@ public RegionInstanceGroupManagersAbandonInstancesRequest getApiMessageRequestBo return regionInstanceGroupManagersAbandonInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java index 78206f41eb00..f23011e953c4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private AcceleratorConfig(Integer acceleratorCount, String acceleratorType) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("acceleratorCount") && acceleratorCount != null) { - fieldMap.put("acceleratorCount", Collections.singletonList(String.valueOf(acceleratorCount))); - } - if (fieldNames.contains("acceleratorType") && acceleratorType != null) { - fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("acceleratorCount")) { - return String.valueOf(acceleratorCount); + return acceleratorCount; } if (fieldName.equals("acceleratorType")) { - return String.valueOf(acceleratorType); + return acceleratorType; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getAcceleratorCount() { return acceleratorCount; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java index 77d140001d40..fb87ef23f2f4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private AcceleratorType( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("deprecated") && deprecated != null) { - fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("maximumCardsPerInstance") && maximumCardsPerInstance != null) { - fieldMap.put( - "maximumCardsPerInstance", - Collections.singletonList(String.valueOf(maximumCardsPerInstance))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("deprecated")) { - return String.valueOf(deprecated); + return deprecated; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("maximumCardsPerInstance")) { - return String.valueOf(maximumCardsPerInstance); + return maximumCardsPerInstance; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -146,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java index 07b2d2dfd939..3ef933c0ed8e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private AcceleratorTypeAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java index d978fdcbf654..6445ea9d8386 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private AcceleratorTypeList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorType item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java index ae1279524908..91d5ebd7ae01 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private AcceleratorTypesScopedList(List acceleratorTypes, Warni } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("acceleratorTypes") && acceleratorTypes != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AcceleratorType item : acceleratorTypes) { - stringList.add(item.toString()); - } - fieldMap.put("acceleratorTypes", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("acceleratorTypes")) { - return String.valueOf(acceleratorTypes); + return acceleratorTypes; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAcceleratorTypesList() { return acceleratorTypes; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java index 6f2d287a7072..700c7be5d262 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,49 +57,24 @@ private AccessConfig( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("natIP") && natIP != null) { - fieldMap.put("natIP", Collections.singletonList(String.valueOf(natIP))); - } - if (fieldNames.contains("publicPtrDomainName") && publicPtrDomainName != null) { - fieldMap.put( - "publicPtrDomainName", Collections.singletonList(String.valueOf(publicPtrDomainName))); - } - if (fieldNames.contains("setPublicPtr") && setPublicPtr != null) { - fieldMap.put("setPublicPtr", Collections.singletonList(String.valueOf(setPublicPtr))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("natIP")) { - return String.valueOf(natIP); + return natIP; } if (fieldName.equals("publicPtrDomainName")) { - return String.valueOf(publicPtrDomainName); + return publicPtrDomainName; } if (fieldName.equals("setPublicPtr")) { - return String.valueOf(setPublicPtr); + return setPublicPtr; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -114,6 +85,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getKind() { return kind; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java index 62f3e600b067..355d5d314cfb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private AddAccessConfigInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) { - fieldMap.put( - "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource))); - } - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("networkInterface") && networkInterface != null) { - fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("accessConfigResource")) { - return String.valueOf(accessConfigResource); + return accessConfigResource; } if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("networkInterface")) { - return String.valueOf(networkInterface); + return networkInterface; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -164,6 +120,12 @@ public AccessConfig getApiMessageRequestBody() { return accessConfigResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public AccessConfig getAccessConfigResource() { return accessConfigResource; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java index b1faf9156468..9262d462efe4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddHealthCheckTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetPoolsAddHealthCheckRequestResource") - && targetPoolsAddHealthCheckRequestResource != null) { - fieldMap.put( - "targetPoolsAddHealthCheckRequestResource", - Collections.singletonList(String.valueOf(targetPoolsAddHealthCheckRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetPoolsAddHealthCheckRequestResource")) { - return String.valueOf(targetPoolsAddHealthCheckRequestResource); + return targetPoolsAddHealthCheckRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public TargetPoolsAddHealthCheckRequest getApiMessageRequestBody() { return targetPoolsAddHealthCheckRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java index 7a944fcdd6b2..29504b899fbf 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddInstanceTargetPoolHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("targetPool") && targetPool != null) { - fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool))); - } - if (fieldNames.contains("targetPoolsAddInstanceRequestResource") - && targetPoolsAddInstanceRequestResource != null) { - fieldMap.put( - "targetPoolsAddInstanceRequestResource", - Collections.singletonList(String.valueOf(targetPoolsAddInstanceRequestResource))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("targetPool")) { - return String.valueOf(targetPool); + return targetPool; } if (fieldName.equals("targetPoolsAddInstanceRequestResource")) { - return String.valueOf(targetPoolsAddInstanceRequestResource); + return targetPoolsAddInstanceRequestResource; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public TargetPoolsAddInstanceRequest getApiMessageRequestBody() { return targetPoolsAddInstanceRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java index 2585c5368b99..d728e67f4649 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddInstancesInstanceGroupHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("instanceGroup") && instanceGroup != null) { - fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup))); - } - if (fieldNames.contains("instanceGroupsAddInstancesRequestResource") - && instanceGroupsAddInstancesRequestResource != null) { - fieldMap.put( - "instanceGroupsAddInstancesRequestResource", - Collections.singletonList(String.valueOf(instanceGroupsAddInstancesRequestResource))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("instanceGroup")) { - return String.valueOf(instanceGroup); + return instanceGroup; } if (fieldName.equals("instanceGroupsAddInstancesRequestResource")) { - return String.valueOf(instanceGroupsAddInstancesRequestResource); + return instanceGroupsAddInstancesRequestResource; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public InstanceGroupsAddInstancesRequest getApiMessageRequestBody() { return instanceGroupsAddInstancesRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java index 01f04c528b36..2ee03b079e03 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -77,75 +73,36 @@ private AddPeeringNetworkHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("networksAddPeeringRequestResource") - && networksAddPeeringRequestResource != null) { - fieldMap.put( - "networksAddPeeringRequestResource", - Collections.singletonList(String.valueOf(networksAddPeeringRequestResource))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("networksAddPeeringRequestResource")) { - return String.valueOf(networksAddPeeringRequestResource); + return networksAddPeeringRequestResource; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -156,6 +113,12 @@ public NetworksAddPeeringRequest getApiMessageRequestBody() { return networksAddPeeringRequestResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java index bf5fb8f70e1c..3d04956026b1 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,95 +86,45 @@ private Address( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("address") && address != null) { - fieldMap.put("address", Collections.singletonList(String.valueOf(address))); - } - if (fieldNames.contains("addressType") && addressType != null) { - fieldMap.put("addressType", Collections.singletonList(String.valueOf(addressType))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("ipVersion") && ipVersion != null) { - fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("users") && users != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : users) { - stringList.add(item.toString()); - } - fieldMap.put("users", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("address")) { - return String.valueOf(address); + return address; } if (fieldName.equals("addressType")) { - return String.valueOf(addressType); + return addressType; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("ipVersion")) { - return String.valueOf(ipVersion); + return ipVersion; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("users")) { - return String.valueOf(users); + return users; } return null; } @@ -190,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAddress() { return address; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java index 089c2a50cbab..4fb93c707ae0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private AddressAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java index e00dea659899..0dc4ac78c33c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java @@ -43,8 +43,7 @@ * * try (AddressClient addressClient = AddressClient.create()) { * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - * String requestId = ""; - * Operation response = addressClient.deleteAddress(address, requestId); + * Operation response = addressClient.deleteAddress(address); * } * *

@@ -299,30 +298,19 @@ public final AggregatedListAddressesPagedResponse aggregatedListAddresses( *

    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
-   *   String requestId = "";
-   *   Operation response = addressClient.deleteAddress(address, requestId);
+   *   Operation response = addressClient.deleteAddress(address);
    * }
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAddress(ProjectRegionAddressName address, String requestId) { + public final Operation deleteAddress(ProjectRegionAddressName address) { DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder() .setAddress(address == null ? null : address.toString()) - .setRequestId(requestId) .build(); return deleteAddress(request); } @@ -336,28 +324,18 @@ public final Operation deleteAddress(ProjectRegionAddressName address, String re *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
-   *   String requestId = "";
-   *   Operation response = addressClient.deleteAddress(address.toString(), requestId);
+   *   Operation response = addressClient.deleteAddress(address.toString());
    * }
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAddress(String address, String requestId) { + public final Operation deleteAddress(String address) { DeleteAddressHttpRequest request = - DeleteAddressHttpRequest.newBuilder().setAddress(address).setRequestId(requestId).build(); + DeleteAddressHttpRequest.newBuilder().setAddress(address).build(); return deleteAddress(request); } @@ -370,10 +348,8 @@ public final Operation deleteAddress(String address, String requestId) { *


    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
-   *   String requestId = "";
    *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = addressClient.deleteAddress(request);
    * }
@@ -396,10 +372,8 @@ public final Operation deleteAddress(DeleteAddressHttpRequest request) {
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
    *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
-   *   String requestId = "";
    *   DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = addressClient.deleteAddressCallable().futureCall(request);
    *   // Do something
@@ -516,22 +490,12 @@ public final UnaryCallable getAddressCallable()
    *
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = addressClient.insertAddress(requestId, region, addressResource);
+   *   Operation response = addressClient.insertAddress(region, addressResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for @@ -539,12 +503,10 @@ public final UnaryCallable getAddressCallable() * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAddress( - String requestId, ProjectRegionName region, Address addressResource) { + public final Operation insertAddress(ProjectRegionName region, Address addressResource) { InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setAddressResource(addressResource) .build(); @@ -559,22 +521,12 @@ public final Operation insertAddress( * *


    * try (AddressClient addressClient = AddressClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = addressClient.insertAddress(requestId, region.toString(), addressResource);
+   *   Operation response = addressClient.insertAddress(region.toString(), addressResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for @@ -582,11 +534,10 @@ public final Operation insertAddress( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAddress(String requestId, String region, Address addressResource) { + public final Operation insertAddress(String region, Address addressResource) { InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setAddressResource(addressResource) .build(); @@ -601,11 +552,9 @@ public final Operation insertAddress(String requestId, String region, Address ad * *


    * try (AddressClient addressClient = AddressClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAddressResource(addressResource)
    *     .build();
@@ -629,11 +578,9 @@ public final Operation insertAddress(InsertAddressHttpRequest request) {
    *
    * 

    * try (AddressClient addressClient = AddressClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAddressResource(addressResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
index 936e44245a21..dfad4309cbbe 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private AddressList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Address item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java
index e98751340740..b8aa0161070a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private AddressesScopedList(List
addresses, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("addresses") && addresses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Address item : addresses) { - stringList.add(item.toString()); - } - fieldMap.put("addresses", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("addresses")) { - return String.valueOf(addresses); + return addresses; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List
getAddressesList() { return addresses; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java index 12b9d6c85154..e2478c51f2dc 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListAcceleratorTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java index 83487619deab..88436c282b6b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListAddressesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java index 9abfaa836482..71a24f28b3a4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListAutoscalersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java index eb79e6cb84f6..69a8227af819 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListBackendServicesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java index a75b2af098ee..89e876b8abb4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListDiskTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java index 233312cc74e5..c9f8029f34e8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListDisksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java index b660e858c440..72cea01f104d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListForwardingRulesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java index bf09eaf8d2ed..fb2284b7dbee 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListGlobalOperationsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java index 856200d39650..076e196cfb8f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInstanceGroupManagersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java index 646396f2bb92..211639cfbe7c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInstanceGroupsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java index 423c1ce14128..e281da33a595 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java index 76e22de8c8ad..286d3e0d2f94 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListInterconnectAttachmentsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java index 048534c3d74a..9c22653c070e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListMachineTypesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java index bf7348b89619..f6e9e5484105 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListRegionCommitmentsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java index 8cf47d8bf4c2..619e7fe65aaa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListRoutersHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java index a99349acb6ee..8a5bda15a8ef 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListSubnetworksHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java index 6e2c49c6b09f..91c43d6c5927 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListTargetInstancesHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java index be52b0d6b37d..3c548928adeb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListTargetPoolsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java index 67e1c0a94a9f..164b5b92c225 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListTargetVpnGatewaysHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java index f3706a16d0ea..2cac8c858695 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -85,84 +81,42 @@ private AggregatedListVpnTunnelsHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("filter") && filter != null) { - fieldMap.put("filter", Collections.singletonList(String.valueOf(filter))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("maxResults") && maxResults != null) { - fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults))); - } - if (fieldNames.contains("orderBy") && orderBy != null) { - fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy))); - } - if (fieldNames.contains("pageToken") && pageToken != null) { - fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("project") && project != null) { - fieldMap.put("project", Collections.singletonList(String.valueOf(project))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("filter")) { - return String.valueOf(filter); + return filter; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("maxResults")) { - return String.valueOf(maxResults); + return maxResults; } if (fieldName.equals("orderBy")) { - return String.valueOf(orderBy); + return orderBy; } if (fieldName.equals("pageToken")) { - return String.valueOf(pageToken); + return pageToken; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("project")) { - return String.valueOf(project); + return project; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java index cc3041ce98f3..c4d1d59b1043 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,25 +39,12 @@ private AliasIpRange(String ipCidrRange, String subnetworkRangeName) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) { - fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange))); - } - if (fieldNames.contains("subnetworkRangeName") && subnetworkRangeName != null) { - fieldMap.put( - "subnetworkRangeName", Collections.singletonList(String.valueOf(subnetworkRangeName))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("ipCidrRange")) { - return String.valueOf(ipCidrRange); + return ipCidrRange; } if (fieldName.equals("subnetworkRangeName")) { - return String.valueOf(subnetworkRangeName); + return subnetworkRangeName; } return null; } @@ -72,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIpCidrRange() { return ipCidrRange; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java index b51dc3456385..ed17969066a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private Allowed(String iPProtocol, List ports) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("iPProtocol") && iPProtocol != null) { - fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol))); - } - if (fieldNames.contains("ports") && ports != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : ports) { - stringList.add(item.toString()); - } - fieldMap.put("ports", stringList.build()); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("iPProtocol")) { - return String.valueOf(iPProtocol); + return iPProtocol; } if (fieldName.equals("ports")) { - return String.valueOf(ports); + return ports; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getIPProtocol() { return iPProtocol; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index 7b626dce9f4b..f6586f9fe210 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -81,79 +77,39 @@ private AttachDiskInstanceHttpRequest( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("access_token") && access_token != null) { - fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token))); - } - if (fieldNames.contains("attachedDiskResource") && attachedDiskResource != null) { - fieldMap.put( - "attachedDiskResource", Collections.singletonList(String.valueOf(attachedDiskResource))); - } - if (fieldNames.contains("callback") && callback != null) { - fieldMap.put("callback", Collections.singletonList(String.valueOf(callback))); - } - if (fieldNames.contains("fields") && fields != null) { - fieldMap.put("fields", Collections.singletonList(String.valueOf(fields))); - } - if (fieldNames.contains("forceAttach") && forceAttach != null) { - fieldMap.put("forceAttach", Collections.singletonList(String.valueOf(forceAttach))); - } - if (fieldNames.contains("instance") && instance != null) { - fieldMap.put("instance", Collections.singletonList(String.valueOf(instance))); - } - if (fieldNames.contains("key") && key != null) { - fieldMap.put("key", Collections.singletonList(String.valueOf(key))); - } - if (fieldNames.contains("prettyPrint") && prettyPrint != null) { - fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint))); - } - if (fieldNames.contains("quotaUser") && quotaUser != null) { - fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser))); - } - if (fieldNames.contains("requestId") && requestId != null) { - fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId))); - } - if (fieldNames.contains("userIp") && userIp != null) { - fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("access_token")) { - return String.valueOf(access_token); + return access_token; } if (fieldName.equals("attachedDiskResource")) { - return String.valueOf(attachedDiskResource); + return attachedDiskResource; } if (fieldName.equals("callback")) { - return String.valueOf(callback); + return callback; } if (fieldName.equals("fields")) { - return String.valueOf(fields); + return fields; } if (fieldName.equals("forceAttach")) { - return String.valueOf(forceAttach); + return forceAttach; } if (fieldName.equals("instance")) { - return String.valueOf(instance); + return instance; } if (fieldName.equals("key")) { - return String.valueOf(key); + return key; } if (fieldName.equals("prettyPrint")) { - return String.valueOf(prettyPrint); + return prettyPrint; } if (fieldName.equals("quotaUser")) { - return String.valueOf(quotaUser); + return quotaUser; } if (fieldName.equals("requestId")) { - return String.valueOf(requestId); + return requestId; } if (fieldName.equals("userIp")) { - return String.valueOf(userIp); + return userIp; } return null; } @@ -164,6 +120,12 @@ public AttachedDisk getApiMessageRequestBody() { return attachedDiskResource; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getAccessToken() { return access_token; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java index 9039024f2ef4..13bc11b8ef17 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,99 +86,45 @@ private AttachedDisk( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoDelete") && autoDelete != null) { - fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete))); - } - if (fieldNames.contains("boot") && boot != null) { - fieldMap.put("boot", Collections.singletonList(String.valueOf(boot))); - } - if (fieldNames.contains("deviceName") && deviceName != null) { - fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName))); - } - if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) { - fieldMap.put( - "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey))); - } - if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (GuestOsFeature item : guestOsFeatures) { - stringList.add(item.toString()); - } - fieldMap.put("guestOsFeatures", stringList.build()); - } - if (fieldNames.contains("index") && index != null) { - fieldMap.put("index", Collections.singletonList(String.valueOf(index))); - } - if (fieldNames.contains("initializeParams") && initializeParams != null) { - fieldMap.put("initializeParams", Collections.singletonList(String.valueOf(initializeParams))); - } - if (fieldNames.contains("interface2") && interface2 != null) { - fieldMap.put("interface2", Collections.singletonList(String.valueOf(interface2))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("licenses") && licenses != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (String item : licenses) { - stringList.add(item.toString()); - } - fieldMap.put("licenses", stringList.build()); - } - if (fieldNames.contains("mode") && mode != null) { - fieldMap.put("mode", Collections.singletonList(String.valueOf(mode))); - } - if (fieldNames.contains("source") && source != null) { - fieldMap.put("source", Collections.singletonList(String.valueOf(source))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoDelete")) { - return String.valueOf(autoDelete); + return autoDelete; } if (fieldName.equals("boot")) { - return String.valueOf(boot); + return boot; } if (fieldName.equals("deviceName")) { - return String.valueOf(deviceName); + return deviceName; } if (fieldName.equals("diskEncryptionKey")) { - return String.valueOf(diskEncryptionKey); + return diskEncryptionKey; } if (fieldName.equals("guestOsFeatures")) { - return String.valueOf(guestOsFeatures); + return guestOsFeatures; } if (fieldName.equals("index")) { - return String.valueOf(index); + return index; } if (fieldName.equals("initializeParams")) { - return String.valueOf(initializeParams); + return initializeParams; } if (fieldName.equals("interface2")) { - return String.valueOf(interface2); + return interface2; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("licenses")) { - return String.valueOf(licenses); + return licenses; } if (fieldName.equals("mode")) { - return String.valueOf(mode); + return mode; } if (fieldName.equals("source")) { - return String.valueOf(source); + return source; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -194,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Boolean getAutoDelete() { return autoDelete; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java index ebc8f214e56b..ca7015f26d13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,50 +58,24 @@ private AttachedDiskInitializeParams( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("diskName") && diskName != null) { - fieldMap.put("diskName", Collections.singletonList(String.valueOf(diskName))); - } - if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) { - fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb))); - } - if (fieldNames.contains("diskType") && diskType != null) { - fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType))); - } - if (fieldNames.contains("labels") && labels != null) { - fieldMap.put("labels", Collections.singletonList(String.valueOf(labels))); - } - if (fieldNames.contains("sourceImage") && sourceImage != null) { - fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage))); - } - if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) { - fieldMap.put( - "sourceImageEncryptionKey", - Collections.singletonList(String.valueOf(sourceImageEncryptionKey))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("diskName")) { - return String.valueOf(diskName); + return diskName; } if (fieldName.equals("diskSizeGb")) { - return String.valueOf(diskSizeGb); + return diskSizeGb; } if (fieldName.equals("diskType")) { - return String.valueOf(diskType); + return diskType; } if (fieldName.equals("labels")) { - return String.valueOf(labels); + return labels; } if (fieldName.equals("sourceImage")) { - return String.valueOf(sourceImage); + return sourceImage; } if (fieldName.equals("sourceImageEncryptionKey")) { - return String.valueOf(sourceImageEncryptionKey); + return sourceImageEncryptionKey; } return null; } @@ -115,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getDiskName() { return diskName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java index 0c6b2d8ed12e..4b73600d6412 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -87,90 +82,42 @@ private Autoscaler( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoscalingPolicy") && autoscalingPolicy != null) { - fieldMap.put( - "autoscalingPolicy", Collections.singletonList(String.valueOf(autoscalingPolicy))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("status") && status != null) { - fieldMap.put("status", Collections.singletonList(String.valueOf(status))); - } - if (fieldNames.contains("statusDetails") && statusDetails != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AutoscalerStatusDetails item : statusDetails) { - stringList.add(item.toString()); - } - fieldMap.put("statusDetails", stringList.build()); - } - if (fieldNames.contains("target") && target != null) { - fieldMap.put("target", Collections.singletonList(String.valueOf(target))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoscalingPolicy")) { - return String.valueOf(autoscalingPolicy); + return autoscalingPolicy; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("status")) { - return String.valueOf(status); + return status; } if (fieldName.equals("statusDetails")) { - return String.valueOf(statusDetails); + return statusDetails; } if (fieldName.equals("target")) { - return String.valueOf(target); + return target; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -181,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public AutoscalingPolicy getAutoscalingPolicy() { return autoscalingPolicy; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java index af7e74834ac5..3e0ac9f3b606 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private AutoscalerAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java index dfa52bbbff27..6b15fc7cf416 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java @@ -43,8 +43,7 @@ * * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - * String requestId = ""; - * Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId); + * Operation response = autoscalerClient.deleteAutoscaler(autoscaler); * } * *
@@ -300,30 +299,19 @@ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers( *

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
-   *   String requestId = "";
-   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId);
+   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler);
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler, String requestId) { + public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler) { DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) - .setRequestId(requestId) .build(); return deleteAutoscaler(request); } @@ -337,31 +325,18 @@ public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler, St *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
-   *   String requestId = "";
-   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString(), requestId);
+   *   Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString());
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteAutoscaler(String autoscaler, String requestId) { + public final Operation deleteAutoscaler(String autoscaler) { DeleteAutoscalerHttpRequest request = - DeleteAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .build(); + DeleteAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build(); return deleteAutoscaler(request); } @@ -374,10 +349,8 @@ public final Operation deleteAutoscaler(String autoscaler, String requestId) { *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
-   *   String requestId = "";
    *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = autoscalerClient.deleteAutoscaler(request);
    * }
@@ -400,10 +373,8 @@ public final Operation deleteAutoscaler(DeleteAutoscalerHttpRequest request) {
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
-   *   String requestId = "";
    *   DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = autoscalerClient.deleteAutoscalerCallable().futureCall(request);
    *   // Do something
@@ -526,22 +497,12 @@ public final UnaryCallable getAutoscalerCa
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.insertAutoscaler(zone, requestId, autoscalerResource);
+   *   Operation response = autoscalerClient.insertAutoscaler(zone, autoscalerResource);
    * }
    * 
* * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an * autoscaling policy that you define. For more information, read Autoscaling Groups of @@ -550,13 +511,11 @@ public final UnaryCallable getAutoscalerCa * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAutoscaler( - ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { + public final Operation insertAutoscaler(ProjectZoneName zone, Autoscaler autoscalerResource) { InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return insertAutoscaler(request); @@ -571,22 +530,12 @@ public final Operation insertAutoscaler( *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.insertAutoscaler(zone.toString(), requestId, autoscalerResource);
+   *   Operation response = autoscalerClient.insertAutoscaler(zone.toString(), autoscalerResource);
    * }
    * 
* * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an * autoscaling policy that you define. For more information, read Autoscaling Groups of @@ -595,13 +544,11 @@ public final Operation insertAutoscaler( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertAutoscaler( - String zone, String requestId, Autoscaler autoscalerResource) { + public final Operation insertAutoscaler(String zone, Autoscaler autoscalerResource) { InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder() .setZone(zone) - .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return insertAutoscaler(request); @@ -616,11 +563,9 @@ public final Operation insertAutoscaler( *


    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
    *   Operation response = autoscalerClient.insertAutoscaler(request);
@@ -644,11 +589,9 @@ public final Operation insertAutoscaler(InsertAutoscalerHttpRequest request) {
    * 

    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
    *   ApiFuture<Operation> future = autoscalerClient.insertAutoscalerCallable().futureCall(request);
@@ -809,23 +752,13 @@ public final UnaryCallable listAutos
    * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
    *   String autoscaler = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource);
+   *   Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to patch. * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an * autoscaling policy that you define. For more information, read Autoscaling Groups of @@ -835,13 +768,12 @@ public final UnaryCallable listAutos */ @BetaApi public final Operation patchAutoscaler( - String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { + String autoscaler, ProjectZoneName zone, Autoscaler autoscalerResource) { PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return patchAutoscaler(request); @@ -858,23 +790,13 @@ public final Operation patchAutoscaler( * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - * Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), requestId, autoscalerResource); + * Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), autoscalerResource); * } *

* * @param autoscaler Name of the autoscaler to patch. * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an * autoscaling policy that you define. For more information, read Autoscaling Groups of @@ -884,13 +806,12 @@ public final Operation patchAutoscaler( */ @BetaApi public final Operation patchAutoscaler( - String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { + String autoscaler, String zone, Autoscaler autoscalerResource) { PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone) - .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return patchAutoscaler(request); @@ -907,12 +828,10 @@ public final Operation patchAutoscaler( * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); * PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() * .setAutoscaler(autoscaler) * .setZone(zone.toString()) - * .setRequestId(requestId) * .setAutoscalerResource(autoscalerResource) * .build(); * Operation response = autoscalerClient.patchAutoscaler(request); @@ -938,12 +857,10 @@ public final Operation patchAutoscaler(PatchAutoscalerHttpRequest request) { * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); * PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder() * .setAutoscaler(autoscaler) * .setZone(zone.toString()) - * .setRequestId(requestId) * .setAutoscalerResource(autoscalerResource) * .build(); * ApiFuture<Operation> future = autoscalerClient.patchAutoscalerCallable().futureCall(request); @@ -967,23 +884,13 @@ public final UnaryCallable patchAutoscale * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource); + * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, autoscalerResource); * } *

* * @param autoscaler Name of the autoscaler to update. * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an * autoscaling policy that you define. For more information, read Autoscaling Groups of @@ -993,13 +900,12 @@ public final UnaryCallable patchAutoscale */ @BetaApi public final Operation updateAutoscaler( - String autoscaler, ProjectZoneName zone, String requestId, Autoscaler autoscalerResource) { + String autoscaler, ProjectZoneName zone, Autoscaler autoscalerResource) { UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return updateAutoscaler(request); @@ -1015,23 +921,13 @@ public final Operation updateAutoscaler( * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), requestId, autoscalerResource); + * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), autoscalerResource); * } *

* * @param autoscaler Name of the autoscaler to update. * @param zone Name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an * autoscaling policy that you define. For more information, read Autoscaling Groups of @@ -1041,13 +937,12 @@ public final Operation updateAutoscaler( */ @BetaApi public final Operation updateAutoscaler( - String autoscaler, String zone, String requestId, Autoscaler autoscalerResource) { + String autoscaler, String zone, Autoscaler autoscalerResource) { UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) .setZone(zone) - .setRequestId(requestId) .setAutoscalerResource(autoscalerResource) .build(); return updateAutoscaler(request); @@ -1063,12 +958,10 @@ public final Operation updateAutoscaler( * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); * UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() * .setAutoscaler(autoscaler) * .setZone(zone.toString()) - * .setRequestId(requestId) * .setAutoscalerResource(autoscalerResource) * .build(); * Operation response = autoscalerClient.updateAutoscaler(request); @@ -1093,12 +986,10 @@ public final Operation updateAutoscaler(UpdateAutoscalerHttpRequest request) { * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * String autoscaler = ""; * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - * String requestId = ""; * Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); * UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder() * .setAutoscaler(autoscaler) * .setZone(zone.toString()) - * .setRequestId(requestId) * .setAutoscalerResource(autoscalerResource) * .build(); * ApiFuture<Operation> future = autoscalerClient.updateAutoscalerCallable().futureCall(request); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java index c2f9aafcc324..ebf938b369cb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,52 +58,24 @@ private AutoscalerList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Autoscaler item : items) { - stringList.add(item.toString()); - } - fieldMap.put("items", stringList.build()); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java index 846838c8c2a1..23faa574e2d4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -43,24 +39,12 @@ private AutoscalerStatusDetails(String message, String type) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("message") && message != null) { - fieldMap.put("message", Collections.singletonList(String.valueOf(message))); - } - if (fieldNames.contains("type") && type != null) { - fieldMap.put("type", Collections.singletonList(String.valueOf(type))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("message")) { - return String.valueOf(message); + return message; } if (fieldName.equals("type")) { - return String.valueOf(type); + return type; } return null; } @@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getMessage() { return message; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java index 33fd70094e0c..c8a2cc70631a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -45,28 +40,12 @@ private AutoscalersScopedList(List autoscalers, Warning warning) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("autoscalers") && autoscalers != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (Autoscaler item : autoscalers) { - stringList.add(item.toString()); - } - fieldMap.put("autoscalers", stringList.build()); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("autoscalers")) { - return String.valueOf(autoscalers); + return autoscalers; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public List getAutoscalersList() { return autoscalers; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java index e229455b299f..9a8c18371125 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -63,55 +58,24 @@ private AutoscalingPolicy( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("coolDownPeriodSec") && coolDownPeriodSec != null) { - fieldMap.put( - "coolDownPeriodSec", Collections.singletonList(String.valueOf(coolDownPeriodSec))); - } - if (fieldNames.contains("cpuUtilization") && cpuUtilization != null) { - fieldMap.put("cpuUtilization", Collections.singletonList(String.valueOf(cpuUtilization))); - } - if (fieldNames.contains("customMetricUtilizations") && customMetricUtilizations != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (AutoscalingPolicyCustomMetricUtilization item : customMetricUtilizations) { - stringList.add(item.toString()); - } - fieldMap.put("customMetricUtilizations", stringList.build()); - } - if (fieldNames.contains("loadBalancingUtilization") && loadBalancingUtilization != null) { - fieldMap.put( - "loadBalancingUtilization", - Collections.singletonList(String.valueOf(loadBalancingUtilization))); - } - if (fieldNames.contains("maxNumReplicas") && maxNumReplicas != null) { - fieldMap.put("maxNumReplicas", Collections.singletonList(String.valueOf(maxNumReplicas))); - } - if (fieldNames.contains("minNumReplicas") && minNumReplicas != null) { - fieldMap.put("minNumReplicas", Collections.singletonList(String.valueOf(minNumReplicas))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("coolDownPeriodSec")) { - return String.valueOf(coolDownPeriodSec); + return coolDownPeriodSec; } if (fieldName.equals("cpuUtilization")) { - return String.valueOf(cpuUtilization); + return cpuUtilization; } if (fieldName.equals("customMetricUtilizations")) { - return String.valueOf(customMetricUtilizations); + return customMetricUtilizations; } if (fieldName.equals("loadBalancingUtilization")) { - return String.valueOf(loadBalancingUtilization); + return loadBalancingUtilization; } if (fieldName.equals("maxNumReplicas")) { - return String.valueOf(maxNumReplicas); + return maxNumReplicas; } if (fieldName.equals("minNumReplicas")) { - return String.valueOf(minNumReplicas); + return minNumReplicas; } return null; } @@ -122,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public Integer getCoolDownPeriodSec() { return coolDownPeriodSec; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java index 4ff32c3a8ad6..5d195b49d90e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,26 +36,22 @@ private AutoscalingPolicyCpuUtilization(Double utilizationTarget) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put( - "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return utilizationTarget; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("utilizationTarget")) { - return String.valueOf(utilizationTarget); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java index c72326ca0f8c..2098a3495b66 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -47,33 +43,15 @@ private AutoscalingPolicyCustomMetricUtilization( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("metric") && metric != null) { - fieldMap.put("metric", Collections.singletonList(String.valueOf(metric))); - } - if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put( - "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); - } - if (fieldNames.contains("utilizationTargetType") && utilizationTargetType != null) { - fieldMap.put( - "utilizationTargetType", - Collections.singletonList(String.valueOf(utilizationTargetType))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("metric")) { - return String.valueOf(metric); + return metric; } if (fieldName.equals("utilizationTarget")) { - return String.valueOf(utilizationTarget); + return utilizationTarget; } if (fieldName.equals("utilizationTargetType")) { - return String.valueOf(utilizationTargetType); + return utilizationTargetType; } return null; } @@ -84,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getMetric() { return metric; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java index ecdd43a850a3..e7b3fa592d42 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -40,26 +36,22 @@ private AutoscalingPolicyLoadBalancingUtilization(Double utilizationTarget) { } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("utilizationTarget") && utilizationTarget != null) { - fieldMap.put( - "utilizationTarget", Collections.singletonList(String.valueOf(utilizationTarget))); + public Object getFieldValue(String fieldName) { + if (fieldName.equals("utilizationTarget")) { + return utilizationTarget; } - return fieldMap; + return null; } + @Nullable @Override - public String getFieldStringValue(String fieldName) { - if (fieldName.equals("utilizationTarget")) { - return String.valueOf(utilizationTarget); - } + public ApiMessage getApiMessageRequestBody() { return null; } @Nullable @Override - public ApiMessage getApiMessageRequestBody() { + public List getFieldMask() { return null; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java index 47c88237a96f..07e1da2dc268 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -73,69 +69,33 @@ private Backend( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("balancingMode") && balancingMode != null) { - fieldMap.put("balancingMode", Collections.singletonList(String.valueOf(balancingMode))); - } - if (fieldNames.contains("capacityScaler") && capacityScaler != null) { - fieldMap.put("capacityScaler", Collections.singletonList(String.valueOf(capacityScaler))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("group") && group != null) { - fieldMap.put("group", Collections.singletonList(String.valueOf(group))); - } - if (fieldNames.contains("maxConnections") && maxConnections != null) { - fieldMap.put("maxConnections", Collections.singletonList(String.valueOf(maxConnections))); - } - if (fieldNames.contains("maxConnectionsPerInstance") && maxConnectionsPerInstance != null) { - fieldMap.put( - "maxConnectionsPerInstance", - Collections.singletonList(String.valueOf(maxConnectionsPerInstance))); - } - if (fieldNames.contains("maxRate") && maxRate != null) { - fieldMap.put("maxRate", Collections.singletonList(String.valueOf(maxRate))); - } - if (fieldNames.contains("maxRatePerInstance") && maxRatePerInstance != null) { - fieldMap.put( - "maxRatePerInstance", Collections.singletonList(String.valueOf(maxRatePerInstance))); - } - if (fieldNames.contains("maxUtilization") && maxUtilization != null) { - fieldMap.put("maxUtilization", Collections.singletonList(String.valueOf(maxUtilization))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("balancingMode")) { - return String.valueOf(balancingMode); + return balancingMode; } if (fieldName.equals("capacityScaler")) { - return String.valueOf(capacityScaler); + return capacityScaler; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("group")) { - return String.valueOf(group); + return group; } if (fieldName.equals("maxConnections")) { - return String.valueOf(maxConnections); + return maxConnections; } if (fieldName.equals("maxConnectionsPerInstance")) { - return String.valueOf(maxConnectionsPerInstance); + return maxConnectionsPerInstance; } if (fieldName.equals("maxRate")) { - return String.valueOf(maxRate); + return maxRate; } if (fieldName.equals("maxRatePerInstance")) { - return String.valueOf(maxRatePerInstance); + return maxRatePerInstance; } if (fieldName.equals("maxUtilization")) { - return String.valueOf(maxUtilization); + return maxUtilization; } return null; } @@ -146,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBalancingMode() { return balancingMode; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java index 96bf4e7e748e..31d2b09925c8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java @@ -17,12 +17,8 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -69,61 +65,30 @@ private BackendBucket( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("bucketName") && bucketName != null) { - fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName))); - } - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("enableCdn") && enableCdn != null) { - fieldMap.put("enableCdn", Collections.singletonList(String.valueOf(enableCdn))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("bucketName")) { - return String.valueOf(bucketName); + return bucketName; } if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("enableCdn")) { - return String.valueOf(enableCdn); + return enableCdn; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } return null; } @@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getBucketName() { return bucketName; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java index 70fe22010ccd..2704697a98bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java @@ -43,8 +43,7 @@ * * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) { * ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - * String requestId = ""; - * Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId); + * Operation response = backendBucketClient.deleteBackendBucket(backendBucket); * } * *

@@ -162,31 +161,19 @@ public BackendBucketStub getStub() { *

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
-   *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId);
+   *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendBucket( - ProjectGlobalBackendBucketName backendBucket, String requestId) { + public final Operation deleteBackendBucket(ProjectGlobalBackendBucketName backendBucket) { DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder() .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .setRequestId(requestId) .build(); return deleteBackendBucket(request); } @@ -200,31 +187,18 @@ public final Operation deleteBackendBucket( *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
-   *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket.toString(), requestId);
+   *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket.toString());
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendBucket(String backendBucket, String requestId) { + public final Operation deleteBackendBucket(String backendBucket) { DeleteBackendBucketHttpRequest request = - DeleteBackendBucketHttpRequest.newBuilder() - .setBackendBucket(backendBucket) - .setRequestId(requestId) - .build(); + DeleteBackendBucketHttpRequest.newBuilder().setBackendBucket(backendBucket).build(); return deleteBackendBucket(request); } @@ -237,10 +211,8 @@ public final Operation deleteBackendBucket(String backendBucket, String requestI *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = backendBucketClient.deleteBackendBucket(request);
    * }
@@ -263,10 +235,8 @@ public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest reques
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = backendBucketClient.deleteBackendBucketCallable().futureCall(request);
    *   // Do something
@@ -391,22 +361,12 @@ public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request)
    *
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
-   *   Operation response = backendBucketClient.insertBackendBucket(requestId, project, backendBucketResource);
+   *   Operation response = backendBucketClient.insertBackendBucket(project, backendBucketResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage * bucket. @@ -414,11 +374,10 @@ public final BackendBucket getBackendBucket(GetBackendBucketHttpRequest request) */ @BetaApi public final Operation insertBackendBucket( - String requestId, ProjectName project, BackendBucket backendBucketResource) { + ProjectName project, BackendBucket backendBucketResource) { InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setBackendBucketResource(backendBucketResource) .build(); @@ -434,34 +393,22 @@ public final Operation insertBackendBucket( * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
-   *   Operation response = backendBucketClient.insertBackendBucket(requestId, project.toString(), backendBucketResource);
+   *   Operation response = backendBucketClient.insertBackendBucket(project.toString(), backendBucketResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertBackendBucket( - String requestId, String project, BackendBucket backendBucketResource) { + public final Operation insertBackendBucket(String project, BackendBucket backendBucketResource) { InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setBackendBucketResource(backendBucketResource) .build(); @@ -477,11 +424,9 @@ public final Operation insertBackendBucket( * *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setBackendBucketResource(backendBucketResource)
    *     .build();
@@ -506,11 +451,9 @@ public final Operation insertBackendBucket(InsertBackendBucketHttpRequest reques
    *
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   InsertBackendBucketHttpRequest request = InsertBackendBucketHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setBackendBucketResource(backendBucketResource)
    *     .build();
@@ -674,36 +617,23 @@ public final ListBackendBucketsPagedResponse listBackendBuckets(
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
-   *   Operation response = backendBucketClient.patchBackendBucket(backendBucket, requestId, backendBucketResource);
+   *   Operation response = backendBucketClient.patchBackendBucket(backendBucket, backendBucketResource);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation patchBackendBucket( - ProjectGlobalBackendBucketName backendBucket, - String requestId, - BackendBucket backendBucketResource) { + ProjectGlobalBackendBucketName backendBucket, BackendBucket backendBucketResource) { PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder() .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .setRequestId(requestId) .setBackendBucketResource(backendBucketResource) .build(); return patchBackendBucket(request); @@ -719,34 +649,23 @@ public final Operation patchBackendBucket( *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
-   *   Operation response = backendBucketClient.patchBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
+   *   Operation response = backendBucketClient.patchBackendBucket(backendBucket.toString(), backendBucketResource);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation patchBackendBucket( - String backendBucket, String requestId, BackendBucket backendBucketResource) { + String backendBucket, BackendBucket backendBucketResource) { PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder() .setBackendBucket(backendBucket) - .setRequestId(requestId) .setBackendBucketResource(backendBucketResource) .build(); return patchBackendBucket(request); @@ -762,11 +681,9 @@ public final Operation patchBackendBucket( *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
-   *     .setRequestId(requestId)
    *     .setBackendBucketResource(backendBucketResource)
    *     .build();
    *   Operation response = backendBucketClient.patchBackendBucket(request);
@@ -791,11 +708,9 @@ public final Operation patchBackendBucket(PatchBackendBucketHttpRequest request)
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   PatchBackendBucketHttpRequest request = PatchBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
-   *     .setRequestId(requestId)
    *     .setBackendBucketResource(backendBucketResource)
    *     .build();
    *   ApiFuture<Operation> future = backendBucketClient.patchBackendBucketCallable().futureCall(request);
@@ -819,36 +734,23 @@ public final Operation patchBackendBucket(PatchBackendBucketHttpRequest request)
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
-   *   Operation response = backendBucketClient.updateBackendBucket(backendBucket, requestId, backendBucketResource);
+   *   Operation response = backendBucketClient.updateBackendBucket(backendBucket, backendBucketResource);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation updateBackendBucket( - ProjectGlobalBackendBucketName backendBucket, - String requestId, - BackendBucket backendBucketResource) { + ProjectGlobalBackendBucketName backendBucket, BackendBucket backendBucketResource) { UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder() .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) - .setRequestId(requestId) .setBackendBucketResource(backendBucketResource) .build(); return updateBackendBucket(request); @@ -863,34 +765,23 @@ public final Operation updateBackendBucket( *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
-   *   Operation response = backendBucketClient.updateBackendBucket(backendBucket.toString(), requestId, backendBucketResource);
+   *   Operation response = backendBucketClient.updateBackendBucket(backendBucket.toString(), backendBucketResource);
    * }
    * 
* * @param backendBucket Name of the BackendBucket resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendBucketResource A BackendBucket resource. This resource defines a Cloud Storage * bucket. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation updateBackendBucket( - String backendBucket, String requestId, BackendBucket backendBucketResource) { + String backendBucket, BackendBucket backendBucketResource) { UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder() .setBackendBucket(backendBucket) - .setRequestId(requestId) .setBackendBucketResource(backendBucketResource) .build(); return updateBackendBucket(request); @@ -905,11 +796,9 @@ public final Operation updateBackendBucket( *


    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
-   *     .setRequestId(requestId)
    *     .setBackendBucketResource(backendBucketResource)
    *     .build();
    *   Operation response = backendBucketClient.updateBackendBucket(request);
@@ -933,11 +822,9 @@ public final Operation updateBackendBucket(UpdateBackendBucketHttpRequest reques
    * 

    * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
    *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
-   *   String requestId = "";
    *   BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
    *   UpdateBackendBucketHttpRequest request = UpdateBackendBucketHttpRequest.newBuilder()
    *     .setBackendBucket(backendBucket.toString())
-   *     .setRequestId(requestId)
    *     .setBackendBucketResource(backendBucketResource)
    *     .build();
    *   ApiFuture<Operation> future = backendBucketClient.updateBackendBucketCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java
index 603ca247d2ec..c291cf9ca2cb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private BackendBucketList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (BackendBucket item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java
index 20ad95f049f4..7b0d8a5b5971 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -123,150 +118,69 @@ private BackendService(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("affinityCookieTtlSec") && affinityCookieTtlSec != null) {
-      fieldMap.put(
-          "affinityCookieTtlSec", Collections.singletonList(String.valueOf(affinityCookieTtlSec)));
-    }
-    if (fieldNames.contains("backends") && backends != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Backend item : backends) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("backends", stringList.build());
-    }
-    if (fieldNames.contains("cdnPolicy") && cdnPolicy != null) {
-      fieldMap.put("cdnPolicy", Collections.singletonList(String.valueOf(cdnPolicy)));
-    }
-    if (fieldNames.contains("connectionDraining") && connectionDraining != null) {
-      fieldMap.put(
-          "connectionDraining", Collections.singletonList(String.valueOf(connectionDraining)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("enableCDN") && enableCDN != null) {
-      fieldMap.put("enableCDN", Collections.singletonList(String.valueOf(enableCDN)));
-    }
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("healthChecks") && healthChecks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : healthChecks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("healthChecks", stringList.build());
-    }
-    if (fieldNames.contains("iap") && iap != null) {
-      fieldMap.put("iap", Collections.singletonList(String.valueOf(iap)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) {
-      fieldMap.put(
-          "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("portName") && portName != null) {
-      fieldMap.put("portName", Collections.singletonList(String.valueOf(portName)));
-    }
-    if (fieldNames.contains("protocol") && protocol != null) {
-      fieldMap.put("protocol", Collections.singletonList(String.valueOf(protocol)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) {
-      fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity)));
-    }
-    if (fieldNames.contains("timeoutSec") && timeoutSec != null) {
-      fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("affinityCookieTtlSec")) {
-      return String.valueOf(affinityCookieTtlSec);
+      return affinityCookieTtlSec;
     }
     if (fieldName.equals("backends")) {
-      return String.valueOf(backends);
+      return backends;
     }
     if (fieldName.equals("cdnPolicy")) {
-      return String.valueOf(cdnPolicy);
+      return cdnPolicy;
     }
     if (fieldName.equals("connectionDraining")) {
-      return String.valueOf(connectionDraining);
+      return connectionDraining;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("enableCDN")) {
-      return String.valueOf(enableCDN);
+      return enableCDN;
     }
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("healthChecks")) {
-      return String.valueOf(healthChecks);
+      return healthChecks;
     }
     if (fieldName.equals("iap")) {
-      return String.valueOf(iap);
+      return iap;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("loadBalancingScheme")) {
-      return String.valueOf(loadBalancingScheme);
+      return loadBalancingScheme;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("portName")) {
-      return String.valueOf(portName);
+      return portName;
     }
     if (fieldName.equals("protocol")) {
-      return String.valueOf(protocol);
+      return protocol;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sessionAffinity")) {
-      return String.valueOf(sessionAffinity);
+      return sessionAffinity;
     }
     if (fieldName.equals("timeoutSec")) {
-      return String.valueOf(timeoutSec);
+      return timeoutSec;
     }
     return null;
   }
@@ -277,6 +191,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getAffinityCookieTtlSec() {
     return affinityCookieTtlSec;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java
index 213fd39884fc..85b75e24ef98 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private BackendServiceAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java
index e00f03c76397..b9892872ad1d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private BackendServiceCdnPolicy(CacheKeyPolicy cacheKeyPolicy) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("cacheKeyPolicy") && cacheKeyPolicy != null) {
-      fieldMap.put("cacheKeyPolicy", Collections.singletonList(String.valueOf(cacheKeyPolicy)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("cacheKeyPolicy")) {
+      return cacheKeyPolicy;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("cacheKeyPolicy")) {
-      return String.valueOf(cacheKeyPolicy);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
index 10d8cf8b1548..99d520e89b3d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
- *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
+ *   Operation response = backendServiceClient.deleteBackendService(backendService);
  * }
  * 
  * 
@@ -307,31 +306,19 @@ public final AggregatedListBackendServicesPagedResponse aggregatedListBackendSer * *

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
-   *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
+   *   Operation response = backendServiceClient.deleteBackendService(backendService);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendService( - String requestId, ProjectGlobalBackendServiceName backendService) { + public final Operation deleteBackendService(ProjectGlobalBackendServiceName backendService) { DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .build(); return deleteBackendService(request); @@ -345,32 +332,19 @@ public final Operation deleteBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
-   *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService.toString());
+   *   Operation response = backendServiceClient.deleteBackendService(backendService.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteBackendService(String requestId, String backendService) { + public final Operation deleteBackendService(String backendService) { DeleteBackendServiceHttpRequest request = - DeleteBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) - .setBackendService(backendService) - .build(); + DeleteBackendServiceHttpRequest.newBuilder().setBackendService(backendService).build(); return deleteBackendService(request); } @@ -382,10 +356,8 @@ public final Operation deleteBackendService(String requestId, String backendServ * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   Operation response = backendServiceClient.deleteBackendService(request);
@@ -408,10 +380,8 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   DeleteBackendServiceHttpRequest request = DeleteBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   ApiFuture<Operation> future = backendServiceClient.deleteBackendServiceCallable().futureCall(request);
@@ -654,22 +624,12 @@ public final BackendServiceGroupHealth getHealthBackendService(
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.insertBackendService(requestId, project, backendServiceResource);
+   *   Operation response = backendServiceClient.insertBackendService(project, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -678,11 +638,10 @@ public final BackendServiceGroupHealth getHealthBackendService( */ @BetaApi public final Operation insertBackendService( - String requestId, ProjectName project, BackendService backendServiceResource) { + ProjectName project, BackendService backendServiceResource) { InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -699,22 +658,12 @@ public final Operation insertBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.insertBackendService(requestId, project.toString(), backendServiceResource);
+   *   Operation response = backendServiceClient.insertBackendService(project.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -723,11 +672,10 @@ public final Operation insertBackendService( */ @BetaApi public final Operation insertBackendService( - String requestId, String project, BackendService backendServiceResource) { + String project, BackendService backendServiceResource) { InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setBackendServiceResource(backendServiceResource) .build(); @@ -744,11 +692,9 @@ public final Operation insertBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -774,11 +720,9 @@ public final Operation insertBackendService(InsertBackendServiceHttpRequest requ
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertBackendServiceHttpRequest request = InsertBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -943,22 +887,12 @@ public final ListBackendServicesPagedResponse listBackendServices(
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.patchBackendService(requestId, backendService, backendServiceResource);
+   *   Operation response = backendServiceClient.patchBackendService(backendService, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -967,13 +901,10 @@ public final ListBackendServicesPagedResponse listBackendServices( */ @BetaApi public final Operation patchBackendService( - String requestId, - ProjectGlobalBackendServiceName backendService, - BackendService backendServiceResource) { + ProjectGlobalBackendServiceName backendService, BackendService backendServiceResource) { PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -991,22 +922,12 @@ public final Operation patchBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.patchBackendService(requestId, backendService.toString(), backendServiceResource);
+   *   Operation response = backendServiceClient.patchBackendService(backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -1015,11 +936,10 @@ public final Operation patchBackendService( */ @BetaApi public final Operation patchBackendService( - String requestId, String backendService, BackendService backendServiceResource) { + String backendService, BackendService backendServiceResource) { PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -1037,11 +957,9 @@ public final Operation patchBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -1068,11 +986,9 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchBackendServiceHttpRequest request = PatchBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -1098,22 +1014,12 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.updateBackendService(requestId, backendService, backendServiceResource);
+   *   Operation response = backendServiceClient.updateBackendService(backendService, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -1122,13 +1028,10 @@ public final Operation patchBackendService(PatchBackendServiceHttpRequest reques */ @BetaApi public final Operation updateBackendService( - String requestId, - ProjectGlobalBackendServiceName backendService, - BackendService backendServiceResource) { + ProjectGlobalBackendServiceName backendService, BackendService backendServiceResource) { UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -1145,22 +1048,12 @@ public final Operation updateBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = backendServiceClient.updateBackendService(requestId, backendService.toString(), backendServiceResource);
+   *   Operation response = backendServiceClient.updateBackendService(backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -1169,11 +1062,10 @@ public final Operation updateBackendService( */ @BetaApi public final Operation updateBackendService( - String requestId, String backendService, BackendService backendServiceResource) { + String backendService, BackendService backendServiceResource) { UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -1190,11 +1082,9 @@ public final Operation updateBackendService( * *


    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -1220,11 +1110,9 @@ public final Operation updateBackendService(UpdateBackendServiceHttpRequest requ
    *
    * 

    * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateBackendServiceHttpRequest request = UpdateBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java
index 28ff6b520dff..ef90349b4949 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private BackendServiceGroupHealth(List healthStatus, String kind)
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("healthStatus") && healthStatus != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HealthStatus item : healthStatus) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("healthStatus", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("healthStatus")) {
-      return String.valueOf(healthStatus);
+      return healthStatus;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getHealthStatusList() {
     return healthStatus;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java
index 5dc77ed986f0..7bf7ea7e950b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,39 +49,18 @@ private BackendServiceIAP(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("enabled") && enabled != null) {
-      fieldMap.put("enabled", Collections.singletonList(String.valueOf(enabled)));
-    }
-    if (fieldNames.contains("oauth2ClientId") && oauth2ClientId != null) {
-      fieldMap.put("oauth2ClientId", Collections.singletonList(String.valueOf(oauth2ClientId)));
-    }
-    if (fieldNames.contains("oauth2ClientSecret") && oauth2ClientSecret != null) {
-      fieldMap.put(
-          "oauth2ClientSecret", Collections.singletonList(String.valueOf(oauth2ClientSecret)));
-    }
-    if (fieldNames.contains("oauth2ClientSecretSha256") && oauth2ClientSecretSha256 != null) {
-      fieldMap.put(
-          "oauth2ClientSecretSha256",
-          Collections.singletonList(String.valueOf(oauth2ClientSecretSha256)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("enabled")) {
-      return String.valueOf(enabled);
+      return enabled;
     }
     if (fieldName.equals("oauth2ClientId")) {
-      return String.valueOf(oauth2ClientId);
+      return oauth2ClientId;
     }
     if (fieldName.equals("oauth2ClientSecret")) {
-      return String.valueOf(oauth2ClientSecret);
+      return oauth2ClientSecret;
     }
     if (fieldName.equals("oauth2ClientSecretSha256")) {
-      return String.valueOf(oauth2ClientSecretSha256);
+      return oauth2ClientSecretSha256;
     }
     return null;
   }
@@ -96,6 +71,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getEnabled() {
     return enabled;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java
index 3f6c7a98681c..e89fdd5087ca 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private BackendServiceList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (BackendService item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java
index 0d964ea5d92d..2314286e6873 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private BackendServicesScopedList(List backendServices, Warning
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("backendServices") && backendServices != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (BackendService item : backendServices) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("backendServices", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("backendServices")) {
-      return String.valueOf(backendServices);
+      return backendServices;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getBackendServicesList() {
     return backendServices;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java
index 0a8d49d8c913..34d363da9d00 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private CacheInvalidationRule(String host, String path) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("path") && path != null) {
-      fieldMap.put("path", Collections.singletonList(String.valueOf(path)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("path")) {
-      return String.valueOf(path);
+      return path;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getHost() {
     return host;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java
index 521b6a093360..ebfa5f81c911 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -59,51 +54,21 @@ private CacheKeyPolicy(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("includeHost") && includeHost != null) {
-      fieldMap.put("includeHost", Collections.singletonList(String.valueOf(includeHost)));
-    }
-    if (fieldNames.contains("includeProtocol") && includeProtocol != null) {
-      fieldMap.put("includeProtocol", Collections.singletonList(String.valueOf(includeProtocol)));
-    }
-    if (fieldNames.contains("includeQueryString") && includeQueryString != null) {
-      fieldMap.put(
-          "includeQueryString", Collections.singletonList(String.valueOf(includeQueryString)));
-    }
-    if (fieldNames.contains("queryStringBlacklist") && queryStringBlacklist != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : queryStringBlacklist) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("queryStringBlacklist", stringList.build());
-    }
-    if (fieldNames.contains("queryStringWhitelist") && queryStringWhitelist != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : queryStringWhitelist) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("queryStringWhitelist", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("includeHost")) {
-      return String.valueOf(includeHost);
+      return includeHost;
     }
     if (fieldName.equals("includeProtocol")) {
-      return String.valueOf(includeProtocol);
+      return includeProtocol;
     }
     if (fieldName.equals("includeQueryString")) {
-      return String.valueOf(includeQueryString);
+      return includeQueryString;
     }
     if (fieldName.equals("queryStringBlacklist")) {
-      return String.valueOf(queryStringBlacklist);
+      return queryStringBlacklist;
     }
     if (fieldName.equals("queryStringWhitelist")) {
-      return String.valueOf(queryStringWhitelist);
+      return queryStringWhitelist;
     }
     return null;
   }
@@ -114,6 +79,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getIncludeHost() {
     return includeHost;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java
index 5bd07d7e5efd..dc34e8a93323 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -91,95 +86,45 @@ private Commitment(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("endTimestamp") && endTimestamp != null) {
-      fieldMap.put("endTimestamp", Collections.singletonList(String.valueOf(endTimestamp)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("plan") && plan != null) {
-      fieldMap.put("plan", Collections.singletonList(String.valueOf(plan)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("resources") && resources != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ResourceCommitment item : resources) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("resources", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("startTimestamp") && startTimestamp != null) {
-      fieldMap.put("startTimestamp", Collections.singletonList(String.valueOf(startTimestamp)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("statusMessage") && statusMessage != null) {
-      fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("endTimestamp")) {
-      return String.valueOf(endTimestamp);
+      return endTimestamp;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("plan")) {
-      return String.valueOf(plan);
+      return plan;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("resources")) {
-      return String.valueOf(resources);
+      return resources;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("startTimestamp")) {
-      return String.valueOf(startTimestamp);
+      return startTimestamp;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("statusMessage")) {
-      return String.valueOf(statusMessage);
+      return statusMessage;
     }
     return null;
   }
@@ -190,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java
index 0a9cf4e5b86b..755176db0c56 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private CommitmentAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java
index c67292729f6c..8d6a8931d91b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private CommitmentList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Commitment item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java
index ae7cb02bbbfc..7abc8f23eb5a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private CommitmentsScopedList(List commitments, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("commitments") && commitments != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Commitment item : commitments) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("commitments", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("commitments")) {
-      return String.valueOf(commitments);
+      return commitments;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getCommitmentsList() {
     return commitments;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java
index 1f6c0b898838..cbcf3e4a0732 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,26 +36,22 @@ private ConnectionDraining(Integer drainingTimeoutSec) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("drainingTimeoutSec") && drainingTimeoutSec != null) {
-      fieldMap.put(
-          "drainingTimeoutSec", Collections.singletonList(String.valueOf(drainingTimeoutSec)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("drainingTimeoutSec")) {
+      return drainingTimeoutSec;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("drainingTimeoutSec")) {
-      return String.valueOf(drainingTimeoutSec);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java
index 22e34f75bc37..61bb82da6835 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,78 +77,39 @@ private CreateSnapshotDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("guestFlush") && guestFlush != null) {
-      fieldMap.put("guestFlush", Collections.singletonList(String.valueOf(guestFlush)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("snapshotResource") && snapshotResource != null) {
-      fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("guestFlush")) {
-      return String.valueOf(guestFlush);
+      return guestFlush;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("snapshotResource")) {
-      return String.valueOf(snapshotResource);
+      return snapshotResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -163,6 +120,12 @@ public Snapshot getApiMessageRequestBody() {
     return snapshotResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java
index 26a7758fdc19..394b1e60eccc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private CreateSnapshotRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("snapshotResource") && snapshotResource != null) {
-      fieldMap.put("snapshotResource", Collections.singletonList(String.valueOf(snapshotResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("snapshotResource")) {
-      return String.valueOf(snapshotResource);
+      return snapshotResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Snapshot getApiMessageRequestBody() {
     return snapshotResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java
index 9535453d1ed2..5c1acb5c85e4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private CustomerEncryptionKey(String rawKey, String sha256) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("rawKey") && rawKey != null) {
-      fieldMap.put("rawKey", Collections.singletonList(String.valueOf(rawKey)));
-    }
-    if (fieldNames.contains("sha256") && sha256 != null) {
-      fieldMap.put("sha256", Collections.singletonList(String.valueOf(sha256)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("rawKey")) {
-      return String.valueOf(rawKey);
+      return rawKey;
     }
     if (fieldName.equals("sha256")) {
-      return String.valueOf(sha256);
+      return sha256;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getRawKey() {
     return rawKey;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java
index a7e25e4ff78d..31796df11626 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -44,25 +40,12 @@ private CustomerEncryptionKeyProtectedDisk(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) {
-      fieldMap.put(
-          "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey)));
-    }
-    if (fieldNames.contains("source") && source != null) {
-      fieldMap.put("source", Collections.singletonList(String.valueOf(source)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("diskEncryptionKey")) {
-      return String.valueOf(diskEncryptionKey);
+      return diskEncryptionKey;
     }
     if (fieldName.equals("source")) {
-      return String.valueOf(source);
+      return source;
     }
     return null;
   }
@@ -73,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public CustomerEncryptionKey getDiskEncryptionKey() {
     return diskEncryptionKey;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java
index 1984f5b20e4c..d74b9ed54b52 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private Data(String key, String value) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("value") && value != null) {
-      fieldMap.put("value", Collections.singletonList(String.valueOf(value)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("value")) {
-      return String.valueOf(value);
+      return value;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getKey() {
     return key;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java
index fb7423784f94..0d0497c6c3a4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,78 +77,39 @@ private DeleteAccessConfigInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("accessConfig") && accessConfig != null) {
-      fieldMap.put("accessConfig", Collections.singletonList(String.valueOf(accessConfig)));
-    }
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("networkInterface") && networkInterface != null) {
-      fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("accessConfig")) {
-      return String.valueOf(accessConfig);
+      return accessConfig;
     }
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("networkInterface")) {
-      return String.valueOf(networkInterface);
+      return networkInterface;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -163,6 +120,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessConfig() {
     return accessConfig;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java
index 3aed29febb4b..693eafccbf44 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteAddressHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("address") && address != null) {
-      fieldMap.put("address", Collections.singletonList(String.valueOf(address)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("address")) {
-      return String.valueOf(address);
+      return address;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java
index 501172a2ea9d..0d0e58fd556a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java
index 41386c1527a9..bdefaf6a5a18 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteBackendBucketHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendBucket") && backendBucket != null) {
-      fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendBucket")) {
-      return String.valueOf(backendBucket);
+      return backendBucket;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java
index fc9ec286591d..36c2f268f09b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java
index 4f400cea4939..6f71d205d1ed 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java
index 0a95cdb91268..170556e99284 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteFirewallHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("firewall") && firewall != null) {
-      fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("firewall")) {
-      return String.valueOf(firewall);
+      return firewall;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java
index ba1826a2c7a3..42e54201f856 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRule") && forwardingRule != null) {
-      fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRule")) {
-      return String.valueOf(forwardingRule);
+      return forwardingRule;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java
index a19eb85ef20c..b1106d5bb80e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteGlobalAddressHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("address") && address != null) {
-      fieldMap.put("address", Collections.singletonList(String.valueOf(address)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("address")) {
-      return String.valueOf(address);
+      return address;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java
index ccc7cd90e76b..9035cee23212 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteGlobalForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRule") && forwardingRule != null) {
-      fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRule")) {
-      return String.valueOf(forwardingRule);
+      return forwardingRule;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java
index dffbfeba8a65..6e092ff9013d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private DeleteGlobalOperationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("operation") && operation != null) {
-      fieldMap.put("operation", Collections.singletonList(String.valueOf(operation)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("operation")) {
-      return String.valueOf(operation);
+      return operation;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java
index d597ed87bc26..8d3a336d5895 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("healthCheck") && healthCheck != null) {
-      fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("healthCheck")) {
-      return String.valueOf(healthCheck);
+      return healthCheck;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java
index d98cdc2eaff1..d349a48aa402 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteHttpHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) {
-      fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpHealthCheck")) {
-      return String.valueOf(httpHealthCheck);
+      return httpHealthCheck;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java
index ea083fec6dd1..8152f210254e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteHttpsHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) {
-      fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpsHealthCheck")) {
-      return String.valueOf(httpsHealthCheck);
+      return httpsHealthCheck;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java
index f192fa56ff6d..c7553ecc3d21 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteImageHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("image") && image != null) {
-      fieldMap.put("image", Collections.singletonList(String.valueOf(image)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("image")) {
-      return String.valueOf(image);
+      return image;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java
index f1049a23f64d..7493d25b35fb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java
index 3716bb27c6fe..45f5f6490909 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,67 +69,33 @@ private DeleteInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -144,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java
index 673d763e1b3b..6f9a6197141f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java
index 91e9b81e9b8d..e1220a364c62 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteInstanceTemplateHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) {
-      fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceTemplate")) {
-      return String.valueOf(instanceTemplate);
+      return instanceTemplate;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java
index d02f3aa75879..3f87e1272557 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,77 +76,36 @@ private DeleteInstancesInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("instanceGroupManagersDeleteInstancesRequestResource")
-        && instanceGroupManagersDeleteInstancesRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupManagersDeleteInstancesRequestResource",
-          Collections.singletonList(
-              String.valueOf(instanceGroupManagersDeleteInstancesRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("instanceGroupManagersDeleteInstancesRequestResource")) {
-      return String.valueOf(instanceGroupManagersDeleteInstancesRequestResource);
+      return instanceGroupManagersDeleteInstancesRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -161,6 +116,12 @@ public InstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBody() {
     return instanceGroupManagersDeleteInstancesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java
index 8b1b4978b59f..45a0bd96edd6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,77 +76,36 @@ private DeleteInstancesRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionInstanceGroupManagersDeleteInstancesRequestResource")
-        && regionInstanceGroupManagersDeleteInstancesRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupManagersDeleteInstancesRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionInstanceGroupManagersDeleteInstancesRequestResource")) {
-      return String.valueOf(regionInstanceGroupManagersDeleteInstancesRequestResource);
+      return regionInstanceGroupManagersDeleteInstancesRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -161,6 +116,12 @@ public RegionInstanceGroupManagersDeleteInstancesRequest getApiMessageRequestBod
     return regionInstanceGroupManagersDeleteInstancesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java
index a954333c2313..21d38965684f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,68 +69,33 @@ private DeleteInterconnectAttachmentHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) {
-      fieldMap.put(
-          "interconnectAttachment",
-          Collections.singletonList(String.valueOf(interconnectAttachment)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnectAttachment")) {
-      return String.valueOf(interconnectAttachment);
+      return interconnectAttachment;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -145,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java
index 6b47502e9489..f500dceac067 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteInterconnectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnect") && interconnect != null) {
-      fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnect")) {
-      return String.valueOf(interconnect);
+      return interconnect;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java
index 6746f152dc4d..1b72506cf12b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteLicenseHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("license") && license != null) {
-      fieldMap.put("license", Collections.singletonList(String.valueOf(license)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("license")) {
-      return String.valueOf(license);
+      return license;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java
index c0091faaf314..7541e806787a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteNetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java
index e2f86b272efa..08cc13a54a85 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteRegionAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java
index 8ba0bf3ce1fc..008d140f7a38 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteRegionBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java
index 5dfb0647e4dc..e7711ba261bf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java
index 9d007d07395c..e11f8b34363a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,67 +69,33 @@ private DeleteRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -144,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java
index 0aa04d0347fa..6055704b364e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private DeleteRegionOperationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("operation") && operation != null) {
-      fieldMap.put("operation", Collections.singletonList(String.valueOf(operation)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("operation")) {
-      return String.valueOf(operation);
+      return operation;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java
index 169f670aaefb..386c7b765e77 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteRouteHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("route") && route != null) {
-      fieldMap.put("route", Collections.singletonList(String.valueOf(route)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("route")) {
-      return String.valueOf(route);
+      return route;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java
index 2b2c5dffd844..5bd48ef27f22 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java
index bc41b7100059..bd2cc210d568 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteSnapshotHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("snapshot") && snapshot != null) {
-      fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("snapshot")) {
-      return String.valueOf(snapshot);
+      return snapshot;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java
index 45c38ccbdb4b..d73bc6c2785a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteSslCertificateHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslCertificate") && sslCertificate != null) {
-      fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslCertificate")) {
-      return String.valueOf(sslCertificate);
+      return sslCertificate;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java
index dabf1a10aadc..270a2dd6834e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteSslPolicyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslPolicy") && sslPolicy != null) {
-      fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslPolicy")) {
-      return String.valueOf(sslPolicy);
+      return sslPolicy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java
index 92553629d430..4270d7f84e8c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteSubnetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java
index 1ec62978cef3..6b2928c2b241 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetHttpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) {
-      fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpProxy")) {
-      return String.valueOf(targetHttpProxy);
+      return targetHttpProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java
index 1adb6c8e9987..27f496359c10 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetHttpsProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
-      fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpsProxy")) {
-      return String.valueOf(targetHttpsProxy);
+      return targetHttpsProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java
index 4ae64c4505e0..7c0999908eec 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetInstance") && targetInstance != null) {
-      fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetInstance")) {
-      return String.valueOf(targetInstance);
+      return targetInstance;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java
index c520c4629eee..aca94b513e81 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetPool") && targetPool != null) {
-      fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetPool")) {
-      return String.valueOf(targetPool);
+      return targetPool;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java
index 58c4c718a276..645f7b594a81 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
-      fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetSslProxy")) {
-      return String.valueOf(targetSslProxy);
+      return targetSslProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java
index 20e042141905..76e48333d234 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetTcpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
-      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetTcpProxy")) {
-      return String.valueOf(targetTcpProxy);
+      return targetTcpProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java
index f9dc3744a64d..bba660371155 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteTargetVpnGatewayHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) {
-      fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetVpnGateway")) {
-      return String.valueOf(targetVpnGateway);
+      return targetVpnGateway;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java
index ce830ad22a39..e4be6526e378 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java
index 04c41adf8d23..f886123d795a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DeleteVpnTunnelHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) {
-      fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("vpnTunnel")) {
-      return String.valueOf(vpnTunnel);
+      return vpnTunnel;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java
index ddb4f4ffd11b..40ddc56cdec5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private DeleteZoneOperationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("operation") && operation != null) {
-      fieldMap.put("operation", Collections.singletonList(String.valueOf(operation)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("operation")) {
-      return String.valueOf(operation);
+      return operation;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java
index 8d93d2ea8590..e841066a4447 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private Denied(String iPProtocol, List ports) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("iPProtocol") && iPProtocol != null) {
-      fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol)));
-    }
-    if (fieldNames.contains("ports") && ports != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : ports) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("ports", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("iPProtocol")) {
-      return String.valueOf(iPProtocol);
+      return iPProtocol;
     }
     if (fieldName.equals("ports")) {
-      return String.valueOf(ports);
+      return ports;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getIPProtocol() {
     return iPProtocol;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java
index 663b4d0f8606..fd9fbc338322 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private DeprecateImageHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("deprecationStatusResource") && deprecationStatusResource != null) {
-      fieldMap.put(
-          "deprecationStatusResource",
-          Collections.singletonList(String.valueOf(deprecationStatusResource)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("image") && image != null) {
-      fieldMap.put("image", Collections.singletonList(String.valueOf(image)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("deprecationStatusResource")) {
-      return String.valueOf(deprecationStatusResource);
+      return deprecationStatusResource;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("image")) {
-      return String.valueOf(image);
+      return image;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public DeprecationStatus getApiMessageRequestBody() {
     return deprecationStatusResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java
index 6a5068384d9b..c0022caa6ff8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private DeprecationStatus(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("deleted") && deleted != null) {
-      fieldMap.put("deleted", Collections.singletonList(String.valueOf(deleted)));
-    }
-    if (fieldNames.contains("deprecated") && deprecated != null) {
-      fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
-    }
-    if (fieldNames.contains("obsolete") && obsolete != null) {
-      fieldMap.put("obsolete", Collections.singletonList(String.valueOf(obsolete)));
-    }
-    if (fieldNames.contains("replacement") && replacement != null) {
-      fieldMap.put("replacement", Collections.singletonList(String.valueOf(replacement)));
-    }
-    if (fieldNames.contains("state") && state != null) {
-      fieldMap.put("state", Collections.singletonList(String.valueOf(state)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("deleted")) {
-      return String.valueOf(deleted);
+      return deleted;
     }
     if (fieldName.equals("deprecated")) {
-      return String.valueOf(deprecated);
+      return deprecated;
     }
     if (fieldName.equals("obsolete")) {
-      return String.valueOf(obsolete);
+      return obsolete;
     }
     if (fieldName.equals("replacement")) {
-      return String.valueOf(replacement);
+      return replacement;
     }
     if (fieldName.equals("state")) {
-      return String.valueOf(state);
+      return state;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDeleted() {
     return deleted;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java
index abaf1ce24c20..e93c3ac9809f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private DetachDiskInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("deviceName") && deviceName != null) {
-      fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("deviceName")) {
-      return String.valueOf(deviceName);
+      return deviceName;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java
index 60345cd24532..e99584fb3776 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private DisableXpnHostProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java
index 3add0970478b..8338ca7c7a40 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private DisableXpnResourceProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("projectsDisableXpnResourceRequestResource")
-        && projectsDisableXpnResourceRequestResource != null) {
-      fieldMap.put(
-          "projectsDisableXpnResourceRequestResource",
-          Collections.singletonList(String.valueOf(projectsDisableXpnResourceRequestResource)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("projectsDisableXpnResourceRequestResource")) {
-      return String.valueOf(projectsDisableXpnResourceRequestResource);
+      return projectsDisableXpnResourceRequestResource;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public ProjectsDisableXpnResourceRequest getApiMessageRequestBody() {
     return projectsDisableXpnResourceRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java
index c9be0f7c6beb..17230df6b038 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java
@@ -17,14 +17,10 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -151,208 +147,90 @@ private Disk(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("diskEncryptionKey") && diskEncryptionKey != null) {
-      fieldMap.put(
-          "diskEncryptionKey", Collections.singletonList(String.valueOf(diskEncryptionKey)));
-    }
-    if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (GuestOsFeature item : guestOsFeatures) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("guestOsFeatures", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    if (fieldNames.contains("lastAttachTimestamp") && lastAttachTimestamp != null) {
-      fieldMap.put(
-          "lastAttachTimestamp", Collections.singletonList(String.valueOf(lastAttachTimestamp)));
-    }
-    if (fieldNames.contains("lastDetachTimestamp") && lastDetachTimestamp != null) {
-      fieldMap.put(
-          "lastDetachTimestamp", Collections.singletonList(String.valueOf(lastDetachTimestamp)));
-    }
-    if (fieldNames.contains("licenseCodes") && licenseCodes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : licenseCodes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenseCodes", stringList.build());
-    }
-    if (fieldNames.contains("licenses") && licenses != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : licenses) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenses", stringList.build());
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("options") && options != null) {
-      fieldMap.put("options", Collections.singletonList(String.valueOf(options)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("replicaZones") && replicaZones != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : replicaZones) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("replicaZones", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sizeGb") && sizeGb != null) {
-      fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb)));
-    }
-    if (fieldNames.contains("sourceImage") && sourceImage != null) {
-      fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage)));
-    }
-    if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) {
-      fieldMap.put(
-          "sourceImageEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceImageEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceImageId") && sourceImageId != null) {
-      fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId)));
-    }
-    if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) {
-      fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot)));
-    }
-    if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) {
-      fieldMap.put(
-          "sourceSnapshotEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) {
-      fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("type") && type != null) {
-      fieldMap.put("type", Collections.singletonList(String.valueOf(type)));
-    }
-    if (fieldNames.contains("users") && users != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : users) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("users", stringList.build());
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("diskEncryptionKey")) {
-      return String.valueOf(diskEncryptionKey);
+      return diskEncryptionKey;
     }
     if (fieldName.equals("guestOsFeatures")) {
-      return String.valueOf(guestOsFeatures);
+      return guestOsFeatures;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     if (fieldName.equals("lastAttachTimestamp")) {
-      return String.valueOf(lastAttachTimestamp);
+      return lastAttachTimestamp;
     }
     if (fieldName.equals("lastDetachTimestamp")) {
-      return String.valueOf(lastDetachTimestamp);
+      return lastDetachTimestamp;
     }
     if (fieldName.equals("licenseCodes")) {
-      return String.valueOf(licenseCodes);
+      return licenseCodes;
     }
     if (fieldName.equals("licenses")) {
-      return String.valueOf(licenses);
+      return licenses;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("options")) {
-      return String.valueOf(options);
+      return options;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("replicaZones")) {
-      return String.valueOf(replicaZones);
+      return replicaZones;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sizeGb")) {
-      return String.valueOf(sizeGb);
+      return sizeGb;
     }
     if (fieldName.equals("sourceImage")) {
-      return String.valueOf(sourceImage);
+      return sourceImage;
     }
     if (fieldName.equals("sourceImageEncryptionKey")) {
-      return String.valueOf(sourceImageEncryptionKey);
+      return sourceImageEncryptionKey;
     }
     if (fieldName.equals("sourceImageId")) {
-      return String.valueOf(sourceImageId);
+      return sourceImageId;
     }
     if (fieldName.equals("sourceSnapshot")) {
-      return String.valueOf(sourceSnapshot);
+      return sourceSnapshot;
     }
     if (fieldName.equals("sourceSnapshotEncryptionKey")) {
-      return String.valueOf(sourceSnapshotEncryptionKey);
+      return sourceSnapshotEncryptionKey;
     }
     if (fieldName.equals("sourceSnapshotId")) {
-      return String.valueOf(sourceSnapshotId);
+      return sourceSnapshotId;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("type")) {
-      return String.valueOf(type);
+      return type;
     }
     if (fieldName.equals("users")) {
-      return String.valueOf(users);
+      return users;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -363,6 +241,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java
index e9267403e344..e3254b1b0e23 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private DiskAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
index cb20e39337cd..385f53b71dab 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
@@ -43,10 +43,9 @@
  * 
  * try (DiskClient diskClient = DiskClient.create()) {
  *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
- *   String requestId = "";
  *   Boolean guestFlush = false;
  *   Snapshot snapshotResource = Snapshot.newBuilder().build();
- *   Operation response = diskClient.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource);
+ *   Operation response = diskClient.createSnapshotDisk(disk, guestFlush, snapshotResource);
  * }
  * 
  * 
@@ -300,23 +299,13 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks( *

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
-   *   Operation response = diskClient.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource);
+   *   Operation response = diskClient.createSnapshotDisk(disk, guestFlush, snapshotResource);
    * }
    * 
* * @param disk Name of the persistent disk to snapshot. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param guestFlush * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots * ==) (== resource_for v1.snapshots ==) @@ -324,12 +313,11 @@ public final AggregatedListDisksPagedResponse aggregatedListDisks( */ @BetaApi public final Operation createSnapshotDisk( - ProjectZoneDiskName disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { + ProjectZoneDiskName disk, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) .setGuestFlush(guestFlush) .setSnapshotResource(snapshotResource) .build(); @@ -345,23 +333,13 @@ public final Operation createSnapshotDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
-   *   Operation response = diskClient.createSnapshotDisk(disk.toString(), requestId, guestFlush, snapshotResource);
+   *   Operation response = diskClient.createSnapshotDisk(disk.toString(), guestFlush, snapshotResource);
    * }
    * 
* * @param disk Name of the persistent disk to snapshot. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param guestFlush * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots * ==) (== resource_for v1.snapshots ==) @@ -369,12 +347,11 @@ public final Operation createSnapshotDisk( */ @BetaApi public final Operation createSnapshotDisk( - String disk, String requestId, Boolean guestFlush, Snapshot snapshotResource) { + String disk, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() .setDisk(disk) - .setRequestId(requestId) .setGuestFlush(guestFlush) .setSnapshotResource(snapshotResource) .build(); @@ -390,12 +367,10 @@ public final Operation createSnapshotDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
    *   CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setGuestFlush(guestFlush)
    *     .setSnapshotResource(snapshotResource)
    *     .build();
@@ -420,12 +395,10 @@ public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request)
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   Boolean guestFlush = false;
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
    *   CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setGuestFlush(guestFlush)
    *     .setSnapshotResource(snapshotResource)
    *     .build();
@@ -452,31 +425,18 @@ public final Operation createSnapshotDisk(CreateSnapshotDiskHttpRequest request)
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
-   *   Operation response = diskClient.deleteDisk(disk, requestId);
+   *   Operation response = diskClient.deleteDisk(disk);
    * }
    * 
* * @param disk Name of the persistent disk to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteDisk(ProjectZoneDiskName disk, String requestId) { + public final Operation deleteDisk(ProjectZoneDiskName disk) { DeleteDiskHttpRequest request = - DeleteDiskHttpRequest.newBuilder() - .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) - .build(); + DeleteDiskHttpRequest.newBuilder().setDisk(disk == null ? null : disk.toString()).build(); return deleteDisk(request); } @@ -491,28 +451,17 @@ public final Operation deleteDisk(ProjectZoneDiskName disk, String requestId) { *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
-   *   Operation response = diskClient.deleteDisk(disk.toString(), requestId);
+   *   Operation response = diskClient.deleteDisk(disk.toString());
    * }
    * 
* * @param disk Name of the persistent disk to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteDisk(String disk, String requestId) { + public final Operation deleteDisk(String disk) { - DeleteDiskHttpRequest request = - DeleteDiskHttpRequest.newBuilder().setDisk(disk).setRequestId(requestId).build(); + DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder().setDisk(disk).build(); return deleteDisk(request); } @@ -527,10 +476,8 @@ public final Operation deleteDisk(String disk, String requestId) { *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = diskClient.deleteDisk(request);
    * }
@@ -555,10 +502,8 @@ public final Operation deleteDisk(DeleteDiskHttpRequest request) {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   DeleteDiskHttpRequest request = DeleteDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.deleteDiskCallable().futureCall(request);
    *   // Do something
@@ -681,37 +626,22 @@ public final UnaryCallable getDiskCallable() {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
-   *   Operation response = diskClient.insertDisk(zone, requestId, sourceImage, diskResource);
+   *   Operation response = diskClient.insertDisk(zone, diskResource);
    * }
    * 
* * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). - * @param sourceImage Optional. Source image to restore onto a disk. * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertDisk( - ProjectZoneName zone, String requestId, String sourceImage, Disk diskResource) { + public final Operation insertDisk(ProjectZoneName zone, Disk diskResource) { InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) - .setSourceImage(sourceImage) .setDiskResource(diskResource) .build(); return insertDisk(request); @@ -729,39 +659,21 @@ public final Operation insertDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
-   *   Operation response = diskClient.insertDisk(zone.toString(), requestId, sourceImage, diskResource);
+   *   Operation response = diskClient.insertDisk(zone.toString(), diskResource);
    * }
    * 
* * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). - * @param sourceImage Optional. Source image to restore onto a disk. * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertDisk( - String zone, String requestId, String sourceImage, Disk diskResource) { + public final Operation insertDisk(String zone, Disk diskResource) { InsertDiskHttpRequest request = - InsertDiskHttpRequest.newBuilder() - .setZone(zone) - .setRequestId(requestId) - .setSourceImage(sourceImage) - .setDiskResource(diskResource) - .build(); + InsertDiskHttpRequest.newBuilder().setZone(zone).setDiskResource(diskResource).build(); return insertDisk(request); } @@ -777,13 +689,9 @@ public final Operation insertDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
    *   InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
-   *     .setSourceImage(sourceImage)
    *     .setDiskResource(diskResource)
    *     .build();
    *   Operation response = diskClient.insertDisk(request);
@@ -810,13 +718,9 @@ public final Operation insertDisk(InsertDiskHttpRequest request) {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   Disk diskResource = Disk.newBuilder().build();
    *   InsertDiskHttpRequest request = InsertDiskHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
-   *     .setSourceImage(sourceImage)
    *     .setDiskResource(diskResource)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.insertDiskCallable().futureCall(request);
@@ -972,33 +876,22 @@ public final UnaryCallable listDisksCallable() {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
-   *   Operation response = diskClient.resizeDisk(disk, requestId, disksResizeRequestResource);
+   *   Operation response = diskClient.resizeDisk(disk, disksResizeRequestResource);
    * }
    * 
* * @param disk The name of the persistent disk. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param disksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resizeDisk( - ProjectZoneDiskName disk, String requestId, DisksResizeRequest disksResizeRequestResource) { + ProjectZoneDiskName disk, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) .setDisksResizeRequestResource(disksResizeRequestResource) .build(); return resizeDisk(request); @@ -1013,33 +906,21 @@ public final Operation resizeDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
-   *   Operation response = diskClient.resizeDisk(disk.toString(), requestId, disksResizeRequestResource);
+   *   Operation response = diskClient.resizeDisk(disk.toString(), disksResizeRequestResource);
    * }
    * 
* * @param disk The name of the persistent disk. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param disksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeDisk( - String disk, String requestId, DisksResizeRequest disksResizeRequestResource) { + public final Operation resizeDisk(String disk, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() .setDisk(disk) - .setRequestId(requestId) .setDisksResizeRequestResource(disksResizeRequestResource) .build(); return resizeDisk(request); @@ -1054,11 +935,9 @@ public final Operation resizeDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setDisksResizeRequestResource(disksResizeRequestResource)
    *     .build();
    *   Operation response = diskClient.resizeDisk(request);
@@ -1082,11 +961,9 @@ public final Operation resizeDisk(ResizeDiskHttpRequest request) {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]");
-   *   String requestId = "";
    *   DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
    *   ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setDisksResizeRequestResource(disksResizeRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.resizeDiskCallable().futureCall(request);
@@ -1110,35 +987,22 @@ public final UnaryCallable resizeDiskCallable(
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
-   *   Operation response = diskClient.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource);
+   *   Operation response = diskClient.setLabelsDisk(resource, zoneSetLabelsRequestResource);
    * }
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param zoneSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setLabelsDisk( - ProjectZoneDiskResourceName resource, - String requestId, - ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + ProjectZoneDiskResourceName resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder() .setResource(resource == null ? null : resource.toString()) - .setRequestId(requestId) .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) .build(); return setLabelsDisk(request); @@ -1154,33 +1018,22 @@ public final Operation setLabelsDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
-   *   Operation response = diskClient.setLabelsDisk(resource.toString(), requestId, zoneSetLabelsRequestResource);
+   *   Operation response = diskClient.setLabelsDisk(resource.toString(), zoneSetLabelsRequestResource);
    * }
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param zoneSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setLabelsDisk( - String resource, String requestId, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { + String resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource) { SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder() .setResource(resource) - .setRequestId(requestId) .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource) .build(); return setLabelsDisk(request); @@ -1196,11 +1049,9 @@ public final Operation setLabelsDisk( *


    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
    *     .setResource(resource.toString())
-   *     .setRequestId(requestId)
    *     .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource)
    *     .build();
    *   Operation response = diskClient.setLabelsDisk(request);
@@ -1225,11 +1076,9 @@ public final Operation setLabelsDisk(SetLabelsDiskHttpRequest request) {
    * 

    * try (DiskClient diskClient = DiskClient.create()) {
    *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
    *   SetLabelsDiskHttpRequest request = SetLabelsDiskHttpRequest.newBuilder()
    *     .setResource(resource.toString())
-   *     .setRequestId(requestId)
    *     .setZoneSetLabelsRequestResource(zoneSetLabelsRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = diskClient.setLabelsDiskCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java
index 9aa240ff1239..41c6fe8ff920 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private DiskList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Disk item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java
index 28420b92da74..a2883c8c4c96 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private DiskMoveRequest(String destinationZone, String targetDisk) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("destinationZone") && destinationZone != null) {
-      fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone)));
-    }
-    if (fieldNames.contains("targetDisk") && targetDisk != null) {
-      fieldMap.put("targetDisk", Collections.singletonList(String.valueOf(targetDisk)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("destinationZone")) {
-      return String.valueOf(destinationZone);
+      return destinationZone;
     }
     if (fieldName.equals("targetDisk")) {
-      return String.valueOf(targetDisk);
+      return targetDisk;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDestinationZone() {
     return destinationZone;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java
index 628bca2d0c75..516285f6e775 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,80 +77,39 @@ private DiskType(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("defaultDiskSizeGb") && defaultDiskSizeGb != null) {
-      fieldMap.put(
-          "defaultDiskSizeGb", Collections.singletonList(String.valueOf(defaultDiskSizeGb)));
-    }
-    if (fieldNames.contains("deprecated") && deprecated != null) {
-      fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("validDiskSize") && validDiskSize != null) {
-      fieldMap.put("validDiskSize", Collections.singletonList(String.valueOf(validDiskSize)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("defaultDiskSizeGb")) {
-      return String.valueOf(defaultDiskSizeGb);
+      return defaultDiskSizeGb;
     }
     if (fieldName.equals("deprecated")) {
-      return String.valueOf(deprecated);
+      return deprecated;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("validDiskSize")) {
-      return String.valueOf(validDiskSize);
+      return validDiskSize;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -165,6 +120,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java
index b41efcfa2bfb..74b9171c6866 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private DiskTypeAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java
index ebd739b3d4ff..c22ef5722ef9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private DiskTypeList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (DiskType item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java
index 03ace04edf50..130e23217f19 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private DiskTypesScopedList(List diskTypes, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("diskTypes") && diskTypes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (DiskType item : diskTypes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("diskTypes", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("diskTypes")) {
-      return String.valueOf(diskTypes);
+      return diskTypes;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getDiskTypesList() {
     return diskTypes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java
index 6f833e5e86d3..24b6df9cdd91 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private DisksResizeRequest(String sizeGb) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("sizeGb") && sizeGb != null) {
-      fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("sizeGb")) {
+      return sizeGb;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("sizeGb")) {
-      return String.valueOf(sizeGb);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java
index 25d5992e60fd..8efc36590961 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private DisksScopedList(List disks, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("disks") && disks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Disk item : disks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("disks", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("disks")) {
-      return String.valueOf(disks);
+      return disks;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getDisksList() {
     return disks;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java
index 80bee960b45c..439065cdbae3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private EnableXpnHostProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java
index b8318817bae1..47b515ca4b1f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private EnableXpnResourceProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("projectsEnableXpnResourceRequestResource")
-        && projectsEnableXpnResourceRequestResource != null) {
-      fieldMap.put(
-          "projectsEnableXpnResourceRequestResource",
-          Collections.singletonList(String.valueOf(projectsEnableXpnResourceRequestResource)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("projectsEnableXpnResourceRequestResource")) {
-      return String.valueOf(projectsEnableXpnResourceRequestResource);
+      return projectsEnableXpnResourceRequestResource;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public ProjectsEnableXpnResourceRequest getApiMessageRequestBody() {
     return projectsEnableXpnResourceRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java
index b75652abd576..d725f174c601 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private Error(List errors) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("errors") && errors != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Errors item : errors) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("errors", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("errors")) {
+      return errors;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("errors")) {
-      return String.valueOf(errors);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java
index 4a8dc4f78995..2c492e0b4846 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,30 +42,15 @@ private Errors(String code, String location, String message) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("code") && code != null) {
-      fieldMap.put("code", Collections.singletonList(String.valueOf(code)));
-    }
-    if (fieldNames.contains("location") && location != null) {
-      fieldMap.put("location", Collections.singletonList(String.valueOf(location)));
-    }
-    if (fieldNames.contains("message") && message != null) {
-      fieldMap.put("message", Collections.singletonList(String.valueOf(message)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("code")) {
-      return String.valueOf(code);
+      return code;
     }
     if (fieldName.equals("location")) {
-      return String.valueOf(location);
+      return location;
     }
     if (fieldName.equals("message")) {
-      return String.valueOf(message);
+      return message;
     }
     return null;
   }
@@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCode() {
     return code;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java
index 5ce3c75029fe..e0d913f58a59 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private ExpandIpCidrRangeSubnetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    if (fieldNames.contains("subnetworksExpandIpCidrRangeRequestResource")
-        && subnetworksExpandIpCidrRangeRequestResource != null) {
-      fieldMap.put(
-          "subnetworksExpandIpCidrRangeRequestResource",
-          Collections.singletonList(String.valueOf(subnetworksExpandIpCidrRangeRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     if (fieldName.equals("subnetworksExpandIpCidrRangeRequestResource")) {
-      return String.valueOf(subnetworksExpandIpCidrRangeRequestResource);
+      return subnetworksExpandIpCidrRangeRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public SubnetworksExpandIpCidrRangeRequest getApiMessageRequestBody() {
     return subnetworksExpandIpCidrRangeRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java
index 016bb754a7a9..752346813ce1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -107,147 +102,57 @@ private Firewall(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("allowed") && allowed != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Allowed item : allowed) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("allowed", stringList.build());
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("denied") && denied != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Denied item : denied) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("denied", stringList.build());
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("destinationRanges") && destinationRanges != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : destinationRanges) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("destinationRanges", stringList.build());
-    }
-    if (fieldNames.contains("direction") && direction != null) {
-      fieldMap.put("direction", Collections.singletonList(String.valueOf(direction)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("priority") && priority != null) {
-      fieldMap.put("priority", Collections.singletonList(String.valueOf(priority)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sourceRanges") && sourceRanges != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sourceRanges) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sourceRanges", stringList.build());
-    }
-    if (fieldNames.contains("sourceServiceAccounts") && sourceServiceAccounts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sourceServiceAccounts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sourceServiceAccounts", stringList.build());
-    }
-    if (fieldNames.contains("sourceTags") && sourceTags != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sourceTags) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sourceTags", stringList.build());
-    }
-    if (fieldNames.contains("targetServiceAccounts") && targetServiceAccounts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : targetServiceAccounts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetServiceAccounts", stringList.build());
-    }
-    if (fieldNames.contains("targetTags") && targetTags != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : targetTags) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetTags", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("allowed")) {
-      return String.valueOf(allowed);
+      return allowed;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("denied")) {
-      return String.valueOf(denied);
+      return denied;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("destinationRanges")) {
-      return String.valueOf(destinationRanges);
+      return destinationRanges;
     }
     if (fieldName.equals("direction")) {
-      return String.valueOf(direction);
+      return direction;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("priority")) {
-      return String.valueOf(priority);
+      return priority;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sourceRanges")) {
-      return String.valueOf(sourceRanges);
+      return sourceRanges;
     }
     if (fieldName.equals("sourceServiceAccounts")) {
-      return String.valueOf(sourceServiceAccounts);
+      return sourceServiceAccounts;
     }
     if (fieldName.equals("sourceTags")) {
-      return String.valueOf(sourceTags);
+      return sourceTags;
     }
     if (fieldName.equals("targetServiceAccounts")) {
-      return String.valueOf(targetServiceAccounts);
+      return targetServiceAccounts;
     }
     if (fieldName.equals("targetTags")) {
-      return String.valueOf(targetTags);
+      return targetTags;
     }
     return null;
   }
@@ -258,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getAllowedList() {
     return allowed;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java
index 0a6e628f0687..73125d7aa21c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java
@@ -43,8 +43,7 @@
  * 
  * try (FirewallClient firewallClient = FirewallClient.create()) {
  *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
- *   String requestId = "";
- *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
+ *   Operation response = firewallClient.deleteFirewall(firewall);
  * }
  * 
  * 
@@ -160,30 +159,19 @@ public FirewallStub getStub() { *

    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
-   *   Operation response = firewallClient.deleteFirewall(firewall, requestId);
+   *   Operation response = firewallClient.deleteFirewall(firewall);
    * }
    * 
* * @param firewall Name of the firewall rule to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteFirewall(ProjectGlobalFirewallName firewall, String requestId) { + public final Operation deleteFirewall(ProjectGlobalFirewallName firewall) { DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder() .setFirewall(firewall == null ? null : firewall.toString()) - .setRequestId(requestId) .build(); return deleteFirewall(request); } @@ -197,31 +185,18 @@ public final Operation deleteFirewall(ProjectGlobalFirewallName firewall, String *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
-   *   Operation response = firewallClient.deleteFirewall(firewall.toString(), requestId);
+   *   Operation response = firewallClient.deleteFirewall(firewall.toString());
    * }
    * 
* * @param firewall Name of the firewall rule to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteFirewall(String firewall, String requestId) { + public final Operation deleteFirewall(String firewall) { DeleteFirewallHttpRequest request = - DeleteFirewallHttpRequest.newBuilder() - .setFirewall(firewall) - .setRequestId(requestId) - .build(); + DeleteFirewallHttpRequest.newBuilder().setFirewall(firewall).build(); return deleteFirewall(request); } @@ -234,10 +209,8 @@ public final Operation deleteFirewall(String firewall, String requestId) { *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = firewallClient.deleteFirewall(request);
    * }
@@ -260,10 +233,8 @@ public final Operation deleteFirewall(DeleteFirewallHttpRequest request) {
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   DeleteFirewallHttpRequest request = DeleteFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = firewallClient.deleteFirewallCallable().futureCall(request);
    *   // Do something
@@ -381,33 +352,21 @@ public final UnaryCallable getFirewallCallable
    *
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.insertFirewall(requestId, project, firewallResource);
+   *   Operation response = firewallClient.insertFirewall(project, firewallResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertFirewall( - String requestId, ProjectName project, Firewall firewallResource) { + public final Operation insertFirewall(ProjectName project, Firewall firewallResource) { InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setFirewallResource(firewallResource) .build(); @@ -422,33 +381,21 @@ public final Operation insertFirewall( * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.insertFirewall(requestId, project.toString(), firewallResource);
+   *   Operation response = firewallClient.insertFirewall(project.toString(), firewallResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertFirewall( - String requestId, String project, Firewall firewallResource) { + public final Operation insertFirewall(String project, Firewall firewallResource) { InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setFirewallResource(firewallResource) .build(); @@ -463,11 +410,9 @@ public final Operation insertFirewall( * *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setFirewallResource(firewallResource)
    *     .build();
@@ -491,11 +436,9 @@ public final Operation insertFirewall(InsertFirewallHttpRequest request) {
    *
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   InsertFirewallHttpRequest request = InsertFirewallHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setFirewallResource(firewallResource)
    *     .build();
@@ -656,33 +599,22 @@ public final UnaryCallable listFirewalls
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.patchFirewall(firewall, requestId, firewallResource);
+   *   Operation response = firewallClient.patchFirewall(firewall, firewallResource);
    * }
    * 
* * @param firewall Name of the firewall rule to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation patchFirewall( - ProjectGlobalFirewallName firewall, String requestId, Firewall firewallResource) { + ProjectGlobalFirewallName firewall, Firewall firewallResource) { PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder() .setFirewall(firewall == null ? null : firewall.toString()) - .setRequestId(requestId) .setFirewallResource(firewallResource) .build(); return patchFirewall(request); @@ -698,33 +630,21 @@ public final Operation patchFirewall( *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.patchFirewall(firewall.toString(), requestId, firewallResource);
+   *   Operation response = firewallClient.patchFirewall(firewall.toString(), firewallResource);
    * }
    * 
* * @param firewall Name of the firewall rule to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchFirewall( - String firewall, String requestId, Firewall firewallResource) { + public final Operation patchFirewall(String firewall, Firewall firewallResource) { PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder() .setFirewall(firewall) - .setRequestId(requestId) .setFirewallResource(firewallResource) .build(); return patchFirewall(request); @@ -740,11 +660,9 @@ public final Operation patchFirewall( *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
-   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   Operation response = firewallClient.patchFirewall(request);
@@ -769,11 +687,9 @@ public final Operation patchFirewall(PatchFirewallHttpRequest request) {
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   PatchFirewallHttpRequest request = PatchFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
-   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   ApiFuture<Operation> future = firewallClient.patchFirewallCallable().futureCall(request);
@@ -798,33 +714,22 @@ public final UnaryCallable patchFirewallCal
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.updateFirewall(firewall, requestId, firewallResource);
+   *   Operation response = firewallClient.updateFirewall(firewall, firewallResource);
    * }
    * 
* * @param firewall Name of the firewall rule to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation updateFirewall( - ProjectGlobalFirewallName firewall, String requestId, Firewall firewallResource) { + ProjectGlobalFirewallName firewall, Firewall firewallResource) { UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder() .setFirewall(firewall == null ? null : firewall.toString()) - .setRequestId(requestId) .setFirewallResource(firewallResource) .build(); return updateFirewall(request); @@ -841,33 +746,21 @@ public final Operation updateFirewall( *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
-   *   Operation response = firewallClient.updateFirewall(firewall.toString(), requestId, firewallResource);
+   *   Operation response = firewallClient.updateFirewall(firewall.toString(), firewallResource);
    * }
    * 
* * @param firewall Name of the firewall rule to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param firewallResource Represents a Firewall resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateFirewall( - String firewall, String requestId, Firewall firewallResource) { + public final Operation updateFirewall(String firewall, Firewall firewallResource) { UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder() .setFirewall(firewall) - .setRequestId(requestId) .setFirewallResource(firewallResource) .build(); return updateFirewall(request); @@ -884,11 +777,9 @@ public final Operation updateFirewall( *


    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
-   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   Operation response = firewallClient.updateFirewall(request);
@@ -914,11 +805,9 @@ public final Operation updateFirewall(UpdateFirewallHttpRequest request) {
    * 

    * try (FirewallClient firewallClient = FirewallClient.create()) {
    *   ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]");
-   *   String requestId = "";
    *   Firewall firewallResource = Firewall.newBuilder().build();
    *   UpdateFirewallHttpRequest request = UpdateFirewallHttpRequest.newBuilder()
    *     .setFirewall(firewall.toString())
-   *     .setRequestId(requestId)
    *     .setFirewallResource(firewallResource)
    *     .build();
    *   ApiFuture<Operation> future = firewallClient.updateFirewallCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
index e89c70bc0bad..f21ec79e0701 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private FirewallList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Firewall item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java
index 1acc4698d122..e098464b0dde 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -107,120 +102,57 @@ private ForwardingRule(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("iPAddress") && iPAddress != null) {
-      fieldMap.put("iPAddress", Collections.singletonList(String.valueOf(iPAddress)));
-    }
-    if (fieldNames.contains("iPProtocol") && iPProtocol != null) {
-      fieldMap.put("iPProtocol", Collections.singletonList(String.valueOf(iPProtocol)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("ipVersion") && ipVersion != null) {
-      fieldMap.put("ipVersion", Collections.singletonList(String.valueOf(ipVersion)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("loadBalancingScheme") && loadBalancingScheme != null) {
-      fieldMap.put(
-          "loadBalancingScheme", Collections.singletonList(String.valueOf(loadBalancingScheme)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("portRange") && portRange != null) {
-      fieldMap.put("portRange", Collections.singletonList(String.valueOf(portRange)));
-    }
-    if (fieldNames.contains("ports") && ports != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : ports) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("ports", stringList.build());
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    if (fieldNames.contains("target") && target != null) {
-      fieldMap.put("target", Collections.singletonList(String.valueOf(target)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("iPAddress")) {
-      return String.valueOf(iPAddress);
+      return iPAddress;
     }
     if (fieldName.equals("iPProtocol")) {
-      return String.valueOf(iPProtocol);
+      return iPProtocol;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("ipVersion")) {
-      return String.valueOf(ipVersion);
+      return ipVersion;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("loadBalancingScheme")) {
-      return String.valueOf(loadBalancingScheme);
+      return loadBalancingScheme;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("portRange")) {
-      return String.valueOf(portRange);
+      return portRange;
     }
     if (fieldName.equals("ports")) {
-      return String.valueOf(ports);
+      return ports;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     if (fieldName.equals("target")) {
-      return String.valueOf(target);
+      return target;
     }
     return null;
   }
@@ -231,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getBackendService() {
     return backendService;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java
index 55a82726164a..1f25d325df24 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private ForwardingRuleAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
index 9c464a8c0086..9b121c11ccc3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
- *   String requestId = "";
  *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
- *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
+ *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
  * }
  * 
  * 
@@ -302,31 +301,19 @@ public final AggregatedListForwardingRulesPagedResponse aggregatedListForwarding * *

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
-   *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
+   *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteForwardingRule( - String requestId, ProjectRegionForwardingRuleName forwardingRule) { + public final Operation deleteForwardingRule(ProjectRegionForwardingRuleName forwardingRule) { DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .build(); return deleteForwardingRule(request); @@ -340,32 +327,19 @@ public final Operation deleteForwardingRule( * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
-   *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule.toString());
+   *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteForwardingRule(String requestId, String forwardingRule) { + public final Operation deleteForwardingRule(String forwardingRule) { DeleteForwardingRuleHttpRequest request = - DeleteForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) - .setForwardingRule(forwardingRule) - .build(); + DeleteForwardingRuleHttpRequest.newBuilder().setForwardingRule(forwardingRule).build(); return deleteForwardingRule(request); } @@ -377,10 +351,8 @@ public final Operation deleteForwardingRule(String requestId, String forwardingR * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   Operation response = forwardingRuleClient.deleteForwardingRule(request);
@@ -403,10 +375,8 @@ public final Operation deleteForwardingRule(DeleteForwardingRuleHttpRequest requ
    *
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   DeleteForwardingRuleHttpRequest request = DeleteForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   ApiFuture<Operation> future = forwardingRuleClient.deleteForwardingRuleCallable().futureCall(request);
@@ -528,22 +498,12 @@ public final ForwardingRule getForwardingRule(GetForwardingRuleHttpRequest reque
    *
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = forwardingRuleClient.insertForwardingRule(requestId, region, forwardingRuleResource);
+   *   Operation response = forwardingRuleClient.insertForwardingRule(region, forwardingRuleResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies * which pool of target virtual machines to forward a packet to if it matches the given @@ -555,11 +515,10 @@ public final ForwardingRule getForwardingRule(GetForwardingRuleHttpRequest reque */ @BetaApi public final Operation insertForwardingRule( - String requestId, ProjectRegionName region, ForwardingRule forwardingRuleResource) { + ProjectRegionName region, ForwardingRule forwardingRuleResource) { InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -575,22 +534,12 @@ public final Operation insertForwardingRule( * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = forwardingRuleClient.insertForwardingRule(requestId, region.toString(), forwardingRuleResource);
+   *   Operation response = forwardingRuleClient.insertForwardingRule(region.toString(), forwardingRuleResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies * which pool of target virtual machines to forward a packet to if it matches the given @@ -602,11 +551,10 @@ public final Operation insertForwardingRule( */ @BetaApi public final Operation insertForwardingRule( - String requestId, String region, ForwardingRule forwardingRuleResource) { + String region, ForwardingRule forwardingRuleResource) { InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -622,11 +570,9 @@ public final Operation insertForwardingRule( * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -651,11 +597,9 @@ public final Operation insertForwardingRule(InsertForwardingRuleHttpRequest requ
    *
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertForwardingRuleHttpRequest request = InsertForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -818,35 +762,22 @@ public final ListForwardingRulesPagedResponse listForwardingRules(
    *
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = forwardingRuleClient.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource);
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(forwardingRule, targetReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetForwardingRule( - String requestId, - ProjectRegionForwardingRuleName forwardingRule, - TargetReference targetReferenceResource) { + ProjectRegionForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -862,33 +793,22 @@ public final Operation setTargetForwardingRule( * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = forwardingRuleClient.setTargetForwardingRule(requestId, forwardingRule.toString(), targetReferenceResource);
+   *   Operation response = forwardingRuleClient.setTargetForwardingRule(forwardingRule.toString(), targetReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetForwardingRule( - String requestId, String forwardingRule, TargetReference targetReferenceResource) { + String forwardingRule, TargetReference targetReferenceResource) { SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -904,11 +824,9 @@ public final Operation setTargetForwardingRule( * *


    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
@@ -933,11 +851,9 @@ public final Operation setTargetForwardingRule(SetTargetForwardingRuleHttpReques
    *
    * 

    * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetForwardingRuleHttpRequest request = SetTargetForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java
index f33b52c9b425..a7d25a79118b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private ForwardingRuleList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ForwardingRule item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java
index 4202d67f4da6..66aa34626498 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private ForwardingRulesScopedList(List forwardingRules, Warning
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("forwardingRules") && forwardingRules != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ForwardingRule item : forwardingRules) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("forwardingRules", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("forwardingRules")) {
-      return String.valueOf(forwardingRules);
+      return forwardingRules;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getForwardingRulesList() {
     return forwardingRules;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java
index 7ab02b6274bf..861c64ea1405 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetAcceleratorTypeHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("acceleratorType") && acceleratorType != null) {
-      fieldMap.put("acceleratorType", Collections.singletonList(String.valueOf(acceleratorType)));
-    }
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("acceleratorType")) {
-      return String.valueOf(acceleratorType);
+      return acceleratorType;
     }
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAcceleratorType() {
     return acceleratorType;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java
index ca2a1a1e5e4e..73e1b8de267c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetAddressHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("address") && address != null) {
-      fieldMap.put("address", Collections.singletonList(String.valueOf(address)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("address")) {
-      return String.valueOf(address);
+      return address;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java
index c2f3d68b5372..6dce224ca63f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java
index 34d156febed3..cf2e28002930 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetBackendBucketHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendBucket") && backendBucket != null) {
-      fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendBucket")) {
-      return String.valueOf(backendBucket);
+      return backendBucket;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java
index 9341bbee372b..8d8ca9cbe9b4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java
index 6ad9763c7b67..3ed0f637b373 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java
index ae90dd62b439..dc59d19540bb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetDiskTypeHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("diskType") && diskType != null) {
-      fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("diskType")) {
-      return String.valueOf(diskType);
+      return diskType;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java
index 7c2ef0032da2..f7941097b523 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetFirewallHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("firewall") && firewall != null) {
-      fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("firewall")) {
-      return String.valueOf(firewall);
+      return firewall;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java
index 56699ab4db3a..72a30fbc8dda 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRule") && forwardingRule != null) {
-      fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRule")) {
-      return String.valueOf(forwardingRule);
+      return forwardingRule;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java
index 77c615dbaa89..cd3168370454 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetFromFamilyImageHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("family") && family != null) {
-      fieldMap.put("family", Collections.singletonList(String.valueOf(family)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("family")) {
-      return String.valueOf(family);
+      return family;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java
index aca1109f15d3..9939700d0fdf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetGlobalAddressHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("address") && address != null) {
-      fieldMap.put("address", Collections.singletonList(String.valueOf(address)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("address")) {
-      return String.valueOf(address);
+      return address;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java
index 3859ea6d568b..499754896dc9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetGlobalForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRule") && forwardingRule != null) {
-      fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRule")) {
-      return String.valueOf(forwardingRule);
+      return forwardingRule;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java
index 671ec05feb62..d324b7e0b662 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetGlobalOperationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("operation") && operation != null) {
-      fieldMap.put("operation", Collections.singletonList(String.valueOf(operation)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("operation")) {
-      return String.valueOf(operation);
+      return operation;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java
index fbebc8ba2fbb..de74c613666a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private GetHealthBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resourceGroupReferenceResource")
-        && resourceGroupReferenceResource != null) {
-      fieldMap.put(
-          "resourceGroupReferenceResource",
-          Collections.singletonList(String.valueOf(resourceGroupReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resourceGroupReferenceResource")) {
-      return String.valueOf(resourceGroupReferenceResource);
+      return resourceGroupReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public ResourceGroupReference getApiMessageRequestBody() {
     return resourceGroupReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java
index cc1198822080..f03de6e68a7a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("healthCheck") && healthCheck != null) {
-      fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("healthCheck")) {
-      return String.valueOf(healthCheck);
+      return healthCheck;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java
index 7a65116d9166..d2411b7e6995 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private GetHealthRegionBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resourceGroupReferenceResource")
-        && resourceGroupReferenceResource != null) {
-      fieldMap.put(
-          "resourceGroupReferenceResource",
-          Collections.singletonList(String.valueOf(resourceGroupReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resourceGroupReferenceResource")) {
-      return String.valueOf(resourceGroupReferenceResource);
+      return resourceGroupReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public ResourceGroupReference getApiMessageRequestBody() {
     return resourceGroupReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java
index 37fc9330ce5e..80adbde9767e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,68 +69,33 @@ private GetHealthTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceReferenceResource") && instanceReferenceResource != null) {
-      fieldMap.put(
-          "instanceReferenceResource",
-          Collections.singletonList(String.valueOf(instanceReferenceResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetPool") && targetPool != null) {
-      fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceReferenceResource")) {
-      return String.valueOf(instanceReferenceResource);
+      return instanceReferenceResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetPool")) {
-      return String.valueOf(targetPool);
+      return targetPool;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -145,6 +106,12 @@ public InstanceReference getApiMessageRequestBody() {
     return instanceReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java
index 56e4c1dfdf72..f15e79e68f9f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetHttpHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) {
-      fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpHealthCheck")) {
-      return String.valueOf(httpHealthCheck);
+      return httpHealthCheck;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java
index 2c552dcad757..0df43e72848f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetHttpsHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) {
-      fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpsHealthCheck")) {
-      return String.valueOf(httpsHealthCheck);
+      return httpsHealthCheck;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java
index 3d3bde96e1be..159c4c597af0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetImageHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("image") && image != null) {
-      fieldMap.put("image", Collections.singletonList(String.valueOf(image)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("image")) {
-      return String.valueOf(image);
+      return image;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java
index 4c13c2749ca6..a3ea3a0b3819 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java
index 5b8e5d2a6c08..1ec4366a7463 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,61 +65,30 @@ private GetInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java
index be3a9305efae..40609939618e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java
index f6fac3c4c386..6a605d45dd6d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetInstanceTemplateHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) {
-      fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceTemplate")) {
-      return String.valueOf(instanceTemplate);
+      return instanceTemplate;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java
index 18b251663554..6b32b78e607c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,62 +65,30 @@ private GetInterconnectAttachmentHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnectAttachment") && interconnectAttachment != null) {
-      fieldMap.put(
-          "interconnectAttachment",
-          Collections.singletonList(String.valueOf(interconnectAttachment)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnectAttachment")) {
-      return String.valueOf(interconnectAttachment);
+      return interconnectAttachment;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -135,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java
index 40467ffc4fa1..2c8ec025066d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetInterconnectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnect") && interconnect != null) {
-      fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnect")) {
-      return String.valueOf(interconnect);
+      return interconnect;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java
index d60b56dc3d3b..5c4f2c3d6990 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,61 +65,30 @@ private GetInterconnectLocationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnectLocation") && interconnectLocation != null) {
-      fieldMap.put(
-          "interconnectLocation", Collections.singletonList(String.valueOf(interconnectLocation)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnectLocation")) {
-      return String.valueOf(interconnectLocation);
+      return interconnectLocation;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java
index 5cb7a6f14f2e..34e074261a60 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetLicenseCodeHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("licenseCode") && licenseCode != null) {
-      fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("licenseCode")) {
-      return String.valueOf(licenseCode);
+      return licenseCode;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java
index af7142f32723..cb6cddb8ab7c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetLicenseHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("license") && license != null) {
-      fieldMap.put("license", Collections.singletonList(String.valueOf(license)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("license")) {
-      return String.valueOf(license);
+      return license;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java
index 751b2506dead..5af4426b2ed9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetMachineTypeHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("machineType") && machineType != null) {
-      fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("machineType")) {
-      return String.valueOf(machineType);
+      return machineType;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java
index 4aa9fe8fd792..6dbe5865035a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetNetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java
index f7aff07b6c3b..ea0958bef2a4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java
index 2a9ea9bae395..a7a2a7ab473c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java
index 69e9f7e76887..32dc24e1172b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java
index 0a9f807f127f..4e5eb300c90d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionCommitmentHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("commitment") && commitment != null) {
-      fieldMap.put("commitment", Collections.singletonList(String.valueOf(commitment)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("commitment")) {
-      return String.valueOf(commitment);
+      return commitment;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java
index e8e226455879..c3f4e636a34a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java
index 3cc8efec0f9a..f1a0ca9dcec6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionDiskTypeHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("diskType") && diskType != null) {
-      fieldMap.put("diskType", Collections.singletonList(String.valueOf(diskType)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("diskType")) {
-      return String.valueOf(diskType);
+      return diskType;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java
index 88050280800a..e6a53479cce3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java
index 7ff9e320f782..bd32752142b1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java
index 212d7e16382d..d53a58c42f46 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,61 +65,30 @@ private GetRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java
index e5bbdf3b129b..9354e73dc6c3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRegionOperationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("operation") && operation != null) {
-      fieldMap.put("operation", Collections.singletonList(String.valueOf(operation)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("operation")) {
-      return String.valueOf(operation);
+      return operation;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java
index 52f9b6cb4342..91f70cc51d78 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRouteHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("route") && route != null) {
-      fieldMap.put("route", Collections.singletonList(String.valueOf(route)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("route")) {
-      return String.valueOf(route);
+      return route;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java
index 0ce4cd7991a0..2da040ec96e3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java
index 161f201fe023..b359cd4020be 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetRouterStatusRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java
index 887cf3504e42..9ee831ed202b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private GetSerialPortOutputInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("start") && start != null) {
-      fieldMap.put("start", Collections.singletonList(String.valueOf(start)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("start")) {
-      return String.valueOf(start);
+      return start;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java
index 712e57a23357..5b0822171072 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetSnapshotHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("snapshot") && snapshot != null) {
-      fieldMap.put("snapshot", Collections.singletonList(String.valueOf(snapshot)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("snapshot")) {
-      return String.valueOf(snapshot);
+      return snapshot;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java
index 6a891e246f99..f5e8b0c99aa7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetSslCertificateHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("sslCertificate") && sslCertificate != null) {
-      fieldMap.put("sslCertificate", Collections.singletonList(String.valueOf(sslCertificate)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("sslCertificate")) {
-      return String.valueOf(sslCertificate);
+      return sslCertificate;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java
index d08405a2fbce..6e7dd8c3f033 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetSslPolicyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("sslPolicy") && sslPolicy != null) {
-      fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("sslPolicy")) {
-      return String.valueOf(sslPolicy);
+      return sslPolicy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java
index 6ef53c597515..32037a6780d0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetSubnetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java
index 1bbe06ba5a44..e62b679f239b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetHttpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) {
-      fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetHttpProxy")) {
-      return String.valueOf(targetHttpProxy);
+      return targetHttpProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java
index 44582e4c58e9..501ec52d64b2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetHttpsProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
-      fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetHttpsProxy")) {
-      return String.valueOf(targetHttpsProxy);
+      return targetHttpsProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java
index 89e81f5d6846..9ef98bb1b6d3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetInstance") && targetInstance != null) {
-      fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetInstance")) {
-      return String.valueOf(targetInstance);
+      return targetInstance;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java
index 7f75ff18a016..1b37944d89f9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetPool") && targetPool != null) {
-      fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetPool")) {
-      return String.valueOf(targetPool);
+      return targetPool;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java
index 5f5b29916400..547104a99a25 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
-      fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetSslProxy")) {
-      return String.valueOf(targetSslProxy);
+      return targetSslProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java
index 3f83752b1fd6..add3781e55d5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetTcpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
-      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetTcpProxy")) {
-      return String.valueOf(targetTcpProxy);
+      return targetTcpProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java
index a198980dc3cd..b37f4baf5e50 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetTargetVpnGatewayHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) {
-      fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("targetVpnGateway")) {
-      return String.valueOf(targetVpnGateway);
+      return targetVpnGateway;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java
index a81d5bea67ca..af52761d6aa8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java
index cd1792e0e4b5..ed991eda312e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetVpnTunnelHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("vpnTunnel") && vpnTunnel != null) {
-      fieldMap.put("vpnTunnel", Collections.singletonList(String.valueOf(vpnTunnel)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("vpnTunnel")) {
-      return String.valueOf(vpnTunnel);
+      return vpnTunnel;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java
index c36a0d8a2d34..f163158b66f4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetXpnHostProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java
index 049f445bd406..b053e307ed0c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private GetXpnResourcesProjectsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java
index 602b07ab97e2..3232d136a0d3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetZoneHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java
index d2f32e90abf6..bd5fd02a5146 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,60 +65,30 @@ private GetZoneOperationHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("operation") && operation != null) {
-      fieldMap.put("operation", Collections.singletonList(String.valueOf(operation)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("operation")) {
-      return String.valueOf(operation);
+      return operation;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -133,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java
index 931492de94d1..28567e8599c8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java
@@ -43,8 +43,7 @@
  * 
  * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
  *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
- *   String requestId = "";
- *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
+ *   Operation response = globalAddressClient.deleteGlobalAddress(address);
  * }
  * 
  * 
@@ -162,30 +161,19 @@ public GlobalAddressStub getStub() { *

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
-   *   String requestId = "";
-   *   Operation response = globalAddressClient.deleteGlobalAddress(address, requestId);
+   *   Operation response = globalAddressClient.deleteGlobalAddress(address);
    * }
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalAddress(ProjectGlobalAddressName address, String requestId) { + public final Operation deleteGlobalAddress(ProjectGlobalAddressName address) { DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder() .setAddress(address == null ? null : address.toString()) - .setRequestId(requestId) .build(); return deleteGlobalAddress(request); } @@ -199,31 +187,18 @@ public final Operation deleteGlobalAddress(ProjectGlobalAddressName address, Str *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
-   *   String requestId = "";
-   *   Operation response = globalAddressClient.deleteGlobalAddress(address.toString(), requestId);
+   *   Operation response = globalAddressClient.deleteGlobalAddress(address.toString());
    * }
    * 
* * @param address Name of the address resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalAddress(String address, String requestId) { + public final Operation deleteGlobalAddress(String address) { DeleteGlobalAddressHttpRequest request = - DeleteGlobalAddressHttpRequest.newBuilder() - .setAddress(address) - .setRequestId(requestId) - .build(); + DeleteGlobalAddressHttpRequest.newBuilder().setAddress(address).build(); return deleteGlobalAddress(request); } @@ -236,10 +211,8 @@ public final Operation deleteGlobalAddress(String address, String requestId) { *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
-   *   String requestId = "";
    *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = globalAddressClient.deleteGlobalAddress(request);
    * }
@@ -262,10 +235,8 @@ public final Operation deleteGlobalAddress(DeleteGlobalAddressHttpRequest reques
    * 

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
    *   ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]");
-   *   String requestId = "";
    *   DeleteGlobalAddressHttpRequest request = DeleteGlobalAddressHttpRequest.newBuilder()
    *     .setAddress(address.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = globalAddressClient.deleteGlobalAddressCallable().futureCall(request);
    *   // Do something
@@ -388,22 +359,12 @@ public final UnaryCallable getGlobalAddres
    *
    * 

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = globalAddressClient.insertGlobalAddress(requestId, project, addressResource);
+   *   Operation response = globalAddressClient.insertGlobalAddress(project, addressResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for @@ -411,12 +372,10 @@ public final UnaryCallable getGlobalAddres * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalAddress( - String requestId, ProjectName project, Address addressResource) { + public final Operation insertGlobalAddress(ProjectName project, Address addressResource) { InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setAddressResource(addressResource) .build(); @@ -431,22 +390,12 @@ public final Operation insertGlobalAddress( * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
-   *   Operation response = globalAddressClient.insertGlobalAddress(requestId, project.toString(), addressResource);
+   *   Operation response = globalAddressClient.insertGlobalAddress(project.toString(), addressResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (== * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for @@ -454,12 +403,10 @@ public final Operation insertGlobalAddress( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertGlobalAddress( - String requestId, String project, Address addressResource) { + public final Operation insertGlobalAddress(String project, Address addressResource) { InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setAddressResource(addressResource) .build(); @@ -474,11 +421,9 @@ public final Operation insertGlobalAddress( * *


    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setAddressResource(addressResource)
    *     .build();
@@ -502,11 +447,9 @@ public final Operation insertGlobalAddress(InsertGlobalAddressHttpRequest reques
    *
    * 

    * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Address addressResource = Address.newBuilder().build();
    *   InsertGlobalAddressHttpRequest request = InsertGlobalAddressHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setAddressResource(addressResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java
index b49565d4cae7..30a902acdfe2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
- *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
+ *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
  * }
  * 
  * 
@@ -162,31 +161,20 @@ public GlobalForwardingRuleStub getStub() { * *

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
-   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteGlobalForwardingRule( - String requestId, ProjectGlobalForwardingRuleName forwardingRule) { + ProjectGlobalForwardingRuleName forwardingRule) { DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .build(); return deleteGlobalForwardingRule(request); @@ -200,30 +188,19 @@ public final Operation deleteGlobalForwardingRule( * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
-   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule.toString());
+   *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteGlobalForwardingRule(String requestId, String forwardingRule) { + public final Operation deleteGlobalForwardingRule(String forwardingRule) { DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule) .build(); return deleteGlobalForwardingRule(request); @@ -237,10 +214,8 @@ public final Operation deleteGlobalForwardingRule(String requestId, String forwa * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(request);
@@ -263,10 +238,8 @@ public final Operation deleteGlobalForwardingRule(DeleteGlobalForwardingRuleHttp
    *
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .build();
    *   ApiFuture<Operation> future = globalForwardingRuleClient.deleteGlobalForwardingRuleCallable().futureCall(request);
@@ -393,22 +366,12 @@ public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpR
    *
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(requestId, project, forwardingRuleResource);
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(project, forwardingRuleResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies * which pool of target virtual machines to forward a packet to if it matches the given @@ -420,11 +383,10 @@ public final ForwardingRule getGlobalForwardingRule(GetGlobalForwardingRuleHttpR */ @BetaApi public final Operation insertGlobalForwardingRule( - String requestId, ProjectName project, ForwardingRule forwardingRuleResource) { + ProjectName project, ForwardingRule forwardingRuleResource) { InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -440,22 +402,12 @@ public final Operation insertGlobalForwardingRule( * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(requestId, project.toString(), forwardingRuleResource);
+   *   Operation response = globalForwardingRuleClient.insertGlobalForwardingRule(project.toString(), forwardingRuleResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param forwardingRuleResource A ForwardingRule resource. A ForwardingRule resource specifies * which pool of target virtual machines to forward a packet to if it matches the given @@ -467,11 +419,10 @@ public final Operation insertGlobalForwardingRule( */ @BetaApi public final Operation insertGlobalForwardingRule( - String requestId, String project, ForwardingRule forwardingRuleResource) { + String project, ForwardingRule forwardingRuleResource) { InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setForwardingRuleResource(forwardingRuleResource) .build(); @@ -487,11 +438,9 @@ public final Operation insertGlobalForwardingRule( * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -516,11 +465,9 @@ public final Operation insertGlobalForwardingRule(InsertGlobalForwardingRuleHttp
    *
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
    *   InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setForwardingRuleResource(forwardingRuleResource)
    *     .build();
@@ -685,35 +632,22 @@ public final ListGlobalForwardingRulesPagedResponse listGlobalForwardingRules(
    *
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource);
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetGlobalForwardingRule( - String requestId, - ProjectGlobalForwardingRuleName forwardingRule, - TargetReference targetReferenceResource) { + ProjectGlobalForwardingRuleName forwardingRule, TargetReference targetReferenceResource) { SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule == null ? null : forwardingRule.toString()) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -729,33 +663,22 @@ public final Operation setTargetGlobalForwardingRule( * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(requestId, forwardingRule.toString(), targetReferenceResource);
+   *   Operation response = globalForwardingRuleClient.setTargetGlobalForwardingRule(forwardingRule.toString(), targetReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forwardingRule Name of the ForwardingRule resource in which target is to be set. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetGlobalForwardingRule( - String requestId, String forwardingRule, TargetReference targetReferenceResource) { + String forwardingRule, TargetReference targetReferenceResource) { SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder() - .setRequestId(requestId) .setForwardingRule(forwardingRule) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -771,11 +694,9 @@ public final Operation setTargetGlobalForwardingRule( * *


    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
@@ -801,11 +722,9 @@ public final Operation setTargetGlobalForwardingRule(
    *
    * 

    * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetTargetGlobalForwardingRuleHttpRequest request = SetTargetGlobalForwardingRuleHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setForwardingRule(forwardingRule.toString())
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java
index dc6bf9e24a7c..3c1184f61e5f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +40,12 @@ private GlobalSetLabelsRequest(String labelFingerprint, Map labe
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     return null;
   }
@@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getLabelFingerprint() {
     return labelFingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java
index 081a717689cd..22ec52f78ce5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private GuestOsFeature(String type) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("type") && type != null) {
-      fieldMap.put("type", Collections.singletonList(String.valueOf(type)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("type")) {
+      return type;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("type")) {
-      return String.valueOf(type);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java
index 5ed8c553fd67..a7c925ef69ab 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -97,104 +93,51 @@ private HealthCheck(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) {
-      fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) {
-      fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold)));
-    }
-    if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) {
-      fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck)));
-    }
-    if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) {
-      fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sslHealthCheck") && sslHealthCheck != null) {
-      fieldMap.put("sslHealthCheck", Collections.singletonList(String.valueOf(sslHealthCheck)));
-    }
-    if (fieldNames.contains("tcpHealthCheck") && tcpHealthCheck != null) {
-      fieldMap.put("tcpHealthCheck", Collections.singletonList(String.valueOf(tcpHealthCheck)));
-    }
-    if (fieldNames.contains("timeoutSec") && timeoutSec != null) {
-      fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec)));
-    }
-    if (fieldNames.contains("type") && type != null) {
-      fieldMap.put("type", Collections.singletonList(String.valueOf(type)));
-    }
-    if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) {
-      fieldMap.put(
-          "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("checkIntervalSec")) {
-      return String.valueOf(checkIntervalSec);
+      return checkIntervalSec;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("healthyThreshold")) {
-      return String.valueOf(healthyThreshold);
+      return healthyThreshold;
     }
     if (fieldName.equals("httpHealthCheck")) {
-      return String.valueOf(httpHealthCheck);
+      return httpHealthCheck;
     }
     if (fieldName.equals("httpsHealthCheck")) {
-      return String.valueOf(httpsHealthCheck);
+      return httpsHealthCheck;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sslHealthCheck")) {
-      return String.valueOf(sslHealthCheck);
+      return sslHealthCheck;
     }
     if (fieldName.equals("tcpHealthCheck")) {
-      return String.valueOf(tcpHealthCheck);
+      return tcpHealthCheck;
     }
     if (fieldName.equals("timeoutSec")) {
-      return String.valueOf(timeoutSec);
+      return timeoutSec;
     }
     if (fieldName.equals("type")) {
-      return String.valueOf(type);
+      return type;
     }
     if (fieldName.equals("unhealthyThreshold")) {
-      return String.valueOf(unhealthyThreshold);
+      return unhealthyThreshold;
     }
     return null;
   }
@@ -205,6 +148,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getCheckIntervalSec() {
     return checkIntervalSec;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
index 907f7ad4ef94..ad9834baec92 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
- *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
+ *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
  * }
  * 
  * 
@@ -160,31 +159,19 @@ public HealthCheckStub getStub() { * *

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
-   *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
+   *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHealthCheck( - String requestId, ProjectGlobalHealthCheckName healthCheck) { + public final Operation deleteHealthCheck(ProjectGlobalHealthCheckName healthCheck) { DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) .build(); return deleteHealthCheck(request); @@ -198,32 +185,19 @@ public final Operation deleteHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
-   *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck.toString());
+   *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHealthCheck(String requestId, String healthCheck) { + public final Operation deleteHealthCheck(String healthCheck) { DeleteHealthCheckHttpRequest request = - DeleteHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHealthCheck(healthCheck) - .build(); + DeleteHealthCheckHttpRequest.newBuilder().setHealthCheck(healthCheck).build(); return deleteHealthCheck(request); } @@ -235,10 +209,8 @@ public final Operation deleteHealthCheck(String requestId, String healthCheck) { * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
    *   Operation response = healthCheckClient.deleteHealthCheck(request);
@@ -261,10 +233,8 @@ public final Operation deleteHealthCheck(DeleteHealthCheckHttpRequest request) {
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .build();
    *   ApiFuture<Operation> future = healthCheckClient.deleteHealthCheckCallable().futureCall(request);
@@ -387,22 +357,12 @@ public final UnaryCallable getHealthChec
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.insertHealthCheck(requestId, project, healthCheckResource);
+   *   Operation response = healthCheckClient.insertHealthCheck(project, healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how * individual virtual machines should be checked for health, via one of the supported @@ -410,12 +370,10 @@ public final UnaryCallable getHealthChec * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHealthCheck( - String requestId, ProjectName project, HealthCheck healthCheckResource) { + public final Operation insertHealthCheck(ProjectName project, HealthCheck healthCheckResource) { InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setHealthCheckResource(healthCheckResource) .build(); @@ -430,22 +388,12 @@ public final Operation insertHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.insertHealthCheck(requestId, project.toString(), healthCheckResource);
+   *   Operation response = healthCheckClient.insertHealthCheck(project.toString(), healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how * individual virtual machines should be checked for health, via one of the supported @@ -453,12 +401,10 @@ public final Operation insertHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertHealthCheck( - String requestId, String project, HealthCheck healthCheckResource) { + public final Operation insertHealthCheck(String project, HealthCheck healthCheckResource) { InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setHealthCheckResource(healthCheckResource) .build(); @@ -473,11 +419,9 @@ public final Operation insertHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -501,11 +445,9 @@ public final Operation insertHealthCheck(InsertHealthCheckHttpRequest request) {
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   InsertHealthCheckHttpRequest request = InsertHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -666,22 +608,12 @@ public final ListHealthChecksPagedResponse listHealthChecks(ListHealthChecksHttp
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck, healthCheckResource);
+   *   Operation response = healthCheckClient.patchHealthCheck(healthCheck, healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to patch. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how * individual virtual machines should be checked for health, via one of the supported @@ -690,11 +622,10 @@ public final ListHealthChecksPagedResponse listHealthChecks(ListHealthChecksHttp */ @BetaApi public final Operation patchHealthCheck( - String requestId, ProjectGlobalHealthCheckName healthCheck, HealthCheck healthCheckResource) { + ProjectGlobalHealthCheckName healthCheck, HealthCheck healthCheckResource) { PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) .setHealthCheckResource(healthCheckResource) .build(); @@ -710,22 +641,12 @@ public final Operation patchHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.patchHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
+   *   Operation response = healthCheckClient.patchHealthCheck(healthCheck.toString(), healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to patch. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how * individual virtual machines should be checked for health, via one of the supported @@ -733,12 +654,10 @@ public final Operation patchHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchHealthCheck( - String requestId, String healthCheck, HealthCheck healthCheckResource) { + public final Operation patchHealthCheck(String healthCheck, HealthCheck healthCheckResource) { PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHealthCheck(healthCheck) .setHealthCheckResource(healthCheckResource) .build(); @@ -754,11 +673,9 @@ public final Operation patchHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -783,11 +700,9 @@ public final Operation patchHealthCheck(PatchHealthCheckHttpRequest request) {
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   PatchHealthCheckHttpRequest request = PatchHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -810,22 +725,12 @@ public final UnaryCallable patchHealthCh
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck, healthCheckResource);
+   *   Operation response = healthCheckClient.updateHealthCheck(healthCheck, healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to update. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how * individual virtual machines should be checked for health, via one of the supported @@ -834,11 +739,10 @@ public final UnaryCallable patchHealthCh */ @BetaApi public final Operation updateHealthCheck( - String requestId, ProjectGlobalHealthCheckName healthCheck, HealthCheck healthCheckResource) { + ProjectGlobalHealthCheckName healthCheck, HealthCheck healthCheckResource) { UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHealthCheck(healthCheck == null ? null : healthCheck.toString()) .setHealthCheckResource(healthCheckResource) .build(); @@ -853,22 +757,12 @@ public final Operation updateHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
-   *   Operation response = healthCheckClient.updateHealthCheck(requestId, healthCheck.toString(), healthCheckResource);
+   *   Operation response = healthCheckClient.updateHealthCheck(healthCheck.toString(), healthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param healthCheck Name of the HealthCheck resource to update. * @param healthCheckResource An HealthCheck resource. This resource defines a template for how * individual virtual machines should be checked for health, via one of the supported @@ -876,12 +770,10 @@ public final Operation updateHealthCheck( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateHealthCheck( - String requestId, String healthCheck, HealthCheck healthCheckResource) { + public final Operation updateHealthCheck(String healthCheck, HealthCheck healthCheckResource) { UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHealthCheck(healthCheck) .setHealthCheckResource(healthCheckResource) .build(); @@ -896,11 +788,9 @@ public final Operation updateHealthCheck( * *


    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
@@ -924,11 +814,9 @@ public final Operation updateHealthCheck(UpdateHealthCheckHttpRequest request) {
    *
    * 

    * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
    *   HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
    *   UpdateHealthCheckHttpRequest request = UpdateHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHealthCheck(healthCheck.toString())
    *     .setHealthCheckResource(healthCheckResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
index c65a4b4bde8a..aaab7be4b2a1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private HealthCheckList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HealthCheck item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java
index fb7cd5b85d53..a32982dbe395 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private HealthCheckReference(String healthCheck) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("healthCheck") && healthCheck != null) {
-      fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("healthCheck")) {
+      return healthCheck;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("healthCheck")) {
-      return String.valueOf(healthCheck);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java
index b31d9a53e69a..b70aabb2e31e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -49,36 +45,18 @@ private HealthStatus(String healthState, String instance, String ipAddress, Inte
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("healthState") && healthState != null) {
-      fieldMap.put("healthState", Collections.singletonList(String.valueOf(healthState)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("ipAddress") && ipAddress != null) {
-      fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("healthState")) {
-      return String.valueOf(healthState);
+      return healthState;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("ipAddress")) {
-      return String.valueOf(ipAddress);
+      return ipAddress;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     return null;
   }
@@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getHealthState() {
     return healthState;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java
index 7e814efe1324..42e8e9b62bb0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -48,34 +43,15 @@ private HostRule(String description, List hosts, String pathMatcher) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("hosts") && hosts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : hosts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("hosts", stringList.build());
-    }
-    if (fieldNames.contains("pathMatcher") && pathMatcher != null) {
-      fieldMap.put("pathMatcher", Collections.singletonList(String.valueOf(pathMatcher)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("hosts")) {
-      return String.valueOf(hosts);
+      return hosts;
     }
     if (fieldName.equals("pathMatcher")) {
-      return String.valueOf(pathMatcher);
+      return pathMatcher;
     }
     return null;
   }
@@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDescription() {
     return description;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java
index cc37dbe6a9a9..d9cf64e2df11 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private HttpHealthCheck(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("portName") && portName != null) {
-      fieldMap.put("portName", Collections.singletonList(String.valueOf(portName)));
-    }
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
-    }
-    if (fieldNames.contains("requestPath") && requestPath != null) {
-      fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("portName")) {
-      return String.valueOf(portName);
+      return portName;
     }
     if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
+      return proxyHeader;
     }
     if (fieldName.equals("requestPath")) {
-      return String.valueOf(requestPath);
+      return requestPath;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getHost() {
     return host;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java
index 21ef5d6e7db1..315a881cebd4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -89,92 +85,45 @@ private HttpHealthCheck2(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) {
-      fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) {
-      fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold)));
-    }
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("requestPath") && requestPath != null) {
-      fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("timeoutSec") && timeoutSec != null) {
-      fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec)));
-    }
-    if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) {
-      fieldMap.put(
-          "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("checkIntervalSec")) {
-      return String.valueOf(checkIntervalSec);
+      return checkIntervalSec;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("healthyThreshold")) {
-      return String.valueOf(healthyThreshold);
+      return healthyThreshold;
     }
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("requestPath")) {
-      return String.valueOf(requestPath);
+      return requestPath;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("timeoutSec")) {
-      return String.valueOf(timeoutSec);
+      return timeoutSec;
     }
     if (fieldName.equals("unhealthyThreshold")) {
-      return String.valueOf(unhealthyThreshold);
+      return unhealthyThreshold;
     }
     return null;
   }
@@ -185,6 +134,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getCheckIntervalSec() {
     return checkIntervalSec;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
index a46f3f547e6d..a73efe768568 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
- *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
+ *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
  * }
  * 
  * 
@@ -162,31 +161,19 @@ public HttpHealthCheckStub getStub() { * *

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpHealthCheck( - String requestId, ProjectGlobalHttpHealthCheckName httpHealthCheck) { + public final Operation deleteHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck) { DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) .build(); return deleteHttpHealthCheck(request); @@ -200,32 +187,19 @@ public final Operation deleteHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
-   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck.toString());
+   *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpHealthCheck(String requestId, String httpHealthCheck) { + public final Operation deleteHttpHealthCheck(String httpHealthCheck) { DeleteHttpHealthCheckHttpRequest request = - DeleteHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) - .setHttpHealthCheck(httpHealthCheck) - .build(); + DeleteHttpHealthCheckHttpRequest.newBuilder().setHttpHealthCheck(httpHealthCheck).build(); return deleteHttpHealthCheck(request); } @@ -237,10 +211,8 @@ public final Operation deleteHttpHealthCheck(String requestId, String httpHealth * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
    *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(request);
@@ -263,10 +235,8 @@ public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest re
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .build();
    *   ApiFuture<Operation> future = httpHealthCheckClient.deleteHttpHealthCheckCallable().futureCall(request);
@@ -393,22 +363,12 @@ public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest r
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project, httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(project, httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTP. @@ -416,11 +376,10 @@ public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest r */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, ProjectName project, HttpHealthCheck2 httpHealthCheckResource) { + ProjectName project, HttpHealthCheck2 httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -436,22 +395,12 @@ public final Operation insertHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(requestId, project.toString(), httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.insertHttpHealthCheck(project.toString(), httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTP. @@ -459,11 +408,10 @@ public final Operation insertHttpHealthCheck( */ @BetaApi public final Operation insertHttpHealthCheck( - String requestId, String project, HttpHealthCheck2 httpHealthCheckResource) { + String project, HttpHealthCheck2 httpHealthCheckResource) { InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -479,11 +427,9 @@ public final Operation insertHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -508,11 +454,9 @@ public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest re
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -676,22 +620,12 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks(
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTP. @@ -699,13 +633,10 @@ public final ListHttpHealthChecksPagedResponse listHttpHealthChecks( */ @BetaApi public final Operation patchHttpHealthCheck( - String requestId, - ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck2 httpHealthCheckResource) { + ProjectGlobalHttpHealthCheckName httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -722,22 +653,12 @@ public final Operation patchHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to patch. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTP. @@ -745,11 +666,10 @@ public final Operation patchHttpHealthCheck( */ @BetaApi public final Operation patchHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { + String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -766,11 +686,9 @@ public final Operation patchHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -796,11 +714,9 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -825,22 +741,12 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to update. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTP. @@ -848,13 +754,10 @@ public final Operation patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest requ */ @BetaApi public final Operation updateHttpHealthCheck( - String requestId, - ProjectGlobalHttpHealthCheckName httpHealthCheck, - HttpHealthCheck2 httpHealthCheckResource) { + ProjectGlobalHttpHealthCheckName httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck == null ? null : httpHealthCheck.toString()) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -870,22 +773,12 @@ public final Operation updateHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
-   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(requestId, httpHealthCheck.toString(), httpHealthCheckResource);
+   *   Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpHealthCheck Name of the HttpHealthCheck resource to update. * @param httpHealthCheckResource An HttpHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTP. @@ -893,11 +786,10 @@ public final Operation updateHttpHealthCheck( */ @BetaApi public final Operation updateHttpHealthCheck( - String requestId, String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { + String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource) { UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setHttpHealthCheck(httpHealthCheck) .setHttpHealthCheckResource(httpHealthCheckResource) .build(); @@ -913,11 +805,9 @@ public final Operation updateHttpHealthCheck( * *


    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
@@ -942,11 +832,9 @@ public final Operation updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest re
    *
    * 

    * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
    *   HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
    *   UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setHttpHealthCheck(httpHealthCheck.toString())
    *     .setHttpHealthCheckResource(httpHealthCheckResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java
index 41c505c42162..9daa88ffc761 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private HttpHealthCheckList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HttpHealthCheck2 item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java
index d50cb331244c..3631367073bd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private HttpSHealthCheck(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("portName") && portName != null) {
-      fieldMap.put("portName", Collections.singletonList(String.valueOf(portName)));
-    }
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
-    }
-    if (fieldNames.contains("requestPath") && requestPath != null) {
-      fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("portName")) {
-      return String.valueOf(portName);
+      return portName;
     }
     if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
+      return proxyHeader;
     }
     if (fieldName.equals("requestPath")) {
-      return String.valueOf(requestPath);
+      return requestPath;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getHost() {
     return host;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java
index 4523dfd5f2db..704fe75934c8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -89,92 +85,45 @@ private HttpsHealthCheck2(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("checkIntervalSec") && checkIntervalSec != null) {
-      fieldMap.put("checkIntervalSec", Collections.singletonList(String.valueOf(checkIntervalSec)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("healthyThreshold") && healthyThreshold != null) {
-      fieldMap.put("healthyThreshold", Collections.singletonList(String.valueOf(healthyThreshold)));
-    }
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("requestPath") && requestPath != null) {
-      fieldMap.put("requestPath", Collections.singletonList(String.valueOf(requestPath)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("timeoutSec") && timeoutSec != null) {
-      fieldMap.put("timeoutSec", Collections.singletonList(String.valueOf(timeoutSec)));
-    }
-    if (fieldNames.contains("unhealthyThreshold") && unhealthyThreshold != null) {
-      fieldMap.put(
-          "unhealthyThreshold", Collections.singletonList(String.valueOf(unhealthyThreshold)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("checkIntervalSec")) {
-      return String.valueOf(checkIntervalSec);
+      return checkIntervalSec;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("healthyThreshold")) {
-      return String.valueOf(healthyThreshold);
+      return healthyThreshold;
     }
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("requestPath")) {
-      return String.valueOf(requestPath);
+      return requestPath;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("timeoutSec")) {
-      return String.valueOf(timeoutSec);
+      return timeoutSec;
     }
     if (fieldName.equals("unhealthyThreshold")) {
-      return String.valueOf(unhealthyThreshold);
+      return unhealthyThreshold;
     }
     return null;
   }
@@ -185,6 +134,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getCheckIntervalSec() {
     return checkIntervalSec;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
index 29569f3e5e58..d400dbc49faf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java
@@ -43,8 +43,7 @@
  * 
  * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
  *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
- *   String requestId = "";
- *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
+ *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
  * }
  * 
  * 
@@ -163,31 +162,20 @@ public HttpsHealthCheckStub getStub() { *

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
-   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId);
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteHttpsHealthCheck( - ProjectGlobalHttpsHealthCheckName httpsHealthCheck, String requestId) { + ProjectGlobalHttpsHealthCheckName httpsHealthCheck) { DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .setRequestId(requestId) .build(); return deleteHttpsHealthCheck(request); } @@ -201,30 +189,19 @@ public final Operation deleteHttpsHealthCheck( *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
-   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString(), requestId);
+   *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString());
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteHttpsHealthCheck(String httpsHealthCheck, String requestId) { + public final Operation deleteHttpsHealthCheck(String httpsHealthCheck) { DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck) - .setRequestId(requestId) .build(); return deleteHttpsHealthCheck(request); } @@ -238,10 +215,8 @@ public final Operation deleteHttpsHealthCheck(String httpsHealthCheck, String re *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(request);
    * }
@@ -264,10 +239,8 @@ public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = httpsHealthCheckClient.deleteHttpsHealthCheckCallable().futureCall(request);
    *   // Do something
@@ -393,22 +366,12 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpReques
    *
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project, httpsHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTPS. @@ -416,11 +379,10 @@ public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpReques */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, ProjectName project, HttpsHealthCheck2 httpsHealthCheckResource) { + ProjectName project, HttpsHealthCheck2 httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); @@ -436,22 +398,12 @@ public final Operation insertHttpsHealthCheck( * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(requestId, project.toString(), httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project.toString(), httpsHealthCheckResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTPS. @@ -459,11 +411,10 @@ public final Operation insertHttpsHealthCheck( */ @BetaApi public final Operation insertHttpsHealthCheck( - String requestId, String project, HttpsHealthCheck2 httpsHealthCheckResource) { + String project, HttpsHealthCheck2 httpsHealthCheckResource) { InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); @@ -479,11 +430,9 @@ public final Operation insertHttpsHealthCheck( * *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
@@ -508,11 +457,9 @@ public final Operation insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest
    *
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
@@ -677,22 +624,12 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -700,13 +637,11 @@ public final ListHttpsHealthChecksPagedResponse listHttpsHealthChecks( @BetaApi public final Operation patchHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, - String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return patchHttpsHealthCheck(request); @@ -723,34 +658,23 @@ public final Operation patchHttpsHealthCheck( *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation patchHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { + String httpsHealthCheck, HttpsHealthCheck2 httpsHealthCheckResource) { PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck) - .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return patchHttpsHealthCheck(request); @@ -767,11 +691,9 @@ public final Operation patchHttpsHealthCheck( *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
-   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(request);
@@ -797,11 +719,9 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
-   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   ApiFuture<Operation> future = httpsHealthCheckClient.patchHttpsHealthCheckCallable().futureCall(request);
@@ -826,22 +746,12 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -849,13 +759,11 @@ public final Operation patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest re @BetaApi public final Operation updateHttpsHealthCheck( ProjectGlobalHttpsHealthCheckName httpsHealthCheck, - String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck == null ? null : httpsHealthCheck.toString()) - .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return updateHttpsHealthCheck(request); @@ -871,34 +779,23 @@ public final Operation updateHttpsHealthCheck( *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
-   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), requestId, httpsHealthCheckResource);
+   *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource);
    * }
    * 
* * @param httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param httpsHealthCheckResource An HttpsHealthCheck resource. This resource defines a template * for how individual instances should be checked for health, via HTTPS. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation updateHttpsHealthCheck( - String httpsHealthCheck, String requestId, HttpsHealthCheck2 httpsHealthCheckResource) { + String httpsHealthCheck, HttpsHealthCheck2 httpsHealthCheckResource) { UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder() .setHttpsHealthCheck(httpsHealthCheck) - .setRequestId(requestId) .setHttpsHealthCheckResource(httpsHealthCheckResource) .build(); return updateHttpsHealthCheck(request); @@ -914,11 +811,9 @@ public final Operation updateHttpsHealthCheck( *


    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
-   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(request);
@@ -943,11 +838,9 @@ public final Operation updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest
    * 

    * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
    *   ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
-   *   String requestId = "";
    *   HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
    *   UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
    *     .setHttpsHealthCheck(httpsHealthCheck.toString())
-   *     .setRequestId(requestId)
    *     .setHttpsHealthCheckResource(httpsHealthCheckResource)
    *     .build();
    *   ApiFuture<Operation> future = httpsHealthCheckClient.updateHttpsHealthCheckCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java
index f238d2e334c3..8f27fd034a82 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private HttpsHealthCheckList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HttpsHealthCheck2 item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java
index 12d4d8d3e135..293e38cf15ea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java
@@ -17,14 +17,10 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -151,200 +147,90 @@ private Image(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("archiveSizeBytes") && archiveSizeBytes != null) {
-      fieldMap.put("archiveSizeBytes", Collections.singletonList(String.valueOf(archiveSizeBytes)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("deprecated") && deprecated != null) {
-      fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) {
-      fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb)));
-    }
-    if (fieldNames.contains("family") && family != null) {
-      fieldMap.put("family", Collections.singletonList(String.valueOf(family)));
-    }
-    if (fieldNames.contains("guestOsFeatures") && guestOsFeatures != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (GuestOsFeature item : guestOsFeatures) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("guestOsFeatures", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("imageEncryptionKey") && imageEncryptionKey != null) {
-      fieldMap.put(
-          "imageEncryptionKey", Collections.singletonList(String.valueOf(imageEncryptionKey)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    if (fieldNames.contains("licenseCodes") && licenseCodes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : licenseCodes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenseCodes", stringList.build());
-    }
-    if (fieldNames.contains("licenses") && licenses != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : licenses) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenses", stringList.build());
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("rawDisk") && rawDisk != null) {
-      fieldMap.put("rawDisk", Collections.singletonList(String.valueOf(rawDisk)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sourceDisk") && sourceDisk != null) {
-      fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk)));
-    }
-    if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) {
-      fieldMap.put(
-          "sourceDiskEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceDiskEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) {
-      fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId)));
-    }
-    if (fieldNames.contains("sourceImage") && sourceImage != null) {
-      fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage)));
-    }
-    if (fieldNames.contains("sourceImageEncryptionKey") && sourceImageEncryptionKey != null) {
-      fieldMap.put(
-          "sourceImageEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceImageEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceImageId") && sourceImageId != null) {
-      fieldMap.put("sourceImageId", Collections.singletonList(String.valueOf(sourceImageId)));
-    }
-    if (fieldNames.contains("sourceSnapshot") && sourceSnapshot != null) {
-      fieldMap.put("sourceSnapshot", Collections.singletonList(String.valueOf(sourceSnapshot)));
-    }
-    if (fieldNames.contains("sourceSnapshotEncryptionKey") && sourceSnapshotEncryptionKey != null) {
-      fieldMap.put(
-          "sourceSnapshotEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceSnapshotEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceSnapshotId") && sourceSnapshotId != null) {
-      fieldMap.put("sourceSnapshotId", Collections.singletonList(String.valueOf(sourceSnapshotId)));
-    }
-    if (fieldNames.contains("sourceType") && sourceType != null) {
-      fieldMap.put("sourceType", Collections.singletonList(String.valueOf(sourceType)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("archiveSizeBytes")) {
-      return String.valueOf(archiveSizeBytes);
+      return archiveSizeBytes;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("deprecated")) {
-      return String.valueOf(deprecated);
+      return deprecated;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("diskSizeGb")) {
-      return String.valueOf(diskSizeGb);
+      return diskSizeGb;
     }
     if (fieldName.equals("family")) {
-      return String.valueOf(family);
+      return family;
     }
     if (fieldName.equals("guestOsFeatures")) {
-      return String.valueOf(guestOsFeatures);
+      return guestOsFeatures;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("imageEncryptionKey")) {
-      return String.valueOf(imageEncryptionKey);
+      return imageEncryptionKey;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     if (fieldName.equals("licenseCodes")) {
-      return String.valueOf(licenseCodes);
+      return licenseCodes;
     }
     if (fieldName.equals("licenses")) {
-      return String.valueOf(licenses);
+      return licenses;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("rawDisk")) {
-      return String.valueOf(rawDisk);
+      return rawDisk;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sourceDisk")) {
-      return String.valueOf(sourceDisk);
+      return sourceDisk;
     }
     if (fieldName.equals("sourceDiskEncryptionKey")) {
-      return String.valueOf(sourceDiskEncryptionKey);
+      return sourceDiskEncryptionKey;
     }
     if (fieldName.equals("sourceDiskId")) {
-      return String.valueOf(sourceDiskId);
+      return sourceDiskId;
     }
     if (fieldName.equals("sourceImage")) {
-      return String.valueOf(sourceImage);
+      return sourceImage;
     }
     if (fieldName.equals("sourceImageEncryptionKey")) {
-      return String.valueOf(sourceImageEncryptionKey);
+      return sourceImageEncryptionKey;
     }
     if (fieldName.equals("sourceImageId")) {
-      return String.valueOf(sourceImageId);
+      return sourceImageId;
     }
     if (fieldName.equals("sourceSnapshot")) {
-      return String.valueOf(sourceSnapshot);
+      return sourceSnapshot;
     }
     if (fieldName.equals("sourceSnapshotEncryptionKey")) {
-      return String.valueOf(sourceSnapshotEncryptionKey);
+      return sourceSnapshotEncryptionKey;
     }
     if (fieldName.equals("sourceSnapshotId")) {
-      return String.valueOf(sourceSnapshotId);
+      return sourceSnapshotId;
     }
     if (fieldName.equals("sourceType")) {
-      return String.valueOf(sourceType);
+      return sourceType;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     return null;
   }
@@ -355,6 +241,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getArchiveSizeBytes() {
     return archiveSizeBytes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
index a67b90090b25..040311711301 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java
@@ -43,8 +43,7 @@
  * 
  * try (ImageClient imageClient = ImageClient.create()) {
  *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
- *   String requestId = "";
- *   Operation response = imageClient.deleteImage(image, requestId);
+ *   Operation response = imageClient.deleteImage(image);
  * }
  * 
  * 
@@ -160,30 +159,19 @@ public ImageStub getStub() { *

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
-   *   Operation response = imageClient.deleteImage(image, requestId);
+   *   Operation response = imageClient.deleteImage(image);
    * }
    * 
* * @param image Name of the image resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteImage(ProjectGlobalImageName image, String requestId) { + public final Operation deleteImage(ProjectGlobalImageName image) { DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder() .setImage(image == null ? null : image.toString()) - .setRequestId(requestId) .build(); return deleteImage(request); } @@ -197,28 +185,17 @@ public final Operation deleteImage(ProjectGlobalImageName image, String requestI *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
-   *   Operation response = imageClient.deleteImage(image.toString(), requestId);
+   *   Operation response = imageClient.deleteImage(image.toString());
    * }
    * 
* * @param image Name of the image resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteImage(String image, String requestId) { + public final Operation deleteImage(String image) { - DeleteImageHttpRequest request = - DeleteImageHttpRequest.newBuilder().setImage(image).setRequestId(requestId).build(); + DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder().setImage(image).build(); return deleteImage(request); } @@ -231,10 +208,8 @@ public final Operation deleteImage(String image, String requestId) { *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = imageClient.deleteImage(request);
    * }
@@ -257,10 +232,8 @@ public final Operation deleteImage(DeleteImageHttpRequest request) {
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
    *   DeleteImageHttpRequest request = DeleteImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = imageClient.deleteImageCallable().futureCall(request);
    *   // Do something
@@ -284,33 +257,22 @@ public final UnaryCallable deleteImageCallabl
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
-   *   Operation response = imageClient.deprecateImage(image, requestId, deprecationStatusResource);
+   *   Operation response = imageClient.deprecateImage(image, deprecationStatusResource);
    * }
    * 
* * @param image Image name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param deprecationStatusResource Deprecation status for a public resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deprecateImage( - ProjectGlobalImageName image, String requestId, DeprecationStatus deprecationStatusResource) { + ProjectGlobalImageName image, DeprecationStatus deprecationStatusResource) { DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder() .setImage(image == null ? null : image.toString()) - .setRequestId(requestId) .setDeprecationStatusResource(deprecationStatusResource) .build(); return deprecateImage(request); @@ -327,33 +289,21 @@ public final Operation deprecateImage( *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
-   *   Operation response = imageClient.deprecateImage(image.toString(), requestId, deprecationStatusResource);
+   *   Operation response = imageClient.deprecateImage(image.toString(), deprecationStatusResource);
    * }
    * 
* * @param image Image name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param deprecationStatusResource Deprecation status for a public resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deprecateImage( - String image, String requestId, DeprecationStatus deprecationStatusResource) { + public final Operation deprecateImage(String image, DeprecationStatus deprecationStatusResource) { DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder() .setImage(image) - .setRequestId(requestId) .setDeprecationStatusResource(deprecationStatusResource) .build(); return deprecateImage(request); @@ -370,11 +320,9 @@ public final Operation deprecateImage( *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
-   *     .setRequestId(requestId)
    *     .setDeprecationStatusResource(deprecationStatusResource)
    *     .build();
    *   Operation response = imageClient.deprecateImage(request);
@@ -400,11 +348,9 @@ public final Operation deprecateImage(DeprecateImageHttpRequest request) {
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
-   *   String requestId = "";
    *   DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build();
    *   DeprecateImageHttpRequest request = DeprecateImageHttpRequest.newBuilder()
    *     .setImage(image.toString())
-   *     .setRequestId(requestId)
    *     .setDeprecationStatusResource(deprecationStatusResource)
    *     .build();
    *   ApiFuture<Operation> future = imageClient.deprecateImageCallable().futureCall(request);
@@ -618,23 +564,13 @@ public final UnaryCallable getFromFamilyIm
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
-   *   Operation response = imageClient.insertImage(forceCreate, requestId, project, imageResource);
+   *   Operation response = imageClient.insertImage(forceCreate, project, imageResource);
    * }
    * 
* * @param forceCreate Force image creation if true. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for * v1.images ==) @@ -642,12 +578,11 @@ public final UnaryCallable getFromFamilyIm */ @BetaApi public final Operation insertImage( - Boolean forceCreate, String requestId, ProjectName project, Image imageResource) { + Boolean forceCreate, ProjectName project, Image imageResource) { InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder() .setForceCreate(forceCreate) - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setImageResource(imageResource) .build(); @@ -663,36 +598,24 @@ public final Operation insertImage( *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
-   *   Operation response = imageClient.insertImage(forceCreate, requestId, project.toString(), imageResource);
+   *   Operation response = imageClient.insertImage(forceCreate, project.toString(), imageResource);
    * }
    * 
* * @param forceCreate Force image creation if true. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param imageResource An Image resource. (== resource_for beta.images ==) (== resource_for * v1.images ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertImage( - Boolean forceCreate, String requestId, String project, Image imageResource) { + public final Operation insertImage(Boolean forceCreate, String project, Image imageResource) { InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder() .setForceCreate(forceCreate) - .setRequestId(requestId) .setProject(project) .setImageResource(imageResource) .build(); @@ -708,12 +631,10 @@ public final Operation insertImage( *


    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
    *   InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder()
    *     .setForceCreate(forceCreate)
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setImageResource(imageResource)
    *     .build();
@@ -738,12 +659,10 @@ public final Operation insertImage(InsertImageHttpRequest request) {
    * 

    * try (ImageClient imageClient = ImageClient.create()) {
    *   Boolean forceCreate = false;
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Image imageResource = Image.newBuilder().build();
    *   InsertImageHttpRequest request = InsertImageHttpRequest.newBuilder()
    *     .setForceCreate(forceCreate)
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setImageResource(imageResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java
index 8fa51eaa64e3..db11170a78d4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private ImageList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Image item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java
index ea752693f8d2..44854ff6fb49 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertAddressHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("addressResource") && addressResource != null) {
-      fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("addressResource")) {
-      return String.valueOf(addressResource);
+      return addressResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Address getApiMessageRequestBody() {
     return addressResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java
index 6a96da87124d..3d82ab72a020 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) {
-      fieldMap.put(
-          "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscalerResource")) {
-      return String.valueOf(autoscalerResource);
+      return autoscalerResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public Autoscaler getApiMessageRequestBody() {
     return autoscalerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java
index 42c4e361e50b..f2416257483e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertBackendBucketHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) {
-      fieldMap.put(
-          "backendBucketResource",
-          Collections.singletonList(String.valueOf(backendBucketResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendBucketResource")) {
-      return String.valueOf(backendBucketResource);
+      return backendBucketResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public BackendBucket getApiMessageRequestBody() {
     return backendBucketResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java
index 42fcd7be40a2..7bdaa1185c4f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) {
-      fieldMap.put(
-          "backendServiceResource",
-          Collections.singletonList(String.valueOf(backendServiceResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendServiceResource")) {
-      return String.valueOf(backendServiceResource);
+      return backendServiceResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() {
     return backendServiceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java
index 3b1b60e75f6d..aa60ae6b958c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,78 +77,39 @@ private InsertDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("diskResource") && diskResource != null) {
-      fieldMap.put("diskResource", Collections.singletonList(String.valueOf(diskResource)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sourceImage") && sourceImage != null) {
-      fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("diskResource")) {
-      return String.valueOf(diskResource);
+      return diskResource;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sourceImage")) {
-      return String.valueOf(sourceImage);
+      return sourceImage;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -163,6 +120,12 @@ public Disk getApiMessageRequestBody() {
     return diskResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java
index 83dc075807f0..b3894dc14e7d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertFirewallHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("firewallResource") && firewallResource != null) {
-      fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("firewallResource")) {
-      return String.valueOf(firewallResource);
+      return firewallResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Firewall getApiMessageRequestBody() {
     return firewallResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java
index b19b538ab343..5ac102ea2b9d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) {
-      fieldMap.put(
-          "forwardingRuleResource",
-          Collections.singletonList(String.valueOf(forwardingRuleResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRuleResource")) {
-      return String.valueOf(forwardingRuleResource);
+      return forwardingRuleResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public ForwardingRule getApiMessageRequestBody() {
     return forwardingRuleResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java
index eabad11cacd9..8494ba87d2b7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertGlobalAddressHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("addressResource") && addressResource != null) {
-      fieldMap.put("addressResource", Collections.singletonList(String.valueOf(addressResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("addressResource")) {
-      return String.valueOf(addressResource);
+      return addressResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Address getApiMessageRequestBody() {
     return addressResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java
index 88c75c705ec6..ffc889f6a054 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertGlobalForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRuleResource") && forwardingRuleResource != null) {
-      fieldMap.put(
-          "forwardingRuleResource",
-          Collections.singletonList(String.valueOf(forwardingRuleResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRuleResource")) {
-      return String.valueOf(forwardingRuleResource);
+      return forwardingRuleResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public ForwardingRule getApiMessageRequestBody() {
     return forwardingRuleResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java
index 54634df42917..e49d8f2d47b7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) {
-      fieldMap.put(
-          "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("healthCheckResource")) {
-      return String.valueOf(healthCheckResource);
+      return healthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public HealthCheck getApiMessageRequestBody() {
     return healthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java
index 2d8878494a2e..aa6e4e2dbc5d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertHttpHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) {
-      fieldMap.put(
-          "httpHealthCheckResource",
-          Collections.singletonList(String.valueOf(httpHealthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpHealthCheckResource")) {
-      return String.valueOf(httpHealthCheckResource);
+      return httpHealthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public HttpHealthCheck2 getApiMessageRequestBody() {
     return httpHealthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java
index 5be147a7e9ea..64ebaef619e6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertHttpsHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) {
-      fieldMap.put(
-          "httpsHealthCheckResource",
-          Collections.singletonList(String.valueOf(httpsHealthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpsHealthCheckResource")) {
-      return String.valueOf(httpsHealthCheckResource);
+      return httpsHealthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public HttpsHealthCheck2 getApiMessageRequestBody() {
     return httpsHealthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java
index 85e548a840ff..fc5fe51b948b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,78 +77,39 @@ private InsertImageHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forceCreate") && forceCreate != null) {
-      fieldMap.put("forceCreate", Collections.singletonList(String.valueOf(forceCreate)));
-    }
-    if (fieldNames.contains("imageResource") && imageResource != null) {
-      fieldMap.put("imageResource", Collections.singletonList(String.valueOf(imageResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forceCreate")) {
-      return String.valueOf(forceCreate);
+      return forceCreate;
     }
     if (fieldName.equals("imageResource")) {
-      return String.valueOf(imageResource);
+      return imageResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -163,6 +120,12 @@ public Image getApiMessageRequestBody() {
     return imageResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java
index e164d6cae1b2..31d5d8febca0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupResource") && instanceGroupResource != null) {
-      fieldMap.put(
-          "instanceGroupResource",
-          Collections.singletonList(String.valueOf(instanceGroupResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupResource")) {
-      return String.valueOf(instanceGroupResource);
+      return instanceGroupResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public InstanceGroup getApiMessageRequestBody() {
     return instanceGroupResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java
index 57a03d1b5920..869aeaa40d7d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private InsertInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManagerResource")
-        && instanceGroupManagerResource != null) {
-      fieldMap.put(
-          "instanceGroupManagerResource",
-          Collections.singletonList(String.valueOf(instanceGroupManagerResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManagerResource")) {
-      return String.valueOf(instanceGroupManagerResource);
+      return instanceGroupManagerResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstanceGroupManager getApiMessageRequestBody() {
     return instanceGroupManagerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java
index fcff5ddf431b..0a110a065c7e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,80 +77,39 @@ private InsertInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceResource") && instanceResource != null) {
-      fieldMap.put("instanceResource", Collections.singletonList(String.valueOf(instanceResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sourceInstanceTemplate") && sourceInstanceTemplate != null) {
-      fieldMap.put(
-          "sourceInstanceTemplate",
-          Collections.singletonList(String.valueOf(sourceInstanceTemplate)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceResource")) {
-      return String.valueOf(instanceResource);
+      return instanceResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sourceInstanceTemplate")) {
-      return String.valueOf(sourceInstanceTemplate);
+      return sourceInstanceTemplate;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -165,6 +120,12 @@ public Instance getApiMessageRequestBody() {
     return instanceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java
index f63f92b4f8ad..950f30b9ee45 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertInstanceTemplateHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceTemplateResource") && instanceTemplateResource != null) {
-      fieldMap.put(
-          "instanceTemplateResource",
-          Collections.singletonList(String.valueOf(instanceTemplateResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceTemplateResource")) {
-      return String.valueOf(instanceTemplateResource);
+      return instanceTemplateResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public InstanceTemplate getApiMessageRequestBody() {
     return instanceTemplateResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java
index a8ac39739e70..8a3e6df68c91 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private InsertInterconnectAttachmentHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnectAttachmentResource")
-        && interconnectAttachmentResource != null) {
-      fieldMap.put(
-          "interconnectAttachmentResource",
-          Collections.singletonList(String.valueOf(interconnectAttachmentResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnectAttachmentResource")) {
-      return String.valueOf(interconnectAttachmentResource);
+      return interconnectAttachmentResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InterconnectAttachment getApiMessageRequestBody() {
     return interconnectAttachmentResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java
index 9ddb8551c356..9402cf686fc4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertInterconnectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnectResource") && interconnectResource != null) {
-      fieldMap.put(
-          "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnectResource")) {
-      return String.valueOf(interconnectResource);
+      return interconnectResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public Interconnect getApiMessageRequestBody() {
     return interconnectResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java
index fe43d76ababc..577888b8f703 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertLicenseHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("licenseResource") && licenseResource != null) {
-      fieldMap.put("licenseResource", Collections.singletonList(String.valueOf(licenseResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("licenseResource")) {
-      return String.valueOf(licenseResource);
+      return licenseResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public License getApiMessageRequestBody() {
     return licenseResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java
index c3f9aa063165..1c765b0db7a5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertNetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("networkResource") && networkResource != null) {
-      fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("networkResource")) {
-      return String.valueOf(networkResource);
+      return networkResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Network getApiMessageRequestBody() {
     return networkResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java
index 596244b18249..6f68a3783cb2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertRegionAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) {
-      fieldMap.put(
-          "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscalerResource")) {
-      return String.valueOf(autoscalerResource);
+      return autoscalerResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public Autoscaler getApiMessageRequestBody() {
     return autoscalerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java
index 99e8a70e4722..f85f6024141f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertRegionBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) {
-      fieldMap.put(
-          "backendServiceResource",
-          Collections.singletonList(String.valueOf(backendServiceResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendServiceResource")) {
-      return String.valueOf(backendServiceResource);
+      return backendServiceResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public BackendService getApiMessageRequestBody() {
     return backendServiceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java
index b20ba9542536..b2ac2c51f6a6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertRegionCommitmentHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("commitmentResource") && commitmentResource != null) {
-      fieldMap.put(
-          "commitmentResource", Collections.singletonList(String.valueOf(commitmentResource)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("commitmentResource")) {
-      return String.valueOf(commitmentResource);
+      return commitmentResource;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public Commitment getApiMessageRequestBody() {
     return commitmentResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java
index 8622ee682548..410d10f9dfe2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,78 +77,39 @@ private InsertRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("diskResource") && diskResource != null) {
-      fieldMap.put("diskResource", Collections.singletonList(String.valueOf(diskResource)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sourceImage") && sourceImage != null) {
-      fieldMap.put("sourceImage", Collections.singletonList(String.valueOf(sourceImage)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("diskResource")) {
-      return String.valueOf(diskResource);
+      return diskResource;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sourceImage")) {
-      return String.valueOf(sourceImage);
+      return sourceImage;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -163,6 +120,12 @@ public Disk getApiMessageRequestBody() {
     return diskResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java
index 7f446083c85b..7e4b4df953c9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private InsertRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManagerResource")
-        && instanceGroupManagerResource != null) {
-      fieldMap.put(
-          "instanceGroupManagerResource",
-          Collections.singletonList(String.valueOf(instanceGroupManagerResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManagerResource")) {
-      return String.valueOf(instanceGroupManagerResource);
+      return instanceGroupManagerResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstanceGroupManager getApiMessageRequestBody() {
     return instanceGroupManagerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java
index 15c2d58f3f02..ef13fefe5651 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertRouteHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("routeResource") && routeResource != null) {
-      fieldMap.put("routeResource", Collections.singletonList(String.valueOf(routeResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("routeResource")) {
-      return String.valueOf(routeResource);
+      return routeResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Route getApiMessageRequestBody() {
     return routeResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java
index 9224aaeac65e..73648b655089 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("routerResource") && routerResource != null) {
-      fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("routerResource")) {
-      return String.valueOf(routerResource);
+      return routerResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Router getApiMessageRequestBody() {
     return routerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java
index d24619b7bdc8..6eaf2ac78ddb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertSslCertificateHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslCertificateResource") && sslCertificateResource != null) {
-      fieldMap.put(
-          "sslCertificateResource",
-          Collections.singletonList(String.valueOf(sslCertificateResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslCertificateResource")) {
-      return String.valueOf(sslCertificateResource);
+      return sslCertificateResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public SslCertificate getApiMessageRequestBody() {
     return sslCertificateResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java
index dedc433cbc2c..1bb69f83736c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertSslPolicyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) {
-      fieldMap.put(
-          "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslPolicyResource")) {
-      return String.valueOf(sslPolicyResource);
+      return sslPolicyResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public SslPolicy getApiMessageRequestBody() {
     return sslPolicyResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java
index 98bec8e85e85..2db72649e1a8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertSubnetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) {
-      fieldMap.put(
-          "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("subnetworkResource")) {
-      return String.valueOf(subnetworkResource);
+      return subnetworkResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public Subnetwork getApiMessageRequestBody() {
     return subnetworkResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java
index f001e2403a26..0954f10a7667 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertTargetHttpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpProxyResource") && targetHttpProxyResource != null) {
-      fieldMap.put(
-          "targetHttpProxyResource",
-          Collections.singletonList(String.valueOf(targetHttpProxyResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpProxyResource")) {
-      return String.valueOf(targetHttpProxyResource);
+      return targetHttpProxyResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetHttpProxy getApiMessageRequestBody() {
     return targetHttpProxyResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java
index 2e357705b953..af8b42abc271 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertTargetHttpsProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpsProxyResource") && targetHttpsProxyResource != null) {
-      fieldMap.put(
-          "targetHttpsProxyResource",
-          Collections.singletonList(String.valueOf(targetHttpsProxyResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpsProxyResource")) {
-      return String.valueOf(targetHttpsProxyResource);
+      return targetHttpsProxyResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetHttpsProxy getApiMessageRequestBody() {
     return targetHttpsProxyResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java
index bfaa6abf741b..c6b44391a95e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertTargetInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetInstanceResource") && targetInstanceResource != null) {
-      fieldMap.put(
-          "targetInstanceResource",
-          Collections.singletonList(String.valueOf(targetInstanceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetInstanceResource")) {
-      return String.valueOf(targetInstanceResource);
+      return targetInstanceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetInstance getApiMessageRequestBody() {
     return targetInstanceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java
index c42a2c6d5718..42353932d5b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetPoolResource") && targetPoolResource != null) {
-      fieldMap.put(
-          "targetPoolResource", Collections.singletonList(String.valueOf(targetPoolResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetPoolResource")) {
-      return String.valueOf(targetPoolResource);
+      return targetPoolResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public TargetPool getApiMessageRequestBody() {
     return targetPoolResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java
index 7ca1cfa1fd4d..8edac35f2e7d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetSslProxyResource") && targetSslProxyResource != null) {
-      fieldMap.put(
-          "targetSslProxyResource",
-          Collections.singletonList(String.valueOf(targetSslProxyResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetSslProxyResource")) {
-      return String.valueOf(targetSslProxyResource);
+      return targetSslProxyResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetSslProxy getApiMessageRequestBody() {
     return targetSslProxyResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java
index bebf9bf2660e..c77a843b7fa4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertTargetTcpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetTcpProxyResource") && targetTcpProxyResource != null) {
-      fieldMap.put(
-          "targetTcpProxyResource",
-          Collections.singletonList(String.valueOf(targetTcpProxyResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetTcpProxyResource")) {
-      return String.valueOf(targetTcpProxyResource);
+      return targetTcpProxyResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetTcpProxy getApiMessageRequestBody() {
     return targetTcpProxyResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java
index 33eea30cd206..9ebec84e2861 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private InsertTargetVpnGatewayHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetVpnGatewayResource") && targetVpnGatewayResource != null) {
-      fieldMap.put(
-          "targetVpnGatewayResource",
-          Collections.singletonList(String.valueOf(targetVpnGatewayResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetVpnGatewayResource")) {
-      return String.valueOf(targetVpnGatewayResource);
+      return targetVpnGatewayResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetVpnGateway getApiMessageRequestBody() {
     return targetVpnGatewayResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java
index f6a4a3a1ac2c..0a4fd9b8895f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private InsertUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("urlMapResource") && urlMapResource != null) {
-      fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("urlMapResource")) {
-      return String.valueOf(urlMapResource);
+      return urlMapResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public UrlMap getApiMessageRequestBody() {
     return urlMapResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java
index fb7470850b13..d99f43f1896e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private InsertVpnTunnelHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("vpnTunnelResource") && vpnTunnelResource != null) {
-      fieldMap.put(
-          "vpnTunnelResource", Collections.singletonList(String.valueOf(vpnTunnelResource)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("vpnTunnelResource")) {
-      return String.valueOf(vpnTunnelResource);
+      return vpnTunnelResource;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public VpnTunnel getApiMessageRequestBody() {
     return vpnTunnelResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java
index 3dae75547c94..31f30d76b42c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java
@@ -17,14 +17,10 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -135,174 +131,78 @@ private Instance(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("canIpForward") && canIpForward != null) {
-      fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward)));
-    }
-    if (fieldNames.contains("cpuPlatform") && cpuPlatform != null) {
-      fieldMap.put("cpuPlatform", Collections.singletonList(String.valueOf(cpuPlatform)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("deletionProtection") && deletionProtection != null) {
-      fieldMap.put(
-          "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("disks") && disks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AttachedDisk item : disks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("disks", stringList.build());
-    }
-    if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AcceleratorConfig item : guestAccelerators) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("guestAccelerators", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    if (fieldNames.contains("machineType") && machineType != null) {
-      fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType)));
-    }
-    if (fieldNames.contains("metadata") && metadata != null) {
-      fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata)));
-    }
-    if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) {
-      fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NetworkInterface item : networkInterfaces) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("networkInterfaces", stringList.build());
-    }
-    if (fieldNames.contains("scheduling") && scheduling != null) {
-      fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ServiceAccount item : serviceAccounts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("serviceAccounts", stringList.build());
-    }
-    if (fieldNames.contains("startRestricted") && startRestricted != null) {
-      fieldMap.put("startRestricted", Collections.singletonList(String.valueOf(startRestricted)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("statusMessage") && statusMessage != null) {
-      fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage)));
-    }
-    if (fieldNames.contains("tags") && tags != null) {
-      fieldMap.put("tags", Collections.singletonList(String.valueOf(tags)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("canIpForward")) {
-      return String.valueOf(canIpForward);
+      return canIpForward;
     }
     if (fieldName.equals("cpuPlatform")) {
-      return String.valueOf(cpuPlatform);
+      return cpuPlatform;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("deletionProtection")) {
-      return String.valueOf(deletionProtection);
+      return deletionProtection;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("disks")) {
-      return String.valueOf(disks);
+      return disks;
     }
     if (fieldName.equals("guestAccelerators")) {
-      return String.valueOf(guestAccelerators);
+      return guestAccelerators;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     if (fieldName.equals("machineType")) {
-      return String.valueOf(machineType);
+      return machineType;
     }
     if (fieldName.equals("metadata")) {
-      return String.valueOf(metadata);
+      return metadata;
     }
     if (fieldName.equals("minCpuPlatform")) {
-      return String.valueOf(minCpuPlatform);
+      return minCpuPlatform;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("networkInterfaces")) {
-      return String.valueOf(networkInterfaces);
+      return networkInterfaces;
     }
     if (fieldName.equals("scheduling")) {
-      return String.valueOf(scheduling);
+      return scheduling;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("serviceAccounts")) {
-      return String.valueOf(serviceAccounts);
+      return serviceAccounts;
     }
     if (fieldName.equals("startRestricted")) {
-      return String.valueOf(startRestricted);
+      return startRestricted;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("statusMessage")) {
-      return String.valueOf(statusMessage);
+      return statusMessage;
     }
     if (fieldName.equals("tags")) {
-      return String.valueOf(tags);
+      return tags;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -313,6 +213,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getCanIpForward() {
     return canIpForward;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java
index 876eb432086d..520c4fd90d89 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private InstanceAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java
index 931ee7b7068c..d3546fa39ed4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java
@@ -44,9 +44,8 @@
  * try (InstanceClient instanceClient = InstanceClient.create()) {
  *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
  *   String networkInterface = "";
- *   String requestId = "";
  *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
- *   Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource);
+ *   Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource);
  * }
  * 
  * 
@@ -163,23 +162,13 @@ public InstanceStub getStub() { * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource); * } *
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface to add to this instance. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param accessConfigResource An access configuration attached to an instance's network * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -188,14 +177,12 @@ public InstanceStub getStub() { public final Operation addAccessConfigInstance( ProjectZoneInstanceName instance, String networkInterface, - String requestId, AccessConfig accessConfigResource) { AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setAccessConfigResource(accessConfigResource) .build(); return addAccessConfigInstance(request); @@ -211,39 +198,25 @@ public final Operation addAccessConfigInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance.toString(), networkInterface, requestId, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance.toString(), networkInterface, accessConfigResource); * } *

* * @param instance The instance name for this request. * @param networkInterface The name of the network interface to add to this instance. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param accessConfigResource An access configuration attached to an instance's network * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addAccessConfigInstance( - String instance, - String networkInterface, - String requestId, - AccessConfig accessConfigResource) { + String instance, String networkInterface, AccessConfig accessConfigResource) { AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setAccessConfigResource(accessConfigResource) .build(); return addAccessConfigInstance(request); @@ -259,12 +232,10 @@ public final Operation addAccessConfigInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); * AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setAccessConfigResource(accessConfigResource) * .build(); * Operation response = instanceClient.addAccessConfigInstance(request); @@ -289,12 +260,10 @@ public final Operation addAccessConfigInstance(AddAccessConfigInstanceHttpReques * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); * AddAccessConfigInstanceHttpRequest request = AddAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setAccessConfigResource(accessConfigResource) * .build(); * ApiFuture<Operation> future = instanceClient.addAccessConfigInstanceCallable().futureCall(request); @@ -459,23 +428,13 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean forceAttach = false;
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
-   *   Operation response = instanceClient.attachDiskInstance(instance, requestId, forceAttach, attachedDiskResource);
+   *   Operation response = instanceClient.attachDiskInstance(instance, forceAttach, attachedDiskResource);
    * }
    * 
* * @param instance The instance name for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forceAttach Whether to force attach the disk even if it's currently attached to another * instance. This is only available for regional disks. * @param attachedDiskResource An instance-attached disk resource. @@ -483,15 +442,11 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances( */ @BetaApi public final Operation attachDiskInstance( - ProjectZoneInstanceName instance, - String requestId, - Boolean forceAttach, - AttachedDisk attachedDiskResource) { + ProjectZoneInstanceName instance, Boolean forceAttach, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setForceAttach(forceAttach) .setAttachedDiskResource(attachedDiskResource) .build(); @@ -509,23 +464,13 @@ public final Operation attachDiskInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean forceAttach = false;
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
-   *   Operation response = instanceClient.attachDiskInstance(instance.toString(), requestId, forceAttach, attachedDiskResource);
+   *   Operation response = instanceClient.attachDiskInstance(instance.toString(), forceAttach, attachedDiskResource);
    * }
    * 
* * @param instance The instance name for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param forceAttach Whether to force attach the disk even if it's currently attached to another * instance. This is only available for regional disks. * @param attachedDiskResource An instance-attached disk resource. @@ -533,12 +478,11 @@ public final Operation attachDiskInstance( */ @BetaApi public final Operation attachDiskInstance( - String instance, String requestId, Boolean forceAttach, AttachedDisk attachedDiskResource) { + String instance, Boolean forceAttach, AttachedDisk attachedDiskResource) { AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setForceAttach(forceAttach) .setAttachedDiskResource(attachedDiskResource) .build(); @@ -556,12 +500,10 @@ public final Operation attachDiskInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean forceAttach = false;
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setForceAttach(forceAttach)
    *     .setAttachedDiskResource(attachedDiskResource)
    *     .build();
@@ -588,12 +530,10 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request)
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean forceAttach = false;
    *   AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
    *   AttachDiskInstanceHttpRequest request = AttachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setForceAttach(forceAttach)
    *     .setAttachedDiskResource(attachedDiskResource)
    *     .build();
@@ -619,30 +559,19 @@ public final Operation attachDiskInstance(AttachDiskInstanceHttpRequest request)
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.deleteInstance(instance, requestId);
+   *   Operation response = instanceClient.deleteInstance(instance);
    * }
    * 
* * @param instance Name of the instance resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstance(ProjectZoneInstanceName instance, String requestId) { + public final Operation deleteInstance(ProjectZoneInstanceName instance) { DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .build(); return deleteInstance(request); } @@ -657,31 +586,18 @@ public final Operation deleteInstance(ProjectZoneInstanceName instance, String r *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.deleteInstance(instance.toString(), requestId);
+   *   Operation response = instanceClient.deleteInstance(instance.toString());
    * }
    * 
* * @param instance Name of the instance resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstance(String instance, String requestId) { + public final Operation deleteInstance(String instance) { DeleteInstanceHttpRequest request = - DeleteInstanceHttpRequest.newBuilder() - .setInstance(instance) - .setRequestId(requestId) - .build(); + DeleteInstanceHttpRequest.newBuilder().setInstance(instance).build(); return deleteInstance(request); } @@ -695,10 +611,8 @@ public final Operation deleteInstance(String instance, String requestId) { *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.deleteInstance(request);
    * }
@@ -722,10 +636,8 @@ public final Operation deleteInstance(DeleteInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   DeleteInstanceHttpRequest request = DeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.deleteInstanceCallable().futureCall(request);
    *   // Do something
@@ -748,38 +660,24 @@ public final UnaryCallable deleteInstanceC
    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
-   *   String requestId = "";
    *   String accessConfig = "";
-   *   Operation response = instanceClient.deleteAccessConfigInstance(instance, networkInterface, requestId, accessConfig);
+   *   Operation response = instanceClient.deleteAccessConfigInstance(instance, networkInterface, accessConfig);
    * }
    * 
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param accessConfig The name of the access config to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteAccessConfigInstance( - ProjectZoneInstanceName instance, - String networkInterface, - String requestId, - String accessConfig) { + ProjectZoneInstanceName instance, String networkInterface, String accessConfig) { DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setAccessConfig(accessConfig) .build(); return deleteAccessConfigInstance(request); @@ -795,35 +693,24 @@ public final Operation deleteAccessConfigInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * String accessConfig = ""; - * Operation response = instanceClient.deleteAccessConfigInstance(instance.toString(), networkInterface, requestId, accessConfig); + * Operation response = instanceClient.deleteAccessConfigInstance(instance.toString(), networkInterface, accessConfig); * } *

* * @param instance The instance name for this request. * @param networkInterface The name of the network interface. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param accessConfig The name of the access config to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteAccessConfigInstance( - String instance, String networkInterface, String requestId, String accessConfig) { + String instance, String networkInterface, String accessConfig) { DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setAccessConfig(accessConfig) .build(); return deleteAccessConfigInstance(request); @@ -839,12 +726,10 @@ public final Operation deleteAccessConfigInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * String accessConfig = ""; * DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setAccessConfig(accessConfig) * .build(); * Operation response = instanceClient.deleteAccessConfigInstance(request); @@ -869,12 +754,10 @@ public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttp * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * String accessConfig = ""; * DeleteAccessConfigInstanceHttpRequest request = DeleteAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setAccessConfig(accessConfig) * .build(); * ApiFuture<Operation> future = instanceClient.deleteAccessConfigInstanceCallable().futureCall(request); @@ -898,33 +781,21 @@ public final Operation deleteAccessConfigInstance(DeleteAccessConfigInstanceHttp *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   String deviceName = "";
-   *   Operation response = instanceClient.detachDiskInstance(instance, requestId, deviceName);
+   *   Operation response = instanceClient.detachDiskInstance(instance, deviceName);
    * }
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param deviceName Disk device name to detach. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation detachDiskInstance( - ProjectZoneInstanceName instance, String requestId, String deviceName) { + public final Operation detachDiskInstance(ProjectZoneInstanceName instance, String deviceName) { DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setDeviceName(deviceName) .build(); return detachDiskInstance(request); @@ -939,32 +810,21 @@ public final Operation detachDiskInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   String deviceName = "";
-   *   Operation response = instanceClient.detachDiskInstance(instance.toString(), requestId, deviceName);
+   *   Operation response = instanceClient.detachDiskInstance(instance.toString(), deviceName);
    * }
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param deviceName Disk device name to detach. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation detachDiskInstance(String instance, String requestId, String deviceName) { + public final Operation detachDiskInstance(String instance, String deviceName) { DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setDeviceName(deviceName) .build(); return detachDiskInstance(request); @@ -979,11 +839,9 @@ public final Operation detachDiskInstance(String instance, String requestId, Str *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   String deviceName = "";
    *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setDeviceName(deviceName)
    *     .build();
    *   Operation response = instanceClient.detachDiskInstance(request);
@@ -1007,11 +865,9 @@ public final Operation detachDiskInstance(DetachDiskInstanceHttpRequest request)
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   String deviceName = "";
    *   DetachDiskInstanceHttpRequest request = DetachDiskInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setDeviceName(deviceName)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.detachDiskInstanceCallable().futureCall(request);
@@ -1264,46 +1120,23 @@ public final SerialPortOutput getSerialPortOutputInstance(
    *
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
-   *   Operation response = instanceClient.insertInstance(sourceInstanceTemplate, zone, requestId, instanceResource);
+   *   Operation response = instanceClient.insertInstance(zone, instanceResource);
    * }
    * 
* - * @param 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/global/instanceTemplates/instanceTemplate - * - projects/project/global/global/instanceTemplates/instanceTemplate - - * global/instancesTemplates/instanceTemplate * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== * resource_for v1.instances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstance( - String sourceInstanceTemplate, - ProjectZoneName zone, - String requestId, - Instance instanceResource) { + public final Operation insertInstance(ProjectZoneName zone, Instance instanceResource) { InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder() - .setSourceInstanceTemplate(sourceInstanceTemplate) .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setInstanceResource(instanceResource) .build(); return insertInstance(request); @@ -1317,43 +1150,23 @@ public final Operation insertInstance( * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
-   *   Operation response = instanceClient.insertInstance(sourceInstanceTemplate, zone.toString(), requestId, instanceResource);
+   *   Operation response = instanceClient.insertInstance(zone.toString(), instanceResource);
    * }
    * 
* - * @param 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/global/instanceTemplates/instanceTemplate - * - projects/project/global/global/instanceTemplates/instanceTemplate - - * global/instancesTemplates/instanceTemplate * @param zone The name of the zone for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceResource An Instance resource. (== resource_for beta.instances ==) (== * resource_for v1.instances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstance( - String sourceInstanceTemplate, String zone, String requestId, Instance instanceResource) { + public final Operation insertInstance(String zone, Instance instanceResource) { InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder() - .setSourceInstanceTemplate(sourceInstanceTemplate) .setZone(zone) - .setRequestId(requestId) .setInstanceResource(instanceResource) .build(); return insertInstance(request); @@ -1367,14 +1180,10 @@ public final Operation insertInstance( * *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
-   *     .setSourceInstanceTemplate(sourceInstanceTemplate)
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setInstanceResource(instanceResource)
    *     .build();
    *   Operation response = instanceClient.insertInstance(request);
@@ -1397,14 +1206,10 @@ public final Operation insertInstance(InsertInstanceHttpRequest request) {
    *
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
-   *   String sourceInstanceTemplate = "";
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   Instance instanceResource = Instance.newBuilder().build();
    *   InsertInstanceHttpRequest request = InsertInstanceHttpRequest.newBuilder()
-   *     .setSourceInstanceTemplate(sourceInstanceTemplate)
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setInstanceResource(instanceResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.insertInstanceCallable().futureCall(request);
@@ -1703,30 +1508,19 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.resetInstance(instance, requestId);
+   *   Operation response = instanceClient.resetInstance(instance);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resetInstance(ProjectZoneInstanceName instance, String requestId) { + public final Operation resetInstance(ProjectZoneInstanceName instance) { ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .build(); return resetInstance(request); } @@ -1740,28 +1534,18 @@ public final Operation resetInstance(ProjectZoneInstanceName instance, String re *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.resetInstance(instance.toString(), requestId);
+   *   Operation response = instanceClient.resetInstance(instance.toString());
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resetInstance(String instance, String requestId) { + public final Operation resetInstance(String instance) { ResetInstanceHttpRequest request = - ResetInstanceHttpRequest.newBuilder().setInstance(instance).setRequestId(requestId).build(); + ResetInstanceHttpRequest.newBuilder().setInstance(instance).build(); return resetInstance(request); } @@ -1774,10 +1558,8 @@ public final Operation resetInstance(String instance, String requestId) { *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.resetInstance(request);
    * }
@@ -1800,10 +1582,8 @@ public final Operation resetInstance(ResetInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   ResetInstanceHttpRequest request = ResetInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.resetInstanceCallable().futureCall(request);
    *   // Do something
@@ -1825,33 +1605,22 @@ public final UnaryCallable resetInstanceCal
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   Boolean deletionProtection = false;
-   *   Operation response = instanceClient.setDeletionProtectionInstance(resource, requestId, deletionProtection);
+   *   Operation response = instanceClient.setDeletionProtectionInstance(resource, deletionProtection);
    * }
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param deletionProtection Whether the resource should be protected against deletion. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setDeletionProtectionInstance( - ProjectZoneInstanceResourceName resource, String requestId, Boolean deletionProtection) { + ProjectZoneInstanceResourceName resource, Boolean deletionProtection) { SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder() .setResource(resource == null ? null : resource.toString()) - .setRequestId(requestId) .setDeletionProtection(deletionProtection) .build(); return setDeletionProtectionInstance(request); @@ -1866,33 +1635,22 @@ public final Operation setDeletionProtectionInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   Boolean deletionProtection = false;
-   *   Operation response = instanceClient.setDeletionProtectionInstance(resource.toString(), requestId, deletionProtection);
+   *   Operation response = instanceClient.setDeletionProtectionInstance(resource.toString(), deletionProtection);
    * }
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param deletionProtection Whether the resource should be protected against deletion. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setDeletionProtectionInstance( - String resource, String requestId, Boolean deletionProtection) { + String resource, Boolean deletionProtection) { SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder() .setResource(resource) - .setRequestId(requestId) .setDeletionProtection(deletionProtection) .build(); return setDeletionProtectionInstance(request); @@ -1907,11 +1665,9 @@ public final Operation setDeletionProtectionInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
    *     .setResource(resource.toString())
-   *     .setRequestId(requestId)
    *     .setDeletionProtection(deletionProtection)
    *     .build();
    *   Operation response = instanceClient.setDeletionProtectionInstance(request);
@@ -1936,11 +1692,9 @@ public final Operation setDeletionProtectionInstance(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
-   *   String requestId = "";
    *   Boolean deletionProtection = false;
    *   SetDeletionProtectionInstanceHttpRequest request = SetDeletionProtectionInstanceHttpRequest.newBuilder()
    *     .setResource(resource.toString())
-   *     .setRequestId(requestId)
    *     .setDeletionProtection(deletionProtection)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setDeletionProtectionInstanceCallable().futureCall(request);
@@ -1964,35 +1718,24 @@ public final Operation setDeletionProtectionInstance(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
-   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance, requestId, autoDelete, deviceName);
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance, autoDelete, deviceName);
    * }
    * 
* * @param instance The instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoDelete Whether to auto-delete the disk when the instance is deleted. * @param deviceName The device name of the disk to modify. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setDiskAutoDeleteInstance( - ProjectZoneInstanceName instance, String requestId, Boolean autoDelete, String deviceName) { + ProjectZoneInstanceName instance, Boolean autoDelete, String deviceName) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setAutoDelete(autoDelete) .setDeviceName(deviceName) .build(); @@ -2008,35 +1751,24 @@ public final Operation setDiskAutoDeleteInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
-   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance.toString(), requestId, autoDelete, deviceName);
+   *   Operation response = instanceClient.setDiskAutoDeleteInstance(instance.toString(), autoDelete, deviceName);
    * }
    * 
* * @param instance The instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param autoDelete Whether to auto-delete the disk when the instance is deleted. * @param deviceName The device name of the disk to modify. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setDiskAutoDeleteInstance( - String instance, String requestId, Boolean autoDelete, String deviceName) { + String instance, Boolean autoDelete, String deviceName) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setAutoDelete(autoDelete) .setDeviceName(deviceName) .build(); @@ -2052,12 +1784,10 @@ public final Operation setDiskAutoDeleteInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
    *   SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setAutoDelete(autoDelete)
    *     .setDeviceName(deviceName)
    *     .build();
@@ -2082,12 +1812,10 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Boolean autoDelete = false;
    *   String deviceName = "";
    *   SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setAutoDelete(autoDelete)
    *     .setDeviceName(deviceName)
    *     .build();
@@ -2113,35 +1841,23 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
-   *   Operation response = instanceClient.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource);
+   *   Operation response = instanceClient.setLabelsInstance(instance, instancesSetLabelsRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setLabelsInstance( ProjectZoneInstanceName instance, - String requestId, InstancesSetLabelsRequest instancesSetLabelsRequestResource) { SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) .build(); return setLabelsInstance(request); @@ -2157,35 +1873,22 @@ public final Operation setLabelsInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
-   *   Operation response = instanceClient.setLabelsInstance(instance.toString(), requestId, instancesSetLabelsRequestResource);
+   *   Operation response = instanceClient.setLabelsInstance(instance.toString(), instancesSetLabelsRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setLabelsInstance( - String instance, - String requestId, - InstancesSetLabelsRequest instancesSetLabelsRequestResource) { + String instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource) { SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource) .build(); return setLabelsInstance(request); @@ -2201,11 +1904,9 @@ public final Operation setLabelsInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
    *   SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource)
    *     .build();
    *   Operation response = instanceClient.setLabelsInstance(request);
@@ -2230,11 +1931,9 @@ public final Operation setLabelsInstance(SetLabelsInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build();
    *   SetLabelsInstanceHttpRequest request = SetLabelsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetLabelsRequestResource(instancesSetLabelsRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setLabelsInstanceCallable().futureCall(request);
@@ -2258,35 +1957,23 @@ public final UnaryCallable setLabelsIns
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMachineResourcesInstance(instance, requestId, instancesSetMachineResourcesRequestResource);
+   *   Operation response = instanceClient.setMachineResourcesInstance(instance, instancesSetMachineResourcesRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineResourcesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMachineResourcesInstance( ProjectZoneInstanceName instance, - String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setInstancesSetMachineResourcesRequestResource( instancesSetMachineResourcesRequestResource) .build(); @@ -2303,35 +1990,23 @@ public final Operation setMachineResourcesInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMachineResourcesInstance(instance.toString(), requestId, instancesSetMachineResourcesRequestResource);
+   *   Operation response = instanceClient.setMachineResourcesInstance(instance.toString(), instancesSetMachineResourcesRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineResourcesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMachineResourcesInstance( String instance, - String requestId, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource) { SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setInstancesSetMachineResourcesRequestResource( instancesSetMachineResourcesRequestResource) .build(); @@ -2348,11 +2023,9 @@ public final Operation setMachineResourcesInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
    *   SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource)
    *     .build();
    *   Operation response = instanceClient.setMachineResourcesInstance(request);
@@ -2378,11 +2051,9 @@ public final Operation setMachineResourcesInstance(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build();
    *   SetMachineResourcesInstanceHttpRequest request = SetMachineResourcesInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetMachineResourcesRequestResource(instancesSetMachineResourcesRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setMachineResourcesInstanceCallable().futureCall(request);
@@ -2406,35 +2077,23 @@ public final Operation setMachineResourcesInstance(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource);
+   *   Operation response = instanceClient.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineTypeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMachineTypeInstance( ProjectZoneInstanceName instance, - String requestId, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) .build(); return setMachineTypeInstance(request); @@ -2449,35 +2108,22 @@ public final Operation setMachineTypeInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMachineTypeInstance(instance.toString(), requestId, instancesSetMachineTypeRequestResource);
+   *   Operation response = instanceClient.setMachineTypeInstance(instance.toString(), instancesSetMachineTypeRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetMachineTypeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMachineTypeInstance( - String instance, - String requestId, - InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { + String instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource) { SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource) .build(); return setMachineTypeInstance(request); @@ -2492,11 +2138,9 @@ public final Operation setMachineTypeInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
    *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
    *     .build();
    *   Operation response = instanceClient.setMachineTypeInstance(request);
@@ -2520,11 +2164,9 @@ public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build();
    *   SetMachineTypeInstanceHttpRequest request = SetMachineTypeInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetMachineTypeRequestResource(instancesSetMachineTypeRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setMachineTypeInstanceCallable().futureCall(request);
@@ -2548,33 +2190,22 @@ public final Operation setMachineTypeInstance(SetMachineTypeInstanceHttpRequest
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = instanceClient.setMetadataInstance(instance, requestId, metadataResource);
+   *   Operation response = instanceClient.setMetadataInstance(instance, metadataResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMetadataInstance( - ProjectZoneInstanceName instance, String requestId, Metadata metadataResource) { + ProjectZoneInstanceName instance, Metadata metadataResource) { SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setMetadataResource(metadataResource) .build(); return setMetadataInstance(request); @@ -2589,33 +2220,21 @@ public final Operation setMetadataInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = instanceClient.setMetadataInstance(instance.toString(), requestId, metadataResource);
+   *   Operation response = instanceClient.setMetadataInstance(instance.toString(), metadataResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setMetadataInstance( - String instance, String requestId, Metadata metadataResource) { + public final Operation setMetadataInstance(String instance, Metadata metadataResource) { SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setMetadataResource(metadataResource) .build(); return setMetadataInstance(request); @@ -2630,11 +2249,9 @@ public final Operation setMetadataInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setMetadataResource(metadataResource)
    *     .build();
    *   Operation response = instanceClient.setMetadataInstance(request);
@@ -2658,11 +2275,9 @@ public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest reques
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetMetadataInstanceHttpRequest request = SetMetadataInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setMetadataResource(metadataResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setMetadataInstanceCallable().futureCall(request);
@@ -2687,35 +2302,23 @@ public final Operation setMetadataInstance(SetMetadataInstanceHttpRequest reques
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMinCpuPlatformInstance(instance, requestId, instancesSetMinCpuPlatformRequestResource);
+   *   Operation response = instanceClient.setMinCpuPlatformInstance(instance, instancesSetMinCpuPlatformRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetMinCpuPlatformRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMinCpuPlatformInstance( ProjectZoneInstanceName instance, - String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) .build(); return setMinCpuPlatformInstance(request); @@ -2731,35 +2334,23 @@ public final Operation setMinCpuPlatformInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
-   *   Operation response = instanceClient.setMinCpuPlatformInstance(instance.toString(), requestId, instancesSetMinCpuPlatformRequestResource);
+   *   Operation response = instanceClient.setMinCpuPlatformInstance(instance.toString(), instancesSetMinCpuPlatformRequestResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetMinCpuPlatformRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setMinCpuPlatformInstance( String instance, - String requestId, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource) { SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource) .build(); return setMinCpuPlatformInstance(request); @@ -2775,11 +2366,9 @@ public final Operation setMinCpuPlatformInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
    *   SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource)
    *     .build();
    *   Operation response = instanceClient.setMinCpuPlatformInstance(request);
@@ -2804,11 +2393,9 @@ public final Operation setMinCpuPlatformInstance(SetMinCpuPlatformInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build();
    *   SetMinCpuPlatformInstanceHttpRequest request = SetMinCpuPlatformInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetMinCpuPlatformRequestResource(instancesSetMinCpuPlatformRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setMinCpuPlatformInstanceCallable().futureCall(request);
@@ -2832,33 +2419,22 @@ public final Operation setMinCpuPlatformInstance(SetMinCpuPlatformInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
-   *   Operation response = instanceClient.setSchedulingInstance(instance, requestId, schedulingResource);
+   *   Operation response = instanceClient.setSchedulingInstance(instance, schedulingResource);
    * }
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param schedulingResource Sets the scheduling options for an Instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSchedulingInstance( - ProjectZoneInstanceName instance, String requestId, Scheduling schedulingResource) { + ProjectZoneInstanceName instance, Scheduling schedulingResource) { SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setSchedulingResource(schedulingResource) .build(); return setSchedulingInstance(request); @@ -2873,33 +2449,21 @@ public final Operation setSchedulingInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
-   *   Operation response = instanceClient.setSchedulingInstance(instance.toString(), requestId, schedulingResource);
+   *   Operation response = instanceClient.setSchedulingInstance(instance.toString(), schedulingResource);
    * }
    * 
* * @param instance Instance name. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param schedulingResource Sets the scheduling options for an Instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setSchedulingInstance( - String instance, String requestId, Scheduling schedulingResource) { + public final Operation setSchedulingInstance(String instance, Scheduling schedulingResource) { SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setSchedulingResource(schedulingResource) .build(); return setSchedulingInstance(request); @@ -2914,11 +2478,9 @@ public final Operation setSchedulingInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setSchedulingResource(schedulingResource)
    *     .build();
    *   Operation response = instanceClient.setSchedulingInstance(request);
@@ -2942,11 +2504,9 @@ public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest re
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Scheduling schedulingResource = Scheduling.newBuilder().build();
    *   SetSchedulingInstanceHttpRequest request = SetSchedulingInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setSchedulingResource(schedulingResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setSchedulingInstanceCallable().futureCall(request);
@@ -2971,35 +2531,23 @@ public final Operation setSchedulingInstance(SetSchedulingInstanceHttpRequest re
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
-   *   Operation response = instanceClient.setServiceAccountInstance(instance, requestId, instancesSetServiceAccountRequestResource);
+   *   Operation response = instanceClient.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetServiceAccountRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setServiceAccountInstance( ProjectZoneInstanceName instance, - String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) .build(); return setServiceAccountInstance(request); @@ -3015,35 +2563,23 @@ public final Operation setServiceAccountInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
-   *   Operation response = instanceClient.setServiceAccountInstance(instance.toString(), requestId, instancesSetServiceAccountRequestResource);
+   *   Operation response = instanceClient.setServiceAccountInstance(instance.toString(), instancesSetServiceAccountRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesSetServiceAccountRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setServiceAccountInstance( String instance, - String requestId, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource) { SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource) .build(); return setServiceAccountInstance(request); @@ -3059,11 +2595,9 @@ public final Operation setServiceAccountInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource)
    *     .build();
    *   Operation response = instanceClient.setServiceAccountInstance(request);
@@ -3088,11 +2622,9 @@ public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build();
    *   SetServiceAccountInstanceHttpRequest request = SetServiceAccountInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesSetServiceAccountRequestResource(instancesSetServiceAccountRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setServiceAccountInstanceCallable().futureCall(request);
@@ -3116,33 +2648,21 @@ public final Operation setServiceAccountInstance(SetServiceAccountInstanceHttpRe
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
-   *   Operation response = instanceClient.setTagsInstance(instance, requestId, tagsResource);
+   *   Operation response = instanceClient.setTagsInstance(instance, tagsResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param tagsResource A set of instance tags. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTagsInstance( - ProjectZoneInstanceName instance, String requestId, Tags tagsResource) { + public final Operation setTagsInstance(ProjectZoneInstanceName instance, Tags tagsResource) { SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setTagsResource(tagsResource) .build(); return setTagsInstance(request); @@ -3157,32 +2677,21 @@ public final Operation setTagsInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
-   *   Operation response = instanceClient.setTagsInstance(instance.toString(), requestId, tagsResource);
+   *   Operation response = instanceClient.setTagsInstance(instance.toString(), tagsResource);
    * }
    * 
* * @param instance Name of the instance scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param tagsResource A set of instance tags. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation setTagsInstance(String instance, String requestId, Tags tagsResource) { + public final Operation setTagsInstance(String instance, Tags tagsResource) { SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setTagsResource(tagsResource) .build(); return setTagsInstance(request); @@ -3197,11 +2706,9 @@ public final Operation setTagsInstance(String instance, String requestId, Tags t *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setTagsResource(tagsResource)
    *     .build();
    *   Operation response = instanceClient.setTagsInstance(request);
@@ -3225,11 +2732,9 @@ public final Operation setTagsInstance(SetTagsInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   Tags tagsResource = Tags.newBuilder().build();
    *   SetTagsInstanceHttpRequest request = SetTagsInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setTagsResource(tagsResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.setTagsInstanceCallable().futureCall(request);
@@ -3253,30 +2758,19 @@ public final UnaryCallable setTagsInstanc
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.startInstance(instance, requestId);
+   *   Operation response = instanceClient.startInstance(instance);
    * }
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startInstance(ProjectZoneInstanceName instance, String requestId) { + public final Operation startInstance(ProjectZoneInstanceName instance) { StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .build(); return startInstance(request); } @@ -3291,28 +2785,18 @@ public final Operation startInstance(ProjectZoneInstanceName instance, String re *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.startInstance(instance.toString(), requestId);
+   *   Operation response = instanceClient.startInstance(instance.toString());
    * }
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation startInstance(String instance, String requestId) { + public final Operation startInstance(String instance) { StartInstanceHttpRequest request = - StartInstanceHttpRequest.newBuilder().setInstance(instance).setRequestId(requestId).build(); + StartInstanceHttpRequest.newBuilder().setInstance(instance).build(); return startInstance(request); } @@ -3326,10 +2810,8 @@ public final Operation startInstance(String instance, String requestId) { *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.startInstance(request);
    * }
@@ -3353,10 +2835,8 @@ public final Operation startInstance(StartInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   StartInstanceHttpRequest request = StartInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.startInstanceCallable().futureCall(request);
    *   // Do something
@@ -3379,35 +2859,23 @@ public final UnaryCallable startInstanceCal
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
-   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance, requestId, instancesStartWithEncryptionKeyRequestResource);
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance, instancesStartWithEncryptionKeyRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesStartWithEncryptionKeyRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation startWithEncryptionKeyInstance( ProjectZoneInstanceName instance, - String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .setInstancesStartWithEncryptionKeyRequestResource( instancesStartWithEncryptionKeyRequestResource) .build(); @@ -3424,35 +2892,23 @@ public final Operation startWithEncryptionKeyInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
-   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance.toString(), requestId, instancesStartWithEncryptionKeyRequestResource);
+   *   Operation response = instanceClient.startWithEncryptionKeyInstance(instance.toString(), instancesStartWithEncryptionKeyRequestResource);
    * }
    * 
* * @param instance Name of the instance resource to start. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instancesStartWithEncryptionKeyRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation startWithEncryptionKeyInstance( String instance, - String requestId, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource) { StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder() .setInstance(instance) - .setRequestId(requestId) .setInstancesStartWithEncryptionKeyRequestResource( instancesStartWithEncryptionKeyRequestResource) .build(); @@ -3469,11 +2925,9 @@ public final Operation startWithEncryptionKeyInstance( *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource)
    *     .build();
    *   Operation response = instanceClient.startWithEncryptionKeyInstance(request);
@@ -3499,11 +2953,9 @@ public final Operation startWithEncryptionKeyInstance(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build();
    *   StartWithEncryptionKeyInstanceHttpRequest request = StartWithEncryptionKeyInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .setInstancesStartWithEncryptionKeyRequestResource(instancesStartWithEncryptionKeyRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.startWithEncryptionKeyInstanceCallable().futureCall(request);
@@ -3530,30 +2982,19 @@ public final Operation startWithEncryptionKeyInstance(
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.stopInstance(instance, requestId);
+   *   Operation response = instanceClient.stopInstance(instance);
    * }
    * 
* * @param instance Name of the instance resource to stop. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation stopInstance(ProjectZoneInstanceName instance, String requestId) { + public final Operation stopInstance(ProjectZoneInstanceName instance) { StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) - .setRequestId(requestId) .build(); return stopInstance(request); } @@ -3570,28 +3011,18 @@ public final Operation stopInstance(ProjectZoneInstanceName instance, String req *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
-   *   Operation response = instanceClient.stopInstance(instance.toString(), requestId);
+   *   Operation response = instanceClient.stopInstance(instance.toString());
    * }
    * 
* * @param instance Name of the instance resource to stop. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation stopInstance(String instance, String requestId) { + public final Operation stopInstance(String instance) { StopInstanceHttpRequest request = - StopInstanceHttpRequest.newBuilder().setInstance(instance).setRequestId(requestId).build(); + StopInstanceHttpRequest.newBuilder().setInstance(instance).build(); return stopInstance(request); } @@ -3607,10 +3038,8 @@ public final Operation stopInstance(String instance, String requestId) { *


    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceClient.stopInstance(request);
    * }
@@ -3636,10 +3065,8 @@ public final Operation stopInstance(StopInstanceHttpRequest request) {
    * 

    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
-   *   String requestId = "";
    *   StopInstanceHttpRequest request = StopInstanceHttpRequest.newBuilder()
    *     .setInstance(instance.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceClient.stopInstanceCallable().futureCall(request);
    *   // Do something
@@ -3664,23 +3091,13 @@ public final UnaryCallable stopInstanceCalla
    * try (InstanceClient instanceClient = InstanceClient.create()) {
    *   ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
    *   String networkInterface = "";
-   *   String requestId = "";
    *   AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
-   *   Operation response = instanceClient.updateAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource);
+   *   Operation response = instanceClient.updateAccessConfigInstance(instance, networkInterface, accessConfigResource);
    * }
    * 
* * @param instance The instance name for this request. * @param networkInterface The name of the network interface where the access config is attached. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param accessConfigResource An access configuration attached to an instance's network * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -3689,14 +3106,12 @@ public final UnaryCallable stopInstanceCalla public final Operation updateAccessConfigInstance( ProjectZoneInstanceName instance, String networkInterface, - String requestId, AccessConfig accessConfigResource) { UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setAccessConfigResource(accessConfigResource) .build(); return updateAccessConfigInstance(request); @@ -3714,39 +3129,25 @@ public final Operation updateAccessConfigInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.updateAccessConfigInstance(instance.toString(), networkInterface, requestId, accessConfigResource); + * Operation response = instanceClient.updateAccessConfigInstance(instance.toString(), networkInterface, accessConfigResource); * } *

* * @param instance The instance name for this request. * @param networkInterface The name of the network interface where the access config is attached. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param accessConfigResource An access configuration attached to an instance's network * interface. Only one access config per instance is supported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation updateAccessConfigInstance( - String instance, - String networkInterface, - String requestId, - AccessConfig accessConfigResource) { + String instance, String networkInterface, AccessConfig accessConfigResource) { UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder() .setInstance(instance) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setAccessConfigResource(accessConfigResource) .build(); return updateAccessConfigInstance(request); @@ -3764,12 +3165,10 @@ public final Operation updateAccessConfigInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); * UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setAccessConfigResource(accessConfigResource) * .build(); * Operation response = instanceClient.updateAccessConfigInstance(request); @@ -3796,12 +3195,10 @@ public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttp * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); * UpdateAccessConfigInstanceHttpRequest request = UpdateAccessConfigInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setAccessConfigResource(accessConfigResource) * .build(); * ApiFuture<Operation> future = instanceClient.updateAccessConfigInstanceCallable().futureCall(request); @@ -3826,23 +3223,13 @@ public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttp * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); - * Operation response = instanceClient.updateNetworkInterfaceInstance(instance, networkInterface, requestId, networkInterfaceResource); + * Operation response = instanceClient.updateNetworkInterfaceInstance(instance, networkInterface, networkInterfaceResource); * } *

* * @param instance The instance name for this request. * @param networkInterface The name of the network interface to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param networkInterfaceResource A network interface resource attached to an instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -3850,14 +3237,12 @@ public final Operation updateAccessConfigInstance(UpdateAccessConfigInstanceHttp public final Operation updateNetworkInterfaceInstance( ProjectZoneInstanceName instance, String networkInterface, - String requestId, NetworkInterface networkInterfaceResource) { UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() .setInstance(instance == null ? null : instance.toString()) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setNetworkInterfaceResource(networkInterfaceResource) .build(); return updateNetworkInterfaceInstance(request); @@ -3873,38 +3258,24 @@ public final Operation updateNetworkInterfaceInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); - * Operation response = instanceClient.updateNetworkInterfaceInstance(instance.toString(), networkInterface, requestId, networkInterfaceResource); + * Operation response = instanceClient.updateNetworkInterfaceInstance(instance.toString(), networkInterface, networkInterfaceResource); * } *

* * @param instance The instance name for this request. * @param networkInterface The name of the network interface to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param networkInterfaceResource A network interface resource attached to an instance. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation updateNetworkInterfaceInstance( - String instance, - String networkInterface, - String requestId, - NetworkInterface networkInterfaceResource) { + String instance, String networkInterface, NetworkInterface networkInterfaceResource) { UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() .setInstance(instance) .setNetworkInterface(networkInterface) - .setRequestId(requestId) .setNetworkInterfaceResource(networkInterfaceResource) .build(); return updateNetworkInterfaceInstance(request); @@ -3920,12 +3291,10 @@ public final Operation updateNetworkInterfaceInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); * UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setNetworkInterfaceResource(networkInterfaceResource) * .build(); * Operation response = instanceClient.updateNetworkInterfaceInstance(request); @@ -3951,12 +3320,10 @@ public final Operation updateNetworkInterfaceInstance( * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); * UpdateNetworkInterfaceInstanceHttpRequest request = UpdateNetworkInterfaceInstanceHttpRequest.newBuilder() * .setInstance(instance.toString()) * .setNetworkInterface(networkInterface) - * .setRequestId(requestId) * .setNetworkInterfaceResource(networkInterfaceResource) * .build(); * ApiFuture<Operation> future = instanceClient.updateNetworkInterfaceInstanceCallable().futureCall(request); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java index 83954bf65eae..e8d1b23bc558 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java @@ -17,14 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -91,95 +86,45 @@ private InstanceGroup( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) { - fieldMap.put( - "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp))); - } - if (fieldNames.contains("description") && description != null) { - fieldMap.put("description", Collections.singletonList(String.valueOf(description))); - } - if (fieldNames.contains("fingerprint") && fingerprint != null) { - fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint))); - } - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("name") && name != null) { - fieldMap.put("name", Collections.singletonList(String.valueOf(name))); - } - if (fieldNames.contains("namedPorts") && namedPorts != null) { - ImmutableList.Builder stringList = ImmutableList.builder(); - for (NamedPort item : namedPorts) { - stringList.add(item.toString()); - } - fieldMap.put("namedPorts", stringList.build()); - } - if (fieldNames.contains("network") && network != null) { - fieldMap.put("network", Collections.singletonList(String.valueOf(network))); - } - if (fieldNames.contains("region") && region != null) { - fieldMap.put("region", Collections.singletonList(String.valueOf(region))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("size") && size != null) { - fieldMap.put("size", Collections.singletonList(String.valueOf(size))); - } - if (fieldNames.contains("subnetwork") && subnetwork != null) { - fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork))); - } - if (fieldNames.contains("zone") && zone != null) { - fieldMap.put("zone", Collections.singletonList(String.valueOf(zone))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { - return String.valueOf(creationTimestamp); + return creationTimestamp; } if (fieldName.equals("description")) { - return String.valueOf(description); + return description; } if (fieldName.equals("fingerprint")) { - return String.valueOf(fingerprint); + return fingerprint; } if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("name")) { - return String.valueOf(name); + return name; } if (fieldName.equals("namedPorts")) { - return String.valueOf(namedPorts); + return namedPorts; } if (fieldName.equals("network")) { - return String.valueOf(network); + return network; } if (fieldName.equals("region")) { - return String.valueOf(region); + return region; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("size")) { - return String.valueOf(size); + return size; } if (fieldName.equals("subnetwork")) { - return String.valueOf(subnetwork); + return subnetwork; } if (fieldName.equals("zone")) { - return String.valueOf(zone); + return zone; } return null; } @@ -190,6 +135,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getCreationTimestamp() { return creationTimestamp; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java index e26acc7fa38c..ccf256b918a3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java @@ -17,12 +17,9 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -61,48 +58,24 @@ private InstanceGroupAggregatedList( } @Override - public Map> populateFieldsInMap(Set fieldNames) { - Map> fieldMap = new HashMap<>(); - if (fieldNames.contains("id") && id != null) { - fieldMap.put("id", Collections.singletonList(String.valueOf(id))); - } - if (fieldNames.contains("items") && items != null) { - fieldMap.put("items", Collections.singletonList(String.valueOf(items))); - } - if (fieldNames.contains("kind") && kind != null) { - fieldMap.put("kind", Collections.singletonList(String.valueOf(kind))); - } - if (fieldNames.contains("nextPageToken") && nextPageToken != null) { - fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken))); - } - if (fieldNames.contains("selfLink") && selfLink != null) { - fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink))); - } - if (fieldNames.contains("warning") && warning != null) { - fieldMap.put("warning", Collections.singletonList(String.valueOf(warning))); - } - return fieldMap; - } - - @Override - public String getFieldStringValue(String fieldName) { + public Object getFieldValue(String fieldName) { if (fieldName.equals("id")) { - return String.valueOf(id); + return id; } if (fieldName.equals("items")) { - return String.valueOf(items); + return items; } if (fieldName.equals("kind")) { - return String.valueOf(kind); + return kind; } if (fieldName.equals("nextPageToken")) { - return String.valueOf(nextPageToken); + return nextPageToken; } if (fieldName.equals("selfLink")) { - return String.valueOf(selfLink); + return selfLink; } if (fieldName.equals("warning")) { - return String.valueOf(warning); + return warning; } return null; } @@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() { return null; } + @Nullable + @Override + public List getFieldMask() { + return null; + } + public String getId() { return id; } diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java index 3db0b38062aa..7080dd8c45d8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java @@ -42,10 +42,9 @@ *

  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
- *   String requestId = "";
  *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
  *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
+ *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
  * }
  * 
  * 
@@ -163,35 +162,23 @@ public InstanceGroupStub getStub() { * *

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where you are adding instances. * @param instanceGroupsAddInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addInstancesInstanceGroup( - String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) .build(); @@ -207,35 +194,23 @@ public final Operation addInstancesInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsAddInstancesRequestResource);
+   *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup.toString(), instanceGroupsAddInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where you are adding instances. * @param instanceGroupsAddInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addInstancesInstanceGroup( - String requestId, String instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource) { AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource) .build(); @@ -251,11 +226,9 @@ public final Operation addInstancesInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource)
    *     .build();
@@ -280,11 +253,9 @@ public final Operation addInstancesInstanceGroup(AddInstancesInstanceGroupHttpRe
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
    *   AddInstancesInstanceGroupHttpRequest request = AddInstancesInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsAddInstancesRequestResource(instanceGroupsAddInstancesRequestResource)
    *     .build();
@@ -451,31 +422,19 @@ public final AggregatedListInstanceGroupsPagedResponse aggregatedListInstanceGro
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
-   *   Operation response = instanceGroupClient.deleteInstanceGroup(requestId, instanceGroup);
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(instanceGroup);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroup( - String requestId, ProjectZoneInstanceGroupName instanceGroup) { + public final Operation deleteInstanceGroup(ProjectZoneInstanceGroupName instanceGroup) { DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .build(); return deleteInstanceGroup(request); @@ -491,32 +450,19 @@ public final Operation deleteInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
-   *   Operation response = instanceGroupClient.deleteInstanceGroup(requestId, instanceGroup.toString());
+   *   Operation response = instanceGroupClient.deleteInstanceGroup(instanceGroup.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroup(String requestId, String instanceGroup) { + public final Operation deleteInstanceGroup(String instanceGroup) { DeleteInstanceGroupHttpRequest request = - DeleteInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) - .setInstanceGroup(instanceGroup) - .build(); + DeleteInstanceGroupHttpRequest.newBuilder().setInstanceGroup(instanceGroup).build(); return deleteInstanceGroup(request); } @@ -530,10 +476,8 @@ public final Operation deleteInstanceGroup(String requestId, String instanceGrou * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .build();
    *   Operation response = instanceGroupClient.deleteInstanceGroup(request);
@@ -558,10 +502,8 @@ public final Operation deleteInstanceGroup(DeleteInstanceGroupHttpRequest reques
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   DeleteInstanceGroupHttpRequest request = DeleteInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupClient.deleteInstanceGroupCallable().futureCall(request);
@@ -688,22 +630,12 @@ public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request)
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
-   *   Operation response = instanceGroupClient.insertInstanceGroup(zone, requestId, instanceGroupResource);
+   *   Operation response = instanceGroupClient.insertInstanceGroup(zone, instanceGroupResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== * resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== * resource_for v1.regionInstanceGroups ==) @@ -711,12 +643,11 @@ public final InstanceGroup getInstanceGroup(GetInstanceGroupHttpRequest request) */ @BetaApi public final Operation insertInstanceGroup( - ProjectZoneName zone, String requestId, InstanceGroup instanceGroupResource) { + ProjectZoneName zone, InstanceGroup instanceGroupResource) { InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setInstanceGroupResource(instanceGroupResource) .build(); return insertInstanceGroup(request); @@ -732,35 +663,23 @@ public final Operation insertInstanceGroup( *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
-   *   Operation response = instanceGroupClient.insertInstanceGroup(zone.toString(), requestId, instanceGroupResource);
+   *   Operation response = instanceGroupClient.insertInstanceGroup(zone.toString(), instanceGroupResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupResource InstanceGroups (== resource_for beta.instanceGroups ==) (== * resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== * resource_for v1.regionInstanceGroups ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInstanceGroup( - String zone, String requestId, InstanceGroup instanceGroupResource) { + public final Operation insertInstanceGroup(String zone, InstanceGroup instanceGroupResource) { InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder() .setZone(zone) - .setRequestId(requestId) .setInstanceGroupResource(instanceGroupResource) .build(); return insertInstanceGroup(request); @@ -776,11 +695,9 @@ public final Operation insertInstanceGroup( *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setInstanceGroupResource(instanceGroupResource)
    *     .build();
    *   Operation response = instanceGroupClient.insertInstanceGroup(request);
@@ -805,11 +722,9 @@ public final Operation insertInstanceGroup(InsertInstanceGroupHttpRequest reques
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build();
    *   InsertInstanceGroupHttpRequest request = InsertInstanceGroupHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setInstanceGroupResource(instanceGroupResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupClient.insertInstanceGroupCallable().futureCall(request);
@@ -1136,22 +1051,12 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource);
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(instanceGroup, instanceGroupsRemoveInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the specified instances will be * removed. * @param instanceGroupsRemoveInstancesRequestResource @@ -1159,13 +1064,11 @@ public final ListInstancesInstanceGroupsPagedResponse listInstancesInstanceGroup */ @BetaApi public final Operation removeInstancesInstanceGroup( - String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setInstanceGroupsRemoveInstancesRequestResource( instanceGroupsRemoveInstancesRequestResource) @@ -1186,22 +1089,12 @@ public final Operation removeInstancesInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsRemoveInstancesRequestResource);
+   *   Operation response = instanceGroupClient.removeInstancesInstanceGroup(instanceGroup.toString(), instanceGroupsRemoveInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the specified instances will be * removed. * @param instanceGroupsRemoveInstancesRequestResource @@ -1209,13 +1102,11 @@ public final Operation removeInstancesInstanceGroup( */ @BetaApi public final Operation removeInstancesInstanceGroup( - String requestId, String instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setInstanceGroupsRemoveInstancesRequestResource( instanceGroupsRemoveInstancesRequestResource) @@ -1236,11 +1127,9 @@ public final Operation removeInstancesInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource)
    *     .build();
@@ -1270,11 +1159,9 @@ public final Operation removeInstancesInstanceGroup(
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build();
    *   RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsRemoveInstancesRequestResource(instanceGroupsRemoveInstancesRequestResource)
    *     .build();
@@ -1298,35 +1185,23 @@ public final Operation removeInstancesInstanceGroup(
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the named ports are updated. * @param instanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setNamedPortsInstanceGroup( - String requestId, ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setInstanceGroupsSetNamedPortsRequestResource( instanceGroupsSetNamedPortsRequestResource) @@ -1342,35 +1217,23 @@ public final Operation setNamedPortsInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(requestId, instanceGroup.toString(), instanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = instanceGroupClient.setNamedPortsInstanceGroup(instanceGroup.toString(), instanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the instance group where the named ports are updated. * @param instanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setNamedPortsInstanceGroup( - String requestId, String instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource) { SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setInstanceGroupsSetNamedPortsRequestResource( instanceGroupsSetNamedPortsRequestResource) @@ -1386,11 +1249,9 @@ public final Operation setNamedPortsInstanceGroup( * *


    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource)
    *     .build();
@@ -1414,11 +1275,9 @@ public final Operation setNamedPortsInstanceGroup(SetNamedPortsInstanceGroupHttp
    *
    * 

    * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
    *   InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsInstanceGroupHttpRequest request = SetNamedPortsInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setInstanceGroupsSetNamedPortsRequestResource(instanceGroupsSetNamedPortsRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java
index 61e7a98c78bc..5d45ba71b0dc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InstanceGroupList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceGroup item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java
index 2a5b1234ee97..c517a08d25fa 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -103,117 +98,54 @@ private InstanceGroupManager(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("baseInstanceName") && baseInstanceName != null) {
-      fieldMap.put("baseInstanceName", Collections.singletonList(String.valueOf(baseInstanceName)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("currentActions") && currentActions != null) {
-      fieldMap.put("currentActions", Collections.singletonList(String.valueOf(currentActions)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) {
-      fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("namedPorts") && namedPorts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NamedPort item : namedPorts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("namedPorts", stringList.build());
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("targetPools") && targetPools != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : targetPools) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetPools", stringList.build());
-    }
-    if (fieldNames.contains("targetSize") && targetSize != null) {
-      fieldMap.put("targetSize", Collections.singletonList(String.valueOf(targetSize)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("baseInstanceName")) {
-      return String.valueOf(baseInstanceName);
+      return baseInstanceName;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("currentActions")) {
-      return String.valueOf(currentActions);
+      return currentActions;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("instanceTemplate")) {
-      return String.valueOf(instanceTemplate);
+      return instanceTemplate;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("namedPorts")) {
-      return String.valueOf(namedPorts);
+      return namedPorts;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("targetPools")) {
-      return String.valueOf(targetPools);
+      return targetPools;
     }
     if (fieldName.equals("targetSize")) {
-      return String.valueOf(targetSize);
+      return targetSize;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -224,6 +156,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getBaseInstanceName() {
     return baseInstanceName;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java
index 4ffb882381ce..e7dee1d39935 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,62 +65,30 @@ private InstanceGroupManagerActionsSummary(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("abandoning") && abandoning != null) {
-      fieldMap.put("abandoning", Collections.singletonList(String.valueOf(abandoning)));
-    }
-    if (fieldNames.contains("creating") && creating != null) {
-      fieldMap.put("creating", Collections.singletonList(String.valueOf(creating)));
-    }
-    if (fieldNames.contains("creatingWithoutRetries") && creatingWithoutRetries != null) {
-      fieldMap.put(
-          "creatingWithoutRetries",
-          Collections.singletonList(String.valueOf(creatingWithoutRetries)));
-    }
-    if (fieldNames.contains("deleting") && deleting != null) {
-      fieldMap.put("deleting", Collections.singletonList(String.valueOf(deleting)));
-    }
-    if (fieldNames.contains("none") && none != null) {
-      fieldMap.put("none", Collections.singletonList(String.valueOf(none)));
-    }
-    if (fieldNames.contains("recreating") && recreating != null) {
-      fieldMap.put("recreating", Collections.singletonList(String.valueOf(recreating)));
-    }
-    if (fieldNames.contains("refreshing") && refreshing != null) {
-      fieldMap.put("refreshing", Collections.singletonList(String.valueOf(refreshing)));
-    }
-    if (fieldNames.contains("restarting") && restarting != null) {
-      fieldMap.put("restarting", Collections.singletonList(String.valueOf(restarting)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("abandoning")) {
-      return String.valueOf(abandoning);
+      return abandoning;
     }
     if (fieldName.equals("creating")) {
-      return String.valueOf(creating);
+      return creating;
     }
     if (fieldName.equals("creatingWithoutRetries")) {
-      return String.valueOf(creatingWithoutRetries);
+      return creatingWithoutRetries;
     }
     if (fieldName.equals("deleting")) {
-      return String.valueOf(deleting);
+      return deleting;
     }
     if (fieldName.equals("none")) {
-      return String.valueOf(none);
+      return none;
     }
     if (fieldName.equals("recreating")) {
-      return String.valueOf(recreating);
+      return recreating;
     }
     if (fieldName.equals("refreshing")) {
-      return String.valueOf(refreshing);
+      return refreshing;
     }
     if (fieldName.equals("restarting")) {
-      return String.valueOf(restarting);
+      return restarting;
     }
     return null;
   }
@@ -135,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getAbandoning() {
     return abandoning;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java
index f6d9303baa32..3f69694136f6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private InstanceGroupManagerAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
index 5f9d80ea5e9d..c266a5718d82 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java
@@ -42,10 +42,9 @@
  * 
  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
- *   String requestId = "";
  *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
  *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
@@ -175,36 +174,24 @@ public InstanceGroupManagerStub getStub() { * *

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation abandonInstancesInstanceGroupManager( - String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setInstanceGroupManagersAbandonInstancesRequestResource( @@ -233,36 +220,24 @@ public final Operation abandonInstancesInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation abandonInstancesInstanceGroupManager( - String requestId, String instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setInstanceGroupManagersAbandonInstancesRequestResource( instanceGroupManagersAbandonInstancesRequestResource) @@ -290,11 +265,9 @@ public final Operation abandonInstancesInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -331,11 +304,9 @@ public final Operation abandonInstancesInstanceGroupManager(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesInstanceGroupManagerHttpRequest request = AbandonInstancesInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersAbandonInstancesRequestResource(instanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -504,31 +475,20 @@ public final AggregatedListInstanceGroupManagersPagedResponse aggregatedListInst
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(requestId, instanceGroupManager);
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(instanceGroupManager);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInstanceGroupManager( - String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager) { + ProjectZoneInstanceGroupManagerName instanceGroupManager) { DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .build(); @@ -545,30 +505,19 @@ public final Operation deleteInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(requestId, instanceGroupManager.toString());
+   *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(instanceGroupManager.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceGroupManager(String requestId, String instanceGroupManager) { + public final Operation deleteInstanceGroupManager(String instanceGroupManager) { DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .build(); return deleteInstanceGroupManager(request); @@ -584,10 +533,8 @@ public final Operation deleteInstanceGroupManager(String requestId, String insta * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = instanceGroupManagerClient.deleteInstanceGroupManager(request);
@@ -612,10 +559,8 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteInstanceGroupManagerHttpRequest request = DeleteInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupManagerClient.deleteInstanceGroupManagerCallable().futureCall(request);
@@ -649,36 +594,24 @@ public final Operation deleteInstanceGroupManager(DeleteInstanceGroupManagerHttp
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInstancesInstanceGroupManager( - String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setInstanceGroupManagersDeleteInstancesRequestResource( @@ -706,36 +639,24 @@ public final Operation deleteInstancesInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.deleteInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInstancesInstanceGroupManager( - String requestId, String instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setInstanceGroupManagersDeleteInstancesRequestResource( instanceGroupManagersDeleteInstancesRequestResource) @@ -762,11 +683,9 @@ public final Operation deleteInstancesInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -802,11 +721,9 @@ public final Operation deleteInstancesInstanceGroupManager(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesInstanceGroupManagerHttpRequest request = DeleteInstancesInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersDeleteInstancesRequestResource(instanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -945,22 +862,12 @@ public final InstanceGroupManager getInstanceGroupManager(
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource);
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone, instanceGroupManagerResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the managed instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== * resource_for beta.regionInstanceGroupManagers ==) (== resource_for @@ -969,12 +876,11 @@ public final InstanceGroupManager getInstanceGroupManager( */ @BetaApi public final Operation insertInstanceGroupManager( - ProjectZoneName zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { + ProjectZoneName zone, InstanceGroupManager instanceGroupManagerResource) { InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setInstanceGroupManagerResource(instanceGroupManagerResource) .build(); return insertInstanceGroupManager(request); @@ -996,22 +902,12 @@ public final Operation insertInstanceGroupManager( *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone.toString(), requestId, instanceGroupManagerResource);
+   *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(zone.toString(), instanceGroupManagerResource);
    * }
    * 
* * @param zone The name of the zone where you want to create the managed instance group. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== * resource_for beta.regionInstanceGroupManagers ==) (== resource_for @@ -1020,12 +916,11 @@ public final Operation insertInstanceGroupManager( */ @BetaApi public final Operation insertInstanceGroupManager( - String zone, String requestId, InstanceGroupManager instanceGroupManagerResource) { + String zone, InstanceGroupManager instanceGroupManagerResource) { InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder() .setZone(zone) - .setRequestId(requestId) .setInstanceGroupManagerResource(instanceGroupManagerResource) .build(); return insertInstanceGroupManager(request); @@ -1047,11 +942,9 @@ public final Operation insertInstanceGroupManager( *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
    *   Operation response = instanceGroupManagerClient.insertInstanceGroupManager(request);
@@ -1082,11 +975,9 @@ public final Operation insertInstanceGroupManager(InsertInstanceGroupManagerHttp
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertInstanceGroupManagerHttpRequest request = InsertInstanceGroupManagerHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupManagerClient.insertInstanceGroupManagerCallable().futureCall(request);
@@ -1384,36 +1275,24 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersRecreateInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation recreateInstancesInstanceGroupManager( - String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setInstanceGroupManagersRecreateInstancesRequestResource( @@ -1440,36 +1319,24 @@ public final Operation recreateInstancesInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersRecreateInstancesRequestResource);
+   *   Operation response = instanceGroupManagerClient.recreateInstancesInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersRecreateInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersRecreateInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation recreateInstancesInstanceGroupManager( - String requestId, String instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource) { RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setInstanceGroupManagersRecreateInstancesRequestResource( instanceGroupManagersRecreateInstancesRequestResource) @@ -1495,11 +1362,9 @@ public final Operation recreateInstancesInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
    *     .build();
@@ -1534,11 +1399,9 @@ public final Operation recreateInstancesInstanceGroupManager(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
    *   RecreateInstancesInstanceGroupManagerHttpRequest request = RecreateInstancesInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersRecreateInstancesRequestResource(instanceGroupManagersRecreateInstancesRequestResource)
    *     .build();
@@ -1571,35 +1434,24 @@ public final Operation recreateInstancesInstanceGroupManager(
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, requestId, instanceGroupManager);
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, instanceGroupManager);
    * }
    * 
* * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resizeInstanceGroupManager( - Integer size, String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager) { + Integer size, ProjectZoneInstanceGroupManagerName instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() .setSize(size) - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .build(); @@ -1623,35 +1475,23 @@ public final Operation resizeInstanceGroupManager( *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, requestId, instanceGroupManager.toString());
+   *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(size, instanceGroupManager.toString());
    * }
    * 
* * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation resizeInstanceGroupManager( - Integer size, String requestId, String instanceGroupManager) { + public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) { ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder() .setSize(size) - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .build(); return resizeInstanceGroupManager(request); @@ -1674,11 +1514,9 @@ public final Operation resizeInstanceGroupManager( *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = instanceGroupManagerClient.resizeInstanceGroupManager(request);
@@ -1710,11 +1548,9 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = instanceGroupManagerClient.resizeInstanceGroupManagerCallable().futureCall(request);
@@ -1738,36 +1574,24 @@ public final Operation resizeInstanceGroupManager(ResizeInstanceGroupManagerHttp
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetInstanceTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setInstanceTemplateInstanceGroupManager( - String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setInstanceGroupManagersSetInstanceTemplateRequestResource( @@ -1785,36 +1609,24 @@ public final Operation setInstanceTemplateInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersSetInstanceTemplateRequestResource);
+   *   Operation response = instanceGroupManagerClient.setInstanceTemplateInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersSetInstanceTemplateRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetInstanceTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setInstanceTemplateInstanceGroupManager( - String requestId, String instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource) { SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setInstanceGroupManagersSetInstanceTemplateRequestResource( instanceGroupManagersSetInstanceTemplateRequestResource) @@ -1831,11 +1643,9 @@ public final Operation setInstanceTemplateInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
    *     .build();
@@ -1861,11 +1671,9 @@ public final Operation setInstanceTemplateInstanceGroupManager(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateInstanceGroupManagerHttpRequest request = SetInstanceTemplateInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetInstanceTemplateRequestResource(instanceGroupManagersSetInstanceTemplateRequestResource)
    *     .build();
@@ -1893,36 +1701,24 @@ public final Operation setInstanceTemplateInstanceGroupManager(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetPoolsInstanceGroupManager( - String requestId, ProjectZoneInstanceGroupManagerName instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setInstanceGroupManagersSetTargetPoolsRequestResource( @@ -1943,36 +1739,24 @@ public final Operation setTargetPoolsInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(requestId, instanceGroupManager.toString(), instanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = instanceGroupManagerClient.setTargetPoolsInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param instanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetPoolsInstanceGroupManager( - String requestId, String instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setInstanceGroupManagersSetTargetPoolsRequestResource( instanceGroupManagersSetTargetPoolsRequestResource) @@ -1992,11 +1776,9 @@ public final Operation setTargetPoolsInstanceGroupManager( * *


    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
@@ -2025,11 +1807,9 @@ public final Operation setTargetPoolsInstanceGroupManager(
    *
    * 

    * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
    *   InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsInstanceGroupManagerHttpRequest request = SetTargetPoolsInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setInstanceGroupManagersSetTargetPoolsRequestResource(instanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java
index d2b342712b58..cf3f5523287f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InstanceGroupManagerList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceGroupManager item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java
index b38c1b293980..b4b0f1a82ce7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstanceGroupManagersAbandonInstancesRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java
index c96ff91fdfbc..8b7e1fde5548 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstanceGroupManagersDeleteInstancesRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java
index 6b0747ba2282..56adcdd6f18f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -42,29 +38,22 @@ private InstanceGroupManagersListManagedInstancesResponse(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("managedInstances") && managedInstances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ManagedInstance item : managedInstances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("managedInstances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("managedInstances")) {
+      return managedInstances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("managedInstances")) {
-      return String.valueOf(managedInstances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java
index d672f3af897c..26b38255944f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstanceGroupManagersRecreateInstancesRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java
index 7a09476e60bc..2423d1f5b481 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,28 +41,12 @@ private InstanceGroupManagersScopedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instanceGroupManagers") && instanceGroupManagers != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceGroupManager item : instanceGroupManagers) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instanceGroupManagers", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("instanceGroupManagers")) {
-      return String.valueOf(instanceGroupManagers);
+      return instanceGroupManagers;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -78,6 +57,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getInstanceGroupManagersList() {
     return instanceGroupManagers;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java
index 6b8d4fdc5c1e..a5a25c5e287b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private InstanceGroupManagersSetInstanceTemplateRequest(String instanceTemplate)
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) {
-      fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instanceTemplate")) {
+      return instanceTemplate;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instanceTemplate")) {
-      return String.valueOf(instanceTemplate);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java
index 03c59c8515e7..b725f6531a08 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private InstanceGroupManagersSetTargetPoolsRequest(String fingerprint, List> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("targetPools") && targetPools != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : targetPools) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetPools", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("targetPools")) {
-      return String.valueOf(targetPools);
+      return targetPools;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getFingerprint() {
     return fingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java
index ba597e29026d..019168d28d14 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstanceGroupsAddInstancesRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceReference item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java
index 95d0d999162f..f981f564e892 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InstanceGroupsListInstances(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceWithNamedPorts item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java
index 25fe971e58c5..84f5a6944f18 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private InstanceGroupsListInstancesRequest(String instanceState) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instanceState") && instanceState != null) {
-      fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instanceState")) {
+      return instanceState;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instanceState")) {
-      return String.valueOf(instanceState);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java
index e08eb75e9557..3e5bf339f895 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstanceGroupsRemoveInstancesRequest(List instances)
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceReference item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java
index ad9dbc96e281..88f22ad13a7d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private InstanceGroupsScopedList(List instanceGroups, Warning war
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instanceGroups") && instanceGroups != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceGroup item : instanceGroups) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instanceGroups", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("instanceGroups")) {
-      return String.valueOf(instanceGroups);
+      return instanceGroups;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getInstanceGroupsList() {
     return instanceGroups;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java
index 7dabe633d62a..d5a0eea248dd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private InstanceGroupsSetNamedPortsRequest(String fingerprint, List n
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("namedPorts") && namedPorts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NamedPort item : namedPorts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("namedPorts", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("namedPorts")) {
-      return String.valueOf(namedPorts);
+      return namedPorts;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getFingerprint() {
     return fingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java
index d941f757c9d3..ce2e48dc6a78 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InstanceList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Instance item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java
index 5b68399cdcfb..28412fdaae8f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InstanceListReferrers(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Reference item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java
index 9bcd0e989942..88ff621565a8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private InstanceMoveRequest(String destinationZone, String targetInstance) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("destinationZone") && destinationZone != null) {
-      fieldMap.put("destinationZone", Collections.singletonList(String.valueOf(destinationZone)));
-    }
-    if (fieldNames.contains("targetInstance") && targetInstance != null) {
-      fieldMap.put("targetInstance", Collections.singletonList(String.valueOf(targetInstance)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("destinationZone")) {
-      return String.valueOf(destinationZone);
+      return destinationZone;
     }
     if (fieldName.equals("targetInstance")) {
-      return String.valueOf(targetInstance);
+      return targetInstance;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDestinationZone() {
     return destinationZone;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java
index 31bacf16a954..d03e13b7b481 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java
@@ -17,14 +17,10 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -87,100 +83,42 @@ private InstanceProperties(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("canIpForward") && canIpForward != null) {
-      fieldMap.put("canIpForward", Collections.singletonList(String.valueOf(canIpForward)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("disks") && disks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AttachedDisk item : disks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("disks", stringList.build());
-    }
-    if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AcceleratorConfig item : guestAccelerators) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("guestAccelerators", stringList.build());
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    if (fieldNames.contains("machineType") && machineType != null) {
-      fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType)));
-    }
-    if (fieldNames.contains("metadata") && metadata != null) {
-      fieldMap.put("metadata", Collections.singletonList(String.valueOf(metadata)));
-    }
-    if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) {
-      fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform)));
-    }
-    if (fieldNames.contains("networkInterfaces") && networkInterfaces != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NetworkInterface item : networkInterfaces) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("networkInterfaces", stringList.build());
-    }
-    if (fieldNames.contains("scheduling") && scheduling != null) {
-      fieldMap.put("scheduling", Collections.singletonList(String.valueOf(scheduling)));
-    }
-    if (fieldNames.contains("serviceAccounts") && serviceAccounts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ServiceAccount item : serviceAccounts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("serviceAccounts", stringList.build());
-    }
-    if (fieldNames.contains("tags") && tags != null) {
-      fieldMap.put("tags", Collections.singletonList(String.valueOf(tags)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("canIpForward")) {
-      return String.valueOf(canIpForward);
+      return canIpForward;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("disks")) {
-      return String.valueOf(disks);
+      return disks;
     }
     if (fieldName.equals("guestAccelerators")) {
-      return String.valueOf(guestAccelerators);
+      return guestAccelerators;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     if (fieldName.equals("machineType")) {
-      return String.valueOf(machineType);
+      return machineType;
     }
     if (fieldName.equals("metadata")) {
-      return String.valueOf(metadata);
+      return metadata;
     }
     if (fieldName.equals("minCpuPlatform")) {
-      return String.valueOf(minCpuPlatform);
+      return minCpuPlatform;
     }
     if (fieldName.equals("networkInterfaces")) {
-      return String.valueOf(networkInterfaces);
+      return networkInterfaces;
     }
     if (fieldName.equals("scheduling")) {
-      return String.valueOf(scheduling);
+      return scheduling;
     }
     if (fieldName.equals("serviceAccounts")) {
-      return String.valueOf(serviceAccounts);
+      return serviceAccounts;
     }
     if (fieldName.equals("tags")) {
-      return String.valueOf(tags);
+      return tags;
     }
     return null;
   }
@@ -191,6 +129,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getCanIpForward() {
     return canIpForward;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java
index a2688b582701..c535675b686e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private InstanceReference(String instance) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instance")) {
+      return instance;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java
index 0aab1348c662..acc02653fe16 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -65,55 +61,27 @@ private InstanceTemplate(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("properties") && properties != null) {
-      fieldMap.put("properties", Collections.singletonList(String.valueOf(properties)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("properties")) {
-      return String.valueOf(properties);
+      return properties;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -124,6 +92,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
index 62e918f5f4e3..6e2e6bb04675 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java
@@ -43,8 +43,7 @@
  * 
  * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
  *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
- *   String requestId = "";
- *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
+ *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate);
  * }
  * 
  * 
@@ -164,31 +163,20 @@ public InstanceTemplateStub getStub() { *

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
-   *   String requestId = "";
-   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId);
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate);
    * }
    * 
* * @param instanceTemplate The name of the instance template to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInstanceTemplate( - ProjectGlobalInstanceTemplateName instanceTemplate, String requestId) { + ProjectGlobalInstanceTemplateName instanceTemplate) { DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder() .setInstanceTemplate(instanceTemplate == null ? null : instanceTemplate.toString()) - .setRequestId(requestId) .build(); return deleteInstanceTemplate(request); } @@ -203,30 +191,19 @@ public final Operation deleteInstanceTemplate( *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
-   *   String requestId = "";
-   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString(), requestId);
+   *   Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate.toString());
    * }
    * 
* * @param instanceTemplate The name of the instance template to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInstanceTemplate(String instanceTemplate, String requestId) { + public final Operation deleteInstanceTemplate(String instanceTemplate) { DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder() .setInstanceTemplate(instanceTemplate) - .setRequestId(requestId) .build(); return deleteInstanceTemplate(request); } @@ -241,10 +218,8 @@ public final Operation deleteInstanceTemplate(String instanceTemplate, String re *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
-   *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = instanceTemplateClient.deleteInstanceTemplate(request);
    * }
@@ -268,10 +243,8 @@ public final Operation deleteInstanceTemplate(DeleteInstanceTemplateHttpRequest
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
    *   ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]");
-   *   String requestId = "";
    *   DeleteInstanceTemplateHttpRequest request = DeleteInstanceTemplateHttpRequest.newBuilder()
    *     .setInstanceTemplate(instanceTemplate.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = instanceTemplateClient.deleteInstanceTemplateCallable().futureCall(request);
    *   // Do something
@@ -399,22 +372,12 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest
    *
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
-   *   Operation response = instanceTemplateClient.insertInstanceTemplate(requestId, project, instanceTemplateResource);
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(project, instanceTemplateResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceTemplateResource An Instance Template resource. (== resource_for * beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) @@ -422,11 +385,10 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest */ @BetaApi public final Operation insertInstanceTemplate( - String requestId, ProjectName project, InstanceTemplate instanceTemplateResource) { + ProjectName project, InstanceTemplate instanceTemplateResource) { InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setInstanceTemplateResource(instanceTemplateResource) .build(); @@ -444,22 +406,12 @@ public final Operation insertInstanceTemplate( * *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
-   *   Operation response = instanceTemplateClient.insertInstanceTemplate(requestId, project.toString(), instanceTemplateResource);
+   *   Operation response = instanceTemplateClient.insertInstanceTemplate(project.toString(), instanceTemplateResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceTemplateResource An Instance Template resource. (== resource_for * beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) @@ -467,11 +419,10 @@ public final Operation insertInstanceTemplate( */ @BetaApi public final Operation insertInstanceTemplate( - String requestId, String project, InstanceTemplate instanceTemplateResource) { + String project, InstanceTemplate instanceTemplateResource) { InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setInstanceTemplateResource(instanceTemplateResource) .build(); @@ -489,11 +440,9 @@ public final Operation insertInstanceTemplate( * *


    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
    *   InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceTemplateResource(instanceTemplateResource)
    *     .build();
@@ -520,11 +469,9 @@ public final Operation insertInstanceTemplate(InsertInstanceTemplateHttpRequest
    *
    * 

    * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build();
    *   InsertInstanceTemplateHttpRequest request = InsertInstanceTemplateHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceTemplateResource(instanceTemplateResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java
index 978a2165ef68..161856e0997d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InstanceTemplateList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceTemplate item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java
index d5a2289c923f..76f81f42a5dd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -48,34 +43,15 @@ private InstanceWithNamedPorts(String instance, List namedPorts, Stri
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("namedPorts") && namedPorts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NamedPort item : namedPorts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("namedPorts", stringList.build());
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("namedPorts")) {
-      return String.valueOf(namedPorts);
+      return namedPorts;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     return null;
   }
@@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getInstance() {
     return instance;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java
index a90d6ddd0e7f..44cf666578cb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private InstancesScopedList(List instances, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Instance item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
+      return instances;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getInstancesList() {
     return instances;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java
index 8f5854007be7..2cc3bef69f5e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +40,12 @@ private InstancesSetLabelsRequest(String labelFingerprint, Map l
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     return null;
   }
@@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getLabelFingerprint() {
     return labelFingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java
index edc382e08ae0..c6310a43d417 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstancesSetMachineResourcesRequest(List guestAcceler
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("guestAccelerators") && guestAccelerators != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AcceleratorConfig item : guestAccelerators) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("guestAccelerators", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("guestAccelerators")) {
+      return guestAccelerators;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("guestAccelerators")) {
-      return String.valueOf(guestAccelerators);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java
index 0fafbb310071..a62184708523 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private InstancesSetMachineTypeRequest(String machineType) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("machineType") && machineType != null) {
-      fieldMap.put("machineType", Collections.singletonList(String.valueOf(machineType)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("machineType")) {
+      return machineType;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("machineType")) {
-      return String.valueOf(machineType);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java
index b8a75edb1d66..dc4dc20ceb8e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private InstancesSetMinCpuPlatformRequest(String minCpuPlatform) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("minCpuPlatform") && minCpuPlatform != null) {
-      fieldMap.put("minCpuPlatform", Collections.singletonList(String.valueOf(minCpuPlatform)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("minCpuPlatform")) {
+      return minCpuPlatform;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("minCpuPlatform")) {
-      return String.valueOf(minCpuPlatform);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java
index 756984e0496c..0df845b9967e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private InstancesSetServiceAccountRequest(String email, List scopes) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("email") && email != null) {
-      fieldMap.put("email", Collections.singletonList(String.valueOf(email)));
-    }
-    if (fieldNames.contains("scopes") && scopes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : scopes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("scopes", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("email")) {
-      return String.valueOf(email);
+      return email;
     }
     if (fieldName.equals("scopes")) {
-      return String.valueOf(scopes);
+      return scopes;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getEmail() {
     return email;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java
index 7622b603c226..c11e404ccae7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private InstancesStartWithEncryptionKeyRequest(List> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("disks") && disks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (CustomerEncryptionKeyProtectedDisk item : disks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("disks", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("disks")) {
+      return disks;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("disks")) {
-      return String.valueOf(disks);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java
index 066e1fb0cea4..089b0939531e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -123,155 +118,69 @@ private Interconnect(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("adminEnabled") && adminEnabled != null) {
-      fieldMap.put("adminEnabled", Collections.singletonList(String.valueOf(adminEnabled)));
-    }
-    if (fieldNames.contains("circuitInfos") && circuitInfos != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InterconnectCircuitInfo item : circuitInfos) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("circuitInfos", stringList.build());
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("customerName") && customerName != null) {
-      fieldMap.put("customerName", Collections.singletonList(String.valueOf(customerName)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("expectedOutages") && expectedOutages != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InterconnectOutageNotification item : expectedOutages) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("expectedOutages", stringList.build());
-    }
-    if (fieldNames.contains("googleIpAddress") && googleIpAddress != null) {
-      fieldMap.put("googleIpAddress", Collections.singletonList(String.valueOf(googleIpAddress)));
-    }
-    if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) {
-      fieldMap.put(
-          "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : interconnectAttachments) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("interconnectAttachments", stringList.build());
-    }
-    if (fieldNames.contains("interconnectType") && interconnectType != null) {
-      fieldMap.put("interconnectType", Collections.singletonList(String.valueOf(interconnectType)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("linkType") && linkType != null) {
-      fieldMap.put("linkType", Collections.singletonList(String.valueOf(linkType)));
-    }
-    if (fieldNames.contains("location") && location != null) {
-      fieldMap.put("location", Collections.singletonList(String.valueOf(location)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("nocContactEmail") && nocContactEmail != null) {
-      fieldMap.put("nocContactEmail", Collections.singletonList(String.valueOf(nocContactEmail)));
-    }
-    if (fieldNames.contains("operationalStatus") && operationalStatus != null) {
-      fieldMap.put(
-          "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus)));
-    }
-    if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) {
-      fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress)));
-    }
-    if (fieldNames.contains("provisionedLinkCount") && provisionedLinkCount != null) {
-      fieldMap.put(
-          "provisionedLinkCount", Collections.singletonList(String.valueOf(provisionedLinkCount)));
-    }
-    if (fieldNames.contains("requestedLinkCount") && requestedLinkCount != null) {
-      fieldMap.put(
-          "requestedLinkCount", Collections.singletonList(String.valueOf(requestedLinkCount)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("adminEnabled")) {
-      return String.valueOf(adminEnabled);
+      return adminEnabled;
     }
     if (fieldName.equals("circuitInfos")) {
-      return String.valueOf(circuitInfos);
+      return circuitInfos;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("customerName")) {
-      return String.valueOf(customerName);
+      return customerName;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("expectedOutages")) {
-      return String.valueOf(expectedOutages);
+      return expectedOutages;
     }
     if (fieldName.equals("googleIpAddress")) {
-      return String.valueOf(googleIpAddress);
+      return googleIpAddress;
     }
     if (fieldName.equals("googleReferenceId")) {
-      return String.valueOf(googleReferenceId);
+      return googleReferenceId;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("interconnectAttachments")) {
-      return String.valueOf(interconnectAttachments);
+      return interconnectAttachments;
     }
     if (fieldName.equals("interconnectType")) {
-      return String.valueOf(interconnectType);
+      return interconnectType;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("linkType")) {
-      return String.valueOf(linkType);
+      return linkType;
     }
     if (fieldName.equals("location")) {
-      return String.valueOf(location);
+      return location;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("nocContactEmail")) {
-      return String.valueOf(nocContactEmail);
+      return nocContactEmail;
     }
     if (fieldName.equals("operationalStatus")) {
-      return String.valueOf(operationalStatus);
+      return operationalStatus;
     }
     if (fieldName.equals("peerIpAddress")) {
-      return String.valueOf(peerIpAddress);
+      return peerIpAddress;
     }
     if (fieldName.equals("provisionedLinkCount")) {
-      return String.valueOf(provisionedLinkCount);
+      return provisionedLinkCount;
     }
     if (fieldName.equals("requestedLinkCount")) {
-      return String.valueOf(requestedLinkCount);
+      return requestedLinkCount;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -282,6 +191,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getAdminEnabled() {
     return adminEnabled;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java
index 25ad248755c8..ad6378241434 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -93,104 +89,48 @@ private InterconnectAttachment(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("cloudRouterIpAddress") && cloudRouterIpAddress != null) {
-      fieldMap.put(
-          "cloudRouterIpAddress", Collections.singletonList(String.valueOf(cloudRouterIpAddress)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("customerRouterIpAddress") && customerRouterIpAddress != null) {
-      fieldMap.put(
-          "customerRouterIpAddress",
-          Collections.singletonList(String.valueOf(customerRouterIpAddress)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("googleReferenceId") && googleReferenceId != null) {
-      fieldMap.put(
-          "googleReferenceId", Collections.singletonList(String.valueOf(googleReferenceId)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("interconnect") && interconnect != null) {
-      fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("operationalStatus") && operationalStatus != null) {
-      fieldMap.put(
-          "operationalStatus", Collections.singletonList(String.valueOf(operationalStatus)));
-    }
-    if (fieldNames.contains("privateInterconnectInfo") && privateInterconnectInfo != null) {
-      fieldMap.put(
-          "privateInterconnectInfo",
-          Collections.singletonList(String.valueOf(privateInterconnectInfo)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("cloudRouterIpAddress")) {
-      return String.valueOf(cloudRouterIpAddress);
+      return cloudRouterIpAddress;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("customerRouterIpAddress")) {
-      return String.valueOf(customerRouterIpAddress);
+      return customerRouterIpAddress;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("googleReferenceId")) {
-      return String.valueOf(googleReferenceId);
+      return googleReferenceId;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("interconnect")) {
-      return String.valueOf(interconnect);
+      return interconnect;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("operationalStatus")) {
-      return String.valueOf(operationalStatus);
+      return operationalStatus;
     }
     if (fieldName.equals("privateInterconnectInfo")) {
-      return String.valueOf(privateInterconnectInfo);
+      return privateInterconnectInfo;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -201,6 +141,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCloudRouterIpAddress() {
     return cloudRouterIpAddress;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java
index ef8b07654665..3bcad79216bf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private InterconnectAttachmentAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
index ef14ae1d9441..2db9cbfaad1b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
- *   String requestId = "";
  *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
- *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
+ *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment);
  * }
  * 
  * 
@@ -307,31 +306,20 @@ public InterconnectAttachmentStub getStub() { * *

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
-   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
+   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param interconnectAttachment Name of the interconnect attachment to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInterconnectAttachment( - String requestId, ProjectRegionInterconnectAttachmentName interconnectAttachment) { + ProjectRegionInterconnectAttachmentName interconnectAttachment) { DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) .setInterconnectAttachment( interconnectAttachment == null ? null : interconnectAttachment.toString()) .build(); @@ -346,31 +334,19 @@ public final Operation deleteInterconnectAttachment( * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
-   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment.toString());
+   *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param interconnectAttachment Name of the interconnect attachment to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnectAttachment( - String requestId, String interconnectAttachment) { + public final Operation deleteInterconnectAttachment(String interconnectAttachment) { DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) .setInterconnectAttachment(interconnectAttachment) .build(); return deleteInterconnectAttachment(request); @@ -384,10 +360,8 @@ public final Operation deleteInterconnectAttachment( * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInterconnectAttachment(interconnectAttachment.toString())
    *     .build();
    *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(request);
@@ -411,10 +385,8 @@ public final Operation deleteInterconnectAttachment(
    *
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
    *   DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInterconnectAttachment(interconnectAttachment.toString())
    *     .build();
    *   ApiFuture<Operation> future = interconnectAttachmentClient.deleteInterconnectAttachmentCallable().futureCall(request);
@@ -541,22 +513,12 @@ public final InterconnectAttachment getInterconnectAttachment(
    *
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
-   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource);
+   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(region, interconnectAttachmentResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) * resource. For more information, see Creating VLAN Attachments. (== resource_for @@ -565,13 +527,10 @@ public final InterconnectAttachment getInterconnectAttachment( */ @BetaApi public final Operation insertInterconnectAttachment( - String requestId, - ProjectRegionName region, - InterconnectAttachment interconnectAttachmentResource) { + ProjectRegionName region, InterconnectAttachment interconnectAttachmentResource) { InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setInterconnectAttachmentResource(interconnectAttachmentResource) .build(); @@ -587,22 +546,12 @@ public final Operation insertInterconnectAttachment( * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
-   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(requestId, region.toString(), interconnectAttachmentResource);
+   *   Operation response = interconnectAttachmentClient.insertInterconnectAttachment(region.toString(), interconnectAttachmentResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) * resource. For more information, see Creating VLAN Attachments. (== resource_for @@ -611,11 +560,10 @@ public final Operation insertInterconnectAttachment( */ @BetaApi public final Operation insertInterconnectAttachment( - String requestId, String region, InterconnectAttachment interconnectAttachmentResource) { + String region, InterconnectAttachment interconnectAttachmentResource) { InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setInterconnectAttachmentResource(interconnectAttachmentResource) .build(); @@ -631,11 +579,9 @@ public final Operation insertInterconnectAttachment( * *


    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
    *   InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setInterconnectAttachmentResource(interconnectAttachmentResource)
    *     .build();
@@ -661,11 +607,9 @@ public final Operation insertInterconnectAttachment(
    *
    * 

    * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
    *   InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setInterconnectAttachmentResource(interconnectAttachmentResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java
index 886515f693f0..1191157b728f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InterconnectAttachmentList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InterconnectAttachment item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java
index ee63f13390c0..25728173b18d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private InterconnectAttachmentPrivateInfo(Integer tag8021q) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("tag8021q") && tag8021q != null) {
-      fieldMap.put("tag8021q", Collections.singletonList(String.valueOf(tag8021q)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("tag8021q")) {
+      return tag8021q;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("tag8021q")) {
-      return String.valueOf(tag8021q);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java
index 82d0e16c6d6f..61be55216bf4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,28 +41,12 @@ private InterconnectAttachmentsScopedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("interconnectAttachments") && interconnectAttachments != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InterconnectAttachment item : interconnectAttachments) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("interconnectAttachments", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("interconnectAttachments")) {
-      return String.valueOf(interconnectAttachments);
+      return interconnectAttachments;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -78,6 +57,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getInterconnectAttachmentsList() {
     return interconnectAttachments;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java
index 5d48c4f7d3d2..6f97b0aaf04b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -47,30 +43,15 @@ private InterconnectCircuitInfo(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("customerDemarcId") && customerDemarcId != null) {
-      fieldMap.put("customerDemarcId", Collections.singletonList(String.valueOf(customerDemarcId)));
-    }
-    if (fieldNames.contains("googleCircuitId") && googleCircuitId != null) {
-      fieldMap.put("googleCircuitId", Collections.singletonList(String.valueOf(googleCircuitId)));
-    }
-    if (fieldNames.contains("googleDemarcId") && googleDemarcId != null) {
-      fieldMap.put("googleDemarcId", Collections.singletonList(String.valueOf(googleDemarcId)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("customerDemarcId")) {
-      return String.valueOf(customerDemarcId);
+      return customerDemarcId;
     }
     if (fieldName.equals("googleCircuitId")) {
-      return String.valueOf(googleCircuitId);
+      return googleCircuitId;
     }
     if (fieldName.equals("googleDemarcId")) {
-      return String.valueOf(googleDemarcId);
+      return googleDemarcId;
     }
     return null;
   }
@@ -81,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCustomerDemarcId() {
     return customerDemarcId;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java
index c706d6a3946f..4116545da5b4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
- *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
+ *   Operation response = interconnectClient.deleteInterconnect(interconnect);
  * }
  * 
  * 
@@ -160,31 +159,19 @@ public InterconnectStub getStub() { * *

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
-   *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
+   *   Operation response = interconnectClient.deleteInterconnect(interconnect);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnect( - String requestId, ProjectGlobalInterconnectName interconnect) { + public final Operation deleteInterconnect(ProjectGlobalInterconnectName interconnect) { DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) .setInterconnect(interconnect == null ? null : interconnect.toString()) .build(); return deleteInterconnect(request); @@ -198,32 +185,19 @@ public final Operation deleteInterconnect( * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
-   *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect.toString());
+   *   Operation response = interconnectClient.deleteInterconnect(interconnect.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteInterconnect(String requestId, String interconnect) { + public final Operation deleteInterconnect(String interconnect) { DeleteInterconnectHttpRequest request = - DeleteInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) - .setInterconnect(interconnect) - .build(); + DeleteInterconnectHttpRequest.newBuilder().setInterconnect(interconnect).build(); return deleteInterconnect(request); } @@ -235,10 +209,8 @@ public final Operation deleteInterconnect(String requestId, String interconnect) * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
    *     .build();
    *   Operation response = interconnectClient.deleteInterconnect(request);
@@ -261,10 +233,8 @@ public final Operation deleteInterconnect(DeleteInterconnectHttpRequest request)
    *
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   DeleteInterconnectHttpRequest request = DeleteInterconnectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
    *     .build();
    *   ApiFuture<Operation> future = interconnectClient.deleteInterconnectCallable().futureCall(request);
@@ -388,22 +358,12 @@ public final UnaryCallable getIntercon
    *
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
-   *   Operation response = interconnectClient.insertInterconnect(requestId, project, interconnectResource);
+   *   Operation response = interconnectClient.insertInterconnect(project, interconnectResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is * a dedicated connection between Google's network and your on-premises network. For more @@ -413,11 +373,10 @@ public final UnaryCallable getIntercon */ @BetaApi public final Operation insertInterconnect( - String requestId, ProjectName project, Interconnect interconnectResource) { + ProjectName project, Interconnect interconnectResource) { InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setInterconnectResource(interconnectResource) .build(); @@ -432,22 +391,12 @@ public final Operation insertInterconnect( * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
-   *   Operation response = interconnectClient.insertInterconnect(requestId, project.toString(), interconnectResource);
+   *   Operation response = interconnectClient.insertInterconnect(project.toString(), interconnectResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is * a dedicated connection between Google's network and your on-premises network. For more @@ -456,12 +405,10 @@ public final Operation insertInterconnect( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertInterconnect( - String requestId, String project, Interconnect interconnectResource) { + public final Operation insertInterconnect(String project, Interconnect interconnectResource) { InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setInterconnectResource(interconnectResource) .build(); @@ -476,11 +423,9 @@ public final Operation insertInterconnect( * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInterconnectResource(interconnectResource)
    *     .build();
@@ -504,11 +449,9 @@ public final Operation insertInterconnect(InsertInterconnectHttpRequest request)
    *
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   InsertInterconnectHttpRequest request = InsertInterconnectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInterconnectResource(interconnectResource)
    *     .build();
@@ -671,22 +614,12 @@ public final ListInterconnectsPagedResponse listInterconnects(
    *
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
-   *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect, interconnectResource);
+   *   Operation response = interconnectClient.patchInterconnect(interconnect, interconnectResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to update. * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is * a dedicated connection between Google's network and your on-premises network. For more @@ -696,13 +629,10 @@ public final ListInterconnectsPagedResponse listInterconnects( */ @BetaApi public final Operation patchInterconnect( - String requestId, - ProjectGlobalInterconnectName interconnect, - Interconnect interconnectResource) { + ProjectGlobalInterconnectName interconnect, Interconnect interconnectResource) { PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) .setInterconnect(interconnect == null ? null : interconnect.toString()) .setInterconnectResource(interconnectResource) .build(); @@ -718,22 +648,12 @@ public final Operation patchInterconnect( * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
-   *   Operation response = interconnectClient.patchInterconnect(requestId, interconnect.toString(), interconnectResource);
+   *   Operation response = interconnectClient.patchInterconnect(interconnect.toString(), interconnectResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param interconnect Name of the interconnect to update. * @param interconnectResource Represents an Interconnects resource. The Interconnects resource is * a dedicated connection between Google's network and your on-premises network. For more @@ -742,12 +662,10 @@ public final Operation patchInterconnect( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchInterconnect( - String requestId, String interconnect, Interconnect interconnectResource) { + public final Operation patchInterconnect(String interconnect, Interconnect interconnectResource) { PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder() - .setRequestId(requestId) .setInterconnect(interconnect) .setInterconnectResource(interconnectResource) .build(); @@ -763,11 +681,9 @@ public final Operation patchInterconnect( * *


    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
    *     .setInterconnectResource(interconnectResource)
    *     .build();
@@ -792,11 +708,9 @@ public final Operation patchInterconnect(PatchInterconnectHttpRequest request) {
    *
    * 

    * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
    *   Interconnect interconnectResource = Interconnect.newBuilder().build();
    *   PatchInterconnectHttpRequest request = PatchInterconnectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInterconnect(interconnect.toString())
    *     .setInterconnectResource(interconnectResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java
index a08d3dc5b512..5c472c3a5863 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InterconnectList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Interconnect item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java
index 821c975a5d3e..3a5257017b1e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -95,104 +90,48 @@ private InterconnectLocation(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("address") && address != null) {
-      fieldMap.put("address", Collections.singletonList(String.valueOf(address)));
-    }
-    if (fieldNames.contains("availabilityZone") && availabilityZone != null) {
-      fieldMap.put("availabilityZone", Collections.singletonList(String.valueOf(availabilityZone)));
-    }
-    if (fieldNames.contains("city") && city != null) {
-      fieldMap.put("city", Collections.singletonList(String.valueOf(city)));
-    }
-    if (fieldNames.contains("continent") && continent != null) {
-      fieldMap.put("continent", Collections.singletonList(String.valueOf(continent)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("facilityProvider") && facilityProvider != null) {
-      fieldMap.put("facilityProvider", Collections.singletonList(String.valueOf(facilityProvider)));
-    }
-    if (fieldNames.contains("facilityProviderFacilityId") && facilityProviderFacilityId != null) {
-      fieldMap.put(
-          "facilityProviderFacilityId",
-          Collections.singletonList(String.valueOf(facilityProviderFacilityId)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("peeringdbFacilityId") && peeringdbFacilityId != null) {
-      fieldMap.put(
-          "peeringdbFacilityId", Collections.singletonList(String.valueOf(peeringdbFacilityId)));
-    }
-    if (fieldNames.contains("regionInfos") && regionInfos != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InterconnectLocationRegionInfo item : regionInfos) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("regionInfos", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("address")) {
-      return String.valueOf(address);
+      return address;
     }
     if (fieldName.equals("availabilityZone")) {
-      return String.valueOf(availabilityZone);
+      return availabilityZone;
     }
     if (fieldName.equals("city")) {
-      return String.valueOf(city);
+      return city;
     }
     if (fieldName.equals("continent")) {
-      return String.valueOf(continent);
+      return continent;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("facilityProvider")) {
-      return String.valueOf(facilityProvider);
+      return facilityProvider;
     }
     if (fieldName.equals("facilityProviderFacilityId")) {
-      return String.valueOf(facilityProviderFacilityId);
+      return facilityProviderFacilityId;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("peeringdbFacilityId")) {
-      return String.valueOf(peeringdbFacilityId);
+      return peeringdbFacilityId;
     }
     if (fieldName.equals("regionInfos")) {
-      return String.valueOf(regionInfos);
+      return regionInfos;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -203,6 +142,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAddress() {
     return address;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java
index 21efdc1eaa2b..bc9871314b16 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private InterconnectLocationList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InterconnectLocation item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java
index 2046dd98aef0..42a3f98eee06 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -47,30 +43,15 @@ private InterconnectLocationRegionInfo(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("expectedRttMs") && expectedRttMs != null) {
-      fieldMap.put("expectedRttMs", Collections.singletonList(String.valueOf(expectedRttMs)));
-    }
-    if (fieldNames.contains("locationPresence") && locationPresence != null) {
-      fieldMap.put("locationPresence", Collections.singletonList(String.valueOf(locationPresence)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("expectedRttMs")) {
-      return String.valueOf(expectedRttMs);
+      return expectedRttMs;
     }
     if (fieldName.equals("locationPresence")) {
-      return String.valueOf(locationPresence);
+      return locationPresence;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     return null;
   }
@@ -81,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getExpectedRttMs() {
     return expectedRttMs;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java
index ba87f2fb6546..8be3ef264b6a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -71,64 +66,30 @@ private InterconnectOutageNotification(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("affectedCircuits") && affectedCircuits != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : affectedCircuits) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("affectedCircuits", stringList.build());
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("endTime") && endTime != null) {
-      fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime)));
-    }
-    if (fieldNames.contains("issueType") && issueType != null) {
-      fieldMap.put("issueType", Collections.singletonList(String.valueOf(issueType)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("source") && source != null) {
-      fieldMap.put("source", Collections.singletonList(String.valueOf(source)));
-    }
-    if (fieldNames.contains("startTime") && startTime != null) {
-      fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime)));
-    }
-    if (fieldNames.contains("state") && state != null) {
-      fieldMap.put("state", Collections.singletonList(String.valueOf(state)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("affectedCircuits")) {
-      return String.valueOf(affectedCircuits);
+      return affectedCircuits;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("endTime")) {
-      return String.valueOf(endTime);
+      return endTime;
     }
     if (fieldName.equals("issueType")) {
-      return String.valueOf(issueType);
+      return issueType;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("source")) {
-      return String.valueOf(source);
+      return source;
     }
     if (fieldName.equals("startTime")) {
-      return String.valueOf(startTime);
+      return startTime;
     }
     if (fieldName.equals("state")) {
-      return String.valueOf(state);
+      return state;
     }
     return null;
   }
@@ -139,6 +100,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getAffectedCircuitsList() {
     return affectedCircuits;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java
index 264ee694bb6f..28e219f33b54 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private InvalidateCacheUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("cacheInvalidationRuleResource")
-        && cacheInvalidationRuleResource != null) {
-      fieldMap.put(
-          "cacheInvalidationRuleResource",
-          Collections.singletonList(String.valueOf(cacheInvalidationRuleResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("cacheInvalidationRuleResource")) {
-      return String.valueOf(cacheInvalidationRuleResource);
+      return cacheInvalidationRuleResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public CacheInvalidationRule getApiMessageRequestBody() {
     return cacheInvalidationRuleResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java
index d405d453faa1..17ebac93eda3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private Items(String key, String value) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("value") && value != null) {
-      fieldMap.put("value", Collections.singletonList(String.valueOf(value)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("value")) {
-      return String.valueOf(value);
+      return value;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getKey() {
     return key;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java
index 4e0c9b885395..e25f2f6337ee 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private License(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("chargesUseFee") && chargesUseFee != null) {
-      fieldMap.put("chargesUseFee", Collections.singletonList(String.valueOf(chargesUseFee)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("licenseCode") && licenseCode != null) {
-      fieldMap.put("licenseCode", Collections.singletonList(String.valueOf(licenseCode)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("resourceRequirements") && resourceRequirements != null) {
-      fieldMap.put(
-          "resourceRequirements", Collections.singletonList(String.valueOf(resourceRequirements)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("transferable") && transferable != null) {
-      fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("chargesUseFee")) {
-      return String.valueOf(chargesUseFee);
+      return chargesUseFee;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("licenseCode")) {
-      return String.valueOf(licenseCode);
+      return licenseCode;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("resourceRequirements")) {
-      return String.valueOf(resourceRequirements);
+      return resourceRequirements;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("transferable")) {
-      return String.valueOf(transferable);
+      return transferable;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getChargesUseFee() {
     return chargesUseFee;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
index c6cd4686639f..b23b8319adb5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java
@@ -43,8 +43,7 @@
  * 
  * try (LicenseClient licenseClient = LicenseClient.create()) {
  *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
- *   String requestId = "";
- *   Operation response = licenseClient.deleteLicense(license, requestId);
+ *   Operation response = licenseClient.deleteLicense(license);
  * }
  * 
  * 
@@ -160,30 +159,19 @@ public LicenseStub getStub() { *

    * try (LicenseClient licenseClient = LicenseClient.create()) {
    *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
-   *   String requestId = "";
-   *   Operation response = licenseClient.deleteLicense(license, requestId);
+   *   Operation response = licenseClient.deleteLicense(license);
    * }
    * 
* * @param license Name of the license resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteLicense(ProjectGlobalLicenseName license, String requestId) { + public final Operation deleteLicense(ProjectGlobalLicenseName license) { DeleteLicenseHttpRequest request = DeleteLicenseHttpRequest.newBuilder() .setLicense(license == null ? null : license.toString()) - .setRequestId(requestId) .build(); return deleteLicense(request); } @@ -197,28 +185,18 @@ public final Operation deleteLicense(ProjectGlobalLicenseName license, String re *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
    *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
-   *   String requestId = "";
-   *   Operation response = licenseClient.deleteLicense(license.toString(), requestId);
+   *   Operation response = licenseClient.deleteLicense(license.toString());
    * }
    * 
* * @param license Name of the license resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteLicense(String license, String requestId) { + public final Operation deleteLicense(String license) { DeleteLicenseHttpRequest request = - DeleteLicenseHttpRequest.newBuilder().setLicense(license).setRequestId(requestId).build(); + DeleteLicenseHttpRequest.newBuilder().setLicense(license).build(); return deleteLicense(request); } @@ -231,10 +209,8 @@ public final Operation deleteLicense(String license, String requestId) { *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
    *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
-   *   String requestId = "";
    *   DeleteLicenseHttpRequest request = DeleteLicenseHttpRequest.newBuilder()
    *     .setLicense(license.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = licenseClient.deleteLicense(request);
    * }
@@ -257,10 +233,8 @@ public final Operation deleteLicense(DeleteLicenseHttpRequest request) {
    * 

    * try (LicenseClient licenseClient = LicenseClient.create()) {
    *   ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]");
-   *   String requestId = "";
    *   DeleteLicenseHttpRequest request = DeleteLicenseHttpRequest.newBuilder()
    *     .setLicense(license.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = licenseClient.deleteLicenseCallable().futureCall(request);
    *   // Do something
@@ -377,33 +351,21 @@ public final UnaryCallable getLicenseCallable()
    *
    * 

    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   License licenseResource = License.newBuilder().build();
-   *   Operation response = licenseClient.insertLicense(requestId, project, licenseResource);
+   *   Operation response = licenseClient.insertLicense(project, licenseResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param licenseResource A license resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertLicense( - String requestId, ProjectName project, License licenseResource) { + public final Operation insertLicense(ProjectName project, License licenseResource) { InsertLicenseHttpRequest request = InsertLicenseHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setLicenseResource(licenseResource) .build(); @@ -418,32 +380,21 @@ public final Operation insertLicense( * *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   License licenseResource = License.newBuilder().build();
-   *   Operation response = licenseClient.insertLicense(requestId, project.toString(), licenseResource);
+   *   Operation response = licenseClient.insertLicense(project.toString(), licenseResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param licenseResource A license resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertLicense(String requestId, String project, License licenseResource) { + public final Operation insertLicense(String project, License licenseResource) { InsertLicenseHttpRequest request = InsertLicenseHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setLicenseResource(licenseResource) .build(); @@ -458,11 +409,9 @@ public final Operation insertLicense(String requestId, String project, License l * *


    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   License licenseResource = License.newBuilder().build();
    *   InsertLicenseHttpRequest request = InsertLicenseHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setLicenseResource(licenseResource)
    *     .build();
@@ -486,11 +435,9 @@ public final Operation insertLicense(InsertLicenseHttpRequest request) {
    *
    * 

    * try (LicenseClient licenseClient = LicenseClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   License licenseResource = License.newBuilder().build();
    *   InsertLicenseHttpRequest request = InsertLicenseHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setLicenseResource(licenseResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java
index 5752223ce642..6829da3cd60a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -75,71 +70,33 @@ private LicenseCode(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("licenseAlias") && licenseAlias != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (LicenseCodeLicenseAlias item : licenseAlias) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenseAlias", stringList.build());
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("state") && state != null) {
-      fieldMap.put("state", Collections.singletonList(String.valueOf(state)));
-    }
-    if (fieldNames.contains("transferable") && transferable != null) {
-      fieldMap.put("transferable", Collections.singletonList(String.valueOf(transferable)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("licenseAlias")) {
-      return String.valueOf(licenseAlias);
+      return licenseAlias;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("state")) {
-      return String.valueOf(state);
+      return state;
     }
     if (fieldName.equals("transferable")) {
-      return String.valueOf(transferable);
+      return transferable;
     }
     return null;
   }
@@ -150,6 +107,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java
index 0a6acb8c0f41..96b3ef8ec210 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private LicenseCodeLicenseAlias(String description, String selfLink) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDescription() {
     return description;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java
index 40228b44df36..a71e1505a4fe 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private LicenseResourceRequirements(Integer minGuestCpuCount, Integer minMemoryM
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("minGuestCpuCount") && minGuestCpuCount != null) {
-      fieldMap.put("minGuestCpuCount", Collections.singletonList(String.valueOf(minGuestCpuCount)));
-    }
-    if (fieldNames.contains("minMemoryMb") && minMemoryMb != null) {
-      fieldMap.put("minMemoryMb", Collections.singletonList(String.valueOf(minMemoryMb)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("minGuestCpuCount")) {
-      return String.valueOf(minGuestCpuCount);
+      return minGuestCpuCount;
     }
     if (fieldName.equals("minMemoryMb")) {
-      return String.valueOf(minMemoryMb);
+      return minMemoryMb;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getMinGuestCpuCount() {
     return minGuestCpuCount;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java
index c26fff8ac1bd..5af927bb3672 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -55,46 +50,21 @@ private LicensesListResponse(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (License item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -105,6 +75,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java
index 5059c1664405..24f88896d771 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListAcceleratorTypesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java
index f49ce42acd49..5198a60931af 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListAddressesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java
index 754c7ec43bc7..05568ecd5361 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListAutoscalersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java
index 370573626da8..fc751f1a6f53 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListAvailableFeaturesSslPoliciesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java
index 2831420c3b72..b84e53222541 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListBackendBucketsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java
index 4468629a8f8b..7e49314be6fe 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListBackendServicesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java
index 463aaa944660..bb16c2b40bd0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListDiskTypesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java
index d1c92e50b928..b19f5c74f988 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListDisksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java
index 8d901b420a57..b3ba0d38e97a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListFirewallsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java
index a37aeed865f1..52b8e7afc873 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListForwardingRulesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java
index bd891abd7674..777d19f94c6a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListGlobalAddressesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java
index 5ff5a403047b..77462c526914 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListGlobalForwardingRulesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java
index b05ed6fcb18a..07c6f18f4f6f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListGlobalOperationsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java
index c089be938173..42de29469cc8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListHealthChecksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java
index b46175cf9aea..34a50eb3eb7c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListHttpHealthChecksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java
index 7e37b6d7686d..f56ff8f78216 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListHttpsHealthChecksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java
index 2871c11599ab..faf12f63e32b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListImagesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java
index 4a3a8e3174c2..bed894d85107 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInstanceGroupManagersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java
index 065f8f3f7726..30d061945370 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInstanceGroupsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java
index 3dff877bf30d..66421b27a04e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInstanceTemplatesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java
index 35744f497336..1067060d2659 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInstancesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java
index 3b4ef6048d60..b9c536de1722 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -89,93 +85,45 @@ private ListInstancesInstanceGroupsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("instanceGroupsListInstancesRequestResource")
-        && instanceGroupsListInstancesRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupsListInstancesRequestResource",
-          Collections.singletonList(String.valueOf(instanceGroupsListInstancesRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("instanceGroupsListInstancesRequestResource")) {
-      return String.valueOf(instanceGroupsListInstancesRequestResource);
+      return instanceGroupsListInstancesRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -186,6 +134,12 @@ public InstanceGroupsListInstancesRequest getApiMessageRequestBody() {
     return instanceGroupsListInstancesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java
index 78bfd32bbd0a..b349cdf74f05 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -91,94 +87,45 @@ private ListInstancesRegionInstanceGroupsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionInstanceGroupsListInstancesRequestResource")
-        && regionInstanceGroupsListInstancesRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupsListInstancesRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupsListInstancesRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionInstanceGroupsListInstancesRequestResource")) {
-      return String.valueOf(regionInstanceGroupsListInstancesRequestResource);
+      return regionInstanceGroupsListInstancesRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -189,6 +136,12 @@ public RegionInstanceGroupsListInstancesRequest getApiMessageRequestBody() {
     return regionInstanceGroupsListInstancesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java
index 4314af4017c7..ea3f0319af05 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInterconnectAttachmentsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java
index 35b25d7679e5..6765ca3f254b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInterconnectLocationsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java
index a8099c0b40ec..cef9d8e5fd1d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListInterconnectsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java
index 965e04fc88f5..5a8550d8c53e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListLicensesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java
index 1c468d4aab5f..b93f7892d350 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListMachineTypesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java
index fd91b32e5133..4a6b155aa537 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,85 +81,42 @@ private ListManagedInstancesInstanceGroupManagersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -174,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java
index 38a4ca194dff..c54915618126 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -86,85 +82,42 @@ private ListManagedInstancesRegionInstanceGroupManagersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -175,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java
index 3833c085e618..db9d798b5793 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListNetworksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java
index fecf7b8aac5b..0864085f101e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListReferrersInstancesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java
index fa2545c4b03d..9acb39fccbaf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionAutoscalersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java
index 584dc381f80e..39c3159dbb73 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionBackendServicesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java
index 4a991b0cb9c2..af22bce70777 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionCommitmentsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java
index 1faa87ffc7ab..850910078295 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionDiskTypesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java
index c1df5c9af353..ae818c4cc369 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionDisksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java
index ce71d45770a6..49dec8728e7e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionInstanceGroupManagersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java
index 22da113346da..273834703ead 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionInstanceGroupsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java
index 371fc05e0284..1ec0e417def9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionOperationsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java
index 4f87e0ad4103..1854141ffced 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRegionsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java
index 2a4e4adb9262..01ef08ef554a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRoutersHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java
index 766e05a72202..bd78370554b0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListRoutesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java
index c6fb14db309c..e9c265a28f91 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListSnapshotsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java
index 7df078c07b2f..b099c7588532 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListSslCertificatesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java
index 4e8674f51aa7..ff1727df14a9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListSslPoliciesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java
index 30ba879d6c92..ee1517a229e4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListSubnetworksHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java
index 103aaf931bfb..fe7bf148cdba 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetHttpProxiesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java
index 530a1db7d30f..7911a4a7f758 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetHttpsProxiesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java
index d0573cfc9162..643f3ab4322f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetInstancesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java
index 758a7b8191a6..5effff1cc334 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetPoolsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java
index 468717b78089..eb79d63ca80d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetSslProxiesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java
index 2ac3f7bd32c6..1f80fe35142d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetTcpProxiesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java
index db242544a50d..0e017f6edd2b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListTargetVpnGatewaysHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java
index 553367d73cd3..4173d3714524 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListUrlMapsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java
index d269ea2a36aa..6d1142436e0a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListVpnTunnelsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java
index 0419581ecf6d..c25ffe2c79dd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -89,93 +85,45 @@ private ListXpnHostsProjectsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("projectsListXpnHostsRequestResource")
-        && projectsListXpnHostsRequestResource != null) {
-      fieldMap.put(
-          "projectsListXpnHostsRequestResource",
-          Collections.singletonList(String.valueOf(projectsListXpnHostsRequestResource)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("projectsListXpnHostsRequestResource")) {
-      return String.valueOf(projectsListXpnHostsRequestResource);
+      return projectsListXpnHostsRequestResource;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -186,6 +134,12 @@ public ProjectsListXpnHostsRequest getApiMessageRequestBody() {
     return projectsListXpnHostsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java
index 9ecdd6e33fd3..7c6f29c1f4e0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListZoneOperationsHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java
index 7054df81e8f0..1c49589566a8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -85,84 +81,42 @@ private ListZonesHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("filter") && filter != null) {
-      fieldMap.put("filter", Collections.singletonList(String.valueOf(filter)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("maxResults") && maxResults != null) {
-      fieldMap.put("maxResults", Collections.singletonList(String.valueOf(maxResults)));
-    }
-    if (fieldNames.contains("orderBy") && orderBy != null) {
-      fieldMap.put("orderBy", Collections.singletonList(String.valueOf(orderBy)));
-    }
-    if (fieldNames.contains("pageToken") && pageToken != null) {
-      fieldMap.put("pageToken", Collections.singletonList(String.valueOf(pageToken)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("filter")) {
-      return String.valueOf(filter);
+      return filter;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("maxResults")) {
-      return String.valueOf(maxResults);
+      return maxResults;
     }
     if (fieldName.equals("orderBy")) {
-      return String.valueOf(orderBy);
+      return orderBy;
     }
     if (fieldName.equals("pageToken")) {
-      return String.valueOf(pageToken);
+      return pageToken;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -173,6 +127,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java
index c85c7f8f01bf..1cfb5c318521 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -99,112 +94,51 @@ private MachineType(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("deprecated") && deprecated != null) {
-      fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("guestCpus") && guestCpus != null) {
-      fieldMap.put("guestCpus", Collections.singletonList(String.valueOf(guestCpus)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("imageSpaceGb") && imageSpaceGb != null) {
-      fieldMap.put("imageSpaceGb", Collections.singletonList(String.valueOf(imageSpaceGb)));
-    }
-    if (fieldNames.contains("isSharedCpu") && isSharedCpu != null) {
-      fieldMap.put("isSharedCpu", Collections.singletonList(String.valueOf(isSharedCpu)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("maximumPersistentDisks") && maximumPersistentDisks != null) {
-      fieldMap.put(
-          "maximumPersistentDisks",
-          Collections.singletonList(String.valueOf(maximumPersistentDisks)));
-    }
-    if (fieldNames.contains("maximumPersistentDisksSizeGb")
-        && maximumPersistentDisksSizeGb != null) {
-      fieldMap.put(
-          "maximumPersistentDisksSizeGb",
-          Collections.singletonList(String.valueOf(maximumPersistentDisksSizeGb)));
-    }
-    if (fieldNames.contains("memoryMb") && memoryMb != null) {
-      fieldMap.put("memoryMb", Collections.singletonList(String.valueOf(memoryMb)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("scratchDisks") && scratchDisks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ScratchDisks item : scratchDisks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("scratchDisks", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("deprecated")) {
-      return String.valueOf(deprecated);
+      return deprecated;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("guestCpus")) {
-      return String.valueOf(guestCpus);
+      return guestCpus;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("imageSpaceGb")) {
-      return String.valueOf(imageSpaceGb);
+      return imageSpaceGb;
     }
     if (fieldName.equals("isSharedCpu")) {
-      return String.valueOf(isSharedCpu);
+      return isSharedCpu;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("maximumPersistentDisks")) {
-      return String.valueOf(maximumPersistentDisks);
+      return maximumPersistentDisks;
     }
     if (fieldName.equals("maximumPersistentDisksSizeGb")) {
-      return String.valueOf(maximumPersistentDisksSizeGb);
+      return maximumPersistentDisksSizeGb;
     }
     if (fieldName.equals("memoryMb")) {
-      return String.valueOf(memoryMb);
+      return memoryMb;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("scratchDisks")) {
-      return String.valueOf(scratchDisks);
+      return scratchDisks;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -215,6 +149,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java
index 9f950f37c44a..2aea9edf43de 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private MachineTypeAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java
index 89d1b36936cb..e0fe295eb4bb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private MachineTypeList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (MachineType item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java
index 2f41edbc6d61..e9508a1838d6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private MachineTypesScopedList(List machineTypes, Warning warning)
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("machineTypes") && machineTypes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (MachineType item : machineTypes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("machineTypes", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("machineTypes")) {
-      return String.valueOf(machineTypes);
+      return machineTypes;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getMachineTypesList() {
     return machineTypes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java
index f496bf31d2c4..29e6d18ac983 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -57,42 +53,21 @@ private ManagedInstance(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("currentAction") && currentAction != null) {
-      fieldMap.put("currentAction", Collections.singletonList(String.valueOf(currentAction)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instanceStatus") && instanceStatus != null) {
-      fieldMap.put("instanceStatus", Collections.singletonList(String.valueOf(instanceStatus)));
-    }
-    if (fieldNames.contains("lastAttempt") && lastAttempt != null) {
-      fieldMap.put("lastAttempt", Collections.singletonList(String.valueOf(lastAttempt)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("currentAction")) {
-      return String.valueOf(currentAction);
+      return currentAction;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instanceStatus")) {
-      return String.valueOf(instanceStatus);
+      return instanceStatus;
     }
     if (fieldName.equals("lastAttempt")) {
-      return String.valueOf(lastAttempt);
+      return lastAttempt;
     }
     return null;
   }
@@ -103,6 +78,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCurrentAction() {
     return currentAction;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java
index 0398c6007add..a6c4ddf12359 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private ManagedInstanceLastAttempt(Errors errors) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("errors") && errors != null) {
-      fieldMap.put("errors", Collections.singletonList(String.valueOf(errors)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("errors")) {
+      return errors;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("errors")) {
-      return String.valueOf(errors);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java
index 95c758ea3f70..df0f5847fa27 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -48,34 +43,15 @@ private Metadata(String fingerprint, List items, String kind) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Items item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     return null;
   }
@@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getFingerprint() {
     return fingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java
index 5605995652de..c95d807b2326 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private MoveDiskProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("diskMoveRequestResource") && diskMoveRequestResource != null) {
-      fieldMap.put(
-          "diskMoveRequestResource",
-          Collections.singletonList(String.valueOf(diskMoveRequestResource)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("diskMoveRequestResource")) {
-      return String.valueOf(diskMoveRequestResource);
+      return diskMoveRequestResource;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public DiskMoveRequest getApiMessageRequestBody() {
     return diskMoveRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java
index f370b4161b53..63cd98cdf273 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private MoveInstanceProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceMoveRequestResource") && instanceMoveRequestResource != null) {
-      fieldMap.put(
-          "instanceMoveRequestResource",
-          Collections.singletonList(String.valueOf(instanceMoveRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceMoveRequestResource")) {
-      return String.valueOf(instanceMoveRequestResource);
+      return instanceMoveRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public InstanceMoveRequest getApiMessageRequestBody() {
     return instanceMoveRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java
index 2d5d450c6dd7..00a11aaee175 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private NamedPort(String name, Integer port) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getName() {
     return name;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java
index 48da3336168b..4ce606f5aa81 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -87,95 +82,42 @@ private Network(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("autoCreateSubnetworks") && autoCreateSubnetworks != null) {
-      fieldMap.put(
-          "autoCreateSubnetworks",
-          Collections.singletonList(String.valueOf(autoCreateSubnetworks)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("gatewayIPv4") && gatewayIPv4 != null) {
-      fieldMap.put("gatewayIPv4", Collections.singletonList(String.valueOf(gatewayIPv4)));
-    }
-    if (fieldNames.contains("iPv4Range") && iPv4Range != null) {
-      fieldMap.put("iPv4Range", Collections.singletonList(String.valueOf(iPv4Range)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("peerings") && peerings != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NetworkPeering item : peerings) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("peerings", stringList.build());
-    }
-    if (fieldNames.contains("routingConfig") && routingConfig != null) {
-      fieldMap.put("routingConfig", Collections.singletonList(String.valueOf(routingConfig)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("subnetworks") && subnetworks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : subnetworks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("subnetworks", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("autoCreateSubnetworks")) {
-      return String.valueOf(autoCreateSubnetworks);
+      return autoCreateSubnetworks;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("gatewayIPv4")) {
-      return String.valueOf(gatewayIPv4);
+      return gatewayIPv4;
     }
     if (fieldName.equals("iPv4Range")) {
-      return String.valueOf(iPv4Range);
+      return iPv4Range;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("peerings")) {
-      return String.valueOf(peerings);
+      return peerings;
     }
     if (fieldName.equals("routingConfig")) {
-      return String.valueOf(routingConfig);
+      return routingConfig;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("subnetworks")) {
-      return String.valueOf(subnetworks);
+      return subnetworks;
     }
     return null;
   }
@@ -186,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getAutoCreateSubnetworks() {
     return autoCreateSubnetworks;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java
index b628f1efe77f..d32a0201db26 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java
@@ -42,10 +42,9 @@
  * 
  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
  *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
- *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
+ *   Operation response = networkClient.addPeeringNetwork(network, networksAddPeeringRequestResource);
  * }
  * 
  * 
@@ -160,35 +159,23 @@ public NetworkStub getStub() { * *

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
-   *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
+   *   Operation response = networkClient.addPeeringNetwork(network, networksAddPeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to add peering to. * @param networksAddPeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addPeeringNetwork( - String requestId, ProjectGlobalNetworkName network, NetworksAddPeeringRequest networksAddPeeringRequestResource) { AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) .build(); @@ -203,35 +190,22 @@ public final Operation addPeeringNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
-   *   Operation response = networkClient.addPeeringNetwork(requestId, network.toString(), networksAddPeeringRequestResource);
+   *   Operation response = networkClient.addPeeringNetwork(network.toString(), networksAddPeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to add peering to. * @param networksAddPeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addPeeringNetwork( - String requestId, - String network, - NetworksAddPeeringRequest networksAddPeeringRequestResource) { + String network, NetworksAddPeeringRequest networksAddPeeringRequestResource) { AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network) .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource) .build(); @@ -246,11 +220,9 @@ public final Operation addPeeringNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource)
    *     .build();
@@ -274,11 +246,9 @@ public final Operation addPeeringNetwork(AddPeeringNetworkHttpRequest request) {
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
    *   AddPeeringNetworkHttpRequest request = AddPeeringNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .setNetworksAddPeeringRequestResource(networksAddPeeringRequestResource)
    *     .build();
@@ -301,30 +271,19 @@ public final UnaryCallable addPeeringNe
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.deleteNetwork(requestId, network);
+   *   Operation response = networkClient.deleteNetwork(network);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteNetwork(String requestId, ProjectGlobalNetworkName network) { + public final Operation deleteNetwork(ProjectGlobalNetworkName network) { DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .build(); return deleteNetwork(request); @@ -338,29 +297,19 @@ public final Operation deleteNetwork(String requestId, ProjectGlobalNetworkName * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.deleteNetwork(requestId, network.toString());
+   *   Operation response = networkClient.deleteNetwork(network.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteNetwork(String requestId, String network) { + public final Operation deleteNetwork(String network) { DeleteNetworkHttpRequest request = - DeleteNetworkHttpRequest.newBuilder().setRequestId(requestId).setNetwork(network).build(); + DeleteNetworkHttpRequest.newBuilder().setNetwork(network).build(); return deleteNetwork(request); } @@ -372,10 +321,8 @@ public final Operation deleteNetwork(String requestId, String network) { * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   Operation response = networkClient.deleteNetwork(request);
@@ -398,10 +345,8 @@ public final Operation deleteNetwork(DeleteNetworkHttpRequest request) {
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   ApiFuture<Operation> future = networkClient.deleteNetworkCallable().futureCall(request);
@@ -519,34 +464,22 @@ public final UnaryCallable getNetworkCallable()
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
-   *   Operation response = networkClient.insertNetwork(requestId, project, networkResource);
+   *   Operation response = networkClient.insertNetwork(project, networkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param networkResource Represents a Network resource. Read Networks and Firewalls for more * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertNetwork( - String requestId, ProjectName project, Network networkResource) { + public final Operation insertNetwork(ProjectName project, Network networkResource) { InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setNetworkResource(networkResource) .build(); @@ -561,33 +494,22 @@ public final Operation insertNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
-   *   Operation response = networkClient.insertNetwork(requestId, project.toString(), networkResource);
+   *   Operation response = networkClient.insertNetwork(project.toString(), networkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param networkResource Represents a Network resource. Read Networks and Firewalls for more * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertNetwork(String requestId, String project, Network networkResource) { + public final Operation insertNetwork(String project, Network networkResource) { InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setNetworkResource(networkResource) .build(); @@ -602,11 +524,9 @@ public final Operation insertNetwork(String requestId, String project, Network n * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
    *   InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setNetworkResource(networkResource)
    *     .build();
@@ -630,11 +550,9 @@ public final Operation insertNetwork(InsertNetworkHttpRequest request) {
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Network networkResource = Network.newBuilder().build();
    *   InsertNetworkHttpRequest request = InsertNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setNetworkResource(networkResource)
    *     .build();
@@ -794,34 +712,22 @@ public final UnaryCallable listNetworksCal
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
-   *   Operation response = networkClient.patchNetwork(requestId, network, networkResource);
+   *   Operation response = networkClient.patchNetwork(network, networkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to update. * @param networkResource Represents a Network resource. Read Networks and Firewalls for more * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchNetwork( - String requestId, ProjectGlobalNetworkName network, Network networkResource) { + public final Operation patchNetwork(ProjectGlobalNetworkName network, Network networkResource) { PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .setNetworkResource(networkResource) .build(); @@ -837,33 +743,22 @@ public final Operation patchNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
-   *   Operation response = networkClient.patchNetwork(requestId, network.toString(), networkResource);
+   *   Operation response = networkClient.patchNetwork(network.toString(), networkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to update. * @param networkResource Represents a Network resource. Read Networks and Firewalls for more * information. (== resource_for v1.networks ==) (== resource_for beta.networks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchNetwork(String requestId, String network, Network networkResource) { + public final Operation patchNetwork(String network, Network networkResource) { PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network) .setNetworkResource(networkResource) .build(); @@ -879,11 +774,9 @@ public final Operation patchNetwork(String requestId, String network, Network ne * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .setNetworkResource(networkResource)
    *     .build();
@@ -908,11 +801,9 @@ public final Operation patchNetwork(PatchNetworkHttpRequest request) {
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   Network networkResource = Network.newBuilder().build();
    *   PatchNetworkHttpRequest request = PatchNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .setNetworkResource(networkResource)
    *     .build();
@@ -935,35 +826,23 @@ public final UnaryCallable patchNetworkCalla
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
-   *   Operation response = networkClient.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource);
+   *   Operation response = networkClient.removePeeringNetwork(network, networksRemovePeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to remove peering from. * @param networksRemovePeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation removePeeringNetwork( - String requestId, ProjectGlobalNetworkName network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) .build(); @@ -978,35 +857,22 @@ public final Operation removePeeringNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
-   *   Operation response = networkClient.removePeeringNetwork(requestId, network.toString(), networksRemovePeeringRequestResource);
+   *   Operation response = networkClient.removePeeringNetwork(network.toString(), networksRemovePeeringRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network resource to remove peering from. * @param networksRemovePeeringRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation removePeeringNetwork( - String requestId, - String network, - NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { + String network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource) { RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network) .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource) .build(); @@ -1021,11 +887,9 @@ public final Operation removePeeringNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource)
    *     .build();
@@ -1049,11 +913,9 @@ public final Operation removePeeringNetwork(RemovePeeringNetworkHttpRequest requ
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build();
    *   RemovePeeringNetworkHttpRequest request = RemovePeeringNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .setNetworksRemovePeeringRequestResource(networksRemovePeeringRequestResource)
    *     .build();
@@ -1077,31 +939,19 @@ public final Operation removePeeringNetwork(RemovePeeringNetworkHttpRequest requ
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network);
+   *   Operation response = networkClient.switchToCustomModeNetwork(network);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation switchToCustomModeNetwork( - String requestId, ProjectGlobalNetworkName network) { + public final Operation switchToCustomModeNetwork(ProjectGlobalNetworkName network) { SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setNetwork(network == null ? null : network.toString()) .build(); return switchToCustomModeNetwork(request); @@ -1115,32 +965,19 @@ public final Operation switchToCustomModeNetwork( * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
-   *   Operation response = networkClient.switchToCustomModeNetwork(requestId, network.toString());
+   *   Operation response = networkClient.switchToCustomModeNetwork(network.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param network Name of the network to be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation switchToCustomModeNetwork(String requestId, String network) { + public final Operation switchToCustomModeNetwork(String network) { SwitchToCustomModeNetworkHttpRequest request = - SwitchToCustomModeNetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setNetwork(network) - .build(); + SwitchToCustomModeNetworkHttpRequest.newBuilder().setNetwork(network).build(); return switchToCustomModeNetwork(request); } @@ -1152,10 +989,8 @@ public final Operation switchToCustomModeNetwork(String requestId, String networ * *


    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   Operation response = networkClient.switchToCustomModeNetwork(request);
@@ -1178,10 +1013,8 @@ public final Operation switchToCustomModeNetwork(SwitchToCustomModeNetworkHttpRe
    *
    * 

    * try (NetworkClient networkClient = NetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
    *   SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setNetwork(network.toString())
    *     .build();
    *   ApiFuture<Operation> future = networkClient.switchToCustomModeNetworkCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java
index cf8da9d0ed2f..52c668ae9840 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -71,68 +66,30 @@ private NetworkInterface(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("accessConfigs") && accessConfigs != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AccessConfig item : accessConfigs) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("accessConfigs", stringList.build());
-    }
-    if (fieldNames.contains("aliasIpRanges") && aliasIpRanges != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (AliasIpRange item : aliasIpRanges) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("aliasIpRanges", stringList.build());
-    }
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("networkIP") && networkIP != null) {
-      fieldMap.put("networkIP", Collections.singletonList(String.valueOf(networkIP)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("accessConfigs")) {
-      return String.valueOf(accessConfigs);
+      return accessConfigs;
     }
     if (fieldName.equals("aliasIpRanges")) {
-      return String.valueOf(aliasIpRanges);
+      return aliasIpRanges;
     }
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("networkIP")) {
-      return String.valueOf(networkIP);
+      return networkIP;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     return null;
   }
@@ -143,6 +100,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getAccessConfigsList() {
     return accessConfigs;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java
index b2cf2cdf80e1..7173c819e1c2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private NetworkList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Network item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java
index 0d6bdca5b111..358916af8b13 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private NetworkPeering(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) {
-      fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("state") && state != null) {
-      fieldMap.put("state", Collections.singletonList(String.valueOf(state)));
-    }
-    if (fieldNames.contains("stateDetails") && stateDetails != null) {
-      fieldMap.put("stateDetails", Collections.singletonList(String.valueOf(stateDetails)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("autoCreateRoutes")) {
-      return String.valueOf(autoCreateRoutes);
+      return autoCreateRoutes;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("state")) {
-      return String.valueOf(state);
+      return state;
     }
     if (fieldName.equals("stateDetails")) {
-      return String.valueOf(stateDetails);
+      return stateDetails;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getAutoCreateRoutes() {
     return autoCreateRoutes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java
index ee9f3c89ec24..fee7e20c4536 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private NetworkRoutingConfig(String routingMode) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("routingMode") && routingMode != null) {
-      fieldMap.put("routingMode", Collections.singletonList(String.valueOf(routingMode)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("routingMode")) {
+      return routingMode;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("routingMode")) {
-      return String.valueOf(routingMode);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java
index a964e5b5c782..c70d12129013 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,30 +42,15 @@ private NetworksAddPeeringRequest(Boolean autoCreateRoutes, String name, String
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("autoCreateRoutes") && autoCreateRoutes != null) {
-      fieldMap.put("autoCreateRoutes", Collections.singletonList(String.valueOf(autoCreateRoutes)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("peerNetwork") && peerNetwork != null) {
-      fieldMap.put("peerNetwork", Collections.singletonList(String.valueOf(peerNetwork)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("autoCreateRoutes")) {
-      return String.valueOf(autoCreateRoutes);
+      return autoCreateRoutes;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("peerNetwork")) {
-      return String.valueOf(peerNetwork);
+      return peerNetwork;
     }
     return null;
   }
@@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getAutoCreateRoutes() {
     return autoCreateRoutes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java
index cf35ffa8be25..397a37cef130 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private NetworksRemovePeeringRequest(String name) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("name")) {
+      return name;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("name")) {
-      return String.valueOf(name);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java
index 1c4bfddfdd70..1ce06a104dea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -131,157 +126,75 @@ private Operation(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("clientOperationId") && clientOperationId != null) {
-      fieldMap.put(
-          "clientOperationId", Collections.singletonList(String.valueOf(clientOperationId)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("endTime") && endTime != null) {
-      fieldMap.put("endTime", Collections.singletonList(String.valueOf(endTime)));
-    }
-    if (fieldNames.contains("error") && error != null) {
-      fieldMap.put("error", Collections.singletonList(String.valueOf(error)));
-    }
-    if (fieldNames.contains("httpErrorMessage") && httpErrorMessage != null) {
-      fieldMap.put("httpErrorMessage", Collections.singletonList(String.valueOf(httpErrorMessage)));
-    }
-    if (fieldNames.contains("httpErrorStatusCode") && httpErrorStatusCode != null) {
-      fieldMap.put(
-          "httpErrorStatusCode", Collections.singletonList(String.valueOf(httpErrorStatusCode)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("insertTime") && insertTime != null) {
-      fieldMap.put("insertTime", Collections.singletonList(String.valueOf(insertTime)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("operationType") && operationType != null) {
-      fieldMap.put("operationType", Collections.singletonList(String.valueOf(operationType)));
-    }
-    if (fieldNames.contains("progress") && progress != null) {
-      fieldMap.put("progress", Collections.singletonList(String.valueOf(progress)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("startTime") && startTime != null) {
-      fieldMap.put("startTime", Collections.singletonList(String.valueOf(startTime)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("statusMessage") && statusMessage != null) {
-      fieldMap.put("statusMessage", Collections.singletonList(String.valueOf(statusMessage)));
-    }
-    if (fieldNames.contains("targetId") && targetId != null) {
-      fieldMap.put("targetId", Collections.singletonList(String.valueOf(targetId)));
-    }
-    if (fieldNames.contains("targetLink") && targetLink != null) {
-      fieldMap.put("targetLink", Collections.singletonList(String.valueOf(targetLink)));
-    }
-    if (fieldNames.contains("user") && user != null) {
-      fieldMap.put("user", Collections.singletonList(String.valueOf(user)));
-    }
-    if (fieldNames.contains("warnings") && warnings != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Warnings item : warnings) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("warnings", stringList.build());
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("clientOperationId")) {
-      return String.valueOf(clientOperationId);
+      return clientOperationId;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("endTime")) {
-      return String.valueOf(endTime);
+      return endTime;
     }
     if (fieldName.equals("error")) {
-      return String.valueOf(error);
+      return error;
     }
     if (fieldName.equals("httpErrorMessage")) {
-      return String.valueOf(httpErrorMessage);
+      return httpErrorMessage;
     }
     if (fieldName.equals("httpErrorStatusCode")) {
-      return String.valueOf(httpErrorStatusCode);
+      return httpErrorStatusCode;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("insertTime")) {
-      return String.valueOf(insertTime);
+      return insertTime;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("operationType")) {
-      return String.valueOf(operationType);
+      return operationType;
     }
     if (fieldName.equals("progress")) {
-      return String.valueOf(progress);
+      return progress;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("startTime")) {
-      return String.valueOf(startTime);
+      return startTime;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("statusMessage")) {
-      return String.valueOf(statusMessage);
+      return statusMessage;
     }
     if (fieldName.equals("targetId")) {
-      return String.valueOf(targetId);
+      return targetId;
     }
     if (fieldName.equals("targetLink")) {
-      return String.valueOf(targetLink);
+      return targetLink;
     }
     if (fieldName.equals("user")) {
-      return String.valueOf(user);
+      return user;
     }
     if (fieldName.equals("warnings")) {
-      return String.valueOf(warnings);
+      return warnings;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -292,6 +205,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getClientOperationId() {
     return clientOperationId;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java
index 5c7fa68a5c07..29bdd2229966 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private OperationAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java
index d48e70e4f295..f02a5fb2cd7d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private OperationList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Operation item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java
index 9fff272b34bb..b6ce075a7325 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private OperationsScopedList(List operations, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("operations") && operations != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Operation item : operations) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("operations", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("operations")) {
-      return String.valueOf(operations);
+      return operations;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getOperationsList() {
     return operations;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java
index e1b438e32537..2102af68384b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class PatchAutoscalerHttpRequest implements ApiMessage {
   private final String autoscaler;
   private final Autoscaler autoscalerResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -46,6 +43,7 @@ private PatchAutoscalerHttpRequest() {
     this.autoscaler = null;
     this.autoscalerResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -60,6 +58,7 @@ private PatchAutoscalerHttpRequest(
       String autoscaler,
       Autoscaler autoscalerResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -71,6 +70,7 @@ private PatchAutoscalerHttpRequest(
     this.autoscaler = autoscaler;
     this.autoscalerResource = autoscalerResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -81,79 +81,42 @@ private PatchAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) {
-      fieldMap.put(
-          "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("autoscalerResource")) {
-      return String.valueOf(autoscalerResource);
+      return autoscalerResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -164,6 +127,12 @@ public Autoscaler getApiMessageRequestBody() {
     return autoscalerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -235,6 +204,7 @@ public static class Builder {
     private String autoscaler;
     private Autoscaler autoscalerResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -259,6 +229,9 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -288,6 +261,7 @@ public Builder mergeFrom(PatchAutoscalerHttpRequest other) {
       this.autoscaler = source.autoscaler;
       this.autoscalerResource = source.autoscalerResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -333,6 +307,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -410,6 +393,7 @@ public PatchAutoscalerHttpRequest build() {
           autoscaler,
           autoscalerResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -425,6 +409,7 @@ public Builder clone() {
       newBuilder.setAutoscaler(this.autoscaler);
       newBuilder.setAutoscalerResource(this.autoscalerResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -451,6 +436,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -485,6 +473,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.autoscaler, that.getAutoscaler())
           && Objects.equals(this.autoscalerResource, that.getAutoscalerResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -503,6 +492,7 @@ public int hashCode() {
         autoscaler,
         autoscalerResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java
index 89a83330fd88..c2557817a243 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class PatchBackendBucketHttpRequest implements ApiMessage {
   private final String backendBucket;
   private final BackendBucket backendBucketResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -45,6 +42,7 @@ private PatchBackendBucketHttpRequest() {
     this.backendBucket = null;
     this.backendBucketResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -58,6 +56,7 @@ private PatchBackendBucketHttpRequest(
       String backendBucket,
       BackendBucket backendBucketResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -68,6 +67,7 @@ private PatchBackendBucketHttpRequest(
     this.backendBucket = backendBucket;
     this.backendBucketResource = backendBucketResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,74 +77,39 @@ private PatchBackendBucketHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendBucket") && backendBucket != null) {
-      fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket)));
-    }
-    if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) {
-      fieldMap.put(
-          "backendBucketResource",
-          Collections.singletonList(String.valueOf(backendBucketResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendBucket")) {
-      return String.valueOf(backendBucket);
+      return backendBucket;
     }
     if (fieldName.equals("backendBucketResource")) {
-      return String.valueOf(backendBucketResource);
+      return backendBucketResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public BackendBucket getApiMessageRequestBody() {
     return backendBucketResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -222,6 +193,7 @@ public static class Builder {
     private String backendBucket;
     private BackendBucket backendBucketResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -245,6 +217,9 @@ public Builder mergeFrom(PatchBackendBucketHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -271,6 +246,7 @@ public Builder mergeFrom(PatchBackendBucketHttpRequest other) {
       this.backendBucket = source.backendBucket;
       this.backendBucketResource = source.backendBucketResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -315,6 +291,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -384,6 +369,7 @@ public PatchBackendBucketHttpRequest build() {
           backendBucket,
           backendBucketResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -398,6 +384,7 @@ public Builder clone() {
       newBuilder.setBackendBucket(this.backendBucket);
       newBuilder.setBackendBucketResource(this.backendBucketResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -423,6 +410,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -454,6 +444,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.backendBucket, that.getBackendBucket())
           && Objects.equals(this.backendBucketResource, that.getBackendBucketResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -471,6 +462,7 @@ public int hashCode() {
         backendBucket,
         backendBucketResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java
index 63c92c498405..cbd151c53a69 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class PatchBackendServiceHttpRequest implements ApiMessage {
   private final String backendService;
   private final BackendService backendServiceResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -45,6 +42,7 @@ private PatchBackendServiceHttpRequest() {
     this.backendService = null;
     this.backendServiceResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -58,6 +56,7 @@ private PatchBackendServiceHttpRequest(
       String backendService,
       BackendService backendServiceResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -68,6 +67,7 @@ private PatchBackendServiceHttpRequest(
     this.backendService = backendService;
     this.backendServiceResource = backendServiceResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,74 +77,39 @@ private PatchBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) {
-      fieldMap.put(
-          "backendServiceResource",
-          Collections.singletonList(String.valueOf(backendServiceResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("backendServiceResource")) {
-      return String.valueOf(backendServiceResource);
+      return backendServiceResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public BackendService getApiMessageRequestBody() {
     return backendServiceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -222,6 +193,7 @@ public static class Builder {
     private String backendService;
     private BackendService backendServiceResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -245,6 +217,9 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -271,6 +246,7 @@ public Builder mergeFrom(PatchBackendServiceHttpRequest other) {
       this.backendService = source.backendService;
       this.backendServiceResource = source.backendServiceResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -315,6 +291,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -384,6 +369,7 @@ public PatchBackendServiceHttpRequest build() {
           backendService,
           backendServiceResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -398,6 +384,7 @@ public Builder clone() {
       newBuilder.setBackendService(this.backendService);
       newBuilder.setBackendServiceResource(this.backendServiceResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -423,6 +410,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -454,6 +444,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.backendService, that.getBackendService())
           && Objects.equals(this.backendServiceResource, that.getBackendServiceResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -471,6 +462,7 @@ public int hashCode() {
         backendService,
         backendServiceResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java
index 4a7c2fae0014..b9eeb0fcb088 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchFirewallHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String firewall;
   private final Firewall firewallResource;
@@ -43,6 +40,7 @@ public final class PatchFirewallHttpRequest implements ApiMessage {
   private PatchFirewallHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.firewall = null;
     this.firewallResource = null;
@@ -56,6 +54,7 @@ private PatchFirewallHttpRequest() {
   private PatchFirewallHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String firewall,
       Firewall firewallResource,
@@ -66,6 +65,7 @@ private PatchFirewallHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.firewall = firewall;
     this.firewallResource = firewallResource;
@@ -77,72 +77,39 @@ private PatchFirewallHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("firewall") && firewall != null) {
-      fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall)));
-    }
-    if (fieldNames.contains("firewallResource") && firewallResource != null) {
-      fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("firewall")) {
-      return String.valueOf(firewall);
+      return firewall;
     }
     if (fieldName.equals("firewallResource")) {
-      return String.valueOf(firewallResource);
+      return firewallResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public Firewall getApiMessageRequestBody() {
     return firewallResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static PatchFirewallHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String firewall;
     private Firewall firewallResource;
@@ -237,6 +211,9 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(PatchFirewallHttpRequest other) {
     Builder(PatchFirewallHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.firewall = source.firewall;
       this.firewallResource = source.firewallResource;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public PatchFirewallHttpRequest build() {
       return new PatchFirewallHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           firewall,
           firewallResource,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setFirewall(this.firewall);
       newBuilder.setFirewallResource(this.firewallResource);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       PatchFirewallHttpRequest that = (PatchFirewallHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.firewall, that.getFirewall())
           && Objects.equals(this.firewallResource, that.getFirewallResource())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         firewall,
         firewallResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java
index 069a5579dae6..4434ba523295 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchHealthCheckHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String healthCheck;
   private final HealthCheck healthCheckResource;
@@ -43,6 +40,7 @@ public final class PatchHealthCheckHttpRequest implements ApiMessage {
   private PatchHealthCheckHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.healthCheck = null;
     this.healthCheckResource = null;
@@ -56,6 +54,7 @@ private PatchHealthCheckHttpRequest() {
   private PatchHealthCheckHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String healthCheck,
       HealthCheck healthCheckResource,
@@ -66,6 +65,7 @@ private PatchHealthCheckHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.healthCheck = healthCheck;
     this.healthCheckResource = healthCheckResource;
@@ -77,73 +77,39 @@ private PatchHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("healthCheck") && healthCheck != null) {
-      fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck)));
-    }
-    if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) {
-      fieldMap.put(
-          "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("healthCheck")) {
-      return String.valueOf(healthCheck);
+      return healthCheck;
     }
     if (fieldName.equals("healthCheckResource")) {
-      return String.valueOf(healthCheckResource);
+      return healthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +120,12 @@ public HealthCheck getApiMessageRequestBody() {
     return healthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -219,6 +191,7 @@ public static PatchHealthCheckHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String healthCheck;
     private HealthCheck healthCheckResource;
@@ -238,6 +211,9 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -268,6 +244,7 @@ public Builder mergeFrom(PatchHealthCheckHttpRequest other) {
     Builder(PatchHealthCheckHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.healthCheck = source.healthCheck;
       this.healthCheckResource = source.healthCheckResource;
@@ -296,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -381,6 +367,7 @@ public PatchHealthCheckHttpRequest build() {
       return new PatchHealthCheckHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           healthCheck,
           healthCheckResource,
@@ -395,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setHealthCheck(this.healthCheck);
       newBuilder.setHealthCheckResource(this.healthCheckResource);
@@ -416,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -451,6 +442,7 @@ public boolean equals(Object o) {
       PatchHealthCheckHttpRequest that = (PatchHealthCheckHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.healthCheck, that.getHealthCheck())
           && Objects.equals(this.healthCheckResource, that.getHealthCheckResource())
@@ -468,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         healthCheck,
         healthCheckResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java
index 5d21363c4307..547949750001 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchHttpHealthCheckHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String httpHealthCheck;
   private final HttpHealthCheck2 httpHealthCheckResource;
@@ -43,6 +40,7 @@ public final class PatchHttpHealthCheckHttpRequest implements ApiMessage {
   private PatchHttpHealthCheckHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.httpHealthCheck = null;
     this.httpHealthCheckResource = null;
@@ -56,6 +54,7 @@ private PatchHttpHealthCheckHttpRequest() {
   private PatchHttpHealthCheckHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String httpHealthCheck,
       HttpHealthCheck2 httpHealthCheckResource,
@@ -66,6 +65,7 @@ private PatchHttpHealthCheckHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.httpHealthCheck = httpHealthCheck;
     this.httpHealthCheckResource = httpHealthCheckResource;
@@ -77,74 +77,39 @@ private PatchHttpHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) {
-      fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck)));
-    }
-    if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) {
-      fieldMap.put(
-          "httpHealthCheckResource",
-          Collections.singletonList(String.valueOf(httpHealthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpHealthCheck")) {
-      return String.valueOf(httpHealthCheck);
+      return httpHealthCheck;
     }
     if (fieldName.equals("httpHealthCheckResource")) {
-      return String.valueOf(httpHealthCheckResource);
+      return httpHealthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public HttpHealthCheck2 getApiMessageRequestBody() {
     return httpHealthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -220,6 +191,7 @@ public static PatchHttpHealthCheckHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String httpHealthCheck;
     private HttpHealthCheck2 httpHealthCheckResource;
@@ -239,6 +211,9 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -269,6 +244,7 @@ public Builder mergeFrom(PatchHttpHealthCheckHttpRequest other) {
     Builder(PatchHttpHealthCheckHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.httpHealthCheck = source.httpHealthCheck;
       this.httpHealthCheckResource = source.httpHealthCheckResource;
@@ -297,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -382,6 +367,7 @@ public PatchHttpHealthCheckHttpRequest build() {
       return new PatchHttpHealthCheckHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           httpHealthCheck,
           httpHealthCheckResource,
@@ -396,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setHttpHealthCheck(this.httpHealthCheck);
       newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource);
@@ -417,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -452,6 +442,7 @@ public boolean equals(Object o) {
       PatchHttpHealthCheckHttpRequest that = (PatchHttpHealthCheckHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck())
           && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource())
@@ -469,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         httpHealthCheck,
         httpHealthCheckResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java
index fe2a163ad132..fca2a190e0ea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String httpsHealthCheck;
   private final HttpsHealthCheck2 httpsHealthCheckResource;
@@ -43,6 +40,7 @@ public final class PatchHttpsHealthCheckHttpRequest implements ApiMessage {
   private PatchHttpsHealthCheckHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.httpsHealthCheck = null;
     this.httpsHealthCheckResource = null;
@@ -56,6 +54,7 @@ private PatchHttpsHealthCheckHttpRequest() {
   private PatchHttpsHealthCheckHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String httpsHealthCheck,
       HttpsHealthCheck2 httpsHealthCheckResource,
@@ -66,6 +65,7 @@ private PatchHttpsHealthCheckHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.httpsHealthCheck = httpsHealthCheck;
     this.httpsHealthCheckResource = httpsHealthCheckResource;
@@ -77,74 +77,39 @@ private PatchHttpsHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) {
-      fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck)));
-    }
-    if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) {
-      fieldMap.put(
-          "httpsHealthCheckResource",
-          Collections.singletonList(String.valueOf(httpsHealthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpsHealthCheck")) {
-      return String.valueOf(httpsHealthCheck);
+      return httpsHealthCheck;
     }
     if (fieldName.equals("httpsHealthCheckResource")) {
-      return String.valueOf(httpsHealthCheckResource);
+      return httpsHealthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public HttpsHealthCheck2 getApiMessageRequestBody() {
     return httpsHealthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -220,6 +191,7 @@ public static PatchHttpsHealthCheckHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String httpsHealthCheck;
     private HttpsHealthCheck2 httpsHealthCheckResource;
@@ -239,6 +211,9 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -269,6 +244,7 @@ public Builder mergeFrom(PatchHttpsHealthCheckHttpRequest other) {
     Builder(PatchHttpsHealthCheckHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.httpsHealthCheck = source.httpsHealthCheck;
       this.httpsHealthCheckResource = source.httpsHealthCheckResource;
@@ -297,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -382,6 +367,7 @@ public PatchHttpsHealthCheckHttpRequest build() {
       return new PatchHttpsHealthCheckHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           httpsHealthCheck,
           httpsHealthCheckResource,
@@ -396,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setHttpsHealthCheck(this.httpsHealthCheck);
       newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource);
@@ -417,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -452,6 +442,7 @@ public boolean equals(Object o) {
       PatchHttpsHealthCheckHttpRequest that = (PatchHttpsHealthCheckHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck())
           && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource())
@@ -469,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         httpsHealthCheck,
         httpsHealthCheckResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java
index 74192f22a4b8..d6e8277ab9a5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchInterconnectHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String interconnect;
   private final Interconnect interconnectResource;
@@ -43,6 +40,7 @@ public final class PatchInterconnectHttpRequest implements ApiMessage {
   private PatchInterconnectHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.interconnect = null;
     this.interconnectResource = null;
@@ -56,6 +54,7 @@ private PatchInterconnectHttpRequest() {
   private PatchInterconnectHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String interconnect,
       Interconnect interconnectResource,
@@ -66,6 +65,7 @@ private PatchInterconnectHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.interconnect = interconnect;
     this.interconnectResource = interconnectResource;
@@ -77,73 +77,39 @@ private PatchInterconnectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("interconnect") && interconnect != null) {
-      fieldMap.put("interconnect", Collections.singletonList(String.valueOf(interconnect)));
-    }
-    if (fieldNames.contains("interconnectResource") && interconnectResource != null) {
-      fieldMap.put(
-          "interconnectResource", Collections.singletonList(String.valueOf(interconnectResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("interconnect")) {
-      return String.valueOf(interconnect);
+      return interconnect;
     }
     if (fieldName.equals("interconnectResource")) {
-      return String.valueOf(interconnectResource);
+      return interconnectResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +120,12 @@ public Interconnect getApiMessageRequestBody() {
     return interconnectResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -219,6 +191,7 @@ public static PatchInterconnectHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String interconnect;
     private Interconnect interconnectResource;
@@ -238,6 +211,9 @@ public Builder mergeFrom(PatchInterconnectHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -268,6 +244,7 @@ public Builder mergeFrom(PatchInterconnectHttpRequest other) {
     Builder(PatchInterconnectHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.interconnect = source.interconnect;
       this.interconnectResource = source.interconnectResource;
@@ -296,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -381,6 +367,7 @@ public PatchInterconnectHttpRequest build() {
       return new PatchInterconnectHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           interconnect,
           interconnectResource,
@@ -395,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setInterconnect(this.interconnect);
       newBuilder.setInterconnectResource(this.interconnectResource);
@@ -416,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -451,6 +442,7 @@ public boolean equals(Object o) {
       PatchInterconnectHttpRequest that = (PatchInterconnectHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.interconnect, that.getInterconnect())
           && Objects.equals(this.interconnectResource, that.getInterconnectResource())
@@ -468,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         interconnect,
         interconnectResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java
index 2d9202c8cc87..28d763a2bf0c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchNetworkHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String network;
@@ -43,6 +40,7 @@ public final class PatchNetworkHttpRequest implements ApiMessage {
   private PatchNetworkHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.network = null;
@@ -56,6 +54,7 @@ private PatchNetworkHttpRequest() {
   private PatchNetworkHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String network,
@@ -66,6 +65,7 @@ private PatchNetworkHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.network = network;
@@ -77,72 +77,39 @@ private PatchNetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("networkResource") && networkResource != null) {
-      fieldMap.put("networkResource", Collections.singletonList(String.valueOf(networkResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("networkResource")) {
-      return String.valueOf(networkResource);
+      return networkResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public Network getApiMessageRequestBody() {
     return networkResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static PatchNetworkHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String network;
@@ -237,6 +211,9 @@ public Builder mergeFrom(PatchNetworkHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(PatchNetworkHttpRequest other) {
     Builder(PatchNetworkHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.network = source.network;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public PatchNetworkHttpRequest build() {
       return new PatchNetworkHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           network,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setNetwork(this.network);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       PatchNetworkHttpRequest that = (PatchNetworkHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.network, that.getNetwork())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         network,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java
index dd3d15c4d300..c3c81698c71e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class PatchRegionAutoscalerHttpRequest implements ApiMessage {
   private final String autoscaler;
   private final Autoscaler autoscalerResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -46,6 +43,7 @@ private PatchRegionAutoscalerHttpRequest() {
     this.autoscaler = null;
     this.autoscalerResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -60,6 +58,7 @@ private PatchRegionAutoscalerHttpRequest(
       String autoscaler,
       Autoscaler autoscalerResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -71,6 +70,7 @@ private PatchRegionAutoscalerHttpRequest(
     this.autoscaler = autoscaler;
     this.autoscalerResource = autoscalerResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -81,79 +81,42 @@ private PatchRegionAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) {
-      fieldMap.put(
-          "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("autoscalerResource")) {
-      return String.valueOf(autoscalerResource);
+      return autoscalerResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -164,6 +127,12 @@ public Autoscaler getApiMessageRequestBody() {
     return autoscalerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -235,6 +204,7 @@ public static class Builder {
     private String autoscaler;
     private Autoscaler autoscalerResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -259,6 +229,9 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -288,6 +261,7 @@ public Builder mergeFrom(PatchRegionAutoscalerHttpRequest other) {
       this.autoscaler = source.autoscaler;
       this.autoscalerResource = source.autoscalerResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -333,6 +307,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -411,6 +394,7 @@ public PatchRegionAutoscalerHttpRequest build() {
           autoscaler,
           autoscalerResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -426,6 +410,7 @@ public Builder clone() {
       newBuilder.setAutoscaler(this.autoscaler);
       newBuilder.setAutoscalerResource(this.autoscalerResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -452,6 +437,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -486,6 +474,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.autoscaler, that.getAutoscaler())
           && Objects.equals(this.autoscalerResource, that.getAutoscalerResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -504,6 +493,7 @@ public int hashCode() {
         autoscaler,
         autoscalerResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java
index 62ac1effe9c8..4f91c71c2486 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class PatchRegionBackendServiceHttpRequest implements ApiMessage {
   private final String backendService;
   private final BackendService backendServiceResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -45,6 +42,7 @@ private PatchRegionBackendServiceHttpRequest() {
     this.backendService = null;
     this.backendServiceResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -58,6 +56,7 @@ private PatchRegionBackendServiceHttpRequest(
       String backendService,
       BackendService backendServiceResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -68,6 +67,7 @@ private PatchRegionBackendServiceHttpRequest(
     this.backendService = backendService;
     this.backendServiceResource = backendServiceResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,74 +77,39 @@ private PatchRegionBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) {
-      fieldMap.put(
-          "backendServiceResource",
-          Collections.singletonList(String.valueOf(backendServiceResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("backendServiceResource")) {
-      return String.valueOf(backendServiceResource);
+      return backendServiceResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public BackendService getApiMessageRequestBody() {
     return backendServiceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -222,6 +193,7 @@ public static class Builder {
     private String backendService;
     private BackendService backendServiceResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -245,6 +217,9 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -271,6 +246,7 @@ public Builder mergeFrom(PatchRegionBackendServiceHttpRequest other) {
       this.backendService = source.backendService;
       this.backendServiceResource = source.backendServiceResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -315,6 +291,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -384,6 +369,7 @@ public PatchRegionBackendServiceHttpRequest build() {
           backendService,
           backendServiceResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -398,6 +384,7 @@ public Builder clone() {
       newBuilder.setBackendService(this.backendService);
       newBuilder.setBackendServiceResource(this.backendServiceResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -423,6 +410,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -454,6 +444,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.backendService, that.getBackendService())
           && Objects.equals(this.backendServiceResource, that.getBackendServiceResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -471,6 +462,7 @@ public int hashCode() {
         backendService,
         backendServiceResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java
index 5162364dd1b7..bf550127c4f0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchRouterHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -43,6 +40,7 @@ public final class PatchRouterHttpRequest implements ApiMessage {
   private PatchRouterHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -56,6 +54,7 @@ private PatchRouterHttpRequest() {
   private PatchRouterHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -66,6 +65,7 @@ private PatchRouterHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,72 +77,39 @@ private PatchRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("routerResource") && routerResource != null) {
-      fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("routerResource")) {
-      return String.valueOf(routerResource);
+      return routerResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public Router getApiMessageRequestBody() {
     return routerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static PatchRouterHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -237,6 +211,9 @@ public Builder mergeFrom(PatchRouterHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(PatchRouterHttpRequest other) {
     Builder(PatchRouterHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public PatchRouterHttpRequest build() {
       return new PatchRouterHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       PatchRouterHttpRequest that = (PatchRouterHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java
index a026878f2905..41c751755cd8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchSslPolicyHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -43,6 +40,7 @@ public final class PatchSslPolicyHttpRequest implements ApiMessage {
   private PatchSslPolicyHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -56,6 +54,7 @@ private PatchSslPolicyHttpRequest() {
   private PatchSslPolicyHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -66,6 +65,7 @@ private PatchSslPolicyHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,73 +77,39 @@ private PatchSslPolicyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslPolicy") && sslPolicy != null) {
-      fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy)));
-    }
-    if (fieldNames.contains("sslPolicyResource") && sslPolicyResource != null) {
-      fieldMap.put(
-          "sslPolicyResource", Collections.singletonList(String.valueOf(sslPolicyResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslPolicy")) {
-      return String.valueOf(sslPolicy);
+      return sslPolicy;
     }
     if (fieldName.equals("sslPolicyResource")) {
-      return String.valueOf(sslPolicyResource);
+      return sslPolicyResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +120,12 @@ public SslPolicy getApiMessageRequestBody() {
     return sslPolicyResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -219,6 +191,7 @@ public static PatchSslPolicyHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -238,6 +211,9 @@ public Builder mergeFrom(PatchSslPolicyHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -268,6 +244,7 @@ public Builder mergeFrom(PatchSslPolicyHttpRequest other) {
     Builder(PatchSslPolicyHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -296,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -381,6 +367,7 @@ public PatchSslPolicyHttpRequest build() {
       return new PatchSslPolicyHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -395,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -416,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -451,6 +442,7 @@ public boolean equals(Object o) {
       PatchSslPolicyHttpRequest that = (PatchSslPolicyHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -468,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java
index a95f50f20073..0cb24e08eb02 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchSubnetworkHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -43,6 +40,7 @@ public final class PatchSubnetworkHttpRequest implements ApiMessage {
   private PatchSubnetworkHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -56,6 +54,7 @@ private PatchSubnetworkHttpRequest() {
   private PatchSubnetworkHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -66,6 +65,7 @@ private PatchSubnetworkHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,73 +77,39 @@ private PatchSubnetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    if (fieldNames.contains("subnetworkResource") && subnetworkResource != null) {
-      fieldMap.put(
-          "subnetworkResource", Collections.singletonList(String.valueOf(subnetworkResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     if (fieldName.equals("subnetworkResource")) {
-      return String.valueOf(subnetworkResource);
+      return subnetworkResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +120,12 @@ public Subnetwork getApiMessageRequestBody() {
     return subnetworkResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -219,6 +191,7 @@ public static PatchSubnetworkHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -238,6 +211,9 @@ public Builder mergeFrom(PatchSubnetworkHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -268,6 +244,7 @@ public Builder mergeFrom(PatchSubnetworkHttpRequest other) {
     Builder(PatchSubnetworkHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -296,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -381,6 +367,7 @@ public PatchSubnetworkHttpRequest build() {
       return new PatchSubnetworkHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -395,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -416,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -451,6 +442,7 @@ public boolean equals(Object o) {
       PatchSubnetworkHttpRequest that = (PatchSubnetworkHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -468,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java
index 4a4afacb909a..ec3e86f9e168 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class PatchUrlMapHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -43,6 +40,7 @@ public final class PatchUrlMapHttpRequest implements ApiMessage {
   private PatchUrlMapHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -56,6 +54,7 @@ private PatchUrlMapHttpRequest() {
   private PatchUrlMapHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -66,6 +65,7 @@ private PatchUrlMapHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,72 +77,39 @@ private PatchUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    if (fieldNames.contains("urlMapResource") && urlMapResource != null) {
-      fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     if (fieldName.equals("urlMapResource")) {
-      return String.valueOf(urlMapResource);
+      return urlMapResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public UrlMap getApiMessageRequestBody() {
     return urlMapResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static PatchUrlMapHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -237,6 +211,9 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(PatchUrlMapHttpRequest other) {
     Builder(PatchUrlMapHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public PatchUrlMapHttpRequest build() {
       return new PatchUrlMapHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       PatchUrlMapHttpRequest that = (PatchUrlMapHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java
index 07f69275395b..2afb86aaf9a3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -52,40 +47,18 @@ private PathMatcher(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("defaultService") && defaultService != null) {
-      fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("pathRules") && pathRules != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (PathRule item : pathRules) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("pathRules", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("defaultService")) {
-      return String.valueOf(defaultService);
+      return defaultService;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("pathRules")) {
-      return String.valueOf(pathRules);
+      return pathRules;
     }
     return null;
   }
@@ -96,6 +69,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDefaultService() {
     return defaultService;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java
index 968ee3b56b68..88bbf46bf25a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private PathRule(List paths, String service) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("paths") && paths != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : paths) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("paths", stringList.build());
-    }
-    if (fieldNames.contains("service") && service != null) {
-      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("paths")) {
-      return String.valueOf(paths);
+      return paths;
     }
     if (fieldName.equals("service")) {
-      return String.valueOf(service);
+      return service;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getPathsList() {
     return paths;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java
index abbed54809b7..c27d00c0cf1b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private PreviewRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("routerResource") && routerResource != null) {
-      fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("routerResource")) {
-      return String.valueOf(routerResource);
+      return routerResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public Router getApiMessageRequestBody() {
     return routerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java
index c39ee68b0057..e3522dc027f1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -87,98 +82,42 @@ private Project(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("commonInstanceMetadata") && commonInstanceMetadata != null) {
-      fieldMap.put(
-          "commonInstanceMetadata",
-          Collections.singletonList(String.valueOf(commonInstanceMetadata)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("defaultServiceAccount") && defaultServiceAccount != null) {
-      fieldMap.put(
-          "defaultServiceAccount",
-          Collections.singletonList(String.valueOf(defaultServiceAccount)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : enabledFeatures) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("enabledFeatures", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("quotas") && quotas != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Quota item : quotas) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("quotas", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("usageExportLocation") && usageExportLocation != null) {
-      fieldMap.put(
-          "usageExportLocation", Collections.singletonList(String.valueOf(usageExportLocation)));
-    }
-    if (fieldNames.contains("xpnProjectStatus") && xpnProjectStatus != null) {
-      fieldMap.put("xpnProjectStatus", Collections.singletonList(String.valueOf(xpnProjectStatus)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("commonInstanceMetadata")) {
-      return String.valueOf(commonInstanceMetadata);
+      return commonInstanceMetadata;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("defaultServiceAccount")) {
-      return String.valueOf(defaultServiceAccount);
+      return defaultServiceAccount;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("enabledFeatures")) {
-      return String.valueOf(enabledFeatures);
+      return enabledFeatures;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("quotas")) {
-      return String.valueOf(quotas);
+      return quotas;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("usageExportLocation")) {
-      return String.valueOf(usageExportLocation);
+      return usageExportLocation;
     }
     if (fieldName.equals("xpnProjectStatus")) {
-      return String.valueOf(xpnProjectStatus);
+      return xpnProjectStatus;
     }
     return null;
   }
@@ -189,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Metadata getCommonInstanceMetadata() {
     return commonInstanceMetadata;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java
index cab562f3330a..51c5f47b353a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (ProjectClient projectClient = ProjectClient.create()) {
- *   String requestId = "";
  *   ProjectName project = ProjectName.of("[PROJECT]");
- *   Operation response = projectClient.disableXpnHostProject(requestId, project);
+ *   Operation response = projectClient.disableXpnHostProject(project);
  * }
  * 
  * 
@@ -159,30 +158,19 @@ public ProjectStub getStub() { * *

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   Operation response = projectClient.disableXpnHostProject(requestId, project);
+   *   Operation response = projectClient.disableXpnHostProject(project);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation disableXpnHostProject(String requestId, ProjectName project) { + public final Operation disableXpnHostProject(ProjectName project) { DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .build(); return disableXpnHostProject(request); @@ -196,32 +184,19 @@ public final Operation disableXpnHostProject(String requestId, ProjectName proje * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   Operation response = projectClient.disableXpnHostProject(requestId, project.toString());
+   *   Operation response = projectClient.disableXpnHostProject(project.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation disableXpnHostProject(String requestId, String project) { + public final Operation disableXpnHostProject(String project) { DisableXpnHostProjectHttpRequest request = - DisableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .build(); + DisableXpnHostProjectHttpRequest.newBuilder().setProject(project).build(); return disableXpnHostProject(request); } @@ -233,10 +208,8 @@ public final Operation disableXpnHostProject(String requestId, String project) { * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .build();
    *   Operation response = projectClient.disableXpnHostProject(request);
@@ -259,10 +232,8 @@ public final Operation disableXpnHostProject(DisableXpnHostProjectHttpRequest re
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .build();
    *   ApiFuture<Operation> future = projectClient.disableXpnHostProjectCallable().futureCall(request);
@@ -285,35 +256,23 @@ public final Operation disableXpnHostProject(DisableXpnHostProjectHttpRequest re
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
-   *   Operation response = projectClient.disableXpnResourceProject(requestId, project, projectsDisableXpnResourceRequestResource);
+   *   Operation response = projectClient.disableXpnResourceProject(project, projectsDisableXpnResourceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsDisableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation disableXpnResourceProject( - String requestId, ProjectName project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) .build(); @@ -328,35 +287,22 @@ public final Operation disableXpnResourceProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
-   *   Operation response = projectClient.disableXpnResourceProject(requestId, project.toString(), projectsDisableXpnResourceRequestResource);
+   *   Operation response = projectClient.disableXpnResourceProject(project.toString(), projectsDisableXpnResourceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsDisableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation disableXpnResourceProject( - String requestId, - String project, - ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { + String project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource) { DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource) .build(); @@ -371,11 +317,9 @@ public final Operation disableXpnResourceProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
    *   DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource)
    *     .build();
@@ -399,11 +343,9 @@ public final Operation disableXpnResourceProject(DisableXpnResourceProjectHttpRe
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build();
    *   DisableXpnResourceProjectHttpRequest request = DisableXpnResourceProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setProjectsDisableXpnResourceRequestResource(projectsDisableXpnResourceRequestResource)
    *     .build();
@@ -427,30 +369,19 @@ public final Operation disableXpnResourceProject(DisableXpnResourceProjectHttpRe
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   Operation response = projectClient.enableXpnHostProject(requestId, project);
+   *   Operation response = projectClient.enableXpnHostProject(project);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation enableXpnHostProject(String requestId, ProjectName project) { + public final Operation enableXpnHostProject(ProjectName project) { EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .build(); return enableXpnHostProject(request); @@ -464,32 +395,19 @@ public final Operation enableXpnHostProject(String requestId, ProjectName projec * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   Operation response = projectClient.enableXpnHostProject(requestId, project.toString());
+   *   Operation response = projectClient.enableXpnHostProject(project.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation enableXpnHostProject(String requestId, String project) { + public final Operation enableXpnHostProject(String project) { EnableXpnHostProjectHttpRequest request = - EnableXpnHostProjectHttpRequest.newBuilder() - .setRequestId(requestId) - .setProject(project) - .build(); + EnableXpnHostProjectHttpRequest.newBuilder().setProject(project).build(); return enableXpnHostProject(request); } @@ -501,10 +419,8 @@ public final Operation enableXpnHostProject(String requestId, String project) { * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .build();
    *   Operation response = projectClient.enableXpnHostProject(request);
@@ -527,10 +443,8 @@ public final Operation enableXpnHostProject(EnableXpnHostProjectHttpRequest requ
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   EnableXpnHostProjectHttpRequest request = EnableXpnHostProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .build();
    *   ApiFuture<Operation> future = projectClient.enableXpnHostProjectCallable().futureCall(request);
@@ -554,35 +468,23 @@ public final Operation enableXpnHostProject(EnableXpnHostProjectHttpRequest requ
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
-   *   Operation response = projectClient.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource);
+   *   Operation response = projectClient.enableXpnResourceProject(project, projectsEnableXpnResourceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsEnableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation enableXpnResourceProject( - String requestId, ProjectName project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) .build(); @@ -598,35 +500,22 @@ public final Operation enableXpnResourceProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
-   *   Operation response = projectClient.enableXpnResourceProject(requestId, project.toString(), projectsEnableXpnResourceRequestResource);
+   *   Operation response = projectClient.enableXpnResourceProject(project.toString(), projectsEnableXpnResourceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param projectsEnableXpnResourceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation enableXpnResourceProject( - String requestId, - String project, - ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { + String project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource) { EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource) .build(); @@ -642,11 +531,9 @@ public final Operation enableXpnResourceProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
    *   EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource)
    *     .build();
@@ -671,11 +558,9 @@ public final Operation enableXpnResourceProject(EnableXpnResourceProjectHttpRequ
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build();
    *   EnableXpnResourceProjectHttpRequest request = EnableXpnResourceProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setProjectsEnableXpnResourceRequestResource(projectsEnableXpnResourceRequestResource)
    *     .build();
@@ -1185,33 +1070,22 @@ public final ListXpnHostsProjectsPagedResponse listXpnHostsProjects(
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveDiskProject(requestId, project, diskMoveRequestResource);
+   *   Operation response = projectClient.moveDiskProject(project, diskMoveRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param diskMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation moveDiskProject( - String requestId, ProjectName project, DiskMoveRequest diskMoveRequestResource) { + ProjectName project, DiskMoveRequest diskMoveRequestResource) { MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setDiskMoveRequestResource(diskMoveRequestResource) .build(); @@ -1226,33 +1100,21 @@ public final Operation moveDiskProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveDiskProject(requestId, project.toString(), diskMoveRequestResource);
+   *   Operation response = projectClient.moveDiskProject(project.toString(), diskMoveRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param diskMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation moveDiskProject( - String requestId, String project, DiskMoveRequest diskMoveRequestResource) { + public final Operation moveDiskProject(String project, DiskMoveRequest diskMoveRequestResource) { MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setDiskMoveRequestResource(diskMoveRequestResource) .build(); @@ -1267,11 +1129,9 @@ public final Operation moveDiskProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
    *   MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setDiskMoveRequestResource(diskMoveRequestResource)
    *     .build();
@@ -1295,11 +1155,9 @@ public final Operation moveDiskProject(MoveDiskProjectHttpRequest request) {
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
    *   MoveDiskProjectHttpRequest request = MoveDiskProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setDiskMoveRequestResource(diskMoveRequestResource)
    *     .build();
@@ -1322,33 +1180,22 @@ public final UnaryCallable moveDiskProjec
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveInstanceProject(requestId, project, instanceMoveRequestResource);
+   *   Operation response = projectClient.moveInstanceProject(project, instanceMoveRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation moveInstanceProject( - String requestId, ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { + ProjectName project, InstanceMoveRequest instanceMoveRequestResource) { MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setInstanceMoveRequestResource(instanceMoveRequestResource) .build(); @@ -1363,33 +1210,22 @@ public final Operation moveInstanceProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
-   *   Operation response = projectClient.moveInstanceProject(requestId, project.toString(), instanceMoveRequestResource);
+   *   Operation response = projectClient.moveInstanceProject(project.toString(), instanceMoveRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param instanceMoveRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation moveInstanceProject( - String requestId, String project, InstanceMoveRequest instanceMoveRequestResource) { + String project, InstanceMoveRequest instanceMoveRequestResource) { MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setInstanceMoveRequestResource(instanceMoveRequestResource) .build(); @@ -1404,11 +1240,9 @@ public final Operation moveInstanceProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
    *   MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceMoveRequestResource(instanceMoveRequestResource)
    *     .build();
@@ -1432,11 +1266,9 @@ public final Operation moveInstanceProject(MoveInstanceProjectHttpRequest reques
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
    *   MoveInstanceProjectHttpRequest request = MoveInstanceProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setInstanceMoveRequestResource(instanceMoveRequestResource)
    *     .build();
@@ -1461,33 +1293,22 @@ public final Operation moveInstanceProject(MoveInstanceProjectHttpRequest reques
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = projectClient.setCommonInstanceMetadataProject(requestId, project, metadataResource);
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(project, metadataResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setCommonInstanceMetadataProject( - String requestId, ProjectName project, Metadata metadataResource) { + ProjectName project, Metadata metadataResource) { SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setMetadataResource(metadataResource) .build(); @@ -1503,33 +1324,22 @@ public final Operation setCommonInstanceMetadataProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
-   *   Operation response = projectClient.setCommonInstanceMetadataProject(requestId, project.toString(), metadataResource);
+   *   Operation response = projectClient.setCommonInstanceMetadataProject(project.toString(), metadataResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param metadataResource A metadata key/value entry. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setCommonInstanceMetadataProject( - String requestId, String project, Metadata metadataResource) { + String project, Metadata metadataResource) { SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setMetadataResource(metadataResource) .build(); @@ -1545,11 +1355,9 @@ public final Operation setCommonInstanceMetadataProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setMetadataResource(metadataResource)
    *     .build();
@@ -1575,11 +1383,9 @@ public final Operation setCommonInstanceMetadataProject(
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Metadata metadataResource = Metadata.newBuilder().build();
    *   SetCommonInstanceMetadataProjectHttpRequest request = SetCommonInstanceMetadataProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setMetadataResource(metadataResource)
    *     .build();
@@ -1604,22 +1410,12 @@ public final Operation setCommonInstanceMetadataProject(
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
-   *   Operation response = projectClient.setUsageExportBucketProject(requestId, project, usageExportLocationResource);
+   *   Operation response = projectClient.setUsageExportBucketProject(project, usageExportLocationResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily * usage report. Contains bucket_name and report_name prefix. @@ -1627,11 +1423,10 @@ public final Operation setCommonInstanceMetadataProject( */ @BetaApi public final Operation setUsageExportBucketProject( - String requestId, ProjectName project, UsageExportLocation usageExportLocationResource) { + ProjectName project, UsageExportLocation usageExportLocationResource) { SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setUsageExportLocationResource(usageExportLocationResource) .build(); @@ -1647,22 +1442,12 @@ public final Operation setUsageExportBucketProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
-   *   Operation response = projectClient.setUsageExportBucketProject(requestId, project.toString(), usageExportLocationResource);
+   *   Operation response = projectClient.setUsageExportBucketProject(project.toString(), usageExportLocationResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param usageExportLocationResource The location in Cloud Storage and naming method of the daily * usage report. Contains bucket_name and report_name prefix. @@ -1670,11 +1455,10 @@ public final Operation setUsageExportBucketProject( */ @BetaApi public final Operation setUsageExportBucketProject( - String requestId, String project, UsageExportLocation usageExportLocationResource) { + String project, UsageExportLocation usageExportLocationResource) { SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setUsageExportLocationResource(usageExportLocationResource) .build(); @@ -1690,11 +1474,9 @@ public final Operation setUsageExportBucketProject( * *


    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
    *   SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUsageExportLocationResource(usageExportLocationResource)
    *     .build();
@@ -1720,11 +1502,9 @@ public final Operation setUsageExportBucketProject(
    *
    * 

    * try (ProjectClient projectClient = ProjectClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
    *   SetUsageExportBucketProjectHttpRequest request = SetUsageExportBucketProjectHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUsageExportLocationResource(usageExportLocationResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java
index 2d2681b02469..cfdf2021f2d7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private ProjectsDisableXpnResourceRequest(XpnResourceId xpnResource) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("xpnResource") && xpnResource != null) {
-      fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("xpnResource")) {
+      return xpnResource;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("xpnResource")) {
-      return String.valueOf(xpnResource);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java
index 93d202170c86..6711dcfed506 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private ProjectsEnableXpnResourceRequest(XpnResourceId xpnResource) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("xpnResource") && xpnResource != null) {
-      fieldMap.put("xpnResource", Collections.singletonList(String.valueOf(xpnResource)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("xpnResource")) {
+      return xpnResource;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("xpnResource")) {
-      return String.valueOf(xpnResource);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java
index 03735a00d02e..3a9c24aaf12d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -49,34 +44,15 @@ private ProjectsGetXpnResources(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("resources") && resources != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (XpnResourceId item : resources) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("resources", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("resources")) {
-      return String.valueOf(resources);
+      return resources;
     }
     return null;
   }
@@ -87,6 +63,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getKind() {
     return kind;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java
index 15a07bb7ad48..9f5602b43fc6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private ProjectsListXpnHostsRequest(String organization) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("organization") && organization != null) {
-      fieldMap.put("organization", Collections.singletonList(String.valueOf(organization)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("organization")) {
+      return organization;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("organization")) {
-      return String.valueOf(organization);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java
index bec535da0955..0001cdcba466 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,30 +42,15 @@ private Quota(Double limit, String metric, Double usage) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("limit") && limit != null) {
-      fieldMap.put("limit", Collections.singletonList(String.valueOf(limit)));
-    }
-    if (fieldNames.contains("metric") && metric != null) {
-      fieldMap.put("metric", Collections.singletonList(String.valueOf(metric)));
-    }
-    if (fieldNames.contains("usage") && usage != null) {
-      fieldMap.put("usage", Collections.singletonList(String.valueOf(usage)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("limit")) {
-      return String.valueOf(limit);
+      return limit;
     }
     if (fieldName.equals("metric")) {
-      return String.valueOf(metric);
+      return metric;
     }
     if (fieldName.equals("usage")) {
-      return String.valueOf(usage);
+      return usage;
     }
     return null;
   }
@@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Double getLimit() {
     return limit;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java
index f40843794cd0..e32d17996fb1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,30 +42,15 @@ private RawDisk(String containerType, String sha1Checksum, String source) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("containerType") && containerType != null) {
-      fieldMap.put("containerType", Collections.singletonList(String.valueOf(containerType)));
-    }
-    if (fieldNames.contains("sha1Checksum") && sha1Checksum != null) {
-      fieldMap.put("sha1Checksum", Collections.singletonList(String.valueOf(sha1Checksum)));
-    }
-    if (fieldNames.contains("source") && source != null) {
-      fieldMap.put("source", Collections.singletonList(String.valueOf(source)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("containerType")) {
-      return String.valueOf(containerType);
+      return containerType;
     }
     if (fieldName.equals("sha1Checksum")) {
-      return String.valueOf(sha1Checksum);
+      return sha1Checksum;
     }
     if (fieldName.equals("source")) {
-      return String.valueOf(source);
+      return source;
     }
     return null;
   }
@@ -80,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getContainerType() {
     return containerType;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java
index fa3fa9b56115..938f45cd1449 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,77 +76,36 @@ private RecreateInstancesInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("instanceGroupManagersRecreateInstancesRequestResource")
-        && instanceGroupManagersRecreateInstancesRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupManagersRecreateInstancesRequestResource",
-          Collections.singletonList(
-              String.valueOf(instanceGroupManagersRecreateInstancesRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("instanceGroupManagersRecreateInstancesRequestResource")) {
-      return String.valueOf(instanceGroupManagersRecreateInstancesRequestResource);
+      return instanceGroupManagersRecreateInstancesRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -161,6 +116,12 @@ public InstanceGroupManagersRecreateInstancesRequest getApiMessageRequestBody()
     return instanceGroupManagersRecreateInstancesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java
index 0448b906a2da..5d8fc03ea2c8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,77 +75,36 @@ private RecreateInstancesRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionInstanceGroupManagersRecreateRequestResource")
-        && regionInstanceGroupManagersRecreateRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupManagersRecreateRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupManagersRecreateRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionInstanceGroupManagersRecreateRequestResource")) {
-      return String.valueOf(regionInstanceGroupManagersRecreateRequestResource);
+      return regionInstanceGroupManagersRecreateRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -160,6 +115,12 @@ public RegionInstanceGroupManagersRecreateRequest getApiMessageRequestBody() {
     return regionInstanceGroupManagersRecreateRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java
index c445cf9c6833..3628a6bda60c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -49,36 +45,18 @@ private Reference(String kind, String referenceType, String referrer, String tar
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("referenceType") && referenceType != null) {
-      fieldMap.put("referenceType", Collections.singletonList(String.valueOf(referenceType)));
-    }
-    if (fieldNames.contains("referrer") && referrer != null) {
-      fieldMap.put("referrer", Collections.singletonList(String.valueOf(referrer)));
-    }
-    if (fieldNames.contains("target") && target != null) {
-      fieldMap.put("target", Collections.singletonList(String.valueOf(target)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("referenceType")) {
-      return String.valueOf(referenceType);
+      return referenceType;
     }
     if (fieldName.equals("referrer")) {
-      return String.valueOf(referrer);
+      return referrer;
     }
     if (fieldName.equals("target")) {
-      return String.valueOf(target);
+      return target;
     }
     return null;
   }
@@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getKind() {
     return kind;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java
index dfbe4ed281ff..0d3c8cba1ae1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,81 +74,36 @@ private Region(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("deprecated") && deprecated != null) {
-      fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("quotas") && quotas != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Quota item : quotas) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("quotas", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("zones") && zones != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : zones) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("zones", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("deprecated")) {
-      return String.valueOf(deprecated);
+      return deprecated;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("quotas")) {
-      return String.valueOf(quotas);
+      return quotas;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("zones")) {
-      return String.valueOf(zones);
+      return zones;
     }
     return null;
   }
@@ -164,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
index 10981a4c21f4..bd85152c9d4f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java
@@ -43,8 +43,7 @@
  * 
  * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
  *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
- *   String requestId = "";
- *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler, requestId);
+ *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
  * }
  * 
  * 
@@ -163,31 +162,19 @@ public RegionAutoscalerStub getStub() { *

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
-   *   String requestId = "";
-   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler, requestId);
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler);
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionAutoscaler( - ProjectRegionAutoscalerName autoscaler, String requestId) { + public final Operation deleteRegionAutoscaler(ProjectRegionAutoscalerName autoscaler) { DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler == null ? null : autoscaler.toString()) - .setRequestId(requestId) .build(); return deleteRegionAutoscaler(request); } @@ -201,31 +188,18 @@ public final Operation deleteRegionAutoscaler( *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
-   *   String requestId = "";
-   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler.toString(), requestId);
+   *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler.toString());
    * }
    * 
* * @param autoscaler Name of the autoscaler to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionAutoscaler(String autoscaler, String requestId) { + public final Operation deleteRegionAutoscaler(String autoscaler) { DeleteRegionAutoscalerHttpRequest request = - DeleteRegionAutoscalerHttpRequest.newBuilder() - .setAutoscaler(autoscaler) - .setRequestId(requestId) - .build(); + DeleteRegionAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build(); return deleteRegionAutoscaler(request); } @@ -238,10 +212,8 @@ public final Operation deleteRegionAutoscaler(String autoscaler, String requestI *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
-   *   String requestId = "";
    *   DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = regionAutoscalerClient.deleteRegionAutoscaler(request);
    * }
@@ -264,10 +236,8 @@ public final Operation deleteRegionAutoscaler(DeleteRegionAutoscalerHttpRequest
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]");
-   *   String requestId = "";
    *   DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = regionAutoscalerClient.deleteRegionAutoscalerCallable().futureCall(request);
    *   // Do something
@@ -387,22 +357,12 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque
    *
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(requestId, region, autoscalerResource);
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(region, autoscalerResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an @@ -413,11 +373,10 @@ public final Autoscaler getRegionAutoscaler(GetRegionAutoscalerHttpRequest reque */ @BetaApi public final Operation insertRegionAutoscaler( - String requestId, ProjectRegionName region, Autoscaler autoscalerResource) { + ProjectRegionName region, Autoscaler autoscalerResource) { InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setAutoscalerResource(autoscalerResource) .build(); @@ -432,22 +391,12 @@ public final Operation insertRegionAutoscaler( * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(requestId, region.toString(), autoscalerResource);
+   *   Operation response = regionAutoscalerClient.insertRegionAutoscaler(region.toString(), autoscalerResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an @@ -457,12 +406,10 @@ public final Operation insertRegionAutoscaler( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionAutoscaler( - String requestId, String region, Autoscaler autoscalerResource) { + public final Operation insertRegionAutoscaler(String region, Autoscaler autoscalerResource) { InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setAutoscalerResource(autoscalerResource) .build(); @@ -477,11 +424,9 @@ public final Operation insertRegionAutoscaler( * *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -505,11 +450,9 @@ public final Operation insertRegionAutoscaler(InsertRegionAutoscalerHttpRequest
    *
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -673,23 +616,13 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers(
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, region, autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an @@ -700,15 +633,11 @@ public final ListRegionAutoscalersPagedResponse listRegionAutoscalers( */ @BetaApi public final Operation patchRegionAutoscaler( - String autoscaler, - String requestId, - ProjectRegionName region, - Autoscaler autoscalerResource) { + String autoscaler, ProjectRegionName region, Autoscaler autoscalerResource) { PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setAutoscalerResource(autoscalerResource) .build(); @@ -725,23 +654,13 @@ public final Operation patchRegionAutoscaler( *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, requestId, region.toString(), autoscalerResource);
+   *   Operation response = regionAutoscalerClient.patchRegionAutoscaler(autoscaler, region.toString(), autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an @@ -752,12 +671,11 @@ public final Operation patchRegionAutoscaler( */ @BetaApi public final Operation patchRegionAutoscaler( - String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { + String autoscaler, String region, Autoscaler autoscalerResource) { PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) - .setRequestId(requestId) .setRegion(region) .setAutoscalerResource(autoscalerResource) .build(); @@ -774,12 +692,10 @@ public final Operation patchRegionAutoscaler( *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -805,12 +721,10 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   PatchRegionAutoscalerHttpRequest request = PatchRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -835,23 +749,13 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource);
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, region, autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an @@ -862,15 +766,11 @@ public final Operation patchRegionAutoscaler(PatchRegionAutoscalerHttpRequest re */ @BetaApi public final Operation updateRegionAutoscaler( - String autoscaler, - String requestId, - ProjectRegionName region, - Autoscaler autoscalerResource) { + String autoscaler, ProjectRegionName region, Autoscaler autoscalerResource) { UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setAutoscalerResource(autoscalerResource) .build(); @@ -886,23 +786,13 @@ public final Operation updateRegionAutoscaler( *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
-   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, requestId, region.toString(), autoscalerResource);
+   *   Operation response = regionAutoscalerClient.updateRegionAutoscaler(autoscaler, region.toString(), autoscalerResource);
    * }
    * 
* * @param autoscaler Name of the autoscaler to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to * automatically scale virtual machine instances in managed instance groups according to an @@ -913,12 +803,11 @@ public final Operation updateRegionAutoscaler( */ @BetaApi public final Operation updateRegionAutoscaler( - String autoscaler, String requestId, String region, Autoscaler autoscalerResource) { + String autoscaler, String region, Autoscaler autoscalerResource) { UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder() .setAutoscaler(autoscaler) - .setRequestId(requestId) .setRegion(region) .setAutoscalerResource(autoscalerResource) .build(); @@ -934,12 +823,10 @@ public final Operation updateRegionAutoscaler( *


    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
@@ -964,12 +851,10 @@ public final Operation updateRegionAutoscaler(UpdateRegionAutoscalerHttpRequest
    * 

    * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) {
    *   String autoscaler = "";
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
    *   UpdateRegionAutoscalerHttpRequest request = UpdateRegionAutoscalerHttpRequest.newBuilder()
    *     .setAutoscaler(autoscaler)
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setAutoscalerResource(autoscalerResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java
index 5ad459a5be6e..09562b3cbb11 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RegionAutoscalerList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Autoscaler item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java
index c55d190fd8f9..ab17b311941f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
- *   String requestId = "";
  *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
- *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService);
+ *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
  * }
  * 
  * 
@@ -162,31 +161,20 @@ public RegionBackendServiceStub getStub() { * *

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
-   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService);
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteRegionBackendService( - String requestId, ProjectRegionBackendServiceName backendService) { + ProjectRegionBackendServiceName backendService) { DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .build(); return deleteRegionBackendService(request); @@ -200,30 +188,19 @@ public final Operation deleteRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
-   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService.toString());
+   *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionBackendService(String requestId, String backendService) { + public final Operation deleteRegionBackendService(String backendService) { DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService) .build(); return deleteRegionBackendService(request); @@ -237,10 +214,8 @@ public final Operation deleteRegionBackendService(String requestId, String backe * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   Operation response = regionBackendServiceClient.deleteRegionBackendService(request);
@@ -263,10 +238,8 @@ public final Operation deleteRegionBackendService(DeleteRegionBackendServiceHttp
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .build();
    *   ApiFuture<Operation> future = regionBackendServiceClient.deleteRegionBackendServiceCallable().futureCall(request);
@@ -504,22 +477,12 @@ public final BackendServiceGroupHealth getHealthRegionBackendService(
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.insertRegionBackendService(requestId, region, backendServiceResource);
+   *   Operation response = regionBackendServiceClient.insertRegionBackendService(region, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -528,11 +491,10 @@ public final BackendServiceGroupHealth getHealthRegionBackendService( */ @BetaApi public final Operation insertRegionBackendService( - String requestId, ProjectRegionName region, BackendService backendServiceResource) { + ProjectRegionName region, BackendService backendServiceResource) { InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -549,22 +511,12 @@ public final Operation insertRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.insertRegionBackendService(requestId, region.toString(), backendServiceResource);
+   *   Operation response = regionBackendServiceClient.insertRegionBackendService(region.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -573,11 +525,10 @@ public final Operation insertRegionBackendService( */ @BetaApi public final Operation insertRegionBackendService( - String requestId, String region, BackendService backendServiceResource) { + String region, BackendService backendServiceResource) { InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setBackendServiceResource(backendServiceResource) .build(); @@ -594,11 +545,9 @@ public final Operation insertRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -624,11 +573,9 @@ public final Operation insertRegionBackendService(InsertRegionBackendServiceHttp
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -800,22 +747,12 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices(
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.patchRegionBackendService(requestId, backendService, backendServiceResource);
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(backendService, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -824,13 +761,10 @@ public final ListRegionBackendServicesPagedResponse listRegionBackendServices( */ @BetaApi public final Operation patchRegionBackendService( - String requestId, - ProjectRegionBackendServiceName backendService, - BackendService backendServiceResource) { + ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -848,22 +782,12 @@ public final Operation patchRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.patchRegionBackendService(requestId, backendService.toString(), backendServiceResource);
+   *   Operation response = regionBackendServiceClient.patchRegionBackendService(backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to patch. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -872,11 +796,10 @@ public final Operation patchRegionBackendService( */ @BetaApi public final Operation patchRegionBackendService( - String requestId, String backendService, BackendService backendServiceResource) { + String backendService, BackendService backendServiceResource) { PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -894,11 +817,9 @@ public final Operation patchRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -925,11 +846,9 @@ public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRe
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -955,22 +874,12 @@ public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRe
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.updateRegionBackendService(requestId, backendService, backendServiceResource);
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(backendService, backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -979,13 +888,10 @@ public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRe */ @BetaApi public final Operation updateRegionBackendService( - String requestId, - ProjectRegionBackendServiceName backendService, - BackendService backendServiceResource) { + ProjectRegionBackendServiceName backendService, BackendService backendServiceResource) { UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService == null ? null : backendService.toString()) .setBackendServiceResource(backendServiceResource) .build(); @@ -1002,22 +908,12 @@ public final Operation updateRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
-   *   Operation response = regionBackendServiceClient.updateRegionBackendService(requestId, backendService.toString(), backendServiceResource);
+   *   Operation response = regionBackendServiceClient.updateRegionBackendService(backendService.toString(), backendServiceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param backendService Name of the BackendService resource to update. * @param backendServiceResource A BackendService resource. This resource defines a group of * backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) @@ -1026,11 +922,10 @@ public final Operation updateRegionBackendService( */ @BetaApi public final Operation updateRegionBackendService( - String requestId, String backendService, BackendService backendServiceResource) { + String backendService, BackendService backendServiceResource) { UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder() - .setRequestId(requestId) .setBackendService(backendService) .setBackendServiceResource(backendServiceResource) .build(); @@ -1047,11 +942,9 @@ public final Operation updateRegionBackendService( * *


    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
@@ -1077,11 +970,9 @@ public final Operation updateRegionBackendService(UpdateRegionBackendServiceHttp
    *
    * 

    * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
    *   BackendService backendServiceResource = BackendService.newBuilder().build();
    *   UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setBackendService(backendService.toString())
    *     .setBackendServiceResource(backendServiceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
index 27f821e6ff9a..399aa2a169b6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java
@@ -404,22 +404,12 @@ public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest reque
    *
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
-   *   Operation response = regionCommitmentClient.insertRegionCommitment(requestId, region, commitmentResource);
+   *   Operation response = regionCommitmentClient.insertRegionCommitment(region, commitmentResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource * means that you are purchasing a committed use contract with an explicit start and end time. @@ -433,11 +423,10 @@ public final Commitment getRegionCommitment(GetRegionCommitmentHttpRequest reque */ @BetaApi public final Operation insertRegionCommitment( - String requestId, ProjectRegionName region, Commitment commitmentResource) { + ProjectRegionName region, Commitment commitmentResource) { InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setCommitmentResource(commitmentResource) .build(); @@ -452,22 +441,12 @@ public final Operation insertRegionCommitment( * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
-   *   Operation response = regionCommitmentClient.insertRegionCommitment(requestId, region.toString(), commitmentResource);
+   *   Operation response = regionCommitmentClient.insertRegionCommitment(region.toString(), commitmentResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param commitmentResource Represents a Commitment resource. Creating a Commitment resource * means that you are purchasing a committed use contract with an explicit start and end time. @@ -480,12 +459,10 @@ public final Operation insertRegionCommitment( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionCommitment( - String requestId, String region, Commitment commitmentResource) { + public final Operation insertRegionCommitment(String region, Commitment commitmentResource) { InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setCommitmentResource(commitmentResource) .build(); @@ -500,11 +477,9 @@ public final Operation insertRegionCommitment( * *


    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
    *   InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setCommitmentResource(commitmentResource)
    *     .build();
@@ -528,11 +503,9 @@ public final Operation insertRegionCommitment(InsertRegionCommitmentHttpRequest
    *
    * 

    * try (RegionCommitmentClient regionCommitmentClient = RegionCommitmentClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Commitment commitmentResource = Commitment.newBuilder().build();
    *   InsertRegionCommitmentHttpRequest request = InsertRegionCommitmentHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setCommitmentResource(commitmentResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java
index 5df811c2be59..65b229358925 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java
@@ -43,9 +43,8 @@
  * 
  * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
  *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
- *   String requestId = "";
  *   Snapshot snapshotResource = Snapshot.newBuilder().build();
- *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, requestId, snapshotResource);
+ *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, snapshotResource);
  * }
  * 
  * 
@@ -161,34 +160,23 @@ public RegionDiskStub getStub() { *

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
-   *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, requestId, snapshotResource);
+   *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk, snapshotResource);
    * }
    * 
* * @param disk Name of the regional persistent disk to snapshot. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots * ==) (== resource_for v1.snapshots ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation createSnapshotRegionDisk( - ProjectRegionDiskName disk, String requestId, Snapshot snapshotResource) { + ProjectRegionDiskName disk, Snapshot snapshotResource) { CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) .setSnapshotResource(snapshotResource) .build(); return createSnapshotRegionDisk(request); @@ -203,34 +191,22 @@ public final Operation createSnapshotRegionDisk( *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
-   *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk.toString(), requestId, snapshotResource);
+   *   Operation response = regionDiskClient.createSnapshotRegionDisk(disk.toString(), snapshotResource);
    * }
    * 
* * @param disk Name of the regional persistent disk to snapshot. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots * ==) (== resource_for v1.snapshots ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation createSnapshotRegionDisk( - String disk, String requestId, Snapshot snapshotResource) { + public final Operation createSnapshotRegionDisk(String disk, Snapshot snapshotResource) { CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder() .setDisk(disk) - .setRequestId(requestId) .setSnapshotResource(snapshotResource) .build(); return createSnapshotRegionDisk(request); @@ -245,11 +221,9 @@ public final Operation createSnapshotRegionDisk( *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
    *   CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setSnapshotResource(snapshotResource)
    *     .build();
    *   Operation response = regionDiskClient.createSnapshotRegionDisk(request);
@@ -273,11 +247,9 @@ public final Operation createSnapshotRegionDisk(CreateSnapshotRegionDiskHttpRequ
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   Snapshot snapshotResource = Snapshot.newBuilder().build();
    *   CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setSnapshotResource(snapshotResource)
    *     .build();
    *   ApiFuture<Operation> future = regionDiskClient.createSnapshotRegionDiskCallable().futureCall(request);
@@ -303,30 +275,19 @@ public final Operation createSnapshotRegionDisk(CreateSnapshotRegionDiskHttpRequ
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
-   *   Operation response = regionDiskClient.deleteRegionDisk(disk, requestId);
+   *   Operation response = regionDiskClient.deleteRegionDisk(disk);
    * }
    * 
* * @param disk Name of the regional persistent disk to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionDisk(ProjectRegionDiskName disk, String requestId) { + public final Operation deleteRegionDisk(ProjectRegionDiskName disk) { DeleteRegionDiskHttpRequest request = DeleteRegionDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) .build(); return deleteRegionDisk(request); } @@ -342,28 +303,18 @@ public final Operation deleteRegionDisk(ProjectRegionDiskName disk, String reque *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
-   *   Operation response = regionDiskClient.deleteRegionDisk(disk.toString(), requestId);
+   *   Operation response = regionDiskClient.deleteRegionDisk(disk.toString());
    * }
    * 
* * @param disk Name of the regional persistent disk to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionDisk(String disk, String requestId) { + public final Operation deleteRegionDisk(String disk) { DeleteRegionDiskHttpRequest request = - DeleteRegionDiskHttpRequest.newBuilder().setDisk(disk).setRequestId(requestId).build(); + DeleteRegionDiskHttpRequest.newBuilder().setDisk(disk).build(); return deleteRegionDisk(request); } @@ -378,10 +329,8 @@ public final Operation deleteRegionDisk(String disk, String requestId) { *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   DeleteRegionDiskHttpRequest request = DeleteRegionDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = regionDiskClient.deleteRegionDisk(request);
    * }
@@ -406,10 +355,8 @@ public final Operation deleteRegionDisk(DeleteRegionDiskHttpRequest request) {
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   DeleteRegionDiskHttpRequest request = DeleteRegionDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = regionDiskClient.deleteRegionDiskCallable().futureCall(request);
    *   // Do something
@@ -527,37 +474,22 @@ public final UnaryCallable getRegionDiskCallable
    *
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Disk diskResource = Disk.newBuilder().build();
-   *   Operation response = regionDiskClient.insertRegionDisk(requestId, sourceImage, region, diskResource);
+   *   Operation response = regionDiskClient.insertRegionDisk(region, diskResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). - * @param sourceImage Optional. Source image to restore onto a disk. * @param region Name of the region for this request. * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionDisk( - String requestId, String sourceImage, ProjectRegionName region, Disk diskResource) { + public final Operation insertRegionDisk(ProjectRegionName region, Disk diskResource) { InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder() - .setRequestId(requestId) - .setSourceImage(sourceImage) .setRegion(region == null ? null : region.toString()) .setDiskResource(diskResource) .build(); @@ -573,37 +505,22 @@ public final Operation insertRegionDisk( * *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Disk diskResource = Disk.newBuilder().build();
-   *   Operation response = regionDiskClient.insertRegionDisk(requestId, sourceImage, region.toString(), diskResource);
+   *   Operation response = regionDiskClient.insertRegionDisk(region.toString(), diskResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). - * @param sourceImage Optional. Source image to restore onto a disk. * @param region Name of the region for this request. * @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks * ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRegionDisk( - String requestId, String sourceImage, String region, Disk diskResource) { + public final Operation insertRegionDisk(String region, Disk diskResource) { InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder() - .setRequestId(requestId) - .setSourceImage(sourceImage) .setRegion(region) .setDiskResource(diskResource) .build(); @@ -619,13 +536,9 @@ public final Operation insertRegionDisk( * *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Disk diskResource = Disk.newBuilder().build();
    *   InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
-   *     .setSourceImage(sourceImage)
    *     .setRegion(region.toString())
    *     .setDiskResource(diskResource)
    *     .build();
@@ -650,13 +563,9 @@ public final Operation insertRegionDisk(InsertRegionDiskHttpRequest request) {
    *
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
-   *   String requestId = "";
-   *   String sourceImage = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Disk diskResource = Disk.newBuilder().build();
    *   InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
-   *     .setSourceImage(sourceImage)
    *     .setRegion(region.toString())
    *     .setDiskResource(diskResource)
    *     .build();
@@ -816,35 +725,22 @@ public final UnaryCallable listRegionDisks
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
-   *   Operation response = regionDiskClient.resizeRegionDisk(disk, requestId, regionDisksResizeRequestResource);
+   *   Operation response = regionDiskClient.resizeRegionDisk(disk, regionDisksResizeRequestResource);
    * }
    * 
* * @param disk Name of the regional persistent disk. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param regionDisksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resizeRegionDisk( - ProjectRegionDiskName disk, - String requestId, - RegionDisksResizeRequest regionDisksResizeRequestResource) { + ProjectRegionDiskName disk, RegionDisksResizeRequest regionDisksResizeRequestResource) { ResizeRegionDiskHttpRequest request = ResizeRegionDiskHttpRequest.newBuilder() .setDisk(disk == null ? null : disk.toString()) - .setRequestId(requestId) .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource) .build(); return resizeRegionDisk(request); @@ -859,33 +755,22 @@ public final Operation resizeRegionDisk( *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
-   *   Operation response = regionDiskClient.resizeRegionDisk(disk.toString(), requestId, regionDisksResizeRequestResource);
+   *   Operation response = regionDiskClient.resizeRegionDisk(disk.toString(), regionDisksResizeRequestResource);
    * }
    * 
* * @param disk Name of the regional persistent disk. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param regionDisksResizeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resizeRegionDisk( - String disk, String requestId, RegionDisksResizeRequest regionDisksResizeRequestResource) { + String disk, RegionDisksResizeRequest regionDisksResizeRequestResource) { ResizeRegionDiskHttpRequest request = ResizeRegionDiskHttpRequest.newBuilder() .setDisk(disk) - .setRequestId(requestId) .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource) .build(); return resizeRegionDisk(request); @@ -900,11 +785,9 @@ public final Operation resizeRegionDisk( *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
    *   ResizeRegionDiskHttpRequest request = ResizeRegionDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource)
    *     .build();
    *   Operation response = regionDiskClient.resizeRegionDisk(request);
@@ -928,11 +811,9 @@ public final Operation resizeRegionDisk(ResizeRegionDiskHttpRequest request) {
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]");
-   *   String requestId = "";
    *   RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build();
    *   ResizeRegionDiskHttpRequest request = ResizeRegionDiskHttpRequest.newBuilder()
    *     .setDisk(disk.toString())
-   *     .setRequestId(requestId)
    *     .setRegionDisksResizeRequestResource(regionDisksResizeRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = regionDiskClient.resizeRegionDiskCallable().futureCall(request);
@@ -955,35 +836,23 @@ public final UnaryCallable resizeRegionD
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
-   *   String requestId = "";
    *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
-   *   Operation response = regionDiskClient.setLabelsRegionDisk(resource, requestId, regionSetLabelsRequestResource);
+   *   Operation response = regionDiskClient.setLabelsRegionDisk(resource, regionSetLabelsRequestResource);
    * }
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param regionSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setLabelsRegionDisk( ProjectRegionDiskResourceName resource, - String requestId, RegionSetLabelsRequest regionSetLabelsRequestResource) { SetLabelsRegionDiskHttpRequest request = SetLabelsRegionDiskHttpRequest.newBuilder() .setResource(resource == null ? null : resource.toString()) - .setRequestId(requestId) .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource) .build(); return setLabelsRegionDisk(request); @@ -998,33 +867,22 @@ public final Operation setLabelsRegionDisk( *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
-   *   String requestId = "";
    *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
-   *   Operation response = regionDiskClient.setLabelsRegionDisk(resource.toString(), requestId, regionSetLabelsRequestResource);
+   *   Operation response = regionDiskClient.setLabelsRegionDisk(resource.toString(), regionSetLabelsRequestResource);
    * }
    * 
* * @param resource Name of the resource for this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param regionSetLabelsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setLabelsRegionDisk( - String resource, String requestId, RegionSetLabelsRequest regionSetLabelsRequestResource) { + String resource, RegionSetLabelsRequest regionSetLabelsRequestResource) { SetLabelsRegionDiskHttpRequest request = SetLabelsRegionDiskHttpRequest.newBuilder() .setResource(resource) - .setRequestId(requestId) .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource) .build(); return setLabelsRegionDisk(request); @@ -1039,11 +897,9 @@ public final Operation setLabelsRegionDisk( *


    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
-   *   String requestId = "";
    *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
    *   SetLabelsRegionDiskHttpRequest request = SetLabelsRegionDiskHttpRequest.newBuilder()
    *     .setResource(resource.toString())
-   *     .setRequestId(requestId)
    *     .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource)
    *     .build();
    *   Operation response = regionDiskClient.setLabelsRegionDisk(request);
@@ -1067,11 +923,9 @@ public final Operation setLabelsRegionDisk(SetLabelsRegionDiskHttpRequest reques
    * 

    * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
    *   ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
-   *   String requestId = "";
    *   RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build();
    *   SetLabelsRegionDiskHttpRequest request = SetLabelsRegionDiskHttpRequest.newBuilder()
    *     .setResource(resource.toString())
-   *     .setRequestId(requestId)
    *     .setRegionSetLabelsRequestResource(regionSetLabelsRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = regionDiskClient.setLabelsRegionDiskCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java
index dc0c1fd48225..66d048d56ea9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RegionDiskTypeList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (DiskType item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java
index dc4137065890..55e1eaf40792 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private RegionDisksResizeRequest(String sizeGb) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("sizeGb") && sizeGb != null) {
-      fieldMap.put("sizeGb", Collections.singletonList(String.valueOf(sizeGb)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("sizeGb")) {
+      return sizeGb;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("sizeGb")) {
-      return String.valueOf(sizeGb);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java
index eb1b6df13847..5c4038ebd787 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java
@@ -572,35 +572,23 @@ public final ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionI
    *
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param regionInstanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setNamedPortsRegionInstanceGroup( - String requestId, ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup == null ? null : instanceGroup.toString()) .setRegionInstanceGroupsSetNamedPortsRequestResource( regionInstanceGroupsSetNamedPortsRequestResource) @@ -616,35 +604,23 @@ public final Operation setNamedPortsRegionInstanceGroup( * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(requestId, instanceGroup.toString(), regionInstanceGroupsSetNamedPortsRequestResource);
+   *   Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup.toString(), regionInstanceGroupsSetNamedPortsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroup The name of the regional instance group where the named ports are updated. * @param regionInstanceGroupsSetNamedPortsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setNamedPortsRegionInstanceGroup( - String requestId, String instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource) { SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroup(instanceGroup) .setRegionInstanceGroupsSetNamedPortsRequestResource( regionInstanceGroupsSetNamedPortsRequestResource) @@ -660,11 +636,9 @@ public final Operation setNamedPortsRegionInstanceGroup( * *


    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
    *     .build();
@@ -689,11 +663,9 @@ public final Operation setNamedPortsRegionInstanceGroup(
    *
    * 

    * try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
    *   RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
    *   SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroup(instanceGroup.toString())
    *     .setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java
index c32961fffa4e..b86404389c2c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RegionInstanceGroupList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceGroup item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
index 77e7949453cd..9ec4e4d39af4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java
@@ -42,10 +42,9 @@
  * 
  * 
  * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
- *   String requestId = "";
  *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
  *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
@@ -177,36 +176,24 @@ public RegionInstanceGroupManagerStub getStub() { * *

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation abandonInstancesRegionInstanceGroupManager( - String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setRegionInstanceGroupManagersAbandonInstancesRequestResource( @@ -235,36 +222,24 @@ public final Operation abandonInstancesRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersAbandonInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersAbandonInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersAbandonInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation abandonInstancesRegionInstanceGroupManager( - String requestId, String instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource) { AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setRegionInstanceGroupManagersAbandonInstancesRequestResource( regionInstanceGroupManagersAbandonInstancesRequestResource) @@ -292,11 +267,9 @@ public final Operation abandonInstancesRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -333,11 +306,9 @@ public final Operation abandonInstancesRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
    *   AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
    *     .build();
@@ -361,31 +332,20 @@ public final Operation abandonInstancesRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(requestId, instanceGroupManager);
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteRegionInstanceGroupManager( - String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { + ProjectRegionInstanceGroupManagerName instanceGroupManager) { DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .build(); @@ -400,31 +360,19 @@ public final Operation deleteRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(requestId, instanceGroupManager.toString());
+   *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRegionInstanceGroupManager( - String requestId, String instanceGroupManager) { + public final Operation deleteRegionInstanceGroupManager(String instanceGroupManager) { DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .build(); return deleteRegionInstanceGroupManager(request); @@ -438,10 +386,8 @@ public final Operation deleteRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(request);
@@ -465,10 +411,8 @@ public final Operation deleteRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManagerCallable().futureCall(request);
@@ -502,36 +446,24 @@ public final Operation deleteRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInstancesRegionInstanceGroupManager( - String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setRegionInstanceGroupManagersDeleteInstancesRequestResource( @@ -559,36 +491,24 @@ public final Operation deleteInstancesRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersDeleteInstancesRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersDeleteInstancesRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersDeleteInstancesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteInstancesRegionInstanceGroupManager( - String requestId, String instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource) { DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setRegionInstanceGroupManagersDeleteInstancesRequestResource( regionInstanceGroupManagersDeleteInstancesRequestResource) @@ -615,11 +535,9 @@ public final Operation deleteInstancesRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -655,11 +573,9 @@ public final Operation deleteInstancesRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
    *   DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
    *     .build();
@@ -792,22 +708,12 @@ public final InstanceGroupManager getRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource);
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region, instanceGroupManagerResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== @@ -817,13 +723,10 @@ public final InstanceGroupManager getRegionInstanceGroupManager( */ @BetaApi public final Operation insertRegionInstanceGroupManager( - String requestId, - ProjectRegionName region, - InstanceGroupManager instanceGroupManagerResource) { + ProjectRegionName region, InstanceGroupManager instanceGroupManagerResource) { InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setInstanceGroupManagerResource(instanceGroupManagerResource) .build(); @@ -844,22 +747,12 @@ public final Operation insertRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(requestId, region.toString(), instanceGroupManagerResource);
+   *   Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region.toString(), instanceGroupManagerResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== @@ -869,11 +762,10 @@ public final Operation insertRegionInstanceGroupManager( */ @BetaApi public final Operation insertRegionInstanceGroupManager( - String requestId, String region, InstanceGroupManager instanceGroupManagerResource) { + String region, InstanceGroupManager instanceGroupManagerResource) { InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setInstanceGroupManagerResource(instanceGroupManagerResource) .build(); @@ -894,11 +786,9 @@ public final Operation insertRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
@@ -929,11 +819,9 @@ public final Operation insertRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
    *   InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
    *     .build();
@@ -1221,36 +1109,24 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersRecreateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation recreateInstancesRegionInstanceGroupManager( - String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setRegionInstanceGroupManagersRecreateRequestResource( @@ -1277,36 +1153,24 @@ public final Operation recreateInstancesRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersRecreateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersRecreateRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersRecreateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation recreateInstancesRegionInstanceGroupManager( - String requestId, String instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource) { RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setRegionInstanceGroupManagersRecreateRequestResource( regionInstanceGroupManagersRecreateRequestResource) @@ -1332,11 +1196,9 @@ public final Operation recreateInstancesRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
    *   RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
    *     .build();
@@ -1371,11 +1233,9 @@ public final Operation recreateInstancesRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
    *   RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
    *     .build();
@@ -1409,33 +1269,22 @@ public final Operation recreateInstancesRegionInstanceGroupManager(
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager);
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager);
    * }
    * 
* * @param size Number of instances that should exist in this instance group manager. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resizeRegionInstanceGroupManager( - Integer size, String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager) { + Integer size, ProjectRegionInstanceGroupManagerName instanceGroupManager) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() .setSize(size) - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .build(); @@ -1460,33 +1309,22 @@ public final Operation resizeRegionInstanceGroupManager( *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
-   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager.toString());
+   *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager.toString());
    * }
    * 
* * @param size Number of instances that should exist in this instance group manager. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation resizeRegionInstanceGroupManager( - Integer size, String requestId, String instanceGroupManager) { + Integer size, String instanceGroupManager) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder() .setSize(size) - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .build(); return resizeRegionInstanceGroupManager(request); @@ -1510,11 +1348,9 @@ public final Operation resizeRegionInstanceGroupManager( *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(request);
@@ -1548,11 +1384,9 @@ public final Operation resizeRegionInstanceGroupManager(
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
    *   Integer size = 0;
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
    *     .setSize(size)
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .build();
    *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManagerCallable().futureCall(request);
@@ -1576,36 +1410,24 @@ public final Operation resizeRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param regionInstanceGroupManagersSetTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setInstanceTemplateRegionInstanceGroupManager( - String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setRegionInstanceGroupManagersSetTemplateRequestResource( @@ -1623,36 +1445,24 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersSetTemplateRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTemplateRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager The name of the managed instance group. * @param regionInstanceGroupManagersSetTemplateRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setInstanceTemplateRegionInstanceGroupManager( - String requestId, String instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource) { SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setRegionInstanceGroupManagersSetTemplateRequestResource( regionInstanceGroupManagersSetTemplateRequestResource) @@ -1669,11 +1479,9 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
    *     .build();
@@ -1699,11 +1507,9 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
    *   SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
    *     .build();
@@ -1728,36 +1534,24 @@ public final Operation setInstanceTemplateRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetPoolsRegionInstanceGroupManager( - String requestId, ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager( instanceGroupManager == null ? null : instanceGroupManager.toString()) .setRegionInstanceGroupManagersSetTargetPoolsRequestResource( @@ -1775,36 +1569,24 @@ public final Operation setTargetPoolsRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
-   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(requestId, instanceGroupManager.toString(), regionInstanceGroupManagersSetTargetPoolsRequestResource);
+   *   Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTargetPoolsRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param instanceGroupManager Name of the managed instance group. * @param regionInstanceGroupManagersSetTargetPoolsRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setTargetPoolsRegionInstanceGroupManager( - String requestId, String instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource) { SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder() - .setRequestId(requestId) .setInstanceGroupManager(instanceGroupManager) .setRegionInstanceGroupManagersSetTargetPoolsRequestResource( regionInstanceGroupManagersSetTargetPoolsRequestResource) @@ -1821,11 +1603,9 @@ public final Operation setTargetPoolsRegionInstanceGroupManager( * *


    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
@@ -1851,11 +1631,9 @@ public final Operation setTargetPoolsRegionInstanceGroupManager(
    *
    * 

    * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
    *   RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
    *   SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setInstanceGroupManager(instanceGroupManager.toString())
    *     .setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java
index f1f09b5f5466..861020ed21e7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RegionInstanceGroupManagerList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceGroupManager item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java
index 3327c7ebb786..87956be472c0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private RegionInstanceGroupManagersAbandonInstancesRequest(List instance
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java
index 9474e8998620..a4b32543c022 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private RegionInstanceGroupManagersDeleteInstancesRequest(List instances
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java
index e02308bfa2fe..4ae23bf6b182 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private RegionInstanceGroupManagersListInstancesResponse(List m
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("managedInstances") && managedInstances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (ManagedInstance item : managedInstances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("managedInstances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("managedInstances")) {
+      return managedInstances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("managedInstances")) {
-      return String.valueOf(managedInstances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java
index 36663c265597..ba1241f5c9ea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private RegionInstanceGroupManagersRecreateRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java
index 937044c58ce1..e855cb402ec3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,28 +41,12 @@ private RegionInstanceGroupManagersSetTargetPoolsRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("targetPools") && targetPools != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : targetPools) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetPools", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("targetPools")) {
-      return String.valueOf(targetPools);
+      return targetPools;
     }
     return null;
   }
@@ -78,6 +57,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getFingerprint() {
     return fingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java
index c4e23696134a..5529a711192c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private RegionInstanceGroupManagersSetTemplateRequest(String instanceTemplate) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instanceTemplate") && instanceTemplate != null) {
-      fieldMap.put("instanceTemplate", Collections.singletonList(String.valueOf(instanceTemplate)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instanceTemplate")) {
+      return instanceTemplate;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instanceTemplate")) {
-      return String.valueOf(instanceTemplate);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java
index 59f1430cc6c7..e97ad0a481a8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RegionInstanceGroupsListInstances(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceWithNamedPorts item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java
index d6bfddceb997..fa62768f170b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private RegionInstanceGroupsListInstancesRequest(String instanceState, String po
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instanceState") && instanceState != null) {
-      fieldMap.put("instanceState", Collections.singletonList(String.valueOf(instanceState)));
-    }
-    if (fieldNames.contains("portName") && portName != null) {
-      fieldMap.put("portName", Collections.singletonList(String.valueOf(portName)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("instanceState")) {
-      return String.valueOf(instanceState);
+      return instanceState;
     }
     if (fieldName.equals("portName")) {
-      return String.valueOf(portName);
+      return portName;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getInstanceState() {
     return instanceState;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java
index 5f66c8f0a730..8e609e19ef37 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private RegionInstanceGroupsSetNamedPortsRequest(String fingerprint, List> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("namedPorts") && namedPorts != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (NamedPort item : namedPorts) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("namedPorts", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("namedPorts")) {
-      return String.valueOf(namedPorts);
+      return namedPorts;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getFingerprint() {
     return fingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java
index a29b6a2d91c1..083b4ad7f70b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RegionList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Region item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java
index 565f1de73102..d1e38298e6a9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +40,12 @@ private RegionSetLabelsRequest(String labelFingerprint, Map labe
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     return null;
   }
@@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getLabelFingerprint() {
     return labelFingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java
index e95afb751c71..9e372429acbd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private RemoveHealthCheckTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetPool") && targetPool != null) {
-      fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
-    }
-    if (fieldNames.contains("targetPoolsRemoveHealthCheckRequestResource")
-        && targetPoolsRemoveHealthCheckRequestResource != null) {
-      fieldMap.put(
-          "targetPoolsRemoveHealthCheckRequestResource",
-          Collections.singletonList(String.valueOf(targetPoolsRemoveHealthCheckRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetPool")) {
-      return String.valueOf(targetPool);
+      return targetPool;
     }
     if (fieldName.equals("targetPoolsRemoveHealthCheckRequestResource")) {
-      return String.valueOf(targetPoolsRemoveHealthCheckRequestResource);
+      return targetPoolsRemoveHealthCheckRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public TargetPoolsRemoveHealthCheckRequest getApiMessageRequestBody() {
     return targetPoolsRemoveHealthCheckRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java
index c9c60f1d8c0b..6459033db189 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private RemoveInstanceTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetPool") && targetPool != null) {
-      fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
-    }
-    if (fieldNames.contains("targetPoolsRemoveInstanceRequestResource")
-        && targetPoolsRemoveInstanceRequestResource != null) {
-      fieldMap.put(
-          "targetPoolsRemoveInstanceRequestResource",
-          Collections.singletonList(String.valueOf(targetPoolsRemoveInstanceRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetPool")) {
-      return String.valueOf(targetPool);
+      return targetPool;
     }
     if (fieldName.equals("targetPoolsRemoveInstanceRequestResource")) {
-      return String.valueOf(targetPoolsRemoveInstanceRequestResource);
+      return targetPoolsRemoveInstanceRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public TargetPoolsRemoveInstanceRequest getApiMessageRequestBody() {
     return targetPoolsRemoveInstanceRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java
index 3381247f4eea..a997c78245e8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -78,75 +74,36 @@ private RemoveInstancesInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("instanceGroupsRemoveInstancesRequestResource")
-        && instanceGroupsRemoveInstancesRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupsRemoveInstancesRequestResource",
-          Collections.singletonList(String.valueOf(instanceGroupsRemoveInstancesRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("instanceGroupsRemoveInstancesRequestResource")) {
-      return String.valueOf(instanceGroupsRemoveInstancesRequestResource);
+      return instanceGroupsRemoveInstancesRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -157,6 +114,12 @@ public InstanceGroupsRemoveInstancesRequest getApiMessageRequestBody() {
     return instanceGroupsRemoveInstancesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java
index 0416828b172e..8bd762d6c23d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private RemovePeeringNetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("networksRemovePeeringRequestResource")
-        && networksRemovePeeringRequestResource != null) {
-      fieldMap.put(
-          "networksRemovePeeringRequestResource",
-          Collections.singletonList(String.valueOf(networksRemovePeeringRequestResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("networksRemovePeeringRequestResource")) {
-      return String.valueOf(networksRemovePeeringRequestResource);
+      return networksRemovePeeringRequestResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public NetworksRemovePeeringRequest getApiMessageRequestBody() {
     return networksRemovePeeringRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java
index f18510819b7f..426b99a4e8ae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private ResetInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java
index 46fe780a669e..7231c0b99131 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private ResizeDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("disksResizeRequestResource") && disksResizeRequestResource != null) {
-      fieldMap.put(
-          "disksResizeRequestResource",
-          Collections.singletonList(String.valueOf(disksResizeRequestResource)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("disksResizeRequestResource")) {
-      return String.valueOf(disksResizeRequestResource);
+      return disksResizeRequestResource;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public DisksResizeRequest getApiMessageRequestBody() {
     return disksResizeRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java
index 96e9ecdbcdf8..9fd2f0fbdd49 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private ResizeInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("size") && size != null) {
-      fieldMap.put("size", Collections.singletonList(String.valueOf(size)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("size")) {
-      return String.valueOf(size);
+      return size;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java
index 809e47384582..53c6d1937ea7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private ResizeRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("disk") && disk != null) {
-      fieldMap.put("disk", Collections.singletonList(String.valueOf(disk)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionDisksResizeRequestResource")
-        && regionDisksResizeRequestResource != null) {
-      fieldMap.put(
-          "regionDisksResizeRequestResource",
-          Collections.singletonList(String.valueOf(regionDisksResizeRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("disk")) {
-      return String.valueOf(disk);
+      return disk;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionDisksResizeRequestResource")) {
-      return String.valueOf(regionDisksResizeRequestResource);
+      return regionDisksResizeRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public RegionDisksResizeRequest getApiMessageRequestBody() {
     return regionDisksResizeRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java
index 867324d35a91..9ad8bcb64ff6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private ResizeRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("size") && size != null) {
-      fieldMap.put("size", Collections.singletonList(String.valueOf(size)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("size")) {
-      return String.valueOf(size);
+      return size;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java
index 32d6d8680d97..c48fcbb28ff5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private ResourceCommitment(String amount, String type) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("amount") && amount != null) {
-      fieldMap.put("amount", Collections.singletonList(String.valueOf(amount)));
-    }
-    if (fieldNames.contains("type") && type != null) {
-      fieldMap.put("type", Collections.singletonList(String.valueOf(type)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("amount")) {
-      return String.valueOf(amount);
+      return amount;
     }
     if (fieldName.equals("type")) {
-      return String.valueOf(type);
+      return type;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAmount() {
     return amount;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java
index c0af2934011c..5b6876d4274b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private ResourceGroupReference(String group) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("group") && group != null) {
-      fieldMap.put("group", Collections.singletonList(String.valueOf(group)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("group")) {
+      return group;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("group")) {
-      return String.valueOf(group);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java
index c98eb0299c8a..5787127134b3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -107,123 +102,57 @@ private Route(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("destRange") && destRange != null) {
-      fieldMap.put("destRange", Collections.singletonList(String.valueOf(destRange)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("nextHopGateway") && nextHopGateway != null) {
-      fieldMap.put("nextHopGateway", Collections.singletonList(String.valueOf(nextHopGateway)));
-    }
-    if (fieldNames.contains("nextHopInstance") && nextHopInstance != null) {
-      fieldMap.put("nextHopInstance", Collections.singletonList(String.valueOf(nextHopInstance)));
-    }
-    if (fieldNames.contains("nextHopIp") && nextHopIp != null) {
-      fieldMap.put("nextHopIp", Collections.singletonList(String.valueOf(nextHopIp)));
-    }
-    if (fieldNames.contains("nextHopNetwork") && nextHopNetwork != null) {
-      fieldMap.put("nextHopNetwork", Collections.singletonList(String.valueOf(nextHopNetwork)));
-    }
-    if (fieldNames.contains("nextHopPeering") && nextHopPeering != null) {
-      fieldMap.put("nextHopPeering", Collections.singletonList(String.valueOf(nextHopPeering)));
-    }
-    if (fieldNames.contains("nextHopVpnTunnel") && nextHopVpnTunnel != null) {
-      fieldMap.put("nextHopVpnTunnel", Collections.singletonList(String.valueOf(nextHopVpnTunnel)));
-    }
-    if (fieldNames.contains("priority") && priority != null) {
-      fieldMap.put("priority", Collections.singletonList(String.valueOf(priority)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("tags") && tags != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : tags) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("tags", stringList.build());
-    }
-    if (fieldNames.contains("warnings") && warnings != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Warnings item : warnings) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("warnings", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("destRange")) {
-      return String.valueOf(destRange);
+      return destRange;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("nextHopGateway")) {
-      return String.valueOf(nextHopGateway);
+      return nextHopGateway;
     }
     if (fieldName.equals("nextHopInstance")) {
-      return String.valueOf(nextHopInstance);
+      return nextHopInstance;
     }
     if (fieldName.equals("nextHopIp")) {
-      return String.valueOf(nextHopIp);
+      return nextHopIp;
     }
     if (fieldName.equals("nextHopNetwork")) {
-      return String.valueOf(nextHopNetwork);
+      return nextHopNetwork;
     }
     if (fieldName.equals("nextHopPeering")) {
-      return String.valueOf(nextHopPeering);
+      return nextHopPeering;
     }
     if (fieldName.equals("nextHopVpnTunnel")) {
-      return String.valueOf(nextHopVpnTunnel);
+      return nextHopVpnTunnel;
     }
     if (fieldName.equals("priority")) {
-      return String.valueOf(priority);
+      return priority;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("tags")) {
-      return String.valueOf(tags);
+      return tags;
     }
     if (fieldName.equals("warnings")) {
-      return String.valueOf(warnings);
+      return warnings;
     }
     return null;
   }
@@ -234,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java
index a9459f8879af..c59904facdae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java
@@ -43,8 +43,7 @@
  * 
  * try (RouteClient routeClient = RouteClient.create()) {
  *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
- *   String requestId = "";
- *   Operation response = routeClient.deleteRoute(route, requestId);
+ *   Operation response = routeClient.deleteRoute(route);
  * }
  * 
  * 
@@ -160,30 +159,19 @@ public RouteStub getStub() { *

    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
-   *   String requestId = "";
-   *   Operation response = routeClient.deleteRoute(route, requestId);
+   *   Operation response = routeClient.deleteRoute(route);
    * }
    * 
* * @param route Name of the Route resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRoute(ProjectGlobalRouteName route, String requestId) { + public final Operation deleteRoute(ProjectGlobalRouteName route) { DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder() .setRoute(route == null ? null : route.toString()) - .setRequestId(requestId) .build(); return deleteRoute(request); } @@ -197,28 +185,17 @@ public final Operation deleteRoute(ProjectGlobalRouteName route, String requestI *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
-   *   String requestId = "";
-   *   Operation response = routeClient.deleteRoute(route.toString(), requestId);
+   *   Operation response = routeClient.deleteRoute(route.toString());
    * }
    * 
* * @param route Name of the Route resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRoute(String route, String requestId) { + public final Operation deleteRoute(String route) { - DeleteRouteHttpRequest request = - DeleteRouteHttpRequest.newBuilder().setRoute(route).setRequestId(requestId).build(); + DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder().setRoute(route).build(); return deleteRoute(request); } @@ -231,10 +208,8 @@ public final Operation deleteRoute(String route, String requestId) { *


    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
-   *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = routeClient.deleteRoute(request);
    * }
@@ -257,10 +232,8 @@ public final Operation deleteRoute(DeleteRouteHttpRequest request) {
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
    *   ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]");
-   *   String requestId = "";
    *   DeleteRouteHttpRequest request = DeleteRouteHttpRequest.newBuilder()
    *     .setRoute(route.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = routeClient.deleteRouteCallable().futureCall(request);
    *   // Do something
@@ -379,22 +352,12 @@ public final UnaryCallable getRouteCallable() {
    *
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
-   *   Operation response = routeClient.insertRoute(requestId, project, routeResource);
+   *   Operation response = routeClient.insertRoute(project, routeResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param routeResource Represents a Route resource. A route specifies how certain packets should * be handled by the network. Routes are associated with instances by tags and the set of @@ -412,11 +375,10 @@ public final UnaryCallable getRouteCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRoute(String requestId, ProjectName project, Route routeResource) { + public final Operation insertRoute(ProjectName project, Route routeResource) { InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setRouteResource(routeResource) .build(); @@ -431,22 +393,12 @@ public final Operation insertRoute(String requestId, ProjectName project, Route * *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
-   *   Operation response = routeClient.insertRoute(requestId, project.toString(), routeResource);
+   *   Operation response = routeClient.insertRoute(project.toString(), routeResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param routeResource Represents a Route resource. A route specifies how certain packets should * be handled by the network. Routes are associated with instances by tags and the set of @@ -464,11 +416,10 @@ public final Operation insertRoute(String requestId, ProjectName project, Route * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRoute(String requestId, String project, Route routeResource) { + public final Operation insertRoute(String project, Route routeResource) { InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setRouteResource(routeResource) .build(); @@ -483,11 +434,9 @@ public final Operation insertRoute(String requestId, String project, Route route * *


    * try (RouteClient routeClient = RouteClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
    *   InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setRouteResource(routeResource)
    *     .build();
@@ -511,11 +460,9 @@ public final Operation insertRoute(InsertRouteHttpRequest request) {
    *
    * 

    * try (RouteClient routeClient = RouteClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   Route routeResource = Route.newBuilder().build();
    *   InsertRouteHttpRequest request = InsertRouteHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setRouteResource(routeResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
index 82cdccf0d624..49dadda25cc1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RouteList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Route item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java
index e97c03183b29..a4f548b9a72a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -83,87 +78,39 @@ private Router(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("bgp") && bgp != null) {
-      fieldMap.put("bgp", Collections.singletonList(String.valueOf(bgp)));
-    }
-    if (fieldNames.contains("bgpPeers") && bgpPeers != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (RouterBgpPeer item : bgpPeers) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("bgpPeers", stringList.build());
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("interfaces") && interfaces != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (RouterInterface item : interfaces) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("interfaces", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("bgp")) {
-      return String.valueOf(bgp);
+      return bgp;
     }
     if (fieldName.equals("bgpPeers")) {
-      return String.valueOf(bgpPeers);
+      return bgpPeers;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("interfaces")) {
-      return String.valueOf(interfaces);
+      return interfaces;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -174,6 +121,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public RouterBgp getBgp() {
     return bgp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java
index d740b89abec4..993cfe8968f3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private RouterAdvertisedIpRange(String description, String range) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("range") && range != null) {
-      fieldMap.put("range", Collections.singletonList(String.valueOf(range)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("range")) {
-      return String.valueOf(range);
+      return range;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDescription() {
     return description;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java
index cff265feafde..dc85b2cc9a5c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private RouterAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java
index 0aebfe3071b5..bedca25c58d3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -55,44 +50,18 @@ private RouterBgp(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("advertiseMode") && advertiseMode != null) {
-      fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode)));
-    }
-    if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : advertisedGroups) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("advertisedGroups", stringList.build());
-    }
-    if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (RouterAdvertisedIpRange item : advertisedIpRanges) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("advertisedIpRanges", stringList.build());
-    }
-    if (fieldNames.contains("asn") && asn != null) {
-      fieldMap.put("asn", Collections.singletonList(String.valueOf(asn)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("advertiseMode")) {
-      return String.valueOf(advertiseMode);
+      return advertiseMode;
     }
     if (fieldName.equals("advertisedGroups")) {
-      return String.valueOf(advertisedGroups);
+      return advertisedGroups;
     }
     if (fieldName.equals("advertisedIpRanges")) {
-      return String.valueOf(advertisedIpRanges);
+      return advertisedIpRanges;
     }
     if (fieldName.equals("asn")) {
-      return String.valueOf(asn);
+      return asn;
     }
     return null;
   }
@@ -103,6 +72,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAdvertiseMode() {
     return advertiseMode;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java
index 2520f0b75206..1667284e364c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -75,76 +70,33 @@ private RouterBgpPeer(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("advertiseMode") && advertiseMode != null) {
-      fieldMap.put("advertiseMode", Collections.singletonList(String.valueOf(advertiseMode)));
-    }
-    if (fieldNames.contains("advertisedGroups") && advertisedGroups != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : advertisedGroups) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("advertisedGroups", stringList.build());
-    }
-    if (fieldNames.contains("advertisedIpRanges") && advertisedIpRanges != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (RouterAdvertisedIpRange item : advertisedIpRanges) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("advertisedIpRanges", stringList.build());
-    }
-    if (fieldNames.contains("advertisedRoutePriority") && advertisedRoutePriority != null) {
-      fieldMap.put(
-          "advertisedRoutePriority",
-          Collections.singletonList(String.valueOf(advertisedRoutePriority)));
-    }
-    if (fieldNames.contains("interfaceName") && interfaceName != null) {
-      fieldMap.put("interfaceName", Collections.singletonList(String.valueOf(interfaceName)));
-    }
-    if (fieldNames.contains("ipAddress") && ipAddress != null) {
-      fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("peerAsn") && peerAsn != null) {
-      fieldMap.put("peerAsn", Collections.singletonList(String.valueOf(peerAsn)));
-    }
-    if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) {
-      fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("advertiseMode")) {
-      return String.valueOf(advertiseMode);
+      return advertiseMode;
     }
     if (fieldName.equals("advertisedGroups")) {
-      return String.valueOf(advertisedGroups);
+      return advertisedGroups;
     }
     if (fieldName.equals("advertisedIpRanges")) {
-      return String.valueOf(advertisedIpRanges);
+      return advertisedIpRanges;
     }
     if (fieldName.equals("advertisedRoutePriority")) {
-      return String.valueOf(advertisedRoutePriority);
+      return advertisedRoutePriority;
     }
     if (fieldName.equals("interfaceName")) {
-      return String.valueOf(interfaceName);
+      return interfaceName;
     }
     if (fieldName.equals("ipAddress")) {
-      return String.valueOf(ipAddress);
+      return ipAddress;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("peerAsn")) {
-      return String.valueOf(peerAsn);
+      return peerAsn;
     }
     if (fieldName.equals("peerIpAddress")) {
-      return String.valueOf(peerIpAddress);
+      return peerIpAddress;
     }
     return null;
   }
@@ -155,6 +107,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAdvertiseMode() {
     return advertiseMode;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
index 8bab4d9e0202..5b7b27180607 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java
@@ -43,8 +43,7 @@
  * 
  * try (RouterClient routerClient = RouterClient.create()) {
  *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
- *   String requestId = "";
- *   Operation response = routerClient.deleteRouter(router, requestId);
+ *   Operation response = routerClient.deleteRouter(router);
  * }
  * 
  * 
@@ -298,30 +297,19 @@ public final AggregatedListRoutersPagedResponse aggregatedListRouters( *

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
-   *   Operation response = routerClient.deleteRouter(router, requestId);
+   *   Operation response = routerClient.deleteRouter(router);
    * }
    * 
* * @param router Name of the Router resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRouter(ProjectRegionRouterName router, String requestId) { + public final Operation deleteRouter(ProjectRegionRouterName router) { DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder() .setRouter(router == null ? null : router.toString()) - .setRequestId(requestId) .build(); return deleteRouter(request); } @@ -335,28 +323,18 @@ public final Operation deleteRouter(ProjectRegionRouterName router, String reque *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
-   *   Operation response = routerClient.deleteRouter(router.toString(), requestId);
+   *   Operation response = routerClient.deleteRouter(router.toString());
    * }
    * 
* * @param router Name of the Router resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteRouter(String router, String requestId) { + public final Operation deleteRouter(String router) { DeleteRouterHttpRequest request = - DeleteRouterHttpRequest.newBuilder().setRouter(router).setRequestId(requestId).build(); + DeleteRouterHttpRequest.newBuilder().setRouter(router).build(); return deleteRouter(request); } @@ -369,10 +347,8 @@ public final Operation deleteRouter(String router, String requestId) { *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = routerClient.deleteRouter(request);
    * }
@@ -395,10 +371,8 @@ public final Operation deleteRouter(DeleteRouterHttpRequest request) {
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   DeleteRouterHttpRequest request = DeleteRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = routerClient.deleteRouterCallable().futureCall(request);
    *   // Do something
@@ -619,33 +593,21 @@ public final RouterStatusResponse getRouterStatusRouter(
    *
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.insertRouter(requestId, region, routerResource);
+   *   Operation response = routerClient.insertRouter(region, routerResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRouter( - String requestId, ProjectRegionName region, Router routerResource) { + public final Operation insertRouter(ProjectRegionName region, Router routerResource) { InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setRouterResource(routerResource) .build(); @@ -661,32 +623,21 @@ public final Operation insertRouter( * *


    * try (RouterClient routerClient = RouterClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.insertRouter(requestId, region.toString(), routerResource);
+   *   Operation response = routerClient.insertRouter(region.toString(), routerResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertRouter(String requestId, String region, Router routerResource) { + public final Operation insertRouter(String region, Router routerResource) { InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setRouterResource(routerResource) .build(); @@ -702,11 +653,9 @@ public final Operation insertRouter(String requestId, String region, Router rout * *


    * try (RouterClient routerClient = RouterClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setRouterResource(routerResource)
    *     .build();
@@ -731,11 +680,9 @@ public final Operation insertRouter(InsertRouterHttpRequest request) {
    *
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Router routerResource = Router.newBuilder().build();
    *   InsertRouterHttpRequest request = InsertRouterHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setRouterResource(routerResource)
    *     .build();
@@ -895,33 +842,21 @@ public final UnaryCallable listRoutersCallab
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.patchRouter(router, requestId, routerResource);
+   *   Operation response = routerClient.patchRouter(router, routerResource);
    * }
    * 
* * @param router Name of the Router resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRouter( - ProjectRegionRouterName router, String requestId, Router routerResource) { + public final Operation patchRouter(ProjectRegionRouterName router, Router routerResource) { PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder() .setRouter(router == null ? null : router.toString()) - .setRequestId(requestId) .setRouterResource(routerResource) .build(); return patchRouter(request); @@ -937,32 +872,21 @@ public final Operation patchRouter( *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.patchRouter(router.toString(), requestId, routerResource);
+   *   Operation response = routerClient.patchRouter(router.toString(), routerResource);
    * }
    * 
* * @param router Name of the Router resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchRouter(String router, String requestId, Router routerResource) { + public final Operation patchRouter(String router, Router routerResource) { PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder() .setRouter(router) - .setRequestId(requestId) .setRouterResource(routerResource) .build(); return patchRouter(request); @@ -978,11 +902,9 @@ public final Operation patchRouter(String router, String requestId, Router route *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
-   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   Operation response = routerClient.patchRouter(request);
@@ -1007,11 +929,9 @@ public final Operation patchRouter(PatchRouterHttpRequest request) {
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   PatchRouterHttpRequest request = PatchRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
-   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   ApiFuture<Operation> future = routerClient.patchRouterCallable().futureCall(request);
@@ -1149,33 +1069,21 @@ public final RoutersPreviewResponse previewRouter(PreviewRouterHttpRequest reque
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.updateRouter(router, requestId, routerResource);
+   *   Operation response = routerClient.updateRouter(router, routerResource);
    * }
    * 
* * @param router Name of the Router resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRouter( - ProjectRegionRouterName router, String requestId, Router routerResource) { + public final Operation updateRouter(ProjectRegionRouterName router, Router routerResource) { UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder() .setRouter(router == null ? null : router.toString()) - .setRequestId(requestId) .setRouterResource(routerResource) .build(); return updateRouter(request); @@ -1190,32 +1098,21 @@ public final Operation updateRouter( *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
-   *   Operation response = routerClient.updateRouter(router.toString(), requestId, routerResource);
+   *   Operation response = routerClient.updateRouter(router.toString(), routerResource);
    * }
    * 
* * @param router Name of the Router resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param routerResource Router resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateRouter(String router, String requestId, Router routerResource) { + public final Operation updateRouter(String router, Router routerResource) { UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder() .setRouter(router) - .setRequestId(requestId) .setRouterResource(routerResource) .build(); return updateRouter(request); @@ -1230,11 +1127,9 @@ public final Operation updateRouter(String router, String requestId, Router rout *


    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
-   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   Operation response = routerClient.updateRouter(request);
@@ -1258,11 +1153,9 @@ public final Operation updateRouter(UpdateRouterHttpRequest request) {
    * 

    * try (RouterClient routerClient = RouterClient.create()) {
    *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
-   *   String requestId = "";
    *   Router routerResource = Router.newBuilder().build();
    *   UpdateRouterHttpRequest request = UpdateRouterHttpRequest.newBuilder()
    *     .setRouter(router.toString())
-   *     .setRequestId(requestId)
    *     .setRouterResource(routerResource)
    *     .build();
    *   ApiFuture<Operation> future = routerClient.updateRouterCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
index 2685c57f2a0a..90b406d53037 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -50,39 +46,18 @@ private RouterInterface(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("ipRange") && ipRange != null) {
-      fieldMap.put("ipRange", Collections.singletonList(String.valueOf(ipRange)));
-    }
-    if (fieldNames.contains("linkedInterconnectAttachment")
-        && linkedInterconnectAttachment != null) {
-      fieldMap.put(
-          "linkedInterconnectAttachment",
-          Collections.singletonList(String.valueOf(linkedInterconnectAttachment)));
-    }
-    if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) {
-      fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("ipRange")) {
-      return String.valueOf(ipRange);
+      return ipRange;
     }
     if (fieldName.equals("linkedInterconnectAttachment")) {
-      return String.valueOf(linkedInterconnectAttachment);
+      return linkedInterconnectAttachment;
     }
     if (fieldName.equals("linkedVpnTunnel")) {
-      return String.valueOf(linkedVpnTunnel);
+      return linkedVpnTunnel;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     return null;
   }
@@ -93,6 +68,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getIpRange() {
     return ipRange;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
index 6a1c16d705b5..cc8bd25b138d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private RouterList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Router item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java
index 87cb1f3d6c20..ed6892ffe4aa 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -55,48 +50,18 @@ private RouterStatus(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("bestRoutes") && bestRoutes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Route item : bestRoutes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("bestRoutes", stringList.build());
-    }
-    if (fieldNames.contains("bestRoutesForRouter") && bestRoutesForRouter != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Route item : bestRoutesForRouter) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("bestRoutesForRouter", stringList.build());
-    }
-    if (fieldNames.contains("bgpPeerStatus") && bgpPeerStatus != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (RouterStatusBgpPeerStatus item : bgpPeerStatus) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("bgpPeerStatus", stringList.build());
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("bestRoutes")) {
-      return String.valueOf(bestRoutes);
+      return bestRoutes;
     }
     if (fieldName.equals("bestRoutesForRouter")) {
-      return String.valueOf(bestRoutesForRouter);
+      return bestRoutesForRouter;
     }
     if (fieldName.equals("bgpPeerStatus")) {
-      return String.valueOf(bgpPeerStatus);
+      return bgpPeerStatus;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     return null;
   }
@@ -107,6 +72,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getBestRoutesList() {
     return bestRoutes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java
index abf4198ec76f..19e08605fdb3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +74,36 @@ private RouterStatusBgpPeerStatus(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("advertisedRoutes") && advertisedRoutes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Route item : advertisedRoutes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("advertisedRoutes", stringList.build());
-    }
-    if (fieldNames.contains("ipAddress") && ipAddress != null) {
-      fieldMap.put("ipAddress", Collections.singletonList(String.valueOf(ipAddress)));
-    }
-    if (fieldNames.contains("linkedVpnTunnel") && linkedVpnTunnel != null) {
-      fieldMap.put("linkedVpnTunnel", Collections.singletonList(String.valueOf(linkedVpnTunnel)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("numLearnedRoutes") && numLearnedRoutes != null) {
-      fieldMap.put("numLearnedRoutes", Collections.singletonList(String.valueOf(numLearnedRoutes)));
-    }
-    if (fieldNames.contains("peerIpAddress") && peerIpAddress != null) {
-      fieldMap.put("peerIpAddress", Collections.singletonList(String.valueOf(peerIpAddress)));
-    }
-    if (fieldNames.contains("state") && state != null) {
-      fieldMap.put("state", Collections.singletonList(String.valueOf(state)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("uptime") && uptime != null) {
-      fieldMap.put("uptime", Collections.singletonList(String.valueOf(uptime)));
-    }
-    if (fieldNames.contains("uptimeSeconds") && uptimeSeconds != null) {
-      fieldMap.put("uptimeSeconds", Collections.singletonList(String.valueOf(uptimeSeconds)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("advertisedRoutes")) {
-      return String.valueOf(advertisedRoutes);
+      return advertisedRoutes;
     }
     if (fieldName.equals("ipAddress")) {
-      return String.valueOf(ipAddress);
+      return ipAddress;
     }
     if (fieldName.equals("linkedVpnTunnel")) {
-      return String.valueOf(linkedVpnTunnel);
+      return linkedVpnTunnel;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("numLearnedRoutes")) {
-      return String.valueOf(numLearnedRoutes);
+      return numLearnedRoutes;
     }
     if (fieldName.equals("peerIpAddress")) {
-      return String.valueOf(peerIpAddress);
+      return peerIpAddress;
     }
     if (fieldName.equals("state")) {
-      return String.valueOf(state);
+      return state;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("uptime")) {
-      return String.valueOf(uptime);
+      return uptime;
     }
     if (fieldName.equals("uptimeSeconds")) {
-      return String.valueOf(uptimeSeconds);
+      return uptimeSeconds;
     }
     return null;
   }
@@ -159,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getAdvertisedRoutesList() {
     return advertisedRoutes;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java
index b00558dd3b1f..270f2fe8ff9d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private RouterStatusResponse(String kind, RouterStatus result) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("result") && result != null) {
-      fieldMap.put("result", Collections.singletonList(String.valueOf(result)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("result")) {
-      return String.valueOf(result);
+      return result;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getKind() {
     return kind;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java
index c1311f4462c0..cfe2dec432e7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private RoutersPreviewResponse(Router resource) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("resource")) {
+      return resource;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java
index 77858274e19e..2b101ef397ac 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private RoutersScopedList(List routers, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("routers") && routers != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Router item : routers) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("routers", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("routers")) {
-      return String.valueOf(routers);
+      return routers;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getRoutersList() {
     return routers;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java
index cf70e23f88da..608db5cc07ce 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private SSLHealthCheck(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("portName") && portName != null) {
-      fieldMap.put("portName", Collections.singletonList(String.valueOf(portName)));
-    }
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
-    }
-    if (fieldNames.contains("request") && request != null) {
-      fieldMap.put("request", Collections.singletonList(String.valueOf(request)));
-    }
-    if (fieldNames.contains("response") && response != null) {
-      fieldMap.put("response", Collections.singletonList(String.valueOf(response)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("portName")) {
-      return String.valueOf(portName);
+      return portName;
     }
     if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
+      return proxyHeader;
     }
     if (fieldName.equals("request")) {
-      return String.valueOf(request);
+      return request;
     }
     if (fieldName.equals("response")) {
-      return String.valueOf(response);
+      return response;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getPort() {
     return port;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java
index b6dede48f68e..9b44ee823a01 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -46,31 +42,15 @@ private Scheduling(Boolean automaticRestart, String onHostMaintenance, Boolean p
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("automaticRestart") && automaticRestart != null) {
-      fieldMap.put("automaticRestart", Collections.singletonList(String.valueOf(automaticRestart)));
-    }
-    if (fieldNames.contains("onHostMaintenance") && onHostMaintenance != null) {
-      fieldMap.put(
-          "onHostMaintenance", Collections.singletonList(String.valueOf(onHostMaintenance)));
-    }
-    if (fieldNames.contains("preemptible") && preemptible != null) {
-      fieldMap.put("preemptible", Collections.singletonList(String.valueOf(preemptible)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("automaticRestart")) {
-      return String.valueOf(automaticRestart);
+      return automaticRestart;
     }
     if (fieldName.equals("onHostMaintenance")) {
-      return String.valueOf(onHostMaintenance);
+      return onHostMaintenance;
     }
     if (fieldName.equals("preemptible")) {
-      return String.valueOf(preemptible);
+      return preemptible;
     }
     return null;
   }
@@ -81,6 +61,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Boolean getAutomaticRestart() {
     return automaticRestart;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java
index 5001ccf5668c..e806a83522e6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private ScratchDisks(Integer diskGb) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("diskGb") && diskGb != null) {
-      fieldMap.put("diskGb", Collections.singletonList(String.valueOf(diskGb)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("diskGb")) {
+      return diskGb;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("diskGb")) {
-      return String.valueOf(diskGb);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java
index 4753665af903..176456887caf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private SerialPortOutput(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("contents") && contents != null) {
-      fieldMap.put("contents", Collections.singletonList(String.valueOf(contents)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("next") && next != null) {
-      fieldMap.put("next", Collections.singletonList(String.valueOf(next)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("start") && start != null) {
-      fieldMap.put("start", Collections.singletonList(String.valueOf(start)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("contents")) {
-      return String.valueOf(contents);
+      return contents;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("next")) {
-      return String.valueOf(next);
+      return next;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("start")) {
-      return String.valueOf(start);
+      return start;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getContents() {
     return contents;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java
index 2bc312927530..b21d731cf495 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private ServiceAccount(String email, List scopes) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("email") && email != null) {
-      fieldMap.put("email", Collections.singletonList(String.valueOf(email)));
-    }
-    if (fieldNames.contains("scopes") && scopes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : scopes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("scopes", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("email")) {
-      return String.valueOf(email);
+      return email;
     }
     if (fieldName.equals("scopes")) {
-      return String.valueOf(scopes);
+      return scopes;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getEmail() {
     return email;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java
index ec0cedce49c0..94915ed07aa1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +75,36 @@ private SetBackendServiceTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetSslProxiesSetBackendServiceRequestResource")
-        && targetSslProxiesSetBackendServiceRequestResource != null) {
-      fieldMap.put(
-          "targetSslProxiesSetBackendServiceRequestResource",
-          Collections.singletonList(
-              String.valueOf(targetSslProxiesSetBackendServiceRequestResource)));
-    }
-    if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
-      fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetSslProxiesSetBackendServiceRequestResource")) {
-      return String.valueOf(targetSslProxiesSetBackendServiceRequestResource);
+      return targetSslProxiesSetBackendServiceRequestResource;
     }
     if (fieldName.equals("targetSslProxy")) {
-      return String.valueOf(targetSslProxy);
+      return targetSslProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -159,6 +115,12 @@ public TargetSslProxiesSetBackendServiceRequest getApiMessageRequestBody() {
     return targetSslProxiesSetBackendServiceRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java
index 42a0014c88d9..5a79262f2ebc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +75,36 @@ private SetBackendServiceTargetTcpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetTcpProxiesSetBackendServiceRequestResource")
-        && targetTcpProxiesSetBackendServiceRequestResource != null) {
-      fieldMap.put(
-          "targetTcpProxiesSetBackendServiceRequestResource",
-          Collections.singletonList(
-              String.valueOf(targetTcpProxiesSetBackendServiceRequestResource)));
-    }
-    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
-      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetTcpProxiesSetBackendServiceRequestResource")) {
-      return String.valueOf(targetTcpProxiesSetBackendServiceRequestResource);
+      return targetTcpProxiesSetBackendServiceRequestResource;
     }
     if (fieldName.equals("targetTcpProxy")) {
-      return String.valueOf(targetTcpProxy);
+      return targetTcpProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -159,6 +115,12 @@ public TargetTcpProxiesSetBackendServiceRequest getApiMessageRequestBody() {
     return targetTcpProxiesSetBackendServiceRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java
index 64316ee60f46..a8ff1c84b873 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,80 +77,39 @@ private SetBackupTargetPoolHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("failoverRatio") && failoverRatio != null) {
-      fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetPool") && targetPool != null) {
-      fieldMap.put("targetPool", Collections.singletonList(String.valueOf(targetPool)));
-    }
-    if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) {
-      fieldMap.put(
-          "targetReferenceResource",
-          Collections.singletonList(String.valueOf(targetReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("failoverRatio")) {
-      return String.valueOf(failoverRatio);
+      return failoverRatio;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetPool")) {
-      return String.valueOf(targetPool);
+      return targetPool;
     }
     if (fieldName.equals("targetReferenceResource")) {
-      return String.valueOf(targetReferenceResource);
+      return targetReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -165,6 +120,12 @@ public TargetReference getApiMessageRequestBody() {
     return targetReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java
index e1067dfacdec..7ef2f549c852 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private SetCommonInstanceMetadataProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("metadataResource") && metadataResource != null) {
-      fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("metadataResource")) {
-      return String.valueOf(metadataResource);
+      return metadataResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Metadata getApiMessageRequestBody() {
     return metadataResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java
index 74dc10f99e02..25ddb9bee5c3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private SetDeletionProtectionInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("deletionProtection") && deletionProtection != null) {
-      fieldMap.put(
-          "deletionProtection", Collections.singletonList(String.valueOf(deletionProtection)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("deletionProtection")) {
-      return String.valueOf(deletionProtection);
+      return deletionProtection;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java
index c71d726e3203..1d68a7549b97 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,78 +77,39 @@ private SetDiskAutoDeleteInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoDelete") && autoDelete != null) {
-      fieldMap.put("autoDelete", Collections.singletonList(String.valueOf(autoDelete)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("deviceName") && deviceName != null) {
-      fieldMap.put("deviceName", Collections.singletonList(String.valueOf(deviceName)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoDelete")) {
-      return String.valueOf(autoDelete);
+      return autoDelete;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("deviceName")) {
-      return String.valueOf(deviceName);
+      return deviceName;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -163,6 +120,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java
index 42d118e74ec8..4b2b5108df78 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,77 +76,36 @@ private SetInstanceTemplateInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("instanceGroupManagersSetInstanceTemplateRequestResource")
-        && instanceGroupManagersSetInstanceTemplateRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupManagersSetInstanceTemplateRequestResource",
-          Collections.singletonList(
-              String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("instanceGroupManagersSetInstanceTemplateRequestResource")) {
-      return String.valueOf(instanceGroupManagersSetInstanceTemplateRequestResource);
+      return instanceGroupManagersSetInstanceTemplateRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -161,6 +116,12 @@ public InstanceGroupManagersSetInstanceTemplateRequest getApiMessageRequestBody(
     return instanceGroupManagersSetInstanceTemplateRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java
index 04073eee5b98..6465fd01f274 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,77 +76,36 @@ private SetInstanceTemplateRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionInstanceGroupManagersSetTemplateRequestResource")
-        && regionInstanceGroupManagersSetTemplateRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupManagersSetTemplateRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionInstanceGroupManagersSetTemplateRequestResource")) {
-      return String.valueOf(regionInstanceGroupManagersSetTemplateRequestResource);
+      return regionInstanceGroupManagersSetTemplateRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -161,6 +116,12 @@ public RegionInstanceGroupManagersSetTemplateRequest getApiMessageRequestBody()
     return regionInstanceGroupManagersSetTemplateRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java
index f3217f2bce48..5169b551ebaf 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetLabelsDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zoneSetLabelsRequestResource")
-        && zoneSetLabelsRequestResource != null) {
-      fieldMap.put(
-          "zoneSetLabelsRequestResource",
-          Collections.singletonList(String.valueOf(zoneSetLabelsRequestResource)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zoneSetLabelsRequestResource")) {
-      return String.valueOf(zoneSetLabelsRequestResource);
+      return zoneSetLabelsRequestResource;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public ZoneSetLabelsRequest getApiMessageRequestBody() {
     return zoneSetLabelsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java
index 20b77f6a94ac..71baf086694e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private SetLabelsImageHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("globalSetLabelsRequestResource")
-        && globalSetLabelsRequestResource != null) {
-      fieldMap.put(
-          "globalSetLabelsRequestResource",
-          Collections.singletonList(String.valueOf(globalSetLabelsRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("globalSetLabelsRequestResource")) {
-      return String.valueOf(globalSetLabelsRequestResource);
+      return globalSetLabelsRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public GlobalSetLabelsRequest getApiMessageRequestBody() {
     return globalSetLabelsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java
index be8e7c4200b6..057e08320ac4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetLabelsInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instancesSetLabelsRequestResource")
-        && instancesSetLabelsRequestResource != null) {
-      fieldMap.put(
-          "instancesSetLabelsRequestResource",
-          Collections.singletonList(String.valueOf(instancesSetLabelsRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instancesSetLabelsRequestResource")) {
-      return String.valueOf(instancesSetLabelsRequestResource);
+      return instancesSetLabelsRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstancesSetLabelsRequest getApiMessageRequestBody() {
     return instancesSetLabelsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java
index 5c97044f2cbc..0ee157f7e2fd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetLabelsRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionSetLabelsRequestResource")
-        && regionSetLabelsRequestResource != null) {
-      fieldMap.put(
-          "regionSetLabelsRequestResource",
-          Collections.singletonList(String.valueOf(regionSetLabelsRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionSetLabelsRequestResource")) {
-      return String.valueOf(regionSetLabelsRequestResource);
+      return regionSetLabelsRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public RegionSetLabelsRequest getApiMessageRequestBody() {
     return regionSetLabelsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java
index 5b4d0d82e0f8..f61d9205e66d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private SetLabelsSnapshotHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("globalSetLabelsRequestResource")
-        && globalSetLabelsRequestResource != null) {
-      fieldMap.put(
-          "globalSetLabelsRequestResource",
-          Collections.singletonList(String.valueOf(globalSetLabelsRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("globalSetLabelsRequestResource")) {
-      return String.valueOf(globalSetLabelsRequestResource);
+      return globalSetLabelsRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public GlobalSetLabelsRequest getApiMessageRequestBody() {
     return globalSetLabelsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java
index ff4e738a7a9f..8f112ba95cea 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetMachineResourcesInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instancesSetMachineResourcesRequestResource")
-        && instancesSetMachineResourcesRequestResource != null) {
-      fieldMap.put(
-          "instancesSetMachineResourcesRequestResource",
-          Collections.singletonList(String.valueOf(instancesSetMachineResourcesRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instancesSetMachineResourcesRequestResource")) {
-      return String.valueOf(instancesSetMachineResourcesRequestResource);
+      return instancesSetMachineResourcesRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstancesSetMachineResourcesRequest getApiMessageRequestBody() {
     return instancesSetMachineResourcesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java
index 87e1801f599a..7badaf6cfdfe 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetMachineTypeInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instancesSetMachineTypeRequestResource")
-        && instancesSetMachineTypeRequestResource != null) {
-      fieldMap.put(
-          "instancesSetMachineTypeRequestResource",
-          Collections.singletonList(String.valueOf(instancesSetMachineTypeRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instancesSetMachineTypeRequestResource")) {
-      return String.valueOf(instancesSetMachineTypeRequestResource);
+      return instancesSetMachineTypeRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstancesSetMachineTypeRequest getApiMessageRequestBody() {
     return instancesSetMachineTypeRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java
index 2df6c66b6f3d..55cea5ad9886 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private SetMetadataInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("metadataResource") && metadataResource != null) {
-      fieldMap.put("metadataResource", Collections.singletonList(String.valueOf(metadataResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("metadataResource")) {
-      return String.valueOf(metadataResource);
+      return metadataResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Metadata getApiMessageRequestBody() {
     return metadataResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java
index 7f23570801a8..fdbef21a1e7f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetMinCpuPlatformInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instancesSetMinCpuPlatformRequestResource")
-        && instancesSetMinCpuPlatformRequestResource != null) {
-      fieldMap.put(
-          "instancesSetMinCpuPlatformRequestResource",
-          Collections.singletonList(String.valueOf(instancesSetMinCpuPlatformRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instancesSetMinCpuPlatformRequestResource")) {
-      return String.valueOf(instancesSetMinCpuPlatformRequestResource);
+      return instancesSetMinCpuPlatformRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstancesSetMinCpuPlatformRequest getApiMessageRequestBody() {
     return instancesSetMinCpuPlatformRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java
index 62658c55ce77..deb3334abff7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetNamedPortsInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("instanceGroupsSetNamedPortsRequestResource")
-        && instanceGroupsSetNamedPortsRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupsSetNamedPortsRequestResource",
-          Collections.singletonList(String.valueOf(instanceGroupsSetNamedPortsRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("instanceGroupsSetNamedPortsRequestResource")) {
-      return String.valueOf(instanceGroupsSetNamedPortsRequestResource);
+      return instanceGroupsSetNamedPortsRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() {
     return instanceGroupsSetNamedPortsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java
index 9ac402efdc3d..8557570e6ce3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +75,36 @@ private SetNamedPortsRegionInstanceGroupHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroup") && instanceGroup != null) {
-      fieldMap.put("instanceGroup", Collections.singletonList(String.valueOf(instanceGroup)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionInstanceGroupsSetNamedPortsRequestResource")
-        && regionInstanceGroupsSetNamedPortsRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupsSetNamedPortsRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroup")) {
-      return String.valueOf(instanceGroup);
+      return instanceGroup;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionInstanceGroupsSetNamedPortsRequestResource")) {
-      return String.valueOf(regionInstanceGroupsSetNamedPortsRequestResource);
+      return regionInstanceGroupsSetNamedPortsRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -159,6 +115,12 @@ public RegionInstanceGroupsSetNamedPortsRequest getApiMessageRequestBody() {
     return regionInstanceGroupsSetNamedPortsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java
index 773951397df8..f94b3e6f4f67 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +75,36 @@ private SetPrivateIpGoogleAccessSubnetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("subnetwork") && subnetwork != null) {
-      fieldMap.put("subnetwork", Collections.singletonList(String.valueOf(subnetwork)));
-    }
-    if (fieldNames.contains("subnetworksSetPrivateIpGoogleAccessRequestResource")
-        && subnetworksSetPrivateIpGoogleAccessRequestResource != null) {
-      fieldMap.put(
-          "subnetworksSetPrivateIpGoogleAccessRequestResource",
-          Collections.singletonList(
-              String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("subnetwork")) {
-      return String.valueOf(subnetwork);
+      return subnetwork;
     }
     if (fieldName.equals("subnetworksSetPrivateIpGoogleAccessRequestResource")) {
-      return String.valueOf(subnetworksSetPrivateIpGoogleAccessRequestResource);
+      return subnetworksSetPrivateIpGoogleAccessRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -159,6 +115,12 @@ public SubnetworksSetPrivateIpGoogleAccessRequest getApiMessageRequestBody() {
     return subnetworksSetPrivateIpGoogleAccessRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java
index 13b0df6fae62..940b1957222d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -78,75 +74,36 @@ private SetProxyHeaderTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetSslProxiesSetProxyHeaderRequestResource")
-        && targetSslProxiesSetProxyHeaderRequestResource != null) {
-      fieldMap.put(
-          "targetSslProxiesSetProxyHeaderRequestResource",
-          Collections.singletonList(String.valueOf(targetSslProxiesSetProxyHeaderRequestResource)));
-    }
-    if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
-      fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetSslProxiesSetProxyHeaderRequestResource")) {
-      return String.valueOf(targetSslProxiesSetProxyHeaderRequestResource);
+      return targetSslProxiesSetProxyHeaderRequestResource;
     }
     if (fieldName.equals("targetSslProxy")) {
-      return String.valueOf(targetSslProxy);
+      return targetSslProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -157,6 +114,12 @@ public TargetSslProxiesSetProxyHeaderRequest getApiMessageRequestBody() {
     return targetSslProxiesSetProxyHeaderRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java
index 4c2535a0ef40..97bcded5875d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -78,75 +74,36 @@ private SetProxyHeaderTargetTcpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetTcpProxiesSetProxyHeaderRequestResource")
-        && targetTcpProxiesSetProxyHeaderRequestResource != null) {
-      fieldMap.put(
-          "targetTcpProxiesSetProxyHeaderRequestResource",
-          Collections.singletonList(String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource)));
-    }
-    if (fieldNames.contains("targetTcpProxy") && targetTcpProxy != null) {
-      fieldMap.put("targetTcpProxy", Collections.singletonList(String.valueOf(targetTcpProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetTcpProxiesSetProxyHeaderRequestResource")) {
-      return String.valueOf(targetTcpProxiesSetProxyHeaderRequestResource);
+      return targetTcpProxiesSetProxyHeaderRequestResource;
     }
     if (fieldName.equals("targetTcpProxy")) {
-      return String.valueOf(targetTcpProxy);
+      return targetTcpProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -157,6 +114,12 @@ public TargetTcpProxiesSetProxyHeaderRequest getApiMessageRequestBody() {
     return targetTcpProxiesSetProxyHeaderRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java
index a31bdc208c62..ab2132538887 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,73 +73,36 @@ private SetSchedulingInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("schedulingResource") && schedulingResource != null) {
-      fieldMap.put(
-          "schedulingResource", Collections.singletonList(String.valueOf(schedulingResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("schedulingResource")) {
-      return String.valueOf(schedulingResource);
+      return schedulingResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +113,12 @@ public Scheduling getApiMessageRequestBody() {
     return schedulingResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java
index 346ad7ec664a..913fb653a488 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,75 +73,36 @@ private SetServiceAccountInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instancesSetServiceAccountRequestResource")
-        && instancesSetServiceAccountRequestResource != null) {
-      fieldMap.put(
-          "instancesSetServiceAccountRequestResource",
-          Collections.singletonList(String.valueOf(instancesSetServiceAccountRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instancesSetServiceAccountRequestResource")) {
-      return String.valueOf(instancesSetServiceAccountRequestResource);
+      return instancesSetServiceAccountRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -156,6 +113,12 @@ public InstancesSetServiceAccountRequest getApiMessageRequestBody() {
     return instancesSetServiceAccountRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java
index 856b6f8dc764..b754e5a5f75a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,76 +76,36 @@ private SetSslCertificatesTargetHttpsProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpsProxiesSetSslCertificatesRequestResource")
-        && targetHttpsProxiesSetSslCertificatesRequestResource != null) {
-      fieldMap.put(
-          "targetHttpsProxiesSetSslCertificatesRequestResource",
-          Collections.singletonList(
-              String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource)));
-    }
-    if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
-      fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpsProxiesSetSslCertificatesRequestResource")) {
-      return String.valueOf(targetHttpsProxiesSetSslCertificatesRequestResource);
+      return targetHttpsProxiesSetSslCertificatesRequestResource;
     }
     if (fieldName.equals("targetHttpsProxy")) {
-      return String.valueOf(targetHttpsProxy);
+      return targetHttpsProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -160,6 +116,12 @@ public TargetHttpsProxiesSetSslCertificatesRequest getApiMessageRequestBody() {
     return targetHttpsProxiesSetSslCertificatesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java
index e569f57696c8..ce3278ac073e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +75,36 @@ private SetSslCertificatesTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetSslProxiesSetSslCertificatesRequestResource")
-        && targetSslProxiesSetSslCertificatesRequestResource != null) {
-      fieldMap.put(
-          "targetSslProxiesSetSslCertificatesRequestResource",
-          Collections.singletonList(
-              String.valueOf(targetSslProxiesSetSslCertificatesRequestResource)));
-    }
-    if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
-      fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetSslProxiesSetSslCertificatesRequestResource")) {
-      return String.valueOf(targetSslProxiesSetSslCertificatesRequestResource);
+      return targetSslProxiesSetSslCertificatesRequestResource;
     }
     if (fieldName.equals("targetSslProxy")) {
-      return String.valueOf(targetSslProxy);
+      return targetSslProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -159,6 +115,12 @@ public TargetSslProxiesSetSslCertificatesRequest getApiMessageRequestBody() {
     return targetSslProxiesSetSslCertificatesRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java
index 57545bbf899e..2b355c09bdc8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetSslPolicyTargetHttpsProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) {
-      fieldMap.put(
-          "sslPolicyReferenceResource",
-          Collections.singletonList(String.valueOf(sslPolicyReferenceResource)));
-    }
-    if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
-      fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslPolicyReferenceResource")) {
-      return String.valueOf(sslPolicyReferenceResource);
+      return sslPolicyReferenceResource;
     }
     if (fieldName.equals("targetHttpsProxy")) {
-      return String.valueOf(targetHttpsProxy);
+      return targetHttpsProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public SslPolicyReference getApiMessageRequestBody() {
     return sslPolicyReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java
index b690cf4f02c0..187704c3d2dd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetSslPolicyTargetSslProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("sslPolicyReferenceResource") && sslPolicyReferenceResource != null) {
-      fieldMap.put(
-          "sslPolicyReferenceResource",
-          Collections.singletonList(String.valueOf(sslPolicyReferenceResource)));
-    }
-    if (fieldNames.contains("targetSslProxy") && targetSslProxy != null) {
-      fieldMap.put("targetSslProxy", Collections.singletonList(String.valueOf(targetSslProxy)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("sslPolicyReferenceResource")) {
-      return String.valueOf(sslPolicyReferenceResource);
+      return sslPolicyReferenceResource;
     }
     if (fieldName.equals("targetSslProxy")) {
-      return String.valueOf(targetSslProxy);
+      return targetSslProxy;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public SslPolicyReference getApiMessageRequestBody() {
     return sslPolicyReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java
index dcb381e82c3c..c04373e8a529 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,72 +73,36 @@ private SetTagsInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("tagsResource") && tagsResource != null) {
-      fieldMap.put("tagsResource", Collections.singletonList(String.valueOf(tagsResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("tagsResource")) {
-      return String.valueOf(tagsResource);
+      return tagsResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +113,12 @@ public Tags getApiMessageRequestBody() {
     return tagsResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java
index 8d715bdd6461..0f4011f2ca43 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetTargetForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRule") && forwardingRule != null) {
-      fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) {
-      fieldMap.put(
-          "targetReferenceResource",
-          Collections.singletonList(String.valueOf(targetReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRule")) {
-      return String.valueOf(forwardingRule);
+      return forwardingRule;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetReferenceResource")) {
-      return String.valueOf(targetReferenceResource);
+      return targetReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetReference getApiMessageRequestBody() {
     return targetReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java
index 5d90c0309c54..591c84ce4079 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetTargetGlobalForwardingRuleHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("forwardingRule") && forwardingRule != null) {
-      fieldMap.put("forwardingRule", Collections.singletonList(String.valueOf(forwardingRule)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetReferenceResource") && targetReferenceResource != null) {
-      fieldMap.put(
-          "targetReferenceResource",
-          Collections.singletonList(String.valueOf(targetReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("forwardingRule")) {
-      return String.valueOf(forwardingRule);
+      return forwardingRule;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetReferenceResource")) {
-      return String.valueOf(targetReferenceResource);
+      return targetReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public TargetReference getApiMessageRequestBody() {
     return targetReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java
index b41902cfd6ea..de3e6724cc64 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,77 +75,36 @@ private SetTargetPoolsInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("instanceGroupManagersSetTargetPoolsRequestResource")
-        && instanceGroupManagersSetTargetPoolsRequestResource != null) {
-      fieldMap.put(
-          "instanceGroupManagersSetTargetPoolsRequestResource",
-          Collections.singletonList(
-              String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("instanceGroupManagersSetTargetPoolsRequestResource")) {
-      return String.valueOf(instanceGroupManagersSetTargetPoolsRequestResource);
+      return instanceGroupManagersSetTargetPoolsRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -160,6 +115,12 @@ public InstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody() {
     return instanceGroupManagersSetTargetPoolsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java
index d1f6bd78f19b..b99e289db6b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -80,77 +76,36 @@ private SetTargetPoolsRegionInstanceGroupManagerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instanceGroupManager") && instanceGroupManager != null) {
-      fieldMap.put(
-          "instanceGroupManager", Collections.singletonList(String.valueOf(instanceGroupManager)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("regionInstanceGroupManagersSetTargetPoolsRequestResource")
-        && regionInstanceGroupManagersSetTargetPoolsRequestResource != null) {
-      fieldMap.put(
-          "regionInstanceGroupManagersSetTargetPoolsRequestResource",
-          Collections.singletonList(
-              String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instanceGroupManager")) {
-      return String.valueOf(instanceGroupManager);
+      return instanceGroupManager;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("regionInstanceGroupManagersSetTargetPoolsRequestResource")) {
-      return String.valueOf(regionInstanceGroupManagersSetTargetPoolsRequestResource);
+      return regionInstanceGroupManagersSetTargetPoolsRequestResource;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -161,6 +116,12 @@ public RegionInstanceGroupManagersSetTargetPoolsRequest getApiMessageRequestBody
     return regionInstanceGroupManagersSetTargetPoolsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java
index cb03dc8c68b9..fc43374f5e9f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetUrlMapTargetHttpProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpProxy") && targetHttpProxy != null) {
-      fieldMap.put("targetHttpProxy", Collections.singletonList(String.valueOf(targetHttpProxy)));
-    }
-    if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) {
-      fieldMap.put(
-          "urlMapReferenceResource",
-          Collections.singletonList(String.valueOf(urlMapReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpProxy")) {
-      return String.valueOf(targetHttpProxy);
+      return targetHttpProxy;
     }
     if (fieldName.equals("urlMapReferenceResource")) {
-      return String.valueOf(urlMapReferenceResource);
+      return urlMapReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public UrlMapReference getApiMessageRequestBody() {
     return urlMapReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java
index 00ee948a619b..c886f963980f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetUrlMapTargetHttpsProxyHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("targetHttpsProxy") && targetHttpsProxy != null) {
-      fieldMap.put("targetHttpsProxy", Collections.singletonList(String.valueOf(targetHttpsProxy)));
-    }
-    if (fieldNames.contains("urlMapReferenceResource") && urlMapReferenceResource != null) {
-      fieldMap.put(
-          "urlMapReferenceResource",
-          Collections.singletonList(String.valueOf(urlMapReferenceResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("targetHttpsProxy")) {
-      return String.valueOf(targetHttpsProxy);
+      return targetHttpsProxy;
     }
     if (fieldName.equals("urlMapReferenceResource")) {
-      return String.valueOf(urlMapReferenceResource);
+      return urlMapReferenceResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public UrlMapReference getApiMessageRequestBody() {
     return urlMapReferenceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java
index 914272f15daa..4190be522ba5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -77,74 +73,36 @@ private SetUsageExportBucketProjectHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("project") && project != null) {
-      fieldMap.put("project", Collections.singletonList(String.valueOf(project)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("usageExportLocationResource") && usageExportLocationResource != null) {
-      fieldMap.put(
-          "usageExportLocationResource",
-          Collections.singletonList(String.valueOf(usageExportLocationResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("project")) {
-      return String.valueOf(project);
+      return project;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("usageExportLocationResource")) {
-      return String.valueOf(usageExportLocationResource);
+      return usageExportLocationResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +113,12 @@ public UsageExportLocation getApiMessageRequestBody() {
     return usageExportLocationResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java
index 67ac4ed48159..4be6f4617e06 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java
@@ -17,14 +17,10 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -111,134 +107,60 @@ private Snapshot(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("diskSizeGb") && diskSizeGb != null) {
-      fieldMap.put("diskSizeGb", Collections.singletonList(String.valueOf(diskSizeGb)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    if (fieldNames.contains("licenseCodes") && licenseCodes != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : licenseCodes) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenseCodes", stringList.build());
-    }
-    if (fieldNames.contains("licenses") && licenses != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : licenses) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("licenses", stringList.build());
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("snapshotEncryptionKey") && snapshotEncryptionKey != null) {
-      fieldMap.put(
-          "snapshotEncryptionKey",
-          Collections.singletonList(String.valueOf(snapshotEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceDisk") && sourceDisk != null) {
-      fieldMap.put("sourceDisk", Collections.singletonList(String.valueOf(sourceDisk)));
-    }
-    if (fieldNames.contains("sourceDiskEncryptionKey") && sourceDiskEncryptionKey != null) {
-      fieldMap.put(
-          "sourceDiskEncryptionKey",
-          Collections.singletonList(String.valueOf(sourceDiskEncryptionKey)));
-    }
-    if (fieldNames.contains("sourceDiskId") && sourceDiskId != null) {
-      fieldMap.put("sourceDiskId", Collections.singletonList(String.valueOf(sourceDiskId)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("storageBytes") && storageBytes != null) {
-      fieldMap.put("storageBytes", Collections.singletonList(String.valueOf(storageBytes)));
-    }
-    if (fieldNames.contains("storageBytesStatus") && storageBytesStatus != null) {
-      fieldMap.put(
-          "storageBytesStatus", Collections.singletonList(String.valueOf(storageBytesStatus)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("diskSizeGb")) {
-      return String.valueOf(diskSizeGb);
+      return diskSizeGb;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     if (fieldName.equals("licenseCodes")) {
-      return String.valueOf(licenseCodes);
+      return licenseCodes;
     }
     if (fieldName.equals("licenses")) {
-      return String.valueOf(licenses);
+      return licenses;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("snapshotEncryptionKey")) {
-      return String.valueOf(snapshotEncryptionKey);
+      return snapshotEncryptionKey;
     }
     if (fieldName.equals("sourceDisk")) {
-      return String.valueOf(sourceDisk);
+      return sourceDisk;
     }
     if (fieldName.equals("sourceDiskEncryptionKey")) {
-      return String.valueOf(sourceDiskEncryptionKey);
+      return sourceDiskEncryptionKey;
     }
     if (fieldName.equals("sourceDiskId")) {
-      return String.valueOf(sourceDiskId);
+      return sourceDiskId;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("storageBytes")) {
-      return String.valueOf(storageBytes);
+      return storageBytes;
     }
     if (fieldName.equals("storageBytesStatus")) {
-      return String.valueOf(storageBytesStatus);
+      return storageBytesStatus;
     }
     return null;
   }
@@ -249,6 +171,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
index 3b8509f39793..d9df2eb33fd3 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
+ *   Operation response = snapshotClient.deleteSnapshot(snapshot);
  * }
  * 
  * 
@@ -164,30 +163,19 @@ public SnapshotStub getStub() { * *

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
+   *   Operation response = snapshotClient.deleteSnapshot(snapshot);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param snapshot Name of the Snapshot resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSnapshot(String requestId, ProjectGlobalSnapshotName snapshot) { + public final Operation deleteSnapshot(ProjectGlobalSnapshotName snapshot) { DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder() - .setRequestId(requestId) .setSnapshot(snapshot == null ? null : snapshot.toString()) .build(); return deleteSnapshot(request); @@ -206,32 +194,19 @@ public final Operation deleteSnapshot(String requestId, ProjectGlobalSnapshotNam * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot.toString());
+   *   Operation response = snapshotClient.deleteSnapshot(snapshot.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param snapshot Name of the Snapshot resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSnapshot(String requestId, String snapshot) { + public final Operation deleteSnapshot(String snapshot) { DeleteSnapshotHttpRequest request = - DeleteSnapshotHttpRequest.newBuilder() - .setRequestId(requestId) - .setSnapshot(snapshot) - .build(); + DeleteSnapshotHttpRequest.newBuilder().setSnapshot(snapshot).build(); return deleteSnapshot(request); } @@ -248,10 +223,8 @@ public final Operation deleteSnapshot(String requestId, String snapshot) { * *


    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
    *     .build();
    *   Operation response = snapshotClient.deleteSnapshot(request);
@@ -279,10 +252,8 @@ public final Operation deleteSnapshot(DeleteSnapshotHttpRequest request) {
    *
    * 

    * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    *   DeleteSnapshotHttpRequest request = DeleteSnapshotHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSnapshot(snapshot.toString())
    *     .build();
    *   ApiFuture<Operation> future = snapshotClient.deleteSnapshotCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java
index 198c12f23451..f1f7ce3efa18 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private SnapshotList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Snapshot item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java
index ddd5a6eb3410..3894f3103963 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,61 +65,30 @@ private SslCertificate(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("certificate") && certificate != null) {
-      fieldMap.put("certificate", Collections.singletonList(String.valueOf(certificate)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("privateKey") && privateKey != null) {
-      fieldMap.put("privateKey", Collections.singletonList(String.valueOf(privateKey)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("certificate")) {
-      return String.valueOf(certificate);
+      return certificate;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("privateKey")) {
-      return String.valueOf(privateKey);
+      return privateKey;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCertificate() {
     return certificate;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java
index 5f3650841791..f6167e2d26a5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java
@@ -43,8 +43,7 @@
  * 
  * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
  *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
- *   String requestId = "";
- *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
+ *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
  * }
  * 
  * 
@@ -162,31 +161,19 @@ public SslCertificateStub getStub() { *

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
-   *   String requestId = "";
-   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId);
+   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate);
    * }
    * 
* * @param sslCertificate Name of the SslCertificate resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslCertificate( - ProjectGlobalSslCertificateName sslCertificate, String requestId) { + public final Operation deleteSslCertificate(ProjectGlobalSslCertificateName sslCertificate) { DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder() .setSslCertificate(sslCertificate == null ? null : sslCertificate.toString()) - .setRequestId(requestId) .build(); return deleteSslCertificate(request); } @@ -200,31 +187,18 @@ public final Operation deleteSslCertificate( *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
-   *   String requestId = "";
-   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString(), requestId);
+   *   Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate.toString());
    * }
    * 
* * @param sslCertificate Name of the SslCertificate resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslCertificate(String sslCertificate, String requestId) { + public final Operation deleteSslCertificate(String sslCertificate) { DeleteSslCertificateHttpRequest request = - DeleteSslCertificateHttpRequest.newBuilder() - .setSslCertificate(sslCertificate) - .setRequestId(requestId) - .build(); + DeleteSslCertificateHttpRequest.newBuilder().setSslCertificate(sslCertificate).build(); return deleteSslCertificate(request); } @@ -237,10 +211,8 @@ public final Operation deleteSslCertificate(String sslCertificate, String reques *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
-   *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = sslCertificateClient.deleteSslCertificate(request);
    * }
@@ -263,10 +235,8 @@ public final Operation deleteSslCertificate(DeleteSslCertificateHttpRequest requ
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
    *   ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]");
-   *   String requestId = "";
    *   DeleteSslCertificateHttpRequest request = DeleteSslCertificateHttpRequest.newBuilder()
    *     .setSslCertificate(sslCertificate.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = sslCertificateClient.deleteSslCertificateCallable().futureCall(request);
    *   // Do something
@@ -391,22 +361,12 @@ public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest reque
    *
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
-   *   Operation response = sslCertificateClient.insertSslCertificate(requestId, project, sslCertificateResource);
+   *   Operation response = sslCertificateClient.insertSslCertificate(project, sslCertificateResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to * upload an SSL key and certificate to the load balancer to serve secure connections from the @@ -415,11 +375,10 @@ public final SslCertificate getSslCertificate(GetSslCertificateHttpRequest reque */ @BetaApi public final Operation insertSslCertificate( - String requestId, ProjectName project, SslCertificate sslCertificateResource) { + ProjectName project, SslCertificate sslCertificateResource) { InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setSslCertificateResource(sslCertificateResource) .build(); @@ -435,22 +394,12 @@ public final Operation insertSslCertificate( * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
-   *   Operation response = sslCertificateClient.insertSslCertificate(requestId, project.toString(), sslCertificateResource);
+   *   Operation response = sslCertificateClient.insertSslCertificate(project.toString(), sslCertificateResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param sslCertificateResource An SslCertificate resource. This resource provides a mechanism to * upload an SSL key and certificate to the load balancer to serve secure connections from the @@ -459,11 +408,10 @@ public final Operation insertSslCertificate( */ @BetaApi public final Operation insertSslCertificate( - String requestId, String project, SslCertificate sslCertificateResource) { + String project, SslCertificate sslCertificateResource) { InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setSslCertificateResource(sslCertificateResource) .build(); @@ -479,11 +427,9 @@ public final Operation insertSslCertificate( * *


    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
    *   InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setSslCertificateResource(sslCertificateResource)
    *     .build();
@@ -508,11 +454,9 @@ public final Operation insertSslCertificate(InsertSslCertificateHttpRequest requ
    *
    * 

    * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
    *   InsertSslCertificateHttpRequest request = InsertSslCertificateHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setSslCertificateResource(sslCertificateResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java
index cbb9a020d13c..a787ee087c2c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private SslCertificateList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (SslCertificate item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java
index 1f42eb277e9b..01888013fbf9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private SslPoliciesList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (SslPolicy item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java
index 58ef5f0038a9..83ff4bdd015d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private SslPoliciesListAvailableFeaturesResponse(List features) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("features") && features != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : features) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("features", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("features")) {
+      return features;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("features")) {
-      return String.valueOf(features);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java
index d002cc4c701f..ae708f653f4c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -87,97 +82,42 @@ private SslPolicy(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("customFeatures") && customFeatures != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : customFeatures) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("customFeatures", stringList.build());
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("enabledFeatures") && enabledFeatures != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : enabledFeatures) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("enabledFeatures", stringList.build());
-    }
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("minTlsVersion") && minTlsVersion != null) {
-      fieldMap.put("minTlsVersion", Collections.singletonList(String.valueOf(minTlsVersion)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("profile") && profile != null) {
-      fieldMap.put("profile", Collections.singletonList(String.valueOf(profile)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warnings") && warnings != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Warnings item : warnings) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("warnings", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("customFeatures")) {
-      return String.valueOf(customFeatures);
+      return customFeatures;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("enabledFeatures")) {
-      return String.valueOf(enabledFeatures);
+      return enabledFeatures;
     }
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("minTlsVersion")) {
-      return String.valueOf(minTlsVersion);
+      return minTlsVersion;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("profile")) {
-      return String.valueOf(profile);
+      return profile;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warnings")) {
-      return String.valueOf(warnings);
+      return warnings;
     }
     return null;
   }
@@ -188,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java
index 8d71c1fda14d..cdf291995cdc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
- *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy);
+ *   Operation response = sslPolicyClient.deleteSslPolicy(sslPolicy);
  * }
  * 
  * 
@@ -160,31 +159,20 @@ public SslPolicyStub getStub() { * *

    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
-   *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy);
+   *   Operation response = sslPolicyClient.deleteSslPolicy(sslPolicy);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and * comply with RFC1035. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslPolicy(String requestId, ProjectGlobalSslPolicyName sslPolicy) { + public final Operation deleteSslPolicy(ProjectGlobalSslPolicyName sslPolicy) { DeleteSslPolicyHttpRequest request = DeleteSslPolicyHttpRequest.newBuilder() - .setRequestId(requestId) .setSslPolicy(sslPolicy == null ? null : sslPolicy.toString()) .build(); return deleteSslPolicy(request); @@ -199,33 +187,20 @@ public final Operation deleteSslPolicy(String requestId, ProjectGlobalSslPolicyN * *


    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
-   *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy.toString());
+   *   Operation response = sslPolicyClient.deleteSslPolicy(sslPolicy.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and * comply with RFC1035. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSslPolicy(String requestId, String sslPolicy) { + public final Operation deleteSslPolicy(String sslPolicy) { DeleteSslPolicyHttpRequest request = - DeleteSslPolicyHttpRequest.newBuilder() - .setRequestId(requestId) - .setSslPolicy(sslPolicy) - .build(); + DeleteSslPolicyHttpRequest.newBuilder().setSslPolicy(sslPolicy).build(); return deleteSslPolicy(request); } @@ -238,10 +213,8 @@ public final Operation deleteSslPolicy(String requestId, String sslPolicy) { * *


    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
    *   DeleteSslPolicyHttpRequest request = DeleteSslPolicyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSslPolicy(sslPolicy.toString())
    *     .build();
    *   Operation response = sslPolicyClient.deleteSslPolicy(request);
@@ -265,10 +238,8 @@ public final Operation deleteSslPolicy(DeleteSslPolicyHttpRequest request) {
    *
    * 

    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
    *   DeleteSslPolicyHttpRequest request = DeleteSslPolicyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSslPolicy(sslPolicy.toString())
    *     .build();
    *   ApiFuture<Operation> future = sslPolicyClient.deleteSslPolicyCallable().futureCall(request);
@@ -390,22 +361,12 @@ public final UnaryCallable getSslPolicyCalla
    *
    * 

    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
-   *   Operation response = sslPolicyClient.insertSslPolicy(requestId, project, sslPolicyResource);
+   *   Operation response = sslPolicyClient.insertSslPolicy(project, sslPolicyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This * can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between @@ -414,12 +375,10 @@ public final UnaryCallable getSslPolicyCalla * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSslPolicy( - String requestId, ProjectName project, SslPolicy sslPolicyResource) { + public final Operation insertSslPolicy(ProjectName project, SslPolicy sslPolicyResource) { InsertSslPolicyHttpRequest request = InsertSslPolicyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setSslPolicyResource(sslPolicyResource) .build(); @@ -435,22 +394,12 @@ public final Operation insertSslPolicy( * *


    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
-   *   Operation response = sslPolicyClient.insertSslPolicy(requestId, project.toString(), sslPolicyResource);
+   *   Operation response = sslPolicyClient.insertSslPolicy(project.toString(), sslPolicyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This * can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between @@ -459,12 +408,10 @@ public final Operation insertSslPolicy( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSslPolicy( - String requestId, String project, SslPolicy sslPolicyResource) { + public final Operation insertSslPolicy(String project, SslPolicy sslPolicyResource) { InsertSslPolicyHttpRequest request = InsertSslPolicyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setSslPolicyResource(sslPolicyResource) .build(); @@ -480,11 +427,9 @@ public final Operation insertSslPolicy( * *


    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
    *   InsertSslPolicyHttpRequest request = InsertSslPolicyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setSslPolicyResource(sslPolicyResource)
    *     .build();
@@ -509,11 +454,9 @@ public final Operation insertSslPolicy(InsertSslPolicyHttpRequest request) {
    *
    * 

    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
    *   InsertSslPolicyHttpRequest request = InsertSslPolicyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setSslPolicyResource(sslPolicyResource)
    *     .build();
@@ -775,22 +718,12 @@ public final SslPoliciesListAvailableFeaturesResponse listAvailableFeaturesSslPo
    *
    * 

    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
-   *   Operation response = sslPolicyClient.patchSslPolicy(requestId, sslPolicy, sslPolicyResource);
+   *   Operation response = sslPolicyClient.patchSslPolicy(sslPolicy, sslPolicyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and * comply with RFC1035. * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This @@ -801,11 +734,10 @@ public final SslPoliciesListAvailableFeaturesResponse listAvailableFeaturesSslPo */ @BetaApi public final Operation patchSslPolicy( - String requestId, ProjectGlobalSslPolicyName sslPolicy, SslPolicy sslPolicyResource) { + ProjectGlobalSslPolicyName sslPolicy, SslPolicy sslPolicyResource) { PatchSslPolicyHttpRequest request = PatchSslPolicyHttpRequest.newBuilder() - .setRequestId(requestId) .setSslPolicy(sslPolicy == null ? null : sslPolicy.toString()) .setSslPolicyResource(sslPolicyResource) .build(); @@ -820,22 +752,12 @@ public final Operation patchSslPolicy( * *


    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
-   *   Operation response = sslPolicyClient.patchSslPolicy(requestId, sslPolicy.toString(), sslPolicyResource);
+   *   Operation response = sslPolicyClient.patchSslPolicy(sslPolicy.toString(), sslPolicyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and * comply with RFC1035. * @param sslPolicyResource A SSL policy specifies the server-side support for SSL features. This @@ -845,12 +767,10 @@ public final Operation patchSslPolicy( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchSslPolicy( - String requestId, String sslPolicy, SslPolicy sslPolicyResource) { + public final Operation patchSslPolicy(String sslPolicy, SslPolicy sslPolicyResource) { PatchSslPolicyHttpRequest request = PatchSslPolicyHttpRequest.newBuilder() - .setRequestId(requestId) .setSslPolicy(sslPolicy) .setSslPolicyResource(sslPolicyResource) .build(); @@ -865,11 +785,9 @@ public final Operation patchSslPolicy( * *


    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
    *   PatchSslPolicyHttpRequest request = PatchSslPolicyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSslPolicy(sslPolicy.toString())
    *     .setSslPolicyResource(sslPolicyResource)
    *     .build();
@@ -893,11 +811,9 @@ public final Operation patchSslPolicy(PatchSslPolicyHttpRequest request) {
    *
    * 

    * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
    *   SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
    *   PatchSslPolicyHttpRequest request = PatchSslPolicyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSslPolicy(sslPolicy.toString())
    *     .setSslPolicyResource(sslPolicyResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java
index 245dfab14d8b..39637920f887 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private SslPolicyReference(String sslPolicy) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("sslPolicy") && sslPolicy != null) {
-      fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("sslPolicy")) {
+      return sslPolicy;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("sslPolicy")) {
-      return String.valueOf(sslPolicy);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java
index 7903c82a18c7..4f3f05adc1a0 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private StartInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java
index 6f13286785a2..b120c69e1c47 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,76 +75,36 @@ private StartWithEncryptionKeyInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("instancesStartWithEncryptionKeyRequestResource")
-        && instancesStartWithEncryptionKeyRequestResource != null) {
-      fieldMap.put(
-          "instancesStartWithEncryptionKeyRequestResource",
-          Collections.singletonList(
-              String.valueOf(instancesStartWithEncryptionKeyRequestResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("instancesStartWithEncryptionKeyRequestResource")) {
-      return String.valueOf(instancesStartWithEncryptionKeyRequestResource);
+      return instancesStartWithEncryptionKeyRequestResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -159,6 +115,12 @@ public InstancesStartWithEncryptionKeyRequest getApiMessageRequestBody() {
     return instancesStartWithEncryptionKeyRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java
index 5aa9f03aee38..5d126ad32e95 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private StopInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java
index a9cf424b146e..091edb2fb777 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -95,103 +90,48 @@ private Subnetwork(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("enableFlowLogs") && enableFlowLogs != null) {
-      fieldMap.put("enableFlowLogs", Collections.singletonList(String.valueOf(enableFlowLogs)));
-    }
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("gatewayAddress") && gatewayAddress != null) {
-      fieldMap.put("gatewayAddress", Collections.singletonList(String.valueOf(gatewayAddress)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) {
-      fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) {
-      fieldMap.put(
-          "privateIpGoogleAccess",
-          Collections.singletonList(String.valueOf(privateIpGoogleAccess)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("secondaryIpRanges") && secondaryIpRanges != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (SubnetworkSecondaryRange item : secondaryIpRanges) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("secondaryIpRanges", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("enableFlowLogs")) {
-      return String.valueOf(enableFlowLogs);
+      return enableFlowLogs;
     }
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("gatewayAddress")) {
-      return String.valueOf(gatewayAddress);
+      return gatewayAddress;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("ipCidrRange")) {
-      return String.valueOf(ipCidrRange);
+      return ipCidrRange;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("privateIpGoogleAccess")) {
-      return String.valueOf(privateIpGoogleAccess);
+      return privateIpGoogleAccess;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("secondaryIpRanges")) {
-      return String.valueOf(secondaryIpRanges);
+      return secondaryIpRanges;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     return null;
   }
@@ -202,6 +142,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java
index 947025080ea9..99fd627600a5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private SubnetworkAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
index 83e35c22d08c..d9231e08310a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
- *   String requestId = "";
  *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
- *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
+ *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
  * }
  * 
  * 
@@ -299,31 +298,19 @@ public final AggregatedListSubnetworksPagedResponse aggregatedListSubnetworks( * *

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
-   *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
+   *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSubnetwork( - String requestId, ProjectRegionSubnetworkName subnetwork) { + public final Operation deleteSubnetwork(ProjectRegionSubnetworkName subnetwork) { DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) .build(); return deleteSubnetwork(request); @@ -337,32 +324,19 @@ public final Operation deleteSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
-   *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork.toString());
+   *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteSubnetwork(String requestId, String subnetwork) { + public final Operation deleteSubnetwork(String subnetwork) { DeleteSubnetworkHttpRequest request = - DeleteSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) - .setSubnetwork(subnetwork) - .build(); + DeleteSubnetworkHttpRequest.newBuilder().setSubnetwork(subnetwork).build(); return deleteSubnetwork(request); } @@ -374,10 +348,8 @@ public final Operation deleteSubnetwork(String requestId, String subnetwork) { * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .build();
    *   Operation response = subnetworkClient.deleteSubnetwork(request);
@@ -400,10 +372,8 @@ public final Operation deleteSubnetwork(DeleteSubnetworkHttpRequest request) {
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .build();
    *   ApiFuture<Operation> future = subnetworkClient.deleteSubnetworkCallable().futureCall(request);
@@ -425,35 +395,23 @@ public final UnaryCallable deleteSubnetw
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
-   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource);
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to update. * @param subnetworksExpandIpCidrRangeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation expandIpCidrRangeSubnetwork( - String requestId, ProjectRegionSubnetworkName subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) .setSubnetworksExpandIpCidrRangeRequestResource( subnetworksExpandIpCidrRangeRequestResource) @@ -469,35 +427,23 @@ public final Operation expandIpCidrRangeSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
-   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(requestId, subnetwork.toString(), subnetworksExpandIpCidrRangeRequestResource);
+   *   Operation response = subnetworkClient.expandIpCidrRangeSubnetwork(subnetwork.toString(), subnetworksExpandIpCidrRangeRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to update. * @param subnetworksExpandIpCidrRangeRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation expandIpCidrRangeSubnetwork( - String requestId, String subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource) { ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork) .setSubnetworksExpandIpCidrRangeRequestResource( subnetworksExpandIpCidrRangeRequestResource) @@ -513,11 +459,9 @@ public final Operation expandIpCidrRangeSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
    *     .build();
@@ -542,11 +486,9 @@ public final Operation expandIpCidrRangeSubnetwork(
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build();
    *   ExpandIpCidrRangeSubnetworkHttpRequest request = ExpandIpCidrRangeSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworksExpandIpCidrRangeRequestResource(subnetworksExpandIpCidrRangeRequestResource)
    *     .build();
@@ -667,34 +609,22 @@ public final UnaryCallable getSubnetworkCa
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
-   *   Operation response = subnetworkClient.insertSubnetwork(requestId, region, subnetworkResource);
+   *   Operation response = subnetworkClient.insertSubnetwork(region, subnetworkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSubnetwork( - String requestId, ProjectRegionName region, Subnetwork subnetworkResource) { + public final Operation insertSubnetwork(ProjectRegionName region, Subnetwork subnetworkResource) { InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setSubnetworkResource(subnetworkResource) .build(); @@ -709,34 +639,22 @@ public final Operation insertSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
-   *   Operation response = subnetworkClient.insertSubnetwork(requestId, region.toString(), subnetworkResource);
+   *   Operation response = subnetworkClient.insertSubnetwork(region.toString(), subnetworkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertSubnetwork( - String requestId, String region, Subnetwork subnetworkResource) { + public final Operation insertSubnetwork(String region, Subnetwork subnetworkResource) { InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setSubnetworkResource(subnetworkResource) .build(); @@ -751,11 +669,9 @@ public final Operation insertSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setSubnetworkResource(subnetworkResource)
    *     .build();
@@ -779,11 +695,9 @@ public final Operation insertSubnetwork(InsertSubnetworkHttpRequest request) {
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   InsertSubnetworkHttpRequest request = InsertSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setSubnetworkResource(subnetworkResource)
    *     .build();
@@ -945,22 +859,12 @@ public final UnaryCallable listSubne
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
-   *   Operation response = subnetworkClient.patchSubnetwork(requestId, subnetwork, subnetworkResource);
+   *   Operation response = subnetworkClient.patchSubnetwork(subnetwork, subnetworkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to patch. * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== * resource_for v1.subnetworks ==) @@ -968,11 +872,10 @@ public final UnaryCallable listSubne */ @BetaApi public final Operation patchSubnetwork( - String requestId, ProjectRegionSubnetworkName subnetwork, Subnetwork subnetworkResource) { + ProjectRegionSubnetworkName subnetwork, Subnetwork subnetworkResource) { PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) .setSubnetworkResource(subnetworkResource) .build(); @@ -990,34 +893,22 @@ public final Operation patchSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
-   *   Operation response = subnetworkClient.patchSubnetwork(requestId, subnetwork.toString(), subnetworkResource);
+   *   Operation response = subnetworkClient.patchSubnetwork(subnetwork.toString(), subnetworkResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource to patch. * @param subnetworkResource A Subnetwork resource. (== resource_for beta.subnetworks ==) (== * resource_for v1.subnetworks ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchSubnetwork( - String requestId, String subnetwork, Subnetwork subnetworkResource) { + public final Operation patchSubnetwork(String subnetwork, Subnetwork subnetworkResource) { PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork) .setSubnetworkResource(subnetworkResource) .build(); @@ -1035,11 +926,9 @@ public final Operation patchSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworkResource(subnetworkResource)
    *     .build();
@@ -1066,11 +955,9 @@ public final Operation patchSubnetwork(PatchSubnetworkHttpRequest request) {
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   Subnetwork subnetworkResource = Subnetwork.newBuilder().build();
    *   PatchSubnetworkHttpRequest request = PatchSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworkResource(subnetworkResource)
    *     .build();
@@ -1094,36 +981,24 @@ public final UnaryCallable patchSubnetwor
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
-   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource);
+   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource. * @param subnetworksSetPrivateIpGoogleAccessRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setPrivateIpGoogleAccessSubnetwork( - String requestId, ProjectRegionSubnetworkName subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) .setSubnetworksSetPrivateIpGoogleAccessRequestResource( subnetworksSetPrivateIpGoogleAccessRequestResource) @@ -1140,36 +1015,24 @@ public final Operation setPrivateIpGoogleAccessSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
-   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(requestId, subnetwork.toString(), subnetworksSetPrivateIpGoogleAccessRequestResource);
+   *   Operation response = subnetworkClient.setPrivateIpGoogleAccessSubnetwork(subnetwork.toString(), subnetworksSetPrivateIpGoogleAccessRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param subnetwork Name of the Subnetwork resource. * @param subnetworksSetPrivateIpGoogleAccessRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setPrivateIpGoogleAccessSubnetwork( - String requestId, String subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource) { SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder() - .setRequestId(requestId) .setSubnetwork(subnetwork) .setSubnetworksSetPrivateIpGoogleAccessRequestResource( subnetworksSetPrivateIpGoogleAccessRequestResource) @@ -1186,11 +1049,9 @@ public final Operation setPrivateIpGoogleAccessSubnetwork( * *


    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
    *   SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource)
    *     .build();
@@ -1216,11 +1077,9 @@ public final Operation setPrivateIpGoogleAccessSubnetwork(
    *
    * 

    * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
    *   SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build();
    *   SetPrivateIpGoogleAccessSubnetworkHttpRequest request = SetPrivateIpGoogleAccessSubnetworkHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setSubnetwork(subnetwork.toString())
    *     .setSubnetworksSetPrivateIpGoogleAccessRequestResource(subnetworksSetPrivateIpGoogleAccessRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java
index 5c097934afd2..9de9d5baf1f1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private SubnetworkList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Subnetwork item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java
index 0c9326ec20bd..eb0308bdfc60 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private SubnetworkSecondaryRange(String ipCidrRange, String rangeName) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) {
-      fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange)));
-    }
-    if (fieldNames.contains("rangeName") && rangeName != null) {
-      fieldMap.put("rangeName", Collections.singletonList(String.valueOf(rangeName)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("ipCidrRange")) {
-      return String.valueOf(ipCidrRange);
+      return ipCidrRange;
     }
     if (fieldName.equals("rangeName")) {
-      return String.valueOf(rangeName);
+      return rangeName;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getIpCidrRange() {
     return ipCidrRange;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java
index 87ded433931a..ae59ff1ad14a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private SubnetworksExpandIpCidrRangeRequest(String ipCidrRange) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("ipCidrRange") && ipCidrRange != null) {
-      fieldMap.put("ipCidrRange", Collections.singletonList(String.valueOf(ipCidrRange)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("ipCidrRange")) {
+      return ipCidrRange;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("ipCidrRange")) {
-      return String.valueOf(ipCidrRange);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java
index 4e95dd289f18..5bfb6e7c1222 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private SubnetworksScopedList(List subnetworks, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("subnetworks") && subnetworks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Subnetwork item : subnetworks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("subnetworks", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("subnetworks")) {
-      return String.valueOf(subnetworks);
+      return subnetworks;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getSubnetworksList() {
     return subnetworks;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java
index 3a1b9d3b878a..e58dad72c307 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,27 +36,22 @@ private SubnetworksSetPrivateIpGoogleAccessRequest(Boolean privateIpGoogleAccess
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("privateIpGoogleAccess") && privateIpGoogleAccess != null) {
-      fieldMap.put(
-          "privateIpGoogleAccess",
-          Collections.singletonList(String.valueOf(privateIpGoogleAccess)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("privateIpGoogleAccess")) {
+      return privateIpGoogleAccess;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("privateIpGoogleAccess")) {
-      return String.valueOf(privateIpGoogleAccess);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java
index 9fa3349e9153..3d4356db6fef 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,66 +69,33 @@ private SwitchToCustomModeNetworkHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -143,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java
index 888316c44aff..81500de7a425 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -53,42 +49,21 @@ private TCPHealthCheck(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("port") && port != null) {
-      fieldMap.put("port", Collections.singletonList(String.valueOf(port)));
-    }
-    if (fieldNames.contains("portName") && portName != null) {
-      fieldMap.put("portName", Collections.singletonList(String.valueOf(portName)));
-    }
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
-    }
-    if (fieldNames.contains("request") && request != null) {
-      fieldMap.put("request", Collections.singletonList(String.valueOf(request)));
-    }
-    if (fieldNames.contains("response") && response != null) {
-      fieldMap.put("response", Collections.singletonList(String.valueOf(response)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("port")) {
-      return String.valueOf(port);
+      return port;
     }
     if (fieldName.equals("portName")) {
-      return String.valueOf(portName);
+      return portName;
     }
     if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
+      return proxyHeader;
     }
     if (fieldName.equals("request")) {
-      return String.valueOf(request);
+      return request;
     }
     if (fieldName.equals("response")) {
-      return String.valueOf(response);
+      return response;
     }
     return null;
   }
@@ -99,6 +74,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public Integer getPort() {
     return port;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java
index ac201c3f237e..ef6f6e0a939b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private Tags(String fingerprint, List items) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getFingerprint() {
     return fingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java
index 68c65cb2ee9c..8671056aade1 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -65,55 +61,27 @@ private TargetHttpProxy(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     return null;
   }
@@ -124,6 +92,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java
index db1c6e870004..c75e97f2647f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
- *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
+ *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
  * }
  * 
  * 
@@ -162,31 +161,19 @@ public TargetHttpProxyStub getStub() { * *

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
-   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpProxy( - String requestId, ProjectGlobalTargetHttpProxyName targetHttpProxy) { + public final Operation deleteTargetHttpProxy(ProjectGlobalTargetHttpProxyName targetHttpProxy) { DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) .build(); return deleteTargetHttpProxy(request); @@ -200,32 +187,19 @@ public final Operation deleteTargetHttpProxy( * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
-   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy.toString());
+   *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpProxy(String requestId, String targetHttpProxy) { + public final Operation deleteTargetHttpProxy(String targetHttpProxy) { DeleteTargetHttpProxyHttpRequest request = - DeleteTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetHttpProxy(targetHttpProxy) - .build(); + DeleteTargetHttpProxyHttpRequest.newBuilder().setTargetHttpProxy(targetHttpProxy).build(); return deleteTargetHttpProxy(request); } @@ -237,10 +211,8 @@ public final Operation deleteTargetHttpProxy(String requestId, String targetHttp * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
    *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(request);
@@ -263,10 +235,8 @@ public final Operation deleteTargetHttpProxy(DeleteTargetHttpProxyHttpRequest re
    *
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   DeleteTargetHttpProxyHttpRequest request = DeleteTargetHttpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetHttpProxyClient.deleteTargetHttpProxyCallable().futureCall(request);
@@ -393,22 +363,12 @@ public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest re
    *
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(requestId, project, targetHttpProxyResource);
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(project, targetHttpProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. * (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) @@ -416,11 +376,10 @@ public final TargetHttpProxy getTargetHttpProxy(GetTargetHttpProxyHttpRequest re */ @BetaApi public final Operation insertTargetHttpProxy( - String requestId, ProjectName project, TargetHttpProxy targetHttpProxyResource) { + ProjectName project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetHttpProxyResource(targetHttpProxyResource) .build(); @@ -436,22 +395,12 @@ public final Operation insertTargetHttpProxy( * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(requestId, project.toString(), targetHttpProxyResource);
+   *   Operation response = targetHttpProxyClient.insertTargetHttpProxy(project.toString(), targetHttpProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetHttpProxyResource A TargetHttpProxy resource. This resource defines an HTTP proxy. * (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) @@ -459,11 +408,10 @@ public final Operation insertTargetHttpProxy( */ @BetaApi public final Operation insertTargetHttpProxy( - String requestId, String project, TargetHttpProxy targetHttpProxyResource) { + String project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setTargetHttpProxyResource(targetHttpProxyResource) .build(); @@ -479,11 +427,9 @@ public final Operation insertTargetHttpProxy( * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
    *   InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpProxyResource(targetHttpProxyResource)
    *     .build();
@@ -508,11 +454,9 @@ public final Operation insertTargetHttpProxy(InsertTargetHttpProxyHttpRequest re
    *
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
    *   InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpProxyResource(targetHttpProxyResource)
    *     .build();
@@ -674,35 +618,22 @@ public final ListTargetHttpProxiesPagedResponse listTargetHttpProxies(
    *
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource);
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setUrlMapTargetHttpProxy( - String requestId, - ProjectTargetHttpProxyName targetHttpProxy, - UrlMapReference urlMapReferenceResource) { + ProjectTargetHttpProxyName targetHttpProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy == null ? null : targetHttpProxy.toString()) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); @@ -717,33 +648,22 @@ public final Operation setUrlMapTargetHttpProxy( * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(requestId, targetHttpProxy.toString(), urlMapReferenceResource);
+   *   Operation response = targetHttpProxyClient.setUrlMapTargetHttpProxy(targetHttpProxy.toString(), urlMapReferenceResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetHttpProxy Name of the TargetHttpProxy to set a URL map for. * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setUrlMapTargetHttpProxy( - String requestId, String targetHttpProxy, UrlMapReference urlMapReferenceResource) { + String targetHttpProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetHttpProxy(targetHttpProxy) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); @@ -758,11 +678,9 @@ public final Operation setUrlMapTargetHttpProxy( * *


    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
@@ -786,11 +704,9 @@ public final Operation setUrlMapTargetHttpProxy(SetUrlMapTargetHttpProxyHttpRequ
    *
    * 

    * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpProxyHttpRequest request = SetUrlMapTargetHttpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetHttpProxy(targetHttpProxy.toString())
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java
index 9d7c1cd4ac3c..550e9be4b4c6 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetHttpProxyList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetHttpProxy item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java
index 498d2a85d90c..5b59aff31e11 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TargetHttpsProxiesSetSslCertificatesRequest(List sslCertificates
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("sslCertificates") && sslCertificates != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sslCertificates) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sslCertificates", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("sslCertificates")) {
+      return sslCertificates;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("sslCertificates")) {
-      return String.valueOf(sslCertificates);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java
index fb8271a9a200..357612eca81f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -75,71 +70,33 @@ private TargetHttpsProxy(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sslCertificates") && sslCertificates != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sslCertificates) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sslCertificates", stringList.build());
-    }
-    if (fieldNames.contains("sslPolicy") && sslPolicy != null) {
-      fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sslCertificates")) {
-      return String.valueOf(sslCertificates);
+      return sslCertificates;
     }
     if (fieldName.equals("sslPolicy")) {
-      return String.valueOf(sslPolicy);
+      return sslPolicy;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     return null;
   }
@@ -150,6 +107,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
index 761464a474a3..0c203e55a67f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java
@@ -43,8 +43,7 @@
  * 
  * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
  *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
- *   String requestId = "";
- *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
+ *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
  * }
  * 
  * 
@@ -163,31 +162,20 @@ public TargetHttpsProxyStub getStub() { *

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
-   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId);
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteTargetHttpsProxy( - ProjectGlobalTargetHttpsProxyName targetHttpsProxy, String requestId) { + ProjectGlobalTargetHttpsProxyName targetHttpsProxy) { DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) .build(); return deleteTargetHttpsProxy(request); } @@ -201,30 +189,19 @@ public final Operation deleteTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
-   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString(), requestId);
+   *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy.toString());
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetHttpsProxy(String targetHttpsProxy, String requestId) { + public final Operation deleteTargetHttpsProxy(String targetHttpsProxy) { DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) .build(); return deleteTargetHttpsProxy(request); } @@ -238,10 +215,8 @@ public final Operation deleteTargetHttpsProxy(String targetHttpsProxy, String re *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(request);
    * }
@@ -264,10 +239,8 @@ public final Operation deleteTargetHttpsProxy(DeleteTargetHttpsProxyHttpRequest
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   DeleteTargetHttpsProxyHttpRequest request = DeleteTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.deleteTargetHttpsProxyCallable().futureCall(request);
    *   // Do something
@@ -393,22 +366,12 @@ public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest
    *
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(requestId, project, targetHttpsProxyResource);
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(project, targetHttpsProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS * proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies @@ -417,11 +380,10 @@ public final TargetHttpsProxy getTargetHttpsProxy(GetTargetHttpsProxyHttpRequest */ @BetaApi public final Operation insertTargetHttpsProxy( - String requestId, ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { + ProjectName project, TargetHttpsProxy targetHttpsProxyResource) { InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetHttpsProxyResource(targetHttpsProxyResource) .build(); @@ -437,22 +399,12 @@ public final Operation insertTargetHttpsProxy( * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(requestId, project.toString(), targetHttpsProxyResource);
+   *   Operation response = targetHttpsProxyClient.insertTargetHttpsProxy(project.toString(), targetHttpsProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetHttpsProxyResource A TargetHttpsProxy resource. This resource defines an HTTPS * proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies @@ -461,11 +413,10 @@ public final Operation insertTargetHttpsProxy( */ @BetaApi public final Operation insertTargetHttpsProxy( - String requestId, String project, TargetHttpsProxy targetHttpsProxyResource) { + String project, TargetHttpsProxy targetHttpsProxyResource) { InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setTargetHttpsProxyResource(targetHttpsProxyResource) .build(); @@ -481,11 +432,9 @@ public final Operation insertTargetHttpsProxy( * *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
    *   InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpsProxyResource(targetHttpsProxyResource)
    *     .build();
@@ -510,11 +459,9 @@ public final Operation insertTargetHttpsProxy(InsertTargetHttpsProxyHttpRequest
    *
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build();
    *   InsertTargetHttpsProxyHttpRequest request = InsertTargetHttpsProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetHttpsProxyResource(targetHttpsProxyResource)
    *     .build();
@@ -677,37 +624,25 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies(
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates * resource for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetHttpsProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslCertificatesTargetHttpsProxy( ProjectTargetHttpsProxyName targetHttpsProxy, - String requestId, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) .setTargetHttpsProxiesSetSslCertificatesRequestResource( targetHttpsProxiesSetSslCertificatesRequestResource) .build(); @@ -723,37 +658,25 @@ public final Operation setSslCertificatesTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy.toString(), requestId, targetHttpsProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(targetHttpsProxy.toString(), targetHttpsProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates * resource for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetHttpsProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslCertificatesTargetHttpsProxy( String targetHttpsProxy, - String requestId, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) .setTargetHttpsProxiesSetSslCertificatesRequestResource( targetHttpsProxiesSetSslCertificatesRequestResource) .build(); @@ -769,11 +692,9 @@ public final Operation setSslCertificatesTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   Operation response = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxy(request);
@@ -798,11 +719,9 @@ public final Operation setSslCertificatesTargetHttpsProxy(
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetHttpsProxyHttpRequest request = SetSslCertificatesTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetHttpsProxiesSetSslCertificatesRequestResource(targetHttpsProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.setSslCertificatesTargetHttpsProxyCallable().futureCall(request);
@@ -828,36 +747,24 @@ public final Operation setSslCertificatesTargetHttpsProxy(
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(targetHttpsProxy, requestId, sslPolicyReferenceResource);
+   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(targetHttpsProxy, sslPolicyReferenceResource);
    * }
    * 
* * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicyReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslPolicyTargetHttpsProxy( ProjectGlobalTargetHttpsProxyName targetHttpsProxy, - String requestId, SslPolicyReference sslPolicyReferenceResource) { SetSslPolicyTargetHttpsProxyHttpRequest request = SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) .setSslPolicyReferenceResource(sslPolicyReferenceResource) .build(); return setSslPolicyTargetHttpsProxy(request); @@ -874,34 +781,23 @@ public final Operation setSslPolicyTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(targetHttpsProxy.toString(), requestId, sslPolicyReferenceResource);
+   *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(targetHttpsProxy.toString(), sslPolicyReferenceResource);
    * }
    * 
* * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicyReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslPolicyTargetHttpsProxy( - String targetHttpsProxy, String requestId, SslPolicyReference sslPolicyReferenceResource) { + String targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource) { SetSslPolicyTargetHttpsProxyHttpRequest request = SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) .setSslPolicyReferenceResource(sslPolicyReferenceResource) .build(); return setSslPolicyTargetHttpsProxy(request); @@ -918,11 +814,9 @@ public final Operation setSslPolicyTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
    *   SetSslPolicyTargetHttpsProxyHttpRequest request = SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
    *     .build();
    *   Operation response = targetHttpsProxyClient.setSslPolicyTargetHttpsProxy(request);
@@ -949,11 +843,9 @@ public final Operation setSslPolicyTargetHttpsProxy(
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
    *   SetSslPolicyTargetHttpsProxyHttpRequest request = SetSslPolicyTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.setSslPolicyTargetHttpsProxyCallable().futureCall(request);
@@ -977,35 +869,22 @@ public final Operation setSslPolicyTargetHttpsProxy(
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource);
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setUrlMapTargetHttpsProxy( - ProjectTargetHttpsProxyName targetHttpsProxy, - String requestId, - UrlMapReference urlMapReferenceResource) { + ProjectTargetHttpsProxyName targetHttpsProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) - .setRequestId(requestId) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); return setUrlMapTargetHttpsProxy(request); @@ -1020,33 +899,22 @@ public final Operation setUrlMapTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
-   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy.toString(), requestId, urlMapReferenceResource);
+   *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(targetHttpsProxy.toString(), urlMapReferenceResource);
    * }
    * 
* * @param targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param urlMapReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setUrlMapTargetHttpsProxy( - String targetHttpsProxy, String requestId, UrlMapReference urlMapReferenceResource) { + String targetHttpsProxy, UrlMapReference urlMapReferenceResource) { SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder() .setTargetHttpsProxy(targetHttpsProxy) - .setRequestId(requestId) .setUrlMapReferenceResource(urlMapReferenceResource) .build(); return setUrlMapTargetHttpsProxy(request); @@ -1061,11 +929,9 @@ public final Operation setUrlMapTargetHttpsProxy( *


    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
    *   Operation response = targetHttpsProxyClient.setUrlMapTargetHttpsProxy(request);
@@ -1089,11 +955,9 @@ public final Operation setUrlMapTargetHttpsProxy(SetUrlMapTargetHttpsProxyHttpRe
    * 

    * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
    *   ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
-   *   String requestId = "";
    *   UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
    *   SetUrlMapTargetHttpsProxyHttpRequest request = SetUrlMapTargetHttpsProxyHttpRequest.newBuilder()
    *     .setTargetHttpsProxy(targetHttpsProxy.toString())
-   *     .setRequestId(requestId)
    *     .setUrlMapReferenceResource(urlMapReferenceResource)
    *     .build();
    *   ApiFuture<Operation> future = targetHttpsProxyClient.setUrlMapTargetHttpsProxyCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
index 634c86cfb5fa..e113c6e2b09d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetHttpsProxyList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetHttpsProxy item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java
index 2a90d043466a..ae3f4b5cc9ae 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,67 +69,33 @@ private TargetInstance(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("natPolicy") && natPolicy != null) {
-      fieldMap.put("natPolicy", Collections.singletonList(String.valueOf(natPolicy)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("natPolicy")) {
-      return String.valueOf(natPolicy);
+      return natPolicy;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -144,6 +106,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java
index 8a1ed62c3cbb..b53ae8011727 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private TargetInstanceAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
index 822058e866a8..a705ea5fe8ef 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
- *   String requestId = "";
  *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
- *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
+ *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
  * }
  * 
  * 
@@ -302,31 +301,19 @@ public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInst * *

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
-   *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
+   *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetInstance Name of the TargetInstance resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetInstance( - String requestId, ProjectZoneTargetInstanceName targetInstance) { + public final Operation deleteTargetInstance(ProjectZoneTargetInstanceName targetInstance) { DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetInstance(targetInstance == null ? null : targetInstance.toString()) .build(); return deleteTargetInstance(request); @@ -340,32 +327,19 @@ public final Operation deleteTargetInstance( * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
-   *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance.toString());
+   *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetInstance Name of the TargetInstance resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetInstance(String requestId, String targetInstance) { + public final Operation deleteTargetInstance(String targetInstance) { DeleteTargetInstanceHttpRequest request = - DeleteTargetInstanceHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetInstance(targetInstance) - .build(); + DeleteTargetInstanceHttpRequest.newBuilder().setTargetInstance(targetInstance).build(); return deleteTargetInstance(request); } @@ -377,10 +351,8 @@ public final Operation deleteTargetInstance(String requestId, String targetInsta * *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetInstance(targetInstance.toString())
    *     .build();
    *   Operation response = targetInstanceClient.deleteTargetInstance(request);
@@ -403,10 +375,8 @@ public final Operation deleteTargetInstance(DeleteTargetInstanceHttpRequest requ
    *
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
-   *   String requestId = "";
    *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
    *   DeleteTargetInstanceHttpRequest request = DeleteTargetInstanceHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetInstance(targetInstance.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetInstanceClient.deleteTargetInstanceCallable().futureCall(request);
@@ -533,22 +503,12 @@ public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest reque
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
-   *   Operation response = targetInstanceClient.insertTargetInstance(zone, requestId, targetInstanceResource);
+   *   Operation response = targetInstanceClient.insertTargetInstance(zone, targetInstanceResource);
    * }
    * 
* * @param zone Name of the zone scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint * instance that terminates traffic of certain protocols. (== resource_for * beta.targetInstances ==) (== resource_for v1.targetInstances ==) @@ -556,12 +516,11 @@ public final TargetInstance getTargetInstance(GetTargetInstanceHttpRequest reque */ @BetaApi public final Operation insertTargetInstance( - ProjectZoneName zone, String requestId, TargetInstance targetInstanceResource) { + ProjectZoneName zone, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() .setZone(zone == null ? null : zone.toString()) - .setRequestId(requestId) .setTargetInstanceResource(targetInstanceResource) .build(); return insertTargetInstance(request); @@ -577,35 +536,23 @@ public final Operation insertTargetInstance( *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
-   *   Operation response = targetInstanceClient.insertTargetInstance(zone.toString(), requestId, targetInstanceResource);
+   *   Operation response = targetInstanceClient.insertTargetInstance(zone.toString(), targetInstanceResource);
    * }
    * 
* * @param zone Name of the zone scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetInstanceResource A TargetInstance resource. This resource defines an endpoint * instance that terminates traffic of certain protocols. (== resource_for * beta.targetInstances ==) (== resource_for v1.targetInstances ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetInstance( - String zone, String requestId, TargetInstance targetInstanceResource) { + public final Operation insertTargetInstance(String zone, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() .setZone(zone) - .setRequestId(requestId) .setTargetInstanceResource(targetInstanceResource) .build(); return insertTargetInstance(request); @@ -621,11 +568,9 @@ public final Operation insertTargetInstance( *


    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setTargetInstanceResource(targetInstanceResource)
    *     .build();
    *   Operation response = targetInstanceClient.insertTargetInstance(request);
@@ -650,11 +595,9 @@ public final Operation insertTargetInstance(InsertTargetInstanceHttpRequest requ
    * 

    * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
    *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
-   *   String requestId = "";
    *   TargetInstance targetInstanceResource = TargetInstance.newBuilder().build();
    *   InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder()
    *     .setZone(zone.toString())
-   *     .setRequestId(requestId)
    *     .setTargetInstanceResource(targetInstanceResource)
    *     .build();
    *   ApiFuture<Operation> future = targetInstanceClient.insertTargetInstanceCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java
index 62be4396490b..991a0d378693 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetInstanceList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetInstance item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java
index 6841771a144c..64398288fc9b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private TargetInstancesScopedList(List targetInstances, Warning
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("targetInstances") && targetInstances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetInstance item : targetInstances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetInstances", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("targetInstances")) {
-      return String.valueOf(targetInstances);
+      return targetInstances;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getTargetInstancesList() {
     return targetInstances;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java
index 449ec391fcfc..eec752881690 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -87,93 +82,42 @@ private TargetPool(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("backupPool") && backupPool != null) {
-      fieldMap.put("backupPool", Collections.singletonList(String.valueOf(backupPool)));
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("failoverRatio") && failoverRatio != null) {
-      fieldMap.put("failoverRatio", Collections.singletonList(String.valueOf(failoverRatio)));
-    }
-    if (fieldNames.contains("healthChecks") && healthChecks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : healthChecks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("healthChecks", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sessionAffinity") && sessionAffinity != null) {
-      fieldMap.put("sessionAffinity", Collections.singletonList(String.valueOf(sessionAffinity)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("backupPool")) {
-      return String.valueOf(backupPool);
+      return backupPool;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("failoverRatio")) {
-      return String.valueOf(failoverRatio);
+      return failoverRatio;
     }
     if (fieldName.equals("healthChecks")) {
-      return String.valueOf(healthChecks);
+      return healthChecks;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
+      return instances;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sessionAffinity")) {
-      return String.valueOf(sessionAffinity);
+      return sessionAffinity;
     }
     return null;
   }
@@ -184,6 +128,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getBackupPool() {
     return backupPool;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java
index 534839707fa1..52e333905b9f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private TargetPoolAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
index 022065be3154..1b12d6b30d66 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java
@@ -43,9 +43,8 @@
  * 
  * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
  *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
- *   String requestId = "";
  *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
- *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
+ *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
  * }
  * 
  * 
@@ -161,35 +160,23 @@ public TargetPoolStub getStub() { *

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to add a health check to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addHealthCheckTargetPool( ProjectRegionTargetPoolName targetPool, - String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) .build(); return addHealthCheckTargetPool(request); @@ -204,35 +191,23 @@ public final Operation addHealthCheckTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool.toString(), requestId, targetPoolsAddHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool.toString(), targetPoolsAddHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to add a health check to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addHealthCheckTargetPool( String targetPool, - String requestId, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource) { AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) - .setRequestId(requestId) .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource) .build(); return addHealthCheckTargetPool(request); @@ -247,11 +222,9 @@ public final Operation addHealthCheckTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.addHealthCheckTargetPool(request);
@@ -275,11 +248,9 @@ public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequ
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build();
    *   AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsAddHealthCheckRequestResource(targetPoolsAddHealthCheckRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.addHealthCheckTargetPoolCallable().futureCall(request);
@@ -303,35 +274,23 @@ public final Operation addHealthCheckTargetPool(AddHealthCheckTargetPoolHttpRequ
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource);
+   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to add instances to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addInstanceTargetPool( ProjectRegionTargetPoolName targetPool, - String requestId, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) .build(); return addInstanceTargetPool(request); @@ -346,35 +305,22 @@ public final Operation addInstanceTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool.toString(), requestId, targetPoolsAddInstanceRequestResource);
+   *   Operation response = targetPoolClient.addInstanceTargetPool(targetPool.toString(), targetPoolsAddInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to add instances to. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsAddInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation addInstanceTargetPool( - String targetPool, - String requestId, - TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { + String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource) { AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) - .setRequestId(requestId) .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource) .build(); return addInstanceTargetPool(request); @@ -389,11 +335,9 @@ public final Operation addInstanceTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.addInstanceTargetPool(request);
@@ -417,11 +361,9 @@ public final Operation addInstanceTargetPool(AddInstanceTargetPoolHttpRequest re
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build();
    *   AddInstanceTargetPoolHttpRequest request = AddInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsAddInstanceRequestResource(targetPoolsAddInstanceRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.addInstanceTargetPoolCallable().futureCall(request);
@@ -585,31 +527,19 @@ public final AggregatedListTargetPoolsPagedResponse aggregatedListTargetPools(
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
-   *   Operation response = targetPoolClient.deleteTargetPool(targetPool, requestId);
+   *   Operation response = targetPoolClient.deleteTargetPool(targetPool);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetPool( - ProjectRegionTargetPoolName targetPool, String requestId) { + public final Operation deleteTargetPool(ProjectRegionTargetPoolName targetPool) { DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) .build(); return deleteTargetPool(request); } @@ -623,31 +553,18 @@ public final Operation deleteTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
-   *   Operation response = targetPoolClient.deleteTargetPool(targetPool.toString(), requestId);
+   *   Operation response = targetPoolClient.deleteTargetPool(targetPool.toString());
    * }
    * 
* * @param targetPool Name of the TargetPool resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetPool(String targetPool, String requestId) { + public final Operation deleteTargetPool(String targetPool) { DeleteTargetPoolHttpRequest request = - DeleteTargetPoolHttpRequest.newBuilder() - .setTargetPool(targetPool) - .setRequestId(requestId) - .build(); + DeleteTargetPoolHttpRequest.newBuilder().setTargetPool(targetPool).build(); return deleteTargetPool(request); } @@ -660,10 +577,8 @@ public final Operation deleteTargetPool(String targetPool, String requestId) { *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = targetPoolClient.deleteTargetPool(request);
    * }
@@ -686,10 +601,8 @@ public final Operation deleteTargetPool(DeleteTargetPoolHttpRequest request) {
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   DeleteTargetPoolHttpRequest request = DeleteTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.deleteTargetPoolCallable().futureCall(request);
    *   // Do something
@@ -929,22 +842,12 @@ public final TargetPoolInstanceHealth getHealthTargetPool(
    *
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
-   *   Operation response = targetPoolClient.insertTargetPool(requestId, region, targetPoolResource);
+   *   Operation response = targetPoolClient.insertTargetPool(region, targetPoolResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an * associated HttpHealthCheck resource, and the fallback target pool. (== resource_for @@ -952,12 +855,10 @@ public final TargetPoolInstanceHealth getHealthTargetPool( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetPool( - String requestId, ProjectRegionName region, TargetPool targetPoolResource) { + public final Operation insertTargetPool(ProjectRegionName region, TargetPool targetPoolResource) { InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setTargetPoolResource(targetPoolResource) .build(); @@ -973,22 +874,12 @@ public final Operation insertTargetPool( * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
-   *   Operation response = targetPoolClient.insertTargetPool(requestId, region.toString(), targetPoolResource);
+   *   Operation response = targetPoolClient.insertTargetPool(region.toString(), targetPoolResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region scoping this request. * @param targetPoolResource A TargetPool resource. This resource defines a pool of instances, an * associated HttpHealthCheck resource, and the fallback target pool. (== resource_for @@ -996,12 +887,10 @@ public final Operation insertTargetPool( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertTargetPool( - String requestId, String region, TargetPool targetPoolResource) { + public final Operation insertTargetPool(String region, TargetPool targetPoolResource) { InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setTargetPoolResource(targetPoolResource) .build(); @@ -1017,11 +906,9 @@ public final Operation insertTargetPool( * *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetPoolResource(targetPoolResource)
    *     .build();
@@ -1046,11 +933,9 @@ public final Operation insertTargetPool(InsertTargetPoolHttpRequest request) {
    *
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetPool targetPoolResource = TargetPool.newBuilder().build();
    *   InsertTargetPoolHttpRequest request = InsertTargetPoolHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetPoolResource(targetPoolResource)
    *     .build();
@@ -1210,35 +1095,23 @@ public final UnaryCallable listTarge
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to remove health checks from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation removeHealthCheckTargetPool( ProjectRegionTargetPoolName targetPool, - String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) .setTargetPoolsRemoveHealthCheckRequestResource( targetPoolsRemoveHealthCheckRequestResource) .build(); @@ -1254,35 +1127,23 @@ public final Operation removeHealthCheckTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool.toString(), requestId, targetPoolsRemoveHealthCheckRequestResource);
+   *   Operation response = targetPoolClient.removeHealthCheckTargetPool(targetPool.toString(), targetPoolsRemoveHealthCheckRequestResource);
    * }
    * 
* * @param targetPool Name of the target pool to remove health checks from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveHealthCheckRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation removeHealthCheckTargetPool( String targetPool, - String requestId, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource) { RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) - .setRequestId(requestId) .setTargetPoolsRemoveHealthCheckRequestResource( targetPoolsRemoveHealthCheckRequestResource) .build(); @@ -1298,11 +1159,9 @@ public final Operation removeHealthCheckTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.removeHealthCheckTargetPool(request);
@@ -1327,11 +1186,9 @@ public final Operation removeHealthCheckTargetPool(
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
    *   RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveHealthCheckRequestResource(targetPoolsRemoveHealthCheckRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.removeHealthCheckTargetPoolCallable().futureCall(request);
@@ -1355,35 +1212,23 @@ public final Operation removeHealthCheckTargetPool(
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool, requestId, targetPoolsRemoveInstanceRequestResource);
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to remove instances from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation removeInstanceTargetPool( ProjectRegionTargetPoolName targetPool, - String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) .build(); return removeInstanceTargetPool(request); @@ -1398,35 +1243,23 @@ public final Operation removeInstanceTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
-   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool.toString(), requestId, targetPoolsRemoveInstanceRequestResource);
+   *   Operation response = targetPoolClient.removeInstanceTargetPool(targetPool.toString(), targetPoolsRemoveInstanceRequestResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to remove instances from. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetPoolsRemoveInstanceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation removeInstanceTargetPool( String targetPool, - String requestId, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource) { RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) - .setRequestId(requestId) .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource) .build(); return removeInstanceTargetPool(request); @@ -1441,11 +1274,9 @@ public final Operation removeInstanceTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource)
    *     .build();
    *   Operation response = targetPoolClient.removeInstanceTargetPool(request);
@@ -1469,11 +1300,9 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build();
    *   RemoveInstanceTargetPoolHttpRequest request = RemoveInstanceTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setTargetPoolsRemoveInstanceRequestResource(targetPoolsRemoveInstanceRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetPoolClient.removeInstanceTargetPoolCallable().futureCall(request);
@@ -1497,23 +1326,13 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool, requestId, failoverRatio, targetReferenceResource);
+   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to set a backup pool for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param failoverRatio New failoverRatio value for the target pool. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1521,14 +1340,12 @@ public final Operation removeInstanceTargetPool(RemoveInstanceTargetPoolHttpRequ @BetaApi public final Operation setBackupTargetPool( ProjectRegionTargetPoolName targetPool, - String requestId, Float failoverRatio, TargetReference targetReferenceResource) { SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool == null ? null : targetPool.toString()) - .setRequestId(requestId) .setFailoverRatio(failoverRatio) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -1544,38 +1361,24 @@ public final Operation setBackupTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
-   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool.toString(), requestId, failoverRatio, targetReferenceResource);
+   *   Operation response = targetPoolClient.setBackupTargetPool(targetPool.toString(), failoverRatio, targetReferenceResource);
    * }
    * 
* * @param targetPool Name of the TargetPool resource to set a backup pool for. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param failoverRatio New failoverRatio value for the target pool. * @param targetReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setBackupTargetPool( - String targetPool, - String requestId, - Float failoverRatio, - TargetReference targetReferenceResource) { + String targetPool, Float failoverRatio, TargetReference targetReferenceResource) { SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder() .setTargetPool(targetPool) - .setRequestId(requestId) .setFailoverRatio(failoverRatio) .setTargetReferenceResource(targetReferenceResource) .build(); @@ -1591,12 +1394,10 @@ public final Operation setBackupTargetPool( *


    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setFailoverRatio(failoverRatio)
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
@@ -1621,12 +1422,10 @@ public final Operation setBackupTargetPool(SetBackupTargetPoolHttpRequest reques
    * 

    * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
    *   ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]");
-   *   String requestId = "";
    *   Float failoverRatio = 0;
    *   TargetReference targetReferenceResource = TargetReference.newBuilder().build();
    *   SetBackupTargetPoolHttpRequest request = SetBackupTargetPoolHttpRequest.newBuilder()
    *     .setTargetPool(targetPool.toString())
-   *     .setRequestId(requestId)
    *     .setFailoverRatio(failoverRatio)
    *     .setTargetReferenceResource(targetReferenceResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java
index de34cf340414..4cf8e8c1d042 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private TargetPoolInstanceHealth(List healthStatus, String kind) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("healthStatus") && healthStatus != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HealthStatus item : healthStatus) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("healthStatus", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("healthStatus")) {
-      return String.valueOf(healthStatus);
+      return healthStatus;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getHealthStatusList() {
     return healthStatus;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java
index a79ad4673848..60e4057ef6b9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetPoolList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetPool item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java
index dc49f449a4b9..d572f8a1be3f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TargetPoolsAddHealthCheckRequest(List healthChecks
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("healthChecks") && healthChecks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HealthCheckReference item : healthChecks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("healthChecks", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("healthChecks")) {
+      return healthChecks;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("healthChecks")) {
-      return String.valueOf(healthChecks);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java
index be52b4653521..5899ad2cbe74 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TargetPoolsAddInstanceRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceReference item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java
index 400b6fcc3f6a..dbeb40723bee 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TargetPoolsRemoveHealthCheckRequest(List healthChe
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("healthChecks") && healthChecks != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HealthCheckReference item : healthChecks) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("healthChecks", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("healthChecks")) {
+      return healthChecks;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("healthChecks")) {
-      return String.valueOf(healthChecks);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java
index c03b31fd48cd..3d0c875689d7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TargetPoolsRemoveInstanceRequest(List instances) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("instances") && instances != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (InstanceReference item : instances) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("instances", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("instances")) {
+      return instances;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("instances")) {
-      return String.valueOf(instances);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java
index 79bc8b5e8db6..8604dac74615 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private TargetPoolsScopedList(List targetPools, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("targetPools") && targetPools != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetPool item : targetPools) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetPools", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("targetPools")) {
-      return String.valueOf(targetPools);
+      return targetPools;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getTargetPoolsList() {
     return targetPools;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java
index c9282e24fafa..aafe660140e9 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private TargetReference(String target) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("target") && target != null) {
-      fieldMap.put("target", Collections.singletonList(String.valueOf(target)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("target")) {
+      return target;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("target")) {
-      return String.valueOf(target);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java
index 5e811f2cc921..93585948f5dc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private TargetSslProxiesSetBackendServiceRequest(String service) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("service") && service != null) {
-      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("service")) {
+      return service;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("service")) {
-      return String.valueOf(service);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java
index 5f1c1b9fc9b9..98dc4bf88056 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private TargetSslProxiesSetProxyHeaderRequest(String proxyHeader) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("proxyHeader")) {
+      return proxyHeader;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java
index 9c9b7e8edafc..922cf0239499 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TargetSslProxiesSetSslCertificatesRequest(List sslCertificates)
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("sslCertificates") && sslCertificates != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sslCertificates) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sslCertificates", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("sslCertificates")) {
+      return sslCertificates;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("sslCertificates")) {
-      return String.valueOf(sslCertificates);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java
index e0462ced07cf..d832bec89020 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,77 +74,36 @@ private TargetSslProxy(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("service") && service != null) {
-      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
-    }
-    if (fieldNames.contains("sslCertificates") && sslCertificates != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : sslCertificates) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("sslCertificates", stringList.build());
-    }
-    if (fieldNames.contains("sslPolicy") && sslPolicy != null) {
-      fieldMap.put("sslPolicy", Collections.singletonList(String.valueOf(sslPolicy)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
+      return proxyHeader;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("service")) {
-      return String.valueOf(service);
+      return service;
     }
     if (fieldName.equals("sslCertificates")) {
-      return String.valueOf(sslCertificates);
+      return sslCertificates;
     }
     if (fieldName.equals("sslPolicy")) {
-      return String.valueOf(sslPolicy);
+      return sslPolicy;
     }
     return null;
   }
@@ -160,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
index a96e1ca34053..e4987c986f75 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java
@@ -43,8 +43,7 @@
  * 
  * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
  *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
- *   String requestId = "";
- *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
+ *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
  * }
  * 
  * 
@@ -162,31 +161,19 @@ public TargetSslProxyStub getStub() { *

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
-   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId);
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetSslProxy( - ProjectGlobalTargetSslProxyName targetSslProxy, String requestId) { + public final Operation deleteTargetSslProxy(ProjectGlobalTargetSslProxyName targetSslProxy) { DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) .build(); return deleteTargetSslProxy(request); } @@ -200,31 +187,18 @@ public final Operation deleteTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
-   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString(), requestId);
+   *   Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy.toString());
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetSslProxy(String targetSslProxy, String requestId) { + public final Operation deleteTargetSslProxy(String targetSslProxy) { DeleteTargetSslProxyHttpRequest request = - DeleteTargetSslProxyHttpRequest.newBuilder() - .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) - .build(); + DeleteTargetSslProxyHttpRequest.newBuilder().setTargetSslProxy(targetSslProxy).build(); return deleteTargetSslProxy(request); } @@ -237,10 +211,8 @@ public final Operation deleteTargetSslProxy(String targetSslProxy, String reques *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = targetSslProxyClient.deleteTargetSslProxy(request);
    * }
@@ -263,10 +235,8 @@ public final Operation deleteTargetSslProxy(DeleteTargetSslProxyHttpRequest requ
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   DeleteTargetSslProxyHttpRequest request = DeleteTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.deleteTargetSslProxyCallable().futureCall(request);
    *   // Do something
@@ -391,22 +361,12 @@ public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest reque
    *
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
-   *   Operation response = targetSslProxyClient.insertTargetSslProxy(requestId, project, targetSslProxyResource);
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(project, targetSslProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. * (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) @@ -414,11 +374,10 @@ public final TargetSslProxy getTargetSslProxy(GetTargetSslProxyHttpRequest reque */ @BetaApi public final Operation insertTargetSslProxy( - String requestId, ProjectName project, TargetSslProxy targetSslProxyResource) { + ProjectName project, TargetSslProxy targetSslProxyResource) { InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetSslProxyResource(targetSslProxyResource) .build(); @@ -434,22 +393,12 @@ public final Operation insertTargetSslProxy( * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
-   *   Operation response = targetSslProxyClient.insertTargetSslProxy(requestId, project.toString(), targetSslProxyResource);
+   *   Operation response = targetSslProxyClient.insertTargetSslProxy(project.toString(), targetSslProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetSslProxyResource A TargetSslProxy resource. This resource defines an SSL proxy. * (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) @@ -457,11 +406,10 @@ public final Operation insertTargetSslProxy( */ @BetaApi public final Operation insertTargetSslProxy( - String requestId, String project, TargetSslProxy targetSslProxyResource) { + String project, TargetSslProxy targetSslProxyResource) { InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setTargetSslProxyResource(targetSslProxyResource) .build(); @@ -477,11 +425,9 @@ public final Operation insertTargetSslProxy( * *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
    *   InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetSslProxyResource(targetSslProxyResource)
    *     .build();
@@ -506,11 +452,9 @@ public final Operation insertTargetSslProxy(InsertTargetSslProxyHttpRequest requ
    *
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build();
    *   InsertTargetSslProxyHttpRequest request = InsertTargetSslProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetSslProxyResource(targetSslProxyResource)
    *     .build();
@@ -673,36 +617,24 @@ public final ListTargetSslProxiesPagedResponse listTargetSslProxies(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource);
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy, targetSslProxiesSetBackendServiceRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to * be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setBackendServiceTargetSslProxy( ProjectGlobalTargetSslProxyName targetSslProxy, - String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) .setTargetSslProxiesSetBackendServiceRequestResource( targetSslProxiesSetBackendServiceRequestResource) .build(); @@ -718,36 +650,24 @@ public final Operation setBackendServiceTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetBackendServiceRequestResource);
+   *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetBackendServiceRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to * be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetBackendServiceRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setBackendServiceTargetSslProxy( String targetSslProxy, - String requestId, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) .setTargetSslProxiesSetBackendServiceRequestResource( targetSslProxiesSetBackendServiceRequestResource) .build(); @@ -763,11 +683,9 @@ public final Operation setBackendServiceTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setBackendServiceTargetSslProxy(request);
@@ -792,11 +710,9 @@ public final Operation setBackendServiceTargetSslProxy(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetSslProxyHttpRequest request = SetBackendServiceTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetBackendServiceRequestResource(targetSslProxiesSetBackendServiceRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setBackendServiceTargetSslProxyCallable().futureCall(request);
@@ -820,35 +736,23 @@ public final Operation setBackendServiceTargetSslProxy(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource);
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setProxyHeaderTargetSslProxy( ProjectGlobalTargetSslProxyName targetSslProxy, - String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) .setTargetSslProxiesSetProxyHeaderRequestResource( targetSslProxiesSetProxyHeaderRequestResource) .build(); @@ -864,35 +768,23 @@ public final Operation setProxyHeaderTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetProxyHeaderRequestResource);
+   *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetProxyHeaderRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setProxyHeaderTargetSslProxy( String targetSslProxy, - String requestId, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) .setTargetSslProxiesSetProxyHeaderRequestResource( targetSslProxiesSetProxyHeaderRequestResource) .build(); @@ -908,11 +800,9 @@ public final Operation setProxyHeaderTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setProxyHeaderTargetSslProxy(request);
@@ -937,11 +827,9 @@ public final Operation setProxyHeaderTargetSslProxy(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetSslProxyHttpRequest request = SetProxyHeaderTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetProxyHeaderRequestResource(targetSslProxiesSetProxyHeaderRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setProxyHeaderTargetSslProxyCallable().futureCall(request);
@@ -965,36 +853,24 @@ public final Operation setProxyHeaderTargetSslProxy(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to * be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslCertificatesTargetSslProxy( ProjectGlobalTargetSslProxyName targetSslProxy, - String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) .setTargetSslProxiesSetSslCertificatesRequestResource( targetSslProxiesSetSslCertificatesRequestResource) .build(); @@ -1010,36 +886,24 @@ public final Operation setSslCertificatesTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), requestId, targetSslProxiesSetSslCertificatesRequestResource);
+   *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(targetSslProxy.toString(), targetSslProxiesSetSslCertificatesRequestResource);
    * }
    * 
* * @param targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to * be set. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetSslProxiesSetSslCertificatesRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslCertificatesTargetSslProxy( String targetSslProxy, - String requestId, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource) { SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) .setTargetSslProxiesSetSslCertificatesRequestResource( targetSslProxiesSetSslCertificatesRequestResource) .build(); @@ -1055,11 +919,9 @@ public final Operation setSslCertificatesTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setSslCertificatesTargetSslProxy(request);
@@ -1084,11 +946,9 @@ public final Operation setSslCertificatesTargetSslProxy(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build();
    *   SetSslCertificatesTargetSslProxyHttpRequest request = SetSslCertificatesTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setTargetSslProxiesSetSslCertificatesRequestResource(targetSslProxiesSetSslCertificatesRequestResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setSslCertificatesTargetSslProxyCallable().futureCall(request);
@@ -1114,36 +974,24 @@ public final Operation setSslCertificatesTargetSslProxy(
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(targetSslProxy, requestId, sslPolicyReferenceResource);
+   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(targetSslProxy, sslPolicyReferenceResource);
    * }
    * 
* * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicyReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslPolicyTargetSslProxy( ProjectGlobalTargetSslProxyName targetSslProxy, - String requestId, SslPolicyReference sslPolicyReferenceResource) { SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy == null ? null : targetSslProxy.toString()) - .setRequestId(requestId) .setSslPolicyReferenceResource(sslPolicyReferenceResource) .build(); return setSslPolicyTargetSslProxy(request); @@ -1160,34 +1008,23 @@ public final Operation setSslPolicyTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
-   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(targetSslProxy.toString(), requestId, sslPolicyReferenceResource);
+   *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(targetSslProxy.toString(), sslPolicyReferenceResource);
    * }
    * 
* * @param 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 requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param sslPolicyReferenceResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setSslPolicyTargetSslProxy( - String targetSslProxy, String requestId, SslPolicyReference sslPolicyReferenceResource) { + String targetSslProxy, SslPolicyReference sslPolicyReferenceResource) { SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) - .setRequestId(requestId) .setSslPolicyReferenceResource(sslPolicyReferenceResource) .build(); return setSslPolicyTargetSslProxy(request); @@ -1204,11 +1041,9 @@ public final Operation setSslPolicyTargetSslProxy( *


    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
    *   SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
    *     .build();
    *   Operation response = targetSslProxyClient.setSslPolicyTargetSslProxy(request);
@@ -1234,11 +1069,9 @@ public final Operation setSslPolicyTargetSslProxy(SetSslPolicyTargetSslProxyHttp
    * 

    * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) {
    *   ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]");
-   *   String requestId = "";
    *   SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build();
    *   SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder()
    *     .setTargetSslProxy(targetSslProxy.toString())
-   *     .setRequestId(requestId)
    *     .setSslPolicyReferenceResource(sslPolicyReferenceResource)
    *     .build();
    *   ApiFuture<Operation> future = targetSslProxyClient.setSslPolicyTargetSslProxyCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java
index e5c08024a116..c99a0f47d210 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetSslProxyList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetSslProxy item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java
index d0b6a82b0895..147e6d889373 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private TargetTcpProxiesSetBackendServiceRequest(String service) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("service") && service != null) {
-      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("service")) {
+      return service;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("service")) {
-      return String.valueOf(service);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java
index d7a1e88c441e..9e77f3319352 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private TargetTcpProxiesSetProxyHeaderRequest(String proxyHeader) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("proxyHeader")) {
+      return proxyHeader;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java
index a694a28320e1..b6f7a888ce6c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -69,61 +65,30 @@ private TargetTcpProxy(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("proxyHeader") && proxyHeader != null) {
-      fieldMap.put("proxyHeader", Collections.singletonList(String.valueOf(proxyHeader)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("service") && service != null) {
-      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("proxyHeader")) {
-      return String.valueOf(proxyHeader);
+      return proxyHeader;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("service")) {
-      return String.valueOf(service);
+      return service;
     }
     return null;
   }
@@ -134,6 +99,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
index 4cc4e9a9c1b8..853bf7608b7a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
- *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
+ *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(targetTcpProxy);
  * }
  * 
  * 
@@ -161,31 +160,19 @@ public TargetTcpProxyStub getStub() { * *

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
-   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
+   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(targetTcpProxy);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetTcpProxy( - String requestId, ProjectGlobalTargetTcpProxyName targetTcpProxy) { + public final Operation deleteTargetTcpProxy(ProjectGlobalTargetTcpProxyName targetTcpProxy) { DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) .build(); return deleteTargetTcpProxy(request); @@ -199,32 +186,19 @@ public final Operation deleteTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
-   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy.toString());
+   *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(targetTcpProxy.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetTcpProxy(String requestId, String targetTcpProxy) { + public final Operation deleteTargetTcpProxy(String targetTcpProxy) { DeleteTargetTcpProxyHttpRequest request = - DeleteTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) - .setTargetTcpProxy(targetTcpProxy) - .build(); + DeleteTargetTcpProxyHttpRequest.newBuilder().setTargetTcpProxy(targetTcpProxy).build(); return deleteTargetTcpProxy(request); } @@ -236,10 +210,8 @@ public final Operation deleteTargetTcpProxy(String requestId, String targetTcpPr * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .build();
    *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(request);
@@ -262,10 +234,8 @@ public final Operation deleteTargetTcpProxy(DeleteTargetTcpProxyHttpRequest requ
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   DeleteTargetTcpProxyHttpRequest request = DeleteTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetTcpProxyClient.deleteTargetTcpProxyCallable().futureCall(request);
@@ -391,22 +361,12 @@ public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest reque
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
-   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(requestId, project, targetTcpProxyResource);
+   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(project, targetTcpProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) @@ -414,11 +374,10 @@ public final TargetTcpProxy getTargetTcpProxy(GetTargetTcpProxyHttpRequest reque */ @BetaApi public final Operation insertTargetTcpProxy( - String requestId, ProjectName project, TargetTcpProxy targetTcpProxyResource) { + ProjectName project, TargetTcpProxy targetTcpProxyResource) { InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setTargetTcpProxyResource(targetTcpProxyResource) .build(); @@ -434,22 +393,12 @@ public final Operation insertTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
-   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(requestId, project.toString(), targetTcpProxyResource);
+   *   Operation response = targetTcpProxyClient.insertTargetTcpProxy(project.toString(), targetTcpProxyResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param targetTcpProxyResource A TargetTcpProxy resource. This resource defines a TCP proxy. (== * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) @@ -457,11 +406,10 @@ public final Operation insertTargetTcpProxy( */ @BetaApi public final Operation insertTargetTcpProxy( - String requestId, String project, TargetTcpProxy targetTcpProxyResource) { + String project, TargetTcpProxy targetTcpProxyResource) { InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setTargetTcpProxyResource(targetTcpProxyResource) .build(); @@ -477,11 +425,9 @@ public final Operation insertTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
    *   InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetTcpProxyResource(targetTcpProxyResource)
    *     .build();
@@ -506,11 +452,9 @@ public final Operation insertTargetTcpProxy(InsertTargetTcpProxyHttpRequest requ
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
    *   InsertTargetTcpProxyHttpRequest request = InsertTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setTargetTcpProxyResource(targetTcpProxyResource)
    *     .build();
@@ -672,22 +616,12 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies(
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
-   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource);
+   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to * be set. * @param targetTcpProxiesSetBackendServiceRequestResource @@ -695,13 +629,11 @@ public final ListTargetTcpProxiesPagedResponse listTargetTcpProxies( */ @BetaApi public final Operation setBackendServiceTargetTcpProxy( - String requestId, ProjectGlobalTargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) .setTargetTcpProxiesSetBackendServiceRequestResource( targetTcpProxiesSetBackendServiceRequestResource) @@ -717,22 +649,12 @@ public final Operation setBackendServiceTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
-   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetBackendServiceRequestResource);
+   *   Operation response = targetTcpProxyClient.setBackendServiceTargetTcpProxy(targetTcpProxy.toString(), targetTcpProxiesSetBackendServiceRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to * be set. * @param targetTcpProxiesSetBackendServiceRequestResource @@ -740,13 +662,11 @@ public final Operation setBackendServiceTargetTcpProxy( */ @BetaApi public final Operation setBackendServiceTargetTcpProxy( - String requestId, String targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource) { SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetTcpProxy(targetTcpProxy) .setTargetTcpProxiesSetBackendServiceRequestResource( targetTcpProxiesSetBackendServiceRequestResource) @@ -762,11 +682,9 @@ public final Operation setBackendServiceTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource)
    *     .build();
@@ -791,11 +709,9 @@ public final Operation setBackendServiceTargetTcpProxy(
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
    *   SetBackendServiceTargetTcpProxyHttpRequest request = SetBackendServiceTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .setTargetTcpProxiesSetBackendServiceRequestResource(targetTcpProxiesSetBackendServiceRequestResource)
    *     .build();
@@ -819,35 +735,23 @@ public final Operation setBackendServiceTargetTcpProxy(
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
-   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource);
+   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. * @param targetTcpProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setProxyHeaderTargetTcpProxy( - String requestId, ProjectGlobalTargetTcpProxyName targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) .setTargetTcpProxiesSetProxyHeaderRequestResource( targetTcpProxiesSetProxyHeaderRequestResource) @@ -863,35 +767,23 @@ public final Operation setProxyHeaderTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
-   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(requestId, targetTcpProxy.toString(), targetTcpProxiesSetProxyHeaderRequestResource);
+   *   Operation response = targetTcpProxyClient.setProxyHeaderTargetTcpProxy(targetTcpProxy.toString(), targetTcpProxiesSetProxyHeaderRequestResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. * @param targetTcpProxiesSetProxyHeaderRequestResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation setProxyHeaderTargetTcpProxy( - String requestId, String targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource) { SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetTcpProxy(targetTcpProxy) .setTargetTcpProxiesSetProxyHeaderRequestResource( targetTcpProxiesSetProxyHeaderRequestResource) @@ -907,11 +799,9 @@ public final Operation setProxyHeaderTargetTcpProxy( * *


    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource)
    *     .build();
@@ -936,11 +826,9 @@ public final Operation setProxyHeaderTargetTcpProxy(
    *
    * 

    * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
-   *   String requestId = "";
    *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
    *   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
    *   SetProxyHeaderTargetTcpProxyHttpRequest request = SetProxyHeaderTargetTcpProxyHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetTcpProxy(targetTcpProxy.toString())
    *     .setTargetTcpProxiesSetProxyHeaderRequestResource(targetTcpProxiesSetProxyHeaderRequestResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java
index 77340a74321c..d7a118c6c3cd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetTcpProxyList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetTcpProxy item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java
index 43e0beaa5b26..70d886b3cb8e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -83,87 +78,39 @@ private TargetVpnGateway(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("forwardingRules") && forwardingRules != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : forwardingRules) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("forwardingRules", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("network") && network != null) {
-      fieldMap.put("network", Collections.singletonList(String.valueOf(network)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("tunnels") && tunnels != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : tunnels) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("tunnels", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("forwardingRules")) {
-      return String.valueOf(forwardingRules);
+      return forwardingRules;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("network")) {
-      return String.valueOf(network);
+      return network;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("tunnels")) {
-      return String.valueOf(tunnels);
+      return tunnels;
     }
     return null;
   }
@@ -174,6 +121,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java
index 36337ef7da0e..e461f3ffcfe8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private TargetVpnGatewayAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java
index 823d778ff705..ff30faab874a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
- *   String requestId = "";
  *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
- *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
+ *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
  * }
  * 
  * 
@@ -304,31 +303,20 @@ public final AggregatedListTargetVpnGatewaysPagedResponse aggregatedListTargetVp * *

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
-   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetVpnGateway Name of the target VPN gateway to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation deleteTargetVpnGateway( - String requestId, ProjectRegionTargetVpnGatewayName targetVpnGateway) { + ProjectRegionTargetVpnGatewayName targetVpnGateway) { DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetVpnGateway(targetVpnGateway == null ? null : targetVpnGateway.toString()) .build(); return deleteTargetVpnGateway(request); @@ -342,30 +330,19 @@ public final Operation deleteTargetVpnGateway( * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
-   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway.toString());
+   *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param targetVpnGateway Name of the target VPN gateway to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteTargetVpnGateway(String requestId, String targetVpnGateway) { + public final Operation deleteTargetVpnGateway(String targetVpnGateway) { DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) .setTargetVpnGateway(targetVpnGateway) .build(); return deleteTargetVpnGateway(request); @@ -379,10 +356,8 @@ public final Operation deleteTargetVpnGateway(String requestId, String targetVpn * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetVpnGateway(targetVpnGateway.toString())
    *     .build();
    *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(request);
@@ -405,10 +380,8 @@ public final Operation deleteTargetVpnGateway(DeleteTargetVpnGatewayHttpRequest
    *
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
    *   DeleteTargetVpnGatewayHttpRequest request = DeleteTargetVpnGatewayHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setTargetVpnGateway(targetVpnGateway.toString())
    *     .build();
    *   ApiFuture<Operation> future = targetVpnGatewayClient.deleteTargetVpnGatewayCallable().futureCall(request);
@@ -535,22 +508,12 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest
    *
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
-   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource);
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(region, targetVpnGatewayResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) @@ -558,11 +521,10 @@ public final TargetVpnGateway getTargetVpnGateway(GetTargetVpnGatewayHttpRequest */ @BetaApi public final Operation insertTargetVpnGateway( - String requestId, ProjectRegionName region, TargetVpnGateway targetVpnGatewayResource) { + ProjectRegionName region, TargetVpnGateway targetVpnGatewayResource) { InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setTargetVpnGatewayResource(targetVpnGatewayResource) .build(); @@ -578,22 +540,12 @@ public final Operation insertTargetVpnGateway( * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
-   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(requestId, region.toString(), targetVpnGatewayResource);
+   *   Operation response = targetVpnGatewayClient.insertTargetVpnGateway(region.toString(), targetVpnGatewayResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param targetVpnGatewayResource Represents a Target VPN gateway resource. (== resource_for * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) @@ -601,11 +553,10 @@ public final Operation insertTargetVpnGateway( */ @BetaApi public final Operation insertTargetVpnGateway( - String requestId, String region, TargetVpnGateway targetVpnGatewayResource) { + String region, TargetVpnGateway targetVpnGatewayResource) { InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setTargetVpnGatewayResource(targetVpnGatewayResource) .build(); @@ -621,11 +572,9 @@ public final Operation insertTargetVpnGateway( * *


    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetVpnGatewayResource(targetVpnGatewayResource)
    *     .build();
@@ -650,11 +599,9 @@ public final Operation insertTargetVpnGateway(InsertTargetVpnGatewayHttpRequest
    *
    * 

    * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build();
    *   InsertTargetVpnGatewayHttpRequest request = InsertTargetVpnGatewayHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setTargetVpnGatewayResource(targetVpnGatewayResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java
index 1748b6d159f6..5c854db00c19 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private TargetVpnGatewayList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetVpnGateway item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java
index 81f4c5bbe9ee..11cbdff73336 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private TargetVpnGatewaysScopedList(List targetVpnGateways, Wa
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("targetVpnGateways") && targetVpnGateways != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TargetVpnGateway item : targetVpnGateways) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("targetVpnGateways", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("targetVpnGateways")) {
-      return String.valueOf(targetVpnGateways);
+      return targetVpnGateways;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getTargetVpnGatewaysList() {
     return targetVpnGateways;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java
index 1604e2e56205..df706e89fc10 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -49,36 +45,18 @@ private TestFailure(String actualService, String expectedService, String host, S
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("actualService") && actualService != null) {
-      fieldMap.put("actualService", Collections.singletonList(String.valueOf(actualService)));
-    }
-    if (fieldNames.contains("expectedService") && expectedService != null) {
-      fieldMap.put("expectedService", Collections.singletonList(String.valueOf(expectedService)));
-    }
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("path") && path != null) {
-      fieldMap.put("path", Collections.singletonList(String.valueOf(path)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("actualService")) {
-      return String.valueOf(actualService);
+      return actualService;
     }
     if (fieldName.equals("expectedService")) {
-      return String.valueOf(expectedService);
+      return expectedService;
     }
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("path")) {
-      return String.valueOf(path);
+      return path;
     }
     return null;
   }
@@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getActualService() {
     return actualService;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java
index 6efe2d8d36a8..f1ed4d30d813 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private TestIamPermissionsLicenseCodeHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("testPermissionsRequestResource")
-        && testPermissionsRequestResource != null) {
-      fieldMap.put(
-          "testPermissionsRequestResource",
-          Collections.singletonList(String.valueOf(testPermissionsRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("testPermissionsRequestResource")) {
-      return String.valueOf(testPermissionsRequestResource);
+      return testPermissionsRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public TestPermissionsRequest getApiMessageRequestBody() {
     return testPermissionsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java
index 5406f9caf1bf..3813b199cda8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private TestIamPermissionsLicenseHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("testPermissionsRequestResource")
-        && testPermissionsRequestResource != null) {
-      fieldMap.put(
-          "testPermissionsRequestResource",
-          Collections.singletonList(String.valueOf(testPermissionsRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("testPermissionsRequestResource")) {
-      return String.valueOf(testPermissionsRequestResource);
+      return testPermissionsRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public TestPermissionsRequest getApiMessageRequestBody() {
     return testPermissionsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java
index 7e2cabb70c72..8c2f58e277bc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private TestIamPermissionsRegionDiskHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
-    }
-    if (fieldNames.contains("testPermissionsRequestResource")
-        && testPermissionsRequestResource != null) {
-      fieldMap.put(
-          "testPermissionsRequestResource",
-          Collections.singletonList(String.valueOf(testPermissionsRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
+      return resource;
     }
     if (fieldName.equals("testPermissionsRequestResource")) {
-      return String.valueOf(testPermissionsRequestResource);
+      return testPermissionsRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public TestPermissionsRequest getApiMessageRequestBody() {
     return testPermissionsRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java
index 8dba23a1ec59..ff9b408e5c8b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TestPermissionsRequest(List permissions) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("permissions") && permissions != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : permissions) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("permissions", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("permissions")) {
+      return permissions;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("permissions")) {
-      return String.valueOf(permissions);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java
index 13f16f8653e7..8f29bbd7bce2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java
@@ -17,13 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -41,29 +37,22 @@ private TestPermissionsResponse(List permissions) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("permissions") && permissions != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : permissions) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("permissions", stringList.build());
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("permissions")) {
+      return permissions;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("permissions")) {
-      return String.valueOf(permissions);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java
index e3e75cba5335..29f7d04ec065 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -81,79 +77,39 @@ private UpdateAccessConfigInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("accessConfigResource") && accessConfigResource != null) {
-      fieldMap.put(
-          "accessConfigResource", Collections.singletonList(String.valueOf(accessConfigResource)));
-    }
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("networkInterface") && networkInterface != null) {
-      fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("accessConfigResource")) {
-      return String.valueOf(accessConfigResource);
+      return accessConfigResource;
     }
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("networkInterface")) {
-      return String.valueOf(networkInterface);
+      return networkInterface;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -164,6 +120,12 @@ public AccessConfig getApiMessageRequestBody() {
     return accessConfigResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public AccessConfig getAccessConfigResource() {
     return accessConfigResource;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java
index b8a2a198ba0b..8f44596273da 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class UpdateAutoscalerHttpRequest implements ApiMessage {
   private final String autoscaler;
   private final Autoscaler autoscalerResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -46,6 +43,7 @@ private UpdateAutoscalerHttpRequest() {
     this.autoscaler = null;
     this.autoscalerResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -60,6 +58,7 @@ private UpdateAutoscalerHttpRequest(
       String autoscaler,
       Autoscaler autoscalerResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -71,6 +70,7 @@ private UpdateAutoscalerHttpRequest(
     this.autoscaler = autoscaler;
     this.autoscalerResource = autoscalerResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -81,79 +81,42 @@ private UpdateAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) {
-      fieldMap.put(
-          "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    if (fieldNames.contains("zone") && zone != null) {
-      fieldMap.put("zone", Collections.singletonList(String.valueOf(zone)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("autoscalerResource")) {
-      return String.valueOf(autoscalerResource);
+      return autoscalerResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     if (fieldName.equals("zone")) {
-      return String.valueOf(zone);
+      return zone;
     }
     return null;
   }
@@ -164,6 +127,12 @@ public Autoscaler getApiMessageRequestBody() {
     return autoscalerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -235,6 +204,7 @@ public static class Builder {
     private String autoscaler;
     private Autoscaler autoscalerResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -259,6 +229,9 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -288,6 +261,7 @@ public Builder mergeFrom(UpdateAutoscalerHttpRequest other) {
       this.autoscaler = source.autoscaler;
       this.autoscalerResource = source.autoscalerResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -333,6 +307,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -410,6 +393,7 @@ public UpdateAutoscalerHttpRequest build() {
           autoscaler,
           autoscalerResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -425,6 +409,7 @@ public Builder clone() {
       newBuilder.setAutoscaler(this.autoscaler);
       newBuilder.setAutoscalerResource(this.autoscalerResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -451,6 +436,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -485,6 +473,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.autoscaler, that.getAutoscaler())
           && Objects.equals(this.autoscalerResource, that.getAutoscalerResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -503,6 +492,7 @@ public int hashCode() {
         autoscaler,
         autoscalerResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java
index ac9b68154816..4c40aef2a060 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class UpdateBackendBucketHttpRequest implements ApiMessage {
   private final String backendBucket;
   private final BackendBucket backendBucketResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -45,6 +42,7 @@ private UpdateBackendBucketHttpRequest() {
     this.backendBucket = null;
     this.backendBucketResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -58,6 +56,7 @@ private UpdateBackendBucketHttpRequest(
       String backendBucket,
       BackendBucket backendBucketResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -68,6 +67,7 @@ private UpdateBackendBucketHttpRequest(
     this.backendBucket = backendBucket;
     this.backendBucketResource = backendBucketResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,74 +77,39 @@ private UpdateBackendBucketHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendBucket") && backendBucket != null) {
-      fieldMap.put("backendBucket", Collections.singletonList(String.valueOf(backendBucket)));
-    }
-    if (fieldNames.contains("backendBucketResource") && backendBucketResource != null) {
-      fieldMap.put(
-          "backendBucketResource",
-          Collections.singletonList(String.valueOf(backendBucketResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendBucket")) {
-      return String.valueOf(backendBucket);
+      return backendBucket;
     }
     if (fieldName.equals("backendBucketResource")) {
-      return String.valueOf(backendBucketResource);
+      return backendBucketResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public BackendBucket getApiMessageRequestBody() {
     return backendBucketResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -222,6 +193,7 @@ public static class Builder {
     private String backendBucket;
     private BackendBucket backendBucketResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -245,6 +217,9 @@ public Builder mergeFrom(UpdateBackendBucketHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -271,6 +246,7 @@ public Builder mergeFrom(UpdateBackendBucketHttpRequest other) {
       this.backendBucket = source.backendBucket;
       this.backendBucketResource = source.backendBucketResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -315,6 +291,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -384,6 +369,7 @@ public UpdateBackendBucketHttpRequest build() {
           backendBucket,
           backendBucketResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -398,6 +384,7 @@ public Builder clone() {
       newBuilder.setBackendBucket(this.backendBucket);
       newBuilder.setBackendBucketResource(this.backendBucketResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -423,6 +410,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -454,6 +444,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.backendBucket, that.getBackendBucket())
           && Objects.equals(this.backendBucketResource, that.getBackendBucketResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -471,6 +462,7 @@ public int hashCode() {
         backendBucket,
         backendBucketResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java
index e403c03d0963..c2db0a34accb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class UpdateBackendServiceHttpRequest implements ApiMessage {
   private final String backendService;
   private final BackendService backendServiceResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -45,6 +42,7 @@ private UpdateBackendServiceHttpRequest() {
     this.backendService = null;
     this.backendServiceResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -58,6 +56,7 @@ private UpdateBackendServiceHttpRequest(
       String backendService,
       BackendService backendServiceResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -68,6 +67,7 @@ private UpdateBackendServiceHttpRequest(
     this.backendService = backendService;
     this.backendServiceResource = backendServiceResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,74 +77,39 @@ private UpdateBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) {
-      fieldMap.put(
-          "backendServiceResource",
-          Collections.singletonList(String.valueOf(backendServiceResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("backendServiceResource")) {
-      return String.valueOf(backendServiceResource);
+      return backendServiceResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public BackendService getApiMessageRequestBody() {
     return backendServiceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -222,6 +193,7 @@ public static class Builder {
     private String backendService;
     private BackendService backendServiceResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -245,6 +217,9 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -271,6 +246,7 @@ public Builder mergeFrom(UpdateBackendServiceHttpRequest other) {
       this.backendService = source.backendService;
       this.backendServiceResource = source.backendServiceResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -315,6 +291,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -384,6 +369,7 @@ public UpdateBackendServiceHttpRequest build() {
           backendService,
           backendServiceResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -398,6 +384,7 @@ public Builder clone() {
       newBuilder.setBackendService(this.backendService);
       newBuilder.setBackendServiceResource(this.backendServiceResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -423,6 +410,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -454,6 +444,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.backendService, that.getBackendService())
           && Objects.equals(this.backendServiceResource, that.getBackendServiceResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -471,6 +462,7 @@ public int hashCode() {
         backendService,
         backendServiceResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java
index 1859339a9a09..bc40d74b3fdc 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateFirewallHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String firewall;
   private final Firewall firewallResource;
@@ -43,6 +40,7 @@ public final class UpdateFirewallHttpRequest implements ApiMessage {
   private UpdateFirewallHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.firewall = null;
     this.firewallResource = null;
@@ -56,6 +54,7 @@ private UpdateFirewallHttpRequest() {
   private UpdateFirewallHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String firewall,
       Firewall firewallResource,
@@ -66,6 +65,7 @@ private UpdateFirewallHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.firewall = firewall;
     this.firewallResource = firewallResource;
@@ -77,72 +77,39 @@ private UpdateFirewallHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("firewall") && firewall != null) {
-      fieldMap.put("firewall", Collections.singletonList(String.valueOf(firewall)));
-    }
-    if (fieldNames.contains("firewallResource") && firewallResource != null) {
-      fieldMap.put("firewallResource", Collections.singletonList(String.valueOf(firewallResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("firewall")) {
-      return String.valueOf(firewall);
+      return firewall;
     }
     if (fieldName.equals("firewallResource")) {
-      return String.valueOf(firewallResource);
+      return firewallResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public Firewall getApiMessageRequestBody() {
     return firewallResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static UpdateFirewallHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String firewall;
     private Firewall firewallResource;
@@ -237,6 +211,9 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(UpdateFirewallHttpRequest other) {
     Builder(UpdateFirewallHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.firewall = source.firewall;
       this.firewallResource = source.firewallResource;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public UpdateFirewallHttpRequest build() {
       return new UpdateFirewallHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           firewall,
           firewallResource,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setFirewall(this.firewall);
       newBuilder.setFirewallResource(this.firewallResource);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       UpdateFirewallHttpRequest that = (UpdateFirewallHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.firewall, that.getFirewall())
           && Objects.equals(this.firewallResource, that.getFirewallResource())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         firewall,
         firewallResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java
index 023f73d37af1..dd475e3ce0f8 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateHealthCheckHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String healthCheck;
   private final HealthCheck healthCheckResource;
@@ -43,6 +40,7 @@ public final class UpdateHealthCheckHttpRequest implements ApiMessage {
   private UpdateHealthCheckHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.healthCheck = null;
     this.healthCheckResource = null;
@@ -56,6 +54,7 @@ private UpdateHealthCheckHttpRequest() {
   private UpdateHealthCheckHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String healthCheck,
       HealthCheck healthCheckResource,
@@ -66,6 +65,7 @@ private UpdateHealthCheckHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.healthCheck = healthCheck;
     this.healthCheckResource = healthCheckResource;
@@ -77,73 +77,39 @@ private UpdateHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("healthCheck") && healthCheck != null) {
-      fieldMap.put("healthCheck", Collections.singletonList(String.valueOf(healthCheck)));
-    }
-    if (fieldNames.contains("healthCheckResource") && healthCheckResource != null) {
-      fieldMap.put(
-          "healthCheckResource", Collections.singletonList(String.valueOf(healthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("healthCheck")) {
-      return String.valueOf(healthCheck);
+      return healthCheck;
     }
     if (fieldName.equals("healthCheckResource")) {
-      return String.valueOf(healthCheckResource);
+      return healthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -154,6 +120,12 @@ public HealthCheck getApiMessageRequestBody() {
     return healthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -219,6 +191,7 @@ public static UpdateHealthCheckHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String healthCheck;
     private HealthCheck healthCheckResource;
@@ -238,6 +211,9 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -268,6 +244,7 @@ public Builder mergeFrom(UpdateHealthCheckHttpRequest other) {
     Builder(UpdateHealthCheckHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.healthCheck = source.healthCheck;
       this.healthCheckResource = source.healthCheckResource;
@@ -296,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -381,6 +367,7 @@ public UpdateHealthCheckHttpRequest build() {
       return new UpdateHealthCheckHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           healthCheck,
           healthCheckResource,
@@ -395,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setHealthCheck(this.healthCheck);
       newBuilder.setHealthCheckResource(this.healthCheckResource);
@@ -416,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -451,6 +442,7 @@ public boolean equals(Object o) {
       UpdateHealthCheckHttpRequest that = (UpdateHealthCheckHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.healthCheck, that.getHealthCheck())
           && Objects.equals(this.healthCheckResource, that.getHealthCheckResource())
@@ -468,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         healthCheck,
         healthCheckResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java
index 69dcd7676c08..268b31281559 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String httpHealthCheck;
   private final HttpHealthCheck2 httpHealthCheckResource;
@@ -43,6 +40,7 @@ public final class UpdateHttpHealthCheckHttpRequest implements ApiMessage {
   private UpdateHttpHealthCheckHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.httpHealthCheck = null;
     this.httpHealthCheckResource = null;
@@ -56,6 +54,7 @@ private UpdateHttpHealthCheckHttpRequest() {
   private UpdateHttpHealthCheckHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String httpHealthCheck,
       HttpHealthCheck2 httpHealthCheckResource,
@@ -66,6 +65,7 @@ private UpdateHttpHealthCheckHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.httpHealthCheck = httpHealthCheck;
     this.httpHealthCheckResource = httpHealthCheckResource;
@@ -77,74 +77,39 @@ private UpdateHttpHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpHealthCheck") && httpHealthCheck != null) {
-      fieldMap.put("httpHealthCheck", Collections.singletonList(String.valueOf(httpHealthCheck)));
-    }
-    if (fieldNames.contains("httpHealthCheckResource") && httpHealthCheckResource != null) {
-      fieldMap.put(
-          "httpHealthCheckResource",
-          Collections.singletonList(String.valueOf(httpHealthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpHealthCheck")) {
-      return String.valueOf(httpHealthCheck);
+      return httpHealthCheck;
     }
     if (fieldName.equals("httpHealthCheckResource")) {
-      return String.valueOf(httpHealthCheckResource);
+      return httpHealthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public HttpHealthCheck2 getApiMessageRequestBody() {
     return httpHealthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -220,6 +191,7 @@ public static UpdateHttpHealthCheckHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String httpHealthCheck;
     private HttpHealthCheck2 httpHealthCheckResource;
@@ -239,6 +211,9 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -269,6 +244,7 @@ public Builder mergeFrom(UpdateHttpHealthCheckHttpRequest other) {
     Builder(UpdateHttpHealthCheckHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.httpHealthCheck = source.httpHealthCheck;
       this.httpHealthCheckResource = source.httpHealthCheckResource;
@@ -297,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -382,6 +367,7 @@ public UpdateHttpHealthCheckHttpRequest build() {
       return new UpdateHttpHealthCheckHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           httpHealthCheck,
           httpHealthCheckResource,
@@ -396,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setHttpHealthCheck(this.httpHealthCheck);
       newBuilder.setHttpHealthCheckResource(this.httpHealthCheckResource);
@@ -417,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -452,6 +442,7 @@ public boolean equals(Object o) {
       UpdateHttpHealthCheckHttpRequest that = (UpdateHttpHealthCheckHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.httpHealthCheck, that.getHttpHealthCheck())
           && Objects.equals(this.httpHealthCheckResource, that.getHttpHealthCheckResource())
@@ -469,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         httpHealthCheck,
         httpHealthCheckResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java
index 311f25262dde..4e1efc4c27ba 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String httpsHealthCheck;
   private final HttpsHealthCheck2 httpsHealthCheckResource;
@@ -43,6 +40,7 @@ public final class UpdateHttpsHealthCheckHttpRequest implements ApiMessage {
   private UpdateHttpsHealthCheckHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.httpsHealthCheck = null;
     this.httpsHealthCheckResource = null;
@@ -56,6 +54,7 @@ private UpdateHttpsHealthCheckHttpRequest() {
   private UpdateHttpsHealthCheckHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String httpsHealthCheck,
       HttpsHealthCheck2 httpsHealthCheckResource,
@@ -66,6 +65,7 @@ private UpdateHttpsHealthCheckHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.httpsHealthCheck = httpsHealthCheck;
     this.httpsHealthCheckResource = httpsHealthCheckResource;
@@ -77,74 +77,39 @@ private UpdateHttpsHealthCheckHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("httpsHealthCheck") && httpsHealthCheck != null) {
-      fieldMap.put("httpsHealthCheck", Collections.singletonList(String.valueOf(httpsHealthCheck)));
-    }
-    if (fieldNames.contains("httpsHealthCheckResource") && httpsHealthCheckResource != null) {
-      fieldMap.put(
-          "httpsHealthCheckResource",
-          Collections.singletonList(String.valueOf(httpsHealthCheckResource)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("httpsHealthCheck")) {
-      return String.valueOf(httpsHealthCheck);
+      return httpsHealthCheck;
     }
     if (fieldName.equals("httpsHealthCheckResource")) {
-      return String.valueOf(httpsHealthCheckResource);
+      return httpsHealthCheckResource;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public HttpsHealthCheck2 getApiMessageRequestBody() {
     return httpsHealthCheckResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -220,6 +191,7 @@ public static UpdateHttpsHealthCheckHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String httpsHealthCheck;
     private HttpsHealthCheck2 httpsHealthCheckResource;
@@ -239,6 +211,9 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -269,6 +244,7 @@ public Builder mergeFrom(UpdateHttpsHealthCheckHttpRequest other) {
     Builder(UpdateHttpsHealthCheckHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.httpsHealthCheck = source.httpsHealthCheck;
       this.httpsHealthCheckResource = source.httpsHealthCheckResource;
@@ -297,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -382,6 +367,7 @@ public UpdateHttpsHealthCheckHttpRequest build() {
       return new UpdateHttpsHealthCheckHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           httpsHealthCheck,
           httpsHealthCheckResource,
@@ -396,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setHttpsHealthCheck(this.httpsHealthCheck);
       newBuilder.setHttpsHealthCheckResource(this.httpsHealthCheckResource);
@@ -417,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -452,6 +442,7 @@ public boolean equals(Object o) {
       UpdateHttpsHealthCheckHttpRequest that = (UpdateHttpsHealthCheckHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.httpsHealthCheck, that.getHttpsHealthCheck())
           && Objects.equals(this.httpsHealthCheckResource, that.getHttpsHealthCheckResource())
@@ -469,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         httpsHealthCheck,
         httpsHealthCheckResource,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java
index d059bd42e620..4d23d4d321e7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String instance;
   private final String key;
@@ -44,6 +41,7 @@ public final class UpdateNetworkInterfaceInstanceHttpRequest implements ApiMessa
   private UpdateNetworkInterfaceInstanceHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.instance = null;
     this.key = null;
@@ -58,6 +56,7 @@ private UpdateNetworkInterfaceInstanceHttpRequest() {
   private UpdateNetworkInterfaceInstanceHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String instance,
       String key,
@@ -69,6 +68,7 @@ private UpdateNetworkInterfaceInstanceHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.instance = instance;
     this.key = key;
@@ -81,80 +81,42 @@ private UpdateNetworkInterfaceInstanceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("instance") && instance != null) {
-      fieldMap.put("instance", Collections.singletonList(String.valueOf(instance)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("networkInterface") && networkInterface != null) {
-      fieldMap.put("networkInterface", Collections.singletonList(String.valueOf(networkInterface)));
-    }
-    if (fieldNames.contains("networkInterfaceResource") && networkInterfaceResource != null) {
-      fieldMap.put(
-          "networkInterfaceResource",
-          Collections.singletonList(String.valueOf(networkInterfaceResource)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("instance")) {
-      return String.valueOf(instance);
+      return instance;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("networkInterface")) {
-      return String.valueOf(networkInterface);
+      return networkInterface;
     }
     if (fieldName.equals("networkInterfaceResource")) {
-      return String.valueOf(networkInterfaceResource);
+      return networkInterfaceResource;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -165,6 +127,12 @@ public NetworkInterface getApiMessageRequestBody() {
     return networkInterfaceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -234,6 +202,7 @@ public static UpdateNetworkInterfaceInstanceHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String instance;
     private String key;
@@ -254,6 +223,9 @@ public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -287,6 +259,7 @@ public Builder mergeFrom(UpdateNetworkInterfaceInstanceHttpRequest other) {
     Builder(UpdateNetworkInterfaceInstanceHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.instance = source.instance;
       this.key = source.key;
@@ -316,6 +289,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -414,6 +396,7 @@ public UpdateNetworkInterfaceInstanceHttpRequest build() {
       return new UpdateNetworkInterfaceInstanceHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           instance,
           key,
@@ -429,6 +412,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setInstance(this.instance);
       newBuilder.setKey(this.key);
@@ -451,6 +435,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -490,6 +477,7 @@ public boolean equals(Object o) {
           (UpdateNetworkInterfaceInstanceHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.instance, that.getInstance())
           && Objects.equals(this.key, that.getKey())
@@ -508,6 +496,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         instance,
         key,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java
index 26014c33180f..fe33e4ccc64d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class UpdateRegionAutoscalerHttpRequest implements ApiMessage {
   private final String autoscaler;
   private final Autoscaler autoscalerResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -46,6 +43,7 @@ private UpdateRegionAutoscalerHttpRequest() {
     this.autoscaler = null;
     this.autoscalerResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -60,6 +58,7 @@ private UpdateRegionAutoscalerHttpRequest(
       String autoscaler,
       Autoscaler autoscalerResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -71,6 +70,7 @@ private UpdateRegionAutoscalerHttpRequest(
     this.autoscaler = autoscaler;
     this.autoscalerResource = autoscalerResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -81,79 +81,42 @@ private UpdateRegionAutoscalerHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("autoscaler") && autoscaler != null) {
-      fieldMap.put("autoscaler", Collections.singletonList(String.valueOf(autoscaler)));
-    }
-    if (fieldNames.contains("autoscalerResource") && autoscalerResource != null) {
-      fieldMap.put(
-          "autoscalerResource", Collections.singletonList(String.valueOf(autoscalerResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("autoscaler")) {
-      return String.valueOf(autoscaler);
+      return autoscaler;
     }
     if (fieldName.equals("autoscalerResource")) {
-      return String.valueOf(autoscalerResource);
+      return autoscalerResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -164,6 +127,12 @@ public Autoscaler getApiMessageRequestBody() {
     return autoscalerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -235,6 +204,7 @@ public static class Builder {
     private String autoscaler;
     private Autoscaler autoscalerResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -259,6 +229,9 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -288,6 +261,7 @@ public Builder mergeFrom(UpdateRegionAutoscalerHttpRequest other) {
       this.autoscaler = source.autoscaler;
       this.autoscalerResource = source.autoscalerResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -333,6 +307,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -411,6 +394,7 @@ public UpdateRegionAutoscalerHttpRequest build() {
           autoscaler,
           autoscalerResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -426,6 +410,7 @@ public Builder clone() {
       newBuilder.setAutoscaler(this.autoscaler);
       newBuilder.setAutoscalerResource(this.autoscalerResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -452,6 +437,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -486,6 +474,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.autoscaler, that.getAutoscaler())
           && Objects.equals(this.autoscalerResource, that.getAutoscalerResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -504,6 +493,7 @@ public int hashCode() {
         autoscaler,
         autoscalerResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java
index e6a829c34afe..50ff784603bb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -33,6 +29,7 @@ public final class UpdateRegionBackendServiceHttpRequest implements ApiMessage {
   private final String backendService;
   private final BackendService backendServiceResource;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -45,6 +42,7 @@ private UpdateRegionBackendServiceHttpRequest() {
     this.backendService = null;
     this.backendServiceResource = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -58,6 +56,7 @@ private UpdateRegionBackendServiceHttpRequest(
       String backendService,
       BackendService backendServiceResource,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -68,6 +67,7 @@ private UpdateRegionBackendServiceHttpRequest(
     this.backendService = backendService;
     this.backendServiceResource = backendServiceResource;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,74 +77,39 @@ private UpdateRegionBackendServiceHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("backendService") && backendService != null) {
-      fieldMap.put("backendService", Collections.singletonList(String.valueOf(backendService)));
-    }
-    if (fieldNames.contains("backendServiceResource") && backendServiceResource != null) {
-      fieldMap.put(
-          "backendServiceResource",
-          Collections.singletonList(String.valueOf(backendServiceResource)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("backendService")) {
-      return String.valueOf(backendService);
+      return backendService;
     }
     if (fieldName.equals("backendServiceResource")) {
-      return String.valueOf(backendServiceResource);
+      return backendServiceResource;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -155,6 +120,12 @@ public BackendService getApiMessageRequestBody() {
     return backendServiceResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -222,6 +193,7 @@ public static class Builder {
     private String backendService;
     private BackendService backendServiceResource;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -245,6 +217,9 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -271,6 +246,7 @@ public Builder mergeFrom(UpdateRegionBackendServiceHttpRequest other) {
       this.backendService = source.backendService;
       this.backendServiceResource = source.backendServiceResource;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -315,6 +291,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -384,6 +369,7 @@ public UpdateRegionBackendServiceHttpRequest build() {
           backendService,
           backendServiceResource,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -398,6 +384,7 @@ public Builder clone() {
       newBuilder.setBackendService(this.backendService);
       newBuilder.setBackendServiceResource(this.backendServiceResource);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -423,6 +410,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -454,6 +444,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.backendService, that.getBackendService())
           && Objects.equals(this.backendServiceResource, that.getBackendServiceResource())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -471,6 +462,7 @@ public int hashCode() {
         backendService,
         backendServiceResource,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java
index e5e3b508f1ce..33353765119e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateRouterHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -43,6 +40,7 @@ public final class UpdateRouterHttpRequest implements ApiMessage {
   private UpdateRouterHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -56,6 +54,7 @@ private UpdateRouterHttpRequest() {
   private UpdateRouterHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -66,6 +65,7 @@ private UpdateRouterHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,72 +77,39 @@ private UpdateRouterHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("routerResource") && routerResource != null) {
-      fieldMap.put("routerResource", Collections.singletonList(String.valueOf(routerResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("routerResource")) {
-      return String.valueOf(routerResource);
+      return routerResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public Router getApiMessageRequestBody() {
     return routerResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static UpdateRouterHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -237,6 +211,9 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(UpdateRouterHttpRequest other) {
     Builder(UpdateRouterHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public UpdateRouterHttpRequest build() {
       return new UpdateRouterHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       UpdateRouterHttpRequest that = (UpdateRouterHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java
index 553a99a61431..d10954b5d792 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -31,6 +27,7 @@
 public final class UpdateUrlMapHttpRequest implements ApiMessage {
   private final String access_token;
   private final String callback;
+  private final List fieldMask;
   private final String fields;
   private final String key;
   private final String prettyPrint;
@@ -43,6 +40,7 @@ public final class UpdateUrlMapHttpRequest implements ApiMessage {
   private UpdateUrlMapHttpRequest() {
     this.access_token = null;
     this.callback = null;
+    this.fieldMask = null;
     this.fields = null;
     this.key = null;
     this.prettyPrint = null;
@@ -56,6 +54,7 @@ private UpdateUrlMapHttpRequest() {
   private UpdateUrlMapHttpRequest(
       String access_token,
       String callback,
+      List fieldMask,
       String fields,
       String key,
       String prettyPrint,
@@ -66,6 +65,7 @@ private UpdateUrlMapHttpRequest(
       String userIp) {
     this.access_token = access_token;
     this.callback = callback;
+    this.fieldMask = fieldMask;
     this.fields = fields;
     this.key = key;
     this.prettyPrint = prettyPrint;
@@ -77,72 +77,39 @@ private UpdateUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("requestId") && requestId != null) {
-      fieldMap.put("requestId", Collections.singletonList(String.valueOf(requestId)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    if (fieldNames.contains("urlMapResource") && urlMapResource != null) {
-      fieldMap.put("urlMapResource", Collections.singletonList(String.valueOf(urlMapResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
+    }
+    if (fieldName.equals("fieldMask")) {
+      return fieldMask;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("requestId")) {
-      return String.valueOf(requestId);
+      return requestId;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     if (fieldName.equals("urlMapResource")) {
-      return String.valueOf(urlMapResource);
+      return urlMapResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -153,6 +120,12 @@ public UrlMap getApiMessageRequestBody() {
     return urlMapResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return fieldMask;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
@@ -218,6 +191,7 @@ public static UpdateUrlMapHttpRequest getDefaultInstance() {
   public static class Builder {
     private String access_token;
     private String callback;
+    private List fieldMask;
     private String fields;
     private String key;
     private String prettyPrint;
@@ -237,6 +211,9 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) {
       if (other.getCallback() != null) {
         this.callback = other.callback;
       }
+      if (other.getFieldMask() != null) {
+        this.fieldMask = other.fieldMask;
+      }
       if (other.getFields() != null) {
         this.fields = other.fields;
       }
@@ -267,6 +244,7 @@ public Builder mergeFrom(UpdateUrlMapHttpRequest other) {
     Builder(UpdateUrlMapHttpRequest source) {
       this.access_token = source.access_token;
       this.callback = source.callback;
+      this.fieldMask = source.fieldMask;
       this.fields = source.fields;
       this.key = source.key;
       this.prettyPrint = source.prettyPrint;
@@ -295,6 +273,15 @@ public Builder setCallback(String callback) {
       return this;
     }
 
+    public List getFieldMask() {
+      return fieldMask;
+    }
+
+    public Builder setFieldMask(List fieldMask) {
+      this.fieldMask = fieldMask;
+      return this;
+    }
+
     public String getFields() {
       return fields;
     }
@@ -380,6 +367,7 @@ public UpdateUrlMapHttpRequest build() {
       return new UpdateUrlMapHttpRequest(
           access_token,
           callback,
+          fieldMask,
           fields,
           key,
           prettyPrint,
@@ -394,6 +382,7 @@ public Builder clone() {
       Builder newBuilder = new Builder();
       newBuilder.setAccessToken(this.access_token);
       newBuilder.setCallback(this.callback);
+      newBuilder.setFieldMask(this.fieldMask);
       newBuilder.setFields(this.fields);
       newBuilder.setKey(this.key);
       newBuilder.setPrettyPrint(this.prettyPrint);
@@ -415,6 +404,9 @@ public String toString() {
         + "callback="
         + callback
         + ", "
+        + "fieldMask="
+        + fieldMask
+        + ", "
         + "fields="
         + fields
         + ", "
@@ -450,6 +442,7 @@ public boolean equals(Object o) {
       UpdateUrlMapHttpRequest that = (UpdateUrlMapHttpRequest) o;
       return Objects.equals(this.access_token, that.getAccessToken())
           && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fieldMask, that.getFieldMask())
           && Objects.equals(this.fields, that.getFields())
           && Objects.equals(this.key, that.getKey())
           && Objects.equals(this.prettyPrint, that.getPrettyPrint())
@@ -467,6 +460,7 @@ public int hashCode() {
     return Objects.hash(
         access_token,
         callback,
+        fieldMask,
         fields,
         key,
         prettyPrint,
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java
index 8d3e1ce15fb2..8480218f299c 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -83,91 +78,39 @@ private UrlMap(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("defaultService") && defaultService != null) {
-      fieldMap.put("defaultService", Collections.singletonList(String.valueOf(defaultService)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("fingerprint") && fingerprint != null) {
-      fieldMap.put("fingerprint", Collections.singletonList(String.valueOf(fingerprint)));
-    }
-    if (fieldNames.contains("hostRules") && hostRules != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (HostRule item : hostRules) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("hostRules", stringList.build());
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("pathMatchers") && pathMatchers != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (PathMatcher item : pathMatchers) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("pathMatchers", stringList.build());
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("tests") && tests != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (UrlMapTest item : tests) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("tests", stringList.build());
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("defaultService")) {
-      return String.valueOf(defaultService);
+      return defaultService;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("fingerprint")) {
-      return String.valueOf(fingerprint);
+      return fingerprint;
     }
     if (fieldName.equals("hostRules")) {
-      return String.valueOf(hostRules);
+      return hostRules;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("pathMatchers")) {
-      return String.valueOf(pathMatchers);
+      return pathMatchers;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("tests")) {
-      return String.valueOf(tests);
+      return tests;
     }
     return null;
   }
@@ -178,6 +121,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java
index c24260332ba2..01ae9bc7ebfa 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java
@@ -43,8 +43,7 @@
  * 
  * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
  *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
- *   String requestId = "";
- *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
+ *   Operation response = urlMapClient.deleteUrlMap(urlMap);
  * }
  * 
  * 
@@ -160,30 +159,19 @@ public UrlMapStub getStub() { *

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
-   *   Operation response = urlMapClient.deleteUrlMap(urlMap, requestId);
+   *   Operation response = urlMapClient.deleteUrlMap(urlMap);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteUrlMap(ProjectGlobalUrlMapName urlMap, String requestId) { + public final Operation deleteUrlMap(ProjectGlobalUrlMapName urlMap) { DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) .build(); return deleteUrlMap(request); } @@ -197,28 +185,18 @@ public final Operation deleteUrlMap(ProjectGlobalUrlMapName urlMap, String reque *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
-   *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString(), requestId);
+   *   Operation response = urlMapClient.deleteUrlMap(urlMap.toString());
    * }
    * 
* * @param urlMap Name of the UrlMap resource to delete. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteUrlMap(String urlMap, String requestId) { + public final Operation deleteUrlMap(String urlMap) { DeleteUrlMapHttpRequest request = - DeleteUrlMapHttpRequest.newBuilder().setUrlMap(urlMap).setRequestId(requestId).build(); + DeleteUrlMapHttpRequest.newBuilder().setUrlMap(urlMap).build(); return deleteUrlMap(request); } @@ -231,10 +209,8 @@ public final Operation deleteUrlMap(String urlMap, String requestId) { *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   Operation response = urlMapClient.deleteUrlMap(request);
    * }
@@ -257,10 +233,8 @@ public final Operation deleteUrlMap(DeleteUrlMapHttpRequest request) {
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   DeleteUrlMapHttpRequest request = DeleteUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.deleteUrlMapCallable().futureCall(request);
    *   // Do something
@@ -381,34 +355,22 @@ public final UnaryCallable getUrlMapCallable() {
    *
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.insertUrlMap(requestId, project, urlMapResource);
+   *   Operation response = urlMapClient.insertUrlMap(project, urlMapResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertUrlMap( - String requestId, ProjectName project, UrlMap urlMapResource) { + public final Operation insertUrlMap(ProjectName project, UrlMap urlMapResource) { InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project == null ? null : project.toString()) .setUrlMapResource(urlMapResource) .build(); @@ -423,33 +385,22 @@ public final Operation insertUrlMap( * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.insertUrlMap(requestId, project.toString(), urlMapResource);
+   *   Operation response = urlMapClient.insertUrlMap(project.toString(), urlMapResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param project Project ID for this request. * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertUrlMap(String requestId, String project, UrlMap urlMapResource) { + public final Operation insertUrlMap(String project, UrlMap urlMapResource) { InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder() - .setRequestId(requestId) .setProject(project) .setUrlMapResource(urlMapResource) .build(); @@ -464,11 +415,9 @@ public final Operation insertUrlMap(String requestId, String project, UrlMap url * *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUrlMapResource(urlMapResource)
    *     .build();
@@ -492,11 +441,9 @@ public final Operation insertUrlMap(InsertUrlMapHttpRequest request) {
    *
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
-   *   String requestId = "";
    *   ProjectName project = ProjectName.of("[PROJECT]");
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   InsertUrlMapHttpRequest request = InsertUrlMapHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setProject(project.toString())
    *     .setUrlMapResource(urlMapResource)
    *     .build();
@@ -521,35 +468,22 @@ public final UnaryCallable insertUrlMapCalla
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
-   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource);
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource);
    * }
    * 
* * @param urlMap Name of the UrlMap scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param cacheInvalidationRuleResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation invalidateCacheUrlMap( - ProjectGlobalUrlMapName urlMap, - String requestId, - CacheInvalidationRule cacheInvalidationRuleResource) { + ProjectGlobalUrlMapName urlMap, CacheInvalidationRule cacheInvalidationRuleResource) { InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) .build(); return invalidateCacheUrlMap(request); @@ -565,33 +499,22 @@ public final Operation invalidateCacheUrlMap( *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
-   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), requestId, cacheInvalidationRuleResource);
+   *   Operation response = urlMapClient.invalidateCacheUrlMap(urlMap.toString(), cacheInvalidationRuleResource);
    * }
    * 
* * @param urlMap Name of the UrlMap scoping this request. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param cacheInvalidationRuleResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi public final Operation invalidateCacheUrlMap( - String urlMap, String requestId, CacheInvalidationRule cacheInvalidationRuleResource) { + String urlMap, CacheInvalidationRule cacheInvalidationRuleResource) { InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) - .setRequestId(requestId) .setCacheInvalidationRuleResource(cacheInvalidationRuleResource) .build(); return invalidateCacheUrlMap(request); @@ -607,11 +530,9 @@ public final Operation invalidateCacheUrlMap( *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .setCacheInvalidationRuleResource(cacheInvalidationRuleResource)
    *     .build();
    *   Operation response = urlMapClient.invalidateCacheUrlMap(request);
@@ -636,11 +557,9 @@ public final Operation invalidateCacheUrlMap(InvalidateCacheUrlMapHttpRequest re
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build();
    *   InvalidateCacheUrlMapHttpRequest request = InvalidateCacheUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .setCacheInvalidationRuleResource(cacheInvalidationRuleResource)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.invalidateCacheUrlMapCallable().futureCall(request);
@@ -801,34 +720,22 @@ public final UnaryCallable listUrlMapsCallab
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.patchUrlMap(urlMap, requestId, urlMapResource);
+   *   Operation response = urlMapClient.patchUrlMap(urlMap, urlMapResource);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchUrlMap( - ProjectGlobalUrlMapName urlMap, String requestId, UrlMap urlMapResource) { + public final Operation patchUrlMap(ProjectGlobalUrlMapName urlMap, UrlMap urlMapResource) { PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return patchUrlMap(request); @@ -844,33 +751,22 @@ public final Operation patchUrlMap( *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), requestId, urlMapResource);
+   *   Operation response = urlMapClient.patchUrlMap(urlMap.toString(), urlMapResource);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to patch. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation patchUrlMap(String urlMap, String requestId, UrlMap urlMapResource) { + public final Operation patchUrlMap(String urlMap, UrlMap urlMapResource) { PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) - .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return patchUrlMap(request); @@ -886,11 +782,9 @@ public final Operation patchUrlMap(String urlMap, String requestId, UrlMap urlMa *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   Operation response = urlMapClient.patchUrlMap(request);
@@ -915,11 +809,9 @@ public final Operation patchUrlMap(PatchUrlMapHttpRequest request) {
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   PatchUrlMapHttpRequest request = PatchUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.patchUrlMapCallable().futureCall(request);
@@ -942,34 +834,22 @@ public final UnaryCallable patchUrlMapCallabl
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.updateUrlMap(urlMap, requestId, urlMapResource);
+   *   Operation response = urlMapClient.updateUrlMap(urlMap, urlMapResource);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateUrlMap( - ProjectGlobalUrlMapName urlMap, String requestId, UrlMap urlMapResource) { + public final Operation updateUrlMap(ProjectGlobalUrlMapName urlMap, UrlMap urlMapResource) { UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap == null ? null : urlMap.toString()) - .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return updateUrlMap(request); @@ -984,33 +864,22 @@ public final Operation updateUrlMap( *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
-   *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), requestId, urlMapResource);
+   *   Operation response = urlMapClient.updateUrlMap(urlMap.toString(), urlMapResource);
    * }
    * 
* * @param urlMap Name of the UrlMap resource to update. - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param urlMapResource A UrlMap resource. This resource defines the mapping from URL to the * BackendService resource, based on the "longest-match" of the URL's host and path. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation updateUrlMap(String urlMap, String requestId, UrlMap urlMapResource) { + public final Operation updateUrlMap(String urlMap, UrlMap urlMapResource) { UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder() .setUrlMap(urlMap) - .setRequestId(requestId) .setUrlMapResource(urlMapResource) .build(); return updateUrlMap(request); @@ -1025,11 +894,9 @@ public final Operation updateUrlMap(String urlMap, String requestId, UrlMap urlM *


    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   Operation response = urlMapClient.updateUrlMap(request);
@@ -1053,11 +920,9 @@ public final Operation updateUrlMap(UpdateUrlMapHttpRequest request) {
    * 

    * try (UrlMapClient urlMapClient = UrlMapClient.create()) {
    *   ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]");
-   *   String requestId = "";
    *   UrlMap urlMapResource = UrlMap.newBuilder().build();
    *   UpdateUrlMapHttpRequest request = UpdateUrlMapHttpRequest.newBuilder()
    *     .setUrlMap(urlMap.toString())
-   *     .setRequestId(requestId)
    *     .setUrlMapResource(urlMapResource)
    *     .build();
    *   ApiFuture<Operation> future = urlMapClient.updateUrlMapCallable().futureCall(request);
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java
index 073f4c2050b3..01de00a6b4b7 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private UrlMapList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (UrlMap item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java
index 54eac934b2bb..eedff2c1705e 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private UrlMapReference(String urlMap) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("urlMap")) {
+      return urlMap;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java
index 6c9cee06b282..3807f0fcc592 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -49,36 +45,18 @@ private UrlMapTest(String description, String host, String path, String service)
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("host") && host != null) {
-      fieldMap.put("host", Collections.singletonList(String.valueOf(host)));
-    }
-    if (fieldNames.contains("path") && path != null) {
-      fieldMap.put("path", Collections.singletonList(String.valueOf(path)));
-    }
-    if (fieldNames.contains("service") && service != null) {
-      fieldMap.put("service", Collections.singletonList(String.valueOf(service)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("host")) {
-      return String.valueOf(host);
+      return host;
     }
     if (fieldName.equals("path")) {
-      return String.valueOf(path);
+      return path;
     }
     if (fieldName.equals("service")) {
-      return String.valueOf(service);
+      return service;
     }
     return null;
   }
@@ -89,6 +67,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getDescription() {
     return description;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java
index 1d006f36b0da..57a9eef7757b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -55,44 +50,18 @@ private UrlMapValidationResult(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("loadErrors") && loadErrors != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : loadErrors) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("loadErrors", stringList.build());
-    }
-    if (fieldNames.contains("loadSucceeded") && loadSucceeded != null) {
-      fieldMap.put("loadSucceeded", Collections.singletonList(String.valueOf(loadSucceeded)));
-    }
-    if (fieldNames.contains("testFailures") && testFailures != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (TestFailure item : testFailures) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("testFailures", stringList.build());
-    }
-    if (fieldNames.contains("testPassed") && testPassed != null) {
-      fieldMap.put("testPassed", Collections.singletonList(String.valueOf(testPassed)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("loadErrors")) {
-      return String.valueOf(loadErrors);
+      return loadErrors;
     }
     if (fieldName.equals("loadSucceeded")) {
-      return String.valueOf(loadSucceeded);
+      return loadSucceeded;
     }
     if (fieldName.equals("testFailures")) {
-      return String.valueOf(testFailures);
+      return testFailures;
     }
     if (fieldName.equals("testPassed")) {
-      return String.valueOf(testPassed);
+      return testPassed;
     }
     return null;
   }
@@ -103,6 +72,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getLoadErrorsList() {
     return loadErrors;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java
index 67ad5ece8a64..b966c622365a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private UrlMapsValidateRequest(UrlMap resource) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("resource") && resource != null) {
-      fieldMap.put("resource", Collections.singletonList(String.valueOf(resource)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("resource")) {
+      return resource;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("resource")) {
-      return String.valueOf(resource);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java
index aada951cc3e3..5ea9b6d68757 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -40,25 +36,22 @@ private UrlMapsValidateResponse(UrlMapValidationResult result) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("result") && result != null) {
-      fieldMap.put("result", Collections.singletonList(String.valueOf(result)));
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("result")) {
+      return result;
     }
-    return fieldMap;
+    return null;
   }
 
+  @Nullable
   @Override
-  public String getFieldStringValue(String fieldName) {
-    if (fieldName.equals("result")) {
-      return String.valueOf(result);
-    }
+  public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
   @Nullable
   @Override
-  public ApiMessage getApiMessageRequestBody() {
+  public List getFieldMask() {
     return null;
   }
 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java
index 0e8d805e19f6..bc102b38b4a5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private UsageExportLocation(String bucketName, String reportNamePrefix) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("bucketName") && bucketName != null) {
-      fieldMap.put("bucketName", Collections.singletonList(String.valueOf(bucketName)));
-    }
-    if (fieldNames.contains("reportNamePrefix") && reportNamePrefix != null) {
-      fieldMap.put("reportNamePrefix", Collections.singletonList(String.valueOf(reportNamePrefix)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("bucketName")) {
-      return String.valueOf(bucketName);
+      return bucketName;
     }
     if (fieldName.equals("reportNamePrefix")) {
-      return String.valueOf(reportNamePrefix);
+      return reportNamePrefix;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getBucketName() {
     return bucketName;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java
index 50a4ff2a3d32..1e5b6f4c84f4 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -73,69 +69,33 @@ private ValidateUrlMapHttpRequest(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("access_token") && access_token != null) {
-      fieldMap.put("access_token", Collections.singletonList(String.valueOf(access_token)));
-    }
-    if (fieldNames.contains("callback") && callback != null) {
-      fieldMap.put("callback", Collections.singletonList(String.valueOf(callback)));
-    }
-    if (fieldNames.contains("fields") && fields != null) {
-      fieldMap.put("fields", Collections.singletonList(String.valueOf(fields)));
-    }
-    if (fieldNames.contains("key") && key != null) {
-      fieldMap.put("key", Collections.singletonList(String.valueOf(key)));
-    }
-    if (fieldNames.contains("prettyPrint") && prettyPrint != null) {
-      fieldMap.put("prettyPrint", Collections.singletonList(String.valueOf(prettyPrint)));
-    }
-    if (fieldNames.contains("quotaUser") && quotaUser != null) {
-      fieldMap.put("quotaUser", Collections.singletonList(String.valueOf(quotaUser)));
-    }
-    if (fieldNames.contains("urlMap") && urlMap != null) {
-      fieldMap.put("urlMap", Collections.singletonList(String.valueOf(urlMap)));
-    }
-    if (fieldNames.contains("urlMapsValidateRequestResource")
-        && urlMapsValidateRequestResource != null) {
-      fieldMap.put(
-          "urlMapsValidateRequestResource",
-          Collections.singletonList(String.valueOf(urlMapsValidateRequestResource)));
-    }
-    if (fieldNames.contains("userIp") && userIp != null) {
-      fieldMap.put("userIp", Collections.singletonList(String.valueOf(userIp)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("access_token")) {
-      return String.valueOf(access_token);
+      return access_token;
     }
     if (fieldName.equals("callback")) {
-      return String.valueOf(callback);
+      return callback;
     }
     if (fieldName.equals("fields")) {
-      return String.valueOf(fields);
+      return fields;
     }
     if (fieldName.equals("key")) {
-      return String.valueOf(key);
+      return key;
     }
     if (fieldName.equals("prettyPrint")) {
-      return String.valueOf(prettyPrint);
+      return prettyPrint;
     }
     if (fieldName.equals("quotaUser")) {
-      return String.valueOf(quotaUser);
+      return quotaUser;
     }
     if (fieldName.equals("urlMap")) {
-      return String.valueOf(urlMap);
+      return urlMap;
     }
     if (fieldName.equals("urlMapsValidateRequestResource")) {
-      return String.valueOf(urlMapsValidateRequestResource);
+      return urlMapsValidateRequestResource;
     }
     if (fieldName.equals("userIp")) {
-      return String.valueOf(userIp);
+      return userIp;
     }
     return null;
   }
@@ -146,6 +106,12 @@ public UrlMapsValidateRequest getApiMessageRequestBody() {
     return urlMapsValidateRequestResource;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getAccessToken() {
     return access_token;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java
index d00ea6107360..b363aa3aa3d5 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -107,123 +102,57 @@ private VpnTunnel(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("detailedStatus") && detailedStatus != null) {
-      fieldMap.put("detailedStatus", Collections.singletonList(String.valueOf(detailedStatus)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("ikeVersion") && ikeVersion != null) {
-      fieldMap.put("ikeVersion", Collections.singletonList(String.valueOf(ikeVersion)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("localTrafficSelector") && localTrafficSelector != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : localTrafficSelector) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("localTrafficSelector", stringList.build());
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("peerIp") && peerIp != null) {
-      fieldMap.put("peerIp", Collections.singletonList(String.valueOf(peerIp)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("remoteTrafficSelector") && remoteTrafficSelector != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : remoteTrafficSelector) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("remoteTrafficSelector", stringList.build());
-    }
-    if (fieldNames.contains("router") && router != null) {
-      fieldMap.put("router", Collections.singletonList(String.valueOf(router)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("sharedSecret") && sharedSecret != null) {
-      fieldMap.put("sharedSecret", Collections.singletonList(String.valueOf(sharedSecret)));
-    }
-    if (fieldNames.contains("sharedSecretHash") && sharedSecretHash != null) {
-      fieldMap.put("sharedSecretHash", Collections.singletonList(String.valueOf(sharedSecretHash)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    if (fieldNames.contains("targetVpnGateway") && targetVpnGateway != null) {
-      fieldMap.put("targetVpnGateway", Collections.singletonList(String.valueOf(targetVpnGateway)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("detailedStatus")) {
-      return String.valueOf(detailedStatus);
+      return detailedStatus;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("ikeVersion")) {
-      return String.valueOf(ikeVersion);
+      return ikeVersion;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("localTrafficSelector")) {
-      return String.valueOf(localTrafficSelector);
+      return localTrafficSelector;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("peerIp")) {
-      return String.valueOf(peerIp);
+      return peerIp;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("remoteTrafficSelector")) {
-      return String.valueOf(remoteTrafficSelector);
+      return remoteTrafficSelector;
     }
     if (fieldName.equals("router")) {
-      return String.valueOf(router);
+      return router;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("sharedSecret")) {
-      return String.valueOf(sharedSecret);
+      return sharedSecret;
     }
     if (fieldName.equals("sharedSecretHash")) {
-      return String.valueOf(sharedSecretHash);
+      return sharedSecretHash;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     if (fieldName.equals("targetVpnGateway")) {
-      return String.valueOf(targetVpnGateway);
+      return targetVpnGateway;
     }
     return null;
   }
@@ -234,6 +163,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCreationTimestamp() {
     return creationTimestamp;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java
index 9dc39b6f3bdc..0d492688936a 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -61,48 +58,24 @@ private VpnTunnelAggregatedList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      fieldMap.put("items", Collections.singletonList(String.valueOf(items)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -113,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
index b6a9eda661b5..27145d27e043 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java
@@ -42,9 +42,8 @@
  * 
  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
- *   String requestId = "";
  *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
- *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
+ *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
  * }
  * 
  * 
@@ -298,30 +297,19 @@ public final AggregatedListVpnTunnelsPagedResponse aggregatedListVpnTunnels( * *

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
-   *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
+   *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param vpnTunnel Name of the VpnTunnel resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteVpnTunnel(String requestId, ProjectRegionVpnTunnelName vpnTunnel) { + public final Operation deleteVpnTunnel(ProjectRegionVpnTunnelName vpnTunnel) { DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) .setVpnTunnel(vpnTunnel == null ? null : vpnTunnel.toString()) .build(); return deleteVpnTunnel(request); @@ -335,32 +323,19 @@ public final Operation deleteVpnTunnel(String requestId, ProjectRegionVpnTunnelN * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
-   *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel.toString());
+   *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel.toString());
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param vpnTunnel Name of the VpnTunnel resource to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation deleteVpnTunnel(String requestId, String vpnTunnel) { + public final Operation deleteVpnTunnel(String vpnTunnel) { DeleteVpnTunnelHttpRequest request = - DeleteVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) - .setVpnTunnel(vpnTunnel) - .build(); + DeleteVpnTunnelHttpRequest.newBuilder().setVpnTunnel(vpnTunnel).build(); return deleteVpnTunnel(request); } @@ -372,10 +347,8 @@ public final Operation deleteVpnTunnel(String requestId, String vpnTunnel) { * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setVpnTunnel(vpnTunnel.toString())
    *     .build();
    *   Operation response = vpnTunnelClient.deleteVpnTunnel(request);
@@ -398,10 +371,8 @@ public final Operation deleteVpnTunnel(DeleteVpnTunnelHttpRequest request) {
    *
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
    *   DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setVpnTunnel(vpnTunnel.toString())
    *     .build();
    *   ApiFuture<Operation> future = vpnTunnelClient.deleteVpnTunnelCallable().futureCall(request);
@@ -525,34 +496,22 @@ public final UnaryCallable getVpnTunnelCalla
    *
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
-   *   Operation response = vpnTunnelClient.insertVpnTunnel(requestId, region, vpnTunnelResource);
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(region, vpnTunnelResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== * resource_for v1.vpnTunnels ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertVpnTunnel( - String requestId, ProjectRegionName region, VpnTunnel vpnTunnelResource) { + public final Operation insertVpnTunnel(ProjectRegionName region, VpnTunnel vpnTunnelResource) { InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region == null ? null : region.toString()) .setVpnTunnelResource(vpnTunnelResource) .build(); @@ -568,34 +527,22 @@ public final Operation insertVpnTunnel( * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
-   *   Operation response = vpnTunnelClient.insertVpnTunnel(requestId, region.toString(), vpnTunnelResource);
+   *   Operation response = vpnTunnelClient.insertVpnTunnel(region.toString(), vpnTunnelResource);
    * }
    * 
* - * @param requestId An optional request ID to identify requests. Specify a unique request ID so - * that if you must retry your request, the server will know to ignore the request if it has - * already been completed. - *

For example, consider a situation where you make an initial request and the request - * times out. If you make the request again with the same request ID, the server can check if - * original operation with the same request ID was received, and if so, will ignore the second - * request. This prevents clients from accidentally creating duplicate commitments. - *

The request ID must be a valid UUID with the exception that zero UUID is not supported - * (00000000-0000-0000-0000-000000000000). * @param region Name of the region for this request. * @param vpnTunnelResource VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== * resource_for v1.vpnTunnels ==) * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi - public final Operation insertVpnTunnel( - String requestId, String region, VpnTunnel vpnTunnelResource) { + public final Operation insertVpnTunnel(String region, VpnTunnel vpnTunnelResource) { InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder() - .setRequestId(requestId) .setRegion(region) .setVpnTunnelResource(vpnTunnelResource) .build(); @@ -611,11 +558,9 @@ public final Operation insertVpnTunnel( * *


    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setVpnTunnelResource(vpnTunnelResource)
    *     .build();
@@ -640,11 +585,9 @@ public final Operation insertVpnTunnel(InsertVpnTunnelHttpRequest request) {
    *
    * 

    * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
-   *   String requestId = "";
    *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
    *   VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build();
    *   InsertVpnTunnelHttpRequest request = InsertVpnTunnelHttpRequest.newBuilder()
-   *     .setRequestId(requestId)
    *     .setRegion(region.toString())
    *     .setVpnTunnelResource(vpnTunnelResource)
    *     .build();
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
index 3b6b900db1fd..7205aa4a8647 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private VpnTunnelList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (VpnTunnel item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java
index 8c08a390bf52..ea1e23fb9162 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -45,28 +40,12 @@ private VpnTunnelsScopedList(List vpnTunnels, Warning warning) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("vpnTunnels") && vpnTunnels != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (VpnTunnel item : vpnTunnels) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("vpnTunnels", stringList.build());
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("vpnTunnels")) {
-      return String.valueOf(vpnTunnels);
+      return vpnTunnels;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -77,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getVpnTunnelsList() {
     return vpnTunnels;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java
index 8728216ff0df..b9b8ed6c959d 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -48,34 +43,15 @@ private Warning(String code, List data, String message) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("code") && code != null) {
-      fieldMap.put("code", Collections.singletonList(String.valueOf(code)));
-    }
-    if (fieldNames.contains("data") && data != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Data item : data) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("data", stringList.build());
-    }
-    if (fieldNames.contains("message") && message != null) {
-      fieldMap.put("message", Collections.singletonList(String.valueOf(message)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("code")) {
-      return String.valueOf(code);
+      return code;
     }
     if (fieldName.equals("data")) {
-      return String.valueOf(data);
+      return data;
     }
     if (fieldName.equals("message")) {
-      return String.valueOf(message);
+      return message;
     }
     return null;
   }
@@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCode() {
     return code;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java
index 4620e964b2d7..ac9609a33607 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -48,34 +43,15 @@ private Warnings(String code, List data, String message) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("code") && code != null) {
-      fieldMap.put("code", Collections.singletonList(String.valueOf(code)));
-    }
-    if (fieldNames.contains("data") && data != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Data item : data) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("data", stringList.build());
-    }
-    if (fieldNames.contains("message") && message != null) {
-      fieldMap.put("message", Collections.singletonList(String.valueOf(message)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("code")) {
-      return String.valueOf(code);
+      return code;
     }
     if (fieldName.equals("data")) {
-      return String.valueOf(data);
+      return data;
     }
     if (fieldName.equals("message")) {
-      return String.valueOf(message);
+      return message;
     }
     return null;
   }
@@ -86,6 +62,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getCode() {
     return code;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java
index 43273af679dc..da89eeaf4e6b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private XpnHostList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Project item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java
index 130421428275..810cc2aa1797 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java
@@ -17,12 +17,8 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +39,12 @@ private XpnResourceId(String id, String type) {
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("type") && type != null) {
-      fieldMap.put("type", Collections.singletonList(String.valueOf(type)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("type")) {
-      return String.valueOf(type);
+      return type;
     }
     return null;
   }
@@ -71,6 +55,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java
index e1e7afeb2e8d..8406d81a7481 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -79,77 +74,36 @@ private Zone(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("availableCpuPlatforms") && availableCpuPlatforms != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (String item : availableCpuPlatforms) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("availableCpuPlatforms", stringList.build());
-    }
-    if (fieldNames.contains("creationTimestamp") && creationTimestamp != null) {
-      fieldMap.put(
-          "creationTimestamp", Collections.singletonList(String.valueOf(creationTimestamp)));
-    }
-    if (fieldNames.contains("deprecated") && deprecated != null) {
-      fieldMap.put("deprecated", Collections.singletonList(String.valueOf(deprecated)));
-    }
-    if (fieldNames.contains("description") && description != null) {
-      fieldMap.put("description", Collections.singletonList(String.valueOf(description)));
-    }
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("name") && name != null) {
-      fieldMap.put("name", Collections.singletonList(String.valueOf(name)));
-    }
-    if (fieldNames.contains("region") && region != null) {
-      fieldMap.put("region", Collections.singletonList(String.valueOf(region)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("status") && status != null) {
-      fieldMap.put("status", Collections.singletonList(String.valueOf(status)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("availableCpuPlatforms")) {
-      return String.valueOf(availableCpuPlatforms);
+      return availableCpuPlatforms;
     }
     if (fieldName.equals("creationTimestamp")) {
-      return String.valueOf(creationTimestamp);
+      return creationTimestamp;
     }
     if (fieldName.equals("deprecated")) {
-      return String.valueOf(deprecated);
+      return deprecated;
     }
     if (fieldName.equals("description")) {
-      return String.valueOf(description);
+      return description;
     }
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("name")) {
-      return String.valueOf(name);
+      return name;
     }
     if (fieldName.equals("region")) {
-      return String.valueOf(region);
+      return region;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("status")) {
-      return String.valueOf(status);
+      return status;
     }
     return null;
   }
@@ -160,6 +114,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public List getAvailableCpuPlatformsList() {
     return availableCpuPlatforms;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
index c73bc4b7f84a..a4085a18b4bb 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java
@@ -17,14 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -63,52 +58,24 @@ private ZoneList(
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("id") && id != null) {
-      fieldMap.put("id", Collections.singletonList(String.valueOf(id)));
-    }
-    if (fieldNames.contains("items") && items != null) {
-      ImmutableList.Builder stringList = ImmutableList.builder();
-      for (Zone item : items) {
-        stringList.add(item.toString());
-      }
-      fieldMap.put("items", stringList.build());
-    }
-    if (fieldNames.contains("kind") && kind != null) {
-      fieldMap.put("kind", Collections.singletonList(String.valueOf(kind)));
-    }
-    if (fieldNames.contains("nextPageToken") && nextPageToken != null) {
-      fieldMap.put("nextPageToken", Collections.singletonList(String.valueOf(nextPageToken)));
-    }
-    if (fieldNames.contains("selfLink") && selfLink != null) {
-      fieldMap.put("selfLink", Collections.singletonList(String.valueOf(selfLink)));
-    }
-    if (fieldNames.contains("warning") && warning != null) {
-      fieldMap.put("warning", Collections.singletonList(String.valueOf(warning)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("id")) {
-      return String.valueOf(id);
+      return id;
     }
     if (fieldName.equals("items")) {
-      return String.valueOf(items);
+      return items;
     }
     if (fieldName.equals("kind")) {
-      return String.valueOf(kind);
+      return kind;
     }
     if (fieldName.equals("nextPageToken")) {
-      return String.valueOf(nextPageToken);
+      return nextPageToken;
     }
     if (fieldName.equals("selfLink")) {
-      return String.valueOf(selfLink);
+      return selfLink;
     }
     if (fieldName.equals("warning")) {
-      return String.valueOf(warning);
+      return warning;
     }
     return null;
   }
@@ -119,6 +86,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getId() {
     return id;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java
index af3946d967c1..e2a6f547e87b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java
@@ -17,12 +17,9 @@
 
 import com.google.api.core.BetaApi;
 import com.google.api.gax.httpjson.ApiMessage;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import javax.annotation.Generated;
 import javax.annotation.Nullable;
 
@@ -43,24 +40,12 @@ private ZoneSetLabelsRequest(String labelFingerprint, Map labels
   }
 
   @Override
-  public Map> populateFieldsInMap(Set fieldNames) {
-    Map> fieldMap = new HashMap<>();
-    if (fieldNames.contains("labelFingerprint") && labelFingerprint != null) {
-      fieldMap.put("labelFingerprint", Collections.singletonList(String.valueOf(labelFingerprint)));
-    }
-    if (fieldNames.contains("labels") && labels != null) {
-      fieldMap.put("labels", Collections.singletonList(String.valueOf(labels)));
-    }
-    return fieldMap;
-  }
-
-  @Override
-  public String getFieldStringValue(String fieldName) {
+  public Object getFieldValue(String fieldName) {
     if (fieldName.equals("labelFingerprint")) {
-      return String.valueOf(labelFingerprint);
+      return labelFingerprint;
     }
     if (fieldName.equals("labels")) {
-      return String.valueOf(labels);
+      return labels;
     }
     return null;
   }
@@ -71,6 +56,12 @@ public ApiMessage getApiMessageRequestBody() {
     return null;
   }
 
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
   public String getLabelFingerprint() {
     return labelFingerprint;
   }
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java
index 2106936a44e3..cedd68dfe55b 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java
@@ -44,8 +44,7 @@
  * 
  * try (AddressClient addressClient = AddressClient.create()) {
  *   ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
- *   String requestId = "";
- *   Operation response = addressClient.deleteAddress(address, requestId);
+ *   Operation response = addressClient.deleteAddress(address);
  * }
  * 
  * 
@@ -60,8 +59,7 @@ * * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) { * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - * String requestId = ""; - * Operation response = autoscalerClient.deleteAutoscaler(autoscaler, requestId); + * Operation response = autoscalerClient.deleteAutoscaler(autoscaler); * } * *
@@ -76,8 +74,7 @@ * * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) { * ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - * String requestId = ""; - * Operation response = backendBucketClient.deleteBackendBucket(backendBucket, requestId); + * Operation response = backendBucketClient.deleteBackendBucket(backendBucket); * } * *
@@ -91,9 +88,8 @@ *
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
- *   Operation response = backendServiceClient.deleteBackendService(requestId, backendService);
+ *   Operation response = backendServiceClient.deleteBackendService(backendService);
  * }
  * 
  * 
@@ -123,10 +119,9 @@ * * try (DiskClient diskClient = DiskClient.create()) { * ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - * String requestId = ""; * Boolean guestFlush = false; * Snapshot snapshotResource = Snapshot.newBuilder().build(); - * Operation response = diskClient.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource); + * Operation response = diskClient.createSnapshotDisk(disk, guestFlush, snapshotResource); * } * *
@@ -141,8 +136,7 @@ * * try (FirewallClient firewallClient = FirewallClient.create()) { * ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - * String requestId = ""; - * Operation response = firewallClient.deleteFirewall(firewall, requestId); + * Operation response = firewallClient.deleteFirewall(firewall); * } * *
@@ -156,9 +150,8 @@ *
  * 
  * try (ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient.create()) {
- *   String requestId = "";
  *   ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]");
- *   Operation response = forwardingRuleClient.deleteForwardingRule(requestId, forwardingRule);
+ *   Operation response = forwardingRuleClient.deleteForwardingRule(forwardingRule);
  * }
  * 
  * 
@@ -173,8 +166,7 @@ * * try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) { * ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); - * String requestId = ""; - * Operation response = globalAddressClient.deleteGlobalAddress(address, requestId); + * Operation response = globalAddressClient.deleteGlobalAddress(address); * } * *
@@ -188,9 +180,8 @@ *
  * 
  * try (GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]");
- *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(requestId, forwardingRule);
+ *   Operation response = globalForwardingRuleClient.deleteGlobalForwardingRule(forwardingRule);
  * }
  * 
  * 
@@ -219,9 +210,8 @@ *
  * 
  * try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]");
- *   Operation response = healthCheckClient.deleteHealthCheck(requestId, healthCheck);
+ *   Operation response = healthCheckClient.deleteHealthCheck(healthCheck);
  * }
  * 
  * 
@@ -235,9 +225,8 @@ *
  * 
  * try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
- *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(requestId, httpHealthCheck);
+ *   Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
  * }
  * 
  * 
@@ -252,8 +241,7 @@ * * try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) { * ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - * String requestId = ""; - * Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck, requestId); + * Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck); * } * *
@@ -268,8 +256,7 @@ * * try (ImageClient imageClient = ImageClient.create()) { * ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); - * String requestId = ""; - * Operation response = imageClient.deleteImage(image, requestId); + * Operation response = imageClient.deleteImage(image); * } * *
@@ -283,10 +270,9 @@ *
  * 
  * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
- *   String requestId = "";
  *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
  *   InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = instanceGroupManagerClient.abandonInstancesInstanceGroupManager(instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
@@ -300,10 +286,9 @@ *
  * 
  * try (InstanceGroupClient instanceGroupClient = InstanceGroupClient.create()) {
- *   String requestId = "";
  *   ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]");
  *   InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build();
- *   Operation response = instanceGroupClient.addInstancesInstanceGroup(requestId, instanceGroup, instanceGroupsAddInstancesRequestResource);
+ *   Operation response = instanceGroupClient.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource);
  * }
  * 
  * 
@@ -318,8 +303,7 @@ * * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) { * ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - * String requestId = ""; - * Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate, requestId); + * Operation response = instanceTemplateClient.deleteInstanceTemplate(instanceTemplate); * } * *
@@ -335,9 +319,8 @@ * try (InstanceClient instanceClient = InstanceClient.create()) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); * String networkInterface = ""; - * String requestId = ""; * AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + * Operation response = instanceClient.addAccessConfigInstance(instance, networkInterface, accessConfigResource); * } * *
@@ -351,9 +334,8 @@ *
  * 
  * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
- *   String requestId = "";
  *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
- *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(requestId, interconnectAttachment);
+ *   Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment);
  * }
  * 
  * 
@@ -382,9 +364,8 @@ *
  * 
  * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
- *   Operation response = interconnectClient.deleteInterconnect(requestId, interconnect);
+ *   Operation response = interconnectClient.deleteInterconnect(interconnect);
  * }
  * 
  * 
@@ -414,8 +395,7 @@ * * try (LicenseClient licenseClient = LicenseClient.create()) { * ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); - * String requestId = ""; - * Operation response = licenseClient.deleteLicense(license, requestId); + * Operation response = licenseClient.deleteLicense(license); * } * *
@@ -444,10 +424,9 @@ *
  * 
  * try (NetworkClient networkClient = NetworkClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]");
  *   NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build();
- *   Operation response = networkClient.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource);
+ *   Operation response = networkClient.addPeeringNetwork(network, networksAddPeeringRequestResource);
  * }
  * 
  * 
@@ -461,9 +440,8 @@ *
  * 
  * try (ProjectClient projectClient = ProjectClient.create()) {
- *   String requestId = "";
  *   ProjectName project = ProjectName.of("[PROJECT]");
- *   Operation response = projectClient.disableXpnHostProject(requestId, project);
+ *   Operation response = projectClient.disableXpnHostProject(project);
  * }
  * 
  * 
@@ -478,8 +456,7 @@ * * try (RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient.create()) { * ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - * String requestId = ""; - * Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler, requestId); + * Operation response = regionAutoscalerClient.deleteRegionAutoscaler(autoscaler); * } * *
@@ -493,9 +470,8 @@ *
  * 
  * try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
- *   String requestId = "";
  *   ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
- *   Operation response = regionBackendServiceClient.deleteRegionBackendService(requestId, backendService);
+ *   Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
  * }
  * 
  * 
@@ -540,9 +516,8 @@ * * try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) { * ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - * String requestId = ""; * Snapshot snapshotResource = Snapshot.newBuilder().build(); - * Operation response = regionDiskClient.createSnapshotRegionDisk(disk, requestId, snapshotResource); + * Operation response = regionDiskClient.createSnapshotRegionDisk(disk, snapshotResource); * } * *
@@ -557,10 +532,9 @@ *
  * 
  * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
- *   String requestId = "";
  *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
  *   RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
- *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(requestId, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
+ *   Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
  * }
  * 
  * 
@@ -620,8 +594,7 @@ * * try (RouterClient routerClient = RouterClient.create()) { * ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - * String requestId = ""; - * Operation response = routerClient.deleteRouter(router, requestId); + * Operation response = routerClient.deleteRouter(router); * } * *
@@ -636,8 +609,7 @@ * * try (RouteClient routeClient = RouteClient.create()) { * ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); - * String requestId = ""; - * Operation response = routeClient.deleteRoute(route, requestId); + * Operation response = routeClient.deleteRoute(route); * } * *
@@ -651,9 +623,8 @@ *
  * 
  * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- *   Operation response = snapshotClient.deleteSnapshot(requestId, snapshot);
+ *   Operation response = snapshotClient.deleteSnapshot(snapshot);
  * }
  * 
  * 
@@ -668,8 +639,7 @@ * * try (SslCertificateClient sslCertificateClient = SslCertificateClient.create()) { * ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); - * String requestId = ""; - * Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate, requestId); + * Operation response = sslCertificateClient.deleteSslCertificate(sslCertificate); * } * *
@@ -683,9 +653,8 @@ *
  * 
  * try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]");
- *   Operation response = sslPolicyClient.deleteSslPolicy(requestId, sslPolicy);
+ *   Operation response = sslPolicyClient.deleteSslPolicy(sslPolicy);
  * }
  * 
  * 
@@ -699,9 +668,8 @@ *
  * 
  * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
- *   String requestId = "";
  *   ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]");
- *   Operation response = subnetworkClient.deleteSubnetwork(requestId, subnetwork);
+ *   Operation response = subnetworkClient.deleteSubnetwork(subnetwork);
  * }
  * 
  * 
@@ -715,9 +683,8 @@ *
  * 
  * try (TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]");
- *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(requestId, targetHttpProxy);
+ *   Operation response = targetHttpProxyClient.deleteTargetHttpProxy(targetHttpProxy);
  * }
  * 
  * 
@@ -732,8 +699,7 @@ * * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) { * ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - * String requestId = ""; - * Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy, requestId); + * Operation response = targetHttpsProxyClient.deleteTargetHttpsProxy(targetHttpsProxy); * } * *
@@ -747,9 +713,8 @@ *
  * 
  * try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) {
- *   String requestId = "";
  *   ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]");
- *   Operation response = targetInstanceClient.deleteTargetInstance(requestId, targetInstance);
+ *   Operation response = targetInstanceClient.deleteTargetInstance(targetInstance);
  * }
  * 
  * 
@@ -764,9 +729,8 @@ * * try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) { * ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - * String requestId = ""; * TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); - * Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, requestId, targetPoolsAddHealthCheckRequestResource); + * Operation response = targetPoolClient.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); * } * *
@@ -781,8 +745,7 @@ * * try (TargetSslProxyClient targetSslProxyClient = TargetSslProxyClient.create()) { * ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - * String requestId = ""; - * Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy, requestId); + * Operation response = targetSslProxyClient.deleteTargetSslProxy(targetSslProxy); * } * *
@@ -796,9 +759,8 @@ *
  * 
  * try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) {
- *   String requestId = "";
  *   ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]");
- *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(requestId, targetTcpProxy);
+ *   Operation response = targetTcpProxyClient.deleteTargetTcpProxy(targetTcpProxy);
  * }
  * 
  * 
@@ -812,9 +774,8 @@ *
  * 
  * try (TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient.create()) {
- *   String requestId = "";
  *   ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]");
- *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(requestId, targetVpnGateway);
+ *   Operation response = targetVpnGatewayClient.deleteTargetVpnGateway(targetVpnGateway);
  * }
  * 
  * 
@@ -829,8 +790,7 @@ * * try (UrlMapClient urlMapClient = UrlMapClient.create()) { * ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - * String requestId = ""; - * Operation response = urlMapClient.deleteUrlMap(urlMap, requestId); + * Operation response = urlMapClient.deleteUrlMap(urlMap); * } * *
@@ -844,9 +804,8 @@ *
  * 
  * try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
- *   String requestId = "";
  *   ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]");
- *   Operation response = vpnTunnelClient.deleteVpnTunnel(requestId, vpnTunnel);
+ *   Operation response = vpnTunnelClient.deleteVpnTunnel(vpnTunnel);
  * }
  * 
  * 
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java index 71269115b288..597842fdabe8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java @@ -66,8 +66,6 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListAcceleratorTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/acceleratorTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -88,7 +86,6 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAcceleratorTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")) @@ -110,7 +107,6 @@ public class HttpJsonAcceleratorTypeStub extends AcceleratorTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAcceleratorTypesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/acceleratorTypes")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java index bc79b274fd0e..7092da29b4c0 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java @@ -66,7 +66,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -87,7 +86,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAddressHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -108,7 +106,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAddressHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/addresses/{address}")) .setQueryParams(Sets.newHashSet()) @@ -129,7 +126,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -149,7 +145,6 @@ public class HttpJsonAddressStub extends AddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java index 50d28633fe62..5247f8519acd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java @@ -69,7 +69,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/autoscalers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,7 +89,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -111,7 +109,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/autoscalers/{autoscaler}")) .setQueryParams(Sets.newHashSet()) @@ -132,7 +129,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -152,7 +148,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -173,7 +168,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -193,7 +187,6 @@ public class HttpJsonAutoscalerStub extends AutoscalerStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java index dc2e4c87bd40..e293e0781306 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java @@ -63,7 +63,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +83,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet()) @@ -105,7 +103,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListBackendBucketsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendBuckets")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -146,7 +142,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -167,7 +162,6 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateBackendBucketHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendBuckets/{backendBucket}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java index d4b898387ef5..707e2defa242 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java @@ -71,8 +71,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/backendServices")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -93,7 +91,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -114,7 +111,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet()) @@ -137,7 +133,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/backendServices/{backendService}/getHealth")) @@ -159,7 +154,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -179,7 +173,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/backendServices")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -200,7 +193,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -221,7 +213,6 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/backendServices/{backendService}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index d05faf374ce8..601895c004fb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -69,7 +69,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,7 +89,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(CreateSnapshotDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{disk}/createSnapshot")) .setQueryParams(Sets.newHashSet("guestFlush", "requestId")) @@ -111,7 +109,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) @@ -130,7 +127,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks/{disk}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneDiskName.newFactory()) @@ -150,7 +146,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) .setQueryParams(Sets.newHashSet("requestId", "sourceImage")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -170,7 +165,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -191,7 +185,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{disk}/resize")) .setQueryParams(Sets.newHashSet("requestId")) @@ -212,7 +205,6 @@ public class HttpJsonDiskStub extends DiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/disks/{resource}/setLabels")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java index 5763aab2b33e..8831d983a454 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java @@ -64,7 +64,6 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -85,7 +84,6 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetDiskTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/diskTypes/{diskType}")) .setQueryParams(Sets.newHashSet()) @@ -106,7 +104,6 @@ public class HttpJsonDiskTypeStub extends DiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java index 47a4e3218911..468a6224f60a 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java @@ -63,7 +63,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -83,7 +82,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -103,7 +101,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -123,7 +120,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListFirewallsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -144,7 +140,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) @@ -164,7 +159,6 @@ public class HttpJsonFirewallStub extends FirewallStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateFirewallHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/firewalls/{firewall}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalFirewallName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java index be620cb1bdd9..f6adf2664a38 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java @@ -69,8 +69,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/forwardingRules")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -91,7 +89,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}")) @@ -113,7 +110,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}")) @@ -135,7 +131,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams(Sets.newHashSet("requestId")) @@ -156,7 +151,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/forwardingRules")) .setQueryParams( @@ -178,7 +172,6 @@ public class HttpJsonForwardingRuleStub extends ForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTargetForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java index b0016d2ce018..2b904500960f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java @@ -61,7 +61,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) @@ -81,7 +80,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses/{address}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalAddressName.newFactory()) @@ -101,7 +99,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertGlobalAddressHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -121,7 +118,6 @@ public class HttpJsonGlobalAddressStub extends GlobalAddressStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalAddressesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/addresses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java index 9cbabb7f7df5..fa77e0ea9c16 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java @@ -62,8 +62,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +82,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/forwardingRules/{forwardingRule}")) .setQueryParams(Sets.newHashSet()) @@ -105,8 +102,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - InsertGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -126,7 +121,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalForwardingRulesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/forwardingRules")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,8 +142,6 @@ public class HttpJsonGlobalForwardingRuleStub extends GlobalForwardingRuleStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetTargetGlobalForwardingRuleHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/forwardingRules/{forwardingRule}/setTarget")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java index eb5098744995..ba198e28cb7e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java @@ -65,8 +65,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListGlobalOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -87,7 +85,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteGlobalOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -104,7 +101,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetGlobalOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -125,7 +121,6 @@ public class HttpJsonGlobalOperationStub extends GlobalOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListGlobalOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java index 6314d09d3cd2..7a376c55eedd 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java @@ -63,7 +63,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +83,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet()) @@ -105,7 +103,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/healthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -146,7 +142,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -167,7 +162,6 @@ public class HttpJsonHealthCheckStub extends HealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/healthChecks/{healthCheck}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java index 694e165658c9..5e95d6cba767 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java @@ -63,7 +63,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -85,7 +84,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -107,7 +105,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHttpHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpHealthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,7 +144,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) @@ -170,7 +165,6 @@ public class HttpJsonHttpHealthCheckStub extends HttpHealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHttpHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpHealthChecks/{httpHealthCheck}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java index 5715b291ee87..6005410adb56 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java @@ -63,7 +63,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -85,7 +84,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -107,7 +105,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListHttpsHealthChecksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/httpsHealthChecks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,7 +144,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) @@ -170,7 +165,6 @@ public class HttpJsonHttpsHealthCheckStub extends HttpsHealthCheckStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateHttpsHealthCheckHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/httpsHealthChecks/{httpsHealthCheck}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index ed43ce6d9584..56beeda780b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -66,7 +66,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalImageName.newFactory()) @@ -86,7 +85,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeprecateImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/{image}/deprecate")) .setQueryParams(Sets.newHashSet("requestId")) @@ -106,7 +104,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images/{image}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalImageName.newFactory()) @@ -126,7 +123,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetFromFamilyImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/family/{family}")) .setQueryParams(Sets.newHashSet()) @@ -147,7 +143,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertImageHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams(Sets.newHashSet("forceCreate", "requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -167,7 +162,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListImagesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/images")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -188,7 +182,6 @@ public class HttpJsonImageStub extends ImageStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsImageHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/images/{resource}/setLabels")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index 987c4b18e78e..392f69a3c76d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -76,8 +76,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AbandonInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) @@ -103,8 +101,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/instanceGroupManagers")) .setQueryParams( @@ -126,8 +122,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) @@ -151,8 +145,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) @@ -174,7 +166,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) @@ -196,8 +187,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - InsertInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -220,7 +209,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instanceGroupManagers")) .setQueryParams( @@ -248,8 +236,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListManagedInstancesInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) @@ -277,8 +263,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RecreateInstancesInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) @@ -300,8 +284,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - ResizeInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")) @@ -326,8 +308,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetInstanceTemplateInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) @@ -350,8 +330,6 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetTargetPoolsInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java index 1de6f6a0ac03..788a010acc13 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java @@ -71,7 +71,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")) @@ -96,8 +95,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/instanceGroups")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -118,7 +115,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) @@ -140,7 +136,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}")) @@ -162,7 +157,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -182,7 +176,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instanceGroups")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -206,8 +199,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListInstancesInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")) @@ -231,8 +222,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RemoveInstancesInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")) @@ -254,8 +243,6 @@ public class HttpJsonInstanceGroupStub extends InstanceGroupStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - SetNamedPortsInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index ecf4d2ff151a..8ee9c52e86bb 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -91,7 +91,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/addAccessConfig")) @@ -115,7 +114,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/instances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -136,7 +134,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AttachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/attachDisk")) @@ -158,7 +155,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -179,8 +175,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")) @@ -203,7 +197,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DetachDiskInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/detachDisk")) @@ -225,7 +218,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}")) .setQueryParams(Sets.newHashSet()) @@ -247,8 +239,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - GetSerialPortOutputInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/serialPort")) @@ -270,7 +260,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams( Sets.newHashSet("requestId", "sourceInstanceTemplate")) @@ -291,7 +280,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/instances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -312,7 +300,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListReferrersInstancesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/referrers")) @@ -335,7 +322,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/reset")) .setQueryParams(Sets.newHashSet("requestId")) @@ -357,8 +343,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetDeletionProtectionInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")) @@ -380,7 +364,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetDiskAutoDeleteInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")) @@ -403,7 +386,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setLabels")) @@ -426,8 +408,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetMachineResourcesInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMachineResources")) @@ -449,7 +429,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMachineTypeInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMachineType")) @@ -471,7 +450,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMetadataInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMetadata")) @@ -493,7 +471,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetMinCpuPlatformInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")) @@ -515,7 +492,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetSchedulingInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setScheduling")) @@ -537,7 +513,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetServiceAccountInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setServiceAccount")) @@ -559,7 +534,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetTagsInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/setTags")) @@ -581,7 +555,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StartInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/start")) .setQueryParams(Sets.newHashSet("requestId")) @@ -603,8 +576,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - StartWithEncryptionKeyInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")) @@ -626,7 +597,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(StopInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/instances/{instance}/stop")) .setQueryParams(Sets.newHashSet("requestId")) @@ -647,8 +617,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - UpdateAccessConfigInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")) @@ -671,8 +639,6 @@ public class HttpJsonInstanceStub extends InstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - UpdateNetworkInterfaceInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index 1a4abca55ce5..bc01f1963a26 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -61,7 +61,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/instanceTemplates/{instanceTemplate}")) @@ -83,7 +82,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/instanceTemplates/{instanceTemplate}")) @@ -105,7 +103,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInstanceTemplateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInstanceTemplatesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/instanceTemplates")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java index 44952dab3864..b6878ea5897b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java @@ -70,8 +70,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListInterconnectAttachmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/interconnectAttachments")) .setQueryParams( @@ -95,8 +93,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) @@ -120,7 +116,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")) @@ -143,8 +138,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - InsertInterconnectAttachmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) .setQueryParams(Sets.newHashSet("requestId")) @@ -168,8 +161,6 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListInterconnectAttachmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/interconnectAttachments")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java index 7c323e58ba1c..e8c631e04b58 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java @@ -58,7 +58,6 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectLocationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/interconnectLocations/{interconnectLocation}")) @@ -82,7 +81,6 @@ public class HttpJsonInterconnectLocationStub extends InterconnectLocationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectLocationsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnectLocations")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java index 7c53ea5eaac0..b1b15eb95a92 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -62,7 +62,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -83,7 +82,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet()) @@ -104,7 +102,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,7 +121,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListInterconnectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/interconnects")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -145,7 +141,6 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchInterconnectHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/interconnects/{interconnect}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java index 56199ba78943..6d6cb808fb5d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java @@ -56,7 +56,6 @@ public class HttpJsonLicenseCodeStub extends LicenseCodeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetLicenseCodeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/licenseCodes/{licenseCode}")) .setQueryParams(Sets.newHashSet()) @@ -80,8 +79,6 @@ public class HttpJsonLicenseCodeStub extends LicenseCodeStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - TestIamPermissionsLicenseCodeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/licenseCodes/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java index 2cff99d85cfd..a3e2dbb86fb3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -64,7 +64,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) @@ -84,7 +83,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses/{license}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalLicenseName.newFactory()) @@ -104,7 +102,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertLicenseHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -124,7 +121,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListLicensesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/licenses")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -147,7 +143,6 @@ public class HttpJsonLicenseStub extends LicenseStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(TestIamPermissionsLicenseHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/licenses/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java index 61b731aec0ce..3481d3b7a886 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java @@ -64,8 +64,6 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - AggregatedListMachineTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/machineTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -86,7 +84,6 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetMachineTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/machineTypes/{machineType}")) .setQueryParams(Sets.newHashSet()) @@ -107,7 +104,6 @@ public class HttpJsonMachineTypeStub extends MachineTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListMachineTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/machineTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java index 74017edbc6fb..e6749f921a7b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java @@ -65,7 +65,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddPeeringNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/networks/{network}/addPeering")) .setQueryParams(Sets.newHashSet("requestId")) @@ -86,7 +85,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -106,7 +104,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -126,7 +123,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -146,7 +142,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListNetworksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -167,7 +162,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchNetworkHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/networks/{network}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalNetworkName.newFactory()) @@ -187,7 +181,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemovePeeringNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/networks/{network}/removePeering")) .setQueryParams(Sets.newHashSet("requestId")) @@ -208,7 +201,6 @@ public class HttpJsonNetworkStub extends NetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SwitchToCustomModeNetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/networks/{network}/switchToCustomMode")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index d1567f5830c6..e85bff516d78 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -70,7 +70,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DisableXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/disableXpnHost")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -90,7 +89,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DisableXpnResourceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/disableXpnResource")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -110,7 +108,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(EnableXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/enableXpnHost")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -130,7 +127,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(EnableXpnResourceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/enableXpnResource")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -150,7 +146,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectName.newFactory()) @@ -170,7 +165,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetXpnHostProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/getXpnHost")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectName.newFactory()) @@ -192,7 +186,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetXpnResourcesProjectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/getXpnResources")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) @@ -213,7 +206,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListXpnHostsProjectsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/listXpnHosts")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "order_by", "pageToken")) @@ -234,7 +226,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(MoveDiskProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveDisk")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -254,7 +245,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(MoveInstanceProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/moveInstance")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -275,8 +265,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetCommonInstanceMetadataProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setCommonInstanceMetadata")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -297,8 +285,6 @@ public class HttpJsonProjectStub extends ProjectStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetUsageExportBucketProjectHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/setUsageExportBucket")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java index a334a165b06e..14edae389a0e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java @@ -63,7 +63,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/autoscalers/{autoscaler}")) @@ -85,7 +84,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/autoscalers/{autoscaler}")) @@ -107,7 +105,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -128,7 +125,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionAutoscalersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams( @@ -150,7 +146,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) @@ -171,7 +166,6 @@ public class HttpJsonRegionAutoscalerStub extends RegionAutoscalerStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRegionAutoscalerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/autoscalers")) .setQueryParams(Sets.newHashSet("autoscaler", "requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java index 29fb7291a39f..dda6e4aa0ab3 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java @@ -65,8 +65,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - DeleteRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -88,7 +86,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -113,8 +110,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - GetHealthRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}/getHealth")) @@ -136,8 +131,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - InsertRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams(Sets.newHashSet("requestId")) @@ -158,7 +151,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionBackendServicesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/backendServices")) .setQueryParams( @@ -180,7 +172,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) @@ -202,8 +193,6 @@ public class HttpJsonRegionBackendServiceStub extends RegionBackendServiceStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - UpdateRegionBackendServiceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/backendServices/{backendService}")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java index c029a17b62dc..5dfe80b2b250 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java @@ -67,8 +67,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListRegionCommitmentsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/commitments")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -89,7 +87,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionCommitmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/commitments/{commitment}")) @@ -111,7 +108,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionCommitmentHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/commitments")) .setQueryParams(Sets.newHashSet("requestId")) @@ -132,7 +128,6 @@ public class HttpJsonRegionCommitmentStub extends RegionCommitmentStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionCommitmentsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/commitments")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java index 84e973aa4f46..da608a53ae8c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java @@ -67,7 +67,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(CreateSnapshotRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/disks/{disk}/createSnapshot")) @@ -89,7 +88,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/disks/{disk}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -110,7 +108,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/disks/{disk}")) .setQueryParams(Sets.newHashSet()) @@ -131,7 +128,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/disks")) .setQueryParams(Sets.newHashSet("requestId", "sourceImage")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -151,7 +147,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionDisksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/disks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -172,7 +167,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ResizeRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/disks/{disk}/resize")) .setQueryParams(Sets.newHashSet("requestId")) @@ -193,7 +187,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/disks/{resource}/setLabels")) @@ -218,8 +211,6 @@ public class HttpJsonRegionDiskStub extends RegionDiskStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - TestIamPermissionsRegionDiskHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/disks/{resource}/testIamPermissions")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java index 7026a3e42be2..ea333312e0fa 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java @@ -58,7 +58,6 @@ public class HttpJsonRegionDiskTypeStub extends RegionDiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionDiskTypeHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/diskTypes/{diskType}")) .setQueryParams(Sets.newHashSet()) @@ -79,7 +78,6 @@ public class HttpJsonRegionDiskTypeStub extends RegionDiskTypeStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionDiskTypesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/diskTypes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index 9ea79f7beef7..cb4fbae5818d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -72,9 +72,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AbandonInstancesRegionInstanceGroupManagerHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")) @@ -97,8 +94,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) @@ -123,8 +118,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - DeleteInstancesRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")) @@ -149,8 +142,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - GetRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) @@ -173,8 +164,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - InsertRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams(Sets.newHashSet("requestId")) @@ -199,8 +188,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListRegionInstanceGroupManagersHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroupManagers")) .setQueryParams( @@ -228,9 +215,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListManagedInstancesRegionInstanceGroupManagersHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")) @@ -258,9 +242,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RecreateInstancesRegionInstanceGroupManagerHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")) @@ -283,8 +264,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ResizeRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")) @@ -309,9 +288,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetInstanceTemplateRegionInstanceGroupManagerHttpRequest - .getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")) @@ -336,8 +312,6 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetTargetPoolsRegionInstanceGroupManagerHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java index 5ec45e732bab..a3449b0d5f30 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java @@ -63,7 +63,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}")) @@ -87,7 +86,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/instanceGroups")) .setQueryParams( @@ -113,8 +111,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListInstancesRegionInstanceGroupsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")) @@ -138,8 +134,6 @@ public class HttpJsonRegionInstanceGroupStub extends RegionInstanceGroupStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetNamedPortsRegionInstanceGroupHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java index da8b445f7610..b29c529b77b9 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java @@ -59,7 +59,6 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRegionOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -76,7 +75,6 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -97,7 +95,6 @@ public class HttpJsonRegionOperationStub extends RegionOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java index f4ada3539b17..873fb2367dac 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java @@ -57,7 +57,6 @@ public class HttpJsonRegionStub extends RegionStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRegionHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -77,7 +76,6 @@ public class HttpJsonRegionStub extends RegionStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRegionsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java index 454da75c6930..1e148d400c27 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java @@ -61,7 +61,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) @@ -80,7 +79,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes/{route}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalRouteName.newFactory()) @@ -100,7 +98,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouteHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -120,7 +117,6 @@ public class HttpJsonRouteStub extends RouteStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/routes")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index 6840b113e982..f47074367384 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -71,7 +71,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListRoutersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/routers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -92,7 +91,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -112,7 +110,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet()) @@ -133,7 +130,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetRouterStatusRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/routers/{router}/getRouterStatus")) @@ -155,7 +151,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertRouterHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -175,7 +170,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListRoutersHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/routers")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -196,7 +190,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -217,7 +210,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PreviewRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/routers/{router}/preview")) @@ -239,7 +231,6 @@ public class HttpJsonRouterStub extends RouterStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateRouterHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/routers/{router}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 5fdf58c8c7a1..5cc1d823aa4c 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -62,7 +62,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) @@ -82,7 +81,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots/{snapshot}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalSnapshotName.newFactory()) @@ -102,7 +100,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSnapshotsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/snapshots")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -123,7 +120,6 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetLabelsSnapshotHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/snapshots/{resource}/setLabels")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java index 8d534e6e71e1..e1745d8b7bc4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java @@ -61,7 +61,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -82,7 +81,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslCertificates/{sslCertificate}")) .setQueryParams(Sets.newHashSet()) @@ -103,7 +101,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSslCertificateHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -123,7 +120,6 @@ public class HttpJsonSslCertificateStub extends SslCertificateStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSslCertificatesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslCertificates")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java index d3d8945ccdd7..7d2aa520fa59 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java @@ -64,7 +64,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -85,7 +84,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet()) @@ -106,7 +104,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -126,7 +123,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSslPoliciesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/sslPolicies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -152,8 +148,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ListAvailableFeaturesSslPoliciesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/listAvailableFeatures")) .setQueryParams( @@ -177,7 +171,6 @@ public class HttpJsonSslPolicyStub extends SslPolicyStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchSslPolicyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/sslPolicies/{sslPolicy}")) .setQueryParams(Sets.newHashSet("requestId")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index 368173fdb653..c49c72f72b9b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -70,7 +70,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListSubnetworksHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/subnetworks")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -91,7 +90,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -114,8 +112,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - ExpandIpCidrRangeSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")) @@ -137,7 +133,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -159,7 +154,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams(Sets.newHashSet("requestId")) @@ -180,7 +174,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListSubnetworksHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/subnetworks")) .setQueryParams( @@ -202,7 +195,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}")) @@ -225,8 +217,6 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetPrivateIpGoogleAccessSubnetworkHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java index b8b409dc14d5..9b774747118b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java @@ -63,7 +63,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpProxies/{targetHttpProxy}")) @@ -85,7 +84,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpProxies/{targetHttpProxy}")) @@ -107,7 +105,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetHttpProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -148,7 +144,6 @@ public class HttpJsonTargetHttpProxyStub extends TargetHttpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUrlMapTargetHttpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index ecdb1d01ac5c..1e017d23839e 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -65,7 +65,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) @@ -87,7 +86,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}")) @@ -109,7 +107,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -129,7 +126,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetHttpsProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetHttpsProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -151,8 +147,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetSslCertificatesTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")) @@ -175,8 +169,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetSslPolicyTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")) @@ -198,7 +190,6 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetUrlMapTargetHttpsProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java index 75f70874fa4f..6c72a4757756 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java @@ -68,8 +68,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListTargetInstancesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/targetInstances")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -90,7 +88,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/targetInstances/{targetInstance}")) @@ -112,7 +109,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/zones/{zone}/targetInstances/{targetInstance}")) @@ -134,7 +130,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetInstanceHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams(Sets.newHashSet("requestId")) @@ -155,7 +150,6 @@ public class HttpJsonTargetInstanceStub extends TargetInstanceStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetInstancesHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/targetInstances")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java index 833ffc5c5ea0..4f7711c7a176 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java @@ -72,7 +72,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")) @@ -94,7 +93,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AddInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/addInstance")) @@ -118,7 +116,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListTargetPoolsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/targetPools")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -139,7 +136,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}")) @@ -161,7 +157,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}")) @@ -183,7 +178,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetHealthTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/getHealth")) @@ -205,7 +199,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams(Sets.newHashSet("requestId")) @@ -226,7 +219,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetPoolsHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetPools")) .setQueryParams( @@ -249,8 +241,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - RemoveHealthCheckTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")) @@ -272,7 +262,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(RemoveInstanceTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")) @@ -294,7 +283,6 @@ public class HttpJsonTargetPoolStub extends TargetPoolStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(SetBackupTargetPoolHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetPools/{targetPool}/setBackup")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java index 1261642c4672..ed85e9da385d 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java @@ -65,7 +65,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -86,7 +85,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetSslProxies/{targetSslProxy}")) .setQueryParams(Sets.newHashSet()) @@ -107,7 +105,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -127,7 +124,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetSslProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetSslProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -149,8 +145,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetBackendServiceTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")) @@ -173,8 +167,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetProxyHeaderTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")) @@ -197,8 +189,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetSslCertificatesTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")) @@ -220,8 +210,6 @@ public class HttpJsonTargetSslProxyStub extends TargetSslProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance( - SetSslPolicyTargetSslProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java index 4773e569571a..f9730e9be9ad 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java @@ -63,7 +63,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -84,7 +83,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/targetTcpProxies/{targetTcpProxy}")) .setQueryParams(Sets.newHashSet()) @@ -105,7 +103,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetTcpProxiesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/targetTcpProxies")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -147,8 +143,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetBackendServiceTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")) @@ -171,8 +165,6 @@ public class HttpJsonTargetTcpProxyStub extends TargetTcpProxyStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - SetProxyHeaderTargetTcpProxyHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java index f76dc9f7befe..fecf358a7ac4 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java @@ -69,8 +69,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setRequestFormatter( ApiMessageHttpRequestFormatter .newBuilder() - .setRequestInstance( - AggregatedListTargetVpnGatewaysHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/aggregated/targetVpnGateways")) .setQueryParams( @@ -92,7 +90,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) @@ -114,7 +111,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create( "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")) @@ -136,7 +132,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertTargetVpnGatewayHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams(Sets.newHashSet("requestId")) @@ -157,7 +152,6 @@ public class HttpJsonTargetVpnGatewayStub extends TargetVpnGatewayStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListTargetVpnGatewaysHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/targetVpnGateways")) .setQueryParams( diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java index 056c98ad0fdc..e50d38214193 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java @@ -66,7 +66,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -85,7 +84,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -105,7 +103,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectName.newFactory()) @@ -125,7 +122,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InvalidateCacheUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/urlMaps/{urlMap}/invalidateCache")) .setQueryParams(Sets.newHashSet("requestId")) @@ -146,7 +142,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListUrlMapsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -167,7 +162,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.PATCH) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(PatchUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -187,7 +181,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.PUT) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(UpdateUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/global/urlMaps/{urlMap}")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectGlobalUrlMapName.newFactory()) @@ -207,7 +200,6 @@ public class HttpJsonUrlMapStub extends UrlMapStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ValidateUrlMapHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/global/urlMaps/{urlMap}/validate")) .setQueryParams(Sets.newHashSet()) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java index adf45ca0d010..f5c8756cc4a8 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java @@ -67,7 +67,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(AggregatedListVpnTunnelsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/aggregated/vpnTunnels")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) @@ -88,7 +87,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet("requestId")) @@ -109,7 +107,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/regions/{region}/vpnTunnels/{vpnTunnel}")) .setQueryParams(Sets.newHashSet()) @@ -130,7 +127,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.POST) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(InsertVpnTunnelHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams(Sets.newHashSet("requestId")) .setResourceNameFactory(ProjectRegionName.newFactory()) @@ -150,7 +146,6 @@ public class HttpJsonVpnTunnelStub extends VpnTunnelStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListVpnTunnelsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/regions/{region}/vpnTunnels")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java index f89a38af5a8f..76ecb0954782 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java @@ -59,7 +59,6 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.DELETE) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(DeleteZoneOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -76,7 +75,6 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetZoneOperationHttpRequest.getDefaultInstance()) .setPathTemplate( PathTemplate.create("{project}/zones/{zone}/operations/{operation}")) .setQueryParams(Sets.newHashSet()) @@ -97,7 +95,6 @@ public class HttpJsonZoneOperationStub extends ZoneOperationStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListZoneOperationsHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/operations")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java index fcf298ddb2df..2e5d57eedf72 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java @@ -57,7 +57,6 @@ public class HttpJsonZoneStub extends ZoneStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(GetZoneHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones/{zone}")) .setQueryParams(Sets.newHashSet()) .setResourceNameFactory(ProjectZoneName.newFactory()) @@ -77,7 +76,6 @@ public class HttpJsonZoneStub extends ZoneStub { .setHttpMethod(HttpMethods.GET) .setRequestFormatter( ApiMessageHttpRequestFormatter.newBuilder() - .setRequestInstance(ListZonesHttpRequest.getDefaultInstance()) .setPathTemplate(PathTemplate.create("{project}/zones")) .setQueryParams( Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index 5e93ed070f5c..14bade32a966 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -202,9 +202,8 @@ public void deleteAddressTest() { ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteAddress(address, requestId); + Operation actualResponse = client.deleteAddress(address); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -233,9 +232,8 @@ public void deleteAddressExceptionTest() throws Exception { try { ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]"); - String requestId = "requestId37109963"; - client.deleteAddress(address, requestId); + client.deleteAddress(address); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -365,11 +363,10 @@ public void insertAddressTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Address addressResource = Address.newBuilder().build(); - Operation actualResponse = client.insertAddress(requestId, region, addressResource); + Operation actualResponse = client.insertAddress(region, addressResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -396,11 +393,10 @@ public void insertAddressExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Address addressResource = Address.newBuilder().build(); - client.insertAddress(requestId, region, addressResource); + client.insertAddress(region, addressResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java index d7980716d32a..f1d69cadbd2a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java @@ -206,9 +206,8 @@ public void deleteAutoscalerTest() { ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteAutoscaler(autoscaler, requestId); + Operation actualResponse = client.deleteAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -237,9 +236,8 @@ public void deleteAutoscalerExceptionTest() throws Exception { try { ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]"); - String requestId = "requestId37109963"; - client.deleteAutoscaler(autoscaler, requestId); + client.deleteAutoscaler(autoscaler); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -365,10 +363,9 @@ public void insertAutoscalerTest() { mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.insertAutoscaler(zone, requestId, autoscalerResource); + Operation actualResponse = client.insertAutoscaler(zone, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -396,10 +393,9 @@ public void insertAutoscalerExceptionTest() throws Exception { try { ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.insertAutoscaler(zone, requestId, autoscalerResource); + client.insertAutoscaler(zone, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -518,11 +514,9 @@ public void patchAutoscalerTest() { String autoscaler = "autoscaler517258967"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource); + Operation actualResponse = client.patchAutoscaler(autoscaler, zone, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -551,10 +545,9 @@ public void patchAutoscalerExceptionTest() throws Exception { try { String autoscaler = "autoscaler517258967"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.patchAutoscaler(autoscaler, zone, requestId, autoscalerResource); + client.patchAutoscaler(autoscaler, zone, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -613,11 +606,9 @@ public void updateAutoscalerTest() { String autoscaler = "autoscaler517258967"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource); + Operation actualResponse = client.updateAutoscaler(autoscaler, zone, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -646,10 +637,9 @@ public void updateAutoscalerExceptionTest() throws Exception { try { String autoscaler = "autoscaler517258967"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.updateAutoscaler(autoscaler, zone, requestId, autoscalerResource); + client.updateAutoscaler(autoscaler, zone, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java index f20900a4e2b2..38917bc24fab 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java @@ -138,9 +138,8 @@ public void deleteBackendBucketTest() { ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteBackendBucket(backendBucket, requestId); + Operation actualResponse = client.deleteBackendBucket(backendBucket); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -169,9 +168,8 @@ public void deleteBackendBucketExceptionTest() throws Exception { try { ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - String requestId = "requestId37109963"; - client.deleteBackendBucket(backendBucket, requestId); + client.deleteBackendBucket(backendBucket); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -292,12 +290,10 @@ public void insertBackendBucketTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); - Operation actualResponse = - client.insertBackendBucket(requestId, project, backendBucketResource); + Operation actualResponse = client.insertBackendBucket(project, backendBucketResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -324,11 +320,10 @@ public void insertBackendBucketExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); - client.insertBackendBucket(requestId, project, backendBucketResource); + client.insertBackendBucket(project, backendBucketResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -447,11 +442,9 @@ public void patchBackendBucketTest() { ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); - Operation actualResponse = - client.patchBackendBucket(backendBucket, requestId, backendBucketResource); + Operation actualResponse = client.patchBackendBucket(backendBucket, backendBucketResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -480,10 +473,9 @@ public void patchBackendBucketExceptionTest() throws Exception { try { ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); - client.patchBackendBucket(backendBucket, requestId, backendBucketResource); + client.patchBackendBucket(backendBucket, backendBucketResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -542,11 +534,9 @@ public void updateBackendBucketTest() { ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); - Operation actualResponse = - client.updateBackendBucket(backendBucket, requestId, backendBucketResource); + Operation actualResponse = client.updateBackendBucket(backendBucket, backendBucketResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -575,10 +565,9 @@ public void updateBackendBucketExceptionTest() throws Exception { try { ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - String requestId = "requestId37109963"; BackendBucket backendBucketResource = BackendBucket.newBuilder().build(); - client.updateBackendBucket(backendBucket, requestId, backendBucketResource); + client.updateBackendBucket(backendBucket, backendBucketResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index 95e69a22696b..1913b10f6f89 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -206,11 +206,10 @@ public void deleteBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - Operation actualResponse = client.deleteBackendService(requestId, backendService); + Operation actualResponse = client.deleteBackendService(backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -237,11 +236,10 @@ public void deleteBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - client.deleteBackendService(requestId, backendService); + client.deleteBackendService(backendService); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -431,12 +429,10 @@ public void insertBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - Operation actualResponse = - client.insertBackendService(requestId, project, backendServiceResource); + Operation actualResponse = client.insertBackendService(project, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -463,11 +459,10 @@ public void insertBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.insertBackendService(requestId, project, backendServiceResource); + client.insertBackendService(project, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -584,13 +579,11 @@ public void patchBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - Operation actualResponse = - client.patchBackendService(requestId, backendService, backendServiceResource); + Operation actualResponse = client.patchBackendService(backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -617,12 +610,11 @@ public void patchBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.patchBackendService(requestId, backendService, backendServiceResource); + client.patchBackendService(backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -679,13 +671,11 @@ public void updateBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - Operation actualResponse = - client.updateBackendService(requestId, backendService, backendServiceResource); + Operation actualResponse = client.updateBackendService(backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -712,12 +702,11 @@ public void updateBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.updateBackendService(requestId, backendService, backendServiceResource); + client.updateBackendService(backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 60e6d5fb4771..94683e69e0cd 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -206,12 +206,10 @@ public void createSnapshotDiskTest() { mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - String requestId = "requestId37109963"; Boolean guestFlush = false; Snapshot snapshotResource = Snapshot.newBuilder().build(); - Operation actualResponse = - client.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource); + Operation actualResponse = client.createSnapshotDisk(disk, guestFlush, snapshotResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -239,11 +237,10 @@ public void createSnapshotDiskExceptionTest() throws Exception { try { ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - String requestId = "requestId37109963"; Boolean guestFlush = false; Snapshot snapshotResource = Snapshot.newBuilder().build(); - client.createSnapshotDisk(disk, requestId, guestFlush, snapshotResource); + client.createSnapshotDisk(disk, guestFlush, snapshotResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -301,9 +298,8 @@ public void deleteDiskTest() { mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteDisk(disk, requestId); + Operation actualResponse = client.deleteDisk(disk); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -331,9 +327,8 @@ public void deleteDiskExceptionTest() throws Exception { try { ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - String requestId = "requestId37109963"; - client.deleteDisk(disk, requestId); + client.deleteDisk(disk); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -475,11 +470,9 @@ public void insertDiskTest() { mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; - String sourceImage = "sourceImage1661056055"; Disk diskResource = Disk.newBuilder().build(); - Operation actualResponse = client.insertDisk(zone, requestId, sourceImage, diskResource); + Operation actualResponse = client.insertDisk(zone, diskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -507,11 +500,9 @@ public void insertDiskExceptionTest() throws Exception { try { ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; - String sourceImage = "sourceImage1661056055"; Disk diskResource = Disk.newBuilder().build(); - client.insertDisk(zone, requestId, sourceImage, diskResource); + client.insertDisk(zone, diskResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -629,10 +620,9 @@ public void resizeDiskTest() { mockService.addResponse(expectedResponse); ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - String requestId = "requestId37109963"; DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); - Operation actualResponse = client.resizeDisk(disk, requestId, disksResizeRequestResource); + Operation actualResponse = client.resizeDisk(disk, disksResizeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -660,10 +650,9 @@ public void resizeDiskExceptionTest() throws Exception { try { ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); - String requestId = "requestId37109963"; DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build(); - client.resizeDisk(disk, requestId, disksResizeRequestResource); + client.resizeDisk(disk, disksResizeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -722,11 +711,9 @@ public void setLabelsDiskTest() { ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); - String requestId = "requestId37109963"; ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build(); - Operation actualResponse = - client.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource); + Operation actualResponse = client.setLabelsDisk(resource, zoneSetLabelsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -755,10 +742,9 @@ public void setLabelsDiskExceptionTest() throws Exception { try { ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); - String requestId = "requestId37109963"; ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build(); - client.setLabelsDisk(resource, requestId, zoneSetLabelsRequestResource); + client.setLabelsDisk(resource, zoneSetLabelsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java index 9532b1fe0654..c36d014f97fc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java @@ -137,9 +137,8 @@ public void deleteFirewallTest() { mockService.addResponse(expectedResponse); ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteFirewall(firewall, requestId); + Operation actualResponse = client.deleteFirewall(firewall); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -167,9 +166,8 @@ public void deleteFirewallExceptionTest() throws Exception { try { ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - String requestId = "requestId37109963"; - client.deleteFirewall(firewall, requestId); + client.deleteFirewall(firewall); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -290,11 +288,10 @@ public void insertFirewallTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Firewall firewallResource = Firewall.newBuilder().build(); - Operation actualResponse = client.insertFirewall(requestId, project, firewallResource); + Operation actualResponse = client.insertFirewall(project, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -321,11 +318,10 @@ public void insertFirewallExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Firewall firewallResource = Firewall.newBuilder().build(); - client.insertFirewall(requestId, project, firewallResource); + client.insertFirewall(project, firewallResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -443,10 +439,9 @@ public void patchFirewallTest() { mockService.addResponse(expectedResponse); ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - Operation actualResponse = client.patchFirewall(firewall, requestId, firewallResource); + Operation actualResponse = client.patchFirewall(firewall, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -474,10 +469,9 @@ public void patchFirewallExceptionTest() throws Exception { try { ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - client.patchFirewall(firewall, requestId, firewallResource); + client.patchFirewall(firewall, firewallResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -535,10 +529,9 @@ public void updateFirewallTest() { mockService.addResponse(expectedResponse); ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - Operation actualResponse = client.updateFirewall(firewall, requestId, firewallResource); + Operation actualResponse = client.updateFirewall(firewall, firewallResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -566,10 +559,9 @@ public void updateFirewallExceptionTest() throws Exception { try { ProjectGlobalFirewallName firewall = ProjectGlobalFirewallName.of("[PROJECT]", "[FIREWALL]"); - String requestId = "requestId37109963"; Firewall firewallResource = Firewall.newBuilder().build(); - client.updateFirewall(firewall, requestId, firewallResource); + client.updateFirewall(firewall, firewallResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 276fe84f04fc..d6c94aead3a6 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -202,11 +202,10 @@ public void deleteForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); - Operation actualResponse = client.deleteForwardingRule(requestId, forwardingRule); + Operation actualResponse = client.deleteForwardingRule(forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -233,11 +232,10 @@ public void deleteForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); - client.deleteForwardingRule(requestId, forwardingRule); + client.deleteForwardingRule(forwardingRule); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -376,12 +374,10 @@ public void insertForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); - Operation actualResponse = - client.insertForwardingRule(requestId, region, forwardingRuleResource); + Operation actualResponse = client.insertForwardingRule(region, forwardingRuleResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -408,11 +404,10 @@ public void insertForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); - client.insertForwardingRule(requestId, region, forwardingRuleResource); + client.insertForwardingRule(region, forwardingRuleResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -529,13 +524,12 @@ public void setTargetForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = - client.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource); + client.setTargetForwardingRule(forwardingRule, targetReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -562,12 +556,11 @@ public void setTargetForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionForwardingRuleName forwardingRule = ProjectRegionForwardingRuleName.of("[PROJECT]", "[REGION]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); - client.setTargetForwardingRule(requestId, forwardingRule, targetReferenceResource); + client.setTargetForwardingRule(forwardingRule, targetReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index b421f542bb85..d73efe4dd9e7 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -133,9 +133,8 @@ public void deleteGlobalAddressTest() { mockService.addResponse(expectedResponse); ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteGlobalAddress(address, requestId); + Operation actualResponse = client.deleteGlobalAddress(address); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -163,9 +162,8 @@ public void deleteGlobalAddressExceptionTest() throws Exception { try { ProjectGlobalAddressName address = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); - String requestId = "requestId37109963"; - client.deleteGlobalAddress(address, requestId); + client.deleteGlobalAddress(address); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -293,11 +291,10 @@ public void insertGlobalAddressTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Address addressResource = Address.newBuilder().build(); - Operation actualResponse = client.insertGlobalAddress(requestId, project, addressResource); + Operation actualResponse = client.insertGlobalAddress(project, addressResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -324,11 +321,10 @@ public void insertGlobalAddressExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Address addressResource = Address.newBuilder().build(); - client.insertGlobalAddress(requestId, project, addressResource); + client.insertGlobalAddress(project, addressResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index 3304df1a2989..671bffee4e82 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -135,11 +135,10 @@ public void deleteGlobalForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); - Operation actualResponse = client.deleteGlobalForwardingRule(requestId, forwardingRule); + Operation actualResponse = client.deleteGlobalForwardingRule(forwardingRule); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -166,11 +165,10 @@ public void deleteGlobalForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); - client.deleteGlobalForwardingRule(requestId, forwardingRule); + client.deleteGlobalForwardingRule(forwardingRule); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -309,12 +307,10 @@ public void insertGlobalForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); - Operation actualResponse = - client.insertGlobalForwardingRule(requestId, project, forwardingRuleResource); + Operation actualResponse = client.insertGlobalForwardingRule(project, forwardingRuleResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -341,11 +337,10 @@ public void insertGlobalForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build(); - client.insertGlobalForwardingRule(requestId, project, forwardingRuleResource); + client.insertGlobalForwardingRule(project, forwardingRuleResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -463,13 +458,12 @@ public void setTargetGlobalForwardingRuleTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = - client.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource); + client.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -496,12 +490,11 @@ public void setTargetGlobalForwardingRuleExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalForwardingRuleName forwardingRule = ProjectGlobalForwardingRuleName.of("[PROJECT]", "[FORWARDING_RULE]"); TargetReference targetReferenceResource = TargetReference.newBuilder().build(); - client.setTargetGlobalForwardingRule(requestId, forwardingRule, targetReferenceResource); + client.setTargetGlobalForwardingRule(forwardingRule, targetReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java index 7a83cf68696e..0a3e9896fa2c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java @@ -136,11 +136,10 @@ public void deleteHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); - Operation actualResponse = client.deleteHealthCheck(requestId, healthCheck); + Operation actualResponse = client.deleteHealthCheck(healthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -167,11 +166,10 @@ public void deleteHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); - client.deleteHealthCheck(requestId, healthCheck); + client.deleteHealthCheck(healthCheck); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -298,11 +296,10 @@ public void insertHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - Operation actualResponse = client.insertHealthCheck(requestId, project, healthCheckResource); + Operation actualResponse = client.insertHealthCheck(project, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -329,11 +326,10 @@ public void insertHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - client.insertHealthCheck(requestId, project, healthCheckResource); + client.insertHealthCheck(project, healthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -450,12 +446,11 @@ public void patchHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - Operation actualResponse = client.patchHealthCheck(requestId, healthCheck, healthCheckResource); + Operation actualResponse = client.patchHealthCheck(healthCheck, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -482,12 +477,11 @@ public void patchHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - client.patchHealthCheck(requestId, healthCheck, healthCheckResource); + client.patchHealthCheck(healthCheck, healthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -544,13 +538,11 @@ public void updateHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - Operation actualResponse = - client.updateHealthCheck(requestId, healthCheck, healthCheckResource); + Operation actualResponse = client.updateHealthCheck(healthCheck, healthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -577,12 +569,11 @@ public void updateHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName.of("[PROJECT]", "[HEALTH_CHECK]"); HealthCheck healthCheckResource = HealthCheck.newBuilder().build(); - client.updateHealthCheck(requestId, healthCheck, healthCheckResource); + client.updateHealthCheck(healthCheck, healthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java index e0af34e68892..b84c34a573d4 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java @@ -136,11 +136,10 @@ public void deleteHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - Operation actualResponse = client.deleteHttpHealthCheck(requestId, httpHealthCheck); + Operation actualResponse = client.deleteHttpHealthCheck(httpHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -167,11 +166,10 @@ public void deleteHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); - client.deleteHttpHealthCheck(requestId, httpHealthCheck); + client.deleteHttpHealthCheck(httpHealthCheck); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -302,12 +300,10 @@ public void insertHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); - Operation actualResponse = - client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); + Operation actualResponse = client.insertHttpHealthCheck(project, httpHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -334,11 +330,10 @@ public void insertHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); - client.insertHttpHealthCheck(requestId, project, httpHealthCheckResource); + client.insertHttpHealthCheck(project, httpHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -455,13 +450,12 @@ public void patchHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = - client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); + client.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -488,12 +482,11 @@ public void patchHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); - client.patchHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); + client.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -550,13 +543,12 @@ public void updateHttpHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); Operation actualResponse = - client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); + client.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -583,12 +575,11 @@ public void updateHttpHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]"); HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build(); - client.updateHttpHealthCheck(requestId, httpHealthCheck, httpHealthCheckResource); + client.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java index efe3e12c9789..96074104aa2a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java @@ -138,9 +138,8 @@ public void deleteHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); + Operation actualResponse = client.deleteHttpsHealthCheck(httpsHealthCheck); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -169,9 +168,8 @@ public void deleteHttpsHealthCheckExceptionTest() throws Exception { try { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - String requestId = "requestId37109963"; - client.deleteHttpsHealthCheck(httpsHealthCheck, requestId); + client.deleteHttpsHealthCheck(httpsHealthCheck); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -302,12 +300,10 @@ public void insertHttpsHealthCheckTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); - Operation actualResponse = - client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); + Operation actualResponse = client.insertHttpsHealthCheck(project, httpsHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -334,11 +330,10 @@ public void insertHttpsHealthCheckExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); - client.insertHttpsHealthCheck(requestId, project, httpsHealthCheckResource); + client.insertHttpsHealthCheck(project, httpsHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -457,11 +452,10 @@ public void patchHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - String requestId = "requestId37109963"; HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = - client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); + client.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -490,10 +484,9 @@ public void patchHttpsHealthCheckExceptionTest() throws Exception { try { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - String requestId = "requestId37109963"; HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); - client.patchHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); + client.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -552,11 +545,10 @@ public void updateHttpsHealthCheckTest() { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - String requestId = "requestId37109963"; HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); Operation actualResponse = - client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); + client.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -585,10 +577,9 @@ public void updateHttpsHealthCheckExceptionTest() throws Exception { try { ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]"); - String requestId = "requestId37109963"; HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build(); - client.updateHttpsHealthCheck(httpsHealthCheck, requestId, httpsHealthCheckResource); + client.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index 16fe02854a71..63dab8cb15df 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -139,9 +139,8 @@ public void deleteImageTest() { mockService.addResponse(expectedResponse); ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteImage(image, requestId); + Operation actualResponse = client.deleteImage(image); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -169,9 +168,8 @@ public void deleteImageExceptionTest() throws Exception { try { ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); - String requestId = "requestId37109963"; - client.deleteImage(image, requestId); + client.deleteImage(image); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -229,10 +227,9 @@ public void deprecateImageTest() { mockService.addResponse(expectedResponse); ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); - String requestId = "requestId37109963"; DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); - Operation actualResponse = client.deprecateImage(image, requestId, deprecationStatusResource); + Operation actualResponse = client.deprecateImage(image, deprecationStatusResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -260,10 +257,9 @@ public void deprecateImageExceptionTest() throws Exception { try { ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]"); - String requestId = "requestId37109963"; DeprecationStatus deprecationStatusResource = DeprecationStatus.newBuilder().build(); - client.deprecateImage(image, requestId, deprecationStatusResource); + client.deprecateImage(image, deprecationStatusResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -486,11 +482,10 @@ public void insertImageTest() { mockService.addResponse(expectedResponse); Boolean forceCreate = true; - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Image imageResource = Image.newBuilder().build(); - Operation actualResponse = client.insertImage(forceCreate, requestId, project, imageResource); + Operation actualResponse = client.insertImage(forceCreate, project, imageResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -518,11 +513,10 @@ public void insertImageExceptionTest() throws Exception { try { Boolean forceCreate = true; - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Image imageResource = Image.newBuilder().build(); - client.insertImage(forceCreate, requestId, project, imageResource); + client.insertImage(forceCreate, project, imageResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index 9b6dad9db677..e576cbe14404 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -185,11 +185,10 @@ public void addAccessConfigInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); Operation actualResponse = - client.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + client.addAccessConfigInstance(instance, networkInterface, accessConfigResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -219,10 +218,9 @@ public void addAccessConfigInstanceExceptionTest() throws Exception { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - client.addAccessConfigInstance(instance, networkInterface, requestId, accessConfigResource); + client.addAccessConfigInstance(instance, networkInterface, accessConfigResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -344,12 +342,11 @@ public void attachDiskInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Boolean forceAttach = false; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); Operation actualResponse = - client.attachDiskInstance(instance, requestId, forceAttach, attachedDiskResource); + client.attachDiskInstance(instance, forceAttach, attachedDiskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -378,11 +375,10 @@ public void attachDiskInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Boolean forceAttach = false; AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build(); - client.attachDiskInstance(instance, requestId, forceAttach, attachedDiskResource); + client.attachDiskInstance(instance, forceAttach, attachedDiskResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -441,9 +437,8 @@ public void deleteInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteInstance(instance, requestId); + Operation actualResponse = client.deleteInstance(instance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -472,9 +467,8 @@ public void deleteInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - client.deleteInstance(instance, requestId); + client.deleteInstance(instance); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -534,11 +528,10 @@ public void deleteAccessConfigInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; String accessConfig = "accessConfig-464014723"; Operation actualResponse = - client.deleteAccessConfigInstance(instance, networkInterface, requestId, accessConfig); + client.deleteAccessConfigInstance(instance, networkInterface, accessConfig); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -568,10 +561,9 @@ public void deleteAccessConfigInstanceExceptionTest() throws Exception { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; String accessConfig = "accessConfig-464014723"; - client.deleteAccessConfigInstance(instance, networkInterface, requestId, accessConfig); + client.deleteAccessConfigInstance(instance, networkInterface, accessConfig); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -630,10 +622,9 @@ public void detachDiskInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; String deviceName = "deviceName-1543071020"; - Operation actualResponse = client.detachDiskInstance(instance, requestId, deviceName); + Operation actualResponse = client.detachDiskInstance(instance, deviceName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -662,10 +653,9 @@ public void detachDiskInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; String deviceName = "deviceName-1543071020"; - client.detachDiskInstance(instance, requestId, deviceName); + client.detachDiskInstance(instance, deviceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -865,13 +855,10 @@ public void insertInstanceTest() { .build(); mockService.addResponse(expectedResponse); - String sourceInstanceTemplate = "sourceInstanceTemplate869294528"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Instance instanceResource = Instance.newBuilder().build(); - Operation actualResponse = - client.insertInstance(sourceInstanceTemplate, zone, requestId, instanceResource); + Operation actualResponse = client.insertInstance(zone, instanceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -898,12 +885,10 @@ public void insertInstanceExceptionTest() throws Exception { mockService.addException(exception); try { - String sourceInstanceTemplate = "sourceInstanceTemplate869294528"; ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; Instance instanceResource = Instance.newBuilder().build(); - client.insertInstance(sourceInstanceTemplate, zone, requestId, instanceResource); + client.insertInstance(zone, instanceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1084,9 +1069,8 @@ public void resetInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.resetInstance(instance, requestId); + Operation actualResponse = client.resetInstance(instance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1115,9 +1099,8 @@ public void resetInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - client.resetInstance(instance, requestId); + client.resetInstance(instance); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1176,11 +1159,9 @@ public void setDeletionProtectionInstanceTest() { ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); - String requestId = "requestId37109963"; Boolean deletionProtection = true; - Operation actualResponse = - client.setDeletionProtectionInstance(resource, requestId, deletionProtection); + Operation actualResponse = client.setDeletionProtectionInstance(resource, deletionProtection); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1209,10 +1190,9 @@ public void setDeletionProtectionInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); - String requestId = "requestId37109963"; Boolean deletionProtection = true; - client.setDeletionProtectionInstance(resource, requestId, deletionProtection); + client.setDeletionProtectionInstance(resource, deletionProtection); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1271,12 +1251,10 @@ public void setDiskAutoDeleteInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Boolean autoDelete = false; String deviceName = "deviceName-1543071020"; - Operation actualResponse = - client.setDiskAutoDeleteInstance(instance, requestId, autoDelete, deviceName); + Operation actualResponse = client.setDiskAutoDeleteInstance(instance, autoDelete, deviceName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1305,11 +1283,10 @@ public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Boolean autoDelete = false; String deviceName = "deviceName-1543071020"; - client.setDiskAutoDeleteInstance(instance, requestId, autoDelete, deviceName); + client.setDiskAutoDeleteInstance(instance, autoDelete, deviceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1368,12 +1345,11 @@ public void setLabelsInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build(); Operation actualResponse = - client.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource); + client.setLabelsInstance(instance, instancesSetLabelsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1402,11 +1378,10 @@ public void setLabelsInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetLabelsRequest instancesSetLabelsRequestResource = InstancesSetLabelsRequest.newBuilder().build(); - client.setLabelsInstance(instance, requestId, instancesSetLabelsRequestResource); + client.setLabelsInstance(instance, instancesSetLabelsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1465,13 +1440,11 @@ public void setMachineResourcesInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build(); Operation actualResponse = - client.setMachineResourcesInstance( - instance, requestId, instancesSetMachineResourcesRequestResource); + client.setMachineResourcesInstance(instance, instancesSetMachineResourcesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1500,12 +1473,10 @@ public void setMachineResourcesInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = InstancesSetMachineResourcesRequest.newBuilder().build(); - client.setMachineResourcesInstance( - instance, requestId, instancesSetMachineResourcesRequestResource); + client.setMachineResourcesInstance(instance, instancesSetMachineResourcesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1564,12 +1535,11 @@ public void setMachineTypeInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); Operation actualResponse = - client.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource); + client.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1598,11 +1568,10 @@ public void setMachineTypeInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = InstancesSetMachineTypeRequest.newBuilder().build(); - client.setMachineTypeInstance(instance, requestId, instancesSetMachineTypeRequestResource); + client.setMachineTypeInstance(instance, instancesSetMachineTypeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1661,10 +1630,9 @@ public void setMetadataInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Metadata metadataResource = Metadata.newBuilder().build(); - Operation actualResponse = client.setMetadataInstance(instance, requestId, metadataResource); + Operation actualResponse = client.setMetadataInstance(instance, metadataResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1693,10 +1661,9 @@ public void setMetadataInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Metadata metadataResource = Metadata.newBuilder().build(); - client.setMetadataInstance(instance, requestId, metadataResource); + client.setMetadataInstance(instance, metadataResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1755,13 +1722,11 @@ public void setMinCpuPlatformInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build(); Operation actualResponse = - client.setMinCpuPlatformInstance( - instance, requestId, instancesSetMinCpuPlatformRequestResource); + client.setMinCpuPlatformInstance(instance, instancesSetMinCpuPlatformRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1790,12 +1755,10 @@ public void setMinCpuPlatformInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = InstancesSetMinCpuPlatformRequest.newBuilder().build(); - client.setMinCpuPlatformInstance( - instance, requestId, instancesSetMinCpuPlatformRequestResource); + client.setMinCpuPlatformInstance(instance, instancesSetMinCpuPlatformRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1854,11 +1817,9 @@ public void setSchedulingInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Scheduling schedulingResource = Scheduling.newBuilder().build(); - Operation actualResponse = - client.setSchedulingInstance(instance, requestId, schedulingResource); + Operation actualResponse = client.setSchedulingInstance(instance, schedulingResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1887,10 +1848,9 @@ public void setSchedulingInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Scheduling schedulingResource = Scheduling.newBuilder().build(); - client.setSchedulingInstance(instance, requestId, schedulingResource); + client.setSchedulingInstance(instance, schedulingResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1949,13 +1909,11 @@ public void setServiceAccountInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); Operation actualResponse = - client.setServiceAccountInstance( - instance, requestId, instancesSetServiceAccountRequestResource); + client.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1984,12 +1942,10 @@ public void setServiceAccountInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = InstancesSetServiceAccountRequest.newBuilder().build(); - client.setServiceAccountInstance( - instance, requestId, instancesSetServiceAccountRequestResource); + client.setServiceAccountInstance(instance, instancesSetServiceAccountRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2048,10 +2004,9 @@ public void setTagsInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Tags tagsResource = Tags.newBuilder().build(); - Operation actualResponse = client.setTagsInstance(instance, requestId, tagsResource); + Operation actualResponse = client.setTagsInstance(instance, tagsResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -2080,10 +2035,9 @@ public void setTagsInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; Tags tagsResource = Tags.newBuilder().build(); - client.setTagsInstance(instance, requestId, tagsResource); + client.setTagsInstance(instance, tagsResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2142,9 +2096,8 @@ public void startInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.startInstance(instance, requestId); + Operation actualResponse = client.startInstance(instance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -2173,9 +2126,8 @@ public void startInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - client.startInstance(instance, requestId); + client.startInstance(instance); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2234,13 +2186,12 @@ public void startWithEncryptionKeyInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); Operation actualResponse = client.startWithEncryptionKeyInstance( - instance, requestId, instancesStartWithEncryptionKeyRequestResource); + instance, instancesStartWithEncryptionKeyRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -2269,12 +2220,11 @@ public void startWithEncryptionKeyInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = InstancesStartWithEncryptionKeyRequest.newBuilder().build(); client.startWithEncryptionKeyInstance( - instance, requestId, instancesStartWithEncryptionKeyRequestResource); + instance, instancesStartWithEncryptionKeyRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2333,9 +2283,8 @@ public void stopInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.stopInstance(instance, requestId); + Operation actualResponse = client.stopInstance(instance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -2364,9 +2313,8 @@ public void stopInstanceExceptionTest() throws Exception { try { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); - String requestId = "requestId37109963"; - client.stopInstance(instance, requestId); + client.stopInstance(instance); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2426,12 +2374,10 @@ public void updateAccessConfigInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); Operation actualResponse = - client.updateAccessConfigInstance( - instance, networkInterface, requestId, accessConfigResource); + client.updateAccessConfigInstance(instance, networkInterface, accessConfigResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -2461,11 +2407,9 @@ public void updateAccessConfigInstanceExceptionTest() throws Exception { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; AccessConfig accessConfigResource = AccessConfig.newBuilder().build(); - client.updateAccessConfigInstance( - instance, networkInterface, requestId, accessConfigResource); + client.updateAccessConfigInstance(instance, networkInterface, accessConfigResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -2525,12 +2469,10 @@ public void updateNetworkInterfaceInstanceTest() { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); Operation actualResponse = - client.updateNetworkInterfaceInstance( - instance, networkInterface, requestId, networkInterfaceResource); + client.updateNetworkInterfaceInstance(instance, networkInterface, networkInterfaceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -2560,11 +2502,9 @@ public void updateNetworkInterfaceInstanceExceptionTest() throws Exception { ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]"); String networkInterface = "networkInterface902258792"; - String requestId = "requestId37109963"; NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build(); - client.updateNetworkInterfaceInstance( - instance, networkInterface, requestId, networkInterfaceResource); + client.updateNetworkInterfaceInstance(instance, networkInterface, networkInterfaceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java index 42f45526f10e..9bb04f730750 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java @@ -146,15 +146,13 @@ public void addInstancesInstanceGroupTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); Operation actualResponse = - client.addInstancesInstanceGroup( - requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); + client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -181,14 +179,12 @@ public void addInstancesInstanceGroupExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = InstanceGroupsAddInstancesRequest.newBuilder().build(); - client.addInstancesInstanceGroup( - requestId, instanceGroup, instanceGroupsAddInstancesRequestResource); + client.addInstancesInstanceGroup(instanceGroup, instanceGroupsAddInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -308,11 +304,10 @@ public void deleteInstanceGroupTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - Operation actualResponse = client.deleteInstanceGroup(requestId, instanceGroup); + Operation actualResponse = client.deleteInstanceGroup(instanceGroup); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -339,11 +334,10 @@ public void deleteInstanceGroupExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); - client.deleteInstanceGroup(requestId, instanceGroup); + client.deleteInstanceGroup(instanceGroup); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -474,10 +468,9 @@ public void insertInstanceGroupTest() { mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); - Operation actualResponse = client.insertInstanceGroup(zone, requestId, instanceGroupResource); + Operation actualResponse = client.insertInstanceGroup(zone, instanceGroupResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -505,10 +498,9 @@ public void insertInstanceGroupExceptionTest() throws Exception { try { ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; InstanceGroup instanceGroupResource = InstanceGroup.newBuilder().build(); - client.insertInstanceGroup(zone, requestId, instanceGroupResource); + client.insertInstanceGroup(zone, instanceGroupResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -693,7 +685,6 @@ public void removeInstancesInstanceGroupTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = @@ -701,7 +692,7 @@ public void removeInstancesInstanceGroupTest() { Operation actualResponse = client.removeInstancesInstanceGroup( - requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -728,14 +719,13 @@ public void removeInstancesInstanceGroupExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = InstanceGroupsRemoveInstancesRequest.newBuilder().build(); client.removeInstancesInstanceGroup( - requestId, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + instanceGroup, instanceGroupsRemoveInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -792,7 +782,6 @@ public void setNamedPortsInstanceGroupTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = @@ -800,7 +789,7 @@ public void setNamedPortsInstanceGroupTest() { Operation actualResponse = client.setNamedPortsInstanceGroup( - requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -827,14 +816,12 @@ public void setNamedPortsInstanceGroupExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupName instanceGroup = ProjectZoneInstanceGroupName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP]"); InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = InstanceGroupsSetNamedPortsRequest.newBuilder().build(); - client.setNamedPortsInstanceGroup( - requestId, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + client.setNamedPortsInstanceGroup(instanceGroup, instanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index beefb93d91ef..617333dead3e 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -152,7 +152,6 @@ public void abandonInstancesInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersAbandonInstancesRequest @@ -161,7 +160,7 @@ public void abandonInstancesInstanceGroupManagerTest() { Operation actualResponse = client.abandonInstancesInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -188,7 +187,6 @@ public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersAbandonInstancesRequest @@ -196,7 +194,7 @@ public void abandonInstancesInstanceGroupManagerExceptionTest() throws Exception InstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); client.abandonInstancesInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -318,11 +316,10 @@ public void deleteInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - Operation actualResponse = client.deleteInstanceGroupManager(requestId, instanceGroupManager); + Operation actualResponse = client.deleteInstanceGroupManager(instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -349,11 +346,10 @@ public void deleteInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - client.deleteInstanceGroupManager(requestId, instanceGroupManager); + client.deleteInstanceGroupManager(instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -410,7 +406,6 @@ public void deleteInstancesInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersDeleteInstancesRequest @@ -419,7 +414,7 @@ public void deleteInstancesInstanceGroupManagerTest() { Operation actualResponse = client.deleteInstancesInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -446,7 +441,6 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersDeleteInstancesRequest @@ -454,7 +448,7 @@ public void deleteInstancesInstanceGroupManagerExceptionTest() throws Exception InstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); client.deleteInstancesInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -588,11 +582,10 @@ public void insertInstanceGroupManagerTest() { mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); Operation actualResponse = - client.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource); + client.insertInstanceGroupManager(zone, instanceGroupManagerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -620,10 +613,9 @@ public void insertInstanceGroupManagerExceptionTest() throws Exception { try { ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); - client.insertInstanceGroupManager(zone, requestId, instanceGroupManagerResource); + client.insertInstanceGroupManager(zone, instanceGroupManagerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -789,7 +781,6 @@ public void recreateInstancesInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersRecreateInstancesRequest @@ -798,7 +789,7 @@ public void recreateInstancesInstanceGroupManagerTest() { Operation actualResponse = client.recreateInstancesInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -825,7 +816,6 @@ public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exceptio mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersRecreateInstancesRequest @@ -833,7 +823,7 @@ public void recreateInstancesInstanceGroupManagerExceptionTest() throws Exceptio InstanceGroupManagersRecreateInstancesRequest.newBuilder().build(); client.recreateInstancesInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -891,12 +881,10 @@ public void resizeInstanceGroupManagerTest() { mockService.addResponse(expectedResponse); Integer size = 3530753; - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - Operation actualResponse = - client.resizeInstanceGroupManager(size, requestId, instanceGroupManager); + Operation actualResponse = client.resizeInstanceGroupManager(size, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -924,11 +912,10 @@ public void resizeInstanceGroupManagerExceptionTest() throws Exception { try { Integer size = 3530753; - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); - client.resizeInstanceGroupManager(size, requestId, instanceGroupManager); + client.resizeInstanceGroupManager(size, instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -985,7 +972,6 @@ public void setInstanceTemplateInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetInstanceTemplateRequest @@ -994,9 +980,7 @@ public void setInstanceTemplateInstanceGroupManagerTest() { Operation actualResponse = client.setInstanceTemplateInstanceGroupManager( - requestId, - instanceGroupManager, - instanceGroupManagersSetInstanceTemplateRequestResource); + instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1023,7 +1007,6 @@ public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Except mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetInstanceTemplateRequest @@ -1031,7 +1014,7 @@ public void setInstanceTemplateInstanceGroupManagerExceptionTest() throws Except InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build(); client.setInstanceTemplateInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1088,7 +1071,6 @@ public void setTargetPoolsInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = @@ -1096,7 +1078,7 @@ public void setTargetPoolsInstanceGroupManagerTest() { Operation actualResponse = client.setTargetPoolsInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1123,7 +1105,6 @@ public void setTargetPoolsInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); InstanceGroupManagersSetTargetPoolsRequest @@ -1131,7 +1112,7 @@ public void setTargetPoolsInstanceGroupManagerExceptionTest() throws Exception { InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); client.setTargetPoolsInstanceGroupManager( - requestId, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index cdd2a199e6d5..527b6564efea 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -134,9 +134,8 @@ public void deleteInstanceTemplateTest() { ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteInstanceTemplate(instanceTemplate, requestId); + Operation actualResponse = client.deleteInstanceTemplate(instanceTemplate); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -165,9 +164,8 @@ public void deleteInstanceTemplateExceptionTest() throws Exception { try { ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName.of("[PROJECT]", "[INSTANCE_TEMPLATE]"); - String requestId = "requestId37109963"; - client.deleteInstanceTemplate(instanceTemplate, requestId); + client.deleteInstanceTemplate(instanceTemplate); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -284,12 +282,10 @@ public void insertInstanceTemplateTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build(); - Operation actualResponse = - client.insertInstanceTemplate(requestId, project, instanceTemplateResource); + Operation actualResponse = client.insertInstanceTemplate(project, instanceTemplateResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -316,11 +312,10 @@ public void insertInstanceTemplateExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceTemplate instanceTemplateResource = InstanceTemplate.newBuilder().build(); - client.insertInstanceTemplate(requestId, project, instanceTemplateResource); + client.insertInstanceTemplate(project, instanceTemplateResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java index 23dab449c76a..7bcea70c5530 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java @@ -203,13 +203,11 @@ public void deleteInterconnectAttachmentTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of( "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); - Operation actualResponse = - client.deleteInterconnectAttachment(requestId, interconnectAttachment); + Operation actualResponse = client.deleteInterconnectAttachment(interconnectAttachment); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -236,12 +234,11 @@ public void deleteInterconnectAttachmentExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of( "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); - client.deleteInterconnectAttachment(requestId, interconnectAttachment); + client.deleteInterconnectAttachment(interconnectAttachment); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -377,13 +374,12 @@ public void insertInterconnectAttachmentTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build(); Operation actualResponse = - client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource); + client.insertInterconnectAttachment(region, interconnectAttachmentResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -410,12 +406,11 @@ public void insertInterconnectAttachmentExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build(); - client.insertInterconnectAttachment(requestId, region, interconnectAttachmentResource); + client.insertInterconnectAttachment(region, interconnectAttachmentResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java index 730a1e91e71a..d674a8ca33f8 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java @@ -134,11 +134,10 @@ public void deleteInterconnectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); - Operation actualResponse = client.deleteInterconnect(requestId, interconnect); + Operation actualResponse = client.deleteInterconnect(interconnect); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -165,11 +164,10 @@ public void deleteInterconnectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); - client.deleteInterconnect(requestId, interconnect); + client.deleteInterconnect(interconnect); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -310,11 +308,10 @@ public void insertInterconnectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); - Operation actualResponse = client.insertInterconnect(requestId, project, interconnectResource); + Operation actualResponse = client.insertInterconnect(project, interconnectResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -341,11 +338,10 @@ public void insertInterconnectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); - client.insertInterconnect(requestId, project, interconnectResource); + client.insertInterconnect(project, interconnectResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -462,13 +458,11 @@ public void patchInterconnectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); - Operation actualResponse = - client.patchInterconnect(requestId, interconnect, interconnectResource); + Operation actualResponse = client.patchInterconnect(interconnect, interconnectResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -495,12 +489,11 @@ public void patchInterconnectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); Interconnect interconnectResource = Interconnect.newBuilder().build(); - client.patchInterconnect(requestId, interconnect, interconnectResource); + client.patchInterconnect(interconnect, interconnectResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java index ae4e7d5e7d36..e33da4e3c227 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java @@ -135,9 +135,8 @@ public void deleteLicenseTest() { mockService.addResponse(expectedResponse); ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteLicense(license, requestId); + Operation actualResponse = client.deleteLicense(license); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -165,9 +164,8 @@ public void deleteLicenseExceptionTest() throws Exception { try { ProjectGlobalLicenseName license = ProjectGlobalLicenseName.of("[PROJECT]", "[LICENSE]"); - String requestId = "requestId37109963"; - client.deleteLicense(license, requestId); + client.deleteLicense(license); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -289,11 +287,10 @@ public void insertLicenseTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); License licenseResource = License.newBuilder().build(); - Operation actualResponse = client.insertLicense(requestId, project, licenseResource); + Operation actualResponse = client.insertLicense(project, licenseResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -320,11 +317,10 @@ public void insertLicenseExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); License licenseResource = License.newBuilder().build(); - client.insertLicense(requestId, project, licenseResource); + client.insertLicense(project, licenseResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java index c7fa343db950..494be4ca7ab1 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java @@ -140,13 +140,11 @@ public void addPeeringNetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); - Operation actualResponse = - client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); + Operation actualResponse = client.addPeeringNetwork(network, networksAddPeeringRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -173,12 +171,11 @@ public void addPeeringNetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); NetworksAddPeeringRequest networksAddPeeringRequestResource = NetworksAddPeeringRequest.newBuilder().build(); - client.addPeeringNetwork(requestId, network, networksAddPeeringRequestResource); + client.addPeeringNetwork(network, networksAddPeeringRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -235,10 +232,9 @@ public void deleteNetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - Operation actualResponse = client.deleteNetwork(requestId, network); + Operation actualResponse = client.deleteNetwork(network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -265,10 +261,9 @@ public void deleteNetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - client.deleteNetwork(requestId, network); + client.deleteNetwork(network); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -389,11 +384,10 @@ public void insertNetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Network networkResource = Network.newBuilder().build(); - Operation actualResponse = client.insertNetwork(requestId, project, networkResource); + Operation actualResponse = client.insertNetwork(project, networkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -420,11 +414,10 @@ public void insertNetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Network networkResource = Network.newBuilder().build(); - client.insertNetwork(requestId, project, networkResource); + client.insertNetwork(project, networkResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -541,11 +534,10 @@ public void patchNetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); Network networkResource = Network.newBuilder().build(); - Operation actualResponse = client.patchNetwork(requestId, network, networkResource); + Operation actualResponse = client.patchNetwork(network, networkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -572,11 +564,10 @@ public void patchNetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); Network networkResource = Network.newBuilder().build(); - client.patchNetwork(requestId, network, networkResource); + client.patchNetwork(network, networkResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -633,13 +624,12 @@ public void removePeeringNetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build(); Operation actualResponse = - client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource); + client.removePeeringNetwork(network, networksRemovePeeringRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -666,12 +656,11 @@ public void removePeeringNetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); NetworksRemovePeeringRequest networksRemovePeeringRequestResource = NetworksRemovePeeringRequest.newBuilder().build(); - client.removePeeringNetwork(requestId, network, networksRemovePeeringRequestResource); + client.removePeeringNetwork(network, networksRemovePeeringRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -728,10 +717,9 @@ public void switchToCustomModeNetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - Operation actualResponse = client.switchToCustomModeNetwork(requestId, network); + Operation actualResponse = client.switchToCustomModeNetwork(network); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -758,10 +746,9 @@ public void switchToCustomModeNetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalNetworkName network = ProjectGlobalNetworkName.of("[PROJECT]", "[NETWORK]"); - client.switchToCustomModeNetwork(requestId, network); + client.switchToCustomModeNetwork(network); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index 76277b4bc483..61824ef3222b 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -149,10 +149,9 @@ public void disableXpnHostProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - Operation actualResponse = client.disableXpnHostProject(requestId, project); + Operation actualResponse = client.disableXpnHostProject(project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -179,10 +178,9 @@ public void disableXpnHostProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - client.disableXpnHostProject(requestId, project); + client.disableXpnHostProject(project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -239,14 +237,12 @@ public void disableXpnResourceProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build(); Operation actualResponse = - client.disableXpnResourceProject( - requestId, project, projectsDisableXpnResourceRequestResource); + client.disableXpnResourceProject(project, projectsDisableXpnResourceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -273,13 +269,11 @@ public void disableXpnResourceProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = ProjectsDisableXpnResourceRequest.newBuilder().build(); - client.disableXpnResourceProject( - requestId, project, projectsDisableXpnResourceRequestResource); + client.disableXpnResourceProject(project, projectsDisableXpnResourceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -336,10 +330,9 @@ public void enableXpnHostProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - Operation actualResponse = client.enableXpnHostProject(requestId, project); + Operation actualResponse = client.enableXpnHostProject(project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -366,10 +359,9 @@ public void enableXpnHostProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); - client.enableXpnHostProject(requestId, project); + client.enableXpnHostProject(project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -426,14 +418,12 @@ public void enableXpnResourceProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build(); Operation actualResponse = - client.enableXpnResourceProject( - requestId, project, projectsEnableXpnResourceRequestResource); + client.enableXpnResourceProject(project, projectsEnableXpnResourceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -460,12 +450,11 @@ public void enableXpnResourceProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = ProjectsEnableXpnResourceRequest.newBuilder().build(); - client.enableXpnResourceProject(requestId, project, projectsEnableXpnResourceRequestResource); + client.enableXpnResourceProject(project, projectsEnableXpnResourceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -768,11 +757,10 @@ public void moveDiskProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); - Operation actualResponse = client.moveDiskProject(requestId, project, diskMoveRequestResource); + Operation actualResponse = client.moveDiskProject(project, diskMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -799,11 +787,10 @@ public void moveDiskProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build(); - client.moveDiskProject(requestId, project, diskMoveRequestResource); + client.moveDiskProject(project, diskMoveRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -860,12 +847,10 @@ public void moveInstanceProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); - Operation actualResponse = - client.moveInstanceProject(requestId, project, instanceMoveRequestResource); + Operation actualResponse = client.moveInstanceProject(project, instanceMoveRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -892,11 +877,10 @@ public void moveInstanceProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build(); - client.moveInstanceProject(requestId, project, instanceMoveRequestResource); + client.moveInstanceProject(project, instanceMoveRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -953,12 +937,10 @@ public void setCommonInstanceMetadataProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Metadata metadataResource = Metadata.newBuilder().build(); - Operation actualResponse = - client.setCommonInstanceMetadataProject(requestId, project, metadataResource); + Operation actualResponse = client.setCommonInstanceMetadataProject(project, metadataResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -985,11 +967,10 @@ public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Metadata metadataResource = Metadata.newBuilder().build(); - client.setCommonInstanceMetadataProject(requestId, project, metadataResource); + client.setCommonInstanceMetadataProject(project, metadataResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1046,12 +1027,11 @@ public void setUsageExportBucketProjectTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build(); Operation actualResponse = - client.setUsageExportBucketProject(requestId, project, usageExportLocationResource); + client.setUsageExportBucketProject(project, usageExportLocationResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1078,11 +1058,10 @@ public void setUsageExportBucketProjectExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build(); - client.setUsageExportBucketProject(requestId, project, usageExportLocationResource); + client.setUsageExportBucketProject(project, usageExportLocationResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java index 209d3bf3d330..cabdd58aaddc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java @@ -138,9 +138,8 @@ public void deleteRegionAutoscalerTest() { ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteRegionAutoscaler(autoscaler, requestId); + Operation actualResponse = client.deleteRegionAutoscaler(autoscaler); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -169,9 +168,8 @@ public void deleteRegionAutoscalerExceptionTest() throws Exception { try { ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName.of("[PROJECT]", "[REGION]", "[AUTOSCALER]"); - String requestId = "requestId37109963"; - client.deleteRegionAutoscaler(autoscaler, requestId); + client.deleteRegionAutoscaler(autoscaler); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -296,11 +294,10 @@ public void insertRegionAutoscalerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = client.insertRegionAutoscaler(requestId, region, autoscalerResource); + Operation actualResponse = client.insertRegionAutoscaler(region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -327,11 +324,10 @@ public void insertRegionAutoscalerExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.insertRegionAutoscaler(requestId, region, autoscalerResource); + client.insertRegionAutoscaler(region, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -449,12 +445,10 @@ public void patchRegionAutoscalerTest() { mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - Operation actualResponse = - client.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); + Operation actualResponse = client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -482,11 +476,10 @@ public void patchRegionAutoscalerExceptionTest() throws Exception { try { String autoscaler = "autoscaler517258967"; - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.patchRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); + client.patchRegionAutoscaler(autoscaler, region, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -544,12 +537,11 @@ public void updateRegionAutoscalerTest() { mockService.addResponse(expectedResponse); String autoscaler = "autoscaler517258967"; - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); Operation actualResponse = - client.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); + client.updateRegionAutoscaler(autoscaler, region, autoscalerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -577,11 +569,10 @@ public void updateRegionAutoscalerExceptionTest() throws Exception { try { String autoscaler = "autoscaler517258967"; - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Autoscaler autoscalerResource = Autoscaler.newBuilder().build(); - client.updateRegionAutoscaler(autoscaler, requestId, region, autoscalerResource); + client.updateRegionAutoscaler(autoscaler, region, autoscalerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java index 7b62d5d73271..6effc2e07529 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java @@ -139,11 +139,10 @@ public void deleteRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - Operation actualResponse = client.deleteRegionBackendService(requestId, backendService); + Operation actualResponse = client.deleteRegionBackendService(backendService); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -170,11 +169,10 @@ public void deleteRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); - client.deleteRegionBackendService(requestId, backendService); + client.deleteRegionBackendService(backendService); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -364,12 +362,10 @@ public void insertRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - Operation actualResponse = - client.insertRegionBackendService(requestId, region, backendServiceResource); + Operation actualResponse = client.insertRegionBackendService(region, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -396,11 +392,10 @@ public void insertRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.insertRegionBackendService(requestId, region, backendServiceResource); + client.insertRegionBackendService(region, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -518,13 +513,12 @@ public void patchRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.patchRegionBackendService(requestId, backendService, backendServiceResource); + client.patchRegionBackendService(backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -551,12 +545,11 @@ public void patchRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.patchRegionBackendService(requestId, backendService, backendServiceResource); + client.patchRegionBackendService(backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -613,13 +606,12 @@ public void updateRegionBackendServiceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); Operation actualResponse = - client.updateRegionBackendService(requestId, backendService, backendServiceResource); + client.updateRegionBackendService(backendService, backendServiceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -646,12 +638,11 @@ public void updateRegionBackendServiceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]"); BackendService backendServiceResource = BackendService.newBuilder().build(); - client.updateRegionBackendService(requestId, backendService, backendServiceResource); + client.updateRegionBackendService(backendService, backendServiceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java index 60e5592301dc..74bd522cd516 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java @@ -270,11 +270,10 @@ public void insertRegionCommitmentTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Commitment commitmentResource = Commitment.newBuilder().build(); - Operation actualResponse = client.insertRegionCommitment(requestId, region, commitmentResource); + Operation actualResponse = client.insertRegionCommitment(region, commitmentResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -301,11 +300,10 @@ public void insertRegionCommitmentExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Commitment commitmentResource = Commitment.newBuilder().build(); - client.insertRegionCommitment(requestId, region, commitmentResource); + client.insertRegionCommitment(region, commitmentResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java index 4a0d4d341655..4466235bf6b9 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java @@ -141,10 +141,9 @@ public void createSnapshotRegionDiskTest() { mockService.addResponse(expectedResponse); ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - String requestId = "requestId37109963"; Snapshot snapshotResource = Snapshot.newBuilder().build(); - Operation actualResponse = client.createSnapshotRegionDisk(disk, requestId, snapshotResource); + Operation actualResponse = client.createSnapshotRegionDisk(disk, snapshotResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -172,10 +171,9 @@ public void createSnapshotRegionDiskExceptionTest() throws Exception { try { ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - String requestId = "requestId37109963"; Snapshot snapshotResource = Snapshot.newBuilder().build(); - client.createSnapshotRegionDisk(disk, requestId, snapshotResource); + client.createSnapshotRegionDisk(disk, snapshotResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -233,9 +231,8 @@ public void deleteRegionDiskTest() { mockService.addResponse(expectedResponse); ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteRegionDisk(disk, requestId); + Operation actualResponse = client.deleteRegionDisk(disk); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -263,9 +260,8 @@ public void deleteRegionDiskExceptionTest() throws Exception { try { ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - String requestId = "requestId37109963"; - client.deleteRegionDisk(disk, requestId); + client.deleteRegionDisk(disk); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -406,13 +402,10 @@ public void insertRegionDiskTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; - String sourceImage = "sourceImage1661056055"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Disk diskResource = Disk.newBuilder().build(); - Operation actualResponse = - client.insertRegionDisk(requestId, sourceImage, region, diskResource); + Operation actualResponse = client.insertRegionDisk(region, diskResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -439,12 +432,10 @@ public void insertRegionDiskExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; - String sourceImage = "sourceImage1661056055"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Disk diskResource = Disk.newBuilder().build(); - client.insertRegionDisk(requestId, sourceImage, region, diskResource); + client.insertRegionDisk(region, diskResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -562,12 +553,10 @@ public void resizeRegionDiskTest() { mockService.addResponse(expectedResponse); ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - String requestId = "requestId37109963"; RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build(); - Operation actualResponse = - client.resizeRegionDisk(disk, requestId, regionDisksResizeRequestResource); + Operation actualResponse = client.resizeRegionDisk(disk, regionDisksResizeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -595,11 +584,10 @@ public void resizeRegionDiskExceptionTest() throws Exception { try { ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); - String requestId = "requestId37109963"; RegionDisksResizeRequest regionDisksResizeRequestResource = RegionDisksResizeRequest.newBuilder().build(); - client.resizeRegionDisk(disk, requestId, regionDisksResizeRequestResource); + client.resizeRegionDisk(disk, regionDisksResizeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -658,12 +646,10 @@ public void setLabelsRegionDiskTest() { ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); - String requestId = "requestId37109963"; RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build(); - Operation actualResponse = - client.setLabelsRegionDisk(resource, requestId, regionSetLabelsRequestResource); + Operation actualResponse = client.setLabelsRegionDisk(resource, regionSetLabelsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -692,11 +678,10 @@ public void setLabelsRegionDiskExceptionTest() throws Exception { try { ProjectRegionDiskResourceName resource = ProjectRegionDiskResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); - String requestId = "requestId37109963"; RegionSetLabelsRequest regionSetLabelsRequestResource = RegionSetLabelsRequest.newBuilder().build(); - client.setLabelsRegionDisk(resource, requestId, regionSetLabelsRequestResource); + client.setLabelsRegionDisk(resource, regionSetLabelsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java index 6de861a732a7..10fd1add9a37 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java @@ -336,7 +336,6 @@ public void setNamedPortsRegionInstanceGroupTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = @@ -344,7 +343,7 @@ public void setNamedPortsRegionInstanceGroupTest() { Operation actualResponse = client.setNamedPortsRegionInstanceGroup( - requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -371,14 +370,13 @@ public void setNamedPortsRegionInstanceGroupExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]"); RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build(); client.setNamedPortsRegionInstanceGroup( - requestId, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index 42b7a3c9d025..bdc9a057b6dd 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -147,7 +147,6 @@ public void abandonInstancesRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -157,9 +156,7 @@ public void abandonInstancesRegionInstanceGroupManagerTest() { Operation actualResponse = client.abandonInstancesRegionInstanceGroupManager( - requestId, - instanceGroupManager, - regionInstanceGroupManagersAbandonInstancesRequestResource); + instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -186,7 +183,6 @@ public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exc mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -195,9 +191,7 @@ public void abandonInstancesRegionInstanceGroupManagerExceptionTest() throws Exc RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build(); client.abandonInstancesRegionInstanceGroupManager( - requestId, - instanceGroupManager, - regionInstanceGroupManagersAbandonInstancesRequestResource); + instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -254,13 +248,11 @@ public void deleteRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - Operation actualResponse = - client.deleteRegionInstanceGroupManager(requestId, instanceGroupManager); + Operation actualResponse = client.deleteRegionInstanceGroupManager(instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -287,12 +279,11 @@ public void deleteRegionInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - client.deleteRegionInstanceGroupManager(requestId, instanceGroupManager); + client.deleteRegionInstanceGroupManager(instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -349,7 +340,6 @@ public void deleteInstancesRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -359,9 +349,7 @@ public void deleteInstancesRegionInstanceGroupManagerTest() { Operation actualResponse = client.deleteInstancesRegionInstanceGroupManager( - requestId, - instanceGroupManager, - regionInstanceGroupManagersDeleteInstancesRequestResource); + instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -388,7 +376,6 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -397,9 +384,7 @@ public void deleteInstancesRegionInstanceGroupManagerExceptionTest() throws Exce RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build(); client.deleteInstancesRegionInstanceGroupManager( - requestId, - instanceGroupManager, - regionInstanceGroupManagersDeleteInstancesRequestResource); + instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -535,12 +520,11 @@ public void insertRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); Operation actualResponse = - client.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource); + client.insertRegionInstanceGroupManager(region, instanceGroupManagerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -567,11 +551,10 @@ public void insertRegionInstanceGroupManagerExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); - client.insertRegionInstanceGroupManager(requestId, region, instanceGroupManagerResource); + client.insertRegionInstanceGroupManager(region, instanceGroupManagerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -739,7 +722,6 @@ public void recreateInstancesRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -748,7 +730,7 @@ public void recreateInstancesRegionInstanceGroupManagerTest() { Operation actualResponse = client.recreateInstancesRegionInstanceGroupManager( - requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -775,7 +757,6 @@ public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Ex mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -784,7 +765,7 @@ public void recreateInstancesRegionInstanceGroupManagerExceptionTest() throws Ex RegionInstanceGroupManagersRecreateRequest.newBuilder().build(); client.recreateInstancesRegionInstanceGroupManager( - requestId, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -842,13 +823,11 @@ public void resizeRegionInstanceGroupManagerTest() { mockService.addResponse(expectedResponse); Integer size = 3530753; - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - Operation actualResponse = - client.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager); + Operation actualResponse = client.resizeRegionInstanceGroupManager(size, instanceGroupManager); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -876,12 +855,11 @@ public void resizeRegionInstanceGroupManagerExceptionTest() throws Exception { try { Integer size = 3530753; - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); - client.resizeRegionInstanceGroupManager(size, requestId, instanceGroupManager); + client.resizeRegionInstanceGroupManager(size, instanceGroupManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -938,7 +916,6 @@ public void setInstanceTemplateRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -948,7 +925,7 @@ public void setInstanceTemplateRegionInstanceGroupManagerTest() { Operation actualResponse = client.setInstanceTemplateRegionInstanceGroupManager( - requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -975,7 +952,6 @@ public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -984,7 +960,7 @@ public void setInstanceTemplateRegionInstanceGroupManagerExceptionTest() throws RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build(); client.setInstanceTemplateRegionInstanceGroupManager( - requestId, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -1041,7 +1017,6 @@ public void setTargetPoolsRegionInstanceGroupManagerTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -1051,9 +1026,7 @@ public void setTargetPoolsRegionInstanceGroupManagerTest() { Operation actualResponse = client.setTargetPoolsRegionInstanceGroupManager( - requestId, - instanceGroupManager, - regionInstanceGroupManagersSetTargetPoolsRequestResource); + instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1080,7 +1053,6 @@ public void setTargetPoolsRegionInstanceGroupManagerExceptionTest() throws Excep mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of( "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); @@ -1089,9 +1061,7 @@ public void setTargetPoolsRegionInstanceGroupManagerExceptionTest() throws Excep RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build(); client.setTargetPoolsRegionInstanceGroupManager( - requestId, - instanceGroupManager, - regionInstanceGroupManagersSetTargetPoolsRequestResource); + instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java index 4b777ece8835..2b5756eb7884 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java @@ -133,9 +133,8 @@ public void deleteRouteTest() { mockService.addResponse(expectedResponse); ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteRoute(route, requestId); + Operation actualResponse = client.deleteRoute(route); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -163,9 +162,8 @@ public void deleteRouteExceptionTest() throws Exception { try { ProjectGlobalRouteName route = ProjectGlobalRouteName.of("[PROJECT]", "[ROUTE]"); - String requestId = "requestId37109963"; - client.deleteRoute(route, requestId); + client.deleteRoute(route); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -298,11 +296,10 @@ public void insertRouteTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Route routeResource = Route.newBuilder().build(); - Operation actualResponse = client.insertRoute(requestId, project, routeResource); + Operation actualResponse = client.insertRoute(project, routeResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -329,11 +326,10 @@ public void insertRouteExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); Route routeResource = Route.newBuilder().build(); - client.insertRoute(requestId, project, routeResource); + client.insertRoute(project, routeResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 38308a2d5f96..59530a691e8d 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -209,9 +209,8 @@ public void deleteRouterTest() { ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteRouter(router, requestId); + Operation actualResponse = client.deleteRouter(router); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -240,9 +239,8 @@ public void deleteRouterExceptionTest() throws Exception { try { ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String requestId = "requestId37109963"; - client.deleteRouter(router, requestId); + client.deleteRouter(router); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -410,11 +408,10 @@ public void insertRouterTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Router routerResource = Router.newBuilder().build(); - Operation actualResponse = client.insertRouter(requestId, region, routerResource); + Operation actualResponse = client.insertRouter(region, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -441,11 +438,10 @@ public void insertRouterExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Router routerResource = Router.newBuilder().build(); - client.insertRouter(requestId, region, routerResource); + client.insertRouter(region, routerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -564,10 +560,9 @@ public void patchRouterTest() { ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - Operation actualResponse = client.patchRouter(router, requestId, routerResource); + Operation actualResponse = client.patchRouter(router, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -596,10 +591,9 @@ public void patchRouterExceptionTest() throws Exception { try { ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - client.patchRouter(router, requestId, routerResource); + client.patchRouter(router, routerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -706,10 +700,9 @@ public void updateRouterTest() { ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - Operation actualResponse = client.updateRouter(router, requestId, routerResource); + Operation actualResponse = client.updateRouter(router, routerResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -738,10 +731,9 @@ public void updateRouterExceptionTest() throws Exception { try { ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); - String requestId = "requestId37109963"; Router routerResource = Router.newBuilder().build(); - client.updateRouter(router, requestId, routerResource); + client.updateRouter(router, routerResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index 3130b8a9bfdc..f2e69ecc6a4c 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -132,10 +132,9 @@ public void deleteSnapshotTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - Operation actualResponse = client.deleteSnapshot(requestId, snapshot); + Operation actualResponse = client.deleteSnapshot(snapshot); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -162,10 +161,9 @@ public void deleteSnapshotExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalSnapshotName snapshot = ProjectGlobalSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - client.deleteSnapshot(requestId, snapshot); + client.deleteSnapshot(snapshot); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java index ae37831e11ac..527eeda02526 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java @@ -134,9 +134,8 @@ public void deleteSslCertificateTest() { ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteSslCertificate(sslCertificate, requestId); + Operation actualResponse = client.deleteSslCertificate(sslCertificate); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -165,9 +164,8 @@ public void deleteSslCertificateExceptionTest() throws Exception { try { ProjectGlobalSslCertificateName sslCertificate = ProjectGlobalSslCertificateName.of("[PROJECT]", "[SSL_CERTIFICATE]"); - String requestId = "requestId37109963"; - client.deleteSslCertificate(sslCertificate, requestId); + client.deleteSslCertificate(sslCertificate); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -288,12 +286,10 @@ public void insertSslCertificateTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); SslCertificate sslCertificateResource = SslCertificate.newBuilder().build(); - Operation actualResponse = - client.insertSslCertificate(requestId, project, sslCertificateResource); + Operation actualResponse = client.insertSslCertificate(project, sslCertificateResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -320,11 +316,10 @@ public void insertSslCertificateExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); SslCertificate sslCertificateResource = SslCertificate.newBuilder().build(); - client.insertSslCertificate(requestId, project, sslCertificateResource); + client.insertSslCertificate(project, sslCertificateResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java index 6735368b23c3..9b6b78b4bee8 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java @@ -136,11 +136,10 @@ public void deleteSslPolicyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); - Operation actualResponse = client.deleteSslPolicy(requestId, sslPolicy); + Operation actualResponse = client.deleteSslPolicy(sslPolicy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -167,11 +166,10 @@ public void deleteSslPolicyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); - client.deleteSslPolicy(requestId, sslPolicy); + client.deleteSslPolicy(sslPolicy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -294,11 +292,10 @@ public void insertSslPolicyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); - Operation actualResponse = client.insertSslPolicy(requestId, project, sslPolicyResource); + Operation actualResponse = client.insertSslPolicy(project, sslPolicyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -325,11 +322,10 @@ public void insertSslPolicyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); - client.insertSslPolicy(requestId, project, sslPolicyResource); + client.insertSslPolicy(project, sslPolicyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -492,12 +488,11 @@ public void patchSslPolicyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); - Operation actualResponse = client.patchSslPolicy(requestId, sslPolicy, sslPolicyResource); + Operation actualResponse = client.patchSslPolicy(sslPolicy, sslPolicyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -524,12 +519,11 @@ public void patchSslPolicyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalSslPolicyName sslPolicy = ProjectGlobalSslPolicyName.of("[PROJECT]", "[SSL_POLICY]"); SslPolicy sslPolicyResource = SslPolicy.newBuilder().build(); - client.patchSslPolicy(requestId, sslPolicy, sslPolicyResource); + client.patchSslPolicy(sslPolicy, sslPolicyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 62c3de1e1ffd..7712342e3b5a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -206,11 +206,10 @@ public void deleteSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - Operation actualResponse = client.deleteSubnetwork(requestId, subnetwork); + Operation actualResponse = client.deleteSubnetwork(subnetwork); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -237,11 +236,10 @@ public void deleteSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); - client.deleteSubnetwork(requestId, subnetwork); + client.deleteSubnetwork(subnetwork); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -298,15 +296,13 @@ public void expandIpCidrRangeSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); Operation actualResponse = - client.expandIpCidrRangeSubnetwork( - requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + client.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -333,14 +329,12 @@ public void expandIpCidrRangeSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = SubnetworksExpandIpCidrRangeRequest.newBuilder().build(); - client.expandIpCidrRangeSubnetwork( - requestId, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + client.expandIpCidrRangeSubnetwork(subnetwork, subnetworksExpandIpCidrRangeRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -471,11 +465,10 @@ public void insertSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - Operation actualResponse = client.insertSubnetwork(requestId, region, subnetworkResource); + Operation actualResponse = client.insertSubnetwork(region, subnetworkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -502,11 +495,10 @@ public void insertSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - client.insertSubnetwork(requestId, region, subnetworkResource); + client.insertSubnetwork(region, subnetworkResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -623,12 +615,11 @@ public void patchSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - Operation actualResponse = client.patchSubnetwork(requestId, subnetwork, subnetworkResource); + Operation actualResponse = client.patchSubnetwork(subnetwork, subnetworkResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -655,12 +646,11 @@ public void patchSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); Subnetwork subnetworkResource = Subnetwork.newBuilder().build(); - client.patchSubnetwork(requestId, subnetwork, subnetworkResource); + client.patchSubnetwork(subnetwork, subnetworkResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -717,7 +707,6 @@ public void setPrivateIpGoogleAccessSubnetworkTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = @@ -725,7 +714,7 @@ public void setPrivateIpGoogleAccessSubnetworkTest() { Operation actualResponse = client.setPrivateIpGoogleAccessSubnetwork( - requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -752,7 +741,6 @@ public void setPrivateIpGoogleAccessSubnetworkExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); SubnetworksSetPrivateIpGoogleAccessRequest @@ -760,7 +748,7 @@ public void setPrivateIpGoogleAccessSubnetworkExceptionTest() throws Exception { SubnetworksSetPrivateIpGoogleAccessRequest.newBuilder().build(); client.setPrivateIpGoogleAccessSubnetwork( - requestId, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java index 73a118e5bf9d..ffe11ea88660 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java @@ -134,11 +134,10 @@ public void deleteTargetHttpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); - Operation actualResponse = client.deleteTargetHttpProxy(requestId, targetHttpProxy); + Operation actualResponse = client.deleteTargetHttpProxy(targetHttpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -165,11 +164,10 @@ public void deleteTargetHttpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalTargetHttpProxyName targetHttpProxy = ProjectGlobalTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); - client.deleteTargetHttpProxy(requestId, targetHttpProxy); + client.deleteTargetHttpProxy(targetHttpProxy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -288,12 +286,10 @@ public void insertTargetHttpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build(); - Operation actualResponse = - client.insertTargetHttpProxy(requestId, project, targetHttpProxyResource); + Operation actualResponse = client.insertTargetHttpProxy(project, targetHttpProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -320,11 +316,10 @@ public void insertTargetHttpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build(); - client.insertTargetHttpProxy(requestId, project, targetHttpProxyResource); + client.insertTargetHttpProxy(project, targetHttpProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -441,13 +436,12 @@ public void setUrlMapTargetHttpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); Operation actualResponse = - client.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource); + client.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -474,12 +468,11 @@ public void setUrlMapTargetHttpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectTargetHttpProxyName targetHttpProxy = ProjectTargetHttpProxyName.of("[PROJECT]", "[TARGET_HTTP_PROXY]"); UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); - client.setUrlMapTargetHttpProxy(requestId, targetHttpProxy, urlMapReferenceResource); + client.setUrlMapTargetHttpProxy(targetHttpProxy, urlMapReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 1068db766bd1..bd147fecbe76 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -140,9 +140,8 @@ public void deleteTargetHttpsProxyTest() { ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); + Operation actualResponse = client.deleteTargetHttpsProxy(targetHttpsProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -171,9 +170,8 @@ public void deleteTargetHttpsProxyExceptionTest() throws Exception { try { ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; - client.deleteTargetHttpsProxy(targetHttpsProxy, requestId); + client.deleteTargetHttpsProxy(targetHttpsProxy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -295,12 +293,10 @@ public void insertTargetHttpsProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); - Operation actualResponse = - client.insertTargetHttpsProxy(requestId, project, targetHttpsProxyResource); + Operation actualResponse = client.insertTargetHttpsProxy(project, targetHttpsProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -327,11 +323,10 @@ public void insertTargetHttpsProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetHttpsProxy targetHttpsProxyResource = TargetHttpsProxy.newBuilder().build(); - client.insertTargetHttpsProxy(requestId, project, targetHttpsProxyResource); + client.insertTargetHttpsProxy(project, targetHttpsProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -450,14 +445,13 @@ public void setSslCertificatesTargetHttpsProxyTest() { ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = client.setSslCertificatesTargetHttpsProxy( - targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); + targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -486,13 +480,12 @@ public void setSslCertificatesTargetHttpsProxyExceptionTest() throws Exception { try { ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = TargetHttpsProxiesSetSslCertificatesRequest.newBuilder().build(); client.setSslCertificatesTargetHttpsProxy( - targetHttpsProxy, requestId, targetHttpsProxiesSetSslCertificatesRequestResource); + targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -551,12 +544,10 @@ public void setSslPolicyTargetHttpsProxyTest() { ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); Operation actualResponse = - client.setSslPolicyTargetHttpsProxy( - targetHttpsProxy, requestId, sslPolicyReferenceResource); + client.setSslPolicyTargetHttpsProxy(targetHttpsProxy, sslPolicyReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -585,10 +576,9 @@ public void setSslPolicyTargetHttpsProxyExceptionTest() throws Exception { try { ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); - client.setSslPolicyTargetHttpsProxy(targetHttpsProxy, requestId, sslPolicyReferenceResource); + client.setSslPolicyTargetHttpsProxy(targetHttpsProxy, sslPolicyReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -647,11 +637,10 @@ public void setUrlMapTargetHttpsProxyTest() { ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); Operation actualResponse = - client.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource); + client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -680,10 +669,9 @@ public void setUrlMapTargetHttpsProxyExceptionTest() throws Exception { try { ProjectTargetHttpsProxyName targetHttpsProxy = ProjectTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); - String requestId = "requestId37109963"; UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build(); - client.setUrlMapTargetHttpsProxy(targetHttpsProxy, requestId, urlMapReferenceResource); + client.setUrlMapTargetHttpsProxy(targetHttpsProxy, urlMapReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java index 62d4ca7ef7ab..a995d97f1c5a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java @@ -200,11 +200,10 @@ public void deleteTargetInstanceTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); - Operation actualResponse = client.deleteTargetInstance(requestId, targetInstance); + Operation actualResponse = client.deleteTargetInstance(targetInstance); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -231,11 +230,10 @@ public void deleteTargetInstanceExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectZoneTargetInstanceName targetInstance = ProjectZoneTargetInstanceName.of("[PROJECT]", "[ZONE]", "[TARGET_INSTANCE]"); - client.deleteTargetInstance(requestId, targetInstance); + client.deleteTargetInstance(targetInstance); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -360,10 +358,9 @@ public void insertTargetInstanceTest() { mockService.addResponse(expectedResponse); ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); - Operation actualResponse = client.insertTargetInstance(zone, requestId, targetInstanceResource); + Operation actualResponse = client.insertTargetInstance(zone, targetInstanceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -391,10 +388,9 @@ public void insertTargetInstanceExceptionTest() throws Exception { try { ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); - String requestId = "requestId37109963"; TargetInstance targetInstanceResource = TargetInstance.newBuilder().build(); - client.insertTargetInstance(zone, requestId, targetInstanceResource); + client.insertTargetInstance(zone, targetInstanceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java index 55c69ddf141d..12f60655798f 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java @@ -151,13 +151,11 @@ public void addHealthCheckTargetPoolTest() { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); Operation actualResponse = - client.addHealthCheckTargetPool( - targetPool, requestId, targetPoolsAddHealthCheckRequestResource); + client.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -186,12 +184,10 @@ public void addHealthCheckTargetPoolExceptionTest() throws Exception { try { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest.newBuilder().build(); - client.addHealthCheckTargetPool( - targetPool, requestId, targetPoolsAddHealthCheckRequestResource); + client.addHealthCheckTargetPool(targetPool, targetPoolsAddHealthCheckRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -250,12 +246,11 @@ public void addInstanceTargetPoolTest() { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); Operation actualResponse = - client.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource); + client.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -284,11 +279,10 @@ public void addInstanceTargetPoolExceptionTest() throws Exception { try { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = TargetPoolsAddInstanceRequest.newBuilder().build(); - client.addInstanceTargetPool(targetPool, requestId, targetPoolsAddInstanceRequestResource); + client.addInstanceTargetPool(targetPool, targetPoolsAddInstanceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -410,9 +404,8 @@ public void deleteTargetPoolTest() { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteTargetPool(targetPool, requestId); + Operation actualResponse = client.deleteTargetPool(targetPool); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -441,9 +434,8 @@ public void deleteTargetPoolExceptionTest() throws Exception { try { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; - client.deleteTargetPool(targetPool, requestId); + client.deleteTargetPool(targetPool); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -619,11 +611,10 @@ public void insertTargetPoolTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); TargetPool targetPoolResource = TargetPool.newBuilder().build(); - Operation actualResponse = client.insertTargetPool(requestId, region, targetPoolResource); + Operation actualResponse = client.insertTargetPool(region, targetPoolResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -650,11 +641,10 @@ public void insertTargetPoolExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); TargetPool targetPoolResource = TargetPool.newBuilder().build(); - client.insertTargetPool(requestId, region, targetPoolResource); + client.insertTargetPool(region, targetPoolResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -773,13 +763,11 @@ public void removeHealthCheckTargetPoolTest() { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); Operation actualResponse = - client.removeHealthCheckTargetPool( - targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); + client.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -808,12 +796,10 @@ public void removeHealthCheckTargetPoolExceptionTest() throws Exception { try { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = TargetPoolsRemoveHealthCheckRequest.newBuilder().build(); - client.removeHealthCheckTargetPool( - targetPool, requestId, targetPoolsRemoveHealthCheckRequestResource); + client.removeHealthCheckTargetPool(targetPool, targetPoolsRemoveHealthCheckRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -872,13 +858,11 @@ public void removeInstanceTargetPoolTest() { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); Operation actualResponse = - client.removeInstanceTargetPool( - targetPool, requestId, targetPoolsRemoveInstanceRequestResource); + client.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -907,12 +891,10 @@ public void removeInstanceTargetPoolExceptionTest() throws Exception { try { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = TargetPoolsRemoveInstanceRequest.newBuilder().build(); - client.removeInstanceTargetPool( - targetPool, requestId, targetPoolsRemoveInstanceRequestResource); + client.removeInstanceTargetPool(targetPool, targetPoolsRemoveInstanceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -971,12 +953,11 @@ public void setBackupTargetPoolTest() { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; Float failoverRatio = -8.6107481E7F; TargetReference targetReferenceResource = TargetReference.newBuilder().build(); Operation actualResponse = - client.setBackupTargetPool(targetPool, requestId, failoverRatio, targetReferenceResource); + client.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1005,11 +986,10 @@ public void setBackupTargetPoolExceptionTest() throws Exception { try { ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName.of("[PROJECT]", "[REGION]", "[TARGET_POOL]"); - String requestId = "requestId37109963"; Float failoverRatio = -8.6107481E7F; TargetReference targetReferenceResource = TargetReference.newBuilder().build(); - client.setBackupTargetPool(targetPool, requestId, failoverRatio, targetReferenceResource); + client.setBackupTargetPool(targetPool, failoverRatio, targetReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java index d53c2359b802..ecf6d8291c59 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java @@ -142,9 +142,8 @@ public void deleteTargetSslProxyTest() { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteTargetSslProxy(targetSslProxy, requestId); + Operation actualResponse = client.deleteTargetSslProxy(targetSslProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -173,9 +172,8 @@ public void deleteTargetSslProxyExceptionTest() throws Exception { try { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; - client.deleteTargetSslProxy(targetSslProxy, requestId); + client.deleteTargetSslProxy(targetSslProxy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -299,12 +297,10 @@ public void insertTargetSslProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); - Operation actualResponse = - client.insertTargetSslProxy(requestId, project, targetSslProxyResource); + Operation actualResponse = client.insertTargetSslProxy(project, targetSslProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -331,11 +327,10 @@ public void insertTargetSslProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetSslProxy targetSslProxyResource = TargetSslProxy.newBuilder().build(); - client.insertTargetSslProxy(requestId, project, targetSslProxyResource); + client.insertTargetSslProxy(project, targetSslProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -454,13 +449,12 @@ public void setBackendServiceTargetSslProxyTest() { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); Operation actualResponse = client.setBackendServiceTargetSslProxy( - targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); + targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -489,12 +483,11 @@ public void setBackendServiceTargetSslProxyExceptionTest() throws Exception { try { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = TargetSslProxiesSetBackendServiceRequest.newBuilder().build(); client.setBackendServiceTargetSslProxy( - targetSslProxy, requestId, targetSslProxiesSetBackendServiceRequestResource); + targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -553,13 +546,12 @@ public void setProxyHeaderTargetSslProxyTest() { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); Operation actualResponse = client.setProxyHeaderTargetSslProxy( - targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); + targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -588,12 +580,11 @@ public void setProxyHeaderTargetSslProxyExceptionTest() throws Exception { try { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = TargetSslProxiesSetProxyHeaderRequest.newBuilder().build(); client.setProxyHeaderTargetSslProxy( - targetSslProxy, requestId, targetSslProxiesSetProxyHeaderRequestResource); + targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -652,13 +643,12 @@ public void setSslCertificatesTargetSslProxyTest() { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); Operation actualResponse = client.setSslCertificatesTargetSslProxy( - targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); + targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -687,12 +677,11 @@ public void setSslCertificatesTargetSslProxyExceptionTest() throws Exception { try { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = TargetSslProxiesSetSslCertificatesRequest.newBuilder().build(); client.setSslCertificatesTargetSslProxy( - targetSslProxy, requestId, targetSslProxiesSetSslCertificatesRequestResource); + targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -751,11 +740,10 @@ public void setSslPolicyTargetSslProxyTest() { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); Operation actualResponse = - client.setSslPolicyTargetSslProxy(targetSslProxy, requestId, sslPolicyReferenceResource); + client.setSslPolicyTargetSslProxy(targetSslProxy, sslPolicyReferenceResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -784,10 +772,9 @@ public void setSslPolicyTargetSslProxyExceptionTest() throws Exception { try { ProjectGlobalTargetSslProxyName targetSslProxy = ProjectGlobalTargetSslProxyName.of("[PROJECT]", "[TARGET_SSL_PROXY]"); - String requestId = "requestId37109963"; SslPolicyReference sslPolicyReferenceResource = SslPolicyReference.newBuilder().build(); - client.setSslPolicyTargetSslProxy(targetSslProxy, requestId, sslPolicyReferenceResource); + client.setSslPolicyTargetSslProxy(targetSslProxy, sslPolicyReferenceResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java index 067f5a281022..bb83dfbfe5af 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java @@ -136,11 +136,10 @@ public void deleteTargetTcpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - Operation actualResponse = client.deleteTargetTcpProxy(requestId, targetTcpProxy); + Operation actualResponse = client.deleteTargetTcpProxy(targetTcpProxy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -167,11 +166,10 @@ public void deleteTargetTcpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); - client.deleteTargetTcpProxy(requestId, targetTcpProxy); + client.deleteTargetTcpProxy(targetTcpProxy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -292,12 +290,10 @@ public void insertTargetTcpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build(); - Operation actualResponse = - client.insertTargetTcpProxy(requestId, project, targetTcpProxyResource); + Operation actualResponse = client.insertTargetTcpProxy(project, targetTcpProxyResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -324,11 +320,10 @@ public void insertTargetTcpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build(); - client.insertTargetTcpProxy(requestId, project, targetTcpProxyResource); + client.insertTargetTcpProxy(project, targetTcpProxyResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -445,7 +440,6 @@ public void setBackendServiceTargetTcpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = @@ -453,7 +447,7 @@ public void setBackendServiceTargetTcpProxyTest() { Operation actualResponse = client.setBackendServiceTargetTcpProxy( - requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -480,14 +474,13 @@ public void setBackendServiceTargetTcpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = TargetTcpProxiesSetBackendServiceRequest.newBuilder().build(); client.setBackendServiceTargetTcpProxy( - requestId, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -544,7 +537,6 @@ public void setProxyHeaderTargetTcpProxyTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = @@ -552,7 +544,7 @@ public void setProxyHeaderTargetTcpProxyTest() { Operation actualResponse = client.setProxyHeaderTargetTcpProxy( - requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -579,14 +571,13 @@ public void setProxyHeaderTargetTcpProxyExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PROJECT]", "[TARGET_TCP_PROXY]"); TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build(); client.setProxyHeaderTargetTcpProxy( - requestId, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java index e79add735159..82090ab7b5c2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java @@ -201,11 +201,10 @@ public void deleteTargetVpnGatewayTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); - Operation actualResponse = client.deleteTargetVpnGateway(requestId, targetVpnGateway); + Operation actualResponse = client.deleteTargetVpnGateway(targetVpnGateway); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -232,11 +231,10 @@ public void deleteTargetVpnGatewayExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionTargetVpnGatewayName targetVpnGateway = ProjectRegionTargetVpnGatewayName.of("[PROJECT]", "[REGION]", "[TARGET_VPN_GATEWAY]"); - client.deleteTargetVpnGateway(requestId, targetVpnGateway); + client.deleteTargetVpnGateway(targetVpnGateway); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -359,12 +357,10 @@ public void insertTargetVpnGatewayTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build(); - Operation actualResponse = - client.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource); + Operation actualResponse = client.insertTargetVpnGateway(region, targetVpnGatewayResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -391,11 +387,10 @@ public void insertTargetVpnGatewayExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); TargetVpnGateway targetVpnGatewayResource = TargetVpnGateway.newBuilder().build(); - client.insertTargetVpnGateway(requestId, region, targetVpnGatewayResource); + client.insertTargetVpnGateway(region, targetVpnGatewayResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java index ddd8b2fd8ee3..b5cf326bc414 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java @@ -141,9 +141,8 @@ public void deleteUrlMapTest() { mockService.addResponse(expectedResponse); ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; - Operation actualResponse = client.deleteUrlMap(urlMap, requestId); + Operation actualResponse = client.deleteUrlMap(urlMap); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -171,9 +170,8 @@ public void deleteUrlMapExceptionTest() throws Exception { try { ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; - client.deleteUrlMap(urlMap, requestId); + client.deleteUrlMap(urlMap); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -292,11 +290,10 @@ public void insertUrlMapTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UrlMap urlMapResource = UrlMap.newBuilder().build(); - Operation actualResponse = client.insertUrlMap(requestId, project, urlMapResource); + Operation actualResponse = client.insertUrlMap(project, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -323,11 +320,10 @@ public void insertUrlMapExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectName project = ProjectName.of("[PROJECT]"); UrlMap urlMapResource = UrlMap.newBuilder().build(); - client.insertUrlMap(requestId, project, urlMapResource); + client.insertUrlMap(project, urlMapResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -385,12 +381,10 @@ public void invalidateCacheUrlMapTest() { mockService.addResponse(expectedResponse); ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); - Operation actualResponse = - client.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource); + Operation actualResponse = client.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -418,11 +412,10 @@ public void invalidateCacheUrlMapExceptionTest() throws Exception { try { ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; CacheInvalidationRule cacheInvalidationRuleResource = CacheInvalidationRule.newBuilder().build(); - client.invalidateCacheUrlMap(urlMap, requestId, cacheInvalidationRuleResource); + client.invalidateCacheUrlMap(urlMap, cacheInvalidationRuleResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -540,10 +533,9 @@ public void patchUrlMapTest() { mockService.addResponse(expectedResponse); ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - Operation actualResponse = client.patchUrlMap(urlMap, requestId, urlMapResource); + Operation actualResponse = client.patchUrlMap(urlMap, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -571,10 +563,9 @@ public void patchUrlMapExceptionTest() throws Exception { try { ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - client.patchUrlMap(urlMap, requestId, urlMapResource); + client.patchUrlMap(urlMap, urlMapResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -632,10 +623,9 @@ public void updateUrlMapTest() { mockService.addResponse(expectedResponse); ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - Operation actualResponse = client.updateUrlMap(urlMap, requestId, urlMapResource); + Operation actualResponse = client.updateUrlMap(urlMap, urlMapResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -663,10 +653,9 @@ public void updateUrlMapExceptionTest() throws Exception { try { ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName.of("[PROJECT]", "[URL_MAP]"); - String requestId = "requestId37109963"; UrlMap urlMapResource = UrlMap.newBuilder().build(); - client.updateUrlMap(urlMap, requestId, urlMapResource); + client.updateUrlMap(urlMap, urlMapResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java index ec71f3dd9208..d6585dbe7be2 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java @@ -200,11 +200,10 @@ public void deleteVpnTunnelTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); - Operation actualResponse = client.deleteVpnTunnel(requestId, vpnTunnel); + Operation actualResponse = client.deleteVpnTunnel(vpnTunnel); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -231,11 +230,10 @@ public void deleteVpnTunnelExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName.of("[PROJECT]", "[REGION]", "[VPN_TUNNEL]"); - client.deleteVpnTunnel(requestId, vpnTunnel); + client.deleteVpnTunnel(vpnTunnel); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -372,11 +370,10 @@ public void insertVpnTunnelTest() { .build(); mockService.addResponse(expectedResponse); - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); - Operation actualResponse = client.insertVpnTunnel(requestId, region, vpnTunnelResource); + Operation actualResponse = client.insertVpnTunnel(region, vpnTunnelResource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -403,11 +400,10 @@ public void insertVpnTunnelExceptionTest() throws Exception { mockService.addException(exception); try { - String requestId = "requestId37109963"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); VpnTunnel vpnTunnelResource = VpnTunnel.newBuilder().build(); - client.insertVpnTunnel(requestId, region, vpnTunnelResource); + client.insertVpnTunnel(region, vpnTunnelResource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception From 7a8ef835d7d1ce4237c22f64dde296b5fe0798a1 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 22 May 2018 13:30:01 -0700 Subject: [PATCH 39/42] moving google-cloud-compute to google-cloud-clients/compute --- .../google-cloud-compute/pom.xml | 20 - .../cloud/compute/deprecated/Address.java | 191 - .../cloud/compute/deprecated/AddressId.java | 91 - .../cloud/compute/deprecated/AddressInfo.java | 574 --- .../compute/deprecated/AttachedDisk.java | 926 ---- .../cloud/compute/deprecated/Compute.java | 2709 ----------- .../compute/deprecated/ComputeException.java | 62 - .../compute/deprecated/ComputeFactory.java | 25 - .../cloud/compute/deprecated/ComputeImpl.java | 2058 -------- .../compute/deprecated/ComputeOptions.java | 145 - .../compute/deprecated/DeprecationStatus.java | 360 -- .../google/cloud/compute/deprecated/Disk.java | 262 -- .../compute/deprecated/DiskConfiguration.java | 203 - .../cloud/compute/deprecated/DiskId.java | 162 - .../deprecated/DiskImageConfiguration.java | 165 - .../cloud/compute/deprecated/DiskInfo.java | 443 -- .../cloud/compute/deprecated/DiskType.java | 244 - .../cloud/compute/deprecated/DiskTypeId.java | 153 - .../compute/deprecated/ForwardingRuleId.java | 93 - .../compute/deprecated/GlobalAddressId.java | 104 - .../deprecated/GlobalForwardingRuleId.java | 123 - .../compute/deprecated/GlobalOperationId.java | 92 - .../cloud/compute/deprecated/Image.java | 214 - .../deprecated/ImageConfiguration.java | 190 - .../deprecated/ImageDiskConfiguration.java | 178 - .../cloud/compute/deprecated/ImageId.java | 145 - .../cloud/compute/deprecated/ImageInfo.java | 417 -- .../cloud/compute/deprecated/Instance.java | 465 -- .../cloud/compute/deprecated/InstanceId.java | 177 - .../compute/deprecated/InstanceInfo.java | 676 --- .../cloud/compute/deprecated/License.java | 92 - .../cloud/compute/deprecated/LicenseId.java | 128 - .../cloud/compute/deprecated/MachineType.java | 323 -- .../compute/deprecated/MachineTypeId.java | 148 - .../cloud/compute/deprecated/Metadata.java | 212 - .../cloud/compute/deprecated/Network.java | 194 - .../deprecated/NetworkConfiguration.java | 98 - .../cloud/compute/deprecated/NetworkId.java | 137 - .../cloud/compute/deprecated/NetworkInfo.java | 291 -- .../compute/deprecated/NetworkInterface.java | 548 --- .../cloud/compute/deprecated/Operation.java | 845 ---- .../cloud/compute/deprecated/OperationId.java | 93 - .../cloud/compute/deprecated/Option.java | 72 - .../cloud/compute/deprecated/Region.java | 421 -- .../compute/deprecated/RegionAddressId.java | 151 - .../deprecated/RegionForwardingRuleId.java | 167 - .../cloud/compute/deprecated/RegionId.java | 133 - .../compute/deprecated/RegionOperationId.java | 133 - .../cloud/compute/deprecated/ResourceId.java | 71 - .../compute/deprecated/SchedulingOptions.java | 193 - .../compute/deprecated/ServiceAccount.java | 123 - .../cloud/compute/deprecated/Snapshot.java | 216 - .../deprecated/SnapshotDiskConfiguration.java | 184 - .../cloud/compute/deprecated/SnapshotId.java | 132 - .../compute/deprecated/SnapshotInfo.java | 484 -- .../deprecated/StandardDiskConfiguration.java | 131 - .../StandardNetworkConfiguration.java | 102 - .../deprecated/StorageImageConfiguration.java | 204 - .../SubnetNetworkConfiguration.java | 111 - .../cloud/compute/deprecated/Subnetwork.java | 191 - .../compute/deprecated/SubnetworkId.java | 179 - .../compute/deprecated/SubnetworkInfo.java | 348 -- .../google/cloud/compute/deprecated/Tags.java | 227 - .../google/cloud/compute/deprecated/Zone.java | 303 -- .../cloud/compute/deprecated/ZoneId.java | 128 - .../compute/deprecated/ZoneOperationId.java | 133 - .../compute/deprecated/package-info.java | 59 - .../deprecated/spi/ComputeRpcFactory.java | 27 - .../compute/deprecated/spi/v1/ComputeRpc.java | 650 --- .../deprecated/spi/v1/HttpComputeRpc.java | 1159 ----- .../testing/RemoteComputeHelper.java | 137 - .../deprecated/testing/ResourceCleaner.java | 171 - .../deprecated/testing/package-info.java | 31 - ...tancesInstanceGroupManagerHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../cloud/compute/v1/AcceleratorConfig.java | 0 .../cloud/compute/v1/AcceleratorType.java | 0 .../v1/AcceleratorTypeAggregatedList.java | 0 .../compute/v1/AcceleratorTypeClient.java | 0 .../cloud/compute/v1/AcceleratorTypeList.java | 0 .../compute/v1/AcceleratorTypeSettings.java | 0 .../v1/AcceleratorTypesScopedList.java | 0 .../google/cloud/compute/v1/AccessConfig.java | 0 .../AddAccessConfigInstanceHttpRequest.java | 0 .../AddHealthCheckTargetPoolHttpRequest.java | 0 .../v1/AddInstanceTargetPoolHttpRequest.java | 0 .../AddInstancesInstanceGroupHttpRequest.java | 0 .../v1/AddPeeringNetworkHttpRequest.java | 0 .../com/google/cloud/compute/v1/Address.java | 0 .../compute/v1/AddressAggregatedList.java | 0 .../cloud/compute/v1/AddressClient.java | 0 .../google/cloud/compute/v1/AddressList.java | 0 .../cloud/compute/v1/AddressSettings.java | 0 .../cloud/compute/v1/AddressesScopedList.java | 0 ...egatedListAcceleratorTypesHttpRequest.java | 0 .../AggregatedListAddressesHttpRequest.java | 0 .../AggregatedListAutoscalersHttpRequest.java | 0 ...regatedListBackendServicesHttpRequest.java | 0 .../AggregatedListDiskTypesHttpRequest.java | 0 .../v1/AggregatedListDisksHttpRequest.java | 0 ...regatedListForwardingRulesHttpRequest.java | 0 ...egatedListGlobalOperationsHttpRequest.java | 0 ...dListInstanceGroupManagersHttpRequest.java | 0 ...gregatedListInstanceGroupsHttpRequest.java | 0 .../AggregatedListInstancesHttpRequest.java | 0 ...istInterconnectAttachmentsHttpRequest.java | 0 ...AggregatedListMachineTypesHttpRequest.java | 0 ...gatedListRegionCommitmentsHttpRequest.java | 0 .../v1/AggregatedListRoutersHttpRequest.java | 0 .../AggregatedListSubnetworksHttpRequest.java | 0 ...regatedListTargetInstancesHttpRequest.java | 0 .../AggregatedListTargetPoolsHttpRequest.java | 0 ...gatedListTargetVpnGatewaysHttpRequest.java | 0 .../AggregatedListVpnTunnelsHttpRequest.java | 0 .../google/cloud/compute/v1/AliasIpRange.java | 0 .../com/google/cloud/compute/v1/Allowed.java | 0 .../v1/AttachDiskInstanceHttpRequest.java | 0 .../google/cloud/compute/v1/AttachedDisk.java | 0 .../v1/AttachedDiskInitializeParams.java | 0 .../google/cloud/compute/v1/Autoscaler.java | 0 .../compute/v1/AutoscalerAggregatedList.java | 0 .../cloud/compute/v1/AutoscalerClient.java | 0 .../cloud/compute/v1/AutoscalerList.java | 0 .../cloud/compute/v1/AutoscalerSettings.java | 0 .../compute/v1/AutoscalerStatusDetails.java | 0 .../compute/v1/AutoscalersScopedList.java | 0 .../cloud/compute/v1/AutoscalingPolicy.java | 0 .../v1/AutoscalingPolicyCpuUtilization.java | 0 ...oscalingPolicyCustomMetricUtilization.java | 0 ...scalingPolicyLoadBalancingUtilization.java | 0 .../com/google/cloud/compute/v1/Backend.java | 0 .../cloud/compute/v1/BackendBucket.java | 0 .../cloud/compute/v1/BackendBucketClient.java | 0 .../cloud/compute/v1/BackendBucketList.java | 0 .../compute/v1/BackendBucketSettings.java | 0 .../cloud/compute/v1/BackendService.java | 0 .../v1/BackendServiceAggregatedList.java | 0 .../compute/v1/BackendServiceCdnPolicy.java | 0 .../compute/v1/BackendServiceClient.java | 0 .../compute/v1/BackendServiceGroupHealth.java | 0 .../cloud/compute/v1/BackendServiceIAP.java | 0 .../cloud/compute/v1/BackendServiceList.java | 0 .../compute/v1/BackendServiceSettings.java | 0 .../compute/v1/BackendServicesScopedList.java | 0 .../compute/v1/CacheInvalidationRule.java | 0 .../cloud/compute/v1/CacheKeyPolicy.java | 0 .../google/cloud/compute/v1/Commitment.java | 0 .../compute/v1/CommitmentAggregatedList.java | 0 .../cloud/compute/v1/CommitmentList.java | 0 .../compute/v1/CommitmentsScopedList.java | 0 .../cloud/compute/v1/ConnectionDraining.java | 0 .../v1/CreateSnapshotDiskHttpRequest.java | 0 .../CreateSnapshotRegionDiskHttpRequest.java | 0 .../compute/v1/CustomerEncryptionKey.java | 0 .../CustomerEncryptionKeyProtectedDisk.java | 0 .../com/google/cloud/compute/v1/Data.java | 0 ...DeleteAccessConfigInstanceHttpRequest.java | 0 .../compute/v1/DeleteAddressHttpRequest.java | 0 .../v1/DeleteAutoscalerHttpRequest.java | 0 .../v1/DeleteBackendBucketHttpRequest.java | 0 .../v1/DeleteBackendServiceHttpRequest.java | 0 .../compute/v1/DeleteDiskHttpRequest.java | 0 .../compute/v1/DeleteFirewallHttpRequest.java | 0 .../v1/DeleteForwardingRuleHttpRequest.java | 0 .../v1/DeleteGlobalAddressHttpRequest.java | 0 ...DeleteGlobalForwardingRuleHttpRequest.java | 0 .../v1/DeleteGlobalOperationHttpRequest.java | 0 .../v1/DeleteHealthCheckHttpRequest.java | 0 .../v1/DeleteHttpHealthCheckHttpRequest.java | 0 .../v1/DeleteHttpsHealthCheckHttpRequest.java | 0 .../compute/v1/DeleteImageHttpRequest.java | 0 .../v1/DeleteInstanceGroupHttpRequest.java | 0 ...DeleteInstanceGroupManagerHttpRequest.java | 0 .../compute/v1/DeleteInstanceHttpRequest.java | 0 .../v1/DeleteInstanceTemplateHttpRequest.java | 0 ...tancesInstanceGroupManagerHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 ...leteInterconnectAttachmentHttpRequest.java | 0 .../v1/DeleteInterconnectHttpRequest.java | 0 .../compute/v1/DeleteLicenseHttpRequest.java | 0 .../compute/v1/DeleteNetworkHttpRequest.java | 0 .../v1/DeleteRegionAutoscalerHttpRequest.java | 0 ...DeleteRegionBackendServiceHttpRequest.java | 0 .../v1/DeleteRegionDiskHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../v1/DeleteRegionOperationHttpRequest.java | 0 .../compute/v1/DeleteRouteHttpRequest.java | 0 .../compute/v1/DeleteRouterHttpRequest.java | 0 .../compute/v1/DeleteSnapshotHttpRequest.java | 0 .../v1/DeleteSslCertificateHttpRequest.java | 0 .../v1/DeleteSslPolicyHttpRequest.java | 0 .../v1/DeleteSubnetworkHttpRequest.java | 0 .../v1/DeleteTargetHttpProxyHttpRequest.java | 0 .../v1/DeleteTargetHttpsProxyHttpRequest.java | 0 .../v1/DeleteTargetInstanceHttpRequest.java | 0 .../v1/DeleteTargetPoolHttpRequest.java | 0 .../v1/DeleteTargetSslProxyHttpRequest.java | 0 .../v1/DeleteTargetTcpProxyHttpRequest.java | 0 .../v1/DeleteTargetVpnGatewayHttpRequest.java | 0 .../compute/v1/DeleteUrlMapHttpRequest.java | 0 .../v1/DeleteVpnTunnelHttpRequest.java | 0 .../v1/DeleteZoneOperationHttpRequest.java | 0 .../com/google/cloud/compute/v1/Denied.java | 0 .../compute/v1/DeprecateImageHttpRequest.java | 0 .../cloud/compute/v1/DeprecationStatus.java | 0 .../v1/DetachDiskInstanceHttpRequest.java | 0 .../v1/DisableXpnHostProjectHttpRequest.java | 0 .../DisableXpnResourceProjectHttpRequest.java | 0 .../com/google/cloud/compute/v1/Disk.java | 0 .../cloud/compute/v1/DiskAggregatedList.java | 0 .../google/cloud/compute/v1/DiskClient.java | 0 .../com/google/cloud/compute/v1/DiskList.java | 0 .../cloud/compute/v1/DiskMoveRequest.java | 0 .../google/cloud/compute/v1/DiskSettings.java | 0 .../com/google/cloud/compute/v1/DiskType.java | 0 .../compute/v1/DiskTypeAggregatedList.java | 0 .../cloud/compute/v1/DiskTypeClient.java | 0 .../google/cloud/compute/v1/DiskTypeList.java | 0 .../cloud/compute/v1/DiskTypeSettings.java | 0 .../cloud/compute/v1/DiskTypesScopedList.java | 0 .../cloud/compute/v1/DisksResizeRequest.java | 0 .../cloud/compute/v1/DisksScopedList.java | 0 .../v1/EnableXpnHostProjectHttpRequest.java | 0 .../EnableXpnResourceProjectHttpRequest.java | 0 .../com/google/cloud/compute/v1/Error.java | 0 .../com/google/cloud/compute/v1/Errors.java | 0 ...xpandIpCidrRangeSubnetworkHttpRequest.java | 0 .../com/google/cloud/compute/v1/Firewall.java | 0 .../cloud/compute/v1/FirewallClient.java | 0 .../google/cloud/compute/v1/FirewallList.java | 0 .../cloud/compute/v1/FirewallSettings.java | 0 .../cloud/compute/v1/ForwardingRule.java | 0 .../v1/ForwardingRuleAggregatedList.java | 0 .../compute/v1/ForwardingRuleClient.java | 0 .../cloud/compute/v1/ForwardingRuleList.java | 0 .../compute/v1/ForwardingRuleSettings.java | 0 .../compute/v1/ForwardingRulesScopedList.java | 0 .../v1/GetAcceleratorTypeHttpRequest.java | 0 .../compute/v1/GetAddressHttpRequest.java | 0 .../compute/v1/GetAutoscalerHttpRequest.java | 0 .../v1/GetBackendBucketHttpRequest.java | 0 .../v1/GetBackendServiceHttpRequest.java | 0 .../cloud/compute/v1/GetDiskHttpRequest.java | 0 .../compute/v1/GetDiskTypeHttpRequest.java | 0 .../compute/v1/GetFirewallHttpRequest.java | 0 .../v1/GetForwardingRuleHttpRequest.java | 0 .../v1/GetFromFamilyImageHttpRequest.java | 0 .../v1/GetGlobalAddressHttpRequest.java | 0 .../GetGlobalForwardingRuleHttpRequest.java | 0 .../v1/GetGlobalOperationHttpRequest.java | 0 .../GetHealthBackendServiceHttpRequest.java | 0 .../compute/v1/GetHealthCheckHttpRequest.java | 0 ...HealthRegionBackendServiceHttpRequest.java | 0 .../v1/GetHealthTargetPoolHttpRequest.java | 0 .../v1/GetHttpHealthCheckHttpRequest.java | 0 .../v1/GetHttpsHealthCheckHttpRequest.java | 0 .../cloud/compute/v1/GetImageHttpRequest.java | 0 .../v1/GetInstanceGroupHttpRequest.java | 0 .../GetInstanceGroupManagerHttpRequest.java | 0 .../compute/v1/GetInstanceHttpRequest.java | 0 .../v1/GetInstanceTemplateHttpRequest.java | 0 .../GetInterconnectAttachmentHttpRequest.java | 0 .../v1/GetInterconnectHttpRequest.java | 0 .../GetInterconnectLocationHttpRequest.java | 0 .../compute/v1/GetLicenseCodeHttpRequest.java | 0 .../compute/v1/GetLicenseHttpRequest.java | 0 .../compute/v1/GetMachineTypeHttpRequest.java | 0 .../compute/v1/GetNetworkHttpRequest.java | 0 .../compute/v1/GetProjectHttpRequest.java | 0 .../v1/GetRegionAutoscalerHttpRequest.java | 0 .../GetRegionBackendServiceHttpRequest.java | 0 .../v1/GetRegionCommitmentHttpRequest.java | 0 .../compute/v1/GetRegionDiskHttpRequest.java | 0 .../v1/GetRegionDiskTypeHttpRequest.java | 0 .../compute/v1/GetRegionHttpRequest.java | 0 .../v1/GetRegionInstanceGroupHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../v1/GetRegionOperationHttpRequest.java | 0 .../cloud/compute/v1/GetRouteHttpRequest.java | 0 .../compute/v1/GetRouterHttpRequest.java | 0 .../v1/GetRouterStatusRouterHttpRequest.java | 0 ...etSerialPortOutputInstanceHttpRequest.java | 0 .../compute/v1/GetSnapshotHttpRequest.java | 0 .../v1/GetSslCertificateHttpRequest.java | 0 .../compute/v1/GetSslPolicyHttpRequest.java | 0 .../compute/v1/GetSubnetworkHttpRequest.java | 0 .../v1/GetTargetHttpProxyHttpRequest.java | 0 .../v1/GetTargetHttpsProxyHttpRequest.java | 0 .../v1/GetTargetInstanceHttpRequest.java | 0 .../compute/v1/GetTargetPoolHttpRequest.java | 0 .../v1/GetTargetSslProxyHttpRequest.java | 0 .../v1/GetTargetTcpProxyHttpRequest.java | 0 .../v1/GetTargetVpnGatewayHttpRequest.java | 0 .../compute/v1/GetUrlMapHttpRequest.java | 0 .../compute/v1/GetVpnTunnelHttpRequest.java | 0 .../v1/GetXpnHostProjectHttpRequest.java | 0 .../GetXpnResourcesProjectsHttpRequest.java | 0 .../cloud/compute/v1/GetZoneHttpRequest.java | 0 .../v1/GetZoneOperationHttpRequest.java | 0 .../cloud/compute/v1/GlobalAddressClient.java | 0 .../compute/v1/GlobalAddressSettings.java | 0 .../v1/GlobalForwardingRuleClient.java | 0 .../v1/GlobalForwardingRuleSettings.java | 0 .../compute/v1/GlobalOperationClient.java | 0 .../compute/v1/GlobalOperationSettings.java | 0 .../compute/v1/GlobalSetLabelsRequest.java | 0 .../cloud/compute/v1/GuestOsFeature.java | 0 .../google/cloud/compute/v1/HealthCheck.java | 0 .../cloud/compute/v1/HealthCheckClient.java | 0 .../cloud/compute/v1/HealthCheckList.java | 0 .../compute/v1/HealthCheckReference.java | 0 .../cloud/compute/v1/HealthCheckSettings.java | 0 .../google/cloud/compute/v1/HealthStatus.java | 0 .../com/google/cloud/compute/v1/HostRule.java | 0 .../cloud/compute/v1/HttpHealthCheck.java | 0 .../cloud/compute/v1/HttpHealthCheck2.java | 0 .../compute/v1/HttpHealthCheckClient.java | 0 .../cloud/compute/v1/HttpHealthCheckList.java | 0 .../compute/v1/HttpHealthCheckSettings.java | 0 .../cloud/compute/v1/HttpSHealthCheck.java | 0 .../cloud/compute/v1/HttpsHealthCheck2.java | 0 .../compute/v1/HttpsHealthCheckClient.java | 0 .../compute/v1/HttpsHealthCheckList.java | 0 .../compute/v1/HttpsHealthCheckSettings.java | 0 .../com/google/cloud/compute/v1/Image.java | 0 .../google/cloud/compute/v1/ImageClient.java | 0 .../google/cloud/compute/v1/ImageList.java | 0 .../cloud/compute/v1/ImageSettings.java | 0 .../compute/v1/InsertAddressHttpRequest.java | 0 .../v1/InsertAutoscalerHttpRequest.java | 0 .../v1/InsertBackendBucketHttpRequest.java | 0 .../v1/InsertBackendServiceHttpRequest.java | 0 .../compute/v1/InsertDiskHttpRequest.java | 0 .../compute/v1/InsertFirewallHttpRequest.java | 0 .../v1/InsertForwardingRuleHttpRequest.java | 0 .../v1/InsertGlobalAddressHttpRequest.java | 0 ...InsertGlobalForwardingRuleHttpRequest.java | 0 .../v1/InsertHealthCheckHttpRequest.java | 0 .../v1/InsertHttpHealthCheckHttpRequest.java | 0 .../v1/InsertHttpsHealthCheckHttpRequest.java | 0 .../compute/v1/InsertImageHttpRequest.java | 0 .../v1/InsertInstanceGroupHttpRequest.java | 0 ...InsertInstanceGroupManagerHttpRequest.java | 0 .../compute/v1/InsertInstanceHttpRequest.java | 0 .../v1/InsertInstanceTemplateHttpRequest.java | 0 ...sertInterconnectAttachmentHttpRequest.java | 0 .../v1/InsertInterconnectHttpRequest.java | 0 .../compute/v1/InsertLicenseHttpRequest.java | 0 .../compute/v1/InsertNetworkHttpRequest.java | 0 .../v1/InsertRegionAutoscalerHttpRequest.java | 0 ...InsertRegionBackendServiceHttpRequest.java | 0 .../v1/InsertRegionCommitmentHttpRequest.java | 0 .../v1/InsertRegionDiskHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../compute/v1/InsertRouteHttpRequest.java | 0 .../compute/v1/InsertRouterHttpRequest.java | 0 .../v1/InsertSslCertificateHttpRequest.java | 0 .../v1/InsertSslPolicyHttpRequest.java | 0 .../v1/InsertSubnetworkHttpRequest.java | 0 .../v1/InsertTargetHttpProxyHttpRequest.java | 0 .../v1/InsertTargetHttpsProxyHttpRequest.java | 0 .../v1/InsertTargetInstanceHttpRequest.java | 0 .../v1/InsertTargetPoolHttpRequest.java | 0 .../v1/InsertTargetSslProxyHttpRequest.java | 0 .../v1/InsertTargetTcpProxyHttpRequest.java | 0 .../v1/InsertTargetVpnGatewayHttpRequest.java | 0 .../compute/v1/InsertUrlMapHttpRequest.java | 0 .../v1/InsertVpnTunnelHttpRequest.java | 0 .../com/google/cloud/compute/v1/Instance.java | 0 .../compute/v1/InstanceAggregatedList.java | 0 .../cloud/compute/v1/InstanceClient.java | 0 .../cloud/compute/v1/InstanceGroup.java | 0 .../v1/InstanceGroupAggregatedList.java | 0 .../cloud/compute/v1/InstanceGroupClient.java | 0 .../cloud/compute/v1/InstanceGroupList.java | 0 .../compute/v1/InstanceGroupManager.java | 0 .../InstanceGroupManagerActionsSummary.java | 0 .../InstanceGroupManagerAggregatedList.java | 0 .../v1/InstanceGroupManagerClient.java | 0 .../compute/v1/InstanceGroupManagerList.java | 0 .../v1/InstanceGroupManagerSettings.java | 0 ...eGroupManagersAbandonInstancesRequest.java | 0 ...ceGroupManagersDeleteInstancesRequest.java | 0 ...pManagersListManagedInstancesResponse.java | 0 ...GroupManagersRecreateInstancesRequest.java | 0 .../v1/InstanceGroupManagersScopedList.java | 0 ...oupManagersSetInstanceTemplateRequest.java | 0 ...nceGroupManagersSetTargetPoolsRequest.java | 0 .../compute/v1/InstanceGroupSettings.java | 0 .../v1/InstanceGroupsAddInstancesRequest.java | 0 .../v1/InstanceGroupsListInstances.java | 0 .../InstanceGroupsListInstancesRequest.java | 0 .../InstanceGroupsRemoveInstancesRequest.java | 0 .../compute/v1/InstanceGroupsScopedList.java | 0 .../InstanceGroupsSetNamedPortsRequest.java | 0 .../google/cloud/compute/v1/InstanceList.java | 0 .../compute/v1/InstanceListReferrers.java | 0 .../cloud/compute/v1/InstanceMoveRequest.java | 0 .../cloud/compute/v1/InstanceProperties.java | 0 .../cloud/compute/v1/InstanceReference.java | 0 .../cloud/compute/v1/InstanceSettings.java | 0 .../cloud/compute/v1/InstanceTemplate.java | 0 .../compute/v1/InstanceTemplateClient.java | 0 .../compute/v1/InstanceTemplateList.java | 0 .../compute/v1/InstanceTemplateSettings.java | 0 .../compute/v1/InstanceWithNamedPorts.java | 0 .../cloud/compute/v1/InstancesScopedList.java | 0 .../compute/v1/InstancesSetLabelsRequest.java | 0 .../InstancesSetMachineResourcesRequest.java | 0 .../v1/InstancesSetMachineTypeRequest.java | 0 .../v1/InstancesSetMinCpuPlatformRequest.java | 0 .../v1/InstancesSetServiceAccountRequest.java | 0 ...nstancesStartWithEncryptionKeyRequest.java | 0 .../google/cloud/compute/v1/Interconnect.java | 0 .../compute/v1/InterconnectAttachment.java | 0 .../InterconnectAttachmentAggregatedList.java | 0 .../v1/InterconnectAttachmentClient.java | 0 .../v1/InterconnectAttachmentList.java | 0 .../v1/InterconnectAttachmentPrivateInfo.java | 0 .../v1/InterconnectAttachmentSettings.java | 0 .../v1/InterconnectAttachmentsScopedList.java | 0 .../compute/v1/InterconnectCircuitInfo.java | 0 .../cloud/compute/v1/InterconnectClient.java | 0 .../cloud/compute/v1/InterconnectList.java | 0 .../compute/v1/InterconnectLocation.java | 0 .../v1/InterconnectLocationClient.java | 0 .../compute/v1/InterconnectLocationList.java | 0 .../v1/InterconnectLocationRegionInfo.java | 0 .../v1/InterconnectLocationSettings.java | 0 .../v1/InterconnectOutageNotification.java | 0 .../compute/v1/InterconnectSettings.java | 0 .../v1/InvalidateCacheUrlMapHttpRequest.java | 0 .../com/google/cloud/compute/v1/Items.java | 0 .../com/google/cloud/compute/v1/License.java | 0 .../cloud/compute/v1/LicenseClient.java | 0 .../google/cloud/compute/v1/LicenseCode.java | 0 .../cloud/compute/v1/LicenseCodeClient.java | 0 .../compute/v1/LicenseCodeLicenseAlias.java | 0 .../cloud/compute/v1/LicenseCodeSettings.java | 0 .../v1/LicenseResourceRequirements.java | 0 .../cloud/compute/v1/LicenseSettings.java | 0 .../compute/v1/LicensesListResponse.java | 0 .../v1/ListAcceleratorTypesHttpRequest.java | 0 .../compute/v1/ListAddressesHttpRequest.java | 0 .../v1/ListAutoscalersHttpRequest.java | 0 ...ailableFeaturesSslPoliciesHttpRequest.java | 0 .../v1/ListBackendBucketsHttpRequest.java | 0 .../v1/ListBackendServicesHttpRequest.java | 0 .../compute/v1/ListDiskTypesHttpRequest.java | 0 .../compute/v1/ListDisksHttpRequest.java | 0 .../compute/v1/ListFirewallsHttpRequest.java | 0 .../v1/ListForwardingRulesHttpRequest.java | 0 .../v1/ListGlobalAddressesHttpRequest.java | 0 .../ListGlobalForwardingRulesHttpRequest.java | 0 .../v1/ListGlobalOperationsHttpRequest.java | 0 .../v1/ListHealthChecksHttpRequest.java | 0 .../v1/ListHttpHealthChecksHttpRequest.java | 0 .../v1/ListHttpsHealthChecksHttpRequest.java | 0 .../compute/v1/ListImagesHttpRequest.java | 0 .../ListInstanceGroupManagersHttpRequest.java | 0 .../v1/ListInstanceGroupsHttpRequest.java | 0 .../v1/ListInstanceTemplatesHttpRequest.java | 0 .../compute/v1/ListInstancesHttpRequest.java | 0 ...istInstancesInstanceGroupsHttpRequest.java | 0 ...tancesRegionInstanceGroupsHttpRequest.java | 0 ...istInterconnectAttachmentsHttpRequest.java | 0 .../ListInterconnectLocationsHttpRequest.java | 0 .../v1/ListInterconnectsHttpRequest.java | 0 .../compute/v1/ListLicensesHttpRequest.java | 0 .../v1/ListMachineTypesHttpRequest.java | 0 ...ancesInstanceGroupManagersHttpRequest.java | 0 ...egionInstanceGroupManagersHttpRequest.java | 0 .../compute/v1/ListNetworksHttpRequest.java | 0 .../v1/ListReferrersInstancesHttpRequest.java | 0 .../v1/ListRegionAutoscalersHttpRequest.java | 0 .../ListRegionBackendServicesHttpRequest.java | 0 .../v1/ListRegionCommitmentsHttpRequest.java | 0 .../v1/ListRegionDiskTypesHttpRequest.java | 0 .../v1/ListRegionDisksHttpRequest.java | 0 ...egionInstanceGroupManagersHttpRequest.java | 0 .../ListRegionInstanceGroupsHttpRequest.java | 0 .../v1/ListRegionOperationsHttpRequest.java | 0 .../compute/v1/ListRegionsHttpRequest.java | 0 .../compute/v1/ListRoutersHttpRequest.java | 0 .../compute/v1/ListRoutesHttpRequest.java | 0 .../compute/v1/ListSnapshotsHttpRequest.java | 0 .../v1/ListSslCertificatesHttpRequest.java | 0 .../v1/ListSslPoliciesHttpRequest.java | 0 .../v1/ListSubnetworksHttpRequest.java | 0 .../v1/ListTargetHttpProxiesHttpRequest.java | 0 .../v1/ListTargetHttpsProxiesHttpRequest.java | 0 .../v1/ListTargetInstancesHttpRequest.java | 0 .../v1/ListTargetPoolsHttpRequest.java | 0 .../v1/ListTargetSslProxiesHttpRequest.java | 0 .../v1/ListTargetTcpProxiesHttpRequest.java | 0 .../v1/ListTargetVpnGatewaysHttpRequest.java | 0 .../compute/v1/ListUrlMapsHttpRequest.java | 0 .../compute/v1/ListVpnTunnelsHttpRequest.java | 0 .../v1/ListXpnHostsProjectsHttpRequest.java | 0 .../v1/ListZoneOperationsHttpRequest.java | 0 .../compute/v1/ListZonesHttpRequest.java | 0 .../google/cloud/compute/v1/MachineType.java | 0 .../compute/v1/MachineTypeAggregatedList.java | 0 .../cloud/compute/v1/MachineTypeClient.java | 0 .../cloud/compute/v1/MachineTypeList.java | 0 .../cloud/compute/v1/MachineTypeSettings.java | 0 .../compute/v1/MachineTypesScopedList.java | 0 .../cloud/compute/v1/ManagedInstance.java | 0 .../v1/ManagedInstanceLastAttempt.java | 0 .../com/google/cloud/compute/v1/Metadata.java | 0 .../v1/MoveDiskProjectHttpRequest.java | 0 .../v1/MoveInstanceProjectHttpRequest.java | 0 .../google/cloud/compute/v1/NamedPort.java | 0 .../com/google/cloud/compute/v1/Network.java | 0 .../cloud/compute/v1/NetworkClient.java | 0 .../cloud/compute/v1/NetworkInterface.java | 0 .../google/cloud/compute/v1/NetworkList.java | 0 .../cloud/compute/v1/NetworkPeering.java | 0 .../compute/v1/NetworkRoutingConfig.java | 0 .../cloud/compute/v1/NetworkSettings.java | 0 .../compute/v1/NetworksAddPeeringRequest.java | 0 .../v1/NetworksRemovePeeringRequest.java | 0 .../google/cloud/compute/v1/Operation.java | 0 .../compute/v1/OperationAggregatedList.java | 0 .../cloud/compute/v1/OperationList.java | 0 .../compute/v1/OperationsScopedList.java | 0 .../v1/PatchAutoscalerHttpRequest.java | 0 .../v1/PatchBackendBucketHttpRequest.java | 0 .../v1/PatchBackendServiceHttpRequest.java | 0 .../compute/v1/PatchFirewallHttpRequest.java | 0 .../v1/PatchHealthCheckHttpRequest.java | 0 .../v1/PatchHttpHealthCheckHttpRequest.java | 0 .../v1/PatchHttpsHealthCheckHttpRequest.java | 0 .../v1/PatchInterconnectHttpRequest.java | 0 .../compute/v1/PatchNetworkHttpRequest.java | 0 .../v1/PatchRegionAutoscalerHttpRequest.java | 0 .../PatchRegionBackendServiceHttpRequest.java | 0 .../compute/v1/PatchRouterHttpRequest.java | 0 .../compute/v1/PatchSslPolicyHttpRequest.java | 0 .../v1/PatchSubnetworkHttpRequest.java | 0 .../compute/v1/PatchUrlMapHttpRequest.java | 0 .../google/cloud/compute/v1/PathMatcher.java | 0 .../com/google/cloud/compute/v1/PathRule.java | 0 .../compute/v1/PreviewRouterHttpRequest.java | 0 .../com/google/cloud/compute/v1/Project.java | 0 .../cloud/compute/v1/ProjectClient.java | 0 .../compute/v1/ProjectGlobalAddressName.java | 0 .../v1/ProjectGlobalBackendBucketName.java | 0 .../v1/ProjectGlobalBackendServiceName.java | 0 .../compute/v1/ProjectGlobalFirewallName.java | 0 .../v1/ProjectGlobalForwardingRuleName.java | 0 .../v1/ProjectGlobalHealthCheckName.java | 0 .../v1/ProjectGlobalHttpHealthCheckName.java | 0 .../v1/ProjectGlobalHttpsHealthCheckName.java | 0 .../v1/ProjectGlobalImageFamilyName.java | 0 .../compute/v1/ProjectGlobalImageName.java | 0 .../v1/ProjectGlobalImageResourceName.java | 0 .../v1/ProjectGlobalInstanceTemplateName.java | 0 ...ProjectGlobalInterconnectLocationName.java | 0 .../v1/ProjectGlobalInterconnectName.java | 0 .../v1/ProjectGlobalLicenseCodeName.java | 0 .../ProjectGlobalLicenseCodeResourceName.java | 0 .../compute/v1/ProjectGlobalLicenseName.java | 0 .../v1/ProjectGlobalLicenseResourceName.java | 0 .../compute/v1/ProjectGlobalNetworkName.java | 0 .../v1/ProjectGlobalOperationName.java | 0 .../compute/v1/ProjectGlobalRouteName.java | 0 .../compute/v1/ProjectGlobalSnapshotName.java | 0 .../v1/ProjectGlobalSnapshotResourceName.java | 0 .../v1/ProjectGlobalSslCertificateName.java | 0 .../v1/ProjectGlobalSslPolicyName.java | 0 .../v1/ProjectGlobalTargetHttpProxyName.java | 0 .../v1/ProjectGlobalTargetHttpsProxyName.java | 0 .../v1/ProjectGlobalTargetSslProxyName.java | 0 .../v1/ProjectGlobalTargetTcpProxyName.java | 0 .../compute/v1/ProjectGlobalUrlMapName.java | 0 .../google/cloud/compute/v1/ProjectName.java | 0 .../compute/v1/ProjectRegionAddressName.java | 0 .../v1/ProjectRegionAutoscalerName.java | 0 .../v1/ProjectRegionBackendServiceName.java | 0 .../v1/ProjectRegionCommitmentName.java | 0 .../compute/v1/ProjectRegionDiskName.java | 0 .../v1/ProjectRegionDiskResourceName.java | 0 .../compute/v1/ProjectRegionDiskTypeName.java | 0 .../v1/ProjectRegionForwardingRuleName.java | 0 ...ProjectRegionInstanceGroupManagerName.java | 0 .../v1/ProjectRegionInstanceGroupName.java | 0 ...ojectRegionInterconnectAttachmentName.java | 0 .../cloud/compute/v1/ProjectRegionName.java | 0 .../v1/ProjectRegionOperationName.java | 0 .../compute/v1/ProjectRegionRouterName.java | 0 .../v1/ProjectRegionSubnetworkName.java | 0 .../v1/ProjectRegionTargetPoolName.java | 0 .../v1/ProjectRegionTargetVpnGatewayName.java | 0 .../v1/ProjectRegionVpnTunnelName.java | 0 .../cloud/compute/v1/ProjectSettings.java | 0 .../v1/ProjectTargetHttpProxyName.java | 0 .../v1/ProjectTargetHttpsProxyName.java | 0 .../v1/ProjectZoneAcceleratorTypeName.java | 0 .../compute/v1/ProjectZoneAutoscalerName.java | 0 .../cloud/compute/v1/ProjectZoneDiskName.java | 0 .../v1/ProjectZoneDiskResourceName.java | 0 .../compute/v1/ProjectZoneDiskTypeName.java | 0 .../ProjectZoneInstanceGroupManagerName.java | 0 .../v1/ProjectZoneInstanceGroupName.java | 0 .../compute/v1/ProjectZoneInstanceName.java | 0 .../v1/ProjectZoneInstanceResourceName.java | 0 .../v1/ProjectZoneMachineTypeName.java | 0 .../cloud/compute/v1/ProjectZoneName.java | 0 .../compute/v1/ProjectZoneOperationName.java | 0 .../v1/ProjectZoneTargetInstanceName.java | 0 .../v1/ProjectsDisableXpnResourceRequest.java | 0 .../v1/ProjectsEnableXpnResourceRequest.java | 0 .../compute/v1/ProjectsGetXpnResources.java | 0 .../v1/ProjectsListXpnHostsRequest.java | 0 .../com/google/cloud/compute/v1/Quota.java | 0 .../com/google/cloud/compute/v1/RawDisk.java | 0 ...tancesInstanceGroupManagerHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../google/cloud/compute/v1/Reference.java | 0 .../com/google/cloud/compute/v1/Region.java | 0 .../compute/v1/RegionAutoscalerClient.java | 0 .../compute/v1/RegionAutoscalerList.java | 0 .../compute/v1/RegionAutoscalerSettings.java | 0 .../v1/RegionBackendServiceClient.java | 0 .../v1/RegionBackendServiceSettings.java | 0 .../google/cloud/compute/v1/RegionClient.java | 0 .../compute/v1/RegionCommitmentClient.java | 0 .../compute/v1/RegionCommitmentSettings.java | 0 .../cloud/compute/v1/RegionDiskClient.java | 0 .../cloud/compute/v1/RegionDiskSettings.java | 0 .../compute/v1/RegionDiskTypeClient.java | 0 .../cloud/compute/v1/RegionDiskTypeList.java | 0 .../compute/v1/RegionDiskTypeSettings.java | 0 .../compute/v1/RegionDisksResizeRequest.java | 0 .../compute/v1/RegionInstanceGroupClient.java | 0 .../compute/v1/RegionInstanceGroupList.java | 0 .../v1/RegionInstanceGroupManagerClient.java | 0 .../v1/RegionInstanceGroupManagerList.java | 0 .../RegionInstanceGroupManagerSettings.java | 0 ...eGroupManagersAbandonInstancesRequest.java | 0 ...ceGroupManagersDeleteInstancesRequest.java | 0 ...nceGroupManagersListInstancesResponse.java | 0 ...nInstanceGroupManagersRecreateRequest.java | 0 ...nceGroupManagersSetTargetPoolsRequest.java | 0 ...stanceGroupManagersSetTemplateRequest.java | 0 .../v1/RegionInstanceGroupSettings.java | 0 .../v1/RegionInstanceGroupsListInstances.java | 0 ...ionInstanceGroupsListInstancesRequest.java | 0 ...ionInstanceGroupsSetNamedPortsRequest.java | 0 .../google/cloud/compute/v1/RegionList.java | 0 .../compute/v1/RegionOperationClient.java | 0 .../compute/v1/RegionOperationSettings.java | 0 .../compute/v1/RegionSetLabelsRequest.java | 0 .../cloud/compute/v1/RegionSettings.java | 0 ...emoveHealthCheckTargetPoolHttpRequest.java | 0 .../RemoveInstanceTargetPoolHttpRequest.java | 0 ...moveInstancesInstanceGroupHttpRequest.java | 0 .../v1/RemovePeeringNetworkHttpRequest.java | 0 .../compute/v1/ResetInstanceHttpRequest.java | 0 .../compute/v1/ResizeDiskHttpRequest.java | 0 ...ResizeInstanceGroupManagerHttpRequest.java | 0 .../v1/ResizeRegionDiskHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../cloud/compute/v1/ResourceCommitment.java | 0 .../compute/v1/ResourceGroupReference.java | 0 .../com/google/cloud/compute/v1/Route.java | 0 .../google/cloud/compute/v1/RouteClient.java | 0 .../google/cloud/compute/v1/RouteList.java | 0 .../cloud/compute/v1/RouteSettings.java | 0 .../com/google/cloud/compute/v1/Router.java | 0 .../compute/v1/RouterAdvertisedIpRange.java | 0 .../compute/v1/RouterAggregatedList.java | 0 .../google/cloud/compute/v1/RouterBgp.java | 0 .../cloud/compute/v1/RouterBgpPeer.java | 0 .../google/cloud/compute/v1/RouterClient.java | 0 .../cloud/compute/v1/RouterInterface.java | 0 .../google/cloud/compute/v1/RouterList.java | 0 .../cloud/compute/v1/RouterSettings.java | 0 .../google/cloud/compute/v1/RouterStatus.java | 0 .../compute/v1/RouterStatusBgpPeerStatus.java | 0 .../compute/v1/RouterStatusResponse.java | 0 .../compute/v1/RoutersPreviewResponse.java | 0 .../cloud/compute/v1/RoutersScopedList.java | 0 .../cloud/compute/v1/SSLHealthCheck.java | 0 .../google/cloud/compute/v1/Scheduling.java | 0 .../google/cloud/compute/v1/ScratchDisks.java | 0 .../cloud/compute/v1/SerialPortOutput.java | 0 .../cloud/compute/v1/ServiceAccount.java | 0 ...ckendServiceTargetSslProxyHttpRequest.java | 0 ...ckendServiceTargetTcpProxyHttpRequest.java | 0 .../v1/SetBackupTargetPoolHttpRequest.java | 0 ...monInstanceMetadataProjectHttpRequest.java | 0 ...DeletionProtectionInstanceHttpRequest.java | 0 .../SetDiskAutoDeleteInstanceHttpRequest.java | 0 ...mplateInstanceGroupManagerHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../compute/v1/SetLabelsDiskHttpRequest.java | 0 .../compute/v1/SetLabelsImageHttpRequest.java | 0 .../v1/SetLabelsInstanceHttpRequest.java | 0 .../v1/SetLabelsRegionDiskHttpRequest.java | 0 .../v1/SetLabelsSnapshotHttpRequest.java | 0 ...etMachineResourcesInstanceHttpRequest.java | 0 .../v1/SetMachineTypeInstanceHttpRequest.java | 0 .../v1/SetMetadataInstanceHttpRequest.java | 0 .../SetMinCpuPlatformInstanceHttpRequest.java | 0 ...SetNamedPortsInstanceGroupHttpRequest.java | 0 ...edPortsRegionInstanceGroupHttpRequest.java | 0 ...teIpGoogleAccessSubnetworkHttpRequest.java | 0 ...tProxyHeaderTargetSslProxyHttpRequest.java | 0 ...tProxyHeaderTargetTcpProxyHttpRequest.java | 0 .../v1/SetSchedulingInstanceHttpRequest.java | 0 .../SetServiceAccountInstanceHttpRequest.java | 0 ...rtificatesTargetHttpsProxyHttpRequest.java | 0 ...CertificatesTargetSslProxyHttpRequest.java | 0 ...tSslPolicyTargetHttpsProxyHttpRequest.java | 0 ...SetSslPolicyTargetSslProxyHttpRequest.java | 0 .../v1/SetTagsInstanceHttpRequest.java | 0 .../SetTargetForwardingRuleHttpRequest.java | 0 ...TargetGlobalForwardingRuleHttpRequest.java | 0 ...tPoolsInstanceGroupManagerHttpRequest.java | 0 ...RegionInstanceGroupManagerHttpRequest.java | 0 .../SetUrlMapTargetHttpProxyHttpRequest.java | 0 .../SetUrlMapTargetHttpsProxyHttpRequest.java | 0 ...etUsageExportBucketProjectHttpRequest.java | 0 .../com/google/cloud/compute/v1/Snapshot.java | 0 .../cloud/compute/v1/SnapshotClient.java | 0 .../google/cloud/compute/v1/SnapshotList.java | 0 .../cloud/compute/v1/SnapshotSettings.java | 0 .../cloud/compute/v1/SslCertificate.java | 0 .../compute/v1/SslCertificateClient.java | 0 .../cloud/compute/v1/SslCertificateList.java | 0 .../compute/v1/SslCertificateSettings.java | 0 .../cloud/compute/v1/SslPoliciesList.java | 0 ...PoliciesListAvailableFeaturesResponse.java | 0 .../google/cloud/compute/v1/SslPolicy.java | 0 .../cloud/compute/v1/SslPolicyClient.java | 0 .../cloud/compute/v1/SslPolicyReference.java | 0 .../cloud/compute/v1/SslPolicySettings.java | 0 .../compute/v1/StartInstanceHttpRequest.java | 0 ...tWithEncryptionKeyInstanceHttpRequest.java | 0 .../compute/v1/StopInstanceHttpRequest.java | 0 .../google/cloud/compute/v1/Subnetwork.java | 0 .../compute/v1/SubnetworkAggregatedList.java | 0 .../cloud/compute/v1/SubnetworkClient.java | 0 .../cloud/compute/v1/SubnetworkList.java | 0 .../compute/v1/SubnetworkSecondaryRange.java | 0 .../cloud/compute/v1/SubnetworkSettings.java | 0 .../SubnetworksExpandIpCidrRangeRequest.java | 0 .../compute/v1/SubnetworksScopedList.java | 0 ...tworksSetPrivateIpGoogleAccessRequest.java | 0 .../SwitchToCustomModeNetworkHttpRequest.java | 0 .../cloud/compute/v1/TCPHealthCheck.java | 0 .../com/google/cloud/compute/v1/Tags.java | 0 .../cloud/compute/v1/TargetHttpProxy.java | 0 .../compute/v1/TargetHttpProxyClient.java | 0 .../cloud/compute/v1/TargetHttpProxyList.java | 0 .../compute/v1/TargetHttpProxySettings.java | 0 ...HttpsProxiesSetSslCertificatesRequest.java | 0 .../cloud/compute/v1/TargetHttpsProxy.java | 0 .../compute/v1/TargetHttpsProxyClient.java | 0 .../compute/v1/TargetHttpsProxyList.java | 0 .../compute/v1/TargetHttpsProxySettings.java | 0 .../cloud/compute/v1/TargetInstance.java | 0 .../v1/TargetInstanceAggregatedList.java | 0 .../compute/v1/TargetInstanceClient.java | 0 .../cloud/compute/v1/TargetInstanceList.java | 0 .../compute/v1/TargetInstanceSettings.java | 0 .../compute/v1/TargetInstancesScopedList.java | 0 .../google/cloud/compute/v1/TargetPool.java | 0 .../compute/v1/TargetPoolAggregatedList.java | 0 .../cloud/compute/v1/TargetPoolClient.java | 0 .../compute/v1/TargetPoolInstanceHealth.java | 0 .../cloud/compute/v1/TargetPoolList.java | 0 .../cloud/compute/v1/TargetPoolSettings.java | 0 .../v1/TargetPoolsAddHealthCheckRequest.java | 0 .../v1/TargetPoolsAddInstanceRequest.java | 0 .../TargetPoolsRemoveHealthCheckRequest.java | 0 .../v1/TargetPoolsRemoveInstanceRequest.java | 0 .../compute/v1/TargetPoolsScopedList.java | 0 .../cloud/compute/v1/TargetReference.java | 0 ...getSslProxiesSetBackendServiceRequest.java | 0 ...TargetSslProxiesSetProxyHeaderRequest.java | 0 ...etSslProxiesSetSslCertificatesRequest.java | 0 .../cloud/compute/v1/TargetSslProxy.java | 0 .../compute/v1/TargetSslProxyClient.java | 0 .../cloud/compute/v1/TargetSslProxyList.java | 0 .../compute/v1/TargetSslProxySettings.java | 0 ...getTcpProxiesSetBackendServiceRequest.java | 0 ...TargetTcpProxiesSetProxyHeaderRequest.java | 0 .../cloud/compute/v1/TargetTcpProxy.java | 0 .../compute/v1/TargetTcpProxyClient.java | 0 .../cloud/compute/v1/TargetTcpProxyList.java | 0 .../compute/v1/TargetTcpProxySettings.java | 0 .../cloud/compute/v1/TargetVpnGateway.java | 0 .../v1/TargetVpnGatewayAggregatedList.java | 0 .../compute/v1/TargetVpnGatewayClient.java | 0 .../compute/v1/TargetVpnGatewayList.java | 0 .../compute/v1/TargetVpnGatewaySettings.java | 0 .../v1/TargetVpnGatewaysScopedList.java | 0 .../google/cloud/compute/v1/TestFailure.java | 0 ...tIamPermissionsLicenseCodeHttpRequest.java | 0 .../TestIamPermissionsLicenseHttpRequest.java | 0 ...stIamPermissionsRegionDiskHttpRequest.java | 0 .../compute/v1/TestPermissionsRequest.java | 0 .../compute/v1/TestPermissionsResponse.java | 0 ...UpdateAccessConfigInstanceHttpRequest.java | 0 .../v1/UpdateAutoscalerHttpRequest.java | 0 .../v1/UpdateBackendBucketHttpRequest.java | 0 .../v1/UpdateBackendServiceHttpRequest.java | 0 .../compute/v1/UpdateFirewallHttpRequest.java | 0 .../v1/UpdateHealthCheckHttpRequest.java | 0 .../v1/UpdateHttpHealthCheckHttpRequest.java | 0 .../v1/UpdateHttpsHealthCheckHttpRequest.java | 0 ...teNetworkInterfaceInstanceHttpRequest.java | 0 .../v1/UpdateRegionAutoscalerHttpRequest.java | 0 ...UpdateRegionBackendServiceHttpRequest.java | 0 .../compute/v1/UpdateRouterHttpRequest.java | 0 .../compute/v1/UpdateUrlMapHttpRequest.java | 0 .../com/google/cloud/compute/v1/UrlMap.java | 0 .../google/cloud/compute/v1/UrlMapClient.java | 0 .../google/cloud/compute/v1/UrlMapList.java | 0 .../cloud/compute/v1/UrlMapReference.java | 0 .../cloud/compute/v1/UrlMapSettings.java | 0 .../google/cloud/compute/v1/UrlMapTest.java | 0 .../compute/v1/UrlMapValidationResult.java | 0 .../compute/v1/UrlMapsValidateRequest.java | 0 .../compute/v1/UrlMapsValidateResponse.java | 0 .../cloud/compute/v1/UsageExportLocation.java | 0 .../compute/v1/ValidateUrlMapHttpRequest.java | 0 .../google/cloud/compute/v1/VpnTunnel.java | 0 .../compute/v1/VpnTunnelAggregatedList.java | 0 .../cloud/compute/v1/VpnTunnelClient.java | 0 .../cloud/compute/v1/VpnTunnelList.java | 0 .../cloud/compute/v1/VpnTunnelSettings.java | 0 .../compute/v1/VpnTunnelsScopedList.java | 0 .../com/google/cloud/compute/v1/Warning.java | 0 .../com/google/cloud/compute/v1/Warnings.java | 0 .../google/cloud/compute/v1/XpnHostList.java | 0 .../cloud/compute/v1/XpnResourceId.java | 0 .../com/google/cloud/compute/v1/Zone.java | 0 .../google/cloud/compute/v1/ZoneClient.java | 0 .../com/google/cloud/compute/v1/ZoneList.java | 0 .../cloud/compute/v1/ZoneOperationClient.java | 0 .../compute/v1/ZoneOperationSettings.java | 0 .../compute/v1/ZoneSetLabelsRequest.java | 0 .../google/cloud/compute/v1/ZoneSettings.java | 0 .../google/cloud/compute/v1/package-info.java | 0 .../compute/v1/stub/AcceleratorTypeStub.java | 0 .../v1/stub/AcceleratorTypeStubSettings.java | 0 .../cloud/compute/v1/stub/AddressStub.java | 0 .../compute/v1/stub/AddressStubSettings.java | 0 .../cloud/compute/v1/stub/AutoscalerStub.java | 0 .../v1/stub/AutoscalerStubSettings.java | 0 .../compute/v1/stub/BackendBucketStub.java | 0 .../v1/stub/BackendBucketStubSettings.java | 0 .../compute/v1/stub/BackendServiceStub.java | 0 .../v1/stub/BackendServiceStubSettings.java | 0 .../cloud/compute/v1/stub/DiskStub.java | 0 .../compute/v1/stub/DiskStubSettings.java | 0 .../cloud/compute/v1/stub/DiskTypeStub.java | 0 .../compute/v1/stub/DiskTypeStubSettings.java | 0 .../cloud/compute/v1/stub/FirewallStub.java | 0 .../compute/v1/stub/FirewallStubSettings.java | 0 .../compute/v1/stub/ForwardingRuleStub.java | 0 .../v1/stub/ForwardingRuleStubSettings.java | 0 .../compute/v1/stub/GlobalAddressStub.java | 0 .../v1/stub/GlobalAddressStubSettings.java | 0 .../v1/stub/GlobalForwardingRuleStub.java | 0 .../GlobalForwardingRuleStubSettings.java | 0 .../compute/v1/stub/GlobalOperationStub.java | 0 .../v1/stub/GlobalOperationStubSettings.java | 0 .../compute/v1/stub/HealthCheckStub.java | 0 .../v1/stub/HealthCheckStubSettings.java | 0 .../compute/v1/stub/HttpHealthCheckStub.java | 0 .../v1/stub/HttpHealthCheckStubSettings.java | 0 ...ttpJsonAcceleratorTypeCallableFactory.java | 0 .../v1/stub/HttpJsonAcceleratorTypeStub.java | 0 .../stub/HttpJsonAddressCallableFactory.java | 0 .../compute/v1/stub/HttpJsonAddressStub.java | 0 .../HttpJsonAutoscalerCallableFactory.java | 0 .../v1/stub/HttpJsonAutoscalerStub.java | 0 .../HttpJsonBackendBucketCallableFactory.java | 0 .../v1/stub/HttpJsonBackendBucketStub.java | 0 ...HttpJsonBackendServiceCallableFactory.java | 0 .../v1/stub/HttpJsonBackendServiceStub.java | 0 .../v1/stub/HttpJsonDiskCallableFactory.java | 0 .../compute/v1/stub/HttpJsonDiskStub.java | 0 .../stub/HttpJsonDiskTypeCallableFactory.java | 0 .../compute/v1/stub/HttpJsonDiskTypeStub.java | 0 .../stub/HttpJsonFirewallCallableFactory.java | 0 .../compute/v1/stub/HttpJsonFirewallStub.java | 0 ...HttpJsonForwardingRuleCallableFactory.java | 0 .../v1/stub/HttpJsonForwardingRuleStub.java | 0 .../HttpJsonGlobalAddressCallableFactory.java | 0 .../v1/stub/HttpJsonGlobalAddressStub.java | 0 ...onGlobalForwardingRuleCallableFactory.java | 0 .../HttpJsonGlobalForwardingRuleStub.java | 0 ...ttpJsonGlobalOperationCallableFactory.java | 0 .../v1/stub/HttpJsonGlobalOperationStub.java | 0 .../HttpJsonHealthCheckCallableFactory.java | 0 .../v1/stub/HttpJsonHealthCheckStub.java | 0 ...ttpJsonHttpHealthCheckCallableFactory.java | 0 .../v1/stub/HttpJsonHttpHealthCheckStub.java | 0 ...tpJsonHttpsHealthCheckCallableFactory.java | 0 .../v1/stub/HttpJsonHttpsHealthCheckStub.java | 0 .../v1/stub/HttpJsonImageCallableFactory.java | 0 .../compute/v1/stub/HttpJsonImageStub.java | 0 .../stub/HttpJsonInstanceCallableFactory.java | 0 .../HttpJsonInstanceGroupCallableFactory.java | 0 ...onInstanceGroupManagerCallableFactory.java | 0 .../HttpJsonInstanceGroupManagerStub.java | 0 .../v1/stub/HttpJsonInstanceGroupStub.java | 0 .../compute/v1/stub/HttpJsonInstanceStub.java | 0 ...tpJsonInstanceTemplateCallableFactory.java | 0 .../v1/stub/HttpJsonInstanceTemplateStub.java | 0 ...InterconnectAttachmentCallableFactory.java | 0 .../HttpJsonInterconnectAttachmentStub.java | 0 .../HttpJsonInterconnectCallableFactory.java | 0 ...onInterconnectLocationCallableFactory.java | 0 .../HttpJsonInterconnectLocationStub.java | 0 .../v1/stub/HttpJsonInterconnectStub.java | 0 .../stub/HttpJsonLicenseCallableFactory.java | 0 .../HttpJsonLicenseCodeCallableFactory.java | 0 .../v1/stub/HttpJsonLicenseCodeStub.java | 0 .../compute/v1/stub/HttpJsonLicenseStub.java | 0 .../HttpJsonMachineTypeCallableFactory.java | 0 .../v1/stub/HttpJsonMachineTypeStub.java | 0 .../stub/HttpJsonNetworkCallableFactory.java | 0 .../compute/v1/stub/HttpJsonNetworkStub.java | 0 .../stub/HttpJsonProjectCallableFactory.java | 0 .../compute/v1/stub/HttpJsonProjectStub.java | 0 ...tpJsonRegionAutoscalerCallableFactory.java | 0 .../v1/stub/HttpJsonRegionAutoscalerStub.java | 0 ...onRegionBackendServiceCallableFactory.java | 0 .../HttpJsonRegionBackendServiceStub.java | 0 .../stub/HttpJsonRegionCallableFactory.java | 0 ...tpJsonRegionCommitmentCallableFactory.java | 0 .../v1/stub/HttpJsonRegionCommitmentStub.java | 0 .../HttpJsonRegionDiskCallableFactory.java | 0 .../v1/stub/HttpJsonRegionDiskStub.java | 0 ...HttpJsonRegionDiskTypeCallableFactory.java | 0 .../v1/stub/HttpJsonRegionDiskTypeStub.java | 0 ...sonRegionInstanceGroupCallableFactory.java | 0 ...onInstanceGroupManagerCallableFactory.java | 0 ...ttpJsonRegionInstanceGroupManagerStub.java | 0 .../stub/HttpJsonRegionInstanceGroupStub.java | 0 ...ttpJsonRegionOperationCallableFactory.java | 0 .../v1/stub/HttpJsonRegionOperationStub.java | 0 .../compute/v1/stub/HttpJsonRegionStub.java | 0 .../v1/stub/HttpJsonRouteCallableFactory.java | 0 .../compute/v1/stub/HttpJsonRouteStub.java | 0 .../stub/HttpJsonRouterCallableFactory.java | 0 .../compute/v1/stub/HttpJsonRouterStub.java | 0 .../stub/HttpJsonSnapshotCallableFactory.java | 0 .../compute/v1/stub/HttpJsonSnapshotStub.java | 0 ...HttpJsonSslCertificateCallableFactory.java | 0 .../v1/stub/HttpJsonSslCertificateStub.java | 0 .../HttpJsonSslPolicyCallableFactory.java | 0 .../v1/stub/HttpJsonSslPolicyStub.java | 0 .../HttpJsonSubnetworkCallableFactory.java | 0 .../v1/stub/HttpJsonSubnetworkStub.java | 0 ...ttpJsonTargetHttpProxyCallableFactory.java | 0 .../v1/stub/HttpJsonTargetHttpProxyStub.java | 0 ...tpJsonTargetHttpsProxyCallableFactory.java | 0 .../v1/stub/HttpJsonTargetHttpsProxyStub.java | 0 ...HttpJsonTargetInstanceCallableFactory.java | 0 .../v1/stub/HttpJsonTargetInstanceStub.java | 0 .../HttpJsonTargetPoolCallableFactory.java | 0 .../v1/stub/HttpJsonTargetPoolStub.java | 0 ...HttpJsonTargetSslProxyCallableFactory.java | 0 .../v1/stub/HttpJsonTargetSslProxyStub.java | 0 ...HttpJsonTargetTcpProxyCallableFactory.java | 0 .../v1/stub/HttpJsonTargetTcpProxyStub.java | 0 ...tpJsonTargetVpnGatewayCallableFactory.java | 0 .../v1/stub/HttpJsonTargetVpnGatewayStub.java | 0 .../stub/HttpJsonUrlMapCallableFactory.java | 0 .../compute/v1/stub/HttpJsonUrlMapStub.java | 0 .../HttpJsonVpnTunnelCallableFactory.java | 0 .../v1/stub/HttpJsonVpnTunnelStub.java | 0 .../v1/stub/HttpJsonZoneCallableFactory.java | 0 .../HttpJsonZoneOperationCallableFactory.java | 0 .../v1/stub/HttpJsonZoneOperationStub.java | 0 .../compute/v1/stub/HttpJsonZoneStub.java | 0 .../compute/v1/stub/HttpsHealthCheckStub.java | 0 .../v1/stub/HttpsHealthCheckStubSettings.java | 0 .../cloud/compute/v1/stub/ImageStub.java | 0 .../compute/v1/stub/ImageStubSettings.java | 0 .../v1/stub/InstanceGroupManagerStub.java | 0 .../InstanceGroupManagerStubSettings.java | 0 .../compute/v1/stub/InstanceGroupStub.java | 0 .../v1/stub/InstanceGroupStubSettings.java | 0 .../cloud/compute/v1/stub/InstanceStub.java | 0 .../compute/v1/stub/InstanceStubSettings.java | 0 .../compute/v1/stub/InstanceTemplateStub.java | 0 .../v1/stub/InstanceTemplateStubSettings.java | 0 .../v1/stub/InterconnectAttachmentStub.java | 0 .../InterconnectAttachmentStubSettings.java | 0 .../v1/stub/InterconnectLocationStub.java | 0 .../InterconnectLocationStubSettings.java | 0 .../compute/v1/stub/InterconnectStub.java | 0 .../v1/stub/InterconnectStubSettings.java | 0 .../compute/v1/stub/LicenseCodeStub.java | 0 .../v1/stub/LicenseCodeStubSettings.java | 0 .../cloud/compute/v1/stub/LicenseStub.java | 0 .../compute/v1/stub/LicenseStubSettings.java | 0 .../compute/v1/stub/MachineTypeStub.java | 0 .../v1/stub/MachineTypeStubSettings.java | 0 .../cloud/compute/v1/stub/NetworkStub.java | 0 .../compute/v1/stub/NetworkStubSettings.java | 0 .../cloud/compute/v1/stub/ProjectStub.java | 0 .../compute/v1/stub/ProjectStubSettings.java | 0 .../compute/v1/stub/RegionAutoscalerStub.java | 0 .../v1/stub/RegionAutoscalerStubSettings.java | 0 .../v1/stub/RegionBackendServiceStub.java | 0 .../RegionBackendServiceStubSettings.java | 0 .../compute/v1/stub/RegionCommitmentStub.java | 0 .../v1/stub/RegionCommitmentStubSettings.java | 0 .../cloud/compute/v1/stub/RegionDiskStub.java | 0 .../v1/stub/RegionDiskStubSettings.java | 0 .../compute/v1/stub/RegionDiskTypeStub.java | 0 .../v1/stub/RegionDiskTypeStubSettings.java | 0 .../stub/RegionInstanceGroupManagerStub.java | 0 ...egionInstanceGroupManagerStubSettings.java | 0 .../v1/stub/RegionInstanceGroupStub.java | 0 .../stub/RegionInstanceGroupStubSettings.java | 0 .../compute/v1/stub/RegionOperationStub.java | 0 .../v1/stub/RegionOperationStubSettings.java | 0 .../cloud/compute/v1/stub/RegionStub.java | 0 .../compute/v1/stub/RegionStubSettings.java | 0 .../cloud/compute/v1/stub/RouteStub.java | 0 .../compute/v1/stub/RouteStubSettings.java | 0 .../cloud/compute/v1/stub/RouterStub.java | 0 .../compute/v1/stub/RouterStubSettings.java | 0 .../cloud/compute/v1/stub/SnapshotStub.java | 0 .../compute/v1/stub/SnapshotStubSettings.java | 0 .../compute/v1/stub/SslCertificateStub.java | 0 .../v1/stub/SslCertificateStubSettings.java | 0 .../cloud/compute/v1/stub/SslPolicyStub.java | 0 .../v1/stub/SslPolicyStubSettings.java | 0 .../cloud/compute/v1/stub/SubnetworkStub.java | 0 .../v1/stub/SubnetworkStubSettings.java | 0 .../compute/v1/stub/TargetHttpProxyStub.java | 0 .../v1/stub/TargetHttpProxyStubSettings.java | 0 .../compute/v1/stub/TargetHttpsProxyStub.java | 0 .../v1/stub/TargetHttpsProxyStubSettings.java | 0 .../compute/v1/stub/TargetInstanceStub.java | 0 .../v1/stub/TargetInstanceStubSettings.java | 0 .../cloud/compute/v1/stub/TargetPoolStub.java | 0 .../v1/stub/TargetPoolStubSettings.java | 0 .../compute/v1/stub/TargetSslProxyStub.java | 0 .../v1/stub/TargetSslProxyStubSettings.java | 0 .../compute/v1/stub/TargetTcpProxyStub.java | 0 .../v1/stub/TargetTcpProxyStubSettings.java | 0 .../compute/v1/stub/TargetVpnGatewayStub.java | 0 .../v1/stub/TargetVpnGatewayStubSettings.java | 0 .../cloud/compute/v1/stub/UrlMapStub.java | 0 .../compute/v1/stub/UrlMapStubSettings.java | 0 .../cloud/compute/v1/stub/VpnTunnelStub.java | 0 .../v1/stub/VpnTunnelStubSettings.java | 0 .../compute/v1/stub/ZoneOperationStub.java | 0 .../v1/stub/ZoneOperationStubSettings.java | 0 .../cloud/compute/v1/stub/ZoneStub.java | 0 .../compute/v1/stub/ZoneStubSettings.java | 0 .../compute/deprecated/AddressIdTest.java | 119 - .../compute/deprecated/AddressInfoTest.java | 200 - .../cloud/compute/deprecated/AddressTest.java | 294 -- .../compute/deprecated/AttachedDiskTest.java | 393 -- .../deprecated/ComputeExceptionTest.java | 99 - .../compute/deprecated/ComputeImplTest.java | 4118 ----------------- .../deprecated/ComputeOptionsTest.java | 36 - .../deprecated/DeprecationStatusTest.java | 183 - .../cloud/compute/deprecated/DiskIdTest.java | 87 - .../DiskImageConfigurationTest.java | 110 - .../compute/deprecated/DiskInfoTest.java | 267 -- .../cloud/compute/deprecated/DiskTest.java | 475 -- .../compute/deprecated/DiskTypeIdTest.java | 84 - .../compute/deprecated/DiskTypeTest.java | 72 - .../deprecated/ForwardingRuleIdTest.java | 139 - .../ImageDiskConfigurationTest.java | 112 - .../cloud/compute/deprecated/ImageIdTest.java | 79 - .../compute/deprecated/ImageInfoTest.java | 179 - .../cloud/compute/deprecated/ImageTest.java | 307 -- .../compute/deprecated/InstanceIdTest.java | 88 - .../compute/deprecated/InstanceInfoTest.java | 184 - .../compute/deprecated/InstanceTest.java | 917 ---- .../compute/deprecated/LicenseIdTest.java | 79 - .../cloud/compute/deprecated/LicenseTest.java | 49 - .../compute/deprecated/MachineTypeIdTest.java | 83 - .../compute/deprecated/MachineTypeTest.java | 89 - .../compute/deprecated/MetadataTest.java | 81 - .../compute/deprecated/NetworkIdTest.java | 79 - .../compute/deprecated/NetworkInfoTest.java | 126 - .../deprecated/NetworkInterfaceTest.java | 182 - .../cloud/compute/deprecated/NetworkTest.java | 259 -- .../compute/deprecated/OperationIdTest.java | 169 - .../compute/deprecated/OperationTest.java | 518 --- .../compute/deprecated/RegionIdTest.java | 79 - .../cloud/compute/deprecated/RegionTest.java | 89 - .../deprecated/SchedulingOptionsTest.java | 57 - .../compute/deprecated/SerializationTest.java | 304 -- .../deprecated/ServiceAccountTest.java | 47 - .../SnapshotDiskConfigurationTest.java | 112 - .../compute/deprecated/SnapshotIdTest.java | 79 - .../compute/deprecated/SnapshotInfoTest.java | 136 - .../compute/deprecated/SnapshotTest.java | 218 - .../StandardDiskConfigurationTest.java | 103 - .../StandardNetworkConfigurationTest.java | 76 - .../StorageImageConfigurationTest.java | 106 - .../SubnetNetworkConfigurationTest.java | 82 - .../compute/deprecated/SubnetworkIdTest.java | 87 - .../deprecated/SubnetworkInfoTest.java | 108 - .../compute/deprecated/SubnetworkTest.java | 210 - .../cloud/compute/deprecated/TagsTest.java | 69 - .../cloud/compute/deprecated/ZoneIdTest.java | 79 - .../cloud/compute/deprecated/ZoneTest.java | 77 - .../compute/deprecated/it/ITComputeTest.java | 1843 -------- .../testing/RemoteComputeHelperTest.java | 102 - .../compute/v1/AcceleratorTypeClientTest.java | 0 .../cloud/compute/v1/AddressClientTest.java | 0 .../compute/v1/AutoscalerClientTest.java | 0 .../compute/v1/BackendBucketClientTest.java | 0 .../compute/v1/BackendServiceClientTest.java | 0 .../cloud/compute/v1/DiskClientTest.java | 0 .../cloud/compute/v1/DiskTypeClientTest.java | 0 .../cloud/compute/v1/FirewallClientTest.java | 0 .../compute/v1/ForwardingRuleClientTest.java | 0 .../compute/v1/GlobalAddressClientTest.java | 0 .../v1/GlobalForwardingRuleClientTest.java | 0 .../compute/v1/GlobalOperationClientTest.java | 0 .../compute/v1/HealthCheckClientTest.java | 0 .../compute/v1/HttpHealthCheckClientTest.java | 0 .../v1/HttpsHealthCheckClientTest.java | 0 .../cloud/compute/v1/ImageClientTest.java | 0 .../cloud/compute/v1/InstanceClientTest.java | 0 .../compute/v1/InstanceGroupClientTest.java | 0 .../v1/InstanceGroupManagerClientTest.java | 0 .../v1/InstanceTemplateClientTest.java | 0 .../v1/InterconnectAttachmentClientTest.java | 0 .../compute/v1/InterconnectClientTest.java | 0 .../v1/InterconnectLocationClientTest.java | 0 .../cloud/compute/v1/LicenseClientTest.java | 0 .../compute/v1/LicenseCodeClientTest.java | 0 .../compute/v1/MachineTypeClientTest.java | 0 .../cloud/compute/v1/NetworkClientTest.java | 0 .../cloud/compute/v1/ProjectClientTest.java | 0 .../v1/RegionAutoscalerClientTest.java | 0 .../v1/RegionBackendServiceClientTest.java | 0 .../cloud/compute/v1/RegionClientTest.java | 0 .../v1/RegionCommitmentClientTest.java | 0 .../compute/v1/RegionDiskClientTest.java | 0 .../compute/v1/RegionDiskTypeClientTest.java | 0 .../v1/RegionInstanceGroupClientTest.java | 0 .../RegionInstanceGroupManagerClientTest.java | 0 .../compute/v1/RegionOperationClientTest.java | 0 .../cloud/compute/v1/RouteClientTest.java | 0 .../cloud/compute/v1/RouterClientTest.java | 0 .../cloud/compute/v1/SnapshotClientTest.java | 0 .../compute/v1/SslCertificateClientTest.java | 0 .../cloud/compute/v1/SslPolicyClientTest.java | 0 .../compute/v1/SubnetworkClientTest.java | 0 .../compute/v1/TargetHttpProxyClientTest.java | 0 .../v1/TargetHttpsProxyClientTest.java | 0 .../compute/v1/TargetInstanceClientTest.java | 0 .../compute/v1/TargetPoolClientTest.java | 0 .../compute/v1/TargetSslProxyClientTest.java | 0 .../compute/v1/TargetTcpProxyClientTest.java | 0 .../v1/TargetVpnGatewayClientTest.java | 0 .../cloud/compute/v1/UrlMapClientTest.java | 0 .../cloud/compute/v1/VpnTunnelClientTest.java | 0 .../cloud/compute/v1/ZoneClientTest.java | 0 .../compute/v1/ZoneOperationClientTest.java | 0 1172 files changed, 35866 deletions(-) delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AccessConfig.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Address.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddressClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddressList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddressSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Allowed.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Autoscaler.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Backend.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendBucket.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendService.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Commitment.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CommitmentList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Data.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Denied.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Disk.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskType.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Error.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Errors.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Firewall.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/FirewallClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/FirewallList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HealthCheck.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HealthStatus.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HostRule.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Image.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ImageClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ImageList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ImageSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Instance.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceReference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Interconnect.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Items.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/License.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseCode.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MachineType.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Metadata.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NamedPort.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Network.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworkClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworkList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Operation.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/OperationList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PathMatcher.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PathRule.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Project.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Quota.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RawDisk.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Reference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Region.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RegionSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Route.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouteClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouteList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouteSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Router.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterBgp.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterInterface.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterStatus.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Scheduling.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Snapshot.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SnapshotList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslCertificate.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslPolicy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Subnetwork.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Tags.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetInstance.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPool.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetReference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TestFailure.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMap.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Warning.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Warnings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/XpnHostList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/Zone.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ZoneClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ZoneList.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/package-info.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java (100%) delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java delete mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java (100%) rename {google-cloud-compute => google-cloud-clients/google-cloud-compute}/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java (100%) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index 52f237e6485a..854684f2568c 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -43,26 +43,6 @@ test-jar test - - com.google.api - gax - - - com.google.api - gax - testlib - test - - - com.google.api - gax-httpjson - - - com.google.api - gax-httpjson - testlib - test - junit junit diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java deleted file mode 100644 index 643f0a6f1ad2..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.Compute.AddressOption; -import com.google.cloud.compute.deprecated.Compute.OperationOption; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.Objects; - -/** - * A Google Compute Engine address. With Compute Engine you can create static external IP addresses - * that are assigned to your project and persist until you explicitly release them. A region address - * can be assigned to a Compute Engine instance or to a regional forwarding rule. Compute Engine - * also allows you to create global addresses that are used for global forwarding rules. Both global - * addresses and global forwarding rules can only be used for HTTP load balancing. {@code Address} - * adds a layer of service-related functionality over {@link AddressInfo}. Objects of this class are - * immutable. To get an {@code Address} object with the most recent information use {@link #reload}. - * - * @see - * Static external IP addresses - * @see HTTP Load Balancing - */ -public class Address extends AddressInfo { - - private static final long serialVersionUID = 3457542817554062712L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Address} objects. - */ - public static class Builder extends AddressInfo.Builder { - - private final Compute compute; - private final AddressInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, AddressId addressId) { - this.compute = compute; - this.infoBuilder = new AddressInfo.BuilderImpl(); - this.infoBuilder.setAddressId(addressId); - } - - Builder(Address address) { - this.compute = address.compute; - this.infoBuilder = new AddressInfo.BuilderImpl(address); - } - - @Override - public Builder setAddress(String address) { - infoBuilder.setAddress(address); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - infoBuilder.setCreationTimestamp(creationTimestamp); - return this; - } - - @Override - public Builder setDescription(String description) { - infoBuilder.setDescription(description); - return this; - } - - @Override - Builder setGeneratedId(String generatedId) { - infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - public Builder setAddressId(AddressId addressId) { - infoBuilder.setAddressId(addressId); - return this; - } - - @Override - Builder setStatus(Status status) { - infoBuilder.setStatus(status); - return this; - } - - @Override - Builder setUsage(Usage usage) { - infoBuilder.setUsage(usage); - return this; - } - - @Override - public Address build() { - return new Address(compute, infoBuilder); - } - } - - Address(Compute compute, AddressInfo.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this address exists. - * - * @return {@code true} if this address exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(AddressOption.fields()) != null; - } - - /** - * Fetches the current address' latest information. Returns {@code null} if the address does not - * exist. - * - * @param options address options - * @return an {@code Address} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Address reload(AddressOption... options) { - return compute.getAddress(getAddressId(), options); - } - - /** - * Deletes this address. - * - * @return an {@code Operation} object if delete request was successfully sent, {@code null} if - * the address was not found - * @throws ComputeException upon failure - */ - public Operation delete(OperationOption... options) { - return compute.deleteAddress(getAddressId(), options); - } - - /** - * Returns the address's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Address.class)) { - return false; - } - Address other = (Address) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Address fromPb(Compute compute, com.google.api.services.compute.model.Address addressPb) { - return new Address(compute, new AddressInfo.BuilderImpl(addressPb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java deleted file mode 100644 index 137335027530..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * Base class for Google Compute Engine address identities. - */ -public abstract class AddressId extends ResourceId { - - private static final long serialVersionUID = 147328216049936438L; - - private final String address; - - /** - * Possible types for a Google Compute Engine address identity. - */ - enum Type { - /** - * Global static external IP addresses can be assigned to global forwarding rules. - */ - GLOBAL, - - /** - * Region static external IP addresses can be assigned to instances and region forwarding rules. - */ - REGION - } - - AddressId(String project, String address) { - super(project); - this.address = checkNotNull(address); - } - - /** - * Returns the type of this address identity. - */ - public abstract Type getType(); - - /** - * Returns the name of the address resource. The name must be 1-63 characters long and comply with - * RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getAddress() { - return address; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("address", address); - } - - @Override - final int baseHashCode() { - return Objects.hash(super.baseHashCode(), address); - } - - @Override - final boolean baseEquals(ResourceId resourceId) { - return resourceId instanceof AddressId - && super.baseEquals(resourceId) - && Objects.equals(address, ((AddressId) resourceId).address); - } - - @Override - abstract AddressId setProjectId(String projectId); -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java deleted file mode 100644 index 0bde7a3e4b0d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java +++ /dev/null @@ -1,574 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Address; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine address. With Compute Engine you can create static external IP addresses - * that are assigned to your project and persist until you explicitly release them. A region address - * can be assigned to a Compute Engine instance or to a regional forwarding rule. To create a region - * address, use a {@link RegionAddressId} identity. Compute Engine also allows you to create global - * addresses that are used for global forwarding rules. Both global addresses and global forwarding - * rules can only be used for HTTP load balancing. To create a global address, use a - * {@link GlobalAddressId} identity. - * - * @see - * Static external IP addresses - * @see HTTP Load Balancing - */ -public class AddressInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public AddressInfo apply(Address pb) { - return AddressInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Address apply(AddressInfo addressInfo) { - return addressInfo.toPb(); - } - }; - - private static final long serialVersionUID = 7678434703520207500L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String address; - private final Long creationTimestamp; - private final String description; - private final String generatedId; - private final AddressId addressId; - private final Status status; - private final Usage usage; - - /** - * The status of the address. - */ - public enum Status { - - /** - * The address is reserved for the project and is available for use. - */ - RESERVED, - - /** - * The address is currently being used and thus not available. - */ - IN_USE - } - - /** - * Base class for a Google Compute Engine address's usage information. Implementations of this - * class represent different possible usages of a Compute Engine address. {@link InstanceUsage} - * contains information for region addresses assigned to a Google Compute Engine instance. - * {@link RegionForwardingUsage} contains information for region addresses assigned to one or more - * region forwarding rules. {@link GlobalForwardingUsage} contains information for global - * addresses assigned to one or more global forwarding rules. - */ - public abstract static class Usage implements Serializable { - - private static final long serialVersionUID = -5028609518171408695L; - - Usage() {} - - /** - * Returns the identities of resources currently using this address. - */ - public abstract List getUsers(); - - final boolean baseEquals(Usage usage) { - return Objects.equals(toPb(), usage.toPb()); - } - - Address toPb() { - return new Address().setUsers(Lists.transform(getUsers(), new Function() { - @Override - public String apply(ResourceId resourceId) { - return resourceId.getSelfLink(); - } - })); - } - - @SuppressWarnings("unchecked") - static T fromPb(Address addressPb) { - String url = addressPb.getUsers().get(0); - if (InstanceId.matchesUrl(url)) { - return (T) InstanceUsage.fromPb(addressPb); - } else if (RegionForwardingRuleId.matchesUrl(url)) { - return (T) RegionForwardingUsage.fromPb(addressPb); - } else if (GlobalForwardingRuleId.matchesUrl(url)) { - return (T) GlobalForwardingUsage.fromPb(addressPb); - } else { - throw new IllegalArgumentException("Unexpected resource URL for address user"); - } - } - } - - /** - * Usage information for a Google Compute Engine region address assigned to a virtual machine - * instance. - */ - public static final class InstanceUsage extends Usage { - - private static final long serialVersionUID = -5028609518171408695L; - - private final InstanceId instance; - - InstanceUsage(InstanceId instance) { - this.instance = checkNotNull(instance); - } - - /** - * Returns the identity of the instance using the address. - */ - public InstanceId getInstance() { - return instance; - } - - @Override - public List getUsers() { - return ImmutableList.of(instance); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("instance", instance).toString(); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof InstanceUsage && baseEquals((InstanceUsage) obj); - } - - @Override - public int hashCode() { - return Objects.hash(instance); - } - - @SuppressWarnings("unchecked") - static InstanceUsage fromPb(Address addressPb) { - return new InstanceUsage(InstanceId.fromUrl(addressPb.getUsers().get(0))); - } - } - - /** - * Usage information for a Google Compute Engine region address assigned to one or more region - * forwarding rules. - */ - public static final class RegionForwardingUsage extends Usage { - - private static final long serialVersionUID = -4255145869626427363L; - - private final List forwardingRules; - - RegionForwardingUsage(List forwardingRules) { - this.forwardingRules = ImmutableList.copyOf(forwardingRules); - } - - /** - * Returns a list of identities of region forwarding rules that are currently using the address. - */ - public List getForwardingRules() { - return forwardingRules; - } - - @Override - public List getUsers() { - return forwardingRules; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("forwardingRules", forwardingRules).toString(); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof RegionForwardingUsage && baseEquals((RegionForwardingUsage) obj); - } - - @Override - public int hashCode() { - return Objects.hash(forwardingRules); - } - - @SuppressWarnings("unchecked") - static RegionForwardingUsage fromPb(Address addressPb) { - return new RegionForwardingUsage( - Lists.transform(addressPb.getUsers(), RegionForwardingRuleId.FROM_URL_FUNCTION)); - } - } - - /** - * Usage information for a Google Compute Engine global address assigned to one or more global - * forwarding rules. - */ - public static final class GlobalForwardingUsage extends Usage { - - private static final long serialVersionUID = -2974154224319117433L; - - private final List forwardingRules; - - GlobalForwardingUsage(List forwardingRules) { - this.forwardingRules = ImmutableList.copyOf(forwardingRules); - } - - /** - * Returns a list of identities of global forwarding rules that are currently using the address. - */ - public List getForwardingRules() { - return forwardingRules; - } - - @Override - public List getUsers() { - return forwardingRules; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("forwardingRules", forwardingRules).toString(); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof GlobalForwardingUsage && baseEquals((GlobalForwardingUsage) obj); - } - - @Override - public int hashCode() { - return Objects.hash(forwardingRules); - } - - @SuppressWarnings("unchecked") - static GlobalForwardingUsage fromPb(Address addressPb) { - return new GlobalForwardingUsage( - Lists.transform(addressPb.getUsers(), GlobalForwardingRuleId.FROM_URL_FUNCTION)); - } - } - - /** - * A builder for {@code AddressInfo} objects. - */ - public abstract static class Builder { - - /** - * Sets the actual IP address. - */ - public abstract Builder setAddress(String address); - - abstract Builder setCreationTimestamp(Long creationTimestamp); - - /** - * Sets an optional textual description of the address. - */ - public abstract Builder setDescription(String description); - - abstract Builder setGeneratedId(String generatedId); - - public abstract Builder setAddressId(AddressId addressId); - - abstract Builder setStatus(Status status); - - abstract Builder setUsage(Usage usage); - - /** - * Creates an {@code AddressInfo} object. - */ - public abstract AddressInfo build(); - } - - static final class BuilderImpl extends Builder { - - private String address; - private Long creationTimestamp; - private String description; - private String generatedId; - private AddressId addressId; - private Status status; - private Usage usage; - - BuilderImpl() {} - - BuilderImpl(AddressInfo addressInfo) { - this.address = addressInfo.address; - this.creationTimestamp = addressInfo.creationTimestamp; - this.description = addressInfo.description; - this.generatedId = addressInfo.generatedId; - this.addressId = addressInfo.addressId; - this.status = addressInfo.status; - this.usage = addressInfo.usage; - } - - BuilderImpl(Address addressPb) { - if (RegionAddressId.matchesUrl(addressPb.getSelfLink())) { - addressId = RegionAddressId.fromUrl(addressPb.getSelfLink()); - } else { - addressId = GlobalAddressId.fromUrl(addressPb.getSelfLink()); - } - address = addressPb.getAddress(); - if (addressPb.getCreationTimestamp() != null) { - creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(addressPb.getCreationTimestamp()); - } - description = addressPb.getDescription(); - if (addressPb.getId() != null) { - generatedId = addressPb.getId().toString(); - } - if (addressPb.getStatus() != null) { - status = Status.valueOf(addressPb.getStatus()); - } - if (addressPb.getUsers() != null && addressPb.getUsers().size() > 0) { - usage = Usage.fromPb(addressPb); - } - } - - @Override - public BuilderImpl setAddress(String address) { - this.address = address; - return this; - } - - @Override - BuilderImpl setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - public BuilderImpl setDescription(String description) { - this.description = description; - return this; - } - - @Override - BuilderImpl setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - public BuilderImpl setAddressId(AddressId addressId) { - this.addressId = checkNotNull(addressId); - return this; - } - - @Override - BuilderImpl setStatus(Status status) { - this.status = status; - return this; - } - - @Override - BuilderImpl setUsage(Usage usage) { - this.usage = usage; - return this; - } - - @Override - public AddressInfo build() { - return new AddressInfo(this); - } - } - - AddressInfo(BuilderImpl builder) { - address = builder.address; - creationTimestamp = builder.creationTimestamp; - description = builder.description; - generatedId = builder.generatedId; - addressId = checkNotNull(builder.addressId); - status = builder.status; - usage = builder.usage; - } - - /** - * Returns the static external IP address represented by this object. - */ - public String getAddress() { - return address; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns an optional textual description of the address. - */ - public String getDescription() { - return description; - } - - /** - * Returns the service-generated unique identifier for the address. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the address identity. Returns {@link GlobalAddressId} for a global address, returns - * {@link RegionAddressId} for a region address. - */ - @SuppressWarnings("unchecked") - public T getAddressId() { - return (T) addressId; - } - - /** - * Returns the status of the address. - */ - public Status getStatus() { - return status; - } - - /** - * Returns the usage information of the address. Returns an {@link InstanceUsage} object for - * region addresses that are assigned to VM instances. Returns a {@link RegionForwardingUsage} - * object for region addresses assigned to region forwarding rules. Returns a - * {@link GlobalForwardingUsage} object for global addresses assigned to global forwarding rules. - * Returns {@code null} if the address is not in use. - */ - @SuppressWarnings("unchecked") - public T getUsage() { - return (T) usage; - } - - /** - * Returns a builder for the {@code AddressInfo} object. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("address", address) - .add("creationTimestamp", creationTimestamp) - .add("description", description) - .add("generatedId", generatedId) - .add("addressId", addressId) - .add("status", status) - .add("usage", usage) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(address, creationTimestamp, description, generatedId, addressId, status, - usage); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(AddressInfo.class) - && Objects.equals(toPb(), ((AddressInfo) obj).toPb()); - } - - AddressInfo setProjectId(String projectId) { - if (getAddressId().getProject() != null) { - return this; - } - return toBuilder().setAddressId(addressId.setProjectId(projectId)).build(); - } - - Address toPb() { - Address addressPb = usage != null ? usage.toPb() : new Address(); - addressPb.setAddress(address); - if (creationTimestamp != null) { - addressPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - addressPb.setDescription(description); - if (generatedId != null) { - addressPb.setId(new BigInteger(generatedId)); - } - addressPb.setName(addressId.getAddress()); - if (addressId.getType() == AddressId.Type.REGION) { - addressPb.setRegion(this.getAddressId().getRegionId().getSelfLink()); - } - if (status != null) { - addressPb.setStatus(status.name()); - } - addressPb.setSelfLink(addressId.getSelfLink()); - return addressPb; - } - - /** - * Returns a builder for the {@code AddressInfo} object given it's identity. - */ - public static Builder newBuilder(AddressId addressId) { - return new BuilderImpl().setAddressId(addressId); - } - - /** - * Returns an {@code AddressInfo} object for the provided identity. - */ - public static AddressInfo of(AddressId addressId) { - return newBuilder(addressId).build(); - } - - /** - * Returns an {@code AddressInfo} object for the provided name. The object corresponds to a global - * address. - */ - public static AddressInfo of(String name) { - return of(GlobalAddressId.of(name)); - } - - /** - * Returns an {@code AddressInfo} object for the provided region identity and name. The object - * corresponds to a region address. - */ - public static AddressInfo of(RegionId regionId, String name) { - return of(RegionAddressId.of(regionId, name)); - } - - /** - * Returns an {@code AddressInfo} object for the provided region and address names. The object - * corresponds to a region address. - */ - public static AddressInfo of(String region, String name) { - return of(RegionAddressId.of(region, name)); - } - - static AddressInfo fromPb(Address addressPb) { - return new BuilderImpl(addressPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java deleted file mode 100644 index 1909b3566435..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java +++ /dev/null @@ -1,926 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.AttachedDiskInitializeParams; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; - -import java.io.Serializable; -import java.util.List; -import java.util.Objects; - -/** - * A disk attached to a Google Compute Engine instance. To create a new disk to attach when an image - * is being created use {@link CreateDiskConfiguration}. To attach an existing persistent disk use - * {@link PersistentDiskConfiguration}. To attach a scratch disk use - * {@link ScratchDiskConfiguration}. - */ -public class AttachedDisk implements Serializable { - - static final Function - FROM_PB_FUNCTION = - new Function() { - @Override - public AttachedDisk apply( - com.google.api.services.compute.model.AttachedDisk pb) { - return AttachedDisk.fromPb(pb); - } - }; - static final Function - TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.AttachedDisk apply( - AttachedDisk attachedDisk) { - return attachedDisk.toPb(); - } - }; - private static final long serialVersionUID = 2969789134157943798L; - - private final String deviceName; - private final Integer index; - private final AttachedDiskConfiguration configuration; - private final List licenses; - - /** - * Base class for {@code AttachedDisk} configuration. Use {@link PersistentDiskConfiguration} to - * attach an existing persistent disk. Use {@link CreateDiskConfiguration} to create a boot - * persistent disk to attach to the instance. Use {@link ScratchDiskConfiguration} to attach a - * scratch disk. - */ - public abstract static class AttachedDiskConfiguration implements Serializable { - - private static final long serialVersionUID = 8813134841283115565L; - - private final Type type; - private final InterfaceType interfaceType; - private final Boolean boot; - private final Boolean autoDelete; - - /** - * Specifies the type of the attached disk. - */ - public enum Type { - /** - * A persistent disk attached to a VM instance. Such an attached disk must already exist or - * can be created along with the instance by using {@link CreateDiskConfiguration}. A - * persistent disk can be attached to other VM instances. - */ - PERSISTENT, - - /** - * A scratch disk is created with the VM instance it is attached to. Scratch disks are only - * available to their VM instance. - */ - SCRATCH - } - - /** - * Specifies the disk interface to use for attaching this disk, which is either {@code SCSI} - * or {@code NVME}. Persistent disks must always use {@code SCSI}. Scratch SSDs can use either - * {@code NVME} or {@code SCSI}. - */ - public enum InterfaceType { - SCSI, - NVME - } - - AttachedDiskConfiguration(Type type, InterfaceType interfaceType, Boolean boot, - Boolean autoDelete) { - this.type = checkNotNull(type); - this.interfaceType = interfaceType; - this.boot = boot; - this.autoDelete = autoDelete; - } - - /** - * Returns the type of the attached disk. - */ - public Type getType() { - return type; - } - - /** - * Returns the interface to use to attach the disk. If not specified, {@link InterfaceType#SCSI} - * is used. - */ - public InterfaceType getInterfaceType() { - return interfaceType; - } - - /** - * Returns whether to use the attached disk as a boot disk. If {@code true} the virtual machine - * will use the first partition of the disk for its root filesystem. If not specified, the - * disk is not used as a boot disk. - */ - public Boolean boot() { - return boot; - } - - /** - * Returns whether the disk should auto-delete when the instance to which it's attached is - * deleted. If not specified, the disk is not deleted automatically. - */ - public Boolean autoDelete() { - return autoDelete; - } - - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this) - .add("type", type) - .add("interfaceType", interfaceType) - .add("boot", boot) - .add("autoDelete", autoDelete); - } - - @Override - public String toString() { - return toStringHelper().toString(); - } - - final int baseHashCode() { - return Objects.hash(type, interfaceType); - } - - final boolean baseEquals(AttachedDiskConfiguration diskConfiguration) { - return Objects.equals(toPb(), diskConfiguration.toPb()); - } - - abstract AttachedDiskConfiguration setProjectId(String projectId); - - com.google.api.services.compute.model.AttachedDisk toPb() { - com.google.api.services.compute.model.AttachedDisk attachedDiskPb = - new com.google.api.services.compute.model.AttachedDisk(); - attachedDiskPb.setType(type.name()); - if (interfaceType != null) { - attachedDiskPb.setInterface(interfaceType.name()); - } - attachedDiskPb.setBoot(boot); - attachedDiskPb.setAutoDelete(autoDelete); - return attachedDiskPb; - } - - @SuppressWarnings("unchecked") - static T fromPb( - com.google.api.services.compute.model.AttachedDisk diskPb) { - switch (Type.valueOf(diskPb.getType())) { - case PERSISTENT: - if (diskPb.getSource() == null) { - return (T) CreateDiskConfiguration.fromPb(diskPb); - } else { - return (T) PersistentDiskConfiguration.fromPb(diskPb); - } - case SCRATCH: - return (T) ScratchDiskConfiguration.fromPb(diskPb); - default: - // should be unreachable - throw new IllegalArgumentException("Unrecognized attached disk type"); - } - } - } - - /** - * An attached disk configuration for existing persistent disks. - */ - public static final class PersistentDiskConfiguration extends AttachedDiskConfiguration { - - private static final long serialVersionUID = 6367613188140104726L; - - private final DiskId sourceDisk; - private final Mode mode; - - /** - * Specifies the mode in which to attach the disk. - */ - public enum Mode { - /** - * The instance can both read and write to the disk. - */ - READ_WRITE, - - /** - * The instance is only allowed to read the disk. - */ - READ_ONLY - } - - /** - * A builder for {@code PersistentDiskConfiguration} objects. - */ - public static final class Builder { - - private DiskId sourceDisk; - private Mode mode; - private Boolean boot; - private Boolean autoDelete; - - private Builder(DiskId sourceDisk) { - this.sourceDisk = checkNotNull(sourceDisk); - } - - private Builder(PersistentDiskConfiguration configuration) { - sourceDisk = configuration.sourceDisk; - mode = configuration.mode; - boot = configuration.boot(); - autoDelete = configuration.autoDelete(); - } - - /** - * Sets the identity of the persistent disk to be attached. - */ - public Builder setSourceDisk(DiskId sourceDisk) { - this.sourceDisk = checkNotNull(sourceDisk); - return this; - } - - /** - * Sets the mode in which to attach this disk. If not specified, the disk is attached in - * {@link Mode#READ_WRITE} mode. - */ - public Builder setMode(Mode mode) { - this.mode = mode; - return this; - } - - /** - * Sets whether to use the attached disk as a boot disk. If {@code true} the virtual machine - * instance will use the first partition of the disk for its root filesystem. If not - * specified, the isk is not used as a boot disk. - */ - public Builder setBoot(boolean boot) { - this.boot = boot; - return this; - } - - /** - * Sets whether the disk should auto-delete when the instance to which it's attached is - * deleted. If not specified, the disk is not deleted automatically. - */ - public Builder setAutoDelete(boolean autoDelete) { - this.autoDelete = autoDelete; - return this; - } - - /** - * Creates a {@code PersistentDiskConfiguration} object. - */ - public PersistentDiskConfiguration build() { - return new PersistentDiskConfiguration(this); - } - } - - private PersistentDiskConfiguration(Builder builder) { - super(Type.PERSISTENT, null, builder.boot, builder.autoDelete); - this.sourceDisk = builder.sourceDisk; - this.mode = builder.mode; - } - - /** - * Returns the identity of the persistent disk to be attached. - */ - public DiskId getSourceDisk() { - return sourceDisk; - } - - /** - * Returns the mode in which to attach this disk. If not specified, the disk is attached in - * {@link Mode#READ_WRITE} mode. - */ - public Mode getMode() { - return mode; - } - - /** - * Returns a builder for the current configuration. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("sourceDisk", sourceDisk).add("mode", mode); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), sourceDisk, mode); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(PersistentDiskConfiguration.class) - && baseEquals((PersistentDiskConfiguration) obj); - } - - @Override - PersistentDiskConfiguration setProjectId(String projectId) { - if (sourceDisk.getProject() != null) { - return this; - } - return toBuilder().setSourceDisk(sourceDisk.setProjectId(projectId)).build(); - } - - @Override - com.google.api.services.compute.model.AttachedDisk toPb() { - com.google.api.services.compute.model.AttachedDisk attachedDiskPb = super.toPb(); - attachedDiskPb.setSource(sourceDisk.getSelfLink()); - attachedDiskPb.setMode(mode != null ? mode.toString() : null); - return attachedDiskPb; - } - - /** - * Returns a builder for a {@code PersistentDiskConfiguration} object given the identity of the - * persistent disk to attach. - */ - public static Builder newBuilder(DiskId sourceDisk) { - return new Builder(sourceDisk); - } - - /** - * Returns a {@code PersistentDiskConfiguration} object given the identity of the persistent - * disk to attach. - */ - public static PersistentDiskConfiguration of(DiskId sourceDisk) { - return newBuilder(sourceDisk).build(); - } - - @SuppressWarnings("unchecked") - static PersistentDiskConfiguration fromPb( - com.google.api.services.compute.model.AttachedDisk diskPb) { - Builder builder = new Builder(DiskId.fromUrl(diskPb.getSource())); - if (diskPb.getMode() != null) { - builder.setMode(Mode.valueOf(diskPb.getMode())); - } - if (diskPb.getBoot() != null) { - builder.setBoot(diskPb.getBoot()); - } - if (diskPb.getAutoDelete() != null) { - builder.setAutoDelete(diskPb.getAutoDelete()); - } - return builder.build(); - } - } - - /** - * An attached disk configuration for bootable persistent disks that must be created with the - * instance they are attached to. Attached disks that use this configuration can only be attached - * to an instance upon creation. A {@code CreateDiskConfiguration} object is never returned by the - * service: after the instance is created the corresponding attached disk will be returned with a - * {@link PersistentDiskConfiguration}. - */ - public static final class CreateDiskConfiguration extends AttachedDiskConfiguration { - - private static final long serialVersionUID = 961995522284348824L; - - private final String diskName; - private final DiskTypeId diskType; - private final Long diskSizeGb; - private final ImageId sourceImage; - - /** - * A builder for {@code CreateDiskConfiguration} objects. - */ - public static final class Builder { - - private String diskName; - private DiskTypeId diskType; - private Long diskSizeGb; - private ImageId sourceImage; - private Boolean autoDelete; - - private Builder(ImageId sourceImage) { - this.sourceImage = checkNotNull(sourceImage); - } - - private Builder(CreateDiskConfiguration configuration) { - this.diskName = configuration.diskName; - this.diskType = configuration.diskType; - this.diskSizeGb = configuration.diskSizeGb; - this.sourceImage = configuration.sourceImage; - this.autoDelete = configuration.autoDelete(); - } - - /** - * Sets the name to be assigned to the disk. If not specified, the disk is given the - * instance's name. - */ - public Builder setDiskName(String diskName) { - this.diskName = diskName; - return this; - } - - /** - * Sets the identity of the disk type. If not specified, {@code pd-standard} is used. - */ - public Builder setDiskType(DiskTypeId diskType) { - this.diskType = diskType; - return this; - } - - /** - * Sets the size of the persistent disk, in GB. If not set the disk will have the size of the - * source image. This value can be larger than the image's size. If the provided size is - * smaller than the image's size, then instance creation will fail. - */ - public Builder setDiskSizeGb(Long diskSizeGb) { - this.diskSizeGb = diskSizeGb; - return this; - } - - /** - * Sets the identity of the source image used to create the disk. - */ - public Builder setSourceImage(ImageId sourceImage) { - this.sourceImage = checkNotNull(sourceImage); - return this; - } - - /** - * Sets whether the disk should auto-delete when the instance to which it's attached is - * deleted. If not specified, the disk is not deleted automatically. - */ - public Builder setAutoDelete(Boolean autoDelete) { - this.autoDelete = autoDelete; - return this; - } - - /** - * Creates a {@code CreateDiskConfiguration} object. - */ - public CreateDiskConfiguration build() { - return new CreateDiskConfiguration(this); - } - } - - private CreateDiskConfiguration(Builder builder) { - super(Type.PERSISTENT, null, true, builder.autoDelete); - this.diskName = builder.diskName; - this.diskType = builder.diskType; - this.diskSizeGb = builder.diskSizeGb; - this.sourceImage = builder.sourceImage; - } - - /** - * Returns the name to be assigned to the disk. If not specified, the disk is given the - * instance's name. - */ - public String getDiskName() { - return diskName; - } - - /** - * Returns the identity of the disk type. If not specified, {@code pd-standard} is used. - */ - public DiskTypeId getDiskType() { - return diskType; - } - - /** - * Returns the size of the persistent disk, in GB. If not set the disk will have the size of the - * source image. This value can be larger than the image's size. If the provided size is smaller - * than the image's size then instance creation will fail. - */ - public Long getDiskSizeGb() { - return diskSizeGb; - } - - /** - * Returns the identity of the source image used to create the disk. - */ - public ImageId getSourceImage() { - return sourceImage; - } - - /** - * Returns a builder for the current configuration. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("diskName", diskName) - .add("diskType", diskType) - .add("diskSizeGb", diskSizeGb) - .add("sourceImage", sourceImage); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), diskName, diskType, diskSizeGb, sourceImage); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(CreateDiskConfiguration.class) - && baseEquals((CreateDiskConfiguration) obj); - } - - @Override - CreateDiskConfiguration setProjectId(String projectId) { - Builder builder = toBuilder(); - if (builder.diskType != null) { - builder.setDiskType(diskType.setProjectId(projectId)); - } - if (builder.sourceImage != null) { - builder.setSourceImage(sourceImage.setProjectId(projectId)); - } - return builder.build(); - } - - @Override - com.google.api.services.compute.model.AttachedDisk toPb() { - AttachedDiskInitializeParams initializeParamsPb = new AttachedDiskInitializeParams(); - initializeParamsPb.setDiskName(diskName); - initializeParamsPb.setDiskSizeGb(diskSizeGb); - initializeParamsPb.setSourceImage(sourceImage.getSelfLink()); - if (diskType != null) { - initializeParamsPb.setDiskType(diskType.getSelfLink()); - } - com.google.api.services.compute.model.AttachedDisk attachedDiskPb = super.toPb(); - attachedDiskPb.setInitializeParams(initializeParamsPb); - return attachedDiskPb; - } - - /** - * Returns a builder for a {@code CreateDiskConfiguration} object given the source image that - * will be used to create the disk. - */ - public static Builder newBuilder(ImageId sourceImage) { - return new Builder(sourceImage); - } - - /** - * Returns a {@code CreateDiskConfiguration} object given the source image that will be used to - * create the disk. - */ - public static CreateDiskConfiguration of(ImageId sourceImage) { - return newBuilder(sourceImage).build(); - } - - @SuppressWarnings("unchecked") - static CreateDiskConfiguration fromPb( - com.google.api.services.compute.model.AttachedDisk diskPb) { - AttachedDiskInitializeParams initializeParamsPb = diskPb.getInitializeParams(); - Builder builder = newBuilder(ImageId.fromUrl(initializeParamsPb.getSourceImage())); - if (initializeParamsPb.getDiskType() != null) { - builder.setDiskType(DiskTypeId.fromUrl(initializeParamsPb.getDiskType())); - } - builder.setDiskName(initializeParamsPb.getDiskName()); - builder.setDiskSizeGb(initializeParamsPb.getDiskSizeGb()); - builder.setAutoDelete(diskPb.getAutoDelete()); - if (initializeParamsPb.getDiskType() != null) { - builder.setDiskType(DiskTypeId.fromUrl(initializeParamsPb.getDiskType())); - } - return builder.build(); - } - } - - /** - * An attached disk configuration for scratch disks. Attached disks that use this configuration - * can only be attached to an instance upon creation. - */ - public static final class ScratchDiskConfiguration extends AttachedDiskConfiguration { - - private static final long serialVersionUID = -8445453507234691254L; - - private final DiskTypeId diskType; - - /** - * A builder for {@code ScratchDiskConfiguration} objects. - */ - public static final class Builder { - - private DiskTypeId diskType; - private InterfaceType interfaceType; - - private Builder() {} - - private Builder(ScratchDiskConfiguration configuration) { - this.diskType = configuration.diskType; - this.interfaceType = configuration.getInterfaceType(); - } - - /** - * Sets the identity of the disk type for the scratch disk to attach. - */ - public Builder setDiskType(DiskTypeId diskType) { - this.diskType = diskType; - return this; - } - - /** - * Sets the interface type. If not specified, {@code SCSI} is used. - */ - public Builder setInterfaceType(InterfaceType interfaceType) { - this.interfaceType = interfaceType; - return this; - } - - /** - * Creates a {@code ScratchDiskConfiguration} object. - */ - public ScratchDiskConfiguration build() { - return new ScratchDiskConfiguration(this); - } - } - - private ScratchDiskConfiguration(Builder builder) { - super(Type.SCRATCH, builder.interfaceType, false, true); - this.diskType = builder.diskType; - } - - /** - * Returns the identity of the disk type for the scratch disk to attach. - */ - public DiskTypeId getDiskType() { - return diskType; - } - - /** - * Returns a builder for the current configuration. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("diskType", diskType); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode()); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(ScratchDiskConfiguration.class) - && baseEquals((ScratchDiskConfiguration) obj); - } - - @Override - ScratchDiskConfiguration setProjectId(String projectId) { - if (diskType.getProject() != null) { - return this; - } - return toBuilder().setDiskType(diskType.setProjectId(projectId)).build(); - } - - @Override - com.google.api.services.compute.model.AttachedDisk toPb() { - com.google.api.services.compute.model.AttachedDisk attachedDiskPb = super.toPb(); - if (diskType != null) { - AttachedDiskInitializeParams initializeParamsPb = new AttachedDiskInitializeParams(); - initializeParamsPb.setDiskType(diskType.getSelfLink()); - attachedDiskPb.setInitializeParams(initializeParamsPb); - } - return attachedDiskPb; - } - - /** - * Returns a builder for {@code ScratchDiskConfiguration} objects given the disk type identity. - */ - public static Builder newBuilder(DiskTypeId diskType) { - return new Builder().setDiskType(diskType); - } - - /** - * Returns a {@code ScratchDiskConfiguration} object given the disk type identity. The disk will - * be attached via the default interface ({@link InterfaceType#SCSI}). - */ - public static ScratchDiskConfiguration of(DiskTypeId diskType) { - return newBuilder(diskType).build(); - } - - @SuppressWarnings("unchecked") - static ScratchDiskConfiguration fromPb( - com.google.api.services.compute.model.AttachedDisk diskPb) { - Builder builder = new Builder(); - if (diskPb.getInterface() != null) { - builder.setInterfaceType(InterfaceType.valueOf(diskPb.getInterface())); - } - if (diskPb.getInitializeParams() != null - && diskPb.getInitializeParams().getDiskType() != null) { - builder.setDiskType(DiskTypeId.fromUrl(diskPb.getInitializeParams().getDiskType())); - } - return builder.build(); - } - } - - /** - * A builder for {@code AttachedDisk} objects. - */ - public static final class Builder { - - private String deviceName; - private Integer index; - private AttachedDiskConfiguration configuration; - private List licenses; - - Builder(AttachedDiskConfiguration configuration) { - this.configuration = checkNotNull(configuration); - } - - Builder(AttachedDisk attachedDisk) { - this.deviceName = attachedDisk.deviceName; - this.index = attachedDisk.index; - this.configuration = attachedDisk.configuration; - this.licenses = attachedDisk.licenses; - } - - /** - * Sets the unique device name of your choice that is reflected into the - * {@code /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 service chooses a default device name to - * apply to this disk, in the form {@code persistent-disks-x}, where x is a number assigned by - * Google Compute Engine. - */ - public Builder setDeviceName(String deviceName) { - this.deviceName = deviceName; - return this; - } - - /** - * Sets a zero-based index to this disk, where 0 is reserved for the boot disk. For example, - * if you have many disks attached to an instance, each disk would have an unique index number. - * If not specified, the service will choose an appropriate value. - */ - public Builder setIndex(Integer index) { - this.index = index; - return this; - } - - /** - * Sets the attached disk configuration. Use {@link ScratchDiskConfiguration} to attach a - * scratch disk to the instance. Use {@link PersistentDiskConfiguration} to attach a - * persistent disk to the instance. Use {@link CreateDiskConfiguration} to create and attach - * a new persistent disk. - */ - public Builder setConfiguration(AttachedDiskConfiguration configuration) { - this.configuration = checkNotNull(configuration); - return this; - } - - Builder setLicenses(List licenses) { - this.licenses = licenses; - return this; - } - - /** - * Creates an {@code AttachedDisk} object. - */ - public AttachedDisk build() { - return new AttachedDisk(this); - } - } - - private AttachedDisk(Builder builder) { - this.deviceName = builder.deviceName; - this.index = builder.index; - this.configuration = builder.configuration; - this.licenses = builder.licenses; - } - - /** - * Returns the unique device name of your choice that is reflected into the - * {@code /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 service chooses a default device name to - * apply to this disk, in the form {@code persistent-disks-x}, where x is a number assigned by - * Google Compute Engine. - */ - public String getDeviceName() { - return deviceName; - } - - /** - * Returns a zero-based index to this disk, where 0 is reserved for the boot disk. - */ - public Integer getIndex() { - return index; - } - - /** - * Returns the attached disk configuration. Returns {@link ScratchDiskConfiguration} to attach a - * scratch disk to the instance. Returns {@link PersistentDiskConfiguration} to attach a - * persistent disk to the instance. Returns {@link CreateDiskConfiguration} to create and attach - * a new persistent disk. - */ - @SuppressWarnings("unchecked") - public T getConfiguration() { - return (T) configuration; - } - - /** - * Returns a list of publicly accessible licenses for the attached disk. - */ - public List getLicenses() { - return licenses; - } - - /** - * Returns a builder for the current attached disk. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("deviceName", deviceName) - .add("index", index) - .add("configuration", configuration) - .add("licenses", licenses) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(deviceName, index, configuration, licenses); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(AttachedDisk.class) - && Objects.equals(toPb(), ((AttachedDisk) obj).toPb()); - } - - AttachedDisk setProjectId(String projectId) { - return toBuilder().setConfiguration(configuration.setProjectId(projectId)).build(); - } - - com.google.api.services.compute.model.AttachedDisk toPb() { - com.google.api.services.compute.model.AttachedDisk attachedDiskPb = configuration.toPb(); - attachedDiskPb.setDeviceName(deviceName); - attachedDiskPb.setIndex(index); - if (licenses != null) { - attachedDiskPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); - } - return attachedDiskPb; - } - - /** - * Returns a builder for an {@code AttachedDisk} object given its configuration. - */ - public static Builder newBuilder(AttachedDiskConfiguration configuration) { - return new Builder(configuration); - } - - /** - * Returns an {@code AttachedDisk} object given its configuration. - */ - public static AttachedDisk of(AttachedDiskConfiguration configuration) { - return newBuilder(configuration).build(); - } - - /** - * Returns an {@code AttachedDisk} object given the device name and its configuration. - */ - public static AttachedDisk of(String deviceName, AttachedDiskConfiguration configuration) { - return newBuilder(configuration).setDeviceName(deviceName).build(); - } - - static AttachedDisk fromPb(com.google.api.services.compute.model.AttachedDisk diskPb) { - AttachedDiskConfiguration configuration = AttachedDiskConfiguration.fromPb(diskPb); - Builder builder = newBuilder(configuration); - builder.setDeviceName(diskPb.getDeviceName()); - builder.setIndex(diskPb.getIndex()); - if (diskPb.getLicenses() != null) { - builder.setLicenses(Lists.transform(diskPb.getLicenses(), LicenseId.FROM_URL_FUNCTION)); - } - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java deleted file mode 100644 index 51c9eae1389d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java +++ /dev/null @@ -1,2709 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.FieldSelector; -import com.google.cloud.FieldSelector.Helper; -import com.google.api.gax.paging.Page; -import com.google.cloud.Service; -import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; -import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; -import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; - -import java.io.Serializable; -import java.util.List; -import java.util.Objects; - -/** - * An interface for Google Cloud Compute Engine. - * - * @see Google Cloud Compute Engine - */ -public interface Compute extends Service { - - /** - * Fields of a Compute Engine DiskType resource. - * - * @see Disk - * Type Resource - */ - enum DiskTypeField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DEFAULT_DISK_SIZE_GB("defaultDiskSizeGb"), - DESCRIPTION("description"), - ID("id"), - NAME("name"), - SELF_LINK("selfLink"), - VALID_DISK_SIZE("validDiskSize"), - ZONE("zone"), - DEPRECATED("deprecated"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - DiskTypeField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine MachineType resource. - * - * @see - * Machine Type Resource - */ - enum MachineTypeField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - GUEST_CPUS("guestCpus"), - ID("id"), - IMAGE_SPACE_GB("imageSpaceGb"), - MAXIMUM_PERSISTENT_DISKS("maximumPersistentDisks"), - MAXIMUM_PERSISTENT_DISKS_SIZE_GB("maximumPersistentDisksSizeGb"), - MEMORY_MB("memoryMb"), - NAME("name"), - SCRATCH_DISKS("scratchDisks"), - SELF_LINK("selfLink"), - ZONE("zone"), - DEPRECATED("deprecated"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - MachineTypeField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Region resource. - * - * @see - * Region Resource - */ - enum RegionField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - ID("id"), - NAME("name"), - QUOTAS("quotas"), - SELF_LINK("selfLink"), - STATUS("status"), - ZONES("zones"), - DEPRECATED("deprecated"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - RegionField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Zone resource. - * - * @see Zone - * Resource - */ - enum ZoneField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - ID("id"), - NAME("name"), - REGION("region"), - SELF_LINK("selfLink"), - STATUS("status"), - DEPRECATED("deprecated"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - ZoneField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine License resource. - * - * @see License - * Resource - */ - enum LicenseField implements FieldSelector { - CHARGES_USE_FEE("chargesUseFee"), - NAME("name"), - SELF_LINK("selfLink"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - LicenseField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Operation resource. - * - * @see - * GlobalOperation Resource - * @see - * RegionOperation Resource - * @see - * ZoneOperation Resource - */ - enum OperationField implements FieldSelector { - CLIENT_OPERATION_ID("clientOperationId"), - DESCRIPTION("description"), - END_TIME("endTime"), - ERROR("error"), - HTTP_ERROR_MESSAGE("httpErrorMessage"), - HTTP_ERROR_STATUS_CODE("httpErrorStatusCode"), - ID("id"), - INSERT_TIME("insertTime"), - NAME("name"), - OPERATION_TYPE("operationType"), - PROGRESS("progress"), - REGION("region"), - SELF_LINK("selfLink"), - START_TIME("startTime"), - STATUS("status"), - STATUS_MESSAGE("statusMessage"), - TARGET_ID("targetId"), - TARGET_LINK("targetLink"), - USER("user"), - WARNINGS("warnings"), - ZONE("zone"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - OperationField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Address resource. - * - * @see Region - * Address Resource - * @see - * Global Address Resource - */ - enum AddressField implements FieldSelector { - ADDRESS("address"), - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - ID("id"), - NAME("name"), - REGION("region"), - SELF_LINK("selfLink"), - STATUS("status"), - USERS("users"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - AddressField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Disk resource. - * - * @see Disk - * Resource - */ - enum DiskField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - ID("id"), - LAST_ATTACH_TIMESTAMP("lastAttachTimestamp"), - LAST_DETACH_TIMESTAMP("lastDetachTimestamp"), - LICENSES("licenses"), - NAME("name"), - OPTIONS("options"), - SELF_LINK("selfLink"), - SIZE_GB("sizeGb"), - SOURCE_IMAGE("sourceImage"), - SOURCE_IMAGE_ID("sourceImageId"), - SOURCE_SNAPSHOT("sourceSnapshot"), - SOURCE_SNAPSHOT_ID("sourceSnapshotId"), - STATUS("status"), - TYPE("type"), - USERS("users"), - ZONE("zone"); - - static final List REQUIRED_FIELDS = - ImmutableList.of(SELF_LINK, TYPE, SOURCE_IMAGE, SOURCE_SNAPSHOT); - - private final String selector; - - DiskField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Snapshot resource. - * - * @see - * Snapshot Resource - */ - enum SnapshotField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - DISK_SIZE_GB("diskSizeGb"), - ID("id"), - LICENSES("licenses"), - NAME("name"), - SELF_LINK("selfLink"), - SOURCE_DISK("sourceDisk"), - SOURCE_DISK_ID("sourceDiskId"), - STATUS("status"), - STORAGE_BYTES("storageBytes"), - STORAGE_BYTES_STATUS("storageBytesStatus"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - SnapshotField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Image resource. - * - * @see Image - * Resource - */ - enum ImageField implements FieldSelector { - ARCHIVE_SIZE_BYTES("archiveSizeBytes"), - CREATION_TIMESTAMP("creationTimestamp"), - DEPRECATED("deprecated"), - DESCRIPTION("description"), - DISK_SIZE_GB("diskSizeGb"), - ID("id"), - LICENSES("licenses"), - NAME("name"), - RAW_DISK("rawDisk"), - SELF_LINK("selfLink"), - SOURCE_DISK("sourceDisk"), - SOURCE_DISK_ID("sourceDiskId"), - SOURCE_TYPE("sourceType"); - - static final List REQUIRED_FIELDS = - ImmutableList.of(SELF_LINK, SOURCE_DISK, RAW_DISK); - - private final String selector; - - ImageField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Subnetwork resource. - * - * @see - * Subnetwork Resource - */ - enum SubnetworkField implements FieldSelector { - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - GATEWAY_ADDRESS("gatewayAddress"), - ID("id"), - IP_CIDR_RANGE("ipCidrRange"), - NAME("name"), - NETWORK("network"), - REGION("region"), - SELF_LINK("selfLink"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - SubnetworkField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Network resource. - * - * @see - * Network Resource - */ - enum NetworkField implements FieldSelector { - IPV4_RANGE("IPv4Range"), - AUTO_CREATE_SUBNETWORKS("autoCreateSubnetworks"), - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - GATEWAY_IPV4("gatewayIPv4"), - ID("id"), - NAME("name"), - SELF_LINK("selfLink"), - SUBNETWORKS("subnetworks"); - - static final List REQUIRED_FIELDS = - ImmutableList.of(SELF_LINK, IPV4_RANGE, AUTO_CREATE_SUBNETWORKS); - - private final String selector; - - NetworkField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Fields of a Compute Engine Instance resource. - * - * @see - * Network Resource - */ - enum InstanceField implements FieldSelector { - CAN_IP_FORWARD("canIpForward"), - CPU_PLATFORM("cpuPlatform"), - CREATION_TIMESTAMP("creationTimestamp"), - DESCRIPTION("description"), - DISKS("disks"), - ID("id"), - MACHINE_TYPE("machineType"), - METADATA("metadata"), - NAME("name"), - NETWORK_INTERFACES("networkInterfaces"), - SCHEDULING("scheduling"), - SELF_LINK("selfLink"), - SERVICE_ACCOUNTS("serviceAccounts"), - STATUS("status"), - STATUS_MESSAGE("statusMessage"), - TAGS("tags"), - ZONE("zone"); - - static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); - - private final String selector; - - InstanceField(String selector) { - this.selector = selector; - } - - @Override - public String getSelector() { - return selector; - } - } - - /** - * Base class for list filters. - */ - abstract class ListFilter implements Serializable { - - private static final long serialVersionUID = -238638392811165127L; - - private final String field; - private final ComparisonOperator operator; - private final Object value; - - enum ComparisonOperator { - /** - * Defines an equals filter. - */ - EQ, - - /** - * Defines a not-equals filter. - */ - NE - } - - ListFilter(String field, ComparisonOperator operator, Object value) { - this.field = field; - this.operator = operator; - this.value = value; - } - - @Override - public int hashCode() { - return Objects.hash(field, operator, value); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof ListFilter && toPb().equals(((ListFilter) obj).toPb()); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("field", field) - .add("operator", operator) - .add("value", value) - .toString(); - } - - String toPb() { - return field + ' ' + operator.name().toLowerCase() + ' ' + value.toString(); - } - } - - /** - * Class for filtering disk type lists. - */ - class DiskTypeFilter extends ListFilter { - - private static final long serialVersionUID = 4847837203592234453L; - - private DiskTypeFilter(DiskTypeField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static DiskTypeFilter equals(DiskTypeField field, String value) { - return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static DiskTypeFilter notEquals(DiskTypeField field, String value) { - return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns an equals filter for the given field and long value. - */ - public static DiskTypeFilter equals(DiskTypeField field, long value) { - return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and long value. - */ - public static DiskTypeFilter notEquals(DiskTypeField field, long value) { - return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering machine type lists. - */ - class MachineTypeFilter extends ListFilter { - - private static final long serialVersionUID = 7346062041571853235L; - - private MachineTypeFilter(MachineTypeField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static MachineTypeFilter equals(MachineTypeField field, String value) { - return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static MachineTypeFilter notEquals(MachineTypeField field, String value) { - return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns an equals filter for the given field and long value. - */ - public static MachineTypeFilter equals(MachineTypeField field, long value) { - return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and long value. - */ - public static MachineTypeFilter notEquals(MachineTypeField field, long value) { - return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering region lists. - */ - class RegionFilter extends ListFilter { - - private static final long serialVersionUID = 4464892812442567172L; - - private RegionFilter(RegionField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static RegionFilter equals(RegionField field, String value) { - return new RegionFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static RegionFilter notEquals(RegionField field, String value) { - return new RegionFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - } - - /** - * Class for filtering zone lists. - */ - class ZoneFilter extends ListFilter { - - private static final long serialVersionUID = -3927428278548808737L; - - private ZoneFilter(ZoneField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static ZoneFilter equals(ZoneField field, String value) { - return new ZoneFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static ZoneFilter notEquals(ZoneField field, String value) { - return new ZoneFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - } - - /** - * Class for filtering operation lists. - */ - class OperationFilter extends ListFilter { - - private static final long serialVersionUID = -3202249202748346427L; - - private OperationFilter(OperationField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static OperationFilter equals(OperationField field, String value) { - return new OperationFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static OperationFilter notEquals(OperationField field, String value) { - return new OperationFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns an equals filter for the given field and long value. - */ - public static OperationFilter equals(OperationField field, long value) { - return new OperationFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and long value. - */ - public static OperationFilter notEquals(OperationField field, long value) { - return new OperationFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering address lists. - */ - class AddressFilter extends ListFilter { - - private static final long serialVersionUID = -227481644259653765L; - - private AddressFilter(AddressField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static AddressFilter equals(AddressField field, String value) { - return new AddressFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static AddressFilter notEquals(AddressField field, String value) { - return new AddressFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - } - - /** - * Class for filtering snapshot lists. - */ - class SnapshotFilter extends ListFilter { - - private static final long serialVersionUID = 8757711630092406747L; - - private SnapshotFilter(SnapshotField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static SnapshotFilter equals(SnapshotField field, String value) { - return new SnapshotFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static SnapshotFilter notEquals(SnapshotField field, String value) { - return new SnapshotFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns an equals filter for the given field and long value. - */ - public static SnapshotFilter equals(SnapshotField field, long value) { - return new SnapshotFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and long value. - */ - public static SnapshotFilter notEquals(SnapshotField field, long value) { - return new SnapshotFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering image lists. - */ - class ImageFilter extends ListFilter { - - private static final long serialVersionUID = -3601427417234098397L; - - private ImageFilter(ImageField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static ImageFilter equals(ImageField field, String value) { - return new ImageFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static ImageFilter notEquals(ImageField field, String value) { - return new ImageFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns an equals filter for the given field and long value. - */ - public static ImageFilter equals(ImageField field, long value) { - return new ImageFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and long value. - */ - public static ImageFilter notEquals(ImageField field, long value) { - return new ImageFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering disk lists. - */ - class DiskFilter extends ListFilter { - - private static final long serialVersionUID = 5856790665396877913L; - - private DiskFilter(DiskField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static DiskFilter equals(DiskField field, String value) { - return new DiskFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static DiskFilter notEquals(DiskField field, String value) { - return new DiskFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns an equals filter for the given field and long value. - */ - public static DiskFilter equals(DiskField field, long value) { - return new DiskFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and long value. - */ - public static DiskFilter notEquals(DiskField field, long value) { - return new DiskFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering subnetwork lists. - */ - class SubnetworkFilter extends ListFilter { - - private static final long serialVersionUID = 979448583739105481L; - - private SubnetworkFilter(SubnetworkField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static SubnetworkFilter equals(SubnetworkField field, String value) { - return new SubnetworkFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static SubnetworkFilter notEquals(SubnetworkField field, String value) { - return new SubnetworkFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - } - - /** - * Class for filtering network lists. - */ - class NetworkFilter extends ListFilter { - - private static final long serialVersionUID = 7921406498804130930L; - - private NetworkFilter(NetworkField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static NetworkFilter equals(NetworkField field, String value) { - return new NetworkFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static NetworkFilter notEquals(NetworkField field, String value) { - return new NetworkFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns a equals filter for the given field and boolean value. - */ - public static NetworkFilter equals(NetworkField field, boolean value) { - return new NetworkFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and boolean value. - */ - public static NetworkFilter notEquals(NetworkField field, boolean value) { - return new NetworkFilter(checkNotNull(field), ComparisonOperator.NE, value); - } - } - - /** - * Class for filtering instance lists. - */ - class InstanceFilter extends ListFilter { - - private static final long serialVersionUID = 679008888882025686L; - - private InstanceFilter(InstanceField field, ComparisonOperator operator, Object value) { - super(field.getSelector(), operator, value); - } - - /** - * Returns an equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static InstanceFilter equals(InstanceField field, String value) { - return new InstanceFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); - } - - /** - * Returns a not-equals filter for the given field and string value. For string fields, - * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must - * match the entire field. - * - * @see RE2 - */ - public static InstanceFilter notEquals(InstanceField field, String value) { - return new InstanceFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); - } - - /** - * Returns a equals filter for the given field and boolean value. - */ - public static InstanceFilter equals(InstanceField field, boolean value) { - return new InstanceFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - - /** - * Returns a not-equals filter for the given field and boolean value. - */ - public static InstanceFilter notEquals(InstanceField field, boolean value) { - return new InstanceFilter(checkNotNull(field), ComparisonOperator.EQ, value); - } - } - - /** - * Class for specifying disk type get options. - */ - class DiskTypeOption extends Option { - - private static final long serialVersionUID = 7349162455602991554L; - - private DiskTypeOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the disk type's fields to be returned by the RPC call. If this - * option is not provided, all disk type's fields are returned. {@code DiskTypeOption.fields} - * can be used to specify only the fields of interest. {@link DiskType#getDiskTypeId()} is always - * returned, even if not specified. - */ - public static DiskTypeOption fields(DiskTypeField... fields) { - return new DiskTypeOption(ComputeRpc.Option.FIELDS, - Helper.selector(DiskTypeField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying disk type list options. - */ - class DiskTypeListOption extends Option { - - private static final long serialVersionUID = 9051194230847610951L; - - private DiskTypeListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the disk types being listed. - */ - public static DiskTypeListOption filter(DiskTypeFilter filter) { - return new DiskTypeListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of disk types returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static DiskTypeListOption pageSize(long pageSize) { - return new DiskTypeListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing disk types. - */ - public static DiskTypeListOption pageToken(String pageToken) { - return new DiskTypeListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the disk type's fields to be returned by the RPC call. If this - * option is not provided, all disk type's fields are returned. - * {@code DiskTypeListOption.fields} can be used to specify only the fields of interest. - * {@link DiskType#getDiskTypeId()} is always returned, even if not specified. - */ - public static DiskTypeListOption fields(DiskTypeField... fields) { - return new DiskTypeListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", DiskTypeField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying disk type aggregated list options. - */ - class DiskTypeAggregatedListOption extends Option { - - private static final long serialVersionUID = 7611137483018305170L; - - private DiskTypeAggregatedListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the disk types being listed. - */ - public static DiskTypeAggregatedListOption filter(DiskTypeFilter filter) { - return new DiskTypeAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of disk types returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static DiskTypeAggregatedListOption pageSize(long pageSize) { - return new DiskTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing disk types. - */ - public static DiskTypeAggregatedListOption pageToken(String pageToken) { - return new DiskTypeAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - } - - /** - * Class for specifying machine type get options. - */ - class MachineTypeOption extends Option { - - private static final long serialVersionUID = 7349162455602991554L; - - private MachineTypeOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the machine type's fields to be returned by the RPC call. If - * this option is not provided, all machine type's fields are returned. - * {@code MachineTypeOption.fields} can be used to specify only the fields of interest. - * {@link MachineType#getMachineTypeId()} is always returned, even if not specified. - */ - public static MachineTypeOption fields(MachineTypeField... fields) { - return new MachineTypeOption(ComputeRpc.Option.FIELDS, - Helper.selector(MachineTypeField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying machine type list options. - */ - class MachineTypeListOption extends Option { - - private static final long serialVersionUID = -2974553049419897902L; - - private MachineTypeListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the machine types being listed. - */ - public static MachineTypeListOption filter(MachineTypeFilter filter) { - return new MachineTypeListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of machine types returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static MachineTypeListOption pageSize(long pageSize) { - return new MachineTypeListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing machine types. - */ - public static MachineTypeListOption pageToken(String pageToken) { - return new MachineTypeListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the machine type's fields to be returned by the RPC call. If - * this option is not provided, all machine type's fields are returned. - * {@code MachineTypeListOption.fields} can be used to specify only the fields of interest. - * {@link MachineType#getMachineTypeId()} is always returned, even if not specified. - */ - public static MachineTypeListOption fields(MachineTypeField... fields) { - return new MachineTypeListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", MachineTypeField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying machine type aggregated list options. - */ - class MachineTypeAggregatedListOption extends Option { - - private static final long serialVersionUID = 8492257475500296057L; - - private MachineTypeAggregatedListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the machine types being listed. - */ - public static MachineTypeAggregatedListOption filter(MachineTypeFilter filter) { - return new MachineTypeAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of machine types returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static MachineTypeAggregatedListOption pageSize(long pageSize) { - return new MachineTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing machine types. - */ - public static MachineTypeAggregatedListOption pageToken(String pageToken) { - return new MachineTypeAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - } - - /** - * Class for specifying region get options. - */ - class RegionOption extends Option { - - private static final long serialVersionUID = 2025084807788610826L; - - private RegionOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the region's fields to be returned by the RPC call. If this - * option is not provided, all region's fields are returned. {@code RegionOption.fields} can be - * used to specify only the fields of interest. {@link Region#getRegionId()} is always - * returned, even if not specified. - */ - public static RegionOption fields(RegionField... fields) { - return new RegionOption(ComputeRpc.Option.FIELDS, - Helper.selector(RegionField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying region list options. - */ - class RegionListOption extends Option { - - private static final long serialVersionUID = 3348089279267170211L; - - private RegionListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the regions being listed. - */ - public static RegionListOption filter(RegionFilter filter) { - return new RegionListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of regions returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static RegionListOption pageSize(long pageSize) { - return new RegionListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing regions. - */ - public static RegionListOption pageToken(String pageToken) { - return new RegionListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the region's fields to be returned by the RPC call. If this - * option is not provided, all region's fields are returned. {@code RegionListOption.fields} can - * be used to specify only the fields of interest. {@link Region#getRegionId()} is always - * returned, even if not specified. - */ - public static RegionListOption fields(RegionField... fields) { - return new RegionListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", RegionField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying zone get options. - */ - class ZoneOption extends Option { - - private static final long serialVersionUID = -2968652076389846258L; - - private ZoneOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the zone's fields to be returned by the RPC call. If this option - * is not provided, all zone's fields are returned. {@code ZoneOption.fields} can be used to - * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if - * not specified. - */ - public static ZoneOption fields(ZoneField... fields) { - return new ZoneOption(ComputeRpc.Option.FIELDS, - Helper.selector(ZoneField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying zone list options. - */ - class ZoneListOption extends Option { - - private static final long serialVersionUID = -4721971371200905764L; - - private ZoneListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the zones being listed. - */ - public static ZoneListOption filter(ZoneFilter filter) { - return new ZoneListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of zones returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static ZoneListOption pageSize(long pageSize) { - return new ZoneListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing zones. - */ - public static ZoneListOption pageToken(String pageToken) { - return new ZoneListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the zone's fields to be returned by the RPC call. If this option - * is not provided, all zone's fields are returned. {@code ZoneListOption.fields} can be used to - * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if - * not specified. - */ - public static ZoneListOption fields(ZoneField... fields) { - return new ZoneListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", ZoneField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying license get options. - */ - class LicenseOption extends Option { - - private static final long serialVersionUID = -2968652076389846258L; - - private LicenseOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the license's fields to be returned by the RPC call. If this - * option is not provided, all license's fields are returned. {@code LicenseOption.fields} can - * be used to specify only the fields of interest. {@link License#getLicenseId()} is always - * returned, even if not specified. - */ - public static LicenseOption fields(LicenseField... fields) { - return new LicenseOption(ComputeRpc.Option.FIELDS, - Helper.selector(LicenseField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying operation get options. - */ - class OperationOption extends Option { - - private static final long serialVersionUID = -4572636917684779912L; - - private OperationOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the operation's fields to be returned by the RPC call. If this - * option is not provided, all operation's fields are returned. {@code OperationOption.fields} - * can be used to specify only the fields of interest. {@link Operation#getOperationId()} is - * always returned, even if not specified. - */ - public static OperationOption fields(OperationField... fields) { - return new OperationOption(ComputeRpc.Option.FIELDS, - Helper.selector(OperationField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying operation list options. - */ - class OperationListOption extends Option { - - private static final long serialVersionUID = -1509532420587265823L; - - private OperationListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the operations being listed. - */ - public static OperationListOption filter(OperationFilter filter) { - return new OperationListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of operations returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static OperationListOption pageSize(long pageSize) { - return new OperationListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing operations. - */ - public static OperationListOption pageToken(String pageToken) { - return new OperationListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the operation's fields to be returned by the RPC call. If this - * option is not provided, all operation's fields are returned. - * {@code OperationListOption.fields} can be used to specify only the fields of interest. - * {@link Operation#getOperationId()} is always returned, even if not specified. - */ - public static OperationListOption fields(OperationField... fields) { - return new OperationListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", OperationField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying address get options. - */ - class AddressOption extends Option { - - private static final long serialVersionUID = -5755491818692494389L; - - private AddressOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the address' fields to be returned by the RPC call. If this - * option is not provided, all address' fields are returned. {@code AddressOption.fields} can be - * used to specify only the fields of interest. {@link Address#getAddressId()} is always - * returned, even if not specified. - */ - public static AddressOption fields(AddressField... fields) { - return new AddressOption(ComputeRpc.Option.FIELDS, - Helper.selector(AddressField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying address list options. - */ - class AddressListOption extends Option { - - private static final long serialVersionUID = -4281322966374929346L; - - private AddressListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the addresses being listed. - */ - public static AddressListOption filter(AddressFilter filter) { - return new AddressListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of addresses returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static AddressListOption pageSize(long pageSize) { - return new AddressListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing addresses. - */ - public static AddressListOption pageToken(String pageToken) { - return new AddressListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the address' fields to be returned by the RPC call. If this - * option is not provided, all address' fields are returned. {@code AddressListOption.fields} - * can be used to specify only the fields of interest. {@link Address#getAddressId()} is always - * returned, even if not specified. - */ - public static AddressListOption fields(AddressField... fields) { - return new AddressListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", AddressField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying address aggregated list options. - */ - class AddressAggregatedListOption extends Option { - - private static final long serialVersionUID = -95538941541279561L; - - private AddressAggregatedListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the addresses being listed. - */ - public static AddressAggregatedListOption filter(AddressFilter filter) { - return new AddressAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of addresses returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static AddressAggregatedListOption pageSize(long pageSize) { - return new AddressAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing addresses. - */ - public static AddressAggregatedListOption pageToken(String pageToken) { - return new AddressAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - } - - /** - * Class for specifying snapshot get options. - */ - class SnapshotOption extends Option { - - private static final long serialVersionUID = -3505179459035500945L; - - private SnapshotOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this - * option is not provided, all the snapshot's fields are returned. {@code SnapshotOption.fields} - * can be used to specify only the fields of interest. {@link Snapshot#getSnapshotId()} is always - * returned, even if not specified. - */ - public static SnapshotOption fields(SnapshotField... fields) { - return new SnapshotOption(ComputeRpc.Option.FIELDS, - Helper.selector(SnapshotField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying snapshot list options. - */ - class SnapshotListOption extends Option { - - private static final long serialVersionUID = 8278588147660831257L; - - private SnapshotListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the snapshots being listed. - */ - public static SnapshotListOption filter(SnapshotFilter filter) { - return new SnapshotListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of snapshots returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static SnapshotListOption pageSize(long pageSize) { - return new SnapshotListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing snapshots. - */ - public static SnapshotListOption pageToken(String pageToken) { - return new SnapshotListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this - * option is not provided, all the snapshot's fields are returned. - * {@code SnapshotListOption.fields} can be used to specify only the fields of interest. - * {@link Snapshot#getSnapshotId()} is always returned, even if not specified. - */ - public static SnapshotListOption fields(SnapshotField... fields) { - return new SnapshotListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", SnapshotField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying image get options. - */ - class ImageOption extends Option { - - private static final long serialVersionUID = -7622190783089299272L; - - private ImageOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the image's fields to be returned by the RPC call. If this - * option is not provided, all image's fields are returned. {@code ImageOption.fields} can be - * used to specify only the fields of interest. {@link Image#getImageId()} and - * {@link Image#getConfiguration()} are always returned, even if not specified. - */ - public static ImageOption fields(ImageField... fields) { - return new ImageOption(ComputeRpc.Option.FIELDS, - Helper.selector(ImageField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying image list options. - */ - class ImageListOption extends Option { - - private static final long serialVersionUID = -4927977224287915654L; - - private ImageListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the images being listed. - */ - public static ImageListOption filter(ImageFilter filter) { - return new ImageListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of images returned per page. {@code pageSize} - * must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static ImageListOption pageSize(long pageSize) { - return new ImageListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing images. - */ - public static ImageListOption pageToken(String pageToken) { - return new ImageListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the image's fields to be returned by the RPC call. If this - * option is not provided, all image's fields are returned. {@code ImageListOption.fields} can - * be used to specify only the fields of interest. {@link Image#getImageId()} and - * {@link Image#getConfiguration()} are always returned, even if not specified. - */ - public static ImageListOption fields(ImageField... fields) { - return new ImageListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", ImageField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying disk get options. - */ - class DiskOption extends Option { - - private static final long serialVersionUID = -4354796876226661667L; - - private DiskOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the disk's fields to be returned by the RPC call. If this option - * is not provided, all disk's fields are returned. {@code DiskOption.fields} can be used to - * specify only the fields of interest. {@link Disk#getDiskId()}, - * {@link DiskConfiguration#getDiskType()} and either - * {@link SnapshotDiskConfiguration#getSourceSnapshot()} or - * {@link ImageDiskConfiguration#getSourceImage()} are always returned, even if not specified. - */ - public static DiskOption fields(DiskField... fields) { - return new DiskOption(ComputeRpc.Option.FIELDS, - Helper.selector(DiskField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying disk list options. - */ - class DiskListOption extends Option { - - private static final long serialVersionUID = -5148497888688645905L; - - private DiskListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the disks being listed. - */ - public static DiskListOption filter(DiskFilter filter) { - return new DiskListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of disks returned per page. {@code pageSize} - * must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static DiskListOption pageSize(long pageSize) { - return new DiskListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing disks. - */ - public static DiskListOption pageToken(String pageToken) { - return new DiskListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the disk's fields to be returned by the RPC call. If this option - * is not provided, all disk's fields are returned. {@code DiskListOption.fields} can be used to - * specify only the fields of interest. {@link Disk#getDiskId()}, - * {@link DiskConfiguration#getDiskType()} and either - * {@link SnapshotDiskConfiguration#getSourceSnapshot()} or - * {@link ImageDiskConfiguration#getSourceImage()} are always returned, even if not specified. - */ - public static DiskListOption fields(DiskField... fields) { - return new DiskListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", DiskField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying disk aggregated list options. - */ - class DiskAggregatedListOption extends Option { - - private static final long serialVersionUID = 1163784797870242766L; - - private DiskAggregatedListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the disks being listed. - */ - public static DiskAggregatedListOption filter(DiskFilter filter) { - return new DiskAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of disks returned per page. {@code pageSize} - * must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static DiskAggregatedListOption pageSize(long pageSize) { - return new DiskAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing disks. - */ - public static DiskAggregatedListOption pageToken(String pageToken) { - return new DiskAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - } - - /** - * Class for specifying subnetwork get options. - */ - class SubnetworkOption extends Option { - - private static final long serialVersionUID = 1994416967962074717L; - - private SubnetworkOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this - * option is not provided, all subnetwork's fields are returned. {@code SubnetworkOption.fields} - * can be used to specify only the fields of interest. {@link Subnetwork#getSubnetworkId()} is - * always returned, even if not specified. - */ - public static SubnetworkOption fields(SubnetworkField... fields) { - return new SubnetworkOption(ComputeRpc.Option.FIELDS, - Helper.selector(SubnetworkField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying subnetwork list options. - */ - class SubnetworkListOption extends Option { - - private static final long serialVersionUID = -2978666213373829606L; - - private SubnetworkListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the subnetworks being listed. - */ - public static SubnetworkListOption filter(SubnetworkFilter filter) { - return new SubnetworkListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of subnetworks returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static SubnetworkListOption pageSize(long pageSize) { - return new SubnetworkListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing subnetworks. - */ - public static SubnetworkListOption pageToken(String pageToken) { - return new SubnetworkListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this - * option is not provided, all subnetwork's fields are returned. - * {@code SubnetworListkOption.fields} can be used to specify only the fields of interest. - * {@link Subnetwork#getSubnetworkId()} is always returned, even if not specified. - */ - public static SubnetworkListOption fields(SubnetworkField... fields) { - return new SubnetworkListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", SubnetworkField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying subnetwork aggregated list options. - */ - class SubnetworkAggregatedListOption extends Option { - - private static final long serialVersionUID = -4033514850525545027L; - - private SubnetworkAggregatedListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the subnetworks being listed. - */ - public static SubnetworkAggregatedListOption filter(SubnetworkFilter filter) { - return new SubnetworkAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of subnetworks returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static SubnetworkAggregatedListOption pageSize(long pageSize) { - return new SubnetworkAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing subnetworks. - */ - public static SubnetworkAggregatedListOption pageToken(String pageToken) { - return new SubnetworkAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - } - - /** - * Class for specifying network get options. - */ - class NetworkOption extends Option { - - private static final long serialVersionUID = 5346750551643875754L; - - private NetworkOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the network's fields to be returned by the RPC call. If this - * option is not provided, all network's fields are returned. {@code NetworkOption.fields} - * can be used to specify only the fields of interest. {@link Network#getNetworkId()} and - * {@link Network#getConfiguration()} are always returned, even if not specified. - */ - public static NetworkOption fields(NetworkField... fields) { - return new NetworkOption(ComputeRpc.Option.FIELDS, - Helper.selector(NetworkField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying network list options. - */ - class NetworkListOption extends Option { - - private static final long serialVersionUID = -4291731916527773896L; - - private NetworkListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the networks being listed. - */ - public static NetworkListOption filter(NetworkFilter filter) { - return new NetworkListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of networks returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static NetworkListOption pageSize(long pageSize) { - return new NetworkListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing networks. - */ - public static NetworkListOption pageToken(String pageToken) { - return new NetworkListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the network's fields to be returned by the RPC call. If this - * option is not provided, all network's fields are returned. {@code NetworkListOption.fields} - * can be used to specify only the fields of interest. {@link Network#getNetworkId()} and - * {@link Network#getConfiguration()} are always returned, even if not specified. - */ - public static NetworkListOption fields(NetworkField... fields) { - return new NetworkListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", NetworkField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying instance get options. - */ - class InstanceOption extends Option { - - private static final long serialVersionUID = -5277658025892081493L; - - private InstanceOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify the instance's fields to be returned by the RPC call. If this - * option is not provided, all instance's fields are returned. {@code InstanceOption.fields} - * can be used to specify only the fields of interest. {@link Instance#getInstanceId()} is - * always returned, even if not specified. - */ - public static InstanceOption fields(InstanceField... fields) { - return new InstanceOption(ComputeRpc.Option.FIELDS, - Helper.selector(InstanceField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying instance list options. - */ - class InstanceListOption extends Option { - - private static final long serialVersionUID = -1096684312959047430L; - - private InstanceListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the instances being listed. - */ - public static InstanceListOption filter(InstanceFilter filter) { - return new InstanceListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of instances returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static InstanceListOption pageSize(long pageSize) { - return new InstanceListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing instances. - */ - public static InstanceListOption pageToken(String pageToken) { - return new InstanceListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - - /** - * Returns an option to specify the instance's fields to be returned by the RPC call. If this - * option is not provided, all instance's fields are returned. {@code InstanceListOption.fields} - * can be used to specify only the fields of interest. {@link Instance#getInstanceId()} is - * always returned, even if not specified. - */ - public static InstanceListOption fields(InstanceField... fields) { - return new InstanceListOption(ComputeRpc.Option.FIELDS, - Helper.listSelector("items", InstanceField.REQUIRED_FIELDS, fields)); - } - } - - /** - * Class for specifying instance aggregated list options. - */ - class InstanceAggregatedListOption extends Option { - - private static final long serialVersionUID = -2020005298975967713L; - - private InstanceAggregatedListOption(ComputeRpc.Option option, Object value) { - super(option, value); - } - - /** - * Returns an option to specify a filter on the instances being listed. - */ - public static InstanceAggregatedListOption filter(InstanceFilter filter) { - return new InstanceAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); - } - - /** - * Returns an option to specify the maximum number of instances returned per page. - * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. - */ - public static InstanceAggregatedListOption pageSize(long pageSize) { - return new InstanceAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); - } - - /** - * Returns an option to specify the page token from which to start listing instances. - */ - public static InstanceAggregatedListOption pageToken(String pageToken) { - return new InstanceAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); - } - } - - /** - * Returns the requested disk type or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - DiskType getDiskType(DiskTypeId diskTypeId, DiskTypeOption... options); - - /** - * Returns the requested disk type or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - DiskType getDiskType(String zone, String diskType, DiskTypeOption... options); - - /** - * Lists the disk types in the provided zone. - * - * @throws ComputeException upon failure - */ - Page listDiskTypes(String zone, DiskTypeListOption... options); - - /** - * Lists the disk types in all zones. - * - * @throws ComputeException upon failure - */ - Page listDiskTypes(DiskTypeAggregatedListOption... options); - - /** - * Returns the requested machine type or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - MachineType getMachineType(MachineTypeId machineTypeId, MachineTypeOption... options); - - /** - * Returns the requested machine type or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - MachineType getMachineType(String zone, String machineType, MachineTypeOption... options); - - /** - * Lists the machine types in the provided zone. - * - * @throws ComputeException upon failure - */ - Page listMachineTypes(String zone, MachineTypeListOption... options); - - /** - * Lists the machine types in all zones. - * - * @throws ComputeException upon failure - */ - Page listMachineTypes(MachineTypeAggregatedListOption... options); - - /** - * Returns the requested region or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Region getRegion(String region, RegionOption... options); - - /** - * Lists the regions. - * - * @throws ComputeException upon failure - */ - Page listRegions(RegionListOption... options); - - /** - * Returns the requested zone or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Zone getZone(String zone, ZoneOption... options); - - /** - * Lists the zones. - * - * @throws ComputeException upon failure - */ - Page listZones(ZoneListOption... options); - - /** - * Returns the requested license or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - License getLicense(String license, LicenseOption... options); - - /** - * Returns the requested license or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - License getLicense(LicenseId license, LicenseOption... options); - - /** - * Returns the requested operation or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Operation getOperation(OperationId operationId, OperationOption... options); - - /** - * Lists the global operations. - * - * @throws ComputeException upon failure - */ - Page listGlobalOperations(OperationListOption... options); - - /** - * Lists the operations for the provided region. These are operations that create/modify/delete - * resources that live in a region (e.g. subnetworks). - * - * @throws ComputeException upon failure - */ - Page listRegionOperations(String region, OperationListOption... options); - - /** - * Lists the operations for the provided zone. These are operations that create/modify/delete - * resources that live in a zone (e.g. instances). - * - * @throws ComputeException upon failure - */ - Page listZoneOperations(String zone, OperationListOption... options); - - /** - * Deletes the requested operation. Delete is only possible for operations that have completed - * their execution. Any attempt to delete a running operation will fail. - * - * @return {@code true} if operation was deleted, {@code false} if it was not found - * @throws ComputeException upon failure - */ - boolean deleteOperation(OperationId operation); - - /** - * Returns the requested address or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Address getAddress(AddressId addressId, AddressOption... options); - - /** - * Creates a new address. - * - * @return an operation for address' creation - * @throws ComputeException upon failure - */ - Operation create(AddressInfo address, OperationOption... options); - - /** - * Lists the global addresses. - * - * @throws ComputeException upon failure - */ - Page
listGlobalAddresses(AddressListOption... options); - - /** - * Lists the region addresses for the provided region. - * - * @throws ComputeException upon failure - */ - Page
listRegionAddresses(String region, AddressListOption... options); - - /** - * Lists both global and region addresses. - * - * @throws ComputeException upon failure - */ - Page
listAddresses(AddressAggregatedListOption... options); - - /** - * Deletes the requested address. - * - * @return an operation if the request was issued correctly, {@code null} if the address was not - * found - * @throws ComputeException upon failure - */ - Operation deleteAddress(AddressId addressId, OperationOption... options); - - /** - * Creates a new snapshot. - * - * @return a zone operation for snapshot creation - * @throws ComputeException upon failure - */ - Operation create(SnapshotInfo snapshot, OperationOption... options); - - /** - * Returns the requested snapshot or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Snapshot getSnapshot(String snapshot, SnapshotOption... options); - - /** - * Lists snapshots. - * - * @throws ComputeException upon failure - */ - Page listSnapshots(SnapshotListOption... options); - - /** - * Deletes the requested snapshot. Keep in mind that deleting a single snapshot might not - * necessarily delete all the data for that snapshot. If any data for the snapshot that is marked - * for deletion is needed for subsequent snapshots, the data will be moved to the next snapshot. - * - * @return a global operation if the request was issued correctly, {@code null} if the snapshot - * was not found - * @throws ComputeException upon failure - * @see - * Deleting a snapshot - */ - Operation deleteSnapshot(SnapshotId snapshot, OperationOption... options); - - /** - * Deletes the requested snapshot. Keep in mind that deleting a single snapshot might not - * necessarily delete all the data for 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 snapshot. - * - * @return a global operation if the request was issued correctly, {@code null} if the snapshot - * was not found - * @throws ComputeException upon failure - * @see - * Deleting a snapshot - */ - Operation deleteSnapshot(String snapshot, OperationOption... options); - - /** - * Creates a new image. - * - * @return a global operation for image's creation - * @throws ComputeException upon failure - */ - Operation create(ImageInfo image, OperationOption... options); - - /** - * Returns the requested image or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Image getImage(ImageId imageId, ImageOption... options); - - /** - * Lists images in the provided project that are available to the current user. This method can be - * used to list publicly-available images by providing the respective image project. Examples of - * image projects are: {@code centos-cloud}, {@code coreos-cloud}, {@code debian-cloud}, - * {@code opensuse-cloud}, {@code rhel-cloud}, {@code suse-cloud}, {@code ubuntu-os-cloud} and - * {@code windows-cloud}. Attempting to delete or deprecate a publicly-available image will fail. - * - * @throws ComputeException upon failure - * @see Operating Systems - */ - Page listImages(String project, ImageListOption... options); - - /** - * Lists images in the current project. - * - * @throws ComputeException upon failure - */ - Page listImages(ImageListOption... options); - - /** - * Deletes the requested image. - * - * @return a global operation if the delete request was issued correctly, {@code null} if the - * image was not found - * @throws ComputeException upon failure or if {@code image} is a publicly-available image - */ - Operation deleteImage(ImageId image, OperationOption... options); - - /** - * Deprecates the requested image. - * - * @return a global operation if the deprecation request was issued correctly, {@code null} if the - * image was not found - * @throws ComputeException upon failure or if {@code image} is a publicly-available image - */ - Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, - OperationOption... options); - - /** - * Returns the requested disk or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Disk getDisk(DiskId diskId, DiskOption... options); - - /** - * Creates a new disk. - * - * @return a zone operation for disk's creation - * @throws ComputeException upon failure - */ - Operation create(DiskInfo disk, OperationOption... options); - - /** - * Lists disks for the provided zone. - * - * @throws ComputeException upon failure - */ - Page listDisks(String zone, DiskListOption... options); - - /** - * Lists disks for all zones. - * - * @throws ComputeException upon failure - */ - Page listDisks(DiskAggregatedListOption... options); - - /** - * Deletes the requested disk. - * - * @return a zone operation if the request was issued correctly, {@code null} if the disk was not - * found - * @throws ComputeException upon failure - */ - Operation deleteDisk(DiskId disk, OperationOption... options); - - /** - * Resizes the disk to the requested size. The new size must be larger than the previous one. - * - * @return a zone operation if the request was issued correctly, {@code null} if the disk was not - * found - * @throws ComputeException upon failure or if the new disk size is smaller than the previous one - */ - Operation resize(DiskId disk, long sizeGb, OperationOption... options); - - /* - * Creates a new subnetwork. - * - * @return a region operation for subnetwork's creation - * @throws ComputeException upon failure - */ - Operation create(SubnetworkInfo subnetwork, OperationOption... options); - - /** - * Returns the requested subnetwork or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Subnetwork getSubnetwork(SubnetworkId subnetworkId, SubnetworkOption... options); - - /** - * Lists subnetworks for the provided region. - * - * @throws ComputeException upon failure - */ - Page listSubnetworks(String region, SubnetworkListOption... options); - - /** - * Lists subnetworks for all regions. - * - * @throws ComputeException upon failure - */ - Page listSubnetworks(SubnetworkAggregatedListOption... options); - - /** - * Deletes the requested subnetwork. Any attempt to delete an automatically created subnetwork - * will fail. - * - * @return a region operation if the delete request was issued correctly, {@code null} if the - * subnetwork was not found - * @throws ComputeException upon failure - */ - Operation deleteSubnetwork(SubnetworkId subnetwork, OperationOption... options); - - /** - * Creates a new network. - * - * @return a global operation for network's creation - * @throws ComputeException upon failure - */ - Operation create(NetworkInfo network, OperationOption... options); - - /** - * Returns the requested network or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Network getNetwork(String network, NetworkOption... options); - - /** - * Lists networks. - * - * @throws ComputeException upon failure - */ - Page listNetworks(NetworkListOption... options); - - /** - * Deletes the requested network. - * - * @return a global operation if the delete request was issued correctly, {@code null} if the - * network was not found - * @throws ComputeException upon failure - */ - Operation deleteNetwork(String network, OperationOption... options); - - /** - * Deletes the requested network. - * - * @return a global operation if the delete request was issued correctly, {@code null} if the - * network was not found - * @throws ComputeException upon failure - */ - Operation deleteNetwork(NetworkId network, OperationOption... options); - - /** - * Creates a new instance. - * - * @return a zone operation for instance's creation - * @throws ComputeException upon failure - */ - Operation create(InstanceInfo instance, OperationOption... options); - - /** - * Returns the requested instance or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Instance getInstance(InstanceId instance, InstanceOption... options); - - /** - * Lists instances for the provided zone. - * - * @throws ComputeException upon failure - */ - Page listInstances(String zone, InstanceListOption... options); - - /** - * Lists instances for all zones. - * - * @throws ComputeException upon failure - */ - Page listInstances(InstanceAggregatedListOption... options); - - /** - * Deletes the requested instance. - * - * @return a zone operation if the delete request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation deleteInstance(InstanceId instance, OperationOption... options); - - /** - * Adds an access configuration to an instance's network interface. - * - * @return a zone operation if the add request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation addAccessConfig(InstanceId instance, String networkInterface, AccessConfig accessConfig, - OperationOption... options); - - /** - * Attaches a persistent disk to an instance given its configuration. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation attachDisk(InstanceId instance, PersistentDiskConfiguration configuration, - OperationOption... options); - - /** - * Attaches a persistent disk to an instance given the device name and its configuration. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation attachDisk(InstanceId instance, String deviceName, - PersistentDiskConfiguration configuration, OperationOption... options); - - /** - * Attaches a persistent disk to an instance given the device name, its configuration and the - * device index. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation attachDisk(InstanceId instance, String deviceName, - PersistentDiskConfiguration configuration, int index, OperationOption... options); - - /** - * Deletes an access configuration from an instance's network interface. - * - * @return a zone operation if the delete request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation deleteAccessConfig(InstanceId instance, String networkInterface, String accessConfig, - OperationOption... options); - - /** - * Detaches a disk from an instance. - * - * @return a zone operation if the detach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation detachDisk(InstanceId instance, String deviceName, OperationOption... options); - - /** - * Returns the serial port output for the provided instance and port number. {@code port} must be - * between 1 and 4 (inclusive). - * - * @return the serial port output or {@code null} if the instance was not found - * @throws ComputeException upon failure - */ - String getSerialPortOutput(InstanceId instance, int port); - - /** - * Returns the default serial port output for the provided instance. Default serial port - * corresponds to port number 1. - * - * @return the serial port output or {@code null} if the instance was not found - * @throws ComputeException upon failure - */ - String getSerialPortOutput(InstanceId instance); - - /** - * Resets the provided instance. - * - * @return a zone operation if the reset request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation reset(InstanceId instance, OperationOption... options); - - /** - * Sets the auto-delete flag for a disk attached to the provided instance. - * - * @return a zone operation if the flag setting request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation setDiskAutoDelete(InstanceId instance, String deviceName, boolean autoDelete, - OperationOption... options); - - /** - * Sets the machine type for the provided instance. Instance must be in - * {@link InstanceInfo.Status#TERMINATED} state to be able to set its machine type. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setMachineType(InstanceId instance, MachineTypeId machineType, - OperationOption... options); - - /** - * Sets the metadata for the provided instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setMetadata(InstanceId instance, Metadata metadata, OperationOption... options); - - /** - * Sets the scheduling options for the provided instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setSchedulingOptions(InstanceId instance, SchedulingOptions scheduling, - OperationOption... options); - - /** - * Sets the tags for the provided instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setTags(InstanceId instance, Tags tags, OperationOption... options); - - /** - * Starts the provided instance. - * - * @return a zone operation if the start request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation start(InstanceId instance, OperationOption... options); - - /** - * Stops the provided instance. - * - * @return a zone operation if the stop request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation stop(InstanceId instance, OperationOption... options); -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java deleted file mode 100644 index 20ca52da6775..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.cloud.BaseServiceException; -import com.google.cloud.RetryHelper.RetryHelperException; -import com.google.cloud.http.BaseHttpServiceException; -import com.google.common.collect.ImmutableSet; -import java.io.IOException; -import java.util.Set; -import java.util.concurrent.ExecutionException; - -/** - * Compute Engine service exception. - */ -public class ComputeException extends BaseHttpServiceException { - - private static final Set RETRYABLE_ERRORS = ImmutableSet.of(new Error(500, null)); - private static final long serialVersionUID = -8039359778707845810L; - - ComputeException(int code, String message) { - super(code, message, null, true, RETRYABLE_ERRORS, null); - } - - ComputeException(int code, String message, Throwable cause) { - super(code, message, null, true, RETRYABLE_ERRORS, cause); - } - - public ComputeException(IOException exception) { - super(exception, true, RETRYABLE_ERRORS); - } - - /** - * Translate RetryHelperException to the ComputeException that caused the error. This method will - * always throw an exception. - * - * @throws ComputeException when {@code ex} was caused by a {@code ComputeException} - */ - static BaseServiceException translateAndThrow(RetryHelperException ex) { - BaseServiceException.translate(ex); - throw new ComputeException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); - } - - static BaseServiceException translateAndThrow(ExecutionException ex) { - BaseServiceException.translate(ex); - throw new ComputeException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java deleted file mode 100644 index 8ebf55517745..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.cloud.ServiceFactory; - -/** - * An interface for Compute factories. - */ -public interface ComputeFactory extends ServiceFactory { -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java deleted file mode 100644 index 8dfcdd5f5362..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java +++ /dev/null @@ -1,2058 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.cloud.RetryHelper.runWithRetries; -import static com.google.common.base.Preconditions.checkArgument; - -import com.google.api.gax.paging.Page; -import com.google.cloud.BaseService; -import com.google.cloud.PageImpl; -import com.google.cloud.PageImpl.NextPageFetcher; -import com.google.cloud.RetryHelper; -import com.google.cloud.Tuple; -import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; -import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; -import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; -import java.util.Map; -import java.util.concurrent.Callable; - -final class ComputeImpl extends BaseService implements Compute { - - private static class GlobalOperationPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -2488912172182315364L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - GlobalOperationPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listGlobalOperations(serviceOptions, requestOptions); - } - } - - private static class DiskTypePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -5253916264932522976L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String zone; - - DiskTypePageFetcher(String zone, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.zone = zone; - } - - @Override - public Page getNextPage() { - return listDiskTypes(zone, serviceOptions, requestOptions); - } - } - - private static class AggregatedDiskTypePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -1664743503750307996L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - AggregatedDiskTypePageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listDiskTypes(serviceOptions, requestOptions); - } - } - - private static class MachineTypePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -5048133000517001933L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String zone; - - MachineTypePageFetcher(String zone, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.zone = zone; - } - - @Override - public Page getNextPage() { - return listMachineTypes(zone, serviceOptions, requestOptions); - } - } - - private static class AggregatedMachineTypePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 2919227789802660026L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - AggregatedMachineTypePageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listMachineTypes(serviceOptions, requestOptions); - } - } - - private static class RegionPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 4180147045485258863L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - RegionPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listRegions(serviceOptions, requestOptions); - } - } - - private static class ZonePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -3946202621600687597L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - ZonePageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listZones(serviceOptions, requestOptions); - } - } - - private static class RegionOperationPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 4111705358926164078L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String region; - - RegionOperationPageFetcher(String region, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.region = region; - } - - @Override - public Page getNextPage() { - return listRegionOperations(region, serviceOptions, requestOptions); - } - } - - private static class ZoneOperationPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -9012504536518197793L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String zone; - - ZoneOperationPageFetcher(String zone, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.zone = zone; - } - - @Override - public Page getNextPage() { - return listZoneOperations(zone, serviceOptions, requestOptions); - } - } - - private static class GlobalAddressPageFetcher implements NextPageFetcher
{ - - private static final long serialVersionUID = -3832055341507574454L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - GlobalAddressPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page
getNextPage() { - return listGlobalAddresses(serviceOptions, requestOptions); - } - } - - private static class RegionAddressPageFetcher implements NextPageFetcher
{ - - private static final long serialVersionUID = 7080596594494397027L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String region; - - RegionAddressPageFetcher(String region, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.region = region; - } - - @Override - public Page
getNextPage() { - return listRegionAddresses(region, serviceOptions, requestOptions); - } - } - - private static class AggregatedAddressPageFetcher implements NextPageFetcher
{ - - private static final long serialVersionUID = -5798942282919494950L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - AggregatedAddressPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page
getNextPage() { - return listAddresses(serviceOptions, requestOptions); - } - } - - private static class SnapshotPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 6205774609802216986L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - SnapshotPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listSnapshots(serviceOptions, requestOptions); - } - } - - private static class ImagePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 6403679803137922023L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String project; - - ImagePageFetcher(String project, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.project = project; - } - - @Override - public Page getNextPage() { - return listImages(project, serviceOptions, requestOptions); - } - } - - private static class DiskPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 4146589787872718476L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String zone; - - DiskPageFetcher(String zone, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.zone = zone; - } - - @Override - public Page getNextPage() { - return listDisks(zone, serviceOptions, requestOptions); - } - } - - private static class AggregatedDiskPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = -5240045334115926206L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - AggregatedDiskPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listDisks(serviceOptions, requestOptions); - } - } - - private static class SubnetworkPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 3674038457884412651L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String region; - - SubnetworkPageFetcher(String region, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.region = region; - } - - @Override - public Page getNextPage() { - return listSubnetworks(region, serviceOptions, requestOptions); - } - } - - private static class AggregatedSubnetworkPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 771343548833894551L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - AggregatedSubnetworkPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listSubnetworks(serviceOptions, requestOptions); - } - } - - private static class NetworkPageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 5580210850353114531L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - NetworkPageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listNetworks(serviceOptions, requestOptions); - } - } - - private static class InstancePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 7563769742657453865L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - private final String zone; - - InstancePageFetcher(String zone, ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - this.zone = zone; - } - - @Override - public Page getNextPage() { - return listInstances(zone, serviceOptions, requestOptions); - } - } - - private static class AggregatedInstancePageFetcher implements NextPageFetcher { - - private static final long serialVersionUID = 1863059389783095681L; - private final Map requestOptions; - private final ComputeOptions serviceOptions; - - AggregatedInstancePageFetcher(ComputeOptions serviceOptions, String cursor, - Map optionMap) { - this.requestOptions = - PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); - this.serviceOptions = serviceOptions; - } - - @Override - public Page getNextPage() { - return listInstances(serviceOptions, requestOptions); - } - } - - private final ComputeRpc computeRpc; - - ComputeImpl(ComputeOptions options) { - super(options); - computeRpc = options.getComputeRpcV1(); - } - - @Override - public DiskType getDiskType(final DiskTypeId diskTypeId, DiskTypeOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.DiskType answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.DiskType call() { - return computeRpc.getDiskType(diskTypeId.getZone(), diskTypeId.getType(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : DiskType.fromPb(answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public DiskType getDiskType(String zone, String diskType, DiskTypeOption... options) { - return getDiskType(DiskTypeId.of(zone, diskType), options); - } - - @Override - public Page listDiskTypes(String zone, DiskTypeListOption... options) { - return listDiskTypes(zone, getOptions(), optionMap(options)); - } - - private static Page listDiskTypes(final String zone, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listDiskTypes(zone, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable diskTypes = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public DiskType apply(com.google.api.services.compute.model.DiskType diskType) { - return DiskType.fromPb(diskType); - } - }); - return new PageImpl<>(new DiskTypePageFetcher(zone, serviceOptions, cursor, optionsMap), - cursor, diskTypes); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listDiskTypes(DiskTypeAggregatedListOption... options) { - return listDiskTypes(getOptions(), optionMap(options)); - } - - private static Page listDiskTypes(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listDiskTypes(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable diskTypes = Iterables.transform(result.y(), - new Function() { - @Override - public DiskType apply(com.google.api.services.compute.model.DiskType diskType) { - return DiskType.fromPb(diskType); - } - }); - return new PageImpl<>(new AggregatedDiskTypePageFetcher(serviceOptions, cursor, optionsMap), - cursor, diskTypes); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public MachineType getMachineType(final MachineTypeId machineType, MachineTypeOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.MachineType answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.MachineType call() { - return computeRpc.getMachineType(machineType.getZone(), machineType.getType(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : MachineType.fromPb(answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public MachineType getMachineType(String zone, String machineType, MachineTypeOption... options) { - return getMachineType(MachineTypeId.of(zone, machineType), options); - } - - @Override - public Page listMachineTypes(String zone, MachineTypeListOption... options) { - return listMachineTypes(zone, getOptions(), optionMap(options)); - } - - private static Page listMachineTypes(final String zone, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listMachineTypes(zone, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable machineTypes = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public MachineType apply( - com.google.api.services.compute.model.MachineType machineType) { - return MachineType.fromPb(machineType); - } - }); - return new PageImpl<>(new MachineTypePageFetcher(zone, serviceOptions, cursor, optionsMap), - cursor, machineTypes); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listMachineTypes(MachineTypeAggregatedListOption... options) { - return listMachineTypes(getOptions(), optionMap(options)); - } - - private static Page listMachineTypes(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listMachineTypes(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable machineTypes = Iterables.transform(result.y(), - new Function() { - @Override - public MachineType apply( - com.google.api.services.compute.model.MachineType machineType) { - return MachineType.fromPb(machineType); - } - }); - return new PageImpl<>( - new AggregatedMachineTypePageFetcher(serviceOptions, cursor, optionsMap), cursor, - machineTypes); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Region getRegion(final String region, RegionOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Region answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Region call() { - return computeRpc.getRegion(region, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Region.fromPb(answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listRegions(RegionListOption... options) { - return listRegions(getOptions(), optionMap(options)); - } - - private static Page listRegions(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listRegions(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable regions = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public Region apply(com.google.api.services.compute.model.Region region) { - return Region.fromPb(region); - } - }); - return new PageImpl<>(new RegionPageFetcher(serviceOptions, cursor, optionsMap), cursor, - regions); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Zone getZone(final String zone, ZoneOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Zone answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Zone call() { - return computeRpc.getZone(zone, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Zone.fromPb(answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listZones(ZoneListOption... options) { - return listZones(getOptions(), optionMap(options)); - } - - private static Page listZones(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listZones(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable zones = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public Zone apply(com.google.api.services.compute.model.Zone zone) { - return Zone.fromPb(zone); - } - }); - return new PageImpl<>(new ZonePageFetcher(serviceOptions, cursor, optionsMap), cursor, zones); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public License getLicense(String license, LicenseOption... options) { - return getLicense(LicenseId.of(license), options); - } - - @Override - public License getLicense(LicenseId license, LicenseOption... options) { - final LicenseId completeId = license.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.License answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.License call() { - return computeRpc.getLicense(completeId.getProject(), completeId.getLicense(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : License.fromPb(answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation getOperation(final OperationId operationId, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - switch (operationId.getType()) { - case REGION: - RegionOperationId regionOperationId = (RegionOperationId) operationId; - return computeRpc.getRegionOperation(regionOperationId.getRegion(), - regionOperationId.getOperation(), optionsMap); - case ZONE: - ZoneOperationId zoneOperationId = (ZoneOperationId) operationId; - return computeRpc.getZoneOperation(zoneOperationId.getZone(), - zoneOperationId.getOperation(), optionsMap); - case GLOBAL: - return computeRpc.getGlobalOperation(operationId.getOperation(), optionsMap); - default: - throw new IllegalArgumentException("Unexpected operation identity type"); - } - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private static Function - operationFromPb(final ComputeOptions serviceOptions) { - return new Function() { - @Override - public Operation apply(com.google.api.services.compute.model.Operation operation) { - return Operation.fromPb(serviceOptions.getService(), operation); - } - }; - } - - @Override - public Page listGlobalOperations(OperationListOption... options) { - return listGlobalOperations(getOptions(), optionMap(options)); - } - - private static Page listGlobalOperations(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listGlobalOperations(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable operations = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), operationFromPb(serviceOptions)); - return new PageImpl<>(new GlobalOperationPageFetcher(serviceOptions, cursor, optionsMap), - cursor, operations); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listRegionOperations(String region, OperationListOption... options) { - return listRegionOperations(region, getOptions(), optionMap(options)); - } - - private static Page listRegionOperations(final String region, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listRegionOperations(region, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable operations = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), operationFromPb(serviceOptions)); - return new PageImpl<>(new RegionOperationPageFetcher(region, serviceOptions, cursor, - optionsMap), cursor, operations); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listZoneOperations(String zone, OperationListOption... options) { - return listZoneOperations(zone, getOptions(), optionMap(options)); - } - - private static Page listZoneOperations(final String zone, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listZoneOperations(zone, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable operations = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), operationFromPb(serviceOptions)); - return new PageImpl<>(new ZoneOperationPageFetcher(zone, serviceOptions, cursor, optionsMap), - cursor, operations); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public boolean deleteOperation(final OperationId operation) { - try { - return runWithRetries(new Callable() { - @Override - public Boolean call() { - switch (operation.getType()) { - case REGION: - RegionOperationId regionOperationId = (RegionOperationId) operation; - return computeRpc.deleteRegionOperation(regionOperationId.getRegion(), - regionOperationId.getOperation()); - case ZONE: - ZoneOperationId zoneOperationId = (ZoneOperationId) operation; - return computeRpc.deleteZoneOperation(zoneOperationId.getZone(), - zoneOperationId.getOperation()); - case GLOBAL: - return computeRpc.deleteGlobalOperation(operation.getOperation()); - default: - throw new IllegalArgumentException("Unexpected operation identity type"); - } - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Address getAddress(final AddressId addressId, AddressOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Address answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Address call() { - switch (addressId.getType()) { - case REGION: - RegionAddressId regionAddressId = (RegionAddressId) addressId; - return computeRpc.getRegionAddress(regionAddressId.getRegion(), - regionAddressId.getAddress(), optionsMap); - case GLOBAL: - return computeRpc.getGlobalAddress(addressId.getAddress(), optionsMap); - default: - throw new IllegalArgumentException("Unexpected address identity type"); - } - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Address.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation create(final AddressInfo address, OperationOption... options) { - final com.google.api.services.compute.model.Address addressPb = - address.setProjectId(getOptions().getProjectId()).toPb(); - final Map optionsMap = optionMap(options); - try { - return Operation.fromPb(this, - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - switch (address.getAddressId().getType()) { - case REGION: - RegionAddressId regionAddressId = address.getAddressId(); - return computeRpc.createRegionAddress(regionAddressId.getRegion(), addressPb, - optionsMap); - case GLOBAL: - return computeRpc.createGlobalAddress(addressPb, optionsMap); - default: - throw new IllegalArgumentException("Unexpected address identity type"); - } - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private static Function addressFromPb( - final ComputeOptions serviceOptions) { - return new Function() { - @Override - public Address apply(com.google.api.services.compute.model.Address address) { - return Address.fromPb(serviceOptions.getService(), address); - } - }; - } - - @Override - public Page
listGlobalAddresses(AddressListOption... options) { - return listGlobalAddresses(getOptions(), optionMap(options)); - } - - private static Page
listGlobalAddresses(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listGlobalAddresses(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable
operations = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), addressFromPb(serviceOptions)); - return new PageImpl<>(new GlobalAddressPageFetcher(serviceOptions, cursor, optionsMap), - cursor, operations); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page
listRegionAddresses(String region, AddressListOption... options) { - return listRegionAddresses(region, getOptions(), optionMap(options)); - } - - private static Page
listRegionAddresses(final String region, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listRegionAddresses(region, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable
operations = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), addressFromPb(serviceOptions)); - return new PageImpl<>(new RegionAddressPageFetcher(region, serviceOptions, cursor, - optionsMap), cursor, operations); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page
listAddresses(AddressAggregatedListOption... options) { - return listAddresses(getOptions(), optionMap(options)); - } - - private static Page
listAddresses(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listAddresses(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable
operations = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public Address apply(com.google.api.services.compute.model.Address address) { - return Address.fromPb(serviceOptions.getService(), address); - } - }); - return new PageImpl<>(new AggregatedAddressPageFetcher(serviceOptions, cursor, optionsMap), - cursor, operations); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteAddress(final AddressId addressId, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - switch (addressId.getType()) { - case REGION: - RegionAddressId regionAddressId = (RegionAddressId) addressId; - return computeRpc.deleteRegionAddress(regionAddressId.getRegion(), - regionAddressId.getAddress(), optionsMap); - case GLOBAL: - return computeRpc.deleteGlobalAddress(addressId.getAddress(), optionsMap); - default: - throw new IllegalArgumentException("Unexpected address identity type"); - } - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation create(SnapshotInfo snapshot, OperationOption... options) { - final SnapshotInfo completeSnapshot = snapshot.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.createSnapshot(completeSnapshot.getSourceDisk().getZone(), - completeSnapshot.getSourceDisk().getDisk(), - completeSnapshot.getSnapshotId().getSnapshot(), completeSnapshot.getDescription(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Snapshot getSnapshot(final String snapshot, SnapshotOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Snapshot answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Snapshot call() { - return computeRpc.getSnapshot(snapshot, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Snapshot.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listSnapshots(SnapshotListOption... options) { - return listSnapshots(getOptions(), optionMap(options)); - } - - private static Page listSnapshots(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listSnapshots(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable snapshots = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public Snapshot apply(com.google.api.services.compute.model.Snapshot snapshot) { - return Snapshot.fromPb(serviceOptions.getService(), snapshot); - } - }); - return new PageImpl<>(new SnapshotPageFetcher(serviceOptions, cursor, optionsMap), cursor, - snapshots); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteSnapshot(SnapshotId snapshot, OperationOption... options) { - return deleteSnapshot(snapshot.getSnapshot(), options); - } - - @Override - public Operation deleteSnapshot(final String snapshot, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteSnapshot(snapshot, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation create(ImageInfo image, OperationOption... options) { - final ImageInfo completeImage = image.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.createImage(completeImage.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Image getImage(ImageId imageId, ImageOption... options) { - final ImageId completeImageId = imageId.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Image answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Image call() { - return computeRpc.getImage(completeImageId.getProject(), completeImageId.getImage(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Image.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listImages(String project, ImageListOption... options) { - return listImages(project, getOptions(), optionMap(options)); - } - - @Override - public Page listImages(ImageListOption... options) { - return listImages(getOptions().getProjectId(), getOptions(), optionMap(options)); - } - - private static Page listImages(final String project, final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listImages(project, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable images = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public Image apply(com.google.api.services.compute.model.Image image) { - return Image.fromPb(serviceOptions.getService(), image); - } - }); - return new PageImpl<>(new ImagePageFetcher(project, serviceOptions, cursor, optionsMap), - cursor, images); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteImage(ImageId image, OperationOption... options) { - final ImageId completeId = image.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteImage(completeId.getProject(), completeId.getImage(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deprecate(ImageId image, - final DeprecationStatus deprecationStatus, OperationOption... options) { - final ImageId completeId = image.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deprecateImage(completeId.getProject(), completeId.getImage(), - deprecationStatus.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Disk getDisk(final DiskId diskId, DiskOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Disk answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Disk call() { - return computeRpc.getDisk(diskId.getZone(), diskId.getDisk(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Disk.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation create(final DiskInfo disk, OperationOption... options) { - final com.google.api.services.compute.model.Disk diskPb = - disk.setProjectId(getOptions().getProjectId()).toPb(); - final Map optionsMap = optionMap(options); - try { - return Operation.fromPb(this, - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.createDisk(disk.getDiskId().getZone(), diskPb, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private static Function diskFromPb( - final ComputeOptions serviceOptions) { - return new Function() { - @Override - public Disk apply(com.google.api.services.compute.model.Disk disk) { - return Disk.fromPb(serviceOptions.getService(), disk); - } - }; - } - - @Override - public Page listDisks(String zone, DiskListOption... options) { - return listDisks(zone, getOptions(), optionMap(options)); - } - - private static Page listDisks(final String zone, final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listDisks(zone, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable disks = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), diskFromPb(serviceOptions)); - return new PageImpl<>(new DiskPageFetcher(zone, serviceOptions, cursor, optionsMap), - cursor, disks); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listDisks(DiskAggregatedListOption... options) { - return listDisks(getOptions(), optionMap(options)); - } - - private static Page listDisks(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listDisks(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable disks = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), diskFromPb(serviceOptions)); - return new PageImpl<>(new AggregatedDiskPageFetcher(serviceOptions, cursor, optionsMap), - cursor, disks); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteDisk(final DiskId disk, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteDisk(disk.getZone(), disk.getDisk(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation resize(final DiskId disk, final long sizeGb, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.resizeDisk(disk.getZone(), disk.getDisk(), sizeGb, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation create(SubnetworkInfo subnetwork, OperationOption... options) { - final SubnetworkInfo completeSubnetwork = subnetwork.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.createSubnetwork(completeSubnetwork.getSubnetworkId().getRegion(), - completeSubnetwork.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Subnetwork getSubnetwork(final SubnetworkId subnetworkId, SubnetworkOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Subnetwork answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Subnetwork call() { - return computeRpc.getSubnetwork(subnetworkId.getRegion(), - subnetworkId.getSubnetwork(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Subnetwork.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private static Function - subnetworkFromPb(final ComputeOptions serviceOptions) { - return new Function() { - @Override - public Subnetwork apply(com.google.api.services.compute.model.Subnetwork subnetwork) { - return Subnetwork.fromPb(serviceOptions.getService(), subnetwork); - } - }; - } - - @Override - public Page listSubnetworks(String region, SubnetworkListOption... options) { - return listSubnetworks(region, getOptions(), optionMap(options)); - } - - private static Page listSubnetworks(final String region, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listSubnetworks(region, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable subnetworks = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), subnetworkFromPb(serviceOptions)); - return new PageImpl<>(new SubnetworkPageFetcher(region, serviceOptions, cursor, optionsMap), - cursor, subnetworks); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listSubnetworks(SubnetworkAggregatedListOption... options) { - return listSubnetworks(getOptions(), optionMap(options)); - } - - private static Page listSubnetworks(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listSubnetworks(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable subnetworks = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), subnetworkFromPb(serviceOptions)); - return new PageImpl<>(new AggregatedSubnetworkPageFetcher(serviceOptions, cursor, optionsMap), - cursor, subnetworks); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteSubnetwork(final SubnetworkId subnetwork, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteSubnetwork(subnetwork.getRegion(), subnetwork.getSubnetwork(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation create(NetworkInfo network, OperationOption... options) { - final NetworkInfo completeNetwork = network.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.createNetwork(completeNetwork.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Network getNetwork(final String network, NetworkOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Network answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Network call() { - return computeRpc.getNetwork(network, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Network.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listNetworks(NetworkListOption... options) { - return listNetworks(getOptions(), optionMap(options)); - } - - private static Page listNetworks(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listNetworks(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable networks = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), - new Function() { - @Override - public Network apply(com.google.api.services.compute.model.Network network) { - return Network.fromPb(serviceOptions.getService(), network); - } - }); - return new PageImpl<>(new NetworkPageFetcher(serviceOptions, cursor, optionsMap), - cursor, networks); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteNetwork(final NetworkId network, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteNetwork(network.getNetwork(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteNetwork(String network, OperationOption... options) { - return deleteNetwork(NetworkId.of(network)); - } - - @Override - public Operation create(InstanceInfo instance, OperationOption... options) { - final InstanceInfo completeInstance = instance.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.createInstance(completeInstance.getInstanceId().getZone(), - completeInstance.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Instance getInstance(final InstanceId instance, InstanceOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Instance answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Instance call() { - return computeRpc.getInstance(instance.getZone(), instance.getInstance(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Instance.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private static Function - instanceFromPb(final ComputeOptions serviceOptions) { - return new Function() { - @Override - public Instance apply(com.google.api.services.compute.model.Instance instance) { - return Instance.fromPb(serviceOptions.getService(), instance); - } - }; - } - - @Override - public Page listInstances(String zone, InstanceListOption... options) { - return listInstances(zone, getOptions(), optionMap(options)); - } - - private static Page listInstances(final String zone, - final ComputeOptions serviceOptions, final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listInstances(zone, optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable instances = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), instanceFromPb(serviceOptions)); - return new PageImpl<>(new InstancePageFetcher(zone, serviceOptions, cursor, optionsMap), - cursor, instances); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Page listInstances(InstanceAggregatedListOption... options) { - return listInstances(getOptions(), optionMap(options)); - } - - private static Page listInstances(final ComputeOptions serviceOptions, - final Map optionsMap) { - try { - Tuple> result = - runWithRetries(new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions.getComputeRpcV1().listInstances(optionsMap); - } - }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); - String cursor = result.x(); - Iterable instances = Iterables.transform( - result.y() == null ? ImmutableList.of() - : result.y(), instanceFromPb(serviceOptions)); - return new PageImpl<>(new AggregatedInstancePageFetcher(serviceOptions, cursor, optionsMap), - cursor, instances); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation deleteInstance(final InstanceId instance, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteInstance(instance.getZone(), instance.getInstance(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation addAccessConfig(final InstanceId instance, final String networkInterface, - final AccessConfig accessConfig, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.addAccessConfig(instance.getZone(), instance.getInstance(), - networkInterface, accessConfig.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private Operation attachDisk(final InstanceId instance, AttachedDisk diskToAttach, - OperationOption... options) { - final AttachedDisk completeDisk = diskToAttach.setProjectId(getOptions().getProjectId()); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.attachDisk(instance.getZone(), instance.getInstance(), - completeDisk.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation attachDisk(InstanceId instance, PersistentDiskConfiguration configuration, - OperationOption... options) { - return attachDisk(instance, AttachedDisk.of(configuration), options); - } - - @Override - public Operation attachDisk(InstanceId instance, String deviceName, - PersistentDiskConfiguration configuration, OperationOption... options) { - return attachDisk(instance, AttachedDisk.of(deviceName, configuration), options); - } - - @Override - public Operation attachDisk(InstanceId instance, String deviceName, - PersistentDiskConfiguration configuration, int index, OperationOption... options) { - AttachedDisk attachedDisk = AttachedDisk.newBuilder(configuration) - .setDeviceName(deviceName) - .setIndex(index) - .build(); - return attachDisk(instance, attachedDisk, options); - } - - @Override - public Operation deleteAccessConfig(final InstanceId instance, final String networkInterface, - final String accessConfig, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.deleteAccessConfig(instance.getZone(), instance.getInstance(), - networkInterface, accessConfig, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation detachDisk(final InstanceId instance, final String deviceName, - OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.detachDisk(instance.getZone(), instance.getInstance(), deviceName, - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public String getSerialPortOutput(final InstanceId instance, final int port) { - try { - return runWithRetries(new Callable() { - @Override - public String call() { - return computeRpc.getSerialPortOutput(instance.getZone(), instance.getInstance(), port, - optionMap()); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public String getSerialPortOutput(final InstanceId instance) { - try { - return runWithRetries(new Callable() { - @Override - public String call() { - return computeRpc.getSerialPortOutput(instance.getZone(), instance.getInstance(), null, - optionMap()); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation reset(final InstanceId instance, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.reset(instance.getZone(), instance.getInstance(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation setDiskAutoDelete(final InstanceId instance, final String deviceName, - final boolean autoDelete, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.setDiskAutoDelete(instance.getZone(), instance.getInstance(), - deviceName, autoDelete, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation setMachineType(final InstanceId instance, final MachineTypeId machineType, - OperationOption... options) { - final String machineTypeUrl = - machineType.setProjectId(getOptions().getProjectId()).getSelfLink(); - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.setMachineType(instance.getZone(), instance.getInstance(), - machineTypeUrl, optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation setMetadata(final InstanceId instance, final Metadata metadata, - OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.setMetadata(instance.getZone(), instance.getInstance(), - metadata.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation setSchedulingOptions(final InstanceId instance, - final SchedulingOptions schedulingOptions, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.setScheduling(instance.getZone(), instance.getInstance(), - schedulingOptions.toPb(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation setTags(final InstanceId instance, final Tags tags, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.setTags(instance.getZone(), instance.getInstance(), tags.toPb(), - optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation start(final InstanceId instance, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.start(instance.getZone(), instance.getInstance(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - @Override - public Operation stop(final InstanceId instance, OperationOption... options) { - final Map optionsMap = optionMap(options); - try { - com.google.api.services.compute.model.Operation answer = - runWithRetries(new Callable() { - @Override - public com.google.api.services.compute.model.Operation call() { - return computeRpc.stop(instance.getZone(), instance.getInstance(), optionsMap); - } - }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return answer == null ? null : Operation.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { - throw ComputeException.translateAndThrow(e); - } - } - - private Map optionMap(Option... options) { - Map optionMap = Maps.newEnumMap(ComputeRpc.Option.class); - for (Option option : options) { - Object prev = optionMap.put(option.getRpcOption(), option.getValue()); - checkArgument(prev == null, "Duplicate option %s", option); - } - return optionMap; - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java deleted file mode 100644 index a92389ef880d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.cloud.http.HttpTransportOptions; -import com.google.cloud.ServiceDefaults; -import com.google.cloud.ServiceOptions; -import com.google.cloud.ServiceRpc; -import com.google.cloud.TransportOptions; -import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; -import com.google.cloud.compute.deprecated.spi.ComputeRpcFactory; -import com.google.cloud.compute.deprecated.spi.v1.HttpComputeRpc; -import com.google.common.collect.ImmutableSet; - -import java.util.Set; - -public class ComputeOptions extends ServiceOptions { - - private static final String API_SHORT_NAME = "Compute"; - private static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute"; - private static final Set SCOPES = ImmutableSet.of(COMPUTE_SCOPE); - private static final long serialVersionUID = 6983703596543425691L; - - public static class DefaultComputeFactory implements ComputeFactory { - - private static final ComputeFactory INSTANCE = new DefaultComputeFactory(); - - @Override - public Compute create(ComputeOptions options) { - return new ComputeImpl(options); - } - } - - public static class DefaultComputeRpcFactory implements ComputeRpcFactory { - - private static final ComputeRpcFactory INSTANCE = new DefaultComputeRpcFactory(); - - @Override - public ServiceRpc create(ComputeOptions options) { - return new HttpComputeRpc(options); - } - } - - public static class Builder extends - ServiceOptions.Builder { - - private Builder() { - } - - private Builder(ComputeOptions options) { - super(options); - } - - @Override - public Builder setTransportOptions(TransportOptions transportOptions) { - if (!(transportOptions instanceof HttpTransportOptions)) { - throw new IllegalArgumentException( - "Only http transport is allowed for " + API_SHORT_NAME + "."); - } - return super.setTransportOptions(transportOptions); - } - - @Override - public ComputeOptions build() { - return new ComputeOptions(this); - } - } - - private ComputeOptions(Builder builder) { - super(ComputeFactory.class, ComputeRpcFactory.class, builder, new ComputeDefaults()); - } - - private static class ComputeDefaults implements - ServiceDefaults { - - @Override - public ComputeFactory getDefaultServiceFactory() { - return DefaultComputeFactory.INSTANCE; - } - - @Override - public ComputeRpcFactory getDefaultRpcFactory() { - return DefaultComputeRpcFactory.INSTANCE; - } - - @Override - public TransportOptions getDefaultTransportOptions() { - return getDefaultHttpTransportOptions(); - } - } - - public static HttpTransportOptions getDefaultHttpTransportOptions() { - return HttpTransportOptions.newBuilder().build(); - } - - @Override - protected Set getScopes() { - return SCOPES; - } - - protected ComputeRpc getComputeRpcV1() { - return (ComputeRpc) getRpc(); - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public int hashCode() { - return baseHashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ComputeOptions)) { - return false; - } - ComputeOptions other = (ComputeOptions) obj; - return baseEquals(other); - } - - public static ComputeOptions getDefaultInstance() { - return newBuilder().build(); - } - - public static Builder newBuilder() { - return new Builder(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java deleted file mode 100644 index aee07c7617d9..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.util.Objects; - -/** - * The deprecation status associated to a Google Compute Engine resource. - * - * @param The Google Compute Engine resource identity to which the deprecation status refers - */ -public final class DeprecationStatus implements Serializable { - - private static final long serialVersionUID = -2695077634793679794L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private static final DateTimeFormatter TIMESTAMP_PARSER = ISODateTimeFormat.dateTimeParser(); - - private final String deleted; - private final String deprecated; - private final String obsolete; - private final T replacement; - private final Status status; - - /** - * The deprecation status of a Google Compute Engine resource. - */ - public enum Status { - /** - * Operations that create a Google Compute Engine entity using a deprecated resource will return - * successfully but with a warning indicating the deprecation and suggesting a replacement. - */ - DEPRECATED, - - /** - * Operations that create a Google Compute Engine entity using an obsolete resource will be - * rejected and result in an error. - */ - OBSOLETE, - - /** - * Operations that create a Google Compute Engine entity using a deleted resource will be - * rejected and result in an error. - */ - DELETED - } - - /** - * A builder for {@code DeprecationStatus} objects. - * - * @param The Google Compute Engine resource identity to which the deprecation status refers - */ - public static final class Builder { - - private String deleted; - private String deprecated; - private String obsolete; - private T replacement; - private Status status; - - Builder() {} - - Builder(DeprecationStatus deprecationStatus) { - this.deleted = deprecationStatus.deleted; - this.deprecated = deprecationStatus.deprecated; - this.obsolete = deprecationStatus.obsolete; - this.replacement = deprecationStatus.replacement; - this.status = deprecationStatus.status; - } - - /** - * Sets the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#DELETED}. Timestamp should be in RFC3339 format. - * - * @see RFC3339 - */ - // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) - Builder setDeleted(String deleted) { - this.deleted = deleted; - return this; - } - - /** - * Sets the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#DEPRECATED}. Timestamp should be in RFC3339 format. - * - * @see RFC3339 - */ - // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) - Builder setDeprecated(String deprecated) { - this.deprecated = deprecated; - return this; - } - - /** - * Sets the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#OBSOLETE}. Timestamp should be in RFC3339 format. - * - * @see RFC3339 - */ - // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) - Builder setObsolete(String obsolete) { - this.obsolete = obsolete; - return this; - } - - /** - * Sets the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#DELETED}. In milliseconds since epoch. - */ - public Builder setDeleted(long deleted) { - this.deleted = TIMESTAMP_FORMATTER.print(deleted); - return this; - } - - /** - * Sets the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#DEPRECATED}. In milliseconds since epoch. - */ - public Builder setDeprecated(long deprecated) { - this.deprecated = TIMESTAMP_FORMATTER.print(deprecated); - return this; - } - - /** - * Sets the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#OBSOLETE}. In milliseconds since epoch. - */ - public Builder setObsolete(long obsolete) { - this.obsolete = TIMESTAMP_FORMATTER.print(obsolete); - return this; - } - - /** - * Sets the identity of the suggested replacement for a deprecated resource. The suggested - * replacement resource must be the same kind of resource as the deprecated resource. - */ - public Builder setReplacement(T replacement) { - this.replacement = replacement; - return this; - } - - /** - * Sets the status of the deprecated resource. - */ - public Builder setStatus(Status status) { - this.status = checkNotNull(status); - return this; - } - - /** - * Creates a {@code DeprecationStatus} object. - */ - public DeprecationStatus build() { - return new DeprecationStatus(this); - } - } - - DeprecationStatus(Builder builder) { - this.deleted = builder.deleted; - this.deprecated = builder.deprecated; - this.obsolete = builder.obsolete; - this.replacement = builder.replacement; - this.status = checkNotNull(builder.status); - } - - /** - * Returns the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#DELETED}. Returns {@code null} if not set. This value should be in RFC3339 - * format. - * - * @see RFC3339 - */ - // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) - public String getDeleted() { - return deleted; - } - - /** - * Returns the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#DEPRECATED}. Returns {@code null} if not set. This value should be in RFC3339 - * format. - * - * @see RFC3339 - */ - // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) - public String getDeprecated() { - return deprecated; - } - - /** - * Returns the timestamp on or after which the deprecation state of this resource will be changed - * to {@link Status#OBSOLETE}. Returns {@code null} if not set. This value should be in RFC3339 - * format. - * - * @see RFC3339 - */ - // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) - public String getObsolete() { - return obsolete; - } - - /** - * Returns the timestamp (in milliseconds since epoch) on or after which the deprecation state of - * this resource will be changed to {@link Status#DELETED}. Returns {@code null} if not set. - * - * @throws IllegalStateException if {@link #getDeleted()} is not a valid date, time or datetime - */ - public Long getDeletedMillis() { - try { - return deleted != null ? TIMESTAMP_PARSER.parseMillis(deleted) : null; - } catch (IllegalArgumentException ex) { - throw new IllegalStateException(ex.getMessage(), ex); - } - } - - /** - * Returns the timestamp (in milliseconds since epoch) on or after which the deprecation state of - * this resource will be changed to {@link Status#DEPRECATED}. Returns {@code null} if not set. - * - * @throws IllegalStateException if {@link #getDeprecated()} is not a valid date, time or datetime - */ - public Long getDeprecatedMillis() { - try { - return deprecated != null ? TIMESTAMP_PARSER.parseMillis(deprecated) : null; - } catch (IllegalArgumentException ex) { - throw new IllegalStateException(ex.getMessage(), ex); - } - } - - /** - * Returns the timestamp (in milliseconds since epoch) on or after which the deprecation state of - * this resource will be changed to {@link Status#OBSOLETE}. Returns {@code null} if not set. - * - * @throws IllegalStateException if {@link #getObsolete()} is not a valid date, time or datetime - */ - public Long getObsoleteMillis() { - try { - return obsolete != null ? TIMESTAMP_PARSER.parseMillis(obsolete) : null; - } catch (IllegalArgumentException ex) { - throw new IllegalStateException(ex.getMessage(), ex); - } - } - - /** - * Returns the identity of the suggested replacement for a deprecated resource. The suggested - * replacement resource must be the same kind of resource as the deprecated resource. - */ - public T getReplacement() { - return replacement; - } - - /** - * Returns the deprecation state of this resource. - */ - public Status getStatus() { - return status; - } - - /** - * Returns a builder for the {@code DeprecationStatus} object. - */ - public Builder toBuilder() { - return new Builder<>(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("deleted", deleted) - .add("deprecated", deprecated) - .add("obsolete", obsolete) - .add("replacement", replacement) - .add("status", status) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(deleted, deprecated, obsolete, replacement, status); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj instanceof DeprecationStatus - && Objects.equals(toPb(), ((DeprecationStatus) obj).toPb()); - } - - com.google.api.services.compute.model.DeprecationStatus toPb() { - com.google.api.services.compute.model.DeprecationStatus deprecationStatusPb = - new com.google.api.services.compute.model.DeprecationStatus(); - deprecationStatusPb.setDeleted(deleted); - deprecationStatusPb.setDeprecated(deprecated); - deprecationStatusPb.setObsolete(obsolete); - deprecationStatusPb.setReplacement(replacement.getSelfLink()); - deprecationStatusPb.setState(status.name()); - return deprecationStatusPb; - } - - /** - * Returns the builder for a {@code DeprecationStatus} object given the status. - */ - public static Builder newBuilder(Status status) { - return new Builder().setStatus(status); - } - - /** - * Returns the builder for a {@code DeprecationStatus} object given the status and replacement's - * identity. - */ - public static Builder newBuilder(Status status, T replacement) { - return new Builder().setStatus(status).setReplacement(replacement); - } - - /** - * Returns a {@code DeprecationStatus} object given the status and replacement's identity. - */ - public static DeprecationStatus of(Status status, T replacement) { - return newBuilder(status, replacement).build(); - } - - static DeprecationStatus fromPb( - com.google.api.services.compute.model.DeprecationStatus deprecationStatusPb, - Function fromUrl) { - Builder builder = new Builder<>(); - builder.setDeleted(deprecationStatusPb.getDeleted()); - builder.setDeprecated(deprecationStatusPb.getDeprecated()); - builder.setObsolete(deprecationStatusPb.getObsolete()); - if (deprecationStatusPb.getReplacement() != null) { - builder.setReplacement(fromUrl.apply(deprecationStatusPb.getReplacement())); - } - if (deprecationStatusPb.getState() != null) { - builder.setStatus(Status.valueOf(deprecationStatusPb.getState())); - } - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java deleted file mode 100644 index 4a64422151c7..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.Compute.DiskOption; -import com.google.cloud.compute.deprecated.Compute.OperationOption; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine persistent disk. A disk can be used as primary storage for your virtual - * machine instances. Objects of this class are immutable. To get a {@code Disk} object with the - * most recent information use {@link #reload}. {@code Disk} adds a layer of service-related - * functionality over {@link DiskInfo}. - * - * @see Block Storage - */ -public class Disk extends DiskInfo { - - private static final long serialVersionUID = 7234747955588262204L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Disk} objects. - */ - public static class Builder extends DiskInfo.Builder { - - private final Compute compute; - private final DiskInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, DiskId diskId, DiskConfiguration diskConfiguration) { - this.compute = compute; - this.infoBuilder = new DiskInfo.BuilderImpl(diskId, diskConfiguration); - } - - Builder(Disk disk) { - this.compute = disk.compute; - this.infoBuilder = new DiskInfo.BuilderImpl(disk); - } - - @Override - Builder setGeneratedId(String generatedId) { - infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - public Builder setConfiguration(DiskConfiguration configuration) { - infoBuilder.setConfiguration(configuration); - return this; - } - - @Override - public Builder setDiskId(DiskId diskId) { - infoBuilder.setDiskId(diskId); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - infoBuilder.setCreationTimestamp(creationTimestamp); - return this; - } - - @Override - Builder setCreationStatus(CreationStatus creationStatus) { - infoBuilder.setCreationStatus(creationStatus); - return this; - } - - @Override - public Builder setDescription(String description) { - infoBuilder.setDescription(description); - return this; - } - - @Override - Builder setLicenses(List licenses) { - infoBuilder.setLicenses(licenses); - return this; - } - - @Override - Builder setAttachedInstances(List attachedInstances) { - infoBuilder.setAttachedInstances(attachedInstances); - return this; - } - - @Override - Builder setLastAttachTimestamp(Long lastAttachTimestamp) { - infoBuilder.setLastAttachTimestamp(lastAttachTimestamp); - return this; - } - - @Override - Builder setLastDetachTimestamp(Long lastDetachTimestamp) { - infoBuilder.setLastDetachTimestamp(lastDetachTimestamp); - return this; - } - - @Override - public Disk build() { - return new Disk(compute, infoBuilder); - } - } - - Disk(Compute compute, DiskInfo.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this disk exists. - * - * @return {@code true} if this disk exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(DiskOption.fields()) != null; - } - - /** - * Fetches current disk's latest information. Returns {@code null} if the disk does not exist. - * - * @param options disk options - * @return a {@code Disk} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Disk reload(DiskOption... options) { - return compute.getDisk(getDiskId(), options); - } - - /** - * Deletes this disk. - * - * @return a zone operation if the delete request was successfully sent, {@code null} if the disk - * was not found - * @throws ComputeException upon failure - */ - public Operation delete(OperationOption... options) { - return compute.deleteDisk(getDiskId(), options); - } - - /** - * Creates a snapshot for this disk given the snapshot's name. - * - * @return a zone operation for snapshot creation - * @throws ComputeException upon failure - */ - public Operation createSnapshot(String snapshot, OperationOption... options) { - return compute.create(SnapshotInfo.of(SnapshotId.of(snapshot), getDiskId()), options); - } - - /** - * Creates a snapshot for this disk given the snapshot's name and description. - * - * @return a zone operation for snapshot creation - * @throws ComputeException upon failure - */ - public Operation createSnapshot(String snapshot, String description, OperationOption... options) { - SnapshotInfo snapshotInfo = SnapshotInfo.newBuilder(SnapshotId.of(snapshot), getDiskId()) - .setDescription(description) - .build(); - return compute.create(snapshotInfo, options); - } - - /** - * Creates an image for this disk given the image's name. - * - * @return a global operation if the image creation was successfully requested - * @throws ComputeException upon failure - */ - public Operation createImage(String image, OperationOption... options) { - ImageInfo imageInfo = ImageInfo.of(ImageId.of(image), DiskImageConfiguration.of(getDiskId())); - return compute.create(imageInfo, options); - } - - /** - * Creates an image for this disk given the image's name and description. - * - * @return a global operation if the image creation was successfully requested - * @throws ComputeException upon failure - */ - public Operation createImage(String image, String description, OperationOption... options) { - ImageInfo imageInfo = - ImageInfo.newBuilder(ImageId.of(image), DiskImageConfiguration.of(getDiskId())) - .setDescription(description) - .build(); - return compute.create(imageInfo, options); - } - - /** - * Resizes this disk to the requested size. The new size must be larger than the previous one. - * - * @return a zone operation if the resize request was issued correctly, {@code null} if this disk - * was not found - * @throws ComputeException upon failure or if the new disk size is smaller than the previous one - */ - public Operation resize(long sizeGb, OperationOption... options) { - return compute.resize(getDiskId(), sizeGb, options); - } - - /** - * Returns the disk's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Disk.class)) { - return false; - } - Disk other = (Disk) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Disk fromPb(Compute compute, com.google.api.services.compute.model.Disk diskPb) { - return new Disk(compute, new DiskInfo.BuilderImpl(diskPb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java deleted file mode 100644 index 0f08c7c7a1be..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.services.compute.model.Disk; -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; - -import java.io.Serializable; -import java.util.Objects; - -/** - * Base class for Google Compute Engine disk configurations. A disk can be used as primary storage - * for your virtual machine instances. Use {@link StandardDiskConfiguration} to create a standard - * disk given a disk type and size. Use {@link ImageDiskConfiguration} to create a disk from a - * Compute Engine disk image. Use {@link SnapshotDiskConfiguration} to create a disk from a Compute - * Engine disk snapshot. - * - * @see Block Storage - */ -public abstract class DiskConfiguration implements Serializable { - - private static final long serialVersionUID = -1783061701255428417L; - - private final Type type; - private final Long sizeGb; - private final DiskTypeId diskType; - - /** - * Type of a Google Compute Engine disk configuration. - */ - public enum Type { - /** - * A Google Compute Engine standard disk configuration. - */ - STANDARD, - - /** - * A Google Compute Engine disk configuration that creates a disk from an image. - */ - IMAGE, - - /** - * A Google Compute Engine disk configuration that creates a disk from a snapshot. - */ - SNAPSHOT - } - - /** - * Base builder for disk configurations. - * - * @param the disk configuration type - * @param the disk configuration builder - */ - public abstract static class Builder> { - - private Type type; - private Long sizeGb; - private DiskTypeId diskType; - - Builder(Type type) { - this.type = type; - } - - Builder(DiskConfiguration diskConfiguration) { - this.type = diskConfiguration.type; - this.sizeGb = diskConfiguration.sizeGb; - this.diskType = diskConfiguration.diskType; - } - - Builder(Type type, Disk diskPb) { - this.type = type; - this.sizeGb = diskPb.getSizeGb(); - if (diskPb.getType() != null) { - this.diskType = DiskTypeId.fromUrl(diskPb.getType()); - } - } - - @SuppressWarnings("unchecked") - protected B self() { - return (B) this; - } - - B setType(Type type) { - this.type = type; - return self(); - } - - /** - * Sets the size of the persistent disk, in GB. - */ - public B setSizeGb(Long sizeGb) { - this.sizeGb = sizeGb; - return self(); - } - - /** - * Sets the identity of the disk type. If not set {@code pd-standard} will be used. - */ - public B setDiskType(DiskTypeId diskType) { - this.diskType = diskType; - return self(); - } - - /** - * Creates an object. - */ - public abstract T build(); - } - - DiskConfiguration(Builder builder) { - this.type = builder.type; - this.sizeGb = builder.sizeGb; - this.diskType = builder.diskType; - } - - /** - * Returns the disk configuration's type. This method returns {@link Type#STANDARD} for a standard - * configuration that creates a disk given its type and size. This method returns - * {@link Type#SNAPSHOT} for a configuration that creates a disk from a Google Compute Engine - * snapshot. This method returns {@link Type#IMAGE} for a configuration that creates a disk - * from a Google Compute Engine image. - */ - public Type getType() { - return type; - } - - /** - * Returns the size of the persistent disk, in GB. - */ - public Long getSizeGb() { - return sizeGb; - } - - /** - * Returns the identity of the disk type. - */ - public DiskTypeId getDiskType() { - return diskType; - } - - /** - * Returns a builder for the object. - */ - public abstract Builder toBuilder(); - - ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this) - .add("type", type) - .add("sizeGb", sizeGb) - .add("diskType", diskType); - } - - @Override - public String toString() { - return toStringHelper().toString(); - } - - final int baseHashCode() { - return Objects.hash(type, sizeGb, diskType); - } - - final boolean baseEquals(DiskConfiguration diskConfiguration) { - return diskConfiguration != null - && getClass().equals(diskConfiguration.getClass()) - && Objects.equals(toPb(), diskConfiguration.toPb()); - } - - abstract DiskConfiguration setProjectId(String projectId); - - Disk toPb() { - Disk diskPb = new Disk(); - diskPb.setSizeGb(sizeGb); - if (diskType != null) { - diskPb.setType(diskType.getSelfLink()); - } - return diskPb; - } - - @SuppressWarnings("unchecked") - static T fromPb(Disk diskPb) { - if (diskPb.getSourceImage() != null) { - return (T) ImageDiskConfiguration.fromPb(diskPb); - } else if (diskPb.getSourceSnapshot() != null) { - return (T) SnapshotDiskConfiguration.fromPb(diskPb); - } - return (T) StandardDiskConfiguration.fromPb(diskPb); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java deleted file mode 100644 index b5e7004c0af0..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine disk. - */ -public final class DiskId extends ResourceId { - - private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/disks/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -8761290740495870787L; - - private final String zone; - private final String disk; - - private DiskId(String project, String zone, String disk) { - super(project); - this.zone = checkNotNull(zone); - this.disk = checkNotNull(disk); - } - - /** - * Returns the name of the zone this disk belongs to. - */ - public String getZone() { - return zone; - } - - /** - * Returns the identity of the zone this disk belongs to. - */ - public ZoneId getZoneId() { - return ZoneId.of(getProject(), zone); - } - - /** - * Returns the name of the disk. The name must be 1-63 characters long and comply with RFC1035. - * Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} - * which means the first character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getDisk() { - return disk; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/zones/" + zone + "/disks/" + disk; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("zone", zone).add("disk", disk); - } - - @Override - public int hashCode() { - return Objects.hash(super.baseHashCode(), zone, disk); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof DiskId)) { - return false; - } - DiskId other = (DiskId) obj; - return baseEquals(other) - && Objects.equals(zone, other.zone) - && Objects.equals(disk, other.disk); - } - - @Override - DiskId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return DiskId.of(projectId, zone, disk); - } - - /** - * Returns a disk identity given the zone identity and the disk name. The disk name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static DiskId of(ZoneId zoneId, String disk) { - return new DiskId(zoneId.getProject(), zoneId.getZone(), disk); - } - - /** - * Returns a disk identity given the zone and disk names. The disk name must be 1-63 characters - * long and comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public static DiskId of(String zone, String disk) { - return new DiskId(null, zone, disk); - } - - /** - * Returns a disk identity given project, zone and disks names. The disk name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static DiskId of(String project, String zone, String disk) { - return new DiskId(project, zone, disk); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a disk URL. Returns - * {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static DiskId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid disk URL"); - } - return DiskId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java deleted file mode 100644 index 764c7adf8c08..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Image; -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * A Google Compute Engine disk image configuration. This class can be used to create images from an - * existing Google Compute Engine disk. - */ -public class DiskImageConfiguration extends ImageConfiguration { - - private static final long serialVersionUID = 2716403667042981170L; - - private final DiskId sourceDisk; - private final String sourceDiskId; - - /** - * A builder for {@code DiskImageConfiguration} objects. - */ - public static final class Builder - extends ImageConfiguration.Builder { - - private DiskId sourceDisk; - private String sourceDiskId; - - private Builder() { - super(Type.DISK); - } - - private Builder(DiskImageConfiguration imageConfiguration) { - super(imageConfiguration); - this.sourceDisk = imageConfiguration.sourceDisk; - this.sourceDiskId = imageConfiguration.sourceDiskId; - } - - private Builder(Image imagePb) { - super(Type.DISK, imagePb); - this.sourceDisk = DiskId.fromUrl(imagePb.getSourceDisk()); - this.sourceDiskId = imagePb.getSourceDiskId(); - } - - /** - * Sets the identity of the source disk used to create the image. - */ - public Builder setSourceDisk(DiskId sourceDisk) { - this.sourceDisk = checkNotNull(sourceDisk); - return this; - } - - Builder setSourceDiskId(String sourceDiskId) { - this.sourceDiskId = sourceDiskId; - return this; - } - - /** - * Creates a {@code DiskImageConfiguration} object. - */ - @Override - public DiskImageConfiguration build() { - return new DiskImageConfiguration(this); - } - } - - private DiskImageConfiguration(Builder builder) { - super(builder); - this.sourceDisk = checkNotNull(builder.sourceDisk); - this.sourceDiskId = builder.sourceDiskId; - } - - /** - * Returns the identity of the source disk used to create this image. - */ - public DiskId getSourceDisk() { - return sourceDisk; - } - - /** - * Returns the service-generated unique id 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. - */ - public String getSourceDiskId() { - return sourceDiskId; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("sourceDisk", sourceDisk) - .add("sourceDiskId", sourceDiskId); - } - - @Override - public final int hashCode() { - return Objects.hash(baseHashCode(), sourceDisk, sourceDiskId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(DiskImageConfiguration.class) - && baseEquals((DiskImageConfiguration) obj); - } - - @Override - DiskImageConfiguration setProjectId(String projectId) { - if (sourceDisk.getProject() != null) { - return this; - } - return toBuilder().setSourceDisk(sourceDisk.setProjectId(projectId)).build(); - } - - @Override - Image toPb() { - Image imagePb = super.toPb(); - imagePb.setSourceDisk(sourceDisk.getSelfLink()); - imagePb.setSourceDiskId(sourceDiskId); - return imagePb; - } - - /** - * Creates a builder for a {@code DiskImageConfiguration} given the source disk identity. - */ - public static Builder newBuilder(DiskId sourceDisk) { - return new Builder().setSourceDisk(sourceDisk); - } - - /** - * Creates a {@code DiskImageConfiguration} object given the source disk identity. - */ - public static DiskImageConfiguration of(DiskId sourceId) { - return newBuilder(sourceId).build(); - } - - @SuppressWarnings("unchecked") - static DiskImageConfiguration fromPb(Image imagePb) { - return new Builder(imagePb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java deleted file mode 100644 index 02748014cb88..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Disk; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine persistent disk. A disk can be used as primary storage for your virtual - * machine instances. - * - * @see Block Storage - */ -public class DiskInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public DiskInfo apply(Disk pb) { - return DiskInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Disk apply(DiskInfo diskType) { - return diskType.toPb(); - } - }; - - private static final long serialVersionUID = -7173418340679279619L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final DiskId diskId; - private final DiskConfiguration configuration; - private final Long creationTimestamp; - private final CreationStatus creationStatus; - private final String description; - private final List licenses; - private final List attachedInstances; - private final Long lastAttachTimestamp; - private final Long lastDetachTimestamp; - - /** - * The status of disk creation. - */ - public enum CreationStatus { - /** - * The disk is being created. - */ - CREATING, - - /** - * Disk creation failed. - */ - FAILED, - - /** - * The disk has been created and is ready to use. - */ - READY, - - /** - * The disk is being restored. - */ - RESTORING - } - - /** - * Builder for {@code DiskInfo} objects. - */ - public abstract static class Builder { - - abstract Builder setGeneratedId(String generatedId); - - /** - * Sets the disk configuration. - */ - public abstract Builder setConfiguration(DiskConfiguration configuration); - - /** - * Sets the disk identity. - */ - public abstract Builder setDiskId(DiskId diskId); - - abstract Builder setCreationTimestamp(Long creationTimestamp); - - abstract Builder setCreationStatus(CreationStatus creationStatus); - - /** - * Sets an optional textual description of the resource. - */ - public abstract Builder setDescription(String description); - - abstract Builder setLicenses(List licenses); - - abstract Builder setAttachedInstances(List attachedInstances); - - abstract Builder setLastAttachTimestamp(Long lastAttachTimestamp); - - abstract Builder setLastDetachTimestamp(Long lastDetachTimestamp); - - /** - * Creates a {@code DiskInfo} object. - */ - public abstract DiskInfo build(); - } - - static final class BuilderImpl extends Builder { - - private String generatedId; - private DiskId diskId; - private DiskConfiguration configuration; - private Long creationTimestamp; - private CreationStatus creationStatus; - private String description; - private List licenses; - private List attachedInstances; - private Long lastAttachTimestamp; - private Long lastDetachTimestamp; - - BuilderImpl(DiskId diskId, DiskConfiguration configuration) { - this.diskId = checkNotNull(diskId); - this.configuration = checkNotNull(configuration); - } - - BuilderImpl(DiskInfo diskInfo) { - this.generatedId = diskInfo.generatedId; - this.configuration = diskInfo.configuration; - this.creationTimestamp = diskInfo.creationTimestamp; - this.creationStatus = diskInfo.creationStatus; - this.diskId = diskInfo.diskId; - this.description = diskInfo.description; - this.licenses = diskInfo.licenses; - this.attachedInstances = diskInfo.attachedInstances; - this.lastAttachTimestamp = diskInfo.lastAttachTimestamp; - this.lastDetachTimestamp = diskInfo.lastDetachTimestamp; - } - - BuilderImpl(Disk diskPb) { - if (diskPb.getId() != null) { - this.generatedId = diskPb.getId().toString(); - } - this.configuration = DiskConfiguration.fromPb(diskPb); - if (diskPb.getCreationTimestamp() != null) { - this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(diskPb.getCreationTimestamp()); - } - if (diskPb.getStatus() != null) { - this.creationStatus = CreationStatus.valueOf(diskPb.getStatus()); - } - this.diskId = DiskId.fromUrl(diskPb.getSelfLink()); - this.description = diskPb.getDescription(); - if (diskPb.getLicenses() != null) { - this.licenses = Lists.transform(diskPb.getLicenses(), LicenseId.FROM_URL_FUNCTION); - } - if (diskPb.getUsers() != null) { - this.attachedInstances = Lists.transform(diskPb.getUsers(), InstanceId.FROM_URL_FUNCTION); - } - if (diskPb.getLastAttachTimestamp() != null) { - this.lastAttachTimestamp = TIMESTAMP_FORMATTER.parseMillis(diskPb.getLastAttachTimestamp()); - } - if (diskPb.getLastDetachTimestamp() != null) { - this.lastDetachTimestamp = TIMESTAMP_FORMATTER.parseMillis(diskPb.getLastDetachTimestamp()); - } - } - - @Override - BuilderImpl setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - public BuilderImpl setConfiguration(DiskConfiguration configuration) { - this.configuration = checkNotNull(configuration); - return this; - } - - @Override - public BuilderImpl setDiskId(DiskId diskId) { - this.diskId = checkNotNull(diskId); - return this; - } - - @Override - BuilderImpl setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - BuilderImpl setCreationStatus(CreationStatus creationStatus) { - this.creationStatus = creationStatus; - return this; - } - - @Override - public BuilderImpl setDescription(String description) { - this.description = description; - return this; - } - - @Override - BuilderImpl setLicenses(List licenses) { - this.licenses = licenses != null ? ImmutableList.copyOf(licenses) : null; - return this; - } - - @Override - BuilderImpl setAttachedInstances(List attachedInstances) { - this.attachedInstances = - attachedInstances != null ? ImmutableList.copyOf(attachedInstances) : null; - return this; - } - - @Override - BuilderImpl setLastAttachTimestamp(Long lastAttachTimestamp) { - this.lastAttachTimestamp = lastAttachTimestamp; - return this; - } - - @Override - BuilderImpl setLastDetachTimestamp(Long lastDetachTimestamp) { - this.lastDetachTimestamp = lastDetachTimestamp; - return this; - } - - @Override - public DiskInfo build() { - return new DiskInfo(this); - } - } - - DiskInfo(BuilderImpl builder) { - this.generatedId = builder.generatedId; - this.configuration = builder.configuration; - this.creationTimestamp = builder.creationTimestamp; - this.creationStatus = builder.creationStatus; - this.diskId = builder.diskId; - this.description = builder.description; - this.licenses = builder.licenses; - this.attachedInstances = builder.attachedInstances; - this.lastAttachTimestamp = builder.lastAttachTimestamp; - this.lastDetachTimestamp = builder.lastDetachTimestamp; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns the service-generated unique identifier for the disk. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the disk configuration. - */ - @SuppressWarnings("unchecked") - public T getConfiguration() { - return (T) configuration; - } - - /** - * Returns the disk identity. - */ - public DiskId getDiskId() { - return diskId; - } - - /** - * Returns the creation status of the disk. - */ - public CreationStatus getCreationStatus() { - return creationStatus; - } - - /** - * Returns a textual description of the disk. - */ - public String getDescription() { - return description; - } - - /** - * Returns all applicable publicly visible licenses for the disk. - */ - public List getLicenses() { - return licenses; - } - - /** - * Returns all the identities of the instances this disk is attached to. - */ - public List getAttachedInstances() { - return attachedInstances; - } - - /** - * Returns the last attach timestamp in milliseconds since epoch. - */ - public Long getLastAttachTimestamp() { - return lastAttachTimestamp; - } - - /** - * Returns the last detach timestamp in milliseconds since epoch. - */ - public Long getLastDetachTimestamp() { - return lastDetachTimestamp; - } - - /** - * Returns a builder for the object. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("diskId", diskId) - .add("configuration", configuration) - .add("creationTimestamp", creationTimestamp) - .add("creationStatus", creationStatus) - .add("description", description) - .add("licenses", licenses) - .add("attachedInstances", attachedInstances) - .add("lastAttachTimestamp", lastAttachTimestamp) - .add("lastDetachTimestamp", lastDetachTimestamp) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(diskId, configuration, creationTimestamp, creationStatus, description, - licenses, attachedInstances, lastAttachTimestamp, lastDetachTimestamp); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(DiskInfo.class) - && Objects.equals(toPb(), ((DiskInfo) obj).toPb()); - } - - /** - * Returns a builder for a {@code DiskInfo} object given its identity and configuration. Use - * {@link StandardDiskConfiguration} to create a simple disk given its type and size. Use - * {@link SnapshotDiskConfiguration} to create a disk from a snapshot. Use - * {@link ImageDiskConfiguration} to create a disk from a disk image. - */ - public static Builder newBuilder(DiskId diskId, DiskConfiguration configuration) { - return new BuilderImpl(diskId, configuration); - } - - /** - * Returns a {@code DiskInfo} object given its identity and configuration. Use - * {@link StandardDiskConfiguration} to create a simple disk given its type and size. Use - * {@link SnapshotDiskConfiguration} to create a disk from a snapshot. Use - * {@link ImageDiskConfiguration} to create a disk from a disk image. - */ - public static DiskInfo of(DiskId diskId, DiskConfiguration configuration) { - return newBuilder(diskId, configuration).build(); - } - - DiskInfo setProjectId(String projectId) { - return toBuilder() - .setDiskId(diskId.setProjectId(projectId)) - .setConfiguration(configuration.setProjectId(projectId)) - .build(); - } - - Disk toPb() { - Disk diskPb = configuration.toPb(); - if (generatedId != null) { - diskPb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - diskPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - diskPb.setZone(diskId.getZoneId().getSelfLink()); - if (creationStatus != null) { - diskPb.setStatus(creationStatus.toString()); - } - diskPb.setName(diskId.getDisk()); - diskPb.setDescription(description); - diskPb.setSelfLink(diskId.getSelfLink()); - if (licenses != null) { - diskPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); - } - if (attachedInstances != null) { - diskPb.setUsers(Lists.transform(attachedInstances, InstanceId.TO_URL_FUNCTION)); - } - if (lastAttachTimestamp != null) { - diskPb.setLastAttachTimestamp(TIMESTAMP_FORMATTER.print(lastAttachTimestamp)); - } - if (lastDetachTimestamp != null) { - diskPb.setLastDetachTimestamp(TIMESTAMP_FORMATTER.print(lastDetachTimestamp)); - } - return diskPb; - } - - static DiskInfo fromPb(Disk diskPb) { - return new BuilderImpl(diskPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java deleted file mode 100644 index 413326d3e5d1..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.Objects; - -/** - * A Google Compute Engine disk type. A disk type represents the type of disk to use, such as - * {@code pd-ssd} or {@code pd-standard}. - * - * @see Disk Types - */ -public class DiskType implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public DiskType apply(com.google.api.services.compute.model.DiskType pb) { - return DiskType.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.DiskType apply(DiskType diskType) { - return diskType.toPb(); - } - }; - - private static final long serialVersionUID = -944042261695072026L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final DiskTypeId diskTypeId; - private final Long creationTimestamp; - private final String description; - private final String validDiskSize; - private final Long defaultDiskSizeGb; - private final DeprecationStatus deprecationStatus; - - static final class Builder { - - private String generatedId; - private DiskTypeId diskTypeId; - private Long creationTimestamp; - private String description; - private String validDiskSize; - private Long defaultDiskSizeGb; - private DeprecationStatus deprecationStatus; - - private Builder() {} - - Builder setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - Builder setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - Builder setDiskTypeId(DiskTypeId diskTypeId) { - this.diskTypeId = diskTypeId; - return this; - } - - Builder setDescription(String description) { - this.description = description; - return this; - } - - Builder setValidDiskSize(String validDiskSize) { - this.validDiskSize = validDiskSize; - return this; - } - - Builder setDefaultDiskSizeGb(Long defaultDiskSizeGb) { - this.defaultDiskSizeGb = defaultDiskSizeGb; - return this; - } - - Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { - this.deprecationStatus = deprecationStatus; - return this; - } - - DiskType build() { - return new DiskType(this); - } - } - - private DiskType(Builder builder) { - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.diskTypeId = builder.diskTypeId; - this.description = builder.description; - this.validDiskSize = builder.validDiskSize; - this.defaultDiskSizeGb = builder.defaultDiskSizeGb; - this.deprecationStatus = builder.deprecationStatus; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns the disk type's identity. - */ - public DiskTypeId getDiskTypeId() { - return diskTypeId; - } - - /** - * Returns the service-generated unique identifier for the disk type. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns a textual description of the disk type. - */ - public String getDescription() { - return description; - } - - /** - * Returns an optional textual description of the valid disk size, such as "10GB-10TB". - */ - public String getValidDiskSize() { - return validDiskSize; - } - - /** - * Returns the service-defined default disk size in GB. - */ - public Long getDefaultDiskSizeGb() { - return defaultDiskSizeGb; - } - - /** - * Returns the deprecation status of the disk type. If {@link DeprecationStatus#getStatus()} is - * either {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} - * the disk type should not be used. Returns {@code null} if the disk type is not deprecated. - */ - public DeprecationStatus getDeprecationStatus() { - return deprecationStatus; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("description", description) - .add("validDiskSize", validDiskSize) - .add("defaultDiskSizeGb", defaultDiskSizeGb) - .add("deprecationStatus", deprecationStatus) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(diskTypeId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(DiskType.class) - && Objects.equals(toPb(), ((DiskType) obj).toPb()); - } - - com.google.api.services.compute.model.DiskType toPb() { - com.google.api.services.compute.model.DiskType diskTypePb = - new com.google.api.services.compute.model.DiskType(); - if (generatedId != null) { - diskTypePb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - diskTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - diskTypePb.setDescription(description); - diskTypePb.setValidDiskSize(validDiskSize); - diskTypePb.setSelfLink(diskTypeId.getSelfLink()); - diskTypePb.setDefaultDiskSizeGb(defaultDiskSizeGb); - diskTypePb.setZone(diskTypeId.getZoneId().getSelfLink()); - if (deprecationStatus != null) { - diskTypePb.setDeprecated(deprecationStatus.toPb()); - } - return diskTypePb; - } - - static Builder newBuilder() { - return new Builder(); - } - - static DiskType fromPb(com.google.api.services.compute.model.DiskType diskTypePb) { - Builder builder = newBuilder(); - if (diskTypePb.getId() != null) { - builder.setGeneratedId(diskTypePb.getId().toString()); - } - if (diskTypePb.getCreationTimestamp() != null) { - builder.setCreationTimestamp( - TIMESTAMP_FORMATTER.parseMillis(diskTypePb.getCreationTimestamp())); - } - builder.setDiskTypeId(DiskTypeId.fromUrl(diskTypePb.getSelfLink())); - builder.setDescription(diskTypePb.getDescription()); - builder.setValidDiskSize(diskTypePb.getValidDiskSize()); - builder.setDefaultDiskSizeGb(diskTypePb.getDefaultDiskSizeGb()); - if (diskTypePb.getDeprecated() != null) { - builder.setDeprecationStatus( - DeprecationStatus.fromPb(diskTypePb.getDeprecated(), DiskTypeId.FROM_URL_FUNCTION)); - } - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java deleted file mode 100644 index 6a06b17c160a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine disk type. - */ -public final class DiskTypeId extends ResourceId { - - static final Function FROM_URL_FUNCTION = new Function() { - @Override - public DiskTypeId apply(String pb) { - return DiskTypeId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = new Function() { - @Override - public String apply(DiskTypeId diskTypeId) { - return diskTypeId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/diskTypes/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 7337881474103686219L; - - private final String zone; - private final String type; - - private DiskTypeId(String project, String zone, String type) { - super(project); - this.zone = checkNotNull(zone); - this.type = checkNotNull(type); - } - - /** - * Returns the name of the disk type. - */ - public String getType() { - return type; - } - - /** - * Returns the name of the zone this disk type belongs to. - */ - public String getZone() { - return zone; - } - - /** - * Returns the identity of the zone this disk type belongs to. - */ - public ZoneId getZoneId() { - return ZoneId.of(getProject(), zone); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/zones/" + zone + "/diskTypes/" + type; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("zone", zone).add("type", type); - } - - @Override - public int hashCode() { - return Objects.hash(super.baseHashCode(), zone, type); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof DiskTypeId)) { - return false; - } - DiskTypeId other = (DiskTypeId) obj; - return baseEquals(other) - && Objects.equals(zone, other.zone) - && Objects.equals(type, other.type); - } - - @Override - DiskTypeId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return DiskTypeId.of(projectId, zone, type); - } - - /** - * Returns a disk type identity given the zone identity and the disk type name. - */ - public static DiskTypeId of(ZoneId zoneId, String type) { - return new DiskTypeId(zoneId.getProject(), zoneId.getZone(), type); - } - - /** - * Returns a disk type identity given the zone and disk type names. - */ - public static DiskTypeId of(String zone, String type) { - return of(ZoneId.of(null, zone), type); - } - - /** - * Returns a disk type identity given project disk, zone and disk type names. - */ - public static DiskTypeId of(String project, String zone, String type) { - return of(ZoneId.of(project, zone), type); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a disk type URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static DiskTypeId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid disk type URL"); - } - return DiskTypeId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java deleted file mode 100644 index 82440b33c81a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * Base class for Google Compute Engine forwarding rule identities. - */ -public abstract class ForwardingRuleId extends ResourceId { - - private static final long serialVersionUID = -4352410760458355391L; - - private final String rule; - - ForwardingRuleId(String project, String rule) { - super(project); - this.rule = checkNotNull(rule); - } - - /** - * Possible types for a Google Compute Engine forwarding rule identity. - */ - enum Type { - /** - * Global forwarding rules are used to forward traffic to the correct load balancer for HTTP(S) - * load balancing. - */ - GLOBAL, - - /** - * Region forwarding rules are used to forward traffic to the correct pool of target virtual - * machines. - */ - REGION - } - - /** - * Returns the type of this forwarding rule identity. - */ - public abstract Type getType(); - - /** - * Returns the name of the forwarding rule. The forwarding rule name must be 1-63 characters long - * and comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getRule() { - return rule; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("rule", rule); - } - - @Override - final int baseHashCode() { - return Objects.hash(super.baseHashCode(), rule); - } - - @Override - final boolean baseEquals(ResourceId resourceId) { - return resourceId instanceof ForwardingRuleId - && super.baseEquals(resourceId) - && Objects.equals(rule, ((ForwardingRuleId) resourceId).rule); - } - - @Override - abstract ForwardingRuleId setProjectId(String projectId); -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java deleted file mode 100644 index b191bb3889d6..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine global address. - */ -public final class GlobalAddressId extends AddressId { - - private static final String REGEX = ResourceId.REGEX + "global/addresses/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -2950815290049218593L; - - private GlobalAddressId(String project, String address) { - super(project, address); - } - - @Override - public Type getType() { - return Type.GLOBAL; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/addresses/" + getAddress(); - } - - @Override - public int hashCode() { - return baseHashCode(); - } - - @Override - public boolean equals(Object obj) { - return obj == this || obj instanceof GlobalAddressId && baseEquals((GlobalAddressId) obj); - } - - @Override - GlobalAddressId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return GlobalAddressId.of(projectId, getAddress()); - } - - /** - * Returns an address identity given the address name. The address name must be 1-63 characters - * long and comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public static GlobalAddressId of(String address) { - return new GlobalAddressId(null, address); - } - - /** - * Returns an address identity given project and address names. The address name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static GlobalAddressId of(String project, String address) { - return new GlobalAddressId(project, address); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a global address - * URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static GlobalAddressId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid global address URL"); - } - return GlobalAddressId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java deleted file mode 100644 index 7761803a36ae..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.common.base.Function; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine global forwarding rule. - */ -public final class GlobalForwardingRuleId extends ForwardingRuleId { - - static final Function FROM_URL_FUNCTION = - new Function() { - @Override - public GlobalForwardingRuleId apply(String pb) { - return GlobalForwardingRuleId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = - new Function() { - @Override - public String apply(GlobalForwardingRuleId forwardingRuleId) { - return forwardingRuleId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "global/forwardingRules/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -2648031793037534254L; - - private GlobalForwardingRuleId(String project, String rule) { - super(project, rule); - } - - @Override - public Type getType() { - return Type.GLOBAL; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/forwardingRules/" + getRule(); - } - - @Override - public int hashCode() { - return baseHashCode(); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj instanceof GlobalForwardingRuleId - && baseEquals((GlobalForwardingRuleId) obj); - } - - @Override - GlobalForwardingRuleId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return GlobalForwardingRuleId.of(projectId, getRule()); - } - - /** - * Returns a forwarding rule identity given the rule name. The forwarding rule name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static GlobalForwardingRuleId of(String rule) { - return new GlobalForwardingRuleId(null, rule); - } - - /** - * Returns a forwarding rule identity given the project rule names. The forwarding rule name must - * be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static GlobalForwardingRuleId of(String project, String rule) { - return new GlobalForwardingRuleId(project, rule); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a global forwarding - * rule URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static GlobalForwardingRuleId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid global forwarding rule URL"); - } - return GlobalForwardingRuleId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java deleted file mode 100644 index 3c188874b1b4..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine global operation. - */ -public final class GlobalOperationId extends OperationId { - - private static final String REGEX = ResourceId.REGEX + "global/operations/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 3945756772641577962L; - - private GlobalOperationId(String project, String operation) { - super(project, operation); - } - - @Override - public Type getType() { - return Type.GLOBAL; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/operations/" + getOperation(); - } - - @Override - public int hashCode() { - return baseHashCode(); - } - - @Override - public boolean equals(Object obj) { - return obj == this || obj instanceof GlobalOperationId && baseEquals((GlobalOperationId) obj); - } - - @Override - GlobalOperationId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return GlobalOperationId.of(projectId, getOperation()); - } - - /** - * Returns a global operation identity given the operation name. - */ - public static GlobalOperationId of(String operation) { - return new GlobalOperationId(null, operation); - } - - /** - * Returns a global operation identity given project and operation names. - */ - public static GlobalOperationId of(String project, String operation) { - return new GlobalOperationId(project, operation); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a global operation - * URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static GlobalOperationId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid global operation URL"); - } - return GlobalOperationId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java deleted file mode 100644 index 084fc418465a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.Compute.ImageOption; -import com.google.cloud.compute.deprecated.Compute.OperationOption; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine Image. An image contains a boot loader, an operating system and a root - * file system that is necessary for starting an instance. Compute Engine offers publicly-available - * images of certain operating systems that you can use, or you can create a custom image. A custom - * image is an image created from one of your virtual machine instances that contains your specific - * instance configurations. To get an {@code Image} object with the most recent information use - * {@link #reload}. {@code Image} adds a layer of service-related functionality - * over {@link ImageInfo}. - * - * @see Images - */ -public class Image extends ImageInfo { - - private static final long serialVersionUID = 4623766590317494020L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Image} objects. - */ - public static class Builder extends ImageInfo.Builder { - - private final Compute compute; - private final ImageInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, ImageId imageId, ImageConfiguration configuration) { - this.compute = compute; - this.infoBuilder = new ImageInfo.BuilderImpl(); - this.infoBuilder.setImageId(imageId); - this.infoBuilder.setConfiguration(configuration); - } - - Builder(Image image) { - this.compute = image.compute; - this.infoBuilder = new ImageInfo.BuilderImpl(image); - } - - @Override - Builder setGeneratedId(String generatedId) { - infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - Builder getCreationTimestamp(Long creationTimestamp) { - infoBuilder.getCreationTimestamp(creationTimestamp); - return this; - } - - @Override - public Builder setImageId(ImageId imageId) { - infoBuilder.setImageId(imageId); - return this; - } - - @Override - public Builder setDescription(String description) { - infoBuilder.setDescription(description); - return this; - } - - @Override - public Builder setConfiguration(ImageConfiguration configuration) { - infoBuilder.setConfiguration(configuration); - return this; - } - - @Override - Builder setStatus(Status status) { - infoBuilder.setStatus(status); - return this; - } - - @Override - Builder setDiskSizeGb(Long diskSizeGb) { - infoBuilder.setDiskSizeGb(diskSizeGb); - return this; - } - - @Override - Builder setLicenses(List licenses) { - infoBuilder.setLicenses(licenses); - return this; - } - - @Override - Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { - infoBuilder.setDeprecationStatus(deprecationStatus); - return this; - } - - @Override - public Image build() { - return new Image(compute, infoBuilder); - } - } - - Image(Compute compute, ImageInfo.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this image exists. - * - * @return {@code true} if this image exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(ImageOption.fields()) != null; - } - - /** - * Fetches current image' latest information. Returns {@code null} if the image does not exist. - * - * @param options image options - * @return an {@code Image} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Image reload(ImageOption... options) { - return compute.getImage(getImageId(), options); - } - - /** - * Deletes this image. - * - * @return a global operation if the delete request was successfully sent, {@code null} if the - * image was not found - * @throws ComputeException upon failure or if this image is a publicly-available image - */ - public Operation delete(OperationOption... options) { - return compute.deleteImage(getImageId(), options); - } - - /** - * Deprecates this image. - * - * @return a global operation if the deprecation request was successfully sent, {@code null} if - * the image was not found - * @throws ComputeException upon failure or if this image is a publicly-available image - */ - public Operation deprecate(DeprecationStatus deprecationStatus, - OperationOption... options) { - return compute.deprecate(getImageId(), deprecationStatus, options); - } - - /** - * Returns the image's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Image.class)) { - return false; - } - Image other = (Image) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Image fromPb(Compute compute, com.google.api.services.compute.model.Image imagePb) { - return new Image(compute, new ImageInfo.BuilderImpl(imagePb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java deleted file mode 100644 index 2cfea1dea504..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.services.compute.model.Image; -import com.google.common.base.MoreObjects; - -import java.io.Serializable; -import java.util.Objects; - -/** - * Base class for Google Compute Engine image configuration. Use {@link DiskImageConfiguration} to - * create an image from an existing Google Compute Engine disk. Use - * {@link StorageImageConfiguration} to create an image from a file stored in Google Cloud Storage. - */ -public abstract class ImageConfiguration implements Serializable { - - private static final long serialVersionUID = -9154332316597745316L; - - private final Type type; - private final SourceType sourceType; - private final Long archiveSizeBytes; - - /** - * Type of a Google Compute Engine image. - */ - public enum Type { - /** - * A Google Compute Engine image created from a Google Compute Engine disk. - */ - DISK, - - /** - * A Google Compute Engine image created from a file saved in Google Cloud Storage. - */ - STORAGE - } - - /** - * Image source type. The only admissible value is {@code RAW}. - */ - public enum SourceType { - RAW - } - - /** - * Base builder for image configurations. - * - * @param the image configuration class - * @param the image configuration builder - */ - public abstract static class Builder> { - - private Type type; - private SourceType sourceType; - private Long archiveSizeBytes; - - Builder(Type type) { - this.type = type; - } - - Builder(ImageConfiguration imageConfiguration) { - this.type = imageConfiguration.type; - this.sourceType = imageConfiguration.sourceType; - this.archiveSizeBytes = imageConfiguration.archiveSizeBytes; - } - - Builder(Type type, Image imagePb) { - this.type = type; - if (imagePb.getSourceType() != null) { - this.sourceType = SourceType.valueOf(imagePb.getSourceType()); - } - this.archiveSizeBytes = imagePb.getArchiveSizeBytes(); - } - - @SuppressWarnings("unchecked") - B self() { - return (B) this; - } - - B setType(Type type) { - this.type = type; - return self(); - } - - B setSourceType(SourceType sourceType) { - this.sourceType = sourceType; - return self(); - } - - B setArchiveSizeBytes(Long archiveSizeBytes) { - this.archiveSizeBytes = archiveSizeBytes; - return self(); - } - - /** - * Creates a configuration object. - */ - public abstract T build(); - } - - ImageConfiguration(Builder builder) { - this.type = builder.type; - this.sourceType = builder.sourceType; - this.archiveSizeBytes = builder.archiveSizeBytes; - } - - /** - * Returns the image's type. This method returns {@link Type#DISK} if this image was created from - * an existing disk. This method returns {@link Type#STORAGE} if this image was created from a - * file in Google Cloud Storage. - */ - public Type getType() { - return type; - } - - /** - * Returns the source type of the disk. The default and only value is {@link SourceType#RAW}. - */ - public SourceType getSourceType() { - return sourceType; - } - - /** - * Returns the size of the image archive stored in Google Cloud Storage (in bytes). - */ - public Long getArchiveSizeBytes() { - return archiveSizeBytes; - } - - /** - * Returns a builder for the object. - */ - public abstract Builder toBuilder(); - - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this) - .add("type", type) - .add("sourceType", sourceType) - .add("archiveSizeBytes", archiveSizeBytes); - } - - @Override - public String toString() { - return toStringHelper().toString(); - } - - final int baseHashCode() { - return Objects.hash(type, sourceType, archiveSizeBytes); - } - - final boolean baseEquals(ImageConfiguration imageConfiguration) { - return imageConfiguration != null - && getClass().equals(imageConfiguration.getClass()) - && Objects.equals(toPb(), imageConfiguration.toPb()); - } - - abstract ImageConfiguration setProjectId(String projectId); - - Image toPb() { - Image imagePb = new Image(); - if (sourceType != null) { - imagePb.setSourceType(sourceType.name()); - } - imagePb.setArchiveSizeBytes(archiveSizeBytes); - return imagePb; - } - - @SuppressWarnings("unchecked") - static T fromPb(Image imagePb) { - if (imagePb.getSourceDisk() != null) { - return (T) DiskImageConfiguration.fromPb(imagePb); - } - return (T) StorageImageConfiguration.fromPb(imagePb); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java deleted file mode 100644 index 75d36154cd21..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Disk; -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * A Google Compute Engine disk configuration to create a disk from a Google Compute Engine image. - * - * @see Block Storage - */ -public class ImageDiskConfiguration extends DiskConfiguration { - - private static final long serialVersionUID = 6469117882950722812L; - - private final ImageId sourceImage; - private final String sourceImageId; - - /** - * A builder for {@code ImageDiskConfiguration} objects. - */ - public static class Builder - extends DiskConfiguration.Builder { - - private ImageId sourceImage; - private String sourceImageId; - - private Builder(ImageId sourceImage) { - super(Type.IMAGE); - this.sourceImage = checkNotNull(sourceImage); - } - - private Builder(ImageDiskConfiguration configuration) { - super(configuration); - this.sourceImage = configuration.sourceImage; - this.sourceImageId = configuration.sourceImageId; - } - - private Builder(Disk diskPb) { - super(Type.IMAGE, diskPb); - this.sourceImage = ImageId.fromUrl(diskPb.getSourceImage()); - this.sourceImageId = diskPb.getSourceImageId(); - } - - /** - * Sets the size of the persistent disk, in GB. If not set the disk will have the size of the - * image. This value can be larger than the image's size. If the provided size is smaller than - * the image's size then disk creation will fail. - */ - @Override - public Builder setSizeGb(Long sizeGb) { - super.setSizeGb(sizeGb); - return this; - } - - /** - * Sets the identity of the source image used to create the disk. - */ - public Builder setSourceImage(ImageId sourceImage) { - this.sourceImage = checkNotNull(sourceImage); - return this; - } - - Builder setSourceImageId(String sourceImageId) { - this.sourceImageId = sourceImageId; - return this; - } - - /** - * Creates an {@code ImageDiskConfiguration} object. - */ - @Override - public ImageDiskConfiguration build() { - return new ImageDiskConfiguration(this); - } - } - - private ImageDiskConfiguration(Builder builder) { - super(builder); - this.sourceImage = builder.sourceImage; - this.sourceImageId = builder.sourceImageId; - } - - /** - * Returns the identity of the source image used to create the disk. - */ - public ImageId getSourceImage() { - return sourceImage; - } - - /** - * Returns the service-generated unique id 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 service-generated id would identify the exact version of the image that - * was used. - */ - public String getSourceImageId() { - return sourceImageId; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("sourceImage", sourceImage) - .add("sourceImageId", sourceImageId); - } - - @Override - public final int hashCode() { - return Objects.hash(baseHashCode(), sourceImage, sourceImageId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(ImageDiskConfiguration.class) - && baseEquals((ImageDiskConfiguration) obj); - } - - @Override - ImageDiskConfiguration setProjectId(String projectId) { - Builder builder = toBuilder().setSourceImage(sourceImage.setProjectId(projectId)); - if (getDiskType() != null) { - builder.setDiskType(getDiskType().setProjectId(projectId)); - } - return builder.build(); - } - - @Override - Disk toPb() { - return super.toPb().setSourceImage(sourceImage.getSelfLink()).setSourceImageId(sourceImageId); - } - - /** - * Returns a builder for an {@code ImageDiskConfiguration} object given the image identity. - */ - public static Builder newBuilder(ImageId imageId) { - return new Builder(imageId); - } - - /** - * Returns an {@code ImageDiskConfiguration} object given the image identity. - */ - public static ImageDiskConfiguration of(ImageId imageId) { - return newBuilder(imageId).build(); - } - - @SuppressWarnings("unchecked") - static ImageDiskConfiguration fromPb(Disk diskPb) { - return new Builder(diskPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java deleted file mode 100644 index 4b6cf98f8bf6..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine image. - */ -public final class ImageId extends ResourceId { - - static final Function FROM_URL_FUNCTION = new Function() { - @Override - public ImageId apply(String pb) { - return ImageId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = new Function() { - @Override - public String apply(ImageId imageId) { - return imageId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "global/images/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 6434553917859414341L; - - private final String image; - - private ImageId(String project, String image) { - super(project); - this.image = checkNotNull(image); - } - - /** - * Returns the name of the image. The name must be 1-63 characters long and comply with RFC1035. - * Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} - * which means the first character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getImage() { - return image; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/images/" + image; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("image", image); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), image); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ImageId)) { - return false; - } - ImageId other = (ImageId) obj; - return baseEquals(other) && Objects.equals(image, other.image); - } - - @Override - ImageId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return ImageId.of(projectId, image); - } - - /** - * Returns an image identity given the image name. The image name must be 1-63 characters long and - * comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public static ImageId of(String image) { - return new ImageId(null, image); - } - - /** - * Returns an image identity given project and image names. The image name must be 1-63 characters - * long and comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public static ImageId of(String project, String image) { - return new ImageId(project, image); - } - - /** - * Returns {@code true} if the provided string matches the expected format of an image URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static ImageId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid image URL"); - } - return ImageId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java deleted file mode 100644 index 0e0c289c78e3..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Image; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine Image. An image contains a boot loader, an operating system and a root - * file system that is necessary for starting an instance. Compute Engine offers publicly-available - * images of certain operating systems that you can use, or you can create a custom image. A custom - * image is an image created from one of your virtual machine instances that contains your specific - * instance configurations. Use {@link DiskImageConfiguration} to create an image from an existing - * disk. Use {@link StorageImageConfiguration} to create an image from a file stored in Google - * Cloud Storage. - * - * @see Images - */ -public class ImageInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public ImageInfo apply(Image pb) { - return ImageInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Image apply(ImageInfo image) { - return image.toPb(); - } - }; - - private static final long serialVersionUID = -1061916352807358977L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final ImageId imageId; - private final Long creationTimestamp; - private final String description; - private final ImageConfiguration configuration; - private final Status status; - private final Long diskSizeGb; - private final List licenses; - private final DeprecationStatus deprecationStatus; - - /** - * The status of a Google Compute Engine Image. An image can be used to create other disks only - * after it has been successfully created and its status is set to {@code READY}. - */ - public enum Status { - /** - * Image creation failed. The image can not be used. - */ - FAILED, - - /** - * Image creation is pending. The image is not ready to be used yet. - */ - PENDING, - - /** - * Image has been created and is ready for use. - */ - READY - } - - /** - * A builder for {@code ImageInfo} objects. - */ - public abstract static class Builder { - - abstract Builder setGeneratedId(String generatedId); - - abstract Builder getCreationTimestamp(Long creationTimestamp); - - /** - * Sets the image identity. - */ - public abstract Builder setImageId(ImageId imageId); - - /** - * Sets an optional textual description of the image. - */ - public abstract Builder setDescription(String description); - - /** - * Sets the image configuration. Use {@link DiskImageConfiguration} to create an image from an - * existing disk. Use {@link StorageImageConfiguration} to create an image from a file stored in - * Google Cloud Storage. - */ - public abstract Builder setConfiguration(ImageConfiguration configuration); - - abstract Builder setStatus(Status status); - - abstract Builder setDiskSizeGb(Long diskSizeGb); - - abstract Builder setLicenses(List licenses); - - abstract Builder setDeprecationStatus(DeprecationStatus deprecationStatus); - - /** - * Creates a {@code ImageInfo} object. - */ - public abstract ImageInfo build(); - } - - static final class BuilderImpl extends Builder { - - private String generatedId; - private Long creationTimestamp; - private ImageId imageId; - private String description; - private ImageConfiguration configuration; - private Status status; - private Long diskSizeGb; - private List licenses; - private DeprecationStatus deprecationStatus; - - BuilderImpl() {} - - BuilderImpl(ImageInfo imageInfo) { - this.generatedId = imageInfo.generatedId; - this.creationTimestamp = imageInfo.creationTimestamp; - this.imageId = imageInfo.imageId; - this.description = imageInfo.description; - this.configuration = imageInfo.configuration; - this.status = imageInfo.status; - this.diskSizeGb = imageInfo.diskSizeGb; - this.licenses = imageInfo.licenses; - this.deprecationStatus = imageInfo.deprecationStatus; - } - - BuilderImpl(Image imagePb) { - if (imagePb.getId() != null) { - this.generatedId = imagePb.getId().toString(); - } - if (imagePb.getCreationTimestamp() != null) { - this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(imagePb.getCreationTimestamp()); - } - this.imageId = ImageId.fromUrl(imagePb.getSelfLink()); - this.description = imagePb.getDescription(); - this.configuration = ImageConfiguration.fromPb(imagePb); - if (imagePb.getStatus() != null) { - this.status = Status.valueOf(imagePb.getStatus()); - } - this.diskSizeGb = imagePb.getDiskSizeGb(); - if (imagePb.getLicenses() != null) { - this.licenses = Lists.transform(imagePb.getLicenses(), LicenseId.FROM_URL_FUNCTION); - } - if (imagePb.getDeprecated() != null) { - this.deprecationStatus = - DeprecationStatus.fromPb(imagePb.getDeprecated(), ImageId.FROM_URL_FUNCTION); - } - } - - @Override - BuilderImpl setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - BuilderImpl getCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - public BuilderImpl setImageId(ImageId imageId) { - this.imageId = checkNotNull(imageId); - return this; - } - - @Override - public BuilderImpl setDescription(String description) { - this.description = description; - return this; - } - - @Override - public BuilderImpl setConfiguration(ImageConfiguration configuration) { - this.configuration = checkNotNull(configuration); - return this; - } - - @Override - BuilderImpl setStatus(Status status) { - this.status = status; - return this; - } - - @Override - BuilderImpl setDiskSizeGb(Long diskSizeGb) { - this.diskSizeGb = diskSizeGb; - return this; - } - - @Override - BuilderImpl setLicenses(List licenses) { - this.licenses = licenses != null ? ImmutableList.copyOf(licenses) : null; - return this; - } - - @Override - BuilderImpl setDeprecationStatus(DeprecationStatus deprecationStatus) { - this.deprecationStatus = deprecationStatus; - return this; - } - - @Override - public ImageInfo build() { - return new ImageInfo(this); - } - } - - ImageInfo(BuilderImpl builder) { - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.imageId = checkNotNull(builder.imageId); - this.description = builder.description; - this.configuration = checkNotNull(builder.configuration); - this.status = builder.status; - this.diskSizeGb = builder.diskSizeGb; - this.licenses = builder.licenses; - this.deprecationStatus = builder.deprecationStatus; - } - - /** - * Returns the service-generated unique identifier for the image. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns the image identity. - */ - public ImageId getImageId() { - return imageId; - } - - /** - * Returns a textual description of the image. - */ - public String getDescription() { - return description; - } - - /** - * Returns the image configuration. This method returns an instance of - * {@link DiskImageConfiguration} if the the image was created from a Google Compute Engine disk. - * This method returns an instance of {@link StorageImageConfiguration} if the image was created - * from a file stored in Google Cloud Storage. - */ - @SuppressWarnings("unchecked") - public T getConfiguration() { - return (T) configuration; - } - - /** - * Returns all applicable publicly visible licenses. - */ - public List getLicenses() { - return licenses; - } - - /** - * Returns the status of the image. An image can be used to create other disks only after it has - * been successfully created and its status is set to {@link Status#READY}. - */ - public Status getStatus() { - return status; - } - - /** - * Returns the size of the image when restored onto a persistent disk (in GB). - */ - public Long getDiskSizeGb() { - return diskSizeGb; - } - - /** - * Returns the deprecation status of the image. If {@link DeprecationStatus#getStatus()} is either - * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the - * image must not be used. Returns {@code null} if the image is not deprecated. - */ - public DeprecationStatus getDeprecationStatus() { - return deprecationStatus; - } - - /** - * Returns a builder for the current image. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("imageId", imageId) - .add("description", description) - .add("configuration", configuration) - .add("status", status) - .add("diskSizeGb", diskSizeGb) - .add("licenses", licenses) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(generatedId, creationTimestamp, imageId, description, configuration, status, - diskSizeGb, licenses); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(ImageInfo.class) - && Objects.equals(toPb(), ((ImageInfo) obj).toPb()); - } - - ImageInfo setProjectId(String projectId) { - return toBuilder() - .setImageId(imageId.setProjectId(projectId)) - .setConfiguration(configuration.setProjectId(projectId)) - .build(); - } - - Image toPb() { - Image imagePb = configuration.toPb(); - if (generatedId != null) { - imagePb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - imagePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - imagePb.setName(imageId.getImage()); - imagePb.setDescription(description); - imagePb.setSelfLink(imageId.getSelfLink()); - if (status != null) { - imagePb.setStatus(status.name()); - } - imagePb.setDiskSizeGb(diskSizeGb); - if (licenses != null) { - imagePb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); - } - if (deprecationStatus != null) { - imagePb.setDeprecated(deprecationStatus.toPb()); - } - return imagePb; - } - - /** - * Returns a builder for an {@code ImageInfo} object given the image identity and an image - * configuration. Use {@link DiskImageConfiguration} to create an image from an existing disk. Use - * {@link StorageImageConfiguration} to create an image from a file stored in Google Cloud - * Storage. - */ - public static Builder newBuilder(ImageId imageId, ImageConfiguration configuration) { - return new BuilderImpl().setImageId(imageId).setConfiguration(configuration); - } - - /** - * Returns an {@code ImageInfo} object given the image identity and an image configuration. Use - * {@link DiskImageConfiguration} to create an image from an existing disk. Use - * {@link StorageImageConfiguration} to create an image from a file stored in Google Cloud - * Storage. - */ - public static ImageInfo of(ImageId imageId, ImageConfiguration configuration) { - return newBuilder(imageId, configuration).build(); - } - - static ImageInfo fromPb(Image imagePb) { - return new BuilderImpl(imagePb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java deleted file mode 100644 index 265f9739f412..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; -import com.google.cloud.compute.deprecated.Compute.InstanceOption; -import com.google.cloud.compute.deprecated.Compute.OperationOption; -import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; -import com.google.common.collect.ImmutableList; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A Google Compute Engine VM Instance. An instance is a virtual machine (VM) hosted on Google's - * infrastructure. Instances can run Linux and Windows Server images provided by Google, or any - * customized versions of these images. You can also build and run images of other operating - * systems. Objects of this class are immutable. To get an {@code Instance} object with the most - * recent information use {@link #reload}. {@code Instance} adds a layer of service-related - * functionality over {@link InstanceInfo}. - * - * @see Virtual Machine Instances - */ -public class Instance extends InstanceInfo { - - private static final long serialVersionUID = 3072508155558980677L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Instance} objects. - */ - public static class Builder extends InstanceInfo.Builder { - - private final Compute compute; - private final InstanceInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, InstanceId instanceId, MachineTypeId machineType, - AttachedDisk attachedDisk, NetworkInterface networkInterface) { - this.compute = compute; - this.infoBuilder = new InstanceInfo.BuilderImpl(instanceId); - this.infoBuilder.setMachineType(machineType); - this.infoBuilder.setAttachedDisks(ImmutableList.of(attachedDisk)); - this.infoBuilder.setNetworkInterfaces(ImmutableList.of(networkInterface)); - } - - Builder(Instance instance) { - this.compute = instance.compute; - this.infoBuilder = new InstanceInfo.BuilderImpl(instance); - } - - @Override - Builder setGeneratedId(String generatedId) { - this.infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - public Builder setInstanceId(InstanceId instanceId) { - this.infoBuilder.setInstanceId(instanceId); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - this.infoBuilder.setCreationTimestamp(creationTimestamp); - return this; - } - - @Override - public Builder setDescription(String description) { - this.infoBuilder.setDescription(description); - return this; - } - - @Override - Builder setStatus(Status status) { - this.infoBuilder.setStatus(status); - return this; - } - - @Override - Builder setStatusMessage(String statusMessage) { - this.infoBuilder.setStatusMessage(statusMessage); - return this; - } - - @Override - public Builder setTags(Tags tags) { - this.infoBuilder.setTags(tags); - return this; - } - - @Override - public Builder setMachineType(MachineTypeId machineType) { - this.infoBuilder.setMachineType(machineType); - return this; - } - - @Override - public Builder setCanIpForward(Boolean canIpForward) { - this.infoBuilder.setCanIpForward(canIpForward); - return this; - } - - @Override - public Builder setNetworkInterfaces(List networkInterfaces) { - this.infoBuilder.setNetworkInterfaces(networkInterfaces); - return this; - } - - @Override - public Builder setNetworkInterfaces(NetworkInterface... networkInterfaces) { - this.infoBuilder.setNetworkInterfaces(networkInterfaces); - return this; - } - - @Override - public Builder setAttachedDisks(List attachedDisks) { - this.infoBuilder.setAttachedDisks(attachedDisks); - return this; - } - - @Override - public Builder setAttachedDisks(AttachedDisk... attachedDisks) { - this.infoBuilder.setAttachedDisks(attachedDisks); - return this; - } - - @Override - public Builder setMetadata(Metadata metadata) { - this.infoBuilder.setMetadata(metadata); - return this; - } - - @Override - public Builder setServiceAccounts(List serviceAccounts) { - this.infoBuilder.setServiceAccounts(serviceAccounts); - return this; - } - - @Override - public Builder setSchedulingOptions(SchedulingOptions schedulingOptions) { - this.infoBuilder.setSchedulingOptions(schedulingOptions); - return this; - } - - @Override - Builder setCpuPlatform(String cpuPlatform) { - this.infoBuilder.setCpuPlatform(cpuPlatform); - return this; - } - - @Override - public Instance build() { - return new Instance(compute, infoBuilder); - } - } - - Instance(Compute compute, Instance.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this instance exists. - * - * @return {@code true} if this instance exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(InstanceOption.fields()) != null; - } - - /** - * Fetches current instance's latest information. Returns {@code null} if the instance does not - * exist. - * - * @param options instance options - * @return a {@code Instance} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Instance reload(InstanceOption... options) { - return compute.getInstance(getInstanceId(), options); - } - - /** - * Deletes this instance. - * - * @return a zone operation if delete request was successfully sent, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation delete(OperationOption... options) { - return compute.deleteInstance(getInstanceId(), options); - } - - /** - * Adds an access configuration to the provided network interface for this instance. - * - * @return a zone operation if the add request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation addAccessConfig(String networkInterface, AccessConfig accessConfig, - OperationOption... options) { - return compute.addAccessConfig(getInstanceId(), networkInterface, accessConfig, options); - } - - /** - * Attaches a persistent disk to this instance given its configuration. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation attachDisk(PersistentDiskConfiguration configuration, - OperationOption... options) { - return compute.attachDisk(getInstanceId(), configuration, options); - } - - /** - * Attaches a persistent disk to this instance given the device name and its configuration. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation attachDisk(String deviceName, PersistentDiskConfiguration configuration, - OperationOption... options) { - return compute.attachDisk(getInstanceId(), deviceName, configuration, options); - } - - /** - * Attaches a persistent disk to this instance given the device name, its configuration and the - * device index. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation attachDisk(String deviceName, PersistentDiskConfiguration configuration, - int index, OperationOption... options) { - return compute.attachDisk(getInstanceId(), deviceName, configuration, index, options); - } - - /** - * Deletes an access configuration from the provided network interface for this instance. - * - * @return a zone operation if the delete request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation deleteAccessConfig(String networkInterface, String accessConfig, - OperationOption... options) { - return compute.deleteAccessConfig(getInstanceId(), networkInterface, accessConfig, options); - } - - /** - * Detaches a disk from this instance. - * - * @return a zone operation if the detach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation detachDisk(String deviceName, OperationOption... options) { - return compute.detachDisk(getInstanceId(), deviceName, options); - } - - /** - * Returns the serial port output for this instance and port number. {@code port} must be between - * 1 and 4 (inclusive). - * - * @return the serial port output or {@code null} if the instance was not found - * @throws ComputeException upon failure - */ - public String getSerialPortOutput(int port) { - return compute.getSerialPortOutput(getInstanceId(), port); - } - - /** - * Returns the default serial port output for this instance. Default serial port corresponds to - * port number 1. - * - * @return the serial port output or {@code null} if the instance was not found - * @throws ComputeException upon failure - */ - public String getSerialPortOutput() { - return compute.getSerialPortOutput(getInstanceId()); - } - - /** - * Resets this instance. - * - * @return a zone operation if the reset request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation reset(OperationOption... options) { - return compute.reset(getInstanceId(), options); - } - - /** - * Sets the auto-delete flag for a disk attached to this instance. - * - * @return a zone operation if the flag setting request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation setDiskAutoDelete(String deviceName, boolean autoDelete, - OperationOption... options) { - return compute.setDiskAutoDelete(getInstanceId(), deviceName, autoDelete, options); - } - - /** - * Sets the machine type for this instance. The instance must be in - * {@link InstanceInfo.Status#TERMINATED} state to be able to set its machine type. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation setMachineType(MachineTypeId machineType, OperationOption... options) { - return compute.setMachineType(getInstanceId(), machineType, options); - } - - /** - * Sets the metadata for this instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation setMetadata(Metadata metadata, OperationOption... options) { - return compute.setMetadata(getInstanceId(), metadata, options); - } - - /** - * Sets the metadata for this instance, fingerprint value is taken from this instance's - * {@code tags().fingerprint()}. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation setMetadata(Map metadata, OperationOption... options) { - return setMetadata(getMetadata().toBuilder().setValues(metadata).build(), options); - } - - /** - * Sets the scheduling options for this instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation setSchedulingOptions(SchedulingOptions scheduling, OperationOption... options) { - return compute.setSchedulingOptions(getInstanceId(), scheduling, options); - } - - /** - * Sets the tags for this instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation setTags(Tags tags, OperationOption... options) { - return compute.setTags(getInstanceId(), tags, options); - } - - /** - * Sets the tags for this instance, fingerprint value is taken from this instance's - * {@code tags().fingerprint()}. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - public Operation setTags(Iterable tags, OperationOption... options) { - return setTags(getTags().toBuilder().setValues(tags).build(), options); - } - - /** - * Starts this instance. - * - * @return a zone operation if the start request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation start(OperationOption... options) { - return compute.start(getInstanceId(), options); - } - - /** - * Stops this instance. - * - * @return a zone operation if the stop request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - public Operation stop(OperationOption... options) { - return compute.stop(getInstanceId(), options); - } - - /** - * Returns the snapshot's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Instance.class)) { - return false; - } - Instance other = (Instance) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Instance fromPb(Compute compute, - com.google.api.services.compute.model.Instance instancePb) { - return new Instance(compute, new InstanceInfo.BuilderImpl(instancePb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java deleted file mode 100644 index 1cfeb7cbd7be..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine virtual machine instance. - */ -public final class InstanceId extends ResourceId { - - static final Function FROM_URL_FUNCTION = new Function() { - @Override - public InstanceId apply(String pb) { - return InstanceId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = new Function() { - @Override - public String apply(InstanceId instanceId) { - return instanceId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/instances/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -2787043125223159922L; - - private final String zone; - private final String instance; - - private InstanceId(String project, String zone, String instance) { - super(project); - this.zone = checkNotNull(zone); - this.instance = checkNotNull(instance); - } - - /** - * Returns the name of the instance. The name must be 1-63 characters long and comply with - * RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getInstance() { - return instance; - } - - /** - * Returns the name of the zone this instance belongs to. - */ - public String getZone() { - return zone; - } - - /** - * Returns the identity of the zone this instance belongs to. - */ - public ZoneId getZoneId() { - return ZoneId.of(getProject(), zone); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/zones/" + zone + "/instances/" + instance; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("zone", zone).add("instance", instance); - } - - @Override - public int hashCode() { - return Objects.hash(super.baseHashCode(), zone, instance); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof InstanceId)) { - return false; - } - InstanceId other = (InstanceId) obj; - return baseEquals(other) - && Objects.equals(zone, other.zone) - && Objects.equals(instance, other.instance); - } - - @Override - InstanceId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return InstanceId.of(projectId, zone, instance); - } - - /** - * Returns an instance identity given the zone identity and the instance name. The instance name - * must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the - * regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static InstanceId of(ZoneId zoneId, String instance) { - return new InstanceId(zoneId.getProject(), zoneId.getZone(), instance); - } - - /** - * Returns an instance identity given the zone and instance names. The instance name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static InstanceId of(String zone, String instance) { - return new InstanceId(null, zone, instance); - } - - /** - * Returns an instance identity given project, zone and instance names. The instance name must be - * 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static InstanceId of(String project, String zone, String instance) { - return new InstanceId(project, zone, instance); - } - - /** - * Returns {@code true} if the provided string matches the expected format of an instance URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static InstanceId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid instance URL"); - } - return InstanceId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java deleted file mode 100644 index a6192f60fa35..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java +++ /dev/null @@ -1,676 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Instance; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine VM Instance. An instance is a virtual machine (VM) hosted on Google's - * infrastructure. Instances can run Linux and Windows Server images provided by Google, or any - * customized versions of these images. You can also build and run images of other operating - * systems. Google Compute Engine also lets you choose the machine properties of your instances, - * such as the number of virtual CPUs and the amount of memory - * - *

By default, each Compute Engine instance has a small root persistent disk that contains the - * operating system. When your applications require additional storage space, you can add one or - * more additional disks to your instance. - * - *

Instances communicate with other instances in the same network through a local area network. - * Instances communicate with the rest of the world through the Internet. A network lives in a - * project and is isolated from other networks in the project. A project can have up to five - * different networks. - * - * @see Virtual Machine Instances - */ -public class InstanceInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public InstanceInfo apply(Instance pb) { - return InstanceInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Instance apply(InstanceInfo instance) { - return instance.toPb(); - } - }; - - private static final long serialVersionUID = -6601223112628977168L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final InstanceId instanceId; - private final Long creationTimestamp; - private final String description; - private final Status status; - private final String statusMessage; - private final Tags tags; - private final MachineTypeId machineType; - private final Boolean canIpForward; - private final List networkInterfaces; - private final List attachedDisks; - private final Metadata metadata; - private final List serviceAccounts; - private final SchedulingOptions schedulingOptions; - private final String cpuPlatform; - - /** - * The status of the instance. - */ - public enum Status { - /** - * Indicates that resources are being reserved for the instance. The instance isn't running yet. - */ - PROVISIONING, - - /** - * Indicates that resources have been acquired and the instance is being prepared for launch. - */ - STAGING, - - /** - * Indicates that the instance is booting up or running. You should be able to {@code ssh} into - * the instance soon, though not immediately, after it enters this state. - */ - RUNNING, - - /** - * Indicates that the instance is being stopped either due to a failure, or the instance being - * shut down. This is a temporary status and the instance will move to {@code TERMINATED}. - */ - STOPPING, - - /** - * Indicates that the instance was shut down or encountered a failure, either through the API or - * from inside the guest. You can choose to restart the instance or delete it. - */ - TERMINATED - } - - /** - * A builder for {@code InstanceInfo} objects. - */ - public abstract static class Builder { - - abstract Builder setGeneratedId(String generatedId); - - /** - * Sets the identity of the virtual machine instance. - */ - public abstract Builder setInstanceId(InstanceId instanceId); - - abstract Builder setCreationTimestamp(Long creationTimestamp); - - /** - * Sets an optional description of this Google Compute Engine instance. - */ - public abstract Builder setDescription(String description); - - abstract Builder setStatus(Status status); - - abstract Builder setStatusMessage(String statusMessage); - - /** - * Sets the tags to apply to this instance. Tags are used to identify valid sources or targets - * for network firewalls. - */ - public abstract Builder setTags(Tags tags); - - /** - * Sets the machine type identity. - */ - public abstract Builder setMachineType(MachineTypeId machineType); - - /** - * Sets whether to allow 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. - * - * @see Enabling IP - * Forwarding - */ - public abstract Builder setCanIpForward(Boolean canIpForward); - - /** - * Sets a list of network interfaces. This specifies how this instance is configured to interact - * with other network services, such as connecting to the internet. At the moment, instances - * only support one network interface. - */ - public abstract Builder setNetworkInterfaces(List networkInterfaces); - - /** - * Sets a list of network interfaces. This specifies how this instance is configured to interact - * with other network services, such as connecting to the internet. At the moment, instances - * only support one network interface. - */ - public abstract Builder setNetworkInterfaces(NetworkInterface... networkInterfaces); - - /** - * Sets a list of disks to attach to the instance. One boot disk must be provided (i.e. an - * attached disk such that {@link AttachedDisk.AttachedDiskConfiguration#boot()} returns - * {@code true}). - */ - public abstract Builder setAttachedDisks(List attachedDisks); - - /** - * Sets a list of disks to attach to the instance. One boot disk must be provided. - */ - public abstract Builder setAttachedDisks(AttachedDisk... attachedDisks); - - /** - * Sets the instance metadata. - */ - public abstract Builder setMetadata(Metadata metadata); - - /** - * Sets a list of service accounts, with their specified scopes, authorized for this instance. - * Service accounts generate access tokens that can be accessed through the metadata server and - * used to authenticate applications on the instance. - * - * @see Authenticating from - * Google Compute Engine - */ - public abstract Builder setServiceAccounts(List serviceAccounts); - - /** - * Sets the scheduling options for the instance. - */ - public abstract Builder setSchedulingOptions(SchedulingOptions schedulingOptions); - - abstract Builder setCpuPlatform(String cpuPlatform); - - /** - * Creates an {@code InstanceInfo} object. - */ - public abstract InstanceInfo build(); - } - - public static final class BuilderImpl extends Builder { - - private String generatedId; - private InstanceId instanceId; - private Long creationTimestamp; - private String description; - private Status status; - private String statusMessage; - private Tags tags; - private MachineTypeId machineType; - private Boolean canIpForward; - private List networkInterfaces; - private List attachedDisks; - private Metadata metadata; - private List serviceAccounts; - private SchedulingOptions schedulingOptions; - private String cpuPlatform; - - BuilderImpl(InstanceId instanceId) { - this.instanceId = checkNotNull(instanceId); - } - - BuilderImpl(InstanceInfo instance) { - this.generatedId = instance.generatedId; - this.instanceId = instance.instanceId; - this.creationTimestamp = instance.creationTimestamp; - this.description = instance.description; - this.status = instance.status; - this.statusMessage = instance.statusMessage; - this.tags = instance.tags; - this.machineType = instance.machineType; - this.canIpForward = instance.canIpForward; - this.networkInterfaces = instance.networkInterfaces; - this.attachedDisks = instance.attachedDisks; - this.metadata = instance.metadata; - this.serviceAccounts = instance.serviceAccounts; - this.schedulingOptions = instance.schedulingOptions; - this.cpuPlatform = instance.cpuPlatform; - } - - BuilderImpl(Instance instancePb) { - if (instancePb.getId() != null) { - this.generatedId = instancePb.getId().toString(); - } - this.instanceId = InstanceId.fromUrl(instancePb.getSelfLink()); - if (instancePb.getCreationTimestamp() != null) { - this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(instancePb.getCreationTimestamp()); - } - this.description = instancePb.getDescription(); - if (instancePb.getStatus() != null) { - this.status = Status.valueOf(instancePb.getStatus()); - } - this.statusMessage = instancePb.getStatusMessage(); - if (instancePb.getTags() != null) { - this.tags = Tags.fromPb(instancePb.getTags()); - } - if (instancePb.getMachineType() != null) { - this.machineType = MachineTypeId.fromUrl(instancePb.getMachineType()); - } - this.canIpForward = instancePb.getCanIpForward(); - if (instancePb.getNetworkInterfaces() != null) { - this.networkInterfaces = - Lists.transform(instancePb.getNetworkInterfaces(), NetworkInterface.FROM_PB_FUNCTION); - } - if (instancePb.getDisks() != null) { - this.attachedDisks = Lists.transform(instancePb.getDisks(), AttachedDisk.FROM_PB_FUNCTION); - } - if (instancePb.getMetadata() != null) { - this.metadata = Metadata.fromPb(instancePb.getMetadata()); - } - if (instancePb.getServiceAccounts() != null) { - this.serviceAccounts = - Lists.transform(instancePb.getServiceAccounts(), ServiceAccount.FROM_PB_FUNCTION); - } - if (instancePb.getScheduling() != null) { - this.schedulingOptions = SchedulingOptions.fromPb(instancePb.getScheduling()); - } - this.cpuPlatform = instancePb.getCpuPlatform(); - } - - @Override - Builder setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - public Builder setInstanceId(InstanceId instanceId) { - this.instanceId = checkNotNull(instanceId); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - public Builder setDescription(String description) { - this.description = description; - return this; - } - - @Override - Builder setStatus(Status status) { - this.status = status; - return this; - } - - @Override - Builder setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - return this; - } - - @Override - public Builder setTags(Tags tags) { - this.tags = tags; - return this; - } - - @Override - public Builder setMachineType(MachineTypeId machineType) { - this.machineType = checkNotNull(machineType); - return this; - } - - @Override - public Builder setCanIpForward(Boolean canIpForward) { - this.canIpForward = canIpForward; - return this; - } - - @Override - public Builder setNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = ImmutableList.copyOf(checkNotNull(networkInterfaces)); - return this; - } - - @Override - public Builder setNetworkInterfaces(NetworkInterface... networkInterfaces) { - this.networkInterfaces = Arrays.asList(networkInterfaces); - return this; - } - - @Override - public Builder setAttachedDisks(List attachedDisks) { - this.attachedDisks = ImmutableList.copyOf(checkNotNull(attachedDisks)); - return this; - } - - @Override - public Builder setAttachedDisks(AttachedDisk... attachedDisks) { - this.attachedDisks = Arrays.asList(attachedDisks); - return this; - } - - @Override - public Builder setMetadata(Metadata metadata) { - this.metadata = metadata; - return this; - } - - @Override - public Builder setServiceAccounts(List serviceAccounts) { - this.serviceAccounts = ImmutableList.copyOf(checkNotNull(serviceAccounts)); - return this; - } - - @Override - public Builder setSchedulingOptions(SchedulingOptions schedulingOptions) { - this.schedulingOptions = schedulingOptions; - return this; - } - - @Override - Builder setCpuPlatform(String cpuPlatform) { - this.cpuPlatform = cpuPlatform; - return this; - } - - @Override - public InstanceInfo build() { - checkNotNull(attachedDisks); - checkNotNull(networkInterfaces); - return new InstanceInfo(this); - } - } - - InstanceInfo(BuilderImpl builder) { - this.generatedId = builder.generatedId; - this.instanceId = builder.instanceId; - this.creationTimestamp = builder.creationTimestamp; - this.description = builder.description; - this.status = builder.status; - this.statusMessage = builder.statusMessage; - this.tags = builder.tags; - this.machineType = builder.machineType; - this.canIpForward = builder.canIpForward; - this.networkInterfaces = builder.networkInterfaces; - this.attachedDisks = builder.attachedDisks; - this.metadata = builder.metadata; - this.serviceAccounts = builder.serviceAccounts; - this.schedulingOptions = builder.schedulingOptions; - this.cpuPlatform = builder.cpuPlatform; - } - - /** - * Returns the service-generated unique identifier for the instance. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the instance identity. - */ - public InstanceId getInstanceId() { - return instanceId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns a textual description of the instance. - */ - public String getDescription() { - return description; - } - - /** - * Returns the status of the instance. - */ - public Status getStatus() { - return status; - } - - /** - * Returns an optional, human-readable explanation of the status. - */ - public String getStatusMessage() { - return statusMessage; - } - - /** - * Returns the tags of this instance. Tags are used to identify valid sources or targets for - * network firewalls. - */ - public Tags getTags() { - return tags; - } - - /** - * Returns the machine type identity. - */ - public MachineTypeId getMachineType() { - return machineType; - } - - /** - * Returns whether to allow 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. - * - * @see Enabling IP - * Forwarding - */ - public Boolean canIpForward() { - return canIpForward; - } - - /** - * Returns a list of network interfaces. This specifies how this instance is configured to - * interact with other network services, such as connecting to the internet. - */ - public List getNetworkInterfaces() { - return networkInterfaces; - } - - /** - * Returns a list of disks attached to the instance. - */ - public List getAttachedDisks() { - return attachedDisks; - } - - /** - * Returns the instance metadata. - */ - public Metadata getMetadata() { - return metadata; - } - - /** - * Returns a list of service accounts, with their specified scopes, authorized for this instance. - * Service accounts generate access tokens that can be accessed through the metadata server and - * used to authenticate applications on the instance. - * - * @see Authenticating from - * Google Compute Engine - */ - public List getServiceAccounts() { - return serviceAccounts; - } - - /** - * Returns the scheduling options for the instance. - */ - public SchedulingOptions getSchedulingOptions() { - return schedulingOptions; - } - - /** - * Returns the CPU platform used by this instance. - */ - public String getCpuPlatform() { - return cpuPlatform; - } - - /** - * Returns a builder for the current instance. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("instanceId", instanceId) - .add("creationTimestamp", creationTimestamp) - .add("description", description) - .add("status", status) - .add("statusMessage", statusMessage) - .add("tags", tags) - .add("machineType", machineType) - .add("canIpForward", canIpForward) - .add("networkInterfaces", networkInterfaces) - .add("attachedDisks", attachedDisks) - .add("metadata", metadata) - .add("serviceAccounts", serviceAccounts) - .add("schedulingOptions", schedulingOptions) - .add("cpuPlatform", cpuPlatform) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(generatedId, instanceId, creationTimestamp, description, status, - statusMessage, tags, machineType, canIpForward, networkInterfaces, attachedDisks, metadata, - serviceAccounts, schedulingOptions, cpuPlatform); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(InstanceInfo.class) - && Objects.equals(toPb(), ((InstanceInfo) obj).toPb()); - } - - InstanceInfo setProjectId(final String projectId) { - Builder builder = toBuilder(); - builder.setNetworkInterfaces(Lists.transform(networkInterfaces, - new Function() { - @Override - public NetworkInterface apply(NetworkInterface networkInterface) { - return networkInterface.setProjectId(projectId); - } - })); - builder.setAttachedDisks(Lists.transform(attachedDisks, - new Function() { - @Override - public AttachedDisk apply(AttachedDisk attachedDisk) { - return attachedDisk.setProjectId(projectId); - } - })); - return builder.setInstanceId(instanceId.setProjectId(projectId)) - .setMachineType(machineType.setProjectId(projectId)) - .build(); - } - - Instance toPb() { - Instance instancePb = new Instance(); - if (generatedId != null) { - instancePb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - instancePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - instancePb.setName(instanceId.getInstance()); - instancePb.setDescription(description); - instancePb.setSelfLink(instanceId.getSelfLink()); - instancePb.setZone(instanceId.getZoneId().getSelfLink()); - if (status != null) { - instancePb.setStatus(status.name()); - } - instancePb.setStatusMessage(statusMessage); - if (tags != null) { - instancePb.setTags(tags.toPb()); - } - if (machineType != null) { - instancePb.setMachineType(machineType.getSelfLink()); - } - instancePb.setCanIpForward(canIpForward); - if (networkInterfaces != null) { - instancePb.setNetworkInterfaces( - Lists.transform(networkInterfaces, NetworkInterface.TO_PB_FUNCTION)); - } - if (attachedDisks != null) { - instancePb.setDisks(Lists.transform(attachedDisks, AttachedDisk.TO_PB_FUNCTION)); - } - if (metadata != null) { - instancePb.setMetadata(metadata.toPb()); - } - if (serviceAccounts != null) { - instancePb.setServiceAccounts( - Lists.transform(serviceAccounts, ServiceAccount.TO_PB_FUNCTION)); - } - if (schedulingOptions != null) { - instancePb.setScheduling(schedulingOptions.toPb()); - } - instancePb.setCpuPlatform(cpuPlatform); - return instancePb; - } - - /** - * Returns a builder for an {@code InstanceInfo} object given the instance identity and the - * machine type. - */ - public static Builder newBuilder(InstanceId instanceId, MachineTypeId machineType) { - return new BuilderImpl(instanceId).setMachineType(machineType); - } - - /** - * Returns an {@code InstanceInfo} object given the instance identity, the machine type, a disk - * to attach to the instance and a network interface. {@code disk} must be a boot disk (i.e. - * {@link AttachedDisk.AttachedDiskConfiguration#boot()} returns {@code true}). - */ - public static InstanceInfo of(InstanceId instanceId, MachineTypeId machineType, AttachedDisk disk, - NetworkInterface networkInterface) { - return newBuilder(instanceId, machineType) - .setAttachedDisks(ImmutableList.of(disk)) - .setNetworkInterfaces(ImmutableList.of(networkInterface)) - .build(); - } - - static InstanceInfo fromPb(Instance instancePb) { - return new BuilderImpl(instancePb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java deleted file mode 100644 index c848aca8fda8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.io.Serializable; -import java.util.Objects; - -/** - * A Google Compute Engine License. A License represents a software license. Licenses are used to - * track software usage in images, persistent disks, snapshots, and virtual machine instances. - * - * @see Licenses - */ -public class License implements Serializable { - - private static final long serialVersionUID = 6907923910319640363L; - - private final LicenseId licenseId; - private final Boolean chargesUseFee; - - License(LicenseId licenseId, Boolean chargesUseFee) { - this.licenseId = checkNotNull(licenseId); - this.chargesUseFee = chargesUseFee; - } - - /** - * Returns the identity of the license. - */ - public LicenseId getLicenseId() { - return licenseId; - } - - /** - * Returns {@code true} if the customer will be charged a license fee for running software that - * contains this license on an instance. - */ - public Boolean chargesUseFee() { - return chargesUseFee; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("licenseId", licenseId) - .add("chargesUseFee", chargesUseFee) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(licenseId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(License.class) - && Objects.equals(toPb(), ((License) obj).toPb()); - } - - com.google.api.services.compute.model.License toPb() { - com.google.api.services.compute.model.License licensePb = - new com.google.api.services.compute.model.License(); - licensePb.setName(licenseId.getLicense()); - licensePb.setChargesUseFee(chargesUseFee); - licensePb.setSelfLink(licenseId.getSelfLink()); - return licensePb; - } - - static License fromPb(com.google.api.services.compute.model.License licensePb) { - return new License(LicenseId.fromUrl(licensePb.getSelfLink()), licensePb.getChargesUseFee()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java deleted file mode 100644 index 310492769b8d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine license. - */ -public final class LicenseId extends ResourceId { - - static final Function FROM_URL_FUNCTION = new Function() { - @Override - public LicenseId apply(String pb) { - return LicenseId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = new Function() { - @Override - public String apply(LicenseId licenseId) { - return licenseId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "global/licenses/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -2239484554024469651L; - - private final String license; - - private LicenseId(String project, String license) { - super(project); - this.license = checkNotNull(license); - } - - /** - * Returns the name of the license. - */ - public String getLicense() { - return license; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/licenses/" + license; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("license", license); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), license); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof LicenseId)) { - return false; - } - LicenseId other = (LicenseId) obj; - return baseEquals(other) && Objects.equals(license, other.license); - } - - @Override - LicenseId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return LicenseId.of(projectId, license); - } - - /** - * Returns a license identity given the license name. - */ - public static LicenseId of(String license) { - return new LicenseId(null, license); - } - - /** - * Returns a license identity given project and license names. - */ - public static LicenseId of(String project, String license) { - return new LicenseId(project, license); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a license URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static LicenseId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid license URL"); - } - return LicenseId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java deleted file mode 100644 index 795a534c4c73..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.services.compute.model.MachineType.ScratchDisks; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine machine type. A machine type determine the virtualized hardware - * specifications of your virtual machine instances, such as the amount of memory or number of - * virtual CPUs. - * - * @see Machine Types - */ -public class MachineType implements Serializable { - - static final Function - FROM_PB_FUNCTION = - new Function() { - @Override - public MachineType apply(com.google.api.services.compute.model.MachineType pb) { - return MachineType.fromPb(pb); - } - }; - static final Function - TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.MachineType apply(MachineType type) { - return type.toPb(); - } - }; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private static final long serialVersionUID = -4210962597502860450L; - - private final MachineTypeId machineTypeId; - private final String generatedId; - private final Long creationTimestamp; - private final String description; - private final Integer cpus; - private final Integer memoryMb; - private final List scratchDisksSizeGb; - private final Integer maximumPersistentDisks; - private final Long maximumPersistentDisksSizeGb; - private final DeprecationStatus deprecationStatus; - - static final class Builder { - - private MachineTypeId machineTypeId; - private String generatedId; - private Long creationTimestamp; - private String description; - private Integer cpus; - private Integer memoryMb; - private List scratchDisksSizeGb; - private Integer maximumPersistentDisks; - private Long maximumPersistentDisksSizeGb; - private DeprecationStatus deprecationStatus; - - private Builder() {} - - Builder setMachineTypeId(MachineTypeId machineTypeId) { - this.machineTypeId = machineTypeId; - return this; - } - - Builder setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - Builder setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - Builder setDescription(String description) { - this.description = description; - return this; - } - - Builder setCpus(Integer cpus) { - this.cpus = cpus; - return this; - } - - Builder setMemoryMb(Integer memoryMb) { - this.memoryMb = memoryMb; - return this; - } - - Builder setScratchDisksSizeGb(List scratchDisksSizeGb) { - this.scratchDisksSizeGb = scratchDisksSizeGb; - return this; - } - - Builder setMaximumPersistentDisks(Integer maximumPersistentDisks) { - this.maximumPersistentDisks = maximumPersistentDisks; - return this; - } - - Builder setMaximumPersistentDisksSizeGb(Long maximumPersistentDisksSizeGb) { - this.maximumPersistentDisksSizeGb = maximumPersistentDisksSizeGb; - return this; - } - - Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { - this.deprecationStatus = deprecationStatus; - return this; - } - - MachineType build() { - return new MachineType(this); - } - } - - private MachineType(Builder builder) { - this.machineTypeId = builder.machineTypeId; - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.description = builder.description; - this.cpus = builder.cpus; - this.memoryMb = builder.memoryMb; - this.scratchDisksSizeGb = builder.scratchDisksSizeGb; - this.maximumPersistentDisks = builder.maximumPersistentDisks; - this.maximumPersistentDisksSizeGb = builder.maximumPersistentDisksSizeGb; - this.deprecationStatus = builder.deprecationStatus; - } - - /** - * Returns the machine type's identity. - */ - public MachineTypeId getMachineTypeId() { - return machineTypeId; - } - - /** - * Returns the service-generated unique identifier for the machine type. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns an optional textual description of the machine type. - */ - public String getDescription() { - return description; - } - - /** - * Returns the number of virtual CPUs that are available to the instance. - */ - public Integer getCpus() { - return cpus; - } - - /** - * Returns the amount of physical memory available to the instance, defined in MB. - */ - public Integer getMemoryMb() { - return memoryMb; - } - - /** - * Returns the size of all extended scratch disks assigned to the instance, defined in GB. - */ - public List getScratchDisksSizeGb() { - return scratchDisksSizeGb; - } - - /** - * Returns the maximum number of persistent disks allowed by this instance type. - */ - public Integer getMaximumPersistentDisks() { - return maximumPersistentDisks; - } - - /** - * Returns the maximum total persistent disks size allowed, defined in GB. - */ - public Long getMaximumPersistentDisksSizeGb() { - return maximumPersistentDisksSizeGb; - } - - /** - * Returns the deprecation status of the machine type. If {@link DeprecationStatus#getStatus()} is - * either {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} - * the machine type should not be used. Returns {@code null} if the machine type is not - * deprecated. - */ - public DeprecationStatus getDeprecationStatus() { - return deprecationStatus; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("machineTypeId", machineTypeId) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("description", description) - .add("cpus", cpus) - .add("memoryMb", memoryMb) - .add("scratchDisksSizeGb", scratchDisksSizeGb) - .add("maximumPersistentDisks", maximumPersistentDisks) - .add("maximumPersistentDisksSizeGb", maximumPersistentDisksSizeGb) - .add("deprecationStatus", deprecationStatus) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(machineTypeId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(MachineType.class) - && Objects.equals(toPb(), ((MachineType) obj).toPb()); - } - - com.google.api.services.compute.model.MachineType toPb() { - com.google.api.services.compute.model.MachineType machineTypePb = - new com.google.api.services.compute.model.MachineType(); - if (generatedId != null) { - machineTypePb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - machineTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - machineTypePb.setName(machineTypeId.getType()); - machineTypePb.setDescription(description); - machineTypePb.setSelfLink(machineTypeId.getSelfLink()); - machineTypePb.setGuestCpus(cpus); - machineTypePb.setMemoryMb(memoryMb); - if (scratchDisksSizeGb != null) { - machineTypePb.setScratchDisks(Lists.transform(scratchDisksSizeGb, - new Function() { - @Override - public ScratchDisks apply(Integer diskSize) { - return new ScratchDisks().setDiskGb(diskSize); - } - })); - } - machineTypePb.setMaximumPersistentDisks(maximumPersistentDisks); - machineTypePb.setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb); - machineTypePb.setZone(machineTypeId.getZoneId().getZone()); - if (deprecationStatus != null) { - machineTypePb.setDeprecated(deprecationStatus.toPb()); - } - return machineTypePb; - } - - static Builder newBuilder() { - return new Builder(); - } - - static MachineType fromPb(com.google.api.services.compute.model.MachineType machineTypePb) { - Builder builder = newBuilder(); - builder.setMachineTypeId(MachineTypeId.fromUrl(machineTypePb.getSelfLink())); - if (machineTypePb.getId() != null) { - builder.setGeneratedId(machineTypePb.getId().toString()); - } - if (machineTypePb.getCreationTimestamp() != null) { - builder.setCreationTimestamp( - TIMESTAMP_FORMATTER.parseMillis(machineTypePb.getCreationTimestamp())); - } - builder.setDescription(machineTypePb.getDescription()); - builder.setCpus(machineTypePb.getGuestCpus()); - builder.setMemoryMb(machineTypePb.getMemoryMb()); - if (machineTypePb.getScratchDisks() != null) { - builder.setScratchDisksSizeGb( - Lists.transform(machineTypePb.getScratchDisks(), new Function() { - @Override - public Integer apply(ScratchDisks scratchDiskPb) { - return scratchDiskPb.getDiskGb(); - } - })); - } - builder.setMaximumPersistentDisks(machineTypePb.getMaximumPersistentDisks()); - builder.setMaximumPersistentDisksSizeGb(machineTypePb.getMaximumPersistentDisksSizeGb()); - if (machineTypePb.getDeprecated() != null) { - builder.setDeprecationStatus( - DeprecationStatus.fromPb(machineTypePb.getDeprecated(), MachineTypeId.FROM_URL_FUNCTION)); - } - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java deleted file mode 100644 index d5838a0e53f8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine machine type. - */ -public final class MachineTypeId extends ResourceId { - - static final Function FROM_URL_FUNCTION = - new Function() { - @Override - public MachineTypeId apply(String pb) { - return MachineTypeId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = - new Function() { - @Override - public String apply(MachineTypeId machineTypeId) { - return machineTypeId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/machineTypes/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -5819598544478859608L; - - private final String zone; - private final String type; - - private MachineTypeId(String project, String zone, String type) { - super(project); - this.zone = checkNotNull(zone); - this.type = checkNotNull(type); - } - - /** - * Returns the name of the machine type. - */ - public String getType() { - return type; - } - - /** - * Returns the name of the zone this machine type belongs to. - */ - public String getZone() { - return zone; - } - - /** - * Returns the identity of the zone this machine type belongs to. - */ - public ZoneId getZoneId() { - return ZoneId.of(getProject(), zone); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/zones/" + zone + "/machineTypes/" + type; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("zone", zone).add("type", type); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), zone, type); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof MachineTypeId)) { - return false; - } - MachineTypeId other = (MachineTypeId) obj; - return baseEquals(other) - && Objects.equals(zone, other.zone) - && Objects.equals(type, other.type); - } - - @Override - MachineTypeId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return MachineTypeId.of(projectId, zone, type); - } - - /** - * Returns a machine type identity given the zone and type names. - */ - public static MachineTypeId of(String zone, String type) { - return new MachineTypeId(null, zone, type); - } - - /** - * Returns a machine type identity given project, zone and type names. - */ - public static MachineTypeId of(String project, String zone, String type) { - return new MachineTypeId(project, zone, type); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a machine type URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static MachineTypeId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid machine type URL"); - } - return MachineTypeId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java deleted file mode 100644 index 1584fb765377..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * Metadata for Google Compute Engine Instance as ket/value pairs. This includes custom metadata - * and predefined keys. - * - * @see Metadata - */ -public final class Metadata implements Serializable { - - static final Function - FROM_PB_FUNCTION = - new Function() { - @Override - public Metadata apply(com.google.api.services.compute.model.Metadata pb) { - return Metadata.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Metadata apply(Metadata metadata) { - return metadata.toPb(); - } - }; - - private static final long serialVersionUID = -945038809838910107L; - - private final Map values; - private final String fingerprint; - - /** - * A builder for {@code Metadata} objects. - */ - public static final class Builder { - - private Map values; - private String fingerprint; - - Builder() { - values = Maps.newHashMap(); - } - - Builder(Metadata metadata) { - this.values = metadata.values != null ? Maps.newHashMap(metadata.values) - : Maps.newHashMap(); - this.fingerprint = metadata.fingerprint; - } - - /** - * Sets the metadata for the instance as key/value pairs. The total size of all keys and - * values must be less than 512 KB. Keys must conform to the following regexp: - * {@code [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. Values must be less than or equal to 32768 bytes. - */ - public Builder setValues(Map values) { - this.values = Maps.newHashMap(checkNotNull(values)); - return this; - } - - /** - * Adds a key/value pair to the instance metadata. The total size of all keys and values must - * be less than 512 KB. Keys must conform to the following regexp: {@code [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. Values must be less than or equal to 32768 bytes. - */ - public Builder add(String key, String value) { - this.values.put(key, value); - return this; - } - - /** - * Sets the fingerprint for the metadata. This value can be used to update instance's - * metadata. - */ - public Builder setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Creates a {@code Metadata} object. - */ - public Metadata build() { - return new Metadata(this); - } - } - - private Metadata(Builder builder) { - this.values = ImmutableMap.copyOf(builder.values); - this.fingerprint = builder.fingerprint; - } - - /** - * Returns instance's metadata as key/value pairs. - */ - public Map getValues() { - return values; - } - - /** - * Returns the fingerprint for the metadata. This value can be used to update instance's - * metadata. - */ - public String getFingerprint() { - return fingerprint; - } - - /** - * Returns a builder for the current instance metadata. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("values", values) - .add("fingerprint", fingerprint) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(values, fingerprint); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj instanceof Metadata - && Objects.equals(toPb(), ((Metadata) obj).toPb()); - } - - com.google.api.services.compute.model.Metadata toPb() { - com.google.api.services.compute.model.Metadata metadataPb = - new com.google.api.services.compute.model.Metadata(); - metadataPb.setFingerprint(fingerprint); - List itemsPb = - Lists.newArrayListWithCapacity(values.size()); - for (Map.Entry entry : values.entrySet()) { - itemsPb.add(new com.google.api.services.compute.model.Metadata.Items() - .setKey(entry.getKey()).setValue(entry.getValue())); - } - metadataPb.setItems(itemsPb); - metadataPb.setFingerprint(fingerprint); - return metadataPb; - } - - /** - * Returns a builder for a {@code Metadata} object. - */ - public static Builder newBuilder() { - return new Builder(); - } - - /** - * Returns a {@code Metadata} object given the the metadata as a map. The total size of all keys - * and values must be less than 512 KB. Keys must conform to the following regexp: - * {@code [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. Values must be less than or equal to 32768 bytes. - */ - public static Metadata of(Map values) { - return newBuilder().setValues(values).build(); - } - - static Metadata fromPb(com.google.api.services.compute.model.Metadata metadataPb) { - Builder builder = newBuilder(); - if (metadataPb.getItems() != null) { - Map metadataValues = - Maps.newHashMapWithExpectedSize(metadataPb.getItems().size()); - for (com.google.api.services.compute.model.Metadata.Items item : metadataPb.getItems()) { - metadataValues.put(item.getKey(), item.getValue()); - } - builder.setValues(metadataValues); - } - return builder.setFingerprint(metadataPb.getFingerprint()).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java deleted file mode 100644 index 84ae46e7f956..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.Compute.NetworkOption; -import com.google.cloud.compute.deprecated.Compute.OperationOption; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.Objects; - -/** - * A Google Compute Engine Network. Every virtual machine instance is created as a member of a - * network. Networks connect instances to each other and to the Internet. You can segment your - * networks, use firewall rules to restrict access to instances, and create static routes to forward - * traffic to specific destinations. Objects of this class are immutable. To get a {@code Network} - * object with the most recent information use {@link #reload}. {@code Network} adds a layer of - * service-related functionality over {@link NetworkInfo}. - * - * @see Using Networks and Firewalls - */ -public class Network extends NetworkInfo { - - private static final long serialVersionUID = 8608280908101278096L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Network} objects. - */ - public static class Builder extends NetworkInfo.Builder { - - private final Compute compute; - private final NetworkInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, NetworkId networkId, NetworkConfiguration configuration) { - this.compute = compute; - this.infoBuilder = new NetworkInfo.BuilderImpl(networkId, configuration); - this.infoBuilder.setNetworkId(networkId); - this.infoBuilder.setConfiguration(configuration); - } - - Builder(Network subnetwork) { - this.compute = subnetwork.compute; - this.infoBuilder = new NetworkInfo.BuilderImpl(subnetwork); - } - - @Override - Builder setGeneratedId(String generatedId) { - infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - infoBuilder.setCreationTimestamp(creationTimestamp); - return this; - } - - @Override - public Builder setNetworkId(NetworkId networkId) { - infoBuilder.setNetworkId(networkId); - return this; - } - - @Override - public Builder setDescription(String description) { - infoBuilder.setDescription(description); - return this; - } - - @Override - public Builder setConfiguration(NetworkConfiguration configuration) { - infoBuilder.setConfiguration(configuration); - return this; - } - - @Override - public Network build() { - return new Network(compute, infoBuilder); - } - } - - Network(Compute compute, NetworkInfo.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this network exists. - * - * @return {@code true} if this network exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(NetworkOption.fields()) != null; - } - - /** - * Fetches current network' latest information. Returns {@code null} if the network does not - * exist. - * - * @param options network options - * @return a {@code Network} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Network reload(NetworkOption... options) { - return compute.getNetwork(getNetworkId().getNetwork(), options); - } - - /** - * Deletes this network. - * - * @return an operation object if delete request was successfully sent, {@code null} if the - * network was not found - * @throws ComputeException upon failure - */ - public Operation delete(OperationOption... options) { - return compute.deleteNetwork(getNetworkId().getNetwork(), options); - } - - /** - * Creates a subnetwork for this network given its identity and the range of IPv4 addresses in - * CIDR format. Subnetwork creation is only supported for networks in "custom subnet mode" (i.e. - * {@link #getConfiguration()} returns a {@link SubnetNetworkConfiguration}) with automatic - * creation of subnetworks disabled (i.e. {@link SubnetNetworkConfiguration#autoCreateSubnetworks()} - * returns {@code false}). - * - * @return an operation object if creation request was successfully sent - * @throws ComputeException upon failure - * @see CIDR - */ - public Operation createSubnetwork(SubnetworkId subnetworkId, String ipRange, - OperationOption... options) { - return compute.create(SubnetworkInfo.of(subnetworkId, getNetworkId(), ipRange), options); - } - - /** - * Returns the network's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Network.class)) { - return false; - } - Network other = (Network) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Network fromPb(Compute compute, - com.google.api.services.compute.model.Network networkPb) { - return new Network(compute, new NetworkInfo.BuilderImpl(networkPb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java deleted file mode 100644 index 8ccc947b950f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.services.compute.model.Network; -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; - -import java.io.Serializable; -import java.util.Objects; - -/** - * Base class for Google Compute Engine network configuration. Use - * {@link StandardNetworkConfiguration} to create a standard network with associated address range. - * Use {@link SubnetNetworkConfiguration} to create a network that supports subnetworks, up to one - * per region, each with its own address range. - * - * @see Using Networks and Firewalls - */ -public abstract class NetworkConfiguration implements Serializable { - - private static final long serialVersionUID = 6599798536784576564L; - - private final Type type; - - /** - * Type of a Google Compute Engine disk configuration. - */ - public enum Type { - /** - * A Google Compute Engine network with no subnetworks. - */ - STANDARD, - - /** - * A Google Compute Engine network that supports the creation of subnetworks (either automatic - * or manual). - */ - SUBNET - } - - NetworkConfiguration(Type type) { - this.type = type; - } - - /** - * Returns the network's type. This method returns {@link Type#STANDARD} for a standard networks - * with no subnetworks. This method returns {@link Type#SUBNET} for a network that supports the - * creation of subnetworks (either automatic or manual). - */ - public Type getType() { - return type; - } - - ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("type", type); - } - - @Override - public String toString() { - return toStringHelper().toString(); - } - - final int baseHashCode() { - return Objects.hash(type); - } - - final boolean baseEquals(NetworkConfiguration networkConfiguration) { - return networkConfiguration != null - && getClass().equals(networkConfiguration.getClass()) - && Objects.equals(toPb(), networkConfiguration.toPb()); - } - - abstract Network toPb(); - - @SuppressWarnings("unchecked") - static T fromPb(Network networkPb) { - if (networkPb.getIPv4Range() != null) { - return (T) StandardNetworkConfiguration.fromPb(networkPb); - } else { - return (T) SubnetNetworkConfiguration.fromPb(networkPb); - } - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java deleted file mode 100644 index 111732e0c338..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects.ToStringHelper; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine network. - */ -public final class NetworkId extends ResourceId { - - private static final String REGEX = ResourceId.REGEX + "global/networks/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 2386765228138819506L; - - private final String network; - - NetworkId(String project, String network) { - super(project); - this.network = checkNotNull(network); - } - - private NetworkId(NetworkId networkId) { - super(networkId.getProject()); - this.network = checkNotNull(networkId.getNetwork()); - } - - /** - * Returns the name of the network. The network name must be 1-63 characters long and comply with - * RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getNetwork() { - return network; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/networks/" + network; - } - - @Override - ToStringHelper toStringHelper() { - return super.toStringHelper().add("network", network); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), network); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof NetworkId)) { - return false; - } - NetworkId other = (NetworkId) obj; - return baseEquals(other) && Objects.equals(network, other.network); - } - - @Override - NetworkId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return NetworkId.of(projectId, network); - } - - /** - * Returns a new network identity given project and network names. The network name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static NetworkId of(String project, String network) { - return new NetworkId(project, network); - } - - /** - * Returns a new network identity given network name. The network name must be 1-63 characters - * long and comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public static NetworkId of(String network) { - return NetworkId.of(null, network); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a network URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static NetworkId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid network URL"); - } - return NetworkId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java deleted file mode 100644 index 722ef57f1231..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Network; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.Objects; - -/** - * A Google Compute Engine Network. Every virtual machine instance is created as a member of a - * network. Networks connect instances to each other and to the Internet. You can segment your - * networks, use firewall rules to restrict access to instances, and create static routes to forward - * traffic to specific destinations. - * - *

A network lives in a project and is isolated from other networks in the project. A project can - * have up to five different networks. - * - * @see Using Networks and Firewalls - */ -public class NetworkInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public NetworkInfo apply(Network pb) { - return NetworkInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Network apply(NetworkInfo network) { - return network.toPb(); - } - }; - - private static final long serialVersionUID = 4336912581538114026L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final NetworkId networkId; - private final Long creationTimestamp; - private final String description; - private final NetworkConfiguration configuration; - - /** - * A builder for {@code NetworkInfo} objects. - */ - public abstract static class Builder { - - abstract Builder setGeneratedId(String generatedId); - - abstract Builder setCreationTimestamp(Long creationTimestamp); - - /** - * Sets the identity of the network. - */ - public abstract Builder setNetworkId(NetworkId networkId); - - /** - * Sets an optional textual description of the network. - */ - public abstract Builder setDescription(String description); - - /** - * Sets the network configuration. Use {@link StandardNetworkConfiguration} to create a standard - * network with associated IPv4 range. Use {@link SubnetNetworkConfiguration} to create a - * network that could be divided into subnetworks, up to one per region, each with its own - * address range. - */ - public abstract Builder setConfiguration(NetworkConfiguration configuration); - - /** - * Creates a {@code NetworkInfo} object. - */ - public abstract NetworkInfo build(); - } - - static final class BuilderImpl extends Builder { - - private String generatedId; - private NetworkId networkId; - private Long creationTimestamp; - private String description; - private NetworkConfiguration configuration; - - BuilderImpl(NetworkId networkId, NetworkConfiguration configuration) { - this.networkId = checkNotNull(networkId); - this.configuration = checkNotNull(configuration); - } - - BuilderImpl(NetworkInfo networkInfo) { - this.generatedId = networkInfo.generatedId; - this.creationTimestamp = networkInfo.creationTimestamp; - this.networkId = networkInfo.networkId; - this.description = networkInfo.description; - this.configuration = networkInfo.configuration; - } - - BuilderImpl(Network networkPb) { - if (networkPb.getId() != null) { - this.generatedId = networkPb.getId().toString(); - } - if (networkPb.getCreationTimestamp() != null) { - this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(networkPb.getCreationTimestamp()); - } - this.networkId = NetworkId.fromUrl(networkPb.getSelfLink()); - this.description = networkPb.getDescription(); - this.configuration = NetworkConfiguration.fromPb(networkPb); - } - - @Override - BuilderImpl setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - BuilderImpl setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - public BuilderImpl setNetworkId(NetworkId networkId) { - this.networkId = checkNotNull(networkId); - return this; - } - - @Override - public BuilderImpl setDescription(String description) { - this.description = description; - return this; - } - - @Override - public BuilderImpl setConfiguration(NetworkConfiguration configuration) { - this.configuration = checkNotNull(configuration); - return this; - } - - @Override - public NetworkInfo build() { - return new NetworkInfo(this); - } - } - - NetworkInfo(BuilderImpl builder) { - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.networkId = builder.networkId; - this.description = builder.description; - this.configuration = builder.configuration; - } - - /** - * Returns the service-generated unique identifier for the network. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns the network identity. - */ - public NetworkId getNetworkId() { - return networkId; - } - - /** - * Returns a textual description of the network. - */ - public String getDescription() { - return description; - } - - /** - * Returns the network configuration. Returns a {@link StandardNetworkConfiguration} for standard - * networks with associated IPv4 range. Returns {@link SubnetNetworkConfiguration} for networks - * that could be divided into subnetworks, up to one per region, each with its own address range. - */ - @SuppressWarnings("unchecked") - public T getConfiguration() { - return (T) configuration; - } - - /** - * Returns a builder for the current network. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("networkId", networkId) - .add("description", description) - .add("configuration", configuration) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(generatedId, networkId, creationTimestamp, description, configuration); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(NetworkInfo.class) - && Objects.equals(toPb(), ((NetworkInfo) obj).toPb()); - } - - NetworkInfo setProjectId(String projectId) { - return toBuilder() - .setNetworkId(networkId.setProjectId(projectId)) - .build(); - } - - Network toPb() { - Network networkPb = configuration.toPb(); - if (generatedId != null) { - networkPb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - networkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - networkPb.setName(networkId.getNetwork()); - networkPb.setDescription(description); - networkPb.setSelfLink(networkId.getSelfLink()); - return networkPb; - } - - /** - * Returns a builder for a {@code NetworkInfo} object given the network identity and its - * configuration. Use {@link StandardNetworkConfiguration} to create a standard network with - * associated address range. Use {@link SubnetNetworkConfiguration} to create a network that - * supports subnetworks, up to one per region, each with its own address range. - */ - public static Builder newBuilder(NetworkId networkId, NetworkConfiguration configuration) { - return new BuilderImpl(networkId, configuration); - } - - /** - * Returns a {@code NetworkInfo} object given the network identity. Use - * {@link StandardNetworkConfiguration} to create a standard network with associated address - * range. Use {@link SubnetNetworkConfiguration} to create a network that supports subnetworks, up - * to one per region, each with its own address range. - */ - public static NetworkInfo of(NetworkId networkId, NetworkConfiguration configuration) { - return newBuilder(networkId, configuration).build(); - } - - static NetworkInfo fromPb(Network networkPb) { - return new BuilderImpl(networkPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java deleted file mode 100644 index 316611af24d7..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.core.ApiFunction; -import com.google.cloud.StringEnumType; -import com.google.cloud.StringEnumValue; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** - * A network interface for a Google Compute Engine instance. Network interfaces specify how - * the instance is configured to interact with other network services, such as connecting to the - * internet. - * - * @see Configuring an - * Instance's IP Addresses - */ -public class NetworkInterface implements Serializable { - - static final Function - FROM_PB_FUNCTION = - new Function() { - @Override - public NetworkInterface apply( - com.google.api.services.compute.model.NetworkInterface pb) { - return NetworkInterface.fromPb(pb); - } - }; - static final Function - TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.NetworkInterface apply( - NetworkInterface networkInterface) { - return networkInterface.toPb(); - } - }; - - private static final long serialVersionUID = 936741262053605581L; - - private final String name; - private final NetworkId network; - private final String networkIp; - private final SubnetworkId subnetwork; - private final List accessConfigurations; - - /** - * Access configuration for a Google Compute Engine instance's network interface. Objects of this - * class can be used to assign either a static or an ephemeral external IP address to Google - * Compute Engine instances. - * - * @see - * Static external IP addresses - * @see - * Ephemeral external IP addresses - */ - public static final class AccessConfig implements Serializable { - - static final Function - FROM_PB_FUNCTION = - new Function() { - @Override - public AccessConfig apply(com.google.api.services.compute.model.AccessConfig pb) { - return AccessConfig.fromPb(pb); - } - }; - static final Function - TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.AccessConfig apply( - AccessConfig instance) { - return instance.toPb(); - } - }; - - private static final long serialVersionUID = -5438060668934041567L; - - private final String name; - private final String natIp; - private final Type type; - - /** - * The type of network access configuration. The only supported value is {@code ONE_TO_ONE_NAT}. - */ - public static final class Type extends StringEnumValue { - private static final long serialVersionUID = -1181560540824208967L; - - private static final ApiFunction CONSTRUCTOR = - new ApiFunction() { - @Override - public Type apply(String constant) { - return new Type(constant); - } - }; - - private static final StringEnumType type = new StringEnumType( - Type.class, - CONSTRUCTOR); - - public static final Type ONE_TO_ONE_NAT = type.createAndRegister("ONE_TO_ONE_NAT"); - - private Type(String constant) { - super(constant); - } - - /** - * Get the Type for the given String constant, and throw an exception if the constant is - * not recognized. - */ - public static Type valueOfStrict(String constant) { - return type.valueOfStrict(constant); - } - - /** - * Get the Type for the given String constant, and allow unrecognized values. - */ - public static Type valueOf(String constant) { - return type.valueOf(constant); - } - - /** - * Return the known values for Type. - */ - public static Type[] values() { - return type.values(); - } - } - - public static final class Builder { - - private String name; - private String natIp; - private Type type; - - private Builder() {} - - private Builder(AccessConfig accessConfig) { - this.name = accessConfig.name; - this.natIp = accessConfig.natIp; - this.type = accessConfig.type; - } - - /** - * Sets the name of the access configuration. - */ - public Builder setName(String name) { - this.name = name; - return this; - } - - /** - * Sets 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. - * - * @see - * Ephemeral external IP addresses - * @see - * Ephemeral external IP addresses - */ - public Builder setNatIp(String natIp) { - this.natIp = natIp; - return this; - } - - /** - * Sets the type of the access configuration. The only supported value is - * {@link Type#ONE_TO_ONE_NAT}. - */ - public Builder setType(Type type) { - this.type = type; - return this; - } - - /** - * Creates an {@code AccessConfig} object. - */ - public AccessConfig build() { - return new AccessConfig(this); - } - } - - AccessConfig(Builder builder) { - this.name = builder.name; - this.natIp = builder.natIp; - this.type = builder.type; - } - - /** - * Returns the name of the access configuration. - */ - public String getName() { - return name; - } - - /** - * Returns an external IP address associated with this instance. - */ - public String getNatIp() { - return natIp; - } - - /** - * Returns the type of network access configuration. The only supported value is - * {@link Type#ONE_TO_ONE_NAT}. - */ - public Type getType() { - return type; - } - - /** - * Returns a builder for the current access configuration. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("name", name) - .add("natIp", natIp) - .add("type", type) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(name, natIp, type); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj instanceof AccessConfig - && Objects.equals(toPb(), ((AccessConfig) obj).toPb()); - } - - com.google.api.services.compute.model.AccessConfig toPb() { - com.google.api.services.compute.model.AccessConfig accessConfigPb = - new com.google.api.services.compute.model.AccessConfig(); - accessConfigPb.setName(name); - accessConfigPb.setNatIP(natIp); - if (type != null) { - accessConfigPb.setType(type.name()); - } - return accessConfigPb; - } - - /** - * Returns a builder for an {@code AccessConfig} object. - */ - public static Builder newBuilder() { - return new Builder(); - } - - /** - * Returns an {@code AccessConfig} object given the static external IP address. - * - * @see - * Static external IP addresses - */ - public static AccessConfig of(String natIp) { - return newBuilder().setNatIp(natIp).build(); - } - - /** - * Returns an {@code AccessConfig} object. IP address for this access configuration will be - * taken from a pool of ephemeral addresses. - * - * @see - * Ephemeral external IP addresses - */ - public static AccessConfig of() { - return newBuilder().build(); - } - - static AccessConfig fromPb(com.google.api.services.compute.model.AccessConfig configPb) { - Builder builder = newBuilder(); - builder.setName(configPb.getName()); - if (configPb.getNatIP() != null) { - builder.setNatIp(configPb.getNatIP()); - } - if (configPb.getType() != null) { - builder.setType(Type.valueOf(configPb.getType())); - } - return builder.build(); - } - } - - public static final class Builder { - - private String name; - private NetworkId network; - private String networkIp; - private SubnetworkId subnetwork; - private List accessConfigurations; - - private Builder(NetworkId network) { - this.network = checkNotNull(network); - } - - private Builder(NetworkInterface networkInterface) { - this.name = networkInterface.name; - this.network = networkInterface.network; - this.networkIp = networkInterface.networkIp; - this.subnetwork = networkInterface.subnetwork; - this.accessConfigurations = networkInterface.accessConfigurations; - } - - Builder setName(String name) { - this.name = name; - return this; - } - - /** - * Sets the identity of the network this interface applies to. - */ - public Builder setNetwork(NetworkId network) { - this.network = checkNotNull(network); - return this; - } - - Builder setNetworkIp(String networkIp) { - this.networkIp = networkIp; - return this; - } - - /** - * Sets the identity of the subnetwork this interface applies to. Setting the subnetwork is - * not necessary when the network is in "automatic subnet mode". - */ - public Builder setSubnetwork(SubnetworkId subnetwork) { - this.subnetwork = subnetwork; - return this; - } - - /** - * Sets a list of access configurations for the network interface. Access configurations can be - * used to assign either a static or an ephemeral external IP address to Google Compute Engine - * instances. At the moment, network interfaces only support one access configuration. - * - * @see - * Static external IP addresses - * @see - * Ephemeral external IP addresses - */ - public Builder setAccessConfigurations(List accessConfigurations) { - this.accessConfigurations = ImmutableList.copyOf(accessConfigurations); - return this; - } - - /** - * Sets a list of access configurations for the network interface. Access configurations can be - * used to assign either a static or an ephemeral external IP address to Google Compute Engine - * instances. At the moment, network interfaces only support one access configuration. - * - * @see - * Static external IP addresses - * @see - * Ephemeral external IP addresses - */ - public Builder setAccessConfigurations(AccessConfig... accessConfigurations) { - setAccessConfigurations(Arrays.asList(accessConfigurations)); - return this; - } - - /** - * Creates a {@code NetworkInterface} object. - */ - public NetworkInterface build() { - return new NetworkInterface(this); - } - } - - private NetworkInterface(Builder builder) { - this.name = builder.name; - this.network = builder.network; - this.networkIp = builder.networkIp; - this.subnetwork = builder.subnetwork; - this.accessConfigurations = builder.accessConfigurations != null - ? builder.accessConfigurations : ImmutableList.of(); - } - - /** - * Returns the name of the network interface, generated by the service. For network devices, - * these are {@code eth0}, {@code eth1}, etc. - */ - public String getName() { - return name; - } - - /** - * Returns the identity of the network this interface applies to. - */ - public NetworkId getNetwork() { - return network; - } - - /** - * An optional IPv4 internal network address assigned by the service to the instance for this - * network interface. - */ - public String getNetworkIp() { - return networkIp; - } - - /** - * Returns the identity of the subnetwork this interface applies to. - */ - public SubnetworkId getSubnetwork() { - return subnetwork; - } - - /** - * Returns a list of access configurations for the network interface. - */ - public List getAccessConfigurations() { - return accessConfigurations; - } - - /** - * Returns a builder for the current network interface. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("name", name) - .add("network", network) - .add("networkIp", networkIp) - .add("subnetwork", subnetwork) - .add("accessConfigurations", accessConfigurations) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(name, network, networkIp, subnetwork, accessConfigurations); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(NetworkInterface.class) - && Objects.equals(toPb(), ((NetworkInterface) obj).toPb()); - } - - com.google.api.services.compute.model.NetworkInterface toPb() { - com.google.api.services.compute.model.NetworkInterface interfacePb = - new com.google.api.services.compute.model.NetworkInterface(); - interfacePb.setName(name); - interfacePb.setNetwork(network.getSelfLink()); - if (subnetwork != null) { - interfacePb.setSubnetwork(subnetwork.getSelfLink()); - } - interfacePb.setNetworkIP(networkIp); - if (accessConfigurations != null) { - interfacePb.setAccessConfigs( - Lists.transform(accessConfigurations, AccessConfig.TO_PB_FUNCTION)); - } - return interfacePb; - } - - NetworkInterface setProjectId(String projectId) { - Builder builder = toBuilder(); - builder.setNetwork(network.setProjectId(projectId)); - if (subnetwork != null) { - builder.setSubnetwork(subnetwork.setProjectId(projectId)); - } - return builder.build(); - } - - /** - * Returns a builder for a {@code NetworkInterface} object given the network's identity. - */ - public static Builder newBuilder(NetworkId networkId) { - return new Builder(networkId); - } - - /** - * Returns a builder for a {@code NetworkInterface} object given the network's name. - */ - public static Builder newBuilder(String network) { - return newBuilder(NetworkId.of(network)); - } - - /** - * Returns a {@code NetworkInterface} object given the network's identity. - */ - public static NetworkInterface of(NetworkId networkId) { - return newBuilder(networkId).build(); - } - - /** - * Returns a {@code NetworkInterface} object given the network's name. - */ - public static NetworkInterface of(String network) { - return newBuilder(network).build(); - } - - static NetworkInterface fromPb( - com.google.api.services.compute.model.NetworkInterface interfacePb) { - Builder builder = newBuilder(NetworkId.fromUrl(interfacePb.getNetwork())) - .setName(interfacePb.getName()); - if (interfacePb.getSubnetwork() != null) { - builder.setSubnetwork(SubnetworkId.fromUrl(interfacePb.getSubnetwork())); - } - builder.setNetworkIp(interfacePb.getNetworkIP()); - builder.setAccessConfigurations(interfacePb.getAccessConfigs() != null - ? Lists.transform(interfacePb.getAccessConfigs(), AccessConfig.FROM_PB_FUNCTION) : - ImmutableList.of()); - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java deleted file mode 100644 index 363f26fbde5f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java +++ /dev/null @@ -1,845 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.gax.retrying.BasicResultRetryAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.cloud.RetryHelper; -import com.google.cloud.RetryOption; -import com.google.cloud.compute.deprecated.Compute.OperationOption; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.threeten.bp.Duration; - -/** - * Google Compute Engine operations. Operation identity can be obtained via {@link - * #getOperationId()}. {@link #getOperationId()} returns {@link GlobalOperationId} for global - * operations, {@link RegionOperationId} for region operations, and {@link ZoneOperationId} for zone - * operations. To get an {@code Operation} object with the most recent information, use {@link - * #reload(Compute.OperationOption...)}. - */ -public class Operation implements Serializable { - - private static final long serialVersionUID = -8979001444590023899L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final RetrySettings DEFAULT_OPERATION_WAIT_SETTINGS = - RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofHours(12L)) - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.0) - .setJittered(false) - .setMaxRetryDelay(Duration.ofMinutes(500L)) - .build(); - - private transient Compute compute; - private final ComputeOptions options; - private final String generatedId; - private final OperationId operationId; - private final String clientOperationId; - private final String operationType; - private final String targetLink; - private final String targetId; - private final Status status; - private final String statusMessage; - private final String user; - private final Integer progress; - private final Long insertTime; - private final Long startTime; - private final Long endTime; - private final List errors; - private final List warnings; - private final Integer httpErrorStatusCode; - private final String httpErrorMessage; - private final String description; - - /** Status of an operation. */ - public enum Status { - PENDING, - RUNNING, - DONE - } - - /** An error that can occur during the processing of a Google Compute Engine operation. */ - public static final class OperationError implements Serializable { - - static final Function FROM_PB_FUNCTION = new Function< - com.google.api.services.compute.model.Operation.Error.Errors, OperationError>() { - @Override - public OperationError apply( - com.google.api.services.compute.model.Operation.Error.Errors pb) { - return OperationError.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Operation.Error.Errors apply( - OperationError operation) { - return operation.toPb(); - } - }; - - private static final long serialVersionUID = -1155314394806515873L; - - private final String code; - private final String location; - private final String message; - - OperationError(String code, String location, String message) { - this.code = code; - this.location = location; - this.message = message; - } - - /** Returns an error type identifier for this error. */ - public String getCode() { - return code; - } - - /** Returns the field in the request which caused the error. This value is optional. */ - public String getLocation() { - return location; - } - - /** Returns an optional, human-readable error message. */ - public String getMessage() { - return message; - } - - com.google.api.services.compute.model.Operation.Error.Errors toPb() { - return new com.google.api.services.compute.model.Operation.Error.Errors() - .setCode(code) - .setLocation(location) - .setMessage(message); - } - - static OperationError fromPb( - com.google.api.services.compute.model.Operation.Error.Errors errorPb) { - return new OperationError(errorPb.getCode(), errorPb.getLocation(), errorPb.getMessage()); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof OperationError - && Objects.equals(code, ((OperationError) obj).code) - && Objects.equals(message, ((OperationError) obj).message) - && Objects.equals(location, ((OperationError) obj).location); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("code", code) - .add("location", location) - .add("message", message) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(code, location, message); - } - } - - /** - * A warning message that is generated during the processing of a Google Compute Engine operation. - */ - public static final class OperationWarning implements Serializable { - - static final - Function - FROM_PB_FUNCTION = - new Function() { - @Override - public OperationWarning apply( - com.google.api.services.compute.model.Operation.Warnings pb) { - return OperationWarning.fromPb(pb); - } - }; - static final - Function - TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Operation.Warnings apply( - OperationWarning operation) { - return operation.toPb(); - } - }; - - private static final long serialVersionUID = 4917326627380228928L; - - private final String code; - private final String message; - private final Map metadata; - - OperationWarning(String code, String message, Map metadata) { - this.code = code; - this.metadata = metadata != null ? ImmutableMap.copyOf(metadata) : null; - this.message = message; - } - - /** - * Returns a warning identifier for this warning. For example, {@code NO_RESULTS_ON_PAGE} if - * there are no results in the response. - */ - public String getCode() { - return code; - } - - /** Returns a human-readable error message. */ - public String getMessage() { - return message; - } - - /** - * Returns metadata about this warning. Each key 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 {@code scope} and the key's 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). - */ - public Map getMetadata() { - return metadata; - } - - com.google.api.services.compute.model.Operation.Warnings toPb() { - com.google.api.services.compute.model.Operation.Warnings warningPb = - new com.google.api.services.compute.model.Operation.Warnings() - .setCode(code) - .setMessage(message); - if (this.metadata != null) { - List metadataPb = - Lists.newArrayListWithCapacity(metadata.size()); - for (Map.Entry entry : metadata.entrySet()) { - metadataPb.add( - new com.google.api.services.compute.model.Operation.Warnings.Data() - .setKey(entry.getKey()) - .setValue(entry.getValue())); - } - warningPb.setData(metadataPb); - } - return warningPb; - } - - static OperationWarning fromPb( - com.google.api.services.compute.model.Operation.Warnings warningPb) { - Map metadata = null; - if (warningPb.getData() != null) { - metadata = Maps.newHashMapWithExpectedSize(warningPb.getData().size()); - for (com.google.api.services.compute.model.Operation.Warnings.Data data : - warningPb.getData()) { - metadata.put(data.getKey(), data.getValue()); - } - } - return new OperationWarning(warningPb.getCode(), warningPb.getMessage(), metadata); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof OperationWarning - && Objects.equals(code, ((OperationWarning) obj).code) - && Objects.equals(message, ((OperationWarning) obj).message) - && Objects.equals(metadata, ((OperationWarning) obj).metadata); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("code", code) - .add("message", message) - .add("metadata", metadata) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, metadata); - } - } - - static final class Builder { - - private Compute compute; - private String generatedId; - private OperationId operationId; - private String clientOperationId; - private String operationType; - private String targetLink; - private String targetId; - private Status status; - private String statusMessage; - private String user; - private Integer progress; - private Long insertTime; - private Long startTime; - private Long endTime; - private List errors; - private List warnings; - private Integer httpErrorStatusCode; - private String httpErrorMessage; - private String description; - - Builder(Compute compute) { - this.compute = compute; - } - - Builder(Compute compute, com.google.api.services.compute.model.Operation operationPb) { - this.compute = compute; - if (operationPb.getId() != null) { - generatedId = operationPb.getId().toString(); - } - if (RegionOperationId.matchesUrl(operationPb.getSelfLink())) { - operationId = RegionOperationId.fromUrl(operationPb.getSelfLink()); - } else if (ZoneOperationId.matchesUrl(operationPb.getSelfLink())) { - operationId = ZoneOperationId.fromUrl(operationPb.getSelfLink()); - } else { - operationId = GlobalOperationId.fromUrl(operationPb.getSelfLink()); - } - clientOperationId = operationPb.getClientOperationId(); - operationType = operationPb.getOperationType(); - targetLink = operationPb.getTargetLink(); - if (operationPb.getTargetId() != null) { - targetId = operationPb.getTargetId().toString(); - } - if (operationPb.getStatus() != null) { - status = Status.valueOf(operationPb.getStatus()); - } - statusMessage = operationPb.getStatusMessage(); - user = operationPb.getUser(); - progress = operationPb.getProgress(); - if (operationPb.getInsertTime() != null) { - insertTime = TIMESTAMP_FORMATTER.parseMillis(operationPb.getInsertTime()); - } - if (operationPb.getStartTime() != null) { - startTime = TIMESTAMP_FORMATTER.parseMillis(operationPb.getStartTime()); - } - if (operationPb.getEndTime() != null) { - endTime = TIMESTAMP_FORMATTER.parseMillis(operationPb.getEndTime()); - } - if (operationPb.getError() != null && operationPb.getError().getErrors() != null) { - errors = - Lists.transform(operationPb.getError().getErrors(), OperationError.FROM_PB_FUNCTION); - } - if (operationPb.getWarnings() != null) { - warnings = Lists.transform(operationPb.getWarnings(), OperationWarning.FROM_PB_FUNCTION); - } - httpErrorStatusCode = operationPb.getHttpErrorStatusCode(); - httpErrorMessage = operationPb.getHttpErrorMessage(); - description = operationPb.getDescription(); - } - - Builder getGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - Builder setOperationId(OperationId operationId) { - this.operationId = checkNotNull(operationId); - return this; - } - - Builder setClientOperationId(String clientOperationId) { - this.clientOperationId = clientOperationId; - return this; - } - - Builder setOperationType(String operationType) { - this.operationType = operationType; - return this; - } - - Builder setTargetLink(String targetLink) { - this.targetLink = targetLink; - return this; - } - - Builder setTargetId(String targetId) { - this.targetId = targetId; - return this; - } - - Builder setStatus(Status status) { - this.status = status; - return this; - } - - Builder setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - return this; - } - - Builder setUser(String user) { - this.user = user; - return this; - } - - Builder setProgress(Integer progress) { - this.progress = progress; - return this; - } - - Builder setInsertTime(Long insertTime) { - this.insertTime = insertTime; - return this; - } - - Builder setStartTime(Long startTime) { - this.startTime = startTime; - return this; - } - - Builder setEndTime(Long endTime) { - this.endTime = endTime; - return this; - } - - Builder setErrors(List errors) { - this.errors = ImmutableList.copyOf(checkNotNull(errors)); - return this; - } - - Builder setWarnings(List warnings) { - this.warnings = ImmutableList.copyOf(checkNotNull(warnings)); - return this; - } - - Builder setHttpErrorStatusCode(Integer httpErrorStatusCode) { - this.httpErrorStatusCode = httpErrorStatusCode; - return this; - } - - Builder setHttpErrorMessage(String httpErrorMessage) { - this.httpErrorMessage = httpErrorMessage; - return this; - } - - Builder setDescription(String description) { - this.description = description; - return this; - } - - Operation build() { - return new Operation(this); - } - } - - private Operation(Builder builder) { - this.compute = checkNotNull(builder.compute); - this.options = compute.getOptions(); - this.generatedId = builder.generatedId; - this.operationId = checkNotNull(builder.operationId); - this.clientOperationId = builder.clientOperationId; - this.operationType = builder.operationType; - this.targetLink = builder.targetLink; - this.targetId = builder.targetId; - this.status = builder.status; - this.statusMessage = builder.statusMessage; - this.user = builder.user; - this.progress = builder.progress; - this.insertTime = builder.insertTime; - this.startTime = builder.startTime; - this.endTime = builder.endTime; - this.errors = builder.errors != null ? ImmutableList.copyOf(builder.errors) : null; - this.warnings = builder.warnings != null ? ImmutableList.copyOf(builder.warnings) : null; - this.httpErrorStatusCode = builder.httpErrorStatusCode; - this.httpErrorMessage = builder.httpErrorMessage; - this.description = builder.description; - } - - /** Returns the operation's {@code Compute} object used to issue requests. */ - public Compute getCompute() { - return compute; - } - - /** Returns the service-generated unique identifier for the operation. */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the operation's identity. This method returns an {@link GlobalOperationId} for global - * operations, a {@link RegionOperationId} for region operations and a {@link ZoneOperationId} for - * zone operations. - * - * @see RFC1035 - */ - @SuppressWarnings("unchecked") - public T getOperationId() { - return (T) operationId; - } - - /** Reserved for future use. */ - String getClientOperationId() { - return clientOperationId; - } - - /** Returns the type of operation. */ - public String getOperationType() { - return operationType; - } - - /** Returns the URL of the resource that the operation is modifying. */ - public String getTargetLink() { - return targetLink; - } - - /** - * Returns the unique service-defined target ID, which identifies the resource that the operation - * is modifying. - */ - public String getTargetId() { - return targetId; - } - - /** Returns the status of the operation. */ - public Status getStatus() { - return status; - } - - /** Returns an optional textual description of the current status of the operation. */ - public String getStatusMessage() { - return statusMessage; - } - - /** Returns the user who requested the operation, for example: {@code user@example.com}. */ - public String getUser() { - return user; - } - - /** - * Returns 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. - */ - public Integer getProgress() { - return progress; - } - - /** Returns the time that this operation was requested. In milliseconds since epoch. */ - public Long getInsertTime() { - return insertTime; - } - - /** - * Returns the time that this operation was started by the service. In milliseconds since epoch. - * This value will be {@code null} if the operation has not started yet. - */ - public Long getStartTime() { - return startTime; - } - - /** - * Returns the time that this operation was completed. In milliseconds since epoch. This value - * will be {@code null} if the operation has not finished yet. - */ - public Long getEndTime() { - return endTime; - } - - /** - * Returns the errors encountered while processing this operation, if any. Returns {@code null} if - * no error occurred. - */ - public List getErrors() { - return errors; - } - - /** - * Returns the warnings encountered while processing this operation, if any. Returns {@code null} - * if no warning occurred. - */ - public List getWarnings() { - return warnings; - } - - /** - * Returns the HTTP error status code that was returned, if the operation failed. For example, a - * {@code 404} means the resource was not found. - */ - public Integer getHttpErrorStatusCode() { - return httpErrorStatusCode; - } - - /** - * Returns the the HTTP error message that was returned, if the operation failed. For example, a - * {@code NOT FOUND} message is returned if the resource was not found. - */ - public String getHttpErrorMessage() { - return httpErrorMessage; - } - - /** Returns an optional textual description of the operation. */ - public String getDescription() { - return description; - } - - /** - * Checks if this operation exists. - * - * @return {@code true} if this operation exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(OperationOption.fields()) != null; - } - - /** - * Checks if this operation has completed its execution, either failing or succeeding. If the - * operation does not exist this method returns {@code true}. You can wait for operation - * completion with: - * - *

{@code
-   * while(!operation.isDone()) {
-   *   Thread.sleep(1000L);
-   * }
-   * }
- * - * @return {@code true} if this operation is in {@link Operation.Status#DONE} state or if it does - * not exist, {@code false} if the state is not {@link Operation.Status#DONE} - * @throws ComputeException upon failure - */ - public boolean isDone() { - Operation operation = - compute.getOperation(operationId, OperationOption.fields(Compute.OperationField.STATUS)); - return operation == null || operation.getStatus() == Status.DONE; - } - - /** - * Blocks until this operation completes its execution, either failing or succeeding. This method - * returns current operation's latest information. If the operation no longer exists, this method - * returns {@code null}. By default, the operation status is checked using jittered exponential - * backoff with 1 second as an initial delay, 2.0 as a backoff factor, 1 minute as maximum delay - * between polls, 12 hours as a total timeout and unlimited number of attempts. - * - *

Example usage of {@code waitFor()}: - * - *

{@code
-   * Operation completedOperation = operation.waitFor();
-   * if (completedOperation == null) {
-   *   // operation no longer exists
-   * } else if (completedOperation.errors() != null) {
-   *   // operation failed, handle error
-   * } else {
-   *   // operation completed successfully
-   * }
-   * }
- * - *

Example usage of {@code waitFor()} with checking period and timeout: - * - *

{@code
-   * Operation completedOperation =
-   *     operation.waitFor(
-   *         RetryOption.maxRetryDelay(Duration.ofSeconds(30)),
-   *         RetryOption.totalTimeout(Duration.ofMinutes(1)),
-   *         RetryOption.jittered(false));
-   * if (completedOperation == null) {
-   *   // operation no longer exists
-   * } else if (completedOperation.errors() != null) {
-   *   // operation failed, handle error
-   * } else {
-   *   // operation completed successfully
-   * }
-   * }
- * - * @param waitOptions options to configure checking period and timeout - * @throws ComputeException upon failure, check {@link ComputeException#getCause()} for details - * @throws InterruptedException if the current thread gets interrupted while waiting for the - * operation to complete - */ - public Operation waitFor(RetryOption... waitOptions) - throws InterruptedException { - RetrySettings waitSettings = - RetryOption.mergeToSettings(DEFAULT_OPERATION_WAIT_SETTINGS, waitOptions); - try { - Operation operation = - RetryHelper.poll( - new Callable() { - @Override - public Operation call() throws Exception { - return compute.getOperation( - operationId, OperationOption.fields(Compute.OperationField.STATUS)); - } - }, - waitSettings, - new BasicResultRetryAlgorithm() { - @Override - public boolean shouldRetry(Throwable prevThrowable, Operation prevResponse) { - return prevResponse != null && prevResponse.getStatus() != Status.DONE; - } - }, - options.getClock()); - return operation == null ? null : reload(); - } catch (ExecutionException e) { - throw ComputeException.translateAndThrow(e); - } - } - - /** - * Fetches current operation's latest information. Returns {@code null} if the operation does not - * exist. - * - * @param options operation options - * @return an {@code Operation} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Operation reload(OperationOption... options) { - return compute.getOperation(operationId, options); - } - - /** - * Deletes this operation. Delete is only possible for operations that have completed their - * execution. Any attempt to delete a running operation will fail. - * - * @return {@code true} if operation was deleted, {@code false} if it was not found - * @throws ComputeException upon failure - */ - public boolean delete() { - return compute.deleteOperation(operationId); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("operationsId", operationId) - .add("clientOperationId", clientOperationId) - .add("operationType", operationType) - .add("targetLink", targetLink) - .add("targetId", targetId) - .add("status", status) - .add("statusMessage", statusMessage) - .add("user", user) - .add("progress", progress) - .add("insertTime", insertTime) - .add("startTime", startTime) - .add("endTime", endTime) - .add("errors", errors) - .add("warnings", warnings) - .add("httpErrorStatusCode", httpErrorStatusCode) - .add("httpErrorMessage", httpErrorMessage) - .add("description", description) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(operationId); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Operation.class)) { - return false; - } - Operation other = (Operation) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - com.google.api.services.compute.model.Operation toPb() { - com.google.api.services.compute.model.Operation operationPb = - new com.google.api.services.compute.model.Operation(); - if (generatedId != null) { - operationPb.setId(new BigInteger(generatedId)); - } - operationPb.setName(operationId.getOperation()); - operationPb.setClientOperationId(clientOperationId); - switch (operationId.getType()) { - case REGION: - operationPb.setRegion(this.getOperationId().getRegionId().getSelfLink()); - break; - case ZONE: - operationPb.setZone(this.getOperationId().getZoneId().getSelfLink()); - break; - } - if (operationType != null) { - operationPb.setOperationType(operationType); - } - operationPb.setTargetLink(targetLink); - if (targetId != null) { - operationPb.setTargetId(new BigInteger(targetId)); - } - if (status != null) { - operationPb.setStatus(status.name()); - } - operationPb.setStatusMessage(statusMessage); - operationPb.setUser(user); - operationPb.setProgress(progress); - if (insertTime != null) { - operationPb.setInsertTime(TIMESTAMP_FORMATTER.print(insertTime)); - } - if (startTime != null) { - operationPb.setStartTime(TIMESTAMP_FORMATTER.print(startTime)); - } - if (endTime != null) { - operationPb.setEndTime(TIMESTAMP_FORMATTER.print(endTime)); - } - if (errors != null) { - operationPb.setError( - new com.google.api.services.compute.model.Operation.Error() - .setErrors(Lists.transform(errors, OperationError.TO_PB_FUNCTION))); - } - if (warnings != null) { - operationPb.setWarnings(Lists.transform(warnings, OperationWarning.TO_PB_FUNCTION)); - } - operationPb.setHttpErrorStatusCode(httpErrorStatusCode); - operationPb.setHttpErrorMessage(httpErrorMessage); - operationPb.setSelfLink(operationId.getSelfLink()); - operationPb.setDescription(description); - return operationPb; - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Operation fromPb( - Compute compute, com.google.api.services.compute.model.Operation operationPb) { - return new Builder(compute, operationPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java deleted file mode 100644 index c6b556e51255..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * Base class for Google Compute Engine operation identities. - */ -public abstract class OperationId extends ResourceId { - - private static final long serialVersionUID = -5502909279744388604L; - - private final String operation; - - OperationId(String project, String operation) { - super(project); - this.operation = checkNotNull(operation); - } - - /** - * Possible types for a Google Compute Engine operation identity. - */ - enum Type { - /** - * Global operations are those operations that deal with global resources, such as global - * addresses or snapshots. - */ - GLOBAL, - - /** - * Region operations are those operations that deal with resources that live in a region, such - * as subnetworks. - */ - REGION, - - /** - * Zone operations are those operations that deal with resources that live in a zone, such as - * disks and instances. - */ - ZONE - } - - /** - * Returns the type of this operation identity. - */ - public abstract Type getType(); - - /** - * Returns the name of the operation resource. - */ - public String getOperation() { - return operation; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("operation", operation); - } - - @Override - final int baseHashCode() { - return Objects.hash(super.baseHashCode(), operation); - } - - @Override - final boolean baseEquals(ResourceId resourceId) { - return resourceId instanceof OperationId - && super.baseEquals(resourceId) - && Objects.equals(operation, ((OperationId) resourceId).operation); - } - - @Override - abstract OperationId setProjectId(String projectId); -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java deleted file mode 100644 index 3696589bb42f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; -import com.google.common.base.MoreObjects; - -import java.io.Serializable; -import java.util.Objects; - -/** - * Base class for Compute operation option. - */ -class Option implements Serializable { - - private static final long serialVersionUID = 4116849309806774350L; - - private final ComputeRpc.Option rpcOption; - private final Object value; - - Option(ComputeRpc.Option rpcOption, Object value) { - this.rpcOption = checkNotNull(rpcOption); - this.value = value; - } - - ComputeRpc.Option getRpcOption() { - return rpcOption; - } - - Object getValue() { - return value; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Option)) { - return false; - } - Option other = (Option) obj; - return Objects.equals(rpcOption, other.rpcOption) - && Objects.equals(value, other.value); - } - - @Override - public int hashCode() { - return Objects.hash(rpcOption, value); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("name", rpcOption.value()) - .add("value", value) - .toString(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java deleted file mode 100644 index ff2854108b9b..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.core.ApiFunction; -import com.google.cloud.StringEnumType; -import com.google.cloud.StringEnumValue; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -/** - * A Google Compute Engine region. - * - * @see Region and Zones - */ -public class Region implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public Region apply(com.google.api.services.compute.model.Region pb) { - return Region.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Region apply(Region region) { - return region.toPb(); - } - }; - - private static final long serialVersionUID = -3578710133393645135L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final RegionId regionId; - private final String generatedId; - private final Long creationTimestamp; - private final String description; - private final Status status; - private final List zones; - private final List quotas; - private final DeprecationStatus deprecationStatus; - - /** - * Status of the region. - */ - public static final class Status extends StringEnumValue { - private static final long serialVersionUID = 658578478474360264L; - - private static final ApiFunction CONSTRUCTOR = - new ApiFunction() { - @Override - public Status apply(String constant) { - return new Status(constant); - } - }; - - private static final StringEnumType type = new StringEnumType( - Status.class, - CONSTRUCTOR); - - public static final Status UP = type.createAndRegister("UP"); - public static final Status DOWN = type.createAndRegister("DOWN"); - - private Status(String constant) { - super(constant); - } - - /** - * Get the Status for the given String constant, and throw an exception if the constant is - * not recognized. - */ - public static Status valueOfStrict(String constant) { - return type.valueOfStrict(constant); - } - - /** - * Get the Status for the given String constant, and allow unrecognized values. - */ - public static Status valueOf(String constant) { - return type.valueOf(constant); - } - - /** - * Return the known values for Status. - */ - public static Status[] values() { - return type.values(); - } - } - - /** - * A quota assigned to this region. - */ - public static final class Quota implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public Quota apply(com.google.api.services.compute.model.Quota pb) { - return Quota.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Quota apply(Quota quota) { - return quota.toPb(); - } - }; - private static final long serialVersionUID = -4357118665133226338L; - - private final String metric; - private final double limit; - private final double usage; - - /** - * Returns a region quota object. - */ - Quota(String metric, double limit, double usage) { - this.metric = metric; - this.limit = limit; - this.usage = usage; - } - - /** - * Returns the name of the quota metric. - */ - public String getMetric() { - return metric; - } - - /** - * Returns the quota limit for this metric. - */ - public double getLimit() { - return limit; - } - - /** - * Returns the current usage for this quota. - */ - public double getUsage() { - return usage; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("metric", metric) - .add("limit", limit) - .add("usage", usage) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(metric, limit, usage); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Quota)) { - return false; - } - Quota other = (Quota) obj; - return Objects.equals(metric, other.metric) - && Objects.equals(limit, other.limit) - && Objects.equals(usage, other.usage); - } - - com.google.api.services.compute.model.Quota toPb() { - return new com.google.api.services.compute.model.Quota() - .setMetric(metric) - .setLimit(limit) - .setUsage(usage); - } - - static Quota fromPb(com.google.api.services.compute.model.Quota quotaPb) { - return new Quota(quotaPb.getMetric(), quotaPb.getLimit(), quotaPb.getUsage()); - } - } - - static final class Builder { - - private RegionId regionId; - private String generatedId; - private Long creationTimestamp; - private String description; - - private Status status; - private List zones; - private List quotas; - private DeprecationStatus deprecationStatus; - - private Builder() {} - - Builder setRegionId(RegionId regionId) { - this.regionId = regionId; - return this; - } - - Builder setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - Builder setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - Builder setDescription(String description) { - this.description = description; - return this; - } - - Builder setStatus(Status status) { - this.status = status; - return this; - } - - Builder setZones(List zones) { - this.zones = ImmutableList.copyOf(zones); - return this; - } - - Builder setQuotas(List quotas) { - this.quotas = ImmutableList.copyOf(quotas); - return this; - } - - Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { - this.deprecationStatus = deprecationStatus; - return this; - } - - Region build() { - return new Region(this); - } - } - - private Region(Builder builder) { - this.regionId = builder.regionId; - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.description = builder.description; - this.status = builder.status; - this.zones = builder.zones; - this.quotas = builder.quotas; - this.deprecationStatus = builder.deprecationStatus; - } - - /** - * Returns the region's identity. - */ - public RegionId getRegionId() { - return regionId; - } - - /** - * Returns the service-generated unique identifier for the region. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns an optional textual description of the region. - */ - public String getDescription() { - return description; - } - - /** - * Returns the status of the status. - */ - public Status getStatus() { - return status; - } - - /** - * Returns a list of identities of zones available in this region. - */ - public List getZones() { - return zones; - } - - /** - * Returns quotas assigned to this region. - */ - public List getQuotas() { - return quotas; - } - - /** - * Returns the deprecation status of the region. If {@link DeprecationStatus#getStatus()} is either - * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the - * region should not be used. Returns {@code null} if the region is not deprecated. - */ - public DeprecationStatus getDeprecationStatus() { - return deprecationStatus; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("regionId", regionId) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("description", description) - .add("status", status) - .add("zones", zones) - .add("quotas", quotas) - .add("deprecationStatus", deprecationStatus) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(regionId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(Region.class) - && Objects.equals(toPb(), ((Region) obj).toPb()); - } - - com.google.api.services.compute.model.Region toPb() { - com.google.api.services.compute.model.Region regionPb = - new com.google.api.services.compute.model.Region(); - if (generatedId != null) { - regionPb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - regionPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - regionPb.setName(regionId.getRegion()); - regionPb.setDescription(description); - regionPb.setSelfLink(regionId.getSelfLink()); - if (status != null) { - regionPb.setStatus(status.name()); - } - if (zones != null) { - regionPb.setZones(Lists.transform(zones, ZoneId.TO_URL_FUNCTION)); - } - if (quotas != null) { - regionPb.setQuotas(Lists.transform(quotas, Quota.TO_PB_FUNCTION)); - } - if (deprecationStatus != null) { - regionPb.setDeprecated(deprecationStatus.toPb()); - } - return regionPb; - } - - static Builder builder() { - return new Builder(); - } - - static Region fromPb(com.google.api.services.compute.model.Region regionPb) { - Builder builder = builder(); - builder.setRegionId(RegionId.fromUrl(regionPb.getSelfLink())); - if (regionPb.getId() != null) { - builder.setGeneratedId(regionPb.getId().toString()); - } - if (regionPb.getCreationTimestamp() != null) { - builder.setCreationTimestamp( - TIMESTAMP_FORMATTER.parseMillis(regionPb.getCreationTimestamp())); - } - builder.setDescription(regionPb.getDescription()); - if (regionPb.getStatus() != null) { - builder.setStatus(Status.valueOf(regionPb.getStatus())); - } - if (regionPb.getZones() != null) { - builder.setZones(Lists.transform(regionPb.getZones(), ZoneId.FROM_URL_FUNCTION)); - } - if (regionPb.getQuotas() != null) { - builder.setQuotas(Lists.transform(regionPb.getQuotas(), Quota.FROM_PB_FUNCTION)); - } - if (regionPb.getDeprecated() != null) { - builder.setDeprecationStatus( - DeprecationStatus.fromPb(regionPb.getDeprecated(), RegionId.FROM_URL_FUNCTION)); - } - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java deleted file mode 100644 index 89e9983d9dd4..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine region address. - */ -public final class RegionAddressId extends AddressId { - - private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/addresses/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 8170980880371085238L; - - private final String region; - - private RegionAddressId(String project, String region, String address) { - super(project, address); - this.region = checkNotNull(region); - } - - @Override - public Type getType() { - return Type.REGION; - } - - /** - * Returns the name of the region this address belongs to. - */ - public String getRegion() { - return region; - } - - /** - * Returns the identity of the region this address belongs to. - */ - public RegionId getRegionId() { - return RegionId.of(getProject(), region); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/regions/" + region + "/addresses/" + getAddress(); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("region", region); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), region); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof RegionAddressId)) { - return false; - } - RegionAddressId other = (RegionAddressId) obj; - return baseEquals(other) && Objects.equals(region, other.region); - } - - @Override - RegionAddressId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return RegionAddressId.of(projectId, region, getAddress()); - } - - /** - * Returns a region address identity given the region identity and the address name. The address - * name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 - * characters long and match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means - * the first character must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static RegionAddressId of(RegionId regionId, String address) { - return new RegionAddressId(regionId.getProject(), regionId.getRegion(), address); - } - - /** - * Returns a region address identity given the region and address names. The address name must be - * 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static RegionAddressId of(String region, String address) { - return new RegionAddressId(null, region, address); - } - - /** - * Returns a region address identity given project, region and address names. The address name - * must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the - * regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static RegionAddressId of(String project, String region, String address) { - return new RegionAddressId(project, region, address); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a region address - * URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static RegionAddressId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid region address URL"); - } - return RegionAddressId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java deleted file mode 100644 index a6ffb99cbc82..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine region's forwarding rule. - */ -public final class RegionForwardingRuleId extends ForwardingRuleId { - - static final Function FROM_URL_FUNCTION = - new Function() { - @Override - public RegionForwardingRuleId apply(String pb) { - return RegionForwardingRuleId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = - new Function() { - @Override - public String apply(RegionForwardingRuleId forwardingRuleId) { - return forwardingRuleId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/forwardingRules/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 7885327931402904667L; - - private final String region; - - private RegionForwardingRuleId(String project, String region, String rule) { - super(project, rule); - this.region = checkNotNull(region); - } - - @Override - public Type getType() { - return Type.REGION; - } - - /** - * Returns the name of the region this forwarding rule belongs to. - */ - public String getRegion() { - return region; - } - - /** - * Returns the identity of the region this forwarding rule belongs to. - */ - public RegionId getRegionId() { - return RegionId.of(getProject(), region); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/regions/" + region + "/forwardingRules/" + getRule(); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("region", region); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), region); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof RegionForwardingRuleId)) { - return false; - } - RegionForwardingRuleId other = (RegionForwardingRuleId) obj; - return baseEquals(other) && Objects.equals(region, other.region); - } - - @Override - RegionForwardingRuleId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return RegionForwardingRuleId.of(projectId, region, getRule()); - } - - /** - * Returns a region forwarding rule identity given the region identity and the rule name. The - * forwarding rule name must be 1-63 characters long and comply with RFC1035. Specifically, the - * name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first - * character must be a lowercase letter, and all following characters must be a dash, lowercase - * letter, or digit, except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static RegionForwardingRuleId of(RegionId regionId, String rule) { - return new RegionForwardingRuleId(regionId.getProject(), regionId.getRegion(), rule); - } - - /** - * Returns a region forwarding rule identity given the region and rule names. The forwarding rule - * name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match - * the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must - * be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static RegionForwardingRuleId of(String region, String rule) { - return new RegionForwardingRuleId(null, region, rule); - } - - /** - * Returns a region forwarding rule identity given project, region and rule names. The forwarding - * rule name must be 1-63 characters long and comply with RFC1035. Specifically, the name must - * match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character - * must be a lowercase letter, and all following characters must be a dash, lowercase letter, or - * digit, except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static RegionForwardingRuleId of(String project, String region, String rule) { - return new RegionForwardingRuleId(project, region, rule); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a region forwarding - * rule URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static RegionForwardingRuleId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid region forwarding rule URL"); - } - return RegionForwardingRuleId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java deleted file mode 100644 index 8bbd3140f5f2..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects.ToStringHelper; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * A Google Compute Engine region identity. - */ -public final class RegionId extends ResourceId { - - static final Function FROM_URL_FUNCTION = new Function() { - @Override - public RegionId apply(String pb) { - return RegionId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = new Function() { - @Override - public String apply(RegionId regionId) { - return regionId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 5569092266957249294L; - - private final String region; - - private RegionId(String project, String region) { - super(project); - this.region = checkNotNull(region); - } - - private RegionId(RegionId regionId) { - super(regionId.getProject()); - this.region = checkNotNull(regionId.getRegion()); - } - - /** - * Returns the name of the region. - */ - public String getRegion() { - return region; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/regions/" + region; - } - - @Override - ToStringHelper toStringHelper() { - return super.toStringHelper().add("region", region); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), region); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof RegionId)) { - return false; - } - RegionId other = (RegionId) obj; - return baseEquals(other) && Objects.equals(region, other.region); - } - - @Override - RegionId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return RegionId.of(projectId, region); - } - - /** - * Returns a new region identity given project and region names. - */ - public static RegionId of(String project, String region) { - return new RegionId(project, region); - } - - /** - * Returns a new region identity given region name. - */ - public static RegionId of(String region) { - return RegionId.of(null, region); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a region URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static RegionId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid region URL"); - } - return RegionId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java deleted file mode 100644 index e51bfc4091c5..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine region's operation. - */ -public final class RegionOperationId extends OperationId { - - private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/operations/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 5816161906501886782L; - - private final String region; - - private RegionOperationId(String project, String region, String operation) { - super(project, operation); - this.region = checkNotNull(region); - } - - @Override - public Type getType() { - return Type.REGION; - } - - /** - * Returns the name of the region this operation belongs to. - */ - public String getRegion() { - return region; - } - - /** - * Returns the identity of the region this operation belongs to. - */ - public RegionId getRegionId() { - return RegionId.of(getProject(), region); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/regions/" + region + "/operations/" + getOperation(); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("region", region); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), region); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof RegionOperationId)) { - return false; - } - RegionOperationId other = (RegionOperationId) obj; - return baseEquals(other) && Objects.equals(region, other.region); - } - - @Override - RegionOperationId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return RegionOperationId.of(projectId, region, getOperation()); - } - - /** - * Returns a region operation identity given the region identity and the operation name. - */ - public static RegionOperationId of(RegionId regionId, String operation) { - return new RegionOperationId(regionId.getProject(), regionId.getRegion(), operation); - } - - /** - * Returns a region operation identity given the region and operation names. - */ - public static RegionOperationId of(String region, String operation) { - return new RegionOperationId(null, region, operation); - } - - /** - * Returns a region operation identity given project, region and operation names. - */ - public static RegionOperationId of(String project, String region, String operation) { - return new RegionOperationId(project, region, operation); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a region operation - * URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static RegionOperationId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid region operation URL"); - } - return RegionOperationId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java deleted file mode 100644 index 01b8357c0d3b..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.common.base.MoreObjects; - -import java.io.Serializable; -import java.util.Objects; - -/** - * Base class for Google Compute Engine resource identities. - */ -public abstract class ResourceId implements Serializable { - - static final String REGEX = ".*?projects/([^/]+)/"; - private static final String BASE_URL = "https://www.googleapis.com/compute/v1/projects/"; - private static final long serialVersionUID = -8028734746870421573L; - - private final String project; - - ResourceId(String project) { - this.project = project; - } - - /** - * Returns a fully qualified URL to the entity. - */ - public String getSelfLink() { - return BASE_URL + project; - } - - /** - * Returns the name of the project. - */ - public final String getProject() { - return project; - } - - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("project", project); - } - - @Override - public String toString() { - return toStringHelper().toString(); - } - - int baseHashCode() { - return Objects.hash(project); - } - - boolean baseEquals(ResourceId resourceId) { - return Objects.equals(project, resourceId.project); - } - - abstract ResourceId setProjectId(String projectId); -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java deleted file mode 100644 index a7dd3a91e386..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.core.ApiFunction; -import com.google.cloud.StringEnumType; -import com.google.cloud.StringEnumValue; -import com.google.common.base.MoreObjects; - -import java.io.Serializable; -import java.util.Objects; - -/** - * A Google Compute Engine instance scheduling options. When there are system events that might - * cause your instances to be disrupted, Google Compute Engine automatically manages the - * scheduling decisions for your instances. Use {@code SchedulingOptions.preemptible()} to create - * a preemptible instance. Use {@code SchedulingOptions.standard()} to configure scheduling - * options for a standard instance. - * - * @see - * Setting Instance Scheduling Options - */ -public final class SchedulingOptions implements Serializable { - - private static final long serialVersionUID = 4199610694227857331L; - - private final boolean automaticRestart; - private final Maintenance maintenance; - private final boolean isPreemptible; - - /** - * Defines the maintenance behavior for this instance. - */ - public static final class Maintenance extends StringEnumValue { - private static final long serialVersionUID = 1041388027965833378L; - - private static final ApiFunction CONSTRUCTOR = - new ApiFunction() { - @Override - public Maintenance apply(String constant) { - return new Maintenance(constant); - } - }; - - private static final StringEnumType type = new StringEnumType( - Maintenance.class, - CONSTRUCTOR); - - /** - * The default behavior for standard instances. - */ - public static final Maintenance MIGRATE = type.createAndRegister("MIGRATE"); - - /** - * The default and only possible behavior for preemptible instances. - */ - public static final Maintenance TERMINATE = type.createAndRegister("TERMINATE"); - - private Maintenance(String constant) { - super(constant); - } - - /** - * Get the Maintenance for the given String constant, and throw an exception if the constant is - * not recognized. - */ - public static Maintenance valueOfStrict(String constant) { - return type.valueOfStrict(constant); - } - - /** - * Get the Maintenance for the given String constant, and allow unrecognized values. - */ - public static Maintenance valueOf(String constant) { - return type.valueOf(constant); - } - - /** - * Return the known values for Maintenance. - */ - public static Maintenance[] values() { - return type.values(); - } - } - - private SchedulingOptions(Boolean automaticRestart, Maintenance maintenance, - Boolean isPreemptible) { - this.automaticRestart = automaticRestart; - this.maintenance = maintenance; - this.isPreemptible = isPreemptible; - } - - /** - * Returns whether the instance should be automatically restarted if it is terminated by Compute - * Engine (not terminated by a user). - */ - public Boolean automaticRestart() { - return automaticRestart; - } - - /** - * Returns the maintenance behavior for the instance. - */ - public Maintenance getMaintenance() { - return maintenance; - } - - /** - * Returns {@code true} if the instance is preemptible, {@code false} otherwhise. - * - * @see Preemptible - * Instance - */ - public boolean isPreemptible() { - return isPreemptible; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("automaticRestart", automaticRestart) - .add("maintenance", maintenance) - .add("isPreemptible", isPreemptible) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(automaticRestart, maintenance, isPreemptible); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj instanceof SchedulingOptions - && Objects.equals(toPb(), ((SchedulingOptions) obj).toPb()); - } - - com.google.api.services.compute.model.Scheduling toPb() { - com.google.api.services.compute.model.Scheduling schedulingPb = - new com.google.api.services.compute.model.Scheduling(); - schedulingPb.setAutomaticRestart(automaticRestart); - schedulingPb.setPreemptible(isPreemptible); - if (maintenance != null) { - schedulingPb.setOnHostMaintenance(maintenance.name()); - } - return schedulingPb; - } - - /** - * Returns a {@code SchedulingOptions} object for a preemptible instance. - * - * @see Preemptible - * Instance - */ - public static SchedulingOptions preemptible() { - return new SchedulingOptions(false, Maintenance.TERMINATE, true); - } - - /** - * Returns a {@code SchedulingOptions} object for a standard instance. - * - * @param automaticRestart specifies whether the instance should be automatically restarted if - * it is terminated by Compute Engine (not terminated by a user) - * @param maintenance defines the maintenance behavior for the instance - */ - public static SchedulingOptions standard(boolean automaticRestart, Maintenance maintenance) { - return new SchedulingOptions(automaticRestart, maintenance, false); - } - - static SchedulingOptions fromPb(com.google.api.services.compute.model.Scheduling schedPb) { - Maintenance maintenance = null; - if (schedPb.getOnHostMaintenance() != null) { - maintenance = Maintenance.valueOf(schedPb.getOnHostMaintenance()); - } - return new SchedulingOptions(schedPb.getAutomaticRestart(), maintenance, - schedPb.getPreemptible()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java deleted file mode 100644 index 0be8694a4616..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** - * A service account, with its specified scopes, authorized for this instance. - * - * @see Authenticating from Google - * Compute Engine - */ -public final class ServiceAccount implements Serializable { - - static final Function - FROM_PB_FUNCTION = - new Function() { - @Override - public ServiceAccount apply(com.google.api.services.compute.model.ServiceAccount pb) { - return ServiceAccount.fromPb(pb); - } - }; - static final Function - TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.ServiceAccount apply( - ServiceAccount metadata) { - return metadata.toPb(); - } - }; - - private static final long serialVersionUID = 4199610694227857331L; - - private final String email; - private final List scopes; - - private ServiceAccount(String email, List scopes) { - this.email = email; - this.scopes = ImmutableList.copyOf(scopes); - } - - /** - * Returns the email address of the service account. - */ - public String getEmail() { - return email; - } - - /** - * Returns the list of scopes to be made available for this service account. - */ - public List getScopes() { - return scopes; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("email", email) - .add("scopes", scopes) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(email, scopes); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj instanceof ServiceAccount - && Objects.equals(toPb(), ((ServiceAccount) obj).toPb()); - } - - com.google.api.services.compute.model.ServiceAccount toPb() { - com.google.api.services.compute.model.ServiceAccount serviceAccountPb = - new com.google.api.services.compute.model.ServiceAccount(); - serviceAccountPb.setEmail(email); - serviceAccountPb.setScopes(scopes); - return serviceAccountPb; - } - - /** - * Returns a {@code ServiceAccount} object for the provided email and scopes. - */ - public static ServiceAccount of(String email, List scopes) { - return new ServiceAccount(email, scopes); - } - - /** - * Returns a {@code ServiceAccount} object for the provided email and scopes. - */ - public static ServiceAccount of(String email, String... scopes) { - return of(email, Arrays.asList(scopes)); - } - - static ServiceAccount fromPb(com.google.api.services.compute.model.ServiceAccount accountPb) { - return new ServiceAccount(accountPb.getEmail(), accountPb.getScopes()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java deleted file mode 100644 index eef6d4bf4266..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.Compute.OperationOption; -import com.google.cloud.compute.deprecated.Compute.SnapshotOption; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine snapshot. Compute Engine allows you to take snapshots of your persistent - * disk and create new persistent disks from that snapshot. This can be useful for backing up data, - * recreating a persistent disk that might have been lost, or copying a persistent disk. Snapshots - * can be applied across persistent disk types. {@code Snapshot} adds a layer of service-related - * functionality over {@link SnapshotInfo}. Objects of this class are immutable; to get a - * {@code Snapshot} object with the most recent information use {@link #reload}. - * - * @see Use - * persistent disk snapshots - */ -public class Snapshot extends SnapshotInfo { - - private static final long serialVersionUID = -973924811396336695L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Snapshot} objects. - */ - public static class Builder extends SnapshotInfo.Builder { - - private final Compute compute; - private final SnapshotInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, SnapshotId snapshotId, DiskId sourceDisk) { - this.compute = compute; - this.infoBuilder = new SnapshotInfo.BuilderImpl(); - this.infoBuilder.setSnapshotId(snapshotId); - this.infoBuilder.setSourceDisk(sourceDisk); - } - - Builder(Snapshot snapshot) { - this.compute = snapshot.compute; - this.infoBuilder = new SnapshotInfo.BuilderImpl(snapshot); - } - - @Override - Builder setGeneratedId(String generatedId) { - infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - infoBuilder.setCreationTimestamp(creationTimestamp); - return this; - } - - @Override - public Builder setSnapshotId(SnapshotId snapshotId) { - infoBuilder.setSnapshotId(snapshotId); - return this; - } - - @Override - public Builder setDescription(String description) { - infoBuilder.setDescription(description); - return this; - } - - @Override - Builder setStatus(Status status) { - infoBuilder.setStatus(status); - return this; - } - - @Override - Builder setDiskSizeGb(Long diskSizeGb) { - infoBuilder.setDiskSizeGb(diskSizeGb); - return this; - } - - @Override - Builder setLicenses(List licenses) { - infoBuilder.setLicenses(licenses); - return this; - } - - @Override - public Builder setSourceDisk(DiskId sourceDisk) { - infoBuilder.setSourceDisk(sourceDisk); - return this; - } - - @Override - Builder setSourceDiskId(String sourceDiskId) { - infoBuilder.setSourceDiskId(sourceDiskId); - return this; - } - - @Override - Builder setStorageBytes(Long storageBytes) { - infoBuilder.setStorageBytes(storageBytes); - return this; - } - - @Override - Builder setStorageBytesStatus(StorageBytesStatus storageBytesStatus) { - infoBuilder.setStorageBytesStatus(storageBytesStatus); - return this; - } - - @Override - public Snapshot build() { - return new Snapshot(compute, infoBuilder); - } - } - - Snapshot(Compute compute, SnapshotInfo.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this snapshot exists. - * - * @return {@code true} if this snapshot exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(SnapshotOption.fields()) != null; - } - - /** - * Fetches current snapshot's latest information. Returns {@code null} if the snapshot does not - * exist. - * - * @param options snapshot options - * @return a {@code Snapshot} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Snapshot reload(SnapshotOption... options) { - return compute.getSnapshot(getSnapshotId().getSnapshot(), options); - } - - /** - * Deletes this snapshot. - * - * @return a global operation if delete request was successfully sent, {@code null} if the - * snapshot was not found - * @throws ComputeException upon failure - */ - public Operation delete(OperationOption... options) { - return compute.deleteSnapshot(getSnapshotId(), options); - } - - /** - * Returns the snapshot's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Snapshot.class)) { - return false; - } - Snapshot other = (Snapshot) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Snapshot fromPb(Compute compute, - com.google.api.services.compute.model.Snapshot snapshotPb) { - return new Snapshot(compute, new SnapshotInfo.BuilderImpl(snapshotPb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java deleted file mode 100644 index fb59f821e149..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Disk; -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * A Google Compute Engine disk configuration to create a disk from a Google Compute Engine - * snapshot. - * - * @see Block Storage - */ -public class SnapshotDiskConfiguration extends DiskConfiguration { - - private static final long serialVersionUID = -1996055058706221049L; - - private final SnapshotId sourceSnapshot; - private final String sourceSnapshotId; - - /** - * A builder for {@code SnapshotDiskConfiguration} objects. - */ - public static class Builder - extends DiskConfiguration.Builder { - - private SnapshotId sourceSnapshot; - private String sourceSnapshotId; - - private Builder(SnapshotId sourceSnapshot) { - super(Type.SNAPSHOT); - this.sourceSnapshot = checkNotNull(sourceSnapshot); - } - - private Builder(SnapshotDiskConfiguration configuration) { - super(configuration); - this.sourceSnapshot = configuration.sourceSnapshot; - this.sourceSnapshotId = configuration.sourceSnapshotId; - } - - private Builder(Disk diskPb) { - super(Type.SNAPSHOT, diskPb); - this.sourceSnapshot = SnapshotId.fromUrl(diskPb.getSourceSnapshot()); - this.sourceSnapshotId = diskPb.getSourceSnapshotId(); - } - - /** - * Sets the size of the persistent disk, in GB. If not set the disk will have the size of the - * snapshot. This value can be larger than the snapshot's size. If the provided size is smaller - * than the snapshot's size then disk creation will fail. - * - * @see - * Restoring a snapshot to a larger size - */ - @Override - public Builder setSizeGb(Long sizeGb) { - super.setSizeGb(sizeGb); - return this; - } - - /** - * Sets the identity of the source snapshot used to create the disk. - */ - public Builder setSourceSnapshot(SnapshotId sourceSnapshot) { - this.sourceSnapshot = checkNotNull(sourceSnapshot); - return this; - } - - Builder setSourceSnapshotId(String sourceSnapshotId) { - this.sourceSnapshotId = sourceSnapshotId; - return this; - } - - /** - * Creates a {@code SnapshotDiskConfiguration} object. - */ - @Override - public SnapshotDiskConfiguration build() { - return new SnapshotDiskConfiguration(this); - } - } - - private SnapshotDiskConfiguration(Builder builder) { - super(builder); - this.sourceSnapshot = builder.sourceSnapshot; - this.sourceSnapshotId = builder.sourceSnapshotId; - } - - /** - * Returns the identity of the source snapshot used to create the disk. - */ - public SnapshotId getSourceSnapshot() { - return sourceSnapshot; - } - - /** - * Returns the service-generated unique id of the snapshot used to create this disk. This value - * identifies the exact snapshot that was used to create the 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. - */ - public String getSourceSnapshotId() { - return sourceSnapshotId; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("sourceSnapshot", sourceSnapshot) - .add("sourceSnapshotId", sourceSnapshotId); - } - - @Override - public final int hashCode() { - return Objects.hash(baseHashCode(), sourceSnapshot, sourceSnapshotId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(SnapshotDiskConfiguration.class) - && baseEquals((SnapshotDiskConfiguration) obj); - } - - @Override - SnapshotDiskConfiguration setProjectId(String projectId) { - Builder builder = toBuilder().setSourceSnapshot(sourceSnapshot.setProjectId(projectId)); - if (getDiskType() != null) { - builder.setDiskType(getDiskType().setProjectId(projectId)); - } - return builder.build(); - } - - @Override - Disk toPb() { - return super.toPb() - .setSourceSnapshot(sourceSnapshot.getSelfLink()) - .setSourceSnapshotId(sourceSnapshotId); - } - - /** - * Returns a builder for a {@code SnapshotDiskConfiguration} object given the snapshot identity. - */ - public static Builder newBuilder(SnapshotId sourceSnapshot) { - return new Builder(sourceSnapshot); - } - - /** - * Returns a {@code SnapshotDiskConfiguration} object given the snapshot identity. - */ - public static SnapshotDiskConfiguration of(SnapshotId sourceSnapshot) { - return newBuilder(sourceSnapshot).build(); - } - - @SuppressWarnings("unchecked") - static SnapshotDiskConfiguration fromPb(Disk diskPb) { - return new Builder(diskPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java deleted file mode 100644 index cd041c94535c..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine snapshot. - */ -public final class SnapshotId extends ResourceId { - - private static final String REGEX = ResourceId.REGEX + "global/snapshots/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -1699492866663041082L; - - private final String snapshot; - - private SnapshotId(String project, String snapshot) { - super(project); - this.snapshot = checkNotNull(snapshot); - } - - /** - * Returns the name of the snapshot. The name must be 1-63 characters long and comply with - * RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getSnapshot() { - return snapshot; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/global/snapshots/" + snapshot; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("snapshot", snapshot); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), snapshot); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof SnapshotId)) { - return false; - } - SnapshotId other = (SnapshotId) obj; - return baseEquals(other) && Objects.equals(snapshot, other.snapshot); - } - - @Override - SnapshotId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return SnapshotId.of(projectId, snapshot); - } - - /** - * Returns a snapshot identity given the snapshot name. The snapshot name must be 1-63 characters - * long and comply with RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public static SnapshotId of(String snapshot) { - return new SnapshotId(null, snapshot); - } - - /** - * Returns a snapshot identity given project and snapshot names. The snapshot name must be 1-63 - * characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static SnapshotId of(String project, String snapshot) { - return new SnapshotId(project, snapshot); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a snapshot URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return url.matches(REGEX); - } - - static SnapshotId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid snapshot URL"); - } - return SnapshotId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java deleted file mode 100644 index 54e03869c5b8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java +++ /dev/null @@ -1,484 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Snapshot; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine snapshot. Compute Engine allows you to take snapshots of your persistent - * disk and create new persistent disks from that snapshot. This can be useful for backing up data, - * recreating a persistent disk that might have been lost, or copying a persistent disk. Snapshots - * can be applied across persistent disk types. - * - * @see Use - * persistent disk snapshots - */ -public class SnapshotInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public SnapshotInfo apply(Snapshot pb) { - return SnapshotInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Snapshot apply(SnapshotInfo snapshot) { - return snapshot.toPb(); - } - }; - - private static final long serialVersionUID = 1065513502131159769L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final SnapshotId snapshotId; - private final Long creationTimestamp; - private final String description; - private final Status status; - private final Long diskSizeGb; - private final List licenses; - private final DiskId sourceDisk; - private final String sourceDiskId; - private final Long storageBytes; - private final StorageBytesStatus storageBytesStatus; - - /** - * The status of a Google Compute Engine snapshot. A snapshot can be used to create a disk only - * after the snapshot has been successfully created and the status is set to {@code READY}. - */ - public enum Status { - /** - * The snapshot is being created. - */ - CREATING, - - /** - * The snapshot is being deleted. - */ - DELETING, - - /** - * Snapshot's creation failed. - */ - FAILED, - - /** - * Snapshot has been successfully created. - */ - READY, - - /** - * Snapshot is being uploaded. - */ - UPLOADING - } - - /** - * An indicator of whether {@link SnapshotInfo#getStorageBytes()} is in a stable state or it is - * being adjusted as a result of shared storage reallocation. - */ - public enum StorageBytesStatus { - /** - * Indicates that the size of the snapshot is being updated. - */ - UPDATING, - - /** - * Indicates that the size of the snapshot is up-to-date. - */ - UP_TO_DATE - } - - /** - * A builder for {@code SnapshotInfo} objects. - */ - public abstract static class Builder { - - abstract Builder setGeneratedId(String generatedId); - - abstract Builder setCreationTimestamp(Long creationTimestamp); - - /** - * Sets the snapshot identity. - */ - public abstract Builder setSnapshotId(SnapshotId snapshotId); - - /** - * Sets an optional textual description of the snapshot. - */ - public abstract Builder setDescription(String description); - - abstract Builder setStatus(Status status); - - abstract Builder setDiskSizeGb(Long diskSizeGb); - - abstract Builder setLicenses(List licenses); - - /** - * Sets the identity of the source disk used to create the snapshot. - */ - public abstract Builder setSourceDisk(DiskId sourceDisk); - - abstract Builder setSourceDiskId(String sourceDiskId); - - abstract Builder setStorageBytes(Long storageBytes); - - abstract Builder setStorageBytesStatus(StorageBytesStatus storageBytesStatus); - - /** - * Creates a {@code SnapshotInfo} object. - */ - public abstract SnapshotInfo build(); - } - - static final class BuilderImpl extends Builder { - - private String generatedId; - private Long creationTimestamp; - private SnapshotId snapshotId; - private String description; - private Status status; - private Long diskSizeGb; - private List licenses; - private DiskId sourceDisk; - private String sourceDiskId; - private Long storageBytes; - private StorageBytesStatus storageBytesStatus; - - BuilderImpl() {} - - BuilderImpl(SnapshotInfo snapshotInfo) { - this.generatedId = snapshotInfo.generatedId; - this.creationTimestamp = snapshotInfo.creationTimestamp; - this.snapshotId = snapshotInfo.snapshotId; - this.description = snapshotInfo.description; - this.status = snapshotInfo.status; - this.diskSizeGb = snapshotInfo.diskSizeGb; - this.licenses = snapshotInfo.licenses; - this.sourceDisk = snapshotInfo.sourceDisk; - this.sourceDiskId = snapshotInfo.sourceDiskId; - this.storageBytes = snapshotInfo.storageBytes; - this.storageBytesStatus = snapshotInfo.storageBytesStatus; - } - - BuilderImpl(Snapshot snapshotPb) { - if (snapshotPb.getId() != null) { - this.generatedId = snapshotPb.getId().toString(); - } - if (snapshotPb.getCreationTimestamp() != null) { - this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(snapshotPb.getCreationTimestamp()); - } - this.snapshotId = SnapshotId.fromUrl(snapshotPb.getSelfLink()); - this.description = snapshotPb.getDescription(); - if (snapshotPb.getStatus() != null) { - this.status = Status.valueOf(snapshotPb.getStatus()); - } - this.diskSizeGb = snapshotPb.getDiskSizeGb(); - if (snapshotPb.getLicenses() != null) { - this.licenses = Lists.transform(snapshotPb.getLicenses(), LicenseId.FROM_URL_FUNCTION); - } - if (snapshotPb.getSourceDisk() != null) { - this.sourceDisk = DiskId.fromUrl(snapshotPb.getSourceDisk()); - } - this.sourceDiskId = snapshotPb.getSourceDiskId(); - this.storageBytes = snapshotPb.getStorageBytes(); - if (snapshotPb.getStorageBytesStatus() != null) { - this.storageBytesStatus = StorageBytesStatus.valueOf(snapshotPb.getStorageBytesStatus()); - } - } - - @Override - BuilderImpl setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - BuilderImpl setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - public BuilderImpl setSnapshotId(SnapshotId snapshotId) { - this.snapshotId = checkNotNull(snapshotId); - return this; - } - - @Override - public BuilderImpl setDescription(String description) { - this.description = description; - return this; - } - - @Override - BuilderImpl setStatus(Status status) { - this.status = status; - return this; - } - - @Override - BuilderImpl setDiskSizeGb(Long diskSizeGb) { - this.diskSizeGb = diskSizeGb; - return this; - } - - @Override - BuilderImpl setLicenses(List licenses) { - this.licenses = licenses != null ? ImmutableList.copyOf(licenses) : null; - return this; - } - - @Override - public BuilderImpl setSourceDisk(DiskId sourceDisk) { - this.sourceDisk = checkNotNull(sourceDisk); - return this; - } - - @Override - BuilderImpl setSourceDiskId(String sourceDiskId) { - this.sourceDiskId = sourceDiskId; - return this; - } - - @Override - BuilderImpl setStorageBytes(Long storageBytes) { - this.storageBytes = storageBytes; - return this; - } - - @Override - BuilderImpl setStorageBytesStatus(StorageBytesStatus storageBytesStatus) { - this.storageBytesStatus = storageBytesStatus; - return this; - } - - @Override - public SnapshotInfo build() { - return new SnapshotInfo(this); - } - } - - SnapshotInfo(BuilderImpl builder) { - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.snapshotId = checkNotNull(builder.snapshotId); - this.description = builder.description; - this.status = builder.status; - this.diskSizeGb = builder.diskSizeGb; - this.licenses = builder.licenses; - this.sourceDisk = builder.sourceDisk; - this.sourceDiskId = builder.sourceDiskId; - this.storageBytes = builder.storageBytes; - this.storageBytesStatus = builder.storageBytesStatus; - } - - /** - * Returns the service-generated unique identifier for the snapshot. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns the snapshot identity. - */ - public SnapshotId getSnapshotId() { - return snapshotId; - } - - /** - * Returns a textual description of the snapshot. - */ - public String getDescription() { - return description; - } - - /** - * Returns all applicable publicly visible licenses. - */ - public List getLicenses() { - return licenses; - } - - /** - * Returns the status of the snapshot. A snapshot can be used to create other resources, such as - * disks, only after the snapshot has been successfully created and the status is set to - * {@code READY}. - */ - public Status getStatus() { - return status; - } - - /** - * Returns the size of the snapshot (in GB). - */ - public Long getDiskSizeGb() { - return diskSizeGb; - } - - /** - * Returns the identity of the source disk used to create this snapshot. - */ - public DiskId getSourceDisk() { - return sourceDisk; - } - - /** - * Returns the service-generated unique id 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. - */ - public String getSourceDiskId() { - return sourceDiskId; - } - - /** - * Returns the size of the the storage used by the snapshot. As snapshots share storage, this - * number is expected to change with snapshot creation/deletion. - */ - public Long getStorageBytes() { - return storageBytes; - } - - /** - * Indicates whether {@link SnapshotInfo#getStorageBytes()} is in a stable state or it is being - * adjusted as a result of shared storage reallocation. {@link StorageBytesStatus#UPDATING} - * indicates that the size of the snapshot is being updated. {@link StorageBytesStatus#UP_TO_DATE} - * indicates that the size of the snapshot is up-to-date. - */ - public StorageBytesStatus getStorageBytesStatus() { - return storageBytesStatus; - } - - /** - * Returns a builder for the current snapshot. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("snapshotId", snapshotId) - .add("description", description) - .add("status", status) - .add("diskSizeGb", diskSizeGb) - .add("licenses", licenses) - .add("sourceDisk", sourceDisk) - .add("sourceDiskId", sourceDiskId) - .add("storageBytes", storageBytes) - .add("storageBytesStatus", storageBytesStatus) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(generatedId, creationTimestamp, snapshotId, description, status, diskSizeGb, - licenses, sourceDisk, sourceDiskId, storageBytes, storageBytesStatus); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(SnapshotInfo.class) - && Objects.equals(toPb(), ((SnapshotInfo) obj).toPb()); - } - - SnapshotInfo setProjectId(String projectId) { - return toBuilder() - .setSnapshotId(snapshotId.setProjectId(projectId)) - .setSourceDisk(sourceDisk.setProjectId(projectId)) - .build(); - } - - Snapshot toPb() { - Snapshot snapshotPb = new Snapshot(); - if (generatedId != null) { - snapshotPb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - snapshotPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - snapshotPb.setName(snapshotId.getSnapshot()); - snapshotPb.setDescription(description); - snapshotPb.setSelfLink(snapshotId.getSelfLink()); - if (status != null) { - snapshotPb.setStatus(status.name()); - } - snapshotPb.setDiskSizeGb(diskSizeGb); - if (licenses != null) { - snapshotPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); - } - if (sourceDisk != null) { - snapshotPb.setSourceDisk(sourceDisk.getSelfLink()); - } - snapshotPb.setSourceDiskId(sourceDiskId); - snapshotPb.setStorageBytes(storageBytes); - if (storageBytesStatus != null) { - snapshotPb.setStorageBytesStatus(storageBytesStatus.name()); - } - return snapshotPb; - } - - /** - * Returns a builder for a {@code SnapshotInfo} object given the snapshot identity and a source - * disk identity. - */ - public static Builder newBuilder(SnapshotId snapshotId, DiskId source) { - return new BuilderImpl().setSnapshotId(snapshotId).setSourceDisk(source); - } - - /** - * Returns a {@code SnapshotInfo} object given the snapshot identity and a source disk identity. - */ - public static SnapshotInfo of(SnapshotId snapshotId, DiskId source) { - return newBuilder(snapshotId, source).build(); - } - - static SnapshotInfo fromPb(Snapshot snapshotPb) { - return new BuilderImpl(snapshotPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java deleted file mode 100644 index d3f0c0970126..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.services.compute.model.Disk; - -import java.util.Objects; - -/** - * A Google Compute Engine standard persistent disk configuration. This class allows users to create - * a disk given its type and size. - * - * @see Block Storage - */ -public class StandardDiskConfiguration extends DiskConfiguration { - - private static final long serialVersionUID = -6974045909359567054L; - - /** - * A builder for {@code StandardDiskConfiguration} objects. - */ - public static class Builder - extends DiskConfiguration.Builder { - - private Builder() { - super(Type.STANDARD); - } - - private Builder(StandardDiskConfiguration configuration) { - super(configuration); - } - - private Builder(Disk diskPb) { - super(Type.STANDARD, diskPb); - } - - /** - * Sets the size of the persistent disk, in GB. If not set, 500GB is used. - */ - @Override - public Builder setSizeGb(Long sizeGb) { - super.setSizeGb(sizeGb); - return this; - } - - /** - * Creates a {@code StandardDiskConfiguration} object. - */ - @Override - public StandardDiskConfiguration build() { - return new StandardDiskConfiguration(this); - } - } - - private StandardDiskConfiguration(Builder builder) { - super(builder); - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final int hashCode() { - return Objects.hash(baseHashCode()); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(StandardDiskConfiguration.class) - && baseEquals((StandardDiskConfiguration) obj); - } - - @Override - StandardDiskConfiguration setProjectId(String projectId) { - if (getDiskType() == null || getDiskType().getProject() != null) { - return this; - } - return toBuilder().setDiskType(getDiskType().setProjectId(projectId)).build(); - } - - /** - * Returns a builder for a {@code StandardDiskConfiguration} object. - */ - public static Builder newBuilder() { - return new Builder(); - } - - /** - * Returns a {@code StandardDiskConfiguration} object given the disk type. - */ - public static StandardDiskConfiguration of(DiskTypeId diskType) { - return newBuilder().setDiskType(diskType).build(); - } - - /** - * Returns a {@code StandardDiskConfiguration} object given the disk size in GB. - */ - public static StandardDiskConfiguration of(long sizeGb) { - return newBuilder().setSizeGb(sizeGb).build(); - } - - /** - * Returns a {@code StandardDiskConfiguration} object given the disk type and size in GB. - */ - public static StandardDiskConfiguration of(DiskTypeId diskType, long sizeGb) { - return newBuilder().setDiskType(diskType).setSizeGb(sizeGb).build(); - } - - @SuppressWarnings("unchecked") - static StandardDiskConfiguration fromPb(Disk diskPb) { - return new Builder(diskPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java deleted file mode 100644 index 892f37ab472b..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Network; -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * A Google Compute Engine standard network configuration. This class allows users to create a - * network with its own address range. A network created with a {@code StandardNetworkConfiguration} - * does not support the creation of subnetworks. - * - * @see Using Networks and Firewalls - */ -public class StandardNetworkConfiguration extends NetworkConfiguration { - - private static final long serialVersionUID = -5143748459659467966L; - - private final String ipRange; - private final String gatewayAddress; - - StandardNetworkConfiguration(String ipRange, String gatewayAddress) { - super(Type.STANDARD); - this.ipRange = checkNotNull(ipRange); - this.gatewayAddress = gatewayAddress; - } - - /** - * Returns the range of internal IPv4 addresses that are legal on this network. This range is a - * CIDR specification, for example: {@code 192.168.0.0/16}. - * - * @see CIDR - */ - public String getIpRange() { - return ipRange; - } - - /** - * Returns the gateway IPv4 address for this networks. This value is read only and is selected by - * Google Compute Engine, typically as the first usable address in {@code ipRange}. - */ - public String getGatewayAddress() { - return gatewayAddress; - } - - @Override - public final int hashCode() { - return Objects.hash(super.baseHashCode(), ipRange, gatewayAddress); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(StandardNetworkConfiguration.class) - && Objects.equals(toPb(), ((StandardNetworkConfiguration) obj).toPb()); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper().add("ipRange", ipRange).add("gatewayAddress", gatewayAddress); - } - - @Override - Network toPb() { - return new Network().setIPv4Range(ipRange).setGatewayIPv4(gatewayAddress); - } - - /** - * Returns a {@code StandardNetworkConfiguration} object given the range of internal addresses - * that are legal on this network. {@code ipRange} must be a CIDR specification, for example: - * {@code 192.168.0.0/16}. - * - * @see CIDR - */ - public static StandardNetworkConfiguration of(String ipRange) { - return new StandardNetworkConfiguration(ipRange, null); - } - - @SuppressWarnings("unchecked") - static StandardNetworkConfiguration fromPb(Network networkPb) { - return new StandardNetworkConfiguration(networkPb.getIPv4Range(), networkPb.getGatewayIPv4()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java deleted file mode 100644 index 7af2f719d619..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Image; -import com.google.common.base.MoreObjects; - -import java.util.Objects; - -/** - * A Google Compute Engine image configuration used to create images from a Google Cloud Storage - * URL where the disk image is stored. - */ -public class StorageImageConfiguration extends ImageConfiguration { - - private static final long serialVersionUID = 8160447986545005880L; - - private final ContainerType containerType; - private final String sha1; - private final String source; - - /** - * The format used to encode and transmit the block device. The only supported value is - * {@code TAR}. This is just a container and transmission format, not a runtime format. - */ - public enum ContainerType { - TAR - } - - /** - * A builder for {@code StorageImageConfiguration} objects. - */ - public static final class Builder - extends ImageConfiguration.Builder { - - private ContainerType containerType; - private String sha1; - private String source; - - private Builder() { - super(Type.STORAGE); - } - - private Builder(StorageImageConfiguration imageConfiguration) { - super(imageConfiguration); - this.containerType = imageConfiguration.containerType; - this.sha1 = imageConfiguration.sha1; - this.source = imageConfiguration.source; - } - - private Builder(Image imagePb) { - super(Type.STORAGE, imagePb); - if (imagePb.getRawDisk().getContainerType() != null) { - this.containerType = ContainerType.valueOf(imagePb.getRawDisk().getContainerType()); - } - this.sha1 = imagePb.getRawDisk().getSha1Checksum(); - this.source = imagePb.getRawDisk().getSource(); - } - - /** - * Sets the format used to encode and transmit the block device. The only supported value is - * {@code TAR}. This is just a container and transmission format, not a runtime format. - */ - public Builder setContainerType(ContainerType containerType) { - this.containerType = containerType; - return this; - } - - /** - * Sets the SHA1 checksum of the disk image before unpackaging. - */ - public Builder setSha1(String sha1) { - this.sha1 = sha1; - return this; - } - - /** - * Sets the full Google Cloud Storage URL where the disk image is stored (e.g. - * {@code gs://bucket/file}). - */ - public Builder setSource(String source) { - this.source = checkNotNull(source); - return this; - } - - /** - * Creates a {@code StorageImageConfiguration} object. - */ - @Override - public StorageImageConfiguration build() { - return new StorageImageConfiguration(this); - } - } - - private StorageImageConfiguration(Builder builder) { - super(builder); - this.source = checkNotNull(builder.source); - this.containerType = builder.containerType; - this.sha1 = builder.sha1; - } - - /** - * Returns the format used to encode and transmit the block device. This is just a container and - * transmission format, not a runtime format. - */ - public ContainerType getContainerType() { - return containerType; - } - - /** - * Returns the SHA1 checksum of the disk image before unpackaging. - */ - public String getSha1() { - return sha1; - } - - /** - * Returns the full Google Cloud Storage URL where the disk image is stored (e.g. - * {@code gs://bucket/file}). - */ - public String getSource() { - return source; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("source", source) - .add("containerType", containerType) - .add("sha1", sha1); - } - - @Override - public final int hashCode() { - return Objects.hash(baseHashCode(), source, containerType, sha1); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(StorageImageConfiguration.class) - && Objects.equals(toPb(), ((StorageImageConfiguration) obj).toPb()); - } - - @Override - StorageImageConfiguration setProjectId(String projectId) { - return this; - } - - @Override - Image toPb() { - Image.RawDisk rawDiskPb = new Image.RawDisk(); - rawDiskPb.setSource(source); - rawDiskPb.setSha1Checksum(sha1); - if (containerType != null) { - rawDiskPb.setContainerType(containerType.name()); - } - Image imagePb = super.toPb(); - return imagePb.setRawDisk(rawDiskPb); - } - - /** - * Creates a {@code StorageImageConfiguration} builder given the full Google Cloud Storage URL - * where the disk image is stored. - */ - public static Builder newBuilder(String source) { - return new Builder().setSource(source); - } - - /** - * Creates a {@code StorageImageConfiguration} object given the full Google Cloud Storage URL - * where the disk image is stored. - */ - public static StorageImageConfiguration of(String source) { - return newBuilder(source).build(); - } - - @SuppressWarnings("unchecked") - static StorageImageConfiguration fromPb(Image imagePb) { - return new Builder(imagePb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java deleted file mode 100644 index 4cd550952189..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.services.compute.model.Network; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; - -import java.util.List; -import java.util.Objects; - -/** - * A Google Compute Engine configuration for networks that support subnetworks, up to one per - * region, each with its own address range. Subnetworks can be either automatically or manually - * created, depending on the value of {@link SubnetNetworkConfiguration#autoCreateSubnetworks()}. - * - * @see Using Networks and Firewalls - */ -public class SubnetNetworkConfiguration extends NetworkConfiguration { - - private static final long serialVersionUID = -5286394393047479494L; - - private final Boolean autoCreateSubnetworks; - private final List subnetworks; - - SubnetNetworkConfiguration(boolean autoCreateSubnetworks, List subnetworks) { - super(Type.SUBNET); - this.autoCreateSubnetworks = autoCreateSubnetworks; - this.subnetworks = subnetworks; - } - - /** - * Returns whether the subnetworks should be automatically created. When set to {@code true}, the - * network is created in "auto subnet mode". When set to {@code false}, the network is in - * "custom subnet mode". In "auto subnet mode", a subnetwork per region is automatically created. - * In "custom subnet mode", a custom topology of subnetworks can be created by the user. - */ - public Boolean autoCreateSubnetworks() { - return autoCreateSubnetworks; - } - - /** - * Returns the identities of all networks in this network. - */ - public List getSubnetworks() { - return subnetworks; - } - - @Override - public final int hashCode() { - return Objects.hash(autoCreateSubnetworks, subnetworks); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(SubnetNetworkConfiguration.class) - && Objects.equals(toPb(), ((SubnetNetworkConfiguration) obj).toPb()); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("autoCreateSubnetworks", autoCreateSubnetworks) - .add("subnetworks", subnetworks); - } - - @Override - Network toPb() { - Network networkPb = new Network().setAutoCreateSubnetworks(autoCreateSubnetworks); - if (subnetworks != null) { - networkPb.setSubnetworks(Lists.transform(subnetworks, SubnetworkId.TO_URL_FUNCTION)); - } - return networkPb; - } - - /** - * Returns a {@code SubnetNetworkConfiguration} object. The {@code autoCreateSubnetworks} - * parameter sets whether subnetworks should be automatically created. When set to {@code true}, - * the network is created in "auto subnet mode". When set to {@code false}, the network is in - * "custom subnet mode". In "auto subnet mode", a subnetwork per region is automatically created. - * In "custom subnet mode", a custom topology of subnetworks can be created by the user. - */ - public static SubnetNetworkConfiguration of(boolean autoCreateSubnetworks) { - return new SubnetNetworkConfiguration(autoCreateSubnetworks, null); - } - - @SuppressWarnings("unchecked") - static SubnetNetworkConfiguration fromPb(Network networkPb) { - List subnetworks = null; - if (networkPb.getSubnetworks() != null) { - subnetworks = Lists.transform(networkPb.getSubnetworks(), SubnetworkId.FROM_URL_FUNCTION); - } - return new SubnetNetworkConfiguration(networkPb.getAutoCreateSubnetworks(), subnetworks); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java deleted file mode 100644 index bf0c65dc387c..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.cloud.compute.deprecated.Compute.OperationOption; -import com.google.cloud.compute.deprecated.Compute.SubnetworkOption; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.Objects; - -/** - * A Google Compute Engine Subnetwork. Subnetworks segments your cloud network IP space into - * subnetworks. Subnetwork prefixes can be automatically allocated, or you can create a custom - * topology. Objects of this class are immutable. To get a {@code Subnetwork} object with the most - * recent information use {@link #reload}. {@code Subnetwork} adds a layer of service-related - * functionality over {@link SubnetworkInfo}. - * - * @see Subnetworks - */ -public class Subnetwork extends SubnetworkInfo { - - private static final long serialVersionUID = 8608280908101278096L; - - private final ComputeOptions options; - private transient Compute compute; - - /** - * A builder for {@code Subnetwork} objects. - */ - public static class Builder extends SubnetworkInfo.Builder { - - private final Compute compute; - private final SubnetworkInfo.BuilderImpl infoBuilder; - - Builder(Compute compute, SubnetworkId subnetworkId, NetworkId networkId, String ipRange) { - this.compute = compute; - this.infoBuilder = new SubnetworkInfo.BuilderImpl(subnetworkId, networkId, ipRange); - this.infoBuilder.setSubnetworkId(subnetworkId); - this.infoBuilder.setNetwork(networkId); - this.infoBuilder.setIpRange(ipRange); - } - - Builder(Subnetwork subnetwork) { - this.compute = subnetwork.compute; - this.infoBuilder = new SubnetworkInfo.BuilderImpl(subnetwork); - } - - @Override - Builder setGeneratedId(String generatedId) { - infoBuilder.setGeneratedId(generatedId); - return this; - } - - @Override - Builder setCreationTimestamp(Long creationTimestamp) { - infoBuilder.setCreationTimestamp(creationTimestamp); - return this; - } - - @Override - public Builder setSubnetworkId(SubnetworkId subnetworkId) { - infoBuilder.setSubnetworkId(subnetworkId); - return this; - } - - - @Override - public Builder setDescription(String description) { - infoBuilder.setDescription(description); - return this; - } - - @Override - Builder setGatewayAddress(String gatewayAddress) { - infoBuilder.setGatewayAddress(gatewayAddress); - return this; - } - - @Override - public Builder setNetwork(NetworkId network) { - infoBuilder.setNetwork(network); - return this; - } - - @Override - public Builder setIpRange(String ipRange) { - infoBuilder.setIpRange(ipRange); - return this; - } - - @Override - public Subnetwork build() { - return new Subnetwork(compute, infoBuilder); - } - } - - Subnetwork(Compute compute, SubnetworkInfo.BuilderImpl infoBuilder) { - super(infoBuilder); - this.compute = checkNotNull(compute); - this.options = compute.getOptions(); - } - - /** - * Checks if this subnetwork exists. - * - * @return {@code true} if this subnetwork exists, {@code false} otherwise - * @throws ComputeException upon failure - */ - public boolean exists() { - return reload(SubnetworkOption.fields()) != null; - } - - /** - * Fetches current subnetwork' latest information. Returns {@code null} if the subnetwork does not - * exist. - * - * @param options subnetwork options - * @return an {@code Subnetwork} object with latest information or {@code null} if not found - * @throws ComputeException upon failure - */ - public Subnetwork reload(SubnetworkOption... options) { - return compute.getSubnetwork(getSubnetworkId(), options); - } - - /** - * Deletes this subnetwork. If this subnetwork was auto-generated deletion will fail. - * - * @return an operation object if delete request was successfully sent, {@code null} if the - * subnetwork was not found - * @throws ComputeException upon failure - */ - public Operation delete(OperationOption... options) { - return compute.deleteSubnetwork(getSubnetworkId(), options); - } - - /** - * Returns the subnetwork's {@code Compute} object used to issue requests. - */ - public Compute getCompute() { - return compute; - } - - @Override - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj == null || !obj.getClass().equals(Subnetwork.class)) { - return false; - } - Subnetwork other = (Subnetwork) obj; - return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); - } - - @Override - public final int hashCode() { - return Objects.hash(super.hashCode(), options); - } - - private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { - input.defaultReadObject(); - this.compute = options.getService(); - } - - static Subnetwork fromPb(Compute compute, - com.google.api.services.compute.model.Subnetwork subnetworkPb) { - return new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(subnetworkPb)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java deleted file mode 100644 index 84bb5b903b41..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine subnetwork. - */ -public final class SubnetworkId extends ResourceId { - - static final Function FROM_URL_FUNCTION = - new Function() { - @Override - public SubnetworkId apply(String pb) { - return SubnetworkId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = - new Function() { - @Override - public String apply(SubnetworkId zoneId) { - return zoneId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/subnetworks/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -5451054513760540282L; - - private final String region; - private final String subnetwork; - - private SubnetworkId(String project, String region, String subnetwork) { - super(project); - this.region = checkNotNull(region); - this.subnetwork = checkNotNull(subnetwork); - } - - /** - * Returns the name of the region this subnetwork belongs to. - */ - public String getRegion() { - return region; - } - - /** - * Returns the identity of the region this subnetwork belongs to. - */ - public RegionId getRegionId() { - return RegionId.of(getProject(), region); - } - - /** - * Returns the name of the subnetwork. The name must be 1-63 characters long and comply with - * RFC1035. Specifically, the name must match the regular expression - * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, - * and all following characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. - * - * @see RFC1035 - */ - public String getSubnetwork() { - return subnetwork; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/regions/" + region + "/subnetworks/" + subnetwork; - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("region", region).add("subnetwork", subnetwork); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), region, subnetwork); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof SubnetworkId)) { - return false; - } - SubnetworkId other = (SubnetworkId) obj; - return baseEquals(other) - && Objects.equals(region, other.region) - && Objects.equals(subnetwork, other.subnetwork); - } - - @Override - SubnetworkId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return SubnetworkId.of(projectId, getRegion(), subnetwork); - } - - /** - * Returns a subnetwork identity given the region identity and the subnetwork name. The subnetwork - * name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match - * the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must - * be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static SubnetworkId of(RegionId regionId, String subnetwork) { - return new SubnetworkId(regionId.getProject(), regionId.getRegion(), subnetwork); - } - - /** - * Returns a subnetwork identity given the region and subnetwork names. The subnetwork name must - * be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular - * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static SubnetworkId of(String region, String subnetwork) { - return new SubnetworkId(null, region, subnetwork); - } - - /** - * Returns a subnetwork identity given project, region and subnetwork names. The subnetwork name - * must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the - * regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, - * except the last character, which cannot be a dash. - * - * @see RFC1035 - */ - public static SubnetworkId of(String project, String region, String subnetwork) { - return new SubnetworkId(project, region, subnetwork); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a subnetwork URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static SubnetworkId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid subnetwork URL"); - } - return SubnetworkId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java deleted file mode 100644 index a7a99ee21f95..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java +++ /dev/null @@ -1,348 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.api.services.compute.model.Subnetwork; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.Objects; - -/** - * A Google Compute Engine subnetwork. Compute Engine subnetworks allow you to segment your Compute - * Engine network IP space into subnetworks. Subnetworks for a Compute Engine network can be - * automatically allocated, or you can create a custom topology. - * - * @see Subnetworks - */ -public class SubnetworkInfo implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public SubnetworkInfo apply(Subnetwork pb) { - return SubnetworkInfo.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public Subnetwork apply(SubnetworkInfo subnetwork) { - return subnetwork.toPb(); - } - }; - - private static final long serialVersionUID = 7491176262675441579L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final String generatedId; - private final SubnetworkId subnetworkId; - private final Long creationTimestamp; - private final String description; - private final String gatewayAddress; - private final NetworkId network; - private final String ipRange; - - /** - * A builder for {@code SubnetworkInfo} objects. - */ - public abstract static class Builder { - - abstract Builder setGeneratedId(String generatedId); - - abstract Builder setCreationTimestamp(Long creationTimestamp); - - /** - * Sets the identity of the subnework. - */ - public abstract Builder setSubnetworkId(SubnetworkId subnetworkId); - - /** - * Sets an optional textual description of the subnetwork. - */ - public abstract Builder setDescription(String description); - - abstract Builder setGatewayAddress(String gatewayAddress); - - /** - * Sets the identity of the network to which this subnetwork belongs. Only networks that are in - * subnet mode can have subnetworks. - */ - public abstract Builder setNetwork(NetworkId network); - - /** - * Sets the range of internal IPv4 addresses that are owned by this subnetwork. This range must - * be a CIDR specification, for example: {@code 192.168.0.0/16}. Ranges must be unique and - * non-overlapping within a network. - * - * @see CIDR - */ - public abstract Builder setIpRange(String ipRange); - - /** - * Creates a {@code SubnetworkInfo} object. - */ - public abstract SubnetworkInfo build(); - } - - static final class BuilderImpl extends Builder { - - private String generatedId; - private SubnetworkId subnetworkId; - private Long creationTimestamp; - private String description; - private String gatewayAddress; - private NetworkId network; - private String ipRange; - - BuilderImpl(SubnetworkId subnetworkId, NetworkId network, String ipRange) { - this.subnetworkId = checkNotNull(subnetworkId); - this.network = checkNotNull(network); - this.ipRange = checkNotNull(ipRange); - } - - BuilderImpl(SubnetworkInfo subnetworkInfo) { - this.generatedId = subnetworkInfo.generatedId; - this.creationTimestamp = subnetworkInfo.creationTimestamp; - this.subnetworkId = subnetworkInfo.subnetworkId; - this.description = subnetworkInfo.description; - this.gatewayAddress = subnetworkInfo.gatewayAddress; - this.network = subnetworkInfo.network; - this.ipRange = subnetworkInfo.ipRange; - } - - BuilderImpl(Subnetwork subnetworkPb) { - if (subnetworkPb.getId() != null) { - this.generatedId = subnetworkPb.getId().toString(); - } - if (subnetworkPb.getCreationTimestamp() != null) { - this.creationTimestamp = - TIMESTAMP_FORMATTER.parseMillis(subnetworkPb.getCreationTimestamp()); - } - this.subnetworkId = SubnetworkId.fromUrl(subnetworkPb.getSelfLink()); - this.description = subnetworkPb.getDescription(); - this.gatewayAddress = subnetworkPb.getGatewayAddress(); - if (subnetworkPb.getNetwork() != null) { - this.network = NetworkId.fromUrl(subnetworkPb.getNetwork()); - } - this.ipRange = subnetworkPb.getIpCidrRange(); - } - - @Override - BuilderImpl setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - @Override - BuilderImpl setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - @Override - public BuilderImpl setSubnetworkId(SubnetworkId subnetworkId) { - this.subnetworkId = checkNotNull(subnetworkId); - return this; - } - - @Override - public BuilderImpl setDescription(String description) { - this.description = description; - return this; - } - - @Override - BuilderImpl setGatewayAddress(String gatewayAddress) { - this.gatewayAddress = gatewayAddress; - return this; - } - - @Override - public BuilderImpl setNetwork(NetworkId network) { - this.network = checkNotNull(network); - return this; - } - - @Override - public BuilderImpl setIpRange(String ipRange) { - this.ipRange = checkNotNull(ipRange); - return this; - } - - @Override - public SubnetworkInfo build() { - return new SubnetworkInfo(this); - } - } - - SubnetworkInfo(BuilderImpl builder) { - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.subnetworkId = checkNotNull(builder.subnetworkId); - this.description = builder.description; - this.gatewayAddress = builder.gatewayAddress; - this.network = builder.network; - this.ipRange = builder.ipRange; - } - - /** - * Returns the service-generated unique identifier for the subnetwork. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns the subnetwork identity. - */ - public SubnetworkId getSubnetworkId() { - return subnetworkId; - } - - /** - * Returns a textual description of the subnetwork. - */ - public String getDescription() { - return description; - } - - /** - * Returns the gateway IPv4 address for this subnetwork, selected by the service. - */ - public String getGatewayAddress() { - return gatewayAddress; - } - - /** - * Returns the identity of the network to which this subnetwork belongs. Only networks that are in - * subnet mode can have subnetworks. - */ - public NetworkId getNetwork() { - return network; - } - - /** - * Returns the range of internal IPv4 addresses that are owned by this subnetwork. This range is a - * CIDR specification, for example: {@code 192.168.0.0/16}. Ranges must be unique and - * non-overlapping within a network. - * - * @see CIDR - */ - public String getIpRange() { - return ipRange; - } - - /** - * Returns a builder for the current subnetwork. - */ - public Builder toBuilder() { - return new BuilderImpl(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("subnetworkId", subnetworkId) - .add("description", description) - .add("gatewayAddress", gatewayAddress) - .add("network", network) - .add("ipRange", ipRange) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(generatedId, creationTimestamp, subnetworkId, description, gatewayAddress, - network, ipRange); - } - - @Override - public boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(SubnetworkInfo.class) - && Objects.equals(toPb(), ((SubnetworkInfo) obj).toPb()); - } - - SubnetworkInfo setProjectId(String projectId) { - return toBuilder() - .setSubnetworkId(subnetworkId.setProjectId(projectId)) - .setNetwork(network.setProjectId(projectId)) - .build(); - } - - Subnetwork toPb() { - Subnetwork subnetworkPb = new Subnetwork(); - if (generatedId != null) { - subnetworkPb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - subnetworkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - subnetworkPb.setName(subnetworkId.getSubnetwork()); - subnetworkPb.setDescription(description); - subnetworkPb.setSelfLink(subnetworkId.getSelfLink()); - subnetworkPb.setGatewayAddress(gatewayAddress); - subnetworkPb.setNetwork(network.getSelfLink()); - subnetworkPb.setIpCidrRange(ipRange); - return subnetworkPb; - } - - /** - * Returns a builder for a {@code SubnetworkInfo} object given the identity of the subnetwork, the - * identity of the network this subnetwork belongs to and the range of IPv4 addresses owned by - * this subnetwork. {@code ipRange} must be a CIDR specification, for example: - * {@code 192.168.0.0/16}. - * - * @see CIDR - */ - public static Builder newBuilder(SubnetworkId subnetworkId, NetworkId network, String ipRange) { - return new BuilderImpl(subnetworkId, network, ipRange); - } - - /** - * Returns a {@code SubnetworkInfo} object given the identity of the subnetwork, the identity of - * the network this subnetwork belongs to and the range of IPv4 addresses owned by this - * subnetwork. {@code ipRange} must be a CIDR specification, for example: {@code 192.168.0.0/16}. - * - * @see CIDR - */ - public static SubnetworkInfo of(SubnetworkId subnetworkId, NetworkId network, String ipRange) { - return newBuilder(subnetworkId, network, ipRange).build(); - } - - static SubnetworkInfo fromPb(Subnetwork subnetworkPb) { - return new BuilderImpl(subnetworkPb).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java deleted file mode 100644 index a866613fe615..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** - * A list of tags for a Google Compute Engine Instance; with associated fingerprint. Tags are used - * to identify valid sources or targets for network firewalls and are specified by the client - * during instance creation. Each tag within the list must comply with RFC1035. - * - * @see RFC1035 - */ -public final class Tags implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public Tags apply(com.google.api.services.compute.model.Tags pb) { - return Tags.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Tags apply(Tags tags) { - return tags.toPb(); - } - }; - - private static final long serialVersionUID = 5627093820497225322L; - - private final List values; - private final String fingerprint; - - /** - * A builder for {@code Tags} objects. - */ - public static final class Builder { - - private List values; - private String fingerprint; - - private Builder() { - values = Lists.newArrayList(); - } - - private Builder(Tags tags) { - this.values = tags.values != null ? Lists.newArrayList(tags.values) - : Lists.newArrayList(); - this.fingerprint = tags.fingerprint; - } - - /** - * Sets a list of tags to apply to an instance. Tags are used to identify valid sources or - * targets for network firewalls. Each tag within the list must comply with RFC1035. - * - * @see RFC1035 - */ - public Builder setValues(Iterable values) { - this.values = Lists.newArrayList(values); - return this; - } - - /** - * Sets a list of tags to apply to an instance. Tags are used to identify valid sources or - * targets for network firewalls. Each tag within the list must comply with RFC1035. - * - * @see RFC1035 - */ - public Builder setValues(String... values) { - this.values = Lists.newArrayList(Arrays.asList(checkNotNull(values))); - return this; - } - - /** - * Adds a tag to the list of tags. Tags are used to identify valid sources or targets for - * network firewalls. The tag must comply with RFC1035. - * - * @see RFC1035 - */ - public Builder add(String tag) { - this.values.add(tag); - return this; - } - - /** - * Sets the fingerprint for the tags. This value is needed to update instance's tags. - */ - public Builder setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Creates a {@code Tags} object. - */ - public Tags build() { - return new Tags(this); - } - } - - private Tags(Builder builder) { - this.values = ImmutableList.copyOf(builder.values); - this.fingerprint = builder.fingerprint; - } - - /** - * Returns a list of tags to apply to an instance. Tags are used to identify valid sources or - * targets for network firewalls. Each tag within the list must comply with RFC1035. - * - * @see RFC1035 - */ - public List getValues() { - return values; - } - - /** - * Returns the fingerprint for the tags. This value is needed to update instance's tags. - */ - public String getFingerprint() { - return fingerprint; - } - - /** - * Returns a builder for the current instance tags. - */ - public Builder toBuilder() { - return new Builder(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("values", values) - .add("fingerprint", fingerprint) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(values, fingerprint); - } - - @Override - public boolean equals(Object obj) { - return obj == this || obj instanceof Tags && Objects.equals(toPb(), ((Tags) obj).toPb()); - } - - com.google.api.services.compute.model.Tags toPb() { - com.google.api.services.compute.model.Tags tagsPb = - new com.google.api.services.compute.model.Tags(); - tagsPb.setFingerprint(fingerprint); - tagsPb.setItems(values); - return tagsPb; - } - - /** - * Returns a builder for a {@code Tags} object given the tags to apply to the instance. Each tag - * within the list must comply with RFC1035. - * - * @see RFC1035 - */ - public static Builder newBuilder(Iterable values) { - return new Builder().setValues(values); - } - - /** - * Returns a builder for a {@code Tags} object given the tags to apply to the instance. Each tag - * within the list must comply with RFC1035. - * - * @see RFC1035 - */ - public static Builder newBuilder(String... values) { - return new Builder().setValues(values); - } - - /** - * Returns a {@code Tags} object given the tags to apply to the instance. Each tag within the - * list must comply with RFC1035. - * - * @see RFC1035 - */ - public static Tags of(Iterable values) { - return newBuilder(values).build(); - } - - /** - * Returns a {@code Tags} object given the tags to apply to the instance. Each tag within the - * list must comply with RFC1035. - * - * @see RFC1035 - */ - public static Tags of(String... values) { - return newBuilder(values).build(); - } - - static Tags fromPb(com.google.api.services.compute.model.Tags tagsPb) { - Builder builder = - newBuilder(tagsPb.getItems() != null ? tagsPb.getItems() : ImmutableList.of()); - return builder.setFingerprint(tagsPb.getFingerprint()).build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java deleted file mode 100644 index 0b455cda7e10..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.api.core.ApiFunction; -import com.google.cloud.StringEnumType; -import com.google.cloud.StringEnumValue; -import com.google.common.base.Function; -import com.google.common.base.MoreObjects; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.Objects; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -/** - * A Google Compute Engine zone. - * - * @see Region and Zones - */ -public class Zone implements Serializable { - - static final Function FROM_PB_FUNCTION = - new Function() { - @Override - public Zone apply(com.google.api.services.compute.model.Zone pb) { - return Zone.fromPb(pb); - } - }; - static final Function TO_PB_FUNCTION = - new Function() { - @Override - public com.google.api.services.compute.model.Zone apply(Zone region) { - return region.toPb(); - } - }; - - private static final long serialVersionUID = 6113636504417213010L; - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - - private final ZoneId zoneId; - private final String generatedId; - private final Long creationTimestamp; - private final String description; - private final Status status; - private final RegionId region; - private final DeprecationStatus deprecationStatus; - - /** - * Status of the region. - */ - public static final class Status extends StringEnumValue { - private static final long serialVersionUID = -1052872318386811804L; - - private static final ApiFunction CONSTRUCTOR = - new ApiFunction() { - @Override - public Status apply(String constant) { - return new Status(constant); - } - }; - - private static final StringEnumType type = new StringEnumType( - Status.class, - CONSTRUCTOR); - - public static final Status UP = type.createAndRegister("UP"); - public static final Status DOWN = type.createAndRegister("DOWN"); - - private Status(String constant) { - super(constant); - } - - /** - * Get the Status for the given String constant, and throw an exception if the constant is - * not recognized. - */ - public static Status valueOfStrict(String constant) { - return type.valueOfStrict(constant); - } - - /** - * Get the Status for the given String constant, and allow unrecognized values. - */ - public static Status valueOf(String constant) { - return type.valueOf(constant); - } - - /** - * Return the known values for Status. - */ - public static Status[] values() { - return type.values(); - } - } - - static final class Builder { - - private ZoneId zoneId; - private String generatedId; - private Long creationTimestamp; - private String description; - - private Status status; - private RegionId region; - private DeprecationStatus deprecationStatus; - - private Builder() {} - - Builder setZoneId(ZoneId zoneId) { - this.zoneId = zoneId; - return this; - } - - Builder setGeneratedId(String generatedId) { - this.generatedId = generatedId; - return this; - } - - Builder setCreationTimestamp(Long creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - Builder setDescription(String description) { - this.description = description; - return this; - } - - Builder setStatus(Status status) { - this.status = status; - return this; - } - - Builder setRegion(RegionId region) { - this.region = region; - return this; - } - - Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { - this.deprecationStatus = deprecationStatus; - return this; - } - - Zone build() { - return new Zone(this); - } - } - - private Zone(Builder builder) { - this.zoneId = builder.zoneId; - this.generatedId = builder.generatedId; - this.creationTimestamp = builder.creationTimestamp; - this.description = builder.description; - this.status = builder.status; - this.region = builder.region; - this.deprecationStatus = builder.deprecationStatus; - } - - /** - * Returns the zone's identity. - */ - public ZoneId getZoneId() { - return zoneId; - } - - /** - * Returns the creation timestamp in milliseconds since epoch. - */ - public Long getCreationTimestamp() { - return creationTimestamp; - } - - /** - * Returns an optional textual description of the zone. - */ - public String getDescription() { - return description; - } - - /** - * Returns the service-generated unique identifier for the zone. - */ - public String getGeneratedId() { - return generatedId; - } - - /** - * Returns the status of the zone. - */ - public Status getStatus() { - return status; - } - - /** - * Returns the identity of the region that hosts the zone. - */ - public RegionId getRegion() { - return region; - } - - /** - * Returns the deprecation status of the zone. If {@link DeprecationStatus#getStatus()} is either - * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the zone - * should not be used. Returns {@code null} if the zone is not deprecated. - */ - public DeprecationStatus getDeprecationStatus() { - return deprecationStatus; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("zoneId", zoneId) - .add("generatedId", generatedId) - .add("creationTimestamp", creationTimestamp) - .add("description", description) - .add("status", status) - .add("region", region) - .add("deprecationStatus", deprecationStatus) - .toString(); - } - - @Override - public final int hashCode() { - return Objects.hash(zoneId); - } - - @Override - public final boolean equals(Object obj) { - return obj == this - || obj != null - && obj.getClass().equals(Zone.class) - && Objects.equals(toPb(), ((Zone) obj).toPb()); - } - - com.google.api.services.compute.model.Zone toPb() { - com.google.api.services.compute.model.Zone zonePb = - new com.google.api.services.compute.model.Zone(); - if (generatedId != null) { - zonePb.setId(new BigInteger(generatedId)); - } - if (creationTimestamp != null) { - zonePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); - } - zonePb.setName(zoneId.getZone()); - zonePb.setDescription(description); - zonePb.setSelfLink(zoneId.getSelfLink()); - if (status != null) { - zonePb.setStatus(status.name()); - } - if (region != null) { - zonePb.setRegion(region.getSelfLink()); - } - if (deprecationStatus != null) { - zonePb.setDeprecated(deprecationStatus.toPb()); - } - return zonePb; - } - - static Builder builder() { - return new Builder(); - } - - static Zone fromPb(com.google.api.services.compute.model.Zone zonePb) { - Builder builder = builder(); - builder.setZoneId(ZoneId.fromUrl(zonePb.getSelfLink())); - if (zonePb.getId() != null) { - builder.setGeneratedId(zonePb.getId().toString()); - } - if (zonePb.getCreationTimestamp() != null) { - builder.setCreationTimestamp(TIMESTAMP_FORMATTER.parseMillis(zonePb.getCreationTimestamp())); - } - builder.setDescription(zonePb.getDescription()); - if (zonePb.getStatus() != null) { - builder.setStatus(Status.valueOf(zonePb.getStatus())); - } - if (zonePb.getRegion() != null) { - builder.setRegion(RegionId.fromUrl(zonePb.getRegion())); - } - if (zonePb.getDeprecated() != null) { - builder.setDeprecationStatus( - DeprecationStatus.fromPb(zonePb.getDeprecated(), ZoneId.FROM_URL_FUNCTION)); - } - return builder.build(); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java deleted file mode 100644 index 6b7fc8028279..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.Function; -import com.google.common.base.MoreObjects.ToStringHelper; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * A Google Compute Engine zone identity. - */ -public final class ZoneId extends ResourceId { - - static final Function FROM_URL_FUNCTION = new Function() { - @Override - public ZoneId apply(String pb) { - return ZoneId.fromUrl(pb); - } - }; - static final Function TO_URL_FUNCTION = new Function() { - @Override - public String apply(ZoneId zoneId) { - return zoneId.getSelfLink(); - } - }; - - private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = -7635391994812946733L; - - private final String zone; - - private ZoneId(String project, String zone) { - super(project); - this.zone = checkNotNull(zone); - } - - /** - * Returns the name of the zone. - */ - public String getZone() { - return zone; - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/zones/" + zone; - } - - @Override - ToStringHelper toStringHelper() { - return super.toStringHelper().add("zone", zone); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), zone); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ZoneId)) { - return false; - } - ZoneId other = (ZoneId) obj; - return baseEquals(other) && Objects.equals(zone, other.zone); - } - - @Override - ZoneId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return ZoneId.of(projectId, zone); - } - - /** - * Returns a new zone identity given project and zone names. - */ - public static ZoneId of(String project, String zone) { - return new ZoneId(project, zone); - } - - /** - * Returns a new zone identity given zone name. - */ - public static ZoneId of(String zone) { - return ZoneId.of(null, zone); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a zone URL. - * Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return url.matches(REGEX); - } - - static ZoneId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid zone URL"); - } - return ZoneId.of(matcher.group(1), matcher.group(2)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java deleted file mode 100644 index 2e7d10d1d873..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; - -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Identity for a Google Compute Engine zone operation. - */ -public final class ZoneOperationId extends OperationId { - - private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/operations/([^/]+)"; - private static final Pattern PATTERN = Pattern.compile(REGEX); - private static final long serialVersionUID = 4910670262094017392L; - - private final String zone; - - private ZoneOperationId(String project, String zone, String operation) { - super(project, operation); - this.zone = checkNotNull(zone); - } - - @Override - public Type getType() { - return Type.ZONE; - } - - /** - * Returns the name of the zone this operation belongs to. - */ - public String getZone() { - return zone; - } - - /** - * Returns the identity of the zone this address belongs to. - */ - public ZoneId getZoneId() { - return ZoneId.of(getProject(), zone); - } - - @Override - public String getSelfLink() { - return super.getSelfLink() + "/zones/" + zone + "/operations/" + getOperation(); - } - - @Override - MoreObjects.ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).add("zone", zone); - } - - @Override - public int hashCode() { - return Objects.hash(baseHashCode(), zone); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ZoneOperationId)) { - return false; - } - ZoneOperationId other = (ZoneOperationId) obj; - return baseEquals(other) && Objects.equals(zone, other.zone); - } - - @Override - ZoneOperationId setProjectId(String projectId) { - if (getProject() != null) { - return this; - } - return ZoneOperationId.of(projectId, zone, getOperation()); - } - - /** - * Returns a zone operation identity given the zone identity and the operation name. - */ - public static ZoneOperationId of(ZoneId zoneId, String operation) { - return new ZoneOperationId(zoneId.getProject(), zoneId.getZone(), operation); - } - - /** - * Returns a zone operation identity given the zone and operation names. - */ - public static ZoneOperationId of(String zone, String operation) { - return new ZoneOperationId(null, zone, operation); - } - - /** - * Returns a zone operation identity given project, zone and operation names. - */ - public static ZoneOperationId of(String project, String zone, String operation) { - return new ZoneOperationId(project, zone, operation); - } - - /** - * Returns {@code true} if the provided string matches the expected format of a zone operation - * URL. Returns {@code false} otherwise. - */ - static boolean matchesUrl(String url) { - return PATTERN.matcher(url).matches(); - } - - static ZoneOperationId fromUrl(String url) { - Matcher matcher = PATTERN.matcher(url); - if (!matcher.matches()) { - throw new IllegalArgumentException(url + " is not a valid zone operation URL"); - } - return ZoneOperationId.of(matcher.group(1), matcher.group(2), matcher.group(3)); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java deleted file mode 100644 index a951997e09ff..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * A client for Google Compute Engine – High-performance, scalable virtual machines. - * - *

Here's a simple usage example for using google-cloud from App/Compute Engine. This example - * shows how to create a snapshot from an existing disk. For the complete source code see - * - * CreateSnapshot.java. - *

 {@code
- * Compute compute = ComputeOptions.getDefaultInstance().getService();
- * DiskId diskId = DiskId.of("us-central1-a", "disk-name");
- * Disk disk = compute.getDisk(diskId, Compute.DiskOption.fields());
- * if (disk != null) {
- *   String snapshotName = "disk-name-snapshot";
- *   Operation operation = disk.createSnapshot(snapshotName);
- *   operation = operation.waitFor();
- *   if (operation.getErrors() == null) {
- *     // use snapshot
- *     Snapshot snapshot = compute.getSnapshot(snapshotName);
- *   }
- * }}
- *

This second example shows how to create a virtual machine instance. Complete source code can - * be found at - * - * CreateInstance.java. - *

 {@code
- * Compute compute = ComputeOptions.getDefaultInstance().getService();
- * ImageId imageId = ImageId.of("debian-cloud", "debian-8-jessie-v20160329");
- * NetworkId networkId = NetworkId.of("default");
- * AttachedDisk attachedDisk = AttachedDisk.of(AttachedDisk.CreateDiskConfiguration.of(imageId));
- * NetworkInterface networkInterface = NetworkInterface.of(networkId);
- * InstanceId instanceId = InstanceId.of("us-central1-a", "instance-name");
- * MachineTypeId machineTypeId = MachineTypeId.of("us-central1-a", "n1-standard-1");
- * Operation operation =
- *     compute.create(InstanceInfo.of(instanceId, machineTypeId, attachedDisk, networkInterface));
- * operation = operation.waitFor();
- * if (operation.getErrors() == null) {
- *   // use instance
- *   Instance instance = compute.getInstance(instanceId);
- * }}
- * - * @see Google Cloud Compute - */ -package com.google.cloud.compute.deprecated; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java deleted file mode 100644 index d192bf5cd222..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.spi; - -import com.google.cloud.compute.deprecated.ComputeOptions; -import com.google.cloud.spi.ServiceRpcFactory; - -/** - * An interface for Compute RPC factory. - * Implementation will be loaded via {@link java.util.ServiceLoader}. - */ -public interface ComputeRpcFactory extends ServiceRpcFactory { -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java deleted file mode 100644 index 768b4d02112d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java +++ /dev/null @@ -1,650 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.spi.v1; - -import com.google.api.services.compute.model.AccessConfig; -import com.google.api.services.compute.model.Address; -import com.google.api.services.compute.model.AttachedDisk; -import com.google.api.services.compute.model.DeprecationStatus; -import com.google.api.services.compute.model.Disk; -import com.google.api.services.compute.model.DiskType; -import com.google.api.services.compute.model.Image; -import com.google.api.services.compute.model.Instance; -import com.google.api.services.compute.model.License; -import com.google.api.services.compute.model.MachineType; -import com.google.api.services.compute.model.Metadata; -import com.google.api.services.compute.model.Network; -import com.google.api.services.compute.model.Operation; -import com.google.api.services.compute.model.Region; -import com.google.api.services.compute.model.Scheduling; -import com.google.api.services.compute.model.Snapshot; -import com.google.api.services.compute.model.Subnetwork; -import com.google.api.services.compute.model.Tags; -import com.google.api.services.compute.model.Zone; -import com.google.cloud.ServiceRpc; -import com.google.cloud.Tuple; -import com.google.cloud.compute.deprecated.ComputeException; -import java.util.Map; - -public interface ComputeRpc extends ServiceRpc { - - // These options are part of the Google Compute Engine query parameters - enum Option { - FIELDS("fields"), - MAX_RESULTS("maxResults"), - PAGE_TOKEN("pageToken"), - FILTER("filter"); - - private final String value; - - Option(String value) { - this.value = value; - } - - public String value() { - return value; - } - - @SuppressWarnings("unchecked") - T get(Map options) { - return (T) options.get(this); - } - - String getString(Map options) { - return get(options); - } - - Long getLong(Map options) { - return get(options); - } - - Boolean getBoolean(Map options) { - return get(options); - } - } - - /** - * Returns the requested disk type or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - DiskType getDiskType(String zone, String diskType, Map options); - - /** - * Lists the disk types in the provided zone. - * - * @throws ComputeException upon failure - */ - Tuple> listDiskTypes(String zone, Map options); - - /** - * Lists disk types. - * - * @throws ComputeException upon failure - */ - Tuple> listDiskTypes(Map options); - - /** - * Returns the requested machine type or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - MachineType getMachineType(String zone, String diskType, Map options); - - /** - * Lists the machine types in the provided zone. - * - * @throws ComputeException upon failure - */ - Tuple> listMachineTypes(String zone, Map options); - - /** - * Lists machine types. - * - * @throws ComputeException upon failure - */ - Tuple> listMachineTypes(Map options); - - /** - * Returns the requested region or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Region getRegion(String region, Map options); - - /** - * Lists the regions. - * - * @throws ComputeException upon failure - */ - Tuple> listRegions(Map options); - - /** - * Returns the requested zone or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Zone getZone(String zone, Map options); - - /** - * Lists the zones. - * - * @throws ComputeException upon failure - */ - Tuple> listZones(Map options); - - /** - * Returns the requested license or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - License getLicense(String project, String license, Map options); - - /** - * Returns the requested global operation or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Operation getGlobalOperation(String operation, Map options); - - /** - * Lists the global operations. - * - * @throws ComputeException upon failure - */ - Tuple> listGlobalOperations(Map options); - - /** - * Deletes the requested global operation. - * - * @return {@code true} if operation was deleted, {@code false} if it was not found - * @throws ComputeException upon failure - */ - boolean deleteGlobalOperation(String operation); - - /** - * Returns the requested region operation or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Operation getRegionOperation(String region, String operation, Map options); - - /** - * Lists the region operations for the provided region. - * - * @throws ComputeException upon failure - */ - Tuple> listRegionOperations(String region, Map options); - - /** - * Deletes the requested region operation. - * - * @return {@code true} if operation was deleted, {@code false} if it was not found - * @throws ComputeException upon failure - */ - boolean deleteRegionOperation(String region, String operation); - - /** - * Returns the requested zone operation or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Operation getZoneOperation(String zone, String operation, Map options); - - /** - * Lists the zone operations for the provided zone. - * - * @throws ComputeException upon failure - */ - Tuple> listZoneOperations(String zone, Map options); - - /** - * Deletes the requested zone operation. - * - * @return {@code true} if operation was deleted, {@code false} if it was not found - * @throws ComputeException upon failure - */ - boolean deleteZoneOperation(String zone, String operation); - - /** - * Returns the requested global address or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Address getGlobalAddress(String address, Map options); - - /** - * Creates a new global address. - * - * @return a global operation for global address' creation - * @throws ComputeException upon failure - */ - Operation createGlobalAddress(Address address, Map options); - - /** - * Lists the global addresses. - * - * @throws ComputeException upon failure - */ - Tuple> listGlobalAddresses(Map options); - - /** - * Deletes the requested global address. - * - * @return a global operation if the request was issued correctly, {@code null} if the address was - * not found - * @throws ComputeException upon failure - */ - Operation deleteGlobalAddress(String address, Map options); - - /** - * Returns the requested region address or {@code null} if not found. - * - * @throws ComputeException upon failure or if region is not found - */ - Address getRegionAddress(String region, String address, Map options); - - /** - * Creates a new region address. - * - * @return a region operation for region address' creation - * @throws ComputeException upon failure or if region is not found - */ - Operation createRegionAddress(String region, Address address, Map options); - - /** - * Lists the regions addresses for the provided region. - * - * @throws ComputeException upon failure or if region is not found - */ - Tuple> listRegionAddresses(String region, Map options); - - /** - * Lists all addresses. - * - * @throws ComputeException upon failure - */ - Tuple> listAddresses(Map options); - - /** - * Deletes the requested region address. - * - * @return a region operation if the request was issued correctly, {@code null} if the address was - * not found - * @throws ComputeException upon failure or if region is not found - */ - Operation deleteRegionAddress(String region, String address, Map options); - - /** - * Creates a snapshot for the specified disk. - * - * @return a zone operation for snapshot creation - * @throws ComputeException upon failure - */ - Operation createSnapshot(String zone, String disk, String snapshot, String description, - Map options); - - /** - * Returns the requested snapshot or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Snapshot getSnapshot(String snapshot, Map options); - - /** - * Lists snapshots. - * - * @throws ComputeException upon failure - */ - Tuple> listSnapshots(Map options); - - /** - * Deletes the requested snapshot. Keep in mind that deleting a single snapshot might not - * necessarily delete all the data for that snapshot. If any data for the snapshot that is marked - * for deletion is needed for subsequent snapshots, the data will be moved to the next snapshot. - * - * @return a global operation if the request was issued correctly, {@code null} if the snapshot - * was not found - * @throws ComputeException upon failure - */ - Operation deleteSnapshot(String snapshot, Map options); - - /** - * Creates a new image. - * - * @return a global operation for image's creation - * @throws ComputeException upon failure - */ - Operation createImage(Image image, Map options); - - /** - * Returns the requested image or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Image getImage(String project, String image, Map options); - - /** - * Lists images in the provided project that are available to the current user. - * - * @throws ComputeException upon failure - */ - Tuple> listImages(String project, Map options); - - /** - * Deletes the requested image. - * - * @return a global operation if the delete request was issued correctly, {@code null} if the - * image was not found - * @throws ComputeException upon failure - */ - Operation deleteImage(String project, String image, Map options); - - /** - * Deprecates the requested image. - * - * @return a global operation if the deprecation request was issued correctly, {@code null} if the - * image was not found - * @throws ComputeException upon failure - */ - Operation deprecateImage(String project, String image, DeprecationStatus deprecationStatus, - Map options); - - /** - * Returns the requested disk or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Disk getDisk(String zone, String disk, Map options); - - /** - * Creates a new disk. - * - * @return a zone operation for disk's creation - * @throws ComputeException upon failure - */ - Operation createDisk(String zone, Disk disk, Map options); - - /** - * Lists the disks for the provided zone. - * - * @throws ComputeException upon failure - */ - Tuple> listDisks(String zone, Map options); - - /** - * Lists disks for all zones. - * - * @throws ComputeException upon failure - */ - Tuple> listDisks(Map options); - - /** - * Deletes the requested disk. - * - * @return a zone operation if the request was issued correctly, {@code null} if the disk was not - * found - * @throws ComputeException upon failure - */ - Operation deleteDisk(String zone, String disk, Map options); - - /** - * Resizes the disk to the requested size. The new size must be larger than the previous one. - * - * @return a zone operation if the request was issued correctly, {@code null} if the disk was not - * found - * @throws ComputeException upon failure or if the new disk size is smaller than the previous one - */ - Operation resizeDisk(String zone, String disk, long sizeGb, Map options); - - /* - * Creates a new subnetwork. - * - * @return a region operation for subnetwork's creation - * @throws ComputeException upon failure - */ - Operation createSubnetwork(String region, Subnetwork subnetwork, Map options); - - /** - * Returns the requested subnetwork or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Subnetwork getSubnetwork(String region, String subnetwork, Map options); - - /** - * Lists subnetworks for the provided region. - * - * @throws ComputeException upon failure - */ - Tuple> listSubnetworks(String region, Map options); - - /** - * Lists subnetworks. - * - * @throws ComputeException upon failure - */ - Tuple> listSubnetworks(Map options); - - /** - * Deletes the requested subnetwork. Any attempt to delete an automatically created subnetwork - * will fail. - * - * @return a region operation if the delete request was issued correctly, {@code null} if the - * subnetwork was not found - * @throws ComputeException upon failure - */ - Operation deleteSubnetwork(String region, String subnetwork, Map options); - - /** - * Creates a new network. - * - * @return a global operation for network's creation - * @throws ComputeException upon failure - */ - Operation createNetwork(Network network, Map options); - - /** - * Returns the requested network or {@code null} if not found. - * - * @throws ComputeException upon failure - */ - Network getNetwork(String network, Map options); - - /** - * Lists networks. - * - * @throws ComputeException upon failure - */ - Tuple> listNetworks(Map options); - - /** - * Deletes the requested network. - * - * @return a global operation if the delete request was issued correctly, {@code null} if the - * network was not found - * @throws ComputeException upon failure - */ - Operation deleteNetwork(String network, Map options); - - /** - * Creates a new instance. - * - * @return a zone operation for instance's creation - * @throws ComputeException upon failure or if the zone does not exist - */ - Operation createInstance(String zone, Instance instance, Map options); - - /** - * Returns the requested instance or {@code null} if not found. - * - * @throws ComputeException upon failure or if the zone does not exist - */ - Instance getInstance(String zone, String instance, Map options); - - /** - * Lists instances for the provided zone. - * - * @throws ComputeException upon failure or if the zone does not exist - */ - Tuple> listInstances(String zone, Map options); - - /** - * Lists instances. - * - * @throws ComputeException upon failure - */ - Tuple> listInstances(Map options); - - /** - * Deletes the requested instance. - * - * @return a zone operation if the delete request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure or if the zone does not exist - */ - Operation deleteInstance(String zone, String instance, Map options); - - /** - * Adds an access configuration to an instance's network interface. - * - * @return a zone operation if the add request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation addAccessConfig(String zone, String instance, String networkInterface, - AccessConfig accessConfig, Map options); - - /** - * Attaches a disk to an instance. - * - * @return a zone operation if the attach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation attachDisk(String zone, String instance, AttachedDisk attachedDisk, - Map options); - - /** - * Deletes an access configuration from an instance's network interface. - * - * @return a zone operation if the delete request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation deleteAccessConfig(String zone, String instance, String networkInterface, - String accessConfig, Map options); - - /** - * Detaches a disk from an instance. - * - * @return a zone operation if the detach request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation detachDisk(String zone, String instance, String deviceName, Map options); - - /** - * Returns the serial port output for the provided instance and port number. {@code port} must be - * between 1 and 4 (inclusive). If {@code port} is {@code null} output for the default port (1) is - * returned. - * - * @return the serial port output or {@code null} if the instance was not found - * @throws ComputeException upon failure - */ - String getSerialPortOutput(String zone, String instance, Integer port, Map options); - - /** - * Resets the provided instance. - * - * @return a zone operation if the reset request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation reset(String zone, String instance, Map options); - - /** - * Sets the auto-delete flag for a disk attached to the provided instance. - * - * @return a zone operation if the flag setting request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation setDiskAutoDelete(String zone, String instance, String deviceName, boolean autoDelete, - Map options); - - /** - * Sets the machine type for the provided instance. Instance must be in {@code TERMINATED} state - * to be able to set its machine type. - * - * @param zone name of the zone in which the instance resides - * @param instance name of the instance - * @param machineTypeUrl full or partial URL of the machine type resource. For example - * {@code zones/us-central1-f/machineTypes/n1-standard-1}. - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setMachineType(String zone, String instance, String machineTypeUrl, - Map options); - - /** - * Sets the metadata for the provided instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setMetadata(String zone, String instance, Metadata metadata, Map options); - - /** - * Sets the scheduling options for the provided instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setScheduling(String zone, String instance, Scheduling scheduling, - Map options); - - /** - * Sets the tags for the provided instance. - * - * @return a zone operation if the set request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation setTags(String zone, String instance, Tags tags, Map options); - - /** - * Starts the provided instance. - * - * @return a zone operation if the start request was issued correctly, {@code null} if the - * instance was not found - * @throws ComputeException upon failure - */ - Operation start(String zone, String instance, Map options); - - /** - * Stops the provided instance. - * - * @return a zone operation if the stop request was issued correctly, {@code null} if the instance - * was not found - * @throws ComputeException upon failure - */ - Operation stop(String zone, String instance, Map options); -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java deleted file mode 100644 index 4e9ad9b09b47..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java +++ /dev/null @@ -1,1159 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.spi.v1; - -import static java.net.HttpURLConnection.HTTP_NOT_FOUND; - -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.jackson.JacksonFactory; -import com.google.api.services.compute.Compute; -import com.google.api.services.compute.model.AccessConfig; -import com.google.api.services.compute.model.Address; -import com.google.api.services.compute.model.AddressAggregatedList; -import com.google.api.services.compute.model.AddressList; -import com.google.api.services.compute.model.AddressesScopedList; -import com.google.api.services.compute.model.AttachedDisk; -import com.google.api.services.compute.model.DeprecationStatus; -import com.google.api.services.compute.model.Disk; -import com.google.api.services.compute.model.DiskAggregatedList; -import com.google.api.services.compute.model.DiskList; -import com.google.api.services.compute.model.DiskType; -import com.google.api.services.compute.model.DiskTypeAggregatedList; -import com.google.api.services.compute.model.DiskTypeList; -import com.google.api.services.compute.model.DiskTypesScopedList; -import com.google.api.services.compute.model.DisksResizeRequest; -import com.google.api.services.compute.model.DisksScopedList; -import com.google.api.services.compute.model.Image; -import com.google.api.services.compute.model.ImageList; -import com.google.api.services.compute.model.Instance; -import com.google.api.services.compute.model.InstanceAggregatedList; -import com.google.api.services.compute.model.InstanceList; -import com.google.api.services.compute.model.InstancesScopedList; -import com.google.api.services.compute.model.InstancesSetMachineTypeRequest; -import com.google.api.services.compute.model.License; -import com.google.api.services.compute.model.MachineType; -import com.google.api.services.compute.model.MachineTypeAggregatedList; -import com.google.api.services.compute.model.MachineTypeList; -import com.google.api.services.compute.model.MachineTypesScopedList; -import com.google.api.services.compute.model.Metadata; -import com.google.api.services.compute.model.Network; -import com.google.api.services.compute.model.NetworkList; -import com.google.api.services.compute.model.Operation; -import com.google.api.services.compute.model.OperationList; -import com.google.api.services.compute.model.Region; -import com.google.api.services.compute.model.RegionList; -import com.google.api.services.compute.model.Scheduling; -import com.google.api.services.compute.model.SerialPortOutput; -import com.google.api.services.compute.model.Snapshot; -import com.google.api.services.compute.model.SnapshotList; -import com.google.api.services.compute.model.Subnetwork; -import com.google.api.services.compute.model.SubnetworkAggregatedList; -import com.google.api.services.compute.model.SubnetworkList; -import com.google.api.services.compute.model.SubnetworksScopedList; -import com.google.api.services.compute.model.Tags; -import com.google.api.services.compute.model.Zone; -import com.google.api.services.compute.model.ZoneList; -import com.google.cloud.Tuple; -import com.google.cloud.compute.deprecated.ComputeException; -import com.google.cloud.compute.deprecated.ComputeOptions; -import com.google.cloud.http.HttpTransportOptions; -import com.google.common.collect.ImmutableList; -import java.io.IOException; -import java.util.Map; - -public class HttpComputeRpc implements ComputeRpc { - - private final ComputeOptions options; - private final Compute compute; - - public HttpComputeRpc(ComputeOptions options) { - HttpTransportOptions transportOptions = (HttpTransportOptions) options.getTransportOptions(); - HttpTransport transport = transportOptions.getHttpTransportFactory().create(); - HttpRequestInitializer initializer = transportOptions.getHttpRequestInitializer(options); - this.options = options; - compute = new Compute.Builder(transport, new JacksonFactory(), initializer) - .setRootUrl(options.getHost()) - .setApplicationName(options.getApplicationName()) - .build(); - } - - private static ComputeException translate(IOException exception) { - return new ComputeException(exception); - } - - @Override - public DiskType getDiskType(String zone, String diskType, Map options) { - try { - return compute.diskTypes() - .get(this.options.getProjectId(), zone, diskType) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listDiskTypes(String zone, Map options) { - try { - DiskTypeList diskTypesList = compute.diskTypes() - .list(this.options.getProjectId(), zone) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable diskTypes = diskTypesList.getItems(); - return Tuple.of(diskTypesList.getNextPageToken(), diskTypes); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listDiskTypes(Map options) { - try { - DiskTypeAggregatedList aggregatedList = compute.diskTypes() - .aggregatedList(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - // todo(mziccard): uncomment or remove once #711 is closed - // .setFields(FIELDS.getString(options)) - .execute(); - ImmutableList.Builder builder = ImmutableList.builder(); - Map scopedList = aggregatedList.getItems(); - if (scopedList != null) { - for (DiskTypesScopedList diskTypesScopedList : scopedList.values()) { - if (diskTypesScopedList.getDiskTypes() != null) { - builder.addAll(diskTypesScopedList.getDiskTypes()); - } - } - } - return Tuple.>of(aggregatedList.getNextPageToken(), - builder.build()); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public MachineType getMachineType(String zone, String machineType, Map options) { - try { - return compute.machineTypes() - .get(this.options.getProjectId(), zone, machineType) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listMachineTypes(String zone, - Map options) { - try { - MachineTypeList machineTypesList = compute.machineTypes() - .list(this.options.getProjectId(), zone) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable machineTypes = machineTypesList.getItems(); - return Tuple.of(machineTypesList.getNextPageToken(), machineTypes); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listMachineTypes(Map options) { - try { - MachineTypeAggregatedList aggregatedList = compute.machineTypes() - .aggregatedList(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - // todo(mziccard): uncomment or remove once #711 is closed - // .setFields(FIELDS.getString(options)) - .execute(); - ImmutableList.Builder builder = ImmutableList.builder(); - Map scopedList = aggregatedList.getItems(); - if (scopedList != null) { - for (MachineTypesScopedList machineTypesScopedList : scopedList.values()) { - if (machineTypesScopedList.getMachineTypes() != null) { - builder.addAll(machineTypesScopedList.getMachineTypes()); - } - } - } - return Tuple.>of(aggregatedList.getNextPageToken(), - builder.build()); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Region getRegion(String region, Map options) { - try { - return compute.regions() - .get(this.options.getProjectId(), region) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listRegions(Map options) { - try { - RegionList regionsList = compute.regions() - .list(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable regions = regionsList.getItems(); - return Tuple.of(regionsList.getNextPageToken(), regions); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Zone getZone(String zone, Map options) { - try { - return compute.zones() - .get(this.options.getProjectId(), zone) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listZones(Map options) { - try { - ZoneList zonesList = compute.zones() - .list(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable zones = zonesList.getItems(); - return Tuple.of(zonesList.getNextPageToken(), zones); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public License getLicense(String project, String license, Map options) { - try { - return compute.licenses() - .get(project, license) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation getGlobalOperation(String operation, Map options) { - try { - return compute.globalOperations() - .get(this.options.getProjectId(), operation) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listGlobalOperations(Map options) { - try { - OperationList operationsList = compute.globalOperations() - .list(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable operations = operationsList.getItems(); - return Tuple.of(operationsList.getNextPageToken(), operations); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public boolean deleteGlobalOperation(String operation) { - try { - compute.globalOperations().delete(this.options.getProjectId(), operation).execute(); - return true; - } catch (IOException ex) { - return falseForNotFound(ex); - } - } - - @Override - public Operation getRegionOperation(String region, String operation, Map options) { - try { - return compute.regionOperations() - .get(this.options.getProjectId(), region, operation) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listRegionOperations(String region, - Map options) { - try { - OperationList operationsList = compute.regionOperations() - .list(this.options.getProjectId(), region) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable operations = operationsList.getItems(); - return Tuple.of(operationsList.getNextPageToken(), operations); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public boolean deleteRegionOperation(String region, String operation) { - try { - compute.regionOperations().delete(this.options.getProjectId(), region, operation).execute(); - return true; - } catch (IOException ex) { - return falseForNotFound(ex); - } - } - - @Override - public Operation getZoneOperation(String zone, String operation, Map options) { - try { - return compute.zoneOperations() - .get(this.options.getProjectId(), zone, operation) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listZoneOperations(String zone, - Map options) { - try { - OperationList operationsList = compute.zoneOperations() - .list(this.options.getProjectId(), zone) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable operations = operationsList.getItems(); - return Tuple.of(operationsList.getNextPageToken(), operations); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public boolean deleteZoneOperation(String zone, String operation) { - try { - compute.zoneOperations().delete(this.options.getProjectId(), zone, operation).execute(); - return true; - } catch (IOException ex) { - return falseForNotFound(ex); - } - } - - @Override - public Address getGlobalAddress(String address, Map options) { - try { - return compute.globalAddresses() - .get(this.options.getProjectId(), address) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createGlobalAddress(Address address, Map options) { - try { - return compute.globalAddresses() - .insert(this.options.getProjectId(), address) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listGlobalAddresses(Map options) { - try { - AddressList addressList = compute.globalAddresses() - .list(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable
operations = addressList.getItems(); - return Tuple.of(addressList.getNextPageToken(), operations); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteGlobalAddress(String address, Map options) { - try { - return compute.globalAddresses() - .delete(this.options.getProjectId(), address) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Address getRegionAddress(String region, String address, Map options) { - try { - return compute.addresses() - .get(this.options.getProjectId(), region, address) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createRegionAddress(String region, Address address, Map options) { - try { - return compute.addresses() - .insert(this.options.getProjectId(), region, address) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listRegionAddresses(String region, - Map options) { - try { - AddressList addressList = compute.addresses() - .list(this.options.getProjectId(), region) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable
operations = addressList.getItems(); - return Tuple.of(addressList.getNextPageToken(), operations); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listAddresses(Map options) { - try { - AddressAggregatedList aggregatedList = compute.addresses() - .aggregatedList(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - // todo(mziccard): uncomment or remove once #711 is closed - // .setFields(FIELDS.getString(options)) - .execute(); - ImmutableList.Builder
builder = ImmutableList.builder(); - Map scopedList = aggregatedList.getItems(); - if (scopedList != null) { - for (AddressesScopedList addressesScopedList : scopedList.values()) { - if (addressesScopedList.getAddresses() != null) { - builder.addAll(addressesScopedList.getAddresses()); - } - } - } - return Tuple.>of(aggregatedList.getNextPageToken(), - builder.build()); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteRegionAddress(String region, String address, Map options) { - try { - return compute.addresses() - .delete(this.options.getProjectId(), region, address) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createSnapshot(String zone, String disk, String snapshot, String description, - Map options) { - Snapshot snapshotObject = new Snapshot().setName(snapshot).setDescription(description); - try { - return compute.disks() - .createSnapshot(this.options.getProjectId(), zone, disk, snapshotObject) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Snapshot getSnapshot(String snapshot, Map options) { - try { - return compute.snapshots() - .get(this.options.getProjectId(), snapshot) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listSnapshots(Map options) { - try { - SnapshotList snapshotList = compute.snapshots() - .list(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable snapshots = snapshotList.getItems(); - return Tuple.of(snapshotList.getNextPageToken(), snapshots); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteSnapshot(String snapshot, Map options) { - try { - return compute.snapshots() - .delete(this.options.getProjectId(), snapshot) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createImage(Image image, Map options) { - try { - return compute.images() - .insert(this.options.getProjectId(), image) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Image getImage(String project, String image, Map options) { - try { - return compute.images() - .get(project, image) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listImages(String project, Map options) { - try { - ImageList imageList = compute.images() - .list(project) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable images = imageList.getItems(); - return Tuple.of(imageList.getNextPageToken(), images); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteImage(String project, String image, Map options) { - try { - return compute.images() - .delete(project, image) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation deprecateImage(String project, String image, DeprecationStatus deprecationStatus, - Map options) { - try { - return compute.images() - .deprecate(project, image, deprecationStatus) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Disk getDisk(String zone, String disk, Map options) { - try { - return compute.disks() - .get(this.options.getProjectId(), zone, disk) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createDisk(String zone, Disk disk, Map options) { - try { - return compute.disks() - .insert(this.options.getProjectId(), zone, disk) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listDisks(String zone, Map options) { - try { - DiskList diskList = compute.disks() - .list(this.options.getProjectId(), zone) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable disks = diskList.getItems(); - return Tuple.of(diskList.getNextPageToken(), disks); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listDisks(Map options) { - try { - DiskAggregatedList aggregatedList = compute.disks() - .aggregatedList(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - // todo(mziccard): uncomment or remove once #711 is closed - // .setFields(FIELDS.getString(options)) - .execute(); - ImmutableList.Builder builder = ImmutableList.builder(); - Map scopedList = aggregatedList.getItems(); - if (scopedList != null) { - for (DisksScopedList disksScopedList : scopedList.values()) { - if (disksScopedList.getDisks() != null) { - builder.addAll(disksScopedList.getDisks()); - } - } - } - return Tuple.>of(aggregatedList.getNextPageToken(), - builder.build()); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteDisk(String zone, String disk, Map options) { - try { - return compute.disks() - .delete(this.options.getProjectId(), zone, disk) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation resizeDisk(String zone, String disk, long sizeGb, Map options) { - try { - DisksResizeRequest resizeRequest = new DisksResizeRequest().setSizeGb(sizeGb); - return compute.disks().resize(this.options.getProjectId(), zone, disk, resizeRequest) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - public Operation createSubnetwork(String region, Subnetwork subnetwork, Map options) { - try { - return compute.subnetworks() - .insert(this.options.getProjectId(), region, subnetwork) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Subnetwork getSubnetwork(String region, String subnetwork, Map options) { - try { - return compute.subnetworks() - .get(this.options.getProjectId(), region, subnetwork) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listSubnetworks(String region, - Map options) { - try { - SubnetworkList subnetworkList = compute.subnetworks() - .list(this.options.getProjectId(), region) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable subnetworks = subnetworkList.getItems(); - return Tuple.of(subnetworkList.getNextPageToken(), subnetworks); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listSubnetworks(Map options) { - try { - SubnetworkAggregatedList aggregatedList = compute.subnetworks() - .aggregatedList(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - // todo(mziccard): uncomment or remove once #711 is closed - // .setFields(FIELDS.getString(options)) - .execute(); - ImmutableList.Builder builder = ImmutableList.builder(); - Map scopedList = aggregatedList.getItems(); - if (scopedList != null) { - for (SubnetworksScopedList subnetworksScopedList : scopedList.values()) { - if (subnetworksScopedList.getSubnetworks() != null) { - builder.addAll(subnetworksScopedList.getSubnetworks()); - } - } - } - return Tuple.>of(aggregatedList.getNextPageToken(), - builder.build()); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteSubnetwork(String region, String subnetwork, Map options) { - try { - return compute.subnetworks() - .delete(this.options.getProjectId(), region, subnetwork) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createNetwork(Network network, Map options) { - try { - return compute.networks() - .insert(this.options.getProjectId(), network) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Network getNetwork(String network, Map options) { - try { - return compute.networks() - .get(this.options.getProjectId(), network) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listNetworks(Map options) { - try { - NetworkList networkList = compute.networks() - .list(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable networks = networkList.getItems(); - return Tuple.of(networkList.getNextPageToken(), networks); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteNetwork(String network, Map options) { - try { - return compute.networks() - .delete(this.options.getProjectId(), network) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation createInstance(String zone, Instance instance, Map options) { - try { - return compute.instances() - .insert(this.options.getProjectId(), zone, instance) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Instance getInstance(String zone, String instance, Map options) { - try { - return compute.instances() - .get(this.options.getProjectId(), zone, instance) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Tuple> listInstances(String zone, Map options) { - try { - InstanceList instanceList = compute.instances() - .list(this.options.getProjectId(), zone) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setFields(Option.FIELDS.getString(options)) - .execute(); - Iterable instances = instanceList.getItems(); - return Tuple.of(instanceList.getNextPageToken(), instances); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Tuple> listInstances(Map options) { - try { - InstanceAggregatedList aggregatedList = compute.instances() - .aggregatedList(this.options.getProjectId()) - .setFilter(Option.FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - // todo(mziccard): uncomment or remove once #711 is closed - // .setFields(FIELDS.getString(options)) - .execute(); - ImmutableList.Builder builder = ImmutableList.builder(); - Map scopedList = aggregatedList.getItems(); - if (scopedList != null) { - for (InstancesScopedList instancesScopedList : scopedList.values()) { - if (instancesScopedList.getInstances() != null) { - builder.addAll(instancesScopedList.getInstances()); - } - } - } - return Tuple.>of(aggregatedList.getNextPageToken(), - builder.build()); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteInstance(String zone, String instance, Map options) { - try { - return compute.instances() - .delete(this.options.getProjectId(), zone, instance) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation addAccessConfig(String zone, String instance, String networkInterface, - AccessConfig accessConfig, Map options) { - try { - return compute.instances() - .addAccessConfig( - this.options.getProjectId(), zone, instance, networkInterface, accessConfig) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation attachDisk(String zone, String instance, AttachedDisk attachedDisk, - Map options) { - try { - return compute.instances() - .attachDisk(this.options.getProjectId(), zone, instance, attachedDisk) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - throw translate(ex); - } - } - - @Override - public Operation deleteAccessConfig(String zone, String instance, String networkInterface, - String accessConfig, Map options) { - try { - return compute.instances() - .deleteAccessConfig(this.options.getProjectId(), zone, instance, accessConfig, - networkInterface) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation detachDisk(String zone, String instance, String deviceName, - Map options) { - try { - return compute.instances() - .detachDisk(this.options.getProjectId(), zone, instance, deviceName) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public String getSerialPortOutput(String zone, String instance, Integer port, - Map options) { - try { - SerialPortOutput portOutput = compute.instances() - .getSerialPortOutput(this.options.getProjectId(), zone, instance) - .setPort(port) - .setFields(Option.FIELDS.getString(options)) - .execute(); - return portOutput != null ? portOutput.getContents() : null; - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation reset(String zone, String instance, Map options) { - try { - return compute.instances() - .reset(this.options.getProjectId(), zone, instance) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation setDiskAutoDelete(String zone, String instance, String deviceName, - boolean autoDelete, Map options) { - try { - return compute.instances() - .setDiskAutoDelete(this.options.getProjectId(), zone, instance, autoDelete, deviceName) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation setMachineType(String zone, String instance, String machineTypeUrl, - Map options) { - try { - InstancesSetMachineTypeRequest request = - new InstancesSetMachineTypeRequest().setMachineType(machineTypeUrl); - return compute.instances() - .setMachineType(this.options.getProjectId(), zone, instance, request) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation setMetadata(String zone, String instance, Metadata metadata, - Map options) { - try { - return compute.instances() - .setMetadata(this.options.getProjectId(), zone, instance, metadata) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation setScheduling(String zone, String instance, Scheduling scheduling, - Map options) { - try { - return compute.instances() - .setScheduling(this.options.getProjectId(), zone, instance, scheduling) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation setTags(String zone, String instance, Tags tags, Map options) { - try { - return compute.instances() - .setTags(this.options.getProjectId(), zone, instance, tags) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation start(String zone, String instance, Map options) { - try { - return compute.instances() - .start(this.options.getProjectId(), zone, instance) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - @Override - public Operation stop(String zone, String instance, Map options) { - try { - return compute.instances() - .stop(this.options.getProjectId(), zone, instance) - .setFields(Option.FIELDS.getString(options)) - .execute(); - } catch (IOException ex) { - return nullForNotFound(ex); - } - } - - /** - * This method returns {@code null} if the error code of {@code exception} was 404, re-throws the - * exception otherwise. - * - * @throws ComputeException if the error code of {@code exception} was not 404 - */ - private static T nullForNotFound(IOException exception) { - ComputeException serviceException = translate(exception); - if (serviceException.getCode() == HTTP_NOT_FOUND) { - return null; - } - throw serviceException; - } - - /** - * This method returns {@code false} if the error code of {@code exception} was 404, re-throws the - * exception otherwise. - * - * @throws ComputeException if the error code of {@code exception} was not 404 - */ - private static boolean falseForNotFound(IOException exception) { - ComputeException serviceException = translate(exception); - if (serviceException.getCode() == HTTP_NOT_FOUND) { - return false; - } - throw serviceException; - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java deleted file mode 100644 index 2e813b33c142..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.testing; - -import com.google.auth.oauth2.ServiceAccountCredentials; -import com.google.cloud.http.HttpTransportOptions; -import com.google.api.gax.retrying.RetrySettings; -import com.google.cloud.compute.deprecated.ComputeOptions; - -import java.io.IOException; -import java.io.InputStream; -import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.threeten.bp.Duration; - -/** - * Utility to create a remote Compute configuration for testing. Compute options can be obtained - * via the {@link #getOptions()} method. Returned options have custom - * {@link ComputeOptions#getRetrySettings()}: {@link RetrySettings#getMaxAttempts()} is {@code 10}, - * {@link RetrySettings#getMaxAttempts()} ()} is {@code 6}, - * {@link RetrySettings#getMaxRetryDelay()} is {@code 30000}, - * {@link RetrySettings#getTotalTimeout()} is {@code 120000} and - * {@link RetrySettings#getInitialRetryDelay()} is {@code 250}. - * {@link HttpTransportOptions#getConnectTimeout()} and - * {@link HttpTransportOptions#getReadTimeout()} are both - * set to {@code 60000}. - */ -public class RemoteComputeHelper { - - private static final Logger log = Logger.getLogger(RemoteComputeHelper.class.getName()); - private final ComputeOptions options; - - private RemoteComputeHelper(ComputeOptions options) { - this.options = options; - } - - /** - * Returns a {@link ComputeOptions} object to be used for testing. - */ - public ComputeOptions getOptions() { - return options; - } - - /** - * Returns a base name for testing resources generated using a random UUID. This base name can be - * prepended to resource names to prevent name clashes. This method always returns a 30 characters - * long prefix. Since Compute Engine resource names can be at most 63 characters long your suffix - * should be no longer than 33 characters. - */ - public static String baseResourceName() { - return "test-" + UUID.randomUUID().toString().replace("-", "").substring(0, 24) + "-"; - } - - /** - * Creates a {@code RemoteComputeHelper} object for the given project id and JSON key input - * stream. - * - * @param projectId id of the project to be used for running the tests - * @param keyStream input stream for a JSON key - * @return A {@code RemoteComputeHelper} object for the provided options - * @throws ComputeHelperException if {@code keyStream} is not a valid JSON key stream - */ - public static RemoteComputeHelper create(String projectId, InputStream keyStream) { - try { - HttpTransportOptions transportOptions = ComputeOptions.getDefaultHttpTransportOptions(); - transportOptions = transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000) - .build(); - ComputeOptions computeOptions = ComputeOptions.newBuilder() - .setCredentials(ServiceAccountCredentials.fromStream(keyStream)) - .setProjectId(projectId) - .setRetrySettings(retrySettings()) - .setTransportOptions(transportOptions) - .build(); - return new RemoteComputeHelper(computeOptions); - } catch (IOException ex) { - if (log.isLoggable(Level.WARNING)) { - log.log(Level.WARNING, ex.getMessage()); - } - throw ComputeHelperException.translate(ex); - } - } - - /** - * Creates a {@code RemoteComputeHelper} object using default project id and authentication - * credentials. - */ - public static RemoteComputeHelper create() { - HttpTransportOptions transportOptions = ComputeOptions.getDefaultHttpTransportOptions(); - transportOptions = transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000) - .build(); - ComputeOptions computeOptions = ComputeOptions.newBuilder() - .setRetrySettings(retrySettings()) - .setTransportOptions(transportOptions) - .build(); - return new RemoteComputeHelper(computeOptions); - } - - private static RetrySettings retrySettings() { - return RetrySettings.newBuilder().setMaxAttempts(10) - .setMaxRetryDelay(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(120000L)) - .setInitialRetryDelay(Duration.ofMillis(250L)) - .setRetryDelayMultiplier(1.0) - .setInitialRpcTimeout(Duration.ofMillis(120000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(120000L)) - .build(); - } - - public static class ComputeHelperException extends RuntimeException { - - private static final long serialVersionUID = -5747977015007639912L; - - public ComputeHelperException(String message, Throwable cause) { - super(message, cause); - } - - public static ComputeHelperException translate(Exception ex) { - return new ComputeHelperException(ex.getMessage(), ex); - } - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java deleted file mode 100644 index 64daaade1438..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.testing; - -import com.google.cloud.compute.deprecated.AddressId; -import com.google.cloud.compute.deprecated.Compute; -import com.google.cloud.compute.deprecated.DiskId; -import com.google.cloud.compute.deprecated.ImageId; -import com.google.cloud.compute.deprecated.InstanceId; -import com.google.cloud.compute.deprecated.NetworkId; -import com.google.cloud.compute.deprecated.SnapshotId; -import com.google.cloud.compute.deprecated.SubnetworkId; -import com.google.common.base.Function; -import java.util.HashMap; -import java.util.Map; -import java.util.NoSuchElementException; - -public class ResourceCleaner { - private final Compute compute; - private final Map> resources; - - private ResourceCleaner(Compute compute) { - this.compute = compute; - this.resources = new HashMap<>(); - } - - public static ResourceCleaner create(Compute compute) { - return new ResourceCleaner(compute); - } - - private class ManagedResource { - final T resourceId; - Function deleteFunc; - - private ManagedResource(T resourceId, Function deleteFunc) { - this.resourceId = resourceId; - this.deleteFunc = deleteFunc; - } - - public void delete() { - deleteFunc.apply(resourceId); - } - } - - public void cleanUp() { - for (Map.Entry> r : resources.entrySet()) { - r.getValue().delete(); - } - resources.clear(); - } - - public void add(AddressId addressId) { - ManagedResource r = - new ManagedResource<>( - addressId, - new Function() { - @Override - public Void apply(AddressId addressId) { - compute.deleteAddress(addressId); - return null; - } - }); - resources.put(addressId, r); - } - - public void add(DiskId diskId) { - ManagedResource r = - new ManagedResource<>( - diskId, - new Function() { - @Override - public Void apply(DiskId diskId) { - compute.deleteDisk(diskId); - return null; - } - }); - resources.put(diskId, r); - } - - public void add(SnapshotId snapshotId) { - ManagedResource r = - new ManagedResource<>( - snapshotId, - new Function() { - @Override - public Void apply(SnapshotId snapshotId) { - compute.deleteSnapshot(snapshotId); - return null; - } - }); - resources.put(snapshotId, r); - } - - public void add(NetworkId networkId) { - ManagedResource r = - new ManagedResource<>( - networkId, - new Function() { - @Override - public Void apply(NetworkId networkId) { - compute.deleteNetwork(networkId); - return null; - } - }); - resources.put(networkId, r); - } - - public void add(SubnetworkId subnetworkId) { - ManagedResource r = - new ManagedResource<>( - subnetworkId, - new Function() { - @Override - public Void apply(SubnetworkId subnetworkId) { - compute.deleteSubnetwork(subnetworkId); - return null; - } - }); - resources.put(subnetworkId, r); - } - - public void add(ImageId imageId) { - ManagedResource r = - new ManagedResource<>( - imageId, - new Function() { - @Override - public Void apply(ImageId imageId) { - compute.deleteImage(imageId); - return null; - } - }); - resources.put(imageId, r); - } - - public void add(InstanceId instanceId) { - ManagedResource r = - new ManagedResource<>( - instanceId, - new Function() { - @Override - public Void apply(InstanceId instanceId) { - compute.deleteInstance(instanceId); - return null; - } - }); - resources.put(instanceId, r); - } - - public ResourceCleaner remove(Object resourceId) { - if (!resources.containsKey(resourceId)) { - throw new NoSuchElementException(resourceId + " has not been added to managed resources"); - } - resources.remove(resourceId); - return this; - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java deleted file mode 100644 index d983ba74b17e..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * A testing helper for Google Compute Engine. - * - *

A simple usage example: - * - *

Before the test: - *

 {@code
- * RemoteComputeHelper computeHelper = RemoteComputeHelper.create();
- * Compute compute = computeHelper.getOptions().getService();
- * } 
- * - * @see - * Google Cloud Java tools for testing - */ -package com.google.cloud.compute.deprecated.testing; diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AbandonInstancesRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorConfig.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorType.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypeSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AcceleratorTypesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddAccessConfigInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddHealthCheckTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstanceTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddInstancesInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddPeeringNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAcceleratorTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAddressesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListAutoscalersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListBackendServicesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDiskTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListDisksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListForwardingRulesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListGlobalOperationsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupManagersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstanceGroupsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInstancesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListInterconnectAttachmentsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListMachineTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRegionCommitmentsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListRoutersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListSubnetworksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetInstancesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetPoolsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListTargetVpnGatewaysHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListVpnTunnelsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AliasIpRange.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDisk.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachedDiskInitializeParams.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Autoscaler.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerStatusDetails.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalersScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCpuUtilization.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyCustomMetricUtilization.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalingPolicyLoadBalancingUtilization.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Backend.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucket.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendService.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceCdnPolicy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceGroupHealth.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceIAP.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServicesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheInvalidationRule.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CacheKeyPolicy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Commitment.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CommitmentsScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ConnectionDraining.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CreateSnapshotRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKey.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/CustomerEncryptionKeyProtectedDisk.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Data.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAccessConfigInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAddressHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendBucketHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteFirewallHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalAddressHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteGlobalOperationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteHttpsHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteImageHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstanceTemplateHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInstancesRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectAttachmentHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteInterconnectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteLicenseHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRegionOperationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouteHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSnapshotHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslCertificateHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSslPolicyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSubnetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetHttpsProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetTcpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteTargetVpnGatewayHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteVpnTunnelHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteZoneOperationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecateImageHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeprecationStatus.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DetachDiskInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnHostProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisableXpnResourceProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Disk.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskMoveRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskType.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypeSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskTypesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksResizeRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DisksScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnHostProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/EnableXpnResourceProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Error.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Errors.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ExpandIpCidrRangeSubnetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Firewall.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRuleSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRulesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAcceleratorTypeHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAddressHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendBucketHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiskTypeHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFirewallHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetFromFamilyImageHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalAddressHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetGlobalOperationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthRegionBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHealthTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetHttpsHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetImageHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInstanceTemplateHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectAttachmentHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetInterconnectLocationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseCodeHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetLicenseHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetMachineTypeHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionCommitmentHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionDiskTypeHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRegionOperationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouteHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetRouterStatusRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSerialPortOutputInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSnapshotHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslCertificateHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSslPolicyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetSubnetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetHttpsProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetTcpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetTargetVpnGatewayHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetVpnTunnelHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnHostProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetXpnResourcesProjectsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetZoneOperationHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalForwardingRuleSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalOperationSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalSetLabelsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GuestOsFeature.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckReference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthStatus.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HostRule.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheck2.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpHealthCheckSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpSHealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheck2.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Image.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAddressHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendBucketHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertFirewallHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalAddressHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertGlobalForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertHttpsHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertImageHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInstanceTemplateHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectAttachmentHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertInterconnectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertLicenseHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionCommitmentHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouteHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslCertificateHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSslPolicyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertSubnetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetHttpsProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetVpnGatewayHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertVpnTunnelHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroup.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerActionsSummary.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersAbandonInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersDeleteInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersListManagedInstancesResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersRecreateInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetInstanceTemplateRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagersSetTargetPoolsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsAddInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstances.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsListInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsRemoveInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupsSetNamedPortsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceListReferrers.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceMoveRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceProperties.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceReference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplate.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceWithNamedPorts.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetLabelsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineResourcesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMachineTypeRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetMinCpuPlatformRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesSetServiceAccountRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstancesStartWithEncryptionKeyRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Interconnect.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachment.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentPrivateInfo.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentsScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectCircuitInfo.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocation.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationRegionInfo.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectLocationSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectOutageNotification.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InvalidateCacheUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Items.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/License.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCode.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeLicenseAlias.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseCodeSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseResourceRequirements.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicensesListResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAcceleratorTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAddressesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAutoscalersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListAvailableFeaturesSslPoliciesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendBucketsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListBackendServicesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDiskTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListDisksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListFirewallsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListForwardingRulesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalAddressesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalForwardingRulesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListGlobalOperationsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHealthChecksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpHealthChecksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListHttpsHealthChecksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListImagesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupManagersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceGroupsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstanceTemplatesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesInstanceGroupsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInstancesRegionInstanceGroupsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectAttachmentsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectLocationsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListInterconnectsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListLicensesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListMachineTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesInstanceGroupManagersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListManagedInstancesRegionInstanceGroupManagersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNetworksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListReferrersInstancesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionAutoscalersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionBackendServicesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionCommitmentsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDiskTypesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionDisksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupManagersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionInstanceGroupsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionOperationsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRegionsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutersHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListRoutesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSnapshotsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslCertificatesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSslPoliciesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListSubnetworksHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpProxiesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetHttpsProxiesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetInstancesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetPoolsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetSslProxiesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetTcpProxiesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListTargetVpnGatewaysHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUrlMapsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListVpnTunnelsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListXpnHostsProjectsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZoneOperationsHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListZonesHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineType.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypeSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MachineTypesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstance.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ManagedInstanceLastAttempt.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Metadata.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveDiskProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/MoveInstanceProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NamedPort.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkInterface.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkRoutingConfig.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksRemovePeeringRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Operation.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/OperationsScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendBucketHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchFirewallHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchHttpsHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSslPolicyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchSubnetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathMatcher.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PathRule.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PreviewRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalAddressName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendBucketName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalBackendServiceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalFirewallName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalForwardingRuleName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHealthCheckName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpHealthCheckName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalHttpsHealthCheckName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageFamilyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalImageResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectLocationName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInterconnectName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseCodeResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalLicenseResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalNetworkName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalOperationName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalRouteName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSnapshotResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslCertificateName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalSslPolicyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpProxyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetHttpsProxyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetSslProxyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalTargetTcpProxyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalUrlMapName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAddressName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionAutoscalerName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionBackendServiceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionCommitmentName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionDiskTypeName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionForwardingRuleName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupManagerName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInstanceGroupName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionInterconnectAttachmentName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionOperationName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionRouterName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetPoolName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionTargetVpnGatewayName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionVpnTunnelName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpProxyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectTargetHttpsProxyName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAcceleratorTypeName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneAutoscalerName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneDiskTypeName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupManagerName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceGroupName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneInstanceResourceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneMachineTypeName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneOperationName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneTargetInstanceName.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsDisableXpnResourceRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsEnableXpnResourceRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsGetXpnResources.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsListXpnHostsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Quota.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RawDisk.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RecreateInstancesRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Reference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Region.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionAutoscalerSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionBackendServiceSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionCommitmentSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskTypeSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDisksResizeRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersAbandonInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersDeleteInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersListInstancesResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersRecreateRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTargetPoolsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagersSetTemplateRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstances.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsListInstancesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupsSetNamedPortsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionOperationSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSetLabelsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveHealthCheckTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstanceTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemoveInstancesInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RemovePeeringNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResetInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResizeRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceCommitment.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ResourceGroupReference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Route.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouteSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Router.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAdvertisedIpRange.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgp.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterBgpPeer.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterInterface.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatus.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusBgpPeerStatus.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterStatusResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersPreviewResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RoutersScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SSLHealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ScratchDisks.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SerialPortOutput.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ServiceAccount.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackendServiceTargetTcpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetBackupTargetPoolHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetCommonInstanceMetadataProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDeletionProtectionInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDiskAutoDeleteInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsImageHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetLabelsSnapshotHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineResourcesInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMachineTypeInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMetadataInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetMinCpuPlatformInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNamedPortsRegionInstanceGroupHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetPrivateIpGoogleAccessSubnetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetProxyHeaderTargetTcpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSchedulingInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetServiceAccountInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetHttpsProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslCertificatesTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetHttpsProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetSslPolicyTargetSslProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTagsInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetGlobalForwardingRuleHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetTargetPoolsRegionInstanceGroupManagerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUrlMapTargetHttpsProxyHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetUsageExportBucketProjectHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Snapshot.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificate.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslCertificateSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPoliciesListAvailableFeaturesResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyReference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicySettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StartWithEncryptionKeyInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/StopInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Subnetwork.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSecondaryRange.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksExpandIpCidrRangeRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworksSetPrivateIpGoogleAccessRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SwitchToCustomModeNetworkHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TCPHealthCheck.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Tags.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxyList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpProxySettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxiesSetSslCertificatesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstance.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstancesScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPool.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolInstanceHealth.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddHealthCheckRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsAddInstanceRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveHealthCheckRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsRemoveInstanceRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolsScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetReference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetBackendServiceRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetProxyHeaderRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxiesSetSslCertificatesRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxyList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetSslProxySettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetBackendServiceRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxiesSetProxyHeaderRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxy.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxySettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGateway.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewayList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaySettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetVpnGatewaysScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestFailure.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseCodeHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsLicenseHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsRegionDiskHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestPermissionsResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAccessConfigInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendBucketHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateFirewallHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateHttpsHealthCheckHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateNetworkInterfaceInstanceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionAutoscalerHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRegionBackendServiceHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateRouterHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UpdateUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMap.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapReference.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapTest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapValidationResult.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UrlMapsValidateResponse.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsageExportLocation.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ValidateUrlMapHttpRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnel.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelAggregatedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelsScopedList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warning.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Warnings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnHostList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/XpnResourceId.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Zone.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneList.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationClient.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneOperationSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSetLabelsRequest.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ZoneSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AcceleratorTypeStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AddressStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/AutoscalerStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskTypeStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/FirewallStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ForwardingRuleStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalAddressStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalForwardingRuleStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/GlobalOperationStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HealthCheckStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpHealthCheckStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAcceleratorTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAddressStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonAutoscalerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonFirewallStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonForwardingRuleStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalAddressStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalForwardingRuleStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonGlobalOperationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHealthCheckStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpHealthCheckStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonHttpsHealthCheckStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectLocationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseCodeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonMachineTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNetworkStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionAutoscalerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionBackendServiceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionCommitmentStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionDiskTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionOperationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouteStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslCertificateStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSslPolicyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetInstanceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetPoolStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetSslProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetTcpProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetVpnGatewayStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonUrlMapStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonVpnTunnelStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationCallableFactory.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneOperationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonZoneStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpsHealthCheckStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectLocationStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseCodeStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/MachineTypeStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NetworkStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionAutoscalerStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionBackendServiceStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionCommitmentStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionDiskTypeStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionOperationStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouteStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslCertificateStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SslPolicyStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpProxyStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetInstanceStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetPoolStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetSslProxyStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetTcpProxyStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetVpnGatewayStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/UrlMapStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/VpnTunnelStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneOperationStubSettings.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStub.java diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java similarity index 100% rename from google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java rename to google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ZoneStubSettings.java diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java deleted file mode 100644 index d8839bddd577..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class AddressIdTest { - - private static final String PROJECT = "project"; - private static final String REGION = "region"; - private static final String NAME = "addr"; - private static final String GLOBAL_URL = - "https://www.googleapis.com/compute/v1/projects/project/global/addresses/addr"; - private static final String REGION_URL = - "https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/addr"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - GlobalAddressId addressId = GlobalAddressId.of(PROJECT, NAME); - assertEquals(PROJECT, addressId.getProject()); - assertEquals(NAME, addressId.getAddress()); - assertEquals(GLOBAL_URL, addressId.getSelfLink()); - addressId = GlobalAddressId.of(NAME); - assertNull(addressId.getProject()); - assertEquals(NAME, addressId.getAddress()); - RegionAddressId regionAddressId = RegionAddressId.of(PROJECT, REGION, NAME); - assertEquals(PROJECT, regionAddressId.getProject()); - assertEquals(REGION, regionAddressId.getRegion()); - assertEquals(NAME, regionAddressId.getAddress()); - assertEquals(REGION_URL, regionAddressId.getSelfLink()); - regionAddressId = RegionAddressId.of(RegionId.of(PROJECT, REGION), NAME); - assertEquals(PROJECT, regionAddressId.getProject()); - assertEquals(REGION, regionAddressId.getRegion()); - assertEquals(NAME, regionAddressId.getAddress()); - assertEquals(REGION_URL, regionAddressId.getSelfLink()); - regionAddressId = RegionAddressId.of(REGION, NAME); - assertNull(regionAddressId.getProject()); - assertEquals(REGION, regionAddressId.getRegion()); - assertEquals(NAME, regionAddressId.getAddress()); - } - - @Test - public void testToAndFromUrlGlobal() { - GlobalAddressId addressId = GlobalAddressId.of(PROJECT, NAME); - compareAddressId(addressId, GlobalAddressId.fromUrl(addressId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid global address URL"); - GlobalAddressId.fromUrl("notMatchingUrl"); - } - - @Test - public void testToAndFromUrlRegion() { - RegionAddressId regionAddressId = RegionAddressId.of(PROJECT, REGION, NAME); - compareRegionAddressId(regionAddressId, RegionAddressId.fromUrl(regionAddressId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid region address URL"); - RegionAddressId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - GlobalAddressId addressId = GlobalAddressId.of(PROJECT, NAME); - assertSame(addressId, addressId.setProjectId(PROJECT)); - compareAddressId(addressId, GlobalAddressId.of(NAME).setProjectId(PROJECT)); - RegionAddressId regionAddressId = RegionAddressId.of(PROJECT, REGION, NAME); - assertSame(regionAddressId, regionAddressId.setProjectId(PROJECT)); - compareRegionAddressId(regionAddressId, RegionAddressId.of(REGION, NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(GlobalAddressId.matchesUrl(GlobalAddressId.of(PROJECT, NAME).getSelfLink())); - assertFalse(GlobalAddressId.matchesUrl("notMatchingUrl")); - assertTrue(RegionAddressId.matchesUrl(RegionAddressId.of(PROJECT, REGION, NAME).getSelfLink())); - assertFalse(RegionAddressId.matchesUrl("notMatchingUrl")); - } - - private void compareAddressId(GlobalAddressId expected, GlobalAddressId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getAddress(), expected.getAddress()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } - - private void compareRegionAddressId(RegionAddressId expected, RegionAddressId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getRegion(), expected.getRegion()); - assertEquals(expected.getAddress(), expected.getAddress()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java deleted file mode 100644 index 1149205ea18d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.cloud.compute.deprecated.AddressInfo.GlobalForwardingUsage; -import com.google.cloud.compute.deprecated.AddressInfo.RegionForwardingUsage; -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class AddressInfoTest { - - private static final String ADDRESS = "192.168.1.1"; - private static final Long CREATION_TIMESTAMP = 1452602400000L; - private static final String DESCRIPTION = "description"; - private static final String GENERATED_ID = "42"; - private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); - private static final RegionAddressId REGION_ADDRESS_ID = - RegionAddressId.of("project", "region", "address"); - private static final AddressInfo.Status STATUS = AddressInfo.Status.RESERVED; - private static final List GLOBAL_FORWARDING_RULES = - ImmutableList.of(GlobalForwardingRuleId.of("project", "forwardingRule1"), - GlobalForwardingRuleId.of("project", "forwardingRule2")); - private static final List REGION_FORWARDING_RULES = - ImmutableList.of(RegionForwardingRuleId.of("project", "region", "forwardingRule1"), - RegionForwardingRuleId.of("project", "region", "forwardingRule2")); - private static final AddressInfo.InstanceUsage INSTANCE_USAGE = - new AddressInfo.InstanceUsage(InstanceId.of("project", "zone", "instance1")); - private static final GlobalForwardingUsage GLOBAL_FORWARDING_USAGE = - new GlobalForwardingUsage(GLOBAL_FORWARDING_RULES); - private static final RegionForwardingUsage REGION_FORWARDING_USAGE = - new RegionForwardingUsage(REGION_FORWARDING_RULES); - private static final AddressInfo INSTANCE_ADDRESS_INFO = AddressInfo.newBuilder(REGION_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(INSTANCE_USAGE) - .build(); - private static final AddressInfo GLOBAL_FORWARDING_ADDRESS_INFO = - AddressInfo.newBuilder(GLOBAL_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(GLOBAL_FORWARDING_USAGE) - .build(); - private static final AddressInfo REGION_FORWARDING_ADDRESS_INFO = - AddressInfo.newBuilder(REGION_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(REGION_FORWARDING_USAGE) - .build(); - - @Test - public void testToBuilder() { - compareAddressInfo(INSTANCE_ADDRESS_INFO, INSTANCE_ADDRESS_INFO.toBuilder().build()); - AddressInfo addressInfo = INSTANCE_ADDRESS_INFO.toBuilder() - .setAddress("192.168.1.2") - .setDescription("description2") - .build(); - assertEquals("description2", addressInfo.getDescription()); - assertEquals("192.168.1.2", addressInfo.getAddress()); - addressInfo = addressInfo.toBuilder() - .setAddress("192.168.1.1") - .setDescription("description") - .build(); - compareAddressInfo(INSTANCE_ADDRESS_INFO, addressInfo); - } - - @Test - public void testToBuilderIncomplete() { - AddressInfo addressInfo = AddressInfo.newBuilder(GLOBAL_ADDRESS_ID).build(); - assertEquals(addressInfo, addressInfo.toBuilder().build()); - addressInfo = AddressInfo.newBuilder(REGION_ADDRESS_ID).build(); - assertEquals(addressInfo, addressInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(ADDRESS, INSTANCE_ADDRESS_INFO.getAddress()); - assertEquals(CREATION_TIMESTAMP, INSTANCE_ADDRESS_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, INSTANCE_ADDRESS_INFO.getDescription()); - assertEquals(GENERATED_ID, INSTANCE_ADDRESS_INFO.getGeneratedId()); - assertEquals(REGION_ADDRESS_ID, INSTANCE_ADDRESS_INFO.getAddressId()); - assertEquals(STATUS, INSTANCE_ADDRESS_INFO.getStatus()); - assertEquals(INSTANCE_USAGE, INSTANCE_ADDRESS_INFO.getUsage()); - assertEquals(INSTANCE_USAGE.getInstance(), - INSTANCE_ADDRESS_INFO.getUsage().getInstance()); - assertEquals(ADDRESS, REGION_FORWARDING_ADDRESS_INFO.getAddress()); - assertEquals(CREATION_TIMESTAMP, REGION_FORWARDING_ADDRESS_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, REGION_FORWARDING_ADDRESS_INFO.getDescription()); - assertEquals(GENERATED_ID, REGION_FORWARDING_ADDRESS_INFO.getGeneratedId()); - assertEquals(REGION_ADDRESS_ID, REGION_FORWARDING_ADDRESS_INFO.getAddressId()); - assertEquals(STATUS, REGION_FORWARDING_ADDRESS_INFO.getStatus()); - assertEquals(REGION_FORWARDING_USAGE, REGION_FORWARDING_ADDRESS_INFO.getUsage()); - assertEquals(REGION_FORWARDING_RULES, - REGION_FORWARDING_ADDRESS_INFO.getUsage().getForwardingRules()); - assertEquals(ADDRESS, GLOBAL_FORWARDING_ADDRESS_INFO.getAddress()); - assertEquals(CREATION_TIMESTAMP, GLOBAL_FORWARDING_ADDRESS_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, GLOBAL_FORWARDING_ADDRESS_INFO.getDescription()); - assertEquals(GENERATED_ID, GLOBAL_FORWARDING_ADDRESS_INFO.getGeneratedId()); - assertEquals(GLOBAL_ADDRESS_ID, GLOBAL_FORWARDING_ADDRESS_INFO.getAddressId()); - assertEquals(STATUS, GLOBAL_FORWARDING_ADDRESS_INFO.getStatus()); - assertEquals(GLOBAL_FORWARDING_USAGE, GLOBAL_FORWARDING_ADDRESS_INFO.getUsage()); - assertEquals(GLOBAL_FORWARDING_RULES, - GLOBAL_FORWARDING_ADDRESS_INFO.getUsage().getForwardingRules()); - } - - @Test - public void testOf() { - AddressInfo addressInfo = AddressInfo.of("address"); - assertEquals(GlobalAddressId.of("address"), addressInfo.getAddressId()); - assertNull(addressInfo.getAddress()); - assertNull(addressInfo.getCreationTimestamp()); - assertNull(addressInfo.getDescription()); - assertNull(addressInfo.getGeneratedId()); - assertNull(addressInfo.getStatus()); - assertNull(addressInfo.getUsage()); - addressInfo = AddressInfo.of(GLOBAL_ADDRESS_ID); - assertEquals(GLOBAL_ADDRESS_ID, addressInfo.getAddressId()); - assertNull(addressInfo.getAddress()); - assertNull(addressInfo.getCreationTimestamp()); - assertNull(addressInfo.getDescription()); - assertNull(addressInfo.getGeneratedId()); - assertNull(addressInfo.getStatus()); - assertNull(addressInfo.getUsage()); - addressInfo = AddressInfo.of("region", "address"); - assertEquals(RegionAddressId.of("region", "address"), addressInfo.getAddressId()); - assertNull(addressInfo.getAddress()); - assertNull(addressInfo.getCreationTimestamp()); - assertNull(addressInfo.getDescription()); - assertNull(addressInfo.getGeneratedId()); - assertNull(addressInfo.getStatus()); - assertNull(addressInfo.getUsage()); - addressInfo = AddressInfo.of(RegionId.of("region"), "address"); - assertEquals(RegionAddressId.of("region", "address"), addressInfo.getAddressId()); - assertNull(addressInfo.getAddress()); - assertNull(addressInfo.getCreationTimestamp()); - assertNull(addressInfo.getDescription()); - assertNull(addressInfo.getGeneratedId()); - assertNull(addressInfo.getStatus()); - assertNull(addressInfo.getUsage()); - } - - @Test - public void testToPbAndFromPb() { - compareAddressInfo(INSTANCE_ADDRESS_INFO, AddressInfo.fromPb(INSTANCE_ADDRESS_INFO.toPb())); - compareAddressInfo(REGION_FORWARDING_ADDRESS_INFO, - AddressInfo.fromPb(REGION_FORWARDING_ADDRESS_INFO.toPb())); - compareAddressInfo(GLOBAL_FORWARDING_ADDRESS_INFO, - AddressInfo.fromPb(GLOBAL_FORWARDING_ADDRESS_INFO.toPb())); - AddressInfo addressInfo = AddressInfo.newBuilder(GLOBAL_ADDRESS_ID).build(); - compareAddressInfo(addressInfo, AddressInfo.fromPb(addressInfo.toPb())); - } - - @Test - public void testSetProjectId() { - AddressInfo addressInfo = GLOBAL_FORWARDING_ADDRESS_INFO.toBuilder() - .setAddressId(GlobalAddressId.of(GLOBAL_ADDRESS_ID.getAddress())) - .build(); - compareAddressInfo(GLOBAL_FORWARDING_ADDRESS_INFO, addressInfo.setProjectId("project")); - } - - private void compareAddressInfo(AddressInfo expected, AddressInfo value) { - assertEquals(expected, value); - assertEquals(expected.getAddress(), value.getAddress()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getAddressId(), value.getAddressId()); - assertEquals(expected.getUsage(), value.getUsage()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java deleted file mode 100644 index 9b590c0a9d8f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; - -import org.junit.After; -import org.junit.Test; - -import java.util.List; - -public class AddressTest { - - private static final String ADDRESS = "192.168.1.1"; - private static final Long CREATION_TIMESTAMP = 1452602400000L; - private static final String DESCRIPTION = "description"; - private static final String GENERATED_ID = "42"; - private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); - private static final RegionAddressId REGION_ADDRESS_ID = - RegionAddressId.of("project", "region", "address"); - private static final AddressInfo.Status STATUS = AddressInfo.Status.RESERVED; - private static final List GLOBAL_FORWARDING_RULES = - ImmutableList.of(GlobalForwardingRuleId.of("project", "forwardingRule1"), - GlobalForwardingRuleId.of("project", "forwardingRule2")); - private static final List REGION_FORWARDING_RULES = - ImmutableList.of(RegionForwardingRuleId.of("project", "region", "forwardingRule1"), - RegionForwardingRuleId.of("project", "region", "forwardingRule2")); - private static final AddressInfo.InstanceUsage INSTANCE_USAGE = - new AddressInfo.InstanceUsage(InstanceId.of("project", "zone", "instance1")); - private static final AddressInfo.GlobalForwardingUsage GLOBAL_FORWARDING_USAGE = - new AddressInfo.GlobalForwardingUsage(GLOBAL_FORWARDING_RULES); - private static final AddressInfo.RegionForwardingUsage REGION_FORWARDING_USAGE = - new AddressInfo.RegionForwardingUsage(REGION_FORWARDING_RULES); - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Address globalForwardingAddress; - private Address instanceAddress; - private Address regionForwardingAddress; - private Address address; - - private void initializeExpectedAddress(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - instanceAddress = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(INSTANCE_USAGE) - .build(); - globalForwardingAddress = new Address.Builder(serviceMockReturnsOptions, GLOBAL_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(GLOBAL_FORWARDING_USAGE) - .build(); - regionForwardingAddress = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(REGION_FORWARDING_USAGE) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeAddress() { - address = new Address.Builder(compute, REGION_ADDRESS_ID) - .setAddress(ADDRESS) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGeneratedId(GENERATED_ID) - .setStatus(STATUS) - .setUsage(REGION_FORWARDING_USAGE) - .build(); - } - - @After - public void tearDown() throws Exception { - verify(serviceMockReturnsOptions); - } - - @Test - public void testBuilder() { - initializeExpectedAddress(6); - assertEquals(ADDRESS, instanceAddress.getAddress()); - assertEquals(CREATION_TIMESTAMP, instanceAddress.getCreationTimestamp()); - assertEquals(DESCRIPTION, instanceAddress.getDescription()); - assertEquals(GENERATED_ID, instanceAddress.getGeneratedId()); - assertEquals(REGION_ADDRESS_ID, instanceAddress.getAddressId()); - assertEquals(STATUS, instanceAddress.getStatus()); - assertEquals(INSTANCE_USAGE, instanceAddress.getUsage()); - assertSame(serviceMockReturnsOptions, instanceAddress.getCompute()); - assertEquals(ADDRESS, regionForwardingAddress.getAddress()); - assertEquals(CREATION_TIMESTAMP, regionForwardingAddress.getCreationTimestamp()); - assertEquals(DESCRIPTION, regionForwardingAddress.getDescription()); - assertEquals(GENERATED_ID, regionForwardingAddress.getGeneratedId()); - assertEquals(REGION_ADDRESS_ID, regionForwardingAddress.getAddressId()); - assertEquals(STATUS, regionForwardingAddress.getStatus()); - assertEquals(REGION_FORWARDING_USAGE, regionForwardingAddress.getUsage()); - assertSame(serviceMockReturnsOptions, regionForwardingAddress.getCompute()); - assertEquals(ADDRESS, globalForwardingAddress.getAddress()); - assertEquals(CREATION_TIMESTAMP, globalForwardingAddress.getCreationTimestamp()); - assertEquals(DESCRIPTION, globalForwardingAddress.getDescription()); - assertEquals(GENERATED_ID, globalForwardingAddress.getGeneratedId()); - assertEquals(GLOBAL_ADDRESS_ID, globalForwardingAddress.getAddressId()); - assertEquals(STATUS, globalForwardingAddress.getStatus()); - assertEquals(GLOBAL_FORWARDING_USAGE, globalForwardingAddress.getUsage()); - assertSame(serviceMockReturnsOptions, globalForwardingAddress.getCompute()); - Address address = new Address.Builder(serviceMockReturnsOptions, GLOBAL_ADDRESS_ID).build(); - assertEquals(GLOBAL_ADDRESS_ID, address.getAddressId()); - assertSame(serviceMockReturnsOptions, address.getCompute()); - assertNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getDescription()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID).build(); - assertEquals(REGION_ADDRESS_ID, address.getAddressId()); - assertSame(serviceMockReturnsOptions, address.getCompute()); - assertNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getDescription()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) - .setAddressId(GLOBAL_ADDRESS_ID) - .build(); - assertEquals(GLOBAL_ADDRESS_ID, address.getAddressId()); - assertSame(serviceMockReturnsOptions, address.getCompute()); - assertNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getDescription()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - } - - @Test - public void testToBuilder() { - initializeExpectedAddress(16); - compareAddress(instanceAddress, instanceAddress.toBuilder().build()); - compareAddress(globalForwardingAddress, globalForwardingAddress.toBuilder().build()); - compareAddress(regionForwardingAddress, regionForwardingAddress.toBuilder().build()); - Address newAddress = instanceAddress.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newAddress.getDescription()); - newAddress = newAddress.toBuilder().setDescription("description").build(); - compareAddress(instanceAddress, newAddress); - } - - @Test - public void testToAndFromPb() { - initializeExpectedAddress(20); - compareAddress(globalForwardingAddress, - Address.fromPb(serviceMockReturnsOptions, globalForwardingAddress.toPb())); - compareAddress(regionForwardingAddress, - Address.fromPb(serviceMockReturnsOptions, regionForwardingAddress.toPb())); - compareAddress(instanceAddress, - Address.fromPb(serviceMockReturnsOptions, instanceAddress.toPb())); - Address address = new Address.Builder(serviceMockReturnsOptions, GLOBAL_ADDRESS_ID).build(); - compareAddress(address, Address.fromPb(serviceMockReturnsOptions, address.toPb())); - address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID).build(); - compareAddress(address, Address.fromPb(serviceMockReturnsOptions, address.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedAddress(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - expect(compute.deleteAddress(REGION_ADDRESS_ID)).andReturn(operation); - replay(compute); - initializeAddress(); - assertSame(operation, address.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedAddress(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteAddress(REGION_ADDRESS_ID)).andReturn(null); - replay(compute); - initializeAddress(); - assertNull(address.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedAddress(3); - Compute.AddressOption[] expectedOptions = {Compute.AddressOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getAddress(REGION_ADDRESS_ID, expectedOptions)).andReturn(regionForwardingAddress); - replay(compute); - initializeAddress(); - assertTrue(address.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedAddress(3); - Compute.AddressOption[] expectedOptions = {Compute.AddressOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getAddress(REGION_ADDRESS_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeAddress(); - assertFalse(address.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedAddress(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getAddress(REGION_ADDRESS_ID)).andReturn(regionForwardingAddress); - replay(compute); - initializeAddress(); - Address updatedAddress = address.reload(); - compareAddress(regionForwardingAddress, updatedAddress); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedAddress(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getAddress(REGION_ADDRESS_ID)).andReturn(null); - replay(compute); - initializeAddress(); - assertNull(address.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedAddress(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getAddress(REGION_ADDRESS_ID, Compute.AddressOption.fields())) - .andReturn(regionForwardingAddress); - replay(compute); - initializeAddress(); - Address updatedAddress = address.reload(Compute.AddressOption.fields()); - compareAddress(regionForwardingAddress, updatedAddress); - verify(compute); - } - - private void compareAddress(Address expected, Address value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getAddress(), value.getAddress()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getAddressId(), value.getAddressId()); - assertEquals(expected.getUsage(), value.getUsage()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java deleted file mode 100644 index cb794b5e5e6e..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.compute.deprecated.AttachedDisk.AttachedDiskConfiguration.InterfaceType; -import com.google.cloud.compute.deprecated.AttachedDisk.AttachedDiskConfiguration.Type; -import com.google.cloud.compute.deprecated.AttachedDisk.CreateDiskConfiguration; -import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; -import com.google.cloud.compute.deprecated.AttachedDisk.ScratchDiskConfiguration; -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class AttachedDiskTest { - - private static final Boolean AUTO_DELETE = true; - private static final Boolean BOOT = true; - private static final Integer INDEX = 0; - private static final String DEVICE_NAME = "deviceName"; - private static final String DISK_NAME = "diskName"; - private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); - private static final Long DISK_SIZE_GB = 42L; - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final InterfaceType INTERFACE_TYPE = InterfaceType.NVME; - private static final PersistentDiskConfiguration.Mode MODE = - PersistentDiskConfiguration.Mode.READ_ONLY; - private static final PersistentDiskConfiguration PERSISTENT_DISK_CONFIGURATION = - PersistentDiskConfiguration.newBuilder(DISK_ID) - .setBoot(BOOT) - .setAutoDelete(AUTO_DELETE) - .setMode(MODE) - .build(); - private static final ScratchDiskConfiguration SCRATCH_DISK_CONFIGURATION = - ScratchDiskConfiguration.newBuilder(DISK_TYPE_ID).setInterfaceType(INTERFACE_TYPE).build(); - private static final CreateDiskConfiguration CREATE_DISK_CONFIGURATION = - CreateDiskConfiguration.newBuilder(IMAGE_ID) - .setAutoDelete(AUTO_DELETE) - .setDiskName(DISK_NAME) - .setDiskType(DISK_TYPE_ID) - .setDiskSizeGb(DISK_SIZE_GB) - .setSourceImage(IMAGE_ID) - .build(); - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final AttachedDisk PERSISTENT_DISK = - AttachedDisk.newBuilder(PERSISTENT_DISK_CONFIGURATION) - .setDeviceName(DEVICE_NAME) - .setIndex(INDEX) - .setLicenses(LICENSES) - .build(); - private static final AttachedDisk SCRATCH_DISK = - AttachedDisk.newBuilder(SCRATCH_DISK_CONFIGURATION) - .setDeviceName(DEVICE_NAME) - .setIndex(INDEX) - .setLicenses(LICENSES) - .build(); - private static final AttachedDisk CREATED_DISK = - AttachedDisk.newBuilder(CREATE_DISK_CONFIGURATION) - .setDeviceName(DEVICE_NAME) - .setIndex(INDEX) - .setLicenses(LICENSES) - .build(); - - @Test - public void testConfigurationToBuilder() { - comparePersistentDiskConfiguration(PERSISTENT_DISK_CONFIGURATION, - PERSISTENT_DISK_CONFIGURATION.toBuilder().build()); - compareScratchDiskConfiguration(SCRATCH_DISK_CONFIGURATION, - SCRATCH_DISK_CONFIGURATION.toBuilder().build()); - compareCreateDiskConfiguration(CREATE_DISK_CONFIGURATION, - CREATE_DISK_CONFIGURATION.toBuilder().build()); - PersistentDiskConfiguration persistentDiskConfiguration = - PERSISTENT_DISK_CONFIGURATION.toBuilder().setAutoDelete(false).build(); - assertFalse(persistentDiskConfiguration.autoDelete()); - persistentDiskConfiguration = - persistentDiskConfiguration.toBuilder().setAutoDelete(AUTO_DELETE).build(); - assertEquals(PERSISTENT_DISK_CONFIGURATION, persistentDiskConfiguration); - ScratchDiskConfiguration scratchDiskConfiguration = - SCRATCH_DISK_CONFIGURATION.toBuilder().setInterfaceType(InterfaceType.SCSI).build(); - assertEquals(InterfaceType.SCSI, scratchDiskConfiguration.getInterfaceType()); - scratchDiskConfiguration = - scratchDiskConfiguration.toBuilder().setInterfaceType(INTERFACE_TYPE).build(); - assertEquals(SCRATCH_DISK_CONFIGURATION, scratchDiskConfiguration); - CreateDiskConfiguration createDiskConfiguration = - CREATE_DISK_CONFIGURATION.toBuilder().setAutoDelete(false).build(); - assertFalse(createDiskConfiguration.autoDelete()); - createDiskConfiguration = - createDiskConfiguration.toBuilder().setAutoDelete(AUTO_DELETE).build(); - assertEquals(CREATE_DISK_CONFIGURATION, createDiskConfiguration); - } - - @Test - public void testConfigurationToBuilderIncomplete() { - PersistentDiskConfiguration persistentConfiguration = PersistentDiskConfiguration.of(DISK_ID); - comparePersistentDiskConfiguration(persistentConfiguration, - AttachedDisk.AttachedDiskConfiguration.fromPb( - persistentConfiguration.toPb())); - ScratchDiskConfiguration scratchDiskConfiguration = ScratchDiskConfiguration.of(DISK_TYPE_ID); - compareScratchDiskConfiguration(scratchDiskConfiguration, - AttachedDisk.AttachedDiskConfiguration.fromPb( - scratchDiskConfiguration.toPb())); - CreateDiskConfiguration createDiskConfiguration = CreateDiskConfiguration.of(IMAGE_ID); - compareCreateDiskConfiguration(createDiskConfiguration, - AttachedDisk.AttachedDiskConfiguration.fromPb( - createDiskConfiguration.toPb())); - } - - @Test - public void testToBuilder() { - compareAttachedDisk(PERSISTENT_DISK, PERSISTENT_DISK.toBuilder().build()); - compareAttachedDisk(SCRATCH_DISK, SCRATCH_DISK.toBuilder().build()); - compareAttachedDisk(CREATED_DISK, CREATED_DISK.toBuilder().build()); - AttachedDisk attachedDisk = PERSISTENT_DISK.toBuilder().setDeviceName("newDeviceName").build(); - assertEquals("newDeviceName", attachedDisk.getDeviceName()); - attachedDisk = attachedDisk.toBuilder().setDeviceName(DEVICE_NAME).build(); - compareAttachedDisk(PERSISTENT_DISK, attachedDisk); - } - - @Test - public void testToBuilderIncomplete() { - AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); - assertEquals(attachedDisk, attachedDisk.toBuilder().build()); - attachedDisk = AttachedDisk.of(SCRATCH_DISK_CONFIGURATION); - assertEquals(attachedDisk, attachedDisk.toBuilder().build()); - attachedDisk = AttachedDisk.of(CREATE_DISK_CONFIGURATION); - assertEquals(attachedDisk, attachedDisk.toBuilder().build()); - } - - @Test - public void testConfigurationBuilder() { - assertTrue(CREATE_DISK_CONFIGURATION.boot()); - assertEquals(AUTO_DELETE, CREATE_DISK_CONFIGURATION.autoDelete()); - assertNull(CREATE_DISK_CONFIGURATION.getInterfaceType()); - assertEquals(Type.PERSISTENT, CREATE_DISK_CONFIGURATION.getType()); - assertEquals(IMAGE_ID, CREATE_DISK_CONFIGURATION.getSourceImage()); - assertEquals(DISK_NAME, CREATE_DISK_CONFIGURATION.getDiskName()); - assertEquals(DISK_TYPE_ID, CREATE_DISK_CONFIGURATION.getDiskType()); - assertEquals(DISK_SIZE_GB, CREATE_DISK_CONFIGURATION.getDiskSizeGb()); - assertEquals(IMAGE_ID, CREATE_DISK_CONFIGURATION.getSourceImage()); - - assertEquals(BOOT, PERSISTENT_DISK_CONFIGURATION.boot()); - assertEquals(AUTO_DELETE, PERSISTENT_DISK_CONFIGURATION.autoDelete()); - assertNull(PERSISTENT_DISK_CONFIGURATION.getInterfaceType()); - assertEquals(Type.PERSISTENT, PERSISTENT_DISK_CONFIGURATION.getType()); - assertEquals(MODE, PERSISTENT_DISK_CONFIGURATION.getMode()); - assertEquals(DISK_ID, PERSISTENT_DISK_CONFIGURATION.getSourceDisk()); - - assertFalse(SCRATCH_DISK_CONFIGURATION.boot()); - assertTrue(SCRATCH_DISK_CONFIGURATION.autoDelete()); - assertEquals(INTERFACE_TYPE, SCRATCH_DISK_CONFIGURATION.getInterfaceType()); - assertEquals(Type.SCRATCH, SCRATCH_DISK_CONFIGURATION.getType()); - assertEquals(DISK_TYPE_ID, SCRATCH_DISK_CONFIGURATION.getDiskType()); - } - - @Test - public void testBuilder() { - assertEquals(PERSISTENT_DISK_CONFIGURATION, PERSISTENT_DISK.getConfiguration()); - assertEquals(DEVICE_NAME, PERSISTENT_DISK.getDeviceName()); - assertEquals(INDEX, PERSISTENT_DISK.getIndex()); - assertEquals(LICENSES, PERSISTENT_DISK.getLicenses()); - assertEquals(SCRATCH_DISK_CONFIGURATION, SCRATCH_DISK.getConfiguration()); - assertEquals(DEVICE_NAME, SCRATCH_DISK.getDeviceName()); - assertEquals(INDEX, SCRATCH_DISK.getIndex()); - assertEquals(LICENSES, SCRATCH_DISK.getLicenses()); - assertEquals(CREATE_DISK_CONFIGURATION, CREATED_DISK.getConfiguration()); - assertEquals(DEVICE_NAME, CREATED_DISK.getDeviceName()); - assertEquals(INDEX, CREATED_DISK.getIndex()); - assertEquals(LICENSES, CREATED_DISK.getLicenses()); - } - - @Test - public void testConfigurationOf() { - PersistentDiskConfiguration persistentConfiguration = PersistentDiskConfiguration.of(DISK_ID); - assertEquals(DISK_ID, persistentConfiguration.getSourceDisk()); - assertEquals(Type.PERSISTENT, persistentConfiguration.getType()); - assertNull(persistentConfiguration.autoDelete()); - assertNull(persistentConfiguration.boot()); - assertNull(persistentConfiguration.getInterfaceType()); - ScratchDiskConfiguration scratchDiskConfiguration = ScratchDiskConfiguration.of(DISK_TYPE_ID); - assertEquals(DISK_TYPE_ID, scratchDiskConfiguration.getDiskType()); - assertNull(scratchDiskConfiguration.getInterfaceType()); - assertEquals(Type.SCRATCH, scratchDiskConfiguration.getType()); - assertTrue(scratchDiskConfiguration.autoDelete()); - assertFalse(scratchDiskConfiguration.boot()); - assertNull(scratchDiskConfiguration.getInterfaceType()); - CreateDiskConfiguration createDiskConfiguration = CreateDiskConfiguration.of(IMAGE_ID); - assertEquals(IMAGE_ID, createDiskConfiguration.getSourceImage()); - assertNull(createDiskConfiguration.getDiskType()); - assertNull(createDiskConfiguration.getDiskName()); - assertNull(createDiskConfiguration.getDiskSizeGb()); - assertNull(createDiskConfiguration.getInterfaceType()); - assertEquals(Type.PERSISTENT, createDiskConfiguration.getType()); - assertNull(createDiskConfiguration.autoDelete()); - assertTrue(createDiskConfiguration.boot()); - assertNull(createDiskConfiguration.getInterfaceType()); - } - - @Test - public void testOf() { - AttachedDisk attachedDisk = AttachedDisk.of(DEVICE_NAME, PERSISTENT_DISK_CONFIGURATION); - assertEquals(PERSISTENT_DISK_CONFIGURATION, attachedDisk.getConfiguration()); - assertEquals(DEVICE_NAME, attachedDisk.getDeviceName()); - assertNull(attachedDisk.getIndex()); - assertNull(attachedDisk.getLicenses()); - attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); - assertEquals(PERSISTENT_DISK_CONFIGURATION, attachedDisk.getConfiguration()); - assertNull(attachedDisk.getDeviceName()); - assertNull(attachedDisk.getIndex()); - assertNull(attachedDisk.getLicenses()); - attachedDisk = AttachedDisk.of(DEVICE_NAME, SCRATCH_DISK_CONFIGURATION); - assertEquals(SCRATCH_DISK_CONFIGURATION, attachedDisk.getConfiguration()); - assertEquals(DEVICE_NAME, attachedDisk.getDeviceName()); - assertNull(attachedDisk.getIndex()); - assertNull(attachedDisk.getLicenses()); - attachedDisk = AttachedDisk.of(SCRATCH_DISK_CONFIGURATION); - assertEquals(SCRATCH_DISK_CONFIGURATION, attachedDisk.getConfiguration()); - assertNull(attachedDisk.getDeviceName()); - assertNull(attachedDisk.getIndex()); - assertNull(attachedDisk.getLicenses()); - attachedDisk = AttachedDisk.of(DEVICE_NAME, CREATE_DISK_CONFIGURATION); - assertEquals(CREATE_DISK_CONFIGURATION, attachedDisk.getConfiguration()); - assertEquals(DEVICE_NAME, attachedDisk.getDeviceName()); - assertNull(attachedDisk.getIndex()); - assertNull(attachedDisk.getLicenses()); - attachedDisk = AttachedDisk.of(CREATE_DISK_CONFIGURATION); - assertEquals(CREATE_DISK_CONFIGURATION, attachedDisk.getConfiguration()); - assertNull(attachedDisk.getDeviceName()); - assertNull(attachedDisk.getIndex()); - assertNull(attachedDisk.getLicenses()); - } - - @Test - public void testConfigurationToAndFromPb() { - PersistentDiskConfiguration persistentConfiguration = - PersistentDiskConfiguration.of(DISK_ID); - comparePersistentDiskConfiguration(persistentConfiguration, - AttachedDisk.AttachedDiskConfiguration.fromPb( - persistentConfiguration.toPb())); - comparePersistentDiskConfiguration(PERSISTENT_DISK_CONFIGURATION, - AttachedDisk.AttachedDiskConfiguration.fromPb( - PERSISTENT_DISK_CONFIGURATION.toPb())); - ScratchDiskConfiguration scratchDiskConfiguration = - ScratchDiskConfiguration.of(DISK_TYPE_ID); - compareScratchDiskConfiguration(scratchDiskConfiguration, - AttachedDisk.AttachedDiskConfiguration.fromPb( - scratchDiskConfiguration.toPb())); - compareScratchDiskConfiguration(SCRATCH_DISK_CONFIGURATION, - AttachedDisk.AttachedDiskConfiguration.fromPb( - SCRATCH_DISK_CONFIGURATION.toPb())); - CreateDiskConfiguration createDiskConfiguration = - CreateDiskConfiguration.of(IMAGE_ID); - compareCreateDiskConfiguration(createDiskConfiguration, - AttachedDisk.AttachedDiskConfiguration.fromPb( - createDiskConfiguration.toPb())); - compareCreateDiskConfiguration(CREATE_DISK_CONFIGURATION, - AttachedDisk.AttachedDiskConfiguration.fromPb( - CREATE_DISK_CONFIGURATION.toPb())); - } - - @Test - public void testToAndFromPb() { - AttachedDisk attachedDisk = AttachedDisk.fromPb(PERSISTENT_DISK.toPb()); - compareAttachedDisk(PERSISTENT_DISK, attachedDisk); - attachedDisk = AttachedDisk.fromPb(SCRATCH_DISK.toPb()); - compareAttachedDisk(SCRATCH_DISK, attachedDisk); - attachedDisk = AttachedDisk.fromPb(CREATED_DISK.toPb()); - compareAttachedDisk(CREATED_DISK, attachedDisk); - attachedDisk = AttachedDisk.of(DEVICE_NAME, PERSISTENT_DISK_CONFIGURATION); - compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); - attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); - compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); - attachedDisk = AttachedDisk.of(DEVICE_NAME, SCRATCH_DISK_CONFIGURATION); - compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); - attachedDisk = AttachedDisk.of(SCRATCH_DISK_CONFIGURATION); - compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); - attachedDisk = AttachedDisk.of(DEVICE_NAME, CREATE_DISK_CONFIGURATION); - compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); - attachedDisk = AttachedDisk.of(CREATE_DISK_CONFIGURATION); - compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); - } - - @Test - public void testConfigurationSetProjectId() { - PersistentDiskConfiguration persistentConfiguration = - PersistentDiskConfiguration.of(DiskId.of("zone", "disk")); - comparePersistentDiskConfiguration( - PersistentDiskConfiguration.of(DiskId.of("project", "zone", "disk")), - persistentConfiguration.setProjectId("project")); - ScratchDiskConfiguration scratchDiskConfiguration = - ScratchDiskConfiguration.of(DiskTypeId.of("zone", "diskType")); - compareScratchDiskConfiguration( - ScratchDiskConfiguration.of(DiskTypeId.of("project", "zone", "diskType")), - scratchDiskConfiguration.setProjectId("project")); - CreateDiskConfiguration createDiskConfiguration = CREATE_DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of("zone", "diskType")) - .setSourceImage(ImageId.of("image")) - .build(); - compareCreateDiskConfiguration(CREATE_DISK_CONFIGURATION, - createDiskConfiguration.setProjectId("project")); - } - - @Test - public void testSetProjectId() { - PersistentDiskConfiguration persistentConfiguration = - PersistentDiskConfiguration.of(DiskId.of("zone", "disk")); - PersistentDiskConfiguration persistentConfigurationWithProject = - PersistentDiskConfiguration.of(DiskId.of("project", "zone", "disk")); - AttachedDisk attachedDisk = AttachedDisk.of(persistentConfiguration); - compareAttachedDisk(AttachedDisk.of(persistentConfigurationWithProject), - attachedDisk.setProjectId("project")); - ScratchDiskConfiguration scratchDiskConfiguration = - ScratchDiskConfiguration.of(DiskTypeId.of("zone", "diskType")); - ScratchDiskConfiguration scratchDiskConfigurationWithProject = - ScratchDiskConfiguration.of(DiskTypeId.of("project", "zone", "diskType")); - compareAttachedDisk(AttachedDisk.of(scratchDiskConfigurationWithProject), - AttachedDisk.of(scratchDiskConfiguration).setProjectId("project")); - CreateDiskConfiguration createDiskConfiguration = - CreateDiskConfiguration.of(ImageId.of("image")); - CreateDiskConfiguration createDiskConfigurationWithProject = - CreateDiskConfiguration.of(ImageId.of("project", "image")); - compareAttachedDisk(AttachedDisk.of(createDiskConfigurationWithProject), - AttachedDisk.of(createDiskConfiguration).setProjectId("project")); - createDiskConfiguration = CREATE_DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of("zone", "diskType")) - .setSourceImage(ImageId.of("image")) - .build(); - compareAttachedDisk(AttachedDisk.of(CREATE_DISK_CONFIGURATION), - AttachedDisk.of(createDiskConfiguration).setProjectId("project")); - } - - public void compareAttachedDiskConfiguration(AttachedDisk.AttachedDiskConfiguration expected, - AttachedDisk.AttachedDiskConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.getInterfaceType(), value.getInterfaceType()); - assertEquals(expected.boot(), value.boot()); - assertEquals(expected.autoDelete(), value.autoDelete()); - assertEquals(expected.hashCode(), value.hashCode()); - } - - public void comparePersistentDiskConfiguration(PersistentDiskConfiguration expected, - PersistentDiskConfiguration value) { - compareAttachedDiskConfiguration(expected, value); - assertEquals(expected.getMode(), value.getMode()); - assertEquals(expected.getSourceDisk(), value.getSourceDisk()); - } - - public void compareCreateDiskConfiguration(CreateDiskConfiguration expected, - CreateDiskConfiguration value) { - compareAttachedDiskConfiguration(expected, value); - assertEquals(expected.getDiskName(), value.getDiskName()); - assertEquals(expected.getDiskType(), value.getDiskType()); - assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); - assertEquals(expected.getSourceImage(), value.getSourceImage()); - } - - public void compareScratchDiskConfiguration(ScratchDiskConfiguration expected, - ScratchDiskConfiguration value) { - compareAttachedDiskConfiguration(expected, value); - assertEquals(expected.getDiskType(), value.getDiskType()); - } - - public void compareAttachedDisk(AttachedDisk expected, AttachedDisk value) { - assertEquals(expected, value); - assertEquals(expected.getDeviceName(), value.getDeviceName()); - assertEquals(expected.getIndex(), value.getIndex()); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java deleted file mode 100644 index ac1335753f3e..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.BaseServiceException; -import com.google.cloud.RetryHelper.RetryHelperException; - -import org.junit.Test; - -import java.io.IOException; -import java.net.SocketTimeoutException; - -public class ComputeExceptionTest { - - @Test - public void testResourceManagerException() { - ComputeException exception = new ComputeException(500, "message"); - assertEquals(500, exception.getCode()); - assertEquals("message", exception.getMessage()); - assertNull(exception.getReason()); - assertTrue(exception.isRetryable()); - - exception = new ComputeException(403, "message"); - assertEquals(403, exception.getCode()); - assertEquals("message", exception.getMessage()); - assertNull(exception.getReason()); - assertFalse(exception.isRetryable()); - - IOException cause = new SocketTimeoutException(); - exception = new ComputeException(cause); - assertNull(exception.getReason()); - assertNull(exception.getMessage()); - assertTrue(exception.isRetryable()); - assertSame(cause, exception.getCause()); - - exception = new ComputeException(403, "message", cause); - assertEquals(403, exception.getCode()); - assertEquals("message", exception.getMessage()); - assertNull(exception.getReason()); - assertFalse(exception.isRetryable()); - assertSame(cause, exception.getCause()); - } - - @Test - public void testTranslateAndThrow() throws Exception { - Exception cause = new ComputeException(500, "message"); - RetryHelperException exceptionMock = createMock(RetryHelperException.class); - expect(exceptionMock.getCause()).andReturn(cause).times(2); - replay(exceptionMock); - try { - ComputeException.translateAndThrow(exceptionMock); - } catch (BaseServiceException ex) { - assertEquals(500, ex.getCode()); - assertEquals("message", ex.getMessage()); - assertTrue(ex.isRetryable()); - } finally { - verify(exceptionMock); - } - cause = new IllegalArgumentException("message"); - exceptionMock = createMock(RetryHelperException.class); - expect(exceptionMock.getMessage()).andReturn("message").times(1); - expect(exceptionMock.getCause()).andReturn(cause).times(2); - replay(exceptionMock); - try { - ComputeException.translateAndThrow(exceptionMock); - } catch (BaseServiceException ex) { - assertEquals(ComputeException.UNKNOWN_CODE, ex.getCode()); - assertEquals("message", ex.getMessage()); - assertFalse(ex.isRetryable()); - assertSame(cause, ex.getCause()); - } finally { - verify(exceptionMock); - } - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java deleted file mode 100644 index 0841dbaea063..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java +++ /dev/null @@ -1,4118 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.capture; -import static org.easymock.EasyMock.eq; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.paging.Page; -import com.google.cloud.ServiceOptions; -import com.google.cloud.Tuple; -import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; -import com.google.cloud.compute.deprecated.spi.ComputeRpcFactory; -import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import java.util.List; -import java.util.Map; -import org.easymock.Capture; -import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class ComputeImplTest { - - private static final String PROJECT = "project"; - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final String VALID_DISK_SIZE = "10GB-10TB"; - private static final Long DEFAULT_DISK_SIZE_GB = 10L; - private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); - private static final DiskType DISK_TYPE = DiskType.newBuilder() - .setGeneratedId(GENERATED_ID) - .setDiskTypeId(DISK_TYPE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setValidDiskSize(VALID_DISK_SIZE) - .setDefaultDiskSizeGb(DEFAULT_DISK_SIZE_GB) - .build(); - private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); - private static final Integer GUEST_CPUS = 1; - private static final Integer MEMORY_MB = 2; - private static final List SCRATCH_DISKS = ImmutableList.of(3); - private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; - private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; - private static final MachineType MACHINE_TYPE = MachineType.newBuilder() - .setGeneratedId(GENERATED_ID) - .setMachineTypeId(MACHINE_TYPE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setCpus(GUEST_CPUS) - .setMemoryMb(MEMORY_MB) - .setScratchDisksSizeGb(SCRATCH_DISKS) - .setMaximumPersistentDisks(MAXIMUM_PERSISTENT_DISKS) - .setMaximumPersistentDisksSizeGb(MAXIMUM_PERSISTENT_DISKS_SIZE_GB) - .build(); - private static final RegionId REGION_ID = RegionId.of("project", "region"); - private static final Region.Status REGION_STATUS = Region.Status.DOWN; - private static final ZoneId ZONE_ID1 = ZoneId.of("project", "zone1"); - private static final ZoneId ZONE_ID2 = ZoneId.of("project", "zone2"); - private static final List ZONES = ImmutableList.of(ZONE_ID1, ZONE_ID2); - private static final Region.Quota QUOTA1 = - new Region.Quota("METRIC1", 2, 1); - private static final Region.Quota QUOTA2 = - new Region.Quota("METRIC2", 4, 3); - private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); - private static final Region REGION = Region.builder() - .setRegionId(REGION_ID) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(REGION_STATUS) - .setZones(ZONES) - .setQuotas(QUOTAS) - .build(); - private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); - private static final Zone.Status ZONE_STATUS = Zone.Status.DOWN; - private static final Zone ZONE = Zone.builder() - .setZoneId(ZONE_ID) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(ZONE_STATUS) - .setRegion(REGION_ID) - .build(); - private static final LicenseId LICENSE_ID = LicenseId.of("project", "license"); - private static final Boolean CHARGES_USE_FEE = true; - private static final License LICENSE = new License(LICENSE_ID, CHARGES_USE_FEE); - private static final Operation.OperationError OPERATION_ERROR1 = - new Operation.OperationError("code1", "location1", "message1"); - private static final Operation.OperationError OPERATION_ERROR2 = - new Operation.OperationError("code2", "location2", "message2"); - private static final Operation.OperationWarning OPERATION_WARNING1 = - new Operation.OperationWarning("code1", "message1", ImmutableMap.of("k1", "v1")); - private static final Operation.OperationWarning OPERATION_WARNING2 = - new Operation.OperationWarning("code2", "location2", ImmutableMap.of("k2", "v2")); - private static final String CLIENT_OPERATION_ID = "clientOperationId"; - private static final String OPERATION_TYPE = "delete"; - private static final String TARGET_LINK = "targetLink"; - private static final String TARGET_ID = "42"; - private static final Operation.Status STATUS = Operation.Status.DONE; - private static final String STATUS_MESSAGE = "statusMessage"; - private static final String USER = "user"; - private static final Integer PROGRESS = 100; - private static final Long INSERT_TIME = 1453293540000L; - private static final Long START_TIME = 1453293420000L; - private static final Long END_TIME = 1453293480000L; - private static final List ERRORS = - ImmutableList.of(OPERATION_ERROR1, OPERATION_ERROR2); - private static final List WARNINGS = - ImmutableList.of(OPERATION_WARNING1, OPERATION_WARNING2); - private static final Integer HTTP_ERROR_STATUS_CODE = 404; - private static final String HTTP_ERROR_MESSAGE = "NOT FOUND"; - private static final GlobalOperationId GLOBAL_OPERATION_ID = - GlobalOperationId.of("project", "op"); - private static final ZoneOperationId ZONE_OPERATION_ID = - ZoneOperationId.of("project", "zone", "op"); - private static final RegionOperationId REGION_OPERATION_ID = - RegionOperationId.of("project", "region", "op"); - private static final RegionAddressId REGION_ADDRESS_ID = - RegionAddressId.of("project", "region", "address"); - private static final GlobalAddressId GLOBAL_ADDRESS_ID = - GlobalAddressId.of("project", "address"); - private static final AddressInfo REGION_ADDRESS = - AddressInfo.newBuilder(REGION_ADDRESS_ID).build(); - private static final AddressInfo GLOBAL_ADDRESS = - AddressInfo.newBuilder(GLOBAL_ADDRESS_ID).build(); - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); - private static final SnapshotInfo SNAPSHOT = SnapshotInfo.of(SNAPSHOT_ID, DISK_ID); - private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final ImageInfo IMAGE = ImageInfo.of(IMAGE_ID, DiskImageConfiguration.of(DISK_ID)); - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, IMAGE_ID).build(); - private static final DiskInfo DISK = - DiskInfo.of(DISK_ID, StandardDiskConfiguration.of(DISK_TYPE_ID)); - private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); - private static final SubnetworkId SUBNETWORK_ID = SubnetworkId.of("project", "region", "network"); - private static final SubnetworkInfo SUBNETWORK = - SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, "192.168.0.0/16"); - private static final NetworkInfo NETWORK = - NetworkInfo.of(NETWORK_ID, StandardNetworkConfiguration.of("192.168.0.0/16")); - private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); - private static final AttachedDisk.PersistentDiskConfiguration PERSISTENT_DISK_CONFIGURATION = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - private static final AttachedDisk ATTACHED_DISK = - AttachedDisk.of("device", PERSISTENT_DISK_CONFIGURATION); - private static final NetworkInterface NETWORK_INTERFACE = NetworkInterface.of(NETWORK_ID); - private static final InstanceInfo INSTANCE = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE_ID, ATTACHED_DISK, NETWORK_INTERFACE); - - // Empty ComputeRpc options - private static final Map EMPTY_RPC_OPTIONS = ImmutableMap.of(); - - // DiskType options - private static final Compute.DiskTypeOption DISK_TYPE_OPTION_FIELDS = - Compute.DiskTypeOption.fields(Compute.DiskTypeField.ID, Compute.DiskTypeField.DESCRIPTION); - - // DiskType list options - private static final Compute.DiskTypeFilter DISK_TYPE_FILTER = - Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DESCRIPTION, "someDescription"); - private static final Compute.DiskTypeListOption DISK_TYPE_LIST_PAGE_TOKEN = - Compute.DiskTypeListOption.pageToken("cursor"); - private static final Compute.DiskTypeListOption DISK_TYPE_LIST_PAGE_SIZE = - Compute.DiskTypeListOption.pageSize(42L); - private static final Compute.DiskTypeListOption DISK_TYPE_LIST_FILTER = - Compute.DiskTypeListOption.filter(DISK_TYPE_FILTER); - private static final Map DISK_TYPE_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "description eq someDescription"); - - // DiskType aggregated list options - private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_PAGE_TOKEN = - Compute.DiskTypeAggregatedListOption.pageToken("cursor"); - private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_PAGE_SIZE = - Compute.DiskTypeAggregatedListOption.pageSize(42L); - private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_FILTER = - Compute.DiskTypeAggregatedListOption.filter(DISK_TYPE_FILTER); - - // MachineType options - private static final Compute.MachineTypeOption MACHINE_TYPE_OPTION_FIELDS = - Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID, - Compute.MachineTypeField.DESCRIPTION); - - // MachineType list options - private static final Compute.MachineTypeFilter MACHINE_TYPE_FILTER = - Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.MAXIMUM_PERSISTENT_DISKS, 42L); - private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_PAGE_TOKEN = - Compute.MachineTypeListOption.pageToken("cursor"); - private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_PAGE_SIZE = - Compute.MachineTypeListOption.pageSize(42L); - private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_FILTER = - Compute.MachineTypeListOption.filter(MACHINE_TYPE_FILTER); - private static final Map MACHINE_TYPE_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "maximumPersistentDisks ne 42"); - - // MachineType aggregated list options - private static final Compute.MachineTypeAggregatedListOption - MACHINE_TYPE_AGGREGATED_LIST_PAGE_TOKEN = - Compute.MachineTypeAggregatedListOption.pageToken("cursor"); - private static final Compute.MachineTypeAggregatedListOption - MACHINE_TYPE_AGGREGATED_LIST_PAGE_SIZE = - Compute.MachineTypeAggregatedListOption.pageSize(42L); - private static final Compute.MachineTypeAggregatedListOption MACHINE_TYPE_AGGREGATED_LIST_FILTER = - Compute.MachineTypeAggregatedListOption.filter(MACHINE_TYPE_FILTER); - - // Region options - private static final Compute.RegionOption REGION_OPTION_FIELDS = - Compute.RegionOption.fields(Compute.RegionField.ID, Compute.RegionField.DESCRIPTION); - - // Region list options - private static final Compute.RegionFilter REGION_FILTER = - Compute.RegionFilter.equals(Compute.RegionField.ID, "someId"); - private static final Compute.RegionListOption REGION_LIST_PAGE_TOKEN = - Compute.RegionListOption.pageToken("cursor"); - private static final Compute.RegionListOption REGION_LIST_PAGE_SIZE = - Compute.RegionListOption.pageSize(42L); - private static final Compute.RegionListOption REGION_LIST_FILTER = - Compute.RegionListOption.filter(REGION_FILTER); - private static final Map REGION_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "id eq someId"); - - // Zone options - private static final Compute.ZoneOption ZONE_OPTION_FIELDS = - Compute.ZoneOption.fields(Compute.ZoneField.ID, Compute.ZoneField.DESCRIPTION); - - // Zone list options - private static final Compute.ZoneFilter ZONE_FILTER = - Compute.ZoneFilter.notEquals(Compute.ZoneField.NAME, "someName"); - private static final Compute.ZoneListOption ZONE_LIST_PAGE_TOKEN = - Compute.ZoneListOption.pageToken("cursor"); - private static final Compute.ZoneListOption ZONE_LIST_PAGE_SIZE = - Compute.ZoneListOption.pageSize(42L); - private static final Compute.ZoneListOption ZONE_LIST_FILTER = - Compute.ZoneListOption.filter(ZONE_FILTER); - private static final Map ZONE_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "name ne someName"); - - // License options - private static final Compute.LicenseOption LICENSE_OPTION_FIELDS = - Compute.LicenseOption.fields(Compute.LicenseField.CHARGES_USE_FEE); - - // Operation options - private static final Compute.OperationOption OPERATION_OPTION_FIELDS = - Compute.OperationOption.fields(Compute.OperationField.ID, Compute.OperationField.DESCRIPTION); - - // Operation list options - private static final Compute.OperationFilter OPERATION_FILTER = - Compute.OperationFilter.notEquals(Compute.OperationField.PROGRESS, 0); - private static final Compute.OperationListOption OPERATION_LIST_PAGE_TOKEN = - Compute.OperationListOption.pageToken("cursor"); - private static final Compute.OperationListOption OPERATION_LIST_PAGE_SIZE = - Compute.OperationListOption.pageSize(42L); - private static final Compute.OperationListOption OPERATION_LIST_FILTER = - Compute.OperationListOption.filter(OPERATION_FILTER); - private static final Map OPERATION_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "progress ne 0"); - - // Address options - private static final Compute.AddressOption ADDRESS_OPTION_FIELDS = - Compute.AddressOption.fields(Compute.AddressField.ID, Compute.AddressField.DESCRIPTION); - - // Address list options - private static final Compute.AddressFilter ADDRESS_FILTER = - Compute.AddressFilter.notEquals(Compute.AddressField.REGION, "someRegion"); - private static final Compute.AddressListOption ADDRESS_LIST_PAGE_TOKEN = - Compute.AddressListOption.pageToken("cursor"); - private static final Compute.AddressListOption ADDRESS_LIST_PAGE_SIZE = - Compute.AddressListOption.pageSize(42L); - private static final Compute.AddressListOption ADDRESS_LIST_FILTER = - Compute.AddressListOption.filter(ADDRESS_FILTER); - private static final Map ADDRESS_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "region ne someRegion"); - - // Address aggregated list options - private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_PAGE_TOKEN = - Compute.AddressAggregatedListOption.pageToken("cursor"); - private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_PAGE_SIZE = - Compute.AddressAggregatedListOption.pageSize(42L); - private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_FILTER = - Compute.AddressAggregatedListOption.filter(ADDRESS_FILTER); - - // Snapshot options - private static final Compute.SnapshotOption SNAPSHOT_OPTION_FIELDS = - Compute.SnapshotOption.fields(Compute.SnapshotField.ID, Compute.SnapshotField.DESCRIPTION); - - // Snapshot list options - private static final Compute.SnapshotFilter SNAPSHOT_FILTER = - Compute.SnapshotFilter.equals(Compute.SnapshotField.DISK_SIZE_GB, 500L); - private static final Compute.SnapshotListOption SNAPSHOT_LIST_PAGE_TOKEN = - Compute.SnapshotListOption.pageToken("cursor"); - private static final Compute.SnapshotListOption SNAPSHOT_LIST_PAGE_SIZE = - Compute.SnapshotListOption.pageSize(42L); - private static final Compute.SnapshotListOption SNAPSHOT_LIST_FILTER = - Compute.SnapshotListOption.filter(SNAPSHOT_FILTER); - private static final Map SNAPSHOT_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "diskSizeGb eq 500"); - - // Image options - private static final Compute.ImageOption IMAGE_OPTION_FIELDS = - Compute.ImageOption.fields(Compute.ImageField.ID, Compute.ImageField.DESCRIPTION); - - // Image list options - private static final Compute.ImageFilter IMAGE_FILTER = - Compute.ImageFilter.notEquals(Compute.ImageField.DISK_SIZE_GB, 500L); - private static final Compute.ImageListOption IMAGE_LIST_PAGE_TOKEN = - Compute.ImageListOption.pageToken("cursor"); - private static final Compute.ImageListOption IMAGE_LIST_PAGE_SIZE = - Compute.ImageListOption.pageSize(42L); - private static final Compute.ImageListOption IMAGE_LIST_FILTER = - Compute.ImageListOption.filter(IMAGE_FILTER); - private static final Map IMAGE_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "diskSizeGb ne 500"); - - // Disk options - private static final Compute.DiskOption DISK_OPTION_FIELDS = - Compute.DiskOption.fields(Compute.DiskField.ID, Compute.DiskField.DESCRIPTION); - - // Disk list options - private static final Compute.DiskFilter DISK_FILTER = - Compute.DiskFilter.notEquals(Compute.DiskField.SIZE_GB, 500L); - private static final Compute.DiskListOption DISK_LIST_PAGE_TOKEN = - Compute.DiskListOption.pageToken("cursor"); - private static final Compute.DiskListOption DISK_LIST_PAGE_SIZE = - Compute.DiskListOption.pageSize(42L); - private static final Compute.DiskListOption DISK_LIST_FILTER = - Compute.DiskListOption.filter(DISK_FILTER); - private static final Map DISK_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "sizeGb ne 500"); - - // Disk aggregated list options - private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_PAGE_TOKEN = - Compute.DiskAggregatedListOption.pageToken("cursor"); - private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_PAGE_SIZE = - Compute.DiskAggregatedListOption.pageSize(42L); - private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_FILTER = - Compute.DiskAggregatedListOption.filter(DISK_FILTER); - - // Subnetwork options - private static final Compute.SubnetworkOption SUBNETWORK_OPTION_FIELDS = - Compute.SubnetworkOption.fields(Compute.SubnetworkField.ID, - Compute.SubnetworkField.DESCRIPTION); - - // Subnetwork list options - private static final Compute.SubnetworkFilter SUBNETWORK_FILTER = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.IP_CIDR_RANGE, "192.168.0.0/16"); - private static final Compute.SubnetworkListOption SUBNETWORK_LIST_PAGE_TOKEN = - Compute.SubnetworkListOption.pageToken("cursor"); - private static final Compute.SubnetworkListOption SUBNETWORK_LIST_PAGE_SIZE = - Compute.SubnetworkListOption.pageSize(42L); - private static final Compute.SubnetworkListOption SUBNETWORK_LIST_FILTER = - Compute.SubnetworkListOption.filter(SUBNETWORK_FILTER); - private static final Map SUBNETWORK_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "ipCidrRange eq 192.168.0.0/16"); - - // Subnetwork aggregated list options - private static final Compute.SubnetworkAggregatedListOption - SUBNETWORK_AGGREGATED_LIST_PAGE_TOKEN = - Compute.SubnetworkAggregatedListOption.pageToken("cursor"); - private static final Compute.SubnetworkAggregatedListOption SUBNETWORK_AGGREGATED_LIST_PAGE_SIZE = - Compute.SubnetworkAggregatedListOption.pageSize(42L); - private static final Compute.SubnetworkAggregatedListOption SUBNETWORK_AGGREGATED_LIST_FILTER = - Compute.SubnetworkAggregatedListOption.filter(SUBNETWORK_FILTER); - - // Network options - private static final Compute.NetworkOption NETWORK_OPTION_FIELDS = - Compute.NetworkOption.fields(Compute.NetworkField.ID, Compute.NetworkField.DESCRIPTION); - - // Network list options - private static final Compute.NetworkFilter NETWORK_FILTER = - Compute.NetworkFilter.equals(Compute.NetworkField.IPV4_RANGE, "192.168.0.0/16"); - private static final Compute.NetworkListOption NETWORK_LIST_PAGE_TOKEN = - Compute.NetworkListOption.pageToken("cursor"); - private static final Compute.NetworkListOption NETWORK_LIST_PAGE_SIZE = - Compute.NetworkListOption.pageSize(42L); - private static final Compute.NetworkListOption NETWORK_LIST_FILTER = - Compute.NetworkListOption.filter(NETWORK_FILTER); - private static final Map NETWORK_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "IPv4Range eq 192.168.0.0/16"); - - // Instance options - private static final Compute.InstanceOption INSTANCE_OPTION_FIELDS = - Compute.InstanceOption.fields(Compute.InstanceField.ID, Compute.InstanceField.DESCRIPTION); - - // Instance list options - private static final Compute.InstanceFilter INSTANCE_FILTER = - Compute.InstanceFilter.equals(Compute.InstanceField.CAN_IP_FORWARD, true); - private static final Compute.InstanceListOption INSTANCE_LIST_PAGE_TOKEN = - Compute.InstanceListOption.pageToken("cursor"); - private static final Compute.InstanceListOption INSTANCE_LIST_PAGE_SIZE = - Compute.InstanceListOption.pageSize(42L); - private static final Compute.InstanceListOption INSTANCE_LIST_FILTER = - Compute.InstanceListOption.filter(INSTANCE_FILTER); - private static final Map INSTANCE_LIST_OPTIONS = ImmutableMap.of( - ComputeRpc.Option.PAGE_TOKEN, "cursor", - ComputeRpc.Option.MAX_RESULTS, 42L, - ComputeRpc.Option.FILTER, "canIpForward eq true"); - - // Instance aggregated list options - private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_PAGE_TOKEN = - Compute.InstanceAggregatedListOption.pageToken("cursor"); - private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_PAGE_SIZE = - Compute.InstanceAggregatedListOption.pageSize(42L); - private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_FILTER = - Compute.InstanceAggregatedListOption.filter(INSTANCE_FILTER); - - private static final Function - OPERATION_TO_PB_FUNCTION = new Function() { - @Override - public com.google.api.services.compute.model.Operation apply(Operation operation) { - return operation.toPb(); - } - }; - - private ComputeOptions options; - private ComputeRpcFactory rpcFactoryMock; - private ComputeRpc computeRpcMock; - private Compute compute; - - private Operation globalOperation; - private Operation zoneOperation; - private Operation regionOperation; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Before - public void setUp() { - rpcFactoryMock = EasyMock.createMock(ComputeRpcFactory.class); - computeRpcMock = EasyMock.createMock(ComputeRpc.class); - EasyMock.expect(rpcFactoryMock.create(EasyMock.anyObject(ComputeOptions.class))) - .andReturn(computeRpcMock).times(2); - EasyMock.replay(rpcFactoryMock); - options = ComputeOptions.newBuilder() - .setProjectId(PROJECT) - .setServiceRpcFactory(rpcFactoryMock) - .setRetrySettings(ServiceOptions.getNoRetrySettings()) - .build(); - Compute otherService = options.toBuilder().build().getService(); - globalOperation = new Operation.Builder(otherService) - .getGeneratedId(GENERATED_ID) - .setOperationId(GLOBAL_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - zoneOperation = new Operation.Builder(otherService) - .getGeneratedId(GENERATED_ID) - .setOperationId(ZONE_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - regionOperation = new Operation.Builder(otherService) - .getGeneratedId(GENERATED_ID) - .setOperationId(REGION_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - } - - @After - public void tearDown() { - EasyMock.verify(rpcFactoryMock, computeRpcMock); - } - - @Test - public void testGetOptions() { - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertSame(options, compute.getOptions()); - } - - @Test - public void testGetDiskType() { - EasyMock.expect(computeRpcMock.getDiskType( - DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andReturn(DISK_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - DiskType diskType = compute.getDiskType(DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType()); - assertEquals(DISK_TYPE, diskType); - } - - @Test - public void testGetDiskType_Null() { - EasyMock.expect(computeRpcMock.getDiskType( - DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getDiskType(DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType())); - } - - @Test - public void testGetDiskTypeFromDiskTypeId() { - EasyMock.expect(computeRpcMock.getDiskType( - DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andReturn(DISK_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - DiskType diskType = compute.getDiskType(DISK_TYPE_ID); - assertEquals(DISK_TYPE, diskType); - } - - @Test - public void testGetDiskTypeWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect( - computeRpcMock.getDiskType( - eq(DISK_TYPE_ID.getZone()), eq(DISK_TYPE_ID.getType()), capture(capturedOptions))) - .andReturn(DISK_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - DiskType diskType = compute.getDiskType(DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), - DISK_TYPE_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(DISK_TYPE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(DISK_TYPE, diskType); - } - - @Test - public void testListDiskTypes() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testListDiskTypesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); - ImmutableList nextDiskTypeList = ImmutableList.of(DISK_TYPE); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextDiskTypeList, DiskType.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), nextOptions)) - .andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextDiskTypeList.toArray(), - Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testListEmptyDiskTypes() { - ImmutableList diskTypes = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - diskTypes); - EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone()); - assertNull(page.getNextPageToken()); - assertArrayEquals(diskTypes.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testListDiskTypesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), DISK_TYPE_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone(), DISK_TYPE_LIST_PAGE_SIZE, - DISK_TYPE_LIST_PAGE_TOKEN, DISK_TYPE_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testAggregatedListDiskTypes() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDiskTypes(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDiskTypes(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testAggregatedListDiskTypesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); - ImmutableList nextDiskTypeList = ImmutableList.of(DISK_TYPE); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextDiskTypeList, DiskType.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listDiskTypes(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listDiskTypes(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listDiskTypes(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextDiskTypeList.toArray(), - Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testAggregatedListEmptyDiskTypes() { - ImmutableList diskTypes = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - diskTypes); - EasyMock.expect(computeRpcMock.listDiskTypes(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listDiskTypes(); - assertNull(page.getNextPageToken()); - assertArrayEquals(diskTypes.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testAggregatedListDiskTypesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDiskTypes(DISK_TYPE_AGGREGATED_LIST_PAGE_SIZE, - DISK_TYPE_AGGREGATED_LIST_PAGE_TOKEN, DISK_TYPE_AGGREGATED_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); - } - - @Test - public void testGetMachineType() { - EasyMock.expect( - computeRpcMock.getMachineType( - MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andReturn(MACHINE_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - MachineType machineType = - compute.getMachineType(MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType()); - assertEquals(MACHINE_TYPE, machineType); - } - - @Test - public void testGetMachineType_Null() { - EasyMock.expect( - computeRpcMock.getMachineType( - MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getMachineType(MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType())); - } - - @Test - public void testGetMachineTypeFromMachineTypeId() { - EasyMock.expect(computeRpcMock.getMachineType( - MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andReturn(MACHINE_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - MachineType machineType = compute.getMachineType(MACHINE_TYPE_ID); - assertEquals(MACHINE_TYPE, machineType); - } - - @Test - public void testGetMachineTypeWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect( - computeRpcMock.getMachineType(eq(MACHINE_TYPE_ID.getZone()), eq(MACHINE_TYPE_ID.getType()), - capture(capturedOptions))) - .andReturn(MACHINE_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - MachineType machineType = compute.getMachineType(MACHINE_TYPE_ID.getZone(), - MACHINE_TYPE_ID.getType(), MACHINE_TYPE_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(DISK_TYPE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(MACHINE_TYPE, machineType); - } - - @Test - public void testListMachineTypes() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(machineTypeList.toArray(), Iterables.toArray(page.getValues(), - MachineType.class)); - } - - @Test - public void testListMachineTypesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); - ImmutableList nextMachineTypeList = ImmutableList.of(MACHINE_TYPE); - Tuple> - nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextMachineTypeList, MachineType.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), nextOptions)) - .andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(machineTypeList.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextMachineTypeList.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - } - - @Test - public void testListEmptyMachineTypes() { - ImmutableList machineTypes = - ImmutableList.of(); - Tuple> result = - Tuple.>of( - null, - machineTypes); - EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone()); - assertNull(page.getNextPageToken()); - assertArrayEquals(machineTypes.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - } - - @Test - public void testListMachineTypesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); - EasyMock.expect( - computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone(), - MACHINE_TYPE_LIST_PAGE_SIZE, MACHINE_TYPE_LIST_PAGE_TOKEN, MACHINE_TYPE_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(machineTypeList.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - } - - @Test - public void testAggregatedListMachineTypes() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listMachineTypes(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listMachineTypes(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(machineTypeList.toArray(), Iterables.toArray(page.getValues(), - MachineType.class)); - } - - @Test - public void testAggregatedListMachineTypesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); - ImmutableList nextMachineTypeList = ImmutableList.of(MACHINE_TYPE); - Tuple> - nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextMachineTypeList, MachineType.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listMachineTypes(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listMachineTypes(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listMachineTypes(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(machineTypeList.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextMachineTypeList.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - } - - @Test - public void testAggregatedListEmptyMachineTypes() { - ImmutableList machineTypes = - ImmutableList.of(); - Tuple> result = - Tuple.>of( - null, - machineTypes); - EasyMock.expect(computeRpcMock.listMachineTypes(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listMachineTypes(); - assertNull(page.getNextPageToken()); - assertArrayEquals(machineTypes.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - } - - @Test - public void testAggregatedListMachineTypesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listMachineTypes(MACHINE_TYPE_AGGREGATED_LIST_PAGE_SIZE, - MACHINE_TYPE_AGGREGATED_LIST_PAGE_TOKEN, MACHINE_TYPE_AGGREGATED_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(machineTypeList.toArray(), - Iterables.toArray(page.getValues(), MachineType.class)); - } - - @Test - public void testGetRegion() { - EasyMock.expect(computeRpcMock.getRegion(REGION_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(REGION.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Region region = compute.getRegion(REGION_ID.getRegion()); - assertEquals(REGION, region); - } - - @Test - public void testGetRegion_Null() { - EasyMock.expect(computeRpcMock.getRegion(REGION_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getRegion(REGION_ID.getRegion())); - } - - @Test - public void testGetRegionWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getRegion(eq(REGION_ID.getRegion()), capture(capturedOptions))) - .andReturn(REGION.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Region region = compute.getRegion(REGION_ID.getRegion(), REGION_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(REGION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(REGION, region); - } - - @Test - public void testListRegions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList regionList = ImmutableList.of(REGION, REGION); - Tuple> result = - Tuple.of(cursor, Iterables.transform(regionList, Region.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listRegions(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listRegions(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(regionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); - } - - @Test - public void testListRegionsNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList regionList = ImmutableList.of(REGION, REGION); - ImmutableList nextRegionList = ImmutableList.of(REGION); - Tuple> result = - Tuple.of(cursor, Iterables.transform(regionList, Region.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, Iterables.transform(nextRegionList, Region.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listRegions(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listRegions(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listRegions(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(regionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextRegionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); - } - - @Test - public void testListEmptyRegions() { - ImmutableList regions = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - regions); - EasyMock.expect(computeRpcMock.listRegions(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listRegions(); - assertNull(page.getNextPageToken()); - assertArrayEquals(regions.toArray(), Iterables.toArray(page.getValues(), Region.class)); - } - - @Test - public void testListRegionsWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList regionList = ImmutableList.of(REGION, REGION); - Tuple> result = - Tuple.of(cursor, Iterables.transform(regionList, Region.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listRegions(REGION_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listRegions(REGION_LIST_PAGE_SIZE, REGION_LIST_PAGE_TOKEN, - REGION_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(regionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); - } - - @Test - public void testGetZone() { - EasyMock.expect(computeRpcMock.getZone(ZONE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(ZONE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Zone zone = compute.getZone(ZONE_ID.getZone()); - assertEquals(ZONE, zone); - } - - @Test - public void testGetZone_Null() { - EasyMock.expect(computeRpcMock.getZone(ZONE_ID.getZone(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getZone(ZONE_ID.getZone())); - } - - @Test - public void testGetZoneWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getZone(eq(ZONE_ID.getZone()), capture(capturedOptions))) - .andReturn(ZONE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Zone zone = compute.getZone(ZONE_ID.getZone(), ZONE_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(ZONE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(ZONE, zone); - } - - @Test - public void testListZones() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList zoneList = ImmutableList.of(ZONE, ZONE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(zoneList, Zone.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listZones(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listZones(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(zoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); - } - - @Test - public void testListZonesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList zoneList = ImmutableList.of(ZONE, ZONE); - ImmutableList nextZoneList = ImmutableList.of(ZONE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(zoneList, Zone.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, Iterables.transform(nextZoneList, Zone.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listZones(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listZones(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listZones(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(zoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextZoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); - } - - @Test - public void testListEmptyZones() { - ImmutableList zones = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - zones); - EasyMock.expect(computeRpcMock.listZones(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listZones(); - assertNull(page.getNextPageToken()); - assertArrayEquals(zones.toArray(), Iterables.toArray(page.getValues(), Zone.class)); - } - - @Test - public void testListZonesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList zoneList = ImmutableList.of(ZONE, ZONE); - Tuple> result = - Tuple.of(cursor, Iterables.transform(zoneList, Zone.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listZones(ZONE_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = - compute.listZones(ZONE_LIST_PAGE_SIZE, ZONE_LIST_PAGE_TOKEN, ZONE_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(zoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); - } - - @Test - public void testGetLicenseFromString() { - EasyMock.expect(computeRpcMock.getLicense(PROJECT, LICENSE_ID.getLicense(), EMPTY_RPC_OPTIONS)) - .andReturn(LICENSE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - License license = compute.getLicense(LICENSE_ID.getLicense()); - assertEquals(LICENSE, license); - } - - @Test - public void testGetLicenseFromString_Null() { - EasyMock.expect(computeRpcMock.getLicense(PROJECT, LICENSE_ID.getLicense(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getLicense(LICENSE_ID.getLicense())); - } - - @Test - public void testGetLicenseFromStringWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getLicense( - eq(PROJECT), eq(LICENSE_ID.getLicense()), capture(capturedOptions))) - .andReturn(LICENSE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - License license = compute.getLicense(LICENSE_ID.getLicense(), LICENSE_OPTION_FIELDS); - assertEquals(LICENSE, license); - String selector = (String) capturedOptions.getValue().get(LICENSE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("chargesUseFee")); - assertEquals(22, selector.length()); - assertEquals(LICENSE, license); - } - - @Test - public void testGetLicenseFromIdWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - LicenseId licenseId = LicenseId.of("project2", "license2"); - EasyMock.expect(computeRpcMock.getLicense( - eq(licenseId.getProject()), eq(licenseId.getLicense()), capture(capturedOptions))) - .andReturn(LICENSE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - License license = compute.getLicense(licenseId, LICENSE_OPTION_FIELDS); - assertEquals(LICENSE, license); - String selector = (String) capturedOptions.getValue().get(LICENSE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("chargesUseFee")); - assertEquals(22, selector.length()); - assertEquals(LICENSE, license); - } - - @Test - public void testGetLicenseFromId() { - LicenseId licenseId = LicenseId.of("project2", "license2"); - EasyMock.expect(computeRpcMock.getLicense(licenseId.getProject(), licenseId.getLicense(), - EMPTY_RPC_OPTIONS)).andReturn(LICENSE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - License license = compute.getLicense(licenseId); - assertEquals(LICENSE, license); - } - - @Test - public void testGetLicenseFromId_Null() { - LicenseId licenseId = LicenseId.of("project2", "license2"); - EasyMock.expect(computeRpcMock.getLicense( - licenseId.getProject(), licenseId.getLicense(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getLicense(licenseId)); - } - - @Test - public void testGetGlobalOperation() { - EasyMock.expect( - computeRpcMock.getGlobalOperation(GLOBAL_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(globalOperation, compute.getOperation(GLOBAL_OPERATION_ID)); - } - - @Test - public void testGetGlobalOperation_Null() { - EasyMock.expect( - computeRpcMock.getGlobalOperation(GLOBAL_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getOperation(GLOBAL_OPERATION_ID)); - } - - @Test - public void testGetGlobalOperationWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getGlobalOperation( - eq(GLOBAL_OPERATION_ID.getOperation()), capture(capturedOptions))) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.getOperation(GLOBAL_OPERATION_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testListGlobalOperations() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(globalOperation, globalOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listGlobalOperations(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listGlobalOperations(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListGlobalOperationsNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(globalOperation, globalOperation); - ImmutableList nextOperationList = ImmutableList.of(globalOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listGlobalOperations(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listGlobalOperations(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listGlobalOperations(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextOperationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListEmptyGlobalOperations() { - ImmutableList operations = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - operations); - EasyMock.expect(computeRpcMock.listGlobalOperations(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listGlobalOperations(); - assertNull(page.getNextPageToken()); - assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListGlobalOperationsWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(globalOperation, globalOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listGlobalOperations(OPERATION_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listGlobalOperations(OPERATION_LIST_PAGE_SIZE, - OPERATION_LIST_PAGE_TOKEN, OPERATION_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testDeleteGlobalOperation_True() { - EasyMock.expect(computeRpcMock.deleteGlobalOperation(GLOBAL_OPERATION_ID.getOperation())) - .andReturn(true); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertTrue(compute.deleteOperation(GLOBAL_OPERATION_ID)); - } - - @Test - public void testDeleteGlobalOperation_False() { - EasyMock.expect(computeRpcMock.deleteGlobalOperation(GLOBAL_OPERATION_ID.getOperation())) - .andReturn(false); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertFalse(compute.deleteOperation(GLOBAL_OPERATION_ID)); - } - - @Test - public void testGetRegionOperation() { - EasyMock.expect(computeRpcMock.getRegionOperation(REGION_OPERATION_ID.getRegion(), - REGION_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) - .andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.getOperation(REGION_OPERATION_ID); - assertEquals(regionOperation, operation); - } - - @Test - public void testGetRegionOperation_Null() { - EasyMock.expect(computeRpcMock.getRegionOperation(REGION_OPERATION_ID.getRegion(), - REGION_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) - .andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.getOperation(REGION_OPERATION_ID); - assertEquals(regionOperation, operation); - } - - @Test - public void testGetRegionOperationWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getRegionOperation(eq(REGION_OPERATION_ID.getRegion()), - eq(REGION_OPERATION_ID.getOperation()), capture(capturedOptions))) - .andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.getOperation(REGION_OPERATION_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(regionOperation, operation); - } - - @Test - public void testListRegionOperations() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(regionOperation, regionOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - EasyMock.expect( - computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListRegionOperationsNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(regionOperation, regionOperation); - ImmutableList nextOperationList = ImmutableList.of(regionOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), - EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), - nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextOperationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListEmptyRegionOperations() { - ImmutableList operations = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - operations); - EasyMock.expect( - computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion()); - assertNull(page.getNextPageToken()); - assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListRegionOperationsWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(regionOperation, regionOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listRegionOperations( - REGION_OPERATION_ID.getRegion(), OPERATION_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion(), - OPERATION_LIST_PAGE_SIZE, OPERATION_LIST_PAGE_TOKEN, OPERATION_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testDeleteRegionOperation_True() { - EasyMock.expect(computeRpcMock.deleteRegionOperation(REGION_OPERATION_ID.getRegion(), - REGION_OPERATION_ID.getOperation())).andReturn(true); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertTrue(compute.deleteOperation(REGION_OPERATION_ID)); - } - - @Test - public void testDeleteRegionOperation_False() { - EasyMock.expect(computeRpcMock.deleteRegionOperation(REGION_OPERATION_ID.getRegion(), - REGION_OPERATION_ID.getOperation())).andReturn(false); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertFalse(compute.deleteOperation(REGION_OPERATION_ID)); - } - - @Test - public void testGetZoneOperation() { - EasyMock.expect(computeRpcMock.getZoneOperation(ZONE_OPERATION_ID.getZone(), - ZONE_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.getOperation(ZONE_OPERATION_ID); - assertEquals(zoneOperation, operation); - } - - @Test - public void testGetZoneOperation_Null() { - EasyMock.expect(computeRpcMock.getZoneOperation(ZONE_OPERATION_ID.getZone(), - ZONE_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getOperation(ZONE_OPERATION_ID)); - } - - @Test - public void testGetZoneOperationWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getZoneOperation(eq(ZONE_OPERATION_ID.getZone()), - eq(ZONE_OPERATION_ID.getOperation()), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.getOperation(ZONE_OPERATION_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testListZoneOperations() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(zoneOperation, zoneOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - EasyMock.expect( - computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListZoneOperationsNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(zoneOperation, zoneOperation); - ImmutableList nextOperationList = ImmutableList.of(zoneOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listZoneOperations( - ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect(computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), nextOptions)) - .andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextOperationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListEmptyZoneOperations() { - ImmutableList operations = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - operations); - EasyMock.expect( - computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone()); - assertNull(page.getNextPageToken()); - assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testListZoneOperationsWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList operationList = ImmutableList.of(zoneOperation, zoneOperation); - Tuple> result = - Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); - EasyMock.expect( - computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), OPERATION_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone(), - OPERATION_LIST_PAGE_SIZE, OPERATION_LIST_PAGE_TOKEN, OPERATION_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(operationList.toArray(), - Iterables.toArray(page.getValues(), Operation.class)); - } - - @Test - public void testDeleteZoneOperation_True() { - EasyMock.expect(computeRpcMock.deleteZoneOperation(ZONE_OPERATION_ID.getZone(), - ZONE_OPERATION_ID.getOperation())).andReturn(true); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertTrue(compute.deleteOperation(ZONE_OPERATION_ID)); - } - - @Test - public void testDeleteZoneOperation_False() { - EasyMock.expect(computeRpcMock.deleteZoneOperation(ZONE_OPERATION_ID.getZone(), - ZONE_OPERATION_ID.getOperation())).andReturn(false); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertFalse(compute.deleteOperation(ZONE_OPERATION_ID)); - } - - @Test - public void testGetGlobalAddress() { - EasyMock.expect(computeRpcMock.getGlobalAddress( - GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) - .andReturn(GLOBAL_ADDRESS.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Address address = compute.getAddress(GLOBAL_ADDRESS_ID); - assertEquals(new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), address); - } - - @Test - public void testGetGlobalAddress_Null() { - EasyMock.expect(computeRpcMock.getGlobalAddress( - GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getAddress(GLOBAL_ADDRESS_ID)); - } - - @Test - public void testGetGlobalAddressWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getGlobalAddress( - eq(GLOBAL_ADDRESS_ID.getAddress()), capture(capturedOptions))) - .andReturn(GLOBAL_ADDRESS.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Address address = compute.getAddress(GLOBAL_ADDRESS_ID, ADDRESS_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(ADDRESS_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), address); - } - - @Test - public void testGetRegionAddress() { - EasyMock.expect(computeRpcMock.getRegionAddress(REGION_ADDRESS_ID.getRegion(), - REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(REGION_ADDRESS.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Address address = compute.getAddress(REGION_ADDRESS_ID); - assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); - } - - @Test - public void testGetRegionAddress_Null() { - EasyMock.expect(computeRpcMock.getRegionAddress(REGION_ADDRESS_ID.getRegion(), - REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(REGION_ADDRESS.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Address address = compute.getAddress(REGION_ADDRESS_ID); - assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); - } - - @Test - public void testGetRegionAddressWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getRegionAddress(eq(REGION_ADDRESS_ID.getRegion()), - eq(REGION_ADDRESS_ID.getAddress()), capture(capturedOptions))) - .andReturn(REGION_ADDRESS.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Address address = compute.getAddress(REGION_ADDRESS_ID, ADDRESS_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(ADDRESS_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); - } - - @Test - public void testDeleteGlobalAddress_Operation() { - EasyMock.expect(computeRpcMock.deleteGlobalAddress( - GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(globalOperation, compute.deleteAddress(GLOBAL_ADDRESS_ID)); - } - - @Test - public void testDeleteGlobalAddressWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteGlobalAddress(eq(GLOBAL_ADDRESS_ID.getAddress()), - capture(capturedOptions))).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteAddress(GLOBAL_ADDRESS_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testDeleteGlobalAddress_Null() { - EasyMock.expect(computeRpcMock.deleteGlobalAddress( - GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteAddress(GLOBAL_ADDRESS_ID)); - } - - @Test - public void testDeleteRegionAddress_Operation() { - EasyMock.expect(computeRpcMock.deleteRegionAddress(REGION_ADDRESS_ID.getRegion(), - REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(regionOperation, compute.deleteAddress(REGION_ADDRESS_ID)); - } - - @Test - public void testDeleteRegionAddressWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteRegionAddress(eq(REGION_ADDRESS_ID.getRegion()), - eq(REGION_ADDRESS_ID.getAddress()), capture(capturedOptions))) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteAddress(REGION_ADDRESS_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testDeleteRegionAddress_Null() { - EasyMock.expect(computeRpcMock.deleteRegionAddress(REGION_ADDRESS_ID.getRegion(), - REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteAddress(REGION_ADDRESS_ID)); - } - - @Test - public void testListGlobalAddresses() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listGlobalAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page
page = compute.listGlobalAddresses(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListGlobalAddressesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); - ImmutableList
nextAddressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextAddressList, AddressInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listGlobalAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listGlobalAddresses(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page
page = compute.listGlobalAddresses(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextAddressList.toArray(), - Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListEmptyGlobalAddresses() { - ImmutableList addresses = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - addresses); - EasyMock.expect(computeRpcMock.listGlobalAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page
page = compute.listGlobalAddresses(); - assertNull(page.getNextPageToken()); - assertArrayEquals(addresses.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListGlobalAddressesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listGlobalAddresses(ADDRESS_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page
page = compute.listGlobalAddresses(ADDRESS_LIST_PAGE_SIZE, - ADDRESS_LIST_PAGE_TOKEN, ADDRESS_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListRegionAddresses() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - EasyMock.expect( - computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListRegionAddressesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - ImmutableList
nextAddressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextAddressList, AddressInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect( - computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect( - computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), nextOptions)) - .andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextAddressList.toArray(), - Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListEmptyRegionAddresses() { - ImmutableList addresses = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - addresses); - EasyMock.expect( - computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion()); - assertNull(page.getNextPageToken()); - assertArrayEquals(addresses.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testListRegionAddressesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - EasyMock.expect( - computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), ADDRESS_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), - ADDRESS_LIST_PAGE_SIZE, ADDRESS_LIST_PAGE_TOKEN, ADDRESS_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testAggregatedListAddresses() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page
page = compute.listAddresses(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testAggregatedListAddressesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - ImmutableList
nextAddressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextAddressList, AddressInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listAddresses(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page
page = compute.listAddresses(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextAddressList.toArray(), - Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testAggregatedListEmptyAddresses() { - ImmutableList addresses = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - addresses); - EasyMock.expect(computeRpcMock.listAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Page
page = compute.listAddresses(); - assertNull(page.getNextPageToken()); - assertArrayEquals(addresses.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testAggregatedListAddressesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList
addressList = ImmutableList.of( - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), - new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listAddresses(ADDRESS_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page
page = compute.listAddresses(ADDRESS_AGGREGATED_LIST_PAGE_SIZE, - ADDRESS_AGGREGATED_LIST_PAGE_TOKEN, ADDRESS_AGGREGATED_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); - } - - @Test - public void testCreateGlobalAddress() { - EasyMock.expect(computeRpcMock.createGlobalAddress(GLOBAL_ADDRESS.toPb(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - AddressId incompleteId = GlobalAddressId.of("address"); - Operation operation = - compute.create(GLOBAL_ADDRESS.toBuilder().setAddressId(incompleteId).build()); - assertEquals(globalOperation, operation); - } - - @Test - public void testCreateGlobalAddressWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect( - computeRpcMock.createGlobalAddress(eq(GLOBAL_ADDRESS.toPb()), capture(capturedOptions))) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(GLOBAL_ADDRESS, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testCreateRegionAddress() { - EasyMock.expect(computeRpcMock.createRegionAddress(REGION_ADDRESS_ID.getRegion(), - REGION_ADDRESS.toPb(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - AddressId incompleteId = RegionAddressId.of("region", "address"); - Operation operation = - compute.create(REGION_ADDRESS.toBuilder().setAddressId(incompleteId).build()); - assertEquals(regionOperation, operation); - } - - @Test - public void testCreateRegionAddressWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createRegionAddress(eq(REGION_ADDRESS_ID.getRegion()), - eq(REGION_ADDRESS.toPb()), capture(capturedOptions))).andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(REGION_ADDRESS, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(regionOperation, operation); - } - - @Test - public void testCreateSnapshot() { - EasyMock.expect(computeRpcMock.createSnapshot(DISK_ID.getZone(), DISK_ID.getDisk(), - SNAPSHOT_ID.getSnapshot(), null, EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(SNAPSHOT); - assertEquals(zoneOperation, operation); - } - - @Test - public void testCreateSnapshotWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createSnapshot(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), - eq(SNAPSHOT_ID.getSnapshot()), EasyMock.isNull(), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(SNAPSHOT, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testGetSnapshot() { - EasyMock.expect(computeRpcMock.getSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) - .andReturn(SNAPSHOT.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Snapshot snapshot = compute.getSnapshot(SNAPSHOT_ID.getSnapshot()); - assertEquals(new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), snapshot); - } - - @Test - public void testGetSnapshot_Null() { - EasyMock.expect(computeRpcMock.getSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getSnapshot(SNAPSHOT_ID.getSnapshot())); - } - - @Test - public void testGetSnapshotWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getSnapshot(eq(SNAPSHOT_ID.getSnapshot()), - capture(capturedOptions))).andReturn(SNAPSHOT.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Snapshot snapshot = compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), SNAPSHOT_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(SNAPSHOT_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), snapshot); - } - - @Test - public void testDeleteSnapshot_Operation() { - EasyMock.expect(computeRpcMock.deleteSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(globalOperation, compute.deleteSnapshot(SNAPSHOT_ID.getSnapshot())); - } - - @Test - public void testDeleteSnapshotWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteSnapshot(eq(SNAPSHOT_ID.getSnapshot()), - capture(capturedOptions))).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteSnapshot(SNAPSHOT_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testDeleteSnapshot_Null() { - EasyMock.expect(computeRpcMock.deleteSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteSnapshot(SNAPSHOT_ID)); - } - - @Test - public void testListSnapshots() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList snapshotList = ImmutableList.of( - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(snapshotList, SnapshotInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listSnapshots(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSnapshots(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(snapshotList.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); - } - - @Test - public void testListSnapshotsNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList snapshotList = ImmutableList.of( - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); - ImmutableList nextSnapshotList = ImmutableList.of( - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(snapshotList, SnapshotInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextSnapshotList, SnapshotInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listSnapshots(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listSnapshots(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listSnapshots(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(snapshotList.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextSnapshotList.toArray(), - Iterables.toArray(page.getValues(), Snapshot.class)); - } - - @Test - public void testListEmptySnapshots() { - compute = options.getService(); - ImmutableList snapshots = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - snapshots); - EasyMock.expect(computeRpcMock.listSnapshots(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSnapshots(); - assertNull(page.getNextPageToken()); - assertArrayEquals(snapshots.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); - } - - @Test - public void testListSnapshotsWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList snapshotList = ImmutableList.of( - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), - new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(snapshotList, SnapshotInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listSnapshots(SNAPSHOT_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSnapshots(SNAPSHOT_LIST_PAGE_SIZE, SNAPSHOT_LIST_PAGE_TOKEN, - SNAPSHOT_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(snapshotList.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); - } - - @Test - public void testCreateImage() { - EasyMock.expect(computeRpcMock.createImage(IMAGE.toPb(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(IMAGE); - assertEquals(globalOperation, operation); - } - - @Test - public void testCreateImageWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createImage(eq(IMAGE.toPb()), capture(capturedOptions))) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(IMAGE, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testGetImage() { - EasyMock.expect( - computeRpcMock.getImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), EMPTY_RPC_OPTIONS)) - .andReturn(IMAGE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Image image = compute.getImage(IMAGE_ID); - assertEquals(new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), image); - } - - @Test - public void testGetImage_Null() { - EasyMock.expect( - computeRpcMock.getImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getImage(IMAGE_ID)); - } - - @Test - public void testGetImageWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getImage(eq(IMAGE_ID.getProject()), eq(IMAGE_ID.getImage()), - capture(capturedOptions))).andReturn(IMAGE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Image image = compute.getImage(IMAGE_ID, IMAGE_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(IMAGE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("sourceDisk")); - assertTrue(selector.contains("rawDisk")); - assertTrue(selector.contains("description")); - assertEquals(42, selector.length()); - assertEquals(new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), image); - } - - @Test - public void testDeleteImage_Operation() { - EasyMock.expect(computeRpcMock.deleteImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), - EMPTY_RPC_OPTIONS)).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(globalOperation, compute.deleteImage(IMAGE_ID)); - } - - @Test - public void testDeleteImageWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteImage(eq(PROJECT), eq(IMAGE_ID.getImage()), - capture(capturedOptions))).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteImage(ImageId.of("image"), OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testDeleteImage_Null() { - EasyMock.expect(computeRpcMock.deleteImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteImage(IMAGE_ID)); - } - - @Test - public void testDeprecateImage_Operation() { - EasyMock.expect(computeRpcMock.deprecateImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), - DEPRECATION_STATUS.toPb(), EMPTY_RPC_OPTIONS)).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(globalOperation, compute.deprecate(IMAGE_ID, DEPRECATION_STATUS)); - } - - @Test - public void testDeprecateImageWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deprecateImage(eq(PROJECT), eq(IMAGE_ID.getImage()), - eq(DEPRECATION_STATUS.toPb()), capture(capturedOptions))).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = - compute.deprecate(ImageId.of("image"), DEPRECATION_STATUS, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testDeprecateImage_Null() { - EasyMock.expect(computeRpcMock.deprecateImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), - DEPRECATION_STATUS.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deprecate(IMAGE_ID, DEPRECATION_STATUS)); - } - - @Test - public void testListImages() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList imageList = ImmutableList.of( - new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), - new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listImages(PROJECT, EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testListImagesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList imageList = ImmutableList.of( - new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), - new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); - ImmutableList nextImageList = ImmutableList.of( - new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextImageList, ImageInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listImages(PROJECT, EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listImages(PROJECT, nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextImageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testListImagesForProject() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList imageList = ImmutableList.of( - new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), - new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listImages("otherProject", EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages("otherProject"); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testListEmptyImages() { - compute = options.getService(); - ImmutableList images = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - images); - EasyMock.expect(computeRpcMock.listImages(PROJECT, EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages(); - assertNull(page.getNextPageToken()); - assertArrayEquals(images.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testListEmptyImagesForProject() { - compute = options.getService(); - ImmutableList images = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - images); - EasyMock.expect(computeRpcMock.listImages("otherProject", EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages("otherProject"); - assertNull(page.getNextPageToken()); - assertArrayEquals(images.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testListImagesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList imageList = ImmutableList.of( - new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), - new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listImages(PROJECT, IMAGE_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages(IMAGE_LIST_PAGE_SIZE, IMAGE_LIST_PAGE_TOKEN, - IMAGE_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testListImagesForProjectWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList imageList = ImmutableList.of( - new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), - new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listImages("other", IMAGE_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listImages("other", IMAGE_LIST_PAGE_SIZE, IMAGE_LIST_PAGE_TOKEN, - IMAGE_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); - } - - @Test - public void testGetDisk() { - EasyMock.expect(computeRpcMock.getDisk(DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) - .andReturn(DISK.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Disk disk = compute.getDisk(DISK_ID); - assertEquals(new Disk(compute, new DiskInfo.BuilderImpl(DISK)), disk); - } - - @Test - public void testGetDisk_Null() { - EasyMock.expect(computeRpcMock.getDisk(DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getDisk(DISK_ID)); - } - - @Test - public void testGetDiskWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getDisk(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), - capture(capturedOptions))).andReturn(DISK.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Disk disk = compute.getDisk(DISK_ID, DISK_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(DISK_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("type")); - assertTrue(selector.contains("sourceImage")); - assertTrue(selector.contains("sourceSnapshot")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(55, selector.length()); - assertEquals(new Disk(compute, new DiskInfo.BuilderImpl(DISK)), disk); - } - - @Test - public void testDeleteDisk_Operation() { - EasyMock.expect(computeRpcMock.deleteDisk( - DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.deleteDisk(DISK_ID)); - } - - @Test - public void testDeleteDiskWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteDisk(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteDisk(DISK_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testDeleteDisk_Null() { - EasyMock.expect(computeRpcMock.deleteDisk( - DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteDisk(DISK_ID)); - } - - @Test - public void testListDisks() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK)), - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(DISK_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testListDisksNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList diskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK)), - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - ImmutableList nextDiskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, Iterables.transform(nextDiskList, DiskInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(DISK_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextDiskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testListEmptyDisks() { - compute = options.getService(); - ImmutableList disks = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - disks); - EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(DISK_ID.getZone()); - assertNull(page.getNextPageToken()); - assertArrayEquals(disks.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testListDisksWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK)), - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), DISK_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks( - DISK_ID.getZone(), DISK_LIST_PAGE_SIZE, DISK_LIST_PAGE_TOKEN, DISK_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testAggregatedListDisks() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK)), - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDisks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testAggregatedListDisksNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList diskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK)), - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - ImmutableList nextDiskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, Iterables.transform(nextDiskList, DiskInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listDisks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listDisks(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextDiskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testAggregatedListEmptyDisks() { - compute = options.getService(); - ImmutableList diskList = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - diskList); - EasyMock.expect(computeRpcMock.listDisks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(); - assertNull(page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testAggregatedListDisksWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList diskList = ImmutableList.of( - new Disk(compute, new DiskInfo.BuilderImpl(DISK)), - new Disk(compute, new DiskInfo.BuilderImpl(DISK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listDisks(DISK_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listDisks(DISK_AGGREGATED_LIST_PAGE_SIZE, - DISK_AGGREGATED_LIST_PAGE_TOKEN, DISK_AGGREGATED_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); - } - - @Test - public void testCreateDisk() { - EasyMock.expect(computeRpcMock.createDisk(DISK_ID.getZone(), DISK.toPb(), EMPTY_RPC_OPTIONS)) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - DiskId diskId = DiskId.of("zone", "disk"); - DiskTypeId diskTypeId = DiskTypeId.of("zone", "diskType"); - DiskInfo disk = DISK.toBuilder() - .setDiskId(diskId) - .setConfiguration(StandardDiskConfiguration.of(diskTypeId)) - .build(); - Operation operation = compute.create(disk); - assertEquals(zoneOperation, operation); - } - - @Test - public void testCreateDiskWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createDisk(eq(DISK_ID.getZone()), eq(DISK.toPb()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(DISK, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testResizeDisk_Operation() { - EasyMock.expect(computeRpcMock.resizeDisk(DISK_ID.getZone(), DISK_ID.getDisk(), 42L, - EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.resize(DISK_ID, 42L)); - } - - @Test - public void testResizeDiskWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.resizeDisk(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), eq(42L), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.resize(DISK_ID, 42L, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testResizeDisk_Null() { - EasyMock.expect(computeRpcMock.resizeDisk(DISK_ID.getZone(), DISK_ID.getDisk(), 42L, - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.resize(DISK_ID, 42L)); - } - - @Test - public void testGetSubnetwork() { - EasyMock.expect(computeRpcMock.getSubnetwork( - SUBNETWORK_ID.getRegion(), SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)) - .andReturn(SUBNETWORK.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Subnetwork subnetwork = compute.getSubnetwork(SUBNETWORK_ID); - assertEquals(new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), subnetwork); - } - - @Test - public void testGetSubnetwork_Null() { - EasyMock.expect(computeRpcMock.getSubnetwork( - SUBNETWORK_ID.getRegion(), SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getSubnetwork(SUBNETWORK_ID)); - } - - @Test - public void testGetSubnetworkWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getSubnetwork(eq(SUBNETWORK_ID.getRegion()), - eq(SUBNETWORK_ID.getSubnetwork()), capture(capturedOptions))).andReturn(SUBNETWORK.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Subnetwork subnetwork = compute.getSubnetwork(SUBNETWORK_ID, SUBNETWORK_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(SUBNETWORK_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), subnetwork); - } - - @Test - public void testDeleteSubnetwork_Operation() { - EasyMock.expect(computeRpcMock.deleteSubnetwork(SUBNETWORK_ID.getRegion(), - SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(regionOperation, compute.deleteSubnetwork(SUBNETWORK_ID)); - } - - @Test - public void testDeleteSubnetworkWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteSubnetwork(eq(SUBNETWORK_ID.getRegion()), - eq(SUBNETWORK_ID.getSubnetwork()), capture(capturedOptions))) - .andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteSubnetwork(SUBNETWORK_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(regionOperation, operation); - } - - @Test - public void testDeleteSubnetwork_Null() { - EasyMock.expect(computeRpcMock.deleteSubnetwork(SUBNETWORK_ID.getRegion(), - SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteSubnetwork(SUBNETWORK_ID)); - } - - @Test - public void testListSubnetworks() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList subnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(subnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testListSubnetworksNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList subnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - ImmutableList nextSubnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - Tuple> - nextResult = Tuple.of(nextCursor, - Iterables.transform(nextSubnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), nextOptions)) - .andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(subnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextSubnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testListEmptySubnetworks() { - compute = options.getService(); - ImmutableList subnetworks = - ImmutableList.of(); - Tuple> result = - Tuple.>of( - null, - subnetworks); - EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion()); - assertNull(page.getNextPageToken()); - assertArrayEquals(subnetworks.toArray(), Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testListSubnetworksWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList subnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listSubnetworks( - SUBNETWORK_ID.getRegion(), SUBNETWORK_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion(), - SUBNETWORK_LIST_PAGE_SIZE, SUBNETWORK_LIST_PAGE_TOKEN, SUBNETWORK_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(subnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testAggregatedListSubnetworks() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList subnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listSubnetworks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(subnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testAggregatedListSubnetworksNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList subnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - ImmutableList nextSubnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - Tuple> - nextResult = Tuple.of(nextCursor, - Iterables.transform(nextSubnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listSubnetworks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listSubnetworks(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(subnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextSubnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testAggregatedListEmptySubnetworks() { - compute = options.getService(); - ImmutableList subnetworks = - ImmutableList.of(); - Tuple> result = - Tuple.>of( - null, - subnetworks); - EasyMock.expect(computeRpcMock.listSubnetworks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(); - assertNull(page.getNextPageToken()); - assertArrayEquals(subnetworks.toArray(), Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testAggregatedListSubnetworksWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList subnetworkList = ImmutableList.of( - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), - new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); - Tuple> result = - Tuple.of(cursor, - Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listSubnetworks(SUBNETWORK_AGGREGATED_LIST_PAGE_SIZE, - SUBNETWORK_AGGREGATED_LIST_PAGE_TOKEN, SUBNETWORK_AGGREGATED_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(subnetworkList.toArray(), - Iterables.toArray(page.getValues(), Subnetwork.class)); - } - - @Test - public void testCreateSubnetwork() { - EasyMock.expect(computeRpcMock.createSubnetwork(SUBNETWORK_ID.getRegion(), SUBNETWORK.toPb(), - EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - SubnetworkId subnetworkId = SubnetworkId.of("region", "network"); - NetworkId networkId = NetworkId.of("network"); - SubnetworkInfo subnetwork = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); - Operation operation = compute.create(subnetwork); - assertEquals(regionOperation, operation); - } - - @Test - public void testCreateSubnetworkWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createSubnetwork(eq(SUBNETWORK_ID.getRegion()), - eq(SUBNETWORK.toPb()), capture(capturedOptions))).andReturn(regionOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(SUBNETWORK, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(regionOperation, operation); - } - - @Test - public void testGetNetwork() { - EasyMock.expect(computeRpcMock.getNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) - .andReturn(NETWORK.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Network network = compute.getNetwork(NETWORK_ID.getNetwork()); - assertEquals(new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), network); - } - - @Test - public void testGetNetwork_Null() { - EasyMock.expect(computeRpcMock.getNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getNetwork(NETWORK_ID.getNetwork())); - } - - @Test - public void testGetNetworkWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getNetwork(eq( - NETWORK_ID.getNetwork()), capture(capturedOptions))) - .andReturn(NETWORK.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Network network = compute.getNetwork(NETWORK_ID.getNetwork(), NETWORK_OPTION_FIELDS); - String selector = (String) capturedOptions.getValue().get(NETWORK_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertTrue(selector.contains("IPv4Range")); - assertTrue(selector.contains("autoCreateSubnetworks")); - assertEquals(55, selector.length()); - assertEquals(new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), network); - } - - @Test - public void testDeleteNetwork_Operation() { - EasyMock.expect(computeRpcMock.deleteNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(globalOperation, compute.deleteNetwork(NETWORK_ID)); - } - - @Test - public void testDeleteNetworkWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteNetwork(eq(NETWORK_ID.getNetwork()), - capture(capturedOptions))).andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteNetwork(NETWORK_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testDeleteNetwork_Null() { - EasyMock.expect(computeRpcMock.deleteNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteNetwork(NETWORK_ID)); - } - - @Test - public void testListNetworks() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList networkList = ImmutableList.of( - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(networkList, NetworkInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listNetworks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listNetworks(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(networkList.toArray(), Iterables.toArray(page.getValues(), Network.class)); - } - - @Test - public void testListNetworksNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList networkList = ImmutableList.of( - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); - ImmutableList nextNetworkList = ImmutableList.of( - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(networkList, NetworkInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextNetworkList, NetworkInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listNetworks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listNetworks(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listNetworks(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(networkList.toArray(), Iterables.toArray(page.getValues(), Network.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextNetworkList.toArray(), - Iterables.toArray(page.getValues(), Network.class)); - } - - @Test - public void testListEmptyNetworks() { - compute = options.getService(); - ImmutableList networks = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - networks); - EasyMock.expect(computeRpcMock.listNetworks(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listNetworks(); - assertNull(page.getNextPageToken()); - assertArrayEquals(networks.toArray(), Iterables.toArray(page.getValues(), Network.class)); - } - - @Test - public void testListNetworksWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList networkList = ImmutableList.of( - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), - new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(networkList, NetworkInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listNetworks(NETWORK_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listNetworks(NETWORK_LIST_PAGE_SIZE, NETWORK_LIST_PAGE_TOKEN, - NETWORK_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(networkList.toArray(), Iterables.toArray(page.getValues(), Network.class)); - } - - @Test - public void testCreateNetwork() { - EasyMock.expect(computeRpcMock.createNetwork(NETWORK.toPb(), EMPTY_RPC_OPTIONS)) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - NetworkInfo network = - NetworkInfo.of(NetworkId.of("network"), StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(network); - assertEquals(globalOperation, operation); - } - - @Test - public void testCreateNetworkWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createNetwork(eq(NETWORK.toPb()), capture(capturedOptions))) - .andReturn(globalOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(NETWORK, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(globalOperation, operation); - } - - @Test - public void testGetInstance() { - EasyMock.expect(computeRpcMock.getInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(INSTANCE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Instance instance = compute.getInstance(INSTANCE_ID); - assertEquals(new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), instance); - } - - @Test - public void testGetInstance_Null() { - EasyMock.expect(computeRpcMock.getInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getInstance(INSTANCE_ID)); - } - - @Test - public void testGetInstanceWithSelectedFields() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.getInstance( - eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), capture(capturedOptions))) - .andReturn(INSTANCE.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Instance instance = compute.getInstance(INSTANCE_ID, INSTANCE_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(INSTANCE_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), instance); - } - - @Test - public void testDeleteInstance_Operation() { - EasyMock.expect(computeRpcMock.deleteInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.deleteInstance(INSTANCE_ID)); - } - - @Test - public void testDeleteInstanceWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteInstance(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteInstance(INSTANCE_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testDeleteInstance_Null() { - EasyMock.expect(computeRpcMock.deleteInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteInstance(INSTANCE_ID)); - } - - @Test - public void testListInstances() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(INSTANCE_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testListInstancesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - ImmutableList nextInstanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextInstanceList, InstanceInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), nextOptions)) - .andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(INSTANCE_ID.getZone()); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextInstanceList.toArray(), - Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testListEmptyInstances() { - compute = options.getService(); - ImmutableList instances = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - instances); - EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), EMPTY_RPC_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(INSTANCE_ID.getZone()); - assertNull(page.getNextPageToken()); - assertArrayEquals(instances.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testListInstancesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), INSTANCE_LIST_OPTIONS)) - .andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(INSTANCE_ID.getZone(), INSTANCE_LIST_PAGE_SIZE, - INSTANCE_LIST_PAGE_TOKEN, INSTANCE_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testAggregatedListInstances() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listInstances(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testAggregatedListInstancesNextPage() { - String cursor = "cursor"; - String nextCursor = "nextCursor"; - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - ImmutableList nextInstanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); - Tuple> nextResult = - Tuple.of(nextCursor, - Iterables.transform(nextInstanceList, InstanceInfo.TO_PB_FUNCTION)); - Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); - EasyMock.expect(computeRpcMock.listInstances(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.expect(computeRpcMock.listInstances(nextOptions)).andReturn(nextResult); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - page = page.getNextPage(); - assertEquals(nextCursor, page.getNextPageToken()); - assertArrayEquals(nextInstanceList.toArray(), - Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testAggregatedListEmptyInstances() { - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of(); - Tuple> result = - Tuple.>of(null, - instanceList); - EasyMock.expect(computeRpcMock.listInstances(EMPTY_RPC_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(); - assertNull(page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testAggregatedListInstancesWithOptions() { - String cursor = "cursor"; - compute = options.getService(); - ImmutableList instanceList = ImmutableList.of( - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), - new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); - Tuple> result = - Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); - EasyMock.expect(computeRpcMock.listInstances(INSTANCE_LIST_OPTIONS)).andReturn(result); - EasyMock.replay(computeRpcMock); - Page page = compute.listInstances(INSTANCE_AGGREGATED_LIST_PAGE_SIZE, - INSTANCE_AGGREGATED_LIST_PAGE_TOKEN, INSTANCE_AGGREGATED_LIST_FILTER); - assertEquals(cursor, page.getNextPageToken()); - assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); - } - - @Test - public void testCreateInstance() { - EasyMock.expect(computeRpcMock.createInstance(INSTANCE_ID.getZone(), INSTANCE.toPb(), - EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - InstanceInfo instance = InstanceInfo.of(InstanceId.of("zone", "instance"), - MachineTypeId.of("zone", "type"), ATTACHED_DISK, - NetworkInterface.of(NetworkId.of("network"))); - Operation operation = compute.create(instance); - assertEquals(zoneOperation, operation); - } - - @Test - public void testCreateInstanceWithOptions() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.createInstance(eq(INSTANCE_ID.getZone()), eq(INSTANCE.toPb()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.create(INSTANCE, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testAddAccessConfig_Operation() { - AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); - EasyMock.expect(computeRpcMock.addAccessConfig(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - "networkInterface", accessConfig.toPb(), EMPTY_RPC_OPTIONS)) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, - compute.addAccessConfig(INSTANCE_ID, "networkInterface", accessConfig)); - } - - @Test - public void testAddAccessConfigWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); - EasyMock.expect(computeRpcMock.addAccessConfig(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq("networkInterface"), eq(accessConfig.toPb()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.addAccessConfig(INSTANCE_ID, "networkInterface", accessConfig, - OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testAddAccessConfig_Null() { - AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); - EasyMock.expect(computeRpcMock.addAccessConfig(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - "networkInterface", accessConfig.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.addAccessConfig(INSTANCE_ID, "networkInterface", accessConfig)); - } - - @Test - public void testAttachDisk_Operation() { - AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); - EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.attachDisk(INSTANCE_ID, PERSISTENT_DISK_CONFIGURATION)); - } - - @Test - public void testAttachDiskWithSelectedFields_Operation() { - AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.attachDisk( - eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), eq(attachedDisk.toPb()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = - compute.attachDisk(INSTANCE_ID, PERSISTENT_DISK_CONFIGURATION, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testAttachDisk_Null() { - AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); - EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.attachDisk(INSTANCE_ID, PERSISTENT_DISK_CONFIGURATION)); - } - - @Test - public void testAttachDiskName_Operation() { - AttachedDisk attachedDisk = AttachedDisk.of("dev0", PERSISTENT_DISK_CONFIGURATION); - EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, - compute.attachDisk(INSTANCE_ID, "dev0", PERSISTENT_DISK_CONFIGURATION)); - } - - @Test - public void testAttachDiskNameWithSelectedFields_Operation() { - AttachedDisk attachedDisk = AttachedDisk.of("dev0", PERSISTENT_DISK_CONFIGURATION); - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.attachDisk( - eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), eq(attachedDisk.toPb()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.attachDisk(INSTANCE_ID, "dev0", PERSISTENT_DISK_CONFIGURATION, - OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testAttachDiskName_Null() { - AttachedDisk attachedDisk = AttachedDisk.of("dev0", PERSISTENT_DISK_CONFIGURATION); - EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.attachDisk(INSTANCE_ID, "dev0", PERSISTENT_DISK_CONFIGURATION)); - } - - @Test - public void testDeleteAccessConfig_Operation() { - EasyMock.expect(computeRpcMock.deleteAccessConfig(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), "networkInterface", "accessConfig", EMPTY_RPC_OPTIONS)) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, - compute.deleteAccessConfig(INSTANCE_ID, "networkInterface", "accessConfig")); - } - - @Test - public void testDeleteAccessConfigWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.deleteAccessConfig(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq("networkInterface"), eq("accessConfig"), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.deleteAccessConfig(INSTANCE_ID, "networkInterface", - "accessConfig", OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testDeleteAccessConfig_Null() { - EasyMock.expect(computeRpcMock.deleteAccessConfig(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), "networkInterface", "accessConfig", EMPTY_RPC_OPTIONS)) - .andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.deleteAccessConfig(INSTANCE_ID, "networkInterface", "accessConfig")); - } - - @Test - public void testDetachDisk_Operation() { - EasyMock.expect(computeRpcMock.detachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - "device", EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.detachDisk(INSTANCE_ID, "device")); - } - - @Test - public void testDetachDiskWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.detachDisk(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq("device"), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.detachDisk(INSTANCE_ID, "device", OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testDetachDisk_Null() { - EasyMock.expect(computeRpcMock.detachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - "device", EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.detachDisk(INSTANCE_ID, "device")); - } - - @Test - public void testSerialPortOutputFromPort() { - String output = "output"; - EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), 2, EMPTY_RPC_OPTIONS)).andReturn(output); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(output, compute.getSerialPortOutput(INSTANCE_ID, 2)); - } - - @Test - public void testSerialPortOutputDefault() { - String output = "output"; - EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), null, EMPTY_RPC_OPTIONS)).andReturn(output); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(output, compute.getSerialPortOutput(INSTANCE_ID)); - } - - @Test - public void testSerialPortOutputFromPort_Null() { - EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), 2, EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getSerialPortOutput(INSTANCE_ID, 2)); - } - - @Test - public void testSerialPortOutputDefault_Null() { - EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), null, EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.getSerialPortOutput(INSTANCE_ID)); - } - - @Test - public void testResetInstance_Operation() { - EasyMock.expect(computeRpcMock.reset(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.reset(INSTANCE_ID)); - } - - @Test - public void testResetInstanceWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.reset(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.reset(INSTANCE_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testResetInstance_Null() { - EasyMock.expect(computeRpcMock.reset(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.reset(INSTANCE_ID)); - } - - @Test - public void testSetDiskAutodelete_Operation() { - EasyMock.expect(computeRpcMock.setDiskAutoDelete(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), "device", true, EMPTY_RPC_OPTIONS)) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.setDiskAutoDelete(INSTANCE_ID, "device", true)); - } - - @Test - public void testSetDiskAutodeleteWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.setDiskAutoDelete(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq("device"), eq(true), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = - compute.setDiskAutoDelete(INSTANCE_ID, "device", true, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testSetDiskAutodelete_Null() { - EasyMock.expect(computeRpcMock.setDiskAutoDelete(INSTANCE_ID.getZone(), - INSTANCE_ID.getInstance(), "device", false, EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.setDiskAutoDelete(INSTANCE_ID, "device", false)); - } - - @Test - public void testSetMachineType_Operation() { - EasyMock.expect(computeRpcMock.setMachineType(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - MACHINE_TYPE_ID.getSelfLink(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, - compute.setMachineType(INSTANCE_ID, MachineTypeId.of("zone", "type"))); - } - - @Test - public void testSetMachineTypeWithOptions_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.setMachineType(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq(MACHINE_TYPE_ID.getSelfLink()), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.setMachineType(INSTANCE_ID, MachineTypeId.of("zone", "type"), - OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testSetMachineType_Null() { - EasyMock.expect(computeRpcMock.setMachineType(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - MACHINE_TYPE_ID.getSelfLink(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.setMachineType(INSTANCE_ID, MachineTypeId.of("zone", "type"))); - } - - @Test - public void testSetMetadata_Operation() { - Metadata metadata = Metadata.newBuilder() - .add("key", "value") - .setFingerprint("fingerprint") - .build(); - EasyMock.expect(computeRpcMock.setMetadata(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - metadata.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.setMetadata(INSTANCE_ID, metadata)); - } - - @Test - public void testSetMetadataWithOptions_Operation() { - Capture> capturedOptions = Capture.newInstance(); - Metadata metadata = Metadata.newBuilder() - .add("key", "value") - .setFingerprint("fingerprint") - .build(); - EasyMock.expect(computeRpcMock.setMetadata(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq(metadata.toPb()), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.setMetadata(INSTANCE_ID, metadata, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testSetMetadata_Null() { - Metadata metadata = Metadata.newBuilder() - .add("key", "value") - .setFingerprint("fingerprint") - .build(); - EasyMock.expect(computeRpcMock.setMetadata(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - metadata.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.setMetadata(INSTANCE_ID, metadata)); - } - - @Test - public void testSetSchedulingOptions_Operation() { - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - EasyMock.expect(computeRpcMock.setScheduling(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - schedulingOptions.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)); - } - - @Test - public void testSetSchedulingOptionsWithOptions_Operation() { - Capture> capturedOptions = Capture.newInstance(); - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - EasyMock.expect(computeRpcMock.setScheduling(eq(INSTANCE_ID.getZone()), - eq(INSTANCE_ID.getInstance()), eq(schedulingOptions.toPb()), capture(capturedOptions))) - .andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = - compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testSetSchedulingOptions_Null() { - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - EasyMock.expect(computeRpcMock.setScheduling(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - schedulingOptions.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)); - } - - @Test - public void testTags_Operation() { - Tags tags = Tags.of("tag1", "tag2"); - EasyMock.expect(computeRpcMock.setTags(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - tags.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.setTags(INSTANCE_ID, tags)); - } - - @Test - public void testSetTagsWithOptions_Operation() { - Tags tags = Tags.of("tag1", "tag2"); - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.setTags(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), - eq(tags.toPb()), capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.setTags(INSTANCE_ID, tags, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testSetTags_Null() { - Tags tags = Tags.of("tag1", "tag2"); - EasyMock.expect(computeRpcMock.setTags(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - tags.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.setTags(INSTANCE_ID, tags)); - } - - @Test - public void testStartInstance_Operation() { - EasyMock.expect(computeRpcMock.start(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.start(INSTANCE_ID)); - } - - @Test - public void testStartInstanceWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.start(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.start(INSTANCE_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testStartInstance_Null() { - EasyMock.expect(computeRpcMock.start(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.start(INSTANCE_ID)); - } - - @Test - public void testStopInstance_Operation() { - EasyMock.expect(computeRpcMock.stop(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertEquals(zoneOperation, compute.stop(INSTANCE_ID)); - } - - @Test - public void testStopInstanceWithSelectedFields_Operation() { - Capture> capturedOptions = Capture.newInstance(); - EasyMock.expect(computeRpcMock.stop(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), - capture(capturedOptions))).andReturn(zoneOperation.toPb()); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - Operation operation = compute.stop(INSTANCE_ID, OPERATION_OPTION_FIELDS); - String selector = - (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); - assertTrue(selector.contains("selfLink")); - assertTrue(selector.contains("id")); - assertTrue(selector.contains("description")); - assertEquals(23, selector.length()); - assertEquals(zoneOperation, operation); - } - - @Test - public void testStopInstance_Null() { - EasyMock.expect(computeRpcMock.stop(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), - EMPTY_RPC_OPTIONS)).andReturn(null); - EasyMock.replay(computeRpcMock); - compute = options.getService(); - assertNull(compute.stop(INSTANCE_ID)); - } - - @Test - public void testRetryableException() { - EasyMock.expect(computeRpcMock.getDiskType( - DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andThrow(new ComputeException(500, "InternalError")) - .andReturn(DISK_TYPE.toPb()); - EasyMock.replay(computeRpcMock); - compute = - options.toBuilder() - .setRetrySettings(ServiceOptions.getDefaultRetrySettings()).build() - .getService(); - DiskType diskType = compute.getDiskType(DISK_TYPE_ID); - assertEquals(DISK_TYPE, diskType); - } - - @Test - public void testNonRetryableException() { - String exceptionMessage = "Not Implemented"; - EasyMock.expect(computeRpcMock.getDiskType( - DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andThrow(new ComputeException(501, exceptionMessage)); - EasyMock.replay(computeRpcMock); - compute = - options.toBuilder() - .setRetrySettings(ServiceOptions.getDefaultRetrySettings()).build() - .getService(); - thrown.expect(ComputeException.class); - thrown.expectMessage(exceptionMessage); - compute.getDiskType(DISK_TYPE_ID); - } - - @Test - public void testRuntimeException() { - String exceptionMessage = "Artificial runtime exception"; - EasyMock.expect(computeRpcMock.getDiskType( - DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) - .andThrow(new RuntimeException(exceptionMessage)); - EasyMock.replay(computeRpcMock); - compute = - options.toBuilder() - .setRetrySettings(ServiceOptions.getDefaultRetrySettings()).build() - .getService(); - thrown.expect(ComputeException.class); - thrown.expectMessage(exceptionMessage); - compute.getDiskType(DISK_TYPE_ID); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java deleted file mode 100644 index 5511d870ce35..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.cloud.TransportOptions; -import org.easymock.EasyMock; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class ComputeOptionsTest { - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testInvalidTransport() { - thrown.expect(IllegalArgumentException.class); - ComputeOptions.newBuilder().setTransportOptions(EasyMock.createMock(TransportOptions.class)); - } - -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java deleted file mode 100644 index b11d516105b7..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; - -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; -import org.junit.Test; - -public class DeprecationStatusTest { - - private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private static final Long DELETED_MILLIS = 1453293540000L; - private static final Long DEPRECATED_MILLIS = 1453293420000L; - private static final Long OBSOLETE_MILLIS = 1453293480000L; - private static final String DELETED = TIMESTAMP_FORMATTER.print(DELETED_MILLIS); - private static final String DEPRECATED = TIMESTAMP_FORMATTER.print(DEPRECATED_MILLIS); - private static final String OBSOLETE = TIMESTAMP_FORMATTER.print(OBSOLETE_MILLIS); - private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); - private static final MachineTypeId MACHINE_TYPE_ID = - MachineTypeId.of("project", "zone", "machineType"); - private static final DeprecationStatus.Status STATUS = DeprecationStatus.Status.DELETED; - private static final DeprecationStatus DISK_TYPE_STATUS = - DeprecationStatus.newBuilder(STATUS) - .setReplacement(DISK_TYPE_ID) - .setDeprecated(DEPRECATED) - .setObsolete(OBSOLETE) - .setDeleted(DELETED) - .build(); - private static final DeprecationStatus DISK_TYPE_STATUS_MILLIS = - DeprecationStatus.newBuilder(STATUS) - .setReplacement(DISK_TYPE_ID) - .setDeprecated(DEPRECATED_MILLIS) - .setObsolete(OBSOLETE_MILLIS) - .setDeleted(DELETED_MILLIS) - .build(); - private static final DeprecationStatus MACHINE_TYPE_STATUS = - DeprecationStatus.newBuilder(STATUS, MACHINE_TYPE_ID) - .setDeprecated(DEPRECATED) - .setObsolete(OBSOLETE) - .setDeleted(DELETED) - .build(); - - @Test - public void testBuilder() { - compareDeprecationStatus(DISK_TYPE_STATUS, DISK_TYPE_STATUS_MILLIS); - assertEquals(DELETED, DISK_TYPE_STATUS.getDeleted()); - assertEquals(DEPRECATED, DISK_TYPE_STATUS.getDeprecated()); - assertEquals(OBSOLETE, DISK_TYPE_STATUS.getObsolete()); - assertEquals(DISK_TYPE_ID, DISK_TYPE_STATUS.getReplacement()); - assertEquals(DEPRECATED_MILLIS, DISK_TYPE_STATUS.getDeprecatedMillis()); - assertEquals(DELETED_MILLIS, DISK_TYPE_STATUS.getDeletedMillis()); - assertEquals(OBSOLETE_MILLIS, DISK_TYPE_STATUS.getObsoleteMillis()); - assertEquals(STATUS, DISK_TYPE_STATUS.getStatus()); - assertEquals(DELETED, DISK_TYPE_STATUS_MILLIS.getDeleted()); - assertEquals(DEPRECATED, DISK_TYPE_STATUS_MILLIS.getDeprecated()); - assertEquals(OBSOLETE, DISK_TYPE_STATUS_MILLIS.getObsolete()); - assertEquals(DISK_TYPE_ID, DISK_TYPE_STATUS_MILLIS.getReplacement()); - assertEquals(DEPRECATED_MILLIS, DISK_TYPE_STATUS_MILLIS.getDeprecatedMillis()); - assertEquals(DELETED_MILLIS, DISK_TYPE_STATUS_MILLIS.getDeletedMillis()); - assertEquals(OBSOLETE_MILLIS, DISK_TYPE_STATUS_MILLIS.getObsoleteMillis()); - assertEquals(STATUS, DISK_TYPE_STATUS.getStatus()); - assertEquals(DELETED, MACHINE_TYPE_STATUS.getDeleted()); - assertEquals(DEPRECATED, MACHINE_TYPE_STATUS.getDeprecated()); - assertEquals(OBSOLETE, MACHINE_TYPE_STATUS.getObsolete()); - assertEquals(DEPRECATED_MILLIS, MACHINE_TYPE_STATUS.getDeprecatedMillis()); - assertEquals(DELETED_MILLIS, MACHINE_TYPE_STATUS.getDeletedMillis()); - assertEquals(OBSOLETE_MILLIS, MACHINE_TYPE_STATUS.getObsoleteMillis()); - assertEquals(MACHINE_TYPE_ID, MACHINE_TYPE_STATUS.getReplacement()); - assertEquals(STATUS, MACHINE_TYPE_STATUS.getStatus()); - } - - @Test - public void testGettersIllegalArgument() { - DeprecationStatus deprecationStatus = - DeprecationStatus.newBuilder(STATUS, MACHINE_TYPE_ID) - .setDeprecated("deprecated") - .setObsolete("obsolete") - .setDeleted("delete") - .build(); - assertEquals("deprecated", deprecationStatus.getDeprecated()); - try { - deprecationStatus.getDeprecatedMillis(); - fail("Expected IllegalArgumentException"); - } catch (IllegalStateException ex) { - // never reached - } - assertEquals("obsolete", deprecationStatus.getObsolete()); - try { - deprecationStatus.getObsoleteMillis(); - fail("Expected IllegalArgumentException"); - } catch (IllegalStateException ex) { - // never reached - } - assertEquals("delete", deprecationStatus.getDeleted()); - try { - deprecationStatus.getDeletedMillis(); - fail("Expected IllegalArgumentException"); - } catch (IllegalStateException ex) { - // never reached - } - } - - @Test - public void testToBuilder() { - compareDeprecationStatus(DISK_TYPE_STATUS, DISK_TYPE_STATUS.toBuilder().build()); - compareDeprecationStatus(MACHINE_TYPE_STATUS, MACHINE_TYPE_STATUS.toBuilder().build()); - DeprecationStatus deprecationStatus = DISK_TYPE_STATUS.toBuilder() - .setDeleted(DEPRECATED) - .build(); - assertEquals(DEPRECATED, deprecationStatus.getDeleted()); - deprecationStatus = deprecationStatus.toBuilder().setDeleted(DELETED).build(); - compareDeprecationStatus(DISK_TYPE_STATUS, deprecationStatus); - } - - @Test - public void testToBuilderIncomplete() { - DeprecationStatus diskStatus = DeprecationStatus.of(STATUS, DISK_TYPE_ID); - assertEquals(diskStatus, diskStatus.toBuilder().build()); - } - - @Test - public void testOf() { - DeprecationStatus diskStatus = DeprecationStatus.of(STATUS, DISK_TYPE_ID); - assertNull(diskStatus.getDeleted()); - assertNull(diskStatus.getDeprecated()); - assertNull(diskStatus.getObsolete()); - assertEquals(DISK_TYPE_ID, diskStatus.getReplacement()); - assertEquals(STATUS, diskStatus.getStatus()); - } - - @Test - public void testToAndFromPb() { - DeprecationStatus diskStatus = - DeprecationStatus.fromPb(DISK_TYPE_STATUS.toPb(), DiskTypeId.FROM_URL_FUNCTION); - compareDeprecationStatus(DISK_TYPE_STATUS, diskStatus); - DeprecationStatus machineStatus = - DeprecationStatus.fromPb(MACHINE_TYPE_STATUS.toPb(), MachineTypeId.FROM_URL_FUNCTION); - compareDeprecationStatus(MACHINE_TYPE_STATUS, machineStatus); - diskStatus = DeprecationStatus.newBuilder(STATUS, DISK_TYPE_ID) - .setDeprecated(DEPRECATED) - .build(); - assertEquals(diskStatus, - DeprecationStatus.fromPb(diskStatus.toPb(), DiskTypeId.FROM_URL_FUNCTION)); - machineStatus = - DeprecationStatus.newBuilder(STATUS, MACHINE_TYPE_ID).setDeprecated(DEPRECATED).build(); - assertEquals(machineStatus, - DeprecationStatus.fromPb(machineStatus.toPb(), MachineTypeId.FROM_URL_FUNCTION)); - diskStatus = DeprecationStatus.of(STATUS, DISK_TYPE_ID); - assertEquals(diskStatus, - DeprecationStatus.fromPb(diskStatus.toPb(), DiskTypeId.FROM_URL_FUNCTION)); - } - - private void compareDeprecationStatus(DeprecationStatus expected, DeprecationStatus value) { - assertEquals(expected, value); - assertEquals(expected.getDeleted(), value.getDeleted()); - assertEquals(expected.getDeprecated(), value.getDeprecated()); - assertEquals(expected.getObsolete(), value.getObsolete()); - assertEquals(expected.getDeletedMillis(), value.getDeletedMillis()); - assertEquals(expected.getDeprecatedMillis(), value.getDeprecatedMillis()); - assertEquals(expected.getObsoleteMillis(), value.getObsoleteMillis()); - assertEquals(expected.getReplacement(), value.getReplacement()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java deleted file mode 100644 index 65a121e38c3f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class DiskIdTest { - - private static final String PROJECT = "project"; - private static final String ZONE = "zone"; - private static final String NAME = "disk"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - DiskId diskId = DiskId.of(PROJECT, ZONE, NAME); - assertEquals(PROJECT, diskId.getProject()); - assertEquals(ZONE, diskId.getZone()); - assertEquals(NAME, diskId.getDisk()); - assertEquals(URL, diskId.getSelfLink()); - diskId = DiskId.of(ZONE, NAME); - assertNull(diskId.getProject()); - assertEquals(ZONE, diskId.getZone()); - assertEquals(NAME, diskId.getDisk()); - diskId = DiskId.of(ZoneId.of(ZONE), NAME); - assertNull(diskId.getProject()); - assertEquals(ZONE, diskId.getZone()); - assertEquals(NAME, diskId.getDisk()); - } - - @Test - public void testToAndFromUrl() { - DiskId diskId = DiskId.of(PROJECT, ZONE, NAME); - compareDiskId(diskId, DiskId.fromUrl(diskId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid disk URL"); - DiskId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - DiskId diskId = DiskId.of(PROJECT, ZONE, NAME); - assertSame(diskId, diskId.setProjectId(PROJECT)); - compareDiskId(diskId, DiskId.of(ZONE, NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(DiskId.matchesUrl(DiskId.of(PROJECT, ZONE, NAME).getSelfLink())); - assertFalse(DiskId.matchesUrl("notMatchingUrl")); - } - - private void compareDiskId(DiskId expected, DiskId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getZone(), expected.getZone()); - assertEquals(expected.getDisk(), expected.getDisk()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java deleted file mode 100644 index e3724b7eee81..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class DiskImageConfigurationTest { - - private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); - private static final String SOURCE_DISK_ID = "diskId"; - private static final Long ARCHIVE_SIZE_BYTES = 42L; - private static final ImageConfiguration.SourceType SOURCE_TYPE = - ImageConfiguration.SourceType.RAW; - private static final DiskImageConfiguration CONFIGURATION = - DiskImageConfiguration.newBuilder(SOURCE_DISK) - .setSourceDiskId(SOURCE_DISK_ID) - .setSourceType(SOURCE_TYPE) - .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) - .build(); - - @Test - public void testToBuilder() { - compareDiskImageConfiguration(CONFIGURATION, CONFIGURATION.toBuilder().build()); - DiskId newDisk = DiskId.of("newProject", "newZone", "newDisk"); - String newDiskId = "newDiskId"; - DiskImageConfiguration configuration = CONFIGURATION.toBuilder() - .setSourceDisk(newDisk) - .setSourceDiskId(newDiskId) - .build(); - assertEquals(newDisk, configuration.getSourceDisk()); - assertEquals(newDiskId, configuration.getSourceDiskId()); - configuration = configuration.toBuilder() - .setSourceDiskId(SOURCE_DISK_ID) - .setSourceDisk(SOURCE_DISK) - .build(); - compareDiskImageConfiguration(CONFIGURATION, configuration); - } - - @Test - public void testToBuilderIncomplete() { - DiskImageConfiguration configuration = DiskImageConfiguration.of(SOURCE_DISK); - compareDiskImageConfiguration(configuration, configuration.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(SOURCE_TYPE, CONFIGURATION.getSourceType()); - assertEquals(SOURCE_DISK, CONFIGURATION.getSourceDisk()); - assertEquals(SOURCE_DISK_ID, CONFIGURATION.getSourceDiskId()); - assertEquals(ARCHIVE_SIZE_BYTES, CONFIGURATION.getArchiveSizeBytes()); - assertEquals(ImageConfiguration.Type.DISK, CONFIGURATION.getType()); - } - - @Test - public void testToAndFromPb() { - assertTrue(ImageConfiguration.fromPb(CONFIGURATION.toPb()) instanceof DiskImageConfiguration); - compareDiskImageConfiguration(CONFIGURATION, - ImageConfiguration.fromPb(CONFIGURATION.toPb())); - DiskImageConfiguration configuration = DiskImageConfiguration.of(SOURCE_DISK); - compareDiskImageConfiguration(configuration, - DiskImageConfiguration.fromPb(configuration.toPb())); - } - - @Test - public void testOf() { - DiskImageConfiguration configuration = DiskImageConfiguration.of(SOURCE_DISK); - assertEquals(ImageConfiguration.Type.DISK, configuration.getType()); - assertNull(configuration.getSourceDiskId()); - assertNull(configuration.getSourceType()); - assertNull(configuration.getArchiveSizeBytes()); - assertEquals(SOURCE_DISK, configuration.getSourceDisk()); - } - - @Test - public void testSetProjectId() { - DiskImageConfiguration configuration = CONFIGURATION.toBuilder() - .setSourceDisk(DiskId.of("zone", "disk")) - .build(); - compareDiskImageConfiguration(CONFIGURATION, configuration.setProjectId("project")); - } - - private void compareDiskImageConfiguration(DiskImageConfiguration expected, - DiskImageConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.getArchiveSizeBytes(), value.getArchiveSizeBytes()); - assertEquals(expected.getSourceDisk(), value.getSourceDisk()); - assertEquals(expected.getSourceDiskId(), value.getSourceDiskId()); - assertEquals(expected.getSourceType(), value.getSourceType()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java deleted file mode 100644 index 2ef2b6c2ba64..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.api.services.compute.model.Disk; -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class DiskInfoTest { - - private static final String GENERATED_ID = "42"; - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final DiskInfo.CreationStatus CREATION_STATUS = DiskInfo.CreationStatus.READY; - private static final String DESCRIPTION = "description"; - private static final Long SIZE_GB = 500L; - private static final DiskTypeId TYPE = DiskTypeId.of("project", "zone", "disk"); - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final List ATTACHED_INSTANCES = ImmutableList.of( - InstanceId.of("project", "zone", "instance1"), - InstanceId.of("project", "zone", "instance2")); - private static final SnapshotId SNAPSHOT = SnapshotId.of("project", "snapshot"); - private static final ImageId IMAGE = ImageId.of("project", "image"); - private static final String SNAPSHOT_ID = "snapshotId"; - private static final String IMAGE_ID = "snapshotId"; - private static final Long LAST_ATTACH_TIMESTAMP = 1453293600000L; - private static final Long LAST_DETACH_TIMESTAMP = 1453293660000L; - private static final StandardDiskConfiguration DISK_CONFIGURATION = - StandardDiskConfiguration.newBuilder() - .setSizeGb(SIZE_GB) - .setDiskType(TYPE) - .build(); - private static final SnapshotDiskConfiguration SNAPSHOT_DISK_CONFIGURATION = - SnapshotDiskConfiguration.newBuilder(SNAPSHOT) - .setSizeGb(SIZE_GB) - .setDiskType(TYPE) - .setSourceSnapshotId(SNAPSHOT_ID) - .build(); - private static final ImageDiskConfiguration IMAGE_DISK_CONFIGURATION = - ImageDiskConfiguration.newBuilder(IMAGE) - .setSizeGb(SIZE_GB) - .setDiskType(TYPE) - .setSourceImageId(IMAGE_ID) - .build(); - private static final DiskInfo DISK_INFO = DiskInfo.newBuilder(DISK_ID, DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) - .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) - .build(); - private static final DiskInfo SNAPSHOT_DISK_INFO = - DiskInfo.newBuilder(DISK_ID, SNAPSHOT_DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) - .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) - .build(); - private static final DiskInfo IMAGE_DISK_INFO = - DiskInfo.newBuilder(DISK_ID, IMAGE_DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) - .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) - .build(); - - @Test - public void testToBuilder() { - compareDiskInfo(DISK_INFO, DISK_INFO.toBuilder().build()); - compareDiskInfo(IMAGE_DISK_INFO, IMAGE_DISK_INFO.toBuilder().build()); - compareDiskInfo(SNAPSHOT_DISK_INFO, SNAPSHOT_DISK_INFO.toBuilder().build()); - DiskInfo diskInfo = DISK_INFO.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", diskInfo.getDescription()); - diskInfo = diskInfo.toBuilder().setDescription("description").build(); - compareDiskInfo(DISK_INFO, diskInfo); - } - - @Test - public void testToBuilderIncomplete() { - DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); - assertEquals(diskInfo, diskInfo.toBuilder().build()); - diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); - assertEquals(diskInfo, diskInfo.toBuilder().build()); - diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); - assertEquals(diskInfo, diskInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, DISK_INFO.getGeneratedId()); - assertEquals(DISK_ID, DISK_INFO.getDiskId()); - assertEquals(DISK_CONFIGURATION, DISK_INFO.getConfiguration()); - assertEquals(CREATION_TIMESTAMP, DISK_INFO.getCreationTimestamp()); - assertEquals(CREATION_STATUS, DISK_INFO.getCreationStatus()); - assertEquals(DESCRIPTION, DISK_INFO.getDescription()); - assertEquals(LICENSES, DISK_INFO.getLicenses()); - assertEquals(ATTACHED_INSTANCES, DISK_INFO.getAttachedInstances()); - assertEquals(LAST_ATTACH_TIMESTAMP, DISK_INFO.getLastAttachTimestamp()); - assertEquals(LAST_DETACH_TIMESTAMP, DISK_INFO.getLastDetachTimestamp()); - assertEquals(GENERATED_ID, IMAGE_DISK_INFO.getGeneratedId()); - assertEquals(DISK_ID, IMAGE_DISK_INFO.getDiskId()); - assertEquals(IMAGE_DISK_CONFIGURATION, IMAGE_DISK_INFO.getConfiguration()); - assertEquals(CREATION_TIMESTAMP, IMAGE_DISK_INFO.getCreationTimestamp()); - assertEquals(CREATION_STATUS, IMAGE_DISK_INFO.getCreationStatus()); - assertEquals(DESCRIPTION, IMAGE_DISK_INFO.getDescription()); - assertEquals(LICENSES, IMAGE_DISK_INFO.getLicenses()); - assertEquals(ATTACHED_INSTANCES, IMAGE_DISK_INFO.getAttachedInstances()); - assertEquals(LAST_ATTACH_TIMESTAMP, IMAGE_DISK_INFO.getLastAttachTimestamp()); - assertEquals(LAST_DETACH_TIMESTAMP, IMAGE_DISK_INFO.getLastDetachTimestamp()); - assertEquals(GENERATED_ID, SNAPSHOT_DISK_INFO.getGeneratedId()); - assertEquals(DISK_ID, SNAPSHOT_DISK_INFO.getDiskId()); - assertEquals(SNAPSHOT_DISK_CONFIGURATION, SNAPSHOT_DISK_INFO.getConfiguration()); - assertEquals(CREATION_TIMESTAMP, SNAPSHOT_DISK_INFO.getCreationTimestamp()); - assertEquals(CREATION_STATUS, SNAPSHOT_DISK_INFO.getCreationStatus()); - assertEquals(DESCRIPTION, SNAPSHOT_DISK_INFO.getDescription()); - assertEquals(LICENSES, SNAPSHOT_DISK_INFO.getLicenses()); - assertEquals(ATTACHED_INSTANCES, SNAPSHOT_DISK_INFO.getAttachedInstances()); - assertEquals(LAST_ATTACH_TIMESTAMP, SNAPSHOT_DISK_INFO.getLastAttachTimestamp()); - assertEquals(LAST_DETACH_TIMESTAMP, SNAPSHOT_DISK_INFO.getLastDetachTimestamp()); - } - - @Test - public void testOf() { - DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); - assertNull(diskInfo.getGeneratedId()); - assertEquals(DISK_ID, diskInfo.getDiskId()); - assertEquals(DISK_CONFIGURATION, diskInfo.getConfiguration()); - assertNull(diskInfo.getCreationTimestamp()); - assertNull(diskInfo.getCreationStatus()); - assertNull(diskInfo.getDescription()); - assertNull(diskInfo.getLicenses()); - assertNull(diskInfo.getAttachedInstances()); - assertNull(diskInfo.getLastAttachTimestamp()); - assertNull(diskInfo.getLastDetachTimestamp()); - diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); - assertNull(diskInfo.getGeneratedId()); - assertEquals(DISK_ID, diskInfo.getDiskId()); - assertEquals(IMAGE_DISK_CONFIGURATION, diskInfo.getConfiguration()); - assertNull(diskInfo.getCreationTimestamp()); - assertNull(diskInfo.getCreationStatus()); - assertNull(diskInfo.getDescription()); - assertNull(diskInfo.getLicenses()); - assertNull(diskInfo.getAttachedInstances()); - assertNull(diskInfo.getLastAttachTimestamp()); - assertNull(diskInfo.getLastDetachTimestamp()); - diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); - assertNull(diskInfo.getGeneratedId()); - assertEquals(DISK_ID, diskInfo.getDiskId()); - assertEquals(SNAPSHOT_DISK_CONFIGURATION, diskInfo.getConfiguration()); - assertNull(diskInfo.getCreationTimestamp()); - assertNull(diskInfo.getCreationStatus()); - assertNull(diskInfo.getDescription()); - assertNull(diskInfo.getLicenses()); - assertNull(diskInfo.getAttachedInstances()); - assertNull(diskInfo.getLastAttachTimestamp()); - assertNull(diskInfo.getLastDetachTimestamp()); - } - - @Test - public void testToAndFromPb() { - DiskInfo diskInfo = DiskInfo.fromPb(DISK_INFO.toPb()); - compareDiskInfo(DISK_INFO, diskInfo); - diskInfo = DiskInfo.fromPb(SNAPSHOT_DISK_INFO.toPb()); - compareDiskInfo(SNAPSHOT_DISK_INFO, diskInfo); - diskInfo = DiskInfo.fromPb(IMAGE_DISK_INFO.toPb()); - compareDiskInfo(IMAGE_DISK_INFO, diskInfo); - Disk disk = new Disk() - .setSelfLink(DISK_ID.getSelfLink()) - .setType(TYPE.getSelfLink()) - .setSizeGb(SIZE_GB); - diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); - compareDiskInfo(diskInfo, DiskInfo.fromPb(disk)); - disk = new Disk() - .setType(TYPE.getSelfLink()) - .setSizeGb(SIZE_GB) - .setSelfLink(DISK_ID.getSelfLink()) - .setSourceSnapshotId(SNAPSHOT_ID) - .setSourceSnapshot(SNAPSHOT.getSelfLink()); - diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); - compareDiskInfo(diskInfo, DiskInfo.fromPb(disk)); - disk = new Disk() - .setType(TYPE.getSelfLink()) - .setSizeGb(SIZE_GB) - .setSelfLink(DISK_ID.getSelfLink()) - .setSourceImageId(IMAGE_ID) - .setSourceImage(IMAGE.getSelfLink()); - diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); - compareDiskInfo(diskInfo, DiskInfo.fromPb(disk)); - } - - @Test - public void testSetProjectId() { - StandardDiskConfiguration standardDiskConfiguration = DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of(TYPE.getZone(), TYPE.getType())) - .build(); - DiskInfo diskInfo = DISK_INFO.toBuilder() - .setDiskId(DiskId.of(DISK_ID.getZone(), DISK_ID.getDisk())) - .setConfiguration(standardDiskConfiguration) - .build(); - compareDiskInfo(DISK_INFO, diskInfo.setProjectId("project")); - SnapshotDiskConfiguration snapshotDiskConfiguration = SNAPSHOT_DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of(TYPE.getZone(), TYPE.getType())) - .setSourceSnapshot(SnapshotId.of(SNAPSHOT.getSnapshot())) - .build(); - diskInfo = SNAPSHOT_DISK_INFO.toBuilder() - .setDiskId(DiskId.of(DISK_ID.getZone(), DISK_ID.getDisk())) - .setConfiguration(snapshotDiskConfiguration) - .build(); - compareDiskInfo(SNAPSHOT_DISK_INFO, diskInfo.setProjectId("project")); - ImageDiskConfiguration imageDiskConfiguration = IMAGE_DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of(TYPE.getZone(), TYPE.getType())) - .setSourceImage(ImageId.of(IMAGE.getImage())) - .build(); - diskInfo = IMAGE_DISK_INFO.toBuilder() - .setDiskId(DiskId.of(DISK_ID.getZone(), DISK_ID.getDisk())) - .setConfiguration(imageDiskConfiguration) - .build(); - compareDiskInfo(IMAGE_DISK_INFO, diskInfo.setProjectId("project")); - } - - public void compareDiskInfo(DiskInfo expected, DiskInfo value) { - assertEquals(expected, value); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getDiskId(), value.getDiskId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getCreationStatus(), value.getCreationStatus()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.getAttachedInstances(), value.getAttachedInstances()); - assertEquals(expected.getLastAttachTimestamp(), value.getLastAttachTimestamp()); - assertEquals(expected.getLastDetachTimestamp(), value.getLastDetachTimestamp()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java deleted file mode 100644 index 3e7765c4c9b7..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class DiskTest { - - private static final String GENERATED_ID = "42"; - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final DiskInfo.CreationStatus CREATION_STATUS = DiskInfo.CreationStatus.READY; - private static final String DESCRIPTION = "description"; - private static final Long SIZE_GB = 500L; - private static final DiskTypeId TYPE = DiskTypeId.of("project", "zone", "disk"); - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final List ATTACHED_INSTANCES = ImmutableList.of( - InstanceId.of("project", "zone", "instance1"), - InstanceId.of("project", "zone", "instance2")); - private static final SnapshotId SNAPSHOT = SnapshotId.of("project", "snapshot"); - private static final ImageId IMAGE = ImageId.of("project", "image"); - private static final String SNAPSHOT_ID = "snapshotId"; - private static final String IMAGE_ID = "imageId"; - private static final Long LAST_ATTACH_TIMESTAMP = 1453293600000L; - private static final Long LAST_DETACH_TIMESTAMP = 1453293660000L; - private static final StandardDiskConfiguration DISK_CONFIGURATION = - StandardDiskConfiguration.newBuilder() - .setSizeGb(SIZE_GB) - .setDiskType(TYPE) - .build(); - private static final SnapshotDiskConfiguration SNAPSHOT_DISK_CONFIGURATION = - SnapshotDiskConfiguration.newBuilder(SNAPSHOT) - .setSizeGb(SIZE_GB) - .setDiskType(TYPE) - .setSourceSnapshotId(SNAPSHOT_ID) - .build(); - private static final ImageDiskConfiguration IMAGE_DISK_CONFIGURATION = - ImageDiskConfiguration.newBuilder(IMAGE) - .setSizeGb(SIZE_GB) - .setDiskType(TYPE) - .setSourceImageId(IMAGE_ID) - .build(); - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Disk disk; - private Disk standardDisk; - private Disk snapshotDisk; - private Disk imageDisk; - - private void initializeExpectedDisk(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - standardDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) - .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) - .build(); - snapshotDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, SNAPSHOT_DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) - .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) - .build(); - imageDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, IMAGE_DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) - .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeDisk() { - disk = new Disk.Builder(compute, DISK_ID, DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setCreationStatus(CREATION_STATUS) - .setDescription(DESCRIPTION) - .setLicenses(LICENSES) - .setAttachedInstances(ATTACHED_INSTANCES) - .build(); - } - - @Test - public void testToBuilder() { - initializeExpectedDisk(16); - compareDisk(standardDisk, standardDisk.toBuilder().build()); - compareDisk(imageDisk, imageDisk.toBuilder().build()); - compareDisk(snapshotDisk, snapshotDisk.toBuilder().build()); - Disk newDisk = standardDisk.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newDisk.getDescription()); - newDisk = newDisk.toBuilder().setDescription("description").build(); - compareDisk(standardDisk, newDisk); - } - - @Test - public void testToBuilderIncomplete() { - initializeExpectedDisk(18); - DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); - Disk disk = new Disk(serviceMockReturnsOptions, new DiskInfo.BuilderImpl(diskInfo)); - compareDisk(disk, disk.toBuilder().build()); - diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); - disk = new Disk(serviceMockReturnsOptions, new DiskInfo.BuilderImpl(diskInfo)); - compareDisk(disk, disk.toBuilder().build()); - diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); - disk = new Disk(serviceMockReturnsOptions, new DiskInfo.BuilderImpl(diskInfo)); - compareDisk(disk, disk.toBuilder().build()); - } - - @Test - public void testBuilder() { - initializeExpectedDisk(4); - assertEquals(DISK_ID, standardDisk.getDiskId()); - assertEquals(GENERATED_ID, standardDisk.getGeneratedId()); - assertEquals(DISK_CONFIGURATION, standardDisk.getConfiguration()); - assertEquals(CREATION_TIMESTAMP, standardDisk.getCreationTimestamp()); - assertEquals(CREATION_STATUS, standardDisk.getCreationStatus()); - assertEquals(DESCRIPTION, standardDisk.getDescription()); - assertEquals(LICENSES, standardDisk.getLicenses()); - assertEquals(ATTACHED_INSTANCES, standardDisk.getAttachedInstances()); - assertEquals(LAST_ATTACH_TIMESTAMP, standardDisk.getLastAttachTimestamp()); - assertEquals(LAST_DETACH_TIMESTAMP, standardDisk.getLastDetachTimestamp()); - assertSame(serviceMockReturnsOptions, standardDisk.getCompute()); - assertEquals(DISK_ID, imageDisk.getDiskId()); - assertEquals(GENERATED_ID, imageDisk.getGeneratedId()); - assertEquals(IMAGE_DISK_CONFIGURATION, imageDisk.getConfiguration()); - assertEquals(CREATION_TIMESTAMP, imageDisk.getCreationTimestamp()); - assertEquals(CREATION_STATUS, imageDisk.getCreationStatus()); - assertEquals(DESCRIPTION, imageDisk.getDescription()); - assertEquals(LICENSES, imageDisk.getLicenses()); - assertEquals(ATTACHED_INSTANCES, imageDisk.getAttachedInstances()); - assertEquals(LAST_ATTACH_TIMESTAMP, imageDisk.getLastAttachTimestamp()); - assertEquals(LAST_DETACH_TIMESTAMP, imageDisk.getLastDetachTimestamp()); - assertSame(serviceMockReturnsOptions, imageDisk.getCompute()); - assertEquals(DISK_ID, snapshotDisk.getDiskId()); - assertEquals(GENERATED_ID, snapshotDisk.getGeneratedId()); - assertEquals(SNAPSHOT_DISK_CONFIGURATION, snapshotDisk.getConfiguration()); - assertEquals(CREATION_TIMESTAMP, snapshotDisk.getCreationTimestamp()); - assertEquals(CREATION_STATUS, snapshotDisk.getCreationStatus()); - assertEquals(DESCRIPTION, snapshotDisk.getDescription()); - assertEquals(LICENSES, snapshotDisk.getLicenses()); - assertEquals(ATTACHED_INSTANCES, snapshotDisk.getAttachedInstances()); - assertEquals(LAST_ATTACH_TIMESTAMP, snapshotDisk.getLastAttachTimestamp()); - assertEquals(LAST_DETACH_TIMESTAMP, snapshotDisk.getLastDetachTimestamp()); - assertSame(serviceMockReturnsOptions, snapshotDisk.getCompute()); - Disk disk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION) - .setDiskId(DiskId.of("newProject", "newZone")) - .setConfiguration(SNAPSHOT_DISK_CONFIGURATION) - .build(); - assertEquals(DiskId.of("newProject", "newZone"), disk.getDiskId()); - assertNull(disk.getGeneratedId()); - assertEquals(SNAPSHOT_DISK_CONFIGURATION, disk.getConfiguration()); - assertNull(disk.getCreationTimestamp()); - assertNull(disk.getCreationStatus()); - assertNull(disk.getDescription()); - assertNull(disk.getLicenses()); - assertNull(disk.getAttachedInstances()); - assertNull(disk.getLastAttachTimestamp()); - assertNull(disk.getLastDetachTimestamp()); - assertSame(serviceMockReturnsOptions, disk.getCompute()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedDisk(24); - compareDisk(standardDisk, Disk.fromPb(serviceMockReturnsOptions, standardDisk.toPb())); - compareDisk(imageDisk, Disk.fromPb(serviceMockReturnsOptions, imageDisk.toPb())); - compareDisk(snapshotDisk, Disk.fromPb(serviceMockReturnsOptions, snapshotDisk.toPb())); - Disk disk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION).build(); - compareDisk(disk, Disk.fromPb(serviceMockReturnsOptions, disk.toPb())); - disk = - new Disk.Builder(serviceMockReturnsOptions, DISK_ID, SNAPSHOT_DISK_CONFIGURATION).build(); - compareDisk(disk, Disk.fromPb(serviceMockReturnsOptions, disk.toPb())); - disk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, IMAGE_DISK_CONFIGURATION).build(); - compareDisk(disk, Disk.fromPb(serviceMockReturnsOptions, disk.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "zone", "op")) - .build(); - expect(compute.deleteDisk(DISK_ID)).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedDisk(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteDisk(DISK_ID)).andReturn(null); - replay(compute); - initializeDisk(); - assertNull(disk.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedDisk(3); - Compute.DiskOption[] expectedOptions = {Compute.DiskOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getDisk(DISK_ID, expectedOptions)).andReturn(imageDisk); - replay(compute); - initializeDisk(); - assertTrue(disk.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedDisk(3); - Compute.DiskOption[] expectedOptions = {Compute.DiskOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getDisk(DISK_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeDisk(); - assertFalse(disk.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedDisk(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getDisk(DISK_ID)).andReturn(imageDisk); - replay(compute); - initializeDisk(); - Disk updatedDisk = disk.reload(); - compareDisk(imageDisk, updatedDisk); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedDisk(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getDisk(DISK_ID)).andReturn(null); - replay(compute); - initializeDisk(); - assertNull(disk.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedDisk(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getDisk(DISK_ID, Compute.DiskOption.fields())).andReturn(imageDisk); - replay(compute); - initializeDisk(); - Disk updatedDisk = disk.reload(Compute.DiskOption.fields()); - compareDisk(imageDisk, updatedDisk); - verify(compute); - } - - @Test - public void testCreateSnapshot() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "zone", "op")) - .build(); - SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); - SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID).build(); - expect(compute.create(snapshot)).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.createSnapshot(SNAPSHOT.getSnapshot())); - } - - @Test - public void testCreateSnapshotWithDescription() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "zone", "op")) - .build(); - SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); - SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID) - .setDescription("description") - .build(); - expect(compute.create(snapshot)).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.createSnapshot(SNAPSHOT.getSnapshot(), "description")); - } - - @Test - public void testCreateSnapshotWithOptions() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "zone", "op")) - .build(); - SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); - SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID).build(); - expect(compute.create(snapshot, Compute.OperationOption.fields())).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, - disk.createSnapshot(SNAPSHOT.getSnapshot(), Compute.OperationOption.fields())); - } - - @Test - public void testCreateSnapshotWithDescriptionAndOptions() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "zone", "op")) - .build(); - SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); - SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID) - .setDescription("description") - .build(); - expect(compute.create(snapshot, Compute.OperationOption.fields())).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, - disk.createSnapshot(SNAPSHOT.getSnapshot(), "description", - Compute.OperationOption.fields())); - } - - @Test - public void testCreateImage() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - ImageId imageId = ImageId.of(IMAGE.getImage()); - ImageInfo image = ImageInfo.of(imageId, DiskImageConfiguration.of(DISK_ID)); - expect(compute.create(image)).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.createImage(IMAGE.getImage())); - } - - @Test - public void testCreateImageWithDescription() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - ImageId imageId = ImageId.of(IMAGE.getImage()); - ImageInfo image = ImageInfo.newBuilder(imageId, DiskImageConfiguration.of(DISK_ID)) - .setDescription("description") - .build(); - expect(compute.create(image)).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.createImage(IMAGE.getImage(), "description")); - } - - @Test - public void testCreateImageWithOptions() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - ImageId imageId = ImageId.of(IMAGE.getImage()); - ImageInfo image = ImageInfo.of(imageId, DiskImageConfiguration.of(DISK_ID)); - expect(compute.create(image, Compute.OperationOption.fields())).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.createImage(IMAGE.getImage(), Compute.OperationOption.fields())); - } - - @Test - public void testCreateImageWithDescriptionAndOptions() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - ImageId imageId = ImageId.of(IMAGE.getImage()); - ImageInfo image = ImageInfo.newBuilder(imageId, DiskImageConfiguration.of(DISK_ID)) - .setDescription("description") - .build(); - expect(compute.create(image, Compute.OperationOption.fields())).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, - disk.createImage(IMAGE.getImage(), "description", Compute.OperationOption.fields())); - } - - @Test - public void testResizeOperation() { - initializeExpectedDisk(4); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "zone", "op")) - .build(); - expect(compute.resize(DISK_ID, 42L)).andReturn(operation); - replay(compute); - initializeDisk(); - assertSame(operation, disk.resize(42L)); - } - - @Test - public void testResizeNull() { - initializeExpectedDisk(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.resize(DISK_ID, 42L)).andReturn(null); - replay(compute); - initializeDisk(); - assertNull(disk.resize(42L)); - } - - public void compareDisk(Disk expected, Disk value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getDiskId(), value.getDiskId()); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getCreationStatus(), value.getCreationStatus()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.getAttachedInstances(), value.getAttachedInstances()); - assertEquals(expected.getLastAttachTimestamp(), value.getLastAttachTimestamp()); - assertEquals(expected.getLastDetachTimestamp(), value.getLastDetachTimestamp()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java deleted file mode 100644 index b6bf0d7da253..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class DiskTypeIdTest { - - private static final String PROJECT = "project"; - private static final String ZONE = "zone"; - private static final String DISK_TYPE = "diskType"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - DiskTypeId diskTypeId = DiskTypeId.of(PROJECT, ZONE, DISK_TYPE); - assertEquals(PROJECT, diskTypeId.getProject()); - assertEquals(ZONE, diskTypeId.getZone()); - assertEquals(DISK_TYPE, diskTypeId.getType()); - assertEquals(URL, diskTypeId.getSelfLink()); - diskTypeId = DiskTypeId.of(ZONE, DISK_TYPE); - assertNull(diskTypeId.getProject()); - assertEquals(ZONE, diskTypeId.getZone()); - assertEquals(DISK_TYPE, diskTypeId.getType()); - } - - @Test - public void testToAndFromUrl() { - DiskTypeId diskTypeId = DiskTypeId.of(PROJECT, ZONE, DISK_TYPE); - assertSame(diskTypeId, diskTypeId.setProjectId(PROJECT)); - compareDiskTypeId(diskTypeId, DiskTypeId.fromUrl(diskTypeId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid disk type URL"); - DiskTypeId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - DiskTypeId diskTypeId = DiskTypeId.of(PROJECT, ZONE, DISK_TYPE); - assertSame(diskTypeId, diskTypeId.setProjectId(PROJECT)); - compareDiskTypeId(diskTypeId, DiskTypeId.of(ZONE, DISK_TYPE).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(DiskTypeId.matchesUrl(DiskTypeId.of(PROJECT, ZONE, DISK_TYPE).getSelfLink())); - assertFalse(DiskTypeId.matchesUrl("notMatchingUrl")); - } - - private void compareDiskTypeId(DiskTypeId expected, DiskTypeId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getZone(), expected.getZone()); - assertEquals(expected.getType(), expected.getType()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java deleted file mode 100644 index 47ebb3447fa8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class DiskTypeTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final String VALID_DISK_SIZE = "10GB-10TB"; - private static final Long DEFAULT_DISK_SIZE_GB = 10L; - private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, DISK_TYPE_ID); - private static final DiskType DISK_TYPE = DiskType.newBuilder() - .setGeneratedId(GENERATED_ID) - .setDiskTypeId(DISK_TYPE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setValidDiskSize(VALID_DISK_SIZE) - .setDefaultDiskSizeGb(DEFAULT_DISK_SIZE_GB) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, DISK_TYPE.getGeneratedId()); - assertEquals(DISK_TYPE_ID, DISK_TYPE.getDiskTypeId()); - assertEquals(CREATION_TIMESTAMP, DISK_TYPE.getCreationTimestamp()); - assertEquals(DESCRIPTION, DISK_TYPE.getDescription()); - assertEquals(VALID_DISK_SIZE, DISK_TYPE.getValidDiskSize()); - assertEquals(DEFAULT_DISK_SIZE_GB, DISK_TYPE.getDefaultDiskSizeGb()); - assertEquals(DEPRECATION_STATUS, DISK_TYPE.getDeprecationStatus()); - } - - @Test - public void testToPbAndFromPb() { - compareDiskTypes(DISK_TYPE, DiskType.fromPb(DISK_TYPE.toPb())); - DiskType diskType = DiskType.newBuilder().setDiskTypeId(DISK_TYPE_ID).build(); - compareDiskTypes(diskType, DiskType.fromPb(diskType.toPb())); - } - - private void compareDiskTypes(DiskType expected, DiskType value) { - assertEquals(expected, value); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getDiskTypeId(), value.getDiskTypeId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getValidDiskSize(), value.getValidDiskSize()); - assertEquals(expected.getDefaultDiskSizeGb(), value.getDefaultDiskSizeGb()); - assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java deleted file mode 100644 index 560a766d3c65..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class ForwardingRuleIdTest { - - private static final String PROJECT = "project"; - private static final String REGION = "region"; - private static final String NAME = "rule"; - private static final String GLOBAL_URL = - "https://www.googleapis.com/compute/v1/projects/project/global/forwardingRules/rule"; - private static final String REGION_URL = "https://www.googleapis.com/compute/v1/projects/" - + "project/regions/region/forwardingRules/rule"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - GlobalForwardingRuleId forwardingRuleId = GlobalForwardingRuleId.of(PROJECT, NAME); - assertEquals(PROJECT, forwardingRuleId.getProject()); - assertEquals(NAME, forwardingRuleId.getRule()); - assertEquals(GLOBAL_URL, forwardingRuleId.getSelfLink()); - assertEquals(ForwardingRuleId.Type.GLOBAL, forwardingRuleId.getType()); - forwardingRuleId = GlobalForwardingRuleId.of(NAME); - assertNull(forwardingRuleId.getProject()); - assertEquals(NAME, forwardingRuleId.getRule()); - assertEquals(ForwardingRuleId.Type.GLOBAL, forwardingRuleId.getType()); - RegionForwardingRuleId regionForwardingRuleId = - RegionForwardingRuleId.of(PROJECT, REGION, NAME); - assertEquals(PROJECT, regionForwardingRuleId.getProject()); - assertEquals(REGION, regionForwardingRuleId.getRegion()); - assertEquals(NAME, regionForwardingRuleId.getRule()); - assertEquals(REGION_URL, regionForwardingRuleId.getSelfLink()); - assertEquals(ForwardingRuleId.Type.REGION, regionForwardingRuleId.getType()); - regionForwardingRuleId = RegionForwardingRuleId.of(RegionId.of(PROJECT, REGION), NAME); - assertEquals(PROJECT, regionForwardingRuleId.getProject()); - assertEquals(REGION, regionForwardingRuleId.getRegion()); - assertEquals(NAME, regionForwardingRuleId.getRule()); - assertEquals(REGION_URL, regionForwardingRuleId.getSelfLink()); - assertEquals(ForwardingRuleId.Type.REGION, regionForwardingRuleId.getType()); - regionForwardingRuleId = RegionForwardingRuleId.of(REGION, NAME); - assertNull(regionForwardingRuleId.getProject()); - assertEquals(REGION, regionForwardingRuleId.getRegion()); - assertEquals(NAME, regionForwardingRuleId.getRule()); - assertEquals(ForwardingRuleId.Type.REGION, regionForwardingRuleId.getType()); - } - - @Test - public void testToAndFromUrlGlobal() { - GlobalForwardingRuleId forwardingRuleId = GlobalForwardingRuleId.of(PROJECT, NAME); - compareGlobalForwardingRuleId(forwardingRuleId, - GlobalForwardingRuleId.fromUrl(forwardingRuleId.getSelfLink())); - RegionForwardingRuleId regionForwardingRuleId = - RegionForwardingRuleId.of(PROJECT, REGION, NAME); - compareRegionForwardingRuleId(regionForwardingRuleId, - RegionForwardingRuleId.fromUrl(regionForwardingRuleId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid global forwarding rule URL"); - GlobalForwardingRuleId.fromUrl("notMatchingUrl"); - } - - @Test - public void testToAndFromUrlRegion() { - RegionForwardingRuleId regionForwardingRuleId = - RegionForwardingRuleId.of(PROJECT, REGION, NAME); - compareRegionForwardingRuleId(regionForwardingRuleId, - RegionForwardingRuleId.fromUrl(regionForwardingRuleId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid region forwarding rule URL"); - RegionForwardingRuleId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - GlobalForwardingRuleId forwardingRuleId = GlobalForwardingRuleId.of(PROJECT, NAME); - assertSame(forwardingRuleId, forwardingRuleId.setProjectId(PROJECT)); - compareGlobalForwardingRuleId(forwardingRuleId, - GlobalForwardingRuleId.of(NAME).setProjectId(PROJECT)); - RegionForwardingRuleId regionForwardingRuleId = - RegionForwardingRuleId.of(PROJECT, REGION, NAME); - assertSame(regionForwardingRuleId, regionForwardingRuleId.setProjectId(PROJECT)); - compareRegionForwardingRuleId(regionForwardingRuleId, - RegionForwardingRuleId.of(REGION, NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(GlobalForwardingRuleId.matchesUrl( - GlobalForwardingRuleId.of(PROJECT, NAME).getSelfLink())); - assertFalse(GlobalForwardingRuleId.matchesUrl("notMatchingUrl")); - assertTrue(RegionForwardingRuleId.matchesUrl( - RegionForwardingRuleId.of(PROJECT, REGION, NAME).getSelfLink())); - assertFalse(RegionForwardingRuleId.matchesUrl("notMatchingUrl")); - } - - private void compareGlobalForwardingRuleId(GlobalForwardingRuleId expected, - GlobalForwardingRuleId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getRule(), expected.getRule()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } - - private void compareRegionForwardingRuleId(RegionForwardingRuleId expected, - RegionForwardingRuleId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getRegion(), expected.getRegion()); - assertEquals(expected.getRule(), expected.getRule()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java deleted file mode 100644 index e3b94dcefc1a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.compute.deprecated.DiskConfiguration.Type; - -import org.junit.Test; - -public class ImageDiskConfigurationTest { - - private static final Long SIZE = 42L; - private static final DiskTypeId DISK_TYPE = DiskTypeId.of("project", "zone", "type"); - private static final ImageId IMAGE = ImageId.of("project", "image"); - private static final String IMAGE_ID = "imageId"; - private static final ImageDiskConfiguration DISK_CONFIGURATION = - ImageDiskConfiguration.newBuilder(IMAGE) - .setSizeGb(SIZE) - .setDiskType(DISK_TYPE) - .setSourceImageId(IMAGE_ID) - .build(); - - @Test - public void testToBuilder() { - compareImageDiskConfiguration(DISK_CONFIGURATION, DISK_CONFIGURATION.toBuilder().build()); - ImageId newImageId = ImageId.of("newProject", "newImage"); - ImageDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() - .setSizeGb(24L) - .setSourceImage(newImageId) - .setSourceImageId("newImageId") - .build(); - assertEquals(24L, diskConfiguration.getSizeGb().longValue()); - assertEquals(newImageId, diskConfiguration.getSourceImage()); - assertEquals("newImageId", diskConfiguration.getSourceImageId()); - diskConfiguration = diskConfiguration.toBuilder() - .setSizeGb(SIZE) - .setSourceImage(IMAGE) - .setSourceImageId(IMAGE_ID) - .build(); - compareImageDiskConfiguration(DISK_CONFIGURATION, diskConfiguration); - } - - @Test - public void testToBuilderIncomplete() { - ImageDiskConfiguration diskConfiguration = ImageDiskConfiguration.of(IMAGE); - compareImageDiskConfiguration(diskConfiguration, diskConfiguration.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(DISK_TYPE, DISK_CONFIGURATION.getDiskType()); - assertEquals(SIZE, DISK_CONFIGURATION.getSizeGb()); - assertEquals(IMAGE, DISK_CONFIGURATION.getSourceImage()); - assertEquals(IMAGE_ID, DISK_CONFIGURATION.getSourceImageId()); - assertEquals(Type.IMAGE, DISK_CONFIGURATION.getType()); - } - - @Test - public void testToAndFromPb() { - assertTrue(DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb()) - instanceof ImageDiskConfiguration); - compareImageDiskConfiguration(DISK_CONFIGURATION, - DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb())); - } - - @Test - public void testOf() { - ImageDiskConfiguration configuration = ImageDiskConfiguration.of(IMAGE); - assertNull(configuration.getDiskType()); - assertNull(configuration.getSizeGb()); - assertNull(configuration.getSourceImageId()); - assertEquals(IMAGE, configuration.getSourceImage()); - assertEquals(Type.IMAGE, configuration.getType()); - } - - @Test - public void testSetProjectId() { - ImageDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of(DISK_TYPE.getZone(), DISK_TYPE.getType())) - .setSourceImage(ImageId.of(IMAGE.getImage())) - .build(); - compareImageDiskConfiguration(DISK_CONFIGURATION, diskConfiguration.setProjectId("project")); - } - - private void compareImageDiskConfiguration(ImageDiskConfiguration expected, - ImageDiskConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getDiskType(), value.getDiskType()); - assertEquals(expected.getSizeGb(), value.getSizeGb()); - assertEquals(expected.getSourceImage(), value.getSourceImage()); - assertEquals(expected.getSourceImageId(), value.getSourceImageId()); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java deleted file mode 100644 index 40f7ce1f16ee..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class ImageIdTest { - - private static final String PROJECT = "project"; - private static final String NAME = "image"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/global/images/image"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - ImageId imageId = ImageId.of(PROJECT, NAME); - assertEquals(PROJECT, imageId.getProject()); - assertEquals(NAME, imageId.getImage()); - assertEquals(URL, imageId.getSelfLink()); - imageId = ImageId.of(NAME); - assertNull(imageId.getProject()); - assertEquals(NAME, imageId.getImage()); - } - - @Test - public void testToAndFromUrl() { - ImageId imageId = ImageId.of(PROJECT, NAME); - compareImageId(imageId, ImageId.fromUrl(imageId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid image URL"); - ImageId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - ImageId imageId = ImageId.of(PROJECT, NAME); - assertSame(imageId, imageId.setProjectId(PROJECT)); - compareImageId(imageId, ImageId.of(NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(ImageId.matchesUrl(ImageId.of(PROJECT, NAME).getSelfLink())); - assertFalse(ImageId.matchesUrl("notMatchingUrl")); - } - - private void compareImageId(ImageId expected, ImageId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getImage(), expected.getImage()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java deleted file mode 100644 index fbb1b86d2e92..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.cloud.compute.deprecated.ImageConfiguration.SourceType; -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class ImageInfoTest { - - private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final ImageInfo.Status STATUS = ImageInfo.Status.READY; - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final Long DISK_SIZE_GB = 42L; - private static final String STORAGE_SOURCE = "source"; - private static final Long ARCHIVE_SIZE_BYTES = 24L; - private static final String SHA1_CHECKSUM = "checksum"; - private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); - private static final String SOURCE_DISK_ID = "diskId"; - private static final SourceType SOURCE_TYPE = SourceType.RAW; - private static final StorageImageConfiguration STORAGE_CONFIGURATION = - StorageImageConfiguration.newBuilder(STORAGE_SOURCE) - .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) - .setContainerType(StorageImageConfiguration.ContainerType.TAR) - .setSha1(SHA1_CHECKSUM) - .setSourceType(SOURCE_TYPE) - .build(); - private static final DiskImageConfiguration DISK_CONFIGURATION = - DiskImageConfiguration.newBuilder(SOURCE_DISK) - .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) - .setSourceDiskId(SOURCE_DISK_ID) - .setSourceType(SOURCE_TYPE) - .build(); - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, IMAGE_ID); - private static final ImageInfo STORAGE_IMAGE = - ImageInfo.newBuilder(IMAGE_ID, STORAGE_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .getCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - private static final ImageInfo DISK_IMAGE = - ImageInfo.newBuilder(IMAGE_ID, DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .getCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - - @Test - public void testToBuilder() { - compareImageInfo(STORAGE_IMAGE, STORAGE_IMAGE.toBuilder().build()); - compareImageInfo(DISK_IMAGE, DISK_IMAGE.toBuilder().build()); - ImageInfo imageInfo = STORAGE_IMAGE.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", imageInfo.getDescription()); - imageInfo = imageInfo.toBuilder().setDescription("description").build(); - compareImageInfo(STORAGE_IMAGE, imageInfo); - } - - @Test - public void testToBuilderIncomplete() { - ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, STORAGE_CONFIGURATION); - assertEquals(imageInfo, imageInfo.toBuilder().build()); - imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); - assertEquals(imageInfo, imageInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, STORAGE_IMAGE.getGeneratedId()); - assertEquals(IMAGE_ID, STORAGE_IMAGE.getImageId()); - assertEquals(CREATION_TIMESTAMP, STORAGE_IMAGE.getCreationTimestamp()); - assertEquals(DESCRIPTION, STORAGE_IMAGE.getDescription()); - assertEquals(STORAGE_CONFIGURATION, STORAGE_IMAGE.getConfiguration()); - assertEquals(STATUS, STORAGE_IMAGE.getStatus()); - assertEquals(DISK_SIZE_GB, STORAGE_IMAGE.getDiskSizeGb()); - assertEquals(LICENSES, STORAGE_IMAGE.getLicenses()); - assertEquals(DEPRECATION_STATUS, STORAGE_IMAGE.getDeprecationStatus()); - assertEquals(GENERATED_ID, DISK_IMAGE.getGeneratedId()); - assertEquals(IMAGE_ID, DISK_IMAGE.getImageId()); - assertEquals(CREATION_TIMESTAMP, DISK_IMAGE.getCreationTimestamp()); - assertEquals(DESCRIPTION, DISK_IMAGE.getDescription()); - assertEquals(DISK_CONFIGURATION, DISK_IMAGE.getConfiguration()); - assertEquals(STATUS, DISK_IMAGE.getStatus()); - assertEquals(DISK_SIZE_GB, DISK_IMAGE.getDiskSizeGb()); - assertEquals(LICENSES, DISK_IMAGE.getLicenses()); - assertEquals(DEPRECATION_STATUS, DISK_IMAGE.getDeprecationStatus()); - } - - @Test - public void testOf() { - ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, STORAGE_CONFIGURATION); - assertEquals(IMAGE_ID, imageInfo.getImageId()); - assertEquals(STORAGE_CONFIGURATION, imageInfo.getConfiguration()); - assertNull(imageInfo.getGeneratedId()); - assertNull(imageInfo.getCreationTimestamp()); - assertNull(imageInfo.getDescription()); - assertNull(imageInfo.getStatus()); - assertNull(imageInfo.getDiskSizeGb()); - assertNull(imageInfo.getLicenses()); - assertNull(imageInfo.getDeprecationStatus()); - imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); - assertEquals(IMAGE_ID, imageInfo.getImageId()); - assertEquals(DISK_CONFIGURATION, imageInfo.getConfiguration()); - assertNull(imageInfo.getGeneratedId()); - assertNull(imageInfo.getCreationTimestamp()); - assertNull(imageInfo.getDescription()); - assertNull(imageInfo.getStatus()); - assertNull(imageInfo.getDiskSizeGb()); - assertNull(imageInfo.getLicenses()); - assertNull(imageInfo.getDeprecationStatus()); - } - - @Test - public void testToAndFromPb() { - compareImageInfo(STORAGE_IMAGE, ImageInfo.fromPb(STORAGE_IMAGE.toPb())); - compareImageInfo(DISK_IMAGE, ImageInfo.fromPb(DISK_IMAGE.toPb())); - ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, StorageImageConfiguration.of(STORAGE_SOURCE)); - compareImageInfo(imageInfo, ImageInfo.fromPb(imageInfo.toPb())); - imageInfo = ImageInfo.of(IMAGE_ID, DiskImageConfiguration.of(SOURCE_DISK)); - compareImageInfo(imageInfo, ImageInfo.fromPb(imageInfo.toPb())); - } - - @Test - public void testSetProjectId() { - ImageInfo imageInfo = DISK_IMAGE.toBuilder() - .setImageId(ImageId.of("image")) - .setConfiguration(DISK_CONFIGURATION.toBuilder() - .setSourceDisk(DiskId.of("zone", "disk")) - .build()) - .build(); - compareImageInfo(DISK_IMAGE, imageInfo.setProjectId("project")); - } - - public void compareImageInfo(ImageInfo expected, ImageInfo value) { - assertEquals(expected, value); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getImageId(), value.getImageId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java deleted file mode 100644 index 84d84596e6d8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class ImageTest { - - private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final ImageInfo.Status STATUS = ImageInfo.Status.READY; - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final Long DISK_SIZE_GB = 42L; - private static final String STORAGE_SOURCE = "source"; - private static final Long ARCHIVE_SIZE_BYTES = 24L; - private static final String SHA1_CHECKSUM = "checksum"; - private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); - private static final String SOURCE_DISK_ID = "diskId"; - private static final ImageConfiguration.SourceType SOURCE_TYPE = - ImageConfiguration.SourceType.RAW; - private static final StorageImageConfiguration STORAGE_CONFIGURATION = - StorageImageConfiguration.newBuilder(STORAGE_SOURCE) - .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) - .setContainerType(StorageImageConfiguration.ContainerType.TAR) - .setSha1(SHA1_CHECKSUM) - .setSourceType(SOURCE_TYPE) - .build(); - private static final DiskImageConfiguration DISK_CONFIGURATION = - DiskImageConfiguration.newBuilder(SOURCE_DISK) - .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) - .setSourceDiskId(SOURCE_DISK_ID) - .setSourceType(SOURCE_TYPE) - .build(); - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, IMAGE_ID); - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Image image; - private Image diskImage; - private Image storageImage; - - private void initializeExpectedImage(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - diskImage = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .getCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - storageImage = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, STORAGE_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .getCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeImage() { - image = new Image.Builder(compute, IMAGE_ID, DISK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .getCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - } - - @Test - public void testToBuilder() { - initializeExpectedImage(12); - compareImage(diskImage, diskImage.toBuilder().build()); - compareImage(storageImage, storageImage.toBuilder().build()); - Image newImage = diskImage.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newImage.getDescription()); - newImage = newImage.toBuilder().setDescription("description").build(); - compareImage(diskImage, newImage); - } - - @Test - public void testToBuilderIncomplete() { - initializeExpectedImage(6); - ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); - Image image = - new Image(serviceMockReturnsOptions, new ImageInfo.BuilderImpl(imageInfo)); - compareImage(image, image.toBuilder().build()); - } - - @Test - public void testBuilder() { - initializeExpectedImage(3); - assertEquals(GENERATED_ID, diskImage.getGeneratedId()); - assertEquals(IMAGE_ID, diskImage.getImageId()); - assertEquals(CREATION_TIMESTAMP, diskImage.getCreationTimestamp()); - assertEquals(DESCRIPTION, diskImage.getDescription()); - assertEquals(DISK_CONFIGURATION, diskImage.getConfiguration()); - assertEquals(STATUS, diskImage.getStatus()); - assertEquals(DISK_SIZE_GB, diskImage.getDiskSizeGb()); - assertEquals(LICENSES, diskImage.getLicenses()); - assertEquals(DEPRECATION_STATUS, diskImage.getDeprecationStatus()); - assertSame(serviceMockReturnsOptions, diskImage.getCompute()); - assertEquals(GENERATED_ID, storageImage.getGeneratedId()); - assertEquals(IMAGE_ID, storageImage.getImageId()); - assertEquals(CREATION_TIMESTAMP, storageImage.getCreationTimestamp()); - assertEquals(DESCRIPTION, storageImage.getDescription()); - assertEquals(STORAGE_CONFIGURATION, storageImage.getConfiguration()); - assertEquals(STATUS, storageImage.getStatus()); - assertEquals(DISK_SIZE_GB, storageImage.getDiskSizeGb()); - assertEquals(LICENSES, storageImage.getLicenses()); - assertEquals(DEPRECATION_STATUS, storageImage.getDeprecationStatus()); - assertSame(serviceMockReturnsOptions, storageImage.getCompute()); - ImageId imageId = ImageId.of("otherImage"); - Image image = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, STORAGE_CONFIGURATION) - .setImageId(imageId) - .setConfiguration(DISK_CONFIGURATION) - .build(); - assertNull(image.getGeneratedId()); - assertEquals(imageId, image.getImageId()); - assertNull(image.getCreationTimestamp()); - assertNull(image.getDescription()); - assertEquals(DISK_CONFIGURATION, image.getConfiguration()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - assertSame(serviceMockReturnsOptions, image.getCompute()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedImage(12); - compareImage(diskImage, - Image.fromPb(serviceMockReturnsOptions, diskImage.toPb())); - compareImage(storageImage, - Image.fromPb(serviceMockReturnsOptions, storageImage.toPb())); - Image image = - new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, DISK_CONFIGURATION).build(); - compareImage(image, Image.fromPb(serviceMockReturnsOptions, image.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedImage(3); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - expect(compute.deleteImage(IMAGE_ID)).andReturn(operation); - replay(compute); - initializeImage(); - assertSame(operation, image.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedImage(2); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteImage(IMAGE_ID)).andReturn(null); - replay(compute); - initializeImage(); - assertNull(image.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedImage(2); - Compute.ImageOption[] expectedOptions = {Compute.ImageOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getImage(IMAGE_ID, expectedOptions)).andReturn(diskImage); - replay(compute); - initializeImage(); - assertTrue(image.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedImage(2); - Compute.ImageOption[] expectedOptions = {Compute.ImageOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getImage(IMAGE_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeImage(); - assertFalse(image.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedImage(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getImage(IMAGE_ID)).andReturn(storageImage); - replay(compute); - initializeImage(); - Image updateImage = image.reload(); - compareImage(storageImage, updateImage); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedImage(2); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getImage(IMAGE_ID)).andReturn(null); - replay(compute); - initializeImage(); - assertNull(image.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedImage(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getImage(IMAGE_ID, Compute.ImageOption.fields())).andReturn(storageImage); - replay(compute); - initializeImage(); - Image updateImage = image.reload(Compute.ImageOption.fields()); - compareImage(storageImage, updateImage); - verify(compute); - } - - @Test - public void testDeprecateImage() { - initializeExpectedImage(3); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - DeprecationStatus status = - DeprecationStatus.of(DeprecationStatus.Status.DEPRECATED, IMAGE_ID); - expect(compute.deprecate(IMAGE_ID, status)).andReturn(operation); - replay(compute); - initializeImage(); - assertSame(operation, image.deprecate(status)); - } - - @Test - public void testDeprecateNull() { - initializeExpectedImage(2); - expect(compute.getOptions()).andReturn(mockOptions); - DeprecationStatus status = - DeprecationStatus.of(DeprecationStatus.Status.DEPRECATED, IMAGE_ID); - expect(compute.deprecate(IMAGE_ID, status)).andReturn(null); - replay(compute); - initializeImage(); - assertNull(image.deprecate(status)); - } - - public void compareImage(Image expected, Image value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getImageId(), value.getImageId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java deleted file mode 100644 index 53527d7e8793..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class InstanceIdTest { - - private static final String PROJECT = "project"; - private static final String ZONE = "zone"; - private static final String NAME = "instance"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - InstanceId instanceId = InstanceId.of(PROJECT, ZONE, NAME); - assertEquals(PROJECT, instanceId.getProject()); - assertEquals(ZONE, instanceId.getZone()); - assertEquals(NAME, instanceId.getInstance()); - assertEquals(URL, instanceId.getSelfLink()); - instanceId = InstanceId.of(ZoneId.of(PROJECT, ZONE), NAME); - assertEquals(PROJECT, instanceId.getProject()); - assertEquals(ZONE, instanceId.getZone()); - assertEquals(NAME, instanceId.getInstance()); - assertEquals(URL, instanceId.getSelfLink()); - instanceId = InstanceId.of(ZONE, NAME); - assertNull(instanceId.getProject()); - assertEquals(ZONE, instanceId.getZone()); - assertEquals(NAME, instanceId.getInstance()); - } - - @Test - public void testToAndFromUrl() { - InstanceId instanceId = InstanceId.of(PROJECT, ZONE, NAME); - compareInstanceId(instanceId, InstanceId.fromUrl(instanceId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid instance URL"); - InstanceId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - InstanceId instanceId = InstanceId.of(PROJECT, ZONE, NAME); - assertSame(instanceId, instanceId.setProjectId(PROJECT)); - compareInstanceId(instanceId, InstanceId.of(ZONE, NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(InstanceId.matchesUrl(InstanceId.of(PROJECT, ZONE, NAME).getSelfLink())); - assertFalse(InstanceId.matchesUrl("notMatchingUrl")); - } - - private void compareInstanceId(InstanceId expected, InstanceId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getZone(), expected.getZone()); - assertEquals(expected.getInstance(), expected.getInstance()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java deleted file mode 100644 index 2eb0d32c7701..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class InstanceInfoTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); - private static final InstanceInfo.Status STATUS = InstanceInfo.Status.RUNNING; - private static final String STATUS_MESSAGE = "statusMessage"; - private static final Tags TAGS = Tags.of("tag1", "tag2"); - private static final MachineTypeId MACHINE_TYPE = MachineTypeId.of("project", "zone", "type"); - private static final Boolean CAN_IP_FORWARD = true; - private static final NetworkInterface NETWORK_INTERFACE = - NetworkInterface.of(NetworkId.of("project", "network")); - private static final List NETWORK_INTERFACES = - ImmutableList.of(NETWORK_INTERFACE); - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final AttachedDisk ATTACHED_DISK = - AttachedDisk.of(AttachedDisk.PersistentDiskConfiguration.of(DISK_ID)); - private static final List ATTACHED_DISKS = ImmutableList.of(ATTACHED_DISK); - private static final Metadata METADATA = Metadata.newBuilder() - .add("key1", "value1") - .add("key2", "value2") - .build(); - private static final ServiceAccount SERVICE_ACCOUNT = - ServiceAccount.of("email", ImmutableList.of("scope1")); - private static final List SERVICE_ACCOUNTS = ImmutableList.of(SERVICE_ACCOUNT); - private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); - private static final String CPU_PLATFORM = "cpuPlatform"; - private static final InstanceInfo INSTANCE_INFO = - InstanceInfo.newBuilder(INSTANCE_ID, MACHINE_TYPE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setTags(TAGS) - .setCanIpForward(CAN_IP_FORWARD) - .setNetworkInterfaces(NETWORK_INTERFACES) - .setAttachedDisks(ATTACHED_DISKS) - .setMetadata(METADATA) - .setServiceAccounts(SERVICE_ACCOUNTS) - .setSchedulingOptions(SCHEDULING_OPTIONS) - .setCpuPlatform(CPU_PLATFORM) - .build(); - - @Test - public void testToBuilder() { - compareInstanceInfo(INSTANCE_INFO, INSTANCE_INFO.toBuilder().build()); - InstanceInfo instance = INSTANCE_INFO.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", instance.getDescription()); - instance = instance.toBuilder().setDescription(DESCRIPTION).build(); - compareInstanceInfo(INSTANCE_INFO, instance); - } - - @Test - public void testToBuilderIncomplete() { - InstanceInfo instanceInfo = InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, - NETWORK_INTERFACE); - assertEquals(instanceInfo, instanceInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, INSTANCE_INFO.getGeneratedId()); - assertEquals(INSTANCE_ID, INSTANCE_INFO.getInstanceId()); - assertEquals(CREATION_TIMESTAMP, INSTANCE_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, INSTANCE_INFO.getDescription()); - assertEquals(STATUS, INSTANCE_INFO.getStatus()); - assertEquals(STATUS_MESSAGE, INSTANCE_INFO.getStatusMessage()); - assertEquals(TAGS, INSTANCE_INFO.getTags()); - assertEquals(MACHINE_TYPE, INSTANCE_INFO.getMachineType()); - assertEquals(CAN_IP_FORWARD, INSTANCE_INFO.canIpForward()); - assertEquals(NETWORK_INTERFACES, INSTANCE_INFO.getNetworkInterfaces()); - assertEquals(ATTACHED_DISKS, INSTANCE_INFO.getAttachedDisks()); - assertEquals(METADATA, INSTANCE_INFO.getMetadata()); - assertEquals(SERVICE_ACCOUNTS, INSTANCE_INFO.getServiceAccounts()); - assertEquals(SCHEDULING_OPTIONS, INSTANCE_INFO.getSchedulingOptions()); - assertEquals(CPU_PLATFORM, INSTANCE_INFO.getCpuPlatform()); - InstanceInfo instanceInfo = InstanceInfo.newBuilder(INSTANCE_ID, MACHINE_TYPE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setTags(TAGS) - .setCanIpForward(CAN_IP_FORWARD) - .setNetworkInterfaces(NETWORK_INTERFACE) - .setAttachedDisks(ATTACHED_DISK) - .setMetadata(METADATA) - .setServiceAccounts(SERVICE_ACCOUNTS) - .setSchedulingOptions(SCHEDULING_OPTIONS) - .setCpuPlatform(CPU_PLATFORM) - .build(); - compareInstanceInfo(INSTANCE_INFO, instanceInfo); - } - - @Test - public void testOf() { - InstanceInfo instance = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); - assertNull(instance.getGeneratedId()); - assertEquals(INSTANCE_ID, instance.getInstanceId()); - assertNull(instance.getCreationTimestamp()); - assertNull(instance.getDescription()); - assertNull(instance.getStatus()); - assertNull(instance.getStatusMessage()); - assertNull(instance.getTags()); - assertEquals(MACHINE_TYPE, instance.getMachineType()); - assertNull(instance.canIpForward()); - assertEquals(NETWORK_INTERFACES, instance.getNetworkInterfaces()); - assertEquals(ATTACHED_DISKS, instance.getAttachedDisks()); - assertNull(instance.getMetadata()); - assertNull(instance.getServiceAccounts()); - assertNull(instance.getSchedulingOptions()); - assertNull(instance.getCpuPlatform()); - } - - @Test - public void testToAndFromPb() { - compareInstanceInfo(INSTANCE_INFO, InstanceInfo.fromPb(INSTANCE_INFO.toPb())); - InstanceInfo instance = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); - compareInstanceInfo(instance, InstanceInfo.fromPb(instance.toPb())); - } - - @Test - public void testSetProjectId() { - InstanceInfo instance = InstanceInfo.of( - InstanceId.of("zone", "instance"), - MachineTypeId.of("zone", "type"), - AttachedDisk.of(AttachedDisk.PersistentDiskConfiguration.of(DiskId.of("zone", "disk"))), - NetworkInterface.of(NetworkId.of("project", "network"))); - InstanceInfo instanceWithProject = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); - compareInstanceInfo(instanceWithProject, instance.setProjectId("project")); - } - - public void compareInstanceInfo(InstanceInfo expected, InstanceInfo value) { - assertEquals(expected, value); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getInstanceId(), value.getInstanceId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getStatusMessage(), value.getStatusMessage()); - assertEquals(expected.getTags(), value.getTags()); - assertEquals(expected.getMachineType(), value.getMachineType()); - assertEquals(expected.canIpForward(), value.canIpForward()); - assertEquals(expected.getNetworkInterfaces(), value.getNetworkInterfaces()); - assertEquals(expected.getAttachedDisks(), value.getAttachedDisks()); - assertEquals(expected.getMetadata(), value.getMetadata()); - assertEquals(expected.getServiceAccounts(), value.getServiceAccounts()); - assertEquals(expected.getSchedulingOptions(), value.getSchedulingOptions()); - assertEquals(expected.getCpuPlatform(), value.getCpuPlatform()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java deleted file mode 100644 index 98b29f1f86d9..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; - -import org.junit.Test; - -import java.util.List; -import java.util.Map; - -public class InstanceTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); - private static final InstanceInfo.Status STATUS = InstanceInfo.Status.RUNNING; - private static final String STATUS_MESSAGE = "statusMessage"; - private static final Tags TAGS = Tags.newBuilder() - .setValues("tag1", "tag2") - .setFingerprint("fingerprint") - .build(); - private static final MachineTypeId MACHINE_TYPE = MachineTypeId.of("project", "zone", "type"); - private static final Boolean CAN_IP_FORWARD = true; - private static final NetworkInterface NETWORK_INTERFACE = - NetworkInterface.of(NetworkId.of("project", "network")); - private static final List NETWORK_INTERFACES = - ImmutableList.of(NETWORK_INTERFACE); - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final AttachedDisk ATTACHED_DISK = - AttachedDisk.of(AttachedDisk.PersistentDiskConfiguration.of(DISK_ID)); - private static final List ATTACHED_DISKS = ImmutableList.of(ATTACHED_DISK); - private static final Metadata METADATA = Metadata.newBuilder() - .add("key1", "value1") - .add("key2", "value2") - .setFingerprint("fingerprint") - .build(); - private static final ServiceAccount SERVICE_ACCOUNT = - ServiceAccount.of("email", ImmutableList.of("scope1")); - private static final List SERVICE_ACCOUNTS = - ImmutableList.of(SERVICE_ACCOUNT); - private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); - private static final String CPU_PLATFORM = "cpuPlatform"; - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Instance instance; - private Instance expectedInstance; - - private void initializeExpectedInstance(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - expectedInstance = new Instance.Builder(serviceMockReturnsOptions, INSTANCE_ID, MACHINE_TYPE, - ATTACHED_DISK, NETWORK_INTERFACE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setTags(TAGS) - .setCanIpForward(CAN_IP_FORWARD) - .setMetadata(METADATA) - .setServiceAccounts(SERVICE_ACCOUNTS) - .setSchedulingOptions(SCHEDULING_OPTIONS) - .setCpuPlatform(CPU_PLATFORM) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeInstance() { - instance = new Instance.Builder(compute, INSTANCE_ID, MACHINE_TYPE, - ATTACHED_DISK, NETWORK_INTERFACE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setTags(TAGS) - .setCanIpForward(CAN_IP_FORWARD) - .setMetadata(METADATA) - .setServiceAccounts(SERVICE_ACCOUNTS) - .setSchedulingOptions(SCHEDULING_OPTIONS) - .setCpuPlatform(CPU_PLATFORM) - .build(); - } - - @Test - public void testToBuilder() { - initializeExpectedInstance(8); - compareInstance(expectedInstance, expectedInstance.toBuilder().build()); - Instance newInstance = expectedInstance.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newInstance.getDescription()); - newInstance = newInstance.toBuilder().setDescription("description").build(); - compareInstance(expectedInstance, newInstance); - } - - @Test - public void testToBuilderIncomplete() { - initializeExpectedInstance(5); - InstanceInfo instanceInfo = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); - Instance instance = - new Instance(serviceMockReturnsOptions, new InstanceInfo.BuilderImpl(instanceInfo)); - compareInstance(instance, instance.toBuilder().build()); - } - - @Test - public void testBuilder() { - initializeExpectedInstance(2); - assertEquals(GENERATED_ID, expectedInstance.getGeneratedId()); - assertEquals(INSTANCE_ID, expectedInstance.getInstanceId()); - assertEquals(CREATION_TIMESTAMP, expectedInstance.getCreationTimestamp()); - assertEquals(DESCRIPTION, expectedInstance.getDescription()); - assertEquals(STATUS, expectedInstance.getStatus()); - assertEquals(STATUS_MESSAGE, expectedInstance.getStatusMessage()); - assertEquals(TAGS, expectedInstance.getTags()); - assertEquals(MACHINE_TYPE, expectedInstance.getMachineType()); - assertEquals(CAN_IP_FORWARD, expectedInstance.canIpForward()); - assertEquals(NETWORK_INTERFACES, expectedInstance.getNetworkInterfaces()); - assertEquals(ATTACHED_DISKS, expectedInstance.getAttachedDisks()); - assertEquals(METADATA, expectedInstance.getMetadata()); - assertEquals(SERVICE_ACCOUNTS, expectedInstance.getServiceAccounts()); - assertEquals(SCHEDULING_OPTIONS, expectedInstance.getSchedulingOptions()); - assertEquals(CPU_PLATFORM, expectedInstance.getCpuPlatform()); - assertSame(serviceMockReturnsOptions, expectedInstance.getCompute()); - InstanceInfo instanceInfo = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); - Instance instance = - new Instance(serviceMockReturnsOptions, new InstanceInfo.BuilderImpl(instanceInfo)); - assertNull(instance.getGeneratedId()); - assertEquals(INSTANCE_ID, instance.getInstanceId()); - assertNull(instance.getCreationTimestamp()); - assertNull(instance.getDescription()); - assertNull(instance.getStatus()); - assertNull(instance.getStatusMessage()); - assertNull(instance.getTags()); - assertEquals(MACHINE_TYPE, instance.getMachineType()); - assertNull(instance.canIpForward()); - assertEquals(NETWORK_INTERFACES, instance.getNetworkInterfaces()); - assertEquals(ATTACHED_DISKS, instance.getAttachedDisks()); - assertNull(instance.getMetadata()); - assertNull(instance.getServiceAccounts()); - assertNull(instance.getSchedulingOptions()); - assertNull(instance.getCpuPlatform()); - assertSame(serviceMockReturnsOptions, instance.getCompute()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedInstance(8); - compareInstance(expectedInstance, - Instance.fromPb(serviceMockReturnsOptions, expectedInstance.toPb())); - Instance instance = new Instance.Builder(serviceMockReturnsOptions, INSTANCE_ID, MACHINE_TYPE, - ATTACHED_DISK, NETWORK_INTERFACE).build(); - compareInstance(instance, Instance.fromPb(serviceMockReturnsOptions, instance.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.deleteInstance(INSTANCE_ID)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteInstance(INSTANCE_ID)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedInstance(1); - Compute.InstanceOption[] expectedOptions = {Compute.InstanceOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getInstance(INSTANCE_ID, expectedOptions)).andReturn(expectedInstance); - replay(compute); - initializeInstance(); - assertTrue(instance.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedInstance(1); - Compute.InstanceOption[] expectedOptions = {Compute.InstanceOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getInstance(INSTANCE_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeInstance(); - assertFalse(instance.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedInstance(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getInstance(INSTANCE_ID)).andReturn(expectedInstance); - replay(compute); - initializeInstance(); - Instance updatedInstance = instance.reload(); - compareInstance(expectedInstance, updatedInstance); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getInstance(INSTANCE_ID)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedInstance(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getInstance(INSTANCE_ID, - Compute.InstanceOption.fields())).andReturn(expectedInstance); - replay(compute); - initializeInstance(); - Instance updateInstance = instance.reload(Compute.InstanceOption.fields()); - compareInstance(expectedInstance, updateInstance); - verify(compute); - } - - @Test - public void testAddAccessConfig() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.of("192.168.1.1"); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.addAccessConfig(INSTANCE_ID, "nic0", accessConfig)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.addAccessConfig("nic0", accessConfig)); - } - - @Test - public void testAddAccessConfig_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.of("192.168.1.1"); - expect(compute.addAccessConfig(INSTANCE_ID, "nic0", accessConfig)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.addAccessConfig("nic0", accessConfig)); - } - - @Test - public void testAddAccessConfigWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.of("192.168.1.1"); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.addAccessConfig( - INSTANCE_ID, "nic0", accessConfig, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, - instance.addAccessConfig("nic0", accessConfig, Compute.OperationOption.fields())); - } - - @Test - public void testAttachDisk() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.attachDisk(INSTANCE_ID, configuration)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.attachDisk(configuration)); - } - - @Test - public void testAttachDisk_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - expect(compute.attachDisk(INSTANCE_ID, configuration)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.attachDisk(configuration)); - } - - @Test - public void testAttachDiskWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.attachDisk(INSTANCE_ID, configuration, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.attachDisk(configuration, Compute.OperationOption.fields())); - } - - @Test - public void testAttachDiskName() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.attachDisk("dev0", configuration)); - } - - @Test - public void testAttachDiskName_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.attachDisk("dev0", configuration)); - } - - @Test - public void testAttachDiskNameWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, - instance.attachDisk("dev0", configuration, Compute.OperationOption.fields())); - } - - @Test - public void testAttachDiskNameIndex() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration, 1)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.attachDisk("dev0", configuration, 1)); - } - - @Test - public void testAttachDiskNameIndex_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration, 1)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.attachDisk("dev0", configuration, 1)); - } - - @Test - public void testAttachDiskNameIndexWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - AttachedDisk.PersistentDiskConfiguration configuration = - AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.attachDisk( - INSTANCE_ID, "dev0", configuration, 1, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, - instance.attachDisk("dev0", configuration, 1, Compute.OperationOption.fields())); - } - - @Test - public void testDeleteAccessConfig() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.deleteAccessConfig(INSTANCE_ID, "nic0", "NAT")).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.deleteAccessConfig("nic0", "NAT")); - } - - @Test - public void testDeleteAccessConfig_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteAccessConfig(INSTANCE_ID, "nic0", "NAT")).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.deleteAccessConfig("nic0", "NAT")); - } - - @Test - public void testDeleteAccessConfigWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.deleteAccessConfig( - INSTANCE_ID, "nic0", "NAT", Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, - instance.deleteAccessConfig("nic0", "NAT", Compute.OperationOption.fields())); - } - - @Test - public void testDetachDisk() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.detachDisk(INSTANCE_ID, "dev0")).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.detachDisk("dev0")); - } - - @Test - public void testDetachDisk_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.detachDisk(INSTANCE_ID, "dev0")).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.detachDisk("dev0")); - } - - @Test - public void testDetachDiskWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.detachDisk(INSTANCE_ID, "dev0", Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.detachDisk("dev0", Compute.OperationOption.fields())); - } - - @Test - public void testGetSerialPortOutputWithNumber() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSerialPortOutput(INSTANCE_ID, 2)).andReturn("output"); - replay(compute); - initializeInstance(); - assertSame("output", instance.getSerialPortOutput(2)); - } - - @Test - public void testGetSerialPortOutput() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSerialPortOutput(INSTANCE_ID)).andReturn("output"); - replay(compute); - initializeInstance(); - assertSame("output", instance.getSerialPortOutput()); - } - - @Test - public void testResetOperation() { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.reset(INSTANCE_ID)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.reset()); - } - - @Test - public void testResetNull() { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.reset(INSTANCE_ID)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.reset()); - } - - @Test - public void testSetDiskAutodelete() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.setDiskAutoDelete(INSTANCE_ID, "dev0", true)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setDiskAutoDelete("dev0", true)); - } - - @Test - public void testSetDiskAutodelete_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.setDiskAutoDelete(INSTANCE_ID, "dev0", false)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setDiskAutoDelete("dev0", false)); - } - - @Test - public void testSetDiskAutodeleteWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.setDiskAutoDelete(INSTANCE_ID, "dev0", true, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, - instance.setDiskAutoDelete("dev0", true, Compute.OperationOption.fields())); - } - - @Test - public void testSetMachineType() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.setMachineType(INSTANCE_ID, MACHINE_TYPE)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setMachineType(MACHINE_TYPE)); - } - - @Test - public void testSetMachineType_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.setMachineType(INSTANCE_ID, MACHINE_TYPE)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setMachineType(MACHINE_TYPE)); - } - - @Test - public void testSetMachineTypeWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.setMachineType(INSTANCE_ID, MACHINE_TYPE, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setMachineType(MACHINE_TYPE, Compute.OperationOption.fields())); - } - - @Test - public void testSetMetadata() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - Metadata metadata = Metadata.newBuilder().add("k", "v").setFingerprint("fingerprint").build(); - expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setMetadata(metadata)); - } - - @Test - public void testSetMetadata_Null() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Metadata metadata = Metadata.newBuilder().add("k", "v").setFingerprint("fingerprint").build(); - expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setMetadata(metadata)); - } - - @Test - public void testSetMetadataWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - Metadata metadata = Metadata.newBuilder().add("k", "v").setFingerprint("fingerprint").build(); - expect(compute.setMetadata(INSTANCE_ID, metadata, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setMetadata(metadata, Compute.OperationOption.fields())); - } - - @Test - public void testSetMetadataFromMap() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - Map metadataMap = ImmutableMap.of("k", "v"); - Metadata metadata = - Metadata.newBuilder().setValues(metadataMap).setFingerprint("fingerprint").build(); - expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setMetadata(metadataMap)); - } - - @Test - public void testSetMetadataFromMap_Null() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Map metadataMap = ImmutableMap.of("k", "v"); - Metadata metadata = - Metadata.newBuilder().setValues(metadataMap).setFingerprint("fingerprint").build(); - expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setMetadata(metadataMap)); - } - - @Test - public void testSetMetadataFromMapWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - Map metadataMap = ImmutableMap.of("k", "v"); - Metadata metadata = - Metadata.newBuilder().setValues(metadataMap).setFingerprint("fingerprint").build(); - expect(compute.setMetadata(INSTANCE_ID, metadata, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setMetadata(metadataMap, Compute.OperationOption.fields())); - } - - @Test - public void testSetSchedulingOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - expect(compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setSchedulingOptions(schedulingOptions)); - } - - @Test - public void testSetSchedulingOptions_Null() throws Exception { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - expect(compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setSchedulingOptions(schedulingOptions)); - } - - @Test - public void testSetSchedulingOptionsWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - expect(compute.setSchedulingOptions( - INSTANCE_ID, schedulingOptions, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, - instance.setSchedulingOptions(schedulingOptions, Compute.OperationOption.fields())); - } - - @Test - public void testSetTags() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - Tags tags = Tags.newBuilder().setValues("v1", "v2").setFingerprint("fingerprint").build(); - expect(compute.setTags(INSTANCE_ID, tags)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setTags(tags)); - } - - @Test - public void testSetTags_Null() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Tags tags = Tags.newBuilder().setValues("v1", "v2").setFingerprint("fingerprint").build(); - expect(compute.setTags(INSTANCE_ID, tags)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setTags(tags)); - } - - @Test - public void testSetTagsWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - Tags tags = Tags.newBuilder().setValues("v1", "v2").setFingerprint("fingerprint").build(); - expect(compute.setTags(INSTANCE_ID, tags, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setTags(tags, Compute.OperationOption.fields())); - } - - @Test - public void testSetTagsFromList() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - List tagList = ImmutableList.of("v1", "v2"); - Tags tags = Tags.newBuilder().setValues(tagList).setFingerprint("fingerprint").build(); - expect(compute.setTags(INSTANCE_ID, tags)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setTags(tagList)); - } - - @Test - public void testSetTagsFromList_Null() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - List tagList = ImmutableList.of("v1", "v2"); - Tags tags = Tags.newBuilder().setValues(tagList).setFingerprint("fingerprint").build(); - expect(compute.setTags(INSTANCE_ID, tags)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.setTags(tagList)); - } - - @Test - public void testSetTagsFromListWithOptions() throws Exception { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - List tagList = ImmutableList.of("v1", "v2"); - Tags tags = Tags.newBuilder().setValues(tagList).setFingerprint("fingerprint").build(); - expect(compute.setTags(INSTANCE_ID, tags, Compute.OperationOption.fields())) - .andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.setTags(tagList, Compute.OperationOption.fields())); - } - - @Test - public void testStartOperation() { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.start(INSTANCE_ID)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.start()); - } - - @Test - public void testStartNull() { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.start(INSTANCE_ID)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.start()); - } - - @Test - public void testStopOperation() { - initializeExpectedInstance(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZoneOperationId.of("project", "op")) - .build(); - expect(compute.stop(INSTANCE_ID)).andReturn(operation); - replay(compute); - initializeInstance(); - assertSame(operation, instance.stop()); - } - - @Test - public void testStopNull() { - initializeExpectedInstance(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.stop(INSTANCE_ID)).andReturn(null); - replay(compute); - initializeInstance(); - assertNull(instance.stop()); - } - - public void compareInstance(Instance expected, Instance value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getInstanceId(), value.getInstanceId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getStatusMessage(), value.getStatusMessage()); - assertEquals(expected.getTags(), value.getTags()); - assertEquals(expected.getMachineType(), value.getMachineType()); - assertEquals(expected.canIpForward(), value.canIpForward()); - assertEquals(expected.getNetworkInterfaces(), value.getNetworkInterfaces()); - assertEquals(expected.getAttachedDisks(), value.getAttachedDisks()); - assertEquals(expected.getMetadata(), value.getMetadata()); - assertEquals(expected.getServiceAccounts(), value.getServiceAccounts()); - assertEquals(expected.getSchedulingOptions(), value.getSchedulingOptions()); - assertEquals(expected.getCpuPlatform(), value.getCpuPlatform()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java deleted file mode 100644 index 3cfa46744f5a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class LicenseIdTest { - - private static final String PROJECT = "project"; - private static final String LICENSE = "license"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/global/licenses/license"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - LicenseId licenseId = LicenseId.of(PROJECT, LICENSE); - assertEquals(PROJECT, licenseId.getProject()); - assertEquals(LICENSE, licenseId.getLicense()); - assertEquals(URL, licenseId.getSelfLink()); - licenseId = LicenseId.of(LICENSE); - assertNull(licenseId.getProject()); - assertEquals(LICENSE, licenseId.getLicense()); - } - - @Test - public void testToAndFromUrl() { - LicenseId licenseId = LicenseId.of(PROJECT, LICENSE); - compareLicenseId(licenseId, LicenseId.fromUrl(licenseId.getSelfLink())); - } - - @Test - public void testSetProjectId() { - LicenseId licenseId = LicenseId.of(PROJECT, LICENSE); - assertSame(licenseId, licenseId.setProjectId(PROJECT)); - compareLicenseId(licenseId, LicenseId.of(LICENSE).setProjectId(PROJECT)); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid license URL"); - LicenseId.fromUrl("notMatchingUrl"); - } - - @Test - public void testMatchesUrl() { - assertTrue(LicenseId.matchesUrl(LicenseId.of(PROJECT, LICENSE).getSelfLink())); - assertFalse(LicenseId.matchesUrl("notMatchingUrl")); - } - - private void compareLicenseId(LicenseId expected, LicenseId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getLicense(), expected.getLicense()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java deleted file mode 100644 index 35ca4a869a73..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class LicenseTest { - - private static final LicenseId LICENSE_ID = LicenseId.of("project", "license"); - private static final Boolean CHARGES_USE_FEE = true; - private static final License LICENSE = new License(LICENSE_ID, CHARGES_USE_FEE); - - @Test - public void testBuilder() { - assertEquals(LICENSE_ID, LICENSE.getLicenseId()); - assertEquals(CHARGES_USE_FEE, LICENSE.chargesUseFee()); - } - - @Test - public void testToAndFromPb() { - License license = License.fromPb(LICENSE.toPb()); - compareLicenses(LICENSE, license); - assertEquals(LICENSE_ID.getProject(), license.getLicenseId().getProject()); - assertEquals(LICENSE_ID.getLicense(), license.getLicenseId().getLicense()); - } - - private void compareLicenses(License expected, License value) { - assertEquals(expected, value); - assertEquals(expected.getLicenseId(), value.getLicenseId()); - assertEquals(expected.chargesUseFee(), value.chargesUseFee()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java deleted file mode 100644 index 1e068ab2b792..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class MachineTypeIdTest { - - private static final String PROJECT = "project"; - private static final String ZONE = "zone"; - private static final String TYPE = "type"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/zones/zone/machineTypes/type"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - MachineTypeId machineTypeId = MachineTypeId.of(PROJECT, ZONE, TYPE); - assertEquals(PROJECT, machineTypeId.getProject()); - assertEquals(ZONE, machineTypeId.getZone()); - assertEquals(TYPE, machineTypeId.getType()); - assertEquals(URL, machineTypeId.getSelfLink()); - machineTypeId = MachineTypeId.of(ZONE, TYPE); - assertNull(machineTypeId.getProject()); - assertEquals(ZONE, machineTypeId.getZone()); - assertEquals(TYPE, machineTypeId.getType()); - } - - @Test - public void testToAndFromUrl() { - MachineTypeId machineTypeId = MachineTypeId.of(PROJECT, ZONE, TYPE); - compareMachineTypeId(machineTypeId, MachineTypeId.fromUrl(machineTypeId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid machine type URL"); - MachineTypeId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - MachineTypeId machineTypeId = MachineTypeId.of(PROJECT, ZONE, TYPE); - assertSame(machineTypeId, machineTypeId.setProjectId(PROJECT)); - compareMachineTypeId(machineTypeId, MachineTypeId.of(ZONE, TYPE).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(MachineTypeId.matchesUrl(MachineTypeId.of(PROJECT, ZONE, TYPE).getSelfLink())); - assertFalse(MachineTypeId.matchesUrl("notMatchingUrl")); - } - - private void compareMachineTypeId(MachineTypeId expected, MachineTypeId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getZone(), expected.getZone()); - assertEquals(expected.getType(), expected.getType()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java deleted file mode 100644 index 8eeb601d86e8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class MachineTypeTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); - private static final Integer CPUS = 1; - private static final Integer MEMORY_MB = 2; - private static final List SCRATCH_DISKS = ImmutableList.of(3); - private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; - private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, MACHINE_TYPE_ID); - private static final MachineType MACHINE_TYPE = MachineType.newBuilder() - .setGeneratedId(GENERATED_ID) - .setMachineTypeId(MACHINE_TYPE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setCpus(CPUS) - .setMemoryMb(MEMORY_MB) - .setScratchDisksSizeGb(SCRATCH_DISKS) - .setMaximumPersistentDisks(MAXIMUM_PERSISTENT_DISKS) - .setMaximumPersistentDisksSizeGb(MAXIMUM_PERSISTENT_DISKS_SIZE_GB) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, MACHINE_TYPE.getGeneratedId()); - assertEquals(MACHINE_TYPE_ID, MACHINE_TYPE.getMachineTypeId()); - assertEquals(CREATION_TIMESTAMP, MACHINE_TYPE.getCreationTimestamp()); - assertEquals(DESCRIPTION, MACHINE_TYPE.getDescription()); - assertEquals(CPUS, MACHINE_TYPE.getCpus()); - assertEquals(MEMORY_MB, MACHINE_TYPE.getMemoryMb()); - assertEquals(SCRATCH_DISKS, MACHINE_TYPE.getScratchDisksSizeGb()); - assertEquals(MAXIMUM_PERSISTENT_DISKS, MACHINE_TYPE.getMaximumPersistentDisks()); - assertEquals(MAXIMUM_PERSISTENT_DISKS_SIZE_GB, MACHINE_TYPE.getMaximumPersistentDisksSizeGb()); - assertEquals(DEPRECATION_STATUS, MACHINE_TYPE.getDeprecationStatus()); - } - - @Test - public void testToPbAndFromPb() { - compareMachineTypes(MACHINE_TYPE, MachineType.fromPb(MACHINE_TYPE.toPb())); - MachineType machineType = MachineType.newBuilder().setMachineTypeId(MACHINE_TYPE_ID).build(); - compareMachineTypes(machineType, MachineType.fromPb(machineType.toPb())); - } - - private void compareMachineTypes(MachineType expected, MachineType value) { - assertEquals(expected, value); - assertEquals(expected.getMachineTypeId(), value.getMachineTypeId()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getCpus(), value.getCpus()); - assertEquals(expected.getMemoryMb(), value.getMemoryMb()); - assertEquals(expected.getScratchDisksSizeGb(), value.getScratchDisksSizeGb()); - assertEquals(expected.getMaximumPersistentDisks(), value.getMaximumPersistentDisks()); - assertEquals(expected.getMaximumPersistentDisksSizeGb(), - value.getMaximumPersistentDisksSizeGb()); - assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java deleted file mode 100644 index 393543acf26d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.common.collect.ImmutableMap; - -import org.junit.Test; - -import java.util.Map; - -public class MetadataTest { - - private static final Metadata METADATA = Metadata.newBuilder() - .add("key1", "value1") - .add("key2", "value2") - .build(); - - @Test - public void testToBuilder() { - Metadata metadata = METADATA.toBuilder().setFingerprint("newFingerprint").build(); - assertEquals("newFingerprint", metadata.getFingerprint()); - compareMetadata(METADATA, metadata.toBuilder().setFingerprint(null).build()); - } - - @Test - public void testBuilder() { - assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), METADATA.getValues()); - assertNull(METADATA.getFingerprint()); - Metadata metadata = Metadata.newBuilder() - .setValues(ImmutableMap.of("key1", "value1", "key2", "value2")) - .build(); - assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), metadata.getValues()); - assertNull(metadata.getFingerprint()); - metadata = Metadata.newBuilder() - .setValues(ImmutableMap.of("key1", "value1", "key2", "value2")) - .setFingerprint("fingerprint") - .build(); - assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), metadata.getValues()); - assertEquals("fingerprint", metadata.getFingerprint()); - } - - @Test - public void testOf() { - Map map = ImmutableMap.of("key1", "value1", "key2", "value2"); - compareMetadata(METADATA, Metadata.of(map)); - } - - @Test - public void testToAndFromPb() { - compareMetadata(METADATA, Metadata.fromPb(METADATA.toPb())); - Metadata metadata = Metadata.newBuilder() - .setValues(ImmutableMap.of("key1", "value1", "key2", "value2")) - .setFingerprint("fingerprint") - .build(); - compareMetadata(metadata, Metadata.fromPb(metadata.toPb())); - } - - public void compareMetadata(Metadata expected, Metadata value) { - assertEquals(expected, value); - assertEquals(expected.getFingerprint(), value.getFingerprint()); - assertEquals(expected.getValues(), value.getValues()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java deleted file mode 100644 index be749284ef51..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class NetworkIdTest { - - private static final String PROJECT = "project"; - private static final String NETWORK = "network"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/global/networks/network"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - NetworkId networkId = NetworkId.of(PROJECT, NETWORK); - assertEquals(PROJECT, networkId.getProject()); - assertEquals(NETWORK, networkId.getNetwork()); - assertEquals(URL, networkId.getSelfLink()); - networkId = NetworkId.of(NETWORK); - assertNull(networkId.getProject()); - assertEquals(NETWORK, networkId.getNetwork()); - } - - @Test - public void testToAndFromUrl() { - NetworkId networkId = NetworkId.of(PROJECT, NETWORK); - compareNetworkId(networkId, NetworkId.fromUrl(networkId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid network URL"); - NetworkId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - NetworkId networkId = NetworkId.of(PROJECT, NETWORK); - assertSame(networkId, networkId.setProjectId(PROJECT)); - compareNetworkId(networkId, NetworkId.of(NETWORK).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(NetworkId.matchesUrl(NetworkId.of(PROJECT, NETWORK).getSelfLink())); - assertFalse(NetworkId.matchesUrl("notMatchingUrl")); - } - - private void compareNetworkId(NetworkId expected, NetworkId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getNetwork(), expected.getNetwork()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java deleted file mode 100644 index f0b313df927d..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class NetworkInfoTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final SubnetworkId SUBNETWORK1 = SubnetworkId.of("project", "region1", "network1"); - private static final SubnetworkId SUBNETWORK2 = SubnetworkId.of("project", "region2", "network2"); - private static final List SUBNETWORKS = ImmutableList.of(SUBNETWORK1, SUBNETWORK2); - private static final String GATEWAY_ADDRESS = "192.168.1.1"; - private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); - private static final String IP_RANGE = "192.168.0.0/16"; - private static final Boolean AUTO_CREATE_SUBNETWORKS = true; - private static final StandardNetworkConfiguration NETWORK_CONFIGURATION = - new StandardNetworkConfiguration(IP_RANGE, GATEWAY_ADDRESS); - private static final SubnetNetworkConfiguration SUBNET_NETWORK_CONFIGURATION = - new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); - private static final NetworkInfo NETWORK_INFO = - NetworkInfo.newBuilder(NETWORK_ID, NETWORK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .build(); - private static final NetworkInfo SUBNET_NETWORK_INFO = - NetworkInfo.newBuilder(NETWORK_ID, SUBNET_NETWORK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .build(); - - @Test - public void testToBuilder() { - compareNetworkInfo(NETWORK_INFO, NETWORK_INFO.toBuilder().build()); - NetworkInfo networkInfo = NETWORK_INFO.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", networkInfo.getDescription()); - networkInfo = networkInfo.toBuilder().setDescription("description").build(); - compareNetworkInfo(NETWORK_INFO, networkInfo); - compareNetworkInfo(SUBNET_NETWORK_INFO, SUBNET_NETWORK_INFO.toBuilder().build()); - networkInfo = SUBNET_NETWORK_INFO.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", networkInfo.getDescription()); - networkInfo = networkInfo.toBuilder().setDescription("description").build(); - compareNetworkInfo(SUBNET_NETWORK_INFO, networkInfo); - } - - @Test - public void testToBuilderIncomplete() { - NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); - assertEquals(networkInfo, networkInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, NETWORK_INFO.getGeneratedId()); - assertEquals(NETWORK_ID, NETWORK_INFO.getNetworkId()); - assertEquals(CREATION_TIMESTAMP, NETWORK_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, NETWORK_INFO.getDescription()); - assertEquals(NETWORK_CONFIGURATION, NETWORK_INFO.getConfiguration()); - assertEquals(GENERATED_ID, SUBNET_NETWORK_INFO.getGeneratedId()); - assertEquals(NETWORK_ID, SUBNET_NETWORK_INFO.getNetworkId()); - assertEquals(CREATION_TIMESTAMP, SUBNET_NETWORK_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, SUBNET_NETWORK_INFO.getDescription()); - assertEquals(SUBNET_NETWORK_CONFIGURATION, SUBNET_NETWORK_INFO.getConfiguration()); - } - - @Test - public void testOf() { - NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); - assertNull(networkInfo.getGeneratedId()); - assertEquals(NETWORK_ID, NETWORK_INFO.getNetworkId()); - assertEquals(NETWORK_CONFIGURATION, NETWORK_INFO.getConfiguration()); - assertNull(networkInfo.getCreationTimestamp()); - assertNull(networkInfo.getDescription()); - } - - @Test - public void testToAndFromPb() { - compareNetworkInfo(NETWORK_INFO, NetworkInfo.fromPb(NETWORK_INFO.toPb())); - compareNetworkInfo(SUBNET_NETWORK_INFO, NetworkInfo.fromPb(SUBNET_NETWORK_INFO.toPb())); - NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); - compareNetworkInfo(networkInfo, NetworkInfo.fromPb(networkInfo.toPb())); - } - - @Test - public void testSetProjectId() { - NetworkInfo networkInfo = NETWORK_INFO.toBuilder() - .setNetworkId(NetworkId.of("network")) - .build(); - compareNetworkInfo(NETWORK_INFO, networkInfo.setProjectId("project")); - } - - public void compareNetworkInfo(NetworkInfo expected, NetworkInfo value) { - assertEquals(expected, value); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getNetworkId(), value.getNetworkId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java deleted file mode 100644 index 5b561e41fa64..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class NetworkInterfaceTest { - - private static final String NAME = "networkInterface"; - private static final NetworkId NETWORK = NetworkId.of("project", "network"); - private static final String NETWORK_IP = "192.168.1.1"; - private static final SubnetworkId SUBNETWORK = SubnetworkId.of("project", "region", "subnetwork"); - private static final AccessConfig ACCESS_CONFIG = - AccessConfig.newBuilder() - .setName("accessConfig") - .setNatIp("192.168.1.1") - .setType(AccessConfig.Type.ONE_TO_ONE_NAT) - .build(); - private static final List ACCESS_CONFIGURATIONS = - ImmutableList.of(ACCESS_CONFIG); - private static final NetworkInterface NETWORK_INTERFACE = NetworkInterface.newBuilder(NETWORK) - .setName(NAME) - .setNetworkIp(NETWORK_IP) - .setSubnetwork(SUBNETWORK) - .setAccessConfigurations(ACCESS_CONFIGURATIONS) - .build(); - - @Test - public void testAccessConfigToBuilder() { - AccessConfig accessConfig = - ACCESS_CONFIG.toBuilder().setName("newName").build(); - assertEquals("newName", accessConfig.getName()); - compareAccessConfig(ACCESS_CONFIG, accessConfig.toBuilder().setName("accessConfig").build()); - } - - @Test - public void testAccessConfigToBuilderIncomplete() { - AccessConfig accessConfig = AccessConfig.of(); - compareAccessConfig(accessConfig, accessConfig.toBuilder().build()); - } - - @Test - public void testToBuilder() { - compareNetworkInterface(NETWORK_INTERFACE, NETWORK_INTERFACE.toBuilder().build()); - NetworkInterface networkInterface = - NETWORK_INTERFACE.toBuilder().setName("newInterface").build(); - assertEquals("newInterface", networkInterface.getName()); - networkInterface = networkInterface.toBuilder().setName(NAME).build(); - compareNetworkInterface(NETWORK_INTERFACE, networkInterface); - } - - @Test - public void testToBuilderIncomplete() { - NetworkInterface networkInterface = NetworkInterface.of(NETWORK); - assertEquals(networkInterface, networkInterface.toBuilder().build()); - networkInterface = NetworkInterface.of(NETWORK.getNetwork()); - assertEquals(networkInterface, networkInterface.toBuilder().build()); - } - - @Test - public void testAccessConfigBuilder() { - assertEquals("accessConfig", ACCESS_CONFIG.getName()); - assertEquals("192.168.1.1", ACCESS_CONFIG.getNatIp()); - assertEquals(AccessConfig.Type.ONE_TO_ONE_NAT, ACCESS_CONFIG.getType()); - } - - @Test - public void testBuilder() { - assertEquals(NAME, NETWORK_INTERFACE.getName()); - assertEquals(NETWORK, NETWORK_INTERFACE.getNetwork()); - assertEquals(NETWORK_IP, NETWORK_INTERFACE.getNetworkIp()); - assertEquals(SUBNETWORK, NETWORK_INTERFACE.getSubnetwork()); - assertEquals(ACCESS_CONFIGURATIONS, NETWORK_INTERFACE.getAccessConfigurations()); - NetworkInterface networkInterface = NetworkInterface.newBuilder("network") - .setName(NAME) - .setNetworkIp(NETWORK_IP) - .setSubnetwork(SUBNETWORK) - .setAccessConfigurations(ACCESS_CONFIG) - .build(); - assertEquals(NAME, networkInterface.getName()); - assertEquals(NetworkId.of("network"), networkInterface.getNetwork()); - assertEquals(NETWORK_IP, networkInterface.getNetworkIp()); - assertEquals(SUBNETWORK, networkInterface.getSubnetwork()); - assertEquals(ACCESS_CONFIGURATIONS, networkInterface.getAccessConfigurations()); - } - - @Test - public void testAccessConfigOf() { - AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); - assertNull(accessConfig.getName()); - assertEquals("192.168.1.1", accessConfig.getNatIp()); - assertNull(accessConfig.getType()); - accessConfig = AccessConfig.of(); - assertNull(accessConfig.getName()); - assertNull(accessConfig.getNatIp()); - assertNull(accessConfig.getType()); - } - - @Test - public void testOf() { - NetworkInterface networkInterface = NetworkInterface.of(NETWORK); - assertNull(networkInterface.getName()); - assertEquals(NETWORK, networkInterface.getNetwork()); - assertNull(networkInterface.getNetworkIp()); - assertNull(networkInterface.getSubnetwork()); - networkInterface = NetworkInterface.of(NETWORK.getNetwork()); - assertNull(networkInterface.getName()); - assertNull(networkInterface.getNetwork().getProject()); - assertEquals(NETWORK.getNetwork(), networkInterface.getNetwork().getNetwork()); - assertNull(networkInterface.getNetworkIp()); - assertNull(networkInterface.getSubnetwork()); - } - - @Test - public void testAccessConfigToAndFromPb() { - AccessConfig accessConfig = - AccessConfig.fromPb(ACCESS_CONFIG.toPb()); - compareAccessConfig(ACCESS_CONFIG, accessConfig); - accessConfig = AccessConfig.of(); - compareAccessConfig(accessConfig, AccessConfig.fromPb(accessConfig.toPb())); - } - - @Test - public void testToAndFromPb() { - NetworkInterface networkInterface = NetworkInterface.fromPb(NETWORK_INTERFACE.toPb()); - compareNetworkInterface(NETWORK_INTERFACE, networkInterface); - networkInterface = NetworkInterface.of(NETWORK); - compareNetworkInterface(networkInterface, NetworkInterface.fromPb(networkInterface.toPb())); - } - - @Test - public void testSetProjectId() { - NetworkInterface networkInterface = NetworkInterface.of(NETWORK); - compareNetworkInterface(networkInterface, - NetworkInterface.of(NetworkId.of("network")).setProjectId("project")); - networkInterface = NETWORK_INTERFACE.toBuilder() - .setNetwork(NetworkId.of("network")) - .setSubnetwork(SubnetworkId.of("region", "subnetwork")) - .build(); - compareNetworkInterface(NETWORK_INTERFACE, networkInterface.setProjectId("project")); - } - - public void compareAccessConfig(AccessConfig expected, AccessConfig value) { - assertEquals(expected, value); - assertEquals(expected.getName(), value.getName()); - assertEquals(expected.getNatIp(), value.getNatIp()); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.hashCode(), value.hashCode()); - } - - public void compareNetworkInterface(NetworkInterface expected, NetworkInterface value) { - assertEquals(expected, value); - assertEquals(expected.getName(), value.getName()); - assertEquals(expected.getNetwork(), value.getNetwork()); - assertEquals(expected.getNetworkIp(), value.getNetworkIp()); - assertEquals(expected.getSubnetwork(), value.getSubnetwork()); - assertEquals(expected.getAccessConfigurations(), value.getAccessConfigurations()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java deleted file mode 100644 index 86ea9fb61a76..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class NetworkTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final SubnetworkId SUBNETWORK1 = SubnetworkId.of("project", "region1", "network1"); - private static final SubnetworkId SUBNETWORK2 = SubnetworkId.of("project", "region2", "network2"); - private static final List SUBNETWORKS = ImmutableList.of(SUBNETWORK1, SUBNETWORK2); - private static final String GATEWAY_ADDRESS = "192.168.1.1"; - private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); - private static final String IP_RANGE = "192.168.0.0/16"; - private static final Boolean AUTO_CREATE_SUBNETWORKS = true; - private static final StandardNetworkConfiguration NETWORK_CONFIGURATION = - new StandardNetworkConfiguration(IP_RANGE, GATEWAY_ADDRESS); - private static final SubnetNetworkConfiguration SUBNET_NETWORK_CONFIGURATION = - new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Network network; - private Network standardNetwork; - private Network subnetNetwork; - - private void initializeExpectedNetwork(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - standardNetwork = - new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, NETWORK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .build(); - subnetNetwork = - new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, SUBNET_NETWORK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeNetwork() { - network = new Network.Builder(compute, NETWORK_ID, NETWORK_CONFIGURATION) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .build(); - } - - @Test - public void testToBuilder() { - initializeExpectedNetwork(9); - compareNetwork(standardNetwork, standardNetwork.toBuilder().build()); - Network newNetwork = standardNetwork.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newNetwork.getDescription()); - newNetwork = newNetwork.toBuilder().setDescription("description").build(); - compareNetwork(standardNetwork, newNetwork); - } - - @Test - public void testToBuilderIncomplete() { - initializeExpectedNetwork(6); - NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); - Network network = - new Network(serviceMockReturnsOptions, new NetworkInfo.BuilderImpl(networkInfo)); - compareNetwork(network, network.toBuilder().build()); - } - - @Test - public void testBuilder() { - initializeExpectedNetwork(2); - assertEquals(GENERATED_ID, standardNetwork.getGeneratedId()); - assertEquals(NETWORK_ID, standardNetwork.getNetworkId()); - assertEquals(CREATION_TIMESTAMP, standardNetwork.getCreationTimestamp()); - assertEquals(DESCRIPTION, standardNetwork.getDescription()); - assertEquals(NETWORK_CONFIGURATION, standardNetwork.getConfiguration()); - assertSame(serviceMockReturnsOptions, standardNetwork.getCompute()); - assertEquals(GENERATED_ID, subnetNetwork.getGeneratedId()); - assertEquals(NETWORK_ID, subnetNetwork.getNetworkId()); - assertEquals(CREATION_TIMESTAMP, subnetNetwork.getCreationTimestamp()); - assertEquals(DESCRIPTION, subnetNetwork.getDescription()); - assertEquals(SUBNET_NETWORK_CONFIGURATION, subnetNetwork.getConfiguration()); - assertSame(serviceMockReturnsOptions, subnetNetwork.getCompute()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedNetwork(12); - compareNetwork(standardNetwork, - Network.fromPb(serviceMockReturnsOptions, standardNetwork.toPb())); - compareNetwork(subnetNetwork, - Network.fromPb(serviceMockReturnsOptions, subnetNetwork.toPb())); - Network network = - new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, NETWORK_CONFIGURATION).build(); - compareNetwork(network, Network.fromPb(serviceMockReturnsOptions, network.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedNetwork(3); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - expect(compute.deleteNetwork(NETWORK_ID.getNetwork())).andReturn(operation); - replay(compute); - initializeNetwork(); - assertSame(operation, network.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedNetwork(2); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteNetwork(NETWORK_ID.getNetwork())).andReturn(null); - replay(compute); - initializeNetwork(); - assertNull(network.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedNetwork(2); - Compute.NetworkOption[] expectedOptions = {Compute.NetworkOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getNetwork(NETWORK_ID.getNetwork(), expectedOptions)) - .andReturn(standardNetwork); - replay(compute); - initializeNetwork(); - assertTrue(network.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedNetwork(2); - Compute.NetworkOption[] expectedOptions = {Compute.NetworkOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getNetwork(NETWORK_ID.getNetwork(), expectedOptions)).andReturn(null); - replay(compute); - initializeNetwork(); - assertFalse(network.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedNetwork(4); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getNetwork(NETWORK_ID.getNetwork())).andReturn(standardNetwork); - replay(compute); - initializeNetwork(); - Network updatedNetwork = network.reload(); - compareNetwork(standardNetwork, updatedNetwork); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedNetwork(2); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getNetwork(NETWORK_ID.getNetwork())).andReturn(null); - replay(compute); - initializeNetwork(); - assertNull(network.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedNetwork(4); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getNetwork(NETWORK_ID.getNetwork(), Compute.NetworkOption.fields())) - .andReturn(standardNetwork); - replay(compute); - initializeNetwork(); - Network updatedNetwork = network.reload(Compute.NetworkOption.fields()); - compareNetwork(standardNetwork, updatedNetwork); - verify(compute); - } - - @Test - public void testCreateSubnetwork() throws Exception { - initializeExpectedNetwork(3); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(RegionOperationId.of(SUBNETWORK1.getRegionId(), "op")) - .build(); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.create(SubnetworkInfo.of(SUBNETWORK1, NETWORK_ID, IP_RANGE))) - .andReturn(operation); - replay(compute); - initializeNetwork(); - assertSame(operation, network.createSubnetwork(SUBNETWORK1, IP_RANGE)); - verify(compute); - } - - @Test - public void testCreateSubnetworkWithOptions() throws Exception { - initializeExpectedNetwork(3); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(RegionOperationId.of(SUBNETWORK1.getRegionId(), "op")) - .build(); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.create(SubnetworkInfo.of(SUBNETWORK1, NETWORK_ID, IP_RANGE), - Compute.OperationOption.fields())).andReturn(operation); - replay(compute); - initializeNetwork(); - assertSame(operation, - network.createSubnetwork(SUBNETWORK1, IP_RANGE, Compute.OperationOption.fields())); - verify(compute); - } - - public void compareNetwork(Network expected, Network value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getNetworkId(), value.getNetworkId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getConfiguration(), value.getConfiguration()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java deleted file mode 100644 index 5b375d6be5f3..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class OperationIdTest { - - private static final String PROJECT = "project"; - private static final String ZONE = "zone"; - private static final String REGION = "region"; - private static final String NAME = "op"; - private static final String GLOBAL_URL = - "https://www.googleapis.com/compute/v1/projects/project/global/operations/op"; - private static final String ZONE_URL = - "https://www.googleapis.com/compute/v1/projects/project/zones/zone/operations/op"; - private static final String REGION_URL = - "https://www.googleapis.com/compute/v1/projects/project/regions/region/operations/op"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - GlobalOperationId operationId = GlobalOperationId.of(PROJECT, NAME); - assertEquals(OperationId.Type.GLOBAL, operationId.getType()); - assertEquals(PROJECT, operationId.getProject()); - assertEquals(NAME, operationId.getOperation()); - assertEquals(GLOBAL_URL, operationId.getSelfLink()); - operationId = GlobalOperationId.of(NAME); - assertEquals(OperationId.Type.GLOBAL, operationId.getType()); - assertNull(operationId.getProject()); - assertEquals(NAME, operationId.getOperation()); - ZoneOperationId zoneOperationId = ZoneOperationId.of(PROJECT, ZONE, NAME); - assertEquals(OperationId.Type.ZONE, zoneOperationId.getType()); - assertEquals(PROJECT, zoneOperationId.getProject()); - assertEquals(ZONE, zoneOperationId.getZone()); - assertEquals(NAME, zoneOperationId.getOperation()); - assertEquals(ZONE_URL, zoneOperationId.getSelfLink()); - zoneOperationId = ZoneOperationId.of(ZONE, NAME); - assertEquals(OperationId.Type.ZONE, zoneOperationId.getType()); - assertNull(zoneOperationId.getProject()); - assertEquals(ZONE, zoneOperationId.getZone()); - assertEquals(NAME, zoneOperationId.getOperation()); - zoneOperationId = ZoneOperationId.of(ZoneId.of(PROJECT, ZONE), NAME); - assertEquals(OperationId.Type.ZONE, zoneOperationId.getType()); - assertEquals(PROJECT, zoneOperationId.getProject()); - assertEquals(ZONE, zoneOperationId.getZone()); - assertEquals(NAME, zoneOperationId.getOperation()); - RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME); - assertEquals(OperationId.Type.REGION, regionOperationId.getType()); - assertEquals(PROJECT, regionOperationId.getProject()); - assertEquals(REGION, regionOperationId.getRegion()); - assertEquals(NAME, regionOperationId.getOperation()); - assertEquals(REGION_URL, regionOperationId.getSelfLink()); - regionOperationId = RegionOperationId.of(REGION, NAME); - assertEquals(OperationId.Type.REGION, regionOperationId.getType()); - assertNull(regionOperationId.getProject()); - assertEquals(REGION, regionOperationId.getRegion()); - assertEquals(NAME, regionOperationId.getOperation()); - regionOperationId = RegionOperationId.of(RegionId.of(PROJECT, REGION), NAME); - assertEquals(OperationId.Type.REGION, regionOperationId.getType()); - assertEquals(PROJECT, regionOperationId.getProject()); - assertEquals(REGION, regionOperationId.getRegion()); - assertEquals(NAME, regionOperationId.getOperation()); - } - - @Test - public void testToAndFromUrlGlobal() { - GlobalOperationId operationId = GlobalOperationId.of(PROJECT, NAME); - compareOperationId(operationId, GlobalOperationId.fromUrl(operationId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid global operation URL"); - GlobalOperationId.fromUrl("notMatchingUrl"); - } - - @Test - public void testToAndFromUrlRegion() { - RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME); - compareRegionOperationId(regionOperationId, - RegionOperationId.fromUrl(regionOperationId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid region operation URL"); - RegionOperationId.fromUrl("notMatchingUrl"); - } - - @Test - public void testToAndFromUrlZone() { - ZoneOperationId zoneOperationId = ZoneOperationId.of(PROJECT, ZONE, NAME); - compareZoneOperationId(zoneOperationId, ZoneOperationId.fromUrl(zoneOperationId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid zone operation URL"); - ZoneOperationId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - GlobalOperationId operationId = GlobalOperationId.of(PROJECT, NAME); - assertSame(operationId, operationId.setProjectId(PROJECT)); - compareOperationId(operationId, GlobalOperationId.of(NAME).setProjectId(PROJECT)); - ZoneOperationId zoneOperationId = ZoneOperationId.of(PROJECT, ZONE, NAME); - assertSame(zoneOperationId, zoneOperationId.setProjectId(PROJECT)); - compareZoneOperationId(zoneOperationId, ZoneOperationId.of(ZONE, NAME).setProjectId(PROJECT)); - RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME); - assertSame(regionOperationId, regionOperationId.setProjectId(PROJECT)); - compareRegionOperationId(regionOperationId, - RegionOperationId.of(REGION, NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(GlobalOperationId.matchesUrl(GlobalOperationId.of(PROJECT, NAME).getSelfLink())); - assertFalse(GlobalOperationId.matchesUrl("notMatchingUrl")); - assertTrue( - RegionOperationId.matchesUrl(RegionOperationId.of(PROJECT, REGION, NAME).getSelfLink())); - assertFalse(RegionOperationId.matchesUrl("notMatchingUrl")); - assertTrue(ZoneOperationId.matchesUrl(ZoneOperationId.of(PROJECT, REGION, NAME).getSelfLink())); - assertFalse(ZoneOperationId.matchesUrl("notMatchingUrl")); - } - - private void compareOperationId(GlobalOperationId expected, GlobalOperationId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getOperation(), expected.getOperation()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } - - private void compareZoneOperationId(ZoneOperationId expected, ZoneOperationId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getZone(), expected.getZone()); - assertEquals(expected.getOperation(), expected.getOperation()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } - - private void compareRegionOperationId(RegionOperationId expected, RegionOperationId value) { - assertEquals(expected, value); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getRegion(), expected.getRegion()); - assertEquals(expected.getOperation(), expected.getOperation()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java deleted file mode 100644 index 60798c55ce8a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.api.core.ApiClock; -import com.google.api.core.CurrentMillisClock; -import com.google.cloud.RetryOption; -import com.google.cloud.compute.deprecated.Operation.OperationError; -import com.google.cloud.compute.deprecated.Operation.OperationWarning; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; - -import org.junit.After; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -import java.util.List; -import org.threeten.bp.Duration; - -public class OperationTest { - - private static final OperationError OPERATION_ERROR1 = - new OperationError("code1", "location1", "message1"); - private static final OperationError OPERATION_ERROR2 = - new OperationError("code2", "location2", "message2"); - private static final OperationWarning OPERATION_WARNING1 = - new OperationWarning("code1", "message1", ImmutableMap.of("k1", "v1")); - private static final OperationWarning OPERATION_WARNING2 = - new OperationWarning("code2", "location2", ImmutableMap.of("k2", "v2")); - private static final String GENERATED_ID = "1"; - private static final String CLIENT_OPERATION_ID = "clientOperationId"; - private static final String OPERATION_TYPE = "delete"; - private static final String TARGET_LINK = "targetLink"; - private static final String TARGET_ID = "42"; - private static final Operation.Status STATUS = Operation.Status.DONE; - private static final String STATUS_MESSAGE = "statusMessage"; - private static final String USER = "user"; - private static final Integer PROGRESS = 100; - private static final Long INSERT_TIME = 1453293540000L; - private static final Long START_TIME = 1453293420000L; - private static final Long END_TIME = 1453293480000L; - private static final List ERRORS = - ImmutableList.of(OPERATION_ERROR1, OPERATION_ERROR2); - private static final List WARNINGS = - ImmutableList.of(OPERATION_WARNING1, OPERATION_WARNING2); - private static final Integer HTTP_ERROR_STATUS_CODE = 404; - private static final String HTTP_ERROR_MESSAGE = "NOT FOUND"; - private static final String DESCRIPTION = "description"; - private static final GlobalOperationId GLOBAL_OPERATION_ID = - GlobalOperationId.of("project", "op"); - private static final ZoneOperationId ZONE_OPERATION_ID = - ZoneOperationId.of("project", "zone", "op"); - private static final RegionOperationId REGION_OPERATION_ID = - RegionOperationId.of("project", "region", "op"); - - @Rule - public final ExpectedException thrown = ExpectedException.none(); - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Operation globalOperation; - private Operation regionOperation; - private Operation zoneOperation; - private Operation operation; - - private void initializeExpectedOperation(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - globalOperation = new Operation.Builder(serviceMockReturnsOptions) - .getGeneratedId(GENERATED_ID) - .setOperationId(GLOBAL_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - zoneOperation = new Operation.Builder(serviceMockReturnsOptions) - .getGeneratedId(GENERATED_ID) - .setOperationId(ZONE_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - regionOperation = new Operation.Builder(serviceMockReturnsOptions) - .getGeneratedId(GENERATED_ID) - .setOperationId(REGION_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeOperation() { - operation = new Operation.Builder(compute) - .getGeneratedId(GENERATED_ID) - .setOperationId(GLOBAL_OPERATION_ID) - .setClientOperationId(CLIENT_OPERATION_ID) - .setOperationType(OPERATION_TYPE) - .setTargetLink(TARGET_LINK) - .setTargetId(TARGET_ID) - .setStatus(STATUS) - .setStatusMessage(STATUS_MESSAGE) - .setUser(USER) - .setProgress(PROGRESS) - .setInsertTime(INSERT_TIME) - .setStartTime(START_TIME) - .setEndTime(END_TIME) - .setErrors(ERRORS) - .setWarnings(WARNINGS) - .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) - .setHttpErrorMessage(HTTP_ERROR_MESSAGE) - .setDescription(DESCRIPTION) - .build(); - } - - @After - public void tearDown() throws Exception { - verify(serviceMockReturnsOptions); - } - - private void assertEqualsCommonFields(Operation operation) { - assertEquals(GENERATED_ID, operation.getGeneratedId()); - assertEquals(CLIENT_OPERATION_ID, operation.getClientOperationId()); - assertEquals(OPERATION_TYPE, operation.getOperationType()); - assertEquals(TARGET_LINK, operation.getTargetLink()); - assertEquals(TARGET_ID, operation.getTargetId()); - assertEquals(STATUS, operation.getStatus()); - assertEquals(STATUS_MESSAGE, operation.getStatusMessage()); - assertEquals(USER, operation.getUser()); - assertEquals(PROGRESS, operation.getProgress()); - assertEquals(INSERT_TIME, operation.getInsertTime()); - assertEquals(START_TIME, operation.getStartTime()); - assertEquals(END_TIME, operation.getEndTime()); - assertEquals(ERRORS, operation.getErrors()); - assertEquals(WARNINGS, operation.getWarnings()); - assertEquals(HTTP_ERROR_STATUS_CODE, globalOperation.getHttpErrorStatusCode()); - assertEquals(HTTP_ERROR_MESSAGE, globalOperation.getHttpErrorMessage()); - assertEquals(DESCRIPTION, globalOperation.getDescription()); - assertSame(serviceMockReturnsOptions, globalOperation.getCompute()); - } - - private void assertNullCommonFields(Operation operation) { - assertNull(operation.getGeneratedId()); - assertNull(operation.getClientOperationId()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getErrors()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorStatusCode()); - assertNull(operation.getHttpErrorMessage()); - assertNull(operation.getDescription()); - assertSame(serviceMockReturnsOptions, operation.getCompute()); - } - - @Test - public void testBuilder() { - initializeExpectedOperation(6); - assertEqualsCommonFields(globalOperation); - assertEquals(GLOBAL_OPERATION_ID, globalOperation.getOperationId()); - assertEqualsCommonFields(regionOperation); - assertEquals(REGION_OPERATION_ID, regionOperation.getOperationId()); - assertEqualsCommonFields(zoneOperation); - assertEquals(ZONE_OPERATION_ID, zoneOperation.getOperationId()); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GLOBAL_OPERATION_ID) - .build(); - assertNullCommonFields(operation); - assertEquals(GLOBAL_OPERATION_ID, operation.getOperationId()); - operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZONE_OPERATION_ID) - .build(); - assertNullCommonFields(operation); - assertEquals(ZONE_OPERATION_ID, operation.getOperationId()); - operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(REGION_OPERATION_ID) - .build(); - assertNullCommonFields(operation); - assertEquals(REGION_OPERATION_ID, operation.getOperationId()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedOperation(24); - compareOperation(globalOperation, - Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb())); - assertNotNull(regionOperation.toPb().getRegion()); - compareOperation(regionOperation, - Operation.fromPb(serviceMockReturnsOptions, regionOperation.toPb())); - assertNotNull(zoneOperation.toPb().getZone()); - compareOperation(zoneOperation, - Operation.fromPb(serviceMockReturnsOptions, zoneOperation.toPb())); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GLOBAL_OPERATION_ID) - .build(); - compareOperation(operation, Operation.fromPb(serviceMockReturnsOptions, operation.toPb())); - operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(ZONE_OPERATION_ID) - .build(); - compareOperation(operation, Operation.fromPb(serviceMockReturnsOptions, operation.toPb())); - operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(REGION_OPERATION_ID) - .build(); - compareOperation(operation, Operation.fromPb(serviceMockReturnsOptions, operation.toPb())); - } - - @Test - public void testDeleteTrue() { - initializeExpectedOperation(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteOperation(GLOBAL_OPERATION_ID)).andReturn(true); - replay(compute); - initializeOperation(); - assertTrue(operation.delete()); - verify(compute); - } - - @Test - public void testDeleteFalse() { - initializeExpectedOperation(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteOperation(GLOBAL_OPERATION_ID)).andReturn(false); - replay(compute); - initializeOperation(); - assertFalse(operation.delete()); - verify(compute); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedOperation(3); - Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); - replay(compute); - initializeOperation(); - assertTrue(operation.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedOperation(3); - Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeOperation(); - assertFalse(operation.exists()); - verify(compute); - } - - @Test - public void testIsDone_True() throws Exception { - initializeExpectedOperation(3); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); - replay(compute); - initializeOperation(); - assertTrue(operation.isDone()); - verify(compute); - } - - @Test - public void testIsDone_False() throws Exception { - initializeExpectedOperation(4); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn( - Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setStatus("PENDING"))); - replay(compute); - initializeOperation(); - assertFalse(operation.isDone()); - verify(compute); - } - @Test - public void testIsDone_NotExists() throws Exception { - initializeExpectedOperation(3); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeOperation(); - assertTrue(operation.isDone()); - verify(compute); - } - - @Test - public void testWaitFor() throws InterruptedException { - initializeExpectedOperation(4); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - Operation successOperation = - Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setError(null)); - expect(compute.getOptions()).andReturn(mockOptions); - expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(successOperation); - expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(successOperation); - replay(compute, mockOptions); - initializeOperation(); - assertSame(successOperation, operation.waitFor()); - verify(mockOptions); - } - - @Test - public void testWaitFor_Null() throws InterruptedException { - initializeExpectedOperation(3); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); - expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(null); - replay(compute, mockOptions); - initializeOperation(); - assertNull(operation.waitFor()); - verify(mockOptions); - } - - @Test - public void testWaitForCheckingPeriod() throws InterruptedException { - initializeExpectedOperation(5); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - Operation runningOperation = Operation.fromPb(serviceMockReturnsOptions, - globalOperation.toPb().setError(null).setStatus("RUNNING")); - Operation completedOperation = - Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setError(null)); - expect(compute.getOptions()).andReturn(mockOptions); - expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)) - .andReturn(completedOperation); - expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(completedOperation); - replay(compute, mockOptions); - initializeOperation(); - assertSame( - completedOperation, operation.waitFor(RetryOption.initialRetryDelay(Duration.ofMillis(1)))); - verify(mockOptions); - } - - @Test - public void testWaitForCheckingPeriod_Null() throws InterruptedException { - initializeExpectedOperation(4); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - Operation runningOperation = Operation.fromPb(serviceMockReturnsOptions, - globalOperation.toPb().setError(null).setStatus("RUNNING")); - expect(compute.getOptions()).andReturn(mockOptions); - expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); - replay(compute, mockOptions); - initializeOperation(); - assertNull(operation.waitFor(RetryOption.initialRetryDelay(Duration.ofMillis(1L)))); - verify(compute, mockOptions); - } - - @Test - public void testWaitForWithTimeout() throws InterruptedException { - initializeExpectedOperation(4); - Compute.OperationOption[] expectedOptions = - {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; - ApiClock clock = createStrictMock(ApiClock.class); - expect(clock.nanoTime()).andReturn(0L); - expect(clock.nanoTime()).andReturn(1_000_000L); - expect(clock.nanoTime()).andReturn(3_000_000L); - Operation runningOperation = Operation.fromPb(serviceMockReturnsOptions, - globalOperation.toPb().setError(null).setStatus("RUNNING")); - expect(compute.getOptions()).andReturn(mockOptions); - expect(mockOptions.getClock()).andReturn(clock); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); - expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); - replay(compute, clock, mockOptions); - initializeOperation(); - thrown.expect(ComputeException.class); - operation.waitFor(RetryOption.initialRetryDelay(Duration.ofMillis(1L)), - RetryOption.totalTimeout(Duration.ofMillis(3L))); - verify(compute, clock, mockOptions); - } - - @Test - public void testReload() throws Exception { - initializeExpectedOperation(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(globalOperation); - replay(compute); - initializeOperation(); - Operation updatedOperation = operation.reload(); - compareOperation(globalOperation, updatedOperation); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedOperation(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(null); - replay(compute); - initializeOperation(); - assertNull(operation.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedOperation(5); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getOperation(GLOBAL_OPERATION_ID, Compute.OperationOption.fields())) - .andReturn(globalOperation); - replay(compute); - initializeOperation(); - Operation updatedOperation = operation.reload(Compute.OperationOption.fields()); - compareOperation(globalOperation, updatedOperation); - verify(compute); - } - - private void compareOperation(Operation expected, Operation value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getOperationId(), value.getOperationId()); - assertEquals(expected.getClientOperationId(), value.getClientOperationId()); - assertEquals(expected.getOperationType(), value.getOperationType()); - assertEquals(expected.getTargetLink(), value.getTargetLink()); - assertEquals(expected.getTargetId(), value.getTargetId()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getStatusMessage(), value.getStatusMessage()); - assertEquals(expected.getUser(), value.getUser()); - assertEquals(expected.getProgress(), value.getProgress()); - assertEquals(expected.getInsertTime(), value.getInsertTime()); - assertEquals(expected.getStartTime(), value.getStartTime()); - assertEquals(expected.getEndTime(), value.getEndTime()); - assertEquals(expected.getErrors(), value.getErrors()); - assertEquals(expected.getWarnings(), value.getWarnings()); - assertEquals(expected.getHttpErrorStatusCode(), value.getHttpErrorStatusCode()); - assertEquals(expected.getHttpErrorMessage(), value.getHttpErrorMessage()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java deleted file mode 100644 index 428ce46b0221..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class RegionIdTest { - - private static final String PROJECT = "project"; - private static final String REGION = "region"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/regions/region"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - RegionId regionId = RegionId.of(PROJECT, REGION); - assertEquals(PROJECT, regionId.getProject()); - assertEquals(REGION, regionId.getRegion()); - assertEquals(URL, regionId.getSelfLink()); - regionId = RegionId.of(REGION); - assertNull(regionId.getProject()); - assertEquals(REGION, regionId.getRegion()); - } - - @Test - public void testToAndFromUrl() { - RegionId regionId = RegionId.of(PROJECT, REGION); - compareRegionId(regionId, RegionId.fromUrl(regionId.getSelfLink())); - } - - @Test - public void testSetProjectId() { - RegionId regionId = RegionId.of(PROJECT, REGION); - assertSame(regionId, regionId.setProjectId(PROJECT)); - compareRegionId(regionId, RegionId.of(REGION).setProjectId(PROJECT)); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid region URL"); - RegionId.fromUrl("notMatchingUrl"); - } - - @Test - public void testMatchesUrl() { - assertTrue(RegionId.matchesUrl(RegionId.of(PROJECT, REGION).getSelfLink())); - assertFalse(RegionId.matchesUrl("notMatchingUrl")); - } - - private void compareRegionId(RegionId expected, RegionId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getRegion(), expected.getRegion()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java deleted file mode 100644 index adef3a7d7318..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class RegionTest { - - private static final RegionId REGION_ID = RegionId.of("project", "region"); - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final Region.Status STATUS = Region.Status.DOWN; - private static final ZoneId ZONE_ID1 = ZoneId.of("project", "zone1"); - private static final ZoneId ZONE_ID2 = ZoneId.of("project", "zone2"); - private static final List ZONES = ImmutableList.of(ZONE_ID1, ZONE_ID2); - private static final Region.Quota QUOTA1 = - new Region.Quota("METRIC1", 2, 1); - private static final Region.Quota QUOTA2 = - new Region.Quota("METRIC2", 4, 3); - private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, REGION_ID); - private static final Region REGION = Region.builder() - .setRegionId(REGION_ID) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setZones(ZONES) - .setQuotas(QUOTAS) - .setDeprecationStatus(DEPRECATION_STATUS) - .build(); - - @Test - public void testBuilder() { - assertEquals(REGION_ID, REGION.getRegionId()); - assertEquals(GENERATED_ID, REGION.getGeneratedId()); - assertEquals(CREATION_TIMESTAMP, REGION.getCreationTimestamp()); - assertEquals(DESCRIPTION, REGION.getDescription()); - assertEquals(STATUS, REGION.getStatus()); - assertEquals(ZONES, REGION.getZones()); - assertEquals(QUOTAS, REGION.getQuotas()); - assertEquals(DEPRECATION_STATUS, REGION.getDeprecationStatus()); - } - - @Test - public void testToAndFromPb() { - Region region = Region.fromPb(REGION.toPb()); - compareRegions(REGION, region); - assertEquals(REGION_ID.getProject(), region.getRegionId().getProject()); - assertEquals(REGION_ID.getRegion(), region.getRegionId().getRegion()); - region = Region.builder().setRegionId(REGION_ID).build(); - compareRegions(region, Region.fromPb(region.toPb())); - } - - private void compareRegions(Region expected, Region value) { - assertEquals(expected, value); - assertEquals(expected.getRegionId(), value.getRegionId()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getZones(), value.getZones()); - assertEquals(expected.getQuotas(), value.getQuotas()); - assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java deleted file mode 100644 index 628e723da7f8..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class SchedulingOptionsTest { - - private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); - - @Test - public void testFactoryMethods() { - assertTrue(SCHEDULING_OPTIONS.isPreemptible()); - assertFalse(SCHEDULING_OPTIONS.automaticRestart()); - assertEquals(SchedulingOptions.Maintenance.TERMINATE, SCHEDULING_OPTIONS.getMaintenance()); - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - assertFalse(schedulingOptions.isPreemptible()); - assertTrue(schedulingOptions.automaticRestart()); - assertEquals(SchedulingOptions.Maintenance.MIGRATE, schedulingOptions.getMaintenance()); - } - - @Test - public void testToAndFromPb() { - compareSchedulingOptions(SCHEDULING_OPTIONS, - SchedulingOptions.fromPb(SCHEDULING_OPTIONS.toPb())); - SchedulingOptions schedulingOptions = - SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); - compareSchedulingOptions(schedulingOptions, SchedulingOptions.fromPb(schedulingOptions.toPb())); - } - - public void compareSchedulingOptions(SchedulingOptions expected, SchedulingOptions value) { - assertEquals(expected, value); - assertEquals(expected.isPreemptible(), value.isPreemptible()); - assertEquals(expected.getMaintenance(), value.getMaintenance()); - assertEquals(expected.automaticRestart(), value.automaticRestart()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java deleted file mode 100644 index 28fdc44c5482..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import com.google.cloud.BaseSerializationTest; -import com.google.cloud.NoCredentials; -import com.google.cloud.Restorable; -import com.google.cloud.ServiceOptions; -import com.google.cloud.compute.deprecated.AttachedDisk.CreateDiskConfiguration; -import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; -import com.google.cloud.compute.deprecated.AttachedDisk.ScratchDiskConfiguration; -import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; - -import java.io.Serializable; -import java.util.List; - -public class SerializationTest extends BaseSerializationTest { - - private static final Compute COMPUTE = ComputeOptions.newBuilder().setProjectId("p").build().getService(); - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final String VALID_DISK_SIZE = "10GB-10TB"; - private static final Long DEFAULT_DISK_SIZE_GB = 10L; - private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); - private static final DiskType DISK_TYPE = DiskType.newBuilder() - .setDiskTypeId(DISK_TYPE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setValidDiskSize(VALID_DISK_SIZE) - .setDefaultDiskSizeGb(DEFAULT_DISK_SIZE_GB) - .build(); - private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); - private static final Integer GUEST_CPUS = 1; - private static final Integer MEMORY_MB = 2; - private static final List SCRATCH_DISKS = ImmutableList.of(3); - private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; - private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; - private static final MachineType MACHINE_TYPE = MachineType.newBuilder() - .setMachineTypeId(MACHINE_TYPE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setCpus(GUEST_CPUS) - .setMemoryMb(MEMORY_MB) - .setScratchDisksSizeGb(SCRATCH_DISKS) - .setMaximumPersistentDisks(MAXIMUM_PERSISTENT_DISKS) - .setMaximumPersistentDisksSizeGb(MAXIMUM_PERSISTENT_DISKS_SIZE_GB) - .build(); - private static final RegionId REGION_ID = RegionId.of("project", "region"); - private static final Region.Status REGION_STATUS = Region.Status.DOWN; - private static final ZoneId ZONE_ID1 = ZoneId.of("project", "zone1"); - private static final ZoneId ZONE_ID2 = ZoneId.of("project", "zone2"); - private static final List ZONES = ImmutableList.of(ZONE_ID1, ZONE_ID2); - private static final Region.Quota QUOTA1 = - new Region.Quota("METRIC1", 2, 1); - private static final Region.Quota QUOTA2 = - new Region.Quota("METRIC2", 4, 3); - private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); - private static final Region REGION = Region.builder() - .setRegionId(REGION_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(REGION_STATUS) - .setZones(ZONES) - .setQuotas(QUOTAS) - .build(); - private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); - private static final Zone.Status ZONE_STATUS = Zone.Status.DOWN; - private static final Zone ZONE = Zone.builder() - .setZoneId(ZONE_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(ZONE_STATUS) - .setRegion(REGION_ID) - .build(); - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, MACHINE_TYPE_ID); - private static final LicenseId LICENSE_ID = LicenseId.of("project", "license"); - private static final Boolean CHARGES_USE_FEE = true; - private static final License LICENSE = new License(LICENSE_ID, CHARGES_USE_FEE); - private static final GlobalOperationId GLOBAL_OPERATION_ID = - GlobalOperationId.of("project", "op"); - private static final ZoneOperationId ZONE_OPERATION_ID = - ZoneOperationId.of("project", "zone", "op"); - private static final RegionOperationId REGION_OPERATION_ID = - RegionOperationId.of("project", "region", "op"); - private static final Operation GLOBAL_OPERATION = - new Operation.Builder(COMPUTE).setOperationId(GLOBAL_OPERATION_ID).build(); - private static final Operation ZONE_OPERATION = - new Operation.Builder(COMPUTE).setOperationId(ZONE_OPERATION_ID).build(); - private static final Operation REGION_OPERATION = - new Operation.Builder(COMPUTE).setOperationId(REGION_OPERATION_ID).build(); - private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); - private static final GlobalForwardingRuleId GLOBAL_FORWARDING_RULE_ID = - GlobalForwardingRuleId.of("project", "rule"); - private static final RegionForwardingRuleId REGION_FORWARDING_RULE_ID = - RegionForwardingRuleId.of("project", "region", "rule"); - private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); - private static final RegionAddressId REGION_ADDRESS_ID = - RegionAddressId.of("project", "region", "address"); - private static final AddressInfo.InstanceUsage INSTANCE_USAGE = - new AddressInfo.InstanceUsage(INSTANCE_ID); - private static final AddressInfo.GlobalForwardingUsage GLOBAL_FORWARDING_USAGE = - new AddressInfo.GlobalForwardingUsage(ImmutableList.of(GLOBAL_FORWARDING_RULE_ID)); - private static final AddressInfo.RegionForwardingUsage REGION_FORWARDING_USAGE = - new AddressInfo.RegionForwardingUsage(ImmutableList.of(REGION_FORWARDING_RULE_ID)); - private static final AddressInfo ADDRESS_INFO = AddressInfo.newBuilder(REGION_ADDRESS_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setUsage(INSTANCE_USAGE) - .build(); - private static final Address ADDRESS = new Address.Builder(COMPUTE, REGION_ADDRESS_ID).build(); - private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); - private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); - private static final SnapshotInfo SNAPSHOT_INFO = SnapshotInfo.of(SNAPSHOT_ID, DISK_ID); - private static final Snapshot SNAPSHOT = - new Snapshot.Builder(COMPUTE, SNAPSHOT_ID, DISK_ID).build(); - private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final DiskImageConfiguration DISK_IMAGE_CONFIGURATION = - DiskImageConfiguration.of(DISK_ID); - private static final StorageImageConfiguration STORAGE_IMAGE_CONFIGURATION = - StorageImageConfiguration.of("gs:/bucket/file"); - private static final ImageInfo IMAGE_INFO = ImageInfo.of(IMAGE_ID, DISK_IMAGE_CONFIGURATION); - private static final Image IMAGE = - new Image.Builder(COMPUTE, IMAGE_ID, DISK_IMAGE_CONFIGURATION).build(); - private static final StandardDiskConfiguration STANDARD_DISK_CONFIGURATION = - StandardDiskConfiguration.of(DISK_TYPE_ID); - private static final ImageDiskConfiguration IMAGE_DISK_CONFIGURATION = - ImageDiskConfiguration.of(IMAGE_ID); - private static final SnapshotDiskConfiguration SNAPSHOT_DISK_CONFIGURATION = - SnapshotDiskConfiguration.of(SNAPSHOT_ID); - private static final DiskInfo DISK_INFO = DiskInfo.of(DISK_ID, STANDARD_DISK_CONFIGURATION); - private static final Disk DISK = - new Disk.Builder(COMPUTE, DISK_ID, STANDARD_DISK_CONFIGURATION).build(); - private static final SubnetworkId SUBNETWORK_ID = - SubnetworkId.of("project", "region", "subnetwork"); - private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); - private static final SubnetworkInfo SUBNETWORK_INFO = - SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, "192.168.0.0/16"); - private static final Subnetwork SUBNETWORK = - new Subnetwork.Builder(COMPUTE, SUBNETWORK_ID, NETWORK_ID, "192.168.0.0/16").build(); - private static final StandardNetworkConfiguration STANDARD_NETWORK_CONFIGURATION = - StandardNetworkConfiguration.of("192.168.0.0/16"); - private static final SubnetNetworkConfiguration SUBNET_NETWORK_CONFIGURATION = - SubnetNetworkConfiguration.of(false); - private static final NetworkInfo NETWORK_INFO = - NetworkInfo.of(NETWORK_ID, STANDARD_NETWORK_CONFIGURATION); - private static final Network NETWORK = - new Network.Builder(COMPUTE, NETWORK_ID, STANDARD_NETWORK_CONFIGURATION).build(); - private static final AccessConfig ACCESS_CONFIG = AccessConfig.of("192.168.1.1"); - private static final NetworkInterface NETWORK_INTERFACE = NetworkInterface.newBuilder(NETWORK_ID) - .setAccessConfigurations(ACCESS_CONFIG) - .build(); - private static final CreateDiskConfiguration CREATE_DISK_CONFIGURATION = - CreateDiskConfiguration.of(IMAGE_ID); - private static final PersistentDiskConfiguration PERSISTENT_DISK_CONFIGURATION = - PersistentDiskConfiguration.of(DISK_ID); - private static final ScratchDiskConfiguration SCRATCH_DISK_CONFIGURATION = - ScratchDiskConfiguration.of(DISK_TYPE_ID); - private static final AttachedDisk ATTACHED_DISK = AttachedDisk.of(CREATE_DISK_CONFIGURATION); - private static final Tags TAGS = Tags.of("tag1", "tag2"); - private static final Metadata METADATA = Metadata.of(ImmutableMap.of("key1", "val1")); - private static final ServiceAccount SERVICE_ACCOUNT = ServiceAccount.of("email"); - private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); - private static final InstanceInfo INSTANCE_INFO = - InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE_ID, ATTACHED_DISK, NETWORK_INTERFACE); - private static final Instance INSTANCE = - new Instance.Builder(COMPUTE, INSTANCE_ID, MACHINE_TYPE_ID, ATTACHED_DISK, NETWORK_INTERFACE) - .build(); - private static final Compute.DiskTypeOption DISK_TYPE_OPTION = - Compute.DiskTypeOption.fields(); - private static final Compute.DiskTypeFilter DISK_TYPE_FILTER = - Compute.DiskTypeFilter.equals(Compute.DiskTypeField.SELF_LINK, "selfLink"); - private static final Compute.DiskTypeListOption DISK_TYPE_LIST_OPTION = - Compute.DiskTypeListOption.filter(DISK_TYPE_FILTER); - private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_OPTION = - Compute.DiskTypeAggregatedListOption.filter(DISK_TYPE_FILTER); - private static final Compute.MachineTypeOption MACHINE_TYPE_OPTION = - Compute.MachineTypeOption.fields(); - private static final Compute.MachineTypeFilter MACHINE_TYPE_FILTER = - Compute.MachineTypeFilter.equals(Compute.MachineTypeField.SELF_LINK, "selfLink"); - private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_OPTION = - Compute.MachineTypeListOption.filter(MACHINE_TYPE_FILTER); - private static final Compute.MachineTypeAggregatedListOption MACHINE_TYPE_AGGREGATED_LIST_OPTION = - Compute.MachineTypeAggregatedListOption.filter(MACHINE_TYPE_FILTER); - private static final Compute.RegionOption REGION_OPTION = Compute.RegionOption.fields(); - private static final Compute.RegionFilter REGION_FILTER = - Compute.RegionFilter.equals(Compute.RegionField.SELF_LINK, "selfLink"); - private static final Compute.RegionListOption REGION_LIST_OPTION = - Compute.RegionListOption.filter(REGION_FILTER); - private static final Compute.ZoneOption ZONE_OPTION = Compute.ZoneOption.fields(); - private static final Compute.ZoneFilter ZONE_FILTER = - Compute.ZoneFilter.equals(Compute.ZoneField.SELF_LINK, "selfLink"); - private static final Compute.ZoneListOption ZONE_LIST_OPTION = - Compute.ZoneListOption.filter(ZONE_FILTER); - private static final Compute.LicenseOption LICENSE_OPTION = Compute.LicenseOption.fields(); - private static final Compute.OperationOption OPERATION_OPTION = Compute.OperationOption.fields(); - private static final Compute.OperationFilter OPERATION_FILTER = - Compute.OperationFilter.equals(Compute.OperationField.SELF_LINK, "selfLink"); - private static final Compute.OperationListOption OPERATION_LIST_OPTION = - Compute.OperationListOption.filter(OPERATION_FILTER); - private static final Compute.AddressOption ADDRESS_OPTION = Compute.AddressOption.fields(); - private static final Compute.AddressFilter ADDRESS_FILTER = - Compute.AddressFilter.equals(Compute.AddressField.SELF_LINK, "selfLink"); - private static final Compute.AddressListOption ADDRESS_LIST_OPTION = - Compute.AddressListOption.filter(ADDRESS_FILTER); - private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_OPTION = - Compute.AddressAggregatedListOption.filter(ADDRESS_FILTER); - private static final Compute.SnapshotOption SNAPSHOT_OPTION = Compute.SnapshotOption.fields(); - private static final Compute.SnapshotFilter SNAPSHOT_FILTER = - Compute.SnapshotFilter.equals(Compute.SnapshotField.SELF_LINK, "selfLink"); - private static final Compute.SnapshotListOption SNAPSHOT_LIST_OPTION = - Compute.SnapshotListOption.filter(SNAPSHOT_FILTER); - private static final Compute.ImageOption IMAGE_OPTION = Compute.ImageOption.fields(); - private static final Compute.ImageFilter IMAGE_FILTER = - Compute.ImageFilter.equals(Compute.ImageField.SELF_LINK, "selfLink"); - private static final Compute.ImageListOption IMAGE_LIST_OPTION = - Compute.ImageListOption.filter(IMAGE_FILTER); - private static final Compute.DiskOption DISK_OPTION = Compute.DiskOption.fields(); - private static final Compute.DiskFilter DISK_FILTER = - Compute.DiskFilter.equals(Compute.DiskField.SELF_LINK, "selfLink"); - private static final Compute.DiskListOption DISK_LIST_OPTION = - Compute.DiskListOption.filter(DISK_FILTER); - private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_OPTION = - Compute.DiskAggregatedListOption.filter(DISK_FILTER); - private static final Compute.SubnetworkOption SUBNETWORK_OPTION = - Compute.SubnetworkOption.fields(); - private static final Compute.SubnetworkFilter SUBNETWORK_FILTER = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.SELF_LINK, "selfLink"); - private static final Compute.SubnetworkListOption SUBNETWORK_LIST_OPTION = - Compute.SubnetworkListOption.filter(SUBNETWORK_FILTER); - private static final Compute.SubnetworkAggregatedListOption SUBNETWORK_AGGREGATED_LIST_OPTION = - Compute.SubnetworkAggregatedListOption.filter(SUBNETWORK_FILTER); - private static final Compute.NetworkOption NETWORK_OPTION = - Compute.NetworkOption.fields(); - private static final Compute.NetworkFilter NETWORK_FILTER = - Compute.NetworkFilter.equals(Compute.NetworkField.SELF_LINK, "selfLink"); - private static final Compute.NetworkListOption NETWORK_LIST_OPTION = - Compute.NetworkListOption.filter(NETWORK_FILTER); - private static final Compute.InstanceOption INSTANCE_OPTION = - Compute.InstanceOption.fields(); - private static final Compute.InstanceFilter INSTANCE_FILTER = - Compute.InstanceFilter.equals(Compute.InstanceField.SELF_LINK, "selfLink"); - private static final Compute.InstanceListOption INSTANCE_LIST_OPTION = - Compute.InstanceListOption.filter(INSTANCE_FILTER); - private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_OPTION = - Compute.InstanceAggregatedListOption.filter(INSTANCE_FILTER); - - @Override - protected Serializable[] serializableObjects() { - ComputeOptions options = ComputeOptions.newBuilder() - .setProjectId("p1") - .setCredentials(NoCredentials.getInstance()) - .build(); - ComputeOptions otherOptions = options.toBuilder() - .setProjectId("p2") - .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) - .build(); - return new Serializable[]{DISK_TYPE_ID, DISK_TYPE, MACHINE_TYPE_ID, MACHINE_TYPE, REGION_ID, - REGION, ZONE_ID, ZONE, LICENSE_ID, LICENSE, DEPRECATION_STATUS, GLOBAL_OPERATION_ID, - REGION_OPERATION_ID, ZONE_OPERATION_ID, GLOBAL_OPERATION, REGION_OPERATION, ZONE_OPERATION, - INSTANCE_ID, REGION_FORWARDING_RULE_ID, GLOBAL_FORWARDING_RULE_ID, GLOBAL_ADDRESS_ID, - REGION_ADDRESS_ID, INSTANCE_USAGE, GLOBAL_FORWARDING_USAGE, REGION_FORWARDING_USAGE, - ADDRESS_INFO, ADDRESS, DISK_ID, SNAPSHOT_ID, SNAPSHOT_INFO, SNAPSHOT, IMAGE_ID, - DISK_IMAGE_CONFIGURATION, STORAGE_IMAGE_CONFIGURATION, IMAGE_INFO, IMAGE, - STANDARD_DISK_CONFIGURATION, IMAGE_DISK_CONFIGURATION, SNAPSHOT_DISK_CONFIGURATION, - DISK_INFO, DISK, SUBNETWORK_ID, NETWORK_ID, SUBNETWORK_INFO, SUBNETWORK, - STANDARD_NETWORK_CONFIGURATION, SUBNET_NETWORK_CONFIGURATION, NETWORK_INFO, NETWORK, - ACCESS_CONFIG, NETWORK_INTERFACE, CREATE_DISK_CONFIGURATION, PERSISTENT_DISK_CONFIGURATION, - SCRATCH_DISK_CONFIGURATION, ATTACHED_DISK, TAGS, METADATA, SERVICE_ACCOUNT, - SCHEDULING_OPTIONS, INSTANCE_INFO, INSTANCE, DISK_TYPE_OPTION, DISK_TYPE_FILTER, - DISK_TYPE_LIST_OPTION, DISK_TYPE_AGGREGATED_LIST_OPTION, MACHINE_TYPE_OPTION, - MACHINE_TYPE_FILTER, MACHINE_TYPE_LIST_OPTION, MACHINE_TYPE_AGGREGATED_LIST_OPTION, - REGION_OPTION, REGION_FILTER, REGION_LIST_OPTION, ZONE_OPTION, ZONE_FILTER, - ZONE_LIST_OPTION, LICENSE_OPTION, OPERATION_OPTION, OPERATION_FILTER, OPERATION_LIST_OPTION, - ADDRESS_OPTION, ADDRESS_FILTER, ADDRESS_LIST_OPTION, ADDRESS_AGGREGATED_LIST_OPTION, - SNAPSHOT_OPTION, SNAPSHOT_FILTER, SNAPSHOT_LIST_OPTION, IMAGE_OPTION, IMAGE_FILTER, - IMAGE_LIST_OPTION, DISK_OPTION, DISK_FILTER, DISK_LIST_OPTION, DISK_AGGREGATED_LIST_OPTION, - SUBNETWORK_OPTION, SUBNETWORK_FILTER, SUBNETWORK_LIST_OPTION, - SUBNETWORK_AGGREGATED_LIST_OPTION, NETWORK_OPTION, NETWORK_FILTER, NETWORK_LIST_OPTION, - INSTANCE_OPTION, INSTANCE_FILTER, INSTANCE_LIST_OPTION, INSTANCE_AGGREGATED_LIST_OPTION, - options, otherOptions}; - } - - @Override - protected Restorable[] restorableObjects() { - return null; - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java deleted file mode 100644 index 1a34703414d2..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -public class ServiceAccountTest { - - private static final ServiceAccount SERVICE_ACCOUNT = - ServiceAccount.of("email", ImmutableList.of("scope1")); - - @Test - public void testOf() { - compareServiceAccount(SERVICE_ACCOUNT, ServiceAccount.of("email", ImmutableList.of("scope1"))); - compareServiceAccount(SERVICE_ACCOUNT, ServiceAccount.of("email", "scope1")); - } - - @Test - public void testToAndFromPb() { - compareServiceAccount(SERVICE_ACCOUNT, ServiceAccount.fromPb(SERVICE_ACCOUNT.toPb())); - } - - public void compareServiceAccount(ServiceAccount expected, ServiceAccount value) { - assertEquals(expected, value); - assertEquals(expected.getEmail(), value.getEmail()); - assertEquals(expected.getScopes(), value.getScopes()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java deleted file mode 100644 index 079e98015eb2..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.compute.deprecated.DiskConfiguration.Type; - -import org.junit.Test; - -public class SnapshotDiskConfigurationTest { - - private static final Long SIZE = 42L; - private static final DiskTypeId DISK_TYPE = DiskTypeId.of("project", "zone", "type"); - private static final SnapshotId SNAPSHOT = SnapshotId.of("project", "snapshot"); - private static final String SNAPSHOT_ID = "snapshotId"; - private static final SnapshotDiskConfiguration DISK_CONFIGURATION = - SnapshotDiskConfiguration.newBuilder(SNAPSHOT) - .setSizeGb(SIZE) - .setDiskType(DISK_TYPE) - .setSourceSnapshotId(SNAPSHOT_ID) - .build(); - - @Test - public void testToBuilder() { - compareSnapshotDiskConfiguration(DISK_CONFIGURATION, DISK_CONFIGURATION.toBuilder().build()); - SnapshotId newSnapshot = SnapshotId.of("newProject", "newSnapshot"); - SnapshotDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() - .setSizeGb(24L) - .setSourceSnapshot(newSnapshot) - .setSourceSnapshotId("newSnapshotId") - .build(); - assertEquals(24L, diskConfiguration.getSizeGb().longValue()); - assertEquals(newSnapshot, diskConfiguration.getSourceSnapshot()); - assertEquals("newSnapshotId", diskConfiguration.getSourceSnapshotId()); - diskConfiguration = diskConfiguration.toBuilder() - .setSizeGb(SIZE) - .setSourceSnapshot(SNAPSHOT) - .setSourceSnapshotId(SNAPSHOT_ID) - .build(); - compareSnapshotDiskConfiguration(DISK_CONFIGURATION, diskConfiguration); - } - - @Test - public void testToBuilderIncomplete() { - SnapshotDiskConfiguration diskConfiguration = SnapshotDiskConfiguration.of(SNAPSHOT); - compareSnapshotDiskConfiguration(diskConfiguration, diskConfiguration.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(DISK_TYPE, DISK_CONFIGURATION.getDiskType()); - assertEquals(SIZE, DISK_CONFIGURATION.getSizeGb()); - assertEquals(SNAPSHOT, DISK_CONFIGURATION.getSourceSnapshot()); - assertEquals(SNAPSHOT_ID, DISK_CONFIGURATION.getSourceSnapshotId()); - assertEquals(Type.SNAPSHOT, DISK_CONFIGURATION.getType()); - } - - @Test - public void testToAndFromPb() { - assertTrue(DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb()) - instanceof SnapshotDiskConfiguration); - compareSnapshotDiskConfiguration(DISK_CONFIGURATION, - DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb())); - } - - @Test - public void testOf() { - SnapshotDiskConfiguration configuration = SnapshotDiskConfiguration.of(SNAPSHOT); - assertNull(configuration.getDiskType()); - assertNull(configuration.getSizeGb()); - assertNull(configuration.getSourceSnapshotId()); - assertEquals(SNAPSHOT, configuration.getSourceSnapshot()); - assertEquals(Type.SNAPSHOT, configuration.getType()); - } - - @Test - public void testSetProjectId() { - SnapshotDiskConfiguration configuration = DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of(DISK_TYPE.getZone(), DISK_TYPE.getType())) - .setSourceSnapshot(SnapshotId.of(SNAPSHOT.getSnapshot())) - .build(); - compareSnapshotDiskConfiguration(DISK_CONFIGURATION, configuration.setProjectId("project")); - } - - private void compareSnapshotDiskConfiguration(SnapshotDiskConfiguration expected, - SnapshotDiskConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getDiskType(), value.getDiskType()); - assertEquals(expected.getSizeGb(), value.getSizeGb()); - assertEquals(expected.getSourceSnapshot(), value.getSourceSnapshot()); - assertEquals(expected.getSourceSnapshotId(), value.getSourceSnapshotId()); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java deleted file mode 100644 index cefe83147d13..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class SnapshotIdTest { - - private static final String PROJECT = "project"; - private static final String NAME = "snapshot"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - SnapshotId snapshotId = SnapshotId.of(PROJECT, NAME); - assertEquals(PROJECT, snapshotId.getProject()); - assertEquals(NAME, snapshotId.getSnapshot()); - assertEquals(URL, snapshotId.getSelfLink()); - snapshotId = SnapshotId.of(NAME); - assertNull(snapshotId.getProject()); - assertEquals(NAME, snapshotId.getSnapshot()); - } - - @Test - public void testToAndFromUrl() { - SnapshotId snapshotId = SnapshotId.of(PROJECT, NAME); - compareSnapshotId(snapshotId, SnapshotId.fromUrl(snapshotId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid snapshot URL"); - SnapshotId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - SnapshotId snapshotId = SnapshotId.of(PROJECT, NAME); - assertSame(snapshotId, snapshotId.setProjectId(PROJECT)); - compareSnapshotId(snapshotId, SnapshotId.of(NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(SnapshotId.matchesUrl(SnapshotId.of(PROJECT, NAME).getSelfLink())); - assertFalse(SnapshotId.matchesUrl("notMatchingUrl")); - } - - private void compareSnapshotId(SnapshotId expected, SnapshotId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getSnapshot(), expected.getSnapshot()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java deleted file mode 100644 index 10724d1ce4d6..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.cloud.compute.deprecated.SnapshotInfo.Status; -import com.google.cloud.compute.deprecated.SnapshotInfo.StorageBytesStatus; -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class SnapshotInfoTest { - - private static final String GENERATED_ID = "42"; - private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); - private static final Status STATUS = Status.CREATING; - private static final Long DISK_SIZE_GB = 42L; - private static final String SOURCE_DISK_ID = "diskId"; - private static final Long STORAGE_BYTES = 24L; - private static final StorageBytesStatus STORAGE_BYTES_STATUS = StorageBytesStatus.UP_TO_DATE; - private static final SnapshotInfo SNAPSHOT_INFO = - SnapshotInfo.newBuilder(SNAPSHOT_ID, SOURCE_DISK) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setSourceDiskId(SOURCE_DISK_ID) - .setStorageBytes(STORAGE_BYTES) - .setStorageBytesStatus(STORAGE_BYTES_STATUS) - .build(); - - @Test - public void testToBuilder() { - compareSnapshotInfo(SNAPSHOT_INFO, SNAPSHOT_INFO.toBuilder().build()); - SnapshotInfo snapshotInfo = SNAPSHOT_INFO.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", snapshotInfo.getDescription()); - snapshotInfo = snapshotInfo.toBuilder().setDescription("description").build(); - compareSnapshotInfo(SNAPSHOT_INFO, snapshotInfo); - } - - @Test - public void testToBuilderIncomplete() { - SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); - assertEquals(snapshotInfo, snapshotInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, SNAPSHOT_INFO.getGeneratedId()); - assertEquals(SNAPSHOT_ID, SNAPSHOT_INFO.getSnapshotId()); - assertEquals(CREATION_TIMESTAMP, SNAPSHOT_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, SNAPSHOT_INFO.getDescription()); - assertEquals(STATUS, SNAPSHOT_INFO.getStatus()); - assertEquals(DISK_SIZE_GB, SNAPSHOT_INFO.getDiskSizeGb()); - assertEquals(LICENSES, SNAPSHOT_INFO.getLicenses()); - assertEquals(SOURCE_DISK, SNAPSHOT_INFO.getSourceDisk()); - assertEquals(SOURCE_DISK_ID, SNAPSHOT_INFO.getSourceDiskId()); - assertEquals(STORAGE_BYTES, SNAPSHOT_INFO.getStorageBytes()); - assertEquals(STORAGE_BYTES_STATUS, SNAPSHOT_INFO.getStorageBytesStatus()); - } - - @Test - public void testOf() { - SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); - assertNull(snapshotInfo.getGeneratedId()); - assertEquals(SNAPSHOT_ID, snapshotInfo.getSnapshotId()); - assertNull(snapshotInfo.getCreationTimestamp()); - assertNull(snapshotInfo.getDescription()); - assertNull(snapshotInfo.getStatus()); - assertNull(snapshotInfo.getDiskSizeGb()); - assertNull(snapshotInfo.getLicenses()); - assertEquals(SOURCE_DISK, snapshotInfo.getSourceDisk()); - assertNull(snapshotInfo.getSourceDiskId()); - assertNull(snapshotInfo.getStorageBytes()); - assertNull(snapshotInfo.getStorageBytesStatus()); - } - - @Test - public void testToAndFromPb() { - compareSnapshotInfo(SNAPSHOT_INFO, SnapshotInfo.fromPb(SNAPSHOT_INFO.toPb())); - SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); - compareSnapshotInfo(snapshotInfo, SnapshotInfo.fromPb(snapshotInfo.toPb())); - snapshotInfo = new SnapshotInfo.BuilderImpl().setSnapshotId(SNAPSHOT_ID).build(); - compareSnapshotInfo(snapshotInfo, SnapshotInfo.fromPb(snapshotInfo.toPb())); - } - - @Test - public void testSetProjectId() { - SnapshotInfo snapshotInfo = SNAPSHOT_INFO.toBuilder() - .setSnapshotId(SnapshotId.of("snapshot")) - .setSourceDisk(DiskId.of("zone", "disk")) - .build(); - compareSnapshotInfo(SNAPSHOT_INFO, snapshotInfo.setProjectId("project")); - } - - public void compareSnapshotInfo(SnapshotInfo expected, SnapshotInfo value) { - assertEquals(expected, value); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getSnapshotId(), value.getSnapshotId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.getSourceDisk(), value.getSourceDisk()); - assertEquals(expected.getSourceDiskId(), value.getSourceDiskId()); - assertEquals(expected.getStorageBytes(), value.getStorageBytes()); - assertEquals(expected.getStorageBytesStatus(), value.getStorageBytesStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java deleted file mode 100644 index 8fd1cb15df04..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class SnapshotTest { - - private static final String GENERATED_ID = "42"; - private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final List LICENSES = ImmutableList.of( - LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); - private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); - private static final SnapshotInfo.Status STATUS = SnapshotInfo.Status.CREATING; - private static final Long DISK_SIZE_GB = 42L; - private static final String SOURCE_DISK_ID = "diskId"; - private static final Long STORAGE_BYTES = 24L; - private static final SnapshotInfo.StorageBytesStatus STORAGE_BYTES_STATUS = - SnapshotInfo.StorageBytesStatus.UP_TO_DATE; - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Snapshot snapshot; - private Snapshot expectedSnapshot; - - private void initializeExpectedSnapshot(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - expectedSnapshot = new Snapshot.Builder(serviceMockReturnsOptions, SNAPSHOT_ID, SOURCE_DISK) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setSourceDiskId(SOURCE_DISK_ID) - .setStorageBytes(STORAGE_BYTES) - .setStorageBytesStatus(STORAGE_BYTES_STATUS) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeSnapshot() { - snapshot = new Snapshot.Builder(compute, SNAPSHOT_ID, SOURCE_DISK) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDiskSizeGb(DISK_SIZE_GB) - .setLicenses(LICENSES) - .setSourceDiskId(SOURCE_DISK_ID) - .setStorageBytes(STORAGE_BYTES) - .setStorageBytesStatus(STORAGE_BYTES_STATUS) - .build(); - } - - @Test - public void testToBuilder() { - initializeExpectedSnapshot(8); - compareSnapshot(expectedSnapshot, expectedSnapshot.toBuilder().build()); - Snapshot newSnapshot = expectedSnapshot.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newSnapshot.getDescription()); - newSnapshot = newSnapshot.toBuilder().setDescription("description").build(); - compareSnapshot(expectedSnapshot, newSnapshot); - } - - @Test - public void testToBuilderIncomplete() { - initializeExpectedSnapshot(5); - SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); - Snapshot snapshot = - new Snapshot(serviceMockReturnsOptions, new SnapshotInfo.BuilderImpl(snapshotInfo)); - compareSnapshot(snapshot, snapshot.toBuilder().build()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedSnapshot(8); - compareSnapshot(expectedSnapshot, - Snapshot.fromPb(serviceMockReturnsOptions, expectedSnapshot.toPb())); - Snapshot snapshot = - new Snapshot.Builder(serviceMockReturnsOptions, SNAPSHOT_ID, SOURCE_DISK).build(); - compareSnapshot(snapshot, Snapshot.fromPb(serviceMockReturnsOptions, snapshot.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedSnapshot(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - expect(compute.deleteSnapshot(SNAPSHOT_ID)).andReturn(operation); - replay(compute); - initializeSnapshot(); - assertSame(operation, snapshot.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedSnapshot(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteSnapshot(SNAPSHOT_ID)).andReturn(null); - replay(compute); - initializeSnapshot(); - assertNull(snapshot.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedSnapshot(1); - Compute.SnapshotOption[] expectedOptions = {Compute.SnapshotOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), expectedOptions)) - .andReturn(expectedSnapshot); - replay(compute); - initializeSnapshot(); - assertTrue(snapshot.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedSnapshot(1); - Compute.SnapshotOption[] expectedOptions = {Compute.SnapshotOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), expectedOptions)).andReturn(null); - replay(compute); - initializeSnapshot(); - assertFalse(snapshot.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedSnapshot(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot())).andReturn(expectedSnapshot); - replay(compute); - initializeSnapshot(); - Snapshot updatedSnapshot = snapshot.reload(); - compareSnapshot(expectedSnapshot, updatedSnapshot); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedSnapshot(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot())).andReturn(null); - replay(compute); - initializeSnapshot(); - assertNull(snapshot.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedSnapshot(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), Compute.SnapshotOption.fields())) - .andReturn(expectedSnapshot); - replay(compute); - initializeSnapshot(); - Snapshot updatedSnapshot = snapshot.reload(Compute.SnapshotOption.fields()); - compareSnapshot(expectedSnapshot, updatedSnapshot); - verify(compute); - } - - public void compareSnapshot(Snapshot expected, Snapshot value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getSnapshotId(), value.getSnapshotId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); - assertEquals(expected.getLicenses(), value.getLicenses()); - assertEquals(expected.getSourceDisk(), value.getSourceDisk()); - assertEquals(expected.getSourceDiskId(), value.getSourceDiskId()); - assertEquals(expected.getStorageBytes(), value.getStorageBytes()); - assertEquals(expected.getStorageBytesStatus(), value.getStorageBytesStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java deleted file mode 100644 index b0692180c3e0..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.compute.deprecated.DiskConfiguration.Type; - -import org.junit.Test; - -public class StandardDiskConfigurationTest { - - private static final Long SIZE = 42L; - private static final DiskTypeId DISK_TYPE = DiskTypeId.of("project", "zone", "type"); - private static final StandardDiskConfiguration DISK_CONFIGURATION = - StandardDiskConfiguration.newBuilder() - .setSizeGb(SIZE) - .setDiskType(DISK_TYPE) - .build(); - - @Test - public void testToBuilder() { - compareStandardDiskConfiguration(DISK_CONFIGURATION, DISK_CONFIGURATION.toBuilder().build()); - StandardDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() - .setSizeGb(24L) - .build(); - assertEquals(24L, diskConfiguration.getSizeGb().longValue()); - diskConfiguration = diskConfiguration.toBuilder() - .setSizeGb(SIZE) - .build(); - compareStandardDiskConfiguration(DISK_CONFIGURATION, diskConfiguration); - } - - @Test - public void testToBuilderIncomplete() { - StandardDiskConfiguration diskConfiguration = StandardDiskConfiguration.of(DISK_TYPE); - compareStandardDiskConfiguration(diskConfiguration, diskConfiguration.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(DISK_TYPE, DISK_CONFIGURATION.getDiskType()); - assertEquals(SIZE, DISK_CONFIGURATION.getSizeGb()); - assertEquals(Type.STANDARD, DISK_CONFIGURATION.getType()); - } - - @Test - public void testToAndFromPb() { - assertTrue(DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb()) - instanceof StandardDiskConfiguration); - compareStandardDiskConfiguration(DISK_CONFIGURATION, - DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb())); - } - - @Test - public void testOf() { - StandardDiskConfiguration configuration = StandardDiskConfiguration.of(DISK_TYPE); - assertEquals(DISK_TYPE, configuration.getDiskType()); - assertNull(configuration.getSizeGb()); - assertEquals(Type.STANDARD, configuration.getType()); - configuration = StandardDiskConfiguration.of(DISK_TYPE, SIZE); - assertEquals(DISK_TYPE, configuration.getDiskType()); - assertEquals(SIZE, configuration.getSizeGb()); - assertEquals(Type.STANDARD, configuration.getType()); - configuration = StandardDiskConfiguration.of(SIZE); - assertNull(configuration.getDiskType()); - assertEquals(SIZE, configuration.getSizeGb()); - assertEquals(Type.STANDARD, configuration.getType()); - } - - @Test - public void testSetProjectId() { - StandardDiskConfiguration configuration = DISK_CONFIGURATION.toBuilder() - .setDiskType(DiskTypeId.of(DISK_TYPE.getZone(), DISK_TYPE.getType())) - .build(); - compareStandardDiskConfiguration(DISK_CONFIGURATION, configuration.setProjectId("project")); - } - - private void compareStandardDiskConfiguration(StandardDiskConfiguration expected, - StandardDiskConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getDiskType(), value.getDiskType()); - assertEquals(expected.getSizeGb(), value.getSizeGb()); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java deleted file mode 100644 index a0d7a686c723..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.compute.deprecated.NetworkConfiguration.Type; - -import org.junit.Test; - -public class StandardNetworkConfigurationTest { - - private static final String IP_RANGE = "192.168.0.0/16"; - private static final String GATEWAY_ADDRESS = "192.168.1.1"; - private static final StandardNetworkConfiguration NETWORK_CONFIGURATION = - new StandardNetworkConfiguration(IP_RANGE, GATEWAY_ADDRESS); - - @Test - public void testConstructor() { - assertEquals(Type.STANDARD, NETWORK_CONFIGURATION.getType()); - assertEquals(IP_RANGE, NETWORK_CONFIGURATION.getIpRange()); - assertEquals(GATEWAY_ADDRESS, NETWORK_CONFIGURATION.getGatewayAddress()); - StandardNetworkConfiguration networkConfiguration = - new StandardNetworkConfiguration(IP_RANGE, null); - assertEquals(Type.STANDARD, networkConfiguration.getType()); - assertEquals(IP_RANGE, networkConfiguration.getIpRange()); - assertNull(networkConfiguration.getGatewayAddress()); - } - - @Test - public void testToAndFromPb() { - assertTrue(NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb()) - instanceof StandardNetworkConfiguration); - compareNetworkConfiguration(NETWORK_CONFIGURATION, - NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb())); - StandardNetworkConfiguration networkConfiguration = - new StandardNetworkConfiguration(IP_RANGE, null); - assertTrue(NetworkConfiguration.fromPb(networkConfiguration.toPb()) - instanceof StandardNetworkConfiguration); - compareNetworkConfiguration(networkConfiguration, - NetworkConfiguration.fromPb(networkConfiguration.toPb())); - } - - @Test - public void testOf() { - StandardNetworkConfiguration configuration = StandardNetworkConfiguration.of(IP_RANGE); - assertEquals(Type.STANDARD, configuration.getType()); - assertEquals(IP_RANGE, configuration.getIpRange()); - assertNull(configuration.getGatewayAddress()); - } - - private void compareNetworkConfiguration(StandardNetworkConfiguration expected, - StandardNetworkConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getIpRange(), value.getIpRange()); - assertEquals(expected.getGatewayAddress(), value.getGatewayAddress()); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java deleted file mode 100644 index 9131f77d0dd0..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class StorageImageConfigurationTest { - - private static final String SOURCE = "source"; - private static final ImageConfiguration.SourceType SOURCE_TYPE = - ImageConfiguration.SourceType.RAW; - private static final StorageImageConfiguration.ContainerType CONTAINER_TYPE = - StorageImageConfiguration.ContainerType.TAR; - private static final Long ARCHIVE_SIZE_BYTES = 42L; - private static final String SHA1 = "sha1"; - private static final StorageImageConfiguration CONFIGURATION = - StorageImageConfiguration.newBuilder(SOURCE) - .setSourceType(SOURCE_TYPE) - .setContainerType(CONTAINER_TYPE) - .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) - .setSha1(SHA1) - .build(); - - @Test - public void testToBuilder() { - compareRawImageConfiguration(CONFIGURATION, CONFIGURATION.toBuilder().build()); - String newSource = "newSource"; - StorageImageConfiguration configuration = CONFIGURATION.toBuilder().setSource(newSource).build(); - assertEquals(newSource, configuration.getSource()); - configuration = configuration.toBuilder().setSource(SOURCE).build(); - compareRawImageConfiguration(CONFIGURATION, configuration); - } - - @Test - public void testToBuilderIncomplete() { - StorageImageConfiguration configuration = StorageImageConfiguration.of(SOURCE); - compareRawImageConfiguration(configuration, configuration.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(SOURCE_TYPE, CONFIGURATION.getSourceType()); - assertEquals(SOURCE, CONFIGURATION.getSource()); - assertEquals(CONTAINER_TYPE, CONFIGURATION.getContainerType()); - assertEquals(ARCHIVE_SIZE_BYTES, CONFIGURATION.getArchiveSizeBytes()); - assertEquals(SHA1, CONFIGURATION.getSha1()); - assertEquals(ImageConfiguration.Type.STORAGE, CONFIGURATION.getType()); - } - - @Test - public void testToAndFromPb() { - assertTrue(ImageConfiguration.fromPb(CONFIGURATION.toPb()) instanceof StorageImageConfiguration); - compareRawImageConfiguration(CONFIGURATION, - ImageConfiguration.fromPb(CONFIGURATION.toPb())); - StorageImageConfiguration configuration = StorageImageConfiguration.of(SOURCE); - compareRawImageConfiguration(configuration, - StorageImageConfiguration.fromPb(configuration.toPb())); - } - - @Test - public void testOf() { - StorageImageConfiguration configuration = StorageImageConfiguration.of(SOURCE); - assertEquals(ImageConfiguration.Type.STORAGE, configuration.getType()); - assertNull(configuration.getSourceType()); - assertEquals(SOURCE, configuration.getSource()); - assertNull(configuration.getContainerType()); - assertNull(configuration.getArchiveSizeBytes()); - assertNull(configuration.getSha1()); - } - - @Test - public void testSetProjectId() { - assertSame(CONFIGURATION, CONFIGURATION.setProjectId("project")); - } - - private void compareRawImageConfiguration(StorageImageConfiguration expected, - StorageImageConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.getSource(), value.getSource()); - assertEquals(expected.getSourceType(), value.getSourceType()); - assertEquals(expected.getContainerType(), value.getContainerType()); - assertEquals(expected.getArchiveSizeBytes(), value.getArchiveSizeBytes()); - assertEquals(expected.getSha1(), value.getSha1()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java deleted file mode 100644 index ff3c0bc4f12f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -import java.util.List; - -public class SubnetNetworkConfigurationTest { - - private static final Boolean AUTO_CREATE_SUBNETWORKS = true; - private static final List SUBNETWORKS = ImmutableList.of( - SubnetworkId.of("project", "region", "subnetwork1"), - SubnetworkId.of("project", "region", "subnetwork2")); - private static final SubnetNetworkConfiguration NETWORK_CONFIGURATION = - new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); - - @Test - public void testConstructor() { - assertEquals(AUTO_CREATE_SUBNETWORKS, NETWORK_CONFIGURATION.autoCreateSubnetworks()); - assertEquals(NetworkConfiguration.Type.SUBNET, NETWORK_CONFIGURATION.getType()); - assertEquals(SUBNETWORKS, NETWORK_CONFIGURATION.getSubnetworks()); - assertEquals(NetworkConfiguration.Type.SUBNET, NETWORK_CONFIGURATION.getType()); - SubnetNetworkConfiguration networkConfiguration = - new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, null); - assertEquals(NetworkConfiguration.Type.SUBNET, networkConfiguration.getType()); - assertEquals(AUTO_CREATE_SUBNETWORKS, networkConfiguration.autoCreateSubnetworks()); - assertNull(networkConfiguration.getSubnetworks()); - } - - @Test - public void testToAndFromPb() { - assertTrue(NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb()) - instanceof SubnetNetworkConfiguration); - compareNetworkConfiguration(NETWORK_CONFIGURATION, - NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb())); - SubnetNetworkConfiguration networkConfiguration = - new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, null); - assertTrue(NetworkConfiguration.fromPb(networkConfiguration.toPb()) - instanceof SubnetNetworkConfiguration); - compareNetworkConfiguration(networkConfiguration, - NetworkConfiguration.fromPb(networkConfiguration.toPb())); - } - - @Test - public void testOf() { - SubnetNetworkConfiguration configuration = - SubnetNetworkConfiguration.of(AUTO_CREATE_SUBNETWORKS); - assertEquals(AUTO_CREATE_SUBNETWORKS, configuration.autoCreateSubnetworks()); - assertNull(configuration.getSubnetworks()); - assertEquals(NetworkConfiguration.Type.SUBNET, configuration.getType()); - } - - private void compareNetworkConfiguration(SubnetNetworkConfiguration expected, - SubnetNetworkConfiguration value) { - assertEquals(expected, value); - assertEquals(expected.autoCreateSubnetworks(), value.autoCreateSubnetworks()); - assertEquals(expected.getSubnetworks(), value.getSubnetworks()); - assertEquals(expected.getType(), value.getType()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java deleted file mode 100644 index 528847bdb785..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class SubnetworkIdTest { - - private static final String PROJECT = "project"; - private static final String REGION = "region"; - private static final String NAME = "subnet"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnet"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - SubnetworkId subnetworkId = SubnetworkId.of(PROJECT, REGION, NAME); - assertEquals(PROJECT, subnetworkId.getProject()); - assertEquals(REGION, subnetworkId.getRegion()); - assertEquals(NAME, subnetworkId.getSubnetwork()); - assertEquals(URL, subnetworkId.getSelfLink()); - subnetworkId = SubnetworkId.of(REGION, NAME); - assertNull(subnetworkId.getProject()); - assertEquals(REGION, subnetworkId.getRegion()); - assertEquals(NAME, subnetworkId.getSubnetwork()); - subnetworkId = SubnetworkId.of(RegionId.of(PROJECT, REGION), NAME); - assertEquals(PROJECT, subnetworkId.getProject()); - assertEquals(REGION, subnetworkId.getRegion()); - assertEquals(NAME, subnetworkId.getSubnetwork()); - } - - @Test - public void testToAndFromUrl() { - SubnetworkId subnetworkId = SubnetworkId.of(PROJECT, REGION, NAME); - compareSubnetworkId(subnetworkId, SubnetworkId.fromUrl(subnetworkId.getSelfLink())); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid subnetwork URL"); - SubnetworkId.fromUrl("notMatchingUrl"); - } - - @Test - public void testSetProjectId() { - SubnetworkId subnetworkId = SubnetworkId.of(PROJECT, REGION, NAME); - assertSame(subnetworkId, subnetworkId.setProjectId(PROJECT)); - compareSubnetworkId(subnetworkId, SubnetworkId.of(REGION, NAME).setProjectId(PROJECT)); - } - - @Test - public void testMatchesUrl() { - assertTrue(SubnetworkId.matchesUrl(SubnetworkId.of(PROJECT, REGION, NAME).getSelfLink())); - assertFalse(SubnetworkId.matchesUrl("notMatchingUrl")); - } - - private void compareSubnetworkId(SubnetworkId expected, SubnetworkId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getRegion(), expected.getRegion()); - assertEquals(expected.getSubnetwork(), expected.getSubnetwork()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java deleted file mode 100644 index 0d541cad2a55..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import org.junit.Test; - -public class SubnetworkInfoTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final SubnetworkId SUBNETWORK_ID = - SubnetworkId.of("project", "region", "subnetwork"); - private static final String GATEWAY_ADDRESS = "192.168.1.1"; - private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); - private static final String IP_RANGE = "192.168.0.0/16"; - private static final SubnetworkInfo SUBNETWORK_INFO = - SubnetworkInfo.newBuilder(SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGatewayAddress(GATEWAY_ADDRESS) - .build(); - - @Test - public void testToBuilder() { - compareSubnetworkInfo(SUBNETWORK_INFO, SUBNETWORK_INFO.toBuilder().build()); - SubnetworkInfo subnetworkInfo = - SUBNETWORK_INFO.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", subnetworkInfo.getDescription()); - subnetworkInfo = subnetworkInfo.toBuilder().setDescription("description").build(); - compareSubnetworkInfo(SUBNETWORK_INFO, subnetworkInfo); - } - - @Test - public void testToBuilderIncomplete() { - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); - assertEquals(subnetworkInfo, subnetworkInfo.toBuilder().build()); - } - - @Test - public void testBuilder() { - assertEquals(GENERATED_ID, SUBNETWORK_INFO.getGeneratedId()); - assertEquals(SUBNETWORK_ID, SUBNETWORK_INFO.getSubnetworkId()); - assertEquals(CREATION_TIMESTAMP, SUBNETWORK_INFO.getCreationTimestamp()); - assertEquals(DESCRIPTION, SUBNETWORK_INFO.getDescription()); - assertEquals(GATEWAY_ADDRESS, SUBNETWORK_INFO.getGatewayAddress()); - assertEquals(NETWORK_ID, SUBNETWORK_INFO.getNetwork()); - assertEquals(IP_RANGE, SUBNETWORK_INFO.getIpRange()); - } - - @Test - public void testOf() { - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); - assertNull(subnetworkInfo.getGeneratedId()); - assertEquals(SUBNETWORK_ID, subnetworkInfo.getSubnetworkId()); - assertNull(subnetworkInfo.getCreationTimestamp()); - assertNull(subnetworkInfo.getDescription()); - assertNull(subnetworkInfo.getGatewayAddress()); - assertEquals(NETWORK_ID, subnetworkInfo.getNetwork()); - assertEquals(IP_RANGE, subnetworkInfo.getIpRange()); - } - - @Test - public void testToAndFromPb() { - compareSubnetworkInfo(SUBNETWORK_INFO, SubnetworkInfo.fromPb(SUBNETWORK_INFO.toPb())); - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); - compareSubnetworkInfo(subnetworkInfo, SubnetworkInfo.fromPb(subnetworkInfo.toPb())); - } - - @Test - public void testSetProjectId() { - SubnetworkInfo subnetworkInfo = SUBNETWORK_INFO.toBuilder() - .setSubnetworkId(SubnetworkId.of("region", "subnetwork")) - .setNetwork(NetworkId.of("network")) - .build(); - compareSubnetworkInfo(SUBNETWORK_INFO, subnetworkInfo.setProjectId("project")); - } - - public void compareSubnetworkInfo(SubnetworkInfo expected, SubnetworkInfo value) { - assertEquals(expected, value); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getSubnetworkId(), value.getSubnetworkId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getGatewayAddress(), value.getGatewayAddress()); - assertEquals(expected.getNetwork(), value.getNetwork()); - assertEquals(expected.getIpRange(), value.getIpRange()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java deleted file mode 100644 index 3f2a67445b17..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class SubnetworkTest { - - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final SubnetworkId SUBNETWORK_ID = SubnetworkId.of("project", "region", "network"); - private static final String GATEWAY_ADDRESS = "192.168.1.1"; - private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); - private static final String IP_RANGE = "192.168.0.0/16"; - - private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); - private final ComputeOptions mockOptions = createMock(ComputeOptions.class); - private Compute compute; - private Subnetwork subnetwork; - private Subnetwork expectedSubnetwork; - - private void initializeExpectedSubnetwork(int optionsCalls) { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); - replay(serviceMockReturnsOptions); - expectedSubnetwork = - new Subnetwork.Builder(serviceMockReturnsOptions, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGatewayAddress(GATEWAY_ADDRESS) - .build(); - compute = createStrictMock(Compute.class); - } - - private void initializeSubnetwork() { - subnetwork = - new Subnetwork.Builder(compute, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setGatewayAddress(GATEWAY_ADDRESS) - .build(); - } - - @Test - public void testToBuilder() { - initializeExpectedSubnetwork(8); - compareSubnetwork(expectedSubnetwork, expectedSubnetwork.toBuilder().build()); - Subnetwork newSubnetwork = expectedSubnetwork.toBuilder().setDescription("newDescription").build(); - assertEquals("newDescription", newSubnetwork.getDescription()); - newSubnetwork = newSubnetwork.toBuilder().setDescription("description").build(); - compareSubnetwork(expectedSubnetwork, newSubnetwork); - } - - @Test - public void testToBuilderIncomplete() { - initializeExpectedSubnetwork(5); - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); - Subnetwork subnetwork = - new Subnetwork(serviceMockReturnsOptions, new SubnetworkInfo.BuilderImpl(subnetworkInfo)); - compareSubnetwork(subnetwork, subnetwork.toBuilder().build()); - } - - @Test - public void testBuilder() { - initializeExpectedSubnetwork(1); - assertEquals(GENERATED_ID, expectedSubnetwork.getGeneratedId()); - assertEquals(SUBNETWORK_ID, expectedSubnetwork.getSubnetworkId()); - assertEquals(CREATION_TIMESTAMP, expectedSubnetwork.getCreationTimestamp()); - assertEquals(DESCRIPTION, expectedSubnetwork.getDescription()); - assertEquals(GATEWAY_ADDRESS, expectedSubnetwork.getGatewayAddress()); - assertEquals(NETWORK_ID, expectedSubnetwork.getNetwork()); - assertEquals(IP_RANGE, expectedSubnetwork.getIpRange()); - assertSame(serviceMockReturnsOptions, expectedSubnetwork.getCompute()); - } - - @Test - public void testToAndFromPb() { - initializeExpectedSubnetwork(8); - compareSubnetwork(expectedSubnetwork, - Subnetwork.fromPb(serviceMockReturnsOptions, expectedSubnetwork.toPb())); - Subnetwork subnetwork = - new Subnetwork.Builder(serviceMockReturnsOptions, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .build(); - compareSubnetwork(subnetwork, Subnetwork.fromPb(serviceMockReturnsOptions, subnetwork.toPb())); - } - - @Test - public void testDeleteOperation() { - initializeExpectedSubnetwork(2); - expect(compute.getOptions()).andReturn(mockOptions); - Operation operation = new Operation.Builder(serviceMockReturnsOptions) - .setOperationId(GlobalOperationId.of("project", "op")) - .build(); - expect(compute.deleteSubnetwork(SUBNETWORK_ID)).andReturn(operation); - replay(compute); - initializeSubnetwork(); - assertSame(operation, subnetwork.delete()); - } - - @Test - public void testDeleteNull() { - initializeExpectedSubnetwork(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.deleteSubnetwork(SUBNETWORK_ID)).andReturn(null); - replay(compute); - initializeSubnetwork(); - assertNull(subnetwork.delete()); - } - - @Test - public void testExists_True() throws Exception { - initializeExpectedSubnetwork(1); - Compute.SubnetworkOption[] expectedOptions = {Compute.SubnetworkOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSubnetwork(SUBNETWORK_ID, expectedOptions)) - .andReturn(expectedSubnetwork); - replay(compute); - initializeSubnetwork(); - assertTrue(subnetwork.exists()); - verify(compute); - } - - @Test - public void testExists_False() throws Exception { - initializeExpectedSubnetwork(1); - Compute.SubnetworkOption[] expectedOptions = {Compute.SubnetworkOption.fields()}; - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSubnetwork(SUBNETWORK_ID, expectedOptions)).andReturn(null); - replay(compute); - initializeSubnetwork(); - assertFalse(subnetwork.exists()); - verify(compute); - } - - @Test - public void testReload() throws Exception { - initializeExpectedSubnetwork(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSubnetwork(SUBNETWORK_ID)).andReturn(expectedSubnetwork); - replay(compute); - initializeSubnetwork(); - Subnetwork updatedSubnetwork = subnetwork.reload(); - compareSubnetwork(expectedSubnetwork, updatedSubnetwork); - verify(compute); - } - - @Test - public void testReloadNull() throws Exception { - initializeExpectedSubnetwork(1); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSubnetwork(SUBNETWORK_ID)).andReturn(null); - replay(compute); - initializeSubnetwork(); - assertNull(subnetwork.reload()); - verify(compute); - } - - @Test - public void testReloadWithOptions() throws Exception { - initializeExpectedSubnetwork(3); - expect(compute.getOptions()).andReturn(mockOptions); - expect(compute.getSubnetwork(SUBNETWORK_ID, Compute.SubnetworkOption.fields())) - .andReturn(expectedSubnetwork); - replay(compute); - initializeSubnetwork(); - Subnetwork updatedSubnetwork = subnetwork.reload(Compute.SubnetworkOption.fields()); - compareSubnetwork(expectedSubnetwork, updatedSubnetwork); - verify(compute); - } - - public void compareSubnetwork(Subnetwork expected, Subnetwork value) { - assertEquals(expected, value); - assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getSubnetworkId(), value.getSubnetworkId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getGatewayAddress(), value.getGatewayAddress()); - assertEquals(expected.getNetwork(), value.getNetwork()); - assertEquals(expected.getIpRange(), value.getIpRange()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java deleted file mode 100644 index 420b677a033f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import com.google.common.collect.ImmutableList; - -import org.junit.Test; - -public class TagsTest { - - private static final Tags TAGS = Tags.of("tag1", "tag2"); - - @Test - public void testToBuilder() { - Tags tags = TAGS.toBuilder().setValues("tag1").build(); - assertEquals(ImmutableList.of("tag1"), tags.getValues()); - compareTags(TAGS, tags.toBuilder().setValues("tag1", "tag2").build()); - } - - @Test - public void testBuilder() { - Tags tags = Tags.newBuilder().setValues(ImmutableList.of("tag1", "tag2")).build(); - assertEquals(ImmutableList.of("tag1", "tag2"), tags.getValues()); - assertNull(tags.getFingerprint()); - tags = Tags.newBuilder().add("tag1").add("tag2").build(); - assertEquals(ImmutableList.of("tag1", "tag2"), tags.getValues()); - assertNull(tags.getFingerprint()); - tags = Tags.newBuilder().add("tag1").add("tag2").setFingerprint("fingerprint").build(); - assertEquals(ImmutableList.of("tag1", "tag2"), tags.getValues()); - assertEquals("fingerprint", tags.getFingerprint()); - } - - @Test - public void testOf() { - compareTags(TAGS, Tags.of("tag1", "tag2")); - compareTags(TAGS, Tags.of(ImmutableList.of("tag1", "tag2"))); - } - - @Test - public void testToAndFromPb() { - compareTags(TAGS, Tags.fromPb(TAGS.toPb())); - Tags tags = Tags.newBuilder().add("tag1").add("tag2").setFingerprint("fingerprint").build(); - compareTags(tags, Tags.fromPb(tags.toPb())); - } - - public void compareTags(Tags expected, Tags value) { - assertEquals(expected, value); - assertEquals(expected.getFingerprint(), value.getFingerprint()); - assertEquals(expected.getValues(), value.getValues()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java deleted file mode 100644 index 72d8e2f44eb3..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class ZoneIdTest { - - private static final String PROJECT = "project"; - private static final String ZONE = "zone"; - private static final String URL = - "https://www.googleapis.com/compute/v1/projects/project/zones/zone"; - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testOf() { - ZoneId zoneId = ZoneId.of(PROJECT, ZONE); - assertEquals(PROJECT, zoneId.getProject()); - assertEquals(ZONE, zoneId.getZone()); - assertEquals(URL, zoneId.getSelfLink()); - zoneId = ZoneId.of(ZONE); - assertNull(zoneId.getProject()); - assertEquals(ZONE, zoneId.getZone()); - } - - @Test - public void testToAndFromUrl() { - ZoneId zoneId = ZoneId.of(PROJECT, ZONE); - compareZoneId(zoneId, ZoneId.fromUrl(zoneId.getSelfLink())); - } - - @Test - public void testSetProjectId() { - ZoneId zoneId = ZoneId.of(PROJECT, ZONE); - assertSame(zoneId, zoneId.setProjectId(PROJECT)); - compareZoneId(zoneId, ZoneId.of(ZONE).setProjectId(PROJECT)); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("notMatchingUrl is not a valid zone URL"); - ZoneId.fromUrl("notMatchingUrl"); - } - - @Test - public void testMatchesUrl() { - assertTrue(ZoneId.matchesUrl(ZoneId.of(PROJECT, ZONE).getSelfLink())); - assertFalse(ZoneId.matchesUrl("notMatchingUrl")); - } - - private void compareZoneId(ZoneId expected, ZoneId value) { - assertEquals(expected, value); - assertEquals(expected.getProject(), expected.getProject()); - assertEquals(expected.getZone(), expected.getZone()); - assertEquals(expected.getSelfLink(), expected.getSelfLink()); - assertEquals(expected.hashCode(), expected.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java deleted file mode 100644 index 5d0a9f1d140a..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class ZoneTest { - - private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); - private static final RegionId REGION_ID = RegionId.of("project", "region"); - private static final String GENERATED_ID = "42"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; - private static final String DESCRIPTION = "description"; - private static final Zone.Status STATUS = Zone.Status.DOWN; - private static final DeprecationStatus DEPRECATION_STATUS = - DeprecationStatus.of(DeprecationStatus.Status.DELETED, ZONE_ID); - private static final Zone ZONE = Zone.builder() - .setZoneId(ZONE_ID) - .setGeneratedId(GENERATED_ID) - .setCreationTimestamp(CREATION_TIMESTAMP) - .setDescription(DESCRIPTION) - .setStatus(STATUS) - .setDeprecationStatus(DEPRECATION_STATUS) - .setRegion(REGION_ID) - .build(); - - @Test - public void testBuilder() { - assertEquals(REGION_ID, ZONE.getRegion()); - assertEquals(GENERATED_ID, ZONE.getGeneratedId()); - assertEquals(CREATION_TIMESTAMP, ZONE.getCreationTimestamp()); - assertEquals(DESCRIPTION, ZONE.getDescription()); - assertEquals(STATUS, ZONE.getStatus()); - assertEquals(REGION_ID, ZONE.getRegion()); - assertEquals(DEPRECATION_STATUS, ZONE.getDeprecationStatus()); - } - - @Test - public void testToAndFromPb() { - com.google.api.services.compute.model.Zone zonePb = ZONE.toPb(); - assertEquals(REGION_ID.getSelfLink(), zonePb.getRegion()); - Zone zone = Zone.fromPb(zonePb); - compareZones(ZONE, zone); - assertEquals(ZONE_ID.getProject(), zone.getZoneId().getProject()); - assertEquals(ZONE_ID.getZone(), zone.getZoneId().getZone()); - zone = Zone.builder().setZoneId(ZONE_ID).build(); - compareZones(zone, Zone.fromPb(zone.toPb())); - } - - private void compareZones(Zone expected, Zone value) { - assertEquals(expected, value); - assertEquals(expected.getZoneId(), value.getZoneId()); - assertEquals(expected.getGeneratedId(), value.getGeneratedId()); - assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); - assertEquals(expected.getDescription(), value.getDescription()); - assertEquals(expected.getStatus(), value.getStatus()); - assertEquals(expected.getRegion(), value.getRegion()); - assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); - assertEquals(expected.hashCode(), value.hashCode()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java deleted file mode 100644 index 03627e8ce452..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java +++ /dev/null @@ -1,1843 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.paging.Page; -import com.google.cloud.compute.deprecated.Address; -import com.google.cloud.compute.deprecated.AddressId; -import com.google.cloud.compute.deprecated.AddressInfo; -import com.google.cloud.compute.deprecated.AttachedDisk; -import com.google.cloud.compute.deprecated.Compute; -import com.google.cloud.compute.deprecated.DeprecationStatus; -import com.google.cloud.compute.deprecated.Disk; -import com.google.cloud.compute.deprecated.DiskConfiguration; -import com.google.cloud.compute.deprecated.DiskId; -import com.google.cloud.compute.deprecated.DiskImageConfiguration; -import com.google.cloud.compute.deprecated.DiskInfo; -import com.google.cloud.compute.deprecated.DiskType; -import com.google.cloud.compute.deprecated.DiskTypeId; -import com.google.cloud.compute.deprecated.GlobalAddressId; -import com.google.cloud.compute.deprecated.Image; -import com.google.cloud.compute.deprecated.ImageConfiguration; -import com.google.cloud.compute.deprecated.ImageDiskConfiguration; -import com.google.cloud.compute.deprecated.ImageId; -import com.google.cloud.compute.deprecated.ImageInfo; -import com.google.cloud.compute.deprecated.Instance; -import com.google.cloud.compute.deprecated.InstanceId; -import com.google.cloud.compute.deprecated.InstanceInfo; -import com.google.cloud.compute.deprecated.License; -import com.google.cloud.compute.deprecated.LicenseId; -import com.google.cloud.compute.deprecated.MachineType; -import com.google.cloud.compute.deprecated.MachineTypeId; -import com.google.cloud.compute.deprecated.Network; -import com.google.cloud.compute.deprecated.NetworkConfiguration; -import com.google.cloud.compute.deprecated.NetworkId; -import com.google.cloud.compute.deprecated.NetworkInfo; -import com.google.cloud.compute.deprecated.NetworkInterface; -import com.google.cloud.compute.deprecated.Operation; -import com.google.cloud.compute.deprecated.Region; -import com.google.cloud.compute.deprecated.RegionAddressId; -import com.google.cloud.compute.deprecated.RegionOperationId; -import com.google.cloud.compute.deprecated.SchedulingOptions; -import com.google.cloud.compute.deprecated.Snapshot; -import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; -import com.google.cloud.compute.deprecated.SnapshotId; -import com.google.cloud.compute.deprecated.SnapshotInfo; -import com.google.cloud.compute.deprecated.StandardDiskConfiguration; -import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; -import com.google.cloud.compute.deprecated.StorageImageConfiguration; -import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; -import com.google.cloud.compute.deprecated.Subnetwork; -import com.google.cloud.compute.deprecated.SubnetworkId; -import com.google.cloud.compute.deprecated.SubnetworkInfo; -import com.google.cloud.compute.deprecated.Zone; -import com.google.cloud.compute.deprecated.ZoneOperationId; -import com.google.cloud.compute.deprecated.testing.ResourceCleaner; -import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeoutException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; - -@Ignore -public class ITComputeTest { - - private static final String REGION = "us-central1"; - private static final String ZONE = "us-central1-a"; - private static final String DISK_TYPE = "local-ssd"; - private static final String MACHINE_TYPE = "f1-micro"; - private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); - private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); - private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); - private static final String IMAGE_PROJECT = "debian-cloud"; - - private static Compute compute; - private static ResourceCleaner resourceCleaner; - - - @Rule - public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() { - RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); - compute = computeHelper.getOptions().getService(); - resourceCleaner = ResourceCleaner.create(compute); - } - - @AfterClass - public static void tearDown() { - resourceCleaner.cleanUp(); - } - - @Test - public void testGetDiskType() { - DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); - // assertNotNull(diskType.getGeneratedId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testGetDiskTypeWithSelectedFields() { - DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, - Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - // assertNotNull(diskType.getGeneratedId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); - assertNotNull(diskType.getCreationTimestamp()); - assertNull(diskType.getDescription()); - assertNull(diskType.getValidDiskSize()); - assertNull(diskType.getDefaultDiskSizeGb()); - } - - @Test - public void testListDiskTypes() { - Page diskPage = compute.listDiskTypes(ZONE); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithSelectedFields() { - Page diskPage = compute.listDiskTypes(ZONE, - Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - assertNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNull(diskType.getDescription()); - assertNull(diskType.getValidDiskSize()); - assertNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testListDiskTypesWithFilter() { - Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( - Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertEquals(ZONE, diskType.getDiskTypeId().getZone()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypes() { - Page diskPage = compute.listDiskTypes(); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotNull(diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testAggregatedListDiskTypesWithFilter() { - Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( - Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); - Iterator diskTypeIterator = diskPage.iterateAll().iterator(); - assertTrue(diskTypeIterator.hasNext()); - while (diskTypeIterator.hasNext()) { - DiskType diskType = diskTypeIterator.next(); - // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.getGeneratedId()); - assertNotNull(diskType.getDiskTypeId()); - assertNotNull(diskType.getCreationTimestamp()); - assertNotNull(diskType.getDescription()); - assertNotNull(diskType.getValidDiskSize()); - assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); - } - } - - @Test - public void testGetMachineType() { - MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - - @Test - public void testGetMachineTypeWithSelectedFields() { - MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, - Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); - assertNotNull(machineType.getGeneratedId()); - assertNull(machineType.getCreationTimestamp()); - assertNull(machineType.getDescription()); - assertNull(machineType.getCpus()); - assertNull(machineType.getMemoryMb()); - assertNull(machineType.getMaximumPersistentDisks()); - assertNull(machineType.getMaximumPersistentDisksSizeGb()); - } - - @Test - public void testListMachineTypes() { - Page machinePage = compute.listMachineTypes(ZONE); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testListMachineTypesWithSelectedFields() { - Page machinePage = compute.listMachineTypes(ZONE, - Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNull(machineType.getDescription()); - assertNull(machineType.getCpus()); - assertNull(machineType.getMemoryMb()); - assertNull(machineType.getMaximumPersistentDisks()); - assertNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testListMachineTypesWithFilter() { - Page machinePage = compute.listMachineTypes(ZONE, - Compute.MachineTypeListOption.filter( - Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertEquals(ZONE, machineType.getMachineTypeId().getZone()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertEquals(2, (long) machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testAggregatedListMachineTypes() { - Page machinePage = compute.listMachineTypes(); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testAggregatedListMachineTypesWithFilter() { - Page machinePage = - compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( - Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); - Iterator machineTypeIterator = machinePage.iterateAll().iterator(); - assertTrue(machineTypeIterator.hasNext()); - while (machineTypeIterator.hasNext()) { - MachineType machineType = machineTypeIterator.next(); - assertNotNull(machineType.getMachineTypeId()); - assertNotNull(machineType.getGeneratedId()); - assertNotNull(machineType.getCreationTimestamp()); - assertNotNull(machineType.getDescription()); - assertNotNull(machineType.getCpus()); - assertNotEquals(2, (long) machineType.getCpus()); - assertNotNull(machineType.getMemoryMb()); - assertNotNull(machineType.getMaximumPersistentDisks()); - assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); - } - } - - @Test - public void testGetLicense() { - License license = compute.getLicense(LICENSE_ID); - assertEquals(LICENSE_ID, license.getLicenseId()); - assertNotNull(license.chargesUseFee()); - } - - @Test - public void testGetLicenseWithSelectedFields() { - License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); - assertEquals(LICENSE_ID, license.getLicenseId()); - assertNull(license.chargesUseFee()); - } - - @Test - public void testGetRegion() { - Region region = compute.getRegion(REGION); - assertEquals(REGION, region.getRegionId().getRegion()); - assertNotNull(region.getDescription()); - assertNotNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNotNull(region.getQuotas()); - assertNotNull(region.getStatus()); - assertNotNull(region.getZones()); - } - - @Test - public void testGetRegionWithSelectedFields() { - Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); - assertEquals(REGION, region.getRegionId().getRegion()); - assertNotNull(region.getGeneratedId()); - assertNull(region.getDescription()); - assertNull(region.getCreationTimestamp()); - assertNull(region.getQuotas()); - assertNull(region.getStatus()); - assertNull(region.getZones()); - } - - @Test - public void testListRegions() { - Page regionPage = compute.listRegions(); - Iterator regionIterator = regionPage.iterateAll().iterator(); - while (regionIterator.hasNext()) { - Region region = regionIterator.next(); - assertNotNull(region.getRegionId()); - assertNotNull(region.getDescription()); - assertNotNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNotNull(region.getQuotas()); - assertNotNull(region.getStatus()); - assertNotNull(region.getZones()); - } - } - - @Test - public void testListRegionsWithSelectedFields() { - Page regionPage = - compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); - Iterator regionIterator = regionPage.iterateAll().iterator(); - while (regionIterator.hasNext()) { - Region region = regionIterator.next(); - assertNotNull(region.getRegionId()); - assertNull(region.getDescription()); - assertNull(region.getCreationTimestamp()); - assertNotNull(region.getGeneratedId()); - assertNull(region.getQuotas()); - assertNull(region.getStatus()); - assertNull(region.getZones()); - } - } - - @Test - public void testListRegionsWithFilter() { - Page regionPage = compute.listRegions(Compute.RegionListOption.filter( - Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); - Iterator regionIterator = regionPage.iterateAll().iterator(); - assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); - assertFalse(regionIterator.hasNext()); - } - - @Test - public void testGetZone() { - Zone zone = compute.getZone(ZONE); - assertEquals(ZONE, zone.getZoneId().getZone()); - assertNotNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNotNull(zone.getDescription()); - assertNotNull(zone.getStatus()); - assertNotNull(zone.getRegion()); - } - - @Test - public void testGetZoneWithSelectedFields() { - Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); - assertEquals(ZONE, zone.getZoneId().getZone()); - assertNotNull(zone.getGeneratedId()); - assertNull(zone.getCreationTimestamp()); - assertNull(zone.getDescription()); - assertNull(zone.getStatus()); - assertNull(zone.getRegion()); - } - - @Test - public void testListZones() { - Page zonePage = compute.listZones(); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - while (zoneIterator.hasNext()) { - Zone zone = zoneIterator.next(); - assertNotNull(zone.getZoneId()); - assertNotNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNotNull(zone.getDescription()); - assertNotNull(zone.getStatus()); - assertNotNull(zone.getRegion()); - } - } - - @Test - public void testListZonesWithSelectedFields() { - Page zonePage = compute.listZones( - Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - while (zoneIterator.hasNext()) { - Zone zone = zoneIterator.next(); - assertNotNull(zone.getZoneId()); - assertNull(zone.getGeneratedId()); - assertNotNull(zone.getCreationTimestamp()); - assertNull(zone.getDescription()); - assertNull(zone.getStatus()); - assertNull(zone.getRegion()); - } - } - - @Test - public void testListZonesWithFilter() { - Page zonePage = compute.listZones( - Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); - Iterator zoneIterator = zonePage.iterateAll().iterator(); - assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); - assertFalse(zoneIterator.hasNext()); - } - - @Test - public void testListGlobalOperations() { - Page operationPage = compute.listGlobalOperations(); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListGlobalOperationsWithSelectedFields() { - Page operationPage = - compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListGlobalOperationsWithFilter() { - Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( - Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListRegionOperations() { - Page operationPage = compute.listRegionOperations(REGION); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListRegionOperationsWithSelectedFields() { - Page operationPage = compute.listRegionOperations(REGION, - Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListRegionOperationsWithFilter() { - Page operationPage = compute.listRegionOperations(REGION, - Compute.OperationListOption.filter(Compute.OperationFilter.equals( - Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(REGION, operation.getOperationId().getRegion()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListZoneOperations() { - Page operationPage = compute.listZoneOperations(ZONE); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertNotNull(operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testListZoneOperationsWithSelectedFields() { - Page operationPage = compute.listZoneOperations(ZONE, - Compute.OperationListOption.fields(Compute.OperationField.ID)); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - assertNull(operation.getOperationType()); - assertNull(operation.getTargetLink()); - assertNull(operation.getTargetId()); - assertNull(operation.getOperationType()); - assertNull(operation.getStatus()); - assertNull(operation.getStatusMessage()); - assertNull(operation.getUser()); - assertNull(operation.getProgress()); - assertNull(operation.getDescription()); - assertNull(operation.getInsertTime()); - assertNull(operation.getStartTime()); - assertNull(operation.getEndTime()); - assertNull(operation.getWarnings()); - assertNull(operation.getHttpErrorMessage()); - } - } - - @Test - public void testListZoneOperationsWithFilter() { - Page operationPage = compute.listZoneOperations(ZONE, - Compute.OperationListOption.filter(Compute.OperationFilter.equals( - Compute.OperationField.STATUS, "DONE"))); - Iterator operationIterator = operationPage.iterateAll().iterator(); - while (operationIterator.hasNext()) { - Operation operation = operationIterator.next(); - assertNotNull(operation.getGeneratedId()); - assertNotNull(operation.getOperationId()); - assertEquals(ZONE, operation.getOperationId().getZone()); - // todo(mziccard): uncomment or remove once #727 is closed - // assertNotNull(operation.getCreationTimestamp()); - assertNotNull(operation.getOperationType()); - assertEquals(Operation.Status.DONE, operation.getStatus()); - assertNotNull(operation.getUser()); - } - } - - @Test - public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; - AddressId addressId = RegionAddressId.of(REGION, name); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - // test get - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, remoteAddress.getAddressId().getRegion()); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNotNull(remoteAddress.getAddress()); - assertNotNull(remoteAddress.getCreationTimestamp()); - assertNotNull(remoteAddress.getGeneratedId()); - assertNotNull(remoteAddress.getStatus()); - // test get with selected fields - remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, remoteAddress.getAddressId().getRegion()); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNull(remoteAddress.getAddress()); - assertNull(remoteAddress.getCreationTimestamp()); - assertNull(remoteAddress.getGeneratedId()); - operation = remoteAddress.delete(); - operation.waitFor(); - resourceCleaner.remove(addressId); - assertNull(compute.getAddress(addressId)); - } - - @Test - public void testListRegionAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-region-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); - AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - // test list - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(address.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, address.getAddressId().getRegion()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - // test list with selected fields - count = 0; - addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), - Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); - addressIterator = addressPage.iterateAll().iterator(); - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertTrue(address.getAddressId() instanceof RegionAddressId); - assertEquals(REGION, address.getAddressId().getRegion()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); - AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; - AddressId addressId = GlobalAddressId.of(name); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - // test get - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNotNull(remoteAddress.getAddress()); - assertNotNull(remoteAddress.getCreationTimestamp()); - assertNotNull(remoteAddress.getGeneratedId()); - assertNotNull(remoteAddress.getStatus()); - // test get with selected fields - remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); - assertNotNull(remoteAddress); - assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); - assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); - assertNull(remoteAddress.getAddress()); - assertNull(remoteAddress.getCreationTimestamp()); - assertNull(remoteAddress.getGeneratedId()); - operation = remoteAddress.delete(); - operation.waitFor(); - resourceCleaner.remove(addressId); - assertNull(compute.getAddress(addressId)); - } - - @Test - public void testListGlobalAddresses() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-global-address"; - String[] addressNames = {prefix + "1", prefix + "2"}; - AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); - AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); - Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); - Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); - firstOperation.waitFor(); - resourceCleaner.add(firstAddressId); - secondOperation.waitFor(); - resourceCleaner.add(secondAddressId); - Set addressSet = ImmutableSet.copyOf(addressNames); - // test list - Compute.AddressFilter filter = - Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); - Page
addressPage = - compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); - Iterator
addressIterator = addressPage.iterateAll().iterator(); - int count = 0; - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertNotNull(address.getAddressId()); - assertTrue(address.getAddressId() instanceof GlobalAddressId); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNotNull(address.getCreationTimestamp()); - assertNotNull(address.getGeneratedId()); - count++; - } - assertEquals(2, count); - // test list with selected fields - count = 0; - addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), - Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); - addressIterator = addressPage.iterateAll().iterator(); - while (addressIterator.hasNext()) { - Address address = addressIterator.next(); - assertTrue(address.getAddressId() instanceof GlobalAddressId); - assertTrue(addressSet.contains(address.getAddressId().getAddress())); - assertNotNull(address.getAddress()); - assertNull(address.getCreationTimestamp()); - assertNull(address.getGeneratedId()); - assertNull(address.getStatus()); - assertNull(address.getUsage()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetResizeAndDeleteStandardDisk() - throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; - DiskId diskId = DiskId.of(ZONE, name); - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - // test get - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.resize(200L); - operation.waitFor(); - // test resize and get with selected fields - remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(200L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(diskId); - assertNull(compute.getDisk(diskId)); - } - - @Test - public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; - DiskId diskId = DiskId.of(ZONE, name); - DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - // test get - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); - ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); - assertNotNull(remoteConfiguration.getSourceImageId()); - assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); - assertNotNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - // test get with selected fields - remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); - assertNull(remoteConfiguration.getSourceImageId()); - assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(diskId); - assertNull(compute.getDisk(diskId)); - } - - @Test - public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() - throws InterruptedException, TimeoutException { - String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; - String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; - DiskId diskId = DiskId.of(ZONE, diskName); - DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); - String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); - operation.waitFor(); - Disk remoteDisk = compute.getDisk(diskId); - resourceCleaner.add(diskId); - operation = remoteDisk.createSnapshot(snapshotName); - operation.waitFor(); - // test get snapshot with selected fields - Snapshot snapshot = compute.getSnapshot(snapshotName, - Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - resourceCleaner.add(snapshot.getSnapshotId()); - assertNull(snapshot.getGeneratedId()); - assertNotNull(snapshot.getSnapshotId()); - assertNotNull(snapshot.getCreationTimestamp()); - assertNull(snapshot.getDescription()); - assertNull(snapshot.getStatus()); - assertNull(snapshot.getDiskSizeGb()); - assertNull(snapshot.getLicenses()); - assertNull(snapshot.getSourceDisk()); - assertNull(snapshot.getSourceDiskId()); - assertNull(snapshot.getStorageBytes()); - assertNull(snapshot.getStorageBytesStatus()); - // test get snapshot - snapshot = compute.getSnapshot(snapshotName); - assertNotNull(snapshot.getGeneratedId()); - assertNotNull(snapshot.getSnapshotId()); - assertNotNull(snapshot.getCreationTimestamp()); - assertNotNull(snapshot.getStatus()); - assertEquals(100L, (long) snapshot.getDiskSizeGb()); - assertEquals(diskName, snapshot.getSourceDisk().getDisk()); - assertNotNull(snapshot.getSourceDiskId()); - assertNotNull(snapshot.getStorageBytes()); - assertNotNull(snapshot.getStorageBytesStatus()); - remoteDisk.delete(); - resourceCleaner.remove(diskId); - diskInfo = - DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); - operation = compute.create(diskInfo); - operation.waitFor(); - // test get disk - remoteDisk = compute.getDisk(snapshotDiskId); - resourceCleaner.add(snapshotDiskId); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); - SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); - assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNotNull(remoteConfiguration.getSourceSnapshotId()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - // test get disk with selected fields - remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); - assertNotNull(remoteDisk); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); - assertNull(remoteDisk.getCreationStatus()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); - remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); - assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); - assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - operation = remoteDisk.delete(); - operation.waitFor(); - resourceCleaner.remove(snapshotDiskId); - assertNull(compute.getDisk(snapshotDiskId)); - operation = snapshot.delete(); - operation.waitFor(); - resourceCleaner.remove(snapshot.getSnapshotId()); - assertNull(compute.getSnapshot(snapshotName)); - } - - @Test - public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; - String[] diskNames = {prefix + "1", prefix + "2"}; - DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); - DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); - DiskConfiguration configuration = - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); - Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); - Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); - firstOperation.waitFor(); - resourceCleaner.add(firstDiskId); - secondOperation.waitFor(); - resourceCleaner.add(secondDiskId); - Set diskSet = ImmutableSet.copyOf(diskNames); - // test list disks - Compute.DiskFilter diskFilter = - Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); - Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); - Iterator diskIterator = diskPage.iterateAll().iterator(); - int count = 0; - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - count++; - } - assertEquals(2, count); - // test list disks with selected fields - count = 0; - diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), - Compute.DiskListOption.fields(Compute.DiskField.STATUS)); - diskIterator = diskPage.iterateAll().iterator(); - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertEquals(ZONE, remoteDisk.getDiskId().getZone()); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNull(remoteDisk.getCreationTimestamp()); - assertNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertNull(remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - assertNull(remoteDisk.getLastAttachTimestamp()); - assertNull(remoteDisk.getLastDetachTimestamp()); - count++; - } - assertEquals(2, count); - // test snapshots - SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); - SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); - firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); - secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); - firstOperation.waitFor(); - resourceCleaner.add(firstSnapshotId); - secondOperation.waitFor(); - resourceCleaner.add(secondSnapshotId); - // test list snapshots - Compute.SnapshotFilter snapshotFilter = - Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); - Page snapshotPage = - compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); - Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); - count = 0; - while (snapshotIterator.hasNext()) { - Snapshot remoteSnapshot = snapshotIterator.next(); - assertNotNull(remoteSnapshot.getGeneratedId()); - assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); - assertNotNull(remoteSnapshot.getCreationTimestamp()); - assertNotNull(remoteSnapshot.getStatus()); - assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); - assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); - assertNotNull(remoteSnapshot.getSourceDiskId()); - assertNotNull(remoteSnapshot.getStorageBytes()); - assertNotNull(remoteSnapshot.getStorageBytesStatus()); - count++; - } - assertEquals(2, count); - // test list snapshots with selected fields - snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), - Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - snapshotIterator = snapshotPage.iterateAll().iterator(); - count = 0; - while (snapshotIterator.hasNext()) { - Snapshot remoteSnapshot = snapshotIterator.next(); - assertNull(remoteSnapshot.getGeneratedId()); - assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); - assertNotNull(remoteSnapshot.getCreationTimestamp()); - assertNull(remoteSnapshot.getStatus()); - assertNull(remoteSnapshot.getDiskSizeGb()); - assertNull(remoteSnapshot.getSourceDisk()); - assertNull(remoteSnapshot.getSourceDiskId()); - assertNull(remoteSnapshot.getStorageBytes()); - assertNull(remoteSnapshot.getStorageBytesStatus()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testAggregatedListDisks() throws InterruptedException, TimeoutException { - String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; - String[] diskZones = {"us-central1-a", "us-east1-c"}; - String[] diskNames = {prefix + "1", prefix + "2"}; - DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); - DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); - DiskConfiguration configuration = - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); - Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); - Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); - firstOperation.waitFor(); - resourceCleaner.add(firstDiskId); - secondOperation.waitFor(); - resourceCleaner.add(secondDiskId); - Set zoneSet = ImmutableSet.copyOf(diskZones); - Set diskSet = ImmutableSet.copyOf(diskNames); - Compute.DiskFilter diskFilter = - Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); - Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); - Iterator diskIterator = diskPage.iterateAll().iterator(); - int count = 0; - while (diskIterator.hasNext()) { - Disk remoteDisk = diskIterator.next(); - assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); - assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); - assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); - assertNotNull(remoteDisk.getCreationTimestamp()); - assertNotNull(remoteDisk.getGeneratedId()); - assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); - StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); - assertEquals(100L, (long) remoteConfiguration.getSizeGb()); - assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); - assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); - count++; - } - assertEquals(2, count); - } - - @Test - public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { - String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; - String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; - DiskId diskId = DiskId.of(ZONE, diskName); - ImageId imageId = ImageId.of(imageName); - DiskInfo diskInfo = - DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); - Operation operation = compute.create(diskInfo); -operation.waitFor(); - Disk remoteDisk = compute.getDisk(diskId); - ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); - operation = compute.create(imageInfo); -operation.waitFor(); - resourceCleaner.add(diskId); - // test get image with selected fields - Image image = compute.getImage(imageId, - Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); - resourceCleaner.add(imageId); - assertNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNull(image.getDescription()); - assertNotNull(image.getConfiguration()); - assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); - DiskImageConfiguration remoteConfiguration = image.getConfiguration(); - assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); - assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - // test get image - image = compute.getImage(imageId); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); - remoteConfiguration = image.getConfiguration(); - assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); - assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); - assertEquals(100L, (long) image.getDiskSizeGb()); - assertNotNull(image.getStatus()); - assertNull(image.getDeprecationStatus()); - // test deprecate image - DeprecationStatus deprecationStatus = - DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) - .setDeprecated(System.currentTimeMillis()) - .build(); - operation = image.deprecate(deprecationStatus); - operation.waitFor(); - image = compute.getImage(imageId); - assertEquals(deprecationStatus, image.getDeprecationStatus()); - remoteDisk.delete(); - resourceCleaner.remove(diskId); - operation = image.delete(); - operation.waitFor(); - resourceCleaner.remove(imageId); - assertNull(compute.getImage(imageId)); - } - - @Test - public void testListImages() { - Page imagePage = compute.listImages(IMAGE_PROJECT); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNotNull(image.getStatus()); - assertNotNull(image.getDiskSizeGb()); - } - assertTrue(count > 0); - } - - @Test - public void testListImagesWithSelectedFields() { - Page imagePage = - compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNull(image.getStatus()); - assertNull(image.getDiskSizeGb()); - assertNull(image.getLicenses()); - assertNull(image.getDeprecationStatus()); - } - assertTrue(count > 0); - } - - @Test - public void testListImagesWithFilter() { - Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( - Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); - Iterator imageIterator = imagePage.iterateAll().iterator(); - int count = 0; - while (imageIterator.hasNext()) { - count++; - Image image = imageIterator.next(); - assertNotNull(image.getGeneratedId()); - assertNotNull(image.getImageId()); - assertNotNull(image.getCreationTimestamp()); - assertNotNull(image.getConfiguration()); - assertNotNull(image.getStatus()); - assertNotNull(image.getDiskSizeGb()); - assertEquals(365056004L, - (long) image.getConfiguration().getArchiveSizeBytes()); - } - assertTrue(count > 0); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "create-and-get-network"; - NetworkId networkId = NetworkId.of(name); - NetworkInfo networkInfo = - NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(networkInfo); -operation.waitFor(); - // test get network with selected fields - Network network = compute.getNetwork(networkId.getNetwork(), - Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); - resourceCleaner.add(networkId); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertNull(network.getDescription()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - // test get network - network = compute.getNetwork(networkId.getNetwork()); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - operation = network.delete(); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getNetwork(name)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testListNetworks() throws InterruptedException, TimeoutException { - String name = BASE_RESOURCE_NAME + "list-network"; - NetworkId networkId = NetworkId.of(name); - NetworkInfo networkInfo = - NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - resourceCleaner.add(networkId); - // test list - Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); - Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); - Iterator networkIterator = networkPage.iterateAll().iterator(); - int count = 0; - while (networkIterator.hasNext()) { - Network network = networkIterator.next(); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - count++; - } - assertEquals(1, count); - // test list with selected fields - count = 0; - networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), - Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); - networkIterator = networkPage.iterateAll().iterator(); - while (networkIterator.hasNext()) { - Network network = networkIterator.next(); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertNull(network.getDescription()); - assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); - StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); - assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); - count++; - } - assertEquals(1, count); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getNetwork(name)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { - String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; - NetworkId networkId = NetworkId.of(networkName); - NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - // test get network - Network network = compute.getNetwork(networkId.getNetwork()); - resourceCleaner.add(networkId); - assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); - assertNotNull(network.getGeneratedId()); - assertNotNull(network.getCreationTimestamp()); - assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); - assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); - assertFalse(network.getConfiguration().autoCreateSubnetworks()); - String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; - SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); - SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); - operation = compute.create(subnetworkInfo); - operation.waitFor(); - // test get subnetwork with selected fields - Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, - Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - resourceCleaner.add(subnetworkId); - assertNull(subnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(subnetwork.getCreationTimestamp()); - assertNull(subnetwork.getDescription()); - assertNull(subnetwork.getGatewayAddress()); - assertNull(subnetwork.getNetwork()); - assertNull(subnetwork.getIpRange()); - // test get subnetwork - subnetwork = compute.getSubnetwork(subnetworkId); - assertNotNull(subnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(subnetwork.getCreationTimestamp()); - assertNotNull(subnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); - assertEquals("192.168.0.0/16", subnetwork.getIpRange()); - // test list subnetworks - Compute.SubnetworkFilter filter = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); - Page subnetworkPage = - compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); - Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); - int count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), - remoteSubnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNotNull(remoteSubnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); - assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); - count++; - } - assertEquals(1, count); - // test list subnetworks with selected fields - subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), - Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - subnetworkIterator = subnetworkPage.iterateAll().iterator(); - count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNull(remoteSubnetwork.getGeneratedId()); - assertEquals(subnetworkId.getSubnetwork(), - remoteSubnetwork.getSubnetworkId().getSubnetwork()); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNull(remoteSubnetwork.getDescription()); - assertNull(remoteSubnetwork.getGatewayAddress()); - assertNull(remoteSubnetwork.getNetwork()); - assertNull(remoteSubnetwork.getIpRange()); - count++; - } - assertEquals(1, count); - operation = subnetwork.delete(); - operation.waitFor(); - resourceCleaner.remove(subnetworkId); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getSubnetwork(subnetworkId)); - assertNull(compute.getNetwork(networkName)); - } - - @Ignore("Avoid leaving orphan networks when interrupted: see #2118") - @Test - public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { - String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; - NetworkId networkId = NetworkId.of(networkName); - NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); - Operation operation = compute.create(networkInfo); - operation.waitFor(); - resourceCleaner.add(networkId); - String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; - String[] regionNames = {"us-central1", "us-east1"}; - String[] subnetworkNames = {prefix + "1", prefix + "2"}; - String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; - SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); - SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); - SubnetworkInfo firstSubnetworkInfo = - SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); - SubnetworkInfo secondSubnetworkInfo = - SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); - Operation firstOperation = compute.create(firstSubnetworkInfo); - Operation secondOperation = compute.create(secondSubnetworkInfo); - firstOperation.waitFor(); - resourceCleaner.add(firstSubnetworkId); - secondOperation.waitFor(); - resourceCleaner.add(secondSubnetworkId); - Set regionSet = ImmutableSet.copyOf(regionNames); - Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); - Set rangeSet = ImmutableSet.copyOf(ipRanges); - Compute.SubnetworkFilter subnetworkFilter = - Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); - Page subnetworkPage = - compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); - Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); - int count = 0; - while (subnetworkIterator.hasNext()) { - Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.getGeneratedId()); - assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); - assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); - assertNotNull(remoteSubnetwork.getCreationTimestamp()); - assertNotNull(remoteSubnetwork.getGatewayAddress()); - assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); - assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); - count++; - } - assertEquals(2, count); - firstOperation = compute.deleteSubnetwork(firstSubnetworkId); - secondOperation = compute.deleteSubnetwork(secondSubnetworkId); - firstOperation.waitFor(); - resourceCleaner.remove(firstSubnetworkId); - secondOperation.waitFor(); - resourceCleaner.remove(secondSubnetworkId); - operation = compute.deleteNetwork(networkId); - operation.waitFor(); - resourceCleaner.remove(networkId); - assertNull(compute.getSubnetwork(firstSubnetworkId)); - assertNull(compute.getSubnetwork(secondSubnetworkId)); - assertNull(compute.getNetwork(networkName)); - } - - @Test - public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; - String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; - // Create an address to assign to the instance - AddressId addressId = RegionAddressId.of(REGION, addressName); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation operation = compute.create(addressInfo); - operation.waitFor(); - Address address = compute.getAddress(addressId); - resourceCleaner.add(addressId); - // Create an instance - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) - .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() - .setName("NAT") - .setNatIp(address.getAddress()).build()) - .build(); - AttachedDisk disk1 = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - AttachedDisk disk2 = - AttachedDisk.of("dev1", - AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) - .setAttachedDisks(disk1, disk2) - .setNetworkInterfaces(networkInterface) - .build(); - operation = compute.create(instanceInfo); - operation.waitFor(); - // test get - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); - assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); - assertEquals(ZONE, remoteInstance.getMachineType().getZone()); - assertNotNull(remoteInstance.getCreationTimestamp()); - Set deviceSet = ImmutableSet.of("dev0", "dev1"); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - } - assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, - remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); - AttachedDisk.PersistentDiskConfiguration remoteConfiguration = - remoteInstance.getAttachedDisks().get(0).getConfiguration(); - assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); - assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); - assertTrue(remoteConfiguration.boot()); - assertTrue(remoteConfiguration.autoDelete()); - assertEquals(1, remoteInstance.getNetworkInterfaces().size()); - NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); - assertNotNull(remoteNetworkInterface.getName()); - assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); - List remoteAccessConfigurations = - remoteNetworkInterface.getAccessConfigurations(); - assertNotNull(remoteAccessConfigurations); - assertEquals(1, remoteAccessConfigurations.size()); - NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); - assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); - assertEquals("NAT", remoteAccessConfig.getName()); - assertNotNull(remoteInstance.getMetadata()); - assertNotNull(remoteInstance.getTags()); - // test get with selected fields - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); - assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); - assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); - assertNull(remoteInstance.getMachineType()); - assertNotNull(remoteInstance.getCreationTimestamp()); - assertNull(remoteInstance.getAttachedDisks()); - assertNull(remoteInstance.getNetworkInterfaces()); - assertNull(remoteInstance.getMetadata()); - assertNull(remoteInstance.getTags()); - // test get default serial port output - String serialPortOutput = remoteInstance.getSerialPortOutput(); - assertNotNull(serialPortOutput); - // test get serial port output by number - String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); - assertTrue(newSerialPortOutput.contains(serialPortOutput)); - operation = remoteInstance.delete(); - operation.waitFor(); - resourceCleaner.remove(instanceId); - assertNull(compute.getInstance(instanceId)); - } - - @Test - public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation operation = compute.create(instanceInfo); - operation.waitFor(); - Instance remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - resourceCleaner.add(instanceId); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - operation = remoteInstance.stop(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); - operation = remoteInstance.start(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - operation = remoteInstance.reset(); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId, - Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); - assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); - } - - @Test - public void testSetInstanceProperties() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation operation = compute.create(instanceInfo); - operation.waitFor(); - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - // test set tags - List tags = ImmutableList.of("tag1", "tag2"); - operation = remoteInstance.setTags(tags); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(tags, remoteInstance.getTags().getValues()); - // test set metadata - Map metadata = ImmutableMap.of("key", "value"); - operation = remoteInstance.setMetadata(metadata); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(metadata, remoteInstance.getMetadata().getValues()); - // test set machine type - operation = remoteInstance.stop(); - operation.waitFor(); - operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); - assertEquals(ZONE, remoteInstance.getMachineType().getZone()); - // test set scheduling options - SchedulingOptions options = - SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); - operation = remoteInstance.setSchedulingOptions(options); - operation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(options, remoteInstance.getSchedulingOptions()); - } - - @Test - public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; - String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation instanceOperation = compute.create(instanceInfo); - DiskId diskId = DiskId.of(ZONE, diskName); - Operation diskOperation = compute.create(DiskInfo.of(diskId, - StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); - instanceOperation.waitFor(); - diskOperation.waitFor(); - resourceCleaner.add(diskId); - Instance remoteInstance = compute.getInstance(instanceId); - // test attach disk - instanceOperation = remoteInstance.attachDisk("dev1", - AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - Set deviceSet = ImmutableSet.of("dev0", "dev1"); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - } - // test set disk auto-delete - instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(2, remoteInstance.getAttachedDisks().size()); - for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { - assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); - assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); - } - // test detach disk - instanceOperation = remoteInstance.detachDisk("dev1"); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertEquals(1, remoteInstance.getAttachedDisks().size()); - assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); - } - - @Test - public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { - String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; - String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; - InstanceId instanceId = InstanceId.of(ZONE, instanceName); - NetworkId networkId = NetworkId.of("default"); - NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); - AttachedDisk disk = AttachedDisk.of("dev0", - AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); - InstanceInfo instanceInfo = - InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) - .setAttachedDisks(disk) - .setNetworkInterfaces(networkInterface) - .build(); - Operation instanceOperation = compute.create(instanceInfo); - AddressId addressId = RegionAddressId.of(REGION, addressName); - AddressInfo addressInfo = AddressInfo.of(addressId); - Operation addressOperation = compute.create(addressInfo); - addressOperation.waitFor(); - instanceOperation.waitFor(); - Address remoteAddress = compute.getAddress(addressId); - resourceCleaner.add(addressId); - Instance remoteInstance = compute.getInstance(instanceId); - resourceCleaner.add(instanceId); - String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); - // test add access config - NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() - .setNatIp(remoteAddress.getAddress()) - .setName("NAT") - .build(); - instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - List accessConfigurations = - remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); - assertEquals(1, accessConfigurations.size()); - assertEquals("NAT", accessConfigurations.get(0).getName()); - // test delete access config - instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); - instanceOperation.waitFor(); - remoteInstance = compute.getInstance(instanceId); - assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); - } -} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java deleted file mode 100644 index 9c4a1960da0f..000000000000 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.compute.deprecated.testing; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.http.HttpTransportOptions; -import com.google.cloud.compute.deprecated.ComputeOptions; -import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper.ComputeHelperException; - -import org.threeten.bp.Duration; -import org.junit.Test; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.regex.Pattern; -import org.junit.Test; - -public class RemoteComputeHelperTest { - - private static final String PROJECT_ID = "project-id"; - private static final String JSON_KEY = "{\n" - + " \"private_key_id\": \"somekeyid\",\n" - + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" - + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" - + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" - + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" - + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" - + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" - + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" - + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" - + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" - + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" - + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" - + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" - + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" - + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" - + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" - + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" - + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" - + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" - + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" - + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" - + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" - + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" - + " \"type\": \"service_account\"\n" - + "}"; - private static final InputStream JSON_KEY_STREAM = new ByteArrayInputStream(JSON_KEY.getBytes()); - private static final String BASE_RESOURCE_NAME_REGEX = "test-[0-9a-f]{24}-"; - private static final Pattern BASE_RESOURCE_NAME_PATTERN = - Pattern.compile(BASE_RESOURCE_NAME_REGEX); - - @Test - public void testBaseResourceName() { - String baseResourceName = RemoteComputeHelper.baseResourceName(); - assertTrue(BASE_RESOURCE_NAME_PATTERN.matcher(baseResourceName).matches()); - } - - @Test - public void testCreateFromStream() { - RemoteComputeHelper helper = RemoteComputeHelper.create(PROJECT_ID, JSON_KEY_STREAM); - ComputeOptions options = helper.getOptions(); - assertEquals(PROJECT_ID, options.getProjectId()); - assertEquals(60000, - ((HttpTransportOptions) options.getTransportOptions()).getConnectTimeout()); - assertEquals(60000, - ((HttpTransportOptions) options.getTransportOptions()).getReadTimeout()); - assertEquals(10, options.getRetrySettings().getMaxAttempts()); - assertEquals(Duration.ofMillis(30000), options.getRetrySettings().getMaxRetryDelay()); - assertEquals(Duration.ofMillis(120000), options.getRetrySettings().getTotalTimeout()); - assertEquals(Duration.ofMillis(250), options.getRetrySettings().getInitialRetryDelay()); - } - - @Test - public void testComputeHelperException() { - ComputeHelperException exception = new ComputeHelperException("message", null); - assertEquals("message", exception.getMessage()); - assertNull(exception.getCause()); - IOException cause = new IOException("message"); - exception = ComputeHelperException.translate(cause); - assertEquals("message", exception.getMessage()); - assertSame(cause, exception.getCause()); - } -} diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AcceleratorTypeClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AutoscalerClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskTypeClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/FirewallClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalOperationClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HealthCheckClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpHealthCheckClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/HttpsHealthCheckClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectLocationClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseCodeClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/MachineTypeClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NetworkClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionAutoscalerClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionBackendServiceClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionCommitmentClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionDiskTypeClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionOperationClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouteClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslCertificateClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SslPolicyClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpProxyClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetInstanceClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetPoolClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetSslProxyClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetTcpProxyClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetVpnGatewayClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/UrlMapClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/VpnTunnelClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneClientTest.java diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java similarity index 100% rename from google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java rename to google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ZoneOperationClientTest.java From 6c34057d9de81ff06601a5e4f064a64482e475e6 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 22 May 2018 15:36:56 -0700 Subject: [PATCH 40/42] add back in deprecated compute package --- .../cloud/compute/deprecated/Address.java | 191 + .../cloud/compute/deprecated/AddressId.java | 91 + .../cloud/compute/deprecated/AddressInfo.java | 574 +++ .../compute/deprecated/AttachedDisk.java | 926 ++++ .../cloud/compute/deprecated/Compute.java | 2709 +++++++++++ .../compute/deprecated/ComputeException.java | 62 + .../compute/deprecated/ComputeFactory.java | 25 + .../cloud/compute/deprecated/ComputeImpl.java | 2058 ++++++++ .../compute/deprecated/ComputeOptions.java | 145 + .../compute/deprecated/DeprecationStatus.java | 360 ++ .../google/cloud/compute/deprecated/Disk.java | 262 ++ .../compute/deprecated/DiskConfiguration.java | 203 + .../cloud/compute/deprecated/DiskId.java | 162 + .../deprecated/DiskImageConfiguration.java | 165 + .../cloud/compute/deprecated/DiskInfo.java | 443 ++ .../cloud/compute/deprecated/DiskType.java | 244 + .../cloud/compute/deprecated/DiskTypeId.java | 153 + .../compute/deprecated/ForwardingRuleId.java | 93 + .../compute/deprecated/GlobalAddressId.java | 104 + .../deprecated/GlobalForwardingRuleId.java | 123 + .../compute/deprecated/GlobalOperationId.java | 92 + .../cloud/compute/deprecated/Image.java | 214 + .../deprecated/ImageConfiguration.java | 190 + .../deprecated/ImageDiskConfiguration.java | 178 + .../cloud/compute/deprecated/ImageId.java | 145 + .../cloud/compute/deprecated/ImageInfo.java | 417 ++ .../cloud/compute/deprecated/Instance.java | 465 ++ .../cloud/compute/deprecated/InstanceId.java | 177 + .../compute/deprecated/InstanceInfo.java | 676 +++ .../cloud/compute/deprecated/License.java | 92 + .../cloud/compute/deprecated/LicenseId.java | 128 + .../cloud/compute/deprecated/MachineType.java | 323 ++ .../compute/deprecated/MachineTypeId.java | 148 + .../cloud/compute/deprecated/Metadata.java | 212 + .../cloud/compute/deprecated/Network.java | 194 + .../deprecated/NetworkConfiguration.java | 98 + .../cloud/compute/deprecated/NetworkId.java | 137 + .../cloud/compute/deprecated/NetworkInfo.java | 291 ++ .../compute/deprecated/NetworkInterface.java | 548 +++ .../cloud/compute/deprecated/Operation.java | 845 ++++ .../cloud/compute/deprecated/OperationId.java | 93 + .../cloud/compute/deprecated/Option.java | 72 + .../cloud/compute/deprecated/Region.java | 421 ++ .../compute/deprecated/RegionAddressId.java | 151 + .../deprecated/RegionForwardingRuleId.java | 167 + .../cloud/compute/deprecated/RegionId.java | 133 + .../compute/deprecated/RegionOperationId.java | 133 + .../cloud/compute/deprecated/ResourceId.java | 71 + .../compute/deprecated/SchedulingOptions.java | 193 + .../compute/deprecated/ServiceAccount.java | 123 + .../cloud/compute/deprecated/Snapshot.java | 216 + .../deprecated/SnapshotDiskConfiguration.java | 184 + .../cloud/compute/deprecated/SnapshotId.java | 132 + .../compute/deprecated/SnapshotInfo.java | 484 ++ .../deprecated/StandardDiskConfiguration.java | 131 + .../StandardNetworkConfiguration.java | 102 + .../deprecated/StorageImageConfiguration.java | 204 + .../SubnetNetworkConfiguration.java | 111 + .../cloud/compute/deprecated/Subnetwork.java | 191 + .../compute/deprecated/SubnetworkId.java | 179 + .../compute/deprecated/SubnetworkInfo.java | 348 ++ .../google/cloud/compute/deprecated/Tags.java | 227 + .../google/cloud/compute/deprecated/Zone.java | 303 ++ .../cloud/compute/deprecated/ZoneId.java | 128 + .../compute/deprecated/ZoneOperationId.java | 133 + .../compute/deprecated/package-info.java | 59 + .../deprecated/spi/ComputeRpcFactory.java | 27 + .../compute/deprecated/spi/v1/ComputeRpc.java | 650 +++ .../deprecated/spi/v1/HttpComputeRpc.java | 1159 +++++ .../testing/RemoteComputeHelper.java | 137 + .../deprecated/testing/ResourceCleaner.java | 171 + .../deprecated/testing/package-info.java | 31 + .../compute/deprecated/AddressIdTest.java | 119 + .../compute/deprecated/AddressInfoTest.java | 200 + .../cloud/compute/deprecated/AddressTest.java | 294 ++ .../compute/deprecated/AttachedDiskTest.java | 393 ++ .../deprecated/ComputeExceptionTest.java | 99 + .../compute/deprecated/ComputeImplTest.java | 4118 +++++++++++++++++ .../deprecated/ComputeOptionsTest.java | 36 + .../deprecated/DeprecationStatusTest.java | 183 + .../cloud/compute/deprecated/DiskIdTest.java | 87 + .../DiskImageConfigurationTest.java | 110 + .../compute/deprecated/DiskInfoTest.java | 267 ++ .../cloud/compute/deprecated/DiskTest.java | 475 ++ .../compute/deprecated/DiskTypeIdTest.java | 84 + .../compute/deprecated/DiskTypeTest.java | 72 + .../deprecated/ForwardingRuleIdTest.java | 139 + .../ImageDiskConfigurationTest.java | 112 + .../cloud/compute/deprecated/ImageIdTest.java | 79 + .../compute/deprecated/ImageInfoTest.java | 179 + .../cloud/compute/deprecated/ImageTest.java | 307 ++ .../compute/deprecated/InstanceIdTest.java | 88 + .../compute/deprecated/InstanceInfoTest.java | 184 + .../compute/deprecated/InstanceTest.java | 917 ++++ .../compute/deprecated/LicenseIdTest.java | 79 + .../cloud/compute/deprecated/LicenseTest.java | 49 + .../compute/deprecated/MachineTypeIdTest.java | 83 + .../compute/deprecated/MachineTypeTest.java | 89 + .../compute/deprecated/MetadataTest.java | 81 + .../compute/deprecated/NetworkIdTest.java | 79 + .../compute/deprecated/NetworkInfoTest.java | 126 + .../deprecated/NetworkInterfaceTest.java | 182 + .../cloud/compute/deprecated/NetworkTest.java | 259 ++ .../compute/deprecated/OperationIdTest.java | 169 + .../compute/deprecated/OperationTest.java | 518 +++ .../compute/deprecated/RegionIdTest.java | 79 + .../cloud/compute/deprecated/RegionTest.java | 89 + .../deprecated/SchedulingOptionsTest.java | 57 + .../compute/deprecated/SerializationTest.java | 304 ++ .../deprecated/ServiceAccountTest.java | 47 + .../SnapshotDiskConfigurationTest.java | 112 + .../compute/deprecated/SnapshotIdTest.java | 79 + .../compute/deprecated/SnapshotInfoTest.java | 136 + .../compute/deprecated/SnapshotTest.java | 218 + .../StandardDiskConfigurationTest.java | 103 + .../StandardNetworkConfigurationTest.java | 76 + .../StorageImageConfigurationTest.java | 106 + .../SubnetNetworkConfigurationTest.java | 82 + .../compute/deprecated/SubnetworkIdTest.java | 87 + .../deprecated/SubnetworkInfoTest.java | 108 + .../compute/deprecated/SubnetworkTest.java | 210 + .../cloud/compute/deprecated/TagsTest.java | 69 + .../cloud/compute/deprecated/ZoneIdTest.java | 79 + .../cloud/compute/deprecated/ZoneTest.java | 77 + .../compute/deprecated/it/ITComputeTest.java | 1842 ++++++++ .../testing/RemoteComputeHelperTest.java | 102 + 126 files changed, 35845 insertions(+) create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java new file mode 100644 index 000000000000..643f0a6f1ad2 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Address.java @@ -0,0 +1,191 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.Compute.AddressOption; +import com.google.cloud.compute.deprecated.Compute.OperationOption; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Objects; + +/** + * A Google Compute Engine address. With Compute Engine you can create static external IP addresses + * that are assigned to your project and persist until you explicitly release them. A region address + * can be assigned to a Compute Engine instance or to a regional forwarding rule. Compute Engine + * also allows you to create global addresses that are used for global forwarding rules. Both global + * addresses and global forwarding rules can only be used for HTTP load balancing. {@code Address} + * adds a layer of service-related functionality over {@link AddressInfo}. Objects of this class are + * immutable. To get an {@code Address} object with the most recent information use {@link #reload}. + * + * @see + * Static external IP addresses + * @see HTTP Load Balancing + */ +public class Address extends AddressInfo { + + private static final long serialVersionUID = 3457542817554062712L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Address} objects. + */ + public static class Builder extends AddressInfo.Builder { + + private final Compute compute; + private final AddressInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, AddressId addressId) { + this.compute = compute; + this.infoBuilder = new AddressInfo.BuilderImpl(); + this.infoBuilder.setAddressId(addressId); + } + + Builder(Address address) { + this.compute = address.compute; + this.infoBuilder = new AddressInfo.BuilderImpl(address); + } + + @Override + public Builder setAddress(String address) { + infoBuilder.setAddress(address); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + infoBuilder.setCreationTimestamp(creationTimestamp); + return this; + } + + @Override + public Builder setDescription(String description) { + infoBuilder.setDescription(description); + return this; + } + + @Override + Builder setGeneratedId(String generatedId) { + infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + public Builder setAddressId(AddressId addressId) { + infoBuilder.setAddressId(addressId); + return this; + } + + @Override + Builder setStatus(Status status) { + infoBuilder.setStatus(status); + return this; + } + + @Override + Builder setUsage(Usage usage) { + infoBuilder.setUsage(usage); + return this; + } + + @Override + public Address build() { + return new Address(compute, infoBuilder); + } + } + + Address(Compute compute, AddressInfo.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this address exists. + * + * @return {@code true} if this address exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(AddressOption.fields()) != null; + } + + /** + * Fetches the current address' latest information. Returns {@code null} if the address does not + * exist. + * + * @param options address options + * @return an {@code Address} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Address reload(AddressOption... options) { + return compute.getAddress(getAddressId(), options); + } + + /** + * Deletes this address. + * + * @return an {@code Operation} object if delete request was successfully sent, {@code null} if + * the address was not found + * @throws ComputeException upon failure + */ + public Operation delete(OperationOption... options) { + return compute.deleteAddress(getAddressId(), options); + } + + /** + * Returns the address's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Address.class)) { + return false; + } + Address other = (Address) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Address fromPb(Compute compute, com.google.api.services.compute.model.Address addressPb) { + return new Address(compute, new AddressInfo.BuilderImpl(addressPb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java new file mode 100644 index 000000000000..137335027530 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressId.java @@ -0,0 +1,91 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * Base class for Google Compute Engine address identities. + */ +public abstract class AddressId extends ResourceId { + + private static final long serialVersionUID = 147328216049936438L; + + private final String address; + + /** + * Possible types for a Google Compute Engine address identity. + */ + enum Type { + /** + * Global static external IP addresses can be assigned to global forwarding rules. + */ + GLOBAL, + + /** + * Region static external IP addresses can be assigned to instances and region forwarding rules. + */ + REGION + } + + AddressId(String project, String address) { + super(project); + this.address = checkNotNull(address); + } + + /** + * Returns the type of this address identity. + */ + public abstract Type getType(); + + /** + * Returns the name of the address resource. The name must be 1-63 characters long and comply with + * RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getAddress() { + return address; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("address", address); + } + + @Override + final int baseHashCode() { + return Objects.hash(super.baseHashCode(), address); + } + + @Override + final boolean baseEquals(ResourceId resourceId) { + return resourceId instanceof AddressId + && super.baseEquals(resourceId) + && Objects.equals(address, ((AddressId) resourceId).address); + } + + @Override + abstract AddressId setProjectId(String projectId); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java new file mode 100644 index 000000000000..0bde7a3e4b0d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AddressInfo.java @@ -0,0 +1,574 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Address; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine address. With Compute Engine you can create static external IP addresses + * that are assigned to your project and persist until you explicitly release them. A region address + * can be assigned to a Compute Engine instance or to a regional forwarding rule. To create a region + * address, use a {@link RegionAddressId} identity. Compute Engine also allows you to create global + * addresses that are used for global forwarding rules. Both global addresses and global forwarding + * rules can only be used for HTTP load balancing. To create a global address, use a + * {@link GlobalAddressId} identity. + * + * @see + * Static external IP addresses + * @see HTTP Load Balancing + */ +public class AddressInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public AddressInfo apply(Address pb) { + return AddressInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Address apply(AddressInfo addressInfo) { + return addressInfo.toPb(); + } + }; + + private static final long serialVersionUID = 7678434703520207500L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String address; + private final Long creationTimestamp; + private final String description; + private final String generatedId; + private final AddressId addressId; + private final Status status; + private final Usage usage; + + /** + * The status of the address. + */ + public enum Status { + + /** + * The address is reserved for the project and is available for use. + */ + RESERVED, + + /** + * The address is currently being used and thus not available. + */ + IN_USE + } + + /** + * Base class for a Google Compute Engine address's usage information. Implementations of this + * class represent different possible usages of a Compute Engine address. {@link InstanceUsage} + * contains information for region addresses assigned to a Google Compute Engine instance. + * {@link RegionForwardingUsage} contains information for region addresses assigned to one or more + * region forwarding rules. {@link GlobalForwardingUsage} contains information for global + * addresses assigned to one or more global forwarding rules. + */ + public abstract static class Usage implements Serializable { + + private static final long serialVersionUID = -5028609518171408695L; + + Usage() {} + + /** + * Returns the identities of resources currently using this address. + */ + public abstract List getUsers(); + + final boolean baseEquals(Usage usage) { + return Objects.equals(toPb(), usage.toPb()); + } + + Address toPb() { + return new Address().setUsers(Lists.transform(getUsers(), new Function() { + @Override + public String apply(ResourceId resourceId) { + return resourceId.getSelfLink(); + } + })); + } + + @SuppressWarnings("unchecked") + static T fromPb(Address addressPb) { + String url = addressPb.getUsers().get(0); + if (InstanceId.matchesUrl(url)) { + return (T) InstanceUsage.fromPb(addressPb); + } else if (RegionForwardingRuleId.matchesUrl(url)) { + return (T) RegionForwardingUsage.fromPb(addressPb); + } else if (GlobalForwardingRuleId.matchesUrl(url)) { + return (T) GlobalForwardingUsage.fromPb(addressPb); + } else { + throw new IllegalArgumentException("Unexpected resource URL for address user"); + } + } + } + + /** + * Usage information for a Google Compute Engine region address assigned to a virtual machine + * instance. + */ + public static final class InstanceUsage extends Usage { + + private static final long serialVersionUID = -5028609518171408695L; + + private final InstanceId instance; + + InstanceUsage(InstanceId instance) { + this.instance = checkNotNull(instance); + } + + /** + * Returns the identity of the instance using the address. + */ + public InstanceId getInstance() { + return instance; + } + + @Override + public List getUsers() { + return ImmutableList.of(instance); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("instance", instance).toString(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof InstanceUsage && baseEquals((InstanceUsage) obj); + } + + @Override + public int hashCode() { + return Objects.hash(instance); + } + + @SuppressWarnings("unchecked") + static InstanceUsage fromPb(Address addressPb) { + return new InstanceUsage(InstanceId.fromUrl(addressPb.getUsers().get(0))); + } + } + + /** + * Usage information for a Google Compute Engine region address assigned to one or more region + * forwarding rules. + */ + public static final class RegionForwardingUsage extends Usage { + + private static final long serialVersionUID = -4255145869626427363L; + + private final List forwardingRules; + + RegionForwardingUsage(List forwardingRules) { + this.forwardingRules = ImmutableList.copyOf(forwardingRules); + } + + /** + * Returns a list of identities of region forwarding rules that are currently using the address. + */ + public List getForwardingRules() { + return forwardingRules; + } + + @Override + public List getUsers() { + return forwardingRules; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("forwardingRules", forwardingRules).toString(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof RegionForwardingUsage && baseEquals((RegionForwardingUsage) obj); + } + + @Override + public int hashCode() { + return Objects.hash(forwardingRules); + } + + @SuppressWarnings("unchecked") + static RegionForwardingUsage fromPb(Address addressPb) { + return new RegionForwardingUsage( + Lists.transform(addressPb.getUsers(), RegionForwardingRuleId.FROM_URL_FUNCTION)); + } + } + + /** + * Usage information for a Google Compute Engine global address assigned to one or more global + * forwarding rules. + */ + public static final class GlobalForwardingUsage extends Usage { + + private static final long serialVersionUID = -2974154224319117433L; + + private final List forwardingRules; + + GlobalForwardingUsage(List forwardingRules) { + this.forwardingRules = ImmutableList.copyOf(forwardingRules); + } + + /** + * Returns a list of identities of global forwarding rules that are currently using the address. + */ + public List getForwardingRules() { + return forwardingRules; + } + + @Override + public List getUsers() { + return forwardingRules; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("forwardingRules", forwardingRules).toString(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof GlobalForwardingUsage && baseEquals((GlobalForwardingUsage) obj); + } + + @Override + public int hashCode() { + return Objects.hash(forwardingRules); + } + + @SuppressWarnings("unchecked") + static GlobalForwardingUsage fromPb(Address addressPb) { + return new GlobalForwardingUsage( + Lists.transform(addressPb.getUsers(), GlobalForwardingRuleId.FROM_URL_FUNCTION)); + } + } + + /** + * A builder for {@code AddressInfo} objects. + */ + public abstract static class Builder { + + /** + * Sets the actual IP address. + */ + public abstract Builder setAddress(String address); + + abstract Builder setCreationTimestamp(Long creationTimestamp); + + /** + * Sets an optional textual description of the address. + */ + public abstract Builder setDescription(String description); + + abstract Builder setGeneratedId(String generatedId); + + public abstract Builder setAddressId(AddressId addressId); + + abstract Builder setStatus(Status status); + + abstract Builder setUsage(Usage usage); + + /** + * Creates an {@code AddressInfo} object. + */ + public abstract AddressInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String address; + private Long creationTimestamp; + private String description; + private String generatedId; + private AddressId addressId; + private Status status; + private Usage usage; + + BuilderImpl() {} + + BuilderImpl(AddressInfo addressInfo) { + this.address = addressInfo.address; + this.creationTimestamp = addressInfo.creationTimestamp; + this.description = addressInfo.description; + this.generatedId = addressInfo.generatedId; + this.addressId = addressInfo.addressId; + this.status = addressInfo.status; + this.usage = addressInfo.usage; + } + + BuilderImpl(Address addressPb) { + if (RegionAddressId.matchesUrl(addressPb.getSelfLink())) { + addressId = RegionAddressId.fromUrl(addressPb.getSelfLink()); + } else { + addressId = GlobalAddressId.fromUrl(addressPb.getSelfLink()); + } + address = addressPb.getAddress(); + if (addressPb.getCreationTimestamp() != null) { + creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(addressPb.getCreationTimestamp()); + } + description = addressPb.getDescription(); + if (addressPb.getId() != null) { + generatedId = addressPb.getId().toString(); + } + if (addressPb.getStatus() != null) { + status = Status.valueOf(addressPb.getStatus()); + } + if (addressPb.getUsers() != null && addressPb.getUsers().size() > 0) { + usage = Usage.fromPb(addressPb); + } + } + + @Override + public BuilderImpl setAddress(String address) { + this.address = address; + return this; + } + + @Override + BuilderImpl setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + public BuilderImpl setDescription(String description) { + this.description = description; + return this; + } + + @Override + BuilderImpl setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + public BuilderImpl setAddressId(AddressId addressId) { + this.addressId = checkNotNull(addressId); + return this; + } + + @Override + BuilderImpl setStatus(Status status) { + this.status = status; + return this; + } + + @Override + BuilderImpl setUsage(Usage usage) { + this.usage = usage; + return this; + } + + @Override + public AddressInfo build() { + return new AddressInfo(this); + } + } + + AddressInfo(BuilderImpl builder) { + address = builder.address; + creationTimestamp = builder.creationTimestamp; + description = builder.description; + generatedId = builder.generatedId; + addressId = checkNotNull(builder.addressId); + status = builder.status; + usage = builder.usage; + } + + /** + * Returns the static external IP address represented by this object. + */ + public String getAddress() { + return address; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns an optional textual description of the address. + */ + public String getDescription() { + return description; + } + + /** + * Returns the service-generated unique identifier for the address. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the address identity. Returns {@link GlobalAddressId} for a global address, returns + * {@link RegionAddressId} for a region address. + */ + @SuppressWarnings("unchecked") + public T getAddressId() { + return (T) addressId; + } + + /** + * Returns the status of the address. + */ + public Status getStatus() { + return status; + } + + /** + * Returns the usage information of the address. Returns an {@link InstanceUsage} object for + * region addresses that are assigned to VM instances. Returns a {@link RegionForwardingUsage} + * object for region addresses assigned to region forwarding rules. Returns a + * {@link GlobalForwardingUsage} object for global addresses assigned to global forwarding rules. + * Returns {@code null} if the address is not in use. + */ + @SuppressWarnings("unchecked") + public T getUsage() { + return (T) usage; + } + + /** + * Returns a builder for the {@code AddressInfo} object. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("address", address) + .add("creationTimestamp", creationTimestamp) + .add("description", description) + .add("generatedId", generatedId) + .add("addressId", addressId) + .add("status", status) + .add("usage", usage) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(address, creationTimestamp, description, generatedId, addressId, status, + usage); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(AddressInfo.class) + && Objects.equals(toPb(), ((AddressInfo) obj).toPb()); + } + + AddressInfo setProjectId(String projectId) { + if (getAddressId().getProject() != null) { + return this; + } + return toBuilder().setAddressId(addressId.setProjectId(projectId)).build(); + } + + Address toPb() { + Address addressPb = usage != null ? usage.toPb() : new Address(); + addressPb.setAddress(address); + if (creationTimestamp != null) { + addressPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + addressPb.setDescription(description); + if (generatedId != null) { + addressPb.setId(new BigInteger(generatedId)); + } + addressPb.setName(addressId.getAddress()); + if (addressId.getType() == AddressId.Type.REGION) { + addressPb.setRegion(this.getAddressId().getRegionId().getSelfLink()); + } + if (status != null) { + addressPb.setStatus(status.name()); + } + addressPb.setSelfLink(addressId.getSelfLink()); + return addressPb; + } + + /** + * Returns a builder for the {@code AddressInfo} object given it's identity. + */ + public static Builder newBuilder(AddressId addressId) { + return new BuilderImpl().setAddressId(addressId); + } + + /** + * Returns an {@code AddressInfo} object for the provided identity. + */ + public static AddressInfo of(AddressId addressId) { + return newBuilder(addressId).build(); + } + + /** + * Returns an {@code AddressInfo} object for the provided name. The object corresponds to a global + * address. + */ + public static AddressInfo of(String name) { + return of(GlobalAddressId.of(name)); + } + + /** + * Returns an {@code AddressInfo} object for the provided region identity and name. The object + * corresponds to a region address. + */ + public static AddressInfo of(RegionId regionId, String name) { + return of(RegionAddressId.of(regionId, name)); + } + + /** + * Returns an {@code AddressInfo} object for the provided region and address names. The object + * corresponds to a region address. + */ + public static AddressInfo of(String region, String name) { + return of(RegionAddressId.of(region, name)); + } + + static AddressInfo fromPb(Address addressPb) { + return new BuilderImpl(addressPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java new file mode 100644 index 000000000000..1909b3566435 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/AttachedDisk.java @@ -0,0 +1,926 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.AttachedDiskInitializeParams; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +/** + * A disk attached to a Google Compute Engine instance. To create a new disk to attach when an image + * is being created use {@link CreateDiskConfiguration}. To attach an existing persistent disk use + * {@link PersistentDiskConfiguration}. To attach a scratch disk use + * {@link ScratchDiskConfiguration}. + */ +public class AttachedDisk implements Serializable { + + static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public AttachedDisk apply( + com.google.api.services.compute.model.AttachedDisk pb) { + return AttachedDisk.fromPb(pb); + } + }; + static final Function + TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.AttachedDisk apply( + AttachedDisk attachedDisk) { + return attachedDisk.toPb(); + } + }; + private static final long serialVersionUID = 2969789134157943798L; + + private final String deviceName; + private final Integer index; + private final AttachedDiskConfiguration configuration; + private final List licenses; + + /** + * Base class for {@code AttachedDisk} configuration. Use {@link PersistentDiskConfiguration} to + * attach an existing persistent disk. Use {@link CreateDiskConfiguration} to create a boot + * persistent disk to attach to the instance. Use {@link ScratchDiskConfiguration} to attach a + * scratch disk. + */ + public abstract static class AttachedDiskConfiguration implements Serializable { + + private static final long serialVersionUID = 8813134841283115565L; + + private final Type type; + private final InterfaceType interfaceType; + private final Boolean boot; + private final Boolean autoDelete; + + /** + * Specifies the type of the attached disk. + */ + public enum Type { + /** + * A persistent disk attached to a VM instance. Such an attached disk must already exist or + * can be created along with the instance by using {@link CreateDiskConfiguration}. A + * persistent disk can be attached to other VM instances. + */ + PERSISTENT, + + /** + * A scratch disk is created with the VM instance it is attached to. Scratch disks are only + * available to their VM instance. + */ + SCRATCH + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either {@code SCSI} + * or {@code NVME}. Persistent disks must always use {@code SCSI}. Scratch SSDs can use either + * {@code NVME} or {@code SCSI}. + */ + public enum InterfaceType { + SCSI, + NVME + } + + AttachedDiskConfiguration(Type type, InterfaceType interfaceType, Boolean boot, + Boolean autoDelete) { + this.type = checkNotNull(type); + this.interfaceType = interfaceType; + this.boot = boot; + this.autoDelete = autoDelete; + } + + /** + * Returns the type of the attached disk. + */ + public Type getType() { + return type; + } + + /** + * Returns the interface to use to attach the disk. If not specified, {@link InterfaceType#SCSI} + * is used. + */ + public InterfaceType getInterfaceType() { + return interfaceType; + } + + /** + * Returns whether to use the attached disk as a boot disk. If {@code true} the virtual machine + * will use the first partition of the disk for its root filesystem. If not specified, the + * disk is not used as a boot disk. + */ + public Boolean boot() { + return boot; + } + + /** + * Returns whether the disk should auto-delete when the instance to which it's attached is + * deleted. If not specified, the disk is not deleted automatically. + */ + public Boolean autoDelete() { + return autoDelete; + } + + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this) + .add("type", type) + .add("interfaceType", interfaceType) + .add("boot", boot) + .add("autoDelete", autoDelete); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + final int baseHashCode() { + return Objects.hash(type, interfaceType); + } + + final boolean baseEquals(AttachedDiskConfiguration diskConfiguration) { + return Objects.equals(toPb(), diskConfiguration.toPb()); + } + + abstract AttachedDiskConfiguration setProjectId(String projectId); + + com.google.api.services.compute.model.AttachedDisk toPb() { + com.google.api.services.compute.model.AttachedDisk attachedDiskPb = + new com.google.api.services.compute.model.AttachedDisk(); + attachedDiskPb.setType(type.name()); + if (interfaceType != null) { + attachedDiskPb.setInterface(interfaceType.name()); + } + attachedDiskPb.setBoot(boot); + attachedDiskPb.setAutoDelete(autoDelete); + return attachedDiskPb; + } + + @SuppressWarnings("unchecked") + static T fromPb( + com.google.api.services.compute.model.AttachedDisk diskPb) { + switch (Type.valueOf(diskPb.getType())) { + case PERSISTENT: + if (diskPb.getSource() == null) { + return (T) CreateDiskConfiguration.fromPb(diskPb); + } else { + return (T) PersistentDiskConfiguration.fromPb(diskPb); + } + case SCRATCH: + return (T) ScratchDiskConfiguration.fromPb(diskPb); + default: + // should be unreachable + throw new IllegalArgumentException("Unrecognized attached disk type"); + } + } + } + + /** + * An attached disk configuration for existing persistent disks. + */ + public static final class PersistentDiskConfiguration extends AttachedDiskConfiguration { + + private static final long serialVersionUID = 6367613188140104726L; + + private final DiskId sourceDisk; + private final Mode mode; + + /** + * Specifies the mode in which to attach the disk. + */ + public enum Mode { + /** + * The instance can both read and write to the disk. + */ + READ_WRITE, + + /** + * The instance is only allowed to read the disk. + */ + READ_ONLY + } + + /** + * A builder for {@code PersistentDiskConfiguration} objects. + */ + public static final class Builder { + + private DiskId sourceDisk; + private Mode mode; + private Boolean boot; + private Boolean autoDelete; + + private Builder(DiskId sourceDisk) { + this.sourceDisk = checkNotNull(sourceDisk); + } + + private Builder(PersistentDiskConfiguration configuration) { + sourceDisk = configuration.sourceDisk; + mode = configuration.mode; + boot = configuration.boot(); + autoDelete = configuration.autoDelete(); + } + + /** + * Sets the identity of the persistent disk to be attached. + */ + public Builder setSourceDisk(DiskId sourceDisk) { + this.sourceDisk = checkNotNull(sourceDisk); + return this; + } + + /** + * Sets the mode in which to attach this disk. If not specified, the disk is attached in + * {@link Mode#READ_WRITE} mode. + */ + public Builder setMode(Mode mode) { + this.mode = mode; + return this; + } + + /** + * Sets whether to use the attached disk as a boot disk. If {@code true} the virtual machine + * instance will use the first partition of the disk for its root filesystem. If not + * specified, the isk is not used as a boot disk. + */ + public Builder setBoot(boolean boot) { + this.boot = boot; + return this; + } + + /** + * Sets whether the disk should auto-delete when the instance to which it's attached is + * deleted. If not specified, the disk is not deleted automatically. + */ + public Builder setAutoDelete(boolean autoDelete) { + this.autoDelete = autoDelete; + return this; + } + + /** + * Creates a {@code PersistentDiskConfiguration} object. + */ + public PersistentDiskConfiguration build() { + return new PersistentDiskConfiguration(this); + } + } + + private PersistentDiskConfiguration(Builder builder) { + super(Type.PERSISTENT, null, builder.boot, builder.autoDelete); + this.sourceDisk = builder.sourceDisk; + this.mode = builder.mode; + } + + /** + * Returns the identity of the persistent disk to be attached. + */ + public DiskId getSourceDisk() { + return sourceDisk; + } + + /** + * Returns the mode in which to attach this disk. If not specified, the disk is attached in + * {@link Mode#READ_WRITE} mode. + */ + public Mode getMode() { + return mode; + } + + /** + * Returns a builder for the current configuration. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("sourceDisk", sourceDisk).add("mode", mode); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), sourceDisk, mode); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(PersistentDiskConfiguration.class) + && baseEquals((PersistentDiskConfiguration) obj); + } + + @Override + PersistentDiskConfiguration setProjectId(String projectId) { + if (sourceDisk.getProject() != null) { + return this; + } + return toBuilder().setSourceDisk(sourceDisk.setProjectId(projectId)).build(); + } + + @Override + com.google.api.services.compute.model.AttachedDisk toPb() { + com.google.api.services.compute.model.AttachedDisk attachedDiskPb = super.toPb(); + attachedDiskPb.setSource(sourceDisk.getSelfLink()); + attachedDiskPb.setMode(mode != null ? mode.toString() : null); + return attachedDiskPb; + } + + /** + * Returns a builder for a {@code PersistentDiskConfiguration} object given the identity of the + * persistent disk to attach. + */ + public static Builder newBuilder(DiskId sourceDisk) { + return new Builder(sourceDisk); + } + + /** + * Returns a {@code PersistentDiskConfiguration} object given the identity of the persistent + * disk to attach. + */ + public static PersistentDiskConfiguration of(DiskId sourceDisk) { + return newBuilder(sourceDisk).build(); + } + + @SuppressWarnings("unchecked") + static PersistentDiskConfiguration fromPb( + com.google.api.services.compute.model.AttachedDisk diskPb) { + Builder builder = new Builder(DiskId.fromUrl(diskPb.getSource())); + if (diskPb.getMode() != null) { + builder.setMode(Mode.valueOf(diskPb.getMode())); + } + if (diskPb.getBoot() != null) { + builder.setBoot(diskPb.getBoot()); + } + if (diskPb.getAutoDelete() != null) { + builder.setAutoDelete(diskPb.getAutoDelete()); + } + return builder.build(); + } + } + + /** + * An attached disk configuration for bootable persistent disks that must be created with the + * instance they are attached to. Attached disks that use this configuration can only be attached + * to an instance upon creation. A {@code CreateDiskConfiguration} object is never returned by the + * service: after the instance is created the corresponding attached disk will be returned with a + * {@link PersistentDiskConfiguration}. + */ + public static final class CreateDiskConfiguration extends AttachedDiskConfiguration { + + private static final long serialVersionUID = 961995522284348824L; + + private final String diskName; + private final DiskTypeId diskType; + private final Long diskSizeGb; + private final ImageId sourceImage; + + /** + * A builder for {@code CreateDiskConfiguration} objects. + */ + public static final class Builder { + + private String diskName; + private DiskTypeId diskType; + private Long diskSizeGb; + private ImageId sourceImage; + private Boolean autoDelete; + + private Builder(ImageId sourceImage) { + this.sourceImage = checkNotNull(sourceImage); + } + + private Builder(CreateDiskConfiguration configuration) { + this.diskName = configuration.diskName; + this.diskType = configuration.diskType; + this.diskSizeGb = configuration.diskSizeGb; + this.sourceImage = configuration.sourceImage; + this.autoDelete = configuration.autoDelete(); + } + + /** + * Sets the name to be assigned to the disk. If not specified, the disk is given the + * instance's name. + */ + public Builder setDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Sets the identity of the disk type. If not specified, {@code pd-standard} is used. + */ + public Builder setDiskType(DiskTypeId diskType) { + this.diskType = diskType; + return this; + } + + /** + * Sets the size of the persistent disk, in GB. If not set the disk will have the size of the + * source image. This value can be larger than the image's size. If the provided size is + * smaller than the image's size, then instance creation will fail. + */ + public Builder setDiskSizeGb(Long diskSizeGb) { + this.diskSizeGb = diskSizeGb; + return this; + } + + /** + * Sets the identity of the source image used to create the disk. + */ + public Builder setSourceImage(ImageId sourceImage) { + this.sourceImage = checkNotNull(sourceImage); + return this; + } + + /** + * Sets whether the disk should auto-delete when the instance to which it's attached is + * deleted. If not specified, the disk is not deleted automatically. + */ + public Builder setAutoDelete(Boolean autoDelete) { + this.autoDelete = autoDelete; + return this; + } + + /** + * Creates a {@code CreateDiskConfiguration} object. + */ + public CreateDiskConfiguration build() { + return new CreateDiskConfiguration(this); + } + } + + private CreateDiskConfiguration(Builder builder) { + super(Type.PERSISTENT, null, true, builder.autoDelete); + this.diskName = builder.diskName; + this.diskType = builder.diskType; + this.diskSizeGb = builder.diskSizeGb; + this.sourceImage = builder.sourceImage; + } + + /** + * Returns the name to be assigned to the disk. If not specified, the disk is given the + * instance's name. + */ + public String getDiskName() { + return diskName; + } + + /** + * Returns the identity of the disk type. If not specified, {@code pd-standard} is used. + */ + public DiskTypeId getDiskType() { + return diskType; + } + + /** + * Returns the size of the persistent disk, in GB. If not set the disk will have the size of the + * source image. This value can be larger than the image's size. If the provided size is smaller + * than the image's size then instance creation will fail. + */ + public Long getDiskSizeGb() { + return diskSizeGb; + } + + /** + * Returns the identity of the source image used to create the disk. + */ + public ImageId getSourceImage() { + return sourceImage; + } + + /** + * Returns a builder for the current configuration. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("diskName", diskName) + .add("diskType", diskType) + .add("diskSizeGb", diskSizeGb) + .add("sourceImage", sourceImage); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), diskName, diskType, diskSizeGb, sourceImage); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(CreateDiskConfiguration.class) + && baseEquals((CreateDiskConfiguration) obj); + } + + @Override + CreateDiskConfiguration setProjectId(String projectId) { + Builder builder = toBuilder(); + if (builder.diskType != null) { + builder.setDiskType(diskType.setProjectId(projectId)); + } + if (builder.sourceImage != null) { + builder.setSourceImage(sourceImage.setProjectId(projectId)); + } + return builder.build(); + } + + @Override + com.google.api.services.compute.model.AttachedDisk toPb() { + AttachedDiskInitializeParams initializeParamsPb = new AttachedDiskInitializeParams(); + initializeParamsPb.setDiskName(diskName); + initializeParamsPb.setDiskSizeGb(diskSizeGb); + initializeParamsPb.setSourceImage(sourceImage.getSelfLink()); + if (diskType != null) { + initializeParamsPb.setDiskType(diskType.getSelfLink()); + } + com.google.api.services.compute.model.AttachedDisk attachedDiskPb = super.toPb(); + attachedDiskPb.setInitializeParams(initializeParamsPb); + return attachedDiskPb; + } + + /** + * Returns a builder for a {@code CreateDiskConfiguration} object given the source image that + * will be used to create the disk. + */ + public static Builder newBuilder(ImageId sourceImage) { + return new Builder(sourceImage); + } + + /** + * Returns a {@code CreateDiskConfiguration} object given the source image that will be used to + * create the disk. + */ + public static CreateDiskConfiguration of(ImageId sourceImage) { + return newBuilder(sourceImage).build(); + } + + @SuppressWarnings("unchecked") + static CreateDiskConfiguration fromPb( + com.google.api.services.compute.model.AttachedDisk diskPb) { + AttachedDiskInitializeParams initializeParamsPb = diskPb.getInitializeParams(); + Builder builder = newBuilder(ImageId.fromUrl(initializeParamsPb.getSourceImage())); + if (initializeParamsPb.getDiskType() != null) { + builder.setDiskType(DiskTypeId.fromUrl(initializeParamsPb.getDiskType())); + } + builder.setDiskName(initializeParamsPb.getDiskName()); + builder.setDiskSizeGb(initializeParamsPb.getDiskSizeGb()); + builder.setAutoDelete(diskPb.getAutoDelete()); + if (initializeParamsPb.getDiskType() != null) { + builder.setDiskType(DiskTypeId.fromUrl(initializeParamsPb.getDiskType())); + } + return builder.build(); + } + } + + /** + * An attached disk configuration for scratch disks. Attached disks that use this configuration + * can only be attached to an instance upon creation. + */ + public static final class ScratchDiskConfiguration extends AttachedDiskConfiguration { + + private static final long serialVersionUID = -8445453507234691254L; + + private final DiskTypeId diskType; + + /** + * A builder for {@code ScratchDiskConfiguration} objects. + */ + public static final class Builder { + + private DiskTypeId diskType; + private InterfaceType interfaceType; + + private Builder() {} + + private Builder(ScratchDiskConfiguration configuration) { + this.diskType = configuration.diskType; + this.interfaceType = configuration.getInterfaceType(); + } + + /** + * Sets the identity of the disk type for the scratch disk to attach. + */ + public Builder setDiskType(DiskTypeId diskType) { + this.diskType = diskType; + return this; + } + + /** + * Sets the interface type. If not specified, {@code SCSI} is used. + */ + public Builder setInterfaceType(InterfaceType interfaceType) { + this.interfaceType = interfaceType; + return this; + } + + /** + * Creates a {@code ScratchDiskConfiguration} object. + */ + public ScratchDiskConfiguration build() { + return new ScratchDiskConfiguration(this); + } + } + + private ScratchDiskConfiguration(Builder builder) { + super(Type.SCRATCH, builder.interfaceType, false, true); + this.diskType = builder.diskType; + } + + /** + * Returns the identity of the disk type for the scratch disk to attach. + */ + public DiskTypeId getDiskType() { + return diskType; + } + + /** + * Returns a builder for the current configuration. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("diskType", diskType); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode()); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(ScratchDiskConfiguration.class) + && baseEquals((ScratchDiskConfiguration) obj); + } + + @Override + ScratchDiskConfiguration setProjectId(String projectId) { + if (diskType.getProject() != null) { + return this; + } + return toBuilder().setDiskType(diskType.setProjectId(projectId)).build(); + } + + @Override + com.google.api.services.compute.model.AttachedDisk toPb() { + com.google.api.services.compute.model.AttachedDisk attachedDiskPb = super.toPb(); + if (diskType != null) { + AttachedDiskInitializeParams initializeParamsPb = new AttachedDiskInitializeParams(); + initializeParamsPb.setDiskType(diskType.getSelfLink()); + attachedDiskPb.setInitializeParams(initializeParamsPb); + } + return attachedDiskPb; + } + + /** + * Returns a builder for {@code ScratchDiskConfiguration} objects given the disk type identity. + */ + public static Builder newBuilder(DiskTypeId diskType) { + return new Builder().setDiskType(diskType); + } + + /** + * Returns a {@code ScratchDiskConfiguration} object given the disk type identity. The disk will + * be attached via the default interface ({@link InterfaceType#SCSI}). + */ + public static ScratchDiskConfiguration of(DiskTypeId diskType) { + return newBuilder(diskType).build(); + } + + @SuppressWarnings("unchecked") + static ScratchDiskConfiguration fromPb( + com.google.api.services.compute.model.AttachedDisk diskPb) { + Builder builder = new Builder(); + if (diskPb.getInterface() != null) { + builder.setInterfaceType(InterfaceType.valueOf(diskPb.getInterface())); + } + if (diskPb.getInitializeParams() != null + && diskPb.getInitializeParams().getDiskType() != null) { + builder.setDiskType(DiskTypeId.fromUrl(diskPb.getInitializeParams().getDiskType())); + } + return builder.build(); + } + } + + /** + * A builder for {@code AttachedDisk} objects. + */ + public static final class Builder { + + private String deviceName; + private Integer index; + private AttachedDiskConfiguration configuration; + private List licenses; + + Builder(AttachedDiskConfiguration configuration) { + this.configuration = checkNotNull(configuration); + } + + Builder(AttachedDisk attachedDisk) { + this.deviceName = attachedDisk.deviceName; + this.index = attachedDisk.index; + this.configuration = attachedDisk.configuration; + this.licenses = attachedDisk.licenses; + } + + /** + * Sets the unique device name of your choice that is reflected into the + * {@code /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 service chooses a default device name to + * apply to this disk, in the form {@code persistent-disks-x}, where x is a number assigned by + * Google Compute Engine. + */ + public Builder setDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Sets a zero-based index to this disk, where 0 is reserved for the boot disk. For example, + * if you have many disks attached to an instance, each disk would have an unique index number. + * If not specified, the service will choose an appropriate value. + */ + public Builder setIndex(Integer index) { + this.index = index; + return this; + } + + /** + * Sets the attached disk configuration. Use {@link ScratchDiskConfiguration} to attach a + * scratch disk to the instance. Use {@link PersistentDiskConfiguration} to attach a + * persistent disk to the instance. Use {@link CreateDiskConfiguration} to create and attach + * a new persistent disk. + */ + public Builder setConfiguration(AttachedDiskConfiguration configuration) { + this.configuration = checkNotNull(configuration); + return this; + } + + Builder setLicenses(List licenses) { + this.licenses = licenses; + return this; + } + + /** + * Creates an {@code AttachedDisk} object. + */ + public AttachedDisk build() { + return new AttachedDisk(this); + } + } + + private AttachedDisk(Builder builder) { + this.deviceName = builder.deviceName; + this.index = builder.index; + this.configuration = builder.configuration; + this.licenses = builder.licenses; + } + + /** + * Returns the unique device name of your choice that is reflected into the + * {@code /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 service chooses a default device name to + * apply to this disk, in the form {@code persistent-disks-x}, where x is a number assigned by + * Google Compute Engine. + */ + public String getDeviceName() { + return deviceName; + } + + /** + * Returns a zero-based index to this disk, where 0 is reserved for the boot disk. + */ + public Integer getIndex() { + return index; + } + + /** + * Returns the attached disk configuration. Returns {@link ScratchDiskConfiguration} to attach a + * scratch disk to the instance. Returns {@link PersistentDiskConfiguration} to attach a + * persistent disk to the instance. Returns {@link CreateDiskConfiguration} to create and attach + * a new persistent disk. + */ + @SuppressWarnings("unchecked") + public T getConfiguration() { + return (T) configuration; + } + + /** + * Returns a list of publicly accessible licenses for the attached disk. + */ + public List getLicenses() { + return licenses; + } + + /** + * Returns a builder for the current attached disk. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("deviceName", deviceName) + .add("index", index) + .add("configuration", configuration) + .add("licenses", licenses) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(deviceName, index, configuration, licenses); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(AttachedDisk.class) + && Objects.equals(toPb(), ((AttachedDisk) obj).toPb()); + } + + AttachedDisk setProjectId(String projectId) { + return toBuilder().setConfiguration(configuration.setProjectId(projectId)).build(); + } + + com.google.api.services.compute.model.AttachedDisk toPb() { + com.google.api.services.compute.model.AttachedDisk attachedDiskPb = configuration.toPb(); + attachedDiskPb.setDeviceName(deviceName); + attachedDiskPb.setIndex(index); + if (licenses != null) { + attachedDiskPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); + } + return attachedDiskPb; + } + + /** + * Returns a builder for an {@code AttachedDisk} object given its configuration. + */ + public static Builder newBuilder(AttachedDiskConfiguration configuration) { + return new Builder(configuration); + } + + /** + * Returns an {@code AttachedDisk} object given its configuration. + */ + public static AttachedDisk of(AttachedDiskConfiguration configuration) { + return newBuilder(configuration).build(); + } + + /** + * Returns an {@code AttachedDisk} object given the device name and its configuration. + */ + public static AttachedDisk of(String deviceName, AttachedDiskConfiguration configuration) { + return newBuilder(configuration).setDeviceName(deviceName).build(); + } + + static AttachedDisk fromPb(com.google.api.services.compute.model.AttachedDisk diskPb) { + AttachedDiskConfiguration configuration = AttachedDiskConfiguration.fromPb(diskPb); + Builder builder = newBuilder(configuration); + builder.setDeviceName(diskPb.getDeviceName()); + builder.setIndex(diskPb.getIndex()); + if (diskPb.getLicenses() != null) { + builder.setLicenses(Lists.transform(diskPb.getLicenses(), LicenseId.FROM_URL_FUNCTION)); + } + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java new file mode 100644 index 000000000000..51c9eae1389d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Compute.java @@ -0,0 +1,2709 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.FieldSelector; +import com.google.cloud.FieldSelector.Helper; +import com.google.api.gax.paging.Page; +import com.google.cloud.Service; +import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; +import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; +import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +/** + * An interface for Google Cloud Compute Engine. + * + * @see Google Cloud Compute Engine + */ +public interface Compute extends Service { + + /** + * Fields of a Compute Engine DiskType resource. + * + * @see Disk + * Type Resource + */ + enum DiskTypeField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DEFAULT_DISK_SIZE_GB("defaultDiskSizeGb"), + DESCRIPTION("description"), + ID("id"), + NAME("name"), + SELF_LINK("selfLink"), + VALID_DISK_SIZE("validDiskSize"), + ZONE("zone"), + DEPRECATED("deprecated"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + DiskTypeField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine MachineType resource. + * + * @see + * Machine Type Resource + */ + enum MachineTypeField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + GUEST_CPUS("guestCpus"), + ID("id"), + IMAGE_SPACE_GB("imageSpaceGb"), + MAXIMUM_PERSISTENT_DISKS("maximumPersistentDisks"), + MAXIMUM_PERSISTENT_DISKS_SIZE_GB("maximumPersistentDisksSizeGb"), + MEMORY_MB("memoryMb"), + NAME("name"), + SCRATCH_DISKS("scratchDisks"), + SELF_LINK("selfLink"), + ZONE("zone"), + DEPRECATED("deprecated"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + MachineTypeField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Region resource. + * + * @see + * Region Resource + */ + enum RegionField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + ID("id"), + NAME("name"), + QUOTAS("quotas"), + SELF_LINK("selfLink"), + STATUS("status"), + ZONES("zones"), + DEPRECATED("deprecated"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + RegionField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Zone resource. + * + * @see Zone + * Resource + */ + enum ZoneField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + ID("id"), + NAME("name"), + REGION("region"), + SELF_LINK("selfLink"), + STATUS("status"), + DEPRECATED("deprecated"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + ZoneField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine License resource. + * + * @see License + * Resource + */ + enum LicenseField implements FieldSelector { + CHARGES_USE_FEE("chargesUseFee"), + NAME("name"), + SELF_LINK("selfLink"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + LicenseField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Operation resource. + * + * @see + * GlobalOperation Resource + * @see + * RegionOperation Resource + * @see + * ZoneOperation Resource + */ + enum OperationField implements FieldSelector { + CLIENT_OPERATION_ID("clientOperationId"), + DESCRIPTION("description"), + END_TIME("endTime"), + ERROR("error"), + HTTP_ERROR_MESSAGE("httpErrorMessage"), + HTTP_ERROR_STATUS_CODE("httpErrorStatusCode"), + ID("id"), + INSERT_TIME("insertTime"), + NAME("name"), + OPERATION_TYPE("operationType"), + PROGRESS("progress"), + REGION("region"), + SELF_LINK("selfLink"), + START_TIME("startTime"), + STATUS("status"), + STATUS_MESSAGE("statusMessage"), + TARGET_ID("targetId"), + TARGET_LINK("targetLink"), + USER("user"), + WARNINGS("warnings"), + ZONE("zone"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + OperationField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Address resource. + * + * @see Region + * Address Resource + * @see + * Global Address Resource + */ + enum AddressField implements FieldSelector { + ADDRESS("address"), + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + ID("id"), + NAME("name"), + REGION("region"), + SELF_LINK("selfLink"), + STATUS("status"), + USERS("users"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + AddressField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Disk resource. + * + * @see Disk + * Resource + */ + enum DiskField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + ID("id"), + LAST_ATTACH_TIMESTAMP("lastAttachTimestamp"), + LAST_DETACH_TIMESTAMP("lastDetachTimestamp"), + LICENSES("licenses"), + NAME("name"), + OPTIONS("options"), + SELF_LINK("selfLink"), + SIZE_GB("sizeGb"), + SOURCE_IMAGE("sourceImage"), + SOURCE_IMAGE_ID("sourceImageId"), + SOURCE_SNAPSHOT("sourceSnapshot"), + SOURCE_SNAPSHOT_ID("sourceSnapshotId"), + STATUS("status"), + TYPE("type"), + USERS("users"), + ZONE("zone"); + + static final List REQUIRED_FIELDS = + ImmutableList.of(SELF_LINK, TYPE, SOURCE_IMAGE, SOURCE_SNAPSHOT); + + private final String selector; + + DiskField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Snapshot resource. + * + * @see + * Snapshot Resource + */ + enum SnapshotField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + DISK_SIZE_GB("diskSizeGb"), + ID("id"), + LICENSES("licenses"), + NAME("name"), + SELF_LINK("selfLink"), + SOURCE_DISK("sourceDisk"), + SOURCE_DISK_ID("sourceDiskId"), + STATUS("status"), + STORAGE_BYTES("storageBytes"), + STORAGE_BYTES_STATUS("storageBytesStatus"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + SnapshotField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Image resource. + * + * @see Image + * Resource + */ + enum ImageField implements FieldSelector { + ARCHIVE_SIZE_BYTES("archiveSizeBytes"), + CREATION_TIMESTAMP("creationTimestamp"), + DEPRECATED("deprecated"), + DESCRIPTION("description"), + DISK_SIZE_GB("diskSizeGb"), + ID("id"), + LICENSES("licenses"), + NAME("name"), + RAW_DISK("rawDisk"), + SELF_LINK("selfLink"), + SOURCE_DISK("sourceDisk"), + SOURCE_DISK_ID("sourceDiskId"), + SOURCE_TYPE("sourceType"); + + static final List REQUIRED_FIELDS = + ImmutableList.of(SELF_LINK, SOURCE_DISK, RAW_DISK); + + private final String selector; + + ImageField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Subnetwork resource. + * + * @see + * Subnetwork Resource + */ + enum SubnetworkField implements FieldSelector { + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + GATEWAY_ADDRESS("gatewayAddress"), + ID("id"), + IP_CIDR_RANGE("ipCidrRange"), + NAME("name"), + NETWORK("network"), + REGION("region"), + SELF_LINK("selfLink"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + SubnetworkField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Network resource. + * + * @see + * Network Resource + */ + enum NetworkField implements FieldSelector { + IPV4_RANGE("IPv4Range"), + AUTO_CREATE_SUBNETWORKS("autoCreateSubnetworks"), + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + GATEWAY_IPV4("gatewayIPv4"), + ID("id"), + NAME("name"), + SELF_LINK("selfLink"), + SUBNETWORKS("subnetworks"); + + static final List REQUIRED_FIELDS = + ImmutableList.of(SELF_LINK, IPV4_RANGE, AUTO_CREATE_SUBNETWORKS); + + private final String selector; + + NetworkField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Fields of a Compute Engine Instance resource. + * + * @see + * Network Resource + */ + enum InstanceField implements FieldSelector { + CAN_IP_FORWARD("canIpForward"), + CPU_PLATFORM("cpuPlatform"), + CREATION_TIMESTAMP("creationTimestamp"), + DESCRIPTION("description"), + DISKS("disks"), + ID("id"), + MACHINE_TYPE("machineType"), + METADATA("metadata"), + NAME("name"), + NETWORK_INTERFACES("networkInterfaces"), + SCHEDULING("scheduling"), + SELF_LINK("selfLink"), + SERVICE_ACCOUNTS("serviceAccounts"), + STATUS("status"), + STATUS_MESSAGE("statusMessage"), + TAGS("tags"), + ZONE("zone"); + + static final List REQUIRED_FIELDS = ImmutableList.of(SELF_LINK); + + private final String selector; + + InstanceField(String selector) { + this.selector = selector; + } + + @Override + public String getSelector() { + return selector; + } + } + + /** + * Base class for list filters. + */ + abstract class ListFilter implements Serializable { + + private static final long serialVersionUID = -238638392811165127L; + + private final String field; + private final ComparisonOperator operator; + private final Object value; + + enum ComparisonOperator { + /** + * Defines an equals filter. + */ + EQ, + + /** + * Defines a not-equals filter. + */ + NE + } + + ListFilter(String field, ComparisonOperator operator, Object value) { + this.field = field; + this.operator = operator; + this.value = value; + } + + @Override + public int hashCode() { + return Objects.hash(field, operator, value); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof ListFilter && toPb().equals(((ListFilter) obj).toPb()); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("field", field) + .add("operator", operator) + .add("value", value) + .toString(); + } + + String toPb() { + return field + ' ' + operator.name().toLowerCase() + ' ' + value.toString(); + } + } + + /** + * Class for filtering disk type lists. + */ + class DiskTypeFilter extends ListFilter { + + private static final long serialVersionUID = 4847837203592234453L; + + private DiskTypeFilter(DiskTypeField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static DiskTypeFilter equals(DiskTypeField field, String value) { + return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static DiskTypeFilter notEquals(DiskTypeField field, String value) { + return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns an equals filter for the given field and long value. + */ + public static DiskTypeFilter equals(DiskTypeField field, long value) { + return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and long value. + */ + public static DiskTypeFilter notEquals(DiskTypeField field, long value) { + return new DiskTypeFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering machine type lists. + */ + class MachineTypeFilter extends ListFilter { + + private static final long serialVersionUID = 7346062041571853235L; + + private MachineTypeFilter(MachineTypeField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static MachineTypeFilter equals(MachineTypeField field, String value) { + return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static MachineTypeFilter notEquals(MachineTypeField field, String value) { + return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns an equals filter for the given field and long value. + */ + public static MachineTypeFilter equals(MachineTypeField field, long value) { + return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and long value. + */ + public static MachineTypeFilter notEquals(MachineTypeField field, long value) { + return new MachineTypeFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering region lists. + */ + class RegionFilter extends ListFilter { + + private static final long serialVersionUID = 4464892812442567172L; + + private RegionFilter(RegionField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static RegionFilter equals(RegionField field, String value) { + return new RegionFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static RegionFilter notEquals(RegionField field, String value) { + return new RegionFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + } + + /** + * Class for filtering zone lists. + */ + class ZoneFilter extends ListFilter { + + private static final long serialVersionUID = -3927428278548808737L; + + private ZoneFilter(ZoneField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static ZoneFilter equals(ZoneField field, String value) { + return new ZoneFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static ZoneFilter notEquals(ZoneField field, String value) { + return new ZoneFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + } + + /** + * Class for filtering operation lists. + */ + class OperationFilter extends ListFilter { + + private static final long serialVersionUID = -3202249202748346427L; + + private OperationFilter(OperationField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static OperationFilter equals(OperationField field, String value) { + return new OperationFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static OperationFilter notEquals(OperationField field, String value) { + return new OperationFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns an equals filter for the given field and long value. + */ + public static OperationFilter equals(OperationField field, long value) { + return new OperationFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and long value. + */ + public static OperationFilter notEquals(OperationField field, long value) { + return new OperationFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering address lists. + */ + class AddressFilter extends ListFilter { + + private static final long serialVersionUID = -227481644259653765L; + + private AddressFilter(AddressField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static AddressFilter equals(AddressField field, String value) { + return new AddressFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static AddressFilter notEquals(AddressField field, String value) { + return new AddressFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + } + + /** + * Class for filtering snapshot lists. + */ + class SnapshotFilter extends ListFilter { + + private static final long serialVersionUID = 8757711630092406747L; + + private SnapshotFilter(SnapshotField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static SnapshotFilter equals(SnapshotField field, String value) { + return new SnapshotFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static SnapshotFilter notEquals(SnapshotField field, String value) { + return new SnapshotFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns an equals filter for the given field and long value. + */ + public static SnapshotFilter equals(SnapshotField field, long value) { + return new SnapshotFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and long value. + */ + public static SnapshotFilter notEquals(SnapshotField field, long value) { + return new SnapshotFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering image lists. + */ + class ImageFilter extends ListFilter { + + private static final long serialVersionUID = -3601427417234098397L; + + private ImageFilter(ImageField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static ImageFilter equals(ImageField field, String value) { + return new ImageFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static ImageFilter notEquals(ImageField field, String value) { + return new ImageFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns an equals filter for the given field and long value. + */ + public static ImageFilter equals(ImageField field, long value) { + return new ImageFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and long value. + */ + public static ImageFilter notEquals(ImageField field, long value) { + return new ImageFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering disk lists. + */ + class DiskFilter extends ListFilter { + + private static final long serialVersionUID = 5856790665396877913L; + + private DiskFilter(DiskField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static DiskFilter equals(DiskField field, String value) { + return new DiskFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static DiskFilter notEquals(DiskField field, String value) { + return new DiskFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns an equals filter for the given field and long value. + */ + public static DiskFilter equals(DiskField field, long value) { + return new DiskFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and long value. + */ + public static DiskFilter notEquals(DiskField field, long value) { + return new DiskFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering subnetwork lists. + */ + class SubnetworkFilter extends ListFilter { + + private static final long serialVersionUID = 979448583739105481L; + + private SubnetworkFilter(SubnetworkField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static SubnetworkFilter equals(SubnetworkField field, String value) { + return new SubnetworkFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static SubnetworkFilter notEquals(SubnetworkField field, String value) { + return new SubnetworkFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + } + + /** + * Class for filtering network lists. + */ + class NetworkFilter extends ListFilter { + + private static final long serialVersionUID = 7921406498804130930L; + + private NetworkFilter(NetworkField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static NetworkFilter equals(NetworkField field, String value) { + return new NetworkFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static NetworkFilter notEquals(NetworkField field, String value) { + return new NetworkFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns a equals filter for the given field and boolean value. + */ + public static NetworkFilter equals(NetworkField field, boolean value) { + return new NetworkFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and boolean value. + */ + public static NetworkFilter notEquals(NetworkField field, boolean value) { + return new NetworkFilter(checkNotNull(field), ComparisonOperator.NE, value); + } + } + + /** + * Class for filtering instance lists. + */ + class InstanceFilter extends ListFilter { + + private static final long serialVersionUID = 679008888882025686L; + + private InstanceFilter(InstanceField field, ComparisonOperator operator, Object value) { + super(field.getSelector(), operator, value); + } + + /** + * Returns an equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static InstanceFilter equals(InstanceField field, String value) { + return new InstanceFilter(checkNotNull(field), ComparisonOperator.EQ, checkNotNull(value)); + } + + /** + * Returns a not-equals filter for the given field and string value. For string fields, + * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must + * match the entire field. + * + * @see RE2 + */ + public static InstanceFilter notEquals(InstanceField field, String value) { + return new InstanceFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); + } + + /** + * Returns a equals filter for the given field and boolean value. + */ + public static InstanceFilter equals(InstanceField field, boolean value) { + return new InstanceFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + + /** + * Returns a not-equals filter for the given field and boolean value. + */ + public static InstanceFilter notEquals(InstanceField field, boolean value) { + return new InstanceFilter(checkNotNull(field), ComparisonOperator.EQ, value); + } + } + + /** + * Class for specifying disk type get options. + */ + class DiskTypeOption extends Option { + + private static final long serialVersionUID = 7349162455602991554L; + + private DiskTypeOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the disk type's fields to be returned by the RPC call. If this + * option is not provided, all disk type's fields are returned. {@code DiskTypeOption.fields} + * can be used to specify only the fields of interest. {@link DiskType#getDiskTypeId()} is always + * returned, even if not specified. + */ + public static DiskTypeOption fields(DiskTypeField... fields) { + return new DiskTypeOption(ComputeRpc.Option.FIELDS, + Helper.selector(DiskTypeField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying disk type list options. + */ + class DiskTypeListOption extends Option { + + private static final long serialVersionUID = 9051194230847610951L; + + private DiskTypeListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the disk types being listed. + */ + public static DiskTypeListOption filter(DiskTypeFilter filter) { + return new DiskTypeListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of disk types returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static DiskTypeListOption pageSize(long pageSize) { + return new DiskTypeListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing disk types. + */ + public static DiskTypeListOption pageToken(String pageToken) { + return new DiskTypeListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the disk type's fields to be returned by the RPC call. If this + * option is not provided, all disk type's fields are returned. + * {@code DiskTypeListOption.fields} can be used to specify only the fields of interest. + * {@link DiskType#getDiskTypeId()} is always returned, even if not specified. + */ + public static DiskTypeListOption fields(DiskTypeField... fields) { + return new DiskTypeListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", DiskTypeField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying disk type aggregated list options. + */ + class DiskTypeAggregatedListOption extends Option { + + private static final long serialVersionUID = 7611137483018305170L; + + private DiskTypeAggregatedListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the disk types being listed. + */ + public static DiskTypeAggregatedListOption filter(DiskTypeFilter filter) { + return new DiskTypeAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of disk types returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static DiskTypeAggregatedListOption pageSize(long pageSize) { + return new DiskTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing disk types. + */ + public static DiskTypeAggregatedListOption pageToken(String pageToken) { + return new DiskTypeAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + } + + /** + * Class for specifying machine type get options. + */ + class MachineTypeOption extends Option { + + private static final long serialVersionUID = 7349162455602991554L; + + private MachineTypeOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the machine type's fields to be returned by the RPC call. If + * this option is not provided, all machine type's fields are returned. + * {@code MachineTypeOption.fields} can be used to specify only the fields of interest. + * {@link MachineType#getMachineTypeId()} is always returned, even if not specified. + */ + public static MachineTypeOption fields(MachineTypeField... fields) { + return new MachineTypeOption(ComputeRpc.Option.FIELDS, + Helper.selector(MachineTypeField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying machine type list options. + */ + class MachineTypeListOption extends Option { + + private static final long serialVersionUID = -2974553049419897902L; + + private MachineTypeListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the machine types being listed. + */ + public static MachineTypeListOption filter(MachineTypeFilter filter) { + return new MachineTypeListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of machine types returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static MachineTypeListOption pageSize(long pageSize) { + return new MachineTypeListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing machine types. + */ + public static MachineTypeListOption pageToken(String pageToken) { + return new MachineTypeListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the machine type's fields to be returned by the RPC call. If + * this option is not provided, all machine type's fields are returned. + * {@code MachineTypeListOption.fields} can be used to specify only the fields of interest. + * {@link MachineType#getMachineTypeId()} is always returned, even if not specified. + */ + public static MachineTypeListOption fields(MachineTypeField... fields) { + return new MachineTypeListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", MachineTypeField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying machine type aggregated list options. + */ + class MachineTypeAggregatedListOption extends Option { + + private static final long serialVersionUID = 8492257475500296057L; + + private MachineTypeAggregatedListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the machine types being listed. + */ + public static MachineTypeAggregatedListOption filter(MachineTypeFilter filter) { + return new MachineTypeAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of machine types returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static MachineTypeAggregatedListOption pageSize(long pageSize) { + return new MachineTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing machine types. + */ + public static MachineTypeAggregatedListOption pageToken(String pageToken) { + return new MachineTypeAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + } + + /** + * Class for specifying region get options. + */ + class RegionOption extends Option { + + private static final long serialVersionUID = 2025084807788610826L; + + private RegionOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the region's fields to be returned by the RPC call. If this + * option is not provided, all region's fields are returned. {@code RegionOption.fields} can be + * used to specify only the fields of interest. {@link Region#getRegionId()} is always + * returned, even if not specified. + */ + public static RegionOption fields(RegionField... fields) { + return new RegionOption(ComputeRpc.Option.FIELDS, + Helper.selector(RegionField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying region list options. + */ + class RegionListOption extends Option { + + private static final long serialVersionUID = 3348089279267170211L; + + private RegionListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the regions being listed. + */ + public static RegionListOption filter(RegionFilter filter) { + return new RegionListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of regions returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static RegionListOption pageSize(long pageSize) { + return new RegionListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing regions. + */ + public static RegionListOption pageToken(String pageToken) { + return new RegionListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the region's fields to be returned by the RPC call. If this + * option is not provided, all region's fields are returned. {@code RegionListOption.fields} can + * be used to specify only the fields of interest. {@link Region#getRegionId()} is always + * returned, even if not specified. + */ + public static RegionListOption fields(RegionField... fields) { + return new RegionListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", RegionField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying zone get options. + */ + class ZoneOption extends Option { + + private static final long serialVersionUID = -2968652076389846258L; + + private ZoneOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the zone's fields to be returned by the RPC call. If this option + * is not provided, all zone's fields are returned. {@code ZoneOption.fields} can be used to + * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if + * not specified. + */ + public static ZoneOption fields(ZoneField... fields) { + return new ZoneOption(ComputeRpc.Option.FIELDS, + Helper.selector(ZoneField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying zone list options. + */ + class ZoneListOption extends Option { + + private static final long serialVersionUID = -4721971371200905764L; + + private ZoneListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the zones being listed. + */ + public static ZoneListOption filter(ZoneFilter filter) { + return new ZoneListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of zones returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static ZoneListOption pageSize(long pageSize) { + return new ZoneListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing zones. + */ + public static ZoneListOption pageToken(String pageToken) { + return new ZoneListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the zone's fields to be returned by the RPC call. If this option + * is not provided, all zone's fields are returned. {@code ZoneListOption.fields} can be used to + * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if + * not specified. + */ + public static ZoneListOption fields(ZoneField... fields) { + return new ZoneListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", ZoneField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying license get options. + */ + class LicenseOption extends Option { + + private static final long serialVersionUID = -2968652076389846258L; + + private LicenseOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the license's fields to be returned by the RPC call. If this + * option is not provided, all license's fields are returned. {@code LicenseOption.fields} can + * be used to specify only the fields of interest. {@link License#getLicenseId()} is always + * returned, even if not specified. + */ + public static LicenseOption fields(LicenseField... fields) { + return new LicenseOption(ComputeRpc.Option.FIELDS, + Helper.selector(LicenseField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying operation get options. + */ + class OperationOption extends Option { + + private static final long serialVersionUID = -4572636917684779912L; + + private OperationOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the operation's fields to be returned by the RPC call. If this + * option is not provided, all operation's fields are returned. {@code OperationOption.fields} + * can be used to specify only the fields of interest. {@link Operation#getOperationId()} is + * always returned, even if not specified. + */ + public static OperationOption fields(OperationField... fields) { + return new OperationOption(ComputeRpc.Option.FIELDS, + Helper.selector(OperationField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying operation list options. + */ + class OperationListOption extends Option { + + private static final long serialVersionUID = -1509532420587265823L; + + private OperationListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the operations being listed. + */ + public static OperationListOption filter(OperationFilter filter) { + return new OperationListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of operations returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static OperationListOption pageSize(long pageSize) { + return new OperationListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing operations. + */ + public static OperationListOption pageToken(String pageToken) { + return new OperationListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the operation's fields to be returned by the RPC call. If this + * option is not provided, all operation's fields are returned. + * {@code OperationListOption.fields} can be used to specify only the fields of interest. + * {@link Operation#getOperationId()} is always returned, even if not specified. + */ + public static OperationListOption fields(OperationField... fields) { + return new OperationListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", OperationField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying address get options. + */ + class AddressOption extends Option { + + private static final long serialVersionUID = -5755491818692494389L; + + private AddressOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the address' fields to be returned by the RPC call. If this + * option is not provided, all address' fields are returned. {@code AddressOption.fields} can be + * used to specify only the fields of interest. {@link Address#getAddressId()} is always + * returned, even if not specified. + */ + public static AddressOption fields(AddressField... fields) { + return new AddressOption(ComputeRpc.Option.FIELDS, + Helper.selector(AddressField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying address list options. + */ + class AddressListOption extends Option { + + private static final long serialVersionUID = -4281322966374929346L; + + private AddressListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the addresses being listed. + */ + public static AddressListOption filter(AddressFilter filter) { + return new AddressListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of addresses returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static AddressListOption pageSize(long pageSize) { + return new AddressListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing addresses. + */ + public static AddressListOption pageToken(String pageToken) { + return new AddressListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the address' fields to be returned by the RPC call. If this + * option is not provided, all address' fields are returned. {@code AddressListOption.fields} + * can be used to specify only the fields of interest. {@link Address#getAddressId()} is always + * returned, even if not specified. + */ + public static AddressListOption fields(AddressField... fields) { + return new AddressListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", AddressField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying address aggregated list options. + */ + class AddressAggregatedListOption extends Option { + + private static final long serialVersionUID = -95538941541279561L; + + private AddressAggregatedListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the addresses being listed. + */ + public static AddressAggregatedListOption filter(AddressFilter filter) { + return new AddressAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of addresses returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static AddressAggregatedListOption pageSize(long pageSize) { + return new AddressAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing addresses. + */ + public static AddressAggregatedListOption pageToken(String pageToken) { + return new AddressAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + } + + /** + * Class for specifying snapshot get options. + */ + class SnapshotOption extends Option { + + private static final long serialVersionUID = -3505179459035500945L; + + private SnapshotOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this + * option is not provided, all the snapshot's fields are returned. {@code SnapshotOption.fields} + * can be used to specify only the fields of interest. {@link Snapshot#getSnapshotId()} is always + * returned, even if not specified. + */ + public static SnapshotOption fields(SnapshotField... fields) { + return new SnapshotOption(ComputeRpc.Option.FIELDS, + Helper.selector(SnapshotField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying snapshot list options. + */ + class SnapshotListOption extends Option { + + private static final long serialVersionUID = 8278588147660831257L; + + private SnapshotListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the snapshots being listed. + */ + public static SnapshotListOption filter(SnapshotFilter filter) { + return new SnapshotListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of snapshots returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static SnapshotListOption pageSize(long pageSize) { + return new SnapshotListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing snapshots. + */ + public static SnapshotListOption pageToken(String pageToken) { + return new SnapshotListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this + * option is not provided, all the snapshot's fields are returned. + * {@code SnapshotListOption.fields} can be used to specify only the fields of interest. + * {@link Snapshot#getSnapshotId()} is always returned, even if not specified. + */ + public static SnapshotListOption fields(SnapshotField... fields) { + return new SnapshotListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", SnapshotField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying image get options. + */ + class ImageOption extends Option { + + private static final long serialVersionUID = -7622190783089299272L; + + private ImageOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the image's fields to be returned by the RPC call. If this + * option is not provided, all image's fields are returned. {@code ImageOption.fields} can be + * used to specify only the fields of interest. {@link Image#getImageId()} and + * {@link Image#getConfiguration()} are always returned, even if not specified. + */ + public static ImageOption fields(ImageField... fields) { + return new ImageOption(ComputeRpc.Option.FIELDS, + Helper.selector(ImageField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying image list options. + */ + class ImageListOption extends Option { + + private static final long serialVersionUID = -4927977224287915654L; + + private ImageListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the images being listed. + */ + public static ImageListOption filter(ImageFilter filter) { + return new ImageListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of images returned per page. {@code pageSize} + * must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static ImageListOption pageSize(long pageSize) { + return new ImageListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing images. + */ + public static ImageListOption pageToken(String pageToken) { + return new ImageListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the image's fields to be returned by the RPC call. If this + * option is not provided, all image's fields are returned. {@code ImageListOption.fields} can + * be used to specify only the fields of interest. {@link Image#getImageId()} and + * {@link Image#getConfiguration()} are always returned, even if not specified. + */ + public static ImageListOption fields(ImageField... fields) { + return new ImageListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", ImageField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying disk get options. + */ + class DiskOption extends Option { + + private static final long serialVersionUID = -4354796876226661667L; + + private DiskOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the disk's fields to be returned by the RPC call. If this option + * is not provided, all disk's fields are returned. {@code DiskOption.fields} can be used to + * specify only the fields of interest. {@link Disk#getDiskId()}, + * {@link DiskConfiguration#getDiskType()} and either + * {@link SnapshotDiskConfiguration#getSourceSnapshot()} or + * {@link ImageDiskConfiguration#getSourceImage()} are always returned, even if not specified. + */ + public static DiskOption fields(DiskField... fields) { + return new DiskOption(ComputeRpc.Option.FIELDS, + Helper.selector(DiskField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying disk list options. + */ + class DiskListOption extends Option { + + private static final long serialVersionUID = -5148497888688645905L; + + private DiskListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the disks being listed. + */ + public static DiskListOption filter(DiskFilter filter) { + return new DiskListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of disks returned per page. {@code pageSize} + * must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static DiskListOption pageSize(long pageSize) { + return new DiskListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing disks. + */ + public static DiskListOption pageToken(String pageToken) { + return new DiskListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the disk's fields to be returned by the RPC call. If this option + * is not provided, all disk's fields are returned. {@code DiskListOption.fields} can be used to + * specify only the fields of interest. {@link Disk#getDiskId()}, + * {@link DiskConfiguration#getDiskType()} and either + * {@link SnapshotDiskConfiguration#getSourceSnapshot()} or + * {@link ImageDiskConfiguration#getSourceImage()} are always returned, even if not specified. + */ + public static DiskListOption fields(DiskField... fields) { + return new DiskListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", DiskField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying disk aggregated list options. + */ + class DiskAggregatedListOption extends Option { + + private static final long serialVersionUID = 1163784797870242766L; + + private DiskAggregatedListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the disks being listed. + */ + public static DiskAggregatedListOption filter(DiskFilter filter) { + return new DiskAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of disks returned per page. {@code pageSize} + * must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static DiskAggregatedListOption pageSize(long pageSize) { + return new DiskAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing disks. + */ + public static DiskAggregatedListOption pageToken(String pageToken) { + return new DiskAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + } + + /** + * Class for specifying subnetwork get options. + */ + class SubnetworkOption extends Option { + + private static final long serialVersionUID = 1994416967962074717L; + + private SubnetworkOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this + * option is not provided, all subnetwork's fields are returned. {@code SubnetworkOption.fields} + * can be used to specify only the fields of interest. {@link Subnetwork#getSubnetworkId()} is + * always returned, even if not specified. + */ + public static SubnetworkOption fields(SubnetworkField... fields) { + return new SubnetworkOption(ComputeRpc.Option.FIELDS, + Helper.selector(SubnetworkField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying subnetwork list options. + */ + class SubnetworkListOption extends Option { + + private static final long serialVersionUID = -2978666213373829606L; + + private SubnetworkListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the subnetworks being listed. + */ + public static SubnetworkListOption filter(SubnetworkFilter filter) { + return new SubnetworkListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of subnetworks returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static SubnetworkListOption pageSize(long pageSize) { + return new SubnetworkListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing subnetworks. + */ + public static SubnetworkListOption pageToken(String pageToken) { + return new SubnetworkListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this + * option is not provided, all subnetwork's fields are returned. + * {@code SubnetworListkOption.fields} can be used to specify only the fields of interest. + * {@link Subnetwork#getSubnetworkId()} is always returned, even if not specified. + */ + public static SubnetworkListOption fields(SubnetworkField... fields) { + return new SubnetworkListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", SubnetworkField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying subnetwork aggregated list options. + */ + class SubnetworkAggregatedListOption extends Option { + + private static final long serialVersionUID = -4033514850525545027L; + + private SubnetworkAggregatedListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the subnetworks being listed. + */ + public static SubnetworkAggregatedListOption filter(SubnetworkFilter filter) { + return new SubnetworkAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of subnetworks returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static SubnetworkAggregatedListOption pageSize(long pageSize) { + return new SubnetworkAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing subnetworks. + */ + public static SubnetworkAggregatedListOption pageToken(String pageToken) { + return new SubnetworkAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + } + + /** + * Class for specifying network get options. + */ + class NetworkOption extends Option { + + private static final long serialVersionUID = 5346750551643875754L; + + private NetworkOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the network's fields to be returned by the RPC call. If this + * option is not provided, all network's fields are returned. {@code NetworkOption.fields} + * can be used to specify only the fields of interest. {@link Network#getNetworkId()} and + * {@link Network#getConfiguration()} are always returned, even if not specified. + */ + public static NetworkOption fields(NetworkField... fields) { + return new NetworkOption(ComputeRpc.Option.FIELDS, + Helper.selector(NetworkField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying network list options. + */ + class NetworkListOption extends Option { + + private static final long serialVersionUID = -4291731916527773896L; + + private NetworkListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the networks being listed. + */ + public static NetworkListOption filter(NetworkFilter filter) { + return new NetworkListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of networks returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static NetworkListOption pageSize(long pageSize) { + return new NetworkListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing networks. + */ + public static NetworkListOption pageToken(String pageToken) { + return new NetworkListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the network's fields to be returned by the RPC call. If this + * option is not provided, all network's fields are returned. {@code NetworkListOption.fields} + * can be used to specify only the fields of interest. {@link Network#getNetworkId()} and + * {@link Network#getConfiguration()} are always returned, even if not specified. + */ + public static NetworkListOption fields(NetworkField... fields) { + return new NetworkListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", NetworkField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying instance get options. + */ + class InstanceOption extends Option { + + private static final long serialVersionUID = -5277658025892081493L; + + private InstanceOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the instance's fields to be returned by the RPC call. If this + * option is not provided, all instance's fields are returned. {@code InstanceOption.fields} + * can be used to specify only the fields of interest. {@link Instance#getInstanceId()} is + * always returned, even if not specified. + */ + public static InstanceOption fields(InstanceField... fields) { + return new InstanceOption(ComputeRpc.Option.FIELDS, + Helper.selector(InstanceField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying instance list options. + */ + class InstanceListOption extends Option { + + private static final long serialVersionUID = -1096684312959047430L; + + private InstanceListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the instances being listed. + */ + public static InstanceListOption filter(InstanceFilter filter) { + return new InstanceListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of instances returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static InstanceListOption pageSize(long pageSize) { + return new InstanceListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing instances. + */ + public static InstanceListOption pageToken(String pageToken) { + return new InstanceListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to specify the instance's fields to be returned by the RPC call. If this + * option is not provided, all instance's fields are returned. {@code InstanceListOption.fields} + * can be used to specify only the fields of interest. {@link Instance#getInstanceId()} is + * always returned, even if not specified. + */ + public static InstanceListOption fields(InstanceField... fields) { + return new InstanceListOption(ComputeRpc.Option.FIELDS, + Helper.listSelector("items", InstanceField.REQUIRED_FIELDS, fields)); + } + } + + /** + * Class for specifying instance aggregated list options. + */ + class InstanceAggregatedListOption extends Option { + + private static final long serialVersionUID = -2020005298975967713L; + + private InstanceAggregatedListOption(ComputeRpc.Option option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a filter on the instances being listed. + */ + public static InstanceAggregatedListOption filter(InstanceFilter filter) { + return new InstanceAggregatedListOption(ComputeRpc.Option.FILTER, filter.toPb()); + } + + /** + * Returns an option to specify the maximum number of instances returned per page. + * {@code pageSize} must be between 0 and 500 (inclusive). If not specified 500 is used. + */ + public static InstanceAggregatedListOption pageSize(long pageSize) { + return new InstanceAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing instances. + */ + public static InstanceAggregatedListOption pageToken(String pageToken) { + return new InstanceAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); + } + } + + /** + * Returns the requested disk type or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + DiskType getDiskType(DiskTypeId diskTypeId, DiskTypeOption... options); + + /** + * Returns the requested disk type or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + DiskType getDiskType(String zone, String diskType, DiskTypeOption... options); + + /** + * Lists the disk types in the provided zone. + * + * @throws ComputeException upon failure + */ + Page listDiskTypes(String zone, DiskTypeListOption... options); + + /** + * Lists the disk types in all zones. + * + * @throws ComputeException upon failure + */ + Page listDiskTypes(DiskTypeAggregatedListOption... options); + + /** + * Returns the requested machine type or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + MachineType getMachineType(MachineTypeId machineTypeId, MachineTypeOption... options); + + /** + * Returns the requested machine type or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + MachineType getMachineType(String zone, String machineType, MachineTypeOption... options); + + /** + * Lists the machine types in the provided zone. + * + * @throws ComputeException upon failure + */ + Page listMachineTypes(String zone, MachineTypeListOption... options); + + /** + * Lists the machine types in all zones. + * + * @throws ComputeException upon failure + */ + Page listMachineTypes(MachineTypeAggregatedListOption... options); + + /** + * Returns the requested region or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Region getRegion(String region, RegionOption... options); + + /** + * Lists the regions. + * + * @throws ComputeException upon failure + */ + Page listRegions(RegionListOption... options); + + /** + * Returns the requested zone or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Zone getZone(String zone, ZoneOption... options); + + /** + * Lists the zones. + * + * @throws ComputeException upon failure + */ + Page listZones(ZoneListOption... options); + + /** + * Returns the requested license or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + License getLicense(String license, LicenseOption... options); + + /** + * Returns the requested license or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + License getLicense(LicenseId license, LicenseOption... options); + + /** + * Returns the requested operation or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Operation getOperation(OperationId operationId, OperationOption... options); + + /** + * Lists the global operations. + * + * @throws ComputeException upon failure + */ + Page listGlobalOperations(OperationListOption... options); + + /** + * Lists the operations for the provided region. These are operations that create/modify/delete + * resources that live in a region (e.g. subnetworks). + * + * @throws ComputeException upon failure + */ + Page listRegionOperations(String region, OperationListOption... options); + + /** + * Lists the operations for the provided zone. These are operations that create/modify/delete + * resources that live in a zone (e.g. instances). + * + * @throws ComputeException upon failure + */ + Page listZoneOperations(String zone, OperationListOption... options); + + /** + * Deletes the requested operation. Delete is only possible for operations that have completed + * their execution. Any attempt to delete a running operation will fail. + * + * @return {@code true} if operation was deleted, {@code false} if it was not found + * @throws ComputeException upon failure + */ + boolean deleteOperation(OperationId operation); + + /** + * Returns the requested address or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Address getAddress(AddressId addressId, AddressOption... options); + + /** + * Creates a new address. + * + * @return an operation for address' creation + * @throws ComputeException upon failure + */ + Operation create(AddressInfo address, OperationOption... options); + + /** + * Lists the global addresses. + * + * @throws ComputeException upon failure + */ + Page
listGlobalAddresses(AddressListOption... options); + + /** + * Lists the region addresses for the provided region. + * + * @throws ComputeException upon failure + */ + Page
listRegionAddresses(String region, AddressListOption... options); + + /** + * Lists both global and region addresses. + * + * @throws ComputeException upon failure + */ + Page
listAddresses(AddressAggregatedListOption... options); + + /** + * Deletes the requested address. + * + * @return an operation if the request was issued correctly, {@code null} if the address was not + * found + * @throws ComputeException upon failure + */ + Operation deleteAddress(AddressId addressId, OperationOption... options); + + /** + * Creates a new snapshot. + * + * @return a zone operation for snapshot creation + * @throws ComputeException upon failure + */ + Operation create(SnapshotInfo snapshot, OperationOption... options); + + /** + * Returns the requested snapshot or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Snapshot getSnapshot(String snapshot, SnapshotOption... options); + + /** + * Lists snapshots. + * + * @throws ComputeException upon failure + */ + Page listSnapshots(SnapshotListOption... options); + + /** + * Deletes the requested snapshot. Keep in mind that deleting a single snapshot might not + * necessarily delete all the data for that snapshot. If any data for the snapshot that is marked + * for deletion is needed for subsequent snapshots, the data will be moved to the next snapshot. + * + * @return a global operation if the request was issued correctly, {@code null} if the snapshot + * was not found + * @throws ComputeException upon failure + * @see + * Deleting a snapshot + */ + Operation deleteSnapshot(SnapshotId snapshot, OperationOption... options); + + /** + * Deletes the requested snapshot. Keep in mind that deleting a single snapshot might not + * necessarily delete all the data for 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 snapshot. + * + * @return a global operation if the request was issued correctly, {@code null} if the snapshot + * was not found + * @throws ComputeException upon failure + * @see + * Deleting a snapshot + */ + Operation deleteSnapshot(String snapshot, OperationOption... options); + + /** + * Creates a new image. + * + * @return a global operation for image's creation + * @throws ComputeException upon failure + */ + Operation create(ImageInfo image, OperationOption... options); + + /** + * Returns the requested image or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Image getImage(ImageId imageId, ImageOption... options); + + /** + * Lists images in the provided project that are available to the current user. This method can be + * used to list publicly-available images by providing the respective image project. Examples of + * image projects are: {@code centos-cloud}, {@code coreos-cloud}, {@code debian-cloud}, + * {@code opensuse-cloud}, {@code rhel-cloud}, {@code suse-cloud}, {@code ubuntu-os-cloud} and + * {@code windows-cloud}. Attempting to delete or deprecate a publicly-available image will fail. + * + * @throws ComputeException upon failure + * @see Operating Systems + */ + Page listImages(String project, ImageListOption... options); + + /** + * Lists images in the current project. + * + * @throws ComputeException upon failure + */ + Page listImages(ImageListOption... options); + + /** + * Deletes the requested image. + * + * @return a global operation if the delete request was issued correctly, {@code null} if the + * image was not found + * @throws ComputeException upon failure or if {@code image} is a publicly-available image + */ + Operation deleteImage(ImageId image, OperationOption... options); + + /** + * Deprecates the requested image. + * + * @return a global operation if the deprecation request was issued correctly, {@code null} if the + * image was not found + * @throws ComputeException upon failure or if {@code image} is a publicly-available image + */ + Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, + OperationOption... options); + + /** + * Returns the requested disk or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Disk getDisk(DiskId diskId, DiskOption... options); + + /** + * Creates a new disk. + * + * @return a zone operation for disk's creation + * @throws ComputeException upon failure + */ + Operation create(DiskInfo disk, OperationOption... options); + + /** + * Lists disks for the provided zone. + * + * @throws ComputeException upon failure + */ + Page listDisks(String zone, DiskListOption... options); + + /** + * Lists disks for all zones. + * + * @throws ComputeException upon failure + */ + Page listDisks(DiskAggregatedListOption... options); + + /** + * Deletes the requested disk. + * + * @return a zone operation if the request was issued correctly, {@code null} if the disk was not + * found + * @throws ComputeException upon failure + */ + Operation deleteDisk(DiskId disk, OperationOption... options); + + /** + * Resizes the disk to the requested size. The new size must be larger than the previous one. + * + * @return a zone operation if the request was issued correctly, {@code null} if the disk was not + * found + * @throws ComputeException upon failure or if the new disk size is smaller than the previous one + */ + Operation resize(DiskId disk, long sizeGb, OperationOption... options); + + /* + * Creates a new subnetwork. + * + * @return a region operation for subnetwork's creation + * @throws ComputeException upon failure + */ + Operation create(SubnetworkInfo subnetwork, OperationOption... options); + + /** + * Returns the requested subnetwork or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Subnetwork getSubnetwork(SubnetworkId subnetworkId, SubnetworkOption... options); + + /** + * Lists subnetworks for the provided region. + * + * @throws ComputeException upon failure + */ + Page listSubnetworks(String region, SubnetworkListOption... options); + + /** + * Lists subnetworks for all regions. + * + * @throws ComputeException upon failure + */ + Page listSubnetworks(SubnetworkAggregatedListOption... options); + + /** + * Deletes the requested subnetwork. Any attempt to delete an automatically created subnetwork + * will fail. + * + * @return a region operation if the delete request was issued correctly, {@code null} if the + * subnetwork was not found + * @throws ComputeException upon failure + */ + Operation deleteSubnetwork(SubnetworkId subnetwork, OperationOption... options); + + /** + * Creates a new network. + * + * @return a global operation for network's creation + * @throws ComputeException upon failure + */ + Operation create(NetworkInfo network, OperationOption... options); + + /** + * Returns the requested network or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Network getNetwork(String network, NetworkOption... options); + + /** + * Lists networks. + * + * @throws ComputeException upon failure + */ + Page listNetworks(NetworkListOption... options); + + /** + * Deletes the requested network. + * + * @return a global operation if the delete request was issued correctly, {@code null} if the + * network was not found + * @throws ComputeException upon failure + */ + Operation deleteNetwork(String network, OperationOption... options); + + /** + * Deletes the requested network. + * + * @return a global operation if the delete request was issued correctly, {@code null} if the + * network was not found + * @throws ComputeException upon failure + */ + Operation deleteNetwork(NetworkId network, OperationOption... options); + + /** + * Creates a new instance. + * + * @return a zone operation for instance's creation + * @throws ComputeException upon failure + */ + Operation create(InstanceInfo instance, OperationOption... options); + + /** + * Returns the requested instance or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Instance getInstance(InstanceId instance, InstanceOption... options); + + /** + * Lists instances for the provided zone. + * + * @throws ComputeException upon failure + */ + Page listInstances(String zone, InstanceListOption... options); + + /** + * Lists instances for all zones. + * + * @throws ComputeException upon failure + */ + Page listInstances(InstanceAggregatedListOption... options); + + /** + * Deletes the requested instance. + * + * @return a zone operation if the delete request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation deleteInstance(InstanceId instance, OperationOption... options); + + /** + * Adds an access configuration to an instance's network interface. + * + * @return a zone operation if the add request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation addAccessConfig(InstanceId instance, String networkInterface, AccessConfig accessConfig, + OperationOption... options); + + /** + * Attaches a persistent disk to an instance given its configuration. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation attachDisk(InstanceId instance, PersistentDiskConfiguration configuration, + OperationOption... options); + + /** + * Attaches a persistent disk to an instance given the device name and its configuration. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation attachDisk(InstanceId instance, String deviceName, + PersistentDiskConfiguration configuration, OperationOption... options); + + /** + * Attaches a persistent disk to an instance given the device name, its configuration and the + * device index. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation attachDisk(InstanceId instance, String deviceName, + PersistentDiskConfiguration configuration, int index, OperationOption... options); + + /** + * Deletes an access configuration from an instance's network interface. + * + * @return a zone operation if the delete request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation deleteAccessConfig(InstanceId instance, String networkInterface, String accessConfig, + OperationOption... options); + + /** + * Detaches a disk from an instance. + * + * @return a zone operation if the detach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation detachDisk(InstanceId instance, String deviceName, OperationOption... options); + + /** + * Returns the serial port output for the provided instance and port number. {@code port} must be + * between 1 and 4 (inclusive). + * + * @return the serial port output or {@code null} if the instance was not found + * @throws ComputeException upon failure + */ + String getSerialPortOutput(InstanceId instance, int port); + + /** + * Returns the default serial port output for the provided instance. Default serial port + * corresponds to port number 1. + * + * @return the serial port output or {@code null} if the instance was not found + * @throws ComputeException upon failure + */ + String getSerialPortOutput(InstanceId instance); + + /** + * Resets the provided instance. + * + * @return a zone operation if the reset request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation reset(InstanceId instance, OperationOption... options); + + /** + * Sets the auto-delete flag for a disk attached to the provided instance. + * + * @return a zone operation if the flag setting request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation setDiskAutoDelete(InstanceId instance, String deviceName, boolean autoDelete, + OperationOption... options); + + /** + * Sets the machine type for the provided instance. Instance must be in + * {@link InstanceInfo.Status#TERMINATED} state to be able to set its machine type. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setMachineType(InstanceId instance, MachineTypeId machineType, + OperationOption... options); + + /** + * Sets the metadata for the provided instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setMetadata(InstanceId instance, Metadata metadata, OperationOption... options); + + /** + * Sets the scheduling options for the provided instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setSchedulingOptions(InstanceId instance, SchedulingOptions scheduling, + OperationOption... options); + + /** + * Sets the tags for the provided instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setTags(InstanceId instance, Tags tags, OperationOption... options); + + /** + * Starts the provided instance. + * + * @return a zone operation if the start request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation start(InstanceId instance, OperationOption... options); + + /** + * Stops the provided instance. + * + * @return a zone operation if the stop request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation stop(InstanceId instance, OperationOption... options); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java new file mode 100644 index 000000000000..20ca52da6775 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeException.java @@ -0,0 +1,62 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.cloud.BaseServiceException; +import com.google.cloud.RetryHelper.RetryHelperException; +import com.google.cloud.http.BaseHttpServiceException; +import com.google.common.collect.ImmutableSet; +import java.io.IOException; +import java.util.Set; +import java.util.concurrent.ExecutionException; + +/** + * Compute Engine service exception. + */ +public class ComputeException extends BaseHttpServiceException { + + private static final Set RETRYABLE_ERRORS = ImmutableSet.of(new Error(500, null)); + private static final long serialVersionUID = -8039359778707845810L; + + ComputeException(int code, String message) { + super(code, message, null, true, RETRYABLE_ERRORS, null); + } + + ComputeException(int code, String message, Throwable cause) { + super(code, message, null, true, RETRYABLE_ERRORS, cause); + } + + public ComputeException(IOException exception) { + super(exception, true, RETRYABLE_ERRORS); + } + + /** + * Translate RetryHelperException to the ComputeException that caused the error. This method will + * always throw an exception. + * + * @throws ComputeException when {@code ex} was caused by a {@code ComputeException} + */ + static BaseServiceException translateAndThrow(RetryHelperException ex) { + BaseServiceException.translate(ex); + throw new ComputeException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); + } + + static BaseServiceException translateAndThrow(ExecutionException ex) { + BaseServiceException.translate(ex); + throw new ComputeException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java new file mode 100644 index 000000000000..8ebf55517745 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeFactory.java @@ -0,0 +1,25 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.cloud.ServiceFactory; + +/** + * An interface for Compute factories. + */ +public interface ComputeFactory extends ServiceFactory { +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java new file mode 100644 index 000000000000..8dfcdd5f5362 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeImpl.java @@ -0,0 +1,2058 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.cloud.RetryHelper.runWithRetries; +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.api.gax.paging.Page; +import com.google.cloud.BaseService; +import com.google.cloud.PageImpl; +import com.google.cloud.PageImpl.NextPageFetcher; +import com.google.cloud.RetryHelper; +import com.google.cloud.Tuple; +import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; +import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; +import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; +import com.google.common.base.Function; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.concurrent.Callable; + +final class ComputeImpl extends BaseService implements Compute { + + private static class GlobalOperationPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -2488912172182315364L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + GlobalOperationPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listGlobalOperations(serviceOptions, requestOptions); + } + } + + private static class DiskTypePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -5253916264932522976L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String zone; + + DiskTypePageFetcher(String zone, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.zone = zone; + } + + @Override + public Page getNextPage() { + return listDiskTypes(zone, serviceOptions, requestOptions); + } + } + + private static class AggregatedDiskTypePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -1664743503750307996L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + AggregatedDiskTypePageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listDiskTypes(serviceOptions, requestOptions); + } + } + + private static class MachineTypePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -5048133000517001933L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String zone; + + MachineTypePageFetcher(String zone, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.zone = zone; + } + + @Override + public Page getNextPage() { + return listMachineTypes(zone, serviceOptions, requestOptions); + } + } + + private static class AggregatedMachineTypePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 2919227789802660026L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + AggregatedMachineTypePageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listMachineTypes(serviceOptions, requestOptions); + } + } + + private static class RegionPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 4180147045485258863L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + RegionPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listRegions(serviceOptions, requestOptions); + } + } + + private static class ZonePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -3946202621600687597L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + ZonePageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listZones(serviceOptions, requestOptions); + } + } + + private static class RegionOperationPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 4111705358926164078L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String region; + + RegionOperationPageFetcher(String region, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.region = region; + } + + @Override + public Page getNextPage() { + return listRegionOperations(region, serviceOptions, requestOptions); + } + } + + private static class ZoneOperationPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -9012504536518197793L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String zone; + + ZoneOperationPageFetcher(String zone, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.zone = zone; + } + + @Override + public Page getNextPage() { + return listZoneOperations(zone, serviceOptions, requestOptions); + } + } + + private static class GlobalAddressPageFetcher implements NextPageFetcher
{ + + private static final long serialVersionUID = -3832055341507574454L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + GlobalAddressPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page
getNextPage() { + return listGlobalAddresses(serviceOptions, requestOptions); + } + } + + private static class RegionAddressPageFetcher implements NextPageFetcher
{ + + private static final long serialVersionUID = 7080596594494397027L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String region; + + RegionAddressPageFetcher(String region, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.region = region; + } + + @Override + public Page
getNextPage() { + return listRegionAddresses(region, serviceOptions, requestOptions); + } + } + + private static class AggregatedAddressPageFetcher implements NextPageFetcher
{ + + private static final long serialVersionUID = -5798942282919494950L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + AggregatedAddressPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page
getNextPage() { + return listAddresses(serviceOptions, requestOptions); + } + } + + private static class SnapshotPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 6205774609802216986L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + SnapshotPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listSnapshots(serviceOptions, requestOptions); + } + } + + private static class ImagePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 6403679803137922023L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String project; + + ImagePageFetcher(String project, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.project = project; + } + + @Override + public Page getNextPage() { + return listImages(project, serviceOptions, requestOptions); + } + } + + private static class DiskPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 4146589787872718476L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String zone; + + DiskPageFetcher(String zone, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.zone = zone; + } + + @Override + public Page getNextPage() { + return listDisks(zone, serviceOptions, requestOptions); + } + } + + private static class AggregatedDiskPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = -5240045334115926206L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + AggregatedDiskPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listDisks(serviceOptions, requestOptions); + } + } + + private static class SubnetworkPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 3674038457884412651L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String region; + + SubnetworkPageFetcher(String region, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.region = region; + } + + @Override + public Page getNextPage() { + return listSubnetworks(region, serviceOptions, requestOptions); + } + } + + private static class AggregatedSubnetworkPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 771343548833894551L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + AggregatedSubnetworkPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listSubnetworks(serviceOptions, requestOptions); + } + } + + private static class NetworkPageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 5580210850353114531L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + NetworkPageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listNetworks(serviceOptions, requestOptions); + } + } + + private static class InstancePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 7563769742657453865L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + private final String zone; + + InstancePageFetcher(String zone, ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + this.zone = zone; + } + + @Override + public Page getNextPage() { + return listInstances(zone, serviceOptions, requestOptions); + } + } + + private static class AggregatedInstancePageFetcher implements NextPageFetcher { + + private static final long serialVersionUID = 1863059389783095681L; + private final Map requestOptions; + private final ComputeOptions serviceOptions; + + AggregatedInstancePageFetcher(ComputeOptions serviceOptions, String cursor, + Map optionMap) { + this.requestOptions = + PageImpl.nextRequestOptions(ComputeRpc.Option.PAGE_TOKEN, cursor, optionMap); + this.serviceOptions = serviceOptions; + } + + @Override + public Page getNextPage() { + return listInstances(serviceOptions, requestOptions); + } + } + + private final ComputeRpc computeRpc; + + ComputeImpl(ComputeOptions options) { + super(options); + computeRpc = options.getComputeRpcV1(); + } + + @Override + public DiskType getDiskType(final DiskTypeId diskTypeId, DiskTypeOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.DiskType answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.DiskType call() { + return computeRpc.getDiskType(diskTypeId.getZone(), diskTypeId.getType(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : DiskType.fromPb(answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public DiskType getDiskType(String zone, String diskType, DiskTypeOption... options) { + return getDiskType(DiskTypeId.of(zone, diskType), options); + } + + @Override + public Page listDiskTypes(String zone, DiskTypeListOption... options) { + return listDiskTypes(zone, getOptions(), optionMap(options)); + } + + private static Page listDiskTypes(final String zone, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listDiskTypes(zone, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable diskTypes = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public DiskType apply(com.google.api.services.compute.model.DiskType diskType) { + return DiskType.fromPb(diskType); + } + }); + return new PageImpl<>(new DiskTypePageFetcher(zone, serviceOptions, cursor, optionsMap), + cursor, diskTypes); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listDiskTypes(DiskTypeAggregatedListOption... options) { + return listDiskTypes(getOptions(), optionMap(options)); + } + + private static Page listDiskTypes(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listDiskTypes(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable diskTypes = Iterables.transform(result.y(), + new Function() { + @Override + public DiskType apply(com.google.api.services.compute.model.DiskType diskType) { + return DiskType.fromPb(diskType); + } + }); + return new PageImpl<>(new AggregatedDiskTypePageFetcher(serviceOptions, cursor, optionsMap), + cursor, diskTypes); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public MachineType getMachineType(final MachineTypeId machineType, MachineTypeOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.MachineType answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.MachineType call() { + return computeRpc.getMachineType(machineType.getZone(), machineType.getType(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : MachineType.fromPb(answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public MachineType getMachineType(String zone, String machineType, MachineTypeOption... options) { + return getMachineType(MachineTypeId.of(zone, machineType), options); + } + + @Override + public Page listMachineTypes(String zone, MachineTypeListOption... options) { + return listMachineTypes(zone, getOptions(), optionMap(options)); + } + + private static Page listMachineTypes(final String zone, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listMachineTypes(zone, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable machineTypes = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public MachineType apply( + com.google.api.services.compute.model.MachineType machineType) { + return MachineType.fromPb(machineType); + } + }); + return new PageImpl<>(new MachineTypePageFetcher(zone, serviceOptions, cursor, optionsMap), + cursor, machineTypes); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listMachineTypes(MachineTypeAggregatedListOption... options) { + return listMachineTypes(getOptions(), optionMap(options)); + } + + private static Page listMachineTypes(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listMachineTypes(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable machineTypes = Iterables.transform(result.y(), + new Function() { + @Override + public MachineType apply( + com.google.api.services.compute.model.MachineType machineType) { + return MachineType.fromPb(machineType); + } + }); + return new PageImpl<>( + new AggregatedMachineTypePageFetcher(serviceOptions, cursor, optionsMap), cursor, + machineTypes); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Region getRegion(final String region, RegionOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Region answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Region call() { + return computeRpc.getRegion(region, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Region.fromPb(answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listRegions(RegionListOption... options) { + return listRegions(getOptions(), optionMap(options)); + } + + private static Page listRegions(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listRegions(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable regions = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public Region apply(com.google.api.services.compute.model.Region region) { + return Region.fromPb(region); + } + }); + return new PageImpl<>(new RegionPageFetcher(serviceOptions, cursor, optionsMap), cursor, + regions); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Zone getZone(final String zone, ZoneOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Zone answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Zone call() { + return computeRpc.getZone(zone, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Zone.fromPb(answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listZones(ZoneListOption... options) { + return listZones(getOptions(), optionMap(options)); + } + + private static Page listZones(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listZones(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable zones = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public Zone apply(com.google.api.services.compute.model.Zone zone) { + return Zone.fromPb(zone); + } + }); + return new PageImpl<>(new ZonePageFetcher(serviceOptions, cursor, optionsMap), cursor, zones); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public License getLicense(String license, LicenseOption... options) { + return getLicense(LicenseId.of(license), options); + } + + @Override + public License getLicense(LicenseId license, LicenseOption... options) { + final LicenseId completeId = license.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.License answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.License call() { + return computeRpc.getLicense(completeId.getProject(), completeId.getLicense(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : License.fromPb(answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation getOperation(final OperationId operationId, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + switch (operationId.getType()) { + case REGION: + RegionOperationId regionOperationId = (RegionOperationId) operationId; + return computeRpc.getRegionOperation(regionOperationId.getRegion(), + regionOperationId.getOperation(), optionsMap); + case ZONE: + ZoneOperationId zoneOperationId = (ZoneOperationId) operationId; + return computeRpc.getZoneOperation(zoneOperationId.getZone(), + zoneOperationId.getOperation(), optionsMap); + case GLOBAL: + return computeRpc.getGlobalOperation(operationId.getOperation(), optionsMap); + default: + throw new IllegalArgumentException("Unexpected operation identity type"); + } + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private static Function + operationFromPb(final ComputeOptions serviceOptions) { + return new Function() { + @Override + public Operation apply(com.google.api.services.compute.model.Operation operation) { + return Operation.fromPb(serviceOptions.getService(), operation); + } + }; + } + + @Override + public Page listGlobalOperations(OperationListOption... options) { + return listGlobalOperations(getOptions(), optionMap(options)); + } + + private static Page listGlobalOperations(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listGlobalOperations(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable operations = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), operationFromPb(serviceOptions)); + return new PageImpl<>(new GlobalOperationPageFetcher(serviceOptions, cursor, optionsMap), + cursor, operations); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listRegionOperations(String region, OperationListOption... options) { + return listRegionOperations(region, getOptions(), optionMap(options)); + } + + private static Page listRegionOperations(final String region, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listRegionOperations(region, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable operations = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), operationFromPb(serviceOptions)); + return new PageImpl<>(new RegionOperationPageFetcher(region, serviceOptions, cursor, + optionsMap), cursor, operations); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listZoneOperations(String zone, OperationListOption... options) { + return listZoneOperations(zone, getOptions(), optionMap(options)); + } + + private static Page listZoneOperations(final String zone, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listZoneOperations(zone, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable operations = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), operationFromPb(serviceOptions)); + return new PageImpl<>(new ZoneOperationPageFetcher(zone, serviceOptions, cursor, optionsMap), + cursor, operations); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public boolean deleteOperation(final OperationId operation) { + try { + return runWithRetries(new Callable() { + @Override + public Boolean call() { + switch (operation.getType()) { + case REGION: + RegionOperationId regionOperationId = (RegionOperationId) operation; + return computeRpc.deleteRegionOperation(regionOperationId.getRegion(), + regionOperationId.getOperation()); + case ZONE: + ZoneOperationId zoneOperationId = (ZoneOperationId) operation; + return computeRpc.deleteZoneOperation(zoneOperationId.getZone(), + zoneOperationId.getOperation()); + case GLOBAL: + return computeRpc.deleteGlobalOperation(operation.getOperation()); + default: + throw new IllegalArgumentException("Unexpected operation identity type"); + } + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Address getAddress(final AddressId addressId, AddressOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Address answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Address call() { + switch (addressId.getType()) { + case REGION: + RegionAddressId regionAddressId = (RegionAddressId) addressId; + return computeRpc.getRegionAddress(regionAddressId.getRegion(), + regionAddressId.getAddress(), optionsMap); + case GLOBAL: + return computeRpc.getGlobalAddress(addressId.getAddress(), optionsMap); + default: + throw new IllegalArgumentException("Unexpected address identity type"); + } + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Address.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation create(final AddressInfo address, OperationOption... options) { + final com.google.api.services.compute.model.Address addressPb = + address.setProjectId(getOptions().getProjectId()).toPb(); + final Map optionsMap = optionMap(options); + try { + return Operation.fromPb(this, + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + switch (address.getAddressId().getType()) { + case REGION: + RegionAddressId regionAddressId = address.getAddressId(); + return computeRpc.createRegionAddress(regionAddressId.getRegion(), addressPb, + optionsMap); + case GLOBAL: + return computeRpc.createGlobalAddress(addressPb, optionsMap); + default: + throw new IllegalArgumentException("Unexpected address identity type"); + } + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private static Function addressFromPb( + final ComputeOptions serviceOptions) { + return new Function() { + @Override + public Address apply(com.google.api.services.compute.model.Address address) { + return Address.fromPb(serviceOptions.getService(), address); + } + }; + } + + @Override + public Page
listGlobalAddresses(AddressListOption... options) { + return listGlobalAddresses(getOptions(), optionMap(options)); + } + + private static Page
listGlobalAddresses(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listGlobalAddresses(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable
operations = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), addressFromPb(serviceOptions)); + return new PageImpl<>(new GlobalAddressPageFetcher(serviceOptions, cursor, optionsMap), + cursor, operations); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page
listRegionAddresses(String region, AddressListOption... options) { + return listRegionAddresses(region, getOptions(), optionMap(options)); + } + + private static Page
listRegionAddresses(final String region, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listRegionAddresses(region, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable
operations = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), addressFromPb(serviceOptions)); + return new PageImpl<>(new RegionAddressPageFetcher(region, serviceOptions, cursor, + optionsMap), cursor, operations); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page
listAddresses(AddressAggregatedListOption... options) { + return listAddresses(getOptions(), optionMap(options)); + } + + private static Page
listAddresses(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listAddresses(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable
operations = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public Address apply(com.google.api.services.compute.model.Address address) { + return Address.fromPb(serviceOptions.getService(), address); + } + }); + return new PageImpl<>(new AggregatedAddressPageFetcher(serviceOptions, cursor, optionsMap), + cursor, operations); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteAddress(final AddressId addressId, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + switch (addressId.getType()) { + case REGION: + RegionAddressId regionAddressId = (RegionAddressId) addressId; + return computeRpc.deleteRegionAddress(regionAddressId.getRegion(), + regionAddressId.getAddress(), optionsMap); + case GLOBAL: + return computeRpc.deleteGlobalAddress(addressId.getAddress(), optionsMap); + default: + throw new IllegalArgumentException("Unexpected address identity type"); + } + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation create(SnapshotInfo snapshot, OperationOption... options) { + final SnapshotInfo completeSnapshot = snapshot.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.createSnapshot(completeSnapshot.getSourceDisk().getZone(), + completeSnapshot.getSourceDisk().getDisk(), + completeSnapshot.getSnapshotId().getSnapshot(), completeSnapshot.getDescription(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Snapshot getSnapshot(final String snapshot, SnapshotOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Snapshot answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Snapshot call() { + return computeRpc.getSnapshot(snapshot, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Snapshot.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listSnapshots(SnapshotListOption... options) { + return listSnapshots(getOptions(), optionMap(options)); + } + + private static Page listSnapshots(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listSnapshots(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable snapshots = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public Snapshot apply(com.google.api.services.compute.model.Snapshot snapshot) { + return Snapshot.fromPb(serviceOptions.getService(), snapshot); + } + }); + return new PageImpl<>(new SnapshotPageFetcher(serviceOptions, cursor, optionsMap), cursor, + snapshots); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteSnapshot(SnapshotId snapshot, OperationOption... options) { + return deleteSnapshot(snapshot.getSnapshot(), options); + } + + @Override + public Operation deleteSnapshot(final String snapshot, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteSnapshot(snapshot, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation create(ImageInfo image, OperationOption... options) { + final ImageInfo completeImage = image.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.createImage(completeImage.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Image getImage(ImageId imageId, ImageOption... options) { + final ImageId completeImageId = imageId.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Image answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Image call() { + return computeRpc.getImage(completeImageId.getProject(), completeImageId.getImage(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Image.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listImages(String project, ImageListOption... options) { + return listImages(project, getOptions(), optionMap(options)); + } + + @Override + public Page listImages(ImageListOption... options) { + return listImages(getOptions().getProjectId(), getOptions(), optionMap(options)); + } + + private static Page listImages(final String project, final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listImages(project, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable images = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public Image apply(com.google.api.services.compute.model.Image image) { + return Image.fromPb(serviceOptions.getService(), image); + } + }); + return new PageImpl<>(new ImagePageFetcher(project, serviceOptions, cursor, optionsMap), + cursor, images); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteImage(ImageId image, OperationOption... options) { + final ImageId completeId = image.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteImage(completeId.getProject(), completeId.getImage(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deprecate(ImageId image, + final DeprecationStatus deprecationStatus, OperationOption... options) { + final ImageId completeId = image.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deprecateImage(completeId.getProject(), completeId.getImage(), + deprecationStatus.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Disk getDisk(final DiskId diskId, DiskOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Disk answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Disk call() { + return computeRpc.getDisk(diskId.getZone(), diskId.getDisk(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Disk.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation create(final DiskInfo disk, OperationOption... options) { + final com.google.api.services.compute.model.Disk diskPb = + disk.setProjectId(getOptions().getProjectId()).toPb(); + final Map optionsMap = optionMap(options); + try { + return Operation.fromPb(this, + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.createDisk(disk.getDiskId().getZone(), diskPb, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private static Function diskFromPb( + final ComputeOptions serviceOptions) { + return new Function() { + @Override + public Disk apply(com.google.api.services.compute.model.Disk disk) { + return Disk.fromPb(serviceOptions.getService(), disk); + } + }; + } + + @Override + public Page listDisks(String zone, DiskListOption... options) { + return listDisks(zone, getOptions(), optionMap(options)); + } + + private static Page listDisks(final String zone, final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listDisks(zone, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable disks = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), diskFromPb(serviceOptions)); + return new PageImpl<>(new DiskPageFetcher(zone, serviceOptions, cursor, optionsMap), + cursor, disks); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listDisks(DiskAggregatedListOption... options) { + return listDisks(getOptions(), optionMap(options)); + } + + private static Page listDisks(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listDisks(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable disks = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), diskFromPb(serviceOptions)); + return new PageImpl<>(new AggregatedDiskPageFetcher(serviceOptions, cursor, optionsMap), + cursor, disks); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteDisk(final DiskId disk, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteDisk(disk.getZone(), disk.getDisk(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation resize(final DiskId disk, final long sizeGb, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.resizeDisk(disk.getZone(), disk.getDisk(), sizeGb, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation create(SubnetworkInfo subnetwork, OperationOption... options) { + final SubnetworkInfo completeSubnetwork = subnetwork.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.createSubnetwork(completeSubnetwork.getSubnetworkId().getRegion(), + completeSubnetwork.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Subnetwork getSubnetwork(final SubnetworkId subnetworkId, SubnetworkOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Subnetwork answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Subnetwork call() { + return computeRpc.getSubnetwork(subnetworkId.getRegion(), + subnetworkId.getSubnetwork(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Subnetwork.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private static Function + subnetworkFromPb(final ComputeOptions serviceOptions) { + return new Function() { + @Override + public Subnetwork apply(com.google.api.services.compute.model.Subnetwork subnetwork) { + return Subnetwork.fromPb(serviceOptions.getService(), subnetwork); + } + }; + } + + @Override + public Page listSubnetworks(String region, SubnetworkListOption... options) { + return listSubnetworks(region, getOptions(), optionMap(options)); + } + + private static Page listSubnetworks(final String region, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listSubnetworks(region, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable subnetworks = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), subnetworkFromPb(serviceOptions)); + return new PageImpl<>(new SubnetworkPageFetcher(region, serviceOptions, cursor, optionsMap), + cursor, subnetworks); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listSubnetworks(SubnetworkAggregatedListOption... options) { + return listSubnetworks(getOptions(), optionMap(options)); + } + + private static Page listSubnetworks(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listSubnetworks(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable subnetworks = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), subnetworkFromPb(serviceOptions)); + return new PageImpl<>(new AggregatedSubnetworkPageFetcher(serviceOptions, cursor, optionsMap), + cursor, subnetworks); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteSubnetwork(final SubnetworkId subnetwork, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteSubnetwork(subnetwork.getRegion(), subnetwork.getSubnetwork(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation create(NetworkInfo network, OperationOption... options) { + final NetworkInfo completeNetwork = network.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.createNetwork(completeNetwork.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Network getNetwork(final String network, NetworkOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Network answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Network call() { + return computeRpc.getNetwork(network, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Network.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listNetworks(NetworkListOption... options) { + return listNetworks(getOptions(), optionMap(options)); + } + + private static Page listNetworks(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listNetworks(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable networks = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), + new Function() { + @Override + public Network apply(com.google.api.services.compute.model.Network network) { + return Network.fromPb(serviceOptions.getService(), network); + } + }); + return new PageImpl<>(new NetworkPageFetcher(serviceOptions, cursor, optionsMap), + cursor, networks); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteNetwork(final NetworkId network, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteNetwork(network.getNetwork(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteNetwork(String network, OperationOption... options) { + return deleteNetwork(NetworkId.of(network)); + } + + @Override + public Operation create(InstanceInfo instance, OperationOption... options) { + final InstanceInfo completeInstance = instance.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.createInstance(completeInstance.getInstanceId().getZone(), + completeInstance.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Instance getInstance(final InstanceId instance, InstanceOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Instance answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Instance call() { + return computeRpc.getInstance(instance.getZone(), instance.getInstance(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Instance.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private static Function + instanceFromPb(final ComputeOptions serviceOptions) { + return new Function() { + @Override + public Instance apply(com.google.api.services.compute.model.Instance instance) { + return Instance.fromPb(serviceOptions.getService(), instance); + } + }; + } + + @Override + public Page listInstances(String zone, InstanceListOption... options) { + return listInstances(zone, getOptions(), optionMap(options)); + } + + private static Page listInstances(final String zone, + final ComputeOptions serviceOptions, final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listInstances(zone, optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable instances = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), instanceFromPb(serviceOptions)); + return new PageImpl<>(new InstancePageFetcher(zone, serviceOptions, cursor, optionsMap), + cursor, instances); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Page listInstances(InstanceAggregatedListOption... options) { + return listInstances(getOptions(), optionMap(options)); + } + + private static Page listInstances(final ComputeOptions serviceOptions, + final Map optionsMap) { + try { + Tuple> result = + runWithRetries(new Callable>>() { + @Override + public Tuple> call() { + return serviceOptions.getComputeRpcV1().listInstances(optionsMap); + } + }, serviceOptions.getRetrySettings(), EXCEPTION_HANDLER, serviceOptions.getClock()); + String cursor = result.x(); + Iterable instances = Iterables.transform( + result.y() == null ? ImmutableList.of() + : result.y(), instanceFromPb(serviceOptions)); + return new PageImpl<>(new AggregatedInstancePageFetcher(serviceOptions, cursor, optionsMap), + cursor, instances); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation deleteInstance(final InstanceId instance, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteInstance(instance.getZone(), instance.getInstance(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation addAccessConfig(final InstanceId instance, final String networkInterface, + final AccessConfig accessConfig, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.addAccessConfig(instance.getZone(), instance.getInstance(), + networkInterface, accessConfig.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private Operation attachDisk(final InstanceId instance, AttachedDisk diskToAttach, + OperationOption... options) { + final AttachedDisk completeDisk = diskToAttach.setProjectId(getOptions().getProjectId()); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.attachDisk(instance.getZone(), instance.getInstance(), + completeDisk.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation attachDisk(InstanceId instance, PersistentDiskConfiguration configuration, + OperationOption... options) { + return attachDisk(instance, AttachedDisk.of(configuration), options); + } + + @Override + public Operation attachDisk(InstanceId instance, String deviceName, + PersistentDiskConfiguration configuration, OperationOption... options) { + return attachDisk(instance, AttachedDisk.of(deviceName, configuration), options); + } + + @Override + public Operation attachDisk(InstanceId instance, String deviceName, + PersistentDiskConfiguration configuration, int index, OperationOption... options) { + AttachedDisk attachedDisk = AttachedDisk.newBuilder(configuration) + .setDeviceName(deviceName) + .setIndex(index) + .build(); + return attachDisk(instance, attachedDisk, options); + } + + @Override + public Operation deleteAccessConfig(final InstanceId instance, final String networkInterface, + final String accessConfig, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.deleteAccessConfig(instance.getZone(), instance.getInstance(), + networkInterface, accessConfig, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation detachDisk(final InstanceId instance, final String deviceName, + OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.detachDisk(instance.getZone(), instance.getInstance(), deviceName, + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public String getSerialPortOutput(final InstanceId instance, final int port) { + try { + return runWithRetries(new Callable() { + @Override + public String call() { + return computeRpc.getSerialPortOutput(instance.getZone(), instance.getInstance(), port, + optionMap()); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public String getSerialPortOutput(final InstanceId instance) { + try { + return runWithRetries(new Callable() { + @Override + public String call() { + return computeRpc.getSerialPortOutput(instance.getZone(), instance.getInstance(), null, + optionMap()); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation reset(final InstanceId instance, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.reset(instance.getZone(), instance.getInstance(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation setDiskAutoDelete(final InstanceId instance, final String deviceName, + final boolean autoDelete, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.setDiskAutoDelete(instance.getZone(), instance.getInstance(), + deviceName, autoDelete, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation setMachineType(final InstanceId instance, final MachineTypeId machineType, + OperationOption... options) { + final String machineTypeUrl = + machineType.setProjectId(getOptions().getProjectId()).getSelfLink(); + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.setMachineType(instance.getZone(), instance.getInstance(), + machineTypeUrl, optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation setMetadata(final InstanceId instance, final Metadata metadata, + OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.setMetadata(instance.getZone(), instance.getInstance(), + metadata.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation setSchedulingOptions(final InstanceId instance, + final SchedulingOptions schedulingOptions, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.setScheduling(instance.getZone(), instance.getInstance(), + schedulingOptions.toPb(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation setTags(final InstanceId instance, final Tags tags, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.setTags(instance.getZone(), instance.getInstance(), tags.toPb(), + optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation start(final InstanceId instance, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.start(instance.getZone(), instance.getInstance(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + @Override + public Operation stop(final InstanceId instance, OperationOption... options) { + final Map optionsMap = optionMap(options); + try { + com.google.api.services.compute.model.Operation answer = + runWithRetries(new Callable() { + @Override + public com.google.api.services.compute.model.Operation call() { + return computeRpc.stop(instance.getZone(), instance.getInstance(), optionsMap); + } + }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); + return answer == null ? null : Operation.fromPb(this, answer); + } catch (RetryHelper.RetryHelperException e) { + throw ComputeException.translateAndThrow(e); + } + } + + private Map optionMap(Option... options) { + Map optionMap = Maps.newEnumMap(ComputeRpc.Option.class); + for (Option option : options) { + Object prev = optionMap.put(option.getRpcOption(), option.getValue()); + checkArgument(prev == null, "Duplicate option %s", option); + } + return optionMap; + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java new file mode 100644 index 000000000000..a92389ef880d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ComputeOptions.java @@ -0,0 +1,145 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.cloud.http.HttpTransportOptions; +import com.google.cloud.ServiceDefaults; +import com.google.cloud.ServiceOptions; +import com.google.cloud.ServiceRpc; +import com.google.cloud.TransportOptions; +import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; +import com.google.cloud.compute.deprecated.spi.ComputeRpcFactory; +import com.google.cloud.compute.deprecated.spi.v1.HttpComputeRpc; +import com.google.common.collect.ImmutableSet; + +import java.util.Set; + +public class ComputeOptions extends ServiceOptions { + + private static final String API_SHORT_NAME = "Compute"; + private static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute"; + private static final Set SCOPES = ImmutableSet.of(COMPUTE_SCOPE); + private static final long serialVersionUID = 6983703596543425691L; + + public static class DefaultComputeFactory implements ComputeFactory { + + private static final ComputeFactory INSTANCE = new DefaultComputeFactory(); + + @Override + public Compute create(ComputeOptions options) { + return new ComputeImpl(options); + } + } + + public static class DefaultComputeRpcFactory implements ComputeRpcFactory { + + private static final ComputeRpcFactory INSTANCE = new DefaultComputeRpcFactory(); + + @Override + public ServiceRpc create(ComputeOptions options) { + return new HttpComputeRpc(options); + } + } + + public static class Builder extends + ServiceOptions.Builder { + + private Builder() { + } + + private Builder(ComputeOptions options) { + super(options); + } + + @Override + public Builder setTransportOptions(TransportOptions transportOptions) { + if (!(transportOptions instanceof HttpTransportOptions)) { + throw new IllegalArgumentException( + "Only http transport is allowed for " + API_SHORT_NAME + "."); + } + return super.setTransportOptions(transportOptions); + } + + @Override + public ComputeOptions build() { + return new ComputeOptions(this); + } + } + + private ComputeOptions(Builder builder) { + super(ComputeFactory.class, ComputeRpcFactory.class, builder, new ComputeDefaults()); + } + + private static class ComputeDefaults implements + ServiceDefaults { + + @Override + public ComputeFactory getDefaultServiceFactory() { + return DefaultComputeFactory.INSTANCE; + } + + @Override + public ComputeRpcFactory getDefaultRpcFactory() { + return DefaultComputeRpcFactory.INSTANCE; + } + + @Override + public TransportOptions getDefaultTransportOptions() { + return getDefaultHttpTransportOptions(); + } + } + + public static HttpTransportOptions getDefaultHttpTransportOptions() { + return HttpTransportOptions.newBuilder().build(); + } + + @Override + protected Set getScopes() { + return SCOPES; + } + + protected ComputeRpc getComputeRpcV1() { + return (ComputeRpc) getRpc(); + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ComputeOptions)) { + return false; + } + ComputeOptions other = (ComputeOptions) obj; + return baseEquals(other); + } + + public static ComputeOptions getDefaultInstance() { + return newBuilder().build(); + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java new file mode 100644 index 000000000000..aee07c7617d9 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DeprecationStatus.java @@ -0,0 +1,360 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.util.Objects; + +/** + * The deprecation status associated to a Google Compute Engine resource. + * + * @param The Google Compute Engine resource identity to which the deprecation status refers + */ +public final class DeprecationStatus implements Serializable { + + private static final long serialVersionUID = -2695077634793679794L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + private static final DateTimeFormatter TIMESTAMP_PARSER = ISODateTimeFormat.dateTimeParser(); + + private final String deleted; + private final String deprecated; + private final String obsolete; + private final T replacement; + private final Status status; + + /** + * The deprecation status of a Google Compute Engine resource. + */ + public enum Status { + /** + * Operations that create a Google Compute Engine entity using a deprecated resource will return + * successfully but with a warning indicating the deprecation and suggesting a replacement. + */ + DEPRECATED, + + /** + * Operations that create a Google Compute Engine entity using an obsolete resource will be + * rejected and result in an error. + */ + OBSOLETE, + + /** + * Operations that create a Google Compute Engine entity using a deleted resource will be + * rejected and result in an error. + */ + DELETED + } + + /** + * A builder for {@code DeprecationStatus} objects. + * + * @param The Google Compute Engine resource identity to which the deprecation status refers + */ + public static final class Builder { + + private String deleted; + private String deprecated; + private String obsolete; + private T replacement; + private Status status; + + Builder() {} + + Builder(DeprecationStatus deprecationStatus) { + this.deleted = deprecationStatus.deleted; + this.deprecated = deprecationStatus.deprecated; + this.obsolete = deprecationStatus.obsolete; + this.replacement = deprecationStatus.replacement; + this.status = deprecationStatus.status; + } + + /** + * Sets the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#DELETED}. Timestamp should be in RFC3339 format. + * + * @see RFC3339 + */ + // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) + Builder setDeleted(String deleted) { + this.deleted = deleted; + return this; + } + + /** + * Sets the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#DEPRECATED}. Timestamp should be in RFC3339 format. + * + * @see RFC3339 + */ + // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) + Builder setDeprecated(String deprecated) { + this.deprecated = deprecated; + return this; + } + + /** + * Sets the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#OBSOLETE}. Timestamp should be in RFC3339 format. + * + * @see RFC3339 + */ + // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) + Builder setObsolete(String obsolete) { + this.obsolete = obsolete; + return this; + } + + /** + * Sets the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#DELETED}. In milliseconds since epoch. + */ + public Builder setDeleted(long deleted) { + this.deleted = TIMESTAMP_FORMATTER.print(deleted); + return this; + } + + /** + * Sets the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#DEPRECATED}. In milliseconds since epoch. + */ + public Builder setDeprecated(long deprecated) { + this.deprecated = TIMESTAMP_FORMATTER.print(deprecated); + return this; + } + + /** + * Sets the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#OBSOLETE}. In milliseconds since epoch. + */ + public Builder setObsolete(long obsolete) { + this.obsolete = TIMESTAMP_FORMATTER.print(obsolete); + return this; + } + + /** + * Sets the identity of the suggested replacement for a deprecated resource. The suggested + * replacement resource must be the same kind of resource as the deprecated resource. + */ + public Builder setReplacement(T replacement) { + this.replacement = replacement; + return this; + } + + /** + * Sets the status of the deprecated resource. + */ + public Builder setStatus(Status status) { + this.status = checkNotNull(status); + return this; + } + + /** + * Creates a {@code DeprecationStatus} object. + */ + public DeprecationStatus build() { + return new DeprecationStatus(this); + } + } + + DeprecationStatus(Builder builder) { + this.deleted = builder.deleted; + this.deprecated = builder.deprecated; + this.obsolete = builder.obsolete; + this.replacement = builder.replacement; + this.status = checkNotNull(builder.status); + } + + /** + * Returns the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#DELETED}. Returns {@code null} if not set. This value should be in RFC3339 + * format. + * + * @see RFC3339 + */ + // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) + public String getDeleted() { + return deleted; + } + + /** + * Returns the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#DEPRECATED}. Returns {@code null} if not set. This value should be in RFC3339 + * format. + * + * @see RFC3339 + */ + // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) + public String getDeprecated() { + return deprecated; + } + + /** + * Returns the timestamp on or after which the deprecation state of this resource will be changed + * to {@link Status#OBSOLETE}. Returns {@code null} if not set. This value should be in RFC3339 + * format. + * + * @see RFC3339 + */ + // Wrongly-formatted timestamps were allowed, we must still support them (see #732 for details) + public String getObsolete() { + return obsolete; + } + + /** + * Returns the timestamp (in milliseconds since epoch) on or after which the deprecation state of + * this resource will be changed to {@link Status#DELETED}. Returns {@code null} if not set. + * + * @throws IllegalStateException if {@link #getDeleted()} is not a valid date, time or datetime + */ + public Long getDeletedMillis() { + try { + return deleted != null ? TIMESTAMP_PARSER.parseMillis(deleted) : null; + } catch (IllegalArgumentException ex) { + throw new IllegalStateException(ex.getMessage(), ex); + } + } + + /** + * Returns the timestamp (in milliseconds since epoch) on or after which the deprecation state of + * this resource will be changed to {@link Status#DEPRECATED}. Returns {@code null} if not set. + * + * @throws IllegalStateException if {@link #getDeprecated()} is not a valid date, time or datetime + */ + public Long getDeprecatedMillis() { + try { + return deprecated != null ? TIMESTAMP_PARSER.parseMillis(deprecated) : null; + } catch (IllegalArgumentException ex) { + throw new IllegalStateException(ex.getMessage(), ex); + } + } + + /** + * Returns the timestamp (in milliseconds since epoch) on or after which the deprecation state of + * this resource will be changed to {@link Status#OBSOLETE}. Returns {@code null} if not set. + * + * @throws IllegalStateException if {@link #getObsolete()} is not a valid date, time or datetime + */ + public Long getObsoleteMillis() { + try { + return obsolete != null ? TIMESTAMP_PARSER.parseMillis(obsolete) : null; + } catch (IllegalArgumentException ex) { + throw new IllegalStateException(ex.getMessage(), ex); + } + } + + /** + * Returns the identity of the suggested replacement for a deprecated resource. The suggested + * replacement resource must be the same kind of resource as the deprecated resource. + */ + public T getReplacement() { + return replacement; + } + + /** + * Returns the deprecation state of this resource. + */ + public Status getStatus() { + return status; + } + + /** + * Returns a builder for the {@code DeprecationStatus} object. + */ + public Builder toBuilder() { + return new Builder<>(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("deleted", deleted) + .add("deprecated", deprecated) + .add("obsolete", obsolete) + .add("replacement", replacement) + .add("status", status) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(deleted, deprecated, obsolete, replacement, status); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof DeprecationStatus + && Objects.equals(toPb(), ((DeprecationStatus) obj).toPb()); + } + + com.google.api.services.compute.model.DeprecationStatus toPb() { + com.google.api.services.compute.model.DeprecationStatus deprecationStatusPb = + new com.google.api.services.compute.model.DeprecationStatus(); + deprecationStatusPb.setDeleted(deleted); + deprecationStatusPb.setDeprecated(deprecated); + deprecationStatusPb.setObsolete(obsolete); + deprecationStatusPb.setReplacement(replacement.getSelfLink()); + deprecationStatusPb.setState(status.name()); + return deprecationStatusPb; + } + + /** + * Returns the builder for a {@code DeprecationStatus} object given the status. + */ + public static Builder newBuilder(Status status) { + return new Builder().setStatus(status); + } + + /** + * Returns the builder for a {@code DeprecationStatus} object given the status and replacement's + * identity. + */ + public static Builder newBuilder(Status status, T replacement) { + return new Builder().setStatus(status).setReplacement(replacement); + } + + /** + * Returns a {@code DeprecationStatus} object given the status and replacement's identity. + */ + public static DeprecationStatus of(Status status, T replacement) { + return newBuilder(status, replacement).build(); + } + + static DeprecationStatus fromPb( + com.google.api.services.compute.model.DeprecationStatus deprecationStatusPb, + Function fromUrl) { + Builder builder = new Builder<>(); + builder.setDeleted(deprecationStatusPb.getDeleted()); + builder.setDeprecated(deprecationStatusPb.getDeprecated()); + builder.setObsolete(deprecationStatusPb.getObsolete()); + if (deprecationStatusPb.getReplacement() != null) { + builder.setReplacement(fromUrl.apply(deprecationStatusPb.getReplacement())); + } + if (deprecationStatusPb.getState() != null) { + builder.setStatus(Status.valueOf(deprecationStatusPb.getState())); + } + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java new file mode 100644 index 000000000000..4a64422151c7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java @@ -0,0 +1,262 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.Compute.DiskOption; +import com.google.cloud.compute.deprecated.Compute.OperationOption; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine persistent disk. A disk can be used as primary storage for your virtual + * machine instances. Objects of this class are immutable. To get a {@code Disk} object with the + * most recent information use {@link #reload}. {@code Disk} adds a layer of service-related + * functionality over {@link DiskInfo}. + * + * @see Block Storage + */ +public class Disk extends DiskInfo { + + private static final long serialVersionUID = 7234747955588262204L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Disk} objects. + */ + public static class Builder extends DiskInfo.Builder { + + private final Compute compute; + private final DiskInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, DiskId diskId, DiskConfiguration diskConfiguration) { + this.compute = compute; + this.infoBuilder = new DiskInfo.BuilderImpl(diskId, diskConfiguration); + } + + Builder(Disk disk) { + this.compute = disk.compute; + this.infoBuilder = new DiskInfo.BuilderImpl(disk); + } + + @Override + Builder setGeneratedId(String generatedId) { + infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + public Builder setConfiguration(DiskConfiguration configuration) { + infoBuilder.setConfiguration(configuration); + return this; + } + + @Override + public Builder setDiskId(DiskId diskId) { + infoBuilder.setDiskId(diskId); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + infoBuilder.setCreationTimestamp(creationTimestamp); + return this; + } + + @Override + Builder setCreationStatus(CreationStatus creationStatus) { + infoBuilder.setCreationStatus(creationStatus); + return this; + } + + @Override + public Builder setDescription(String description) { + infoBuilder.setDescription(description); + return this; + } + + @Override + Builder setLicenses(List licenses) { + infoBuilder.setLicenses(licenses); + return this; + } + + @Override + Builder setAttachedInstances(List attachedInstances) { + infoBuilder.setAttachedInstances(attachedInstances); + return this; + } + + @Override + Builder setLastAttachTimestamp(Long lastAttachTimestamp) { + infoBuilder.setLastAttachTimestamp(lastAttachTimestamp); + return this; + } + + @Override + Builder setLastDetachTimestamp(Long lastDetachTimestamp) { + infoBuilder.setLastDetachTimestamp(lastDetachTimestamp); + return this; + } + + @Override + public Disk build() { + return new Disk(compute, infoBuilder); + } + } + + Disk(Compute compute, DiskInfo.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this disk exists. + * + * @return {@code true} if this disk exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(DiskOption.fields()) != null; + } + + /** + * Fetches current disk's latest information. Returns {@code null} if the disk does not exist. + * + * @param options disk options + * @return a {@code Disk} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Disk reload(DiskOption... options) { + return compute.getDisk(getDiskId(), options); + } + + /** + * Deletes this disk. + * + * @return a zone operation if the delete request was successfully sent, {@code null} if the disk + * was not found + * @throws ComputeException upon failure + */ + public Operation delete(OperationOption... options) { + return compute.deleteDisk(getDiskId(), options); + } + + /** + * Creates a snapshot for this disk given the snapshot's name. + * + * @return a zone operation for snapshot creation + * @throws ComputeException upon failure + */ + public Operation createSnapshot(String snapshot, OperationOption... options) { + return compute.create(SnapshotInfo.of(SnapshotId.of(snapshot), getDiskId()), options); + } + + /** + * Creates a snapshot for this disk given the snapshot's name and description. + * + * @return a zone operation for snapshot creation + * @throws ComputeException upon failure + */ + public Operation createSnapshot(String snapshot, String description, OperationOption... options) { + SnapshotInfo snapshotInfo = SnapshotInfo.newBuilder(SnapshotId.of(snapshot), getDiskId()) + .setDescription(description) + .build(); + return compute.create(snapshotInfo, options); + } + + /** + * Creates an image for this disk given the image's name. + * + * @return a global operation if the image creation was successfully requested + * @throws ComputeException upon failure + */ + public Operation createImage(String image, OperationOption... options) { + ImageInfo imageInfo = ImageInfo.of(ImageId.of(image), DiskImageConfiguration.of(getDiskId())); + return compute.create(imageInfo, options); + } + + /** + * Creates an image for this disk given the image's name and description. + * + * @return a global operation if the image creation was successfully requested + * @throws ComputeException upon failure + */ + public Operation createImage(String image, String description, OperationOption... options) { + ImageInfo imageInfo = + ImageInfo.newBuilder(ImageId.of(image), DiskImageConfiguration.of(getDiskId())) + .setDescription(description) + .build(); + return compute.create(imageInfo, options); + } + + /** + * Resizes this disk to the requested size. The new size must be larger than the previous one. + * + * @return a zone operation if the resize request was issued correctly, {@code null} if this disk + * was not found + * @throws ComputeException upon failure or if the new disk size is smaller than the previous one + */ + public Operation resize(long sizeGb, OperationOption... options) { + return compute.resize(getDiskId(), sizeGb, options); + } + + /** + * Returns the disk's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Disk.class)) { + return false; + } + Disk other = (Disk) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Disk fromPb(Compute compute, com.google.api.services.compute.model.Disk diskPb) { + return new Disk(compute, new DiskInfo.BuilderImpl(diskPb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java new file mode 100644 index 000000000000..0f08c7c7a1be --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskConfiguration.java @@ -0,0 +1,203 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.services.compute.model.Disk; +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Base class for Google Compute Engine disk configurations. A disk can be used as primary storage + * for your virtual machine instances. Use {@link StandardDiskConfiguration} to create a standard + * disk given a disk type and size. Use {@link ImageDiskConfiguration} to create a disk from a + * Compute Engine disk image. Use {@link SnapshotDiskConfiguration} to create a disk from a Compute + * Engine disk snapshot. + * + * @see Block Storage + */ +public abstract class DiskConfiguration implements Serializable { + + private static final long serialVersionUID = -1783061701255428417L; + + private final Type type; + private final Long sizeGb; + private final DiskTypeId diskType; + + /** + * Type of a Google Compute Engine disk configuration. + */ + public enum Type { + /** + * A Google Compute Engine standard disk configuration. + */ + STANDARD, + + /** + * A Google Compute Engine disk configuration that creates a disk from an image. + */ + IMAGE, + + /** + * A Google Compute Engine disk configuration that creates a disk from a snapshot. + */ + SNAPSHOT + } + + /** + * Base builder for disk configurations. + * + * @param the disk configuration type + * @param the disk configuration builder + */ + public abstract static class Builder> { + + private Type type; + private Long sizeGb; + private DiskTypeId diskType; + + Builder(Type type) { + this.type = type; + } + + Builder(DiskConfiguration diskConfiguration) { + this.type = diskConfiguration.type; + this.sizeGb = diskConfiguration.sizeGb; + this.diskType = diskConfiguration.diskType; + } + + Builder(Type type, Disk diskPb) { + this.type = type; + this.sizeGb = diskPb.getSizeGb(); + if (diskPb.getType() != null) { + this.diskType = DiskTypeId.fromUrl(diskPb.getType()); + } + } + + @SuppressWarnings("unchecked") + protected B self() { + return (B) this; + } + + B setType(Type type) { + this.type = type; + return self(); + } + + /** + * Sets the size of the persistent disk, in GB. + */ + public B setSizeGb(Long sizeGb) { + this.sizeGb = sizeGb; + return self(); + } + + /** + * Sets the identity of the disk type. If not set {@code pd-standard} will be used. + */ + public B setDiskType(DiskTypeId diskType) { + this.diskType = diskType; + return self(); + } + + /** + * Creates an object. + */ + public abstract T build(); + } + + DiskConfiguration(Builder builder) { + this.type = builder.type; + this.sizeGb = builder.sizeGb; + this.diskType = builder.diskType; + } + + /** + * Returns the disk configuration's type. This method returns {@link Type#STANDARD} for a standard + * configuration that creates a disk given its type and size. This method returns + * {@link Type#SNAPSHOT} for a configuration that creates a disk from a Google Compute Engine + * snapshot. This method returns {@link Type#IMAGE} for a configuration that creates a disk + * from a Google Compute Engine image. + */ + public Type getType() { + return type; + } + + /** + * Returns the size of the persistent disk, in GB. + */ + public Long getSizeGb() { + return sizeGb; + } + + /** + * Returns the identity of the disk type. + */ + public DiskTypeId getDiskType() { + return diskType; + } + + /** + * Returns a builder for the object. + */ + public abstract Builder toBuilder(); + + ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this) + .add("type", type) + .add("sizeGb", sizeGb) + .add("diskType", diskType); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + final int baseHashCode() { + return Objects.hash(type, sizeGb, diskType); + } + + final boolean baseEquals(DiskConfiguration diskConfiguration) { + return diskConfiguration != null + && getClass().equals(diskConfiguration.getClass()) + && Objects.equals(toPb(), diskConfiguration.toPb()); + } + + abstract DiskConfiguration setProjectId(String projectId); + + Disk toPb() { + Disk diskPb = new Disk(); + diskPb.setSizeGb(sizeGb); + if (diskType != null) { + diskPb.setType(diskType.getSelfLink()); + } + return diskPb; + } + + @SuppressWarnings("unchecked") + static T fromPb(Disk diskPb) { + if (diskPb.getSourceImage() != null) { + return (T) ImageDiskConfiguration.fromPb(diskPb); + } else if (diskPb.getSourceSnapshot() != null) { + return (T) SnapshotDiskConfiguration.fromPb(diskPb); + } + return (T) StandardDiskConfiguration.fromPb(diskPb); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java new file mode 100644 index 000000000000..b5e7004c0af0 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java @@ -0,0 +1,162 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine disk. + */ +public final class DiskId extends ResourceId { + + private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/disks/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -8761290740495870787L; + + private final String zone; + private final String disk; + + private DiskId(String project, String zone, String disk) { + super(project); + this.zone = checkNotNull(zone); + this.disk = checkNotNull(disk); + } + + /** + * Returns the name of the zone this disk belongs to. + */ + public String getZone() { + return zone; + } + + /** + * Returns the identity of the zone this disk belongs to. + */ + public ZoneId getZoneId() { + return ZoneId.of(getProject(), zone); + } + + /** + * Returns the name of the disk. The name must be 1-63 characters long and comply with RFC1035. + * Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} + * which means the first character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getDisk() { + return disk; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/zones/" + zone + "/disks/" + disk; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("zone", zone).add("disk", disk); + } + + @Override + public int hashCode() { + return Objects.hash(super.baseHashCode(), zone, disk); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof DiskId)) { + return false; + } + DiskId other = (DiskId) obj; + return baseEquals(other) + && Objects.equals(zone, other.zone) + && Objects.equals(disk, other.disk); + } + + @Override + DiskId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return DiskId.of(projectId, zone, disk); + } + + /** + * Returns a disk identity given the zone identity and the disk name. The disk name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static DiskId of(ZoneId zoneId, String disk) { + return new DiskId(zoneId.getProject(), zoneId.getZone(), disk); + } + + /** + * Returns a disk identity given the zone and disk names. The disk name must be 1-63 characters + * long and comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public static DiskId of(String zone, String disk) { + return new DiskId(null, zone, disk); + } + + /** + * Returns a disk identity given project, zone and disks names. The disk name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static DiskId of(String project, String zone, String disk) { + return new DiskId(project, zone, disk); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a disk URL. Returns + * {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static DiskId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid disk URL"); + } + return DiskId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java new file mode 100644 index 000000000000..764c7adf8c08 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskImageConfiguration.java @@ -0,0 +1,165 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Image; +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * A Google Compute Engine disk image configuration. This class can be used to create images from an + * existing Google Compute Engine disk. + */ +public class DiskImageConfiguration extends ImageConfiguration { + + private static final long serialVersionUID = 2716403667042981170L; + + private final DiskId sourceDisk; + private final String sourceDiskId; + + /** + * A builder for {@code DiskImageConfiguration} objects. + */ + public static final class Builder + extends ImageConfiguration.Builder { + + private DiskId sourceDisk; + private String sourceDiskId; + + private Builder() { + super(Type.DISK); + } + + private Builder(DiskImageConfiguration imageConfiguration) { + super(imageConfiguration); + this.sourceDisk = imageConfiguration.sourceDisk; + this.sourceDiskId = imageConfiguration.sourceDiskId; + } + + private Builder(Image imagePb) { + super(Type.DISK, imagePb); + this.sourceDisk = DiskId.fromUrl(imagePb.getSourceDisk()); + this.sourceDiskId = imagePb.getSourceDiskId(); + } + + /** + * Sets the identity of the source disk used to create the image. + */ + public Builder setSourceDisk(DiskId sourceDisk) { + this.sourceDisk = checkNotNull(sourceDisk); + return this; + } + + Builder setSourceDiskId(String sourceDiskId) { + this.sourceDiskId = sourceDiskId; + return this; + } + + /** + * Creates a {@code DiskImageConfiguration} object. + */ + @Override + public DiskImageConfiguration build() { + return new DiskImageConfiguration(this); + } + } + + private DiskImageConfiguration(Builder builder) { + super(builder); + this.sourceDisk = checkNotNull(builder.sourceDisk); + this.sourceDiskId = builder.sourceDiskId; + } + + /** + * Returns the identity of the source disk used to create this image. + */ + public DiskId getSourceDisk() { + return sourceDisk; + } + + /** + * Returns the service-generated unique id 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. + */ + public String getSourceDiskId() { + return sourceDiskId; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("sourceDisk", sourceDisk) + .add("sourceDiskId", sourceDiskId); + } + + @Override + public final int hashCode() { + return Objects.hash(baseHashCode(), sourceDisk, sourceDiskId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(DiskImageConfiguration.class) + && baseEquals((DiskImageConfiguration) obj); + } + + @Override + DiskImageConfiguration setProjectId(String projectId) { + if (sourceDisk.getProject() != null) { + return this; + } + return toBuilder().setSourceDisk(sourceDisk.setProjectId(projectId)).build(); + } + + @Override + Image toPb() { + Image imagePb = super.toPb(); + imagePb.setSourceDisk(sourceDisk.getSelfLink()); + imagePb.setSourceDiskId(sourceDiskId); + return imagePb; + } + + /** + * Creates a builder for a {@code DiskImageConfiguration} given the source disk identity. + */ + public static Builder newBuilder(DiskId sourceDisk) { + return new Builder().setSourceDisk(sourceDisk); + } + + /** + * Creates a {@code DiskImageConfiguration} object given the source disk identity. + */ + public static DiskImageConfiguration of(DiskId sourceId) { + return newBuilder(sourceId).build(); + } + + @SuppressWarnings("unchecked") + static DiskImageConfiguration fromPb(Image imagePb) { + return new Builder(imagePb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java new file mode 100644 index 000000000000..02748014cb88 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskInfo.java @@ -0,0 +1,443 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Disk; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine persistent disk. A disk can be used as primary storage for your virtual + * machine instances. + * + * @see Block Storage + */ +public class DiskInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public DiskInfo apply(Disk pb) { + return DiskInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Disk apply(DiskInfo diskType) { + return diskType.toPb(); + } + }; + + private static final long serialVersionUID = -7173418340679279619L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final DiskId diskId; + private final DiskConfiguration configuration; + private final Long creationTimestamp; + private final CreationStatus creationStatus; + private final String description; + private final List licenses; + private final List attachedInstances; + private final Long lastAttachTimestamp; + private final Long lastDetachTimestamp; + + /** + * The status of disk creation. + */ + public enum CreationStatus { + /** + * The disk is being created. + */ + CREATING, + + /** + * Disk creation failed. + */ + FAILED, + + /** + * The disk has been created and is ready to use. + */ + READY, + + /** + * The disk is being restored. + */ + RESTORING + } + + /** + * Builder for {@code DiskInfo} objects. + */ + public abstract static class Builder { + + abstract Builder setGeneratedId(String generatedId); + + /** + * Sets the disk configuration. + */ + public abstract Builder setConfiguration(DiskConfiguration configuration); + + /** + * Sets the disk identity. + */ + public abstract Builder setDiskId(DiskId diskId); + + abstract Builder setCreationTimestamp(Long creationTimestamp); + + abstract Builder setCreationStatus(CreationStatus creationStatus); + + /** + * Sets an optional textual description of the resource. + */ + public abstract Builder setDescription(String description); + + abstract Builder setLicenses(List licenses); + + abstract Builder setAttachedInstances(List attachedInstances); + + abstract Builder setLastAttachTimestamp(Long lastAttachTimestamp); + + abstract Builder setLastDetachTimestamp(Long lastDetachTimestamp); + + /** + * Creates a {@code DiskInfo} object. + */ + public abstract DiskInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String generatedId; + private DiskId diskId; + private DiskConfiguration configuration; + private Long creationTimestamp; + private CreationStatus creationStatus; + private String description; + private List licenses; + private List attachedInstances; + private Long lastAttachTimestamp; + private Long lastDetachTimestamp; + + BuilderImpl(DiskId diskId, DiskConfiguration configuration) { + this.diskId = checkNotNull(diskId); + this.configuration = checkNotNull(configuration); + } + + BuilderImpl(DiskInfo diskInfo) { + this.generatedId = diskInfo.generatedId; + this.configuration = diskInfo.configuration; + this.creationTimestamp = diskInfo.creationTimestamp; + this.creationStatus = diskInfo.creationStatus; + this.diskId = diskInfo.diskId; + this.description = diskInfo.description; + this.licenses = diskInfo.licenses; + this.attachedInstances = diskInfo.attachedInstances; + this.lastAttachTimestamp = diskInfo.lastAttachTimestamp; + this.lastDetachTimestamp = diskInfo.lastDetachTimestamp; + } + + BuilderImpl(Disk diskPb) { + if (diskPb.getId() != null) { + this.generatedId = diskPb.getId().toString(); + } + this.configuration = DiskConfiguration.fromPb(diskPb); + if (diskPb.getCreationTimestamp() != null) { + this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(diskPb.getCreationTimestamp()); + } + if (diskPb.getStatus() != null) { + this.creationStatus = CreationStatus.valueOf(diskPb.getStatus()); + } + this.diskId = DiskId.fromUrl(diskPb.getSelfLink()); + this.description = diskPb.getDescription(); + if (diskPb.getLicenses() != null) { + this.licenses = Lists.transform(diskPb.getLicenses(), LicenseId.FROM_URL_FUNCTION); + } + if (diskPb.getUsers() != null) { + this.attachedInstances = Lists.transform(diskPb.getUsers(), InstanceId.FROM_URL_FUNCTION); + } + if (diskPb.getLastAttachTimestamp() != null) { + this.lastAttachTimestamp = TIMESTAMP_FORMATTER.parseMillis(diskPb.getLastAttachTimestamp()); + } + if (diskPb.getLastDetachTimestamp() != null) { + this.lastDetachTimestamp = TIMESTAMP_FORMATTER.parseMillis(diskPb.getLastDetachTimestamp()); + } + } + + @Override + BuilderImpl setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + public BuilderImpl setConfiguration(DiskConfiguration configuration) { + this.configuration = checkNotNull(configuration); + return this; + } + + @Override + public BuilderImpl setDiskId(DiskId diskId) { + this.diskId = checkNotNull(diskId); + return this; + } + + @Override + BuilderImpl setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + BuilderImpl setCreationStatus(CreationStatus creationStatus) { + this.creationStatus = creationStatus; + return this; + } + + @Override + public BuilderImpl setDescription(String description) { + this.description = description; + return this; + } + + @Override + BuilderImpl setLicenses(List licenses) { + this.licenses = licenses != null ? ImmutableList.copyOf(licenses) : null; + return this; + } + + @Override + BuilderImpl setAttachedInstances(List attachedInstances) { + this.attachedInstances = + attachedInstances != null ? ImmutableList.copyOf(attachedInstances) : null; + return this; + } + + @Override + BuilderImpl setLastAttachTimestamp(Long lastAttachTimestamp) { + this.lastAttachTimestamp = lastAttachTimestamp; + return this; + } + + @Override + BuilderImpl setLastDetachTimestamp(Long lastDetachTimestamp) { + this.lastDetachTimestamp = lastDetachTimestamp; + return this; + } + + @Override + public DiskInfo build() { + return new DiskInfo(this); + } + } + + DiskInfo(BuilderImpl builder) { + this.generatedId = builder.generatedId; + this.configuration = builder.configuration; + this.creationTimestamp = builder.creationTimestamp; + this.creationStatus = builder.creationStatus; + this.diskId = builder.diskId; + this.description = builder.description; + this.licenses = builder.licenses; + this.attachedInstances = builder.attachedInstances; + this.lastAttachTimestamp = builder.lastAttachTimestamp; + this.lastDetachTimestamp = builder.lastDetachTimestamp; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns the service-generated unique identifier for the disk. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the disk configuration. + */ + @SuppressWarnings("unchecked") + public T getConfiguration() { + return (T) configuration; + } + + /** + * Returns the disk identity. + */ + public DiskId getDiskId() { + return diskId; + } + + /** + * Returns the creation status of the disk. + */ + public CreationStatus getCreationStatus() { + return creationStatus; + } + + /** + * Returns a textual description of the disk. + */ + public String getDescription() { + return description; + } + + /** + * Returns all applicable publicly visible licenses for the disk. + */ + public List getLicenses() { + return licenses; + } + + /** + * Returns all the identities of the instances this disk is attached to. + */ + public List getAttachedInstances() { + return attachedInstances; + } + + /** + * Returns the last attach timestamp in milliseconds since epoch. + */ + public Long getLastAttachTimestamp() { + return lastAttachTimestamp; + } + + /** + * Returns the last detach timestamp in milliseconds since epoch. + */ + public Long getLastDetachTimestamp() { + return lastDetachTimestamp; + } + + /** + * Returns a builder for the object. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("diskId", diskId) + .add("configuration", configuration) + .add("creationTimestamp", creationTimestamp) + .add("creationStatus", creationStatus) + .add("description", description) + .add("licenses", licenses) + .add("attachedInstances", attachedInstances) + .add("lastAttachTimestamp", lastAttachTimestamp) + .add("lastDetachTimestamp", lastDetachTimestamp) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(diskId, configuration, creationTimestamp, creationStatus, description, + licenses, attachedInstances, lastAttachTimestamp, lastDetachTimestamp); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(DiskInfo.class) + && Objects.equals(toPb(), ((DiskInfo) obj).toPb()); + } + + /** + * Returns a builder for a {@code DiskInfo} object given its identity and configuration. Use + * {@link StandardDiskConfiguration} to create a simple disk given its type and size. Use + * {@link SnapshotDiskConfiguration} to create a disk from a snapshot. Use + * {@link ImageDiskConfiguration} to create a disk from a disk image. + */ + public static Builder newBuilder(DiskId diskId, DiskConfiguration configuration) { + return new BuilderImpl(diskId, configuration); + } + + /** + * Returns a {@code DiskInfo} object given its identity and configuration. Use + * {@link StandardDiskConfiguration} to create a simple disk given its type and size. Use + * {@link SnapshotDiskConfiguration} to create a disk from a snapshot. Use + * {@link ImageDiskConfiguration} to create a disk from a disk image. + */ + public static DiskInfo of(DiskId diskId, DiskConfiguration configuration) { + return newBuilder(diskId, configuration).build(); + } + + DiskInfo setProjectId(String projectId) { + return toBuilder() + .setDiskId(diskId.setProjectId(projectId)) + .setConfiguration(configuration.setProjectId(projectId)) + .build(); + } + + Disk toPb() { + Disk diskPb = configuration.toPb(); + if (generatedId != null) { + diskPb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + diskPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + diskPb.setZone(diskId.getZoneId().getSelfLink()); + if (creationStatus != null) { + diskPb.setStatus(creationStatus.toString()); + } + diskPb.setName(diskId.getDisk()); + diskPb.setDescription(description); + diskPb.setSelfLink(diskId.getSelfLink()); + if (licenses != null) { + diskPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); + } + if (attachedInstances != null) { + diskPb.setUsers(Lists.transform(attachedInstances, InstanceId.TO_URL_FUNCTION)); + } + if (lastAttachTimestamp != null) { + diskPb.setLastAttachTimestamp(TIMESTAMP_FORMATTER.print(lastAttachTimestamp)); + } + if (lastDetachTimestamp != null) { + diskPb.setLastDetachTimestamp(TIMESTAMP_FORMATTER.print(lastDetachTimestamp)); + } + return diskPb; + } + + static DiskInfo fromPb(Disk diskPb) { + return new BuilderImpl(diskPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java new file mode 100644 index 000000000000..413326d3e5d1 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskType.java @@ -0,0 +1,244 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Objects; + +/** + * A Google Compute Engine disk type. A disk type represents the type of disk to use, such as + * {@code pd-ssd} or {@code pd-standard}. + * + * @see Disk Types + */ +public class DiskType implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public DiskType apply(com.google.api.services.compute.model.DiskType pb) { + return DiskType.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.DiskType apply(DiskType diskType) { + return diskType.toPb(); + } + }; + + private static final long serialVersionUID = -944042261695072026L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final DiskTypeId diskTypeId; + private final Long creationTimestamp; + private final String description; + private final String validDiskSize; + private final Long defaultDiskSizeGb; + private final DeprecationStatus deprecationStatus; + + static final class Builder { + + private String generatedId; + private DiskTypeId diskTypeId; + private Long creationTimestamp; + private String description; + private String validDiskSize; + private Long defaultDiskSizeGb; + private DeprecationStatus deprecationStatus; + + private Builder() {} + + Builder setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + Builder setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + Builder setDiskTypeId(DiskTypeId diskTypeId) { + this.diskTypeId = diskTypeId; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Builder setValidDiskSize(String validDiskSize) { + this.validDiskSize = validDiskSize; + return this; + } + + Builder setDefaultDiskSizeGb(Long defaultDiskSizeGb) { + this.defaultDiskSizeGb = defaultDiskSizeGb; + return this; + } + + Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { + this.deprecationStatus = deprecationStatus; + return this; + } + + DiskType build() { + return new DiskType(this); + } + } + + private DiskType(Builder builder) { + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.diskTypeId = builder.diskTypeId; + this.description = builder.description; + this.validDiskSize = builder.validDiskSize; + this.defaultDiskSizeGb = builder.defaultDiskSizeGb; + this.deprecationStatus = builder.deprecationStatus; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns the disk type's identity. + */ + public DiskTypeId getDiskTypeId() { + return diskTypeId; + } + + /** + * Returns the service-generated unique identifier for the disk type. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns a textual description of the disk type. + */ + public String getDescription() { + return description; + } + + /** + * Returns an optional textual description of the valid disk size, such as "10GB-10TB". + */ + public String getValidDiskSize() { + return validDiskSize; + } + + /** + * Returns the service-defined default disk size in GB. + */ + public Long getDefaultDiskSizeGb() { + return defaultDiskSizeGb; + } + + /** + * Returns the deprecation status of the disk type. If {@link DeprecationStatus#getStatus()} is + * either {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} + * the disk type should not be used. Returns {@code null} if the disk type is not deprecated. + */ + public DeprecationStatus getDeprecationStatus() { + return deprecationStatus; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("description", description) + .add("validDiskSize", validDiskSize) + .add("defaultDiskSizeGb", defaultDiskSizeGb) + .add("deprecationStatus", deprecationStatus) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(diskTypeId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(DiskType.class) + && Objects.equals(toPb(), ((DiskType) obj).toPb()); + } + + com.google.api.services.compute.model.DiskType toPb() { + com.google.api.services.compute.model.DiskType diskTypePb = + new com.google.api.services.compute.model.DiskType(); + if (generatedId != null) { + diskTypePb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + diskTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + diskTypePb.setDescription(description); + diskTypePb.setValidDiskSize(validDiskSize); + diskTypePb.setSelfLink(diskTypeId.getSelfLink()); + diskTypePb.setDefaultDiskSizeGb(defaultDiskSizeGb); + diskTypePb.setZone(diskTypeId.getZoneId().getSelfLink()); + if (deprecationStatus != null) { + diskTypePb.setDeprecated(deprecationStatus.toPb()); + } + return diskTypePb; + } + + static Builder newBuilder() { + return new Builder(); + } + + static DiskType fromPb(com.google.api.services.compute.model.DiskType diskTypePb) { + Builder builder = newBuilder(); + if (diskTypePb.getId() != null) { + builder.setGeneratedId(diskTypePb.getId().toString()); + } + if (diskTypePb.getCreationTimestamp() != null) { + builder.setCreationTimestamp( + TIMESTAMP_FORMATTER.parseMillis(diskTypePb.getCreationTimestamp())); + } + builder.setDiskTypeId(DiskTypeId.fromUrl(diskTypePb.getSelfLink())); + builder.setDescription(diskTypePb.getDescription()); + builder.setValidDiskSize(diskTypePb.getValidDiskSize()); + builder.setDefaultDiskSizeGb(diskTypePb.getDefaultDiskSizeGb()); + if (diskTypePb.getDeprecated() != null) { + builder.setDeprecationStatus( + DeprecationStatus.fromPb(diskTypePb.getDeprecated(), DiskTypeId.FROM_URL_FUNCTION)); + } + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java new file mode 100644 index 000000000000..6a06b17c160a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java @@ -0,0 +1,153 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine disk type. + */ +public final class DiskTypeId extends ResourceId { + + static final Function FROM_URL_FUNCTION = new Function() { + @Override + public DiskTypeId apply(String pb) { + return DiskTypeId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = new Function() { + @Override + public String apply(DiskTypeId diskTypeId) { + return diskTypeId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/diskTypes/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 7337881474103686219L; + + private final String zone; + private final String type; + + private DiskTypeId(String project, String zone, String type) { + super(project); + this.zone = checkNotNull(zone); + this.type = checkNotNull(type); + } + + /** + * Returns the name of the disk type. + */ + public String getType() { + return type; + } + + /** + * Returns the name of the zone this disk type belongs to. + */ + public String getZone() { + return zone; + } + + /** + * Returns the identity of the zone this disk type belongs to. + */ + public ZoneId getZoneId() { + return ZoneId.of(getProject(), zone); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/zones/" + zone + "/diskTypes/" + type; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("zone", zone).add("type", type); + } + + @Override + public int hashCode() { + return Objects.hash(super.baseHashCode(), zone, type); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof DiskTypeId)) { + return false; + } + DiskTypeId other = (DiskTypeId) obj; + return baseEquals(other) + && Objects.equals(zone, other.zone) + && Objects.equals(type, other.type); + } + + @Override + DiskTypeId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return DiskTypeId.of(projectId, zone, type); + } + + /** + * Returns a disk type identity given the zone identity and the disk type name. + */ + public static DiskTypeId of(ZoneId zoneId, String type) { + return new DiskTypeId(zoneId.getProject(), zoneId.getZone(), type); + } + + /** + * Returns a disk type identity given the zone and disk type names. + */ + public static DiskTypeId of(String zone, String type) { + return of(ZoneId.of(null, zone), type); + } + + /** + * Returns a disk type identity given project disk, zone and disk type names. + */ + public static DiskTypeId of(String project, String zone, String type) { + return of(ZoneId.of(project, zone), type); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a disk type URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static DiskTypeId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid disk type URL"); + } + return DiskTypeId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java new file mode 100644 index 000000000000..82440b33c81a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ForwardingRuleId.java @@ -0,0 +1,93 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * Base class for Google Compute Engine forwarding rule identities. + */ +public abstract class ForwardingRuleId extends ResourceId { + + private static final long serialVersionUID = -4352410760458355391L; + + private final String rule; + + ForwardingRuleId(String project, String rule) { + super(project); + this.rule = checkNotNull(rule); + } + + /** + * Possible types for a Google Compute Engine forwarding rule identity. + */ + enum Type { + /** + * Global forwarding rules are used to forward traffic to the correct load balancer for HTTP(S) + * load balancing. + */ + GLOBAL, + + /** + * Region forwarding rules are used to forward traffic to the correct pool of target virtual + * machines. + */ + REGION + } + + /** + * Returns the type of this forwarding rule identity. + */ + public abstract Type getType(); + + /** + * Returns the name of the forwarding rule. The forwarding rule name must be 1-63 characters long + * and comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getRule() { + return rule; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("rule", rule); + } + + @Override + final int baseHashCode() { + return Objects.hash(super.baseHashCode(), rule); + } + + @Override + final boolean baseEquals(ResourceId resourceId) { + return resourceId instanceof ForwardingRuleId + && super.baseEquals(resourceId) + && Objects.equals(rule, ((ForwardingRuleId) resourceId).rule); + } + + @Override + abstract ForwardingRuleId setProjectId(String projectId); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java new file mode 100644 index 000000000000..b191bb3889d6 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalAddressId.java @@ -0,0 +1,104 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine global address. + */ +public final class GlobalAddressId extends AddressId { + + private static final String REGEX = ResourceId.REGEX + "global/addresses/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -2950815290049218593L; + + private GlobalAddressId(String project, String address) { + super(project, address); + } + + @Override + public Type getType() { + return Type.GLOBAL; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/addresses/" + getAddress(); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj == this || obj instanceof GlobalAddressId && baseEquals((GlobalAddressId) obj); + } + + @Override + GlobalAddressId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return GlobalAddressId.of(projectId, getAddress()); + } + + /** + * Returns an address identity given the address name. The address name must be 1-63 characters + * long and comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public static GlobalAddressId of(String address) { + return new GlobalAddressId(null, address); + } + + /** + * Returns an address identity given project and address names. The address name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static GlobalAddressId of(String project, String address) { + return new GlobalAddressId(project, address); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a global address + * URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static GlobalAddressId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid global address URL"); + } + return GlobalAddressId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java new file mode 100644 index 000000000000..7761803a36ae --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalForwardingRuleId.java @@ -0,0 +1,123 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.common.base.Function; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine global forwarding rule. + */ +public final class GlobalForwardingRuleId extends ForwardingRuleId { + + static final Function FROM_URL_FUNCTION = + new Function() { + @Override + public GlobalForwardingRuleId apply(String pb) { + return GlobalForwardingRuleId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = + new Function() { + @Override + public String apply(GlobalForwardingRuleId forwardingRuleId) { + return forwardingRuleId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "global/forwardingRules/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -2648031793037534254L; + + private GlobalForwardingRuleId(String project, String rule) { + super(project, rule); + } + + @Override + public Type getType() { + return Type.GLOBAL; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/forwardingRules/" + getRule(); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof GlobalForwardingRuleId + && baseEquals((GlobalForwardingRuleId) obj); + } + + @Override + GlobalForwardingRuleId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return GlobalForwardingRuleId.of(projectId, getRule()); + } + + /** + * Returns a forwarding rule identity given the rule name. The forwarding rule name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static GlobalForwardingRuleId of(String rule) { + return new GlobalForwardingRuleId(null, rule); + } + + /** + * Returns a forwarding rule identity given the project rule names. The forwarding rule name must + * be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static GlobalForwardingRuleId of(String project, String rule) { + return new GlobalForwardingRuleId(project, rule); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a global forwarding + * rule URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static GlobalForwardingRuleId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid global forwarding rule URL"); + } + return GlobalForwardingRuleId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java new file mode 100644 index 000000000000..3c188874b1b4 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/GlobalOperationId.java @@ -0,0 +1,92 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine global operation. + */ +public final class GlobalOperationId extends OperationId { + + private static final String REGEX = ResourceId.REGEX + "global/operations/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 3945756772641577962L; + + private GlobalOperationId(String project, String operation) { + super(project, operation); + } + + @Override + public Type getType() { + return Type.GLOBAL; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/operations/" + getOperation(); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj == this || obj instanceof GlobalOperationId && baseEquals((GlobalOperationId) obj); + } + + @Override + GlobalOperationId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return GlobalOperationId.of(projectId, getOperation()); + } + + /** + * Returns a global operation identity given the operation name. + */ + public static GlobalOperationId of(String operation) { + return new GlobalOperationId(null, operation); + } + + /** + * Returns a global operation identity given project and operation names. + */ + public static GlobalOperationId of(String project, String operation) { + return new GlobalOperationId(project, operation); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a global operation + * URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static GlobalOperationId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid global operation URL"); + } + return GlobalOperationId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java new file mode 100644 index 000000000000..084fc418465a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Image.java @@ -0,0 +1,214 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.Compute.ImageOption; +import com.google.cloud.compute.deprecated.Compute.OperationOption; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine Image. An image contains a boot loader, an operating system and a root + * file system that is necessary for starting an instance. Compute Engine offers publicly-available + * images of certain operating systems that you can use, or you can create a custom image. A custom + * image is an image created from one of your virtual machine instances that contains your specific + * instance configurations. To get an {@code Image} object with the most recent information use + * {@link #reload}. {@code Image} adds a layer of service-related functionality + * over {@link ImageInfo}. + * + * @see Images + */ +public class Image extends ImageInfo { + + private static final long serialVersionUID = 4623766590317494020L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Image} objects. + */ + public static class Builder extends ImageInfo.Builder { + + private final Compute compute; + private final ImageInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, ImageId imageId, ImageConfiguration configuration) { + this.compute = compute; + this.infoBuilder = new ImageInfo.BuilderImpl(); + this.infoBuilder.setImageId(imageId); + this.infoBuilder.setConfiguration(configuration); + } + + Builder(Image image) { + this.compute = image.compute; + this.infoBuilder = new ImageInfo.BuilderImpl(image); + } + + @Override + Builder setGeneratedId(String generatedId) { + infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + Builder getCreationTimestamp(Long creationTimestamp) { + infoBuilder.getCreationTimestamp(creationTimestamp); + return this; + } + + @Override + public Builder setImageId(ImageId imageId) { + infoBuilder.setImageId(imageId); + return this; + } + + @Override + public Builder setDescription(String description) { + infoBuilder.setDescription(description); + return this; + } + + @Override + public Builder setConfiguration(ImageConfiguration configuration) { + infoBuilder.setConfiguration(configuration); + return this; + } + + @Override + Builder setStatus(Status status) { + infoBuilder.setStatus(status); + return this; + } + + @Override + Builder setDiskSizeGb(Long diskSizeGb) { + infoBuilder.setDiskSizeGb(diskSizeGb); + return this; + } + + @Override + Builder setLicenses(List licenses) { + infoBuilder.setLicenses(licenses); + return this; + } + + @Override + Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { + infoBuilder.setDeprecationStatus(deprecationStatus); + return this; + } + + @Override + public Image build() { + return new Image(compute, infoBuilder); + } + } + + Image(Compute compute, ImageInfo.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this image exists. + * + * @return {@code true} if this image exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(ImageOption.fields()) != null; + } + + /** + * Fetches current image' latest information. Returns {@code null} if the image does not exist. + * + * @param options image options + * @return an {@code Image} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Image reload(ImageOption... options) { + return compute.getImage(getImageId(), options); + } + + /** + * Deletes this image. + * + * @return a global operation if the delete request was successfully sent, {@code null} if the + * image was not found + * @throws ComputeException upon failure or if this image is a publicly-available image + */ + public Operation delete(OperationOption... options) { + return compute.deleteImage(getImageId(), options); + } + + /** + * Deprecates this image. + * + * @return a global operation if the deprecation request was successfully sent, {@code null} if + * the image was not found + * @throws ComputeException upon failure or if this image is a publicly-available image + */ + public Operation deprecate(DeprecationStatus deprecationStatus, + OperationOption... options) { + return compute.deprecate(getImageId(), deprecationStatus, options); + } + + /** + * Returns the image's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Image.class)) { + return false; + } + Image other = (Image) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Image fromPb(Compute compute, com.google.api.services.compute.model.Image imagePb) { + return new Image(compute, new ImageInfo.BuilderImpl(imagePb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java new file mode 100644 index 000000000000..2cfea1dea504 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageConfiguration.java @@ -0,0 +1,190 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.services.compute.model.Image; +import com.google.common.base.MoreObjects; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Base class for Google Compute Engine image configuration. Use {@link DiskImageConfiguration} to + * create an image from an existing Google Compute Engine disk. Use + * {@link StorageImageConfiguration} to create an image from a file stored in Google Cloud Storage. + */ +public abstract class ImageConfiguration implements Serializable { + + private static final long serialVersionUID = -9154332316597745316L; + + private final Type type; + private final SourceType sourceType; + private final Long archiveSizeBytes; + + /** + * Type of a Google Compute Engine image. + */ + public enum Type { + /** + * A Google Compute Engine image created from a Google Compute Engine disk. + */ + DISK, + + /** + * A Google Compute Engine image created from a file saved in Google Cloud Storage. + */ + STORAGE + } + + /** + * Image source type. The only admissible value is {@code RAW}. + */ + public enum SourceType { + RAW + } + + /** + * Base builder for image configurations. + * + * @param the image configuration class + * @param the image configuration builder + */ + public abstract static class Builder> { + + private Type type; + private SourceType sourceType; + private Long archiveSizeBytes; + + Builder(Type type) { + this.type = type; + } + + Builder(ImageConfiguration imageConfiguration) { + this.type = imageConfiguration.type; + this.sourceType = imageConfiguration.sourceType; + this.archiveSizeBytes = imageConfiguration.archiveSizeBytes; + } + + Builder(Type type, Image imagePb) { + this.type = type; + if (imagePb.getSourceType() != null) { + this.sourceType = SourceType.valueOf(imagePb.getSourceType()); + } + this.archiveSizeBytes = imagePb.getArchiveSizeBytes(); + } + + @SuppressWarnings("unchecked") + B self() { + return (B) this; + } + + B setType(Type type) { + this.type = type; + return self(); + } + + B setSourceType(SourceType sourceType) { + this.sourceType = sourceType; + return self(); + } + + B setArchiveSizeBytes(Long archiveSizeBytes) { + this.archiveSizeBytes = archiveSizeBytes; + return self(); + } + + /** + * Creates a configuration object. + */ + public abstract T build(); + } + + ImageConfiguration(Builder builder) { + this.type = builder.type; + this.sourceType = builder.sourceType; + this.archiveSizeBytes = builder.archiveSizeBytes; + } + + /** + * Returns the image's type. This method returns {@link Type#DISK} if this image was created from + * an existing disk. This method returns {@link Type#STORAGE} if this image was created from a + * file in Google Cloud Storage. + */ + public Type getType() { + return type; + } + + /** + * Returns the source type of the disk. The default and only value is {@link SourceType#RAW}. + */ + public SourceType getSourceType() { + return sourceType; + } + + /** + * Returns the size of the image archive stored in Google Cloud Storage (in bytes). + */ + public Long getArchiveSizeBytes() { + return archiveSizeBytes; + } + + /** + * Returns a builder for the object. + */ + public abstract Builder toBuilder(); + + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this) + .add("type", type) + .add("sourceType", sourceType) + .add("archiveSizeBytes", archiveSizeBytes); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + final int baseHashCode() { + return Objects.hash(type, sourceType, archiveSizeBytes); + } + + final boolean baseEquals(ImageConfiguration imageConfiguration) { + return imageConfiguration != null + && getClass().equals(imageConfiguration.getClass()) + && Objects.equals(toPb(), imageConfiguration.toPb()); + } + + abstract ImageConfiguration setProjectId(String projectId); + + Image toPb() { + Image imagePb = new Image(); + if (sourceType != null) { + imagePb.setSourceType(sourceType.name()); + } + imagePb.setArchiveSizeBytes(archiveSizeBytes); + return imagePb; + } + + @SuppressWarnings("unchecked") + static T fromPb(Image imagePb) { + if (imagePb.getSourceDisk() != null) { + return (T) DiskImageConfiguration.fromPb(imagePb); + } + return (T) StorageImageConfiguration.fromPb(imagePb); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java new file mode 100644 index 000000000000..75d36154cd21 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageDiskConfiguration.java @@ -0,0 +1,178 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Disk; +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * A Google Compute Engine disk configuration to create a disk from a Google Compute Engine image. + * + * @see Block Storage + */ +public class ImageDiskConfiguration extends DiskConfiguration { + + private static final long serialVersionUID = 6469117882950722812L; + + private final ImageId sourceImage; + private final String sourceImageId; + + /** + * A builder for {@code ImageDiskConfiguration} objects. + */ + public static class Builder + extends DiskConfiguration.Builder { + + private ImageId sourceImage; + private String sourceImageId; + + private Builder(ImageId sourceImage) { + super(Type.IMAGE); + this.sourceImage = checkNotNull(sourceImage); + } + + private Builder(ImageDiskConfiguration configuration) { + super(configuration); + this.sourceImage = configuration.sourceImage; + this.sourceImageId = configuration.sourceImageId; + } + + private Builder(Disk diskPb) { + super(Type.IMAGE, diskPb); + this.sourceImage = ImageId.fromUrl(diskPb.getSourceImage()); + this.sourceImageId = diskPb.getSourceImageId(); + } + + /** + * Sets the size of the persistent disk, in GB. If not set the disk will have the size of the + * image. This value can be larger than the image's size. If the provided size is smaller than + * the image's size then disk creation will fail. + */ + @Override + public Builder setSizeGb(Long sizeGb) { + super.setSizeGb(sizeGb); + return this; + } + + /** + * Sets the identity of the source image used to create the disk. + */ + public Builder setSourceImage(ImageId sourceImage) { + this.sourceImage = checkNotNull(sourceImage); + return this; + } + + Builder setSourceImageId(String sourceImageId) { + this.sourceImageId = sourceImageId; + return this; + } + + /** + * Creates an {@code ImageDiskConfiguration} object. + */ + @Override + public ImageDiskConfiguration build() { + return new ImageDiskConfiguration(this); + } + } + + private ImageDiskConfiguration(Builder builder) { + super(builder); + this.sourceImage = builder.sourceImage; + this.sourceImageId = builder.sourceImageId; + } + + /** + * Returns the identity of the source image used to create the disk. + */ + public ImageId getSourceImage() { + return sourceImage; + } + + /** + * Returns the service-generated unique id 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 service-generated id would identify the exact version of the image that + * was used. + */ + public String getSourceImageId() { + return sourceImageId; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("sourceImage", sourceImage) + .add("sourceImageId", sourceImageId); + } + + @Override + public final int hashCode() { + return Objects.hash(baseHashCode(), sourceImage, sourceImageId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(ImageDiskConfiguration.class) + && baseEquals((ImageDiskConfiguration) obj); + } + + @Override + ImageDiskConfiguration setProjectId(String projectId) { + Builder builder = toBuilder().setSourceImage(sourceImage.setProjectId(projectId)); + if (getDiskType() != null) { + builder.setDiskType(getDiskType().setProjectId(projectId)); + } + return builder.build(); + } + + @Override + Disk toPb() { + return super.toPb().setSourceImage(sourceImage.getSelfLink()).setSourceImageId(sourceImageId); + } + + /** + * Returns a builder for an {@code ImageDiskConfiguration} object given the image identity. + */ + public static Builder newBuilder(ImageId imageId) { + return new Builder(imageId); + } + + /** + * Returns an {@code ImageDiskConfiguration} object given the image identity. + */ + public static ImageDiskConfiguration of(ImageId imageId) { + return newBuilder(imageId).build(); + } + + @SuppressWarnings("unchecked") + static ImageDiskConfiguration fromPb(Disk diskPb) { + return new Builder(diskPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java new file mode 100644 index 000000000000..4b6cf98f8bf6 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageId.java @@ -0,0 +1,145 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine image. + */ +public final class ImageId extends ResourceId { + + static final Function FROM_URL_FUNCTION = new Function() { + @Override + public ImageId apply(String pb) { + return ImageId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = new Function() { + @Override + public String apply(ImageId imageId) { + return imageId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "global/images/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 6434553917859414341L; + + private final String image; + + private ImageId(String project, String image) { + super(project); + this.image = checkNotNull(image); + } + + /** + * Returns the name of the image. The name must be 1-63 characters long and comply with RFC1035. + * Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} + * which means the first character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getImage() { + return image; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/images/" + image; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("image", image); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), image); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ImageId)) { + return false; + } + ImageId other = (ImageId) obj; + return baseEquals(other) && Objects.equals(image, other.image); + } + + @Override + ImageId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return ImageId.of(projectId, image); + } + + /** + * Returns an image identity given the image name. The image name must be 1-63 characters long and + * comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public static ImageId of(String image) { + return new ImageId(null, image); + } + + /** + * Returns an image identity given project and image names. The image name must be 1-63 characters + * long and comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public static ImageId of(String project, String image) { + return new ImageId(project, image); + } + + /** + * Returns {@code true} if the provided string matches the expected format of an image URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static ImageId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid image URL"); + } + return ImageId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java new file mode 100644 index 000000000000..0e0c289c78e3 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ImageInfo.java @@ -0,0 +1,417 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Image; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine Image. An image contains a boot loader, an operating system and a root + * file system that is necessary for starting an instance. Compute Engine offers publicly-available + * images of certain operating systems that you can use, or you can create a custom image. A custom + * image is an image created from one of your virtual machine instances that contains your specific + * instance configurations. Use {@link DiskImageConfiguration} to create an image from an existing + * disk. Use {@link StorageImageConfiguration} to create an image from a file stored in Google + * Cloud Storage. + * + * @see Images + */ +public class ImageInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public ImageInfo apply(Image pb) { + return ImageInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Image apply(ImageInfo image) { + return image.toPb(); + } + }; + + private static final long serialVersionUID = -1061916352807358977L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final ImageId imageId; + private final Long creationTimestamp; + private final String description; + private final ImageConfiguration configuration; + private final Status status; + private final Long diskSizeGb; + private final List licenses; + private final DeprecationStatus deprecationStatus; + + /** + * The status of a Google Compute Engine Image. An image can be used to create other disks only + * after it has been successfully created and its status is set to {@code READY}. + */ + public enum Status { + /** + * Image creation failed. The image can not be used. + */ + FAILED, + + /** + * Image creation is pending. The image is not ready to be used yet. + */ + PENDING, + + /** + * Image has been created and is ready for use. + */ + READY + } + + /** + * A builder for {@code ImageInfo} objects. + */ + public abstract static class Builder { + + abstract Builder setGeneratedId(String generatedId); + + abstract Builder getCreationTimestamp(Long creationTimestamp); + + /** + * Sets the image identity. + */ + public abstract Builder setImageId(ImageId imageId); + + /** + * Sets an optional textual description of the image. + */ + public abstract Builder setDescription(String description); + + /** + * Sets the image configuration. Use {@link DiskImageConfiguration} to create an image from an + * existing disk. Use {@link StorageImageConfiguration} to create an image from a file stored in + * Google Cloud Storage. + */ + public abstract Builder setConfiguration(ImageConfiguration configuration); + + abstract Builder setStatus(Status status); + + abstract Builder setDiskSizeGb(Long diskSizeGb); + + abstract Builder setLicenses(List licenses); + + abstract Builder setDeprecationStatus(DeprecationStatus deprecationStatus); + + /** + * Creates a {@code ImageInfo} object. + */ + public abstract ImageInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String generatedId; + private Long creationTimestamp; + private ImageId imageId; + private String description; + private ImageConfiguration configuration; + private Status status; + private Long diskSizeGb; + private List licenses; + private DeprecationStatus deprecationStatus; + + BuilderImpl() {} + + BuilderImpl(ImageInfo imageInfo) { + this.generatedId = imageInfo.generatedId; + this.creationTimestamp = imageInfo.creationTimestamp; + this.imageId = imageInfo.imageId; + this.description = imageInfo.description; + this.configuration = imageInfo.configuration; + this.status = imageInfo.status; + this.diskSizeGb = imageInfo.diskSizeGb; + this.licenses = imageInfo.licenses; + this.deprecationStatus = imageInfo.deprecationStatus; + } + + BuilderImpl(Image imagePb) { + if (imagePb.getId() != null) { + this.generatedId = imagePb.getId().toString(); + } + if (imagePb.getCreationTimestamp() != null) { + this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(imagePb.getCreationTimestamp()); + } + this.imageId = ImageId.fromUrl(imagePb.getSelfLink()); + this.description = imagePb.getDescription(); + this.configuration = ImageConfiguration.fromPb(imagePb); + if (imagePb.getStatus() != null) { + this.status = Status.valueOf(imagePb.getStatus()); + } + this.diskSizeGb = imagePb.getDiskSizeGb(); + if (imagePb.getLicenses() != null) { + this.licenses = Lists.transform(imagePb.getLicenses(), LicenseId.FROM_URL_FUNCTION); + } + if (imagePb.getDeprecated() != null) { + this.deprecationStatus = + DeprecationStatus.fromPb(imagePb.getDeprecated(), ImageId.FROM_URL_FUNCTION); + } + } + + @Override + BuilderImpl setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + BuilderImpl getCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + public BuilderImpl setImageId(ImageId imageId) { + this.imageId = checkNotNull(imageId); + return this; + } + + @Override + public BuilderImpl setDescription(String description) { + this.description = description; + return this; + } + + @Override + public BuilderImpl setConfiguration(ImageConfiguration configuration) { + this.configuration = checkNotNull(configuration); + return this; + } + + @Override + BuilderImpl setStatus(Status status) { + this.status = status; + return this; + } + + @Override + BuilderImpl setDiskSizeGb(Long diskSizeGb) { + this.diskSizeGb = diskSizeGb; + return this; + } + + @Override + BuilderImpl setLicenses(List licenses) { + this.licenses = licenses != null ? ImmutableList.copyOf(licenses) : null; + return this; + } + + @Override + BuilderImpl setDeprecationStatus(DeprecationStatus deprecationStatus) { + this.deprecationStatus = deprecationStatus; + return this; + } + + @Override + public ImageInfo build() { + return new ImageInfo(this); + } + } + + ImageInfo(BuilderImpl builder) { + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.imageId = checkNotNull(builder.imageId); + this.description = builder.description; + this.configuration = checkNotNull(builder.configuration); + this.status = builder.status; + this.diskSizeGb = builder.diskSizeGb; + this.licenses = builder.licenses; + this.deprecationStatus = builder.deprecationStatus; + } + + /** + * Returns the service-generated unique identifier for the image. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns the image identity. + */ + public ImageId getImageId() { + return imageId; + } + + /** + * Returns a textual description of the image. + */ + public String getDescription() { + return description; + } + + /** + * Returns the image configuration. This method returns an instance of + * {@link DiskImageConfiguration} if the the image was created from a Google Compute Engine disk. + * This method returns an instance of {@link StorageImageConfiguration} if the image was created + * from a file stored in Google Cloud Storage. + */ + @SuppressWarnings("unchecked") + public T getConfiguration() { + return (T) configuration; + } + + /** + * Returns all applicable publicly visible licenses. + */ + public List getLicenses() { + return licenses; + } + + /** + * Returns the status of the image. An image can be used to create other disks only after it has + * been successfully created and its status is set to {@link Status#READY}. + */ + public Status getStatus() { + return status; + } + + /** + * Returns the size of the image when restored onto a persistent disk (in GB). + */ + public Long getDiskSizeGb() { + return diskSizeGb; + } + + /** + * Returns the deprecation status of the image. If {@link DeprecationStatus#getStatus()} is either + * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the + * image must not be used. Returns {@code null} if the image is not deprecated. + */ + public DeprecationStatus getDeprecationStatus() { + return deprecationStatus; + } + + /** + * Returns a builder for the current image. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("imageId", imageId) + .add("description", description) + .add("configuration", configuration) + .add("status", status) + .add("diskSizeGb", diskSizeGb) + .add("licenses", licenses) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(generatedId, creationTimestamp, imageId, description, configuration, status, + diskSizeGb, licenses); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(ImageInfo.class) + && Objects.equals(toPb(), ((ImageInfo) obj).toPb()); + } + + ImageInfo setProjectId(String projectId) { + return toBuilder() + .setImageId(imageId.setProjectId(projectId)) + .setConfiguration(configuration.setProjectId(projectId)) + .build(); + } + + Image toPb() { + Image imagePb = configuration.toPb(); + if (generatedId != null) { + imagePb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + imagePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + imagePb.setName(imageId.getImage()); + imagePb.setDescription(description); + imagePb.setSelfLink(imageId.getSelfLink()); + if (status != null) { + imagePb.setStatus(status.name()); + } + imagePb.setDiskSizeGb(diskSizeGb); + if (licenses != null) { + imagePb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); + } + if (deprecationStatus != null) { + imagePb.setDeprecated(deprecationStatus.toPb()); + } + return imagePb; + } + + /** + * Returns a builder for an {@code ImageInfo} object given the image identity and an image + * configuration. Use {@link DiskImageConfiguration} to create an image from an existing disk. Use + * {@link StorageImageConfiguration} to create an image from a file stored in Google Cloud + * Storage. + */ + public static Builder newBuilder(ImageId imageId, ImageConfiguration configuration) { + return new BuilderImpl().setImageId(imageId).setConfiguration(configuration); + } + + /** + * Returns an {@code ImageInfo} object given the image identity and an image configuration. Use + * {@link DiskImageConfiguration} to create an image from an existing disk. Use + * {@link StorageImageConfiguration} to create an image from a file stored in Google Cloud + * Storage. + */ + public static ImageInfo of(ImageId imageId, ImageConfiguration configuration) { + return newBuilder(imageId, configuration).build(); + } + + static ImageInfo fromPb(Image imagePb) { + return new BuilderImpl(imagePb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java new file mode 100644 index 000000000000..265f9739f412 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java @@ -0,0 +1,465 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; +import com.google.cloud.compute.deprecated.Compute.InstanceOption; +import com.google.cloud.compute.deprecated.Compute.OperationOption; +import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; +import com.google.common.collect.ImmutableList; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A Google Compute Engine VM Instance. An instance is a virtual machine (VM) hosted on Google's + * infrastructure. Instances can run Linux and Windows Server images provided by Google, or any + * customized versions of these images. You can also build and run images of other operating + * systems. Objects of this class are immutable. To get an {@code Instance} object with the most + * recent information use {@link #reload}. {@code Instance} adds a layer of service-related + * functionality over {@link InstanceInfo}. + * + * @see Virtual Machine Instances + */ +public class Instance extends InstanceInfo { + + private static final long serialVersionUID = 3072508155558980677L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Instance} objects. + */ + public static class Builder extends InstanceInfo.Builder { + + private final Compute compute; + private final InstanceInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, InstanceId instanceId, MachineTypeId machineType, + AttachedDisk attachedDisk, NetworkInterface networkInterface) { + this.compute = compute; + this.infoBuilder = new InstanceInfo.BuilderImpl(instanceId); + this.infoBuilder.setMachineType(machineType); + this.infoBuilder.setAttachedDisks(ImmutableList.of(attachedDisk)); + this.infoBuilder.setNetworkInterfaces(ImmutableList.of(networkInterface)); + } + + Builder(Instance instance) { + this.compute = instance.compute; + this.infoBuilder = new InstanceInfo.BuilderImpl(instance); + } + + @Override + Builder setGeneratedId(String generatedId) { + this.infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + public Builder setInstanceId(InstanceId instanceId) { + this.infoBuilder.setInstanceId(instanceId); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + this.infoBuilder.setCreationTimestamp(creationTimestamp); + return this; + } + + @Override + public Builder setDescription(String description) { + this.infoBuilder.setDescription(description); + return this; + } + + @Override + Builder setStatus(Status status) { + this.infoBuilder.setStatus(status); + return this; + } + + @Override + Builder setStatusMessage(String statusMessage) { + this.infoBuilder.setStatusMessage(statusMessage); + return this; + } + + @Override + public Builder setTags(Tags tags) { + this.infoBuilder.setTags(tags); + return this; + } + + @Override + public Builder setMachineType(MachineTypeId machineType) { + this.infoBuilder.setMachineType(machineType); + return this; + } + + @Override + public Builder setCanIpForward(Boolean canIpForward) { + this.infoBuilder.setCanIpForward(canIpForward); + return this; + } + + @Override + public Builder setNetworkInterfaces(List networkInterfaces) { + this.infoBuilder.setNetworkInterfaces(networkInterfaces); + return this; + } + + @Override + public Builder setNetworkInterfaces(NetworkInterface... networkInterfaces) { + this.infoBuilder.setNetworkInterfaces(networkInterfaces); + return this; + } + + @Override + public Builder setAttachedDisks(List attachedDisks) { + this.infoBuilder.setAttachedDisks(attachedDisks); + return this; + } + + @Override + public Builder setAttachedDisks(AttachedDisk... attachedDisks) { + this.infoBuilder.setAttachedDisks(attachedDisks); + return this; + } + + @Override + public Builder setMetadata(Metadata metadata) { + this.infoBuilder.setMetadata(metadata); + return this; + } + + @Override + public Builder setServiceAccounts(List serviceAccounts) { + this.infoBuilder.setServiceAccounts(serviceAccounts); + return this; + } + + @Override + public Builder setSchedulingOptions(SchedulingOptions schedulingOptions) { + this.infoBuilder.setSchedulingOptions(schedulingOptions); + return this; + } + + @Override + Builder setCpuPlatform(String cpuPlatform) { + this.infoBuilder.setCpuPlatform(cpuPlatform); + return this; + } + + @Override + public Instance build() { + return new Instance(compute, infoBuilder); + } + } + + Instance(Compute compute, Instance.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this instance exists. + * + * @return {@code true} if this instance exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(InstanceOption.fields()) != null; + } + + /** + * Fetches current instance's latest information. Returns {@code null} if the instance does not + * exist. + * + * @param options instance options + * @return a {@code Instance} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Instance reload(InstanceOption... options) { + return compute.getInstance(getInstanceId(), options); + } + + /** + * Deletes this instance. + * + * @return a zone operation if delete request was successfully sent, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation delete(OperationOption... options) { + return compute.deleteInstance(getInstanceId(), options); + } + + /** + * Adds an access configuration to the provided network interface for this instance. + * + * @return a zone operation if the add request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation addAccessConfig(String networkInterface, AccessConfig accessConfig, + OperationOption... options) { + return compute.addAccessConfig(getInstanceId(), networkInterface, accessConfig, options); + } + + /** + * Attaches a persistent disk to this instance given its configuration. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation attachDisk(PersistentDiskConfiguration configuration, + OperationOption... options) { + return compute.attachDisk(getInstanceId(), configuration, options); + } + + /** + * Attaches a persistent disk to this instance given the device name and its configuration. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation attachDisk(String deviceName, PersistentDiskConfiguration configuration, + OperationOption... options) { + return compute.attachDisk(getInstanceId(), deviceName, configuration, options); + } + + /** + * Attaches a persistent disk to this instance given the device name, its configuration and the + * device index. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation attachDisk(String deviceName, PersistentDiskConfiguration configuration, + int index, OperationOption... options) { + return compute.attachDisk(getInstanceId(), deviceName, configuration, index, options); + } + + /** + * Deletes an access configuration from the provided network interface for this instance. + * + * @return a zone operation if the delete request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation deleteAccessConfig(String networkInterface, String accessConfig, + OperationOption... options) { + return compute.deleteAccessConfig(getInstanceId(), networkInterface, accessConfig, options); + } + + /** + * Detaches a disk from this instance. + * + * @return a zone operation if the detach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation detachDisk(String deviceName, OperationOption... options) { + return compute.detachDisk(getInstanceId(), deviceName, options); + } + + /** + * Returns the serial port output for this instance and port number. {@code port} must be between + * 1 and 4 (inclusive). + * + * @return the serial port output or {@code null} if the instance was not found + * @throws ComputeException upon failure + */ + public String getSerialPortOutput(int port) { + return compute.getSerialPortOutput(getInstanceId(), port); + } + + /** + * Returns the default serial port output for this instance. Default serial port corresponds to + * port number 1. + * + * @return the serial port output or {@code null} if the instance was not found + * @throws ComputeException upon failure + */ + public String getSerialPortOutput() { + return compute.getSerialPortOutput(getInstanceId()); + } + + /** + * Resets this instance. + * + * @return a zone operation if the reset request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation reset(OperationOption... options) { + return compute.reset(getInstanceId(), options); + } + + /** + * Sets the auto-delete flag for a disk attached to this instance. + * + * @return a zone operation if the flag setting request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation setDiskAutoDelete(String deviceName, boolean autoDelete, + OperationOption... options) { + return compute.setDiskAutoDelete(getInstanceId(), deviceName, autoDelete, options); + } + + /** + * Sets the machine type for this instance. The instance must be in + * {@link InstanceInfo.Status#TERMINATED} state to be able to set its machine type. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation setMachineType(MachineTypeId machineType, OperationOption... options) { + return compute.setMachineType(getInstanceId(), machineType, options); + } + + /** + * Sets the metadata for this instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation setMetadata(Metadata metadata, OperationOption... options) { + return compute.setMetadata(getInstanceId(), metadata, options); + } + + /** + * Sets the metadata for this instance, fingerprint value is taken from this instance's + * {@code tags().fingerprint()}. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation setMetadata(Map metadata, OperationOption... options) { + return setMetadata(getMetadata().toBuilder().setValues(metadata).build(), options); + } + + /** + * Sets the scheduling options for this instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation setSchedulingOptions(SchedulingOptions scheduling, OperationOption... options) { + return compute.setSchedulingOptions(getInstanceId(), scheduling, options); + } + + /** + * Sets the tags for this instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation setTags(Tags tags, OperationOption... options) { + return compute.setTags(getInstanceId(), tags, options); + } + + /** + * Sets the tags for this instance, fingerprint value is taken from this instance's + * {@code tags().fingerprint()}. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + public Operation setTags(Iterable tags, OperationOption... options) { + return setTags(getTags().toBuilder().setValues(tags).build(), options); + } + + /** + * Starts this instance. + * + * @return a zone operation if the start request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation start(OperationOption... options) { + return compute.start(getInstanceId(), options); + } + + /** + * Stops this instance. + * + * @return a zone operation if the stop request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + public Operation stop(OperationOption... options) { + return compute.stop(getInstanceId(), options); + } + + /** + * Returns the snapshot's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Instance.class)) { + return false; + } + Instance other = (Instance) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Instance fromPb(Compute compute, + com.google.api.services.compute.model.Instance instancePb) { + return new Instance(compute, new InstanceInfo.BuilderImpl(instancePb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java new file mode 100644 index 000000000000..1cfeb7cbd7be --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java @@ -0,0 +1,177 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine virtual machine instance. + */ +public final class InstanceId extends ResourceId { + + static final Function FROM_URL_FUNCTION = new Function() { + @Override + public InstanceId apply(String pb) { + return InstanceId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = new Function() { + @Override + public String apply(InstanceId instanceId) { + return instanceId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/instances/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -2787043125223159922L; + + private final String zone; + private final String instance; + + private InstanceId(String project, String zone, String instance) { + super(project); + this.zone = checkNotNull(zone); + this.instance = checkNotNull(instance); + } + + /** + * Returns the name of the instance. The name must be 1-63 characters long and comply with + * RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getInstance() { + return instance; + } + + /** + * Returns the name of the zone this instance belongs to. + */ + public String getZone() { + return zone; + } + + /** + * Returns the identity of the zone this instance belongs to. + */ + public ZoneId getZoneId() { + return ZoneId.of(getProject(), zone); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/zones/" + zone + "/instances/" + instance; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("zone", zone).add("instance", instance); + } + + @Override + public int hashCode() { + return Objects.hash(super.baseHashCode(), zone, instance); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof InstanceId)) { + return false; + } + InstanceId other = (InstanceId) obj; + return baseEquals(other) + && Objects.equals(zone, other.zone) + && Objects.equals(instance, other.instance); + } + + @Override + InstanceId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return InstanceId.of(projectId, zone, instance); + } + + /** + * Returns an instance identity given the zone identity and the instance name. The instance name + * must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the + * regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static InstanceId of(ZoneId zoneId, String instance) { + return new InstanceId(zoneId.getProject(), zoneId.getZone(), instance); + } + + /** + * Returns an instance identity given the zone and instance names. The instance name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static InstanceId of(String zone, String instance) { + return new InstanceId(null, zone, instance); + } + + /** + * Returns an instance identity given project, zone and instance names. The instance name must be + * 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static InstanceId of(String project, String zone, String instance) { + return new InstanceId(project, zone, instance); + } + + /** + * Returns {@code true} if the provided string matches the expected format of an instance URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static InstanceId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid instance URL"); + } + return InstanceId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java new file mode 100644 index 000000000000..a6192f60fa35 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceInfo.java @@ -0,0 +1,676 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Instance; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine VM Instance. An instance is a virtual machine (VM) hosted on Google's + * infrastructure. Instances can run Linux and Windows Server images provided by Google, or any + * customized versions of these images. You can also build and run images of other operating + * systems. Google Compute Engine also lets you choose the machine properties of your instances, + * such as the number of virtual CPUs and the amount of memory + * + *

By default, each Compute Engine instance has a small root persistent disk that contains the + * operating system. When your applications require additional storage space, you can add one or + * more additional disks to your instance. + * + *

Instances communicate with other instances in the same network through a local area network. + * Instances communicate with the rest of the world through the Internet. A network lives in a + * project and is isolated from other networks in the project. A project can have up to five + * different networks. + * + * @see Virtual Machine Instances + */ +public class InstanceInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public InstanceInfo apply(Instance pb) { + return InstanceInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Instance apply(InstanceInfo instance) { + return instance.toPb(); + } + }; + + private static final long serialVersionUID = -6601223112628977168L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final InstanceId instanceId; + private final Long creationTimestamp; + private final String description; + private final Status status; + private final String statusMessage; + private final Tags tags; + private final MachineTypeId machineType; + private final Boolean canIpForward; + private final List networkInterfaces; + private final List attachedDisks; + private final Metadata metadata; + private final List serviceAccounts; + private final SchedulingOptions schedulingOptions; + private final String cpuPlatform; + + /** + * The status of the instance. + */ + public enum Status { + /** + * Indicates that resources are being reserved for the instance. The instance isn't running yet. + */ + PROVISIONING, + + /** + * Indicates that resources have been acquired and the instance is being prepared for launch. + */ + STAGING, + + /** + * Indicates that the instance is booting up or running. You should be able to {@code ssh} into + * the instance soon, though not immediately, after it enters this state. + */ + RUNNING, + + /** + * Indicates that the instance is being stopped either due to a failure, or the instance being + * shut down. This is a temporary status and the instance will move to {@code TERMINATED}. + */ + STOPPING, + + /** + * Indicates that the instance was shut down or encountered a failure, either through the API or + * from inside the guest. You can choose to restart the instance or delete it. + */ + TERMINATED + } + + /** + * A builder for {@code InstanceInfo} objects. + */ + public abstract static class Builder { + + abstract Builder setGeneratedId(String generatedId); + + /** + * Sets the identity of the virtual machine instance. + */ + public abstract Builder setInstanceId(InstanceId instanceId); + + abstract Builder setCreationTimestamp(Long creationTimestamp); + + /** + * Sets an optional description of this Google Compute Engine instance. + */ + public abstract Builder setDescription(String description); + + abstract Builder setStatus(Status status); + + abstract Builder setStatusMessage(String statusMessage); + + /** + * Sets the tags to apply to this instance. Tags are used to identify valid sources or targets + * for network firewalls. + */ + public abstract Builder setTags(Tags tags); + + /** + * Sets the machine type identity. + */ + public abstract Builder setMachineType(MachineTypeId machineType); + + /** + * Sets whether to allow 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. + * + * @see Enabling IP + * Forwarding + */ + public abstract Builder setCanIpForward(Boolean canIpForward); + + /** + * Sets a list of network interfaces. This specifies how this instance is configured to interact + * with other network services, such as connecting to the internet. At the moment, instances + * only support one network interface. + */ + public abstract Builder setNetworkInterfaces(List networkInterfaces); + + /** + * Sets a list of network interfaces. This specifies how this instance is configured to interact + * with other network services, such as connecting to the internet. At the moment, instances + * only support one network interface. + */ + public abstract Builder setNetworkInterfaces(NetworkInterface... networkInterfaces); + + /** + * Sets a list of disks to attach to the instance. One boot disk must be provided (i.e. an + * attached disk such that {@link AttachedDisk.AttachedDiskConfiguration#boot()} returns + * {@code true}). + */ + public abstract Builder setAttachedDisks(List attachedDisks); + + /** + * Sets a list of disks to attach to the instance. One boot disk must be provided. + */ + public abstract Builder setAttachedDisks(AttachedDisk... attachedDisks); + + /** + * Sets the instance metadata. + */ + public abstract Builder setMetadata(Metadata metadata); + + /** + * Sets a list of service accounts, with their specified scopes, authorized for this instance. + * Service accounts generate access tokens that can be accessed through the metadata server and + * used to authenticate applications on the instance. + * + * @see Authenticating from + * Google Compute Engine + */ + public abstract Builder setServiceAccounts(List serviceAccounts); + + /** + * Sets the scheduling options for the instance. + */ + public abstract Builder setSchedulingOptions(SchedulingOptions schedulingOptions); + + abstract Builder setCpuPlatform(String cpuPlatform); + + /** + * Creates an {@code InstanceInfo} object. + */ + public abstract InstanceInfo build(); + } + + public static final class BuilderImpl extends Builder { + + private String generatedId; + private InstanceId instanceId; + private Long creationTimestamp; + private String description; + private Status status; + private String statusMessage; + private Tags tags; + private MachineTypeId machineType; + private Boolean canIpForward; + private List networkInterfaces; + private List attachedDisks; + private Metadata metadata; + private List serviceAccounts; + private SchedulingOptions schedulingOptions; + private String cpuPlatform; + + BuilderImpl(InstanceId instanceId) { + this.instanceId = checkNotNull(instanceId); + } + + BuilderImpl(InstanceInfo instance) { + this.generatedId = instance.generatedId; + this.instanceId = instance.instanceId; + this.creationTimestamp = instance.creationTimestamp; + this.description = instance.description; + this.status = instance.status; + this.statusMessage = instance.statusMessage; + this.tags = instance.tags; + this.machineType = instance.machineType; + this.canIpForward = instance.canIpForward; + this.networkInterfaces = instance.networkInterfaces; + this.attachedDisks = instance.attachedDisks; + this.metadata = instance.metadata; + this.serviceAccounts = instance.serviceAccounts; + this.schedulingOptions = instance.schedulingOptions; + this.cpuPlatform = instance.cpuPlatform; + } + + BuilderImpl(Instance instancePb) { + if (instancePb.getId() != null) { + this.generatedId = instancePb.getId().toString(); + } + this.instanceId = InstanceId.fromUrl(instancePb.getSelfLink()); + if (instancePb.getCreationTimestamp() != null) { + this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(instancePb.getCreationTimestamp()); + } + this.description = instancePb.getDescription(); + if (instancePb.getStatus() != null) { + this.status = Status.valueOf(instancePb.getStatus()); + } + this.statusMessage = instancePb.getStatusMessage(); + if (instancePb.getTags() != null) { + this.tags = Tags.fromPb(instancePb.getTags()); + } + if (instancePb.getMachineType() != null) { + this.machineType = MachineTypeId.fromUrl(instancePb.getMachineType()); + } + this.canIpForward = instancePb.getCanIpForward(); + if (instancePb.getNetworkInterfaces() != null) { + this.networkInterfaces = + Lists.transform(instancePb.getNetworkInterfaces(), NetworkInterface.FROM_PB_FUNCTION); + } + if (instancePb.getDisks() != null) { + this.attachedDisks = Lists.transform(instancePb.getDisks(), AttachedDisk.FROM_PB_FUNCTION); + } + if (instancePb.getMetadata() != null) { + this.metadata = Metadata.fromPb(instancePb.getMetadata()); + } + if (instancePb.getServiceAccounts() != null) { + this.serviceAccounts = + Lists.transform(instancePb.getServiceAccounts(), ServiceAccount.FROM_PB_FUNCTION); + } + if (instancePb.getScheduling() != null) { + this.schedulingOptions = SchedulingOptions.fromPb(instancePb.getScheduling()); + } + this.cpuPlatform = instancePb.getCpuPlatform(); + } + + @Override + Builder setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + public Builder setInstanceId(InstanceId instanceId) { + this.instanceId = checkNotNull(instanceId); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + public Builder setDescription(String description) { + this.description = description; + return this; + } + + @Override + Builder setStatus(Status status) { + this.status = status; + return this; + } + + @Override + Builder setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + @Override + public Builder setTags(Tags tags) { + this.tags = tags; + return this; + } + + @Override + public Builder setMachineType(MachineTypeId machineType) { + this.machineType = checkNotNull(machineType); + return this; + } + + @Override + public Builder setCanIpForward(Boolean canIpForward) { + this.canIpForward = canIpForward; + return this; + } + + @Override + public Builder setNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = ImmutableList.copyOf(checkNotNull(networkInterfaces)); + return this; + } + + @Override + public Builder setNetworkInterfaces(NetworkInterface... networkInterfaces) { + this.networkInterfaces = Arrays.asList(networkInterfaces); + return this; + } + + @Override + public Builder setAttachedDisks(List attachedDisks) { + this.attachedDisks = ImmutableList.copyOf(checkNotNull(attachedDisks)); + return this; + } + + @Override + public Builder setAttachedDisks(AttachedDisk... attachedDisks) { + this.attachedDisks = Arrays.asList(attachedDisks); + return this; + } + + @Override + public Builder setMetadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + @Override + public Builder setServiceAccounts(List serviceAccounts) { + this.serviceAccounts = ImmutableList.copyOf(checkNotNull(serviceAccounts)); + return this; + } + + @Override + public Builder setSchedulingOptions(SchedulingOptions schedulingOptions) { + this.schedulingOptions = schedulingOptions; + return this; + } + + @Override + Builder setCpuPlatform(String cpuPlatform) { + this.cpuPlatform = cpuPlatform; + return this; + } + + @Override + public InstanceInfo build() { + checkNotNull(attachedDisks); + checkNotNull(networkInterfaces); + return new InstanceInfo(this); + } + } + + InstanceInfo(BuilderImpl builder) { + this.generatedId = builder.generatedId; + this.instanceId = builder.instanceId; + this.creationTimestamp = builder.creationTimestamp; + this.description = builder.description; + this.status = builder.status; + this.statusMessage = builder.statusMessage; + this.tags = builder.tags; + this.machineType = builder.machineType; + this.canIpForward = builder.canIpForward; + this.networkInterfaces = builder.networkInterfaces; + this.attachedDisks = builder.attachedDisks; + this.metadata = builder.metadata; + this.serviceAccounts = builder.serviceAccounts; + this.schedulingOptions = builder.schedulingOptions; + this.cpuPlatform = builder.cpuPlatform; + } + + /** + * Returns the service-generated unique identifier for the instance. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the instance identity. + */ + public InstanceId getInstanceId() { + return instanceId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns a textual description of the instance. + */ + public String getDescription() { + return description; + } + + /** + * Returns the status of the instance. + */ + public Status getStatus() { + return status; + } + + /** + * Returns an optional, human-readable explanation of the status. + */ + public String getStatusMessage() { + return statusMessage; + } + + /** + * Returns the tags of this instance. Tags are used to identify valid sources or targets for + * network firewalls. + */ + public Tags getTags() { + return tags; + } + + /** + * Returns the machine type identity. + */ + public MachineTypeId getMachineType() { + return machineType; + } + + /** + * Returns whether to allow 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. + * + * @see Enabling IP + * Forwarding + */ + public Boolean canIpForward() { + return canIpForward; + } + + /** + * Returns a list of network interfaces. This specifies how this instance is configured to + * interact with other network services, such as connecting to the internet. + */ + public List getNetworkInterfaces() { + return networkInterfaces; + } + + /** + * Returns a list of disks attached to the instance. + */ + public List getAttachedDisks() { + return attachedDisks; + } + + /** + * Returns the instance metadata. + */ + public Metadata getMetadata() { + return metadata; + } + + /** + * Returns a list of service accounts, with their specified scopes, authorized for this instance. + * Service accounts generate access tokens that can be accessed through the metadata server and + * used to authenticate applications on the instance. + * + * @see Authenticating from + * Google Compute Engine + */ + public List getServiceAccounts() { + return serviceAccounts; + } + + /** + * Returns the scheduling options for the instance. + */ + public SchedulingOptions getSchedulingOptions() { + return schedulingOptions; + } + + /** + * Returns the CPU platform used by this instance. + */ + public String getCpuPlatform() { + return cpuPlatform; + } + + /** + * Returns a builder for the current instance. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("instanceId", instanceId) + .add("creationTimestamp", creationTimestamp) + .add("description", description) + .add("status", status) + .add("statusMessage", statusMessage) + .add("tags", tags) + .add("machineType", machineType) + .add("canIpForward", canIpForward) + .add("networkInterfaces", networkInterfaces) + .add("attachedDisks", attachedDisks) + .add("metadata", metadata) + .add("serviceAccounts", serviceAccounts) + .add("schedulingOptions", schedulingOptions) + .add("cpuPlatform", cpuPlatform) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(generatedId, instanceId, creationTimestamp, description, status, + statusMessage, tags, machineType, canIpForward, networkInterfaces, attachedDisks, metadata, + serviceAccounts, schedulingOptions, cpuPlatform); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(InstanceInfo.class) + && Objects.equals(toPb(), ((InstanceInfo) obj).toPb()); + } + + InstanceInfo setProjectId(final String projectId) { + Builder builder = toBuilder(); + builder.setNetworkInterfaces(Lists.transform(networkInterfaces, + new Function() { + @Override + public NetworkInterface apply(NetworkInterface networkInterface) { + return networkInterface.setProjectId(projectId); + } + })); + builder.setAttachedDisks(Lists.transform(attachedDisks, + new Function() { + @Override + public AttachedDisk apply(AttachedDisk attachedDisk) { + return attachedDisk.setProjectId(projectId); + } + })); + return builder.setInstanceId(instanceId.setProjectId(projectId)) + .setMachineType(machineType.setProjectId(projectId)) + .build(); + } + + Instance toPb() { + Instance instancePb = new Instance(); + if (generatedId != null) { + instancePb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + instancePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + instancePb.setName(instanceId.getInstance()); + instancePb.setDescription(description); + instancePb.setSelfLink(instanceId.getSelfLink()); + instancePb.setZone(instanceId.getZoneId().getSelfLink()); + if (status != null) { + instancePb.setStatus(status.name()); + } + instancePb.setStatusMessage(statusMessage); + if (tags != null) { + instancePb.setTags(tags.toPb()); + } + if (machineType != null) { + instancePb.setMachineType(machineType.getSelfLink()); + } + instancePb.setCanIpForward(canIpForward); + if (networkInterfaces != null) { + instancePb.setNetworkInterfaces( + Lists.transform(networkInterfaces, NetworkInterface.TO_PB_FUNCTION)); + } + if (attachedDisks != null) { + instancePb.setDisks(Lists.transform(attachedDisks, AttachedDisk.TO_PB_FUNCTION)); + } + if (metadata != null) { + instancePb.setMetadata(metadata.toPb()); + } + if (serviceAccounts != null) { + instancePb.setServiceAccounts( + Lists.transform(serviceAccounts, ServiceAccount.TO_PB_FUNCTION)); + } + if (schedulingOptions != null) { + instancePb.setScheduling(schedulingOptions.toPb()); + } + instancePb.setCpuPlatform(cpuPlatform); + return instancePb; + } + + /** + * Returns a builder for an {@code InstanceInfo} object given the instance identity and the + * machine type. + */ + public static Builder newBuilder(InstanceId instanceId, MachineTypeId machineType) { + return new BuilderImpl(instanceId).setMachineType(machineType); + } + + /** + * Returns an {@code InstanceInfo} object given the instance identity, the machine type, a disk + * to attach to the instance and a network interface. {@code disk} must be a boot disk (i.e. + * {@link AttachedDisk.AttachedDiskConfiguration#boot()} returns {@code true}). + */ + public static InstanceInfo of(InstanceId instanceId, MachineTypeId machineType, AttachedDisk disk, + NetworkInterface networkInterface) { + return newBuilder(instanceId, machineType) + .setAttachedDisks(ImmutableList.of(disk)) + .setNetworkInterfaces(ImmutableList.of(networkInterface)) + .build(); + } + + static InstanceInfo fromPb(Instance instancePb) { + return new BuilderImpl(instancePb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java new file mode 100644 index 000000000000..c848aca8fda8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/License.java @@ -0,0 +1,92 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.io.Serializable; +import java.util.Objects; + +/** + * A Google Compute Engine License. A License represents a software license. Licenses are used to + * track software usage in images, persistent disks, snapshots, and virtual machine instances. + * + * @see Licenses + */ +public class License implements Serializable { + + private static final long serialVersionUID = 6907923910319640363L; + + private final LicenseId licenseId; + private final Boolean chargesUseFee; + + License(LicenseId licenseId, Boolean chargesUseFee) { + this.licenseId = checkNotNull(licenseId); + this.chargesUseFee = chargesUseFee; + } + + /** + * Returns the identity of the license. + */ + public LicenseId getLicenseId() { + return licenseId; + } + + /** + * Returns {@code true} if the customer will be charged a license fee for running software that + * contains this license on an instance. + */ + public Boolean chargesUseFee() { + return chargesUseFee; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("licenseId", licenseId) + .add("chargesUseFee", chargesUseFee) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(licenseId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(License.class) + && Objects.equals(toPb(), ((License) obj).toPb()); + } + + com.google.api.services.compute.model.License toPb() { + com.google.api.services.compute.model.License licensePb = + new com.google.api.services.compute.model.License(); + licensePb.setName(licenseId.getLicense()); + licensePb.setChargesUseFee(chargesUseFee); + licensePb.setSelfLink(licenseId.getSelfLink()); + return licensePb; + } + + static License fromPb(com.google.api.services.compute.model.License licensePb) { + return new License(LicenseId.fromUrl(licensePb.getSelfLink()), licensePb.getChargesUseFee()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java new file mode 100644 index 000000000000..310492769b8d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/LicenseId.java @@ -0,0 +1,128 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine license. + */ +public final class LicenseId extends ResourceId { + + static final Function FROM_URL_FUNCTION = new Function() { + @Override + public LicenseId apply(String pb) { + return LicenseId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = new Function() { + @Override + public String apply(LicenseId licenseId) { + return licenseId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "global/licenses/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -2239484554024469651L; + + private final String license; + + private LicenseId(String project, String license) { + super(project); + this.license = checkNotNull(license); + } + + /** + * Returns the name of the license. + */ + public String getLicense() { + return license; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/licenses/" + license; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("license", license); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), license); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof LicenseId)) { + return false; + } + LicenseId other = (LicenseId) obj; + return baseEquals(other) && Objects.equals(license, other.license); + } + + @Override + LicenseId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return LicenseId.of(projectId, license); + } + + /** + * Returns a license identity given the license name. + */ + public static LicenseId of(String license) { + return new LicenseId(null, license); + } + + /** + * Returns a license identity given project and license names. + */ + public static LicenseId of(String project, String license) { + return new LicenseId(project, license); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a license URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static LicenseId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid license URL"); + } + return LicenseId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java new file mode 100644 index 000000000000..795a534c4c73 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineType.java @@ -0,0 +1,323 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.services.compute.model.MachineType.ScratchDisks; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine machine type. A machine type determine the virtualized hardware + * specifications of your virtual machine instances, such as the amount of memory or number of + * virtual CPUs. + * + * @see Machine Types + */ +public class MachineType implements Serializable { + + static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public MachineType apply(com.google.api.services.compute.model.MachineType pb) { + return MachineType.fromPb(pb); + } + }; + static final Function + TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.MachineType apply(MachineType type) { + return type.toPb(); + } + }; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private static final long serialVersionUID = -4210962597502860450L; + + private final MachineTypeId machineTypeId; + private final String generatedId; + private final Long creationTimestamp; + private final String description; + private final Integer cpus; + private final Integer memoryMb; + private final List scratchDisksSizeGb; + private final Integer maximumPersistentDisks; + private final Long maximumPersistentDisksSizeGb; + private final DeprecationStatus deprecationStatus; + + static final class Builder { + + private MachineTypeId machineTypeId; + private String generatedId; + private Long creationTimestamp; + private String description; + private Integer cpus; + private Integer memoryMb; + private List scratchDisksSizeGb; + private Integer maximumPersistentDisks; + private Long maximumPersistentDisksSizeGb; + private DeprecationStatus deprecationStatus; + + private Builder() {} + + Builder setMachineTypeId(MachineTypeId machineTypeId) { + this.machineTypeId = machineTypeId; + return this; + } + + Builder setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + Builder setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Builder setCpus(Integer cpus) { + this.cpus = cpus; + return this; + } + + Builder setMemoryMb(Integer memoryMb) { + this.memoryMb = memoryMb; + return this; + } + + Builder setScratchDisksSizeGb(List scratchDisksSizeGb) { + this.scratchDisksSizeGb = scratchDisksSizeGb; + return this; + } + + Builder setMaximumPersistentDisks(Integer maximumPersistentDisks) { + this.maximumPersistentDisks = maximumPersistentDisks; + return this; + } + + Builder setMaximumPersistentDisksSizeGb(Long maximumPersistentDisksSizeGb) { + this.maximumPersistentDisksSizeGb = maximumPersistentDisksSizeGb; + return this; + } + + Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { + this.deprecationStatus = deprecationStatus; + return this; + } + + MachineType build() { + return new MachineType(this); + } + } + + private MachineType(Builder builder) { + this.machineTypeId = builder.machineTypeId; + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.description = builder.description; + this.cpus = builder.cpus; + this.memoryMb = builder.memoryMb; + this.scratchDisksSizeGb = builder.scratchDisksSizeGb; + this.maximumPersistentDisks = builder.maximumPersistentDisks; + this.maximumPersistentDisksSizeGb = builder.maximumPersistentDisksSizeGb; + this.deprecationStatus = builder.deprecationStatus; + } + + /** + * Returns the machine type's identity. + */ + public MachineTypeId getMachineTypeId() { + return machineTypeId; + } + + /** + * Returns the service-generated unique identifier for the machine type. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns an optional textual description of the machine type. + */ + public String getDescription() { + return description; + } + + /** + * Returns the number of virtual CPUs that are available to the instance. + */ + public Integer getCpus() { + return cpus; + } + + /** + * Returns the amount of physical memory available to the instance, defined in MB. + */ + public Integer getMemoryMb() { + return memoryMb; + } + + /** + * Returns the size of all extended scratch disks assigned to the instance, defined in GB. + */ + public List getScratchDisksSizeGb() { + return scratchDisksSizeGb; + } + + /** + * Returns the maximum number of persistent disks allowed by this instance type. + */ + public Integer getMaximumPersistentDisks() { + return maximumPersistentDisks; + } + + /** + * Returns the maximum total persistent disks size allowed, defined in GB. + */ + public Long getMaximumPersistentDisksSizeGb() { + return maximumPersistentDisksSizeGb; + } + + /** + * Returns the deprecation status of the machine type. If {@link DeprecationStatus#getStatus()} is + * either {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} + * the machine type should not be used. Returns {@code null} if the machine type is not + * deprecated. + */ + public DeprecationStatus getDeprecationStatus() { + return deprecationStatus; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("machineTypeId", machineTypeId) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("description", description) + .add("cpus", cpus) + .add("memoryMb", memoryMb) + .add("scratchDisksSizeGb", scratchDisksSizeGb) + .add("maximumPersistentDisks", maximumPersistentDisks) + .add("maximumPersistentDisksSizeGb", maximumPersistentDisksSizeGb) + .add("deprecationStatus", deprecationStatus) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(machineTypeId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(MachineType.class) + && Objects.equals(toPb(), ((MachineType) obj).toPb()); + } + + com.google.api.services.compute.model.MachineType toPb() { + com.google.api.services.compute.model.MachineType machineTypePb = + new com.google.api.services.compute.model.MachineType(); + if (generatedId != null) { + machineTypePb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + machineTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + machineTypePb.setName(machineTypeId.getType()); + machineTypePb.setDescription(description); + machineTypePb.setSelfLink(machineTypeId.getSelfLink()); + machineTypePb.setGuestCpus(cpus); + machineTypePb.setMemoryMb(memoryMb); + if (scratchDisksSizeGb != null) { + machineTypePb.setScratchDisks(Lists.transform(scratchDisksSizeGb, + new Function() { + @Override + public ScratchDisks apply(Integer diskSize) { + return new ScratchDisks().setDiskGb(diskSize); + } + })); + } + machineTypePb.setMaximumPersistentDisks(maximumPersistentDisks); + machineTypePb.setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb); + machineTypePb.setZone(machineTypeId.getZoneId().getZone()); + if (deprecationStatus != null) { + machineTypePb.setDeprecated(deprecationStatus.toPb()); + } + return machineTypePb; + } + + static Builder newBuilder() { + return new Builder(); + } + + static MachineType fromPb(com.google.api.services.compute.model.MachineType machineTypePb) { + Builder builder = newBuilder(); + builder.setMachineTypeId(MachineTypeId.fromUrl(machineTypePb.getSelfLink())); + if (machineTypePb.getId() != null) { + builder.setGeneratedId(machineTypePb.getId().toString()); + } + if (machineTypePb.getCreationTimestamp() != null) { + builder.setCreationTimestamp( + TIMESTAMP_FORMATTER.parseMillis(machineTypePb.getCreationTimestamp())); + } + builder.setDescription(machineTypePb.getDescription()); + builder.setCpus(machineTypePb.getGuestCpus()); + builder.setMemoryMb(machineTypePb.getMemoryMb()); + if (machineTypePb.getScratchDisks() != null) { + builder.setScratchDisksSizeGb( + Lists.transform(machineTypePb.getScratchDisks(), new Function() { + @Override + public Integer apply(ScratchDisks scratchDiskPb) { + return scratchDiskPb.getDiskGb(); + } + })); + } + builder.setMaximumPersistentDisks(machineTypePb.getMaximumPersistentDisks()); + builder.setMaximumPersistentDisksSizeGb(machineTypePb.getMaximumPersistentDisksSizeGb()); + if (machineTypePb.getDeprecated() != null) { + builder.setDeprecationStatus( + DeprecationStatus.fromPb(machineTypePb.getDeprecated(), MachineTypeId.FROM_URL_FUNCTION)); + } + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java new file mode 100644 index 000000000000..d5838a0e53f8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java @@ -0,0 +1,148 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine machine type. + */ +public final class MachineTypeId extends ResourceId { + + static final Function FROM_URL_FUNCTION = + new Function() { + @Override + public MachineTypeId apply(String pb) { + return MachineTypeId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = + new Function() { + @Override + public String apply(MachineTypeId machineTypeId) { + return machineTypeId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/machineTypes/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -5819598544478859608L; + + private final String zone; + private final String type; + + private MachineTypeId(String project, String zone, String type) { + super(project); + this.zone = checkNotNull(zone); + this.type = checkNotNull(type); + } + + /** + * Returns the name of the machine type. + */ + public String getType() { + return type; + } + + /** + * Returns the name of the zone this machine type belongs to. + */ + public String getZone() { + return zone; + } + + /** + * Returns the identity of the zone this machine type belongs to. + */ + public ZoneId getZoneId() { + return ZoneId.of(getProject(), zone); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/zones/" + zone + "/machineTypes/" + type; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("zone", zone).add("type", type); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), zone, type); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof MachineTypeId)) { + return false; + } + MachineTypeId other = (MachineTypeId) obj; + return baseEquals(other) + && Objects.equals(zone, other.zone) + && Objects.equals(type, other.type); + } + + @Override + MachineTypeId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return MachineTypeId.of(projectId, zone, type); + } + + /** + * Returns a machine type identity given the zone and type names. + */ + public static MachineTypeId of(String zone, String type) { + return new MachineTypeId(null, zone, type); + } + + /** + * Returns a machine type identity given project, zone and type names. + */ + public static MachineTypeId of(String project, String zone, String type) { + return new MachineTypeId(project, zone, type); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a machine type URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static MachineTypeId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid machine type URL"); + } + return MachineTypeId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java new file mode 100644 index 000000000000..1584fb765377 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Metadata.java @@ -0,0 +1,212 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Metadata for Google Compute Engine Instance as ket/value pairs. This includes custom metadata + * and predefined keys. + * + * @see Metadata + */ +public final class Metadata implements Serializable { + + static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public Metadata apply(com.google.api.services.compute.model.Metadata pb) { + return Metadata.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Metadata apply(Metadata metadata) { + return metadata.toPb(); + } + }; + + private static final long serialVersionUID = -945038809838910107L; + + private final Map values; + private final String fingerprint; + + /** + * A builder for {@code Metadata} objects. + */ + public static final class Builder { + + private Map values; + private String fingerprint; + + Builder() { + values = Maps.newHashMap(); + } + + Builder(Metadata metadata) { + this.values = metadata.values != null ? Maps.newHashMap(metadata.values) + : Maps.newHashMap(); + this.fingerprint = metadata.fingerprint; + } + + /** + * Sets the metadata for the instance as key/value pairs. The total size of all keys and + * values must be less than 512 KB. Keys must conform to the following regexp: + * {@code [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. Values must be less than or equal to 32768 bytes. + */ + public Builder setValues(Map values) { + this.values = Maps.newHashMap(checkNotNull(values)); + return this; + } + + /** + * Adds a key/value pair to the instance metadata. The total size of all keys and values must + * be less than 512 KB. Keys must conform to the following regexp: {@code [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. Values must be less than or equal to 32768 bytes. + */ + public Builder add(String key, String value) { + this.values.put(key, value); + return this; + } + + /** + * Sets the fingerprint for the metadata. This value can be used to update instance's + * metadata. + */ + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Creates a {@code Metadata} object. + */ + public Metadata build() { + return new Metadata(this); + } + } + + private Metadata(Builder builder) { + this.values = ImmutableMap.copyOf(builder.values); + this.fingerprint = builder.fingerprint; + } + + /** + * Returns instance's metadata as key/value pairs. + */ + public Map getValues() { + return values; + } + + /** + * Returns the fingerprint for the metadata. This value can be used to update instance's + * metadata. + */ + public String getFingerprint() { + return fingerprint; + } + + /** + * Returns a builder for the current instance metadata. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("values", values) + .add("fingerprint", fingerprint) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(values, fingerprint); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof Metadata + && Objects.equals(toPb(), ((Metadata) obj).toPb()); + } + + com.google.api.services.compute.model.Metadata toPb() { + com.google.api.services.compute.model.Metadata metadataPb = + new com.google.api.services.compute.model.Metadata(); + metadataPb.setFingerprint(fingerprint); + List itemsPb = + Lists.newArrayListWithCapacity(values.size()); + for (Map.Entry entry : values.entrySet()) { + itemsPb.add(new com.google.api.services.compute.model.Metadata.Items() + .setKey(entry.getKey()).setValue(entry.getValue())); + } + metadataPb.setItems(itemsPb); + metadataPb.setFingerprint(fingerprint); + return metadataPb; + } + + /** + * Returns a builder for a {@code Metadata} object. + */ + public static Builder newBuilder() { + return new Builder(); + } + + /** + * Returns a {@code Metadata} object given the the metadata as a map. The total size of all keys + * and values must be less than 512 KB. Keys must conform to the following regexp: + * {@code [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. Values must be less than or equal to 32768 bytes. + */ + public static Metadata of(Map values) { + return newBuilder().setValues(values).build(); + } + + static Metadata fromPb(com.google.api.services.compute.model.Metadata metadataPb) { + Builder builder = newBuilder(); + if (metadataPb.getItems() != null) { + Map metadataValues = + Maps.newHashMapWithExpectedSize(metadataPb.getItems().size()); + for (com.google.api.services.compute.model.Metadata.Items item : metadataPb.getItems()) { + metadataValues.put(item.getKey(), item.getValue()); + } + builder.setValues(metadataValues); + } + return builder.setFingerprint(metadataPb.getFingerprint()).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java new file mode 100644 index 000000000000..84ae46e7f956 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Network.java @@ -0,0 +1,194 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.Compute.NetworkOption; +import com.google.cloud.compute.deprecated.Compute.OperationOption; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Objects; + +/** + * A Google Compute Engine Network. Every virtual machine instance is created as a member of a + * network. Networks connect instances to each other and to the Internet. You can segment your + * networks, use firewall rules to restrict access to instances, and create static routes to forward + * traffic to specific destinations. Objects of this class are immutable. To get a {@code Network} + * object with the most recent information use {@link #reload}. {@code Network} adds a layer of + * service-related functionality over {@link NetworkInfo}. + * + * @see Using Networks and Firewalls + */ +public class Network extends NetworkInfo { + + private static final long serialVersionUID = 8608280908101278096L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Network} objects. + */ + public static class Builder extends NetworkInfo.Builder { + + private final Compute compute; + private final NetworkInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, NetworkId networkId, NetworkConfiguration configuration) { + this.compute = compute; + this.infoBuilder = new NetworkInfo.BuilderImpl(networkId, configuration); + this.infoBuilder.setNetworkId(networkId); + this.infoBuilder.setConfiguration(configuration); + } + + Builder(Network subnetwork) { + this.compute = subnetwork.compute; + this.infoBuilder = new NetworkInfo.BuilderImpl(subnetwork); + } + + @Override + Builder setGeneratedId(String generatedId) { + infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + infoBuilder.setCreationTimestamp(creationTimestamp); + return this; + } + + @Override + public Builder setNetworkId(NetworkId networkId) { + infoBuilder.setNetworkId(networkId); + return this; + } + + @Override + public Builder setDescription(String description) { + infoBuilder.setDescription(description); + return this; + } + + @Override + public Builder setConfiguration(NetworkConfiguration configuration) { + infoBuilder.setConfiguration(configuration); + return this; + } + + @Override + public Network build() { + return new Network(compute, infoBuilder); + } + } + + Network(Compute compute, NetworkInfo.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this network exists. + * + * @return {@code true} if this network exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(NetworkOption.fields()) != null; + } + + /** + * Fetches current network' latest information. Returns {@code null} if the network does not + * exist. + * + * @param options network options + * @return a {@code Network} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Network reload(NetworkOption... options) { + return compute.getNetwork(getNetworkId().getNetwork(), options); + } + + /** + * Deletes this network. + * + * @return an operation object if delete request was successfully sent, {@code null} if the + * network was not found + * @throws ComputeException upon failure + */ + public Operation delete(OperationOption... options) { + return compute.deleteNetwork(getNetworkId().getNetwork(), options); + } + + /** + * Creates a subnetwork for this network given its identity and the range of IPv4 addresses in + * CIDR format. Subnetwork creation is only supported for networks in "custom subnet mode" (i.e. + * {@link #getConfiguration()} returns a {@link SubnetNetworkConfiguration}) with automatic + * creation of subnetworks disabled (i.e. {@link SubnetNetworkConfiguration#autoCreateSubnetworks()} + * returns {@code false}). + * + * @return an operation object if creation request was successfully sent + * @throws ComputeException upon failure + * @see CIDR + */ + public Operation createSubnetwork(SubnetworkId subnetworkId, String ipRange, + OperationOption... options) { + return compute.create(SubnetworkInfo.of(subnetworkId, getNetworkId(), ipRange), options); + } + + /** + * Returns the network's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Network.class)) { + return false; + } + Network other = (Network) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Network fromPb(Compute compute, + com.google.api.services.compute.model.Network networkPb) { + return new Network(compute, new NetworkInfo.BuilderImpl(networkPb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java new file mode 100644 index 000000000000..8ccc947b950f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkConfiguration.java @@ -0,0 +1,98 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.services.compute.model.Network; +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Base class for Google Compute Engine network configuration. Use + * {@link StandardNetworkConfiguration} to create a standard network with associated address range. + * Use {@link SubnetNetworkConfiguration} to create a network that supports subnetworks, up to one + * per region, each with its own address range. + * + * @see Using Networks and Firewalls + */ +public abstract class NetworkConfiguration implements Serializable { + + private static final long serialVersionUID = 6599798536784576564L; + + private final Type type; + + /** + * Type of a Google Compute Engine disk configuration. + */ + public enum Type { + /** + * A Google Compute Engine network with no subnetworks. + */ + STANDARD, + + /** + * A Google Compute Engine network that supports the creation of subnetworks (either automatic + * or manual). + */ + SUBNET + } + + NetworkConfiguration(Type type) { + this.type = type; + } + + /** + * Returns the network's type. This method returns {@link Type#STANDARD} for a standard networks + * with no subnetworks. This method returns {@link Type#SUBNET} for a network that supports the + * creation of subnetworks (either automatic or manual). + */ + public Type getType() { + return type; + } + + ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("type", type); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + final int baseHashCode() { + return Objects.hash(type); + } + + final boolean baseEquals(NetworkConfiguration networkConfiguration) { + return networkConfiguration != null + && getClass().equals(networkConfiguration.getClass()) + && Objects.equals(toPb(), networkConfiguration.toPb()); + } + + abstract Network toPb(); + + @SuppressWarnings("unchecked") + static T fromPb(Network networkPb) { + if (networkPb.getIPv4Range() != null) { + return (T) StandardNetworkConfiguration.fromPb(networkPb); + } else { + return (T) SubnetNetworkConfiguration.fromPb(networkPb); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java new file mode 100644 index 000000000000..111732e0c338 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkId.java @@ -0,0 +1,137 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects.ToStringHelper; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine network. + */ +public final class NetworkId extends ResourceId { + + private static final String REGEX = ResourceId.REGEX + "global/networks/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 2386765228138819506L; + + private final String network; + + NetworkId(String project, String network) { + super(project); + this.network = checkNotNull(network); + } + + private NetworkId(NetworkId networkId) { + super(networkId.getProject()); + this.network = checkNotNull(networkId.getNetwork()); + } + + /** + * Returns the name of the network. The network name must be 1-63 characters long and comply with + * RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getNetwork() { + return network; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/networks/" + network; + } + + @Override + ToStringHelper toStringHelper() { + return super.toStringHelper().add("network", network); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), network); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof NetworkId)) { + return false; + } + NetworkId other = (NetworkId) obj; + return baseEquals(other) && Objects.equals(network, other.network); + } + + @Override + NetworkId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return NetworkId.of(projectId, network); + } + + /** + * Returns a new network identity given project and network names. The network name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static NetworkId of(String project, String network) { + return new NetworkId(project, network); + } + + /** + * Returns a new network identity given network name. The network name must be 1-63 characters + * long and comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public static NetworkId of(String network) { + return NetworkId.of(null, network); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a network URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static NetworkId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid network URL"); + } + return NetworkId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java new file mode 100644 index 000000000000..722ef57f1231 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java @@ -0,0 +1,291 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Network; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Objects; + +/** + * A Google Compute Engine Network. Every virtual machine instance is created as a member of a + * network. Networks connect instances to each other and to the Internet. You can segment your + * networks, use firewall rules to restrict access to instances, and create static routes to forward + * traffic to specific destinations. + * + *

A network lives in a project and is isolated from other networks in the project. A project can + * have up to five different networks. + * + * @see Using Networks and Firewalls + */ +public class NetworkInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public NetworkInfo apply(Network pb) { + return NetworkInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Network apply(NetworkInfo network) { + return network.toPb(); + } + }; + + private static final long serialVersionUID = 4336912581538114026L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final NetworkId networkId; + private final Long creationTimestamp; + private final String description; + private final NetworkConfiguration configuration; + + /** + * A builder for {@code NetworkInfo} objects. + */ + public abstract static class Builder { + + abstract Builder setGeneratedId(String generatedId); + + abstract Builder setCreationTimestamp(Long creationTimestamp); + + /** + * Sets the identity of the network. + */ + public abstract Builder setNetworkId(NetworkId networkId); + + /** + * Sets an optional textual description of the network. + */ + public abstract Builder setDescription(String description); + + /** + * Sets the network configuration. Use {@link StandardNetworkConfiguration} to create a standard + * network with associated IPv4 range. Use {@link SubnetNetworkConfiguration} to create a + * network that could be divided into subnetworks, up to one per region, each with its own + * address range. + */ + public abstract Builder setConfiguration(NetworkConfiguration configuration); + + /** + * Creates a {@code NetworkInfo} object. + */ + public abstract NetworkInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String generatedId; + private NetworkId networkId; + private Long creationTimestamp; + private String description; + private NetworkConfiguration configuration; + + BuilderImpl(NetworkId networkId, NetworkConfiguration configuration) { + this.networkId = checkNotNull(networkId); + this.configuration = checkNotNull(configuration); + } + + BuilderImpl(NetworkInfo networkInfo) { + this.generatedId = networkInfo.generatedId; + this.creationTimestamp = networkInfo.creationTimestamp; + this.networkId = networkInfo.networkId; + this.description = networkInfo.description; + this.configuration = networkInfo.configuration; + } + + BuilderImpl(Network networkPb) { + if (networkPb.getId() != null) { + this.generatedId = networkPb.getId().toString(); + } + if (networkPb.getCreationTimestamp() != null) { + this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(networkPb.getCreationTimestamp()); + } + this.networkId = NetworkId.fromUrl(networkPb.getSelfLink()); + this.description = networkPb.getDescription(); + this.configuration = NetworkConfiguration.fromPb(networkPb); + } + + @Override + BuilderImpl setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + BuilderImpl setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + public BuilderImpl setNetworkId(NetworkId networkId) { + this.networkId = checkNotNull(networkId); + return this; + } + + @Override + public BuilderImpl setDescription(String description) { + this.description = description; + return this; + } + + @Override + public BuilderImpl setConfiguration(NetworkConfiguration configuration) { + this.configuration = checkNotNull(configuration); + return this; + } + + @Override + public NetworkInfo build() { + return new NetworkInfo(this); + } + } + + NetworkInfo(BuilderImpl builder) { + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.networkId = builder.networkId; + this.description = builder.description; + this.configuration = builder.configuration; + } + + /** + * Returns the service-generated unique identifier for the network. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns the network identity. + */ + public NetworkId getNetworkId() { + return networkId; + } + + /** + * Returns a textual description of the network. + */ + public String getDescription() { + return description; + } + + /** + * Returns the network configuration. Returns a {@link StandardNetworkConfiguration} for standard + * networks with associated IPv4 range. Returns {@link SubnetNetworkConfiguration} for networks + * that could be divided into subnetworks, up to one per region, each with its own address range. + */ + @SuppressWarnings("unchecked") + public T getConfiguration() { + return (T) configuration; + } + + /** + * Returns a builder for the current network. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("networkId", networkId) + .add("description", description) + .add("configuration", configuration) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(generatedId, networkId, creationTimestamp, description, configuration); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(NetworkInfo.class) + && Objects.equals(toPb(), ((NetworkInfo) obj).toPb()); + } + + NetworkInfo setProjectId(String projectId) { + return toBuilder() + .setNetworkId(networkId.setProjectId(projectId)) + .build(); + } + + Network toPb() { + Network networkPb = configuration.toPb(); + if (generatedId != null) { + networkPb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + networkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + networkPb.setName(networkId.getNetwork()); + networkPb.setDescription(description); + networkPb.setSelfLink(networkId.getSelfLink()); + return networkPb; + } + + /** + * Returns a builder for a {@code NetworkInfo} object given the network identity and its + * configuration. Use {@link StandardNetworkConfiguration} to create a standard network with + * associated address range. Use {@link SubnetNetworkConfiguration} to create a network that + * supports subnetworks, up to one per region, each with its own address range. + */ + public static Builder newBuilder(NetworkId networkId, NetworkConfiguration configuration) { + return new BuilderImpl(networkId, configuration); + } + + /** + * Returns a {@code NetworkInfo} object given the network identity. Use + * {@link StandardNetworkConfiguration} to create a standard network with associated address + * range. Use {@link SubnetNetworkConfiguration} to create a network that supports subnetworks, up + * to one per region, each with its own address range. + */ + public static NetworkInfo of(NetworkId networkId, NetworkConfiguration configuration) { + return newBuilder(networkId, configuration).build(); + } + + static NetworkInfo fromPb(Network networkPb) { + return new BuilderImpl(networkPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java new file mode 100644 index 000000000000..316611af24d7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInterface.java @@ -0,0 +1,548 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.ApiFunction; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * A network interface for a Google Compute Engine instance. Network interfaces specify how + * the instance is configured to interact with other network services, such as connecting to the + * internet. + * + * @see Configuring an + * Instance's IP Addresses + */ +public class NetworkInterface implements Serializable { + + static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public NetworkInterface apply( + com.google.api.services.compute.model.NetworkInterface pb) { + return NetworkInterface.fromPb(pb); + } + }; + static final Function + TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.NetworkInterface apply( + NetworkInterface networkInterface) { + return networkInterface.toPb(); + } + }; + + private static final long serialVersionUID = 936741262053605581L; + + private final String name; + private final NetworkId network; + private final String networkIp; + private final SubnetworkId subnetwork; + private final List accessConfigurations; + + /** + * Access configuration for a Google Compute Engine instance's network interface. Objects of this + * class can be used to assign either a static or an ephemeral external IP address to Google + * Compute Engine instances. + * + * @see + * Static external IP addresses + * @see + * Ephemeral external IP addresses + */ + public static final class AccessConfig implements Serializable { + + static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public AccessConfig apply(com.google.api.services.compute.model.AccessConfig pb) { + return AccessConfig.fromPb(pb); + } + }; + static final Function + TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.AccessConfig apply( + AccessConfig instance) { + return instance.toPb(); + } + }; + + private static final long serialVersionUID = -5438060668934041567L; + + private final String name; + private final String natIp; + private final Type type; + + /** + * The type of network access configuration. The only supported value is {@code ONE_TO_ONE_NAT}. + */ + public static final class Type extends StringEnumValue { + private static final long serialVersionUID = -1181560540824208967L; + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public Type apply(String constant) { + return new Type(constant); + } + }; + + private static final StringEnumType type = new StringEnumType( + Type.class, + CONSTRUCTOR); + + public static final Type ONE_TO_ONE_NAT = type.createAndRegister("ONE_TO_ONE_NAT"); + + private Type(String constant) { + super(constant); + } + + /** + * Get the Type for the given String constant, and throw an exception if the constant is + * not recognized. + */ + public static Type valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** + * Get the Type for the given String constant, and allow unrecognized values. + */ + public static Type valueOf(String constant) { + return type.valueOf(constant); + } + + /** + * Return the known values for Type. + */ + public static Type[] values() { + return type.values(); + } + } + + public static final class Builder { + + private String name; + private String natIp; + private Type type; + + private Builder() {} + + private Builder(AccessConfig accessConfig) { + this.name = accessConfig.name; + this.natIp = accessConfig.natIp; + this.type = accessConfig.type; + } + + /** + * Sets the name of the access configuration. + */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** + * Sets 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. + * + * @see + * Ephemeral external IP addresses + * @see + * Ephemeral external IP addresses + */ + public Builder setNatIp(String natIp) { + this.natIp = natIp; + return this; + } + + /** + * Sets the type of the access configuration. The only supported value is + * {@link Type#ONE_TO_ONE_NAT}. + */ + public Builder setType(Type type) { + this.type = type; + return this; + } + + /** + * Creates an {@code AccessConfig} object. + */ + public AccessConfig build() { + return new AccessConfig(this); + } + } + + AccessConfig(Builder builder) { + this.name = builder.name; + this.natIp = builder.natIp; + this.type = builder.type; + } + + /** + * Returns the name of the access configuration. + */ + public String getName() { + return name; + } + + /** + * Returns an external IP address associated with this instance. + */ + public String getNatIp() { + return natIp; + } + + /** + * Returns the type of network access configuration. The only supported value is + * {@link Type#ONE_TO_ONE_NAT}. + */ + public Type getType() { + return type; + } + + /** + * Returns a builder for the current access configuration. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("name", name) + .add("natIp", natIp) + .add("type", type) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(name, natIp, type); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof AccessConfig + && Objects.equals(toPb(), ((AccessConfig) obj).toPb()); + } + + com.google.api.services.compute.model.AccessConfig toPb() { + com.google.api.services.compute.model.AccessConfig accessConfigPb = + new com.google.api.services.compute.model.AccessConfig(); + accessConfigPb.setName(name); + accessConfigPb.setNatIP(natIp); + if (type != null) { + accessConfigPb.setType(type.name()); + } + return accessConfigPb; + } + + /** + * Returns a builder for an {@code AccessConfig} object. + */ + public static Builder newBuilder() { + return new Builder(); + } + + /** + * Returns an {@code AccessConfig} object given the static external IP address. + * + * @see + * Static external IP addresses + */ + public static AccessConfig of(String natIp) { + return newBuilder().setNatIp(natIp).build(); + } + + /** + * Returns an {@code AccessConfig} object. IP address for this access configuration will be + * taken from a pool of ephemeral addresses. + * + * @see + * Ephemeral external IP addresses + */ + public static AccessConfig of() { + return newBuilder().build(); + } + + static AccessConfig fromPb(com.google.api.services.compute.model.AccessConfig configPb) { + Builder builder = newBuilder(); + builder.setName(configPb.getName()); + if (configPb.getNatIP() != null) { + builder.setNatIp(configPb.getNatIP()); + } + if (configPb.getType() != null) { + builder.setType(Type.valueOf(configPb.getType())); + } + return builder.build(); + } + } + + public static final class Builder { + + private String name; + private NetworkId network; + private String networkIp; + private SubnetworkId subnetwork; + private List accessConfigurations; + + private Builder(NetworkId network) { + this.network = checkNotNull(network); + } + + private Builder(NetworkInterface networkInterface) { + this.name = networkInterface.name; + this.network = networkInterface.network; + this.networkIp = networkInterface.networkIp; + this.subnetwork = networkInterface.subnetwork; + this.accessConfigurations = networkInterface.accessConfigurations; + } + + Builder setName(String name) { + this.name = name; + return this; + } + + /** + * Sets the identity of the network this interface applies to. + */ + public Builder setNetwork(NetworkId network) { + this.network = checkNotNull(network); + return this; + } + + Builder setNetworkIp(String networkIp) { + this.networkIp = networkIp; + return this; + } + + /** + * Sets the identity of the subnetwork this interface applies to. Setting the subnetwork is + * not necessary when the network is in "automatic subnet mode". + */ + public Builder setSubnetwork(SubnetworkId subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + /** + * Sets a list of access configurations for the network interface. Access configurations can be + * used to assign either a static or an ephemeral external IP address to Google Compute Engine + * instances. At the moment, network interfaces only support one access configuration. + * + * @see + * Static external IP addresses + * @see + * Ephemeral external IP addresses + */ + public Builder setAccessConfigurations(List accessConfigurations) { + this.accessConfigurations = ImmutableList.copyOf(accessConfigurations); + return this; + } + + /** + * Sets a list of access configurations for the network interface. Access configurations can be + * used to assign either a static or an ephemeral external IP address to Google Compute Engine + * instances. At the moment, network interfaces only support one access configuration. + * + * @see + * Static external IP addresses + * @see + * Ephemeral external IP addresses + */ + public Builder setAccessConfigurations(AccessConfig... accessConfigurations) { + setAccessConfigurations(Arrays.asList(accessConfigurations)); + return this; + } + + /** + * Creates a {@code NetworkInterface} object. + */ + public NetworkInterface build() { + return new NetworkInterface(this); + } + } + + private NetworkInterface(Builder builder) { + this.name = builder.name; + this.network = builder.network; + this.networkIp = builder.networkIp; + this.subnetwork = builder.subnetwork; + this.accessConfigurations = builder.accessConfigurations != null + ? builder.accessConfigurations : ImmutableList.of(); + } + + /** + * Returns the name of the network interface, generated by the service. For network devices, + * these are {@code eth0}, {@code eth1}, etc. + */ + public String getName() { + return name; + } + + /** + * Returns the identity of the network this interface applies to. + */ + public NetworkId getNetwork() { + return network; + } + + /** + * An optional IPv4 internal network address assigned by the service to the instance for this + * network interface. + */ + public String getNetworkIp() { + return networkIp; + } + + /** + * Returns the identity of the subnetwork this interface applies to. + */ + public SubnetworkId getSubnetwork() { + return subnetwork; + } + + /** + * Returns a list of access configurations for the network interface. + */ + public List getAccessConfigurations() { + return accessConfigurations; + } + + /** + * Returns a builder for the current network interface. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("name", name) + .add("network", network) + .add("networkIp", networkIp) + .add("subnetwork", subnetwork) + .add("accessConfigurations", accessConfigurations) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(name, network, networkIp, subnetwork, accessConfigurations); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(NetworkInterface.class) + && Objects.equals(toPb(), ((NetworkInterface) obj).toPb()); + } + + com.google.api.services.compute.model.NetworkInterface toPb() { + com.google.api.services.compute.model.NetworkInterface interfacePb = + new com.google.api.services.compute.model.NetworkInterface(); + interfacePb.setName(name); + interfacePb.setNetwork(network.getSelfLink()); + if (subnetwork != null) { + interfacePb.setSubnetwork(subnetwork.getSelfLink()); + } + interfacePb.setNetworkIP(networkIp); + if (accessConfigurations != null) { + interfacePb.setAccessConfigs( + Lists.transform(accessConfigurations, AccessConfig.TO_PB_FUNCTION)); + } + return interfacePb; + } + + NetworkInterface setProjectId(String projectId) { + Builder builder = toBuilder(); + builder.setNetwork(network.setProjectId(projectId)); + if (subnetwork != null) { + builder.setSubnetwork(subnetwork.setProjectId(projectId)); + } + return builder.build(); + } + + /** + * Returns a builder for a {@code NetworkInterface} object given the network's identity. + */ + public static Builder newBuilder(NetworkId networkId) { + return new Builder(networkId); + } + + /** + * Returns a builder for a {@code NetworkInterface} object given the network's name. + */ + public static Builder newBuilder(String network) { + return newBuilder(NetworkId.of(network)); + } + + /** + * Returns a {@code NetworkInterface} object given the network's identity. + */ + public static NetworkInterface of(NetworkId networkId) { + return newBuilder(networkId).build(); + } + + /** + * Returns a {@code NetworkInterface} object given the network's name. + */ + public static NetworkInterface of(String network) { + return newBuilder(network).build(); + } + + static NetworkInterface fromPb( + com.google.api.services.compute.model.NetworkInterface interfacePb) { + Builder builder = newBuilder(NetworkId.fromUrl(interfacePb.getNetwork())) + .setName(interfacePb.getName()); + if (interfacePb.getSubnetwork() != null) { + builder.setSubnetwork(SubnetworkId.fromUrl(interfacePb.getSubnetwork())); + } + builder.setNetworkIp(interfacePb.getNetworkIP()); + builder.setAccessConfigurations(interfacePb.getAccessConfigs() != null + ? Lists.transform(interfacePb.getAccessConfigs(), AccessConfig.FROM_PB_FUNCTION) : + ImmutableList.of()); + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java new file mode 100644 index 000000000000..363f26fbde5f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java @@ -0,0 +1,845 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.gax.retrying.BasicResultRetryAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.cloud.RetryHelper; +import com.google.cloud.RetryOption; +import com.google.cloud.compute.deprecated.Compute.OperationOption; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.threeten.bp.Duration; + +/** + * Google Compute Engine operations. Operation identity can be obtained via {@link + * #getOperationId()}. {@link #getOperationId()} returns {@link GlobalOperationId} for global + * operations, {@link RegionOperationId} for region operations, and {@link ZoneOperationId} for zone + * operations. To get an {@code Operation} object with the most recent information, use {@link + * #reload(Compute.OperationOption...)}. + */ +public class Operation implements Serializable { + + private static final long serialVersionUID = -8979001444590023899L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final RetrySettings DEFAULT_OPERATION_WAIT_SETTINGS = + RetrySettings.newBuilder() + .setTotalTimeout(Duration.ofHours(12L)) + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.0) + .setJittered(false) + .setMaxRetryDelay(Duration.ofMinutes(500L)) + .build(); + + private transient Compute compute; + private final ComputeOptions options; + private final String generatedId; + private final OperationId operationId; + private final String clientOperationId; + private final String operationType; + private final String targetLink; + private final String targetId; + private final Status status; + private final String statusMessage; + private final String user; + private final Integer progress; + private final Long insertTime; + private final Long startTime; + private final Long endTime; + private final List errors; + private final List warnings; + private final Integer httpErrorStatusCode; + private final String httpErrorMessage; + private final String description; + + /** Status of an operation. */ + public enum Status { + PENDING, + RUNNING, + DONE + } + + /** An error that can occur during the processing of a Google Compute Engine operation. */ + public static final class OperationError implements Serializable { + + static final Function FROM_PB_FUNCTION = new Function< + com.google.api.services.compute.model.Operation.Error.Errors, OperationError>() { + @Override + public OperationError apply( + com.google.api.services.compute.model.Operation.Error.Errors pb) { + return OperationError.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Operation.Error.Errors apply( + OperationError operation) { + return operation.toPb(); + } + }; + + private static final long serialVersionUID = -1155314394806515873L; + + private final String code; + private final String location; + private final String message; + + OperationError(String code, String location, String message) { + this.code = code; + this.location = location; + this.message = message; + } + + /** Returns an error type identifier for this error. */ + public String getCode() { + return code; + } + + /** Returns the field in the request which caused the error. This value is optional. */ + public String getLocation() { + return location; + } + + /** Returns an optional, human-readable error message. */ + public String getMessage() { + return message; + } + + com.google.api.services.compute.model.Operation.Error.Errors toPb() { + return new com.google.api.services.compute.model.Operation.Error.Errors() + .setCode(code) + .setLocation(location) + .setMessage(message); + } + + static OperationError fromPb( + com.google.api.services.compute.model.Operation.Error.Errors errorPb) { + return new OperationError(errorPb.getCode(), errorPb.getLocation(), errorPb.getMessage()); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof OperationError + && Objects.equals(code, ((OperationError) obj).code) + && Objects.equals(message, ((OperationError) obj).message) + && Objects.equals(location, ((OperationError) obj).location); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("code", code) + .add("location", location) + .add("message", message) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(code, location, message); + } + } + + /** + * A warning message that is generated during the processing of a Google Compute Engine operation. + */ + public static final class OperationWarning implements Serializable { + + static final + Function + FROM_PB_FUNCTION = + new Function() { + @Override + public OperationWarning apply( + com.google.api.services.compute.model.Operation.Warnings pb) { + return OperationWarning.fromPb(pb); + } + }; + static final + Function + TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Operation.Warnings apply( + OperationWarning operation) { + return operation.toPb(); + } + }; + + private static final long serialVersionUID = 4917326627380228928L; + + private final String code; + private final String message; + private final Map metadata; + + OperationWarning(String code, String message, Map metadata) { + this.code = code; + this.metadata = metadata != null ? ImmutableMap.copyOf(metadata) : null; + this.message = message; + } + + /** + * Returns a warning identifier for this warning. For example, {@code NO_RESULTS_ON_PAGE} if + * there are no results in the response. + */ + public String getCode() { + return code; + } + + /** Returns a human-readable error message. */ + public String getMessage() { + return message; + } + + /** + * Returns metadata about this warning. Each key 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 {@code scope} and the key's 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). + */ + public Map getMetadata() { + return metadata; + } + + com.google.api.services.compute.model.Operation.Warnings toPb() { + com.google.api.services.compute.model.Operation.Warnings warningPb = + new com.google.api.services.compute.model.Operation.Warnings() + .setCode(code) + .setMessage(message); + if (this.metadata != null) { + List metadataPb = + Lists.newArrayListWithCapacity(metadata.size()); + for (Map.Entry entry : metadata.entrySet()) { + metadataPb.add( + new com.google.api.services.compute.model.Operation.Warnings.Data() + .setKey(entry.getKey()) + .setValue(entry.getValue())); + } + warningPb.setData(metadataPb); + } + return warningPb; + } + + static OperationWarning fromPb( + com.google.api.services.compute.model.Operation.Warnings warningPb) { + Map metadata = null; + if (warningPb.getData() != null) { + metadata = Maps.newHashMapWithExpectedSize(warningPb.getData().size()); + for (com.google.api.services.compute.model.Operation.Warnings.Data data : + warningPb.getData()) { + metadata.put(data.getKey(), data.getValue()); + } + } + return new OperationWarning(warningPb.getCode(), warningPb.getMessage(), metadata); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof OperationWarning + && Objects.equals(code, ((OperationWarning) obj).code) + && Objects.equals(message, ((OperationWarning) obj).message) + && Objects.equals(metadata, ((OperationWarning) obj).metadata); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("code", code) + .add("message", message) + .add("metadata", metadata) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, metadata); + } + } + + static final class Builder { + + private Compute compute; + private String generatedId; + private OperationId operationId; + private String clientOperationId; + private String operationType; + private String targetLink; + private String targetId; + private Status status; + private String statusMessage; + private String user; + private Integer progress; + private Long insertTime; + private Long startTime; + private Long endTime; + private List errors; + private List warnings; + private Integer httpErrorStatusCode; + private String httpErrorMessage; + private String description; + + Builder(Compute compute) { + this.compute = compute; + } + + Builder(Compute compute, com.google.api.services.compute.model.Operation operationPb) { + this.compute = compute; + if (operationPb.getId() != null) { + generatedId = operationPb.getId().toString(); + } + if (RegionOperationId.matchesUrl(operationPb.getSelfLink())) { + operationId = RegionOperationId.fromUrl(operationPb.getSelfLink()); + } else if (ZoneOperationId.matchesUrl(operationPb.getSelfLink())) { + operationId = ZoneOperationId.fromUrl(operationPb.getSelfLink()); + } else { + operationId = GlobalOperationId.fromUrl(operationPb.getSelfLink()); + } + clientOperationId = operationPb.getClientOperationId(); + operationType = operationPb.getOperationType(); + targetLink = operationPb.getTargetLink(); + if (operationPb.getTargetId() != null) { + targetId = operationPb.getTargetId().toString(); + } + if (operationPb.getStatus() != null) { + status = Status.valueOf(operationPb.getStatus()); + } + statusMessage = operationPb.getStatusMessage(); + user = operationPb.getUser(); + progress = operationPb.getProgress(); + if (operationPb.getInsertTime() != null) { + insertTime = TIMESTAMP_FORMATTER.parseMillis(operationPb.getInsertTime()); + } + if (operationPb.getStartTime() != null) { + startTime = TIMESTAMP_FORMATTER.parseMillis(operationPb.getStartTime()); + } + if (operationPb.getEndTime() != null) { + endTime = TIMESTAMP_FORMATTER.parseMillis(operationPb.getEndTime()); + } + if (operationPb.getError() != null && operationPb.getError().getErrors() != null) { + errors = + Lists.transform(operationPb.getError().getErrors(), OperationError.FROM_PB_FUNCTION); + } + if (operationPb.getWarnings() != null) { + warnings = Lists.transform(operationPb.getWarnings(), OperationWarning.FROM_PB_FUNCTION); + } + httpErrorStatusCode = operationPb.getHttpErrorStatusCode(); + httpErrorMessage = operationPb.getHttpErrorMessage(); + description = operationPb.getDescription(); + } + + Builder getGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + Builder setOperationId(OperationId operationId) { + this.operationId = checkNotNull(operationId); + return this; + } + + Builder setClientOperationId(String clientOperationId) { + this.clientOperationId = clientOperationId; + return this; + } + + Builder setOperationType(String operationType) { + this.operationType = operationType; + return this; + } + + Builder setTargetLink(String targetLink) { + this.targetLink = targetLink; + return this; + } + + Builder setTargetId(String targetId) { + this.targetId = targetId; + return this; + } + + Builder setStatus(Status status) { + this.status = status; + return this; + } + + Builder setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + Builder setUser(String user) { + this.user = user; + return this; + } + + Builder setProgress(Integer progress) { + this.progress = progress; + return this; + } + + Builder setInsertTime(Long insertTime) { + this.insertTime = insertTime; + return this; + } + + Builder setStartTime(Long startTime) { + this.startTime = startTime; + return this; + } + + Builder setEndTime(Long endTime) { + this.endTime = endTime; + return this; + } + + Builder setErrors(List errors) { + this.errors = ImmutableList.copyOf(checkNotNull(errors)); + return this; + } + + Builder setWarnings(List warnings) { + this.warnings = ImmutableList.copyOf(checkNotNull(warnings)); + return this; + } + + Builder setHttpErrorStatusCode(Integer httpErrorStatusCode) { + this.httpErrorStatusCode = httpErrorStatusCode; + return this; + } + + Builder setHttpErrorMessage(String httpErrorMessage) { + this.httpErrorMessage = httpErrorMessage; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Operation build() { + return new Operation(this); + } + } + + private Operation(Builder builder) { + this.compute = checkNotNull(builder.compute); + this.options = compute.getOptions(); + this.generatedId = builder.generatedId; + this.operationId = checkNotNull(builder.operationId); + this.clientOperationId = builder.clientOperationId; + this.operationType = builder.operationType; + this.targetLink = builder.targetLink; + this.targetId = builder.targetId; + this.status = builder.status; + this.statusMessage = builder.statusMessage; + this.user = builder.user; + this.progress = builder.progress; + this.insertTime = builder.insertTime; + this.startTime = builder.startTime; + this.endTime = builder.endTime; + this.errors = builder.errors != null ? ImmutableList.copyOf(builder.errors) : null; + this.warnings = builder.warnings != null ? ImmutableList.copyOf(builder.warnings) : null; + this.httpErrorStatusCode = builder.httpErrorStatusCode; + this.httpErrorMessage = builder.httpErrorMessage; + this.description = builder.description; + } + + /** Returns the operation's {@code Compute} object used to issue requests. */ + public Compute getCompute() { + return compute; + } + + /** Returns the service-generated unique identifier for the operation. */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the operation's identity. This method returns an {@link GlobalOperationId} for global + * operations, a {@link RegionOperationId} for region operations and a {@link ZoneOperationId} for + * zone operations. + * + * @see RFC1035 + */ + @SuppressWarnings("unchecked") + public T getOperationId() { + return (T) operationId; + } + + /** Reserved for future use. */ + String getClientOperationId() { + return clientOperationId; + } + + /** Returns the type of operation. */ + public String getOperationType() { + return operationType; + } + + /** Returns the URL of the resource that the operation is modifying. */ + public String getTargetLink() { + return targetLink; + } + + /** + * Returns the unique service-defined target ID, which identifies the resource that the operation + * is modifying. + */ + public String getTargetId() { + return targetId; + } + + /** Returns the status of the operation. */ + public Status getStatus() { + return status; + } + + /** Returns an optional textual description of the current status of the operation. */ + public String getStatusMessage() { + return statusMessage; + } + + /** Returns the user who requested the operation, for example: {@code user@example.com}. */ + public String getUser() { + return user; + } + + /** + * Returns 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. + */ + public Integer getProgress() { + return progress; + } + + /** Returns the time that this operation was requested. In milliseconds since epoch. */ + public Long getInsertTime() { + return insertTime; + } + + /** + * Returns the time that this operation was started by the service. In milliseconds since epoch. + * This value will be {@code null} if the operation has not started yet. + */ + public Long getStartTime() { + return startTime; + } + + /** + * Returns the time that this operation was completed. In milliseconds since epoch. This value + * will be {@code null} if the operation has not finished yet. + */ + public Long getEndTime() { + return endTime; + } + + /** + * Returns the errors encountered while processing this operation, if any. Returns {@code null} if + * no error occurred. + */ + public List getErrors() { + return errors; + } + + /** + * Returns the warnings encountered while processing this operation, if any. Returns {@code null} + * if no warning occurred. + */ + public List getWarnings() { + return warnings; + } + + /** + * Returns the HTTP error status code that was returned, if the operation failed. For example, a + * {@code 404} means the resource was not found. + */ + public Integer getHttpErrorStatusCode() { + return httpErrorStatusCode; + } + + /** + * Returns the the HTTP error message that was returned, if the operation failed. For example, a + * {@code NOT FOUND} message is returned if the resource was not found. + */ + public String getHttpErrorMessage() { + return httpErrorMessage; + } + + /** Returns an optional textual description of the operation. */ + public String getDescription() { + return description; + } + + /** + * Checks if this operation exists. + * + * @return {@code true} if this operation exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(OperationOption.fields()) != null; + } + + /** + * Checks if this operation has completed its execution, either failing or succeeding. If the + * operation does not exist this method returns {@code true}. You can wait for operation + * completion with: + * + *

{@code
+   * while(!operation.isDone()) {
+   *   Thread.sleep(1000L);
+   * }
+   * }
+ * + * @return {@code true} if this operation is in {@link Operation.Status#DONE} state or if it does + * not exist, {@code false} if the state is not {@link Operation.Status#DONE} + * @throws ComputeException upon failure + */ + public boolean isDone() { + Operation operation = + compute.getOperation(operationId, OperationOption.fields(Compute.OperationField.STATUS)); + return operation == null || operation.getStatus() == Status.DONE; + } + + /** + * Blocks until this operation completes its execution, either failing or succeeding. This method + * returns current operation's latest information. If the operation no longer exists, this method + * returns {@code null}. By default, the operation status is checked using jittered exponential + * backoff with 1 second as an initial delay, 2.0 as a backoff factor, 1 minute as maximum delay + * between polls, 12 hours as a total timeout and unlimited number of attempts. + * + *

Example usage of {@code waitFor()}: + * + *

{@code
+   * Operation completedOperation = operation.waitFor();
+   * if (completedOperation == null) {
+   *   // operation no longer exists
+   * } else if (completedOperation.errors() != null) {
+   *   // operation failed, handle error
+   * } else {
+   *   // operation completed successfully
+   * }
+   * }
+ * + *

Example usage of {@code waitFor()} with checking period and timeout: + * + *

{@code
+   * Operation completedOperation =
+   *     operation.waitFor(
+   *         RetryOption.maxRetryDelay(Duration.ofSeconds(30)),
+   *         RetryOption.totalTimeout(Duration.ofMinutes(1)),
+   *         RetryOption.jittered(false));
+   * if (completedOperation == null) {
+   *   // operation no longer exists
+   * } else if (completedOperation.errors() != null) {
+   *   // operation failed, handle error
+   * } else {
+   *   // operation completed successfully
+   * }
+   * }
+ * + * @param waitOptions options to configure checking period and timeout + * @throws ComputeException upon failure, check {@link ComputeException#getCause()} for details + * @throws InterruptedException if the current thread gets interrupted while waiting for the + * operation to complete + */ + public Operation waitFor(RetryOption... waitOptions) + throws InterruptedException { + RetrySettings waitSettings = + RetryOption.mergeToSettings(DEFAULT_OPERATION_WAIT_SETTINGS, waitOptions); + try { + Operation operation = + RetryHelper.poll( + new Callable() { + @Override + public Operation call() throws Exception { + return compute.getOperation( + operationId, OperationOption.fields(Compute.OperationField.STATUS)); + } + }, + waitSettings, + new BasicResultRetryAlgorithm() { + @Override + public boolean shouldRetry(Throwable prevThrowable, Operation prevResponse) { + return prevResponse != null && prevResponse.getStatus() != Status.DONE; + } + }, + options.getClock()); + return operation == null ? null : reload(); + } catch (ExecutionException e) { + throw ComputeException.translateAndThrow(e); + } + } + + /** + * Fetches current operation's latest information. Returns {@code null} if the operation does not + * exist. + * + * @param options operation options + * @return an {@code Operation} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Operation reload(OperationOption... options) { + return compute.getOperation(operationId, options); + } + + /** + * Deletes this operation. Delete is only possible for operations that have completed their + * execution. Any attempt to delete a running operation will fail. + * + * @return {@code true} if operation was deleted, {@code false} if it was not found + * @throws ComputeException upon failure + */ + public boolean delete() { + return compute.deleteOperation(operationId); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("operationsId", operationId) + .add("clientOperationId", clientOperationId) + .add("operationType", operationType) + .add("targetLink", targetLink) + .add("targetId", targetId) + .add("status", status) + .add("statusMessage", statusMessage) + .add("user", user) + .add("progress", progress) + .add("insertTime", insertTime) + .add("startTime", startTime) + .add("endTime", endTime) + .add("errors", errors) + .add("warnings", warnings) + .add("httpErrorStatusCode", httpErrorStatusCode) + .add("httpErrorMessage", httpErrorMessage) + .add("description", description) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(operationId); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Operation.class)) { + return false; + } + Operation other = (Operation) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + com.google.api.services.compute.model.Operation toPb() { + com.google.api.services.compute.model.Operation operationPb = + new com.google.api.services.compute.model.Operation(); + if (generatedId != null) { + operationPb.setId(new BigInteger(generatedId)); + } + operationPb.setName(operationId.getOperation()); + operationPb.setClientOperationId(clientOperationId); + switch (operationId.getType()) { + case REGION: + operationPb.setRegion(this.getOperationId().getRegionId().getSelfLink()); + break; + case ZONE: + operationPb.setZone(this.getOperationId().getZoneId().getSelfLink()); + break; + } + if (operationType != null) { + operationPb.setOperationType(operationType); + } + operationPb.setTargetLink(targetLink); + if (targetId != null) { + operationPb.setTargetId(new BigInteger(targetId)); + } + if (status != null) { + operationPb.setStatus(status.name()); + } + operationPb.setStatusMessage(statusMessage); + operationPb.setUser(user); + operationPb.setProgress(progress); + if (insertTime != null) { + operationPb.setInsertTime(TIMESTAMP_FORMATTER.print(insertTime)); + } + if (startTime != null) { + operationPb.setStartTime(TIMESTAMP_FORMATTER.print(startTime)); + } + if (endTime != null) { + operationPb.setEndTime(TIMESTAMP_FORMATTER.print(endTime)); + } + if (errors != null) { + operationPb.setError( + new com.google.api.services.compute.model.Operation.Error() + .setErrors(Lists.transform(errors, OperationError.TO_PB_FUNCTION))); + } + if (warnings != null) { + operationPb.setWarnings(Lists.transform(warnings, OperationWarning.TO_PB_FUNCTION)); + } + operationPb.setHttpErrorStatusCode(httpErrorStatusCode); + operationPb.setHttpErrorMessage(httpErrorMessage); + operationPb.setSelfLink(operationId.getSelfLink()); + operationPb.setDescription(description); + return operationPb; + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Operation fromPb( + Compute compute, com.google.api.services.compute.model.Operation operationPb) { + return new Builder(compute, operationPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java new file mode 100644 index 000000000000..c6b556e51255 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/OperationId.java @@ -0,0 +1,93 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * Base class for Google Compute Engine operation identities. + */ +public abstract class OperationId extends ResourceId { + + private static final long serialVersionUID = -5502909279744388604L; + + private final String operation; + + OperationId(String project, String operation) { + super(project); + this.operation = checkNotNull(operation); + } + + /** + * Possible types for a Google Compute Engine operation identity. + */ + enum Type { + /** + * Global operations are those operations that deal with global resources, such as global + * addresses or snapshots. + */ + GLOBAL, + + /** + * Region operations are those operations that deal with resources that live in a region, such + * as subnetworks. + */ + REGION, + + /** + * Zone operations are those operations that deal with resources that live in a zone, such as + * disks and instances. + */ + ZONE + } + + /** + * Returns the type of this operation identity. + */ + public abstract Type getType(); + + /** + * Returns the name of the operation resource. + */ + public String getOperation() { + return operation; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("operation", operation); + } + + @Override + final int baseHashCode() { + return Objects.hash(super.baseHashCode(), operation); + } + + @Override + final boolean baseEquals(ResourceId resourceId) { + return resourceId instanceof OperationId + && super.baseEquals(resourceId) + && Objects.equals(operation, ((OperationId) resourceId).operation); + } + + @Override + abstract OperationId setProjectId(String projectId); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java new file mode 100644 index 000000000000..3696589bb42f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Option.java @@ -0,0 +1,72 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; +import com.google.common.base.MoreObjects; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Base class for Compute operation option. + */ +class Option implements Serializable { + + private static final long serialVersionUID = 4116849309806774350L; + + private final ComputeRpc.Option rpcOption; + private final Object value; + + Option(ComputeRpc.Option rpcOption, Object value) { + this.rpcOption = checkNotNull(rpcOption); + this.value = value; + } + + ComputeRpc.Option getRpcOption() { + return rpcOption; + } + + Object getValue() { + return value; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Option)) { + return false; + } + Option other = (Option) obj; + return Objects.equals(rpcOption, other.rpcOption) + && Objects.equals(value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(rpcOption, value); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("name", rpcOption.value()) + .add("value", value) + .toString(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java new file mode 100644 index 000000000000..ff2854108b9b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Region.java @@ -0,0 +1,421 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.core.ApiFunction; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +/** + * A Google Compute Engine region. + * + * @see Region and Zones + */ +public class Region implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public Region apply(com.google.api.services.compute.model.Region pb) { + return Region.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Region apply(Region region) { + return region.toPb(); + } + }; + + private static final long serialVersionUID = -3578710133393645135L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final RegionId regionId; + private final String generatedId; + private final Long creationTimestamp; + private final String description; + private final Status status; + private final List zones; + private final List quotas; + private final DeprecationStatus deprecationStatus; + + /** + * Status of the region. + */ + public static final class Status extends StringEnumValue { + private static final long serialVersionUID = 658578478474360264L; + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public Status apply(String constant) { + return new Status(constant); + } + }; + + private static final StringEnumType type = new StringEnumType( + Status.class, + CONSTRUCTOR); + + public static final Status UP = type.createAndRegister("UP"); + public static final Status DOWN = type.createAndRegister("DOWN"); + + private Status(String constant) { + super(constant); + } + + /** + * Get the Status for the given String constant, and throw an exception if the constant is + * not recognized. + */ + public static Status valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** + * Get the Status for the given String constant, and allow unrecognized values. + */ + public static Status valueOf(String constant) { + return type.valueOf(constant); + } + + /** + * Return the known values for Status. + */ + public static Status[] values() { + return type.values(); + } + } + + /** + * A quota assigned to this region. + */ + public static final class Quota implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public Quota apply(com.google.api.services.compute.model.Quota pb) { + return Quota.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Quota apply(Quota quota) { + return quota.toPb(); + } + }; + private static final long serialVersionUID = -4357118665133226338L; + + private final String metric; + private final double limit; + private final double usage; + + /** + * Returns a region quota object. + */ + Quota(String metric, double limit, double usage) { + this.metric = metric; + this.limit = limit; + this.usage = usage; + } + + /** + * Returns the name of the quota metric. + */ + public String getMetric() { + return metric; + } + + /** + * Returns the quota limit for this metric. + */ + public double getLimit() { + return limit; + } + + /** + * Returns the current usage for this quota. + */ + public double getUsage() { + return usage; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("metric", metric) + .add("limit", limit) + .add("usage", usage) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(metric, limit, usage); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Quota)) { + return false; + } + Quota other = (Quota) obj; + return Objects.equals(metric, other.metric) + && Objects.equals(limit, other.limit) + && Objects.equals(usage, other.usage); + } + + com.google.api.services.compute.model.Quota toPb() { + return new com.google.api.services.compute.model.Quota() + .setMetric(metric) + .setLimit(limit) + .setUsage(usage); + } + + static Quota fromPb(com.google.api.services.compute.model.Quota quotaPb) { + return new Quota(quotaPb.getMetric(), quotaPb.getLimit(), quotaPb.getUsage()); + } + } + + static final class Builder { + + private RegionId regionId; + private String generatedId; + private Long creationTimestamp; + private String description; + + private Status status; + private List zones; + private List quotas; + private DeprecationStatus deprecationStatus; + + private Builder() {} + + Builder setRegionId(RegionId regionId) { + this.regionId = regionId; + return this; + } + + Builder setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + Builder setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Builder setStatus(Status status) { + this.status = status; + return this; + } + + Builder setZones(List zones) { + this.zones = ImmutableList.copyOf(zones); + return this; + } + + Builder setQuotas(List quotas) { + this.quotas = ImmutableList.copyOf(quotas); + return this; + } + + Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { + this.deprecationStatus = deprecationStatus; + return this; + } + + Region build() { + return new Region(this); + } + } + + private Region(Builder builder) { + this.regionId = builder.regionId; + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.description = builder.description; + this.status = builder.status; + this.zones = builder.zones; + this.quotas = builder.quotas; + this.deprecationStatus = builder.deprecationStatus; + } + + /** + * Returns the region's identity. + */ + public RegionId getRegionId() { + return regionId; + } + + /** + * Returns the service-generated unique identifier for the region. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns an optional textual description of the region. + */ + public String getDescription() { + return description; + } + + /** + * Returns the status of the status. + */ + public Status getStatus() { + return status; + } + + /** + * Returns a list of identities of zones available in this region. + */ + public List getZones() { + return zones; + } + + /** + * Returns quotas assigned to this region. + */ + public List getQuotas() { + return quotas; + } + + /** + * Returns the deprecation status of the region. If {@link DeprecationStatus#getStatus()} is either + * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the + * region should not be used. Returns {@code null} if the region is not deprecated. + */ + public DeprecationStatus getDeprecationStatus() { + return deprecationStatus; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("regionId", regionId) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("description", description) + .add("status", status) + .add("zones", zones) + .add("quotas", quotas) + .add("deprecationStatus", deprecationStatus) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(regionId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(Region.class) + && Objects.equals(toPb(), ((Region) obj).toPb()); + } + + com.google.api.services.compute.model.Region toPb() { + com.google.api.services.compute.model.Region regionPb = + new com.google.api.services.compute.model.Region(); + if (generatedId != null) { + regionPb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + regionPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + regionPb.setName(regionId.getRegion()); + regionPb.setDescription(description); + regionPb.setSelfLink(regionId.getSelfLink()); + if (status != null) { + regionPb.setStatus(status.name()); + } + if (zones != null) { + regionPb.setZones(Lists.transform(zones, ZoneId.TO_URL_FUNCTION)); + } + if (quotas != null) { + regionPb.setQuotas(Lists.transform(quotas, Quota.TO_PB_FUNCTION)); + } + if (deprecationStatus != null) { + regionPb.setDeprecated(deprecationStatus.toPb()); + } + return regionPb; + } + + static Builder builder() { + return new Builder(); + } + + static Region fromPb(com.google.api.services.compute.model.Region regionPb) { + Builder builder = builder(); + builder.setRegionId(RegionId.fromUrl(regionPb.getSelfLink())); + if (regionPb.getId() != null) { + builder.setGeneratedId(regionPb.getId().toString()); + } + if (regionPb.getCreationTimestamp() != null) { + builder.setCreationTimestamp( + TIMESTAMP_FORMATTER.parseMillis(regionPb.getCreationTimestamp())); + } + builder.setDescription(regionPb.getDescription()); + if (regionPb.getStatus() != null) { + builder.setStatus(Status.valueOf(regionPb.getStatus())); + } + if (regionPb.getZones() != null) { + builder.setZones(Lists.transform(regionPb.getZones(), ZoneId.FROM_URL_FUNCTION)); + } + if (regionPb.getQuotas() != null) { + builder.setQuotas(Lists.transform(regionPb.getQuotas(), Quota.FROM_PB_FUNCTION)); + } + if (regionPb.getDeprecated() != null) { + builder.setDeprecationStatus( + DeprecationStatus.fromPb(regionPb.getDeprecated(), RegionId.FROM_URL_FUNCTION)); + } + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java new file mode 100644 index 000000000000..89e9983d9dd4 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java @@ -0,0 +1,151 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine region address. + */ +public final class RegionAddressId extends AddressId { + + private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/addresses/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 8170980880371085238L; + + private final String region; + + private RegionAddressId(String project, String region, String address) { + super(project, address); + this.region = checkNotNull(region); + } + + @Override + public Type getType() { + return Type.REGION; + } + + /** + * Returns the name of the region this address belongs to. + */ + public String getRegion() { + return region; + } + + /** + * Returns the identity of the region this address belongs to. + */ + public RegionId getRegionId() { + return RegionId.of(getProject(), region); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/regions/" + region + "/addresses/" + getAddress(); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("region", region); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), region); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RegionAddressId)) { + return false; + } + RegionAddressId other = (RegionAddressId) obj; + return baseEquals(other) && Objects.equals(region, other.region); + } + + @Override + RegionAddressId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return RegionAddressId.of(projectId, region, getAddress()); + } + + /** + * Returns a region address identity given the region identity and the address name. The address + * name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 + * characters long and match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means + * the first character must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static RegionAddressId of(RegionId regionId, String address) { + return new RegionAddressId(regionId.getProject(), regionId.getRegion(), address); + } + + /** + * Returns a region address identity given the region and address names. The address name must be + * 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static RegionAddressId of(String region, String address) { + return new RegionAddressId(null, region, address); + } + + /** + * Returns a region address identity given project, region and address names. The address name + * must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the + * regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static RegionAddressId of(String project, String region, String address) { + return new RegionAddressId(project, region, address); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a region address + * URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static RegionAddressId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid region address URL"); + } + return RegionAddressId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java new file mode 100644 index 000000000000..a6ffb99cbc82 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java @@ -0,0 +1,167 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine region's forwarding rule. + */ +public final class RegionForwardingRuleId extends ForwardingRuleId { + + static final Function FROM_URL_FUNCTION = + new Function() { + @Override + public RegionForwardingRuleId apply(String pb) { + return RegionForwardingRuleId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = + new Function() { + @Override + public String apply(RegionForwardingRuleId forwardingRuleId) { + return forwardingRuleId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/forwardingRules/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 7885327931402904667L; + + private final String region; + + private RegionForwardingRuleId(String project, String region, String rule) { + super(project, rule); + this.region = checkNotNull(region); + } + + @Override + public Type getType() { + return Type.REGION; + } + + /** + * Returns the name of the region this forwarding rule belongs to. + */ + public String getRegion() { + return region; + } + + /** + * Returns the identity of the region this forwarding rule belongs to. + */ + public RegionId getRegionId() { + return RegionId.of(getProject(), region); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/regions/" + region + "/forwardingRules/" + getRule(); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("region", region); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), region); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RegionForwardingRuleId)) { + return false; + } + RegionForwardingRuleId other = (RegionForwardingRuleId) obj; + return baseEquals(other) && Objects.equals(region, other.region); + } + + @Override + RegionForwardingRuleId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return RegionForwardingRuleId.of(projectId, region, getRule()); + } + + /** + * Returns a region forwarding rule identity given the region identity and the rule name. The + * forwarding rule name must be 1-63 characters long and comply with RFC1035. Specifically, the + * name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first + * character must be a lowercase letter, and all following characters must be a dash, lowercase + * letter, or digit, except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static RegionForwardingRuleId of(RegionId regionId, String rule) { + return new RegionForwardingRuleId(regionId.getProject(), regionId.getRegion(), rule); + } + + /** + * Returns a region forwarding rule identity given the region and rule names. The forwarding rule + * name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match + * the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must + * be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static RegionForwardingRuleId of(String region, String rule) { + return new RegionForwardingRuleId(null, region, rule); + } + + /** + * Returns a region forwarding rule identity given project, region and rule names. The forwarding + * rule name must be 1-63 characters long and comply with RFC1035. Specifically, the name must + * match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character + * must be a lowercase letter, and all following characters must be a dash, lowercase letter, or + * digit, except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static RegionForwardingRuleId of(String project, String region, String rule) { + return new RegionForwardingRuleId(project, region, rule); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a region forwarding + * rule URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static RegionForwardingRuleId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid region forwarding rule URL"); + } + return RegionForwardingRuleId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java new file mode 100644 index 000000000000..8bbd3140f5f2 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionId.java @@ -0,0 +1,133 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects.ToStringHelper; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * A Google Compute Engine region identity. + */ +public final class RegionId extends ResourceId { + + static final Function FROM_URL_FUNCTION = new Function() { + @Override + public RegionId apply(String pb) { + return RegionId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = new Function() { + @Override + public String apply(RegionId regionId) { + return regionId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 5569092266957249294L; + + private final String region; + + private RegionId(String project, String region) { + super(project); + this.region = checkNotNull(region); + } + + private RegionId(RegionId regionId) { + super(regionId.getProject()); + this.region = checkNotNull(regionId.getRegion()); + } + + /** + * Returns the name of the region. + */ + public String getRegion() { + return region; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/regions/" + region; + } + + @Override + ToStringHelper toStringHelper() { + return super.toStringHelper().add("region", region); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), region); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RegionId)) { + return false; + } + RegionId other = (RegionId) obj; + return baseEquals(other) && Objects.equals(region, other.region); + } + + @Override + RegionId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return RegionId.of(projectId, region); + } + + /** + * Returns a new region identity given project and region names. + */ + public static RegionId of(String project, String region) { + return new RegionId(project, region); + } + + /** + * Returns a new region identity given region name. + */ + public static RegionId of(String region) { + return RegionId.of(null, region); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a region URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static RegionId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid region URL"); + } + return RegionId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java new file mode 100644 index 000000000000..e51bfc4091c5 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java @@ -0,0 +1,133 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine region's operation. + */ +public final class RegionOperationId extends OperationId { + + private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/operations/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 5816161906501886782L; + + private final String region; + + private RegionOperationId(String project, String region, String operation) { + super(project, operation); + this.region = checkNotNull(region); + } + + @Override + public Type getType() { + return Type.REGION; + } + + /** + * Returns the name of the region this operation belongs to. + */ + public String getRegion() { + return region; + } + + /** + * Returns the identity of the region this operation belongs to. + */ + public RegionId getRegionId() { + return RegionId.of(getProject(), region); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/regions/" + region + "/operations/" + getOperation(); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("region", region); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), region); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RegionOperationId)) { + return false; + } + RegionOperationId other = (RegionOperationId) obj; + return baseEquals(other) && Objects.equals(region, other.region); + } + + @Override + RegionOperationId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return RegionOperationId.of(projectId, region, getOperation()); + } + + /** + * Returns a region operation identity given the region identity and the operation name. + */ + public static RegionOperationId of(RegionId regionId, String operation) { + return new RegionOperationId(regionId.getProject(), regionId.getRegion(), operation); + } + + /** + * Returns a region operation identity given the region and operation names. + */ + public static RegionOperationId of(String region, String operation) { + return new RegionOperationId(null, region, operation); + } + + /** + * Returns a region operation identity given project, region and operation names. + */ + public static RegionOperationId of(String project, String region, String operation) { + return new RegionOperationId(project, region, operation); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a region operation + * URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static RegionOperationId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid region operation URL"); + } + return RegionOperationId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java new file mode 100644 index 000000000000..01b8357c0d3b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ResourceId.java @@ -0,0 +1,71 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.common.base.MoreObjects; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Base class for Google Compute Engine resource identities. + */ +public abstract class ResourceId implements Serializable { + + static final String REGEX = ".*?projects/([^/]+)/"; + private static final String BASE_URL = "https://www.googleapis.com/compute/v1/projects/"; + private static final long serialVersionUID = -8028734746870421573L; + + private final String project; + + ResourceId(String project) { + this.project = project; + } + + /** + * Returns a fully qualified URL to the entity. + */ + public String getSelfLink() { + return BASE_URL + project; + } + + /** + * Returns the name of the project. + */ + public final String getProject() { + return project; + } + + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("project", project); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + int baseHashCode() { + return Objects.hash(project); + } + + boolean baseEquals(ResourceId resourceId) { + return Objects.equals(project, resourceId.project); + } + + abstract ResourceId setProjectId(String projectId); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java new file mode 100644 index 000000000000..a7dd3a91e386 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SchedulingOptions.java @@ -0,0 +1,193 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.core.ApiFunction; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; +import com.google.common.base.MoreObjects; + +import java.io.Serializable; +import java.util.Objects; + +/** + * A Google Compute Engine instance scheduling options. When there are system events that might + * cause your instances to be disrupted, Google Compute Engine automatically manages the + * scheduling decisions for your instances. Use {@code SchedulingOptions.preemptible()} to create + * a preemptible instance. Use {@code SchedulingOptions.standard()} to configure scheduling + * options for a standard instance. + * + * @see + * Setting Instance Scheduling Options + */ +public final class SchedulingOptions implements Serializable { + + private static final long serialVersionUID = 4199610694227857331L; + + private final boolean automaticRestart; + private final Maintenance maintenance; + private final boolean isPreemptible; + + /** + * Defines the maintenance behavior for this instance. + */ + public static final class Maintenance extends StringEnumValue { + private static final long serialVersionUID = 1041388027965833378L; + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public Maintenance apply(String constant) { + return new Maintenance(constant); + } + }; + + private static final StringEnumType type = new StringEnumType( + Maintenance.class, + CONSTRUCTOR); + + /** + * The default behavior for standard instances. + */ + public static final Maintenance MIGRATE = type.createAndRegister("MIGRATE"); + + /** + * The default and only possible behavior for preemptible instances. + */ + public static final Maintenance TERMINATE = type.createAndRegister("TERMINATE"); + + private Maintenance(String constant) { + super(constant); + } + + /** + * Get the Maintenance for the given String constant, and throw an exception if the constant is + * not recognized. + */ + public static Maintenance valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** + * Get the Maintenance for the given String constant, and allow unrecognized values. + */ + public static Maintenance valueOf(String constant) { + return type.valueOf(constant); + } + + /** + * Return the known values for Maintenance. + */ + public static Maintenance[] values() { + return type.values(); + } + } + + private SchedulingOptions(Boolean automaticRestart, Maintenance maintenance, + Boolean isPreemptible) { + this.automaticRestart = automaticRestart; + this.maintenance = maintenance; + this.isPreemptible = isPreemptible; + } + + /** + * Returns whether the instance should be automatically restarted if it is terminated by Compute + * Engine (not terminated by a user). + */ + public Boolean automaticRestart() { + return automaticRestart; + } + + /** + * Returns the maintenance behavior for the instance. + */ + public Maintenance getMaintenance() { + return maintenance; + } + + /** + * Returns {@code true} if the instance is preemptible, {@code false} otherwhise. + * + * @see Preemptible + * Instance + */ + public boolean isPreemptible() { + return isPreemptible; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("automaticRestart", automaticRestart) + .add("maintenance", maintenance) + .add("isPreemptible", isPreemptible) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(automaticRestart, maintenance, isPreemptible); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof SchedulingOptions + && Objects.equals(toPb(), ((SchedulingOptions) obj).toPb()); + } + + com.google.api.services.compute.model.Scheduling toPb() { + com.google.api.services.compute.model.Scheduling schedulingPb = + new com.google.api.services.compute.model.Scheduling(); + schedulingPb.setAutomaticRestart(automaticRestart); + schedulingPb.setPreemptible(isPreemptible); + if (maintenance != null) { + schedulingPb.setOnHostMaintenance(maintenance.name()); + } + return schedulingPb; + } + + /** + * Returns a {@code SchedulingOptions} object for a preemptible instance. + * + * @see Preemptible + * Instance + */ + public static SchedulingOptions preemptible() { + return new SchedulingOptions(false, Maintenance.TERMINATE, true); + } + + /** + * Returns a {@code SchedulingOptions} object for a standard instance. + * + * @param automaticRestart specifies whether the instance should be automatically restarted if + * it is terminated by Compute Engine (not terminated by a user) + * @param maintenance defines the maintenance behavior for the instance + */ + public static SchedulingOptions standard(boolean automaticRestart, Maintenance maintenance) { + return new SchedulingOptions(automaticRestart, maintenance, false); + } + + static SchedulingOptions fromPb(com.google.api.services.compute.model.Scheduling schedPb) { + Maintenance maintenance = null; + if (schedPb.getOnHostMaintenance() != null) { + maintenance = Maintenance.valueOf(schedPb.getOnHostMaintenance()); + } + return new SchedulingOptions(schedPb.getAutomaticRestart(), maintenance, + schedPb.getPreemptible()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java new file mode 100644 index 000000000000..0be8694a4616 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java @@ -0,0 +1,123 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * A service account, with its specified scopes, authorized for this instance. + * + * @see Authenticating from Google + * Compute Engine + */ +public final class ServiceAccount implements Serializable { + + static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public ServiceAccount apply(com.google.api.services.compute.model.ServiceAccount pb) { + return ServiceAccount.fromPb(pb); + } + }; + static final Function + TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.ServiceAccount apply( + ServiceAccount metadata) { + return metadata.toPb(); + } + }; + + private static final long serialVersionUID = 4199610694227857331L; + + private final String email; + private final List scopes; + + private ServiceAccount(String email, List scopes) { + this.email = email; + this.scopes = ImmutableList.copyOf(scopes); + } + + /** + * Returns the email address of the service account. + */ + public String getEmail() { + return email; + } + + /** + * Returns the list of scopes to be made available for this service account. + */ + public List getScopes() { + return scopes; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("email", email) + .add("scopes", scopes) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(email, scopes); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof ServiceAccount + && Objects.equals(toPb(), ((ServiceAccount) obj).toPb()); + } + + com.google.api.services.compute.model.ServiceAccount toPb() { + com.google.api.services.compute.model.ServiceAccount serviceAccountPb = + new com.google.api.services.compute.model.ServiceAccount(); + serviceAccountPb.setEmail(email); + serviceAccountPb.setScopes(scopes); + return serviceAccountPb; + } + + /** + * Returns a {@code ServiceAccount} object for the provided email and scopes. + */ + public static ServiceAccount of(String email, List scopes) { + return new ServiceAccount(email, scopes); + } + + /** + * Returns a {@code ServiceAccount} object for the provided email and scopes. + */ + public static ServiceAccount of(String email, String... scopes) { + return of(email, Arrays.asList(scopes)); + } + + static ServiceAccount fromPb(com.google.api.services.compute.model.ServiceAccount accountPb) { + return new ServiceAccount(accountPb.getEmail(), accountPb.getScopes()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java new file mode 100644 index 000000000000..eef6d4bf4266 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Snapshot.java @@ -0,0 +1,216 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.Compute.OperationOption; +import com.google.cloud.compute.deprecated.Compute.SnapshotOption; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine snapshot. Compute Engine allows you to take snapshots of your persistent + * disk and create new persistent disks from that snapshot. This can be useful for backing up data, + * recreating a persistent disk that might have been lost, or copying a persistent disk. Snapshots + * can be applied across persistent disk types. {@code Snapshot} adds a layer of service-related + * functionality over {@link SnapshotInfo}. Objects of this class are immutable; to get a + * {@code Snapshot} object with the most recent information use {@link #reload}. + * + * @see Use + * persistent disk snapshots + */ +public class Snapshot extends SnapshotInfo { + + private static final long serialVersionUID = -973924811396336695L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Snapshot} objects. + */ + public static class Builder extends SnapshotInfo.Builder { + + private final Compute compute; + private final SnapshotInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, SnapshotId snapshotId, DiskId sourceDisk) { + this.compute = compute; + this.infoBuilder = new SnapshotInfo.BuilderImpl(); + this.infoBuilder.setSnapshotId(snapshotId); + this.infoBuilder.setSourceDisk(sourceDisk); + } + + Builder(Snapshot snapshot) { + this.compute = snapshot.compute; + this.infoBuilder = new SnapshotInfo.BuilderImpl(snapshot); + } + + @Override + Builder setGeneratedId(String generatedId) { + infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + infoBuilder.setCreationTimestamp(creationTimestamp); + return this; + } + + @Override + public Builder setSnapshotId(SnapshotId snapshotId) { + infoBuilder.setSnapshotId(snapshotId); + return this; + } + + @Override + public Builder setDescription(String description) { + infoBuilder.setDescription(description); + return this; + } + + @Override + Builder setStatus(Status status) { + infoBuilder.setStatus(status); + return this; + } + + @Override + Builder setDiskSizeGb(Long diskSizeGb) { + infoBuilder.setDiskSizeGb(diskSizeGb); + return this; + } + + @Override + Builder setLicenses(List licenses) { + infoBuilder.setLicenses(licenses); + return this; + } + + @Override + public Builder setSourceDisk(DiskId sourceDisk) { + infoBuilder.setSourceDisk(sourceDisk); + return this; + } + + @Override + Builder setSourceDiskId(String sourceDiskId) { + infoBuilder.setSourceDiskId(sourceDiskId); + return this; + } + + @Override + Builder setStorageBytes(Long storageBytes) { + infoBuilder.setStorageBytes(storageBytes); + return this; + } + + @Override + Builder setStorageBytesStatus(StorageBytesStatus storageBytesStatus) { + infoBuilder.setStorageBytesStatus(storageBytesStatus); + return this; + } + + @Override + public Snapshot build() { + return new Snapshot(compute, infoBuilder); + } + } + + Snapshot(Compute compute, SnapshotInfo.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this snapshot exists. + * + * @return {@code true} if this snapshot exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(SnapshotOption.fields()) != null; + } + + /** + * Fetches current snapshot's latest information. Returns {@code null} if the snapshot does not + * exist. + * + * @param options snapshot options + * @return a {@code Snapshot} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Snapshot reload(SnapshotOption... options) { + return compute.getSnapshot(getSnapshotId().getSnapshot(), options); + } + + /** + * Deletes this snapshot. + * + * @return a global operation if delete request was successfully sent, {@code null} if the + * snapshot was not found + * @throws ComputeException upon failure + */ + public Operation delete(OperationOption... options) { + return compute.deleteSnapshot(getSnapshotId(), options); + } + + /** + * Returns the snapshot's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Snapshot.class)) { + return false; + } + Snapshot other = (Snapshot) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Snapshot fromPb(Compute compute, + com.google.api.services.compute.model.Snapshot snapshotPb) { + return new Snapshot(compute, new SnapshotInfo.BuilderImpl(snapshotPb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java new file mode 100644 index 000000000000..fb59f821e149 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotDiskConfiguration.java @@ -0,0 +1,184 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Disk; +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * A Google Compute Engine disk configuration to create a disk from a Google Compute Engine + * snapshot. + * + * @see Block Storage + */ +public class SnapshotDiskConfiguration extends DiskConfiguration { + + private static final long serialVersionUID = -1996055058706221049L; + + private final SnapshotId sourceSnapshot; + private final String sourceSnapshotId; + + /** + * A builder for {@code SnapshotDiskConfiguration} objects. + */ + public static class Builder + extends DiskConfiguration.Builder { + + private SnapshotId sourceSnapshot; + private String sourceSnapshotId; + + private Builder(SnapshotId sourceSnapshot) { + super(Type.SNAPSHOT); + this.sourceSnapshot = checkNotNull(sourceSnapshot); + } + + private Builder(SnapshotDiskConfiguration configuration) { + super(configuration); + this.sourceSnapshot = configuration.sourceSnapshot; + this.sourceSnapshotId = configuration.sourceSnapshotId; + } + + private Builder(Disk diskPb) { + super(Type.SNAPSHOT, diskPb); + this.sourceSnapshot = SnapshotId.fromUrl(diskPb.getSourceSnapshot()); + this.sourceSnapshotId = diskPb.getSourceSnapshotId(); + } + + /** + * Sets the size of the persistent disk, in GB. If not set the disk will have the size of the + * snapshot. This value can be larger than the snapshot's size. If the provided size is smaller + * than the snapshot's size then disk creation will fail. + * + * @see + * Restoring a snapshot to a larger size + */ + @Override + public Builder setSizeGb(Long sizeGb) { + super.setSizeGb(sizeGb); + return this; + } + + /** + * Sets the identity of the source snapshot used to create the disk. + */ + public Builder setSourceSnapshot(SnapshotId sourceSnapshot) { + this.sourceSnapshot = checkNotNull(sourceSnapshot); + return this; + } + + Builder setSourceSnapshotId(String sourceSnapshotId) { + this.sourceSnapshotId = sourceSnapshotId; + return this; + } + + /** + * Creates a {@code SnapshotDiskConfiguration} object. + */ + @Override + public SnapshotDiskConfiguration build() { + return new SnapshotDiskConfiguration(this); + } + } + + private SnapshotDiskConfiguration(Builder builder) { + super(builder); + this.sourceSnapshot = builder.sourceSnapshot; + this.sourceSnapshotId = builder.sourceSnapshotId; + } + + /** + * Returns the identity of the source snapshot used to create the disk. + */ + public SnapshotId getSourceSnapshot() { + return sourceSnapshot; + } + + /** + * Returns the service-generated unique id of the snapshot used to create this disk. This value + * identifies the exact snapshot that was used to create the 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. + */ + public String getSourceSnapshotId() { + return sourceSnapshotId; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("sourceSnapshot", sourceSnapshot) + .add("sourceSnapshotId", sourceSnapshotId); + } + + @Override + public final int hashCode() { + return Objects.hash(baseHashCode(), sourceSnapshot, sourceSnapshotId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(SnapshotDiskConfiguration.class) + && baseEquals((SnapshotDiskConfiguration) obj); + } + + @Override + SnapshotDiskConfiguration setProjectId(String projectId) { + Builder builder = toBuilder().setSourceSnapshot(sourceSnapshot.setProjectId(projectId)); + if (getDiskType() != null) { + builder.setDiskType(getDiskType().setProjectId(projectId)); + } + return builder.build(); + } + + @Override + Disk toPb() { + return super.toPb() + .setSourceSnapshot(sourceSnapshot.getSelfLink()) + .setSourceSnapshotId(sourceSnapshotId); + } + + /** + * Returns a builder for a {@code SnapshotDiskConfiguration} object given the snapshot identity. + */ + public static Builder newBuilder(SnapshotId sourceSnapshot) { + return new Builder(sourceSnapshot); + } + + /** + * Returns a {@code SnapshotDiskConfiguration} object given the snapshot identity. + */ + public static SnapshotDiskConfiguration of(SnapshotId sourceSnapshot) { + return newBuilder(sourceSnapshot).build(); + } + + @SuppressWarnings("unchecked") + static SnapshotDiskConfiguration fromPb(Disk diskPb) { + return new Builder(diskPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java new file mode 100644 index 000000000000..cd041c94535c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotId.java @@ -0,0 +1,132 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine snapshot. + */ +public final class SnapshotId extends ResourceId { + + private static final String REGEX = ResourceId.REGEX + "global/snapshots/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -1699492866663041082L; + + private final String snapshot; + + private SnapshotId(String project, String snapshot) { + super(project); + this.snapshot = checkNotNull(snapshot); + } + + /** + * Returns the name of the snapshot. The name must be 1-63 characters long and comply with + * RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getSnapshot() { + return snapshot; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/global/snapshots/" + snapshot; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("snapshot", snapshot); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), snapshot); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof SnapshotId)) { + return false; + } + SnapshotId other = (SnapshotId) obj; + return baseEquals(other) && Objects.equals(snapshot, other.snapshot); + } + + @Override + SnapshotId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return SnapshotId.of(projectId, snapshot); + } + + /** + * Returns a snapshot identity given the snapshot name. The snapshot name must be 1-63 characters + * long and comply with RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public static SnapshotId of(String snapshot) { + return new SnapshotId(null, snapshot); + } + + /** + * Returns a snapshot identity given project and snapshot names. The snapshot name must be 1-63 + * characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static SnapshotId of(String project, String snapshot) { + return new SnapshotId(project, snapshot); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a snapshot URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return url.matches(REGEX); + } + + static SnapshotId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid snapshot URL"); + } + return SnapshotId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java new file mode 100644 index 000000000000..54e03869c5b8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SnapshotInfo.java @@ -0,0 +1,484 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Snapshot; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine snapshot. Compute Engine allows you to take snapshots of your persistent + * disk and create new persistent disks from that snapshot. This can be useful for backing up data, + * recreating a persistent disk that might have been lost, or copying a persistent disk. Snapshots + * can be applied across persistent disk types. + * + * @see Use + * persistent disk snapshots + */ +public class SnapshotInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public SnapshotInfo apply(Snapshot pb) { + return SnapshotInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Snapshot apply(SnapshotInfo snapshot) { + return snapshot.toPb(); + } + }; + + private static final long serialVersionUID = 1065513502131159769L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final SnapshotId snapshotId; + private final Long creationTimestamp; + private final String description; + private final Status status; + private final Long diskSizeGb; + private final List licenses; + private final DiskId sourceDisk; + private final String sourceDiskId; + private final Long storageBytes; + private final StorageBytesStatus storageBytesStatus; + + /** + * The status of a Google Compute Engine snapshot. A snapshot can be used to create a disk only + * after the snapshot has been successfully created and the status is set to {@code READY}. + */ + public enum Status { + /** + * The snapshot is being created. + */ + CREATING, + + /** + * The snapshot is being deleted. + */ + DELETING, + + /** + * Snapshot's creation failed. + */ + FAILED, + + /** + * Snapshot has been successfully created. + */ + READY, + + /** + * Snapshot is being uploaded. + */ + UPLOADING + } + + /** + * An indicator of whether {@link SnapshotInfo#getStorageBytes()} is in a stable state or it is + * being adjusted as a result of shared storage reallocation. + */ + public enum StorageBytesStatus { + /** + * Indicates that the size of the snapshot is being updated. + */ + UPDATING, + + /** + * Indicates that the size of the snapshot is up-to-date. + */ + UP_TO_DATE + } + + /** + * A builder for {@code SnapshotInfo} objects. + */ + public abstract static class Builder { + + abstract Builder setGeneratedId(String generatedId); + + abstract Builder setCreationTimestamp(Long creationTimestamp); + + /** + * Sets the snapshot identity. + */ + public abstract Builder setSnapshotId(SnapshotId snapshotId); + + /** + * Sets an optional textual description of the snapshot. + */ + public abstract Builder setDescription(String description); + + abstract Builder setStatus(Status status); + + abstract Builder setDiskSizeGb(Long diskSizeGb); + + abstract Builder setLicenses(List licenses); + + /** + * Sets the identity of the source disk used to create the snapshot. + */ + public abstract Builder setSourceDisk(DiskId sourceDisk); + + abstract Builder setSourceDiskId(String sourceDiskId); + + abstract Builder setStorageBytes(Long storageBytes); + + abstract Builder setStorageBytesStatus(StorageBytesStatus storageBytesStatus); + + /** + * Creates a {@code SnapshotInfo} object. + */ + public abstract SnapshotInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String generatedId; + private Long creationTimestamp; + private SnapshotId snapshotId; + private String description; + private Status status; + private Long diskSizeGb; + private List licenses; + private DiskId sourceDisk; + private String sourceDiskId; + private Long storageBytes; + private StorageBytesStatus storageBytesStatus; + + BuilderImpl() {} + + BuilderImpl(SnapshotInfo snapshotInfo) { + this.generatedId = snapshotInfo.generatedId; + this.creationTimestamp = snapshotInfo.creationTimestamp; + this.snapshotId = snapshotInfo.snapshotId; + this.description = snapshotInfo.description; + this.status = snapshotInfo.status; + this.diskSizeGb = snapshotInfo.diskSizeGb; + this.licenses = snapshotInfo.licenses; + this.sourceDisk = snapshotInfo.sourceDisk; + this.sourceDiskId = snapshotInfo.sourceDiskId; + this.storageBytes = snapshotInfo.storageBytes; + this.storageBytesStatus = snapshotInfo.storageBytesStatus; + } + + BuilderImpl(Snapshot snapshotPb) { + if (snapshotPb.getId() != null) { + this.generatedId = snapshotPb.getId().toString(); + } + if (snapshotPb.getCreationTimestamp() != null) { + this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(snapshotPb.getCreationTimestamp()); + } + this.snapshotId = SnapshotId.fromUrl(snapshotPb.getSelfLink()); + this.description = snapshotPb.getDescription(); + if (snapshotPb.getStatus() != null) { + this.status = Status.valueOf(snapshotPb.getStatus()); + } + this.diskSizeGb = snapshotPb.getDiskSizeGb(); + if (snapshotPb.getLicenses() != null) { + this.licenses = Lists.transform(snapshotPb.getLicenses(), LicenseId.FROM_URL_FUNCTION); + } + if (snapshotPb.getSourceDisk() != null) { + this.sourceDisk = DiskId.fromUrl(snapshotPb.getSourceDisk()); + } + this.sourceDiskId = snapshotPb.getSourceDiskId(); + this.storageBytes = snapshotPb.getStorageBytes(); + if (snapshotPb.getStorageBytesStatus() != null) { + this.storageBytesStatus = StorageBytesStatus.valueOf(snapshotPb.getStorageBytesStatus()); + } + } + + @Override + BuilderImpl setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + BuilderImpl setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + public BuilderImpl setSnapshotId(SnapshotId snapshotId) { + this.snapshotId = checkNotNull(snapshotId); + return this; + } + + @Override + public BuilderImpl setDescription(String description) { + this.description = description; + return this; + } + + @Override + BuilderImpl setStatus(Status status) { + this.status = status; + return this; + } + + @Override + BuilderImpl setDiskSizeGb(Long diskSizeGb) { + this.diskSizeGb = diskSizeGb; + return this; + } + + @Override + BuilderImpl setLicenses(List licenses) { + this.licenses = licenses != null ? ImmutableList.copyOf(licenses) : null; + return this; + } + + @Override + public BuilderImpl setSourceDisk(DiskId sourceDisk) { + this.sourceDisk = checkNotNull(sourceDisk); + return this; + } + + @Override + BuilderImpl setSourceDiskId(String sourceDiskId) { + this.sourceDiskId = sourceDiskId; + return this; + } + + @Override + BuilderImpl setStorageBytes(Long storageBytes) { + this.storageBytes = storageBytes; + return this; + } + + @Override + BuilderImpl setStorageBytesStatus(StorageBytesStatus storageBytesStatus) { + this.storageBytesStatus = storageBytesStatus; + return this; + } + + @Override + public SnapshotInfo build() { + return new SnapshotInfo(this); + } + } + + SnapshotInfo(BuilderImpl builder) { + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.snapshotId = checkNotNull(builder.snapshotId); + this.description = builder.description; + this.status = builder.status; + this.diskSizeGb = builder.diskSizeGb; + this.licenses = builder.licenses; + this.sourceDisk = builder.sourceDisk; + this.sourceDiskId = builder.sourceDiskId; + this.storageBytes = builder.storageBytes; + this.storageBytesStatus = builder.storageBytesStatus; + } + + /** + * Returns the service-generated unique identifier for the snapshot. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns the snapshot identity. + */ + public SnapshotId getSnapshotId() { + return snapshotId; + } + + /** + * Returns a textual description of the snapshot. + */ + public String getDescription() { + return description; + } + + /** + * Returns all applicable publicly visible licenses. + */ + public List getLicenses() { + return licenses; + } + + /** + * Returns the status of the snapshot. A snapshot can be used to create other resources, such as + * disks, only after the snapshot has been successfully created and the status is set to + * {@code READY}. + */ + public Status getStatus() { + return status; + } + + /** + * Returns the size of the snapshot (in GB). + */ + public Long getDiskSizeGb() { + return diskSizeGb; + } + + /** + * Returns the identity of the source disk used to create this snapshot. + */ + public DiskId getSourceDisk() { + return sourceDisk; + } + + /** + * Returns the service-generated unique id 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. + */ + public String getSourceDiskId() { + return sourceDiskId; + } + + /** + * Returns the size of the the storage used by the snapshot. As snapshots share storage, this + * number is expected to change with snapshot creation/deletion. + */ + public Long getStorageBytes() { + return storageBytes; + } + + /** + * Indicates whether {@link SnapshotInfo#getStorageBytes()} is in a stable state or it is being + * adjusted as a result of shared storage reallocation. {@link StorageBytesStatus#UPDATING} + * indicates that the size of the snapshot is being updated. {@link StorageBytesStatus#UP_TO_DATE} + * indicates that the size of the snapshot is up-to-date. + */ + public StorageBytesStatus getStorageBytesStatus() { + return storageBytesStatus; + } + + /** + * Returns a builder for the current snapshot. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("snapshotId", snapshotId) + .add("description", description) + .add("status", status) + .add("diskSizeGb", diskSizeGb) + .add("licenses", licenses) + .add("sourceDisk", sourceDisk) + .add("sourceDiskId", sourceDiskId) + .add("storageBytes", storageBytes) + .add("storageBytesStatus", storageBytesStatus) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(generatedId, creationTimestamp, snapshotId, description, status, diskSizeGb, + licenses, sourceDisk, sourceDiskId, storageBytes, storageBytesStatus); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(SnapshotInfo.class) + && Objects.equals(toPb(), ((SnapshotInfo) obj).toPb()); + } + + SnapshotInfo setProjectId(String projectId) { + return toBuilder() + .setSnapshotId(snapshotId.setProjectId(projectId)) + .setSourceDisk(sourceDisk.setProjectId(projectId)) + .build(); + } + + Snapshot toPb() { + Snapshot snapshotPb = new Snapshot(); + if (generatedId != null) { + snapshotPb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + snapshotPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + snapshotPb.setName(snapshotId.getSnapshot()); + snapshotPb.setDescription(description); + snapshotPb.setSelfLink(snapshotId.getSelfLink()); + if (status != null) { + snapshotPb.setStatus(status.name()); + } + snapshotPb.setDiskSizeGb(diskSizeGb); + if (licenses != null) { + snapshotPb.setLicenses(Lists.transform(licenses, LicenseId.TO_URL_FUNCTION)); + } + if (sourceDisk != null) { + snapshotPb.setSourceDisk(sourceDisk.getSelfLink()); + } + snapshotPb.setSourceDiskId(sourceDiskId); + snapshotPb.setStorageBytes(storageBytes); + if (storageBytesStatus != null) { + snapshotPb.setStorageBytesStatus(storageBytesStatus.name()); + } + return snapshotPb; + } + + /** + * Returns a builder for a {@code SnapshotInfo} object given the snapshot identity and a source + * disk identity. + */ + public static Builder newBuilder(SnapshotId snapshotId, DiskId source) { + return new BuilderImpl().setSnapshotId(snapshotId).setSourceDisk(source); + } + + /** + * Returns a {@code SnapshotInfo} object given the snapshot identity and a source disk identity. + */ + public static SnapshotInfo of(SnapshotId snapshotId, DiskId source) { + return newBuilder(snapshotId, source).build(); + } + + static SnapshotInfo fromPb(Snapshot snapshotPb) { + return new BuilderImpl(snapshotPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java new file mode 100644 index 000000000000..d3f0c0970126 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardDiskConfiguration.java @@ -0,0 +1,131 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.services.compute.model.Disk; + +import java.util.Objects; + +/** + * A Google Compute Engine standard persistent disk configuration. This class allows users to create + * a disk given its type and size. + * + * @see Block Storage + */ +public class StandardDiskConfiguration extends DiskConfiguration { + + private static final long serialVersionUID = -6974045909359567054L; + + /** + * A builder for {@code StandardDiskConfiguration} objects. + */ + public static class Builder + extends DiskConfiguration.Builder { + + private Builder() { + super(Type.STANDARD); + } + + private Builder(StandardDiskConfiguration configuration) { + super(configuration); + } + + private Builder(Disk diskPb) { + super(Type.STANDARD, diskPb); + } + + /** + * Sets the size of the persistent disk, in GB. If not set, 500GB is used. + */ + @Override + public Builder setSizeGb(Long sizeGb) { + super.setSizeGb(sizeGb); + return this; + } + + /** + * Creates a {@code StandardDiskConfiguration} object. + */ + @Override + public StandardDiskConfiguration build() { + return new StandardDiskConfiguration(this); + } + } + + private StandardDiskConfiguration(Builder builder) { + super(builder); + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final int hashCode() { + return Objects.hash(baseHashCode()); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(StandardDiskConfiguration.class) + && baseEquals((StandardDiskConfiguration) obj); + } + + @Override + StandardDiskConfiguration setProjectId(String projectId) { + if (getDiskType() == null || getDiskType().getProject() != null) { + return this; + } + return toBuilder().setDiskType(getDiskType().setProjectId(projectId)).build(); + } + + /** + * Returns a builder for a {@code StandardDiskConfiguration} object. + */ + public static Builder newBuilder() { + return new Builder(); + } + + /** + * Returns a {@code StandardDiskConfiguration} object given the disk type. + */ + public static StandardDiskConfiguration of(DiskTypeId diskType) { + return newBuilder().setDiskType(diskType).build(); + } + + /** + * Returns a {@code StandardDiskConfiguration} object given the disk size in GB. + */ + public static StandardDiskConfiguration of(long sizeGb) { + return newBuilder().setSizeGb(sizeGb).build(); + } + + /** + * Returns a {@code StandardDiskConfiguration} object given the disk type and size in GB. + */ + public static StandardDiskConfiguration of(DiskTypeId diskType, long sizeGb) { + return newBuilder().setDiskType(diskType).setSizeGb(sizeGb).build(); + } + + @SuppressWarnings("unchecked") + static StandardDiskConfiguration fromPb(Disk diskPb) { + return new Builder(diskPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java new file mode 100644 index 000000000000..892f37ab472b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StandardNetworkConfiguration.java @@ -0,0 +1,102 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Network; +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * A Google Compute Engine standard network configuration. This class allows users to create a + * network with its own address range. A network created with a {@code StandardNetworkConfiguration} + * does not support the creation of subnetworks. + * + * @see Using Networks and Firewalls + */ +public class StandardNetworkConfiguration extends NetworkConfiguration { + + private static final long serialVersionUID = -5143748459659467966L; + + private final String ipRange; + private final String gatewayAddress; + + StandardNetworkConfiguration(String ipRange, String gatewayAddress) { + super(Type.STANDARD); + this.ipRange = checkNotNull(ipRange); + this.gatewayAddress = gatewayAddress; + } + + /** + * Returns the range of internal IPv4 addresses that are legal on this network. This range is a + * CIDR specification, for example: {@code 192.168.0.0/16}. + * + * @see CIDR + */ + public String getIpRange() { + return ipRange; + } + + /** + * Returns the gateway IPv4 address for this networks. This value is read only and is selected by + * Google Compute Engine, typically as the first usable address in {@code ipRange}. + */ + public String getGatewayAddress() { + return gatewayAddress; + } + + @Override + public final int hashCode() { + return Objects.hash(super.baseHashCode(), ipRange, gatewayAddress); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(StandardNetworkConfiguration.class) + && Objects.equals(toPb(), ((StandardNetworkConfiguration) obj).toPb()); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper().add("ipRange", ipRange).add("gatewayAddress", gatewayAddress); + } + + @Override + Network toPb() { + return new Network().setIPv4Range(ipRange).setGatewayIPv4(gatewayAddress); + } + + /** + * Returns a {@code StandardNetworkConfiguration} object given the range of internal addresses + * that are legal on this network. {@code ipRange} must be a CIDR specification, for example: + * {@code 192.168.0.0/16}. + * + * @see CIDR + */ + public static StandardNetworkConfiguration of(String ipRange) { + return new StandardNetworkConfiguration(ipRange, null); + } + + @SuppressWarnings("unchecked") + static StandardNetworkConfiguration fromPb(Network networkPb) { + return new StandardNetworkConfiguration(networkPb.getIPv4Range(), networkPb.getGatewayIPv4()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java new file mode 100644 index 000000000000..7af2f719d619 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/StorageImageConfiguration.java @@ -0,0 +1,204 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Image; +import com.google.common.base.MoreObjects; + +import java.util.Objects; + +/** + * A Google Compute Engine image configuration used to create images from a Google Cloud Storage + * URL where the disk image is stored. + */ +public class StorageImageConfiguration extends ImageConfiguration { + + private static final long serialVersionUID = 8160447986545005880L; + + private final ContainerType containerType; + private final String sha1; + private final String source; + + /** + * The format used to encode and transmit the block device. The only supported value is + * {@code TAR}. This is just a container and transmission format, not a runtime format. + */ + public enum ContainerType { + TAR + } + + /** + * A builder for {@code StorageImageConfiguration} objects. + */ + public static final class Builder + extends ImageConfiguration.Builder { + + private ContainerType containerType; + private String sha1; + private String source; + + private Builder() { + super(Type.STORAGE); + } + + private Builder(StorageImageConfiguration imageConfiguration) { + super(imageConfiguration); + this.containerType = imageConfiguration.containerType; + this.sha1 = imageConfiguration.sha1; + this.source = imageConfiguration.source; + } + + private Builder(Image imagePb) { + super(Type.STORAGE, imagePb); + if (imagePb.getRawDisk().getContainerType() != null) { + this.containerType = ContainerType.valueOf(imagePb.getRawDisk().getContainerType()); + } + this.sha1 = imagePb.getRawDisk().getSha1Checksum(); + this.source = imagePb.getRawDisk().getSource(); + } + + /** + * Sets the format used to encode and transmit the block device. The only supported value is + * {@code TAR}. This is just a container and transmission format, not a runtime format. + */ + public Builder setContainerType(ContainerType containerType) { + this.containerType = containerType; + return this; + } + + /** + * Sets the SHA1 checksum of the disk image before unpackaging. + */ + public Builder setSha1(String sha1) { + this.sha1 = sha1; + return this; + } + + /** + * Sets the full Google Cloud Storage URL where the disk image is stored (e.g. + * {@code gs://bucket/file}). + */ + public Builder setSource(String source) { + this.source = checkNotNull(source); + return this; + } + + /** + * Creates a {@code StorageImageConfiguration} object. + */ + @Override + public StorageImageConfiguration build() { + return new StorageImageConfiguration(this); + } + } + + private StorageImageConfiguration(Builder builder) { + super(builder); + this.source = checkNotNull(builder.source); + this.containerType = builder.containerType; + this.sha1 = builder.sha1; + } + + /** + * Returns the format used to encode and transmit the block device. This is just a container and + * transmission format, not a runtime format. + */ + public ContainerType getContainerType() { + return containerType; + } + + /** + * Returns the SHA1 checksum of the disk image before unpackaging. + */ + public String getSha1() { + return sha1; + } + + /** + * Returns the full Google Cloud Storage URL where the disk image is stored (e.g. + * {@code gs://bucket/file}). + */ + public String getSource() { + return source; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("source", source) + .add("containerType", containerType) + .add("sha1", sha1); + } + + @Override + public final int hashCode() { + return Objects.hash(baseHashCode(), source, containerType, sha1); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(StorageImageConfiguration.class) + && Objects.equals(toPb(), ((StorageImageConfiguration) obj).toPb()); + } + + @Override + StorageImageConfiguration setProjectId(String projectId) { + return this; + } + + @Override + Image toPb() { + Image.RawDisk rawDiskPb = new Image.RawDisk(); + rawDiskPb.setSource(source); + rawDiskPb.setSha1Checksum(sha1); + if (containerType != null) { + rawDiskPb.setContainerType(containerType.name()); + } + Image imagePb = super.toPb(); + return imagePb.setRawDisk(rawDiskPb); + } + + /** + * Creates a {@code StorageImageConfiguration} builder given the full Google Cloud Storage URL + * where the disk image is stored. + */ + public static Builder newBuilder(String source) { + return new Builder().setSource(source); + } + + /** + * Creates a {@code StorageImageConfiguration} object given the full Google Cloud Storage URL + * where the disk image is stored. + */ + public static StorageImageConfiguration of(String source) { + return newBuilder(source).build(); + } + + @SuppressWarnings("unchecked") + static StorageImageConfiguration fromPb(Image imagePb) { + return new Builder(imagePb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java new file mode 100644 index 000000000000..4cd550952189 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetNetworkConfiguration.java @@ -0,0 +1,111 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.services.compute.model.Network; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; + +import java.util.List; +import java.util.Objects; + +/** + * A Google Compute Engine configuration for networks that support subnetworks, up to one per + * region, each with its own address range. Subnetworks can be either automatically or manually + * created, depending on the value of {@link SubnetNetworkConfiguration#autoCreateSubnetworks()}. + * + * @see Using Networks and Firewalls + */ +public class SubnetNetworkConfiguration extends NetworkConfiguration { + + private static final long serialVersionUID = -5286394393047479494L; + + private final Boolean autoCreateSubnetworks; + private final List subnetworks; + + SubnetNetworkConfiguration(boolean autoCreateSubnetworks, List subnetworks) { + super(Type.SUBNET); + this.autoCreateSubnetworks = autoCreateSubnetworks; + this.subnetworks = subnetworks; + } + + /** + * Returns whether the subnetworks should be automatically created. When set to {@code true}, the + * network is created in "auto subnet mode". When set to {@code false}, the network is in + * "custom subnet mode". In "auto subnet mode", a subnetwork per region is automatically created. + * In "custom subnet mode", a custom topology of subnetworks can be created by the user. + */ + public Boolean autoCreateSubnetworks() { + return autoCreateSubnetworks; + } + + /** + * Returns the identities of all networks in this network. + */ + public List getSubnetworks() { + return subnetworks; + } + + @Override + public final int hashCode() { + return Objects.hash(autoCreateSubnetworks, subnetworks); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(SubnetNetworkConfiguration.class) + && Objects.equals(toPb(), ((SubnetNetworkConfiguration) obj).toPb()); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("autoCreateSubnetworks", autoCreateSubnetworks) + .add("subnetworks", subnetworks); + } + + @Override + Network toPb() { + Network networkPb = new Network().setAutoCreateSubnetworks(autoCreateSubnetworks); + if (subnetworks != null) { + networkPb.setSubnetworks(Lists.transform(subnetworks, SubnetworkId.TO_URL_FUNCTION)); + } + return networkPb; + } + + /** + * Returns a {@code SubnetNetworkConfiguration} object. The {@code autoCreateSubnetworks} + * parameter sets whether subnetworks should be automatically created. When set to {@code true}, + * the network is created in "auto subnet mode". When set to {@code false}, the network is in + * "custom subnet mode". In "auto subnet mode", a subnetwork per region is automatically created. + * In "custom subnet mode", a custom topology of subnetworks can be created by the user. + */ + public static SubnetNetworkConfiguration of(boolean autoCreateSubnetworks) { + return new SubnetNetworkConfiguration(autoCreateSubnetworks, null); + } + + @SuppressWarnings("unchecked") + static SubnetNetworkConfiguration fromPb(Network networkPb) { + List subnetworks = null; + if (networkPb.getSubnetworks() != null) { + subnetworks = Lists.transform(networkPb.getSubnetworks(), SubnetworkId.FROM_URL_FUNCTION); + } + return new SubnetNetworkConfiguration(networkPb.getAutoCreateSubnetworks(), subnetworks); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java new file mode 100644 index 000000000000..bf0c65dc387c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Subnetwork.java @@ -0,0 +1,191 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.compute.deprecated.Compute.OperationOption; +import com.google.cloud.compute.deprecated.Compute.SubnetworkOption; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Objects; + +/** + * A Google Compute Engine Subnetwork. Subnetworks segments your cloud network IP space into + * subnetworks. Subnetwork prefixes can be automatically allocated, or you can create a custom + * topology. Objects of this class are immutable. To get a {@code Subnetwork} object with the most + * recent information use {@link #reload}. {@code Subnetwork} adds a layer of service-related + * functionality over {@link SubnetworkInfo}. + * + * @see Subnetworks + */ +public class Subnetwork extends SubnetworkInfo { + + private static final long serialVersionUID = 8608280908101278096L; + + private final ComputeOptions options; + private transient Compute compute; + + /** + * A builder for {@code Subnetwork} objects. + */ + public static class Builder extends SubnetworkInfo.Builder { + + private final Compute compute; + private final SubnetworkInfo.BuilderImpl infoBuilder; + + Builder(Compute compute, SubnetworkId subnetworkId, NetworkId networkId, String ipRange) { + this.compute = compute; + this.infoBuilder = new SubnetworkInfo.BuilderImpl(subnetworkId, networkId, ipRange); + this.infoBuilder.setSubnetworkId(subnetworkId); + this.infoBuilder.setNetwork(networkId); + this.infoBuilder.setIpRange(ipRange); + } + + Builder(Subnetwork subnetwork) { + this.compute = subnetwork.compute; + this.infoBuilder = new SubnetworkInfo.BuilderImpl(subnetwork); + } + + @Override + Builder setGeneratedId(String generatedId) { + infoBuilder.setGeneratedId(generatedId); + return this; + } + + @Override + Builder setCreationTimestamp(Long creationTimestamp) { + infoBuilder.setCreationTimestamp(creationTimestamp); + return this; + } + + @Override + public Builder setSubnetworkId(SubnetworkId subnetworkId) { + infoBuilder.setSubnetworkId(subnetworkId); + return this; + } + + + @Override + public Builder setDescription(String description) { + infoBuilder.setDescription(description); + return this; + } + + @Override + Builder setGatewayAddress(String gatewayAddress) { + infoBuilder.setGatewayAddress(gatewayAddress); + return this; + } + + @Override + public Builder setNetwork(NetworkId network) { + infoBuilder.setNetwork(network); + return this; + } + + @Override + public Builder setIpRange(String ipRange) { + infoBuilder.setIpRange(ipRange); + return this; + } + + @Override + public Subnetwork build() { + return new Subnetwork(compute, infoBuilder); + } + } + + Subnetwork(Compute compute, SubnetworkInfo.BuilderImpl infoBuilder) { + super(infoBuilder); + this.compute = checkNotNull(compute); + this.options = compute.getOptions(); + } + + /** + * Checks if this subnetwork exists. + * + * @return {@code true} if this subnetwork exists, {@code false} otherwise + * @throws ComputeException upon failure + */ + public boolean exists() { + return reload(SubnetworkOption.fields()) != null; + } + + /** + * Fetches current subnetwork' latest information. Returns {@code null} if the subnetwork does not + * exist. + * + * @param options subnetwork options + * @return an {@code Subnetwork} object with latest information or {@code null} if not found + * @throws ComputeException upon failure + */ + public Subnetwork reload(SubnetworkOption... options) { + return compute.getSubnetwork(getSubnetworkId(), options); + } + + /** + * Deletes this subnetwork. If this subnetwork was auto-generated deletion will fail. + * + * @return an operation object if delete request was successfully sent, {@code null} if the + * subnetwork was not found + * @throws ComputeException upon failure + */ + public Operation delete(OperationOption... options) { + return compute.deleteSubnetwork(getSubnetworkId(), options); + } + + /** + * Returns the subnetwork's {@code Compute} object used to issue requests. + */ + public Compute getCompute() { + return compute; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Subnetwork.class)) { + return false; + } + Subnetwork other = (Subnetwork) obj; + return Objects.equals(toPb(), other.toPb()) && Objects.equals(options, other.options); + } + + @Override + public final int hashCode() { + return Objects.hash(super.hashCode(), options); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.compute = options.getService(); + } + + static Subnetwork fromPb(Compute compute, + com.google.api.services.compute.model.Subnetwork subnetworkPb) { + return new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(subnetworkPb)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java new file mode 100644 index 000000000000..84bb5b903b41 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java @@ -0,0 +1,179 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine subnetwork. + */ +public final class SubnetworkId extends ResourceId { + + static final Function FROM_URL_FUNCTION = + new Function() { + @Override + public SubnetworkId apply(String pb) { + return SubnetworkId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = + new Function() { + @Override + public String apply(SubnetworkId zoneId) { + return zoneId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "regions/([^/]+)/subnetworks/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -5451054513760540282L; + + private final String region; + private final String subnetwork; + + private SubnetworkId(String project, String region, String subnetwork) { + super(project); + this.region = checkNotNull(region); + this.subnetwork = checkNotNull(subnetwork); + } + + /** + * Returns the name of the region this subnetwork belongs to. + */ + public String getRegion() { + return region; + } + + /** + * Returns the identity of the region this subnetwork belongs to. + */ + public RegionId getRegionId() { + return RegionId.of(getProject(), region); + } + + /** + * Returns the name of the subnetwork. The name must be 1-63 characters long and comply with + * RFC1035. Specifically, the name must match the regular expression + * {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, + * and all following characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. + * + * @see RFC1035 + */ + public String getSubnetwork() { + return subnetwork; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/regions/" + region + "/subnetworks/" + subnetwork; + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("region", region).add("subnetwork", subnetwork); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), region, subnetwork); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof SubnetworkId)) { + return false; + } + SubnetworkId other = (SubnetworkId) obj; + return baseEquals(other) + && Objects.equals(region, other.region) + && Objects.equals(subnetwork, other.subnetwork); + } + + @Override + SubnetworkId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return SubnetworkId.of(projectId, getRegion(), subnetwork); + } + + /** + * Returns a subnetwork identity given the region identity and the subnetwork name. The subnetwork + * name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match + * the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must + * be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static SubnetworkId of(RegionId regionId, String subnetwork) { + return new SubnetworkId(regionId.getProject(), regionId.getRegion(), subnetwork); + } + + /** + * Returns a subnetwork identity given the region and subnetwork names. The subnetwork name must + * be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular + * expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static SubnetworkId of(String region, String subnetwork) { + return new SubnetworkId(null, region, subnetwork); + } + + /** + * Returns a subnetwork identity given project, region and subnetwork names. The subnetwork name + * must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the + * regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase letter, or digit, + * except the last character, which cannot be a dash. + * + * @see RFC1035 + */ + public static SubnetworkId of(String project, String region, String subnetwork) { + return new SubnetworkId(project, region, subnetwork); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a subnetwork URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static SubnetworkId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid subnetwork URL"); + } + return SubnetworkId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java new file mode 100644 index 000000000000..a7a99ee21f95 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java @@ -0,0 +1,348 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.services.compute.model.Subnetwork; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Objects; + +/** + * A Google Compute Engine subnetwork. Compute Engine subnetworks allow you to segment your Compute + * Engine network IP space into subnetworks. Subnetworks for a Compute Engine network can be + * automatically allocated, or you can create a custom topology. + * + * @see Subnetworks + */ +public class SubnetworkInfo implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public SubnetworkInfo apply(Subnetwork pb) { + return SubnetworkInfo.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public Subnetwork apply(SubnetworkInfo subnetwork) { + return subnetwork.toPb(); + } + }; + + private static final long serialVersionUID = 7491176262675441579L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final String generatedId; + private final SubnetworkId subnetworkId; + private final Long creationTimestamp; + private final String description; + private final String gatewayAddress; + private final NetworkId network; + private final String ipRange; + + /** + * A builder for {@code SubnetworkInfo} objects. + */ + public abstract static class Builder { + + abstract Builder setGeneratedId(String generatedId); + + abstract Builder setCreationTimestamp(Long creationTimestamp); + + /** + * Sets the identity of the subnework. + */ + public abstract Builder setSubnetworkId(SubnetworkId subnetworkId); + + /** + * Sets an optional textual description of the subnetwork. + */ + public abstract Builder setDescription(String description); + + abstract Builder setGatewayAddress(String gatewayAddress); + + /** + * Sets the identity of the network to which this subnetwork belongs. Only networks that are in + * subnet mode can have subnetworks. + */ + public abstract Builder setNetwork(NetworkId network); + + /** + * Sets the range of internal IPv4 addresses that are owned by this subnetwork. This range must + * be a CIDR specification, for example: {@code 192.168.0.0/16}. Ranges must be unique and + * non-overlapping within a network. + * + * @see CIDR + */ + public abstract Builder setIpRange(String ipRange); + + /** + * Creates a {@code SubnetworkInfo} object. + */ + public abstract SubnetworkInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String generatedId; + private SubnetworkId subnetworkId; + private Long creationTimestamp; + private String description; + private String gatewayAddress; + private NetworkId network; + private String ipRange; + + BuilderImpl(SubnetworkId subnetworkId, NetworkId network, String ipRange) { + this.subnetworkId = checkNotNull(subnetworkId); + this.network = checkNotNull(network); + this.ipRange = checkNotNull(ipRange); + } + + BuilderImpl(SubnetworkInfo subnetworkInfo) { + this.generatedId = subnetworkInfo.generatedId; + this.creationTimestamp = subnetworkInfo.creationTimestamp; + this.subnetworkId = subnetworkInfo.subnetworkId; + this.description = subnetworkInfo.description; + this.gatewayAddress = subnetworkInfo.gatewayAddress; + this.network = subnetworkInfo.network; + this.ipRange = subnetworkInfo.ipRange; + } + + BuilderImpl(Subnetwork subnetworkPb) { + if (subnetworkPb.getId() != null) { + this.generatedId = subnetworkPb.getId().toString(); + } + if (subnetworkPb.getCreationTimestamp() != null) { + this.creationTimestamp = + TIMESTAMP_FORMATTER.parseMillis(subnetworkPb.getCreationTimestamp()); + } + this.subnetworkId = SubnetworkId.fromUrl(subnetworkPb.getSelfLink()); + this.description = subnetworkPb.getDescription(); + this.gatewayAddress = subnetworkPb.getGatewayAddress(); + if (subnetworkPb.getNetwork() != null) { + this.network = NetworkId.fromUrl(subnetworkPb.getNetwork()); + } + this.ipRange = subnetworkPb.getIpCidrRange(); + } + + @Override + BuilderImpl setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + @Override + BuilderImpl setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + @Override + public BuilderImpl setSubnetworkId(SubnetworkId subnetworkId) { + this.subnetworkId = checkNotNull(subnetworkId); + return this; + } + + @Override + public BuilderImpl setDescription(String description) { + this.description = description; + return this; + } + + @Override + BuilderImpl setGatewayAddress(String gatewayAddress) { + this.gatewayAddress = gatewayAddress; + return this; + } + + @Override + public BuilderImpl setNetwork(NetworkId network) { + this.network = checkNotNull(network); + return this; + } + + @Override + public BuilderImpl setIpRange(String ipRange) { + this.ipRange = checkNotNull(ipRange); + return this; + } + + @Override + public SubnetworkInfo build() { + return new SubnetworkInfo(this); + } + } + + SubnetworkInfo(BuilderImpl builder) { + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.subnetworkId = checkNotNull(builder.subnetworkId); + this.description = builder.description; + this.gatewayAddress = builder.gatewayAddress; + this.network = builder.network; + this.ipRange = builder.ipRange; + } + + /** + * Returns the service-generated unique identifier for the subnetwork. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns the subnetwork identity. + */ + public SubnetworkId getSubnetworkId() { + return subnetworkId; + } + + /** + * Returns a textual description of the subnetwork. + */ + public String getDescription() { + return description; + } + + /** + * Returns the gateway IPv4 address for this subnetwork, selected by the service. + */ + public String getGatewayAddress() { + return gatewayAddress; + } + + /** + * Returns the identity of the network to which this subnetwork belongs. Only networks that are in + * subnet mode can have subnetworks. + */ + public NetworkId getNetwork() { + return network; + } + + /** + * Returns the range of internal IPv4 addresses that are owned by this subnetwork. This range is a + * CIDR specification, for example: {@code 192.168.0.0/16}. Ranges must be unique and + * non-overlapping within a network. + * + * @see CIDR + */ + public String getIpRange() { + return ipRange; + } + + /** + * Returns a builder for the current subnetwork. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("subnetworkId", subnetworkId) + .add("description", description) + .add("gatewayAddress", gatewayAddress) + .add("network", network) + .add("ipRange", ipRange) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(generatedId, creationTimestamp, subnetworkId, description, gatewayAddress, + network, ipRange); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(SubnetworkInfo.class) + && Objects.equals(toPb(), ((SubnetworkInfo) obj).toPb()); + } + + SubnetworkInfo setProjectId(String projectId) { + return toBuilder() + .setSubnetworkId(subnetworkId.setProjectId(projectId)) + .setNetwork(network.setProjectId(projectId)) + .build(); + } + + Subnetwork toPb() { + Subnetwork subnetworkPb = new Subnetwork(); + if (generatedId != null) { + subnetworkPb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + subnetworkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + subnetworkPb.setName(subnetworkId.getSubnetwork()); + subnetworkPb.setDescription(description); + subnetworkPb.setSelfLink(subnetworkId.getSelfLink()); + subnetworkPb.setGatewayAddress(gatewayAddress); + subnetworkPb.setNetwork(network.getSelfLink()); + subnetworkPb.setIpCidrRange(ipRange); + return subnetworkPb; + } + + /** + * Returns a builder for a {@code SubnetworkInfo} object given the identity of the subnetwork, the + * identity of the network this subnetwork belongs to and the range of IPv4 addresses owned by + * this subnetwork. {@code ipRange} must be a CIDR specification, for example: + * {@code 192.168.0.0/16}. + * + * @see CIDR + */ + public static Builder newBuilder(SubnetworkId subnetworkId, NetworkId network, String ipRange) { + return new BuilderImpl(subnetworkId, network, ipRange); + } + + /** + * Returns a {@code SubnetworkInfo} object given the identity of the subnetwork, the identity of + * the network this subnetwork belongs to and the range of IPv4 addresses owned by this + * subnetwork. {@code ipRange} must be a CIDR specification, for example: {@code 192.168.0.0/16}. + * + * @see CIDR + */ + public static SubnetworkInfo of(SubnetworkId subnetworkId, NetworkId network, String ipRange) { + return newBuilder(subnetworkId, network, ipRange).build(); + } + + static SubnetworkInfo fromPb(Subnetwork subnetworkPb) { + return new BuilderImpl(subnetworkPb).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java new file mode 100644 index 000000000000..a866613fe615 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Tags.java @@ -0,0 +1,227 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * A list of tags for a Google Compute Engine Instance; with associated fingerprint. Tags are used + * to identify valid sources or targets for network firewalls and are specified by the client + * during instance creation. Each tag within the list must comply with RFC1035. + * + * @see RFC1035 + */ +public final class Tags implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public Tags apply(com.google.api.services.compute.model.Tags pb) { + return Tags.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Tags apply(Tags tags) { + return tags.toPb(); + } + }; + + private static final long serialVersionUID = 5627093820497225322L; + + private final List values; + private final String fingerprint; + + /** + * A builder for {@code Tags} objects. + */ + public static final class Builder { + + private List values; + private String fingerprint; + + private Builder() { + values = Lists.newArrayList(); + } + + private Builder(Tags tags) { + this.values = tags.values != null ? Lists.newArrayList(tags.values) + : Lists.newArrayList(); + this.fingerprint = tags.fingerprint; + } + + /** + * Sets a list of tags to apply to an instance. Tags are used to identify valid sources or + * targets for network firewalls. Each tag within the list must comply with RFC1035. + * + * @see RFC1035 + */ + public Builder setValues(Iterable values) { + this.values = Lists.newArrayList(values); + return this; + } + + /** + * Sets a list of tags to apply to an instance. Tags are used to identify valid sources or + * targets for network firewalls. Each tag within the list must comply with RFC1035. + * + * @see RFC1035 + */ + public Builder setValues(String... values) { + this.values = Lists.newArrayList(Arrays.asList(checkNotNull(values))); + return this; + } + + /** + * Adds a tag to the list of tags. Tags are used to identify valid sources or targets for + * network firewalls. The tag must comply with RFC1035. + * + * @see RFC1035 + */ + public Builder add(String tag) { + this.values.add(tag); + return this; + } + + /** + * Sets the fingerprint for the tags. This value is needed to update instance's tags. + */ + public Builder setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Creates a {@code Tags} object. + */ + public Tags build() { + return new Tags(this); + } + } + + private Tags(Builder builder) { + this.values = ImmutableList.copyOf(builder.values); + this.fingerprint = builder.fingerprint; + } + + /** + * Returns a list of tags to apply to an instance. Tags are used to identify valid sources or + * targets for network firewalls. Each tag within the list must comply with RFC1035. + * + * @see RFC1035 + */ + public List getValues() { + return values; + } + + /** + * Returns the fingerprint for the tags. This value is needed to update instance's tags. + */ + public String getFingerprint() { + return fingerprint; + } + + /** + * Returns a builder for the current instance tags. + */ + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("values", values) + .add("fingerprint", fingerprint) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(values, fingerprint); + } + + @Override + public boolean equals(Object obj) { + return obj == this || obj instanceof Tags && Objects.equals(toPb(), ((Tags) obj).toPb()); + } + + com.google.api.services.compute.model.Tags toPb() { + com.google.api.services.compute.model.Tags tagsPb = + new com.google.api.services.compute.model.Tags(); + tagsPb.setFingerprint(fingerprint); + tagsPb.setItems(values); + return tagsPb; + } + + /** + * Returns a builder for a {@code Tags} object given the tags to apply to the instance. Each tag + * within the list must comply with RFC1035. + * + * @see RFC1035 + */ + public static Builder newBuilder(Iterable values) { + return new Builder().setValues(values); + } + + /** + * Returns a builder for a {@code Tags} object given the tags to apply to the instance. Each tag + * within the list must comply with RFC1035. + * + * @see RFC1035 + */ + public static Builder newBuilder(String... values) { + return new Builder().setValues(values); + } + + /** + * Returns a {@code Tags} object given the tags to apply to the instance. Each tag within the + * list must comply with RFC1035. + * + * @see RFC1035 + */ + public static Tags of(Iterable values) { + return newBuilder(values).build(); + } + + /** + * Returns a {@code Tags} object given the tags to apply to the instance. Each tag within the + * list must comply with RFC1035. + * + * @see RFC1035 + */ + public static Tags of(String... values) { + return newBuilder(values).build(); + } + + static Tags fromPb(com.google.api.services.compute.model.Tags tagsPb) { + Builder builder = + newBuilder(tagsPb.getItems() != null ? tagsPb.getItems() : ImmutableList.of()); + return builder.setFingerprint(tagsPb.getFingerprint()).build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java new file mode 100644 index 000000000000..0b455cda7e10 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Zone.java @@ -0,0 +1,303 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.api.core.ApiFunction; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Objects; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +/** + * A Google Compute Engine zone. + * + * @see Region and Zones + */ +public class Zone implements Serializable { + + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public Zone apply(com.google.api.services.compute.model.Zone pb) { + return Zone.fromPb(pb); + } + }; + static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.services.compute.model.Zone apply(Zone region) { + return region.toPb(); + } + }; + + private static final long serialVersionUID = 6113636504417213010L; + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + + private final ZoneId zoneId; + private final String generatedId; + private final Long creationTimestamp; + private final String description; + private final Status status; + private final RegionId region; + private final DeprecationStatus deprecationStatus; + + /** + * Status of the region. + */ + public static final class Status extends StringEnumValue { + private static final long serialVersionUID = -1052872318386811804L; + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public Status apply(String constant) { + return new Status(constant); + } + }; + + private static final StringEnumType type = new StringEnumType( + Status.class, + CONSTRUCTOR); + + public static final Status UP = type.createAndRegister("UP"); + public static final Status DOWN = type.createAndRegister("DOWN"); + + private Status(String constant) { + super(constant); + } + + /** + * Get the Status for the given String constant, and throw an exception if the constant is + * not recognized. + */ + public static Status valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** + * Get the Status for the given String constant, and allow unrecognized values. + */ + public static Status valueOf(String constant) { + return type.valueOf(constant); + } + + /** + * Return the known values for Status. + */ + public static Status[] values() { + return type.values(); + } + } + + static final class Builder { + + private ZoneId zoneId; + private String generatedId; + private Long creationTimestamp; + private String description; + + private Status status; + private RegionId region; + private DeprecationStatus deprecationStatus; + + private Builder() {} + + Builder setZoneId(ZoneId zoneId) { + this.zoneId = zoneId; + return this; + } + + Builder setGeneratedId(String generatedId) { + this.generatedId = generatedId; + return this; + } + + Builder setCreationTimestamp(Long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Builder setStatus(Status status) { + this.status = status; + return this; + } + + Builder setRegion(RegionId region) { + this.region = region; + return this; + } + + Builder setDeprecationStatus(DeprecationStatus deprecationStatus) { + this.deprecationStatus = deprecationStatus; + return this; + } + + Zone build() { + return new Zone(this); + } + } + + private Zone(Builder builder) { + this.zoneId = builder.zoneId; + this.generatedId = builder.generatedId; + this.creationTimestamp = builder.creationTimestamp; + this.description = builder.description; + this.status = builder.status; + this.region = builder.region; + this.deprecationStatus = builder.deprecationStatus; + } + + /** + * Returns the zone's identity. + */ + public ZoneId getZoneId() { + return zoneId; + } + + /** + * Returns the creation timestamp in milliseconds since epoch. + */ + public Long getCreationTimestamp() { + return creationTimestamp; + } + + /** + * Returns an optional textual description of the zone. + */ + public String getDescription() { + return description; + } + + /** + * Returns the service-generated unique identifier for the zone. + */ + public String getGeneratedId() { + return generatedId; + } + + /** + * Returns the status of the zone. + */ + public Status getStatus() { + return status; + } + + /** + * Returns the identity of the region that hosts the zone. + */ + public RegionId getRegion() { + return region; + } + + /** + * Returns the deprecation status of the zone. If {@link DeprecationStatus#getStatus()} is either + * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the zone + * should not be used. Returns {@code null} if the zone is not deprecated. + */ + public DeprecationStatus getDeprecationStatus() { + return deprecationStatus; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("zoneId", zoneId) + .add("generatedId", generatedId) + .add("creationTimestamp", creationTimestamp) + .add("description", description) + .add("status", status) + .add("region", region) + .add("deprecationStatus", deprecationStatus) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(zoneId); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(Zone.class) + && Objects.equals(toPb(), ((Zone) obj).toPb()); + } + + com.google.api.services.compute.model.Zone toPb() { + com.google.api.services.compute.model.Zone zonePb = + new com.google.api.services.compute.model.Zone(); + if (generatedId != null) { + zonePb.setId(new BigInteger(generatedId)); + } + if (creationTimestamp != null) { + zonePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); + } + zonePb.setName(zoneId.getZone()); + zonePb.setDescription(description); + zonePb.setSelfLink(zoneId.getSelfLink()); + if (status != null) { + zonePb.setStatus(status.name()); + } + if (region != null) { + zonePb.setRegion(region.getSelfLink()); + } + if (deprecationStatus != null) { + zonePb.setDeprecated(deprecationStatus.toPb()); + } + return zonePb; + } + + static Builder builder() { + return new Builder(); + } + + static Zone fromPb(com.google.api.services.compute.model.Zone zonePb) { + Builder builder = builder(); + builder.setZoneId(ZoneId.fromUrl(zonePb.getSelfLink())); + if (zonePb.getId() != null) { + builder.setGeneratedId(zonePb.getId().toString()); + } + if (zonePb.getCreationTimestamp() != null) { + builder.setCreationTimestamp(TIMESTAMP_FORMATTER.parseMillis(zonePb.getCreationTimestamp())); + } + builder.setDescription(zonePb.getDescription()); + if (zonePb.getStatus() != null) { + builder.setStatus(Status.valueOf(zonePb.getStatus())); + } + if (zonePb.getRegion() != null) { + builder.setRegion(RegionId.fromUrl(zonePb.getRegion())); + } + if (zonePb.getDeprecated() != null) { + builder.setDeprecationStatus( + DeprecationStatus.fromPb(zonePb.getDeprecated(), ZoneId.FROM_URL_FUNCTION)); + } + return builder.build(); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java new file mode 100644 index 000000000000..6b7fc8028279 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneId.java @@ -0,0 +1,128 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.base.MoreObjects.ToStringHelper; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * A Google Compute Engine zone identity. + */ +public final class ZoneId extends ResourceId { + + static final Function FROM_URL_FUNCTION = new Function() { + @Override + public ZoneId apply(String pb) { + return ZoneId.fromUrl(pb); + } + }; + static final Function TO_URL_FUNCTION = new Function() { + @Override + public String apply(ZoneId zoneId) { + return zoneId.getSelfLink(); + } + }; + + private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = -7635391994812946733L; + + private final String zone; + + private ZoneId(String project, String zone) { + super(project); + this.zone = checkNotNull(zone); + } + + /** + * Returns the name of the zone. + */ + public String getZone() { + return zone; + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/zones/" + zone; + } + + @Override + ToStringHelper toStringHelper() { + return super.toStringHelper().add("zone", zone); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), zone); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ZoneId)) { + return false; + } + ZoneId other = (ZoneId) obj; + return baseEquals(other) && Objects.equals(zone, other.zone); + } + + @Override + ZoneId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return ZoneId.of(projectId, zone); + } + + /** + * Returns a new zone identity given project and zone names. + */ + public static ZoneId of(String project, String zone) { + return new ZoneId(project, zone); + } + + /** + * Returns a new zone identity given zone name. + */ + public static ZoneId of(String zone) { + return ZoneId.of(null, zone); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a zone URL. + * Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return url.matches(REGEX); + } + + static ZoneId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid zone URL"); + } + return ZoneId.of(matcher.group(1), matcher.group(2)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java new file mode 100644 index 000000000000..2e7d10d1d873 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java @@ -0,0 +1,133 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Identity for a Google Compute Engine zone operation. + */ +public final class ZoneOperationId extends OperationId { + + private static final String REGEX = ResourceId.REGEX + "zones/([^/]+)/operations/([^/]+)"; + private static final Pattern PATTERN = Pattern.compile(REGEX); + private static final long serialVersionUID = 4910670262094017392L; + + private final String zone; + + private ZoneOperationId(String project, String zone, String operation) { + super(project, operation); + this.zone = checkNotNull(zone); + } + + @Override + public Type getType() { + return Type.ZONE; + } + + /** + * Returns the name of the zone this operation belongs to. + */ + public String getZone() { + return zone; + } + + /** + * Returns the identity of the zone this address belongs to. + */ + public ZoneId getZoneId() { + return ZoneId.of(getProject(), zone); + } + + @Override + public String getSelfLink() { + return super.getSelfLink() + "/zones/" + zone + "/operations/" + getOperation(); + } + + @Override + MoreObjects.ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("zone", zone); + } + + @Override + public int hashCode() { + return Objects.hash(baseHashCode(), zone); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ZoneOperationId)) { + return false; + } + ZoneOperationId other = (ZoneOperationId) obj; + return baseEquals(other) && Objects.equals(zone, other.zone); + } + + @Override + ZoneOperationId setProjectId(String projectId) { + if (getProject() != null) { + return this; + } + return ZoneOperationId.of(projectId, zone, getOperation()); + } + + /** + * Returns a zone operation identity given the zone identity and the operation name. + */ + public static ZoneOperationId of(ZoneId zoneId, String operation) { + return new ZoneOperationId(zoneId.getProject(), zoneId.getZone(), operation); + } + + /** + * Returns a zone operation identity given the zone and operation names. + */ + public static ZoneOperationId of(String zone, String operation) { + return new ZoneOperationId(null, zone, operation); + } + + /** + * Returns a zone operation identity given project, zone and operation names. + */ + public static ZoneOperationId of(String project, String zone, String operation) { + return new ZoneOperationId(project, zone, operation); + } + + /** + * Returns {@code true} if the provided string matches the expected format of a zone operation + * URL. Returns {@code false} otherwise. + */ + static boolean matchesUrl(String url) { + return PATTERN.matcher(url).matches(); + } + + static ZoneOperationId fromUrl(String url) { + Matcher matcher = PATTERN.matcher(url); + if (!matcher.matches()) { + throw new IllegalArgumentException(url + " is not a valid zone operation URL"); + } + return ZoneOperationId.of(matcher.group(1), matcher.group(2), matcher.group(3)); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java new file mode 100644 index 000000000000..a951997e09ff --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/package-info.java @@ -0,0 +1,59 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client for Google Compute Engine – High-performance, scalable virtual machines. + * + *

Here's a simple usage example for using google-cloud from App/Compute Engine. This example + * shows how to create a snapshot from an existing disk. For the complete source code see + * + * CreateSnapshot.java. + *

 {@code
+ * Compute compute = ComputeOptions.getDefaultInstance().getService();
+ * DiskId diskId = DiskId.of("us-central1-a", "disk-name");
+ * Disk disk = compute.getDisk(diskId, Compute.DiskOption.fields());
+ * if (disk != null) {
+ *   String snapshotName = "disk-name-snapshot";
+ *   Operation operation = disk.createSnapshot(snapshotName);
+ *   operation = operation.waitFor();
+ *   if (operation.getErrors() == null) {
+ *     // use snapshot
+ *     Snapshot snapshot = compute.getSnapshot(snapshotName);
+ *   }
+ * }}
+ *

This second example shows how to create a virtual machine instance. Complete source code can + * be found at + * + * CreateInstance.java. + *

 {@code
+ * Compute compute = ComputeOptions.getDefaultInstance().getService();
+ * ImageId imageId = ImageId.of("debian-cloud", "debian-8-jessie-v20160329");
+ * NetworkId networkId = NetworkId.of("default");
+ * AttachedDisk attachedDisk = AttachedDisk.of(AttachedDisk.CreateDiskConfiguration.of(imageId));
+ * NetworkInterface networkInterface = NetworkInterface.of(networkId);
+ * InstanceId instanceId = InstanceId.of("us-central1-a", "instance-name");
+ * MachineTypeId machineTypeId = MachineTypeId.of("us-central1-a", "n1-standard-1");
+ * Operation operation =
+ *     compute.create(InstanceInfo.of(instanceId, machineTypeId, attachedDisk, networkInterface));
+ * operation = operation.waitFor();
+ * if (operation.getErrors() == null) {
+ *   // use instance
+ *   Instance instance = compute.getInstance(instanceId);
+ * }}
+ * + * @see Google Cloud Compute + */ +package com.google.cloud.compute.deprecated; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java new file mode 100644 index 000000000000..d192bf5cd222 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/ComputeRpcFactory.java @@ -0,0 +1,27 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.spi; + +import com.google.cloud.compute.deprecated.ComputeOptions; +import com.google.cloud.spi.ServiceRpcFactory; + +/** + * An interface for Compute RPC factory. + * Implementation will be loaded via {@link java.util.ServiceLoader}. + */ +public interface ComputeRpcFactory extends ServiceRpcFactory { +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java new file mode 100644 index 000000000000..768b4d02112d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java @@ -0,0 +1,650 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.spi.v1; + +import com.google.api.services.compute.model.AccessConfig; +import com.google.api.services.compute.model.Address; +import com.google.api.services.compute.model.AttachedDisk; +import com.google.api.services.compute.model.DeprecationStatus; +import com.google.api.services.compute.model.Disk; +import com.google.api.services.compute.model.DiskType; +import com.google.api.services.compute.model.Image; +import com.google.api.services.compute.model.Instance; +import com.google.api.services.compute.model.License; +import com.google.api.services.compute.model.MachineType; +import com.google.api.services.compute.model.Metadata; +import com.google.api.services.compute.model.Network; +import com.google.api.services.compute.model.Operation; +import com.google.api.services.compute.model.Region; +import com.google.api.services.compute.model.Scheduling; +import com.google.api.services.compute.model.Snapshot; +import com.google.api.services.compute.model.Subnetwork; +import com.google.api.services.compute.model.Tags; +import com.google.api.services.compute.model.Zone; +import com.google.cloud.ServiceRpc; +import com.google.cloud.Tuple; +import com.google.cloud.compute.deprecated.ComputeException; +import java.util.Map; + +public interface ComputeRpc extends ServiceRpc { + + // These options are part of the Google Compute Engine query parameters + enum Option { + FIELDS("fields"), + MAX_RESULTS("maxResults"), + PAGE_TOKEN("pageToken"), + FILTER("filter"); + + private final String value; + + Option(String value) { + this.value = value; + } + + public String value() { + return value; + } + + @SuppressWarnings("unchecked") + T get(Map options) { + return (T) options.get(this); + } + + String getString(Map options) { + return get(options); + } + + Long getLong(Map options) { + return get(options); + } + + Boolean getBoolean(Map options) { + return get(options); + } + } + + /** + * Returns the requested disk type or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + DiskType getDiskType(String zone, String diskType, Map options); + + /** + * Lists the disk types in the provided zone. + * + * @throws ComputeException upon failure + */ + Tuple> listDiskTypes(String zone, Map options); + + /** + * Lists disk types. + * + * @throws ComputeException upon failure + */ + Tuple> listDiskTypes(Map options); + + /** + * Returns the requested machine type or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + MachineType getMachineType(String zone, String diskType, Map options); + + /** + * Lists the machine types in the provided zone. + * + * @throws ComputeException upon failure + */ + Tuple> listMachineTypes(String zone, Map options); + + /** + * Lists machine types. + * + * @throws ComputeException upon failure + */ + Tuple> listMachineTypes(Map options); + + /** + * Returns the requested region or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Region getRegion(String region, Map options); + + /** + * Lists the regions. + * + * @throws ComputeException upon failure + */ + Tuple> listRegions(Map options); + + /** + * Returns the requested zone or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Zone getZone(String zone, Map options); + + /** + * Lists the zones. + * + * @throws ComputeException upon failure + */ + Tuple> listZones(Map options); + + /** + * Returns the requested license or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + License getLicense(String project, String license, Map options); + + /** + * Returns the requested global operation or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Operation getGlobalOperation(String operation, Map options); + + /** + * Lists the global operations. + * + * @throws ComputeException upon failure + */ + Tuple> listGlobalOperations(Map options); + + /** + * Deletes the requested global operation. + * + * @return {@code true} if operation was deleted, {@code false} if it was not found + * @throws ComputeException upon failure + */ + boolean deleteGlobalOperation(String operation); + + /** + * Returns the requested region operation or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Operation getRegionOperation(String region, String operation, Map options); + + /** + * Lists the region operations for the provided region. + * + * @throws ComputeException upon failure + */ + Tuple> listRegionOperations(String region, Map options); + + /** + * Deletes the requested region operation. + * + * @return {@code true} if operation was deleted, {@code false} if it was not found + * @throws ComputeException upon failure + */ + boolean deleteRegionOperation(String region, String operation); + + /** + * Returns the requested zone operation or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Operation getZoneOperation(String zone, String operation, Map options); + + /** + * Lists the zone operations for the provided zone. + * + * @throws ComputeException upon failure + */ + Tuple> listZoneOperations(String zone, Map options); + + /** + * Deletes the requested zone operation. + * + * @return {@code true} if operation was deleted, {@code false} if it was not found + * @throws ComputeException upon failure + */ + boolean deleteZoneOperation(String zone, String operation); + + /** + * Returns the requested global address or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Address getGlobalAddress(String address, Map options); + + /** + * Creates a new global address. + * + * @return a global operation for global address' creation + * @throws ComputeException upon failure + */ + Operation createGlobalAddress(Address address, Map options); + + /** + * Lists the global addresses. + * + * @throws ComputeException upon failure + */ + Tuple> listGlobalAddresses(Map options); + + /** + * Deletes the requested global address. + * + * @return a global operation if the request was issued correctly, {@code null} if the address was + * not found + * @throws ComputeException upon failure + */ + Operation deleteGlobalAddress(String address, Map options); + + /** + * Returns the requested region address or {@code null} if not found. + * + * @throws ComputeException upon failure or if region is not found + */ + Address getRegionAddress(String region, String address, Map options); + + /** + * Creates a new region address. + * + * @return a region operation for region address' creation + * @throws ComputeException upon failure or if region is not found + */ + Operation createRegionAddress(String region, Address address, Map options); + + /** + * Lists the regions addresses for the provided region. + * + * @throws ComputeException upon failure or if region is not found + */ + Tuple> listRegionAddresses(String region, Map options); + + /** + * Lists all addresses. + * + * @throws ComputeException upon failure + */ + Tuple> listAddresses(Map options); + + /** + * Deletes the requested region address. + * + * @return a region operation if the request was issued correctly, {@code null} if the address was + * not found + * @throws ComputeException upon failure or if region is not found + */ + Operation deleteRegionAddress(String region, String address, Map options); + + /** + * Creates a snapshot for the specified disk. + * + * @return a zone operation for snapshot creation + * @throws ComputeException upon failure + */ + Operation createSnapshot(String zone, String disk, String snapshot, String description, + Map options); + + /** + * Returns the requested snapshot or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Snapshot getSnapshot(String snapshot, Map options); + + /** + * Lists snapshots. + * + * @throws ComputeException upon failure + */ + Tuple> listSnapshots(Map options); + + /** + * Deletes the requested snapshot. Keep in mind that deleting a single snapshot might not + * necessarily delete all the data for that snapshot. If any data for the snapshot that is marked + * for deletion is needed for subsequent snapshots, the data will be moved to the next snapshot. + * + * @return a global operation if the request was issued correctly, {@code null} if the snapshot + * was not found + * @throws ComputeException upon failure + */ + Operation deleteSnapshot(String snapshot, Map options); + + /** + * Creates a new image. + * + * @return a global operation for image's creation + * @throws ComputeException upon failure + */ + Operation createImage(Image image, Map options); + + /** + * Returns the requested image or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Image getImage(String project, String image, Map options); + + /** + * Lists images in the provided project that are available to the current user. + * + * @throws ComputeException upon failure + */ + Tuple> listImages(String project, Map options); + + /** + * Deletes the requested image. + * + * @return a global operation if the delete request was issued correctly, {@code null} if the + * image was not found + * @throws ComputeException upon failure + */ + Operation deleteImage(String project, String image, Map options); + + /** + * Deprecates the requested image. + * + * @return a global operation if the deprecation request was issued correctly, {@code null} if the + * image was not found + * @throws ComputeException upon failure + */ + Operation deprecateImage(String project, String image, DeprecationStatus deprecationStatus, + Map options); + + /** + * Returns the requested disk or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Disk getDisk(String zone, String disk, Map options); + + /** + * Creates a new disk. + * + * @return a zone operation for disk's creation + * @throws ComputeException upon failure + */ + Operation createDisk(String zone, Disk disk, Map options); + + /** + * Lists the disks for the provided zone. + * + * @throws ComputeException upon failure + */ + Tuple> listDisks(String zone, Map options); + + /** + * Lists disks for all zones. + * + * @throws ComputeException upon failure + */ + Tuple> listDisks(Map options); + + /** + * Deletes the requested disk. + * + * @return a zone operation if the request was issued correctly, {@code null} if the disk was not + * found + * @throws ComputeException upon failure + */ + Operation deleteDisk(String zone, String disk, Map options); + + /** + * Resizes the disk to the requested size. The new size must be larger than the previous one. + * + * @return a zone operation if the request was issued correctly, {@code null} if the disk was not + * found + * @throws ComputeException upon failure or if the new disk size is smaller than the previous one + */ + Operation resizeDisk(String zone, String disk, long sizeGb, Map options); + + /* + * Creates a new subnetwork. + * + * @return a region operation for subnetwork's creation + * @throws ComputeException upon failure + */ + Operation createSubnetwork(String region, Subnetwork subnetwork, Map options); + + /** + * Returns the requested subnetwork or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Subnetwork getSubnetwork(String region, String subnetwork, Map options); + + /** + * Lists subnetworks for the provided region. + * + * @throws ComputeException upon failure + */ + Tuple> listSubnetworks(String region, Map options); + + /** + * Lists subnetworks. + * + * @throws ComputeException upon failure + */ + Tuple> listSubnetworks(Map options); + + /** + * Deletes the requested subnetwork. Any attempt to delete an automatically created subnetwork + * will fail. + * + * @return a region operation if the delete request was issued correctly, {@code null} if the + * subnetwork was not found + * @throws ComputeException upon failure + */ + Operation deleteSubnetwork(String region, String subnetwork, Map options); + + /** + * Creates a new network. + * + * @return a global operation for network's creation + * @throws ComputeException upon failure + */ + Operation createNetwork(Network network, Map options); + + /** + * Returns the requested network or {@code null} if not found. + * + * @throws ComputeException upon failure + */ + Network getNetwork(String network, Map options); + + /** + * Lists networks. + * + * @throws ComputeException upon failure + */ + Tuple> listNetworks(Map options); + + /** + * Deletes the requested network. + * + * @return a global operation if the delete request was issued correctly, {@code null} if the + * network was not found + * @throws ComputeException upon failure + */ + Operation deleteNetwork(String network, Map options); + + /** + * Creates a new instance. + * + * @return a zone operation for instance's creation + * @throws ComputeException upon failure or if the zone does not exist + */ + Operation createInstance(String zone, Instance instance, Map options); + + /** + * Returns the requested instance or {@code null} if not found. + * + * @throws ComputeException upon failure or if the zone does not exist + */ + Instance getInstance(String zone, String instance, Map options); + + /** + * Lists instances for the provided zone. + * + * @throws ComputeException upon failure or if the zone does not exist + */ + Tuple> listInstances(String zone, Map options); + + /** + * Lists instances. + * + * @throws ComputeException upon failure + */ + Tuple> listInstances(Map options); + + /** + * Deletes the requested instance. + * + * @return a zone operation if the delete request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure or if the zone does not exist + */ + Operation deleteInstance(String zone, String instance, Map options); + + /** + * Adds an access configuration to an instance's network interface. + * + * @return a zone operation if the add request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation addAccessConfig(String zone, String instance, String networkInterface, + AccessConfig accessConfig, Map options); + + /** + * Attaches a disk to an instance. + * + * @return a zone operation if the attach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation attachDisk(String zone, String instance, AttachedDisk attachedDisk, + Map options); + + /** + * Deletes an access configuration from an instance's network interface. + * + * @return a zone operation if the delete request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation deleteAccessConfig(String zone, String instance, String networkInterface, + String accessConfig, Map options); + + /** + * Detaches a disk from an instance. + * + * @return a zone operation if the detach request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation detachDisk(String zone, String instance, String deviceName, Map options); + + /** + * Returns the serial port output for the provided instance and port number. {@code port} must be + * between 1 and 4 (inclusive). If {@code port} is {@code null} output for the default port (1) is + * returned. + * + * @return the serial port output or {@code null} if the instance was not found + * @throws ComputeException upon failure + */ + String getSerialPortOutput(String zone, String instance, Integer port, Map options); + + /** + * Resets the provided instance. + * + * @return a zone operation if the reset request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation reset(String zone, String instance, Map options); + + /** + * Sets the auto-delete flag for a disk attached to the provided instance. + * + * @return a zone operation if the flag setting request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation setDiskAutoDelete(String zone, String instance, String deviceName, boolean autoDelete, + Map options); + + /** + * Sets the machine type for the provided instance. Instance must be in {@code TERMINATED} state + * to be able to set its machine type. + * + * @param zone name of the zone in which the instance resides + * @param instance name of the instance + * @param machineTypeUrl full or partial URL of the machine type resource. For example + * {@code zones/us-central1-f/machineTypes/n1-standard-1}. + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setMachineType(String zone, String instance, String machineTypeUrl, + Map options); + + /** + * Sets the metadata for the provided instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setMetadata(String zone, String instance, Metadata metadata, Map options); + + /** + * Sets the scheduling options for the provided instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setScheduling(String zone, String instance, Scheduling scheduling, + Map options); + + /** + * Sets the tags for the provided instance. + * + * @return a zone operation if the set request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation setTags(String zone, String instance, Tags tags, Map options); + + /** + * Starts the provided instance. + * + * @return a zone operation if the start request was issued correctly, {@code null} if the + * instance was not found + * @throws ComputeException upon failure + */ + Operation start(String zone, String instance, Map options); + + /** + * Stops the provided instance. + * + * @return a zone operation if the stop request was issued correctly, {@code null} if the instance + * was not found + * @throws ComputeException upon failure + */ + Operation stop(String zone, String instance, Map options); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java new file mode 100644 index 000000000000..4e9ad9b09b47 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/HttpComputeRpc.java @@ -0,0 +1,1159 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.spi.v1; + +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; + +import com.google.api.client.http.HttpRequestInitializer; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.json.jackson.JacksonFactory; +import com.google.api.services.compute.Compute; +import com.google.api.services.compute.model.AccessConfig; +import com.google.api.services.compute.model.Address; +import com.google.api.services.compute.model.AddressAggregatedList; +import com.google.api.services.compute.model.AddressList; +import com.google.api.services.compute.model.AddressesScopedList; +import com.google.api.services.compute.model.AttachedDisk; +import com.google.api.services.compute.model.DeprecationStatus; +import com.google.api.services.compute.model.Disk; +import com.google.api.services.compute.model.DiskAggregatedList; +import com.google.api.services.compute.model.DiskList; +import com.google.api.services.compute.model.DiskType; +import com.google.api.services.compute.model.DiskTypeAggregatedList; +import com.google.api.services.compute.model.DiskTypeList; +import com.google.api.services.compute.model.DiskTypesScopedList; +import com.google.api.services.compute.model.DisksResizeRequest; +import com.google.api.services.compute.model.DisksScopedList; +import com.google.api.services.compute.model.Image; +import com.google.api.services.compute.model.ImageList; +import com.google.api.services.compute.model.Instance; +import com.google.api.services.compute.model.InstanceAggregatedList; +import com.google.api.services.compute.model.InstanceList; +import com.google.api.services.compute.model.InstancesScopedList; +import com.google.api.services.compute.model.InstancesSetMachineTypeRequest; +import com.google.api.services.compute.model.License; +import com.google.api.services.compute.model.MachineType; +import com.google.api.services.compute.model.MachineTypeAggregatedList; +import com.google.api.services.compute.model.MachineTypeList; +import com.google.api.services.compute.model.MachineTypesScopedList; +import com.google.api.services.compute.model.Metadata; +import com.google.api.services.compute.model.Network; +import com.google.api.services.compute.model.NetworkList; +import com.google.api.services.compute.model.Operation; +import com.google.api.services.compute.model.OperationList; +import com.google.api.services.compute.model.Region; +import com.google.api.services.compute.model.RegionList; +import com.google.api.services.compute.model.Scheduling; +import com.google.api.services.compute.model.SerialPortOutput; +import com.google.api.services.compute.model.Snapshot; +import com.google.api.services.compute.model.SnapshotList; +import com.google.api.services.compute.model.Subnetwork; +import com.google.api.services.compute.model.SubnetworkAggregatedList; +import com.google.api.services.compute.model.SubnetworkList; +import com.google.api.services.compute.model.SubnetworksScopedList; +import com.google.api.services.compute.model.Tags; +import com.google.api.services.compute.model.Zone; +import com.google.api.services.compute.model.ZoneList; +import com.google.cloud.Tuple; +import com.google.cloud.compute.deprecated.ComputeException; +import com.google.cloud.compute.deprecated.ComputeOptions; +import com.google.cloud.http.HttpTransportOptions; +import com.google.common.collect.ImmutableList; +import java.io.IOException; +import java.util.Map; + +public class HttpComputeRpc implements ComputeRpc { + + private final ComputeOptions options; + private final Compute compute; + + public HttpComputeRpc(ComputeOptions options) { + HttpTransportOptions transportOptions = (HttpTransportOptions) options.getTransportOptions(); + HttpTransport transport = transportOptions.getHttpTransportFactory().create(); + HttpRequestInitializer initializer = transportOptions.getHttpRequestInitializer(options); + this.options = options; + compute = new Compute.Builder(transport, new JacksonFactory(), initializer) + .setRootUrl(options.getHost()) + .setApplicationName(options.getApplicationName()) + .build(); + } + + private static ComputeException translate(IOException exception) { + return new ComputeException(exception); + } + + @Override + public DiskType getDiskType(String zone, String diskType, Map options) { + try { + return compute.diskTypes() + .get(this.options.getProjectId(), zone, diskType) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listDiskTypes(String zone, Map options) { + try { + DiskTypeList diskTypesList = compute.diskTypes() + .list(this.options.getProjectId(), zone) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable diskTypes = diskTypesList.getItems(); + return Tuple.of(diskTypesList.getNextPageToken(), diskTypes); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listDiskTypes(Map options) { + try { + DiskTypeAggregatedList aggregatedList = compute.diskTypes() + .aggregatedList(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + // todo(mziccard): uncomment or remove once #711 is closed + // .setFields(FIELDS.getString(options)) + .execute(); + ImmutableList.Builder builder = ImmutableList.builder(); + Map scopedList = aggregatedList.getItems(); + if (scopedList != null) { + for (DiskTypesScopedList diskTypesScopedList : scopedList.values()) { + if (diskTypesScopedList.getDiskTypes() != null) { + builder.addAll(diskTypesScopedList.getDiskTypes()); + } + } + } + return Tuple.>of(aggregatedList.getNextPageToken(), + builder.build()); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public MachineType getMachineType(String zone, String machineType, Map options) { + try { + return compute.machineTypes() + .get(this.options.getProjectId(), zone, machineType) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listMachineTypes(String zone, + Map options) { + try { + MachineTypeList machineTypesList = compute.machineTypes() + .list(this.options.getProjectId(), zone) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable machineTypes = machineTypesList.getItems(); + return Tuple.of(machineTypesList.getNextPageToken(), machineTypes); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listMachineTypes(Map options) { + try { + MachineTypeAggregatedList aggregatedList = compute.machineTypes() + .aggregatedList(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + // todo(mziccard): uncomment or remove once #711 is closed + // .setFields(FIELDS.getString(options)) + .execute(); + ImmutableList.Builder builder = ImmutableList.builder(); + Map scopedList = aggregatedList.getItems(); + if (scopedList != null) { + for (MachineTypesScopedList machineTypesScopedList : scopedList.values()) { + if (machineTypesScopedList.getMachineTypes() != null) { + builder.addAll(machineTypesScopedList.getMachineTypes()); + } + } + } + return Tuple.>of(aggregatedList.getNextPageToken(), + builder.build()); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Region getRegion(String region, Map options) { + try { + return compute.regions() + .get(this.options.getProjectId(), region) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listRegions(Map options) { + try { + RegionList regionsList = compute.regions() + .list(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable regions = regionsList.getItems(); + return Tuple.of(regionsList.getNextPageToken(), regions); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Zone getZone(String zone, Map options) { + try { + return compute.zones() + .get(this.options.getProjectId(), zone) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listZones(Map options) { + try { + ZoneList zonesList = compute.zones() + .list(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable zones = zonesList.getItems(); + return Tuple.of(zonesList.getNextPageToken(), zones); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public License getLicense(String project, String license, Map options) { + try { + return compute.licenses() + .get(project, license) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation getGlobalOperation(String operation, Map options) { + try { + return compute.globalOperations() + .get(this.options.getProjectId(), operation) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listGlobalOperations(Map options) { + try { + OperationList operationsList = compute.globalOperations() + .list(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable operations = operationsList.getItems(); + return Tuple.of(operationsList.getNextPageToken(), operations); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public boolean deleteGlobalOperation(String operation) { + try { + compute.globalOperations().delete(this.options.getProjectId(), operation).execute(); + return true; + } catch (IOException ex) { + return falseForNotFound(ex); + } + } + + @Override + public Operation getRegionOperation(String region, String operation, Map options) { + try { + return compute.regionOperations() + .get(this.options.getProjectId(), region, operation) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listRegionOperations(String region, + Map options) { + try { + OperationList operationsList = compute.regionOperations() + .list(this.options.getProjectId(), region) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable operations = operationsList.getItems(); + return Tuple.of(operationsList.getNextPageToken(), operations); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public boolean deleteRegionOperation(String region, String operation) { + try { + compute.regionOperations().delete(this.options.getProjectId(), region, operation).execute(); + return true; + } catch (IOException ex) { + return falseForNotFound(ex); + } + } + + @Override + public Operation getZoneOperation(String zone, String operation, Map options) { + try { + return compute.zoneOperations() + .get(this.options.getProjectId(), zone, operation) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listZoneOperations(String zone, + Map options) { + try { + OperationList operationsList = compute.zoneOperations() + .list(this.options.getProjectId(), zone) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable operations = operationsList.getItems(); + return Tuple.of(operationsList.getNextPageToken(), operations); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public boolean deleteZoneOperation(String zone, String operation) { + try { + compute.zoneOperations().delete(this.options.getProjectId(), zone, operation).execute(); + return true; + } catch (IOException ex) { + return falseForNotFound(ex); + } + } + + @Override + public Address getGlobalAddress(String address, Map options) { + try { + return compute.globalAddresses() + .get(this.options.getProjectId(), address) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createGlobalAddress(Address address, Map options) { + try { + return compute.globalAddresses() + .insert(this.options.getProjectId(), address) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listGlobalAddresses(Map options) { + try { + AddressList addressList = compute.globalAddresses() + .list(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable
operations = addressList.getItems(); + return Tuple.of(addressList.getNextPageToken(), operations); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteGlobalAddress(String address, Map options) { + try { + return compute.globalAddresses() + .delete(this.options.getProjectId(), address) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Address getRegionAddress(String region, String address, Map options) { + try { + return compute.addresses() + .get(this.options.getProjectId(), region, address) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createRegionAddress(String region, Address address, Map options) { + try { + return compute.addresses() + .insert(this.options.getProjectId(), region, address) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listRegionAddresses(String region, + Map options) { + try { + AddressList addressList = compute.addresses() + .list(this.options.getProjectId(), region) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable
operations = addressList.getItems(); + return Tuple.of(addressList.getNextPageToken(), operations); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listAddresses(Map options) { + try { + AddressAggregatedList aggregatedList = compute.addresses() + .aggregatedList(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + // todo(mziccard): uncomment or remove once #711 is closed + // .setFields(FIELDS.getString(options)) + .execute(); + ImmutableList.Builder
builder = ImmutableList.builder(); + Map scopedList = aggregatedList.getItems(); + if (scopedList != null) { + for (AddressesScopedList addressesScopedList : scopedList.values()) { + if (addressesScopedList.getAddresses() != null) { + builder.addAll(addressesScopedList.getAddresses()); + } + } + } + return Tuple.>of(aggregatedList.getNextPageToken(), + builder.build()); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteRegionAddress(String region, String address, Map options) { + try { + return compute.addresses() + .delete(this.options.getProjectId(), region, address) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createSnapshot(String zone, String disk, String snapshot, String description, + Map options) { + Snapshot snapshotObject = new Snapshot().setName(snapshot).setDescription(description); + try { + return compute.disks() + .createSnapshot(this.options.getProjectId(), zone, disk, snapshotObject) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Snapshot getSnapshot(String snapshot, Map options) { + try { + return compute.snapshots() + .get(this.options.getProjectId(), snapshot) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listSnapshots(Map options) { + try { + SnapshotList snapshotList = compute.snapshots() + .list(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable snapshots = snapshotList.getItems(); + return Tuple.of(snapshotList.getNextPageToken(), snapshots); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteSnapshot(String snapshot, Map options) { + try { + return compute.snapshots() + .delete(this.options.getProjectId(), snapshot) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createImage(Image image, Map options) { + try { + return compute.images() + .insert(this.options.getProjectId(), image) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Image getImage(String project, String image, Map options) { + try { + return compute.images() + .get(project, image) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listImages(String project, Map options) { + try { + ImageList imageList = compute.images() + .list(project) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable images = imageList.getItems(); + return Tuple.of(imageList.getNextPageToken(), images); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteImage(String project, String image, Map options) { + try { + return compute.images() + .delete(project, image) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation deprecateImage(String project, String image, DeprecationStatus deprecationStatus, + Map options) { + try { + return compute.images() + .deprecate(project, image, deprecationStatus) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Disk getDisk(String zone, String disk, Map options) { + try { + return compute.disks() + .get(this.options.getProjectId(), zone, disk) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createDisk(String zone, Disk disk, Map options) { + try { + return compute.disks() + .insert(this.options.getProjectId(), zone, disk) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listDisks(String zone, Map options) { + try { + DiskList diskList = compute.disks() + .list(this.options.getProjectId(), zone) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable disks = diskList.getItems(); + return Tuple.of(diskList.getNextPageToken(), disks); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listDisks(Map options) { + try { + DiskAggregatedList aggregatedList = compute.disks() + .aggregatedList(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + // todo(mziccard): uncomment or remove once #711 is closed + // .setFields(FIELDS.getString(options)) + .execute(); + ImmutableList.Builder builder = ImmutableList.builder(); + Map scopedList = aggregatedList.getItems(); + if (scopedList != null) { + for (DisksScopedList disksScopedList : scopedList.values()) { + if (disksScopedList.getDisks() != null) { + builder.addAll(disksScopedList.getDisks()); + } + } + } + return Tuple.>of(aggregatedList.getNextPageToken(), + builder.build()); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteDisk(String zone, String disk, Map options) { + try { + return compute.disks() + .delete(this.options.getProjectId(), zone, disk) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation resizeDisk(String zone, String disk, long sizeGb, Map options) { + try { + DisksResizeRequest resizeRequest = new DisksResizeRequest().setSizeGb(sizeGb); + return compute.disks().resize(this.options.getProjectId(), zone, disk, resizeRequest) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + public Operation createSubnetwork(String region, Subnetwork subnetwork, Map options) { + try { + return compute.subnetworks() + .insert(this.options.getProjectId(), region, subnetwork) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Subnetwork getSubnetwork(String region, String subnetwork, Map options) { + try { + return compute.subnetworks() + .get(this.options.getProjectId(), region, subnetwork) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listSubnetworks(String region, + Map options) { + try { + SubnetworkList subnetworkList = compute.subnetworks() + .list(this.options.getProjectId(), region) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable subnetworks = subnetworkList.getItems(); + return Tuple.of(subnetworkList.getNextPageToken(), subnetworks); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listSubnetworks(Map options) { + try { + SubnetworkAggregatedList aggregatedList = compute.subnetworks() + .aggregatedList(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + // todo(mziccard): uncomment or remove once #711 is closed + // .setFields(FIELDS.getString(options)) + .execute(); + ImmutableList.Builder builder = ImmutableList.builder(); + Map scopedList = aggregatedList.getItems(); + if (scopedList != null) { + for (SubnetworksScopedList subnetworksScopedList : scopedList.values()) { + if (subnetworksScopedList.getSubnetworks() != null) { + builder.addAll(subnetworksScopedList.getSubnetworks()); + } + } + } + return Tuple.>of(aggregatedList.getNextPageToken(), + builder.build()); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteSubnetwork(String region, String subnetwork, Map options) { + try { + return compute.subnetworks() + .delete(this.options.getProjectId(), region, subnetwork) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createNetwork(Network network, Map options) { + try { + return compute.networks() + .insert(this.options.getProjectId(), network) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Network getNetwork(String network, Map options) { + try { + return compute.networks() + .get(this.options.getProjectId(), network) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listNetworks(Map options) { + try { + NetworkList networkList = compute.networks() + .list(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable networks = networkList.getItems(); + return Tuple.of(networkList.getNextPageToken(), networks); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteNetwork(String network, Map options) { + try { + return compute.networks() + .delete(this.options.getProjectId(), network) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation createInstance(String zone, Instance instance, Map options) { + try { + return compute.instances() + .insert(this.options.getProjectId(), zone, instance) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Instance getInstance(String zone, String instance, Map options) { + try { + return compute.instances() + .get(this.options.getProjectId(), zone, instance) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Tuple> listInstances(String zone, Map options) { + try { + InstanceList instanceList = compute.instances() + .list(this.options.getProjectId(), zone) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setFields(Option.FIELDS.getString(options)) + .execute(); + Iterable instances = instanceList.getItems(); + return Tuple.of(instanceList.getNextPageToken(), instances); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Tuple> listInstances(Map options) { + try { + InstanceAggregatedList aggregatedList = compute.instances() + .aggregatedList(this.options.getProjectId()) + .setFilter(Option.FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + // todo(mziccard): uncomment or remove once #711 is closed + // .setFields(FIELDS.getString(options)) + .execute(); + ImmutableList.Builder builder = ImmutableList.builder(); + Map scopedList = aggregatedList.getItems(); + if (scopedList != null) { + for (InstancesScopedList instancesScopedList : scopedList.values()) { + if (instancesScopedList.getInstances() != null) { + builder.addAll(instancesScopedList.getInstances()); + } + } + } + return Tuple.>of(aggregatedList.getNextPageToken(), + builder.build()); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteInstance(String zone, String instance, Map options) { + try { + return compute.instances() + .delete(this.options.getProjectId(), zone, instance) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation addAccessConfig(String zone, String instance, String networkInterface, + AccessConfig accessConfig, Map options) { + try { + return compute.instances() + .addAccessConfig( + this.options.getProjectId(), zone, instance, networkInterface, accessConfig) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation attachDisk(String zone, String instance, AttachedDisk attachedDisk, + Map options) { + try { + return compute.instances() + .attachDisk(this.options.getProjectId(), zone, instance, attachedDisk) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + + @Override + public Operation deleteAccessConfig(String zone, String instance, String networkInterface, + String accessConfig, Map options) { + try { + return compute.instances() + .deleteAccessConfig(this.options.getProjectId(), zone, instance, accessConfig, + networkInterface) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation detachDisk(String zone, String instance, String deviceName, + Map options) { + try { + return compute.instances() + .detachDisk(this.options.getProjectId(), zone, instance, deviceName) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public String getSerialPortOutput(String zone, String instance, Integer port, + Map options) { + try { + SerialPortOutput portOutput = compute.instances() + .getSerialPortOutput(this.options.getProjectId(), zone, instance) + .setPort(port) + .setFields(Option.FIELDS.getString(options)) + .execute(); + return portOutput != null ? portOutput.getContents() : null; + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation reset(String zone, String instance, Map options) { + try { + return compute.instances() + .reset(this.options.getProjectId(), zone, instance) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation setDiskAutoDelete(String zone, String instance, String deviceName, + boolean autoDelete, Map options) { + try { + return compute.instances() + .setDiskAutoDelete(this.options.getProjectId(), zone, instance, autoDelete, deviceName) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation setMachineType(String zone, String instance, String machineTypeUrl, + Map options) { + try { + InstancesSetMachineTypeRequest request = + new InstancesSetMachineTypeRequest().setMachineType(machineTypeUrl); + return compute.instances() + .setMachineType(this.options.getProjectId(), zone, instance, request) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation setMetadata(String zone, String instance, Metadata metadata, + Map options) { + try { + return compute.instances() + .setMetadata(this.options.getProjectId(), zone, instance, metadata) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation setScheduling(String zone, String instance, Scheduling scheduling, + Map options) { + try { + return compute.instances() + .setScheduling(this.options.getProjectId(), zone, instance, scheduling) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation setTags(String zone, String instance, Tags tags, Map options) { + try { + return compute.instances() + .setTags(this.options.getProjectId(), zone, instance, tags) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation start(String zone, String instance, Map options) { + try { + return compute.instances() + .start(this.options.getProjectId(), zone, instance) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + @Override + public Operation stop(String zone, String instance, Map options) { + try { + return compute.instances() + .stop(this.options.getProjectId(), zone, instance) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } catch (IOException ex) { + return nullForNotFound(ex); + } + } + + /** + * This method returns {@code null} if the error code of {@code exception} was 404, re-throws the + * exception otherwise. + * + * @throws ComputeException if the error code of {@code exception} was not 404 + */ + private static T nullForNotFound(IOException exception) { + ComputeException serviceException = translate(exception); + if (serviceException.getCode() == HTTP_NOT_FOUND) { + return null; + } + throw serviceException; + } + + /** + * This method returns {@code false} if the error code of {@code exception} was 404, re-throws the + * exception otherwise. + * + * @throws ComputeException if the error code of {@code exception} was not 404 + */ + private static boolean falseForNotFound(IOException exception) { + ComputeException serviceException = translate(exception); + if (serviceException.getCode() == HTTP_NOT_FOUND) { + return false; + } + throw serviceException; + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java new file mode 100644 index 000000000000..2e813b33c142 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelper.java @@ -0,0 +1,137 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.testing; + +import com.google.auth.oauth2.ServiceAccountCredentials; +import com.google.cloud.http.HttpTransportOptions; +import com.google.api.gax.retrying.RetrySettings; +import com.google.cloud.compute.deprecated.ComputeOptions; + +import java.io.IOException; +import java.io.InputStream; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.threeten.bp.Duration; + +/** + * Utility to create a remote Compute configuration for testing. Compute options can be obtained + * via the {@link #getOptions()} method. Returned options have custom + * {@link ComputeOptions#getRetrySettings()}: {@link RetrySettings#getMaxAttempts()} is {@code 10}, + * {@link RetrySettings#getMaxAttempts()} ()} is {@code 6}, + * {@link RetrySettings#getMaxRetryDelay()} is {@code 30000}, + * {@link RetrySettings#getTotalTimeout()} is {@code 120000} and + * {@link RetrySettings#getInitialRetryDelay()} is {@code 250}. + * {@link HttpTransportOptions#getConnectTimeout()} and + * {@link HttpTransportOptions#getReadTimeout()} are both + * set to {@code 60000}. + */ +public class RemoteComputeHelper { + + private static final Logger log = Logger.getLogger(RemoteComputeHelper.class.getName()); + private final ComputeOptions options; + + private RemoteComputeHelper(ComputeOptions options) { + this.options = options; + } + + /** + * Returns a {@link ComputeOptions} object to be used for testing. + */ + public ComputeOptions getOptions() { + return options; + } + + /** + * Returns a base name for testing resources generated using a random UUID. This base name can be + * prepended to resource names to prevent name clashes. This method always returns a 30 characters + * long prefix. Since Compute Engine resource names can be at most 63 characters long your suffix + * should be no longer than 33 characters. + */ + public static String baseResourceName() { + return "test-" + UUID.randomUUID().toString().replace("-", "").substring(0, 24) + "-"; + } + + /** + * Creates a {@code RemoteComputeHelper} object for the given project id and JSON key input + * stream. + * + * @param projectId id of the project to be used for running the tests + * @param keyStream input stream for a JSON key + * @return A {@code RemoteComputeHelper} object for the provided options + * @throws ComputeHelperException if {@code keyStream} is not a valid JSON key stream + */ + public static RemoteComputeHelper create(String projectId, InputStream keyStream) { + try { + HttpTransportOptions transportOptions = ComputeOptions.getDefaultHttpTransportOptions(); + transportOptions = transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000) + .build(); + ComputeOptions computeOptions = ComputeOptions.newBuilder() + .setCredentials(ServiceAccountCredentials.fromStream(keyStream)) + .setProjectId(projectId) + .setRetrySettings(retrySettings()) + .setTransportOptions(transportOptions) + .build(); + return new RemoteComputeHelper(computeOptions); + } catch (IOException ex) { + if (log.isLoggable(Level.WARNING)) { + log.log(Level.WARNING, ex.getMessage()); + } + throw ComputeHelperException.translate(ex); + } + } + + /** + * Creates a {@code RemoteComputeHelper} object using default project id and authentication + * credentials. + */ + public static RemoteComputeHelper create() { + HttpTransportOptions transportOptions = ComputeOptions.getDefaultHttpTransportOptions(); + transportOptions = transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000) + .build(); + ComputeOptions computeOptions = ComputeOptions.newBuilder() + .setRetrySettings(retrySettings()) + .setTransportOptions(transportOptions) + .build(); + return new RemoteComputeHelper(computeOptions); + } + + private static RetrySettings retrySettings() { + return RetrySettings.newBuilder().setMaxAttempts(10) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(120000L)) + .setInitialRetryDelay(Duration.ofMillis(250L)) + .setRetryDelayMultiplier(1.0) + .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .build(); + } + + public static class ComputeHelperException extends RuntimeException { + + private static final long serialVersionUID = -5747977015007639912L; + + public ComputeHelperException(String message, Throwable cause) { + super(message, cause); + } + + public static ComputeHelperException translate(Exception ex) { + return new ComputeHelperException(ex.getMessage(), ex); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java new file mode 100644 index 000000000000..64daaade1438 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/ResourceCleaner.java @@ -0,0 +1,171 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.testing; + +import com.google.cloud.compute.deprecated.AddressId; +import com.google.cloud.compute.deprecated.Compute; +import com.google.cloud.compute.deprecated.DiskId; +import com.google.cloud.compute.deprecated.ImageId; +import com.google.cloud.compute.deprecated.InstanceId; +import com.google.cloud.compute.deprecated.NetworkId; +import com.google.cloud.compute.deprecated.SnapshotId; +import com.google.cloud.compute.deprecated.SubnetworkId; +import com.google.common.base.Function; +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; + +public class ResourceCleaner { + private final Compute compute; + private final Map> resources; + + private ResourceCleaner(Compute compute) { + this.compute = compute; + this.resources = new HashMap<>(); + } + + public static ResourceCleaner create(Compute compute) { + return new ResourceCleaner(compute); + } + + private class ManagedResource { + final T resourceId; + Function deleteFunc; + + private ManagedResource(T resourceId, Function deleteFunc) { + this.resourceId = resourceId; + this.deleteFunc = deleteFunc; + } + + public void delete() { + deleteFunc.apply(resourceId); + } + } + + public void cleanUp() { + for (Map.Entry> r : resources.entrySet()) { + r.getValue().delete(); + } + resources.clear(); + } + + public void add(AddressId addressId) { + ManagedResource r = + new ManagedResource<>( + addressId, + new Function() { + @Override + public Void apply(AddressId addressId) { + compute.deleteAddress(addressId); + return null; + } + }); + resources.put(addressId, r); + } + + public void add(DiskId diskId) { + ManagedResource r = + new ManagedResource<>( + diskId, + new Function() { + @Override + public Void apply(DiskId diskId) { + compute.deleteDisk(diskId); + return null; + } + }); + resources.put(diskId, r); + } + + public void add(SnapshotId snapshotId) { + ManagedResource r = + new ManagedResource<>( + snapshotId, + new Function() { + @Override + public Void apply(SnapshotId snapshotId) { + compute.deleteSnapshot(snapshotId); + return null; + } + }); + resources.put(snapshotId, r); + } + + public void add(NetworkId networkId) { + ManagedResource r = + new ManagedResource<>( + networkId, + new Function() { + @Override + public Void apply(NetworkId networkId) { + compute.deleteNetwork(networkId); + return null; + } + }); + resources.put(networkId, r); + } + + public void add(SubnetworkId subnetworkId) { + ManagedResource r = + new ManagedResource<>( + subnetworkId, + new Function() { + @Override + public Void apply(SubnetworkId subnetworkId) { + compute.deleteSubnetwork(subnetworkId); + return null; + } + }); + resources.put(subnetworkId, r); + } + + public void add(ImageId imageId) { + ManagedResource r = + new ManagedResource<>( + imageId, + new Function() { + @Override + public Void apply(ImageId imageId) { + compute.deleteImage(imageId); + return null; + } + }); + resources.put(imageId, r); + } + + public void add(InstanceId instanceId) { + ManagedResource r = + new ManagedResource<>( + instanceId, + new Function() { + @Override + public Void apply(InstanceId instanceId) { + compute.deleteInstance(instanceId); + return null; + } + }); + resources.put(instanceId, r); + } + + public ResourceCleaner remove(Object resourceId) { + if (!resources.containsKey(resourceId)) { + throw new NoSuchElementException(resourceId + " has not been added to managed resources"); + } + resources.remove(resourceId); + return this; + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java new file mode 100644 index 000000000000..d983ba74b17e --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/testing/package-info.java @@ -0,0 +1,31 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A testing helper for Google Compute Engine. + * + *

A simple usage example: + * + *

Before the test: + *

 {@code
+ * RemoteComputeHelper computeHelper = RemoteComputeHelper.create();
+ * Compute compute = computeHelper.getOptions().getService();
+ * } 
+ * + * @see + * Google Cloud Java tools for testing + */ +package com.google.cloud.compute.deprecated.testing; diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java new file mode 100644 index 000000000000..d8839bddd577 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressIdTest.java @@ -0,0 +1,119 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class AddressIdTest { + + private static final String PROJECT = "project"; + private static final String REGION = "region"; + private static final String NAME = "addr"; + private static final String GLOBAL_URL = + "https://www.googleapis.com/compute/v1/projects/project/global/addresses/addr"; + private static final String REGION_URL = + "https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/addr"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + GlobalAddressId addressId = GlobalAddressId.of(PROJECT, NAME); + assertEquals(PROJECT, addressId.getProject()); + assertEquals(NAME, addressId.getAddress()); + assertEquals(GLOBAL_URL, addressId.getSelfLink()); + addressId = GlobalAddressId.of(NAME); + assertNull(addressId.getProject()); + assertEquals(NAME, addressId.getAddress()); + RegionAddressId regionAddressId = RegionAddressId.of(PROJECT, REGION, NAME); + assertEquals(PROJECT, regionAddressId.getProject()); + assertEquals(REGION, regionAddressId.getRegion()); + assertEquals(NAME, regionAddressId.getAddress()); + assertEquals(REGION_URL, regionAddressId.getSelfLink()); + regionAddressId = RegionAddressId.of(RegionId.of(PROJECT, REGION), NAME); + assertEquals(PROJECT, regionAddressId.getProject()); + assertEquals(REGION, regionAddressId.getRegion()); + assertEquals(NAME, regionAddressId.getAddress()); + assertEquals(REGION_URL, regionAddressId.getSelfLink()); + regionAddressId = RegionAddressId.of(REGION, NAME); + assertNull(regionAddressId.getProject()); + assertEquals(REGION, regionAddressId.getRegion()); + assertEquals(NAME, regionAddressId.getAddress()); + } + + @Test + public void testToAndFromUrlGlobal() { + GlobalAddressId addressId = GlobalAddressId.of(PROJECT, NAME); + compareAddressId(addressId, GlobalAddressId.fromUrl(addressId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid global address URL"); + GlobalAddressId.fromUrl("notMatchingUrl"); + } + + @Test + public void testToAndFromUrlRegion() { + RegionAddressId regionAddressId = RegionAddressId.of(PROJECT, REGION, NAME); + compareRegionAddressId(regionAddressId, RegionAddressId.fromUrl(regionAddressId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid region address URL"); + RegionAddressId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + GlobalAddressId addressId = GlobalAddressId.of(PROJECT, NAME); + assertSame(addressId, addressId.setProjectId(PROJECT)); + compareAddressId(addressId, GlobalAddressId.of(NAME).setProjectId(PROJECT)); + RegionAddressId regionAddressId = RegionAddressId.of(PROJECT, REGION, NAME); + assertSame(regionAddressId, regionAddressId.setProjectId(PROJECT)); + compareRegionAddressId(regionAddressId, RegionAddressId.of(REGION, NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(GlobalAddressId.matchesUrl(GlobalAddressId.of(PROJECT, NAME).getSelfLink())); + assertFalse(GlobalAddressId.matchesUrl("notMatchingUrl")); + assertTrue(RegionAddressId.matchesUrl(RegionAddressId.of(PROJECT, REGION, NAME).getSelfLink())); + assertFalse(RegionAddressId.matchesUrl("notMatchingUrl")); + } + + private void compareAddressId(GlobalAddressId expected, GlobalAddressId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getAddress(), expected.getAddress()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } + + private void compareRegionAddressId(RegionAddressId expected, RegionAddressId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getRegion(), expected.getRegion()); + assertEquals(expected.getAddress(), expected.getAddress()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java new file mode 100644 index 000000000000..1149205ea18d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressInfoTest.java @@ -0,0 +1,200 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.cloud.compute.deprecated.AddressInfo.GlobalForwardingUsage; +import com.google.cloud.compute.deprecated.AddressInfo.RegionForwardingUsage; +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class AddressInfoTest { + + private static final String ADDRESS = "192.168.1.1"; + private static final Long CREATION_TIMESTAMP = 1452602400000L; + private static final String DESCRIPTION = "description"; + private static final String GENERATED_ID = "42"; + private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); + private static final RegionAddressId REGION_ADDRESS_ID = + RegionAddressId.of("project", "region", "address"); + private static final AddressInfo.Status STATUS = AddressInfo.Status.RESERVED; + private static final List GLOBAL_FORWARDING_RULES = + ImmutableList.of(GlobalForwardingRuleId.of("project", "forwardingRule1"), + GlobalForwardingRuleId.of("project", "forwardingRule2")); + private static final List REGION_FORWARDING_RULES = + ImmutableList.of(RegionForwardingRuleId.of("project", "region", "forwardingRule1"), + RegionForwardingRuleId.of("project", "region", "forwardingRule2")); + private static final AddressInfo.InstanceUsage INSTANCE_USAGE = + new AddressInfo.InstanceUsage(InstanceId.of("project", "zone", "instance1")); + private static final GlobalForwardingUsage GLOBAL_FORWARDING_USAGE = + new GlobalForwardingUsage(GLOBAL_FORWARDING_RULES); + private static final RegionForwardingUsage REGION_FORWARDING_USAGE = + new RegionForwardingUsage(REGION_FORWARDING_RULES); + private static final AddressInfo INSTANCE_ADDRESS_INFO = AddressInfo.newBuilder(REGION_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(INSTANCE_USAGE) + .build(); + private static final AddressInfo GLOBAL_FORWARDING_ADDRESS_INFO = + AddressInfo.newBuilder(GLOBAL_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(GLOBAL_FORWARDING_USAGE) + .build(); + private static final AddressInfo REGION_FORWARDING_ADDRESS_INFO = + AddressInfo.newBuilder(REGION_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(REGION_FORWARDING_USAGE) + .build(); + + @Test + public void testToBuilder() { + compareAddressInfo(INSTANCE_ADDRESS_INFO, INSTANCE_ADDRESS_INFO.toBuilder().build()); + AddressInfo addressInfo = INSTANCE_ADDRESS_INFO.toBuilder() + .setAddress("192.168.1.2") + .setDescription("description2") + .build(); + assertEquals("description2", addressInfo.getDescription()); + assertEquals("192.168.1.2", addressInfo.getAddress()); + addressInfo = addressInfo.toBuilder() + .setAddress("192.168.1.1") + .setDescription("description") + .build(); + compareAddressInfo(INSTANCE_ADDRESS_INFO, addressInfo); + } + + @Test + public void testToBuilderIncomplete() { + AddressInfo addressInfo = AddressInfo.newBuilder(GLOBAL_ADDRESS_ID).build(); + assertEquals(addressInfo, addressInfo.toBuilder().build()); + addressInfo = AddressInfo.newBuilder(REGION_ADDRESS_ID).build(); + assertEquals(addressInfo, addressInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(ADDRESS, INSTANCE_ADDRESS_INFO.getAddress()); + assertEquals(CREATION_TIMESTAMP, INSTANCE_ADDRESS_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, INSTANCE_ADDRESS_INFO.getDescription()); + assertEquals(GENERATED_ID, INSTANCE_ADDRESS_INFO.getGeneratedId()); + assertEquals(REGION_ADDRESS_ID, INSTANCE_ADDRESS_INFO.getAddressId()); + assertEquals(STATUS, INSTANCE_ADDRESS_INFO.getStatus()); + assertEquals(INSTANCE_USAGE, INSTANCE_ADDRESS_INFO.getUsage()); + assertEquals(INSTANCE_USAGE.getInstance(), + INSTANCE_ADDRESS_INFO.getUsage().getInstance()); + assertEquals(ADDRESS, REGION_FORWARDING_ADDRESS_INFO.getAddress()); + assertEquals(CREATION_TIMESTAMP, REGION_FORWARDING_ADDRESS_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, REGION_FORWARDING_ADDRESS_INFO.getDescription()); + assertEquals(GENERATED_ID, REGION_FORWARDING_ADDRESS_INFO.getGeneratedId()); + assertEquals(REGION_ADDRESS_ID, REGION_FORWARDING_ADDRESS_INFO.getAddressId()); + assertEquals(STATUS, REGION_FORWARDING_ADDRESS_INFO.getStatus()); + assertEquals(REGION_FORWARDING_USAGE, REGION_FORWARDING_ADDRESS_INFO.getUsage()); + assertEquals(REGION_FORWARDING_RULES, + REGION_FORWARDING_ADDRESS_INFO.getUsage().getForwardingRules()); + assertEquals(ADDRESS, GLOBAL_FORWARDING_ADDRESS_INFO.getAddress()); + assertEquals(CREATION_TIMESTAMP, GLOBAL_FORWARDING_ADDRESS_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, GLOBAL_FORWARDING_ADDRESS_INFO.getDescription()); + assertEquals(GENERATED_ID, GLOBAL_FORWARDING_ADDRESS_INFO.getGeneratedId()); + assertEquals(GLOBAL_ADDRESS_ID, GLOBAL_FORWARDING_ADDRESS_INFO.getAddressId()); + assertEquals(STATUS, GLOBAL_FORWARDING_ADDRESS_INFO.getStatus()); + assertEquals(GLOBAL_FORWARDING_USAGE, GLOBAL_FORWARDING_ADDRESS_INFO.getUsage()); + assertEquals(GLOBAL_FORWARDING_RULES, + GLOBAL_FORWARDING_ADDRESS_INFO.getUsage().getForwardingRules()); + } + + @Test + public void testOf() { + AddressInfo addressInfo = AddressInfo.of("address"); + assertEquals(GlobalAddressId.of("address"), addressInfo.getAddressId()); + assertNull(addressInfo.getAddress()); + assertNull(addressInfo.getCreationTimestamp()); + assertNull(addressInfo.getDescription()); + assertNull(addressInfo.getGeneratedId()); + assertNull(addressInfo.getStatus()); + assertNull(addressInfo.getUsage()); + addressInfo = AddressInfo.of(GLOBAL_ADDRESS_ID); + assertEquals(GLOBAL_ADDRESS_ID, addressInfo.getAddressId()); + assertNull(addressInfo.getAddress()); + assertNull(addressInfo.getCreationTimestamp()); + assertNull(addressInfo.getDescription()); + assertNull(addressInfo.getGeneratedId()); + assertNull(addressInfo.getStatus()); + assertNull(addressInfo.getUsage()); + addressInfo = AddressInfo.of("region", "address"); + assertEquals(RegionAddressId.of("region", "address"), addressInfo.getAddressId()); + assertNull(addressInfo.getAddress()); + assertNull(addressInfo.getCreationTimestamp()); + assertNull(addressInfo.getDescription()); + assertNull(addressInfo.getGeneratedId()); + assertNull(addressInfo.getStatus()); + assertNull(addressInfo.getUsage()); + addressInfo = AddressInfo.of(RegionId.of("region"), "address"); + assertEquals(RegionAddressId.of("region", "address"), addressInfo.getAddressId()); + assertNull(addressInfo.getAddress()); + assertNull(addressInfo.getCreationTimestamp()); + assertNull(addressInfo.getDescription()); + assertNull(addressInfo.getGeneratedId()); + assertNull(addressInfo.getStatus()); + assertNull(addressInfo.getUsage()); + } + + @Test + public void testToPbAndFromPb() { + compareAddressInfo(INSTANCE_ADDRESS_INFO, AddressInfo.fromPb(INSTANCE_ADDRESS_INFO.toPb())); + compareAddressInfo(REGION_FORWARDING_ADDRESS_INFO, + AddressInfo.fromPb(REGION_FORWARDING_ADDRESS_INFO.toPb())); + compareAddressInfo(GLOBAL_FORWARDING_ADDRESS_INFO, + AddressInfo.fromPb(GLOBAL_FORWARDING_ADDRESS_INFO.toPb())); + AddressInfo addressInfo = AddressInfo.newBuilder(GLOBAL_ADDRESS_ID).build(); + compareAddressInfo(addressInfo, AddressInfo.fromPb(addressInfo.toPb())); + } + + @Test + public void testSetProjectId() { + AddressInfo addressInfo = GLOBAL_FORWARDING_ADDRESS_INFO.toBuilder() + .setAddressId(GlobalAddressId.of(GLOBAL_ADDRESS_ID.getAddress())) + .build(); + compareAddressInfo(GLOBAL_FORWARDING_ADDRESS_INFO, addressInfo.setProjectId("project")); + } + + private void compareAddressInfo(AddressInfo expected, AddressInfo value) { + assertEquals(expected, value); + assertEquals(expected.getAddress(), value.getAddress()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getAddressId(), value.getAddressId()); + assertEquals(expected.getUsage(), value.getUsage()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java new file mode 100644 index 000000000000..9b590c0a9d8f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AddressTest.java @@ -0,0 +1,294 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; + +import org.junit.After; +import org.junit.Test; + +import java.util.List; + +public class AddressTest { + + private static final String ADDRESS = "192.168.1.1"; + private static final Long CREATION_TIMESTAMP = 1452602400000L; + private static final String DESCRIPTION = "description"; + private static final String GENERATED_ID = "42"; + private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); + private static final RegionAddressId REGION_ADDRESS_ID = + RegionAddressId.of("project", "region", "address"); + private static final AddressInfo.Status STATUS = AddressInfo.Status.RESERVED; + private static final List GLOBAL_FORWARDING_RULES = + ImmutableList.of(GlobalForwardingRuleId.of("project", "forwardingRule1"), + GlobalForwardingRuleId.of("project", "forwardingRule2")); + private static final List REGION_FORWARDING_RULES = + ImmutableList.of(RegionForwardingRuleId.of("project", "region", "forwardingRule1"), + RegionForwardingRuleId.of("project", "region", "forwardingRule2")); + private static final AddressInfo.InstanceUsage INSTANCE_USAGE = + new AddressInfo.InstanceUsage(InstanceId.of("project", "zone", "instance1")); + private static final AddressInfo.GlobalForwardingUsage GLOBAL_FORWARDING_USAGE = + new AddressInfo.GlobalForwardingUsage(GLOBAL_FORWARDING_RULES); + private static final AddressInfo.RegionForwardingUsage REGION_FORWARDING_USAGE = + new AddressInfo.RegionForwardingUsage(REGION_FORWARDING_RULES); + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Address globalForwardingAddress; + private Address instanceAddress; + private Address regionForwardingAddress; + private Address address; + + private void initializeExpectedAddress(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + instanceAddress = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(INSTANCE_USAGE) + .build(); + globalForwardingAddress = new Address.Builder(serviceMockReturnsOptions, GLOBAL_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(GLOBAL_FORWARDING_USAGE) + .build(); + regionForwardingAddress = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(REGION_FORWARDING_USAGE) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeAddress() { + address = new Address.Builder(compute, REGION_ADDRESS_ID) + .setAddress(ADDRESS) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGeneratedId(GENERATED_ID) + .setStatus(STATUS) + .setUsage(REGION_FORWARDING_USAGE) + .build(); + } + + @After + public void tearDown() throws Exception { + verify(serviceMockReturnsOptions); + } + + @Test + public void testBuilder() { + initializeExpectedAddress(6); + assertEquals(ADDRESS, instanceAddress.getAddress()); + assertEquals(CREATION_TIMESTAMP, instanceAddress.getCreationTimestamp()); + assertEquals(DESCRIPTION, instanceAddress.getDescription()); + assertEquals(GENERATED_ID, instanceAddress.getGeneratedId()); + assertEquals(REGION_ADDRESS_ID, instanceAddress.getAddressId()); + assertEquals(STATUS, instanceAddress.getStatus()); + assertEquals(INSTANCE_USAGE, instanceAddress.getUsage()); + assertSame(serviceMockReturnsOptions, instanceAddress.getCompute()); + assertEquals(ADDRESS, regionForwardingAddress.getAddress()); + assertEquals(CREATION_TIMESTAMP, regionForwardingAddress.getCreationTimestamp()); + assertEquals(DESCRIPTION, regionForwardingAddress.getDescription()); + assertEquals(GENERATED_ID, regionForwardingAddress.getGeneratedId()); + assertEquals(REGION_ADDRESS_ID, regionForwardingAddress.getAddressId()); + assertEquals(STATUS, regionForwardingAddress.getStatus()); + assertEquals(REGION_FORWARDING_USAGE, regionForwardingAddress.getUsage()); + assertSame(serviceMockReturnsOptions, regionForwardingAddress.getCompute()); + assertEquals(ADDRESS, globalForwardingAddress.getAddress()); + assertEquals(CREATION_TIMESTAMP, globalForwardingAddress.getCreationTimestamp()); + assertEquals(DESCRIPTION, globalForwardingAddress.getDescription()); + assertEquals(GENERATED_ID, globalForwardingAddress.getGeneratedId()); + assertEquals(GLOBAL_ADDRESS_ID, globalForwardingAddress.getAddressId()); + assertEquals(STATUS, globalForwardingAddress.getStatus()); + assertEquals(GLOBAL_FORWARDING_USAGE, globalForwardingAddress.getUsage()); + assertSame(serviceMockReturnsOptions, globalForwardingAddress.getCompute()); + Address address = new Address.Builder(serviceMockReturnsOptions, GLOBAL_ADDRESS_ID).build(); + assertEquals(GLOBAL_ADDRESS_ID, address.getAddressId()); + assertSame(serviceMockReturnsOptions, address.getCompute()); + assertNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getDescription()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID).build(); + assertEquals(REGION_ADDRESS_ID, address.getAddressId()); + assertSame(serviceMockReturnsOptions, address.getCompute()); + assertNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getDescription()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) + .setAddressId(GLOBAL_ADDRESS_ID) + .build(); + assertEquals(GLOBAL_ADDRESS_ID, address.getAddressId()); + assertSame(serviceMockReturnsOptions, address.getCompute()); + assertNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getDescription()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + } + + @Test + public void testToBuilder() { + initializeExpectedAddress(16); + compareAddress(instanceAddress, instanceAddress.toBuilder().build()); + compareAddress(globalForwardingAddress, globalForwardingAddress.toBuilder().build()); + compareAddress(regionForwardingAddress, regionForwardingAddress.toBuilder().build()); + Address newAddress = instanceAddress.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newAddress.getDescription()); + newAddress = newAddress.toBuilder().setDescription("description").build(); + compareAddress(instanceAddress, newAddress); + } + + @Test + public void testToAndFromPb() { + initializeExpectedAddress(20); + compareAddress(globalForwardingAddress, + Address.fromPb(serviceMockReturnsOptions, globalForwardingAddress.toPb())); + compareAddress(regionForwardingAddress, + Address.fromPb(serviceMockReturnsOptions, regionForwardingAddress.toPb())); + compareAddress(instanceAddress, + Address.fromPb(serviceMockReturnsOptions, instanceAddress.toPb())); + Address address = new Address.Builder(serviceMockReturnsOptions, GLOBAL_ADDRESS_ID).build(); + compareAddress(address, Address.fromPb(serviceMockReturnsOptions, address.toPb())); + address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID).build(); + compareAddress(address, Address.fromPb(serviceMockReturnsOptions, address.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedAddress(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + expect(compute.deleteAddress(REGION_ADDRESS_ID)).andReturn(operation); + replay(compute); + initializeAddress(); + assertSame(operation, address.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedAddress(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteAddress(REGION_ADDRESS_ID)).andReturn(null); + replay(compute); + initializeAddress(); + assertNull(address.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedAddress(3); + Compute.AddressOption[] expectedOptions = {Compute.AddressOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getAddress(REGION_ADDRESS_ID, expectedOptions)).andReturn(regionForwardingAddress); + replay(compute); + initializeAddress(); + assertTrue(address.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedAddress(3); + Compute.AddressOption[] expectedOptions = {Compute.AddressOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getAddress(REGION_ADDRESS_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeAddress(); + assertFalse(address.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedAddress(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getAddress(REGION_ADDRESS_ID)).andReturn(regionForwardingAddress); + replay(compute); + initializeAddress(); + Address updatedAddress = address.reload(); + compareAddress(regionForwardingAddress, updatedAddress); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedAddress(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getAddress(REGION_ADDRESS_ID)).andReturn(null); + replay(compute); + initializeAddress(); + assertNull(address.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedAddress(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getAddress(REGION_ADDRESS_ID, Compute.AddressOption.fields())) + .andReturn(regionForwardingAddress); + replay(compute); + initializeAddress(); + Address updatedAddress = address.reload(Compute.AddressOption.fields()); + compareAddress(regionForwardingAddress, updatedAddress); + verify(compute); + } + + private void compareAddress(Address expected, Address value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getAddress(), value.getAddress()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getAddressId(), value.getAddressId()); + assertEquals(expected.getUsage(), value.getUsage()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java new file mode 100644 index 000000000000..cb794b5e5e6e --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/AttachedDiskTest.java @@ -0,0 +1,393 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.compute.deprecated.AttachedDisk.AttachedDiskConfiguration.InterfaceType; +import com.google.cloud.compute.deprecated.AttachedDisk.AttachedDiskConfiguration.Type; +import com.google.cloud.compute.deprecated.AttachedDisk.CreateDiskConfiguration; +import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; +import com.google.cloud.compute.deprecated.AttachedDisk.ScratchDiskConfiguration; +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class AttachedDiskTest { + + private static final Boolean AUTO_DELETE = true; + private static final Boolean BOOT = true; + private static final Integer INDEX = 0; + private static final String DEVICE_NAME = "deviceName"; + private static final String DISK_NAME = "diskName"; + private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); + private static final Long DISK_SIZE_GB = 42L; + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final ImageId IMAGE_ID = ImageId.of("project", "image"); + private static final InterfaceType INTERFACE_TYPE = InterfaceType.NVME; + private static final PersistentDiskConfiguration.Mode MODE = + PersistentDiskConfiguration.Mode.READ_ONLY; + private static final PersistentDiskConfiguration PERSISTENT_DISK_CONFIGURATION = + PersistentDiskConfiguration.newBuilder(DISK_ID) + .setBoot(BOOT) + .setAutoDelete(AUTO_DELETE) + .setMode(MODE) + .build(); + private static final ScratchDiskConfiguration SCRATCH_DISK_CONFIGURATION = + ScratchDiskConfiguration.newBuilder(DISK_TYPE_ID).setInterfaceType(INTERFACE_TYPE).build(); + private static final CreateDiskConfiguration CREATE_DISK_CONFIGURATION = + CreateDiskConfiguration.newBuilder(IMAGE_ID) + .setAutoDelete(AUTO_DELETE) + .setDiskName(DISK_NAME) + .setDiskType(DISK_TYPE_ID) + .setDiskSizeGb(DISK_SIZE_GB) + .setSourceImage(IMAGE_ID) + .build(); + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final AttachedDisk PERSISTENT_DISK = + AttachedDisk.newBuilder(PERSISTENT_DISK_CONFIGURATION) + .setDeviceName(DEVICE_NAME) + .setIndex(INDEX) + .setLicenses(LICENSES) + .build(); + private static final AttachedDisk SCRATCH_DISK = + AttachedDisk.newBuilder(SCRATCH_DISK_CONFIGURATION) + .setDeviceName(DEVICE_NAME) + .setIndex(INDEX) + .setLicenses(LICENSES) + .build(); + private static final AttachedDisk CREATED_DISK = + AttachedDisk.newBuilder(CREATE_DISK_CONFIGURATION) + .setDeviceName(DEVICE_NAME) + .setIndex(INDEX) + .setLicenses(LICENSES) + .build(); + + @Test + public void testConfigurationToBuilder() { + comparePersistentDiskConfiguration(PERSISTENT_DISK_CONFIGURATION, + PERSISTENT_DISK_CONFIGURATION.toBuilder().build()); + compareScratchDiskConfiguration(SCRATCH_DISK_CONFIGURATION, + SCRATCH_DISK_CONFIGURATION.toBuilder().build()); + compareCreateDiskConfiguration(CREATE_DISK_CONFIGURATION, + CREATE_DISK_CONFIGURATION.toBuilder().build()); + PersistentDiskConfiguration persistentDiskConfiguration = + PERSISTENT_DISK_CONFIGURATION.toBuilder().setAutoDelete(false).build(); + assertFalse(persistentDiskConfiguration.autoDelete()); + persistentDiskConfiguration = + persistentDiskConfiguration.toBuilder().setAutoDelete(AUTO_DELETE).build(); + assertEquals(PERSISTENT_DISK_CONFIGURATION, persistentDiskConfiguration); + ScratchDiskConfiguration scratchDiskConfiguration = + SCRATCH_DISK_CONFIGURATION.toBuilder().setInterfaceType(InterfaceType.SCSI).build(); + assertEquals(InterfaceType.SCSI, scratchDiskConfiguration.getInterfaceType()); + scratchDiskConfiguration = + scratchDiskConfiguration.toBuilder().setInterfaceType(INTERFACE_TYPE).build(); + assertEquals(SCRATCH_DISK_CONFIGURATION, scratchDiskConfiguration); + CreateDiskConfiguration createDiskConfiguration = + CREATE_DISK_CONFIGURATION.toBuilder().setAutoDelete(false).build(); + assertFalse(createDiskConfiguration.autoDelete()); + createDiskConfiguration = + createDiskConfiguration.toBuilder().setAutoDelete(AUTO_DELETE).build(); + assertEquals(CREATE_DISK_CONFIGURATION, createDiskConfiguration); + } + + @Test + public void testConfigurationToBuilderIncomplete() { + PersistentDiskConfiguration persistentConfiguration = PersistentDiskConfiguration.of(DISK_ID); + comparePersistentDiskConfiguration(persistentConfiguration, + AttachedDisk.AttachedDiskConfiguration.fromPb( + persistentConfiguration.toPb())); + ScratchDiskConfiguration scratchDiskConfiguration = ScratchDiskConfiguration.of(DISK_TYPE_ID); + compareScratchDiskConfiguration(scratchDiskConfiguration, + AttachedDisk.AttachedDiskConfiguration.fromPb( + scratchDiskConfiguration.toPb())); + CreateDiskConfiguration createDiskConfiguration = CreateDiskConfiguration.of(IMAGE_ID); + compareCreateDiskConfiguration(createDiskConfiguration, + AttachedDisk.AttachedDiskConfiguration.fromPb( + createDiskConfiguration.toPb())); + } + + @Test + public void testToBuilder() { + compareAttachedDisk(PERSISTENT_DISK, PERSISTENT_DISK.toBuilder().build()); + compareAttachedDisk(SCRATCH_DISK, SCRATCH_DISK.toBuilder().build()); + compareAttachedDisk(CREATED_DISK, CREATED_DISK.toBuilder().build()); + AttachedDisk attachedDisk = PERSISTENT_DISK.toBuilder().setDeviceName("newDeviceName").build(); + assertEquals("newDeviceName", attachedDisk.getDeviceName()); + attachedDisk = attachedDisk.toBuilder().setDeviceName(DEVICE_NAME).build(); + compareAttachedDisk(PERSISTENT_DISK, attachedDisk); + } + + @Test + public void testToBuilderIncomplete() { + AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); + assertEquals(attachedDisk, attachedDisk.toBuilder().build()); + attachedDisk = AttachedDisk.of(SCRATCH_DISK_CONFIGURATION); + assertEquals(attachedDisk, attachedDisk.toBuilder().build()); + attachedDisk = AttachedDisk.of(CREATE_DISK_CONFIGURATION); + assertEquals(attachedDisk, attachedDisk.toBuilder().build()); + } + + @Test + public void testConfigurationBuilder() { + assertTrue(CREATE_DISK_CONFIGURATION.boot()); + assertEquals(AUTO_DELETE, CREATE_DISK_CONFIGURATION.autoDelete()); + assertNull(CREATE_DISK_CONFIGURATION.getInterfaceType()); + assertEquals(Type.PERSISTENT, CREATE_DISK_CONFIGURATION.getType()); + assertEquals(IMAGE_ID, CREATE_DISK_CONFIGURATION.getSourceImage()); + assertEquals(DISK_NAME, CREATE_DISK_CONFIGURATION.getDiskName()); + assertEquals(DISK_TYPE_ID, CREATE_DISK_CONFIGURATION.getDiskType()); + assertEquals(DISK_SIZE_GB, CREATE_DISK_CONFIGURATION.getDiskSizeGb()); + assertEquals(IMAGE_ID, CREATE_DISK_CONFIGURATION.getSourceImage()); + + assertEquals(BOOT, PERSISTENT_DISK_CONFIGURATION.boot()); + assertEquals(AUTO_DELETE, PERSISTENT_DISK_CONFIGURATION.autoDelete()); + assertNull(PERSISTENT_DISK_CONFIGURATION.getInterfaceType()); + assertEquals(Type.PERSISTENT, PERSISTENT_DISK_CONFIGURATION.getType()); + assertEquals(MODE, PERSISTENT_DISK_CONFIGURATION.getMode()); + assertEquals(DISK_ID, PERSISTENT_DISK_CONFIGURATION.getSourceDisk()); + + assertFalse(SCRATCH_DISK_CONFIGURATION.boot()); + assertTrue(SCRATCH_DISK_CONFIGURATION.autoDelete()); + assertEquals(INTERFACE_TYPE, SCRATCH_DISK_CONFIGURATION.getInterfaceType()); + assertEquals(Type.SCRATCH, SCRATCH_DISK_CONFIGURATION.getType()); + assertEquals(DISK_TYPE_ID, SCRATCH_DISK_CONFIGURATION.getDiskType()); + } + + @Test + public void testBuilder() { + assertEquals(PERSISTENT_DISK_CONFIGURATION, PERSISTENT_DISK.getConfiguration()); + assertEquals(DEVICE_NAME, PERSISTENT_DISK.getDeviceName()); + assertEquals(INDEX, PERSISTENT_DISK.getIndex()); + assertEquals(LICENSES, PERSISTENT_DISK.getLicenses()); + assertEquals(SCRATCH_DISK_CONFIGURATION, SCRATCH_DISK.getConfiguration()); + assertEquals(DEVICE_NAME, SCRATCH_DISK.getDeviceName()); + assertEquals(INDEX, SCRATCH_DISK.getIndex()); + assertEquals(LICENSES, SCRATCH_DISK.getLicenses()); + assertEquals(CREATE_DISK_CONFIGURATION, CREATED_DISK.getConfiguration()); + assertEquals(DEVICE_NAME, CREATED_DISK.getDeviceName()); + assertEquals(INDEX, CREATED_DISK.getIndex()); + assertEquals(LICENSES, CREATED_DISK.getLicenses()); + } + + @Test + public void testConfigurationOf() { + PersistentDiskConfiguration persistentConfiguration = PersistentDiskConfiguration.of(DISK_ID); + assertEquals(DISK_ID, persistentConfiguration.getSourceDisk()); + assertEquals(Type.PERSISTENT, persistentConfiguration.getType()); + assertNull(persistentConfiguration.autoDelete()); + assertNull(persistentConfiguration.boot()); + assertNull(persistentConfiguration.getInterfaceType()); + ScratchDiskConfiguration scratchDiskConfiguration = ScratchDiskConfiguration.of(DISK_TYPE_ID); + assertEquals(DISK_TYPE_ID, scratchDiskConfiguration.getDiskType()); + assertNull(scratchDiskConfiguration.getInterfaceType()); + assertEquals(Type.SCRATCH, scratchDiskConfiguration.getType()); + assertTrue(scratchDiskConfiguration.autoDelete()); + assertFalse(scratchDiskConfiguration.boot()); + assertNull(scratchDiskConfiguration.getInterfaceType()); + CreateDiskConfiguration createDiskConfiguration = CreateDiskConfiguration.of(IMAGE_ID); + assertEquals(IMAGE_ID, createDiskConfiguration.getSourceImage()); + assertNull(createDiskConfiguration.getDiskType()); + assertNull(createDiskConfiguration.getDiskName()); + assertNull(createDiskConfiguration.getDiskSizeGb()); + assertNull(createDiskConfiguration.getInterfaceType()); + assertEquals(Type.PERSISTENT, createDiskConfiguration.getType()); + assertNull(createDiskConfiguration.autoDelete()); + assertTrue(createDiskConfiguration.boot()); + assertNull(createDiskConfiguration.getInterfaceType()); + } + + @Test + public void testOf() { + AttachedDisk attachedDisk = AttachedDisk.of(DEVICE_NAME, PERSISTENT_DISK_CONFIGURATION); + assertEquals(PERSISTENT_DISK_CONFIGURATION, attachedDisk.getConfiguration()); + assertEquals(DEVICE_NAME, attachedDisk.getDeviceName()); + assertNull(attachedDisk.getIndex()); + assertNull(attachedDisk.getLicenses()); + attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); + assertEquals(PERSISTENT_DISK_CONFIGURATION, attachedDisk.getConfiguration()); + assertNull(attachedDisk.getDeviceName()); + assertNull(attachedDisk.getIndex()); + assertNull(attachedDisk.getLicenses()); + attachedDisk = AttachedDisk.of(DEVICE_NAME, SCRATCH_DISK_CONFIGURATION); + assertEquals(SCRATCH_DISK_CONFIGURATION, attachedDisk.getConfiguration()); + assertEquals(DEVICE_NAME, attachedDisk.getDeviceName()); + assertNull(attachedDisk.getIndex()); + assertNull(attachedDisk.getLicenses()); + attachedDisk = AttachedDisk.of(SCRATCH_DISK_CONFIGURATION); + assertEquals(SCRATCH_DISK_CONFIGURATION, attachedDisk.getConfiguration()); + assertNull(attachedDisk.getDeviceName()); + assertNull(attachedDisk.getIndex()); + assertNull(attachedDisk.getLicenses()); + attachedDisk = AttachedDisk.of(DEVICE_NAME, CREATE_DISK_CONFIGURATION); + assertEquals(CREATE_DISK_CONFIGURATION, attachedDisk.getConfiguration()); + assertEquals(DEVICE_NAME, attachedDisk.getDeviceName()); + assertNull(attachedDisk.getIndex()); + assertNull(attachedDisk.getLicenses()); + attachedDisk = AttachedDisk.of(CREATE_DISK_CONFIGURATION); + assertEquals(CREATE_DISK_CONFIGURATION, attachedDisk.getConfiguration()); + assertNull(attachedDisk.getDeviceName()); + assertNull(attachedDisk.getIndex()); + assertNull(attachedDisk.getLicenses()); + } + + @Test + public void testConfigurationToAndFromPb() { + PersistentDiskConfiguration persistentConfiguration = + PersistentDiskConfiguration.of(DISK_ID); + comparePersistentDiskConfiguration(persistentConfiguration, + AttachedDisk.AttachedDiskConfiguration.fromPb( + persistentConfiguration.toPb())); + comparePersistentDiskConfiguration(PERSISTENT_DISK_CONFIGURATION, + AttachedDisk.AttachedDiskConfiguration.fromPb( + PERSISTENT_DISK_CONFIGURATION.toPb())); + ScratchDiskConfiguration scratchDiskConfiguration = + ScratchDiskConfiguration.of(DISK_TYPE_ID); + compareScratchDiskConfiguration(scratchDiskConfiguration, + AttachedDisk.AttachedDiskConfiguration.fromPb( + scratchDiskConfiguration.toPb())); + compareScratchDiskConfiguration(SCRATCH_DISK_CONFIGURATION, + AttachedDisk.AttachedDiskConfiguration.fromPb( + SCRATCH_DISK_CONFIGURATION.toPb())); + CreateDiskConfiguration createDiskConfiguration = + CreateDiskConfiguration.of(IMAGE_ID); + compareCreateDiskConfiguration(createDiskConfiguration, + AttachedDisk.AttachedDiskConfiguration.fromPb( + createDiskConfiguration.toPb())); + compareCreateDiskConfiguration(CREATE_DISK_CONFIGURATION, + AttachedDisk.AttachedDiskConfiguration.fromPb( + CREATE_DISK_CONFIGURATION.toPb())); + } + + @Test + public void testToAndFromPb() { + AttachedDisk attachedDisk = AttachedDisk.fromPb(PERSISTENT_DISK.toPb()); + compareAttachedDisk(PERSISTENT_DISK, attachedDisk); + attachedDisk = AttachedDisk.fromPb(SCRATCH_DISK.toPb()); + compareAttachedDisk(SCRATCH_DISK, attachedDisk); + attachedDisk = AttachedDisk.fromPb(CREATED_DISK.toPb()); + compareAttachedDisk(CREATED_DISK, attachedDisk); + attachedDisk = AttachedDisk.of(DEVICE_NAME, PERSISTENT_DISK_CONFIGURATION); + compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); + attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); + compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); + attachedDisk = AttachedDisk.of(DEVICE_NAME, SCRATCH_DISK_CONFIGURATION); + compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); + attachedDisk = AttachedDisk.of(SCRATCH_DISK_CONFIGURATION); + compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); + attachedDisk = AttachedDisk.of(DEVICE_NAME, CREATE_DISK_CONFIGURATION); + compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); + attachedDisk = AttachedDisk.of(CREATE_DISK_CONFIGURATION); + compareAttachedDisk(attachedDisk, AttachedDisk.fromPb(attachedDisk.toPb())); + } + + @Test + public void testConfigurationSetProjectId() { + PersistentDiskConfiguration persistentConfiguration = + PersistentDiskConfiguration.of(DiskId.of("zone", "disk")); + comparePersistentDiskConfiguration( + PersistentDiskConfiguration.of(DiskId.of("project", "zone", "disk")), + persistentConfiguration.setProjectId("project")); + ScratchDiskConfiguration scratchDiskConfiguration = + ScratchDiskConfiguration.of(DiskTypeId.of("zone", "diskType")); + compareScratchDiskConfiguration( + ScratchDiskConfiguration.of(DiskTypeId.of("project", "zone", "diskType")), + scratchDiskConfiguration.setProjectId("project")); + CreateDiskConfiguration createDiskConfiguration = CREATE_DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of("zone", "diskType")) + .setSourceImage(ImageId.of("image")) + .build(); + compareCreateDiskConfiguration(CREATE_DISK_CONFIGURATION, + createDiskConfiguration.setProjectId("project")); + } + + @Test + public void testSetProjectId() { + PersistentDiskConfiguration persistentConfiguration = + PersistentDiskConfiguration.of(DiskId.of("zone", "disk")); + PersistentDiskConfiguration persistentConfigurationWithProject = + PersistentDiskConfiguration.of(DiskId.of("project", "zone", "disk")); + AttachedDisk attachedDisk = AttachedDisk.of(persistentConfiguration); + compareAttachedDisk(AttachedDisk.of(persistentConfigurationWithProject), + attachedDisk.setProjectId("project")); + ScratchDiskConfiguration scratchDiskConfiguration = + ScratchDiskConfiguration.of(DiskTypeId.of("zone", "diskType")); + ScratchDiskConfiguration scratchDiskConfigurationWithProject = + ScratchDiskConfiguration.of(DiskTypeId.of("project", "zone", "diskType")); + compareAttachedDisk(AttachedDisk.of(scratchDiskConfigurationWithProject), + AttachedDisk.of(scratchDiskConfiguration).setProjectId("project")); + CreateDiskConfiguration createDiskConfiguration = + CreateDiskConfiguration.of(ImageId.of("image")); + CreateDiskConfiguration createDiskConfigurationWithProject = + CreateDiskConfiguration.of(ImageId.of("project", "image")); + compareAttachedDisk(AttachedDisk.of(createDiskConfigurationWithProject), + AttachedDisk.of(createDiskConfiguration).setProjectId("project")); + createDiskConfiguration = CREATE_DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of("zone", "diskType")) + .setSourceImage(ImageId.of("image")) + .build(); + compareAttachedDisk(AttachedDisk.of(CREATE_DISK_CONFIGURATION), + AttachedDisk.of(createDiskConfiguration).setProjectId("project")); + } + + public void compareAttachedDiskConfiguration(AttachedDisk.AttachedDiskConfiguration expected, + AttachedDisk.AttachedDiskConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.getInterfaceType(), value.getInterfaceType()); + assertEquals(expected.boot(), value.boot()); + assertEquals(expected.autoDelete(), value.autoDelete()); + assertEquals(expected.hashCode(), value.hashCode()); + } + + public void comparePersistentDiskConfiguration(PersistentDiskConfiguration expected, + PersistentDiskConfiguration value) { + compareAttachedDiskConfiguration(expected, value); + assertEquals(expected.getMode(), value.getMode()); + assertEquals(expected.getSourceDisk(), value.getSourceDisk()); + } + + public void compareCreateDiskConfiguration(CreateDiskConfiguration expected, + CreateDiskConfiguration value) { + compareAttachedDiskConfiguration(expected, value); + assertEquals(expected.getDiskName(), value.getDiskName()); + assertEquals(expected.getDiskType(), value.getDiskType()); + assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); + assertEquals(expected.getSourceImage(), value.getSourceImage()); + } + + public void compareScratchDiskConfiguration(ScratchDiskConfiguration expected, + ScratchDiskConfiguration value) { + compareAttachedDiskConfiguration(expected, value); + assertEquals(expected.getDiskType(), value.getDiskType()); + } + + public void compareAttachedDisk(AttachedDisk expected, AttachedDisk value) { + assertEquals(expected, value); + assertEquals(expected.getDeviceName(), value.getDeviceName()); + assertEquals(expected.getIndex(), value.getIndex()); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java new file mode 100644 index 000000000000..ac1335753f3e --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeExceptionTest.java @@ -0,0 +1,99 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.BaseServiceException; +import com.google.cloud.RetryHelper.RetryHelperException; + +import org.junit.Test; + +import java.io.IOException; +import java.net.SocketTimeoutException; + +public class ComputeExceptionTest { + + @Test + public void testResourceManagerException() { + ComputeException exception = new ComputeException(500, "message"); + assertEquals(500, exception.getCode()); + assertEquals("message", exception.getMessage()); + assertNull(exception.getReason()); + assertTrue(exception.isRetryable()); + + exception = new ComputeException(403, "message"); + assertEquals(403, exception.getCode()); + assertEquals("message", exception.getMessage()); + assertNull(exception.getReason()); + assertFalse(exception.isRetryable()); + + IOException cause = new SocketTimeoutException(); + exception = new ComputeException(cause); + assertNull(exception.getReason()); + assertNull(exception.getMessage()); + assertTrue(exception.isRetryable()); + assertSame(cause, exception.getCause()); + + exception = new ComputeException(403, "message", cause); + assertEquals(403, exception.getCode()); + assertEquals("message", exception.getMessage()); + assertNull(exception.getReason()); + assertFalse(exception.isRetryable()); + assertSame(cause, exception.getCause()); + } + + @Test + public void testTranslateAndThrow() throws Exception { + Exception cause = new ComputeException(500, "message"); + RetryHelperException exceptionMock = createMock(RetryHelperException.class); + expect(exceptionMock.getCause()).andReturn(cause).times(2); + replay(exceptionMock); + try { + ComputeException.translateAndThrow(exceptionMock); + } catch (BaseServiceException ex) { + assertEquals(500, ex.getCode()); + assertEquals("message", ex.getMessage()); + assertTrue(ex.isRetryable()); + } finally { + verify(exceptionMock); + } + cause = new IllegalArgumentException("message"); + exceptionMock = createMock(RetryHelperException.class); + expect(exceptionMock.getMessage()).andReturn("message").times(1); + expect(exceptionMock.getCause()).andReturn(cause).times(2); + replay(exceptionMock); + try { + ComputeException.translateAndThrow(exceptionMock); + } catch (BaseServiceException ex) { + assertEquals(ComputeException.UNKNOWN_CODE, ex.getCode()); + assertEquals("message", ex.getMessage()); + assertFalse(ex.isRetryable()); + assertSame(cause, ex.getCause()); + } finally { + verify(exceptionMock); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java new file mode 100644 index 000000000000..0841dbaea063 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeImplTest.java @@ -0,0 +1,4118 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.capture; +import static org.easymock.EasyMock.eq; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.paging.Page; +import com.google.cloud.ServiceOptions; +import com.google.cloud.Tuple; +import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; +import com.google.cloud.compute.deprecated.spi.ComputeRpcFactory; +import com.google.cloud.compute.deprecated.spi.v1.ComputeRpc; +import com.google.common.base.Function; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import java.util.List; +import java.util.Map; +import org.easymock.Capture; +import org.easymock.EasyMock; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class ComputeImplTest { + + private static final String PROJECT = "project"; + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final String VALID_DISK_SIZE = "10GB-10TB"; + private static final Long DEFAULT_DISK_SIZE_GB = 10L; + private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); + private static final DiskType DISK_TYPE = DiskType.newBuilder() + .setGeneratedId(GENERATED_ID) + .setDiskTypeId(DISK_TYPE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setValidDiskSize(VALID_DISK_SIZE) + .setDefaultDiskSizeGb(DEFAULT_DISK_SIZE_GB) + .build(); + private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); + private static final Integer GUEST_CPUS = 1; + private static final Integer MEMORY_MB = 2; + private static final List SCRATCH_DISKS = ImmutableList.of(3); + private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; + private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; + private static final MachineType MACHINE_TYPE = MachineType.newBuilder() + .setGeneratedId(GENERATED_ID) + .setMachineTypeId(MACHINE_TYPE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setCpus(GUEST_CPUS) + .setMemoryMb(MEMORY_MB) + .setScratchDisksSizeGb(SCRATCH_DISKS) + .setMaximumPersistentDisks(MAXIMUM_PERSISTENT_DISKS) + .setMaximumPersistentDisksSizeGb(MAXIMUM_PERSISTENT_DISKS_SIZE_GB) + .build(); + private static final RegionId REGION_ID = RegionId.of("project", "region"); + private static final Region.Status REGION_STATUS = Region.Status.DOWN; + private static final ZoneId ZONE_ID1 = ZoneId.of("project", "zone1"); + private static final ZoneId ZONE_ID2 = ZoneId.of("project", "zone2"); + private static final List ZONES = ImmutableList.of(ZONE_ID1, ZONE_ID2); + private static final Region.Quota QUOTA1 = + new Region.Quota("METRIC1", 2, 1); + private static final Region.Quota QUOTA2 = + new Region.Quota("METRIC2", 4, 3); + private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); + private static final Region REGION = Region.builder() + .setRegionId(REGION_ID) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(REGION_STATUS) + .setZones(ZONES) + .setQuotas(QUOTAS) + .build(); + private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); + private static final Zone.Status ZONE_STATUS = Zone.Status.DOWN; + private static final Zone ZONE = Zone.builder() + .setZoneId(ZONE_ID) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(ZONE_STATUS) + .setRegion(REGION_ID) + .build(); + private static final LicenseId LICENSE_ID = LicenseId.of("project", "license"); + private static final Boolean CHARGES_USE_FEE = true; + private static final License LICENSE = new License(LICENSE_ID, CHARGES_USE_FEE); + private static final Operation.OperationError OPERATION_ERROR1 = + new Operation.OperationError("code1", "location1", "message1"); + private static final Operation.OperationError OPERATION_ERROR2 = + new Operation.OperationError("code2", "location2", "message2"); + private static final Operation.OperationWarning OPERATION_WARNING1 = + new Operation.OperationWarning("code1", "message1", ImmutableMap.of("k1", "v1")); + private static final Operation.OperationWarning OPERATION_WARNING2 = + new Operation.OperationWarning("code2", "location2", ImmutableMap.of("k2", "v2")); + private static final String CLIENT_OPERATION_ID = "clientOperationId"; + private static final String OPERATION_TYPE = "delete"; + private static final String TARGET_LINK = "targetLink"; + private static final String TARGET_ID = "42"; + private static final Operation.Status STATUS = Operation.Status.DONE; + private static final String STATUS_MESSAGE = "statusMessage"; + private static final String USER = "user"; + private static final Integer PROGRESS = 100; + private static final Long INSERT_TIME = 1453293540000L; + private static final Long START_TIME = 1453293420000L; + private static final Long END_TIME = 1453293480000L; + private static final List ERRORS = + ImmutableList.of(OPERATION_ERROR1, OPERATION_ERROR2); + private static final List WARNINGS = + ImmutableList.of(OPERATION_WARNING1, OPERATION_WARNING2); + private static final Integer HTTP_ERROR_STATUS_CODE = 404; + private static final String HTTP_ERROR_MESSAGE = "NOT FOUND"; + private static final GlobalOperationId GLOBAL_OPERATION_ID = + GlobalOperationId.of("project", "op"); + private static final ZoneOperationId ZONE_OPERATION_ID = + ZoneOperationId.of("project", "zone", "op"); + private static final RegionOperationId REGION_OPERATION_ID = + RegionOperationId.of("project", "region", "op"); + private static final RegionAddressId REGION_ADDRESS_ID = + RegionAddressId.of("project", "region", "address"); + private static final GlobalAddressId GLOBAL_ADDRESS_ID = + GlobalAddressId.of("project", "address"); + private static final AddressInfo REGION_ADDRESS = + AddressInfo.newBuilder(REGION_ADDRESS_ID).build(); + private static final AddressInfo GLOBAL_ADDRESS = + AddressInfo.newBuilder(GLOBAL_ADDRESS_ID).build(); + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); + private static final SnapshotInfo SNAPSHOT = SnapshotInfo.of(SNAPSHOT_ID, DISK_ID); + private static final ImageId IMAGE_ID = ImageId.of("project", "image"); + private static final ImageInfo IMAGE = ImageInfo.of(IMAGE_ID, DiskImageConfiguration.of(DISK_ID)); + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, IMAGE_ID).build(); + private static final DiskInfo DISK = + DiskInfo.of(DISK_ID, StandardDiskConfiguration.of(DISK_TYPE_ID)); + private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); + private static final SubnetworkId SUBNETWORK_ID = SubnetworkId.of("project", "region", "network"); + private static final SubnetworkInfo SUBNETWORK = + SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, "192.168.0.0/16"); + private static final NetworkInfo NETWORK = + NetworkInfo.of(NETWORK_ID, StandardNetworkConfiguration.of("192.168.0.0/16")); + private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); + private static final AttachedDisk.PersistentDiskConfiguration PERSISTENT_DISK_CONFIGURATION = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + private static final AttachedDisk ATTACHED_DISK = + AttachedDisk.of("device", PERSISTENT_DISK_CONFIGURATION); + private static final NetworkInterface NETWORK_INTERFACE = NetworkInterface.of(NETWORK_ID); + private static final InstanceInfo INSTANCE = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE_ID, ATTACHED_DISK, NETWORK_INTERFACE); + + // Empty ComputeRpc options + private static final Map EMPTY_RPC_OPTIONS = ImmutableMap.of(); + + // DiskType options + private static final Compute.DiskTypeOption DISK_TYPE_OPTION_FIELDS = + Compute.DiskTypeOption.fields(Compute.DiskTypeField.ID, Compute.DiskTypeField.DESCRIPTION); + + // DiskType list options + private static final Compute.DiskTypeFilter DISK_TYPE_FILTER = + Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DESCRIPTION, "someDescription"); + private static final Compute.DiskTypeListOption DISK_TYPE_LIST_PAGE_TOKEN = + Compute.DiskTypeListOption.pageToken("cursor"); + private static final Compute.DiskTypeListOption DISK_TYPE_LIST_PAGE_SIZE = + Compute.DiskTypeListOption.pageSize(42L); + private static final Compute.DiskTypeListOption DISK_TYPE_LIST_FILTER = + Compute.DiskTypeListOption.filter(DISK_TYPE_FILTER); + private static final Map DISK_TYPE_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "description eq someDescription"); + + // DiskType aggregated list options + private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_PAGE_TOKEN = + Compute.DiskTypeAggregatedListOption.pageToken("cursor"); + private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_PAGE_SIZE = + Compute.DiskTypeAggregatedListOption.pageSize(42L); + private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_FILTER = + Compute.DiskTypeAggregatedListOption.filter(DISK_TYPE_FILTER); + + // MachineType options + private static final Compute.MachineTypeOption MACHINE_TYPE_OPTION_FIELDS = + Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID, + Compute.MachineTypeField.DESCRIPTION); + + // MachineType list options + private static final Compute.MachineTypeFilter MACHINE_TYPE_FILTER = + Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.MAXIMUM_PERSISTENT_DISKS, 42L); + private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_PAGE_TOKEN = + Compute.MachineTypeListOption.pageToken("cursor"); + private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_PAGE_SIZE = + Compute.MachineTypeListOption.pageSize(42L); + private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_FILTER = + Compute.MachineTypeListOption.filter(MACHINE_TYPE_FILTER); + private static final Map MACHINE_TYPE_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "maximumPersistentDisks ne 42"); + + // MachineType aggregated list options + private static final Compute.MachineTypeAggregatedListOption + MACHINE_TYPE_AGGREGATED_LIST_PAGE_TOKEN = + Compute.MachineTypeAggregatedListOption.pageToken("cursor"); + private static final Compute.MachineTypeAggregatedListOption + MACHINE_TYPE_AGGREGATED_LIST_PAGE_SIZE = + Compute.MachineTypeAggregatedListOption.pageSize(42L); + private static final Compute.MachineTypeAggregatedListOption MACHINE_TYPE_AGGREGATED_LIST_FILTER = + Compute.MachineTypeAggregatedListOption.filter(MACHINE_TYPE_FILTER); + + // Region options + private static final Compute.RegionOption REGION_OPTION_FIELDS = + Compute.RegionOption.fields(Compute.RegionField.ID, Compute.RegionField.DESCRIPTION); + + // Region list options + private static final Compute.RegionFilter REGION_FILTER = + Compute.RegionFilter.equals(Compute.RegionField.ID, "someId"); + private static final Compute.RegionListOption REGION_LIST_PAGE_TOKEN = + Compute.RegionListOption.pageToken("cursor"); + private static final Compute.RegionListOption REGION_LIST_PAGE_SIZE = + Compute.RegionListOption.pageSize(42L); + private static final Compute.RegionListOption REGION_LIST_FILTER = + Compute.RegionListOption.filter(REGION_FILTER); + private static final Map REGION_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "id eq someId"); + + // Zone options + private static final Compute.ZoneOption ZONE_OPTION_FIELDS = + Compute.ZoneOption.fields(Compute.ZoneField.ID, Compute.ZoneField.DESCRIPTION); + + // Zone list options + private static final Compute.ZoneFilter ZONE_FILTER = + Compute.ZoneFilter.notEquals(Compute.ZoneField.NAME, "someName"); + private static final Compute.ZoneListOption ZONE_LIST_PAGE_TOKEN = + Compute.ZoneListOption.pageToken("cursor"); + private static final Compute.ZoneListOption ZONE_LIST_PAGE_SIZE = + Compute.ZoneListOption.pageSize(42L); + private static final Compute.ZoneListOption ZONE_LIST_FILTER = + Compute.ZoneListOption.filter(ZONE_FILTER); + private static final Map ZONE_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "name ne someName"); + + // License options + private static final Compute.LicenseOption LICENSE_OPTION_FIELDS = + Compute.LicenseOption.fields(Compute.LicenseField.CHARGES_USE_FEE); + + // Operation options + private static final Compute.OperationOption OPERATION_OPTION_FIELDS = + Compute.OperationOption.fields(Compute.OperationField.ID, Compute.OperationField.DESCRIPTION); + + // Operation list options + private static final Compute.OperationFilter OPERATION_FILTER = + Compute.OperationFilter.notEquals(Compute.OperationField.PROGRESS, 0); + private static final Compute.OperationListOption OPERATION_LIST_PAGE_TOKEN = + Compute.OperationListOption.pageToken("cursor"); + private static final Compute.OperationListOption OPERATION_LIST_PAGE_SIZE = + Compute.OperationListOption.pageSize(42L); + private static final Compute.OperationListOption OPERATION_LIST_FILTER = + Compute.OperationListOption.filter(OPERATION_FILTER); + private static final Map OPERATION_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "progress ne 0"); + + // Address options + private static final Compute.AddressOption ADDRESS_OPTION_FIELDS = + Compute.AddressOption.fields(Compute.AddressField.ID, Compute.AddressField.DESCRIPTION); + + // Address list options + private static final Compute.AddressFilter ADDRESS_FILTER = + Compute.AddressFilter.notEquals(Compute.AddressField.REGION, "someRegion"); + private static final Compute.AddressListOption ADDRESS_LIST_PAGE_TOKEN = + Compute.AddressListOption.pageToken("cursor"); + private static final Compute.AddressListOption ADDRESS_LIST_PAGE_SIZE = + Compute.AddressListOption.pageSize(42L); + private static final Compute.AddressListOption ADDRESS_LIST_FILTER = + Compute.AddressListOption.filter(ADDRESS_FILTER); + private static final Map ADDRESS_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "region ne someRegion"); + + // Address aggregated list options + private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_PAGE_TOKEN = + Compute.AddressAggregatedListOption.pageToken("cursor"); + private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_PAGE_SIZE = + Compute.AddressAggregatedListOption.pageSize(42L); + private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_FILTER = + Compute.AddressAggregatedListOption.filter(ADDRESS_FILTER); + + // Snapshot options + private static final Compute.SnapshotOption SNAPSHOT_OPTION_FIELDS = + Compute.SnapshotOption.fields(Compute.SnapshotField.ID, Compute.SnapshotField.DESCRIPTION); + + // Snapshot list options + private static final Compute.SnapshotFilter SNAPSHOT_FILTER = + Compute.SnapshotFilter.equals(Compute.SnapshotField.DISK_SIZE_GB, 500L); + private static final Compute.SnapshotListOption SNAPSHOT_LIST_PAGE_TOKEN = + Compute.SnapshotListOption.pageToken("cursor"); + private static final Compute.SnapshotListOption SNAPSHOT_LIST_PAGE_SIZE = + Compute.SnapshotListOption.pageSize(42L); + private static final Compute.SnapshotListOption SNAPSHOT_LIST_FILTER = + Compute.SnapshotListOption.filter(SNAPSHOT_FILTER); + private static final Map SNAPSHOT_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "diskSizeGb eq 500"); + + // Image options + private static final Compute.ImageOption IMAGE_OPTION_FIELDS = + Compute.ImageOption.fields(Compute.ImageField.ID, Compute.ImageField.DESCRIPTION); + + // Image list options + private static final Compute.ImageFilter IMAGE_FILTER = + Compute.ImageFilter.notEquals(Compute.ImageField.DISK_SIZE_GB, 500L); + private static final Compute.ImageListOption IMAGE_LIST_PAGE_TOKEN = + Compute.ImageListOption.pageToken("cursor"); + private static final Compute.ImageListOption IMAGE_LIST_PAGE_SIZE = + Compute.ImageListOption.pageSize(42L); + private static final Compute.ImageListOption IMAGE_LIST_FILTER = + Compute.ImageListOption.filter(IMAGE_FILTER); + private static final Map IMAGE_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "diskSizeGb ne 500"); + + // Disk options + private static final Compute.DiskOption DISK_OPTION_FIELDS = + Compute.DiskOption.fields(Compute.DiskField.ID, Compute.DiskField.DESCRIPTION); + + // Disk list options + private static final Compute.DiskFilter DISK_FILTER = + Compute.DiskFilter.notEquals(Compute.DiskField.SIZE_GB, 500L); + private static final Compute.DiskListOption DISK_LIST_PAGE_TOKEN = + Compute.DiskListOption.pageToken("cursor"); + private static final Compute.DiskListOption DISK_LIST_PAGE_SIZE = + Compute.DiskListOption.pageSize(42L); + private static final Compute.DiskListOption DISK_LIST_FILTER = + Compute.DiskListOption.filter(DISK_FILTER); + private static final Map DISK_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "sizeGb ne 500"); + + // Disk aggregated list options + private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_PAGE_TOKEN = + Compute.DiskAggregatedListOption.pageToken("cursor"); + private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_PAGE_SIZE = + Compute.DiskAggregatedListOption.pageSize(42L); + private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_FILTER = + Compute.DiskAggregatedListOption.filter(DISK_FILTER); + + // Subnetwork options + private static final Compute.SubnetworkOption SUBNETWORK_OPTION_FIELDS = + Compute.SubnetworkOption.fields(Compute.SubnetworkField.ID, + Compute.SubnetworkField.DESCRIPTION); + + // Subnetwork list options + private static final Compute.SubnetworkFilter SUBNETWORK_FILTER = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.IP_CIDR_RANGE, "192.168.0.0/16"); + private static final Compute.SubnetworkListOption SUBNETWORK_LIST_PAGE_TOKEN = + Compute.SubnetworkListOption.pageToken("cursor"); + private static final Compute.SubnetworkListOption SUBNETWORK_LIST_PAGE_SIZE = + Compute.SubnetworkListOption.pageSize(42L); + private static final Compute.SubnetworkListOption SUBNETWORK_LIST_FILTER = + Compute.SubnetworkListOption.filter(SUBNETWORK_FILTER); + private static final Map SUBNETWORK_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "ipCidrRange eq 192.168.0.0/16"); + + // Subnetwork aggregated list options + private static final Compute.SubnetworkAggregatedListOption + SUBNETWORK_AGGREGATED_LIST_PAGE_TOKEN = + Compute.SubnetworkAggregatedListOption.pageToken("cursor"); + private static final Compute.SubnetworkAggregatedListOption SUBNETWORK_AGGREGATED_LIST_PAGE_SIZE = + Compute.SubnetworkAggregatedListOption.pageSize(42L); + private static final Compute.SubnetworkAggregatedListOption SUBNETWORK_AGGREGATED_LIST_FILTER = + Compute.SubnetworkAggregatedListOption.filter(SUBNETWORK_FILTER); + + // Network options + private static final Compute.NetworkOption NETWORK_OPTION_FIELDS = + Compute.NetworkOption.fields(Compute.NetworkField.ID, Compute.NetworkField.DESCRIPTION); + + // Network list options + private static final Compute.NetworkFilter NETWORK_FILTER = + Compute.NetworkFilter.equals(Compute.NetworkField.IPV4_RANGE, "192.168.0.0/16"); + private static final Compute.NetworkListOption NETWORK_LIST_PAGE_TOKEN = + Compute.NetworkListOption.pageToken("cursor"); + private static final Compute.NetworkListOption NETWORK_LIST_PAGE_SIZE = + Compute.NetworkListOption.pageSize(42L); + private static final Compute.NetworkListOption NETWORK_LIST_FILTER = + Compute.NetworkListOption.filter(NETWORK_FILTER); + private static final Map NETWORK_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "IPv4Range eq 192.168.0.0/16"); + + // Instance options + private static final Compute.InstanceOption INSTANCE_OPTION_FIELDS = + Compute.InstanceOption.fields(Compute.InstanceField.ID, Compute.InstanceField.DESCRIPTION); + + // Instance list options + private static final Compute.InstanceFilter INSTANCE_FILTER = + Compute.InstanceFilter.equals(Compute.InstanceField.CAN_IP_FORWARD, true); + private static final Compute.InstanceListOption INSTANCE_LIST_PAGE_TOKEN = + Compute.InstanceListOption.pageToken("cursor"); + private static final Compute.InstanceListOption INSTANCE_LIST_PAGE_SIZE = + Compute.InstanceListOption.pageSize(42L); + private static final Compute.InstanceListOption INSTANCE_LIST_FILTER = + Compute.InstanceListOption.filter(INSTANCE_FILTER); + private static final Map INSTANCE_LIST_OPTIONS = ImmutableMap.of( + ComputeRpc.Option.PAGE_TOKEN, "cursor", + ComputeRpc.Option.MAX_RESULTS, 42L, + ComputeRpc.Option.FILTER, "canIpForward eq true"); + + // Instance aggregated list options + private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_PAGE_TOKEN = + Compute.InstanceAggregatedListOption.pageToken("cursor"); + private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_PAGE_SIZE = + Compute.InstanceAggregatedListOption.pageSize(42L); + private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_FILTER = + Compute.InstanceAggregatedListOption.filter(INSTANCE_FILTER); + + private static final Function + OPERATION_TO_PB_FUNCTION = new Function() { + @Override + public com.google.api.services.compute.model.Operation apply(Operation operation) { + return operation.toPb(); + } + }; + + private ComputeOptions options; + private ComputeRpcFactory rpcFactoryMock; + private ComputeRpc computeRpcMock; + private Compute compute; + + private Operation globalOperation; + private Operation zoneOperation; + private Operation regionOperation; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Before + public void setUp() { + rpcFactoryMock = EasyMock.createMock(ComputeRpcFactory.class); + computeRpcMock = EasyMock.createMock(ComputeRpc.class); + EasyMock.expect(rpcFactoryMock.create(EasyMock.anyObject(ComputeOptions.class))) + .andReturn(computeRpcMock).times(2); + EasyMock.replay(rpcFactoryMock); + options = ComputeOptions.newBuilder() + .setProjectId(PROJECT) + .setServiceRpcFactory(rpcFactoryMock) + .setRetrySettings(ServiceOptions.getNoRetrySettings()) + .build(); + Compute otherService = options.toBuilder().build().getService(); + globalOperation = new Operation.Builder(otherService) + .getGeneratedId(GENERATED_ID) + .setOperationId(GLOBAL_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + zoneOperation = new Operation.Builder(otherService) + .getGeneratedId(GENERATED_ID) + .setOperationId(ZONE_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + regionOperation = new Operation.Builder(otherService) + .getGeneratedId(GENERATED_ID) + .setOperationId(REGION_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + } + + @After + public void tearDown() { + EasyMock.verify(rpcFactoryMock, computeRpcMock); + } + + @Test + public void testGetOptions() { + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertSame(options, compute.getOptions()); + } + + @Test + public void testGetDiskType() { + EasyMock.expect(computeRpcMock.getDiskType( + DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andReturn(DISK_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + DiskType diskType = compute.getDiskType(DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType()); + assertEquals(DISK_TYPE, diskType); + } + + @Test + public void testGetDiskType_Null() { + EasyMock.expect(computeRpcMock.getDiskType( + DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getDiskType(DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType())); + } + + @Test + public void testGetDiskTypeFromDiskTypeId() { + EasyMock.expect(computeRpcMock.getDiskType( + DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andReturn(DISK_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + DiskType diskType = compute.getDiskType(DISK_TYPE_ID); + assertEquals(DISK_TYPE, diskType); + } + + @Test + public void testGetDiskTypeWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect( + computeRpcMock.getDiskType( + eq(DISK_TYPE_ID.getZone()), eq(DISK_TYPE_ID.getType()), capture(capturedOptions))) + .andReturn(DISK_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + DiskType diskType = compute.getDiskType(DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), + DISK_TYPE_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(DISK_TYPE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(DISK_TYPE, diskType); + } + + @Test + public void testListDiskTypes() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testListDiskTypesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); + ImmutableList nextDiskTypeList = ImmutableList.of(DISK_TYPE); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextDiskTypeList, DiskType.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), nextOptions)) + .andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextDiskTypeList.toArray(), + Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testListEmptyDiskTypes() { + ImmutableList diskTypes = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + diskTypes); + EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone()); + assertNull(page.getNextPageToken()); + assertArrayEquals(diskTypes.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testListDiskTypesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_ID.getZone(), DISK_TYPE_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDiskTypes(DISK_TYPE_ID.getZone(), DISK_TYPE_LIST_PAGE_SIZE, + DISK_TYPE_LIST_PAGE_TOKEN, DISK_TYPE_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testAggregatedListDiskTypes() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDiskTypes(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDiskTypes(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testAggregatedListDiskTypesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); + ImmutableList nextDiskTypeList = ImmutableList.of(DISK_TYPE); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextDiskTypeList, DiskType.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listDiskTypes(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listDiskTypes(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listDiskTypes(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextDiskTypeList.toArray(), + Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testAggregatedListEmptyDiskTypes() { + ImmutableList diskTypes = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + diskTypes); + EasyMock.expect(computeRpcMock.listDiskTypes(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listDiskTypes(); + assertNull(page.getNextPageToken()); + assertArrayEquals(diskTypes.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testAggregatedListDiskTypesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskTypeList = ImmutableList.of(DISK_TYPE, DISK_TYPE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskTypeList, DiskType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDiskTypes(DISK_TYPE_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDiskTypes(DISK_TYPE_AGGREGATED_LIST_PAGE_SIZE, + DISK_TYPE_AGGREGATED_LIST_PAGE_TOKEN, DISK_TYPE_AGGREGATED_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskTypeList.toArray(), Iterables.toArray(page.getValues(), DiskType.class)); + } + + @Test + public void testGetMachineType() { + EasyMock.expect( + computeRpcMock.getMachineType( + MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andReturn(MACHINE_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + MachineType machineType = + compute.getMachineType(MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType()); + assertEquals(MACHINE_TYPE, machineType); + } + + @Test + public void testGetMachineType_Null() { + EasyMock.expect( + computeRpcMock.getMachineType( + MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getMachineType(MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType())); + } + + @Test + public void testGetMachineTypeFromMachineTypeId() { + EasyMock.expect(computeRpcMock.getMachineType( + MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andReturn(MACHINE_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + MachineType machineType = compute.getMachineType(MACHINE_TYPE_ID); + assertEquals(MACHINE_TYPE, machineType); + } + + @Test + public void testGetMachineTypeWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect( + computeRpcMock.getMachineType(eq(MACHINE_TYPE_ID.getZone()), eq(MACHINE_TYPE_ID.getType()), + capture(capturedOptions))) + .andReturn(MACHINE_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + MachineType machineType = compute.getMachineType(MACHINE_TYPE_ID.getZone(), + MACHINE_TYPE_ID.getType(), MACHINE_TYPE_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(DISK_TYPE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(MACHINE_TYPE, machineType); + } + + @Test + public void testListMachineTypes() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(machineTypeList.toArray(), Iterables.toArray(page.getValues(), + MachineType.class)); + } + + @Test + public void testListMachineTypesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); + ImmutableList nextMachineTypeList = ImmutableList.of(MACHINE_TYPE); + Tuple> + nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextMachineTypeList, MachineType.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), nextOptions)) + .andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(machineTypeList.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextMachineTypeList.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + } + + @Test + public void testListEmptyMachineTypes() { + ImmutableList machineTypes = + ImmutableList.of(); + Tuple> result = + Tuple.>of( + null, + machineTypes); + EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone()); + assertNull(page.getNextPageToken()); + assertArrayEquals(machineTypes.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + } + + @Test + public void testListMachineTypesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); + EasyMock.expect( + computeRpcMock.listMachineTypes(MACHINE_TYPE_ID.getZone(), MACHINE_TYPE_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listMachineTypes(MACHINE_TYPE_ID.getZone(), + MACHINE_TYPE_LIST_PAGE_SIZE, MACHINE_TYPE_LIST_PAGE_TOKEN, MACHINE_TYPE_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(machineTypeList.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + } + + @Test + public void testAggregatedListMachineTypes() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listMachineTypes(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listMachineTypes(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(machineTypeList.toArray(), Iterables.toArray(page.getValues(), + MachineType.class)); + } + + @Test + public void testAggregatedListMachineTypesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); + ImmutableList nextMachineTypeList = ImmutableList.of(MACHINE_TYPE); + Tuple> + nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextMachineTypeList, MachineType.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listMachineTypes(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listMachineTypes(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listMachineTypes(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(machineTypeList.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextMachineTypeList.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + } + + @Test + public void testAggregatedListEmptyMachineTypes() { + ImmutableList machineTypes = + ImmutableList.of(); + Tuple> result = + Tuple.>of( + null, + machineTypes); + EasyMock.expect(computeRpcMock.listMachineTypes(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listMachineTypes(); + assertNull(page.getNextPageToken()); + assertArrayEquals(machineTypes.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + } + + @Test + public void testAggregatedListMachineTypesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList machineTypeList = ImmutableList.of(MACHINE_TYPE, MACHINE_TYPE); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(machineTypeList, MachineType.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listMachineTypes(MACHINE_TYPE_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listMachineTypes(MACHINE_TYPE_AGGREGATED_LIST_PAGE_SIZE, + MACHINE_TYPE_AGGREGATED_LIST_PAGE_TOKEN, MACHINE_TYPE_AGGREGATED_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(machineTypeList.toArray(), + Iterables.toArray(page.getValues(), MachineType.class)); + } + + @Test + public void testGetRegion() { + EasyMock.expect(computeRpcMock.getRegion(REGION_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(REGION.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Region region = compute.getRegion(REGION_ID.getRegion()); + assertEquals(REGION, region); + } + + @Test + public void testGetRegion_Null() { + EasyMock.expect(computeRpcMock.getRegion(REGION_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getRegion(REGION_ID.getRegion())); + } + + @Test + public void testGetRegionWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getRegion(eq(REGION_ID.getRegion()), capture(capturedOptions))) + .andReturn(REGION.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Region region = compute.getRegion(REGION_ID.getRegion(), REGION_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(REGION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(REGION, region); + } + + @Test + public void testListRegions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList regionList = ImmutableList.of(REGION, REGION); + Tuple> result = + Tuple.of(cursor, Iterables.transform(regionList, Region.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listRegions(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listRegions(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(regionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); + } + + @Test + public void testListRegionsNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList regionList = ImmutableList.of(REGION, REGION); + ImmutableList nextRegionList = ImmutableList.of(REGION); + Tuple> result = + Tuple.of(cursor, Iterables.transform(regionList, Region.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, Iterables.transform(nextRegionList, Region.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listRegions(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listRegions(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listRegions(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(regionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextRegionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); + } + + @Test + public void testListEmptyRegions() { + ImmutableList regions = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + regions); + EasyMock.expect(computeRpcMock.listRegions(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listRegions(); + assertNull(page.getNextPageToken()); + assertArrayEquals(regions.toArray(), Iterables.toArray(page.getValues(), Region.class)); + } + + @Test + public void testListRegionsWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList regionList = ImmutableList.of(REGION, REGION); + Tuple> result = + Tuple.of(cursor, Iterables.transform(regionList, Region.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listRegions(REGION_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listRegions(REGION_LIST_PAGE_SIZE, REGION_LIST_PAGE_TOKEN, + REGION_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(regionList.toArray(), Iterables.toArray(page.getValues(), Region.class)); + } + + @Test + public void testGetZone() { + EasyMock.expect(computeRpcMock.getZone(ZONE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(ZONE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Zone zone = compute.getZone(ZONE_ID.getZone()); + assertEquals(ZONE, zone); + } + + @Test + public void testGetZone_Null() { + EasyMock.expect(computeRpcMock.getZone(ZONE_ID.getZone(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getZone(ZONE_ID.getZone())); + } + + @Test + public void testGetZoneWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getZone(eq(ZONE_ID.getZone()), capture(capturedOptions))) + .andReturn(ZONE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Zone zone = compute.getZone(ZONE_ID.getZone(), ZONE_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(ZONE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(ZONE, zone); + } + + @Test + public void testListZones() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList zoneList = ImmutableList.of(ZONE, ZONE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(zoneList, Zone.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listZones(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listZones(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(zoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); + } + + @Test + public void testListZonesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList zoneList = ImmutableList.of(ZONE, ZONE); + ImmutableList nextZoneList = ImmutableList.of(ZONE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(zoneList, Zone.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, Iterables.transform(nextZoneList, Zone.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listZones(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listZones(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listZones(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(zoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextZoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); + } + + @Test + public void testListEmptyZones() { + ImmutableList zones = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + zones); + EasyMock.expect(computeRpcMock.listZones(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listZones(); + assertNull(page.getNextPageToken()); + assertArrayEquals(zones.toArray(), Iterables.toArray(page.getValues(), Zone.class)); + } + + @Test + public void testListZonesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList zoneList = ImmutableList.of(ZONE, ZONE); + Tuple> result = + Tuple.of(cursor, Iterables.transform(zoneList, Zone.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listZones(ZONE_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = + compute.listZones(ZONE_LIST_PAGE_SIZE, ZONE_LIST_PAGE_TOKEN, ZONE_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(zoneList.toArray(), Iterables.toArray(page.getValues(), Zone.class)); + } + + @Test + public void testGetLicenseFromString() { + EasyMock.expect(computeRpcMock.getLicense(PROJECT, LICENSE_ID.getLicense(), EMPTY_RPC_OPTIONS)) + .andReturn(LICENSE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + License license = compute.getLicense(LICENSE_ID.getLicense()); + assertEquals(LICENSE, license); + } + + @Test + public void testGetLicenseFromString_Null() { + EasyMock.expect(computeRpcMock.getLicense(PROJECT, LICENSE_ID.getLicense(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getLicense(LICENSE_ID.getLicense())); + } + + @Test + public void testGetLicenseFromStringWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getLicense( + eq(PROJECT), eq(LICENSE_ID.getLicense()), capture(capturedOptions))) + .andReturn(LICENSE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + License license = compute.getLicense(LICENSE_ID.getLicense(), LICENSE_OPTION_FIELDS); + assertEquals(LICENSE, license); + String selector = (String) capturedOptions.getValue().get(LICENSE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("chargesUseFee")); + assertEquals(22, selector.length()); + assertEquals(LICENSE, license); + } + + @Test + public void testGetLicenseFromIdWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + LicenseId licenseId = LicenseId.of("project2", "license2"); + EasyMock.expect(computeRpcMock.getLicense( + eq(licenseId.getProject()), eq(licenseId.getLicense()), capture(capturedOptions))) + .andReturn(LICENSE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + License license = compute.getLicense(licenseId, LICENSE_OPTION_FIELDS); + assertEquals(LICENSE, license); + String selector = (String) capturedOptions.getValue().get(LICENSE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("chargesUseFee")); + assertEquals(22, selector.length()); + assertEquals(LICENSE, license); + } + + @Test + public void testGetLicenseFromId() { + LicenseId licenseId = LicenseId.of("project2", "license2"); + EasyMock.expect(computeRpcMock.getLicense(licenseId.getProject(), licenseId.getLicense(), + EMPTY_RPC_OPTIONS)).andReturn(LICENSE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + License license = compute.getLicense(licenseId); + assertEquals(LICENSE, license); + } + + @Test + public void testGetLicenseFromId_Null() { + LicenseId licenseId = LicenseId.of("project2", "license2"); + EasyMock.expect(computeRpcMock.getLicense( + licenseId.getProject(), licenseId.getLicense(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getLicense(licenseId)); + } + + @Test + public void testGetGlobalOperation() { + EasyMock.expect( + computeRpcMock.getGlobalOperation(GLOBAL_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(globalOperation, compute.getOperation(GLOBAL_OPERATION_ID)); + } + + @Test + public void testGetGlobalOperation_Null() { + EasyMock.expect( + computeRpcMock.getGlobalOperation(GLOBAL_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getOperation(GLOBAL_OPERATION_ID)); + } + + @Test + public void testGetGlobalOperationWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getGlobalOperation( + eq(GLOBAL_OPERATION_ID.getOperation()), capture(capturedOptions))) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.getOperation(GLOBAL_OPERATION_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testListGlobalOperations() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(globalOperation, globalOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listGlobalOperations(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listGlobalOperations(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListGlobalOperationsNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(globalOperation, globalOperation); + ImmutableList nextOperationList = ImmutableList.of(globalOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listGlobalOperations(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listGlobalOperations(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listGlobalOperations(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextOperationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListEmptyGlobalOperations() { + ImmutableList operations = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + operations); + EasyMock.expect(computeRpcMock.listGlobalOperations(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listGlobalOperations(); + assertNull(page.getNextPageToken()); + assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListGlobalOperationsWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(globalOperation, globalOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listGlobalOperations(OPERATION_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listGlobalOperations(OPERATION_LIST_PAGE_SIZE, + OPERATION_LIST_PAGE_TOKEN, OPERATION_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testDeleteGlobalOperation_True() { + EasyMock.expect(computeRpcMock.deleteGlobalOperation(GLOBAL_OPERATION_ID.getOperation())) + .andReturn(true); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertTrue(compute.deleteOperation(GLOBAL_OPERATION_ID)); + } + + @Test + public void testDeleteGlobalOperation_False() { + EasyMock.expect(computeRpcMock.deleteGlobalOperation(GLOBAL_OPERATION_ID.getOperation())) + .andReturn(false); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertFalse(compute.deleteOperation(GLOBAL_OPERATION_ID)); + } + + @Test + public void testGetRegionOperation() { + EasyMock.expect(computeRpcMock.getRegionOperation(REGION_OPERATION_ID.getRegion(), + REGION_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) + .andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.getOperation(REGION_OPERATION_ID); + assertEquals(regionOperation, operation); + } + + @Test + public void testGetRegionOperation_Null() { + EasyMock.expect(computeRpcMock.getRegionOperation(REGION_OPERATION_ID.getRegion(), + REGION_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)) + .andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.getOperation(REGION_OPERATION_ID); + assertEquals(regionOperation, operation); + } + + @Test + public void testGetRegionOperationWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getRegionOperation(eq(REGION_OPERATION_ID.getRegion()), + eq(REGION_OPERATION_ID.getOperation()), capture(capturedOptions))) + .andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.getOperation(REGION_OPERATION_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(regionOperation, operation); + } + + @Test + public void testListRegionOperations() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(regionOperation, regionOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + EasyMock.expect( + computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListRegionOperationsNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(regionOperation, regionOperation); + ImmutableList nextOperationList = ImmutableList.of(regionOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), + EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), + nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextOperationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListEmptyRegionOperations() { + ImmutableList operations = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + operations); + EasyMock.expect( + computeRpcMock.listRegionOperations(REGION_OPERATION_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion()); + assertNull(page.getNextPageToken()); + assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListRegionOperationsWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(regionOperation, regionOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listRegionOperations( + REGION_OPERATION_ID.getRegion(), OPERATION_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listRegionOperations(REGION_OPERATION_ID.getRegion(), + OPERATION_LIST_PAGE_SIZE, OPERATION_LIST_PAGE_TOKEN, OPERATION_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testDeleteRegionOperation_True() { + EasyMock.expect(computeRpcMock.deleteRegionOperation(REGION_OPERATION_ID.getRegion(), + REGION_OPERATION_ID.getOperation())).andReturn(true); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertTrue(compute.deleteOperation(REGION_OPERATION_ID)); + } + + @Test + public void testDeleteRegionOperation_False() { + EasyMock.expect(computeRpcMock.deleteRegionOperation(REGION_OPERATION_ID.getRegion(), + REGION_OPERATION_ID.getOperation())).andReturn(false); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertFalse(compute.deleteOperation(REGION_OPERATION_ID)); + } + + @Test + public void testGetZoneOperation() { + EasyMock.expect(computeRpcMock.getZoneOperation(ZONE_OPERATION_ID.getZone(), + ZONE_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.getOperation(ZONE_OPERATION_ID); + assertEquals(zoneOperation, operation); + } + + @Test + public void testGetZoneOperation_Null() { + EasyMock.expect(computeRpcMock.getZoneOperation(ZONE_OPERATION_ID.getZone(), + ZONE_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getOperation(ZONE_OPERATION_ID)); + } + + @Test + public void testGetZoneOperationWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getZoneOperation(eq(ZONE_OPERATION_ID.getZone()), + eq(ZONE_OPERATION_ID.getOperation()), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.getOperation(ZONE_OPERATION_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testListZoneOperations() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(zoneOperation, zoneOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + EasyMock.expect( + computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListZoneOperationsNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(zoneOperation, zoneOperation); + ImmutableList nextOperationList = ImmutableList.of(zoneOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listZoneOperations( + ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect(computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), nextOptions)) + .andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextOperationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListEmptyZoneOperations() { + ImmutableList operations = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + operations); + EasyMock.expect( + computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone()); + assertNull(page.getNextPageToken()); + assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testListZoneOperationsWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList operationList = ImmutableList.of(zoneOperation, zoneOperation); + Tuple> result = + Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION)); + EasyMock.expect( + computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), OPERATION_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone(), + OPERATION_LIST_PAGE_SIZE, OPERATION_LIST_PAGE_TOKEN, OPERATION_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(operationList.toArray(), + Iterables.toArray(page.getValues(), Operation.class)); + } + + @Test + public void testDeleteZoneOperation_True() { + EasyMock.expect(computeRpcMock.deleteZoneOperation(ZONE_OPERATION_ID.getZone(), + ZONE_OPERATION_ID.getOperation())).andReturn(true); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertTrue(compute.deleteOperation(ZONE_OPERATION_ID)); + } + + @Test + public void testDeleteZoneOperation_False() { + EasyMock.expect(computeRpcMock.deleteZoneOperation(ZONE_OPERATION_ID.getZone(), + ZONE_OPERATION_ID.getOperation())).andReturn(false); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertFalse(compute.deleteOperation(ZONE_OPERATION_ID)); + } + + @Test + public void testGetGlobalAddress() { + EasyMock.expect(computeRpcMock.getGlobalAddress( + GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) + .andReturn(GLOBAL_ADDRESS.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Address address = compute.getAddress(GLOBAL_ADDRESS_ID); + assertEquals(new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), address); + } + + @Test + public void testGetGlobalAddress_Null() { + EasyMock.expect(computeRpcMock.getGlobalAddress( + GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getAddress(GLOBAL_ADDRESS_ID)); + } + + @Test + public void testGetGlobalAddressWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getGlobalAddress( + eq(GLOBAL_ADDRESS_ID.getAddress()), capture(capturedOptions))) + .andReturn(GLOBAL_ADDRESS.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Address address = compute.getAddress(GLOBAL_ADDRESS_ID, ADDRESS_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(ADDRESS_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), address); + } + + @Test + public void testGetRegionAddress() { + EasyMock.expect(computeRpcMock.getRegionAddress(REGION_ADDRESS_ID.getRegion(), + REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(REGION_ADDRESS.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Address address = compute.getAddress(REGION_ADDRESS_ID); + assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); + } + + @Test + public void testGetRegionAddress_Null() { + EasyMock.expect(computeRpcMock.getRegionAddress(REGION_ADDRESS_ID.getRegion(), + REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(REGION_ADDRESS.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Address address = compute.getAddress(REGION_ADDRESS_ID); + assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); + } + + @Test + public void testGetRegionAddressWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getRegionAddress(eq(REGION_ADDRESS_ID.getRegion()), + eq(REGION_ADDRESS_ID.getAddress()), capture(capturedOptions))) + .andReturn(REGION_ADDRESS.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Address address = compute.getAddress(REGION_ADDRESS_ID, ADDRESS_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(ADDRESS_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); + } + + @Test + public void testDeleteGlobalAddress_Operation() { + EasyMock.expect(computeRpcMock.deleteGlobalAddress( + GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(globalOperation, compute.deleteAddress(GLOBAL_ADDRESS_ID)); + } + + @Test + public void testDeleteGlobalAddressWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteGlobalAddress(eq(GLOBAL_ADDRESS_ID.getAddress()), + capture(capturedOptions))).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteAddress(GLOBAL_ADDRESS_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testDeleteGlobalAddress_Null() { + EasyMock.expect(computeRpcMock.deleteGlobalAddress( + GLOBAL_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteAddress(GLOBAL_ADDRESS_ID)); + } + + @Test + public void testDeleteRegionAddress_Operation() { + EasyMock.expect(computeRpcMock.deleteRegionAddress(REGION_ADDRESS_ID.getRegion(), + REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(regionOperation, compute.deleteAddress(REGION_ADDRESS_ID)); + } + + @Test + public void testDeleteRegionAddressWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteRegionAddress(eq(REGION_ADDRESS_ID.getRegion()), + eq(REGION_ADDRESS_ID.getAddress()), capture(capturedOptions))) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteAddress(REGION_ADDRESS_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testDeleteRegionAddress_Null() { + EasyMock.expect(computeRpcMock.deleteRegionAddress(REGION_ADDRESS_ID.getRegion(), + REGION_ADDRESS_ID.getAddress(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteAddress(REGION_ADDRESS_ID)); + } + + @Test + public void testListGlobalAddresses() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listGlobalAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page
page = compute.listGlobalAddresses(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListGlobalAddressesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); + ImmutableList
nextAddressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextAddressList, AddressInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listGlobalAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listGlobalAddresses(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page
page = compute.listGlobalAddresses(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextAddressList.toArray(), + Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListEmptyGlobalAddresses() { + ImmutableList addresses = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + addresses); + EasyMock.expect(computeRpcMock.listGlobalAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page
page = compute.listGlobalAddresses(); + assertNull(page.getNextPageToken()); + assertArrayEquals(addresses.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListGlobalAddressesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listGlobalAddresses(ADDRESS_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page
page = compute.listGlobalAddresses(ADDRESS_LIST_PAGE_SIZE, + ADDRESS_LIST_PAGE_TOKEN, ADDRESS_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListRegionAddresses() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + EasyMock.expect( + computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListRegionAddressesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + ImmutableList
nextAddressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextAddressList, AddressInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect( + computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect( + computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), nextOptions)) + .andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextAddressList.toArray(), + Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListEmptyRegionAddresses() { + ImmutableList addresses = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + addresses); + EasyMock.expect( + computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion()); + assertNull(page.getNextPageToken()); + assertArrayEquals(addresses.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testListRegionAddressesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + EasyMock.expect( + computeRpcMock.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), ADDRESS_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page
page = compute.listRegionAddresses(REGION_ADDRESS_ID.getRegion(), + ADDRESS_LIST_PAGE_SIZE, ADDRESS_LIST_PAGE_TOKEN, ADDRESS_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testAggregatedListAddresses() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page
page = compute.listAddresses(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testAggregatedListAddressesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + ImmutableList
nextAddressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextAddressList, AddressInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listAddresses(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page
page = compute.listAddresses(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextAddressList.toArray(), + Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testAggregatedListEmptyAddresses() { + ImmutableList addresses = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + addresses); + EasyMock.expect(computeRpcMock.listAddresses(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Page
page = compute.listAddresses(); + assertNull(page.getNextPageToken()); + assertArrayEquals(addresses.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testAggregatedListAddressesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList
addressList = ImmutableList.of( + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), + new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(addressList, AddressInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listAddresses(ADDRESS_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page
page = compute.listAddresses(ADDRESS_AGGREGATED_LIST_PAGE_SIZE, + ADDRESS_AGGREGATED_LIST_PAGE_TOKEN, ADDRESS_AGGREGATED_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(addressList.toArray(), Iterables.toArray(page.getValues(), Address.class)); + } + + @Test + public void testCreateGlobalAddress() { + EasyMock.expect(computeRpcMock.createGlobalAddress(GLOBAL_ADDRESS.toPb(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + AddressId incompleteId = GlobalAddressId.of("address"); + Operation operation = + compute.create(GLOBAL_ADDRESS.toBuilder().setAddressId(incompleteId).build()); + assertEquals(globalOperation, operation); + } + + @Test + public void testCreateGlobalAddressWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect( + computeRpcMock.createGlobalAddress(eq(GLOBAL_ADDRESS.toPb()), capture(capturedOptions))) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(GLOBAL_ADDRESS, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testCreateRegionAddress() { + EasyMock.expect(computeRpcMock.createRegionAddress(REGION_ADDRESS_ID.getRegion(), + REGION_ADDRESS.toPb(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + AddressId incompleteId = RegionAddressId.of("region", "address"); + Operation operation = + compute.create(REGION_ADDRESS.toBuilder().setAddressId(incompleteId).build()); + assertEquals(regionOperation, operation); + } + + @Test + public void testCreateRegionAddressWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createRegionAddress(eq(REGION_ADDRESS_ID.getRegion()), + eq(REGION_ADDRESS.toPb()), capture(capturedOptions))).andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(REGION_ADDRESS, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(regionOperation, operation); + } + + @Test + public void testCreateSnapshot() { + EasyMock.expect(computeRpcMock.createSnapshot(DISK_ID.getZone(), DISK_ID.getDisk(), + SNAPSHOT_ID.getSnapshot(), null, EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(SNAPSHOT); + assertEquals(zoneOperation, operation); + } + + @Test + public void testCreateSnapshotWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createSnapshot(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), + eq(SNAPSHOT_ID.getSnapshot()), EasyMock.isNull(), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(SNAPSHOT, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testGetSnapshot() { + EasyMock.expect(computeRpcMock.getSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) + .andReturn(SNAPSHOT.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Snapshot snapshot = compute.getSnapshot(SNAPSHOT_ID.getSnapshot()); + assertEquals(new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), snapshot); + } + + @Test + public void testGetSnapshot_Null() { + EasyMock.expect(computeRpcMock.getSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getSnapshot(SNAPSHOT_ID.getSnapshot())); + } + + @Test + public void testGetSnapshotWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getSnapshot(eq(SNAPSHOT_ID.getSnapshot()), + capture(capturedOptions))).andReturn(SNAPSHOT.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Snapshot snapshot = compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), SNAPSHOT_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(SNAPSHOT_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), snapshot); + } + + @Test + public void testDeleteSnapshot_Operation() { + EasyMock.expect(computeRpcMock.deleteSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(globalOperation, compute.deleteSnapshot(SNAPSHOT_ID.getSnapshot())); + } + + @Test + public void testDeleteSnapshotWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteSnapshot(eq(SNAPSHOT_ID.getSnapshot()), + capture(capturedOptions))).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteSnapshot(SNAPSHOT_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testDeleteSnapshot_Null() { + EasyMock.expect(computeRpcMock.deleteSnapshot(SNAPSHOT_ID.getSnapshot(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteSnapshot(SNAPSHOT_ID)); + } + + @Test + public void testListSnapshots() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList snapshotList = ImmutableList.of( + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(snapshotList, SnapshotInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listSnapshots(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSnapshots(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(snapshotList.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); + } + + @Test + public void testListSnapshotsNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList snapshotList = ImmutableList.of( + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); + ImmutableList nextSnapshotList = ImmutableList.of( + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(snapshotList, SnapshotInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextSnapshotList, SnapshotInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listSnapshots(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listSnapshots(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listSnapshots(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(snapshotList.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextSnapshotList.toArray(), + Iterables.toArray(page.getValues(), Snapshot.class)); + } + + @Test + public void testListEmptySnapshots() { + compute = options.getService(); + ImmutableList snapshots = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + snapshots); + EasyMock.expect(computeRpcMock.listSnapshots(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSnapshots(); + assertNull(page.getNextPageToken()); + assertArrayEquals(snapshots.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); + } + + @Test + public void testListSnapshotsWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList snapshotList = ImmutableList.of( + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT)), + new Snapshot(compute, new SnapshotInfo.BuilderImpl(SNAPSHOT))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(snapshotList, SnapshotInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listSnapshots(SNAPSHOT_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSnapshots(SNAPSHOT_LIST_PAGE_SIZE, SNAPSHOT_LIST_PAGE_TOKEN, + SNAPSHOT_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(snapshotList.toArray(), Iterables.toArray(page.getValues(), Snapshot.class)); + } + + @Test + public void testCreateImage() { + EasyMock.expect(computeRpcMock.createImage(IMAGE.toPb(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(IMAGE); + assertEquals(globalOperation, operation); + } + + @Test + public void testCreateImageWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createImage(eq(IMAGE.toPb()), capture(capturedOptions))) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(IMAGE, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testGetImage() { + EasyMock.expect( + computeRpcMock.getImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), EMPTY_RPC_OPTIONS)) + .andReturn(IMAGE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Image image = compute.getImage(IMAGE_ID); + assertEquals(new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), image); + } + + @Test + public void testGetImage_Null() { + EasyMock.expect( + computeRpcMock.getImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getImage(IMAGE_ID)); + } + + @Test + public void testGetImageWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getImage(eq(IMAGE_ID.getProject()), eq(IMAGE_ID.getImage()), + capture(capturedOptions))).andReturn(IMAGE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Image image = compute.getImage(IMAGE_ID, IMAGE_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(IMAGE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("sourceDisk")); + assertTrue(selector.contains("rawDisk")); + assertTrue(selector.contains("description")); + assertEquals(42, selector.length()); + assertEquals(new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), image); + } + + @Test + public void testDeleteImage_Operation() { + EasyMock.expect(computeRpcMock.deleteImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), + EMPTY_RPC_OPTIONS)).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(globalOperation, compute.deleteImage(IMAGE_ID)); + } + + @Test + public void testDeleteImageWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteImage(eq(PROJECT), eq(IMAGE_ID.getImage()), + capture(capturedOptions))).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteImage(ImageId.of("image"), OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testDeleteImage_Null() { + EasyMock.expect(computeRpcMock.deleteImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteImage(IMAGE_ID)); + } + + @Test + public void testDeprecateImage_Operation() { + EasyMock.expect(computeRpcMock.deprecateImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), + DEPRECATION_STATUS.toPb(), EMPTY_RPC_OPTIONS)).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(globalOperation, compute.deprecate(IMAGE_ID, DEPRECATION_STATUS)); + } + + @Test + public void testDeprecateImageWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deprecateImage(eq(PROJECT), eq(IMAGE_ID.getImage()), + eq(DEPRECATION_STATUS.toPb()), capture(capturedOptions))).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = + compute.deprecate(ImageId.of("image"), DEPRECATION_STATUS, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testDeprecateImage_Null() { + EasyMock.expect(computeRpcMock.deprecateImage(IMAGE_ID.getProject(), IMAGE_ID.getImage(), + DEPRECATION_STATUS.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deprecate(IMAGE_ID, DEPRECATION_STATUS)); + } + + @Test + public void testListImages() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList imageList = ImmutableList.of( + new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), + new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listImages(PROJECT, EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testListImagesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList imageList = ImmutableList.of( + new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), + new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); + ImmutableList nextImageList = ImmutableList.of( + new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextImageList, ImageInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listImages(PROJECT, EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listImages(PROJECT, nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextImageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testListImagesForProject() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList imageList = ImmutableList.of( + new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), + new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listImages("otherProject", EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages("otherProject"); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testListEmptyImages() { + compute = options.getService(); + ImmutableList images = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + images); + EasyMock.expect(computeRpcMock.listImages(PROJECT, EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages(); + assertNull(page.getNextPageToken()); + assertArrayEquals(images.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testListEmptyImagesForProject() { + compute = options.getService(); + ImmutableList images = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + images); + EasyMock.expect(computeRpcMock.listImages("otherProject", EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages("otherProject"); + assertNull(page.getNextPageToken()); + assertArrayEquals(images.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testListImagesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList imageList = ImmutableList.of( + new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), + new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listImages(PROJECT, IMAGE_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages(IMAGE_LIST_PAGE_SIZE, IMAGE_LIST_PAGE_TOKEN, + IMAGE_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testListImagesForProjectWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList imageList = ImmutableList.of( + new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), + new Image(compute, new ImageInfo.BuilderImpl(IMAGE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(imageList, ImageInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listImages("other", IMAGE_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listImages("other", IMAGE_LIST_PAGE_SIZE, IMAGE_LIST_PAGE_TOKEN, + IMAGE_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(imageList.toArray(), Iterables.toArray(page.getValues(), Image.class)); + } + + @Test + public void testGetDisk() { + EasyMock.expect(computeRpcMock.getDisk(DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) + .andReturn(DISK.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Disk disk = compute.getDisk(DISK_ID); + assertEquals(new Disk(compute, new DiskInfo.BuilderImpl(DISK)), disk); + } + + @Test + public void testGetDisk_Null() { + EasyMock.expect(computeRpcMock.getDisk(DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getDisk(DISK_ID)); + } + + @Test + public void testGetDiskWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getDisk(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), + capture(capturedOptions))).andReturn(DISK.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Disk disk = compute.getDisk(DISK_ID, DISK_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(DISK_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("type")); + assertTrue(selector.contains("sourceImage")); + assertTrue(selector.contains("sourceSnapshot")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(55, selector.length()); + assertEquals(new Disk(compute, new DiskInfo.BuilderImpl(DISK)), disk); + } + + @Test + public void testDeleteDisk_Operation() { + EasyMock.expect(computeRpcMock.deleteDisk( + DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.deleteDisk(DISK_ID)); + } + + @Test + public void testDeleteDiskWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteDisk(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteDisk(DISK_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testDeleteDisk_Null() { + EasyMock.expect(computeRpcMock.deleteDisk( + DISK_ID.getZone(), DISK_ID.getDisk(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteDisk(DISK_ID)); + } + + @Test + public void testListDisks() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK)), + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(DISK_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testListDisksNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList diskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK)), + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + ImmutableList nextDiskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, Iterables.transform(nextDiskList, DiskInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(DISK_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextDiskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testListEmptyDisks() { + compute = options.getService(); + ImmutableList disks = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + disks); + EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(DISK_ID.getZone()); + assertNull(page.getNextPageToken()); + assertArrayEquals(disks.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testListDisksWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK)), + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDisks(DISK_ID.getZone(), DISK_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks( + DISK_ID.getZone(), DISK_LIST_PAGE_SIZE, DISK_LIST_PAGE_TOKEN, DISK_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testAggregatedListDisks() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK)), + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDisks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testAggregatedListDisksNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList diskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK)), + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + ImmutableList nextDiskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, Iterables.transform(nextDiskList, DiskInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listDisks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listDisks(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextDiskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testAggregatedListEmptyDisks() { + compute = options.getService(); + ImmutableList diskList = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + diskList); + EasyMock.expect(computeRpcMock.listDisks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(); + assertNull(page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testAggregatedListDisksWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList diskList = ImmutableList.of( + new Disk(compute, new DiskInfo.BuilderImpl(DISK)), + new Disk(compute, new DiskInfo.BuilderImpl(DISK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(diskList, DiskInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listDisks(DISK_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listDisks(DISK_AGGREGATED_LIST_PAGE_SIZE, + DISK_AGGREGATED_LIST_PAGE_TOKEN, DISK_AGGREGATED_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(diskList.toArray(), Iterables.toArray(page.getValues(), Disk.class)); + } + + @Test + public void testCreateDisk() { + EasyMock.expect(computeRpcMock.createDisk(DISK_ID.getZone(), DISK.toPb(), EMPTY_RPC_OPTIONS)) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + DiskId diskId = DiskId.of("zone", "disk"); + DiskTypeId diskTypeId = DiskTypeId.of("zone", "diskType"); + DiskInfo disk = DISK.toBuilder() + .setDiskId(diskId) + .setConfiguration(StandardDiskConfiguration.of(diskTypeId)) + .build(); + Operation operation = compute.create(disk); + assertEquals(zoneOperation, operation); + } + + @Test + public void testCreateDiskWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createDisk(eq(DISK_ID.getZone()), eq(DISK.toPb()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(DISK, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testResizeDisk_Operation() { + EasyMock.expect(computeRpcMock.resizeDisk(DISK_ID.getZone(), DISK_ID.getDisk(), 42L, + EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.resize(DISK_ID, 42L)); + } + + @Test + public void testResizeDiskWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.resizeDisk(eq(DISK_ID.getZone()), eq(DISK_ID.getDisk()), eq(42L), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.resize(DISK_ID, 42L, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testResizeDisk_Null() { + EasyMock.expect(computeRpcMock.resizeDisk(DISK_ID.getZone(), DISK_ID.getDisk(), 42L, + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.resize(DISK_ID, 42L)); + } + + @Test + public void testGetSubnetwork() { + EasyMock.expect(computeRpcMock.getSubnetwork( + SUBNETWORK_ID.getRegion(), SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)) + .andReturn(SUBNETWORK.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Subnetwork subnetwork = compute.getSubnetwork(SUBNETWORK_ID); + assertEquals(new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), subnetwork); + } + + @Test + public void testGetSubnetwork_Null() { + EasyMock.expect(computeRpcMock.getSubnetwork( + SUBNETWORK_ID.getRegion(), SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getSubnetwork(SUBNETWORK_ID)); + } + + @Test + public void testGetSubnetworkWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getSubnetwork(eq(SUBNETWORK_ID.getRegion()), + eq(SUBNETWORK_ID.getSubnetwork()), capture(capturedOptions))).andReturn(SUBNETWORK.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Subnetwork subnetwork = compute.getSubnetwork(SUBNETWORK_ID, SUBNETWORK_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(SUBNETWORK_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), subnetwork); + } + + @Test + public void testDeleteSubnetwork_Operation() { + EasyMock.expect(computeRpcMock.deleteSubnetwork(SUBNETWORK_ID.getRegion(), + SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(regionOperation, compute.deleteSubnetwork(SUBNETWORK_ID)); + } + + @Test + public void testDeleteSubnetworkWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteSubnetwork(eq(SUBNETWORK_ID.getRegion()), + eq(SUBNETWORK_ID.getSubnetwork()), capture(capturedOptions))) + .andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteSubnetwork(SUBNETWORK_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(regionOperation, operation); + } + + @Test + public void testDeleteSubnetwork_Null() { + EasyMock.expect(computeRpcMock.deleteSubnetwork(SUBNETWORK_ID.getRegion(), + SUBNETWORK_ID.getSubnetwork(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteSubnetwork(SUBNETWORK_ID)); + } + + @Test + public void testListSubnetworks() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList subnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(subnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testListSubnetworksNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList subnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + ImmutableList nextSubnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + Tuple> + nextResult = Tuple.of(nextCursor, + Iterables.transform(nextSubnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), nextOptions)) + .andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(subnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextSubnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testListEmptySubnetworks() { + compute = options.getService(); + ImmutableList subnetworks = + ImmutableList.of(); + Tuple> result = + Tuple.>of( + null, + subnetworks); + EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_ID.getRegion(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion()); + assertNull(page.getNextPageToken()); + assertArrayEquals(subnetworks.toArray(), Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testListSubnetworksWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList subnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listSubnetworks( + SUBNETWORK_ID.getRegion(), SUBNETWORK_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(SUBNETWORK_ID.getRegion(), + SUBNETWORK_LIST_PAGE_SIZE, SUBNETWORK_LIST_PAGE_TOKEN, SUBNETWORK_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(subnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testAggregatedListSubnetworks() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList subnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listSubnetworks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(subnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testAggregatedListSubnetworksNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList subnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + ImmutableList nextSubnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + Tuple> + nextResult = Tuple.of(nextCursor, + Iterables.transform(nextSubnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listSubnetworks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listSubnetworks(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(subnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextSubnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testAggregatedListEmptySubnetworks() { + compute = options.getService(); + ImmutableList subnetworks = + ImmutableList.of(); + Tuple> result = + Tuple.>of( + null, + subnetworks); + EasyMock.expect(computeRpcMock.listSubnetworks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(); + assertNull(page.getNextPageToken()); + assertArrayEquals(subnetworks.toArray(), Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testAggregatedListSubnetworksWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList subnetworkList = ImmutableList.of( + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), + new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK))); + Tuple> result = + Tuple.of(cursor, + Iterables.transform(subnetworkList, SubnetworkInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listSubnetworks(SUBNETWORK_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listSubnetworks(SUBNETWORK_AGGREGATED_LIST_PAGE_SIZE, + SUBNETWORK_AGGREGATED_LIST_PAGE_TOKEN, SUBNETWORK_AGGREGATED_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(subnetworkList.toArray(), + Iterables.toArray(page.getValues(), Subnetwork.class)); + } + + @Test + public void testCreateSubnetwork() { + EasyMock.expect(computeRpcMock.createSubnetwork(SUBNETWORK_ID.getRegion(), SUBNETWORK.toPb(), + EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + SubnetworkId subnetworkId = SubnetworkId.of("region", "network"); + NetworkId networkId = NetworkId.of("network"); + SubnetworkInfo subnetwork = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); + Operation operation = compute.create(subnetwork); + assertEquals(regionOperation, operation); + } + + @Test + public void testCreateSubnetworkWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createSubnetwork(eq(SUBNETWORK_ID.getRegion()), + eq(SUBNETWORK.toPb()), capture(capturedOptions))).andReturn(regionOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(SUBNETWORK, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(regionOperation, operation); + } + + @Test + public void testGetNetwork() { + EasyMock.expect(computeRpcMock.getNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) + .andReturn(NETWORK.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Network network = compute.getNetwork(NETWORK_ID.getNetwork()); + assertEquals(new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), network); + } + + @Test + public void testGetNetwork_Null() { + EasyMock.expect(computeRpcMock.getNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getNetwork(NETWORK_ID.getNetwork())); + } + + @Test + public void testGetNetworkWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getNetwork(eq( + NETWORK_ID.getNetwork()), capture(capturedOptions))) + .andReturn(NETWORK.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Network network = compute.getNetwork(NETWORK_ID.getNetwork(), NETWORK_OPTION_FIELDS); + String selector = (String) capturedOptions.getValue().get(NETWORK_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertTrue(selector.contains("IPv4Range")); + assertTrue(selector.contains("autoCreateSubnetworks")); + assertEquals(55, selector.length()); + assertEquals(new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), network); + } + + @Test + public void testDeleteNetwork_Operation() { + EasyMock.expect(computeRpcMock.deleteNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(globalOperation, compute.deleteNetwork(NETWORK_ID)); + } + + @Test + public void testDeleteNetworkWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteNetwork(eq(NETWORK_ID.getNetwork()), + capture(capturedOptions))).andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteNetwork(NETWORK_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testDeleteNetwork_Null() { + EasyMock.expect(computeRpcMock.deleteNetwork(NETWORK_ID.getNetwork(), EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteNetwork(NETWORK_ID)); + } + + @Test + public void testListNetworks() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList networkList = ImmutableList.of( + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(networkList, NetworkInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listNetworks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listNetworks(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(networkList.toArray(), Iterables.toArray(page.getValues(), Network.class)); + } + + @Test + public void testListNetworksNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList networkList = ImmutableList.of( + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); + ImmutableList nextNetworkList = ImmutableList.of( + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(networkList, NetworkInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextNetworkList, NetworkInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listNetworks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listNetworks(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listNetworks(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(networkList.toArray(), Iterables.toArray(page.getValues(), Network.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextNetworkList.toArray(), + Iterables.toArray(page.getValues(), Network.class)); + } + + @Test + public void testListEmptyNetworks() { + compute = options.getService(); + ImmutableList networks = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + networks); + EasyMock.expect(computeRpcMock.listNetworks(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listNetworks(); + assertNull(page.getNextPageToken()); + assertArrayEquals(networks.toArray(), Iterables.toArray(page.getValues(), Network.class)); + } + + @Test + public void testListNetworksWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList networkList = ImmutableList.of( + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK)), + new Network(compute, new NetworkInfo.BuilderImpl(NETWORK))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(networkList, NetworkInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listNetworks(NETWORK_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listNetworks(NETWORK_LIST_PAGE_SIZE, NETWORK_LIST_PAGE_TOKEN, + NETWORK_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(networkList.toArray(), Iterables.toArray(page.getValues(), Network.class)); + } + + @Test + public void testCreateNetwork() { + EasyMock.expect(computeRpcMock.createNetwork(NETWORK.toPb(), EMPTY_RPC_OPTIONS)) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + NetworkInfo network = + NetworkInfo.of(NetworkId.of("network"), StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(network); + assertEquals(globalOperation, operation); + } + + @Test + public void testCreateNetworkWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createNetwork(eq(NETWORK.toPb()), capture(capturedOptions))) + .andReturn(globalOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(NETWORK, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(globalOperation, operation); + } + + @Test + public void testGetInstance() { + EasyMock.expect(computeRpcMock.getInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(INSTANCE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Instance instance = compute.getInstance(INSTANCE_ID); + assertEquals(new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), instance); + } + + @Test + public void testGetInstance_Null() { + EasyMock.expect(computeRpcMock.getInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getInstance(INSTANCE_ID)); + } + + @Test + public void testGetInstanceWithSelectedFields() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.getInstance( + eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), capture(capturedOptions))) + .andReturn(INSTANCE.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Instance instance = compute.getInstance(INSTANCE_ID, INSTANCE_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(INSTANCE_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), instance); + } + + @Test + public void testDeleteInstance_Operation() { + EasyMock.expect(computeRpcMock.deleteInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.deleteInstance(INSTANCE_ID)); + } + + @Test + public void testDeleteInstanceWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteInstance(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteInstance(INSTANCE_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testDeleteInstance_Null() { + EasyMock.expect(computeRpcMock.deleteInstance(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteInstance(INSTANCE_ID)); + } + + @Test + public void testListInstances() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(INSTANCE_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testListInstancesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + ImmutableList nextInstanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextInstanceList, InstanceInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), nextOptions)) + .andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(INSTANCE_ID.getZone()); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextInstanceList.toArray(), + Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testListEmptyInstances() { + compute = options.getService(); + ImmutableList instances = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + instances); + EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), EMPTY_RPC_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(INSTANCE_ID.getZone()); + assertNull(page.getNextPageToken()); + assertArrayEquals(instances.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testListInstancesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listInstances(INSTANCE_ID.getZone(), INSTANCE_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(INSTANCE_ID.getZone(), INSTANCE_LIST_PAGE_SIZE, + INSTANCE_LIST_PAGE_TOKEN, INSTANCE_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testAggregatedListInstances() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listInstances(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testAggregatedListInstancesNextPage() { + String cursor = "cursor"; + String nextCursor = "nextCursor"; + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + ImmutableList nextInstanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); + Tuple> nextResult = + Tuple.of(nextCursor, + Iterables.transform(nextInstanceList, InstanceInfo.TO_PB_FUNCTION)); + Map nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor); + EasyMock.expect(computeRpcMock.listInstances(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.expect(computeRpcMock.listInstances(nextOptions)).andReturn(nextResult); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + page = page.getNextPage(); + assertEquals(nextCursor, page.getNextPageToken()); + assertArrayEquals(nextInstanceList.toArray(), + Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testAggregatedListEmptyInstances() { + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of(); + Tuple> result = + Tuple.>of(null, + instanceList); + EasyMock.expect(computeRpcMock.listInstances(EMPTY_RPC_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(); + assertNull(page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testAggregatedListInstancesWithOptions() { + String cursor = "cursor"; + compute = options.getService(); + ImmutableList instanceList = ImmutableList.of( + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), + new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE))); + Tuple> result = + Tuple.of(cursor, Iterables.transform(instanceList, InstanceInfo.TO_PB_FUNCTION)); + EasyMock.expect(computeRpcMock.listInstances(INSTANCE_LIST_OPTIONS)).andReturn(result); + EasyMock.replay(computeRpcMock); + Page page = compute.listInstances(INSTANCE_AGGREGATED_LIST_PAGE_SIZE, + INSTANCE_AGGREGATED_LIST_PAGE_TOKEN, INSTANCE_AGGREGATED_LIST_FILTER); + assertEquals(cursor, page.getNextPageToken()); + assertArrayEquals(instanceList.toArray(), Iterables.toArray(page.getValues(), Instance.class)); + } + + @Test + public void testCreateInstance() { + EasyMock.expect(computeRpcMock.createInstance(INSTANCE_ID.getZone(), INSTANCE.toPb(), + EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + InstanceInfo instance = InstanceInfo.of(InstanceId.of("zone", "instance"), + MachineTypeId.of("zone", "type"), ATTACHED_DISK, + NetworkInterface.of(NetworkId.of("network"))); + Operation operation = compute.create(instance); + assertEquals(zoneOperation, operation); + } + + @Test + public void testCreateInstanceWithOptions() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.createInstance(eq(INSTANCE_ID.getZone()), eq(INSTANCE.toPb()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.create(INSTANCE, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testAddAccessConfig_Operation() { + AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); + EasyMock.expect(computeRpcMock.addAccessConfig(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + "networkInterface", accessConfig.toPb(), EMPTY_RPC_OPTIONS)) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, + compute.addAccessConfig(INSTANCE_ID, "networkInterface", accessConfig)); + } + + @Test + public void testAddAccessConfigWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); + EasyMock.expect(computeRpcMock.addAccessConfig(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq("networkInterface"), eq(accessConfig.toPb()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.addAccessConfig(INSTANCE_ID, "networkInterface", accessConfig, + OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testAddAccessConfig_Null() { + AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); + EasyMock.expect(computeRpcMock.addAccessConfig(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + "networkInterface", accessConfig.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.addAccessConfig(INSTANCE_ID, "networkInterface", accessConfig)); + } + + @Test + public void testAttachDisk_Operation() { + AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); + EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.attachDisk(INSTANCE_ID, PERSISTENT_DISK_CONFIGURATION)); + } + + @Test + public void testAttachDiskWithSelectedFields_Operation() { + AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.attachDisk( + eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), eq(attachedDisk.toPb()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = + compute.attachDisk(INSTANCE_ID, PERSISTENT_DISK_CONFIGURATION, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testAttachDisk_Null() { + AttachedDisk attachedDisk = AttachedDisk.of(PERSISTENT_DISK_CONFIGURATION); + EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.attachDisk(INSTANCE_ID, PERSISTENT_DISK_CONFIGURATION)); + } + + @Test + public void testAttachDiskName_Operation() { + AttachedDisk attachedDisk = AttachedDisk.of("dev0", PERSISTENT_DISK_CONFIGURATION); + EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, + compute.attachDisk(INSTANCE_ID, "dev0", PERSISTENT_DISK_CONFIGURATION)); + } + + @Test + public void testAttachDiskNameWithSelectedFields_Operation() { + AttachedDisk attachedDisk = AttachedDisk.of("dev0", PERSISTENT_DISK_CONFIGURATION); + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.attachDisk( + eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), eq(attachedDisk.toPb()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.attachDisk(INSTANCE_ID, "dev0", PERSISTENT_DISK_CONFIGURATION, + OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testAttachDiskName_Null() { + AttachedDisk attachedDisk = AttachedDisk.of("dev0", PERSISTENT_DISK_CONFIGURATION); + EasyMock.expect(computeRpcMock.attachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + attachedDisk.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.attachDisk(INSTANCE_ID, "dev0", PERSISTENT_DISK_CONFIGURATION)); + } + + @Test + public void testDeleteAccessConfig_Operation() { + EasyMock.expect(computeRpcMock.deleteAccessConfig(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), "networkInterface", "accessConfig", EMPTY_RPC_OPTIONS)) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, + compute.deleteAccessConfig(INSTANCE_ID, "networkInterface", "accessConfig")); + } + + @Test + public void testDeleteAccessConfigWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.deleteAccessConfig(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq("networkInterface"), eq("accessConfig"), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.deleteAccessConfig(INSTANCE_ID, "networkInterface", + "accessConfig", OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testDeleteAccessConfig_Null() { + EasyMock.expect(computeRpcMock.deleteAccessConfig(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), "networkInterface", "accessConfig", EMPTY_RPC_OPTIONS)) + .andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.deleteAccessConfig(INSTANCE_ID, "networkInterface", "accessConfig")); + } + + @Test + public void testDetachDisk_Operation() { + EasyMock.expect(computeRpcMock.detachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + "device", EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.detachDisk(INSTANCE_ID, "device")); + } + + @Test + public void testDetachDiskWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.detachDisk(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq("device"), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.detachDisk(INSTANCE_ID, "device", OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testDetachDisk_Null() { + EasyMock.expect(computeRpcMock.detachDisk(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + "device", EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.detachDisk(INSTANCE_ID, "device")); + } + + @Test + public void testSerialPortOutputFromPort() { + String output = "output"; + EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), 2, EMPTY_RPC_OPTIONS)).andReturn(output); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(output, compute.getSerialPortOutput(INSTANCE_ID, 2)); + } + + @Test + public void testSerialPortOutputDefault() { + String output = "output"; + EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), null, EMPTY_RPC_OPTIONS)).andReturn(output); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(output, compute.getSerialPortOutput(INSTANCE_ID)); + } + + @Test + public void testSerialPortOutputFromPort_Null() { + EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), 2, EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getSerialPortOutput(INSTANCE_ID, 2)); + } + + @Test + public void testSerialPortOutputDefault_Null() { + EasyMock.expect(computeRpcMock.getSerialPortOutput(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), null, EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.getSerialPortOutput(INSTANCE_ID)); + } + + @Test + public void testResetInstance_Operation() { + EasyMock.expect(computeRpcMock.reset(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.reset(INSTANCE_ID)); + } + + @Test + public void testResetInstanceWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.reset(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.reset(INSTANCE_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testResetInstance_Null() { + EasyMock.expect(computeRpcMock.reset(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.reset(INSTANCE_ID)); + } + + @Test + public void testSetDiskAutodelete_Operation() { + EasyMock.expect(computeRpcMock.setDiskAutoDelete(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), "device", true, EMPTY_RPC_OPTIONS)) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.setDiskAutoDelete(INSTANCE_ID, "device", true)); + } + + @Test + public void testSetDiskAutodeleteWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.setDiskAutoDelete(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq("device"), eq(true), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = + compute.setDiskAutoDelete(INSTANCE_ID, "device", true, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testSetDiskAutodelete_Null() { + EasyMock.expect(computeRpcMock.setDiskAutoDelete(INSTANCE_ID.getZone(), + INSTANCE_ID.getInstance(), "device", false, EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.setDiskAutoDelete(INSTANCE_ID, "device", false)); + } + + @Test + public void testSetMachineType_Operation() { + EasyMock.expect(computeRpcMock.setMachineType(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + MACHINE_TYPE_ID.getSelfLink(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, + compute.setMachineType(INSTANCE_ID, MachineTypeId.of("zone", "type"))); + } + + @Test + public void testSetMachineTypeWithOptions_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.setMachineType(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq(MACHINE_TYPE_ID.getSelfLink()), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.setMachineType(INSTANCE_ID, MachineTypeId.of("zone", "type"), + OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testSetMachineType_Null() { + EasyMock.expect(computeRpcMock.setMachineType(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + MACHINE_TYPE_ID.getSelfLink(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.setMachineType(INSTANCE_ID, MachineTypeId.of("zone", "type"))); + } + + @Test + public void testSetMetadata_Operation() { + Metadata metadata = Metadata.newBuilder() + .add("key", "value") + .setFingerprint("fingerprint") + .build(); + EasyMock.expect(computeRpcMock.setMetadata(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + metadata.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.setMetadata(INSTANCE_ID, metadata)); + } + + @Test + public void testSetMetadataWithOptions_Operation() { + Capture> capturedOptions = Capture.newInstance(); + Metadata metadata = Metadata.newBuilder() + .add("key", "value") + .setFingerprint("fingerprint") + .build(); + EasyMock.expect(computeRpcMock.setMetadata(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq(metadata.toPb()), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.setMetadata(INSTANCE_ID, metadata, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testSetMetadata_Null() { + Metadata metadata = Metadata.newBuilder() + .add("key", "value") + .setFingerprint("fingerprint") + .build(); + EasyMock.expect(computeRpcMock.setMetadata(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + metadata.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.setMetadata(INSTANCE_ID, metadata)); + } + + @Test + public void testSetSchedulingOptions_Operation() { + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + EasyMock.expect(computeRpcMock.setScheduling(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + schedulingOptions.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)); + } + + @Test + public void testSetSchedulingOptionsWithOptions_Operation() { + Capture> capturedOptions = Capture.newInstance(); + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + EasyMock.expect(computeRpcMock.setScheduling(eq(INSTANCE_ID.getZone()), + eq(INSTANCE_ID.getInstance()), eq(schedulingOptions.toPb()), capture(capturedOptions))) + .andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = + compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testSetSchedulingOptions_Null() { + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + EasyMock.expect(computeRpcMock.setScheduling(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + schedulingOptions.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)); + } + + @Test + public void testTags_Operation() { + Tags tags = Tags.of("tag1", "tag2"); + EasyMock.expect(computeRpcMock.setTags(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + tags.toPb(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.setTags(INSTANCE_ID, tags)); + } + + @Test + public void testSetTagsWithOptions_Operation() { + Tags tags = Tags.of("tag1", "tag2"); + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.setTags(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), + eq(tags.toPb()), capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.setTags(INSTANCE_ID, tags, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testSetTags_Null() { + Tags tags = Tags.of("tag1", "tag2"); + EasyMock.expect(computeRpcMock.setTags(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + tags.toPb(), EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.setTags(INSTANCE_ID, tags)); + } + + @Test + public void testStartInstance_Operation() { + EasyMock.expect(computeRpcMock.start(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.start(INSTANCE_ID)); + } + + @Test + public void testStartInstanceWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.start(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.start(INSTANCE_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testStartInstance_Null() { + EasyMock.expect(computeRpcMock.start(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.start(INSTANCE_ID)); + } + + @Test + public void testStopInstance_Operation() { + EasyMock.expect(computeRpcMock.stop(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertEquals(zoneOperation, compute.stop(INSTANCE_ID)); + } + + @Test + public void testStopInstanceWithSelectedFields_Operation() { + Capture> capturedOptions = Capture.newInstance(); + EasyMock.expect(computeRpcMock.stop(eq(INSTANCE_ID.getZone()), eq(INSTANCE_ID.getInstance()), + capture(capturedOptions))).andReturn(zoneOperation.toPb()); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + Operation operation = compute.stop(INSTANCE_ID, OPERATION_OPTION_FIELDS); + String selector = + (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption()); + assertTrue(selector.contains("selfLink")); + assertTrue(selector.contains("id")); + assertTrue(selector.contains("description")); + assertEquals(23, selector.length()); + assertEquals(zoneOperation, operation); + } + + @Test + public void testStopInstance_Null() { + EasyMock.expect(computeRpcMock.stop(INSTANCE_ID.getZone(), INSTANCE_ID.getInstance(), + EMPTY_RPC_OPTIONS)).andReturn(null); + EasyMock.replay(computeRpcMock); + compute = options.getService(); + assertNull(compute.stop(INSTANCE_ID)); + } + + @Test + public void testRetryableException() { + EasyMock.expect(computeRpcMock.getDiskType( + DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andThrow(new ComputeException(500, "InternalError")) + .andReturn(DISK_TYPE.toPb()); + EasyMock.replay(computeRpcMock); + compute = + options.toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()).build() + .getService(); + DiskType diskType = compute.getDiskType(DISK_TYPE_ID); + assertEquals(DISK_TYPE, diskType); + } + + @Test + public void testNonRetryableException() { + String exceptionMessage = "Not Implemented"; + EasyMock.expect(computeRpcMock.getDiskType( + DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andThrow(new ComputeException(501, exceptionMessage)); + EasyMock.replay(computeRpcMock); + compute = + options.toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()).build() + .getService(); + thrown.expect(ComputeException.class); + thrown.expectMessage(exceptionMessage); + compute.getDiskType(DISK_TYPE_ID); + } + + @Test + public void testRuntimeException() { + String exceptionMessage = "Artificial runtime exception"; + EasyMock.expect(computeRpcMock.getDiskType( + DISK_TYPE_ID.getZone(), DISK_TYPE_ID.getType(), EMPTY_RPC_OPTIONS)) + .andThrow(new RuntimeException(exceptionMessage)); + EasyMock.replay(computeRpcMock); + compute = + options.toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()).build() + .getService(); + thrown.expect(ComputeException.class); + thrown.expectMessage(exceptionMessage); + compute.getDiskType(DISK_TYPE_ID); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java new file mode 100644 index 000000000000..5511d870ce35 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ComputeOptionsTest.java @@ -0,0 +1,36 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.cloud.TransportOptions; +import org.easymock.EasyMock; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class ComputeOptionsTest { + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testInvalidTransport() { + thrown.expect(IllegalArgumentException.class); + ComputeOptions.newBuilder().setTransportOptions(EasyMock.createMock(TransportOptions.class)); + } + +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java new file mode 100644 index 000000000000..b11d516105b7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DeprecationStatusTest.java @@ -0,0 +1,183 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; +import org.junit.Test; + +public class DeprecationStatusTest { + + private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); + private static final Long DELETED_MILLIS = 1453293540000L; + private static final Long DEPRECATED_MILLIS = 1453293420000L; + private static final Long OBSOLETE_MILLIS = 1453293480000L; + private static final String DELETED = TIMESTAMP_FORMATTER.print(DELETED_MILLIS); + private static final String DEPRECATED = TIMESTAMP_FORMATTER.print(DEPRECATED_MILLIS); + private static final String OBSOLETE = TIMESTAMP_FORMATTER.print(OBSOLETE_MILLIS); + private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); + private static final MachineTypeId MACHINE_TYPE_ID = + MachineTypeId.of("project", "zone", "machineType"); + private static final DeprecationStatus.Status STATUS = DeprecationStatus.Status.DELETED; + private static final DeprecationStatus DISK_TYPE_STATUS = + DeprecationStatus.newBuilder(STATUS) + .setReplacement(DISK_TYPE_ID) + .setDeprecated(DEPRECATED) + .setObsolete(OBSOLETE) + .setDeleted(DELETED) + .build(); + private static final DeprecationStatus DISK_TYPE_STATUS_MILLIS = + DeprecationStatus.newBuilder(STATUS) + .setReplacement(DISK_TYPE_ID) + .setDeprecated(DEPRECATED_MILLIS) + .setObsolete(OBSOLETE_MILLIS) + .setDeleted(DELETED_MILLIS) + .build(); + private static final DeprecationStatus MACHINE_TYPE_STATUS = + DeprecationStatus.newBuilder(STATUS, MACHINE_TYPE_ID) + .setDeprecated(DEPRECATED) + .setObsolete(OBSOLETE) + .setDeleted(DELETED) + .build(); + + @Test + public void testBuilder() { + compareDeprecationStatus(DISK_TYPE_STATUS, DISK_TYPE_STATUS_MILLIS); + assertEquals(DELETED, DISK_TYPE_STATUS.getDeleted()); + assertEquals(DEPRECATED, DISK_TYPE_STATUS.getDeprecated()); + assertEquals(OBSOLETE, DISK_TYPE_STATUS.getObsolete()); + assertEquals(DISK_TYPE_ID, DISK_TYPE_STATUS.getReplacement()); + assertEquals(DEPRECATED_MILLIS, DISK_TYPE_STATUS.getDeprecatedMillis()); + assertEquals(DELETED_MILLIS, DISK_TYPE_STATUS.getDeletedMillis()); + assertEquals(OBSOLETE_MILLIS, DISK_TYPE_STATUS.getObsoleteMillis()); + assertEquals(STATUS, DISK_TYPE_STATUS.getStatus()); + assertEquals(DELETED, DISK_TYPE_STATUS_MILLIS.getDeleted()); + assertEquals(DEPRECATED, DISK_TYPE_STATUS_MILLIS.getDeprecated()); + assertEquals(OBSOLETE, DISK_TYPE_STATUS_MILLIS.getObsolete()); + assertEquals(DISK_TYPE_ID, DISK_TYPE_STATUS_MILLIS.getReplacement()); + assertEquals(DEPRECATED_MILLIS, DISK_TYPE_STATUS_MILLIS.getDeprecatedMillis()); + assertEquals(DELETED_MILLIS, DISK_TYPE_STATUS_MILLIS.getDeletedMillis()); + assertEquals(OBSOLETE_MILLIS, DISK_TYPE_STATUS_MILLIS.getObsoleteMillis()); + assertEquals(STATUS, DISK_TYPE_STATUS.getStatus()); + assertEquals(DELETED, MACHINE_TYPE_STATUS.getDeleted()); + assertEquals(DEPRECATED, MACHINE_TYPE_STATUS.getDeprecated()); + assertEquals(OBSOLETE, MACHINE_TYPE_STATUS.getObsolete()); + assertEquals(DEPRECATED_MILLIS, MACHINE_TYPE_STATUS.getDeprecatedMillis()); + assertEquals(DELETED_MILLIS, MACHINE_TYPE_STATUS.getDeletedMillis()); + assertEquals(OBSOLETE_MILLIS, MACHINE_TYPE_STATUS.getObsoleteMillis()); + assertEquals(MACHINE_TYPE_ID, MACHINE_TYPE_STATUS.getReplacement()); + assertEquals(STATUS, MACHINE_TYPE_STATUS.getStatus()); + } + + @Test + public void testGettersIllegalArgument() { + DeprecationStatus deprecationStatus = + DeprecationStatus.newBuilder(STATUS, MACHINE_TYPE_ID) + .setDeprecated("deprecated") + .setObsolete("obsolete") + .setDeleted("delete") + .build(); + assertEquals("deprecated", deprecationStatus.getDeprecated()); + try { + deprecationStatus.getDeprecatedMillis(); + fail("Expected IllegalArgumentException"); + } catch (IllegalStateException ex) { + // never reached + } + assertEquals("obsolete", deprecationStatus.getObsolete()); + try { + deprecationStatus.getObsoleteMillis(); + fail("Expected IllegalArgumentException"); + } catch (IllegalStateException ex) { + // never reached + } + assertEquals("delete", deprecationStatus.getDeleted()); + try { + deprecationStatus.getDeletedMillis(); + fail("Expected IllegalArgumentException"); + } catch (IllegalStateException ex) { + // never reached + } + } + + @Test + public void testToBuilder() { + compareDeprecationStatus(DISK_TYPE_STATUS, DISK_TYPE_STATUS.toBuilder().build()); + compareDeprecationStatus(MACHINE_TYPE_STATUS, MACHINE_TYPE_STATUS.toBuilder().build()); + DeprecationStatus deprecationStatus = DISK_TYPE_STATUS.toBuilder() + .setDeleted(DEPRECATED) + .build(); + assertEquals(DEPRECATED, deprecationStatus.getDeleted()); + deprecationStatus = deprecationStatus.toBuilder().setDeleted(DELETED).build(); + compareDeprecationStatus(DISK_TYPE_STATUS, deprecationStatus); + } + + @Test + public void testToBuilderIncomplete() { + DeprecationStatus diskStatus = DeprecationStatus.of(STATUS, DISK_TYPE_ID); + assertEquals(diskStatus, diskStatus.toBuilder().build()); + } + + @Test + public void testOf() { + DeprecationStatus diskStatus = DeprecationStatus.of(STATUS, DISK_TYPE_ID); + assertNull(diskStatus.getDeleted()); + assertNull(diskStatus.getDeprecated()); + assertNull(diskStatus.getObsolete()); + assertEquals(DISK_TYPE_ID, diskStatus.getReplacement()); + assertEquals(STATUS, diskStatus.getStatus()); + } + + @Test + public void testToAndFromPb() { + DeprecationStatus diskStatus = + DeprecationStatus.fromPb(DISK_TYPE_STATUS.toPb(), DiskTypeId.FROM_URL_FUNCTION); + compareDeprecationStatus(DISK_TYPE_STATUS, diskStatus); + DeprecationStatus machineStatus = + DeprecationStatus.fromPb(MACHINE_TYPE_STATUS.toPb(), MachineTypeId.FROM_URL_FUNCTION); + compareDeprecationStatus(MACHINE_TYPE_STATUS, machineStatus); + diskStatus = DeprecationStatus.newBuilder(STATUS, DISK_TYPE_ID) + .setDeprecated(DEPRECATED) + .build(); + assertEquals(diskStatus, + DeprecationStatus.fromPb(diskStatus.toPb(), DiskTypeId.FROM_URL_FUNCTION)); + machineStatus = + DeprecationStatus.newBuilder(STATUS, MACHINE_TYPE_ID).setDeprecated(DEPRECATED).build(); + assertEquals(machineStatus, + DeprecationStatus.fromPb(machineStatus.toPb(), MachineTypeId.FROM_URL_FUNCTION)); + diskStatus = DeprecationStatus.of(STATUS, DISK_TYPE_ID); + assertEquals(diskStatus, + DeprecationStatus.fromPb(diskStatus.toPb(), DiskTypeId.FROM_URL_FUNCTION)); + } + + private void compareDeprecationStatus(DeprecationStatus expected, DeprecationStatus value) { + assertEquals(expected, value); + assertEquals(expected.getDeleted(), value.getDeleted()); + assertEquals(expected.getDeprecated(), value.getDeprecated()); + assertEquals(expected.getObsolete(), value.getObsolete()); + assertEquals(expected.getDeletedMillis(), value.getDeletedMillis()); + assertEquals(expected.getDeprecatedMillis(), value.getDeprecatedMillis()); + assertEquals(expected.getObsoleteMillis(), value.getObsoleteMillis()); + assertEquals(expected.getReplacement(), value.getReplacement()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java new file mode 100644 index 000000000000..65a121e38c3f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskIdTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class DiskIdTest { + + private static final String PROJECT = "project"; + private static final String ZONE = "zone"; + private static final String NAME = "disk"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + DiskId diskId = DiskId.of(PROJECT, ZONE, NAME); + assertEquals(PROJECT, diskId.getProject()); + assertEquals(ZONE, diskId.getZone()); + assertEquals(NAME, diskId.getDisk()); + assertEquals(URL, diskId.getSelfLink()); + diskId = DiskId.of(ZONE, NAME); + assertNull(diskId.getProject()); + assertEquals(ZONE, diskId.getZone()); + assertEquals(NAME, diskId.getDisk()); + diskId = DiskId.of(ZoneId.of(ZONE), NAME); + assertNull(diskId.getProject()); + assertEquals(ZONE, diskId.getZone()); + assertEquals(NAME, diskId.getDisk()); + } + + @Test + public void testToAndFromUrl() { + DiskId diskId = DiskId.of(PROJECT, ZONE, NAME); + compareDiskId(diskId, DiskId.fromUrl(diskId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid disk URL"); + DiskId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + DiskId diskId = DiskId.of(PROJECT, ZONE, NAME); + assertSame(diskId, diskId.setProjectId(PROJECT)); + compareDiskId(diskId, DiskId.of(ZONE, NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(DiskId.matchesUrl(DiskId.of(PROJECT, ZONE, NAME).getSelfLink())); + assertFalse(DiskId.matchesUrl("notMatchingUrl")); + } + + private void compareDiskId(DiskId expected, DiskId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getZone(), expected.getZone()); + assertEquals(expected.getDisk(), expected.getDisk()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java new file mode 100644 index 000000000000..e3724b7eee81 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskImageConfigurationTest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class DiskImageConfigurationTest { + + private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); + private static final String SOURCE_DISK_ID = "diskId"; + private static final Long ARCHIVE_SIZE_BYTES = 42L; + private static final ImageConfiguration.SourceType SOURCE_TYPE = + ImageConfiguration.SourceType.RAW; + private static final DiskImageConfiguration CONFIGURATION = + DiskImageConfiguration.newBuilder(SOURCE_DISK) + .setSourceDiskId(SOURCE_DISK_ID) + .setSourceType(SOURCE_TYPE) + .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) + .build(); + + @Test + public void testToBuilder() { + compareDiskImageConfiguration(CONFIGURATION, CONFIGURATION.toBuilder().build()); + DiskId newDisk = DiskId.of("newProject", "newZone", "newDisk"); + String newDiskId = "newDiskId"; + DiskImageConfiguration configuration = CONFIGURATION.toBuilder() + .setSourceDisk(newDisk) + .setSourceDiskId(newDiskId) + .build(); + assertEquals(newDisk, configuration.getSourceDisk()); + assertEquals(newDiskId, configuration.getSourceDiskId()); + configuration = configuration.toBuilder() + .setSourceDiskId(SOURCE_DISK_ID) + .setSourceDisk(SOURCE_DISK) + .build(); + compareDiskImageConfiguration(CONFIGURATION, configuration); + } + + @Test + public void testToBuilderIncomplete() { + DiskImageConfiguration configuration = DiskImageConfiguration.of(SOURCE_DISK); + compareDiskImageConfiguration(configuration, configuration.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(SOURCE_TYPE, CONFIGURATION.getSourceType()); + assertEquals(SOURCE_DISK, CONFIGURATION.getSourceDisk()); + assertEquals(SOURCE_DISK_ID, CONFIGURATION.getSourceDiskId()); + assertEquals(ARCHIVE_SIZE_BYTES, CONFIGURATION.getArchiveSizeBytes()); + assertEquals(ImageConfiguration.Type.DISK, CONFIGURATION.getType()); + } + + @Test + public void testToAndFromPb() { + assertTrue(ImageConfiguration.fromPb(CONFIGURATION.toPb()) instanceof DiskImageConfiguration); + compareDiskImageConfiguration(CONFIGURATION, + ImageConfiguration.fromPb(CONFIGURATION.toPb())); + DiskImageConfiguration configuration = DiskImageConfiguration.of(SOURCE_DISK); + compareDiskImageConfiguration(configuration, + DiskImageConfiguration.fromPb(configuration.toPb())); + } + + @Test + public void testOf() { + DiskImageConfiguration configuration = DiskImageConfiguration.of(SOURCE_DISK); + assertEquals(ImageConfiguration.Type.DISK, configuration.getType()); + assertNull(configuration.getSourceDiskId()); + assertNull(configuration.getSourceType()); + assertNull(configuration.getArchiveSizeBytes()); + assertEquals(SOURCE_DISK, configuration.getSourceDisk()); + } + + @Test + public void testSetProjectId() { + DiskImageConfiguration configuration = CONFIGURATION.toBuilder() + .setSourceDisk(DiskId.of("zone", "disk")) + .build(); + compareDiskImageConfiguration(CONFIGURATION, configuration.setProjectId("project")); + } + + private void compareDiskImageConfiguration(DiskImageConfiguration expected, + DiskImageConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.getArchiveSizeBytes(), value.getArchiveSizeBytes()); + assertEquals(expected.getSourceDisk(), value.getSourceDisk()); + assertEquals(expected.getSourceDiskId(), value.getSourceDiskId()); + assertEquals(expected.getSourceType(), value.getSourceType()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java new file mode 100644 index 000000000000..2ef2b6c2ba64 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskInfoTest.java @@ -0,0 +1,267 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.api.services.compute.model.Disk; +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class DiskInfoTest { + + private static final String GENERATED_ID = "42"; + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final DiskInfo.CreationStatus CREATION_STATUS = DiskInfo.CreationStatus.READY; + private static final String DESCRIPTION = "description"; + private static final Long SIZE_GB = 500L; + private static final DiskTypeId TYPE = DiskTypeId.of("project", "zone", "disk"); + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final List ATTACHED_INSTANCES = ImmutableList.of( + InstanceId.of("project", "zone", "instance1"), + InstanceId.of("project", "zone", "instance2")); + private static final SnapshotId SNAPSHOT = SnapshotId.of("project", "snapshot"); + private static final ImageId IMAGE = ImageId.of("project", "image"); + private static final String SNAPSHOT_ID = "snapshotId"; + private static final String IMAGE_ID = "snapshotId"; + private static final Long LAST_ATTACH_TIMESTAMP = 1453293600000L; + private static final Long LAST_DETACH_TIMESTAMP = 1453293660000L; + private static final StandardDiskConfiguration DISK_CONFIGURATION = + StandardDiskConfiguration.newBuilder() + .setSizeGb(SIZE_GB) + .setDiskType(TYPE) + .build(); + private static final SnapshotDiskConfiguration SNAPSHOT_DISK_CONFIGURATION = + SnapshotDiskConfiguration.newBuilder(SNAPSHOT) + .setSizeGb(SIZE_GB) + .setDiskType(TYPE) + .setSourceSnapshotId(SNAPSHOT_ID) + .build(); + private static final ImageDiskConfiguration IMAGE_DISK_CONFIGURATION = + ImageDiskConfiguration.newBuilder(IMAGE) + .setSizeGb(SIZE_GB) + .setDiskType(TYPE) + .setSourceImageId(IMAGE_ID) + .build(); + private static final DiskInfo DISK_INFO = DiskInfo.newBuilder(DISK_ID, DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) + .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) + .build(); + private static final DiskInfo SNAPSHOT_DISK_INFO = + DiskInfo.newBuilder(DISK_ID, SNAPSHOT_DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) + .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) + .build(); + private static final DiskInfo IMAGE_DISK_INFO = + DiskInfo.newBuilder(DISK_ID, IMAGE_DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) + .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) + .build(); + + @Test + public void testToBuilder() { + compareDiskInfo(DISK_INFO, DISK_INFO.toBuilder().build()); + compareDiskInfo(IMAGE_DISK_INFO, IMAGE_DISK_INFO.toBuilder().build()); + compareDiskInfo(SNAPSHOT_DISK_INFO, SNAPSHOT_DISK_INFO.toBuilder().build()); + DiskInfo diskInfo = DISK_INFO.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", diskInfo.getDescription()); + diskInfo = diskInfo.toBuilder().setDescription("description").build(); + compareDiskInfo(DISK_INFO, diskInfo); + } + + @Test + public void testToBuilderIncomplete() { + DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); + assertEquals(diskInfo, diskInfo.toBuilder().build()); + diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); + assertEquals(diskInfo, diskInfo.toBuilder().build()); + diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); + assertEquals(diskInfo, diskInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, DISK_INFO.getGeneratedId()); + assertEquals(DISK_ID, DISK_INFO.getDiskId()); + assertEquals(DISK_CONFIGURATION, DISK_INFO.getConfiguration()); + assertEquals(CREATION_TIMESTAMP, DISK_INFO.getCreationTimestamp()); + assertEquals(CREATION_STATUS, DISK_INFO.getCreationStatus()); + assertEquals(DESCRIPTION, DISK_INFO.getDescription()); + assertEquals(LICENSES, DISK_INFO.getLicenses()); + assertEquals(ATTACHED_INSTANCES, DISK_INFO.getAttachedInstances()); + assertEquals(LAST_ATTACH_TIMESTAMP, DISK_INFO.getLastAttachTimestamp()); + assertEquals(LAST_DETACH_TIMESTAMP, DISK_INFO.getLastDetachTimestamp()); + assertEquals(GENERATED_ID, IMAGE_DISK_INFO.getGeneratedId()); + assertEquals(DISK_ID, IMAGE_DISK_INFO.getDiskId()); + assertEquals(IMAGE_DISK_CONFIGURATION, IMAGE_DISK_INFO.getConfiguration()); + assertEquals(CREATION_TIMESTAMP, IMAGE_DISK_INFO.getCreationTimestamp()); + assertEquals(CREATION_STATUS, IMAGE_DISK_INFO.getCreationStatus()); + assertEquals(DESCRIPTION, IMAGE_DISK_INFO.getDescription()); + assertEquals(LICENSES, IMAGE_DISK_INFO.getLicenses()); + assertEquals(ATTACHED_INSTANCES, IMAGE_DISK_INFO.getAttachedInstances()); + assertEquals(LAST_ATTACH_TIMESTAMP, IMAGE_DISK_INFO.getLastAttachTimestamp()); + assertEquals(LAST_DETACH_TIMESTAMP, IMAGE_DISK_INFO.getLastDetachTimestamp()); + assertEquals(GENERATED_ID, SNAPSHOT_DISK_INFO.getGeneratedId()); + assertEquals(DISK_ID, SNAPSHOT_DISK_INFO.getDiskId()); + assertEquals(SNAPSHOT_DISK_CONFIGURATION, SNAPSHOT_DISK_INFO.getConfiguration()); + assertEquals(CREATION_TIMESTAMP, SNAPSHOT_DISK_INFO.getCreationTimestamp()); + assertEquals(CREATION_STATUS, SNAPSHOT_DISK_INFO.getCreationStatus()); + assertEquals(DESCRIPTION, SNAPSHOT_DISK_INFO.getDescription()); + assertEquals(LICENSES, SNAPSHOT_DISK_INFO.getLicenses()); + assertEquals(ATTACHED_INSTANCES, SNAPSHOT_DISK_INFO.getAttachedInstances()); + assertEquals(LAST_ATTACH_TIMESTAMP, SNAPSHOT_DISK_INFO.getLastAttachTimestamp()); + assertEquals(LAST_DETACH_TIMESTAMP, SNAPSHOT_DISK_INFO.getLastDetachTimestamp()); + } + + @Test + public void testOf() { + DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); + assertNull(diskInfo.getGeneratedId()); + assertEquals(DISK_ID, diskInfo.getDiskId()); + assertEquals(DISK_CONFIGURATION, diskInfo.getConfiguration()); + assertNull(diskInfo.getCreationTimestamp()); + assertNull(diskInfo.getCreationStatus()); + assertNull(diskInfo.getDescription()); + assertNull(diskInfo.getLicenses()); + assertNull(diskInfo.getAttachedInstances()); + assertNull(diskInfo.getLastAttachTimestamp()); + assertNull(diskInfo.getLastDetachTimestamp()); + diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); + assertNull(diskInfo.getGeneratedId()); + assertEquals(DISK_ID, diskInfo.getDiskId()); + assertEquals(IMAGE_DISK_CONFIGURATION, diskInfo.getConfiguration()); + assertNull(diskInfo.getCreationTimestamp()); + assertNull(diskInfo.getCreationStatus()); + assertNull(diskInfo.getDescription()); + assertNull(diskInfo.getLicenses()); + assertNull(diskInfo.getAttachedInstances()); + assertNull(diskInfo.getLastAttachTimestamp()); + assertNull(diskInfo.getLastDetachTimestamp()); + diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); + assertNull(diskInfo.getGeneratedId()); + assertEquals(DISK_ID, diskInfo.getDiskId()); + assertEquals(SNAPSHOT_DISK_CONFIGURATION, diskInfo.getConfiguration()); + assertNull(diskInfo.getCreationTimestamp()); + assertNull(diskInfo.getCreationStatus()); + assertNull(diskInfo.getDescription()); + assertNull(diskInfo.getLicenses()); + assertNull(diskInfo.getAttachedInstances()); + assertNull(diskInfo.getLastAttachTimestamp()); + assertNull(diskInfo.getLastDetachTimestamp()); + } + + @Test + public void testToAndFromPb() { + DiskInfo diskInfo = DiskInfo.fromPb(DISK_INFO.toPb()); + compareDiskInfo(DISK_INFO, diskInfo); + diskInfo = DiskInfo.fromPb(SNAPSHOT_DISK_INFO.toPb()); + compareDiskInfo(SNAPSHOT_DISK_INFO, diskInfo); + diskInfo = DiskInfo.fromPb(IMAGE_DISK_INFO.toPb()); + compareDiskInfo(IMAGE_DISK_INFO, diskInfo); + Disk disk = new Disk() + .setSelfLink(DISK_ID.getSelfLink()) + .setType(TYPE.getSelfLink()) + .setSizeGb(SIZE_GB); + diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); + compareDiskInfo(diskInfo, DiskInfo.fromPb(disk)); + disk = new Disk() + .setType(TYPE.getSelfLink()) + .setSizeGb(SIZE_GB) + .setSelfLink(DISK_ID.getSelfLink()) + .setSourceSnapshotId(SNAPSHOT_ID) + .setSourceSnapshot(SNAPSHOT.getSelfLink()); + diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); + compareDiskInfo(diskInfo, DiskInfo.fromPb(disk)); + disk = new Disk() + .setType(TYPE.getSelfLink()) + .setSizeGb(SIZE_GB) + .setSelfLink(DISK_ID.getSelfLink()) + .setSourceImageId(IMAGE_ID) + .setSourceImage(IMAGE.getSelfLink()); + diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); + compareDiskInfo(diskInfo, DiskInfo.fromPb(disk)); + } + + @Test + public void testSetProjectId() { + StandardDiskConfiguration standardDiskConfiguration = DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of(TYPE.getZone(), TYPE.getType())) + .build(); + DiskInfo diskInfo = DISK_INFO.toBuilder() + .setDiskId(DiskId.of(DISK_ID.getZone(), DISK_ID.getDisk())) + .setConfiguration(standardDiskConfiguration) + .build(); + compareDiskInfo(DISK_INFO, diskInfo.setProjectId("project")); + SnapshotDiskConfiguration snapshotDiskConfiguration = SNAPSHOT_DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of(TYPE.getZone(), TYPE.getType())) + .setSourceSnapshot(SnapshotId.of(SNAPSHOT.getSnapshot())) + .build(); + diskInfo = SNAPSHOT_DISK_INFO.toBuilder() + .setDiskId(DiskId.of(DISK_ID.getZone(), DISK_ID.getDisk())) + .setConfiguration(snapshotDiskConfiguration) + .build(); + compareDiskInfo(SNAPSHOT_DISK_INFO, diskInfo.setProjectId("project")); + ImageDiskConfiguration imageDiskConfiguration = IMAGE_DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of(TYPE.getZone(), TYPE.getType())) + .setSourceImage(ImageId.of(IMAGE.getImage())) + .build(); + diskInfo = IMAGE_DISK_INFO.toBuilder() + .setDiskId(DiskId.of(DISK_ID.getZone(), DISK_ID.getDisk())) + .setConfiguration(imageDiskConfiguration) + .build(); + compareDiskInfo(IMAGE_DISK_INFO, diskInfo.setProjectId("project")); + } + + public void compareDiskInfo(DiskInfo expected, DiskInfo value) { + assertEquals(expected, value); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getDiskId(), value.getDiskId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getCreationStatus(), value.getCreationStatus()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.getAttachedInstances(), value.getAttachedInstances()); + assertEquals(expected.getLastAttachTimestamp(), value.getLastAttachTimestamp()); + assertEquals(expected.getLastDetachTimestamp(), value.getLastDetachTimestamp()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java new file mode 100644 index 000000000000..3e7765c4c9b7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTest.java @@ -0,0 +1,475 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class DiskTest { + + private static final String GENERATED_ID = "42"; + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final DiskInfo.CreationStatus CREATION_STATUS = DiskInfo.CreationStatus.READY; + private static final String DESCRIPTION = "description"; + private static final Long SIZE_GB = 500L; + private static final DiskTypeId TYPE = DiskTypeId.of("project", "zone", "disk"); + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final List ATTACHED_INSTANCES = ImmutableList.of( + InstanceId.of("project", "zone", "instance1"), + InstanceId.of("project", "zone", "instance2")); + private static final SnapshotId SNAPSHOT = SnapshotId.of("project", "snapshot"); + private static final ImageId IMAGE = ImageId.of("project", "image"); + private static final String SNAPSHOT_ID = "snapshotId"; + private static final String IMAGE_ID = "imageId"; + private static final Long LAST_ATTACH_TIMESTAMP = 1453293600000L; + private static final Long LAST_DETACH_TIMESTAMP = 1453293660000L; + private static final StandardDiskConfiguration DISK_CONFIGURATION = + StandardDiskConfiguration.newBuilder() + .setSizeGb(SIZE_GB) + .setDiskType(TYPE) + .build(); + private static final SnapshotDiskConfiguration SNAPSHOT_DISK_CONFIGURATION = + SnapshotDiskConfiguration.newBuilder(SNAPSHOT) + .setSizeGb(SIZE_GB) + .setDiskType(TYPE) + .setSourceSnapshotId(SNAPSHOT_ID) + .build(); + private static final ImageDiskConfiguration IMAGE_DISK_CONFIGURATION = + ImageDiskConfiguration.newBuilder(IMAGE) + .setSizeGb(SIZE_GB) + .setDiskType(TYPE) + .setSourceImageId(IMAGE_ID) + .build(); + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Disk disk; + private Disk standardDisk; + private Disk snapshotDisk; + private Disk imageDisk; + + private void initializeExpectedDisk(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + standardDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) + .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) + .build(); + snapshotDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, SNAPSHOT_DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) + .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) + .build(); + imageDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, IMAGE_DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .setLastAttachTimestamp(LAST_ATTACH_TIMESTAMP) + .setLastDetachTimestamp(LAST_DETACH_TIMESTAMP) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeDisk() { + disk = new Disk.Builder(compute, DISK_ID, DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setCreationStatus(CREATION_STATUS) + .setDescription(DESCRIPTION) + .setLicenses(LICENSES) + .setAttachedInstances(ATTACHED_INSTANCES) + .build(); + } + + @Test + public void testToBuilder() { + initializeExpectedDisk(16); + compareDisk(standardDisk, standardDisk.toBuilder().build()); + compareDisk(imageDisk, imageDisk.toBuilder().build()); + compareDisk(snapshotDisk, snapshotDisk.toBuilder().build()); + Disk newDisk = standardDisk.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newDisk.getDescription()); + newDisk = newDisk.toBuilder().setDescription("description").build(); + compareDisk(standardDisk, newDisk); + } + + @Test + public void testToBuilderIncomplete() { + initializeExpectedDisk(18); + DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); + Disk disk = new Disk(serviceMockReturnsOptions, new DiskInfo.BuilderImpl(diskInfo)); + compareDisk(disk, disk.toBuilder().build()); + diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); + disk = new Disk(serviceMockReturnsOptions, new DiskInfo.BuilderImpl(diskInfo)); + compareDisk(disk, disk.toBuilder().build()); + diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); + disk = new Disk(serviceMockReturnsOptions, new DiskInfo.BuilderImpl(diskInfo)); + compareDisk(disk, disk.toBuilder().build()); + } + + @Test + public void testBuilder() { + initializeExpectedDisk(4); + assertEquals(DISK_ID, standardDisk.getDiskId()); + assertEquals(GENERATED_ID, standardDisk.getGeneratedId()); + assertEquals(DISK_CONFIGURATION, standardDisk.getConfiguration()); + assertEquals(CREATION_TIMESTAMP, standardDisk.getCreationTimestamp()); + assertEquals(CREATION_STATUS, standardDisk.getCreationStatus()); + assertEquals(DESCRIPTION, standardDisk.getDescription()); + assertEquals(LICENSES, standardDisk.getLicenses()); + assertEquals(ATTACHED_INSTANCES, standardDisk.getAttachedInstances()); + assertEquals(LAST_ATTACH_TIMESTAMP, standardDisk.getLastAttachTimestamp()); + assertEquals(LAST_DETACH_TIMESTAMP, standardDisk.getLastDetachTimestamp()); + assertSame(serviceMockReturnsOptions, standardDisk.getCompute()); + assertEquals(DISK_ID, imageDisk.getDiskId()); + assertEquals(GENERATED_ID, imageDisk.getGeneratedId()); + assertEquals(IMAGE_DISK_CONFIGURATION, imageDisk.getConfiguration()); + assertEquals(CREATION_TIMESTAMP, imageDisk.getCreationTimestamp()); + assertEquals(CREATION_STATUS, imageDisk.getCreationStatus()); + assertEquals(DESCRIPTION, imageDisk.getDescription()); + assertEquals(LICENSES, imageDisk.getLicenses()); + assertEquals(ATTACHED_INSTANCES, imageDisk.getAttachedInstances()); + assertEquals(LAST_ATTACH_TIMESTAMP, imageDisk.getLastAttachTimestamp()); + assertEquals(LAST_DETACH_TIMESTAMP, imageDisk.getLastDetachTimestamp()); + assertSame(serviceMockReturnsOptions, imageDisk.getCompute()); + assertEquals(DISK_ID, snapshotDisk.getDiskId()); + assertEquals(GENERATED_ID, snapshotDisk.getGeneratedId()); + assertEquals(SNAPSHOT_DISK_CONFIGURATION, snapshotDisk.getConfiguration()); + assertEquals(CREATION_TIMESTAMP, snapshotDisk.getCreationTimestamp()); + assertEquals(CREATION_STATUS, snapshotDisk.getCreationStatus()); + assertEquals(DESCRIPTION, snapshotDisk.getDescription()); + assertEquals(LICENSES, snapshotDisk.getLicenses()); + assertEquals(ATTACHED_INSTANCES, snapshotDisk.getAttachedInstances()); + assertEquals(LAST_ATTACH_TIMESTAMP, snapshotDisk.getLastAttachTimestamp()); + assertEquals(LAST_DETACH_TIMESTAMP, snapshotDisk.getLastDetachTimestamp()); + assertSame(serviceMockReturnsOptions, snapshotDisk.getCompute()); + Disk disk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION) + .setDiskId(DiskId.of("newProject", "newZone")) + .setConfiguration(SNAPSHOT_DISK_CONFIGURATION) + .build(); + assertEquals(DiskId.of("newProject", "newZone"), disk.getDiskId()); + assertNull(disk.getGeneratedId()); + assertEquals(SNAPSHOT_DISK_CONFIGURATION, disk.getConfiguration()); + assertNull(disk.getCreationTimestamp()); + assertNull(disk.getCreationStatus()); + assertNull(disk.getDescription()); + assertNull(disk.getLicenses()); + assertNull(disk.getAttachedInstances()); + assertNull(disk.getLastAttachTimestamp()); + assertNull(disk.getLastDetachTimestamp()); + assertSame(serviceMockReturnsOptions, disk.getCompute()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedDisk(24); + compareDisk(standardDisk, Disk.fromPb(serviceMockReturnsOptions, standardDisk.toPb())); + compareDisk(imageDisk, Disk.fromPb(serviceMockReturnsOptions, imageDisk.toPb())); + compareDisk(snapshotDisk, Disk.fromPb(serviceMockReturnsOptions, snapshotDisk.toPb())); + Disk disk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION).build(); + compareDisk(disk, Disk.fromPb(serviceMockReturnsOptions, disk.toPb())); + disk = + new Disk.Builder(serviceMockReturnsOptions, DISK_ID, SNAPSHOT_DISK_CONFIGURATION).build(); + compareDisk(disk, Disk.fromPb(serviceMockReturnsOptions, disk.toPb())); + disk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, IMAGE_DISK_CONFIGURATION).build(); + compareDisk(disk, Disk.fromPb(serviceMockReturnsOptions, disk.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "zone", "op")) + .build(); + expect(compute.deleteDisk(DISK_ID)).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedDisk(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteDisk(DISK_ID)).andReturn(null); + replay(compute); + initializeDisk(); + assertNull(disk.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedDisk(3); + Compute.DiskOption[] expectedOptions = {Compute.DiskOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getDisk(DISK_ID, expectedOptions)).andReturn(imageDisk); + replay(compute); + initializeDisk(); + assertTrue(disk.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedDisk(3); + Compute.DiskOption[] expectedOptions = {Compute.DiskOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getDisk(DISK_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeDisk(); + assertFalse(disk.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedDisk(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getDisk(DISK_ID)).andReturn(imageDisk); + replay(compute); + initializeDisk(); + Disk updatedDisk = disk.reload(); + compareDisk(imageDisk, updatedDisk); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedDisk(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getDisk(DISK_ID)).andReturn(null); + replay(compute); + initializeDisk(); + assertNull(disk.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedDisk(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getDisk(DISK_ID, Compute.DiskOption.fields())).andReturn(imageDisk); + replay(compute); + initializeDisk(); + Disk updatedDisk = disk.reload(Compute.DiskOption.fields()); + compareDisk(imageDisk, updatedDisk); + verify(compute); + } + + @Test + public void testCreateSnapshot() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "zone", "op")) + .build(); + SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); + SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID).build(); + expect(compute.create(snapshot)).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.createSnapshot(SNAPSHOT.getSnapshot())); + } + + @Test + public void testCreateSnapshotWithDescription() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "zone", "op")) + .build(); + SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); + SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID) + .setDescription("description") + .build(); + expect(compute.create(snapshot)).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.createSnapshot(SNAPSHOT.getSnapshot(), "description")); + } + + @Test + public void testCreateSnapshotWithOptions() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "zone", "op")) + .build(); + SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); + SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID).build(); + expect(compute.create(snapshot, Compute.OperationOption.fields())).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, + disk.createSnapshot(SNAPSHOT.getSnapshot(), Compute.OperationOption.fields())); + } + + @Test + public void testCreateSnapshotWithDescriptionAndOptions() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "zone", "op")) + .build(); + SnapshotId snapshotId = SnapshotId.of(SNAPSHOT.getSnapshot()); + SnapshotInfo snapshot = SnapshotInfo.newBuilder(snapshotId, DISK_ID) + .setDescription("description") + .build(); + expect(compute.create(snapshot, Compute.OperationOption.fields())).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, + disk.createSnapshot(SNAPSHOT.getSnapshot(), "description", + Compute.OperationOption.fields())); + } + + @Test + public void testCreateImage() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + ImageId imageId = ImageId.of(IMAGE.getImage()); + ImageInfo image = ImageInfo.of(imageId, DiskImageConfiguration.of(DISK_ID)); + expect(compute.create(image)).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.createImage(IMAGE.getImage())); + } + + @Test + public void testCreateImageWithDescription() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + ImageId imageId = ImageId.of(IMAGE.getImage()); + ImageInfo image = ImageInfo.newBuilder(imageId, DiskImageConfiguration.of(DISK_ID)) + .setDescription("description") + .build(); + expect(compute.create(image)).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.createImage(IMAGE.getImage(), "description")); + } + + @Test + public void testCreateImageWithOptions() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + ImageId imageId = ImageId.of(IMAGE.getImage()); + ImageInfo image = ImageInfo.of(imageId, DiskImageConfiguration.of(DISK_ID)); + expect(compute.create(image, Compute.OperationOption.fields())).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.createImage(IMAGE.getImage(), Compute.OperationOption.fields())); + } + + @Test + public void testCreateImageWithDescriptionAndOptions() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + ImageId imageId = ImageId.of(IMAGE.getImage()); + ImageInfo image = ImageInfo.newBuilder(imageId, DiskImageConfiguration.of(DISK_ID)) + .setDescription("description") + .build(); + expect(compute.create(image, Compute.OperationOption.fields())).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, + disk.createImage(IMAGE.getImage(), "description", Compute.OperationOption.fields())); + } + + @Test + public void testResizeOperation() { + initializeExpectedDisk(4); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "zone", "op")) + .build(); + expect(compute.resize(DISK_ID, 42L)).andReturn(operation); + replay(compute); + initializeDisk(); + assertSame(operation, disk.resize(42L)); + } + + @Test + public void testResizeNull() { + initializeExpectedDisk(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.resize(DISK_ID, 42L)).andReturn(null); + replay(compute); + initializeDisk(); + assertNull(disk.resize(42L)); + } + + public void compareDisk(Disk expected, Disk value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getDiskId(), value.getDiskId()); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getCreationStatus(), value.getCreationStatus()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.getAttachedInstances(), value.getAttachedInstances()); + assertEquals(expected.getLastAttachTimestamp(), value.getLastAttachTimestamp()); + assertEquals(expected.getLastDetachTimestamp(), value.getLastDetachTimestamp()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java new file mode 100644 index 000000000000..b6bf0d7da253 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeIdTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class DiskTypeIdTest { + + private static final String PROJECT = "project"; + private static final String ZONE = "zone"; + private static final String DISK_TYPE = "diskType"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + DiskTypeId diskTypeId = DiskTypeId.of(PROJECT, ZONE, DISK_TYPE); + assertEquals(PROJECT, diskTypeId.getProject()); + assertEquals(ZONE, diskTypeId.getZone()); + assertEquals(DISK_TYPE, diskTypeId.getType()); + assertEquals(URL, diskTypeId.getSelfLink()); + diskTypeId = DiskTypeId.of(ZONE, DISK_TYPE); + assertNull(diskTypeId.getProject()); + assertEquals(ZONE, diskTypeId.getZone()); + assertEquals(DISK_TYPE, diskTypeId.getType()); + } + + @Test + public void testToAndFromUrl() { + DiskTypeId diskTypeId = DiskTypeId.of(PROJECT, ZONE, DISK_TYPE); + assertSame(diskTypeId, diskTypeId.setProjectId(PROJECT)); + compareDiskTypeId(diskTypeId, DiskTypeId.fromUrl(diskTypeId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid disk type URL"); + DiskTypeId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + DiskTypeId diskTypeId = DiskTypeId.of(PROJECT, ZONE, DISK_TYPE); + assertSame(diskTypeId, diskTypeId.setProjectId(PROJECT)); + compareDiskTypeId(diskTypeId, DiskTypeId.of(ZONE, DISK_TYPE).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(DiskTypeId.matchesUrl(DiskTypeId.of(PROJECT, ZONE, DISK_TYPE).getSelfLink())); + assertFalse(DiskTypeId.matchesUrl("notMatchingUrl")); + } + + private void compareDiskTypeId(DiskTypeId expected, DiskTypeId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getZone(), expected.getZone()); + assertEquals(expected.getType(), expected.getType()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java new file mode 100644 index 000000000000..47ebb3447fa8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/DiskTypeTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class DiskTypeTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final String VALID_DISK_SIZE = "10GB-10TB"; + private static final Long DEFAULT_DISK_SIZE_GB = 10L; + private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, DISK_TYPE_ID); + private static final DiskType DISK_TYPE = DiskType.newBuilder() + .setGeneratedId(GENERATED_ID) + .setDiskTypeId(DISK_TYPE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setValidDiskSize(VALID_DISK_SIZE) + .setDefaultDiskSizeGb(DEFAULT_DISK_SIZE_GB) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, DISK_TYPE.getGeneratedId()); + assertEquals(DISK_TYPE_ID, DISK_TYPE.getDiskTypeId()); + assertEquals(CREATION_TIMESTAMP, DISK_TYPE.getCreationTimestamp()); + assertEquals(DESCRIPTION, DISK_TYPE.getDescription()); + assertEquals(VALID_DISK_SIZE, DISK_TYPE.getValidDiskSize()); + assertEquals(DEFAULT_DISK_SIZE_GB, DISK_TYPE.getDefaultDiskSizeGb()); + assertEquals(DEPRECATION_STATUS, DISK_TYPE.getDeprecationStatus()); + } + + @Test + public void testToPbAndFromPb() { + compareDiskTypes(DISK_TYPE, DiskType.fromPb(DISK_TYPE.toPb())); + DiskType diskType = DiskType.newBuilder().setDiskTypeId(DISK_TYPE_ID).build(); + compareDiskTypes(diskType, DiskType.fromPb(diskType.toPb())); + } + + private void compareDiskTypes(DiskType expected, DiskType value) { + assertEquals(expected, value); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getDiskTypeId(), value.getDiskTypeId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getValidDiskSize(), value.getValidDiskSize()); + assertEquals(expected.getDefaultDiskSizeGb(), value.getDefaultDiskSizeGb()); + assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java new file mode 100644 index 000000000000..560a766d3c65 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ForwardingRuleIdTest.java @@ -0,0 +1,139 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class ForwardingRuleIdTest { + + private static final String PROJECT = "project"; + private static final String REGION = "region"; + private static final String NAME = "rule"; + private static final String GLOBAL_URL = + "https://www.googleapis.com/compute/v1/projects/project/global/forwardingRules/rule"; + private static final String REGION_URL = "https://www.googleapis.com/compute/v1/projects/" + + "project/regions/region/forwardingRules/rule"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + GlobalForwardingRuleId forwardingRuleId = GlobalForwardingRuleId.of(PROJECT, NAME); + assertEquals(PROJECT, forwardingRuleId.getProject()); + assertEquals(NAME, forwardingRuleId.getRule()); + assertEquals(GLOBAL_URL, forwardingRuleId.getSelfLink()); + assertEquals(ForwardingRuleId.Type.GLOBAL, forwardingRuleId.getType()); + forwardingRuleId = GlobalForwardingRuleId.of(NAME); + assertNull(forwardingRuleId.getProject()); + assertEquals(NAME, forwardingRuleId.getRule()); + assertEquals(ForwardingRuleId.Type.GLOBAL, forwardingRuleId.getType()); + RegionForwardingRuleId regionForwardingRuleId = + RegionForwardingRuleId.of(PROJECT, REGION, NAME); + assertEquals(PROJECT, regionForwardingRuleId.getProject()); + assertEquals(REGION, regionForwardingRuleId.getRegion()); + assertEquals(NAME, regionForwardingRuleId.getRule()); + assertEquals(REGION_URL, regionForwardingRuleId.getSelfLink()); + assertEquals(ForwardingRuleId.Type.REGION, regionForwardingRuleId.getType()); + regionForwardingRuleId = RegionForwardingRuleId.of(RegionId.of(PROJECT, REGION), NAME); + assertEquals(PROJECT, regionForwardingRuleId.getProject()); + assertEquals(REGION, regionForwardingRuleId.getRegion()); + assertEquals(NAME, regionForwardingRuleId.getRule()); + assertEquals(REGION_URL, regionForwardingRuleId.getSelfLink()); + assertEquals(ForwardingRuleId.Type.REGION, regionForwardingRuleId.getType()); + regionForwardingRuleId = RegionForwardingRuleId.of(REGION, NAME); + assertNull(regionForwardingRuleId.getProject()); + assertEquals(REGION, regionForwardingRuleId.getRegion()); + assertEquals(NAME, regionForwardingRuleId.getRule()); + assertEquals(ForwardingRuleId.Type.REGION, regionForwardingRuleId.getType()); + } + + @Test + public void testToAndFromUrlGlobal() { + GlobalForwardingRuleId forwardingRuleId = GlobalForwardingRuleId.of(PROJECT, NAME); + compareGlobalForwardingRuleId(forwardingRuleId, + GlobalForwardingRuleId.fromUrl(forwardingRuleId.getSelfLink())); + RegionForwardingRuleId regionForwardingRuleId = + RegionForwardingRuleId.of(PROJECT, REGION, NAME); + compareRegionForwardingRuleId(regionForwardingRuleId, + RegionForwardingRuleId.fromUrl(regionForwardingRuleId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid global forwarding rule URL"); + GlobalForwardingRuleId.fromUrl("notMatchingUrl"); + } + + @Test + public void testToAndFromUrlRegion() { + RegionForwardingRuleId regionForwardingRuleId = + RegionForwardingRuleId.of(PROJECT, REGION, NAME); + compareRegionForwardingRuleId(regionForwardingRuleId, + RegionForwardingRuleId.fromUrl(regionForwardingRuleId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid region forwarding rule URL"); + RegionForwardingRuleId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + GlobalForwardingRuleId forwardingRuleId = GlobalForwardingRuleId.of(PROJECT, NAME); + assertSame(forwardingRuleId, forwardingRuleId.setProjectId(PROJECT)); + compareGlobalForwardingRuleId(forwardingRuleId, + GlobalForwardingRuleId.of(NAME).setProjectId(PROJECT)); + RegionForwardingRuleId regionForwardingRuleId = + RegionForwardingRuleId.of(PROJECT, REGION, NAME); + assertSame(regionForwardingRuleId, regionForwardingRuleId.setProjectId(PROJECT)); + compareRegionForwardingRuleId(regionForwardingRuleId, + RegionForwardingRuleId.of(REGION, NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(GlobalForwardingRuleId.matchesUrl( + GlobalForwardingRuleId.of(PROJECT, NAME).getSelfLink())); + assertFalse(GlobalForwardingRuleId.matchesUrl("notMatchingUrl")); + assertTrue(RegionForwardingRuleId.matchesUrl( + RegionForwardingRuleId.of(PROJECT, REGION, NAME).getSelfLink())); + assertFalse(RegionForwardingRuleId.matchesUrl("notMatchingUrl")); + } + + private void compareGlobalForwardingRuleId(GlobalForwardingRuleId expected, + GlobalForwardingRuleId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getRule(), expected.getRule()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } + + private void compareRegionForwardingRuleId(RegionForwardingRuleId expected, + RegionForwardingRuleId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getRegion(), expected.getRegion()); + assertEquals(expected.getRule(), expected.getRule()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java new file mode 100644 index 000000000000..e3b94dcefc1a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageDiskConfigurationTest.java @@ -0,0 +1,112 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.compute.deprecated.DiskConfiguration.Type; + +import org.junit.Test; + +public class ImageDiskConfigurationTest { + + private static final Long SIZE = 42L; + private static final DiskTypeId DISK_TYPE = DiskTypeId.of("project", "zone", "type"); + private static final ImageId IMAGE = ImageId.of("project", "image"); + private static final String IMAGE_ID = "imageId"; + private static final ImageDiskConfiguration DISK_CONFIGURATION = + ImageDiskConfiguration.newBuilder(IMAGE) + .setSizeGb(SIZE) + .setDiskType(DISK_TYPE) + .setSourceImageId(IMAGE_ID) + .build(); + + @Test + public void testToBuilder() { + compareImageDiskConfiguration(DISK_CONFIGURATION, DISK_CONFIGURATION.toBuilder().build()); + ImageId newImageId = ImageId.of("newProject", "newImage"); + ImageDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() + .setSizeGb(24L) + .setSourceImage(newImageId) + .setSourceImageId("newImageId") + .build(); + assertEquals(24L, diskConfiguration.getSizeGb().longValue()); + assertEquals(newImageId, diskConfiguration.getSourceImage()); + assertEquals("newImageId", diskConfiguration.getSourceImageId()); + diskConfiguration = diskConfiguration.toBuilder() + .setSizeGb(SIZE) + .setSourceImage(IMAGE) + .setSourceImageId(IMAGE_ID) + .build(); + compareImageDiskConfiguration(DISK_CONFIGURATION, diskConfiguration); + } + + @Test + public void testToBuilderIncomplete() { + ImageDiskConfiguration diskConfiguration = ImageDiskConfiguration.of(IMAGE); + compareImageDiskConfiguration(diskConfiguration, diskConfiguration.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(DISK_TYPE, DISK_CONFIGURATION.getDiskType()); + assertEquals(SIZE, DISK_CONFIGURATION.getSizeGb()); + assertEquals(IMAGE, DISK_CONFIGURATION.getSourceImage()); + assertEquals(IMAGE_ID, DISK_CONFIGURATION.getSourceImageId()); + assertEquals(Type.IMAGE, DISK_CONFIGURATION.getType()); + } + + @Test + public void testToAndFromPb() { + assertTrue(DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb()) + instanceof ImageDiskConfiguration); + compareImageDiskConfiguration(DISK_CONFIGURATION, + DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb())); + } + + @Test + public void testOf() { + ImageDiskConfiguration configuration = ImageDiskConfiguration.of(IMAGE); + assertNull(configuration.getDiskType()); + assertNull(configuration.getSizeGb()); + assertNull(configuration.getSourceImageId()); + assertEquals(IMAGE, configuration.getSourceImage()); + assertEquals(Type.IMAGE, configuration.getType()); + } + + @Test + public void testSetProjectId() { + ImageDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of(DISK_TYPE.getZone(), DISK_TYPE.getType())) + .setSourceImage(ImageId.of(IMAGE.getImage())) + .build(); + compareImageDiskConfiguration(DISK_CONFIGURATION, diskConfiguration.setProjectId("project")); + } + + private void compareImageDiskConfiguration(ImageDiskConfiguration expected, + ImageDiskConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getDiskType(), value.getDiskType()); + assertEquals(expected.getSizeGb(), value.getSizeGb()); + assertEquals(expected.getSourceImage(), value.getSourceImage()); + assertEquals(expected.getSourceImageId(), value.getSourceImageId()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java new file mode 100644 index 000000000000..40f7ce1f16ee --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageIdTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class ImageIdTest { + + private static final String PROJECT = "project"; + private static final String NAME = "image"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/global/images/image"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + ImageId imageId = ImageId.of(PROJECT, NAME); + assertEquals(PROJECT, imageId.getProject()); + assertEquals(NAME, imageId.getImage()); + assertEquals(URL, imageId.getSelfLink()); + imageId = ImageId.of(NAME); + assertNull(imageId.getProject()); + assertEquals(NAME, imageId.getImage()); + } + + @Test + public void testToAndFromUrl() { + ImageId imageId = ImageId.of(PROJECT, NAME); + compareImageId(imageId, ImageId.fromUrl(imageId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid image URL"); + ImageId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + ImageId imageId = ImageId.of(PROJECT, NAME); + assertSame(imageId, imageId.setProjectId(PROJECT)); + compareImageId(imageId, ImageId.of(NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(ImageId.matchesUrl(ImageId.of(PROJECT, NAME).getSelfLink())); + assertFalse(ImageId.matchesUrl("notMatchingUrl")); + } + + private void compareImageId(ImageId expected, ImageId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getImage(), expected.getImage()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java new file mode 100644 index 000000000000..fbb1b86d2e92 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageInfoTest.java @@ -0,0 +1,179 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.cloud.compute.deprecated.ImageConfiguration.SourceType; +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class ImageInfoTest { + + private static final ImageId IMAGE_ID = ImageId.of("project", "image"); + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final ImageInfo.Status STATUS = ImageInfo.Status.READY; + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final Long DISK_SIZE_GB = 42L; + private static final String STORAGE_SOURCE = "source"; + private static final Long ARCHIVE_SIZE_BYTES = 24L; + private static final String SHA1_CHECKSUM = "checksum"; + private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); + private static final String SOURCE_DISK_ID = "diskId"; + private static final SourceType SOURCE_TYPE = SourceType.RAW; + private static final StorageImageConfiguration STORAGE_CONFIGURATION = + StorageImageConfiguration.newBuilder(STORAGE_SOURCE) + .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) + .setContainerType(StorageImageConfiguration.ContainerType.TAR) + .setSha1(SHA1_CHECKSUM) + .setSourceType(SOURCE_TYPE) + .build(); + private static final DiskImageConfiguration DISK_CONFIGURATION = + DiskImageConfiguration.newBuilder(SOURCE_DISK) + .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) + .setSourceDiskId(SOURCE_DISK_ID) + .setSourceType(SOURCE_TYPE) + .build(); + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, IMAGE_ID); + private static final ImageInfo STORAGE_IMAGE = + ImageInfo.newBuilder(IMAGE_ID, STORAGE_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .getCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + private static final ImageInfo DISK_IMAGE = + ImageInfo.newBuilder(IMAGE_ID, DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .getCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + + @Test + public void testToBuilder() { + compareImageInfo(STORAGE_IMAGE, STORAGE_IMAGE.toBuilder().build()); + compareImageInfo(DISK_IMAGE, DISK_IMAGE.toBuilder().build()); + ImageInfo imageInfo = STORAGE_IMAGE.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", imageInfo.getDescription()); + imageInfo = imageInfo.toBuilder().setDescription("description").build(); + compareImageInfo(STORAGE_IMAGE, imageInfo); + } + + @Test + public void testToBuilderIncomplete() { + ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, STORAGE_CONFIGURATION); + assertEquals(imageInfo, imageInfo.toBuilder().build()); + imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); + assertEquals(imageInfo, imageInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, STORAGE_IMAGE.getGeneratedId()); + assertEquals(IMAGE_ID, STORAGE_IMAGE.getImageId()); + assertEquals(CREATION_TIMESTAMP, STORAGE_IMAGE.getCreationTimestamp()); + assertEquals(DESCRIPTION, STORAGE_IMAGE.getDescription()); + assertEquals(STORAGE_CONFIGURATION, STORAGE_IMAGE.getConfiguration()); + assertEquals(STATUS, STORAGE_IMAGE.getStatus()); + assertEquals(DISK_SIZE_GB, STORAGE_IMAGE.getDiskSizeGb()); + assertEquals(LICENSES, STORAGE_IMAGE.getLicenses()); + assertEquals(DEPRECATION_STATUS, STORAGE_IMAGE.getDeprecationStatus()); + assertEquals(GENERATED_ID, DISK_IMAGE.getGeneratedId()); + assertEquals(IMAGE_ID, DISK_IMAGE.getImageId()); + assertEquals(CREATION_TIMESTAMP, DISK_IMAGE.getCreationTimestamp()); + assertEquals(DESCRIPTION, DISK_IMAGE.getDescription()); + assertEquals(DISK_CONFIGURATION, DISK_IMAGE.getConfiguration()); + assertEquals(STATUS, DISK_IMAGE.getStatus()); + assertEquals(DISK_SIZE_GB, DISK_IMAGE.getDiskSizeGb()); + assertEquals(LICENSES, DISK_IMAGE.getLicenses()); + assertEquals(DEPRECATION_STATUS, DISK_IMAGE.getDeprecationStatus()); + } + + @Test + public void testOf() { + ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, STORAGE_CONFIGURATION); + assertEquals(IMAGE_ID, imageInfo.getImageId()); + assertEquals(STORAGE_CONFIGURATION, imageInfo.getConfiguration()); + assertNull(imageInfo.getGeneratedId()); + assertNull(imageInfo.getCreationTimestamp()); + assertNull(imageInfo.getDescription()); + assertNull(imageInfo.getStatus()); + assertNull(imageInfo.getDiskSizeGb()); + assertNull(imageInfo.getLicenses()); + assertNull(imageInfo.getDeprecationStatus()); + imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); + assertEquals(IMAGE_ID, imageInfo.getImageId()); + assertEquals(DISK_CONFIGURATION, imageInfo.getConfiguration()); + assertNull(imageInfo.getGeneratedId()); + assertNull(imageInfo.getCreationTimestamp()); + assertNull(imageInfo.getDescription()); + assertNull(imageInfo.getStatus()); + assertNull(imageInfo.getDiskSizeGb()); + assertNull(imageInfo.getLicenses()); + assertNull(imageInfo.getDeprecationStatus()); + } + + @Test + public void testToAndFromPb() { + compareImageInfo(STORAGE_IMAGE, ImageInfo.fromPb(STORAGE_IMAGE.toPb())); + compareImageInfo(DISK_IMAGE, ImageInfo.fromPb(DISK_IMAGE.toPb())); + ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, StorageImageConfiguration.of(STORAGE_SOURCE)); + compareImageInfo(imageInfo, ImageInfo.fromPb(imageInfo.toPb())); + imageInfo = ImageInfo.of(IMAGE_ID, DiskImageConfiguration.of(SOURCE_DISK)); + compareImageInfo(imageInfo, ImageInfo.fromPb(imageInfo.toPb())); + } + + @Test + public void testSetProjectId() { + ImageInfo imageInfo = DISK_IMAGE.toBuilder() + .setImageId(ImageId.of("image")) + .setConfiguration(DISK_CONFIGURATION.toBuilder() + .setSourceDisk(DiskId.of("zone", "disk")) + .build()) + .build(); + compareImageInfo(DISK_IMAGE, imageInfo.setProjectId("project")); + } + + public void compareImageInfo(ImageInfo expected, ImageInfo value) { + assertEquals(expected, value); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getImageId(), value.getImageId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java new file mode 100644 index 000000000000..84d84596e6d8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ImageTest.java @@ -0,0 +1,307 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class ImageTest { + + private static final ImageId IMAGE_ID = ImageId.of("project", "image"); + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final ImageInfo.Status STATUS = ImageInfo.Status.READY; + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final Long DISK_SIZE_GB = 42L; + private static final String STORAGE_SOURCE = "source"; + private static final Long ARCHIVE_SIZE_BYTES = 24L; + private static final String SHA1_CHECKSUM = "checksum"; + private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); + private static final String SOURCE_DISK_ID = "diskId"; + private static final ImageConfiguration.SourceType SOURCE_TYPE = + ImageConfiguration.SourceType.RAW; + private static final StorageImageConfiguration STORAGE_CONFIGURATION = + StorageImageConfiguration.newBuilder(STORAGE_SOURCE) + .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) + .setContainerType(StorageImageConfiguration.ContainerType.TAR) + .setSha1(SHA1_CHECKSUM) + .setSourceType(SOURCE_TYPE) + .build(); + private static final DiskImageConfiguration DISK_CONFIGURATION = + DiskImageConfiguration.newBuilder(SOURCE_DISK) + .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) + .setSourceDiskId(SOURCE_DISK_ID) + .setSourceType(SOURCE_TYPE) + .build(); + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, IMAGE_ID); + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Image image; + private Image diskImage; + private Image storageImage; + + private void initializeExpectedImage(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + diskImage = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .getCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + storageImage = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, STORAGE_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .getCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeImage() { + image = new Image.Builder(compute, IMAGE_ID, DISK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .getCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + } + + @Test + public void testToBuilder() { + initializeExpectedImage(12); + compareImage(diskImage, diskImage.toBuilder().build()); + compareImage(storageImage, storageImage.toBuilder().build()); + Image newImage = diskImage.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newImage.getDescription()); + newImage = newImage.toBuilder().setDescription("description").build(); + compareImage(diskImage, newImage); + } + + @Test + public void testToBuilderIncomplete() { + initializeExpectedImage(6); + ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); + Image image = + new Image(serviceMockReturnsOptions, new ImageInfo.BuilderImpl(imageInfo)); + compareImage(image, image.toBuilder().build()); + } + + @Test + public void testBuilder() { + initializeExpectedImage(3); + assertEquals(GENERATED_ID, diskImage.getGeneratedId()); + assertEquals(IMAGE_ID, diskImage.getImageId()); + assertEquals(CREATION_TIMESTAMP, diskImage.getCreationTimestamp()); + assertEquals(DESCRIPTION, diskImage.getDescription()); + assertEquals(DISK_CONFIGURATION, diskImage.getConfiguration()); + assertEquals(STATUS, diskImage.getStatus()); + assertEquals(DISK_SIZE_GB, diskImage.getDiskSizeGb()); + assertEquals(LICENSES, diskImage.getLicenses()); + assertEquals(DEPRECATION_STATUS, diskImage.getDeprecationStatus()); + assertSame(serviceMockReturnsOptions, diskImage.getCompute()); + assertEquals(GENERATED_ID, storageImage.getGeneratedId()); + assertEquals(IMAGE_ID, storageImage.getImageId()); + assertEquals(CREATION_TIMESTAMP, storageImage.getCreationTimestamp()); + assertEquals(DESCRIPTION, storageImage.getDescription()); + assertEquals(STORAGE_CONFIGURATION, storageImage.getConfiguration()); + assertEquals(STATUS, storageImage.getStatus()); + assertEquals(DISK_SIZE_GB, storageImage.getDiskSizeGb()); + assertEquals(LICENSES, storageImage.getLicenses()); + assertEquals(DEPRECATION_STATUS, storageImage.getDeprecationStatus()); + assertSame(serviceMockReturnsOptions, storageImage.getCompute()); + ImageId imageId = ImageId.of("otherImage"); + Image image = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, STORAGE_CONFIGURATION) + .setImageId(imageId) + .setConfiguration(DISK_CONFIGURATION) + .build(); + assertNull(image.getGeneratedId()); + assertEquals(imageId, image.getImageId()); + assertNull(image.getCreationTimestamp()); + assertNull(image.getDescription()); + assertEquals(DISK_CONFIGURATION, image.getConfiguration()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + assertSame(serviceMockReturnsOptions, image.getCompute()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedImage(12); + compareImage(diskImage, + Image.fromPb(serviceMockReturnsOptions, diskImage.toPb())); + compareImage(storageImage, + Image.fromPb(serviceMockReturnsOptions, storageImage.toPb())); + Image image = + new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, DISK_CONFIGURATION).build(); + compareImage(image, Image.fromPb(serviceMockReturnsOptions, image.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedImage(3); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + expect(compute.deleteImage(IMAGE_ID)).andReturn(operation); + replay(compute); + initializeImage(); + assertSame(operation, image.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedImage(2); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteImage(IMAGE_ID)).andReturn(null); + replay(compute); + initializeImage(); + assertNull(image.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedImage(2); + Compute.ImageOption[] expectedOptions = {Compute.ImageOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getImage(IMAGE_ID, expectedOptions)).andReturn(diskImage); + replay(compute); + initializeImage(); + assertTrue(image.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedImage(2); + Compute.ImageOption[] expectedOptions = {Compute.ImageOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getImage(IMAGE_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeImage(); + assertFalse(image.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedImage(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getImage(IMAGE_ID)).andReturn(storageImage); + replay(compute); + initializeImage(); + Image updateImage = image.reload(); + compareImage(storageImage, updateImage); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedImage(2); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getImage(IMAGE_ID)).andReturn(null); + replay(compute); + initializeImage(); + assertNull(image.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedImage(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getImage(IMAGE_ID, Compute.ImageOption.fields())).andReturn(storageImage); + replay(compute); + initializeImage(); + Image updateImage = image.reload(Compute.ImageOption.fields()); + compareImage(storageImage, updateImage); + verify(compute); + } + + @Test + public void testDeprecateImage() { + initializeExpectedImage(3); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + DeprecationStatus status = + DeprecationStatus.of(DeprecationStatus.Status.DEPRECATED, IMAGE_ID); + expect(compute.deprecate(IMAGE_ID, status)).andReturn(operation); + replay(compute); + initializeImage(); + assertSame(operation, image.deprecate(status)); + } + + @Test + public void testDeprecateNull() { + initializeExpectedImage(2); + expect(compute.getOptions()).andReturn(mockOptions); + DeprecationStatus status = + DeprecationStatus.of(DeprecationStatus.Status.DEPRECATED, IMAGE_ID); + expect(compute.deprecate(IMAGE_ID, status)).andReturn(null); + replay(compute); + initializeImage(); + assertNull(image.deprecate(status)); + } + + public void compareImage(Image expected, Image value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getImageId(), value.getImageId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java new file mode 100644 index 000000000000..53527d7e8793 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceIdTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class InstanceIdTest { + + private static final String PROJECT = "project"; + private static final String ZONE = "zone"; + private static final String NAME = "instance"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + InstanceId instanceId = InstanceId.of(PROJECT, ZONE, NAME); + assertEquals(PROJECT, instanceId.getProject()); + assertEquals(ZONE, instanceId.getZone()); + assertEquals(NAME, instanceId.getInstance()); + assertEquals(URL, instanceId.getSelfLink()); + instanceId = InstanceId.of(ZoneId.of(PROJECT, ZONE), NAME); + assertEquals(PROJECT, instanceId.getProject()); + assertEquals(ZONE, instanceId.getZone()); + assertEquals(NAME, instanceId.getInstance()); + assertEquals(URL, instanceId.getSelfLink()); + instanceId = InstanceId.of(ZONE, NAME); + assertNull(instanceId.getProject()); + assertEquals(ZONE, instanceId.getZone()); + assertEquals(NAME, instanceId.getInstance()); + } + + @Test + public void testToAndFromUrl() { + InstanceId instanceId = InstanceId.of(PROJECT, ZONE, NAME); + compareInstanceId(instanceId, InstanceId.fromUrl(instanceId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid instance URL"); + InstanceId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + InstanceId instanceId = InstanceId.of(PROJECT, ZONE, NAME); + assertSame(instanceId, instanceId.setProjectId(PROJECT)); + compareInstanceId(instanceId, InstanceId.of(ZONE, NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(InstanceId.matchesUrl(InstanceId.of(PROJECT, ZONE, NAME).getSelfLink())); + assertFalse(InstanceId.matchesUrl("notMatchingUrl")); + } + + private void compareInstanceId(InstanceId expected, InstanceId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getZone(), expected.getZone()); + assertEquals(expected.getInstance(), expected.getInstance()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java new file mode 100644 index 000000000000..2eb0d32c7701 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceInfoTest.java @@ -0,0 +1,184 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class InstanceInfoTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); + private static final InstanceInfo.Status STATUS = InstanceInfo.Status.RUNNING; + private static final String STATUS_MESSAGE = "statusMessage"; + private static final Tags TAGS = Tags.of("tag1", "tag2"); + private static final MachineTypeId MACHINE_TYPE = MachineTypeId.of("project", "zone", "type"); + private static final Boolean CAN_IP_FORWARD = true; + private static final NetworkInterface NETWORK_INTERFACE = + NetworkInterface.of(NetworkId.of("project", "network")); + private static final List NETWORK_INTERFACES = + ImmutableList.of(NETWORK_INTERFACE); + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final AttachedDisk ATTACHED_DISK = + AttachedDisk.of(AttachedDisk.PersistentDiskConfiguration.of(DISK_ID)); + private static final List ATTACHED_DISKS = ImmutableList.of(ATTACHED_DISK); + private static final Metadata METADATA = Metadata.newBuilder() + .add("key1", "value1") + .add("key2", "value2") + .build(); + private static final ServiceAccount SERVICE_ACCOUNT = + ServiceAccount.of("email", ImmutableList.of("scope1")); + private static final List SERVICE_ACCOUNTS = ImmutableList.of(SERVICE_ACCOUNT); + private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); + private static final String CPU_PLATFORM = "cpuPlatform"; + private static final InstanceInfo INSTANCE_INFO = + InstanceInfo.newBuilder(INSTANCE_ID, MACHINE_TYPE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setTags(TAGS) + .setCanIpForward(CAN_IP_FORWARD) + .setNetworkInterfaces(NETWORK_INTERFACES) + .setAttachedDisks(ATTACHED_DISKS) + .setMetadata(METADATA) + .setServiceAccounts(SERVICE_ACCOUNTS) + .setSchedulingOptions(SCHEDULING_OPTIONS) + .setCpuPlatform(CPU_PLATFORM) + .build(); + + @Test + public void testToBuilder() { + compareInstanceInfo(INSTANCE_INFO, INSTANCE_INFO.toBuilder().build()); + InstanceInfo instance = INSTANCE_INFO.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", instance.getDescription()); + instance = instance.toBuilder().setDescription(DESCRIPTION).build(); + compareInstanceInfo(INSTANCE_INFO, instance); + } + + @Test + public void testToBuilderIncomplete() { + InstanceInfo instanceInfo = InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, + NETWORK_INTERFACE); + assertEquals(instanceInfo, instanceInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, INSTANCE_INFO.getGeneratedId()); + assertEquals(INSTANCE_ID, INSTANCE_INFO.getInstanceId()); + assertEquals(CREATION_TIMESTAMP, INSTANCE_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, INSTANCE_INFO.getDescription()); + assertEquals(STATUS, INSTANCE_INFO.getStatus()); + assertEquals(STATUS_MESSAGE, INSTANCE_INFO.getStatusMessage()); + assertEquals(TAGS, INSTANCE_INFO.getTags()); + assertEquals(MACHINE_TYPE, INSTANCE_INFO.getMachineType()); + assertEquals(CAN_IP_FORWARD, INSTANCE_INFO.canIpForward()); + assertEquals(NETWORK_INTERFACES, INSTANCE_INFO.getNetworkInterfaces()); + assertEquals(ATTACHED_DISKS, INSTANCE_INFO.getAttachedDisks()); + assertEquals(METADATA, INSTANCE_INFO.getMetadata()); + assertEquals(SERVICE_ACCOUNTS, INSTANCE_INFO.getServiceAccounts()); + assertEquals(SCHEDULING_OPTIONS, INSTANCE_INFO.getSchedulingOptions()); + assertEquals(CPU_PLATFORM, INSTANCE_INFO.getCpuPlatform()); + InstanceInfo instanceInfo = InstanceInfo.newBuilder(INSTANCE_ID, MACHINE_TYPE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setTags(TAGS) + .setCanIpForward(CAN_IP_FORWARD) + .setNetworkInterfaces(NETWORK_INTERFACE) + .setAttachedDisks(ATTACHED_DISK) + .setMetadata(METADATA) + .setServiceAccounts(SERVICE_ACCOUNTS) + .setSchedulingOptions(SCHEDULING_OPTIONS) + .setCpuPlatform(CPU_PLATFORM) + .build(); + compareInstanceInfo(INSTANCE_INFO, instanceInfo); + } + + @Test + public void testOf() { + InstanceInfo instance = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); + assertNull(instance.getGeneratedId()); + assertEquals(INSTANCE_ID, instance.getInstanceId()); + assertNull(instance.getCreationTimestamp()); + assertNull(instance.getDescription()); + assertNull(instance.getStatus()); + assertNull(instance.getStatusMessage()); + assertNull(instance.getTags()); + assertEquals(MACHINE_TYPE, instance.getMachineType()); + assertNull(instance.canIpForward()); + assertEquals(NETWORK_INTERFACES, instance.getNetworkInterfaces()); + assertEquals(ATTACHED_DISKS, instance.getAttachedDisks()); + assertNull(instance.getMetadata()); + assertNull(instance.getServiceAccounts()); + assertNull(instance.getSchedulingOptions()); + assertNull(instance.getCpuPlatform()); + } + + @Test + public void testToAndFromPb() { + compareInstanceInfo(INSTANCE_INFO, InstanceInfo.fromPb(INSTANCE_INFO.toPb())); + InstanceInfo instance = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); + compareInstanceInfo(instance, InstanceInfo.fromPb(instance.toPb())); + } + + @Test + public void testSetProjectId() { + InstanceInfo instance = InstanceInfo.of( + InstanceId.of("zone", "instance"), + MachineTypeId.of("zone", "type"), + AttachedDisk.of(AttachedDisk.PersistentDiskConfiguration.of(DiskId.of("zone", "disk"))), + NetworkInterface.of(NetworkId.of("project", "network"))); + InstanceInfo instanceWithProject = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); + compareInstanceInfo(instanceWithProject, instance.setProjectId("project")); + } + + public void compareInstanceInfo(InstanceInfo expected, InstanceInfo value) { + assertEquals(expected, value); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getInstanceId(), value.getInstanceId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getStatusMessage(), value.getStatusMessage()); + assertEquals(expected.getTags(), value.getTags()); + assertEquals(expected.getMachineType(), value.getMachineType()); + assertEquals(expected.canIpForward(), value.canIpForward()); + assertEquals(expected.getNetworkInterfaces(), value.getNetworkInterfaces()); + assertEquals(expected.getAttachedDisks(), value.getAttachedDisks()); + assertEquals(expected.getMetadata(), value.getMetadata()); + assertEquals(expected.getServiceAccounts(), value.getServiceAccounts()); + assertEquals(expected.getSchedulingOptions(), value.getSchedulingOptions()); + assertEquals(expected.getCpuPlatform(), value.getCpuPlatform()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java new file mode 100644 index 000000000000..98b29f1f86d9 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/InstanceTest.java @@ -0,0 +1,917 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +import org.junit.Test; + +import java.util.List; +import java.util.Map; + +public class InstanceTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); + private static final InstanceInfo.Status STATUS = InstanceInfo.Status.RUNNING; + private static final String STATUS_MESSAGE = "statusMessage"; + private static final Tags TAGS = Tags.newBuilder() + .setValues("tag1", "tag2") + .setFingerprint("fingerprint") + .build(); + private static final MachineTypeId MACHINE_TYPE = MachineTypeId.of("project", "zone", "type"); + private static final Boolean CAN_IP_FORWARD = true; + private static final NetworkInterface NETWORK_INTERFACE = + NetworkInterface.of(NetworkId.of("project", "network")); + private static final List NETWORK_INTERFACES = + ImmutableList.of(NETWORK_INTERFACE); + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final AttachedDisk ATTACHED_DISK = + AttachedDisk.of(AttachedDisk.PersistentDiskConfiguration.of(DISK_ID)); + private static final List ATTACHED_DISKS = ImmutableList.of(ATTACHED_DISK); + private static final Metadata METADATA = Metadata.newBuilder() + .add("key1", "value1") + .add("key2", "value2") + .setFingerprint("fingerprint") + .build(); + private static final ServiceAccount SERVICE_ACCOUNT = + ServiceAccount.of("email", ImmutableList.of("scope1")); + private static final List SERVICE_ACCOUNTS = + ImmutableList.of(SERVICE_ACCOUNT); + private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); + private static final String CPU_PLATFORM = "cpuPlatform"; + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Instance instance; + private Instance expectedInstance; + + private void initializeExpectedInstance(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + expectedInstance = new Instance.Builder(serviceMockReturnsOptions, INSTANCE_ID, MACHINE_TYPE, + ATTACHED_DISK, NETWORK_INTERFACE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setTags(TAGS) + .setCanIpForward(CAN_IP_FORWARD) + .setMetadata(METADATA) + .setServiceAccounts(SERVICE_ACCOUNTS) + .setSchedulingOptions(SCHEDULING_OPTIONS) + .setCpuPlatform(CPU_PLATFORM) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeInstance() { + instance = new Instance.Builder(compute, INSTANCE_ID, MACHINE_TYPE, + ATTACHED_DISK, NETWORK_INTERFACE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setTags(TAGS) + .setCanIpForward(CAN_IP_FORWARD) + .setMetadata(METADATA) + .setServiceAccounts(SERVICE_ACCOUNTS) + .setSchedulingOptions(SCHEDULING_OPTIONS) + .setCpuPlatform(CPU_PLATFORM) + .build(); + } + + @Test + public void testToBuilder() { + initializeExpectedInstance(8); + compareInstance(expectedInstance, expectedInstance.toBuilder().build()); + Instance newInstance = expectedInstance.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newInstance.getDescription()); + newInstance = newInstance.toBuilder().setDescription("description").build(); + compareInstance(expectedInstance, newInstance); + } + + @Test + public void testToBuilderIncomplete() { + initializeExpectedInstance(5); + InstanceInfo instanceInfo = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); + Instance instance = + new Instance(serviceMockReturnsOptions, new InstanceInfo.BuilderImpl(instanceInfo)); + compareInstance(instance, instance.toBuilder().build()); + } + + @Test + public void testBuilder() { + initializeExpectedInstance(2); + assertEquals(GENERATED_ID, expectedInstance.getGeneratedId()); + assertEquals(INSTANCE_ID, expectedInstance.getInstanceId()); + assertEquals(CREATION_TIMESTAMP, expectedInstance.getCreationTimestamp()); + assertEquals(DESCRIPTION, expectedInstance.getDescription()); + assertEquals(STATUS, expectedInstance.getStatus()); + assertEquals(STATUS_MESSAGE, expectedInstance.getStatusMessage()); + assertEquals(TAGS, expectedInstance.getTags()); + assertEquals(MACHINE_TYPE, expectedInstance.getMachineType()); + assertEquals(CAN_IP_FORWARD, expectedInstance.canIpForward()); + assertEquals(NETWORK_INTERFACES, expectedInstance.getNetworkInterfaces()); + assertEquals(ATTACHED_DISKS, expectedInstance.getAttachedDisks()); + assertEquals(METADATA, expectedInstance.getMetadata()); + assertEquals(SERVICE_ACCOUNTS, expectedInstance.getServiceAccounts()); + assertEquals(SCHEDULING_OPTIONS, expectedInstance.getSchedulingOptions()); + assertEquals(CPU_PLATFORM, expectedInstance.getCpuPlatform()); + assertSame(serviceMockReturnsOptions, expectedInstance.getCompute()); + InstanceInfo instanceInfo = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); + Instance instance = + new Instance(serviceMockReturnsOptions, new InstanceInfo.BuilderImpl(instanceInfo)); + assertNull(instance.getGeneratedId()); + assertEquals(INSTANCE_ID, instance.getInstanceId()); + assertNull(instance.getCreationTimestamp()); + assertNull(instance.getDescription()); + assertNull(instance.getStatus()); + assertNull(instance.getStatusMessage()); + assertNull(instance.getTags()); + assertEquals(MACHINE_TYPE, instance.getMachineType()); + assertNull(instance.canIpForward()); + assertEquals(NETWORK_INTERFACES, instance.getNetworkInterfaces()); + assertEquals(ATTACHED_DISKS, instance.getAttachedDisks()); + assertNull(instance.getMetadata()); + assertNull(instance.getServiceAccounts()); + assertNull(instance.getSchedulingOptions()); + assertNull(instance.getCpuPlatform()); + assertSame(serviceMockReturnsOptions, instance.getCompute()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedInstance(8); + compareInstance(expectedInstance, + Instance.fromPb(serviceMockReturnsOptions, expectedInstance.toPb())); + Instance instance = new Instance.Builder(serviceMockReturnsOptions, INSTANCE_ID, MACHINE_TYPE, + ATTACHED_DISK, NETWORK_INTERFACE).build(); + compareInstance(instance, Instance.fromPb(serviceMockReturnsOptions, instance.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.deleteInstance(INSTANCE_ID)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteInstance(INSTANCE_ID)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedInstance(1); + Compute.InstanceOption[] expectedOptions = {Compute.InstanceOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getInstance(INSTANCE_ID, expectedOptions)).andReturn(expectedInstance); + replay(compute); + initializeInstance(); + assertTrue(instance.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedInstance(1); + Compute.InstanceOption[] expectedOptions = {Compute.InstanceOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getInstance(INSTANCE_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeInstance(); + assertFalse(instance.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedInstance(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getInstance(INSTANCE_ID)).andReturn(expectedInstance); + replay(compute); + initializeInstance(); + Instance updatedInstance = instance.reload(); + compareInstance(expectedInstance, updatedInstance); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getInstance(INSTANCE_ID)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedInstance(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getInstance(INSTANCE_ID, + Compute.InstanceOption.fields())).andReturn(expectedInstance); + replay(compute); + initializeInstance(); + Instance updateInstance = instance.reload(Compute.InstanceOption.fields()); + compareInstance(expectedInstance, updateInstance); + verify(compute); + } + + @Test + public void testAddAccessConfig() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.of("192.168.1.1"); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.addAccessConfig(INSTANCE_ID, "nic0", accessConfig)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.addAccessConfig("nic0", accessConfig)); + } + + @Test + public void testAddAccessConfig_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.of("192.168.1.1"); + expect(compute.addAccessConfig(INSTANCE_ID, "nic0", accessConfig)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.addAccessConfig("nic0", accessConfig)); + } + + @Test + public void testAddAccessConfigWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.of("192.168.1.1"); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.addAccessConfig( + INSTANCE_ID, "nic0", accessConfig, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, + instance.addAccessConfig("nic0", accessConfig, Compute.OperationOption.fields())); + } + + @Test + public void testAttachDisk() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.attachDisk(INSTANCE_ID, configuration)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.attachDisk(configuration)); + } + + @Test + public void testAttachDisk_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + expect(compute.attachDisk(INSTANCE_ID, configuration)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.attachDisk(configuration)); + } + + @Test + public void testAttachDiskWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.attachDisk(INSTANCE_ID, configuration, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.attachDisk(configuration, Compute.OperationOption.fields())); + } + + @Test + public void testAttachDiskName() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.attachDisk("dev0", configuration)); + } + + @Test + public void testAttachDiskName_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.attachDisk("dev0", configuration)); + } + + @Test + public void testAttachDiskNameWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, + instance.attachDisk("dev0", configuration, Compute.OperationOption.fields())); + } + + @Test + public void testAttachDiskNameIndex() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration, 1)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.attachDisk("dev0", configuration, 1)); + } + + @Test + public void testAttachDiskNameIndex_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + expect(compute.attachDisk(INSTANCE_ID, "dev0", configuration, 1)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.attachDisk("dev0", configuration, 1)); + } + + @Test + public void testAttachDiskNameIndexWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + AttachedDisk.PersistentDiskConfiguration configuration = + AttachedDisk.PersistentDiskConfiguration.of(DISK_ID); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.attachDisk( + INSTANCE_ID, "dev0", configuration, 1, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, + instance.attachDisk("dev0", configuration, 1, Compute.OperationOption.fields())); + } + + @Test + public void testDeleteAccessConfig() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.deleteAccessConfig(INSTANCE_ID, "nic0", "NAT")).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.deleteAccessConfig("nic0", "NAT")); + } + + @Test + public void testDeleteAccessConfig_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteAccessConfig(INSTANCE_ID, "nic0", "NAT")).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.deleteAccessConfig("nic0", "NAT")); + } + + @Test + public void testDeleteAccessConfigWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.deleteAccessConfig( + INSTANCE_ID, "nic0", "NAT", Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, + instance.deleteAccessConfig("nic0", "NAT", Compute.OperationOption.fields())); + } + + @Test + public void testDetachDisk() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.detachDisk(INSTANCE_ID, "dev0")).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.detachDisk("dev0")); + } + + @Test + public void testDetachDisk_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.detachDisk(INSTANCE_ID, "dev0")).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.detachDisk("dev0")); + } + + @Test + public void testDetachDiskWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.detachDisk(INSTANCE_ID, "dev0", Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.detachDisk("dev0", Compute.OperationOption.fields())); + } + + @Test + public void testGetSerialPortOutputWithNumber() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSerialPortOutput(INSTANCE_ID, 2)).andReturn("output"); + replay(compute); + initializeInstance(); + assertSame("output", instance.getSerialPortOutput(2)); + } + + @Test + public void testGetSerialPortOutput() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSerialPortOutput(INSTANCE_ID)).andReturn("output"); + replay(compute); + initializeInstance(); + assertSame("output", instance.getSerialPortOutput()); + } + + @Test + public void testResetOperation() { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.reset(INSTANCE_ID)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.reset()); + } + + @Test + public void testResetNull() { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.reset(INSTANCE_ID)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.reset()); + } + + @Test + public void testSetDiskAutodelete() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.setDiskAutoDelete(INSTANCE_ID, "dev0", true)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setDiskAutoDelete("dev0", true)); + } + + @Test + public void testSetDiskAutodelete_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.setDiskAutoDelete(INSTANCE_ID, "dev0", false)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setDiskAutoDelete("dev0", false)); + } + + @Test + public void testSetDiskAutodeleteWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.setDiskAutoDelete(INSTANCE_ID, "dev0", true, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, + instance.setDiskAutoDelete("dev0", true, Compute.OperationOption.fields())); + } + + @Test + public void testSetMachineType() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.setMachineType(INSTANCE_ID, MACHINE_TYPE)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setMachineType(MACHINE_TYPE)); + } + + @Test + public void testSetMachineType_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.setMachineType(INSTANCE_ID, MACHINE_TYPE)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setMachineType(MACHINE_TYPE)); + } + + @Test + public void testSetMachineTypeWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.setMachineType(INSTANCE_ID, MACHINE_TYPE, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setMachineType(MACHINE_TYPE, Compute.OperationOption.fields())); + } + + @Test + public void testSetMetadata() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + Metadata metadata = Metadata.newBuilder().add("k", "v").setFingerprint("fingerprint").build(); + expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setMetadata(metadata)); + } + + @Test + public void testSetMetadata_Null() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Metadata metadata = Metadata.newBuilder().add("k", "v").setFingerprint("fingerprint").build(); + expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setMetadata(metadata)); + } + + @Test + public void testSetMetadataWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + Metadata metadata = Metadata.newBuilder().add("k", "v").setFingerprint("fingerprint").build(); + expect(compute.setMetadata(INSTANCE_ID, metadata, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setMetadata(metadata, Compute.OperationOption.fields())); + } + + @Test + public void testSetMetadataFromMap() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + Map metadataMap = ImmutableMap.of("k", "v"); + Metadata metadata = + Metadata.newBuilder().setValues(metadataMap).setFingerprint("fingerprint").build(); + expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setMetadata(metadataMap)); + } + + @Test + public void testSetMetadataFromMap_Null() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Map metadataMap = ImmutableMap.of("k", "v"); + Metadata metadata = + Metadata.newBuilder().setValues(metadataMap).setFingerprint("fingerprint").build(); + expect(compute.setMetadata(INSTANCE_ID, metadata)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setMetadata(metadataMap)); + } + + @Test + public void testSetMetadataFromMapWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + Map metadataMap = ImmutableMap.of("k", "v"); + Metadata metadata = + Metadata.newBuilder().setValues(metadataMap).setFingerprint("fingerprint").build(); + expect(compute.setMetadata(INSTANCE_ID, metadata, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setMetadata(metadataMap, Compute.OperationOption.fields())); + } + + @Test + public void testSetSchedulingOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + expect(compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setSchedulingOptions(schedulingOptions)); + } + + @Test + public void testSetSchedulingOptions_Null() throws Exception { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + expect(compute.setSchedulingOptions(INSTANCE_ID, schedulingOptions)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setSchedulingOptions(schedulingOptions)); + } + + @Test + public void testSetSchedulingOptionsWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + expect(compute.setSchedulingOptions( + INSTANCE_ID, schedulingOptions, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, + instance.setSchedulingOptions(schedulingOptions, Compute.OperationOption.fields())); + } + + @Test + public void testSetTags() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + Tags tags = Tags.newBuilder().setValues("v1", "v2").setFingerprint("fingerprint").build(); + expect(compute.setTags(INSTANCE_ID, tags)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setTags(tags)); + } + + @Test + public void testSetTags_Null() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Tags tags = Tags.newBuilder().setValues("v1", "v2").setFingerprint("fingerprint").build(); + expect(compute.setTags(INSTANCE_ID, tags)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setTags(tags)); + } + + @Test + public void testSetTagsWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + Tags tags = Tags.newBuilder().setValues("v1", "v2").setFingerprint("fingerprint").build(); + expect(compute.setTags(INSTANCE_ID, tags, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setTags(tags, Compute.OperationOption.fields())); + } + + @Test + public void testSetTagsFromList() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + List tagList = ImmutableList.of("v1", "v2"); + Tags tags = Tags.newBuilder().setValues(tagList).setFingerprint("fingerprint").build(); + expect(compute.setTags(INSTANCE_ID, tags)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setTags(tagList)); + } + + @Test + public void testSetTagsFromList_Null() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + List tagList = ImmutableList.of("v1", "v2"); + Tags tags = Tags.newBuilder().setValues(tagList).setFingerprint("fingerprint").build(); + expect(compute.setTags(INSTANCE_ID, tags)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.setTags(tagList)); + } + + @Test + public void testSetTagsFromListWithOptions() throws Exception { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + List tagList = ImmutableList.of("v1", "v2"); + Tags tags = Tags.newBuilder().setValues(tagList).setFingerprint("fingerprint").build(); + expect(compute.setTags(INSTANCE_ID, tags, Compute.OperationOption.fields())) + .andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.setTags(tagList, Compute.OperationOption.fields())); + } + + @Test + public void testStartOperation() { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.start(INSTANCE_ID)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.start()); + } + + @Test + public void testStartNull() { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.start(INSTANCE_ID)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.start()); + } + + @Test + public void testStopOperation() { + initializeExpectedInstance(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZoneOperationId.of("project", "op")) + .build(); + expect(compute.stop(INSTANCE_ID)).andReturn(operation); + replay(compute); + initializeInstance(); + assertSame(operation, instance.stop()); + } + + @Test + public void testStopNull() { + initializeExpectedInstance(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.stop(INSTANCE_ID)).andReturn(null); + replay(compute); + initializeInstance(); + assertNull(instance.stop()); + } + + public void compareInstance(Instance expected, Instance value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getInstanceId(), value.getInstanceId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getStatusMessage(), value.getStatusMessage()); + assertEquals(expected.getTags(), value.getTags()); + assertEquals(expected.getMachineType(), value.getMachineType()); + assertEquals(expected.canIpForward(), value.canIpForward()); + assertEquals(expected.getNetworkInterfaces(), value.getNetworkInterfaces()); + assertEquals(expected.getAttachedDisks(), value.getAttachedDisks()); + assertEquals(expected.getMetadata(), value.getMetadata()); + assertEquals(expected.getServiceAccounts(), value.getServiceAccounts()); + assertEquals(expected.getSchedulingOptions(), value.getSchedulingOptions()); + assertEquals(expected.getCpuPlatform(), value.getCpuPlatform()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java new file mode 100644 index 000000000000..3cfa46744f5a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseIdTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class LicenseIdTest { + + private static final String PROJECT = "project"; + private static final String LICENSE = "license"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/global/licenses/license"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + LicenseId licenseId = LicenseId.of(PROJECT, LICENSE); + assertEquals(PROJECT, licenseId.getProject()); + assertEquals(LICENSE, licenseId.getLicense()); + assertEquals(URL, licenseId.getSelfLink()); + licenseId = LicenseId.of(LICENSE); + assertNull(licenseId.getProject()); + assertEquals(LICENSE, licenseId.getLicense()); + } + + @Test + public void testToAndFromUrl() { + LicenseId licenseId = LicenseId.of(PROJECT, LICENSE); + compareLicenseId(licenseId, LicenseId.fromUrl(licenseId.getSelfLink())); + } + + @Test + public void testSetProjectId() { + LicenseId licenseId = LicenseId.of(PROJECT, LICENSE); + assertSame(licenseId, licenseId.setProjectId(PROJECT)); + compareLicenseId(licenseId, LicenseId.of(LICENSE).setProjectId(PROJECT)); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid license URL"); + LicenseId.fromUrl("notMatchingUrl"); + } + + @Test + public void testMatchesUrl() { + assertTrue(LicenseId.matchesUrl(LicenseId.of(PROJECT, LICENSE).getSelfLink())); + assertFalse(LicenseId.matchesUrl("notMatchingUrl")); + } + + private void compareLicenseId(LicenseId expected, LicenseId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getLicense(), expected.getLicense()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java new file mode 100644 index 000000000000..35ca4a869a73 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/LicenseTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class LicenseTest { + + private static final LicenseId LICENSE_ID = LicenseId.of("project", "license"); + private static final Boolean CHARGES_USE_FEE = true; + private static final License LICENSE = new License(LICENSE_ID, CHARGES_USE_FEE); + + @Test + public void testBuilder() { + assertEquals(LICENSE_ID, LICENSE.getLicenseId()); + assertEquals(CHARGES_USE_FEE, LICENSE.chargesUseFee()); + } + + @Test + public void testToAndFromPb() { + License license = License.fromPb(LICENSE.toPb()); + compareLicenses(LICENSE, license); + assertEquals(LICENSE_ID.getProject(), license.getLicenseId().getProject()); + assertEquals(LICENSE_ID.getLicense(), license.getLicenseId().getLicense()); + } + + private void compareLicenses(License expected, License value) { + assertEquals(expected, value); + assertEquals(expected.getLicenseId(), value.getLicenseId()); + assertEquals(expected.chargesUseFee(), value.chargesUseFee()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java new file mode 100644 index 000000000000..1e068ab2b792 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeIdTest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class MachineTypeIdTest { + + private static final String PROJECT = "project"; + private static final String ZONE = "zone"; + private static final String TYPE = "type"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/zones/zone/machineTypes/type"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + MachineTypeId machineTypeId = MachineTypeId.of(PROJECT, ZONE, TYPE); + assertEquals(PROJECT, machineTypeId.getProject()); + assertEquals(ZONE, machineTypeId.getZone()); + assertEquals(TYPE, machineTypeId.getType()); + assertEquals(URL, machineTypeId.getSelfLink()); + machineTypeId = MachineTypeId.of(ZONE, TYPE); + assertNull(machineTypeId.getProject()); + assertEquals(ZONE, machineTypeId.getZone()); + assertEquals(TYPE, machineTypeId.getType()); + } + + @Test + public void testToAndFromUrl() { + MachineTypeId machineTypeId = MachineTypeId.of(PROJECT, ZONE, TYPE); + compareMachineTypeId(machineTypeId, MachineTypeId.fromUrl(machineTypeId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid machine type URL"); + MachineTypeId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + MachineTypeId machineTypeId = MachineTypeId.of(PROJECT, ZONE, TYPE); + assertSame(machineTypeId, machineTypeId.setProjectId(PROJECT)); + compareMachineTypeId(machineTypeId, MachineTypeId.of(ZONE, TYPE).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(MachineTypeId.matchesUrl(MachineTypeId.of(PROJECT, ZONE, TYPE).getSelfLink())); + assertFalse(MachineTypeId.matchesUrl("notMatchingUrl")); + } + + private void compareMachineTypeId(MachineTypeId expected, MachineTypeId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getZone(), expected.getZone()); + assertEquals(expected.getType(), expected.getType()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java new file mode 100644 index 000000000000..8eeb601d86e8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MachineTypeTest.java @@ -0,0 +1,89 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class MachineTypeTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); + private static final Integer CPUS = 1; + private static final Integer MEMORY_MB = 2; + private static final List SCRATCH_DISKS = ImmutableList.of(3); + private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; + private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, MACHINE_TYPE_ID); + private static final MachineType MACHINE_TYPE = MachineType.newBuilder() + .setGeneratedId(GENERATED_ID) + .setMachineTypeId(MACHINE_TYPE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setCpus(CPUS) + .setMemoryMb(MEMORY_MB) + .setScratchDisksSizeGb(SCRATCH_DISKS) + .setMaximumPersistentDisks(MAXIMUM_PERSISTENT_DISKS) + .setMaximumPersistentDisksSizeGb(MAXIMUM_PERSISTENT_DISKS_SIZE_GB) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, MACHINE_TYPE.getGeneratedId()); + assertEquals(MACHINE_TYPE_ID, MACHINE_TYPE.getMachineTypeId()); + assertEquals(CREATION_TIMESTAMP, MACHINE_TYPE.getCreationTimestamp()); + assertEquals(DESCRIPTION, MACHINE_TYPE.getDescription()); + assertEquals(CPUS, MACHINE_TYPE.getCpus()); + assertEquals(MEMORY_MB, MACHINE_TYPE.getMemoryMb()); + assertEquals(SCRATCH_DISKS, MACHINE_TYPE.getScratchDisksSizeGb()); + assertEquals(MAXIMUM_PERSISTENT_DISKS, MACHINE_TYPE.getMaximumPersistentDisks()); + assertEquals(MAXIMUM_PERSISTENT_DISKS_SIZE_GB, MACHINE_TYPE.getMaximumPersistentDisksSizeGb()); + assertEquals(DEPRECATION_STATUS, MACHINE_TYPE.getDeprecationStatus()); + } + + @Test + public void testToPbAndFromPb() { + compareMachineTypes(MACHINE_TYPE, MachineType.fromPb(MACHINE_TYPE.toPb())); + MachineType machineType = MachineType.newBuilder().setMachineTypeId(MACHINE_TYPE_ID).build(); + compareMachineTypes(machineType, MachineType.fromPb(machineType.toPb())); + } + + private void compareMachineTypes(MachineType expected, MachineType value) { + assertEquals(expected, value); + assertEquals(expected.getMachineTypeId(), value.getMachineTypeId()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getCpus(), value.getCpus()); + assertEquals(expected.getMemoryMb(), value.getMemoryMb()); + assertEquals(expected.getScratchDisksSizeGb(), value.getScratchDisksSizeGb()); + assertEquals(expected.getMaximumPersistentDisks(), value.getMaximumPersistentDisks()); + assertEquals(expected.getMaximumPersistentDisksSizeGb(), + value.getMaximumPersistentDisksSizeGb()); + assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java new file mode 100644 index 000000000000..393543acf26d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/MetadataTest.java @@ -0,0 +1,81 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.common.collect.ImmutableMap; + +import org.junit.Test; + +import java.util.Map; + +public class MetadataTest { + + private static final Metadata METADATA = Metadata.newBuilder() + .add("key1", "value1") + .add("key2", "value2") + .build(); + + @Test + public void testToBuilder() { + Metadata metadata = METADATA.toBuilder().setFingerprint("newFingerprint").build(); + assertEquals("newFingerprint", metadata.getFingerprint()); + compareMetadata(METADATA, metadata.toBuilder().setFingerprint(null).build()); + } + + @Test + public void testBuilder() { + assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), METADATA.getValues()); + assertNull(METADATA.getFingerprint()); + Metadata metadata = Metadata.newBuilder() + .setValues(ImmutableMap.of("key1", "value1", "key2", "value2")) + .build(); + assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), metadata.getValues()); + assertNull(metadata.getFingerprint()); + metadata = Metadata.newBuilder() + .setValues(ImmutableMap.of("key1", "value1", "key2", "value2")) + .setFingerprint("fingerprint") + .build(); + assertEquals(ImmutableMap.of("key1", "value1", "key2", "value2"), metadata.getValues()); + assertEquals("fingerprint", metadata.getFingerprint()); + } + + @Test + public void testOf() { + Map map = ImmutableMap.of("key1", "value1", "key2", "value2"); + compareMetadata(METADATA, Metadata.of(map)); + } + + @Test + public void testToAndFromPb() { + compareMetadata(METADATA, Metadata.fromPb(METADATA.toPb())); + Metadata metadata = Metadata.newBuilder() + .setValues(ImmutableMap.of("key1", "value1", "key2", "value2")) + .setFingerprint("fingerprint") + .build(); + compareMetadata(metadata, Metadata.fromPb(metadata.toPb())); + } + + public void compareMetadata(Metadata expected, Metadata value) { + assertEquals(expected, value); + assertEquals(expected.getFingerprint(), value.getFingerprint()); + assertEquals(expected.getValues(), value.getValues()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java new file mode 100644 index 000000000000..be749284ef51 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkIdTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class NetworkIdTest { + + private static final String PROJECT = "project"; + private static final String NETWORK = "network"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/global/networks/network"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + NetworkId networkId = NetworkId.of(PROJECT, NETWORK); + assertEquals(PROJECT, networkId.getProject()); + assertEquals(NETWORK, networkId.getNetwork()); + assertEquals(URL, networkId.getSelfLink()); + networkId = NetworkId.of(NETWORK); + assertNull(networkId.getProject()); + assertEquals(NETWORK, networkId.getNetwork()); + } + + @Test + public void testToAndFromUrl() { + NetworkId networkId = NetworkId.of(PROJECT, NETWORK); + compareNetworkId(networkId, NetworkId.fromUrl(networkId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid network URL"); + NetworkId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + NetworkId networkId = NetworkId.of(PROJECT, NETWORK); + assertSame(networkId, networkId.setProjectId(PROJECT)); + compareNetworkId(networkId, NetworkId.of(NETWORK).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(NetworkId.matchesUrl(NetworkId.of(PROJECT, NETWORK).getSelfLink())); + assertFalse(NetworkId.matchesUrl("notMatchingUrl")); + } + + private void compareNetworkId(NetworkId expected, NetworkId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getNetwork(), expected.getNetwork()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java new file mode 100644 index 000000000000..f0b313df927d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInfoTest.java @@ -0,0 +1,126 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class NetworkInfoTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final SubnetworkId SUBNETWORK1 = SubnetworkId.of("project", "region1", "network1"); + private static final SubnetworkId SUBNETWORK2 = SubnetworkId.of("project", "region2", "network2"); + private static final List SUBNETWORKS = ImmutableList.of(SUBNETWORK1, SUBNETWORK2); + private static final String GATEWAY_ADDRESS = "192.168.1.1"; + private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); + private static final String IP_RANGE = "192.168.0.0/16"; + private static final Boolean AUTO_CREATE_SUBNETWORKS = true; + private static final StandardNetworkConfiguration NETWORK_CONFIGURATION = + new StandardNetworkConfiguration(IP_RANGE, GATEWAY_ADDRESS); + private static final SubnetNetworkConfiguration SUBNET_NETWORK_CONFIGURATION = + new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); + private static final NetworkInfo NETWORK_INFO = + NetworkInfo.newBuilder(NETWORK_ID, NETWORK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .build(); + private static final NetworkInfo SUBNET_NETWORK_INFO = + NetworkInfo.newBuilder(NETWORK_ID, SUBNET_NETWORK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .build(); + + @Test + public void testToBuilder() { + compareNetworkInfo(NETWORK_INFO, NETWORK_INFO.toBuilder().build()); + NetworkInfo networkInfo = NETWORK_INFO.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", networkInfo.getDescription()); + networkInfo = networkInfo.toBuilder().setDescription("description").build(); + compareNetworkInfo(NETWORK_INFO, networkInfo); + compareNetworkInfo(SUBNET_NETWORK_INFO, SUBNET_NETWORK_INFO.toBuilder().build()); + networkInfo = SUBNET_NETWORK_INFO.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", networkInfo.getDescription()); + networkInfo = networkInfo.toBuilder().setDescription("description").build(); + compareNetworkInfo(SUBNET_NETWORK_INFO, networkInfo); + } + + @Test + public void testToBuilderIncomplete() { + NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); + assertEquals(networkInfo, networkInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, NETWORK_INFO.getGeneratedId()); + assertEquals(NETWORK_ID, NETWORK_INFO.getNetworkId()); + assertEquals(CREATION_TIMESTAMP, NETWORK_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, NETWORK_INFO.getDescription()); + assertEquals(NETWORK_CONFIGURATION, NETWORK_INFO.getConfiguration()); + assertEquals(GENERATED_ID, SUBNET_NETWORK_INFO.getGeneratedId()); + assertEquals(NETWORK_ID, SUBNET_NETWORK_INFO.getNetworkId()); + assertEquals(CREATION_TIMESTAMP, SUBNET_NETWORK_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, SUBNET_NETWORK_INFO.getDescription()); + assertEquals(SUBNET_NETWORK_CONFIGURATION, SUBNET_NETWORK_INFO.getConfiguration()); + } + + @Test + public void testOf() { + NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); + assertNull(networkInfo.getGeneratedId()); + assertEquals(NETWORK_ID, NETWORK_INFO.getNetworkId()); + assertEquals(NETWORK_CONFIGURATION, NETWORK_INFO.getConfiguration()); + assertNull(networkInfo.getCreationTimestamp()); + assertNull(networkInfo.getDescription()); + } + + @Test + public void testToAndFromPb() { + compareNetworkInfo(NETWORK_INFO, NetworkInfo.fromPb(NETWORK_INFO.toPb())); + compareNetworkInfo(SUBNET_NETWORK_INFO, NetworkInfo.fromPb(SUBNET_NETWORK_INFO.toPb())); + NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); + compareNetworkInfo(networkInfo, NetworkInfo.fromPb(networkInfo.toPb())); + } + + @Test + public void testSetProjectId() { + NetworkInfo networkInfo = NETWORK_INFO.toBuilder() + .setNetworkId(NetworkId.of("network")) + .build(); + compareNetworkInfo(NETWORK_INFO, networkInfo.setProjectId("project")); + } + + public void compareNetworkInfo(NetworkInfo expected, NetworkInfo value) { + assertEquals(expected, value); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getNetworkId(), value.getNetworkId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java new file mode 100644 index 000000000000..5b561e41fa64 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkInterfaceTest.java @@ -0,0 +1,182 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class NetworkInterfaceTest { + + private static final String NAME = "networkInterface"; + private static final NetworkId NETWORK = NetworkId.of("project", "network"); + private static final String NETWORK_IP = "192.168.1.1"; + private static final SubnetworkId SUBNETWORK = SubnetworkId.of("project", "region", "subnetwork"); + private static final AccessConfig ACCESS_CONFIG = + AccessConfig.newBuilder() + .setName("accessConfig") + .setNatIp("192.168.1.1") + .setType(AccessConfig.Type.ONE_TO_ONE_NAT) + .build(); + private static final List ACCESS_CONFIGURATIONS = + ImmutableList.of(ACCESS_CONFIG); + private static final NetworkInterface NETWORK_INTERFACE = NetworkInterface.newBuilder(NETWORK) + .setName(NAME) + .setNetworkIp(NETWORK_IP) + .setSubnetwork(SUBNETWORK) + .setAccessConfigurations(ACCESS_CONFIGURATIONS) + .build(); + + @Test + public void testAccessConfigToBuilder() { + AccessConfig accessConfig = + ACCESS_CONFIG.toBuilder().setName("newName").build(); + assertEquals("newName", accessConfig.getName()); + compareAccessConfig(ACCESS_CONFIG, accessConfig.toBuilder().setName("accessConfig").build()); + } + + @Test + public void testAccessConfigToBuilderIncomplete() { + AccessConfig accessConfig = AccessConfig.of(); + compareAccessConfig(accessConfig, accessConfig.toBuilder().build()); + } + + @Test + public void testToBuilder() { + compareNetworkInterface(NETWORK_INTERFACE, NETWORK_INTERFACE.toBuilder().build()); + NetworkInterface networkInterface = + NETWORK_INTERFACE.toBuilder().setName("newInterface").build(); + assertEquals("newInterface", networkInterface.getName()); + networkInterface = networkInterface.toBuilder().setName(NAME).build(); + compareNetworkInterface(NETWORK_INTERFACE, networkInterface); + } + + @Test + public void testToBuilderIncomplete() { + NetworkInterface networkInterface = NetworkInterface.of(NETWORK); + assertEquals(networkInterface, networkInterface.toBuilder().build()); + networkInterface = NetworkInterface.of(NETWORK.getNetwork()); + assertEquals(networkInterface, networkInterface.toBuilder().build()); + } + + @Test + public void testAccessConfigBuilder() { + assertEquals("accessConfig", ACCESS_CONFIG.getName()); + assertEquals("192.168.1.1", ACCESS_CONFIG.getNatIp()); + assertEquals(AccessConfig.Type.ONE_TO_ONE_NAT, ACCESS_CONFIG.getType()); + } + + @Test + public void testBuilder() { + assertEquals(NAME, NETWORK_INTERFACE.getName()); + assertEquals(NETWORK, NETWORK_INTERFACE.getNetwork()); + assertEquals(NETWORK_IP, NETWORK_INTERFACE.getNetworkIp()); + assertEquals(SUBNETWORK, NETWORK_INTERFACE.getSubnetwork()); + assertEquals(ACCESS_CONFIGURATIONS, NETWORK_INTERFACE.getAccessConfigurations()); + NetworkInterface networkInterface = NetworkInterface.newBuilder("network") + .setName(NAME) + .setNetworkIp(NETWORK_IP) + .setSubnetwork(SUBNETWORK) + .setAccessConfigurations(ACCESS_CONFIG) + .build(); + assertEquals(NAME, networkInterface.getName()); + assertEquals(NetworkId.of("network"), networkInterface.getNetwork()); + assertEquals(NETWORK_IP, networkInterface.getNetworkIp()); + assertEquals(SUBNETWORK, networkInterface.getSubnetwork()); + assertEquals(ACCESS_CONFIGURATIONS, networkInterface.getAccessConfigurations()); + } + + @Test + public void testAccessConfigOf() { + AccessConfig accessConfig = AccessConfig.of("192.168.1.1"); + assertNull(accessConfig.getName()); + assertEquals("192.168.1.1", accessConfig.getNatIp()); + assertNull(accessConfig.getType()); + accessConfig = AccessConfig.of(); + assertNull(accessConfig.getName()); + assertNull(accessConfig.getNatIp()); + assertNull(accessConfig.getType()); + } + + @Test + public void testOf() { + NetworkInterface networkInterface = NetworkInterface.of(NETWORK); + assertNull(networkInterface.getName()); + assertEquals(NETWORK, networkInterface.getNetwork()); + assertNull(networkInterface.getNetworkIp()); + assertNull(networkInterface.getSubnetwork()); + networkInterface = NetworkInterface.of(NETWORK.getNetwork()); + assertNull(networkInterface.getName()); + assertNull(networkInterface.getNetwork().getProject()); + assertEquals(NETWORK.getNetwork(), networkInterface.getNetwork().getNetwork()); + assertNull(networkInterface.getNetworkIp()); + assertNull(networkInterface.getSubnetwork()); + } + + @Test + public void testAccessConfigToAndFromPb() { + AccessConfig accessConfig = + AccessConfig.fromPb(ACCESS_CONFIG.toPb()); + compareAccessConfig(ACCESS_CONFIG, accessConfig); + accessConfig = AccessConfig.of(); + compareAccessConfig(accessConfig, AccessConfig.fromPb(accessConfig.toPb())); + } + + @Test + public void testToAndFromPb() { + NetworkInterface networkInterface = NetworkInterface.fromPb(NETWORK_INTERFACE.toPb()); + compareNetworkInterface(NETWORK_INTERFACE, networkInterface); + networkInterface = NetworkInterface.of(NETWORK); + compareNetworkInterface(networkInterface, NetworkInterface.fromPb(networkInterface.toPb())); + } + + @Test + public void testSetProjectId() { + NetworkInterface networkInterface = NetworkInterface.of(NETWORK); + compareNetworkInterface(networkInterface, + NetworkInterface.of(NetworkId.of("network")).setProjectId("project")); + networkInterface = NETWORK_INTERFACE.toBuilder() + .setNetwork(NetworkId.of("network")) + .setSubnetwork(SubnetworkId.of("region", "subnetwork")) + .build(); + compareNetworkInterface(NETWORK_INTERFACE, networkInterface.setProjectId("project")); + } + + public void compareAccessConfig(AccessConfig expected, AccessConfig value) { + assertEquals(expected, value); + assertEquals(expected.getName(), value.getName()); + assertEquals(expected.getNatIp(), value.getNatIp()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + } + + public void compareNetworkInterface(NetworkInterface expected, NetworkInterface value) { + assertEquals(expected, value); + assertEquals(expected.getName(), value.getName()); + assertEquals(expected.getNetwork(), value.getNetwork()); + assertEquals(expected.getNetworkIp(), value.getNetworkIp()); + assertEquals(expected.getSubnetwork(), value.getSubnetwork()); + assertEquals(expected.getAccessConfigurations(), value.getAccessConfigurations()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java new file mode 100644 index 000000000000..86ea9fb61a76 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/NetworkTest.java @@ -0,0 +1,259 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class NetworkTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final SubnetworkId SUBNETWORK1 = SubnetworkId.of("project", "region1", "network1"); + private static final SubnetworkId SUBNETWORK2 = SubnetworkId.of("project", "region2", "network2"); + private static final List SUBNETWORKS = ImmutableList.of(SUBNETWORK1, SUBNETWORK2); + private static final String GATEWAY_ADDRESS = "192.168.1.1"; + private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); + private static final String IP_RANGE = "192.168.0.0/16"; + private static final Boolean AUTO_CREATE_SUBNETWORKS = true; + private static final StandardNetworkConfiguration NETWORK_CONFIGURATION = + new StandardNetworkConfiguration(IP_RANGE, GATEWAY_ADDRESS); + private static final SubnetNetworkConfiguration SUBNET_NETWORK_CONFIGURATION = + new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Network network; + private Network standardNetwork; + private Network subnetNetwork; + + private void initializeExpectedNetwork(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + standardNetwork = + new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, NETWORK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .build(); + subnetNetwork = + new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, SUBNET_NETWORK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeNetwork() { + network = new Network.Builder(compute, NETWORK_ID, NETWORK_CONFIGURATION) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .build(); + } + + @Test + public void testToBuilder() { + initializeExpectedNetwork(9); + compareNetwork(standardNetwork, standardNetwork.toBuilder().build()); + Network newNetwork = standardNetwork.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newNetwork.getDescription()); + newNetwork = newNetwork.toBuilder().setDescription("description").build(); + compareNetwork(standardNetwork, newNetwork); + } + + @Test + public void testToBuilderIncomplete() { + initializeExpectedNetwork(6); + NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); + Network network = + new Network(serviceMockReturnsOptions, new NetworkInfo.BuilderImpl(networkInfo)); + compareNetwork(network, network.toBuilder().build()); + } + + @Test + public void testBuilder() { + initializeExpectedNetwork(2); + assertEquals(GENERATED_ID, standardNetwork.getGeneratedId()); + assertEquals(NETWORK_ID, standardNetwork.getNetworkId()); + assertEquals(CREATION_TIMESTAMP, standardNetwork.getCreationTimestamp()); + assertEquals(DESCRIPTION, standardNetwork.getDescription()); + assertEquals(NETWORK_CONFIGURATION, standardNetwork.getConfiguration()); + assertSame(serviceMockReturnsOptions, standardNetwork.getCompute()); + assertEquals(GENERATED_ID, subnetNetwork.getGeneratedId()); + assertEquals(NETWORK_ID, subnetNetwork.getNetworkId()); + assertEquals(CREATION_TIMESTAMP, subnetNetwork.getCreationTimestamp()); + assertEquals(DESCRIPTION, subnetNetwork.getDescription()); + assertEquals(SUBNET_NETWORK_CONFIGURATION, subnetNetwork.getConfiguration()); + assertSame(serviceMockReturnsOptions, subnetNetwork.getCompute()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedNetwork(12); + compareNetwork(standardNetwork, + Network.fromPb(serviceMockReturnsOptions, standardNetwork.toPb())); + compareNetwork(subnetNetwork, + Network.fromPb(serviceMockReturnsOptions, subnetNetwork.toPb())); + Network network = + new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, NETWORK_CONFIGURATION).build(); + compareNetwork(network, Network.fromPb(serviceMockReturnsOptions, network.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedNetwork(3); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + expect(compute.deleteNetwork(NETWORK_ID.getNetwork())).andReturn(operation); + replay(compute); + initializeNetwork(); + assertSame(operation, network.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedNetwork(2); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteNetwork(NETWORK_ID.getNetwork())).andReturn(null); + replay(compute); + initializeNetwork(); + assertNull(network.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedNetwork(2); + Compute.NetworkOption[] expectedOptions = {Compute.NetworkOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getNetwork(NETWORK_ID.getNetwork(), expectedOptions)) + .andReturn(standardNetwork); + replay(compute); + initializeNetwork(); + assertTrue(network.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedNetwork(2); + Compute.NetworkOption[] expectedOptions = {Compute.NetworkOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getNetwork(NETWORK_ID.getNetwork(), expectedOptions)).andReturn(null); + replay(compute); + initializeNetwork(); + assertFalse(network.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedNetwork(4); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getNetwork(NETWORK_ID.getNetwork())).andReturn(standardNetwork); + replay(compute); + initializeNetwork(); + Network updatedNetwork = network.reload(); + compareNetwork(standardNetwork, updatedNetwork); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedNetwork(2); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getNetwork(NETWORK_ID.getNetwork())).andReturn(null); + replay(compute); + initializeNetwork(); + assertNull(network.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedNetwork(4); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getNetwork(NETWORK_ID.getNetwork(), Compute.NetworkOption.fields())) + .andReturn(standardNetwork); + replay(compute); + initializeNetwork(); + Network updatedNetwork = network.reload(Compute.NetworkOption.fields()); + compareNetwork(standardNetwork, updatedNetwork); + verify(compute); + } + + @Test + public void testCreateSubnetwork() throws Exception { + initializeExpectedNetwork(3); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(RegionOperationId.of(SUBNETWORK1.getRegionId(), "op")) + .build(); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.create(SubnetworkInfo.of(SUBNETWORK1, NETWORK_ID, IP_RANGE))) + .andReturn(operation); + replay(compute); + initializeNetwork(); + assertSame(operation, network.createSubnetwork(SUBNETWORK1, IP_RANGE)); + verify(compute); + } + + @Test + public void testCreateSubnetworkWithOptions() throws Exception { + initializeExpectedNetwork(3); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(RegionOperationId.of(SUBNETWORK1.getRegionId(), "op")) + .build(); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.create(SubnetworkInfo.of(SUBNETWORK1, NETWORK_ID, IP_RANGE), + Compute.OperationOption.fields())).andReturn(operation); + replay(compute); + initializeNetwork(); + assertSame(operation, + network.createSubnetwork(SUBNETWORK1, IP_RANGE, Compute.OperationOption.fields())); + verify(compute); + } + + public void compareNetwork(Network expected, Network value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getNetworkId(), value.getNetworkId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getConfiguration(), value.getConfiguration()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java new file mode 100644 index 000000000000..5b375d6be5f3 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationIdTest.java @@ -0,0 +1,169 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class OperationIdTest { + + private static final String PROJECT = "project"; + private static final String ZONE = "zone"; + private static final String REGION = "region"; + private static final String NAME = "op"; + private static final String GLOBAL_URL = + "https://www.googleapis.com/compute/v1/projects/project/global/operations/op"; + private static final String ZONE_URL = + "https://www.googleapis.com/compute/v1/projects/project/zones/zone/operations/op"; + private static final String REGION_URL = + "https://www.googleapis.com/compute/v1/projects/project/regions/region/operations/op"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + GlobalOperationId operationId = GlobalOperationId.of(PROJECT, NAME); + assertEquals(OperationId.Type.GLOBAL, operationId.getType()); + assertEquals(PROJECT, operationId.getProject()); + assertEquals(NAME, operationId.getOperation()); + assertEquals(GLOBAL_URL, operationId.getSelfLink()); + operationId = GlobalOperationId.of(NAME); + assertEquals(OperationId.Type.GLOBAL, operationId.getType()); + assertNull(operationId.getProject()); + assertEquals(NAME, operationId.getOperation()); + ZoneOperationId zoneOperationId = ZoneOperationId.of(PROJECT, ZONE, NAME); + assertEquals(OperationId.Type.ZONE, zoneOperationId.getType()); + assertEquals(PROJECT, zoneOperationId.getProject()); + assertEquals(ZONE, zoneOperationId.getZone()); + assertEquals(NAME, zoneOperationId.getOperation()); + assertEquals(ZONE_URL, zoneOperationId.getSelfLink()); + zoneOperationId = ZoneOperationId.of(ZONE, NAME); + assertEquals(OperationId.Type.ZONE, zoneOperationId.getType()); + assertNull(zoneOperationId.getProject()); + assertEquals(ZONE, zoneOperationId.getZone()); + assertEquals(NAME, zoneOperationId.getOperation()); + zoneOperationId = ZoneOperationId.of(ZoneId.of(PROJECT, ZONE), NAME); + assertEquals(OperationId.Type.ZONE, zoneOperationId.getType()); + assertEquals(PROJECT, zoneOperationId.getProject()); + assertEquals(ZONE, zoneOperationId.getZone()); + assertEquals(NAME, zoneOperationId.getOperation()); + RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME); + assertEquals(OperationId.Type.REGION, regionOperationId.getType()); + assertEquals(PROJECT, regionOperationId.getProject()); + assertEquals(REGION, regionOperationId.getRegion()); + assertEquals(NAME, regionOperationId.getOperation()); + assertEquals(REGION_URL, regionOperationId.getSelfLink()); + regionOperationId = RegionOperationId.of(REGION, NAME); + assertEquals(OperationId.Type.REGION, regionOperationId.getType()); + assertNull(regionOperationId.getProject()); + assertEquals(REGION, regionOperationId.getRegion()); + assertEquals(NAME, regionOperationId.getOperation()); + regionOperationId = RegionOperationId.of(RegionId.of(PROJECT, REGION), NAME); + assertEquals(OperationId.Type.REGION, regionOperationId.getType()); + assertEquals(PROJECT, regionOperationId.getProject()); + assertEquals(REGION, regionOperationId.getRegion()); + assertEquals(NAME, regionOperationId.getOperation()); + } + + @Test + public void testToAndFromUrlGlobal() { + GlobalOperationId operationId = GlobalOperationId.of(PROJECT, NAME); + compareOperationId(operationId, GlobalOperationId.fromUrl(operationId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid global operation URL"); + GlobalOperationId.fromUrl("notMatchingUrl"); + } + + @Test + public void testToAndFromUrlRegion() { + RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME); + compareRegionOperationId(regionOperationId, + RegionOperationId.fromUrl(regionOperationId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid region operation URL"); + RegionOperationId.fromUrl("notMatchingUrl"); + } + + @Test + public void testToAndFromUrlZone() { + ZoneOperationId zoneOperationId = ZoneOperationId.of(PROJECT, ZONE, NAME); + compareZoneOperationId(zoneOperationId, ZoneOperationId.fromUrl(zoneOperationId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid zone operation URL"); + ZoneOperationId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + GlobalOperationId operationId = GlobalOperationId.of(PROJECT, NAME); + assertSame(operationId, operationId.setProjectId(PROJECT)); + compareOperationId(operationId, GlobalOperationId.of(NAME).setProjectId(PROJECT)); + ZoneOperationId zoneOperationId = ZoneOperationId.of(PROJECT, ZONE, NAME); + assertSame(zoneOperationId, zoneOperationId.setProjectId(PROJECT)); + compareZoneOperationId(zoneOperationId, ZoneOperationId.of(ZONE, NAME).setProjectId(PROJECT)); + RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME); + assertSame(regionOperationId, regionOperationId.setProjectId(PROJECT)); + compareRegionOperationId(regionOperationId, + RegionOperationId.of(REGION, NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(GlobalOperationId.matchesUrl(GlobalOperationId.of(PROJECT, NAME).getSelfLink())); + assertFalse(GlobalOperationId.matchesUrl("notMatchingUrl")); + assertTrue( + RegionOperationId.matchesUrl(RegionOperationId.of(PROJECT, REGION, NAME).getSelfLink())); + assertFalse(RegionOperationId.matchesUrl("notMatchingUrl")); + assertTrue(ZoneOperationId.matchesUrl(ZoneOperationId.of(PROJECT, REGION, NAME).getSelfLink())); + assertFalse(ZoneOperationId.matchesUrl("notMatchingUrl")); + } + + private void compareOperationId(GlobalOperationId expected, GlobalOperationId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getOperation(), expected.getOperation()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } + + private void compareZoneOperationId(ZoneOperationId expected, ZoneOperationId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getZone(), expected.getZone()); + assertEquals(expected.getOperation(), expected.getOperation()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } + + private void compareRegionOperationId(RegionOperationId expected, RegionOperationId value) { + assertEquals(expected, value); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getRegion(), expected.getRegion()); + assertEquals(expected.getOperation(), expected.getOperation()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java new file mode 100644 index 000000000000..60798c55ce8a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/OperationTest.java @@ -0,0 +1,518 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.api.core.ApiClock; +import com.google.api.core.CurrentMillisClock; +import com.google.cloud.RetryOption; +import com.google.cloud.compute.deprecated.Operation.OperationError; +import com.google.cloud.compute.deprecated.Operation.OperationWarning; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +import org.junit.After; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import java.util.List; +import org.threeten.bp.Duration; + +public class OperationTest { + + private static final OperationError OPERATION_ERROR1 = + new OperationError("code1", "location1", "message1"); + private static final OperationError OPERATION_ERROR2 = + new OperationError("code2", "location2", "message2"); + private static final OperationWarning OPERATION_WARNING1 = + new OperationWarning("code1", "message1", ImmutableMap.of("k1", "v1")); + private static final OperationWarning OPERATION_WARNING2 = + new OperationWarning("code2", "location2", ImmutableMap.of("k2", "v2")); + private static final String GENERATED_ID = "1"; + private static final String CLIENT_OPERATION_ID = "clientOperationId"; + private static final String OPERATION_TYPE = "delete"; + private static final String TARGET_LINK = "targetLink"; + private static final String TARGET_ID = "42"; + private static final Operation.Status STATUS = Operation.Status.DONE; + private static final String STATUS_MESSAGE = "statusMessage"; + private static final String USER = "user"; + private static final Integer PROGRESS = 100; + private static final Long INSERT_TIME = 1453293540000L; + private static final Long START_TIME = 1453293420000L; + private static final Long END_TIME = 1453293480000L; + private static final List ERRORS = + ImmutableList.of(OPERATION_ERROR1, OPERATION_ERROR2); + private static final List WARNINGS = + ImmutableList.of(OPERATION_WARNING1, OPERATION_WARNING2); + private static final Integer HTTP_ERROR_STATUS_CODE = 404; + private static final String HTTP_ERROR_MESSAGE = "NOT FOUND"; + private static final String DESCRIPTION = "description"; + private static final GlobalOperationId GLOBAL_OPERATION_ID = + GlobalOperationId.of("project", "op"); + private static final ZoneOperationId ZONE_OPERATION_ID = + ZoneOperationId.of("project", "zone", "op"); + private static final RegionOperationId REGION_OPERATION_ID = + RegionOperationId.of("project", "region", "op"); + + @Rule + public final ExpectedException thrown = ExpectedException.none(); + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Operation globalOperation; + private Operation regionOperation; + private Operation zoneOperation; + private Operation operation; + + private void initializeExpectedOperation(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + globalOperation = new Operation.Builder(serviceMockReturnsOptions) + .getGeneratedId(GENERATED_ID) + .setOperationId(GLOBAL_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + zoneOperation = new Operation.Builder(serviceMockReturnsOptions) + .getGeneratedId(GENERATED_ID) + .setOperationId(ZONE_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + regionOperation = new Operation.Builder(serviceMockReturnsOptions) + .getGeneratedId(GENERATED_ID) + .setOperationId(REGION_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeOperation() { + operation = new Operation.Builder(compute) + .getGeneratedId(GENERATED_ID) + .setOperationId(GLOBAL_OPERATION_ID) + .setClientOperationId(CLIENT_OPERATION_ID) + .setOperationType(OPERATION_TYPE) + .setTargetLink(TARGET_LINK) + .setTargetId(TARGET_ID) + .setStatus(STATUS) + .setStatusMessage(STATUS_MESSAGE) + .setUser(USER) + .setProgress(PROGRESS) + .setInsertTime(INSERT_TIME) + .setStartTime(START_TIME) + .setEndTime(END_TIME) + .setErrors(ERRORS) + .setWarnings(WARNINGS) + .setHttpErrorStatusCode(HTTP_ERROR_STATUS_CODE) + .setHttpErrorMessage(HTTP_ERROR_MESSAGE) + .setDescription(DESCRIPTION) + .build(); + } + + @After + public void tearDown() throws Exception { + verify(serviceMockReturnsOptions); + } + + private void assertEqualsCommonFields(Operation operation) { + assertEquals(GENERATED_ID, operation.getGeneratedId()); + assertEquals(CLIENT_OPERATION_ID, operation.getClientOperationId()); + assertEquals(OPERATION_TYPE, operation.getOperationType()); + assertEquals(TARGET_LINK, operation.getTargetLink()); + assertEquals(TARGET_ID, operation.getTargetId()); + assertEquals(STATUS, operation.getStatus()); + assertEquals(STATUS_MESSAGE, operation.getStatusMessage()); + assertEquals(USER, operation.getUser()); + assertEquals(PROGRESS, operation.getProgress()); + assertEquals(INSERT_TIME, operation.getInsertTime()); + assertEquals(START_TIME, operation.getStartTime()); + assertEquals(END_TIME, operation.getEndTime()); + assertEquals(ERRORS, operation.getErrors()); + assertEquals(WARNINGS, operation.getWarnings()); + assertEquals(HTTP_ERROR_STATUS_CODE, globalOperation.getHttpErrorStatusCode()); + assertEquals(HTTP_ERROR_MESSAGE, globalOperation.getHttpErrorMessage()); + assertEquals(DESCRIPTION, globalOperation.getDescription()); + assertSame(serviceMockReturnsOptions, globalOperation.getCompute()); + } + + private void assertNullCommonFields(Operation operation) { + assertNull(operation.getGeneratedId()); + assertNull(operation.getClientOperationId()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getErrors()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorStatusCode()); + assertNull(operation.getHttpErrorMessage()); + assertNull(operation.getDescription()); + assertSame(serviceMockReturnsOptions, operation.getCompute()); + } + + @Test + public void testBuilder() { + initializeExpectedOperation(6); + assertEqualsCommonFields(globalOperation); + assertEquals(GLOBAL_OPERATION_ID, globalOperation.getOperationId()); + assertEqualsCommonFields(regionOperation); + assertEquals(REGION_OPERATION_ID, regionOperation.getOperationId()); + assertEqualsCommonFields(zoneOperation); + assertEquals(ZONE_OPERATION_ID, zoneOperation.getOperationId()); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GLOBAL_OPERATION_ID) + .build(); + assertNullCommonFields(operation); + assertEquals(GLOBAL_OPERATION_ID, operation.getOperationId()); + operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZONE_OPERATION_ID) + .build(); + assertNullCommonFields(operation); + assertEquals(ZONE_OPERATION_ID, operation.getOperationId()); + operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(REGION_OPERATION_ID) + .build(); + assertNullCommonFields(operation); + assertEquals(REGION_OPERATION_ID, operation.getOperationId()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedOperation(24); + compareOperation(globalOperation, + Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb())); + assertNotNull(regionOperation.toPb().getRegion()); + compareOperation(regionOperation, + Operation.fromPb(serviceMockReturnsOptions, regionOperation.toPb())); + assertNotNull(zoneOperation.toPb().getZone()); + compareOperation(zoneOperation, + Operation.fromPb(serviceMockReturnsOptions, zoneOperation.toPb())); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GLOBAL_OPERATION_ID) + .build(); + compareOperation(operation, Operation.fromPb(serviceMockReturnsOptions, operation.toPb())); + operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(ZONE_OPERATION_ID) + .build(); + compareOperation(operation, Operation.fromPb(serviceMockReturnsOptions, operation.toPb())); + operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(REGION_OPERATION_ID) + .build(); + compareOperation(operation, Operation.fromPb(serviceMockReturnsOptions, operation.toPb())); + } + + @Test + public void testDeleteTrue() { + initializeExpectedOperation(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteOperation(GLOBAL_OPERATION_ID)).andReturn(true); + replay(compute); + initializeOperation(); + assertTrue(operation.delete()); + verify(compute); + } + + @Test + public void testDeleteFalse() { + initializeExpectedOperation(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteOperation(GLOBAL_OPERATION_ID)).andReturn(false); + replay(compute); + initializeOperation(); + assertFalse(operation.delete()); + verify(compute); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedOperation(3); + Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); + replay(compute); + initializeOperation(); + assertTrue(operation.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedOperation(3); + Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeOperation(); + assertFalse(operation.exists()); + verify(compute); + } + + @Test + public void testIsDone_True() throws Exception { + initializeExpectedOperation(3); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); + replay(compute); + initializeOperation(); + assertTrue(operation.isDone()); + verify(compute); + } + + @Test + public void testIsDone_False() throws Exception { + initializeExpectedOperation(4); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn( + Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setStatus("PENDING"))); + replay(compute); + initializeOperation(); + assertFalse(operation.isDone()); + verify(compute); + } + @Test + public void testIsDone_NotExists() throws Exception { + initializeExpectedOperation(3); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeOperation(); + assertTrue(operation.isDone()); + verify(compute); + } + + @Test + public void testWaitFor() throws InterruptedException { + initializeExpectedOperation(4); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + Operation successOperation = + Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setError(null)); + expect(compute.getOptions()).andReturn(mockOptions); + expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(successOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(successOperation); + replay(compute, mockOptions); + initializeOperation(); + assertSame(successOperation, operation.waitFor()); + verify(mockOptions); + } + + @Test + public void testWaitFor_Null() throws InterruptedException { + initializeExpectedOperation(3); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(null); + replay(compute, mockOptions); + initializeOperation(); + assertNull(operation.waitFor()); + verify(mockOptions); + } + + @Test + public void testWaitForCheckingPeriod() throws InterruptedException { + initializeExpectedOperation(5); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + Operation runningOperation = Operation.fromPb(serviceMockReturnsOptions, + globalOperation.toPb().setError(null).setStatus("RUNNING")); + Operation completedOperation = + Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setError(null)); + expect(compute.getOptions()).andReturn(mockOptions); + expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)) + .andReturn(completedOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(completedOperation); + replay(compute, mockOptions); + initializeOperation(); + assertSame( + completedOperation, operation.waitFor(RetryOption.initialRetryDelay(Duration.ofMillis(1)))); + verify(mockOptions); + } + + @Test + public void testWaitForCheckingPeriod_Null() throws InterruptedException { + initializeExpectedOperation(4); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + Operation runningOperation = Operation.fromPb(serviceMockReturnsOptions, + globalOperation.toPb().setError(null).setStatus("RUNNING")); + expect(compute.getOptions()).andReturn(mockOptions); + expect(mockOptions.getClock()).andReturn(CurrentMillisClock.getDefaultClock()); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); + replay(compute, mockOptions); + initializeOperation(); + assertNull(operation.waitFor(RetryOption.initialRetryDelay(Duration.ofMillis(1L)))); + verify(compute, mockOptions); + } + + @Test + public void testWaitForWithTimeout() throws InterruptedException { + initializeExpectedOperation(4); + Compute.OperationOption[] expectedOptions = + {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; + ApiClock clock = createStrictMock(ApiClock.class); + expect(clock.nanoTime()).andReturn(0L); + expect(clock.nanoTime()).andReturn(1_000_000L); + expect(clock.nanoTime()).andReturn(3_000_000L); + Operation runningOperation = Operation.fromPb(serviceMockReturnsOptions, + globalOperation.toPb().setError(null).setStatus("RUNNING")); + expect(compute.getOptions()).andReturn(mockOptions); + expect(mockOptions.getClock()).andReturn(clock); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(runningOperation); + replay(compute, clock, mockOptions); + initializeOperation(); + thrown.expect(ComputeException.class); + operation.waitFor(RetryOption.initialRetryDelay(Duration.ofMillis(1L)), + RetryOption.totalTimeout(Duration.ofMillis(3L))); + verify(compute, clock, mockOptions); + } + + @Test + public void testReload() throws Exception { + initializeExpectedOperation(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(globalOperation); + replay(compute); + initializeOperation(); + Operation updatedOperation = operation.reload(); + compareOperation(globalOperation, updatedOperation); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedOperation(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(null); + replay(compute); + initializeOperation(); + assertNull(operation.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedOperation(5); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getOperation(GLOBAL_OPERATION_ID, Compute.OperationOption.fields())) + .andReturn(globalOperation); + replay(compute); + initializeOperation(); + Operation updatedOperation = operation.reload(Compute.OperationOption.fields()); + compareOperation(globalOperation, updatedOperation); + verify(compute); + } + + private void compareOperation(Operation expected, Operation value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getOperationId(), value.getOperationId()); + assertEquals(expected.getClientOperationId(), value.getClientOperationId()); + assertEquals(expected.getOperationType(), value.getOperationType()); + assertEquals(expected.getTargetLink(), value.getTargetLink()); + assertEquals(expected.getTargetId(), value.getTargetId()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getStatusMessage(), value.getStatusMessage()); + assertEquals(expected.getUser(), value.getUser()); + assertEquals(expected.getProgress(), value.getProgress()); + assertEquals(expected.getInsertTime(), value.getInsertTime()); + assertEquals(expected.getStartTime(), value.getStartTime()); + assertEquals(expected.getEndTime(), value.getEndTime()); + assertEquals(expected.getErrors(), value.getErrors()); + assertEquals(expected.getWarnings(), value.getWarnings()); + assertEquals(expected.getHttpErrorStatusCode(), value.getHttpErrorStatusCode()); + assertEquals(expected.getHttpErrorMessage(), value.getHttpErrorMessage()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java new file mode 100644 index 000000000000..428ce46b0221 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionIdTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class RegionIdTest { + + private static final String PROJECT = "project"; + private static final String REGION = "region"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/regions/region"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + RegionId regionId = RegionId.of(PROJECT, REGION); + assertEquals(PROJECT, regionId.getProject()); + assertEquals(REGION, regionId.getRegion()); + assertEquals(URL, regionId.getSelfLink()); + regionId = RegionId.of(REGION); + assertNull(regionId.getProject()); + assertEquals(REGION, regionId.getRegion()); + } + + @Test + public void testToAndFromUrl() { + RegionId regionId = RegionId.of(PROJECT, REGION); + compareRegionId(regionId, RegionId.fromUrl(regionId.getSelfLink())); + } + + @Test + public void testSetProjectId() { + RegionId regionId = RegionId.of(PROJECT, REGION); + assertSame(regionId, regionId.setProjectId(PROJECT)); + compareRegionId(regionId, RegionId.of(REGION).setProjectId(PROJECT)); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid region URL"); + RegionId.fromUrl("notMatchingUrl"); + } + + @Test + public void testMatchesUrl() { + assertTrue(RegionId.matchesUrl(RegionId.of(PROJECT, REGION).getSelfLink())); + assertFalse(RegionId.matchesUrl("notMatchingUrl")); + } + + private void compareRegionId(RegionId expected, RegionId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getRegion(), expected.getRegion()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java new file mode 100644 index 000000000000..adef3a7d7318 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/RegionTest.java @@ -0,0 +1,89 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class RegionTest { + + private static final RegionId REGION_ID = RegionId.of("project", "region"); + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final Region.Status STATUS = Region.Status.DOWN; + private static final ZoneId ZONE_ID1 = ZoneId.of("project", "zone1"); + private static final ZoneId ZONE_ID2 = ZoneId.of("project", "zone2"); + private static final List ZONES = ImmutableList.of(ZONE_ID1, ZONE_ID2); + private static final Region.Quota QUOTA1 = + new Region.Quota("METRIC1", 2, 1); + private static final Region.Quota QUOTA2 = + new Region.Quota("METRIC2", 4, 3); + private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, REGION_ID); + private static final Region REGION = Region.builder() + .setRegionId(REGION_ID) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setZones(ZONES) + .setQuotas(QUOTAS) + .setDeprecationStatus(DEPRECATION_STATUS) + .build(); + + @Test + public void testBuilder() { + assertEquals(REGION_ID, REGION.getRegionId()); + assertEquals(GENERATED_ID, REGION.getGeneratedId()); + assertEquals(CREATION_TIMESTAMP, REGION.getCreationTimestamp()); + assertEquals(DESCRIPTION, REGION.getDescription()); + assertEquals(STATUS, REGION.getStatus()); + assertEquals(ZONES, REGION.getZones()); + assertEquals(QUOTAS, REGION.getQuotas()); + assertEquals(DEPRECATION_STATUS, REGION.getDeprecationStatus()); + } + + @Test + public void testToAndFromPb() { + Region region = Region.fromPb(REGION.toPb()); + compareRegions(REGION, region); + assertEquals(REGION_ID.getProject(), region.getRegionId().getProject()); + assertEquals(REGION_ID.getRegion(), region.getRegionId().getRegion()); + region = Region.builder().setRegionId(REGION_ID).build(); + compareRegions(region, Region.fromPb(region.toPb())); + } + + private void compareRegions(Region expected, Region value) { + assertEquals(expected, value); + assertEquals(expected.getRegionId(), value.getRegionId()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getZones(), value.getZones()); + assertEquals(expected.getQuotas(), value.getQuotas()); + assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java new file mode 100644 index 000000000000..628e723da7f8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SchedulingOptionsTest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class SchedulingOptionsTest { + + private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); + + @Test + public void testFactoryMethods() { + assertTrue(SCHEDULING_OPTIONS.isPreemptible()); + assertFalse(SCHEDULING_OPTIONS.automaticRestart()); + assertEquals(SchedulingOptions.Maintenance.TERMINATE, SCHEDULING_OPTIONS.getMaintenance()); + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + assertFalse(schedulingOptions.isPreemptible()); + assertTrue(schedulingOptions.automaticRestart()); + assertEquals(SchedulingOptions.Maintenance.MIGRATE, schedulingOptions.getMaintenance()); + } + + @Test + public void testToAndFromPb() { + compareSchedulingOptions(SCHEDULING_OPTIONS, + SchedulingOptions.fromPb(SCHEDULING_OPTIONS.toPb())); + SchedulingOptions schedulingOptions = + SchedulingOptions.standard(true, SchedulingOptions.Maintenance.MIGRATE); + compareSchedulingOptions(schedulingOptions, SchedulingOptions.fromPb(schedulingOptions.toPb())); + } + + public void compareSchedulingOptions(SchedulingOptions expected, SchedulingOptions value) { + assertEquals(expected, value); + assertEquals(expected.isPreemptible(), value.isPreemptible()); + assertEquals(expected.getMaintenance(), value.getMaintenance()); + assertEquals(expected.automaticRestart(), value.automaticRestart()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java new file mode 100644 index 000000000000..28fdc44c5482 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SerializationTest.java @@ -0,0 +1,304 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import com.google.cloud.BaseSerializationTest; +import com.google.cloud.NoCredentials; +import com.google.cloud.Restorable; +import com.google.cloud.ServiceOptions; +import com.google.cloud.compute.deprecated.AttachedDisk.CreateDiskConfiguration; +import com.google.cloud.compute.deprecated.AttachedDisk.PersistentDiskConfiguration; +import com.google.cloud.compute.deprecated.AttachedDisk.ScratchDiskConfiguration; +import com.google.cloud.compute.deprecated.NetworkInterface.AccessConfig; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +import java.io.Serializable; +import java.util.List; + +public class SerializationTest extends BaseSerializationTest { + + private static final Compute COMPUTE = ComputeOptions.newBuilder().setProjectId("p").build().getService(); + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final String VALID_DISK_SIZE = "10GB-10TB"; + private static final Long DEFAULT_DISK_SIZE_GB = 10L; + private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); + private static final DiskType DISK_TYPE = DiskType.newBuilder() + .setDiskTypeId(DISK_TYPE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setValidDiskSize(VALID_DISK_SIZE) + .setDefaultDiskSizeGb(DEFAULT_DISK_SIZE_GB) + .build(); + private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); + private static final Integer GUEST_CPUS = 1; + private static final Integer MEMORY_MB = 2; + private static final List SCRATCH_DISKS = ImmutableList.of(3); + private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; + private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; + private static final MachineType MACHINE_TYPE = MachineType.newBuilder() + .setMachineTypeId(MACHINE_TYPE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setCpus(GUEST_CPUS) + .setMemoryMb(MEMORY_MB) + .setScratchDisksSizeGb(SCRATCH_DISKS) + .setMaximumPersistentDisks(MAXIMUM_PERSISTENT_DISKS) + .setMaximumPersistentDisksSizeGb(MAXIMUM_PERSISTENT_DISKS_SIZE_GB) + .build(); + private static final RegionId REGION_ID = RegionId.of("project", "region"); + private static final Region.Status REGION_STATUS = Region.Status.DOWN; + private static final ZoneId ZONE_ID1 = ZoneId.of("project", "zone1"); + private static final ZoneId ZONE_ID2 = ZoneId.of("project", "zone2"); + private static final List ZONES = ImmutableList.of(ZONE_ID1, ZONE_ID2); + private static final Region.Quota QUOTA1 = + new Region.Quota("METRIC1", 2, 1); + private static final Region.Quota QUOTA2 = + new Region.Quota("METRIC2", 4, 3); + private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); + private static final Region REGION = Region.builder() + .setRegionId(REGION_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(REGION_STATUS) + .setZones(ZONES) + .setQuotas(QUOTAS) + .build(); + private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); + private static final Zone.Status ZONE_STATUS = Zone.Status.DOWN; + private static final Zone ZONE = Zone.builder() + .setZoneId(ZONE_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(ZONE_STATUS) + .setRegion(REGION_ID) + .build(); + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, MACHINE_TYPE_ID); + private static final LicenseId LICENSE_ID = LicenseId.of("project", "license"); + private static final Boolean CHARGES_USE_FEE = true; + private static final License LICENSE = new License(LICENSE_ID, CHARGES_USE_FEE); + private static final GlobalOperationId GLOBAL_OPERATION_ID = + GlobalOperationId.of("project", "op"); + private static final ZoneOperationId ZONE_OPERATION_ID = + ZoneOperationId.of("project", "zone", "op"); + private static final RegionOperationId REGION_OPERATION_ID = + RegionOperationId.of("project", "region", "op"); + private static final Operation GLOBAL_OPERATION = + new Operation.Builder(COMPUTE).setOperationId(GLOBAL_OPERATION_ID).build(); + private static final Operation ZONE_OPERATION = + new Operation.Builder(COMPUTE).setOperationId(ZONE_OPERATION_ID).build(); + private static final Operation REGION_OPERATION = + new Operation.Builder(COMPUTE).setOperationId(REGION_OPERATION_ID).build(); + private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); + private static final GlobalForwardingRuleId GLOBAL_FORWARDING_RULE_ID = + GlobalForwardingRuleId.of("project", "rule"); + private static final RegionForwardingRuleId REGION_FORWARDING_RULE_ID = + RegionForwardingRuleId.of("project", "region", "rule"); + private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); + private static final RegionAddressId REGION_ADDRESS_ID = + RegionAddressId.of("project", "region", "address"); + private static final AddressInfo.InstanceUsage INSTANCE_USAGE = + new AddressInfo.InstanceUsage(INSTANCE_ID); + private static final AddressInfo.GlobalForwardingUsage GLOBAL_FORWARDING_USAGE = + new AddressInfo.GlobalForwardingUsage(ImmutableList.of(GLOBAL_FORWARDING_RULE_ID)); + private static final AddressInfo.RegionForwardingUsage REGION_FORWARDING_USAGE = + new AddressInfo.RegionForwardingUsage(ImmutableList.of(REGION_FORWARDING_RULE_ID)); + private static final AddressInfo ADDRESS_INFO = AddressInfo.newBuilder(REGION_ADDRESS_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setUsage(INSTANCE_USAGE) + .build(); + private static final Address ADDRESS = new Address.Builder(COMPUTE, REGION_ADDRESS_ID).build(); + private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); + private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); + private static final SnapshotInfo SNAPSHOT_INFO = SnapshotInfo.of(SNAPSHOT_ID, DISK_ID); + private static final Snapshot SNAPSHOT = + new Snapshot.Builder(COMPUTE, SNAPSHOT_ID, DISK_ID).build(); + private static final ImageId IMAGE_ID = ImageId.of("project", "image"); + private static final DiskImageConfiguration DISK_IMAGE_CONFIGURATION = + DiskImageConfiguration.of(DISK_ID); + private static final StorageImageConfiguration STORAGE_IMAGE_CONFIGURATION = + StorageImageConfiguration.of("gs:/bucket/file"); + private static final ImageInfo IMAGE_INFO = ImageInfo.of(IMAGE_ID, DISK_IMAGE_CONFIGURATION); + private static final Image IMAGE = + new Image.Builder(COMPUTE, IMAGE_ID, DISK_IMAGE_CONFIGURATION).build(); + private static final StandardDiskConfiguration STANDARD_DISK_CONFIGURATION = + StandardDiskConfiguration.of(DISK_TYPE_ID); + private static final ImageDiskConfiguration IMAGE_DISK_CONFIGURATION = + ImageDiskConfiguration.of(IMAGE_ID); + private static final SnapshotDiskConfiguration SNAPSHOT_DISK_CONFIGURATION = + SnapshotDiskConfiguration.of(SNAPSHOT_ID); + private static final DiskInfo DISK_INFO = DiskInfo.of(DISK_ID, STANDARD_DISK_CONFIGURATION); + private static final Disk DISK = + new Disk.Builder(COMPUTE, DISK_ID, STANDARD_DISK_CONFIGURATION).build(); + private static final SubnetworkId SUBNETWORK_ID = + SubnetworkId.of("project", "region", "subnetwork"); + private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); + private static final SubnetworkInfo SUBNETWORK_INFO = + SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, "192.168.0.0/16"); + private static final Subnetwork SUBNETWORK = + new Subnetwork.Builder(COMPUTE, SUBNETWORK_ID, NETWORK_ID, "192.168.0.0/16").build(); + private static final StandardNetworkConfiguration STANDARD_NETWORK_CONFIGURATION = + StandardNetworkConfiguration.of("192.168.0.0/16"); + private static final SubnetNetworkConfiguration SUBNET_NETWORK_CONFIGURATION = + SubnetNetworkConfiguration.of(false); + private static final NetworkInfo NETWORK_INFO = + NetworkInfo.of(NETWORK_ID, STANDARD_NETWORK_CONFIGURATION); + private static final Network NETWORK = + new Network.Builder(COMPUTE, NETWORK_ID, STANDARD_NETWORK_CONFIGURATION).build(); + private static final AccessConfig ACCESS_CONFIG = AccessConfig.of("192.168.1.1"); + private static final NetworkInterface NETWORK_INTERFACE = NetworkInterface.newBuilder(NETWORK_ID) + .setAccessConfigurations(ACCESS_CONFIG) + .build(); + private static final CreateDiskConfiguration CREATE_DISK_CONFIGURATION = + CreateDiskConfiguration.of(IMAGE_ID); + private static final PersistentDiskConfiguration PERSISTENT_DISK_CONFIGURATION = + PersistentDiskConfiguration.of(DISK_ID); + private static final ScratchDiskConfiguration SCRATCH_DISK_CONFIGURATION = + ScratchDiskConfiguration.of(DISK_TYPE_ID); + private static final AttachedDisk ATTACHED_DISK = AttachedDisk.of(CREATE_DISK_CONFIGURATION); + private static final Tags TAGS = Tags.of("tag1", "tag2"); + private static final Metadata METADATA = Metadata.of(ImmutableMap.of("key1", "val1")); + private static final ServiceAccount SERVICE_ACCOUNT = ServiceAccount.of("email"); + private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); + private static final InstanceInfo INSTANCE_INFO = + InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE_ID, ATTACHED_DISK, NETWORK_INTERFACE); + private static final Instance INSTANCE = + new Instance.Builder(COMPUTE, INSTANCE_ID, MACHINE_TYPE_ID, ATTACHED_DISK, NETWORK_INTERFACE) + .build(); + private static final Compute.DiskTypeOption DISK_TYPE_OPTION = + Compute.DiskTypeOption.fields(); + private static final Compute.DiskTypeFilter DISK_TYPE_FILTER = + Compute.DiskTypeFilter.equals(Compute.DiskTypeField.SELF_LINK, "selfLink"); + private static final Compute.DiskTypeListOption DISK_TYPE_LIST_OPTION = + Compute.DiskTypeListOption.filter(DISK_TYPE_FILTER); + private static final Compute.DiskTypeAggregatedListOption DISK_TYPE_AGGREGATED_LIST_OPTION = + Compute.DiskTypeAggregatedListOption.filter(DISK_TYPE_FILTER); + private static final Compute.MachineTypeOption MACHINE_TYPE_OPTION = + Compute.MachineTypeOption.fields(); + private static final Compute.MachineTypeFilter MACHINE_TYPE_FILTER = + Compute.MachineTypeFilter.equals(Compute.MachineTypeField.SELF_LINK, "selfLink"); + private static final Compute.MachineTypeListOption MACHINE_TYPE_LIST_OPTION = + Compute.MachineTypeListOption.filter(MACHINE_TYPE_FILTER); + private static final Compute.MachineTypeAggregatedListOption MACHINE_TYPE_AGGREGATED_LIST_OPTION = + Compute.MachineTypeAggregatedListOption.filter(MACHINE_TYPE_FILTER); + private static final Compute.RegionOption REGION_OPTION = Compute.RegionOption.fields(); + private static final Compute.RegionFilter REGION_FILTER = + Compute.RegionFilter.equals(Compute.RegionField.SELF_LINK, "selfLink"); + private static final Compute.RegionListOption REGION_LIST_OPTION = + Compute.RegionListOption.filter(REGION_FILTER); + private static final Compute.ZoneOption ZONE_OPTION = Compute.ZoneOption.fields(); + private static final Compute.ZoneFilter ZONE_FILTER = + Compute.ZoneFilter.equals(Compute.ZoneField.SELF_LINK, "selfLink"); + private static final Compute.ZoneListOption ZONE_LIST_OPTION = + Compute.ZoneListOption.filter(ZONE_FILTER); + private static final Compute.LicenseOption LICENSE_OPTION = Compute.LicenseOption.fields(); + private static final Compute.OperationOption OPERATION_OPTION = Compute.OperationOption.fields(); + private static final Compute.OperationFilter OPERATION_FILTER = + Compute.OperationFilter.equals(Compute.OperationField.SELF_LINK, "selfLink"); + private static final Compute.OperationListOption OPERATION_LIST_OPTION = + Compute.OperationListOption.filter(OPERATION_FILTER); + private static final Compute.AddressOption ADDRESS_OPTION = Compute.AddressOption.fields(); + private static final Compute.AddressFilter ADDRESS_FILTER = + Compute.AddressFilter.equals(Compute.AddressField.SELF_LINK, "selfLink"); + private static final Compute.AddressListOption ADDRESS_LIST_OPTION = + Compute.AddressListOption.filter(ADDRESS_FILTER); + private static final Compute.AddressAggregatedListOption ADDRESS_AGGREGATED_LIST_OPTION = + Compute.AddressAggregatedListOption.filter(ADDRESS_FILTER); + private static final Compute.SnapshotOption SNAPSHOT_OPTION = Compute.SnapshotOption.fields(); + private static final Compute.SnapshotFilter SNAPSHOT_FILTER = + Compute.SnapshotFilter.equals(Compute.SnapshotField.SELF_LINK, "selfLink"); + private static final Compute.SnapshotListOption SNAPSHOT_LIST_OPTION = + Compute.SnapshotListOption.filter(SNAPSHOT_FILTER); + private static final Compute.ImageOption IMAGE_OPTION = Compute.ImageOption.fields(); + private static final Compute.ImageFilter IMAGE_FILTER = + Compute.ImageFilter.equals(Compute.ImageField.SELF_LINK, "selfLink"); + private static final Compute.ImageListOption IMAGE_LIST_OPTION = + Compute.ImageListOption.filter(IMAGE_FILTER); + private static final Compute.DiskOption DISK_OPTION = Compute.DiskOption.fields(); + private static final Compute.DiskFilter DISK_FILTER = + Compute.DiskFilter.equals(Compute.DiskField.SELF_LINK, "selfLink"); + private static final Compute.DiskListOption DISK_LIST_OPTION = + Compute.DiskListOption.filter(DISK_FILTER); + private static final Compute.DiskAggregatedListOption DISK_AGGREGATED_LIST_OPTION = + Compute.DiskAggregatedListOption.filter(DISK_FILTER); + private static final Compute.SubnetworkOption SUBNETWORK_OPTION = + Compute.SubnetworkOption.fields(); + private static final Compute.SubnetworkFilter SUBNETWORK_FILTER = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.SELF_LINK, "selfLink"); + private static final Compute.SubnetworkListOption SUBNETWORK_LIST_OPTION = + Compute.SubnetworkListOption.filter(SUBNETWORK_FILTER); + private static final Compute.SubnetworkAggregatedListOption SUBNETWORK_AGGREGATED_LIST_OPTION = + Compute.SubnetworkAggregatedListOption.filter(SUBNETWORK_FILTER); + private static final Compute.NetworkOption NETWORK_OPTION = + Compute.NetworkOption.fields(); + private static final Compute.NetworkFilter NETWORK_FILTER = + Compute.NetworkFilter.equals(Compute.NetworkField.SELF_LINK, "selfLink"); + private static final Compute.NetworkListOption NETWORK_LIST_OPTION = + Compute.NetworkListOption.filter(NETWORK_FILTER); + private static final Compute.InstanceOption INSTANCE_OPTION = + Compute.InstanceOption.fields(); + private static final Compute.InstanceFilter INSTANCE_FILTER = + Compute.InstanceFilter.equals(Compute.InstanceField.SELF_LINK, "selfLink"); + private static final Compute.InstanceListOption INSTANCE_LIST_OPTION = + Compute.InstanceListOption.filter(INSTANCE_FILTER); + private static final Compute.InstanceAggregatedListOption INSTANCE_AGGREGATED_LIST_OPTION = + Compute.InstanceAggregatedListOption.filter(INSTANCE_FILTER); + + @Override + protected Serializable[] serializableObjects() { + ComputeOptions options = ComputeOptions.newBuilder() + .setProjectId("p1") + .setCredentials(NoCredentials.getInstance()) + .build(); + ComputeOptions otherOptions = options.toBuilder() + .setProjectId("p2") + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build(); + return new Serializable[]{DISK_TYPE_ID, DISK_TYPE, MACHINE_TYPE_ID, MACHINE_TYPE, REGION_ID, + REGION, ZONE_ID, ZONE, LICENSE_ID, LICENSE, DEPRECATION_STATUS, GLOBAL_OPERATION_ID, + REGION_OPERATION_ID, ZONE_OPERATION_ID, GLOBAL_OPERATION, REGION_OPERATION, ZONE_OPERATION, + INSTANCE_ID, REGION_FORWARDING_RULE_ID, GLOBAL_FORWARDING_RULE_ID, GLOBAL_ADDRESS_ID, + REGION_ADDRESS_ID, INSTANCE_USAGE, GLOBAL_FORWARDING_USAGE, REGION_FORWARDING_USAGE, + ADDRESS_INFO, ADDRESS, DISK_ID, SNAPSHOT_ID, SNAPSHOT_INFO, SNAPSHOT, IMAGE_ID, + DISK_IMAGE_CONFIGURATION, STORAGE_IMAGE_CONFIGURATION, IMAGE_INFO, IMAGE, + STANDARD_DISK_CONFIGURATION, IMAGE_DISK_CONFIGURATION, SNAPSHOT_DISK_CONFIGURATION, + DISK_INFO, DISK, SUBNETWORK_ID, NETWORK_ID, SUBNETWORK_INFO, SUBNETWORK, + STANDARD_NETWORK_CONFIGURATION, SUBNET_NETWORK_CONFIGURATION, NETWORK_INFO, NETWORK, + ACCESS_CONFIG, NETWORK_INTERFACE, CREATE_DISK_CONFIGURATION, PERSISTENT_DISK_CONFIGURATION, + SCRATCH_DISK_CONFIGURATION, ATTACHED_DISK, TAGS, METADATA, SERVICE_ACCOUNT, + SCHEDULING_OPTIONS, INSTANCE_INFO, INSTANCE, DISK_TYPE_OPTION, DISK_TYPE_FILTER, + DISK_TYPE_LIST_OPTION, DISK_TYPE_AGGREGATED_LIST_OPTION, MACHINE_TYPE_OPTION, + MACHINE_TYPE_FILTER, MACHINE_TYPE_LIST_OPTION, MACHINE_TYPE_AGGREGATED_LIST_OPTION, + REGION_OPTION, REGION_FILTER, REGION_LIST_OPTION, ZONE_OPTION, ZONE_FILTER, + ZONE_LIST_OPTION, LICENSE_OPTION, OPERATION_OPTION, OPERATION_FILTER, OPERATION_LIST_OPTION, + ADDRESS_OPTION, ADDRESS_FILTER, ADDRESS_LIST_OPTION, ADDRESS_AGGREGATED_LIST_OPTION, + SNAPSHOT_OPTION, SNAPSHOT_FILTER, SNAPSHOT_LIST_OPTION, IMAGE_OPTION, IMAGE_FILTER, + IMAGE_LIST_OPTION, DISK_OPTION, DISK_FILTER, DISK_LIST_OPTION, DISK_AGGREGATED_LIST_OPTION, + SUBNETWORK_OPTION, SUBNETWORK_FILTER, SUBNETWORK_LIST_OPTION, + SUBNETWORK_AGGREGATED_LIST_OPTION, NETWORK_OPTION, NETWORK_FILTER, NETWORK_LIST_OPTION, + INSTANCE_OPTION, INSTANCE_FILTER, INSTANCE_LIST_OPTION, INSTANCE_AGGREGATED_LIST_OPTION, + options, otherOptions}; + } + + @Override + protected Restorable[] restorableObjects() { + return null; + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java new file mode 100644 index 000000000000..1a34703414d2 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ServiceAccountTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +public class ServiceAccountTest { + + private static final ServiceAccount SERVICE_ACCOUNT = + ServiceAccount.of("email", ImmutableList.of("scope1")); + + @Test + public void testOf() { + compareServiceAccount(SERVICE_ACCOUNT, ServiceAccount.of("email", ImmutableList.of("scope1"))); + compareServiceAccount(SERVICE_ACCOUNT, ServiceAccount.of("email", "scope1")); + } + + @Test + public void testToAndFromPb() { + compareServiceAccount(SERVICE_ACCOUNT, ServiceAccount.fromPb(SERVICE_ACCOUNT.toPb())); + } + + public void compareServiceAccount(ServiceAccount expected, ServiceAccount value) { + assertEquals(expected, value); + assertEquals(expected.getEmail(), value.getEmail()); + assertEquals(expected.getScopes(), value.getScopes()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java new file mode 100644 index 000000000000..079e98015eb2 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotDiskConfigurationTest.java @@ -0,0 +1,112 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.compute.deprecated.DiskConfiguration.Type; + +import org.junit.Test; + +public class SnapshotDiskConfigurationTest { + + private static final Long SIZE = 42L; + private static final DiskTypeId DISK_TYPE = DiskTypeId.of("project", "zone", "type"); + private static final SnapshotId SNAPSHOT = SnapshotId.of("project", "snapshot"); + private static final String SNAPSHOT_ID = "snapshotId"; + private static final SnapshotDiskConfiguration DISK_CONFIGURATION = + SnapshotDiskConfiguration.newBuilder(SNAPSHOT) + .setSizeGb(SIZE) + .setDiskType(DISK_TYPE) + .setSourceSnapshotId(SNAPSHOT_ID) + .build(); + + @Test + public void testToBuilder() { + compareSnapshotDiskConfiguration(DISK_CONFIGURATION, DISK_CONFIGURATION.toBuilder().build()); + SnapshotId newSnapshot = SnapshotId.of("newProject", "newSnapshot"); + SnapshotDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() + .setSizeGb(24L) + .setSourceSnapshot(newSnapshot) + .setSourceSnapshotId("newSnapshotId") + .build(); + assertEquals(24L, diskConfiguration.getSizeGb().longValue()); + assertEquals(newSnapshot, diskConfiguration.getSourceSnapshot()); + assertEquals("newSnapshotId", diskConfiguration.getSourceSnapshotId()); + diskConfiguration = diskConfiguration.toBuilder() + .setSizeGb(SIZE) + .setSourceSnapshot(SNAPSHOT) + .setSourceSnapshotId(SNAPSHOT_ID) + .build(); + compareSnapshotDiskConfiguration(DISK_CONFIGURATION, diskConfiguration); + } + + @Test + public void testToBuilderIncomplete() { + SnapshotDiskConfiguration diskConfiguration = SnapshotDiskConfiguration.of(SNAPSHOT); + compareSnapshotDiskConfiguration(diskConfiguration, diskConfiguration.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(DISK_TYPE, DISK_CONFIGURATION.getDiskType()); + assertEquals(SIZE, DISK_CONFIGURATION.getSizeGb()); + assertEquals(SNAPSHOT, DISK_CONFIGURATION.getSourceSnapshot()); + assertEquals(SNAPSHOT_ID, DISK_CONFIGURATION.getSourceSnapshotId()); + assertEquals(Type.SNAPSHOT, DISK_CONFIGURATION.getType()); + } + + @Test + public void testToAndFromPb() { + assertTrue(DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb()) + instanceof SnapshotDiskConfiguration); + compareSnapshotDiskConfiguration(DISK_CONFIGURATION, + DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb())); + } + + @Test + public void testOf() { + SnapshotDiskConfiguration configuration = SnapshotDiskConfiguration.of(SNAPSHOT); + assertNull(configuration.getDiskType()); + assertNull(configuration.getSizeGb()); + assertNull(configuration.getSourceSnapshotId()); + assertEquals(SNAPSHOT, configuration.getSourceSnapshot()); + assertEquals(Type.SNAPSHOT, configuration.getType()); + } + + @Test + public void testSetProjectId() { + SnapshotDiskConfiguration configuration = DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of(DISK_TYPE.getZone(), DISK_TYPE.getType())) + .setSourceSnapshot(SnapshotId.of(SNAPSHOT.getSnapshot())) + .build(); + compareSnapshotDiskConfiguration(DISK_CONFIGURATION, configuration.setProjectId("project")); + } + + private void compareSnapshotDiskConfiguration(SnapshotDiskConfiguration expected, + SnapshotDiskConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getDiskType(), value.getDiskType()); + assertEquals(expected.getSizeGb(), value.getSizeGb()); + assertEquals(expected.getSourceSnapshot(), value.getSourceSnapshot()); + assertEquals(expected.getSourceSnapshotId(), value.getSourceSnapshotId()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java new file mode 100644 index 000000000000..cefe83147d13 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotIdTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class SnapshotIdTest { + + private static final String PROJECT = "project"; + private static final String NAME = "snapshot"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + SnapshotId snapshotId = SnapshotId.of(PROJECT, NAME); + assertEquals(PROJECT, snapshotId.getProject()); + assertEquals(NAME, snapshotId.getSnapshot()); + assertEquals(URL, snapshotId.getSelfLink()); + snapshotId = SnapshotId.of(NAME); + assertNull(snapshotId.getProject()); + assertEquals(NAME, snapshotId.getSnapshot()); + } + + @Test + public void testToAndFromUrl() { + SnapshotId snapshotId = SnapshotId.of(PROJECT, NAME); + compareSnapshotId(snapshotId, SnapshotId.fromUrl(snapshotId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid snapshot URL"); + SnapshotId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + SnapshotId snapshotId = SnapshotId.of(PROJECT, NAME); + assertSame(snapshotId, snapshotId.setProjectId(PROJECT)); + compareSnapshotId(snapshotId, SnapshotId.of(NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(SnapshotId.matchesUrl(SnapshotId.of(PROJECT, NAME).getSelfLink())); + assertFalse(SnapshotId.matchesUrl("notMatchingUrl")); + } + + private void compareSnapshotId(SnapshotId expected, SnapshotId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getSnapshot(), expected.getSnapshot()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java new file mode 100644 index 000000000000..10724d1ce4d6 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotInfoTest.java @@ -0,0 +1,136 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.cloud.compute.deprecated.SnapshotInfo.Status; +import com.google.cloud.compute.deprecated.SnapshotInfo.StorageBytesStatus; +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class SnapshotInfoTest { + + private static final String GENERATED_ID = "42"; + private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); + private static final Status STATUS = Status.CREATING; + private static final Long DISK_SIZE_GB = 42L; + private static final String SOURCE_DISK_ID = "diskId"; + private static final Long STORAGE_BYTES = 24L; + private static final StorageBytesStatus STORAGE_BYTES_STATUS = StorageBytesStatus.UP_TO_DATE; + private static final SnapshotInfo SNAPSHOT_INFO = + SnapshotInfo.newBuilder(SNAPSHOT_ID, SOURCE_DISK) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setSourceDiskId(SOURCE_DISK_ID) + .setStorageBytes(STORAGE_BYTES) + .setStorageBytesStatus(STORAGE_BYTES_STATUS) + .build(); + + @Test + public void testToBuilder() { + compareSnapshotInfo(SNAPSHOT_INFO, SNAPSHOT_INFO.toBuilder().build()); + SnapshotInfo snapshotInfo = SNAPSHOT_INFO.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", snapshotInfo.getDescription()); + snapshotInfo = snapshotInfo.toBuilder().setDescription("description").build(); + compareSnapshotInfo(SNAPSHOT_INFO, snapshotInfo); + } + + @Test + public void testToBuilderIncomplete() { + SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); + assertEquals(snapshotInfo, snapshotInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, SNAPSHOT_INFO.getGeneratedId()); + assertEquals(SNAPSHOT_ID, SNAPSHOT_INFO.getSnapshotId()); + assertEquals(CREATION_TIMESTAMP, SNAPSHOT_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, SNAPSHOT_INFO.getDescription()); + assertEquals(STATUS, SNAPSHOT_INFO.getStatus()); + assertEquals(DISK_SIZE_GB, SNAPSHOT_INFO.getDiskSizeGb()); + assertEquals(LICENSES, SNAPSHOT_INFO.getLicenses()); + assertEquals(SOURCE_DISK, SNAPSHOT_INFO.getSourceDisk()); + assertEquals(SOURCE_DISK_ID, SNAPSHOT_INFO.getSourceDiskId()); + assertEquals(STORAGE_BYTES, SNAPSHOT_INFO.getStorageBytes()); + assertEquals(STORAGE_BYTES_STATUS, SNAPSHOT_INFO.getStorageBytesStatus()); + } + + @Test + public void testOf() { + SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); + assertNull(snapshotInfo.getGeneratedId()); + assertEquals(SNAPSHOT_ID, snapshotInfo.getSnapshotId()); + assertNull(snapshotInfo.getCreationTimestamp()); + assertNull(snapshotInfo.getDescription()); + assertNull(snapshotInfo.getStatus()); + assertNull(snapshotInfo.getDiskSizeGb()); + assertNull(snapshotInfo.getLicenses()); + assertEquals(SOURCE_DISK, snapshotInfo.getSourceDisk()); + assertNull(snapshotInfo.getSourceDiskId()); + assertNull(snapshotInfo.getStorageBytes()); + assertNull(snapshotInfo.getStorageBytesStatus()); + } + + @Test + public void testToAndFromPb() { + compareSnapshotInfo(SNAPSHOT_INFO, SnapshotInfo.fromPb(SNAPSHOT_INFO.toPb())); + SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); + compareSnapshotInfo(snapshotInfo, SnapshotInfo.fromPb(snapshotInfo.toPb())); + snapshotInfo = new SnapshotInfo.BuilderImpl().setSnapshotId(SNAPSHOT_ID).build(); + compareSnapshotInfo(snapshotInfo, SnapshotInfo.fromPb(snapshotInfo.toPb())); + } + + @Test + public void testSetProjectId() { + SnapshotInfo snapshotInfo = SNAPSHOT_INFO.toBuilder() + .setSnapshotId(SnapshotId.of("snapshot")) + .setSourceDisk(DiskId.of("zone", "disk")) + .build(); + compareSnapshotInfo(SNAPSHOT_INFO, snapshotInfo.setProjectId("project")); + } + + public void compareSnapshotInfo(SnapshotInfo expected, SnapshotInfo value) { + assertEquals(expected, value); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getSnapshotId(), value.getSnapshotId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.getSourceDisk(), value.getSourceDisk()); + assertEquals(expected.getSourceDiskId(), value.getSourceDiskId()); + assertEquals(expected.getStorageBytes(), value.getStorageBytes()); + assertEquals(expected.getStorageBytesStatus(), value.getStorageBytesStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java new file mode 100644 index 000000000000..8fd1cb15df04 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SnapshotTest.java @@ -0,0 +1,218 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class SnapshotTest { + + private static final String GENERATED_ID = "42"; + private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final List LICENSES = ImmutableList.of( + LicenseId.of("project", "license1"), LicenseId.of("project", "license2")); + private static final SnapshotId SNAPSHOT_ID = SnapshotId.of("project", "snapshot"); + private static final SnapshotInfo.Status STATUS = SnapshotInfo.Status.CREATING; + private static final Long DISK_SIZE_GB = 42L; + private static final String SOURCE_DISK_ID = "diskId"; + private static final Long STORAGE_BYTES = 24L; + private static final SnapshotInfo.StorageBytesStatus STORAGE_BYTES_STATUS = + SnapshotInfo.StorageBytesStatus.UP_TO_DATE; + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Snapshot snapshot; + private Snapshot expectedSnapshot; + + private void initializeExpectedSnapshot(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + expectedSnapshot = new Snapshot.Builder(serviceMockReturnsOptions, SNAPSHOT_ID, SOURCE_DISK) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setSourceDiskId(SOURCE_DISK_ID) + .setStorageBytes(STORAGE_BYTES) + .setStorageBytesStatus(STORAGE_BYTES_STATUS) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeSnapshot() { + snapshot = new Snapshot.Builder(compute, SNAPSHOT_ID, SOURCE_DISK) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDiskSizeGb(DISK_SIZE_GB) + .setLicenses(LICENSES) + .setSourceDiskId(SOURCE_DISK_ID) + .setStorageBytes(STORAGE_BYTES) + .setStorageBytesStatus(STORAGE_BYTES_STATUS) + .build(); + } + + @Test + public void testToBuilder() { + initializeExpectedSnapshot(8); + compareSnapshot(expectedSnapshot, expectedSnapshot.toBuilder().build()); + Snapshot newSnapshot = expectedSnapshot.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newSnapshot.getDescription()); + newSnapshot = newSnapshot.toBuilder().setDescription("description").build(); + compareSnapshot(expectedSnapshot, newSnapshot); + } + + @Test + public void testToBuilderIncomplete() { + initializeExpectedSnapshot(5); + SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); + Snapshot snapshot = + new Snapshot(serviceMockReturnsOptions, new SnapshotInfo.BuilderImpl(snapshotInfo)); + compareSnapshot(snapshot, snapshot.toBuilder().build()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedSnapshot(8); + compareSnapshot(expectedSnapshot, + Snapshot.fromPb(serviceMockReturnsOptions, expectedSnapshot.toPb())); + Snapshot snapshot = + new Snapshot.Builder(serviceMockReturnsOptions, SNAPSHOT_ID, SOURCE_DISK).build(); + compareSnapshot(snapshot, Snapshot.fromPb(serviceMockReturnsOptions, snapshot.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedSnapshot(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + expect(compute.deleteSnapshot(SNAPSHOT_ID)).andReturn(operation); + replay(compute); + initializeSnapshot(); + assertSame(operation, snapshot.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedSnapshot(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteSnapshot(SNAPSHOT_ID)).andReturn(null); + replay(compute); + initializeSnapshot(); + assertNull(snapshot.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedSnapshot(1); + Compute.SnapshotOption[] expectedOptions = {Compute.SnapshotOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), expectedOptions)) + .andReturn(expectedSnapshot); + replay(compute); + initializeSnapshot(); + assertTrue(snapshot.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedSnapshot(1); + Compute.SnapshotOption[] expectedOptions = {Compute.SnapshotOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), expectedOptions)).andReturn(null); + replay(compute); + initializeSnapshot(); + assertFalse(snapshot.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedSnapshot(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot())).andReturn(expectedSnapshot); + replay(compute); + initializeSnapshot(); + Snapshot updatedSnapshot = snapshot.reload(); + compareSnapshot(expectedSnapshot, updatedSnapshot); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedSnapshot(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot())).andReturn(null); + replay(compute); + initializeSnapshot(); + assertNull(snapshot.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedSnapshot(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSnapshot(SNAPSHOT_ID.getSnapshot(), Compute.SnapshotOption.fields())) + .andReturn(expectedSnapshot); + replay(compute); + initializeSnapshot(); + Snapshot updatedSnapshot = snapshot.reload(Compute.SnapshotOption.fields()); + compareSnapshot(expectedSnapshot, updatedSnapshot); + verify(compute); + } + + public void compareSnapshot(Snapshot expected, Snapshot value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getSnapshotId(), value.getSnapshotId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getDiskSizeGb(), value.getDiskSizeGb()); + assertEquals(expected.getLicenses(), value.getLicenses()); + assertEquals(expected.getSourceDisk(), value.getSourceDisk()); + assertEquals(expected.getSourceDiskId(), value.getSourceDiskId()); + assertEquals(expected.getStorageBytes(), value.getStorageBytes()); + assertEquals(expected.getStorageBytesStatus(), value.getStorageBytesStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java new file mode 100644 index 000000000000..b0692180c3e0 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardDiskConfigurationTest.java @@ -0,0 +1,103 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.compute.deprecated.DiskConfiguration.Type; + +import org.junit.Test; + +public class StandardDiskConfigurationTest { + + private static final Long SIZE = 42L; + private static final DiskTypeId DISK_TYPE = DiskTypeId.of("project", "zone", "type"); + private static final StandardDiskConfiguration DISK_CONFIGURATION = + StandardDiskConfiguration.newBuilder() + .setSizeGb(SIZE) + .setDiskType(DISK_TYPE) + .build(); + + @Test + public void testToBuilder() { + compareStandardDiskConfiguration(DISK_CONFIGURATION, DISK_CONFIGURATION.toBuilder().build()); + StandardDiskConfiguration diskConfiguration = DISK_CONFIGURATION.toBuilder() + .setSizeGb(24L) + .build(); + assertEquals(24L, diskConfiguration.getSizeGb().longValue()); + diskConfiguration = diskConfiguration.toBuilder() + .setSizeGb(SIZE) + .build(); + compareStandardDiskConfiguration(DISK_CONFIGURATION, diskConfiguration); + } + + @Test + public void testToBuilderIncomplete() { + StandardDiskConfiguration diskConfiguration = StandardDiskConfiguration.of(DISK_TYPE); + compareStandardDiskConfiguration(diskConfiguration, diskConfiguration.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(DISK_TYPE, DISK_CONFIGURATION.getDiskType()); + assertEquals(SIZE, DISK_CONFIGURATION.getSizeGb()); + assertEquals(Type.STANDARD, DISK_CONFIGURATION.getType()); + } + + @Test + public void testToAndFromPb() { + assertTrue(DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb()) + instanceof StandardDiskConfiguration); + compareStandardDiskConfiguration(DISK_CONFIGURATION, + DiskConfiguration.fromPb(DISK_CONFIGURATION.toPb())); + } + + @Test + public void testOf() { + StandardDiskConfiguration configuration = StandardDiskConfiguration.of(DISK_TYPE); + assertEquals(DISK_TYPE, configuration.getDiskType()); + assertNull(configuration.getSizeGb()); + assertEquals(Type.STANDARD, configuration.getType()); + configuration = StandardDiskConfiguration.of(DISK_TYPE, SIZE); + assertEquals(DISK_TYPE, configuration.getDiskType()); + assertEquals(SIZE, configuration.getSizeGb()); + assertEquals(Type.STANDARD, configuration.getType()); + configuration = StandardDiskConfiguration.of(SIZE); + assertNull(configuration.getDiskType()); + assertEquals(SIZE, configuration.getSizeGb()); + assertEquals(Type.STANDARD, configuration.getType()); + } + + @Test + public void testSetProjectId() { + StandardDiskConfiguration configuration = DISK_CONFIGURATION.toBuilder() + .setDiskType(DiskTypeId.of(DISK_TYPE.getZone(), DISK_TYPE.getType())) + .build(); + compareStandardDiskConfiguration(DISK_CONFIGURATION, configuration.setProjectId("project")); + } + + private void compareStandardDiskConfiguration(StandardDiskConfiguration expected, + StandardDiskConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getDiskType(), value.getDiskType()); + assertEquals(expected.getSizeGb(), value.getSizeGb()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java new file mode 100644 index 000000000000..a0d7a686c723 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StandardNetworkConfigurationTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.compute.deprecated.NetworkConfiguration.Type; + +import org.junit.Test; + +public class StandardNetworkConfigurationTest { + + private static final String IP_RANGE = "192.168.0.0/16"; + private static final String GATEWAY_ADDRESS = "192.168.1.1"; + private static final StandardNetworkConfiguration NETWORK_CONFIGURATION = + new StandardNetworkConfiguration(IP_RANGE, GATEWAY_ADDRESS); + + @Test + public void testConstructor() { + assertEquals(Type.STANDARD, NETWORK_CONFIGURATION.getType()); + assertEquals(IP_RANGE, NETWORK_CONFIGURATION.getIpRange()); + assertEquals(GATEWAY_ADDRESS, NETWORK_CONFIGURATION.getGatewayAddress()); + StandardNetworkConfiguration networkConfiguration = + new StandardNetworkConfiguration(IP_RANGE, null); + assertEquals(Type.STANDARD, networkConfiguration.getType()); + assertEquals(IP_RANGE, networkConfiguration.getIpRange()); + assertNull(networkConfiguration.getGatewayAddress()); + } + + @Test + public void testToAndFromPb() { + assertTrue(NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb()) + instanceof StandardNetworkConfiguration); + compareNetworkConfiguration(NETWORK_CONFIGURATION, + NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb())); + StandardNetworkConfiguration networkConfiguration = + new StandardNetworkConfiguration(IP_RANGE, null); + assertTrue(NetworkConfiguration.fromPb(networkConfiguration.toPb()) + instanceof StandardNetworkConfiguration); + compareNetworkConfiguration(networkConfiguration, + NetworkConfiguration.fromPb(networkConfiguration.toPb())); + } + + @Test + public void testOf() { + StandardNetworkConfiguration configuration = StandardNetworkConfiguration.of(IP_RANGE); + assertEquals(Type.STANDARD, configuration.getType()); + assertEquals(IP_RANGE, configuration.getIpRange()); + assertNull(configuration.getGatewayAddress()); + } + + private void compareNetworkConfiguration(StandardNetworkConfiguration expected, + StandardNetworkConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getIpRange(), value.getIpRange()); + assertEquals(expected.getGatewayAddress(), value.getGatewayAddress()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java new file mode 100644 index 000000000000..9131f77d0dd0 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/StorageImageConfigurationTest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class StorageImageConfigurationTest { + + private static final String SOURCE = "source"; + private static final ImageConfiguration.SourceType SOURCE_TYPE = + ImageConfiguration.SourceType.RAW; + private static final StorageImageConfiguration.ContainerType CONTAINER_TYPE = + StorageImageConfiguration.ContainerType.TAR; + private static final Long ARCHIVE_SIZE_BYTES = 42L; + private static final String SHA1 = "sha1"; + private static final StorageImageConfiguration CONFIGURATION = + StorageImageConfiguration.newBuilder(SOURCE) + .setSourceType(SOURCE_TYPE) + .setContainerType(CONTAINER_TYPE) + .setArchiveSizeBytes(ARCHIVE_SIZE_BYTES) + .setSha1(SHA1) + .build(); + + @Test + public void testToBuilder() { + compareRawImageConfiguration(CONFIGURATION, CONFIGURATION.toBuilder().build()); + String newSource = "newSource"; + StorageImageConfiguration configuration = CONFIGURATION.toBuilder().setSource(newSource).build(); + assertEquals(newSource, configuration.getSource()); + configuration = configuration.toBuilder().setSource(SOURCE).build(); + compareRawImageConfiguration(CONFIGURATION, configuration); + } + + @Test + public void testToBuilderIncomplete() { + StorageImageConfiguration configuration = StorageImageConfiguration.of(SOURCE); + compareRawImageConfiguration(configuration, configuration.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(SOURCE_TYPE, CONFIGURATION.getSourceType()); + assertEquals(SOURCE, CONFIGURATION.getSource()); + assertEquals(CONTAINER_TYPE, CONFIGURATION.getContainerType()); + assertEquals(ARCHIVE_SIZE_BYTES, CONFIGURATION.getArchiveSizeBytes()); + assertEquals(SHA1, CONFIGURATION.getSha1()); + assertEquals(ImageConfiguration.Type.STORAGE, CONFIGURATION.getType()); + } + + @Test + public void testToAndFromPb() { + assertTrue(ImageConfiguration.fromPb(CONFIGURATION.toPb()) instanceof StorageImageConfiguration); + compareRawImageConfiguration(CONFIGURATION, + ImageConfiguration.fromPb(CONFIGURATION.toPb())); + StorageImageConfiguration configuration = StorageImageConfiguration.of(SOURCE); + compareRawImageConfiguration(configuration, + StorageImageConfiguration.fromPb(configuration.toPb())); + } + + @Test + public void testOf() { + StorageImageConfiguration configuration = StorageImageConfiguration.of(SOURCE); + assertEquals(ImageConfiguration.Type.STORAGE, configuration.getType()); + assertNull(configuration.getSourceType()); + assertEquals(SOURCE, configuration.getSource()); + assertNull(configuration.getContainerType()); + assertNull(configuration.getArchiveSizeBytes()); + assertNull(configuration.getSha1()); + } + + @Test + public void testSetProjectId() { + assertSame(CONFIGURATION, CONFIGURATION.setProjectId("project")); + } + + private void compareRawImageConfiguration(StorageImageConfiguration expected, + StorageImageConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.getSource(), value.getSource()); + assertEquals(expected.getSourceType(), value.getSourceType()); + assertEquals(expected.getContainerType(), value.getContainerType()); + assertEquals(expected.getArchiveSizeBytes(), value.getArchiveSizeBytes()); + assertEquals(expected.getSha1(), value.getSha1()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java new file mode 100644 index 000000000000..ff3c0bc4f12f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetNetworkConfigurationTest.java @@ -0,0 +1,82 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +import java.util.List; + +public class SubnetNetworkConfigurationTest { + + private static final Boolean AUTO_CREATE_SUBNETWORKS = true; + private static final List SUBNETWORKS = ImmutableList.of( + SubnetworkId.of("project", "region", "subnetwork1"), + SubnetworkId.of("project", "region", "subnetwork2")); + private static final SubnetNetworkConfiguration NETWORK_CONFIGURATION = + new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); + + @Test + public void testConstructor() { + assertEquals(AUTO_CREATE_SUBNETWORKS, NETWORK_CONFIGURATION.autoCreateSubnetworks()); + assertEquals(NetworkConfiguration.Type.SUBNET, NETWORK_CONFIGURATION.getType()); + assertEquals(SUBNETWORKS, NETWORK_CONFIGURATION.getSubnetworks()); + assertEquals(NetworkConfiguration.Type.SUBNET, NETWORK_CONFIGURATION.getType()); + SubnetNetworkConfiguration networkConfiguration = + new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, null); + assertEquals(NetworkConfiguration.Type.SUBNET, networkConfiguration.getType()); + assertEquals(AUTO_CREATE_SUBNETWORKS, networkConfiguration.autoCreateSubnetworks()); + assertNull(networkConfiguration.getSubnetworks()); + } + + @Test + public void testToAndFromPb() { + assertTrue(NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb()) + instanceof SubnetNetworkConfiguration); + compareNetworkConfiguration(NETWORK_CONFIGURATION, + NetworkConfiguration.fromPb(NETWORK_CONFIGURATION.toPb())); + SubnetNetworkConfiguration networkConfiguration = + new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, null); + assertTrue(NetworkConfiguration.fromPb(networkConfiguration.toPb()) + instanceof SubnetNetworkConfiguration); + compareNetworkConfiguration(networkConfiguration, + NetworkConfiguration.fromPb(networkConfiguration.toPb())); + } + + @Test + public void testOf() { + SubnetNetworkConfiguration configuration = + SubnetNetworkConfiguration.of(AUTO_CREATE_SUBNETWORKS); + assertEquals(AUTO_CREATE_SUBNETWORKS, configuration.autoCreateSubnetworks()); + assertNull(configuration.getSubnetworks()); + assertEquals(NetworkConfiguration.Type.SUBNET, configuration.getType()); + } + + private void compareNetworkConfiguration(SubnetNetworkConfiguration expected, + SubnetNetworkConfiguration value) { + assertEquals(expected, value); + assertEquals(expected.autoCreateSubnetworks(), value.autoCreateSubnetworks()); + assertEquals(expected.getSubnetworks(), value.getSubnetworks()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java new file mode 100644 index 000000000000..528847bdb785 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkIdTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class SubnetworkIdTest { + + private static final String PROJECT = "project"; + private static final String REGION = "region"; + private static final String NAME = "subnet"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnet"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + SubnetworkId subnetworkId = SubnetworkId.of(PROJECT, REGION, NAME); + assertEquals(PROJECT, subnetworkId.getProject()); + assertEquals(REGION, subnetworkId.getRegion()); + assertEquals(NAME, subnetworkId.getSubnetwork()); + assertEquals(URL, subnetworkId.getSelfLink()); + subnetworkId = SubnetworkId.of(REGION, NAME); + assertNull(subnetworkId.getProject()); + assertEquals(REGION, subnetworkId.getRegion()); + assertEquals(NAME, subnetworkId.getSubnetwork()); + subnetworkId = SubnetworkId.of(RegionId.of(PROJECT, REGION), NAME); + assertEquals(PROJECT, subnetworkId.getProject()); + assertEquals(REGION, subnetworkId.getRegion()); + assertEquals(NAME, subnetworkId.getSubnetwork()); + } + + @Test + public void testToAndFromUrl() { + SubnetworkId subnetworkId = SubnetworkId.of(PROJECT, REGION, NAME); + compareSubnetworkId(subnetworkId, SubnetworkId.fromUrl(subnetworkId.getSelfLink())); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid subnetwork URL"); + SubnetworkId.fromUrl("notMatchingUrl"); + } + + @Test + public void testSetProjectId() { + SubnetworkId subnetworkId = SubnetworkId.of(PROJECT, REGION, NAME); + assertSame(subnetworkId, subnetworkId.setProjectId(PROJECT)); + compareSubnetworkId(subnetworkId, SubnetworkId.of(REGION, NAME).setProjectId(PROJECT)); + } + + @Test + public void testMatchesUrl() { + assertTrue(SubnetworkId.matchesUrl(SubnetworkId.of(PROJECT, REGION, NAME).getSelfLink())); + assertFalse(SubnetworkId.matchesUrl("notMatchingUrl")); + } + + private void compareSubnetworkId(SubnetworkId expected, SubnetworkId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getRegion(), expected.getRegion()); + assertEquals(expected.getSubnetwork(), expected.getSubnetwork()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java new file mode 100644 index 000000000000..0d541cad2a55 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkInfoTest.java @@ -0,0 +1,108 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.junit.Test; + +public class SubnetworkInfoTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final SubnetworkId SUBNETWORK_ID = + SubnetworkId.of("project", "region", "subnetwork"); + private static final String GATEWAY_ADDRESS = "192.168.1.1"; + private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); + private static final String IP_RANGE = "192.168.0.0/16"; + private static final SubnetworkInfo SUBNETWORK_INFO = + SubnetworkInfo.newBuilder(SUBNETWORK_ID, NETWORK_ID, IP_RANGE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGatewayAddress(GATEWAY_ADDRESS) + .build(); + + @Test + public void testToBuilder() { + compareSubnetworkInfo(SUBNETWORK_INFO, SUBNETWORK_INFO.toBuilder().build()); + SubnetworkInfo subnetworkInfo = + SUBNETWORK_INFO.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", subnetworkInfo.getDescription()); + subnetworkInfo = subnetworkInfo.toBuilder().setDescription("description").build(); + compareSubnetworkInfo(SUBNETWORK_INFO, subnetworkInfo); + } + + @Test + public void testToBuilderIncomplete() { + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); + assertEquals(subnetworkInfo, subnetworkInfo.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(GENERATED_ID, SUBNETWORK_INFO.getGeneratedId()); + assertEquals(SUBNETWORK_ID, SUBNETWORK_INFO.getSubnetworkId()); + assertEquals(CREATION_TIMESTAMP, SUBNETWORK_INFO.getCreationTimestamp()); + assertEquals(DESCRIPTION, SUBNETWORK_INFO.getDescription()); + assertEquals(GATEWAY_ADDRESS, SUBNETWORK_INFO.getGatewayAddress()); + assertEquals(NETWORK_ID, SUBNETWORK_INFO.getNetwork()); + assertEquals(IP_RANGE, SUBNETWORK_INFO.getIpRange()); + } + + @Test + public void testOf() { + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); + assertNull(subnetworkInfo.getGeneratedId()); + assertEquals(SUBNETWORK_ID, subnetworkInfo.getSubnetworkId()); + assertNull(subnetworkInfo.getCreationTimestamp()); + assertNull(subnetworkInfo.getDescription()); + assertNull(subnetworkInfo.getGatewayAddress()); + assertEquals(NETWORK_ID, subnetworkInfo.getNetwork()); + assertEquals(IP_RANGE, subnetworkInfo.getIpRange()); + } + + @Test + public void testToAndFromPb() { + compareSubnetworkInfo(SUBNETWORK_INFO, SubnetworkInfo.fromPb(SUBNETWORK_INFO.toPb())); + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); + compareSubnetworkInfo(subnetworkInfo, SubnetworkInfo.fromPb(subnetworkInfo.toPb())); + } + + @Test + public void testSetProjectId() { + SubnetworkInfo subnetworkInfo = SUBNETWORK_INFO.toBuilder() + .setSubnetworkId(SubnetworkId.of("region", "subnetwork")) + .setNetwork(NetworkId.of("network")) + .build(); + compareSubnetworkInfo(SUBNETWORK_INFO, subnetworkInfo.setProjectId("project")); + } + + public void compareSubnetworkInfo(SubnetworkInfo expected, SubnetworkInfo value) { + assertEquals(expected, value); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getSubnetworkId(), value.getSubnetworkId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getGatewayAddress(), value.getGatewayAddress()); + assertEquals(expected.getNetwork(), value.getNetwork()); + assertEquals(expected.getIpRange(), value.getIpRange()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java new file mode 100644 index 000000000000..3f2a67445b17 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/SubnetworkTest.java @@ -0,0 +1,210 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class SubnetworkTest { + + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final SubnetworkId SUBNETWORK_ID = SubnetworkId.of("project", "region", "network"); + private static final String GATEWAY_ADDRESS = "192.168.1.1"; + private static final NetworkId NETWORK_ID = NetworkId.of("project", "network"); + private static final String IP_RANGE = "192.168.0.0/16"; + + private final Compute serviceMockReturnsOptions = createStrictMock(Compute.class); + private final ComputeOptions mockOptions = createMock(ComputeOptions.class); + private Compute compute; + private Subnetwork subnetwork; + private Subnetwork expectedSubnetwork; + + private void initializeExpectedSubnetwork(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); + replay(serviceMockReturnsOptions); + expectedSubnetwork = + new Subnetwork.Builder(serviceMockReturnsOptions, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGatewayAddress(GATEWAY_ADDRESS) + .build(); + compute = createStrictMock(Compute.class); + } + + private void initializeSubnetwork() { + subnetwork = + new Subnetwork.Builder(compute, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setGatewayAddress(GATEWAY_ADDRESS) + .build(); + } + + @Test + public void testToBuilder() { + initializeExpectedSubnetwork(8); + compareSubnetwork(expectedSubnetwork, expectedSubnetwork.toBuilder().build()); + Subnetwork newSubnetwork = expectedSubnetwork.toBuilder().setDescription("newDescription").build(); + assertEquals("newDescription", newSubnetwork.getDescription()); + newSubnetwork = newSubnetwork.toBuilder().setDescription("description").build(); + compareSubnetwork(expectedSubnetwork, newSubnetwork); + } + + @Test + public void testToBuilderIncomplete() { + initializeExpectedSubnetwork(5); + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); + Subnetwork subnetwork = + new Subnetwork(serviceMockReturnsOptions, new SubnetworkInfo.BuilderImpl(subnetworkInfo)); + compareSubnetwork(subnetwork, subnetwork.toBuilder().build()); + } + + @Test + public void testBuilder() { + initializeExpectedSubnetwork(1); + assertEquals(GENERATED_ID, expectedSubnetwork.getGeneratedId()); + assertEquals(SUBNETWORK_ID, expectedSubnetwork.getSubnetworkId()); + assertEquals(CREATION_TIMESTAMP, expectedSubnetwork.getCreationTimestamp()); + assertEquals(DESCRIPTION, expectedSubnetwork.getDescription()); + assertEquals(GATEWAY_ADDRESS, expectedSubnetwork.getGatewayAddress()); + assertEquals(NETWORK_ID, expectedSubnetwork.getNetwork()); + assertEquals(IP_RANGE, expectedSubnetwork.getIpRange()); + assertSame(serviceMockReturnsOptions, expectedSubnetwork.getCompute()); + } + + @Test + public void testToAndFromPb() { + initializeExpectedSubnetwork(8); + compareSubnetwork(expectedSubnetwork, + Subnetwork.fromPb(serviceMockReturnsOptions, expectedSubnetwork.toPb())); + Subnetwork subnetwork = + new Subnetwork.Builder(serviceMockReturnsOptions, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) + .build(); + compareSubnetwork(subnetwork, Subnetwork.fromPb(serviceMockReturnsOptions, subnetwork.toPb())); + } + + @Test + public void testDeleteOperation() { + initializeExpectedSubnetwork(2); + expect(compute.getOptions()).andReturn(mockOptions); + Operation operation = new Operation.Builder(serviceMockReturnsOptions) + .setOperationId(GlobalOperationId.of("project", "op")) + .build(); + expect(compute.deleteSubnetwork(SUBNETWORK_ID)).andReturn(operation); + replay(compute); + initializeSubnetwork(); + assertSame(operation, subnetwork.delete()); + } + + @Test + public void testDeleteNull() { + initializeExpectedSubnetwork(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.deleteSubnetwork(SUBNETWORK_ID)).andReturn(null); + replay(compute); + initializeSubnetwork(); + assertNull(subnetwork.delete()); + } + + @Test + public void testExists_True() throws Exception { + initializeExpectedSubnetwork(1); + Compute.SubnetworkOption[] expectedOptions = {Compute.SubnetworkOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSubnetwork(SUBNETWORK_ID, expectedOptions)) + .andReturn(expectedSubnetwork); + replay(compute); + initializeSubnetwork(); + assertTrue(subnetwork.exists()); + verify(compute); + } + + @Test + public void testExists_False() throws Exception { + initializeExpectedSubnetwork(1); + Compute.SubnetworkOption[] expectedOptions = {Compute.SubnetworkOption.fields()}; + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSubnetwork(SUBNETWORK_ID, expectedOptions)).andReturn(null); + replay(compute); + initializeSubnetwork(); + assertFalse(subnetwork.exists()); + verify(compute); + } + + @Test + public void testReload() throws Exception { + initializeExpectedSubnetwork(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSubnetwork(SUBNETWORK_ID)).andReturn(expectedSubnetwork); + replay(compute); + initializeSubnetwork(); + Subnetwork updatedSubnetwork = subnetwork.reload(); + compareSubnetwork(expectedSubnetwork, updatedSubnetwork); + verify(compute); + } + + @Test + public void testReloadNull() throws Exception { + initializeExpectedSubnetwork(1); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSubnetwork(SUBNETWORK_ID)).andReturn(null); + replay(compute); + initializeSubnetwork(); + assertNull(subnetwork.reload()); + verify(compute); + } + + @Test + public void testReloadWithOptions() throws Exception { + initializeExpectedSubnetwork(3); + expect(compute.getOptions()).andReturn(mockOptions); + expect(compute.getSubnetwork(SUBNETWORK_ID, Compute.SubnetworkOption.fields())) + .andReturn(expectedSubnetwork); + replay(compute); + initializeSubnetwork(); + Subnetwork updatedSubnetwork = subnetwork.reload(Compute.SubnetworkOption.fields()); + compareSubnetwork(expectedSubnetwork, updatedSubnetwork); + verify(compute); + } + + public void compareSubnetwork(Subnetwork expected, Subnetwork value) { + assertEquals(expected, value); + assertEquals(expected.getCompute().getOptions(), value.getCompute().getOptions()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getSubnetworkId(), value.getSubnetworkId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getGatewayAddress(), value.getGatewayAddress()); + assertEquals(expected.getNetwork(), value.getNetwork()); + assertEquals(expected.getIpRange(), value.getIpRange()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java new file mode 100644 index 000000000000..420b677a033f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/TagsTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import com.google.common.collect.ImmutableList; + +import org.junit.Test; + +public class TagsTest { + + private static final Tags TAGS = Tags.of("tag1", "tag2"); + + @Test + public void testToBuilder() { + Tags tags = TAGS.toBuilder().setValues("tag1").build(); + assertEquals(ImmutableList.of("tag1"), tags.getValues()); + compareTags(TAGS, tags.toBuilder().setValues("tag1", "tag2").build()); + } + + @Test + public void testBuilder() { + Tags tags = Tags.newBuilder().setValues(ImmutableList.of("tag1", "tag2")).build(); + assertEquals(ImmutableList.of("tag1", "tag2"), tags.getValues()); + assertNull(tags.getFingerprint()); + tags = Tags.newBuilder().add("tag1").add("tag2").build(); + assertEquals(ImmutableList.of("tag1", "tag2"), tags.getValues()); + assertNull(tags.getFingerprint()); + tags = Tags.newBuilder().add("tag1").add("tag2").setFingerprint("fingerprint").build(); + assertEquals(ImmutableList.of("tag1", "tag2"), tags.getValues()); + assertEquals("fingerprint", tags.getFingerprint()); + } + + @Test + public void testOf() { + compareTags(TAGS, Tags.of("tag1", "tag2")); + compareTags(TAGS, Tags.of(ImmutableList.of("tag1", "tag2"))); + } + + @Test + public void testToAndFromPb() { + compareTags(TAGS, Tags.fromPb(TAGS.toPb())); + Tags tags = Tags.newBuilder().add("tag1").add("tag2").setFingerprint("fingerprint").build(); + compareTags(tags, Tags.fromPb(tags.toPb())); + } + + public void compareTags(Tags expected, Tags value) { + assertEquals(expected, value); + assertEquals(expected.getFingerprint(), value.getFingerprint()); + assertEquals(expected.getValues(), value.getValues()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java new file mode 100644 index 000000000000..72d8e2f44eb3 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneIdTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class ZoneIdTest { + + private static final String PROJECT = "project"; + private static final String ZONE = "zone"; + private static final String URL = + "https://www.googleapis.com/compute/v1/projects/project/zones/zone"; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testOf() { + ZoneId zoneId = ZoneId.of(PROJECT, ZONE); + assertEquals(PROJECT, zoneId.getProject()); + assertEquals(ZONE, zoneId.getZone()); + assertEquals(URL, zoneId.getSelfLink()); + zoneId = ZoneId.of(ZONE); + assertNull(zoneId.getProject()); + assertEquals(ZONE, zoneId.getZone()); + } + + @Test + public void testToAndFromUrl() { + ZoneId zoneId = ZoneId.of(PROJECT, ZONE); + compareZoneId(zoneId, ZoneId.fromUrl(zoneId.getSelfLink())); + } + + @Test + public void testSetProjectId() { + ZoneId zoneId = ZoneId.of(PROJECT, ZONE); + assertSame(zoneId, zoneId.setProjectId(PROJECT)); + compareZoneId(zoneId, ZoneId.of(ZONE).setProjectId(PROJECT)); + thrown.expect(IllegalArgumentException.class); + thrown.expectMessage("notMatchingUrl is not a valid zone URL"); + ZoneId.fromUrl("notMatchingUrl"); + } + + @Test + public void testMatchesUrl() { + assertTrue(ZoneId.matchesUrl(ZoneId.of(PROJECT, ZONE).getSelfLink())); + assertFalse(ZoneId.matchesUrl("notMatchingUrl")); + } + + private void compareZoneId(ZoneId expected, ZoneId value) { + assertEquals(expected, value); + assertEquals(expected.getProject(), expected.getProject()); + assertEquals(expected.getZone(), expected.getZone()); + assertEquals(expected.getSelfLink(), expected.getSelfLink()); + assertEquals(expected.hashCode(), expected.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java new file mode 100644 index 000000000000..5d0a9f1d140a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/ZoneTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class ZoneTest { + + private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); + private static final RegionId REGION_ID = RegionId.of("project", "region"); + private static final String GENERATED_ID = "42"; + private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String DESCRIPTION = "description"; + private static final Zone.Status STATUS = Zone.Status.DOWN; + private static final DeprecationStatus DEPRECATION_STATUS = + DeprecationStatus.of(DeprecationStatus.Status.DELETED, ZONE_ID); + private static final Zone ZONE = Zone.builder() + .setZoneId(ZONE_ID) + .setGeneratedId(GENERATED_ID) + .setCreationTimestamp(CREATION_TIMESTAMP) + .setDescription(DESCRIPTION) + .setStatus(STATUS) + .setDeprecationStatus(DEPRECATION_STATUS) + .setRegion(REGION_ID) + .build(); + + @Test + public void testBuilder() { + assertEquals(REGION_ID, ZONE.getRegion()); + assertEquals(GENERATED_ID, ZONE.getGeneratedId()); + assertEquals(CREATION_TIMESTAMP, ZONE.getCreationTimestamp()); + assertEquals(DESCRIPTION, ZONE.getDescription()); + assertEquals(STATUS, ZONE.getStatus()); + assertEquals(REGION_ID, ZONE.getRegion()); + assertEquals(DEPRECATION_STATUS, ZONE.getDeprecationStatus()); + } + + @Test + public void testToAndFromPb() { + com.google.api.services.compute.model.Zone zonePb = ZONE.toPb(); + assertEquals(REGION_ID.getSelfLink(), zonePb.getRegion()); + Zone zone = Zone.fromPb(zonePb); + compareZones(ZONE, zone); + assertEquals(ZONE_ID.getProject(), zone.getZoneId().getProject()); + assertEquals(ZONE_ID.getZone(), zone.getZoneId().getZone()); + zone = Zone.builder().setZoneId(ZONE_ID).build(); + compareZones(zone, Zone.fromPb(zone.toPb())); + } + + private void compareZones(Zone expected, Zone value) { + assertEquals(expected, value); + assertEquals(expected.getZoneId(), value.getZoneId()); + assertEquals(expected.getGeneratedId(), value.getGeneratedId()); + assertEquals(expected.getCreationTimestamp(), value.getCreationTimestamp()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getStatus(), value.getStatus()); + assertEquals(expected.getRegion(), value.getRegion()); + assertEquals(expected.getDeprecationStatus(), value.getDeprecationStatus()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java new file mode 100644 index 000000000000..943d915ced9c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/it/ITComputeTest.java @@ -0,0 +1,1842 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.paging.Page; +import com.google.cloud.compute.deprecated.Address; +import com.google.cloud.compute.deprecated.AddressId; +import com.google.cloud.compute.deprecated.AddressInfo; +import com.google.cloud.compute.deprecated.AttachedDisk; +import com.google.cloud.compute.deprecated.Compute; +import com.google.cloud.compute.deprecated.DeprecationStatus; +import com.google.cloud.compute.deprecated.Disk; +import com.google.cloud.compute.deprecated.DiskConfiguration; +import com.google.cloud.compute.deprecated.DiskId; +import com.google.cloud.compute.deprecated.DiskImageConfiguration; +import com.google.cloud.compute.deprecated.DiskInfo; +import com.google.cloud.compute.deprecated.DiskType; +import com.google.cloud.compute.deprecated.DiskTypeId; +import com.google.cloud.compute.deprecated.GlobalAddressId; +import com.google.cloud.compute.deprecated.Image; +import com.google.cloud.compute.deprecated.ImageConfiguration; +import com.google.cloud.compute.deprecated.ImageDiskConfiguration; +import com.google.cloud.compute.deprecated.ImageId; +import com.google.cloud.compute.deprecated.ImageInfo; +import com.google.cloud.compute.deprecated.Instance; +import com.google.cloud.compute.deprecated.InstanceId; +import com.google.cloud.compute.deprecated.InstanceInfo; +import com.google.cloud.compute.deprecated.License; +import com.google.cloud.compute.deprecated.LicenseId; +import com.google.cloud.compute.deprecated.MachineType; +import com.google.cloud.compute.deprecated.MachineTypeId; +import com.google.cloud.compute.deprecated.Network; +import com.google.cloud.compute.deprecated.NetworkConfiguration; +import com.google.cloud.compute.deprecated.NetworkId; +import com.google.cloud.compute.deprecated.NetworkInfo; +import com.google.cloud.compute.deprecated.NetworkInterface; +import com.google.cloud.compute.deprecated.Operation; +import com.google.cloud.compute.deprecated.Region; +import com.google.cloud.compute.deprecated.RegionAddressId; +import com.google.cloud.compute.deprecated.RegionOperationId; +import com.google.cloud.compute.deprecated.SchedulingOptions; +import com.google.cloud.compute.deprecated.Snapshot; +import com.google.cloud.compute.deprecated.SnapshotDiskConfiguration; +import com.google.cloud.compute.deprecated.SnapshotId; +import com.google.cloud.compute.deprecated.SnapshotInfo; +import com.google.cloud.compute.deprecated.StandardDiskConfiguration; +import com.google.cloud.compute.deprecated.StandardNetworkConfiguration; +import com.google.cloud.compute.deprecated.StorageImageConfiguration; +import com.google.cloud.compute.deprecated.SubnetNetworkConfiguration; +import com.google.cloud.compute.deprecated.Subnetwork; +import com.google.cloud.compute.deprecated.SubnetworkId; +import com.google.cloud.compute.deprecated.SubnetworkInfo; +import com.google.cloud.compute.deprecated.Zone; +import com.google.cloud.compute.deprecated.ZoneOperationId; +import com.google.cloud.compute.deprecated.testing.ResourceCleaner; +import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeoutException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; + +public class ITComputeTest { + + private static final String REGION = "us-central1"; + private static final String ZONE = "us-central1-a"; + private static final String DISK_TYPE = "local-ssd"; + private static final String MACHINE_TYPE = "f1-micro"; + private static final LicenseId LICENSE_ID = LicenseId.of("ubuntu-os-cloud", "ubuntu-1404-trusty"); + private static final String BASE_RESOURCE_NAME = RemoteComputeHelper.baseResourceName(); + private static final ImageId IMAGE_ID = ImageId.of("debian-cloud", "debian-8-jessie-v20160219"); + private static final String IMAGE_PROJECT = "debian-cloud"; + + private static Compute compute; + private static ResourceCleaner resourceCleaner; + + + @Rule + public Timeout globalTimeout = Timeout.seconds(300); + + @BeforeClass + public static void beforeClass() { + RemoteComputeHelper computeHelper = RemoteComputeHelper.create(); + compute = computeHelper.getOptions().getService(); + resourceCleaner = ResourceCleaner.create(compute); + } + + @AfterClass + public static void tearDown() { + resourceCleaner.cleanUp(); + } + + @Test + public void testGetDiskType() { + DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); + // assertNotNull(diskType.getGeneratedId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testGetDiskTypeWithSelectedFields() { + DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, + Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); + // assertNotNull(diskType.getGeneratedId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertEquals(DISK_TYPE, diskType.getDiskTypeId().getType()); + assertNotNull(diskType.getCreationTimestamp()); + assertNull(diskType.getDescription()); + assertNull(diskType.getValidDiskSize()); + assertNull(diskType.getDefaultDiskSizeGb()); + } + + @Test + public void testListDiskTypes() { + Page diskPage = compute.listDiskTypes(ZONE); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithSelectedFields() { + Page diskPage = compute.listDiskTypes(ZONE, + Compute.DiskTypeListOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + assertNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNull(diskType.getDescription()); + assertNull(diskType.getValidDiskSize()); + assertNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testListDiskTypesWithFilter() { + Page diskPage = compute.listDiskTypes(ZONE, Compute.DiskTypeListOption.filter( + Compute.DiskTypeFilter.equals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // todo(mziccard): uncomment or remove once #695 is closed + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertEquals(ZONE, diskType.getDiskTypeId().getZone()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertEquals(375, (long) diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypes() { + Page diskPage = compute.listDiskTypes(); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotNull(diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testAggregatedListDiskTypesWithFilter() { + Page diskPage = compute.listDiskTypes(Compute.DiskTypeAggregatedListOption.filter( + Compute.DiskTypeFilter.notEquals(Compute.DiskTypeField.DEFAULT_DISK_SIZE_GB, 375))); + Iterator diskTypeIterator = diskPage.iterateAll().iterator(); + assertTrue(diskTypeIterator.hasNext()); + while (diskTypeIterator.hasNext()) { + DiskType diskType = diskTypeIterator.next(); + // todo(mziccard): uncomment or remove once #695 is closed + // assertNotNull(diskType.getGeneratedId()); + assertNotNull(diskType.getDiskTypeId()); + assertNotNull(diskType.getCreationTimestamp()); + assertNotNull(diskType.getDescription()); + assertNotNull(diskType.getValidDiskSize()); + assertNotEquals(375, (long) diskType.getDefaultDiskSizeGb()); + } + } + + @Test + public void testGetMachineType() { + MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + + @Test + public void testGetMachineTypeWithSelectedFields() { + MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE, + Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertEquals(MACHINE_TYPE, machineType.getMachineTypeId().getType()); + assertNotNull(machineType.getGeneratedId()); + assertNull(machineType.getCreationTimestamp()); + assertNull(machineType.getDescription()); + assertNull(machineType.getCpus()); + assertNull(machineType.getMemoryMb()); + assertNull(machineType.getMaximumPersistentDisks()); + assertNull(machineType.getMaximumPersistentDisksSizeGb()); + } + + @Test + public void testListMachineTypes() { + Page machinePage = compute.listMachineTypes(ZONE); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testListMachineTypesWithSelectedFields() { + Page machinePage = compute.listMachineTypes(ZONE, + Compute.MachineTypeListOption.fields(Compute.MachineTypeField.CREATION_TIMESTAMP)); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNull(machineType.getDescription()); + assertNull(machineType.getCpus()); + assertNull(machineType.getMemoryMb()); + assertNull(machineType.getMaximumPersistentDisks()); + assertNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testListMachineTypesWithFilter() { + Page machinePage = compute.listMachineTypes(ZONE, + Compute.MachineTypeListOption.filter( + Compute.MachineTypeFilter.equals(Compute.MachineTypeField.GUEST_CPUS, 2))); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertEquals(ZONE, machineType.getMachineTypeId().getZone()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertEquals(2, (long) machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testAggregatedListMachineTypes() { + Page machinePage = compute.listMachineTypes(); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testAggregatedListMachineTypesWithFilter() { + Page machinePage = + compute.listMachineTypes(Compute.MachineTypeAggregatedListOption.filter( + Compute.MachineTypeFilter.notEquals(Compute.MachineTypeField.GUEST_CPUS, 2))); + Iterator machineTypeIterator = machinePage.iterateAll().iterator(); + assertTrue(machineTypeIterator.hasNext()); + while (machineTypeIterator.hasNext()) { + MachineType machineType = machineTypeIterator.next(); + assertNotNull(machineType.getMachineTypeId()); + assertNotNull(machineType.getGeneratedId()); + assertNotNull(machineType.getCreationTimestamp()); + assertNotNull(machineType.getDescription()); + assertNotNull(machineType.getCpus()); + assertNotEquals(2, (long) machineType.getCpus()); + assertNotNull(machineType.getMemoryMb()); + assertNotNull(machineType.getMaximumPersistentDisks()); + assertNotNull(machineType.getMaximumPersistentDisksSizeGb()); + } + } + + @Test + public void testGetLicense() { + License license = compute.getLicense(LICENSE_ID); + assertEquals(LICENSE_ID, license.getLicenseId()); + assertNotNull(license.chargesUseFee()); + } + + @Test + public void testGetLicenseWithSelectedFields() { + License license = compute.getLicense(LICENSE_ID, Compute.LicenseOption.fields()); + assertEquals(LICENSE_ID, license.getLicenseId()); + assertNull(license.chargesUseFee()); + } + + @Test + public void testGetRegion() { + Region region = compute.getRegion(REGION); + assertEquals(REGION, region.getRegionId().getRegion()); + assertNotNull(region.getDescription()); + assertNotNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNotNull(region.getQuotas()); + assertNotNull(region.getStatus()); + assertNotNull(region.getZones()); + } + + @Test + public void testGetRegionWithSelectedFields() { + Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); + assertEquals(REGION, region.getRegionId().getRegion()); + assertNotNull(region.getGeneratedId()); + assertNull(region.getDescription()); + assertNull(region.getCreationTimestamp()); + assertNull(region.getQuotas()); + assertNull(region.getStatus()); + assertNull(region.getZones()); + } + + @Test + public void testListRegions() { + Page regionPage = compute.listRegions(); + Iterator regionIterator = regionPage.iterateAll().iterator(); + while (regionIterator.hasNext()) { + Region region = regionIterator.next(); + assertNotNull(region.getRegionId()); + assertNotNull(region.getDescription()); + assertNotNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNotNull(region.getQuotas()); + assertNotNull(region.getStatus()); + assertNotNull(region.getZones()); + } + } + + @Test + public void testListRegionsWithSelectedFields() { + Page regionPage = + compute.listRegions(Compute.RegionListOption.fields(Compute.RegionField.ID)); + Iterator regionIterator = regionPage.iterateAll().iterator(); + while (regionIterator.hasNext()) { + Region region = regionIterator.next(); + assertNotNull(region.getRegionId()); + assertNull(region.getDescription()); + assertNull(region.getCreationTimestamp()); + assertNotNull(region.getGeneratedId()); + assertNull(region.getQuotas()); + assertNull(region.getStatus()); + assertNull(region.getZones()); + } + } + + @Test + public void testListRegionsWithFilter() { + Page regionPage = compute.listRegions(Compute.RegionListOption.filter( + Compute.RegionFilter.equals(Compute.RegionField.NAME, REGION))); + Iterator regionIterator = regionPage.iterateAll().iterator(); + assertEquals(REGION, regionIterator.next().getRegionId().getRegion()); + assertFalse(regionIterator.hasNext()); + } + + @Test + public void testGetZone() { + Zone zone = compute.getZone(ZONE); + assertEquals(ZONE, zone.getZoneId().getZone()); + assertNotNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNotNull(zone.getDescription()); + assertNotNull(zone.getStatus()); + assertNotNull(zone.getRegion()); + } + + @Test + public void testGetZoneWithSelectedFields() { + Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); + assertEquals(ZONE, zone.getZoneId().getZone()); + assertNotNull(zone.getGeneratedId()); + assertNull(zone.getCreationTimestamp()); + assertNull(zone.getDescription()); + assertNull(zone.getStatus()); + assertNull(zone.getRegion()); + } + + @Test + public void testListZones() { + Page zonePage = compute.listZones(); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + while (zoneIterator.hasNext()) { + Zone zone = zoneIterator.next(); + assertNotNull(zone.getZoneId()); + assertNotNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNotNull(zone.getDescription()); + assertNotNull(zone.getStatus()); + assertNotNull(zone.getRegion()); + } + } + + @Test + public void testListZonesWithSelectedFields() { + Page zonePage = compute.listZones( + Compute.ZoneListOption.fields(Compute.ZoneField.CREATION_TIMESTAMP)); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + while (zoneIterator.hasNext()) { + Zone zone = zoneIterator.next(); + assertNotNull(zone.getZoneId()); + assertNull(zone.getGeneratedId()); + assertNotNull(zone.getCreationTimestamp()); + assertNull(zone.getDescription()); + assertNull(zone.getStatus()); + assertNull(zone.getRegion()); + } + } + + @Test + public void testListZonesWithFilter() { + Page zonePage = compute.listZones( + Compute.ZoneListOption.filter(Compute.ZoneFilter.equals(Compute.ZoneField.NAME, ZONE))); + Iterator zoneIterator = zonePage.iterateAll().iterator(); + assertEquals(ZONE, zoneIterator.next().getZoneId().getZone()); + assertFalse(zoneIterator.hasNext()); + } + + @Test + public void testListGlobalOperations() { + Page operationPage = compute.listGlobalOperations(); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListGlobalOperationsWithSelectedFields() { + Page operationPage = + compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListGlobalOperationsWithFilter() { + Page operationPage = compute.listGlobalOperations(Compute.OperationListOption.filter( + Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListRegionOperations() { + Page operationPage = compute.listRegionOperations(REGION); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListRegionOperationsWithSelectedFields() { + Page operationPage = compute.listRegionOperations(REGION, + Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListRegionOperationsWithFilter() { + Page operationPage = compute.listRegionOperations(REGION, + Compute.OperationListOption.filter(Compute.OperationFilter.equals( + Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(REGION, operation.getOperationId().getRegion()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListZoneOperations() { + Page operationPage = compute.listZoneOperations(ZONE); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertNotNull(operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testListZoneOperationsWithSelectedFields() { + Page operationPage = compute.listZoneOperations(ZONE, + Compute.OperationListOption.fields(Compute.OperationField.ID)); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + assertNull(operation.getOperationType()); + assertNull(operation.getTargetLink()); + assertNull(operation.getTargetId()); + assertNull(operation.getOperationType()); + assertNull(operation.getStatus()); + assertNull(operation.getStatusMessage()); + assertNull(operation.getUser()); + assertNull(operation.getProgress()); + assertNull(operation.getDescription()); + assertNull(operation.getInsertTime()); + assertNull(operation.getStartTime()); + assertNull(operation.getEndTime()); + assertNull(operation.getWarnings()); + assertNull(operation.getHttpErrorMessage()); + } + } + + @Test + public void testListZoneOperationsWithFilter() { + Page operationPage = compute.listZoneOperations(ZONE, + Compute.OperationListOption.filter(Compute.OperationFilter.equals( + Compute.OperationField.STATUS, "DONE"))); + Iterator operationIterator = operationPage.iterateAll().iterator(); + while (operationIterator.hasNext()) { + Operation operation = operationIterator.next(); + assertNotNull(operation.getGeneratedId()); + assertNotNull(operation.getOperationId()); + assertEquals(ZONE, operation.getOperationId().getZone()); + // todo(mziccard): uncomment or remove once #727 is closed + // assertNotNull(operation.getCreationTimestamp()); + assertNotNull(operation.getOperationType()); + assertEquals(Operation.Status.DONE, operation.getStatus()); + assertNotNull(operation.getUser()); + } + } + + @Test + public void testCreateGetAndDeleteRegionAddress() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-region-address"; + AddressId addressId = RegionAddressId.of(REGION, name); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + // test get + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, remoteAddress.getAddressId().getRegion()); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNotNull(remoteAddress.getAddress()); + assertNotNull(remoteAddress.getCreationTimestamp()); + assertNotNull(remoteAddress.getGeneratedId()); + assertNotNull(remoteAddress.getStatus()); + // test get with selected fields + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, remoteAddress.getAddressId().getRegion()); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNull(remoteAddress.getAddress()); + assertNull(remoteAddress.getCreationTimestamp()); + assertNull(remoteAddress.getGeneratedId()); + operation = remoteAddress.delete(); + operation.waitFor(); + resourceCleaner.remove(addressId); + assertNull(compute.getAddress(addressId)); + } + + @Test + public void testListRegionAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-region-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); + AddressId secondAddressId = RegionAddressId.of(REGION, addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + // test list + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(address.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, address.getAddressId().getRegion()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + // test list with selected fields + count = 0; + addressPage = compute.listRegionAddresses(REGION, Compute.AddressListOption.filter(filter), + Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); + addressIterator = addressPage.iterateAll().iterator(); + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertTrue(address.getAddressId() instanceof RegionAddressId); + assertEquals(REGION, address.getAddressId().getRegion()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testAggregatedListAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "aggregated-list-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = RegionAddressId.of(REGION, addressNames[0]); + AddressId secondAddressId = GlobalAddressId.of(REGION, addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listAddresses(Compute.AddressAggregatedListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-global-address"; + AddressId addressId = GlobalAddressId.of(name); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + // test get + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNotNull(remoteAddress.getAddress()); + assertNotNull(remoteAddress.getCreationTimestamp()); + assertNotNull(remoteAddress.getGeneratedId()); + assertNotNull(remoteAddress.getStatus()); + // test get with selected fields + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); + assertNotNull(remoteAddress); + assertTrue(remoteAddress.getAddressId() instanceof GlobalAddressId); + assertEquals(addressId.getAddress(), remoteAddress.getAddressId().getAddress()); + assertNull(remoteAddress.getAddress()); + assertNull(remoteAddress.getCreationTimestamp()); + assertNull(remoteAddress.getGeneratedId()); + operation = remoteAddress.delete(); + operation.waitFor(); + resourceCleaner.remove(addressId); + assertNull(compute.getAddress(addressId)); + } + + @Test + public void testListGlobalAddresses() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-global-address"; + String[] addressNames = {prefix + "1", prefix + "2"}; + AddressId firstAddressId = GlobalAddressId.of(addressNames[0]); + AddressId secondAddressId = GlobalAddressId.of(addressNames[1]); + Operation firstOperation = compute.create(AddressInfo.of(firstAddressId)); + Operation secondOperation = compute.create(AddressInfo.of(secondAddressId)); + firstOperation.waitFor(); + resourceCleaner.add(firstAddressId); + secondOperation.waitFor(); + resourceCleaner.add(secondAddressId); + Set addressSet = ImmutableSet.copyOf(addressNames); + // test list + Compute.AddressFilter filter = + Compute.AddressFilter.equals(Compute.AddressField.NAME, prefix + "\\d"); + Page
addressPage = + compute.listGlobalAddresses(Compute.AddressListOption.filter(filter)); + Iterator
addressIterator = addressPage.iterateAll().iterator(); + int count = 0; + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertNotNull(address.getAddressId()); + assertTrue(address.getAddressId() instanceof GlobalAddressId); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNotNull(address.getCreationTimestamp()); + assertNotNull(address.getGeneratedId()); + count++; + } + assertEquals(2, count); + // test list with selected fields + count = 0; + addressPage = compute.listGlobalAddresses(Compute.AddressListOption.filter(filter), + Compute.AddressListOption.fields(Compute.AddressField.ADDRESS)); + addressIterator = addressPage.iterateAll().iterator(); + while (addressIterator.hasNext()) { + Address address = addressIterator.next(); + assertTrue(address.getAddressId() instanceof GlobalAddressId); + assertTrue(addressSet.contains(address.getAddressId().getAddress())); + assertNotNull(address.getAddress()); + assertNull(address.getCreationTimestamp()); + assertNull(address.getGeneratedId()); + assertNull(address.getStatus()); + assertNull(address.getUsage()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetResizeAndDeleteStandardDisk() + throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-standard-disk"; + DiskId diskId = DiskId.of(ZONE, name); + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + // test get + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.resize(200L); + operation.waitFor(); + // test resize and get with selected fields + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(200L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(diskId); + assertNull(compute.getDisk(diskId)); + } + + @Test + public void testCreateGetAndDeleteImageDisk() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-image-disk"; + DiskId diskId = DiskId.of(ZONE, name); + DiskInfo diskInfo = DiskInfo.of(diskId, ImageDiskConfiguration.of(IMAGE_ID)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + // test get + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); + ImageDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); + assertNotNull(remoteConfiguration.getSourceImageId()); + assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); + assertNotNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + // test get with selected fields + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(diskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof ImageDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(IMAGE_ID, remoteConfiguration.getSourceImage()); + assertNull(remoteConfiguration.getSourceImageId()); + assertEquals(DiskConfiguration.Type.IMAGE, remoteConfiguration.getType()); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(diskId); + assertNull(compute.getDisk(diskId)); + } + + @Test + public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() + throws InterruptedException, TimeoutException { + String diskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk1"; + String snapshotDiskName = BASE_RESOURCE_NAME + "create-and-get-snapshot-disk2"; + DiskId diskId = DiskId.of(ZONE, diskName); + DiskId snapshotDiskId = DiskId.of(ZONE, snapshotDiskName); + String snapshotName = BASE_RESOURCE_NAME + "create-and-get-snapshot"; + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); + operation.waitFor(); + Disk remoteDisk = compute.getDisk(diskId); + resourceCleaner.add(diskId); + operation = remoteDisk.createSnapshot(snapshotName); + operation.waitFor(); + // test get snapshot with selected fields + Snapshot snapshot = compute.getSnapshot(snapshotName, + Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); + resourceCleaner.add(snapshot.getSnapshotId()); + assertNull(snapshot.getGeneratedId()); + assertNotNull(snapshot.getSnapshotId()); + assertNotNull(snapshot.getCreationTimestamp()); + assertNull(snapshot.getDescription()); + assertNull(snapshot.getStatus()); + assertNull(snapshot.getDiskSizeGb()); + assertNull(snapshot.getLicenses()); + assertNull(snapshot.getSourceDisk()); + assertNull(snapshot.getSourceDiskId()); + assertNull(snapshot.getStorageBytes()); + assertNull(snapshot.getStorageBytesStatus()); + // test get snapshot + snapshot = compute.getSnapshot(snapshotName); + assertNotNull(snapshot.getGeneratedId()); + assertNotNull(snapshot.getSnapshotId()); + assertNotNull(snapshot.getCreationTimestamp()); + assertNotNull(snapshot.getStatus()); + assertEquals(100L, (long) snapshot.getDiskSizeGb()); + assertEquals(diskName, snapshot.getSourceDisk().getDisk()); + assertNotNull(snapshot.getSourceDiskId()); + assertNotNull(snapshot.getStorageBytes()); + assertNotNull(snapshot.getStorageBytesStatus()); + remoteDisk.delete(); + resourceCleaner.remove(diskId); + diskInfo = + DiskInfo.of(snapshotDiskId, SnapshotDiskConfiguration.of(SnapshotId.of(snapshotName))); + operation = compute.create(diskInfo); + operation.waitFor(); + // test get disk + remoteDisk = compute.getDisk(snapshotDiskId); + resourceCleaner.add(snapshotDiskId); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); + SnapshotDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); + assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNotNull(remoteConfiguration.getSourceSnapshotId()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + // test get disk with selected fields + remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); + assertNotNull(remoteDisk); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertEquals(snapshotDiskId.getDisk(), remoteDisk.getDiskId().getDisk()); + assertNull(remoteDisk.getCreationStatus()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof SnapshotDiskConfiguration); + remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.getType()); + assertEquals(snapshotName, remoteConfiguration.getSourceSnapshot().getSnapshot()); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-standard", remoteConfiguration.getDiskType().getType()); + assertNull(remoteDisk.getConfiguration().getSourceSnapshotId()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + operation = remoteDisk.delete(); + operation.waitFor(); + resourceCleaner.remove(snapshotDiskId); + assertNull(compute.getDisk(snapshotDiskId)); + operation = snapshot.delete(); + operation.waitFor(); + resourceCleaner.remove(snapshot.getSnapshotId()); + assertNull(compute.getSnapshot(snapshotName)); + } + + @Test + public void testListDisksAndSnapshots() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-disks-and-snapshots-disk"; + String[] diskNames = {prefix + "1", prefix + "2"}; + DiskId firstDiskId = DiskId.of(ZONE, diskNames[0]); + DiskId secondDiskId = DiskId.of(ZONE, diskNames[1]); + DiskConfiguration configuration = + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); + Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); + Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); + firstOperation.waitFor(); + resourceCleaner.add(firstDiskId); + secondOperation.waitFor(); + resourceCleaner.add(secondDiskId); + Set diskSet = ImmutableSet.copyOf(diskNames); + // test list disks + Compute.DiskFilter diskFilter = + Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); + Page diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter)); + Iterator diskIterator = diskPage.iterateAll().iterator(); + int count = 0; + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + count++; + } + assertEquals(2, count); + // test list disks with selected fields + count = 0; + diskPage = compute.listDisks(ZONE, Compute.DiskListOption.filter(diskFilter), + Compute.DiskListOption.fields(Compute.DiskField.STATUS)); + diskIterator = diskPage.iterateAll().iterator(); + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertEquals(ZONE, remoteDisk.getDiskId().getZone()); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNull(remoteDisk.getCreationTimestamp()); + assertNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertNull(remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + assertNull(remoteDisk.getLastAttachTimestamp()); + assertNull(remoteDisk.getLastDetachTimestamp()); + count++; + } + assertEquals(2, count); + // test snapshots + SnapshotId firstSnapshotId = SnapshotId.of(diskNames[0]); + SnapshotId secondSnapshotId = SnapshotId.of(diskNames[1]); + firstOperation = compute.create(SnapshotInfo.of(firstSnapshotId, firstDiskId)); + secondOperation = compute.create(SnapshotInfo.of(secondSnapshotId, secondDiskId)); + firstOperation.waitFor(); + resourceCleaner.add(firstSnapshotId); + secondOperation.waitFor(); + resourceCleaner.add(secondSnapshotId); + // test list snapshots + Compute.SnapshotFilter snapshotFilter = + Compute.SnapshotFilter.equals(Compute.SnapshotField.NAME, prefix + "\\d"); + Page snapshotPage = + compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter)); + Iterator snapshotIterator = snapshotPage.iterateAll().iterator(); + count = 0; + while (snapshotIterator.hasNext()) { + Snapshot remoteSnapshot = snapshotIterator.next(); + assertNotNull(remoteSnapshot.getGeneratedId()); + assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); + assertNotNull(remoteSnapshot.getCreationTimestamp()); + assertNotNull(remoteSnapshot.getStatus()); + assertEquals(100L, (long) remoteSnapshot.getDiskSizeGb()); + assertTrue(diskSet.contains(remoteSnapshot.getSourceDisk().getDisk())); + assertNotNull(remoteSnapshot.getSourceDiskId()); + assertNotNull(remoteSnapshot.getStorageBytes()); + assertNotNull(remoteSnapshot.getStorageBytesStatus()); + count++; + } + assertEquals(2, count); + // test list snapshots with selected fields + snapshotPage = compute.listSnapshots(Compute.SnapshotListOption.filter(snapshotFilter), + Compute.SnapshotListOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); + snapshotIterator = snapshotPage.iterateAll().iterator(); + count = 0; + while (snapshotIterator.hasNext()) { + Snapshot remoteSnapshot = snapshotIterator.next(); + assertNull(remoteSnapshot.getGeneratedId()); + assertTrue(diskSet.contains(remoteSnapshot.getSnapshotId().getSnapshot())); + assertNotNull(remoteSnapshot.getCreationTimestamp()); + assertNull(remoteSnapshot.getStatus()); + assertNull(remoteSnapshot.getDiskSizeGb()); + assertNull(remoteSnapshot.getSourceDisk()); + assertNull(remoteSnapshot.getSourceDiskId()); + assertNull(remoteSnapshot.getStorageBytes()); + assertNull(remoteSnapshot.getStorageBytesStatus()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testAggregatedListDisks() throws InterruptedException, TimeoutException { + String prefix = BASE_RESOURCE_NAME + "list-aggregated-disk"; + String[] diskZones = {"us-central1-a", "us-east1-c"}; + String[] diskNames = {prefix + "1", prefix + "2"}; + DiskId firstDiskId = DiskId.of(diskZones[0], diskNames[0]); + DiskId secondDiskId = DiskId.of(diskZones[1], diskNames[1]); + DiskConfiguration configuration = + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L); + Operation firstOperation = compute.create(DiskInfo.of(firstDiskId, configuration)); + Operation secondOperation = compute.create(DiskInfo.of(secondDiskId, configuration)); + firstOperation.waitFor(); + resourceCleaner.add(firstDiskId); + secondOperation.waitFor(); + resourceCleaner.add(secondDiskId); + Set zoneSet = ImmutableSet.copyOf(diskZones); + Set diskSet = ImmutableSet.copyOf(diskNames); + Compute.DiskFilter diskFilter = + Compute.DiskFilter.equals(Compute.DiskField.NAME, prefix + "\\d"); + Page diskPage = compute.listDisks(Compute.DiskAggregatedListOption.filter(diskFilter)); + Iterator diskIterator = diskPage.iterateAll().iterator(); + int count = 0; + while (diskIterator.hasNext()) { + Disk remoteDisk = diskIterator.next(); + assertTrue(zoneSet.contains(remoteDisk.getDiskId().getZone())); + assertTrue(diskSet.contains(remoteDisk.getDiskId().getDisk())); + assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.getCreationStatus()); + assertNotNull(remoteDisk.getCreationTimestamp()); + assertNotNull(remoteDisk.getGeneratedId()); + assertTrue(remoteDisk.getConfiguration() instanceof StandardDiskConfiguration); + StandardDiskConfiguration remoteConfiguration = remoteDisk.getConfiguration(); + assertEquals(100L, (long) remoteConfiguration.getSizeGb()); + assertEquals("pd-ssd", remoteConfiguration.getDiskType().getType()); + assertEquals(DiskConfiguration.Type.STANDARD, remoteConfiguration.getType()); + count++; + } + assertEquals(2, count); + } + + @Test + public void testCreateGetAndDeprecateImage() throws InterruptedException, TimeoutException { + String diskName = BASE_RESOURCE_NAME + "create-and-get-image-disk"; + String imageName = BASE_RESOURCE_NAME + "create-and-get-image"; + DiskId diskId = DiskId.of(ZONE, diskName); + ImageId imageId = ImageId.of(imageName); + DiskInfo diskInfo = + DiskInfo.of(diskId, StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd"), 100L)); + Operation operation = compute.create(diskInfo); +operation.waitFor(); + Disk remoteDisk = compute.getDisk(diskId); + ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); + operation = compute.create(imageInfo); +operation.waitFor(); + resourceCleaner.add(diskId); + // test get image with selected fields + Image image = compute.getImage(imageId, + Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); + resourceCleaner.add(imageId); + assertNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNull(image.getDescription()); + assertNotNull(image.getConfiguration()); + assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); + DiskImageConfiguration remoteConfiguration = image.getConfiguration(); + assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); + assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + // test get image + image = compute.getImage(imageId); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertTrue(image.getConfiguration() instanceof DiskImageConfiguration); + remoteConfiguration = image.getConfiguration(); + assertEquals(ImageConfiguration.Type.DISK, remoteConfiguration.getType()); + assertEquals(diskName, remoteConfiguration.getSourceDisk().getDisk()); + assertEquals(100L, (long) image.getDiskSizeGb()); + assertNotNull(image.getStatus()); + assertNull(image.getDeprecationStatus()); + // test deprecate image + DeprecationStatus deprecationStatus = + DeprecationStatus.newBuilder(DeprecationStatus.Status.DEPRECATED, imageId) + .setDeprecated(System.currentTimeMillis()) + .build(); + operation = image.deprecate(deprecationStatus); + operation.waitFor(); + image = compute.getImage(imageId); + assertEquals(deprecationStatus, image.getDeprecationStatus()); + remoteDisk.delete(); + resourceCleaner.remove(diskId); + operation = image.delete(); + operation.waitFor(); + resourceCleaner.remove(imageId); + assertNull(compute.getImage(imageId)); + } + + @Test + public void testListImages() { + Page imagePage = compute.listImages(IMAGE_PROJECT); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNotNull(image.getStatus()); + assertNotNull(image.getDiskSizeGb()); + } + assertTrue(count > 0); + } + + @Test + public void testListImagesWithSelectedFields() { + Page imagePage = + compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.fields(Compute.ImageField.ID)); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNull(image.getStatus()); + assertNull(image.getDiskSizeGb()); + assertNull(image.getLicenses()); + assertNull(image.getDeprecationStatus()); + } + assertTrue(count > 0); + } + + @Test + public void testListImagesWithFilter() { + Page imagePage = compute.listImages(IMAGE_PROJECT, Compute.ImageListOption.filter( + Compute.ImageFilter.equals(Compute.ImageField.ARCHIVE_SIZE_BYTES, 365056004L))); + Iterator imageIterator = imagePage.iterateAll().iterator(); + int count = 0; + while (imageIterator.hasNext()) { + count++; + Image image = imageIterator.next(); + assertNotNull(image.getGeneratedId()); + assertNotNull(image.getImageId()); + assertNotNull(image.getCreationTimestamp()); + assertNotNull(image.getConfiguration()); + assertNotNull(image.getStatus()); + assertNotNull(image.getDiskSizeGb()); + assertEquals(365056004L, + (long) image.getConfiguration().getArchiveSizeBytes()); + } + assertTrue(count > 0); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "create-and-get-network"; + NetworkId networkId = NetworkId.of(name); + NetworkInfo networkInfo = + NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(networkInfo); +operation.waitFor(); + // test get network with selected fields + Network network = compute.getNetwork(networkId.getNetwork(), + Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); + resourceCleaner.add(networkId); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertNull(network.getDescription()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + // test get network + network = compute.getNetwork(networkId.getNetwork()); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + operation = network.delete(); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getNetwork(name)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testListNetworks() throws InterruptedException, TimeoutException { + String name = BASE_RESOURCE_NAME + "list-network"; + NetworkId networkId = NetworkId.of(name); + NetworkInfo networkInfo = + NetworkInfo.of(networkId, StandardNetworkConfiguration.of("192.168.0.0/16")); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + resourceCleaner.add(networkId); + // test list + Compute.NetworkFilter filter = Compute.NetworkFilter.equals(Compute.NetworkField.NAME, name); + Page networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter)); + Iterator networkIterator = networkPage.iterateAll().iterator(); + int count = 0; + while (networkIterator.hasNext()) { + Network network = networkIterator.next(); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + count++; + } + assertEquals(1, count); + // test list with selected fields + count = 0; + networkPage = compute.listNetworks(Compute.NetworkListOption.filter(filter), + Compute.NetworkListOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); + networkIterator = networkPage.iterateAll().iterator(); + while (networkIterator.hasNext()) { + Network network = networkIterator.next(); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertNull(network.getDescription()); + assertEquals(NetworkConfiguration.Type.STANDARD, network.getConfiguration().getType()); + StandardNetworkConfiguration remoteConfiguration = network.getConfiguration(); + assertEquals("192.168.0.0/16", remoteConfiguration.getIpRange()); + count++; + } + assertEquals(1, count); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getNetwork(name)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException { + String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network"; + NetworkId networkId = NetworkId.of(networkName); + NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + // test get network + Network network = compute.getNetwork(networkId.getNetwork()); + resourceCleaner.add(networkId); + assertEquals(networkId.getNetwork(), network.getNetworkId().getNetwork()); + assertNotNull(network.getGeneratedId()); + assertNotNull(network.getCreationTimestamp()); + assertEquals(NetworkConfiguration.Type.SUBNET, network.getConfiguration().getType()); + assertTrue(network.getConfiguration() instanceof SubnetNetworkConfiguration); + assertFalse(network.getConfiguration().autoCreateSubnetworks()); + String subnetworkName = BASE_RESOURCE_NAME + "create-subnetwork-subnetwork"; + SubnetworkId subnetworkId = SubnetworkId.of(REGION, subnetworkName); + SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(subnetworkId, networkId, "192.168.0.0/16"); + operation = compute.create(subnetworkInfo); + operation.waitFor(); + // test get subnetwork with selected fields + Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, + Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); + resourceCleaner.add(subnetworkId); + assertNull(subnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(subnetwork.getCreationTimestamp()); + assertNull(subnetwork.getDescription()); + assertNull(subnetwork.getGatewayAddress()); + assertNull(subnetwork.getNetwork()); + assertNull(subnetwork.getIpRange()); + // test get subnetwork + subnetwork = compute.getSubnetwork(subnetworkId); + assertNotNull(subnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), subnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(subnetwork.getCreationTimestamp()); + assertNotNull(subnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), subnetwork.getNetwork().getNetwork()); + assertEquals("192.168.0.0/16", subnetwork.getIpRange()); + // test list subnetworks + Compute.SubnetworkFilter filter = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, subnetworkName); + Page subnetworkPage = + compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter)); + Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); + int count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNotNull(remoteSubnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), + remoteSubnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNotNull(remoteSubnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); + assertEquals("192.168.0.0/16", remoteSubnetwork.getIpRange()); + count++; + } + assertEquals(1, count); + // test list subnetworks with selected fields + subnetworkPage = compute.listSubnetworks(REGION, Compute.SubnetworkListOption.filter(filter), + Compute.SubnetworkListOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); + subnetworkIterator = subnetworkPage.iterateAll().iterator(); + count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNull(remoteSubnetwork.getGeneratedId()); + assertEquals(subnetworkId.getSubnetwork(), + remoteSubnetwork.getSubnetworkId().getSubnetwork()); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNull(remoteSubnetwork.getDescription()); + assertNull(remoteSubnetwork.getGatewayAddress()); + assertNull(remoteSubnetwork.getNetwork()); + assertNull(remoteSubnetwork.getIpRange()); + count++; + } + assertEquals(1, count); + operation = subnetwork.delete(); + operation.waitFor(); + resourceCleaner.remove(subnetworkId); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getSubnetwork(subnetworkId)); + assertNull(compute.getNetwork(networkName)); + } + + @Ignore("Avoid leaving orphan networks when interrupted: see #2118") + @Test + public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException { + String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network"; + NetworkId networkId = NetworkId.of(networkName); + NetworkInfo networkInfo = NetworkInfo.of(networkId, SubnetNetworkConfiguration.of(false)); + Operation operation = compute.create(networkInfo); + operation.waitFor(); + resourceCleaner.add(networkId); + String prefix = BASE_RESOURCE_NAME + "list-subnetwork"; + String[] regionNames = {"us-central1", "us-east1"}; + String[] subnetworkNames = {prefix + "1", prefix + "2"}; + String[] ipRanges = {"10.128.0.0/20", "10.132.0.0/20"}; + SubnetworkId firstSubnetworkId = SubnetworkId.of(regionNames[0], subnetworkNames[0]); + SubnetworkId secondSubnetworkId = SubnetworkId.of(regionNames[1], subnetworkNames[1]); + SubnetworkInfo firstSubnetworkInfo = + SubnetworkInfo.of(firstSubnetworkId, networkId, ipRanges[0]); + SubnetworkInfo secondSubnetworkInfo = + SubnetworkInfo.of(secondSubnetworkId, networkId, ipRanges[1]); + Operation firstOperation = compute.create(firstSubnetworkInfo); + Operation secondOperation = compute.create(secondSubnetworkInfo); + firstOperation.waitFor(); + resourceCleaner.add(firstSubnetworkId); + secondOperation.waitFor(); + resourceCleaner.add(secondSubnetworkId); + Set regionSet = ImmutableSet.copyOf(regionNames); + Set subnetworkSet = ImmutableSet.copyOf(subnetworkNames); + Set rangeSet = ImmutableSet.copyOf(ipRanges); + Compute.SubnetworkFilter subnetworkFilter = + Compute.SubnetworkFilter.equals(Compute.SubnetworkField.NAME, prefix + "\\d"); + Page subnetworkPage = + compute.listSubnetworks(Compute.SubnetworkAggregatedListOption.filter(subnetworkFilter)); + Iterator subnetworkIterator = subnetworkPage.iterateAll().iterator(); + int count = 0; + while (subnetworkIterator.hasNext()) { + Subnetwork remoteSubnetwork = subnetworkIterator.next(); + assertNotNull(remoteSubnetwork.getGeneratedId()); + assertTrue(regionSet.contains(remoteSubnetwork.getSubnetworkId().getRegion())); + assertTrue(subnetworkSet.contains(remoteSubnetwork.getSubnetworkId().getSubnetwork())); + assertNotNull(remoteSubnetwork.getCreationTimestamp()); + assertNotNull(remoteSubnetwork.getGatewayAddress()); + assertEquals(networkId.getNetwork(), remoteSubnetwork.getNetwork().getNetwork()); + assertTrue(rangeSet.contains(remoteSubnetwork.getIpRange())); + count++; + } + assertEquals(2, count); + firstOperation = compute.deleteSubnetwork(firstSubnetworkId); + secondOperation = compute.deleteSubnetwork(secondSubnetworkId); + firstOperation.waitFor(); + resourceCleaner.remove(firstSubnetworkId); + secondOperation.waitFor(); + resourceCleaner.remove(secondSubnetworkId); + operation = compute.deleteNetwork(networkId); + operation.waitFor(); + resourceCleaner.remove(networkId); + assertNull(compute.getSubnetwork(firstSubnetworkId)); + assertNull(compute.getSubnetwork(secondSubnetworkId)); + assertNull(compute.getNetwork(networkName)); + } + + @Test + public void testCreateGetAndDeleteInstance() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "create-and-get-instance"; + String addressName = BASE_RESOURCE_NAME + "create-and-get-instance-address"; + // Create an address to assign to the instance + AddressId addressId = RegionAddressId.of(REGION, addressName); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation operation = compute.create(addressInfo); + operation.waitFor(); + Address address = compute.getAddress(addressId); + resourceCleaner.add(addressId); + // Create an instance + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId) + .setAccessConfigurations(NetworkInterface.AccessConfig.newBuilder() + .setName("NAT") + .setNatIp(address.getAddress()).build()) + .build(); + AttachedDisk disk1 = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + AttachedDisk disk2 = + AttachedDisk.of("dev1", + AttachedDisk.ScratchDiskConfiguration.of(DiskTypeId.of(ZONE, DISK_TYPE))); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, "n1-standard-1")) + .setAttachedDisks(disk1, disk2) + .setNetworkInterfaces(networkInterface) + .build(); + operation = compute.create(instanceInfo); + operation.waitFor(); + // test get + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); + assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); + assertEquals(ZONE, remoteInstance.getMachineType().getZone()); + assertNotNull(remoteInstance.getCreationTimestamp()); + Set deviceSet = ImmutableSet.of("dev0", "dev1"); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + } + assertEquals(AttachedDisk.AttachedDiskConfiguration.Type.PERSISTENT, + remoteInstance.getAttachedDisks().get(0).getConfiguration().getType()); + AttachedDisk.PersistentDiskConfiguration remoteConfiguration = + remoteInstance.getAttachedDisks().get(0).getConfiguration(); + assertEquals(instanceName, remoteConfiguration.getSourceDisk().getDisk()); + assertEquals(ZONE, remoteConfiguration.getSourceDisk().getZone()); + assertTrue(remoteConfiguration.boot()); + assertTrue(remoteConfiguration.autoDelete()); + assertEquals(1, remoteInstance.getNetworkInterfaces().size()); + NetworkInterface remoteNetworkInterface = remoteInstance.getNetworkInterfaces().get(0); + assertNotNull(remoteNetworkInterface.getName()); + assertEquals("default", remoteNetworkInterface.getNetwork().getNetwork()); + List remoteAccessConfigurations = + remoteNetworkInterface.getAccessConfigurations(); + assertNotNull(remoteAccessConfigurations); + assertEquals(1, remoteAccessConfigurations.size()); + NetworkInterface.AccessConfig remoteAccessConfig = remoteAccessConfigurations.get(0); + assertEquals(address.getAddress(), remoteAccessConfig.getNatIp()); + assertEquals("NAT", remoteAccessConfig.getName()); + assertNotNull(remoteInstance.getMetadata()); + assertNotNull(remoteInstance.getTags()); + // test get with selected fields + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); + assertEquals(instanceName, remoteInstance.getInstanceId().getInstance()); + assertEquals(ZONE, remoteInstance.getInstanceId().getZone()); + assertNull(remoteInstance.getMachineType()); + assertNotNull(remoteInstance.getCreationTimestamp()); + assertNull(remoteInstance.getAttachedDisks()); + assertNull(remoteInstance.getNetworkInterfaces()); + assertNull(remoteInstance.getMetadata()); + assertNull(remoteInstance.getTags()); + // test get default serial port output + String serialPortOutput = remoteInstance.getSerialPortOutput(); + assertNotNull(serialPortOutput); + // test get serial port output by number + String newSerialPortOutput = remoteInstance.getSerialPortOutput(1); + assertTrue(newSerialPortOutput.contains(serialPortOutput)); + operation = remoteInstance.delete(); + operation.waitFor(); + resourceCleaner.remove(instanceId); + assertNull(compute.getInstance(instanceId)); + } + + @Test + public void testStartStopAndResetInstance() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "start-stop-reset-instance"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation operation = compute.create(instanceInfo); + operation.waitFor(); + Instance remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + resourceCleaner.add(instanceId); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + operation = remoteInstance.stop(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.getStatus()); + operation = remoteInstance.start(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + operation = remoteInstance.reset(); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.getStatus()); + } + + @Test + public void testSetInstanceProperties() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "set-properties-instance"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation operation = compute.create(instanceInfo); + operation.waitFor(); + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + // test set tags + List tags = ImmutableList.of("tag1", "tag2"); + operation = remoteInstance.setTags(tags); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(tags, remoteInstance.getTags().getValues()); + // test set metadata + Map metadata = ImmutableMap.of("key", "value"); + operation = remoteInstance.setMetadata(metadata); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(metadata, remoteInstance.getMetadata().getValues()); + // test set machine type + operation = remoteInstance.stop(); + operation.waitFor(); + operation = remoteInstance.setMachineType(MachineTypeId.of(ZONE, "n1-standard-1")); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals("n1-standard-1", remoteInstance.getMachineType().getType()); + assertEquals(ZONE, remoteInstance.getMachineType().getZone()); + // test set scheduling options + SchedulingOptions options = + SchedulingOptions.standard(false, SchedulingOptions.Maintenance.TERMINATE); + operation = remoteInstance.setSchedulingOptions(options); + operation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(options, remoteInstance.getSchedulingOptions()); + } + + @Test + public void testAttachAndDetachDisk() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "attach-and-detach-disk-instance"; + String diskName = BASE_RESOURCE_NAME + "attach-and-detach-disk"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation instanceOperation = compute.create(instanceInfo); + DiskId diskId = DiskId.of(ZONE, diskName); + Operation diskOperation = compute.create(DiskInfo.of(diskId, + StandardDiskConfiguration.of(DiskTypeId.of(ZONE, "pd-ssd")))); + instanceOperation.waitFor(); + diskOperation.waitFor(); + resourceCleaner.add(diskId); + Instance remoteInstance = compute.getInstance(instanceId); + // test attach disk + instanceOperation = remoteInstance.attachDisk("dev1", + AttachedDisk.PersistentDiskConfiguration.newBuilder(diskId).build()); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + Set deviceSet = ImmutableSet.of("dev0", "dev1"); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + } + // test set disk auto-delete + instanceOperation = remoteInstance.setDiskAutoDelete("dev1", true); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(2, remoteInstance.getAttachedDisks().size()); + for (AttachedDisk remoteAttachedDisk : remoteInstance.getAttachedDisks()) { + assertTrue(deviceSet.contains(remoteAttachedDisk.getDeviceName())); + assertTrue(remoteAttachedDisk.getConfiguration().autoDelete()); + } + // test detach disk + instanceOperation = remoteInstance.detachDisk("dev1"); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertEquals(1, remoteInstance.getAttachedDisks().size()); + assertEquals("dev0", remoteInstance.getAttachedDisks().get(0).getDeviceName()); + } + + @Test + public void testAddAndRemoveAccessConfig() throws InterruptedException, TimeoutException { + String instanceName = BASE_RESOURCE_NAME + "add-and-remove-access-instance"; + String addressName = BASE_RESOURCE_NAME + "add-and-remove-access-address"; + InstanceId instanceId = InstanceId.of(ZONE, instanceName); + NetworkId networkId = NetworkId.of("default"); + NetworkInterface networkInterface = NetworkInterface.newBuilder(networkId).build(); + AttachedDisk disk = AttachedDisk.of("dev0", + AttachedDisk.CreateDiskConfiguration.newBuilder(IMAGE_ID).setAutoDelete(true).build()); + InstanceInfo instanceInfo = + InstanceInfo.newBuilder(instanceId, MachineTypeId.of(ZONE, MACHINE_TYPE)) + .setAttachedDisks(disk) + .setNetworkInterfaces(networkInterface) + .build(); + Operation instanceOperation = compute.create(instanceInfo); + AddressId addressId = RegionAddressId.of(REGION, addressName); + AddressInfo addressInfo = AddressInfo.of(addressId); + Operation addressOperation = compute.create(addressInfo); + addressOperation.waitFor(); + instanceOperation.waitFor(); + Address remoteAddress = compute.getAddress(addressId); + resourceCleaner.add(addressId); + Instance remoteInstance = compute.getInstance(instanceId); + resourceCleaner.add(instanceId); + String networkInterfaceName = remoteInstance.getNetworkInterfaces().get(0).getName(); + // test add access config + NetworkInterface.AccessConfig accessConfig = NetworkInterface.AccessConfig.newBuilder() + .setNatIp(remoteAddress.getAddress()) + .setName("NAT") + .build(); + instanceOperation = remoteInstance.addAccessConfig(networkInterfaceName, accessConfig); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + List accessConfigurations = + remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations(); + assertEquals(1, accessConfigurations.size()); + assertEquals("NAT", accessConfigurations.get(0).getName()); + // test delete access config + instanceOperation = remoteInstance.deleteAccessConfig(networkInterfaceName, "NAT"); + instanceOperation.waitFor(); + remoteInstance = compute.getInstance(instanceId); + assertTrue(remoteInstance.getNetworkInterfaces().get(0).getAccessConfigurations().isEmpty()); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java new file mode 100644 index 000000000000..9c4a1960da0f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/deprecated/testing/RemoteComputeHelperTest.java @@ -0,0 +1,102 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.compute.deprecated.testing; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.http.HttpTransportOptions; +import com.google.cloud.compute.deprecated.ComputeOptions; +import com.google.cloud.compute.deprecated.testing.RemoteComputeHelper.ComputeHelperException; + +import org.threeten.bp.Duration; +import org.junit.Test; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.regex.Pattern; +import org.junit.Test; + +public class RemoteComputeHelperTest { + + private static final String PROJECT_ID = "project-id"; + private static final String JSON_KEY = "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\"\n" + + "}"; + private static final InputStream JSON_KEY_STREAM = new ByteArrayInputStream(JSON_KEY.getBytes()); + private static final String BASE_RESOURCE_NAME_REGEX = "test-[0-9a-f]{24}-"; + private static final Pattern BASE_RESOURCE_NAME_PATTERN = + Pattern.compile(BASE_RESOURCE_NAME_REGEX); + + @Test + public void testBaseResourceName() { + String baseResourceName = RemoteComputeHelper.baseResourceName(); + assertTrue(BASE_RESOURCE_NAME_PATTERN.matcher(baseResourceName).matches()); + } + + @Test + public void testCreateFromStream() { + RemoteComputeHelper helper = RemoteComputeHelper.create(PROJECT_ID, JSON_KEY_STREAM); + ComputeOptions options = helper.getOptions(); + assertEquals(PROJECT_ID, options.getProjectId()); + assertEquals(60000, + ((HttpTransportOptions) options.getTransportOptions()).getConnectTimeout()); + assertEquals(60000, + ((HttpTransportOptions) options.getTransportOptions()).getReadTimeout()); + assertEquals(10, options.getRetrySettings().getMaxAttempts()); + assertEquals(Duration.ofMillis(30000), options.getRetrySettings().getMaxRetryDelay()); + assertEquals(Duration.ofMillis(120000), options.getRetrySettings().getTotalTimeout()); + assertEquals(Duration.ofMillis(250), options.getRetrySettings().getInitialRetryDelay()); + } + + @Test + public void testComputeHelperException() { + ComputeHelperException exception = new ComputeHelperException("message", null); + assertEquals("message", exception.getMessage()); + assertNull(exception.getCause()); + IOException cause = new IOException("message"); + exception = ComputeHelperException.translate(cause); + assertEquals("message", exception.getMessage()); + assertSame(cause, exception.getCause()); + } +} From 3b84a2f7a329c8b986cb6a6e859d8b45e926605c Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 1 Jun 2018 15:18:33 -0700 Subject: [PATCH 41/42] add gax-httpjson test dep to google-cloud-compute pom --- google-cloud-clients/google-cloud-compute/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index 854684f2568c..bb9eecf41dc2 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -58,5 +58,11 @@ objenesis test + + com.google.api + gax-httpjson + testlib + test + From aaf79d0abf75bf93110b5f75142430090ed65a16 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Fri, 1 Jun 2018 15:20:47 -0700 Subject: [PATCH 42/42] add gax:testlib to compute, and update version in bom --- google-cloud-bom/pom.xml | 2 +- google-cloud-clients/google-cloud-compute/pom.xml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 30565e144543..804cb337c751 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -155,7 +155,7 @@ com.google.api gax - 1.25.0 + 1.27.0 testlib diff --git a/google-cloud-clients/google-cloud-compute/pom.xml b/google-cloud-clients/google-cloud-compute/pom.xml index bb9eecf41dc2..c7c4b4143f41 100644 --- a/google-cloud-clients/google-cloud-compute/pom.xml +++ b/google-cloud-clients/google-cloud-compute/pom.xml @@ -64,5 +64,11 @@ testlib test + + com.google.api + gax + testlib + test +